Built motion from commit a59e49a3.|2.5.50
authorAndrea Amorese <andrea.amorese@xenialab.it>
Mon, 14 Feb 2022 16:50:58 +0000 (17:50 +0100)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Mon, 14 Feb 2022 16:50:58 +0000 (17:50 +0100)
1313 files changed:
apidoc/api_data.js
apidoc/api_data.json
apidoc/api_project.js
apidoc/api_project.json
package.json
public/app/main/apps/contactmanager/i18n/ar.json
public/app/main/apps/contactmanager/i18n/cs.json
public/app/main/apps/contactmanager/i18n/da.json
public/app/main/apps/contactmanager/i18n/de.json
public/app/main/apps/contactmanager/i18n/en.json
public/app/main/apps/contactmanager/i18n/es.json
public/app/main/apps/contactmanager/i18n/et.json
public/app/main/apps/contactmanager/i18n/fa.json
public/app/main/apps/contactmanager/i18n/fi.json
public/app/main/apps/contactmanager/i18n/fr.json
public/app/main/apps/contactmanager/i18n/he.json
public/app/main/apps/contactmanager/i18n/hi.json
public/app/main/apps/contactmanager/i18n/hu.json
public/app/main/apps/contactmanager/i18n/id.json
public/app/main/apps/contactmanager/i18n/it.json
public/app/main/apps/contactmanager/i18n/ja.json
public/app/main/apps/contactmanager/i18n/ko.json
public/app/main/apps/contactmanager/i18n/lt.json
public/app/main/apps/contactmanager/i18n/lv.json
public/app/main/apps/contactmanager/i18n/nl.json
public/app/main/apps/contactmanager/i18n/no.json
public/app/main/apps/contactmanager/i18n/pl.json
public/app/main/apps/contactmanager/i18n/pt-BR.json
public/app/main/apps/contactmanager/i18n/pt-PT.json
public/app/main/apps/contactmanager/i18n/ru.json
public/app/main/apps/contactmanager/i18n/sv.json
public/app/main/apps/contactmanager/i18n/tr.json
public/app/main/apps/contactmanager/i18n/zh-CN.json
public/app/main/apps/contactmanager/i18n/zh-TW.json
public/app/main/apps/motiondialer/i18n/ar.json
public/app/main/apps/motiondialer/i18n/cs.json
public/app/main/apps/motiondialer/i18n/da.json
public/app/main/apps/motiondialer/i18n/de.json
public/app/main/apps/motiondialer/i18n/en.json
public/app/main/apps/motiondialer/i18n/es.json
public/app/main/apps/motiondialer/i18n/et.json
public/app/main/apps/motiondialer/i18n/fa.json
public/app/main/apps/motiondialer/i18n/fi.json
public/app/main/apps/motiondialer/i18n/fr.json
public/app/main/apps/motiondialer/i18n/he.json
public/app/main/apps/motiondialer/i18n/hi.json
public/app/main/apps/motiondialer/i18n/hu.json
public/app/main/apps/motiondialer/i18n/id.json
public/app/main/apps/motiondialer/i18n/it.json
public/app/main/apps/motiondialer/i18n/ja.json
public/app/main/apps/motiondialer/i18n/ko.json
public/app/main/apps/motiondialer/i18n/lt.json
public/app/main/apps/motiondialer/i18n/lv.json
public/app/main/apps/motiondialer/i18n/nl.json
public/app/main/apps/motiondialer/i18n/no.json
public/app/main/apps/motiondialer/i18n/pl.json
public/app/main/apps/motiondialer/i18n/pt-BR.json
public/app/main/apps/motiondialer/i18n/pt-PT.json
public/app/main/apps/motiondialer/i18n/ru.json
public/app/main/apps/motiondialer/i18n/sv.json
public/app/main/apps/motiondialer/i18n/tr.json
public/app/main/apps/motiondialer/i18n/zh-CN.json
public/app/main/apps/motiondialer/i18n/zh-TW.json
public/app/main/apps/tools/i18n/ar.json
public/app/main/apps/tools/i18n/cs.json
public/app/main/apps/tools/i18n/da.json
public/app/main/apps/tools/i18n/de.json
public/app/main/apps/tools/i18n/en.json
public/app/main/apps/tools/i18n/es.json
public/app/main/apps/tools/i18n/et.json
public/app/main/apps/tools/i18n/fa.json
public/app/main/apps/tools/i18n/fi.json
public/app/main/apps/tools/i18n/fr.json
public/app/main/apps/tools/i18n/he.json
public/app/main/apps/tools/i18n/hi.json
public/app/main/apps/tools/i18n/hu.json
public/app/main/apps/tools/i18n/id.json
public/app/main/apps/tools/i18n/it.json
public/app/main/apps/tools/i18n/ja.json
public/app/main/apps/tools/i18n/ko.json
public/app/main/apps/tools/i18n/lt.json
public/app/main/apps/tools/i18n/lv.json
public/app/main/apps/tools/i18n/nl.json
public/app/main/apps/tools/i18n/no.json
public/app/main/apps/tools/i18n/pl.json
public/app/main/apps/tools/i18n/pt-BR.json
public/app/main/apps/tools/i18n/pt-PT.json
public/app/main/apps/tools/i18n/ru.json
public/app/main/apps/tools/i18n/sv.json
public/app/main/apps/tools/i18n/tr.json
public/app/main/apps/tools/i18n/zh-CN.json
public/app/main/apps/tools/i18n/zh-TW.json
public/app/toolbar/i18n/ar.json
public/app/toolbar/i18n/cs.json
public/app/toolbar/i18n/da.json
public/app/toolbar/i18n/de.json
public/app/toolbar/i18n/en.json
public/app/toolbar/i18n/es.json
public/app/toolbar/i18n/et.json
public/app/toolbar/i18n/fa.json
public/app/toolbar/i18n/fi.json
public/app/toolbar/i18n/fr.json
public/app/toolbar/i18n/he.json
public/app/toolbar/i18n/hi.json
public/app/toolbar/i18n/hu.json
public/app/toolbar/i18n/id.json
public/app/toolbar/i18n/it.json
public/app/toolbar/i18n/ja.json
public/app/toolbar/i18n/ko.json
public/app/toolbar/i18n/lt.json
public/app/toolbar/i18n/lv.json
public/app/toolbar/i18n/nl.json
public/app/toolbar/i18n/no.json
public/app/toolbar/i18n/pl.json
public/app/toolbar/i18n/pt-BR.json
public/app/toolbar/i18n/pt-PT.json
public/app/toolbar/i18n/ru.json
public/app/toolbar/i18n/sv.json
public/app/toolbar/i18n/tr.json
public/app/toolbar/i18n/zh-CN.json
public/app/toolbar/i18n/zh-TW.json
public/index.html
public/scripts/app.d1d6b36c.js [moved from public/scripts/app.4e198ed1.js with 53% similarity]
public/styles/app.e921fbc9.css [moved from public/styles/app.6bed6274.css with 87% 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/cmContactHasItem/cmContactHasItem.attributes.js [deleted file]
server/api/cmContactHasItem/cmContactHasItem.controller.js [deleted file]
server/api/cmContactHasItem/cmContactHasItem.model.js [deleted file]
server/api/cmContactHasItem/cmContactHasItem.rpc.js [deleted file]
server/api/cmContactHasItem/index.js [deleted file]
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/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js [deleted file]
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js [deleted file]
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js [deleted file]
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js [deleted file]
server/api/cmHopperAdditionalPhone/index.js [deleted file]
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/contactItemType/contactItemType.attributes.js [deleted file]
server/api/contactItemType/contactItemType.controller.js [deleted file]
server/api/contactItemType/contactItemType.model.js [deleted file]
server/api/contactItemType/contactItemType.rpc.js [deleted file]
server/api/contactItemType/index.js [deleted file]
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/import/cm/csvUpdates.js [deleted file]
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.27.js
server/migrations/2.6.0.js [deleted file]
server/migrations/2.6.1.js [deleted file]
server/migrations/2.6.2.js [deleted file]
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/additionalPhone.js [deleted file]
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/cmHopperAdditionalPhone.js [deleted file]
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 de8944d..dac56d8 100644 (file)
@@ -2496,6 +2496,24 @@ define({ "api": [
     "groupTitle": "Chat_Interactions"
   },
   {
+    "type": "put",
+    "url": "/api/chat/interactions/{id}/close",
+    "title": "Close Interaction",
+    "examples": [
+      {
+        "title": "Example usage:",
+        "content": "curl https://{domain}/api/chat/interactions/{id}/close -d '[{\"to\": \"+3901119886500\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
+        "type": "json"
+      }
+    ],
+    "name": "addMessage",
+    "group": "Chat_Interactions",
+    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "version": "0.0.0",
+    "filename": "server/api/chatInteraction/index.js",
+    "groupTitle": "Chat_Interactions"
+  },
+  {
     "type": "post",
     "url": "/api/chat/interactions/{id}/messages",
     "title": "Creates new messages",
@@ -2573,24 +2591,6 @@ define({ "api": [
     "groupTitle": "Chat_Interactions"
   },
   {
-    "type": "put",
-    "url": "/api/chat/interactions/{id}/close",
-    "title": "Close Interaction",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/chat/interactions/{id}/close -d '[{\"to\": \"+3901119886500\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "addMessage",
-    "group": "Chat_Interactions",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/chatInteraction/index.js",
-    "groupTitle": "Chat_Interactions"
-  },
-  {
     "type": "post",
     "url": "/api/chat/interactions/{id}/attachment_upload",
     "title": "Add attachment",
@@ -5620,324 +5620,6 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/cm_contact_has_items",
-    "title": "Creates a new CmContactHasItem",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items -d '{\"key1\": \"valu1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "CreateCmContactHasItems",
-    "group": "CmContactHasItems",
-    "parameter": {
-      "fields": {
-        "Body": [
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "CmContactId",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "item",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "ItemTypeId",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "ItemClass",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "OrderBy",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "description",
-            "description": ""
-          }
-        ]
-      }
-    },
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "delete",
-    "url": "/api/cm_contact_has_items/{id}",
-    "title": "Deletes a CmContactHasItem",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items/{id} -v -u {name}:{password} -X DELETE",
-        "type": "json"
-      }
-    ],
-    "name": "DeleteCmContactHasItems",
-    "group": "CmContactHasItems",
-    "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm_contact_has_items",
-    "title": "Gets a list of CmContactHasItems",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "GetCmContactHasItems",
-    "group": "CmContactHasItems",
-    "description": "<p>Motion will always return paged results. Motion returns paging data in the <code>Content-Range</code> header in the form start - end / total.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned otherwise it will return a HTTP status code <code>206</code> Partial Content.</p> <p>Motion renders the resulting JSON representation in the response body.</p> <h2>Retrieving Specific Fields</h2> <p>To return only specific fields for a result set you can utilize the <code>fields</code> parameter. This parameter accepts a comma-separated list.</p> <p>A call returning only <code>id</code> and <code>name</code> for a result set would look like this.</p> <p><code>GET /api/cm_contact_has_items?fields=id,name</code></p> <h2>Filtering</h2> <p>You can perform exact-match filtering on any of a model's fields by using the field name as the key and supplying it with a value. These parameters accept a comma-separated list.</p> <p>A call returning a result set for records with <code>name</code> of <code>john.doe</code> or <code>jane.miller</code>.</p> <p><code>GET /api/cm_contact_has_items?name=john.doe,jane.miller</code></p> <p>If you use the key <code>filter</code> the result will be filtered by the value you specify.</p> <p><code>GET /api/cm_contact_has_items?filter=john</code></p> <h2>Sorting</h2> <p>To sort a result set based on one or several fields you can utilize the <code>sort</code> parameter. This parameters accepts a comma-separated list.</p> <p>Results will be sorted in the order of the fields provided. The default sorting order for fields is ascending. Fields can be sorted in descending order by prefixing them with a dash (<code>-</code>).</p> <p>A call sorting a result by <code>id</code> ascending and then <code>name</code> descending would look like this.</p> <p><code>GET /api/cm_contact_has_items?sort=id,-name</code></p> <h2>Offset and Limit</h2> <p>Query results are always paged. Motion leverages the <code>offset</code> and <code>limit</code> parameters to facilitate this.</p> <p>When the neither of these parameters are explicitly supplied the handler will assume the a default <code>limit</code> of <code>100</code>.</p> <p><code>offset</code> is a number indicating the start position in the result set you want to return.</p> <p><code>limit</code> is a number indicating how many records past the start position you want returned.</p> <p>A call with a result set starting at <code>5</code> and returning no more than <code>25</code> records would look like this.</p> <p><code>GET /api/cm_contact_has_items?offset=5&amp;limit=25</code></p> <p>If there were <code>50</code> records in total, the returned <code>Content-Range</code> header would look like this.</p> <p><code>Content-Range: 5-30/50</code></p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm_contact_has_items/{id}",
-    "title": "Gets a single CmContactHasItem",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items/{id} -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "ShowCmContactHasItems",
-    "group": "CmContactHasItems",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "put",
-    "url": "/api/cm_contact_has_items/{id}",
-    "title": "Update an existing CmContactHasItem",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items/{id} -d '{\"key1\": \"value1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X PUT",
-        "type": "json"
-      }
-    ],
-    "name": "updateCmContactHasItems",
-    "group": "CmContactHasItems",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "post",
-    "url": "/api/cm_hopper_additional_phones",
-    "title": "Creates a new CmHopperAdditionalPhone",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones -d '{\"key1\": \"valu1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "CreateCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "parameter": {
-      "fields": {
-        "Body": [
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "CmHopperId",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": false,
-            "field": "phone",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "OrderBy",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "scheduledat",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countbusyretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countcongestionretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countnoanswerretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countnosuchnumberretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countdropretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countabandonedretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countmachineretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countagentrejectretry",
-            "description": ""
-          }
-        ]
-      }
-    },
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "delete",
-    "url": "/api/cm_hopper_additional_phones/{id}",
-    "title": "Deletes a CmHopperAdditionalPhone",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones/{id} -v -u {name}:{password} -X DELETE",
-        "type": "json"
-      }
-    ],
-    "name": "DeleteCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm_hopper_additional_phones",
-    "title": "Gets a list of CmHopperAdditionalPhones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "GetCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "description": "<p>Motion will always return paged results. Motion returns paging data in the <code>Content-Range</code> header in the form start - end / total.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned otherwise it will return a HTTP status code <code>206</code> Partial Content.</p> <p>Motion renders the resulting JSON representation in the response body.</p> <h2>Retrieving Specific Fields</h2> <p>To return only specific fields for a result set you can utilize the <code>fields</code> parameter. This parameter accepts a comma-separated list.</p> <p>A call returning only <code>id</code> and <code>name</code> for a result set would look like this.</p> <p><code>GET /api/cm_hopper_additional_phones?fields=id,name</code></p> <h2>Filtering</h2> <p>You can perform exact-match filtering on any of a model's fields by using the field name as the key and supplying it with a value. These parameters accept a comma-separated list.</p> <p>A call returning a result set for records with <code>name</code> of <code>john.doe</code> or <code>jane.miller</code>.</p> <p><code>GET /api/cm_hopper_additional_phones?name=john.doe,jane.miller</code></p> <p>If you use the key <code>filter</code> the result will be filtered by the value you specify.</p> <p><code>GET /api/cm_hopper_additional_phones?filter=john</code></p> <h2>Sorting</h2> <p>To sort a result set based on one or several fields you can utilize the <code>sort</code> parameter. This parameters accepts a comma-separated list.</p> <p>Results will be sorted in the order of the fields provided. The default sorting order for fields is ascending. Fields can be sorted in descending order by prefixing them with a dash (<code>-</code>).</p> <p>A call sorting a result by <code>id</code> ascending and then <code>name</code> descending would look like this.</p> <p><code>GET /api/cm_hopper_additional_phones?sort=id,-name</code></p> <h2>Offset and Limit</h2> <p>Query results are always paged. Motion leverages the <code>offset</code> and <code>limit</code> parameters to facilitate this.</p> <p>When the neither of these parameters are explicitly supplied the handler will assume the a default <code>limit</code> of <code>100</code>.</p> <p><code>offset</code> is a number indicating the start position in the result set you want to return.</p> <p><code>limit</code> is a number indicating how many records past the start position you want returned.</p> <p>A call with a result set starting at <code>5</code> and returning no more than <code>25</code> records would look like this.</p> <p><code>GET /api/cm_hopper_additional_phones?offset=5&amp;limit=25</code></p> <p>If there were <code>50</code> records in total, the returned <code>Content-Range</code> header would look like this.</p> <p><code>Content-Range: 5-30/50</code></p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm_hopper_additional_phones/{id}",
-    "title": "Gets a single CmHopperAdditionalPhone",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones/{id} -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "ShowCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "put",
-    "url": "/api/cm_hopper_additional_phones/{id}",
-    "title": "Update an existing CmHopperAdditionalPhone",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones/{id} -d '{\"key1\": \"value1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X PUT",
-        "type": "json"
-      }
-    ],
-    "name": "updateCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "post",
     "url": "/api/cm/companies",
     "title": "Creates a new Company",
     "examples": [
@@ -6538,42 +6220,6 @@ define({ "api": [
     "groupTitle": "Cm_Contacts"
   },
   {
-    "type": "post",
-    "url": "/api/cm/contacts/{id}/duplicatePhones",
-    "title": "Sets new contact additional phones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/{id}/duplicateAdditionalPhones -d '{\"phones\": [p1,p2]}' -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "duplicateAdditionalPhones",
-    "group": "Cm_Contacts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_Contacts"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm/contacts/{id}/phones",
-    "title": "Gets contact phones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/{id}/phones -v -u {name}:{password} -X GET",
-        "type": "json"
-      }
-    ],
-    "name": "getAdditionalPhones",
-    "group": "Cm_Contacts",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_Contacts"
-  },
-  {
     "type": "get",
     "url": "/api/cm/contacts/{id}/journey",
     "title": "Gets customer journey",
@@ -6647,42 +6293,6 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/cm/contacts/{id}/rescheduleAdditionalPhones",
-    "title": "Sets new contact additional phones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/{id}/rescheduleAdditionalPhones -d '{\"phones\": [p1,p2]}' -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "rescheduleAdditionalPhones",
-    "group": "Cm_Contacts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_Contacts"
-  },
-  {
-    "type": "post",
-    "url": "/api/cm/contacts/{id}/phones",
-    "title": "Sets new contact phones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/{id}/phones -d '{\"phones\": [p1,p2]}' -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "setAdditionalPhones",
-    "group": "Cm_Contacts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_Contacts"
-  },
-  {
-    "type": "post",
     "url": "/api/cm/contacts/{id}/tags",
     "title": "Sets new tags",
     "examples": [
@@ -6972,13 +6582,6 @@ define({ "api": [
           },
           {
             "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "OrderBy",
-            "description": ""
-          },
-          {
-            "group": "Body",
             "type": "String",
             "optional": true,
             "field": "dialTimezone",
@@ -8287,24 +7890,6 @@ define({ "api": [
   },
   {
     "type": "get",
-    "url": "/api/cm/lists/global_fields",
-    "title": "Gets GLOBAL Custom Fields",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/lists/global_fields -v -u {name}:{password} -X GET",
-        "type": "json"
-      }
-    ],
-    "name": "getGlobalCustomFields",
-    "group": "Cm_Lists",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmList/index.js",
-    "groupTitle": "Cm_Lists"
-  },
-  {
-    "type": "get",
     "url": "/api/cm/lists/{id}/contacts/csv",
     "title": "Gets CSV List Contacts",
     "examples": [
@@ -8359,24 +7944,6 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/cm/contacts/uploadUpdates/:id",
-    "title": "Import existing contacts by csv",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/uploadUpdates/:id -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "importUpdates",
-    "group": "Cm_contacts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_contacts"
-  },
-  {
-    "type": "post",
     "url": "/api/cm/contacts/upload",
     "title": "Upload csv",
     "examples": [
@@ -8449,123 +8016,6 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/contact_item_types",
-    "title": "Creates a new ContactItemType",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types -d '{\"key1\": \"valu1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "CreateContactItemTypes",
-    "group": "ContactItemType",
-    "parameter": {
-      "fields": {
-        "Body": [
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": false,
-            "field": "name",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "OrderBy",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "rgbBackgroundColor",
-            "description": ""
-          }
-        ]
-      }
-    },
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "delete",
-    "url": "/api/contact_item_types/{id}",
-    "title": "Deletes a ContactItemType",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types/{id} -v -u {name}:{password} -X DELETE",
-        "type": "json"
-      }
-    ],
-    "name": "DeleteContactItemTypes",
-    "group": "ContactItemType",
-    "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "get",
-    "url": "/api/contact_item_types",
-    "title": "Gets a list of ContactItemTypes",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "GetContactItemTypes",
-    "group": "ContactItemType",
-    "description": "<p>Motion will always return paged results. Motion returns paging data in the <code>Content-Range</code> header in the form start - end / total.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned otherwise it will return a HTTP status code <code>206</code> Partial Content.</p> <p>Motion renders the resulting JSON representation in the response body.</p> <h2>Retrieving Specific Fields</h2> <p>To return only specific fields for a result set you can utilize the <code>fields</code> parameter. This parameter accepts a comma-separated list.</p> <p>A call returning only <code>id</code> and <code>name</code> for a result set would look like this.</p> <p><code>GET /api/contact_item_types?fields=id,name</code></p> <h2>Filtering</h2> <p>You can perform exact-match filtering on any of a model's fields by using the field name as the key and supplying it with a value. These parameters accept a comma-separated list.</p> <p>A call returning a result set for records with <code>name</code> of <code>john.doe</code> or <code>jane.miller</code>.</p> <p><code>GET /api/contact_item_types?name=john.doe,jane.miller</code></p> <p>If you use the key <code>filter</code> the result will be filtered by the value you specify.</p> <p><code>GET /api/contact_item_types?filter=john</code></p> <h2>Sorting</h2> <p>To sort a result set based on one or several fields you can utilize the <code>sort</code> parameter. This parameters accepts a comma-separated list.</p> <p>Results will be sorted in the order of the fields provided. The default sorting order for fields is ascending. Fields can be sorted in descending order by prefixing them with a dash (<code>-</code>).</p> <p>A call sorting a result by <code>id</code> ascending and then <code>name</code> descending would look like this.</p> <p><code>GET /api/contact_item_types?sort=id,-name</code></p> <h2>Offset and Limit</h2> <p>Query results are always paged. Motion leverages the <code>offset</code> and <code>limit</code> parameters to facilitate this.</p> <p>When the neither of these parameters are explicitly supplied the handler will assume the a default <code>limit</code> of <code>100</code>.</p> <p><code>offset</code> is a number indicating the start position in the result set you want to return.</p> <p><code>limit</code> is a number indicating how many records past the start position you want returned.</p> <p>A call with a result set starting at <code>5</code> and returning no more than <code>25</code> records would look like this.</p> <p><code>GET /api/contact_item_types?offset=5&amp;limit=25</code></p> <p>If there were <code>50</code> records in total, the returned <code>Content-Range</code> header would look like this.</p> <p><code>Content-Range: 5-30/50</code></p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "get",
-    "url": "/api/contact_item_types/{id}",
-    "title": "Gets a single ContactItemType",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types/{id} -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "ShowContactItemTypes",
-    "group": "ContactItemType",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "put",
-    "url": "/api/contact_item_types/{id}",
-    "title": "Update an existing ContactItemType",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types/{id} -d '{\"key1\": \"value1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X PUT",
-        "type": "json"
-      }
-    ],
-    "name": "updateContactItemTypes",
-    "group": "ContactItemType",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "post",
     "url": "/api/cm/custom_field",
     "title": "Create a new custom field",
     "examples": [
@@ -10538,12 +9988,12 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/fax/accounts/addaccountapplications",
-    "title": "Creates new account and applications",
+    "url": "/api/fax/accounts/{id}/applications",
+    "title": "Creates new applications",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/fax/accounts/addaccountapplications -d '[{\"name\": \"name\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
+        "content": "curl https://{domain}/api/fax/accounts/{id}/applications -d '[{\"app\": \"queue\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
         "type": "json"
       }
     ],
@@ -10597,12 +10047,12 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/fax/accounts/{id}/applications",
-    "title": "Creates new applications",
+    "url": "/api/fax/accounts/addaccountapplications",
+    "title": "Creates new account and applications",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/fax/accounts/{id}/applications -d '[{\"app\": \"queue\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
+        "content": "curl https://{domain}/api/fax/accounts/addaccountapplications -d '[{\"name\": \"name\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
         "type": "json"
       }
     ],
@@ -11572,9 +11022,9 @@ define({ "api": [
     "groupTitle": "Fax_Messages"
   },
   {
-    "type": "post",
-    "url": "/api/fax/messages",
-    "title": "Create message and send Fax",
+    "type": "put",
+    "url": "/api/fax/messages/{id}/reject",
+    "title": "Rejects message",
     "examples": [
       {
         "title": "Example usage:",
@@ -11584,15 +11034,15 @@ define({ "api": [
     ],
     "name": "rejectMessage",
     "group": "Fax_Messages",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/faxMessage/index.js",
     "groupTitle": "Fax_Messages"
   },
   {
-    "type": "put",
-    "url": "/api/fax/messages/{id}/reject",
-    "title": "Rejects message",
+    "type": "post",
+    "url": "/api/fax/messages",
+    "title": "Create message and send Fax",
     "examples": [
       {
         "title": "Example usage:",
@@ -11602,7 +11052,7 @@ define({ "api": [
     ],
     "name": "rejectMessage",
     "group": "Fax_Messages",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/faxMessage/index.js",
     "groupTitle": "Fax_Messages"
@@ -20592,36 +20042,36 @@ define({ "api": [
   },
   {
     "type": "get",
-    "url": "/api/rpc/voice/queues",
-    "title": "Gets a list of RTVoiceQueues",
+    "url": "/api/rpc/outbound",
+    "title": "Gets a list of RTOutbound",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/rpc/voice/queues -v -u {name}:{password}",
+        "content": "curl https://{domain}/api/rpc/outbound -v -u {name}:{password}",
         "type": "json"
       }
     ],
     "name": "RTVoiceQueues",
     "group": "RPC_Realtime",
-    "description": "<p>Motion will return a list of realtime voice queues parameters.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a list of realtime outbound parameters.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/rpc/index.js",
     "groupTitle": "RPC_Realtime"
   },
   {
     "type": "get",
-    "url": "/api/rpc/outbound",
-    "title": "Gets a list of RTOutbound",
+    "url": "/api/rpc/voice/queues",
+    "title": "Gets a list of RTVoiceQueues",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/rpc/outbound -v -u {name}:{password}",
+        "content": "curl https://{domain}/api/rpc/voice/queues -v -u {name}:{password}",
         "type": "json"
       }
     ],
     "name": "RTVoiceQueues",
     "group": "RPC_Realtime",
-    "description": "<p>Motion will return a list of realtime outbound parameters.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a list of realtime voice queues parameters.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/rpc/index.js",
     "groupTitle": "RPC_Realtime"
@@ -23552,31 +23002,31 @@ define({ "api": [
     "groupTitle": "Sms_Accounts"
   },
   {
-    "type": "post",
-    "url": "/api/sms/messages/{id}/status",
-    "title": "Receive message status",
+    "type": "get",
+    "url": "/api/sms/accounts/{id}/status",
+    "title": "Receive message status as get request",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/sms/messages/{id}/status \\ \n -H 'Content-Type: application/json' -v -X POST",
+        "content": "curl https://{domain}/api/sms/accounts/{id}/status -H 'Content-Type: application/json' -v -X GET",
         "type": "json"
       }
     ],
     "name": "statusMessage",
     "group": "Sms_Accounts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/smsMessage/index.js",
+    "filename": "server/api/smsAccount/index.js",
     "groupTitle": "Sms_Accounts"
   },
   {
     "type": "post",
-    "url": "/api/sms/accounts/{id}/status",
+    "url": "/api/sms/messages/{id}/status",
     "title": "Receive message status",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/sms/accounts/{id}/status -H 'Content-Type: application/json' -v -X POST",
+        "content": "curl https://{domain}/api/sms/messages/{id}/status \\ \n -H 'Content-Type: application/json' -v -X POST",
         "type": "json"
       }
     ],
@@ -23584,23 +23034,23 @@ define({ "api": [
     "group": "Sms_Accounts",
     "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/smsAccount/index.js",
+    "filename": "server/api/smsMessage/index.js",
     "groupTitle": "Sms_Accounts"
   },
   {
-    "type": "get",
+    "type": "post",
     "url": "/api/sms/accounts/{id}/status",
-    "title": "Receive message status as get request",
+    "title": "Receive message status",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/sms/accounts/{id}/status -H 'Content-Type: application/json' -v -X GET",
+        "content": "curl https://{domain}/api/sms/accounts/{id}/status -H 'Content-Type: application/json' -v -X POST",
         "type": "json"
       }
     ],
     "name": "statusMessage",
     "group": "Sms_Accounts",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/smsAccount/index.js",
     "groupTitle": "Sms_Accounts"
@@ -26625,7 +26075,7 @@ define({ "api": [
   },
   {
     "type": "get",
-    "url": "/api/system/process",
+    "url": "/api/system",
     "title": "Gets system information",
     "examples": [
       {
@@ -26643,7 +26093,7 @@ define({ "api": [
   },
   {
     "type": "get",
-    "url": "/api/system",
+    "url": "/api/system/process",
     "title": "Gets system information",
     "examples": [
       {
@@ -26942,12 +26392,12 @@ define({ "api": [
   },
   {
     "type": "delete",
-    "url": "/api/mail/queues/{id}/teams",
+    "url": "/api/openchannel/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/mail/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/openchannel/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
@@ -26955,17 +26405,17 @@ define({ "api": [
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/mailQueue/index.js",
+    "filename": "server/api/openchannelQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/voice/Prefixes/{id}/teams",
-    "title": "Remove teams from a voice prefix",
+    "url": "/api/voice/queues/{id}/teams",
+    "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/voice/prefixes/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/voice/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
@@ -26973,17 +26423,17 @@ define({ "api": [
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/voicePrefix/index.js",
+    "filename": "server/api/voiceQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/chat/queues/{id}/teams",
-    "title": "Remove teams from a queue",
+    "url": "/api/voice/Prefixes/{id}/teams",
+    "title": "Remove teams from a voice prefix",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/chat/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/voice/prefixes/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
@@ -26991,7 +26441,7 @@ define({ "api": [
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/chatQueue/index.js",
+    "filename": "server/api/voicePrefix/index.js",
     "groupTitle": "Teams"
   },
   {
@@ -27014,12 +26464,12 @@ define({ "api": [
   },
   {
     "type": "delete",
-    "url": "/api/fax/queues/{id}/teams",
+    "url": "/api/whatsapp/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/fax/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/whatsapp/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
@@ -27027,17 +26477,17 @@ define({ "api": [
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/faxQueue/index.js",
+    "filename": "server/api/whatsappQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/openchannel/queues/{id}/teams",
+    "url": "/api/chat/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/openchannel/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/chat/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
@@ -27045,17 +26495,17 @@ define({ "api": [
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/openchannelQueue/index.js",
+    "filename": "server/api/chatQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/whatsapp/queues/{id}/teams",
+    "url": "/api/mail/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/whatsapp/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/mail/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
@@ -27063,17 +26513,17 @@ define({ "api": [
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/whatsappQueue/index.js",
+    "filename": "server/api/mailQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/voice/queues/{id}/teams",
+    "url": "/api/fax/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/voice/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/fax/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
@@ -27081,7 +26531,7 @@ define({ "api": [
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/voiceQueue/index.js",
+    "filename": "server/api/faxQueue/index.js",
     "groupTitle": "Teams"
   },
   {
@@ -35071,12 +34521,12 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/webbar/hold",
-    "title": "hold webrtc call",
+    "url": "/api/webbar/unhold",
+    "title": "unhold webrtc call",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/webbar/hold -d '{\"sessionId\": \"<sessionId>\", \"userId\": 54}' \\\n -H \"Content-Type: application/json\" -X POST",
+        "content": "curl https://{domain}/api/webbar/unhold -d '{\"sessionId\": \"<sessionId>\", \"userId\": 54}' \\\n -H \"Content-Type: application/json\" -X POST",
         "type": "json"
       }
     ],
@@ -35088,7 +34538,7 @@ define({ "api": [
           {
             "group": "Body",
             "type": "String",
-            "optional": true,
+            "optional": false,
             "field": "sessionId",
             "description": ""
           },
@@ -35109,12 +34559,12 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/webbar/unhold",
-    "title": "unhold webrtc call",
+    "url": "/api/webbar/hold",
+    "title": "hold webrtc call",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/webbar/unhold -d '{\"sessionId\": \"<sessionId>\", \"userId\": 54}' \\\n -H \"Content-Type: application/json\" -X POST",
+        "content": "curl https://{domain}/api/webbar/hold -d '{\"sessionId\": \"<sessionId>\", \"userId\": 54}' \\\n -H \"Content-Type: application/json\" -X POST",
         "type": "json"
       }
     ],
@@ -35126,7 +34576,7 @@ define({ "api": [
           {
             "group": "Body",
             "type": "String",
-            "optional": false,
+            "optional": true,
             "field": "sessionId",
             "description": ""
           },
index 5150a98..31970f0 100644 (file)
     "groupTitle": "Chat_Interactions"
   },
   {
+    "type": "put",
+    "url": "/api/chat/interactions/{id}/close",
+    "title": "Close Interaction",
+    "examples": [
+      {
+        "title": "Example usage:",
+        "content": "curl https://{domain}/api/chat/interactions/{id}/close -d '[{\"to\": \"+3901119886500\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
+        "type": "json"
+      }
+    ],
+    "name": "addMessage",
+    "group": "Chat_Interactions",
+    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "version": "0.0.0",
+    "filename": "server/api/chatInteraction/index.js",
+    "groupTitle": "Chat_Interactions"
+  },
+  {
     "type": "post",
     "url": "/api/chat/interactions/{id}/messages",
     "title": "Creates new messages",
     "groupTitle": "Chat_Interactions"
   },
   {
-    "type": "put",
-    "url": "/api/chat/interactions/{id}/close",
-    "title": "Close Interaction",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/chat/interactions/{id}/close -d '[{\"to\": \"+3901119886500\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "addMessage",
-    "group": "Chat_Interactions",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/chatInteraction/index.js",
-    "groupTitle": "Chat_Interactions"
-  },
-  {
     "type": "post",
     "url": "/api/chat/interactions/{id}/attachment_upload",
     "title": "Add attachment",
   },
   {
     "type": "post",
-    "url": "/api/cm_contact_has_items",
-    "title": "Creates a new CmContactHasItem",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items -d '{\"key1\": \"valu1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "CreateCmContactHasItems",
-    "group": "CmContactHasItems",
-    "parameter": {
-      "fields": {
-        "Body": [
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "CmContactId",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "item",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "ItemTypeId",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "ItemClass",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "OrderBy",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "description",
-            "description": ""
-          }
-        ]
-      }
-    },
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "delete",
-    "url": "/api/cm_contact_has_items/{id}",
-    "title": "Deletes a CmContactHasItem",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items/{id} -v -u {name}:{password} -X DELETE",
-        "type": "json"
-      }
-    ],
-    "name": "DeleteCmContactHasItems",
-    "group": "CmContactHasItems",
-    "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm_contact_has_items",
-    "title": "Gets a list of CmContactHasItems",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "GetCmContactHasItems",
-    "group": "CmContactHasItems",
-    "description": "<p>Motion will always return paged results. Motion returns paging data in the <code>Content-Range</code> header in the form start - end / total.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned otherwise it will return a HTTP status code <code>206</code> Partial Content.</p> <p>Motion renders the resulting JSON representation in the response body.</p> <h2>Retrieving Specific Fields</h2> <p>To return only specific fields for a result set you can utilize the <code>fields</code> parameter. This parameter accepts a comma-separated list.</p> <p>A call returning only <code>id</code> and <code>name</code> for a result set would look like this.</p> <p><code>GET /api/cm_contact_has_items?fields=id,name</code></p> <h2>Filtering</h2> <p>You can perform exact-match filtering on any of a model's fields by using the field name as the key and supplying it with a value. These parameters accept a comma-separated list.</p> <p>A call returning a result set for records with <code>name</code> of <code>john.doe</code> or <code>jane.miller</code>.</p> <p><code>GET /api/cm_contact_has_items?name=john.doe,jane.miller</code></p> <p>If you use the key <code>filter</code> the result will be filtered by the value you specify.</p> <p><code>GET /api/cm_contact_has_items?filter=john</code></p> <h2>Sorting</h2> <p>To sort a result set based on one or several fields you can utilize the <code>sort</code> parameter. This parameters accepts a comma-separated list.</p> <p>Results will be sorted in the order of the fields provided. The default sorting order for fields is ascending. Fields can be sorted in descending order by prefixing them with a dash (<code>-</code>).</p> <p>A call sorting a result by <code>id</code> ascending and then <code>name</code> descending would look like this.</p> <p><code>GET /api/cm_contact_has_items?sort=id,-name</code></p> <h2>Offset and Limit</h2> <p>Query results are always paged. Motion leverages the <code>offset</code> and <code>limit</code> parameters to facilitate this.</p> <p>When the neither of these parameters are explicitly supplied the handler will assume the a default <code>limit</code> of <code>100</code>.</p> <p><code>offset</code> is a number indicating the start position in the result set you want to return.</p> <p><code>limit</code> is a number indicating how many records past the start position you want returned.</p> <p>A call with a result set starting at <code>5</code> and returning no more than <code>25</code> records would look like this.</p> <p><code>GET /api/cm_contact_has_items?offset=5&amp;limit=25</code></p> <p>If there were <code>50</code> records in total, the returned <code>Content-Range</code> header would look like this.</p> <p><code>Content-Range: 5-30/50</code></p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm_contact_has_items/{id}",
-    "title": "Gets a single CmContactHasItem",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items/{id} -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "ShowCmContactHasItems",
-    "group": "CmContactHasItems",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "put",
-    "url": "/api/cm_contact_has_items/{id}",
-    "title": "Update an existing CmContactHasItem",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_contact_has_items/{id} -d '{\"key1\": \"value1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X PUT",
-        "type": "json"
-      }
-    ],
-    "name": "updateCmContactHasItems",
-    "group": "CmContactHasItems",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContactHasItem/index.js",
-    "groupTitle": "CmContactHasItems"
-  },
-  {
-    "type": "post",
-    "url": "/api/cm_hopper_additional_phones",
-    "title": "Creates a new CmHopperAdditionalPhone",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones -d '{\"key1\": \"valu1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "CreateCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "parameter": {
-      "fields": {
-        "Body": [
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "CmHopperId",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": false,
-            "field": "phone",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "OrderBy",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "scheduledat",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countbusyretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countcongestionretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countnoanswerretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countnosuchnumberretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countdropretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countabandonedretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countmachineretry",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "countagentrejectretry",
-            "description": ""
-          }
-        ]
-      }
-    },
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "delete",
-    "url": "/api/cm_hopper_additional_phones/{id}",
-    "title": "Deletes a CmHopperAdditionalPhone",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones/{id} -v -u {name}:{password} -X DELETE",
-        "type": "json"
-      }
-    ],
-    "name": "DeleteCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm_hopper_additional_phones",
-    "title": "Gets a list of CmHopperAdditionalPhones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "GetCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "description": "<p>Motion will always return paged results. Motion returns paging data in the <code>Content-Range</code> header in the form start - end / total.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned otherwise it will return a HTTP status code <code>206</code> Partial Content.</p> <p>Motion renders the resulting JSON representation in the response body.</p> <h2>Retrieving Specific Fields</h2> <p>To return only specific fields for a result set you can utilize the <code>fields</code> parameter. This parameter accepts a comma-separated list.</p> <p>A call returning only <code>id</code> and <code>name</code> for a result set would look like this.</p> <p><code>GET /api/cm_hopper_additional_phones?fields=id,name</code></p> <h2>Filtering</h2> <p>You can perform exact-match filtering on any of a model's fields by using the field name as the key and supplying it with a value. These parameters accept a comma-separated list.</p> <p>A call returning a result set for records with <code>name</code> of <code>john.doe</code> or <code>jane.miller</code>.</p> <p><code>GET /api/cm_hopper_additional_phones?name=john.doe,jane.miller</code></p> <p>If you use the key <code>filter</code> the result will be filtered by the value you specify.</p> <p><code>GET /api/cm_hopper_additional_phones?filter=john</code></p> <h2>Sorting</h2> <p>To sort a result set based on one or several fields you can utilize the <code>sort</code> parameter. This parameters accepts a comma-separated list.</p> <p>Results will be sorted in the order of the fields provided. The default sorting order for fields is ascending. Fields can be sorted in descending order by prefixing them with a dash (<code>-</code>).</p> <p>A call sorting a result by <code>id</code> ascending and then <code>name</code> descending would look like this.</p> <p><code>GET /api/cm_hopper_additional_phones?sort=id,-name</code></p> <h2>Offset and Limit</h2> <p>Query results are always paged. Motion leverages the <code>offset</code> and <code>limit</code> parameters to facilitate this.</p> <p>When the neither of these parameters are explicitly supplied the handler will assume the a default <code>limit</code> of <code>100</code>.</p> <p><code>offset</code> is a number indicating the start position in the result set you want to return.</p> <p><code>limit</code> is a number indicating how many records past the start position you want returned.</p> <p>A call with a result set starting at <code>5</code> and returning no more than <code>25</code> records would look like this.</p> <p><code>GET /api/cm_hopper_additional_phones?offset=5&amp;limit=25</code></p> <p>If there were <code>50</code> records in total, the returned <code>Content-Range</code> header would look like this.</p> <p><code>Content-Range: 5-30/50</code></p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm_hopper_additional_phones/{id}",
-    "title": "Gets a single CmHopperAdditionalPhone",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones/{id} -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "ShowCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "put",
-    "url": "/api/cm_hopper_additional_phones/{id}",
-    "title": "Update an existing CmHopperAdditionalPhone",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm_hopper_additional_phones/{id} -d '{\"key1\": \"value1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X PUT",
-        "type": "json"
-      }
-    ],
-    "name": "updateCmHopperAdditionalPhones",
-    "group": "CmHopperAdditionalPhones",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmHopperAdditionalPhone/index.js",
-    "groupTitle": "CmHopperAdditionalPhones"
-  },
-  {
-    "type": "post",
     "url": "/api/cm/companies",
     "title": "Creates a new Company",
     "examples": [
     "groupTitle": "Cm_Contacts"
   },
   {
-    "type": "post",
-    "url": "/api/cm/contacts/{id}/duplicatePhones",
-    "title": "Sets new contact additional phones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/{id}/duplicateAdditionalPhones -d '{\"phones\": [p1,p2]}' -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "duplicateAdditionalPhones",
-    "group": "Cm_Contacts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_Contacts"
-  },
-  {
-    "type": "get",
-    "url": "/api/cm/contacts/{id}/phones",
-    "title": "Gets contact phones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/{id}/phones -v -u {name}:{password} -X GET",
-        "type": "json"
-      }
-    ],
-    "name": "getAdditionalPhones",
-    "group": "Cm_Contacts",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_Contacts"
-  },
-  {
     "type": "get",
     "url": "/api/cm/contacts/{id}/journey",
     "title": "Gets customer journey",
   },
   {
     "type": "post",
-    "url": "/api/cm/contacts/{id}/rescheduleAdditionalPhones",
-    "title": "Sets new contact additional phones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/{id}/rescheduleAdditionalPhones -d '{\"phones\": [p1,p2]}' -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "rescheduleAdditionalPhones",
-    "group": "Cm_Contacts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_Contacts"
-  },
-  {
-    "type": "post",
-    "url": "/api/cm/contacts/{id}/phones",
-    "title": "Sets new contact phones",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/{id}/phones -d '{\"phones\": [p1,p2]}' -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "setAdditionalPhones",
-    "group": "Cm_Contacts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_Contacts"
-  },
-  {
-    "type": "post",
     "url": "/api/cm/contacts/{id}/tags",
     "title": "Sets new tags",
     "examples": [
           },
           {
             "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "OrderBy",
-            "description": ""
-          },
-          {
-            "group": "Body",
             "type": "String",
             "optional": true,
             "field": "dialTimezone",
   },
   {
     "type": "get",
-    "url": "/api/cm/lists/global_fields",
-    "title": "Gets GLOBAL Custom Fields",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/lists/global_fields -v -u {name}:{password} -X GET",
-        "type": "json"
-      }
-    ],
-    "name": "getGlobalCustomFields",
-    "group": "Cm_Lists",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmList/index.js",
-    "groupTitle": "Cm_Lists"
-  },
-  {
-    "type": "get",
     "url": "/api/cm/lists/{id}/contacts/csv",
     "title": "Gets CSV List Contacts",
     "examples": [
   },
   {
     "type": "post",
-    "url": "/api/cm/contacts/uploadUpdates/:id",
-    "title": "Import existing contacts by csv",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/cm/contacts/uploadUpdates/:id -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "importUpdates",
-    "group": "Cm_contacts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/cmContact/index.js",
-    "groupTitle": "Cm_contacts"
-  },
-  {
-    "type": "post",
     "url": "/api/cm/contacts/upload",
     "title": "Upload csv",
     "examples": [
   },
   {
     "type": "post",
-    "url": "/api/contact_item_types",
-    "title": "Creates a new ContactItemType",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types -d '{\"key1\": \"valu1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X POST",
-        "type": "json"
-      }
-    ],
-    "name": "CreateContactItemTypes",
-    "group": "ContactItemType",
-    "parameter": {
-      "fields": {
-        "Body": [
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": false,
-            "field": "name",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "Integer",
-            "optional": true,
-            "field": "OrderBy",
-            "description": ""
-          },
-          {
-            "group": "Body",
-            "type": "String",
-            "optional": true,
-            "field": "rgbBackgroundColor",
-            "description": ""
-          }
-        ]
-      }
-    },
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "delete",
-    "url": "/api/contact_item_types/{id}",
-    "title": "Deletes a ContactItemType",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types/{id} -v -u {name}:{password} -X DELETE",
-        "type": "json"
-      }
-    ],
-    "name": "DeleteContactItemTypes",
-    "group": "ContactItemType",
-    "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "get",
-    "url": "/api/contact_item_types",
-    "title": "Gets a list of ContactItemTypes",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "GetContactItemTypes",
-    "group": "ContactItemType",
-    "description": "<p>Motion will always return paged results. Motion returns paging data in the <code>Content-Range</code> header in the form start - end / total.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned otherwise it will return a HTTP status code <code>206</code> Partial Content.</p> <p>Motion renders the resulting JSON representation in the response body.</p> <h2>Retrieving Specific Fields</h2> <p>To return only specific fields for a result set you can utilize the <code>fields</code> parameter. This parameter accepts a comma-separated list.</p> <p>A call returning only <code>id</code> and <code>name</code> for a result set would look like this.</p> <p><code>GET /api/contact_item_types?fields=id,name</code></p> <h2>Filtering</h2> <p>You can perform exact-match filtering on any of a model's fields by using the field name as the key and supplying it with a value. These parameters accept a comma-separated list.</p> <p>A call returning a result set for records with <code>name</code> of <code>john.doe</code> or <code>jane.miller</code>.</p> <p><code>GET /api/contact_item_types?name=john.doe,jane.miller</code></p> <p>If you use the key <code>filter</code> the result will be filtered by the value you specify.</p> <p><code>GET /api/contact_item_types?filter=john</code></p> <h2>Sorting</h2> <p>To sort a result set based on one or several fields you can utilize the <code>sort</code> parameter. This parameters accepts a comma-separated list.</p> <p>Results will be sorted in the order of the fields provided. The default sorting order for fields is ascending. Fields can be sorted in descending order by prefixing them with a dash (<code>-</code>).</p> <p>A call sorting a result by <code>id</code> ascending and then <code>name</code> descending would look like this.</p> <p><code>GET /api/contact_item_types?sort=id,-name</code></p> <h2>Offset and Limit</h2> <p>Query results are always paged. Motion leverages the <code>offset</code> and <code>limit</code> parameters to facilitate this.</p> <p>When the neither of these parameters are explicitly supplied the handler will assume the a default <code>limit</code> of <code>100</code>.</p> <p><code>offset</code> is a number indicating the start position in the result set you want to return.</p> <p><code>limit</code> is a number indicating how many records past the start position you want returned.</p> <p>A call with a result set starting at <code>5</code> and returning no more than <code>25</code> records would look like this.</p> <p><code>GET /api/contact_item_types?offset=5&amp;limit=25</code></p> <p>If there were <code>50</code> records in total, the returned <code>Content-Range</code> header would look like this.</p> <p><code>Content-Range: 5-30/50</code></p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "get",
-    "url": "/api/contact_item_types/{id}",
-    "title": "Gets a single ContactItemType",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types/{id} -v -u {name}:{password}",
-        "type": "json"
-      }
-    ],
-    "name": "ShowContactItemTypes",
-    "group": "ContactItemType",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "put",
-    "url": "/api/contact_item_types/{id}",
-    "title": "Update an existing ContactItemType",
-    "examples": [
-      {
-        "title": "Example usage:",
-        "content": "curl https://{domain}/api/contact_item_types/{id} -d '{\"key1\": \"value1\", \"key2\": \"value2\", \"...\": \"...\"}' \\\n -H \"Content-Type: application/json\" -v -u {name}:{password} -X PUT",
-        "type": "json"
-      }
-    ],
-    "name": "updateContactItemTypes",
-    "group": "ContactItemType",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
-    "version": "0.0.0",
-    "filename": "server/api/contactItemType/index.js",
-    "groupTitle": "ContactItemType"
-  },
-  {
-    "type": "post",
     "url": "/api/cm/custom_field",
     "title": "Create a new custom field",
     "examples": [
   },
   {
     "type": "post",
-    "url": "/api/fax/accounts/addaccountapplications",
-    "title": "Creates new account and applications",
+    "url": "/api/fax/accounts/{id}/applications",
+    "title": "Creates new applications",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/fax/accounts/addaccountapplications -d '[{\"name\": \"name\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
+        "content": "curl https://{domain}/api/fax/accounts/{id}/applications -d '[{\"app\": \"queue\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
         "type": "json"
       }
     ],
   },
   {
     "type": "post",
-    "url": "/api/fax/accounts/{id}/applications",
-    "title": "Creates new applications",
+    "url": "/api/fax/accounts/addaccountapplications",
+    "title": "Creates new account and applications",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/fax/accounts/{id}/applications -d '[{\"app\": \"queue\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
+        "content": "curl https://{domain}/api/fax/accounts/addaccountapplications -d '[{\"name\": \"name\", \"...\": \"...\"}]' \\ \n -H 'Content-Type: application/json' -v -u {name}:{password} -X POST",
         "type": "json"
       }
     ],
     "groupTitle": "Fax_Messages"
   },
   {
-    "type": "post",
-    "url": "/api/fax/messages",
-    "title": "Create message and send Fax",
+    "type": "put",
+    "url": "/api/fax/messages/{id}/reject",
+    "title": "Rejects message",
     "examples": [
       {
         "title": "Example usage:",
     ],
     "name": "rejectMessage",
     "group": "Fax_Messages",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/faxMessage/index.js",
     "groupTitle": "Fax_Messages"
   },
   {
-    "type": "put",
-    "url": "/api/fax/messages/{id}/reject",
-    "title": "Rejects message",
+    "type": "post",
+    "url": "/api/fax/messages",
+    "title": "Create message and send Fax",
     "examples": [
       {
         "title": "Example usage:",
     ],
     "name": "rejectMessage",
     "group": "Fax_Messages",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/faxMessage/index.js",
     "groupTitle": "Fax_Messages"
   },
   {
     "type": "get",
-    "url": "/api/rpc/voice/queues",
-    "title": "Gets a list of RTVoiceQueues",
+    "url": "/api/rpc/outbound",
+    "title": "Gets a list of RTOutbound",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/rpc/voice/queues -v -u {name}:{password}",
+        "content": "curl https://{domain}/api/rpc/outbound -v -u {name}:{password}",
         "type": "json"
       }
     ],
     "name": "RTVoiceQueues",
     "group": "RPC_Realtime",
-    "description": "<p>Motion will return a list of realtime voice queues parameters.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a list of realtime outbound parameters.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/rpc/index.js",
     "groupTitle": "RPC_Realtime"
   },
   {
     "type": "get",
-    "url": "/api/rpc/outbound",
-    "title": "Gets a list of RTOutbound",
+    "url": "/api/rpc/voice/queues",
+    "title": "Gets a list of RTVoiceQueues",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/rpc/outbound -v -u {name}:{password}",
+        "content": "curl https://{domain}/api/rpc/voice/queues -v -u {name}:{password}",
         "type": "json"
       }
     ],
     "name": "RTVoiceQueues",
     "group": "RPC_Realtime",
-    "description": "<p>Motion will return a list of realtime outbound parameters.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a list of realtime voice queues parameters.</p> <p>Upon success Motion will return a HTTP status code <code>200 OK</code> if the entire collection was returned.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/rpc/index.js",
     "groupTitle": "RPC_Realtime"
     "groupTitle": "Sms_Accounts"
   },
   {
-    "type": "post",
-    "url": "/api/sms/messages/{id}/status",
-    "title": "Receive message status",
+    "type": "get",
+    "url": "/api/sms/accounts/{id}/status",
+    "title": "Receive message status as get request",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/sms/messages/{id}/status \\ \n -H 'Content-Type: application/json' -v -X POST",
+        "content": "curl https://{domain}/api/sms/accounts/{id}/status -H 'Content-Type: application/json' -v -X GET",
         "type": "json"
       }
     ],
     "name": "statusMessage",
     "group": "Sms_Accounts",
-    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/smsMessage/index.js",
+    "filename": "server/api/smsAccount/index.js",
     "groupTitle": "Sms_Accounts"
   },
   {
     "type": "post",
-    "url": "/api/sms/accounts/{id}/status",
+    "url": "/api/sms/messages/{id}/status",
     "title": "Receive message status",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/sms/accounts/{id}/status -H 'Content-Type: application/json' -v -X POST",
+        "content": "curl https://{domain}/api/sms/messages/{id}/status \\ \n -H 'Content-Type: application/json' -v -X POST",
         "type": "json"
       }
     ],
     "group": "Sms_Accounts",
     "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/smsAccount/index.js",
+    "filename": "server/api/smsMessage/index.js",
     "groupTitle": "Sms_Accounts"
   },
   {
-    "type": "get",
+    "type": "post",
     "url": "/api/sms/accounts/{id}/status",
-    "title": "Receive message status as get request",
+    "title": "Receive message status",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/sms/accounts/{id}/status -H 'Content-Type: application/json' -v -X GET",
+        "content": "curl https://{domain}/api/sms/accounts/{id}/status -H 'Content-Type: application/json' -v -X POST",
         "type": "json"
       }
     ],
     "name": "statusMessage",
     "group": "Sms_Accounts",
-    "description": "<p>Motion will return a HTTP status code <code>200</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
+    "description": "<p>Motion will return a HTTP status code <code>201</code> upon success.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
     "filename": "server/api/smsAccount/index.js",
     "groupTitle": "Sms_Accounts"
   },
   {
     "type": "get",
-    "url": "/api/system/process",
+    "url": "/api/system",
     "title": "Gets system information",
     "examples": [
       {
   },
   {
     "type": "get",
-    "url": "/api/system",
+    "url": "/api/system/process",
     "title": "Gets system information",
     "examples": [
       {
   },
   {
     "type": "delete",
-    "url": "/api/mail/queues/{id}/teams",
+    "url": "/api/openchannel/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/mail/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/openchannel/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/mailQueue/index.js",
+    "filename": "server/api/openchannelQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/voice/Prefixes/{id}/teams",
-    "title": "Remove teams from a voice prefix",
+    "url": "/api/voice/queues/{id}/teams",
+    "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/voice/prefixes/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/voice/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/voicePrefix/index.js",
+    "filename": "server/api/voiceQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/chat/queues/{id}/teams",
-    "title": "Remove teams from a queue",
+    "url": "/api/voice/Prefixes/{id}/teams",
+    "title": "Remove teams from a voice prefix",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/chat/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/voice/prefixes/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/chatQueue/index.js",
+    "filename": "server/api/voicePrefix/index.js",
     "groupTitle": "Teams"
   },
   {
   },
   {
     "type": "delete",
-    "url": "/api/fax/queues/{id}/teams",
+    "url": "/api/whatsapp/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/fax/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/whatsapp/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/faxQueue/index.js",
+    "filename": "server/api/whatsappQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/openchannel/queues/{id}/teams",
+    "url": "/api/chat/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/openchannel/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/chat/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/openchannelQueue/index.js",
+    "filename": "server/api/chatQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/whatsapp/queues/{id}/teams",
+    "url": "/api/mail/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/whatsapp/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/mail/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/whatsappQueue/index.js",
+    "filename": "server/api/mailQueue/index.js",
     "groupTitle": "Teams"
   },
   {
     "type": "delete",
-    "url": "/api/voice/queues/{id}/teams",
+    "url": "/api/fax/queues/{id}/teams",
     "title": "Remove teams from a queue",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/voice/queues/{id}/teams -v -u {name}:{password} -X DELETE",
+        "content": "curl https://{domain}/api/fax/queues/{id}/teams -v -u {name}:{password} -X DELETE",
         "type": "json"
       }
     ],
     "group": "Teams",
     "description": "<p>Motion will return a HTTP status code <code>204</code> upon success. Motion return a HTTP status code <code>404</code> if the corresponding record could not be located.</p> <p>Motion renders the resulting JSON representation in the response body.</p>",
     "version": "0.0.0",
-    "filename": "server/api/voiceQueue/index.js",
+    "filename": "server/api/faxQueue/index.js",
     "groupTitle": "Teams"
   },
   {
   },
   {
     "type": "post",
-    "url": "/api/webbar/hold",
-    "title": "hold webrtc call",
+    "url": "/api/webbar/unhold",
+    "title": "unhold webrtc call",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/webbar/hold -d '{\"sessionId\": \"<sessionId>\", \"userId\": 54}' \\\n -H \"Content-Type: application/json\" -X POST",
+        "content": "curl https://{domain}/api/webbar/unhold -d '{\"sessionId\": \"<sessionId>\", \"userId\": 54}' \\\n -H \"Content-Type: application/json\" -X POST",
         "type": "json"
       }
     ],
           {
             "group": "Body",
             "type": "String",
-            "optional": true,
+            "optional": false,
             "field": "sessionId",
             "description": ""
           },
   },
   {
     "type": "post",
-    "url": "/api/webbar/unhold",
-    "title": "unhold webrtc call",
+    "url": "/api/webbar/hold",
+    "title": "hold webrtc call",
     "examples": [
       {
         "title": "Example usage:",
-        "content": "curl https://{domain}/api/webbar/unhold -d '{\"sessionId\": \"<sessionId>\", \"userId\": 54}' \\\n -H \"Content-Type: application/json\" -X POST",
+        "content": "curl https://{domain}/api/webbar/hold -d '{\"sessionId\": \"<sessionId>\", \"userId\": 54}' \\\n -H \"Content-Type: application/json\" -X POST",
         "type": "json"
       }
     ],
           {
             "group": "Body",
             "type": "String",
-            "optional": false,
+            "optional": true,
             "field": "sessionId",
             "description": ""
           },
index f9d77bc..790eac8 100644 (file)
@@ -1,6 +1,6 @@
 define({
   "name": "xCALLY Motion API",
-  "version": "2.6.2",
+  "version": "2.5.50",
   "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-02-10T16:06:22.438Z",
+    "time": "2022-02-14T16:37:58.550Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 6da066b..d298fa0 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "xCALLY Motion API",
-  "version": "2.6.2",
+  "version": "2.5.50",
   "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-02-10T16:06:22.438Z",
+    "time": "2022-02-14T16:37:58.550Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 361d6b4..873c51f 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "motion",
-  "version": "2.6.2",
+  "version": "2.5.50",
   "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
   "main": "server/app.js",
   "engines": {
index 21b2cf3..09afe5b 100644 (file)
     "RECALLME": "عاود الاتصال بي",
     "ACTIONTYPE": "نوع الإجراء",
     "CLICKTOACTION": "انقر للعمل",
-    "ADDITIONAL_PHONES": "هواتف إضافية",
-    "UPDATE_EXISTING_CONTACTS": "تحديث جهات الاتصال الموجودة",
     "DIALTIMEZONE": "اطلب المنطقة الزمنية",
-    "TIMEZONE": "اطلب المنطقة الزمنية",
-    "MOVE_DOWN": "تحرك لأسفل",
-    "MOVE_UP": "تحرك"
+    "TIMEZONE": "اطلب المنطقة الزمنية"
   }
 }
index f1945cc..354420b 100644 (file)
     "VATNUMBER_CF": "Codice Fiscale / DPH",
     "ACTIONTYPE": "Typ akce",
     "CLICKTOACTION": "Klikněte na akci",
-    "ADDITIONAL_PHONES": "Další telefony",
-    "UPDATE_EXISTING_CONTACTS": "Aktualizujte stávající kontakty",
     "DIALTIMEZONE": "Vytočte časové pásmo",
-    "TIMEZONE": "Vytočit časové pásmo",
-    "MOVE_DOWN": "Posunout dolů",
-    "MOVE_UP": "Posuňte se nahoru"
+    "TIMEZONE": "Vytočit časové pásmo"
   }
 }
index 08fb2d4..393eeae 100644 (file)
     "RECALLME": "Husk mig",
     "ACTIONTYPE": "Handlingstype",
     "CLICKTOACTION": "Klik for at handle",
-    "ADDITIONAL_PHONES": "Yderligere telefoner",
-    "UPDATE_EXISTING_CONTACTS": "Opdater eksisterende kontakter",
     "DIALTIMEZONE": "Ring tidszone",
-    "TIMEZONE": "Ring tidszone",
-    "MOVE_DOWN": "Flyt ned",
-    "MOVE_UP": "Flyt op"
+    "TIMEZONE": "Ring tidszone"
   }
 }
index c3d27cc..08a7201 100644 (file)
     "RECALLME": "Rückruf anfordern",
     "ACTIONTYPE": "Aktionstyp",
     "CLICKTOACTION": "Klicken für Aktion",
-    "ADDITIONAL_PHONES": "Zusätzliche Telefone",
-    "UPDATE_EXISTING_CONTACTS": "Bestehende Kontakte aktualisieren",
     "DIALTIMEZONE": "Zeitzone wählen",
-    "TIMEZONE": "Zeitzone wählen",
-    "MOVE_DOWN": "Sich abwärts bewegen",
-    "MOVE_UP": "Bewegen Sie sich nach oben"
+    "TIMEZONE": "Zeitzone wählen"
   }
 }
index b700161..72e1a02 100644 (file)
@@ -17,8 +17,6 @@
     "STARTTIME": "Start Time",
     "ENDTIME": "End Time",
     "MOTION_BULL": "Motion Bull",
-    "MOVE_DOWN": "Move down",
-    "MOVE_UP": "Move up",
     "HOPPER": "Hopper",
     "FINAL": "Hopper Final",
     "HISTORY": "Hopper History",
     "DELETE_LIST": "Delete List",
     "DELETE_HOPPER": "Delete Hopper",
     "RELOAD": "Reload",
-    "ADDITIONAL_PHONES": "Additional phones",
     "NO_COMPANIES": "No Company",
     "NO_AVAILABLE_ITEMS": "No Available Items",
     "ADD": "Add",
-    "UPDATE_EXISTING_CONTACTS": "Update existing contacts",
     "ERRORS": {
       "NAME_REQUIRED": "Mandatory field",
       "FIRSTNAME_REQUIRED": "Mandatory field",
index 59f4c4e..276f40d 100644 (file)
     "RECALLME": "Recordarme",
     "ACTIONTYPE": "Tipo de acción",
     "CLICKTOACTION": "Click para actuar",
-    "ADDITIONAL_PHONES": "Teléfonos adicionales",
-    "UPDATE_EXISTING_CONTACTS": "Actualizar contactos existentes",
     "DIALTIMEZONE": "Marcar zona horaria",
-    "TIMEZONE": "Marcar zona horaria",
-    "MOVE_DOWN": "Mover hacia abajo",
-    "MOVE_UP": "Ascender"
+    "TIMEZONE": "Marcar zona horaria"
   }
 }
index 2592ba3..b8e9ddc 100644 (file)
     "VATNUMBER_CF": "Codice Fiscale / käibemaks",
     "ACTIONTYPE": "Toimingu tüüp",
     "CLICKTOACTION": "Klõpsake toimimiseks",
-    "ADDITIONAL_PHONES": "Täiendavad telefonid",
-    "UPDATE_EXISTING_CONTACTS": "Värskendage olemasolevaid kontakte",
     "DIALTIMEZONE": "Vali ajavöönd",
-    "TIMEZONE": "Vali ajavöönd",
-    "MOVE_DOWN": "Liigu alla",
-    "MOVE_UP": "Üles liikuma"
+    "TIMEZONE": "Vali ajavöönd"
   }
 }
index ee7f8d8..3151e71 100644 (file)
     "RECALLME": "مرا بخاطر بسپار",
     "ACTIONTYPE": "نوع اقدام",
     "CLICKTOACTION": "برای اقدام کلیک کنید",
-    "ADDITIONAL_PHONES": "تلفن های اضافی",
-    "UPDATE_EXISTING_CONTACTS": "مخاطبین موجود را به روز کنید",
     "DIALTIMEZONE": "منطقه زمانی را شماره گیری کنید",
-    "TIMEZONE": "منطقه زمانی را شماره گیری کنید",
-    "MOVE_DOWN": "حرکت به پایین",
-    "MOVE_UP": "حرکت به بالا"
+    "TIMEZONE": "منطقه زمانی را شماره گیری کنید"
   }
 }
index 612c187..5ee98e9 100644 (file)
     "RECALLME": "Muista minut",
     "ACTIONTYPE": "Toiminnan tyyppi",
     "CLICKTOACTION": "Napsauta toimintaan",
-    "ADDITIONAL_PHONES": "Muut puhelimet",
-    "UPDATE_EXISTING_CONTACTS": "Päivitä olemassa olevat yhteystiedot",
     "DIALTIMEZONE": "Valitse aikavyöhyke",
-    "TIMEZONE": "Valitse aikavyöhyke",
-    "MOVE_DOWN": "Siirry alas",
-    "MOVE_UP": "Liiku ylös"
+    "TIMEZONE": "Valitse aikavyöhyke"
   }
 }
index 750f726..6094086 100644 (file)
     "RECALLME": "Rappelle-moi",
     "ACTIONTYPE": "Type d'action",
     "CLICKTOACTION": "Cliquez pour agir",
-    "ADDITIONAL_PHONES": "Téléphones supplémentaires",
-    "UPDATE_EXISTING_CONTACTS": "Mettre à jour les contacts existants",
     "DIALTIMEZONE": "Composer le fuseau horaire",
-    "TIMEZONE": "Composer le fuseau horaire",
-    "MOVE_DOWN": "Descendre",
-    "MOVE_UP": "Déplacer vers le haut"
+    "TIMEZONE": "Composer le fuseau horaire"
   }
 }
index 3835597..4c73a3e 100644 (file)
     "RECALLME": "חייג אליי",
     "ACTIONTYPE": "סוג פעולה",
     "CLICKTOACTION": "לחץ לפעולה",
-    "ADDITIONAL_PHONES": "טלפונים נוספים",
-    "UPDATE_EXISTING_CONTACTS": "עדכן אנשי קשר קיימים",
     "DIALTIMEZONE": "חייג אזור זמן",
-    "TIMEZONE": "חייג אזור זמן",
-    "MOVE_DOWN": "לרדת",
-    "MOVE_UP": "לזוז למעלה"
+    "TIMEZONE": "חייג אזור זמן"
   }
 }
index 68bf074..191df65 100644 (file)
     "RECALLME": "मुझे याद करो",
     "ACTIONTYPE": "प्रक्रिया का प्रकार",
     "CLICKTOACTION": "कार्रवाई के लिए क्लिक करें",
-    "ADDITIONAL_PHONES": "अतिरिक्त फोन",
-    "UPDATE_EXISTING_CONTACTS": "मौजूदा संपर्कों को अपडेट करें",
     "DIALTIMEZONE": "डायल टाइमज़ोन",
-    "TIMEZONE": "डायल टाइमज़ोन",
-    "MOVE_DOWN": "नीचे की ओर",
-    "MOVE_UP": "बढ़ाना"
+    "TIMEZONE": "डायल टाइमज़ोन"
   }
 }
index fb81f68..6091c24 100644 (file)
       "JSCRIPTY_GET_ERROR": "Unable to retrieve any Jscripty project"
     },
     "DIALTIMEZONE": "Tárcsázza az időzónát",
-    "TIMEZONE": "Tárcsázza az időzónát",
-    "ADDITIONAL_PHONES": "További telefonok",
-    "MOVE_DOWN": "Mozgás lefelé",
-    "MOVE_UP": "Lépj felfelé",
-    "UPDATE_EXISTING_CONTACTS": "Frissítse a meglévő kapcsolatokat"
+    "TIMEZONE": "Tárcsázza az időzónát"
   }
 }
index 3d6b77c..d469a00 100644 (file)
     "RECALLME": "Ingat Saya",
     "ACTIONTYPE": "Tipe aksi",
     "CLICKTOACTION": "Klik untuk bertindak",
-    "ADDITIONAL_PHONES": "Telepon tambahan",
-    "UPDATE_EXISTING_CONTACTS": "Perbarui kontak yang ada",
     "DIALTIMEZONE": "Putar Zona Waktu",
-    "TIMEZONE": "Putar Zona Waktu",
-    "MOVE_DOWN": "Turunkan",
-    "MOVE_UP": "Naik"
+    "TIMEZONE": "Putar Zona Waktu"
   }
 }
index 4f5c210..48f8386 100644 (file)
       "ACCOUNTS_GET_ERROR": "Impossibile recuperare gli account {{channel}}",
       "JSCRIPTY_GET_ERROR": "Impossibile recuperare i progetti Jscripty"
     },
-    "ADDITIONAL_PHONES": "Telefoni aggiuntivi",
-    "UPDATE_EXISTING_CONTACTS": "Aggiorna i contatti esistenti",
-    "TIMEZONE": "Componi il fuso orario",
-    "MOVE_DOWN": "Abbassati",
-    "MOVE_UP": "Andare avanti"
+    "TIMEZONE": "Componi il fuso orario"
   }
 }
index cd965cf..8f94175 100644 (file)
     "RECALLME": "私を思い出して",
     "ACTIONTYPE": "アクションタイプ",
     "CLICKTOACTION": "クリックしてアクション",
-    "ADDITIONAL_PHONES": "追加の電話",
-    "UPDATE_EXISTING_CONTACTS": "既存の連絡先を更新する",
     "DIALTIMEZONE": "タイムゾーンをダイヤルする",
-    "TIMEZONE": "タイムゾーンをダイヤルする",
-    "MOVE_DOWN": "下に移動",
-    "MOVE_UP": "上に移動"
+    "TIMEZONE": "タイムゾーンをダイヤルする"
   }
 }
index 289a1d1..0644770 100644 (file)
     "RECALLME": "저를 기억하십시오",
     "ACTIONTYPE": "액션 유형",
     "CLICKTOACTION": "클릭하여 실행",
-    "ADDITIONAL_PHONES": "추가 전화",
-    "UPDATE_EXISTING_CONTACTS": "기존 연락처 업데이트",
     "DIALTIMEZONE": "다이얼 타임존",
-    "TIMEZONE": "다이얼 타임존",
-    "MOVE_DOWN": "아래로 이동",
-    "MOVE_UP": "이동"
+    "TIMEZONE": "다이얼 타임존"
   }
 }
index bdb4f2d..482b36a 100644 (file)
     "RECALLME": "Prisimink mane",
     "ACTIONTYPE": "Veiksmo tipas",
     "CLICKTOACTION": "Spustelėkite, kad veiktumėte",
-    "ADDITIONAL_PHONES": "Papildomi telefonai",
-    "UPDATE_EXISTING_CONTACTS": "Atnaujinkite esamus kontaktus",
     "DIALTIMEZONE": "Surinkite laiko juostą",
-    "TIMEZONE": "Surinkite laiko juostą",
-    "MOVE_DOWN": "Judėk žemyn",
-    "MOVE_UP": "Judėti aukštyn"
+    "TIMEZONE": "Surinkite laiko juostą"
   }
 }
index 2a0a532..118307a 100644 (file)
     "RECALLME": "Atsaukt mani",
     "ACTIONTYPE": "Darbības veids",
     "CLICKTOACTION": "Noklikšķiniet uz darbības",
-    "ADDITIONAL_PHONES": "Papildu tālruņi",
-    "UPDATE_EXISTING_CONTACTS": "Atjauniniet esošās kontaktpersonas",
     "DIALTIMEZONE": "Sastādiet laika joslu",
-    "TIMEZONE": "Sastādiet laika joslu",
-    "MOVE_DOWN": "Pārvietojieties uz leju",
-    "MOVE_UP": "Pārvietojieties uz augšu"
+    "TIMEZONE": "Sastādiet laika joslu"
   }
 }
index caf032b..341ce0a 100644 (file)
     "RECALLME": "Herinner me",
     "ACTIONTYPE": "Actie type",
     "CLICKTOACTION": "Klik voor actie",
-    "ADDITIONAL_PHONES": "Extra telefoons",
-    "UPDATE_EXISTING_CONTACTS": "Bestaande contacten bijwerken",
     "DIALTIMEZONE": "Kies tijdzone",
-    "TIMEZONE": "Kies tijdzone",
-    "MOVE_DOWN": "Naar beneden verplaatsen",
-    "MOVE_UP": "Omhoog gaan"
+    "TIMEZONE": "Kies tijdzone"
   }
 }
index 033049e..a0b3be3 100644 (file)
     "RECALLME": "Husk meg",
     "ACTIONTYPE": "Handlingstype",
     "CLICKTOACTION": "Klikk for å handle",
-    "ADDITIONAL_PHONES": "Ekstra telefoner",
-    "UPDATE_EXISTING_CONTACTS": "Oppdater eksisterende kontakter",
     "DIALTIMEZONE": "Ring tidssone",
-    "TIMEZONE": "Ring tidssone",
-    "MOVE_DOWN": "Flytt ned",
-    "MOVE_UP": "Flytte opp"
+    "TIMEZONE": "Ring tidssone"
   }
 }
index 582fea4..07a2628 100644 (file)
     "RECALLME": "Przypomnij mi",
     "ACTIONTYPE": "Rodzaj działania",
     "CLICKTOACTION": "Kliknij, aby wykonać czynność",
-    "ADDITIONAL_PHONES": "Dodatkowe telefony",
-    "UPDATE_EXISTING_CONTACTS": "Zaktualizuj istniejące kontakty",
     "DIALTIMEZONE": "Wybierz strefę czasową",
-    "TIMEZONE": "Wybierz strefę czasową",
-    "MOVE_DOWN": "Padnij",
-    "MOVE_UP": "Podnieść"
+    "TIMEZONE": "Wybierz strefę czasową"
   }
 }
index b84d6b8..fdf4d0d 100644 (file)
     "RECALLME": "Lembre-me",
     "ACTIONTYPE": "Tipo de acão",
     "CLICKTOACTION": "Clique para ação",
-    "ADDITIONAL_PHONES": "Telefones adicionais",
-    "UPDATE_EXISTING_CONTACTS": "Atualizar contatos existentes",
     "DIALTIMEZONE": "Disque fuso horário",
-    "TIMEZONE": "Disque fuso horário",
-    "MOVE_DOWN": "Mover para baixo",
-    "MOVE_UP": "Subir"
+    "TIMEZONE": "Disque fuso horário"
   }
 }
index 1b7999f..ecea40f 100644 (file)
     "RECALLME": "Lembre-me",
     "ACTIONTYPE": "Tipo de acão",
     "CLICKTOACTION": "Clique para ação",
-    "ADDITIONAL_PHONES": "Telefones adicionais",
-    "UPDATE_EXISTING_CONTACTS": "Atualizar contatos existentes",
     "DIALTIMEZONE": "Disque fuso horário",
-    "TIMEZONE": "Disque fuso horário",
-    "MOVE_DOWN": "Mover para baixo",
-    "MOVE_UP": "Subir"
+    "TIMEZONE": "Disque fuso horário"
   }
 }
index 4917f25..6f75b78 100644 (file)
     "RECALLME": "Вспомни меня",
     "ACTIONTYPE": "Тип действия",
     "CLICKTOACTION": "Нажмите, чтобы действовать",
-    "ADDITIONAL_PHONES": "Дополнительные телефоны",
-    "UPDATE_EXISTING_CONTACTS": "Обновить существующие контакты",
     "DIALTIMEZONE": "Часовой пояс набора",
-    "TIMEZONE": "Часовой пояс набора",
-    "MOVE_DOWN": "Вниз",
-    "MOVE_UP": "Вверх"
+    "TIMEZONE": "Часовой пояс набора"
   }
 }
index c592fac..fc2306f 100644 (file)
     "RECALLME": "Kom ihåg mig",
     "ACTIONTYPE": "Åtgärdstyp",
     "CLICKTOACTION": "Klicka för att åtgärda",
-    "ADDITIONAL_PHONES": "Ytterligare telefoner",
-    "UPDATE_EXISTING_CONTACTS": "Uppdatera befintliga kontakter",
     "DIALTIMEZONE": "Ring tidszon",
-    "TIMEZONE": "Ring tidszon",
-    "MOVE_DOWN": "Flytta ner",
-    "MOVE_UP": "Flytta upp"
+    "TIMEZONE": "Ring tidszon"
   }
 }
index 02d143b..8fdad71 100644 (file)
     "RECALLME": "Beni hatırla",
     "ACTIONTYPE": "Eylem Türü",
     "CLICKTOACTION": "İşlem yapmak için tıklayın",
-    "ADDITIONAL_PHONES": "Ek telefonlar",
-    "UPDATE_EXISTING_CONTACTS": "Mevcut kişileri güncelle",
     "DIALTIMEZONE": "Arama Saat Dilimi",
-    "TIMEZONE": "Arama Saat Dilimi",
-    "MOVE_DOWN": "Aşağı inmek",
-    "MOVE_UP": "yukarı taşı"
+    "TIMEZONE": "Arama Saat Dilimi"
   }
 }
index effe3d3..3e96307 100644 (file)
     "RECALLME": "召回我",
     "ACTIONTYPE": "动作类型",
     "CLICKTOACTION": "点击操作",
-    "ADDITIONAL_PHONES": "附加电话",
-    "UPDATE_EXISTING_CONTACTS": "更新现有联系人",
     "DIALTIMEZONE": "拨号时区",
-    "TIMEZONE": "拨号时区",
-    "MOVE_DOWN": "下移",
-    "MOVE_UP": "提升"
+    "TIMEZONE": "拨号时区"
   }
 }
index 85b0226..da088ea 100644 (file)
     "RECALLME": "召回我",
     "ACTIONTYPE": "動作類型",
     "CLICKTOACTION": "點擊操作",
-    "ADDITIONAL_PHONES": "附加電話",
-    "UPDATE_EXISTING_CONTACTS": "更新現有聯繫人",
     "DIALTIMEZONE": "撥號時區",
-    "TIMEZONE": "撥號時區",
-    "MOVE_DOWN": "下移",
-    "MOVE_UP": "提升"
+    "TIMEZONE": "撥號時區"
   }
 }
index 5df0847..4e3fd63 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "يجب أن تكون القيمة أقل من أو تساوي",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "يجب أن تكون القيمة أقل من أو تساوي",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "يجب أن تكون القيمة أقل من أو تساوي",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "يجب أن تكون القيمة أقل من أو تساوي",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "مكالمة add.phone بعد دقيقة. يجب أن تكون أكبر من أو تساوي",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "حقل الزامي"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "يجب أن تكون القيمة أقل من أو تساوي"
     },
     "HELP": {
       "ACTIVE": "نشيط",
     "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم",
     "SECOND_LEVEL_DISPOSITION": "ترتيب المستوى الثاني",
     "THIRD_LEVEL_DISPOSITION": "الترتيب الثالث",
-    "ADDITIONALPHONES": "هواتف إضافية",
-    "CALLADDITIONALPHONEAFTERMIN": "الاتصال بهاتف إضافي بعد [دقيقة]",
     "PREVIEW_AUTO_RECALL_ME": "أتمتة تذكرني المكالمات",
     "PREVIEW_RECALL_ME_REMINDER": "أذكرني تذكير"
   }
index 0ae115b..e574fd2 100644 (file)
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Hodnota musí být menší nebo rovna",
       "NOSUCHNUMBERMAXRETRY_REQUIRED": "Povinné pole",
       "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Hodnota musí být menší nebo rovna",
-      "NOSUCHNUMBERRETRYTIME_REQUIRED": "Povinné pole",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Volejte add.phone po min. by měla být větší nebo rovna",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Povinné pole"
+      "NOSUCHNUMBERRETRYTIME_REQUIRED": "Povinné pole"
     },
     "GENERAL": "General",
     "AGENTTIMEOUT": "Agent Timeout",
     "NOSUCHNUMBERRETRYTIME": "Čas opakování [min]",
     "SECOND_LEVEL_DISPOSITION": "Dispozice druhé úrovně",
     "THIRD_LEVEL_DISPOSITION": "Dispozice třetí úrovně",
-    "ADDITIONALPHONES": "Další telefony",
-    "CALLADDITIONALPHONEAFTERMIN": "Zavolat další telefon po [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatizujte volání Recall Me",
     "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder"
   }
index e6aa4fc..3a61d1a 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Værdien skal være mindre end eller lig med",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Værdien skal være mindre end eller lig med",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Værdien skal være mindre end eller lig med",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Værdien skal være mindre end eller lig med",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Opkald tilføj. Telefon efter min. skal være større end eller lig med",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Obligatorisk felt"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Værdien skal være mindre end eller lig med"
     },
     "GENERAL": "Generel",
     "AGENTTIMEOUT": "Agent Timeout",
     "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår",
     "SECOND_LEVEL_DISPOSITION": "Andet niveau disposition",
     "THIRD_LEVEL_DISPOSITION": "Tredje niveau disposition",
-    "ADDITIONALPHONES": "Yderligere telefoner",
-    "CALLADDITIONALPHONEAFTERMIN": "Ring til yderligere telefon efter [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatiser Call Me-opkald",
     "PREVIEW_RECALL_ME_REMINDER": "Husk mig påmindelse"
   }
index 3c09c82..da12bbf 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei Anrufbeantworter muss kleiner oder gleich sein als",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei Anrufbeantworter muss kleiner oder gleich sein als",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei falscher Nummer muss kleiner oder gleich sein als",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei falscher Nummer muss kleiner oder gleich sein als",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Rufen Sie add.phone nach min. sollte größer oder gleich sein",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Pflichtfeld"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei falscher Nummer muss kleiner oder gleich sein als"
     },
     "GENERAL": "Allgemein",
     "AGENTTIMEOUT": "Zeitüberschreitung Agent",
     "SECOND_LEVEL_DISPOSITION": "Qualifizierung 2. Ebene",
     "THIRD_LEVEL_DISPOSITION": "Qualifikation 3. Ebene",
     "PREVIEW_AUTO_RECALL_ME": "Rückrufe automatisieren",
-    "PREVIEW_RECALL_ME_REMINDER": "Recall Me Erinnerung",
-    "ADDITIONALPHONES": "Zusätzliche Telefone",
-    "CALLADDITIONALPHONEAFTERMIN": "Weiteres Telefon anrufen nach [min]"
+    "PREVIEW_RECALL_ME_REMINDER": "Recall Me Erinnerung"
   }
 }
index 6b63309..f84c475 100644 (file)
     "NOANSWER": "No Answer",
     "NOANSWERMAXRETRY": "Max Retries",
     "NOANSWERRETRYTIME": "Retry Time [min]",
+    "QUEUE_PARAMS": "Queue Parameters",
+    "ORIGINATED": "Originated",
+    "MESSAGE": "Message",
+    "DROPPED": "Dropped",
+    "CREATED_AT": "Created At",
     "NOSUCHNUMBER": "No such number",
     "NOSUCHNUMBERMAXRETRY": "Max Retries",
     "NOSUCHNUMBERRETRYTIME": "Retry Time [min]",
     "AGENTREJECT": "Agent Reject",
     "AGENTREJECTMAXRETRY": "Max Retries",
     "AGENTREJECTRETRYTIME": "Retry Time [min]",
-    "CALLADDITIONALPHONEAFTERMIN": "Call additional phone after [min]",
-    "ADDITIONALPHONES": "Additional phones",
-    "QUEUE_PARAMS": "Queue Parameters",
-    "ORIGINATED": "Originated",
-    "MESSAGE": "Message",
-    "DROPPED": "Dropped",
-    "CREATED_AT": "Created At",
     "LEGEND": {
       "CUSTOM_APPLICATION": "(*) - Custom application."
     },
       "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to",
       "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field",
       "CALLYSQUAREPROJECT_REQUIRED": "Mandatory field",
-      "TRUNK_REQUIRED": "Mandatory field",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Mandatory field",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Call add.phone after min. should be greater than or equal to"
+      "TRUNK_REQUIRED": "Mandatory field"
     },
     "GENERAL": "General",
     "AGENTTIMEOUT": "Agent Timeout",
       "BUSYRETRYTIME": "Time in minutes before trying to call again a failed contact due to busy",
       "NOANSWERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no answer",
       "NOANSWERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no answer",
+      "GLOBALINTERVAL": "Global time interval during which the dialer is allowed to call contacts. We decline responsibility: pay attention when you modify this field, because you may fail to comply with the national Autodialer Laws and Regulations",
+      "NAME": "Only numbers, letters and specific characters (._) are supported",
       "NOSUCHNUMBERMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for no such number",
       "NOSUCHNUMBERRETRYTIME": "Time in minutes before trying to call again a failed contact due to no such number",
       "DROPMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for drop",
       "MACHINERETRYTIME": "Time in minutes before trying to call again a failed contact due to machine",
       "AGENTREJECTMAXRETRY": "Maximum number of times a contact is called before considering it closed, when the call failed for agent reject",
       "AGENTREJECTRETRYTIME": "Time in minutes before trying to call again a failed contact due to agent reject",
-      "CALLADDITIONALPHONEAFTERMIN": "",
-      "GLOBALINTERVAL": "Global time interval during which the dialer is allowed to call contacts. We decline responsibility: pay attention when you modify this field, because you may fail to comply with the national Autodialer Laws and Regulations",
-      "NAME": "Only numbers, letters and specific characters (._) are supported",
       "MANDATORYDISPOSITIONPAUSEID": "Pause status to set during mandatory disposition",
       "PREVIEW_AUTO_RECALL_ME": "If enabled, the system will automatically generate the Recall Me calls; otherwise, the agent must do it manually"
     },
index b805412..49be9bc 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "El valor debe ser menor o igual que",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "El valor debe ser menor o igual que",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "El valor debe ser menor o igual que",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "El valor debe ser menor o igual que",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Llamar al teléfono adicional después de min. debe ser mayor o igual a",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Campo obligatorio"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "El valor debe ser menor o igual que"
     },
     "ABANDONED": "Abandonado",
     "ABANDONEDCALLS": "Llamadas de cola abandonadas",
     "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso",
     "SECOND_LEVEL_DISPOSITION": "Tipficación de segundo nivel",
     "THIRD_LEVEL_DISPOSITION": "Tipificación de tercer nivel",
-    "ADDITIONALPHONES": "Teléfonos adicionales",
-    "CALLADDITIONALPHONEAFTERMIN": "Llamar a otro teléfono después de [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatizar las llamadas de Recall Me",
     "PREVIEW_RECALL_ME_REMINDER": "Recordarme recordatorio"
   }
index 96861de..a91cc7b 100644 (file)
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Väärtus peab olema väiksem või võrdne",
       "NOSUCHNUMBERMAXRETRY_REQUIRED": "Kohustuslik väli",
       "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Väärtus peab olema väiksem või võrdne",
-      "NOSUCHNUMBERRETRYTIME_REQUIRED": "Kohustuslik väli",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Helista lisa.telefon pärast min. peaks olema suurem või võrdne",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Kohustuslik väli"
+      "NOSUCHNUMBERRETRYTIME_REQUIRED": "Kohustuslik väli"
     },
     "GENERAL": "General",
     "AGENTTIMEOUT": "Agent Timeout",
     "NOSUCHNUMBERRETRYTIME": "Uuesti proovimise aeg [min]",
     "SECOND_LEVEL_DISPOSITION": "Teise taseme korraldus",
     "THIRD_LEVEL_DISPOSITION": "Kolmanda taseme korraldus",
-    "ADDITIONALPHONES": "Täiendavad telefonid",
-    "CALLADDITIONALPHONEAFTERMIN": "Helistage täiendavale telefonile pärast [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatiseerige Call Me kõned",
     "PREVIEW_RECALL_ME_REMINDER": "Tuleta mulle meelde"
   }
index 79cad1d..9bbd864 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "مقدار باید کمتر یا برابر باشد",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "مقدار باید کمتر یا برابر باشد",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "مقدار باید کمتر یا برابر باشد",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "مقدار باید کمتر یا برابر باشد",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "بعد از دقیقه با add.phone تماس بگیرید باید بزرگتر یا مساوی باشد",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "زمینه اجباری"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "مقدار باید کمتر یا برابر باشد"
     },
     "GENERAL": "سردار",
     "AGENTTIMEOUT": "عامل زمان مجاز",
     "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است",
     "SECOND_LEVEL_DISPOSITION": "دفع سطح دوم",
     "THIRD_LEVEL_DISPOSITION": "دفع سطح سوم",
-    "ADDITIONALPHONES": "تلفن های اضافی",
-    "CALLADDITIONALPHONEAFTERMIN": "بعد از [دقیقه] با تلفن اضافی تماس بگیرید",
     "PREVIEW_AUTO_RECALL_ME": "تماس\200cهای Recall Me را خودکار کنید",
     "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder"
   }
index c2eb3f0..b4368b1 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Arvon on oltava pienempi tai yhtä suuri kuin",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Arvon on oltava pienempi tai yhtä suuri kuin",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Arvon on oltava pienempi tai yhtä suuri kuin",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Arvon on oltava pienempi tai yhtä suuri kuin",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Soita lisäpuhelimeen min. pitäisi olla suurempi tai yhtä suuri kuin",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Pakollinen kenttä"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Arvon on oltava pienempi tai yhtä suuri kuin"
     },
     "GENERAL": "Yleistä",
     "AGENTTIMEOUT": "Agentti aikakatkaisu",
     "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä",
     "SECOND_LEVEL_DISPOSITION": "Toisen tason sijoitus",
     "THIRD_LEVEL_DISPOSITION": "Kolmannen tason sijoitus",
-    "ADDITIONALPHONES": "Muut puhelimet",
-    "CALLADDITIONALPHONEAFTERMIN": "Soita lisäpuhelimeen [min] jälkeen",
     "PREVIEW_AUTO_RECALL_ME": "Automatisoi Recall Me -puhelut",
     "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder"
   }
index 5327034..0ad4251 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "La valeur doit être inférieure ou égale à",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "La valeur doit être inférieure ou égale à",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "La valeur doit être inférieure ou égale à",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "La valeur doit être inférieure ou égale à",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Appelez add.phone après min. doit être supérieur ou égal à",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Champ obligatoire"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "La valeur doit être inférieure ou égale à"
     },
     "GENERAL": "Général",
     "AGENTTIMEOUT": "Délai d'agent",
     "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours",
     "SECOND_LEVEL_DISPOSITION": "Disposition de deuxième niveau",
     "THIRD_LEVEL_DISPOSITION": "Disposition de troisième niveau",
-    "ADDITIONALPHONES": "Téléphones supplémentaires",
-    "CALLADDITIONALPHONEAFTERMIN": "Appeler un autre téléphone après [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatisez les appels de rappel",
     "PREVIEW_RECALL_ME_REMINDER": "Rappel de moi"
   }
index 9fabbbe..c077fac 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "הערך חייב להיות קטן או שווה ל-",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "הערך חייב להיות קטן או שווה ל-",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "הערך חייב להיות קטן או שווה ל-",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "הערך חייב להיות קטן או שווה ל-",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "התקשרו add.phone לאחר דקות. צריך להיות גדול או שווה ל",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "שדה חובה"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "הערך חייב להיות קטן או שווה ל-"
     },
     "GENERAL": "כללי",
     "AGENTTIMEOUT": "סוף זמן המתנה לנציג",
     "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת",
     "SECOND_LEVEL_DISPOSITION": "נטייה בדרגה שנייה",
     "THIRD_LEVEL_DISPOSITION": "נטייה ברמה השלישית",
-    "ADDITIONALPHONES": "טלפונים נוספים",
-    "CALLADDITIONALPHONEAFTERMIN": "התקשר לטלפון נוסף לאחר [דקה]",
     "PREVIEW_AUTO_RECALL_ME": "אוטומציה של שיחות Recall Me",
     "PREVIEW_RECALL_ME_REMINDER": "תזכורת לזכר אותי"
   }
index 08a242a..ab897ad 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "मान इससे कम या बराबर होना चाहिए",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "मान इससे कम या बराबर होना चाहिए",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "मान इससे कम या बराबर होना चाहिए",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "मान इससे कम या बराबर होना चाहिए",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "मिनट के बाद add.phone पर कॉल करें। से बड़ा या बराबर होना चाहिए",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "आवश्यक स्थान"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "मान इससे कम या बराबर होना चाहिए"
     },
     "GENERAL": "सामान्य",
     "AGENTTIMEOUT": "एजेंट समयबाह्य",
     "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है",
     "SECOND_LEVEL_DISPOSITION": "दूसरा स्तर विवाद",
     "THIRD_LEVEL_DISPOSITION": "तीसरे स्तर का विवाद",
-    "ADDITIONALPHONES": "अतिरिक्त फोन",
-    "CALLADDITIONALPHONEAFTERMIN": "[मिनट] के बाद अतिरिक्त फ़ोन पर कॉल करें",
     "PREVIEW_AUTO_RECALL_ME": "स्वचालित रिकॉल मी कॉल",
     "PREVIEW_RECALL_ME_REMINDER": "रिकॉल मी रिमाइंडर"
   }
index 9998df8..02b6231 100644 (file)
       "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to",
       "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field",
       "CALLYSQUAREPROJECT_REQUIRED": "Mandatory field",
-      "TRUNK_REQUIRED": "Mandatory field",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Hívja az add.phone-t min. nagyobbnak vagy egyenlőnek kell lennie, mint",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Kötelezően kitöltendő mező"
+      "TRUNK_REQUIRED": "Mandatory field"
     },
     "GENERAL": "General",
     "AGENTTIMEOUT": "Agent Timeout",
     "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress",
     "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available",
     "PREVIEW_AUTO_RECALL_ME": "Automate Recall Me calls",
-    "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder",
-    "ADDITIONALPHONES": "További telefonok",
-    "CALLADDITIONALPHONEAFTERMIN": "Hívjon egy másik telefonszámot [perc] után"
+    "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder"
   }
 }
index eb5c532..b6cd387 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Nilainya harus kurang dari atau sama dengan",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Nilainya harus kurang dari atau sama dengan",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Nilainya harus kurang dari atau sama dengan",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Nilainya harus kurang dari atau sama dengan",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Hubungi add.phone setelah min. harus lebih besar dari atau sama dengan",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Bidang wajib"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Nilainya harus kurang dari atau sama dengan"
     },
     "HELP": {
       "ACTIVE": "Aktif",
     "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung",
     "SECOND_LEVEL_DISPOSITION": "Disposisi Tingkat Kedua",
     "THIRD_LEVEL_DISPOSITION": "Disposisi Tingkat Ketiga",
-    "ADDITIONALPHONES": "Telepon tambahan",
-    "CALLADDITIONALPHONEAFTERMIN": "Hubungi telepon tambahan setelah [mnt]",
     "PREVIEW_AUTO_RECALL_ME": "Otomatiskan panggilan Recall Me",
     "PREVIEW_RECALL_ME_REMINDER": "Ingatkan Saya Pengingat"
   }
index aac0833..e12abd3 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Il valore deve essere minore o uguale a",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Il valore deve essere minore o uguale a",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Il valore deve essere minore o uguale a",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Il valore deve essere minore o uguale a",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Chiama agg.telefono dopo min. dovrebbe essere maggiore o uguale a",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Campo obbligatorio"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Il valore deve essere minore o uguale a"
     },
     "GENERAL": "Generale",
     "TIMEOUT": "Timeout",
     "NOSUCHNUMBERRETRYTIME": "Riprova [min]",
     "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile",
     "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso",
-    "ADDITIONALPHONES": "Telefoni aggiuntivi",
-    "CALLADDITIONALPHONEAFTERMIN": "Chiama telefono aggiuntivo dopo [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatizza chiamate Recall Me",
     "PREVIEW_RECALL_ME_REMINDER": "Ricordami Promemoria"
   }
index 1ea82ce..37e13cc 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "値は以下でなければなりません",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "値は以下でなければなりません",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "値は以下でなければなりません",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "値は以下でなければなりません",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "分後にadd.phoneを呼び出します。以上である必要があります",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "必須フィールド"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "値は以下でなければなりません"
     },
     "HELP": {
       "ACTIVE": "アクティブ",
     "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中",
     "SECOND_LEVEL_DISPOSITION": "第2レベルの気質",
     "THIRD_LEVEL_DISPOSITION": "第3レベルの気質",
-    "ADDITIONALPHONES": "追加の電話",
-    "CALLADDITIONALPHONEAFTERMIN": "[分]後に追加の電話をかける",
     "PREVIEW_AUTO_RECALL_ME": "リコールミーコールを自動化する",
     "PREVIEW_RECALL_ME_REMINDER": "リマインダーを思い出してください"
   }
index 5d0283a..0f01b3e 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "값은 다음보다 작거나 같아야합니다.",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "값은 다음보다 작거나 같아야합니다.",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "값은 다음보다 작거나 같아야합니다.",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "값은 다음보다 작거나 같아야합니다.",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "분 후에 add.phone에 전화를 겁니다. 보다 크거나 같아야 합니다.",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "필수 필드"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "값은 다음보다 작거나 같아야합니다."
     },
     "GENERAL": "일반",
     "AGENTTIMEOUT": "상담원 시간 초과",
     "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중",
     "SECOND_LEVEL_DISPOSITION": "두 번째 수준 처리",
     "THIRD_LEVEL_DISPOSITION": "3 단계 처리",
-    "ADDITIONALPHONES": "추가 전화",
-    "CALLADDITIONALPHONEAFTERMIN": "[min] 후 추가 전화 걸기",
     "PREVIEW_AUTO_RECALL_ME": "자동 회상 전화",
     "PREVIEW_RECALL_ME_REMINDER": "리콜 미 리마인더"
   }
index f7ffb86..2d60bd1 100644 (file)
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vertė turi būti mažesnė arba lygi",
       "NOSUCHNUMBERMAXRETRY_REQUIRED": "Privalomas laukas",
       "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vertė turi būti mažesnė arba lygi",
-      "NOSUCHNUMBERRETRYTIME_REQUIRED": "Privalomas laukas",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Skambinti add.phone po min. turėtų būti didesnis arba lygus",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Privalomas laukas"
+      "NOSUCHNUMBERRETRYTIME_REQUIRED": "Privalomas laukas"
     },
     "GENERAL": "Bendras",
     "AGENTTIMEOUT": "Agento laikas",
     "NOSUCHNUMBERRETRYTIME": "Pakartojimų laikas [min.]",
     "SECOND_LEVEL_DISPOSITION": "Antro lygio disponavimas",
     "THIRD_LEVEL_DISPOSITION": "Trečiojo lygio disponavimas",
-    "ADDITIONALPHONES": "Papildomi telefonai",
-    "CALLADDITIONALPHONEAFTERMIN": "Paskambinkite papildomu telefonu po [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatizuokite „Recall Me“ skambučius",
     "PREVIEW_RECALL_ME_REMINDER": "Prisiminkite man priminimą"
   }
index 09d6f09..57fb5e9 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vērtībai jābūt mazākai vai vienādai ar",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vērtībai jābūt mazākai vai vienādai ar",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vērtībai jābūt mazākai vai vienādai ar",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vērtībai jābūt mazākai vai vienādai ar",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zvans add.phone pēc min. jābūt lielākam vai vienādam ar",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Obligāts lauks"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vērtībai jābūt mazākai vai vienādai ar"
     },
     "HELP": {
       "TIMEOUT": "Sekunžu skaits, lai piezvanītu aģentam rindā",
     "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana",
     "SECOND_LEVEL_DISPOSITION": "Otrā līmeņa izvietojums",
     "THIRD_LEVEL_DISPOSITION": "Trešā līmeņa izvietojums",
-    "ADDITIONALPHONES": "Papildu tālruņi",
-    "CALLADDITIONALPHONEAFTERMIN": "Zvaniet uz papildu tālruni pēc [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatizējiet Recall Me zvanus",
     "PREVIEW_RECALL_ME_REMINDER": "Recall Me Reminder"
   }
index 978ebaf..6b40a6f 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk zijn aan",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk zijn aan",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk zijn aan",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk zijn aan",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Bel add.phone na min. moet groter zijn dan of gelijk zijn aan",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Verplicht veld"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "De waarde moet kleiner zijn dan of gelijk zijn aan"
     },
     "GENERAL": "Algemeen",
     "AGENTTIMEOUT": "Time-out agent",
     "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig",
     "SECOND_LEVEL_DISPOSITION": "Tweede niveau dispositie",
     "THIRD_LEVEL_DISPOSITION": "Dispositie op het derde niveau",
-    "ADDITIONALPHONES": "Extra telefoons",
-    "CALLADDITIONALPHONEAFTERMIN": "Extra telefoon bellen na [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatisch terugbellen oproepen",
     "PREVIEW_RECALL_ME_REMINDER": "Herinner me herinnering"
   }
index 84510d7..310f5da 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Verdien må være mindre enn eller lik",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Verdien må være mindre enn eller lik",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Verdien må være mindre enn eller lik",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Verdien må være mindre enn eller lik",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Ring tilleggstelefon etter min. skal være større enn eller lik",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Obligatoriske felt"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Verdien må være mindre enn eller lik"
     },
     "GENERAL": "Generelt",
     "AGENTTIMEOUT": "Agent tidsavbrudd",
     "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår",
     "SECOND_LEVEL_DISPOSITION": "Andre nivå disposisjon",
     "THIRD_LEVEL_DISPOSITION": "Tredje nivå disposisjon",
-    "ADDITIONALPHONES": "Ekstra telefoner",
-    "CALLADDITIONALPHONEAFTERMIN": "Ring ytterligere telefon etter [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatiser Recall Me-samtaler",
     "PREVIEW_RECALL_ME_REMINDER": "Husk meg påminnelse"
   }
index f0e23e0..dd86593 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wartość musi być mniejsza lub równa",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wartość musi być mniejsza lub równa",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wartość musi być mniejsza lub równa",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wartość musi być mniejsza lub równa",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zadzwoń na ad.telefon po min. powinna być większa lub równa",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Pole obowiązkowe"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wartość musi być mniejsza lub równa"
     },
     "GENERAL": "Ogólne",
     "AGENTTIMEOUT": "Agent Timeout",
     "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu",
     "SECOND_LEVEL_DISPOSITION": "Dyspozycja drugiego poziomu",
     "THIRD_LEVEL_DISPOSITION": "Dyspozycja trzeciego poziomu",
-    "ADDITIONALPHONES": "Dodatkowe telefony",
-    "CALLADDITIONALPHONEAFTERMIN": "Zadzwoń na dodatkowy telefon po [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatyzacja połączeń typu Przypomnij mnie",
     "PREVIEW_RECALL_ME_REMINDER": "Przypomnij mi przypomnienie"
   }
index 6f70beb..1d96551 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Ligue para add.phone após min. deve ser maior ou igual a",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Campo obrigatório"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a"
     },
     "GENERAL": "Geral",
     "AGENTTIMEOUT": "Tempo limite do agente",
     "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento",
     "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível",
     "THIRD_LEVEL_DISPOSITION": "Disposição de terceiro nível",
-    "ADDITIONALPHONES": "Telefones adicionais",
-    "CALLADDITIONALPHONEAFTERMIN": "Ligue para outro telefone após [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatizar Chamadas Recall Me",
     "PREVIEW_RECALL_ME_REMINDER": "Lembrete para me lembrar"
   }
index 58243fa..8724cba 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Ligue para add.phone após min. deve ser maior ou igual a",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Campo obrigatório"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "O valor deve ser menor ou igual a"
     },
     "GENERAL": "Geral",
     "AGENTTIMEOUT": "Tempo Limite do Agente",
     "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento",
     "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível",
     "THIRD_LEVEL_DISPOSITION": "Disposição de terceiro nível",
-    "ADDITIONALPHONES": "Telefones adicionais",
-    "CALLADDITIONALPHONEAFTERMIN": "Ligue para outro telefone após [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatizar Chamadas Recall Me",
     "PREVIEW_RECALL_ME_REMINDER": "Lembrete para me lembrar"
   }
index 85e307f..edbf977 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Значение должно быть меньше или равно",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Значение должно быть меньше или равно",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Значение должно быть меньше или равно",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Значение должно быть меньше или равно",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Звоните на доп. Телефон через мин. должно быть больше или равно",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Обязательное поле"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Значение должно быть меньше или равно"
     },
     "GENERAL": "Генеральной",
     "AGENTTIMEOUT": "Время ожидания оператора",
     "NOSUCHNUMBERRETRYTIME": "Время повтора [мин]",
     "SECOND_LEVEL_DISPOSITION": "Расположение второго уровня",
     "THIRD_LEVEL_DISPOSITION": "Расположение третьего уровня",
-    "ADDITIONALPHONES": "Дополнительные телефоны",
-    "CALLADDITIONALPHONEAFTERMIN": "Позвонить на дополнительный телефон через [мин]",
     "PREVIEW_AUTO_RECALL_ME": "Автоматическая функция \"Перезвоните мне\"",
     "PREVIEW_RECALL_ME_REMINDER": "Напомнить мне"
   }
index 5092fe6..d8fee75 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Värdet måste vara mindre än eller lika med",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Värdet måste vara mindre än eller lika med",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Värdet måste vara mindre än eller lika med",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Värdet måste vara mindre än eller lika med",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Ring till. Telefon efter min. bör vara större än eller lika med",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Obligatoriskt fält"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Värdet måste vara mindre än eller lika med"
     },
     "GENERAL": "Allmänt",
     "AGENTTIMEOUT": "Tidsgräns för agent",
     "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår",
     "SECOND_LEVEL_DISPOSITION": "Andra nivån disposition",
     "THIRD_LEVEL_DISPOSITION": "Tredje nivåens disposition",
-    "ADDITIONALPHONES": "Ytterligare telefoner",
-    "CALLADDITIONALPHONEAFTERMIN": "Ring ytterligare telefon efter [min]",
     "PREVIEW_AUTO_RECALL_ME": "Automatisera Recall Me-samtal",
     "PREVIEW_RECALL_ME_REMINDER": "Påminnelse om mig"
   }
index a58c205..10d7b56 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Değer şundan küçük veya ona eşit olmalıdır",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Değer şundan küçük veya ona eşit olmalıdır",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Değer şundan küçük veya ona eşit olmalıdır",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Değer şundan küçük veya ona eşit olmalıdır",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Dakikadan sonra add.phone'u arayın. daha büyük veya eşit olmalıdır",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Zorunlu alan"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Değer şundan küçük veya ona eşit olmalıdır"
     },
     "GENERAL": "Genel",
     "AGENTTIMEOUT": "Ajan Zaman Aşımı",
     "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor",
     "SECOND_LEVEL_DISPOSITION": "İkinci Düzey Tasarruf",
     "THIRD_LEVEL_DISPOSITION": "Üçüncü Düzey Tasarruf",
-    "ADDITIONALPHONES": "Ek telefonlar",
-    "CALLADDITIONALPHONEAFTERMIN": "[dk] sonra ek telefonu arayın",
     "PREVIEW_AUTO_RECALL_ME": "Beni Geri Çağır aramalarını otomatikleştir",
     "PREVIEW_RECALL_ME_REMINDER": "Beni Hatırla Hatırlatma"
   }
index 5c8b42e..975184b 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "该值必须小于或等于",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "该值必须小于或等于",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "该值必须小于或等于",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "该值必须小于或等于",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "分钟后拨打 add.phone。应该大于或等于",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "必填项"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "该值必须小于或等于"
     },
     "GENERAL": "总的",
     "AGENTTIMEOUT": "代理超时",
     "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中",
     "SECOND_LEVEL_DISPOSITION": "二级处置",
     "THIRD_LEVEL_DISPOSITION": "第三级处置",
-    "ADDITIONALPHONES": "附加电话",
-    "CALLADDITIONALPHONEAFTERMIN": "[分钟] 后拨打其他电话",
     "PREVIEW_AUTO_RECALL_ME": "自动回叫我电话",
     "PREVIEW_RECALL_ME_REMINDER": "记得提醒我"
   }
index 7e62a71..1c86342 100644 (file)
       "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "該值必須小於或等於",
       "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "該值必須小於或等於",
       "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "該值必須小於或等於",
-      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "該值必須小於或等於",
-      "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "分鐘後撥打 add.phone。應該大於或等於",
-      "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "必填項"
+      "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "該值必須小於或等於"
     },
     "GENERAL": "通用",
     "AGENTTIMEOUT": "值機人員等候逾時",
     "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中",
     "SECOND_LEVEL_DISPOSITION": "二級處置",
     "THIRD_LEVEL_DISPOSITION": "第三級處置",
-    "ADDITIONALPHONES": "附加電話",
-    "CALLADDITIONALPHONEAFTERMIN": "[分鐘] 後撥打其他電話",
     "PREVIEW_AUTO_RECALL_ME": "自動回叫我電話",
     "PREVIEW_RECALL_ME_REMINDER": "記得提醒我"
   }
index e85233d..49adc37 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "ترتيب المستوى الثاني",
     "SELECT_LEVEL": "حدد مستوى",
     "TITLEFONTSIZE": "حجم عنوان الخط",
-    "ADD_CONTACTITEMTYPE": "يضيف",
-    "CONTACTITEMTYPE": "أنواع عناصر الاتصال",
-    "NEW_CONTACTITEMTYPE": "نوع عنصر اتصال جديد",
-    "ORDER_BY": "ترتيب حسب",
-    "RGBBACKGROUNDCOLOR": "لون الخلفية RGB",
     "EMAIL": "بريد إلكتروني",
     "FILTERCHATWEBSITES": "تصفية مواقع الدردشة",
     "FILTEREMAILACCOUNTS": "تصفية حسابات البريد الإلكتروني",
     "OPENED_TEXT": "التفاعلات المفتوحة",
     "IGNOREDIALERCONTACTID": "تجاهل معرف جهة الاتصال",
     "MAIL_SUBSTATUS": "حالة البريد الإلكتروني الفرعية",
-    "OFFLINE_MESSAGE": "رسالة دون اتصال",
-    "DELETE_CONTACTITEMTYPE": "حذف نوع عنصر جهة الاتصال",
-    "EDIT_CONTACTITEMTYPE": "تحرير نوع عنصر الاتصال",
-    "ORDER_BY_NUMERIC": "يجب أن يكون الترتيب حسب الحقل قيمة رقمية!"
+    "OFFLINE_MESSAGE": "رسالة دون اتصال"
   }
 }
index 4929bab..8712e7a 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Dispozice druhé úrovně",
     "SELECT_LEVEL": "Vyberte úroveň",
     "TITLEFONTSIZE": "Velikost názvu písma",
-    "ADD_CONTACTITEMTYPE": "Přidat",
-    "CONTACTITEMTYPE": "Kontaktujte typy položek",
-    "NEW_CONTACTITEMTYPE": "Nový typ položky kontaktu",
-    "ORDER_BY": "Seřadit podle",
-    "RGBBACKGROUNDCOLOR": "Barva pozadí RGB",
     "EMAIL": "E-mailem",
     "FILTERCHATWEBSITES": "Filtrujte webové stránky chatu",
     "FILTEREMAILACCOUNTS": "Filtrovat e -mailové účty",
     "OPENED_TEXT": "Otevřené interakce",
     "IGNOREDIALERCONTACTID": "Ignorovat ID kontaktu vytáčení",
     "MAIL_SUBSTATUS": "E-mail Substatus",
-    "OFFLINE_MESSAGE": "Zpráva offline",
-    "DELETE_CONTACTITEMTYPE": "Smazat typ položky kontaktu",
-    "EDIT_CONTACTITEMTYPE": "Upravit typ položky kontaktu",
-    "ORDER_BY_NUMERIC": "Řazení podle pole by měla být číselná hodnota!"
+    "OFFLINE_MESSAGE": "Zpráva offline"
   }
 }
index 1530633..7104354 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Andet niveau disposition",
     "SELECT_LEVEL": "Vælg et niveau",
     "TITLEFONTSIZE": "Skrifttitelstørrelse",
-    "ADD_CONTACTITEMTYPE": "Tilføje",
-    "CONTACTITEMTYPE": "Kontaktelementtyper",
-    "NEW_CONTACTITEMTYPE": "Ny type kontaktperson",
-    "ORDER_BY": "Bestil inden",
-    "RGBBACKGROUNDCOLOR": "RGB Baggrundsfarve",
     "EMAIL": "E -mail",
     "FILTERCHATWEBSITES": "Filtrer chatwebsteder",
     "FILTEREMAILACCOUNTS": "Filtrer e -mail -konti",
     "OPENED_TEXT": "Åbnede interaktioner",
     "IGNOREDIALERCONTACTID": "Ignorer opkaldskontakt-id",
     "MAIL_SUBSTATUS": "E-mail understatus",
-    "OFFLINE_MESSAGE": "Offline besked",
-    "DELETE_CONTACTITEMTYPE": "Slet kontaktelementtype",
-    "EDIT_CONTACTITEMTYPE": "Rediger kontaktelementtype",
-    "ORDER_BY_NUMERIC": "Rækkefølge efter felt skal være numerisk!"
+    "OFFLINE_MESSAGE": "Offline besked"
   }
 }
index 4489cf0..28b91cf 100644 (file)
     "STANDARD": "Standard",
     "MOTION_BAR": "Motion Bar",
     "ALL": "Alle",
-    "ALL_DISPOSITIONS": "Alle Qualifizierungen",
-    "FIRST_LEVEL_DISPOSITION": "Qualifizierung Ebene 1",
-    "LEVEL": "Ebene",
-    "SECOND_LEVEL_DISPOSITION": "Qualifizierung Ebene 2",
-    "SELECT_LEVEL": "Ebene auswählen",
-    "TITLEFONTSIZE": "Schriftgröße Titel",
-    "ADD_CONTACTITEMTYPE": "Hinzufügen",
-    "CONTACTITEMTYPE": "Kontaktartikeltypen",
-    "NEW_CONTACTITEMTYPE": "Neuer Kontaktelementtyp",
-    "ORDER_BY": "Sortieren nach",
-    "RGBBACKGROUNDCOLOR": "RGB-Hintergrundfarbe",
     "EMAIL": "Email",
     "FILTERCHATWEBSITES": "Chat-Websites filtern",
     "FILTEREMAILACCOUNTS": "E-Mail-Konten filtern",
     "MANAGED_TEXT": "Verwaltete Interaktionen",
     "OPENED": "Geöffnet",
     "OPENED_TEXT": "Geöffnete Interaktionen",
+    "ALL_DISPOSITIONS": "Alle Qualifizierungen",
+    "FIRST_LEVEL_DISPOSITION": "Qualifizierung Ebene 1",
+    "LEVEL": "Ebene",
+    "SECOND_LEVEL_DISPOSITION": "Qualifizierung Ebene 2",
+    "SELECT_LEVEL": "Ebene auswählen",
+    "TITLEFONTSIZE": "Schriftgröße Titel",
     "IGNOREDIALERCONTACTID": "Wählkontakt-ID ignorieren",
     "MAIL_SUBSTATUS": "E-Mail Zwischenstatus",
-    "OFFLINE_MESSAGE": "Offline-Nachricht",
-    "DELETE_CONTACTITEMTYPE": "Kontaktelementtyp löschen",
-    "EDIT_CONTACTITEMTYPE": "Kontaktelementtyp bearbeiten",
-    "ORDER_BY_NUMERIC": "Sortieren nach Feld sollte ein numerischer Wert sein!"
+    "OFFLINE_MESSAGE": "Offline-Nachricht"
   }
 }
index 306ec24..320012b 100644 (file)
     "WAITING": "Waiting",
     "TALKING": "Talking",
     "ANSWERED": "Answered",
-    "CONTACTITEMTYPE": "Contact item types",
-    "ORDER_BY": "Order by",
-    "RGBBACKGROUNDCOLOR": "RGB Background color",
-    "NEW_CONTACTITEMTYPE": "New contact item type",
-    "EDIT_CONTACTITEMTYPE": "Edit contact item type",
-    "DELETE_CONTACTITEMTYPE": "Delete contact item type",
-    "ORDER_BY_NUMERIC": "Order by field should be numeric value!",
-    "ADD_CONTACTITEMTYPE": "Add",
     "UNMANAGED": "Unmanaged",
     "CUSTOMTYPE": "Custom [path]",
     "WEBREPORT": "Web Report",
index 63007b6..db925dc 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Tipificación de segundo nivel",
     "SELECT_LEVEL": "Seleccionar un nivel",
     "TITLEFONTSIZE": "Tamaño del título de fuente",
-    "ADD_CONTACTITEMTYPE": "Agregar",
-    "CONTACTITEMTYPE": "Tipos de elementos de contacto",
-    "NEW_CONTACTITEMTYPE": "Nuevo tipo de elemento de contacto",
-    "ORDER_BY": "Ordenar por",
-    "RGBBACKGROUNDCOLOR": "Color de fondo RGB",
     "EMAIL": "Correo electrónico",
     "FILTERCHATWEBSITES": "Filtrar sitios web de chat",
     "FILTEREMAILACCOUNTS": "Filtrar cuentas de correo electrónico",
     "OPENED_TEXT": "Interacciones abiertas",
     "IGNOREDIALERCONTACTID": "Ignorar la identificación del contacto del marcador",
     "MAIL_SUBSTATUS": "Subestado de correo electrónico",
-    "OFFLINE_MESSAGE": "Mensaje sin conexión",
-    "DELETE_CONTACTITEMTYPE": "Eliminar tipo de elemento de contacto",
-    "EDIT_CONTACTITEMTYPE": "Editar tipo de elemento de contacto",
-    "ORDER_BY_NUMERIC": "¡El orden por campo debe ser un valor numérico!"
+    "OFFLINE_MESSAGE": "Mensaje sin conexión"
   }
 }
index 48b85d3..a6ad9fa 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Teise taseme korraldus",
     "SELECT_LEVEL": "Valige tase",
     "TITLEFONTSIZE": "Fondi pealkirja suurus",
-    "ADD_CONTACTITEMTYPE": "Lisama",
-    "CONTACTITEMTYPE": "Kontaktüksuste tüübid",
-    "NEW_CONTACTITEMTYPE": "Uus kontaktüksuse tüüp",
-    "ORDER_BY": "Telli",
-    "RGBBACKGROUNDCOLOR": "RGB taustavärv",
     "EMAIL": "E -post",
     "FILTERCHATWEBSITES": "Filtreeri vestluse veebisaite",
     "FILTEREMAILACCOUNTS": "E -posti kontode filtreerimine",
     "OPENED_TEXT": "Avatud interaktsioonid",
     "IGNOREDIALERCONTACTID": "Ignoreeri helistaja kontakti ID",
     "MAIL_SUBSTATUS": "Meili alamolek",
-    "OFFLINE_MESSAGE": "Võrguühenduseta sõnum",
-    "DELETE_CONTACTITEMTYPE": "Kustuta kontaktiüksuse tüüp",
-    "EDIT_CONTACTITEMTYPE": "Redigeerige kontaktiüksuse tüüpi",
-    "ORDER_BY_NUMERIC": "Järjestus välja järgi peab olema numbriline!"
+    "OFFLINE_MESSAGE": "Võrguühenduseta sõnum"
   }
 }
index 4618bed..abd1c71 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "دفع سطح دوم",
     "SELECT_LEVEL": "یک سطح را انتخاب کنید",
     "TITLEFONTSIZE": "اندازه عنوان قلم",
-    "ADD_CONTACTITEMTYPE": "اضافه کردن",
-    "CONTACTITEMTYPE": "تماس با انواع آیتم ها",
-    "NEW_CONTACTITEMTYPE": "نوع مورد مخاطب جدید",
-    "ORDER_BY": "سفارش توسط",
-    "RGBBACKGROUNDCOLOR": "رنگ پس زمینه RGB",
     "EMAIL": "پست الکترونیک",
     "FILTERCHATWEBSITES": "وب سایت های چت را فیلتر کنید",
     "FILTEREMAILACCOUNTS": "فیلتر کردن حساب های ایمیل",
     "OPENED_TEXT": "تعاملات باز شده",
     "IGNOREDIALERCONTACTID": "نادیده گرفتن شناسه تماس شماره گیر",
     "MAIL_SUBSTATUS": "وضعیت فرعی ایمیل",
-    "OFFLINE_MESSAGE": "پیام آفلاین",
-    "DELETE_CONTACTITEMTYPE": "حذف نوع مورد تماس",
-    "EDIT_CONTACTITEMTYPE": "نوع مورد تماس را ویرایش کنید",
-    "ORDER_BY_NUMERIC": "ترتیب بر اساس فیلد باید مقدار عددی باشد!"
+    "OFFLINE_MESSAGE": "پیام آفلاین"
   }
 }
index 93cea9b..54e2ee2 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Toisen tason sijoitus",
     "SELECT_LEVEL": "Valitse taso",
     "TITLEFONTSIZE": "Kirjasimen otsikon koko",
-    "ADD_CONTACTITEMTYPE": "Lisätä",
-    "CONTACTITEMTYPE": "Yhteystietojen tyypit",
-    "NEW_CONTACTITEMTYPE": "Uusi yhteyshenkilötyyppi",
-    "ORDER_BY": "Tilaa",
-    "RGBBACKGROUNDCOLOR": "RGB -taustaväri",
     "EMAIL": "Sähköposti",
     "FILTERCHATWEBSITES": "Suodata chat -verkkosivustot",
     "FILTEREMAILACCOUNTS": "Suodata sähköpostitilit",
     "OPENED_TEXT": "Avatut vuorovaikutukset",
     "IGNOREDIALERCONTACTID": "Ohita soittajan yhteystiedot",
     "MAIL_SUBSTATUS": "Sähköpostin alitila",
-    "OFFLINE_MESSAGE": "Offline-viesti",
-    "DELETE_CONTACTITEMTYPE": "Poista yhteystietotyyppi",
-    "EDIT_CONTACTITEMTYPE": "Muokkaa yhteystietotyyppiä",
-    "ORDER_BY_NUMERIC": "Kenttien järjestyksen tulee olla numeerinen arvo!"
+    "OFFLINE_MESSAGE": "Offline-viesti"
   }
 }
index e3843c2..c7093fa 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Disposition de deuxième niveau",
     "SELECT_LEVEL": "Sélectionnez un niveau",
     "TITLEFONTSIZE": "Taille du titre de la police",
-    "ADD_CONTACTITEMTYPE": "Ajouter",
-    "CONTACTITEMTYPE": "Types d'articles de contact",
-    "NEW_CONTACTITEMTYPE": "Nouveau type d'élément de contact",
-    "ORDER_BY": "Commandé par",
-    "RGBBACKGROUNDCOLOR": "Couleur d'arrière-plan RVB",
     "EMAIL": "E-mail",
     "FILTERCHATWEBSITES": "Filtrer les sites de chat",
     "FILTEREMAILACCOUNTS": "Filtrer les comptes de messagerie",
     "OPENED_TEXT": "Interactions ouvertes",
     "IGNOREDIALERCONTACTID": "Ignorer l'identifiant du contact du numéroteur",
     "MAIL_SUBSTATUS": "Sous-statut de l'e-mail",
-    "OFFLINE_MESSAGE": "Message hors ligne",
-    "DELETE_CONTACTITEMTYPE": "Supprimer le type d'élément de contact",
-    "EDIT_CONTACTITEMTYPE": "Modifier le type d'élément de contact",
-    "ORDER_BY_NUMERIC": "L'ordre par champ doit être une valeur numérique !"
+    "OFFLINE_MESSAGE": "Message hors ligne"
   }
 }
index 61696ae..ab7c39a 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "נטייה בדרגה שנייה",
     "SELECT_LEVEL": "בחר רמה",
     "TITLEFONTSIZE": "גודל כותרת הגופן",
-    "ADD_CONTACTITEMTYPE": "לְהוֹסִיף",
-    "CONTACTITEMTYPE": "סוגי פריטי איש קשר",
-    "NEW_CONTACTITEMTYPE": "סוג פריט איש קשר חדש",
-    "ORDER_BY": "מיין לפי",
-    "RGBBACKGROUNDCOLOR": "צבע רקע RGB",
     "EMAIL": "אימייל",
     "FILTERCHATWEBSITES": "סנן אתרי צ'אט",
     "FILTEREMAILACCOUNTS": "סנן חשבונות דוא\"ל",
     "OPENED_TEXT": "אינטראקציות פתוחות",
     "IGNOREDIALERCONTACTID": "התעלם מזהה איש קשר חייגן",
     "MAIL_SUBSTATUS": "תת סטטוס דוא\"ל",
-    "OFFLINE_MESSAGE": "הודעה לא מקוונת",
-    "DELETE_CONTACTITEMTYPE": "מחק את סוג פריט איש הקשר",
-    "EDIT_CONTACTITEMTYPE": "ערוך את סוג פריט איש הקשר",
-    "ORDER_BY_NUMERIC": "סדר לפי שדה צריך להיות ערך מספרי!"
+    "OFFLINE_MESSAGE": "הודעה לא מקוונת"
   }
 }
index 2a27fba..77700e3 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "दूसरा स्तर विवाद",
     "SELECT_LEVEL": "एक स्तर चुनें",
     "TITLEFONTSIZE": "फ़ॉन्ट शीर्षक आकार",
-    "ADD_CONTACTITEMTYPE": "जोड़ें",
-    "CONTACTITEMTYPE": "संपर्क आइटम प्रकार",
-    "NEW_CONTACTITEMTYPE": "नया संपर्क आइटम प्रकार",
-    "ORDER_BY": "द्वारा आदेश",
-    "RGBBACKGROUNDCOLOR": "आरजीबी पृष्ठभूमि रंग",
     "EMAIL": "ईमेल",
     "FILTERCHATWEBSITES": "चैट वेबसाइटों को फ़िल्टर करें",
     "FILTEREMAILACCOUNTS": "ईमेल खातों को फ़िल्टर करें",
     "OPENED_TEXT": "खुली बातचीत",
     "IGNOREDIALERCONTACTID": "डायलर संपर्क आईडी पर ध्यान न दें",
     "MAIL_SUBSTATUS": "ईमेल सबस्टैटस",
-    "OFFLINE_MESSAGE": "ऑफ़लाइन संदेश",
-    "DELETE_CONTACTITEMTYPE": "संपर्क आइटम प्रकार हटाएं",
-    "EDIT_CONTACTITEMTYPE": "संपर्क आइटम प्रकार संपादित करें",
-    "ORDER_BY_NUMERIC": "फ़ील्ड के अनुसार क्रम संख्यात्मक मान होना चाहिए!"
+    "OFFLINE_MESSAGE": "ऑफ़लाइन संदेश"
   }
 }
index 922e3cd..1a21f51 100644 (file)
     "MANAGED_TEXT": "Kezelt interakciók",
     "OFFLINE_MESSAGE": "Offline üzenet",
     "OPENED": "Nyitott",
-    "OPENED_TEXT": "Megnyitott interakciók",
-    "ADD_CONTACTITEMTYPE": "Hozzáadás",
-    "CONTACTITEMTYPE": "Kapcsolati elem típusai",
-    "DELETE_CONTACTITEMTYPE": "Kapcsolati elem típusának törlése",
-    "EDIT_CONTACTITEMTYPE": "Kapcsolati elem típusának szerkesztése",
-    "NEW_CONTACTITEMTYPE": "Új kapcsolati elem típusa",
-    "ORDER_BY": "Rendezés",
-    "ORDER_BY_NUMERIC": "A mező szerinti sorrend numerikus legyen!",
-    "RGBBACKGROUNDCOLOR": "RGB háttérszín"
+    "OPENED_TEXT": "Megnyitott interakciók"
   }
 }
index 47e9aca..0457a5f 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Disposisi Tingkat Kedua",
     "SELECT_LEVEL": "Pilih level",
     "TITLEFONTSIZE": "Ukuran Judul Font",
-    "ADD_CONTACTITEMTYPE": "Menambahkan",
-    "CONTACTITEMTYPE": "Jenis item kontak",
-    "NEW_CONTACTITEMTYPE": "Jenis item kontak baru",
-    "ORDER_BY": "Dipesan oleh",
-    "RGBBACKGROUNDCOLOR": "Warna Latar RGB",
     "EMAIL": "Surel",
     "FILTERCHATWEBSITES": "Filter Situs Web Obrolan",
     "FILTEREMAILACCOUNTS": "Filter Akun Email",
     "OPENED_TEXT": "Interaksi Terbuka",
     "IGNOREDIALERCONTACTID": "Abaikan Id kontak dialer",
     "MAIL_SUBSTATUS": "Substatus Email",
-    "OFFLINE_MESSAGE": "Pesan Offline",
-    "DELETE_CONTACTITEMTYPE": "Hapus jenis item kontak",
-    "EDIT_CONTACTITEMTYPE": "Edit jenis item kontak",
-    "ORDER_BY_NUMERIC": "Urutan berdasarkan bidang harus berupa nilai numerik!"
+    "OFFLINE_MESSAGE": "Pesan Offline"
   }
 }
index 4a63be7..5507b29 100644 (file)
@@ -16,7 +16,6 @@
     "FONTSIZE": "Dimensione Font",
     "TITLEFONTSIZE": "Dimensione Font Titolo",
     "CLONE_CUSTOMDASHBOARD": "Clona Dashboard Personalizzata",
-    "ORDER_BY_NUMERIC": "Il campo Ordinamento deve essere numerico!",
     "LINK": "Link [https://]",
     "BACKGROUND": "Background",
     "FOREGROUND": "Foreground",
@@ -24,8 +23,6 @@
     "NONE": "Nessuno",
     "TOTAL": "Totale",
     "ABANDONED": "Abbandonate",
-    "EDIT_CONTACTITEMTYPE": "Modifica tipo di contatto",
-    "DELETE_CONTACTITEMTYPE": "Elimina tipo di contatto",
     "WAITING": "In Attesa",
     "TALKING": "Attive",
     "ANSWERED": "Risposte",
     "AUTOCREATE_FIELD": "Campo autocreazione",
     "STANDARD": "Standard",
     "GLOBALS": "Globali",
-    "MOTION_BAR": "Motion Bar",
-    "ADD_CONTACTITEMTYPE": "Aggiungere",
-    "CONTACTITEMTYPE": "Tipi di elementi di contatto",
-    "NEW_CONTACTITEMTYPE": "Nuovo tipo di elemento di contatto",
-    "ORDER_BY": "Ordinato da",
-    "RGBBACKGROUNDCOLOR": "Colore di sfondo RGB"
+    "MOTION_BAR": "Motion Bar"
   }
 }
index 7a333dc..b4c762a 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "第2レベルの気質",
     "SELECT_LEVEL": "レベルを選択してください",
     "TITLEFONTSIZE": "フォントタイトルサイズ",
-    "ADD_CONTACTITEMTYPE": "追加",
-    "CONTACTITEMTYPE": "連絡先アイテムの種類",
-    "NEW_CONTACTITEMTYPE": "新しい連絡先アイテムタイプ",
-    "ORDER_BY": "注文する",
-    "RGBBACKGROUNDCOLOR": "RGB背景色",
     "EMAIL": "Eメール",
     "FILTERCHATWEBSITES": "チャットWebサイトのフィルター",
     "FILTEREMAILACCOUNTS": "メールアカウントのフィルタリング",
     "OPENED_TEXT": "開かれた相互作用",
     "IGNOREDIALERCONTACTID": "ダイヤラーの連絡先IDを無視する",
     "MAIL_SUBSTATUS": "メールサブステータス",
-    "OFFLINE_MESSAGE": "オフラインメッセージ",
-    "DELETE_CONTACTITEMTYPE": "連絡先アイテムタイプを削除",
-    "EDIT_CONTACTITEMTYPE": "連絡先アイテムタイプの編集",
-    "ORDER_BY_NUMERIC": "フィールド順は数値である必要があります。"
+    "OFFLINE_MESSAGE": "オフラインメッセージ"
   }
 }
index ced8253..340ae67 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "두 번째 수준 처리",
     "SELECT_LEVEL": "레벨 선택",
     "TITLEFONTSIZE": "글꼴 제목 크기",
-    "ADD_CONTACTITEMTYPE": "추가하다",
-    "CONTACTITEMTYPE": "연락처 항목 유형",
-    "NEW_CONTACTITEMTYPE": "새 연락처 항목 유형",
-    "ORDER_BY": "주문",
-    "RGBBACKGROUNDCOLOR": "RGB 배경색",
     "EMAIL": "이메일",
     "FILTERCHATWEBSITES": "채팅 웹사이트 필터링",
     "FILTEREMAILACCOUNTS": "이메일 계정 필터링",
     "OPENED_TEXT": "열린 상호 작용",
     "IGNOREDIALERCONTACTID": "다이얼러 연락처 ID 무시",
     "MAIL_SUBSTATUS": "이메일 하위 상태",
-    "OFFLINE_MESSAGE": "오프라인 메시지",
-    "DELETE_CONTACTITEMTYPE": "연락처 항목 유형 삭제",
-    "EDIT_CONTACTITEMTYPE": "연락처 항목 유형 수정",
-    "ORDER_BY_NUMERIC": "필드별 정렬은 숫자 값이어야 합니다!"
+    "OFFLINE_MESSAGE": "오프라인 메시지"
   }
 }
index b092210..236d5e4 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Antro lygio disponavimas",
     "SELECT_LEVEL": "Pasirinkite lygį",
     "TITLEFONTSIZE": "Šrifto pavadinimo dydis",
-    "ADD_CONTACTITEMTYPE": "Papildyti",
-    "CONTACTITEMTYPE": "Kontaktinių elementų tipai",
-    "NEW_CONTACTITEMTYPE": "Naujas kontaktinio elemento tipas",
-    "ORDER_BY": "Rūšiuoti pagal",
-    "RGBBACKGROUNDCOLOR": "RGB fono spalva",
     "EMAIL": "Paštu",
     "FILTERCHATWEBSITES": "Filtruokite pokalbių svetaines",
     "FILTEREMAILACCOUNTS": "Filtruoti el. Pašto paskyras",
     "OPENED_TEXT": "Atidarytos sąveikos",
     "IGNOREDIALERCONTACTID": "Ignoruoti rinkiklio kontakto ID",
     "MAIL_SUBSTATUS": "El. pašto būsena",
-    "OFFLINE_MESSAGE": "Pranešimas neprisijungus",
-    "DELETE_CONTACTITEMTYPE": "Ištrinti kontaktinio elemento tipą",
-    "EDIT_CONTACTITEMTYPE": "Redaguoti kontaktinio elemento tipą",
-    "ORDER_BY_NUMERIC": "Užsakymas pagal lauką turi būti skaitinis!"
+    "OFFLINE_MESSAGE": "Pranešimas neprisijungus"
   }
 }
index 2d76687..1b8a4ec 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Otrā līmeņa izvietojums",
     "SELECT_LEVEL": "Atlasiet līmeni",
     "TITLEFONTSIZE": "Fonta nosaukuma lielums",
-    "ADD_CONTACTITEMTYPE": "Pievienot",
-    "CONTACTITEMTYPE": "Kontaktpersonu veidi",
-    "NEW_CONTACTITEMTYPE": "Jauns kontakta vienuma veids",
-    "ORDER_BY": "Sakārtot pēc",
-    "RGBBACKGROUNDCOLOR": "RGB fona krāsa",
     "EMAIL": "E -pasts",
     "FILTERCHATWEBSITES": "Filtrējiet tērzēšanas vietnes",
     "FILTEREMAILACCOUNTS": "Filtrējiet e -pasta kontus",
     "OPENED_TEXT": "Atvērtā mijiedarbība",
     "IGNOREDIALERCONTACTID": "Ignorēt zvanītāja kontaktpersonas ID",
     "MAIL_SUBSTATUS": "E-pasta apakšstatuss",
-    "OFFLINE_MESSAGE": "Bezsaistes ziņojums",
-    "DELETE_CONTACTITEMTYPE": "Dzēst kontaktpersonas vienuma veidu",
-    "EDIT_CONTACTITEMTYPE": "Rediģēt kontaktpersonas vienuma veidu",
-    "ORDER_BY_NUMERIC": "Pasūtījumam pēc lauka jābūt skaitliskām vērtībām!"
+    "OFFLINE_MESSAGE": "Bezsaistes ziņojums"
   }
 }
index 89c0a97..2576728 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Tweede niveau dispositie",
     "SELECT_LEVEL": "Kies een niveau",
     "TITLEFONTSIZE": "Lettertype titelgrootte",
-    "ADD_CONTACTITEMTYPE": "Toevoegen",
-    "CONTACTITEMTYPE": "Typen contactitems",
-    "NEW_CONTACTITEMTYPE": "Nieuw type contactitem",
-    "ORDER_BY": "Bestellen op",
-    "RGBBACKGROUNDCOLOR": "RGB-achtergrondkleur",
     "EMAIL": "E-mail",
     "FILTERCHATWEBSITES": "Chat-websites filteren",
     "FILTEREMAILACCOUNTS": "E-mailaccounts filteren",
     "OPENED_TEXT": "Geopende interacties",
     "IGNOREDIALERCONTACTID": "Contact-ID van kiezer negeren",
     "MAIL_SUBSTATUS": "Substatus e-mail",
-    "OFFLINE_MESSAGE": "Offline bericht",
-    "DELETE_CONTACTITEMTYPE": "Type contactitem verwijderen",
-    "EDIT_CONTACTITEMTYPE": "Type contactitem bewerken",
-    "ORDER_BY_NUMERIC": "Sorteer op veld moet een numerieke waarde zijn!"
+    "OFFLINE_MESSAGE": "Offline bericht"
   }
 }
index 8f42c3f..28944c7 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Andre nivå disposisjon",
     "SELECT_LEVEL": "Velg et nivå",
     "TITLEFONTSIZE": "Skriftens tittelstørrelse",
-    "ADD_CONTACTITEMTYPE": "Legg til",
-    "CONTACTITEMTYPE": "Typer av kontaktelementer",
-    "NEW_CONTACTITEMTYPE": "Ny type kontaktelement",
-    "ORDER_BY": "Rekkefølge etter",
-    "RGBBACKGROUNDCOLOR": "RGB bakgrunnsfarge",
     "EMAIL": "E -post",
     "FILTERCHATWEBSITES": "Filtrer nettsteder for chat",
     "FILTEREMAILACCOUNTS": "Filtrer e -postkontoer",
     "OPENED_TEXT": "Åpne interaksjoner",
     "IGNOREDIALERCONTACTID": "Ignorer oppringingskontakt-ID",
     "MAIL_SUBSTATUS": "E-post understatus",
-    "OFFLINE_MESSAGE": "Frakoblet melding",
-    "DELETE_CONTACTITEMTYPE": "Slett kontaktelementtype",
-    "EDIT_CONTACTITEMTYPE": "Rediger kontaktelementtype",
-    "ORDER_BY_NUMERIC": "Rekkefølge etter felt skal være numerisk!"
+    "OFFLINE_MESSAGE": "Frakoblet melding"
   }
 }
index 6855492..63159f7 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Dyspozycja drugiego poziomu",
     "SELECT_LEVEL": "Wybierz poziom",
     "TITLEFONTSIZE": "Rozmiar tytułu czcionki",
-    "ADD_CONTACTITEMTYPE": "Dodać",
-    "CONTACTITEMTYPE": "Typy elementów kontaktu",
-    "NEW_CONTACTITEMTYPE": "Nowy typ elementu kontaktu",
-    "ORDER_BY": "Zamów przez",
-    "RGBBACKGROUNDCOLOR": "Kolor tła RGB",
     "EMAIL": "E-mail",
     "FILTERCHATWEBSITES": "Filtruj strony internetowe czatu",
     "FILTEREMAILACCOUNTS": "Filtruj konta e-mail",
     "OPENED_TEXT": "Otwarte interakcje",
     "IGNOREDIALERCONTACTID": "Ignoruj identyfikator kontaktu dialera",
     "MAIL_SUBSTATUS": "Substancja e-mail",
-    "OFFLINE_MESSAGE": "Wiadomość offline",
-    "DELETE_CONTACTITEMTYPE": "Usuń typ elementu kontaktu",
-    "EDIT_CONTACTITEMTYPE": "Edytuj typ elementu kontaktu",
-    "ORDER_BY_NUMERIC": "Kolejność według pól powinna być wartością liczbową!"
+    "OFFLINE_MESSAGE": "Wiadomość offline"
   }
 }
index 89475fd..e9a47f0 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível",
     "SELECT_LEVEL": "Selecione um nível",
     "TITLEFONTSIZE": "Tamanho do título da fonte",
-    "ADD_CONTACTITEMTYPE": "Adicionar",
-    "CONTACTITEMTYPE": "Tipos de item de contato",
-    "NEW_CONTACTITEMTYPE": "Novo tipo de item de contato",
-    "ORDER_BY": "Ordenar por",
-    "RGBBACKGROUNDCOLOR": "Cor de fundo RGB",
     "EMAIL": "E-mail",
     "FILTERCHATWEBSITES": "Filtrar sites de bate-papo",
     "FILTEREMAILACCOUNTS": "Filtrar contas de e-mail",
     "OPENED_TEXT": "Interações abertas",
     "IGNOREDIALERCONTACTID": "Ignorar o ID de contato do discador",
     "MAIL_SUBSTATUS": "Substatus do Email",
-    "OFFLINE_MESSAGE": "Mensagem offline",
-    "DELETE_CONTACTITEMTYPE": "Excluir tipo de item de contato",
-    "EDIT_CONTACTITEMTYPE": "Editar tipo de item de contato",
-    "ORDER_BY_NUMERIC": "A ordem por campo deve ser um valor numérico!"
+    "OFFLINE_MESSAGE": "Mensagem offline"
   }
 }
index bc7eab4..c00aa93 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Disposição de Segundo Nível",
     "SELECT_LEVEL": "Selecione um nível",
     "TITLEFONTSIZE": "Tamanho do título da fonte",
-    "ADD_CONTACTITEMTYPE": "Adicionar",
-    "CONTACTITEMTYPE": "Tipos de item de contato",
-    "NEW_CONTACTITEMTYPE": "Novo tipo de item de contato",
-    "ORDER_BY": "Ordenar por",
-    "RGBBACKGROUNDCOLOR": "Cor de fundo RGB",
     "EMAIL": "E-mail",
     "FILTERCHATWEBSITES": "Filtrar sites de bate-papo",
     "FILTEREMAILACCOUNTS": "Filtrar contas de e-mail",
     "OPENED_TEXT": "Interações abertas",
     "IGNOREDIALERCONTACTID": "Ignorar o ID de contato do discador",
     "MAIL_SUBSTATUS": "Substatus do Email",
-    "OFFLINE_MESSAGE": "Mensagem offline",
-    "DELETE_CONTACTITEMTYPE": "Excluir tipo de item de contato",
-    "EDIT_CONTACTITEMTYPE": "Editar tipo de item de contato",
-    "ORDER_BY_NUMERIC": "A ordem por campo deve ser um valor numérico!"
+    "OFFLINE_MESSAGE": "Mensagem offline"
   }
 }
index a950f0f..892955e 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Расположение второго уровня",
     "SELECT_LEVEL": "Выберите уровень",
     "TITLEFONTSIZE": "Размер заголовка шрифта",
-    "ADD_CONTACTITEMTYPE": "Добавлять",
-    "CONTACTITEMTYPE": "Типы контактов",
-    "NEW_CONTACTITEMTYPE": "Новый тип элемента контакта",
-    "ORDER_BY": "Сортировать по",
-    "RGBBACKGROUNDCOLOR": "Цвет фона RGB",
     "EMAIL": "Электронное письмо",
     "FILTERCHATWEBSITES": "Фильтр веб-сайтов чата",
     "FILTEREMAILACCOUNTS": "Фильтр учетных записей электронной почты",
     "OPENED_TEXT": "Открытые взаимодействия",
     "IGNOREDIALERCONTACTID": "Игнорировать идентификатор контакта номеронабирателя",
     "MAIL_SUBSTATUS": "Подстатус электронной почты",
-    "OFFLINE_MESSAGE": "Автономное сообщение",
-    "DELETE_CONTACTITEMTYPE": "Удалить тип элемента контакта",
-    "EDIT_CONTACTITEMTYPE": "Изменить тип элемента контакта",
-    "ORDER_BY_NUMERIC": "Порядок по полю должен быть числовым значением!"
+    "OFFLINE_MESSAGE": "Автономное сообщение"
   }
 }
index 2e1fd2b..d5854a7 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "Andra nivån disposition",
     "SELECT_LEVEL": "Välj en nivå",
     "TITLEFONTSIZE": "Teckensnittsstorlek",
-    "ADD_CONTACTITEMTYPE": "Lägg till",
-    "CONTACTITEMTYPE": "Typer av kontaktartiklar",
-    "NEW_CONTACTITEMTYPE": "Ny typ av kontaktartikel",
-    "ORDER_BY": "Sortera efter",
-    "RGBBACKGROUNDCOLOR": "RGB bakgrundsfärg",
     "EMAIL": "E-post",
     "FILTERCHATWEBSITES": "Filtrera chattwebbplatser",
     "FILTEREMAILACCOUNTS": "Filtrera e -postkonton",
     "OPENED_TEXT": "Öppnade interaktioner",
     "IGNOREDIALERCONTACTID": "Ignorera uppringarens kontakt-ID",
     "MAIL_SUBSTATUS": "E-postunderstatus",
-    "OFFLINE_MESSAGE": "Offlinemeddelande",
-    "DELETE_CONTACTITEMTYPE": "Ta bort kontaktobjektstyp",
-    "EDIT_CONTACTITEMTYPE": "Redigera kontaktobjektstyp",
-    "ORDER_BY_NUMERIC": "Ordna efter fält ska vara ett numeriskt värde!"
+    "OFFLINE_MESSAGE": "Offlinemeddelande"
   }
 }
index 13c547b..6c4628c 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "İkinci Düzey Tasarruf",
     "SELECT_LEVEL": "Bir seviye seçin",
     "TITLEFONTSIZE": "Yazı Tipi Başlık Boyutu",
-    "ADD_CONTACTITEMTYPE": "Ekle",
-    "CONTACTITEMTYPE": "İletişim öğesi türleri",
-    "NEW_CONTACTITEMTYPE": "Yeni kişi öğesi türü",
-    "ORDER_BY": "Tarafından sipariş",
-    "RGBBACKGROUNDCOLOR": "RGB Arkaplan rengi",
     "EMAIL": "E-posta",
     "FILTERCHATWEBSITES": "Sohbet Web Sitelerini Filtrele",
     "FILTEREMAILACCOUNTS": "E-posta Hesaplarını Filtrele",
     "OPENED_TEXT": "Açık Etkileşimler",
     "IGNOREDIALERCONTACTID": "Çevirici kişi kimliğini yoksay",
     "MAIL_SUBSTATUS": "E-posta Alt Durumu",
-    "OFFLINE_MESSAGE": "Çevrimdışı Mesaj",
-    "DELETE_CONTACTITEMTYPE": "Kişi öğesi türünü sil",
-    "EDIT_CONTACTITEMTYPE": "Kişi öğesi türünü düzenle",
-    "ORDER_BY_NUMERIC": "Alana göre sıralama sayısal değer olmalıdır!"
+    "OFFLINE_MESSAGE": "Çevrimdışı Mesaj"
   }
 }
index 8e352ea..f7abfb6 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "二级处置",
     "SELECT_LEVEL": "选择一个级别",
     "TITLEFONTSIZE": "字体标题大小",
-    "ADD_CONTACTITEMTYPE": "添加",
-    "CONTACTITEMTYPE": "联系项目类型",
-    "NEW_CONTACTITEMTYPE": "新的联系人项目类型",
-    "ORDER_BY": "订购方式",
-    "RGBBACKGROUNDCOLOR": "RGB 背景色",
     "EMAIL": "电子邮件",
     "FILTERCHATWEBSITES": "过滤聊天网站",
     "FILTEREMAILACCOUNTS": "过滤电子邮件帐户",
     "OPENED_TEXT": "打开的交互",
     "IGNOREDIALERCONTACTID": "忽略拨号联系人 ID",
     "MAIL_SUBSTATUS": "电子邮件子状态",
-    "OFFLINE_MESSAGE": "离线留言",
-    "DELETE_CONTACTITEMTYPE": "删除联系人项目类型",
-    "EDIT_CONTACTITEMTYPE": "编辑联系人项目类型",
-    "ORDER_BY_NUMERIC": "按字段排序应该是数值!"
+    "OFFLINE_MESSAGE": "离线留言"
   }
 }
index 6a30d83..225e797 100644 (file)
     "SECOND_LEVEL_DISPOSITION": "二級處置",
     "SELECT_LEVEL": "選擇一個級別",
     "TITLEFONTSIZE": "字體標題大小",
-    "ADD_CONTACTITEMTYPE": "添加",
-    "CONTACTITEMTYPE": "聯繫項目類型",
-    "NEW_CONTACTITEMTYPE": "新的聯繫人項目類型",
-    "ORDER_BY": "訂購方式",
-    "RGBBACKGROUNDCOLOR": "RGB 背景色",
     "EMAIL": "電子郵件",
     "FILTERCHATWEBSITES": "過濾聊天網站",
     "FILTEREMAILACCOUNTS": "過濾電子郵件帳戶",
     "OPENED_TEXT": "打開的交互",
     "IGNOREDIALERCONTACTID": "忽略撥號聯繫人 ID",
     "MAIL_SUBSTATUS": "電子郵件子狀態",
-    "OFFLINE_MESSAGE": "離線留言",
-    "DELETE_CONTACTITEMTYPE": "刪除聯繫人項目類型",
-    "EDIT_CONTACTITEMTYPE": "編輯聯繫人項目類型",
-    "ORDER_BY_NUMERIC": "按字段排序應該是數值!"
+    "OFFLINE_MESSAGE": "離線留言"
   }
 }
index 6af6092..94ee517 100644 (file)
     "USER_FORCE_LOGOUT": "قام {{ip}} بتسجيل الدخول باستخدام بيانات الاعتماد الخاصة بك.\nغير مسموح بتسجيل الدخول المتعدد",
     "LOGOUT": "تسجيل خروج",
     "SESSION_TIMEOUT": "سيتم إغلاق الجلسة تلقائيًا بعد 60 ثانية",
-    "PHONE2CALL": "هاتف للاتصال",
     "HUNGARIAN": "المجرية",
     "AUTOANSWER_NOTIFICATIONS": "إخطارات الرد التلقائي",
     "CHANNEL": "قناة",
index eac0bd8..8d45f34 100644 (file)
     "WEBRTC_SPEAKER_NOT_AVAILABLE": "Není k dispozici žádný reproduktor",
     "LOGOUT": "Odhlásit se",
     "SESSION_TIMEOUT": "Relace bude automaticky ukončena po 60 sekundách",
-    "PHONE2CALL": "Telefon na zavolání",
     "HUNGARIAN": "maďarský",
     "AUTOANSWER_NOTIFICATIONS": "Oznámení o automatické odpovědi",
     "CHANNEL": "Kanál",
index ffbb285..56bb53e 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} er logget ind med dine legitimationsoplysninger.\nFlere login er ikke tilladt",
     "LOGOUT": "Log ud",
     "SESSION_TIMEOUT": "Sessionen lukkes automatisk efter 60 sekunder",
-    "PHONE2CALL": "Telefon for at ringe",
     "HUNGARIAN": "ungarsk",
     "AUTOANSWER_NOTIFICATIONS": "Autosvar-meddelelser",
     "CHANNEL": "Kanal",
index 0adf4ba..d11e1da 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} hat sich mit Ihren Anmeldeinformationen angemeldet.\nMehrfachanmeldungen sind nicht zulässig",
     "LOGOUT": "Ausloggen",
     "SESSION_TIMEOUT": "Die Sitzung wird nach 60 Sekunden automatisch geschlossen",
-    "PHONE2CALL": "Telefon zum Anrufen",
     "HUNGARIAN": "ungarisch",
     "AUTOANSWER_NOTIFICATIONS": "Automatische Antwortbenachrichtigungen",
     "CHANNEL": "Kanal",
index c1c3ad7..41c6efa 100644 (file)
@@ -17,7 +17,6 @@
     "REQUIREMENTS": "Requirements",
     "LICENSE": "License",
     "HTTPS": "HTTPS",
-    "PHONE2CALL": "Phone to call",
     "CHANNELS": "Channels",
     "CHANNEL": "Channel",
     "NUM_NOTIFICATIONS": "Notifications",
index 1d7cc9a..c5744b8 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} ha iniciado sesión con sus credenciales.\nNo se permiten múltiples inicios de sesión",
     "LOGOUT": "Cerrar sesión",
     "SESSION_TIMEOUT": "La sesión se cerrará automáticamente después de 60 segundos.",
-    "PHONE2CALL": "Teléfono para llamar",
     "HUNGARIAN": "húngaro",
     "AUTOANSWER_NOTIFICATIONS": "Notificaciones de respuesta automática",
     "CHANNEL": "Canal",
index 184add3..ee22825 100644 (file)
     "WEBRTC_SPEAKER_NOT_AVAILABLE": "Kõlarit pole saadaval",
     "LOGOUT": "Logi välja",
     "SESSION_TIMEOUT": "Seanss suletakse 60 sekundi pärast automaatselt",
-    "PHONE2CALL": "Telefon helistamiseks",
     "HUNGARIAN": "ungari",
     "AUTOANSWER_NOTIFICATIONS": "Automaatne vastamine",
     "CHANNEL": "Kanal",
index cfe1d34..767b497 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip} with با اعتبار خود وارد شوید.\nورود چندگانه مجاز نیست",
     "LOGOUT": "خروج",
     "SESSION_TIMEOUT": "جلسه پس از 60 ثانیه به طور خودکار بسته می شود",
-    "PHONE2CALL": "تلفن جهت تماس",
     "HUNGARIAN": "مجارستانی",
     "AUTOANSWER_NOTIFICATIONS": "پاسخ خودکار اعلان ها",
     "CHANNEL": "کانال",
index 3d92e58..30e1292 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} on kirjautunut sisään käyttöoikeustietosi.\nUseita kirjautumisia ei sallita",
     "LOGOUT": "Kirjautua ulos",
     "SESSION_TIMEOUT": "Istunto suljetaan automaattisesti 60 sekunnin kuluttua",
-    "PHONE2CALL": "Puhelin soittaa",
     "HUNGARIAN": "Unkarin kieli",
     "AUTOANSWER_NOTIFICATIONS": "Automaattinen vastaus ilmoitukset",
     "CHANNEL": "kanava",
index 9bbcaf5..4fa8d42 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} s'est connecté avec vos identifiants.\nLes connexions multiples ne sont pas autorisées",
     "LOGOUT": "Se déconnecter",
     "SESSION_TIMEOUT": "La session sera automatiquement fermée après 60 secondes",
-    "PHONE2CALL": "Téléphone pour appeler",
     "HUNGARIAN": "hongrois",
     "AUTOANSWER_NOTIFICATIONS": "Notifications de réponse automatique",
     "CHANNEL": "Canaliser",
index 069ce4f..41c4f09 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} התחבר עם האישורים שלך.\nאין להכניס כניסות מרובות",
     "LOGOUT": "להתנתק",
     "SESSION_TIMEOUT": "ההפעלה תיסגר אוטומטית לאחר 60 שניות",
-    "PHONE2CALL": "טלפון להתקשרות",
     "HUNGARIAN": "הוּנגָרִי",
     "AUTOANSWER_NOTIFICATIONS": "הודעות מענה אוטומטי",
     "CHANNEL": "עָרוּץ",
index 665a579..8d5887e 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} ने आपकी साख के साथ लॉग इन किया है।\nएकाधिक लॉगिन की अनुमति नहीं है",
     "LOGOUT": "लॉग आउट",
     "SESSION_TIMEOUT": "60 सेकंड के बाद सत्र स्वचालित रूप से बंद हो जाएगा",
-    "PHONE2CALL": "कॉल करने के लिए फोन",
     "HUNGARIAN": "हंगेरी",
     "AUTOANSWER_NOTIFICATIONS": "स्वतः उत्तर सूचनाएं",
     "CHANNEL": "चैनल",
index 5305370..f229581 100644 (file)
     "NUM_NOTIFICATIONS": "Értesítések",
     "OPENCHANNEL": "Nyílt csatorna",
     "SMS": "SMS",
-    "WHATSAPP": "Whatsapp",
-    "PHONE2CALL": "Telefon a híváshoz"
+    "WHATSAPP": "Whatsapp"
   }
 }
index cdb770f..d1fe7ce 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} telah masuk dengan kredensial Anda.\nBanyak login tidak diperbolehkan",
     "LOGOUT": "Keluar",
     "SESSION_TIMEOUT": "Sesi akan ditutup secara otomatis setelah 60 detik",
-    "PHONE2CALL": "Telepon untuk dihubungi",
     "HUNGARIAN": "Hongaria",
     "AUTOANSWER_NOTIFICATIONS": "Notifikasi jawaban otomatis",
     "CHANNEL": "Saluran",
index 6ae4616..1be8395 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} si è connesso con le tue credenziali. \nNon sono consentite connessioni multiple",
     "LOGOUT": "Disconnettersi",
     "SESSION_TIMEOUT": "La sessione verrà chiusa automaticamente dopo 60 secondi",
-    "PHONE2CALL": "Telefono per chiamare",
     "HELP": {
       "PREVIEW_RECALLME": "Questa è una chiamata Recall Me programmata per il {{date}}"
     },
index 61673c4..7474c9a 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}}はあなたの認証情報でログインしています。\n複数のログインは許可されていません",
     "LOGOUT": "ログアウト",
     "SESSION_TIMEOUT": "セッションは60秒後に自動的に閉じられます",
-    "PHONE2CALL": "電話する",
     "HUNGARIAN": "ハンガリー語",
     "AUTOANSWER_NOTIFICATIONS": "自動応答通知",
     "CHANNEL": "チャネル",
index 6a67e36..9ff43f1 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}}이 (가) 귀하의 자격 증명으로 로그인했습니다.\n다중 로그인은 허용되지 않습니다.",
     "LOGOUT": "로그 아웃",
     "SESSION_TIMEOUT": "세션은 60 초 후에 자동으로 닫힙니다.",
-    "PHONE2CALL": "전화 걸기",
     "HUNGARIAN": "헝가리 인",
     "AUTOANSWER_NOTIFICATIONS": "자동 응답 알림",
     "CHANNEL": "채널",
index 0817df8..51065b6 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} prisijungė naudodamas savo įgaliojimus. Keli prisijungimai neleidžiami",
     "LOGOUT": "Atsijungti",
     "SESSION_TIMEOUT": "Po 60 sekundžių sesija bus automatiškai uždaryta",
-    "PHONE2CALL": "Telefonas skambinti",
     "HUNGARIAN": "vengrų",
     "AUTOANSWER_NOTIFICATIONS": "Automatinio atsakymo pranešimai",
     "CHANNEL": "Kanalas",
index 2074cd1..7026342 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} ir pieteicies ar jūsu akreditācijas datiem.\nVairāki pieteikumi nav atļauti",
     "LOGOUT": "Izlogoties",
     "SESSION_TIMEOUT": "Sesija tiks automātiski slēgta pēc 60 sekundēm",
-    "PHONE2CALL": "Tālrunis, lai zvanītu",
     "HUNGARIAN": "ungāru",
     "AUTOANSWER_NOTIFICATIONS": "Automātiskās atbildes paziņojumi",
     "CHANNEL": "Kanāls",
index 7b95ad0..9b255b5 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} is ingelogd met uw inloggegevens.\nMeerdere aanmeldingen zijn niet toegestaan",
     "LOGOUT": "Uitloggen",
     "SESSION_TIMEOUT": "De sessie wordt automatisch na 60 seconden afgesloten",
-    "PHONE2CALL": "Telefoon om te bellen",
     "HUNGARIAN": "Hongaars",
     "AUTOANSWER_NOTIFICATIONS": "Meldingen automatisch beantwoorden",
     "CHANNEL": "Kanaal",
index 7fbfe21..d4a4268 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} har logget på med legitimasjonsbeskrivelsen.\nFlere pålogginger er ikke tillatt",
     "LOGOUT": "Logg ut",
     "SESSION_TIMEOUT": "Økten lukkes automatisk etter 60 sekunder",
-    "PHONE2CALL": "Telefon for å ringe",
     "HUNGARIAN": "ungarsk",
     "AUTOANSWER_NOTIFICATIONS": "Autosvar-varsler",
     "CHANNEL": "Kanal",
index 97af4b4..2250070 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} zalogował się przy użyciu Twoich danych logowania.\nWielokrotne logowanie jest niedozwolone",
     "LOGOUT": "Wyloguj",
     "SESSION_TIMEOUT": "Sesja zostanie automatycznie zamknięta po 60 sekundach",
-    "PHONE2CALL": "Telefon, aby zadzwonić",
     "HUNGARIAN": "język węgierski",
     "AUTOANSWER_NOTIFICATIONS": "Powiadomienia automatycznej odpowiedzi",
     "CHANNEL": "Kanał",
index 4f000e1..dda35e4 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} fez login com suas credenciais.\nVários logins não são permitidos",
     "LOGOUT": "Sair",
     "SESSION_TIMEOUT": "A sessão será fechada automaticamente após 60 segundos",
-    "PHONE2CALL": "Telefone para ligar",
     "HUNGARIAN": "húngaro",
     "AUTOANSWER_NOTIFICATIONS": "Notificações de resposta automática",
     "CHANNEL": "Canal",
index c4a4134..0e28412 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} fez login com suas credenciais.\nVários logins não são permitidos",
     "LOGOUT": "Sair",
     "SESSION_TIMEOUT": "A sessão será fechada automaticamente após 60 segundos",
-    "PHONE2CALL": "Telefone para ligar",
     "HUNGARIAN": "húngaro",
     "AUTOANSWER_NOTIFICATIONS": "Notificações de resposta automática",
     "CHANNEL": "Canal",
index c935b01..7c78855 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} вошел в систему с вашими учетными данными.\nМножественные входы не разрешены",
     "LOGOUT": "Выйти",
     "SESSION_TIMEOUT": "Сессия будет автоматически закрыта через 60 секунд.",
-    "PHONE2CALL": "Телефон для звонка",
     "HUNGARIAN": "венгерский язык",
     "AUTOANSWER_NOTIFICATIONS": "Уведомления автоответчика",
     "CHANNEL": "Канал",
index 0a7354c..0378f08 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} har loggat in med dina referenser.\nFlera inloggningar är inte tillåtna",
     "LOGOUT": "Logga ut",
     "SESSION_TIMEOUT": "Sessionen stängs automatiskt efter 60 sekunder",
-    "PHONE2CALL": "Telefon för att ringa",
     "HUNGARIAN": "ungerska",
     "AUTOANSWER_NOTIFICATIONS": "Autosvar aviseringar",
     "CHANNEL": "Kanal",
index 6bd9402..76ed0bb 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}} kimlik bilgilerinizle giriş yaptı.\nBirden çok girişe izin verilmez",
     "LOGOUT": "Çıkış Yap",
     "SESSION_TIMEOUT": "60 saniye sonra oturum otomatik olarak kapatılacaktır",
-    "PHONE2CALL": "Aranacak telefon",
     "HUNGARIAN": "Macarca",
     "AUTOANSWER_NOTIFICATIONS": "Otomatik yanıt bildirimleri",
     "CHANNEL": "Kanal",
index 69d5010..25d0dd2 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}}已使用您的凭据登录。\n不允许多次登录",
     "LOGOUT": "登出",
     "SESSION_TIMEOUT": "该会话将在60秒后自动关闭",
-    "PHONE2CALL": "拨打电话",
     "HUNGARIAN": "匈牙利",
     "AUTOANSWER_NOTIFICATIONS": "自动回复通知",
     "CHANNEL": "渠道",
index 5da9717..bb68a45 100644 (file)
     "USER_FORCE_LOGOUT": "{{ip}}已使用您的憑據登錄。\n不允許多次登錄",
     "LOGOUT": "登出",
     "SESSION_TIMEOUT": "該會話將在60秒後自動關閉",
-    "PHONE2CALL": "撥打電話",
     "HUNGARIAN": "匈牙利",
     "AUTOANSWER_NOTIFICATIONS": "自動回复通知",
     "CHANNEL": "渠道",
index 2c51fce..6af375b 100644 (file)
@@ -1,34 +1,36 @@
-<!doctype html>
+<!DOCTYPE html>
 <html ng-app="motion">
 
 <head>
-  <base href="/">
-  <meta charset="utf-8">
-  <meta name="description" content="">
-  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+  <base href="/" />
+  <meta charset="utf-8" />
+  <meta name="description" content="" />
+  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
   <title id="pageTitle">xCALLY Motion</title>
 
   <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
 
   <link rel="icon" href="/api/settings/1/favicon" />
 
-  <link rel="stylesheet" href="assets/plugins/angular-material-form-builder/dist/angular-material-form-builder.min.css">
+  <link rel="stylesheet" href="assets/plugins/angular-material-form-builder/dist/angular-material-form-builder.min.css" />
 
   <link rel="stylesheet" href="styles/vendor.57a94b79.css">
 
-  <link rel="stylesheet" href="styles/app.6bed6274.css">
+  <link rel="stylesheet" href="styles/app.e921fbc9.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'> -->
 </head>
 
 <!--[if lt IE 10]>
-    <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade
-        your browser</a> to improve your experience.</p>
-    <![endif]-->
+    <p class="browsehappy">
+      You are using an <strong>outdated</strong> browser. Please
+      <a href="http://browsehappy.com/">upgrade your browser</a> to improve your
+      experience.
+    </p>
+  <![endif]-->
 
 <body md-theme="{{vm.themes.active.name}}" md-theme-watch ng-controller="IndexController as vm" class="{{state.current.bodyClass || ''}}" dir="{{vm.direction}}">
-
   <!-- SPLASH SCREEN -->
   <ms-splash-screen id="splash-screen">
     <div class="center">
@@ -66,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.4e198ed1.js"></script>
+  <script src="scripts/app.d1d6b36c.js"></script>
 
   <!-- CKEDITOR -->
   <script src="assets/plugins/ckeditor/ckeditor.js"></script>
similarity index 53%
rename from public/scripts/app.4e198ed1.js
rename to public/scripts/app.d1d6b36c.js
index f61886d..94edeca 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,textButtonColor,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,textButtonColor,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,textButtonColor,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,textButtonColor,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,textButtonColor,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,callAdditionalPhoneAfterMin,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,callAdditionalPhoneAfterMin,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,callAdditionalPhoneAfterMin",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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"}).state("app.tools.contact_item_types",{url:"/contact_item_types",views:{"content@app":{templateUrl:"app/main/apps/tools/views/contact_item_types/contact_item_types.html",controller:"ContactItemTypesController as vm"}},resolve:{contact_item_types:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("contactItemType@get",{fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ContactItemType",fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",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:1013})}]},authenticate:!0,permissionId:1013,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"},setAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/phones"},getAdditionalPhones:{isArray:!0,method:"get",url:r.baseUrl+"cm/contacts/:id/phones"},duplicateAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/duplicateAdditionalPhones"},rescheduleAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/rescheduleAdditionalPhones"},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"},importUpdates:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/uploadUpdates/: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.contactItemType=e(r.baseUrl+"contact_item_types/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"contact_item_types/describe"},clone:{method:"post",url:r.baseUrl+"contact_item_types/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmContactHasItem=e(r.baseUrl+"cm_contact_has_items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm_contact_has_items/describe"},clone:{method:"post",url:r.baseUrl+"cm_contact_has_items/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmHopperAdditionalPhone=e(r.baseUrl+"cm_hopper_additional_phones/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm_hopper_additional_phones/describe"},clone:{method:"post",url:r.baseUrl+"cm_hopper_additional_phones/: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"},getGlobalCustomFields:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/global_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,textButtonColor,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.importContactsUpdates=function(e,n,t){var a=JSON.parse(n);s.show({controller:"ImportContactsUpdatesDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/importUpdates.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,e,a,n,i,s,o,r,l,d,c){var m=this;if(m.errors=[],m.title="CONTACTMANAGER.EDIT_CONTACT",m.crudPermissions=c,m.contact=angular.copy(o),m.additionalItemTypes=[],m.additionalItems=[],m.contacts=n||{rows:[],count:0},m.lists=i||{rows:[],count:0},m.companies=s||{rows:[],count:0},m.customFields={rows:[],count:0},m.newContact=!1,m.newPhone=function(e){return{phone:e,color:"gray"}},m.contactItemTypes=[],m.contact)delete m.contact.List,f(m.contact.ListId),d.cmContact.getAdditionalPhones({id:o.id}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");m.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");m.additionalItems=[];for(var s=0;s<n.length;s++)m.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})}).catch(function(e){console.log(e)});else{m.contact={ListId:r?parseInt(r,10):void 0,CompanyId:l?parseInt(l,10):void 0};var u=_.map(m.contact.Phones,"item"),p=_.map(m.contact.Phones,"description");m.additionalItemTypes=_.map(m.contact.Phones,"ItemTypeId");var g=_.map(m.contact.Phones,"ItemType.rgbBackgroundColor"),v=_.map(m.contact.Phones,"ItemType.name");m.additionalItems=[];for(var h=0;h<u.length;h++)m.additionalItems.push({phone:u[h],type:v[h],color:g[h],description:p[h]});m.title="CONTACTMANAGER.NEW_CONTACT",m.newContact=!0,b()}function f(e){if(e)return d.cmList.getCustomFields({id:e}).$promise.then(function(e){if(e){m.customFields=e;var n=_.map(m.customFields.rows,function(e){return"cf_"+e.id});return d.cmContact.get({id:m.contact.id,attributes:n,raw:!0}).$promise.then(function(e){m.contact=_.merge(m.contact,e)})}}).then(function(){m.customFields.rows.forEach(function(e){"datetime"===e.type&&m.contact["cf_"+e.id]&&(m.contact["cf_"+e.id]=A(m.contact["cf_"+e.id]))}),Object.keys(m.contact).forEach(function(e){if(_.startsWith(e,"cf_")){var n=e.split("_")[1];_.some(m.customFields.rows,["id",Number(n)])||delete m.contact["cf_"+n]}})}).catch(function(e){console.error(e)});m.customFields={rows:[],count:0}}function b(){return d.cmList.getGlobalCustomFields().$promise.then(function(e){if(e){m.customFields=e;_.map(m.customFields.rows,function(e){return"cf_"+e.id})}else;}).catch(function(e){console.error(e)})}function A(e){return null===e?void 0:new Date(e)}function E(){t.hide()}d.contactItemType.get({fields:"id,name,rgbBackgroundColor"}).$promise.then(function(e){m.contactItemTypes=e.rows}),m.addNewContact=function(){m.errors=[],d.cmContact.save(m.contact).$promise.then(function(e){m.contacts.unshift(e),d.cmContact.setAdditionalPhones({id:e.id,items:m.additionalItems,item_types:m.additionalItemTypes}).$promise.then(function(){a.success({title:"Contact properly created",msg:m.contact.name?m.contact.name+" has been created!":""}),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++)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()})})},m.saveContact=function(){m.errors=[],d.cmContact.update({id:m.contact.id},m.contact).$promise.then(function(e){var n=_.find(m.contacts,{id:e.id});n&&_.merge(n,e)}).then(function(){return d.cmContact.setAdditionalPhones({id:o.id,items:m.additionalItems,item_types:m.additionalItemTypes}).$promise.then(function(){a.success({title:"Contact properly saved!",msg:m.contact.name?m.contact.name+" has been saved!":""}),E()})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.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()})})},m.deleteContact=function(e){m.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(){d.cmContact.delete({id:m.contact.id}).$promise.then(function(){_.remove(m.contacts,{id:m.contact.id}),a.success({title:"Contact properly deleted!",msg:m.contact.name?m.contact.name+" has been deleted!":""}),E()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},m.closeDialog=E,m.getCustomFields=f,m.getDateFromString=A,e.$watch("vm.contact.ListId",function(e,n){_.isNil(e)&&b()})}e.$inject=["$mdDialog","$scope","toasty","contacts","lists","companies","contact","ListId","CompanyId","api","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.title="CONTACTMANAGER.COPY_CONTACT",o.contact=angular.copy(n),o.lists=i||{rows:[],count:0},o.addNewContact=function(){o.errors=[];var n=o.contact.id;delete o.contact.id,o.contact.tags&&!o.contact.tags.length&&delete o.contact.tags;s.cmContact.save(o.contact).$promise.then(function(e){return a.unshift(e),s.cmContact.duplicateAdditionalPhones({id:n,fromContactId:n,toContactId:e.id}).$promise.then(function(){t.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(a,t,e,i,s,n,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.additionalItems=[],S.additionalItemTypes=[],S.contactItemTypes=[],S.firstDayMonth=new Date(moment().startOf("month").subtract(1,"seconds").utcOffset(0,!0).format()),S.lastDayMonth=new Date(moment().endOf("month").subtract(1,"day").utcOffset(0,!0).format()),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=e.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");var n=_.map(S.contact.Phones,"item"),t=_.map(S.contact.Phones,"description");S.additionalItemTypes=_.map(S.contact.Phones,"ItemTypeId");var a=_.map(S.contact.Phones,"ItemType.rgbBackgroundColor"),i=_.map(S.contact.Phones,"ItemType.name"),s=_.map(S.contact.Phones,"ItemType.id");S.additionalItems=[];for(var o=0;o<n.length;o++)S.additionalItems.push({phone:n[o],type:i[o],ItemTypeId:s[o],color:a[o],description:t[o]})}).then(function(e){r.contactItemType.get({fields:"id,name,rgbBackgroundColor"}).$promise.then(function(e){S.contactItemTypes=e.rows})}).finally(function(){S.contact&&w()})},S.gotoContacts=function(){e.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},S.duplicateContact=function(e){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:{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}).then(function(){return r.cmContact.setAdditionalPhones({id:S.contact.id,items:S.additionalItems}).$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});s.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(i.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=s.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 s.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=s.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");s.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){s.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.createOrEditIvrCampaignHopper=function(e,n){s.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.newPhone=function(e){return{phone:e,color:"gray"}},S.getCustomerJourney=w,S.loadMoreJourney=function(){return n(function(e,n){var t=S.journey.length;return e(w(t))})},S.moveUp=function(e){N(e,e-1)},S.moveDown=function(e){N(e,e+1)};var R=!0,x=1;function N(e,n){var t=S.additionalItems[n];S.additionalItems[n]=S.additionalItems[e],S.additionalItems[e]=t,a.additionalPhonesForm.$setDirty()}a.$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())}),a.$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())}),a.$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).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),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.contactItemTypes=[],l.contactItemType.get({fields:"id,name,orderBy"}).$promise.then(function(e){var n=e.rows;console.log(n);for(var t=0;t<n.length;t++)g.contactItemTypes.push({key:n[t].name,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(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:"id",required:!0},{key:"firstName",required:!1},{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}],g.contactItemTypes=[],l.contactItemType.get({fields:"id,name,orderBy"}).$promise.then(function(e){for(var n=e.rows,t=0;t<n.length;t++)g.contactItemTypes.push({key:n[t].name,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.importUpdates({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("ImportContactsUpdatesDialogController",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{var t="mail"==e.channel?"email":e.channel;y.user[t+"Autoanswer"]?l(function(){if(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)}).catch(M())},y.user[t+"AutoanswerDelay"]?1e3*y.user[t+"AutoanswerDelay"]:0):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.additionalItemTypes=[],g.additionalItems=[],g.contactItemTypes=[],g.newPhone=function(e){return{phone:e,color:"gray"}},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(){return u.cmContact.setAdditionalPhones({id:g.contact.id,items:g.additionalItems,item_types:g.additionalItemTypes}).$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){}u.contactItemType.get({}).$promise.then(function(e){g.contactItemTypes=e.rows}).then(function(){u.cmContact.getAdditionalPhones({id:g.contact.id}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");g.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");g.additionalItems=[];for(var s=0;s<n.length;s++)g.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})}).catch(function(e){console.log(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(e){o.cmContact.rescheduleAdditionalPhones({id:v.contact.id,hopperId:e.id}).$promise.catch(function(e){console.log(e)})}).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():""),modernAuthentication:!1},v.title="INTEGRATIONS.NEW_DYNAMICS365ACCOUNT",v.newDynamics365Account=!0),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.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,callAdditionalPhoneAfterMin:3,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,callAdditionalPhoneAfterMin,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(){b()}function E(e){_.remove(v.agents.rows,["id",e.UserId])}function y(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,sort:"fullname",globalStatusFilter:"",pauseTypeFilter:"",globalQueueFilter:[],channel:v.channel},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(){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()})})},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()})})},v.clearSelection=function(){v.query.globalQueueFilter=[]},v.selectAll=function(){_.forEach(v.queues.rows,function(e){v.query.globalQueueFilter.push(e.name)})},v.getQueuesByChannel=function(){if(v.queues&&0<v.queues.count)return;var e={type:v.queueType||"inbound",fields:"id,name",sort:"name",nolimit:"true"},n=v.channel+"Queue";return l.getResourcesByRole(v.currentUser,n,e,null).then(function(e){v.queues=e}).catch(function(e){c.error({title:s.instant("VOICE.QUEUES"),msg:e.status?JSON.stringify(e.data):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),(0<v.query.globalQueueFilter.length||!_.isEmpty(v.query.globalStatusFilter))&&b()):e.online&&b()}),d.on("user:update",function(e){var n=_.find(v.agents.rows,["id",e.id]);if(n){if(!1===e.online)return y(n);b()}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"]))}(0<v.query.globalQueueFilter.length||!_.isEmpty(v.query.globalStatusFilter))&&b()}),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);(0<v.query.globalQueueFilter.length||!_.isEmpty(v.query.globalStatusFilter))&&b()}),d.on("userVoiceQueue:save",A),d.on("userVoiceQueue:remove",E),d.on("userChatQueue:save",A),d.on("userChatQueue:remove",E),d.on("userSmsQueue:save",A),d.on("userSmsQueue:remove",E),d.on("userMailQueue:save",A),d.on("userMailQueue:remove",E),d.on("userFaxQueue:save",A),d.on("userFaxQueue:remove",E),d.on("userOpenchannelQueue:save",A),d.on("userOpenchannelQueue:remove",E),d.on("userWhatsappQueue:save",A),d.on("userWhatsappQueue:remove",E),f(),e.$on("$destroy",function(){d.removeAllListeners("user:save"),d.removeAllListeners("user:update"),d.removeAllListeners("user:agentconnect"),d.removeAllListeners("user:agentcomplete"),d.removeAllListeners("userVoiceQueue:save"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userChatQueue:save"),d.removeAllListeners("userChatQueue:remove"),d.removeAllListeners("userSmsQueue:save"),d.removeAllListeners("userSmsQueue:remove"),d.removeAllListeners("userMailQueue:save"),d.removeAllListeners("userMailQueue:remove"),d.removeAllListeners("userFaxQueue:save"),d.removeAllListeners("userFaxQueue:remove"),d.removeAllListeners("userOpenchannelQueue:save"),d.removeAllListeners("userOpenchannelQueue:remove"),d.removeAllListeners("userWhatsappQueue:save"),d.removeAllListeners("userWhatsappQueue:remove"),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.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,chatAutoanswer,chatAutoanswerDelay",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,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.contact_item_types=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="contact_item_types",f.listOrder="",f.listOrderAsc=null,f.selectedContactItemType=[],f.query={fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditContactItemTypeDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/contact_item_types/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{contactItemType:e,contact_item_types:f.contact_item_types.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("contactItemType")+"?").htmlContent("<b>"+(e.name||"contactItemType")+"</b> will be deleted.").ariaLabel("delete contactItemType").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getContactItemType=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.contactItemType.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ContactItemType",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditContactItemType=function(e,n){i.show({controller:"CreateOrEditContactItemTypeDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/contact_item_types/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{contactItemType:n,contact_item_types:f.contact_item_types.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteContactItemType=y,f.exportSelectedContactItemType=function(){var e=angular.copy(f.selectedContactItemType);return f.selectedContactItemType=[],e},f.deleteSelectedContactItemType=function(e){var n=i.confirm().title("Are you sure want to delete the selected contact_item_types?").htmlContent("<b>"+f.selectedContactItemType.length+" selected</b> will be deleted.").ariaLabel("delete ContactItemTypes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedContactItemType.forEach(function(e){y(e)}),f.selectedContactItemType=[]})},f.deselectContactItemType=function(){f.selectedContactItemType=[]},f.selectAllContactItemType=function(){f.selectedContactItemType=f.contact_item_types.rows};var b=!0,A=1;function E(e){f.contact_item_types=e||{count:0,rows:[]}}function y(e){m.contactItemType.delete({id:e.id}).$promise.then(function(){_.remove(f.contact_item_types.rows,{id:e.id}),f.contact_item_types.count-=1,f.contact_item_types.rows.length||f.getContactItemType(),p.success({title:_.startCase("ContactItemType")+" 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:DELETEcontactItemType"}];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:DELETEcontactItemType",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.getContactItemType())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contact_item_types","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("ContactItemTypesController",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_CONTACTITEMTYPE",g.contactItemType=angular.copy(l),g.contact_item_types=r,g.newContactItemType=!1,g.contactItemType||(g.contactItemType={rgbBackgroundColor:"#2196f3"},g.title="TOOLS.NEW_CONTACTITEMTYPE",g.newContactItemType=!0),g.addNewContactItemType=function(){g.errors=[],d.contactItemType.save(g.contactItemType).$promise.then(function(e){g.contact_item_types.unshift(e.toJSON()),o.success({title:"ContactItemType properly created",msg:g.contactItemType.name?g.contactItemType.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.contactItemType.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.contactItemType.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContactItemType=function(){g.errors=[],isNaN(g.contactItemType.OrderBy)?alert(s.instant("TOOLS.ORDER_BY_NUMERIC")):d.contactItemType.update({id:g.contactItemType.id},g.contactItemType).$promise.then(function(e){var n=_.find(g.contact_item_types,{id:e.id});n&&_.merge(n,_.pick(e.toJSON(),_.keys(n))),o.success({title:"ContactItemType properly saved!",msg:g.contactItemType.name?g.contactItemType.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.contactItemType.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.contactItemType.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContactItemType=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The contactItemType will be deleted.").ariaLabel("Delete ContactItemType").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.contactItemType.delete({id:g.contactItemType.id}).$promise.then(function(){_.remove(g.contact_item_types,{id:g.contactItemType.id}),o.success({title:"ContactItemType properly deleted!",msg:(g.contactItemType.name||"contactItemType")+" has been deleted!"}),v(g.contactItemType)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contactItemType.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.contactItemType.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","contact_item_types","contactItemType","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactItemTypeDialogController",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,i,s,o){var r=this;function l(e,n,t){return o.dashboardItem.update(t).$promise.catch(function(e){console.error(e)})}r.customDashboard={},r.init=function(e,n){r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.customDashboard=e,r.customDashboard.draggable={enabled:!0,handle:".draggable",stop:l},r.customDashboard.resizable={enabled:!0,handle:".resizable",stop:l},r.customDashboard.widgets=[];var t=_.map(["chat","fax","mail","openchannel","sms","voice","whatsapp"],function(e){return"voice"===e?o.rpc.getVoiceQueues({fields:"id,name"}).$promise.then(function(e){r.voiceQueues=e}):(a=(t="chat"===(n=e)?n+"Website":n+"Account")+"s",o[t].get({fields:"id,name"}).$promise.then(function(e){r[a]=e||{count:0,rows:[]}}));var n,t,a});return i.all(t).then(function(){return o.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=r.voiceQueues,e.rows[n].voiceQueuesSelected=_.map(r.voiceQueues.rows,"id"),e.rows[n].smsAccounts=r.smsAccounts,e.rows[n].smsAccountsSelected=_.map(r.smsAccounts.rows,"id"),e.rows[n].faxAccounts=r.faxAccounts,e.rows[n].faxAccountsSelected=_.map(r.faxAccounts.rows,"id"),e.rows[n].mailAccounts=r.mailAccounts,e.rows[n].mailAccountsSelected=_.map(r.mailAccounts.rows,"id"),e.rows[n].openchannelAccounts=r.openchannelAccounts,e.rows[n].openchannelAccountsSelected=_.map(r.openchannelAccounts.rows,"id"),e.rows[n].chatWebsites=r.chatWebsites,e.rows[n].chatWebsitesSelected=_.map(r.chatWebsites.rows,"id"),e.rows[n].whatsappAccounts=r.whatsappAccounts,e.rows[n].whatsappAccountsSelected=_.map(r.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",r.customDashboard.widgets.push(e.rows[n])}).catch(function(e){console.error(e)})})},r.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:r.customDashboard.widgets,license:null,setting:null,crudPermissions:r.crudPermissions}}).then(function(e){if(e)for(var n=0;n<r.customDashboard.widgets.length;n+=1)r.customDashboard.widgets[n].id===e.id&&(r.customDashboard.widgets[n].attrs=e.attrs,r.customDashboard.widgets[n].voiceQueues=r.voiceQueues,r.customDashboard.widgets[n].voiceQueuesSelected=_.map(r.voiceQueues.rows,"id"),r.customDashboard.widgets[n].smsAccounts=r.smsAccounts,r.customDashboard.widgets[n].smsAccountsSelected=_.map(r.smsAccounts.rows,"id"),r.customDashboard.widgets[n].faxAccounts=r.faxAccounts,r.customDashboard.widgets[n].faxAccountsSelected=_.map(r.faxAccounts.rows,"id"),r.customDashboard.widgets[n].mailAccounts=r.mailAccounts,r.customDashboard.widgets[n].mailAccountsSelected=_.map(r.mailAccounts.rows,"id"),r.customDashboard.widgets[n].openchannelAccounts=r.openchannelAccounts,r.customDashboard.widgets[n].openchannelAccountsSelected=_.map(r.openchannelAccounts.rows,"id"),r.customDashboard.widgets[n].chatWebsites=r.chatWebsites,r.customDashboard.widgets[n].chatWebsitesSelected=_.map(r.chatWebsites.rows,"id"),r.customDashboard.widgets[n].whatsappAccounts=r.whatsappAccounts,r.customDashboard.widgets[n].whatsappAccountsSelected=_.map(r.whatsappAccounts.rows,"id"),r.customDashboard.widgets[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+r.customDashboard.widgets[n].type+"/ms-widget-engine."+r.customDashboard.widgets[n].type+".html")})},r.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 o.dashboardItem.delete({id:n.id}).$promise.then(function(e){_.remove(r.customDashboard.widgets,{id:n.id}),s.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){r.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];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:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","$q","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.contact_item_types",{id:1013,title:"ContactItemType",route:"contactItemType",translate:"TOOLS.CONTACTITEMTYPE",state:"app.tools.contact_item_types",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1013)&&!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(e,n,t,a,i,s,o,r,l){this.items=[{font_icon:"icon-hangouts",class:"green-700-fg",label:"chat",title:"TOOLBAR.CHAT",value:"chat",permission:r.chat,enabled:l.chatAutoanswer,delay:l.chatAutoanswerDelay},{font_icon:"icon-email",class:"teal-fg",label:"email",title:"TOOLBAR.EMAIL",value:"email",permission:r.mail,enabled:l.emailAutoanswer,delay:l.emailAutoanswerDelay},{font_icon:"icon-message-text",class:"orange-fg",label:"sms",title:"TOOLBAR.SMS",value:"sms",permission:r.messaging,enabled:l.smsAutoanswer,delay:l.smsAutoanswerDelay},{font_icon:"icon-google-earth",class:"amber-fg",label:"openchannel",title:"TOOLBAR.OPENCHANNEL",value:"openchannel",permission:r.openchannel,enabled:l.openchannelAutoanswer,delay:l.openchannelAutoanswerDelay},{font_icon:"icon-deskphone",class:"grey-A200-fg",label:"fax",title:"TOOLBAR.FAX",value:"fax",permission:r.fax,enabled:l.faxAutoanswer,delay:l.faxAutoanswerDelay},{font_icon:"icon-whatsapp",class:"lime-A700-fg",label:"whatsapp",title:"TOOLBAR.WHATSAPP",value:"whatsapp",permission:r.whatsapp,enabled:l.whatsappAutoanswer,delay:l.whatsappAutoanswerDelay}],this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","socket","license","user"],angular.module("app.toolbar").controller("AutoAnswerNotificationsDialogController",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()}function c(e){return s.cmContact.getAdditionalPhones({id:e}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");l.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");l.additionalItems=[];for(var s=0;s<n.length;s++)l.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})})}l.customFieldsMap=r&&r.rows?_.mapValues(_.keyBy(r.rows,function(e){return"cf_"+e.id}),"name"):{},l.errors=[],l.hopperIds=[],l.additionalItems=[],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"})):(c(e.Contact.id),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"})):(c(e.Contact.id),_.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"})):(c(e.Contact.id),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","AdditionalPhones","additionalPhones","priority","scheduledat","tags","updatedAt","facebook","twitter","skype","wechat","teams","viber","line","telegram"],e)},l.isNil=function(e){return _.isNil(e)},_.isNil(l.preview)||c(l.preview.Contact.id),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).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),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.autoanswerIconColor=I.currentUser.chatAutoanswer||I.currentUser.faxAutoanswer||I.currentUser.smsAutoanswer||I.currentUser.emailAutoanswer||I.currentUser.openchannelAutoanswer||I.currentUser.whatsappAutoanswer?"green-700-fg":"gray-700-fg",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.variables.extravar?e.variables.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.autoAnswerNotificationsDialog=function(e){I.autoanswerNotifications;c.show({controller:"AutoAnswerNotificationsDialogController",controllerAs:"vm",templateUrl:"app/toolbar/autoanswers/dialog.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:I.license,user:I.currentUser}})},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"),h.removeAllListeners("userAutoanswerNotification: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.textButtonColor" label="{{\'CHAT.TEXT_BUTTON_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              <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-primary" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContactsUpdates($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.UPDATES_EXISTING_CONTACTS">\n        <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n          {{\'CONTACTMANAGER.UPDATE_EXISTING_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-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\n      <md-input-container class="md-block" flex-gt-sm="">\n        <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n          <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n            {{ $chip.phone }}\n          </md-chip-template>\n        </md-chips>\n      </md-input-container>\n      <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="100">\n        <div class="pb-16" layout="column" layout-align="start center">\n          <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n        </div>\n        <form flex name="additionalPhonesForm" novalidate>\n          <div ng-repeat="additionalPhone in vm.additionalItems">\n            <div layout="row" flex="1">\n              <md-input-container class="md-block" flex="50">\n                <label>{{$index}} - {{additionalPhone.phone}}</label>\n                <md-select ng-model="vm.additionalItemTypes[$index]" ng-disabled="!vm.crudPermissions.canEdit">\n                  <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n                  <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                </md-select>\n              </md-input-container>\n              <md-input-container class="md-block" flex="50">\n                <input ng-model="additionalPhone.description" ng-cloak>\n              </md-input-container>\n            </div>\n          </div>\n        </form>\n      </div>\n\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\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        </div>\n\n        <div ng-switch-when="select">\n          <label>{{customField.alias}}</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">{{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          <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 && additionalPhonesForm.$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                  </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\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\n                  <div layout-gt-sm="row" class="layout-gt-sm-row">\n                    <md-input-container class="md-block" flex-gt-sm="">\n                      <label translate="CONTACTMANAGER.ADDITIONAL_PHONES">Additional Phones</label>\n                      <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n                        <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n                          {{ $chip.phone }}\n                        </md-chip-template>\n                      </md-chips>\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="" 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\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\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.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n              </div>\n              <form name="additionalPhonesForm" novalidate>\n                <div ng-repeat="additionalPhone in vm.additionalItems">\n                  <div layout="row">\n                    <md-button class="md-icon-button" ng-show="!$first" ng-click="vm.moveUp($index)">\n                      <md-tooltip>{{\'CONTACTMANAGER.MOVE_UP\' | translate}}</md-tooltip>\n                      <md-icon md-font-icon="icon-arrow-up"></md-icon>\n                    </md-button>\n                    <md-button class="md-icon-button md-primary" ng-show="!$last" ng-click="vm.moveDown($index)">\n                      <md-tooltip>{{\'CONTACTMANAGER.MOVE_DOWN\' | translate}}</md-tooltip>\n                      <md-icon md-font-icon="icon-arrow-down"></md-icon>\n                    </md-button>\n                  </div>\n                  <div layout="column" style="margin-bottom:5px;border-bottom: 1px solid gray;">\n                    <md-input-container class="md-block">\n                      <label>{{$index}} - {{additionalPhone.phone}}</label>\n                      <md-select ng-model="additionalPhone.ItemTypeId" ng-disabled="!vm.crudPermissions.canEdit">\n                        <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n                        <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                      </md-select>\n                    </md-input-container>\n                    <md-input-container class="md-block">\n                      <input ng-model="additionalPhone.description" ng-cloak>\n                    </md-input-container>\n                  </div>\n                </div>\n              </form>\n            </div>\n\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 class="form-title" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n            <div layout="row" ng-repeat="additionalPhone in vm.contactItemTypes" flex>\n              <md-input-container class="md-icon-float md-block" flex="50">\n                <md-select name="{{additionalPhone.key}}" ng-model="vm.binding[additionalPhone.key]" placeholder="{{additionalPhone.key}}" ng-required="additionalPhone.required">\n                  <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n                  </md-option>\n                </md-select>\n              </md-input-container>\n              <md-input-container class="md-icon-float md-block" flex="50">\n                <md-select name="{{additionalPhone.key+\'_description\'}}" ng-model="vm.binding[additionalPhone.key+\'_description\']" placeholder="{{additionalPhone.key}} description" ng-required="additionalPhone.required">\n                  <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n                  </md-option>\n                </md-select>\n              </md-input-container>\n            </div>\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/import/importUpdates.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.UPDATE_EXISTING_CONTACTS">Update Existing 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 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\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 class="form-title" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n            <div layout="row" ng-repeat="additionalPhone in vm.contactItemTypes" flex>\n              <md-input-container class="md-icon-float md-block" flex="50">\n                <md-select multiple="true" name="{{additionalPhone.key}}" ng-model="vm.binding[additionalPhone.key]" placeholder="{{additionalPhone.key}}" ng-required="additionalPhone.required">\n                  <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n                  </md-option>\n                </md-select>\n              </md-input-container>\n              <md-input-container class="md-icon-float md-block" flex="50">\n                <md-select multiple="true" name="{{additionalPhone.key+\'_description\'}}" ng-model="vm.binding[additionalPhone.key+\'_description\']" placeholder="{{additionalPhone.key}} description" ng-required="additionalPhone.required">\n                  <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n                  </md-option>\n                </md-select>\n              </md-input-container>\n            </div>\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 ng-if="(vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum}).length>0">\n                      <span ng-style="{\'color\':(vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].color} ">\n                        {{ (vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].description }} -\n                        {{ (vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].type }}\n                      </span>\n                    </div>\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                <div layout-gt-sm="row" class="layout-gt-sm-row">\n                  <md-input-container class="md-block" flex-gt-sm="">\n                    <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n                      <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n                        {{ $chip.phone }}\n                      </md-chip-template>\n                    </md-chips>\n                  </md-input-container>\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.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n                    </div>\n                    <form name="additionalPhonesForm" novalidate>\n                      <div ng-repeat="additionalPhone in vm.additionalItems" layout="column">\n                        <md-input-container class="md-block">\n                          <label>{{$index}} - {{additionalPhone.phone}}</label>\n                          <md-select ng-model="vm.additionalItemTypes[$index]">\n                            <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n                            <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n                          </md-select>\n                        </md-input-container>\n                        <md-input-container class="md-block">\n                          <input ng-model="additionalPhone.description" ng-cloak>\n                        </md-input-container>\n                      </div>\n                    </form>\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">\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" ng-required="true">\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        <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">\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                          <md-input-container class="md-block">\n                            <label translate="INTEGRATIONS.ADDITIONALSEARCHCONTACT">Additional search contact</label>\n                            <input type="" name="additionalSearchContact" ng-model="vm_cc.dynamics365Configuration.additionalSearchContact" autofocus>\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) || (additionalphonesForm.$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          <div class="queueCampaign-detail-form-container additionalphones 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.ADDITIONALPHONES">ADDITIONALPHONES</div>\n            </div>\n            <form name="additionalphonesForm" novalidate>\n              <md-input-container class="md-block">\n                <label translate="MOTIONDIALER.CALLADDITIONALPHONEAFTERMIN">CallAdditionalPhoneAfterMin</label>\n                <input type="number" name="callAdditionalPhoneAfterMin" ng-model="vm.queueCampaign.callAdditionalPhoneAfterMin" min="1" max="99999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n                <div ng-messages="additionalphonesForm[\'callAdditionalPhoneAfterMin\'].$error" ng-show="additionalphonesForm[\'callAdditionalPhoneAfterMin\'].$touched" role="alert">\n                  <div ng-message="required">\n                    <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_REQUIRED">CallAdditionalPhoneAfterMin field is required</span>\n                  </div>\n                  <div ng-message="min">\n                    <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CallAdditionalPhoneAfterMin must be a valid greater or equal than</span> <span>1</span>\n                  </div>\n                  <div ng-message="max">\n                    <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_MUST_BE_LESS_THAN_OR_EQUAL_TO">CallAdditionalPhoneAfterMin 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">\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 mw-150" placeholder="{{ \'DASHBOARDS.SELECT_QUEUE\' | translate }}" md-on-open="vm.getQueuesByChannel()" 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=\"['pause', '*pause'].includes(agent.globalStatus)\">{{ 'VOICE.PAUSE' | translate | uppercase }} (</span>{{\n              ['pause', '*pause'].includes(agent.globalStatus) ? \n                ((agent.globalStatusDisplayValue === 'DEFAULT PAUSE' ? ('VOICE.DEFAULT_PAUSE' | translate) : agent.globalStatusDisplayValue) | uppercase) : \n                ('VOICE.' + (agent.globalStatusDisplayValue | uppercase) | translate | uppercase) }}<span ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\">)</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=\"['pause', '*pause'].includes(agent.globalStatus)\" 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=\"['pause', '*pause'].includes(agent.globalStatus)\">\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) || (autoAnswerForm.$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          <div class="agent-detail-form-container auto_answer 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.AUTO_ANSWER">AUTO_ANSWER</div>\n            </div>\n            <form name="autoAnswerForm" novalidate>\n              <md-input-container ng-if="vm.license.chat" class="md-block">\n                <md-switch ng-model="vm.agent.chatAutoanswer" aria-label="chatAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.CHAT_AUTOANSWER">ChatAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.chatAutoanswer" class="md-block">\n                  <label translate="STAFF.CHAT_AUTOANSWERDELAY">ChatAutoAnswerDelay</label>\n                  <input type="number" name="chatAutoAnswerDelay" ng-model="vm.agent.chatAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.mail" class="md-block">\n                <md-switch ng-model="vm.agent.emailAutoanswer" aria-label="emailAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.EMAIL_AUTOANSWER">EmailAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.emailAutoanswer" class="md-block">\n                  <label translate="STAFF.EMAIL_AUTOANSWERDELAY">EmailAutoAnswerDelay</label>\n                  <input type="number" name="emailAutoAnswerDelay" ng-model="vm.agent.emailAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.messaging" class="md-block">\n                <md-switch ng-model="vm.agent.smsAutoanswer" aria-label="smsAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.SMS_AUTOANSWER">SmsAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.smsAutoanswer" class="md-block">\n                  <label translate="STAFF.SMS_AUTOANSWERDELAY">SmsAutoAnswerDelay</label>\n                  <input type="number" name="smsAutoAnswerDelay" ng-model="vm.agent.smsAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.openchannel" class="md-block">\n                <md-switch ng-model="vm.agent.openchannelAutoanswer" aria-label="openchannelAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.OPENCHANNEL_AUTOANSWER">openchannelAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.openchannelAutoanswer" class="md-block">\n                  <label translate="STAFF.OPENCHANNEL_AUTOANSWERDELAY">openchannelAutoAnswerDelay</label>\n                  <input type="number" name="openchannelAutoAnswerDelay" ng-model="vm.agent.openchannelAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.fax" class="md-block">\n                <md-switch ng-model="vm.agent.faxAutoanswer" aria-label="faxAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.FAX_AUTOANSWER">faxAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.faxAutoanswer" class="md-block">\n                  <label translate="STAFF.FAX_AUTOANSWERDELAY">faxAutoAnswerDelay</label>\n                  <input type="number" name="faxAutoAnswerDelay" ng-model="vm.agent.faxAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.whatsapp" class="md-block">\n                <md-switch ng-model="vm.agent.whatsappAutoanswer" aria-label="whatsappAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.WHATSAPP_AUTOANSWER">whatsappAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.whatsappAutoanswer" class="md-block">\n                  <label translate="STAFF.WHATSAPP_AUTOANSWERDELAY">whatsappAutoAnswerDelay</label>\n                  <input type="number" name="whatsappAutoAnswerDelay" ng-model="vm.agent.whatsappAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\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/contact_item_types/contact_item_types.html",'<div id="contact_item_types" 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.CONTACTITEMTYPE">ContactItemType</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.selectedContactItemType.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n    <div class="close-button-wrapper" ng-click="vm.selectedContactItemType =[]">\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-contact_item_types-count">\n          <span>{{vm.selectedContactItemType.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.selectAllContactItemType()" translate="TOOLS.SELECT_ALL">\n                Select all\n              </md-button>\n            </md-menu-item>\n            <md-menu-item>\n              <md-button ng-click="vm.deselectContactItemType()" 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.exportSelectedContactItemType" csv-label="true" filename="contact_item_types.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.deleteSelectedContactItemType($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" ms-scroll>\n\n\n      \x3c!-- CONTACTITEMTYPE TABLE --\x3e\n      <md-card>\n        <md-table-container>\n          <table md-table md-row-select multiple ng-model="vm.selectedContactItemType" md-progress="vm.promise">\n            <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContactItemType">\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="OrderBy">{{ \'TOOLS.ORDER_BY\' | translate }}</th>\n                <th md-column width="10px"></th>\n              </tr>\n            </thead>\n            <tbody md-body>\n              <tr md-row ng-hide="vm.contact_item_types.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="contactItemType" md-select-id="id" ng-repeat="contactItemType in vm.contact_item_types.rows">\n                <td md-cell ng-if="contactItemType.userpic"><img class="avatar" alt="{{contactItemType.name}}" ng-src="api/users/{{contactItemType.id}}/avatar" /></td>\n                <td md-cell ng-if="!contactItemType.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{contactItemType.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n                <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="id ">{{contactItemType.id}}</td>\n                <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="name ">{{contactItemType.name}}</td>\n                <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="OrderBy ">{{contactItemType.OrderBy}}</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(contactItemType, $event    )" translate="TOOLS.EDIT_CONTACTITEMTYPE">\n                          Edit ContactItemType\n                        </md-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(contactItemType, $event    )" translate="TOOLS.DELETE_CONTACTITEMTYPE">\n                          Delete ContactItemType\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.contact_item_types.count}}" md-on-paginate="vm.getContactItemType" md-page-select></md-table-pagination>\n      </md-card>\n      \x3c!-- / CONTACTITEMTYPE 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 CONTACTITEMTYPE BUTTON --\x3e\n  <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-contactItemType-button" ng-click="vm.createOrEditContactItemType($event)" aria-label="add contactItemType" translate translate-attr-aria-label="TOOLS.ADD_CONTACTITEMTYPE">\n    <md-icon md-font-icon="icon-plus"></md-icon>\n  </md-button>\n  \x3c!-- / ADD CONTACTITEMTYPE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/contact_item_types/create/dialog.html",'<md-dialog class="contactItemType-dialog" aria-label="New ContactItemType">\n  <form name="contactItemTypeForm" class="md-inline-form" novalidate>\n    <md-toolbar class="md-accent md-hue-2">\n      <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n        <span class="title">{{ vm.title | translate }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon 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      <md-input-container class="md-block">\n        <label translate="TOOLS.NAME">Name</label>\n        <input type="text" name="name" ng-model="vm.contactItemType.name" ng-required="true" autofocus>\n\n        <div ng-messages="contactItemTypeForm[\'name\'].$error" ng-show="contactItemTypeForm[\'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.ORDER_BY">Order_by</label>\n        <input type="integer" name="OrderBy" ng-model="vm.contactItemType.OrderBy" ng-required="true">\n\n        <div ng-messages="contactItemTypeForm[\'OrderBy\'].$error" ng-show="contactItemTypeForm[\'OrderBy\'].$touched" role="alert">\n          <div ng-message="required">\n            <span translate="TOOLS.ERRORS.ORDER_BY_REQUIRED">Order_by field is required</span>\n          </div>\n        </div>\n      </md-input-container>\n      <div flex md-color-picker ng-model="vm.contactItemType.rgbBackgroundColor" label="{{\'TOOLS.RGBBACKGROUNDCOLOR\' | 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.newContactItemType" ng-click="vm.saveContactItemType()" class="send-button md-accent md-raised" ng-disabled="contactItemTypeForm.$invalid || contactItemTypeForm.$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.newContactItemType" ng-click="vm.addNewContactItemType()" class="send-button md-accent md-raised" ng-disabled="contactItemTypeForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CONTACTITEMTYPE" translate-attr-aria-label="TOOLS.ADD_CONTACTITEMTYPE">\n          ADD CONTACTITEMTYPE\n        </md-button>\n      </div>\n      <div layout="row">\n        <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContactItemType" ng-click="vm.deleteContactItemType($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/autoanswers/dialog.html",'<md-dialog class="autoanswers-dialog" aria-label="autoanswers">\n  <form name="autoanswerForm" 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.AUTOANSWER_NOTIFICATIONS\' | translate)  }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content layout-padding>\n      <md-table-container>\n        <table md-table multiple>\n          <thead md-head>\n            <tr md-row>\n              <th></th>\n              <th md-column>{{ \'TOOLBAR.CHANNEL\' | translate }}</th>\n              <th md-column>{{ \'TOOLBAR.NOTIFICATIONS\' | translate }}</th>\n              <th md-column>{{ \'TOOLBAR.DELAY\' | translate }}</th>\n            </tr>\n          </thead>\n          <tbody md-body>\n            <tr md-row ng-repeat="item in vm.items" ng-if="item.permission">\n              <td>\n                <md-icon md-font-icon="{{item.font_icon}}" class="icon {{item.class}} {{item.font_icon}}" aria-label="{{item.label}}"></md-icon>\n              </td>\n              <td md-cell>\n                <div layout="row">\n                  <span translate="{{item.title}}"></span>\n                </div>\n              </td>\n              <td md-cell align="center">\n                <div layout="row" layout-align="center">\n                  <md-icon ng-if="item.enabled" md-font-icon="icon-check-circle" class="icon green-700-fg"></md-icon>\n                  <span ng-if="!item.enabled" style="color:red">X</span>\n                </div>\n              </td>\n              <td md-cell align="right">\n                <div layout="row" layout-align="end">\n                  <span ng-if="item.enabled">{{item.delay}}</span>\n                </div>\n              </td>\n            </tr>\n          </tbody>\n        </table>\n      </md-table-container>\n    </md-dialog-content>\n\n    <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),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.chat || vm.license.mail || vm.license.messaging || vm.license.openchannel || vm.license.fax || vm.license.whatsapp)" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.autoAnswerNotificationsDialog($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n      <md-icon md-font-icon="icon-reply" class="icon {{ vm.autoanswerIconColor }}"></md-icon>\n      <md-tooltip><span translate="TOOLBAR.AUTOANSWER_NOTIFICATIONS">Notifications</span></md-tooltip>\n    </md-button>\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\n            <md-input-container ng-if="vm.additionalItems.length>0" class="md-block no-margin">\n              <label translate="CONTACTMANAGER.ADDITIONAL_PHONES">Additional phones</label>\n              <md-chips ng-model="vm.additionalItems" placeholder="Phone numbers" readonly="true">\n                <md-chip-template custom-chip alt="{{$chip.type}} {{$chip.description}}" title="{{$chip.type}} {{$chip.description}}">\n                  {{ $chip.phone }}\n                </md-chip-template>\n              </md-chips>\n            </md-input-container>\n\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,textButtonColor,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,textButtonColor,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,textButtonColor,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,textButtonColor,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,textButtonColor,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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay",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,textButtonColor,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{var t="mail"==e.channel?"email":e.channel;y.user[t+"Autoanswer"]?l(function(){if(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)}).catch(M())},y.user[t+"AutoanswerDelay"]?1e3*y.user[t+"AutoanswerDelay"]:0):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=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(){b()}function E(e){_.remove(v.agents.rows,["id",e.UserId])}function y(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,sort:"fullname",globalStatusFilter:"",pauseTypeFilter:"",globalQueueFilter:[],channel:v.channel},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(){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()})})},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()})})},v.clearSelection=function(){v.query.globalQueueFilter=[]},v.selectAll=function(){_.forEach(v.queues.rows,function(e){v.query.globalQueueFilter.push(e.name)})},v.getQueuesByChannel=function(){if(v.queues&&0<v.queues.count)return;var e={type:v.queueType||"inbound",fields:"id,name",sort:"name",nolimit:"true"},n=v.channel+"Queue";return l.getResourcesByRole(v.currentUser,n,e,null).then(function(e){v.queues=e}).catch(function(e){c.error({title:s.instant("VOICE.QUEUES"),msg:e.status?JSON.stringify(e.data):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),(0<v.query.globalQueueFilter.length||!_.isEmpty(v.query.globalStatusFilter))&&b()):e.online&&b()}),d.on("user:update",function(e){var n=_.find(v.agents.rows,["id",e.id]);if(n){if(!1===e.online)return y(n);b()}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"]))}(0<v.query.globalQueueFilter.length||!_.isEmpty(v.query.globalStatusFilter))&&b()}),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);(0<v.query.globalQueueFilter.length||!_.isEmpty(v.query.globalStatusFilter))&&b()}),d.on("userVoiceQueue:save",A),d.on("userVoiceQueue:remove",E),d.on("userChatQueue:save",A),d.on("userChatQueue:remove",E),d.on("userSmsQueue:save",A),d.on("userSmsQueue:remove",E),d.on("userMailQueue:save",A),d.on("userMailQueue:remove",E),d.on("userFaxQueue:save",A),d.on("userFaxQueue:remove",E),d.on("userOpenchannelQueue:save",A),d.on("userOpenchannelQueue:remove",E),d.on("userWhatsappQueue:save",A),d.on("userWhatsappQueue:remove",E),f(),e.$on("$destroy",function(){d.removeAllListeners("user:save"),d.removeAllListeners("user:update"),d.removeAllListeners("user:agentconnect"),d.removeAllListeners("user:agentcomplete"),d.removeAllListeners("userVoiceQueue:save"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userChatQueue:save"),d.removeAllListeners("userChatQueue:remove"),d.removeAllListeners("userSmsQueue:save"),d.removeAllListeners("userSmsQueue:remove"),d.removeAllListeners("userMailQueue:save"),d.removeAllListeners("userMailQueue:remove"),d.removeAllListeners("userFaxQueue:save"),d.removeAllListeners("userFaxQueue:remove"),d.removeAllListeners("userOpenchannelQueue:save"),d.removeAllListeners("userOpenchannelQueue:remove"),d.removeAllListeners("userWhatsappQueue:save"),d.removeAllListeners("userWhatsappQueue:remove"),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.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,chatAutoanswer,chatAutoanswerDelay",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,i,s,o){var r=this;function l(e,n,t){return o.dashboardItem.update(t).$promise.catch(function(e){console.error(e)})}r.customDashboard={},r.init=function(e,n){r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.customDashboard=e,r.customDashboard.draggable={enabled:!0,handle:".draggable",stop:l},r.customDashboard.resizable={enabled:!0,handle:".resizable",stop:l},r.customDashboard.widgets=[];var t=_.map(["chat","fax","mail","openchannel","sms","voice","whatsapp"],function(e){return"voice"===e?o.rpc.getVoiceQueues({fields:"id,name"}).$promise.then(function(e){r.voiceQueues=e}):(a=(t="chat"===(n=e)?n+"Website":n+"Account")+"s",o[t].get({fields:"id,name"}).$promise.then(function(e){r[a]=e||{count:0,rows:[]}}));var n,t,a});return i.all(t).then(function(){return o.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=r.voiceQueues,e.rows[n].voiceQueuesSelected=_.map(r.voiceQueues.rows,"id"),e.rows[n].smsAccounts=r.smsAccounts,e.rows[n].smsAccountsSelected=_.map(r.smsAccounts.rows,"id"),e.rows[n].faxAccounts=r.faxAccounts,e.rows[n].faxAccountsSelected=_.map(r.faxAccounts.rows,"id"),e.rows[n].mailAccounts=r.mailAccounts,e.rows[n].mailAccountsSelected=_.map(r.mailAccounts.rows,"id"),e.rows[n].openchannelAccounts=r.openchannelAccounts,e.rows[n].openchannelAccountsSelected=_.map(r.openchannelAccounts.rows,"id"),e.rows[n].chatWebsites=r.chatWebsites,e.rows[n].chatWebsitesSelected=_.map(r.chatWebsites.rows,"id"),e.rows[n].whatsappAccounts=r.whatsappAccounts,e.rows[n].whatsappAccountsSelected=_.map(r.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",r.customDashboard.widgets.push(e.rows[n])}).catch(function(e){console.error(e)})})},r.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:r.customDashboard.widgets,license:null,setting:null,crudPermissions:r.crudPermissions}}).then(function(e){if(e)for(var n=0;n<r.customDashboard.widgets.length;n+=1)r.customDashboard.widgets[n].id===e.id&&(r.customDashboard.widgets[n].attrs=e.attrs,r.customDashboard.widgets[n].voiceQueues=r.voiceQueues,r.customDashboard.widgets[n].voiceQueuesSelected=_.map(r.voiceQueues.rows,"id"),r.customDashboard.widgets[n].smsAccounts=r.smsAccounts,r.customDashboard.widgets[n].smsAccountsSelected=_.map(r.smsAccounts.rows,"id"),r.customDashboard.widgets[n].faxAccounts=r.faxAccounts,r.customDashboard.widgets[n].faxAccountsSelected=_.map(r.faxAccounts.rows,"id"),r.customDashboard.widgets[n].mailAccounts=r.mailAccounts,r.customDashboard.widgets[n].mailAccountsSelected=_.map(r.mailAccounts.rows,"id"),r.customDashboard.widgets[n].openchannelAccounts=r.openchannelAccounts,r.customDashboard.widgets[n].openchannelAccountsSelected=_.map(r.openchannelAccounts.rows,"id"),r.customDashboard.widgets[n].chatWebsites=r.chatWebsites,r.customDashboard.widgets[n].chatWebsitesSelected=_.map(r.chatWebsites.rows,"id"),r.customDashboard.widgets[n].whatsappAccounts=r.whatsappAccounts,r.customDashboard.widgets[n].whatsappAccountsSelected=_.map(r.whatsappAccounts.rows,"id"),r.customDashboard.widgets[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+r.customDashboard.widgets[n].type+"/ms-widget-engine."+r.customDashboard.widgets[n].type+".html")})},r.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 o.dashboardItem.delete({id:n.id}).$promise.then(function(e){_.remove(r.customDashboard.widgets,{id:n.id}),s.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){r.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];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:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","$q","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(e,n,t,a,i,s,o,r,l){this.items=[{font_icon:"icon-hangouts",class:"green-700-fg",label:"chat",title:"TOOLBAR.CHAT",value:"chat",permission:r.chat,enabled:l.chatAutoanswer,delay:l.chatAutoanswerDelay},{font_icon:"icon-email",class:"teal-fg",label:"email",title:"TOOLBAR.EMAIL",value:"email",permission:r.mail,enabled:l.emailAutoanswer,delay:l.emailAutoanswerDelay},{font_icon:"icon-message-text",class:"orange-fg",label:"sms",title:"TOOLBAR.SMS",value:"sms",permission:r.messaging,enabled:l.smsAutoanswer,delay:l.smsAutoanswerDelay},{font_icon:"icon-google-earth",class:"amber-fg",label:"openchannel",title:"TOOLBAR.OPENCHANNEL",value:"openchannel",permission:r.openchannel,enabled:l.openchannelAutoanswer,delay:l.openchannelAutoanswerDelay},{font_icon:"icon-deskphone",class:"grey-A200-fg",label:"fax",title:"TOOLBAR.FAX",value:"fax",permission:r.fax,enabled:l.faxAutoanswer,delay:l.faxAutoanswerDelay},{font_icon:"icon-whatsapp",class:"lime-A700-fg",label:"whatsapp",title:"TOOLBAR.WHATSAPP",value:"whatsapp",permission:r.whatsapp,enabled:l.whatsappAutoanswer,delay:l.whatsappAutoanswerDelay}],this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","socket","license","user"],angular.module("app.toolbar").controller("AutoAnswerNotificationsDialogController",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.autoanswerIconColor=I.currentUser.chatAutoanswer||I.currentUser.faxAutoanswer||I.currentUser.smsAutoanswer||I.currentUser.emailAutoanswer||I.currentUser.openchannelAutoanswer||I.currentUser.whatsappAutoanswer?"green-700-fg":"gray-700-fg",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.variables.extravar?e.variables.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.autoAnswerNotificationsDialog=function(e){I.autoanswerNotifications;c.show({controller:"AutoAnswerNotificationsDialogController",controllerAs:"vm",templateUrl:"app/toolbar/autoanswers/dialog.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:I.license,user:I.currentUser}})},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"),h.removeAllListeners("userAutoanswerNotification: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.textButtonColor" label="{{\'CHAT.TEXT_BUTTON_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              <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">\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 mw-150" placeholder="{{ \'DASHBOARDS.SELECT_QUEUE\' | translate }}" md-on-open="vm.getQueuesByChannel()" 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=\"['pause', '*pause'].includes(agent.globalStatus)\">{{ 'VOICE.PAUSE' | translate | uppercase }} (</span>{{\n              ['pause', '*pause'].includes(agent.globalStatus) ? \n                ((agent.globalStatusDisplayValue === 'DEFAULT PAUSE' ? ('VOICE.DEFAULT_PAUSE' | translate) : agent.globalStatusDisplayValue) | uppercase) : \n                ('VOICE.' + (agent.globalStatusDisplayValue | uppercase) | translate | uppercase) }}<span ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\">)</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=\"['pause', '*pause'].includes(agent.globalStatus)\" 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=\"['pause', '*pause'].includes(agent.globalStatus)\">\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) || (autoAnswerForm.$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          <div class="agent-detail-form-container auto_answer 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.AUTO_ANSWER">AUTO_ANSWER</div>\n            </div>\n            <form name="autoAnswerForm" novalidate>\n              <md-input-container ng-if="vm.license.chat" class="md-block">\n                <md-switch ng-model="vm.agent.chatAutoanswer" aria-label="chatAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.CHAT_AUTOANSWER">ChatAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.chatAutoanswer" class="md-block">\n                  <label translate="STAFF.CHAT_AUTOANSWERDELAY">ChatAutoAnswerDelay</label>\n                  <input type="number" name="chatAutoAnswerDelay" ng-model="vm.agent.chatAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.mail" class="md-block">\n                <md-switch ng-model="vm.agent.emailAutoanswer" aria-label="emailAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.EMAIL_AUTOANSWER">EmailAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.emailAutoanswer" class="md-block">\n                  <label translate="STAFF.EMAIL_AUTOANSWERDELAY">EmailAutoAnswerDelay</label>\n                  <input type="number" name="emailAutoAnswerDelay" ng-model="vm.agent.emailAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.messaging" class="md-block">\n                <md-switch ng-model="vm.agent.smsAutoanswer" aria-label="smsAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.SMS_AUTOANSWER">SmsAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.smsAutoanswer" class="md-block">\n                  <label translate="STAFF.SMS_AUTOANSWERDELAY">SmsAutoAnswerDelay</label>\n                  <input type="number" name="smsAutoAnswerDelay" ng-model="vm.agent.smsAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.openchannel" class="md-block">\n                <md-switch ng-model="vm.agent.openchannelAutoanswer" aria-label="openchannelAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.OPENCHANNEL_AUTOANSWER">openchannelAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.openchannelAutoanswer" class="md-block">\n                  <label translate="STAFF.OPENCHANNEL_AUTOANSWERDELAY">openchannelAutoAnswerDelay</label>\n                  <input type="number" name="openchannelAutoAnswerDelay" ng-model="vm.agent.openchannelAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.fax" class="md-block">\n                <md-switch ng-model="vm.agent.faxAutoanswer" aria-label="faxAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.FAX_AUTOANSWER">faxAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.faxAutoanswer" class="md-block">\n                  <label translate="STAFF.FAX_AUTOANSWERDELAY">faxAutoAnswerDelay</label>\n                  <input type="number" name="faxAutoAnswerDelay" ng-model="vm.agent.faxAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\n              </md-input-container>\n              <md-input-container ng-if="vm.license.whatsapp" class="md-block">\n                <md-switch ng-model="vm.agent.whatsappAutoanswer" aria-label="whatsappAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n                  <span translate="STAFF.WHATSAPP_AUTOANSWER">whatsappAutoAnswer</span>\n                </md-switch>\n                <md-input-container ng-if="vm.agent.whatsappAutoanswer" class="md-block">\n                  <label translate="STAFF.WHATSAPP_AUTOANSWERDELAY">whatsappAutoAnswerDelay</label>\n                  <input type="number" name="whatsappAutoAnswerDelay" ng-model="vm.agent.whatsappAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n                </md-input-container>\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/autoanswers/dialog.html",'<md-dialog class="autoanswers-dialog" aria-label="autoanswers">\n  <form name="autoanswerForm" 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.AUTOANSWER_NOTIFICATIONS\' | translate)  }}</span>\n        <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n          <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content layout-padding>\n      <md-table-container>\n        <table md-table multiple>\n          <thead md-head>\n            <tr md-row>\n              <th></th>\n              <th md-column>{{ \'TOOLBAR.CHANNEL\' | translate }}</th>\n              <th md-column>{{ \'TOOLBAR.NOTIFICATIONS\' | translate }}</th>\n              <th md-column>{{ \'TOOLBAR.DELAY\' | translate }}</th>\n            </tr>\n          </thead>\n          <tbody md-body>\n            <tr md-row ng-repeat="item in vm.items" ng-if="item.permission">\n              <td>\n                <md-icon md-font-icon="{{item.font_icon}}" class="icon {{item.class}} {{item.font_icon}}" aria-label="{{item.label}}"></md-icon>\n              </td>\n              <td md-cell>\n                <div layout="row">\n                  <span translate="{{item.title}}"></span>\n                </div>\n              </td>\n              <td md-cell align="center">\n                <div layout="row" layout-align="center">\n                  <md-icon ng-if="item.enabled" md-font-icon="icon-check-circle" class="icon green-700-fg"></md-icon>\n                  <span ng-if="!item.enabled" style="color:red">X</span>\n                </div>\n              </td>\n              <td md-cell align="right">\n                <div layout="row" layout-align="end">\n                  <span ng-if="item.enabled">{{item.delay}}</span>\n                </div>\n              </td>\n            </tr>\n          </tbody>\n        </table>\n      </md-table-container>\n    </md-dialog-content>\n\n    <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n    </md-dialog-actions>\n  </form>\n</md-dialog>'),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.chat || vm.license.mail || vm.license.messaging || vm.license.openchannel || vm.license.fax || vm.license.whatsapp)" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.autoAnswerNotificationsDialog($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n      <md-icon md-font-icon="icon-reply" class="icon {{ vm.autoanswerIconColor }}"></md-icon>\n      <md-tooltip><span translate="TOOLBAR.AUTOANSWER_NOTIFICATIONS">Notifications</span></md-tooltip>\n    </md-button>\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 87%
rename from public/styles/app.6bed6274.css
rename to public/styles/app.e921fbc9.css
index a5779d3..b1529b9 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}.mw-150{max-width:150px!important}@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%}}#contact_item_types{position:relative}#contact_item_types>.header{height:76px;min-height:76px;max-height:76px}#contact_item_types>.header .logo .logo-icon{margin:0 16px 0 0}#contact_item_types>.header .logo .logo-text{font-size:24px}#contact_item_types>.header md-icon{color:#fff}#contact_item_types>.header .search-input-wrapper{position:relative}#contact_item_types>.header .search-input-wrapper label{padding-right:4px;cursor:pointer}#contact_item_types>.header .search-input-wrapper label md-icon{color:rgba(255,255,255,.8)}#contact_item_types>.header .search-input-wrapper md-input-container .md-errors-spacer{display:none}#contact_item_types>.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}#contact_item_types>.header .search-input-wrapper md-input-container input::placeholder{color:rgba(255,255,255,.8)}#contact_item_types>.header .search-input-wrapper md-input-container input:focus{border-bottom:1px solid #fff;color:#fff}#contact_item_types>.header.selected-bar{position:absolute;top:0;left:0;right:0;z-index:999;background-image:none;opacity:1!important}#contact_item_types>.header.selected-bar .close-button-wrapper{width:244px}#contact_item_types>.content{position:absolute;top:76px;bottom:0;right:0;left:0}#contact_item_types>.content .main{padding:16px 90px 0 4px;position:absolute;top:0;left:24px;right:0;bottom:0}#contact_item_types>.content .main .no-results{box-shadow:0 1px 1px 0 rgba(0,0,0,.14)}#contact_item_types #add-contactItemType-button{position:fixed;bottom:8px;right:8px;padding:0}#contact_item_types #upload-contactItemType-button{position:fixed;bottom:8px;right:8px;padding:0}md-dialog.contactItemType-dialog{max-width:720px;width:720px}md-dialog.contactItemType-dialog md-dialog-content{display:block;position:relative}md-dialog.contactItemType-dialog md-toolbar .title{font-size:17px}md-dialog.contactItemType-dialog md-input-container textarea{min-height:150px}md-dialog.contactItemType-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.contactItemType-dialog md-input-container md-input-container md-switch{margin:0!important}md-dialog.contactItemType-dialog .date-container{padding:16px 0 24px 0}md-dialog.contactItemType-dialog .error-list{font-size:13px}md-dialog.contactItemType-dialog .error-list .error{background-color:rgba(244,67,54,.08);border:1px solid rgba(244,67,54,.12);padding-left:16px;margin-top:8px;border-radius:2px}md-dialog.contactItemType-dialog .error-list .error .message{font-weight:500}md-dialog.contactItemType-dialog .error-list .error .md-button{margin:0}md-dialog.contactItemType-dialog .error-list .error:last-child{margin-bottom:30px}md-dialog.contactItemType-dialog md-dialog-actions{position:relative;overflow-y:hidden;overflow-x:auto;justify-content:space-between;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.12)}@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}.mw-150{max-width:150px!important}@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
index e1de7d3..3872c77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18ff=['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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x18ff,0x80));var _0xf18f=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x18ff[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0xf18f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf18f('0x1')],'get':function(_0x318144){return this[_0xf18f('0x2')](_0xf18f('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xf18f('0x4'),_0xf18f('0x5'),_0xf18f('0x6'),_0xf18f('0x7'),_0xf18f('0x8'),_0xf18f('0x9'),_0xf18f('0xa'),_0xf18f('0xb')]],'msg':_0xf18f('0xc')}},'comment':_0xf18f('0xc')},'data1':{'type':Sequelize[_0xf18f('0xd')](0x1000),'comment':_0xf18f('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xf18f('0xf')},'data3':{'type':Sequelize[_0xf18f('0xd')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xf18f('0x10')},'data5':{'type':Sequelize[_0xf18f('0xd')](0x1000),'comments':_0xf18f('0x11')},'data6':{'type':Sequelize[_0xf18f('0xd')],'comments':_0xf18f('0x12')},'data7':{'type':Sequelize[_0xf18f('0x13')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xcf40=['integration','motionbar','jscripty','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]','TEXT','urlForward[body]','VIRTUAL','getDataValue','action','contactManager'];(function(_0x3b46ae,_0x2dccf4){var _0x5de2ac=function(_0x37d35f){while(--_0x37d35f){_0x3b46ae['push'](_0x3b46ae['shift']());}};_0x5de2ac(++_0x2dccf4);}(_0xcf40,0x140));var _0x0cf4=function(_0x1dad6c,_0x4c7cb6){_0x1dad6c=_0x1dad6c-0x0;var _0x3f6652=_0xcf40[_0x1dad6c];return _0x3f6652;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0cf4('0x0')],'get':function(_0x3c4fad){return this[_0x0cf4('0x1')](_0x0cf4('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0cf4('0x3'),_0x0cf4('0x4'),_0x0cf4('0x5'),_0x0cf4('0x6'),'urlForward','browser',_0x0cf4('0x7'),_0x0cf4('0x8')]],'msg':_0x0cf4('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x0cf4('0xa')](0x1000),'comment':_0x0cf4('0xb')},'data2':{'type':Sequelize[_0x0cf4('0xa')](0x1000),'comment':_0x0cf4('0xc')},'data3':{'type':Sequelize[_0x0cf4('0xa')](0x1000),'comment':_0x0cf4('0xd')},'data4':{'type':Sequelize[_0x0cf4('0xa')](0x1000),'comments':_0x0cf4('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x0cf4('0xf')},'data6':{'type':Sequelize[_0x0cf4('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x0cf4('0x10')],'comments':_0x0cf4('0x11')}};
\ No newline at end of file
index 5a9590c..b6c43fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74e=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','update','then','destroy','end','error','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x5f04ff,_0x447a9c){var _0x1f3a7d=function(_0x3d1b5f){while(--_0x3d1b5f){_0x5f04ff['push'](_0x5f04ff['shift']());}};_0x1f3a7d(++_0x447a9c);}(_0xa74e,0xfe));var _0xea74=function(_0x526e57,_0x47e6d1){_0x526e57=_0x526e57-0x0;var _0x1eafee=_0xa74e[_0x526e57];return _0x1eafee;};'use strict';var emlformat=require(_0xea74('0x0'));var rimraf=require(_0xea74('0x1'));var zipdir=require(_0xea74('0x2'));var jsonpatch=require(_0xea74('0x3'));var rp=require('request-promise');var moment=require(_0xea74('0x4'));var BPromise=require(_0xea74('0x5'));var Mustache=require(_0xea74('0x6'));var util=require('util');var path=require(_0xea74('0x7'));var sox=require(_0xea74('0x8'));var csv=require(_0xea74('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea74('0xa'));var _=require(_0xea74('0xb'));var squel=require(_0xea74('0xc'));var crypto=require(_0xea74('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xea74('0xe'));var toCsv=require(_0xea74('0x9'));var querystring=require(_0xea74('0xf'));var Papa=require(_0xea74('0x10'));var Redis=require(_0xea74('0x11'));var authService=require(_0xea74('0x12'));var qs=require(_0xea74('0x13'));var as=require(_0xea74('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea74('0x15'))('api');var utils=require(_0xea74('0x16'));var config=require(_0xea74('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xea74('0x18'))['db'];function respondWithStatusCode(_0x33c43f,_0x319f40){_0x319f40=_0x319f40||0xcc;return function(_0x12250d){if(_0x12250d){return _0x33c43f[_0xea74('0x19')](_0x319f40);}return _0x33c43f['status'](_0x319f40)['end']();};}function respondWithResult(_0x123ebe,_0x49c8e6){_0x49c8e6=_0x49c8e6||0xc8;return function(_0x3dc840){if(_0x3dc840){return _0x123ebe[_0xea74('0x1a')](_0x49c8e6)['json'](_0x3dc840);}};}function respondWithFilteredResult(_0xd343a,_0x4e2971){return function(_0x3a77a9){if(_0x3a77a9){var _0x598acb=typeof _0x4e2971[_0xea74('0x1b')]===_0xea74('0x1c')&&typeof _0x4e2971[_0xea74('0x1d')]===_0xea74('0x1c');var _0x451782=_0x3a77a9[_0xea74('0x1e')];var _0x1cdaa9=_0x598acb?0x0:_0x4e2971[_0xea74('0x1b')];var _0x203d72=_0x598acb?_0x3a77a9[_0xea74('0x1e')]:_0x4e2971[_0xea74('0x1b')]+_0x4e2971[_0xea74('0x1d')];var _0x9d722f;if(_0x203d72>=_0x451782){_0x203d72=_0x451782;_0x9d722f=0xc8;}else{_0x9d722f=0xce;}_0xd343a[_0xea74('0x1a')](_0x9d722f);return _0xd343a[_0xea74('0x1f')]('Content-Range',_0x1cdaa9+'-'+_0x203d72+'/'+_0x451782)[_0xea74('0x20')](_0x3a77a9);}return null;};}function patchUpdates(_0x4e6e73){return function(_0x3504f7){try{jsonpatch['apply'](_0x3504f7,_0x4e6e73,!![]);}catch(_0x4325bf){return BPromise[_0xea74('0x21')](_0x4325bf);}return _0x3504f7['save']();};}function saveUpdates(_0x921d0f,_0x29ecdf){return function(_0x367241){if(_0x367241){return _0x367241[_0xea74('0x22')](_0x921d0f)[_0xea74('0x23')](function(_0x5676ba){return _0x5676ba;});}return null;};}function removeEntity(_0x1d9da8,_0x21d00c){return function(_0x53cfc8){if(_0x53cfc8){return _0x53cfc8[_0xea74('0x24')]()[_0xea74('0x23')](function(){_0x1d9da8[_0xea74('0x1a')](0xcc)[_0xea74('0x25')]();});}};}function handleEntityNotFound(_0x241972,_0x3de4a2){return function(_0x272f61){if(!_0x272f61){_0x241972['sendStatus'](0x194);}return _0x272f61;};}function handleError(_0x4b43c7,_0x4bfba0){_0x4bfba0=_0x4bfba0||0x1f4;return function(_0x1acb7f){logger[_0xea74('0x26')](_0x1acb7f['stack']);if(_0x1acb7f[_0xea74('0x27')]){delete _0x1acb7f['name'];}_0x4b43c7[_0xea74('0x1a')](_0x4bfba0)[_0xea74('0x28')](_0x1acb7f);};}exports['update']=function(_0x580666,_0x1e990c){if(_0x580666[_0xea74('0x29')]['id']){delete _0x580666['body']['id'];}return db[_0xea74('0x2a')][_0xea74('0x2b')]({'where':{'id':_0x580666['params']['id']}})['then'](handleEntityNotFound(_0x1e990c,null))[_0xea74('0x23')](saveUpdates(_0x580666[_0xea74('0x29')],null))[_0xea74('0x23')](respondWithResult(_0x1e990c,null))[_0xea74('0x2c')](handleError(_0x1e990c,null));};exports[_0xea74('0x24')]=function(_0xfc50ce,_0x478808){return db[_0xea74('0x2a')][_0xea74('0x2b')]({'where':{'id':_0xfc50ce[_0xea74('0x2d')]['id']}})['then'](handleEntityNotFound(_0x478808,null))[_0xea74('0x23')](removeEntity(_0x478808,null))['catch'](handleError(_0x478808,null));};
\ No newline at end of file
+var _0xe410=['catch','find','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','error','stack','name','update','body','Action','then'];(function(_0xf30651,_0x964c8){var _0x5382a0=function(_0x29d618){while(--_0x29d618){_0xf30651['push'](_0xf30651['shift']());}};_0x5382a0(++_0x964c8);}(_0xe410,0x11d));var _0x0e41=function(_0x493503,_0x351993){_0x493503=_0x493503-0x0;var _0x1986d0=_0xe410[_0x493503];return _0x1986d0;};'use strict';var emlformat=require(_0x0e41('0x0'));var rimraf=require(_0x0e41('0x1'));var zipdir=require(_0x0e41('0x2'));var jsonpatch=require(_0x0e41('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0e41('0x4'));var Mustache=require(_0x0e41('0x5'));var util=require(_0x0e41('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0e41('0x7'));var ejs=require(_0x0e41('0x8'));var fs=require('fs');var fs_extra=require(_0x0e41('0x9'));var _=require(_0x0e41('0xa'));var squel=require('squel');var crypto=require(_0x0e41('0xb'));var jsforce=require(_0x0e41('0xc'));var deskjs=require(_0x0e41('0xd'));var toCsv=require(_0x0e41('0x7'));var querystring=require(_0x0e41('0xe'));var Papa=require('papaparse');var Redis=require(_0x0e41('0xf'));var authService=require(_0x0e41('0x10'));var qs=require(_0x0e41('0x11'));var as=require(_0x0e41('0x12'));var hardwareService=require(_0x0e41('0x13'));var logger=require(_0x0e41('0x14'))(_0x0e41('0x15'));var utils=require(_0x0e41('0x16'));var config=require(_0x0e41('0x17'));var licenseUtil=require(_0x0e41('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25c89a,_0x92abec){_0x92abec=_0x92abec||0xcc;return function(_0x1e28e4){if(_0x1e28e4){return _0x25c89a[_0x0e41('0x19')](_0x92abec);}return _0x25c89a[_0x0e41('0x1a')](_0x92abec)['end']();};}function respondWithResult(_0x411ab7,_0x1f4f3c){_0x1f4f3c=_0x1f4f3c||0xc8;return function(_0x2be29d){if(_0x2be29d){return _0x411ab7[_0x0e41('0x1a')](_0x1f4f3c)[_0x0e41('0x1b')](_0x2be29d);}};}function respondWithFilteredResult(_0x5a8b69,_0x1798b5){return function(_0x1aa9a8){if(_0x1aa9a8){var _0x5b7b64=typeof _0x1798b5[_0x0e41('0x1c')]==='undefined'&&typeof _0x1798b5[_0x0e41('0x1d')]===_0x0e41('0x1e');var _0xb3aae7=_0x1aa9a8[_0x0e41('0x1f')];var _0x4ed26c=_0x5b7b64?0x0:_0x1798b5[_0x0e41('0x1c')];var _0x3dac61=_0x5b7b64?_0x1aa9a8[_0x0e41('0x1f')]:_0x1798b5['offset']+_0x1798b5[_0x0e41('0x1d')];var _0x57880a;if(_0x3dac61>=_0xb3aae7){_0x3dac61=_0xb3aae7;_0x57880a=0xc8;}else{_0x57880a=0xce;}_0x5a8b69['status'](_0x57880a);return _0x5a8b69[_0x0e41('0x20')](_0x0e41('0x21'),_0x4ed26c+'-'+_0x3dac61+'/'+_0xb3aae7)[_0x0e41('0x1b')](_0x1aa9a8);}return null;};}function patchUpdates(_0x1d94f7){return function(_0x4741fa){try{jsonpatch['apply'](_0x4741fa,_0x1d94f7,!![]);}catch(_0xbac3fe){return BPromise[_0x0e41('0x22')](_0xbac3fe);}return _0x4741fa[_0x0e41('0x23')]();};}function saveUpdates(_0x2844c9,_0x2b0763){return function(_0x2a8c38){if(_0x2a8c38){return _0x2a8c38['update'](_0x2844c9)['then'](function(_0x1ea422){return _0x1ea422;});}return null;};}function removeEntity(_0x15e590,_0x463051){return function(_0x462140){if(_0x462140){return _0x462140[_0x0e41('0x24')]()['then'](function(){_0x15e590[_0x0e41('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a000,_0x5686a6){return function(_0x6fc044){if(!_0x6fc044){_0x51a000[_0x0e41('0x19')](0x194);}return _0x6fc044;};}function handleError(_0x18820f,_0x1222b6){_0x1222b6=_0x1222b6||0x1f4;return function(_0x3a1e9d){logger[_0x0e41('0x25')](_0x3a1e9d[_0x0e41('0x26')]);if(_0x3a1e9d[_0x0e41('0x27')]){delete _0x3a1e9d[_0x0e41('0x27')];}_0x18820f[_0x0e41('0x1a')](_0x1222b6)['send'](_0x3a1e9d);};}exports[_0x0e41('0x28')]=function(_0x54c279,_0x2a2601){if(_0x54c279[_0x0e41('0x29')]['id']){delete _0x54c279[_0x0e41('0x29')]['id'];}return db[_0x0e41('0x2a')]['find']({'where':{'id':_0x54c279['params']['id']}})[_0x0e41('0x2b')](handleEntityNotFound(_0x2a2601,null))[_0x0e41('0x2b')](saveUpdates(_0x54c279[_0x0e41('0x29')],null))[_0x0e41('0x2b')](respondWithResult(_0x2a2601,null))[_0x0e41('0x2c')](handleError(_0x2a2601,null));};exports['destroy']=function(_0x938c82,_0x5e2d29){return db[_0x0e41('0x2a')][_0x0e41('0x2d')]({'where':{'id':_0x938c82[_0x0e41('0x2e')]['id']}})[_0x0e41('0x2b')](handleEntityNotFound(_0x5e2d29,null))[_0x0e41('0x2b')](removeEntity(_0x5e2d29,null))[_0x0e41('0x2c')](handleError(_0x5e2d29,null));};
\ No newline at end of file
index f54eb6d..761213d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4387=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','Action'];(function(_0x35f6b4,_0x505966){var _0x10f072=function(_0x20e563){while(--_0x20e563){_0x35f6b4['push'](_0x35f6b4['shift']());}};_0x10f072(++_0x505966);}(_0x4387,0x1b1));var _0x7438=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4387[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7438('0x0'));var util=require(_0x7438('0x1'));var logger=require(_0x7438('0x2'))(_0x7438('0x3'));var moment=require(_0x7438('0x4'));var BPromise=require(_0x7438('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7438('0x6'));var rimraf=require(_0x7438('0x7'));var config=require(_0x7438('0x8'));var attributes=require('./action.attributes');module[_0x7438('0x9')]=function(_0xa64ff7,_0x5900c6){return _0xa64ff7['define'](_0x7438('0xa'),attributes,{'tableName':_0x7438('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9850=['Action','lodash','util','api','moment','rimraf','exports','define'];(function(_0x16504f,_0x312648){var _0x2e0b31=function(_0x1d2af8){while(--_0x1d2af8){_0x16504f['push'](_0x16504f['shift']());}};_0x2e0b31(++_0x312648);}(_0x9850,0x1c9));var _0x0985=function(_0x3059c9,_0x21a980){_0x3059c9=_0x3059c9-0x0;var _0x1bc200=_0x9850[_0x3059c9];return _0x1bc200;};'use strict';var _=require(_0x0985('0x0'));var util=require(_0x0985('0x1'));var logger=require('../../config/logger')(_0x0985('0x2'));var moment=require(_0x0985('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0985('0x4'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x0985('0x5')]=function(_0x585316,_0x48ef67){return _0x585316[_0x0985('0x6')](_0x0985('0x7'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f753198..df48850 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x1d1d60,_0x156366){var _0x224e18=function(_0x615fdb){while(--_0x615fdb){_0x1d1d60['push'](_0x1d1d60['shift']());}};_0x224e18(++_0x156366);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1b903c,_0x3e369c){_0x1b903c=_0x1b903c-0x0;var _0x41b5ed=_0x7fbe[_0x1b903c];return _0x41b5ed;};'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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x23e15c,_0x26fd9b){var _0x24caf1=function(_0x5515cb){while(--_0x5515cb){_0x23e15c['push'](_0x23e15c['shift']());}};_0x24caf1(++_0x26fd9b);}(_0x326f,0xd1));var _0xf326=function(_0x71cd6f,_0x361d6c){_0x71cd6f=_0x71cd6f-0x0;var _0x32cf99=_0x326f[_0x71cd6f];return _0x32cf99;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
index 451fa1c..9647b7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbef1=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','exports','multer','util'];(function(_0x225dd1,_0x28258c){var _0x45ff06=function(_0x443c6d){while(--_0x443c6d){_0x225dd1['push'](_0x225dd1['shift']());}};_0x45ff06(++_0x28258c);}(_0xbef1,0x1a2));var _0x1bef=function(_0x53217c,_0x1755e7){_0x53217c=_0x53217c-0x0;var _0x56e1be=_0xbef1[_0x53217c];return _0x56e1be;};'use strict';var multer=require(_0x1bef('0x0'));var util=require(_0x1bef('0x1'));var path=require(_0x1bef('0x2'));var timeout=require('connect-timeout');var express=require(_0x1bef('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1bef('0x4'));var interaction=require(_0x1bef('0x5'));var config=require(_0x1bef('0x6'));var controller=require(_0x1bef('0x7'));router[_0x1bef('0x8')](_0x1bef('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1bef('0x9'),auth[_0x1bef('0xa')](),controller['destroy']);module[_0x1bef('0xb')]=router;
\ No newline at end of file
+var _0x067c=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','update','delete','isAuthenticated','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x067c,0x11c));var _0xc067=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x067c[_0x16db8b];return _0x5ba017;};'use strict';var multer=require(_0xc067('0x0'));var util=require(_0xc067('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc067('0x2'));var router=express[_0xc067('0x3')]();var fs_extra=require(_0xc067('0x4'));var auth=require(_0xc067('0x5'));var interaction=require(_0xc067('0x6'));var config=require(_0xc067('0x7'));var controller=require('./action.controller');router[_0xc067('0x8')](_0xc067('0x9'),auth['isAuthenticated'](),controller[_0xc067('0xa')]);router[_0xc067('0xb')](_0xc067('0x9'),auth[_0xc067('0xc')](),controller[_0xc067('0xd')]);module[_0xc067('0xe')]=router;
\ No newline at end of file
index d35c4ba..84a1b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x59ed9e,_0x8661dc){var _0x1fda1a=function(_0xdff03b){while(--_0xdff03b){_0x59ed9e['push'](_0x59ed9e['shift']());}};_0x1fda1a(++_0x8661dc);}(_0xeda8,0x104));var _0x8eda=function(_0xaf115f,_0x22e7a5){_0xaf115f=_0xaf115f-0x0;var _0xdfdbab=_0xeda8[_0xaf115f];return _0xdfdbab;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
+var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x39f91a,_0xd030f3){var _0x491d7b=function(_0xa76386){while(--_0xa76386){_0x39f91a['push'](_0x39f91a['shift']());}};_0x491d7b(++_0xd030f3);}(_0x814b,0x1a2));var _0xb814=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x814b[_0x5a636f];return _0x6a8cfb;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
index 8d1c7ae..e63e16c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cba=['apply','save','update','then','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','destroy','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','orderBy','field','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','debug','toString','sequelize','QueryTypes','SELECT','AVG(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','getFields','keyBy','groupBy','clone','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','output','../../files/reports','COUNT(*)','run','Please\x20insert\x20at\x20least\x20one\x20field','Limited\x20Query:','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range'];(function(_0x5f1979,_0x19567c){var _0xca1c19=function(_0x1e2760){while(--_0x1e2760){_0x5f1979['push'](_0x5f1979['shift']());}};_0xca1c19(++_0x19567c);}(_0x4cba,0x119));var _0xa4cb=function(_0x1dca22,_0x3a101c){_0x1dca22=_0x1dca22-0x0;var _0x3c851f=_0x4cba[_0x1dca22];return _0x3c851f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4cb('0x0'));var zipdir=require(_0xa4cb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4cb('0x2'));var moment=require(_0xa4cb('0x3'));var BPromise=require(_0xa4cb('0x4'));var Mustache=require(_0xa4cb('0x5'));var util=require(_0xa4cb('0x6'));var path=require(_0xa4cb('0x7'));var sox=require('sox');var csv=require(_0xa4cb('0x8'));var ejs=require(_0xa4cb('0x9'));var fs=require('fs');var fs_extra=require(_0xa4cb('0xa'));var _=require(_0xa4cb('0xb'));var squel=require(_0xa4cb('0xc'));var crypto=require(_0xa4cb('0xd'));var jsforce=require(_0xa4cb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa4cb('0x8'));var querystring=require(_0xa4cb('0xf'));var Papa=require(_0xa4cb('0x10'));var Redis=require('ioredis');var authService=require(_0xa4cb('0x11'));var qs=require(_0xa4cb('0x12'));var as=require(_0xa4cb('0x13'));var hardwareService=require(_0xa4cb('0x14'));var logger=require(_0xa4cb('0x15'))(_0xa4cb('0x16'));var utils=require(_0xa4cb('0x17'));var config=require(_0xa4cb('0x18'));var licenseUtil=require(_0xa4cb('0x19'));var db=require(_0xa4cb('0x1a'))['db'];var dbH=require(_0xa4cb('0x1a'))['dbH'];function respondWithStatusCode(_0x2b33bb,_0x426652){_0x426652=_0x426652||0xcc;return function(_0x26f641){if(_0x26f641){return _0x2b33bb[_0xa4cb('0x1b')](_0x426652);}return _0x2b33bb[_0xa4cb('0x1c')](_0x426652)[_0xa4cb('0x1d')]();};}function respondWithResult(_0x4a742a,_0x255de9){_0x255de9=_0x255de9||0xc8;return function(_0x15559e){if(_0x15559e){return _0x4a742a[_0xa4cb('0x1c')](_0x255de9)['json'](_0x15559e);}};}function respondWithFilteredResult(_0x4d74af,_0x52e0b1){return function(_0x2d2b3f){if(_0x2d2b3f){var _0x262b0c=typeof _0x52e0b1[_0xa4cb('0x1e')]===_0xa4cb('0x1f')&&typeof _0x52e0b1['limit']===_0xa4cb('0x1f');var _0x4cf202=_0x2d2b3f['count'];var _0x559065=_0x262b0c?0x0:_0x52e0b1['offset'];var _0x2614d6=_0x262b0c?_0x2d2b3f['count']:_0x52e0b1[_0xa4cb('0x1e')]+_0x52e0b1[_0xa4cb('0x20')];var _0x1a3787;if(_0x2614d6>=_0x4cf202){_0x2614d6=_0x4cf202;_0x1a3787=0xc8;}else{_0x1a3787=0xce;}_0x4d74af[_0xa4cb('0x1c')](_0x1a3787);return _0x4d74af[_0xa4cb('0x21')](_0xa4cb('0x22'),_0x559065+'-'+_0x2614d6+'/'+_0x4cf202)['json'](_0x2d2b3f);}return null;};}function patchUpdates(_0xce690a){return function(_0x526114){try{jsonpatch[_0xa4cb('0x23')](_0x526114,_0xce690a,!![]);}catch(_0x27bd27){return BPromise['reject'](_0x27bd27);}return _0x526114[_0xa4cb('0x24')]();};}function saveUpdates(_0x555bc1,_0x8f2bb){return function(_0x5da05b){if(_0x5da05b){return _0x5da05b[_0xa4cb('0x25')](_0x555bc1)[_0xa4cb('0x26')](function(_0x28bc2d){return _0x28bc2d;});}return null;};}function removeEntity(_0x55a542,_0x2c6262){return function(_0x1b3061){if(_0x1b3061){return _0x1b3061['destroy']()['then'](function(){var _0x55b612=_0x1b3061['get']({'plain':!![]});var _0x477c9d=_0xa4cb('0x27');return db[_0xa4cb('0x28')]['destroy']({'where':{'type':_0x477c9d,'resourceId':_0x55b612['id']}})[_0xa4cb('0x26')](function(){return _0x1b3061;});})[_0xa4cb('0x26')](function(){_0x55a542[_0xa4cb('0x1c')](0xcc)[_0xa4cb('0x1d')]();});}};}function handleEntityNotFound(_0x893a0c,_0x97c68a){return function(_0x4a1a45){if(!_0x4a1a45){_0x893a0c[_0xa4cb('0x1b')](0x194);}return _0x4a1a45;};}function handleError(_0x4ff432,_0x25ee9c){_0x25ee9c=_0x25ee9c||0x1f4;return function(_0x44d9c8){logger[_0xa4cb('0x29')](_0x44d9c8[_0xa4cb('0x2a')]);if(_0x44d9c8[_0xa4cb('0x2b')]){delete _0x44d9c8[_0xa4cb('0x2b')];}_0x4ff432[_0xa4cb('0x1c')](_0x25ee9c)[_0xa4cb('0x2c')](_0x44d9c8);};}exports[_0xa4cb('0x2d')]=function(_0x2d9126,_0x4f5308){var _0x4a1801={},_0x15bd95={},_0x355daa={'count':0x0,'rows':[]};var _0xb5f534=_['map'](db[_0xa4cb('0x2e')][_0xa4cb('0x2f')],function(_0x58e0f){return{'name':_0x58e0f['fieldName'],'type':_0x58e0f[_0xa4cb('0x30')][_0xa4cb('0x31')]};});_0x15bd95['model']=_[_0xa4cb('0x32')](_0xb5f534,_0xa4cb('0x2b'));_0x15bd95[_0xa4cb('0x33')]=_['keys'](_0x2d9126['query']);_0x15bd95[_0xa4cb('0x34')]=_[_0xa4cb('0x35')](_0x15bd95['model'],_0x15bd95['query']);_0x4a1801['attributes']=_[_0xa4cb('0x35')](_0x15bd95[_0xa4cb('0x36')],qs[_0xa4cb('0x37')](_0x2d9126[_0xa4cb('0x33')][_0xa4cb('0x37')]));_0x4a1801['attributes']=_0x4a1801['attributes'][_0xa4cb('0x38')]?_0x4a1801[_0xa4cb('0x39')]:_0x15bd95[_0xa4cb('0x36')];if(!_0x2d9126['query'][_0xa4cb('0x3a')](_0xa4cb('0x3b'))){_0x4a1801['limit']=qs[_0xa4cb('0x20')](_0x2d9126[_0xa4cb('0x33')][_0xa4cb('0x20')]);_0x4a1801['offset']=qs['offset'](_0x2d9126[_0xa4cb('0x33')][_0xa4cb('0x1e')]);}_0x4a1801[_0xa4cb('0x3c')]=qs[_0xa4cb('0x3d')](_0x2d9126[_0xa4cb('0x33')][_0xa4cb('0x3d')]);_0x4a1801[_0xa4cb('0x3e')]=qs[_0xa4cb('0x34')](_[_0xa4cb('0x3f')](_0x2d9126[_0xa4cb('0x33')],_0x15bd95[_0xa4cb('0x34')]),_0xb5f534);if(_0x2d9126[_0xa4cb('0x33')][_0xa4cb('0x40')]){_0x4a1801[_0xa4cb('0x3e')]=_[_0xa4cb('0x41')](_0x4a1801[_0xa4cb('0x3e')],{'$or':_['map'](_0xb5f534,function(_0x1b0374){if(_0x1b0374[_0xa4cb('0x30')]!=='VIRTUAL'){var _0x424588={};_0x424588[_0x1b0374[_0xa4cb('0x2b')]]={'$like':'%'+_0x2d9126[_0xa4cb('0x33')][_0xa4cb('0x40')]+'%'};return _0x424588;}})});}_0x4a1801=_['merge']({},_0x4a1801,_0x2d9126[_0xa4cb('0x42')]);var _0x1cf3f7={'where':_0x4a1801[_0xa4cb('0x3e')]};return db[_0xa4cb('0x2e')][_0xa4cb('0x43')](_0x1cf3f7)[_0xa4cb('0x26')](function(_0x522829){_0x355daa[_0xa4cb('0x43')]=_0x522829;if(_0x2d9126['query'][_0xa4cb('0x44')]){_0x4a1801['include']=[{'all':!![]}];}return db[_0xa4cb('0x2e')][_0xa4cb('0x45')](_0x4a1801);})[_0xa4cb('0x26')](function(_0x42a024){_0x355daa['rows']=_0x42a024;return _0x355daa;})[_0xa4cb('0x26')](respondWithFilteredResult(_0x4f5308,_0x4a1801))[_0xa4cb('0x46')](handleError(_0x4f5308,null));};exports[_0xa4cb('0x47')]=function(_0x5b971b,_0x16fa13){var _0x14160d={'raw':![],'where':{'id':_0x5b971b[_0xa4cb('0x48')]['id']}},_0x4a7a07={};_0x4a7a07[_0xa4cb('0x36')]=_['keys'](db[_0xa4cb('0x2e')][_0xa4cb('0x2f')]);_0x4a7a07[_0xa4cb('0x33')]=_['keys'](_0x5b971b['query']);_0x4a7a07[_0xa4cb('0x34')]=_[_0xa4cb('0x35')](_0x4a7a07[_0xa4cb('0x36')],_0x4a7a07[_0xa4cb('0x33')]);_0x14160d['attributes']=_[_0xa4cb('0x35')](_0x4a7a07[_0xa4cb('0x36')],qs['fields'](_0x5b971b[_0xa4cb('0x33')][_0xa4cb('0x37')]));_0x14160d[_0xa4cb('0x39')]=_0x14160d['attributes'][_0xa4cb('0x38')]?_0x14160d['attributes']:_0x4a7a07[_0xa4cb('0x36')];if(_0x5b971b[_0xa4cb('0x33')]['includeAll']){_0x14160d['include']=[{'all':!![]}];}_0x14160d=_[_0xa4cb('0x41')]({},_0x14160d,_0x5b971b[_0xa4cb('0x42')]);return db['AnalyticCustomReport'][_0xa4cb('0x49')](_0x14160d)['then'](handleEntityNotFound(_0x16fa13,null))[_0xa4cb('0x26')](respondWithResult(_0x16fa13,null))[_0xa4cb('0x46')](handleError(_0x16fa13,null));};exports['create']=function(_0x3256d3,_0x4cb2a3){return db[_0xa4cb('0x2e')][_0xa4cb('0x4a')](_0x3256d3[_0xa4cb('0x4b')],{})['then'](function(_0x118573){var _0x41e4b4=_0x3256d3[_0xa4cb('0x4c')][_0xa4cb('0x4d')]({'plain':!![]});if(!_0x41e4b4)throw new Error(_0xa4cb('0x4e'));if(_0x41e4b4[_0xa4cb('0x4f')]===_0xa4cb('0x4c')){var _0x1ba311=_0x118573[_0xa4cb('0x4d')]({'plain':!![]});var _0x36e433='Reports';return db[_0xa4cb('0x50')][_0xa4cb('0x49')]({'where':{'name':_0x36e433,'userProfileId':_0x41e4b4['userProfileId']},'raw':!![]})['then'](function(_0x5fe870){if(_0x5fe870&&_0x5fe870[_0xa4cb('0x51')]===0x0){return db['UserProfileResource'][_0xa4cb('0x4a')]({'name':_0x1ba311[_0xa4cb('0x2b')],'resourceId':_0x1ba311['id'],'type':_0xa4cb('0x27'),'sectionId':_0x5fe870['id']},{})['then'](function(){return _0x118573;});}else{return _0x118573;}})[_0xa4cb('0x46')](function(_0x346d7f){logger[_0xa4cb('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x346d7f);throw _0x346d7f;});}return _0x118573;})[_0xa4cb('0x26')](respondWithResult(_0x4cb2a3,0xc9))['catch'](handleError(_0x4cb2a3,null));};exports[_0xa4cb('0x25')]=function(_0x529f2d,_0x41b67d){if(_0x529f2d[_0xa4cb('0x4b')]['id']){delete _0x529f2d[_0xa4cb('0x4b')]['id'];}return db[_0xa4cb('0x2e')][_0xa4cb('0x49')]({'where':{'id':_0x529f2d['params']['id']}})['then'](handleEntityNotFound(_0x41b67d,null))[_0xa4cb('0x26')](saveUpdates(_0x529f2d[_0xa4cb('0x4b')],null))['then'](respondWithResult(_0x41b67d,null))[_0xa4cb('0x46')](handleError(_0x41b67d,null));};exports[_0xa4cb('0x52')]=function(_0x184c6d,_0x399db3){return db['AnalyticCustomReport'][_0xa4cb('0x49')]({'where':{'id':_0x184c6d[_0xa4cb('0x48')]['id']}})[_0xa4cb('0x26')](handleEntityNotFound(_0x399db3,null))['then'](removeEntity(_0x399db3,null))[_0xa4cb('0x46')](handleError(_0x399db3,null));};exports['preview']=function(_0x3e11e9,_0x55f166){var _0x23c2ac=0xa;var _0x695b94=[_0xa4cb('0x53'),_0xa4cb('0x54'),_0xa4cb('0x55'),_0xa4cb('0x56')];var _0x2ab513={'SUM':_0xa4cb('0x57'),'COUNT':_0xa4cb('0x58'),'COUNT DISTINCT':_0xa4cb('0x59'),'MAX':_0xa4cb('0x5a'),'MIN':_0xa4cb('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa4cb('0x5c'),'GROUP_CONCAT ASC':_0xa4cb('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1ab23e={'SEC_TO_TIME':_0xa4cb('0x5e'),'DATE':_0xa4cb('0x5f'),'HOUR':_0xa4cb('0x60'),'ROUND':_0xa4cb('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3a945c=function(_0x2dad9a){return!_[_0xa4cb('0x62')]([_0xa4cb('0x63'),_0xa4cb('0x64'),_0xa4cb('0x65'),'IS\x20NOT\x20EMPTY'],_0x2dad9a);};var _0x4d3e7c=function(_0x4260dd){if(!_0x4260dd||!_0x4260dd[_0xa4cb('0x66')][_0xa4cb('0x38')]){return'';}for(var _0x33a90f='(',_0x5d6f1f=0x0;_0x5d6f1f<_0x4260dd[_0xa4cb('0x66')][_0xa4cb('0x38')];_0x5d6f1f+=0x1){_0x5d6f1f>0x0&&(_0x33a90f+='\x20'+_0x4260dd[_0xa4cb('0x67')]+'\x20');_0x33a90f+=_0x4260dd[_0xa4cb('0x66')][_0x5d6f1f]['group']?_0x4d3e7c(_0x4260dd[_0xa4cb('0x66')][_0x5d6f1f][_0xa4cb('0x68')]):_0x4260dd['rules'][_0x5d6f1f]['field']+'\x20'+_0x4260dd['rules'][_0x5d6f1f][_0xa4cb('0x69')]+(_0x3a945c(_0x4260dd[_0xa4cb('0x66')][_0x5d6f1f][_0xa4cb('0x69')])?'\x20'+_0x4260dd['rules'][_0x5d6f1f][_0xa4cb('0x6a')]:'');}return _0x33a90f+')';};var _0x38981f={'where':{'id':_0x3e11e9[_0xa4cb('0x48')]['id']}},_0x1035ee,_0x1a5a85,_0x22dc3c,_0x5826ee,_0x347ece;_0x38981f=_[_0xa4cb('0x41')]({},_0x38981f,_0x3e11e9[_0xa4cb('0x42')]);return db[_0xa4cb('0x2e')][_0xa4cb('0x49')](_0x38981f)['then'](function(_0xf7dd60){if(_0xf7dd60){_0x1035ee=_0xf7dd60;return _0xf7dd60['getFields']();}return null;})[_0xa4cb('0x26')](function(_0x308264){if(_0x308264){if(!_0x308264['length']){throw new db[(_0xa4cb('0x6b'))][(_0xa4cb('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1a5a85=_0x308264;return db[_0xa4cb('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xa4cb('0x26')](function(_0x467774){if(_0x467774){_0x22dc3c=_['keyBy'](_0x467774,'id');var _0x36d308;var _0x3a08bc=squel[_0xa4cb('0x6e')]();_0x3a08bc[_0xa4cb('0x6f')](_0x1035ee[_0xa4cb('0x70')]);for(var _0x5b9dae=0x0;_0x5b9dae<_0x1a5a85['length'];_0x5b9dae+=0x1){_0x36d308=_0x1a5a85[_0x5b9dae][_0xa4cb('0x71')]?_0x22dc3c[_0x1a5a85[_0x5b9dae]['MetricId']][_0xa4cb('0x72')]:_0x1a5a85[_0x5b9dae]['field'];_0x36d308=_0x1a5a85[_0x5b9dae][_0xa4cb('0x73')]?_[_0xa4cb('0x74')](_0x2ab513[_0x1a5a85[_0x5b9dae][_0xa4cb('0x73')]],'%s',_0x36d308):_0x36d308;_0x36d308=_0x1a5a85[_0x5b9dae][_0xa4cb('0x75')]?_[_0xa4cb('0x74')](_0x1ab23e[_0x1a5a85[_0x5b9dae]['format']],'%s',_0x36d308):_0x36d308;if(_0x1a5a85[_0x5b9dae]['groupBy']){_0x3a08bc['group'](_0x36d308);}_0x1a5a85[_0x5b9dae]['orderBy']&&_0x3a08bc[_0xa4cb('0x3c')](_0x36d308,_0x1a5a85[_0x5b9dae][_0xa4cb('0x76')]==='DESC'?![]:!![]);_0x3a08bc[_0xa4cb('0x77')](_0x36d308,_0x1a5a85[_0x5b9dae]['alias']||_0x36d308);}if(_0x1035ee[_0xa4cb('0x78')]){_0x1035ee[_0xa4cb('0x78')]=JSON['parse'](_0x1035ee[_0xa4cb('0x78')]);for(var _0x2be551=0x0;_0x2be551<_0x1035ee[_0xa4cb('0x78')][_0xa4cb('0x38')];_0x2be551+=0x1){if(_0x1035ee[_0xa4cb('0x78')][_0x2be551]['type']&&_[_0xa4cb('0x62')](_0x695b94,_0x1035ee[_0xa4cb('0x78')][_0x2be551][_0xa4cb('0x30')])&&_0x1035ee[_0xa4cb('0x78')][_0x2be551][_0xa4cb('0x79')]&&_0x1035ee[_0xa4cb('0x78')][_0x2be551]['foreignTable']&&_0x1035ee[_0xa4cb('0x78')][_0x2be551]['foreignKey']){_0x3a08bc[_0x1035ee[_0xa4cb('0x78')][_0x2be551][_0xa4cb('0x30')]](_0x1035ee[_0xa4cb('0x78')][_0x2be551][_0xa4cb('0x7a')],null,util[_0xa4cb('0x75')](_0xa4cb('0x7b'),_0x1035ee[_0xa4cb('0x70')],_0x1035ee[_0xa4cb('0x78')][_0x2be551][_0xa4cb('0x79')],_0x1035ee[_0xa4cb('0x78')][_0x2be551][_0xa4cb('0x7a')],_0x1035ee[_0xa4cb('0x78')][_0x2be551][_0xa4cb('0x7c')]));}}}if(_0x1035ee['conditions']){_0x1035ee[_0xa4cb('0x7d')]=JSON[_0xa4cb('0x7e')](_0x1035ee[_0xa4cb('0x7d')]);_0x3a08bc[_0xa4cb('0x3e')](_0x4d3e7c(_0x1035ee[_0xa4cb('0x7d')][_0xa4cb('0x68')]));}_0x347ece=_0x3a08bc['clone']();_0x3a08bc[_0xa4cb('0x20')](_0x23c2ac);_0x3a08bc[_0xa4cb('0x1e')](0x0);logger[_0xa4cb('0x7f')]('Limited\x20Query:',_0x3a08bc[_0xa4cb('0x80')]());return dbH[_0xa4cb('0x81')][_0xa4cb('0x33')](_0x3a08bc['toString'](),{'type':dbH[_0xa4cb('0x81')][_0xa4cb('0x82')][_0xa4cb('0x83')]});}})[_0xa4cb('0x26')](respondWithResult(_0x55f166,null))[_0xa4cb('0x46')](handleError(_0x55f166,null));};function runReport(_0x2c6ffc,_0x4d7f08,_0x253f7a){var _0x228be0=_0x4d7f08['name'];var _0x428d2c=0xa;var _0x28b4f4=['join','left_join',_0xa4cb('0x55'),_0xa4cb('0x56')];var _0x14725c={'SUM':_0xa4cb('0x57'),'COUNT':_0xa4cb('0x58'),'COUNT DISTINCT':_0xa4cb('0x59'),'MAX':'MAX(%s)','MIN':_0xa4cb('0x5b'),'AVG':_0xa4cb('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa4cb('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2b1c73={'SEC_TO_TIME':_0xa4cb('0x5e'),'DATE':_0xa4cb('0x5f'),'HOUR':_0xa4cb('0x60'),'ROUND':_0xa4cb('0x61'),'UNIX_TIMESTAMP':_0xa4cb('0x85')};var _0x32204c=function(_0x13d5eb){return!_[_0xa4cb('0x62')]([_0xa4cb('0x63'),_0xa4cb('0x64'),'IS\x20EMPTY',_0xa4cb('0x86')],_0x13d5eb);};var _0x3ba1b0=function(_0x97a5a5){if(!_0x97a5a5||!_0x97a5a5[_0xa4cb('0x66')]['length']){return'';}for(var _0x2ab870='(',_0x51d954=0x0;_0x51d954<_0x97a5a5[_0xa4cb('0x66')][_0xa4cb('0x38')];_0x51d954+=0x1){_0x51d954>0x0&&(_0x2ab870+='\x20'+_0x97a5a5[_0xa4cb('0x67')]+'\x20');_0x2ab870+=_0x97a5a5[_0xa4cb('0x66')][_0x51d954][_0xa4cb('0x68')]?_0x3ba1b0(_0x97a5a5[_0xa4cb('0x66')][_0x51d954][_0xa4cb('0x68')]):_0x97a5a5[_0xa4cb('0x66')][_0x51d954][_0xa4cb('0x77')]+'\x20'+_0x97a5a5['rules'][_0x51d954][_0xa4cb('0x69')]+(_0x32204c(_0x97a5a5[_0xa4cb('0x66')][_0x51d954]['condition'])?'\x20'+_0x97a5a5[_0xa4cb('0x66')][_0x51d954][_0xa4cb('0x6a')]:'');}return _0x2ab870+')';};var _0x6c250={'where':{'id':_0x2c6ffc['id']}},_0x4ab16e,_0x5687f2,_0x5c2fe0,_0x2fb844,_0x2af652;_0x6c250=_['merge']({},_0x6c250,_0x253f7a);return db[_0xa4cb('0x2e')][_0xa4cb('0x49')](_0x6c250)[_0xa4cb('0x26')](function(_0x3f938b){if(_0x3f938b){_0x4ab16e=_0x3f938b;return _0x3f938b[_0xa4cb('0x87')]();}return null;})['then'](function(_0x3b854d){if(_0x3b854d){if(!_0x3b854d[_0xa4cb('0x38')]){throw new db[(_0xa4cb('0x6b'))][(_0xa4cb('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5687f2=_0x3b854d;return db['AnalyticMetric'][_0xa4cb('0x45')]({'raw':!![]});}return null;})[_0xa4cb('0x26')](function(_0x2d7205){if(_0x2d7205){_0x5c2fe0=_[_0xa4cb('0x88')](_0x2d7205,'id');var _0x4b8538;var _0x59ea19=squel['select']();_0x59ea19[_0xa4cb('0x6f')](_0x4ab16e[_0xa4cb('0x70')]);for(var _0x5a2c9d=0x0;_0x5a2c9d<_0x5687f2[_0xa4cb('0x38')];_0x5a2c9d+=0x1){_0x4b8538=_0x5687f2[_0x5a2c9d][_0xa4cb('0x71')]?_0x5c2fe0[_0x5687f2[_0x5a2c9d][_0xa4cb('0x71')]][_0xa4cb('0x72')]:_0x5687f2[_0x5a2c9d]['field'];_0x4b8538=_0x5687f2[_0x5a2c9d][_0xa4cb('0x73')]?_[_0xa4cb('0x74')](_0x14725c[_0x5687f2[_0x5a2c9d][_0xa4cb('0x73')]],'%s',_0x4b8538):_0x4b8538;_0x4b8538=_0x5687f2[_0x5a2c9d][_0xa4cb('0x75')]?_[_0xa4cb('0x74')](_0x2b1c73[_0x5687f2[_0x5a2c9d][_0xa4cb('0x75')]],'%s',_0x4b8538):_0x4b8538;if(_0x5687f2[_0x5a2c9d][_0xa4cb('0x89')]){_0x59ea19[_0xa4cb('0x68')](_0x4b8538);}_0x5687f2[_0x5a2c9d][_0xa4cb('0x76')]&&_0x59ea19[_0xa4cb('0x3c')](_0x4b8538,_0x5687f2[_0x5a2c9d]['orderBy']==='DESC'?![]:!![]);_0x59ea19['field'](_0x4b8538,_0x5687f2[_0x5a2c9d]['alias']||_0x4b8538);}if(_0x4ab16e[_0xa4cb('0x78')]){_0x4ab16e[_0xa4cb('0x78')]=JSON[_0xa4cb('0x7e')](_0x4ab16e['joins']);for(var _0x48edd6=0x0;_0x48edd6<_0x4ab16e['joins'][_0xa4cb('0x38')];_0x48edd6+=0x1){if(_0x4ab16e[_0xa4cb('0x78')][_0x48edd6][_0xa4cb('0x30')]&&_[_0xa4cb('0x62')](_0x28b4f4,_0x4ab16e[_0xa4cb('0x78')][_0x48edd6][_0xa4cb('0x30')])&&_0x4ab16e[_0xa4cb('0x78')][_0x48edd6][_0xa4cb('0x79')]&&_0x4ab16e['joins'][_0x48edd6][_0xa4cb('0x7a')]&&_0x4ab16e['joins'][_0x48edd6][_0xa4cb('0x7c')]){_0x59ea19[_0x4ab16e[_0xa4cb('0x78')][_0x48edd6][_0xa4cb('0x30')]](_0x4ab16e[_0xa4cb('0x78')][_0x48edd6][_0xa4cb('0x7a')],null,util[_0xa4cb('0x75')](_0xa4cb('0x7b'),_0x4ab16e[_0xa4cb('0x70')],_0x4ab16e['joins'][_0x48edd6][_0xa4cb('0x79')],_0x4ab16e[_0xa4cb('0x78')][_0x48edd6]['foreignTable'],_0x4ab16e[_0xa4cb('0x78')][_0x48edd6][_0xa4cb('0x7c')]));}}}if(_0x4ab16e[_0xa4cb('0x7d')]){_0x4ab16e['conditions']=JSON[_0xa4cb('0x7e')](_0x4ab16e[_0xa4cb('0x7d')]);_0x59ea19[_0xa4cb('0x3e')](_0x3ba1b0(_0x4ab16e['conditions'][_0xa4cb('0x68')]));}_0x2af652=_0x59ea19[_0xa4cb('0x8a')]();_0x59ea19['limit'](_0x428d2c);_0x59ea19[_0xa4cb('0x1e')](0x0);return;}})[_0xa4cb('0x26')](function(){if(_0x4d7f08['output']==='web'){return null;}var _0x55c3ed=_['merge'](_0x4d7f08,{'name':_0x4d7f08[_0xa4cb('0x8b')]||_0x4d7f08[_0xa4cb('0x2b')]||_0x4ab16e[_0xa4cb('0x2b')],'basename':_0x228be0,'savename':util['format'](_0xa4cb('0x8c'),_0x4d7f08['name']||_0x4ab16e[_0xa4cb('0x2b')],require('randomstring')['generate'](0x4),_0x4d7f08['output']||_0xa4cb('0x8d')),'reportId':_0x4ab16e['id'],'reportType':_0xa4cb('0x8e')});return db[_0xa4cb('0x8f')][_0xa4cb('0x4a')](_0x55c3ed,{'raw':!![]});})[_0xa4cb('0x26')](function(_0x1c2fd3){if(_0x4ab16e[_0xa4cb('0x70')]===_0xa4cb('0x90')){_0x2af652[_0xa4cb('0x3e')](_0x4ab16e[_0xa4cb('0x70')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4d7f08[_0xa4cb('0x91')],_0x4d7f08['endDate']);}else{_0x2af652[_0xa4cb('0x3e')](_0x4ab16e[_0xa4cb('0x70')]+_0xa4cb('0x92'),_0x4d7f08[_0xa4cb('0x91')],_0x4d7f08[_0xa4cb('0x93')]);}if(_0x1c2fd3){logger['info'](_0xa4cb('0x94'),_0x2af652['toString']());require(_0xa4cb('0x95'))[_0xa4cb('0x96')](path[_0xa4cb('0x53')](__dirname,_0xa4cb('0x97'),_0x1c2fd3[_0xa4cb('0x98')]),[_0x1c2fd3['id'],_0x2af652[_0xa4cb('0x80')](),path[_0xa4cb('0x53')](__dirname,_0xa4cb('0x99'),_0x1c2fd3['savename']),_0x228be0]);return _0x1c2fd3;}else{var _0x31fa37=squel[_0xa4cb('0x6e')]();_0x31fa37[_0xa4cb('0x6f')]('('+_0x2af652['toString']()+')','countTable');_0x31fa37[_0xa4cb('0x77')](_0xa4cb('0x9a'),'count');_0x2af652[_0xa4cb('0x20')](_0x4d7f08['limit']||_0x428d2c);_0x2af652[_0xa4cb('0x1e')](_0x4d7f08[_0xa4cb('0x1e')]||0x0);return dbH[_0xa4cb('0x81')][_0xa4cb('0x33')](_0x31fa37[_0xa4cb('0x80')](),{'type':dbH[_0xa4cb('0x81')][_0xa4cb('0x82')][_0xa4cb('0x83')]})[_0xa4cb('0x26')](function(_0x13612e){if(!_0x13612e[_0xa4cb('0x38')]){_0x2fb844=0x0;}else{_0x2fb844=_0x13612e[0x0][_0xa4cb('0x43')]||0x0;}return dbH[_0xa4cb('0x81')]['query'](_0x2af652[_0xa4cb('0x80')](),{'type':dbH[_0xa4cb('0x81')][_0xa4cb('0x82')][_0xa4cb('0x83')]});})[_0xa4cb('0x26')](function(_0x22b115){return{'rows':_0x22b115||[],'count':_0x2fb844};});}});}exports[_0xa4cb('0x9b')]=function(_0x19ef57,_0x1897c4){return runReport(_0x19ef57[_0xa4cb('0x48')],_0x19ef57[_0xa4cb('0x33')],_0x19ef57[_0xa4cb('0x42')])[_0xa4cb('0x26')](respondWithResult(_0x1897c4,null))[_0xa4cb('0x46')](handleError(_0x1897c4,null));};exports['runReport']=runReport;exports[_0xa4cb('0x33')]=function(_0x324b5d,_0x28d2e0){var _0x4d3b2a=0xa;var _0x44d02f=['join',_0xa4cb('0x54'),'right_join',_0xa4cb('0x56')];var _0x38cfe5={'SUM':_0xa4cb('0x57'),'COUNT':_0xa4cb('0x58'),'COUNT DISTINCT':_0xa4cb('0x59'),'MAX':'MAX(%s)','MIN':_0xa4cb('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa4cb('0x5c'),'GROUP_CONCAT ASC':_0xa4cb('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1c9bd6={'SEC_TO_TIME':_0xa4cb('0x5e'),'DATE':_0xa4cb('0x5f'),'HOUR':_0xa4cb('0x60'),'ROUND':_0xa4cb('0x61'),'UNIX_TIMESTAMP':_0xa4cb('0x85')};var _0x3e3478=function(_0x1fa622){return!_[_0xa4cb('0x62')]([_0xa4cb('0x63'),_0xa4cb('0x64'),_0xa4cb('0x65'),'IS\x20NOT\x20EMPTY'],_0x1fa622);};var _0x4cc6b6=function(_0x3df70c){if(!_0x3df70c||!_0x3df70c[_0xa4cb('0x66')][_0xa4cb('0x38')]){return'';}for(var _0x433925='(',_0x30e1f0=0x0;_0x30e1f0<_0x3df70c['rules'][_0xa4cb('0x38')];_0x30e1f0+=0x1){_0x30e1f0>0x0&&(_0x433925+='\x20'+_0x3df70c[_0xa4cb('0x67')]+'\x20');_0x433925+=_0x3df70c[_0xa4cb('0x66')][_0x30e1f0][_0xa4cb('0x68')]?_0x4cc6b6(_0x3df70c[_0xa4cb('0x66')][_0x30e1f0][_0xa4cb('0x68')]):_0x3df70c['rules'][_0x30e1f0]['field']+'\x20'+_0x3df70c[_0xa4cb('0x66')][_0x30e1f0][_0xa4cb('0x69')]+(_0x3e3478(_0x3df70c[_0xa4cb('0x66')][_0x30e1f0]['condition'])?'\x20'+_0x3df70c[_0xa4cb('0x66')][_0x30e1f0][_0xa4cb('0x6a')]:'');}return _0x433925+')';};var _0x4614a0={'where':{'id':_0x324b5d[_0xa4cb('0x48')]['id']}},_0x3c31c6,_0x270360,_0x3a90d1,_0x59a15a,_0x5c7f11;_0x4614a0=_[_0xa4cb('0x41')]({},_0x4614a0,_0x324b5d[_0xa4cb('0x42')]);return db[_0xa4cb('0x2e')][_0xa4cb('0x49')](_0x4614a0)[_0xa4cb('0x26')](function(_0x3b21b3){if(_0x3b21b3){_0x3c31c6=_0x3b21b3;return _0x3b21b3[_0xa4cb('0x87')]();}return null;})[_0xa4cb('0x26')](function(_0x2f587f){if(_0x2f587f){if(!_0x2f587f[_0xa4cb('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0xa4cb('0x9c'),0x193);}_0x270360=_0x2f587f;return db[_0xa4cb('0x6d')][_0xa4cb('0x45')]({'raw':!![]});}return null;})['then'](function(_0x16a38b){if(_0x16a38b){_0x3a90d1=_['keyBy'](_0x16a38b,'id');var _0x3117ff;var _0x360814=squel['select']();_0x360814[_0xa4cb('0x6f')](_0x3c31c6[_0xa4cb('0x70')]);for(var _0x18d42d=0x0;_0x18d42d<_0x270360[_0xa4cb('0x38')];_0x18d42d+=0x1){_0x3117ff=_0x270360[_0x18d42d][_0xa4cb('0x71')]?_0x3a90d1[_0x270360[_0x18d42d]['MetricId']]['metric']:_0x270360[_0x18d42d]['field'];_0x3117ff=_0x270360[_0x18d42d]['function']?_[_0xa4cb('0x74')](_0x38cfe5[_0x270360[_0x18d42d][_0xa4cb('0x73')]],'%s',_0x3117ff):_0x3117ff;_0x3117ff=_0x270360[_0x18d42d][_0xa4cb('0x75')]?_[_0xa4cb('0x74')](_0x1c9bd6[_0x270360[_0x18d42d][_0xa4cb('0x75')]],'%s',_0x3117ff):_0x3117ff;if(_0x270360[_0x18d42d][_0xa4cb('0x89')]){_0x360814[_0xa4cb('0x68')](_0x3117ff);}_0x270360[_0x18d42d]['orderBy']&&_0x360814[_0xa4cb('0x3c')](_0x3117ff,_0x270360[_0x18d42d][_0xa4cb('0x76')]==='DESC'?![]:!![]);_0x360814['field'](_0x3117ff,_0x270360[_0x18d42d]['alias']||_0x3117ff);}if(_0x3c31c6[_0xa4cb('0x78')]){_0x3c31c6[_0xa4cb('0x78')]=JSON[_0xa4cb('0x7e')](_0x3c31c6[_0xa4cb('0x78')]);for(var _0x10c2fc=0x0;_0x10c2fc<_0x3c31c6[_0xa4cb('0x78')][_0xa4cb('0x38')];_0x10c2fc+=0x1){if(_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc][_0xa4cb('0x30')]&&_[_0xa4cb('0x62')](_0x44d02f,_0x3c31c6['joins'][_0x10c2fc][_0xa4cb('0x30')])&&_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc][_0xa4cb('0x79')]&&_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc][_0xa4cb('0x7a')]&&_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc][_0xa4cb('0x7c')]){_0x360814[_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc]['type']](_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc]['foreignTable'],null,util[_0xa4cb('0x75')](_0xa4cb('0x7b'),_0x3c31c6[_0xa4cb('0x70')],_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc][_0xa4cb('0x79')],_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc]['foreignTable'],_0x3c31c6[_0xa4cb('0x78')][_0x10c2fc][_0xa4cb('0x7c')]));}}}if(_0x3c31c6[_0xa4cb('0x7d')]){_0x3c31c6[_0xa4cb('0x7d')]=JSON[_0xa4cb('0x7e')](_0x3c31c6[_0xa4cb('0x7d')]);_0x360814['where'](_0x4cc6b6(_0x3c31c6[_0xa4cb('0x7d')]['group']));}_0x5c7f11=_0x360814[_0xa4cb('0x8a')]();_0x360814['limit'](_0x4d3b2a);_0x360814['offset'](0x0);logger['debug'](_0xa4cb('0x9d'),_0x360814[_0xa4cb('0x80')]());return dbH[_0xa4cb('0x81')]['query'](_0x360814['toString'](),{'type':dbH[_0xa4cb('0x81')][_0xa4cb('0x82')][_0xa4cb('0x83')]});}})[_0xa4cb('0x26')](function(){return{'sql':_0x5c7f11['toString']()};})[_0xa4cb('0x26')](respondWithResult(_0x28d2e0,null))[_0xa4cb('0x46')](handleError(_0x28d2e0,null));};
\ No newline at end of file
+var _0x1d8c=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','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)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','table','MetricId','function','replace','format','groupBy','orderBy','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','debug','toString','sequelize','QueryTypes','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','select','metric','DESC','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','SELECT','run','runReport','alias','Limited\x20Query:','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','stack','name','send','index','AnalyticCustomReport','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','find'];(function(_0x208cf2,_0x2b24da){var _0x15e6a9=function(_0xeabe4f){while(--_0xeabe4f){_0x208cf2['push'](_0x208cf2['shift']());}};_0x15e6a9(++_0x2b24da);}(_0x1d8c,0x1ae));var _0xc1d8=function(_0x2d2ff3,_0x2480ad){_0x2d2ff3=_0x2d2ff3-0x0;var _0x317393=_0x1d8c[_0x2d2ff3];return _0x317393;};'use strict';var emlformat=require(_0xc1d8('0x0'));var rimraf=require(_0xc1d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1d8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc1d8('0x3'));var util=require(_0xc1d8('0x4'));var path=require(_0xc1d8('0x5'));var sox=require(_0xc1d8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1d8('0x7'));var _=require(_0xc1d8('0x8'));var squel=require('squel');var crypto=require(_0xc1d8('0x9'));var jsforce=require(_0xc1d8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc1d8('0xb'));var querystring=require(_0xc1d8('0xc'));var Papa=require(_0xc1d8('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc1d8('0xe'));var as=require(_0xc1d8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1d8('0x10'))(_0xc1d8('0x11'));var utils=require(_0xc1d8('0x12'));var config=require(_0xc1d8('0x13'));var licenseUtil=require(_0xc1d8('0x14'));var db=require(_0xc1d8('0x15'))['db'];var dbH=require(_0xc1d8('0x15'))[_0xc1d8('0x16')];function respondWithStatusCode(_0x2bdcc1,_0xc60ee5){_0xc60ee5=_0xc60ee5||0xcc;return function(_0xb4fef7){if(_0xb4fef7){return _0x2bdcc1[_0xc1d8('0x17')](_0xc60ee5);}return _0x2bdcc1[_0xc1d8('0x18')](_0xc60ee5)[_0xc1d8('0x19')]();};}function respondWithResult(_0x4a7e9b,_0xd229cd){_0xd229cd=_0xd229cd||0xc8;return function(_0xb92597){if(_0xb92597){return _0x4a7e9b[_0xc1d8('0x18')](_0xd229cd)['json'](_0xb92597);}};}function respondWithFilteredResult(_0x6d2932,_0x29294a){return function(_0x23a141){if(_0x23a141){var _0x1322b3=typeof _0x29294a[_0xc1d8('0x1a')]==='undefined'&&typeof _0x29294a['limit']===_0xc1d8('0x1b');var _0x301274=_0x23a141[_0xc1d8('0x1c')];var _0x20825c=_0x1322b3?0x0:_0x29294a['offset'];var _0x5da2bb=_0x1322b3?_0x23a141[_0xc1d8('0x1c')]:_0x29294a['offset']+_0x29294a[_0xc1d8('0x1d')];var _0x1624f4;if(_0x5da2bb>=_0x301274){_0x5da2bb=_0x301274;_0x1624f4=0xc8;}else{_0x1624f4=0xce;}_0x6d2932[_0xc1d8('0x18')](_0x1624f4);return _0x6d2932[_0xc1d8('0x1e')](_0xc1d8('0x1f'),_0x20825c+'-'+_0x5da2bb+'/'+_0x301274)[_0xc1d8('0x20')](_0x23a141);}return null;};}function patchUpdates(_0x401e05){return function(_0x33b885){try{jsonpatch[_0xc1d8('0x21')](_0x33b885,_0x401e05,!![]);}catch(_0x17659e){return BPromise['reject'](_0x17659e);}return _0x33b885[_0xc1d8('0x22')]();};}function saveUpdates(_0x4d8a37,_0x15813a){return function(_0x4521b2){if(_0x4521b2){return _0x4521b2[_0xc1d8('0x23')](_0x4d8a37)[_0xc1d8('0x24')](function(_0x499816){return _0x499816;});}return null;};}function removeEntity(_0x49f1f8,_0x45eb31){return function(_0x57c005){if(_0x57c005){return _0x57c005[_0xc1d8('0x25')]()[_0xc1d8('0x24')](function(){var _0x4eaf70=_0x57c005[_0xc1d8('0x26')]({'plain':!![]});var _0x4b82fc='CustomReports';return db['UserProfileResource'][_0xc1d8('0x25')]({'where':{'type':_0x4b82fc,'resourceId':_0x4eaf70['id']}})[_0xc1d8('0x24')](function(){return _0x57c005;});})[_0xc1d8('0x24')](function(){_0x49f1f8['status'](0xcc)[_0xc1d8('0x19')]();});}};}function handleEntityNotFound(_0x52a07f,_0x5999d5){return function(_0x5de375){if(!_0x5de375){_0x52a07f[_0xc1d8('0x17')](0x194);}return _0x5de375;};}function handleError(_0x39f385,_0x251b7b){_0x251b7b=_0x251b7b||0x1f4;return function(_0x520cf7){logger['error'](_0x520cf7[_0xc1d8('0x27')]);if(_0x520cf7[_0xc1d8('0x28')]){delete _0x520cf7[_0xc1d8('0x28')];}_0x39f385['status'](_0x251b7b)[_0xc1d8('0x29')](_0x520cf7);};}exports[_0xc1d8('0x2a')]=function(_0x7095ba,_0x302b44){var _0x5378a9={},_0x25a320={},_0x505f79={'count':0x0,'rows':[]};var _0x5e99e2=_['map'](db[_0xc1d8('0x2b')][_0xc1d8('0x2c')],function(_0x3563c1){return{'name':_0x3563c1['fieldName'],'type':_0x3563c1[_0xc1d8('0x2d')][_0xc1d8('0x2e')]};});_0x25a320[_0xc1d8('0x2f')]=_[_0xc1d8('0x30')](_0x5e99e2,_0xc1d8('0x28'));_0x25a320[_0xc1d8('0x31')]=_['keys'](_0x7095ba[_0xc1d8('0x31')]);_0x25a320[_0xc1d8('0x32')]=_[_0xc1d8('0x33')](_0x25a320['model'],_0x25a320[_0xc1d8('0x31')]);_0x5378a9[_0xc1d8('0x34')]=_[_0xc1d8('0x33')](_0x25a320[_0xc1d8('0x2f')],qs[_0xc1d8('0x35')](_0x7095ba[_0xc1d8('0x31')][_0xc1d8('0x35')]));_0x5378a9[_0xc1d8('0x34')]=_0x5378a9['attributes'][_0xc1d8('0x36')]?_0x5378a9['attributes']:_0x25a320[_0xc1d8('0x2f')];if(!_0x7095ba[_0xc1d8('0x31')][_0xc1d8('0x37')]('nolimit')){_0x5378a9[_0xc1d8('0x1d')]=qs[_0xc1d8('0x1d')](_0x7095ba[_0xc1d8('0x31')][_0xc1d8('0x1d')]);_0x5378a9['offset']=qs[_0xc1d8('0x1a')](_0x7095ba[_0xc1d8('0x31')][_0xc1d8('0x1a')]);}_0x5378a9[_0xc1d8('0x38')]=qs[_0xc1d8('0x39')](_0x7095ba[_0xc1d8('0x31')][_0xc1d8('0x39')]);_0x5378a9[_0xc1d8('0x3a')]=qs[_0xc1d8('0x32')](_[_0xc1d8('0x3b')](_0x7095ba[_0xc1d8('0x31')],_0x25a320[_0xc1d8('0x32')]),_0x5e99e2);if(_0x7095ba[_0xc1d8('0x31')]['filter']){_0x5378a9[_0xc1d8('0x3a')]=_[_0xc1d8('0x3c')](_0x5378a9['where'],{'$or':_[_0xc1d8('0x30')](_0x5e99e2,function(_0x3ca599){if(_0x3ca599[_0xc1d8('0x2d')]!==_0xc1d8('0x3d')){var _0x5abb2f={};_0x5abb2f[_0x3ca599[_0xc1d8('0x28')]]={'$like':'%'+_0x7095ba[_0xc1d8('0x31')][_0xc1d8('0x3e')]+'%'};return _0x5abb2f;}})});}_0x5378a9=_['merge']({},_0x5378a9,_0x7095ba[_0xc1d8('0x3f')]);var _0x2e2bce={'where':_0x5378a9[_0xc1d8('0x3a')]};return db[_0xc1d8('0x2b')]['count'](_0x2e2bce)['then'](function(_0x4f6c8f){_0x505f79[_0xc1d8('0x1c')]=_0x4f6c8f;if(_0x7095ba[_0xc1d8('0x31')][_0xc1d8('0x40')]){_0x5378a9[_0xc1d8('0x41')]=[{'all':!![]}];}return db[_0xc1d8('0x2b')]['findAll'](_0x5378a9);})[_0xc1d8('0x24')](function(_0x46a00b){_0x505f79[_0xc1d8('0x42')]=_0x46a00b;return _0x505f79;})['then'](respondWithFilteredResult(_0x302b44,_0x5378a9))['catch'](handleError(_0x302b44,null));};exports[_0xc1d8('0x43')]=function(_0x4b3172,_0x34332f){var _0x5a2403={'raw':![],'where':{'id':_0x4b3172[_0xc1d8('0x44')]['id']}},_0x2fefcd={};_0x2fefcd[_0xc1d8('0x2f')]=_['keys'](db[_0xc1d8('0x2b')][_0xc1d8('0x2c')]);_0x2fefcd[_0xc1d8('0x31')]=_[_0xc1d8('0x45')](_0x4b3172[_0xc1d8('0x31')]);_0x2fefcd['filters']=_[_0xc1d8('0x33')](_0x2fefcd['model'],_0x2fefcd[_0xc1d8('0x31')]);_0x5a2403['attributes']=_[_0xc1d8('0x33')](_0x2fefcd[_0xc1d8('0x2f')],qs[_0xc1d8('0x35')](_0x4b3172[_0xc1d8('0x31')][_0xc1d8('0x35')]));_0x5a2403['attributes']=_0x5a2403['attributes'][_0xc1d8('0x36')]?_0x5a2403[_0xc1d8('0x34')]:_0x2fefcd['model'];if(_0x4b3172['query'][_0xc1d8('0x40')]){_0x5a2403[_0xc1d8('0x41')]=[{'all':!![]}];}_0x5a2403=_[_0xc1d8('0x3c')]({},_0x5a2403,_0x4b3172['options']);return db[_0xc1d8('0x2b')][_0xc1d8('0x46')](_0x5a2403)[_0xc1d8('0x24')](handleEntityNotFound(_0x34332f,null))['then'](respondWithResult(_0x34332f,null))['catch'](handleError(_0x34332f,null));};exports[_0xc1d8('0x47')]=function(_0x3416cc,_0x2a5cbb){return db['AnalyticCustomReport'][_0xc1d8('0x47')](_0x3416cc['body'],{})[_0xc1d8('0x24')](function(_0xd923fd){var _0x3da0a2=_0x3416cc[_0xc1d8('0x48')][_0xc1d8('0x26')]({'plain':!![]});if(!_0x3da0a2)throw new Error(_0xc1d8('0x49'));if(_0x3da0a2['role']===_0xc1d8('0x48')){var _0x110221=_0xd923fd[_0xc1d8('0x26')]({'plain':!![]});var _0x5c2adc=_0xc1d8('0x4a');return db[_0xc1d8('0x4b')]['find']({'where':{'name':_0x5c2adc,'userProfileId':_0x3da0a2[_0xc1d8('0x4c')]},'raw':!![]})[_0xc1d8('0x24')](function(_0x35a50c){if(_0x35a50c&&_0x35a50c[_0xc1d8('0x4d')]===0x0){return db['UserProfileResource'][_0xc1d8('0x47')]({'name':_0x110221['name'],'resourceId':_0x110221['id'],'type':_0xc1d8('0x4e'),'sectionId':_0x35a50c['id']},{})[_0xc1d8('0x24')](function(){return _0xd923fd;});}else{return _0xd923fd;}})[_0xc1d8('0x4f')](function(_0x117e56){logger[_0xc1d8('0x50')](_0xc1d8('0x51'),_0x117e56);throw _0x117e56;});}return _0xd923fd;})[_0xc1d8('0x24')](respondWithResult(_0x2a5cbb,0xc9))[_0xc1d8('0x4f')](handleError(_0x2a5cbb,null));};exports[_0xc1d8('0x23')]=function(_0x1fbf03,_0x28f87c){if(_0x1fbf03[_0xc1d8('0x52')]['id']){delete _0x1fbf03['body']['id'];}return db[_0xc1d8('0x2b')][_0xc1d8('0x46')]({'where':{'id':_0x1fbf03[_0xc1d8('0x44')]['id']}})['then'](handleEntityNotFound(_0x28f87c,null))[_0xc1d8('0x24')](saveUpdates(_0x1fbf03[_0xc1d8('0x52')],null))[_0xc1d8('0x24')](respondWithResult(_0x28f87c,null))[_0xc1d8('0x4f')](handleError(_0x28f87c,null));};exports['destroy']=function(_0x22d893,_0x4da444){return db[_0xc1d8('0x2b')][_0xc1d8('0x46')]({'where':{'id':_0x22d893['params']['id']}})[_0xc1d8('0x24')](handleEntityNotFound(_0x4da444,null))['then'](removeEntity(_0x4da444,null))[_0xc1d8('0x4f')](handleError(_0x4da444,null));};exports[_0xc1d8('0x53')]=function(_0x17ab01,_0x3a4a6f){var _0x97a535=0xa;var _0x5a3a03=[_0xc1d8('0x54'),_0xc1d8('0x55'),_0xc1d8('0x56'),_0xc1d8('0x57')];var _0x803ecd={'SUM':_0xc1d8('0x58'),'COUNT':_0xc1d8('0x59'),'COUNT DISTINCT':_0xc1d8('0x5a'),'MAX':_0xc1d8('0x5b'),'MIN':_0xc1d8('0x5c'),'AVG':_0xc1d8('0x5d'),'GROUP_CONCAT':_0xc1d8('0x5e'),'GROUP_CONCAT ASC':_0xc1d8('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6b49={'SEC_TO_TIME':_0xc1d8('0x60'),'DATE':_0xc1d8('0x61'),'HOUR':_0xc1d8('0x62'),'ROUND':_0xc1d8('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5c93a1=function(_0x3e344d){return!_[_0xc1d8('0x64')]([_0xc1d8('0x65'),_0xc1d8('0x66'),_0xc1d8('0x67'),_0xc1d8('0x68')],_0x3e344d);};var _0x209fcc=function(_0x4460ef){if(!_0x4460ef||!_0x4460ef[_0xc1d8('0x69')][_0xc1d8('0x36')]){return'';}for(var _0x586847='(',_0x16ae1b=0x0;_0x16ae1b<_0x4460ef['rules'][_0xc1d8('0x36')];_0x16ae1b+=0x1){_0x16ae1b>0x0&&(_0x586847+='\x20'+_0x4460ef[_0xc1d8('0x6a')]+'\x20');_0x586847+=_0x4460ef[_0xc1d8('0x69')][_0x16ae1b][_0xc1d8('0x6b')]?_0x209fcc(_0x4460ef[_0xc1d8('0x69')][_0x16ae1b][_0xc1d8('0x6b')]):_0x4460ef[_0xc1d8('0x69')][_0x16ae1b][_0xc1d8('0x6c')]+'\x20'+_0x4460ef[_0xc1d8('0x69')][_0x16ae1b][_0xc1d8('0x6d')]+(_0x5c93a1(_0x4460ef[_0xc1d8('0x69')][_0x16ae1b]['condition'])?'\x20'+_0x4460ef['rules'][_0x16ae1b][_0xc1d8('0x6e')]:'');}return _0x586847+')';};var _0x4650d2={'where':{'id':_0x17ab01['params']['id']}},_0x12390b,_0xa02377,_0x524fbc,_0x7da2ea,_0xe2bf5e;_0x4650d2=_[_0xc1d8('0x3c')]({},_0x4650d2,_0x17ab01['options']);return db[_0xc1d8('0x2b')][_0xc1d8('0x46')](_0x4650d2)['then'](function(_0xcb62e){if(_0xcb62e){_0x12390b=_0xcb62e;return _0xcb62e[_0xc1d8('0x6f')]();}return null;})[_0xc1d8('0x24')](function(_0x11218b){if(_0x11218b){if(!_0x11218b[_0xc1d8('0x36')]){throw new db[(_0xc1d8('0x70'))][(_0xc1d8('0x71'))](_0xc1d8('0x72'),0x193);}_0xa02377=_0x11218b;return db[_0xc1d8('0x73')][_0xc1d8('0x74')]({'raw':!![]});}return null;})[_0xc1d8('0x24')](function(_0x63976e){if(_0x63976e){_0x524fbc=_[_0xc1d8('0x75')](_0x63976e,'id');var _0x3f531c;var _0x1eac58=squel['select']();_0x1eac58[_0xc1d8('0x76')](_0x12390b[_0xc1d8('0x77')]);for(var _0x16b166=0x0;_0x16b166<_0xa02377[_0xc1d8('0x36')];_0x16b166+=0x1){_0x3f531c=_0xa02377[_0x16b166]['MetricId']?_0x524fbc[_0xa02377[_0x16b166][_0xc1d8('0x78')]]['metric']:_0xa02377[_0x16b166][_0xc1d8('0x6c')];_0x3f531c=_0xa02377[_0x16b166][_0xc1d8('0x79')]?_[_0xc1d8('0x7a')](_0x803ecd[_0xa02377[_0x16b166][_0xc1d8('0x79')]],'%s',_0x3f531c):_0x3f531c;_0x3f531c=_0xa02377[_0x16b166][_0xc1d8('0x7b')]?_[_0xc1d8('0x7a')](_0x5e6b49[_0xa02377[_0x16b166][_0xc1d8('0x7b')]],'%s',_0x3f531c):_0x3f531c;if(_0xa02377[_0x16b166][_0xc1d8('0x7c')]){_0x1eac58[_0xc1d8('0x6b')](_0x3f531c);}_0xa02377[_0x16b166][_0xc1d8('0x7d')]&&_0x1eac58['order'](_0x3f531c,_0xa02377[_0x16b166][_0xc1d8('0x7d')]==='DESC'?![]:!![]);_0x1eac58[_0xc1d8('0x6c')](_0x3f531c,_0xa02377[_0x16b166]['alias']||_0x3f531c);}if(_0x12390b[_0xc1d8('0x7e')]){_0x12390b[_0xc1d8('0x7e')]=JSON[_0xc1d8('0x7f')](_0x12390b['joins']);for(var _0x1ab8e6=0x0;_0x1ab8e6<_0x12390b[_0xc1d8('0x7e')][_0xc1d8('0x36')];_0x1ab8e6+=0x1){if(_0x12390b[_0xc1d8('0x7e')][_0x1ab8e6]['type']&&_['includes'](_0x5a3a03,_0x12390b[_0xc1d8('0x7e')][_0x1ab8e6]['type'])&&_0x12390b[_0xc1d8('0x7e')][_0x1ab8e6][_0xc1d8('0x80')]&&_0x12390b['joins'][_0x1ab8e6]['foreignTable']&&_0x12390b['joins'][_0x1ab8e6][_0xc1d8('0x81')]){_0x1eac58[_0x12390b[_0xc1d8('0x7e')][_0x1ab8e6]['type']](_0x12390b[_0xc1d8('0x7e')][_0x1ab8e6][_0xc1d8('0x82')],null,util[_0xc1d8('0x7b')]('%s.%s\x20=\x20%s.%s',_0x12390b[_0xc1d8('0x77')],_0x12390b[_0xc1d8('0x7e')][_0x1ab8e6][_0xc1d8('0x80')],_0x12390b[_0xc1d8('0x7e')][_0x1ab8e6][_0xc1d8('0x82')],_0x12390b['joins'][_0x1ab8e6][_0xc1d8('0x81')]));}}}if(_0x12390b[_0xc1d8('0x83')]){_0x12390b[_0xc1d8('0x83')]=JSON[_0xc1d8('0x7f')](_0x12390b[_0xc1d8('0x83')]);_0x1eac58[_0xc1d8('0x3a')](_0x209fcc(_0x12390b[_0xc1d8('0x83')][_0xc1d8('0x6b')]));}_0xe2bf5e=_0x1eac58[_0xc1d8('0x84')]();_0x1eac58[_0xc1d8('0x1d')](_0x97a535);_0x1eac58['offset'](0x0);logger[_0xc1d8('0x85')]('Limited\x20Query:',_0x1eac58[_0xc1d8('0x86')]());return dbH[_0xc1d8('0x87')][_0xc1d8('0x31')](_0x1eac58[_0xc1d8('0x86')](),{'type':dbH[_0xc1d8('0x87')][_0xc1d8('0x88')]['SELECT']});}})[_0xc1d8('0x24')](respondWithResult(_0x3a4a6f,null))[_0xc1d8('0x4f')](handleError(_0x3a4a6f,null));};function runReport(_0x334c98,_0x57c2d2,_0x4b7b52){var _0x481d84=_0x57c2d2[_0xc1d8('0x28')];var _0x6ed61f=0xa;var _0x386a18=[_0xc1d8('0x54'),'left_join',_0xc1d8('0x56'),_0xc1d8('0x57')];var _0x3b1ef1={'SUM':_0xc1d8('0x58'),'COUNT':_0xc1d8('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc1d8('0x5b'),'MIN':_0xc1d8('0x5c'),'AVG':_0xc1d8('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc1d8('0x89')};var _0x4b4885={'SEC_TO_TIME':_0xc1d8('0x60'),'DATE':_0xc1d8('0x61'),'HOUR':_0xc1d8('0x62'),'ROUND':_0xc1d8('0x63'),'UNIX_TIMESTAMP':_0xc1d8('0x8a')};var _0x476320=function(_0x222af0){return!_[_0xc1d8('0x64')]([_0xc1d8('0x65'),_0xc1d8('0x66'),_0xc1d8('0x67'),_0xc1d8('0x68')],_0x222af0);};var _0x3e81b6=function(_0x6b5d36){if(!_0x6b5d36||!_0x6b5d36[_0xc1d8('0x69')][_0xc1d8('0x36')]){return'';}for(var _0x56d9c5='(',_0x20de66=0x0;_0x20de66<_0x6b5d36[_0xc1d8('0x69')][_0xc1d8('0x36')];_0x20de66+=0x1){_0x20de66>0x0&&(_0x56d9c5+='\x20'+_0x6b5d36[_0xc1d8('0x6a')]+'\x20');_0x56d9c5+=_0x6b5d36[_0xc1d8('0x69')][_0x20de66][_0xc1d8('0x6b')]?_0x3e81b6(_0x6b5d36['rules'][_0x20de66][_0xc1d8('0x6b')]):_0x6b5d36[_0xc1d8('0x69')][_0x20de66][_0xc1d8('0x6c')]+'\x20'+_0x6b5d36[_0xc1d8('0x69')][_0x20de66][_0xc1d8('0x6d')]+(_0x476320(_0x6b5d36[_0xc1d8('0x69')][_0x20de66]['condition'])?'\x20'+_0x6b5d36[_0xc1d8('0x69')][_0x20de66][_0xc1d8('0x6e')]:'');}return _0x56d9c5+')';};var _0x4015b3={'where':{'id':_0x334c98['id']}},_0x5634c0,_0x205bf9,_0x22cc2a,_0x29e9f0,_0x1d0517;_0x4015b3=_['merge']({},_0x4015b3,_0x4b7b52);return db[_0xc1d8('0x2b')][_0xc1d8('0x46')](_0x4015b3)['then'](function(_0x3ae233){if(_0x3ae233){_0x5634c0=_0x3ae233;return _0x3ae233[_0xc1d8('0x6f')]();}return null;})[_0xc1d8('0x24')](function(_0xc5e767){if(_0xc5e767){if(!_0xc5e767[_0xc1d8('0x36')]){throw new db[(_0xc1d8('0x70'))]['ValidationErrorItem'](_0xc1d8('0x72'),0x193);}_0x205bf9=_0xc5e767;return db[_0xc1d8('0x73')][_0xc1d8('0x74')]({'raw':!![]});}return null;})['then'](function(_0x47c64b){if(_0x47c64b){_0x22cc2a=_[_0xc1d8('0x75')](_0x47c64b,'id');var _0x56994c;var _0x50cbf5=squel[_0xc1d8('0x8b')]();_0x50cbf5[_0xc1d8('0x76')](_0x5634c0['table']);for(var _0x569521=0x0;_0x569521<_0x205bf9[_0xc1d8('0x36')];_0x569521+=0x1){_0x56994c=_0x205bf9[_0x569521][_0xc1d8('0x78')]?_0x22cc2a[_0x205bf9[_0x569521]['MetricId']][_0xc1d8('0x8c')]:_0x205bf9[_0x569521][_0xc1d8('0x6c')];_0x56994c=_0x205bf9[_0x569521]['function']?_[_0xc1d8('0x7a')](_0x3b1ef1[_0x205bf9[_0x569521][_0xc1d8('0x79')]],'%s',_0x56994c):_0x56994c;_0x56994c=_0x205bf9[_0x569521][_0xc1d8('0x7b')]?_[_0xc1d8('0x7a')](_0x4b4885[_0x205bf9[_0x569521]['format']],'%s',_0x56994c):_0x56994c;if(_0x205bf9[_0x569521]['groupBy']){_0x50cbf5['group'](_0x56994c);}_0x205bf9[_0x569521][_0xc1d8('0x7d')]&&_0x50cbf5[_0xc1d8('0x38')](_0x56994c,_0x205bf9[_0x569521][_0xc1d8('0x7d')]===_0xc1d8('0x8d')?![]:!![]);_0x50cbf5['field'](_0x56994c,_0x205bf9[_0x569521]['alias']||_0x56994c);}if(_0x5634c0[_0xc1d8('0x7e')]){_0x5634c0[_0xc1d8('0x7e')]=JSON['parse'](_0x5634c0[_0xc1d8('0x7e')]);for(var _0x1c11da=0x0;_0x1c11da<_0x5634c0[_0xc1d8('0x7e')]['length'];_0x1c11da+=0x1){if(_0x5634c0['joins'][_0x1c11da][_0xc1d8('0x2d')]&&_['includes'](_0x386a18,_0x5634c0['joins'][_0x1c11da][_0xc1d8('0x2d')])&&_0x5634c0[_0xc1d8('0x7e')][_0x1c11da][_0xc1d8('0x80')]&&_0x5634c0[_0xc1d8('0x7e')][_0x1c11da][_0xc1d8('0x82')]&&_0x5634c0[_0xc1d8('0x7e')][_0x1c11da][_0xc1d8('0x81')]){_0x50cbf5[_0x5634c0[_0xc1d8('0x7e')][_0x1c11da][_0xc1d8('0x2d')]](_0x5634c0[_0xc1d8('0x7e')][_0x1c11da]['foreignTable'],null,util[_0xc1d8('0x7b')](_0xc1d8('0x8e'),_0x5634c0[_0xc1d8('0x77')],_0x5634c0[_0xc1d8('0x7e')][_0x1c11da]['parentKey'],_0x5634c0[_0xc1d8('0x7e')][_0x1c11da]['foreignTable'],_0x5634c0[_0xc1d8('0x7e')][_0x1c11da][_0xc1d8('0x81')]));}}}if(_0x5634c0[_0xc1d8('0x83')]){_0x5634c0['conditions']=JSON['parse'](_0x5634c0[_0xc1d8('0x83')]);_0x50cbf5[_0xc1d8('0x3a')](_0x3e81b6(_0x5634c0['conditions'][_0xc1d8('0x6b')]));}_0x1d0517=_0x50cbf5['clone']();_0x50cbf5[_0xc1d8('0x1d')](_0x6ed61f);_0x50cbf5['offset'](0x0);return;}})['then'](function(){if(_0x57c2d2[_0xc1d8('0x8f')]===_0xc1d8('0x90')){return null;}var _0x2964db=_[_0xc1d8('0x3c')](_0x57c2d2,{'name':_0x57c2d2['fullPath']||_0x57c2d2[_0xc1d8('0x28')]||_0x5634c0[_0xc1d8('0x28')],'basename':_0x481d84,'savename':util[_0xc1d8('0x7b')](_0xc1d8('0x91'),_0x57c2d2[_0xc1d8('0x28')]||_0x5634c0[_0xc1d8('0x28')],require(_0xc1d8('0x92'))[_0xc1d8('0x93')](0x4),_0x57c2d2[_0xc1d8('0x8f')]||_0xc1d8('0x94')),'reportId':_0x5634c0['id'],'reportType':_0xc1d8('0x95')});return db[_0xc1d8('0x96')]['create'](_0x2964db,{'raw':!![]});})[_0xc1d8('0x24')](function(_0x256738){if(_0x5634c0[_0xc1d8('0x77')]===_0xc1d8('0x97')){_0x1d0517[_0xc1d8('0x3a')](_0x5634c0[_0xc1d8('0x77')]+_0xc1d8('0x98'),_0x57c2d2[_0xc1d8('0x99')],_0x57c2d2[_0xc1d8('0x9a')]);}else{_0x1d0517[_0xc1d8('0x3a')](_0x5634c0[_0xc1d8('0x77')]+_0xc1d8('0x9b'),_0x57c2d2[_0xc1d8('0x99')],_0x57c2d2[_0xc1d8('0x9a')]);}if(_0x256738){logger['info'](_0xc1d8('0x9c'),_0x1d0517['toString']());require(_0xc1d8('0x9d'))[_0xc1d8('0x9e')](path[_0xc1d8('0x54')](__dirname,_0xc1d8('0x9f'),_0x256738[_0xc1d8('0x8f')]),[_0x256738['id'],_0x1d0517[_0xc1d8('0x86')](),path[_0xc1d8('0x54')](__dirname,_0xc1d8('0xa0'),_0x256738[_0xc1d8('0xa1')]),_0x481d84]);return _0x256738;}else{var _0x2eb1b6=squel['select']();_0x2eb1b6['from']('('+_0x1d0517[_0xc1d8('0x86')]()+')','countTable');_0x2eb1b6[_0xc1d8('0x6c')]('COUNT(*)','count');_0x1d0517[_0xc1d8('0x1d')](_0x57c2d2['limit']||_0x6ed61f);_0x1d0517['offset'](_0x57c2d2[_0xc1d8('0x1a')]||0x0);return dbH[_0xc1d8('0x87')][_0xc1d8('0x31')](_0x2eb1b6[_0xc1d8('0x86')](),{'type':dbH[_0xc1d8('0x87')][_0xc1d8('0x88')][_0xc1d8('0xa2')]})[_0xc1d8('0x24')](function(_0x5402eb){if(!_0x5402eb[_0xc1d8('0x36')]){_0x29e9f0=0x0;}else{_0x29e9f0=_0x5402eb[0x0][_0xc1d8('0x1c')]||0x0;}return dbH[_0xc1d8('0x87')][_0xc1d8('0x31')](_0x1d0517[_0xc1d8('0x86')](),{'type':dbH[_0xc1d8('0x87')]['QueryTypes'][_0xc1d8('0xa2')]});})[_0xc1d8('0x24')](function(_0x3ef13c){return{'rows':_0x3ef13c||[],'count':_0x29e9f0};});}});}exports[_0xc1d8('0xa3')]=function(_0x396352,_0x33b267){return runReport(_0x396352[_0xc1d8('0x44')],_0x396352[_0xc1d8('0x31')],_0x396352[_0xc1d8('0x3f')])['then'](respondWithResult(_0x33b267,null))['catch'](handleError(_0x33b267,null));};exports[_0xc1d8('0xa4')]=runReport;exports[_0xc1d8('0x31')]=function(_0x1d8d7e,_0x530635){var _0x1ed696=0xa;var _0x5441c9=[_0xc1d8('0x54'),'left_join','right_join',_0xc1d8('0x57')];var _0x55f186={'SUM':'SUM(%s)','COUNT':_0xc1d8('0x59'),'COUNT DISTINCT':_0xc1d8('0x5a'),'MAX':'MAX(%s)','MIN':_0xc1d8('0x5c'),'AVG':_0xc1d8('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc1d8('0x5f'),'GROUP_CONCAT DESC':_0xc1d8('0x89')};var _0x414735={'SEC_TO_TIME':_0xc1d8('0x60'),'DATE':_0xc1d8('0x61'),'HOUR':_0xc1d8('0x62'),'ROUND':_0xc1d8('0x63'),'UNIX_TIMESTAMP':_0xc1d8('0x8a')};var _0x31a2e7=function(_0x3732f0){return!_[_0xc1d8('0x64')]([_0xc1d8('0x65'),_0xc1d8('0x66'),'IS\x20EMPTY',_0xc1d8('0x68')],_0x3732f0);};var _0x307374=function(_0x142e8d){if(!_0x142e8d||!_0x142e8d[_0xc1d8('0x69')]['length']){return'';}for(var _0x38a682='(',_0x3d0b91=0x0;_0x3d0b91<_0x142e8d[_0xc1d8('0x69')][_0xc1d8('0x36')];_0x3d0b91+=0x1){_0x3d0b91>0x0&&(_0x38a682+='\x20'+_0x142e8d['operator']+'\x20');_0x38a682+=_0x142e8d['rules'][_0x3d0b91][_0xc1d8('0x6b')]?_0x307374(_0x142e8d[_0xc1d8('0x69')][_0x3d0b91][_0xc1d8('0x6b')]):_0x142e8d['rules'][_0x3d0b91][_0xc1d8('0x6c')]+'\x20'+_0x142e8d[_0xc1d8('0x69')][_0x3d0b91][_0xc1d8('0x6d')]+(_0x31a2e7(_0x142e8d['rules'][_0x3d0b91][_0xc1d8('0x6d')])?'\x20'+_0x142e8d[_0xc1d8('0x69')][_0x3d0b91][_0xc1d8('0x6e')]:'');}return _0x38a682+')';};var _0x386044={'where':{'id':_0x1d8d7e[_0xc1d8('0x44')]['id']}},_0x50ce16,_0x5b213d,_0x34e0d3,_0x257952,_0x4dc6da;_0x386044=_[_0xc1d8('0x3c')]({},_0x386044,_0x1d8d7e[_0xc1d8('0x3f')]);return db[_0xc1d8('0x2b')][_0xc1d8('0x46')](_0x386044)[_0xc1d8('0x24')](function(_0x3adca0){if(_0x3adca0){_0x50ce16=_0x3adca0;return _0x3adca0[_0xc1d8('0x6f')]();}return null;})[_0xc1d8('0x24')](function(_0x107c8c){if(_0x107c8c){if(!_0x107c8c[_0xc1d8('0x36')]){throw new db[(_0xc1d8('0x70'))]['ValidationErrorItem'](_0xc1d8('0x72'),0x193);}_0x5b213d=_0x107c8c;return db[_0xc1d8('0x73')][_0xc1d8('0x74')]({'raw':!![]});}return null;})['then'](function(_0x15011d){if(_0x15011d){_0x34e0d3=_[_0xc1d8('0x75')](_0x15011d,'id');var _0x270fe1;var _0x5ce1f8=squel[_0xc1d8('0x8b')]();_0x5ce1f8['from'](_0x50ce16['table']);for(var _0x3998ba=0x0;_0x3998ba<_0x5b213d[_0xc1d8('0x36')];_0x3998ba+=0x1){_0x270fe1=_0x5b213d[_0x3998ba]['MetricId']?_0x34e0d3[_0x5b213d[_0x3998ba][_0xc1d8('0x78')]]['metric']:_0x5b213d[_0x3998ba][_0xc1d8('0x6c')];_0x270fe1=_0x5b213d[_0x3998ba]['function']?_[_0xc1d8('0x7a')](_0x55f186[_0x5b213d[_0x3998ba]['function']],'%s',_0x270fe1):_0x270fe1;_0x270fe1=_0x5b213d[_0x3998ba][_0xc1d8('0x7b')]?_[_0xc1d8('0x7a')](_0x414735[_0x5b213d[_0x3998ba][_0xc1d8('0x7b')]],'%s',_0x270fe1):_0x270fe1;if(_0x5b213d[_0x3998ba][_0xc1d8('0x7c')]){_0x5ce1f8[_0xc1d8('0x6b')](_0x270fe1);}_0x5b213d[_0x3998ba][_0xc1d8('0x7d')]&&_0x5ce1f8['order'](_0x270fe1,_0x5b213d[_0x3998ba][_0xc1d8('0x7d')]===_0xc1d8('0x8d')?![]:!![]);_0x5ce1f8['field'](_0x270fe1,_0x5b213d[_0x3998ba][_0xc1d8('0xa5')]||_0x270fe1);}if(_0x50ce16[_0xc1d8('0x7e')]){_0x50ce16['joins']=JSON[_0xc1d8('0x7f')](_0x50ce16[_0xc1d8('0x7e')]);for(var _0x2145b1=0x0;_0x2145b1<_0x50ce16[_0xc1d8('0x7e')]['length'];_0x2145b1+=0x1){if(_0x50ce16[_0xc1d8('0x7e')][_0x2145b1]['type']&&_[_0xc1d8('0x64')](_0x5441c9,_0x50ce16['joins'][_0x2145b1][_0xc1d8('0x2d')])&&_0x50ce16[_0xc1d8('0x7e')][_0x2145b1][_0xc1d8('0x80')]&&_0x50ce16[_0xc1d8('0x7e')][_0x2145b1][_0xc1d8('0x82')]&&_0x50ce16[_0xc1d8('0x7e')][_0x2145b1][_0xc1d8('0x81')]){_0x5ce1f8[_0x50ce16[_0xc1d8('0x7e')][_0x2145b1][_0xc1d8('0x2d')]](_0x50ce16[_0xc1d8('0x7e')][_0x2145b1]['foreignTable'],null,util[_0xc1d8('0x7b')](_0xc1d8('0x8e'),_0x50ce16['table'],_0x50ce16['joins'][_0x2145b1][_0xc1d8('0x80')],_0x50ce16[_0xc1d8('0x7e')][_0x2145b1][_0xc1d8('0x82')],_0x50ce16[_0xc1d8('0x7e')][_0x2145b1][_0xc1d8('0x81')]));}}}if(_0x50ce16['conditions']){_0x50ce16[_0xc1d8('0x83')]=JSON[_0xc1d8('0x7f')](_0x50ce16['conditions']);_0x5ce1f8[_0xc1d8('0x3a')](_0x307374(_0x50ce16[_0xc1d8('0x83')][_0xc1d8('0x6b')]));}_0x4dc6da=_0x5ce1f8[_0xc1d8('0x84')]();_0x5ce1f8[_0xc1d8('0x1d')](_0x1ed696);_0x5ce1f8[_0xc1d8('0x1a')](0x0);logger[_0xc1d8('0x85')](_0xc1d8('0xa6'),_0x5ce1f8[_0xc1d8('0x86')]());return dbH['sequelize'][_0xc1d8('0x31')](_0x5ce1f8[_0xc1d8('0x86')](),{'type':dbH[_0xc1d8('0x87')][_0xc1d8('0x88')][_0xc1d8('0xa2')]});}})[_0xc1d8('0x24')](function(){return{'sql':_0x4dc6da[_0xc1d8('0x86')]()};})['then'](respondWithResult(_0x530635,null))['catch'](handleError(_0x530635,null));};
\ No newline at end of file
index 4bcb335..8b42cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf48a=['rimraf','./analyticCustomReport.attributes','exports','lodash','../../config/logger','moment','bluebird','path'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xf48a,0x1d3));var _0xaf48=function(_0x526fb1,_0x1d0359){_0x526fb1=_0x526fb1-0x0;var _0x33582f=_0xf48a[_0x526fb1];return _0x33582f;};'use strict';var _=require(_0xaf48('0x0'));var util=require('util');var logger=require(_0xaf48('0x1'))('api');var moment=require(_0xaf48('0x2'));var BPromise=require(_0xaf48('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf48('0x4'));var rimraf=require(_0xaf48('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf48('0x6'));module[_0xaf48('0x7')]=function(_0xaf7ac,_0xff6d08){return _0xaf7ac['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cb0=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x205329,_0x223a33){var _0x1594ab=function(_0x561afb){while(--_0x561afb){_0x205329['push'](_0x205329['shift']());}};_0x1594ab(++_0x223a33);}(_0x5cb0,0x17e));var _0x05cb=function(_0x50bc5e,_0x24b0d4){_0x50bc5e=_0x50bc5e-0x0;var _0x2d1344=_0x5cb0[_0x50bc5e];return _0x2d1344;};'use strict';var _=require(_0x05cb('0x0'));var util=require(_0x05cb('0x1'));var logger=require(_0x05cb('0x2'))(_0x05cb('0x3'));var moment=require(_0x05cb('0x4'));var BPromise=require(_0x05cb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05cb('0x6'));var rimraf=require(_0x05cb('0x7'));var config=require(_0x05cb('0x8'));var attributes=require(_0x05cb('0x9'));module[_0x05cb('0xa')]=function(_0x3e6185,_0x55ee01){return _0x3e6185[_0x05cb('0xb')](_0x05cb('0xc'),attributes,{'tableName':_0x05cb('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2c18e4b..11b239b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fb6=['rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3e3da5,_0x4de4eb){var _0x363860=function(_0x436645){while(--_0x436645){_0x3e3da5['push'](_0x3e3da5['shift']());}};_0x363860(++_0x4de4eb);}(_0x2fb6,0x1dd));var _0x62fb=function(_0x29b628,_0x5532d3){_0x29b628=_0x29b628-0x0;var _0x583f68=_0x2fb6[_0x29b628];return _0x583f68;};'use strict';var _=require(_0x62fb('0x0'));var util=require(_0x62fb('0x1'));var moment=require('moment');var BPromise=require(_0x62fb('0x2'));var rs=require(_0x62fb('0x3'));var fs=require('fs');var Redis=require(_0x62fb('0x4'));var db=require(_0x62fb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x62fb('0x6'));var config=require(_0x62fb('0x7'));var jayson=require(_0x62fb('0x8'));var client=jayson['client'][_0x62fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21fe00,_0x1df293,_0x465972){return new BPromise(function(_0x127e43,_0x197171){return client[_0x62fb('0xa')](_0x21fe00,_0x465972)[_0x62fb('0xb')](function(_0x546813){logger[_0x62fb('0xc')](_0x62fb('0xd'),_0x1df293,'request\x20sent');logger[_0x62fb('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1df293,'request\x20sent',JSON[_0x62fb('0xf')](_0x546813));if(_0x546813['error']){if(_0x546813[_0x62fb('0x10')]['code']===0x1f4){logger['error'](_0x62fb('0xd'),_0x1df293,_0x546813[_0x62fb('0x10')]['message']);return _0x197171(_0x546813[_0x62fb('0x10')]['message']);}logger[_0x62fb('0x10')](_0x62fb('0xd'),_0x1df293,_0x546813['error']['message']);return _0x127e43(_0x546813[_0x62fb('0x10')][_0x62fb('0x11')]);}else{logger[_0x62fb('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1df293,_0x62fb('0x12'));_0x127e43(_0x546813[_0x62fb('0x13')][_0x62fb('0x11')]);}})[_0x62fb('0x14')](function(_0x267b3f){logger[_0x62fb('0x10')](_0x62fb('0xd'),_0x1df293,_0x267b3f);_0x197171(_0x267b3f);});});}
\ No newline at end of file
+var _0xad23=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5e3a99,_0x2ff72c){var _0xdbd829=function(_0x28d647){while(--_0x28d647){_0x5e3a99['push'](_0x5e3a99['shift']());}};_0xdbd829(++_0x2ff72c);}(_0xad23,0x115));var _0x3ad2=function(_0x45b171,_0x164ddc){_0x45b171=_0x45b171-0x0;var _0xbf02f2=_0xad23[_0x45b171];return _0xbf02f2;};'use strict';var _=require(_0x3ad2('0x0'));var util=require(_0x3ad2('0x1'));var moment=require(_0x3ad2('0x2'));var BPromise=require(_0x3ad2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ad2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ad2('0x5'));var logger=require(_0x3ad2('0x6'))(_0x3ad2('0x7'));var config=require(_0x3ad2('0x8'));var jayson=require(_0x3ad2('0x9'));var client=jayson[_0x3ad2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49fe79,_0x1e3915,_0x2d0fef){return new BPromise(function(_0x1335dc,_0x30c973){return client[_0x3ad2('0xb')](_0x49fe79,_0x2d0fef)[_0x3ad2('0xc')](function(_0x23d9fc){logger['info'](_0x3ad2('0xd'),_0x1e3915,_0x3ad2('0xe'));logger[_0x3ad2('0xf')](_0x3ad2('0x10'),_0x1e3915,_0x3ad2('0xe'),JSON[_0x3ad2('0x11')](_0x23d9fc));if(_0x23d9fc['error']){if(_0x23d9fc[_0x3ad2('0x12')][_0x3ad2('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1e3915,_0x23d9fc[_0x3ad2('0x12')][_0x3ad2('0x14')]);return _0x30c973(_0x23d9fc[_0x3ad2('0x12')]['message']);}logger[_0x3ad2('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1e3915,_0x23d9fc['error'][_0x3ad2('0x14')]);return _0x1335dc(_0x23d9fc[_0x3ad2('0x12')]['message']);}else{logger['info'](_0x3ad2('0xd'),_0x1e3915,'request\x20sent');_0x1335dc(_0x23d9fc[_0x3ad2('0x15')][_0x3ad2('0x14')]);}})[_0x3ad2('0x16')](function(_0x1d4ea4){logger[_0x3ad2('0x12')](_0x3ad2('0xd'),_0x1e3915,_0x1d4ea4);_0x30c973(_0x1d4ea4);});});}
\ No newline at end of file
index a9242fb..b44eec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b1d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','destroy','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1b1d,0x1d4));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd1b1('0x0'));var util=require(_0xd1b1('0x1'));var path=require(_0xd1b1('0x2'));var timeout=require(_0xd1b1('0x3'));var express=require(_0xd1b1('0x4'));var router=express[_0xd1b1('0x5')]();var fs_extra=require(_0xd1b1('0x6'));var auth=require(_0xd1b1('0x7'));var interaction=require(_0xd1b1('0x8'));var config=require(_0xd1b1('0x9'));var controller=require(_0xd1b1('0xa'));router[_0xd1b1('0xb')]('/',auth['isAuthenticated'](),controller[_0xd1b1('0xc')]);router[_0xd1b1('0xb')]('/:id',auth[_0xd1b1('0xd')](),controller[_0xd1b1('0xe')]);router[_0xd1b1('0xb')](_0xd1b1('0xf'),auth[_0xd1b1('0xd')](),controller[_0xd1b1('0x10')]);router['get'](_0xd1b1('0x11'),auth[_0xd1b1('0xd')](),controller[_0xd1b1('0x12')]);router['get'](_0xd1b1('0x13'),auth[_0xd1b1('0xd')](),controller[_0xd1b1('0x14')]);router[_0xd1b1('0x15')]('/',auth['isAuthenticated'](),controller[_0xd1b1('0x16')]);router[_0xd1b1('0x17')]('/:id',auth[_0xd1b1('0xd')](),controller['update']);router['delete']('/:id',auth[_0xd1b1('0xd')](),controller[_0xd1b1('0x18')]);module[_0xd1b1('0x19')]=router;
\ No newline at end of file
+var _0xf156=['connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','/:id/run','run','query','post','create','put','update','delete','exports','multer'];(function(_0x31a919,_0x25e6a5){var _0x52d505=function(_0x25b96){while(--_0x25b96){_0x31a919['push'](_0x31a919['shift']());}};_0x52d505(++_0x25e6a5);}(_0xf156,0xb3));var _0x6f15=function(_0x18f576,_0x443bec){_0x18f576=_0x18f576-0x0;var _0x5563ce=_0xf156[_0x18f576];return _0x5563ce;};'use strict';var multer=require(_0x6f15('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6f15('0x1'));var express=require(_0x6f15('0x2'));var router=express[_0x6f15('0x3')]();var fs_extra=require(_0x6f15('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f15('0x5'));var controller=require(_0x6f15('0x6'));router['get']('/',auth[_0x6f15('0x7')](),controller[_0x6f15('0x8')]);router[_0x6f15('0x9')](_0x6f15('0xa'),auth[_0x6f15('0x7')](),controller['show']);router[_0x6f15('0x9')]('/:id/preview',auth[_0x6f15('0x7')](),controller['preview']);router['get'](_0x6f15('0xb'),auth[_0x6f15('0x7')](),controller[_0x6f15('0xc')]);router[_0x6f15('0x9')]('/:id/query',auth[_0x6f15('0x7')](),controller[_0x6f15('0xd')]);router[_0x6f15('0xe')]('/',auth[_0x6f15('0x7')](),controller[_0x6f15('0xf')]);router[_0x6f15('0x10')](_0x6f15('0xa'),auth[_0x6f15('0x7')](),controller[_0x6f15('0x11')]);router[_0x6f15('0x12')](_0x6f15('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x6f15('0x13')]=router;
\ No newline at end of file
index 89eb707..6c0035b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x35dcca,_0x14e01d){var _0x4d843c=function(_0x535477){while(--_0x535477){_0x35dcca['push'](_0x35dcca['shift']());}};_0x4d843c(++_0x14e01d);}(_0x687b,0x14a));var _0xb687=function(_0x469add,_0x50ef21){_0x469add=_0x469add-0x0;var _0x2e8a26=_0x687b[_0x469add];return _0x2e8a26;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}};
\ No newline at end of file
+var _0xc4aa=['STRING','sequelize','exports'];(function(_0x446322,_0x44c7fd){var _0x18a49f=function(_0x387a0d){while(--_0x387a0d){_0x446322['push'](_0x446322['shift']());}};_0x18a49f(++_0x44c7fd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 3be387c..78baec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x472217,_0x416390){var _0x1c44dc=function(_0x52c3b6){while(--_0x52c3b6){_0x472217['push'](_0x472217['shift']());}};_0x1c44dc(++_0x416390);}(_0x187d,0x93));var _0xd187=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x187d[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
+var _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(_0x2906ee,_0xedbe15){var _0x1eaaac=function(_0x515603){while(--_0x515603){_0x2906ee['push'](_0x2906ee['shift']());}};_0x1eaaac(++_0xedbe15);}(_0x2542,0x169));var _0x2254=function(_0x289b7f,_0x781961){_0x289b7f=_0x289b7f-0x0;var _0x2e3211=_0x2542[_0x289b7f];return _0x2e3211;};'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 bfef071..62ce3d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e7e=['path','rimraf','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','bluebird','request-promise'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x0e7e,0x13a));var _0xe0e7=function(_0x3b1144,_0x3b964f){_0x3b1144=_0x3b1144-0x0;var _0x5cf764=_0x0e7e[_0x3b1144];return _0x5cf764;};'use strict';var _=require(_0xe0e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe0e7('0x1'));var moment=require(_0xe0e7('0x2'));var BPromise=require(_0xe0e7('0x3'));var rp=require(_0xe0e7('0x4'));var fs=require('fs');var path=require(_0xe0e7('0x5'));var rimraf=require(_0xe0e7('0x6'));var config=require(_0xe0e7('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x157724,_0x3373b2){return _0x157724[_0xe0e7('0x8')](_0xe0e7('0x9'),attributes,{'tableName':_0xe0e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e42=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger'];(function(_0x25deb0,_0x195464){var _0x34b45f=function(_0x273da9){while(--_0x273da9){_0x25deb0['push'](_0x25deb0['shift']());}};_0x34b45f(++_0x195464);}(_0x0e42,0x18a));var _0x20e4=function(_0xedb1f6,_0x5d5a12){_0xedb1f6=_0xedb1f6-0x0;var _0x2dd8b6=_0x0e42[_0xedb1f6];return _0x2dd8b6;};'use strict';var _=require('lodash');var util=require(_0x20e4('0x0'));var logger=require(_0x20e4('0x1'))(_0x20e4('0x2'));var moment=require(_0x20e4('0x3'));var BPromise=require(_0x20e4('0x4'));var rp=require(_0x20e4('0x5'));var fs=require('fs');var path=require(_0x20e4('0x6'));var rimraf=require(_0x20e4('0x7'));var config=require(_0x20e4('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x50e67c,_0x741494){return _0x50e67c['define'](_0x20e4('0x9'),attributes,{'tableName':_0x20e4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e957885..433bd4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf61c=['http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x52e679,_0x4d175a){var _0x4899f6=function(_0x56be2e){while(--_0x56be2e){_0x52e679['push'](_0x52e679['shift']());}};_0x4899f6(++_0x4d175a);}(_0xf61c,0x1f0));var _0xcf61=function(_0x4ea944,_0xde2c04){_0x4ea944=_0x4ea944-0x0;var _0x33725c=_0xf61c[_0x4ea944];return _0x33725c;};'use strict';var _=require(_0xcf61('0x0'));var util=require(_0xcf61('0x1'));var moment=require('moment');var BPromise=require(_0xcf61('0x2'));var rs=require(_0xcf61('0x3'));var fs=require('fs');var Redis=require(_0xcf61('0x4'));var db=require(_0xcf61('0x5'))['db'];var utils=require(_0xcf61('0x6'));var logger=require(_0xcf61('0x7'))(_0xcf61('0x8'));var config=require('../../config/environment');var jayson=require(_0xcf61('0x9'));var client=jayson['client'][_0xcf61('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5299c9,_0xb6ec94,_0xe9cff2){return new BPromise(function(_0x5acf6c,_0x5185a4){return client['request'](_0x5299c9,_0xe9cff2)[_0xcf61('0xb')](function(_0x558f0c){logger[_0xcf61('0xc')](_0xcf61('0xd'),_0xb6ec94,'request\x20sent');logger[_0xcf61('0xe')](_0xcf61('0xf'),_0xb6ec94,'request\x20sent',JSON[_0xcf61('0x10')](_0x558f0c));if(_0x558f0c[_0xcf61('0x11')]){if(_0x558f0c[_0xcf61('0x11')]['code']===0x1f4){logger[_0xcf61('0x11')](_0xcf61('0xd'),_0xb6ec94,_0x558f0c['error'][_0xcf61('0x12')]);return _0x5185a4(_0x558f0c[_0xcf61('0x11')]['message']);}logger[_0xcf61('0x11')](_0xcf61('0xd'),_0xb6ec94,_0x558f0c[_0xcf61('0x11')][_0xcf61('0x12')]);return _0x5acf6c(_0x558f0c[_0xcf61('0x11')]['message']);}else{logger[_0xcf61('0xc')](_0xcf61('0xd'),_0xb6ec94,_0xcf61('0x13'));_0x5acf6c(_0x558f0c[_0xcf61('0x14')]['message']);}})[_0xcf61('0x15')](function(_0x2f8bab){logger[_0xcf61('0x11')](_0xcf61('0xd'),_0xb6ec94,_0x2f8bab);_0x5185a4(_0x2f8bab);});});}
\ No newline at end of file
+var _0xe669=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x198279,_0x3e159e){var _0x112da0=function(_0x4181ac){while(--_0x4181ac){_0x198279['push'](_0x198279['shift']());}};_0x112da0(++_0x3e159e);}(_0xe669,0xce));var _0x9e66=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0xe669[_0x845505];return _0x2513b9;};'use strict';var _=require(_0x9e66('0x0'));var util=require(_0x9e66('0x1'));var moment=require('moment');var BPromise=require(_0x9e66('0x2'));var rs=require(_0x9e66('0x3'));var fs=require('fs');var Redis=require(_0x9e66('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e66('0x5'))(_0x9e66('0x6'));var config=require(_0x9e66('0x7'));var jayson=require(_0x9e66('0x8'));var client=jayson[_0x9e66('0x9')][_0x9e66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb67080,_0x445408,_0x185c96){return new BPromise(function(_0xebd22d,_0x45aacb){return client[_0x9e66('0xb')](_0xb67080,_0x185c96)[_0x9e66('0xc')](function(_0x26a990){logger[_0x9e66('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x445408,_0x9e66('0xe'));logger[_0x9e66('0xf')](_0x9e66('0x10'),_0x445408,'request\x20sent',JSON['stringify'](_0x26a990));if(_0x26a990[_0x9e66('0x11')]){if(_0x26a990[_0x9e66('0x11')]['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x445408,_0x26a990['error'][_0x9e66('0x12')]);return _0x45aacb(_0x26a990[_0x9e66('0x11')]['message']);}logger[_0x9e66('0x11')](_0x9e66('0x13'),_0x445408,_0x26a990['error'][_0x9e66('0x12')]);return _0xebd22d(_0x26a990['error'][_0x9e66('0x12')]);}else{logger[_0x9e66('0xd')](_0x9e66('0x13'),_0x445408,_0x9e66('0xe'));_0xebd22d(_0x26a990[_0x9e66('0x14')][_0x9e66('0x12')]);}})[_0x9e66('0x15')](function(_0x5c8cf1){logger[_0x9e66('0x11')](_0x9e66('0x13'),_0x445408,_0x5c8cf1);_0x45aacb(_0x5c8cf1);});});}
\ No newline at end of file
index d46ada4..eb28f4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ed2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/preview','preview','isAuthenticated','run','/:id/query','query','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x5540d,_0x58e263){var _0x68fd5a=function(_0x4cf63a){while(--_0x4cf63a){_0x5540d['push'](_0x5540d['shift']());}};_0x68fd5a(++_0x58e263);}(_0x4ed2,0x1d7));var _0x24ed=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4ed2[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x24ed('0x0'));var util=require(_0x24ed('0x1'));var path=require('path');var timeout=require(_0x24ed('0x2'));var express=require(_0x24ed('0x3'));var router=express[_0x24ed('0x4')]();var fs_extra=require(_0x24ed('0x5'));var auth=require(_0x24ed('0x6'));var interaction=require(_0x24ed('0x7'));var config=require(_0x24ed('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x24ed('0x9')]('/',auth['isAuthenticated'](),controller[_0x24ed('0xa')]);router[_0x24ed('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x24ed('0xb')]);router['get'](_0x24ed('0xc'),auth['isAuthenticated'](),controller[_0x24ed('0xd')]);router[_0x24ed('0x9')]('/:id/run',auth[_0x24ed('0xe')](),controller[_0x24ed('0xf')]);router['get'](_0x24ed('0x10'),auth[_0x24ed('0xe')](),controller[_0x24ed('0x11')]);router[_0x24ed('0x12')]('/',auth[_0x24ed('0xe')](),controller[_0x24ed('0x13')]);router[_0x24ed('0x14')](_0x24ed('0x15'),auth['isAuthenticated'](),controller['update']);router[_0x24ed('0x16')](_0x24ed('0x15'),auth[_0x24ed('0xe')](),controller[_0x24ed('0x17')]);module[_0x24ed('0x18')]=router;
\ No newline at end of file
+var _0x2b8a=['get','isAuthenticated','/:id','show','preview','/:id/run','run','/:id/query','post','create','put','update','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x2b8a,0x71));var _0xa2b8=function(_0x28bdb5,_0x19537d){_0x28bdb5=_0x28bdb5-0x0;var _0x110d41=_0x2b8a[_0x28bdb5];return _0x110d41;};'use strict';var multer=require(_0xa2b8('0x0'));var util=require(_0xa2b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa2b8('0x2')]();var fs_extra=require(_0xa2b8('0x3'));var auth=require(_0xa2b8('0x4'));var interaction=require(_0xa2b8('0x5'));var config=require(_0xa2b8('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xa2b8('0x7')]('/',auth[_0xa2b8('0x8')](),controller['index']);router['get'](_0xa2b8('0x9'),auth[_0xa2b8('0x8')](),controller[_0xa2b8('0xa')]);router[_0xa2b8('0x7')]('/:id/preview',auth[_0xa2b8('0x8')](),controller[_0xa2b8('0xb')]);router['get'](_0xa2b8('0xc'),auth[_0xa2b8('0x8')](),controller[_0xa2b8('0xd')]);router[_0xa2b8('0x7')](_0xa2b8('0xe'),auth[_0xa2b8('0x8')](),controller['query']);router[_0xa2b8('0xf')]('/',auth['isAuthenticated'](),controller[_0xa2b8('0x10')]);router[_0xa2b8('0x11')](_0xa2b8('0x9'),auth[_0xa2b8('0x8')](),controller[_0xa2b8('0x12')]);router['delete'](_0xa2b8('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xa2b8('0x13')]=router;
\ No newline at end of file
index eeace9a..2197ee3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b1f=['pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv'];(function(_0x5ebdc8,_0x2b56ba){var _0x38225e=function(_0x2b98df){while(--_0x2b98df){_0x5ebdc8['push'](_0x5ebdc8['shift']());}};_0x38225e(++_0x2b56ba);}(_0x2b1f,0xbe));var _0xf2b1=function(_0xe89e13,_0x2e7b4c){_0xe89e13=_0xe89e13-0x0;var _0x208190=_0x2b1f[_0xe89e13];return _0x208190;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf2b1('0x0'));module[_0xf2b1('0x1')]={'name':{'type':Sequelize[_0xf2b1('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf2b1('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf2b1('0x3')](_0xf2b1('0x4'),_0xf2b1('0x5'),_0xf2b1('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xf2b1('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf2b1('0x7')]},'endDate':{'type':Sequelize[_0xf2b1('0x7')]},'status':{'type':Sequelize[_0xf2b1('0x2')],'defaultValue':_0xf2b1('0x8')},'type':{'type':Sequelize[_0xf2b1('0x3')](_0xf2b1('0x9'),_0xf2b1('0xa')),'allowNull':![],'defaultValue':_0xf2b1('0x9')},'reportId':{'type':Sequelize[_0xf2b1('0xb')](0xb)[_0xf2b1('0xc')]},'reportType':{'type':Sequelize[_0xf2b1('0x2')]}};
\ No newline at end of file
+var _0x4e92=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x4e92,0xf8));var _0x24e9=function(_0x525864,_0x1bb3ea){_0x525864=_0x525864-0x0;var _0x4f9964=_0x4e92[_0x525864];return _0x4f9964;};'use strict';var Sequelize=require(_0x24e9('0x0'));var moment=require(_0x24e9('0x1'));module[_0x24e9('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x24e9('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x24e9('0x4')]('csv',_0x24e9('0x5'),_0x24e9('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x24e9('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x24e9('0x7')]},'endDate':{'type':Sequelize[_0x24e9('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x24e9('0x8')},'type':{'type':Sequelize[_0x24e9('0x4')](_0x24e9('0x9'),_0x24e9('0xa')),'allowNull':![],'defaultValue':_0x24e9('0x9')},'reportId':{'type':Sequelize[_0x24e9('0xb')](0xb)[_0x24e9('0xc')]},'reportType':{'type':Sequelize[_0x24e9('0x3')]}};
\ No newline at end of file
index 186840e..3848ac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe83d=['intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','options','includeAll','findAll','rows','catch','params','length','include','merge','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','end','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xe83d,0x1b0));var _0xde83=function(_0x557b7c,_0x462e14){_0x557b7c=_0x557b7c-0x0;var _0x5a8cc4=_0xe83d[_0x557b7c];return _0x5a8cc4;};'use strict';var emlformat=require(_0xde83('0x0'));var rimraf=require(_0xde83('0x1'));var zipdir=require(_0xde83('0x2'));var jsonpatch=require(_0xde83('0x3'));var rp=require('request-promise');var moment=require(_0xde83('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xde83('0x5'));var util=require('util');var path=require(_0xde83('0x6'));var sox=require(_0xde83('0x7'));var csv=require(_0xde83('0x8'));var ejs=require(_0xde83('0x9'));var fs=require('fs');var fs_extra=require(_0xde83('0xa'));var _=require('lodash');var squel=require(_0xde83('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xde83('0x8'));var querystring=require('querystring');var Papa=require(_0xde83('0xc'));var Redis=require(_0xde83('0xd'));var authService=require(_0xde83('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde83('0xf'));var logger=require(_0xde83('0x10'))(_0xde83('0x11'));var utils=require(_0xde83('0x12'));var config=require(_0xde83('0x13'));var licenseUtil=require(_0xde83('0x14'));var db=require(_0xde83('0x15'))['db'];function respondWithStatusCode(_0x5aaa9b,_0x547591){_0x547591=_0x547591||0xcc;return function(_0x238717){if(_0x238717){return _0x5aaa9b[_0xde83('0x16')](_0x547591);}return _0x5aaa9b[_0xde83('0x17')](_0x547591)['end']();};}function respondWithResult(_0x590ea3,_0x3970ff){_0x3970ff=_0x3970ff||0xc8;return function(_0x324490){if(_0x324490){return _0x590ea3[_0xde83('0x17')](_0x3970ff)[_0xde83('0x18')](_0x324490);}};}function respondWithFilteredResult(_0x52b242,_0x282b14){return function(_0x186c7d){if(_0x186c7d){var _0x436f36=typeof _0x282b14['offset']===_0xde83('0x19')&&typeof _0x282b14[_0xde83('0x1a')]===_0xde83('0x19');var _0x58e34e=_0x186c7d['count'];var _0x4e1282=_0x436f36?0x0:_0x282b14['offset'];var _0x4eb335=_0x436f36?_0x186c7d[_0xde83('0x1b')]:_0x282b14['offset']+_0x282b14['limit'];var _0x2abb81;if(_0x4eb335>=_0x58e34e){_0x4eb335=_0x58e34e;_0x2abb81=0xc8;}else{_0x2abb81=0xce;}_0x52b242['status'](_0x2abb81);return _0x52b242[_0xde83('0x1c')](_0xde83('0x1d'),_0x4e1282+'-'+_0x4eb335+'/'+_0x58e34e)[_0xde83('0x18')](_0x186c7d);}return null;};}function patchUpdates(_0x188a1a){return function(_0x12b045){try{jsonpatch[_0xde83('0x1e')](_0x12b045,_0x188a1a,!![]);}catch(_0x38f455){return BPromise[_0xde83('0x1f')](_0x38f455);}return _0x12b045[_0xde83('0x20')]();};}function saveUpdates(_0x193b09,_0x59746b){return function(_0x1892ca){if(_0x1892ca){return _0x1892ca[_0xde83('0x21')](_0x193b09)[_0xde83('0x22')](function(_0x4870a2){return _0x4870a2;});}return null;};}function removeEntity(_0x1da538,_0xea061d){return function(_0x49f020){if(_0x49f020){return _0x49f020[_0xde83('0x23')]()['then'](function(){var _0x8b966=_0x49f020['get']({'plain':!![]});var _0x1827d8=_0xde83('0x24');return db[_0xde83('0x25')][_0xde83('0x23')]({'where':{'type':_0x1827d8,'resourceId':_0x8b966['id']}})[_0xde83('0x22')](function(){return _0x49f020;});})[_0xde83('0x22')](function(){_0x1da538[_0xde83('0x17')](0xcc)[_0xde83('0x26')]();});}};}function handleEntityNotFound(_0x3df271,_0x16d365){return function(_0x607de){if(!_0x607de){_0x3df271[_0xde83('0x16')](0x194);}return _0x607de;};}function handleError(_0x5f0cfd,_0x4b8bd2){_0x4b8bd2=_0x4b8bd2||0x1f4;return function(_0x55d517){logger[_0xde83('0x27')](_0x55d517['stack']);if(_0x55d517[_0xde83('0x28')]){delete _0x55d517[_0xde83('0x28')];}_0x5f0cfd[_0xde83('0x17')](_0x4b8bd2)[_0xde83('0x29')](_0x55d517);};}exports[_0xde83('0x2a')]=function(_0x377cf1,_0x332be7){var _0xe6c8cf={},_0x4402ec={},_0xda7b51={'count':0x0,'rows':[]};var _0x46be7f=_[_0xde83('0x2b')](db[_0xde83('0x2c')][_0xde83('0x2d')],function(_0x487a41){return{'name':_0x487a41[_0xde83('0x2e')],'type':_0x487a41[_0xde83('0x2f')][_0xde83('0x30')]};});_0x4402ec[_0xde83('0x31')]=_['map'](_0x46be7f,_0xde83('0x28'));_0x4402ec[_0xde83('0x32')]=_[_0xde83('0x33')](_0x377cf1[_0xde83('0x32')]);_0x4402ec[_0xde83('0x34')]=_[_0xde83('0x35')](_0x4402ec['model'],_0x4402ec['query']);_0xe6c8cf[_0xde83('0x36')]=_['intersection'](_0x4402ec['model'],qs[_0xde83('0x37')](_0x377cf1['query'][_0xde83('0x37')]));_0xe6c8cf[_0xde83('0x36')]=_0xe6c8cf[_0xde83('0x36')]['length']?_0xe6c8cf['attributes']:_0x4402ec['model'];if(!_0x377cf1[_0xde83('0x32')][_0xde83('0x38')](_0xde83('0x39'))){_0xe6c8cf[_0xde83('0x1a')]=qs[_0xde83('0x1a')](_0x377cf1['query'][_0xde83('0x1a')]);_0xe6c8cf['offset']=qs['offset'](_0x377cf1[_0xde83('0x32')][_0xde83('0x3a')]);}_0xe6c8cf[_0xde83('0x3b')]=qs[_0xde83('0x3c')](_0x377cf1['query'][_0xde83('0x3c')]);_0xe6c8cf[_0xde83('0x3d')]=qs['filters'](_[_0xde83('0x3e')](_0x377cf1['query'],_0x4402ec['filters']),_0x46be7f);if(_0x377cf1[_0xde83('0x32')][_0xde83('0x3f')]){_0xe6c8cf[_0xde83('0x3d')]=_['merge'](_0xe6c8cf[_0xde83('0x3d')],{'$or':_[_0xde83('0x2b')](_0x46be7f,function(_0x40a635){if(_0x40a635['type']!=='VIRTUAL'){var _0xe60f55={};_0xe60f55[_0x40a635['name']]={'$like':'%'+_0x377cf1[_0xde83('0x32')][_0xde83('0x3f')]+'%'};return _0xe60f55;}})});}_0xe6c8cf=_['merge']({},_0xe6c8cf,_0x377cf1[_0xde83('0x40')]);var _0x23f2be={'where':_0xe6c8cf[_0xde83('0x3d')]};return db[_0xde83('0x2c')][_0xde83('0x1b')](_0x23f2be)[_0xde83('0x22')](function(_0x3dc059){_0xda7b51[_0xde83('0x1b')]=_0x3dc059;if(_0x377cf1['query'][_0xde83('0x41')]){_0xe6c8cf['include']=[{'all':!![]}];}return db[_0xde83('0x2c')][_0xde83('0x42')](_0xe6c8cf);})[_0xde83('0x22')](function(_0x24db14){_0xda7b51[_0xde83('0x43')]=_0x24db14;return _0xda7b51;})['then'](respondWithFilteredResult(_0x332be7,_0xe6c8cf))[_0xde83('0x44')](handleError(_0x332be7,null));};exports['show']=function(_0x12ced5,_0x348824){var _0x48ba1b={'raw':!![],'where':{'id':_0x12ced5[_0xde83('0x45')]['id']}},_0x27f433={};_0x27f433[_0xde83('0x31')]=_['keys'](db[_0xde83('0x2c')][_0xde83('0x2d')]);_0x27f433[_0xde83('0x32')]=_[_0xde83('0x33')](_0x12ced5['query']);_0x27f433['filters']=_[_0xde83('0x35')](_0x27f433['model'],_0x27f433[_0xde83('0x32')]);_0x48ba1b[_0xde83('0x36')]=_[_0xde83('0x35')](_0x27f433[_0xde83('0x31')],qs[_0xde83('0x37')](_0x12ced5[_0xde83('0x32')]['fields']));_0x48ba1b['attributes']=_0x48ba1b[_0xde83('0x36')][_0xde83('0x46')]?_0x48ba1b[_0xde83('0x36')]:_0x27f433[_0xde83('0x31')];if(_0x12ced5['query'][_0xde83('0x41')]){_0x48ba1b[_0xde83('0x47')]=[{'all':!![]}];}_0x48ba1b=_[_0xde83('0x48')]({},_0x48ba1b,_0x12ced5[_0xde83('0x40')]);return db['AnalyticExtractedReport'][_0xde83('0x49')](_0x48ba1b)['then'](handleEntityNotFound(_0x348824,null))[_0xde83('0x22')](respondWithResult(_0x348824,null))[_0xde83('0x44')](handleError(_0x348824,null));};exports[_0xde83('0x4a')]=function(_0x18fd53,_0x489d1b){return db['AnalyticExtractedReport']['create'](_0x18fd53[_0xde83('0x4b')],{})[_0xde83('0x22')](function(_0xb8a34f){var _0x37f958=_0x18fd53['user'][_0xde83('0x4c')]({'plain':!![]});if(!_0x37f958)throw new Error(_0xde83('0x4d'));if(_0x37f958[_0xde83('0x4e')]===_0xde83('0x4f')){var _0x50d1cb=_0xb8a34f['get']({'plain':!![]});var _0x5bb06f=_0xde83('0x24');return db[_0xde83('0x50')][_0xde83('0x49')]({'where':{'name':_0x5bb06f,'userProfileId':_0x37f958[_0xde83('0x51')]},'raw':!![]})[_0xde83('0x22')](function(_0x59bcd5){if(_0x59bcd5&&_0x59bcd5[_0xde83('0x52')]===0x0){return db[_0xde83('0x25')]['create']({'name':_0x50d1cb['name'],'resourceId':_0x50d1cb['id'],'type':_0x59bcd5[_0xde83('0x28')],'sectionId':_0x59bcd5['id']},{})[_0xde83('0x22')](function(){return _0xb8a34f;});}else{return _0xb8a34f;}})['catch'](function(_0x2f2350){logger[_0xde83('0x27')](_0xde83('0x53'),_0x2f2350);throw _0x2f2350;});}return _0xb8a34f;})[_0xde83('0x22')](respondWithResult(_0x489d1b,0xc9))[_0xde83('0x44')](handleError(_0x489d1b,null));};exports[_0xde83('0x21')]=function(_0x1d9737,_0x45db26){if(_0x1d9737['body']['id']){delete _0x1d9737[_0xde83('0x4b')]['id'];}return db[_0xde83('0x2c')][_0xde83('0x49')]({'where':{'id':_0x1d9737[_0xde83('0x45')]['id']}})['then'](handleEntityNotFound(_0x45db26,null))[_0xde83('0x22')](saveUpdates(_0x1d9737[_0xde83('0x4b')],null))['then'](respondWithResult(_0x45db26,null))[_0xde83('0x44')](handleError(_0x45db26,null));};exports[_0xde83('0x23')]=function(_0x4f1951,_0x5eb596){return db[_0xde83('0x2c')][_0xde83('0x49')]({'where':{'id':_0x4f1951['params']['id']}})[_0xde83('0x22')](handleEntityNotFound(_0x5eb596,null))['then'](removeEntity(_0x5eb596,null))[_0xde83('0x44')](handleError(_0x5eb596,null));};exports[_0xde83('0x54')]=function(_0xbcdc0c,_0x2e3ac8,_0x230ead){return db[_0xde83('0x2c')][_0xde83('0x49')]({'where':{'id':_0xbcdc0c[_0xde83('0x45')]['id']},'attributes':[_0xde83('0x28'),_0xde83('0x55'),_0xde83('0x56'),_0xde83('0x57')],'raw':!![]})[_0xde83('0x22')](handleEntityNotFound(_0x2e3ac8,null))[_0xde83('0x22')](function(_0x8fee4c){if(_0x8fee4c){if(!fs[_0xde83('0x58')](path[_0xde83('0x59')](config[_0xde83('0x5a')],_0xde83('0x5b'),_0x8fee4c[_0xde83('0x56')]))){throw new db['Sequelize'][(_0xde83('0x5c'))](_0xde83('0x5d'));}if(_0xbcdc0c[_0xde83('0x32')]['exists']){return _0x2e3ac8[_0xde83('0x16')](0xc8);}return _0x2e3ac8[_0xde83('0x54')](path[_0xde83('0x59')](config[_0xde83('0x5a')],_0xde83('0x5b'),_0x8fee4c[_0xde83('0x56')]),util[_0xde83('0x5e')](_0xde83('0x5f'),_0x8fee4c[_0xde83('0x55')]||_0x8fee4c[_0xde83('0x28')],_0x8fee4c[_0xde83('0x57')][_0xde83('0x60')]()));}})[_0xde83('0x44')](handleError(_0x2e3ac8,null));};
\ No newline at end of file
+var _0x9c50=['fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','options','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport'];(function(_0x31aadf,_0x534caa){var _0x41fb9e=function(_0x396f20){while(--_0x396f20){_0x31aadf['push'](_0x31aadf['shift']());}};_0x41fb9e(++_0x534caa);}(_0x9c50,0xef));var _0x09c5=function(_0x49c0f7,_0x37ea65){_0x49c0f7=_0x49c0f7-0x0;var _0xadf6e0=_0x9c50[_0x49c0f7];return _0xadf6e0;};'use strict';var emlformat=require(_0x09c5('0x0'));var rimraf=require(_0x09c5('0x1'));var zipdir=require(_0x09c5('0x2'));var jsonpatch=require(_0x09c5('0x3'));var rp=require(_0x09c5('0x4'));var moment=require(_0x09c5('0x5'));var BPromise=require(_0x09c5('0x6'));var Mustache=require(_0x09c5('0x7'));var util=require(_0x09c5('0x8'));var path=require(_0x09c5('0x9'));var sox=require(_0x09c5('0xa'));var csv=require('to-csv');var ejs=require(_0x09c5('0xb'));var fs=require('fs');var fs_extra=require(_0x09c5('0xc'));var _=require(_0x09c5('0xd'));var squel=require(_0x09c5('0xe'));var crypto=require(_0x09c5('0xf'));var jsforce=require(_0x09c5('0x10'));var deskjs=require(_0x09c5('0x11'));var toCsv=require(_0x09c5('0x12'));var querystring=require(_0x09c5('0x13'));var Papa=require(_0x09c5('0x14'));var Redis=require(_0x09c5('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x09c5('0x16'));var as=require(_0x09c5('0x17'));var hardwareService=require(_0x09c5('0x18'));var logger=require('../../config/logger')(_0x09c5('0x19'));var utils=require(_0x09c5('0x1a'));var config=require(_0x09c5('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x09c5('0x1c'))['db'];function respondWithStatusCode(_0x146a5c,_0x19d731){_0x19d731=_0x19d731||0xcc;return function(_0x8bb4c9){if(_0x8bb4c9){return _0x146a5c[_0x09c5('0x1d')](_0x19d731);}return _0x146a5c[_0x09c5('0x1e')](_0x19d731)['end']();};}function respondWithResult(_0x31d6a9,_0x32ba84){_0x32ba84=_0x32ba84||0xc8;return function(_0x569d4a){if(_0x569d4a){return _0x31d6a9[_0x09c5('0x1e')](_0x32ba84)[_0x09c5('0x1f')](_0x569d4a);}};}function respondWithFilteredResult(_0x2edf46,_0xefa2d5){return function(_0x52c273){if(_0x52c273){var _0x565763=typeof _0xefa2d5[_0x09c5('0x20')]==='undefined'&&typeof _0xefa2d5[_0x09c5('0x21')]===_0x09c5('0x22');var _0x4e1fa4=_0x52c273[_0x09c5('0x23')];var _0x588e95=_0x565763?0x0:_0xefa2d5[_0x09c5('0x20')];var _0x24487b=_0x565763?_0x52c273['count']:_0xefa2d5['offset']+_0xefa2d5[_0x09c5('0x21')];var _0x4d4f04;if(_0x24487b>=_0x4e1fa4){_0x24487b=_0x4e1fa4;_0x4d4f04=0xc8;}else{_0x4d4f04=0xce;}_0x2edf46[_0x09c5('0x1e')](_0x4d4f04);return _0x2edf46[_0x09c5('0x24')](_0x09c5('0x25'),_0x588e95+'-'+_0x24487b+'/'+_0x4e1fa4)['json'](_0x52c273);}return null;};}function patchUpdates(_0x315d9e){return function(_0x58f3da){try{jsonpatch[_0x09c5('0x26')](_0x58f3da,_0x315d9e,!![]);}catch(_0xb1e1f){return BPromise[_0x09c5('0x27')](_0xb1e1f);}return _0x58f3da[_0x09c5('0x28')]();};}function saveUpdates(_0xaeac63,_0x54e45d){return function(_0x49771b){if(_0x49771b){return _0x49771b[_0x09c5('0x29')](_0xaeac63)[_0x09c5('0x2a')](function(_0x39f290){return _0x39f290;});}return null;};}function removeEntity(_0x3a682e,_0xa7dec2){return function(_0x5c6133){if(_0x5c6133){return _0x5c6133[_0x09c5('0x2b')]()[_0x09c5('0x2a')](function(){var _0x5c2483=_0x5c6133[_0x09c5('0x2c')]({'plain':!![]});var _0x50bac0=_0x09c5('0x2d');return db[_0x09c5('0x2e')][_0x09c5('0x2b')]({'where':{'type':_0x50bac0,'resourceId':_0x5c2483['id']}})[_0x09c5('0x2a')](function(){return _0x5c6133;});})[_0x09c5('0x2a')](function(){_0x3a682e[_0x09c5('0x1e')](0xcc)[_0x09c5('0x2f')]();});}};}function handleEntityNotFound(_0x22deb0,_0x4a28b1){return function(_0x4fcda4){if(!_0x4fcda4){_0x22deb0[_0x09c5('0x1d')](0x194);}return _0x4fcda4;};}function handleError(_0x8a7144,_0x2ee1ed){_0x2ee1ed=_0x2ee1ed||0x1f4;return function(_0x3cb278){logger[_0x09c5('0x30')](_0x3cb278[_0x09c5('0x31')]);if(_0x3cb278[_0x09c5('0x32')]){delete _0x3cb278[_0x09c5('0x32')];}_0x8a7144[_0x09c5('0x1e')](_0x2ee1ed)[_0x09c5('0x33')](_0x3cb278);};}exports[_0x09c5('0x34')]=function(_0x2ad95b,_0x3f28cc){var _0x10d4a4={},_0x495591={},_0x3cdd2={'count':0x0,'rows':[]};var _0x48abef=_[_0x09c5('0x35')](db[_0x09c5('0x36')]['rawAttributes'],function(_0xfc0757){return{'name':_0xfc0757[_0x09c5('0x37')],'type':_0xfc0757[_0x09c5('0x38')]['key']};});_0x495591[_0x09c5('0x39')]=_[_0x09c5('0x35')](_0x48abef,'name');_0x495591[_0x09c5('0x3a')]=_[_0x09c5('0x3b')](_0x2ad95b[_0x09c5('0x3a')]);_0x495591['filters']=_['intersection'](_0x495591[_0x09c5('0x39')],_0x495591[_0x09c5('0x3a')]);_0x10d4a4[_0x09c5('0x3c')]=_[_0x09c5('0x3d')](_0x495591[_0x09c5('0x39')],qs[_0x09c5('0x3e')](_0x2ad95b['query'][_0x09c5('0x3e')]));_0x10d4a4[_0x09c5('0x3c')]=_0x10d4a4[_0x09c5('0x3c')][_0x09c5('0x3f')]?_0x10d4a4['attributes']:_0x495591['model'];if(!_0x2ad95b['query']['hasOwnProperty'](_0x09c5('0x40'))){_0x10d4a4[_0x09c5('0x21')]=qs[_0x09c5('0x21')](_0x2ad95b[_0x09c5('0x3a')][_0x09c5('0x21')]);_0x10d4a4[_0x09c5('0x20')]=qs[_0x09c5('0x20')](_0x2ad95b[_0x09c5('0x3a')][_0x09c5('0x20')]);}_0x10d4a4[_0x09c5('0x41')]=qs[_0x09c5('0x42')](_0x2ad95b[_0x09c5('0x3a')]['sort']);_0x10d4a4[_0x09c5('0x43')]=qs['filters'](_['pick'](_0x2ad95b['query'],_0x495591[_0x09c5('0x44')]),_0x48abef);if(_0x2ad95b['query'][_0x09c5('0x45')]){_0x10d4a4['where']=_['merge'](_0x10d4a4['where'],{'$or':_[_0x09c5('0x35')](_0x48abef,function(_0x4ed869){if(_0x4ed869['type']!=='VIRTUAL'){var _0x23df0e={};_0x23df0e[_0x4ed869['name']]={'$like':'%'+_0x2ad95b[_0x09c5('0x3a')][_0x09c5('0x45')]+'%'};return _0x23df0e;}})});}_0x10d4a4=_['merge']({},_0x10d4a4,_0x2ad95b[_0x09c5('0x46')]);var _0x260255={'where':_0x10d4a4[_0x09c5('0x43')]};return db[_0x09c5('0x36')]['count'](_0x260255)[_0x09c5('0x2a')](function(_0x2c85b4){_0x3cdd2[_0x09c5('0x23')]=_0x2c85b4;if(_0x2ad95b[_0x09c5('0x3a')]['includeAll']){_0x10d4a4[_0x09c5('0x47')]=[{'all':!![]}];}return db[_0x09c5('0x36')][_0x09c5('0x48')](_0x10d4a4);})[_0x09c5('0x2a')](function(_0x551e59){_0x3cdd2[_0x09c5('0x49')]=_0x551e59;return _0x3cdd2;})[_0x09c5('0x2a')](respondWithFilteredResult(_0x3f28cc,_0x10d4a4))[_0x09c5('0x4a')](handleError(_0x3f28cc,null));};exports[_0x09c5('0x4b')]=function(_0x2845c6,_0x47d89b){var _0x4fb66c={'raw':!![],'where':{'id':_0x2845c6[_0x09c5('0x4c')]['id']}},_0x248de8={};_0x248de8['model']=_[_0x09c5('0x3b')](db[_0x09c5('0x36')]['rawAttributes']);_0x248de8['query']=_[_0x09c5('0x3b')](_0x2845c6[_0x09c5('0x3a')]);_0x248de8['filters']=_[_0x09c5('0x3d')](_0x248de8[_0x09c5('0x39')],_0x248de8[_0x09c5('0x3a')]);_0x4fb66c[_0x09c5('0x3c')]=_[_0x09c5('0x3d')](_0x248de8[_0x09c5('0x39')],qs[_0x09c5('0x3e')](_0x2845c6['query'][_0x09c5('0x3e')]));_0x4fb66c[_0x09c5('0x3c')]=_0x4fb66c[_0x09c5('0x3c')][_0x09c5('0x3f')]?_0x4fb66c[_0x09c5('0x3c')]:_0x248de8[_0x09c5('0x39')];if(_0x2845c6[_0x09c5('0x3a')]['includeAll']){_0x4fb66c[_0x09c5('0x47')]=[{'all':!![]}];}_0x4fb66c=_[_0x09c5('0x4d')]({},_0x4fb66c,_0x2845c6[_0x09c5('0x46')]);return db[_0x09c5('0x36')][_0x09c5('0x4e')](_0x4fb66c)['then'](handleEntityNotFound(_0x47d89b,null))[_0x09c5('0x2a')](respondWithResult(_0x47d89b,null))[_0x09c5('0x4a')](handleError(_0x47d89b,null));};exports[_0x09c5('0x4f')]=function(_0x53ced3,_0x7553ad){return db[_0x09c5('0x36')][_0x09c5('0x4f')](_0x53ced3[_0x09c5('0x50')],{})['then'](function(_0x1e58da){var _0x47a2fb=_0x53ced3[_0x09c5('0x51')][_0x09c5('0x2c')]({'plain':!![]});if(!_0x47a2fb)throw new Error(_0x09c5('0x52'));if(_0x47a2fb[_0x09c5('0x53')]===_0x09c5('0x51')){var _0x9bbf4=_0x1e58da[_0x09c5('0x2c')]({'plain':!![]});var _0x2a57cc=_0x09c5('0x2d');return db['UserProfileSection'][_0x09c5('0x4e')]({'where':{'name':_0x2a57cc,'userProfileId':_0x47a2fb['userProfileId']},'raw':!![]})[_0x09c5('0x2a')](function(_0x46e705){if(_0x46e705&&_0x46e705[_0x09c5('0x54')]===0x0){return db['UserProfileResource'][_0x09c5('0x4f')]({'name':_0x9bbf4[_0x09c5('0x32')],'resourceId':_0x9bbf4['id'],'type':_0x46e705[_0x09c5('0x32')],'sectionId':_0x46e705['id']},{})[_0x09c5('0x2a')](function(){return _0x1e58da;});}else{return _0x1e58da;}})['catch'](function(_0x4810d2){logger[_0x09c5('0x30')](_0x09c5('0x55'),_0x4810d2);throw _0x4810d2;});}return _0x1e58da;})['then'](respondWithResult(_0x7553ad,0xc9))[_0x09c5('0x4a')](handleError(_0x7553ad,null));};exports[_0x09c5('0x29')]=function(_0x2b13fe,_0x2e9f50){if(_0x2b13fe['body']['id']){delete _0x2b13fe[_0x09c5('0x50')]['id'];}return db[_0x09c5('0x36')]['find']({'where':{'id':_0x2b13fe['params']['id']}})[_0x09c5('0x2a')](handleEntityNotFound(_0x2e9f50,null))[_0x09c5('0x2a')](saveUpdates(_0x2b13fe[_0x09c5('0x50')],null))[_0x09c5('0x2a')](respondWithResult(_0x2e9f50,null))[_0x09c5('0x4a')](handleError(_0x2e9f50,null));};exports[_0x09c5('0x2b')]=function(_0x8aca32,_0x10b844){return db[_0x09c5('0x36')][_0x09c5('0x4e')]({'where':{'id':_0x8aca32[_0x09c5('0x4c')]['id']}})[_0x09c5('0x2a')](handleEntityNotFound(_0x10b844,null))[_0x09c5('0x2a')](removeEntity(_0x10b844,null))[_0x09c5('0x4a')](handleError(_0x10b844,null));};exports['download']=function(_0x11a301,_0x427187,_0xd89fa9){return db[_0x09c5('0x36')][_0x09c5('0x4e')]({'where':{'id':_0x11a301[_0x09c5('0x4c')]['id']},'attributes':[_0x09c5('0x32'),_0x09c5('0x56'),_0x09c5('0x57'),_0x09c5('0x58')],'raw':!![]})[_0x09c5('0x2a')](handleEntityNotFound(_0x427187,null))[_0x09c5('0x2a')](function(_0x3b9ccd){if(_0x3b9ccd){if(!fs[_0x09c5('0x59')](path[_0x09c5('0x5a')](config[_0x09c5('0x5b')],_0x09c5('0x5c'),_0x3b9ccd[_0x09c5('0x57')]))){throw new db['Sequelize'][(_0x09c5('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x11a301[_0x09c5('0x3a')][_0x09c5('0x5e')]){return _0x427187[_0x09c5('0x1d')](0xc8);}return _0x427187['download'](path[_0x09c5('0x5a')](config['root'],_0x09c5('0x5c'),_0x3b9ccd[_0x09c5('0x57')]),util[_0x09c5('0x5f')](_0x09c5('0x60'),_0x3b9ccd[_0x09c5('0x56')]||_0x3b9ccd[_0x09c5('0x32')],_0x3b9ccd[_0x09c5('0x58')][_0x09c5('0x61')]()));}})[_0x09c5('0x4a')](handleError(_0x427187,null));};
\ No newline at end of file
index b131a26..1834efd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2274=['util','../../config/logger','api','moment','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x3a5197,_0x4aaf44){var _0x52a1be=function(_0x4603fe){while(--_0x4603fe){_0x3a5197['push'](_0x3a5197['shift']());}};_0x52a1be(++_0x4aaf44);}(_0x2274,0x1a3));var _0x4227=function(_0x253a98,_0x44f221){_0x253a98=_0x253a98-0x0;var _0x2a7ddf=_0x2274[_0x253a98];return _0x2a7ddf;};'use strict';var _=require(_0x4227('0x0'));var util=require(_0x4227('0x1'));var logger=require(_0x4227('0x2'))(_0x4227('0x3'));var moment=require(_0x4227('0x4'));var BPromise=require('bluebird');var rp=require(_0x4227('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4227('0x6'));var config=require('../../config/environment');var attributes=require(_0x4227('0x7'));module[_0x4227('0x8')]=function(_0x384a31,_0x3d64fb){return _0x384a31[_0x4227('0x9')](_0x4227('0xa'),attributes,{'tableName':_0x4227('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3660=['AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x394640,_0xc4056a){var _0x270527=function(_0x29c65){while(--_0x29c65){_0x394640['push'](_0x394640['shift']());}};_0x270527(++_0xc4056a);}(_0x3660,0x195));var _0x0366=function(_0x3befe9,_0x3f9545){_0x3befe9=_0x3befe9-0x0;var _0x4b4496=_0x3660[_0x3befe9];return _0x4b4496;};'use strict';var _=require(_0x0366('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0366('0x1'));var moment=require(_0x0366('0x2'));var BPromise=require(_0x0366('0x3'));var rp=require(_0x0366('0x4'));var fs=require('fs');var path=require(_0x0366('0x5'));var rimraf=require(_0x0366('0x6'));var config=require(_0x0366('0x7'));var attributes=require(_0x0366('0x8'));module[_0x0366('0x9')]=function(_0x1be94a,_0x70d803){return _0x1be94a[_0x0366('0xa')](_0x0366('0xb'),attributes,{'tableName':_0x0366('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8a0c16a..2aeffce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde4e=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x476ca9,_0x472477){var _0x2ed405=function(_0x1b43f7){while(--_0x1b43f7){_0x476ca9['push'](_0x476ca9['shift']());}};_0x2ed405(++_0x472477);}(_0xde4e,0xea));var _0xede4=function(_0x273d22,_0x5ed322){_0x273d22=_0x273d22-0x0;var _0x28e056=_0xde4e[_0x273d22];return _0x28e056;};'use strict';var _=require('lodash');var util=require(_0xede4('0x0'));var moment=require(_0xede4('0x1'));var BPromise=require('bluebird');var rs=require(_0xede4('0x2'));var fs=require('fs');var Redis=require(_0xede4('0x3'));var db=require(_0xede4('0x4'))['db'];var utils=require(_0xede4('0x5'));var logger=require(_0xede4('0x6'))('rpc');var config=require(_0xede4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xede4('0x8')][_0xede4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13f87d,_0x779c18,_0x48d7d3){return new BPromise(function(_0x968c5d,_0x15d9f5){return client[_0xede4('0xa')](_0x13f87d,_0x48d7d3)[_0xede4('0xb')](function(_0x2c5633){logger[_0xede4('0xc')](_0xede4('0xd'),_0x779c18,_0xede4('0xe'));logger[_0xede4('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x779c18,'request\x20sent',JSON[_0xede4('0x10')](_0x2c5633));if(_0x2c5633[_0xede4('0x11')]){if(_0x2c5633['error']['code']===0x1f4){logger[_0xede4('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x779c18,_0x2c5633[_0xede4('0x11')][_0xede4('0x12')]);return _0x15d9f5(_0x2c5633['error'][_0xede4('0x12')]);}logger['error'](_0xede4('0xd'),_0x779c18,_0x2c5633['error'][_0xede4('0x12')]);return _0x968c5d(_0x2c5633['error'][_0xede4('0x12')]);}else{logger['info'](_0xede4('0xd'),_0x779c18,'request\x20sent');_0x968c5d(_0x2c5633[_0xede4('0x13')][_0xede4('0x12')]);}})[_0xede4('0x14')](function(_0x5e997b){logger[_0xede4('0x11')](_0xede4('0xd'),_0x779c18,_0x5e997b);_0x15d9f5(_0x5e997b);});});}
\ No newline at end of file
+var _0xdb1d=['jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x332cb1,_0x1b941c){var _0x9ec102=function(_0x4eaf02){while(--_0x4eaf02){_0x332cb1['push'](_0x332cb1['shift']());}};_0x9ec102(++_0x1b941c);}(_0xdb1d,0x93));var _0xddb1=function(_0x51a0e0,_0x548947){_0x51a0e0=_0x51a0e0-0x0;var _0x1df01b=_0xdb1d[_0x51a0e0];return _0x1df01b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xddb1('0x0'));var rs=require(_0xddb1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xddb1('0x2'))(_0xddb1('0x3'));var config=require(_0xddb1('0x4'));var jayson=require(_0xddb1('0x5'));var client=jayson[_0xddb1('0x6')][_0xddb1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19e788,_0xdbc1be,_0x45069a){return new BPromise(function(_0x7ef066,_0x9f8f87){return client[_0xddb1('0x8')](_0x19e788,_0x45069a)[_0xddb1('0x9')](function(_0x3598a4){logger['info'](_0xddb1('0xa'),_0xdbc1be,_0xddb1('0xb'));logger[_0xddb1('0xc')](_0xddb1('0xd'),_0xdbc1be,_0xddb1('0xb'),JSON[_0xddb1('0xe')](_0x3598a4));if(_0x3598a4[_0xddb1('0xf')]){if(_0x3598a4[_0xddb1('0xf')]['code']===0x1f4){logger[_0xddb1('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xdbc1be,_0x3598a4[_0xddb1('0xf')]['message']);return _0x9f8f87(_0x3598a4[_0xddb1('0xf')][_0xddb1('0x10')]);}logger[_0xddb1('0xf')](_0xddb1('0xa'),_0xdbc1be,_0x3598a4[_0xddb1('0xf')]['message']);return _0x7ef066(_0x3598a4[_0xddb1('0xf')][_0xddb1('0x10')]);}else{logger['info'](_0xddb1('0xa'),_0xdbc1be,_0xddb1('0xb'));_0x7ef066(_0x3598a4[_0xddb1('0x11')][_0xddb1('0x10')]);}})[_0xddb1('0x12')](function(_0x570025){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0xdbc1be,_0x570025);_0x9f8f87(_0x570025);});});}
\ No newline at end of file
index 039f941..ca9c13a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef51=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0xef51,0xce));var _0x1ef5=function(_0x52a8da,_0x5d9213){_0x52a8da=_0x52a8da-0x0;var _0x5e9460=_0xef51[_0x52a8da];return _0x5e9460;};'use strict';var multer=require(_0x1ef5('0x0'));var util=require(_0x1ef5('0x1'));var path=require(_0x1ef5('0x2'));var timeout=require(_0x1ef5('0x3'));var express=require('express');var router=express[_0x1ef5('0x4')]();var fs_extra=require(_0x1ef5('0x5'));var auth=require(_0x1ef5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ef5('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x1ef5('0x8')]('/',auth[_0x1ef5('0x9')](),controller[_0x1ef5('0xa')]);router[_0x1ef5('0x8')](_0x1ef5('0xb'),auth['isAuthenticated'](),controller[_0x1ef5('0xc')]);router[_0x1ef5('0x8')](_0x1ef5('0xd'),auth['isAuthenticated'](),controller[_0x1ef5('0xe')]);router[_0x1ef5('0xf')]('/',auth[_0x1ef5('0x9')](),controller[_0x1ef5('0x10')]);router[_0x1ef5('0x11')](_0x1ef5('0xb'),auth[_0x1ef5('0x9')](),controller[_0x1ef5('0x12')]);router['delete'](_0x1ef5('0xb'),auth[_0x1ef5('0x9')](),controller[_0x1ef5('0x13')]);module[_0x1ef5('0x14')]=router;
\ No newline at end of file
+var _0x0c96=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','/:id/download','download','post','create','put','/:id','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x418a35,_0x44ba22){var _0x2da4b7=function(_0x1f8832){while(--_0x1f8832){_0x418a35['push'](_0x418a35['shift']());}};_0x2da4b7(++_0x44ba22);}(_0x0c96,0x139));var _0x60c9=function(_0x5dcedb,_0x3e459e){_0x5dcedb=_0x5dcedb-0x0;var _0x264ca5=_0x0c96[_0x5dcedb];return _0x264ca5;};'use strict';var multer=require(_0x60c9('0x0'));var util=require(_0x60c9('0x1'));var path=require(_0x60c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x60c9('0x3'));var router=express[_0x60c9('0x4')]();var fs_extra=require(_0x60c9('0x5'));var auth=require(_0x60c9('0x6'));var interaction=require(_0x60c9('0x7'));var config=require(_0x60c9('0x8'));var controller=require(_0x60c9('0x9'));router['get']('/',auth[_0x60c9('0xa')](),controller['index']);router[_0x60c9('0xb')]('/:id',auth[_0x60c9('0xa')](),controller['show']);router[_0x60c9('0xb')](_0x60c9('0xc'),auth[_0x60c9('0xa')](),controller[_0x60c9('0xd')]);router[_0x60c9('0xe')]('/',auth[_0x60c9('0xa')](),controller[_0x60c9('0xf')]);router[_0x60c9('0x10')](_0x60c9('0x11'),auth[_0x60c9('0xa')](),controller[_0x60c9('0x12')]);router[_0x60c9('0x13')](_0x60c9('0x11'),auth[_0x60c9('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9549cb2..77d5fd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ca0=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x5ca0,0x117));var _0x05ca=function(_0x114289,_0x225a14){_0x114289=_0x114289-0x0;var _0x4ce627=_0x5ca0[_0x114289];return _0x4ce627;};'use strict';var Sequelize=require(_0x05ca('0x0'));module[_0x05ca('0x1')]={'field':{'type':Sequelize[_0x05ca('0x2')]},'alias':{'type':Sequelize[_0x05ca('0x3')]},'function':{'type':Sequelize[_0x05ca('0x3')]},'format':{'type':Sequelize[_0x05ca('0x3')]},'groupBy':{'type':Sequelize[_0x05ca('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x05ca('0x3')]},'custom':{'type':Sequelize[_0x05ca('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe4ee=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x555d72,_0x455679){var _0x73a8f1=function(_0x3c624){while(--_0x3c624){_0x555d72['push'](_0x555d72['shift']());}};_0x73a8f1(++_0x455679);}(_0xe4ee,0x76));var _0xee4e=function(_0x59fb72,_0x1177dc){_0x59fb72=_0x59fb72-0x0;var _0x3ff91c=_0xe4ee[_0x59fb72];return _0x3ff91c;};'use strict';var Sequelize=require(_0xee4e('0x0'));module[_0xee4e('0x1')]={'field':{'type':Sequelize[_0xee4e('0x2')]},'alias':{'type':Sequelize[_0xee4e('0x3')]},'function':{'type':Sequelize[_0xee4e('0x3')]},'format':{'type':Sequelize[_0xee4e('0x3')]},'groupBy':{'type':Sequelize[_0xee4e('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xee4e('0x3')]},'custom':{'type':Sequelize[_0xee4e('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 8b5826d..e75aab6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ebf=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','query','fields','sort','where','pick','merge','type','VIRTUAL','filter','options','include','rows','catch','show','params','length','includeAll','create','body','bulkCreate','find','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware'];(function(_0x23941d,_0x11f97e){var _0x4cc0d1=function(_0x414a4a){while(--_0x414a4a){_0x23941d['push'](_0x23941d['shift']());}};_0x4cc0d1(++_0x11f97e);}(_0x9ebf,0xe8));var _0xf9eb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9ebf[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf9eb('0x0'));var zipdir=require(_0xf9eb('0x1'));var jsonpatch=require(_0xf9eb('0x2'));var rp=require(_0xf9eb('0x3'));var moment=require(_0xf9eb('0x4'));var BPromise=require(_0xf9eb('0x5'));var Mustache=require(_0xf9eb('0x6'));var util=require(_0xf9eb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf9eb('0x8'));var ejs=require(_0xf9eb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9eb('0xa'));var squel=require('squel');var crypto=require(_0xf9eb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf9eb('0xc'));var toCsv=require(_0xf9eb('0x8'));var querystring=require(_0xf9eb('0xd'));var Papa=require(_0xf9eb('0xe'));var Redis=require(_0xf9eb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9eb('0x10'));var logger=require(_0xf9eb('0x11'))(_0xf9eb('0x12'));var utils=require(_0xf9eb('0x13'));var config=require(_0xf9eb('0x14'));var licenseUtil=require(_0xf9eb('0x15'));var db=require(_0xf9eb('0x16'))['db'];function respondWithStatusCode(_0x162475,_0x15d34e){_0x15d34e=_0x15d34e||0xcc;return function(_0xdb89a2){if(_0xdb89a2){return _0x162475[_0xf9eb('0x17')](_0x15d34e);}return _0x162475[_0xf9eb('0x18')](_0x15d34e)[_0xf9eb('0x19')]();};}function respondWithResult(_0x44237b,_0xb30e1f){_0xb30e1f=_0xb30e1f||0xc8;return function(_0x1ad9b9){if(_0x1ad9b9){return _0x44237b[_0xf9eb('0x18')](_0xb30e1f)[_0xf9eb('0x1a')](_0x1ad9b9);}};}function respondWithFilteredResult(_0x3ebf56,_0x59e0ce){return function(_0x4dcce1){if(_0x4dcce1){var _0x343cf8=typeof _0x59e0ce[_0xf9eb('0x1b')]==='undefined'&&typeof _0x59e0ce['limit']===_0xf9eb('0x1c');var _0x2b8dd6=_0x4dcce1[_0xf9eb('0x1d')];var _0x111760=_0x343cf8?0x0:_0x59e0ce[_0xf9eb('0x1b')];var _0x5d1c91=_0x343cf8?_0x4dcce1[_0xf9eb('0x1d')]:_0x59e0ce[_0xf9eb('0x1b')]+_0x59e0ce[_0xf9eb('0x1e')];var _0x47fa96;if(_0x5d1c91>=_0x2b8dd6){_0x5d1c91=_0x2b8dd6;_0x47fa96=0xc8;}else{_0x47fa96=0xce;}_0x3ebf56['status'](_0x47fa96);return _0x3ebf56[_0xf9eb('0x1f')](_0xf9eb('0x20'),_0x111760+'-'+_0x5d1c91+'/'+_0x2b8dd6)[_0xf9eb('0x1a')](_0x4dcce1);}return null;};}function patchUpdates(_0x166059){return function(_0x5da4d6){try{jsonpatch[_0xf9eb('0x21')](_0x5da4d6,_0x166059,!![]);}catch(_0x495640){return BPromise[_0xf9eb('0x22')](_0x495640);}return _0x5da4d6[_0xf9eb('0x23')]();};}function saveUpdates(_0x414e8e,_0x405f48){return function(_0x4c9f43){if(_0x4c9f43){return _0x4c9f43[_0xf9eb('0x24')](_0x414e8e)[_0xf9eb('0x25')](function(_0x15a854){return _0x15a854;});}return null;};}function removeEntity(_0x34077b,_0x2219de){return function(_0x213e63){if(_0x213e63){return _0x213e63[_0xf9eb('0x26')]()[_0xf9eb('0x25')](function(){_0x34077b[_0xf9eb('0x18')](0xcc)[_0xf9eb('0x19')]();});}};}function handleEntityNotFound(_0x2c230c,_0x534eb5){return function(_0x910622){if(!_0x910622){_0x2c230c['sendStatus'](0x194);}return _0x910622;};}function handleError(_0x196bc7,_0x477119){_0x477119=_0x477119||0x1f4;return function(_0x487e37){logger[_0xf9eb('0x27')](_0x487e37[_0xf9eb('0x28')]);if(_0x487e37[_0xf9eb('0x29')]){delete _0x487e37['name'];}_0x196bc7[_0xf9eb('0x18')](_0x477119)[_0xf9eb('0x2a')](_0x487e37);};}exports[_0xf9eb('0x2b')]=function(_0xa50b1c,_0x38853b){var _0x1d11a7={},_0x30107c={},_0x476f46={'count':0x0,'rows':[]};var _0x53f447=_[_0xf9eb('0x2c')](db[_0xf9eb('0x2d')][_0xf9eb('0x2e')],function(_0x27b0e0){return{'name':_0x27b0e0[_0xf9eb('0x2f')],'type':_0x27b0e0['type'][_0xf9eb('0x30')]};});_0x30107c['model']=_[_0xf9eb('0x2c')](_0x53f447,_0xf9eb('0x29'));_0x30107c['query']=_[_0xf9eb('0x31')](_0xa50b1c['query']);_0x30107c[_0xf9eb('0x32')]=_[_0xf9eb('0x33')](_0x30107c[_0xf9eb('0x34')],_0x30107c['query']);_0x1d11a7[_0xf9eb('0x35')]=_['intersection'](_0x30107c[_0xf9eb('0x34')],qs['fields'](_0xa50b1c[_0xf9eb('0x36')][_0xf9eb('0x37')]));_0x1d11a7[_0xf9eb('0x35')]=_0x1d11a7[_0xf9eb('0x35')]['length']?_0x1d11a7[_0xf9eb('0x35')]:_0x30107c['model'];if(!_0xa50b1c[_0xf9eb('0x36')]['hasOwnProperty']('nolimit')){_0x1d11a7[_0xf9eb('0x1e')]=qs[_0xf9eb('0x1e')](_0xa50b1c[_0xf9eb('0x36')]['limit']);_0x1d11a7[_0xf9eb('0x1b')]=qs[_0xf9eb('0x1b')](_0xa50b1c[_0xf9eb('0x36')]['offset']);}_0x1d11a7['order']=qs[_0xf9eb('0x38')](_0xa50b1c[_0xf9eb('0x36')][_0xf9eb('0x38')]);_0x1d11a7[_0xf9eb('0x39')]=qs[_0xf9eb('0x32')](_[_0xf9eb('0x3a')](_0xa50b1c[_0xf9eb('0x36')],_0x30107c[_0xf9eb('0x32')]),_0x53f447);if(_0xa50b1c[_0xf9eb('0x36')]['filter']){_0x1d11a7['where']=_[_0xf9eb('0x3b')](_0x1d11a7[_0xf9eb('0x39')],{'$or':_[_0xf9eb('0x2c')](_0x53f447,function(_0x3c0bdb){if(_0x3c0bdb[_0xf9eb('0x3c')]!==_0xf9eb('0x3d')){var _0x382a87={};_0x382a87[_0x3c0bdb[_0xf9eb('0x29')]]={'$like':'%'+_0xa50b1c[_0xf9eb('0x36')][_0xf9eb('0x3e')]+'%'};return _0x382a87;}})});}_0x1d11a7=_[_0xf9eb('0x3b')]({},_0x1d11a7,_0xa50b1c[_0xf9eb('0x3f')]);var _0x2aab9f={'where':_0x1d11a7['where']};return db[_0xf9eb('0x2d')]['count'](_0x2aab9f)[_0xf9eb('0x25')](function(_0x2d8a13){_0x476f46[_0xf9eb('0x1d')]=_0x2d8a13;if(_0xa50b1c[_0xf9eb('0x36')]['includeAll']){_0x1d11a7[_0xf9eb('0x40')]=[{'all':!![]}];}return db[_0xf9eb('0x2d')]['findAll'](_0x1d11a7);})[_0xf9eb('0x25')](function(_0x2c358e){_0x476f46[_0xf9eb('0x41')]=_0x2c358e;return _0x476f46;})[_0xf9eb('0x25')](respondWithFilteredResult(_0x38853b,_0x1d11a7))[_0xf9eb('0x42')](handleError(_0x38853b,null));};exports[_0xf9eb('0x43')]=function(_0x101f09,_0x828dee){var _0x287db0={'raw':![],'where':{'id':_0x101f09[_0xf9eb('0x44')]['id']}},_0x509afb={};_0x509afb[_0xf9eb('0x34')]=_[_0xf9eb('0x31')](db['AnalyticFieldReport']['rawAttributes']);_0x509afb[_0xf9eb('0x36')]=_[_0xf9eb('0x31')](_0x101f09[_0xf9eb('0x36')]);_0x509afb[_0xf9eb('0x32')]=_[_0xf9eb('0x33')](_0x509afb[_0xf9eb('0x34')],_0x509afb['query']);_0x287db0['attributes']=_['intersection'](_0x509afb['model'],qs[_0xf9eb('0x37')](_0x101f09['query']['fields']));_0x287db0[_0xf9eb('0x35')]=_0x287db0['attributes'][_0xf9eb('0x45')]?_0x287db0[_0xf9eb('0x35')]:_0x509afb['model'];if(_0x101f09[_0xf9eb('0x36')][_0xf9eb('0x46')]){_0x287db0[_0xf9eb('0x40')]=[{'all':!![]}];}_0x287db0=_[_0xf9eb('0x3b')]({},_0x287db0,_0x101f09[_0xf9eb('0x3f')]);return db[_0xf9eb('0x2d')]['find'](_0x287db0)[_0xf9eb('0x25')](handleEntityNotFound(_0x828dee,null))[_0xf9eb('0x25')](respondWithResult(_0x828dee,null))[_0xf9eb('0x42')](handleError(_0x828dee,null));};exports['create']=function(_0x523ab1,_0x46d4db){return db['AnalyticFieldReport'][_0xf9eb('0x47')](_0x523ab1[_0xf9eb('0x48')],{})[_0xf9eb('0x25')](respondWithResult(_0x46d4db,0xc9))['catch'](handleError(_0x46d4db,null));};exports[_0xf9eb('0x49')]=function(_0x37e491,_0x4c1708){return db[_0xf9eb('0x2d')]['bulkCreate'](_0x37e491[_0xf9eb('0x48')],{'raw':![],'individualHooks':!![]})[_0xf9eb('0x25')](respondWithResult(_0x4c1708,0xc9))['catch'](handleError(_0x4c1708,null));};exports[_0xf9eb('0x24')]=function(_0x505841,_0x184477){if(_0x505841['body']['id']){delete _0x505841[_0xf9eb('0x48')]['id'];}return db[_0xf9eb('0x2d')]['find']({'where':{'id':_0x505841[_0xf9eb('0x44')]['id']}})[_0xf9eb('0x25')](handleEntityNotFound(_0x184477,null))[_0xf9eb('0x25')](saveUpdates(_0x505841['body'],null))['then'](respondWithResult(_0x184477,null))[_0xf9eb('0x42')](handleError(_0x184477,null));};exports[_0xf9eb('0x26')]=function(_0x4fe127,_0x54c2f2){return db['AnalyticFieldReport'][_0xf9eb('0x4a')]({'where':{'id':_0x4fe127[_0xf9eb('0x44')]['id']}})[_0xf9eb('0x25')](handleEntityNotFound(_0x54c2f2,null))[_0xf9eb('0x25')](removeEntity(_0x54c2f2,null))['catch'](handleError(_0x54c2f2,null));};exports['bulkDestroy']=function(_0x2569e7,_0x178662){return db[_0xf9eb('0x2d')][_0xf9eb('0x26')]({'where':{'id':_0x2569e7[_0xf9eb('0x36')][_0xf9eb('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x178662,0xcc))['catch'](handleError(_0x178662,null));};exports[_0xf9eb('0x4c')]=function(_0x1c99d3,_0x2d08db,_0x481a60){return db[_0xf9eb('0x4d')][_0xf9eb('0x4e')]({'where':{'id':_0x1c99d3[_0xf9eb('0x44')]['id']}})[_0xf9eb('0x25')](handleEntityNotFound(_0x2d08db,null))[_0xf9eb('0x25')](function(_0x130cf2){if(_0x130cf2){return db[_0xf9eb('0x4f')][_0xf9eb('0x50')](function(_0x40fa68){return db['AnalyticFieldReport'][_0xf9eb('0x26')]({'where':{'CustomReportId':_0x1c99d3['params']['id']},'transaction':_0x40fa68})['then'](function(_0x121509){var _0x462c97=_[_0xf9eb('0x2c')](_0x1c99d3[_0xf9eb('0x48')],function(_0x34d033){delete _0x34d033['id'];_0x34d033[_0xf9eb('0x51')]=_0x1c99d3['params']['id'];return _0x34d033;});return db[_0xf9eb('0x2d')][_0xf9eb('0x49')](_0x462c97,{'transaction':_0x40fa68});});})[_0xf9eb('0x25')](function(){return db[_0xf9eb('0x2d')][_0xf9eb('0x52')]({'where':{'CustomReportId':_0x1c99d3[_0xf9eb('0x44')]['id']}});});}})['then'](respondWithResult(_0x2d08db,null))[_0xf9eb('0x42')](handleError(_0x2d08db,null));};
\ No newline at end of file
+var _0xe005=['AnalyticFieldReport','findAll','rows','catch','keys','includeAll','find','create','body','bulkCreate','params','destroy','bulkDestroy','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../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','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options'];(function(_0x3487a7,_0x14b3ff){var _0x260c62=function(_0x4aa9d2){while(--_0x4aa9d2){_0x3487a7['push'](_0x3487a7['shift']());}};_0x260c62(++_0x14b3ff);}(_0xe005,0x1d7));var _0x5e00=function(_0x46227e,_0x421fa2){_0x46227e=_0x46227e-0x0;var _0x5d0b8c=_0xe005[_0x46227e];return _0x5d0b8c;};'use strict';var emlformat=require(_0x5e00('0x0'));var rimraf=require(_0x5e00('0x1'));var zipdir=require(_0x5e00('0x2'));var jsonpatch=require(_0x5e00('0x3'));var rp=require(_0x5e00('0x4'));var moment=require(_0x5e00('0x5'));var BPromise=require(_0x5e00('0x6'));var Mustache=require('mustache');var util=require(_0x5e00('0x7'));var path=require(_0x5e00('0x8'));var sox=require(_0x5e00('0x9'));var csv=require(_0x5e00('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e00('0xb'));var _=require(_0x5e00('0xc'));var squel=require(_0x5e00('0xd'));var crypto=require(_0x5e00('0xe'));var jsforce=require(_0x5e00('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5e00('0xa'));var querystring=require(_0x5e00('0x10'));var Papa=require(_0x5e00('0x11'));var Redis=require(_0x5e00('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e00('0x13'));var logger=require(_0x5e00('0x14'))('api');var utils=require(_0x5e00('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5e00('0x16'));var db=require(_0x5e00('0x17'))['db'];function respondWithStatusCode(_0x412096,_0x457269){_0x457269=_0x457269||0xcc;return function(_0x1f05ca){if(_0x1f05ca){return _0x412096[_0x5e00('0x18')](_0x457269);}return _0x412096[_0x5e00('0x19')](_0x457269)[_0x5e00('0x1a')]();};}function respondWithResult(_0x41772c,_0x675c28){_0x675c28=_0x675c28||0xc8;return function(_0x5db29f){if(_0x5db29f){return _0x41772c[_0x5e00('0x19')](_0x675c28)[_0x5e00('0x1b')](_0x5db29f);}};}function respondWithFilteredResult(_0x19d11d,_0x2f7f17){return function(_0x150c29){if(_0x150c29){var _0x7a2f90=typeof _0x2f7f17[_0x5e00('0x1c')]===_0x5e00('0x1d')&&typeof _0x2f7f17[_0x5e00('0x1e')]==='undefined';var _0x362d46=_0x150c29[_0x5e00('0x1f')];var _0x5810a6=_0x7a2f90?0x0:_0x2f7f17['offset'];var _0x34850f=_0x7a2f90?_0x150c29[_0x5e00('0x1f')]:_0x2f7f17[_0x5e00('0x1c')]+_0x2f7f17['limit'];var _0x241241;if(_0x34850f>=_0x362d46){_0x34850f=_0x362d46;_0x241241=0xc8;}else{_0x241241=0xce;}_0x19d11d[_0x5e00('0x19')](_0x241241);return _0x19d11d[_0x5e00('0x20')](_0x5e00('0x21'),_0x5810a6+'-'+_0x34850f+'/'+_0x362d46)['json'](_0x150c29);}return null;};}function patchUpdates(_0x7a9444){return function(_0x1eecfc){try{jsonpatch[_0x5e00('0x22')](_0x1eecfc,_0x7a9444,!![]);}catch(_0x560e91){return BPromise['reject'](_0x560e91);}return _0x1eecfc[_0x5e00('0x23')]();};}function saveUpdates(_0x21afee,_0x4e254f){return function(_0x3502c3){if(_0x3502c3){return _0x3502c3[_0x5e00('0x24')](_0x21afee)[_0x5e00('0x25')](function(_0x624fed){return _0x624fed;});}return null;};}function removeEntity(_0x3ac4fc,_0x31f72f){return function(_0x1a8cb9){if(_0x1a8cb9){return _0x1a8cb9['destroy']()[_0x5e00('0x25')](function(){_0x3ac4fc[_0x5e00('0x19')](0xcc)[_0x5e00('0x1a')]();});}};}function handleEntityNotFound(_0x53fcdc,_0x343bf3){return function(_0x396126){if(!_0x396126){_0x53fcdc[_0x5e00('0x18')](0x194);}return _0x396126;};}function handleError(_0x4178d4,_0x164f6b){_0x164f6b=_0x164f6b||0x1f4;return function(_0x587444){logger['error'](_0x587444['stack']);if(_0x587444[_0x5e00('0x26')]){delete _0x587444[_0x5e00('0x26')];}_0x4178d4['status'](_0x164f6b)[_0x5e00('0x27')](_0x587444);};}exports[_0x5e00('0x28')]=function(_0x176d63,_0x3c15a2){var _0x255871={},_0x44bbee={},_0x2fe829={'count':0x0,'rows':[]};var _0x11d26d=_[_0x5e00('0x29')](db['AnalyticFieldReport'][_0x5e00('0x2a')],function(_0x2e359b){return{'name':_0x2e359b[_0x5e00('0x2b')],'type':_0x2e359b[_0x5e00('0x2c')][_0x5e00('0x2d')]};});_0x44bbee[_0x5e00('0x2e')]=_[_0x5e00('0x29')](_0x11d26d,'name');_0x44bbee['query']=_['keys'](_0x176d63[_0x5e00('0x2f')]);_0x44bbee[_0x5e00('0x30')]=_['intersection'](_0x44bbee[_0x5e00('0x2e')],_0x44bbee[_0x5e00('0x2f')]);_0x255871[_0x5e00('0x31')]=_[_0x5e00('0x32')](_0x44bbee[_0x5e00('0x2e')],qs[_0x5e00('0x33')](_0x176d63[_0x5e00('0x2f')][_0x5e00('0x33')]));_0x255871[_0x5e00('0x31')]=_0x255871[_0x5e00('0x31')][_0x5e00('0x34')]?_0x255871[_0x5e00('0x31')]:_0x44bbee[_0x5e00('0x2e')];if(!_0x176d63[_0x5e00('0x2f')][_0x5e00('0x35')]('nolimit')){_0x255871[_0x5e00('0x1e')]=qs['limit'](_0x176d63[_0x5e00('0x2f')][_0x5e00('0x1e')]);_0x255871[_0x5e00('0x1c')]=qs[_0x5e00('0x1c')](_0x176d63['query'][_0x5e00('0x1c')]);}_0x255871[_0x5e00('0x36')]=qs[_0x5e00('0x37')](_0x176d63[_0x5e00('0x2f')][_0x5e00('0x37')]);_0x255871[_0x5e00('0x38')]=qs[_0x5e00('0x30')](_[_0x5e00('0x39')](_0x176d63['query'],_0x44bbee['filters']),_0x11d26d);if(_0x176d63[_0x5e00('0x2f')]['filter']){_0x255871[_0x5e00('0x38')]=_['merge'](_0x255871[_0x5e00('0x38')],{'$or':_[_0x5e00('0x29')](_0x11d26d,function(_0x584a13){if(_0x584a13[_0x5e00('0x2c')]!==_0x5e00('0x3a')){var _0x50f3cb={};_0x50f3cb[_0x584a13['name']]={'$like':'%'+_0x176d63[_0x5e00('0x2f')]['filter']+'%'};return _0x50f3cb;}})});}_0x255871=_[_0x5e00('0x3b')]({},_0x255871,_0x176d63[_0x5e00('0x3c')]);var _0x16cd4f={'where':_0x255871[_0x5e00('0x38')]};return db[_0x5e00('0x3d')][_0x5e00('0x1f')](_0x16cd4f)[_0x5e00('0x25')](function(_0x1a110b){_0x2fe829['count']=_0x1a110b;if(_0x176d63[_0x5e00('0x2f')]['includeAll']){_0x255871['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x5e00('0x3e')](_0x255871);})[_0x5e00('0x25')](function(_0xb8aa59){_0x2fe829[_0x5e00('0x3f')]=_0xb8aa59;return _0x2fe829;})[_0x5e00('0x25')](respondWithFilteredResult(_0x3c15a2,_0x255871))[_0x5e00('0x40')](handleError(_0x3c15a2,null));};exports['show']=function(_0x110092,_0x3287a2){var _0x2b7211={'raw':![],'where':{'id':_0x110092['params']['id']}},_0x180411={};_0x180411[_0x5e00('0x2e')]=_[_0x5e00('0x41')](db[_0x5e00('0x3d')]['rawAttributes']);_0x180411['query']=_['keys'](_0x110092['query']);_0x180411[_0x5e00('0x30')]=_[_0x5e00('0x32')](_0x180411['model'],_0x180411[_0x5e00('0x2f')]);_0x2b7211[_0x5e00('0x31')]=_['intersection'](_0x180411['model'],qs[_0x5e00('0x33')](_0x110092[_0x5e00('0x2f')]['fields']));_0x2b7211[_0x5e00('0x31')]=_0x2b7211[_0x5e00('0x31')]['length']?_0x2b7211[_0x5e00('0x31')]:_0x180411[_0x5e00('0x2e')];if(_0x110092[_0x5e00('0x2f')][_0x5e00('0x42')]){_0x2b7211['include']=[{'all':!![]}];}_0x2b7211=_[_0x5e00('0x3b')]({},_0x2b7211,_0x110092[_0x5e00('0x3c')]);return db[_0x5e00('0x3d')][_0x5e00('0x43')](_0x2b7211)['then'](handleEntityNotFound(_0x3287a2,null))[_0x5e00('0x25')](respondWithResult(_0x3287a2,null))[_0x5e00('0x40')](handleError(_0x3287a2,null));};exports['create']=function(_0x5d5f84,_0x1e75a7){return db['AnalyticFieldReport'][_0x5e00('0x44')](_0x5d5f84[_0x5e00('0x45')],{})[_0x5e00('0x25')](respondWithResult(_0x1e75a7,0xc9))['catch'](handleError(_0x1e75a7,null));};exports['bulkCreate']=function(_0x1b0321,_0x4a96db){return db['AnalyticFieldReport'][_0x5e00('0x46')](_0x1b0321[_0x5e00('0x45')],{'raw':![],'individualHooks':!![]})[_0x5e00('0x25')](respondWithResult(_0x4a96db,0xc9))[_0x5e00('0x40')](handleError(_0x4a96db,null));};exports[_0x5e00('0x24')]=function(_0x32a936,_0x499400){if(_0x32a936[_0x5e00('0x45')]['id']){delete _0x32a936['body']['id'];}return db[_0x5e00('0x3d')][_0x5e00('0x43')]({'where':{'id':_0x32a936[_0x5e00('0x47')]['id']}})[_0x5e00('0x25')](handleEntityNotFound(_0x499400,null))[_0x5e00('0x25')](saveUpdates(_0x32a936[_0x5e00('0x45')],null))[_0x5e00('0x25')](respondWithResult(_0x499400,null))['catch'](handleError(_0x499400,null));};exports[_0x5e00('0x48')]=function(_0x36cad6,_0x3eef83){return db[_0x5e00('0x3d')]['find']({'where':{'id':_0x36cad6['params']['id']}})[_0x5e00('0x25')](handleEntityNotFound(_0x3eef83,null))['then'](removeEntity(_0x3eef83,null))['catch'](handleError(_0x3eef83,null));};exports[_0x5e00('0x49')]=function(_0x4bb4e5,_0x340ce3){return db['AnalyticFieldReport'][_0x5e00('0x48')]({'where':{'id':_0x4bb4e5[_0x5e00('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x5e00('0x25')](respondWithResult(_0x340ce3,0xcc))[_0x5e00('0x40')](handleError(_0x340ce3,null));};exports['addFields']=function(_0x4af268,_0x74bda9,_0x3edc04){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4af268[_0x5e00('0x47')]['id']}})[_0x5e00('0x25')](handleEntityNotFound(_0x74bda9,null))[_0x5e00('0x25')](function(_0x2142eb){if(_0x2142eb){return db[_0x5e00('0x4a')]['transaction'](function(_0x56cc0b){return db[_0x5e00('0x3d')][_0x5e00('0x48')]({'where':{'CustomReportId':_0x4af268[_0x5e00('0x47')]['id']},'transaction':_0x56cc0b})[_0x5e00('0x25')](function(_0x166dcb){var _0x2e2880=_[_0x5e00('0x29')](_0x4af268[_0x5e00('0x45')],function(_0x1aff76){delete _0x1aff76['id'];_0x1aff76[_0x5e00('0x4b')]=_0x4af268[_0x5e00('0x47')]['id'];return _0x1aff76;});return db[_0x5e00('0x3d')]['bulkCreate'](_0x2e2880,{'transaction':_0x56cc0b});});})[_0x5e00('0x25')](function(){return db[_0x5e00('0x3d')][_0x5e00('0x3e')]({'where':{'CustomReportId':_0x4af268[_0x5e00('0x47')]['id']}});});}})['then'](respondWithResult(_0x74bda9,null))[_0x5e00('0x40')](handleError(_0x74bda9,null));};
\ No newline at end of file
index 3126727..e85370a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65dd=['AnalyticFieldReport','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x287826,_0x23f22f){var _0x2fe2ee=function(_0x47f13){while(--_0x47f13){_0x287826['push'](_0x287826['shift']());}};_0x2fe2ee(++_0x23f22f);}(_0x65dd,0x133));var _0xd65d=function(_0x21923b,_0x44380f){_0x21923b=_0x21923b-0x0;var _0x3ff466=_0x65dd[_0x21923b];return _0x3ff466;};'use strict';var _=require(_0xd65d('0x0'));var util=require('util');var logger=require(_0xd65d('0x1'))(_0xd65d('0x2'));var moment=require('moment');var BPromise=require(_0xd65d('0x3'));var rp=require(_0xd65d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd65d('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0xd65d('0x6')]=function(_0x52610a,_0x3f5833){return _0x52610a[_0xd65d('0x7')](_0xd65d('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c3d=['define','AnalyticFieldReport','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0xf8ddb5,_0x59c968){var _0x489892=function(_0x1fcc3e){while(--_0x1fcc3e){_0xf8ddb5['push'](_0xf8ddb5['shift']());}};_0x489892(++_0x59c968);}(_0x3c3d,0x199));var _0xd3c3=function(_0x494452,_0x5b9635){_0x494452=_0x494452-0x0;var _0x456e08=_0x3c3d[_0x494452];return _0x456e08;};'use strict';var _=require(_0xd3c3('0x0'));var util=require('util');var logger=require(_0xd3c3('0x1'))(_0xd3c3('0x2'));var moment=require(_0xd3c3('0x3'));var BPromise=require('bluebird');var rp=require(_0xd3c3('0x4'));var fs=require('fs');var path=require(_0xd3c3('0x5'));var rimraf=require(_0xd3c3('0x6'));var config=require(_0xd3c3('0x7'));var attributes=require(_0xd3c3('0x8'));module['exports']=function(_0x5915f5,_0x562309){return _0x5915f5[_0xd3c3('0x9')](_0xd3c3('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8cf591d..1f28b2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff4b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5dc68d,_0x2b65aa){var _0x40baf5=function(_0x27436c){while(--_0x27436c){_0x5dc68d['push'](_0x5dc68d['shift']());}};_0x40baf5(++_0x2b65aa);}(_0xff4b,0x179));var _0xbff4=function(_0x42caaf,_0x29a7ac){_0x42caaf=_0x42caaf-0x0;var _0x271b0d=_0xff4b[_0x42caaf];return _0x271b0d;};'use strict';var _=require(_0xbff4('0x0'));var util=require(_0xbff4('0x1'));var moment=require(_0xbff4('0x2'));var BPromise=require(_0xbff4('0x3'));var rs=require(_0xbff4('0x4'));var fs=require('fs');var Redis=require(_0xbff4('0x5'));var db=require(_0xbff4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbff4('0x7'));var config=require(_0xbff4('0x8'));var jayson=require(_0xbff4('0x9'));var client=jayson[_0xbff4('0xa')][_0xbff4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x372579,_0x4cd95f,_0x8228bd){return new BPromise(function(_0x5befc3,_0x16c249){return client[_0xbff4('0xc')](_0x372579,_0x8228bd)[_0xbff4('0xd')](function(_0x46c8cb){logger[_0xbff4('0xe')](_0xbff4('0xf'),_0x4cd95f,_0xbff4('0x10'));logger[_0xbff4('0x11')](_0xbff4('0x12'),_0x4cd95f,_0xbff4('0x10'),JSON[_0xbff4('0x13')](_0x46c8cb));if(_0x46c8cb[_0xbff4('0x14')]){if(_0x46c8cb[_0xbff4('0x14')][_0xbff4('0x15')]===0x1f4){logger['error'](_0xbff4('0xf'),_0x4cd95f,_0x46c8cb[_0xbff4('0x14')][_0xbff4('0x16')]);return _0x16c249(_0x46c8cb[_0xbff4('0x14')][_0xbff4('0x16')]);}logger[_0xbff4('0x14')](_0xbff4('0xf'),_0x4cd95f,_0x46c8cb[_0xbff4('0x14')][_0xbff4('0x16')]);return _0x5befc3(_0x46c8cb[_0xbff4('0x14')][_0xbff4('0x16')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4cd95f,'request\x20sent');_0x5befc3(_0x46c8cb[_0xbff4('0x17')][_0xbff4('0x16')]);}})['catch'](function(_0x206532){logger[_0xbff4('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4cd95f,_0x206532);_0x16c249(_0x206532);});});}
\ No newline at end of file
+var _0x40df=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x40df,0x76));var _0xf40d=function(_0x277484,_0x5913b3){_0x277484=_0x277484-0x0;var _0x543e30=_0x40df[_0x277484];return _0x543e30;};'use strict';var _=require(_0xf40d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf40d('0x1'));var rs=require(_0xf40d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf40d('0x3'))['db'];var utils=require(_0xf40d('0x4'));var logger=require('../../config/logger')(_0xf40d('0x5'));var config=require('../../config/environment');var jayson=require(_0xf40d('0x6'));var client=jayson[_0xf40d('0x7')][_0xf40d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31122e,_0x41966f,_0x5f1db7){return new BPromise(function(_0x4cd417,_0x13c01d){return client[_0xf40d('0x9')](_0x31122e,_0x5f1db7)[_0xf40d('0xa')](function(_0x4eeefa){logger[_0xf40d('0xb')](_0xf40d('0xc'),_0x41966f,_0xf40d('0xd'));logger['debug'](_0xf40d('0xe'),_0x41966f,'request\x20sent',JSON['stringify'](_0x4eeefa));if(_0x4eeefa[_0xf40d('0xf')]){if(_0x4eeefa[_0xf40d('0xf')][_0xf40d('0x10')]===0x1f4){logger[_0xf40d('0xf')](_0xf40d('0xc'),_0x41966f,_0x4eeefa[_0xf40d('0xf')][_0xf40d('0x11')]);return _0x13c01d(_0x4eeefa['error'][_0xf40d('0x11')]);}logger[_0xf40d('0xf')](_0xf40d('0xc'),_0x41966f,_0x4eeefa['error']['message']);return _0x4cd417(_0x4eeefa[_0xf40d('0xf')][_0xf40d('0x11')]);}else{logger[_0xf40d('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x41966f,_0xf40d('0xd'));_0x4cd417(_0x4eeefa[_0xf40d('0x12')][_0xf40d('0x11')]);}})[_0xf40d('0x13')](function(_0x36d4b9){logger['error'](_0xf40d('0xc'),_0x41966f,_0x36d4b9);_0x13c01d(_0x36d4b9);});});}
\ No newline at end of file
index 6ec99dd..1bef9c9 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(_0x1d036c,_0x6daed8){var _0x338516=function(_0x25cd4f){while(--_0x25cd4f){_0x1d036c['push'](_0x1d036c['shift']());}};_0x338516(++_0x6daed8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x1b2f20,_0x9e723b){var _0x2294f4=function(_0x1041a6){while(--_0x1041a6){_0x1b2f20['push'](_0x1b2f20['shift']());}};_0x2294f4(++_0x9e723b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 7c6c7a2..261a469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ae2=['STRING','name','TEXT','sequelize','exports'];(function(_0x1546a6,_0x2fb9c1){var _0x31c034=function(_0x3f8ee7){while(--_0x3f8ee7){_0x1546a6['push'](_0x1546a6['shift']());}};_0x31c034(++_0x2fb9c1);}(_0x6ae2,0x1ed));var _0x26ae=function(_0xd8b4f,_0x3fe442){_0xd8b4f=_0xd8b4f-0x0;var _0x172698=_0x6ae2[_0xd8b4f];return _0x172698;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'name':{'type':Sequelize[_0x26ae('0x2')],'allowNull':![],'unique':_0x26ae('0x3')},'table':{'type':Sequelize[_0x26ae('0x2')]},'metric':{'type':Sequelize[_0x26ae('0x4')]},'description':{'type':Sequelize[_0x26ae('0x2')]}};
\ No newline at end of file
+var _0x2547=['TEXT','exports','STRING','name'];(function(_0x464b16,_0x654a40){var _0x3e1364=function(_0x1e82ff){while(--_0x1e82ff){_0x464b16['push'](_0x464b16['shift']());}};_0x3e1364(++_0x654a40);}(_0x2547,0x1cd));var _0x7254=function(_0x34459c,_0x5d0a99){_0x34459c=_0x34459c-0x0;var _0x57c2bd=_0x2547[_0x34459c];return _0x57c2bd;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'name':{'type':Sequelize[_0x7254('0x1')],'allowNull':![],'unique':_0x7254('0x2')},'table':{'type':Sequelize[_0x7254('0x1')]},'metric':{'type':Sequelize[_0x7254('0x3')]},'description':{'type':Sequelize[_0x7254('0x1')]}};
\ No newline at end of file
index 2c5c7c3..9c8c6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x13b895,_0x3fa462){var _0x50736f=function(_0x439b39){while(--_0x439b39){_0x13b895['push'](_0x13b895['shift']());}};_0x50736f(++_0x3fa462);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4080dd,_0x5b595d){_0x4080dd=_0x4080dd-0x0;var _0x4ecf85=_0x7fbe[_0x4080dd];return _0x4ecf85;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0x9957=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
index 3c87fb0..6748b9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7163=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0x7163,0x1ef));var _0x3716=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x7163[_0x237546];return _0x233e29;};'use strict';var _=require(_0x3716('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3716('0x1'));var moment=require(_0x3716('0x2'));var BPromise=require(_0x3716('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3716('0x4'));var rimraf=require(_0x3716('0x5'));var config=require(_0x3716('0x6'));var attributes=require(_0x3716('0x7'));module['exports']=function(_0x5c81bb,_0x3112a7){return _0x5c81bb[_0x3716('0x8')](_0x3716('0x9'),attributes,{'tableName':_0x3716('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7be=['analytics_metrics','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','AnalyticMetric'];(function(_0x7e918f,_0x48cf10){var _0x5b35ab=function(_0x1455be){while(--_0x1455be){_0x7e918f['push'](_0x7e918f['shift']());}};_0x5b35ab(++_0x48cf10);}(_0xa7be,0xfd));var _0xea7b=function(_0x162fc8,_0x24b36d){_0x162fc8=_0x162fc8-0x0;var _0xd23648=_0xa7be[_0x162fc8];return _0xd23648;};'use strict';var _=require(_0xea7b('0x0'));var util=require(_0xea7b('0x1'));var logger=require(_0xea7b('0x2'))(_0xea7b('0x3'));var moment=require(_0xea7b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xea7b('0x5'));var rimraf=require(_0xea7b('0x6'));var config=require(_0xea7b('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xea7b('0x8')]=function(_0x1bf6cb,_0x3078c9){return _0x1bf6cb[_0xea7b('0x9')](_0xea7b('0xa'),attributes,{'tableName':_0xea7b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f001759..f2fcd43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe755=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x1e8982,_0x37bfc7){var _0x115066=function(_0x202cb1){while(--_0x202cb1){_0x1e8982['push'](_0x1e8982['shift']());}};_0x115066(++_0x37bfc7);}(_0xe755,0x74));var _0x5e75=function(_0x2779f8,_0x551b6e){_0x2779f8=_0x2779f8-0x0;var _0x3ebaf1=_0xe755[_0x2779f8];return _0x3ebaf1;};'use strict';var _=require(_0x5e75('0x0'));var util=require('util');var moment=require(_0x5e75('0x1'));var BPromise=require(_0x5e75('0x2'));var rs=require(_0x5e75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5e75('0x4'));var logger=require(_0x5e75('0x5'))('rpc');var config=require(_0x5e75('0x6'));var jayson=require(_0x5e75('0x7'));var client=jayson[_0x5e75('0x8')][_0x5e75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x414cbe,_0x2ee7b9,_0x208363){return new BPromise(function(_0x2dce87,_0x518194){return client['request'](_0x414cbe,_0x208363)[_0x5e75('0xa')](function(_0x311664){logger[_0x5e75('0xb')](_0x5e75('0xc'),_0x2ee7b9,_0x5e75('0xd'));logger['debug'](_0x5e75('0xe'),_0x2ee7b9,'request\x20sent',JSON[_0x5e75('0xf')](_0x311664));if(_0x311664['error']){if(_0x311664[_0x5e75('0x10')][_0x5e75('0x11')]===0x1f4){logger[_0x5e75('0x10')](_0x5e75('0xc'),_0x2ee7b9,_0x311664[_0x5e75('0x10')][_0x5e75('0x12')]);return _0x518194(_0x311664[_0x5e75('0x10')][_0x5e75('0x12')]);}logger[_0x5e75('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x2ee7b9,_0x311664[_0x5e75('0x10')][_0x5e75('0x12')]);return _0x2dce87(_0x311664[_0x5e75('0x10')][_0x5e75('0x12')]);}else{logger[_0x5e75('0xb')](_0x5e75('0xc'),_0x2ee7b9,_0x5e75('0xd'));_0x2dce87(_0x311664[_0x5e75('0x13')][_0x5e75('0x12')]);}})['catch'](function(_0x3ed349){logger[_0x5e75('0x10')](_0x5e75('0xc'),_0x2ee7b9,_0x3ed349);_0x518194(_0x3ed349);});});}
\ No newline at end of file
+var _0x4833=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x5a4747,_0x12566a){var _0x1d2ebd=function(_0x507b4d){while(--_0x507b4d){_0x5a4747['push'](_0x5a4747['shift']());}};_0x1d2ebd(++_0x12566a);}(_0x4833,0xd4));var _0x3483=function(_0x383552,_0x5db2de){_0x383552=_0x383552-0x0;var _0x338ff7=_0x4833[_0x383552];return _0x338ff7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3483('0x0'));var BPromise=require(_0x3483('0x1'));var rs=require(_0x3483('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3483('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3483('0x4'))(_0x3483('0x5'));var config=require(_0x3483('0x6'));var jayson=require(_0x3483('0x7'));var client=jayson[_0x3483('0x8')][_0x3483('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x252a9b,_0x56893c,_0x477f63){return new BPromise(function(_0x31a8f1,_0x104909){return client[_0x3483('0xa')](_0x252a9b,_0x477f63)[_0x3483('0xb')](function(_0x28d65f){logger['info'](_0x3483('0xc'),_0x56893c,_0x3483('0xd'));logger[_0x3483('0xe')](_0x3483('0xf'),_0x56893c,'request\x20sent',JSON['stringify'](_0x28d65f));if(_0x28d65f[_0x3483('0x10')]){if(_0x28d65f[_0x3483('0x10')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x56893c,_0x28d65f['error']['message']);return _0x104909(_0x28d65f[_0x3483('0x10')][_0x3483('0x11')]);}logger[_0x3483('0x10')](_0x3483('0xc'),_0x56893c,_0x28d65f[_0x3483('0x10')][_0x3483('0x11')]);return _0x31a8f1(_0x28d65f[_0x3483('0x10')][_0x3483('0x11')]);}else{logger[_0x3483('0x12')](_0x3483('0xc'),_0x56893c,'request\x20sent');_0x31a8f1(_0x28d65f[_0x3483('0x13')][_0x3483('0x11')]);}})[_0x3483('0x14')](function(_0x3677e1){logger[_0x3483('0x10')](_0x3483('0xc'),_0x56893c,_0x3677e1);_0x104909(_0x3677e1);});});}
\ No newline at end of file
index 1da16f5..c3632ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0c9=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','post','put','update','delete'];(function(_0x246876,_0x1541b5){var _0x5d6f16=function(_0x4ddeea){while(--_0x4ddeea){_0x246876['push'](_0x246876['shift']());}};_0x5d6f16(++_0x1541b5);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xd0c9[_0x307d86];return _0x361745;};'use strict';var multer=require(_0x9d0c('0x0'));var util=require(_0x9d0c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9d0c('0x2')]();var fs_extra=require(_0x9d0c('0x3'));var auth=require(_0x9d0c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9d0c('0x5'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x9d0c('0x6')](),controller['index']);router[_0x9d0c('0x7')](_0x9d0c('0x8'),auth[_0x9d0c('0x6')](),controller[_0x9d0c('0x9')]);router[_0x9d0c('0xa')]('/',auth[_0x9d0c('0x6')](),controller['create']);router[_0x9d0c('0xb')]('/:id',auth[_0x9d0c('0x6')](),controller[_0x9d0c('0xc')]);router[_0x9d0c('0xd')]('/:id',auth[_0x9d0c('0x6')](),controller[_0x9d0c('0xe')]);module[_0x9d0c('0xf')]=router;
\ No newline at end of file
+var _0x0738=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x50ff7b,_0x7c8e9d){var _0x26ba29=function(_0x35f895){while(--_0x35f895){_0x50ff7b['push'](_0x50ff7b['shift']());}};_0x26ba29(++_0x7c8e9d);}(_0x0738,0x6e));var _0x8073=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0x0738[_0x573c9e];return _0x5d0714;};'use strict';var multer=require(_0x8073('0x0'));var util=require('util');var path=require(_0x8073('0x1'));var timeout=require(_0x8073('0x2'));var express=require(_0x8073('0x3'));var router=express[_0x8073('0x4')]();var fs_extra=require(_0x8073('0x5'));var auth=require(_0x8073('0x6'));var interaction=require(_0x8073('0x7'));var config=require(_0x8073('0x8'));var controller=require(_0x8073('0x9'));router[_0x8073('0xa')]('/',auth[_0x8073('0xb')](),controller['index']);router[_0x8073('0xa')](_0x8073('0xc'),auth[_0x8073('0xb')](),controller[_0x8073('0xd')]);router[_0x8073('0xe')]('/',auth[_0x8073('0xb')](),controller[_0x8073('0xf')]);router[_0x8073('0x10')](_0x8073('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8073('0x11')](_0x8073('0xc'),auth[_0x8073('0xb')](),controller[_0x8073('0x12')]);module['exports']=router;
\ No newline at end of file
index 449ac20..e35bff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc39c=['exports','TEXT'];(function(_0x47ba51,_0x3d6b8e){var _0x465cb7=function(_0x5f3dcc){while(--_0x5f3dcc){_0x47ba51['push'](_0x47ba51['shift']());}};_0x465cb7(++_0x3d6b8e);}(_0xc39c,0x13a));var _0xcc39=function(_0x59ee64,_0x44b92e){_0x59ee64=_0x59ee64-0x0;var _0x39897a=_0xc39c[_0x59ee64];return _0x39897a;};'use strict';var Sequelize=require('sequelize');module[_0xcc39('0x0')]={'tree':{'type':Sequelize[_0xcc39('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x3b54=['sequelize','exports'];(function(_0x129696,_0x166fc4){var _0x2ea919=function(_0x507224){while(--_0x507224){_0x129696['push'](_0x129696['shift']());}};_0x2ea919(++_0x166fc4);}(_0x3b54,0xae));var _0x43b5=function(_0x4e7551,_0x398ee5){_0x4e7551=_0x4e7551-0x0;var _0x2c2ae8=_0x3b54[_0x4e7551];return _0x2c2ae8;};'use strict';var Sequelize=require(_0x43b5('0x0'));module[_0x43b5('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
index 73f0384..2596c75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2ff=['intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','squel','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','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','query','keys','filters'];(function(_0x3dac28,_0x345de7){var _0x139e69=function(_0x280912){while(--_0x280912){_0x3dac28['push'](_0x3dac28['shift']());}};_0x139e69(++_0x345de7);}(_0xc2ff,0x17f));var _0xfc2f=function(_0x250bfb,_0x183c55){_0x250bfb=_0x250bfb-0x0;var _0x2fa5d0=_0xc2ff[_0x250bfb];return _0x2fa5d0;};'use strict';var emlformat=require(_0xfc2f('0x0'));var rimraf=require(_0xfc2f('0x1'));var zipdir=require(_0xfc2f('0x2'));var jsonpatch=require(_0xfc2f('0x3'));var rp=require(_0xfc2f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfc2f('0x5'));var path=require(_0xfc2f('0x6'));var sox=require('sox');var csv=require(_0xfc2f('0x7'));var ejs=require(_0xfc2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc2f('0x9'));var crypto=require(_0xfc2f('0xa'));var jsforce=require(_0xfc2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfc2f('0x7'));var querystring=require(_0xfc2f('0xc'));var Papa=require(_0xfc2f('0xd'));var Redis=require('ioredis');var authService=require(_0xfc2f('0xe'));var qs=require(_0xfc2f('0xf'));var as=require(_0xfc2f('0x10'));var hardwareService=require(_0xfc2f('0x11'));var logger=require(_0xfc2f('0x12'))(_0xfc2f('0x13'));var utils=require(_0xfc2f('0x14'));var config=require(_0xfc2f('0x15'));var licenseUtil=require(_0xfc2f('0x16'));var db=require(_0xfc2f('0x17'))['db'];function respondWithStatusCode(_0x4214f6,_0x170147){_0x170147=_0x170147||0xcc;return function(_0x4f2cd2){if(_0x4f2cd2){return _0x4214f6['sendStatus'](_0x170147);}return _0x4214f6['status'](_0x170147)[_0xfc2f('0x18')]();};}function respondWithResult(_0x2ae9f5,_0x3f9e68){_0x3f9e68=_0x3f9e68||0xc8;return function(_0x105ccd){if(_0x105ccd){return _0x2ae9f5[_0xfc2f('0x19')](_0x3f9e68)[_0xfc2f('0x1a')](_0x105ccd);}};}function respondWithFilteredResult(_0x23cb63,_0x417056){return function(_0x3e3561){if(_0x3e3561){var _0xd61801=typeof _0x417056[_0xfc2f('0x1b')]===_0xfc2f('0x1c')&&typeof _0x417056[_0xfc2f('0x1d')]==='undefined';var _0x14c25b=_0x3e3561[_0xfc2f('0x1e')];var _0xd37943=_0xd61801?0x0:_0x417056[_0xfc2f('0x1b')];var _0xfff4ac=_0xd61801?_0x3e3561['count']:_0x417056['offset']+_0x417056[_0xfc2f('0x1d')];var _0x44fd64;if(_0xfff4ac>=_0x14c25b){_0xfff4ac=_0x14c25b;_0x44fd64=0xc8;}else{_0x44fd64=0xce;}_0x23cb63[_0xfc2f('0x19')](_0x44fd64);return _0x23cb63[_0xfc2f('0x1f')](_0xfc2f('0x20'),_0xd37943+'-'+_0xfff4ac+'/'+_0x14c25b)[_0xfc2f('0x1a')](_0x3e3561);}return null;};}function patchUpdates(_0x936be1){return function(_0x48c086){try{jsonpatch[_0xfc2f('0x21')](_0x48c086,_0x936be1,!![]);}catch(_0x46fc7b){return BPromise[_0xfc2f('0x22')](_0x46fc7b);}return _0x48c086[_0xfc2f('0x23')]();};}function saveUpdates(_0x1f3ff5,_0x282b9e){return function(_0x3ede22){if(_0x3ede22){return _0x3ede22['update'](_0x1f3ff5)[_0xfc2f('0x24')](function(_0x58809a){return _0x58809a;});}return null;};}function removeEntity(_0x4fe879,_0x2d4b5f){return function(_0x41d6b5){if(_0x41d6b5){return _0x41d6b5[_0xfc2f('0x25')]()[_0xfc2f('0x24')](function(){_0x4fe879[_0xfc2f('0x19')](0xcc)[_0xfc2f('0x18')]();});}};}function handleEntityNotFound(_0x437a6a,_0x52ca41){return function(_0x105c79){if(!_0x105c79){_0x437a6a['sendStatus'](0x194);}return _0x105c79;};}function handleError(_0x142c1c,_0x42e85d){_0x42e85d=_0x42e85d||0x1f4;return function(_0x242f99){logger['error'](_0x242f99['stack']);if(_0x242f99['name']){delete _0x242f99[_0xfc2f('0x26')];}_0x142c1c[_0xfc2f('0x19')](_0x42e85d)[_0xfc2f('0x27')](_0x242f99);};}exports[_0xfc2f('0x28')]=function(_0x162aab,_0x1ebddb){var _0x12ba2f={},_0x2ee130={},_0x468840={'count':0x0,'rows':[]};var _0x23d3f6=_[_0xfc2f('0x29')](db[_0xfc2f('0x2a')][_0xfc2f('0x2b')],function(_0x54c1c6){return{'name':_0x54c1c6['fieldName'],'type':_0x54c1c6[_0xfc2f('0x2c')][_0xfc2f('0x2d')]};});_0x2ee130['model']=_['map'](_0x23d3f6,_0xfc2f('0x26'));_0x2ee130[_0xfc2f('0x2e')]=_[_0xfc2f('0x2f')](_0x162aab[_0xfc2f('0x2e')]);_0x2ee130[_0xfc2f('0x30')]=_[_0xfc2f('0x31')](_0x2ee130['model'],_0x2ee130['query']);_0x12ba2f[_0xfc2f('0x32')]=_['intersection'](_0x2ee130[_0xfc2f('0x33')],qs[_0xfc2f('0x34')](_0x162aab[_0xfc2f('0x2e')][_0xfc2f('0x34')]));_0x12ba2f[_0xfc2f('0x32')]=_0x12ba2f[_0xfc2f('0x32')][_0xfc2f('0x35')]?_0x12ba2f[_0xfc2f('0x32')]:_0x2ee130[_0xfc2f('0x33')];if(!_0x162aab[_0xfc2f('0x2e')][_0xfc2f('0x36')](_0xfc2f('0x37'))){_0x12ba2f[_0xfc2f('0x1d')]=qs['limit'](_0x162aab[_0xfc2f('0x2e')][_0xfc2f('0x1d')]);_0x12ba2f[_0xfc2f('0x1b')]=qs[_0xfc2f('0x1b')](_0x162aab[_0xfc2f('0x2e')][_0xfc2f('0x1b')]);}_0x12ba2f[_0xfc2f('0x38')]=qs[_0xfc2f('0x39')](_0x162aab[_0xfc2f('0x2e')][_0xfc2f('0x39')]);_0x12ba2f['where']=qs[_0xfc2f('0x30')](_['pick'](_0x162aab[_0xfc2f('0x2e')],_0x2ee130[_0xfc2f('0x30')]),_0x23d3f6);if(_0x162aab['query'][_0xfc2f('0x3a')]){_0x12ba2f[_0xfc2f('0x3b')]=_['merge'](_0x12ba2f[_0xfc2f('0x3b')],{'$or':_[_0xfc2f('0x29')](_0x23d3f6,function(_0x1edb19){if(_0x1edb19[_0xfc2f('0x2c')]!=='VIRTUAL'){var _0x3d6d88={};_0x3d6d88[_0x1edb19[_0xfc2f('0x26')]]={'$like':'%'+_0x162aab['query']['filter']+'%'};return _0x3d6d88;}})});}_0x12ba2f=_[_0xfc2f('0x3c')]({},_0x12ba2f,_0x162aab[_0xfc2f('0x3d')]);var _0x126ba6={'where':_0x12ba2f[_0xfc2f('0x3b')]};return db[_0xfc2f('0x2a')][_0xfc2f('0x1e')](_0x126ba6)[_0xfc2f('0x24')](function(_0x2d404e){_0x468840[_0xfc2f('0x1e')]=_0x2d404e;if(_0x162aab[_0xfc2f('0x2e')][_0xfc2f('0x3e')]){_0x12ba2f[_0xfc2f('0x3f')]=[{'all':!![]}];}return db[_0xfc2f('0x2a')][_0xfc2f('0x40')](_0x12ba2f);})['then'](function(_0x2f18f1){_0x468840[_0xfc2f('0x41')]=_0x2f18f1;return _0x468840;})[_0xfc2f('0x24')](respondWithFilteredResult(_0x1ebddb,_0x12ba2f))[_0xfc2f('0x42')](handleError(_0x1ebddb,null));};exports[_0xfc2f('0x43')]=function(_0x271347,_0x17863a){var _0x8c3a23={'raw':!![],'where':{'id':_0x271347[_0xfc2f('0x44')]['id']}},_0x3a581e={};_0x3a581e['model']=_[_0xfc2f('0x2f')](db['AnalyticTreeReport'][_0xfc2f('0x2b')]);_0x3a581e[_0xfc2f('0x2e')]=_['keys'](_0x271347['query']);_0x3a581e[_0xfc2f('0x30')]=_[_0xfc2f('0x31')](_0x3a581e[_0xfc2f('0x33')],_0x3a581e['query']);_0x8c3a23[_0xfc2f('0x32')]=_[_0xfc2f('0x31')](_0x3a581e[_0xfc2f('0x33')],qs[_0xfc2f('0x34')](_0x271347[_0xfc2f('0x2e')][_0xfc2f('0x34')]));_0x8c3a23['attributes']=_0x8c3a23[_0xfc2f('0x32')][_0xfc2f('0x35')]?_0x8c3a23[_0xfc2f('0x32')]:_0x3a581e[_0xfc2f('0x33')];if(_0x271347[_0xfc2f('0x2e')][_0xfc2f('0x3e')]){_0x8c3a23[_0xfc2f('0x3f')]=[{'all':!![]}];}_0x8c3a23=_['merge']({},_0x8c3a23,_0x271347[_0xfc2f('0x3d')]);return db['AnalyticTreeReport'][_0xfc2f('0x45')](_0x8c3a23)['then'](handleEntityNotFound(_0x17863a,null))['then'](respondWithResult(_0x17863a,null))[_0xfc2f('0x42')](handleError(_0x17863a,null));};exports['create']=function(_0x11b298,_0x395f8f){return db[_0xfc2f('0x2a')][_0xfc2f('0x46')](_0x11b298[_0xfc2f('0x47')],{})[_0xfc2f('0x24')](respondWithResult(_0x395f8f,0xc9))[_0xfc2f('0x42')](handleError(_0x395f8f,null));};exports['update']=function(_0x29f405,_0x33f6a9){if(_0x29f405[_0xfc2f('0x47')]['id']){delete _0x29f405['body']['id'];}return db[_0xfc2f('0x2a')][_0xfc2f('0x45')]({'where':{'id':_0x29f405[_0xfc2f('0x44')]['id']}})['then'](handleEntityNotFound(_0x33f6a9,null))['then'](saveUpdates(_0x29f405[_0xfc2f('0x47')],null))[_0xfc2f('0x24')](respondWithResult(_0x33f6a9,null))['catch'](handleError(_0x33f6a9,null));};exports[_0xfc2f('0x25')]=function(_0x9f6cdf,_0x18fdba){return db[_0xfc2f('0x2a')][_0xfc2f('0x45')]({'where':{'id':_0x9f6cdf[_0xfc2f('0x44')]['id']}})[_0xfc2f('0x24')](handleEntityNotFound(_0x18fdba,null))[_0xfc2f('0x24')](removeEntity(_0x18fdba,null))[_0xfc2f('0x42')](handleError(_0x18fdba,null));};
\ No newline at end of file
+var _0xa4e6=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','rows','keys','find','catch','create','body','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring'];(function(_0x3733eb,_0x2d9450){var _0x4c80e3=function(_0x365bce){while(--_0x365bce){_0x3733eb['push'](_0x3733eb['shift']());}};_0x4c80e3(++_0x2d9450);}(_0xa4e6,0x14a));var _0x6a4e=function(_0x11f1dd,_0x56671e){_0x11f1dd=_0x11f1dd-0x0;var _0x381e44=_0xa4e6[_0x11f1dd];return _0x381e44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a4e('0x0'));var zipdir=require(_0x6a4e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a4e('0x2'));var moment=require(_0x6a4e('0x3'));var BPromise=require(_0x6a4e('0x4'));var Mustache=require(_0x6a4e('0x5'));var util=require(_0x6a4e('0x6'));var path=require(_0x6a4e('0x7'));var sox=require(_0x6a4e('0x8'));var csv=require(_0x6a4e('0x9'));var ejs=require(_0x6a4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6a4e('0xb'));var crypto=require('crypto');var jsforce=require(_0x6a4e('0xc'));var deskjs=require(_0x6a4e('0xd'));var toCsv=require(_0x6a4e('0x9'));var querystring=require(_0x6a4e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a4e('0xf'));var qs=require(_0x6a4e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a4e('0x11'));var logger=require(_0x6a4e('0x12'))(_0x6a4e('0x13'));var utils=require('../../config/utils');var config=require(_0x6a4e('0x14'));var licenseUtil=require(_0x6a4e('0x15'));var db=require(_0x6a4e('0x16'))['db'];function respondWithStatusCode(_0x40b49f,_0x1eb3da){_0x1eb3da=_0x1eb3da||0xcc;return function(_0x3526cc){if(_0x3526cc){return _0x40b49f[_0x6a4e('0x17')](_0x1eb3da);}return _0x40b49f['status'](_0x1eb3da)[_0x6a4e('0x18')]();};}function respondWithResult(_0x1b6b58,_0xf233f3){_0xf233f3=_0xf233f3||0xc8;return function(_0x1b7d2f){if(_0x1b7d2f){return _0x1b6b58[_0x6a4e('0x19')](_0xf233f3)['json'](_0x1b7d2f);}};}function respondWithFilteredResult(_0x1f6b09,_0x3ab982){return function(_0x27bf1a){if(_0x27bf1a){var _0x22ff09=typeof _0x3ab982[_0x6a4e('0x1a')]===_0x6a4e('0x1b')&&typeof _0x3ab982[_0x6a4e('0x1c')]===_0x6a4e('0x1b');var _0x136cd5=_0x27bf1a[_0x6a4e('0x1d')];var _0x2c0716=_0x22ff09?0x0:_0x3ab982['offset'];var _0xbbc9a5=_0x22ff09?_0x27bf1a[_0x6a4e('0x1d')]:_0x3ab982[_0x6a4e('0x1a')]+_0x3ab982[_0x6a4e('0x1c')];var _0x512a9e;if(_0xbbc9a5>=_0x136cd5){_0xbbc9a5=_0x136cd5;_0x512a9e=0xc8;}else{_0x512a9e=0xce;}_0x1f6b09['status'](_0x512a9e);return _0x1f6b09[_0x6a4e('0x1e')](_0x6a4e('0x1f'),_0x2c0716+'-'+_0xbbc9a5+'/'+_0x136cd5)['json'](_0x27bf1a);}return null;};}function patchUpdates(_0x19f8ad){return function(_0x2d7ee5){try{jsonpatch[_0x6a4e('0x20')](_0x2d7ee5,_0x19f8ad,!![]);}catch(_0x2d2186){return BPromise[_0x6a4e('0x21')](_0x2d2186);}return _0x2d7ee5['save']();};}function saveUpdates(_0x325f93,_0x49aa93){return function(_0x277619){if(_0x277619){return _0x277619[_0x6a4e('0x22')](_0x325f93)[_0x6a4e('0x23')](function(_0x30dd6c){return _0x30dd6c;});}return null;};}function removeEntity(_0x78437f,_0x11b79c){return function(_0x15a24f){if(_0x15a24f){return _0x15a24f[_0x6a4e('0x24')]()[_0x6a4e('0x23')](function(){_0x78437f[_0x6a4e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x567f90,_0x37affa){return function(_0x39cf29){if(!_0x39cf29){_0x567f90[_0x6a4e('0x17')](0x194);}return _0x39cf29;};}function handleError(_0x31dac1,_0x98ebe1){_0x98ebe1=_0x98ebe1||0x1f4;return function(_0x522037){logger['error'](_0x522037[_0x6a4e('0x25')]);if(_0x522037['name']){delete _0x522037[_0x6a4e('0x26')];}_0x31dac1['status'](_0x98ebe1)['send'](_0x522037);};}exports[_0x6a4e('0x27')]=function(_0x39ca23,_0x426259){var _0x3ebc16={},_0x2bfe32={},_0x4e726c={'count':0x0,'rows':[]};var _0xde3b5e=_[_0x6a4e('0x28')](db[_0x6a4e('0x29')][_0x6a4e('0x2a')],function(_0x363005){return{'name':_0x363005[_0x6a4e('0x2b')],'type':_0x363005[_0x6a4e('0x2c')][_0x6a4e('0x2d')]};});_0x2bfe32['model']=_[_0x6a4e('0x28')](_0xde3b5e,'name');_0x2bfe32[_0x6a4e('0x2e')]=_['keys'](_0x39ca23[_0x6a4e('0x2e')]);_0x2bfe32[_0x6a4e('0x2f')]=_[_0x6a4e('0x30')](_0x2bfe32[_0x6a4e('0x31')],_0x2bfe32[_0x6a4e('0x2e')]);_0x3ebc16['attributes']=_[_0x6a4e('0x30')](_0x2bfe32[_0x6a4e('0x31')],qs[_0x6a4e('0x32')](_0x39ca23[_0x6a4e('0x2e')][_0x6a4e('0x32')]));_0x3ebc16[_0x6a4e('0x33')]=_0x3ebc16[_0x6a4e('0x33')][_0x6a4e('0x34')]?_0x3ebc16[_0x6a4e('0x33')]:_0x2bfe32['model'];if(!_0x39ca23[_0x6a4e('0x2e')][_0x6a4e('0x35')]('nolimit')){_0x3ebc16[_0x6a4e('0x1c')]=qs[_0x6a4e('0x1c')](_0x39ca23[_0x6a4e('0x2e')]['limit']);_0x3ebc16['offset']=qs[_0x6a4e('0x1a')](_0x39ca23[_0x6a4e('0x2e')][_0x6a4e('0x1a')]);}_0x3ebc16[_0x6a4e('0x36')]=qs['sort'](_0x39ca23[_0x6a4e('0x2e')][_0x6a4e('0x37')]);_0x3ebc16[_0x6a4e('0x38')]=qs[_0x6a4e('0x2f')](_[_0x6a4e('0x39')](_0x39ca23[_0x6a4e('0x2e')],_0x2bfe32[_0x6a4e('0x2f')]),_0xde3b5e);if(_0x39ca23[_0x6a4e('0x2e')][_0x6a4e('0x3a')]){_0x3ebc16[_0x6a4e('0x38')]=_['merge'](_0x3ebc16[_0x6a4e('0x38')],{'$or':_[_0x6a4e('0x28')](_0xde3b5e,function(_0x4cf11f){if(_0x4cf11f[_0x6a4e('0x2c')]!=='VIRTUAL'){var _0x15c5c8={};_0x15c5c8[_0x4cf11f[_0x6a4e('0x26')]]={'$like':'%'+_0x39ca23[_0x6a4e('0x2e')][_0x6a4e('0x3a')]+'%'};return _0x15c5c8;}})});}_0x3ebc16=_[_0x6a4e('0x3b')]({},_0x3ebc16,_0x39ca23[_0x6a4e('0x3c')]);var _0x4c6756={'where':_0x3ebc16['where']};return db[_0x6a4e('0x29')]['count'](_0x4c6756)['then'](function(_0xf9361c){_0x4e726c[_0x6a4e('0x1d')]=_0xf9361c;if(_0x39ca23['query'][_0x6a4e('0x3d')]){_0x3ebc16['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x3ebc16);})[_0x6a4e('0x23')](function(_0x4a5cd9){_0x4e726c[_0x6a4e('0x3e')]=_0x4a5cd9;return _0x4e726c;})[_0x6a4e('0x23')](respondWithFilteredResult(_0x426259,_0x3ebc16))['catch'](handleError(_0x426259,null));};exports['show']=function(_0x2bf589,_0x28c515){var _0x114d8e={'raw':!![],'where':{'id':_0x2bf589['params']['id']}},_0x2a2e73={};_0x2a2e73['model']=_[_0x6a4e('0x3f')](db['AnalyticTreeReport']['rawAttributes']);_0x2a2e73[_0x6a4e('0x2e')]=_[_0x6a4e('0x3f')](_0x2bf589[_0x6a4e('0x2e')]);_0x2a2e73[_0x6a4e('0x2f')]=_[_0x6a4e('0x30')](_0x2a2e73['model'],_0x2a2e73['query']);_0x114d8e[_0x6a4e('0x33')]=_[_0x6a4e('0x30')](_0x2a2e73[_0x6a4e('0x31')],qs['fields'](_0x2bf589[_0x6a4e('0x2e')][_0x6a4e('0x32')]));_0x114d8e['attributes']=_0x114d8e[_0x6a4e('0x33')][_0x6a4e('0x34')]?_0x114d8e[_0x6a4e('0x33')]:_0x2a2e73['model'];if(_0x2bf589[_0x6a4e('0x2e')][_0x6a4e('0x3d')]){_0x114d8e['include']=[{'all':!![]}];}_0x114d8e=_[_0x6a4e('0x3b')]({},_0x114d8e,_0x2bf589[_0x6a4e('0x3c')]);return db['AnalyticTreeReport'][_0x6a4e('0x40')](_0x114d8e)[_0x6a4e('0x23')](handleEntityNotFound(_0x28c515,null))[_0x6a4e('0x23')](respondWithResult(_0x28c515,null))[_0x6a4e('0x41')](handleError(_0x28c515,null));};exports[_0x6a4e('0x42')]=function(_0x977d06,_0x414ef5){return db[_0x6a4e('0x29')][_0x6a4e('0x42')](_0x977d06[_0x6a4e('0x43')],{})[_0x6a4e('0x23')](respondWithResult(_0x414ef5,0xc9))[_0x6a4e('0x41')](handleError(_0x414ef5,null));};exports['update']=function(_0x13eb7c,_0x1f0416){if(_0x13eb7c[_0x6a4e('0x43')]['id']){delete _0x13eb7c['body']['id'];}return db[_0x6a4e('0x29')][_0x6a4e('0x40')]({'where':{'id':_0x13eb7c['params']['id']}})[_0x6a4e('0x23')](handleEntityNotFound(_0x1f0416,null))[_0x6a4e('0x23')](saveUpdates(_0x13eb7c[_0x6a4e('0x43')],null))[_0x6a4e('0x23')](respondWithResult(_0x1f0416,null))['catch'](handleError(_0x1f0416,null));};exports['destroy']=function(_0x52c855,_0x86b7fe){return db['AnalyticTreeReport'][_0x6a4e('0x40')]({'where':{'id':_0x52c855[_0x6a4e('0x44')]['id']}})['then'](handleEntityNotFound(_0x86b7fe,null))[_0x6a4e('0x23')](removeEntity(_0x86b7fe,null))['catch'](handleError(_0x86b7fe,null));};
\ No newline at end of file
index 35d5d11..7ca6fdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','moment','bluebird','path'];(function(_0x3fddee,_0x4bccde){var _0x2cbde6=function(_0x22ea39){while(--_0x22ea39){_0x3fddee['push'](_0x3fddee['shift']());}};_0x2cbde6(++_0x4bccde);}(_0x187d,0xd3));var _0xd187=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x187d[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))('api');var moment=require(_0xd187('0x2'));var BPromise=require(_0xd187('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd187('0x4'));var rimraf=require('rimraf');var config=require(_0xd187('0x5'));var attributes=require(_0xd187('0x6'));module['exports']=function(_0x3d3cf6,_0x2349cf){return _0x3d3cf6['define'](_0xd187('0x7'),attributes,{'tableName':_0xd187('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4ab=['analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0xb4ab,0x112));var _0xbb4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb4ab[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xbb4a('0x0'));var util=require(_0xbb4a('0x1'));var logger=require(_0xbb4a('0x2'))(_0xbb4a('0x3'));var moment=require('moment');var BPromise=require(_0xbb4a('0x4'));var rp=require(_0xbb4a('0x5'));var fs=require('fs');var path=require(_0xbb4a('0x6'));var rimraf=require(_0xbb4a('0x7'));var config=require(_0xbb4a('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0xbb4a('0x9')]=function(_0x1de31c,_0x398bd4){return _0x1de31c[_0xbb4a('0xa')](_0xbb4a('0xb'),attributes,{'tableName':_0xbb4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a75f636..e26056d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0xc9b268,_0x1c6c44){var _0x2443f8=function(_0x3a034d){while(--_0x3a034d){_0xc9b268['push'](_0xc9b268['shift']());}};_0x2443f8(++_0x1c6c44);}(_0x5f2f,0x73));var _0xf5f2=function(_0x38e030,_0x1067fd){_0x38e030=_0x38e030-0x0;var _0x397576=_0x5f2f[_0x38e030];return _0x397576;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+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(_0x1fc6ee,_0x2e7eb6){var _0x568911=function(_0x33ae98){while(--_0x33ae98){_0x1fc6ee['push'](_0x1fc6ee['shift']());}};_0x568911(++_0x2e7eb6);}(_0xdb28,0x106));var _0x8db2=function(_0x26c4b4,_0x1ca90a){_0x26c4b4=_0x26c4b4-0x0;var _0x36632f=_0xdb28[_0x26c4b4];return _0x36632f;};'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 f32ba6f..e3da02a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38f2=['/:id','show','post','create','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x38f2,0x95));var _0x238f=function(_0x986b06,_0x3475ec){_0x986b06=_0x986b06-0x0;var _0xbf7d07=_0x38f2[_0x986b06];return _0xbf7d07;};'use strict';var multer=require(_0x238f('0x0'));var util=require(_0x238f('0x1'));var path=require(_0x238f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x238f('0x3')]();var fs_extra=require(_0x238f('0x4'));var auth=require(_0x238f('0x5'));var interaction=require(_0x238f('0x6'));var config=require('../../config/environment');var controller=require(_0x238f('0x7'));router[_0x238f('0x8')]('/',auth[_0x238f('0x9')](),controller[_0x238f('0xa')]);router[_0x238f('0x8')](_0x238f('0xb'),auth['isAuthenticated'](),controller[_0x238f('0xc')]);router[_0x238f('0xd')]('/',auth['isAuthenticated'](),controller[_0x238f('0xe')]);router['put'](_0x238f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x238f('0x9')](),controller[_0x238f('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x2ef8=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a80a5,_0x240d45){var _0x302045=function(_0x37842d){while(--_0x37842d){_0x5a80a5['push'](_0x5a80a5['shift']());}};_0x302045(++_0x240d45);}(_0x2ef8,0x1e5));var _0x82ef=function(_0xaf33d0,_0x5ac2f7){_0xaf33d0=_0xaf33d0-0x0;var _0xad2b88=_0x2ef8[_0xaf33d0];return _0xad2b88;};'use strict';var multer=require(_0x82ef('0x0'));var util=require(_0x82ef('0x1'));var path=require(_0x82ef('0x2'));var timeout=require('connect-timeout');var express=require(_0x82ef('0x3'));var router=express[_0x82ef('0x4')]();var fs_extra=require(_0x82ef('0x5'));var auth=require(_0x82ef('0x6'));var interaction=require(_0x82ef('0x7'));var config=require(_0x82ef('0x8'));var controller=require(_0x82ef('0x9'));router[_0x82ef('0xa')]('/',auth[_0x82ef('0xb')](),controller[_0x82ef('0xc')]);router['get'](_0x82ef('0xd'),auth[_0x82ef('0xb')](),controller['show']);router[_0x82ef('0xe')]('/',auth[_0x82ef('0xb')](),controller[_0x82ef('0xf')]);router[_0x82ef('0x10')](_0x82ef('0xd'),auth[_0x82ef('0xb')](),controller[_0x82ef('0x11')]);router['delete']('/:id',auth[_0x82ef('0xb')](),controller['destroy']);module[_0x82ef('0x12')]=router;
\ No newline at end of file
index 4485625..eb771b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8135=['STRING','exports'];(function(_0x5ad531,_0x3ed683){var _0x42165c=function(_0x25f5f9){while(--_0x25f5f9){_0x5ad531['push'](_0x5ad531['shift']());}};_0x42165c(++_0x3ed683);}(_0x8135,0x99));var _0x5813=function(_0x44aa50,_0x560b86){_0x44aa50=_0x44aa50-0x0;var _0x5d5d7d=_0x8135[_0x44aa50];return _0x5d5d7d;};'use strict';var Sequelize=require('sequelize');module[_0x5813('0x0')]={'name':{'type':Sequelize[_0x5813('0x1')]},'basename':{'type':Sequelize[_0x5813('0x1')]},'type':{'type':Sequelize[_0x5813('0x1')]}};
\ No newline at end of file
+var _0x8e94=['exports','STRING','sequelize'];(function(_0x3b0e53,_0xcc4cea){var _0x270a81=function(_0x46082e){while(--_0x46082e){_0x3b0e53['push'](_0x3b0e53['shift']());}};_0x270a81(++_0xcc4cea);}(_0x8e94,0xf8));var _0x48e9=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x8e94[_0x1f7201];return _0x289fd2;};'use strict';var Sequelize=require(_0x48e9('0x0'));module[_0x48e9('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x48e9('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 69bef82..3ee95c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc823=['destroy','then','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','fields','find','catch','clone','createdAt','updatedAt','body','omit','create','update','params','file','basename','filename','mimetype','download','ChatOfflineMessageId','root','join','eml-format','zip-dir','request-promise','mustache','util','path','sox','fs-extra','lodash','squel','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject'];(function(_0x279ca3,_0x2f670c){var _0x59a53f=function(_0x35bad1){while(--_0x35bad1){_0x279ca3['push'](_0x279ca3['shift']());}};_0x59a53f(++_0x2f670c);}(_0xc823,0x12a));var _0x3c82=function(_0x3cb80e,_0x109ec5){_0x3cb80e=_0x3cb80e-0x0;var _0x58ffa=_0xc823[_0x3cb80e];return _0x58ffa;};'use strict';var emlformat=require(_0x3c82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c82('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3c82('0x3'));var util=require(_0x3c82('0x4'));var path=require(_0x3c82('0x5'));var sox=require(_0x3c82('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c82('0x7'));var _=require(_0x3c82('0x8'));var squel=require(_0x3c82('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3c82('0xa'));var querystring=require('querystring');var Papa=require(_0x3c82('0xb'));var Redis=require(_0x3c82('0xc'));var authService=require(_0x3c82('0xd'));var qs=require(_0x3c82('0xe'));var as=require(_0x3c82('0xf'));var hardwareService=require(_0x3c82('0x10'));var logger=require(_0x3c82('0x11'))('api');var utils=require(_0x3c82('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3c82('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10bc49,_0x1241db){_0x1241db=_0x1241db||0xcc;return function(_0x50fd5a){if(_0x50fd5a){return _0x10bc49[_0x3c82('0x14')](_0x1241db);}return _0x10bc49[_0x3c82('0x15')](_0x1241db)[_0x3c82('0x16')]();};}function respondWithResult(_0xcbef64,_0x48a9d1){_0x48a9d1=_0x48a9d1||0xc8;return function(_0x111d5b){if(_0x111d5b){return _0xcbef64['status'](_0x48a9d1)[_0x3c82('0x17')](_0x111d5b);}};}function respondWithFilteredResult(_0x1ceb72,_0x5a0aa4){return function(_0x1bb9e3){if(_0x1bb9e3){var _0x8daa67=typeof _0x5a0aa4['offset']==='undefined'&&typeof _0x5a0aa4['limit']==='undefined';var _0x53df0a=_0x1bb9e3[_0x3c82('0x18')];var _0x331f30=_0x8daa67?0x0:_0x5a0aa4[_0x3c82('0x19')];var _0x1efb64=_0x8daa67?_0x1bb9e3[_0x3c82('0x18')]:_0x5a0aa4[_0x3c82('0x19')]+_0x5a0aa4['limit'];var _0x7e0dd3;if(_0x1efb64>=_0x53df0a){_0x1efb64=_0x53df0a;_0x7e0dd3=0xc8;}else{_0x7e0dd3=0xce;}_0x1ceb72[_0x3c82('0x15')](_0x7e0dd3);return _0x1ceb72[_0x3c82('0x1a')](_0x3c82('0x1b'),_0x331f30+'-'+_0x1efb64+'/'+_0x53df0a)[_0x3c82('0x17')](_0x1bb9e3);}return null;};}function patchUpdates(_0xdd2b21){return function(_0x5e56b4){try{jsonpatch[_0x3c82('0x1c')](_0x5e56b4,_0xdd2b21,!![]);}catch(_0x42ca99){return BPromise[_0x3c82('0x1d')](_0x42ca99);}return _0x5e56b4['save']();};}function saveUpdates(_0x152af2,_0x4a42bf){return function(_0x5f2df5){if(_0x5f2df5){return _0x5f2df5['update'](_0x152af2)['then'](function(_0x228914){return _0x228914;});}return null;};}function removeEntity(_0x131fe4,_0x3e3e9c){return function(_0xbca1ce){if(_0xbca1ce){return _0xbca1ce[_0x3c82('0x1e')]()[_0x3c82('0x1f')](function(){_0x131fe4[_0x3c82('0x15')](0xcc)[_0x3c82('0x16')]();});}};}function handleEntityNotFound(_0x57fca7,_0x4d6639){return function(_0x3a8d0d){if(!_0x3a8d0d){_0x57fca7['sendStatus'](0x194);}return _0x3a8d0d;};}function handleError(_0x418d0c,_0x3a459e){_0x3a459e=_0x3a459e||0x1f4;return function(_0x2d1ec4){logger['error'](_0x2d1ec4[_0x3c82('0x20')]);if(_0x2d1ec4[_0x3c82('0x21')]){delete _0x2d1ec4[_0x3c82('0x21')];}_0x418d0c[_0x3c82('0x15')](_0x3a459e)[_0x3c82('0x22')](_0x2d1ec4);};}exports[_0x3c82('0x23')]=function(_0x23d4df,_0x5e0bed){var _0x5d2a57={},_0x54cdfb={},_0x546aae={'count':0x0,'rows':[]};var _0x4c4533=_[_0x3c82('0x24')](db[_0x3c82('0x25')][_0x3c82('0x26')],function(_0x50b05f){return{'name':_0x50b05f[_0x3c82('0x27')],'type':_0x50b05f[_0x3c82('0x28')][_0x3c82('0x29')]};});_0x54cdfb[_0x3c82('0x2a')]=_[_0x3c82('0x24')](_0x4c4533,_0x3c82('0x21'));_0x54cdfb['query']=_[_0x3c82('0x2b')](_0x23d4df[_0x3c82('0x2c')]);_0x54cdfb[_0x3c82('0x2d')]=_[_0x3c82('0x2e')](_0x54cdfb[_0x3c82('0x2a')],_0x54cdfb[_0x3c82('0x2c')]);_0x5d2a57[_0x3c82('0x2f')]=_[_0x3c82('0x2e')](_0x54cdfb[_0x3c82('0x2a')],qs['fields'](_0x23d4df['query']['fields']));_0x5d2a57[_0x3c82('0x2f')]=_0x5d2a57[_0x3c82('0x2f')][_0x3c82('0x30')]?_0x5d2a57[_0x3c82('0x2f')]:_0x54cdfb[_0x3c82('0x2a')];if(!_0x23d4df[_0x3c82('0x2c')][_0x3c82('0x31')](_0x3c82('0x32'))){_0x5d2a57[_0x3c82('0x33')]=qs['limit'](_0x23d4df['query'][_0x3c82('0x33')]);_0x5d2a57[_0x3c82('0x19')]=qs[_0x3c82('0x19')](_0x23d4df['query'][_0x3c82('0x19')]);}_0x5d2a57[_0x3c82('0x34')]=qs['sort'](_0x23d4df[_0x3c82('0x2c')][_0x3c82('0x35')]);_0x5d2a57[_0x3c82('0x36')]=qs[_0x3c82('0x2d')](_['pick'](_0x23d4df[_0x3c82('0x2c')],_0x54cdfb[_0x3c82('0x2d')]),_0x4c4533);if(_0x23d4df['query'][_0x3c82('0x37')]){_0x5d2a57[_0x3c82('0x36')]=_[_0x3c82('0x38')](_0x5d2a57['where'],{'$or':_[_0x3c82('0x24')](_0x4c4533,function(_0x3e66ec){if(_0x3e66ec['type']!==_0x3c82('0x39')){var _0x1be6d3={};_0x1be6d3[_0x3e66ec['name']]={'$like':'%'+_0x23d4df[_0x3c82('0x2c')][_0x3c82('0x37')]+'%'};return _0x1be6d3;}})});}_0x5d2a57=_[_0x3c82('0x38')]({},_0x5d2a57,_0x23d4df[_0x3c82('0x3a')]);var _0x3414d0={'where':_0x5d2a57[_0x3c82('0x36')]};return db[_0x3c82('0x25')][_0x3c82('0x18')](_0x3414d0)['then'](function(_0x3d7501){_0x546aae[_0x3c82('0x18')]=_0x3d7501;if(_0x23d4df[_0x3c82('0x2c')][_0x3c82('0x3b')]){_0x5d2a57[_0x3c82('0x3c')]=[{'all':!![]}];}return db[_0x3c82('0x25')]['findAll'](_0x5d2a57);})[_0x3c82('0x1f')](function(_0x33a035){_0x546aae[_0x3c82('0x3d')]=_0x33a035;return _0x546aae;})['then'](respondWithFilteredResult(_0x5e0bed,_0x5d2a57))['catch'](handleError(_0x5e0bed,null));};exports[_0x3c82('0x3e')]=function(_0x3af05c,_0x3c40fd){var _0x13f7d0={'raw':!![],'where':{'id':_0x3af05c['params']['id']}},_0x53d384={};_0x53d384['model']=_[_0x3c82('0x2b')](db[_0x3c82('0x25')][_0x3c82('0x26')]);_0x53d384['query']=_[_0x3c82('0x2b')](_0x3af05c[_0x3c82('0x2c')]);_0x53d384[_0x3c82('0x2d')]=_[_0x3c82('0x2e')](_0x53d384[_0x3c82('0x2a')],_0x53d384[_0x3c82('0x2c')]);_0x13f7d0['attributes']=_[_0x3c82('0x2e')](_0x53d384[_0x3c82('0x2a')],qs[_0x3c82('0x3f')](_0x3af05c[_0x3c82('0x2c')][_0x3c82('0x3f')]));_0x13f7d0[_0x3c82('0x2f')]=_0x13f7d0[_0x3c82('0x2f')][_0x3c82('0x30')]?_0x13f7d0[_0x3c82('0x2f')]:_0x53d384['model'];if(_0x3af05c['query']['includeAll']){_0x13f7d0[_0x3c82('0x3c')]=[{'all':!![]}];}_0x13f7d0=_[_0x3c82('0x38')]({},_0x13f7d0,_0x3af05c[_0x3c82('0x3a')]);return db['Attachment'][_0x3c82('0x40')](_0x13f7d0)[_0x3c82('0x1f')](handleEntityNotFound(_0x3c40fd,null))[_0x3c82('0x1f')](respondWithResult(_0x3c40fd,null))[_0x3c82('0x41')](handleError(_0x3c40fd,null));};exports[_0x3c82('0x42')]=function(_0x2995aa,_0x41f66e){var _0x2f6b35={'where':{'id':_0x2995aa['params']['id']}},_0x128749={};_0x128749[_0x3c82('0x2a')]=_[_0x3c82('0x2b')](db[_0x3c82('0x25')]['rawAttributes']);_0x2f6b35[_0x3c82('0x2f')]=_[_0x3c82('0x2e')](_0x128749[_0x3c82('0x2a')],qs[_0x3c82('0x3f')](_0x2995aa['query'][_0x3c82('0x3f')]));_0x2f6b35[_0x3c82('0x2f')]=_0x2f6b35[_0x3c82('0x2f')][_0x3c82('0x30')]?_0x2f6b35[_0x3c82('0x2f')]:_0x128749[_0x3c82('0x2a')];if(_0x2995aa[_0x3c82('0x2c')]['includeAll']){_0x2f6b35[_0x3c82('0x3c')]=[{'all':!![]}];}_0x2f6b35=_[_0x3c82('0x38')]({},_0x2f6b35,_0x2995aa['options']);return db[_0x3c82('0x25')]['find'](_0x2f6b35)[_0x3c82('0x1f')](handleEntityNotFound(_0x41f66e,null))[_0x3c82('0x1f')](function(_0x5ad886){if(_0x5ad886){var _0x3475e1=_0x5ad886['get']({'plain':!![]});_0x3475e1=qs['omit'](_0x3475e1,['id',_0x3c82('0x43'),_0x3c82('0x44')]);_0x2995aa[_0x3c82('0x45')]=_[_0x3c82('0x46')](_0x2995aa['body'],['id',_0x3c82('0x43'),_0x3c82('0x44')]);return db[_0x3c82('0x25')][_0x3c82('0x47')](_[_0x3c82('0x38')](_0x3475e1,_0x2995aa[_0x3c82('0x45')]),{'include':_0x2995aa[_0x3c82('0x2c')][_0x3c82('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x41f66e,0xc9))[_0x3c82('0x41')](handleError(_0x41f66e,null));};exports[_0x3c82('0x48')]=function(_0x142a64,_0x5b2e27){if(_0x142a64[_0x3c82('0x45')]['id']){delete _0x142a64[_0x3c82('0x45')]['id'];}return db[_0x3c82('0x25')]['find']({'where':{'id':_0x142a64[_0x3c82('0x49')]['id']}})[_0x3c82('0x1f')](handleEntityNotFound(_0x5b2e27,null))[_0x3c82('0x1f')](saveUpdates(_0x142a64[_0x3c82('0x45')],null))['then'](respondWithResult(_0x5b2e27,null))['catch'](handleError(_0x5b2e27,null));};exports[_0x3c82('0x1e')]=function(_0x5a0184,_0x2ff939){return db[_0x3c82('0x25')][_0x3c82('0x40')]({'where':{'id':_0x5a0184[_0x3c82('0x49')]['id']}})[_0x3c82('0x1f')](handleEntityNotFound(_0x2ff939,null))[_0x3c82('0x1f')](removeEntity(_0x2ff939,null))['catch'](handleError(_0x2ff939,null));};exports[_0x3c82('0x47')]=function(_0x2854eb,_0x227af5,_0x2989dc){_0x2854eb[_0x3c82('0x45')][_0x3c82('0x21')]=_0x2854eb[_0x3c82('0x4a')]['originalname'];_0x2854eb['body'][_0x3c82('0x4b')]=_0x2854eb[_0x3c82('0x4a')][_0x3c82('0x4c')];_0x2854eb[_0x3c82('0x45')]['type']=_0x2854eb[_0x3c82('0x4a')][_0x3c82('0x4d')];return db[_0x3c82('0x25')]['create'](_0x2854eb[_0x3c82('0x45')])[_0x3c82('0x1f')](respondWithResult(_0x227af5,0xc9))[_0x3c82('0x41')](handleError(_0x227af5,null));};exports[_0x3c82('0x4e')]=function(_0x262ec6,_0x3ef5fe,_0x239df7){return db[_0x3c82('0x25')]['findOne']({'where':{'id':_0x262ec6[_0x3c82('0x49')]['id']},'raw':!![]})[_0x3c82('0x1f')](handleEntityNotFound(_0x3ef5fe,null))[_0x3c82('0x1f')](function(_0x30125b){if(_0x30125b){var _0x21ecc2=_0x30125b[_0x3c82('0x4f')]!==null;var _0x42eda6=path['join'](config[_0x3c82('0x50')],'server/files/attachments/');if(_0x21ecc2){_0x42eda6=path[_0x3c82('0x51')](_0x42eda6,'offline-chat/');}var _0x33fc0e=path[_0x3c82('0x51')](_0x42eda6,_0x30125b[_0x3c82('0x4b')]);return _0x3ef5fe[_0x3c82('0x4e')](_0x33fc0e);}})[_0x3c82('0x41')](handleError(_0x3ef5fe,null));};
\ No newline at end of file
+var _0xbe7e=['keys','filters','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','then','includeAll','include','catch','show','params','find','merge','omit','createdAt','body','updatedAt','create','destroy','originalname','basename','filename','file','mimetype','download','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','error','stack','name','map','Attachment','rawAttributes','fieldName','type','key','model'];(function(_0x22ed76,_0x9848b){var _0x37591c=function(_0x16c830){while(--_0x16c830){_0x22ed76['push'](_0x22ed76['shift']());}};_0x37591c(++_0x9848b);}(_0xbe7e,0x112));var _0xebe7=function(_0x590ed3,_0x4e3dcf){_0x590ed3=_0x590ed3-0x0;var _0x474362=_0xbe7e[_0x590ed3];return _0x474362;};'use strict';var emlformat=require(_0xebe7('0x0'));var rimraf=require(_0xebe7('0x1'));var zipdir=require(_0xebe7('0x2'));var jsonpatch=require(_0xebe7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xebe7('0x4'));var util=require('util');var path=require(_0xebe7('0x5'));var sox=require(_0xebe7('0x6'));var csv=require(_0xebe7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xebe7('0x8'));var crypto=require(_0xebe7('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xebe7('0xa'));var toCsv=require(_0xebe7('0x7'));var querystring=require('querystring');var Papa=require(_0xebe7('0xb'));var Redis=require(_0xebe7('0xc'));var authService=require(_0xebe7('0xd'));var qs=require(_0xebe7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xebe7('0xf'))('api');var utils=require(_0xebe7('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xebe7('0x11'));var db=require(_0xebe7('0x12'))['db'];function respondWithStatusCode(_0x108ec9,_0xeeceff){_0xeeceff=_0xeeceff||0xcc;return function(_0x2d2b14){if(_0x2d2b14){return _0x108ec9[_0xebe7('0x13')](_0xeeceff);}return _0x108ec9[_0xebe7('0x14')](_0xeeceff)[_0xebe7('0x15')]();};}function respondWithResult(_0x45befd,_0x2a6567){_0x2a6567=_0x2a6567||0xc8;return function(_0x5ae5cd){if(_0x5ae5cd){return _0x45befd[_0xebe7('0x14')](_0x2a6567)[_0xebe7('0x16')](_0x5ae5cd);}};}function respondWithFilteredResult(_0x55ec18,_0x401e03){return function(_0x47581c){if(_0x47581c){var _0x5d56a2=typeof _0x401e03[_0xebe7('0x17')]===_0xebe7('0x18')&&typeof _0x401e03[_0xebe7('0x19')]==='undefined';var _0x4cc1aa=_0x47581c[_0xebe7('0x1a')];var _0x1cb8a5=_0x5d56a2?0x0:_0x401e03[_0xebe7('0x17')];var _0x3492ed=_0x5d56a2?_0x47581c[_0xebe7('0x1a')]:_0x401e03[_0xebe7('0x17')]+_0x401e03[_0xebe7('0x19')];var _0x59d015;if(_0x3492ed>=_0x4cc1aa){_0x3492ed=_0x4cc1aa;_0x59d015=0xc8;}else{_0x59d015=0xce;}_0x55ec18[_0xebe7('0x14')](_0x59d015);return _0x55ec18[_0xebe7('0x1b')](_0xebe7('0x1c'),_0x1cb8a5+'-'+_0x3492ed+'/'+_0x4cc1aa)[_0xebe7('0x16')](_0x47581c);}return null;};}function patchUpdates(_0x4de259){return function(_0x3165bf){try{jsonpatch[_0xebe7('0x1d')](_0x3165bf,_0x4de259,!![]);}catch(_0x204f4e){return BPromise['reject'](_0x204f4e);}return _0x3165bf[_0xebe7('0x1e')]();};}function saveUpdates(_0xf20a3c,_0x4d2c19){return function(_0x54e9b5){if(_0x54e9b5){return _0x54e9b5[_0xebe7('0x1f')](_0xf20a3c)['then'](function(_0x306765){return _0x306765;});}return null;};}function removeEntity(_0x21f2cf,_0x35d126){return function(_0x500fda){if(_0x500fda){return _0x500fda['destroy']()['then'](function(){_0x21f2cf['status'](0xcc)[_0xebe7('0x15')]();});}};}function handleEntityNotFound(_0x51260a,_0x1aae08){return function(_0x1400b3){if(!_0x1400b3){_0x51260a[_0xebe7('0x13')](0x194);}return _0x1400b3;};}function handleError(_0x2f494b,_0x464902){_0x464902=_0x464902||0x1f4;return function(_0x100503){logger[_0xebe7('0x20')](_0x100503[_0xebe7('0x21')]);if(_0x100503[_0xebe7('0x22')]){delete _0x100503[_0xebe7('0x22')];}_0x2f494b[_0xebe7('0x14')](_0x464902)['send'](_0x100503);};}exports['index']=function(_0x3167f8,_0x2e3982){var _0x19e7a3={},_0x25e56d={},_0x24e6d5={'count':0x0,'rows':[]};var _0x712c83=_[_0xebe7('0x23')](db[_0xebe7('0x24')][_0xebe7('0x25')],function(_0x3f26ed){return{'name':_0x3f26ed[_0xebe7('0x26')],'type':_0x3f26ed[_0xebe7('0x27')][_0xebe7('0x28')]};});_0x25e56d[_0xebe7('0x29')]=_[_0xebe7('0x23')](_0x712c83,'name');_0x25e56d['query']=_[_0xebe7('0x2a')](_0x3167f8['query']);_0x25e56d[_0xebe7('0x2b')]=_['intersection'](_0x25e56d[_0xebe7('0x29')],_0x25e56d['query']);_0x19e7a3[_0xebe7('0x2c')]=_[_0xebe7('0x2d')](_0x25e56d['model'],qs[_0xebe7('0x2e')](_0x3167f8['query'][_0xebe7('0x2e')]));_0x19e7a3[_0xebe7('0x2c')]=_0x19e7a3['attributes']['length']?_0x19e7a3[_0xebe7('0x2c')]:_0x25e56d['model'];if(!_0x3167f8[_0xebe7('0x2f')][_0xebe7('0x30')](_0xebe7('0x31'))){_0x19e7a3[_0xebe7('0x19')]=qs[_0xebe7('0x19')](_0x3167f8['query'][_0xebe7('0x19')]);_0x19e7a3[_0xebe7('0x17')]=qs[_0xebe7('0x17')](_0x3167f8[_0xebe7('0x2f')]['offset']);}_0x19e7a3[_0xebe7('0x32')]=qs[_0xebe7('0x33')](_0x3167f8[_0xebe7('0x2f')][_0xebe7('0x33')]);_0x19e7a3[_0xebe7('0x34')]=qs[_0xebe7('0x2b')](_[_0xebe7('0x35')](_0x3167f8[_0xebe7('0x2f')],_0x25e56d[_0xebe7('0x2b')]),_0x712c83);if(_0x3167f8[_0xebe7('0x2f')][_0xebe7('0x36')]){_0x19e7a3[_0xebe7('0x34')]=_['merge'](_0x19e7a3[_0xebe7('0x34')],{'$or':_[_0xebe7('0x23')](_0x712c83,function(_0x3e52c9){if(_0x3e52c9[_0xebe7('0x27')]!=='VIRTUAL'){var _0x59d706={};_0x59d706[_0x3e52c9[_0xebe7('0x22')]]={'$like':'%'+_0x3167f8[_0xebe7('0x2f')]['filter']+'%'};return _0x59d706;}})});}_0x19e7a3=_['merge']({},_0x19e7a3,_0x3167f8[_0xebe7('0x37')]);var _0x5589ae={'where':_0x19e7a3[_0xebe7('0x34')]};return db[_0xebe7('0x24')]['count'](_0x5589ae)[_0xebe7('0x38')](function(_0x253014){_0x24e6d5[_0xebe7('0x1a')]=_0x253014;if(_0x3167f8[_0xebe7('0x2f')][_0xebe7('0x39')]){_0x19e7a3[_0xebe7('0x3a')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x19e7a3);})['then'](function(_0x52df87){_0x24e6d5['rows']=_0x52df87;return _0x24e6d5;})[_0xebe7('0x38')](respondWithFilteredResult(_0x2e3982,_0x19e7a3))[_0xebe7('0x3b')](handleError(_0x2e3982,null));};exports[_0xebe7('0x3c')]=function(_0x50ba09,_0x108f49){var _0x137d30={'raw':!![],'where':{'id':_0x50ba09[_0xebe7('0x3d')]['id']}},_0x1602d0={};_0x1602d0[_0xebe7('0x29')]=_[_0xebe7('0x2a')](db[_0xebe7('0x24')]['rawAttributes']);_0x1602d0[_0xebe7('0x2f')]=_[_0xebe7('0x2a')](_0x50ba09[_0xebe7('0x2f')]);_0x1602d0[_0xebe7('0x2b')]=_[_0xebe7('0x2d')](_0x1602d0[_0xebe7('0x29')],_0x1602d0[_0xebe7('0x2f')]);_0x137d30['attributes']=_[_0xebe7('0x2d')](_0x1602d0[_0xebe7('0x29')],qs['fields'](_0x50ba09[_0xebe7('0x2f')]['fields']));_0x137d30[_0xebe7('0x2c')]=_0x137d30['attributes']['length']?_0x137d30['attributes']:_0x1602d0[_0xebe7('0x29')];if(_0x50ba09[_0xebe7('0x2f')]['includeAll']){_0x137d30['include']=[{'all':!![]}];}_0x137d30=_['merge']({},_0x137d30,_0x50ba09[_0xebe7('0x37')]);return db[_0xebe7('0x24')][_0xebe7('0x3e')](_0x137d30)['then'](handleEntityNotFound(_0x108f49,null))[_0xebe7('0x38')](respondWithResult(_0x108f49,null))['catch'](handleError(_0x108f49,null));};exports['clone']=function(_0x40391b,_0x60f953){var _0x4e68c2={'where':{'id':_0x40391b[_0xebe7('0x3d')]['id']}},_0x519034={};_0x519034[_0xebe7('0x29')]=_[_0xebe7('0x2a')](db['Attachment'][_0xebe7('0x25')]);_0x4e68c2[_0xebe7('0x2c')]=_[_0xebe7('0x2d')](_0x519034['model'],qs['fields'](_0x40391b[_0xebe7('0x2f')][_0xebe7('0x2e')]));_0x4e68c2[_0xebe7('0x2c')]=_0x4e68c2[_0xebe7('0x2c')]['length']?_0x4e68c2[_0xebe7('0x2c')]:_0x519034[_0xebe7('0x29')];if(_0x40391b[_0xebe7('0x2f')]['includeAll']){_0x4e68c2[_0xebe7('0x3a')]=[{'all':!![]}];}_0x4e68c2=_[_0xebe7('0x3f')]({},_0x4e68c2,_0x40391b['options']);return db[_0xebe7('0x24')][_0xebe7('0x3e')](_0x4e68c2)[_0xebe7('0x38')](handleEntityNotFound(_0x60f953,null))[_0xebe7('0x38')](function(_0xbe338f){if(_0xbe338f){var _0x3821a2=_0xbe338f['get']({'plain':!![]});_0x3821a2=qs[_0xebe7('0x40')](_0x3821a2,['id',_0xebe7('0x41'),'updatedAt']);_0x40391b[_0xebe7('0x42')]=_[_0xebe7('0x40')](_0x40391b[_0xebe7('0x42')],['id',_0xebe7('0x41'),_0xebe7('0x43')]);return db[_0xebe7('0x24')][_0xebe7('0x44')](_['merge'](_0x3821a2,_0x40391b['body']),{'include':_0x40391b[_0xebe7('0x2f')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xebe7('0x38')](respondWithResult(_0x60f953,0xc9))['catch'](handleError(_0x60f953,null));};exports[_0xebe7('0x1f')]=function(_0x53fb23,_0x104e99){if(_0x53fb23[_0xebe7('0x42')]['id']){delete _0x53fb23[_0xebe7('0x42')]['id'];}return db[_0xebe7('0x24')][_0xebe7('0x3e')]({'where':{'id':_0x53fb23['params']['id']}})['then'](handleEntityNotFound(_0x104e99,null))[_0xebe7('0x38')](saveUpdates(_0x53fb23[_0xebe7('0x42')],null))[_0xebe7('0x38')](respondWithResult(_0x104e99,null))[_0xebe7('0x3b')](handleError(_0x104e99,null));};exports[_0xebe7('0x45')]=function(_0x22aa7f,_0x3ea044){return db[_0xebe7('0x24')][_0xebe7('0x3e')]({'where':{'id':_0x22aa7f[_0xebe7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3ea044,null))[_0xebe7('0x38')](removeEntity(_0x3ea044,null))[_0xebe7('0x3b')](handleError(_0x3ea044,null));};exports['create']=function(_0x41cc9d,_0x49ae7f,_0x55ac19){_0x41cc9d['body'][_0xebe7('0x22')]=_0x41cc9d['file'][_0xebe7('0x46')];_0x41cc9d[_0xebe7('0x42')][_0xebe7('0x47')]=_0x41cc9d['file'][_0xebe7('0x48')];_0x41cc9d[_0xebe7('0x42')][_0xebe7('0x27')]=_0x41cc9d[_0xebe7('0x49')][_0xebe7('0x4a')];return db['Attachment']['create'](_0x41cc9d[_0xebe7('0x42')])[_0xebe7('0x38')](respondWithResult(_0x49ae7f,0xc9))[_0xebe7('0x3b')](handleError(_0x49ae7f,null));};exports[_0xebe7('0x4b')]=function(_0x48d0b9,_0x4af066,_0x41ac71){return db[_0xebe7('0x24')]['findOne']({'where':{'id':_0x48d0b9[_0xebe7('0x3d')]['id']},'raw':!![]})[_0xebe7('0x38')](handleEntityNotFound(_0x4af066,null))[_0xebe7('0x38')](function(_0x56a2f3){if(_0x56a2f3){var _0x1d2871=_0x56a2f3['ChatOfflineMessageId']!==null;var _0x1fd87e=path[_0xebe7('0x4c')](config[_0xebe7('0x4d')],_0xebe7('0x4e'));if(_0x1d2871){_0x1fd87e=path['join'](_0x1fd87e,'offline-chat/');}var _0x1a44f7=path[_0xebe7('0x4c')](_0x1fd87e,_0x56a2f3['basename']);return _0x4af066[_0xebe7('0x4b')](_0x1a44f7);}})[_0xebe7('0x3b')](handleError(_0x4af066,null));};
\ No newline at end of file
index 55e315e..404ddc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d6f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x38712f,_0x52da2f){var _0x28c309=function(_0x57792f){while(--_0x57792f){_0x38712f['push'](_0x38712f['shift']());}};_0x28c309(++_0x52da2f);}(_0x9d6f,0x82));var _0xf9d6=function(_0x2be60a,_0x586f30){_0x2be60a=_0x2be60a-0x0;var _0x5ab51c=_0x9d6f[_0x2be60a];return _0x5ab51c;};'use strict';var _=require(_0xf9d6('0x0'));var util=require(_0xf9d6('0x1'));var logger=require(_0xf9d6('0x2'))(_0xf9d6('0x3'));var moment=require(_0xf9d6('0x4'));var BPromise=require(_0xf9d6('0x5'));var rp=require(_0xf9d6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9d6('0x7'));var config=require(_0xf9d6('0x8'));var attributes=require(_0xf9d6('0x9'));module[_0xf9d6('0xa')]=function(_0x2dbbca,_0x23aba5){return _0x2dbbca[_0xf9d6('0xb')](_0xf9d6('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4c5=['define','attachments','lodash','util','api','bluebird','request-promise','path','rimraf','./attachment.attributes'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xb4c5,0xa2));var _0x5b4c=function(_0x21fd83,_0x1e15ec){_0x21fd83=_0x21fd83-0x0;var _0x321ce2=_0xb4c5[_0x21fd83];return _0x321ce2;};'use strict';var _=require(_0x5b4c('0x0'));var util=require(_0x5b4c('0x1'));var logger=require('../../config/logger')(_0x5b4c('0x2'));var moment=require('moment');var BPromise=require(_0x5b4c('0x3'));var rp=require(_0x5b4c('0x4'));var fs=require('fs');var path=require(_0x5b4c('0x5'));var rimraf=require(_0x5b4c('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b4c('0x7'));module['exports']=function(_0x4ced6e,_0x44ec9f){return _0x4ced6e[_0x5b4c('0x8')]('Attachment',attributes,{'tableName':_0x5b4c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 912f7a2..910ade2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d86=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateAttachment','Attachment','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7d86,0x86));var _0x67d8=function(_0x11f59f,_0xb0a955){_0x11f59f=_0x11f59f-0x0;var _0x4d3734=_0x7d86[_0x11f59f];return _0x4d3734;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var moment=require(_0x67d8('0x1'));var BPromise=require(_0x67d8('0x2'));var rs=require(_0x67d8('0x3'));var fs=require('fs');var Redis=require(_0x67d8('0x4'));var db=require(_0x67d8('0x5'))['db'];var utils=require(_0x67d8('0x6'));var logger=require(_0x67d8('0x7'))('rpc');var config=require(_0x67d8('0x8'));var jayson=require(_0x67d8('0x9'));var client=jayson[_0x67d8('0xa')][_0x67d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2485fa,_0x282b7a,_0x30c690){return new BPromise(function(_0x16e834,_0x31726a){return client[_0x67d8('0xc')](_0x2485fa,_0x30c690)[_0x67d8('0xd')](function(_0x6bc54c){logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));logger[_0x67d8('0x11')](_0x67d8('0x12'),_0x282b7a,_0x67d8('0x10'),JSON[_0x67d8('0x13')](_0x6bc54c));if(_0x6bc54c[_0x67d8('0x14')]){if(_0x6bc54c[_0x67d8('0x14')]['code']===0x1f4){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')]['message']);return _0x31726a(_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);}logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);return _0x16e834(_0x6bc54c[_0x67d8('0x14')]['message']);}else{logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));_0x16e834(_0x6bc54c['result'][_0x67d8('0x15')]);}})[_0x67d8('0x16')](function(_0x4b2795){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x4b2795);_0x31726a(_0x4b2795);});});}exports[_0x67d8('0x17')]=function(_0xefaaea){var _0x23328d=this;return new Promise(function(_0x2a9e66,_0x5117d0){return db[_0x67d8('0x18')][_0x67d8('0x19')](_0xefaaea[_0x67d8('0x1a')],{'raw':_0xefaaea[_0x67d8('0x1b')]?_0xefaaea[_0x67d8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x67d8('0xd')](function(_0x1f682e){logger['info']('CreateAttachment',_0xefaaea);logger[_0x67d8('0x11')]('CreateAttachment',_0xefaaea,JSON[_0x67d8('0x13')](_0x1f682e));_0x2a9e66(_0x1f682e);})[_0x67d8('0x16')](function(_0xdcba3e){logger['error']('CreateAttachment',_0xdcba3e[_0x67d8('0x15')],_0xefaaea);_0x5117d0(_0x23328d[_0x67d8('0x14')](0x1f4,_0xdcba3e[_0x67d8('0x15')]));});});};
\ No newline at end of file
+var _0x750a=['error','code','Attachment,\x20%s,\x20%s','message','catch','body','options','then','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x6899c7,_0x363413){var _0x5186ee=function(_0x2f83a9){while(--_0x2f83a9){_0x6899c7['push'](_0x6899c7['shift']());}};_0x5186ee(++_0x363413);}(_0x750a,0x140));var _0xa750=function(_0x1be71c,_0x2a59f1){_0x1be71c=_0x1be71c-0x0;var _0x2f9123=_0x750a[_0x1be71c];return _0x2f9123;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('Attachment,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['CreateAttachment']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['Attachment']['create'](_0x433dbd[_0xa750('0x15')],{'raw':_0x433dbd['options']?_0x433dbd[_0xa750('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xa750('0x17')](function(_0x4a007d){logger[_0xa750('0xc')]('CreateAttachment',_0x433dbd);logger[_0xa750('0xe')]('CreateAttachment',_0x433dbd,JSON['stringify'](_0x4a007d));_0x4f1faa(_0x4a007d);})[_0xa750('0x14')](function(_0x52da84){logger[_0xa750('0x10')]('CreateAttachment',_0x52da84['message'],_0x433dbd);_0x36dcca(_0x1bde87['error'](0x1f4,_0x52da84['message']));});});};
\ No newline at end of file
index 0186057..7542cf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x1aac38,_0x53cea7){var _0x351295=function(_0x278c48){while(--_0x278c48){_0x1aac38['push'](_0x1aac38['shift']());}};_0x351295(++_0x53cea7);}(_0x757a,0xde));var _0xa757=function(_0x4ec529,_0x908ee2){_0x4ec529=_0x4ec529-0x0;var _0x34b500=_0x757a[_0x4ec529];return _0x34b500;};'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
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x104339,_0x1740d0){var _0xb9c57c=function(_0x3bc9d5){while(--_0x3bc9d5){_0x104339['push'](_0x104339['shift']());}};_0xb9c57c(++_0x1740d0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3401db,_0x2a62b1){_0x3401db=_0x3401db-0x0;var _0x2b7321=_0x5f2f[_0x3401db];return _0x2b7321;};'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('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
index c5586c6..5344893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79fc=['catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','undefined','activedirectory','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','blocked','blockedAt','online','admin','user','agent','disabled','add','minutes','clearBlockUser','getLicense'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x79fc,0x1a1));var _0xc79f=function(_0x2f257e,_0x49af2c){_0x2f257e=_0x2f257e-0x0;var _0x16293c=_0x79fc[_0x2f257e];return _0x16293c;};'use strict';var passport=require(_0xc79f('0x0'));var LocalStrategy=require(_0xc79f('0x1'))[_0xc79f('0x2')];var moment=require(_0xc79f('0x3'));var ActiveDirectory=require(_0xc79f('0x4'));var BPromise=require(_0xc79f('0x5'));var util=require(_0xc79f('0x6'));var db=require(_0xc79f('0x7'))['db'];var authService=require(_0xc79f('0x8'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x26d0f7){var _0x2b3f92=![];if(typeof _0x26d0f7['activedirectory']!==_0xc79f('0x9')){_0x2b3f92=_0x26d0f7[_0xc79f('0xa')][_0xc79f('0xb')]&&_0x26d0f7[_0xc79f('0xa')][_0xc79f('0xc')]&&_0x26d0f7[_0xc79f('0xa')][_0xc79f('0xd')];}return _0x2b3f92;}function adAuthenticate(_0x23317d,_0x141853,_0x122628){return new BPromise(function(_0xfbea15,_0x522d41){try{var _0x5ddb7a=new ActiveDirectory(_0x23317d);_0x5ddb7a[_0xc79f('0xe')](_0x141853,_0x122628,function(_0x2172f7,_0x1d05ea){if(_0x2172f7){logger['error'](_0xc79f('0xf'),_0x141853,util[_0xc79f('0x10')](_0x2172f7,{'showHidden':![],'depth':null}));_0x522d41(_0xc79f('0x11'));}else if(!_0x1d05ea){logger[_0xc79f('0x12')](_0xc79f('0x13'),_0x141853);_0x522d41(_0xc79f('0x11'));}else{_0xfbea15(_0x1d05ea);}});}catch(_0x165602){_0x522d41(_0x165602);}});}function ActiveDirectoryAuthenticate(_0x2934e1,_0x169b20,_0x53247c,_0x2c0581){var _0x9183d9,_0x8aceda;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xc79f('0x14'),_0x169b20);return _0x2c0581(null,![],{'message':_0xc79f('0x11')});}return db[_0xc79f('0x15')]['findOne']({'where':{'id':0x1},'attributes':[_0xc79f('0x16'),_0xc79f('0x17')],'raw':!![]})[_0xc79f('0x18')](function(_0x219268){_0x9183d9=_0x219268;if(!_0x9183d9[_0xc79f('0x16')]){logger[_0xc79f('0x12')](_0xc79f('0x19'),_0x169b20);throw new Error(_0xc79f('0x11'));}return _0x2934e1[_0xc79f('0x1a')]({'logging':!![],'attributes':['id',_0xc79f('0x1b'),_0xc79f('0x1c'),_0xc79f('0x1d'),_0xc79f('0x1e'),'disabled',_0xc79f('0x1f'),_0xc79f('0x20'),_0xc79f('0x21')],'where':{'name':_0x169b20,'role':{'$or':[_0xc79f('0x22'),_0xc79f('0x23'),_0xc79f('0x24')]},'adSsoEnabled':!![]}});})[_0xc79f('0x18')](function(_0x5c0db2){if(!_0x5c0db2||_0x5c0db2&&_0x5c0db2['name']!==_0x169b20){throw new Error(_0xc79f('0x11'));}_0x8aceda=_0x5c0db2;var _0xa704b4=_0x8aceda['name']+'@'+config[_0xc79f('0xa')][_0xc79f('0xd')];return adAuthenticate(config[_0xc79f('0xa')],_0xa704b4,_0x53247c);})['then'](function(_0x35519f){if(_0x8aceda[_0xc79f('0x25')]){throw new Error(_0xc79f('0x11'));}if(_0x9183d9[_0xc79f('0x17')]>0x0){if(_0x8aceda[_0xc79f('0x1f')]){if(moment(_0x8aceda[_0xc79f('0x20')])[_0xc79f('0x26')](_0x9183d9[_0xc79f('0x17')],_0xc79f('0x27'))>moment()){throw new Error(_0xc79f('0x11'));}return utils[_0xc79f('0x28')](_0x8aceda,0x0,![],null)[_0xc79f('0x18')](function(){return utils['getLicense'](_0x8aceda);})['then'](function(){return _0x2c0581(null,_0x8aceda);});}else{return utils[_0xc79f('0x29')](_0x8aceda)['then'](function(){return _0x2c0581(null,_0x8aceda);});}}else{return utils[_0xc79f('0x29')](_0x8aceda)[_0xc79f('0x18')](function(){return _0x2c0581(null,_0x8aceda);});}})[_0xc79f('0x2a')](function(_0x5c0bdf){return _0x2c0581(null,![],_0x5c0bdf);});}function handleError(_0x31a749,_0x2f73,_0x564d09){return _0x31a749[_0xc79f('0x2b')](_0x2f73||0x1f4)[_0xc79f('0x2c')]({'message':_0x564d09?_0x564d09['message']||_0x564d09:''});}exports[_0xc79f('0x2d')]=function(_0x557820,_0x490cc2,_0x468b05){passport[_0xc79f('0xe')](_0xc79f('0x2e'),function(_0x34ff34,_0x50501f,_0x308367){var _0x46817f=_0x34ff34||_0x308367;if(_0x46817f){return handleError(_0x490cc2,0x191,_0x46817f);}if(!_0x50501f){return handleError(_0x490cc2,0x194,{'message':_0xc79f('0x2f')});}else{var _0x3454c1={'payload':{'id':_0x50501f['id'],'role':_0x50501f['role']},'options':{'expiresIn':0x15180}};return authService[_0xc79f('0x30')](_0x3454c1)[_0xc79f('0x18')](function(_0x5c8cca){_0x490cc2[_0xc79f('0x31')]({'id':_0x50501f['id'],'token':_0x5c8cca,'statusCall':'','isAlreadyLogged':_0x50501f[_0xc79f('0x21')]});});}})(_0x557820,_0x490cc2,_0x468b05);};passport['use'](_0xc79f('0x2e'),new LocalStrategy({'usernameField':_0xc79f('0x1b'),'passwordField':_0xc79f('0x1c')},function(_0x5139f9,_0x1ded88,_0x23eccd){return ActiveDirectoryAuthenticate(db[_0xc79f('0x32')],_0x5139f9,_0x1ded88,_0x23eccd);}));
\ No newline at end of file
+var _0x06bf=['disabled','add','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','signToken','json','use','User','passport','passport-local','moment','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','blockDuration','then','adSsoEnabled','password','role','blocked','blockedAt','online','admin','user','agent','name','domain'];(function(_0x602fc0,_0x531591){var _0x56135d=function(_0x4d0744){while(--_0x4d0744){_0x602fc0['push'](_0x602fc0['shift']());}};_0x56135d(++_0x531591);}(_0x06bf,0x68));var _0xf06b=function(_0x5e987a,_0x1970a0){_0x5e987a=_0x5e987a-0x0;var _0x16d654=_0x06bf[_0x5e987a];return _0x16d654;};'use strict';var passport=require(_0xf06b('0x0'));var LocalStrategy=require(_0xf06b('0x1'))['Strategy'];var moment=require(_0xf06b('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0xf06b('0x3'));var db=require(_0xf06b('0x4'))['db'];var authService=require(_0xf06b('0x5'));var utils=require(_0xf06b('0x6'));var config=require(_0xf06b('0x7'));var logger=require(_0xf06b('0x8'))(_0xf06b('0x9'));function isActiveDirectoryConfigured(_0xfc13cf){var _0x1ea93f=![];if(typeof _0xfc13cf['activedirectory']!=='undefined'){_0x1ea93f=_0xfc13cf[_0xf06b('0xa')][_0xf06b('0xb')]&&_0xfc13cf['activedirectory'][_0xf06b('0xc')]&&_0xfc13cf[_0xf06b('0xa')]['domain'];}return _0x1ea93f;}function adAuthenticate(_0x1daca7,_0x521b2d,_0x41a56e){return new BPromise(function(_0x4107a5,_0x2503c9){try{var _0x14fe23=new ActiveDirectory(_0x1daca7);_0x14fe23[_0xf06b('0xd')](_0x521b2d,_0x41a56e,function(_0x52e7fb,_0x2e6e75){if(_0x52e7fb){logger[_0xf06b('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x521b2d,util[_0xf06b('0xf')](_0x52e7fb,{'showHidden':![],'depth':null}));_0x2503c9(_0xf06b('0x10'));}else if(!_0x2e6e75){logger[_0xf06b('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x521b2d);_0x2503c9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4107a5(_0x2e6e75);}});}catch(_0xf48708){_0x2503c9(_0xf48708);}});}function ActiveDirectoryAuthenticate(_0x5b41bd,_0x15cbfa,_0x577658,_0x12a8e1){var _0xc8907b,_0x25fddd;if(!isActiveDirectoryConfigured(config)){logger[_0xf06b('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x15cbfa);return _0x12a8e1(null,![],{'message':_0xf06b('0x10')});}return db['Setting'][_0xf06b('0x11')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xf06b('0x12')],'raw':!![]})[_0xf06b('0x13')](function(_0x39610c){_0xc8907b=_0x39610c;if(!_0xc8907b[_0xf06b('0x14')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x15cbfa);throw new Error(_0xf06b('0x10'));}return _0x5b41bd[_0xf06b('0x11')]({'logging':!![],'attributes':['id','name',_0xf06b('0x15'),'salt',_0xf06b('0x16'),'disabled',_0xf06b('0x17'),_0xf06b('0x18'),_0xf06b('0x19')],'where':{'name':_0x15cbfa,'role':{'$or':[_0xf06b('0x1a'),_0xf06b('0x1b'),_0xf06b('0x1c')]},'adSsoEnabled':!![]}});})[_0xf06b('0x13')](function(_0x43a12d){if(!_0x43a12d||_0x43a12d&&_0x43a12d[_0xf06b('0x1d')]!==_0x15cbfa){throw new Error(_0xf06b('0x10'));}_0x25fddd=_0x43a12d;var _0x17736c=_0x25fddd['name']+'@'+config[_0xf06b('0xa')][_0xf06b('0x1e')];return adAuthenticate(config['activedirectory'],_0x17736c,_0x577658);})[_0xf06b('0x13')](function(_0x86d567){if(_0x25fddd[_0xf06b('0x1f')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0xc8907b[_0xf06b('0x12')]>0x0){if(_0x25fddd[_0xf06b('0x17')]){if(moment(_0x25fddd[_0xf06b('0x18')])[_0xf06b('0x20')](_0xc8907b['blockDuration'],_0xf06b('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xf06b('0x22')](_0x25fddd,0x0,![],null)[_0xf06b('0x13')](function(){return utils['getLicense'](_0x25fddd);})['then'](function(){return _0x12a8e1(null,_0x25fddd);});}else{return utils[_0xf06b('0x23')](_0x25fddd)[_0xf06b('0x13')](function(){return _0x12a8e1(null,_0x25fddd);});}}else{return utils[_0xf06b('0x23')](_0x25fddd)[_0xf06b('0x13')](function(){return _0x12a8e1(null,_0x25fddd);});}})['catch'](function(_0x1e6399){return _0x12a8e1(null,![],_0x1e6399);});}function handleError(_0x2556a2,_0x38dc64,_0x39a91b){return _0x2556a2[_0xf06b('0x24')](_0x38dc64||0x1f4)[_0xf06b('0x25')]({'message':_0x39a91b?_0x39a91b[_0xf06b('0x26')]||_0x39a91b:''});}exports[_0xf06b('0x27')]=function(_0x8f62a1,_0x5e243d,_0x5ae56e){passport[_0xf06b('0xd')](_0xf06b('0x28'),function(_0x593a65,_0x3118ad,_0x2f17f9){var _0x5870cb=_0x593a65||_0x2f17f9;if(_0x5870cb){return handleError(_0x5e243d,0x191,_0x5870cb);}if(!_0x3118ad){return handleError(_0x5e243d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x206be0={'payload':{'id':_0x3118ad['id'],'role':_0x3118ad[_0xf06b('0x16')]},'options':{'expiresIn':0x15180}};return authService[_0xf06b('0x29')](_0x206be0)['then'](function(_0x59417b){_0x5e243d[_0xf06b('0x2a')]({'id':_0x3118ad['id'],'token':_0x59417b,'statusCall':'','isAlreadyLogged':_0x3118ad[_0xf06b('0x19')]});});}})(_0x8f62a1,_0x5e243d,_0x5ae56e);};passport[_0xf06b('0x2b')](_0xf06b('0x28'),new LocalStrategy({'usernameField':_0xf06b('0x1d'),'passwordField':_0xf06b('0x15')},function(_0x33d7f1,_0x4ae8be,_0x5b5766){return ActiveDirectoryAuthenticate(db[_0xf06b('0x2c')],_0x33d7f1,_0x4ae8be,_0x5b5766);}));
\ No newline at end of file
index d6a210b..a1fe293 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfa0=['login','exports','express','./authActiveDirectory.controller','post'];(function(_0x4b836d,_0x319cd3){var _0x49816f=function(_0x413189){while(--_0x413189){_0x4b836d['push'](_0x4b836d['shift']());}};_0x49816f(++_0x319cd3);}(_0xdfa0,0x75));var _0x0dfa=function(_0x5c997,_0x37b3f2){_0x5c997=_0x5c997-0x0;var _0x519ac9=_0xdfa0[_0x5c997];return _0x519ac9;};'use strict';var express=require(_0x0dfa('0x0'));var router=express['Router']();var controller=require(_0x0dfa('0x1'));router[_0x0dfa('0x2')]('/',controller[_0x0dfa('0x3')]);module[_0x0dfa('0x4')]=router;
\ No newline at end of file
+var _0x4b3e=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x218091,_0x844575){var _0x51a469=function(_0x5ce65f){while(--_0x5ce65f){_0x218091['push'](_0x218091['shift']());}};_0x51a469(++_0x844575);}(_0x4b3e,0x1f1));var _0xe4b3=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x4b3e[_0x45f951];return _0x24756c;};'use strict';var express=require(_0xe4b3('0x0'));var router=express[_0xe4b3('0x1')]();var controller=require(_0xe4b3('0x2'));router[_0xe4b3('0x3')]('/',controller[_0xe4b3('0x4')]);module[_0xe4b3('0x5')]=router;
\ No newline at end of file
index 1c147d0..a0606de 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(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7a54,0x106));var _0x47a5=function(_0x57b037,_0x18e307){_0x57b037=_0x57b037-0x0;var _0x1cf287=_0x7a54[_0x57b037];return _0x1cf287;};'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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x539e14,_0x2c94){var _0x3be693=function(_0x2c0310){while(--_0x2c0310){_0x539e14['push'](_0x539e14['shift']());}};_0x3be693(++_0x2c94);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
index af9ec90..4dca3da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d55=['get','login','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x21b3ea,_0x1af79d){var _0x42bdc6=function(_0x330f0a){while(--_0x330f0a){_0x21b3ea['push'](_0x21b3ea['shift']());}};_0x42bdc6(++_0x1af79d);}(_0x5d55,0x1a4));var _0x55d5=function(_0x2565be,_0x12600f){_0x2565be=_0x2565be-0x0;var _0x8fa28d=_0x5d55[_0x2565be];return _0x8fa28d;};'use strict';var express=require('express');var passport=require(_0x55d5('0x0'));var router=express['Router']();var controller=require(_0x55d5('0x1'));var userController=require(_0x55d5('0x2'));var authService=require('../../components/auth/service');router[_0x55d5('0x3')]('/',controller[_0x55d5('0x4')]);router[_0x55d5('0x3')]('/callback',controller[_0x55d5('0x5')],authService[_0x55d5('0x6')],userController[_0x55d5('0x4')],authService[_0x55d5('0x7')]);module[_0x55d5('0x8')]=router;
\ No newline at end of file
+var _0x0303=['/callback','callback','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x1fb01c,_0x56752a){var _0x26f405=function(_0x2e9455){while(--_0x2e9455){_0x1fb01c['push'](_0x1fb01c['shift']());}};_0x26f405(++_0x56752a);}(_0x0303,0x159));var _0x3030=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x0303[_0x2f3848];return _0x102668;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0x3030('0x0'));var userController=require(_0x3030('0x1'));var authService=require(_0x3030('0x2'));router[_0x3030('0x3')]('/',controller[_0x3030('0x4')]);router['get'](_0x3030('0x5'),controller[_0x3030('0x6')],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
index ee412ed..c3a46ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc97b=['local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','util','passport','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','minutes','clearBlockUser','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login'];(function(_0x3cba00,_0x56face){var _0xe71f2f=function(_0x35695c){while(--_0x35695c){_0x3cba00['push'](_0x3cba00['shift']());}};_0xe71f2f(++_0x56face);}(_0xc97b,0x1b5));var _0xbc97=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0xc97b[_0x3b3210];return _0x5b5484;};'use strict';var util=require(_0xbc97('0x0'));var passport=require(_0xbc97('0x1'));var LocalStrategy=require('passport-local')[_0xbc97('0x2')];var jayson=require(_0xbc97('0x3'));var _=require(_0xbc97('0x4'));var rs=require('randomstring');var moment=require(_0xbc97('0x5'));var db=require(_0xbc97('0x6'))['db'];var authService=require(_0xbc97('0x7'));var utils=require(_0xbc97('0x8'));var client=jayson[_0xbc97('0x9')][_0xbc97('0xa')]({'port':0x232b});function localAuthenticate(_0x2920f7,_0x438078,_0x1a2332,_0x18e7cb){var _0x5a6f28,_0x5f42fb;return db[_0xbc97('0xb')][_0xbc97('0xc')]({'where':{'id':0x1},'attributes':[_0xbc97('0xd'),_0xbc97('0xe')],'raw':!![]})[_0xbc97('0xf')](function(_0x30ec76){_0x5a6f28=_0x30ec76;return _0x2920f7[_0xbc97('0xc')]({'attributes':['id',_0xbc97('0x10'),_0xbc97('0x11'),_0xbc97('0x12'),_0xbc97('0x13'),_0xbc97('0x14'),'blocked',_0xbc97('0x15'),_0xbc97('0x16')],'where':{'name':_0x438078,'role':{'$or':['admin',_0xbc97('0x17'),_0xbc97('0x18')]}}});})[_0xbc97('0xf')](function(_0x127dd3){if(!_0x127dd3||_0x127dd3&&_0x127dd3[_0xbc97('0x10')]!==_0x438078){throw new Error(_0xbc97('0x19'));}else{_0x5f42fb=_0x127dd3;return _0x5f42fb;}})['then'](function(){_0x5f42fb[_0xbc97('0x1a')](_0x1a2332,function(_0x5eecb2,_0x3e7fb5){var _0x941a9e=_0x5f42fb[_0xbc97('0x16')]+0x1;if(_0x5eecb2){return _0x18e7cb(_0x5eecb2);}else if(!_0x3e7fb5){if(_0x5f42fb[_0xbc97('0x14')]){return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});}else if(_0x5a6f28[_0xbc97('0xd')]>0x0){if(_0x5f42fb[_0xbc97('0x1b')]){if(_0x5a6f28[_0xbc97('0xe')]>0x0){if(moment(_0x5f42fb[_0xbc97('0x15')])['add'](_0x5a6f28[_0xbc97('0xe')],_0xbc97('0x1c'))>moment()){return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});}else{return utils[_0xbc97('0x1d')](_0x5f42fb,_0x941a9e,![],null)['then'](function(){return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});});}}else{return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});}}else{if(_0x941a9e>=_0x5a6f28[_0xbc97('0xd')]){return utils[_0xbc97('0x1d')](_0x5f42fb,0x0,!![],moment())['then'](function(){return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});});}else{return utils['clearBlockUser'](_0x5f42fb,_0x941a9e,![],null)[_0xbc97('0xf')](function(){return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});});}}}else{return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});}}else{if(_0x5f42fb[_0xbc97('0x14')]){return _0x18e7cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5a6f28[_0xbc97('0xd')]>0x0){if(_0x5f42fb[_0xbc97('0x1b')]){if(_0x5a6f28[_0xbc97('0xe')]>0x0){if(moment(_0x5f42fb[_0xbc97('0x15')])['add'](_0x5a6f28['blockDuration'],_0xbc97('0x1c'))>moment()){return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});}else{return utils[_0xbc97('0x1d')](_0x5f42fb,0x0,![],null)[_0xbc97('0xf')](function(){return utils['getLicense'](_0x5f42fb);})[_0xbc97('0xf')](function(){return _0x18e7cb(null,_0x5f42fb);});}}else{return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});}}else{return utils[_0xbc97('0x1d')](_0x5f42fb,0x0,![],null)[_0xbc97('0xf')](function(){return utils['getLicense'](_0x5f42fb);})[_0xbc97('0xf')](function(){return _0x18e7cb(null,_0x5f42fb);})[_0xbc97('0x1e')](function(_0x58cb51){return _0x18e7cb(null,![],_0x58cb51);});}}else{if(_0x5f42fb[_0xbc97('0x1b')]){return _0x18e7cb(null,![],{'message':_0xbc97('0x19')});}else{return utils['getLicense'](_0x5f42fb)[_0xbc97('0xf')](function(){return _0x18e7cb(null,_0x5f42fb);});}}}});})['catch'](function(_0x3cc928){return _0x18e7cb(null,![],_0x3cc928);});}function sendServiceMail(_0x3231cf){return db['MailAccount'][_0xbc97('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xbc97('0x10'),_0xbc97('0x20')],'include':[{'model':db[_0xbc97('0x21')],'as':_0xbc97('0x22'),'include':[{'model':db[_0xbc97('0x23')],'as':_0xbc97('0x23')}]}]})['then'](function(_0x1d896b){if(!_0x1d896b){throw new Error(_0xbc97('0x24'));}var _0x7f182b=_0x1d896b[_0xbc97('0x25')]();var _0x1db3de={'account':_0x7f182b,'message':_['merge']({'from':util[_0xbc97('0x26')](_0xbc97('0x27'),_0x1d896b[_0xbc97('0x10')],_0x1d896b[_0xbc97('0x20')]||_0x1d896b[_0xbc97('0x22')][_0xbc97('0x17')])},_0x3231cf)};return client[_0xbc97('0x28')](_0xbc97('0x29'),_0x1db3de);})['then'](function(_0x537eda){if(_0x537eda[_0xbc97('0x2a')]){throw new Error(util[_0xbc97('0x26')](_0xbc97('0x2b'),_0x537eda['error'][_0xbc97('0x2c')]||JSON[_0xbc97('0x2d')](_0x537eda[_0xbc97('0x2a')])));}return!![];});}function handleError(_0x38371e,_0x5aa2e7,_0x365506){return _0x38371e[_0xbc97('0x2e')](_0x5aa2e7||0x1f4)[_0xbc97('0x2f')]({'message':_0x365506?_0x365506['message']||_0x365506:''});}exports[_0xbc97('0x30')]=function(_0x2d89d9,_0x527a74,_0x428a79){passport[_0xbc97('0x1a')](_0xbc97('0x31'),function(_0x47451c,_0x5291d0,_0x392586){var _0x4b3c08=_0x47451c||_0x392586;if(_0x4b3c08){return handleError(_0x527a74,0x191,_0x4b3c08);}if(!_0x5291d0){return handleError(_0x527a74,0x194,{'message':_0xbc97('0x32')});}else{var _0x52a5f0={'payload':{'id':_0x5291d0['id'],'role':_0x5291d0['role']},'options':{'expiresIn':0x15180}};return authService[_0xbc97('0x33')](_0x52a5f0)['then'](function(_0x1a129f){_0x527a74[_0xbc97('0x34')]({'id':_0x5291d0['id'],'token':_0x1a129f,'statusCall':'','isAlreadyLogged':_0x5291d0[_0xbc97('0x35')]});});}})(_0x2d89d9,_0x527a74,_0x428a79);};exports['forgot']=function(_0x3ec0d9,_0x7b8680){if(!_0x3ec0d9[_0xbc97('0x36')][_0xbc97('0x20')]){return handleError(_0x7b8680,0x1f4,{'message':_0xbc97('0x37')});}var _0x4e9e70=rs[_0xbc97('0x38')]();_0x3ec0d9['body']['email']=_0x3ec0d9[_0xbc97('0x36')][_0xbc97('0x20')][_0xbc97('0x39')]()[_0xbc97('0x3a')]();var _0x3e5ddc;return db[_0xbc97('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xbc97('0xe')],'raw':!![]})[_0xbc97('0xf')](function(_0x544ceb){_0x3e5ddc=_0x544ceb;return db['User'][_0xbc97('0x1f')]({'where':{'email':_0x3ec0d9[_0xbc97('0x36')][_0xbc97('0x20')]}});})[_0xbc97('0xf')](function(_0xabcafd){if(!_0xabcafd){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xabcafd[_0xbc97('0x14')]){throw new Error(_0xbc97('0x3b'));}if(_0xabcafd[_0xbc97('0x1b')]){if(moment(_0xabcafd[_0xbc97('0x15')])[_0xbc97('0x3c')](_0x3e5ddc[_0xbc97('0xe')],_0xbc97('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xabcafd[_0xbc97('0x1b')]=![];_0xabcafd[_0xbc97('0x15')]=null;}}_0xabcafd[_0xbc97('0x3d')]=_0x4e9e70;_0xabcafd[_0xbc97('0x3e')]=Date[_0xbc97('0x3f')]()+0x36ee80;return _0xabcafd[_0xbc97('0x40')]();})[_0xbc97('0xf')](function(){return sendServiceMail({'to':_0x3ec0d9[_0xbc97('0x36')]['email'],'subject':_0xbc97('0x41'),'text':_0xbc97('0x42')+_0xbc97('0x43')+_0xbc97('0x44')+_0x3ec0d9[_0xbc97('0x45')][_0xbc97('0x46')]+'/reset/'+_0x4e9e70+'\x0a\x0a'+_0xbc97('0x47')});})[_0xbc97('0xf')](function(){_0x7b8680[_0xbc97('0x2e')](0xc8)[_0xbc97('0x2f')]({'message':_0xbc97('0x48')});})[_0xbc97('0x1e')](function(_0xaaecc3){return handleError(_0x7b8680,0x1f4,_0xaaecc3);});};exports[_0xbc97('0x49')]=function(_0x1497bf,_0x5ac756){return db[_0xbc97('0x4a')][_0xbc97('0x1f')]({'where':{'resetPasswordToken':_0x1497bf[_0xbc97('0x4b')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xbc97('0xf')](function(_0x5ea0e1){if(!_0x5ea0e1){throw new Error(_0xbc97('0x4c'));}return db[_0xbc97('0xb')][_0xbc97('0xc')]({'attributes':['id',_0xbc97('0x4d'),_0xbc97('0x4e'),'passwordHistoryLimit']})[_0xbc97('0xf')](function(_0x4097aa){if(_0x4097aa[_0xbc97('0x4d')])authService['validatePasswordPattern'](_0x1497bf['body'][_0xbc97('0x11')]);if(!_0x4097aa[_0xbc97('0x4e')]||!_0x5ea0e1[_0xbc97('0x4f')])return _0x5ea0e1;authService[_0xbc97('0x50')](_0x1497bf[_0xbc97('0x36')][_0xbc97('0x11')],_0x5ea0e1[_0xbc97('0x4f')],_0x4097aa['passwordHistoryLimit']);return _0x5ea0e1;})[_0xbc97('0xf')](function(){_0x5ea0e1[_0xbc97('0x11')]=_0x1497bf[_0xbc97('0x36')][_0xbc97('0x11')];_0x5ea0e1[_0xbc97('0x3d')]=null;_0x5ea0e1[_0xbc97('0x3e')]=null;return _0x5ea0e1['save']();});})[_0xbc97('0xf')](function(){_0x5ac756[_0xbc97('0x2e')](0xc8)[_0xbc97('0x2f')]({'message':'Password\x20reset!'});})[_0xbc97('0x1e')](function(_0x575d87){return handleError(_0x5ac756,0x1f4,_0x575d87);});};passport['use'](_0xbc97('0x31'),new LocalStrategy({'usernameField':_0xbc97('0x10'),'passwordField':_0xbc97('0x11')},function(_0x3d929c,_0x34752c,_0x2d21bb){return localAuthenticate(db[_0xbc97('0x4a')],_0x3d929c,_0x34752c,_0x2d21bb);}));
\ No newline at end of file
+var _0x4c9c=['moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','then','password','disabled','blocked','blockedAt','loginAttempts','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','email','SendMail','error','message','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','randomstring'];(function(_0x2fadb6,_0xce4919){var _0xba4e8a=function(_0x5d5fc1){while(--_0x5d5fc1){_0x2fadb6['push'](_0x2fadb6['shift']());}};_0xba4e8a(++_0xce4919);}(_0x4c9c,0x12e));var _0xc4c9=function(_0x21ba7d,_0x3721f1){_0x21ba7d=_0x21ba7d-0x0;var _0x1445b6=_0x4c9c[_0x21ba7d];return _0x1445b6;};'use strict';var util=require(_0xc4c9('0x0'));var passport=require(_0xc4c9('0x1'));var LocalStrategy=require(_0xc4c9('0x2'))[_0xc4c9('0x3')];var jayson=require(_0xc4c9('0x4'));var _=require('lodash');var rs=require(_0xc4c9('0x5'));var moment=require(_0xc4c9('0x6'));var db=require(_0xc4c9('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc4c9('0x8'));var client=jayson[_0xc4c9('0x9')][_0xc4c9('0xa')]({'port':0x232b});function localAuthenticate(_0x4bc179,_0x3d3202,_0x408e8e,_0x2dc461){var _0x31c267,_0x204bf4;return db[_0xc4c9('0xb')][_0xc4c9('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xc4c9('0xd')](function(_0x2d99c3){_0x31c267=_0x2d99c3;return _0x4bc179[_0xc4c9('0xc')]({'attributes':['id','name',_0xc4c9('0xe'),'salt','role',_0xc4c9('0xf'),_0xc4c9('0x10'),_0xc4c9('0x11'),_0xc4c9('0x12')],'where':{'name':_0x3d3202,'role':{'$or':['admin','user',_0xc4c9('0x13')]}}});})[_0xc4c9('0xd')](function(_0x454ae1){if(!_0x454ae1||_0x454ae1&&_0x454ae1[_0xc4c9('0x14')]!==_0x3d3202){throw new Error(_0xc4c9('0x15'));}else{_0x204bf4=_0x454ae1;return _0x204bf4;}})[_0xc4c9('0xd')](function(){_0x204bf4[_0xc4c9('0x16')](_0x408e8e,function(_0x216e1e,_0xf44c3f){var _0x5ec20f=_0x204bf4[_0xc4c9('0x12')]+0x1;if(_0x216e1e){return _0x2dc461(_0x216e1e);}else if(!_0xf44c3f){if(_0x204bf4[_0xc4c9('0xf')]){return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});}else if(_0x31c267[_0xc4c9('0x17')]>0x0){if(_0x204bf4[_0xc4c9('0x10')]){if(_0x31c267[_0xc4c9('0x18')]>0x0){if(moment(_0x204bf4[_0xc4c9('0x11')])[_0xc4c9('0x19')](_0x31c267['blockDuration'],'minutes')>moment()){return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});}else{return utils[_0xc4c9('0x1a')](_0x204bf4,_0x5ec20f,![],null)[_0xc4c9('0xd')](function(){return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});});}}else{return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});}}else{if(_0x5ec20f>=_0x31c267[_0xc4c9('0x17')]){return utils['clearBlockUser'](_0x204bf4,0x0,!![],moment())['then'](function(){return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});});}else{return utils[_0xc4c9('0x1a')](_0x204bf4,_0x5ec20f,![],null)[_0xc4c9('0xd')](function(){return _0x2dc461(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});}}else{if(_0x204bf4[_0xc4c9('0xf')]){return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});}else if(_0x31c267[_0xc4c9('0x17')]>0x0){if(_0x204bf4[_0xc4c9('0x10')]){if(_0x31c267['blockDuration']>0x0){if(moment(_0x204bf4[_0xc4c9('0x11')])[_0xc4c9('0x19')](_0x31c267[_0xc4c9('0x18')],_0xc4c9('0x1b'))>moment()){return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});}else{return utils['clearBlockUser'](_0x204bf4,0x0,![],null)[_0xc4c9('0xd')](function(){return utils['getLicense'](_0x204bf4);})[_0xc4c9('0xd')](function(){return _0x2dc461(null,_0x204bf4);});}}else{return _0x2dc461(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc4c9('0x1a')](_0x204bf4,0x0,![],null)[_0xc4c9('0xd')](function(){return utils[_0xc4c9('0x1c')](_0x204bf4);})[_0xc4c9('0xd')](function(){return _0x2dc461(null,_0x204bf4);})[_0xc4c9('0x1d')](function(_0x2fb27d){return _0x2dc461(null,![],_0x2fb27d);});}}else{if(_0x204bf4[_0xc4c9('0x10')]){return _0x2dc461(null,![],{'message':_0xc4c9('0x15')});}else{return utils[_0xc4c9('0x1c')](_0x204bf4)['then'](function(){return _0x2dc461(null,_0x204bf4);});}}}});})[_0xc4c9('0x1d')](function(_0x326b05){return _0x2dc461(null,![],_0x326b05);});}function sendServiceMail(_0x24ee95){return db[_0xc4c9('0x1e')][_0xc4c9('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xc4c9('0x14'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xc4c9('0x20'),'include':[{'model':db[_0xc4c9('0x21')],'as':_0xc4c9('0x21')}]}]})['then'](function(_0x486223){if(!_0x486223){throw new Error(_0xc4c9('0x22'));}var _0x23cb5c=_0x486223['getSmtpOptions']();var _0x3e12b8={'account':_0x23cb5c,'message':_['merge']({'from':util[_0xc4c9('0x23')](_0xc4c9('0x24'),_0x486223[_0xc4c9('0x14')],_0x486223[_0xc4c9('0x25')]||_0x486223['Smtp']['user'])},_0x24ee95)};return client['request'](_0xc4c9('0x26'),_0x3e12b8);})['then'](function(_0x1d42c9){if(_0x1d42c9[_0xc4c9('0x27')]){throw new Error(util[_0xc4c9('0x23')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1d42c9[_0xc4c9('0x27')][_0xc4c9('0x28')]||JSON['stringify'](_0x1d42c9[_0xc4c9('0x27')])));}return!![];});}function handleError(_0x29866e,_0x4e137d,_0x5d5661){return _0x29866e['status'](_0x4e137d||0x1f4)[_0xc4c9('0x29')]({'message':_0x5d5661?_0x5d5661[_0xc4c9('0x28')]||_0x5d5661:''});}exports[_0xc4c9('0x2a')]=function(_0x17097c,_0x5ef1f5,_0xeaf658){passport['authenticate'](_0xc4c9('0x2b'),function(_0x22edb9,_0x2f3c1e,_0x4ed98a){var _0x1f3253=_0x22edb9||_0x4ed98a;if(_0x1f3253){return handleError(_0x5ef1f5,0x191,_0x1f3253);}if(!_0x2f3c1e){return handleError(_0x5ef1f5,0x194,{'message':_0xc4c9('0x2c')});}else{var _0x2b0d16={'payload':{'id':_0x2f3c1e['id'],'role':_0x2f3c1e['role']},'options':{'expiresIn':0x15180}};return authService[_0xc4c9('0x2d')](_0x2b0d16)[_0xc4c9('0xd')](function(_0x3b51f1){_0x5ef1f5[_0xc4c9('0x2e')]({'id':_0x2f3c1e['id'],'token':_0x3b51f1,'statusCall':'','isAlreadyLogged':_0x2f3c1e[_0xc4c9('0x2f')]});});}})(_0x17097c,_0x5ef1f5,_0xeaf658);};exports[_0xc4c9('0x30')]=function(_0x303e29,_0x42065a){if(!_0x303e29[_0xc4c9('0x31')]['email']){return handleError(_0x42065a,0x1f4,{'message':_0xc4c9('0x32')});}var _0x59df1f=rs[_0xc4c9('0x33')]();_0x303e29[_0xc4c9('0x31')][_0xc4c9('0x25')]=_0x303e29[_0xc4c9('0x31')][_0xc4c9('0x25')][_0xc4c9('0x34')]()[_0xc4c9('0x35')]();var _0x3bff53;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc4c9('0x17'),_0xc4c9('0x18')],'raw':!![]})[_0xc4c9('0xd')](function(_0x2e0f7c){_0x3bff53=_0x2e0f7c;return db['User'][_0xc4c9('0x1f')]({'where':{'email':_0x303e29[_0xc4c9('0x31')][_0xc4c9('0x25')]}});})[_0xc4c9('0xd')](function(_0x24c30c){if(!_0x24c30c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x24c30c[_0xc4c9('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x24c30c[_0xc4c9('0x10')]){if(moment(_0x24c30c['blockedAt'])['add'](_0x3bff53['blockDuration'],_0xc4c9('0x1b'))>moment()){throw new Error(_0xc4c9('0x36'));}else{_0x24c30c[_0xc4c9('0x10')]=![];_0x24c30c[_0xc4c9('0x11')]=null;}}_0x24c30c[_0xc4c9('0x37')]=_0x59df1f;_0x24c30c[_0xc4c9('0x38')]=Date[_0xc4c9('0x39')]()+0x36ee80;return _0x24c30c[_0xc4c9('0x3a')]();})[_0xc4c9('0xd')](function(){return sendServiceMail({'to':_0x303e29['body'][_0xc4c9('0x25')],'subject':_0xc4c9('0x3b'),'text':'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'+_0xc4c9('0x3c')+_0x303e29['headers']['host']+_0xc4c9('0x3d')+_0x59df1f+'\x0a\x0a'+_0xc4c9('0x3e')});})['then'](function(){_0x42065a[_0xc4c9('0x3f')](0xc8)[_0xc4c9('0x29')]({'message':_0xc4c9('0x40')});})[_0xc4c9('0x1d')](function(_0x26dae3){return handleError(_0x42065a,0x1f4,_0x26dae3);});};exports[_0xc4c9('0x41')]=function(_0x154936,_0x2dacf5){return db[_0xc4c9('0x42')][_0xc4c9('0x1f')]({'where':{'resetPasswordToken':_0x154936[_0xc4c9('0x43')][_0xc4c9('0x44')],'resetPasswordExpires':{'$gt':Date[_0xc4c9('0x39')]()}}})['then'](function(_0x5bc300){if(!_0x5bc300){throw new Error(_0xc4c9('0x45'));}return db[_0xc4c9('0xb')][_0xc4c9('0xc')]({'attributes':['id',_0xc4c9('0x46'),_0xc4c9('0x47'),_0xc4c9('0x48')]})[_0xc4c9('0xd')](function(_0x3b2337){if(_0x3b2337['securePassword'])authService[_0xc4c9('0x49')](_0x154936[_0xc4c9('0x31')][_0xc4c9('0xe')]);if(!_0x3b2337[_0xc4c9('0x47')]||!_0x5bc300[_0xc4c9('0x4a')])return _0x5bc300;authService[_0xc4c9('0x4b')](_0x154936[_0xc4c9('0x31')][_0xc4c9('0xe')],_0x5bc300[_0xc4c9('0x4a')],_0x3b2337[_0xc4c9('0x48')]);return _0x5bc300;})[_0xc4c9('0xd')](function(){_0x5bc300[_0xc4c9('0xe')]=_0x154936[_0xc4c9('0x31')][_0xc4c9('0xe')];_0x5bc300['resetPasswordToken']=null;_0x5bc300[_0xc4c9('0x38')]=null;return _0x5bc300[_0xc4c9('0x3a')]();});})[_0xc4c9('0xd')](function(){_0x2dacf5[_0xc4c9('0x3f')](0xc8)[_0xc4c9('0x29')]({'message':_0xc4c9('0x4c')});})[_0xc4c9('0x1d')](function(_0x4d0703){return handleError(_0x2dacf5,0x1f4,_0x4d0703);});};passport['use'](_0xc4c9('0x2b'),new LocalStrategy({'usernameField':_0xc4c9('0x14'),'passwordField':_0xc4c9('0xe')},function(_0x3cd498,_0x2f6e57,_0x290074){return localAuthenticate(db[_0xc4c9('0x42')],_0x3cd498,_0x2f6e57,_0x290074);}));
\ No newline at end of file
index 23943cd..0601d83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x354e=['forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x354e,0x72));var _0xe354=function(_0x451038,_0x58e92e){_0x451038=_0x451038-0x0;var _0x426419=_0x354e[_0x451038];return _0x426419;};'use strict';var express=require(_0xe354('0x0'));var router=express[_0xe354('0x1')]();var controller=require(_0xe354('0x2'));router[_0xe354('0x3')]('/',controller[_0xe354('0x4')]);router[_0xe354('0x3')](_0xe354('0x5'),controller[_0xe354('0x6')]);router['post'](_0xe354('0x7'),controller[_0xe354('0x8')]);module[_0xe354('0x9')]=router;
\ No newline at end of file
+var _0x2f5e=['login','forgot','/reset/:token','reset','exports','express','Router','post'];(function(_0x1da053,_0x9d2ac3){var _0x3523d8=function(_0x49dcde){while(--_0x49dcde){_0x1da053['push'](_0x1da053['shift']());}};_0x3523d8(++_0x9d2ac3);}(_0x2f5e,0x185));var _0xe2f5=function(_0x2ce999,_0x1332a5){_0x2ce999=_0x2ce999-0x0;var _0x3d911d=_0x2f5e[_0x2ce999];return _0x3d911d;};'use strict';var express=require(_0xe2f5('0x0'));var router=express[_0xe2f5('0x1')]();var controller=require('./authLocal.controller');router[_0xe2f5('0x2')]('/',controller[_0xe2f5('0x3')]);router[_0xe2f5('0x2')]('/forgot',controller[_0xe2f5('0x4')]);router['post'](_0xe2f5('0x5'),controller[_0xe2f5('0x6')]);module[_0xe2f5('0x7')]=router;
\ No newline at end of file
index e43215d..0b55afd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebde=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1b3c2c,_0x2e196c){var _0x4a2641=function(_0x37fadc){while(--_0x37fadc){_0x1b3c2c['push'](_0x1b3c2c['shift']());}};_0x4a2641(++_0x2e196c);}(_0xebde,0x1f1));var _0xeebd=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xebde[_0x21f9c2];return _0x3da17f;};'use strict';var Sequelize=require(_0xeebd('0x0'));module[_0xeebd('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xeebd('0x2')]},'description':{'type':Sequelize[_0xeebd('0x2')]},'status':{'type':Sequelize[_0xeebd('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0bc7=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x0bc7,0x17a));var _0x70bc=function(_0x459c85,_0x1c9a6b){_0x459c85=_0x459c85-0x0;var _0x5496cb=_0x0bc7[_0x459c85];return _0x5496cb;};'use strict';var Sequelize=require(_0x70bc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x70bc('0x1')]},'description':{'type':Sequelize[_0x70bc('0x1')]},'status':{'type':Sequelize[_0x70bc('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x70bc('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index 8da2fb4..7e407eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc695=['keys','include','options','find','create','body','update','destroy','addConditions','ids','omit','getConditions','sort','addActions','getActions','findOne','Action','eml-format','rimraf','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','then','stack','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','VIRTUAL','Automation','includeAll','findAll','catch','show','params'];(function(_0xf919f9,_0x1dd5e5){var _0x4235e1=function(_0x6bb1ec){while(--_0x6bb1ec){_0xf919f9['push'](_0xf919f9['shift']());}};_0x4235e1(++_0x1dd5e5);}(_0xc695,0x197));var _0x5c69=function(_0x1ed034,_0x5d495d){_0x1ed034=_0x1ed034-0x0;var _0x4a82b7=_0xc695[_0x1ed034];return _0x4a82b7;};'use strict';var emlformat=require(_0x5c69('0x0'));var rimraf=require(_0x5c69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5c69('0x2'));var moment=require(_0x5c69('0x3'));var BPromise=require(_0x5c69('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5c69('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5c69('0x6'));var fs=require('fs');var fs_extra=require(_0x5c69('0x7'));var _=require(_0x5c69('0x8'));var squel=require(_0x5c69('0x9'));var crypto=require('crypto');var jsforce=require(_0x5c69('0xa'));var deskjs=require(_0x5c69('0xb'));var toCsv=require(_0x5c69('0xc'));var querystring=require(_0x5c69('0xd'));var Papa=require(_0x5c69('0xe'));var Redis=require('ioredis');var authService=require(_0x5c69('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c69('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x5c69('0x11'));var config=require(_0x5c69('0x12'));var licenseUtil=require(_0x5c69('0x13'));var db=require(_0x5c69('0x14'))['db'];function respondWithStatusCode(_0x42bf5a,_0x1df0a6){_0x1df0a6=_0x1df0a6||0xcc;return function(_0x13c031){if(_0x13c031){return _0x42bf5a[_0x5c69('0x15')](_0x1df0a6);}return _0x42bf5a[_0x5c69('0x16')](_0x1df0a6)['end']();};}function respondWithResult(_0x590265,_0x1c0ef5){_0x1c0ef5=_0x1c0ef5||0xc8;return function(_0x3ac236){if(_0x3ac236){return _0x590265[_0x5c69('0x16')](_0x1c0ef5)['json'](_0x3ac236);}};}function respondWithFilteredResult(_0x2dcf39,_0x2d2f6b){return function(_0x12eaed){if(_0x12eaed){var _0x299950=typeof _0x2d2f6b[_0x5c69('0x17')]===_0x5c69('0x18')&&typeof _0x2d2f6b[_0x5c69('0x19')]===_0x5c69('0x18');var _0x5a484b=_0x12eaed[_0x5c69('0x1a')];var _0x91f2b4=_0x299950?0x0:_0x2d2f6b['offset'];var _0x28a021=_0x299950?_0x12eaed['count']:_0x2d2f6b[_0x5c69('0x17')]+_0x2d2f6b[_0x5c69('0x19')];var _0x4e310d;if(_0x28a021>=_0x5a484b){_0x28a021=_0x5a484b;_0x4e310d=0xc8;}else{_0x4e310d=0xce;}_0x2dcf39[_0x5c69('0x16')](_0x4e310d);return _0x2dcf39[_0x5c69('0x1b')]('Content-Range',_0x91f2b4+'-'+_0x28a021+'/'+_0x5a484b)[_0x5c69('0x1c')](_0x12eaed);}return null;};}function patchUpdates(_0x2d3ba4){return function(_0x2cd336){try{jsonpatch['apply'](_0x2cd336,_0x2d3ba4,!![]);}catch(_0xe67aad){return BPromise[_0x5c69('0x1d')](_0xe67aad);}return _0x2cd336[_0x5c69('0x1e')]();};}function saveUpdates(_0x115106,_0xac69b1){return function(_0x40737a){if(_0x40737a){return _0x40737a['update'](_0x115106)['then'](function(_0x1d8b59){return _0x1d8b59;});}return null;};}function removeEntity(_0x2fdcc6,_0x5ac981){return function(_0x59ae80){if(_0x59ae80){return _0x59ae80['destroy']()[_0x5c69('0x1f')](function(){_0x2fdcc6[_0x5c69('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13328a,_0x537ddb){return function(_0x34ab47){if(!_0x34ab47){_0x13328a['sendStatus'](0x194);}return _0x34ab47;};}function handleError(_0x11f1e1,_0x1659de){_0x1659de=_0x1659de||0x1f4;return function(_0x33c143){logger['error'](_0x33c143[_0x5c69('0x20')]);if(_0x33c143['name']){delete _0x33c143[_0x5c69('0x21')];}_0x11f1e1[_0x5c69('0x16')](_0x1659de)[_0x5c69('0x22')](_0x33c143);};}exports[_0x5c69('0x23')]=function(_0x59a5d6,_0x5f3277){var _0x4dbbbe={},_0x714b63={},_0x47a19f={'count':0x0,'rows':[]};var _0x40a092=_[_0x5c69('0x24')](db['Automation'][_0x5c69('0x25')],function(_0x35b1a8){return{'name':_0x35b1a8['fieldName'],'type':_0x35b1a8[_0x5c69('0x26')][_0x5c69('0x27')]};});_0x714b63['model']=_['map'](_0x40a092,'name');_0x714b63[_0x5c69('0x28')]=_['keys'](_0x59a5d6[_0x5c69('0x28')]);_0x714b63[_0x5c69('0x29')]=_[_0x5c69('0x2a')](_0x714b63[_0x5c69('0x2b')],_0x714b63[_0x5c69('0x28')]);_0x4dbbbe[_0x5c69('0x2c')]=_[_0x5c69('0x2a')](_0x714b63['model'],qs[_0x5c69('0x2d')](_0x59a5d6[_0x5c69('0x28')][_0x5c69('0x2d')]));_0x4dbbbe[_0x5c69('0x2c')]=_0x4dbbbe['attributes'][_0x5c69('0x2e')]?_0x4dbbbe[_0x5c69('0x2c')]:_0x714b63[_0x5c69('0x2b')];if(!_0x59a5d6[_0x5c69('0x28')][_0x5c69('0x2f')](_0x5c69('0x30'))){_0x4dbbbe['limit']=qs[_0x5c69('0x19')](_0x59a5d6[_0x5c69('0x28')][_0x5c69('0x19')]);_0x4dbbbe[_0x5c69('0x17')]=qs[_0x5c69('0x17')](_0x59a5d6[_0x5c69('0x28')][_0x5c69('0x17')]);}_0x4dbbbe[_0x5c69('0x31')]=qs['sort'](_0x59a5d6['query']['sort']);_0x4dbbbe['where']=qs[_0x5c69('0x29')](_[_0x5c69('0x32')](_0x59a5d6[_0x5c69('0x28')],_0x714b63['filters']),_0x40a092);if(_0x59a5d6['query'][_0x5c69('0x33')]){_0x4dbbbe['where']=_[_0x5c69('0x34')](_0x4dbbbe[_0x5c69('0x35')],{'$or':_['map'](_0x40a092,function(_0x5403dd){if(_0x5403dd[_0x5c69('0x26')]!==_0x5c69('0x36')){var _0x48375b={};_0x48375b[_0x5403dd[_0x5c69('0x21')]]={'$like':'%'+_0x59a5d6[_0x5c69('0x28')][_0x5c69('0x33')]+'%'};return _0x48375b;}})});}_0x4dbbbe=_['merge']({},_0x4dbbbe,_0x59a5d6['options']);var _0x1ff7e2={'where':_0x4dbbbe[_0x5c69('0x35')]};return db[_0x5c69('0x37')]['count'](_0x1ff7e2)['then'](function(_0x53d7da){_0x47a19f['count']=_0x53d7da;if(_0x59a5d6[_0x5c69('0x28')][_0x5c69('0x38')]){_0x4dbbbe['include']=[{'all':!![]}];}return db[_0x5c69('0x37')][_0x5c69('0x39')](_0x4dbbbe);})[_0x5c69('0x1f')](function(_0x182deb){_0x47a19f['rows']=_0x182deb;return _0x47a19f;})[_0x5c69('0x1f')](respondWithFilteredResult(_0x5f3277,_0x4dbbbe))[_0x5c69('0x3a')](handleError(_0x5f3277,null));};exports[_0x5c69('0x3b')]=function(_0x5bebbb,_0x19ae6b){var _0x2150b8={'raw':![],'where':{'id':_0x5bebbb[_0x5c69('0x3c')]['id']}},_0x2887bc={};_0x2887bc['model']=_[_0x5c69('0x3d')](db[_0x5c69('0x37')]['rawAttributes']);_0x2887bc[_0x5c69('0x28')]=_[_0x5c69('0x3d')](_0x5bebbb[_0x5c69('0x28')]);_0x2887bc[_0x5c69('0x29')]=_[_0x5c69('0x2a')](_0x2887bc['model'],_0x2887bc[_0x5c69('0x28')]);_0x2150b8[_0x5c69('0x2c')]=_[_0x5c69('0x2a')](_0x2887bc[_0x5c69('0x2b')],qs[_0x5c69('0x2d')](_0x5bebbb['query'][_0x5c69('0x2d')]));_0x2150b8[_0x5c69('0x2c')]=_0x2150b8['attributes'][_0x5c69('0x2e')]?_0x2150b8[_0x5c69('0x2c')]:_0x2887bc[_0x5c69('0x2b')];if(_0x5bebbb[_0x5c69('0x28')][_0x5c69('0x38')]){_0x2150b8[_0x5c69('0x3e')]=[{'all':!![]}];}_0x2150b8=_[_0x5c69('0x34')]({},_0x2150b8,_0x5bebbb[_0x5c69('0x3f')]);return db[_0x5c69('0x37')][_0x5c69('0x40')](_0x2150b8)['then'](handleEntityNotFound(_0x19ae6b,null))['then'](respondWithResult(_0x19ae6b,null))[_0x5c69('0x3a')](handleError(_0x19ae6b,null));};exports['create']=function(_0x2cb6f8,_0x5c2433){return db[_0x5c69('0x37')][_0x5c69('0x41')](_0x2cb6f8[_0x5c69('0x42')],{})[_0x5c69('0x1f')](respondWithResult(_0x5c2433,0xc9))['catch'](handleError(_0x5c2433,null));};exports[_0x5c69('0x43')]=function(_0x480b06,_0x2cb93e){if(_0x480b06[_0x5c69('0x42')]['id']){delete _0x480b06[_0x5c69('0x42')]['id'];}return db[_0x5c69('0x37')][_0x5c69('0x40')]({'where':{'id':_0x480b06[_0x5c69('0x3c')]['id']}})[_0x5c69('0x1f')](handleEntityNotFound(_0x2cb93e,null))[_0x5c69('0x1f')](saveUpdates(_0x480b06[_0x5c69('0x42')],null))['then'](respondWithResult(_0x2cb93e,null))[_0x5c69('0x3a')](handleError(_0x2cb93e,null));};exports[_0x5c69('0x44')]=function(_0x4e3ed6,_0x5a040f){return db[_0x5c69('0x37')][_0x5c69('0x40')]({'where':{'id':_0x4e3ed6[_0x5c69('0x3c')]['id']}})[_0x5c69('0x1f')](handleEntityNotFound(_0x5a040f,null))[_0x5c69('0x1f')](removeEntity(_0x5a040f,null))[_0x5c69('0x3a')](handleError(_0x5a040f,null));};exports[_0x5c69('0x45')]=function(_0x1d3201,_0x415528,_0x15d1a0){return db['Condition']['find']({'where':{'id':_0x1d3201['params']['id']}})[_0x5c69('0x1f')](handleEntityNotFound(_0x415528,null))[_0x5c69('0x1f')](function(_0x5133ff){if(_0x5133ff){return _0x5133ff['addConditions'](_0x1d3201[_0x5c69('0x42')][_0x5c69('0x46')],_[_0x5c69('0x47')](_0x1d3201[_0x5c69('0x42')],['ids','id'])||{});}})[_0x5c69('0x1f')](respondWithResult(_0x415528,null))['catch'](handleError(_0x415528,null));};exports[_0x5c69('0x48')]=function(_0x2a01da,_0x3440c6,_0x225f83){var _0x8f4a1={};var _0x333b4a={};var _0x4b1612;var _0xc90945;return db[_0x5c69('0x37')]['findOne']({'where':{'id':_0x2a01da[_0x5c69('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3440c6,null))['then'](function(_0x2de0ec){if(_0x2de0ec){_0x4b1612=_0x2de0ec;_0x333b4a[_0x5c69('0x2b')]=_['keys'](db['Condition'][_0x5c69('0x25')]);_0x333b4a[_0x5c69('0x28')]=_[_0x5c69('0x3d')](_0x2a01da['query']);_0x333b4a[_0x5c69('0x29')]=_['intersection'](_0x333b4a[_0x5c69('0x2b')],_0x333b4a['query']);_0x8f4a1[_0x5c69('0x2c')]=_[_0x5c69('0x2a')](_0x333b4a[_0x5c69('0x2b')],qs[_0x5c69('0x2d')](_0x2a01da[_0x5c69('0x28')]['fields']));_0x8f4a1[_0x5c69('0x2c')]=_0x8f4a1[_0x5c69('0x2c')][_0x5c69('0x2e')]?_0x8f4a1[_0x5c69('0x2c')]:_0x333b4a[_0x5c69('0x2b')];_0x8f4a1[_0x5c69('0x31')]=qs[_0x5c69('0x49')](_0x2a01da[_0x5c69('0x28')]['sort']);_0x8f4a1[_0x5c69('0x35')]=qs['filters'](_[_0x5c69('0x32')](_0x2a01da[_0x5c69('0x28')],_0x333b4a[_0x5c69('0x29')]));if(_0x2a01da[_0x5c69('0x28')][_0x5c69('0x33')]){_0x8f4a1['where']=_[_0x5c69('0x34')](_0x8f4a1['where'],{'$or':_[_0x5c69('0x24')](_0x8f4a1[_0x5c69('0x2c')],function(_0xcd58be){var _0x535a24={};_0x535a24[_0xcd58be]={'$like':'%'+_0x2a01da[_0x5c69('0x28')][_0x5c69('0x33')]+'%'};return _0x535a24;})});}_0x8f4a1=_[_0x5c69('0x34')]({},_0x8f4a1,_0x2a01da[_0x5c69('0x3f')]);return _0x4b1612[_0x5c69('0x48')](_0x8f4a1);}})['then'](function(_0x5dfbb2){if(_0x5dfbb2){_0xc90945=_0x5dfbb2[_0x5c69('0x2e')];if(!_0x2a01da[_0x5c69('0x28')][_0x5c69('0x2f')]('nolimit')){_0x8f4a1[_0x5c69('0x19')]=qs[_0x5c69('0x19')](_0x2a01da['query'][_0x5c69('0x19')]);_0x8f4a1['offset']=qs[_0x5c69('0x17')](_0x2a01da[_0x5c69('0x28')]['offset']);}return _0x4b1612['getConditions'](_0x8f4a1);}})[_0x5c69('0x1f')](function(_0x57fcd1){if(_0x57fcd1){return _0x57fcd1?{'count':_0xc90945,'rows':_0x57fcd1}:null;}})[_0x5c69('0x1f')](respondWithResult(_0x3440c6,null))['catch'](handleError(_0x3440c6,null));};exports[_0x5c69('0x4a')]=function(_0x2ac922,_0x1142eb,_0x49ce7){return db['Action'][_0x5c69('0x40')]({'where':{'id':_0x2ac922[_0x5c69('0x3c')]['id']}})[_0x5c69('0x1f')](handleEntityNotFound(_0x1142eb,null))['then'](function(_0x4731d7){if(_0x4731d7){return _0x4731d7[_0x5c69('0x4a')](_0x2ac922[_0x5c69('0x42')][_0x5c69('0x46')],_[_0x5c69('0x47')](_0x2ac922[_0x5c69('0x42')],[_0x5c69('0x46'),'id'])||{});}})['then'](respondWithResult(_0x1142eb,null))[_0x5c69('0x3a')](handleError(_0x1142eb,null));};exports[_0x5c69('0x4b')]=function(_0x5b884c,_0x247ce7,_0x3053f5){var _0x28b7e8={};var _0x5bad48={};var _0x41dbf8;var _0x3d9d8b;return db[_0x5c69('0x37')][_0x5c69('0x4c')]({'where':{'id':_0x5b884c['params']['id']}})[_0x5c69('0x1f')](handleEntityNotFound(_0x247ce7,null))['then'](function(_0x1326ee){if(_0x1326ee){_0x41dbf8=_0x1326ee;_0x5bad48['model']=_['keys'](db[_0x5c69('0x4d')][_0x5c69('0x25')]);_0x5bad48[_0x5c69('0x28')]=_['keys'](_0x5b884c[_0x5c69('0x28')]);_0x5bad48['filters']=_[_0x5c69('0x2a')](_0x5bad48[_0x5c69('0x2b')],_0x5bad48[_0x5c69('0x28')]);_0x28b7e8[_0x5c69('0x2c')]=_['intersection'](_0x5bad48[_0x5c69('0x2b')],qs[_0x5c69('0x2d')](_0x5b884c[_0x5c69('0x28')][_0x5c69('0x2d')]));_0x28b7e8[_0x5c69('0x2c')]=_0x28b7e8[_0x5c69('0x2c')][_0x5c69('0x2e')]?_0x28b7e8['attributes']:_0x5bad48[_0x5c69('0x2b')];_0x28b7e8[_0x5c69('0x31')]=qs[_0x5c69('0x49')](_0x5b884c['query'][_0x5c69('0x49')]);_0x28b7e8[_0x5c69('0x35')]=qs[_0x5c69('0x29')](_[_0x5c69('0x32')](_0x5b884c[_0x5c69('0x28')],_0x5bad48['filters']));if(_0x5b884c[_0x5c69('0x28')]['filter']){_0x28b7e8[_0x5c69('0x35')]=_[_0x5c69('0x34')](_0x28b7e8[_0x5c69('0x35')],{'$or':_[_0x5c69('0x24')](_0x28b7e8[_0x5c69('0x2c')],function(_0x3f7e04){var _0x5f0ffb={};_0x5f0ffb[_0x3f7e04]={'$like':'%'+_0x5b884c[_0x5c69('0x28')][_0x5c69('0x33')]+'%'};return _0x5f0ffb;})});}_0x28b7e8=_['merge']({},_0x28b7e8,_0x5b884c[_0x5c69('0x3f')]);return _0x41dbf8['getActions'](_0x28b7e8);}})[_0x5c69('0x1f')](function(_0x20754a){if(_0x20754a){_0x3d9d8b=_0x20754a[_0x5c69('0x2e')];if(!_0x5b884c[_0x5c69('0x28')][_0x5c69('0x2f')](_0x5c69('0x30'))){_0x28b7e8[_0x5c69('0x19')]=qs[_0x5c69('0x19')](_0x5b884c[_0x5c69('0x28')]['limit']);_0x28b7e8[_0x5c69('0x17')]=qs[_0x5c69('0x17')](_0x5b884c[_0x5c69('0x28')]['offset']);}return _0x41dbf8[_0x5c69('0x4b')](_0x28b7e8);}})[_0x5c69('0x1f')](function(_0x26325a){if(_0x26325a){return _0x26325a?{'count':_0x3d9d8b,'rows':_0x26325a}:null;}})[_0x5c69('0x1f')](respondWithResult(_0x247ce7,null))[_0x5c69('0x3a')](handleError(_0x247ce7,null));};
\ No newline at end of file
+var _0x7f96=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','Automation','includeAll','findAll','rows','show','params','include','create','catch','body','find','addConditions','omit','ids','findOne','Condition','order','getConditions','nolimit','addActions','getActions','Action','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x438578,_0xeccb24){var _0x55f90b=function(_0x2ef1fd){while(--_0x2ef1fd){_0x438578['push'](_0x438578['shift']());}};_0x55f90b(++_0xeccb24);}(_0x7f96,0x13e));var _0x67f9=function(_0x18261f,_0x3eddfa){_0x18261f=_0x18261f-0x0;var _0x1c5910=_0x7f96[_0x18261f];return _0x1c5910;};'use strict';var emlformat=require(_0x67f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x67f9('0x1'));var jsonpatch=require(_0x67f9('0x2'));var rp=require('request-promise');var moment=require(_0x67f9('0x3'));var BPromise=require(_0x67f9('0x4'));var Mustache=require(_0x67f9('0x5'));var util=require(_0x67f9('0x6'));var path=require('path');var sox=require(_0x67f9('0x7'));var csv=require(_0x67f9('0x8'));var ejs=require(_0x67f9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67f9('0xa'));var squel=require(_0x67f9('0xb'));var crypto=require(_0x67f9('0xc'));var jsforce=require(_0x67f9('0xd'));var deskjs=require(_0x67f9('0xe'));var toCsv=require(_0x67f9('0x8'));var querystring=require(_0x67f9('0xf'));var Papa=require(_0x67f9('0x10'));var Redis=require(_0x67f9('0x11'));var authService=require(_0x67f9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x67f9('0x13'));var hardwareService=require(_0x67f9('0x14'));var logger=require('../../config/logger')(_0x67f9('0x15'));var utils=require(_0x67f9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x67f9('0x17'));var db=require(_0x67f9('0x18'))['db'];function respondWithStatusCode(_0x20d1d5,_0x10e8e){_0x10e8e=_0x10e8e||0xcc;return function(_0x2c254b){if(_0x2c254b){return _0x20d1d5[_0x67f9('0x19')](_0x10e8e);}return _0x20d1d5[_0x67f9('0x1a')](_0x10e8e)['end']();};}function respondWithResult(_0x3593d2,_0x5f5148){_0x5f5148=_0x5f5148||0xc8;return function(_0x2941d5){if(_0x2941d5){return _0x3593d2[_0x67f9('0x1a')](_0x5f5148)['json'](_0x2941d5);}};}function respondWithFilteredResult(_0x200a91,_0x3f2886){return function(_0x372634){if(_0x372634){var _0x44b98c=typeof _0x3f2886[_0x67f9('0x1b')]===_0x67f9('0x1c')&&typeof _0x3f2886[_0x67f9('0x1d')]===_0x67f9('0x1c');var _0x2eed13=_0x372634[_0x67f9('0x1e')];var _0xf7f3ed=_0x44b98c?0x0:_0x3f2886[_0x67f9('0x1b')];var _0x5079f6=_0x44b98c?_0x372634['count']:_0x3f2886['offset']+_0x3f2886['limit'];var _0x4e983c;if(_0x5079f6>=_0x2eed13){_0x5079f6=_0x2eed13;_0x4e983c=0xc8;}else{_0x4e983c=0xce;}_0x200a91[_0x67f9('0x1a')](_0x4e983c);return _0x200a91[_0x67f9('0x1f')](_0x67f9('0x20'),_0xf7f3ed+'-'+_0x5079f6+'/'+_0x2eed13)['json'](_0x372634);}return null;};}function patchUpdates(_0x563b27){return function(_0x42746e){try{jsonpatch[_0x67f9('0x21')](_0x42746e,_0x563b27,!![]);}catch(_0x3c47db){return BPromise[_0x67f9('0x22')](_0x3c47db);}return _0x42746e[_0x67f9('0x23')]();};}function saveUpdates(_0x4ca7b0,_0xd681e4){return function(_0x56a3dd){if(_0x56a3dd){return _0x56a3dd['update'](_0x4ca7b0)[_0x67f9('0x24')](function(_0x9a5cb2){return _0x9a5cb2;});}return null;};}function removeEntity(_0x2c7e36,_0x5e9b59){return function(_0x252334){if(_0x252334){return _0x252334[_0x67f9('0x25')]()[_0x67f9('0x24')](function(){_0x2c7e36[_0x67f9('0x1a')](0xcc)[_0x67f9('0x26')]();});}};}function handleEntityNotFound(_0x566b85,_0xac7094){return function(_0x27717d){if(!_0x27717d){_0x566b85[_0x67f9('0x19')](0x194);}return _0x27717d;};}function handleError(_0x90990a,_0x55359e){_0x55359e=_0x55359e||0x1f4;return function(_0x3f4489){logger[_0x67f9('0x27')](_0x3f4489[_0x67f9('0x28')]);if(_0x3f4489[_0x67f9('0x29')]){delete _0x3f4489['name'];}_0x90990a['status'](_0x55359e)[_0x67f9('0x2a')](_0x3f4489);};}exports['index']=function(_0x4344c8,_0x769177){var _0x10a985={},_0x4a95f7={},_0x5beb79={'count':0x0,'rows':[]};var _0x12cf2c=_[_0x67f9('0x2b')](db['Automation'][_0x67f9('0x2c')],function(_0x69a154){return{'name':_0x69a154[_0x67f9('0x2d')],'type':_0x69a154[_0x67f9('0x2e')][_0x67f9('0x2f')]};});_0x4a95f7['model']=_[_0x67f9('0x2b')](_0x12cf2c,_0x67f9('0x29'));_0x4a95f7[_0x67f9('0x30')]=_[_0x67f9('0x31')](_0x4344c8['query']);_0x4a95f7[_0x67f9('0x32')]=_[_0x67f9('0x33')](_0x4a95f7[_0x67f9('0x34')],_0x4a95f7[_0x67f9('0x30')]);_0x10a985['attributes']=_['intersection'](_0x4a95f7['model'],qs[_0x67f9('0x35')](_0x4344c8['query']['fields']));_0x10a985['attributes']=_0x10a985[_0x67f9('0x36')][_0x67f9('0x37')]?_0x10a985[_0x67f9('0x36')]:_0x4a95f7[_0x67f9('0x34')];if(!_0x4344c8[_0x67f9('0x30')][_0x67f9('0x38')]('nolimit')){_0x10a985[_0x67f9('0x1d')]=qs[_0x67f9('0x1d')](_0x4344c8[_0x67f9('0x30')][_0x67f9('0x1d')]);_0x10a985['offset']=qs[_0x67f9('0x1b')](_0x4344c8[_0x67f9('0x30')][_0x67f9('0x1b')]);}_0x10a985['order']=qs[_0x67f9('0x39')](_0x4344c8['query'][_0x67f9('0x39')]);_0x10a985[_0x67f9('0x3a')]=qs[_0x67f9('0x32')](_[_0x67f9('0x3b')](_0x4344c8[_0x67f9('0x30')],_0x4a95f7['filters']),_0x12cf2c);if(_0x4344c8[_0x67f9('0x30')][_0x67f9('0x3c')]){_0x10a985[_0x67f9('0x3a')]=_['merge'](_0x10a985['where'],{'$or':_['map'](_0x12cf2c,function(_0x1bfeec){if(_0x1bfeec[_0x67f9('0x2e')]!=='VIRTUAL'){var _0x2ccdf1={};_0x2ccdf1[_0x1bfeec[_0x67f9('0x29')]]={'$like':'%'+_0x4344c8[_0x67f9('0x30')][_0x67f9('0x3c')]+'%'};return _0x2ccdf1;}})});}_0x10a985=_[_0x67f9('0x3d')]({},_0x10a985,_0x4344c8[_0x67f9('0x3e')]);var _0x18b2cf={'where':_0x10a985[_0x67f9('0x3a')]};return db[_0x67f9('0x3f')][_0x67f9('0x1e')](_0x18b2cf)[_0x67f9('0x24')](function(_0x213361){_0x5beb79[_0x67f9('0x1e')]=_0x213361;if(_0x4344c8[_0x67f9('0x30')][_0x67f9('0x40')]){_0x10a985['include']=[{'all':!![]}];}return db['Automation'][_0x67f9('0x41')](_0x10a985);})[_0x67f9('0x24')](function(_0x341db7){_0x5beb79[_0x67f9('0x42')]=_0x341db7;return _0x5beb79;})['then'](respondWithFilteredResult(_0x769177,_0x10a985))['catch'](handleError(_0x769177,null));};exports[_0x67f9('0x43')]=function(_0x2ac123,_0x2b5a33){var _0x21c196={'raw':![],'where':{'id':_0x2ac123[_0x67f9('0x44')]['id']}},_0x52a5db={};_0x52a5db[_0x67f9('0x34')]=_['keys'](db[_0x67f9('0x3f')][_0x67f9('0x2c')]);_0x52a5db['query']=_[_0x67f9('0x31')](_0x2ac123[_0x67f9('0x30')]);_0x52a5db[_0x67f9('0x32')]=_[_0x67f9('0x33')](_0x52a5db[_0x67f9('0x34')],_0x52a5db[_0x67f9('0x30')]);_0x21c196[_0x67f9('0x36')]=_[_0x67f9('0x33')](_0x52a5db[_0x67f9('0x34')],qs[_0x67f9('0x35')](_0x2ac123['query']['fields']));_0x21c196['attributes']=_0x21c196[_0x67f9('0x36')][_0x67f9('0x37')]?_0x21c196['attributes']:_0x52a5db[_0x67f9('0x34')];if(_0x2ac123[_0x67f9('0x30')][_0x67f9('0x40')]){_0x21c196[_0x67f9('0x45')]=[{'all':!![]}];}_0x21c196=_[_0x67f9('0x3d')]({},_0x21c196,_0x2ac123[_0x67f9('0x3e')]);return db[_0x67f9('0x3f')]['find'](_0x21c196)['then'](handleEntityNotFound(_0x2b5a33,null))[_0x67f9('0x24')](respondWithResult(_0x2b5a33,null))['catch'](handleError(_0x2b5a33,null));};exports['create']=function(_0x588ac3,_0x36fc45){return db[_0x67f9('0x3f')][_0x67f9('0x46')](_0x588ac3['body'],{})['then'](respondWithResult(_0x36fc45,0xc9))[_0x67f9('0x47')](handleError(_0x36fc45,null));};exports['update']=function(_0x7a28f0,_0x13a4ad){if(_0x7a28f0[_0x67f9('0x48')]['id']){delete _0x7a28f0[_0x67f9('0x48')]['id'];}return db[_0x67f9('0x3f')][_0x67f9('0x49')]({'where':{'id':_0x7a28f0[_0x67f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x13a4ad,null))[_0x67f9('0x24')](saveUpdates(_0x7a28f0[_0x67f9('0x48')],null))['then'](respondWithResult(_0x13a4ad,null))[_0x67f9('0x47')](handleError(_0x13a4ad,null));};exports[_0x67f9('0x25')]=function(_0x30eaf5,_0x496791){return db[_0x67f9('0x3f')][_0x67f9('0x49')]({'where':{'id':_0x30eaf5[_0x67f9('0x44')]['id']}})[_0x67f9('0x24')](handleEntityNotFound(_0x496791,null))[_0x67f9('0x24')](removeEntity(_0x496791,null))[_0x67f9('0x47')](handleError(_0x496791,null));};exports[_0x67f9('0x4a')]=function(_0x14da2e,_0x2ca424,_0x3c82f5){return db['Condition'][_0x67f9('0x49')]({'where':{'id':_0x14da2e[_0x67f9('0x44')]['id']}})[_0x67f9('0x24')](handleEntityNotFound(_0x2ca424,null))[_0x67f9('0x24')](function(_0x485da0){if(_0x485da0){return _0x485da0['addConditions'](_0x14da2e[_0x67f9('0x48')]['ids'],_[_0x67f9('0x4b')](_0x14da2e[_0x67f9('0x48')],[_0x67f9('0x4c'),'id'])||{});}})[_0x67f9('0x24')](respondWithResult(_0x2ca424,null))[_0x67f9('0x47')](handleError(_0x2ca424,null));};exports['getConditions']=function(_0x3ac201,_0x3bb6d3,_0x427566){var _0x11a592={};var _0x42aa75={};var _0xc24891;var _0x1308dd;return db['Automation'][_0x67f9('0x4d')]({'where':{'id':_0x3ac201['params']['id']}})['then'](handleEntityNotFound(_0x3bb6d3,null))[_0x67f9('0x24')](function(_0x1ad654){if(_0x1ad654){_0xc24891=_0x1ad654;_0x42aa75[_0x67f9('0x34')]=_[_0x67f9('0x31')](db[_0x67f9('0x4e')][_0x67f9('0x2c')]);_0x42aa75['query']=_[_0x67f9('0x31')](_0x3ac201['query']);_0x42aa75[_0x67f9('0x32')]=_['intersection'](_0x42aa75[_0x67f9('0x34')],_0x42aa75[_0x67f9('0x30')]);_0x11a592['attributes']=_['intersection'](_0x42aa75[_0x67f9('0x34')],qs[_0x67f9('0x35')](_0x3ac201[_0x67f9('0x30')][_0x67f9('0x35')]));_0x11a592[_0x67f9('0x36')]=_0x11a592[_0x67f9('0x36')][_0x67f9('0x37')]?_0x11a592['attributes']:_0x42aa75['model'];_0x11a592[_0x67f9('0x4f')]=qs[_0x67f9('0x39')](_0x3ac201[_0x67f9('0x30')][_0x67f9('0x39')]);_0x11a592['where']=qs['filters'](_[_0x67f9('0x3b')](_0x3ac201[_0x67f9('0x30')],_0x42aa75[_0x67f9('0x32')]));if(_0x3ac201[_0x67f9('0x30')][_0x67f9('0x3c')]){_0x11a592[_0x67f9('0x3a')]=_[_0x67f9('0x3d')](_0x11a592[_0x67f9('0x3a')],{'$or':_[_0x67f9('0x2b')](_0x11a592['attributes'],function(_0x53d5d1){var _0x4ed3d7={};_0x4ed3d7[_0x53d5d1]={'$like':'%'+_0x3ac201[_0x67f9('0x30')][_0x67f9('0x3c')]+'%'};return _0x4ed3d7;})});}_0x11a592=_[_0x67f9('0x3d')]({},_0x11a592,_0x3ac201[_0x67f9('0x3e')]);return _0xc24891[_0x67f9('0x50')](_0x11a592);}})['then'](function(_0x41659f){if(_0x41659f){_0x1308dd=_0x41659f['length'];if(!_0x3ac201['query']['hasOwnProperty'](_0x67f9('0x51'))){_0x11a592[_0x67f9('0x1d')]=qs[_0x67f9('0x1d')](_0x3ac201[_0x67f9('0x30')][_0x67f9('0x1d')]);_0x11a592[_0x67f9('0x1b')]=qs[_0x67f9('0x1b')](_0x3ac201[_0x67f9('0x30')]['offset']);}return _0xc24891[_0x67f9('0x50')](_0x11a592);}})[_0x67f9('0x24')](function(_0x22208c){if(_0x22208c){return _0x22208c?{'count':_0x1308dd,'rows':_0x22208c}:null;}})[_0x67f9('0x24')](respondWithResult(_0x3bb6d3,null))[_0x67f9('0x47')](handleError(_0x3bb6d3,null));};exports[_0x67f9('0x52')]=function(_0x1d0fe0,_0x50ef5a,_0x22dbd6){return db['Action'][_0x67f9('0x49')]({'where':{'id':_0x1d0fe0[_0x67f9('0x44')]['id']}})[_0x67f9('0x24')](handleEntityNotFound(_0x50ef5a,null))[_0x67f9('0x24')](function(_0x180ed6){if(_0x180ed6){return _0x180ed6[_0x67f9('0x52')](_0x1d0fe0[_0x67f9('0x48')][_0x67f9('0x4c')],_[_0x67f9('0x4b')](_0x1d0fe0[_0x67f9('0x48')],[_0x67f9('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x50ef5a,null))['catch'](handleError(_0x50ef5a,null));};exports[_0x67f9('0x53')]=function(_0x321d72,_0x96b71c,_0x4e66fd){var _0x9892d2={};var _0x5d3f46={};var _0x56b28b;var _0x2e11f3;return db[_0x67f9('0x3f')]['findOne']({'where':{'id':_0x321d72[_0x67f9('0x44')]['id']}})[_0x67f9('0x24')](handleEntityNotFound(_0x96b71c,null))['then'](function(_0x26ba51){if(_0x26ba51){_0x56b28b=_0x26ba51;_0x5d3f46[_0x67f9('0x34')]=_[_0x67f9('0x31')](db[_0x67f9('0x54')][_0x67f9('0x2c')]);_0x5d3f46['query']=_[_0x67f9('0x31')](_0x321d72[_0x67f9('0x30')]);_0x5d3f46['filters']=_['intersection'](_0x5d3f46[_0x67f9('0x34')],_0x5d3f46[_0x67f9('0x30')]);_0x9892d2['attributes']=_['intersection'](_0x5d3f46['model'],qs[_0x67f9('0x35')](_0x321d72[_0x67f9('0x30')][_0x67f9('0x35')]));_0x9892d2['attributes']=_0x9892d2[_0x67f9('0x36')][_0x67f9('0x37')]?_0x9892d2[_0x67f9('0x36')]:_0x5d3f46[_0x67f9('0x34')];_0x9892d2[_0x67f9('0x4f')]=qs['sort'](_0x321d72[_0x67f9('0x30')][_0x67f9('0x39')]);_0x9892d2[_0x67f9('0x3a')]=qs['filters'](_['pick'](_0x321d72[_0x67f9('0x30')],_0x5d3f46['filters']));if(_0x321d72[_0x67f9('0x30')]['filter']){_0x9892d2['where']=_[_0x67f9('0x3d')](_0x9892d2[_0x67f9('0x3a')],{'$or':_[_0x67f9('0x2b')](_0x9892d2['attributes'],function(_0x598108){var _0x2b76e3={};_0x2b76e3[_0x598108]={'$like':'%'+_0x321d72['query'][_0x67f9('0x3c')]+'%'};return _0x2b76e3;})});}_0x9892d2=_['merge']({},_0x9892d2,_0x321d72[_0x67f9('0x3e')]);return _0x56b28b[_0x67f9('0x53')](_0x9892d2);}})['then'](function(_0x10dbe5){if(_0x10dbe5){_0x2e11f3=_0x10dbe5[_0x67f9('0x37')];if(!_0x321d72[_0x67f9('0x30')]['hasOwnProperty'](_0x67f9('0x51'))){_0x9892d2[_0x67f9('0x1d')]=qs[_0x67f9('0x1d')](_0x321d72['query']['limit']);_0x9892d2[_0x67f9('0x1b')]=qs['offset'](_0x321d72[_0x67f9('0x30')]['offset']);}return _0x56b28b[_0x67f9('0x53')](_0x9892d2);}})[_0x67f9('0x24')](function(_0x37d564){if(_0x37d564){return _0x37d564?{'count':_0x2e11f3,'rows':_0x37d564}:null;}})[_0x67f9('0x24')](respondWithResult(_0x96b71c,null))['catch'](handleError(_0x96b71c,null));};
\ No newline at end of file
index 4937eb6..0bab56f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fdb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','lodash','util','../../config/logger'];(function(_0x2713f5,_0x382adb){var _0x4e6249=function(_0x2e2565){while(--_0x2e2565){_0x2713f5['push'](_0x2713f5['shift']());}};_0x4e6249(++_0x382adb);}(_0x8fdb,0x69));var _0xb8fd=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x8fdb[_0x104e21];return _0x605b37;};'use strict';var _=require(_0xb8fd('0x0'));var util=require(_0xb8fd('0x1'));var logger=require(_0xb8fd('0x2'))(_0xb8fd('0x3'));var moment=require(_0xb8fd('0x4'));var BPromise=require(_0xb8fd('0x5'));var rp=require(_0xb8fd('0x6'));var fs=require('fs');var path=require(_0xb8fd('0x7'));var rimraf=require(_0xb8fd('0x8'));var config=require(_0xb8fd('0x9'));var attributes=require(_0xb8fd('0xa'));module['exports']=function(_0x2f6bbd,_0x5df886){return _0x2f6bbd[_0xb8fd('0xb')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x909f=['./automation.attributes','exports','define','Automation','tools_automations','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3f55de,_0x3ae98f){var _0x2698de=function(_0x48f021){while(--_0x48f021){_0x3f55de['push'](_0x3f55de['shift']());}};_0x2698de(++_0x3ae98f);}(_0x909f,0x10d));var _0xf909=function(_0x260779,_0x5dc256){_0x260779=_0x260779-0x0;var _0x583418=_0x909f[_0x260779];return _0x583418;};'use strict';var _=require(_0xf909('0x0'));var util=require(_0xf909('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf909('0x2'));var BPromise=require(_0xf909('0x3'));var rp=require(_0xf909('0x4'));var fs=require('fs');var path=require(_0xf909('0x5'));var rimraf=require(_0xf909('0x6'));var config=require('../../config/environment');var attributes=require(_0xf909('0x7'));module[_0xf909('0x8')]=function(_0x459896,_0x501cbe){return _0x459896[_0xf909('0x9')](_0xf909('0xa'),attributes,{'tableName':_0xf909('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8d15433..253195c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03e=['debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Automation,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb03e,0x1eb));var _0xeb03=function(_0x2d7ed5,_0x44093d){_0x2d7ed5=_0x2d7ed5-0x0;var _0x1fb240=_0xb03e[_0x2d7ed5];return _0x1fb240;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));var BPromise=require(_0xeb03('0x2'));var rs=require(_0xeb03('0x3'));var fs=require('fs');var Redis=require(_0xeb03('0x4'));var db=require(_0xeb03('0x5'))['db'];var utils=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var jayson=require(_0xeb03('0xa'));var client=jayson[_0xeb03('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b58a2,_0x3d3322,_0x3a6e31){return new BPromise(function(_0x246c6e,_0x3f2c74){return client[_0xeb03('0xc')](_0x3b58a2,_0x3a6e31)['then'](function(_0x403b77){logger[_0xeb03('0xd')](_0xeb03('0xe'),_0x3d3322,'request\x20sent');logger[_0xeb03('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x3d3322,_0xeb03('0x10'),JSON[_0xeb03('0x11')](_0x403b77));if(_0x403b77[_0xeb03('0x12')]){if(_0x403b77[_0xeb03('0x12')][_0xeb03('0x13')]===0x1f4){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x3f2c74(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}logger[_0xeb03('0x12')]('Automation,\x20%s,\x20%s',_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x246c6e(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}else{logger['info'](_0xeb03('0xe'),_0x3d3322,_0xeb03('0x10'));_0x246c6e(_0x403b77[_0xeb03('0x15')]['message']);}})[_0xeb03('0x16')](function(_0x46dd1b){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x46dd1b);_0x3f2c74(_0x46dd1b);});});}
\ No newline at end of file
+var _0xbff2=['jayson/promise','debug','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x52735d,_0x9e1e6e){var _0x22151a=function(_0x219814){while(--_0x219814){_0x52735d['push'](_0x52735d['shift']());}};_0x22151a(++_0x9e1e6e);}(_0xbff2,0x10e));var _0x2bff=function(_0x1bedd9,_0xffdcae){_0x1bedd9=_0x1bedd9-0x0;var _0x2f1b48=_0xbff2[_0x1bedd9];return _0x2f1b48;};'use strict';var _=require(_0x2bff('0x0'));var util=require(_0x2bff('0x1'));var moment=require(_0x2bff('0x2'));var BPromise=require(_0x2bff('0x3'));var rs=require(_0x2bff('0x4'));var fs=require('fs');var Redis=require(_0x2bff('0x5'));var db=require(_0x2bff('0x6'))['db'];var utils=require(_0x2bff('0x7'));var logger=require(_0x2bff('0x8'))('rpc');var config=require(_0x2bff('0x9'));var jayson=require(_0x2bff('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48838e,_0x318d56,_0x34f4a0){return new BPromise(function(_0x4f5537,_0x1aa341){return client['request'](_0x48838e,_0x34f4a0)['then'](function(_0x172498){logger['info']('Automation,\x20%s,\x20%s',_0x318d56,'request\x20sent');logger[_0x2bff('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x318d56,_0x2bff('0xc'),JSON[_0x2bff('0xd')](_0x172498));if(_0x172498['error']){if(_0x172498[_0x2bff('0xe')][_0x2bff('0xf')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x318d56,_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);return _0x1aa341(_0x172498['error'][_0x2bff('0x10')]);}logger[_0x2bff('0xe')]('Automation,\x20%s,\x20%s',_0x318d56,_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);return _0x4f5537(_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);}else{logger['info'](_0x2bff('0x11'),_0x318d56,_0x2bff('0xc'));_0x4f5537(_0x172498[_0x2bff('0x12')][_0x2bff('0x10')]);}})[_0x2bff('0x13')](function(_0x3fd79e){logger['error'](_0x2bff('0x11'),_0x318d56,_0x3fd79e);_0x1aa341(_0x3fd79e);});});}
\ No newline at end of file
index 77fc2c8..41ad1e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfda=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/conditions','isAuthenticated','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','delete','destroy','exports','multer','util','path','express'];(function(_0x579cf3,_0x38540b){var _0x2f589d=function(_0x15d509){while(--_0x15d509){_0x579cf3['push'](_0x579cf3['shift']());}};_0x2f589d(++_0x38540b);}(_0xbfda,0x1dc));var _0xabfd=function(_0x2dc53c,_0x4a29ce){_0x2dc53c=_0x2dc53c-0x0;var _0x32ea88=_0xbfda[_0x2dc53c];return _0x32ea88;};'use strict';var multer=require(_0xabfd('0x0'));var util=require(_0xabfd('0x1'));var path=require(_0xabfd('0x2'));var timeout=require('connect-timeout');var express=require(_0xabfd('0x3'));var router=express['Router']();var fs_extra=require(_0xabfd('0x4'));var auth=require(_0xabfd('0x5'));var interaction=require(_0xabfd('0x6'));var config=require(_0xabfd('0x7'));var controller=require('./automation.controller');router[_0xabfd('0x8')]('/',auth['isAuthenticated'](),controller[_0xabfd('0x9')]);router['get'](_0xabfd('0xa'),auth['isAuthenticated'](),controller[_0xabfd('0xb')]);router[_0xabfd('0x8')](_0xabfd('0xc'),auth[_0xabfd('0xd')](),controller[_0xabfd('0xe')]);router[_0xabfd('0x8')]('/:id/actions',auth[_0xabfd('0xd')](),controller[_0xabfd('0xf')]);router[_0xabfd('0x10')]('/',auth[_0xabfd('0xd')](),controller[_0xabfd('0x11')]);router[_0xabfd('0x10')](_0xabfd('0xc'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x12')]);router[_0xabfd('0x10')](_0xabfd('0x13'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x14')]);router['put'](_0xabfd('0xa'),auth[_0xabfd('0xd')](),controller['update']);router[_0xabfd('0x15')](_0xabfd('0xa'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x16')]);module[_0xabfd('0x17')]=router;
\ No newline at end of file
+var _0x4226=['/:id','show','isAuthenticated','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','delete','destroy','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x2e69b2,_0x10ca6d){var _0x8fa042=function(_0x5d3bf1){while(--_0x5d3bf1){_0x2e69b2['push'](_0x2e69b2['shift']());}};_0x8fa042(++_0x10ca6d);}(_0x4226,0x1dc));var _0x6422=function(_0x4f5f71,_0x16a789){_0x4f5f71=_0x4f5f71-0x0;var _0x4616f6=_0x4226[_0x4f5f71];return _0x4616f6;};'use strict';var multer=require('multer');var util=require(_0x6422('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6422('0x1')]();var fs_extra=require(_0x6422('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x6422('0x3'));var config=require(_0x6422('0x4'));var controller=require(_0x6422('0x5'));router[_0x6422('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6422('0x7'),auth['isAuthenticated'](),controller[_0x6422('0x8')]);router[_0x6422('0x6')]('/:id/conditions',auth[_0x6422('0x9')](),controller[_0x6422('0xa')]);router['get'](_0x6422('0xb'),auth[_0x6422('0x9')](),controller[_0x6422('0xc')]);router[_0x6422('0xd')]('/',auth[_0x6422('0x9')](),controller[_0x6422('0xe')]);router[_0x6422('0xd')](_0x6422('0xf'),auth['isAuthenticated'](),controller[_0x6422('0x10')]);router[_0x6422('0xd')]('/:id/actions',auth['isAuthenticated'](),controller[_0x6422('0x11')]);router[_0x6422('0x12')]('/:id',auth[_0x6422('0x9')](),controller['update']);router[_0x6422('0x13')](_0x6422('0x7'),auth[_0x6422('0x9')](),controller[_0x6422('0x14')]);module['exports']=router;
\ No newline at end of file
index 096acc6..877d69d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd988=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x4cb819,_0x382986){var _0x33fb18=function(_0x211d5e){while(--_0x211d5e){_0x4cb819['push'](_0x4cb819['shift']());}};_0x33fb18(++_0x382986);}(_0xd988,0x1d4));var _0x8d98=function(_0x457bca,_0x7d7917){_0x457bca=_0x457bca-0x0;var _0x189025=_0xd988[_0x457bca];return _0x189025;};'use strict';var Sequelize=require(_0x8d98('0x0'));module[_0x8d98('0x1')]={'name':{'type':Sequelize[_0x8d98('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8d98('0x3')](_0x8d98('0x4')),'allowNull':![],'defaultValue':_0x8d98('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8d98('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x8d98('0x6')](0x4)[_0x8d98('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8d98('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8d98('0x6')](0x3)[_0x8d98('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d98('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8d98('0x6')](0x3)[_0x8d98('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d98('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8d98('0x6')](0x5)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d98('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x8d98('0x6')](0x3)[_0x8d98('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8d98('0x6')](0x5)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d98('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8d98('0x6')](0x3)[_0x8d98('0x7')],'defaultValue':0x3,'comment':_0x8d98('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8d98('0x6')](0x5)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d98('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8d98('0x6')](0x3)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x8d98('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8d98('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x8d98('0x3')](_0x8d98('0xe'),_0x8d98('0xf'),_0x8d98('0x10')),'defaultValue':_0x8d98('0xe')},'dialAMDActive':{'type':Sequelize[_0x8d98('0x5')],'defaultValue':0x0,'comment':_0x8d98('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x8d98('0x6')](0x9)[_0x8d98('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8d98('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x8d98('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8d98('0x6')](0x9)[_0x8d98('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8d98('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8d98('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8d98('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8d98('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8d98('0x6')](0x9)[_0x8d98('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8d98('0x6')](0x5)[_0x8d98('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8d98('0x6')](0x9)[_0x8d98('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8d98('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8d98('0x3')](_0x8d98('0x16'),'ASC'),'defaultValue':_0x8d98('0x16')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x8d98('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8d98('0x17')},'dialCutDigit':{'type':Sequelize[_0x8d98('0x6')](0x3)[_0x8d98('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8d98('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8d98('0x6')](0x3)[_0x8d98('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d98('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d98('0x1a')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8d98('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d98('0x1b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d98('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d98('0x1d')},'dialMachineMaxRetry':{'type':Sequelize[_0x8d98('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d98('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8d98('0x6')](0x5)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d98('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8d98('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d98('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8d98('0x6')](0x5)[_0x8d98('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x0e16=['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','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','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)'];(function(_0xd394e9,_0x589525){var _0x4ca335=function(_0x19812e){while(--_0x19812e){_0xd394e9['push'](_0xd394e9['shift']());}};_0x4ca335(++_0x589525);}(_0x0e16,0x183));var _0x60e1=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x0e16[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0x60e1('0x0'));module[_0x60e1('0x1')]={'name':{'type':Sequelize[_0x60e1('0x2')],'unique':_0x60e1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x60e1('0x4')](_0x60e1('0x5')),'allowNull':![],'defaultValue':_0x60e1('0x5')},'description':{'type':Sequelize[_0x60e1('0x2')]},'active':{'type':Sequelize[_0x60e1('0x6')],'defaultValue':0x0,'comment':_0x60e1('0x7')},'limitCalls':{'type':Sequelize[_0x60e1('0x8')](0x4)[_0x60e1('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x60e1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60e1('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x60e1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60e1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60e1('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x60e1('0x8')](0x5)[_0x60e1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60e1('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'defaultValue':0x3,'comment':_0x60e1('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x60e1('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60e1('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x60e1('0x10')},'dialTimezone':{'type':Sequelize[_0x60e1('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x60e1('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x60e1('0x12'),'never',_0x60e1('0x13')),'defaultValue':_0x60e1('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x60e1('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x60e1('0x8')](0x9)[_0x60e1('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x60e1('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x60e1('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x60e1('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x60e1('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x60e1('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x60e1('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x60e1('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x60e1('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x60e1('0x8')](0x9)[_0x60e1('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x60e1('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x60e1('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x60e1('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x60e1('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x60e1('0x4')](_0x60e1('0x1b'),_0x60e1('0x1c')),'defaultValue':_0x60e1('0x1b')},'dialPrefix':{'type':Sequelize[_0x60e1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x60e1('0x1d')},'dialCutDigit':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x60e1('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60e1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60e1('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x60e1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60e1('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60e1('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x60e1('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60e1('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x60e1('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60e1('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60e1('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60e1('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x60e1('0x8')](0x3)[_0x60e1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60e1('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x60e1('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60e1('0x27')}};
\ No newline at end of file
index 674faf3..9a8fdee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7df3=['NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','get','UserProfileResource','destroy','sendStatus','error','stack','index','map','Campaign','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','fields','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','include','omit','updatedAt','IvrCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','order','CmHopper','findAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','select','field'];(function(_0x2ccd0a,_0x162350){var _0x247b45=function(_0x2c220d){while(--_0x2c220d){_0x2ccd0a['push'](_0x2ccd0a['shift']());}};_0x247b45(++_0x162350);}(_0x7df3,0x1cc));var _0x37df=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7df3[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x37df('0x0'));var rimraf=require(_0x37df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37df('0x2'));var rp=require('request-promise');var moment=require(_0x37df('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x37df('0x4'));var util=require('util');var path=require(_0x37df('0x5'));var sox=require(_0x37df('0x6'));var csv=require(_0x37df('0x7'));var ejs=require(_0x37df('0x8'));var fs=require('fs');var fs_extra=require(_0x37df('0x9'));var _=require(_0x37df('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x37df('0xb'));var toCsv=require(_0x37df('0x7'));var querystring=require(_0x37df('0xc'));var Papa=require(_0x37df('0xd'));var Redis=require('ioredis');var authService=require(_0x37df('0xe'));var qs=require(_0x37df('0xf'));var as=require(_0x37df('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37df('0x11'))(_0x37df('0x12'));var utils=require(_0x37df('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x37df('0x14'));var db=require(_0x37df('0x15'))['db'];function respondWithStatusCode(_0xdae38c,_0xd6c0c2){_0xd6c0c2=_0xd6c0c2||0xcc;return function(_0x116796){if(_0x116796){return _0xdae38c['sendStatus'](_0xd6c0c2);}return _0xdae38c[_0x37df('0x16')](_0xd6c0c2)[_0x37df('0x17')]();};}function respondWithResult(_0x1b0331,_0x497eae){_0x497eae=_0x497eae||0xc8;return function(_0x315253){if(_0x315253){return _0x1b0331[_0x37df('0x16')](_0x497eae)['json'](_0x315253);}};}function respondWithFilteredResult(_0x50632c,_0x53d286){return function(_0x23d4c4){if(_0x23d4c4){var _0x425c3b=typeof _0x53d286[_0x37df('0x18')]===_0x37df('0x19')&&typeof _0x53d286[_0x37df('0x1a')]===_0x37df('0x19');var _0x39779e=_0x23d4c4[_0x37df('0x1b')];var _0x2ddebe=_0x425c3b?0x0:_0x53d286[_0x37df('0x18')];var _0x402b13=_0x425c3b?_0x23d4c4[_0x37df('0x1b')]:_0x53d286[_0x37df('0x18')]+_0x53d286[_0x37df('0x1a')];var _0x5ce5a8;if(_0x402b13>=_0x39779e){_0x402b13=_0x39779e;_0x5ce5a8=0xc8;}else{_0x5ce5a8=0xce;}_0x50632c[_0x37df('0x16')](_0x5ce5a8);return _0x50632c['set'](_0x37df('0x1c'),_0x2ddebe+'-'+_0x402b13+'/'+_0x39779e)[_0x37df('0x1d')](_0x23d4c4);}return null;};}function patchUpdates(_0x4ebe69){return function(_0x3b4974){try{jsonpatch[_0x37df('0x1e')](_0x3b4974,_0x4ebe69,!![]);}catch(_0x128594){return BPromise[_0x37df('0x1f')](_0x128594);}return _0x3b4974[_0x37df('0x20')]();};}function saveUpdates(_0x13db61,_0x47d163){return function(_0x365a76){if(_0x365a76){return _0x365a76['update'](_0x13db61)[_0x37df('0x21')](function(_0x598bd8){return _0x598bd8;});}return null;};}function removeEntity(_0x49c1fb,_0x4827ef){return function(_0x20f991){if(_0x20f991){return _0x20f991['destroy']()[_0x37df('0x21')](function(){var _0x177de2=_0x20f991[_0x37df('0x22')]({'plain':!![]});var _0x4a28ed='IvrCampaigns';return db[_0x37df('0x23')][_0x37df('0x24')]({'where':{'type':_0x4a28ed,'resourceId':_0x177de2['id']}})['then'](function(){return _0x20f991;});})[_0x37df('0x21')](function(){_0x49c1fb[_0x37df('0x16')](0xcc)[_0x37df('0x17')]();});}};}function handleEntityNotFound(_0x55e2b5,_0x220cea){return function(_0x43ef2a){if(!_0x43ef2a){_0x55e2b5[_0x37df('0x25')](0x194);}return _0x43ef2a;};}function handleError(_0x443990,_0x5eb090){_0x5eb090=_0x5eb090||0x1f4;return function(_0xcb9370){logger[_0x37df('0x26')](_0xcb9370[_0x37df('0x27')]);if(_0xcb9370['name']){delete _0xcb9370['name'];}_0x443990[_0x37df('0x16')](_0x5eb090)['send'](_0xcb9370);};}exports[_0x37df('0x28')]=function(_0x1c3b29,_0x1e3701){var _0x220740={},_0x518c70={},_0x534522={'count':0x0,'rows':[]};var _0x3ccf8c=_[_0x37df('0x29')](db[_0x37df('0x2a')][_0x37df('0x2b')],function(_0x3d9767){return{'name':_0x3d9767[_0x37df('0x2c')],'type':_0x3d9767[_0x37df('0x2d')][_0x37df('0x2e')]};});_0x518c70[_0x37df('0x2f')]=_[_0x37df('0x29')](_0x3ccf8c,_0x37df('0x30'));_0x518c70[_0x37df('0x31')]=_[_0x37df('0x32')](_0x1c3b29['query']);_0x518c70[_0x37df('0x33')]=_[_0x37df('0x34')](_0x518c70[_0x37df('0x2f')],_0x518c70[_0x37df('0x31')]);_0x220740['attributes']=_[_0x37df('0x34')](_0x518c70['model'],qs['fields'](_0x1c3b29[_0x37df('0x31')]['fields']));_0x220740[_0x37df('0x35')]=_0x220740[_0x37df('0x35')][_0x37df('0x36')]?_0x220740['attributes']:_0x518c70[_0x37df('0x2f')];if(!_0x1c3b29[_0x37df('0x31')][_0x37df('0x37')](_0x37df('0x38'))){_0x220740[_0x37df('0x1a')]=qs[_0x37df('0x1a')](_0x1c3b29['query'][_0x37df('0x1a')]);_0x220740['offset']=qs['offset'](_0x1c3b29[_0x37df('0x31')][_0x37df('0x18')]);}_0x220740['order']=qs[_0x37df('0x39')](_0x1c3b29[_0x37df('0x31')][_0x37df('0x39')]);_0x220740[_0x37df('0x3a')]=qs['filters'](_[_0x37df('0x3b')](_0x1c3b29[_0x37df('0x31')],_0x518c70['filters']),_0x3ccf8c);if(_0x1c3b29['query'][_0x37df('0x3c')]){_0x220740['where']=_[_0x37df('0x3d')](_0x220740['where'],{'$or':_[_0x37df('0x29')](_0x3ccf8c,function(_0x54e8cf){if(_0x54e8cf[_0x37df('0x2d')]!==_0x37df('0x3e')){var _0x101a2d={};_0x101a2d[_0x54e8cf[_0x37df('0x30')]]={'$like':'%'+_0x1c3b29['query'][_0x37df('0x3c')]+'%'};return _0x101a2d;}})});}_0x220740=_[_0x37df('0x3d')]({},_0x220740,_0x1c3b29['options']);var _0x59e229={'where':_0x220740['where']};return db['Campaign'][_0x37df('0x1b')](_0x59e229)['then'](function(_0x155860){_0x534522[_0x37df('0x1b')]=_0x155860;if(_0x1c3b29[_0x37df('0x31')][_0x37df('0x3f')]){_0x220740['include']=[{'all':!![]}];}return db[_0x37df('0x2a')]['findAll'](_0x220740);})['then'](function(_0x2b4f12){_0x534522[_0x37df('0x40')]=_0x2b4f12;return _0x534522;})['then'](respondWithFilteredResult(_0x1e3701,_0x220740))['catch'](handleError(_0x1e3701,null));};exports[_0x37df('0x41')]=function(_0x196d07,_0x4efc1a){var _0x2d3efb={'raw':![],'where':{'id':_0x196d07[_0x37df('0x42')]['id']}},_0x307751={};_0x307751[_0x37df('0x2f')]=_[_0x37df('0x32')](db['Campaign'][_0x37df('0x2b')]);_0x307751[_0x37df('0x31')]=_['keys'](_0x196d07[_0x37df('0x31')]);_0x307751[_0x37df('0x33')]=_[_0x37df('0x34')](_0x307751[_0x37df('0x2f')],_0x307751[_0x37df('0x31')]);_0x2d3efb[_0x37df('0x35')]=_[_0x37df('0x34')](_0x307751['model'],qs[_0x37df('0x43')](_0x196d07[_0x37df('0x31')][_0x37df('0x43')]));_0x2d3efb['attributes']=_0x2d3efb[_0x37df('0x35')][_0x37df('0x36')]?_0x2d3efb[_0x37df('0x35')]:_0x307751['model'];if(_0x196d07['query']['includeAll']){_0x2d3efb['include']=[{'all':!![]}];}_0x2d3efb=_[_0x37df('0x3d')]({},_0x2d3efb,_0x196d07[_0x37df('0x44')]);return db['Campaign'][_0x37df('0x45')](_0x2d3efb)[_0x37df('0x21')](handleEntityNotFound(_0x4efc1a,null))[_0x37df('0x21')](respondWithResult(_0x4efc1a,null))[_0x37df('0x46')](handleError(_0x4efc1a,null));};exports['create']=function(_0x2fe2e,_0x2b9a46){return db[_0x37df('0x2a')][_0x37df('0x47')](_0x2fe2e[_0x37df('0x48')],{})['then'](function(_0x36a1e1){var _0x31c793=_0x2fe2e[_0x37df('0x49')]['get']({'plain':!![]});if(!_0x31c793)throw new Error(_0x37df('0x4a'));if(_0x31c793[_0x37df('0x4b')]==='user'){var _0x502122=_0x36a1e1[_0x37df('0x22')]({'plain':!![]});var _0x4897f3='IvrCampaigns';return db[_0x37df('0x4c')][_0x37df('0x45')]({'where':{'name':_0x4897f3,'userProfileId':_0x31c793[_0x37df('0x4d')]},'raw':!![]})[_0x37df('0x21')](function(_0x1ff2bd){if(_0x1ff2bd&&_0x1ff2bd['autoAssociation']===0x0){return db[_0x37df('0x23')][_0x37df('0x47')]({'name':_0x502122[_0x37df('0x30')],'resourceId':_0x502122['id'],'type':_0x1ff2bd['name'],'sectionId':_0x1ff2bd['id']},{})['then'](function(){return _0x36a1e1;});}else{return _0x36a1e1;}})[_0x37df('0x46')](function(_0x3fc567){logger[_0x37df('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fc567);throw _0x3fc567;});}return _0x36a1e1;})[_0x37df('0x21')](respondWithResult(_0x2b9a46,0xc9))[_0x37df('0x46')](handleError(_0x2b9a46,null));};exports['clone']=function(_0x4a41b0,_0x32615b){var _0x14de47={'where':{'id':_0x4a41b0[_0x37df('0x42')]['id']}},_0x390970={};_0x390970[_0x37df('0x2f')]=_[_0x37df('0x32')](db['Campaign'][_0x37df('0x2b')]);_0x14de47[_0x37df('0x35')]=_[_0x37df('0x34')](_0x390970[_0x37df('0x2f')],qs[_0x37df('0x43')](_0x4a41b0[_0x37df('0x31')][_0x37df('0x43')]));_0x14de47[_0x37df('0x35')]=_0x14de47[_0x37df('0x35')]['length']?_0x14de47[_0x37df('0x35')]:_0x390970['model'];if(_0x4a41b0[_0x37df('0x31')][_0x37df('0x3f')]){_0x14de47[_0x37df('0x4e')]=[{'all':!![]}];}_0x14de47=_[_0x37df('0x3d')]({},_0x14de47,_0x4a41b0[_0x37df('0x44')]);return db[_0x37df('0x2a')][_0x37df('0x45')](_0x14de47)[_0x37df('0x21')](handleEntityNotFound(_0x32615b,null))[_0x37df('0x21')](function(_0xec29bd){if(_0xec29bd){var _0x1e2969=_0xec29bd[_0x37df('0x22')]({'plain':!![]});_0x1e2969=qs[_0x37df('0x4f')](_0x1e2969,['id','createdAt',_0x37df('0x50')]);_0x4a41b0[_0x37df('0x48')]=_[_0x37df('0x4f')](_0x4a41b0[_0x37df('0x48')],['id','createdAt',_0x37df('0x50')]);return db[_0x37df('0x2a')]['create'](_[_0x37df('0x3d')](_0x1e2969,_0x4a41b0[_0x37df('0x48')]),{'include':_0x4a41b0[_0x37df('0x31')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xfeb94){var _0x15b55e=_0x4a41b0[_0x37df('0x49')]['get']({'plain':!![]});if(!_0x15b55e)throw new Error(_0x37df('0x4a'));if(_0x15b55e[_0x37df('0x4b')]===_0x37df('0x49')){var _0x3c87e6=_0xfeb94[_0x37df('0x22')]({'plain':!![]});var _0x29616e=_0x37df('0x51');return db[_0x37df('0x4c')][_0x37df('0x45')]({'where':{'name':_0x29616e,'userProfileId':_0x15b55e[_0x37df('0x4d')]},'raw':!![]})['then'](function(_0x18ae00){if(_0x18ae00&&_0x18ae00[_0x37df('0x52')]===0x0){return db[_0x37df('0x23')][_0x37df('0x47')]({'name':_0x3c87e6['name'],'resourceId':_0x3c87e6['id'],'type':_0x18ae00[_0x37df('0x30')],'sectionId':_0x18ae00['id']},{})[_0x37df('0x21')](function(){return _0xfeb94;});}else{return _0xfeb94;}})[_0x37df('0x46')](function(_0x26f0cc){logger[_0x37df('0x26')](_0x37df('0x53'),_0x26f0cc);throw _0x26f0cc;});}return _0xfeb94;});}})[_0x37df('0x21')](respondWithResult(_0x32615b,0xc9))[_0x37df('0x46')](handleError(_0x32615b,null));};exports[_0x37df('0x54')]=function(_0x1e28dc,_0x2e6aea){if(_0x1e28dc[_0x37df('0x48')]['id']){delete _0x1e28dc[_0x37df('0x48')]['id'];}return db[_0x37df('0x2a')][_0x37df('0x45')]({'where':{'id':_0x1e28dc[_0x37df('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e6aea,null))['then'](saveUpdates(_0x1e28dc[_0x37df('0x48')],null))[_0x37df('0x21')](respondWithResult(_0x2e6aea,null))[_0x37df('0x46')](handleError(_0x2e6aea,null));};exports[_0x37df('0x24')]=function(_0x47aa10,_0x51cba2){return db[_0x37df('0x2a')][_0x37df('0x45')]({'where':{'id':_0x47aa10[_0x37df('0x42')]['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x51cba2,null))[_0x37df('0x21')](removeEntity(_0x51cba2,null))[_0x37df('0x46')](handleError(_0x51cba2,null));};exports[_0x37df('0x55')]=function(_0x35de67,_0x5f36aa,_0x50aafc){var _0x667a9e={'raw':!![],'where':{}};var _0x7822bc={};var _0x8f99={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x35de67[_0x37df('0x42')]['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x5f36aa,null))[_0x37df('0x21')](function(_0x375524){if(_0x375524){_0x7822bc['model']=_[_0x37df('0x32')](db['CmHopper'][_0x37df('0x2b')]);_0x7822bc[_0x37df('0x31')]=_['keys'](_0x35de67[_0x37df('0x31')]);_0x7822bc[_0x37df('0x33')]=_['intersection'](_0x7822bc[_0x37df('0x2f')],_0x7822bc[_0x37df('0x31')]);_0x667a9e[_0x37df('0x35')]=_[_0x37df('0x34')](_0x7822bc['model'],qs[_0x37df('0x43')](_0x35de67[_0x37df('0x31')][_0x37df('0x43')]));_0x667a9e[_0x37df('0x35')]=_0x667a9e[_0x37df('0x35')]['length']?_0x667a9e['attributes']:_0x7822bc['model'];if(!_0x35de67[_0x37df('0x31')][_0x37df('0x37')](_0x37df('0x38'))){_0x667a9e[_0x37df('0x1a')]=qs[_0x37df('0x1a')](_0x35de67[_0x37df('0x31')][_0x37df('0x1a')]);_0x667a9e[_0x37df('0x18')]=qs[_0x37df('0x18')](_0x35de67[_0x37df('0x31')]['offset']);}_0x667a9e[_0x37df('0x56')]=qs['sort'](_0x35de67[_0x37df('0x31')][_0x37df('0x39')]);_0x667a9e[_0x37df('0x3a')]=qs['filters'](_['pick'](_0x35de67['query'],_0x7822bc[_0x37df('0x33')]));_0x667a9e['where']['CampaignId']=_0x375524['id'];if(_0x35de67[_0x37df('0x31')]['filter']){_0x667a9e['where']=_[_0x37df('0x3d')](_0x667a9e[_0x37df('0x3a')],{'$or':_[_0x37df('0x29')](_0x667a9e[_0x37df('0x35')],function(_0x3a38d4){var _0x11efea={};_0x11efea[_0x3a38d4]={'$like':'%'+_0x35de67[_0x37df('0x31')][_0x37df('0x3c')]+'%'};return _0x11efea;})});}_0x667a9e=_[_0x37df('0x3d')]({},_0x667a9e,_0x35de67['options']);return db['CmHopper']['count']({'where':_0x667a9e[_0x37df('0x3a')]})[_0x37df('0x21')](function(_0x534035){_0x8f99[_0x37df('0x1b')]=_0x534035;if(_0x35de67[_0x37df('0x31')][_0x37df('0x3f')]){_0x667a9e['include']=[{'all':!![]}];}return db[_0x37df('0x57')][_0x37df('0x58')](_0x667a9e);})['then'](function(_0x460ba3){_0x8f99[_0x37df('0x40')]=_0x460ba3;return _0x8f99;});}})[_0x37df('0x21')](respondWithFilteredResult(_0x5f36aa,_0x667a9e))[_0x37df('0x46')](handleError(_0x5f36aa,null));};exports[_0x37df('0x59')]=function(_0x3e878f,_0x4d3f9f,_0x2d29e2){var _0x512ed1={'raw':!![],'where':{}};var _0x57136f={};var _0x512c88={'count':0x0,'rows':[]};return db[_0x37df('0x2a')]['findOne']({'where':{'id':_0x3e878f['params']['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x4d3f9f,null))[_0x37df('0x21')](function(_0x5b468b){if(_0x5b468b){_0x57136f['model']=_[_0x37df('0x32')](db[_0x37df('0x5a')][_0x37df('0x2b')]);_0x57136f[_0x37df('0x31')]=_[_0x37df('0x32')](_0x3e878f[_0x37df('0x31')]);_0x57136f[_0x37df('0x33')]=_[_0x37df('0x34')](_0x57136f['model'],_0x57136f[_0x37df('0x31')]);_0x512ed1['attributes']=_[_0x37df('0x34')](_0x57136f[_0x37df('0x2f')],qs['fields'](_0x3e878f[_0x37df('0x31')][_0x37df('0x43')]));_0x512ed1[_0x37df('0x35')]=_0x512ed1[_0x37df('0x35')][_0x37df('0x36')]?_0x512ed1['attributes']:_0x57136f[_0x37df('0x2f')];if(!_0x3e878f[_0x37df('0x31')][_0x37df('0x37')]('nolimit')){_0x512ed1['limit']=qs[_0x37df('0x1a')](_0x3e878f[_0x37df('0x31')][_0x37df('0x1a')]);_0x512ed1['offset']=qs['offset'](_0x3e878f[_0x37df('0x31')][_0x37df('0x18')]);}_0x512ed1[_0x37df('0x56')]=qs['sort'](_0x3e878f['query'][_0x37df('0x39')]);_0x512ed1[_0x37df('0x3a')]=qs[_0x37df('0x33')](_[_0x37df('0x3b')](_0x3e878f[_0x37df('0x31')],_0x57136f[_0x37df('0x33')]));_0x512ed1[_0x37df('0x3a')][_0x37df('0x5b')]=_0x5b468b['id'];if(_0x3e878f[_0x37df('0x31')]['filter']){_0x512ed1[_0x37df('0x3a')]=_[_0x37df('0x3d')](_0x512ed1[_0x37df('0x3a')],{'$or':_[_0x37df('0x29')](_0x512ed1[_0x37df('0x35')],function(_0x1c0f0a){var _0x48e5ab={};_0x48e5ab[_0x1c0f0a]={'$like':'%'+_0x3e878f[_0x37df('0x31')]['filter']+'%'};return _0x48e5ab;})});}_0x512ed1=_[_0x37df('0x3d')]({},_0x512ed1,_0x3e878f[_0x37df('0x44')]);return db[_0x37df('0x5a')]['count']({'where':_0x512ed1[_0x37df('0x3a')]})[_0x37df('0x21')](function(_0x271702){_0x512c88[_0x37df('0x1b')]=_0x271702;if(_0x3e878f['query']['includeAll']){_0x512ed1[_0x37df('0x4e')]=[{'all':!![]}];}return db[_0x37df('0x5a')][_0x37df('0x58')](_0x512ed1);})['then'](function(_0x43afe0){_0x512c88[_0x37df('0x40')]=_0x43afe0;return _0x512c88;});}})[_0x37df('0x21')](respondWithFilteredResult(_0x4d3f9f,_0x512ed1))[_0x37df('0x46')](handleError(_0x4d3f9f,null));};exports[_0x37df('0x5c')]=function(_0x205536,_0x263416,_0x365ced){var _0x245589={'raw':!![],'where':{}};var _0x390e53={};var _0xd287cd={'count':0x0,'rows':[]};return db[_0x37df('0x2a')][_0x37df('0x5d')]({'where':{'id':_0x205536[_0x37df('0x42')]['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x263416,null))[_0x37df('0x21')](function(_0x4a3930){if(_0x4a3930){_0x390e53[_0x37df('0x2f')]=_[_0x37df('0x32')](db[_0x37df('0x5e')][_0x37df('0x2b')]);_0x390e53[_0x37df('0x31')]=_[_0x37df('0x32')](_0x205536[_0x37df('0x31')]);_0x390e53[_0x37df('0x33')]=_[_0x37df('0x34')](_0x390e53[_0x37df('0x2f')],_0x390e53[_0x37df('0x31')]);_0x245589[_0x37df('0x35')]=_[_0x37df('0x34')](_0x390e53[_0x37df('0x2f')],qs[_0x37df('0x43')](_0x205536[_0x37df('0x31')][_0x37df('0x43')]));_0x245589[_0x37df('0x35')]=_0x245589['attributes'][_0x37df('0x36')]?_0x245589['attributes']:_0x390e53[_0x37df('0x2f')];if(!_0x205536[_0x37df('0x31')][_0x37df('0x37')](_0x37df('0x38'))){_0x245589[_0x37df('0x1a')]=qs[_0x37df('0x1a')](_0x205536['query'][_0x37df('0x1a')]);_0x245589[_0x37df('0x18')]=qs[_0x37df('0x18')](_0x205536['query'][_0x37df('0x18')]);}_0x245589[_0x37df('0x56')]=qs[_0x37df('0x39')](_0x205536[_0x37df('0x31')]['sort']);_0x245589['where']=qs['filters'](_[_0x37df('0x3b')](_0x205536['query'],_0x390e53[_0x37df('0x33')]));_0x245589[_0x37df('0x3a')][_0x37df('0x5b')]=_0x4a3930['id'];if(_0x205536['query']['filter']){_0x245589[_0x37df('0x3a')]=_[_0x37df('0x3d')](_0x245589['where'],{'$or':_['map'](_0x245589[_0x37df('0x35')],function(_0x17a2de){var _0x1a15ef={};_0x1a15ef[_0x17a2de]={'$like':'%'+_0x205536['query']['filter']+'%'};return _0x1a15ef;})});}_0x245589=_['merge']({},_0x245589,_0x205536[_0x37df('0x44')]);return db[_0x37df('0x5e')]['count']({'where':_0x245589[_0x37df('0x3a')]})[_0x37df('0x21')](function(_0x2ffdb4){_0xd287cd[_0x37df('0x1b')]=_0x2ffdb4;if(_0x205536[_0x37df('0x31')]['includeAll']){_0x245589[_0x37df('0x4e')]=[{'all':!![]}];}return db[_0x37df('0x5e')][_0x37df('0x58')](_0x245589);})[_0x37df('0x21')](function(_0x5544b3){_0xd287cd['rows']=_0x5544b3;return _0xd287cd;});}})['then'](respondWithFilteredResult(_0x263416,_0x245589))[_0x37df('0x46')](handleError(_0x263416,null));};exports[_0x37df('0x5f')]=function(_0x19a5b0,_0x5c61f8,_0x1336fc){var _0xe33fb9={'raw':!![],'where':{}};var _0x1c2ee5={};var _0x4b06b0={'count':0x0,'rows':[]};return db[_0x37df('0x2a')][_0x37df('0x5d')]({'where':{'id':_0x19a5b0[_0x37df('0x42')]['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x5c61f8,null))[_0x37df('0x21')](function(_0x34916e){if(_0x34916e){_0x1c2ee5[_0x37df('0x2f')]=_['keys'](db[_0x37df('0x60')][_0x37df('0x2b')]);_0x1c2ee5['query']=_['keys'](_0x19a5b0[_0x37df('0x31')]);_0x1c2ee5['filters']=_[_0x37df('0x34')](_0x1c2ee5[_0x37df('0x2f')],_0x1c2ee5[_0x37df('0x31')]);_0xe33fb9[_0x37df('0x35')]=_[_0x37df('0x34')](_0x1c2ee5[_0x37df('0x2f')],qs[_0x37df('0x43')](_0x19a5b0[_0x37df('0x31')]['fields']));_0xe33fb9[_0x37df('0x35')]=_0xe33fb9['attributes'][_0x37df('0x36')]?_0xe33fb9[_0x37df('0x35')]:_0x1c2ee5['model'];if(!_0x19a5b0[_0x37df('0x31')]['hasOwnProperty'](_0x37df('0x38'))){_0xe33fb9[_0x37df('0x1a')]=qs[_0x37df('0x1a')](_0x19a5b0[_0x37df('0x31')][_0x37df('0x1a')]);_0xe33fb9[_0x37df('0x18')]=qs[_0x37df('0x18')](_0x19a5b0['query'][_0x37df('0x18')]);}_0xe33fb9[_0x37df('0x56')]=qs[_0x37df('0x39')](_0x19a5b0[_0x37df('0x31')][_0x37df('0x39')]);_0xe33fb9[_0x37df('0x3a')]=qs[_0x37df('0x33')](_[_0x37df('0x3b')](_0x19a5b0[_0x37df('0x31')],_0x1c2ee5[_0x37df('0x33')]));_0xe33fb9['where'][_0x37df('0x5b')]=_0x34916e['id'];if(_0x19a5b0[_0x37df('0x31')][_0x37df('0x3c')]){_0xe33fb9['where']=_[_0x37df('0x3d')](_0xe33fb9['where'],{'$or':_[_0x37df('0x29')](_0xe33fb9[_0x37df('0x35')],function(_0x489965){var _0x11dde3={};_0x11dde3[_0x489965]={'$like':'%'+_0x19a5b0[_0x37df('0x31')][_0x37df('0x3c')]+'%'};return _0x11dde3;})});}_0xe33fb9=_[_0x37df('0x3d')]({},_0xe33fb9,_0x19a5b0[_0x37df('0x44')]);return db[_0x37df('0x60')][_0x37df('0x1b')]({'where':_0xe33fb9[_0x37df('0x3a')]})['then'](function(_0x501d77){_0x4b06b0[_0x37df('0x1b')]=_0x501d77;if(_0x19a5b0[_0x37df('0x31')]['includeAll']){_0xe33fb9[_0x37df('0x4e')]=[{'all':!![]}];}return db[_0x37df('0x60')]['findAll'](_0xe33fb9);})[_0x37df('0x21')](function(_0x16511b){_0x4b06b0['rows']=_0x16511b;return _0x4b06b0;});}})[_0x37df('0x21')](respondWithFilteredResult(_0x5c61f8,_0xe33fb9))[_0x37df('0x46')](handleError(_0x5c61f8,null));};exports['getLists']=function(_0x499ffa,_0x27eea1,_0x11efae){var _0x11ed55={};var _0x19384e={};var _0x227629;var _0x16f0bb;return db['Campaign']['findOne']({'where':{'id':_0x499ffa[_0x37df('0x42')]['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x27eea1,null))[_0x37df('0x21')](function(_0x18bbde){if(_0x18bbde){_0x227629=_0x18bbde;_0x19384e[_0x37df('0x2f')]=_[_0x37df('0x32')](db[_0x37df('0x61')][_0x37df('0x2b')]);_0x19384e[_0x37df('0x31')]=_[_0x37df('0x32')](_0x499ffa[_0x37df('0x31')]);_0x19384e[_0x37df('0x33')]=_[_0x37df('0x34')](_0x19384e[_0x37df('0x2f')],_0x19384e['query']);_0x11ed55[_0x37df('0x35')]=_['intersection'](_0x19384e[_0x37df('0x2f')],qs[_0x37df('0x43')](_0x499ffa[_0x37df('0x31')][_0x37df('0x43')]));_0x11ed55[_0x37df('0x35')]=_0x11ed55[_0x37df('0x35')]['length']?_0x11ed55[_0x37df('0x35')]:_0x19384e[_0x37df('0x2f')];_0x11ed55[_0x37df('0x56')]=qs[_0x37df('0x39')](_0x499ffa[_0x37df('0x31')]['sort']);_0x11ed55[_0x37df('0x3a')]=qs[_0x37df('0x33')](_[_0x37df('0x3b')](_0x499ffa[_0x37df('0x31')],_0x19384e[_0x37df('0x33')]));if(_0x499ffa[_0x37df('0x31')]['filter']){_0x11ed55[_0x37df('0x3a')]=_['merge'](_0x11ed55[_0x37df('0x3a')],{'$or':_[_0x37df('0x29')](_0x11ed55['attributes'],function(_0x518b93){var _0x22a16d={};_0x22a16d[_0x518b93]={'$like':'%'+_0x499ffa[_0x37df('0x31')][_0x37df('0x3c')]+'%'};return _0x22a16d;})});}_0x11ed55=_[_0x37df('0x3d')]({},_0x11ed55,_0x499ffa[_0x37df('0x44')]);return _0x227629[_0x37df('0x62')](_0x11ed55);}})[_0x37df('0x21')](function(_0x313b39){if(_0x313b39){_0x16f0bb=_0x313b39[_0x37df('0x36')];if(!_0x499ffa['query']['hasOwnProperty'](_0x37df('0x38'))){_0x11ed55['limit']=qs['limit'](_0x499ffa[_0x37df('0x31')]['limit']);_0x11ed55['offset']=qs[_0x37df('0x18')](_0x499ffa[_0x37df('0x31')]['offset']);}return _0x227629[_0x37df('0x62')](_0x11ed55);}})[_0x37df('0x21')](function(_0x4e1c64){if(_0x4e1c64){return _0x4e1c64?{'count':_0x16f0bb,'rows':_0x4e1c64}:null;}})[_0x37df('0x21')](respondWithResult(_0x27eea1,null))[_0x37df('0x46')](handleError(_0x27eea1,null));};exports['addLists']=function(_0x42aeb3,_0x4de134,_0x36fa60){var _0x4bc059,_0x547a37;var _0x493071=[];var _0x35e778=moment()[_0x37df('0x63')](_0x37df('0x64'));return db[_0x37df('0x2a')][_0x37df('0x45')]({'where':{'id':_0x42aeb3[_0x37df('0x42')]['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x4de134,null))[_0x37df('0x21')](function(_0x3b0e17){if(_0x3b0e17){_0x547a37=_0x3b0e17;return _0x3b0e17[_0x37df('0x65')](_0x42aeb3[_0x37df('0x48')][_0x37df('0x66')],_[_0x37df('0x4f')](_0x42aeb3[_0x37df('0x48')],[_0x37df('0x66'),'id'])||{});}return null;})[_0x37df('0x67')](function(_0x2fafde){var _0x483f84;var _0x42df10;_0x4bc059=_0x2fafde||[];var _0x19a261=[];if(_0x2fafde){for(var _0x22067c=0x0;_0x22067c<_0x2fafde[_0x37df('0x36')];_0x22067c+=0x1){var _0xc6cf5d=_0x2fafde[_0x22067c][_0x37df('0x22')]({'plain':!![]});_0x547a37[_0x37df('0x68')]=_0x42aeb3[_0x37df('0x48')][_0x37df('0x68')]?_0x42aeb3[_0x37df('0x48')][_0x37df('0x68')]:_0x547a37[_0x37df('0x68')];switch(_0x547a37[_0x37df('0x68')]){case'always':_0x483f84=squel[_0x37df('0x69')]()[_0x37df('0x6a')](_0x37df('0x6b'))[_0x37df('0x6c')]([_0x37df('0x6d'),_0x37df('0x6e'),_0x37df('0x6f'),_0x37df('0x70'),'CampaignId',_0x37df('0x71'),'updatedAt'],squel[_0x37df('0x72')]()[_0x37df('0x73')]('phone','phone')['field'](_0x37df('0x74'),'scheduledAt')[_0x37df('0x73')]('id','ContactId')[_0x37df('0x73')](_0xc6cf5d[_0x37df('0x75')]['toString'](),_0x37df('0x70'))['field'](_0x42aeb3['params']['id'][_0x37df('0x76')](),'CampaignId')[_0x37df('0x73')]('\x27'+_0x35e778+'\x27',_0x37df('0x71'))['field']('\x27'+_0x35e778+'\x27',_0x37df('0x50'))[_0x37df('0x77')]('cm_contacts')[_0x37df('0x3a')](_0x37df('0x78'))[_0x37df('0x3a')](_0x37df('0x79'),_0xc6cf5d[_0x37df('0x75')][_0x37df('0x76')]())[_0x37df('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0x37df('0x3a')](_0x37df('0x7a'),squel[_0x37df('0x72')]()[_0x37df('0x73')](_0x37df('0x7b'))['from'](_0x37df('0x7c'))[_0x37df('0x3a')](_0x37df('0x7d'),_0x42aeb3[_0x37df('0x42')]['id'][_0x37df('0x76')]()))[_0x37df('0x3a')](_0x37df('0x7a'),squel[_0x37df('0x72')]()[_0x37df('0x73')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x37df('0x7d'),_0x42aeb3[_0x37df('0x42')]['id'][_0x37df('0x76')]())))[_0x37df('0x76')]();break;case _0x37df('0x7e'):_0x483f84=squel[_0x37df('0x69')]()[_0x37df('0x6a')](_0x37df('0x6b'))[_0x37df('0x6c')]([_0x37df('0x6d'),_0x37df('0x6e'),_0x37df('0x6f'),_0x37df('0x70'),_0x37df('0x5b'),_0x37df('0x71'),_0x37df('0x50')],squel[_0x37df('0x72')]()[_0x37df('0x73')](_0x37df('0x6d'),_0x37df('0x6d'))[_0x37df('0x73')](_0x37df('0x74'),_0x37df('0x6e'))[_0x37df('0x73')]('id',_0x37df('0x6f'))[_0x37df('0x73')](_0xc6cf5d[_0x37df('0x75')][_0x37df('0x76')](),_0x37df('0x70'))[_0x37df('0x73')](_0x42aeb3[_0x37df('0x42')]['id'][_0x37df('0x76')](),'CampaignId')[_0x37df('0x73')]('\x27'+_0x35e778+'\x27','createdAt')['field']('\x27'+_0x35e778+'\x27',_0x37df('0x50'))[_0x37df('0x77')]('cm_contacts')[_0x37df('0x3a')](_0x37df('0x78'))[_0x37df('0x3a')]('ListId\x20=\x20?',_0xc6cf5d[_0x37df('0x75')]['toString']())['where'](_0x37df('0x7f'))[_0x37df('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x37df('0x77')](_0x37df('0x6b'))[_0x37df('0x3a')](_0x37df('0x7d'),_0x42aeb3['params']['id'][_0x37df('0x76')]())))[_0x37df('0x76')]();break;default:_0x483f84=squel['insert']()[_0x37df('0x6a')](_0x37df('0x6b'))[_0x37df('0x6c')](['phone',_0x37df('0x6e'),'ContactId','ListId','CampaignId',_0x37df('0x71'),'updatedAt'],squel[_0x37df('0x72')]()[_0x37df('0x73')](_0x37df('0x6d'),'phone')[_0x37df('0x73')](_0x37df('0x74'),_0x37df('0x6e'))[_0x37df('0x73')]('id',_0x37df('0x6f'))['field'](_0xc6cf5d[_0x37df('0x75')]['toString'](),_0x37df('0x70'))['field'](_0x42aeb3[_0x37df('0x42')]['id']['toString'](),_0x37df('0x5b'))[_0x37df('0x73')]('\x27'+_0x35e778+'\x27',_0x37df('0x71'))[_0x37df('0x73')]('\x27'+_0x35e778+'\x27',_0x37df('0x50'))[_0x37df('0x77')]('cm_contacts')[_0x37df('0x3a')](_0x37df('0x78'))['where'](_0x37df('0x79'),_0xc6cf5d[_0x37df('0x75')][_0x37df('0x76')]())[_0x37df('0x3a')](_0x37df('0x7f')))['toString']();}_0x42df10=squel[_0x37df('0x69')]()[_0x37df('0x6a')](_0x37df('0x80'))[_0x37df('0x6c')](['cmHopperId',_0x37df('0x6e'),_0x37df('0x6d'),'OrderBy',_0x37df('0x71'),_0x37df('0x50')],squel['select']()[_0x37df('0x73')]('h.id','id')['field']('NOW()',_0x37df('0x6e'))[_0x37df('0x73')](_0x37df('0x81'),_0x37df('0x6d'))[_0x37df('0x73')](_0x37df('0x82'),_0x37df('0x83'))[_0x37df('0x73')]('\x27'+_0x35e778+'\x27','createdAt')[_0x37df('0x73')]('\x27'+_0x35e778+'\x27',_0x37df('0x50'))['from'](_0x37df('0x84'),'ci')['join'](_0x37df('0x6b'),'h',_0x37df('0x85'))[_0x37df('0x3a')](_0x37df('0x86'),_0xc6cf5d[_0x37df('0x75')][_0x37df('0x76')]())['where']('h.CampaignId=?',_0x42aeb3[_0x37df('0x42')]['id']['toString']())[_0x37df('0x3a')](_0x37df('0x87'),_0x35e778))[_0x37df('0x76')]();_0x19a261['push'](db[_0x37df('0x88')][_0x37df('0x31')](_0x483f84));_0x493071[_0x37df('0x89')](db[_0x37df('0x88')][_0x37df('0x31')](_0x42df10));}return BPromise[_0x37df('0x8a')](_0x19a261);}})[_0x37df('0x21')](function(){return BPromise[_0x37df('0x8a')](_0x493071);})[_0x37df('0x21')](function(){return _0x4bc059;})[_0x37df('0x21')](respondWithResult(_0x4de134,null))[_0x37df('0x46')](handleError(_0x4de134,null));};exports[_0x37df('0x8b')]=function(_0x227411,_0x5dd61f,_0x25a225){return db[_0x37df('0x2a')][_0x37df('0x45')]({'where':{'id':_0x227411[_0x37df('0x42')]['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x5dd61f,null))[_0x37df('0x21')](function(_0x3d2eda){if(_0x3d2eda){return _0x3d2eda[_0x37df('0x8b')](_0x227411[_0x37df('0x31')][_0x37df('0x66')]);}})['then'](function(_0x55c2eb){if(_0x55c2eb){return db[_0x37df('0x57')]['destroy']({'where':{'ListId':_0x227411[_0x37df('0x31')][_0x37df('0x66')],'CampaignId':_0x227411[_0x37df('0x42')]['id']}})['then'](function(){return _0x55c2eb;});}})['then'](respondWithStatusCode(_0x5dd61f,null))[_0x37df('0x46')](handleError(_0x5dd61f,null));};exports['getBlackLists']=function(_0x5a73a1,_0x35c029,_0x17b2d9){var _0x45128e={};var _0x4df065={};var _0x55c7eb;var _0x33525c;return db[_0x37df('0x2a')][_0x37df('0x5d')]({'where':{'id':_0x5a73a1[_0x37df('0x42')]['id']}})[_0x37df('0x21')](handleEntityNotFound(_0x35c029,null))['then'](function(_0x2299b6){if(_0x2299b6){_0x55c7eb=_0x2299b6;_0x4df065[_0x37df('0x2f')]=_[_0x37df('0x32')](db['CmList']['rawAttributes']);_0x4df065[_0x37df('0x31')]=_[_0x37df('0x32')](_0x5a73a1[_0x37df('0x31')]);_0x4df065[_0x37df('0x33')]=_[_0x37df('0x34')](_0x4df065[_0x37df('0x2f')],_0x4df065['query']);_0x45128e[_0x37df('0x35')]=_['intersection'](_0x4df065[_0x37df('0x2f')],qs[_0x37df('0x43')](_0x5a73a1[_0x37df('0x31')][_0x37df('0x43')]));_0x45128e['attributes']=_0x45128e['attributes']['length']?_0x45128e[_0x37df('0x35')]:_0x4df065[_0x37df('0x2f')];_0x45128e[_0x37df('0x56')]=qs[_0x37df('0x39')](_0x5a73a1[_0x37df('0x31')][_0x37df('0x39')]);_0x45128e[_0x37df('0x3a')]=qs[_0x37df('0x33')](_['pick'](_0x5a73a1[_0x37df('0x31')],_0x4df065[_0x37df('0x33')]));if(_0x5a73a1['query'][_0x37df('0x3c')]){_0x45128e['where']=_['merge'](_0x45128e[_0x37df('0x3a')],{'$or':_[_0x37df('0x29')](_0x45128e['attributes'],function(_0x21a7ca){var _0x1ac88f={};_0x1ac88f[_0x21a7ca]={'$like':'%'+_0x5a73a1[_0x37df('0x31')][_0x37df('0x3c')]+'%'};return _0x1ac88f;})});}_0x45128e=_[_0x37df('0x3d')]({},_0x45128e,_0x5a73a1[_0x37df('0x44')]);return _0x55c7eb[_0x37df('0x8c')](_0x45128e);}})[_0x37df('0x21')](function(_0x1074f6){if(_0x1074f6){_0x33525c=_0x1074f6[_0x37df('0x36')];if(!_0x5a73a1['query'][_0x37df('0x37')](_0x37df('0x38'))){_0x45128e[_0x37df('0x1a')]=qs[_0x37df('0x1a')](_0x5a73a1[_0x37df('0x31')][_0x37df('0x1a')]);_0x45128e['offset']=qs[_0x37df('0x18')](_0x5a73a1[_0x37df('0x31')][_0x37df('0x18')]);}return _0x55c7eb['getBlackLists'](_0x45128e);}})['then'](function(_0x56f807){if(_0x56f807){return _0x56f807?{'count':_0x33525c,'rows':_0x56f807}:null;}})[_0x37df('0x21')](respondWithResult(_0x35c029,null))[_0x37df('0x46')](handleError(_0x35c029,null));};exports[_0x37df('0x8d')]=function(_0x111663,_0x2845ba,_0x418f45){var _0x555ac3,_0x3aa049;var _0x56642a=[];var _0x416b46=moment()[_0x37df('0x63')](_0x37df('0x64'));return db['Campaign']['find']({'where':{'id':_0x111663[_0x37df('0x42')]['id']}})['then'](handleEntityNotFound(_0x2845ba,null))[_0x37df('0x21')](function(_0x264465){if(_0x264465){_0x3aa049=_0x264465;return _0x264465[_0x37df('0x8d')](_0x111663[_0x37df('0x48')][_0x37df('0x66')],_[_0x37df('0x4f')](_0x111663[_0x37df('0x48')],[_0x37df('0x66'),'id'])||{});}return null;})[_0x37df('0x67')](function(_0x308ac8){var _0x117cce;var _0x1bee2f;_0x555ac3=_0x308ac8||[];var _0x34bc4a=[];if(_0x308ac8){for(var _0x501eec=0x0;_0x501eec<_0x308ac8[_0x37df('0x36')];_0x501eec+=0x1){var _0x30daf2=_0x308ac8[_0x501eec][_0x37df('0x22')]({'plain':!![]});_0x117cce=squel[_0x37df('0x69')]()['into'](_0x37df('0x8e'))['fromQuery'](['phone','ContactId',_0x37df('0x70'),_0x37df('0x5b'),_0x37df('0x71'),_0x37df('0x50')],squel['select']()[_0x37df('0x73')](_0x37df('0x6d'),_0x37df('0x6d'))[_0x37df('0x73')]('id',_0x37df('0x6f'))['field'](_0x30daf2[_0x37df('0x75')]['toString'](),'ListId')[_0x37df('0x73')](_0x111663[_0x37df('0x42')]['id'][_0x37df('0x76')](),'CampaignId')['field'](_0x37df('0x74'),'createdAt')[_0x37df('0x73')](_0x37df('0x74'),_0x37df('0x50'))['from']('cm_contacts')[_0x37df('0x3a')](_0x37df('0x78'))[_0x37df('0x3a')]('ListId\x20=\x20?',_0x30daf2[_0x37df('0x75')][_0x37df('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x37df('0x76')]();_0x34bc4a[_0x37df('0x89')](db[_0x37df('0x88')]['query'](_0x117cce));}return BPromise[_0x37df('0x8a')](_0x34bc4a);}})[_0x37df('0x21')](function(){return _0x555ac3;})[_0x37df('0x21')](respondWithResult(_0x2845ba,null))['catch'](handleError(_0x2845ba,null));};exports[_0x37df('0x8f')]=function(_0x5bed64,_0x1de791,_0x225a3f){return db[_0x37df('0x2a')][_0x37df('0x45')]({'where':{'id':_0x5bed64[_0x37df('0x42')]['id']}})['then'](handleEntityNotFound(_0x1de791,null))['then'](function(_0x12a8c3){if(_0x12a8c3){return _0x12a8c3[_0x37df('0x8f')](_0x5bed64[_0x37df('0x31')][_0x37df('0x66')]);}})[_0x37df('0x21')](function(_0x1989f1){if(_0x1989f1){return db[_0x37df('0x60')][_0x37df('0x24')]({'where':{'ListId':_0x5bed64[_0x37df('0x31')][_0x37df('0x66')],'CampaignId':_0x5bed64['params']['id']}})[_0x37df('0x21')](function(){return _0x1989f1;});}})[_0x37df('0x21')](respondWithStatusCode(_0x1de791,null))[_0x37df('0x46')](handleError(_0x1de791,null));};
\ No newline at end of file
+var _0x076b=['CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','scheduledAt','ListId','field','phone','ContactId','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','insert','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','findAll'];(function(_0x304f80,_0x2f7b5b){var _0x4c0f2d=function(_0x2cca97){while(--_0x2cca97){_0x304f80['push'](_0x304f80['shift']());}};_0x4c0f2d(++_0x2f7b5b);}(_0x076b,0x131));var _0xb076=function(_0x411029,_0x5e4c2b){_0x411029=_0x411029-0x0;var _0xc7860a=_0x076b[_0x411029];return _0xc7860a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb076('0x0'));var zipdir=require(_0xb076('0x1'));var jsonpatch=require(_0xb076('0x2'));var rp=require(_0xb076('0x3'));var moment=require(_0xb076('0x4'));var BPromise=require(_0xb076('0x5'));var Mustache=require('mustache');var util=require(_0xb076('0x6'));var path=require(_0xb076('0x7'));var sox=require(_0xb076('0x8'));var csv=require('to-csv');var ejs=require(_0xb076('0x9'));var fs=require('fs');var fs_extra=require(_0xb076('0xa'));var _=require('lodash');var squel=require(_0xb076('0xb'));var crypto=require(_0xb076('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb076('0xd'));var toCsv=require(_0xb076('0xe'));var querystring=require('querystring');var Papa=require(_0xb076('0xf'));var Redis=require(_0xb076('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb076('0x11'));var as=require(_0xb076('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb076('0x13'))('api');var utils=require(_0xb076('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb076('0x15'));var db=require(_0xb076('0x16'))['db'];function respondWithStatusCode(_0x26733e,_0x97ba76){_0x97ba76=_0x97ba76||0xcc;return function(_0x2331a4){if(_0x2331a4){return _0x26733e['sendStatus'](_0x97ba76);}return _0x26733e[_0xb076('0x17')](_0x97ba76)[_0xb076('0x18')]();};}function respondWithResult(_0x11e872,_0x2f9509){_0x2f9509=_0x2f9509||0xc8;return function(_0x1ec5e6){if(_0x1ec5e6){return _0x11e872[_0xb076('0x17')](_0x2f9509)[_0xb076('0x19')](_0x1ec5e6);}};}function respondWithFilteredResult(_0x1483b1,_0x47d9d6){return function(_0x4e688d){if(_0x4e688d){var _0x5b103b=typeof _0x47d9d6[_0xb076('0x1a')]===_0xb076('0x1b')&&typeof _0x47d9d6[_0xb076('0x1c')]===_0xb076('0x1b');var _0xdaeb2=_0x4e688d[_0xb076('0x1d')];var _0x546b22=_0x5b103b?0x0:_0x47d9d6[_0xb076('0x1a')];var _0x532b1a=_0x5b103b?_0x4e688d[_0xb076('0x1d')]:_0x47d9d6[_0xb076('0x1a')]+_0x47d9d6[_0xb076('0x1c')];var _0x30cada;if(_0x532b1a>=_0xdaeb2){_0x532b1a=_0xdaeb2;_0x30cada=0xc8;}else{_0x30cada=0xce;}_0x1483b1[_0xb076('0x17')](_0x30cada);return _0x1483b1['set'](_0xb076('0x1e'),_0x546b22+'-'+_0x532b1a+'/'+_0xdaeb2)[_0xb076('0x19')](_0x4e688d);}return null;};}function patchUpdates(_0x3245b8){return function(_0x77113){try{jsonpatch['apply'](_0x77113,_0x3245b8,!![]);}catch(_0x5a9c54){return BPromise['reject'](_0x5a9c54);}return _0x77113['save']();};}function saveUpdates(_0x1642ab,_0xf28f3b){return function(_0x1a59dd){if(_0x1a59dd){return _0x1a59dd['update'](_0x1642ab)[_0xb076('0x1f')](function(_0x104abf){return _0x104abf;});}return null;};}function removeEntity(_0x3437f6,_0xbcea23){return function(_0x3d2871){if(_0x3d2871){return _0x3d2871[_0xb076('0x20')]()[_0xb076('0x1f')](function(){var _0x5020e6=_0x3d2871[_0xb076('0x21')]({'plain':!![]});var _0x18b802=_0xb076('0x22');return db[_0xb076('0x23')][_0xb076('0x20')]({'where':{'type':_0x18b802,'resourceId':_0x5020e6['id']}})['then'](function(){return _0x3d2871;});})['then'](function(){_0x3437f6[_0xb076('0x17')](0xcc)[_0xb076('0x18')]();});}};}function handleEntityNotFound(_0x584994,_0x4e10e1){return function(_0xfa568a){if(!_0xfa568a){_0x584994[_0xb076('0x24')](0x194);}return _0xfa568a;};}function handleError(_0xcb3103,_0x1c393f){_0x1c393f=_0x1c393f||0x1f4;return function(_0x1d23d1){logger['error'](_0x1d23d1[_0xb076('0x25')]);if(_0x1d23d1[_0xb076('0x26')]){delete _0x1d23d1[_0xb076('0x26')];}_0xcb3103['status'](_0x1c393f)[_0xb076('0x27')](_0x1d23d1);};}exports['index']=function(_0x31df93,_0x1536a7){var _0x59a405={},_0x26f280={},_0x38ec41={'count':0x0,'rows':[]};var _0x2e90f2=_[_0xb076('0x28')](db[_0xb076('0x29')][_0xb076('0x2a')],function(_0xc31365){return{'name':_0xc31365[_0xb076('0x2b')],'type':_0xc31365[_0xb076('0x2c')][_0xb076('0x2d')]};});_0x26f280[_0xb076('0x2e')]=_[_0xb076('0x28')](_0x2e90f2,_0xb076('0x26'));_0x26f280[_0xb076('0x2f')]=_[_0xb076('0x30')](_0x31df93[_0xb076('0x2f')]);_0x26f280[_0xb076('0x31')]=_[_0xb076('0x32')](_0x26f280[_0xb076('0x2e')],_0x26f280['query']);_0x59a405[_0xb076('0x33')]=_[_0xb076('0x32')](_0x26f280[_0xb076('0x2e')],qs[_0xb076('0x34')](_0x31df93[_0xb076('0x2f')][_0xb076('0x34')]));_0x59a405[_0xb076('0x33')]=_0x59a405['attributes'][_0xb076('0x35')]?_0x59a405[_0xb076('0x33')]:_0x26f280['model'];if(!_0x31df93[_0xb076('0x2f')]['hasOwnProperty'](_0xb076('0x36'))){_0x59a405['limit']=qs[_0xb076('0x1c')](_0x31df93[_0xb076('0x2f')][_0xb076('0x1c')]);_0x59a405[_0xb076('0x1a')]=qs[_0xb076('0x1a')](_0x31df93[_0xb076('0x2f')][_0xb076('0x1a')]);}_0x59a405[_0xb076('0x37')]=qs[_0xb076('0x38')](_0x31df93[_0xb076('0x2f')][_0xb076('0x38')]);_0x59a405[_0xb076('0x39')]=qs['filters'](_[_0xb076('0x3a')](_0x31df93[_0xb076('0x2f')],_0x26f280[_0xb076('0x31')]),_0x2e90f2);if(_0x31df93[_0xb076('0x2f')]['filter']){_0x59a405[_0xb076('0x39')]=_[_0xb076('0x3b')](_0x59a405[_0xb076('0x39')],{'$or':_[_0xb076('0x28')](_0x2e90f2,function(_0x4e2bed){if(_0x4e2bed[_0xb076('0x2c')]!=='VIRTUAL'){var _0x355992={};_0x355992[_0x4e2bed[_0xb076('0x26')]]={'$like':'%'+_0x31df93[_0xb076('0x2f')][_0xb076('0x3c')]+'%'};return _0x355992;}})});}_0x59a405=_[_0xb076('0x3b')]({},_0x59a405,_0x31df93[_0xb076('0x3d')]);var _0x303d3d={'where':_0x59a405['where']};return db['Campaign'][_0xb076('0x1d')](_0x303d3d)[_0xb076('0x1f')](function(_0x2aa268){_0x38ec41[_0xb076('0x1d')]=_0x2aa268;if(_0x31df93[_0xb076('0x2f')][_0xb076('0x3e')]){_0x59a405[_0xb076('0x3f')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x59a405);})['then'](function(_0x5b57eb){_0x38ec41[_0xb076('0x40')]=_0x5b57eb;return _0x38ec41;})[_0xb076('0x1f')](respondWithFilteredResult(_0x1536a7,_0x59a405))[_0xb076('0x41')](handleError(_0x1536a7,null));};exports[_0xb076('0x42')]=function(_0x2778f2,_0x549049){var _0x5dfc03={'raw':![],'where':{'id':_0x2778f2[_0xb076('0x43')]['id']}},_0x299879={};_0x299879[_0xb076('0x2e')]=_[_0xb076('0x30')](db[_0xb076('0x29')][_0xb076('0x2a')]);_0x299879[_0xb076('0x2f')]=_['keys'](_0x2778f2['query']);_0x299879[_0xb076('0x31')]=_[_0xb076('0x32')](_0x299879[_0xb076('0x2e')],_0x299879[_0xb076('0x2f')]);_0x5dfc03[_0xb076('0x33')]=_[_0xb076('0x32')](_0x299879[_0xb076('0x2e')],qs[_0xb076('0x34')](_0x2778f2['query'][_0xb076('0x34')]));_0x5dfc03['attributes']=_0x5dfc03['attributes'][_0xb076('0x35')]?_0x5dfc03[_0xb076('0x33')]:_0x299879['model'];if(_0x2778f2['query'][_0xb076('0x3e')]){_0x5dfc03[_0xb076('0x3f')]=[{'all':!![]}];}_0x5dfc03=_[_0xb076('0x3b')]({},_0x5dfc03,_0x2778f2[_0xb076('0x3d')]);return db[_0xb076('0x29')][_0xb076('0x44')](_0x5dfc03)[_0xb076('0x1f')](handleEntityNotFound(_0x549049,null))[_0xb076('0x1f')](respondWithResult(_0x549049,null))[_0xb076('0x41')](handleError(_0x549049,null));};exports['create']=function(_0x3c3ad5,_0x48fd6c){return db[_0xb076('0x29')][_0xb076('0x45')](_0x3c3ad5['body'],{})[_0xb076('0x1f')](function(_0x521cd8){var _0x1b5837=_0x3c3ad5[_0xb076('0x46')][_0xb076('0x21')]({'plain':!![]});if(!_0x1b5837)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b5837[_0xb076('0x47')]===_0xb076('0x46')){var _0x3be83b=_0x521cd8['get']({'plain':!![]});var _0x47ca22=_0xb076('0x22');return db[_0xb076('0x48')][_0xb076('0x44')]({'where':{'name':_0x47ca22,'userProfileId':_0x1b5837[_0xb076('0x49')]},'raw':!![]})['then'](function(_0x47bd26){if(_0x47bd26&&_0x47bd26[_0xb076('0x4a')]===0x0){return db[_0xb076('0x23')][_0xb076('0x45')]({'name':_0x3be83b['name'],'resourceId':_0x3be83b['id'],'type':_0x47bd26['name'],'sectionId':_0x47bd26['id']},{})[_0xb076('0x1f')](function(){return _0x521cd8;});}else{return _0x521cd8;}})[_0xb076('0x41')](function(_0x438801){logger[_0xb076('0x4b')](_0xb076('0x4c'),_0x438801);throw _0x438801;});}return _0x521cd8;})[_0xb076('0x1f')](respondWithResult(_0x48fd6c,0xc9))['catch'](handleError(_0x48fd6c,null));};exports['clone']=function(_0x4d20b3,_0x7dc727){var _0x1f50a2={'where':{'id':_0x4d20b3['params']['id']}},_0x3a425f={};_0x3a425f[_0xb076('0x2e')]=_[_0xb076('0x30')](db[_0xb076('0x29')][_0xb076('0x2a')]);_0x1f50a2['attributes']=_['intersection'](_0x3a425f['model'],qs[_0xb076('0x34')](_0x4d20b3[_0xb076('0x2f')][_0xb076('0x34')]));_0x1f50a2[_0xb076('0x33')]=_0x1f50a2[_0xb076('0x33')]['length']?_0x1f50a2['attributes']:_0x3a425f[_0xb076('0x2e')];if(_0x4d20b3[_0xb076('0x2f')][_0xb076('0x3e')]){_0x1f50a2['include']=[{'all':!![]}];}_0x1f50a2=_[_0xb076('0x3b')]({},_0x1f50a2,_0x4d20b3[_0xb076('0x3d')]);return db[_0xb076('0x29')][_0xb076('0x44')](_0x1f50a2)[_0xb076('0x1f')](handleEntityNotFound(_0x7dc727,null))[_0xb076('0x1f')](function(_0x3817e1){if(_0x3817e1){var _0x4c50a8=_0x3817e1[_0xb076('0x21')]({'plain':!![]});_0x4c50a8=qs[_0xb076('0x4d')](_0x4c50a8,['id',_0xb076('0x4e'),_0xb076('0x4f')]);_0x4d20b3[_0xb076('0x50')]=_[_0xb076('0x4d')](_0x4d20b3[_0xb076('0x50')],['id','createdAt','updatedAt']);return db['Campaign']['create'](_['merge'](_0x4c50a8,_0x4d20b3[_0xb076('0x50')]),{'include':_0x4d20b3['query'][_0xb076('0x3e')]?[{'all':!![]}]:undefined})[_0xb076('0x1f')](function(_0x5cfbba){var _0x4ba97c=_0x4d20b3[_0xb076('0x46')]['get']({'plain':!![]});if(!_0x4ba97c)throw new Error(_0xb076('0x51'));if(_0x4ba97c[_0xb076('0x47')]===_0xb076('0x46')){var _0x5b4c6f=_0x5cfbba[_0xb076('0x21')]({'plain':!![]});var _0x4f72ea=_0xb076('0x22');return db['UserProfileSection'][_0xb076('0x44')]({'where':{'name':_0x4f72ea,'userProfileId':_0x4ba97c[_0xb076('0x49')]},'raw':!![]})['then'](function(_0x35247d){if(_0x35247d&&_0x35247d[_0xb076('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b4c6f[_0xb076('0x26')],'resourceId':_0x5b4c6f['id'],'type':_0x35247d['name'],'sectionId':_0x35247d['id']},{})[_0xb076('0x1f')](function(){return _0x5cfbba;});}else{return _0x5cfbba;}})[_0xb076('0x41')](function(_0x5142c3){logger[_0xb076('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5142c3);throw _0x5142c3;});}return _0x5cfbba;});}})[_0xb076('0x1f')](respondWithResult(_0x7dc727,0xc9))[_0xb076('0x41')](handleError(_0x7dc727,null));};exports[_0xb076('0x52')]=function(_0x340791,_0xe679af){if(_0x340791[_0xb076('0x50')]['id']){delete _0x340791[_0xb076('0x50')]['id'];}return db[_0xb076('0x29')]['find']({'where':{'id':_0x340791[_0xb076('0x43')]['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0xe679af,null))['then'](saveUpdates(_0x340791[_0xb076('0x50')],null))[_0xb076('0x1f')](respondWithResult(_0xe679af,null))[_0xb076('0x41')](handleError(_0xe679af,null));};exports[_0xb076('0x20')]=function(_0x2b0758,_0x1a1286){return db[_0xb076('0x29')][_0xb076('0x44')]({'where':{'id':_0x2b0758[_0xb076('0x43')]['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0x1a1286,null))[_0xb076('0x1f')](removeEntity(_0x1a1286,null))[_0xb076('0x41')](handleError(_0x1a1286,null));};exports[_0xb076('0x53')]=function(_0x34c332,_0x2cefd7,_0x4bd040){var _0x2f9c63={'raw':!![],'where':{}};var _0x12170a={};var _0x2a2fc0={'count':0x0,'rows':[]};return db[_0xb076('0x29')][_0xb076('0x54')]({'where':{'id':_0x34c332[_0xb076('0x43')]['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0x2cefd7,null))[_0xb076('0x1f')](function(_0x4636b4){if(_0x4636b4){_0x12170a[_0xb076('0x2e')]=_['keys'](db[_0xb076('0x55')][_0xb076('0x2a')]);_0x12170a[_0xb076('0x2f')]=_[_0xb076('0x30')](_0x34c332[_0xb076('0x2f')]);_0x12170a[_0xb076('0x31')]=_['intersection'](_0x12170a[_0xb076('0x2e')],_0x12170a[_0xb076('0x2f')]);_0x2f9c63[_0xb076('0x33')]=_['intersection'](_0x12170a[_0xb076('0x2e')],qs[_0xb076('0x34')](_0x34c332[_0xb076('0x2f')][_0xb076('0x34')]));_0x2f9c63[_0xb076('0x33')]=_0x2f9c63[_0xb076('0x33')]['length']?_0x2f9c63[_0xb076('0x33')]:_0x12170a[_0xb076('0x2e')];if(!_0x34c332[_0xb076('0x2f')][_0xb076('0x56')](_0xb076('0x36'))){_0x2f9c63[_0xb076('0x1c')]=qs[_0xb076('0x1c')](_0x34c332['query'][_0xb076('0x1c')]);_0x2f9c63[_0xb076('0x1a')]=qs[_0xb076('0x1a')](_0x34c332['query']['offset']);}_0x2f9c63[_0xb076('0x37')]=qs[_0xb076('0x38')](_0x34c332[_0xb076('0x2f')]['sort']);_0x2f9c63['where']=qs[_0xb076('0x31')](_['pick'](_0x34c332[_0xb076('0x2f')],_0x12170a[_0xb076('0x31')]));_0x2f9c63[_0xb076('0x39')][_0xb076('0x57')]=_0x4636b4['id'];if(_0x34c332[_0xb076('0x2f')][_0xb076('0x3c')]){_0x2f9c63[_0xb076('0x39')]=_['merge'](_0x2f9c63[_0xb076('0x39')],{'$or':_[_0xb076('0x28')](_0x2f9c63[_0xb076('0x33')],function(_0x3cbd6a){var _0xa8fc12={};_0xa8fc12[_0x3cbd6a]={'$like':'%'+_0x34c332[_0xb076('0x2f')][_0xb076('0x3c')]+'%'};return _0xa8fc12;})});}_0x2f9c63=_[_0xb076('0x3b')]({},_0x2f9c63,_0x34c332[_0xb076('0x3d')]);return db[_0xb076('0x55')][_0xb076('0x1d')]({'where':_0x2f9c63['where']})['then'](function(_0x1af1fb){_0x2a2fc0[_0xb076('0x1d')]=_0x1af1fb;if(_0x34c332[_0xb076('0x2f')][_0xb076('0x3e')]){_0x2f9c63[_0xb076('0x3f')]=[{'all':!![]}];}return db[_0xb076('0x55')]['findAll'](_0x2f9c63);})[_0xb076('0x1f')](function(_0x38dfb2){_0x2a2fc0[_0xb076('0x40')]=_0x38dfb2;return _0x2a2fc0;});}})[_0xb076('0x1f')](respondWithFilteredResult(_0x2cefd7,_0x2f9c63))[_0xb076('0x41')](handleError(_0x2cefd7,null));};exports[_0xb076('0x58')]=function(_0x5e07cc,_0xff98bb,_0x376bbe){var _0x311f53={'raw':!![],'where':{}};var _0x5884ac={};var _0xf207dc={'count':0x0,'rows':[]};return db['Campaign'][_0xb076('0x54')]({'where':{'id':_0x5e07cc[_0xb076('0x43')]['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0xff98bb,null))[_0xb076('0x1f')](function(_0x27d259){if(_0x27d259){_0x5884ac[_0xb076('0x2e')]=_['keys'](db[_0xb076('0x59')][_0xb076('0x2a')]);_0x5884ac[_0xb076('0x2f')]=_['keys'](_0x5e07cc[_0xb076('0x2f')]);_0x5884ac[_0xb076('0x31')]=_[_0xb076('0x32')](_0x5884ac[_0xb076('0x2e')],_0x5884ac[_0xb076('0x2f')]);_0x311f53[_0xb076('0x33')]=_[_0xb076('0x32')](_0x5884ac['model'],qs[_0xb076('0x34')](_0x5e07cc[_0xb076('0x2f')][_0xb076('0x34')]));_0x311f53[_0xb076('0x33')]=_0x311f53[_0xb076('0x33')][_0xb076('0x35')]?_0x311f53[_0xb076('0x33')]:_0x5884ac[_0xb076('0x2e')];if(!_0x5e07cc[_0xb076('0x2f')][_0xb076('0x56')](_0xb076('0x36'))){_0x311f53[_0xb076('0x1c')]=qs[_0xb076('0x1c')](_0x5e07cc['query']['limit']);_0x311f53[_0xb076('0x1a')]=qs[_0xb076('0x1a')](_0x5e07cc[_0xb076('0x2f')]['offset']);}_0x311f53[_0xb076('0x37')]=qs[_0xb076('0x38')](_0x5e07cc[_0xb076('0x2f')][_0xb076('0x38')]);_0x311f53['where']=qs['filters'](_[_0xb076('0x3a')](_0x5e07cc[_0xb076('0x2f')],_0x5884ac[_0xb076('0x31')]));_0x311f53[_0xb076('0x39')][_0xb076('0x57')]=_0x27d259['id'];if(_0x5e07cc[_0xb076('0x2f')][_0xb076('0x3c')]){_0x311f53[_0xb076('0x39')]=_[_0xb076('0x3b')](_0x311f53[_0xb076('0x39')],{'$or':_[_0xb076('0x28')](_0x311f53[_0xb076('0x33')],function(_0x567151){var _0x50fb63={};_0x50fb63[_0x567151]={'$like':'%'+_0x5e07cc[_0xb076('0x2f')][_0xb076('0x3c')]+'%'};return _0x50fb63;})});}_0x311f53=_[_0xb076('0x3b')]({},_0x311f53,_0x5e07cc[_0xb076('0x3d')]);return db[_0xb076('0x59')][_0xb076('0x1d')]({'where':_0x311f53[_0xb076('0x39')]})[_0xb076('0x1f')](function(_0x3cb9ac){_0xf207dc[_0xb076('0x1d')]=_0x3cb9ac;if(_0x5e07cc[_0xb076('0x2f')][_0xb076('0x3e')]){_0x311f53['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xb076('0x5a')](_0x311f53);})[_0xb076('0x1f')](function(_0x4053be){_0xf207dc[_0xb076('0x40')]=_0x4053be;return _0xf207dc;});}})[_0xb076('0x1f')](respondWithFilteredResult(_0xff98bb,_0x311f53))[_0xb076('0x41')](handleError(_0xff98bb,null));};exports['getHopperFinals']=function(_0x3a12c3,_0x5d3e20,_0x8987b){var _0x15350e={'raw':!![],'where':{}};var _0x11a5cb={};var _0x44409b={'count':0x0,'rows':[]};return db['Campaign'][_0xb076('0x54')]({'where':{'id':_0x3a12c3[_0xb076('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d3e20,null))[_0xb076('0x1f')](function(_0x343c02){if(_0x343c02){_0x11a5cb['model']=_[_0xb076('0x30')](db[_0xb076('0x5b')][_0xb076('0x2a')]);_0x11a5cb[_0xb076('0x2f')]=_[_0xb076('0x30')](_0x3a12c3[_0xb076('0x2f')]);_0x11a5cb[_0xb076('0x31')]=_[_0xb076('0x32')](_0x11a5cb[_0xb076('0x2e')],_0x11a5cb['query']);_0x15350e['attributes']=_[_0xb076('0x32')](_0x11a5cb['model'],qs['fields'](_0x3a12c3[_0xb076('0x2f')][_0xb076('0x34')]));_0x15350e[_0xb076('0x33')]=_0x15350e['attributes'][_0xb076('0x35')]?_0x15350e[_0xb076('0x33')]:_0x11a5cb['model'];if(!_0x3a12c3[_0xb076('0x2f')][_0xb076('0x56')](_0xb076('0x36'))){_0x15350e[_0xb076('0x1c')]=qs[_0xb076('0x1c')](_0x3a12c3[_0xb076('0x2f')]['limit']);_0x15350e[_0xb076('0x1a')]=qs[_0xb076('0x1a')](_0x3a12c3[_0xb076('0x2f')]['offset']);}_0x15350e[_0xb076('0x37')]=qs[_0xb076('0x38')](_0x3a12c3['query'][_0xb076('0x38')]);_0x15350e[_0xb076('0x39')]=qs[_0xb076('0x31')](_['pick'](_0x3a12c3[_0xb076('0x2f')],_0x11a5cb['filters']));_0x15350e[_0xb076('0x39')]['CampaignId']=_0x343c02['id'];if(_0x3a12c3['query']['filter']){_0x15350e[_0xb076('0x39')]=_[_0xb076('0x3b')](_0x15350e[_0xb076('0x39')],{'$or':_[_0xb076('0x28')](_0x15350e['attributes'],function(_0x1417b7){var _0x2097a8={};_0x2097a8[_0x1417b7]={'$like':'%'+_0x3a12c3[_0xb076('0x2f')][_0xb076('0x3c')]+'%'};return _0x2097a8;})});}_0x15350e=_[_0xb076('0x3b')]({},_0x15350e,_0x3a12c3[_0xb076('0x3d')]);return db[_0xb076('0x5b')][_0xb076('0x1d')]({'where':_0x15350e[_0xb076('0x39')]})[_0xb076('0x1f')](function(_0x5bcbfd){_0x44409b[_0xb076('0x1d')]=_0x5bcbfd;if(_0x3a12c3[_0xb076('0x2f')][_0xb076('0x3e')]){_0x15350e[_0xb076('0x3f')]=[{'all':!![]}];}return db[_0xb076('0x5b')]['findAll'](_0x15350e);})['then'](function(_0x11e568){_0x44409b['rows']=_0x11e568;return _0x44409b;});}})[_0xb076('0x1f')](respondWithFilteredResult(_0x5d3e20,_0x15350e))[_0xb076('0x41')](handleError(_0x5d3e20,null));};exports['getHopperBlacks']=function(_0x6f60e8,_0x304e3f,_0x532096){var _0x486667={'raw':!![],'where':{}};var _0x44f292={};var _0x698e01={'count':0x0,'rows':[]};return db[_0xb076('0x29')][_0xb076('0x54')]({'where':{'id':_0x6f60e8['params']['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0x304e3f,null))[_0xb076('0x1f')](function(_0x3cf542){if(_0x3cf542){_0x44f292[_0xb076('0x2e')]=_['keys'](db['CmHopperBlack'][_0xb076('0x2a')]);_0x44f292['query']=_[_0xb076('0x30')](_0x6f60e8[_0xb076('0x2f')]);_0x44f292[_0xb076('0x31')]=_[_0xb076('0x32')](_0x44f292['model'],_0x44f292[_0xb076('0x2f')]);_0x486667[_0xb076('0x33')]=_['intersection'](_0x44f292[_0xb076('0x2e')],qs['fields'](_0x6f60e8['query'][_0xb076('0x34')]));_0x486667[_0xb076('0x33')]=_0x486667[_0xb076('0x33')]['length']?_0x486667[_0xb076('0x33')]:_0x44f292[_0xb076('0x2e')];if(!_0x6f60e8[_0xb076('0x2f')][_0xb076('0x56')](_0xb076('0x36'))){_0x486667['limit']=qs[_0xb076('0x1c')](_0x6f60e8[_0xb076('0x2f')][_0xb076('0x1c')]);_0x486667[_0xb076('0x1a')]=qs[_0xb076('0x1a')](_0x6f60e8[_0xb076('0x2f')][_0xb076('0x1a')]);}_0x486667[_0xb076('0x37')]=qs[_0xb076('0x38')](_0x6f60e8[_0xb076('0x2f')]['sort']);_0x486667['where']=qs[_0xb076('0x31')](_[_0xb076('0x3a')](_0x6f60e8['query'],_0x44f292[_0xb076('0x31')]));_0x486667[_0xb076('0x39')][_0xb076('0x57')]=_0x3cf542['id'];if(_0x6f60e8['query'][_0xb076('0x3c')]){_0x486667[_0xb076('0x39')]=_[_0xb076('0x3b')](_0x486667[_0xb076('0x39')],{'$or':_[_0xb076('0x28')](_0x486667[_0xb076('0x33')],function(_0x3ac2fe){var _0x37e843={};_0x37e843[_0x3ac2fe]={'$like':'%'+_0x6f60e8[_0xb076('0x2f')][_0xb076('0x3c')]+'%'};return _0x37e843;})});}_0x486667=_['merge']({},_0x486667,_0x6f60e8['options']);return db[_0xb076('0x5c')][_0xb076('0x1d')]({'where':_0x486667[_0xb076('0x39')]})[_0xb076('0x1f')](function(_0xdd3486){_0x698e01[_0xb076('0x1d')]=_0xdd3486;if(_0x6f60e8[_0xb076('0x2f')]['includeAll']){_0x486667['include']=[{'all':!![]}];}return db[_0xb076('0x5c')][_0xb076('0x5a')](_0x486667);})[_0xb076('0x1f')](function(_0x18473c){_0x698e01['rows']=_0x18473c;return _0x698e01;});}})[_0xb076('0x1f')](respondWithFilteredResult(_0x304e3f,_0x486667))[_0xb076('0x41')](handleError(_0x304e3f,null));};exports[_0xb076('0x5d')]=function(_0x253c2f,_0x2a681b,_0x14bdac){var _0x348302={};var _0x3efb31={};var _0x7573c0;var _0x5588a7;return db[_0xb076('0x29')][_0xb076('0x54')]({'where':{'id':_0x253c2f[_0xb076('0x43')]['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0x2a681b,null))[_0xb076('0x1f')](function(_0x4b4a5a){if(_0x4b4a5a){_0x7573c0=_0x4b4a5a;_0x3efb31[_0xb076('0x2e')]=_[_0xb076('0x30')](db[_0xb076('0x5e')][_0xb076('0x2a')]);_0x3efb31[_0xb076('0x2f')]=_[_0xb076('0x30')](_0x253c2f[_0xb076('0x2f')]);_0x3efb31['filters']=_[_0xb076('0x32')](_0x3efb31[_0xb076('0x2e')],_0x3efb31[_0xb076('0x2f')]);_0x348302[_0xb076('0x33')]=_[_0xb076('0x32')](_0x3efb31[_0xb076('0x2e')],qs[_0xb076('0x34')](_0x253c2f[_0xb076('0x2f')][_0xb076('0x34')]));_0x348302[_0xb076('0x33')]=_0x348302[_0xb076('0x33')][_0xb076('0x35')]?_0x348302[_0xb076('0x33')]:_0x3efb31[_0xb076('0x2e')];_0x348302['order']=qs[_0xb076('0x38')](_0x253c2f['query'][_0xb076('0x38')]);_0x348302[_0xb076('0x39')]=qs[_0xb076('0x31')](_[_0xb076('0x3a')](_0x253c2f[_0xb076('0x2f')],_0x3efb31['filters']));if(_0x253c2f[_0xb076('0x2f')][_0xb076('0x3c')]){_0x348302[_0xb076('0x39')]=_['merge'](_0x348302[_0xb076('0x39')],{'$or':_[_0xb076('0x28')](_0x348302[_0xb076('0x33')],function(_0x48e8a7){var _0x4da09d={};_0x4da09d[_0x48e8a7]={'$like':'%'+_0x253c2f['query'][_0xb076('0x3c')]+'%'};return _0x4da09d;})});}_0x348302=_[_0xb076('0x3b')]({},_0x348302,_0x253c2f[_0xb076('0x3d')]);return _0x7573c0[_0xb076('0x5d')](_0x348302);}})[_0xb076('0x1f')](function(_0xbde47c){if(_0xbde47c){_0x5588a7=_0xbde47c['length'];if(!_0x253c2f['query'][_0xb076('0x56')]('nolimit')){_0x348302[_0xb076('0x1c')]=qs[_0xb076('0x1c')](_0x253c2f['query'][_0xb076('0x1c')]);_0x348302[_0xb076('0x1a')]=qs['offset'](_0x253c2f['query'][_0xb076('0x1a')]);}return _0x7573c0[_0xb076('0x5d')](_0x348302);}})[_0xb076('0x1f')](function(_0x10d37a){if(_0x10d37a){return _0x10d37a?{'count':_0x5588a7,'rows':_0x10d37a}:null;}})[_0xb076('0x1f')](respondWithResult(_0x2a681b,null))['catch'](handleError(_0x2a681b,null));};exports[_0xb076('0x5f')]=function(_0x44a5ac,_0x206b51,_0x56e909){var _0x1f6d81,_0x121ded;return db[_0xb076('0x29')][_0xb076('0x44')]({'where':{'id':_0x44a5ac[_0xb076('0x43')]['id']}})['then'](handleEntityNotFound(_0x206b51,null))[_0xb076('0x1f')](function(_0x498caf){if(_0x498caf){_0x121ded=_0x498caf;return _0x498caf[_0xb076('0x5f')](_0x44a5ac['body'][_0xb076('0x60')],_[_0xb076('0x4d')](_0x44a5ac[_0xb076('0x50')],['ids','id'])||{});}return null;})['spread'](function(_0x450c13){var _0x2ad392;_0x1f6d81=_0x450c13||[];var _0x15285f=[];if(_0x450c13){for(var _0xdd96d4=0x0;_0xdd96d4<_0x450c13[_0xb076('0x35')];_0xdd96d4+=0x1){var _0x4bb992=_0x450c13[_0xdd96d4]['get']({'plain':!![]});_0x121ded[_0xb076('0x61')]=_0x44a5ac['body'][_0xb076('0x61')]?_0x44a5ac[_0xb076('0x50')][_0xb076('0x61')]:_0x121ded[_0xb076('0x61')];switch(_0x121ded[_0xb076('0x61')]){case _0xb076('0x62'):_0x2ad392=squel['insert']()[_0xb076('0x63')](_0xb076('0x64'))['fromQuery'](['phone',_0xb076('0x65'),'ContactId',_0xb076('0x66'),_0xb076('0x57'),_0xb076('0x4e'),'updatedAt'],squel['select']()[_0xb076('0x67')](_0xb076('0x68'),'phone')[_0xb076('0x67')]('NOW()',_0xb076('0x65'))[_0xb076('0x67')]('id',_0xb076('0x69'))[_0xb076('0x67')](_0x4bb992[_0xb076('0x6a')][_0xb076('0x6b')](),_0xb076('0x66'))[_0xb076('0x67')](_0x44a5ac[_0xb076('0x43')]['id'][_0xb076('0x6b')](),'CampaignId')[_0xb076('0x67')](_0xb076('0x6c'),_0xb076('0x4e'))['field']('NOW()',_0xb076('0x4f'))['from'](_0xb076('0x6d'))['where'](_0xb076('0x6e'))[_0xb076('0x39')]('ListId\x20=\x20?',_0x4bb992['CmListId'][_0xb076('0x6b')]())[_0xb076('0x39')](_0xb076('0x6f'))['where'](_0xb076('0x70'),squel[_0xb076('0x71')]()[_0xb076('0x67')](_0xb076('0x72'))[_0xb076('0x73')](_0xb076('0x74'))[_0xb076('0x39')](_0xb076('0x75'),_0x44a5ac[_0xb076('0x43')]['id'][_0xb076('0x6b')]()))[_0xb076('0x39')](_0xb076('0x70'),squel[_0xb076('0x71')]()['field'](_0xb076('0x76'))[_0xb076('0x73')](_0xb076('0x64'))['where']('CampaignId\x20=\x20?',_0x44a5ac[_0xb076('0x43')]['id'][_0xb076('0x6b')]())))['toString']();break;case _0xb076('0x77'):_0x2ad392=squel['insert']()['into'](_0xb076('0x64'))[_0xb076('0x78')]([_0xb076('0x68'),'scheduledAt','ContactId',_0xb076('0x66'),'CampaignId',_0xb076('0x4e'),_0xb076('0x4f')],squel['select']()['field']('phone','phone')[_0xb076('0x67')]('NOW()',_0xb076('0x65'))[_0xb076('0x67')]('id',_0xb076('0x69'))[_0xb076('0x67')](_0x4bb992[_0xb076('0x6a')][_0xb076('0x6b')](),_0xb076('0x66'))['field'](_0x44a5ac[_0xb076('0x43')]['id'][_0xb076('0x6b')](),_0xb076('0x57'))['field'](_0xb076('0x6c'),_0xb076('0x4e'))[_0xb076('0x67')](_0xb076('0x6c'),'updatedAt')[_0xb076('0x73')](_0xb076('0x6d'))['where'](_0xb076('0x6e'))['where'](_0xb076('0x79'),_0x4bb992['CmListId'][_0xb076('0x6b')]())[_0xb076('0x39')](_0xb076('0x6f'))[_0xb076('0x39')](_0xb076('0x70'),squel[_0xb076('0x71')]()[_0xb076('0x67')]('COALESCE(phone,\x27\x27)')[_0xb076('0x73')]('cm_hopper')[_0xb076('0x39')]('CampaignId\x20=\x20?',_0x44a5ac[_0xb076('0x43')]['id'][_0xb076('0x6b')]())))[_0xb076('0x6b')]();break;default:_0x2ad392=squel['insert']()[_0xb076('0x63')](_0xb076('0x64'))[_0xb076('0x78')](['phone',_0xb076('0x65'),_0xb076('0x69'),_0xb076('0x66'),_0xb076('0x57'),_0xb076('0x4e'),_0xb076('0x4f')],squel[_0xb076('0x71')]()[_0xb076('0x67')](_0xb076('0x68'),_0xb076('0x68'))[_0xb076('0x67')]('NOW()',_0xb076('0x65'))[_0xb076('0x67')]('id',_0xb076('0x69'))[_0xb076('0x67')](_0x4bb992['CmListId'][_0xb076('0x6b')](),'ListId')[_0xb076('0x67')](_0x44a5ac[_0xb076('0x43')]['id'][_0xb076('0x6b')](),_0xb076('0x57'))[_0xb076('0x67')](_0xb076('0x6c'),_0xb076('0x4e'))['field'](_0xb076('0x6c'),_0xb076('0x4f'))['from'](_0xb076('0x6d'))[_0xb076('0x39')]('deletedAt\x20IS\x20NULL')[_0xb076('0x39')](_0xb076('0x79'),_0x4bb992[_0xb076('0x6a')][_0xb076('0x6b')]())[_0xb076('0x39')](_0xb076('0x6f')))[_0xb076('0x6b')]();}_0x15285f[_0xb076('0x7a')](db[_0xb076('0x7b')]['query'](_0x2ad392));}return BPromise[_0xb076('0x7c')](_0x15285f);}})[_0xb076('0x1f')](function(){return _0x1f6d81;})['then'](respondWithResult(_0x206b51,null))['catch'](handleError(_0x206b51,null));};exports[_0xb076('0x7d')]=function(_0x439241,_0x4c4c19,_0x40c2e9){return db['Campaign']['find']({'where':{'id':_0x439241[_0xb076('0x43')]['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0x4c4c19,null))[_0xb076('0x1f')](function(_0x59f70b){if(_0x59f70b){return _0x59f70b[_0xb076('0x7d')](_0x439241[_0xb076('0x2f')][_0xb076('0x60')]);}})[_0xb076('0x1f')](function(_0x416015){if(_0x416015){return db[_0xb076('0x55')][_0xb076('0x20')]({'where':{'ListId':_0x439241[_0xb076('0x2f')][_0xb076('0x60')],'CampaignId':_0x439241[_0xb076('0x43')]['id']}})['then'](function(){return _0x416015;});}})['then'](respondWithStatusCode(_0x4c4c19,null))[_0xb076('0x41')](handleError(_0x4c4c19,null));};exports[_0xb076('0x7e')]=function(_0x2d85ee,_0x3dd2ba,_0x5c3c32){var _0x4be495={};var _0x47a126={};var _0x3a31cd;var _0x301da0;return db['Campaign'][_0xb076('0x54')]({'where':{'id':_0x2d85ee['params']['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0x3dd2ba,null))[_0xb076('0x1f')](function(_0x1fb4ad){if(_0x1fb4ad){_0x3a31cd=_0x1fb4ad;_0x47a126[_0xb076('0x2e')]=_[_0xb076('0x30')](db[_0xb076('0x5e')][_0xb076('0x2a')]);_0x47a126[_0xb076('0x2f')]=_[_0xb076('0x30')](_0x2d85ee[_0xb076('0x2f')]);_0x47a126[_0xb076('0x31')]=_[_0xb076('0x32')](_0x47a126['model'],_0x47a126[_0xb076('0x2f')]);_0x4be495[_0xb076('0x33')]=_['intersection'](_0x47a126['model'],qs[_0xb076('0x34')](_0x2d85ee[_0xb076('0x2f')][_0xb076('0x34')]));_0x4be495[_0xb076('0x33')]=_0x4be495['attributes'][_0xb076('0x35')]?_0x4be495[_0xb076('0x33')]:_0x47a126['model'];_0x4be495[_0xb076('0x37')]=qs[_0xb076('0x38')](_0x2d85ee[_0xb076('0x2f')][_0xb076('0x38')]);_0x4be495[_0xb076('0x39')]=qs[_0xb076('0x31')](_['pick'](_0x2d85ee[_0xb076('0x2f')],_0x47a126[_0xb076('0x31')]));if(_0x2d85ee[_0xb076('0x2f')][_0xb076('0x3c')]){_0x4be495[_0xb076('0x39')]=_[_0xb076('0x3b')](_0x4be495['where'],{'$or':_[_0xb076('0x28')](_0x4be495['attributes'],function(_0x33772a){var _0x5b74b9={};_0x5b74b9[_0x33772a]={'$like':'%'+_0x2d85ee[_0xb076('0x2f')][_0xb076('0x3c')]+'%'};return _0x5b74b9;})});}_0x4be495=_[_0xb076('0x3b')]({},_0x4be495,_0x2d85ee[_0xb076('0x3d')]);return _0x3a31cd[_0xb076('0x7e')](_0x4be495);}})['then'](function(_0x17a232){if(_0x17a232){_0x301da0=_0x17a232['length'];if(!_0x2d85ee['query'][_0xb076('0x56')](_0xb076('0x36'))){_0x4be495[_0xb076('0x1c')]=qs[_0xb076('0x1c')](_0x2d85ee['query'][_0xb076('0x1c')]);_0x4be495[_0xb076('0x1a')]=qs[_0xb076('0x1a')](_0x2d85ee['query']['offset']);}return _0x3a31cd[_0xb076('0x7e')](_0x4be495);}})[_0xb076('0x1f')](function(_0x35f1d7){if(_0x35f1d7){return _0x35f1d7?{'count':_0x301da0,'rows':_0x35f1d7}:null;}})[_0xb076('0x1f')](respondWithResult(_0x3dd2ba,null))[_0xb076('0x41')](handleError(_0x3dd2ba,null));};exports[_0xb076('0x7f')]=function(_0x440688,_0x50a782,_0x72ee17){var _0x427cac,_0x5c83a4;return db[_0xb076('0x29')][_0xb076('0x44')]({'where':{'id':_0x440688[_0xb076('0x43')]['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0x50a782,null))[_0xb076('0x1f')](function(_0x4242c6){if(_0x4242c6){_0x5c83a4=_0x4242c6;return _0x4242c6[_0xb076('0x7f')](_0x440688['body']['ids'],_['omit'](_0x440688[_0xb076('0x50')],[_0xb076('0x60'),'id'])||{});}return null;})[_0xb076('0x80')](function(_0x51254f){var _0x1cc1ac;_0x427cac=_0x51254f||[];var _0x54270a=[];if(_0x51254f){for(var _0x3ff1fc=0x0;_0x3ff1fc<_0x51254f[_0xb076('0x35')];_0x3ff1fc+=0x1){var _0x3f3fb1=_0x51254f[_0x3ff1fc]['get']({'plain':!![]});_0x1cc1ac=squel[_0xb076('0x81')]()[_0xb076('0x63')](_0xb076('0x82'))['fromQuery']([_0xb076('0x68'),_0xb076('0x69'),'ListId','CampaignId',_0xb076('0x4e'),_0xb076('0x4f')],squel[_0xb076('0x71')]()[_0xb076('0x67')](_0xb076('0x68'),_0xb076('0x68'))[_0xb076('0x67')]('id',_0xb076('0x69'))[_0xb076('0x67')](_0x3f3fb1[_0xb076('0x6a')]['toString'](),_0xb076('0x66'))[_0xb076('0x67')](_0x440688[_0xb076('0x43')]['id']['toString'](),_0xb076('0x57'))['field']('NOW()',_0xb076('0x4e'))[_0xb076('0x67')](_0xb076('0x6c'),'updatedAt')['from']('cm_contacts')[_0xb076('0x39')](_0xb076('0x6e'))[_0xb076('0x39')]('ListId\x20=\x20?',_0x3f3fb1[_0xb076('0x6a')][_0xb076('0x6b')]())[_0xb076('0x39')](_0xb076('0x6f')))[_0xb076('0x6b')]();_0x54270a['push'](db[_0xb076('0x7b')][_0xb076('0x2f')](_0x1cc1ac));}return BPromise['all'](_0x54270a);}})[_0xb076('0x1f')](function(){return _0x427cac;})['then'](respondWithResult(_0x50a782,null))[_0xb076('0x41')](handleError(_0x50a782,null));};exports[_0xb076('0x83')]=function(_0x4b4773,_0x5b81dd,_0x428dd3){return db[_0xb076('0x29')][_0xb076('0x44')]({'where':{'id':_0x4b4773['params']['id']}})[_0xb076('0x1f')](handleEntityNotFound(_0x5b81dd,null))[_0xb076('0x1f')](function(_0x571081){if(_0x571081){return _0x571081[_0xb076('0x83')](_0x4b4773[_0xb076('0x2f')][_0xb076('0x60')]);}})[_0xb076('0x1f')](function(_0x5ce11f){if(_0x5ce11f){return db[_0xb076('0x5c')][_0xb076('0x20')]({'where':{'ListId':_0x4b4773[_0xb076('0x2f')][_0xb076('0x60')],'CampaignId':_0x4b4773[_0xb076('0x43')]['id']}})[_0xb076('0x1f')](function(){return _0x5ce11f;});}})[_0xb076('0x1f')](respondWithStatusCode(_0x5b81dd,null))[_0xb076('0x41')](handleError(_0x5b81dd,null));};
\ No newline at end of file
index b62c496..f410bbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7ff1996..45338c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b1f=['GetCampaign','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','Campaign','findAll','options','raw','where','attributes','include','map','model'];(function(_0x5c179a,_0x57c99d){var _0x26861c=function(_0x2aa6ef){while(--_0x2aa6ef){_0x5c179a['push'](_0x5c179a['shift']());}};_0x26861c(++_0x57c99d);}(_0x4b1f,0x195));var _0xf4b1=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x4b1f[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var moment=require('moment');var BPromise=require(_0xf4b1('0x2'));var rs=require(_0xf4b1('0x3'));var fs=require('fs');var Redis=require(_0xf4b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4b1('0x5'));var logger=require(_0xf4b1('0x6'))(_0xf4b1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf4b1('0x8')][_0xf4b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x310db5,_0x3b9c78,_0x1abfc7){return new BPromise(function(_0x50738c,_0x59cf77){return client['request'](_0x310db5,_0x1abfc7)[_0xf4b1('0xa')](function(_0x53a786){logger[_0xf4b1('0xb')]('Campaign,\x20%s,\x20%s',_0x3b9c78,'request\x20sent');logger[_0xf4b1('0xc')](_0xf4b1('0xd'),_0x3b9c78,_0xf4b1('0xe'),JSON[_0xf4b1('0xf')](_0x53a786));if(_0x53a786[_0xf4b1('0x10')]){if(_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x11')]===0x1f4){logger[_0xf4b1('0x10')](_0xf4b1('0x12'),_0x3b9c78,_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x13')]);return _0x59cf77(_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x13')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x3b9c78,_0x53a786[_0xf4b1('0x10')]['message']);return _0x50738c(_0x53a786['error'][_0xf4b1('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x3b9c78,_0xf4b1('0xe'));_0x50738c(_0x53a786['result']['message']);}})['catch'](function(_0x5cb2a1){logger[_0xf4b1('0x10')](_0xf4b1('0x12'),_0x3b9c78,_0x5cb2a1);_0x59cf77(_0x5cb2a1);});});}exports['GetCampaign']=function(_0x3b378e){var _0x420f9e=this;return new Promise(function(_0x322b38,_0x465da2){return db[_0xf4b1('0x14')][_0xf4b1('0x15')]({'raw':_0x3b378e['options']?_0x3b378e[_0xf4b1('0x16')][_0xf4b1('0x17')]===undefined?!![]:![]:!![],'where':_0x3b378e['options']?_0x3b378e[_0xf4b1('0x16')][_0xf4b1('0x18')]||null:null,'attributes':_0x3b378e['options']?_0x3b378e[_0xf4b1('0x16')][_0xf4b1('0x19')]||null:null,'limit':_0x3b378e[_0xf4b1('0x16')]?_0x3b378e[_0xf4b1('0x16')]['limit']||null:null,'include':_0x3b378e[_0xf4b1('0x16')]?_0x3b378e[_0xf4b1('0x16')][_0xf4b1('0x1a')]?_[_0xf4b1('0x1b')](_0x3b378e['options'][_0xf4b1('0x1a')],function(_0x474212){return{'model':db[_0x474212['model']],'as':_0x474212['as'],'attributes':_0x474212[_0xf4b1('0x19')],'include':_0x474212['include']?_[_0xf4b1('0x1b')](_0x474212['include'],function(_0x238fbe){return{'model':db[_0x238fbe[_0xf4b1('0x1c')]],'as':_0x238fbe['as'],'attributes':_0x238fbe[_0xf4b1('0x19')],'include':_0x238fbe['include']?_[_0xf4b1('0x1b')](_0x238fbe['include'],function(_0x2e3b90){return{'model':db[_0x2e3b90['model']],'as':_0x2e3b90['as'],'attributes':_0x2e3b90[_0xf4b1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf4b1('0xa')](function(_0x5d28af){logger[_0xf4b1('0xb')](_0xf4b1('0x1d'),_0x3b378e);logger['debug'](_0xf4b1('0x1d'),_0x3b378e,JSON[_0xf4b1('0xf')](_0x5d28af));_0x322b38(_0x5d28af);})[_0xf4b1('0x1e')](function(_0x11ffb3){logger[_0xf4b1('0x10')](_0xf4b1('0x1d'),_0x11ffb3[_0xf4b1('0x13')],_0x3b378e);_0x465da2(_0x420f9e['error'](0x1f4,_0x11ffb3['message']));});});};
\ No newline at end of file
+var _0x6737=['stringify','error','code','message','info','result','GetCampaign','Campaign','options','raw','where','attributes','include','map','model','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x6737,0xe2));var _0x7673=function(_0x2190fb,_0x5f7d7f){_0x2190fb=_0x2190fb-0x0;var _0x194bb3=_0x6737[_0x2190fb];return _0x194bb3;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var moment=require(_0x7673('0x1'));var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require('../../config/logger')(_0x7673('0x6'));var config=require(_0x7673('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x8')][_0x7673('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af802,_0x4e4b24,_0x53d67d){return new BPromise(function(_0x5292f7,_0x285c6d){return client['request'](_0x5af802,_0x53d67d)[_0x7673('0xa')](function(_0x1fb769){logger['info'](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));logger[_0x7673('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4e4b24,'request\x20sent',JSON[_0x7673('0xe')](_0x1fb769));if(_0x1fb769['error']){if(_0x1fb769[_0x7673('0xf')][_0x7673('0x10')]===0x1f4){logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);return _0x285c6d(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769['error'][_0x7673('0x11')]);return _0x5292f7(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}else{logger[_0x7673('0x12')](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));_0x5292f7(_0x1fb769[_0x7673('0x13')]['message']);}})['catch'](function(_0x164d05){logger[_0x7673('0xf')]('Campaign,\x20%s,\x20%s',_0x4e4b24,_0x164d05);_0x285c6d(_0x164d05);});});}exports[_0x7673('0x14')]=function(_0x17699a){var _0x58a821=this;return new Promise(function(_0x33ff7d,_0x44704d){return db[_0x7673('0x15')]['findAll']({'raw':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x17')]===undefined?!![]:![]:!![],'where':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x18')]||null:null,'attributes':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x19')]||null:null,'limit':_0x17699a[_0x7673('0x16')]?_0x17699a['options']['limit']||null:null,'include':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x17699a[_0x7673('0x16')]['include'],function(_0x2009e1){return{'model':db[_0x2009e1[_0x7673('0x1c')]],'as':_0x2009e1['as'],'attributes':_0x2009e1[_0x7673('0x19')],'include':_0x2009e1[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x2009e1[_0x7673('0x1a')],function(_0x538280){return{'model':db[_0x538280[_0x7673('0x1c')]],'as':_0x538280['as'],'attributes':_0x538280[_0x7673('0x19')],'include':_0x538280[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x538280['include'],function(_0x5e2cd7){return{'model':db[_0x5e2cd7[_0x7673('0x1c')]],'as':_0x5e2cd7['as'],'attributes':_0x5e2cd7[_0x7673('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7673('0xa')](function(_0x9d9eab){logger[_0x7673('0x12')](_0x7673('0x14'),_0x17699a);logger[_0x7673('0xd')]('GetCampaign',_0x17699a,JSON['stringify'](_0x9d9eab));_0x33ff7d(_0x9d9eab);})[_0x7673('0x1d')](function(_0x2d4c0a){logger[_0x7673('0xf')](_0x7673('0x14'),_0x2d4c0a[_0x7673('0x11')],_0x17699a);_0x44704d(_0x58a821[_0x7673('0xf')](0x1f4,_0x2d4c0a[_0x7673('0x11')]));});});};
\ No newline at end of file
index 079f00c..a83f7e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x208d=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','clone','addLists','/:id/blacklists','addBlackLists','put','update','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','show','isAuthenticated','getHoppers','/:id/hopper_histories'];(function(_0x1a30a0,_0x3b092f){var _0x4f22fd=function(_0x2bb593){while(--_0x2bb593){_0x1a30a0['push'](_0x1a30a0['shift']());}};_0x4f22fd(++_0x3b092f);}(_0x208d,0xa4));var _0xd208=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x208d[_0x438fe1];return _0x3c8e1b;};'use strict';var multer=require(_0xd208('0x0'));var util=require(_0xd208('0x1'));var path=require(_0xd208('0x2'));var timeout=require(_0xd208('0x3'));var express=require('express');var router=express[_0xd208('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd208('0x5'));var interaction=require(_0xd208('0x6'));var config=require(_0xd208('0x7'));var controller=require(_0xd208('0x8'));router[_0xd208('0x9')]('/',auth['isAuthenticated'](),controller[_0xd208('0xa')]);router[_0xd208('0x9')](_0xd208('0xb'),auth['isAuthenticated'](),controller[_0xd208('0xc')]);router[_0xd208('0x9')]('/:id/hoppers',auth[_0xd208('0xd')](),controller[_0xd208('0xe')]);router['get'](_0xd208('0xf'),auth[_0xd208('0xd')](),controller[_0xd208('0x10')]);router[_0xd208('0x9')]('/:id/hopper_finals',auth[_0xd208('0xd')](),controller[_0xd208('0x11')]);router['get'](_0xd208('0x12'),auth[_0xd208('0xd')](),controller[_0xd208('0x13')]);router[_0xd208('0x9')](_0xd208('0x14'),auth[_0xd208('0xd')](),controller[_0xd208('0x15')]);router['get']('/:id/blacklists',auth[_0xd208('0xd')](),controller[_0xd208('0x16')]);router[_0xd208('0x17')]('/',auth[_0xd208('0xd')](),controller[_0xd208('0x18')]);router[_0xd208('0x17')]('/:id/clone',auth[_0xd208('0xd')](),controller[_0xd208('0x19')]);router['post'](_0xd208('0x14'),auth['isAuthenticated'](),controller[_0xd208('0x1a')]);router[_0xd208('0x17')](_0xd208('0x1b'),auth[_0xd208('0xd')](),controller[_0xd208('0x1c')]);router[_0xd208('0x1d')](_0xd208('0xb'),auth[_0xd208('0xd')](),controller[_0xd208('0x1e')]);router['delete'](_0xd208('0xb'),auth['isAuthenticated'](),controller[_0xd208('0x1f')]);router['delete'](_0xd208('0x14'),auth[_0xd208('0xd')](),controller[_0xd208('0x20')]);router[_0xd208('0x21')](_0xd208('0x1b'),auth['isAuthenticated'](),controller[_0xd208('0x22')]);module[_0xd208('0x23')]=router;
\ No newline at end of file
+var _0x867f=['addLists','put','update','delete','destroy','removeLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','/:id/lists'];(function(_0x133868,_0x5549e8){var _0x361a7a=function(_0x357d1c){while(--_0x357d1c){_0x133868['push'](_0x133868['shift']());}};_0x361a7a(++_0x5549e8);}(_0x867f,0xe6));var _0xf867=function(_0x54b749,_0x45913f){_0x54b749=_0x54b749-0x0;var _0x5a1b77=_0x867f[_0x54b749];return _0x5a1b77;};'use strict';var multer=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var path=require(_0xf867('0x2'));var timeout=require(_0xf867('0x3'));var express=require(_0xf867('0x4'));var router=express[_0xf867('0x5')]();var fs_extra=require(_0xf867('0x6'));var auth=require(_0xf867('0x7'));var interaction=require(_0xf867('0x8'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xf867('0x9')]('/',auth[_0xf867('0xa')](),controller[_0xf867('0xb')]);router[_0xf867('0x9')](_0xf867('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf867('0x9')]('/:id/hoppers',auth[_0xf867('0xa')](),controller[_0xf867('0xd')]);router[_0xf867('0x9')](_0xf867('0xe'),auth[_0xf867('0xa')](),controller[_0xf867('0xf')]);router[_0xf867('0x9')](_0xf867('0x10'),auth['isAuthenticated'](),controller[_0xf867('0x11')]);router['get']('/:id/hopper_black',auth[_0xf867('0xa')](),controller[_0xf867('0x12')]);router[_0xf867('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0xf867('0x13')]);router['get'](_0xf867('0x14'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xf867('0x15')]('/',auth[_0xf867('0xa')](),controller[_0xf867('0x16')]);router[_0xf867('0x15')](_0xf867('0x17'),auth[_0xf867('0xa')](),controller[_0xf867('0x18')]);router[_0xf867('0x15')](_0xf867('0x19'),auth['isAuthenticated'](),controller[_0xf867('0x1a')]);router['post'](_0xf867('0x14'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xf867('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xf867('0x1c')]);router[_0xf867('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xf867('0x1e')]);router[_0xf867('0x1d')](_0xf867('0x19'),auth[_0xf867('0xa')](),controller[_0xf867('0x1f')]);router[_0xf867('0x1d')](_0xf867('0x14'),auth[_0xf867('0xa')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
index 64213c6..6426565 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf9f=['TEXT','VIRTUAL','key','sequelize','STRING'];(function(_0x1bd5c1,_0x57d2c3){var _0x2af97d=function(_0x30cf3d){while(--_0x30cf3d){_0x1bd5c1['push'](_0x1bd5c1['shift']());}};_0x2af97d(++_0x57d2c3);}(_0xaf9f,0x11b));var _0xfaf9=function(_0x36d5d5,_0x1c1590){_0x36d5d5=_0x36d5d5-0x0;var _0x4eaa56=_0xaf9f[_0x36d5d5];return _0x4eaa56;};'use strict';var Sequelize=require(_0xfaf9('0x0'));module['exports']={'key':{'type':Sequelize[_0xfaf9('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xfaf9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfaf9('0x1')]},'name':{'type':Sequelize[_0xfaf9('0x3')],'get':function(){return this['getDataValue'](_0xfaf9('0x4'));}}};
\ No newline at end of file
+var _0x720c=['STRING','TEXT','getDataValue','key','sequelize','exports'];(function(_0x310609,_0x2d6c53){var _0x4a6364=function(_0x5ed388){while(--_0x5ed388){_0x310609['push'](_0x310609['shift']());}};_0x4a6364(++_0x2d6c53);}(_0x720c,0x10c));var _0xc720=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x720c[_0x4394b6];return _0x360244;};'use strict';var Sequelize=require(_0xc720('0x0'));module[_0xc720('0x1')]={'key':{'type':Sequelize[_0xc720('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xc720('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xc720('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc720('0x4')](_0xc720('0x5'));}}};
\ No newline at end of file
index 86f99a8..5a42b6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c15=['filter','merge','options','includeAll','include','findAll','rows','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x2c15,0x120));var _0x52c1=function(_0xd82565,_0x6b91a7){_0xd82565=_0xd82565-0x0;var _0x3e5e05=_0x2c15[_0xd82565];return _0x3e5e05;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x52c1('0x0'));var jsonpatch=require(_0x52c1('0x1'));var rp=require(_0x52c1('0x2'));var moment=require(_0x52c1('0x3'));var BPromise=require(_0x52c1('0x4'));var Mustache=require(_0x52c1('0x5'));var util=require(_0x52c1('0x6'));var path=require(_0x52c1('0x7'));var sox=require(_0x52c1('0x8'));var csv=require('to-csv');var ejs=require(_0x52c1('0x9'));var fs=require('fs');var fs_extra=require(_0x52c1('0xa'));var _=require('lodash');var squel=require(_0x52c1('0xb'));var crypto=require(_0x52c1('0xc'));var jsforce=require(_0x52c1('0xd'));var deskjs=require(_0x52c1('0xe'));var toCsv=require(_0x52c1('0xf'));var querystring=require(_0x52c1('0x10'));var Papa=require(_0x52c1('0x11'));var Redis=require(_0x52c1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52c1('0x13'));var logger=require(_0x52c1('0x14'))(_0x52c1('0x15'));var utils=require(_0x52c1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x52c1('0x17'));var db=require(_0x52c1('0x18'))['db'];function respondWithStatusCode(_0x2fa9da,_0x4d6cdc){_0x4d6cdc=_0x4d6cdc||0xcc;return function(_0x375357){if(_0x375357){return _0x2fa9da['sendStatus'](_0x4d6cdc);}return _0x2fa9da[_0x52c1('0x19')](_0x4d6cdc)[_0x52c1('0x1a')]();};}function respondWithResult(_0x10f71b,_0x5bc70e){_0x5bc70e=_0x5bc70e||0xc8;return function(_0x147940){if(_0x147940){return _0x10f71b[_0x52c1('0x19')](_0x5bc70e)[_0x52c1('0x1b')](_0x147940);}};}function respondWithFilteredResult(_0x69b413,_0x28622c){return function(_0x409650){if(_0x409650){var _0x20ffd2=typeof _0x28622c[_0x52c1('0x1c')]===_0x52c1('0x1d')&&typeof _0x28622c[_0x52c1('0x1e')]===_0x52c1('0x1d');var _0x18a8a3=_0x409650[_0x52c1('0x1f')];var _0x23f11e=_0x20ffd2?0x0:_0x28622c[_0x52c1('0x1c')];var _0x286efa=_0x20ffd2?_0x409650[_0x52c1('0x1f')]:_0x28622c[_0x52c1('0x1c')]+_0x28622c['limit'];var _0x3f44e1;if(_0x286efa>=_0x18a8a3){_0x286efa=_0x18a8a3;_0x3f44e1=0xc8;}else{_0x3f44e1=0xce;}_0x69b413[_0x52c1('0x19')](_0x3f44e1);return _0x69b413['set'](_0x52c1('0x20'),_0x23f11e+'-'+_0x286efa+'/'+_0x18a8a3)['json'](_0x409650);}return null;};}function patchUpdates(_0x506f1e){return function(_0x1671cf){try{jsonpatch[_0x52c1('0x21')](_0x1671cf,_0x506f1e,!![]);}catch(_0x44e337){return BPromise[_0x52c1('0x22')](_0x44e337);}return _0x1671cf[_0x52c1('0x23')]();};}function saveUpdates(_0x5ccef5,_0x204e60){return function(_0x464203){if(_0x464203){return _0x464203[_0x52c1('0x24')](_0x5ccef5)[_0x52c1('0x25')](function(_0x2e5322){return _0x2e5322;});}return null;};}function removeEntity(_0x3904ee,_0x576317){return function(_0x3ad14b){if(_0x3ad14b){return _0x3ad14b[_0x52c1('0x26')]()[_0x52c1('0x25')](function(){var _0x269666=_0x3ad14b[_0x52c1('0x27')]({'plain':!![]});var _0x181bcf=_0x52c1('0x28');return db[_0x52c1('0x29')][_0x52c1('0x26')]({'where':{'type':_0x181bcf,'resourceId':_0x269666['id']}})[_0x52c1('0x25')](function(){return _0x3ad14b;});})[_0x52c1('0x25')](function(){_0x3904ee[_0x52c1('0x19')](0xcc)[_0x52c1('0x1a')]();});}};}function handleEntityNotFound(_0x50ff11,_0x530934){return function(_0x377eac){if(!_0x377eac){_0x50ff11[_0x52c1('0x2a')](0x194);}return _0x377eac;};}function handleError(_0x326fac,_0x2d921f){_0x2d921f=_0x2d921f||0x1f4;return function(_0x5f5ada){logger[_0x52c1('0x2b')](_0x5f5ada[_0x52c1('0x2c')]);if(_0x5f5ada[_0x52c1('0x2d')]){delete _0x5f5ada[_0x52c1('0x2d')];}_0x326fac[_0x52c1('0x19')](_0x2d921f)[_0x52c1('0x2e')](_0x5f5ada);};}exports[_0x52c1('0x2f')]=function(_0x407009,_0x35e38d){var _0x2a2cfe={},_0x1550f0={},_0x583837={'count':0x0,'rows':[]};var _0x507471=_[_0x52c1('0x30')](db[_0x52c1('0x31')][_0x52c1('0x32')],function(_0x22bc43){return{'name':_0x22bc43['fieldName'],'type':_0x22bc43['type'][_0x52c1('0x33')]};});_0x1550f0[_0x52c1('0x34')]=_['map'](_0x507471,_0x52c1('0x2d'));_0x1550f0[_0x52c1('0x35')]=_[_0x52c1('0x36')](_0x407009[_0x52c1('0x35')]);_0x1550f0[_0x52c1('0x37')]=_[_0x52c1('0x38')](_0x1550f0['model'],_0x1550f0[_0x52c1('0x35')]);_0x2a2cfe[_0x52c1('0x39')]=_[_0x52c1('0x38')](_0x1550f0[_0x52c1('0x34')],qs[_0x52c1('0x3a')](_0x407009[_0x52c1('0x35')][_0x52c1('0x3a')]));_0x2a2cfe[_0x52c1('0x39')]=_0x2a2cfe[_0x52c1('0x39')][_0x52c1('0x3b')]?_0x2a2cfe['attributes']:_0x1550f0['model'];if(!_0x407009[_0x52c1('0x35')]['hasOwnProperty']('nolimit')){_0x2a2cfe[_0x52c1('0x1e')]=qs['limit'](_0x407009[_0x52c1('0x35')]['limit']);_0x2a2cfe[_0x52c1('0x1c')]=qs[_0x52c1('0x1c')](_0x407009['query']['offset']);}_0x2a2cfe[_0x52c1('0x3c')]=qs[_0x52c1('0x3d')](_0x407009[_0x52c1('0x35')][_0x52c1('0x3d')]);_0x2a2cfe[_0x52c1('0x3e')]=qs[_0x52c1('0x37')](_[_0x52c1('0x3f')](_0x407009[_0x52c1('0x35')],_0x1550f0['filters']),_0x507471);if(_0x407009[_0x52c1('0x35')][_0x52c1('0x40')]){_0x2a2cfe[_0x52c1('0x3e')]=_[_0x52c1('0x41')](_0x2a2cfe['where'],{'$or':[{'key':{'$like':'%'+_0x407009[_0x52c1('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x407009[_0x52c1('0x35')]['filter']+'%'}}]});}_0x2a2cfe=_[_0x52c1('0x41')]({},_0x2a2cfe,_0x407009[_0x52c1('0x42')]);var _0x322f81={'where':_0x2a2cfe[_0x52c1('0x3e')]};return db[_0x52c1('0x31')][_0x52c1('0x1f')](_0x322f81)['then'](function(_0x17e7a3){_0x583837[_0x52c1('0x1f')]=_0x17e7a3;if(_0x407009['query'][_0x52c1('0x43')]){_0x2a2cfe[_0x52c1('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x52c1('0x45')](_0x2a2cfe);})['then'](function(_0x3537de){_0x583837[_0x52c1('0x46')]=_0x3537de;return _0x583837;})[_0x52c1('0x25')](respondWithFilteredResult(_0x35e38d,_0x2a2cfe))[_0x52c1('0x47')](handleError(_0x35e38d,null));};exports['show']=function(_0x320379,_0x4a6eea){var _0x2e1934={'raw':!![],'where':{'id':_0x320379[_0x52c1('0x48')]['id']}},_0x4f7d5e={};_0x4f7d5e[_0x52c1('0x34')]=_['keys'](db[_0x52c1('0x31')][_0x52c1('0x32')]);_0x4f7d5e[_0x52c1('0x35')]=_[_0x52c1('0x36')](_0x320379[_0x52c1('0x35')]);_0x4f7d5e[_0x52c1('0x37')]=_['intersection'](_0x4f7d5e[_0x52c1('0x34')],_0x4f7d5e[_0x52c1('0x35')]);_0x2e1934[_0x52c1('0x39')]=_[_0x52c1('0x38')](_0x4f7d5e['model'],qs[_0x52c1('0x3a')](_0x320379[_0x52c1('0x35')][_0x52c1('0x3a')]));_0x2e1934['attributes']=_0x2e1934[_0x52c1('0x39')][_0x52c1('0x3b')]?_0x2e1934[_0x52c1('0x39')]:_0x4f7d5e['model'];if(_0x320379['query']['includeAll']){_0x2e1934[_0x52c1('0x44')]=[{'all':!![]}];}_0x2e1934=_[_0x52c1('0x41')]({},_0x2e1934,_0x320379[_0x52c1('0x42')]);return db[_0x52c1('0x31')][_0x52c1('0x49')](_0x2e1934)[_0x52c1('0x25')](handleEntityNotFound(_0x4a6eea,null))[_0x52c1('0x25')](respondWithResult(_0x4a6eea,null))[_0x52c1('0x47')](handleError(_0x4a6eea,null));};exports[_0x52c1('0x24')]=function(_0x266f9b,_0x3770da){if(_0x266f9b['body']['id']){delete _0x266f9b['body']['id'];}return db[_0x52c1('0x31')][_0x52c1('0x49')]({'where':{'id':_0x266f9b['params']['id']}})['then'](handleEntityNotFound(_0x3770da,null))['then'](saveUpdates(_0x266f9b[_0x52c1('0x4a')],null))[_0x52c1('0x25')](respondWithResult(_0x3770da,null))[_0x52c1('0x47')](handleError(_0x3770da,null));};exports['destroy']=function(_0x152068,_0x23dec3){return db[_0x52c1('0x31')][_0x52c1('0x49')]({'where':{'id':_0x152068['params']['id']}})[_0x52c1('0x25')](handleEntityNotFound(_0x23dec3,null))[_0x52c1('0x25')](removeEntity(_0x23dec3,null))[_0x52c1('0x47')](handleError(_0x23dec3,null));};exports[_0x52c1('0x4b')]=function(_0x383444,_0x437029){var _0x4ea4bc={'key':_0x383444[_0x52c1('0x4a')][_0x52c1('0x33')]};if(_0x383444[_0x52c1('0x4a')][_0x52c1('0x4c')]){_0x4ea4bc[_0x52c1('0x4c')]=_0x383444[_0x52c1('0x4a')][_0x52c1('0x4c')];}else if(_0x383444[_0x52c1('0x4a')][_0x52c1('0x4d')]){_0x4ea4bc[_0x52c1('0x4d')]=_0x383444['body'][_0x52c1('0x4d')];}else if(_0x383444[_0x52c1('0x4a')]['OpenchannelAccountId']){_0x4ea4bc[_0x52c1('0x4e')]=_0x383444[_0x52c1('0x4a')][_0x52c1('0x4e')];}else if(_0x383444[_0x52c1('0x4a')]['ChatWebsiteId']){_0x4ea4bc[_0x52c1('0x4f')]=_0x383444[_0x52c1('0x4a')][_0x52c1('0x4f')];}return db[_0x52c1('0x31')][_0x52c1('0x49')]({'where':_0x4ea4bc})[_0x52c1('0x25')](function(_0x485597){if(_0x485597){throw new db[(_0x52c1('0x50'))][(_0x52c1('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x52c1('0x31')][_0x52c1('0x4b')](_0x383444[_0x52c1('0x4a')]);})[_0x52c1('0x25')](function(_0x47fb5f){var _0x4c62b0=_0x383444['user'][_0x52c1('0x27')]({'plain':!![]});if(!_0x4c62b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c62b0[_0x52c1('0x52')]===_0x52c1('0x53')){var _0x3245d9=_0x47fb5f[_0x52c1('0x27')]({'plain':!![]});return db[_0x52c1('0x54')][_0x52c1('0x49')]({'where':{'name':_0x52c1('0x28'),'userProfileId':_0x4c62b0[_0x52c1('0x55')]},'raw':!![]})[_0x52c1('0x25')](function(_0x205b6d){if(_0x205b6d&&_0x205b6d[_0x52c1('0x56')]===0x0){return db['UserProfileResource'][_0x52c1('0x4b')]({'name':_0x3245d9[_0x52c1('0x2d')],'resourceId':_0x3245d9['id'],'type':_0x205b6d['name'],'sectionId':_0x205b6d['id']},{})[_0x52c1('0x25')](function(){return _0x47fb5f;});}else{return _0x47fb5f;}})[_0x52c1('0x47')](function(_0x3c1083){logger[_0x52c1('0x2b')](_0x52c1('0x57'),_0x3c1083);throw _0x3c1083;});}return _0x47fb5f;})[_0x52c1('0x25')](respondWithResult(_0x437029,0xc9))['catch'](handleError(_0x437029,null));};
\ No newline at end of file
+var _0x4d13=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','save','then','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','keys','intersection','attributes','query','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x38a18f,_0x4334e5){var _0xc0fbda=function(_0x38181e){while(--_0x38181e){_0x38a18f['push'](_0x38a18f['shift']());}};_0xc0fbda(++_0x4334e5);}(_0x4d13,0x1f1));var _0x34d1=function(_0x555859,_0x48b672){_0x555859=_0x555859-0x0;var _0x5cecfc=_0x4d13[_0x555859];return _0x5cecfc;};'use strict';var emlformat=require(_0x34d1('0x0'));var rimraf=require(_0x34d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x34d1('0x2'));var moment=require(_0x34d1('0x3'));var BPromise=require(_0x34d1('0x4'));var Mustache=require(_0x34d1('0x5'));var util=require(_0x34d1('0x6'));var path=require('path');var sox=require(_0x34d1('0x7'));var csv=require(_0x34d1('0x8'));var ejs=require(_0x34d1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x34d1('0xa'));var deskjs=require(_0x34d1('0xb'));var toCsv=require(_0x34d1('0x8'));var querystring=require(_0x34d1('0xc'));var Papa=require(_0x34d1('0xd'));var Redis=require(_0x34d1('0xe'));var authService=require(_0x34d1('0xf'));var qs=require(_0x34d1('0x10'));var as=require(_0x34d1('0x11'));var hardwareService=require(_0x34d1('0x12'));var logger=require(_0x34d1('0x13'))(_0x34d1('0x14'));var utils=require(_0x34d1('0x15'));var config=require(_0x34d1('0x16'));var licenseUtil=require(_0x34d1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8138b2,_0xf021e3){_0xf021e3=_0xf021e3||0xcc;return function(_0x7c7a9c){if(_0x7c7a9c){return _0x8138b2[_0x34d1('0x18')](_0xf021e3);}return _0x8138b2[_0x34d1('0x19')](_0xf021e3)[_0x34d1('0x1a')]();};}function respondWithResult(_0xa6567c,_0xff9619){_0xff9619=_0xff9619||0xc8;return function(_0x4cc289){if(_0x4cc289){return _0xa6567c['status'](_0xff9619)['json'](_0x4cc289);}};}function respondWithFilteredResult(_0x62715b,_0x1070ca){return function(_0x179786){if(_0x179786){var _0x587ddb=typeof _0x1070ca[_0x34d1('0x1b')]===_0x34d1('0x1c')&&typeof _0x1070ca['limit']===_0x34d1('0x1c');var _0x4192d3=_0x179786['count'];var _0x4f0dfd=_0x587ddb?0x0:_0x1070ca['offset'];var _0x5f1117=_0x587ddb?_0x179786[_0x34d1('0x1d')]:_0x1070ca['offset']+_0x1070ca[_0x34d1('0x1e')];var _0x232d51;if(_0x5f1117>=_0x4192d3){_0x5f1117=_0x4192d3;_0x232d51=0xc8;}else{_0x232d51=0xce;}_0x62715b[_0x34d1('0x19')](_0x232d51);return _0x62715b[_0x34d1('0x1f')]('Content-Range',_0x4f0dfd+'-'+_0x5f1117+'/'+_0x4192d3)['json'](_0x179786);}return null;};}function patchUpdates(_0x53244e){return function(_0x572409){try{jsonpatch['apply'](_0x572409,_0x53244e,!![]);}catch(_0x177cc0){return BPromise['reject'](_0x177cc0);}return _0x572409[_0x34d1('0x20')]();};}function saveUpdates(_0xc1f191,_0x5d7697){return function(_0x1dbfc7){if(_0x1dbfc7){return _0x1dbfc7['update'](_0xc1f191)[_0x34d1('0x21')](function(_0x2d0577){return _0x2d0577;});}return null;};}function removeEntity(_0x3f2607,_0x5c94a4){return function(_0x227b95){if(_0x227b95){return _0x227b95['destroy']()[_0x34d1('0x21')](function(){var _0x366321=_0x227b95['get']({'plain':!![]});var _0x1da724=_0x34d1('0x22');return db[_0x34d1('0x23')][_0x34d1('0x24')]({'where':{'type':_0x1da724,'resourceId':_0x366321['id']}})[_0x34d1('0x21')](function(){return _0x227b95;});})[_0x34d1('0x21')](function(){_0x3f2607['status'](0xcc)[_0x34d1('0x1a')]();});}};}function handleEntityNotFound(_0x177954,_0x3bf5c3){return function(_0x2c4299){if(!_0x2c4299){_0x177954[_0x34d1('0x18')](0x194);}return _0x2c4299;};}function handleError(_0x5be17d,_0x50441e){_0x50441e=_0x50441e||0x1f4;return function(_0x726efc){logger[_0x34d1('0x25')](_0x726efc[_0x34d1('0x26')]);if(_0x726efc['name']){delete _0x726efc[_0x34d1('0x27')];}_0x5be17d['status'](_0x50441e)[_0x34d1('0x28')](_0x726efc);};}exports[_0x34d1('0x29')]=function(_0x34c8a6,_0x4fa53d){var _0x38da02={},_0x319775={},_0x44347a={'count':0x0,'rows':[]};var _0x5dd13b=_['map'](db[_0x34d1('0x2a')][_0x34d1('0x2b')],function(_0x1bfee4){return{'name':_0x1bfee4[_0x34d1('0x2c')],'type':_0x1bfee4[_0x34d1('0x2d')][_0x34d1('0x2e')]};});_0x319775[_0x34d1('0x2f')]=_[_0x34d1('0x30')](_0x5dd13b,_0x34d1('0x27'));_0x319775['query']=_[_0x34d1('0x31')](_0x34c8a6['query']);_0x319775['filters']=_[_0x34d1('0x32')](_0x319775['model'],_0x319775['query']);_0x38da02[_0x34d1('0x33')]=_[_0x34d1('0x32')](_0x319775[_0x34d1('0x2f')],qs['fields'](_0x34c8a6[_0x34d1('0x34')][_0x34d1('0x35')]));_0x38da02[_0x34d1('0x33')]=_0x38da02[_0x34d1('0x33')][_0x34d1('0x36')]?_0x38da02[_0x34d1('0x33')]:_0x319775['model'];if(!_0x34c8a6[_0x34d1('0x34')][_0x34d1('0x37')]('nolimit')){_0x38da02[_0x34d1('0x1e')]=qs[_0x34d1('0x1e')](_0x34c8a6['query'][_0x34d1('0x1e')]);_0x38da02['offset']=qs[_0x34d1('0x1b')](_0x34c8a6[_0x34d1('0x34')][_0x34d1('0x1b')]);}_0x38da02[_0x34d1('0x38')]=qs['sort'](_0x34c8a6[_0x34d1('0x34')][_0x34d1('0x39')]);_0x38da02[_0x34d1('0x3a')]=qs[_0x34d1('0x3b')](_['pick'](_0x34c8a6[_0x34d1('0x34')],_0x319775[_0x34d1('0x3b')]),_0x5dd13b);if(_0x34c8a6['query'][_0x34d1('0x3c')]){_0x38da02[_0x34d1('0x3a')]=_['merge'](_0x38da02['where'],{'$or':[{'key':{'$like':'%'+_0x34c8a6[_0x34d1('0x34')][_0x34d1('0x3c')]+'%'}},{'value':{'$like':'%'+_0x34c8a6['query'][_0x34d1('0x3c')]+'%'}}]});}_0x38da02=_[_0x34d1('0x3d')]({},_0x38da02,_0x34c8a6[_0x34d1('0x3e')]);var _0x1bc02c={'where':_0x38da02[_0x34d1('0x3a')]};return db[_0x34d1('0x2a')][_0x34d1('0x1d')](_0x1bc02c)[_0x34d1('0x21')](function(_0x33ebaf){_0x44347a[_0x34d1('0x1d')]=_0x33ebaf;if(_0x34c8a6[_0x34d1('0x34')][_0x34d1('0x3f')]){_0x38da02[_0x34d1('0x40')]=[{'all':!![]}];}return db[_0x34d1('0x2a')][_0x34d1('0x41')](_0x38da02);})[_0x34d1('0x21')](function(_0x2cc133){_0x44347a[_0x34d1('0x42')]=_0x2cc133;return _0x44347a;})[_0x34d1('0x21')](respondWithFilteredResult(_0x4fa53d,_0x38da02))[_0x34d1('0x43')](handleError(_0x4fa53d,null));};exports[_0x34d1('0x44')]=function(_0x17510b,_0x11b79f){var _0x2231f0={'raw':!![],'where':{'id':_0x17510b[_0x34d1('0x45')]['id']}},_0x1d3784={};_0x1d3784[_0x34d1('0x2f')]=_[_0x34d1('0x31')](db[_0x34d1('0x2a')][_0x34d1('0x2b')]);_0x1d3784['query']=_[_0x34d1('0x31')](_0x17510b['query']);_0x1d3784[_0x34d1('0x3b')]=_['intersection'](_0x1d3784['model'],_0x1d3784['query']);_0x2231f0['attributes']=_[_0x34d1('0x32')](_0x1d3784[_0x34d1('0x2f')],qs['fields'](_0x17510b[_0x34d1('0x34')]['fields']));_0x2231f0[_0x34d1('0x33')]=_0x2231f0[_0x34d1('0x33')][_0x34d1('0x36')]?_0x2231f0[_0x34d1('0x33')]:_0x1d3784[_0x34d1('0x2f')];if(_0x17510b['query'][_0x34d1('0x3f')]){_0x2231f0[_0x34d1('0x40')]=[{'all':!![]}];}_0x2231f0=_[_0x34d1('0x3d')]({},_0x2231f0,_0x17510b[_0x34d1('0x3e')]);return db['CannedAnswer'][_0x34d1('0x46')](_0x2231f0)['then'](handleEntityNotFound(_0x11b79f,null))[_0x34d1('0x21')](respondWithResult(_0x11b79f,null))[_0x34d1('0x43')](handleError(_0x11b79f,null));};exports[_0x34d1('0x47')]=function(_0x2f1663,_0xc1fa17){if(_0x2f1663[_0x34d1('0x48')]['id']){delete _0x2f1663[_0x34d1('0x48')]['id'];}return db[_0x34d1('0x2a')][_0x34d1('0x46')]({'where':{'id':_0x2f1663['params']['id']}})[_0x34d1('0x21')](handleEntityNotFound(_0xc1fa17,null))[_0x34d1('0x21')](saveUpdates(_0x2f1663[_0x34d1('0x48')],null))[_0x34d1('0x21')](respondWithResult(_0xc1fa17,null))[_0x34d1('0x43')](handleError(_0xc1fa17,null));};exports[_0x34d1('0x24')]=function(_0x103464,_0x3fd7f8){return db[_0x34d1('0x2a')][_0x34d1('0x46')]({'where':{'id':_0x103464['params']['id']}})['then'](handleEntityNotFound(_0x3fd7f8,null))[_0x34d1('0x21')](removeEntity(_0x3fd7f8,null))[_0x34d1('0x43')](handleError(_0x3fd7f8,null));};exports[_0x34d1('0x49')]=function(_0x2776db,_0x2edfbe){var _0x4e287f={'key':_0x2776db[_0x34d1('0x48')][_0x34d1('0x2e')]};if(_0x2776db['body'][_0x34d1('0x4a')]){_0x4e287f[_0x34d1('0x4a')]=_0x2776db['body']['MailAccountId'];}else if(_0x2776db[_0x34d1('0x48')][_0x34d1('0x4b')]){_0x4e287f[_0x34d1('0x4b')]=_0x2776db[_0x34d1('0x48')][_0x34d1('0x4b')];}else if(_0x2776db['body']['OpenchannelAccountId']){_0x4e287f[_0x34d1('0x4c')]=_0x2776db['body']['OpenchannelAccountId'];}else if(_0x2776db[_0x34d1('0x48')][_0x34d1('0x4d')]){_0x4e287f[_0x34d1('0x4d')]=_0x2776db[_0x34d1('0x48')][_0x34d1('0x4d')];}return db[_0x34d1('0x2a')]['find']({'where':_0x4e287f})[_0x34d1('0x21')](function(_0x4cd349){if(_0x4cd349){throw new db[(_0x34d1('0x4e'))][(_0x34d1('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x34d1('0x2a')][_0x34d1('0x49')](_0x2776db[_0x34d1('0x48')]);})[_0x34d1('0x21')](function(_0x5e6844){var _0x1a9e15=_0x2776db[_0x34d1('0x50')]['get']({'plain':!![]});if(!_0x1a9e15)throw new Error(_0x34d1('0x51'));if(_0x1a9e15[_0x34d1('0x52')]==='user'){var _0xe79690=_0x5e6844[_0x34d1('0x53')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x34d1('0x22'),'userProfileId':_0x1a9e15[_0x34d1('0x54')]},'raw':!![]})[_0x34d1('0x21')](function(_0x5c36ac){if(_0x5c36ac&&_0x5c36ac['autoAssociation']===0x0){return db[_0x34d1('0x23')][_0x34d1('0x49')]({'name':_0xe79690[_0x34d1('0x27')],'resourceId':_0xe79690['id'],'type':_0x5c36ac[_0x34d1('0x27')],'sectionId':_0x5c36ac['id']},{})[_0x34d1('0x21')](function(){return _0x5e6844;});}else{return _0x5e6844;}})[_0x34d1('0x43')](function(_0x23dd6f){logger['error'](_0x34d1('0x55'),_0x23dd6f);throw _0x23dd6f;});}return _0x5e6844;})[_0x34d1('0x21')](respondWithResult(_0x2edfbe,0xc9))[_0x34d1('0x43')](handleError(_0x2edfbe,null));};
\ No newline at end of file
index 06874a7..f368607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6abd=['api','moment','bluebird','request-promise','path','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x46b090,_0x10c40a){var _0x12abc8=function(_0x178f99){while(--_0x178f99){_0x46b090['push'](_0x46b090['shift']());}};_0x12abc8(++_0x10c40a);}(_0x6abd,0x106));var _0xd6ab=function(_0x42114d,_0x330794){_0x42114d=_0x42114d-0x0;var _0x3a5916=_0x6abd[_0x42114d];return _0x3a5916;};'use strict';var _=require('lodash');var util=require(_0xd6ab('0x0'));var logger=require(_0xd6ab('0x1'))(_0xd6ab('0x2'));var moment=require(_0xd6ab('0x3'));var BPromise=require(_0xd6ab('0x4'));var rp=require(_0xd6ab('0x5'));var fs=require('fs');var path=require(_0xd6ab('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd6ab('0x7'));module[_0xd6ab('0x8')]=function(_0x479d30,_0x3565f1){return _0x479d30[_0xd6ab('0x9')](_0xd6ab('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd6ab('0xb')});};
\ No newline at end of file
+var _0xedcb=['./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xeff1d0,_0x50c531){var _0x51cbb6=function(_0x5eb9e8){while(--_0x5eb9e8){_0xeff1d0['push'](_0xeff1d0['shift']());}};_0x51cbb6(++_0x50c531);}(_0xedcb,0x1aa));var _0xbedc=function(_0x3949ed,_0x37a1fb){_0x3949ed=_0x3949ed-0x0;var _0x5b960c=_0xedcb[_0x3949ed];return _0x5b960c;};'use strict';var _=require(_0xbedc('0x0'));var util=require(_0xbedc('0x1'));var logger=require(_0xbedc('0x2'))(_0xbedc('0x3'));var moment=require(_0xbedc('0x4'));var BPromise=require(_0xbedc('0x5'));var rp=require(_0xbedc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbedc('0x7'));var config=require(_0xbedc('0x8'));var attributes=require(_0xbedc('0x9'));module['exports']=function(_0x571eae,_0xd59898){return _0x571eae[_0xbedc('0xa')](_0xbedc('0xb'),attributes,{'tableName':_0xbedc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbedc('0xd'),'collate':_0xbedc('0xe')});};
\ No newline at end of file
index 603c919..4fd1f6f 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(_0x4854f0,_0x4ca76c){var _0x36e29e=function(_0x2e0e0a){while(--_0x2e0e0a){_0x4854f0['push'](_0x4854f0['shift']());}};_0x36e29e(++_0x4ca76c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x4b2abf,_0x4aaf0f){var _0x390d02=function(_0xb2077e){while(--_0xb2077e){_0x4b2abf['push'](_0x4b2abf['shift']());}};_0x390d02(++_0x4aaf0f);}(_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);});});}
\ No newline at end of file
index a9169b7..5aa8364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x961a=['../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x265e33,_0x3d5f7b){var _0x4ce44e=function(_0x18f7ca){while(--_0x18f7ca){_0x265e33['push'](_0x265e33['shift']());}};_0x4ce44e(++_0x3d5f7b);}(_0x961a,0x14e));var _0xa961=function(_0x4eeaa0,_0x2917a0){_0x4eeaa0=_0x4eeaa0-0x0;var _0x11d62e=_0x961a[_0x4eeaa0];return _0x11d62e;};'use strict';var multer=require('multer');var util=require(_0xa961('0x0'));var path=require(_0xa961('0x1'));var timeout=require(_0xa961('0x2'));var express=require(_0xa961('0x3'));var router=express[_0xa961('0x4')]();var fs_extra=require(_0xa961('0x5'));var auth=require(_0xa961('0x6'));var interaction=require(_0xa961('0x7'));var config=require(_0xa961('0x8'));var controller=require(_0xa961('0x9'));router['get']('/',auth[_0xa961('0xa')](),controller[_0xa961('0xb')]);router[_0xa961('0xc')](_0xa961('0xd'),auth[_0xa961('0xa')](),controller[_0xa961('0xe')]);router['post']('/',auth[_0xa961('0xa')](),controller[_0xa961('0xf')]);router['put'](_0xa961('0xd'),auth[_0xa961('0xa')](),controller[_0xa961('0x10')]);router['delete'](_0xa961('0xd'),auth['isAuthenticated'](),controller[_0xa961('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xb5c1=['./cannedAnswer.controller','isAuthenticated','index','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5c1,0x172));var _0x1b5c=function(_0x1b96e2,_0x4733f6){_0x1b96e2=_0x1b96e2-0x0;var _0x300e48=_0xb5c1[_0x1b96e2];return _0x300e48;};'use strict';var multer=require(_0x1b5c('0x0'));var util=require(_0x1b5c('0x1'));var path=require(_0x1b5c('0x2'));var timeout=require(_0x1b5c('0x3'));var express=require(_0x1b5c('0x4'));var router=express[_0x1b5c('0x5')]();var fs_extra=require(_0x1b5c('0x6'));var auth=require(_0x1b5c('0x7'));var interaction=require(_0x1b5c('0x8'));var config=require(_0x1b5c('0x9'));var controller=require(_0x1b5c('0xa'));router['get']('/',auth[_0x1b5c('0xb')](),controller[_0x1b5c('0xc')]);router['get'](_0x1b5c('0xd'),auth['isAuthenticated'](),controller[_0x1b5c('0xe')]);router[_0x1b5c('0xf')]('/',auth[_0x1b5c('0xb')](),controller['create']);router[_0x1b5c('0x10')](_0x1b5c('0xd'),auth[_0x1b5c('0xb')](),controller[_0x1b5c('0x11')]);router['delete']('/:id',auth[_0x1b5c('0xb')](),controller['destroy']);module[_0x1b5c('0x12')]=router;
\ No newline at end of file
index c8d2c82..af1bd7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f0d=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x360622,_0x56bea5){var _0x4dbcb1=function(_0x3a8237){while(--_0x3a8237){_0x360622['push'](_0x360622['shift']());}};_0x4dbcb1(++_0x56bea5);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xae1292,_0x51ef78){_0xae1292=_0xae1292-0x0;var _0x51d997=_0x6f0d[_0xae1292];return _0x51d997;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'calldate':{'type':Sequelize[_0xd6f0('0x1')],'allowNull':![],'defaultValue':_0xd6f0('0x2')},'clid':{'type':Sequelize[_0xd6f0('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xd6f0('0x3')]},'dcontext':{'type':Sequelize[_0xd6f0('0x3')]},'channel':{'type':Sequelize[_0xd6f0('0x3')]},'dstchannel':{'type':Sequelize[_0xd6f0('0x3')]},'lastapp':{'type':Sequelize[_0xd6f0('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xd6f0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd6f0('0x3')]},'amaflags':{'type':Sequelize[_0xd6f0('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd6f0('0x3')]},'userfield':{'type':Sequelize[_0xd6f0('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xd6f0('0x3')]},'peeraccount':{'type':Sequelize[_0xd6f0('0x3')]},'type':{'type':Sequelize[_0xd6f0('0x3')]},'tag':{'type':Sequelize[_0xd6f0('0x3')]}};
\ No newline at end of file
+var _0x0fec=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x89973e,_0x16f568){var _0x54b99f=function(_0x4f0b95){while(--_0x4f0b95){_0x89973e['push'](_0x89973e['shift']());}};_0x54b99f(++_0x16f568);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x1d866b,_0x45a372){_0x1d866b=_0x1d866b-0x0;var _0xe0acfc=_0x0fec[_0x1d866b];return _0xe0acfc;};'use strict';var Sequelize=require(_0xc0fe('0x0'));module[_0xc0fe('0x1')]={'calldate':{'type':Sequelize[_0xc0fe('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xc0fe('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xc0fe('0x3')]},'channel':{'type':Sequelize[_0xc0fe('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xc0fe('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xc0fe('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc0fe('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xc0fe('0x3')]},'uniqueid':{'type':Sequelize[_0xc0fe('0x3')]},'linkedid':{'type':Sequelize[_0xc0fe('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xc0fe('0x3')]}};
\ No newline at end of file
index 211ee56..e35b9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eea=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','intersection','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x260379,_0x169e9b){_0x260379=_0x260379-0x0;var _0x1d26ac=_0x3eea[_0x260379];return _0x1d26ac;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x2a')](_0x3fa094,'name');_0x78e581[_0xa3ee('0x31')]=_['keys'](_0x59c6f9[_0xa3ee('0x31')]);_0x78e581[_0xa3ee('0x32')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x33')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x34')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x34')]));_0x4abf49[_0xa3ee('0x33')]=_0x4abf49['attributes'][_0xa3ee('0x35')]?_0x4abf49[_0xa3ee('0x33')]:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x36')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x31')]['limit']);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x37')]=qs[_0xa3ee('0x38')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x38')]);_0x4abf49[_0xa3ee('0x39')]=qs[_0xa3ee('0x32')](_[_0xa3ee('0x3a')](_0x59c6f9[_0xa3ee('0x31')],_0x78e581[_0xa3ee('0x32')]),_0x3fa094);if(_0x59c6f9['query'][_0xa3ee('0x3b')]){_0x4abf49[_0xa3ee('0x39')]=_[_0xa3ee('0x3c')](_0x4abf49[_0xa3ee('0x39')],{'$or':_['map'](_0x3fa094,function(_0x257627){if(_0x257627[_0xa3ee('0x2e')]!==_0xa3ee('0x3d')){var _0x5b95e3={};_0x5b95e3[_0x257627[_0xa3ee('0x27')]]={'$like':'%'+_0x59c6f9[_0xa3ee('0x31')]['filter']+'%'};return _0x5b95e3;}})});}_0x4abf49=_[_0xa3ee('0x3c')]({},_0x4abf49,_0x59c6f9[_0xa3ee('0x3e')]);var _0x4ef99a={'where':_0x4abf49[_0xa3ee('0x39')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x4ef99a)[_0xa3ee('0x23')](function(_0x1f0023){_0x481358[_0xa3ee('0x1c')]=_0x1f0023;if(_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x3f')]){_0x4abf49[_0xa3ee('0x40')]=[{'all':!![]}];}return db[_0xa3ee('0x2b')][_0xa3ee('0x41')](_0x4abf49);})['then'](function(_0x5aa4b3){_0x481358['rows']=_0x5aa4b3;return _0x481358;})[_0xa3ee('0x23')](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x42')](handleError(_0x5ba571,null));};exports['show']=function(_0xca106f,_0x425f69){var _0x279834={'raw':!![],'where':{'id':_0xca106f[_0xa3ee('0x43')]['id']}},_0x55f47f={};_0x55f47f['model']=_[_0xa3ee('0x44')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x55f47f[_0xa3ee('0x31')]=_[_0xa3ee('0x44')](_0xca106f[_0xa3ee('0x31')]);_0x55f47f[_0xa3ee('0x32')]=_[_0xa3ee('0x45')](_0x55f47f[_0xa3ee('0x30')],_0x55f47f[_0xa3ee('0x31')]);_0x279834[_0xa3ee('0x33')]=_[_0xa3ee('0x45')](_0x55f47f[_0xa3ee('0x30')],qs[_0xa3ee('0x34')](_0xca106f[_0xa3ee('0x31')][_0xa3ee('0x34')]));_0x279834[_0xa3ee('0x33')]=_0x279834[_0xa3ee('0x33')]['length']?_0x279834[_0xa3ee('0x33')]:_0x55f47f[_0xa3ee('0x30')];if(_0xca106f[_0xa3ee('0x31')][_0xa3ee('0x3f')]){_0x279834['include']=[{'all':!![]}];}_0x279834=_[_0xa3ee('0x3c')]({},_0x279834,_0xca106f['options']);return db[_0xa3ee('0x2b')][_0xa3ee('0x46')](_0x279834)[_0xa3ee('0x23')](handleEntityNotFound(_0x425f69,null))[_0xa3ee('0x23')](respondWithResult(_0x425f69,null))[_0xa3ee('0x42')](handleError(_0x425f69,null));};exports[_0xa3ee('0x47')]=function(_0xd723ad,_0xbb0148){return db[_0xa3ee('0x2b')][_0xa3ee('0x47')](_0xd723ad['body'],{})[_0xa3ee('0x23')](respondWithResult(_0xbb0148,0xc9))['catch'](handleError(_0xbb0148,null));};exports['update']=function(_0xaad29c,_0x2f7171){if(_0xaad29c[_0xa3ee('0x48')]['id']){delete _0xaad29c[_0xa3ee('0x48')]['id'];}return db[_0xa3ee('0x2b')][_0xa3ee('0x46')]({'where':{'id':_0xaad29c[_0xa3ee('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f7171,null))[_0xa3ee('0x23')](saveUpdates(_0xaad29c[_0xa3ee('0x48')],null))['then'](respondWithResult(_0x2f7171,null))[_0xa3ee('0x42')](handleError(_0x2f7171,null));};exports[_0xa3ee('0x24')]=function(_0x2f1db4,_0x5ec981){return db['Cdr'][_0xa3ee('0x46')]({'where':{'id':_0x2f1db4[_0xa3ee('0x43')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x5ec981,null))[_0xa3ee('0x23')](removeEntity(_0x5ec981,null))[_0xa3ee('0x42')](handleError(_0x5ec981,null));};exports['describe']=function(_0x55678e,_0x15b55e){return db[_0xa3ee('0x2b')]['describe']()[_0xa3ee('0x23')](respondWithResult(_0x15b55e,null))[_0xa3ee('0x42')](handleError(_0x15b55e,null));};
\ No newline at end of file
+var _0x25fa=['json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25fa,0x109));var _0xa25f=function(_0x154996,_0x1ceaaf){_0x154996=_0x154996-0x0;var _0x55d295=_0x25fa[_0x154996];return _0x55d295;};'use strict';var emlformat=require(_0xa25f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa25f('0x1'));var jsonpatch=require(_0xa25f('0x2'));var rp=require('request-promise');var moment=require(_0xa25f('0x3'));var BPromise=require(_0xa25f('0x4'));var Mustache=require(_0xa25f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa25f('0x6'));var csv=require('to-csv');var ejs=require(_0xa25f('0x7'));var fs=require('fs');var fs_extra=require(_0xa25f('0x8'));var _=require(_0xa25f('0x9'));var squel=require(_0xa25f('0xa'));var crypto=require(_0xa25f('0xb'));var jsforce=require(_0xa25f('0xc'));var deskjs=require(_0xa25f('0xd'));var toCsv=require(_0xa25f('0xe'));var querystring=require(_0xa25f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa25f('0x10'));var authService=require(_0xa25f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa25f('0x12'));var hardwareService=require(_0xa25f('0x13'));var logger=require(_0xa25f('0x14'))(_0xa25f('0x15'));var utils=require('../../config/utils');var config=require(_0xa25f('0x16'));var licenseUtil=require(_0xa25f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e970c,_0x465e41){_0x465e41=_0x465e41||0xcc;return function(_0x50bb78){if(_0x50bb78){return _0x3e970c[_0xa25f('0x18')](_0x465e41);}return _0x3e970c[_0xa25f('0x19')](_0x465e41)[_0xa25f('0x1a')]();};}function respondWithResult(_0x4b3792,_0x199e18){_0x199e18=_0x199e18||0xc8;return function(_0x2a627f){if(_0x2a627f){return _0x4b3792[_0xa25f('0x19')](_0x199e18)[_0xa25f('0x1b')](_0x2a627f);}};}function respondWithFilteredResult(_0x465809,_0x2d2417){return function(_0x1e5836){if(_0x1e5836){var _0x1859ba=typeof _0x2d2417['offset']===_0xa25f('0x1c')&&typeof _0x2d2417[_0xa25f('0x1d')]===_0xa25f('0x1c');var _0x451a6e=_0x1e5836[_0xa25f('0x1e')];var _0x427105=_0x1859ba?0x0:_0x2d2417['offset'];var _0x292171=_0x1859ba?_0x1e5836['count']:_0x2d2417[_0xa25f('0x1f')]+_0x2d2417['limit'];var _0x559c89;if(_0x292171>=_0x451a6e){_0x292171=_0x451a6e;_0x559c89=0xc8;}else{_0x559c89=0xce;}_0x465809[_0xa25f('0x19')](_0x559c89);return _0x465809['set'](_0xa25f('0x20'),_0x427105+'-'+_0x292171+'/'+_0x451a6e)[_0xa25f('0x1b')](_0x1e5836);}return null;};}function patchUpdates(_0x2aaf3a){return function(_0x3c2665){try{jsonpatch[_0xa25f('0x21')](_0x3c2665,_0x2aaf3a,!![]);}catch(_0x504135){return BPromise[_0xa25f('0x22')](_0x504135);}return _0x3c2665[_0xa25f('0x23')]();};}function saveUpdates(_0x371716,_0x14b7f6){return function(_0x5d2803){if(_0x5d2803){return _0x5d2803[_0xa25f('0x24')](_0x371716)[_0xa25f('0x25')](function(_0x248c0c){return _0x248c0c;});}return null;};}function removeEntity(_0x3675b5,_0x4c6f4d){return function(_0x2b710f){if(_0x2b710f){return _0x2b710f[_0xa25f('0x26')]()[_0xa25f('0x25')](function(){_0x3675b5[_0xa25f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2812d7,_0x898446){return function(_0x53f011){if(!_0x53f011){_0x2812d7[_0xa25f('0x18')](0x194);}return _0x53f011;};}function handleError(_0x51dbf8,_0x2df893){_0x2df893=_0x2df893||0x1f4;return function(_0x4eb7b7){logger[_0xa25f('0x27')](_0x4eb7b7[_0xa25f('0x28')]);if(_0x4eb7b7['name']){delete _0x4eb7b7[_0xa25f('0x29')];}_0x51dbf8[_0xa25f('0x19')](_0x2df893)['send'](_0x4eb7b7);};}exports[_0xa25f('0x2a')]=function(_0x5d39c7,_0x1030c4){var _0x41a847={},_0x472114={},_0x208518={'count':0x0,'rows':[]};var _0x334629=_['map'](db[_0xa25f('0x2b')][_0xa25f('0x2c')],function(_0x119ffc){return{'name':_0x119ffc[_0xa25f('0x2d')],'type':_0x119ffc[_0xa25f('0x2e')]['key']};});_0x472114[_0xa25f('0x2f')]=_[_0xa25f('0x30')](_0x334629,_0xa25f('0x29'));_0x472114[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0x5d39c7[_0xa25f('0x31')]);_0x472114[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x472114[_0xa25f('0x2f')],_0x472114['query']);_0x41a847['attributes']=_['intersection'](_0x472114[_0xa25f('0x2f')],qs[_0xa25f('0x35')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x35')]));_0x41a847[_0xa25f('0x36')]=_0x41a847[_0xa25f('0x36')][_0xa25f('0x37')]?_0x41a847[_0xa25f('0x36')]:_0x472114[_0xa25f('0x2f')];if(!_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x38')]('nolimit')){_0x41a847['limit']=qs[_0xa25f('0x1d')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x1d')]);_0x41a847['offset']=qs['offset'](_0x5d39c7['query'][_0xa25f('0x1f')]);}_0x41a847[_0xa25f('0x39')]=qs[_0xa25f('0x3a')](_0x5d39c7['query']['sort']);_0x41a847[_0xa25f('0x3b')]=qs[_0xa25f('0x33')](_['pick'](_0x5d39c7['query'],_0x472114[_0xa25f('0x33')]),_0x334629);if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]){_0x41a847['where']=_[_0xa25f('0x3d')](_0x41a847[_0xa25f('0x3b')],{'$or':_[_0xa25f('0x30')](_0x334629,function(_0x49556e){if(_0x49556e['type']!==_0xa25f('0x3e')){var _0x44c9c8={};_0x44c9c8[_0x49556e[_0xa25f('0x29')]]={'$like':'%'+_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]+'%'};return _0x44c9c8;}})});}_0x41a847=_[_0xa25f('0x3d')]({},_0x41a847,_0x5d39c7[_0xa25f('0x3f')]);var _0x3382f4={'where':_0x41a847['where']};return db[_0xa25f('0x2b')][_0xa25f('0x1e')](_0x3382f4)[_0xa25f('0x25')](function(_0x2e886f){_0x208518[_0xa25f('0x1e')]=_0x2e886f;if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x40')]){_0x41a847[_0xa25f('0x41')]=[{'all':!![]}];}return db[_0xa25f('0x2b')][_0xa25f('0x42')](_0x41a847);})[_0xa25f('0x25')](function(_0x3267a0){_0x208518[_0xa25f('0x43')]=_0x3267a0;return _0x208518;})['then'](respondWithFilteredResult(_0x1030c4,_0x41a847))[_0xa25f('0x44')](handleError(_0x1030c4,null));};exports['show']=function(_0xace015,_0x320119){var _0x36afe4={'raw':!![],'where':{'id':_0xace015[_0xa25f('0x45')]['id']}},_0x559874={};_0x559874[_0xa25f('0x2f')]=_[_0xa25f('0x32')](db[_0xa25f('0x2b')]['rawAttributes']);_0x559874[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0xace015[_0xa25f('0x31')]);_0x559874[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x559874[_0xa25f('0x2f')],_0x559874['query']);_0x36afe4[_0xa25f('0x36')]=_[_0xa25f('0x34')](_0x559874['model'],qs[_0xa25f('0x35')](_0xace015[_0xa25f('0x31')][_0xa25f('0x35')]));_0x36afe4[_0xa25f('0x36')]=_0x36afe4[_0xa25f('0x36')][_0xa25f('0x37')]?_0x36afe4[_0xa25f('0x36')]:_0x559874[_0xa25f('0x2f')];if(_0xace015[_0xa25f('0x31')][_0xa25f('0x40')]){_0x36afe4[_0xa25f('0x41')]=[{'all':!![]}];}_0x36afe4=_[_0xa25f('0x3d')]({},_0x36afe4,_0xace015[_0xa25f('0x3f')]);return db['Cdr'][_0xa25f('0x46')](_0x36afe4)[_0xa25f('0x25')](handleEntityNotFound(_0x320119,null))[_0xa25f('0x25')](respondWithResult(_0x320119,null))[_0xa25f('0x44')](handleError(_0x320119,null));};exports['create']=function(_0x34717c,_0x43888b){return db[_0xa25f('0x2b')]['create'](_0x34717c[_0xa25f('0x47')],{})[_0xa25f('0x25')](respondWithResult(_0x43888b,0xc9))[_0xa25f('0x44')](handleError(_0x43888b,null));};exports[_0xa25f('0x24')]=function(_0x18c9f2,_0x3b6d34){if(_0x18c9f2[_0xa25f('0x47')]['id']){delete _0x18c9f2[_0xa25f('0x47')]['id'];}return db['Cdr'][_0xa25f('0x46')]({'where':{'id':_0x18c9f2[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0x3b6d34,null))[_0xa25f('0x25')](saveUpdates(_0x18c9f2[_0xa25f('0x47')],null))[_0xa25f('0x25')](respondWithResult(_0x3b6d34,null))[_0xa25f('0x44')](handleError(_0x3b6d34,null));};exports[_0xa25f('0x26')]=function(_0x26a096,_0xe04d67){return db[_0xa25f('0x2b')][_0xa25f('0x46')]({'where':{'id':_0x26a096[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0xe04d67,null))[_0xa25f('0x25')](removeEntity(_0xe04d67,null))[_0xa25f('0x44')](handleError(_0xe04d67,null));};exports[_0xa25f('0x48')]=function(_0x2fedba,_0x32f719){return db[_0xa25f('0x2b')][_0xa25f('0x48')]()[_0xa25f('0x25')](respondWithResult(_0x32f719,null))['catch'](handleError(_0x32f719,null));};
\ No newline at end of file
index 6bfa361..900a434 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(_0x38e99b,_0x3ce115){var _0x510574=function(_0x114169){while(--_0x114169){_0x38e99b['push'](_0x38e99b['shift']());}};_0x510574(++_0x3ce115);}(_0x7a54,0x106));var _0x47a5=function(_0x3c3eba,_0x498a19){_0x3c3eba=_0x3c3eba-0x0;var _0x56b9cc=_0x7a54[_0x3c3eba];return _0x56b9cc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xc0333,_0x231649){var _0x315a87=function(_0x51ce7c){while(--_0x51ce7c){_0xc0333['push'](_0xc0333['shift']());}};_0x315a87(++_0x231649);}(_0x7a54,0x106));var _0x47a5=function(_0x28c65a,_0x3be8f7){_0x28c65a=_0x28c65a-0x0;var _0x56ddcd=_0x7a54[_0x28c65a];return _0x56ddcd;};'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
index 2079e25..9a8ccec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0120=['rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','Cdr,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x148b6e,_0x2f9f7c){var _0x5b1625=function(_0x323567){while(--_0x323567){_0x148b6e['push'](_0x148b6e['shift']());}};_0x5b1625(++_0x2f9f7c);}(_0x0120,0x1f3));var _0x0012=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0120[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0012('0x0'));var util=require('util');var moment=require(_0x0012('0x1'));var BPromise=require(_0x0012('0x2'));var rs=require(_0x0012('0x3'));var fs=require('fs');var Redis=require(_0x0012('0x4'));var db=require(_0x0012('0x5'))['db'];var utils=require(_0x0012('0x6'));var logger=require('../../config/logger')(_0x0012('0x7'));var config=require(_0x0012('0x8'));var jayson=require(_0x0012('0x9'));var client=jayson[_0x0012('0xa')][_0x0012('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ae4da,_0x3dcf07,_0x123ca6){return new BPromise(function(_0x48f492,_0x550342){return client['request'](_0x5ae4da,_0x123ca6)['then'](function(_0x430c74){logger[_0x0012('0xc')]('Cdr,\x20%s,\x20%s',_0x3dcf07,_0x0012('0xd'));logger[_0x0012('0xe')](_0x0012('0xf'),_0x3dcf07,_0x0012('0xd'),JSON[_0x0012('0x10')](_0x430c74));if(_0x430c74['error']){if(_0x430c74['error'][_0x0012('0x11')]===0x1f4){logger[_0x0012('0x12')]('Cdr,\x20%s,\x20%s',_0x3dcf07,_0x430c74[_0x0012('0x12')][_0x0012('0x13')]);return _0x550342(_0x430c74[_0x0012('0x12')][_0x0012('0x13')]);}logger[_0x0012('0x12')](_0x0012('0x14'),_0x3dcf07,_0x430c74[_0x0012('0x12')][_0x0012('0x13')]);return _0x48f492(_0x430c74[_0x0012('0x12')]['message']);}else{logger['info'](_0x0012('0x14'),_0x3dcf07,'request\x20sent');_0x48f492(_0x430c74[_0x0012('0x15')]['message']);}})['catch'](function(_0x1a9fb4){logger['error'](_0x0012('0x14'),_0x3dcf07,_0x1a9fb4);_0x550342(_0x1a9fb4);});});}
\ No newline at end of file
+var _0x80b4=['error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b8e96,_0x48f690){var _0x1c1ca7=function(_0x21cf8f){while(--_0x21cf8f){_0x2b8e96['push'](_0x2b8e96['shift']());}};_0x1c1ca7(++_0x48f690);}(_0x80b4,0x165));var _0x480b=function(_0x304583,_0xb8eca5){_0x304583=_0x304583-0x0;var _0x257329=_0x80b4[_0x304583];return _0x257329;};'use strict';var _=require(_0x480b('0x0'));var util=require(_0x480b('0x1'));var moment=require(_0x480b('0x2'));var BPromise=require(_0x480b('0x3'));var rs=require(_0x480b('0x4'));var fs=require('fs');var Redis=require(_0x480b('0x5'));var db=require(_0x480b('0x6'))['db'];var utils=require(_0x480b('0x7'));var logger=require(_0x480b('0x8'))(_0x480b('0x9'));var config=require('../../config/environment');var jayson=require(_0x480b('0xa'));var client=jayson[_0x480b('0xb')][_0x480b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f1bea,_0x36de34,_0x53f25b){return new BPromise(function(_0x39d1ea,_0x565226){return client['request'](_0x5f1bea,_0x53f25b)[_0x480b('0xd')](function(_0x41f96f){logger['info'](_0x480b('0xe'),_0x36de34,'request\x20sent');logger[_0x480b('0xf')](_0x480b('0x10'),_0x36de34,'request\x20sent',JSON[_0x480b('0x11')](_0x41f96f));if(_0x41f96f[_0x480b('0x12')]){if(_0x41f96f[_0x480b('0x12')][_0x480b('0x13')]===0x1f4){logger[_0x480b('0x12')](_0x480b('0xe'),_0x36de34,_0x41f96f['error'][_0x480b('0x14')]);return _0x565226(_0x41f96f['error'][_0x480b('0x14')]);}logger[_0x480b('0x12')](_0x480b('0xe'),_0x36de34,_0x41f96f[_0x480b('0x12')][_0x480b('0x14')]);return _0x39d1ea(_0x41f96f[_0x480b('0x12')][_0x480b('0x14')]);}else{logger[_0x480b('0x15')]('Cdr,\x20%s,\x20%s',_0x36de34,_0x480b('0x16'));_0x39d1ea(_0x41f96f[_0x480b('0x17')][_0x480b('0x14')]);}})[_0x480b('0x18')](function(_0x1168ef){logger[_0x480b('0x12')]('Cdr,\x20%s,\x20%s',_0x36de34,_0x1168ef);_0x565226(_0x1168ef);});});}
\ No newline at end of file
index ce2ae81..2dc58b9 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(_0x2fad8a,_0x26de69){var _0x494d7d=function(_0x52fe59){while(--_0x52fe59){_0x2fad8a['push'](_0x2fad8a['shift']());}};_0x494d7d(++_0x26de69);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 4615061..5daf8f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93a2=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x93a2,0xd4));var _0x293a=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x93a2[_0x55cc58];return _0x26062e;};'use strict';var Sequelize=require(_0x293a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x293a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x293a('0x2')],'allowNull':![],'defaultValue':_0x293a('0x3')},'appdata':{'type':Sequelize[_0x293a('0x4')]()},'description':{'type':Sequelize[_0x293a('0x2')]},'interval':{'type':Sequelize[_0x293a('0x2')],'defaultValue':_0x293a('0x5')}};
\ No newline at end of file
+var _0xdc52=['exports','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x24fb0e,_0x35315d){var _0x17719e=function(_0x5e91e1){while(--_0x5e91e1){_0x24fb0e['push'](_0x24fb0e['shift']());}};_0x17719e(++_0x35315d);}(_0xdc52,0x13f));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2dc5('0x0'));module[_0x2dc5('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2dc5('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2dc5('0x3')]()},'description':{'type':Sequelize[_0x2dc5('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2dc5('0x4')}};
\ No newline at end of file
index e80e072..32c5307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85b5=['attributes','fields','length','includeAll','merge','options','ChatApplication','find','catch','update','body','params','destroy','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','show','model','keys','rawAttributes','query','filters','intersection'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x85b5,0x7f));var _0x585b=function(_0x4fd220,_0x4540b1){_0x4fd220=_0x4fd220-0x0;var _0x17eb8c=_0x85b5[_0x4fd220];return _0x17eb8c;};'use strict';var emlformat=require(_0x585b('0x0'));var rimraf=require(_0x585b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x585b('0x2'));var rp=require('request-promise');var moment=require(_0x585b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x585b('0x4'));var path=require('path');var sox=require(_0x585b('0x5'));var csv=require(_0x585b('0x6'));var ejs=require(_0x585b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x6'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x585b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16d608,_0x35bda0){_0x35bda0=_0x35bda0||0xcc;return function(_0x19336c){if(_0x19336c){return _0x16d608['sendStatus'](_0x35bda0);}return _0x16d608[_0x585b('0x15')](_0x35bda0)[_0x585b('0x16')]();};}function respondWithResult(_0x3d15ed,_0x299ee4){_0x299ee4=_0x299ee4||0xc8;return function(_0x3dcc28){if(_0x3dcc28){return _0x3d15ed[_0x585b('0x15')](_0x299ee4)[_0x585b('0x17')](_0x3dcc28);}};}function respondWithFilteredResult(_0x5ebc1a,_0x2f827f){return function(_0x41f50d){if(_0x41f50d){var _0x4c094e=typeof _0x2f827f['offset']===_0x585b('0x18')&&typeof _0x2f827f['limit']==='undefined';var _0x2f840e=_0x41f50d[_0x585b('0x19')];var _0x20c4ba=_0x4c094e?0x0:_0x2f827f['offset'];var _0x72fdc4=_0x4c094e?_0x41f50d[_0x585b('0x19')]:_0x2f827f[_0x585b('0x1a')]+_0x2f827f[_0x585b('0x1b')];var _0x562886;if(_0x72fdc4>=_0x2f840e){_0x72fdc4=_0x2f840e;_0x562886=0xc8;}else{_0x562886=0xce;}_0x5ebc1a[_0x585b('0x15')](_0x562886);return _0x5ebc1a[_0x585b('0x1c')](_0x585b('0x1d'),_0x20c4ba+'-'+_0x72fdc4+'/'+_0x2f840e)['json'](_0x41f50d);}return null;};}function patchUpdates(_0x5200ec){return function(_0x6bea29){try{jsonpatch['apply'](_0x6bea29,_0x5200ec,!![]);}catch(_0x484157){return BPromise[_0x585b('0x1e')](_0x484157);}return _0x6bea29[_0x585b('0x1f')]();};}function saveUpdates(_0x48d9f8,_0x183308){return function(_0x272a8d){if(_0x272a8d){return _0x272a8d['update'](_0x48d9f8)[_0x585b('0x20')](function(_0xe50751){return _0xe50751;});}return null;};}function removeEntity(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(_0x1c8a7b){return _0x1c8a7b['destroy']()[_0x585b('0x20')](function(){_0x2122e0[_0x585b('0x15')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x428a9a,_0x1b06a2){return function(_0x1b1241){if(!_0x1b1241){_0x428a9a[_0x585b('0x21')](0x194);}return _0x1b1241;};}function handleError(_0x799947,_0x100189){_0x100189=_0x100189||0x1f4;return function(_0x47099f){logger[_0x585b('0x22')](_0x47099f[_0x585b('0x23')]);if(_0x47099f[_0x585b('0x24')]){delete _0x47099f[_0x585b('0x24')];}_0x799947[_0x585b('0x15')](_0x100189)['send'](_0x47099f);};}exports[_0x585b('0x25')]=function(_0x205ffe,_0x19786){var _0x2cf48a={'raw':!![],'where':{'id':_0x205ffe['params']['id']}},_0x5dad9a={};_0x5dad9a[_0x585b('0x26')]=_[_0x585b('0x27')](db['ChatApplication'][_0x585b('0x28')]);_0x5dad9a[_0x585b('0x29')]=_['keys'](_0x205ffe[_0x585b('0x29')]);_0x5dad9a[_0x585b('0x2a')]=_[_0x585b('0x2b')](_0x5dad9a[_0x585b('0x26')],_0x5dad9a[_0x585b('0x29')]);_0x2cf48a[_0x585b('0x2c')]=_[_0x585b('0x2b')](_0x5dad9a[_0x585b('0x26')],qs[_0x585b('0x2d')](_0x205ffe[_0x585b('0x29')]['fields']));_0x2cf48a[_0x585b('0x2c')]=_0x2cf48a[_0x585b('0x2c')][_0x585b('0x2e')]?_0x2cf48a['attributes']:_0x5dad9a[_0x585b('0x26')];if(_0x205ffe[_0x585b('0x29')][_0x585b('0x2f')]){_0x2cf48a['include']=[{'all':!![]}];}_0x2cf48a=_[_0x585b('0x30')]({},_0x2cf48a,_0x205ffe[_0x585b('0x31')]);return db[_0x585b('0x32')][_0x585b('0x33')](_0x2cf48a)['then'](handleEntityNotFound(_0x19786,null))['then'](respondWithResult(_0x19786,null))[_0x585b('0x34')](handleError(_0x19786,null));};exports[_0x585b('0x35')]=function(_0x411914,_0x31918f){if(_0x411914[_0x585b('0x36')]['id']){delete _0x411914['body']['id'];}return db[_0x585b('0x32')][_0x585b('0x33')]({'where':{'id':_0x411914[_0x585b('0x37')]['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x31918f,null))[_0x585b('0x20')](saveUpdates(_0x411914['body'],null))['then'](respondWithResult(_0x31918f,null))['catch'](handleError(_0x31918f,null));};exports[_0x585b('0x38')]=function(_0x199e54,_0x2c4b9f){return db[_0x585b('0x32')][_0x585b('0x33')]({'where':{'id':_0x199e54[_0x585b('0x37')]['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x2c4b9f,null))[_0x585b('0x20')](removeEntity(_0x2c4b9f,null))[_0x585b('0x34')](handleError(_0x2c4b9f,null));};
\ No newline at end of file
+var _0xceb0=['status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','body','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x21d3b0,_0x2cdb41){var _0x2e1e94=function(_0x51126e){while(--_0x51126e){_0x21d3b0['push'](_0x21d3b0['shift']());}};_0x2e1e94(++_0x2cdb41);}(_0xceb0,0x173));var _0x0ceb=function(_0x436eb5,_0x168e88){_0x436eb5=_0x436eb5-0x0;var _0x280b4d=_0xceb0[_0x436eb5];return _0x280b4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0ceb('0x0'));var moment=require('moment');var BPromise=require(_0x0ceb('0x1'));var Mustache=require(_0x0ceb('0x2'));var util=require(_0x0ceb('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x0ceb('0x4'));var ejs=require(_0x0ceb('0x5'));var fs=require('fs');var fs_extra=require(_0x0ceb('0x6'));var _=require('lodash');var squel=require(_0x0ceb('0x7'));var crypto=require(_0x0ceb('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x0ceb('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0ceb('0xa'));var Papa=require(_0x0ceb('0xb'));var Redis=require(_0x0ceb('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ceb('0xd'));var hardwareService=require(_0x0ceb('0xe'));var logger=require(_0x0ceb('0xf'))(_0x0ceb('0x10'));var utils=require(_0x0ceb('0x11'));var config=require(_0x0ceb('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ceb('0x13'))['db'];function respondWithStatusCode(_0xe19006,_0x358801){_0x358801=_0x358801||0xcc;return function(_0x26cb7a){if(_0x26cb7a){return _0xe19006[_0x0ceb('0x14')](_0x358801);}return _0xe19006[_0x0ceb('0x15')](_0x358801)[_0x0ceb('0x16')]();};}function respondWithResult(_0x54f34e,_0x416fbb){_0x416fbb=_0x416fbb||0xc8;return function(_0x54a173){if(_0x54a173){return _0x54f34e['status'](_0x416fbb)[_0x0ceb('0x17')](_0x54a173);}};}function respondWithFilteredResult(_0x2e6128,_0x218d6e){return function(_0x536bdd){if(_0x536bdd){var _0x33a190=typeof _0x218d6e[_0x0ceb('0x18')]==='undefined'&&typeof _0x218d6e[_0x0ceb('0x19')]===_0x0ceb('0x1a');var _0x2046b6=_0x536bdd[_0x0ceb('0x1b')];var _0x18bed1=_0x33a190?0x0:_0x218d6e[_0x0ceb('0x18')];var _0x2c5a89=_0x33a190?_0x536bdd[_0x0ceb('0x1b')]:_0x218d6e[_0x0ceb('0x18')]+_0x218d6e[_0x0ceb('0x19')];var _0x9aaa59;if(_0x2c5a89>=_0x2046b6){_0x2c5a89=_0x2046b6;_0x9aaa59=0xc8;}else{_0x9aaa59=0xce;}_0x2e6128[_0x0ceb('0x15')](_0x9aaa59);return _0x2e6128[_0x0ceb('0x1c')](_0x0ceb('0x1d'),_0x18bed1+'-'+_0x2c5a89+'/'+_0x2046b6)[_0x0ceb('0x17')](_0x536bdd);}return null;};}function patchUpdates(_0x3dd970){return function(_0x241c07){try{jsonpatch['apply'](_0x241c07,_0x3dd970,!![]);}catch(_0x4eb712){return BPromise[_0x0ceb('0x1e')](_0x4eb712);}return _0x241c07[_0x0ceb('0x1f')]();};}function saveUpdates(_0x5d1235,_0x2fd374){return function(_0x54fce7){if(_0x54fce7){return _0x54fce7[_0x0ceb('0x20')](_0x5d1235)[_0x0ceb('0x21')](function(_0x28fb61){return _0x28fb61;});}return null;};}function removeEntity(_0x17efd7,_0x27e058){return function(_0x4a2b69){if(_0x4a2b69){return _0x4a2b69['destroy']()['then'](function(){_0x17efd7[_0x0ceb('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x336ce9,_0x4c3e4c){return function(_0x45f2fe){if(!_0x45f2fe){_0x336ce9[_0x0ceb('0x14')](0x194);}return _0x45f2fe;};}function handleError(_0x120a47,_0x72e51){_0x72e51=_0x72e51||0x1f4;return function(_0x5a15ee){logger[_0x0ceb('0x22')](_0x5a15ee[_0x0ceb('0x23')]);if(_0x5a15ee[_0x0ceb('0x24')]){delete _0x5a15ee[_0x0ceb('0x24')];}_0x120a47[_0x0ceb('0x15')](_0x72e51)['send'](_0x5a15ee);};}exports[_0x0ceb('0x25')]=function(_0x3792bb,_0x3c934b){var _0x4427b8={'raw':!![],'where':{'id':_0x3792bb[_0x0ceb('0x26')]['id']}},_0x1ca4cb={};_0x1ca4cb['model']=_[_0x0ceb('0x27')](db[_0x0ceb('0x28')][_0x0ceb('0x29')]);_0x1ca4cb[_0x0ceb('0x2a')]=_[_0x0ceb('0x27')](_0x3792bb[_0x0ceb('0x2a')]);_0x1ca4cb[_0x0ceb('0x2b')]=_[_0x0ceb('0x2c')](_0x1ca4cb[_0x0ceb('0x2d')],_0x1ca4cb[_0x0ceb('0x2a')]);_0x4427b8['attributes']=_[_0x0ceb('0x2c')](_0x1ca4cb[_0x0ceb('0x2d')],qs['fields'](_0x3792bb[_0x0ceb('0x2a')][_0x0ceb('0x2e')]));_0x4427b8[_0x0ceb('0x2f')]=_0x4427b8['attributes'][_0x0ceb('0x30')]?_0x4427b8[_0x0ceb('0x2f')]:_0x1ca4cb[_0x0ceb('0x2d')];if(_0x3792bb[_0x0ceb('0x2a')][_0x0ceb('0x31')]){_0x4427b8[_0x0ceb('0x32')]=[{'all':!![]}];}_0x4427b8=_[_0x0ceb('0x33')]({},_0x4427b8,_0x3792bb[_0x0ceb('0x34')]);return db[_0x0ceb('0x28')][_0x0ceb('0x35')](_0x4427b8)[_0x0ceb('0x21')](handleEntityNotFound(_0x3c934b,null))[_0x0ceb('0x21')](respondWithResult(_0x3c934b,null))[_0x0ceb('0x36')](handleError(_0x3c934b,null));};exports['update']=function(_0x439d6b,_0x39e7e1){if(_0x439d6b[_0x0ceb('0x37')]['id']){delete _0x439d6b[_0x0ceb('0x37')]['id'];}return db[_0x0ceb('0x28')][_0x0ceb('0x35')]({'where':{'id':_0x439d6b['params']['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x39e7e1,null))['then'](saveUpdates(_0x439d6b['body'],null))['then'](respondWithResult(_0x39e7e1,null))[_0x0ceb('0x36')](handleError(_0x39e7e1,null));};exports['destroy']=function(_0xc6f107,_0x2f5e8a){return db['ChatApplication'][_0x0ceb('0x35')]({'where':{'id':_0xc6f107[_0x0ceb('0x26')]['id']}})[_0x0ceb('0x21')](handleEntityNotFound(_0x2f5e8a,null))['then'](removeEntity(_0x2f5e8a,null))[_0x0ceb('0x36')](handleError(_0x2f5e8a,null));};
\ No newline at end of file
index f846e00..11d0e14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb81=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','./chatApplication.attributes','exports'];(function(_0x221eae,_0x2a3fa6){var _0x86f9f3=function(_0x59b699){while(--_0x59b699){_0x221eae['push'](_0x221eae['shift']());}};_0x86f9f3(++_0x2a3fa6);}(_0xeb81,0x100));var _0x1eb8=function(_0x5a5dd3,_0x440504){_0x5a5dd3=_0x5a5dd3-0x0;var _0x22f0ce=_0xeb81[_0x5a5dd3];return _0x22f0ce;};'use strict';var _=require(_0x1eb8('0x0'));var util=require('util');var logger=require(_0x1eb8('0x1'))('api');var moment=require(_0x1eb8('0x2'));var BPromise=require(_0x1eb8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1eb8('0x4'));var rimraf=require(_0x1eb8('0x5'));var config=require('../../config/environment');var attributes=require(_0x1eb8('0x6'));module[_0x1eb8('0x7')]=function(_0x578a72,_0x54eaae){return _0x578a72['define']('ChatApplication',attributes,{'tableName':_0x1eb8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1eb8('0x9'),'collate':_0x1eb8('0xa')});};
\ No newline at end of file
+var _0x9f1b=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x233aa1,_0x37af6d){var _0x4e670d=function(_0x2fca54){while(--_0x2fca54){_0x233aa1['push'](_0x233aa1['shift']());}};_0x4e670d(++_0x37af6d);}(_0x9f1b,0xbd));var _0xb9f1=function(_0x1b6bc2,_0x54fa79){_0x1b6bc2=_0x1b6bc2-0x0;var _0x55de11=_0x9f1b[_0x1b6bc2];return _0x55de11;};'use strict';var _=require('lodash');var util=require(_0xb9f1('0x0'));var logger=require('../../config/logger')(_0xb9f1('0x1'));var moment=require(_0xb9f1('0x2'));var BPromise=require('bluebird');var rp=require(_0xb9f1('0x3'));var fs=require('fs');var path=require(_0xb9f1('0x4'));var rimraf=require(_0xb9f1('0x5'));var config=require(_0xb9f1('0x6'));var attributes=require(_0xb9f1('0x7'));module[_0xb9f1('0x8')]=function(_0x1a5c38,_0x526813){return _0x1a5c38[_0xb9f1('0x9')](_0xb9f1('0xa'),attributes,{'tableName':_0xb9f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9f1('0xc'),'collate':_0xb9f1('0xd')});};
\ No newline at end of file
index 81bb3b6..ac03128 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb13=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x281877,_0x19ba04){var _0x333186=function(_0x1a6313){while(--_0x1a6313){_0x281877['push'](_0x281877['shift']());}};_0x333186(++_0x19ba04);}(_0xfb13,0xd6));var _0x3fb1=function(_0x178f3e,_0x567056){_0x178f3e=_0x178f3e-0x0;var _0x2c73ab=_0xfb13[_0x178f3e];return _0x2c73ab;};'use strict';var _=require(_0x3fb1('0x0'));var util=require(_0x3fb1('0x1'));var moment=require(_0x3fb1('0x2'));var BPromise=require(_0x3fb1('0x3'));var rs=require(_0x3fb1('0x4'));var fs=require('fs');var Redis=require(_0x3fb1('0x5'));var db=require(_0x3fb1('0x6'))['db'];var utils=require(_0x3fb1('0x7'));var logger=require(_0x3fb1('0x8'))(_0x3fb1('0x9'));var config=require(_0x3fb1('0xa'));var jayson=require(_0x3fb1('0xb'));var client=jayson[_0x3fb1('0xc')][_0x3fb1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1b0669,_0x128839,_0x4ebf88){return new BPromise(function(_0x4e575c,_0x35a11f){return client['request'](_0x1b0669,_0x4ebf88)['then'](function(_0x40a954){logger[_0x3fb1('0xe')]('ChatApplication,\x20%s,\x20%s',_0x128839,_0x3fb1('0xf'));logger[_0x3fb1('0x10')](_0x3fb1('0x11'),_0x128839,_0x3fb1('0xf'),JSON[_0x3fb1('0x12')](_0x40a954));if(_0x40a954[_0x3fb1('0x13')]){if(_0x40a954[_0x3fb1('0x13')][_0x3fb1('0x14')]===0x1f4){logger[_0x3fb1('0x13')](_0x3fb1('0x15'),_0x128839,_0x40a954[_0x3fb1('0x13')][_0x3fb1('0x16')]);return _0x35a11f(_0x40a954['error'][_0x3fb1('0x16')]);}logger[_0x3fb1('0x13')](_0x3fb1('0x15'),_0x128839,_0x40a954[_0x3fb1('0x13')]['message']);return _0x4e575c(_0x40a954[_0x3fb1('0x13')]['message']);}else{logger[_0x3fb1('0xe')](_0x3fb1('0x15'),_0x128839,_0x3fb1('0xf'));_0x4e575c(_0x40a954[_0x3fb1('0x17')]['message']);}})['catch'](function(_0x6879c0){logger['error'](_0x3fb1('0x15'),_0x128839,_0x6879c0);_0x35a11f(_0x6879c0);});});}
\ No newline at end of file
+var _0xe00d=['ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0xe00d,0x1ad));var _0xde00=function(_0x7587ea,_0x19fc7b){_0x7587ea=_0x7587ea-0x0;var _0x30ec26=_0xe00d[_0x7587ea];return _0x30ec26;};'use strict';var _=require('lodash');var util=require(_0xde00('0x0'));var moment=require(_0xde00('0x1'));var BPromise=require(_0xde00('0x2'));var rs=require(_0xde00('0x3'));var fs=require('fs');var Redis=require(_0xde00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xde00('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xde00('0x6'));var jayson=require(_0xde00('0x7'));var client=jayson['client'][_0xde00('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x526a54,_0x1715b0,_0x26a96c){return new BPromise(function(_0x170189,_0xab4122){return client[_0xde00('0x9')](_0x526a54,_0x26a96c)[_0xde00('0xa')](function(_0x3b039a){logger[_0xde00('0xb')](_0xde00('0xc'),_0x1715b0,_0xde00('0xd'));logger['debug'](_0xde00('0xe'),_0x1715b0,_0xde00('0xd'),JSON[_0xde00('0xf')](_0x3b039a));if(_0x3b039a['error']){if(_0x3b039a['error'][_0xde00('0x10')]===0x1f4){logger[_0xde00('0x11')](_0xde00('0xc'),_0x1715b0,_0x3b039a[_0xde00('0x11')]['message']);return _0xab4122(_0x3b039a[_0xde00('0x11')][_0xde00('0x12')]);}logger[_0xde00('0x11')](_0xde00('0xc'),_0x1715b0,_0x3b039a[_0xde00('0x11')]['message']);return _0x170189(_0x3b039a[_0xde00('0x11')][_0xde00('0x12')]);}else{logger[_0xde00('0xb')](_0xde00('0xc'),_0x1715b0,_0xde00('0xd'));_0x170189(_0x3b039a[_0xde00('0x13')]['message']);}})[_0xde00('0x14')](function(_0x10b5cb){logger['error'](_0xde00('0xc'),_0x1715b0,_0x10b5cb);_0xab4122(_0x10b5cb);});});}
\ No newline at end of file
index c466d8a..98516a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81b6=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','/:id','isAuthenticated','show','put','update','destroy'];(function(_0x19140e,_0x13d31c){var _0x13a8eb=function(_0xa41267){while(--_0xa41267){_0x19140e['push'](_0x19140e['shift']());}};_0x13a8eb(++_0x13d31c);}(_0x81b6,0x151));var _0x681b=function(_0x405a82,_0x20f8a2){_0x405a82=_0x405a82-0x0;var _0x1c2ebb=_0x81b6[_0x405a82];return _0x1c2ebb;};'use strict';var multer=require(_0x681b('0x0'));var util=require(_0x681b('0x1'));var path=require(_0x681b('0x2'));var timeout=require(_0x681b('0x3'));var express=require('express');var router=express[_0x681b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x681b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x681b('0x6'));var controller=require('./chatApplication.controller');router['get'](_0x681b('0x7'),auth[_0x681b('0x8')](),controller[_0x681b('0x9')]);router[_0x681b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x681b('0xb')]);router['delete']('/:id',auth[_0x681b('0x8')](),controller[_0x681b('0xc')]);module[_0x681b('0xd')]=router;
\ No newline at end of file
+var _0xa140=['show','put','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xa140,0x18b));var _0x0a14=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa140[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a14('0x0'));var timeout=require(_0x0a14('0x1'));var express=require(_0x0a14('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0a14('0x3'));var config=require(_0x0a14('0x4'));var controller=require(_0x0a14('0x5'));router['get'](_0x0a14('0x6'),auth[_0x0a14('0x7')](),controller[_0x0a14('0x8')]);router[_0x0a14('0x9')]('/:id',auth[_0x0a14('0x7')](),controller['update']);router[_0x0a14('0xa')](_0x0a14('0x6'),auth[_0x0a14('0x7')](),controller[_0x0a14('0xb')]);module[_0x0a14('0xc')]=router;
\ No newline at end of file
index 64006c6..67a279b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb713=['STRING','BOOLEAN','sequelize'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xb713,0x1a6));var _0x3b71=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0xb713[_0x4067ac];return _0x53d74d;};'use strict';var Sequelize=require(_0x3b71('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b71('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3b71('0x1')]},'write':{'type':Sequelize[_0x3b71('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x8be8=['STRING','BOOLEAN','sequelize','exports'];(function(_0x58d3d3,_0x13e06d){var _0x298e14=function(_0x425120){while(--_0x425120){_0x58d3d3['push'](_0x58d3d3['shift']());}};_0x298e14(++_0x13e06d);}(_0x8be8,0xf6));var _0x88be=function(_0x21b670,_0x55a7ae){_0x21b670=_0x21b670-0x0;var _0x1a7cb5=_0x8be8[_0x21b670];return _0x1a7cb5;};'use strict';var Sequelize=require(_0x88be('0x0'));module[_0x88be('0x1')]={'name':{'type':Sequelize[_0x88be('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x88be('0x2')]},'write':{'type':Sequelize[_0x88be('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 1fc7dc1..ac2c2c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab92=['fs-extra','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','register','sendStatus','status','end','json','limit','undefined','offset','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','update','find','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','ChatInternalMessage','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0xab92,0xb8));var _0x2ab9=function(_0x5a3fef,_0x3f527a){_0x5a3fef=_0x5a3fef-0x0;var _0x523319=_0xab92[_0x5a3fef];return _0x523319;};'use strict';var emlformat=require(_0x2ab9('0x0'));var rimraf=require(_0x2ab9('0x1'));var zipdir=require(_0x2ab9('0x2'));var jsonpatch=require(_0x2ab9('0x3'));var rp=require(_0x2ab9('0x4'));var moment=require(_0x2ab9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2ab9('0x6'));var util=require(_0x2ab9('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2ab9('0x8'));var ejs=require(_0x2ab9('0x9'));var fs=require('fs');var fs_extra=require(_0x2ab9('0xa'));var _=require(_0x2ab9('0xb'));var squel=require('squel');var crypto=require(_0x2ab9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ab9('0x8'));var querystring=require(_0x2ab9('0xd'));var Papa=require(_0x2ab9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2ab9('0xf'));var as=require(_0x2ab9('0x10'));var hardwareService=require(_0x2ab9('0x11'));var logger=require(_0x2ab9('0x12'))(_0x2ab9('0x13'));var utils=require('../../config/utils');var config=require(_0x2ab9('0x14'));var licenseUtil=require(_0x2ab9('0x15'));var db=require(_0x2ab9('0x16'))['db'];config['redis']=_[_0x2ab9('0x17')](config[_0x2ab9('0x18')],{'host':_0x2ab9('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2ab9('0x1a'))[_0x2ab9('0x1b')](socket);function respondWithStatusCode(_0x2bb57f,_0x2c0019){_0x2c0019=_0x2c0019||0xcc;return function(_0x5a8ddb){if(_0x5a8ddb){return _0x2bb57f[_0x2ab9('0x1c')](_0x2c0019);}return _0x2bb57f[_0x2ab9('0x1d')](_0x2c0019)[_0x2ab9('0x1e')]();};}function respondWithResult(_0x5ca522,_0x464b76){_0x464b76=_0x464b76||0xc8;return function(_0x2a9160){if(_0x2a9160){return _0x5ca522['status'](_0x464b76)[_0x2ab9('0x1f')](_0x2a9160);}};}function respondWithFilteredResult(_0x55092f,_0x1cc634){return function(_0x4d4723){if(_0x4d4723){var _0x40996f=typeof _0x1cc634['offset']==='undefined'&&typeof _0x1cc634[_0x2ab9('0x20')]===_0x2ab9('0x21');var _0x247a99=_0x4d4723['count'];var _0xba369b=_0x40996f?0x0:_0x1cc634[_0x2ab9('0x22')];var _0xf44c58=_0x40996f?_0x4d4723['count']:_0x1cc634[_0x2ab9('0x22')]+_0x1cc634[_0x2ab9('0x20')];var _0x33f724;if(_0xf44c58>=_0x247a99){_0xf44c58=_0x247a99;_0x33f724=0xc8;}else{_0x33f724=0xce;}_0x55092f[_0x2ab9('0x1d')](_0x33f724);return _0x55092f['set'](_0x2ab9('0x23'),_0xba369b+'-'+_0xf44c58+'/'+_0x247a99)[_0x2ab9('0x1f')](_0x4d4723);}return null;};}function patchUpdates(_0x1c3e5f){return function(_0x4985b6){try{jsonpatch[_0x2ab9('0x24')](_0x4985b6,_0x1c3e5f,!![]);}catch(_0x122839){return BPromise[_0x2ab9('0x25')](_0x122839);}return _0x4985b6[_0x2ab9('0x26')]();};}function saveUpdates(_0x4fb6f7,_0x1a68fe){return function(_0x439262){if(_0x439262){return _0x439262['update'](_0x4fb6f7)[_0x2ab9('0x27')](function(_0x477be3){return _0x477be3;});}return null;};}function removeEntity(_0x35cc21,_0x4b6187){return function(_0x53b956){if(_0x53b956){return _0x53b956[_0x2ab9('0x28')]()[_0x2ab9('0x27')](function(){_0x35cc21[_0x2ab9('0x1d')](0xcc)[_0x2ab9('0x1e')]();});}};}function handleEntityNotFound(_0x36ca90,_0x2e6cab){return function(_0x4d4f74){if(!_0x4d4f74){_0x36ca90[_0x2ab9('0x1c')](0x194);}return _0x4d4f74;};}function handleError(_0x1a1fae,_0x2f2414){_0x2f2414=_0x2f2414||0x1f4;return function(_0x2ab015){logger['error'](_0x2ab015[_0x2ab9('0x29')]);if(_0x2ab015[_0x2ab9('0x2a')]){delete _0x2ab015[_0x2ab9('0x2a')];}_0x1a1fae['status'](_0x2f2414)['send'](_0x2ab015);};}exports[_0x2ab9('0x2b')]=function(_0x32e476,_0x527696){var _0x39d538={},_0x27ee20={},_0x3e3451={'count':0x0,'rows':[]};var _0xb489be=_[_0x2ab9('0x2c')](db[_0x2ab9('0x2d')][_0x2ab9('0x2e')],function(_0x2366bf){return{'name':_0x2366bf[_0x2ab9('0x2f')],'type':_0x2366bf[_0x2ab9('0x30')]['key']};});_0x27ee20[_0x2ab9('0x31')]=_[_0x2ab9('0x2c')](_0xb489be,_0x2ab9('0x2a'));_0x27ee20[_0x2ab9('0x32')]=_[_0x2ab9('0x33')](_0x32e476[_0x2ab9('0x32')]);_0x27ee20['filters']=_[_0x2ab9('0x34')](_0x27ee20['model'],_0x27ee20[_0x2ab9('0x32')]);_0x39d538[_0x2ab9('0x35')]=_[_0x2ab9('0x34')](_0x27ee20[_0x2ab9('0x31')],qs[_0x2ab9('0x36')](_0x32e476[_0x2ab9('0x32')][_0x2ab9('0x36')]));_0x39d538[_0x2ab9('0x35')]=_0x39d538[_0x2ab9('0x35')][_0x2ab9('0x37')]?_0x39d538[_0x2ab9('0x35')]:_0x27ee20[_0x2ab9('0x31')];if(!_0x32e476['query']['hasOwnProperty']('nolimit')){_0x39d538[_0x2ab9('0x20')]=qs[_0x2ab9('0x20')](_0x32e476[_0x2ab9('0x32')][_0x2ab9('0x20')]);_0x39d538[_0x2ab9('0x22')]=qs[_0x2ab9('0x22')](_0x32e476[_0x2ab9('0x32')][_0x2ab9('0x22')]);}_0x39d538['order']=qs[_0x2ab9('0x38')](_0x32e476[_0x2ab9('0x32')][_0x2ab9('0x38')]);_0x39d538[_0x2ab9('0x39')]=qs[_0x2ab9('0x3a')](_[_0x2ab9('0x3b')](_0x32e476[_0x2ab9('0x32')],_0x27ee20['filters']),_0xb489be);if(_0x32e476[_0x2ab9('0x32')][_0x2ab9('0x3c')]){_0x39d538[_0x2ab9('0x39')]=_[_0x2ab9('0x3d')](_0x39d538[_0x2ab9('0x39')],{'$or':_[_0x2ab9('0x2c')](_0xb489be,function(_0x1a39c8){if(_0x1a39c8[_0x2ab9('0x30')]!==_0x2ab9('0x3e')){var _0x8d91b={};_0x8d91b[_0x1a39c8[_0x2ab9('0x2a')]]={'$like':'%'+_0x32e476['query'][_0x2ab9('0x3c')]+'%'};return _0x8d91b;}})});}_0x39d538=_[_0x2ab9('0x3d')]({},_0x39d538,_0x32e476[_0x2ab9('0x3f')]);var _0x253e91={'where':_0x39d538[_0x2ab9('0x39')]};return db[_0x2ab9('0x2d')][_0x2ab9('0x40')](_0x253e91)['then'](function(_0x5acdb2){_0x3e3451[_0x2ab9('0x40')]=_0x5acdb2;if(_0x32e476[_0x2ab9('0x32')][_0x2ab9('0x41')]){_0x39d538[_0x2ab9('0x42')]=[{'all':!![]}];}return db[_0x2ab9('0x2d')][_0x2ab9('0x43')](_0x39d538);})[_0x2ab9('0x27')](function(_0x5699af){_0x3e3451[_0x2ab9('0x44')]=_0x5699af;return _0x3e3451;})[_0x2ab9('0x27')](respondWithFilteredResult(_0x527696,_0x39d538))['catch'](handleError(_0x527696,null));};exports[_0x2ab9('0x45')]=function(_0x3d5ae7,_0x3f5734){var _0x1dc501={'raw':!![],'where':{'id':_0x3d5ae7[_0x2ab9('0x46')]['id']}},_0x57396b={};_0x57396b['model']=_[_0x2ab9('0x33')](db['ChatGroup'][_0x2ab9('0x2e')]);_0x57396b['query']=_['keys'](_0x3d5ae7[_0x2ab9('0x32')]);_0x57396b[_0x2ab9('0x3a')]=_[_0x2ab9('0x34')](_0x57396b[_0x2ab9('0x31')],_0x57396b[_0x2ab9('0x32')]);_0x1dc501[_0x2ab9('0x35')]=_[_0x2ab9('0x34')](_0x57396b[_0x2ab9('0x31')],qs[_0x2ab9('0x36')](_0x3d5ae7[_0x2ab9('0x32')]['fields']));_0x1dc501[_0x2ab9('0x35')]=_0x1dc501[_0x2ab9('0x35')][_0x2ab9('0x37')]?_0x1dc501[_0x2ab9('0x35')]:_0x57396b[_0x2ab9('0x31')];if(_0x3d5ae7['query'][_0x2ab9('0x41')]){_0x1dc501[_0x2ab9('0x42')]=[{'all':!![]}];}_0x1dc501=_['merge']({},_0x1dc501,_0x3d5ae7[_0x2ab9('0x3f')]);return db[_0x2ab9('0x2d')]['find'](_0x1dc501)[_0x2ab9('0x27')](handleEntityNotFound(_0x3f5734,null))[_0x2ab9('0x27')](respondWithResult(_0x3f5734,null))[_0x2ab9('0x47')](handleError(_0x3f5734,null));};exports['create']=function(_0x242af7,_0x4dfff4){return db['ChatGroup'][_0x2ab9('0x48')](_0x242af7[_0x2ab9('0x49')],{})[_0x2ab9('0x27')](respondWithResult(_0x4dfff4,0xc9))['catch'](handleError(_0x4dfff4,null));};exports[_0x2ab9('0x4a')]=function(_0x5737e8,_0x33b934){if(_0x5737e8['body']['id']){delete _0x5737e8[_0x2ab9('0x49')]['id'];}return db[_0x2ab9('0x2d')][_0x2ab9('0x4b')]({'where':{'id':_0x5737e8[_0x2ab9('0x46')]['id']}})[_0x2ab9('0x27')](handleEntityNotFound(_0x33b934,null))['then'](saveUpdates(_0x5737e8[_0x2ab9('0x49')],null))['then'](respondWithResult(_0x33b934,null))[_0x2ab9('0x47')](handleError(_0x33b934,null));};exports['destroy']=function(_0x4b05f1,_0x3d6b9e){return db[_0x2ab9('0x2d')][_0x2ab9('0x4b')]({'where':{'id':_0x4b05f1[_0x2ab9('0x46')]['id']}})[_0x2ab9('0x27')](handleEntityNotFound(_0x3d6b9e,null))[_0x2ab9('0x27')](removeEntity(_0x3d6b9e,null))[_0x2ab9('0x47')](handleError(_0x3d6b9e,null));};exports[_0x2ab9('0x4c')]=function(_0x528193,_0x299f2f){return db[_0x2ab9('0x2d')][_0x2ab9('0x4c')]()[_0x2ab9('0x27')](respondWithResult(_0x299f2f,null))['catch'](handleError(_0x299f2f,null));};exports['getUnread']=function(_0x12ac7a,_0x2cc341,_0x1bcbad){return db['ChatInternalMessage'][_0x2ab9('0x40')]({'where':{'ChatGroupId':_0x12ac7a[_0x2ab9('0x46')]['id'],'ToId':_0x12ac7a[_0x2ab9('0x4d')]['id'],'read':![]}})['then'](function(_0x51b9c1){return{'id':_[_0x2ab9('0x4e')](_0x12ac7a['params']['id']),'count':_0x51b9c1};})['then'](respondWithResult(_0x2cc341,null))['catch'](handleError(_0x2cc341,null));};exports['addMembers']=function(_0x124d8e,_0x437614,_0x34c7c8){return db['ChatGroup'][_0x2ab9('0x4b')]({'where':{'id':_0x124d8e[_0x2ab9('0x46')]['id']}})[_0x2ab9('0x27')](handleEntityNotFound(_0x437614,null))['then'](function(_0x3ca004){if(_0x3ca004){return _0x3ca004[_0x2ab9('0x4f')](_0x124d8e[_0x2ab9('0x49')][_0x2ab9('0x50')],_[_0x2ab9('0x51')](_0x124d8e[_0x2ab9('0x49')],[_0x2ab9('0x50'),'id'])||{});}})[_0x2ab9('0x27')](respondWithResult(_0x437614,null))[_0x2ab9('0x47')](handleError(_0x437614,null));};exports[_0x2ab9('0x52')]=function(_0x2d2b2d,_0x251f4f,_0x23ee6e){var _0x13e772={};var _0x231615={};var _0x40d5de;var _0x466764;return db[_0x2ab9('0x2d')][_0x2ab9('0x53')]({'where':{'id':_0x2d2b2d[_0x2ab9('0x46')]['id']}})[_0x2ab9('0x27')](handleEntityNotFound(_0x251f4f,null))[_0x2ab9('0x27')](function(_0x178c22){if(_0x178c22){_0x40d5de=_0x178c22;_0x231615[_0x2ab9('0x31')]=_['keys'](db[_0x2ab9('0x54')][_0x2ab9('0x2e')]);_0x231615[_0x2ab9('0x32')]=_[_0x2ab9('0x33')](_0x2d2b2d['query']);_0x231615[_0x2ab9('0x3a')]=_['intersection'](_0x231615[_0x2ab9('0x31')],_0x231615['query']);_0x13e772[_0x2ab9('0x35')]=_[_0x2ab9('0x34')](_0x231615[_0x2ab9('0x31')],qs[_0x2ab9('0x36')](_0x2d2b2d[_0x2ab9('0x32')]['fields']));_0x13e772[_0x2ab9('0x35')]=_0x13e772[_0x2ab9('0x35')][_0x2ab9('0x37')]?_0x13e772[_0x2ab9('0x35')]:_0x231615[_0x2ab9('0x31')];_0x13e772['order']=qs[_0x2ab9('0x38')](_0x2d2b2d[_0x2ab9('0x32')][_0x2ab9('0x38')]);_0x13e772[_0x2ab9('0x39')]=qs[_0x2ab9('0x3a')](_['pick'](_0x2d2b2d[_0x2ab9('0x32')],_0x231615['filters']));if(_0x2d2b2d[_0x2ab9('0x32')][_0x2ab9('0x3c')]){_0x13e772[_0x2ab9('0x39')]=_[_0x2ab9('0x3d')](_0x13e772[_0x2ab9('0x39')],{'$or':_[_0x2ab9('0x2c')](_0x13e772['attributes'],function(_0x321989){var _0x367b46={};_0x367b46[_0x321989]={'$like':'%'+_0x2d2b2d[_0x2ab9('0x32')][_0x2ab9('0x3c')]+'%'};return _0x367b46;})});}_0x13e772=_['merge']({},_0x13e772,_0x2d2b2d[_0x2ab9('0x3f')]);return _0x40d5de[_0x2ab9('0x52')](_0x13e772);}})[_0x2ab9('0x27')](function(_0x10e22e){if(_0x10e22e){_0x466764=_0x10e22e[_0x2ab9('0x37')];if(!_0x2d2b2d[_0x2ab9('0x32')][_0x2ab9('0x55')](_0x2ab9('0x56'))){_0x13e772[_0x2ab9('0x20')]=qs[_0x2ab9('0x20')](_0x2d2b2d['query'][_0x2ab9('0x20')]);_0x13e772[_0x2ab9('0x22')]=qs[_0x2ab9('0x22')](_0x2d2b2d[_0x2ab9('0x32')][_0x2ab9('0x22')]);}return _0x40d5de[_0x2ab9('0x52')](_0x13e772);}})[_0x2ab9('0x27')](function(_0x141305){if(_0x141305){return _0x141305?{'count':_0x466764,'rows':_0x141305}:null;}})[_0x2ab9('0x27')](respondWithResult(_0x251f4f,null))[_0x2ab9('0x47')](handleError(_0x251f4f,null));};exports['removeMembers']=function(_0x2b476e,_0x3bceca,_0x44bd0b){return db['ChatGroup']['find']({'where':{'id':_0x2b476e['params']['id']}})['then'](handleEntityNotFound(_0x3bceca,null))['then'](function(_0x4c6516){if(_0x4c6516){return _0x4c6516[_0x2ab9('0x57')](_0x2b476e['query'][_0x2ab9('0x50')]);}})[_0x2ab9('0x27')](respondWithStatusCode(_0x3bceca,null))[_0x2ab9('0x47')](handleError(_0x3bceca,null));};exports[_0x2ab9('0x58')]=function(_0x31ff01,_0x3c0cfc,_0x55cf74){if(_0x31ff01['body']['id']){delete _0x31ff01[_0x2ab9('0x49')]['id'];}return db[_0x2ab9('0x2d')][_0x2ab9('0x4b')]({'where':{'id':_0x31ff01[_0x2ab9('0x46')]['id']}})[_0x2ab9('0x27')](handleEntityNotFound(_0x3c0cfc,null))[_0x2ab9('0x27')](function(_0x307ba8){if(_0x307ba8){_0x31ff01[_0x2ab9('0x49')][_0x2ab9('0x59')]=_0x307ba8['id'];return db['ChatInternalMessage'][_0x2ab9('0x48')](_0x31ff01[_0x2ab9('0x49')]);}})['then'](respondWithResult(_0x3c0cfc,null))[_0x2ab9('0x47')](handleError(_0x3c0cfc,null));};exports[_0x2ab9('0x5a')]=function(_0x4cadbd,_0x4f8c53,_0x576865){var _0x2e02d0={};var _0x234db6={};var _0x15a347;var _0x36fae0;return db[_0x2ab9('0x2d')]['findOne']({'where':{'id':_0x4cadbd['params']['id']}})[_0x2ab9('0x27')](handleEntityNotFound(_0x4f8c53,null))[_0x2ab9('0x27')](function(_0x36562e){if(_0x36562e){_0x15a347=_0x36562e;_0x234db6[_0x2ab9('0x31')]=_['keys'](db[_0x2ab9('0x5b')]['rawAttributes']);_0x234db6[_0x2ab9('0x32')]=_[_0x2ab9('0x33')](_0x4cadbd[_0x2ab9('0x32')]);_0x234db6[_0x2ab9('0x3a')]=_['intersection'](_0x234db6[_0x2ab9('0x31')],_0x234db6[_0x2ab9('0x32')]);_0x2e02d0[_0x2ab9('0x35')]=_[_0x2ab9('0x34')](_0x234db6[_0x2ab9('0x31')],qs[_0x2ab9('0x36')](_0x4cadbd[_0x2ab9('0x32')][_0x2ab9('0x36')]));_0x2e02d0[_0x2ab9('0x35')]=_0x2e02d0[_0x2ab9('0x35')][_0x2ab9('0x37')]?_0x2e02d0[_0x2ab9('0x35')]:_0x234db6[_0x2ab9('0x31')];_0x2e02d0[_0x2ab9('0x5c')]=qs[_0x2ab9('0x38')](_0x4cadbd['query'][_0x2ab9('0x38')]);_0x2e02d0[_0x2ab9('0x39')]=qs[_0x2ab9('0x3a')](_[_0x2ab9('0x3b')](_0x4cadbd['query'],_0x234db6['filters']));if(_0x4cadbd['query'][_0x2ab9('0x3c')]){_0x2e02d0['where']=_['merge'](_0x2e02d0[_0x2ab9('0x39')],{'$or':_[_0x2ab9('0x2c')](_0x2e02d0['attributes'],function(_0x6af8ed){var _0x37309a={};_0x37309a[_0x6af8ed]={'$like':'%'+_0x4cadbd['query'][_0x2ab9('0x3c')]+'%'};return _0x37309a;})});}if(_0x4cadbd['query'][_0x2ab9('0x5d')]){var _0x3b95d8=_0x4cadbd[_0x2ab9('0x32')][_0x2ab9('0x5d')][_0x2ab9('0x5e')](',');var _0x3d008a={};_0x3d008a[_0x3b95d8[0x0]]={'$gte':moment(_0x3b95d8[0x1])[_0x2ab9('0x5f')](_0x2ab9('0x60'))};_0x2e02d0[_0x2ab9('0x39')]=_[_0x2ab9('0x3d')](_0x2e02d0[_0x2ab9('0x39')],_0x3d008a);}_0x2e02d0=_[_0x2ab9('0x3d')]({},_0x2e02d0,_0x4cadbd['options']);return _0x15a347[_0x2ab9('0x5a')](_0x2e02d0);}})[_0x2ab9('0x27')](function(_0x36b0a0){if(_0x36b0a0){_0x36fae0=_0x36b0a0[_0x2ab9('0x37')];if(!_0x4cadbd[_0x2ab9('0x32')][_0x2ab9('0x55')](_0x2ab9('0x56'))){_0x2e02d0[_0x2ab9('0x20')]=qs[_0x2ab9('0x20')](_0x4cadbd['query']['limit']);_0x2e02d0[_0x2ab9('0x22')]=qs[_0x2ab9('0x22')](_0x4cadbd['query'][_0x2ab9('0x22')]);}return _0x15a347[_0x2ab9('0x5a')](_0x2e02d0);}})[_0x2ab9('0x27')](function(_0x436e7a){if(_0x436e7a){return _0x436e7a?{'count':_0x36fae0,'rows':_0x436e7a}:null;}})[_0x2ab9('0x27')](respondWithResult(_0x4f8c53,null))[_0x2ab9('0x47')](handleError(_0x4f8c53,null));};
\ No newline at end of file
+var _0x1e59=['hasOwnProperty','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','create','body','update','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','order','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','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','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','then','destroy','sendStatus','error','stack','name','send','ChatGroup','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length'];(function(_0xf3e4a0,_0x16a172){var _0x43f1cc=function(_0x3abdf5){while(--_0x3abdf5){_0xf3e4a0['push'](_0xf3e4a0['shift']());}};_0x43f1cc(++_0x16a172);}(_0x1e59,0x8d));var _0x91e5=function(_0x416292,_0xa8dc84){_0x416292=_0x416292-0x0;var _0x126220=_0x1e59[_0x416292];return _0x126220;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x91e5('0x0'));var zipdir=require(_0x91e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91e5('0x2'));var moment=require(_0x91e5('0x3'));var BPromise=require(_0x91e5('0x4'));var Mustache=require(_0x91e5('0x5'));var util=require(_0x91e5('0x6'));var path=require(_0x91e5('0x7'));var sox=require('sox');var csv=require(_0x91e5('0x8'));var ejs=require(_0x91e5('0x9'));var fs=require('fs');var fs_extra=require(_0x91e5('0xa'));var _=require(_0x91e5('0xb'));var squel=require(_0x91e5('0xc'));var crypto=require(_0x91e5('0xd'));var jsforce=require(_0x91e5('0xe'));var deskjs=require(_0x91e5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x91e5('0x10'));var Papa=require(_0x91e5('0x11'));var Redis=require(_0x91e5('0x12'));var authService=require(_0x91e5('0x13'));var qs=require(_0x91e5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91e5('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x91e5('0x16'));var config=require(_0x91e5('0x17'));var licenseUtil=require(_0x91e5('0x18'));var db=require(_0x91e5('0x19'))['db'];config[_0x91e5('0x1a')]=_[_0x91e5('0x1b')](config[_0x91e5('0x1a')],{'host':_0x91e5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91e5('0x1a')]));require(_0x91e5('0x1d'))[_0x91e5('0x1e')](socket);function respondWithStatusCode(_0x285b55,_0x2054d7){_0x2054d7=_0x2054d7||0xcc;return function(_0x21aa75){if(_0x21aa75){return _0x285b55['sendStatus'](_0x2054d7);}return _0x285b55[_0x91e5('0x1f')](_0x2054d7)[_0x91e5('0x20')]();};}function respondWithResult(_0x3c9bbc,_0x1cc5fc){_0x1cc5fc=_0x1cc5fc||0xc8;return function(_0x4e8ba1){if(_0x4e8ba1){return _0x3c9bbc['status'](_0x1cc5fc)[_0x91e5('0x21')](_0x4e8ba1);}};}function respondWithFilteredResult(_0x496180,_0x1c5977){return function(_0x5c06a6){if(_0x5c06a6){var _0x286bb2=typeof _0x1c5977['offset']==='undefined'&&typeof _0x1c5977['limit']===_0x91e5('0x22');var _0x508850=_0x5c06a6[_0x91e5('0x23')];var _0x30f081=_0x286bb2?0x0:_0x1c5977[_0x91e5('0x24')];var _0x5e0419=_0x286bb2?_0x5c06a6['count']:_0x1c5977[_0x91e5('0x24')]+_0x1c5977[_0x91e5('0x25')];var _0x22e7c5;if(_0x5e0419>=_0x508850){_0x5e0419=_0x508850;_0x22e7c5=0xc8;}else{_0x22e7c5=0xce;}_0x496180[_0x91e5('0x1f')](_0x22e7c5);return _0x496180[_0x91e5('0x26')](_0x91e5('0x27'),_0x30f081+'-'+_0x5e0419+'/'+_0x508850)['json'](_0x5c06a6);}return null;};}function patchUpdates(_0x550d07){return function(_0x1a8e62){try{jsonpatch[_0x91e5('0x28')](_0x1a8e62,_0x550d07,!![]);}catch(_0x3526c7){return BPromise['reject'](_0x3526c7);}return _0x1a8e62['save']();};}function saveUpdates(_0x39bc29,_0x1fc69f){return function(_0x4d7fe2){if(_0x4d7fe2){return _0x4d7fe2['update'](_0x39bc29)[_0x91e5('0x29')](function(_0x232ad7){return _0x232ad7;});}return null;};}function removeEntity(_0x5200e4,_0x50a16f){return function(_0x321fee){if(_0x321fee){return _0x321fee[_0x91e5('0x2a')]()['then'](function(){_0x5200e4[_0x91e5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195fe0,_0x5c808f){return function(_0x15dd47){if(!_0x15dd47){_0x195fe0[_0x91e5('0x2b')](0x194);}return _0x15dd47;};}function handleError(_0x7a74af,_0x5651cf){_0x5651cf=_0x5651cf||0x1f4;return function(_0x265bf6){logger[_0x91e5('0x2c')](_0x265bf6[_0x91e5('0x2d')]);if(_0x265bf6[_0x91e5('0x2e')]){delete _0x265bf6[_0x91e5('0x2e')];}_0x7a74af[_0x91e5('0x1f')](_0x5651cf)[_0x91e5('0x2f')](_0x265bf6);};}exports['index']=function(_0x1163a6,_0x25244e){var _0x2e8bf0={},_0x2aadc3={},_0x211047={'count':0x0,'rows':[]};var _0x2ac9a1=_['map'](db[_0x91e5('0x30')][_0x91e5('0x31')],function(_0x18c89d){return{'name':_0x18c89d[_0x91e5('0x32')],'type':_0x18c89d[_0x91e5('0x33')]['key']};});_0x2aadc3[_0x91e5('0x34')]=_['map'](_0x2ac9a1,'name');_0x2aadc3[_0x91e5('0x35')]=_[_0x91e5('0x36')](_0x1163a6['query']);_0x2aadc3['filters']=_[_0x91e5('0x37')](_0x2aadc3['model'],_0x2aadc3[_0x91e5('0x35')]);_0x2e8bf0['attributes']=_[_0x91e5('0x37')](_0x2aadc3[_0x91e5('0x34')],qs[_0x91e5('0x38')](_0x1163a6['query'][_0x91e5('0x38')]));_0x2e8bf0[_0x91e5('0x39')]=_0x2e8bf0[_0x91e5('0x39')][_0x91e5('0x3a')]?_0x2e8bf0[_0x91e5('0x39')]:_0x2aadc3[_0x91e5('0x34')];if(!_0x1163a6['query'][_0x91e5('0x3b')]('nolimit')){_0x2e8bf0['limit']=qs[_0x91e5('0x25')](_0x1163a6['query'][_0x91e5('0x25')]);_0x2e8bf0[_0x91e5('0x24')]=qs[_0x91e5('0x24')](_0x1163a6[_0x91e5('0x35')][_0x91e5('0x24')]);}_0x2e8bf0['order']=qs['sort'](_0x1163a6[_0x91e5('0x35')][_0x91e5('0x3c')]);_0x2e8bf0[_0x91e5('0x3d')]=qs['filters'](_[_0x91e5('0x3e')](_0x1163a6[_0x91e5('0x35')],_0x2aadc3[_0x91e5('0x3f')]),_0x2ac9a1);if(_0x1163a6[_0x91e5('0x35')][_0x91e5('0x40')]){_0x2e8bf0['where']=_[_0x91e5('0x41')](_0x2e8bf0[_0x91e5('0x3d')],{'$or':_[_0x91e5('0x42')](_0x2ac9a1,function(_0x112ddd){if(_0x112ddd[_0x91e5('0x33')]!==_0x91e5('0x43')){var _0x154897={};_0x154897[_0x112ddd[_0x91e5('0x2e')]]={'$like':'%'+_0x1163a6[_0x91e5('0x35')][_0x91e5('0x40')]+'%'};return _0x154897;}})});}_0x2e8bf0=_[_0x91e5('0x41')]({},_0x2e8bf0,_0x1163a6[_0x91e5('0x44')]);var _0x2a999c={'where':_0x2e8bf0[_0x91e5('0x3d')]};return db['ChatGroup']['count'](_0x2a999c)['then'](function(_0x27f7cf){_0x211047[_0x91e5('0x23')]=_0x27f7cf;if(_0x1163a6[_0x91e5('0x35')][_0x91e5('0x45')]){_0x2e8bf0[_0x91e5('0x46')]=[{'all':!![]}];}return db[_0x91e5('0x30')][_0x91e5('0x47')](_0x2e8bf0);})['then'](function(_0x3af49e){_0x211047[_0x91e5('0x48')]=_0x3af49e;return _0x211047;})[_0x91e5('0x29')](respondWithFilteredResult(_0x25244e,_0x2e8bf0))['catch'](handleError(_0x25244e,null));};exports[_0x91e5('0x49')]=function(_0x429390,_0x4d3b34){var _0x4890c1={'raw':!![],'where':{'id':_0x429390['params']['id']}},_0x10af8a={};_0x10af8a[_0x91e5('0x34')]=_[_0x91e5('0x36')](db[_0x91e5('0x30')][_0x91e5('0x31')]);_0x10af8a[_0x91e5('0x35')]=_[_0x91e5('0x36')](_0x429390['query']);_0x10af8a[_0x91e5('0x3f')]=_[_0x91e5('0x37')](_0x10af8a['model'],_0x10af8a[_0x91e5('0x35')]);_0x4890c1[_0x91e5('0x39')]=_[_0x91e5('0x37')](_0x10af8a[_0x91e5('0x34')],qs[_0x91e5('0x38')](_0x429390[_0x91e5('0x35')][_0x91e5('0x38')]));_0x4890c1[_0x91e5('0x39')]=_0x4890c1['attributes']['length']?_0x4890c1[_0x91e5('0x39')]:_0x10af8a['model'];if(_0x429390[_0x91e5('0x35')][_0x91e5('0x45')]){_0x4890c1[_0x91e5('0x46')]=[{'all':!![]}];}_0x4890c1=_[_0x91e5('0x41')]({},_0x4890c1,_0x429390[_0x91e5('0x44')]);return db[_0x91e5('0x30')]['find'](_0x4890c1)[_0x91e5('0x29')](handleEntityNotFound(_0x4d3b34,null))[_0x91e5('0x29')](respondWithResult(_0x4d3b34,null))[_0x91e5('0x4a')](handleError(_0x4d3b34,null));};exports[_0x91e5('0x4b')]=function(_0x36c269,_0x849343){return db['ChatGroup'][_0x91e5('0x4b')](_0x36c269[_0x91e5('0x4c')],{})[_0x91e5('0x29')](respondWithResult(_0x849343,0xc9))[_0x91e5('0x4a')](handleError(_0x849343,null));};exports[_0x91e5('0x4d')]=function(_0x4c8a42,_0x1ec55a){if(_0x4c8a42[_0x91e5('0x4c')]['id']){delete _0x4c8a42['body']['id'];}return db[_0x91e5('0x30')][_0x91e5('0x4e')]({'where':{'id':_0x4c8a42[_0x91e5('0x4f')]['id']}})[_0x91e5('0x29')](handleEntityNotFound(_0x1ec55a,null))[_0x91e5('0x29')](saveUpdates(_0x4c8a42[_0x91e5('0x4c')],null))[_0x91e5('0x29')](respondWithResult(_0x1ec55a,null))[_0x91e5('0x4a')](handleError(_0x1ec55a,null));};exports[_0x91e5('0x2a')]=function(_0x5834be,_0xb74bc6){return db[_0x91e5('0x30')][_0x91e5('0x4e')]({'where':{'id':_0x5834be[_0x91e5('0x4f')]['id']}})['then'](handleEntityNotFound(_0xb74bc6,null))['then'](removeEntity(_0xb74bc6,null))[_0x91e5('0x4a')](handleError(_0xb74bc6,null));};exports[_0x91e5('0x50')]=function(_0x49dc74,_0x5becb8){return db[_0x91e5('0x30')][_0x91e5('0x50')]()[_0x91e5('0x29')](respondWithResult(_0x5becb8,null))[_0x91e5('0x4a')](handleError(_0x5becb8,null));};exports[_0x91e5('0x51')]=function(_0x40dcda,_0x4f6809,_0x34dee1){return db[_0x91e5('0x52')][_0x91e5('0x23')]({'where':{'ChatGroupId':_0x40dcda[_0x91e5('0x4f')]['id'],'ToId':_0x40dcda[_0x91e5('0x53')]['id'],'read':![]}})['then'](function(_0x599d8d){return{'id':_[_0x91e5('0x54')](_0x40dcda['params']['id']),'count':_0x599d8d};})[_0x91e5('0x29')](respondWithResult(_0x4f6809,null))[_0x91e5('0x4a')](handleError(_0x4f6809,null));};exports['addMembers']=function(_0x2a7b5b,_0x39f215,_0xf504d6){return db[_0x91e5('0x30')][_0x91e5('0x4e')]({'where':{'id':_0x2a7b5b[_0x91e5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39f215,null))[_0x91e5('0x29')](function(_0x345115){if(_0x345115){return _0x345115[_0x91e5('0x55')](_0x2a7b5b[_0x91e5('0x4c')][_0x91e5('0x56')],_[_0x91e5('0x57')](_0x2a7b5b[_0x91e5('0x4c')],[_0x91e5('0x56'),'id'])||{});}})[_0x91e5('0x29')](respondWithResult(_0x39f215,null))[_0x91e5('0x4a')](handleError(_0x39f215,null));};exports[_0x91e5('0x58')]=function(_0x347670,_0x4fedbc,_0x40263b){var _0x2052d3={};var _0xc1895e={};var _0x40f6ec;var _0x2380e8;return db['ChatGroup']['findOne']({'where':{'id':_0x347670['params']['id']}})[_0x91e5('0x29')](handleEntityNotFound(_0x4fedbc,null))[_0x91e5('0x29')](function(_0x8a436e){if(_0x8a436e){_0x40f6ec=_0x8a436e;_0xc1895e[_0x91e5('0x34')]=_[_0x91e5('0x36')](db[_0x91e5('0x59')][_0x91e5('0x31')]);_0xc1895e[_0x91e5('0x35')]=_[_0x91e5('0x36')](_0x347670[_0x91e5('0x35')]);_0xc1895e['filters']=_['intersection'](_0xc1895e[_0x91e5('0x34')],_0xc1895e[_0x91e5('0x35')]);_0x2052d3[_0x91e5('0x39')]=_[_0x91e5('0x37')](_0xc1895e[_0x91e5('0x34')],qs['fields'](_0x347670[_0x91e5('0x35')][_0x91e5('0x38')]));_0x2052d3['attributes']=_0x2052d3[_0x91e5('0x39')]['length']?_0x2052d3[_0x91e5('0x39')]:_0xc1895e[_0x91e5('0x34')];_0x2052d3[_0x91e5('0x5a')]=qs[_0x91e5('0x3c')](_0x347670[_0x91e5('0x35')][_0x91e5('0x3c')]);_0x2052d3[_0x91e5('0x3d')]=qs[_0x91e5('0x3f')](_[_0x91e5('0x3e')](_0x347670['query'],_0xc1895e[_0x91e5('0x3f')]));if(_0x347670['query'][_0x91e5('0x40')]){_0x2052d3[_0x91e5('0x3d')]=_[_0x91e5('0x41')](_0x2052d3[_0x91e5('0x3d')],{'$or':_['map'](_0x2052d3[_0x91e5('0x39')],function(_0x1b53b2){var _0xbe0303={};_0xbe0303[_0x1b53b2]={'$like':'%'+_0x347670[_0x91e5('0x35')][_0x91e5('0x40')]+'%'};return _0xbe0303;})});}_0x2052d3=_[_0x91e5('0x41')]({},_0x2052d3,_0x347670['options']);return _0x40f6ec[_0x91e5('0x58')](_0x2052d3);}})[_0x91e5('0x29')](function(_0x7f887){if(_0x7f887){_0x2380e8=_0x7f887['length'];if(!_0x347670[_0x91e5('0x35')][_0x91e5('0x3b')](_0x91e5('0x5b'))){_0x2052d3[_0x91e5('0x25')]=qs[_0x91e5('0x25')](_0x347670['query'][_0x91e5('0x25')]);_0x2052d3[_0x91e5('0x24')]=qs[_0x91e5('0x24')](_0x347670[_0x91e5('0x35')]['offset']);}return _0x40f6ec[_0x91e5('0x58')](_0x2052d3);}})['then'](function(_0xb709f8){if(_0xb709f8){return _0xb709f8?{'count':_0x2380e8,'rows':_0xb709f8}:null;}})[_0x91e5('0x29')](respondWithResult(_0x4fedbc,null))[_0x91e5('0x4a')](handleError(_0x4fedbc,null));};exports[_0x91e5('0x5c')]=function(_0x35eee2,_0x1f8f17,_0x36283a){return db['ChatGroup']['find']({'where':{'id':_0x35eee2['params']['id']}})['then'](handleEntityNotFound(_0x1f8f17,null))[_0x91e5('0x29')](function(_0x261ac9){if(_0x261ac9){return _0x261ac9['removeMembers'](_0x35eee2[_0x91e5('0x35')]['ids']);}})[_0x91e5('0x29')](respondWithStatusCode(_0x1f8f17,null))['catch'](handleError(_0x1f8f17,null));};exports[_0x91e5('0x5d')]=function(_0x521f67,_0x4a78b2,_0x509e6e){if(_0x521f67['body']['id']){delete _0x521f67[_0x91e5('0x4c')]['id'];}return db[_0x91e5('0x30')][_0x91e5('0x4e')]({'where':{'id':_0x521f67[_0x91e5('0x4f')]['id']}})[_0x91e5('0x29')](handleEntityNotFound(_0x4a78b2,null))['then'](function(_0x2f38bb){if(_0x2f38bb){_0x521f67[_0x91e5('0x4c')][_0x91e5('0x5e')]=_0x2f38bb['id'];return db[_0x91e5('0x52')]['create'](_0x521f67[_0x91e5('0x4c')]);}})[_0x91e5('0x29')](respondWithResult(_0x4a78b2,null))[_0x91e5('0x4a')](handleError(_0x4a78b2,null));};exports[_0x91e5('0x5f')]=function(_0x17267,_0x4fcbc8,_0x1c953b){var _0x44ce9c={};var _0xa1cf8a={};var _0xb5d90b;var _0x17047b;return db[_0x91e5('0x30')][_0x91e5('0x60')]({'where':{'id':_0x17267[_0x91e5('0x4f')]['id']}})[_0x91e5('0x29')](handleEntityNotFound(_0x4fcbc8,null))[_0x91e5('0x29')](function(_0x54c94a){if(_0x54c94a){_0xb5d90b=_0x54c94a;_0xa1cf8a[_0x91e5('0x34')]=_[_0x91e5('0x36')](db['ChatInternalMessage']['rawAttributes']);_0xa1cf8a[_0x91e5('0x35')]=_[_0x91e5('0x36')](_0x17267[_0x91e5('0x35')]);_0xa1cf8a[_0x91e5('0x3f')]=_[_0x91e5('0x37')](_0xa1cf8a['model'],_0xa1cf8a[_0x91e5('0x35')]);_0x44ce9c[_0x91e5('0x39')]=_['intersection'](_0xa1cf8a[_0x91e5('0x34')],qs[_0x91e5('0x38')](_0x17267[_0x91e5('0x35')][_0x91e5('0x38')]));_0x44ce9c[_0x91e5('0x39')]=_0x44ce9c[_0x91e5('0x39')][_0x91e5('0x3a')]?_0x44ce9c[_0x91e5('0x39')]:_0xa1cf8a[_0x91e5('0x34')];_0x44ce9c[_0x91e5('0x5a')]=qs['sort'](_0x17267[_0x91e5('0x35')][_0x91e5('0x3c')]);_0x44ce9c[_0x91e5('0x3d')]=qs[_0x91e5('0x3f')](_[_0x91e5('0x3e')](_0x17267[_0x91e5('0x35')],_0xa1cf8a[_0x91e5('0x3f')]));if(_0x17267[_0x91e5('0x35')][_0x91e5('0x40')]){_0x44ce9c[_0x91e5('0x3d')]=_['merge'](_0x44ce9c['where'],{'$or':_[_0x91e5('0x42')](_0x44ce9c[_0x91e5('0x39')],function(_0x151677){var _0x4125de={};_0x4125de[_0x151677]={'$like':'%'+_0x17267[_0x91e5('0x35')][_0x91e5('0x40')]+'%'};return _0x4125de;})});}if(_0x17267[_0x91e5('0x35')][_0x91e5('0x61')]){var _0x119787=_0x17267[_0x91e5('0x35')][_0x91e5('0x61')]['split'](',');var _0x1c6813={};_0x1c6813[_0x119787[0x0]]={'$gte':moment(_0x119787[0x1])[_0x91e5('0x62')](_0x91e5('0x63'))};_0x44ce9c[_0x91e5('0x3d')]=_['merge'](_0x44ce9c[_0x91e5('0x3d')],_0x1c6813);}_0x44ce9c=_['merge']({},_0x44ce9c,_0x17267['options']);return _0xb5d90b[_0x91e5('0x5f')](_0x44ce9c);}})[_0x91e5('0x29')](function(_0x2ddc55){if(_0x2ddc55){_0x17047b=_0x2ddc55[_0x91e5('0x3a')];if(!_0x17267[_0x91e5('0x35')][_0x91e5('0x3b')](_0x91e5('0x5b'))){_0x44ce9c[_0x91e5('0x25')]=qs[_0x91e5('0x25')](_0x17267[_0x91e5('0x35')][_0x91e5('0x25')]);_0x44ce9c[_0x91e5('0x24')]=qs['offset'](_0x17267[_0x91e5('0x35')][_0x91e5('0x24')]);}return _0xb5d90b[_0x91e5('0x5f')](_0x44ce9c);}})['then'](function(_0x34dd33){if(_0x34dd33){return _0x34dd33?{'count':_0x17047b,'rows':_0x34dd33}:null;}})['then'](respondWithResult(_0x4fcbc8,null))[_0x91e5('0x4a')](handleError(_0x4fcbc8,null));};
\ No newline at end of file
index 2339163..1683605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd0a=['emit','hasOwnProperty','hook','events','ChatGroup','remove'];(function(_0xed17b4,_0x363d4b){var _0xab2c34=function(_0x2c26b3){while(--_0x2c26b3){_0xed17b4['push'](_0xed17b4['shift']());}};_0xab2c34(++_0x363d4b);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x54b5f9,_0x2eecd4){_0x54b5f9=_0x54b5f9-0x0;var _0x4dfea5=_0xbd0a[_0x54b5f9];return _0x4dfea5;};'use strict';var EventEmitter=require(_0xabd0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xabd0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xabd0('0x2')};function emitEvent(_0x38111b){return function(_0x41e52b,_0x3d1138,_0x1a4ff4){ChatGroupEvents[_0xabd0('0x3')](_0x38111b+':'+_0x41e52b['id'],_0x41e52b);ChatGroupEvents[_0xabd0('0x3')](_0x38111b,_0x41e52b);_0x1a4ff4(null);};}for(var e in events){if(events[_0xabd0('0x4')](e)){var event=events[e];ChatGroup[_0xabd0('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x7eb7=['update','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners'];(function(_0x3753aa,_0x36d6e9){var _0x923c4e=function(_0xa5485c){while(--_0xa5485c){_0x3753aa['push'](_0x3753aa['shift']());}};_0x923c4e(++_0x36d6e9);}(_0x7eb7,0xfd));var _0x77eb=function(_0x31ffe1,_0x53716f){_0x31ffe1=_0x31ffe1-0x0;var _0x1ad1e4=_0x7eb7[_0x31ffe1];return _0x1ad1e4;};'use strict';var EventEmitter=require(_0x77eb('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x77eb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x77eb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77eb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x410944){return function(_0x432b00,_0x345cc3,_0x23a2c2){ChatGroupEvents[_0x77eb('0x4')](_0x410944+':'+_0x432b00['id'],_0x432b00);ChatGroupEvents[_0x77eb('0x4')](_0x410944,_0x432b00);_0x23a2c2(null);};}for(var e in events){if(events[_0x77eb('0x5')](e)){var event=events[e];ChatGroup[_0x77eb('0x6')](e,emitEvent(event));}}module[_0x77eb('0x7')]=ChatGroupEvents;
\ No newline at end of file
index f4d47c3..fb89ad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb19e=['util','rimraf','./chatGroup.attributes','exports','define','chat_groups','lodash'];(function(_0x5f3f95,_0x3f9d77){var _0x4d1819=function(_0x158fc0){while(--_0x158fc0){_0x5f3f95['push'](_0x5f3f95['shift']());}};_0x4d1819(++_0x3f9d77);}(_0xb19e,0x1e9));var _0xeb19=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xb19e[_0x1b1e76];return _0x3d743a;};'use strict';var _=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb19('0x2'));var config=require('../../config/environment');var attributes=require(_0xeb19('0x3'));module[_0xeb19('0x4')]=function(_0x53da2a,_0x2a7bf0){return _0x53da2a[_0xeb19('0x5')]('ChatGroup',attributes,{'tableName':_0xeb19('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ddc=['lodash','util','api','moment','path','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup'];(function(_0x3468f9,_0x28d5d2){var _0x9ca177=function(_0x50eee2){while(--_0x50eee2){_0x3468f9['push'](_0x3468f9['shift']());}};_0x9ca177(++_0x28d5d2);}(_0x9ddc,0x117));var _0xc9dd=function(_0x2f2a0d,_0x5d1976){_0x2f2a0d=_0x2f2a0d-0x0;var _0x823f5e=_0x9ddc[_0x2f2a0d];return _0x823f5e;};'use strict';var _=require(_0xc9dd('0x0'));var util=require(_0xc9dd('0x1'));var logger=require('../../config/logger')(_0xc9dd('0x2'));var moment=require(_0xc9dd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9dd('0x4'));var rimraf=require(_0xc9dd('0x5'));var config=require(_0xc9dd('0x6'));var attributes=require(_0xc9dd('0x7'));module['exports']=function(_0x58ccba,_0x5f5183){return _0x58ccba['define'](_0xc9dd('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 842e248..c8971c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1360=['request\x20sent','debug','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1360,0xd6));var _0x0136=function(_0x5a03fa,_0xcf3275){_0x5a03fa=_0x5a03fa-0x0;var _0x29e6c2=_0x1360[_0x5a03fa];return _0x29e6c2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0136('0x0'));var BPromise=require(_0x0136('0x1'));var rs=require(_0x0136('0x2'));var fs=require('fs');var Redis=require(_0x0136('0x3'));var db=require(_0x0136('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0136('0x5'))(_0x0136('0x6'));var config=require(_0x0136('0x7'));var jayson=require(_0x0136('0x8'));var client=jayson[_0x0136('0x9')][_0x0136('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0136('0xb')],{'host':_0x0136('0xc'),'port':0x18eb});var socket=require(_0x0136('0xd'))(new Redis(config[_0x0136('0xb')]));require(_0x0136('0xe'))[_0x0136('0xf')](socket);function respondWithRpcPromise(_0x1a6998,_0x16c9ee,_0x23bb49){return new BPromise(function(_0x1453f3,_0x5cdd79){return client[_0x0136('0x10')](_0x1a6998,_0x23bb49)[_0x0136('0x11')](function(_0x1f89fb){logger[_0x0136('0x12')](_0x0136('0x13'),_0x16c9ee,_0x0136('0x14'));logger[_0x0136('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x16c9ee,'request\x20sent',JSON['stringify'](_0x1f89fb));if(_0x1f89fb[_0x0136('0x16')]){if(_0x1f89fb[_0x0136('0x16')][_0x0136('0x17')]===0x1f4){logger[_0x0136('0x16')](_0x0136('0x13'),_0x16c9ee,_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);return _0x5cdd79(_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);}logger[_0x0136('0x16')]('ChatGroup,\x20%s,\x20%s',_0x16c9ee,_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);return _0x1453f3(_0x1f89fb['error'][_0x0136('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x16c9ee,_0x0136('0x14'));_0x1453f3(_0x1f89fb[_0x0136('0x19')]['message']);}})['catch'](function(_0x3d7595){logger['error']('ChatGroup,\x20%s,\x20%s',_0x16c9ee,_0x3d7595);_0x5cdd79(_0x3d7595);});});}
\ No newline at end of file
+var _0x6753=['error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ee953,_0x4540cd){var _0x3d38e5=function(_0x3ff362){while(--_0x3ff362){_0x2ee953['push'](_0x2ee953['shift']());}};_0x3d38e5(++_0x4540cd);}(_0x6753,0xa1));var _0x3675=function(_0x9f9d94,_0x4706ac){_0x9f9d94=_0x9f9d94-0x0;var _0x45ac4b=_0x6753[_0x9f9d94];return _0x45ac4b;};'use strict';var _=require(_0x3675('0x0'));var util=require(_0x3675('0x1'));var moment=require(_0x3675('0x2'));var BPromise=require(_0x3675('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3675('0x4'));var db=require(_0x3675('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3675('0x6'))(_0x3675('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3675('0x8')]({'port':0x232a});config[_0x3675('0x9')]=_[_0x3675('0xa')](config[_0x3675('0x9')],{'host':_0x3675('0xb'),'port':0x18eb});var socket=require(_0x3675('0xc'))(new Redis(config[_0x3675('0x9')]));require(_0x3675('0xd'))[_0x3675('0xe')](socket);function respondWithRpcPromise(_0x1d5d32,_0xa191a5,_0x2a8748){return new BPromise(function(_0x4441b8,_0x420ffa){return client['request'](_0x1d5d32,_0x2a8748)[_0x3675('0xf')](function(_0x173473){logger['info'](_0x3675('0x10'),_0xa191a5,_0x3675('0x11'));logger[_0x3675('0x12')](_0x3675('0x13'),_0xa191a5,_0x3675('0x11'),JSON[_0x3675('0x14')](_0x173473));if(_0x173473[_0x3675('0x15')]){if(_0x173473['error'][_0x3675('0x16')]===0x1f4){logger[_0x3675('0x15')](_0x3675('0x10'),_0xa191a5,_0x173473[_0x3675('0x15')]['message']);return _0x420ffa(_0x173473[_0x3675('0x15')][_0x3675('0x17')]);}logger[_0x3675('0x15')](_0x3675('0x10'),_0xa191a5,_0x173473['error'][_0x3675('0x17')]);return _0x4441b8(_0x173473[_0x3675('0x15')][_0x3675('0x17')]);}else{logger[_0x3675('0x18')](_0x3675('0x10'),_0xa191a5,'request\x20sent');_0x4441b8(_0x173473[_0x3675('0x19')][_0x3675('0x17')]);}})['catch'](function(_0xe9f968){logger['error'](_0x3675('0x10'),_0xa191a5,_0xe9f968);_0x420ffa(_0xe9f968);});});}
\ No newline at end of file
index 436f2bb..783b991 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec5=['length','./chatGroup.events','remove','update','emit','register'];(function(_0x1527c1,_0x1ffc7d){var _0x36f9c2=function(_0x5ee4fe){while(--_0x5ee4fe){_0x1527c1['push'](_0x1527c1['shift']());}};_0x36f9c2(++_0x1ffc7d);}(_0xeec5,0xfd));var _0x5eec=function(_0x3727a2,_0x2837aa){_0x3727a2=_0x3727a2-0x0;var _0x58d086=_0xeec5[_0x3727a2];return _0x58d086;};'use strict';var ChatGroupEvents=require(_0x5eec('0x0'));var events=['save',_0x5eec('0x1'),_0x5eec('0x2')];function createListener(_0x3009fd,_0x458272){return function(_0x484cdf){_0x458272[_0x5eec('0x3')](_0x3009fd,_0x484cdf);};}function removeListener(_0x2414e5,_0x5edf33){return function(){ChatGroupEvents['removeListener'](_0x2414e5,_0x5edf33);};}exports[_0x5eec('0x4')]=function(_0x5e9af2){for(var _0x144972=0x0,_0x5ce853=events[_0x5eec('0x5')];_0x144972<_0x5ce853;_0x144972++){var _0x5a821e=events[_0x144972];var _0x2a523e=createListener('chatGroup:'+_0x5a821e,_0x5e9af2);ChatGroupEvents['on'](_0x5a821e,_0x2a523e);}};
\ No newline at end of file
+var _0x28ff=['./chatGroup.events','save','remove','update','removeListener','chatGroup:'];(function(_0x4c00c8,_0xa33951){var _0x165e0d=function(_0x2c210d){while(--_0x2c210d){_0x4c00c8['push'](_0x4c00c8['shift']());}};_0x165e0d(++_0xa33951);}(_0x28ff,0x1bc));var _0xf28f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x28ff[_0x397e5f];return _0x5302b8;};'use strict';var ChatGroupEvents=require(_0xf28f('0x0'));var events=[_0xf28f('0x1'),_0xf28f('0x2'),_0xf28f('0x3')];function createListener(_0x1430dd,_0x354b4b){return function(_0x31a44a){_0x354b4b['emit'](_0x1430dd,_0x31a44a);};}function removeListener(_0x10a81b,_0x3d15c5){return function(){ChatGroupEvents[_0xf28f('0x4')](_0x10a81b,_0x3d15c5);};}exports['register']=function(_0x3a7ecc){for(var _0x4369a1=0x0,_0x556920=events['length'];_0x4369a1<_0x556920;_0x4369a1++){var _0x59ef34=events[_0x4369a1];var _0x234782=createListener(_0xf28f('0x5')+_0x59ef34,_0x3a7ecc);ChatGroupEvents['on'](_0x59ef34,_0x234782);}};
\ No newline at end of file
index 1987d66..1738c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9081=['destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','put','update','delete'];(function(_0x5bb962,_0x2bd9e8){var _0x576a46=function(_0x148bbc){while(--_0x148bbc){_0x5bb962['push'](_0x5bb962['shift']());}};_0x576a46(++_0x2bd9e8);}(_0x9081,0x189));var _0x1908=function(_0x531e98,_0x51f22d){_0x531e98=_0x531e98-0x0;var _0x4e2516=_0x9081[_0x531e98];return _0x4e2516;};'use strict';var multer=require(_0x1908('0x0'));var util=require(_0x1908('0x1'));var path=require(_0x1908('0x2'));var timeout=require(_0x1908('0x3'));var express=require(_0x1908('0x4'));var router=express[_0x1908('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1908('0x6'));var interaction=require(_0x1908('0x7'));var config=require(_0x1908('0x8'));var controller=require(_0x1908('0x9'));router[_0x1908('0xa')]('/',auth[_0x1908('0xb')](),controller[_0x1908('0xc')]);router['get'](_0x1908('0xd'),auth[_0x1908('0xb')](),controller[_0x1908('0xe')]);router[_0x1908('0xa')](_0x1908('0xf'),auth[_0x1908('0xb')](),controller[_0x1908('0x10')]);router[_0x1908('0xa')]('/:id/unread',auth[_0x1908('0xb')](),controller[_0x1908('0x11')]);router[_0x1908('0xa')](_0x1908('0x12'),auth[_0x1908('0xb')](),controller[_0x1908('0x13')]);router['get'](_0x1908('0x14'),auth[_0x1908('0xb')](),controller[_0x1908('0x15')]);router[_0x1908('0x16')]('/',auth[_0x1908('0xb')](),controller['create']);router[_0x1908('0x16')](_0x1908('0x12'),auth[_0x1908('0xb')](),controller[_0x1908('0x17')]);router[_0x1908('0x16')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x1908('0x18')](_0x1908('0xf'),auth[_0x1908('0xb')](),controller[_0x1908('0x19')]);router[_0x1908('0x1a')]('/:id',auth[_0x1908('0xb')](),controller[_0x1908('0x1b')]);router[_0x1908('0x1a')]('/:id/members',auth[_0x1908('0xb')](),controller[_0x1908('0x1c')]);module[_0x1908('0x1d')]=router;
\ No newline at end of file
+var _0xb2d9=['describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe'];(function(_0x574b13,_0x2f3362){var _0x2833e3=function(_0x5a9d4f){while(--_0x5a9d4f){_0x574b13['push'](_0x574b13['shift']());}};_0x2833e3(++_0x2f3362);}(_0xb2d9,0x1b3));var _0x9b2d=function(_0x417ad1,_0x1192ec){_0x417ad1=_0x417ad1-0x0;var _0xe5d12f=_0xb2d9[_0x417ad1];return _0xe5d12f;};'use strict';var multer=require(_0x9b2d('0x0'));var util=require('util');var path=require(_0x9b2d('0x1'));var timeout=require(_0x9b2d('0x2'));var express=require(_0x9b2d('0x3'));var router=express[_0x9b2d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9b2d('0x5'));var interaction=require(_0x9b2d('0x6'));var config=require(_0x9b2d('0x7'));var controller=require(_0x9b2d('0x8'));router['get']('/',auth[_0x9b2d('0x9')](),controller[_0x9b2d('0xa')]);router[_0x9b2d('0xb')](_0x9b2d('0xc'),auth[_0x9b2d('0x9')](),controller[_0x9b2d('0xd')]);router[_0x9b2d('0xb')](_0x9b2d('0xe'),auth['isAuthenticated'](),controller[_0x9b2d('0xf')]);router[_0x9b2d('0xb')](_0x9b2d('0x10'),auth[_0x9b2d('0x9')](),controller['getUnread']);router[_0x9b2d('0xb')]('/:id/members',auth['isAuthenticated'](),controller[_0x9b2d('0x11')]);router[_0x9b2d('0xb')](_0x9b2d('0x12'),auth[_0x9b2d('0x9')](),controller[_0x9b2d('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9b2d('0x14')]);router[_0x9b2d('0x15')](_0x9b2d('0x16'),auth[_0x9b2d('0x9')](),controller[_0x9b2d('0x17')]);router[_0x9b2d('0x15')](_0x9b2d('0x12'),auth[_0x9b2d('0x9')](),controller['addMessage']);router[_0x9b2d('0x18')](_0x9b2d('0xe'),auth[_0x9b2d('0x9')](),controller[_0x9b2d('0x19')]);router[_0x9b2d('0x1a')]('/:id',auth[_0x9b2d('0x9')](),controller[_0x9b2d('0x1b')]);router[_0x9b2d('0x1a')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
index c7c73d1..62baa9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d21=['DATE','long','ENUM','sequelize','exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x1d21,0x158));var _0x11d2=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x1d21[_0x1c1fba];return _0x37e346;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'closed':{'type':Sequelize[_0x11d2('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x11d2('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x11d2('0x4'),_0x11d2('0x5')),'defaultValue':_0x11d2('0x4')},'ratingMessage':{'type':Sequelize[_0x11d2('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x11d2('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x11d2('0x8')]},'disposition':{'type':Sequelize[_0x11d2('0x7')]},'secondDisposition':{'type':Sequelize[_0x11d2('0x7')]},'thirdDisposition':{'type':Sequelize[_0x11d2('0x7')]},'note':{'type':Sequelize[_0x11d2('0x7')]},'browserName':{'type':Sequelize[_0x11d2('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x11d2('0x7')]},'osVersion':{'type':Sequelize[_0x11d2('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x11d2('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x11d2('0x6')]},'customerIp':{'type':Sequelize[_0x11d2('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x11d2('0x9'))},'read1stAt':{'type':Sequelize[_0x11d2('0x8')]},'lastMsgAt':{'type':Sequelize[_0x11d2('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x11d2('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x11d2('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x11d2('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x11d2('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb2af=['TEXT','DATE','STRING','long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2af,0xd2));var _0xfb2a=function(_0x438949,_0x28053d){_0x438949=_0x438949-0x0;var _0x250e6a=_0xb2af[_0x438949];return _0x250e6a;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'closed':{'type':Sequelize[_0xfb2a('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xfb2a('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xfb2a('0x4'),_0xfb2a('0x5')),'defaultValue':_0xfb2a('0x4')},'ratingMessage':{'type':Sequelize[_0xfb2a('0x6')]},'pathTranscript':{'type':Sequelize[_0xfb2a('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfb2a('0x7')]},'disposition':{'type':Sequelize[_0xfb2a('0x8')]},'secondDisposition':{'type':Sequelize[_0xfb2a('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfb2a('0x8')]},'browserName':{'type':Sequelize[_0xfb2a('0x8')]},'browserVersion':{'type':Sequelize[_0xfb2a('0x8')]},'osName':{'type':Sequelize[_0xfb2a('0x8')]},'osVersion':{'type':Sequelize[_0xfb2a('0x8')]},'deviceModel':{'type':Sequelize[_0xfb2a('0x8')]},'deviceVendor':{'type':Sequelize[_0xfb2a('0x8')]},'deviceType':{'type':Sequelize[_0xfb2a('0x8')]},'referer':{'type':Sequelize[_0xfb2a('0x6')]},'customerIp':{'type':Sequelize[_0xfb2a('0x8')]},'formData':{'type':Sequelize[_0xfb2a('0x6')](_0xfb2a('0x9'))},'read1stAt':{'type':Sequelize[_0xfb2a('0x7')]},'lastMsgAt':{'type':Sequelize[_0xfb2a('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xfb2a('0xa')]('in',_0xfb2a('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xfb2a('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 77cff68..8013a21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['interaction','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','unmanaged','total','closed','UserId','talking','disposition','abandoned','answered','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','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','conditions','length','find','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','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','isEmpty','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','ChatWebsiteId','sequelize','toString','count','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','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','show','params','includeAll','include','create','update','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','fullname','email','contact','account','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','basename','file','filename','mimetype','attachmentDownload','Attachment','attachId','root','server/files/attachments/','close','mailTranscript','join','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','ChatInteractionId','$gte','options','findAll','rows','getMyMessages','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','download','server','tmp','files','attachments','firstName','direction','Account','Owner','get','Chat','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','N.A.','tail','createWriteStream','out','lastName','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','offset','undefined','limit','set','destroy','sendStatus','stack','name','send','render','merge'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x449b81,_0x4b2a6f){_0x449b81=_0x449b81-0x0;var _0xb9b60c=_0xf3cd[_0x449b81];return _0xb9b60c;};'use strict';var rimraf=require(_0xdf3c('0x0'));var zipdir=require(_0xdf3c('0x1'));var rp=require(_0xdf3c('0x2'));var moment=require(_0xdf3c('0x3'));var BPromise=require(_0xdf3c('0x4'));var Mustache=require(_0xdf3c('0x5'));var util=require('util');var path=require(_0xdf3c('0x6'));var ejs=require(_0xdf3c('0x7'));var fs=require('fs');var _=require(_0xdf3c('0x8'));var squel=require('squel');var Redis=require(_0xdf3c('0x9'));var qs=require(_0xdf3c('0xa'));var as=require(_0xdf3c('0xb'));var pdf=require(_0xdf3c('0xc'));var logger=require(_0xdf3c('0xd'))(_0xdf3c('0xe'));var config=require('../../config/environment');var db=require(_0xdf3c('0xf'))['db'];config['redis']=_['defaults'](config[_0xdf3c('0x10')],{'host':_0xdf3c('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf3c('0x10')]));require(_0xdf3c('0x12'))[_0xdf3c('0x13')](socket);var jayson=require(_0xdf3c('0x14'));var client=jayson[_0xdf3c('0x15')][_0xdf3c('0x16')]({'port':0x232b});var client9004=jayson[_0xdf3c('0x15')][_0xdf3c('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x5e8925,_0x1d483c,_0x166ae5,_0x41fc33){return new BPromise(function(_0x17319c,_0x59e431){var _0x2ae4ad=_0x41fc33||client;return _0x2ae4ad[_0xdf3c('0x17')](_0x5e8925,_0x166ae5)[_0xdf3c('0x18')](function(_0x5e0047){logger[_0xdf3c('0x19')](_0xdf3c('0x1a'),_0x1d483c,_0xdf3c('0x1b'));logger[_0xdf3c('0x1c')](_0xdf3c('0x1d'),_0x1d483c,_0xdf3c('0x1b'),JSON[_0xdf3c('0x1e')](_0x5e0047));if(_0x5e0047[_0xdf3c('0x1f')]){if(_0x5e0047[_0xdf3c('0x1f')][_0xdf3c('0x20')]===0x1f4){logger['error'](_0xdf3c('0x1a'),_0x1d483c,_0x5e0047[_0xdf3c('0x1f')][_0xdf3c('0x21')]);return _0x59e431(_0x5e0047[_0xdf3c('0x1f')][_0xdf3c('0x21')]);}logger[_0xdf3c('0x1f')](_0xdf3c('0x1a'),_0x1d483c,_0x5e0047[_0xdf3c('0x1f')][_0xdf3c('0x21')]);return _0x17319c(_0x5e0047[_0xdf3c('0x1f')][_0xdf3c('0x21')]);}else{logger[_0xdf3c('0x19')](_0xdf3c('0x1a'),_0x1d483c,'request\x20sent');_0x17319c(_0x5e0047['result'][_0xdf3c('0x21')]);}})['catch'](function(_0x15776c){logger[_0xdf3c('0x1f')](_0xdf3c('0x1a'),_0x1d483c,_0x15776c);_0x59e431(_0x15776c);});});}function respondWithStatusCode(_0x38b319,_0x33652f){_0x33652f=_0x33652f||0xcc;return function(_0x36ba1c){if(_0x36ba1c){return _0x38b319['sendStatus'](_0x33652f);}return _0x38b319[_0xdf3c('0x22')](_0x33652f)[_0xdf3c('0x23')]();};}function respondWithResult(_0x13e3ca,_0x24754a){_0x24754a=_0x24754a||0xc8;return function(_0x40032a){if(_0x40032a){return _0x13e3ca[_0xdf3c('0x22')](_0x24754a)[_0xdf3c('0x24')](_0x40032a);}};}function respondWithFilteredResult(_0x155f54,_0x18cb46){return function(_0x1adee4){if(_0x1adee4){var _0x4c076c=typeof _0x18cb46[_0xdf3c('0x25')]===_0xdf3c('0x26')&&typeof _0x18cb46['limit']===_0xdf3c('0x26');var _0x59659e=_0x1adee4['count'];var _0x508be9=_0x4c076c?0x0:_0x18cb46[_0xdf3c('0x25')];var _0x186bba=_0x4c076c?_0x1adee4['count']:_0x18cb46['offset']+_0x18cb46[_0xdf3c('0x27')];var _0x1f2ce4;if(_0x186bba>=_0x59659e){_0x186bba=_0x59659e;_0x1f2ce4=0xc8;}else{_0x1f2ce4=0xce;}_0x155f54[_0xdf3c('0x22')](_0x1f2ce4);return _0x155f54[_0xdf3c('0x28')]('Content-Range',_0x508be9+'-'+_0x186bba+'/'+_0x59659e)[_0xdf3c('0x24')](_0x1adee4);}return null;};}function saveUpdates(_0x2a2d94){return function(_0x5386bf){if(_0x5386bf){return _0x5386bf['update'](_0x2a2d94)[_0xdf3c('0x18')](function(_0x46f0e3){return _0x46f0e3;});}return null;};}function removeEntity(_0x36937e){return function(_0x540f3a){if(_0x540f3a){return _0x540f3a[_0xdf3c('0x29')]()[_0xdf3c('0x18')](function(){_0x36937e[_0xdf3c('0x22')](0xcc)[_0xdf3c('0x23')]();});}};}function handleEntityNotFound(_0x575ae1){return function(_0xda0de0){if(!_0xda0de0){_0x575ae1[_0xdf3c('0x2a')](0x194);}return _0xda0de0;};}function handleError(_0x522e5f,_0x40ae3d){_0x40ae3d=_0x40ae3d||0x1f4;return function(_0x3daeda){logger[_0xdf3c('0x1f')](_0x3daeda[_0xdf3c('0x2b')]);if(_0x3daeda['name']){delete _0x3daeda[_0xdf3c('0x2c')];}_0x522e5f[_0xdf3c('0x22')](_0x40ae3d)[_0xdf3c('0x2d')](_0x3daeda);};}function getMustacheRender(_0x3b9ce8,_0x4c1f49){return Mustache[_0xdf3c('0x2e')](_0x3b9ce8,_[_0xdf3c('0x2f')](_0x4c1f49['body'],{'contact':_0x4c1f49['contact'],'message':_0x4c1f49[_0xdf3c('0x21')],'agent':_0x4c1f49['agent'],'interaction':_0x4c1f49[_0xdf3c('0x30')],'account':_0x4c1f49['account']}))||'';}function getInteractionUsers(_0x57faba,_0x52f0c3){return new BPromise(function(_0x44a478,_0x2ee9ad){try{if(_0x52f0c3[_0x57faba['id']]){_0x57faba[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x52f0c3[_0x57faba['id']],function(_0x54c25f){return{'id':_0x54c25f['id'],'fullname':_0x54c25f['fullname']};});}}catch(_0x3d8557){_0x2ee9ad(_0x3d8557);}_0x44a478(_0x57faba);});}function getInteractionTags(_0x49d0f0,_0x46e40f){return new BPromise(function(_0x17b502,_0x3628ae){try{if(_0x49d0f0[_0xdf3c('0x33')]){_0x49d0f0[_0xdf3c('0x34')]=[];_0x49d0f0[_0xdf3c('0x33')][_0xdf3c('0x35')](',')[_0xdf3c('0x36')](function(_0x398c76){_0x49d0f0['Tags'][_0xdf3c('0x37')](_0x46e40f[_0x398c76]);});}delete _0x49d0f0['TagIds'];}catch(_0x5c1471){_0x3628ae(_0x5c1471);}_0x17b502(_0x49d0f0);});}function updateChatInteraction(_0x3b97bc,_0x47f760,_0xccce51){return new BPromise(function(_0x4f93d5,_0x2a94c3){return getInteractionUsers(_0x3b97bc,_0xccce51)[_0xdf3c('0x18')](function(_0x1c6dee){return getInteractionTags(_0x1c6dee,_0x47f760);})[_0xdf3c('0x18')](function(_0x3098cb){return getStateInteraction(_0x3098cb);})[_0xdf3c('0x18')](function(_0x736ef5){_0x4f93d5(_0x736ef5);})[_0xdf3c('0x38')](function(_0x3cf131){_0x2a94c3(_0x3cf131);});});}function getStateInteraction(_0xa65478){return new BPromise(function(_0x424acf){_0xa65478[_0xdf3c('0x39')]=0x0;_0xa65478['talking']=0x0;_0xa65478['answered']=0x0;_0xa65478[_0xdf3c('0x3a')]=0x0;_0xa65478['abandoned']=0x0;_0xa65478[_0xdf3c('0x3b')]=0x0;if(!_0xa65478[_0xdf3c('0x3c')]&&!_0xa65478[_0xdf3c('0x3d')]){_0xa65478[_0xdf3c('0x39')]+=0x1;}if(!_0xa65478['closed']&&_0xa65478['UserId']){_0xa65478[_0xdf3c('0x3e')]+=0x1;if(_0xa65478[_0xdf3c('0x39')]){_0xa65478[_0xdf3c('0x39')]-=0x1;}}if(_0xa65478['closed']&&_0xa65478[_0xdf3c('0x3f')]===_0xdf3c('0x40')){_0xa65478[_0xdf3c('0x40')]+=0x1;if(_0xa65478[_0xdf3c('0x39')]){_0xa65478['waiting']-=0x1;}}else if(_0xa65478[_0xdf3c('0x3c')]&&!_0xa65478[_0xdf3c('0x3d')]&&_0xa65478[_0xdf3c('0x3f')]){_0xa65478[_0xdf3c('0x3a')]+=0x1;if(_0xa65478[_0xdf3c('0x39')]){_0xa65478['waiting']-=0x1;}}else if(_0xa65478[_0xdf3c('0x3c')]&&_0xa65478[_0xdf3c('0x3d')]){_0xa65478[_0xdf3c('0x41')]+=0x1;if(_0xa65478[_0xdf3c('0x3e')]){_0xa65478[_0xdf3c('0x3e')]-=0x1;}}_0xa65478[_0xdf3c('0x3b')]+=0x1;_0x424acf(_0xa65478);});}exports['index']=function(_0x4d6349,_0x2c6c6d){var _0x2be86d={},_0x5a4443={},_0x5c9885={'count':0x0,'rows':[]};var _0x269723=_[_0xdf3c('0x32')](db[_0xdf3c('0x42')][_0xdf3c('0x43')],function(_0xaae4bc){return{'name':_0xaae4bc[_0xdf3c('0x44')],'type':_0xaae4bc[_0xdf3c('0x45')][_0xdf3c('0x46')]};});_0x5a4443[_0xdf3c('0x47')]=_['map'](_0x269723,_0xdf3c('0x2c'));_0x5a4443[_0xdf3c('0x48')]=_[_0xdf3c('0x49')](_0x4d6349[_0xdf3c('0x48')]);_0x5a4443[_0xdf3c('0x4a')]=_[_0xdf3c('0x4b')](_0x5a4443[_0xdf3c('0x47')],_0x5a4443['query']);_0x2be86d[_0xdf3c('0x4c')]=_['intersection'](_0x5a4443[_0xdf3c('0x47')],qs['fields'](_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x4d')]));_0x2be86d[_0xdf3c('0x4c')]=_0x2be86d[_0xdf3c('0x4c')]['length']?_0x2be86d['attributes']:_0x5a4443['model'];if(!_0x4d6349[_0xdf3c('0x48')]['hasOwnProperty'](_0xdf3c('0x4e'))){_0x2be86d[_0xdf3c('0x27')]=qs[_0xdf3c('0x27')](_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x27')]);_0x2be86d['offset']=qs['offset'](_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x25')]);}_0x2be86d['order']=qs[_0xdf3c('0x4f')](_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x4f')]);_0x2be86d[_0xdf3c('0x50')]=qs[_0xdf3c('0x4a')](_[_0xdf3c('0x51')](_0x4d6349[_0xdf3c('0x48')],_0x5a4443['filters']),_0x269723);var _0x4c98dc=[];var _0x35767a=squel[_0xdf3c('0x52')]()[_0xdf3c('0x53')]('id')[_0xdf3c('0x53')](_0xdf3c('0x2c'))[_0xdf3c('0x53')](_0xdf3c('0x54'))[_0xdf3c('0x55')](_0xdf3c('0x56'));var _0x31624a=squel[_0xdf3c('0x52')]()['field'](_0xdf3c('0x57'))['field']('u.fullname')['field']('ui.ChatInteractionId')['from'](_0xdf3c('0x58'),'ui')[_0xdf3c('0x59')]('users','u',_0xdf3c('0x5a'));var _0x32427e=squel['select']()[_0xdf3c('0x55')](_0xdf3c('0x5b'),'i')[_0xdf3c('0x59')](_0xdf3c('0x5c'),'c',_0xdf3c('0x5d'))[_0xdf3c('0x59')](_0xdf3c('0x5e'),'o',_0xdf3c('0x5f'))[_0xdf3c('0x59')](_0xdf3c('0x60'),'a',_0xdf3c('0x61'))['left_join'](_0xdf3c('0x62'),'me',_0xdf3c('0x63'))[_0xdf3c('0x59')]('chat_interaction_has_tags','it',_0xdf3c('0x64'))[_0xdf3c('0x59')](_0xdf3c('0x56'),'t','t.id\x20=\x20it.TagId');var _0x1effdb=squel[_0xdf3c('0x65')]();var _0x5ca218=[];var _0x3611ec=squel['expr']();var _0x28c296;if(_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x66')]){_0x28c296=as[_0xdf3c('0x67')](_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x66')]);var _0x3fca95=_0x28c296[_0xdf3c('0x68')];for(var _0x2922d8=0x0;_0x2922d8<_0x28c296[_0xdf3c('0x69')][_0xdf3c('0x6a')];_0x2922d8++){var _0x1b7195=_0x28c296[_0xdf3c('0x69')][_0x2922d8];var _0x206a18='i';var _0x204110=_[_0xdf3c('0x6b')](_0x269723,[_0xdf3c('0x2c'),_0x1b7195['field']]);if(!_0x204110){switch(_0x1b7195['field']){case _0xdf3c('0x6c'):if(_0x1b7195[_0xdf3c('0x6d')]==0x1){_0x32427e[_0xdf3c('0x6e')]('`'+_0x1b7195['field']+_0xdf3c('0x6f'));}else{_0x32427e['having']('`'+_0x1b7195['field']+_0xdf3c('0x70'));}break;case _0xdf3c('0x71'):if(_0x1b7195[_0xdf3c('0x72')]===_0xdf3c('0x73')){if(_0x1b7195[_0xdf3c('0x6d')][_0xdf3c('0x35')]('\x20')[_0xdf3c('0x6a')]>0x1){_0x1effdb[_0x3fca95](_0xdf3c('0x74'),qs[_0xdf3c('0x75')](_0x1b7195[_0xdf3c('0x6d')]),null);}else{var _0x1cce9a='%'+_0x1b7195[_0xdf3c('0x6d')]+'%';_0x1effdb[_0x3fca95](_0xdf3c('0x76'),_0x1cce9a,_0x1cce9a,_0x1cce9a);}}else{_0x204110=_['find'](_0x269723,[_0xdf3c('0x2c'),_0xdf3c('0x77')]);_0x1b7195[_0xdf3c('0x53')]=_0xdf3c('0x77');_0x4ff52a=as[_0xdf3c('0x78')](_0x206a18,_0x204110['type'],_0x1b7195);_0x1effdb[_0x3fca95](_0x4ff52a[_0xdf3c('0x79')],_0x4ff52a[_0xdf3c('0x6d')][_0xdf3c('0x7a')],_0x4ff52a[_0xdf3c('0x6d')][_0xdf3c('0x23')]);}break;case _0xdf3c('0x7b'):var _0x3c0a8d=_0x1b7195[_0xdf3c('0x6d')][_0xdf3c('0x35')](',')[_0xdf3c('0x32')](function(_0x55010b){return Number(_0x55010b);});_0x3c0a8d[_0xdf3c('0x36')](function(_0x9cc472){_0x3611ec['or'](_0xdf3c('0x7c'),'%,'+_0x9cc472+',%');});_0x5ca218=_[_0xdf3c('0x7d')](_0x5ca218,_0x3c0a8d);break;case _0xdf3c('0x7e'):if(_0x1b7195[_0xdf3c('0x72')]===_0xdf3c('0x73')){_0x1effdb[_0x3fca95]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1b7195[_0xdf3c('0x6d')]+'%',null);}else{_0x204110=_[_0xdf3c('0x6b')](_0x269723,['name','UserId']);_0x1b7195[_0xdf3c('0x53')]=_0xdf3c('0x3d');_0x4ff52a=as[_0xdf3c('0x78')](_0x206a18,_0x204110[_0xdf3c('0x45')],_0x1b7195);_0x1effdb[_0x3fca95](_0x4ff52a[_0xdf3c('0x79')],_0x4ff52a[_0xdf3c('0x6d')][_0xdf3c('0x7a')],_0x4ff52a[_0xdf3c('0x6d')]['end']);}break;case _0xdf3c('0x7f'):_0x4ff52a=as[_0xdf3c('0x78')]('me',null,_0x1b7195);_0x1effdb[_0x3fca95](_0x4ff52a[_0xdf3c('0x79')],_0x4ff52a['value'][_0xdf3c('0x7a')],_0x4ff52a[_0xdf3c('0x6d')][_0xdf3c('0x23')]);break;}}else{var _0x4ff52a=as[_0xdf3c('0x78')](_0x206a18,_0x204110[_0xdf3c('0x45')],_0x1b7195);_0x1effdb[_0x3fca95](_0x4ff52a[_0xdf3c('0x79')],_0x4ff52a[_0xdf3c('0x6d')][_0xdf3c('0x7a')],_0x4ff52a[_0xdf3c('0x6d')]['end']);}}}else{var _0x50753f=_(_0x4d6349['query'])['keys']()['map'](function(_0x2a4e4c){return _[_0xdf3c('0x80')](_0x269723,[_0xdf3c('0x2c'),_0x2a4e4c])?_0x2a4e4c:undefined;})['compact']()[_0xdf3c('0x6d')]();if(!_[_0xdf3c('0x81')](_0x50753f)){_0x50753f[_0xdf3c('0x36')](function(_0x51e8c6){if(_0x51e8c6==='ChatWebsiteId'){_0x32427e[_0xdf3c('0x50')]('i.ChatWebsiteId\x20IN\x20?',[][_0xdf3c('0x82')](_0x4d6349['query'][_0x51e8c6]));}else if(_0x51e8c6===_0xdf3c('0x83')){var _0x2677d7=JSON[_0xdf3c('0x84')](_0x4d6349[_0xdf3c('0x48')][_0x51e8c6])['$gte'];var _0x5148f6=JSON[_0xdf3c('0x84')](_0x4d6349[_0xdf3c('0x48')][_0x51e8c6])[_0xdf3c('0x85')];_0x32427e[_0xdf3c('0x50')](_0xdf3c('0x86'),_0x2677d7,_0x5148f6);}else{if(_0x4d6349[_0xdf3c('0x48')][_0x51e8c6]==='null'){_0x32427e[_0xdf3c('0x50')]('i.'+_0x51e8c6+'\x20IS\x20NULL');}else{_0x32427e[_0xdf3c('0x50')]('i.'+_0x51e8c6+_0xdf3c('0x87'),_0x4d6349[_0xdf3c('0x48')][_0x51e8c6]);}}});}if(_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x88')]){if(_0x4d6349['query'][_0xdf3c('0x88')]==0x1){_0x32427e[_0xdf3c('0x6e')](_0xdf3c('0x89'));}else{_0x32427e['having']('`unreadMessages`\x20>\x200');}}if(_0x4d6349['query']['tag']){_0x5ca218=_[_0xdf3c('0x8a')](_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x8b')])?_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x8b')]:new Array(_0x4d6349[_0xdf3c('0x48')]['tag']);_0x5ca218[_0xdf3c('0x36')](function(_0x585871){_0x3611ec['or'](_0xdf3c('0x7c'),'%,'+_0x585871+',%');});}if(_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x8c')]){var _0x15a057=_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x8c')][_0xdf3c('0x8d')]('\x5c','\x5c\x5c')[_0xdf3c('0x8d')](/'/g,'\x27\x27');if(qs[_0xdf3c('0x8e')](_0x15a057)){_0x1effdb['or'](_0xdf3c('0x8f'),_0x15a057+'%');}else{_0x1effdb['or'](_0xdf3c('0x90'),qs[_0xdf3c('0x75')](_0x15a057))['or'](_0xdf3c('0x91'),_0x15a057+'%');}}}_0x32427e[_0xdf3c('0x50')](_0x1effdb);_0x32427e['group'](_0xdf3c('0x92'));var _0x194b1a={'type':db[_0xdf3c('0x93')][_0xdf3c('0x94')]['SELECT'],'raw':!![]};var _0x9c7bdd=_0x32427e[_0xdf3c('0x95')]();_0x9c7bdd['field']('i.id');_0x9c7bdd[_0xdf3c('0x53')](_0xdf3c('0x96'),_0xdf3c('0x6c'));if(_0x2be86d[_0xdf3c('0x97')]){_0x2be86d[_0xdf3c('0x97')]['forEach'](function(_0x50105b){var _0x471d8f=_0x50105b[0x0]===_0xdf3c('0x98')?_0x50105b[0x0]:'i.'+_0x50105b[0x0];_0x32427e[_0xdf3c('0x97')](_0x471d8f,_0x50105b[0x1]===_0xdf3c('0x99')?![]:!![]);});}if(!_[_0xdf3c('0x81')](_0x5ca218)){_0x32427e['having'](_0x3611ec);_0x9c7bdd[_0xdf3c('0x50')](_0xdf3c('0x9a'),_0x5ca218);}BPromise[_0xdf3c('0x9b')]()[_0xdf3c('0x18')](function(){if(!_0x28c296){if(_0x4d6349[_0xdf3c('0x48')]['ChatWebsiteId'])return;_0x9c7bdd['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x32427e[_0xdf3c('0x50')](_0xdf3c('0x9c'));return;}if(_0x4d6349[_0xdf3c('0x9d')][_0xdf3c('0x9e')]!==_0xdf3c('0x9f'))return;return _0x4d6349[_0xdf3c('0x9d')][_0xdf3c('0xa0')]({'attributes':['id'],'raw':!![]})[_0xdf3c('0x18')](function(_0x5c52e2){if(_[_0xdf3c('0x81')](_0x5c52e2)){_0x9c7bdd[_0xdf3c('0x50')](_0xdf3c('0xa1'));_0x32427e[_0xdf3c('0x50')](_0xdf3c('0xa1'));}else{_0x9c7bdd[_0xdf3c('0x50')]('i.ChatWebsiteId\x20IN\x20?',_[_0xdf3c('0x32')](_0x5c52e2,'id'));_0x32427e[_0xdf3c('0x50')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x5c52e2,'id'));}});})[_0xdf3c('0x18')](function(){if(_0x4d6349['user'][_0xdf3c('0x9e')]===_0xdf3c('0x9f')&&!_0x28c296&&!_0x4d6349['query'][_0xdf3c('0xa2')])return[];return db[_0xdf3c('0xa3')][_0xdf3c('0x48')](_0x9c7bdd[_0xdf3c('0xa4')](),_0x194b1a);})[_0xdf3c('0x18')](function(_0x45c987){_0x5c9885['count']=_0x45c987[_0xdf3c('0x6a')];if(_0x5c9885[_0xdf3c('0xa5')]===0x0)return[];return db[_0xdf3c('0xa3')][_0xdf3c('0x48')](_0x35767a[_0xdf3c('0xa4')](),_0x194b1a)[_0xdf3c('0x18')](function(_0x3deacb){_0x4c98dc=_['keyBy'](_0x3deacb,'id');_0x194b1a=_['merge'](_0x194b1a,{'model':db[_0xdf3c('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d6349[_0xdf3c('0x48')][_0xdf3c('0x4d')]){_0x2be86d['attributes'][_0xdf3c('0x36')](function(_0x52fcb6){_0x32427e['field']('i.'+_0x52fcb6);});}else{_0x32427e[_0xdf3c('0x53')](_0xdf3c('0x96'),'unreadMessages');_0x32427e[_0xdf3c('0x53')]('a.key',_0xdf3c('0xa6'));_0x32427e['field'](_0xdf3c('0xa7'),_0xdf3c('0xa8'));_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xa9'),_0xdf3c('0x98'));_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xaa'));_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xab'),_0xdf3c('0xac'));_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xad'),_0xdf3c('0xae'));_0x32427e[_0xdf3c('0x53')]('c.email',_0xdf3c('0xaf'));_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xb0'),'Contact.phone');_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xb1'),_0xdf3c('0xb2'));_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xb3'),_0xdf3c('0xb4'));_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xb5'),_0xdf3c('0xb6'));_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xb7'),'Owner.internal');_0x32427e[_0xdf3c('0x53')](_0xdf3c('0xb8'),_0xdf3c('0x33'));}if(_0x2be86d[_0xdf3c('0x27')])_0x32427e[_0xdf3c('0x27')](_0x2be86d[_0xdf3c('0x27')]);if(_0x2be86d[_0xdf3c('0x25')])_0x32427e[_0xdf3c('0x25')](_0x2be86d[_0xdf3c('0x25')]);return db[_0xdf3c('0xa3')][_0xdf3c('0x48')](_0x32427e[_0xdf3c('0xa4')](),_0x194b1a);})['then'](function(_0x6627){if(_0x6627[_0xdf3c('0x6a')]>0x0)_0x31624a[_0xdf3c('0x50')](_0xdf3c('0xb9'),_[_0xdf3c('0x32')](_0x6627,'id'));return db[_0xdf3c('0xa3')][_0xdf3c('0x48')](_0x31624a['toString'](),_0x194b1a)[_0xdf3c('0x18')](function(_0x87c93a){var _0x2a7636=_[_0xdf3c('0xba')](_0x87c93a,'ChatInteractionId');var _0x4265cb=[];_0x6627[_0xdf3c('0x36')](function(_0x4eb2ce){_0x4265cb[_0xdf3c('0x37')](updateChatInteraction(_0x4eb2ce,_0x4c98dc,_0x2a7636));});return BPromise['all'](_0x4265cb);});});})[_0xdf3c('0x18')](function(_0x1b2363){_0x5c9885['rows']=_0x1b2363;return _0x5c9885;})[_0xdf3c('0x18')](respondWithFilteredResult(_0x2c6c6d,_0x2be86d))[_0xdf3c('0x38')](handleError(_0x2c6c6d,null));};exports[_0xdf3c('0xbb')]=function(_0x4c0742,_0x4ffd52){var _0x243ad5={'raw':![],'where':{'id':_0x4c0742[_0xdf3c('0xbc')]['id']}},_0x5ea218={};_0x5ea218[_0xdf3c('0x47')]=_[_0xdf3c('0x49')](db[_0xdf3c('0x42')]['rawAttributes']);_0x5ea218[_0xdf3c('0x48')]=_[_0xdf3c('0x49')](_0x4c0742['query']);_0x5ea218[_0xdf3c('0x4a')]=_['intersection'](_0x5ea218[_0xdf3c('0x47')],_0x5ea218[_0xdf3c('0x48')]);_0x243ad5['attributes']=_['intersection'](_0x5ea218[_0xdf3c('0x47')],qs['fields'](_0x4c0742[_0xdf3c('0x48')][_0xdf3c('0x4d')]));_0x243ad5[_0xdf3c('0x4c')]=_0x243ad5[_0xdf3c('0x4c')][_0xdf3c('0x6a')]?_0x243ad5[_0xdf3c('0x4c')]:_0x5ea218[_0xdf3c('0x47')];if(_0x4c0742[_0xdf3c('0x48')][_0xdf3c('0xbd')]){_0x243ad5[_0xdf3c('0xbe')]=[{'all':!![]}];}_0x243ad5=_[_0xdf3c('0x2f')]({},_0x243ad5,_0x4c0742['options']);return db[_0xdf3c('0x42')][_0xdf3c('0x6b')](_0x243ad5)['then'](handleEntityNotFound(_0x4ffd52,null))[_0xdf3c('0x18')](respondWithResult(_0x4ffd52,null))[_0xdf3c('0x38')](handleError(_0x4ffd52,null));};exports[_0xdf3c('0xbf')]=function(_0x307179,_0x7e5769){return db[_0xdf3c('0x42')]['create'](_0x307179[_0xdf3c('0x7f')],{})['then'](respondWithResult(_0x7e5769,0xc9))[_0xdf3c('0x38')](handleError(_0x7e5769,null));};exports[_0xdf3c('0xc0')]=function(_0x214506,_0x2dafff){if(_0x214506[_0xdf3c('0x7f')]['id']){delete _0x214506[_0xdf3c('0x7f')]['id'];}return db['ChatInteraction'][_0xdf3c('0x6b')]({'where':{'id':_0x214506[_0xdf3c('0xbc')]['id']}})['then'](handleEntityNotFound(_0x2dafff,null))[_0xdf3c('0x18')](saveUpdates(_0x214506[_0xdf3c('0x7f')],null))[_0xdf3c('0x18')](respondWithResult(_0x2dafff,null))[_0xdf3c('0x38')](handleError(_0x2dafff,null));};exports[_0xdf3c('0x29')]=function(_0x18c121,_0x1654d5){return db[_0xdf3c('0x42')]['find']({'where':{'id':_0x18c121['params']['id']}})[_0xdf3c('0x18')](handleEntityNotFound(_0x1654d5,null))[_0xdf3c('0x18')](removeEntity(_0x1654d5,null))[_0xdf3c('0x38')](handleError(_0x1654d5,null));};exports[_0xdf3c('0xc1')]=function(_0x47afe4,_0x4f8f27){return db[_0xdf3c('0x42')]['describe']()[_0xdf3c('0x18')](respondWithResult(_0x4f8f27,null))['catch'](handleError(_0x4f8f27,null));};exports[_0xdf3c('0xc2')]=function(_0x666df5,_0x35d01c){var _0x53555a=_0x666df5[_0xdf3c('0xbc')]['id'];var _0x142cd0;var _0x5bf9a9;var _0x50a21b;return db[_0xdf3c('0x42')][_0xdf3c('0xc3')]({'where':{'id':_0x53555a}})[_0xdf3c('0x18')](function(_0x1a1c13){_0x142cd0=_0x1a1c13;return db[_0xdf3c('0xc4')][_0xdf3c('0xc3')]({'where':{'id':_0x1a1c13[_0xdf3c('0xa2')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xdf3c('0xc5'),_0xdf3c('0xc6'),_0xdf3c('0xc7')],'raw':!![]});})[_0xdf3c('0x18')](function(_0x3c3770){if(_0x3c3770&&_0x3c3770[_0xdf3c('0xc8')]&&_0x3c3770[_0xdf3c('0xc9')]){_0x5bf9a9=_0x3c3770;var _0x828c9c={'interaction':{'id':_0x53555a},'agent':{'id':_0x666df5[_0xdf3c('0x9d')]['id'],'name':_0x666df5[_0xdf3c('0x9d')][_0xdf3c('0x2c')],'fullname':_0x666df5[_0xdf3c('0x9d')][_0xdf3c('0xca')],'email':_0x666df5[_0xdf3c('0x9d')][_0xdf3c('0xcb')]},'contact':_0x666df5[_0xdf3c('0x7f')][_0xdf3c('0xcc')],'account':_0x666df5[_0xdf3c('0x7f')][_0xdf3c('0xcd')]};var _0x552654={'rejectUnauthorized':![],'method':'POST','url':_0xdf3c('0xce'),'headers':{'X-APIKEY':_0x3c3770['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x666df5['user'][_0xdf3c('0xcb')]],'buttons':null,'topic':_0x5bf9a9['vidaooTopic'],'note':_[_0xdf3c('0xcf')](_0x5bf9a9[_0xdf3c('0xc6')])?null:getMustacheRender(_0x5bf9a9['vidaooNote'],_0x828c9c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5bf9a9[_0xdf3c('0xc7')])){var _0x3e0a0f=getMustacheRender(_0x5bf9a9[_0xdf3c('0xc7')],_0x828c9c);var _0x4d5216=JSON[_0xdf3c('0x84')](_0x3e0a0f);_0x552654['body'][_0xdf3c('0xd0')]=_0x4d5216;}}catch(_0x4ba88f){throw new db['Sequelize'][(_0xdf3c('0xd1'))](_0xdf3c('0xd2'));}return rp(_0x552654);}else{throw new db[(_0xdf3c('0x93'))][(_0xdf3c('0xd1'))](_0xdf3c('0xd3'));}})[_0xdf3c('0x18')](function(_0x48590a){_0x50a21b=_0x48590a;if(_0x50a21b['id']){var _0x4f017c={'body':_0x50a21b[_0xdf3c('0xd4')],'ChatWebsiteId':_0x5bf9a9['id'],'ChatInteractionId':_0x142cd0['id'],'direction':'out','UserId':_0x666df5[_0xdf3c('0x9d')]['id']};return db[_0xdf3c('0xd5')][_0xdf3c('0xbf')](_0x4f017c,{});}else{throw new db[(_0xdf3c('0x93'))][(_0xdf3c('0xd1'))](_0xdf3c('0xd6'));}})[_0xdf3c('0x18')](function(){return _0x142cd0['updateAttributes']({'vidaooSessionId':_0x50a21b['id']});})['then'](respondWithResult(_0x35d01c,null))[_0xdf3c('0x38')](handleError(_0x35d01c,null));};exports[_0xdf3c('0xd7')]=function(_0x3fa455,_0x13a882){if(_0x3fa455['body']['id']){delete _0x3fa455[_0xdf3c('0x7f')]['id'];}return db[_0xdf3c('0x42')][_0xdf3c('0x6b')]({'where':{'id':_0x3fa455[_0xdf3c('0xbc')]['id']},'include':[{'model':db[_0xdf3c('0xd8')],'as':_0xdf3c('0x71')}]})['then'](handleEntityNotFound(_0x13a882,null))[_0xdf3c('0x18')](saveUpdates(_0x3fa455[_0xdf3c('0x7f')],null))['then'](respondWithResult(_0x13a882,null))[_0xdf3c('0x38')](handleError(_0x13a882,null));};exports[_0xdf3c('0xd9')]=function(_0xe5f939,_0x511a40){if(_0xe5f939[_0xdf3c('0x7f')]['id']){delete _0xe5f939[_0xdf3c('0x7f')]['id'];}return db[_0xdf3c('0x42')][_0xdf3c('0x6b')]({'where':{'id':_0xe5f939[_0xdf3c('0xbc')]['id']}})[_0xdf3c('0x18')](function(_0x3c91ba){if(!_0x3c91ba){logger[_0xdf3c('0x1f')](_0xdf3c('0xda'),'abandon',0x194,_0xdf3c('0xdb'));_0x511a40['sendStatus'](0x194);}else{if(_0x3c91ba[_0xdf3c('0x3d')]){throw new db[(_0xdf3c('0x93'))][(_0xdf3c('0xd1'))](_0xdf3c('0xdc'));}}return _0x3c91ba;})[_0xdf3c('0x18')](function(_0x34344b){if(_0x34344b){return _0x34344b[_0xdf3c('0xc0')]({'closed':_0xe5f939[_0xdf3c('0x7f')][_0xdf3c('0x3c')],'disposition':_0xe5f939[_0xdf3c('0x7f')][_0xdf3c('0x3f')]})['then'](function(_0x379996){return _0x379996;});}})[_0xdf3c('0x18')](function(){return respondWithRpcPromise('AbandonInteraction',_0xdf3c('0xd9'),_0xe5f939[_0xdf3c('0x7f')],client9004);})[_0xdf3c('0x18')](respondWithResult(_0x511a40,null))[_0xdf3c('0x38')](handleError(_0x511a40,null));};exports['attachmentUpload']=function(_0x2670ef,_0xdf510b){_0x2670ef[_0xdf3c('0x7f')]['name']=_0x2670ef['file']['originalname'];_0x2670ef[_0xdf3c('0x7f')][_0xdf3c('0xdd')]=_0x2670ef[_0xdf3c('0xde')][_0xdf3c('0xdf')];_0x2670ef[_0xdf3c('0x7f')][_0xdf3c('0x45')]=_0x2670ef[_0xdf3c('0xde')][_0xdf3c('0xe0')];return db['Attachment'][_0xdf3c('0xbf')](_0x2670ef['body'])[_0xdf3c('0x18')](respondWithResult(_0xdf510b,0xc9))[_0xdf3c('0x38')](handleError(_0xdf510b,null));};exports[_0xdf3c('0xe1')]=function(_0x3263e7,_0x3cb8a7){return db[_0xdf3c('0x42')]['findOne']({'where':{'id':_0x3263e7[_0xdf3c('0xbc')]['id']},'raw':!![]})[_0xdf3c('0x18')](handleEntityNotFound(_0x3cb8a7,null))['then'](function(_0x28337a){if(_0x28337a){if(_0x28337a[_0xdf3c('0x3c')]){return _0x3cb8a7[_0xdf3c('0x22')](0x193)[_0xdf3c('0x24')]({'status':0x193,'message':'Unauthorized'});}return db[_0xdf3c('0xe2')]['findOne']({'where':{'id':_0x3263e7[_0xdf3c('0x48')][_0xdf3c('0xe3')]},'raw':!![]})[_0xdf3c('0x18')](handleEntityNotFound(_0x3cb8a7,null));}})[_0xdf3c('0x18')](function(_0x17669f){if(_0x17669f){var _0x2643be=_0x17669f['ChatOfflineMessageId']!==null;var _0x58edcc=path['join'](config[_0xdf3c('0xe4')],_0xdf3c('0xe5'));if(_0x2643be){_0x58edcc=path['join'](_0x58edcc,'offline-chat/');}var _0x2a8819=path['join'](_0x58edcc,_0x17669f['basename']);return _0x3cb8a7['download'](_0x2a8819);}})[_0xdf3c('0x38')](handleError(_0x3cb8a7,null));};exports[_0xdf3c('0xe6')]=function(_0x2ab6bc,_0x5126be){var _0x187ce8=null;var _0x51d880=null;var _0x1ce1b6=null;if(_0x2ab6bc[_0xdf3c('0x7f')]['id']){delete _0x2ab6bc[_0xdf3c('0x7f')]['id'];}if(_0x2ab6bc[_0xdf3c('0x7f')][_0xdf3c('0xe7')]){_0x1ce1b6=path[_0xdf3c('0xe8')](config[_0xdf3c('0xe4')],_0xdf3c('0xe9'),util[_0xdf3c('0xea')]('transcript-%s.txt',Date[_0xdf3c('0xeb')]()));_0x2ab6bc[_0xdf3c('0x7f')]['pathTranscript']=_0x1ce1b6;}return db[_0xdf3c('0x42')][_0xdf3c('0x6b')]({'where':{'id':_0x2ab6bc['params']['id']},'include':[{'model':db[_0xdf3c('0xd5')],'as':'Messages','include':[{'model':db[_0xdf3c('0x7e')],'as':_0xdf3c('0x7e')}]}]})[_0xdf3c('0x18')](handleEntityNotFound(_0x5126be,null))[_0xdf3c('0x18')](saveUpdates(_0x2ab6bc[_0xdf3c('0x7f')],null))[_0xdf3c('0x18')](function(_0x232b34){if(_0x232b34){_0x187ce8=_0x232b34;return db[_0xdf3c('0xc4')][_0xdf3c('0x6b')]({'where':{'id':_0x187ce8[_0xdf3c('0xa2')]}});}})[_0xdf3c('0x18')](function(_0x1c31ee){if(_0x1c31ee){_0x51d880=_0x1c31ee;return db[_0xdf3c('0xd8')][_0xdf3c('0x6b')]({'where':{'id':_0x187ce8[_0xdf3c('0x77')]}});}})[_0xdf3c('0x18')](function(_0x542a02){if(_0x542a02){if(_0x1ce1b6){var _0x3176cd=null;for(var _0x3f5b9d=0x1;_0x3f5b9d<_0x187ce8['Messages'][_0xdf3c('0x6a')];++_0x3f5b9d){_0x3176cd=_0x187ce8[_0xdf3c('0xec')][_0x3f5b9d];var _0x162d56=_0x3176cd[_0xdf3c('0x3d')]?util['format'](_0xdf3c('0xed'),_0x51d880[_0xdf3c('0xee')],_0x3176cd['UserId']):_0xdf3c('0xef');var _0x37b1a6=_0x2ab6bc['body']['customer']||util[_0xdf3c('0xea')](_0xdf3c('0xed'),_0xdf3c('0xf0'),_0x3176cd['ContactId']);switch(_0x51d880[_0xdf3c('0xf1')]){case'website_alias':_0x162d56=_0x3176cd[_0xdf3c('0x3d')]?util[_0xdf3c('0xea')](_0xdf3c('0xed'),_0x51d880[_0xdf3c('0xee')],_0x3176cd[_0xdf3c('0x3d')]):_0xdf3c('0xef');break;case'agent_alias':_0x162d56=_0x3176cd[_0xdf3c('0x3d')]?_0x3176cd['User'][_0xdf3c('0xf2')]||_0x3176cd[_0xdf3c('0x7e')][_0xdf3c('0xca')]:'System';break;case _0xdf3c('0xf3'):_0x162d56=_0x3176cd['UserId']?_0x3176cd[_0xdf3c('0x7e')][_0xdf3c('0xca')]:'System';break;default:_0x162d56=_0x3176cd[_0xdf3c('0x3d')]?util[_0xdf3c('0xea')](_0xdf3c('0xed'),_0x51d880[_0xdf3c('0xee')],_0x3176cd['UserId']):_0xdf3c('0xef');}var _0x2e4a80=util[_0xdf3c('0xea')](_0xdf3c('0xf4'),moment(_0x3176cd[_0xdf3c('0x83')])[_0xdf3c('0xea')](_0xdf3c('0xf5')),_0x3176cd['direction']==='in'?_0x37b1a6:_0x162d56,_0x3176cd[_0xdf3c('0x7f')]);if(!_0x3176cd[_0xdf3c('0xf6')]){fs[_0xdf3c('0xf7')](_0x1ce1b6,_0x2e4a80);}}return db[_0xdf3c('0xf8')][_0xdf3c('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xdf3c('0xf9')],'as':_0xdf3c('0xfa'),'raw':!![],'include':[{'model':db[_0xdf3c('0xfb')],'as':_0xdf3c('0xfb'),'raw':!![]}]}]});}}})[_0xdf3c('0x18')](function(_0x1b6928){if(!_0x1b6928||!_0x1b6928['Smtp']||!_0x2ab6bc[_0xdf3c('0x7f')])return _0x187ce8;var _0x30a520=_0x1b6928[_0xdf3c('0xfc')]();return respondWithRpcPromise('SendMail',_0xdf3c('0xfd'),{'account':_0x30a520,'message':{'from':util[_0xdf3c('0xea')](_0xdf3c('0xfe'),_0x1b6928[_0xdf3c('0x2c')],_0x1b6928[_0xdf3c('0xcb')]||_0x1b6928['Smtp'][_0xdf3c('0x9d')]),'to':_0x2ab6bc[_0xdf3c('0x7f')]['mailTranscript'],'subject':_0xdf3c('0xff'),'text':util[_0xdf3c('0xea')](_0xdf3c('0x100'),_0x2ab6bc[_0xdf3c('0x7f')][_0xdf3c('0xe7')]),'attachments':[{'path':_0x1ce1b6}]}})[_0xdf3c('0x18')](function(){return _0x187ce8;})[_0xdf3c('0x38')](function(_0x3d9041){logger[_0xdf3c('0x1f')](_0x3d9041);});})['then'](respondWithStatusCode(_0x5126be,0xc8))[_0xdf3c('0x38')](handleError(_0x5126be,null));};exports[_0xdf3c('0x101')]=function(_0x4fcb83,_0x39bc51){return db[_0xdf3c('0xd5')]['find']({'where':{'id':_0x4fcb83['params']['id']}})[_0xdf3c('0x18')](handleEntityNotFound(_0x39bc51,null))[_0xdf3c('0x18')](function(_0x2c6ae1){if(_0x2c6ae1){return _0x2c6ae1[_0xdf3c('0x101')](_0x4fcb83[_0xdf3c('0x7f')][_0xdf3c('0x102')],_[_0xdf3c('0x103')](_0x4fcb83[_0xdf3c('0x7f')],['ids','id'])||{});}})[_0xdf3c('0x18')](respondWithResult(_0x39bc51,null))[_0xdf3c('0x38')](handleError(_0x39bc51,null));};exports[_0xdf3c('0x104')]=function(_0x28bc25,_0x5037a5){var _0x37fd42={'raw':![],'where':{}};var _0x357055={};var _0x137d99={'count':0x0,'rows':[]};return db[_0xdf3c('0x42')]['findOne']({'where':{'id':_0x28bc25[_0xdf3c('0xbc')]['id']}})[_0xdf3c('0x18')](handleEntityNotFound(_0x5037a5,null))[_0xdf3c('0x18')](function(_0x58bc3a){if(_0x58bc3a){_0x357055['model']=_[_0xdf3c('0x49')](db[_0xdf3c('0xd5')][_0xdf3c('0x43')]);_0x357055['query']=_[_0xdf3c('0x49')](_0x28bc25[_0xdf3c('0x48')]);_0x357055[_0xdf3c('0x4a')]=_[_0xdf3c('0x4b')](_0x357055[_0xdf3c('0x47')],_0x357055['query']);_0x37fd42['attributes']=_[_0xdf3c('0x4b')](_0x357055['model'],qs[_0xdf3c('0x4d')](_0x28bc25[_0xdf3c('0x48')][_0xdf3c('0x4d')]));_0x37fd42[_0xdf3c('0x4c')]=_0x37fd42[_0xdf3c('0x4c')][_0xdf3c('0x6a')]?_0x37fd42['attributes']:_0x357055[_0xdf3c('0x47')];if(!_0x28bc25[_0xdf3c('0x48')][_0xdf3c('0x105')](_0xdf3c('0x4e'))){_0x37fd42['limit']=qs[_0xdf3c('0x27')](_0x28bc25[_0xdf3c('0x48')][_0xdf3c('0x27')]);_0x37fd42['offset']=qs['offset'](_0x28bc25[_0xdf3c('0x48')][_0xdf3c('0x25')]);}_0x37fd42['order']=qs[_0xdf3c('0x4f')](_0x28bc25['query'][_0xdf3c('0x4f')]);_0x37fd42[_0xdf3c('0x50')]=qs[_0xdf3c('0x4a')](_[_0xdf3c('0x51')](_0x28bc25[_0xdf3c('0x48')],_0x357055[_0xdf3c('0x4a')]));_0x37fd42['where'][_0xdf3c('0x106')]=_0x58bc3a['id'];if(_0x28bc25[_0xdf3c('0x48')][_0xdf3c('0x8c')]){_0x37fd42[_0xdf3c('0x50')]=_[_0xdf3c('0x2f')](_0x37fd42[_0xdf3c('0x50')],{'$or':_[_0xdf3c('0x32')](_0x37fd42[_0xdf3c('0x4c')],function(_0x43ce1f){var _0x127bfb={};_0x127bfb[_0x43ce1f]={'$like':'%'+_0x28bc25[_0xdf3c('0x48')]['filter']+'%'};return _0x127bfb;})});}if(_0x28bc25[_0xdf3c('0x48')][_0xdf3c('0x107')]){var _0x5a14cd=_0x28bc25[_0xdf3c('0x48')][_0xdf3c('0x107')][_0xdf3c('0x35')](',');var _0x31ec26={};_0x31ec26[_0x5a14cd[0x0]]={'$gte':moment(_0x5a14cd[0x1])[_0xdf3c('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x37fd42[_0xdf3c('0x50')]=_[_0xdf3c('0x2f')](_0x37fd42[_0xdf3c('0x50')],_0x31ec26);}_0x37fd42=_[_0xdf3c('0x2f')]({},_0x37fd42,_0x28bc25[_0xdf3c('0x108')]);return db[_0xdf3c('0xd5')][_0xdf3c('0xa5')]({'where':_0x37fd42[_0xdf3c('0x50')]})[_0xdf3c('0x18')](function(_0x4727f2){_0x137d99[_0xdf3c('0xa5')]=_0x4727f2;if(_0x28bc25[_0xdf3c('0x48')][_0xdf3c('0xbd')]){_0x37fd42['include']=[{'all':!![]}];}return db[_0xdf3c('0xd5')][_0xdf3c('0x109')](_0x37fd42);})['then'](function(_0xc59cea){_0x137d99[_0xdf3c('0x10a')]=_0xc59cea;return _0x137d99;});}})[_0xdf3c('0x18')](respondWithFilteredResult(_0x5037a5,_0x37fd42))[_0xdf3c('0x38')](handleError(_0x5037a5,null));};exports[_0xdf3c('0x10b')]=function(_0x18e2f3,_0x2269da){var _0x15322a={'where':{}},_0xc3b6a1={},_0x3d9a1e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xdf3c('0xc3')]({'where':{'id':_0x18e2f3[_0xdf3c('0xbc')]['id']}})['then'](handleEntityNotFound(_0x2269da,null))[_0xdf3c('0x18')](function(_0x49981e){if(_0x49981e){_0xc3b6a1[_0xdf3c('0x47')]=_['keys'](db[_0xdf3c('0xd5')]['rawAttributes']);_0xc3b6a1[_0xdf3c('0x48')]=_[_0xdf3c('0x49')](_0x18e2f3[_0xdf3c('0x48')]);_0xc3b6a1[_0xdf3c('0x4a')]=_[_0xdf3c('0x4b')](_0xc3b6a1[_0xdf3c('0x47')],_0xc3b6a1[_0xdf3c('0x48')]);_0x15322a[_0xdf3c('0x4c')]=_['intersection'](_0xc3b6a1[_0xdf3c('0x47')],qs[_0xdf3c('0x4d')](_0x18e2f3[_0xdf3c('0x48')]['fields']));_0x15322a[_0xdf3c('0x4c')]=_0x15322a[_0xdf3c('0x4c')][_0xdf3c('0x6a')]?_0x15322a[_0xdf3c('0x4c')]:_0xc3b6a1['model'];if(!_0x18e2f3['query']['hasOwnProperty']('nolimit')){_0x15322a[_0xdf3c('0x27')]=qs[_0xdf3c('0x27')](_0x18e2f3[_0xdf3c('0x48')][_0xdf3c('0x27')]);_0x15322a[_0xdf3c('0x25')]=qs[_0xdf3c('0x25')](_0x18e2f3[_0xdf3c('0x48')]['offset']);}_0x15322a[_0xdf3c('0x97')]=qs['sort'](_0x18e2f3[_0xdf3c('0x48')][_0xdf3c('0x4f')]);_0x15322a[_0xdf3c('0x50')]=qs[_0xdf3c('0x4a')](_[_0xdf3c('0x51')](_0x18e2f3[_0xdf3c('0x48')],_0xc3b6a1[_0xdf3c('0x4a')]));_0x15322a[_0xdf3c('0x50')]['ChatInteractionId']=_0x49981e['id'];if(_0x18e2f3[_0xdf3c('0x48')][_0xdf3c('0x8c')]){_0x15322a[_0xdf3c('0x50')]=_[_0xdf3c('0x2f')](_0x15322a[_0xdf3c('0x50')],{'$or':_['map'](_0x15322a['attributes'],function(_0x31e0a4){var _0x260466={};_0x260466[_0x31e0a4]={'$like':'%'+_0x18e2f3[_0xdf3c('0x48')][_0xdf3c('0x8c')]+'%'};return _0x260466;})});}_0x15322a[_0xdf3c('0x50')][_0xdf3c('0xf6')]=![];if(_0x18e2f3[_0xdf3c('0x48')]['id']){_0x15322a[_0xdf3c('0x50')]['id']={'$gt':_0x18e2f3[_0xdf3c('0x48')]['id']};}_0x15322a=_[_0xdf3c('0x2f')]({},_0x15322a,_0x18e2f3[_0xdf3c('0x108')]);return db['ChatMessage'][_0xdf3c('0xa5')]({'where':_0x15322a[_0xdf3c('0x50')]})[_0xdf3c('0x18')](function(_0x1d4440){_0x3d9a1e[_0xdf3c('0xa5')]=_0x1d4440;_0x15322a[_0xdf3c('0xbe')]=[];if(_0x18e2f3[_0xdf3c('0x48')]['includeAgent']){_0x15322a[_0xdf3c('0xbe')]['push']({'model':db[_0xdf3c('0x7e')],'as':'User','attributes':['id',_0xdf3c('0xca'),_0xdf3c('0xf2')]});}if(_0x18e2f3['query']['includeAll']){_0x15322a[_0xdf3c('0xbe')]=[{'all':!![]}];}return db[_0xdf3c('0xd5')][_0xdf3c('0x109')](_0x15322a);})[_0xdf3c('0x18')](function(_0x310b34){_0x3d9a1e['rows']=_0x310b34;return _0x3d9a1e;});}})[_0xdf3c('0x18')](respondWithFilteredResult(_0x2269da,_0x15322a))[_0xdf3c('0x38')](handleError(_0x2269da,null));};exports[_0xdf3c('0x10c')]=function(_0x337945,_0x40944d){return db['ChatInteraction'][_0xdf3c('0x6b')]({'where':{'id':_0x337945['params']['id']}})[_0xdf3c('0x18')](handleEntityNotFound(_0x40944d,null))['then'](function(_0x5bf37b){if(_0x5bf37b){return _0x5bf37b[_0xdf3c('0x10d')](_0x337945[_0xdf3c('0x7f')][_0xdf3c('0x102')],_[_0xdf3c('0x103')](_0x337945[_0xdf3c('0x7f')],['ids','id'])||{})[_0xdf3c('0x10e')](function(){return db[_0xdf3c('0x7b')]['findAll']({'attributes':['id',_0xdf3c('0x2c'),_0xdf3c('0x54')],'where':{'id':_0x337945[_0xdf3c('0x7f')][_0xdf3c('0x102')]}});})[_0xdf3c('0x18')](function(_0x5e1788){socket[_0xdf3c('0x10f')](_0xdf3c('0x110'),{'id':Number(_0x337945[_0xdf3c('0xbc')]['id']),'tags':_0x5e1788||[]});return{'id':Number(_0x337945[_0xdf3c('0xbc')]['id']),'tags':_0x5e1788||[]};});}})[_0xdf3c('0x18')](respondWithResult(_0x40944d,null))['catch'](handleError(_0x40944d,null));};exports[_0xdf3c('0x111')]=function(_0x43fc55,_0x81b8dd){return db[_0xdf3c('0x42')][_0xdf3c('0x6b')]({'where':{'id':_0x43fc55[_0xdf3c('0xbc')]['id']}})[_0xdf3c('0x18')](handleEntityNotFound(_0x81b8dd,null))[_0xdf3c('0x18')](function(_0xb2e933){if(_0xb2e933){return _0xb2e933[_0xdf3c('0x111')](_0x43fc55[_0xdf3c('0x48')][_0xdf3c('0x102')]);}})[_0xdf3c('0x18')](respondWithStatusCode(_0x81b8dd,null))[_0xdf3c('0x38')](handleError(_0x81b8dd,null));};exports[_0xdf3c('0x112')]=function(_0x2be6c7,_0x18bbe0){var _0x174e96=moment()['unix']()[_0xdf3c('0xa4')]();var _0x350e07=path[_0xdf3c('0xe8')](config['root'],_0xdf3c('0x113'),'files',_0xdf3c('0x114'));var _0x4ac3d7=path[_0xdf3c('0xe8')](config[_0xdf3c('0xe4')],_0xdf3c('0x113'),_0xdf3c('0x115'),_0xdf3c('0x116'));var _0x227591=path[_0xdf3c('0xe8')](_0x350e07,_0x174e96);var _0x4642ca=util[_0xdf3c('0xea')]('transcript-%d-%s.zip',_0x2be6c7[_0xdf3c('0xbc')]['id'],_0x174e96);var _0x3e3d63=path[_0xdf3c('0xe8')](_0x350e07,_0x4642ca);var _0x2964ed=[];_0x2964ed['push']({'model':db['User'],'as':_0xdf3c('0x7e'),'attributes':['id',_0xdf3c('0xca')],'raw':!![]});_0x2964ed[_0xdf3c('0x37')]({'model':db[_0xdf3c('0xd8')],'as':'Contact','attributes':['id',_0xdf3c('0x117'),'lastName'],'raw':!![]});if(_0x2be6c7['query'][_0xdf3c('0x116')]){_0x2964ed[_0xdf3c('0x37')]({'model':db['Attachment'],'as':_0xdf3c('0xe2'),'raw':!![]});}var _0x19024e=[{'model':db['ChatMessage'],'as':_0xdf3c('0xec'),'attributes':['id',_0xdf3c('0x7f'),'createdAt',_0xdf3c('0x118'),_0xdf3c('0xf6'),_0xdf3c('0x88')],'include':_0x2964ed}];_0x19024e[_0xdf3c('0x37')]({'model':db[_0xdf3c('0xc4')],'as':_0xdf3c('0x119'),'attributes':['id','name']});_0x19024e['push']({'model':db[_0xdf3c('0x7e')],'as':_0xdf3c('0x11a'),'attributes':['id',_0xdf3c('0xca')]});return db[_0xdf3c('0x42')][_0xdf3c('0x6b')]({'where':{'id':_0x2be6c7[_0xdf3c('0xbc')]['id']},'include':_0x19024e})['then'](handleEntityNotFound(_0x18bbe0,null))[_0xdf3c('0x18')](function(_0x1605f1){if(_0x1605f1){var _0x3e7b1c=_0x1605f1[_0xdf3c('0x11b')]({'plain':!![]});fs['mkdirSync'](_0x227591);var _0x2f3248={'channel':_0xdf3c('0x11c'),'account':_0x3e7b1c['Account'][_0xdf3c('0x2c')],'agent':_0x3e7b1c[_0xdf3c('0x11a')]?_0x3e7b1c[_0xdf3c('0x11a')][_0xdf3c('0xca')]:'N.A.','createdAt':moment(_0x3e7b1c[_0xdf3c('0x83')])[_0xdf3c('0xea')](_0xdf3c('0x11d'))[_0xdf3c('0xa4')](),'closedAt':_0x3e7b1c['closed']?moment(_0x3e7b1c['closedAt'])[_0xdf3c('0xea')](_0xdf3c('0x11d'))[_0xdf3c('0xa4')]():'','disposition':_0x3e7b1c[_0xdf3c('0x3f')],'chatInfo':{'browser':_0x3e7b1c[_0xdf3c('0x11e')],'os':_0x3e7b1c[_0xdf3c('0x11f')],'referer':_0x3e7b1c[_0xdf3c('0x120')],'customerIp':_0x3e7b1c[_0xdf3c('0x121')],'customerPort':_0x3e7b1c['customerPort']?_0x3e7b1c[_0xdf3c('0x122')]:_0xdf3c('0x123')},'messages':_(_0x3e7b1c['Messages'])[_0xdf3c('0x124')]()[_0xdf3c('0x8c')]({'secret':![]})['map'](function(_0x3d497d){if(_0x3d497d['Attachment']){var _0x3c572d=path[_0xdf3c('0xe8')](_0x4ac3d7,_0x3d497d[_0xdf3c('0xe2')][_0xdf3c('0xdd')]);if(fs['existsSync'](_0x3c572d)){fs['createReadStream'](_0x3c572d)['pipe'](fs[_0xdf3c('0x125')](path[_0xdf3c('0xe8')](_0x227591,_0x3d497d[_0xdf3c('0xe2')][_0xdf3c('0xdd')])));}}return{'date':moment(_0x3d497d[_0xdf3c('0x83')])[_0xdf3c('0xea')](_0xdf3c('0x11d'))['toString'](),'sender':_0x3d497d[_0xdf3c('0x118')]===_0xdf3c('0x126')?_0x3d497d['User']?_0x3d497d[_0xdf3c('0x7e')]['fullname']:_0xdf3c('0xef'):_0x3d497d[_0xdf3c('0x71')][_0xdf3c('0x117')]+(_0x3d497d['Contact'][_0xdf3c('0x127')]?'\x20'+_0x3d497d[_0xdf3c('0x71')][_0xdf3c('0x127')]:''),'body':_0x3d497d[_0xdf3c('0xe2')]?_0x3d497d[_0xdf3c('0xe2')]['basename']:_0x3d497d[_0xdf3c('0x7f')],'direction':_0x3d497d[_0xdf3c('0x118')]===_0xdf3c('0x126')?'A':'C','secret':_0x3d497d[_0xdf3c('0xf6')],'read':_0x3d497d[_0xdf3c('0x88')],'attachment':_0x3d497d[_0xdf3c('0xe2')]};})[_0xdf3c('0x6d')]()};return ejs['renderFile'](path[_0xdf3c('0xe8')](config[_0xdf3c('0xe4')],_0xdf3c('0x113'),'views',_0xdf3c('0x128')),{'interaction':_0x2f3248})['then'](function(_0x200b6b){var _0x42d103=path['join'](_0x227591,_0xdf3c('0x129')+_0x3e7b1c['id']+'-'+_0x174e96+_0xdf3c('0x12a'));var _0x23ae7c={'path':_0x42d103,'channel':_0xdf3c('0x11c'),'interactionId':_0x3e7b1c['id']};return pdf[_0xdf3c('0x12b')](_0x200b6b,_0x23ae7c);})[_0xdf3c('0x18')](function(){return new Promise(function(_0x43057f,_0x429f2a){zipdir(_0x227591,{'saveTo':_0x3e3d63},function(_0x3d56cc,_0x34441a){if(_0x3d56cc)return _0x429f2a(_0x3d56cc);return _0x43057f(_0x34441a);});})[_0xdf3c('0x18')](function(){return new BPromise(function(_0x265d99,_0x59d1db){rimraf(_0x227591,function(_0x2888e3){if(_0x2888e3)_0x59d1db(_0x2888e3);return _0x265d99();});});})['then'](function(){return _0x18bbe0['download'](_0x3e3d63,_0x4642ca,function(_0x4a3bdd){if(_0x4a3bdd){logger['error'](_0xdf3c('0x12c'),_0x4a3bdd);}else{fs[_0xdf3c('0x12d')](_0x3e3d63);}});});});}else{return _0x18bbe0[_0xdf3c('0x2a')](0xc8);}})[_0xdf3c('0x38')](handleError(_0x18bbe0,null));};
\ No newline at end of file
+var _0x4b84=['compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','rows','show','params','ChatInteraction','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','file','basename','filename','attachmentDownload','Attachment','join','root','server/files/attachments/','offline-chat/','download','format','transcript-%s.txt','now','Messages','CmContact','%s%d','agentAlias','System','customer','agentIdentifier','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','rawAttributes','sort','findAll','getMyMessages','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','firstName','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','lastName','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','rimraf','zip-dir','bluebird','path','ejs','lodash','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','update','destroy','stack','name','render','merge','body','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','closed','UserId','disposition','total','index','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','u.id\x20=\x20ui.UserId','select','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$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','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some'];(function(_0x38a913,_0x4270e6){var _0x120cc8=function(_0x3c0998){while(--_0x3c0998){_0x38a913['push'](_0x38a913['shift']());}};_0x120cc8(++_0x4270e6);}(_0x4b84,0x1cc));var _0x44b8=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x4b84[_0x35ef6b];return _0x3ad145;};'use strict';var rimraf=require(_0x44b8('0x0'));var zipdir=require(_0x44b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x44b8('0x3'));var ejs=require(_0x44b8('0x4'));var fs=require('fs');var _=require(_0x44b8('0x5'));var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x44b8('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x44b8('0x7'))('api');var config=require(_0x44b8('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x44b8('0x9')](config[_0x44b8('0xa')],{'host':_0x44b8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44b8('0xa')]));require(_0x44b8('0xc'))[_0x44b8('0xd')](socket);var jayson=require(_0x44b8('0xe'));var client=jayson[_0x44b8('0xf')][_0x44b8('0x10')]({'port':0x232b});var client9004=jayson[_0x44b8('0xf')]['http']({'port':0x232c});function respondWithRpcPromise(_0x147529,_0x4301a6,_0x4bcc43,_0x194230){return new BPromise(function(_0x490bc6,_0x833ea3){var _0x18d642=_0x194230||client;return _0x18d642['request'](_0x147529,_0x4bcc43)[_0x44b8('0x11')](function(_0x4be54c){logger['info'](_0x44b8('0x12'),_0x4301a6,_0x44b8('0x13'));logger[_0x44b8('0x14')](_0x44b8('0x15'),_0x4301a6,'request\x20sent',JSON['stringify'](_0x4be54c));if(_0x4be54c['error']){if(_0x4be54c[_0x44b8('0x16')]['code']===0x1f4){logger[_0x44b8('0x16')](_0x44b8('0x12'),_0x4301a6,_0x4be54c['error'][_0x44b8('0x17')]);return _0x833ea3(_0x4be54c[_0x44b8('0x16')]['message']);}logger[_0x44b8('0x16')](_0x44b8('0x12'),_0x4301a6,_0x4be54c['error'][_0x44b8('0x17')]);return _0x490bc6(_0x4be54c[_0x44b8('0x16')][_0x44b8('0x17')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x12'),_0x4301a6,_0x44b8('0x13'));_0x490bc6(_0x4be54c[_0x44b8('0x19')][_0x44b8('0x17')]);}})[_0x44b8('0x1a')](function(_0x1e0f2d){logger[_0x44b8('0x16')](_0x44b8('0x12'),_0x4301a6,_0x1e0f2d);_0x833ea3(_0x1e0f2d);});});}function respondWithStatusCode(_0x48327e,_0x56549a){_0x56549a=_0x56549a||0xcc;return function(_0x3a8aa4){if(_0x3a8aa4){return _0x48327e[_0x44b8('0x1b')](_0x56549a);}return _0x48327e[_0x44b8('0x1c')](_0x56549a)[_0x44b8('0x1d')]();};}function respondWithResult(_0x51a34a,_0x402497){_0x402497=_0x402497||0xc8;return function(_0x54677c){if(_0x54677c){return _0x51a34a[_0x44b8('0x1c')](_0x402497)[_0x44b8('0x1e')](_0x54677c);}};}function respondWithFilteredResult(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(_0x230a3d){var _0x59acbc=typeof _0x47689e[_0x44b8('0x1f')]==='undefined'&&typeof _0x47689e[_0x44b8('0x20')]===_0x44b8('0x21');var _0x549a26=_0x230a3d[_0x44b8('0x22')];var _0x470f49=_0x59acbc?0x0:_0x47689e[_0x44b8('0x1f')];var _0x59c1bf=_0x59acbc?_0x230a3d[_0x44b8('0x22')]:_0x47689e[_0x44b8('0x1f')]+_0x47689e['limit'];var _0x2e0174;if(_0x59c1bf>=_0x549a26){_0x59c1bf=_0x549a26;_0x2e0174=0xc8;}else{_0x2e0174=0xce;}_0x25a0c1['status'](_0x2e0174);return _0x25a0c1[_0x44b8('0x23')]('Content-Range',_0x470f49+'-'+_0x59c1bf+'/'+_0x549a26)['json'](_0x230a3d);}return null;};}function saveUpdates(_0x5948dc){return function(_0x387293){if(_0x387293){return _0x387293[_0x44b8('0x24')](_0x5948dc)[_0x44b8('0x11')](function(_0x1bd1be){return _0x1bd1be;});}return null;};}function removeEntity(_0x38cd17){return function(_0xc3f667){if(_0xc3f667){return _0xc3f667[_0x44b8('0x25')]()[_0x44b8('0x11')](function(){_0x38cd17[_0x44b8('0x1c')](0xcc)[_0x44b8('0x1d')]();});}};}function handleEntityNotFound(_0x5e1129){return function(_0x417d81){if(!_0x417d81){_0x5e1129[_0x44b8('0x1b')](0x194);}return _0x417d81;};}function handleError(_0x5189dd,_0x261ff2){_0x261ff2=_0x261ff2||0x1f4;return function(_0x538db7){logger[_0x44b8('0x16')](_0x538db7[_0x44b8('0x26')]);if(_0x538db7[_0x44b8('0x27')]){delete _0x538db7[_0x44b8('0x27')];}_0x5189dd[_0x44b8('0x1c')](_0x261ff2)['send'](_0x538db7);};}function getMustacheRender(_0x16b706,_0x2d0eda){return Mustache[_0x44b8('0x28')](_0x16b706,_[_0x44b8('0x29')](_0x2d0eda[_0x44b8('0x2a')],{'contact':_0x2d0eda['contact'],'message':_0x2d0eda[_0x44b8('0x17')],'agent':_0x2d0eda[_0x44b8('0x2b')],'interaction':_0x2d0eda[_0x44b8('0x2c')],'account':_0x2d0eda[_0x44b8('0x2d')]}))||'';}function getInteractionUsers(_0x140a79,_0x3cb5a2){return new BPromise(function(_0x2e8b88,_0x14a9d7){try{if(_0x3cb5a2[_0x140a79['id']]){_0x140a79[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x3cb5a2[_0x140a79['id']],function(_0x13994c){return{'id':_0x13994c['id'],'fullname':_0x13994c[_0x44b8('0x30')]};});}}catch(_0xa5ac3e){_0x14a9d7(_0xa5ac3e);}_0x2e8b88(_0x140a79);});}function getInteractionTags(_0xae15f4,_0x1e1a8a){return new BPromise(function(_0x1becb0,_0x323c50){try{if(_0xae15f4[_0x44b8('0x31')]){_0xae15f4[_0x44b8('0x32')]=[];_0xae15f4[_0x44b8('0x31')][_0x44b8('0x33')](',')[_0x44b8('0x34')](function(_0x59848c){_0xae15f4[_0x44b8('0x32')][_0x44b8('0x35')](_0x1e1a8a[_0x59848c]);});}delete _0xae15f4['TagIds'];}catch(_0x25688b){_0x323c50(_0x25688b);}_0x1becb0(_0xae15f4);});}function updateChatInteraction(_0x2b9139,_0x6658be,_0x332c2b){return new BPromise(function(_0x494687,_0x221543){return getInteractionUsers(_0x2b9139,_0x332c2b)[_0x44b8('0x11')](function(_0x3611b4){return getInteractionTags(_0x3611b4,_0x6658be);})[_0x44b8('0x11')](function(_0x9cb2a){return getStateInteraction(_0x9cb2a);})[_0x44b8('0x11')](function(_0x46aadd){_0x494687(_0x46aadd);})[_0x44b8('0x1a')](function(_0x209039){_0x221543(_0x209039);});});}function getStateInteraction(_0x3d1be1){return new BPromise(function(_0x1c9983){_0x3d1be1[_0x44b8('0x36')]=0x0;_0x3d1be1[_0x44b8('0x37')]=0x0;_0x3d1be1[_0x44b8('0x38')]=0x0;_0x3d1be1[_0x44b8('0x39')]=0x0;_0x3d1be1[_0x44b8('0x3a')]=0x0;_0x3d1be1['total']=0x0;if(!_0x3d1be1[_0x44b8('0x3b')]&&!_0x3d1be1[_0x44b8('0x3c')]){_0x3d1be1[_0x44b8('0x36')]+=0x1;}if(!_0x3d1be1['closed']&&_0x3d1be1[_0x44b8('0x3c')]){_0x3d1be1[_0x44b8('0x37')]+=0x1;if(_0x3d1be1[_0x44b8('0x36')]){_0x3d1be1['waiting']-=0x1;}}if(_0x3d1be1[_0x44b8('0x3b')]&&_0x3d1be1[_0x44b8('0x3d')]===_0x44b8('0x3a')){_0x3d1be1[_0x44b8('0x3a')]+=0x1;if(_0x3d1be1[_0x44b8('0x36')]){_0x3d1be1['waiting']-=0x1;}}else if(_0x3d1be1['closed']&&!_0x3d1be1[_0x44b8('0x3c')]&&_0x3d1be1[_0x44b8('0x3d')]){_0x3d1be1[_0x44b8('0x39')]+=0x1;if(_0x3d1be1[_0x44b8('0x36')]){_0x3d1be1[_0x44b8('0x36')]-=0x1;}}else if(_0x3d1be1[_0x44b8('0x3b')]&&_0x3d1be1[_0x44b8('0x3c')]){_0x3d1be1[_0x44b8('0x38')]+=0x1;if(_0x3d1be1[_0x44b8('0x37')]){_0x3d1be1[_0x44b8('0x37')]-=0x1;}}_0x3d1be1[_0x44b8('0x3e')]+=0x1;_0x1c9983(_0x3d1be1);});}exports[_0x44b8('0x3f')]=function(_0xc1b9de,_0x1236c7){var _0x149731={},_0x60eeb2={},_0xce06dc={'count':0x0,'rows':[]};var _0x3b3d5d=_[_0x44b8('0x2f')](db['ChatInteraction']['rawAttributes'],function(_0x3b1b12){return{'name':_0x3b1b12[_0x44b8('0x40')],'type':_0x3b1b12[_0x44b8('0x41')][_0x44b8('0x42')]};});_0x60eeb2[_0x44b8('0x43')]=_[_0x44b8('0x2f')](_0x3b3d5d,_0x44b8('0x27'));_0x60eeb2['query']=_[_0x44b8('0x44')](_0xc1b9de['query']);_0x60eeb2[_0x44b8('0x45')]=_[_0x44b8('0x46')](_0x60eeb2[_0x44b8('0x43')],_0x60eeb2[_0x44b8('0x47')]);_0x149731[_0x44b8('0x48')]=_[_0x44b8('0x46')](_0x60eeb2['model'],qs[_0x44b8('0x49')](_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x49')]));_0x149731[_0x44b8('0x48')]=_0x149731['attributes'][_0x44b8('0x4a')]?_0x149731[_0x44b8('0x48')]:_0x60eeb2[_0x44b8('0x43')];if(!_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x4b')](_0x44b8('0x4c'))){_0x149731['limit']=qs[_0x44b8('0x20')](_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x20')]);_0x149731[_0x44b8('0x1f')]=qs[_0x44b8('0x1f')](_0xc1b9de['query']['offset']);}_0x149731[_0x44b8('0x4d')]=qs['sort'](_0xc1b9de[_0x44b8('0x47')]['sort']);_0x149731[_0x44b8('0x4e')]=qs[_0x44b8('0x45')](_[_0x44b8('0x4f')](_0xc1b9de[_0x44b8('0x47')],_0x60eeb2[_0x44b8('0x45')]),_0x3b3d5d);var _0x32f588=[];var _0xdc67e8=squel['select']()[_0x44b8('0x50')]('id')[_0x44b8('0x50')](_0x44b8('0x27'))['field'](_0x44b8('0x51'))[_0x44b8('0x52')](_0x44b8('0x53'));var _0x2b256b=squel['select']()[_0x44b8('0x50')](_0x44b8('0x54'))['field'](_0x44b8('0x55'))[_0x44b8('0x50')](_0x44b8('0x56'))[_0x44b8('0x52')](_0x44b8('0x57'),'ui')['left_join']('users','u',_0x44b8('0x58'));var _0x3154bc=squel[_0x44b8('0x59')]()[_0x44b8('0x52')](_0x44b8('0x5a'),'i')[_0x44b8('0x5b')](_0x44b8('0x5c'),'c',_0x44b8('0x5d'))[_0x44b8('0x5b')](_0x44b8('0x5e'),'o',_0x44b8('0x5f'))[_0x44b8('0x5b')]('chat_websites','a',_0x44b8('0x60'))[_0x44b8('0x5b')](_0x44b8('0x61'),'me',_0x44b8('0x62'))[_0x44b8('0x5b')](_0x44b8('0x63'),'it',_0x44b8('0x64'))[_0x44b8('0x5b')](_0x44b8('0x53'),'t',_0x44b8('0x65'));var _0x2ecff9=squel[_0x44b8('0x66')]();var _0x1da152=[];var _0x17ff84=squel[_0x44b8('0x66')]();var _0x293c2e;if(_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x67')]){_0x293c2e=as['parseSearch'](_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x67')]);var _0x10e519=_0x293c2e[_0x44b8('0x68')];for(var _0x51f763=0x0;_0x51f763<_0x293c2e[_0x44b8('0x69')][_0x44b8('0x4a')];_0x51f763++){var _0x4c0869=_0x293c2e[_0x44b8('0x69')][_0x51f763];var _0xc4d667='i';var _0x5df821=_[_0x44b8('0x6a')](_0x3b3d5d,[_0x44b8('0x27'),_0x4c0869['field']]);if(!_0x5df821){switch(_0x4c0869[_0x44b8('0x50')]){case _0x44b8('0x6b'):if(_0x4c0869[_0x44b8('0x6c')]==0x1){_0x3154bc['having']('`'+_0x4c0869[_0x44b8('0x50')]+'`\x20=\x200');}else{_0x3154bc[_0x44b8('0x6d')]('`'+_0x4c0869['field']+_0x44b8('0x6e'));}break;case _0x44b8('0x6f'):if(_0x4c0869[_0x44b8('0x70')]===_0x44b8('0x71')){if(_0x4c0869[_0x44b8('0x6c')][_0x44b8('0x33')]('\x20')['length']>0x1){_0x2ecff9[_0x10e519](_0x44b8('0x72'),qs['getFullTextValue'](_0x4c0869[_0x44b8('0x6c')]),null);}else{var _0x22c762='%'+_0x4c0869['value']+'%';_0x2ecff9[_0x10e519](_0x44b8('0x73'),_0x22c762,_0x22c762,_0x22c762);}}else{_0x5df821=_[_0x44b8('0x6a')](_0x3b3d5d,[_0x44b8('0x27'),_0x44b8('0x74')]);_0x4c0869[_0x44b8('0x50')]=_0x44b8('0x74');_0x5beb66=as[_0x44b8('0x75')](_0xc4d667,_0x5df821[_0x44b8('0x41')],_0x4c0869);_0x2ecff9[_0x10e519](_0x5beb66[_0x44b8('0x76')],_0x5beb66[_0x44b8('0x6c')][_0x44b8('0x77')],_0x5beb66[_0x44b8('0x6c')]['end']);}break;case _0x44b8('0x78'):var _0x4052a9=_0x4c0869[_0x44b8('0x6c')]['split'](',')[_0x44b8('0x2f')](function(_0x5cc122){return Number(_0x5cc122);});_0x4052a9['forEach'](function(_0x10f6cc){_0x17ff84['or'](_0x44b8('0x79'),'%,'+_0x10f6cc+',%');});_0x1da152=_[_0x44b8('0x7a')](_0x1da152,_0x4052a9);break;case _0x44b8('0x7b'):if(_0x4c0869[_0x44b8('0x70')]==='$substring'){_0x2ecff9[_0x10e519](_0x44b8('0x7c'),'%'+_0x4c0869[_0x44b8('0x6c')]+'%',null);}else{_0x5df821=_[_0x44b8('0x6a')](_0x3b3d5d,[_0x44b8('0x27'),_0x44b8('0x3c')]);_0x4c0869[_0x44b8('0x50')]=_0x44b8('0x3c');_0x5beb66=as[_0x44b8('0x75')](_0xc4d667,_0x5df821['type'],_0x4c0869);_0x2ecff9[_0x10e519](_0x5beb66[_0x44b8('0x76')],_0x5beb66[_0x44b8('0x6c')][_0x44b8('0x77')],_0x5beb66[_0x44b8('0x6c')]['end']);}break;case'body':_0x5beb66=as['buildExpression']('me',null,_0x4c0869);_0x2ecff9[_0x10e519](_0x5beb66[_0x44b8('0x76')],_0x5beb66[_0x44b8('0x6c')][_0x44b8('0x77')],_0x5beb66[_0x44b8('0x6c')][_0x44b8('0x1d')]);break;}}else{var _0x5beb66=as[_0x44b8('0x75')](_0xc4d667,_0x5df821['type'],_0x4c0869);_0x2ecff9[_0x10e519](_0x5beb66[_0x44b8('0x76')],_0x5beb66[_0x44b8('0x6c')][_0x44b8('0x77')],_0x5beb66['value']['end']);}}}else{var _0xb4c6dc=_(_0xc1b9de[_0x44b8('0x47')])[_0x44b8('0x44')]()['map'](function(_0x1f5277){return _[_0x44b8('0x7d')](_0x3b3d5d,[_0x44b8('0x27'),_0x1f5277])?_0x1f5277:undefined;})[_0x44b8('0x7e')]()[_0x44b8('0x6c')]();if(!_['isEmpty'](_0xb4c6dc)){_0xb4c6dc[_0x44b8('0x34')](function(_0x1888f8){if(_0x1888f8===_0x44b8('0x7f')){_0x3154bc[_0x44b8('0x4e')](_0x44b8('0x80'),[]['concat'](_0xc1b9de[_0x44b8('0x47')][_0x1888f8]));}else if(_0x1888f8===_0x44b8('0x81')){var _0x4e46c2=JSON[_0x44b8('0x82')](_0xc1b9de[_0x44b8('0x47')][_0x1888f8])[_0x44b8('0x83')];var _0x1c7ef2=JSON['parse'](_0xc1b9de[_0x44b8('0x47')][_0x1888f8])[_0x44b8('0x84')];_0x3154bc['where'](_0x44b8('0x85'),_0x4e46c2,_0x1c7ef2);}else{if(_0xc1b9de[_0x44b8('0x47')][_0x1888f8]==='null'){_0x3154bc[_0x44b8('0x4e')]('i.'+_0x1888f8+'\x20IS\x20NULL');}else{_0x3154bc['where']('i.'+_0x1888f8+_0x44b8('0x86'),_0xc1b9de[_0x44b8('0x47')][_0x1888f8]);}}});}if(_0xc1b9de[_0x44b8('0x47')]['read']){if(_0xc1b9de['query']['read']==0x1){_0x3154bc[_0x44b8('0x6d')](_0x44b8('0x87'));}else{_0x3154bc[_0x44b8('0x6d')](_0x44b8('0x88'));}}if(_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x89')]){_0x1da152=_[_0x44b8('0x8a')](_0xc1b9de[_0x44b8('0x47')]['tag'])?_0xc1b9de[_0x44b8('0x47')]['tag']:new Array(_0xc1b9de['query']['tag']);_0x1da152[_0x44b8('0x34')](function(_0x5ab8b1){_0x17ff84['or'](_0x44b8('0x79'),'%,'+_0x5ab8b1+',%');});}if(_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x8b')]){var _0x306793=_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x8b')][_0x44b8('0x8c')]('\x5c','\x5c\x5c')[_0x44b8('0x8c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x306793)){_0x2ecff9['or'](_0x44b8('0x8d'),_0x306793+'%');}else{_0x2ecff9['or'](_0x44b8('0x8e'),qs[_0x44b8('0x8f')](_0x306793))['or'](_0x44b8('0x90'),_0x306793+'%');}}}_0x3154bc[_0x44b8('0x4e')](_0x2ecff9);_0x3154bc[_0x44b8('0x91')](_0x44b8('0x92'));var _0x41ec83={'type':db[_0x44b8('0x93')]['QueryTypes']['SELECT'],'raw':!![]};var _0x19c198=_0x3154bc['clone']();_0x19c198[_0x44b8('0x50')](_0x44b8('0x92'));_0x19c198[_0x44b8('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x149731['order']){_0x149731[_0x44b8('0x4d')]['forEach'](function(_0x353ff1){var _0x2812da=_0x353ff1[0x0]===_0x44b8('0x94')?_0x353ff1[0x0]:'i.'+_0x353ff1[0x0];_0x3154bc[_0x44b8('0x4d')](_0x2812da,_0x353ff1[0x1]===_0x44b8('0x95')?![]:!![]);});}if(!_[_0x44b8('0x96')](_0x1da152)){_0x3154bc[_0x44b8('0x6d')](_0x17ff84);_0x19c198[_0x44b8('0x4e')](_0x44b8('0x97'),_0x1da152);}BPromise[_0x44b8('0x98')]()[_0x44b8('0x11')](function(){if(!_0x293c2e){if(_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x7f')])return;_0x19c198[_0x44b8('0x4e')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3154bc[_0x44b8('0x4e')](_0x44b8('0x99'));return;}if(_0xc1b9de[_0x44b8('0x9a')][_0x44b8('0x9b')]!==_0x44b8('0x2b'))return;return _0xc1b9de[_0x44b8('0x9a')][_0x44b8('0x9c')]({'attributes':['id'],'raw':!![]})[_0x44b8('0x11')](function(_0x39dc52){if(_[_0x44b8('0x96')](_0x39dc52)){_0x19c198[_0x44b8('0x4e')](_0x44b8('0x9d'));_0x3154bc[_0x44b8('0x4e')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x19c198[_0x44b8('0x4e')](_0x44b8('0x80'),_[_0x44b8('0x2f')](_0x39dc52,'id'));_0x3154bc['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x44b8('0x2f')](_0x39dc52,'id'));}});})[_0x44b8('0x11')](function(){if(_0xc1b9de[_0x44b8('0x9a')]['role']===_0x44b8('0x2b')&&!_0x293c2e&&!_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x7f')])return[];return db[_0x44b8('0x9e')][_0x44b8('0x47')](_0x19c198[_0x44b8('0x9f')](),_0x41ec83);})[_0x44b8('0x11')](function(_0x4391ca){_0xce06dc['count']=_0x4391ca[_0x44b8('0x4a')];if(_0xce06dc[_0x44b8('0x22')]===0x0)return[];return db[_0x44b8('0x9e')][_0x44b8('0x47')](_0xdc67e8[_0x44b8('0x9f')](),_0x41ec83)[_0x44b8('0x11')](function(_0x9d6d07){_0x32f588=_['keyBy'](_0x9d6d07,'id');_0x41ec83=_['merge'](_0x41ec83,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xc1b9de[_0x44b8('0x47')][_0x44b8('0x49')]){_0x149731[_0x44b8('0x48')][_0x44b8('0x34')](function(_0x45b4d8){_0x3154bc[_0x44b8('0x50')]('i.'+_0x45b4d8);});}else{_0x3154bc[_0x44b8('0x50')](_0x44b8('0xa0'),_0x44b8('0x6b'));_0x3154bc['field'](_0x44b8('0xa1'),_0x44b8('0xa2'));_0x3154bc['field']('a.mandatoryDisposition',_0x44b8('0xa3'));_0x3154bc['field'](_0x44b8('0xa4'),_0x44b8('0x94'));_0x3154bc[_0x44b8('0x50')]('i.*');_0x3154bc[_0x44b8('0x50')](_0x44b8('0xa5'),_0x44b8('0xa6'));_0x3154bc[_0x44b8('0x50')]('c.lastName',_0x44b8('0xa7'));_0x3154bc['field'](_0x44b8('0xa8'),_0x44b8('0xa9'));_0x3154bc[_0x44b8('0x50')](_0x44b8('0xaa'),_0x44b8('0xab'));_0x3154bc[_0x44b8('0x50')](_0x44b8('0xac'),'Contact.mobile');_0x3154bc['field']('c.fax',_0x44b8('0xad'));_0x3154bc[_0x44b8('0x50')](_0x44b8('0xae'),_0x44b8('0xaf'));_0x3154bc[_0x44b8('0x50')](_0x44b8('0xb0'),_0x44b8('0xb1'));_0x3154bc[_0x44b8('0x50')](_0x44b8('0xb2'),_0x44b8('0x31'));}if(_0x149731[_0x44b8('0x20')])_0x3154bc[_0x44b8('0x20')](_0x149731[_0x44b8('0x20')]);if(_0x149731[_0x44b8('0x1f')])_0x3154bc[_0x44b8('0x1f')](_0x149731[_0x44b8('0x1f')]);return db[_0x44b8('0x9e')][_0x44b8('0x47')](_0x3154bc['toString'](),_0x41ec83);})[_0x44b8('0x11')](function(_0x49aecf){if(_0x49aecf[_0x44b8('0x4a')]>0x0)_0x2b256b['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x44b8('0x2f')](_0x49aecf,'id'));return db['sequelize']['query'](_0x2b256b['toString'](),_0x41ec83)['then'](function(_0x4e02f0){var _0x2718a2=_[_0x44b8('0xb3')](_0x4e02f0,_0x44b8('0xb4'));var _0x45512b=[];_0x49aecf['forEach'](function(_0x3caa9c){_0x45512b[_0x44b8('0x35')](updateChatInteraction(_0x3caa9c,_0x32f588,_0x2718a2));});return BPromise['all'](_0x45512b);});});})['then'](function(_0x3af642){_0xce06dc[_0x44b8('0xb5')]=_0x3af642;return _0xce06dc;})[_0x44b8('0x11')](respondWithFilteredResult(_0x1236c7,_0x149731))['catch'](handleError(_0x1236c7,null));};exports[_0x44b8('0xb6')]=function(_0x2ac428,_0xdae257){var _0x278cc5={'raw':![],'where':{'id':_0x2ac428[_0x44b8('0xb7')]['id']}},_0x3bb7b1={};_0x3bb7b1[_0x44b8('0x43')]=_[_0x44b8('0x44')](db[_0x44b8('0xb8')]['rawAttributes']);_0x3bb7b1[_0x44b8('0x47')]=_[_0x44b8('0x44')](_0x2ac428['query']);_0x3bb7b1[_0x44b8('0x45')]=_[_0x44b8('0x46')](_0x3bb7b1[_0x44b8('0x43')],_0x3bb7b1['query']);_0x278cc5[_0x44b8('0x48')]=_['intersection'](_0x3bb7b1[_0x44b8('0x43')],qs[_0x44b8('0x49')](_0x2ac428['query'][_0x44b8('0x49')]));_0x278cc5[_0x44b8('0x48')]=_0x278cc5[_0x44b8('0x48')][_0x44b8('0x4a')]?_0x278cc5['attributes']:_0x3bb7b1[_0x44b8('0x43')];if(_0x2ac428[_0x44b8('0x47')][_0x44b8('0xb9')]){_0x278cc5[_0x44b8('0xba')]=[{'all':!![]}];}_0x278cc5=_[_0x44b8('0x29')]({},_0x278cc5,_0x2ac428[_0x44b8('0xbb')]);return db[_0x44b8('0xb8')][_0x44b8('0x6a')](_0x278cc5)[_0x44b8('0x11')](handleEntityNotFound(_0xdae257,null))['then'](respondWithResult(_0xdae257,null))['catch'](handleError(_0xdae257,null));};exports[_0x44b8('0xbc')]=function(_0x107c04,_0x1d29cd){return db[_0x44b8('0xb8')][_0x44b8('0xbc')](_0x107c04['body'],{})[_0x44b8('0x11')](respondWithResult(_0x1d29cd,0xc9))['catch'](handleError(_0x1d29cd,null));};exports[_0x44b8('0x24')]=function(_0x5079de,_0x404c07){if(_0x5079de[_0x44b8('0x2a')]['id']){delete _0x5079de[_0x44b8('0x2a')]['id'];}return db[_0x44b8('0xb8')][_0x44b8('0x6a')]({'where':{'id':_0x5079de[_0x44b8('0xb7')]['id']}})[_0x44b8('0x11')](handleEntityNotFound(_0x404c07,null))[_0x44b8('0x11')](saveUpdates(_0x5079de[_0x44b8('0x2a')],null))['then'](respondWithResult(_0x404c07,null))[_0x44b8('0x1a')](handleError(_0x404c07,null));};exports[_0x44b8('0x25')]=function(_0x970f70,_0x40b995){return db['ChatInteraction']['find']({'where':{'id':_0x970f70['params']['id']}})[_0x44b8('0x11')](handleEntityNotFound(_0x40b995,null))['then'](removeEntity(_0x40b995,null))['catch'](handleError(_0x40b995,null));};exports[_0x44b8('0xbd')]=function(_0x317337,_0x2f2f64){return db[_0x44b8('0xb8')][_0x44b8('0xbd')]()[_0x44b8('0x11')](respondWithResult(_0x2f2f64,null))[_0x44b8('0x1a')](handleError(_0x2f2f64,null));};exports[_0x44b8('0xbe')]=function(_0x4cf3a4,_0x4ecb04){var _0x194220=_0x4cf3a4[_0x44b8('0xb7')]['id'];var _0x2594bf;var _0x5f0c0c;var _0x1e2b67;return db[_0x44b8('0xb8')][_0x44b8('0xbf')]({'where':{'id':_0x194220}})['then'](function(_0x594596){_0x2594bf=_0x594596;return db[_0x44b8('0xc0')][_0x44b8('0xbf')]({'where':{'id':_0x594596[_0x44b8('0x7f')]},'attributes':['id',_0x44b8('0xc1'),_0x44b8('0xc2'),'vidaooTopic',_0x44b8('0xc3'),_0x44b8('0xc4')],'raw':!![]});})['then'](function(_0x24727a){if(_0x24727a&&_0x24727a[_0x44b8('0xc1')]&&_0x24727a[_0x44b8('0xc2')]){_0x5f0c0c=_0x24727a;var _0x237f67={'interaction':{'id':_0x194220},'agent':{'id':_0x4cf3a4['user']['id'],'name':_0x4cf3a4[_0x44b8('0x9a')]['name'],'fullname':_0x4cf3a4[_0x44b8('0x9a')][_0x44b8('0x30')],'email':_0x4cf3a4[_0x44b8('0x9a')][_0x44b8('0xc5')]},'contact':_0x4cf3a4[_0x44b8('0x2a')][_0x44b8('0xc6')],'account':_0x4cf3a4[_0x44b8('0x2a')][_0x44b8('0x2d')]};var _0x5e0fba={'rejectUnauthorized':![],'method':_0x44b8('0xc7'),'url':_0x44b8('0xc8'),'headers':{'X-APIKEY':_0x24727a[_0x44b8('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4cf3a4[_0x44b8('0x9a')][_0x44b8('0xc5')]],'buttons':null,'topic':_0x5f0c0c[_0x44b8('0xc9')],'note':_['isNull'](_0x5f0c0c['vidaooNote'])?null:getMustacheRender(_0x5f0c0c[_0x44b8('0xc3')],_0x237f67),'metadata':null},'redirect':_0x44b8('0xca'),'json':!![]};try{if(!_['isNull'](_0x5f0c0c[_0x44b8('0xc4')])){var _0x16074e=getMustacheRender(_0x5f0c0c['vidaooMetadata'],_0x237f67);var _0x1ec23e=JSON[_0x44b8('0x82')](_0x16074e);_0x5e0fba[_0x44b8('0x2a')][_0x44b8('0xcb')]=_0x1ec23e;}}catch(_0x334522){throw new db[(_0x44b8('0x93'))][(_0x44b8('0xcc'))](_0x44b8('0xcd'));}return rp(_0x5e0fba);}else{throw new db[(_0x44b8('0x93'))][(_0x44b8('0xcc'))](_0x44b8('0xce'));}})[_0x44b8('0x11')](function(_0x1aff91){_0x1e2b67=_0x1aff91;if(_0x1e2b67['id']){var _0x36386e={'body':_0x1e2b67[_0x44b8('0xcf')],'ChatWebsiteId':_0x5f0c0c['id'],'ChatInteractionId':_0x2594bf['id'],'direction':'out','UserId':_0x4cf3a4[_0x44b8('0x9a')]['id']};return db[_0x44b8('0xd0')][_0x44b8('0xbc')](_0x36386e,{});}else{throw new db[(_0x44b8('0x93'))]['ValidationError'](_0x44b8('0xd1'));}})[_0x44b8('0x11')](function(){return _0x2594bf['updateAttributes']({'vidaooSessionId':_0x1e2b67['id']});})[_0x44b8('0x11')](respondWithResult(_0x4ecb04,null))['catch'](handleError(_0x4ecb04,null));};exports[_0x44b8('0xd2')]=function(_0x3fee20,_0x5a508f){if(_0x3fee20[_0x44b8('0x2a')]['id']){delete _0x3fee20['body']['id'];}return db['ChatInteraction'][_0x44b8('0x6a')]({'where':{'id':_0x3fee20[_0x44b8('0xb7')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x5a508f,null))[_0x44b8('0x11')](saveUpdates(_0x3fee20[_0x44b8('0x2a')],null))[_0x44b8('0x11')](respondWithResult(_0x5a508f,null))['catch'](handleError(_0x5a508f,null));};exports['abandon']=function(_0x28da8b,_0x289fbd){if(_0x28da8b[_0x44b8('0x2a')]['id']){delete _0x28da8b[_0x44b8('0x2a')]['id'];}return db[_0x44b8('0xb8')][_0x44b8('0x6a')]({'where':{'id':_0x28da8b[_0x44b8('0xb7')]['id']}})[_0x44b8('0x11')](function(_0x2675e9){if(!_0x2675e9){logger['error'](_0x44b8('0xd3'),'abandon',0x194,_0x44b8('0xd4'));_0x289fbd['sendStatus'](0x194);}else{if(_0x2675e9['UserId']){throw new db[(_0x44b8('0x93'))][(_0x44b8('0xcc'))](_0x44b8('0xd5'));}}return _0x2675e9;})[_0x44b8('0x11')](function(_0x2eec38){if(_0x2eec38){return _0x2eec38[_0x44b8('0x24')]({'closed':_0x28da8b[_0x44b8('0x2a')][_0x44b8('0x3b')],'disposition':_0x28da8b[_0x44b8('0x2a')]['disposition']})[_0x44b8('0x11')](function(_0x1e3b5f){return _0x1e3b5f;});}})[_0x44b8('0x11')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x28da8b[_0x44b8('0x2a')],client9004);})['then'](respondWithResult(_0x289fbd,null))[_0x44b8('0x1a')](handleError(_0x289fbd,null));};exports['attachmentUpload']=function(_0x1ae0bb,_0x54f62d){_0x1ae0bb['body'][_0x44b8('0x27')]=_0x1ae0bb[_0x44b8('0xd6')]['originalname'];_0x1ae0bb[_0x44b8('0x2a')][_0x44b8('0xd7')]=_0x1ae0bb[_0x44b8('0xd6')][_0x44b8('0xd8')];_0x1ae0bb[_0x44b8('0x2a')]['type']=_0x1ae0bb[_0x44b8('0xd6')]['mimetype'];return db['Attachment']['create'](_0x1ae0bb[_0x44b8('0x2a')])[_0x44b8('0x11')](respondWithResult(_0x54f62d,0xc9))['catch'](handleError(_0x54f62d,null));};exports[_0x44b8('0xd9')]=function(_0x3569c4,_0x591576){return db['ChatInteraction'][_0x44b8('0xbf')]({'where':{'id':_0x3569c4[_0x44b8('0xb7')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x591576,null))[_0x44b8('0x11')](function(_0xa37e7){if(_0xa37e7){if(_0xa37e7['closed']){return _0x591576[_0x44b8('0x1c')](0x193)[_0x44b8('0x1e')]({'status':0x193,'message':'Unauthorized'});}return db[_0x44b8('0xda')][_0x44b8('0xbf')]({'where':{'id':_0x3569c4[_0x44b8('0x47')]['attachId']},'raw':!![]})[_0x44b8('0x11')](handleEntityNotFound(_0x591576,null));}})['then'](function(_0x2ea49d){if(_0x2ea49d){var _0x5a7884=_0x2ea49d['ChatOfflineMessageId']!==null;var _0x19e219=path[_0x44b8('0xdb')](config[_0x44b8('0xdc')],_0x44b8('0xdd'));if(_0x5a7884){_0x19e219=path[_0x44b8('0xdb')](_0x19e219,_0x44b8('0xde'));}var _0x28c3=path[_0x44b8('0xdb')](_0x19e219,_0x2ea49d[_0x44b8('0xd7')]);return _0x591576[_0x44b8('0xdf')](_0x28c3);}})[_0x44b8('0x1a')](handleError(_0x591576,null));};exports['close']=function(_0x33dfb4,_0x192923){var _0x9dccab=null;var _0x2a8a33=null;var _0x175e8b=null;if(_0x33dfb4[_0x44b8('0x2a')]['id']){delete _0x33dfb4[_0x44b8('0x2a')]['id'];}if(_0x33dfb4[_0x44b8('0x2a')]['mailTranscript']){_0x175e8b=path[_0x44b8('0xdb')](config[_0x44b8('0xdc')],'server/files/chat/upload/',util[_0x44b8('0xe0')](_0x44b8('0xe1'),Date[_0x44b8('0xe2')]()));_0x33dfb4['body']['pathTranscript']=_0x175e8b;}return db[_0x44b8('0xb8')][_0x44b8('0x6a')]({'where':{'id':_0x33dfb4['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x44b8('0xe3'),'include':[{'model':db[_0x44b8('0x7b')],'as':_0x44b8('0x7b')}]}]})[_0x44b8('0x11')](handleEntityNotFound(_0x192923,null))[_0x44b8('0x11')](saveUpdates(_0x33dfb4['body'],null))[_0x44b8('0x11')](function(_0x4fbf1d){if(_0x4fbf1d){_0x9dccab=_0x4fbf1d;return db[_0x44b8('0xc0')][_0x44b8('0x6a')]({'where':{'id':_0x9dccab[_0x44b8('0x7f')]}});}})[_0x44b8('0x11')](function(_0x3cbec9){if(_0x3cbec9){_0x2a8a33=_0x3cbec9;return db[_0x44b8('0xe4')]['find']({'where':{'id':_0x9dccab[_0x44b8('0x74')]}});}})['then'](function(_0x2c3e11){if(_0x2c3e11){if(_0x175e8b){var _0x1233a3=null;for(var _0x4ea950=0x1;_0x4ea950<_0x9dccab[_0x44b8('0xe3')]['length'];++_0x4ea950){_0x1233a3=_0x9dccab[_0x44b8('0xe3')][_0x4ea950];var _0x371094=_0x1233a3[_0x44b8('0x3c')]?util['format'](_0x44b8('0xe5'),_0x2a8a33[_0x44b8('0xe6')],_0x1233a3['UserId']):_0x44b8('0xe7');var _0x5af83d=_0x33dfb4['body'][_0x44b8('0xe8')]||util['format'](_0x44b8('0xe5'),'Visitor',_0x1233a3[_0x44b8('0x74')]);switch(_0x2a8a33[_0x44b8('0xe9')]){case'website_alias':_0x371094=_0x1233a3[_0x44b8('0x3c')]?util[_0x44b8('0xe0')]('%s%d',_0x2a8a33['agentAlias'],_0x1233a3[_0x44b8('0x3c')]):_0x44b8('0xe7');break;case _0x44b8('0xea'):_0x371094=_0x1233a3[_0x44b8('0x3c')]?_0x1233a3['User'][_0x44b8('0xeb')]||_0x1233a3[_0x44b8('0x7b')][_0x44b8('0x30')]:_0x44b8('0xe7');break;case'agent_fullname':_0x371094=_0x1233a3['UserId']?_0x1233a3[_0x44b8('0x7b')][_0x44b8('0x30')]:_0x44b8('0xe7');break;default:_0x371094=_0x1233a3['UserId']?util[_0x44b8('0xe0')](_0x44b8('0xe5'),_0x2a8a33['agentAlias'],_0x1233a3[_0x44b8('0x3c')]):_0x44b8('0xe7');}var _0x44adfb=util[_0x44b8('0xe0')](_0x44b8('0xec'),moment(_0x1233a3[_0x44b8('0x81')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x1233a3[_0x44b8('0xed')]==='in'?_0x5af83d:_0x371094,_0x1233a3['body']);if(!_0x1233a3[_0x44b8('0xee')]){fs['appendFileSync'](_0x175e8b,_0x44adfb);}}return db[_0x44b8('0xef')][_0x44b8('0xbf')]({'where':{'service':!![]},'include':[{'model':db[_0x44b8('0xf0')],'as':_0x44b8('0xf1'),'raw':!![],'include':[{'model':db[_0x44b8('0xf2')],'as':_0x44b8('0xf2'),'raw':!![]}]}]});}}})[_0x44b8('0x11')](function(_0x259ac7){if(!_0x259ac7||!_0x259ac7[_0x44b8('0xf1')]||!_0x33dfb4[_0x44b8('0x2a')])return _0x9dccab;var _0x1f96c1=_0x259ac7[_0x44b8('0xf3')]();return respondWithRpcPromise(_0x44b8('0xf4'),_0x44b8('0xf5'),{'account':_0x1f96c1,'message':{'from':util[_0x44b8('0xe0')](_0x44b8('0xf6'),_0x259ac7['name'],_0x259ac7[_0x44b8('0xc5')]||_0x259ac7['Smtp'][_0x44b8('0x9a')]),'to':_0x33dfb4[_0x44b8('0x2a')][_0x44b8('0xf7')],'subject':_0x44b8('0xf8'),'text':util[_0x44b8('0xe0')](_0x44b8('0xf9'),_0x33dfb4[_0x44b8('0x2a')]['mailTranscript']),'attachments':[{'path':_0x175e8b}]}})['then'](function(){return _0x9dccab;})[_0x44b8('0x1a')](function(_0x3c90c2){logger[_0x44b8('0x16')](_0x3c90c2);});})[_0x44b8('0x11')](respondWithStatusCode(_0x192923,0xc8))[_0x44b8('0x1a')](handleError(_0x192923,null));};exports['addMessage']=function(_0x32c4a4,_0x208c53){return db[_0x44b8('0xd0')][_0x44b8('0x6a')]({'where':{'id':_0x32c4a4[_0x44b8('0xb7')]['id']}})[_0x44b8('0x11')](handleEntityNotFound(_0x208c53,null))['then'](function(_0x4d07e){if(_0x4d07e){return _0x4d07e[_0x44b8('0xfa')](_0x32c4a4[_0x44b8('0x2a')][_0x44b8('0xfb')],_[_0x44b8('0xfc')](_0x32c4a4['body'],['ids','id'])||{});}})[_0x44b8('0x11')](respondWithResult(_0x208c53,null))[_0x44b8('0x1a')](handleError(_0x208c53,null));};exports['getMessages']=function(_0x5ae640,_0x3e23c5){var _0x527f4a={'raw':![],'where':{}};var _0x3f0ed8={};var _0x44d7eb={'count':0x0,'rows':[]};return db[_0x44b8('0xb8')][_0x44b8('0xbf')]({'where':{'id':_0x5ae640[_0x44b8('0xb7')]['id']}})[_0x44b8('0x11')](handleEntityNotFound(_0x3e23c5,null))[_0x44b8('0x11')](function(_0x42c8a5){if(_0x42c8a5){_0x3f0ed8['model']=_[_0x44b8('0x44')](db[_0x44b8('0xd0')][_0x44b8('0xfd')]);_0x3f0ed8['query']=_[_0x44b8('0x44')](_0x5ae640[_0x44b8('0x47')]);_0x3f0ed8['filters']=_['intersection'](_0x3f0ed8['model'],_0x3f0ed8['query']);_0x527f4a[_0x44b8('0x48')]=_['intersection'](_0x3f0ed8['model'],qs[_0x44b8('0x49')](_0x5ae640[_0x44b8('0x47')][_0x44b8('0x49')]));_0x527f4a['attributes']=_0x527f4a[_0x44b8('0x48')]['length']?_0x527f4a[_0x44b8('0x48')]:_0x3f0ed8[_0x44b8('0x43')];if(!_0x5ae640[_0x44b8('0x47')][_0x44b8('0x4b')]('nolimit')){_0x527f4a[_0x44b8('0x20')]=qs[_0x44b8('0x20')](_0x5ae640[_0x44b8('0x47')][_0x44b8('0x20')]);_0x527f4a['offset']=qs['offset'](_0x5ae640[_0x44b8('0x47')][_0x44b8('0x1f')]);}_0x527f4a['order']=qs[_0x44b8('0xfe')](_0x5ae640[_0x44b8('0x47')][_0x44b8('0xfe')]);_0x527f4a[_0x44b8('0x4e')]=qs[_0x44b8('0x45')](_[_0x44b8('0x4f')](_0x5ae640[_0x44b8('0x47')],_0x3f0ed8[_0x44b8('0x45')]));_0x527f4a['where'][_0x44b8('0xb4')]=_0x42c8a5['id'];if(_0x5ae640[_0x44b8('0x47')][_0x44b8('0x8b')]){_0x527f4a['where']=_[_0x44b8('0x29')](_0x527f4a['where'],{'$or':_[_0x44b8('0x2f')](_0x527f4a['attributes'],function(_0x46a9b3){var _0x1978a9={};_0x1978a9[_0x46a9b3]={'$like':'%'+_0x5ae640[_0x44b8('0x47')][_0x44b8('0x8b')]+'%'};return _0x1978a9;})});}if(_0x5ae640[_0x44b8('0x47')][_0x44b8('0x83')]){var _0x8fc6b1=_0x5ae640[_0x44b8('0x47')][_0x44b8('0x83')][_0x44b8('0x33')](',');var _0x119322={};_0x119322[_0x8fc6b1[0x0]]={'$gte':moment(_0x8fc6b1[0x1])[_0x44b8('0xe0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x527f4a[_0x44b8('0x4e')]=_['merge'](_0x527f4a[_0x44b8('0x4e')],_0x119322);}_0x527f4a=_['merge']({},_0x527f4a,_0x5ae640[_0x44b8('0xbb')]);return db[_0x44b8('0xd0')][_0x44b8('0x22')]({'where':_0x527f4a[_0x44b8('0x4e')]})[_0x44b8('0x11')](function(_0x168706){_0x44d7eb[_0x44b8('0x22')]=_0x168706;if(_0x5ae640['query'][_0x44b8('0xb9')]){_0x527f4a[_0x44b8('0xba')]=[{'all':!![]}];}return db[_0x44b8('0xd0')][_0x44b8('0xff')](_0x527f4a);})[_0x44b8('0x11')](function(_0x1165e0){_0x44d7eb[_0x44b8('0xb5')]=_0x1165e0;return _0x44d7eb;});}})[_0x44b8('0x11')](respondWithFilteredResult(_0x3e23c5,_0x527f4a))[_0x44b8('0x1a')](handleError(_0x3e23c5,null));};exports[_0x44b8('0x100')]=function(_0x2c265f,_0x1c63e6){var _0xbbc40d={'where':{}},_0x4281a6={},_0x4bb399={'count':0x0,'rows':[]};return db[_0x44b8('0xb8')][_0x44b8('0xbf')]({'where':{'id':_0x2c265f['params']['id']}})[_0x44b8('0x11')](handleEntityNotFound(_0x1c63e6,null))[_0x44b8('0x11')](function(_0x404987){if(_0x404987){_0x4281a6[_0x44b8('0x43')]=_[_0x44b8('0x44')](db['ChatMessage'][_0x44b8('0xfd')]);_0x4281a6[_0x44b8('0x47')]=_[_0x44b8('0x44')](_0x2c265f[_0x44b8('0x47')]);_0x4281a6['filters']=_[_0x44b8('0x46')](_0x4281a6[_0x44b8('0x43')],_0x4281a6['query']);_0xbbc40d['attributes']=_['intersection'](_0x4281a6['model'],qs[_0x44b8('0x49')](_0x2c265f['query']['fields']));_0xbbc40d[_0x44b8('0x48')]=_0xbbc40d[_0x44b8('0x48')][_0x44b8('0x4a')]?_0xbbc40d['attributes']:_0x4281a6[_0x44b8('0x43')];if(!_0x2c265f[_0x44b8('0x47')][_0x44b8('0x4b')](_0x44b8('0x4c'))){_0xbbc40d['limit']=qs[_0x44b8('0x20')](_0x2c265f['query'][_0x44b8('0x20')]);_0xbbc40d[_0x44b8('0x1f')]=qs['offset'](_0x2c265f[_0x44b8('0x47')][_0x44b8('0x1f')]);}_0xbbc40d[_0x44b8('0x4d')]=qs[_0x44b8('0xfe')](_0x2c265f[_0x44b8('0x47')]['sort']);_0xbbc40d['where']=qs[_0x44b8('0x45')](_[_0x44b8('0x4f')](_0x2c265f[_0x44b8('0x47')],_0x4281a6[_0x44b8('0x45')]));_0xbbc40d[_0x44b8('0x4e')][_0x44b8('0xb4')]=_0x404987['id'];if(_0x2c265f[_0x44b8('0x47')][_0x44b8('0x8b')]){_0xbbc40d[_0x44b8('0x4e')]=_[_0x44b8('0x29')](_0xbbc40d[_0x44b8('0x4e')],{'$or':_[_0x44b8('0x2f')](_0xbbc40d['attributes'],function(_0x57badd){var _0x1567a3={};_0x1567a3[_0x57badd]={'$like':'%'+_0x2c265f['query'][_0x44b8('0x8b')]+'%'};return _0x1567a3;})});}_0xbbc40d[_0x44b8('0x4e')][_0x44b8('0xee')]=![];if(_0x2c265f['query']['id']){_0xbbc40d[_0x44b8('0x4e')]['id']={'$gt':_0x2c265f[_0x44b8('0x47')]['id']};}_0xbbc40d=_[_0x44b8('0x29')]({},_0xbbc40d,_0x2c265f[_0x44b8('0xbb')]);return db[_0x44b8('0xd0')][_0x44b8('0x22')]({'where':_0xbbc40d['where']})[_0x44b8('0x11')](function(_0x1e3c8f){_0x4bb399['count']=_0x1e3c8f;_0xbbc40d[_0x44b8('0xba')]=[];if(_0x2c265f[_0x44b8('0x47')][_0x44b8('0x101')]){_0xbbc40d[_0x44b8('0xba')][_0x44b8('0x35')]({'model':db['User'],'as':_0x44b8('0x7b'),'attributes':['id',_0x44b8('0x30'),_0x44b8('0xeb')]});}if(_0x2c265f[_0x44b8('0x47')][_0x44b8('0xb9')]){_0xbbc40d[_0x44b8('0xba')]=[{'all':!![]}];}return db[_0x44b8('0xd0')][_0x44b8('0xff')](_0xbbc40d);})[_0x44b8('0x11')](function(_0x460fe7){_0x4bb399['rows']=_0x460fe7;return _0x4bb399;});}})[_0x44b8('0x11')](respondWithFilteredResult(_0x1c63e6,_0xbbc40d))[_0x44b8('0x1a')](handleError(_0x1c63e6,null));};exports[_0x44b8('0x102')]=function(_0x4fe1e3,_0x5f28cb){return db[_0x44b8('0xb8')]['find']({'where':{'id':_0x4fe1e3[_0x44b8('0xb7')]['id']}})[_0x44b8('0x11')](handleEntityNotFound(_0x5f28cb,null))[_0x44b8('0x11')](function(_0x3faa15){if(_0x3faa15){return _0x3faa15[_0x44b8('0x103')](_0x4fe1e3[_0x44b8('0x2a')][_0x44b8('0xfb')],_['omit'](_0x4fe1e3['body'],[_0x44b8('0xfb'),'id'])||{})[_0x44b8('0x104')](function(){return db[_0x44b8('0x78')][_0x44b8('0xff')]({'attributes':['id',_0x44b8('0x27'),_0x44b8('0x51')],'where':{'id':_0x4fe1e3['body']['ids']}});})[_0x44b8('0x11')](function(_0x30ca32){socket[_0x44b8('0x105')](_0x44b8('0x106'),{'id':Number(_0x4fe1e3[_0x44b8('0xb7')]['id']),'tags':_0x30ca32||[]});return{'id':Number(_0x4fe1e3[_0x44b8('0xb7')]['id']),'tags':_0x30ca32||[]};});}})[_0x44b8('0x11')](respondWithResult(_0x5f28cb,null))['catch'](handleError(_0x5f28cb,null));};exports[_0x44b8('0x107')]=function(_0x1f6244,_0x96a3cd){return db['ChatInteraction'][_0x44b8('0x6a')]({'where':{'id':_0x1f6244[_0x44b8('0xb7')]['id']}})[_0x44b8('0x11')](handleEntityNotFound(_0x96a3cd,null))[_0x44b8('0x11')](function(_0x4dd93c){if(_0x4dd93c){return _0x4dd93c[_0x44b8('0x107')](_0x1f6244[_0x44b8('0x47')][_0x44b8('0xfb')]);}})['then'](respondWithStatusCode(_0x96a3cd,null))['catch'](handleError(_0x96a3cd,null));};exports['download']=function(_0x4b3c64,_0x59a43a){var _0x355c5c=moment()[_0x44b8('0x108')]()[_0x44b8('0x9f')]();var _0x319938=path[_0x44b8('0xdb')](config[_0x44b8('0xdc')],_0x44b8('0x109'),_0x44b8('0x10a'),_0x44b8('0x10b'));var _0xd90e3c=path[_0x44b8('0xdb')](config['root'],_0x44b8('0x109'),_0x44b8('0x10a'),_0x44b8('0x10c'));var _0x2857c6=path[_0x44b8('0xdb')](_0x319938,_0x355c5c);var _0x50ed5b=util[_0x44b8('0xe0')]('transcript-%d-%s.zip',_0x4b3c64[_0x44b8('0xb7')]['id'],_0x355c5c);var _0x3432da=path[_0x44b8('0xdb')](_0x319938,_0x50ed5b);var _0x56a269=[];_0x56a269[_0x44b8('0x35')]({'model':db[_0x44b8('0x7b')],'as':'User','attributes':['id',_0x44b8('0x30')],'raw':!![]});_0x56a269[_0x44b8('0x35')]({'model':db[_0x44b8('0xe4')],'as':'Contact','attributes':['id',_0x44b8('0x10d'),'lastName'],'raw':!![]});if(_0x4b3c64[_0x44b8('0x47')][_0x44b8('0x10c')]){_0x56a269[_0x44b8('0x35')]({'model':db['Attachment'],'as':_0x44b8('0xda'),'raw':!![]});}var _0x50de17=[{'model':db[_0x44b8('0xd0')],'as':_0x44b8('0xe3'),'attributes':['id',_0x44b8('0x2a'),_0x44b8('0x81'),_0x44b8('0xed'),_0x44b8('0xee'),'read'],'include':_0x56a269}];_0x50de17[_0x44b8('0x35')]({'model':db[_0x44b8('0xc0')],'as':_0x44b8('0x10e'),'attributes':['id',_0x44b8('0x27')]});_0x50de17['push']({'model':db[_0x44b8('0x7b')],'as':_0x44b8('0x10f'),'attributes':['id',_0x44b8('0x30')]});return db[_0x44b8('0xb8')][_0x44b8('0x6a')]({'where':{'id':_0x4b3c64[_0x44b8('0xb7')]['id']},'include':_0x50de17})[_0x44b8('0x11')](handleEntityNotFound(_0x59a43a,null))[_0x44b8('0x11')](function(_0x2641c3){if(_0x2641c3){var _0x23b385=_0x2641c3[_0x44b8('0x110')]({'plain':!![]});fs[_0x44b8('0x111')](_0x2857c6);var _0x47c49d={'channel':_0x44b8('0x112'),'account':_0x23b385[_0x44b8('0x10e')][_0x44b8('0x27')],'agent':_0x23b385[_0x44b8('0x10f')]?_0x23b385['Owner'][_0x44b8('0x30')]:'N.A.','createdAt':moment(_0x23b385[_0x44b8('0x81')])[_0x44b8('0xe0')](_0x44b8('0x113'))['toString'](),'closedAt':_0x23b385[_0x44b8('0x3b')]?moment(_0x23b385[_0x44b8('0x114')])[_0x44b8('0xe0')](_0x44b8('0x113'))[_0x44b8('0x9f')]():'','disposition':_0x23b385['disposition'],'chatInfo':{'browser':_0x23b385[_0x44b8('0x115')],'os':_0x23b385[_0x44b8('0x116')],'referer':_0x23b385[_0x44b8('0x117')],'customerIp':_0x23b385[_0x44b8('0x118')],'customerPort':_0x23b385[_0x44b8('0x119')]?_0x23b385['customerPort']:_0x44b8('0x11a')},'messages':_(_0x23b385[_0x44b8('0xe3')])[_0x44b8('0x11b')]()[_0x44b8('0x8b')]({'secret':![]})[_0x44b8('0x2f')](function(_0x41dc18){if(_0x41dc18[_0x44b8('0xda')]){var _0x5bd828=path['join'](_0xd90e3c,_0x41dc18['Attachment'][_0x44b8('0xd7')]);if(fs[_0x44b8('0x11c')](_0x5bd828)){fs[_0x44b8('0x11d')](_0x5bd828)['pipe'](fs['createWriteStream'](path[_0x44b8('0xdb')](_0x2857c6,_0x41dc18[_0x44b8('0xda')][_0x44b8('0xd7')])));}}return{'date':moment(_0x41dc18[_0x44b8('0x81')])[_0x44b8('0xe0')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x41dc18['direction']==='out'?_0x41dc18[_0x44b8('0x7b')]?_0x41dc18[_0x44b8('0x7b')][_0x44b8('0x30')]:_0x44b8('0xe7'):_0x41dc18[_0x44b8('0x6f')][_0x44b8('0x10d')]+(_0x41dc18['Contact'][_0x44b8('0x11e')]?'\x20'+_0x41dc18['Contact'][_0x44b8('0x11e')]:''),'body':_0x41dc18[_0x44b8('0xda')]?_0x41dc18[_0x44b8('0xda')]['basename']:_0x41dc18['body'],'direction':_0x41dc18[_0x44b8('0xed')]===_0x44b8('0x11f')?'A':'C','secret':_0x41dc18['secret'],'read':_0x41dc18['read'],'attachment':_0x41dc18[_0x44b8('0xda')]};})[_0x44b8('0x6c')]()};return ejs[_0x44b8('0x120')](path[_0x44b8('0xdb')](config[_0x44b8('0xdc')],'server',_0x44b8('0x121'),_0x44b8('0x122')),{'interaction':_0x47c49d})[_0x44b8('0x11')](function(_0xddce57){var _0x12c9e7=path[_0x44b8('0xdb')](_0x2857c6,_0x44b8('0x123')+_0x23b385['id']+'-'+_0x355c5c+'.pdf');var _0x117633={'path':_0x12c9e7,'channel':_0x44b8('0x112'),'interactionId':_0x23b385['id']};return pdf[_0x44b8('0x124')](_0xddce57,_0x117633);})[_0x44b8('0x11')](function(){return new Promise(function(_0x1a3a61,_0x388ea7){zipdir(_0x2857c6,{'saveTo':_0x3432da},function(_0x5d7efd,_0x3c3316){if(_0x5d7efd)return _0x388ea7(_0x5d7efd);return _0x1a3a61(_0x3c3316);});})[_0x44b8('0x11')](function(){return new BPromise(function(_0x43910a,_0x188acf){rimraf(_0x2857c6,function(_0x57456f){if(_0x57456f)_0x188acf(_0x57456f);return _0x43910a();});});})[_0x44b8('0x11')](function(){return _0x59a43a[_0x44b8('0xdf')](_0x3432da,_0x50ed5b,function(_0x1aae67){if(_0x1aae67){logger[_0x44b8('0x16')]('err',_0x1aae67);}else{fs['unlinkSync'](_0x3432da);}});});});}else{return _0x59a43a[_0x44b8('0x1b')](0xc8);}})[_0x44b8('0x1a')](handleError(_0x59a43a,null));};
\ No newline at end of file
index 6324429..8e890b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5565=['map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5565,0x15d));var _0x5556=function(_0x4c814a,_0x34bad0){_0x4c814a=_0x4c814a-0x0;var _0x449ba9=_0x5565[_0x4c814a];return _0x449ba9;};'use strict';var EventEmitter=require(_0x5556('0x0'));var ChatInteraction=require(_0x5556('0x1'))['db'][_0x5556('0x2')];var ChatMessage=require(_0x5556('0x1'))['db'][_0x5556('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5556('0x4')](0x0);var events={'afterCreate':_0x5556('0x5'),'afterUpdate':_0x5556('0x6'),'afterDestroy':_0x5556('0x7')};function emitEvent(_0x3244b9){return function(_0x1e84f5,_0x5ca6f6,_0x52c51){_0x1e84f5[_0x5556('0x8')]({'attributes':['id'],'raw':!![]})[_0x5556('0x9')](function(_0x54f306){_0x1e84f5[_0x5556('0xa')](_0x5556('0xb'),_0x54f306[_0x5556('0xc')](function(_0x5c4f95){return{'id':_0x5c4f95['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1e84f5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5556('0x9')](function(_0x420237){_0x1e84f5[_0x5556('0xa')](_0x5556('0xd'),_0x420237[_0x5556('0xe')]);ChatInteractionEvents[_0x5556('0xf')](_0x3244b9+':'+_0x1e84f5['id'],_0x1e84f5);ChatInteractionEvents[_0x5556('0xf')](_0x3244b9,_0x1e84f5);_0x52c51(null);})[_0x5556('0x10')](_0x52c51(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5556('0x11')](e,emitEvent(event));}}module[_0x5556('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x4b47=['save','remove','getUsers','then','setDataValue','Users','map','emit','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x57048c,_0x4c1b5a){var _0x358f77=function(_0x4fb8fb){while(--_0x4fb8fb){_0x57048c['push'](_0x57048c['shift']());}};_0x358f77(++_0x4c1b5a);}(_0x4b47,0x1ae));var _0x74b4=function(_0x399072,_0x30749e){_0x399072=_0x399072-0x0;var _0x391e3e=_0x4b47[_0x399072];return _0x391e3e;};'use strict';var EventEmitter=require(_0x74b4('0x0'));var ChatInteraction=require(_0x74b4('0x1'))['db'][_0x74b4('0x2')];var ChatMessage=require(_0x74b4('0x1'))['db'][_0x74b4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x74b4('0x4')](0x0);var events={'afterCreate':_0x74b4('0x5'),'afterUpdate':'update','afterDestroy':_0x74b4('0x6')};function emitEvent(_0x25a49c){return function(_0x11c851,_0x359a28,_0x1b3b41){_0x11c851[_0x74b4('0x7')]({'attributes':['id'],'raw':!![]})[_0x74b4('0x8')](function(_0x30f4f0){_0x11c851[_0x74b4('0x9')](_0x74b4('0xa'),_0x30f4f0[_0x74b4('0xb')](function(_0x3c7322){return{'id':_0x3c7322['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x11c851['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x316546){_0x11c851[_0x74b4('0x9')]('unreadMessages',_0x316546['length']);ChatInteractionEvents['emit'](_0x25a49c+':'+_0x11c851['id'],_0x11c851);ChatInteractionEvents[_0x74b4('0xc')](_0x25a49c,_0x11c851);_0x1b3b41(null);})['catch'](_0x1b3b41(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x74b4('0xd')](e,emitEvent(event));}}module[_0x74b4('0xe')]=ChatInteractionEvents;
\ No newline at end of file
index a42302c..3d92e49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5115=['bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0xfb8f38,_0x2b5215){var _0x18689b=function(_0x1cba43){while(--_0x1cba43){_0xfb8f38['push'](_0xfb8f38['shift']());}};_0x18689b(++_0x2b5215);}(_0x5115,0xe6));var _0x5511=function(_0x2c753c,_0x3378e7){_0x2c753c=_0x2c753c-0x0;var _0x23ba20=_0x5115[_0x2c753c];return _0x23ba20;};'use strict';var _=require(_0x5511('0x0'));var util=require(_0x5511('0x1'));var logger=require(_0x5511('0x2'))('api');var moment=require(_0x5511('0x3'));var BPromise=require(_0x5511('0x4'));var rp=require(_0x5511('0x5'));var fs=require('fs');var path=require(_0x5511('0x6'));var rimraf=require(_0x5511('0x7'));var config=require(_0x5511('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x5511('0x9')]=function(_0x3cd34b,_0x18d553){return _0x3cd34b['define']('ChatInteraction',attributes,{'tableName':_0x5511('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8b74a9,_0x9102af,_0x4016fc){if(_0x8b74a9[_0x5511('0xb')](_0x5511('0xc'))){_0x8b74a9[_0x5511('0xd')]=moment()[_0x5511('0xe')](_0x5511('0xf'));}_0x4016fc(null,_0x8b74a9);}},'charset':_0x5511('0x10'),'collate':_0x5511('0x11')});};
\ No newline at end of file
+var _0xe01c=['format','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x142276,_0x8029bf){var _0x1ecd95=function(_0x23c2c7){while(--_0x23c2c7){_0x142276['push'](_0x142276['shift']());}};_0x1ecd95(++_0x8029bf);}(_0xe01c,0xec));var _0xce01=function(_0x14831c,_0x21b13f){_0x14831c=_0x14831c-0x0;var _0x482284=_0xe01c[_0x14831c];return _0x482284;};'use strict';var _=require('lodash');var util=require(_0xce01('0x0'));var logger=require(_0xce01('0x1'))(_0xce01('0x2'));var moment=require(_0xce01('0x3'));var BPromise=require('bluebird');var rp=require(_0xce01('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xce01('0x5'));var attributes=require('./chatInteraction.attributes');module[_0xce01('0x6')]=function(_0x1de4ea,_0x14a576){return _0x1de4ea[_0xce01('0x7')](_0xce01('0x8'),attributes,{'tableName':_0xce01('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8832df,_0x3b56f0,_0x3dfd67){if(_0x8832df['changed'](_0xce01('0xa'))){_0x8832df['closedAt']=moment()[_0xce01('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3dfd67(null,_0x8832df);}},'charset':'utf8mb4','collate':_0xce01('0xc')});};
\ No newline at end of file
index ed67198..b74ad98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008a=['http','defaults','socket.io-emitter','redis','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','AddTagsToChatInteraction','find','addTags','omit','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xb98708,_0x588587){var _0x132f55=function(_0x4f903e){while(--_0x4f903e){_0xb98708['push'](_0xb98708['shift']());}};_0x132f55(++_0x588587);}(_0x008a,0x182));var _0xa008=function(_0x344a2e,_0x369dc0){_0x344a2e=_0x344a2e-0x0;var _0x146faa=_0x008a[_0x344a2e];return _0x146faa;};'use strict';var _=require(_0xa008('0x0'));var util=require('util');var moment=require(_0xa008('0x1'));var BPromise=require('bluebird');var rs=require(_0xa008('0x2'));var fs=require('fs');var Redis=require(_0xa008('0x3'));var db=require(_0xa008('0x4'))['db'];var utils=require(_0xa008('0x5'));var logger=require(_0xa008('0x6'))(_0xa008('0x7'));var config=require(_0xa008('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa008('0x9')][_0xa008('0xa')]({'port':0x232a});config['redis']=_[_0xa008('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa008('0xc'))(new Redis(config[_0xa008('0xd')]));require(_0xa008('0xe'))[_0xa008('0xf')](socket);function respondWithRpcPromise(_0x3bbc86,_0x5e51ee,_0x1b14e4){return new BPromise(function(_0x574ee8,_0x478469){return client[_0xa008('0x10')](_0x3bbc86,_0x1b14e4)[_0xa008('0x11')](function(_0x26bd49){logger[_0xa008('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x5e51ee,_0xa008('0x13'));logger[_0xa008('0x14')](_0xa008('0x15'),_0x5e51ee,_0xa008('0x13'),JSON[_0xa008('0x16')](_0x26bd49));if(_0x26bd49[_0xa008('0x17')]){if(_0x26bd49[_0xa008('0x17')][_0xa008('0x18')]===0x1f4){logger[_0xa008('0x17')](_0xa008('0x19'),_0x5e51ee,_0x26bd49[_0xa008('0x17')][_0xa008('0x1a')]);return _0x478469(_0x26bd49['error'][_0xa008('0x1a')]);}logger[_0xa008('0x17')](_0xa008('0x19'),_0x5e51ee,_0x26bd49[_0xa008('0x17')][_0xa008('0x1a')]);return _0x574ee8(_0x26bd49['error'][_0xa008('0x1a')]);}else{logger['info'](_0xa008('0x19'),_0x5e51ee,_0xa008('0x13'));_0x574ee8(_0x26bd49[_0xa008('0x1b')]['message']);}})[_0xa008('0x1c')](function(_0x5b315b){logger['error'](_0xa008('0x19'),_0x5e51ee,_0x5b315b);_0x478469(_0x5b315b);});});}exports[_0xa008('0x1d')]=function(_0xe6bcc){var _0x2f4f85=this;return new Promise(function(_0x2d9069,_0x2432b4){return db[_0xa008('0x1e')][_0xa008('0x1f')](_0xe6bcc[_0xa008('0x20')],{'raw':_0xe6bcc[_0xa008('0x21')]?_0xe6bcc['options'][_0xa008('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe6bcc['options']?_0xe6bcc[_0xa008('0x21')][_0xa008('0x23')]||null:null,'attributes':_0xe6bcc[_0xa008('0x21')]?_0xe6bcc[_0xa008('0x21')][_0xa008('0x24')]||null:null,'limit':_0xe6bcc[_0xa008('0x21')]?_0xe6bcc[_0xa008('0x21')]['limit']||null:null})['then'](function(_0x3a0cfd){logger[_0xa008('0x12')](_0xa008('0x1d'),_0xe6bcc);logger[_0xa008('0x14')]('UpdateChatInteraction',_0xe6bcc,JSON[_0xa008('0x16')](_0x3a0cfd));_0x2d9069(_0x3a0cfd);})[_0xa008('0x1c')](function(_0x5c6141){logger[_0xa008('0x17')](_0xa008('0x1d'),_0x5c6141[_0xa008('0x1a')],_0xe6bcc);_0x2432b4(_0x2f4f85['error'](0x1f4,_0x5c6141['message']));});});};exports[_0xa008('0x25')]=function(_0x3854ed){return new Promise(function(_0x370500,_0x27120f){return db[_0xa008('0x1e')][_0xa008('0x26')]({'where':_0x3854ed[_0xa008('0x21')]?_0x3854ed[_0xa008('0x21')][_0xa008('0x23')]||null:null})['then'](function(_0x192433){if(_0x192433){return _0x192433[_0xa008('0x27')](_0x3854ed[_0xa008('0x20')]['ids'],_[_0xa008('0x28')](_0x3854ed[_0xa008('0x20')],[_0xa008('0x29'),'id'])||{});}})[_0xa008('0x2a')](function(_0x150e2c){logger['info']('AddTags',_0x3854ed);logger[_0xa008('0x14')](_0xa008('0x2b'),_0x3854ed,JSON[_0xa008('0x16')](_0x150e2c));_0x370500(_0x150e2c);})[_0xa008('0x1c')](function(_0x23e85a){logger['error'](_0xa008('0x2b'),_0x23e85a['message'],_0x3854ed);_0x27120f(_this[_0xa008('0x17')](0x1f4,_0x23e85a[_0xa008('0x1a')]));});});};
\ No newline at end of file
+var _0xf87e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToChatInteraction','ChatInteraction','find','ids','omit','AddTags'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf87e,0x17a));var _0xef87=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xf87e[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xef87('0x0'));var util=require(_0xef87('0x1'));var moment=require(_0xef87('0x2'));var BPromise=require(_0xef87('0x3'));var rs=require(_0xef87('0x4'));var fs=require('fs');var Redis=require(_0xef87('0x5'));var db=require(_0xef87('0x6'))['db'];var utils=require(_0xef87('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xef87('0x8'));var jayson=require(_0xef87('0x9'));var client=jayson[_0xef87('0xa')][_0xef87('0xb')]({'port':0x232a});config[_0xef87('0xc')]=_['defaults'](config[_0xef87('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef87('0xc')]));require(_0xef87('0xd'))[_0xef87('0xe')](socket);function respondWithRpcPromise(_0x59466c,_0x3ef509,_0x2e9e4e){return new BPromise(function(_0x5ac4bf,_0x16bca5){return client[_0xef87('0xf')](_0x59466c,_0x2e9e4e)['then'](function(_0x828ed3){logger[_0xef87('0x10')](_0xef87('0x11'),_0x3ef509,'request\x20sent');logger[_0xef87('0x12')](_0xef87('0x13'),_0x3ef509,_0xef87('0x14'),JSON[_0xef87('0x15')](_0x828ed3));if(_0x828ed3[_0xef87('0x16')]){if(_0x828ed3[_0xef87('0x16')][_0xef87('0x17')]===0x1f4){logger['error'](_0xef87('0x11'),_0x3ef509,_0x828ed3['error'][_0xef87('0x18')]);return _0x16bca5(_0x828ed3[_0xef87('0x16')]['message']);}logger[_0xef87('0x16')](_0xef87('0x11'),_0x3ef509,_0x828ed3[_0xef87('0x16')]['message']);return _0x5ac4bf(_0x828ed3[_0xef87('0x16')][_0xef87('0x18')]);}else{logger['info'](_0xef87('0x11'),_0x3ef509,_0xef87('0x14'));_0x5ac4bf(_0x828ed3[_0xef87('0x19')][_0xef87('0x18')]);}})[_0xef87('0x1a')](function(_0x473aac){logger[_0xef87('0x16')](_0xef87('0x11'),_0x3ef509,_0x473aac);_0x16bca5(_0x473aac);});});}exports[_0xef87('0x1b')]=function(_0x26b3ce){var _0x2b0fe9=this;return new Promise(function(_0x32eb14,_0x20ea88){return db['ChatInteraction'][_0xef87('0x1c')](_0x26b3ce[_0xef87('0x1d')],{'raw':_0x26b3ce[_0xef87('0x1e')]?_0x26b3ce[_0xef87('0x1e')][_0xef87('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26b3ce[_0xef87('0x1e')]?_0x26b3ce['options'][_0xef87('0x20')]||null:null,'attributes':_0x26b3ce[_0xef87('0x1e')]?_0x26b3ce[_0xef87('0x1e')][_0xef87('0x21')]||null:null,'limit':_0x26b3ce[_0xef87('0x1e')]?_0x26b3ce['options'][_0xef87('0x22')]||null:null})[_0xef87('0x23')](function(_0x199217){logger[_0xef87('0x10')](_0xef87('0x1b'),_0x26b3ce);logger[_0xef87('0x12')](_0xef87('0x1b'),_0x26b3ce,JSON[_0xef87('0x15')](_0x199217));_0x32eb14(_0x199217);})['catch'](function(_0xde9a30){logger[_0xef87('0x16')](_0xef87('0x1b'),_0xde9a30['message'],_0x26b3ce);_0x20ea88(_0x2b0fe9[_0xef87('0x16')](0x1f4,_0xde9a30[_0xef87('0x18')]));});});};exports[_0xef87('0x24')]=function(_0x2bdff9){return new Promise(function(_0x5121d5,_0xb1f2e4){return db[_0xef87('0x25')][_0xef87('0x26')]({'where':_0x2bdff9['options']?_0x2bdff9[_0xef87('0x1e')][_0xef87('0x20')]||null:null})[_0xef87('0x23')](function(_0x26a845){if(_0x26a845){return _0x26a845['addTags'](_0x2bdff9[_0xef87('0x1d')][_0xef87('0x27')],_[_0xef87('0x28')](_0x2bdff9['body'],[_0xef87('0x27'),'id'])||{});}})['spread'](function(_0x136743){logger[_0xef87('0x10')](_0xef87('0x29'),_0x2bdff9);logger[_0xef87('0x12')](_0xef87('0x29'),_0x2bdff9,JSON[_0xef87('0x15')](_0x136743));_0x5121d5(_0x136743);})[_0xef87('0x1a')](function(_0x368142){logger[_0xef87('0x16')](_0xef87('0x29'),_0x368142[_0xef87('0x18')],_0x2bdff9);_0xb1f2e4(_this['error'](0x1f4,_0x368142['message']));});});};
\ No newline at end of file
index 942d7d0..dee291f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad0f=['save','update','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x13e322,_0x21d0fe){var _0x2f50cd=function(_0x13ac05){while(--_0x13ac05){_0x13e322['push'](_0x13e322['shift']());}};_0x2f50cd(++_0x21d0fe);}(_0xad0f,0xa1));var _0xfad0=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0xad0f[_0x5de532];return _0x4e9192;};'use strict';var ChatInteractionEvents=require(_0xfad0('0x0'));var events=[_0xfad0('0x1'),'remove',_0xfad0('0x2')];function createListener(_0x3374c6,_0x7d519b){return function(_0x4cad85){_0x7d519b['emit'](_0x3374c6,_0x4cad85);};}function removeListener(_0x57c843,_0x61b529){return function(){ChatInteractionEvents[_0xfad0('0x3')](_0x57c843,_0x61b529);};}exports[_0xfad0('0x4')]=function(_0x503b53){for(var _0x38a18c=0x0,_0x59566d=events['length'];_0x38a18c<_0x59566d;_0x38a18c++){var _0x285c26=events[_0x38a18c];var _0x3dcc13=createListener(_0xfad0('0x5')+_0x285c26,_0x503b53);ChatInteractionEvents['on'](_0x285c26,_0x3dcc13);}};
\ No newline at end of file
+var _0xf181=['register','length','chatInteraction:','./chatInteraction.events','save','remove','emit'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0xf181,0x6c));var _0x1f18=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xf181[_0x34021d];return _0x16597b;};'use strict';var ChatInteractionEvents=require(_0x1f18('0x0'));var events=[_0x1f18('0x1'),_0x1f18('0x2'),'update'];function createListener(_0x592c20,_0x6cfae4){return function(_0x206aa1){_0x6cfae4[_0x1f18('0x3')](_0x592c20,_0x206aa1);};}function removeListener(_0x2db4c3,_0x236434){return function(){ChatInteractionEvents['removeListener'](_0x2db4c3,_0x236434);};}exports[_0x1f18('0x4')]=function(_0x446163){for(var _0x4b7ca6=0x0,_0x44baf2=events[_0x1f18('0x5')];_0x4b7ca6<_0x44baf2;_0x4b7ca6++){var _0x4a39f4=events[_0x4b7ca6];var _0x420562=createListener(_0x1f18('0x6')+_0x4a39f4,_0x446163);ChatInteractionEvents['on'](_0x4a39f4,_0x420562);}};
\ No newline at end of file
index 47162eb..c85d541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4431=['customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','./chatInteraction.controller','get','/describe','isAuthenticated','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','/:id','update','/:id/custom_update'];(function(_0x5ee367,_0x5aff0b){var _0x145dde=function(_0x1a23d0){while(--_0x1a23d0){_0x5ee367['push'](_0x5ee367['shift']());}};_0x145dde(++_0x5aff0b);}(_0x4431,0x19f));var _0x1443=function(_0xeba338,_0xe21361){_0xeba338=_0xeba338-0x0;var _0x1bfdc0=_0x4431[_0xeba338];return _0x1bfdc0;};'use strict';var multer=require(_0x1443('0x0'));var util=require(_0x1443('0x1'));var path=require(_0x1443('0x2'));var timeout=require(_0x1443('0x3'));var express=require(_0x1443('0x4'));var router=express[_0x1443('0x5')]();var fs_extra=require(_0x1443('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1443('0x7'));router[_0x1443('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1443('0x8')](_0x1443('0x9'),auth[_0x1443('0xa')](),controller['describe']);router[_0x1443('0x8')]('/:id',auth[_0x1443('0xb')](),controller[_0x1443('0xc')]);router[_0x1443('0x8')](_0x1443('0xd'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x1443('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x1443('0x8')](_0x1443('0xe'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0x1443('0xf'),auth[_0x1443('0xa')](),controller[_0x1443('0x10')]);router[_0x1443('0x11')]('/',auth[_0x1443('0xa')](),controller[_0x1443('0x12')]);router[_0x1443('0x11')](_0x1443('0x13'),auth[_0x1443('0xa')](),controller[_0x1443('0x14')]);var upload=multer({'storage':multer[_0x1443('0x15')]({'destination':function(_0x309744,_0x37ddb0,_0x57c3d9){_0x57c3d9(null,path[_0x1443('0x16')](config[_0x1443('0x17')],_0x1443('0x18')));},'filename':function(_0x241e8c,_0x4c0c88,_0x4d3797){_0x4d3797(null,util[_0x1443('0x19')](_0x1443('0x1a'),Date[_0x1443('0x1b')](),_0x4c0c88[_0x1443('0x1c')][_0x1443('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1443('0x11')](_0x1443('0x1e'),upload[_0x1443('0x1f')](_0x1443('0x20')),controller[_0x1443('0x21')]);router['post'](_0x1443('0x22'),auth[_0x1443('0xb')](),controller[_0x1443('0x23')]);router[_0x1443('0x11')](_0x1443('0x24'),auth[_0x1443('0xa')](),interaction['tracked'](_0x1443('0x25'),_0x1443('0x26')),controller[_0x1443('0x27')]);router[_0x1443('0x28')](_0x1443('0x29'),auth['isAuthenticated'](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x1443('0x2a')]);router['put'](_0x1443('0x2b'),controller[_0x1443('0x2c')]);router[_0x1443('0x28')](_0x1443('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0x1443('0x2e')]);router['put'](_0x1443('0x2f'),controller['close']);router[_0x1443('0x30')](_0x1443('0x29'),auth['isAuthenticated'](),interaction['tracked'](_0x1443('0x25'),_0x1443('0x31')),controller[_0x1443('0x32')]);router['delete']('/:id/tags',auth[_0x1443('0xa')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x0199=['addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','isAuthenticated','index','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single'];(function(_0x3e73d7,_0x3fc0c4){var _0x1988d5=function(_0x33c5a1){while(--_0x33c5a1){_0x3e73d7['push'](_0x3e73d7['shift']());}};_0x1988d5(++_0x3fc0c4);}(_0x0199,0x1d1));var _0x9019=function(_0x4d4e10,_0x47974e){_0x4d4e10=_0x4d4e10-0x0;var _0x44b989=_0x0199[_0x4d4e10];return _0x44b989;};'use strict';var multer=require('multer');var util=require(_0x9019('0x0'));var path=require(_0x9019('0x1'));var timeout=require(_0x9019('0x2'));var express=require(_0x9019('0x3'));var router=express[_0x9019('0x4')]();var fs_extra=require(_0x9019('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9019('0x6'));var controller=require(_0x9019('0x7'));router['get']('/',auth[_0x9019('0x8')](),controller[_0x9019('0x9')]);router['get']('/describe',auth[_0x9019('0x8')](),controller[_0x9019('0xa')]);router[_0x9019('0xb')](_0x9019('0xc'),auth[_0x9019('0xd')](),controller[_0x9019('0xe')]);router['get'](_0x9019('0xf'),auth[_0x9019('0xd')](),controller[_0x9019('0x10')]);router[_0x9019('0xb')](_0x9019('0x11'),auth[_0x9019('0x8')](),controller[_0x9019('0x12')]);router[_0x9019('0xb')]('/:id/my_messages',auth[_0x9019('0xd')](),controller[_0x9019('0x13')]);router[_0x9019('0xb')](_0x9019('0x14'),auth[_0x9019('0x8')](),controller['download']);router['post']('/',auth[_0x9019('0x8')](),controller[_0x9019('0x15')]);router[_0x9019('0x16')](_0x9019('0x17'),auth[_0x9019('0x8')](),controller[_0x9019('0x18')]);var upload=multer({'storage':multer[_0x9019('0x19')]({'destination':function(_0x16ac49,_0x451284,_0x11c33a){_0x11c33a(null,path[_0x9019('0x1a')](config[_0x9019('0x1b')],_0x9019('0x1c')));},'filename':function(_0x12a29a,_0x52edb9,_0xabdb12){_0xabdb12(null,util[_0x9019('0x1d')](_0x9019('0x1e'),Date[_0x9019('0x1f')](),_0x52edb9['originalname'][_0x9019('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x9019('0x21'),upload[_0x9019('0x22')]('file'),controller['attachmentUpload']);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x9019('0x23')]);router['post'](_0x9019('0x24'),auth[_0x9019('0x8')](),interaction[_0x9019('0x25')](_0x9019('0x26'),_0x9019('0x27')),controller['addTags']);router[_0x9019('0x28')](_0x9019('0xc'),auth[_0x9019('0x8')](),interaction[_0x9019('0x25')](_0x9019('0x26'),'chatinteraction:update'),controller['update']);router['put'](_0x9019('0x29'),controller[_0x9019('0x2a')]);router[_0x9019('0x28')](_0x9019('0x2b'),auth[_0x9019('0xd')](),controller[_0x9019('0x2c')]);router[_0x9019('0x28')](_0x9019('0x2d'),controller[_0x9019('0x2e')]);router[_0x9019('0x2f')](_0x9019('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x9019('0x26'),'chatinteraction:destroy'),controller[_0x9019('0x30')]);router[_0x9019('0x2f')](_0x9019('0x24'),auth[_0x9019('0x8')](),controller['removeTags']);module[_0x9019('0x31')]=router;
\ No newline at end of file
index 48d757b..beca974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b8c=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x654386,_0x81fc01){var _0x3cdde3=function(_0xaede8){while(--_0xaede8){_0x654386['push'](_0x654386['shift']());}};_0x3cdde3(++_0x81fc01);}(_0x2b8c,0x1ec));var _0xc2b8=function(_0x22fee2,_0x6360ee){_0x22fee2=_0x22fee2-0x0;var _0x28dec4=_0x2b8c[_0x22fee2];return _0x28dec4;};'use strict';var Sequelize=require(_0xc2b8('0x0'));module[_0xc2b8('0x1')]={'body':{'type':Sequelize[_0xc2b8('0x2')](_0xc2b8('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc2b8('0x4')]}};
\ No newline at end of file
+var _0x3e07=['INTEGER','exports','TEXT','medium'];(function(_0x2d9da3,_0x63174d){var _0x2a8d6a=function(_0x92c576){while(--_0x92c576){_0x2d9da3['push'](_0x2d9da3['shift']());}};_0x2a8d6a(++_0x63174d);}(_0x3e07,0x1a9));var _0x73e0=function(_0x5c9844,_0x14354f){_0x5c9844=_0x5c9844-0x0;var _0x3663b8=_0x3e07[_0x5c9844];return _0x3663b8;};'use strict';var Sequelize=require('sequelize');module[_0x73e0('0x0')]={'body':{'type':Sequelize[_0x73e0('0x1')](_0x73e0('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x73e0('0x3')]}};
\ No newline at end of file
index d1f8ae3..2133a7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x013d=['send','index','ChatInternalMessage','rawAttributes','type','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','get','lastMessageAt','lastMessage','format','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','status','end','error','stack','name'];(function(_0x38fa3e,_0xc23e1b){var _0x4d39ba=function(_0x36fdea){while(--_0x36fdea){_0x38fa3e['push'](_0x38fa3e['shift']());}};_0x4d39ba(++_0xc23e1b);}(_0x013d,0xba));var _0xd013=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x013d[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xd013('0x0'));var rimraf=require(_0xd013('0x1'));var zipdir=require(_0xd013('0x2'));var jsonpatch=require(_0xd013('0x3'));var rp=require(_0xd013('0x4'));var moment=require(_0xd013('0x5'));var BPromise=require(_0xd013('0x6'));var Mustache=require(_0xd013('0x7'));var util=require(_0xd013('0x8'));var path=require(_0xd013('0x9'));var sox=require(_0xd013('0xa'));var csv=require(_0xd013('0xb'));var ejs=require(_0xd013('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd013('0xd'));var squel=require(_0xd013('0xe'));var crypto=require(_0xd013('0xf'));var jsforce=require(_0xd013('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd013('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd013('0x11'));var authService=require(_0xd013('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd013('0x13'));var hardwareService=require(_0xd013('0x14'));var logger=require(_0xd013('0x15'))(_0xd013('0x16'));var utils=require(_0xd013('0x17'));var config=require(_0xd013('0x18'));var licenseUtil=require(_0xd013('0x19'));var db=require(_0xd013('0x1a'))['db'];config['redis']=_[_0xd013('0x1b')](config[_0xd013('0x1c')],{'host':_0xd013('0x1d'),'port':0x18eb});var socket=require(_0xd013('0x1e'))(new Redis(config[_0xd013('0x1c')]));require(_0xd013('0x1f'))[_0xd013('0x20')](socket);function respondWithStatusCode(_0x32fe1a,_0x2345cc){_0x2345cc=_0x2345cc||0xcc;return function(_0x4227c4){if(_0x4227c4){return _0x32fe1a[_0xd013('0x21')](_0x2345cc);}return _0x32fe1a['status'](_0x2345cc)['end']();};}function respondWithResult(_0x24702c,_0xab140c){_0xab140c=_0xab140c||0xc8;return function(_0x4b55dd){if(_0x4b55dd){return _0x24702c['status'](_0xab140c)[_0xd013('0x22')](_0x4b55dd);}};}function respondWithFilteredResult(_0x443151,_0x5ad809){return function(_0x49ff4a){if(_0x49ff4a){var _0x58cad3=typeof _0x5ad809[_0xd013('0x23')]==='undefined'&&typeof _0x5ad809['limit']===_0xd013('0x24');var _0x42c9b8=_0x49ff4a[_0xd013('0x25')];var _0x3eb238=_0x58cad3?0x0:_0x5ad809[_0xd013('0x23')];var _0x22e612=_0x58cad3?_0x49ff4a[_0xd013('0x25')]:_0x5ad809[_0xd013('0x23')]+_0x5ad809['limit'];var _0x438a52;if(_0x22e612>=_0x42c9b8){_0x22e612=_0x42c9b8;_0x438a52=0xc8;}else{_0x438a52=0xce;}_0x443151['status'](_0x438a52);return _0x443151[_0xd013('0x26')](_0xd013('0x27'),_0x3eb238+'-'+_0x22e612+'/'+_0x42c9b8)[_0xd013('0x22')](_0x49ff4a);}return null;};}function patchUpdates(_0x235977){return function(_0x13ae82){try{jsonpatch['apply'](_0x13ae82,_0x235977,!![]);}catch(_0x5c4368){return BPromise[_0xd013('0x28')](_0x5c4368);}return _0x13ae82[_0xd013('0x29')]();};}function saveUpdates(_0x459093,_0x1f7145){return function(_0x32452d){if(_0x32452d){return _0x32452d[_0xd013('0x2a')](_0x459093)[_0xd013('0x2b')](function(_0x4f03f1){return _0x4f03f1;});}return null;};}function removeEntity(_0x1487c1,_0x59db12){return function(_0x134b01){if(_0x134b01){return _0x134b01[_0xd013('0x2c')]()[_0xd013('0x2b')](function(){_0x1487c1[_0xd013('0x2d')](0xcc)[_0xd013('0x2e')]();});}};}function handleEntityNotFound(_0x4e3bd2,_0xb5ac0){return function(_0x1e3b10){if(!_0x1e3b10){_0x4e3bd2[_0xd013('0x21')](0x194);}return _0x1e3b10;};}function handleError(_0x99b6eb,_0x226a1a){_0x226a1a=_0x226a1a||0x1f4;return function(_0xe31c90){logger[_0xd013('0x2f')](_0xe31c90[_0xd013('0x30')]);if(_0xe31c90['name']){delete _0xe31c90[_0xd013('0x31')];}_0x99b6eb[_0xd013('0x2d')](_0x226a1a)[_0xd013('0x32')](_0xe31c90);};}exports[_0xd013('0x33')]=function(_0x37ce84,_0x269411){var _0x441fc0={},_0x41e02a={},_0x16963d={'count':0x0,'rows':[]};var _0x139169=_['map'](db[_0xd013('0x34')][_0xd013('0x35')],function(_0x134cd0){return{'name':_0x134cd0['fieldName'],'type':_0x134cd0[_0xd013('0x36')][_0xd013('0x37')]};});_0x41e02a['model']=_['map'](_0x139169,_0xd013('0x31'));_0x41e02a[_0xd013('0x38')]=_[_0xd013('0x39')](_0x37ce84[_0xd013('0x38')]);_0x41e02a['filters']=_['intersection'](_0x41e02a[_0xd013('0x3a')],_0x41e02a[_0xd013('0x38')]);_0x441fc0['attributes']=_[_0xd013('0x3b')](_0x41e02a[_0xd013('0x3a')],qs[_0xd013('0x3c')](_0x37ce84['query'][_0xd013('0x3c')]));_0x441fc0[_0xd013('0x3d')]=_0x441fc0['attributes'][_0xd013('0x3e')]?_0x441fc0[_0xd013('0x3d')]:_0x41e02a['model'];if(!_0x37ce84[_0xd013('0x38')][_0xd013('0x3f')]('nolimit')){_0x441fc0[_0xd013('0x40')]=qs[_0xd013('0x40')](_0x37ce84[_0xd013('0x38')][_0xd013('0x40')]);_0x441fc0['offset']=qs[_0xd013('0x23')](_0x37ce84[_0xd013('0x38')][_0xd013('0x23')]);}_0x441fc0[_0xd013('0x41')]=qs[_0xd013('0x42')](_0x37ce84[_0xd013('0x38')]['sort']);_0x441fc0[_0xd013('0x43')]=qs[_0xd013('0x44')](_['pick'](_0x37ce84[_0xd013('0x38')],_0x41e02a[_0xd013('0x44')]),_0x139169);if(_0x37ce84[_0xd013('0x38')][_0xd013('0x45')]){_0x441fc0[_0xd013('0x43')]=_['merge'](_0x441fc0[_0xd013('0x43')],{'$or':_[_0xd013('0x46')](_0x139169,function(_0x44f9a1){if(_0x44f9a1[_0xd013('0x36')]!==_0xd013('0x47')){var _0x41557d={};_0x41557d[_0x44f9a1[_0xd013('0x31')]]={'$like':'%'+_0x37ce84['query'][_0xd013('0x45')]+'%'};return _0x41557d;}})});}_0x441fc0=_[_0xd013('0x48')]({},_0x441fc0,_0x37ce84[_0xd013('0x49')]);var _0x577385={'where':_0x441fc0['where']};return db[_0xd013('0x34')][_0xd013('0x25')](_0x577385)[_0xd013('0x2b')](function(_0x5c3a0b){_0x16963d[_0xd013('0x25')]=_0x5c3a0b;if(_0x37ce84[_0xd013('0x38')][_0xd013('0x4a')]){_0x441fc0[_0xd013('0x4b')]=[{'all':!![]}];}return db[_0xd013('0x34')][_0xd013('0x4c')](_0x441fc0);})['then'](function(_0x11b599){_0x16963d[_0xd013('0x4d')]=_0x11b599;return _0x16963d;})[_0xd013('0x2b')](respondWithFilteredResult(_0x269411,_0x441fc0))['catch'](handleError(_0x269411,null));};exports[_0xd013('0x4e')]=function(_0x2b3e6a,_0x198a0b){var _0x423c5b={'raw':!![],'where':{'id':_0x2b3e6a[_0xd013('0x4f')]['id']}},_0x27385={};_0x27385[_0xd013('0x3a')]=_['keys'](db['ChatInternalMessage'][_0xd013('0x35')]);_0x27385[_0xd013('0x38')]=_[_0xd013('0x39')](_0x2b3e6a[_0xd013('0x38')]);_0x27385[_0xd013('0x44')]=_['intersection'](_0x27385['model'],_0x27385[_0xd013('0x38')]);_0x423c5b['attributes']=_[_0xd013('0x3b')](_0x27385[_0xd013('0x3a')],qs[_0xd013('0x3c')](_0x2b3e6a[_0xd013('0x38')]['fields']));_0x423c5b[_0xd013('0x3d')]=_0x423c5b['attributes'][_0xd013('0x3e')]?_0x423c5b[_0xd013('0x3d')]:_0x27385[_0xd013('0x3a')];if(_0x2b3e6a[_0xd013('0x38')][_0xd013('0x4a')]){_0x423c5b[_0xd013('0x4b')]=[{'all':!![]}];}_0x423c5b=_['merge']({},_0x423c5b,_0x2b3e6a[_0xd013('0x49')]);return db[_0xd013('0x34')][_0xd013('0x50')](_0x423c5b)[_0xd013('0x2b')](handleEntityNotFound(_0x198a0b,null))[_0xd013('0x2b')](respondWithResult(_0x198a0b,null))[_0xd013('0x51')](handleError(_0x198a0b,null));};exports[_0xd013('0x52')]=function(_0x4b8af1,_0x5dfd4f){return db[_0xd013('0x34')]['create'](_0x4b8af1[_0xd013('0x53')],{})['then'](respondWithResult(_0x5dfd4f,0xc9))['catch'](handleError(_0x5dfd4f,null));};exports['update']=function(_0x3fdfde,_0x15eaf2){if(_0x3fdfde[_0xd013('0x53')]['id']){delete _0x3fdfde['body']['id'];}return db[_0xd013('0x34')]['find']({'where':{'id':_0x3fdfde[_0xd013('0x4f')]['id']}})['then'](handleEntityNotFound(_0x15eaf2,null))[_0xd013('0x2b')](saveUpdates(_0x3fdfde[_0xd013('0x53')],null))['then'](respondWithResult(_0x15eaf2,null))[_0xd013('0x51')](handleError(_0x15eaf2,null));};exports['destroy']=function(_0x18a4c9,_0x50b76b){return db['ChatInternalMessage']['find']({'where':{'id':_0x18a4c9['params']['id']}})[_0xd013('0x2b')](handleEntityNotFound(_0x50b76b,null))[_0xd013('0x2b')](removeEntity(_0x50b76b,null))['catch'](handleError(_0x50b76b,null));};exports[_0xd013('0x54')]=function(_0x51c669,_0x526b42){return db['ChatInternalMessage'][_0xd013('0x54')]()[_0xd013('0x2b')](respondWithResult(_0x526b42,null))[_0xd013('0x51')](handleError(_0x526b42,null));};function wrapUser(_0x3a6b88){return function(_0x1ee2fd){var _0x9febc2=_0x3a6b88[_0xd013('0x55')]({'plain':!![]});_0x9febc2['messages']=[];if(_0x1ee2fd){_0x9febc2[_0xd013('0x56')]=_0x1ee2fd['createdAt'];_0x9febc2[_0xd013('0x57')]=_0x1ee2fd;}else{_0x9febc2[_0xd013('0x56')]=moment(0x0)[_0xd013('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x9febc2[_0xd013('0x57')]={};}return _0x9febc2;};}exports[_0xd013('0x59')]=function(_0x530ea2,_0x59eda3,_0x359cf2){var _0x22c14a=[];return db[_0xd013('0x5a')][_0xd013('0x4c')]({'where':{'role':[_0xd013('0x5b'),_0xd013('0x5c'),_0xd013('0x5d')]},'attributes':['id',_0xd013('0x5e'),_0xd013('0x31'),_0xd013('0x5f'),_0xd013('0x60'),_0xd013('0x61'),_0xd013('0x62'),_0xd013('0x63'),_0xd013('0x64'),_0xd013('0x65')],'order':qs['sort']('-online'),'include':[{'model':db[_0xd013('0x66')],'as':_0xd013('0x67'),'attributes':['id',_0xd013('0x31'),_0xd013('0x36')],'through':{'attributes':[]}}]})[_0xd013('0x2b')](function(_0x3b48e7){if(_0x3b48e7){var _0x445919=_0x530ea2['user'][_0xd013('0x55')]({'plain':!![]});if(!_0x445919)throw new Error(_0xd013('0x68'));if(_0x445919[_0xd013('0x5f')]===_0xd013('0x5d')){return db[_0xd013('0x69')][_0xd013('0x50')]({'where':{'name':_0xd013('0x6a'),'userProfileId':_0x445919[_0xd013('0x6b')]},'raw':!![]})[_0xd013('0x2b')](function(_0x16beb0){if(_0x16beb0){if(_0x16beb0[_0xd013('0x6c')]===0x0){return db[_0xd013('0x6d')][_0xd013('0x4c')]({'where':{'sectionId':_0x16beb0['id']},'raw':!![]})[_0xd013('0x2b')](function(_0x35008a){var _0x5189dd=[];if(_[_0xd013('0x6e')](_0x35008a)){_0x5189dd=_['filter'](_0x3b48e7,function(_0x53c1b8){if(_0x53c1b8[_0xd013('0x5f')]!==_0xd013('0x5b')){return _0x53c1b8;}});return _0x5189dd;}else{for(var _0x560f3=0x0;_0x560f3<_0x3b48e7[_0xd013('0x3e')];_0x560f3++){var _0x26cd7a=_0x3b48e7[_0x560f3];if(_0x26cd7a[_0xd013('0x5f')]===_0xd013('0x5b')){var _0x27f341=_[_0xd013('0x50')](_0x35008a,function(_0x2eccc6){return _0x2eccc6[_0xd013('0x6f')]===_0x26cd7a['id'];});if(_0x27f341)_0x5189dd[_0xd013('0x70')](_0x26cd7a);}else{_0x5189dd[_0xd013('0x70')](_0x26cd7a);}}return _0x5189dd;}});}else{return _0x3b48e7;}}else{var _0x1f9334=_[_0xd013('0x45')](_0x3b48e7,function(_0x23f86c){if(_0x23f86c[_0xd013('0x5f')]!==_0xd013('0x5b')){return _0x23f86c;}});return _0x1f9334;}});}else{return _0x3b48e7;}}})[_0xd013('0x2b')](function(_0x5217bc){var _0x562422=[];if(_0x5217bc){_0x22c14a=_0x5217bc;for(var _0x2253f4=0x0;_0x2253f4<_0x5217bc[_0xd013('0x3e')];_0x2253f4+=0x1){_0x22c14a[_0x2253f4][_0xd013('0x71')]=[];_0x562422[_0xd013('0x70')](db['ChatInternalMessage'][_0xd013('0x50')]({'where':{'FromId':[_0x530ea2[_0xd013('0x5d')]['id'],_0x5217bc[_0x2253f4]['id']],'ToId':[_0x530ea2['user']['id'],_0x5217bc[_0x2253f4]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xd013('0x72'),_0xd013('0x73'),_0xd013('0x53')],'order':qs[_0xd013('0x42')](_0xd013('0x74')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd013('0x2b')](wrapUser(_0x5217bc[_0x2253f4])));}return BPromise[_0xd013('0x75')](_0x562422);}return[];})[_0xd013('0x2b')](function(_0xdd5365){return{'rows':_0xdd5365,'count':_0xdd5365['length']};})[_0xd013('0x2b')](respondWithResult(_0x59eda3,null))[_0xd013('0x51')](handleError(_0x59eda3,null));};
\ No newline at end of file
+var _0x1b4e=['apply','reject','update','destroy','then','error','stack','name','send','index','ChatInternalMessage','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','user','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','push','messages','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0x1b4e,0x129));var _0xe1b4=function(_0xbbace6,_0x4c1b07){_0xbbace6=_0xbbace6-0x0;var _0x30033a=_0x1b4e[_0xbbace6];return _0x30033a;};'use strict';var emlformat=require(_0xe1b4('0x0'));var rimraf=require(_0xe1b4('0x1'));var zipdir=require(_0xe1b4('0x2'));var jsonpatch=require(_0xe1b4('0x3'));var rp=require(_0xe1b4('0x4'));var moment=require(_0xe1b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe1b4('0x6'));var util=require(_0xe1b4('0x7'));var path=require(_0xe1b4('0x8'));var sox=require(_0xe1b4('0x9'));var csv=require(_0xe1b4('0xa'));var ejs=require(_0xe1b4('0xb'));var fs=require('fs');var fs_extra=require(_0xe1b4('0xc'));var _=require(_0xe1b4('0xd'));var squel=require('squel');var crypto=require(_0xe1b4('0xe'));var jsforce=require(_0xe1b4('0xf'));var deskjs=require(_0xe1b4('0x10'));var toCsv=require(_0xe1b4('0xa'));var querystring=require(_0xe1b4('0x11'));var Papa=require(_0xe1b4('0x12'));var Redis=require('ioredis');var authService=require(_0xe1b4('0x13'));var qs=require(_0xe1b4('0x14'));var as=require(_0xe1b4('0x15'));var hardwareService=require(_0xe1b4('0x16'));var logger=require(_0xe1b4('0x17'))(_0xe1b4('0x18'));var utils=require(_0xe1b4('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe1b4('0x1a'));var db=require(_0xe1b4('0x1b'))['db'];config[_0xe1b4('0x1c')]=_['defaults'](config[_0xe1b4('0x1c')],{'host':_0xe1b4('0x1d'),'port':0x18eb});var socket=require(_0xe1b4('0x1e'))(new Redis(config[_0xe1b4('0x1c')]));require(_0xe1b4('0x1f'))[_0xe1b4('0x20')](socket);function respondWithStatusCode(_0x409e30,_0x2d3f3f){_0x2d3f3f=_0x2d3f3f||0xcc;return function(_0x7626d){if(_0x7626d){return _0x409e30[_0xe1b4('0x21')](_0x2d3f3f);}return _0x409e30[_0xe1b4('0x22')](_0x2d3f3f)[_0xe1b4('0x23')]();};}function respondWithResult(_0x4c3eaa,_0x4a2770){_0x4a2770=_0x4a2770||0xc8;return function(_0x2a4ed){if(_0x2a4ed){return _0x4c3eaa[_0xe1b4('0x22')](_0x4a2770)['json'](_0x2a4ed);}};}function respondWithFilteredResult(_0x12699f,_0x5dbd75){return function(_0x91a834){if(_0x91a834){var _0x22bf12=typeof _0x5dbd75[_0xe1b4('0x24')]===_0xe1b4('0x25')&&typeof _0x5dbd75['limit']===_0xe1b4('0x25');var _0x51fb93=_0x91a834[_0xe1b4('0x26')];var _0x5470d1=_0x22bf12?0x0:_0x5dbd75[_0xe1b4('0x24')];var _0x18eb33=_0x22bf12?_0x91a834['count']:_0x5dbd75[_0xe1b4('0x24')]+_0x5dbd75[_0xe1b4('0x27')];var _0xefa7a6;if(_0x18eb33>=_0x51fb93){_0x18eb33=_0x51fb93;_0xefa7a6=0xc8;}else{_0xefa7a6=0xce;}_0x12699f[_0xe1b4('0x22')](_0xefa7a6);return _0x12699f['set'](_0xe1b4('0x28'),_0x5470d1+'-'+_0x18eb33+'/'+_0x51fb93)[_0xe1b4('0x29')](_0x91a834);}return null;};}function patchUpdates(_0x19c117){return function(_0x284762){try{jsonpatch[_0xe1b4('0x2a')](_0x284762,_0x19c117,!![]);}catch(_0x58ad1c){return BPromise[_0xe1b4('0x2b')](_0x58ad1c);}return _0x284762['save']();};}function saveUpdates(_0x4fc904,_0x5c98b4){return function(_0x305855){if(_0x305855){return _0x305855[_0xe1b4('0x2c')](_0x4fc904)['then'](function(_0x4b134e){return _0x4b134e;});}return null;};}function removeEntity(_0x1f55d6,_0x50d08e){return function(_0x3b9233){if(_0x3b9233){return _0x3b9233[_0xe1b4('0x2d')]()[_0xe1b4('0x2e')](function(){_0x1f55d6[_0xe1b4('0x22')](0xcc)[_0xe1b4('0x23')]();});}};}function handleEntityNotFound(_0x35f7e2,_0x213251){return function(_0x47f5f9){if(!_0x47f5f9){_0x35f7e2[_0xe1b4('0x21')](0x194);}return _0x47f5f9;};}function handleError(_0xb893d1,_0x38e512){_0x38e512=_0x38e512||0x1f4;return function(_0x11919c){logger[_0xe1b4('0x2f')](_0x11919c[_0xe1b4('0x30')]);if(_0x11919c['name']){delete _0x11919c[_0xe1b4('0x31')];}_0xb893d1[_0xe1b4('0x22')](_0x38e512)[_0xe1b4('0x32')](_0x11919c);};}exports[_0xe1b4('0x33')]=function(_0x25eec8,_0x31054c){var _0x3acf18={},_0x14dfb3={},_0x57fc2e={'count':0x0,'rows':[]};var _0x2c0db1=_['map'](db[_0xe1b4('0x34')]['rawAttributes'],function(_0x5dd220){return{'name':_0x5dd220['fieldName'],'type':_0x5dd220[_0xe1b4('0x35')][_0xe1b4('0x36')]};});_0x14dfb3[_0xe1b4('0x37')]=_[_0xe1b4('0x38')](_0x2c0db1,_0xe1b4('0x31'));_0x14dfb3[_0xe1b4('0x39')]=_[_0xe1b4('0x3a')](_0x25eec8[_0xe1b4('0x39')]);_0x14dfb3[_0xe1b4('0x3b')]=_[_0xe1b4('0x3c')](_0x14dfb3[_0xe1b4('0x37')],_0x14dfb3[_0xe1b4('0x39')]);_0x3acf18[_0xe1b4('0x3d')]=_[_0xe1b4('0x3c')](_0x14dfb3[_0xe1b4('0x37')],qs[_0xe1b4('0x3e')](_0x25eec8[_0xe1b4('0x39')][_0xe1b4('0x3e')]));_0x3acf18[_0xe1b4('0x3d')]=_0x3acf18[_0xe1b4('0x3d')][_0xe1b4('0x3f')]?_0x3acf18[_0xe1b4('0x3d')]:_0x14dfb3[_0xe1b4('0x37')];if(!_0x25eec8['query']['hasOwnProperty']('nolimit')){_0x3acf18[_0xe1b4('0x27')]=qs[_0xe1b4('0x27')](_0x25eec8[_0xe1b4('0x39')][_0xe1b4('0x27')]);_0x3acf18['offset']=qs['offset'](_0x25eec8[_0xe1b4('0x39')][_0xe1b4('0x24')]);}_0x3acf18[_0xe1b4('0x40')]=qs[_0xe1b4('0x41')](_0x25eec8['query'][_0xe1b4('0x41')]);_0x3acf18[_0xe1b4('0x42')]=qs[_0xe1b4('0x3b')](_['pick'](_0x25eec8[_0xe1b4('0x39')],_0x14dfb3[_0xe1b4('0x3b')]),_0x2c0db1);if(_0x25eec8['query']['filter']){_0x3acf18['where']=_[_0xe1b4('0x43')](_0x3acf18[_0xe1b4('0x42')],{'$or':_[_0xe1b4('0x38')](_0x2c0db1,function(_0x1a45d4){if(_0x1a45d4[_0xe1b4('0x35')]!==_0xe1b4('0x44')){var _0x458072={};_0x458072[_0x1a45d4[_0xe1b4('0x31')]]={'$like':'%'+_0x25eec8['query'][_0xe1b4('0x45')]+'%'};return _0x458072;}})});}_0x3acf18=_[_0xe1b4('0x43')]({},_0x3acf18,_0x25eec8[_0xe1b4('0x46')]);var _0x44294c={'where':_0x3acf18['where']};return db['ChatInternalMessage'][_0xe1b4('0x26')](_0x44294c)[_0xe1b4('0x2e')](function(_0xdf84d1){_0x57fc2e[_0xe1b4('0x26')]=_0xdf84d1;if(_0x25eec8[_0xe1b4('0x39')]['includeAll']){_0x3acf18[_0xe1b4('0x47')]=[{'all':!![]}];}return db[_0xe1b4('0x34')][_0xe1b4('0x48')](_0x3acf18);})[_0xe1b4('0x2e')](function(_0x116642){_0x57fc2e[_0xe1b4('0x49')]=_0x116642;return _0x57fc2e;})[_0xe1b4('0x2e')](respondWithFilteredResult(_0x31054c,_0x3acf18))[_0xe1b4('0x4a')](handleError(_0x31054c,null));};exports[_0xe1b4('0x4b')]=function(_0x1e7e84,_0x12cef4){var _0x4942a7={'raw':!![],'where':{'id':_0x1e7e84[_0xe1b4('0x4c')]['id']}},_0x2f12ee={};_0x2f12ee[_0xe1b4('0x37')]=_[_0xe1b4('0x3a')](db[_0xe1b4('0x34')][_0xe1b4('0x4d')]);_0x2f12ee[_0xe1b4('0x39')]=_[_0xe1b4('0x3a')](_0x1e7e84[_0xe1b4('0x39')]);_0x2f12ee['filters']=_[_0xe1b4('0x3c')](_0x2f12ee[_0xe1b4('0x37')],_0x2f12ee[_0xe1b4('0x39')]);_0x4942a7[_0xe1b4('0x3d')]=_['intersection'](_0x2f12ee['model'],qs[_0xe1b4('0x3e')](_0x1e7e84['query']['fields']));_0x4942a7[_0xe1b4('0x3d')]=_0x4942a7[_0xe1b4('0x3d')][_0xe1b4('0x3f')]?_0x4942a7[_0xe1b4('0x3d')]:_0x2f12ee[_0xe1b4('0x37')];if(_0x1e7e84[_0xe1b4('0x39')][_0xe1b4('0x4e')]){_0x4942a7[_0xe1b4('0x47')]=[{'all':!![]}];}_0x4942a7=_[_0xe1b4('0x43')]({},_0x4942a7,_0x1e7e84[_0xe1b4('0x46')]);return db[_0xe1b4('0x34')][_0xe1b4('0x4f')](_0x4942a7)[_0xe1b4('0x2e')](handleEntityNotFound(_0x12cef4,null))[_0xe1b4('0x2e')](respondWithResult(_0x12cef4,null))[_0xe1b4('0x4a')](handleError(_0x12cef4,null));};exports['create']=function(_0x50f975,_0x5555a6){return db['ChatInternalMessage'][_0xe1b4('0x50')](_0x50f975[_0xe1b4('0x51')],{})[_0xe1b4('0x2e')](respondWithResult(_0x5555a6,0xc9))[_0xe1b4('0x4a')](handleError(_0x5555a6,null));};exports[_0xe1b4('0x2c')]=function(_0x5abb4a,_0x3d7c05){if(_0x5abb4a[_0xe1b4('0x51')]['id']){delete _0x5abb4a['body']['id'];}return db[_0xe1b4('0x34')][_0xe1b4('0x4f')]({'where':{'id':_0x5abb4a[_0xe1b4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d7c05,null))[_0xe1b4('0x2e')](saveUpdates(_0x5abb4a[_0xe1b4('0x51')],null))[_0xe1b4('0x2e')](respondWithResult(_0x3d7c05,null))['catch'](handleError(_0x3d7c05,null));};exports[_0xe1b4('0x2d')]=function(_0x1edefd,_0x3353b9){return db[_0xe1b4('0x34')][_0xe1b4('0x4f')]({'where':{'id':_0x1edefd[_0xe1b4('0x4c')]['id']}})[_0xe1b4('0x2e')](handleEntityNotFound(_0x3353b9,null))[_0xe1b4('0x2e')](removeEntity(_0x3353b9,null))[_0xe1b4('0x4a')](handleError(_0x3353b9,null));};exports['describe']=function(_0x2aeede,_0x33ca8c){return db[_0xe1b4('0x34')][_0xe1b4('0x52')]()[_0xe1b4('0x2e')](respondWithResult(_0x33ca8c,null))[_0xe1b4('0x4a')](handleError(_0x33ca8c,null));};function wrapUser(_0x160790){return function(_0x4f1824){var _0x14f684=_0x160790[_0xe1b4('0x53')]({'plain':!![]});_0x14f684['messages']=[];if(_0x4f1824){_0x14f684[_0xe1b4('0x54')]=_0x4f1824[_0xe1b4('0x55')];_0x14f684['lastMessage']=_0x4f1824;}else{_0x14f684[_0xe1b4('0x54')]=moment(0x0)[_0xe1b4('0x56')](_0xe1b4('0x57'));_0x14f684[_0xe1b4('0x58')]={};}return _0x14f684;};}exports[_0xe1b4('0x59')]=function(_0x32fa7d,_0x18422d,_0x44a812){var _0x15bb09=[];return db[_0xe1b4('0x5a')][_0xe1b4('0x48')]({'where':{'role':[_0xe1b4('0x5b'),'admin',_0xe1b4('0x5c')]},'attributes':['id',_0xe1b4('0x5d'),_0xe1b4('0x31'),_0xe1b4('0x5e'),'userpic','internal',_0xe1b4('0x5f'),_0xe1b4('0x60'),_0xe1b4('0x61'),_0xe1b4('0x62')],'order':qs[_0xe1b4('0x41')](_0xe1b4('0x63')),'include':[{'model':db[_0xe1b4('0x64')],'as':_0xe1b4('0x65'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x260b6e){if(_0x260b6e){var _0x4b27c0=_0x32fa7d[_0xe1b4('0x5c')][_0xe1b4('0x53')]({'plain':!![]});if(!_0x4b27c0)throw new Error(_0xe1b4('0x66'));if(_0x4b27c0[_0xe1b4('0x5e')]==='user'){return db[_0xe1b4('0x67')][_0xe1b4('0x4f')]({'where':{'name':_0xe1b4('0x68'),'userProfileId':_0x4b27c0[_0xe1b4('0x69')]},'raw':!![]})['then'](function(_0x18d91a){if(_0x18d91a){if(_0x18d91a['autoAssociation']===0x0){return db[_0xe1b4('0x6a')][_0xe1b4('0x48')]({'where':{'sectionId':_0x18d91a['id']},'raw':!![]})[_0xe1b4('0x2e')](function(_0x1c51ed){var _0x22543d=[];if(_[_0xe1b4('0x6b')](_0x1c51ed)){_0x22543d=_[_0xe1b4('0x45')](_0x260b6e,function(_0x3e4485){if(_0x3e4485[_0xe1b4('0x5e')]!=='agent'){return _0x3e4485;}});return _0x22543d;}else{for(var _0x332c6b=0x0;_0x332c6b<_0x260b6e[_0xe1b4('0x3f')];_0x332c6b++){var _0x1be2d0=_0x260b6e[_0x332c6b];if(_0x1be2d0[_0xe1b4('0x5e')]==='agent'){var _0x53cc4b=_[_0xe1b4('0x4f')](_0x1c51ed,function(_0x2ec935){return _0x2ec935['resourceId']===_0x1be2d0['id'];});if(_0x53cc4b)_0x22543d[_0xe1b4('0x6c')](_0x1be2d0);}else{_0x22543d[_0xe1b4('0x6c')](_0x1be2d0);}}return _0x22543d;}});}else{return _0x260b6e;}}else{var _0x34823a=_[_0xe1b4('0x45')](_0x260b6e,function(_0x5070bd){if(_0x5070bd[_0xe1b4('0x5e')]!==_0xe1b4('0x5b')){return _0x5070bd;}});return _0x34823a;}});}else{return _0x260b6e;}}})['then'](function(_0x7bba8f){var _0x5989db=[];if(_0x7bba8f){_0x15bb09=_0x7bba8f;for(var _0x18d96a=0x0;_0x18d96a<_0x7bba8f['length'];_0x18d96a+=0x1){_0x15bb09[_0x18d96a][_0xe1b4('0x6d')]=[];_0x5989db[_0xe1b4('0x6c')](db[_0xe1b4('0x34')][_0xe1b4('0x4f')]({'where':{'FromId':[_0x32fa7d[_0xe1b4('0x5c')]['id'],_0x7bba8f[_0x18d96a]['id']],'ToId':[_0x32fa7d[_0xe1b4('0x5c')]['id'],_0x7bba8f[_0x18d96a]['id']],'ChatGroupId':null},'attributes':['id',_0xe1b4('0x55'),'FromId','ToId',_0xe1b4('0x6e'),_0xe1b4('0x51')],'order':qs[_0xe1b4('0x41')](_0xe1b4('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe1b4('0x2e')](wrapUser(_0x7bba8f[_0x18d96a])));}return BPromise[_0xe1b4('0x70')](_0x5989db);}return[];})[_0xe1b4('0x2e')](function(_0x2a5153){return{'rows':_0x2a5153,'count':_0x2a5153[_0xe1b4('0x3f')]};})[_0xe1b4('0x2e')](respondWithResult(_0x18422d,null))[_0xe1b4('0x4a')](handleError(_0x18422d,null));};
\ No newline at end of file
index 1d95fe5..62bd65a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93f1=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','update'];(function(_0x3d12b5,_0x3c47b1){var _0x4724a3=function(_0x54465b){while(--_0x54465b){_0x3d12b5['push'](_0x3d12b5['shift']());}};_0x4724a3(++_0x3c47b1);}(_0x93f1,0x71));var _0x193f=function(_0x4abfa3,_0x319c2e){_0x4abfa3=_0x4abfa3-0x0;var _0x167ad3=_0x93f1[_0x4abfa3];return _0x167ad3;};'use strict';var EventEmitter=require(_0x193f('0x0'));var ChatInternalMessage=require(_0x193f('0x1'))['db'][_0x193f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x193f('0x3'),'afterDestroy':_0x193f('0x4')};function emitEvent(_0x3e078e){return function(_0x24e4cc,_0x499eeb,_0x2c31fc){ChatInternalMessageEvents[_0x193f('0x5')](_0x3e078e+':'+_0x24e4cc['id'],_0x24e4cc);ChatInternalMessageEvents[_0x193f('0x5')](_0x3e078e,_0x24e4cc);_0x2c31fc(null);};}for(var e in events){if(events[_0x193f('0x6')](e)){var event=events[e];ChatInternalMessage[_0x193f('0x7')](e,emitEvent(event));}}module[_0x193f('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x78ce=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x78ce,0x158));var _0xe78c=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x78ce[_0x277af0];return _0x43bd7c;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe78c('0x0')](0x0);var events={'afterCreate':_0xe78c('0x1'),'afterUpdate':_0xe78c('0x2'),'afterDestroy':_0xe78c('0x3')};function emitEvent(_0x1d56c8){return function(_0x3cdad6,_0x5768cb,_0x5e441e){ChatInternalMessageEvents[_0xe78c('0x4')](_0x1d56c8+':'+_0x3cdad6['id'],_0x3cdad6);ChatInternalMessageEvents[_0xe78c('0x4')](_0x1d56c8,_0x3cdad6);_0x5e441e(null);};}for(var e in events){if(events[_0xe78c('0x5')](e)){var event=events[e];ChatInternalMessage[_0xe78c('0x6')](e,emitEvent(event));}}module[_0xe78c('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
index 4353f87..d71af2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb1=['../../config/logger','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x13b62e,_0x12b5a5){var _0x5d4d09=function(_0x224f2b){while(--_0x224f2b){_0x13b62e['push'](_0x13b62e['shift']());}};_0x5d4d09(++_0x12b5a5);}(_0x1cb1,0x1ec));var _0x11cb=function(_0x717d7c,_0x1a46e8){_0x717d7c=_0x717d7c-0x0;var _0x22a603=_0x1cb1[_0x717d7c];return _0x22a603;};'use strict';var _=require(_0x11cb('0x0'));var util=require(_0x11cb('0x1'));var logger=require(_0x11cb('0x2'))(_0x11cb('0x3'));var moment=require(_0x11cb('0x4'));var BPromise=require(_0x11cb('0x5'));var rp=require(_0x11cb('0x6'));var fs=require('fs');var path=require(_0x11cb('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x11cb('0x8'));module[_0x11cb('0x9')]=function(_0x19ab57,_0xdb26ad){return _0x19ab57['define'](_0x11cb('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x11cb('0xb'),'collate':_0x11cb('0xc')});};
\ No newline at end of file
+var _0x1880=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1880,0x1a0));var _0x0188=function(_0x86bed5,_0xa2634d){_0x86bed5=_0x86bed5-0x0;var _0x252d3a=_0x1880[_0x86bed5];return _0x252d3a;};'use strict';var _=require(_0x0188('0x0'));var util=require(_0x0188('0x1'));var logger=require(_0x0188('0x2'))('api');var moment=require(_0x0188('0x3'));var BPromise=require(_0x0188('0x4'));var rp=require(_0x0188('0x5'));var fs=require('fs');var path=require(_0x0188('0x6'));var rimraf=require('rimraf');var config=require(_0x0188('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x0188('0x8')]=function(_0x206f75,_0x595013){return _0x206f75[_0x0188('0x9')](_0x0188('0xa'),attributes,{'tableName':_0x0188('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0188('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index ba1e48a..a36fd68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x813e=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x5b0952,_0x599564){var _0x5d7607=function(_0x14feb6){while(--_0x14feb6){_0x5b0952['push'](_0x5b0952['shift']());}};_0x5d7607(++_0x599564);}(_0x813e,0xba));var _0xe813=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0x813e[_0x2fb87c];return _0x43038b;};'use strict';var _=require(_0xe813('0x0'));var util=require(_0xe813('0x1'));var moment=require(_0xe813('0x2'));var BPromise=require(_0xe813('0x3'));var rs=require(_0xe813('0x4'));var fs=require('fs');var Redis=require(_0xe813('0x5'));var db=require(_0xe813('0x6'))['db'];var utils=require(_0xe813('0x7'));var logger=require(_0xe813('0x8'))(_0xe813('0x9'));var config=require('../../config/environment');var jayson=require(_0xe813('0xa'));var client=jayson[_0xe813('0xb')]['http']({'port':0x232a});config['redis']=_[_0xe813('0xc')](config[_0xe813('0xd')],{'host':_0xe813('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe813('0xd')]));require(_0xe813('0xf'))[_0xe813('0x10')](socket);function respondWithRpcPromise(_0x23ddd3,_0x236827,_0x343dbc){return new BPromise(function(_0x52f3be,_0x233559){return client[_0xe813('0x11')](_0x23ddd3,_0x343dbc)[_0xe813('0x12')](function(_0x454607){logger[_0xe813('0x13')](_0xe813('0x14'),_0x236827,_0xe813('0x15'));logger['debug'](_0xe813('0x16'),_0x236827,'request\x20sent',JSON['stringify'](_0x454607));if(_0x454607[_0xe813('0x17')]){if(_0x454607[_0xe813('0x17')]['code']===0x1f4){logger['error'](_0xe813('0x14'),_0x236827,_0x454607[_0xe813('0x17')]['message']);return _0x233559(_0x454607[_0xe813('0x17')][_0xe813('0x18')]);}logger[_0xe813('0x17')](_0xe813('0x14'),_0x236827,_0x454607[_0xe813('0x17')][_0xe813('0x18')]);return _0x52f3be(_0x454607[_0xe813('0x17')]['message']);}else{logger['info'](_0xe813('0x14'),_0x236827,_0xe813('0x15'));_0x52f3be(_0x454607[_0xe813('0x19')]['message']);}})['catch'](function(_0x5a9c62){logger[_0xe813('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x236827,_0x5a9c62);_0x233559(_0x5a9c62);});});}
\ No newline at end of file
+var _0x1258=['info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x45d055,_0x32a182){var _0x2d3adf=function(_0x42bb8a){while(--_0x42bb8a){_0x45d055['push'](_0x45d055['shift']());}};_0x2d3adf(++_0x32a182);}(_0x1258,0x1ca));var _0x8125=function(_0x26bb77,_0x4552a3){_0x26bb77=_0x26bb77-0x0;var _0x4af561=_0x1258[_0x26bb77];return _0x4af561;};'use strict';var _=require(_0x8125('0x0'));var util=require('util');var moment=require(_0x8125('0x1'));var BPromise=require(_0x8125('0x2'));var rs=require(_0x8125('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8125('0x4'))['db'];var utils=require(_0x8125('0x5'));var logger=require('../../config/logger')(_0x8125('0x6'));var config=require(_0x8125('0x7'));var jayson=require(_0x8125('0x8'));var client=jayson[_0x8125('0x9')][_0x8125('0xa')]({'port':0x232a});config[_0x8125('0xb')]=_[_0x8125('0xc')](config[_0x8125('0xb')],{'host':_0x8125('0xd'),'port':0x18eb});var socket=require(_0x8125('0xe'))(new Redis(config[_0x8125('0xb')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5cc14d,_0x3524ad,_0x17aeab){return new BPromise(function(_0xf2dbb1,_0x457775){return client[_0x8125('0xf')](_0x5cc14d,_0x17aeab)[_0x8125('0x10')](function(_0x3d857f){logger['info'](_0x8125('0x11'),_0x3524ad,_0x8125('0x12'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3524ad,_0x8125('0x12'),JSON[_0x8125('0x13')](_0x3d857f));if(_0x3d857f[_0x8125('0x14')]){if(_0x3d857f[_0x8125('0x14')]['code']===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x3524ad,_0x3d857f['error'][_0x8125('0x15')]);return _0x457775(_0x3d857f[_0x8125('0x14')]['message']);}logger[_0x8125('0x14')](_0x8125('0x11'),_0x3524ad,_0x3d857f[_0x8125('0x14')][_0x8125('0x15')]);return _0xf2dbb1(_0x3d857f[_0x8125('0x14')][_0x8125('0x15')]);}else{logger[_0x8125('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x3524ad,_0x8125('0x12'));_0xf2dbb1(_0x3d857f['result'][_0x8125('0x15')]);}})[_0x8125('0x17')](function(_0x5427b){logger[_0x8125('0x14')](_0x8125('0x11'),_0x3524ad,_0x5427b);_0x457775(_0x5427b);});});}
\ No newline at end of file
index 4012ef5..66c01ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd319=['emit','removeListener','./chatInternalMessage.events','remove'];(function(_0x2c1dd3,_0xe5f383){var _0x3ac491=function(_0x4777d9){while(--_0x4777d9){_0x2c1dd3['push'](_0x2c1dd3['shift']());}};_0x3ac491(++_0xe5f383);}(_0xd319,0xf2));var _0x9d31=function(_0xfc3d6c,_0x49be8e){_0xfc3d6c=_0xfc3d6c-0x0;var _0x32bc7d=_0xd319[_0xfc3d6c];return _0x32bc7d;};'use strict';var ChatInternalMessageEvents=require(_0x9d31('0x0'));var events=['save',_0x9d31('0x1'),'update'];function createListener(_0x5112d4,_0x38de96){return function(_0x3a5cde){_0x38de96[_0x9d31('0x2')](_0x5112d4,_0x3a5cde);};}function removeListener(_0x593e0c,_0xed1d66){return function(){ChatInternalMessageEvents[_0x9d31('0x3')](_0x593e0c,_0xed1d66);};}exports['register']=function(_0x1a1d58){for(var _0x452a44=0x0,_0x3b53b1=events['length'];_0x452a44<_0x3b53b1;_0x452a44++){var _0x2c3c19=events[_0x452a44];var _0x2dd812=createListener('chatInternalMessage:'+_0x2c3c19,_0x1a1d58);ChatInternalMessageEvents['on'](_0x2c3c19,_0x2dd812);}};
\ No newline at end of file
+var _0x1a72=['update','removeListener','register','length','chatInternalMessage:','save','remove'];(function(_0xb65b2f,_0x3c159d){var _0x1d58c5=function(_0x40bbcd){while(--_0x40bbcd){_0xb65b2f['push'](_0xb65b2f['shift']());}};_0x1d58c5(++_0x3c159d);}(_0x1a72,0xd0));var _0x21a7=function(_0x30aa93,_0x40e7f2){_0x30aa93=_0x30aa93-0x0;var _0x44eeff=_0x1a72[_0x30aa93];return _0x44eeff;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x21a7('0x0'),_0x21a7('0x1'),_0x21a7('0x2')];function createListener(_0x15b379,_0x1079bc){return function(_0x44bc0b){_0x1079bc['emit'](_0x15b379,_0x44bc0b);};}function removeListener(_0x318f8c,_0x3b994b){return function(){ChatInternalMessageEvents[_0x21a7('0x3')](_0x318f8c,_0x3b994b);};}exports[_0x21a7('0x4')]=function(_0x1a367d){for(var _0x3e1e0c=0x0,_0x288385=events[_0x21a7('0x5')];_0x3e1e0c<_0x288385;_0x3e1e0c++){var _0x5a1a1e=events[_0x3e1e0c];var _0x307028=createListener(_0x21a7('0x6')+_0x5a1a1e,_0x1a367d);ChatInternalMessageEvents['on'](_0x5a1a1e,_0x307028);}};
\ No newline at end of file
index f574cf5..ead0b0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3652=['getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/users'];(function(_0x510b06,_0x3c0d57){var _0x302c8d=function(_0x2921ef){while(--_0x2921ef){_0x510b06['push'](_0x510b06['shift']());}};_0x302c8d(++_0x3c0d57);}(_0x3652,0x162));var _0x2365=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x3652[_0x2179f1];return _0x176ec9;};'use strict';var multer=require(_0x2365('0x0'));var util=require(_0x2365('0x1'));var path=require(_0x2365('0x2'));var timeout=require(_0x2365('0x3'));var express=require(_0x2365('0x4'));var router=express[_0x2365('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2365('0x6'));var interaction=require(_0x2365('0x7'));var config=require(_0x2365('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x2365('0x9')]('/',auth[_0x2365('0xa')](),controller['index']);router[_0x2365('0x9')](_0x2365('0xb'),auth['isAuthenticated'](),controller[_0x2365('0xc')]);router['get'](_0x2365('0xd'),auth['isAuthenticated'](),controller[_0x2365('0xe')]);router[_0x2365('0x9')](_0x2365('0xf'),auth[_0x2365('0xa')](),controller[_0x2365('0x10')]);router[_0x2365('0x11')]('/',auth[_0x2365('0xa')](),controller[_0x2365('0x12')]);router[_0x2365('0x13')](_0x2365('0xf'),controller[_0x2365('0x14')]);router['delete']('/:id',auth[_0x2365('0xa')](),controller[_0x2365('0x15')]);module[_0x2365('0x16')]=router;
\ No newline at end of file
+var _0xed3f=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3dedad,_0x435b1f){var _0x5470ba=function(_0x9268c4){while(--_0x9268c4){_0x3dedad['push'](_0x3dedad['shift']());}};_0x5470ba(++_0x435b1f);}(_0xed3f,0x11f));var _0xfed3=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0xed3f[_0x2aaa60];return _0x2e3fa5;};'use strict';var multer=require(_0xfed3('0x0'));var util=require(_0xfed3('0x1'));var path=require(_0xfed3('0x2'));var timeout=require(_0xfed3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfed3('0x4'));var auth=require(_0xfed3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfed3('0x6'));var controller=require(_0xfed3('0x7'));router[_0xfed3('0x8')]('/',auth[_0xfed3('0x9')](),controller[_0xfed3('0xa')]);router[_0xfed3('0x8')]('/describe',auth[_0xfed3('0x9')](),controller[_0xfed3('0xb')]);router[_0xfed3('0x8')](_0xfed3('0xc'),auth[_0xfed3('0x9')](),controller['getUsers']);router[_0xfed3('0x8')](_0xfed3('0xd'),auth[_0xfed3('0x9')](),controller[_0xfed3('0xe')]);router[_0xfed3('0xf')]('/',auth[_0xfed3('0x9')](),controller[_0xfed3('0x10')]);router[_0xfed3('0x11')]('/:id',controller[_0xfed3('0x12')]);router[_0xfed3('0x13')](_0xfed3('0xd'),auth['isAuthenticated'](),controller[_0xfed3('0x14')]);module[_0xfed3('0x15')]=router;
\ No newline at end of file
index 7e661b5..50119d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ce=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x29a51a,_0x545b6c){var _0x288a7b=function(_0x2f1301){while(--_0x2f1301){_0x29a51a['push'](_0x29a51a['shift']());}};_0x288a7b(++_0x545b6c);}(_0x02ce,0x1ac));var _0xe02c=function(_0x3ac1a6,_0xe799af){_0x3ac1a6=_0x3ac1a6-0x0;var _0x45ddef=_0x02ce[_0x3ac1a6];return _0x45ddef;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'body':{'type':Sequelize[_0xe02c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe02c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe02c('0x4')]('in',_0xe02c('0x5')),'defaultValue':_0xe02c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe02c('0x6')]},'providerName':{'type':Sequelize[_0xe02c('0x7')]},'providerResponse':{'type':Sequelize[_0xe02c('0x2')]}};
\ No newline at end of file
+var _0x777d=['TEXT','medium','BOOLEAN','ENUM','STRING','exports'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x777d,0xe9));var _0xd777=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x777d[_0x2fdce0];return _0x36f07e;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'body':{'type':Sequelize[_0xd777('0x1')](_0xd777('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd777('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd777('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd777('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 7587bc0..7491528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14dc=['rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','update','destroy','stack','name','send','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','type','VIRTUAL','options','ChatMessage','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','chat-interactions','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2e1952,_0x567598){var _0x3788eb=function(_0xebd732){while(--_0xebd732){_0x2e1952['push'](_0x2e1952['shift']());}};_0x3788eb(++_0x567598);}(_0x14dc,0x89));var _0xc14d=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x14dc[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xc14d('0x0'));var rimraf=require(_0xc14d('0x1'));var zipdir=require(_0xc14d('0x2'));var jsonpatch=require(_0xc14d('0x3'));var rp=require(_0xc14d('0x4'));var moment=require('moment');var BPromise=require(_0xc14d('0x5'));var Mustache=require(_0xc14d('0x6'));var util=require('util');var path=require(_0xc14d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc14d('0x8'));var fs=require('fs');var fs_extra=require(_0xc14d('0x9'));var _=require(_0xc14d('0xa'));var squel=require('squel');var crypto=require(_0xc14d('0xb'));var jsforce=require(_0xc14d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc14d('0xd'));var Papa=require(_0xc14d('0xe'));var Redis=require('ioredis');var authService=require(_0xc14d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc14d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc14d('0x11'))(_0xc14d('0x12'));var utils=require(_0xc14d('0x13'));var config=require(_0xc14d('0x14'));var licenseUtil=require(_0xc14d('0x15'));var db=require(_0xc14d('0x16'))['db'];config[_0xc14d('0x17')]=_['defaults'](config[_0xc14d('0x17')],{'host':_0xc14d('0x18'),'port':0x18eb});var socket=require(_0xc14d('0x19'))(new Redis(config[_0xc14d('0x17')]));require(_0xc14d('0x1a'))['register'](socket);var jayson=require(_0xc14d('0x1b'));var client=jayson['client'][_0xc14d('0x1c')]({'port':0x232c});var client9002=jayson[_0xc14d('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x441d14,_0x51d426,_0x404d4f,_0xee9cc9){return new BPromise(function(_0x58ebfe,_0x49c730){var _0x3a71ff=_0xee9cc9||client;return _0x3a71ff['request'](_0x441d14,_0x404d4f)[_0xc14d('0x1e')](function(_0x325b01){logger[_0xc14d('0x1f')](_0xc14d('0x20'),_0x51d426,_0xc14d('0x21'));logger[_0xc14d('0x22')](_0xc14d('0x23'),_0x51d426,'request\x20sent',JSON[_0xc14d('0x24')](_0x325b01));if(_0x325b01[_0xc14d('0x25')]){if(_0x325b01[_0xc14d('0x25')][_0xc14d('0x26')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x51d426,_0x325b01[_0xc14d('0x25')][_0xc14d('0x27')]);return _0x49c730(_0x325b01[_0xc14d('0x25')][_0xc14d('0x27')]);}logger['error'](_0xc14d('0x20'),_0x51d426,_0x325b01[_0xc14d('0x25')]['message']);return _0x58ebfe(_0x325b01[_0xc14d('0x25')]['message']);}else{logger[_0xc14d('0x1f')](_0xc14d('0x20'),_0x51d426,_0xc14d('0x21'));_0x58ebfe(_0x325b01[_0xc14d('0x28')][_0xc14d('0x27')]);}})['catch'](function(_0x24d4f0){logger[_0xc14d('0x25')](_0xc14d('0x20'),_0x51d426,_0x24d4f0);_0x49c730(_0x24d4f0);});});}function respondWithStatusCode(_0x5bcc7b,_0x1b5c71){_0x1b5c71=_0x1b5c71||0xcc;return function(_0x2ac1bb){if(_0x2ac1bb){return _0x5bcc7b[_0xc14d('0x29')](_0x1b5c71);}return _0x5bcc7b[_0xc14d('0x2a')](_0x1b5c71)[_0xc14d('0x2b')]();};}function respondWithResult(_0x3c8bd8,_0x2ee2be){_0x2ee2be=_0x2ee2be||0xc8;return function(_0x3691e9){if(_0x3691e9){return _0x3c8bd8['status'](_0x2ee2be)[_0xc14d('0x2c')](_0x3691e9);}};}function respondWithFilteredResult(_0x1af499,_0x11691d){return function(_0x52d21b){if(_0x52d21b){var _0x3c7e73=typeof _0x11691d['offset']===_0xc14d('0x2d')&&typeof _0x11691d[_0xc14d('0x2e')]===_0xc14d('0x2d');var _0x5c21c7=_0x52d21b[_0xc14d('0x2f')];var _0x1c615c=_0x3c7e73?0x0:_0x11691d['offset'];var _0x1c91c9=_0x3c7e73?_0x52d21b['count']:_0x11691d['offset']+_0x11691d[_0xc14d('0x2e')];var _0x21674f;if(_0x1c91c9>=_0x5c21c7){_0x1c91c9=_0x5c21c7;_0x21674f=0xc8;}else{_0x21674f=0xce;}_0x1af499[_0xc14d('0x2a')](_0x21674f);return _0x1af499[_0xc14d('0x30')](_0xc14d('0x31'),_0x1c615c+'-'+_0x1c91c9+'/'+_0x5c21c7)[_0xc14d('0x2c')](_0x52d21b);}return null;};}function patchUpdates(_0x4896ca){return function(_0x241643){try{jsonpatch[_0xc14d('0x32')](_0x241643,_0x4896ca,!![]);}catch(_0x19a90d){return BPromise['reject'](_0x19a90d);}return _0x241643['save']();};}function saveUpdates(_0x19e710,_0x554597){return function(_0x529f01){if(_0x529f01){return _0x529f01[_0xc14d('0x33')](_0x19e710)[_0xc14d('0x1e')](function(_0x42bcca){return _0x42bcca;});}return null;};}function removeEntity(_0x159caa,_0x3852aa){return function(_0x5feafc){if(_0x5feafc){return _0x5feafc[_0xc14d('0x34')]()['then'](function(){_0x159caa[_0xc14d('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4983d7,_0x13fdd5){return function(_0x2ae51f){if(!_0x2ae51f){_0x4983d7[_0xc14d('0x29')](0x194);}return _0x2ae51f;};}function handleError(_0x100de1,_0x400bfc){_0x400bfc=_0x400bfc||0x1f4;return function(_0x4f9fd2){logger[_0xc14d('0x25')](_0x4f9fd2[_0xc14d('0x35')]);if(_0x4f9fd2[_0xc14d('0x36')]){delete _0x4f9fd2['name'];}_0x100de1['status'](_0x400bfc)[_0xc14d('0x37')](_0x4f9fd2);};}exports['index']=function(_0x221d4c,_0x1754c2){var _0x5b0922={},_0x421d54={},_0x2f0d72={'count':0x0,'rows':[]};var _0x1443f1=_[_0xc14d('0x38')](db['ChatMessage'][_0xc14d('0x39')],function(_0x5a7826){return{'name':_0x5a7826['fieldName'],'type':_0x5a7826['type']['key']};});_0x421d54[_0xc14d('0x3a')]=_[_0xc14d('0x38')](_0x1443f1,'name');_0x421d54['query']=_['keys'](_0x221d4c[_0xc14d('0x3b')]);_0x421d54['filters']=_[_0xc14d('0x3c')](_0x421d54[_0xc14d('0x3a')],_0x421d54['query']);_0x5b0922['attributes']=_['intersection'](_0x421d54[_0xc14d('0x3a')],qs[_0xc14d('0x3d')](_0x221d4c[_0xc14d('0x3b')]['fields']));_0x5b0922['attributes']=_0x5b0922[_0xc14d('0x3e')][_0xc14d('0x3f')]?_0x5b0922[_0xc14d('0x3e')]:_0x421d54['model'];if(!_0x221d4c[_0xc14d('0x3b')][_0xc14d('0x40')](_0xc14d('0x41'))){_0x5b0922[_0xc14d('0x2e')]=qs[_0xc14d('0x2e')](_0x221d4c[_0xc14d('0x3b')]['limit']);_0x5b0922[_0xc14d('0x42')]=qs[_0xc14d('0x42')](_0x221d4c[_0xc14d('0x3b')][_0xc14d('0x42')]);}_0x5b0922[_0xc14d('0x43')]=qs['sort'](_0x221d4c['query'][_0xc14d('0x44')]);_0x5b0922[_0xc14d('0x45')]=qs[_0xc14d('0x46')](_['pick'](_0x221d4c['query'],_0x421d54[_0xc14d('0x46')]),_0x1443f1);if(_0x221d4c['query'][_0xc14d('0x47')]){_0x5b0922[_0xc14d('0x45')]=_[_0xc14d('0x48')](_0x5b0922[_0xc14d('0x45')],{'$or':_[_0xc14d('0x38')](_0x1443f1,function(_0x290d16){if(_0x290d16[_0xc14d('0x49')]!==_0xc14d('0x4a')){var _0x32585b={};_0x32585b[_0x290d16['name']]={'$like':'%'+_0x221d4c[_0xc14d('0x3b')]['filter']+'%'};return _0x32585b;}})});}_0x5b0922=_[_0xc14d('0x48')]({},_0x5b0922,_0x221d4c[_0xc14d('0x4b')]);var _0x423533={'where':_0x5b0922[_0xc14d('0x45')]};return db[_0xc14d('0x4c')][_0xc14d('0x2f')](_0x423533)[_0xc14d('0x1e')](function(_0x364edc){_0x2f0d72[_0xc14d('0x2f')]=_0x364edc;if(_0x221d4c['query'][_0xc14d('0x4d')]){_0x5b0922[_0xc14d('0x4e')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x5b0922);})[_0xc14d('0x1e')](function(_0x2dfb65){_0x2f0d72[_0xc14d('0x4f')]=_0x2dfb65;return _0x2f0d72;})[_0xc14d('0x1e')](respondWithFilteredResult(_0x1754c2,_0x5b0922))[_0xc14d('0x50')](handleError(_0x1754c2,null));};exports[_0xc14d('0x51')]=function(_0x3fec55,_0x146ccd){var _0x55e5f0={'raw':!![],'where':{'id':_0x3fec55[_0xc14d('0x52')]['id']}},_0x498173={};_0x498173['model']=_[_0xc14d('0x53')](db[_0xc14d('0x4c')][_0xc14d('0x39')]);_0x498173[_0xc14d('0x3b')]=_[_0xc14d('0x53')](_0x3fec55[_0xc14d('0x3b')]);_0x498173[_0xc14d('0x46')]=_[_0xc14d('0x3c')](_0x498173[_0xc14d('0x3a')],_0x498173[_0xc14d('0x3b')]);_0x55e5f0[_0xc14d('0x3e')]=_['intersection'](_0x498173[_0xc14d('0x3a')],qs['fields'](_0x3fec55['query'][_0xc14d('0x3d')]));_0x55e5f0[_0xc14d('0x3e')]=_0x55e5f0[_0xc14d('0x3e')][_0xc14d('0x3f')]?_0x55e5f0[_0xc14d('0x3e')]:_0x498173[_0xc14d('0x3a')];if(_0x3fec55[_0xc14d('0x3b')][_0xc14d('0x4d')]){_0x55e5f0[_0xc14d('0x4e')]=[{'all':!![]}];}_0x55e5f0=_['merge']({},_0x55e5f0,_0x3fec55[_0xc14d('0x4b')]);return db['ChatMessage'][_0xc14d('0x54')](_0x55e5f0)[_0xc14d('0x1e')](handleEntityNotFound(_0x146ccd,null))['then'](respondWithResult(_0x146ccd,null))['catch'](handleError(_0x146ccd,null));};exports[_0xc14d('0x55')]=function(_0x29ccad,_0x5b1810){return db[_0xc14d('0x4c')][_0xc14d('0x55')](_0x29ccad[_0xc14d('0x56')],{})['then'](respondWithResult(_0x5b1810,0xc9))[_0xc14d('0x50')](handleError(_0x5b1810,null));};exports['update']=function(_0x3b272c,_0x1cc71c){if(_0x3b272c[_0xc14d('0x56')]['id']){delete _0x3b272c[_0xc14d('0x56')]['id'];}return db[_0xc14d('0x4c')]['find']({'where':{'id':_0x3b272c[_0xc14d('0x52')]['id']}})[_0xc14d('0x1e')](handleEntityNotFound(_0x1cc71c,null))[_0xc14d('0x1e')](saveUpdates(_0x3b272c[_0xc14d('0x56')],null))['then'](respondWithResult(_0x1cc71c,null))[_0xc14d('0x50')](handleError(_0x1cc71c,null));};exports[_0xc14d('0x34')]=function(_0xab3dc,_0x34e661){return db[_0xc14d('0x4c')][_0xc14d('0x54')]({'where':{'id':_0xab3dc[_0xc14d('0x52')]['id']}})[_0xc14d('0x1e')](handleEntityNotFound(_0x34e661,null))['then'](removeEntity(_0x34e661,null))[_0xc14d('0x50')](handleError(_0x34e661,null));};exports[_0xc14d('0x57')]=function(_0x1a062b,_0x2f144f){return db['ChatMessage'][_0xc14d('0x57')]()[_0xc14d('0x1e')](respondWithResult(_0x2f144f,null))[_0xc14d('0x50')](handleError(_0x2f144f,null));};var interaction_log=require(_0xc14d('0x11'))('chat-interactions');exports[_0xc14d('0x58')]=function(_0x1967d7,_0x109599,_0x4f89b4){var _0xbe7228={'agent':{},'channel':_0xc14d('0x59')};if(_0x1967d7[_0xc14d('0x56')]['id']){delete _0x1967d7[_0xc14d('0x56')]['id'];}_0x1967d7[_0xc14d('0x56')][_0xc14d('0x5a')]=!![];_0x1967d7[_0xc14d('0x56')][_0xc14d('0x5b')]=moment()[_0xc14d('0x5c')](_0xc14d('0x5d'));_0x1967d7[_0xc14d('0x56')][_0xc14d('0x5e')]=_0x1967d7['body'][_0xc14d('0x5e')]||_0x1967d7[_0xc14d('0x5f')]['id'];_0xbe7228[_0xc14d('0x60')]['id']=_0x1967d7[_0xc14d('0x56')][_0xc14d('0x5e')];return db[_0xc14d('0x4c')]['find']({'where':{'id':_0x1967d7[_0xc14d('0x52')]['id'],'UserId':null}})[_0xc14d('0x1e')](handleEntityNotFound(_0x109599,null))['then'](saveUpdates(_0x1967d7['body'],null))[_0xc14d('0x1e')](function(_0x2303aa){if(_0x2303aa){_0xbe7228[_0xc14d('0x27')]=_0x2303aa[_0xc14d('0x61')]({'plain':!![]});return db[_0xc14d('0x62')][_0xc14d('0x54')]({'where':{'id':_0x2303aa[_0xc14d('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x109599,null))[_0xc14d('0x1e')](function(_0x352fd3){if(_0x352fd3){return _0x352fd3[_0xc14d('0x33')]({'UserId':_0x1967d7['body'][_0xc14d('0x5e')],'read1stAt':_[_0xc14d('0x64')](_0x352fd3[_0xc14d('0x65')])?moment()[_0xc14d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x545c46){if(_0x545c46){_0xbe7228[_0xc14d('0x66')]=_0x545c46[_0xc14d('0x61')]({'plain':!![]});interaction_log['info'](_0xc14d('0x67'),_0x1967d7[_0xc14d('0x5f')]['id'],_0x1967d7[_0xc14d('0x5f')][_0xc14d('0x36')],_0x1967d7[_0xc14d('0x5f')][_0xc14d('0x68')],_0xbe7228[_0xc14d('0x66')]['id'],_0x1967d7[_0xc14d('0x56')]?JSON['stringify'](_0x1967d7[_0xc14d('0x56')]):_0xc14d('0x69'));return respondWithRpcPromise('AcceptMessage',_0xc14d('0x6a'),_0xbe7228);}return null;})['then'](function(_0x5e5418){var _0x50f86f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e5418[_0xc14d('0x27')]['ContactId'];return db['sequelize'][_0xc14d('0x3b')](_0x50f86f,{'type':db[_0xc14d('0x6b')][_0xc14d('0x6c')][_0xc14d('0x6d')],'raw':!![]})[_0xc14d('0x1e')](function(_0x6999c5){return _0x6999c5;});})[_0xc14d('0x1e')](function(_0x3e4314){if(_0x3e4314){_0xbe7228[_0xc14d('0x27')][_0xc14d('0x6e')]=_0x3e4314[0x0];if(!_0x1967d7[_0xc14d('0x56')][_0xc14d('0x5e')])return;return db[_0xc14d('0x6f')][_0xc14d('0x54')]({'where':{'id':_0x1967d7[_0xc14d('0x56')][_0xc14d('0x5e')],'role':_0xc14d('0x60')},'attributes':['id',_0xc14d('0x36'),_0xc14d('0x70'),_0xc14d('0x71'),_0xc14d('0x72')],'raw':!![]});}return null;})['then'](function(_0x1787fe){if(!_0x1787fe)return null;_0xbe7228[_0xc14d('0x27')][_0xc14d('0x60')]=_0x1787fe;return _0xbe7228;})['then'](function(_0x46101e){if(_0x46101e){if(_0x1967d7[_0xc14d('0x56')][_0xc14d('0x73')]){_0xbe7228[_0xc14d('0x27')][_0xc14d('0x74')]=util[_0xc14d('0x5c')](_0xc14d('0x75'),_0x1967d7[_0xc14d('0x5f')]['name']);_0xbe7228[_0xc14d('0x27')][_0xc14d('0x76')]=_0xbe7228[_0xc14d('0x76')];_0xbe7228[_0xc14d('0x27')][_0xc14d('0x77')]=_0xbe7228[_0xc14d('0x76')];_0xbe7228[_0xc14d('0x27')]['event']=_0xc14d('0x58');return respondWithRpcPromise(_0xc14d('0x78'),_0xc14d('0x78'),{'event':_0xc14d('0x79'),'message':_[_0xc14d('0x48')](_0xbe7228[_0xc14d('0x27')],JSON[_0xc14d('0x7a')](_0xbe7228['interaction'][_0xc14d('0x7b')]))},client9002)['then'](function(){return _0xbe7228;});}return _0xbe7228;}return null;})['then'](respondWithResult(_0x109599,null))['catch'](handleError(_0x109599,null));};var interaction_log=require(_0xc14d('0x11'))(_0xc14d('0x7c'));exports[_0xc14d('0x7d')]=function(_0x1b9192,_0x4abbaf,_0x593b79){var _0x22f6c5={'agent':{},'channel':'chat'};if(_0x1b9192[_0xc14d('0x56')]['id']){delete _0x1b9192[_0xc14d('0x56')]['id'];}_0x1b9192[_0xc14d('0x56')]['UserId']=_0x1b9192[_0xc14d('0x56')][_0xc14d('0x5e')]||_0x1b9192[_0xc14d('0x5f')]['id'];_0x22f6c5[_0xc14d('0x60')]['id']=_0x1b9192[_0xc14d('0x56')][_0xc14d('0x5e')];return db[_0xc14d('0x4c')][_0xc14d('0x54')]({'where':{'id':_0x1b9192[_0xc14d('0x52')]['id'],'UserId':null}})[_0xc14d('0x1e')](handleEntityNotFound(_0x4abbaf,null))[_0xc14d('0x1e')](function(_0x18d98c){if(_0x18d98c){_0x22f6c5['message']=_0x18d98c[_0xc14d('0x61')]({'plain':!![]});return db['ChatInteraction'][_0xc14d('0x54')]({'where':{'id':_0x18d98c['ChatInteractionId']}});}return null;})[_0xc14d('0x1e')](handleEntityNotFound(_0x4abbaf,null))['then'](function(_0x21190d){if(_0x21190d){_0x22f6c5[_0xc14d('0x66')]=_0x21190d['get']({'plain':!![]});interaction_log[_0xc14d('0x1f')](_0xc14d('0x7e'),_0x1b9192['user']['id'],_0x1b9192[_0xc14d('0x5f')][_0xc14d('0x36')],_0x1b9192['user']['role'],_0x22f6c5[_0xc14d('0x66')]['id'],_0x1b9192['body']?JSON[_0xc14d('0x24')](_0x1b9192['body']):_0xc14d('0x69'));return respondWithRpcPromise('RejectMessage',_0xc14d('0x7f'),_0x22f6c5);}return null;})['then'](function(_0x2dd6ff){var _0x572e9d=_0xc14d('0x80')+_0x2dd6ff[_0xc14d('0x27')][_0xc14d('0x81')];return db[_0xc14d('0x82')][_0xc14d('0x3b')](_0x572e9d,{'type':db[_0xc14d('0x6b')][_0xc14d('0x6c')][_0xc14d('0x6d')],'raw':!![]})['then'](function(_0x2ad740){return _0x2ad740;});})[_0xc14d('0x1e')](function(_0x2892c8){if(_0x2892c8){_0x22f6c5[_0xc14d('0x27')][_0xc14d('0x6e')]=_0x2892c8[0x0];if(!_0x1b9192[_0xc14d('0x56')][_0xc14d('0x5e')])return;return db[_0xc14d('0x6f')]['find']({'where':{'id':_0x1b9192[_0xc14d('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0xc14d('0x36'),_0xc14d('0x70'),_0xc14d('0x71'),'internal'],'raw':!![]});}return null;})[_0xc14d('0x1e')](function(_0x20bd62){if(!_0x20bd62)return null;_0x22f6c5[_0xc14d('0x27')][_0xc14d('0x60')]=_0x20bd62;return _0x22f6c5;})[_0xc14d('0x1e')](function(_0x13bb2d){if(_0x13bb2d){_0x13bb2d[_0xc14d('0x27')][_0xc14d('0x74')]=util[_0xc14d('0x5c')]('SIP/%s',_0x1b9192['user']['name']);_0x13bb2d[_0xc14d('0x27')][_0xc14d('0x76')]=_0x22f6c5[_0xc14d('0x76')];_0x13bb2d['message']['motionChannel']=_0x22f6c5[_0xc14d('0x76')];_0x13bb2d[_0xc14d('0x27')][_0xc14d('0x83')]=_0xc14d('0x7d');respondWithRpcPromise(_0xc14d('0x78'),_0xc14d('0x78'),{'event':'rejectmessage','message':_[_0xc14d('0x48')](_0x22f6c5[_0xc14d('0x27')],JSON[_0xc14d('0x7a')](_0x22f6c5[_0xc14d('0x66')][_0xc14d('0x7b')]))},client9002);return _0x22f6c5;}return null;})[_0xc14d('0x1e')](respondWithResult(_0x4abbaf,null))[_0xc14d('0x50')](handleError(_0x4abbaf,null));};
\ No newline at end of file
+var _0xbbce=['./chatMessage.socket','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','create','body','update','find','describe','chat-interactions','chat','read','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xbbce,0x6e));var _0xebbc=function(_0x1c18c3,_0x36bae1){_0x1c18c3=_0x1c18c3-0x0;var _0x48e34f=_0xbbce[_0x1c18c3];return _0x48e34f;};'use strict';var emlformat=require(_0xebbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebbc('0x1'));var jsonpatch=require(_0xebbc('0x2'));var rp=require(_0xebbc('0x3'));var moment=require(_0xebbc('0x4'));var BPromise=require(_0xebbc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xebbc('0x6'));var sox=require(_0xebbc('0x7'));var csv=require(_0xebbc('0x8'));var ejs=require(_0xebbc('0x9'));var fs=require('fs');var fs_extra=require(_0xebbc('0xa'));var _=require(_0xebbc('0xb'));var squel=require(_0xebbc('0xc'));var crypto=require(_0xebbc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xebbc('0x8'));var querystring=require(_0xebbc('0xe'));var Papa=require(_0xebbc('0xf'));var Redis=require(_0xebbc('0x10'));var authService=require(_0xebbc('0x11'));var qs=require(_0xebbc('0x12'));var as=require(_0xebbc('0x13'));var hardwareService=require(_0xebbc('0x14'));var logger=require(_0xebbc('0x15'))(_0xebbc('0x16'));var utils=require(_0xebbc('0x17'));var config=require(_0xebbc('0x18'));var licenseUtil=require(_0xebbc('0x19'));var db=require(_0xebbc('0x1a'))['db'];config[_0xebbc('0x1b')]=_[_0xebbc('0x1c')](config['redis'],{'host':_0xebbc('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebbc('0x1b')]));require(_0xebbc('0x1e'))['register'](socket);var jayson=require(_0xebbc('0x1f'));var client=jayson[_0xebbc('0x20')][_0xebbc('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xebbc('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x6e4941,_0x21e781,_0x5556d9,_0x80233b){return new BPromise(function(_0x223794,_0x2e1ce7){var _0x141eab=_0x80233b||client;return _0x141eab[_0xebbc('0x22')](_0x6e4941,_0x5556d9)['then'](function(_0x5d38d7){logger['info']('ChatMessage,\x20%s,\x20%s',_0x21e781,_0xebbc('0x23'));logger[_0xebbc('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x21e781,'request\x20sent',JSON[_0xebbc('0x25')](_0x5d38d7));if(_0x5d38d7['error']){if(_0x5d38d7[_0xebbc('0x26')][_0xebbc('0x27')]===0x1f4){logger[_0xebbc('0x26')](_0xebbc('0x28'),_0x21e781,_0x5d38d7[_0xebbc('0x26')][_0xebbc('0x29')]);return _0x2e1ce7(_0x5d38d7[_0xebbc('0x26')][_0xebbc('0x29')]);}logger[_0xebbc('0x26')](_0xebbc('0x28'),_0x21e781,_0x5d38d7[_0xebbc('0x26')][_0xebbc('0x29')]);return _0x223794(_0x5d38d7['error'][_0xebbc('0x29')]);}else{logger['info'](_0xebbc('0x28'),_0x21e781,_0xebbc('0x23'));_0x223794(_0x5d38d7[_0xebbc('0x2a')]['message']);}})[_0xebbc('0x2b')](function(_0x1a6653){logger[_0xebbc('0x26')]('ChatMessage,\x20%s,\x20%s',_0x21e781,_0x1a6653);_0x2e1ce7(_0x1a6653);});});}function respondWithStatusCode(_0x213f82,_0x34a039){_0x34a039=_0x34a039||0xcc;return function(_0x5302ad){if(_0x5302ad){return _0x213f82['sendStatus'](_0x34a039);}return _0x213f82[_0xebbc('0x2c')](_0x34a039)[_0xebbc('0x2d')]();};}function respondWithResult(_0x28c5d7,_0x35ec82){_0x35ec82=_0x35ec82||0xc8;return function(_0x181da2){if(_0x181da2){return _0x28c5d7[_0xebbc('0x2c')](_0x35ec82)[_0xebbc('0x2e')](_0x181da2);}};}function respondWithFilteredResult(_0x921281,_0x21cb13){return function(_0x22a329){if(_0x22a329){var _0x882dc5=typeof _0x21cb13[_0xebbc('0x2f')]===_0xebbc('0x30')&&typeof _0x21cb13[_0xebbc('0x31')]===_0xebbc('0x30');var _0x203059=_0x22a329[_0xebbc('0x32')];var _0x8dd0bb=_0x882dc5?0x0:_0x21cb13[_0xebbc('0x2f')];var _0x16c3d0=_0x882dc5?_0x22a329[_0xebbc('0x32')]:_0x21cb13[_0xebbc('0x2f')]+_0x21cb13[_0xebbc('0x31')];var _0x1b969d;if(_0x16c3d0>=_0x203059){_0x16c3d0=_0x203059;_0x1b969d=0xc8;}else{_0x1b969d=0xce;}_0x921281[_0xebbc('0x2c')](_0x1b969d);return _0x921281[_0xebbc('0x33')]('Content-Range',_0x8dd0bb+'-'+_0x16c3d0+'/'+_0x203059)[_0xebbc('0x2e')](_0x22a329);}return null;};}function patchUpdates(_0x5ab842){return function(_0x45d95e){try{jsonpatch[_0xebbc('0x34')](_0x45d95e,_0x5ab842,!![]);}catch(_0x53d9c7){return BPromise['reject'](_0x53d9c7);}return _0x45d95e[_0xebbc('0x35')]();};}function saveUpdates(_0x5b1bc0,_0x364a27){return function(_0x348111){if(_0x348111){return _0x348111['update'](_0x5b1bc0)[_0xebbc('0x36')](function(_0x8e26e3){return _0x8e26e3;});}return null;};}function removeEntity(_0x2972f1,_0x3203d0){return function(_0x499109){if(_0x499109){return _0x499109[_0xebbc('0x37')]()['then'](function(){_0x2972f1[_0xebbc('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x154129,_0x1e223c){return function(_0x3ce08c){if(!_0x3ce08c){_0x154129[_0xebbc('0x38')](0x194);}return _0x3ce08c;};}function handleError(_0x3a5cbf,_0x2c97cc){_0x2c97cc=_0x2c97cc||0x1f4;return function(_0x1406aa){logger[_0xebbc('0x26')](_0x1406aa[_0xebbc('0x39')]);if(_0x1406aa[_0xebbc('0x3a')]){delete _0x1406aa[_0xebbc('0x3a')];}_0x3a5cbf[_0xebbc('0x2c')](_0x2c97cc)[_0xebbc('0x3b')](_0x1406aa);};}exports['index']=function(_0x3512b3,_0x129cf3){var _0x286b44={},_0x29b044={},_0x190cb6={'count':0x0,'rows':[]};var _0x3ccf17=_[_0xebbc('0x3c')](db[_0xebbc('0x3d')][_0xebbc('0x3e')],function(_0x533ac8){return{'name':_0x533ac8[_0xebbc('0x3f')],'type':_0x533ac8[_0xebbc('0x40')][_0xebbc('0x41')]};});_0x29b044[_0xebbc('0x42')]=_['map'](_0x3ccf17,_0xebbc('0x3a'));_0x29b044[_0xebbc('0x43')]=_['keys'](_0x3512b3[_0xebbc('0x43')]);_0x29b044[_0xebbc('0x44')]=_[_0xebbc('0x45')](_0x29b044['model'],_0x29b044[_0xebbc('0x43')]);_0x286b44[_0xebbc('0x46')]=_[_0xebbc('0x45')](_0x29b044[_0xebbc('0x42')],qs['fields'](_0x3512b3[_0xebbc('0x43')][_0xebbc('0x47')]));_0x286b44[_0xebbc('0x46')]=_0x286b44[_0xebbc('0x46')]['length']?_0x286b44[_0xebbc('0x46')]:_0x29b044[_0xebbc('0x42')];if(!_0x3512b3[_0xebbc('0x43')][_0xebbc('0x48')](_0xebbc('0x49'))){_0x286b44[_0xebbc('0x31')]=qs['limit'](_0x3512b3[_0xebbc('0x43')][_0xebbc('0x31')]);_0x286b44[_0xebbc('0x2f')]=qs['offset'](_0x3512b3['query'][_0xebbc('0x2f')]);}_0x286b44[_0xebbc('0x4a')]=qs[_0xebbc('0x4b')](_0x3512b3[_0xebbc('0x43')][_0xebbc('0x4b')]);_0x286b44[_0xebbc('0x4c')]=qs[_0xebbc('0x44')](_[_0xebbc('0x4d')](_0x3512b3[_0xebbc('0x43')],_0x29b044[_0xebbc('0x44')]),_0x3ccf17);if(_0x3512b3[_0xebbc('0x43')][_0xebbc('0x4e')]){_0x286b44['where']=_[_0xebbc('0x4f')](_0x286b44[_0xebbc('0x4c')],{'$or':_[_0xebbc('0x3c')](_0x3ccf17,function(_0x4d145b){if(_0x4d145b['type']!==_0xebbc('0x50')){var _0x1b29a1={};_0x1b29a1[_0x4d145b[_0xebbc('0x3a')]]={'$like':'%'+_0x3512b3[_0xebbc('0x43')]['filter']+'%'};return _0x1b29a1;}})});}_0x286b44=_[_0xebbc('0x4f')]({},_0x286b44,_0x3512b3[_0xebbc('0x51')]);var _0x1f148c={'where':_0x286b44[_0xebbc('0x4c')]};return db[_0xebbc('0x3d')][_0xebbc('0x32')](_0x1f148c)['then'](function(_0x22657d){_0x190cb6['count']=_0x22657d;if(_0x3512b3['query'][_0xebbc('0x52')]){_0x286b44[_0xebbc('0x53')]=[{'all':!![]}];}return db['ChatMessage'][_0xebbc('0x54')](_0x286b44);})[_0xebbc('0x36')](function(_0xc2eb50){_0x190cb6[_0xebbc('0x55')]=_0xc2eb50;return _0x190cb6;})['then'](respondWithFilteredResult(_0x129cf3,_0x286b44))[_0xebbc('0x2b')](handleError(_0x129cf3,null));};exports[_0xebbc('0x56')]=function(_0x1a2261,_0x39f02e){var _0x318bd4={'raw':!![],'where':{'id':_0x1a2261[_0xebbc('0x57')]['id']}},_0x177d30={};_0x177d30['model']=_[_0xebbc('0x58')](db['ChatMessage']['rawAttributes']);_0x177d30[_0xebbc('0x43')]=_[_0xebbc('0x58')](_0x1a2261[_0xebbc('0x43')]);_0x177d30[_0xebbc('0x44')]=_[_0xebbc('0x45')](_0x177d30[_0xebbc('0x42')],_0x177d30[_0xebbc('0x43')]);_0x318bd4[_0xebbc('0x46')]=_['intersection'](_0x177d30[_0xebbc('0x42')],qs['fields'](_0x1a2261[_0xebbc('0x43')]['fields']));_0x318bd4[_0xebbc('0x46')]=_0x318bd4[_0xebbc('0x46')][_0xebbc('0x59')]?_0x318bd4[_0xebbc('0x46')]:_0x177d30[_0xebbc('0x42')];if(_0x1a2261[_0xebbc('0x43')][_0xebbc('0x52')]){_0x318bd4['include']=[{'all':!![]}];}_0x318bd4=_['merge']({},_0x318bd4,_0x1a2261[_0xebbc('0x51')]);return db[_0xebbc('0x3d')]['find'](_0x318bd4)[_0xebbc('0x36')](handleEntityNotFound(_0x39f02e,null))[_0xebbc('0x36')](respondWithResult(_0x39f02e,null))[_0xebbc('0x2b')](handleError(_0x39f02e,null));};exports[_0xebbc('0x5a')]=function(_0x104c86,_0x3e605b){return db[_0xebbc('0x3d')][_0xebbc('0x5a')](_0x104c86[_0xebbc('0x5b')],{})['then'](respondWithResult(_0x3e605b,0xc9))['catch'](handleError(_0x3e605b,null));};exports[_0xebbc('0x5c')]=function(_0x14ff7f,_0x327df3){if(_0x14ff7f['body']['id']){delete _0x14ff7f[_0xebbc('0x5b')]['id'];}return db[_0xebbc('0x3d')][_0xebbc('0x5d')]({'where':{'id':_0x14ff7f['params']['id']}})['then'](handleEntityNotFound(_0x327df3,null))[_0xebbc('0x36')](saveUpdates(_0x14ff7f['body'],null))[_0xebbc('0x36')](respondWithResult(_0x327df3,null))['catch'](handleError(_0x327df3,null));};exports[_0xebbc('0x37')]=function(_0x2615a8,_0x575dc2){return db[_0xebbc('0x3d')][_0xebbc('0x5d')]({'where':{'id':_0x2615a8['params']['id']}})[_0xebbc('0x36')](handleEntityNotFound(_0x575dc2,null))[_0xebbc('0x36')](removeEntity(_0x575dc2,null))[_0xebbc('0x2b')](handleError(_0x575dc2,null));};exports[_0xebbc('0x5e')]=function(_0x80597b,_0x23450e){return db[_0xebbc('0x3d')][_0xebbc('0x5e')]()[_0xebbc('0x36')](respondWithResult(_0x23450e,null))[_0xebbc('0x2b')](handleError(_0x23450e,null));};var interaction_log=require(_0xebbc('0x15'))(_0xebbc('0x5f'));exports['accept']=function(_0xc991d4,_0x3f69a0,_0x360d6c){var _0x354739={'agent':{},'channel':_0xebbc('0x60')};if(_0xc991d4[_0xebbc('0x5b')]['id']){delete _0xc991d4[_0xebbc('0x5b')]['id'];}_0xc991d4[_0xebbc('0x5b')][_0xebbc('0x61')]=!![];_0xc991d4[_0xebbc('0x5b')]['readAt']=moment()[_0xebbc('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0xc991d4[_0xebbc('0x5b')]['UserId']=_0xc991d4[_0xebbc('0x5b')][_0xebbc('0x63')]||_0xc991d4[_0xebbc('0x64')]['id'];_0x354739[_0xebbc('0x65')]['id']=_0xc991d4[_0xebbc('0x5b')][_0xebbc('0x63')];return db[_0xebbc('0x3d')][_0xebbc('0x5d')]({'where':{'id':_0xc991d4['params']['id'],'UserId':null}})[_0xebbc('0x36')](handleEntityNotFound(_0x3f69a0,null))['then'](saveUpdates(_0xc991d4[_0xebbc('0x5b')],null))['then'](function(_0x3c1cda){if(_0x3c1cda){_0x354739['message']=_0x3c1cda[_0xebbc('0x66')]({'plain':!![]});return db[_0xebbc('0x67')][_0xebbc('0x5d')]({'where':{'id':_0x3c1cda[_0xebbc('0x68')]}});}return null;})[_0xebbc('0x36')](handleEntityNotFound(_0x3f69a0,null))[_0xebbc('0x36')](function(_0x42d61e){if(_0x42d61e){return _0x42d61e[_0xebbc('0x5c')]({'UserId':_0xc991d4['body']['UserId'],'read1stAt':_[_0xebbc('0x69')](_0x42d61e[_0xebbc('0x6a')])?moment()['format'](_0xebbc('0x6b')):undefined});}return null;})[_0xebbc('0x36')](function(_0x3f821a){if(_0x3f821a){_0x354739[_0xebbc('0x6c')]=_0x3f821a[_0xebbc('0x66')]({'plain':!![]});interaction_log[_0xebbc('0x6d')](_0xebbc('0x6e'),_0xc991d4[_0xebbc('0x64')]['id'],_0xc991d4[_0xebbc('0x64')][_0xebbc('0x3a')],_0xc991d4[_0xebbc('0x64')][_0xebbc('0x6f')],_0x354739[_0xebbc('0x6c')]['id'],_0xc991d4[_0xebbc('0x5b')]?JSON[_0xebbc('0x25')](_0xc991d4[_0xebbc('0x5b')]):'null');return respondWithRpcPromise(_0xebbc('0x70'),_0xebbc('0x71'),_0x354739);}return null;})[_0xebbc('0x36')](function(_0x565d42){var _0x445c63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x565d42[_0xebbc('0x29')][_0xebbc('0x72')];return db['sequelize'][_0xebbc('0x43')](_0x445c63,{'type':db[_0xebbc('0x73')][_0xebbc('0x74')][_0xebbc('0x75')],'raw':!![]})['then'](function(_0xfbd39f){return _0xfbd39f;});})['then'](function(_0x1ab88b){if(_0x1ab88b){_0x354739[_0xebbc('0x29')]['contact']=_0x1ab88b[0x0];if(!_0xc991d4[_0xebbc('0x5b')][_0xebbc('0x63')])return;return db[_0xebbc('0x76')][_0xebbc('0x5d')]({'where':{'id':_0xc991d4[_0xebbc('0x5b')]['UserId'],'role':_0xebbc('0x65')},'attributes':['id',_0xebbc('0x3a'),_0xebbc('0x77'),_0xebbc('0x78'),_0xebbc('0x79')],'raw':!![]});}return null;})[_0xebbc('0x36')](function(_0x3c9798){if(!_0x3c9798)return null;_0x354739[_0xebbc('0x29')][_0xebbc('0x65')]=_0x3c9798;return _0x354739;})['then'](function(_0x7db70f){if(_0x7db70f){if(_0xc991d4['body'][_0xebbc('0x7a')]){_0x354739[_0xebbc('0x29')]['interface']=util[_0xebbc('0x62')](_0xebbc('0x7b'),_0xc991d4[_0xebbc('0x64')]['name']);_0x354739[_0xebbc('0x29')][_0xebbc('0x7c')]=_0x354739[_0xebbc('0x7c')];_0x354739['message'][_0xebbc('0x7d')]=_0x354739[_0xebbc('0x7c')];_0x354739[_0xebbc('0x29')][_0xebbc('0x7e')]=_0xebbc('0x7f');return respondWithRpcPromise(_0xebbc('0x80'),'EventManager',{'event':_0xebbc('0x81'),'message':_[_0xebbc('0x4f')](_0x354739[_0xebbc('0x29')],JSON[_0xebbc('0x82')](_0x354739['interaction'][_0xebbc('0x83')]))},client9002)['then'](function(){return _0x354739;});}return _0x354739;}return null;})[_0xebbc('0x36')](respondWithResult(_0x3f69a0,null))[_0xebbc('0x2b')](handleError(_0x3f69a0,null));};var interaction_log=require(_0xebbc('0x15'))('chat-interactions');exports[_0xebbc('0x84')]=function(_0x4d3eb2,_0x4ceefd,_0x2da13a){var _0x466c35={'agent':{},'channel':_0xebbc('0x60')};if(_0x4d3eb2['body']['id']){delete _0x4d3eb2[_0xebbc('0x5b')]['id'];}_0x4d3eb2[_0xebbc('0x5b')][_0xebbc('0x63')]=_0x4d3eb2[_0xebbc('0x5b')][_0xebbc('0x63')]||_0x4d3eb2[_0xebbc('0x64')]['id'];_0x466c35[_0xebbc('0x65')]['id']=_0x4d3eb2[_0xebbc('0x5b')]['UserId'];return db[_0xebbc('0x3d')]['find']({'where':{'id':_0x4d3eb2[_0xebbc('0x57')]['id'],'UserId':null}})[_0xebbc('0x36')](handleEntityNotFound(_0x4ceefd,null))['then'](function(_0x54cd07){if(_0x54cd07){_0x466c35['message']=_0x54cd07[_0xebbc('0x66')]({'plain':!![]});return db['ChatInteraction'][_0xebbc('0x5d')]({'where':{'id':_0x54cd07[_0xebbc('0x68')]}});}return null;})[_0xebbc('0x36')](handleEntityNotFound(_0x4ceefd,null))[_0xebbc('0x36')](function(_0x5465e7){if(_0x5465e7){_0x466c35['interaction']=_0x5465e7[_0xebbc('0x66')]({'plain':!![]});interaction_log[_0xebbc('0x6d')](_0xebbc('0x85'),_0x4d3eb2[_0xebbc('0x64')]['id'],_0x4d3eb2[_0xebbc('0x64')][_0xebbc('0x3a')],_0x4d3eb2[_0xebbc('0x64')][_0xebbc('0x6f')],_0x466c35[_0xebbc('0x6c')]['id'],_0x4d3eb2[_0xebbc('0x5b')]?JSON[_0xebbc('0x25')](_0x4d3eb2[_0xebbc('0x5b')]):'null');return respondWithRpcPromise(_0xebbc('0x86'),_0xebbc('0x87'),_0x466c35);}return null;})[_0xebbc('0x36')](function(_0x1d2ec4){var _0x47aad4=_0xebbc('0x88')+_0x1d2ec4[_0xebbc('0x29')]['ContactId'];return db[_0xebbc('0x89')]['query'](_0x47aad4,{'type':db[_0xebbc('0x73')][_0xebbc('0x74')][_0xebbc('0x75')],'raw':!![]})[_0xebbc('0x36')](function(_0x3ff6a6){return _0x3ff6a6;});})[_0xebbc('0x36')](function(_0x434dcc){if(_0x434dcc){_0x466c35[_0xebbc('0x29')][_0xebbc('0x8a')]=_0x434dcc[0x0];if(!_0x4d3eb2[_0xebbc('0x5b')][_0xebbc('0x63')])return;return db[_0xebbc('0x76')][_0xebbc('0x5d')]({'where':{'id':_0x4d3eb2[_0xebbc('0x5b')][_0xebbc('0x63')],'role':_0xebbc('0x65')},'attributes':['id',_0xebbc('0x3a'),'fullname',_0xebbc('0x78'),_0xebbc('0x79')],'raw':!![]});}return null;})[_0xebbc('0x36')](function(_0x13dfc6){if(!_0x13dfc6)return null;_0x466c35[_0xebbc('0x29')]['agent']=_0x13dfc6;return _0x466c35;})[_0xebbc('0x36')](function(_0x329e87){if(_0x329e87){_0x329e87[_0xebbc('0x29')]['interface']=util[_0xebbc('0x62')]('SIP/%s',_0x4d3eb2[_0xebbc('0x64')][_0xebbc('0x3a')]);_0x329e87[_0xebbc('0x29')][_0xebbc('0x7c')]=_0x466c35[_0xebbc('0x7c')];_0x329e87[_0xebbc('0x29')][_0xebbc('0x7d')]=_0x466c35['channel'];_0x329e87[_0xebbc('0x29')][_0xebbc('0x7e')]=_0xebbc('0x84');respondWithRpcPromise(_0xebbc('0x80'),_0xebbc('0x80'),{'event':_0xebbc('0x8b'),'message':_['merge'](_0x466c35[_0xebbc('0x29')],JSON[_0xebbc('0x82')](_0x466c35[_0xebbc('0x6c')][_0xebbc('0x83')]))},client9002);return _0x466c35;}return null;})['then'](respondWithResult(_0x4ceefd,null))[_0xebbc('0x2b')](handleError(_0x4ceefd,null));};
\ No newline at end of file
index 3e59a27..1246e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfca4=['../../mysqldb','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0xa20971,_0x42064b){var _0x2e35b4=function(_0x2a43e4){while(--_0x2a43e4){_0xa20971['push'](_0xa20971['shift']());}};_0x2e35b4(++_0x42064b);}(_0xfca4,0x77));var _0x4fca=function(_0x30355a,_0x1c691a){_0x30355a=_0x30355a-0x0;var _0x35d744=_0xfca4[_0x30355a];return _0x35d744;};'use strict';var EventEmitter=require(_0x4fca('0x0'));var ChatMessage=require(_0x4fca('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x4fca('0x2')](0x0);var events={'afterCreate':_0x4fca('0x3'),'afterUpdate':_0x4fca('0x4'),'afterDestroy':_0x4fca('0x5')};function emitEvent(_0x3bd19f){return function(_0x180a8f,_0x116e03,_0x2807cc){ChatMessageEvents[_0x4fca('0x6')](_0x3bd19f+':'+_0x180a8f['id'],_0x180a8f);ChatMessageEvents[_0x4fca('0x6')](_0x3bd19f,_0x180a8f);_0x2807cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x4fca('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x75d5=['remove','emit','hasOwnProperty','hook','exports','setMaxListeners','save'];(function(_0x1ca9c5,_0x1beb6e){var _0x59ea70=function(_0x31cc02){while(--_0x31cc02){_0x1ca9c5['push'](_0x1ca9c5['shift']());}};_0x59ea70(++_0x1beb6e);}(_0x75d5,0x7c));var _0x575d=function(_0x52dced,_0x5c90dd){_0x52dced=_0x52dced-0x0;var _0x4fae7c=_0x75d5[_0x52dced];return _0x4fae7c;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x575d('0x0')](0x0);var events={'afterCreate':_0x575d('0x1'),'afterUpdate':'update','afterDestroy':_0x575d('0x2')};function emitEvent(_0x208293){return function(_0x46e0aa,_0x2625dd,_0x538985){ChatMessageEvents[_0x575d('0x3')](_0x208293+':'+_0x46e0aa['id'],_0x46e0aa);ChatMessageEvents[_0x575d('0x3')](_0x208293,_0x46e0aa);_0x538985(null);};}for(var e in events){if(events[_0x575d('0x4')](e)){var event=events[e];ChatMessage[_0x575d('0x5')](e,emitEvent(event));}}module[_0x575d('0x6')]=ChatMessageEvents;
\ No newline at end of file
index 64518b9..7a80158 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a6c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3c6a0d,_0x4e3a18){var _0x5d8888=function(_0xf243cb){while(--_0xf243cb){_0x3c6a0d['push'](_0x3c6a0d['shift']());}};_0x5d8888(++_0x4e3a18);}(_0x8a6c,0x7f));var _0xc8a6=function(_0x108016,_0x32a74a){_0x108016=_0x108016-0x0;var _0xa4a24f=_0x8a6c[_0x108016];return _0xa4a24f;};'use strict';var _=require(_0xc8a6('0x0'));var util=require(_0xc8a6('0x1'));var logger=require(_0xc8a6('0x2'))(_0xc8a6('0x3'));var moment=require(_0xc8a6('0x4'));var BPromise=require(_0xc8a6('0x5'));var rp=require(_0xc8a6('0x6'));var fs=require('fs');var path=require(_0xc8a6('0x7'));var rimraf=require(_0xc8a6('0x8'));var config=require('../../config/environment');var attributes=require(_0xc8a6('0x9'));module['exports']=function(_0x4e73e8,_0x41e39e){return _0x4e73e8[_0xc8a6('0xa')](_0xc8a6('0xb'),attributes,{'tableName':_0xc8a6('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xc8a6('0xd')],'type':_0xc8a6('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38f815,_0x1b2de2,_0x2f392b){var _0x117c85=_0x4e73e8[_0xc8a6('0xf')];var _0x4cd0ee=_0x38f815[_0xc8a6('0x10')]({'plain':!![]});if(_0x4cd0ee[_0xc8a6('0x11')]['toLowerCase']()==='in'||_0x4cd0ee[_0xc8a6('0x11')][_0xc8a6('0x12')]()===_0xc8a6('0x13')&&!_0x4cd0ee[_0xc8a6('0x14')]&&!_[_0xc8a6('0x15')](_0x4cd0ee[_0xc8a6('0x16')])){_0x117c85[_0xc8a6('0x17')][_0xc8a6('0x18')]({'where':{'id':_0x4cd0ee[_0xc8a6('0x19')]}})[_0xc8a6('0x1a')](function(_0x398613){if(_0x398613){_0x398613[_0xc8a6('0x1b')]({'lastMsgAt':_0x4cd0ee[_0xc8a6('0x1c')],'lastMsgDirection':_0x4cd0ee['direction']['toLowerCase']()});}})['catch'](function(_0x5f0ded){console[_0xc8a6('0x1d')](_0x5f0ded);});}_0x2f392b();}},'charset':_0xc8a6('0x1e'),'collate':_0xc8a6('0x1f')});};
\ No newline at end of file
+var _0x1429=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','UserId','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1429,0x1d9));var _0x9142=function(_0x4554f9,_0xe56c6f){_0x4554f9=_0x4554f9-0x0;var _0x11394a=_0x1429[_0x4554f9];return _0x11394a;};'use strict';var _=require(_0x9142('0x0'));var util=require(_0x9142('0x1'));var logger=require(_0x9142('0x2'))(_0x9142('0x3'));var moment=require(_0x9142('0x4'));var BPromise=require(_0x9142('0x5'));var rp=require(_0x9142('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9142('0x7'));var config=require(_0x9142('0x8'));var attributes=require(_0x9142('0x9'));module[_0x9142('0xa')]=function(_0x324675,_0x370c18){return _0x324675[_0x9142('0xb')](_0x9142('0xc'),attributes,{'tableName':_0x9142('0xd'),'paranoid':![],'indexes':[{'name':_0x9142('0xe'),'fields':[_0x9142('0xf')],'type':_0x9142('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x114a72,_0x58dd6e,_0x18e08d){var _0x14f49e=_0x324675['models'];var _0x4032a7=_0x114a72[_0x9142('0x11')]({'plain':!![]});if(_0x4032a7[_0x9142('0x12')][_0x9142('0x13')]()==='in'||_0x4032a7[_0x9142('0x12')][_0x9142('0x13')]()==='out'&&!_0x4032a7['secret']&&!_['isNil'](_0x4032a7[_0x9142('0x14')])){_0x14f49e['ChatInteraction'][_0x9142('0x15')]({'where':{'id':_0x4032a7[_0x9142('0x16')]}})['then'](function(_0x2d0926){if(_0x2d0926){_0x2d0926[_0x9142('0x17')]({'lastMsgAt':_0x4032a7[_0x9142('0x18')],'lastMsgDirection':_0x4032a7[_0x9142('0x12')][_0x9142('0x13')]()});}})[_0x9142('0x19')](function(_0x22235e){console[_0x9142('0x1a')](_0x22235e);});}_0x18e08d();}},'charset':'utf8mb4','collate':_0x9142('0x1b')});};
\ No newline at end of file
index 72c43ee..5c4a01a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5951=['redis','./chatMessage.socket','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x206f4b,_0x346117){var _0x20599c=function(_0x2f15b3){while(--_0x2f15b3){_0x206f4b['push'](_0x206f4b['shift']());}};_0x20599c(++_0x346117);}(_0x5951,0x17d));var _0x1595=function(_0x5ce6f7,_0x3d6e04){_0x5ce6f7=_0x5ce6f7-0x0;var _0x48d811=_0x5951[_0x5ce6f7];return _0x48d811;};'use strict';var _=require(_0x1595('0x0'));var util=require(_0x1595('0x1'));var moment=require(_0x1595('0x2'));var BPromise=require(_0x1595('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1595('0x4'));var db=require(_0x1595('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1595('0x6'))(_0x1595('0x7'));var config=require(_0x1595('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x1595('0x9')]=_['defaults'](config[_0x1595('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1595('0x9')]));require(_0x1595('0xa'))[_0x1595('0xb')](socket);function respondWithRpcPromise(_0x1b9852,_0x569803,_0x2a7d1f){return new BPromise(function(_0x9f66c5,_0xee7b63){return client[_0x1595('0xc')](_0x1b9852,_0x2a7d1f)[_0x1595('0xd')](function(_0x4ceb7d){logger[_0x1595('0xe')]('ChatMessage,\x20%s,\x20%s',_0x569803,'request\x20sent');logger[_0x1595('0xf')](_0x1595('0x10'),_0x569803,_0x1595('0x11'),JSON['stringify'](_0x4ceb7d));if(_0x4ceb7d[_0x1595('0x12')]){if(_0x4ceb7d[_0x1595('0x12')][_0x1595('0x13')]===0x1f4){logger[_0x1595('0x12')](_0x1595('0x14'),_0x569803,_0x4ceb7d[_0x1595('0x12')][_0x1595('0x15')]);return _0xee7b63(_0x4ceb7d[_0x1595('0x12')][_0x1595('0x15')]);}logger[_0x1595('0x12')](_0x1595('0x14'),_0x569803,_0x4ceb7d['error'][_0x1595('0x15')]);return _0x9f66c5(_0x4ceb7d[_0x1595('0x12')][_0x1595('0x15')]);}else{logger[_0x1595('0xe')](_0x1595('0x14'),_0x569803,_0x1595('0x11'));_0x9f66c5(_0x4ceb7d[_0x1595('0x16')][_0x1595('0x15')]);}})[_0x1595('0x17')](function(_0x555b6f){logger[_0x1595('0x12')]('ChatMessage,\x20%s,\x20%s',_0x569803,_0x555b6f);_0xee7b63(_0x555b6f);});});}exports[_0x1595('0x18')]=function(_0x218f0e){var _0x2a4bde=this;return new Promise(function(_0x981a7b,_0x2c3034){return db[_0x1595('0x19')][_0x1595('0x1a')](_0x218f0e[_0x1595('0x1b')],{'raw':_0x218f0e[_0x1595('0x1c')]?_0x218f0e[_0x1595('0x1c')][_0x1595('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x42e1f4){logger['info'](_0x1595('0x18'),_0x218f0e);logger[_0x1595('0xf')]('CreateChatMessage',_0x218f0e,JSON['stringify'](_0x42e1f4));_0x981a7b(_0x42e1f4);})['catch'](function(_0x5d28b2){logger[_0x1595('0x12')]('CreateChatMessage',_0x5d28b2[_0x1595('0x15')],_0x218f0e);_0x2c3034(_0x2a4bde['error'](0x1f4,_0x5d28b2[_0x1595('0x15')]));});});};
\ No newline at end of file
+var _0x13c8=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateChatMessage','ChatMessage','options','raw'];(function(_0x59e487,_0x27e007){var _0x2b6a94=function(_0x2cea7b){while(--_0x2cea7b){_0x59e487['push'](_0x59e487['shift']());}};_0x2b6a94(++_0x27e007);}(_0x13c8,0xa0));var _0x813c=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x13c8[_0x3817a9];return _0x443f30;};'use strict';var _=require(_0x813c('0x0'));var util=require(_0x813c('0x1'));var moment=require(_0x813c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x813c('0x3'));var db=require(_0x813c('0x4'))['db'];var utils=require(_0x813c('0x5'));var logger=require(_0x813c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x813c('0x7'));var client=jayson[_0x813c('0x8')][_0x813c('0x9')]({'port':0x232a});config[_0x813c('0xa')]=_[_0x813c('0xb')](config[_0x813c('0xa')],{'host':_0x813c('0xc'),'port':0x18eb});var socket=require(_0x813c('0xd'))(new Redis(config[_0x813c('0xa')]));require(_0x813c('0xe'))[_0x813c('0xf')](socket);function respondWithRpcPromise(_0x512ffb,_0x12bfa9,_0xf937cd){return new BPromise(function(_0xb5271e,_0x1d77ee){return client[_0x813c('0x10')](_0x512ffb,_0xf937cd)[_0x813c('0x11')](function(_0x4f1432){logger[_0x813c('0x12')](_0x813c('0x13'),_0x12bfa9,_0x813c('0x14'));logger[_0x813c('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x12bfa9,_0x813c('0x14'),JSON[_0x813c('0x16')](_0x4f1432));if(_0x4f1432['error']){if(_0x4f1432['error'][_0x813c('0x17')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x12bfa9,_0x4f1432[_0x813c('0x18')][_0x813c('0x19')]);return _0x1d77ee(_0x4f1432[_0x813c('0x18')]['message']);}logger['error'](_0x813c('0x13'),_0x12bfa9,_0x4f1432[_0x813c('0x18')][_0x813c('0x19')]);return _0xb5271e(_0x4f1432[_0x813c('0x18')][_0x813c('0x19')]);}else{logger['info'](_0x813c('0x13'),_0x12bfa9,_0x813c('0x14'));_0xb5271e(_0x4f1432[_0x813c('0x1a')]['message']);}})[_0x813c('0x1b')](function(_0x34ada9){logger[_0x813c('0x18')](_0x813c('0x13'),_0x12bfa9,_0x34ada9);_0x1d77ee(_0x34ada9);});});}exports[_0x813c('0x1c')]=function(_0x5e35c3){var _0x4000bc=this;return new Promise(function(_0xcab62c,_0x2ce68d){return db[_0x813c('0x1d')]['create'](_0x5e35c3['body'],{'raw':_0x5e35c3[_0x813c('0x1e')]?_0x5e35c3[_0x813c('0x1e')][_0x813c('0x1f')]===undefined?!![]:![]:!![]})[_0x813c('0x11')](function(_0x5b31c2){logger['info']('CreateChatMessage',_0x5e35c3);logger[_0x813c('0x15')](_0x813c('0x1c'),_0x5e35c3,JSON[_0x813c('0x16')](_0x5b31c2));_0xcab62c(_0x5b31c2);})[_0x813c('0x1b')](function(_0x4bc362){logger[_0x813c('0x18')]('CreateChatMessage',_0x4bc362['message'],_0x5e35c3);_0x2ce68d(_0x4000bc['error'](0x1f4,_0x4bc362['message']));});});};
\ No newline at end of file
index 4cb126c..4e546b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['length','chatMessage:','./chatMessage.events','save','remove','update','removeListener','register'];(function(_0x5cfed5,_0x5f14d7){var _0x4035e4=function(_0x531996){while(--_0x531996){_0x5cfed5['push'](_0x5cfed5['shift']());}};_0x4035e4(++_0x5f14d7);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5666fd,_0x44c879){_0x5666fd=_0x5666fd-0x0;var _0x4eba01=_0x8ef6[_0x5666fd];return _0x4eba01;};'use strict';var ChatMessageEvents=require(_0x68ef('0x0'));var events=[_0x68ef('0x1'),_0x68ef('0x2'),_0x68ef('0x3')];function createListener(_0x2cc97b,_0x44e0d3){return function(_0x3411a2){_0x44e0d3['emit'](_0x2cc97b,_0x3411a2);};}function removeListener(_0x27d0af,_0x129ce){return function(){ChatMessageEvents[_0x68ef('0x4')](_0x27d0af,_0x129ce);};}exports[_0x68ef('0x5')]=function(_0x4d26e3){for(var _0x4f77f3=0x0,_0x3c2ff3=events[_0x68ef('0x6')];_0x4f77f3<_0x3c2ff3;_0x4f77f3++){var _0x2de776=events[_0x4f77f3];var _0x4eb5eb=createListener(_0x68ef('0x7')+_0x2de776,_0x4d26e3);ChatMessageEvents['on'](_0x2de776,_0x4eb5eb);}};
\ No newline at end of file
+var _0x938d=['./chatMessage.events','save','update','removeListener','length'];(function(_0x1d4760,_0x5a58e7){var _0x233074=function(_0x5846fb){while(--_0x5846fb){_0x1d4760['push'](_0x1d4760['shift']());}};_0x233074(++_0x5a58e7);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xd938('0x0'));var events=[_0xd938('0x1'),'remove',_0xd938('0x2')];function createListener(_0x29cf5f,_0x221132){return function(_0x5349c7){_0x221132['emit'](_0x29cf5f,_0x5349c7);};}function removeListener(_0xc9f24b,_0x429911){return function(){ChatMessageEvents[_0xd938('0x3')](_0xc9f24b,_0x429911);};}exports['register']=function(_0x3a81d2){for(var _0xb5e113=0x0,_0x1ed46b=events[_0xd938('0x4')];_0xb5e113<_0x1ed46b;_0xb5e113++){var _0x678164=events[_0xb5e113];var _0x419e0b=createListener('chatMessage:'+_0x678164,_0x3a81d2);ChatMessageEvents['on'](_0x678164,_0x419e0b);}};
\ No newline at end of file
index 4d1ddd0..03a339f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7d8=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','create','update','/:id/accept','accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf59389,_0x36dbc2){var _0x5ec992=function(_0xa44101){while(--_0xa44101){_0xf59389['push'](_0xf59389['shift']());}};_0x5ec992(++_0x36dbc2);}(_0xd7d8,0x15f));var _0x8d7d=function(_0x118d25,_0x59aac1){_0x118d25=_0x118d25-0x0;var _0x490944=_0xd7d8[_0x118d25];return _0x490944;};'use strict';var multer=require(_0x8d7d('0x0'));var util=require(_0x8d7d('0x1'));var path=require(_0x8d7d('0x2'));var timeout=require(_0x8d7d('0x3'));var express=require('express');var router=express[_0x8d7d('0x4')]();var fs_extra=require(_0x8d7d('0x5'));var auth=require(_0x8d7d('0x6'));var interaction=require(_0x8d7d('0x7'));var config=require(_0x8d7d('0x8'));var controller=require('./chatMessage.controller');router[_0x8d7d('0x9')]('/',auth[_0x8d7d('0xa')](),controller[_0x8d7d('0xb')]);router[_0x8d7d('0x9')](_0x8d7d('0xc'),auth[_0x8d7d('0xa')](),controller[_0x8d7d('0xd')]);router[_0x8d7d('0x9')](_0x8d7d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x8d7d('0xf')]('/',auth[_0x8d7d('0xa')](),interaction[_0x8d7d('0x10')]('chat','chatmessage:create'),controller[_0x8d7d('0x11')]);router['put'](_0x8d7d('0xe'),controller[_0x8d7d('0x12')]);router['put'](_0x8d7d('0x13'),auth[_0x8d7d('0xa')](),controller[_0x8d7d('0x14')]);router['put'](_0x8d7d('0x15'),auth[_0x8d7d('0xa')](),controller[_0x8d7d('0x16')]);router['delete'](_0x8d7d('0xe'),auth[_0x8d7d('0xa')](),controller['destroy']);module[_0x8d7d('0x17')]=router;
\ No newline at end of file
+var _0xce93=['tracked','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x48cc40,_0x169541){var _0x24e518=function(_0x12de37){while(--_0x12de37){_0x48cc40['push'](_0x48cc40['shift']());}};_0x24e518(++_0x169541);}(_0xce93,0x94));var _0x3ce9=function(_0x355adc,_0xac51ab){_0x355adc=_0x355adc-0x0;var _0x4df04f=_0xce93[_0x355adc];return _0x4df04f;};'use strict';var multer=require('multer');var util=require(_0x3ce9('0x0'));var path=require(_0x3ce9('0x1'));var timeout=require(_0x3ce9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3ce9('0x3'));var auth=require(_0x3ce9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3ce9('0x5'));var controller=require('./chatMessage.controller');router[_0x3ce9('0x6')]('/',auth[_0x3ce9('0x7')](),controller[_0x3ce9('0x8')]);router[_0x3ce9('0x6')]('/describe',auth[_0x3ce9('0x7')](),controller[_0x3ce9('0x9')]);router[_0x3ce9('0x6')](_0x3ce9('0xa'),auth[_0x3ce9('0x7')](),controller[_0x3ce9('0xb')]);router[_0x3ce9('0xc')]('/',auth[_0x3ce9('0x7')](),interaction[_0x3ce9('0xd')]('chat',_0x3ce9('0xe')),controller[_0x3ce9('0xf')]);router['put'](_0x3ce9('0xa'),controller['update']);router[_0x3ce9('0x10')](_0x3ce9('0x11'),auth['isAuthenticated'](),controller[_0x3ce9('0x12')]);router[_0x3ce9('0x10')](_0x3ce9('0x13'),auth[_0x3ce9('0x7')](),controller[_0x3ce9('0x14')]);router[_0x3ce9('0x15')](_0x3ce9('0xa'),auth[_0x3ce9('0x7')](),controller[_0x3ce9('0x16')]);module['exports']=router;
\ No newline at end of file
index bfc6781..c816b4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['medium','TEXT','exports'];(function(_0x13f159,_0x3d7e8f){var _0x141ebe=function(_0x20c565){while(--_0x20c565){_0x13f159['push'](_0x13f159['shift']());}};_0x141ebe(++_0x3d7e8f);}(_0xadb5,0xad));var _0x5adb=function(_0x5f2c31,_0x29896c){_0x5f2c31=_0x5f2c31-0x0;var _0xb19464=_0xadb5[_0x5f2c31];return _0xb19464;};'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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x182d7b,_0x2a24ef){var _0x25b102=function(_0x24a8f6){while(--_0x24a8f6){_0x182d7b['push'](_0x182d7b['shift']());}};_0x25b102(++_0x2a24ef);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d2097,_0x245566){_0x1d2097=_0x1d2097-0x0;var _0x54cc47=_0x5f2f[_0x1d2097];return _0x54cc47;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
index 50327aa..b44c597 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(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x430095,_0x5e2474){_0x430095=_0x430095-0x0;var _0x41f1a7=_0x7a54[_0x430095];return _0x41f1a7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1d7d22,_0x5914e2){var _0x143fb4=function(_0x317fab){while(--_0x317fab){_0x1d7d22['push'](_0x1d7d22['shift']());}};_0x143fb4(++_0x5914e2);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
index 68c3d21..4d40d78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6ba=['hook','exports','../../mysqldb','ChatOfflineMessage','save','update','remove','emit'];(function(_0x1c36e3,_0x3dec1f){var _0x2a5da0=function(_0x58a6c7){while(--_0x58a6c7){_0x1c36e3['push'](_0x1c36e3['shift']());}};_0x2a5da0(++_0x3dec1f);}(_0xe6ba,0x122));var _0xae6b=function(_0x5e2a67,_0x48aee3){_0x5e2a67=_0x5e2a67-0x0;var _0x45da70=_0xe6ba[_0x5e2a67];return _0x45da70;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xae6b('0x0'))['db'][_0xae6b('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae6b('0x2'),'afterUpdate':_0xae6b('0x3'),'afterDestroy':_0xae6b('0x4')};function emitEvent(_0x57c339){return function(_0x280ec2,_0x5563e9,_0x2e9b5b){ChatOfflineMessageEvents['emit'](_0x57c339+':'+_0x280ec2['id'],_0x280ec2);ChatOfflineMessageEvents[_0xae6b('0x5')](_0x57c339,_0x280ec2);_0x2e9b5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xae6b('0x6')](e,emitEvent(event));}}module[_0xae6b('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xf12f=['emit','hasOwnProperty','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x57e242,_0x3585b9){var _0x30c771=function(_0x5b5a08){while(--_0x5b5a08){_0x57e242['push'](_0x57e242['shift']());}};_0x30c771(++_0x3585b9);}(_0xf12f,0x78));var _0xff12=function(_0x357f66,_0x6566ca){_0x357f66=_0x357f66-0x0;var _0x1296c3=_0xf12f[_0x357f66];return _0x1296c3;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xff12('0x0'))['db'][_0xff12('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xff12('0x2')](0x0);var events={'afterCreate':_0xff12('0x3'),'afterUpdate':_0xff12('0x4'),'afterDestroy':_0xff12('0x5')};function emitEvent(_0x1ac709){return function(_0x1a3b9d,_0x21f61e,_0x484c1a){ChatOfflineMessageEvents[_0xff12('0x6')](_0x1ac709+':'+_0x1a3b9d['id'],_0x1a3b9d);ChatOfflineMessageEvents[_0xff12('0x6')](_0x1ac709,_0x1a3b9d);_0x484c1a(null);};}for(var e in events){if(events[_0xff12('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xff12('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
index 41c60ef..12fa32b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8bc=['define','ChatOfflineMessage','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb8bc,0x116));var _0xcb8b=function(_0x19a91a,_0x19e131){_0x19a91a=_0x19a91a-0x0;var _0x7abbf8=_0xb8bc[_0x19a91a];return _0x7abbf8;};'use strict';var attributes=require(_0xcb8b('0x0'));module[_0xcb8b('0x1')]=function(_0x43be3d){return _0x43be3d[_0xcb8b('0x2')](_0xcb8b('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcb8b('0x4')});};
\ No newline at end of file
+var _0xd882=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x1ddad0,_0x3bc76f){var _0x3a2b90=function(_0x2f4ef9){while(--_0x2f4ef9){_0x1ddad0['push'](_0x1ddad0['shift']());}};_0x3a2b90(++_0x3bc76f);}(_0xd882,0xb1));var _0x2d88=function(_0x1d90ca,_0x3bab16){_0x1d90ca=_0x1d90ca-0x0;var _0x28872b=_0xd882[_0x1d90ca];return _0x28872b;};'use strict';var attributes=require(_0x2d88('0x0'));module[_0x2d88('0x1')]=function(_0xe686d5){return _0xe686d5[_0x2d88('0x2')](_0x2d88('0x3'),attributes,{'tableName':_0x2d88('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d88('0x5'),'collate':_0x2d88('0x6')});};
\ No newline at end of file
index a3acb4f..fbca3af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb66=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','code','error','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4adeb9,_0x251666){var _0x2bba5a=function(_0x3f68ed){while(--_0x3f68ed){_0x4adeb9['push'](_0x4adeb9['shift']());}};_0x2bba5a(++_0x251666);}(_0xcb66,0x19f));var _0x6cb6=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0xcb66[_0x30033a];return _0x5e3518;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var moment=require(_0x6cb6('0x1'));var BPromise=require(_0x6cb6('0x2'));var rs=require(_0x6cb6('0x3'));var fs=require('fs');var Redis=require(_0x6cb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cb6('0x5'));var logger=require(_0x6cb6('0x6'))(_0x6cb6('0x7'));var config=require(_0x6cb6('0x8'));var jayson=require(_0x6cb6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x174f39,_0x1595c9,_0x1028b3){return new BPromise(function(_0x4145f2,_0x1d0ee9){return client[_0x6cb6('0xa')](_0x174f39,_0x1028b3)[_0x6cb6('0xb')](function(_0x2b8e56){logger[_0x6cb6('0xc')](_0x6cb6('0xd'),_0x1595c9,_0x6cb6('0xe'));logger[_0x6cb6('0xf')](_0x6cb6('0x10'),_0x1595c9,'request\x20sent',JSON['stringify'](_0x2b8e56));if(_0x2b8e56['error']){if(_0x2b8e56['error'][_0x6cb6('0x11')]===0x1f4){logger[_0x6cb6('0x12')](_0x6cb6('0xd'),_0x1595c9,_0x2b8e56[_0x6cb6('0x12')]['message']);return _0x1d0ee9(_0x2b8e56[_0x6cb6('0x12')][_0x6cb6('0x13')]);}logger['error'](_0x6cb6('0xd'),_0x1595c9,_0x2b8e56[_0x6cb6('0x12')]['message']);return _0x4145f2(_0x2b8e56[_0x6cb6('0x12')][_0x6cb6('0x13')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x1595c9,'request\x20sent');_0x4145f2(_0x2b8e56['result'][_0x6cb6('0x13')]);}})[_0x6cb6('0x14')](function(_0x9c901a){logger[_0x6cb6('0x12')](_0x6cb6('0xd'),_0x1595c9,_0x9c901a);_0x1d0ee9(_0x9c901a);});});}
\ No newline at end of file
+var _0x16e6=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message'];(function(_0xf9389f,_0x2e8300){var _0x1987f7=function(_0x460546){while(--_0x460546){_0xf9389f['push'](_0xf9389f['shift']());}};_0x1987f7(++_0x2e8300);}(_0x16e6,0xe8));var _0x616e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x16e6[_0x342700];return _0x53406f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x616e('0x0'));var BPromise=require(_0x616e('0x1'));var rs=require(_0x616e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x616e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x616e('0x4'))(_0x616e('0x5'));var config=require(_0x616e('0x6'));var jayson=require(_0x616e('0x7'));var client=jayson[_0x616e('0x8')][_0x616e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x345e79,_0x1d65be,_0x565398){return new BPromise(function(_0x14ee0b,_0xd77947){return client[_0x616e('0xa')](_0x345e79,_0x565398)[_0x616e('0xb')](function(_0x5b99a9){logger[_0x616e('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1d65be,_0x616e('0xd'));logger[_0x616e('0xe')](_0x616e('0xf'),_0x1d65be,_0x616e('0xd'),JSON[_0x616e('0x10')](_0x5b99a9));if(_0x5b99a9['error']){if(_0x5b99a9[_0x616e('0x11')][_0x616e('0x12')]===0x1f4){logger[_0x616e('0x11')](_0x616e('0x13'),_0x1d65be,_0x5b99a9[_0x616e('0x11')][_0x616e('0x14')]);return _0xd77947(_0x5b99a9[_0x616e('0x11')][_0x616e('0x14')]);}logger[_0x616e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1d65be,_0x5b99a9['error'][_0x616e('0x14')]);return _0x14ee0b(_0x5b99a9['error'][_0x616e('0x14')]);}else{logger[_0x616e('0xc')](_0x616e('0x13'),_0x1d65be,_0x616e('0xd'));_0x14ee0b(_0x5b99a9[_0x616e('0x15')][_0x616e('0x14')]);}})[_0x616e('0x16')](function(_0x4557c8){logger['error'](_0x616e('0x13'),_0x1d65be,_0x4557c8);_0xd77947(_0x4557c8);});});}
\ No newline at end of file
index e49f694..1de8e7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21da=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x222b16,_0xed7cc7){var _0x544432=function(_0x141605){while(--_0x141605){_0x222b16['push'](_0x222b16['shift']());}};_0x544432(++_0xed7cc7);}(_0x21da,0x117));var _0xa21d=function(_0x42f2a0,_0x240494){_0x42f2a0=_0x42f2a0-0x0;var _0x4b448b=_0x21da[_0x42f2a0];return _0x4b448b;};'use strict';var multer=require(_0xa21d('0x0'));var util=require(_0xa21d('0x1'));var path=require('path');var timeout=require(_0xa21d('0x2'));var express=require(_0xa21d('0x3'));var router=express[_0xa21d('0x4')]();var fs_extra=require(_0xa21d('0x5'));var auth=require(_0xa21d('0x6'));var interaction=require(_0xa21d('0x7'));var config=require(_0xa21d('0x8'));var controller=require(_0xa21d('0x9'));router[_0xa21d('0xa')]('/',auth[_0xa21d('0xb')](),controller[_0xa21d('0xc')]);router[_0xa21d('0xa')](_0xa21d('0xd'),auth[_0xa21d('0xb')](),controller[_0xa21d('0xe')]);router[_0xa21d('0xa')](_0xa21d('0xf'),auth[_0xa21d('0xb')](),controller[_0xa21d('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa21d('0x11')]);router[_0xa21d('0x12')](_0xa21d('0xf'),auth[_0xa21d('0xb')](),controller[_0xa21d('0x13')]);router[_0xa21d('0x14')]('/:id',auth[_0xa21d('0xb')](),controller[_0xa21d('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x3675=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x466f03,_0xe3f71d){var _0x1132db=function(_0x338d4b){while(--_0x338d4b){_0x466f03['push'](_0x466f03['shift']());}};_0x1132db(++_0xe3f71d);}(_0x3675,0x75));var _0x5367=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x3675[_0x1e48d3];return _0x2852b1;};'use strict';var multer=require(_0x5367('0x0'));var util=require(_0x5367('0x1'));var path=require(_0x5367('0x2'));var timeout=require(_0x5367('0x3'));var express=require(_0x5367('0x4'));var router=express['Router']();var fs_extra=require(_0x5367('0x5'));var auth=require(_0x5367('0x6'));var interaction=require(_0x5367('0x7'));var config=require(_0x5367('0x8'));var controller=require(_0x5367('0x9'));router[_0x5367('0xa')]('/',auth[_0x5367('0xb')](),controller['index']);router[_0x5367('0xa')]('/describe',auth[_0x5367('0xb')](),controller[_0x5367('0xc')]);router[_0x5367('0xa')]('/:id',auth[_0x5367('0xb')](),controller['show']);router[_0x5367('0xd')]('/',auth[_0x5367('0xb')](),controller[_0x5367('0xe')]);router[_0x5367('0xf')](_0x5367('0x10'),auth[_0x5367('0xb')](),controller[_0x5367('0x11')]);router[_0x5367('0x12')](_0x5367('0x10'),auth[_0x5367('0xb')](),controller['destroy']);module[_0x5367('0x13')]=router;
\ No newline at end of file
index 4fb6424..43c65a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8426=['exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x11adbd,_0x5055f5){var _0x270029=function(_0x25feb6){while(--_0x25feb6){_0x11adbd['push'](_0x11adbd['shift']());}};_0x270029(++_0x5055f5);}(_0x8426,0x120));var _0x6842=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x8426[_0x50007c];return _0x5c1ec7;};'use strict';var Sequelize=require('sequelize');module[_0x6842('0x0')]={'name':{'type':Sequelize[_0x6842('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6842('0x2')](_0x6842('0x3'),_0x6842('0x4')),'defaultValue':_0x6842('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6842('0x5')]}};
\ No newline at end of file
+var _0x0352=['INTEGER','exports','STRING','mouseOver'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0352,0x135));var _0x2035=function(_0x481d6c,_0x4a317a){_0x481d6c=_0x481d6c-0x0;var _0x419277=_0x0352[_0x481d6c];return _0x419277;};'use strict';var Sequelize=require('sequelize');module[_0x2035('0x0')]={'name':{'type':Sequelize[_0x2035('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2035('0x2'),'timeout'),'defaultValue':_0x2035('0x2')},'selector':{'type':Sequelize[_0x2035('0x1')]},'timeout':{'type':Sequelize[_0x2035('0x3')]}};
\ No newline at end of file
index c287765..741f82a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc3=['model','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','include','merge','ChatProactiveAction','find','catch','create','update','body','destroy','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','undefined','count','Content-Range','apply','reject','then','sendStatus','error','stack','name','params'];(function(_0x47856a,_0x1ad7a0){var _0x1edd96=function(_0x4da7f3){while(--_0x4da7f3){_0x47856a['push'](_0x47856a['shift']());}};_0x1edd96(++_0x1ad7a0);}(_0x8bc3,0x82));var _0x38bc=function(_0x5834c7,_0x596152){_0x5834c7=_0x5834c7-0x0;var _0x151d83=_0x8bc3[_0x5834c7];return _0x151d83;};'use strict';var emlformat=require(_0x38bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38bc('0x2'));var moment=require(_0x38bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x38bc('0x4'));var util=require(_0x38bc('0x5'));var path=require(_0x38bc('0x6'));var sox=require(_0x38bc('0x7'));var csv=require('to-csv');var ejs=require(_0x38bc('0x8'));var fs=require('fs');var fs_extra=require(_0x38bc('0x9'));var _=require(_0x38bc('0xa'));var squel=require(_0x38bc('0xb'));var crypto=require(_0x38bc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38bc('0xd'));var querystring=require(_0x38bc('0xe'));var Papa=require(_0x38bc('0xf'));var Redis=require(_0x38bc('0x10'));var authService=require(_0x38bc('0x11'));var qs=require(_0x38bc('0x12'));var as=require(_0x38bc('0x13'));var hardwareService=require(_0x38bc('0x14'));var logger=require(_0x38bc('0x15'))(_0x38bc('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5f4b,_0x56fdcf){_0x56fdcf=_0x56fdcf||0xcc;return function(_0x486c59){if(_0x486c59){return _0x1a5f4b['sendStatus'](_0x56fdcf);}return _0x1a5f4b['status'](_0x56fdcf)[_0x38bc('0x17')]();};}function respondWithResult(_0x1a7903,_0x454eac){_0x454eac=_0x454eac||0xc8;return function(_0x5d4997){if(_0x5d4997){return _0x1a7903[_0x38bc('0x18')](_0x454eac)[_0x38bc('0x19')](_0x5d4997);}};}function respondWithFilteredResult(_0x1ff95d,_0x322c4e){return function(_0x2c223e){if(_0x2c223e){var _0x1c0cd2=typeof _0x322c4e[_0x38bc('0x1a')]===_0x38bc('0x1b')&&typeof _0x322c4e['limit']===_0x38bc('0x1b');var _0x55940b=_0x2c223e[_0x38bc('0x1c')];var _0x1f0e08=_0x1c0cd2?0x0:_0x322c4e[_0x38bc('0x1a')];var _0x30b309=_0x1c0cd2?_0x2c223e[_0x38bc('0x1c')]:_0x322c4e[_0x38bc('0x1a')]+_0x322c4e['limit'];var _0x36ccda;if(_0x30b309>=_0x55940b){_0x30b309=_0x55940b;_0x36ccda=0xc8;}else{_0x36ccda=0xce;}_0x1ff95d['status'](_0x36ccda);return _0x1ff95d['set'](_0x38bc('0x1d'),_0x1f0e08+'-'+_0x30b309+'/'+_0x55940b)[_0x38bc('0x19')](_0x2c223e);}return null;};}function patchUpdates(_0x325b14){return function(_0x19f3af){try{jsonpatch[_0x38bc('0x1e')](_0x19f3af,_0x325b14,!![]);}catch(_0x40e3b6){return BPromise[_0x38bc('0x1f')](_0x40e3b6);}return _0x19f3af['save']();};}function saveUpdates(_0x4a43c7,_0x2999b0){return function(_0x46b863){if(_0x46b863){return _0x46b863['update'](_0x4a43c7)[_0x38bc('0x20')](function(_0x5f4026){return _0x5f4026;});}return null;};}function removeEntity(_0x897a6b,_0x4251ee){return function(_0x434007){if(_0x434007){return _0x434007['destroy']()[_0x38bc('0x20')](function(){_0x897a6b[_0x38bc('0x18')](0xcc)[_0x38bc('0x17')]();});}};}function handleEntityNotFound(_0x49c92d,_0x349731){return function(_0x3daed5){if(!_0x3daed5){_0x49c92d[_0x38bc('0x21')](0x194);}return _0x3daed5;};}function handleError(_0x3a5b7f,_0x53cb1a){_0x53cb1a=_0x53cb1a||0x1f4;return function(_0x487679){logger[_0x38bc('0x22')](_0x487679[_0x38bc('0x23')]);if(_0x487679[_0x38bc('0x24')]){delete _0x487679[_0x38bc('0x24')];}_0x3a5b7f['status'](_0x53cb1a)['send'](_0x487679);};}exports['show']=function(_0x456a78,_0x43ab9f){var _0x404759={'raw':!![],'where':{'id':_0x456a78[_0x38bc('0x25')]['id']}},_0x539b3b={};_0x539b3b[_0x38bc('0x26')]=_['keys'](db['ChatProactiveAction'][_0x38bc('0x27')]);_0x539b3b['query']=_['keys'](_0x456a78[_0x38bc('0x28')]);_0x539b3b[_0x38bc('0x29')]=_[_0x38bc('0x2a')](_0x539b3b[_0x38bc('0x26')],_0x539b3b[_0x38bc('0x28')]);_0x404759['attributes']=_[_0x38bc('0x2a')](_0x539b3b[_0x38bc('0x26')],qs[_0x38bc('0x2b')](_0x456a78[_0x38bc('0x28')][_0x38bc('0x2b')]));_0x404759['attributes']=_0x404759['attributes'][_0x38bc('0x2c')]?_0x404759[_0x38bc('0x2d')]:_0x539b3b[_0x38bc('0x26')];if(_0x456a78[_0x38bc('0x28')][_0x38bc('0x2e')]){_0x404759[_0x38bc('0x2f')]=[{'all':!![]}];}_0x404759=_[_0x38bc('0x30')]({},_0x404759,_0x456a78['options']);return db[_0x38bc('0x31')][_0x38bc('0x32')](_0x404759)['then'](handleEntityNotFound(_0x43ab9f,null))[_0x38bc('0x20')](respondWithResult(_0x43ab9f,null))[_0x38bc('0x33')](handleError(_0x43ab9f,null));};exports[_0x38bc('0x34')]=function(_0x17031c,_0x477411){return db['ChatProactiveAction'][_0x38bc('0x34')](_0x17031c['body'],{})[_0x38bc('0x20')](respondWithResult(_0x477411,0xc9))[_0x38bc('0x33')](handleError(_0x477411,null));};exports[_0x38bc('0x35')]=function(_0x14d8cf,_0x109af1){if(_0x14d8cf[_0x38bc('0x36')]['id']){delete _0x14d8cf[_0x38bc('0x36')]['id'];}return db[_0x38bc('0x31')]['find']({'where':{'id':_0x14d8cf[_0x38bc('0x25')]['id']}})[_0x38bc('0x20')](handleEntityNotFound(_0x109af1,null))[_0x38bc('0x20')](saveUpdates(_0x14d8cf['body'],null))['then'](respondWithResult(_0x109af1,null))[_0x38bc('0x33')](handleError(_0x109af1,null));};exports[_0x38bc('0x37')]=function(_0xdba6c5,_0x43cfbf){return db[_0x38bc('0x31')][_0x38bc('0x32')]({'where':{'id':_0xdba6c5[_0x38bc('0x25')]['id']}})[_0x38bc('0x20')](handleEntityNotFound(_0x43cfbf,null))['then'](removeEntity(_0x43cfbf,null))[_0x38bc('0x33')](handleError(_0x43cfbf,null));};
\ No newline at end of file
+var _0xa41a=['fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','show','params','model','keys','rawAttributes','query','filters','fields','attributes','length','includeAll','include','merge','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x431e61,_0x53c722){var _0x5328e4=function(_0x6df49e){while(--_0x6df49e){_0x431e61['push'](_0x431e61['shift']());}};_0x5328e4(++_0x53c722);}(_0xa41a,0x6b));var _0xaa41=function(_0x46fc25,_0x20f34e){_0x46fc25=_0x46fc25-0x0;var _0x516fc4=_0xa41a[_0x46fc25];return _0x516fc4;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){_0x43a85c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aec5,_0x527cac){return function(_0x493a10){if(!_0x493a10){_0x16aec5[_0xaa41('0x19')](0x194);}return _0x493a10;};}function handleError(_0x59707f,_0x536bed){_0x536bed=_0x536bed||0x1f4;return function(_0x2d0ac0){logger[_0xaa41('0x26')](_0x2d0ac0[_0xaa41('0x27')]);if(_0x2d0ac0[_0xaa41('0x28')]){delete _0x2d0ac0[_0xaa41('0x28')];}_0x59707f[_0xaa41('0x1a')](_0x536bed)['send'](_0x2d0ac0);};}exports[_0xaa41('0x29')]=function(_0x1f0275,_0x63c18c){var _0x9a16e3={'raw':!![],'where':{'id':_0x1f0275[_0xaa41('0x2a')]['id']}},_0x1d8c2b={};_0x1d8c2b[_0xaa41('0x2b')]=_[_0xaa41('0x2c')](db['ChatProactiveAction'][_0xaa41('0x2d')]);_0x1d8c2b['query']=_['keys'](_0x1f0275[_0xaa41('0x2e')]);_0x1d8c2b[_0xaa41('0x2f')]=_['intersection'](_0x1d8c2b[_0xaa41('0x2b')],_0x1d8c2b[_0xaa41('0x2e')]);_0x9a16e3['attributes']=_['intersection'](_0x1d8c2b['model'],qs[_0xaa41('0x30')](_0x1f0275[_0xaa41('0x2e')][_0xaa41('0x30')]));_0x9a16e3[_0xaa41('0x31')]=_0x9a16e3['attributes'][_0xaa41('0x32')]?_0x9a16e3[_0xaa41('0x31')]:_0x1d8c2b[_0xaa41('0x2b')];if(_0x1f0275['query'][_0xaa41('0x33')]){_0x9a16e3[_0xaa41('0x34')]=[{'all':!![]}];}_0x9a16e3=_[_0xaa41('0x35')]({},_0x9a16e3,_0x1f0275['options']);return db[_0xaa41('0x36')][_0xaa41('0x37')](_0x9a16e3)['then'](handleEntityNotFound(_0x63c18c,null))[_0xaa41('0x25')](respondWithResult(_0x63c18c,null))[_0xaa41('0x38')](handleError(_0x63c18c,null));};exports[_0xaa41('0x39')]=function(_0x5cec87,_0x22b272){return db['ChatProactiveAction'][_0xaa41('0x39')](_0x5cec87[_0xaa41('0x3a')],{})[_0xaa41('0x25')](respondWithResult(_0x22b272,0xc9))['catch'](handleError(_0x22b272,null));};exports['update']=function(_0x4cdd42,_0x2dc05a){if(_0x4cdd42[_0xaa41('0x3a')]['id']){delete _0x4cdd42[_0xaa41('0x3a')]['id'];}return db[_0xaa41('0x36')]['find']({'where':{'id':_0x4cdd42['params']['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x2dc05a,null))[_0xaa41('0x25')](saveUpdates(_0x4cdd42[_0xaa41('0x3a')],null))[_0xaa41('0x25')](respondWithResult(_0x2dc05a,null))[_0xaa41('0x38')](handleError(_0x2dc05a,null));};exports[_0xaa41('0x24')]=function(_0x44a4fc,_0x5e9879){return db[_0xaa41('0x36')][_0xaa41('0x37')]({'where':{'id':_0x44a4fc[_0xaa41('0x2a')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x5e9879,null))['then'](removeEntity(_0x5e9879,null))['catch'](handleError(_0x5e9879,null));};
\ No newline at end of file
index aaf2584..7e074fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93b7=['rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1114d6,_0x50f8cd){var _0x28b41d=function(_0x457530){while(--_0x457530){_0x1114d6['push'](_0x1114d6['shift']());}};_0x28b41d(++_0x50f8cd);}(_0x93b7,0x94));var _0x793b=function(_0x1f707f,_0xb97d26){_0x1f707f=_0x1f707f-0x0;var _0x30368b=_0x93b7[_0x1f707f];return _0x30368b;};'use strict';var _=require(_0x793b('0x0'));var util=require(_0x793b('0x1'));var logger=require(_0x793b('0x2'))(_0x793b('0x3'));var moment=require(_0x793b('0x4'));var BPromise=require(_0x793b('0x5'));var rp=require(_0x793b('0x6'));var fs=require('fs');var path=require(_0x793b('0x7'));var rimraf=require(_0x793b('0x8'));var config=require('../../config/environment');var attributes=require(_0x793b('0x9'));module['exports']=function(_0x1736e5,_0x1e9b99){return _0x1736e5[_0x793b('0xa')](_0x793b('0xb'),attributes,{'tableName':_0x793b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0305=['path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment','request-promise'];(function(_0x25aa2c,_0x48d885){var _0x2e2f0d=function(_0x27c335){while(--_0x27c335){_0x25aa2c['push'](_0x25aa2c['shift']());}};_0x2e2f0d(++_0x48d885);}(_0x0305,0x17c));var _0x5030=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x0305[_0x37a79c];return _0x561d89;};'use strict';var _=require(_0x5030('0x0'));var util=require('util');var logger=require(_0x5030('0x1'))(_0x5030('0x2'));var moment=require(_0x5030('0x3'));var BPromise=require('bluebird');var rp=require(_0x5030('0x4'));var fs=require('fs');var path=require(_0x5030('0x5'));var rimraf=require(_0x5030('0x6'));var config=require('../../config/environment');var attributes=require(_0x5030('0x7'));module['exports']=function(_0x318286,_0x145e4d){return _0x318286[_0x5030('0x8')](_0x5030('0x9'),attributes,{'tableName':_0x5030('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12d9f4e..a29a958 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef9d=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x507fb9,_0xc1dd73){var _0x68007=function(_0x25e9cc){while(--_0x25e9cc){_0x507fb9['push'](_0x507fb9['shift']());}};_0x68007(++_0xc1dd73);}(_0xef9d,0x1c8));var _0xdef9=function(_0x185195,_0x4c08de){_0x185195=_0x185195-0x0;var _0x8f127e=_0xef9d[_0x185195];return _0x8f127e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdef9('0x0'));var BPromise=require(_0xdef9('0x1'));var rs=require(_0xdef9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdef9('0x3'))['db'];var utils=require(_0xdef9('0x4'));var logger=require(_0xdef9('0x5'))(_0xdef9('0x6'));var config=require(_0xdef9('0x7'));var jayson=require(_0xdef9('0x8'));var client=jayson[_0xdef9('0x9')][_0xdef9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4df2bf,_0xa6afc2,_0x302905){return new BPromise(function(_0x299c9a,_0x5a7126){return client[_0xdef9('0xb')](_0x4df2bf,_0x302905)[_0xdef9('0xc')](function(_0x8c8035){logger[_0xdef9('0xd')](_0xdef9('0xe'),_0xa6afc2,_0xdef9('0xf'));logger[_0xdef9('0x10')](_0xdef9('0x11'),_0xa6afc2,_0xdef9('0xf'),JSON[_0xdef9('0x12')](_0x8c8035));if(_0x8c8035[_0xdef9('0x13')]){if(_0x8c8035[_0xdef9('0x13')][_0xdef9('0x14')]===0x1f4){logger['error'](_0xdef9('0xe'),_0xa6afc2,_0x8c8035[_0xdef9('0x13')][_0xdef9('0x15')]);return _0x5a7126(_0x8c8035[_0xdef9('0x13')][_0xdef9('0x15')]);}logger[_0xdef9('0x13')](_0xdef9('0xe'),_0xa6afc2,_0x8c8035[_0xdef9('0x13')][_0xdef9('0x15')]);return _0x299c9a(_0x8c8035[_0xdef9('0x13')][_0xdef9('0x15')]);}else{logger[_0xdef9('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0xa6afc2,'request\x20sent');_0x299c9a(_0x8c8035[_0xdef9('0x16')][_0xdef9('0x15')]);}})[_0xdef9('0x17')](function(_0x1bccbb){logger[_0xdef9('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0xa6afc2,_0x1bccbb);_0x5a7126(_0x1bccbb);});});}
\ No newline at end of file
+var _0x0c58=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','ChatProactiveAction,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1924ac,_0x261094){var _0x3888e2=function(_0x47b97f){while(--_0x47b97f){_0x1924ac['push'](_0x1924ac['shift']());}};_0x3888e2(++_0x261094);}(_0x0c58,0x12f));var _0x80c5=function(_0x5f3a35,_0x31ac29){_0x5f3a35=_0x5f3a35-0x0;var _0x4c195f=_0x0c58[_0x5f3a35];return _0x4c195f;};'use strict';var _=require(_0x80c5('0x0'));var util=require('util');var moment=require(_0x80c5('0x1'));var BPromise=require(_0x80c5('0x2'));var rs=require(_0x80c5('0x3'));var fs=require('fs');var Redis=require(_0x80c5('0x4'));var db=require(_0x80c5('0x5'))['db'];var utils=require(_0x80c5('0x6'));var logger=require(_0x80c5('0x7'))(_0x80c5('0x8'));var config=require('../../config/environment');var jayson=require(_0x80c5('0x9'));var client=jayson[_0x80c5('0xa')][_0x80c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb063,_0x18780e,_0x1986cd){return new BPromise(function(_0x2d4ed0,_0x273c34){return client[_0x80c5('0xc')](_0x1eb063,_0x1986cd)[_0x80c5('0xd')](function(_0x537602){logger[_0x80c5('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x18780e,_0x80c5('0xf'));logger[_0x80c5('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x18780e,_0x80c5('0xf'),JSON['stringify'](_0x537602));if(_0x537602[_0x80c5('0x11')]){if(_0x537602[_0x80c5('0x11')][_0x80c5('0x12')]===0x1f4){logger[_0x80c5('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x18780e,_0x537602[_0x80c5('0x11')][_0x80c5('0x13')]);return _0x273c34(_0x537602['error'][_0x80c5('0x13')]);}logger[_0x80c5('0x11')](_0x80c5('0x14'),_0x18780e,_0x537602[_0x80c5('0x11')]['message']);return _0x2d4ed0(_0x537602[_0x80c5('0x11')]['message']);}else{logger[_0x80c5('0xe')](_0x80c5('0x14'),_0x18780e,_0x80c5('0xf'));_0x2d4ed0(_0x537602['result']['message']);}})[_0x80c5('0x15')](function(_0x4070f8){logger[_0x80c5('0x11')](_0x80c5('0x14'),_0x18780e,_0x4070f8);_0x273c34(_0x4070f8);});});}
\ No newline at end of file
index e956b7a..6101ca6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29b11b,_0x3ea6f0){var _0x227770=function(_0x31e139){while(--_0x31e139){_0x29b11b['push'](_0x29b11b['shift']());}};_0x227770(++_0x3ea6f0);}(_0x6aa7,0x178));var _0x76aa=function(_0x26c310,_0x52d9c8){_0x26c310=_0x26c310-0x0;var _0x58e8f6=_0x6aa7[_0x26c310];return _0x58e8f6;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router;
\ No newline at end of file
+var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xeff8,0x186));var _0x8eff=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xeff8[_0x4914e2];return _0x2dcd07;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
index 67ce0d5..30b07e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1778=['ENUM','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1778,0x1a3));var _0x8177=function(_0x455eb2,_0x4f2dae){_0x455eb2=_0x455eb2-0x0;var _0x260c4e=_0x1778[_0x455eb2];return _0x260c4e;};'use strict';var Sequelize=require(_0x8177('0x0'));module[_0x8177('0x1')]={'name':{'type':Sequelize[_0x8177('0x2')],'unique':_0x8177('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8177('0x2')]},'timeout':{'type':Sequelize[_0x8177('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8177('0x5')]('rrmemory',_0x8177('0x6'),_0x8177('0x7'))}};
\ No newline at end of file
+var _0x5948=['name','STRING','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x7619ad,_0x3518cd){var _0x54593f=function(_0x5f07a3){while(--_0x5f07a3){_0x7619ad['push'](_0x7619ad['shift']());}};_0x54593f(++_0x3518cd);}(_0x5948,0x98));var _0x8594=function(_0x2fd873,_0x51262f){_0x2fd873=_0x2fd873-0x0;var _0x23e544=_0x5948[_0x2fd873];return _0x23e544;};'use strict';var Sequelize=require(_0x8594('0x0'));module[_0x8594('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8594('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8594('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8594('0x4')](_0x8594('0x5'),'beepall',_0x8594('0x6'))}};
\ No newline at end of file
index 58f9bb1..79f38a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9442=['UserProfileResource','destroy','end','stack','name','send','index','ChatQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','include','findAll','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserChatQueue','ChatQueueId','options','findAndCountAll','UserId','agent','chatPause','createdAt','format','SIP','getTeams','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','every','TeamId','includes','all','union','compact','value','removeTeams','ids','isEmpty','forEach','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','info','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','ChatQueues'];(function(_0x8bf24a,_0x2c9105){var _0x40937d=function(_0x2d2181){while(--_0x2d2181){_0x8bf24a['push'](_0x8bf24a['shift']());}};_0x40937d(++_0x2c9105);}(_0x9442,0x19c));var _0x2944=function(_0x5e17c9,_0x527a71){_0x5e17c9=_0x5e17c9-0x0;var _0x1aa0d9=_0x9442[_0x5e17c9];return _0x1aa0d9;};'use strict';var emlformat=require(_0x2944('0x0'));var rimraf=require(_0x2944('0x1'));var zipdir=require(_0x2944('0x2'));var jsonpatch=require(_0x2944('0x3'));var rp=require('request-promise');var moment=require(_0x2944('0x4'));var BPromise=require(_0x2944('0x5'));var Mustache=require(_0x2944('0x6'));var util=require(_0x2944('0x7'));var path=require('path');var sox=require(_0x2944('0x8'));var csv=require(_0x2944('0x9'));var ejs=require(_0x2944('0xa'));var fs=require('fs');var fs_extra=require(_0x2944('0xb'));var _=require(_0x2944('0xc'));var squel=require(_0x2944('0xd'));var crypto=require(_0x2944('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2944('0x9'));var querystring=require(_0x2944('0xf'));var Papa=require(_0x2944('0x10'));var Redis=require(_0x2944('0x11'));var authService=require(_0x2944('0x12'));var qs=require(_0x2944('0x13'));var as=require(_0x2944('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2944('0x15'));var utils=require(_0x2944('0x16'));var config=require(_0x2944('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2944('0x18'))['db'];config[_0x2944('0x19')]=_[_0x2944('0x1a')](config[_0x2944('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x2944('0x1b'))(new Redis(config[_0x2944('0x19')]));require(_0x2944('0x1c'))['register'](socket);var jayson=require(_0x2944('0x1d'));var client=jayson[_0x2944('0x1e')][_0x2944('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3f07a1,_0x20fd3d,_0xafef06,_0x1016d0){return new BPromise(function(_0x2eb3bd,_0x3f6939){var _0x1ad4f6=_0x1016d0||client;return _0x1ad4f6['request'](_0x3f07a1,_0xafef06)['then'](function(_0x57adb7){logger[_0x2944('0x20')]('ChatQueue,\x20%s,\x20%s',_0x20fd3d,'request\x20sent');logger['debug'](_0x2944('0x21'),_0x20fd3d,'request\x20sent',JSON[_0x2944('0x22')](_0x57adb7));if(_0x57adb7[_0x2944('0x23')]){if(_0x57adb7[_0x2944('0x23')][_0x2944('0x24')]===0x1f4){logger['error'](_0x2944('0x25'),_0x20fd3d,_0x57adb7['error'][_0x2944('0x26')]);return _0x3f6939(_0x57adb7[_0x2944('0x23')]['message']);}logger[_0x2944('0x23')]('ChatQueue,\x20%s,\x20%s',_0x20fd3d,_0x57adb7[_0x2944('0x23')][_0x2944('0x26')]);return _0x2eb3bd(_0x57adb7[_0x2944('0x23')]['message']);}else{logger[_0x2944('0x20')]('ChatQueue,\x20%s,\x20%s',_0x20fd3d,_0x2944('0x27'));_0x2eb3bd(_0x57adb7[_0x2944('0x28')]['message']);}})[_0x2944('0x29')](function(_0x147037){logger[_0x2944('0x23')](_0x2944('0x25'),_0x20fd3d,_0x147037);_0x3f6939(_0x147037);});});}function respondWithStatusCode(_0x51e551,_0x21fad5){_0x21fad5=_0x21fad5||0xcc;return function(_0x12c9c3){if(_0x12c9c3){return _0x51e551[_0x2944('0x2a')](_0x21fad5);}return _0x51e551[_0x2944('0x2b')](_0x21fad5)['end']();};}function respondWithResult(_0x5a8c94,_0x14b22a){_0x14b22a=_0x14b22a||0xc8;return function(_0x323510){if(_0x323510){return _0x5a8c94[_0x2944('0x2b')](_0x14b22a)[_0x2944('0x2c')](_0x323510);}};}function respondWithFilteredResult(_0x1bdb17,_0x305ff7){return function(_0x5cce35){if(_0x5cce35){var _0x5089d5=typeof _0x305ff7[_0x2944('0x2d')]===_0x2944('0x2e')&&typeof _0x305ff7[_0x2944('0x2f')]===_0x2944('0x2e');var _0x2dc3d4=_0x5cce35[_0x2944('0x30')];var _0x31b034=_0x5089d5?0x0:_0x305ff7['offset'];var _0x1a1226=_0x5089d5?_0x5cce35[_0x2944('0x30')]:_0x305ff7[_0x2944('0x2d')]+_0x305ff7[_0x2944('0x2f')];var _0x471a95;if(_0x1a1226>=_0x2dc3d4){_0x1a1226=_0x2dc3d4;_0x471a95=0xc8;}else{_0x471a95=0xce;}_0x1bdb17[_0x2944('0x2b')](_0x471a95);return _0x1bdb17[_0x2944('0x31')](_0x2944('0x32'),_0x31b034+'-'+_0x1a1226+'/'+_0x2dc3d4)[_0x2944('0x2c')](_0x5cce35);}return null;};}function patchUpdates(_0x1daa35){return function(_0x549b2f){try{jsonpatch[_0x2944('0x33')](_0x549b2f,_0x1daa35,!![]);}catch(_0x131c30){return BPromise[_0x2944('0x34')](_0x131c30);}return _0x549b2f['save']();};}function saveUpdates(_0x90433d,_0x4e4c27){return function(_0x416d65){if(_0x416d65){return _0x416d65['update'](_0x90433d)['then'](function(_0x1b92c6){return _0x1b92c6;});}return null;};}function removeEntity(_0x34c59d,_0x4463f5){return function(_0x194613){if(_0x194613){return _0x194613['destroy']()[_0x2944('0x35')](function(){var _0x29ac05=_0x194613[_0x2944('0x36')]({'plain':!![]});var _0x5075a9=_0x2944('0x37');return db[_0x2944('0x38')][_0x2944('0x39')]({'where':{'type':_0x5075a9,'resourceId':_0x29ac05['id']}})[_0x2944('0x35')](function(){return _0x194613;});})[_0x2944('0x35')](function(){_0x34c59d[_0x2944('0x2b')](0xcc)[_0x2944('0x3a')]();});}};}function handleEntityNotFound(_0x386d69,_0x2b5f09){return function(_0x1c0123){if(!_0x1c0123){_0x386d69[_0x2944('0x2a')](0x194);}return _0x1c0123;};}function handleError(_0x4ca0b7,_0x50b94f){_0x50b94f=_0x50b94f||0x1f4;return function(_0x5c5337){logger['error'](_0x5c5337[_0x2944('0x3b')]);if(_0x5c5337[_0x2944('0x3c')]){delete _0x5c5337[_0x2944('0x3c')];}_0x4ca0b7[_0x2944('0x2b')](_0x50b94f)[_0x2944('0x3d')](_0x5c5337);};}exports[_0x2944('0x3e')]=function(_0x43861f,_0x4f3627){var _0x350c52={},_0x442f3a={},_0x35bc93={'count':0x0,'rows':[]};var _0x473b51=_['map'](db[_0x2944('0x3f')][_0x2944('0x40')],function(_0x47b51c){return{'name':_0x47b51c['fieldName'],'type':_0x47b51c['type'][_0x2944('0x41')]};});_0x442f3a[_0x2944('0x42')]=_['map'](_0x473b51,_0x2944('0x3c'));_0x442f3a[_0x2944('0x43')]=_[_0x2944('0x44')](_0x43861f[_0x2944('0x43')]);_0x442f3a[_0x2944('0x45')]=_[_0x2944('0x46')](_0x442f3a[_0x2944('0x42')],_0x442f3a[_0x2944('0x43')]);_0x350c52[_0x2944('0x47')]=_['intersection'](_0x442f3a[_0x2944('0x42')],qs['fields'](_0x43861f[_0x2944('0x43')][_0x2944('0x48')]));_0x350c52[_0x2944('0x47')]=_0x350c52['attributes'][_0x2944('0x49')]?_0x350c52[_0x2944('0x47')]:_0x442f3a[_0x2944('0x42')];if(!_0x43861f['query'][_0x2944('0x4a')](_0x2944('0x4b'))){_0x350c52[_0x2944('0x2f')]=qs[_0x2944('0x2f')](_0x43861f['query']['limit']);_0x350c52['offset']=qs[_0x2944('0x2d')](_0x43861f['query'][_0x2944('0x2d')]);}_0x350c52[_0x2944('0x4c')]=qs[_0x2944('0x4d')](_0x43861f[_0x2944('0x43')][_0x2944('0x4d')]);_0x350c52[_0x2944('0x4e')]=qs['filters'](_[_0x2944('0x4f')](_0x43861f[_0x2944('0x43')],_0x442f3a[_0x2944('0x45')]),_0x473b51);if(_0x43861f[_0x2944('0x43')][_0x2944('0x50')]){_0x350c52[_0x2944('0x4e')]=_[_0x2944('0x51')](_0x350c52['where'],{'$or':_[_0x2944('0x52')](_0x473b51,function(_0xd5b680){if(_0xd5b680[_0x2944('0x53')]!==_0x2944('0x54')){var _0x5b5466={};_0x5b5466[_0xd5b680[_0x2944('0x3c')]]={'$like':'%'+_0x43861f[_0x2944('0x43')][_0x2944('0x50')]+'%'};return _0x5b5466;}})});}_0x350c52=_[_0x2944('0x51')]({},_0x350c52,_0x43861f['options']);var _0x40d4c2={'where':_0x350c52['where']};return db[_0x2944('0x3f')][_0x2944('0x30')](_0x40d4c2)[_0x2944('0x35')](function(_0x4d2f01){_0x35bc93['count']=_0x4d2f01;if(_0x43861f[_0x2944('0x43')]['includeAll']){_0x350c52[_0x2944('0x55')]=[{'all':!![]}];}return db[_0x2944('0x3f')][_0x2944('0x56')](_0x350c52);})[_0x2944('0x35')](function(_0x223541){_0x35bc93[_0x2944('0x57')]=_0x223541;return _0x35bc93;})['then'](respondWithFilteredResult(_0x4f3627,_0x350c52))[_0x2944('0x29')](handleError(_0x4f3627,null));};exports[_0x2944('0x58')]=function(_0x5f378c,_0x506f01){var _0x2204e1={'raw':!![],'where':{'id':_0x5f378c['params']['id']}},_0x37872b={};_0x37872b[_0x2944('0x42')]=_[_0x2944('0x44')](db[_0x2944('0x3f')]['rawAttributes']);_0x37872b[_0x2944('0x43')]=_[_0x2944('0x44')](_0x5f378c['query']);_0x37872b[_0x2944('0x45')]=_['intersection'](_0x37872b['model'],_0x37872b['query']);_0x2204e1[_0x2944('0x47')]=_[_0x2944('0x46')](_0x37872b[_0x2944('0x42')],qs[_0x2944('0x48')](_0x5f378c['query'][_0x2944('0x48')]));_0x2204e1[_0x2944('0x47')]=_0x2204e1['attributes'][_0x2944('0x49')]?_0x2204e1[_0x2944('0x47')]:_0x37872b[_0x2944('0x42')];if(_0x5f378c[_0x2944('0x43')][_0x2944('0x59')]){_0x2204e1[_0x2944('0x55')]=[{'all':!![]}];}_0x2204e1=_[_0x2944('0x51')]({},_0x2204e1,_0x5f378c['options']);return db[_0x2944('0x3f')][_0x2944('0x5a')](_0x2204e1)[_0x2944('0x35')](handleEntityNotFound(_0x506f01,null))[_0x2944('0x35')](respondWithResult(_0x506f01,null))[_0x2944('0x29')](handleError(_0x506f01,null));};exports[_0x2944('0x5b')]=function(_0xe9755,_0x4b7b39){return db[_0x2944('0x3f')][_0x2944('0x5b')](_0xe9755[_0x2944('0x5c')],{})[_0x2944('0x35')](function(_0x453155){var _0x106f97=_0xe9755[_0x2944('0x5d')][_0x2944('0x36')]({'plain':!![]});if(!_0x106f97)throw new Error(_0x2944('0x5e'));if(_0x106f97[_0x2944('0x5f')]===_0x2944('0x5d')){var _0x474531=_0x453155[_0x2944('0x36')]({'plain':!![]});var _0x1b1b58=_0x2944('0x37');return db['UserProfileSection'][_0x2944('0x5a')]({'where':{'name':_0x1b1b58,'userProfileId':_0x106f97[_0x2944('0x60')]},'raw':!![]})[_0x2944('0x35')](function(_0x1cb0de){if(_0x1cb0de&&_0x1cb0de[_0x2944('0x61')]===0x0){return db[_0x2944('0x38')][_0x2944('0x5b')]({'name':_0x474531[_0x2944('0x3c')],'resourceId':_0x474531['id'],'type':_0x1cb0de[_0x2944('0x3c')],'sectionId':_0x1cb0de['id']},{})[_0x2944('0x35')](function(){return _0x453155;});}else{return _0x453155;}})['catch'](function(_0x14df2f){logger[_0x2944('0x23')](_0x2944('0x62'),_0x14df2f);throw _0x14df2f;});}return _0x453155;})['then'](respondWithResult(_0x4b7b39,0xc9))[_0x2944('0x29')](handleError(_0x4b7b39,null));};exports[_0x2944('0x63')]=function(_0x3932a8,_0x48a6a8){if(_0x3932a8['body']['id']){delete _0x3932a8[_0x2944('0x5c')]['id'];}return db['ChatQueue'][_0x2944('0x5a')]({'where':{'id':_0x3932a8[_0x2944('0x64')]['id']}})[_0x2944('0x35')](handleEntityNotFound(_0x48a6a8,null))['then'](saveUpdates(_0x3932a8['body'],null))['then'](respondWithResult(_0x48a6a8,null))[_0x2944('0x29')](handleError(_0x48a6a8,null));};exports[_0x2944('0x39')]=function(_0x351ea3,_0x6a7bd5){return db['ChatQueue']['find']({'where':{'id':_0x351ea3[_0x2944('0x64')]['id']}})[_0x2944('0x35')](handleEntityNotFound(_0x6a7bd5,null))[_0x2944('0x35')](removeEntity(_0x6a7bd5,null))[_0x2944('0x29')](handleError(_0x6a7bd5,null));};exports['describe']=function(_0x245902,_0x40c10d){return db[_0x2944('0x3f')][_0x2944('0x65')]()[_0x2944('0x35')](respondWithResult(_0x40c10d,null))[_0x2944('0x29')](handleError(_0x40c10d,null));};exports['getMembers']=function(_0x137813,_0x23ce6e,_0x4dee54){var _0x2f0509={'raw':!![],'where':{}},_0x3e2461={},_0x5add42;return db[_0x2944('0x3f')][_0x2944('0x66')]({'where':{'id':_0x137813['params']['id']}})[_0x2944('0x35')](handleEntityNotFound(_0x23ce6e,null))[_0x2944('0x35')](function(_0x1210c8){if(_0x1210c8){_0x5add42=_0x1210c8[_0x2944('0x36')]({'plain':!![]});_0x3e2461['model']=_[_0x2944('0x44')](db[_0x2944('0x67')][_0x2944('0x40')]);_0x3e2461[_0x2944('0x43')]=_[_0x2944('0x44')](_0x137813[_0x2944('0x43')]);_0x3e2461[_0x2944('0x45')]=_[_0x2944('0x46')](_0x3e2461[_0x2944('0x42')],_0x3e2461[_0x2944('0x43')]);_0x2f0509[_0x2944('0x47')]=_['intersection'](_0x3e2461[_0x2944('0x42')],qs[_0x2944('0x48')](_0x137813[_0x2944('0x43')]['fields']));_0x2f0509['attributes']=_0x2f0509[_0x2944('0x47')][_0x2944('0x49')]?_0x2f0509[_0x2944('0x47')]:_0x3e2461['model'];if(!_0x137813[_0x2944('0x43')][_0x2944('0x4a')]('nolimit')){_0x2f0509['limit']=qs[_0x2944('0x2f')](_0x137813[_0x2944('0x43')]['limit']);_0x2f0509[_0x2944('0x2d')]=qs[_0x2944('0x2d')](_0x137813['query']['offset']);}_0x2f0509['order']=qs[_0x2944('0x4d')](_0x137813[_0x2944('0x43')][_0x2944('0x4d')]);_0x2f0509[_0x2944('0x4e')]=qs['filters'](_[_0x2944('0x4f')](_0x137813[_0x2944('0x43')],_0x3e2461[_0x2944('0x45')]));_0x2f0509[_0x2944('0x4e')][_0x2944('0x68')]=_0x1210c8['id'];if(_0x137813[_0x2944('0x43')][_0x2944('0x50')]){_0x2f0509[_0x2944('0x4e')]=_[_0x2944('0x51')](_0x2f0509['where'],{'$or':_['map'](_0x2f0509[_0x2944('0x47')],function(_0x4c6d3e){var _0x123ea7={};_0x123ea7[_0x4c6d3e]={'$like':'%'+_0x137813[_0x2944('0x43')][_0x2944('0x50')]+'%'};return _0x123ea7;})});}_0x2f0509=_['merge']({},_0x2f0509,_0x137813[_0x2944('0x69')]);return db['UserChatQueue'][_0x2944('0x56')](_0x2f0509);}})[_0x2944('0x35')](function(_0x45a7e0){if(_0x45a7e0){return db['User'][_0x2944('0x6a')]({'where':{'id':_[_0x2944('0x52')](_0x45a7e0,_0x2944('0x6b')),'role':_0x2944('0x6c')},'attributes':['id','name',_0x2944('0x6d'),'updatedAt',_0x2944('0x6e')]});}})[_0x2944('0x35')](function(_0x232c1a){if(_0x232c1a){return{'count':_0x232c1a['count'],'rows':_[_0x2944('0x52')](_0x232c1a[_0x2944('0x57')],function(_0x288356){return{'membername':_0x288356['name'],'UserId':_0x288356['id'],'queue_name':_0x5add42['name'],'ChatQueueId':_0x5add42['id'],'interface':util[_0x2944('0x6f')]('%s/%s',_0x2944('0x70'),_0x288356[_0x2944('0x3c')]),'penalty':0x0,'paused':_0x288356[_0x2944('0x6d')],'createdAt':_0x288356[_0x2944('0x6e')],'updatedAt':_0x288356['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2944('0x35')](respondWithFilteredResult(_0x23ce6e,_0x2f0509))['catch'](handleError(_0x23ce6e,null));};exports[_0x2944('0x71')]=function(_0x2e5f1b,_0x49034d,_0x5df701){var _0xb61f59={};var _0x4b7cd0={};var _0x4a854b;var _0x4ea74c;return db[_0x2944('0x3f')][_0x2944('0x66')]({'where':{'id':_0x2e5f1b[_0x2944('0x64')]['id']}})[_0x2944('0x35')](handleEntityNotFound(_0x49034d,null))[_0x2944('0x35')](function(_0x2a307c){if(_0x2a307c){_0x4a854b=_0x2a307c;_0x4b7cd0[_0x2944('0x42')]=_[_0x2944('0x44')](db[_0x2944('0x72')][_0x2944('0x40')]);_0x4b7cd0['query']=_['keys'](_0x2e5f1b[_0x2944('0x43')]);_0x4b7cd0[_0x2944('0x45')]=_[_0x2944('0x46')](_0x4b7cd0[_0x2944('0x42')],_0x4b7cd0[_0x2944('0x43')]);_0xb61f59[_0x2944('0x47')]=_['intersection'](_0x4b7cd0[_0x2944('0x42')],qs['fields'](_0x2e5f1b[_0x2944('0x43')][_0x2944('0x48')]));_0xb61f59[_0x2944('0x47')]=_0xb61f59[_0x2944('0x47')][_0x2944('0x49')]?_0xb61f59[_0x2944('0x47')]:_0x4b7cd0['model'];_0xb61f59[_0x2944('0x4c')]=qs['sort'](_0x2e5f1b['query'][_0x2944('0x4d')]);_0xb61f59[_0x2944('0x4e')]=qs[_0x2944('0x45')](_[_0x2944('0x4f')](_0x2e5f1b[_0x2944('0x43')],_0x4b7cd0[_0x2944('0x45')]));if(_0x2e5f1b[_0x2944('0x43')][_0x2944('0x50')]){_0xb61f59[_0x2944('0x4e')]=_[_0x2944('0x51')](_0xb61f59[_0x2944('0x4e')],{'$or':_[_0x2944('0x52')](_0xb61f59['attributes'],function(_0x36838b){var _0x36064d={};_0x36064d[_0x36838b]={'$like':'%'+_0x2e5f1b['query'][_0x2944('0x50')]+'%'};return _0x36064d;})});}_0xb61f59=_[_0x2944('0x51')]({},_0xb61f59,_0x2e5f1b['options']);return _0x4a854b[_0x2944('0x71')](_0xb61f59);}})['then'](function(_0x2db85c){if(_0x2db85c){_0x4ea74c=_0x2db85c[_0x2944('0x49')];if(!_0x2e5f1b[_0x2944('0x43')][_0x2944('0x4a')](_0x2944('0x4b'))){_0xb61f59['limit']=qs[_0x2944('0x2f')](_0x2e5f1b['query'][_0x2944('0x2f')]);_0xb61f59['offset']=qs[_0x2944('0x2d')](_0x2e5f1b[_0x2944('0x43')][_0x2944('0x2d')]);}return _0x4a854b[_0x2944('0x71')](_0xb61f59);}})[_0x2944('0x35')](function(_0x5f4329){if(_0x5f4329){return _0x5f4329?{'count':_0x4ea74c,'rows':_0x5f4329}:null;}})[_0x2944('0x35')](respondWithResult(_0x49034d,null))[_0x2944('0x29')](handleError(_0x49034d,null));};exports['addTeams']=function(_0x475823,_0x2a3699,_0x3ca584){var _0x46d322=_0x475823[_0x2944('0x5c')]['ids'];return db['Team']['findAll']({'where':{'id':_0x46d322},'attributes':['id'],'include':[{'model':db[_0x2944('0x73')],'as':_0x2944('0x74'),'attributes':['id',_0x2944('0x3c'),_0x2944('0x75'),_0x2944('0x76'),_0x2944('0x77')],'raw':!![]}]})['then'](function(_0x39becc){if(_0x39becc){var _0x33d0ef=_[_0x2944('0x78')](_0x39becc,function(_0x54ba7d){var _0x421d07=_0x54ba7d[_0x2944('0x36')]({'plain':!![]});return _0x421d07[_0x2944('0x74')];});return db[_0x2944('0x3f')][_0x2944('0x5a')]({'where':{'id':_0x475823[_0x2944('0x64')]['id']}})[_0x2944('0x35')](function(_0x2411d1){return db[_0x2944('0x79')][_0x2944('0x7a')](function(_0xcdcd2){return _0x2411d1[_0x2944('0x7b')](_0x46d322,{'transaction':_0xcdcd2})[_0x2944('0x35')](function(){return BPromise[_0x2944('0x7c')](_0x33d0ef,function(_0x2f3ba7){return db[_0x2944('0x67')][_0x2944('0x7d')]({'where':{'UserId':_0x2f3ba7['id'],'ChatQueueId':_0x475823[_0x2944('0x64')]['id']},'transaction':_0xcdcd2});});})[_0x2944('0x35')](function(){_0x33d0ef['forEach'](function(_0x18ca26){socket[_0x2944('0x7e')](_0x2944('0x7f'),{'UserId':_0x18ca26['id'],'ChatQueueId':_0x2411d1['id']});});});});});}})[_0x2944('0x35')](respondWithStatusCode(_0x2a3699,null))[_0x2944('0x29')](handleError(_0x2a3699,null));};exports['removeTeams']=function(_0x42d000,_0x30255f,_0x52480d){return db[_0x2944('0x72')]['findAll']({'where':{'id':_0x42d000[_0x2944('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2944('0x73')],'as':_0x2944('0x74'),'attributes':['id'],'raw':!![]}]})[_0x2944('0x35')](handleEntityNotFound(_0x30255f,null))[_0x2944('0x35')](function(_0x3a16c4){var _0x3fc4aa=_[_0x2944('0x52')](_0x3a16c4,'id');var _0x526e7b=[];var _0x59d0d9=[];var _0x59d09f=squel['select']();_0x59d09f[_0x2944('0x80')](_0x2944('0x81'))[_0x2944('0x82')](_0x2944('0x83'),'tq')[_0x2944('0x84')]('user_has_teams','ut',_0x2944('0x85'))[_0x2944('0x4e')](_0x2944('0x86'),_0x42d000[_0x2944('0x64')]['id']);for(var _0x17fa8d=0x0;_0x17fa8d<_0x3a16c4[_0x2944('0x49')];_0x17fa8d+=0x1){let _0x576667=_0x3a16c4[_0x17fa8d];for(var _0x5e1c8b=0x0;_0x5e1c8b<_0x576667[_0x2944('0x74')][_0x2944('0x49')];_0x5e1c8b+=0x1){let _0x591d56=_0x576667[_0x2944('0x74')][_0x5e1c8b];var _0x5d12b8=_0x59d09f[_0x2944('0x87')]();_0x5d12b8[_0x2944('0x4e')]('ut.UserId\x20=\x20?',_0x591d56['id']);_0x59d0d9[_0x2944('0x88')](db['sequelize'][_0x2944('0x43')](_0x5d12b8[_0x2944('0x89')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x2944('0x35')](function(_0x261d1c){if(_0x261d1c['length']===0x1){return _0x591d56['id'];}else{var _0xfebd0=_[_0x2944('0x8a')](_['map'](_0x261d1c,_0x2944('0x8b')),function(_0x3ab758){return _[_0x2944('0x8c')](_0x3fc4aa,_0x3ab758);});if(_0xfebd0){return _0x591d56['id'];}}}));}}return BPromise[_0x2944('0x8d')](_0x59d0d9)['then'](function(_0x2b2021){_0x526e7b=_(_0x526e7b)[_0x2944('0x8e')](_0x2b2021)[_0x2944('0x8f')]()[_0x2944('0x90')]();return db[_0x2944('0x3f')][_0x2944('0x5a')]({'where':{'id':_0x42d000[_0x2944('0x64')]['id']}})['then'](function(_0xae4aac){return db[_0x2944('0x79')][_0x2944('0x7a')](function(_0x31d32d){return _0xae4aac[_0x2944('0x91')](_0x42d000[_0x2944('0x43')][_0x2944('0x92')],{'transaction':_0x31d32d})[_0x2944('0x35')](function(){if(!_[_0x2944('0x93')](_0x526e7b)){return _0xae4aac['removeAgents'](_0x526e7b,{'transaction':_0x31d32d});}})[_0x2944('0x35')](function(){_0x526e7b[_0x2944('0x94')](function(_0x2f3304){socket[_0x2944('0x7e')](_0x2944('0x95'),{'UserId':_0x2f3304,'ChatQueueId':_0xae4aac['id']});});});});});});})[_0x2944('0x35')](respondWithStatusCode(_0x30255f,null))[_0x2944('0x29')](handleError(_0x30255f,null));};exports[_0x2944('0x96')]=function(_0x4d5712,_0x42850b,_0x1d1a47){return db[_0x2944('0x3f')][_0x2944('0x5a')]({'where':{'id':_0x4d5712[_0x2944('0x64')]['id']}})[_0x2944('0x35')](handleEntityNotFound(_0x42850b,null))['then'](function(_0x4f2829){if(_0x4f2829){return _0x4f2829['addAgents'](_0x4d5712[_0x2944('0x5c')][_0x2944('0x92')],_[_0x2944('0x97')](_0x4d5712[_0x2944('0x5c')],['ids','id'])||{})[_0x2944('0x98')](function(_0x6f409a){for(var _0x368a5e=0x0;_0x368a5e<_0x4d5712[_0x2944('0x5c')][_0x2944('0x92')][_0x2944('0x49')];_0x368a5e+=0x1){socket[_0x2944('0x7e')](_0x2944('0x7f'),{'UserId':Number(_0x4d5712['body']['ids'][_0x368a5e]),'ChatQueueId':Number(_0x4d5712[_0x2944('0x64')]['id'])});}return _0x6f409a;});}})[_0x2944('0x35')](respondWithResult(_0x42850b,null))['catch'](handleError(_0x42850b,null));};exports[_0x2944('0x99')]=function(_0x516769,_0x226286,_0x134230){return db['ChatQueue']['find']({'where':{'id':_0x516769['params']['id']}})[_0x2944('0x35')](handleEntityNotFound(_0x226286,null))['then'](function(_0x3dc605){if(_0x3dc605){return _0x3dc605[_0x2944('0x99')](_0x516769[_0x2944('0x43')]['ids'])[_0x2944('0x35')](function(){if(_[_0x2944('0x9a')](_0x516769[_0x2944('0x43')][_0x2944('0x92')])){for(var _0xf07e0d=0x0;_0xf07e0d<_0x516769[_0x2944('0x43')][_0x2944('0x92')][_0x2944('0x49')];_0xf07e0d+=0x1){socket[_0x2944('0x7e')](_0x2944('0x95'),{'UserId':Number(_0x516769[_0x2944('0x43')][_0x2944('0x92')][_0xf07e0d]),'ChatQueueId':Number(_0x516769[_0x2944('0x64')]['id'])});}}else{socket[_0x2944('0x7e')](_0x2944('0x95'),{'UserId':Number(_0x516769[_0x2944('0x43')]['ids']),'ChatQueueId':Number(_0x516769[_0x2944('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x226286,null))[_0x2944('0x29')](handleError(_0x226286,null));};exports[_0x2944('0x9b')]=function(_0x499d06,_0x482692,_0x32591b){var _0x2f30e7={};var _0x37fdaa={};var _0x4aab16;var _0x591f83;return db[_0x2944('0x3f')][_0x2944('0x66')]({'where':{'id':_0x499d06[_0x2944('0x64')]['id']}})['then'](handleEntityNotFound(_0x482692,null))['then'](function(_0x2e79f4){if(_0x2e79f4){_0x4aab16=_0x2e79f4;_0x37fdaa['model']=_['keys'](db[_0x2944('0x73')][_0x2944('0x40')]);_0x37fdaa[_0x2944('0x43')]=_[_0x2944('0x44')](_0x499d06[_0x2944('0x43')]);_0x37fdaa['filters']=_[_0x2944('0x46')](_0x37fdaa[_0x2944('0x42')],_0x37fdaa[_0x2944('0x43')]);_0x2f30e7[_0x2944('0x47')]=_[_0x2944('0x46')](_0x37fdaa['model'],qs['fields'](_0x499d06['query'][_0x2944('0x48')]));_0x2f30e7[_0x2944('0x47')]=_0x2f30e7[_0x2944('0x47')][_0x2944('0x49')]?_0x2f30e7[_0x2944('0x47')]:_0x37fdaa[_0x2944('0x42')];_0x2f30e7[_0x2944('0x4c')]=qs[_0x2944('0x4d')](_0x499d06[_0x2944('0x43')][_0x2944('0x4d')]);_0x2f30e7['where']=qs[_0x2944('0x45')](_[_0x2944('0x4f')](_0x499d06['query'],_0x37fdaa[_0x2944('0x45')]));if(_0x499d06[_0x2944('0x43')][_0x2944('0x50')]){_0x2f30e7['where']=_[_0x2944('0x51')](_0x2f30e7[_0x2944('0x4e')],{'$or':_[_0x2944('0x52')](_0x2f30e7[_0x2944('0x47')],function(_0x3c37c3){var _0x2f1d85={};_0x2f1d85[_0x3c37c3]={'$like':'%'+_0x499d06[_0x2944('0x43')]['filter']+'%'};return _0x2f1d85;})});}_0x2f30e7=_[_0x2944('0x51')]({},_0x2f30e7,_0x499d06['options']);return _0x4aab16['getAgents'](_0x2f30e7);}})[_0x2944('0x35')](function(_0x193174){if(_0x193174){_0x591f83=_0x193174['length'];if(!_0x499d06[_0x2944('0x43')][_0x2944('0x4a')](_0x2944('0x4b'))){_0x2f30e7['limit']=qs[_0x2944('0x2f')](_0x499d06[_0x2944('0x43')][_0x2944('0x2f')]);_0x2f30e7['offset']=qs[_0x2944('0x2d')](_0x499d06[_0x2944('0x43')][_0x2944('0x2d')]);}return _0x4aab16[_0x2944('0x9b')](_0x2f30e7);}})[_0x2944('0x35')](function(_0x4564e6){if(_0x4564e6){return _0x4564e6?{'count':_0x591f83,'rows':_0x4564e6}:null;}})[_0x2944('0x35')](respondWithResult(_0x482692,null))[_0x2944('0x29')](handleError(_0x482692,null));};
\ No newline at end of file
+var _0x9d55=['%s/%s','SIP','getTeams','rawAttributes','addTeams','ids','online','interface','Agents','sequelize','transaction','findOrCreate','userChatQueue:save','removeTeams','field','tq.TeamId','join','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','ChatQueue','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','includeAll','rows','show','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format'];(function(_0x96975e,_0x6e49dc){var _0x18198a=function(_0x8d8269){while(--_0x8d8269){_0x96975e['push'](_0x96975e['shift']());}};_0x18198a(++_0x6e49dc);}(_0x9d55,0xb2));var _0x59d5=function(_0x2a9964,_0x4a7004){_0x2a9964=_0x2a9964-0x0;var _0x91dec2=_0x9d55[_0x2a9964];return _0x91dec2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x59d5('0x0'));var moment=require(_0x59d5('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x59d5('0x2'));var util=require('util');var path=require(_0x59d5('0x3'));var sox=require(_0x59d5('0x4'));var csv=require(_0x59d5('0x5'));var ejs=require(_0x59d5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59d5('0x7'));var squel=require('squel');var crypto=require(_0x59d5('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x59d5('0x9'));var toCsv=require(_0x59d5('0x5'));var querystring=require(_0x59d5('0xa'));var Papa=require(_0x59d5('0xb'));var Redis=require(_0x59d5('0xc'));var authService=require(_0x59d5('0xd'));var qs=require(_0x59d5('0xe'));var as=require(_0x59d5('0xf'));var hardwareService=require(_0x59d5('0x10'));var logger=require(_0x59d5('0x11'))(_0x59d5('0x12'));var utils=require(_0x59d5('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x59d5('0x14'))['db'];config['redis']=_[_0x59d5('0x15')](config[_0x59d5('0x16')],{'host':_0x59d5('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x59d5('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x59d5('0x19')][_0x59d5('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x528279,_0x424a99,_0x256d73,_0x250472){return new BPromise(function(_0x1e454e,_0x47ceb2){var _0x5d2d63=_0x250472||client;return _0x5d2d63[_0x59d5('0x1b')](_0x528279,_0x256d73)[_0x59d5('0x1c')](function(_0x2bd2ba){logger[_0x59d5('0x1d')](_0x59d5('0x1e'),_0x424a99,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x424a99,_0x59d5('0x1f'),JSON[_0x59d5('0x20')](_0x2bd2ba));if(_0x2bd2ba[_0x59d5('0x21')]){if(_0x2bd2ba[_0x59d5('0x21')]['code']===0x1f4){logger['error'](_0x59d5('0x1e'),_0x424a99,_0x2bd2ba['error']['message']);return _0x47ceb2(_0x2bd2ba['error'][_0x59d5('0x22')]);}logger[_0x59d5('0x21')](_0x59d5('0x1e'),_0x424a99,_0x2bd2ba['error']['message']);return _0x1e454e(_0x2bd2ba[_0x59d5('0x21')]['message']);}else{logger[_0x59d5('0x1d')](_0x59d5('0x1e'),_0x424a99,_0x59d5('0x1f'));_0x1e454e(_0x2bd2ba[_0x59d5('0x23')][_0x59d5('0x22')]);}})[_0x59d5('0x24')](function(_0x56b7eb){logger['error']('ChatQueue,\x20%s,\x20%s',_0x424a99,_0x56b7eb);_0x47ceb2(_0x56b7eb);});});}function respondWithStatusCode(_0x5e4eeb,_0x114a17){_0x114a17=_0x114a17||0xcc;return function(_0x32de2c){if(_0x32de2c){return _0x5e4eeb['sendStatus'](_0x114a17);}return _0x5e4eeb[_0x59d5('0x25')](_0x114a17)[_0x59d5('0x26')]();};}function respondWithResult(_0x3aff3b,_0x183999){_0x183999=_0x183999||0xc8;return function(_0x28431e){if(_0x28431e){return _0x3aff3b[_0x59d5('0x25')](_0x183999)['json'](_0x28431e);}};}function respondWithFilteredResult(_0x150c9a,_0x16127e){return function(_0x126c0e){if(_0x126c0e){var _0x3a09ea=typeof _0x16127e[_0x59d5('0x27')]===_0x59d5('0x28')&&typeof _0x16127e[_0x59d5('0x29')]===_0x59d5('0x28');var _0x761c93=_0x126c0e[_0x59d5('0x2a')];var _0x30fabc=_0x3a09ea?0x0:_0x16127e['offset'];var _0x1eff74=_0x3a09ea?_0x126c0e[_0x59d5('0x2a')]:_0x16127e['offset']+_0x16127e[_0x59d5('0x29')];var _0x43f663;if(_0x1eff74>=_0x761c93){_0x1eff74=_0x761c93;_0x43f663=0xc8;}else{_0x43f663=0xce;}_0x150c9a[_0x59d5('0x25')](_0x43f663);return _0x150c9a[_0x59d5('0x2b')](_0x59d5('0x2c'),_0x30fabc+'-'+_0x1eff74+'/'+_0x761c93)[_0x59d5('0x2d')](_0x126c0e);}return null;};}function patchUpdates(_0x5ad2aa){return function(_0x5e5c00){try{jsonpatch[_0x59d5('0x2e')](_0x5e5c00,_0x5ad2aa,!![]);}catch(_0x475d06){return BPromise[_0x59d5('0x2f')](_0x475d06);}return _0x5e5c00[_0x59d5('0x30')]();};}function saveUpdates(_0x492d7a,_0x8433fc){return function(_0x380b4a){if(_0x380b4a){return _0x380b4a[_0x59d5('0x31')](_0x492d7a)[_0x59d5('0x1c')](function(_0x50ef24){return _0x50ef24;});}return null;};}function removeEntity(_0x3eaeaf,_0x42b87b){return function(_0x810153){if(_0x810153){return _0x810153[_0x59d5('0x32')]()[_0x59d5('0x1c')](function(){var _0x46924c=_0x810153[_0x59d5('0x33')]({'plain':!![]});var _0x3f8caa=_0x59d5('0x34');return db[_0x59d5('0x35')][_0x59d5('0x32')]({'where':{'type':_0x3f8caa,'resourceId':_0x46924c['id']}})[_0x59d5('0x1c')](function(){return _0x810153;});})['then'](function(){_0x3eaeaf['status'](0xcc)[_0x59d5('0x26')]();});}};}function handleEntityNotFound(_0x4e452d,_0x347ec5){return function(_0xa7773c){if(!_0xa7773c){_0x4e452d[_0x59d5('0x36')](0x194);}return _0xa7773c;};}function handleError(_0x4edca0,_0x1390eb){_0x1390eb=_0x1390eb||0x1f4;return function(_0x1f45c2){logger[_0x59d5('0x21')](_0x1f45c2[_0x59d5('0x37')]);if(_0x1f45c2[_0x59d5('0x38')]){delete _0x1f45c2[_0x59d5('0x38')];}_0x4edca0['status'](_0x1390eb)[_0x59d5('0x39')](_0x1f45c2);};}exports[_0x59d5('0x3a')]=function(_0x3827dc,_0x463f7f){var _0x585e86={},_0x316e0f={},_0x5090f3={'count':0x0,'rows':[]};var _0x57009b=_['map'](db[_0x59d5('0x3b')]['rawAttributes'],function(_0x752294){return{'name':_0x752294[_0x59d5('0x3c')],'type':_0x752294[_0x59d5('0x3d')][_0x59d5('0x3e')]};});_0x316e0f[_0x59d5('0x3f')]=_[_0x59d5('0x40')](_0x57009b,'name');_0x316e0f[_0x59d5('0x41')]=_[_0x59d5('0x42')](_0x3827dc[_0x59d5('0x41')]);_0x316e0f['filters']=_['intersection'](_0x316e0f[_0x59d5('0x3f')],_0x316e0f[_0x59d5('0x41')]);_0x585e86[_0x59d5('0x43')]=_[_0x59d5('0x44')](_0x316e0f[_0x59d5('0x3f')],qs[_0x59d5('0x45')](_0x3827dc[_0x59d5('0x41')][_0x59d5('0x45')]));_0x585e86['attributes']=_0x585e86[_0x59d5('0x43')]['length']?_0x585e86[_0x59d5('0x43')]:_0x316e0f['model'];if(!_0x3827dc[_0x59d5('0x41')][_0x59d5('0x46')](_0x59d5('0x47'))){_0x585e86[_0x59d5('0x29')]=qs['limit'](_0x3827dc[_0x59d5('0x41')]['limit']);_0x585e86[_0x59d5('0x27')]=qs[_0x59d5('0x27')](_0x3827dc[_0x59d5('0x41')]['offset']);}_0x585e86[_0x59d5('0x48')]=qs[_0x59d5('0x49')](_0x3827dc['query'][_0x59d5('0x49')]);_0x585e86[_0x59d5('0x4a')]=qs['filters'](_[_0x59d5('0x4b')](_0x3827dc['query'],_0x316e0f[_0x59d5('0x4c')]),_0x57009b);if(_0x3827dc[_0x59d5('0x41')][_0x59d5('0x4d')]){_0x585e86[_0x59d5('0x4a')]=_['merge'](_0x585e86['where'],{'$or':_[_0x59d5('0x40')](_0x57009b,function(_0x236847){if(_0x236847['type']!==_0x59d5('0x4e')){var _0x189b2f={};_0x189b2f[_0x236847[_0x59d5('0x38')]]={'$like':'%'+_0x3827dc[_0x59d5('0x41')]['filter']+'%'};return _0x189b2f;}})});}_0x585e86=_[_0x59d5('0x4f')]({},_0x585e86,_0x3827dc['options']);var _0x316da4={'where':_0x585e86[_0x59d5('0x4a')]};return db[_0x59d5('0x3b')][_0x59d5('0x2a')](_0x316da4)['then'](function(_0x41b9cf){_0x5090f3[_0x59d5('0x2a')]=_0x41b9cf;if(_0x3827dc[_0x59d5('0x41')][_0x59d5('0x50')]){_0x585e86['include']=[{'all':!![]}];}return db[_0x59d5('0x3b')]['findAll'](_0x585e86);})[_0x59d5('0x1c')](function(_0x15b823){_0x5090f3[_0x59d5('0x51')]=_0x15b823;return _0x5090f3;})[_0x59d5('0x1c')](respondWithFilteredResult(_0x463f7f,_0x585e86))[_0x59d5('0x24')](handleError(_0x463f7f,null));};exports[_0x59d5('0x52')]=function(_0x20b424,_0x536e11){var _0x20c1e9={'raw':!![],'where':{'id':_0x20b424['params']['id']}},_0x5a102b={};_0x5a102b[_0x59d5('0x3f')]=_[_0x59d5('0x42')](db[_0x59d5('0x3b')]['rawAttributes']);_0x5a102b['query']=_[_0x59d5('0x42')](_0x20b424[_0x59d5('0x41')]);_0x5a102b[_0x59d5('0x4c')]=_[_0x59d5('0x44')](_0x5a102b[_0x59d5('0x3f')],_0x5a102b[_0x59d5('0x41')]);_0x20c1e9[_0x59d5('0x43')]=_['intersection'](_0x5a102b[_0x59d5('0x3f')],qs['fields'](_0x20b424[_0x59d5('0x41')]['fields']));_0x20c1e9[_0x59d5('0x43')]=_0x20c1e9['attributes'][_0x59d5('0x53')]?_0x20c1e9['attributes']:_0x5a102b[_0x59d5('0x3f')];if(_0x20b424[_0x59d5('0x41')]['includeAll']){_0x20c1e9[_0x59d5('0x54')]=[{'all':!![]}];}_0x20c1e9=_[_0x59d5('0x4f')]({},_0x20c1e9,_0x20b424[_0x59d5('0x55')]);return db[_0x59d5('0x3b')][_0x59d5('0x56')](_0x20c1e9)['then'](handleEntityNotFound(_0x536e11,null))[_0x59d5('0x1c')](respondWithResult(_0x536e11,null))[_0x59d5('0x24')](handleError(_0x536e11,null));};exports[_0x59d5('0x57')]=function(_0x2ee987,_0x1c060f){return db[_0x59d5('0x3b')][_0x59d5('0x57')](_0x2ee987[_0x59d5('0x58')],{})[_0x59d5('0x1c')](function(_0x833069){var _0xb8f27b=_0x2ee987[_0x59d5('0x59')][_0x59d5('0x33')]({'plain':!![]});if(!_0xb8f27b)throw new Error(_0x59d5('0x5a'));if(_0xb8f27b['role']===_0x59d5('0x59')){var _0x2e30a7=_0x833069['get']({'plain':!![]});var _0x4f14f8=_0x59d5('0x34');return db[_0x59d5('0x5b')][_0x59d5('0x56')]({'where':{'name':_0x4f14f8,'userProfileId':_0xb8f27b[_0x59d5('0x5c')]},'raw':!![]})['then'](function(_0x1c7cdc){if(_0x1c7cdc&&_0x1c7cdc[_0x59d5('0x5d')]===0x0){return db[_0x59d5('0x35')][_0x59d5('0x57')]({'name':_0x2e30a7['name'],'resourceId':_0x2e30a7['id'],'type':_0x1c7cdc['name'],'sectionId':_0x1c7cdc['id']},{})[_0x59d5('0x1c')](function(){return _0x833069;});}else{return _0x833069;}})[_0x59d5('0x24')](function(_0x24d72a){logger[_0x59d5('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24d72a);throw _0x24d72a;});}return _0x833069;})[_0x59d5('0x1c')](respondWithResult(_0x1c060f,0xc9))[_0x59d5('0x24')](handleError(_0x1c060f,null));};exports[_0x59d5('0x31')]=function(_0x2bc914,_0x4ec1b7){if(_0x2bc914['body']['id']){delete _0x2bc914[_0x59d5('0x58')]['id'];}return db[_0x59d5('0x3b')]['find']({'where':{'id':_0x2bc914[_0x59d5('0x5e')]['id']}})[_0x59d5('0x1c')](handleEntityNotFound(_0x4ec1b7,null))[_0x59d5('0x1c')](saveUpdates(_0x2bc914[_0x59d5('0x58')],null))['then'](respondWithResult(_0x4ec1b7,null))[_0x59d5('0x24')](handleError(_0x4ec1b7,null));};exports[_0x59d5('0x32')]=function(_0x169075,_0x454a58){return db[_0x59d5('0x3b')][_0x59d5('0x56')]({'where':{'id':_0x169075[_0x59d5('0x5e')]['id']}})['then'](handleEntityNotFound(_0x454a58,null))['then'](removeEntity(_0x454a58,null))[_0x59d5('0x24')](handleError(_0x454a58,null));};exports['describe']=function(_0x678691,_0x2b3541){return db[_0x59d5('0x3b')][_0x59d5('0x5f')]()[_0x59d5('0x1c')](respondWithResult(_0x2b3541,null))['catch'](handleError(_0x2b3541,null));};exports[_0x59d5('0x60')]=function(_0xb8d0a0,_0x47ed20,_0x155455){var _0x3e843f={'raw':!![],'where':{}},_0x3ff54e={},_0x41a140;return db[_0x59d5('0x3b')][_0x59d5('0x61')]({'where':{'id':_0xb8d0a0['params']['id']}})[_0x59d5('0x1c')](handleEntityNotFound(_0x47ed20,null))['then'](function(_0x2a1766){if(_0x2a1766){_0x41a140=_0x2a1766[_0x59d5('0x33')]({'plain':!![]});_0x3ff54e[_0x59d5('0x3f')]=_[_0x59d5('0x42')](db[_0x59d5('0x62')]['rawAttributes']);_0x3ff54e['query']=_[_0x59d5('0x42')](_0xb8d0a0[_0x59d5('0x41')]);_0x3ff54e['filters']=_[_0x59d5('0x44')](_0x3ff54e['model'],_0x3ff54e[_0x59d5('0x41')]);_0x3e843f[_0x59d5('0x43')]=_[_0x59d5('0x44')](_0x3ff54e['model'],qs[_0x59d5('0x45')](_0xb8d0a0[_0x59d5('0x41')][_0x59d5('0x45')]));_0x3e843f[_0x59d5('0x43')]=_0x3e843f[_0x59d5('0x43')][_0x59d5('0x53')]?_0x3e843f[_0x59d5('0x43')]:_0x3ff54e[_0x59d5('0x3f')];if(!_0xb8d0a0[_0x59d5('0x41')][_0x59d5('0x46')](_0x59d5('0x47'))){_0x3e843f[_0x59d5('0x29')]=qs[_0x59d5('0x29')](_0xb8d0a0[_0x59d5('0x41')][_0x59d5('0x29')]);_0x3e843f[_0x59d5('0x27')]=qs['offset'](_0xb8d0a0[_0x59d5('0x41')]['offset']);}_0x3e843f[_0x59d5('0x48')]=qs['sort'](_0xb8d0a0['query'][_0x59d5('0x49')]);_0x3e843f[_0x59d5('0x4a')]=qs[_0x59d5('0x4c')](_[_0x59d5('0x4b')](_0xb8d0a0[_0x59d5('0x41')],_0x3ff54e[_0x59d5('0x4c')]));_0x3e843f[_0x59d5('0x4a')]['ChatQueueId']=_0x2a1766['id'];if(_0xb8d0a0[_0x59d5('0x41')][_0x59d5('0x4d')]){_0x3e843f[_0x59d5('0x4a')]=_[_0x59d5('0x4f')](_0x3e843f[_0x59d5('0x4a')],{'$or':_[_0x59d5('0x40')](_0x3e843f['attributes'],function(_0x2cb959){var _0x197b99={};_0x197b99[_0x2cb959]={'$like':'%'+_0xb8d0a0[_0x59d5('0x41')]['filter']+'%'};return _0x197b99;})});}_0x3e843f=_['merge']({},_0x3e843f,_0xb8d0a0[_0x59d5('0x55')]);return db['UserChatQueue'][_0x59d5('0x63')](_0x3e843f);}})[_0x59d5('0x1c')](function(_0x1b53f6){if(_0x1b53f6){return db[_0x59d5('0x64')][_0x59d5('0x65')]({'where':{'id':_['map'](_0x1b53f6,_0x59d5('0x66')),'role':_0x59d5('0x67')},'attributes':['id','name',_0x59d5('0x68'),_0x59d5('0x69'),_0x59d5('0x6a')]});}})[_0x59d5('0x1c')](function(_0x1ae2ac){if(_0x1ae2ac){return{'count':_0x1ae2ac[_0x59d5('0x2a')],'rows':_[_0x59d5('0x40')](_0x1ae2ac['rows'],function(_0x3e383f){return{'membername':_0x3e383f[_0x59d5('0x38')],'UserId':_0x3e383f['id'],'queue_name':_0x41a140[_0x59d5('0x38')],'ChatQueueId':_0x41a140['id'],'interface':util[_0x59d5('0x6b')](_0x59d5('0x6c'),_0x59d5('0x6d'),_0x3e383f[_0x59d5('0x38')]),'penalty':0x0,'paused':_0x3e383f[_0x59d5('0x68')],'createdAt':_0x3e383f[_0x59d5('0x6a')],'updatedAt':_0x3e383f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x59d5('0x1c')](respondWithFilteredResult(_0x47ed20,_0x3e843f))[_0x59d5('0x24')](handleError(_0x47ed20,null));};exports[_0x59d5('0x6e')]=function(_0xe3dbe6,_0x4d7d58,_0x14157a){var _0x4066a1={};var _0x3a68cf={};var _0x4c1117;var _0x554064;return db[_0x59d5('0x3b')]['findOne']({'where':{'id':_0xe3dbe6[_0x59d5('0x5e')]['id']}})[_0x59d5('0x1c')](handleEntityNotFound(_0x4d7d58,null))[_0x59d5('0x1c')](function(_0x3363a1){if(_0x3363a1){_0x4c1117=_0x3363a1;_0x3a68cf[_0x59d5('0x3f')]=_[_0x59d5('0x42')](db['Team'][_0x59d5('0x6f')]);_0x3a68cf['query']=_[_0x59d5('0x42')](_0xe3dbe6[_0x59d5('0x41')]);_0x3a68cf[_0x59d5('0x4c')]=_[_0x59d5('0x44')](_0x3a68cf['model'],_0x3a68cf[_0x59d5('0x41')]);_0x4066a1['attributes']=_[_0x59d5('0x44')](_0x3a68cf[_0x59d5('0x3f')],qs[_0x59d5('0x45')](_0xe3dbe6['query'][_0x59d5('0x45')]));_0x4066a1['attributes']=_0x4066a1['attributes']['length']?_0x4066a1[_0x59d5('0x43')]:_0x3a68cf[_0x59d5('0x3f')];_0x4066a1[_0x59d5('0x48')]=qs[_0x59d5('0x49')](_0xe3dbe6[_0x59d5('0x41')][_0x59d5('0x49')]);_0x4066a1[_0x59d5('0x4a')]=qs[_0x59d5('0x4c')](_[_0x59d5('0x4b')](_0xe3dbe6[_0x59d5('0x41')],_0x3a68cf['filters']));if(_0xe3dbe6[_0x59d5('0x41')]['filter']){_0x4066a1[_0x59d5('0x4a')]=_[_0x59d5('0x4f')](_0x4066a1[_0x59d5('0x4a')],{'$or':_[_0x59d5('0x40')](_0x4066a1[_0x59d5('0x43')],function(_0x5eb6f5){var _0x4b230c={};_0x4b230c[_0x5eb6f5]={'$like':'%'+_0xe3dbe6[_0x59d5('0x41')][_0x59d5('0x4d')]+'%'};return _0x4b230c;})});}_0x4066a1=_[_0x59d5('0x4f')]({},_0x4066a1,_0xe3dbe6[_0x59d5('0x55')]);return _0x4c1117[_0x59d5('0x6e')](_0x4066a1);}})['then'](function(_0xc007d5){if(_0xc007d5){_0x554064=_0xc007d5[_0x59d5('0x53')];if(!_0xe3dbe6[_0x59d5('0x41')][_0x59d5('0x46')](_0x59d5('0x47'))){_0x4066a1['limit']=qs[_0x59d5('0x29')](_0xe3dbe6[_0x59d5('0x41')][_0x59d5('0x29')]);_0x4066a1[_0x59d5('0x27')]=qs['offset'](_0xe3dbe6[_0x59d5('0x41')][_0x59d5('0x27')]);}return _0x4c1117[_0x59d5('0x6e')](_0x4066a1);}})[_0x59d5('0x1c')](function(_0x165fb7){if(_0x165fb7){return _0x165fb7?{'count':_0x554064,'rows':_0x165fb7}:null;}})['then'](respondWithResult(_0x4d7d58,null))[_0x59d5('0x24')](handleError(_0x4d7d58,null));};exports[_0x59d5('0x70')]=function(_0x5d589e,_0x127c6a,_0x29e678){var _0x43d2fd=_0x5d589e[_0x59d5('0x58')][_0x59d5('0x71')];return db['Team'][_0x59d5('0x63')]({'where':{'id':_0x43d2fd},'attributes':['id'],'include':[{'model':db[_0x59d5('0x64')],'as':'Agents','attributes':['id',_0x59d5('0x38'),_0x59d5('0x72'),'voicePause',_0x59d5('0x73')],'raw':!![]}]})['then'](function(_0x322977){if(_0x322977){var _0x1686ef=_['flatMap'](_0x322977,function(_0x668755){var _0x42dc15=_0x668755[_0x59d5('0x33')]({'plain':!![]});return _0x42dc15[_0x59d5('0x74')];});return db['ChatQueue']['find']({'where':{'id':_0x5d589e[_0x59d5('0x5e')]['id']}})[_0x59d5('0x1c')](function(_0x4dc755){return db[_0x59d5('0x75')][_0x59d5('0x76')](function(_0x3c5fb6){return _0x4dc755['addTeams'](_0x43d2fd,{'transaction':_0x3c5fb6})[_0x59d5('0x1c')](function(){return BPromise['each'](_0x1686ef,function(_0x14bd7b){return db[_0x59d5('0x62')][_0x59d5('0x77')]({'where':{'UserId':_0x14bd7b['id'],'ChatQueueId':_0x5d589e[_0x59d5('0x5e')]['id']},'transaction':_0x3c5fb6});});})[_0x59d5('0x1c')](function(){_0x1686ef['forEach'](function(_0x8328fa){socket['emit'](_0x59d5('0x78'),{'UserId':_0x8328fa['id'],'ChatQueueId':_0x4dc755['id']});});});});});}})['then'](respondWithStatusCode(_0x127c6a,null))[_0x59d5('0x24')](handleError(_0x127c6a,null));};exports[_0x59d5('0x79')]=function(_0x5849be,_0x41ff2f,_0x3c79d2){return db['Team'][_0x59d5('0x63')]({'where':{'id':_0x5849be[_0x59d5('0x41')][_0x59d5('0x71')]},'attributes':['id'],'include':[{'model':db[_0x59d5('0x64')],'as':_0x59d5('0x74'),'attributes':['id'],'raw':!![]}]})[_0x59d5('0x1c')](handleEntityNotFound(_0x41ff2f,null))[_0x59d5('0x1c')](function(_0x5f30dd){var _0x3a388b=_[_0x59d5('0x40')](_0x5f30dd,'id');var _0x210a80=[];var _0x45c6f6=[];var _0x13ea1a=squel['select']();_0x13ea1a[_0x59d5('0x7a')](_0x59d5('0x7b'))['from']('team_has_chat_queues','tq')[_0x59d5('0x7c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x59d5('0x4a')]('ChatQueueId\x20=\x20?',_0x5849be['params']['id']);for(var _0x2ebe84=0x0;_0x2ebe84<_0x5f30dd[_0x59d5('0x53')];_0x2ebe84+=0x1){let _0x4cc94f=_0x5f30dd[_0x2ebe84];for(var _0xe8146d=0x0;_0xe8146d<_0x4cc94f[_0x59d5('0x74')][_0x59d5('0x53')];_0xe8146d+=0x1){let _0x7c5628=_0x4cc94f[_0x59d5('0x74')][_0xe8146d];var _0x3a222b=_0x13ea1a['clone']();_0x3a222b[_0x59d5('0x4a')](_0x59d5('0x7d'),_0x7c5628['id']);_0x45c6f6['push'](db[_0x59d5('0x75')][_0x59d5('0x41')](_0x3a222b[_0x59d5('0x7e')](),{'type':db[_0x59d5('0x75')][_0x59d5('0x7f')]['SELECT']})[_0x59d5('0x1c')](function(_0x538c57){if(_0x538c57['length']===0x1){return _0x7c5628['id'];}else{var _0x204934=_[_0x59d5('0x80')](_[_0x59d5('0x40')](_0x538c57,_0x59d5('0x81')),function(_0x2c695d){return _[_0x59d5('0x82')](_0x3a388b,_0x2c695d);});if(_0x204934){return _0x7c5628['id'];}}}));}}return BPromise[_0x59d5('0x83')](_0x45c6f6)[_0x59d5('0x1c')](function(_0xbd1758){_0x210a80=_(_0x210a80)['union'](_0xbd1758)[_0x59d5('0x84')]()[_0x59d5('0x85')]();return db['ChatQueue']['find']({'where':{'id':_0x5849be[_0x59d5('0x5e')]['id']}})['then'](function(_0x20108c){return db[_0x59d5('0x75')]['transaction'](function(_0x1d6a31){return _0x20108c['removeTeams'](_0x5849be[_0x59d5('0x41')][_0x59d5('0x71')],{'transaction':_0x1d6a31})[_0x59d5('0x1c')](function(){if(!_[_0x59d5('0x86')](_0x210a80)){return _0x20108c[_0x59d5('0x87')](_0x210a80,{'transaction':_0x1d6a31});}})['then'](function(){_0x210a80['forEach'](function(_0x262dee){socket[_0x59d5('0x88')](_0x59d5('0x89'),{'UserId':_0x262dee,'ChatQueueId':_0x20108c['id']});});});});});});})['then'](respondWithStatusCode(_0x41ff2f,null))[_0x59d5('0x24')](handleError(_0x41ff2f,null));};exports[_0x59d5('0x8a')]=function(_0x4adf3c,_0x8bec2d,_0x12a77c){return db['ChatQueue'][_0x59d5('0x56')]({'where':{'id':_0x4adf3c['params']['id']}})[_0x59d5('0x1c')](handleEntityNotFound(_0x8bec2d,null))[_0x59d5('0x1c')](function(_0x43908e){if(_0x43908e){return _0x43908e[_0x59d5('0x8a')](_0x4adf3c[_0x59d5('0x58')]['ids'],_[_0x59d5('0x8b')](_0x4adf3c[_0x59d5('0x58')],[_0x59d5('0x71'),'id'])||{})[_0x59d5('0x8c')](function(_0x171ec8){for(var _0x21281d=0x0;_0x21281d<_0x4adf3c[_0x59d5('0x58')][_0x59d5('0x71')][_0x59d5('0x53')];_0x21281d+=0x1){socket['emit'](_0x59d5('0x78'),{'UserId':Number(_0x4adf3c['body'][_0x59d5('0x71')][_0x21281d]),'ChatQueueId':Number(_0x4adf3c[_0x59d5('0x5e')]['id'])});}return _0x171ec8;});}})['then'](respondWithResult(_0x8bec2d,null))['catch'](handleError(_0x8bec2d,null));};exports[_0x59d5('0x87')]=function(_0x5d03d6,_0x1568a6,_0x4639eb){return db['ChatQueue']['find']({'where':{'id':_0x5d03d6[_0x59d5('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1568a6,null))[_0x59d5('0x1c')](function(_0x500531){if(_0x500531){return _0x500531[_0x59d5('0x87')](_0x5d03d6[_0x59d5('0x41')][_0x59d5('0x71')])[_0x59d5('0x1c')](function(){if(_[_0x59d5('0x8d')](_0x5d03d6['query'][_0x59d5('0x71')])){for(var _0x126454=0x0;_0x126454<_0x5d03d6['query'][_0x59d5('0x71')][_0x59d5('0x53')];_0x126454+=0x1){socket[_0x59d5('0x88')]('userChatQueue:remove',{'UserId':Number(_0x5d03d6[_0x59d5('0x41')][_0x59d5('0x71')][_0x126454]),'ChatQueueId':Number(_0x5d03d6[_0x59d5('0x5e')]['id'])});}}else{socket[_0x59d5('0x88')](_0x59d5('0x89'),{'UserId':Number(_0x5d03d6[_0x59d5('0x41')]['ids']),'ChatQueueId':Number(_0x5d03d6[_0x59d5('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x1568a6,null))[_0x59d5('0x24')](handleError(_0x1568a6,null));};exports['getAgents']=function(_0x1a899f,_0x25837c,_0xb11a30){var _0x32c73f={};var _0x4cf80e={};var _0x1004d8;var _0x105d1a;return db[_0x59d5('0x3b')][_0x59d5('0x61')]({'where':{'id':_0x1a899f[_0x59d5('0x5e')]['id']}})[_0x59d5('0x1c')](handleEntityNotFound(_0x25837c,null))[_0x59d5('0x1c')](function(_0x5bb8b1){if(_0x5bb8b1){_0x1004d8=_0x5bb8b1;_0x4cf80e['model']=_[_0x59d5('0x42')](db['User'][_0x59d5('0x6f')]);_0x4cf80e[_0x59d5('0x41')]=_[_0x59d5('0x42')](_0x1a899f[_0x59d5('0x41')]);_0x4cf80e['filters']=_[_0x59d5('0x44')](_0x4cf80e[_0x59d5('0x3f')],_0x4cf80e[_0x59d5('0x41')]);_0x32c73f[_0x59d5('0x43')]=_[_0x59d5('0x44')](_0x4cf80e[_0x59d5('0x3f')],qs['fields'](_0x1a899f['query'][_0x59d5('0x45')]));_0x32c73f[_0x59d5('0x43')]=_0x32c73f[_0x59d5('0x43')]['length']?_0x32c73f[_0x59d5('0x43')]:_0x4cf80e[_0x59d5('0x3f')];_0x32c73f[_0x59d5('0x48')]=qs['sort'](_0x1a899f[_0x59d5('0x41')]['sort']);_0x32c73f[_0x59d5('0x4a')]=qs[_0x59d5('0x4c')](_['pick'](_0x1a899f['query'],_0x4cf80e['filters']));if(_0x1a899f[_0x59d5('0x41')][_0x59d5('0x4d')]){_0x32c73f['where']=_['merge'](_0x32c73f[_0x59d5('0x4a')],{'$or':_[_0x59d5('0x40')](_0x32c73f[_0x59d5('0x43')],function(_0x2ec510){var _0x191ffe={};_0x191ffe[_0x2ec510]={'$like':'%'+_0x1a899f[_0x59d5('0x41')][_0x59d5('0x4d')]+'%'};return _0x191ffe;})});}_0x32c73f=_[_0x59d5('0x4f')]({},_0x32c73f,_0x1a899f[_0x59d5('0x55')]);return _0x1004d8['getAgents'](_0x32c73f);}})[_0x59d5('0x1c')](function(_0x415a1c){if(_0x415a1c){_0x105d1a=_0x415a1c[_0x59d5('0x53')];if(!_0x1a899f['query'][_0x59d5('0x46')]('nolimit')){_0x32c73f['limit']=qs[_0x59d5('0x29')](_0x1a899f[_0x59d5('0x41')][_0x59d5('0x29')]);_0x32c73f[_0x59d5('0x27')]=qs[_0x59d5('0x27')](_0x1a899f[_0x59d5('0x41')]['offset']);}return _0x1004d8[_0x59d5('0x8e')](_0x32c73f);}})[_0x59d5('0x1c')](function(_0x5cca3f){if(_0x5cca3f){return _0x5cca3f?{'count':_0x105d1a,'rows':_0x5cca3f}:null;}})[_0x59d5('0x1c')](respondWithResult(_0x25837c,null))[_0x59d5('0x24')](handleError(_0x25837c,null));};
\ No newline at end of file
index 5917674..a6ba6ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3be2=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x329402,_0x4f9cc4){var _0x242dc7=function(_0xedf362){while(--_0xedf362){_0x329402['push'](_0x329402['shift']());}};_0x242dc7(++_0x4f9cc4);}(_0x3be2,0x197));var _0x23be=function(_0x125d72,_0x5615b9){_0x125d72=_0x125d72-0x0;var _0x1a716b=_0x3be2[_0x125d72];return _0x1a716b;};'use strict';var EventEmitter=require(_0x23be('0x0'));var ChatQueue=require(_0x23be('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x23be('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x23be('0x3'),'afterDestroy':_0x23be('0x4')};function emitEvent(_0x2ac241){return function(_0xffc46d,_0x4ddcf3,_0x23bc51){ChatQueueEvents[_0x23be('0x5')](_0x2ac241+':'+_0xffc46d['id'],_0xffc46d);ChatQueueEvents[_0x23be('0x5')](_0x2ac241,_0xffc46d);_0x23bc51(null);};}for(var e in events){if(events[_0x23be('0x6')](e)){var event=events[e];ChatQueue[_0x23be('0x7')](e,emitEvent(event));}}module[_0x23be('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xb4ce=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','ChatQueue'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb4ce,0x166));var _0xeb4c=function(_0x1ea109,_0x22fbc9){_0x1ea109=_0x1ea109-0x0;var _0x6114c=_0xb4ce[_0x1ea109];return _0x6114c;};'use strict';var EventEmitter=require(_0xeb4c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xeb4c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xeb4c('0x2')](0x0);var events={'afterCreate':_0xeb4c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8a9e90){return function(_0x56d05f,_0x3aa4a2,_0x580b29){ChatQueueEvents[_0xeb4c('0x4')](_0x8a9e90+':'+_0x56d05f['id'],_0x56d05f);ChatQueueEvents['emit'](_0x8a9e90,_0x56d05f);_0x580b29(null);};}for(var e in events){if(events[_0xeb4c('0x5')](e)){var event=events[e];ChatQueue[_0xeb4c('0x6')](e,emitEvent(event));}}module[_0xeb4c('0x7')]=ChatQueueEvents;
\ No newline at end of file
index 8f16fb3..0cad253 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc360=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x42293d,_0x39d4e7){var _0x359ea3=function(_0xcc57a9){while(--_0xcc57a9){_0x42293d['push'](_0x42293d['shift']());}};_0x359ea3(++_0x39d4e7);}(_0xc360,0x185));var _0x0c36=function(_0x186029,_0x3d766b){_0x186029=_0x186029-0x0;var _0x3f8ddb=_0xc360[_0x186029];return _0x3f8ddb;};'use strict';var _=require(_0x0c36('0x0'));var util=require('util');var logger=require(_0x0c36('0x1'))(_0x0c36('0x2'));var moment=require(_0x0c36('0x3'));var BPromise=require(_0x0c36('0x4'));var rp=require(_0x0c36('0x5'));var fs=require('fs');var path=require(_0x0c36('0x6'));var rimraf=require('rimraf');var config=require(_0x0c36('0x7'));var attributes=require(_0x0c36('0x8'));module[_0x0c36('0x9')]=function(_0x1caa5e,_0x24b523){return _0x1caa5e[_0x0c36('0xa')](_0x0c36('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x738f=['ChatQueue','chat_queues','../../config/logger','api','bluebird','request-promise','path','exports','define'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x738f,0x1d6));var _0xf738=function(_0x35e7f5,_0x2c52b8){_0x35e7f5=_0x35e7f5-0x0;var _0x290a15=_0x738f[_0x35e7f5];return _0x290a15;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf738('0x0'))(_0xf738('0x1'));var moment=require('moment');var BPromise=require(_0xf738('0x2'));var rp=require(_0xf738('0x3'));var fs=require('fs');var path=require(_0xf738('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xf738('0x5')]=function(_0x2231fe,_0x441dcd){return _0x2231fe[_0xf738('0x6')](_0xf738('0x7'),attributes,{'tableName':_0xf738('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b47129..b266090 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3670=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','include','model','map','stringify','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis'];(function(_0x469889,_0x1e640a){var _0x3e72c1=function(_0x478db2){while(--_0x478db2){_0x469889['push'](_0x469889['shift']());}};_0x3e72c1(++_0x1e640a);}(_0x3670,0x16c));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0367('0x0'));var moment=require(_0x0367('0x1'));var BPromise=require(_0x0367('0x2'));var rs=require(_0x0367('0x3'));var fs=require('fs');var Redis=require(_0x0367('0x4'));var db=require(_0x0367('0x5'))['db'];var utils=require(_0x0367('0x6'));var logger=require('../../config/logger')(_0x0367('0x7'));var config=require(_0x0367('0x8'));var jayson=require(_0x0367('0x9'));var client=jayson[_0x0367('0xa')][_0x0367('0xb')]({'port':0x232a});config[_0x0367('0xc')]=_[_0x0367('0xd')](config[_0x0367('0xc')],{'host':_0x0367('0xe'),'port':0x18eb});var socket=require(_0x0367('0xf'))(new Redis(config[_0x0367('0xc')]));require(_0x0367('0x10'))[_0x0367('0x11')](socket);function respondWithRpcPromise(_0x27d570,_0x412c44,_0x2036c0){return new BPromise(function(_0x5437d0,_0x323471){return client['request'](_0x27d570,_0x2036c0)[_0x0367('0x12')](function(_0x23f4c8){logger[_0x0367('0x13')](_0x0367('0x14'),_0x412c44,_0x0367('0x15'));logger[_0x0367('0x16')](_0x0367('0x17'),_0x412c44,_0x0367('0x15'),JSON['stringify'](_0x23f4c8));if(_0x23f4c8[_0x0367('0x18')]){if(_0x23f4c8[_0x0367('0x18')]['code']===0x1f4){logger[_0x0367('0x18')](_0x0367('0x14'),_0x412c44,_0x23f4c8[_0x0367('0x18')]['message']);return _0x323471(_0x23f4c8[_0x0367('0x18')][_0x0367('0x19')]);}logger[_0x0367('0x18')](_0x0367('0x14'),_0x412c44,_0x23f4c8['error']['message']);return _0x5437d0(_0x23f4c8[_0x0367('0x18')][_0x0367('0x19')]);}else{logger[_0x0367('0x13')]('ChatQueue,\x20%s,\x20%s',_0x412c44,'request\x20sent');_0x5437d0(_0x23f4c8[_0x0367('0x1a')][_0x0367('0x19')]);}})[_0x0367('0x1b')](function(_0x383217){logger['error'](_0x0367('0x14'),_0x412c44,_0x383217);_0x323471(_0x383217);});});}exports[_0x0367('0x1c')]=function(_0x14ddf2){var _0x2f8d0d=this;return new Promise(function(_0x50551d,_0x5de2fd){return db[_0x0367('0x1d')][_0x0367('0x1e')]({'raw':_0x14ddf2['options']?_0x14ddf2['options'][_0x0367('0x1f')]===undefined?!![]:![]:!![],'where':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x21')]||null:null,'attributes':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x22')]||null:null,'limit':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2['options']['limit']||null:null,'include':_0x14ddf2[_0x0367('0x20')]?_0x14ddf2[_0x0367('0x20')][_0x0367('0x23')]?_['map'](_0x14ddf2['options'][_0x0367('0x23')],function(_0x520a84){return{'model':db[_0x520a84[_0x0367('0x24')]],'as':_0x520a84['as'],'attributes':_0x520a84[_0x0367('0x22')],'include':_0x520a84[_0x0367('0x23')]?_[_0x0367('0x25')](_0x520a84[_0x0367('0x23')],function(_0x5c2905){return{'model':db[_0x5c2905[_0x0367('0x24')]],'as':_0x5c2905['as'],'attributes':_0x5c2905[_0x0367('0x22')],'include':_0x5c2905[_0x0367('0x23')]?_[_0x0367('0x25')](_0x5c2905['include'],function(_0x2ed10e){return{'model':db[_0x2ed10e[_0x0367('0x24')]],'as':_0x2ed10e['as'],'attributes':_0x2ed10e[_0x0367('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46461f){logger[_0x0367('0x13')]('GetChatQueue',_0x14ddf2);logger[_0x0367('0x16')](_0x0367('0x1c'),_0x14ddf2,JSON[_0x0367('0x26')](_0x46461f));_0x50551d(_0x46461f);})[_0x0367('0x1b')](function(_0x382370){logger['error'](_0x0367('0x1c'),_0x382370['message'],_0x14ddf2);_0x5de2fd(_0x2f8d0d[_0x0367('0x18')](0x1f4,_0x382370[_0x0367('0x19')]));});});};exports[_0x0367('0x27')]=function(_0xb6ab1b){var _0x16265a=this;return new Promise(function(_0x157dd2,_0x4edac8){return db[_0x0367('0x1d')][_0x0367('0x28')]({'raw':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b['options'][_0x0367('0x1f')]===undefined?!![]:![]:!![],'where':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b[_0x0367('0x20')][_0x0367('0x21')]||null:null,'attributes':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b[_0x0367('0x20')]['attributes']||null:null,'include':_0xb6ab1b[_0x0367('0x20')]?_0xb6ab1b['options'][_0x0367('0x23')]?_[_0x0367('0x25')](_0xb6ab1b[_0x0367('0x20')]['include'],function(_0x33395f){return{'model':db[_0x33395f['model']],'as':_0x33395f['as'],'attributes':_0x33395f['attributes'],'include':_0x33395f[_0x0367('0x23')]?_[_0x0367('0x25')](_0x33395f[_0x0367('0x23')],function(_0x843a58){return{'model':db[_0x843a58['model']],'as':_0x843a58['as'],'attributes':_0x843a58[_0x0367('0x22')],'include':_0x843a58[_0x0367('0x23')]?_[_0x0367('0x25')](_0x843a58[_0x0367('0x23')],function(_0x5d60c3){return{'model':db[_0x5d60c3['model']],'as':_0x5d60c3['as'],'attributes':_0x5d60c3[_0x0367('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0367('0x12')](function(_0x2d4a0b){logger[_0x0367('0x13')](_0x0367('0x27'),_0xb6ab1b);logger[_0x0367('0x16')](_0x0367('0x27'),_0xb6ab1b,JSON['stringify'](_0x2d4a0b));_0x157dd2(_0x2d4a0b);})['catch'](function(_0x2f4660){logger[_0x0367('0x18')](_0x0367('0x27'),_0x2f4660[_0x0367('0x19')],_0xb6ab1b);_0x4edac8(_0x16265a[_0x0367('0x18')](0x1f4,_0x2f4660[_0x0367('0x19')]));});});};
\ No newline at end of file
+var _0xc2f4=['jayson/promise','client','http','defaults','socket.io-emitter','redis','register','request','then','info','request\x20sent','debug','stringify','error','message','ChatQueue,\x20%s,\x20%s','catch','findAll','options','raw','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','ChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x109f89,_0x4f2bae){var _0x40da68=function(_0x44f197){while(--_0x44f197){_0x109f89['push'](_0x109f89['shift']());}};_0x40da68(++_0x4f2bae);}(_0xc2f4,0x107));var _0x4c2f=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0xc2f4[_0x21a2b3];return _0x4651a7;};'use strict';var _=require(_0x4c2f('0x0'));var util=require(_0x4c2f('0x1'));var moment=require(_0x4c2f('0x2'));var BPromise=require(_0x4c2f('0x3'));var rs=require(_0x4c2f('0x4'));var fs=require('fs');var Redis=require(_0x4c2f('0x5'));var db=require(_0x4c2f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c2f('0x7'))(_0x4c2f('0x8'));var config=require(_0x4c2f('0x9'));var jayson=require(_0x4c2f('0xa'));var client=jayson[_0x4c2f('0xb')][_0x4c2f('0xc')]({'port':0x232a});config['redis']=_[_0x4c2f('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4c2f('0xe'))(new Redis(config[_0x4c2f('0xf')]));require('./chatQueue.socket')[_0x4c2f('0x10')](socket);function respondWithRpcPromise(_0x5d3b85,_0x29017b,_0x503776){return new BPromise(function(_0x3f2d9a,_0x27202f){return client[_0x4c2f('0x11')](_0x5d3b85,_0x503776)[_0x4c2f('0x12')](function(_0x32dd7e){logger[_0x4c2f('0x13')]('ChatQueue,\x20%s,\x20%s',_0x29017b,_0x4c2f('0x14'));logger[_0x4c2f('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x29017b,_0x4c2f('0x14'),JSON[_0x4c2f('0x16')](_0x32dd7e));if(_0x32dd7e[_0x4c2f('0x17')]){if(_0x32dd7e[_0x4c2f('0x17')]['code']===0x1f4){logger[_0x4c2f('0x17')]('ChatQueue,\x20%s,\x20%s',_0x29017b,_0x32dd7e['error'][_0x4c2f('0x18')]);return _0x27202f(_0x32dd7e[_0x4c2f('0x17')][_0x4c2f('0x18')]);}logger['error'](_0x4c2f('0x19'),_0x29017b,_0x32dd7e[_0x4c2f('0x17')][_0x4c2f('0x18')]);return _0x3f2d9a(_0x32dd7e['error'][_0x4c2f('0x18')]);}else{logger['info'](_0x4c2f('0x19'),_0x29017b,_0x4c2f('0x14'));_0x3f2d9a(_0x32dd7e['result'][_0x4c2f('0x18')]);}})[_0x4c2f('0x1a')](function(_0x1e5a16){logger[_0x4c2f('0x17')](_0x4c2f('0x19'),_0x29017b,_0x1e5a16);_0x27202f(_0x1e5a16);});});}exports['GetChatQueue']=function(_0x101456){var _0x3ea1a8=this;return new Promise(function(_0x10fa87,_0x2ba864){return db['ChatQueue'][_0x4c2f('0x1b')]({'raw':_0x101456['options']?_0x101456[_0x4c2f('0x1c')][_0x4c2f('0x1d')]===undefined?!![]:![]:!![],'where':_0x101456[_0x4c2f('0x1c')]?_0x101456['options']['where']||null:null,'attributes':_0x101456[_0x4c2f('0x1c')]?_0x101456[_0x4c2f('0x1c')][_0x4c2f('0x1e')]||null:null,'limit':_0x101456[_0x4c2f('0x1c')]?_0x101456[_0x4c2f('0x1c')][_0x4c2f('0x1f')]||null:null,'include':_0x101456[_0x4c2f('0x1c')]?_0x101456[_0x4c2f('0x1c')][_0x4c2f('0x20')]?_[_0x4c2f('0x21')](_0x101456[_0x4c2f('0x1c')]['include'],function(_0x9a13b4){return{'model':db[_0x9a13b4[_0x4c2f('0x22')]],'as':_0x9a13b4['as'],'attributes':_0x9a13b4['attributes'],'include':_0x9a13b4['include']?_[_0x4c2f('0x21')](_0x9a13b4[_0x4c2f('0x20')],function(_0x56e7ad){return{'model':db[_0x56e7ad[_0x4c2f('0x22')]],'as':_0x56e7ad['as'],'attributes':_0x56e7ad[_0x4c2f('0x1e')],'include':_0x56e7ad[_0x4c2f('0x20')]?_[_0x4c2f('0x21')](_0x56e7ad[_0x4c2f('0x20')],function(_0x4f85f5){return{'model':db[_0x4f85f5[_0x4c2f('0x22')]],'as':_0x4f85f5['as'],'attributes':_0x4f85f5[_0x4c2f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4c2f('0x12')](function(_0x36eb86){logger[_0x4c2f('0x13')]('GetChatQueue',_0x101456);logger[_0x4c2f('0x15')](_0x4c2f('0x23'),_0x101456,JSON['stringify'](_0x36eb86));_0x10fa87(_0x36eb86);})[_0x4c2f('0x1a')](function(_0x41e882){logger[_0x4c2f('0x17')](_0x4c2f('0x23'),_0x41e882[_0x4c2f('0x18')],_0x101456);_0x2ba864(_0x3ea1a8[_0x4c2f('0x17')](0x1f4,_0x41e882['message']));});});};exports[_0x4c2f('0x24')]=function(_0x175f81){var _0x273511=this;return new Promise(function(_0x2af1ad,_0x33736a){return db[_0x4c2f('0x25')][_0x4c2f('0x26')]({'raw':_0x175f81[_0x4c2f('0x1c')]?_0x175f81[_0x4c2f('0x1c')][_0x4c2f('0x1d')]===undefined?!![]:![]:!![],'where':_0x175f81[_0x4c2f('0x1c')]?_0x175f81[_0x4c2f('0x1c')]['where']||null:null,'attributes':_0x175f81['options']?_0x175f81[_0x4c2f('0x1c')][_0x4c2f('0x1e')]||null:null,'include':_0x175f81['options']?_0x175f81[_0x4c2f('0x1c')]['include']?_[_0x4c2f('0x21')](_0x175f81[_0x4c2f('0x1c')][_0x4c2f('0x20')],function(_0x5cfd63){return{'model':db[_0x5cfd63[_0x4c2f('0x22')]],'as':_0x5cfd63['as'],'attributes':_0x5cfd63[_0x4c2f('0x1e')],'include':_0x5cfd63[_0x4c2f('0x20')]?_['map'](_0x5cfd63[_0x4c2f('0x20')],function(_0x219eaa){return{'model':db[_0x219eaa[_0x4c2f('0x22')]],'as':_0x219eaa['as'],'attributes':_0x219eaa[_0x4c2f('0x1e')],'include':_0x219eaa[_0x4c2f('0x20')]?_[_0x4c2f('0x21')](_0x219eaa['include'],function(_0x24660e){return{'model':db[_0x24660e[_0x4c2f('0x22')]],'as':_0x24660e['as'],'attributes':_0x24660e[_0x4c2f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4c2f('0x12')](function(_0x4c9263){logger[_0x4c2f('0x13')](_0x4c2f('0x24'),_0x175f81);logger[_0x4c2f('0x15')]('ShowChatQueue',_0x175f81,JSON['stringify'](_0x4c9263));_0x2af1ad(_0x4c9263);})[_0x4c2f('0x1a')](function(_0x56db4f){logger['error'](_0x4c2f('0x24'),_0x56db4f[_0x4c2f('0x18')],_0x175f81);_0x33736a(_0x273511[_0x4c2f('0x17')](0x1f4,_0x56db4f[_0x4c2f('0x18')]));});});};
\ No newline at end of file
index cf4d3b3..bc9c4bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['remove','removeListener','register','length','chatQueue:','save'];(function(_0x4c0e76,_0x424c83){var _0x7b0007=function(_0x39b29a){while(--_0x39b29a){_0x4c0e76['push'](_0x4c0e76['shift']());}};_0x7b0007(++_0x424c83);}(_0xb821,0xa7));var _0x1b82=function(_0x2eefb6,_0x282f0c){_0x2eefb6=_0x2eefb6-0x0;var _0x423525=_0xb821[_0x2eefb6];return _0x423525;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x1b82('0x0'),_0x1b82('0x1'),'update'];function createListener(_0x4a4f81,_0xbab478){return function(_0x578a10){_0xbab478['emit'](_0x4a4f81,_0x578a10);};}function removeListener(_0x3b1d14,_0x1403ab){return function(){ChatQueueEvents[_0x1b82('0x2')](_0x3b1d14,_0x1403ab);};}exports[_0x1b82('0x3')]=function(_0x597ca7){for(var _0x3e27c4=0x0,_0x192434=events[_0x1b82('0x4')];_0x3e27c4<_0x192434;_0x3e27c4++){var _0x3632dd=events[_0x3e27c4];var _0x18f45f=createListener(_0x1b82('0x5')+_0x3632dd,_0x597ca7);ChatQueueEvents['on'](_0x3632dd,_0x18f45f);}};
\ No newline at end of file
+var _0x702d=['remove','update','emit','register','length','./chatQueue.events','save'];(function(_0x59e69b,_0x3c8ef1){var _0x4a5f8a=function(_0x469c6c){while(--_0x469c6c){_0x59e69b['push'](_0x59e69b['shift']());}};_0x4a5f8a(++_0x3c8ef1);}(_0x702d,0x147));var _0xd702=function(_0x444383,_0x449da5){_0x444383=_0x444383-0x0;var _0x4fa52f=_0x702d[_0x444383];return _0x4fa52f;};'use strict';var ChatQueueEvents=require(_0xd702('0x0'));var events=[_0xd702('0x1'),_0xd702('0x2'),_0xd702('0x3')];function createListener(_0x37ed5c,_0x5c2b9e){return function(_0x20c11a){_0x5c2b9e[_0xd702('0x4')](_0x37ed5c,_0x20c11a);};}function removeListener(_0x27b260,_0x1c5a32){return function(){ChatQueueEvents['removeListener'](_0x27b260,_0x1c5a32);};}exports[_0xd702('0x5')]=function(_0x544e94){for(var _0x1aecfc=0x0,_0x3a2c03=events[_0xd702('0x6')];_0x1aecfc<_0x3a2c03;_0x1aecfc++){var _0x5af246=events[_0x1aecfc];var _0x12bb75=createListener('chatQueue:'+_0x5af246,_0x544e94);ChatQueueEvents['on'](_0x5af246,_0x12bb75);}};
\ No newline at end of file
index 8c577a7..d4f8911 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(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0x5fc3[_0x22eb96];return _0x5e1adf;};'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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x18934f,_0x209b8f){var _0x4c64e9=function(_0x24d71e){while(--_0x24d71e){_0x18934f['push'](_0x18934f['shift']());}};_0x4c64e9(++_0x209b8f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 494487d..edda04c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x077a=['STRING','DATE','moment','exports'];(function(_0x4b9a62,_0x528ba3){var _0x45c582=function(_0x596041){while(--_0x596041){_0x4b9a62['push'](_0x4b9a62['shift']());}};_0x45c582(++_0x528ba3);}(_0x077a,0x1f2));var _0xa077=function(_0x15d60e,_0x4e846d){_0x15d60e=_0x15d60e-0x0;var _0x5c6452=_0x077a[_0x15d60e];return _0x5c6452;};'use strict';var moment=require(_0xa077('0x0'));var Sequelize=require('sequelize');module[_0xa077('0x1')]={'uniqueid':{'type':Sequelize[_0xa077('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa077('0x2')]},'joinAt':{'type':Sequelize[_0xa077('0x3')]},'leaveAt':{'type':Sequelize[_0xa077('0x3')]},'acceptAt':{'type':Sequelize[_0xa077('0x3')]},'exitAt':{'type':Sequelize[_0xa077('0x3')]},'reason':{'type':Sequelize[_0xa077('0x2')]}};
\ No newline at end of file
+var _0xde4d=['STRING','DATE','moment','sequelize'];(function(_0x37c87d,_0x37675c){var _0x48f231=function(_0x4c8ac0){while(--_0x4c8ac0){_0x37c87d['push'](_0x37c87d['shift']());}};_0x48f231(++_0x37675c);}(_0xde4d,0x17a));var _0xdde4=function(_0x4053cc,_0x4a2158){_0x4053cc=_0x4053cc-0x0;var _0x2d98c2=_0xde4d[_0x4053cc];return _0x2d98c2;};'use strict';var moment=require(_0xdde4('0x0'));var Sequelize=require(_0xdde4('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xdde4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdde4('0x2')]},'joinAt':{'type':Sequelize[_0xdde4('0x3')]},'leaveAt':{'type':Sequelize[_0xdde4('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdde4('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 043ad70..1c38369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9ce=['nolimit','order','sort','where','pick','merge','includeAll','include','rows','rawAttributes','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x117040,_0x474630){var _0x2a3dff=function(_0x3e372a){while(--_0x3e372a){_0x117040['push'](_0x117040['shift']());}};_0x2a3dff(++_0x474630);}(_0xd9ce,0xeb));var _0xed9c=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0xd9ce[_0x146be0];return _0x1bcc25;};'use strict';var emlformat=require(_0xed9c('0x0'));var rimraf=require(_0xed9c('0x1'));var zipdir=require(_0xed9c('0x2'));var jsonpatch=require(_0xed9c('0x3'));var rp=require(_0xed9c('0x4'));var moment=require(_0xed9c('0x5'));var BPromise=require(_0xed9c('0x6'));var Mustache=require(_0xed9c('0x7'));var util=require('util');var path=require(_0xed9c('0x8'));var sox=require(_0xed9c('0x9'));var csv=require(_0xed9c('0xa'));var ejs=require(_0xed9c('0xb'));var fs=require('fs');var fs_extra=require(_0xed9c('0xc'));var _=require(_0xed9c('0xd'));var squel=require('squel');var crypto=require(_0xed9c('0xe'));var jsforce=require(_0xed9c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed9c('0x10'));var Papa=require('papaparse');var Redis=require(_0xed9c('0x11'));var authService=require(_0xed9c('0x12'));var qs=require(_0xed9c('0x13'));var as=require(_0xed9c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed9c('0x15'))(_0xed9c('0x16'));var utils=require(_0xed9c('0x17'));var config=require(_0xed9c('0x18'));var licenseUtil=require(_0xed9c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52be22,_0x88a8f9){_0x88a8f9=_0x88a8f9||0xcc;return function(_0x2153be){if(_0x2153be){return _0x52be22[_0xed9c('0x1a')](_0x88a8f9);}return _0x52be22[_0xed9c('0x1b')](_0x88a8f9)['end']();};}function respondWithResult(_0x5a5d8d,_0x99a5ee){_0x99a5ee=_0x99a5ee||0xc8;return function(_0x50a934){if(_0x50a934){return _0x5a5d8d[_0xed9c('0x1b')](_0x99a5ee)[_0xed9c('0x1c')](_0x50a934);}};}function respondWithFilteredResult(_0x95f79,_0x3fd63e){return function(_0x737656){if(_0x737656){var _0x22a28d=typeof _0x3fd63e[_0xed9c('0x1d')]==='undefined'&&typeof _0x3fd63e[_0xed9c('0x1e')]===_0xed9c('0x1f');var _0x2d45d9=_0x737656['count'];var _0x485029=_0x22a28d?0x0:_0x3fd63e[_0xed9c('0x1d')];var _0x48b7b4=_0x22a28d?_0x737656[_0xed9c('0x20')]:_0x3fd63e[_0xed9c('0x1d')]+_0x3fd63e[_0xed9c('0x1e')];var _0x2d432e;if(_0x48b7b4>=_0x2d45d9){_0x48b7b4=_0x2d45d9;_0x2d432e=0xc8;}else{_0x2d432e=0xce;}_0x95f79[_0xed9c('0x1b')](_0x2d432e);return _0x95f79[_0xed9c('0x21')]('Content-Range',_0x485029+'-'+_0x48b7b4+'/'+_0x2d45d9)[_0xed9c('0x1c')](_0x737656);}return null;};}function patchUpdates(_0x32c67e){return function(_0x45dc96){try{jsonpatch['apply'](_0x45dc96,_0x32c67e,!![]);}catch(_0x129c5f){return BPromise[_0xed9c('0x22')](_0x129c5f);}return _0x45dc96[_0xed9c('0x23')]();};}function saveUpdates(_0xd5bac1,_0x55ef58){return function(_0x538a70){if(_0x538a70){return _0x538a70[_0xed9c('0x24')](_0xd5bac1)[_0xed9c('0x25')](function(_0xc7a92a){return _0xc7a92a;});}return null;};}function removeEntity(_0x2ae3ce,_0x1fd75d){return function(_0x340c6){if(_0x340c6){return _0x340c6['destroy']()[_0xed9c('0x25')](function(){_0x2ae3ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x495055,_0x4855b0){return function(_0xc02cd5){if(!_0xc02cd5){_0x495055[_0xed9c('0x1a')](0x194);}return _0xc02cd5;};}function handleError(_0x1536b3,_0x4f1a3f){_0x4f1a3f=_0x4f1a3f||0x1f4;return function(_0x2a1fac){logger[_0xed9c('0x26')](_0x2a1fac[_0xed9c('0x27')]);if(_0x2a1fac['name']){delete _0x2a1fac[_0xed9c('0x28')];}_0x1536b3[_0xed9c('0x1b')](_0x4f1a3f)[_0xed9c('0x29')](_0x2a1fac);};}exports[_0xed9c('0x2a')]=function(_0x548eab,_0x15d6e7){var _0x48dae4={},_0x42c134={},_0x438a31={'count':0x0,'rows':[]};var _0x16c27c=_[_0xed9c('0x2b')](db[_0xed9c('0x2c')]['rawAttributes'],function(_0x55d27e){return{'name':_0x55d27e[_0xed9c('0x2d')],'type':_0x55d27e[_0xed9c('0x2e')][_0xed9c('0x2f')]};});_0x42c134[_0xed9c('0x30')]=_['map'](_0x16c27c,_0xed9c('0x28'));_0x42c134[_0xed9c('0x31')]=_[_0xed9c('0x32')](_0x548eab[_0xed9c('0x31')]);_0x42c134[_0xed9c('0x33')]=_['intersection'](_0x42c134[_0xed9c('0x30')],_0x42c134['query']);_0x48dae4[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x42c134[_0xed9c('0x30')],qs[_0xed9c('0x36')](_0x548eab[_0xed9c('0x31')][_0xed9c('0x36')]));_0x48dae4[_0xed9c('0x34')]=_0x48dae4[_0xed9c('0x34')][_0xed9c('0x37')]?_0x48dae4[_0xed9c('0x34')]:_0x42c134[_0xed9c('0x30')];if(!_0x548eab[_0xed9c('0x31')][_0xed9c('0x38')](_0xed9c('0x39'))){_0x48dae4[_0xed9c('0x1e')]=qs[_0xed9c('0x1e')](_0x548eab['query'][_0xed9c('0x1e')]);_0x48dae4[_0xed9c('0x1d')]=qs[_0xed9c('0x1d')](_0x548eab[_0xed9c('0x31')]['offset']);}_0x48dae4[_0xed9c('0x3a')]=qs[_0xed9c('0x3b')](_0x548eab[_0xed9c('0x31')][_0xed9c('0x3b')]);_0x48dae4[_0xed9c('0x3c')]=qs[_0xed9c('0x33')](_[_0xed9c('0x3d')](_0x548eab[_0xed9c('0x31')],_0x42c134[_0xed9c('0x33')]),_0x16c27c);if(_0x548eab[_0xed9c('0x31')]['filter']){_0x48dae4['where']=_[_0xed9c('0x3e')](_0x48dae4[_0xed9c('0x3c')],{'$or':_[_0xed9c('0x2b')](_0x16c27c,function(_0x503b02){if(_0x503b02[_0xed9c('0x2e')]!=='VIRTUAL'){var _0x4ee934={};_0x4ee934[_0x503b02[_0xed9c('0x28')]]={'$like':'%'+_0x548eab['query']['filter']+'%'};return _0x4ee934;}})});}_0x48dae4=_[_0xed9c('0x3e')]({},_0x48dae4,_0x548eab['options']);var _0x2aef00={'where':_0x48dae4['where']};return db[_0xed9c('0x2c')]['count'](_0x2aef00)[_0xed9c('0x25')](function(_0x19e151){_0x438a31[_0xed9c('0x20')]=_0x19e151;if(_0x548eab[_0xed9c('0x31')][_0xed9c('0x3f')]){_0x48dae4[_0xed9c('0x40')]=[{'all':!![]}];}return db[_0xed9c('0x2c')]['findAll'](_0x48dae4);})[_0xed9c('0x25')](function(_0x18918f){_0x438a31[_0xed9c('0x41')]=_0x18918f;return _0x438a31;})['then'](respondWithFilteredResult(_0x15d6e7,_0x48dae4))['catch'](handleError(_0x15d6e7,null));};exports['show']=function(_0x4f07f5,_0x1c6188){var _0x46cde2={'raw':!![],'where':{'id':_0x4f07f5['params']['id']}},_0x30894d={};_0x30894d['model']=_[_0xed9c('0x32')](db[_0xed9c('0x2c')][_0xed9c('0x42')]);_0x30894d[_0xed9c('0x31')]=_[_0xed9c('0x32')](_0x4f07f5[_0xed9c('0x31')]);_0x30894d[_0xed9c('0x33')]=_[_0xed9c('0x35')](_0x30894d[_0xed9c('0x30')],_0x30894d[_0xed9c('0x31')]);_0x46cde2[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x30894d[_0xed9c('0x30')],qs['fields'](_0x4f07f5['query']['fields']));_0x46cde2['attributes']=_0x46cde2[_0xed9c('0x34')][_0xed9c('0x37')]?_0x46cde2[_0xed9c('0x34')]:_0x30894d[_0xed9c('0x30')];if(_0x4f07f5[_0xed9c('0x31')][_0xed9c('0x3f')]){_0x46cde2[_0xed9c('0x40')]=[{'all':!![]}];}_0x46cde2=_['merge']({},_0x46cde2,_0x4f07f5['options']);return db[_0xed9c('0x2c')][_0xed9c('0x43')](_0x46cde2)['then'](handleEntityNotFound(_0x1c6188,null))[_0xed9c('0x25')](respondWithResult(_0x1c6188,null))['catch'](handleError(_0x1c6188,null));};exports[_0xed9c('0x44')]=function(_0x39d420,_0xbb0ef6){return db[_0xed9c('0x2c')]['create'](_0x39d420[_0xed9c('0x45')],{})[_0xed9c('0x25')](respondWithResult(_0xbb0ef6,0xc9))[_0xed9c('0x46')](handleError(_0xbb0ef6,null));};exports[_0xed9c('0x24')]=function(_0x4b488e,_0x108c46){if(_0x4b488e['body']['id']){delete _0x4b488e['body']['id'];}return db[_0xed9c('0x2c')][_0xed9c('0x43')]({'where':{'id':_0x4b488e['params']['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x108c46,null))[_0xed9c('0x25')](saveUpdates(_0x4b488e['body'],null))[_0xed9c('0x25')](respondWithResult(_0x108c46,null))[_0xed9c('0x46')](handleError(_0x108c46,null));};exports['destroy']=function(_0x4f304a,_0x22033a){return db[_0xed9c('0x2c')][_0xed9c('0x43')]({'where':{'id':_0x4f304a[_0xed9c('0x47')]['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x22033a,null))[_0xed9c('0x25')](removeEntity(_0x22033a,null))[_0xed9c('0x46')](handleError(_0x22033a,null));};exports[_0xed9c('0x48')]=function(_0x4d0374,_0xd7ec75){return db['ChatQueueReport'][_0xed9c('0x48')]()['then'](respondWithResult(_0xd7ec75,null))['catch'](handleError(_0xd7ec75,null));};
\ No newline at end of file
+var _0x1059=['where','pick','filters','filter','merge','map','VIRTUAL','options','ChatQueueReport','includeAll','findAll','show','include','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort'];(function(_0xaae375,_0x4ee392){var _0x1b1192=function(_0x672fa1){while(--_0x672fa1){_0xaae375['push'](_0xaae375['shift']());}};_0x1b1192(++_0x4ee392);}(_0x1059,0x176));var _0x9105=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0x1059[_0x50c492];return _0x3505a8;};'use strict';var emlformat=require(_0x9105('0x0'));var rimraf=require(_0x9105('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9105('0x2'));var rp=require(_0x9105('0x3'));var moment=require(_0x9105('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9105('0x5'));var util=require('util');var path=require(_0x9105('0x6'));var sox=require(_0x9105('0x7'));var csv=require('to-csv');var ejs=require(_0x9105('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9105('0x9'));var squel=require(_0x9105('0xa'));var crypto=require(_0x9105('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9105('0xc'));var toCsv=require(_0x9105('0xd'));var querystring=require(_0x9105('0xe'));var Papa=require(_0x9105('0xf'));var Redis=require('ioredis');var authService=require(_0x9105('0x10'));var qs=require(_0x9105('0x11'));var as=require(_0x9105('0x12'));var hardwareService=require(_0x9105('0x13'));var logger=require('../../config/logger')(_0x9105('0x14'));var utils=require('../../config/utils');var config=require(_0x9105('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22aef4,_0x22df34){_0x22df34=_0x22df34||0xcc;return function(_0x2c0605){if(_0x2c0605){return _0x22aef4[_0x9105('0x16')](_0x22df34);}return _0x22aef4['status'](_0x22df34)[_0x9105('0x17')]();};}function respondWithResult(_0x58f884,_0x10b4a5){_0x10b4a5=_0x10b4a5||0xc8;return function(_0x1aa0d0){if(_0x1aa0d0){return _0x58f884[_0x9105('0x18')](_0x10b4a5)['json'](_0x1aa0d0);}};}function respondWithFilteredResult(_0x5bde8e,_0x3a25c1){return function(_0x7e4a1c){if(_0x7e4a1c){var _0x3933d5=typeof _0x3a25c1[_0x9105('0x19')]===_0x9105('0x1a')&&typeof _0x3a25c1[_0x9105('0x1b')]===_0x9105('0x1a');var _0x13d241=_0x7e4a1c[_0x9105('0x1c')];var _0x3d44d4=_0x3933d5?0x0:_0x3a25c1[_0x9105('0x19')];var _0x38f00f=_0x3933d5?_0x7e4a1c['count']:_0x3a25c1['offset']+_0x3a25c1[_0x9105('0x1b')];var _0x825941;if(_0x38f00f>=_0x13d241){_0x38f00f=_0x13d241;_0x825941=0xc8;}else{_0x825941=0xce;}_0x5bde8e[_0x9105('0x18')](_0x825941);return _0x5bde8e[_0x9105('0x1d')]('Content-Range',_0x3d44d4+'-'+_0x38f00f+'/'+_0x13d241)[_0x9105('0x1e')](_0x7e4a1c);}return null;};}function patchUpdates(_0x17b7bd){return function(_0x52c2cd){try{jsonpatch[_0x9105('0x1f')](_0x52c2cd,_0x17b7bd,!![]);}catch(_0x2810f5){return BPromise[_0x9105('0x20')](_0x2810f5);}return _0x52c2cd[_0x9105('0x21')]();};}function saveUpdates(_0x456b67,_0x308060){return function(_0x47a77e){if(_0x47a77e){return _0x47a77e[_0x9105('0x22')](_0x456b67)[_0x9105('0x23')](function(_0x2e6988){return _0x2e6988;});}return null;};}function removeEntity(_0x458264,_0x1be4dd){return function(_0x432025){if(_0x432025){return _0x432025[_0x9105('0x24')]()[_0x9105('0x23')](function(){_0x458264[_0x9105('0x18')](0xcc)[_0x9105('0x17')]();});}};}function handleEntityNotFound(_0x2d83e2,_0x59f4c3){return function(_0x3a66f1){if(!_0x3a66f1){_0x2d83e2[_0x9105('0x16')](0x194);}return _0x3a66f1;};}function handleError(_0x2cc932,_0x46d46c){_0x46d46c=_0x46d46c||0x1f4;return function(_0x3f660c){logger[_0x9105('0x25')](_0x3f660c['stack']);if(_0x3f660c[_0x9105('0x26')]){delete _0x3f660c[_0x9105('0x26')];}_0x2cc932[_0x9105('0x18')](_0x46d46c)['send'](_0x3f660c);};}exports[_0x9105('0x27')]=function(_0x148045,_0xb7e049){var _0x51e31f={},_0x3d22b2={},_0x3b6e0d={'count':0x0,'rows':[]};var _0x26f5a3=_['map'](db['ChatQueueReport'][_0x9105('0x28')],function(_0x1a282f){return{'name':_0x1a282f[_0x9105('0x29')],'type':_0x1a282f['type'][_0x9105('0x2a')]};});_0x3d22b2[_0x9105('0x2b')]=_['map'](_0x26f5a3,_0x9105('0x26'));_0x3d22b2[_0x9105('0x2c')]=_[_0x9105('0x2d')](_0x148045['query']);_0x3d22b2['filters']=_['intersection'](_0x3d22b2['model'],_0x3d22b2[_0x9105('0x2c')]);_0x51e31f['attributes']=_[_0x9105('0x2e')](_0x3d22b2['model'],qs[_0x9105('0x2f')](_0x148045[_0x9105('0x2c')][_0x9105('0x2f')]));_0x51e31f[_0x9105('0x30')]=_0x51e31f[_0x9105('0x30')]['length']?_0x51e31f[_0x9105('0x30')]:_0x3d22b2[_0x9105('0x2b')];if(!_0x148045[_0x9105('0x2c')][_0x9105('0x31')]('nolimit')){_0x51e31f[_0x9105('0x1b')]=qs[_0x9105('0x1b')](_0x148045[_0x9105('0x2c')][_0x9105('0x1b')]);_0x51e31f['offset']=qs[_0x9105('0x19')](_0x148045[_0x9105('0x2c')][_0x9105('0x19')]);}_0x51e31f[_0x9105('0x32')]=qs[_0x9105('0x33')](_0x148045[_0x9105('0x2c')][_0x9105('0x33')]);_0x51e31f[_0x9105('0x34')]=qs['filters'](_[_0x9105('0x35')](_0x148045[_0x9105('0x2c')],_0x3d22b2[_0x9105('0x36')]),_0x26f5a3);if(_0x148045['query'][_0x9105('0x37')]){_0x51e31f[_0x9105('0x34')]=_[_0x9105('0x38')](_0x51e31f[_0x9105('0x34')],{'$or':_[_0x9105('0x39')](_0x26f5a3,function(_0x25270b){if(_0x25270b['type']!==_0x9105('0x3a')){var _0x120ccc={};_0x120ccc[_0x25270b[_0x9105('0x26')]]={'$like':'%'+_0x148045[_0x9105('0x2c')]['filter']+'%'};return _0x120ccc;}})});}_0x51e31f=_[_0x9105('0x38')]({},_0x51e31f,_0x148045[_0x9105('0x3b')]);var _0x4c3b98={'where':_0x51e31f[_0x9105('0x34')]};return db[_0x9105('0x3c')][_0x9105('0x1c')](_0x4c3b98)[_0x9105('0x23')](function(_0x46c5bf){_0x3b6e0d[_0x9105('0x1c')]=_0x46c5bf;if(_0x148045[_0x9105('0x2c')][_0x9105('0x3d')]){_0x51e31f['include']=[{'all':!![]}];}return db[_0x9105('0x3c')][_0x9105('0x3e')](_0x51e31f);})[_0x9105('0x23')](function(_0x49a677){_0x3b6e0d['rows']=_0x49a677;return _0x3b6e0d;})['then'](respondWithFilteredResult(_0xb7e049,_0x51e31f))['catch'](handleError(_0xb7e049,null));};exports[_0x9105('0x3f')]=function(_0x5c86df,_0x18a6c3){var _0x40e968={'raw':!![],'where':{'id':_0x5c86df['params']['id']}},_0x27703c={};_0x27703c[_0x9105('0x2b')]=_[_0x9105('0x2d')](db[_0x9105('0x3c')][_0x9105('0x28')]);_0x27703c[_0x9105('0x2c')]=_[_0x9105('0x2d')](_0x5c86df[_0x9105('0x2c')]);_0x27703c[_0x9105('0x36')]=_[_0x9105('0x2e')](_0x27703c[_0x9105('0x2b')],_0x27703c[_0x9105('0x2c')]);_0x40e968[_0x9105('0x30')]=_['intersection'](_0x27703c[_0x9105('0x2b')],qs[_0x9105('0x2f')](_0x5c86df[_0x9105('0x2c')][_0x9105('0x2f')]));_0x40e968[_0x9105('0x30')]=_0x40e968['attributes']['length']?_0x40e968[_0x9105('0x30')]:_0x27703c[_0x9105('0x2b')];if(_0x5c86df[_0x9105('0x2c')][_0x9105('0x3d')]){_0x40e968[_0x9105('0x40')]=[{'all':!![]}];}_0x40e968=_['merge']({},_0x40e968,_0x5c86df['options']);return db[_0x9105('0x3c')][_0x9105('0x41')](_0x40e968)[_0x9105('0x23')](handleEntityNotFound(_0x18a6c3,null))[_0x9105('0x23')](respondWithResult(_0x18a6c3,null))[_0x9105('0x42')](handleError(_0x18a6c3,null));};exports[_0x9105('0x43')]=function(_0x267c14,_0x34551e){return db[_0x9105('0x3c')][_0x9105('0x43')](_0x267c14[_0x9105('0x44')],{})[_0x9105('0x23')](respondWithResult(_0x34551e,0xc9))[_0x9105('0x42')](handleError(_0x34551e,null));};exports['update']=function(_0x191c73,_0x5e51bd){if(_0x191c73[_0x9105('0x44')]['id']){delete _0x191c73['body']['id'];}return db[_0x9105('0x3c')][_0x9105('0x41')]({'where':{'id':_0x191c73[_0x9105('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e51bd,null))[_0x9105('0x23')](saveUpdates(_0x191c73[_0x9105('0x44')],null))['then'](respondWithResult(_0x5e51bd,null))[_0x9105('0x42')](handleError(_0x5e51bd,null));};exports[_0x9105('0x24')]=function(_0x12ad8d,_0x15145a){return db[_0x9105('0x3c')][_0x9105('0x41')]({'where':{'id':_0x12ad8d['params']['id']}})[_0x9105('0x23')](handleEntityNotFound(_0x15145a,null))[_0x9105('0x23')](removeEntity(_0x15145a,null))[_0x9105('0x42')](handleError(_0x15145a,null));};exports[_0x9105('0x46')]=function(_0x2591f3,_0x173ce6){return db['ChatQueueReport'][_0x9105('0x46')]()[_0x9105('0x23')](respondWithResult(_0x173ce6,null))[_0x9105('0x42')](handleError(_0x173ce6,null));};
\ No newline at end of file
index a056a23..a4d67cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x562922,_0x4121fd){var _0x785095=function(_0xfa93f6){while(--_0xfa93f6){_0x562922['push'](_0x562922['shift']());}};_0x785095(++_0x4121fd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x283127,_0x54d4d5){var _0x43da5d=function(_0x10947f){while(--_0x10947f){_0x283127['push'](_0x283127['shift']());}};_0x43da5d(++_0x54d4d5);}(_0xb10b,0x12a));var _0xbb10=function(_0x1255d6,_0x481067){_0x1255d6=_0x1255d6-0x0;var _0x1397af=_0xb10b[_0x1255d6];return _0x1397af;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 6ba74b4..3186e46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24a9=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','create','body','options','then','debug','UpdateChatQueueReport','ChatQueueReport','update','raw','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x153597,_0x492f6f){var _0x27d9de=function(_0x42f31f){while(--_0x42f31f){_0x153597['push'](_0x153597['shift']());}};_0x27d9de(++_0x492f6f);}(_0x24a9,0xf9));var _0x924a=function(_0x30c323,_0x1d2dff){_0x30c323=_0x30c323-0x0;var _0x10d168=_0x24a9[_0x30c323];return _0x10d168;};'use strict';var _=require(_0x924a('0x0'));var util=require(_0x924a('0x1'));var moment=require('moment');var BPromise=require(_0x924a('0x2'));var rs=require(_0x924a('0x3'));var fs=require('fs');var Redis=require(_0x924a('0x4'));var db=require(_0x924a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x924a('0x6'))(_0x924a('0x7'));var config=require(_0x924a('0x8'));var jayson=require(_0x924a('0x9'));var client=jayson[_0x924a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x557b12,_0x31063e,_0x59b79a){return new BPromise(function(_0x4a7e89,_0x5cb5a3){return client[_0x924a('0xb')](_0x557b12,_0x59b79a)['then'](function(_0x4475f6){logger[_0x924a('0xc')](_0x924a('0xd'),_0x31063e,_0x924a('0xe'));logger['debug'](_0x924a('0xf'),_0x31063e,_0x924a('0xe'),JSON[_0x924a('0x10')](_0x4475f6));if(_0x4475f6[_0x924a('0x11')]){if(_0x4475f6[_0x924a('0x11')]['code']===0x1f4){logger[_0x924a('0x11')](_0x924a('0xd'),_0x31063e,_0x4475f6['error'][_0x924a('0x12')]);return _0x5cb5a3(_0x4475f6['error'][_0x924a('0x12')]);}logger['error'](_0x924a('0xd'),_0x31063e,_0x4475f6[_0x924a('0x11')]['message']);return _0x4a7e89(_0x4475f6[_0x924a('0x11')][_0x924a('0x12')]);}else{logger['info'](_0x924a('0xd'),_0x31063e,_0x924a('0xe'));_0x4a7e89(_0x4475f6[_0x924a('0x13')][_0x924a('0x12')]);}})[_0x924a('0x14')](function(_0x290331){logger[_0x924a('0x11')](_0x924a('0xd'),_0x31063e,_0x290331);_0x5cb5a3(_0x290331);});});}exports[_0x924a('0x15')]=function(_0x5c09f2){var _0x40966d=this;return new Promise(function(_0x319af9,_0x3fffb5){return db['ChatQueueReport'][_0x924a('0x16')](_0x5c09f2[_0x924a('0x17')],{'raw':_0x5c09f2[_0x924a('0x18')]?_0x5c09f2[_0x924a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x924a('0x19')](function(_0xb86ce5){logger['info'](_0x924a('0x15'),_0x5c09f2);logger[_0x924a('0x1a')]('CreateChatQueueReport',_0x5c09f2,JSON['stringify'](_0xb86ce5));_0x319af9(_0xb86ce5);})[_0x924a('0x14')](function(_0x321bd7){logger[_0x924a('0x11')]('CreateChatQueueReport',_0x321bd7[_0x924a('0x12')],_0x5c09f2);_0x3fffb5(_0x40966d[_0x924a('0x11')](0x1f4,_0x321bd7['message']));});});};exports[_0x924a('0x1b')]=function(_0x53f314){var _0x54ac7d=this;return new Promise(function(_0x35f74f,_0x580169){return db[_0x924a('0x1c')][_0x924a('0x1d')](_0x53f314[_0x924a('0x17')],{'raw':_0x53f314[_0x924a('0x18')]?_0x53f314['options'][_0x924a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53f314['options']?_0x53f314[_0x924a('0x18')]['where']||null:null,'attributes':_0x53f314['options']?_0x53f314['options'][_0x924a('0x1f')]||null:null,'limit':_0x53f314['options']?_0x53f314[_0x924a('0x18')][_0x924a('0x20')]||null:null})[_0x924a('0x19')](function(_0x157add){logger[_0x924a('0xc')](_0x924a('0x1b'),_0x53f314);logger[_0x924a('0x1a')](_0x924a('0x1b'),_0x53f314,JSON['stringify'](_0x157add));_0x35f74f(_0x157add);})[_0x924a('0x14')](function(_0x3bed28){logger[_0x924a('0x11')](_0x924a('0x1b'),_0x3bed28[_0x924a('0x12')],_0x53f314);_0x580169(_0x54ac7d[_0x924a('0x11')](0x1f4,_0x3bed28[_0x924a('0x12')]));});});};
\ No newline at end of file
+var _0xd7ff=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment'];(function(_0x5bbd54,_0x467cba){var _0x3da3f4=function(_0x77b7e7){while(--_0x77b7e7){_0x5bbd54['push'](_0x5bbd54['shift']());}};_0x3da3f4(++_0x467cba);}(_0xd7ff,0xeb));var _0xfd7f=function(_0x5e41a7,_0x5159a3){_0x5e41a7=_0x5e41a7-0x0;var _0x443277=_0xd7ff[_0x5e41a7];return _0x443277;};'use strict';var _=require(_0xfd7f('0x0'));var util=require(_0xfd7f('0x1'));var moment=require(_0xfd7f('0x2'));var BPromise=require(_0xfd7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd7f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd7f('0x5'));var logger=require(_0xfd7f('0x6'))(_0xfd7f('0x7'));var config=require(_0xfd7f('0x8'));var jayson=require(_0xfd7f('0x9'));var client=jayson[_0xfd7f('0xa')][_0xfd7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x432faf,_0x14744a,_0x6963ea){return new BPromise(function(_0x4b660a,_0x42e057){return client[_0xfd7f('0xc')](_0x432faf,_0x6963ea)[_0xfd7f('0xd')](function(_0x5d6ac1){logger['info'](_0xfd7f('0xe'),_0x14744a,_0xfd7f('0xf'));logger[_0xfd7f('0x10')](_0xfd7f('0x11'),_0x14744a,'request\x20sent',JSON[_0xfd7f('0x12')](_0x5d6ac1));if(_0x5d6ac1[_0xfd7f('0x13')]){if(_0x5d6ac1['error'][_0xfd7f('0x14')]===0x1f4){logger['error'](_0xfd7f('0xe'),_0x14744a,_0x5d6ac1[_0xfd7f('0x13')][_0xfd7f('0x15')]);return _0x42e057(_0x5d6ac1['error'][_0xfd7f('0x15')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x14744a,_0x5d6ac1[_0xfd7f('0x13')][_0xfd7f('0x15')]);return _0x4b660a(_0x5d6ac1[_0xfd7f('0x13')][_0xfd7f('0x15')]);}else{logger[_0xfd7f('0x16')](_0xfd7f('0xe'),_0x14744a,_0xfd7f('0xf'));_0x4b660a(_0x5d6ac1['result'][_0xfd7f('0x15')]);}})['catch'](function(_0x359b31){logger['error'](_0xfd7f('0xe'),_0x14744a,_0x359b31);_0x42e057(_0x359b31);});});}exports[_0xfd7f('0x17')]=function(_0x242dd8){var _0x5d83a6=this;return new Promise(function(_0xa97167,_0x5b10af){return db[_0xfd7f('0x18')][_0xfd7f('0x19')](_0x242dd8[_0xfd7f('0x1a')],{'raw':_0x242dd8[_0xfd7f('0x1b')]?_0x242dd8[_0xfd7f('0x1b')][_0xfd7f('0x1c')]===undefined?!![]:![]:!![]})[_0xfd7f('0xd')](function(_0x5402b3){logger[_0xfd7f('0x16')](_0xfd7f('0x17'),_0x242dd8);logger[_0xfd7f('0x10')](_0xfd7f('0x17'),_0x242dd8,JSON[_0xfd7f('0x12')](_0x5402b3));_0xa97167(_0x5402b3);})[_0xfd7f('0x1d')](function(_0x3e879c){logger[_0xfd7f('0x13')](_0xfd7f('0x17'),_0x3e879c['message'],_0x242dd8);_0x5b10af(_0x5d83a6[_0xfd7f('0x13')](0x1f4,_0x3e879c[_0xfd7f('0x15')]));});});};exports[_0xfd7f('0x1e')]=function(_0x15c6d8){var _0x51cf76=this;return new Promise(function(_0x8e57cc,_0x549adb){return db[_0xfd7f('0x18')]['update'](_0x15c6d8[_0xfd7f('0x1a')],{'raw':_0x15c6d8[_0xfd7f('0x1b')]?_0x15c6d8[_0xfd7f('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15c6d8[_0xfd7f('0x1b')]?_0x15c6d8['options'][_0xfd7f('0x1f')]||null:null,'attributes':_0x15c6d8['options']?_0x15c6d8[_0xfd7f('0x1b')][_0xfd7f('0x20')]||null:null,'limit':_0x15c6d8[_0xfd7f('0x1b')]?_0x15c6d8['options'][_0xfd7f('0x21')]||null:null})[_0xfd7f('0xd')](function(_0x55d990){logger['info'](_0xfd7f('0x1e'),_0x15c6d8);logger[_0xfd7f('0x10')]('UpdateChatQueueReport',_0x15c6d8,JSON['stringify'](_0x55d990));_0x8e57cc(_0x55d990);})[_0xfd7f('0x1d')](function(_0x1db7c3){logger[_0xfd7f('0x13')](_0xfd7f('0x1e'),_0x1db7c3[_0xfd7f('0x15')],_0x15c6d8);_0x549adb(_0x51cf76[_0xfd7f('0x13')](0x1f4,_0x1db7c3[_0xfd7f('0x15')]));});});};
\ No newline at end of file
index a5c48ef..65ad96c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82e8=['post','create','/:id','update','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','/describe','get','show'];(function(_0x58f0c5,_0x2b3333){var _0x3afd3b=function(_0x459640){while(--_0x459640){_0x58f0c5['push'](_0x58f0c5['shift']());}};_0x3afd3b(++_0x2b3333);}(_0x82e8,0x1da));var _0x882e=function(_0x1b1c65,_0x23ca6d){_0x1b1c65=_0x1b1c65-0x0;var _0x1b86d9=_0x82e8[_0x1b1c65];return _0x1b86d9;};'use strict';var multer=require('multer');var util=require(_0x882e('0x0'));var path=require(_0x882e('0x1'));var timeout=require('connect-timeout');var express=require(_0x882e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x882e('0x3'));var interaction=require(_0x882e('0x4'));var config=require(_0x882e('0x5'));var controller=require(_0x882e('0x6'));router['get']('/',auth[_0x882e('0x7')](),controller[_0x882e('0x8')]);router['get'](_0x882e('0x9'),auth[_0x882e('0x7')](),controller['describe']);router[_0x882e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x882e('0xb')]);router[_0x882e('0xc')]('/',auth[_0x882e('0x7')](),controller[_0x882e('0xd')]);router['put'](_0x882e('0xe'),auth['isAuthenticated'](),controller[_0x882e('0xf')]);router['delete'](_0x882e('0xe'),auth[_0x882e('0x7')](),controller[_0x882e('0x10')]);module[_0x882e('0x11')]=router;
\ No newline at end of file
+var _0xa2b3=['get','isAuthenticated','index','/describe','/:id','show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd5a40e,_0x555d9d){var _0x26c9ef=function(_0xbf51a5){while(--_0xbf51a5){_0xd5a40e['push'](_0xd5a40e['shift']());}};_0x26c9ef(++_0x555d9d);}(_0xa2b3,0x1ad));var _0x3a2b=function(_0x4cea46,_0x23e5b0){_0x4cea46=_0x4cea46-0x0;var _0x42ae71=_0xa2b3[_0x4cea46];return _0x42ae71;};'use strict';var multer=require(_0x3a2b('0x0'));var util=require(_0x3a2b('0x1'));var path=require('path');var timeout=require(_0x3a2b('0x2'));var express=require(_0x3a2b('0x3'));var router=express[_0x3a2b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a2b('0x5'));var interaction=require(_0x3a2b('0x6'));var config=require(_0x3a2b('0x7'));var controller=require('./chatQueueReport.controller');router[_0x3a2b('0x8')]('/',auth[_0x3a2b('0x9')](),controller[_0x3a2b('0xa')]);router[_0x3a2b('0x8')](_0x3a2b('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3a2b('0x8')](_0x3a2b('0xc'),auth[_0x3a2b('0x9')](),controller[_0x3a2b('0xd')]);router['post']('/',auth[_0x3a2b('0x9')](),controller[_0x3a2b('0xe')]);router[_0x3a2b('0xf')](_0x3a2b('0xc'),auth[_0x3a2b('0x9')](),controller[_0x3a2b('0x10')]);router['delete'](_0x3a2b('0xc'),auth[_0x3a2b('0x9')](),controller[_0x3a2b('0x11')]);module[_0x3a2b('0x12')]=router;
\ No newline at end of file
index 911d7f9..603d2fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0xb90019,_0xf476f6){var _0x3e0a14=function(_0x29423c){while(--_0x29423c){_0xb90019['push'](_0xb90019['shift']());}};_0x3e0a14(++_0xf476f6);}(_0x00bb,0x1d8));var _0xb00b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x00bb[_0x618414];return _0x21c19a;};'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
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x39c671,_0x226e54){_0x39c671=_0x39c671-0x0;var _0x8df25f=_0x9bde[_0x39c671];return _0x8df25f;};'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
index 91f14df..33bf800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec11=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport'];(function(_0x334d52,_0x40d32b){var _0x32aacf=function(_0x2a904e){while(--_0x2a904e){_0x334d52['push'](_0x334d52['shift']());}};_0x32aacf(++_0x40d32b);}(_0xec11,0x157));var _0x1ec1=function(_0x4c4d96,_0x4bf323){_0x4c4d96=_0x4c4d96-0x0;var _0x25c99a=_0xec11[_0x4c4d96];return _0x25c99a;};'use strict';var emlformat=require(_0x1ec1('0x0'));var rimraf=require(_0x1ec1('0x1'));var zipdir=require(_0x1ec1('0x2'));var jsonpatch=require(_0x1ec1('0x3'));var rp=require(_0x1ec1('0x4'));var moment=require(_0x1ec1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1ec1('0x6'));var util=require(_0x1ec1('0x7'));var path=require(_0x1ec1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ec1('0x9'));var fs=require('fs');var fs_extra=require(_0x1ec1('0xa'));var _=require(_0x1ec1('0xb'));var squel=require(_0x1ec1('0xc'));var crypto=require(_0x1ec1('0xd'));var jsforce=require(_0x1ec1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ec1('0xf'));var Papa=require(_0x1ec1('0x10'));var Redis=require(_0x1ec1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ec1('0x12'));var hardwareService=require(_0x1ec1('0x13'));var logger=require(_0x1ec1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1ec1('0x15'));var licenseUtil=require(_0x1ec1('0x16'));var db=require(_0x1ec1('0x17'))['db'];function respondWithStatusCode(_0x595fb6,_0x2f430b){_0x2f430b=_0x2f430b||0xcc;return function(_0x167159){if(_0x167159){return _0x595fb6['sendStatus'](_0x2f430b);}return _0x595fb6[_0x1ec1('0x18')](_0x2f430b)[_0x1ec1('0x19')]();};}function respondWithResult(_0x5f00a1,_0x3a8854){_0x3a8854=_0x3a8854||0xc8;return function(_0x52d7cc){if(_0x52d7cc){return _0x5f00a1[_0x1ec1('0x18')](_0x3a8854)[_0x1ec1('0x1a')](_0x52d7cc);}};}function respondWithFilteredResult(_0x4a8b31,_0x2f5460){return function(_0x57706a){if(_0x57706a){var _0x4a1380=typeof _0x2f5460[_0x1ec1('0x1b')]==='undefined'&&typeof _0x2f5460['limit']===_0x1ec1('0x1c');var _0x3d94e5=_0x57706a[_0x1ec1('0x1d')];var _0x13134b=_0x4a1380?0x0:_0x2f5460[_0x1ec1('0x1b')];var _0x315d8d=_0x4a1380?_0x57706a['count']:_0x2f5460[_0x1ec1('0x1b')]+_0x2f5460[_0x1ec1('0x1e')];var _0x24ebb0;if(_0x315d8d>=_0x3d94e5){_0x315d8d=_0x3d94e5;_0x24ebb0=0xc8;}else{_0x24ebb0=0xce;}_0x4a8b31[_0x1ec1('0x18')](_0x24ebb0);return _0x4a8b31[_0x1ec1('0x1f')](_0x1ec1('0x20'),_0x13134b+'-'+_0x315d8d+'/'+_0x3d94e5)[_0x1ec1('0x1a')](_0x57706a);}return null;};}function patchUpdates(_0x415b2a){return function(_0x30c10e){try{jsonpatch[_0x1ec1('0x21')](_0x30c10e,_0x415b2a,!![]);}catch(_0x547951){return BPromise[_0x1ec1('0x22')](_0x547951);}return _0x30c10e[_0x1ec1('0x23')]();};}function saveUpdates(_0x2fda34,_0x1ab561){return function(_0xcf41f1){if(_0xcf41f1){return _0xcf41f1[_0x1ec1('0x24')](_0x2fda34)['then'](function(_0x297ce5){return _0x297ce5;});}return null;};}function removeEntity(_0x287c45,_0x24a197){return function(_0x1e2b97){if(_0x1e2b97){return _0x1e2b97[_0x1ec1('0x25')]()[_0x1ec1('0x26')](function(){_0x287c45[_0x1ec1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b14af,_0x20ead9){return function(_0x4fead1){if(!_0x4fead1){_0x4b14af[_0x1ec1('0x27')](0x194);}return _0x4fead1;};}function handleError(_0x59f0c5,_0x16cc86){_0x16cc86=_0x16cc86||0x1f4;return function(_0x50fb1f){logger[_0x1ec1('0x28')](_0x50fb1f[_0x1ec1('0x29')]);if(_0x50fb1f[_0x1ec1('0x2a')]){delete _0x50fb1f['name'];}_0x59f0c5[_0x1ec1('0x18')](_0x16cc86)[_0x1ec1('0x2b')](_0x50fb1f);};}exports[_0x1ec1('0x2c')]=function(_0x447eae,_0xc67f93){var _0xa940b5={},_0x2441dd={},_0x52bc72={'count':0x0,'rows':[]};var _0x30a432=_[_0x1ec1('0x2d')](db[_0x1ec1('0x2e')][_0x1ec1('0x2f')],function(_0x1ced7f){return{'name':_0x1ced7f[_0x1ec1('0x30')],'type':_0x1ced7f[_0x1ec1('0x31')][_0x1ec1('0x32')]};});_0x2441dd['model']=_['map'](_0x30a432,_0x1ec1('0x2a'));_0x2441dd[_0x1ec1('0x33')]=_[_0x1ec1('0x34')](_0x447eae['query']);_0x2441dd[_0x1ec1('0x35')]=_[_0x1ec1('0x36')](_0x2441dd[_0x1ec1('0x37')],_0x2441dd['query']);_0xa940b5['attributes']=_[_0x1ec1('0x36')](_0x2441dd[_0x1ec1('0x37')],qs[_0x1ec1('0x38')](_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x38')]));_0xa940b5[_0x1ec1('0x39')]=_0xa940b5[_0x1ec1('0x39')][_0x1ec1('0x3a')]?_0xa940b5[_0x1ec1('0x39')]:_0x2441dd['model'];if(!_0x447eae['query'][_0x1ec1('0x3b')]('nolimit')){_0xa940b5[_0x1ec1('0x1e')]=qs[_0x1ec1('0x1e')](_0x447eae['query']['limit']);_0xa940b5[_0x1ec1('0x1b')]=qs['offset'](_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x1b')]);}_0xa940b5[_0x1ec1('0x3c')]=qs[_0x1ec1('0x3d')](_0x447eae[_0x1ec1('0x33')]['sort']);_0xa940b5['where']=qs[_0x1ec1('0x35')](_[_0x1ec1('0x3e')](_0x447eae[_0x1ec1('0x33')],_0x2441dd['filters']),_0x30a432);if(_0x447eae['query']['filter']){_0xa940b5[_0x1ec1('0x3f')]=_[_0x1ec1('0x40')](_0xa940b5[_0x1ec1('0x3f')],{'$or':_[_0x1ec1('0x2d')](_0x30a432,function(_0x380fe6){if(_0x380fe6[_0x1ec1('0x31')]!==_0x1ec1('0x41')){var _0x405356={};_0x405356[_0x380fe6['name']]={'$like':'%'+_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x42')]+'%'};return _0x405356;}})});}_0xa940b5=_[_0x1ec1('0x40')]({},_0xa940b5,_0x447eae[_0x1ec1('0x43')]);var _0x5764d8={'where':_0xa940b5[_0x1ec1('0x3f')]};return db[_0x1ec1('0x2e')][_0x1ec1('0x1d')](_0x5764d8)[_0x1ec1('0x26')](function(_0x6d72a5){_0x52bc72[_0x1ec1('0x1d')]=_0x6d72a5;if(_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x44')]){_0xa940b5[_0x1ec1('0x45')]=[{'all':!![]}];}return db[_0x1ec1('0x2e')][_0x1ec1('0x46')](_0xa940b5);})[_0x1ec1('0x26')](function(_0x39d19c){_0x52bc72['rows']=_0x39d19c;return _0x52bc72;})[_0x1ec1('0x26')](respondWithFilteredResult(_0xc67f93,_0xa940b5))[_0x1ec1('0x47')](handleError(_0xc67f93,null));};exports[_0x1ec1('0x48')]=function(_0x118ea2,_0x5192bf){var _0x2940b5={'raw':!![],'where':{'id':_0x118ea2[_0x1ec1('0x49')]['id']}},_0x3974df={};_0x3974df[_0x1ec1('0x37')]=_[_0x1ec1('0x34')](db[_0x1ec1('0x2e')]['rawAttributes']);_0x3974df[_0x1ec1('0x33')]=_['keys'](_0x118ea2[_0x1ec1('0x33')]);_0x3974df[_0x1ec1('0x35')]=_[_0x1ec1('0x36')](_0x3974df[_0x1ec1('0x37')],_0x3974df[_0x1ec1('0x33')]);_0x2940b5['attributes']=_[_0x1ec1('0x36')](_0x3974df[_0x1ec1('0x37')],qs['fields'](_0x118ea2[_0x1ec1('0x33')][_0x1ec1('0x38')]));_0x2940b5[_0x1ec1('0x39')]=_0x2940b5['attributes']['length']?_0x2940b5[_0x1ec1('0x39')]:_0x3974df[_0x1ec1('0x37')];if(_0x118ea2[_0x1ec1('0x33')][_0x1ec1('0x44')]){_0x2940b5[_0x1ec1('0x45')]=[{'all':!![]}];}_0x2940b5=_[_0x1ec1('0x40')]({},_0x2940b5,_0x118ea2[_0x1ec1('0x43')]);return db[_0x1ec1('0x2e')]['find'](_0x2940b5)['then'](handleEntityNotFound(_0x5192bf,null))[_0x1ec1('0x26')](respondWithResult(_0x5192bf,null))[_0x1ec1('0x47')](handleError(_0x5192bf,null));};exports[_0x1ec1('0x4a')]=function(_0x384017,_0x696b3a){return db['ChatTransferReport']['create'](_0x384017[_0x1ec1('0x4b')],{})[_0x1ec1('0x26')](respondWithResult(_0x696b3a,0xc9))[_0x1ec1('0x47')](handleError(_0x696b3a,null));};exports[_0x1ec1('0x24')]=function(_0x5481a6,_0x2e6c66){if(_0x5481a6['body']['id']){delete _0x5481a6[_0x1ec1('0x4b')]['id'];}return db[_0x1ec1('0x2e')][_0x1ec1('0x4c')]({'where':{'id':_0x5481a6['params']['id']}})['then'](handleEntityNotFound(_0x2e6c66,null))[_0x1ec1('0x26')](saveUpdates(_0x5481a6[_0x1ec1('0x4b')],null))['then'](respondWithResult(_0x2e6c66,null))[_0x1ec1('0x47')](handleError(_0x2e6c66,null));};exports[_0x1ec1('0x25')]=function(_0x5360dc,_0x1dedb2){return db[_0x1ec1('0x2e')][_0x1ec1('0x4c')]({'where':{'id':_0x5360dc['params']['id']}})[_0x1ec1('0x26')](handleEntityNotFound(_0x1dedb2,null))[_0x1ec1('0x26')](removeEntity(_0x1dedb2,null))['catch'](handleError(_0x1dedb2,null));};exports[_0x1ec1('0x4d')]=function(_0x26657d,_0x25f929){return db[_0x1ec1('0x2e')][_0x1ec1('0x4d')]()['then'](respondWithResult(_0x25f929,null))[_0x1ec1('0x47')](handleError(_0x25f929,null));};
\ No newline at end of file
+var _0x0f2e=['ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','ChatTransferReport','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox'];(function(_0x2ba6e8,_0x4dccea){var _0x49474f=function(_0x5d25a0){while(--_0x5d25a0){_0x2ba6e8['push'](_0x2ba6e8['shift']());}};_0x49474f(++_0x4dccea);}(_0x0f2e,0x1b5));var _0xe0f2=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x0f2e[_0x5e709a];return _0x57401a;};'use strict';var emlformat=require(_0xe0f2('0x0'));var rimraf=require(_0xe0f2('0x1'));var zipdir=require(_0xe0f2('0x2'));var jsonpatch=require(_0xe0f2('0x3'));var rp=require('request-promise');var moment=require(_0xe0f2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe0f2('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe0f2('0x6'));var csv=require('to-csv');var ejs=require(_0xe0f2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0f2('0x8'));var squel=require(_0xe0f2('0x9'));var crypto=require(_0xe0f2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe0f2('0xb'));var toCsv=require(_0xe0f2('0xc'));var querystring=require(_0xe0f2('0xd'));var Papa=require(_0xe0f2('0xe'));var Redis=require(_0xe0f2('0xf'));var authService=require(_0xe0f2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0f2('0x11'))(_0xe0f2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x221c53,_0x567fa7){_0x567fa7=_0x567fa7||0xcc;return function(_0x2ec4e1){if(_0x2ec4e1){return _0x221c53['sendStatus'](_0x567fa7);}return _0x221c53[_0xe0f2('0x13')](_0x567fa7)[_0xe0f2('0x14')]();};}function respondWithResult(_0x50a009,_0x59ca35){_0x59ca35=_0x59ca35||0xc8;return function(_0x1b8ff7){if(_0x1b8ff7){return _0x50a009['status'](_0x59ca35)[_0xe0f2('0x15')](_0x1b8ff7);}};}function respondWithFilteredResult(_0x4854bb,_0x5d759d){return function(_0x412a2f){if(_0x412a2f){var _0x4161f0=typeof _0x5d759d[_0xe0f2('0x16')]===_0xe0f2('0x17')&&typeof _0x5d759d[_0xe0f2('0x18')]===_0xe0f2('0x17');var _0x3c7dad=_0x412a2f[_0xe0f2('0x19')];var _0x43d06d=_0x4161f0?0x0:_0x5d759d['offset'];var _0x1b639d=_0x4161f0?_0x412a2f['count']:_0x5d759d[_0xe0f2('0x16')]+_0x5d759d['limit'];var _0x5d7dd0;if(_0x1b639d>=_0x3c7dad){_0x1b639d=_0x3c7dad;_0x5d7dd0=0xc8;}else{_0x5d7dd0=0xce;}_0x4854bb[_0xe0f2('0x13')](_0x5d7dd0);return _0x4854bb[_0xe0f2('0x1a')](_0xe0f2('0x1b'),_0x43d06d+'-'+_0x1b639d+'/'+_0x3c7dad)[_0xe0f2('0x15')](_0x412a2f);}return null;};}function patchUpdates(_0x4bdbb9){return function(_0x35de14){try{jsonpatch[_0xe0f2('0x1c')](_0x35de14,_0x4bdbb9,!![]);}catch(_0x2b3ad1){return BPromise[_0xe0f2('0x1d')](_0x2b3ad1);}return _0x35de14[_0xe0f2('0x1e')]();};}function saveUpdates(_0x1d1d79,_0x1a6188){return function(_0x1d7f41){if(_0x1d7f41){return _0x1d7f41[_0xe0f2('0x1f')](_0x1d1d79)[_0xe0f2('0x20')](function(_0x541cc0){return _0x541cc0;});}return null;};}function removeEntity(_0x1bacdf,_0x1f5b0b){return function(_0xb37db3){if(_0xb37db3){return _0xb37db3['destroy']()['then'](function(){_0x1bacdf['status'](0xcc)[_0xe0f2('0x14')]();});}};}function handleEntityNotFound(_0x328405,_0x173a54){return function(_0x3e6edb){if(!_0x3e6edb){_0x328405[_0xe0f2('0x21')](0x194);}return _0x3e6edb;};}function handleError(_0x1d3642,_0x478ee3){_0x478ee3=_0x478ee3||0x1f4;return function(_0x2a6c00){logger[_0xe0f2('0x22')](_0x2a6c00[_0xe0f2('0x23')]);if(_0x2a6c00[_0xe0f2('0x24')]){delete _0x2a6c00[_0xe0f2('0x24')];}_0x1d3642[_0xe0f2('0x13')](_0x478ee3)[_0xe0f2('0x25')](_0x2a6c00);};}exports[_0xe0f2('0x26')]=function(_0x17a509,_0x3ceb14){var _0x370224={},_0xe6487d={},_0x5f1d2f={'count':0x0,'rows':[]};var _0x58730a=_[_0xe0f2('0x27')](db['ChatTransferReport'][_0xe0f2('0x28')],function(_0x58e933){return{'name':_0x58e933[_0xe0f2('0x29')],'type':_0x58e933[_0xe0f2('0x2a')][_0xe0f2('0x2b')]};});_0xe6487d[_0xe0f2('0x2c')]=_[_0xe0f2('0x27')](_0x58730a,_0xe0f2('0x24'));_0xe6487d[_0xe0f2('0x2d')]=_[_0xe0f2('0x2e')](_0x17a509['query']);_0xe6487d[_0xe0f2('0x2f')]=_[_0xe0f2('0x30')](_0xe6487d[_0xe0f2('0x2c')],_0xe6487d[_0xe0f2('0x2d')]);_0x370224[_0xe0f2('0x31')]=_['intersection'](_0xe6487d[_0xe0f2('0x2c')],qs[_0xe0f2('0x32')](_0x17a509[_0xe0f2('0x2d')]['fields']));_0x370224['attributes']=_0x370224['attributes'][_0xe0f2('0x33')]?_0x370224[_0xe0f2('0x31')]:_0xe6487d[_0xe0f2('0x2c')];if(!_0x17a509['query'][_0xe0f2('0x34')](_0xe0f2('0x35'))){_0x370224[_0xe0f2('0x18')]=qs[_0xe0f2('0x18')](_0x17a509['query'][_0xe0f2('0x18')]);_0x370224[_0xe0f2('0x16')]=qs['offset'](_0x17a509[_0xe0f2('0x2d')][_0xe0f2('0x16')]);}_0x370224[_0xe0f2('0x36')]=qs[_0xe0f2('0x37')](_0x17a509[_0xe0f2('0x2d')][_0xe0f2('0x37')]);_0x370224[_0xe0f2('0x38')]=qs[_0xe0f2('0x2f')](_[_0xe0f2('0x39')](_0x17a509[_0xe0f2('0x2d')],_0xe6487d['filters']),_0x58730a);if(_0x17a509[_0xe0f2('0x2d')]['filter']){_0x370224[_0xe0f2('0x38')]=_['merge'](_0x370224[_0xe0f2('0x38')],{'$or':_[_0xe0f2('0x27')](_0x58730a,function(_0x328cf1){if(_0x328cf1[_0xe0f2('0x2a')]!==_0xe0f2('0x3a')){var _0x37313e={};_0x37313e[_0x328cf1[_0xe0f2('0x24')]]={'$like':'%'+_0x17a509[_0xe0f2('0x2d')][_0xe0f2('0x3b')]+'%'};return _0x37313e;}})});}_0x370224=_[_0xe0f2('0x3c')]({},_0x370224,_0x17a509[_0xe0f2('0x3d')]);var _0x172cf0={'where':_0x370224[_0xe0f2('0x38')]};return db[_0xe0f2('0x3e')][_0xe0f2('0x19')](_0x172cf0)[_0xe0f2('0x20')](function(_0x14dca3){_0x5f1d2f[_0xe0f2('0x19')]=_0x14dca3;if(_0x17a509[_0xe0f2('0x2d')]['includeAll']){_0x370224[_0xe0f2('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe0f2('0x40')](_0x370224);})[_0xe0f2('0x20')](function(_0x5a713a){_0x5f1d2f[_0xe0f2('0x41')]=_0x5a713a;return _0x5f1d2f;})[_0xe0f2('0x20')](respondWithFilteredResult(_0x3ceb14,_0x370224))['catch'](handleError(_0x3ceb14,null));};exports[_0xe0f2('0x42')]=function(_0x4050d3,_0x24f310){var _0x49676d={'raw':!![],'where':{'id':_0x4050d3[_0xe0f2('0x43')]['id']}},_0x24d00d={};_0x24d00d[_0xe0f2('0x2c')]=_[_0xe0f2('0x2e')](db[_0xe0f2('0x3e')][_0xe0f2('0x28')]);_0x24d00d['query']=_[_0xe0f2('0x2e')](_0x4050d3[_0xe0f2('0x2d')]);_0x24d00d[_0xe0f2('0x2f')]=_[_0xe0f2('0x30')](_0x24d00d['model'],_0x24d00d[_0xe0f2('0x2d')]);_0x49676d[_0xe0f2('0x31')]=_[_0xe0f2('0x30')](_0x24d00d['model'],qs[_0xe0f2('0x32')](_0x4050d3[_0xe0f2('0x2d')][_0xe0f2('0x32')]));_0x49676d[_0xe0f2('0x31')]=_0x49676d['attributes']['length']?_0x49676d[_0xe0f2('0x31')]:_0x24d00d[_0xe0f2('0x2c')];if(_0x4050d3[_0xe0f2('0x2d')]['includeAll']){_0x49676d[_0xe0f2('0x3f')]=[{'all':!![]}];}_0x49676d=_[_0xe0f2('0x3c')]({},_0x49676d,_0x4050d3[_0xe0f2('0x3d')]);return db['ChatTransferReport'][_0xe0f2('0x44')](_0x49676d)['then'](handleEntityNotFound(_0x24f310,null))[_0xe0f2('0x20')](respondWithResult(_0x24f310,null))[_0xe0f2('0x45')](handleError(_0x24f310,null));};exports[_0xe0f2('0x46')]=function(_0x4061d9,_0x40032d){return db[_0xe0f2('0x3e')][_0xe0f2('0x46')](_0x4061d9[_0xe0f2('0x47')],{})['then'](respondWithResult(_0x40032d,0xc9))[_0xe0f2('0x45')](handleError(_0x40032d,null));};exports['update']=function(_0x449371,_0x479ce4){if(_0x449371[_0xe0f2('0x47')]['id']){delete _0x449371[_0xe0f2('0x47')]['id'];}return db[_0xe0f2('0x3e')][_0xe0f2('0x44')]({'where':{'id':_0x449371[_0xe0f2('0x43')]['id']}})[_0xe0f2('0x20')](handleEntityNotFound(_0x479ce4,null))[_0xe0f2('0x20')](saveUpdates(_0x449371['body'],null))[_0xe0f2('0x20')](respondWithResult(_0x479ce4,null))[_0xe0f2('0x45')](handleError(_0x479ce4,null));};exports[_0xe0f2('0x48')]=function(_0x2348a1,_0x722a05){return db[_0xe0f2('0x3e')][_0xe0f2('0x44')]({'where':{'id':_0x2348a1['params']['id']}})[_0xe0f2('0x20')](handleEntityNotFound(_0x722a05,null))[_0xe0f2('0x20')](removeEntity(_0x722a05,null))['catch'](handleError(_0x722a05,null));};exports[_0xe0f2('0x49')]=function(_0x313bbb,_0x2dfafd){return db['ChatTransferReport']['describe']()[_0xe0f2('0x20')](respondWithResult(_0x2dfafd,null))[_0xe0f2('0x45')](handleError(_0x2dfafd,null));};
\ No newline at end of file
index 1c5f654..32b836a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6afa=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6afa,0x149));var _0xa6af=function(_0x1600a6,_0x83165c){_0x1600a6=_0x1600a6-0x0;var _0x2a875e=_0x6afa[_0x1600a6];return _0x2a875e;};'use strict';var _=require(_0xa6af('0x0'));var util=require(_0xa6af('0x1'));var logger=require(_0xa6af('0x2'))(_0xa6af('0x3'));var moment=require(_0xa6af('0x4'));var BPromise=require(_0xa6af('0x5'));var rp=require(_0xa6af('0x6'));var fs=require('fs');var path=require(_0xa6af('0x7'));var rimraf=require(_0xa6af('0x8'));var config=require(_0xa6af('0x9'));var attributes=require(_0xa6af('0xa'));module[_0xa6af('0xb')]=function(_0x544994,_0x47d772){return _0x544994[_0xa6af('0xc')](_0xa6af('0xd'),attributes,{'tableName':_0xa6af('0xe'),'paranoid':![],'indexes':[{'name':_0xa6af('0xf'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd01=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xfd01,0x90));var _0x1fd0=function(_0x310a19,_0x1d6425){_0x310a19=_0x310a19-0x0;var _0x5bf709=_0xfd01[_0x310a19];return _0x5bf709;};'use strict';var _=require(_0x1fd0('0x0'));var util=require(_0x1fd0('0x1'));var logger=require(_0x1fd0('0x2'))(_0x1fd0('0x3'));var moment=require('moment');var BPromise=require(_0x1fd0('0x4'));var rp=require(_0x1fd0('0x5'));var fs=require('fs');var path=require(_0x1fd0('0x6'));var rimraf=require(_0x1fd0('0x7'));var config=require('../../config/environment');var attributes=require(_0x1fd0('0x8'));module['exports']=function(_0x547a5d,_0x392a6a){return _0x547a5d[_0x1fd0('0x9')](_0x1fd0('0xa'),attributes,{'tableName':_0x1fd0('0xb'),'paranoid':![],'indexes':[{'name':_0x1fd0('0xc'),'fields':[_0x1fd0('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index cede307..b0231b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7f7=['../../config/logger','jayson/promise','client','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x51e79c,_0x51485e){var _0x2467be=function(_0xbf70f0){while(--_0xbf70f0){_0x51e79c['push'](_0x51e79c['shift']());}};_0x2467be(++_0x51485e);}(_0xe7f7,0x118));var _0x7e7f=function(_0x4fbaf9,_0x3b8190){_0x4fbaf9=_0x4fbaf9-0x0;var _0x1d89a0=_0xe7f7[_0x4fbaf9];return _0x1d89a0;};'use strict';var _=require(_0x7e7f('0x0'));var util=require(_0x7e7f('0x1'));var moment=require(_0x7e7f('0x2'));var BPromise=require('bluebird');var rs=require(_0x7e7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e7f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7e7f('0x6'));var client=jayson[_0x7e7f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2671c8,_0x1abd4d,_0x42dba4){return new BPromise(function(_0x219bd8,_0x3b2740){return client[_0x7e7f('0x8')](_0x2671c8,_0x42dba4)[_0x7e7f('0x9')](function(_0x255203){logger[_0x7e7f('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x1abd4d,_0x7e7f('0xb'));logger['debug'](_0x7e7f('0xc'),_0x1abd4d,_0x7e7f('0xb'),JSON['stringify'](_0x255203));if(_0x255203['error']){if(_0x255203[_0x7e7f('0xd')][_0x7e7f('0xe')]===0x1f4){logger[_0x7e7f('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x1abd4d,_0x255203[_0x7e7f('0xd')][_0x7e7f('0xf')]);return _0x3b2740(_0x255203['error'][_0x7e7f('0xf')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1abd4d,_0x255203['error'][_0x7e7f('0xf')]);return _0x219bd8(_0x255203[_0x7e7f('0xd')][_0x7e7f('0xf')]);}else{logger[_0x7e7f('0xa')](_0x7e7f('0x10'),_0x1abd4d,_0x7e7f('0xb'));_0x219bd8(_0x255203[_0x7e7f('0x11')]['message']);}})[_0x7e7f('0x12')](function(_0xc0a32d){logger[_0x7e7f('0xd')](_0x7e7f('0x10'),_0x1abd4d,_0xc0a32d);_0x3b2740(_0xc0a32d);});});}
\ No newline at end of file
+var _0x1378=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1378,0x94));var _0x8137=function(_0x1bf39a,_0x5e6f7c){_0x1bf39a=_0x1bf39a-0x0;var _0x4887b9=_0x1378[_0x1bf39a];return _0x4887b9;};'use strict';var _=require(_0x8137('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8137('0x1'));var rs=require(_0x8137('0x2'));var fs=require('fs');var Redis=require(_0x8137('0x3'));var db=require(_0x8137('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8137('0x5'))(_0x8137('0x6'));var config=require(_0x8137('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8137('0x8')][_0x8137('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd6707d,_0x40bc12,_0x4c1a9f){return new BPromise(function(_0x22ffef,_0x1bc710){return client['request'](_0xd6707d,_0x4c1a9f)[_0x8137('0xa')](function(_0x2b2fa6){logger[_0x8137('0xb')](_0x8137('0xc'),_0x40bc12,_0x8137('0xd'));logger[_0x8137('0xe')](_0x8137('0xf'),_0x40bc12,'request\x20sent',JSON[_0x8137('0x10')](_0x2b2fa6));if(_0x2b2fa6[_0x8137('0x11')]){if(_0x2b2fa6[_0x8137('0x11')][_0x8137('0x12')]===0x1f4){logger[_0x8137('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x40bc12,_0x2b2fa6[_0x8137('0x11')]['message']);return _0x1bc710(_0x2b2fa6[_0x8137('0x11')][_0x8137('0x13')]);}logger[_0x8137('0x11')](_0x8137('0xc'),_0x40bc12,_0x2b2fa6[_0x8137('0x11')]['message']);return _0x22ffef(_0x2b2fa6['error'][_0x8137('0x13')]);}else{logger[_0x8137('0xb')](_0x8137('0xc'),_0x40bc12,_0x8137('0xd'));_0x22ffef(_0x2b2fa6['result']['message']);}})[_0x8137('0x14')](function(_0xac41b6){logger[_0x8137('0x11')](_0x8137('0xc'),_0x40bc12,_0xac41b6);_0x1bc710(_0xac41b6);});});}
\ No newline at end of file
index f60b85b..3cf04e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2baf=['isAuthenticated','describe','/:id','show','post','create','delete','exports','util','path','Router','fs-extra','get'];(function(_0x33bace,_0x506f40){var _0x330ff0=function(_0xcc7486){while(--_0xcc7486){_0x33bace['push'](_0x33bace['shift']());}};_0x330ff0(++_0x506f40);}(_0x2baf,0x119));var _0xf2ba=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x2baf[_0x256e32];return _0x464070;};'use strict';var multer=require('multer');var util=require(_0xf2ba('0x0'));var path=require(_0xf2ba('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2ba('0x2')]();var fs_extra=require(_0xf2ba('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xf2ba('0x4')]('/',auth[_0xf2ba('0x5')](),controller['index']);router[_0xf2ba('0x4')]('/describe',auth[_0xf2ba('0x5')](),controller[_0xf2ba('0x6')]);router[_0xf2ba('0x4')](_0xf2ba('0x7'),auth[_0xf2ba('0x5')](),controller[_0xf2ba('0x8')]);router[_0xf2ba('0x9')]('/',auth[_0xf2ba('0x5')](),controller[_0xf2ba('0xa')]);router['put'](_0xf2ba('0x7'),auth[_0xf2ba('0x5')](),controller['update']);router[_0xf2ba('0xb')](_0xf2ba('0x7'),auth[_0xf2ba('0x5')](),controller['destroy']);module[_0xf2ba('0xc')]=router;
\ No newline at end of file
+var _0xfb1a=['update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x33fd5a,_0x50c70f){var _0x2cc8df=function(_0x119058){while(--_0x119058){_0x33fd5a['push'](_0x33fd5a['shift']());}};_0x2cc8df(++_0x50c70f);}(_0xfb1a,0x1e7));var _0xafb1=function(_0x3a9c82,_0x32b1a6){_0x3a9c82=_0x3a9c82-0x0;var _0x17b5bc=_0xfb1a[_0x3a9c82];return _0x17b5bc;};'use strict';var multer=require(_0xafb1('0x0'));var util=require(_0xafb1('0x1'));var path=require(_0xafb1('0x2'));var timeout=require('connect-timeout');var express=require(_0xafb1('0x3'));var router=express[_0xafb1('0x4')]();var fs_extra=require(_0xafb1('0x5'));var auth=require(_0xafb1('0x6'));var interaction=require(_0xafb1('0x7'));var config=require(_0xafb1('0x8'));var controller=require(_0xafb1('0x9'));router[_0xafb1('0xa')]('/',auth[_0xafb1('0xb')](),controller[_0xafb1('0xc')]);router[_0xafb1('0xa')](_0xafb1('0xd'),auth['isAuthenticated'](),controller[_0xafb1('0xe')]);router['get'](_0xafb1('0xf'),auth[_0xafb1('0xb')](),controller['show']);router[_0xafb1('0x10')]('/',auth[_0xafb1('0xb')](),controller[_0xafb1('0x11')]);router[_0xafb1('0x12')](_0xafb1('0xf'),auth['isAuthenticated'](),controller[_0xafb1('0x13')]);router['delete']('/:id',auth[_0xafb1('0xb')](),controller[_0xafb1('0x14')]);module[_0xafb1('0x15')]=router;
\ No newline at end of file
index c415736..efc661f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','name','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate'];(function(_0x1b63d3,_0x3698c7){var _0x4f96c3=function(_0x3cac62){while(--_0x3cac62){_0x1b63d3['push'](_0x1b63d3['shift']());}};_0x4f96c3(++_0x3698c7);}(_0xb821,0xa7));var _0x1b82=function(_0x2c0c48,_0x2201fd){_0x2c0c48=_0x2c0c48-0x0;var _0x261076=_0xb821[_0x2c0c48];return _0x261076;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1b82('0x0'));module[_0x1b82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1b82('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x3')},'mapKeyOffline':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x3')},'key':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x5')},'customerAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1b82('0x4')]},'animation':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1b82('0xa')](_0x1b82('0xb'),_0x1b82('0xc')),'defaultValue':_0x1b82('0xb')},'header_online':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xd')},'offline_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1b82('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x12')},'placeholderMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xe')},'skipMessageButton':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x1b82('0x16'),_0x1b82('0x17')),'defaultValue':_0x1b82('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x1b82('0x1a'),'required':!![]},'props':{'title':_0x1b82('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1b82('0x1c'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0xf2e556){return this[_0x1b82('0x1d')](_0x1b82('0x1c'),JSON[_0x1b82('0x18')](_0xf2e556));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null},{'type':_0x1b82('0x1e'),'config':{'placeholder':_0x1b82('0x1f')},'props':{'title':_0x1b82('0x1f'),'helpText':_0x1b82('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1b82('0x21')](_0x1b82('0x22'))?JSON[_0x1b82('0x23')](this[_0x1b82('0x21')]('offlineForm')):{};},'set':function(_0x17b3aa){return this[_0x1b82('0x1d')](_0x1b82('0x22'),JSON[_0x1b82('0x18')](_0x17b3aa));}},'token':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return rs[_0x1b82('0x24')]();}},'autoclose':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1b82('0x4')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1b82('0x4')]},'waitingTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x25')},'waitingMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1b82('0x4')]},'notificationTemplate':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return _0x1b82('0x28');}},'notificationSound':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2b')},'messagesAlignment':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2c')},'defaultTitle':{'type':Sequelize[_0x1b82('0x4')]},'customerAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2d')},'systemAvatar':{'type':Sequelize[_0x1b82('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1b82('0x8')],'comment':_0x1b82('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x17d214){if(!_0x17d214)this['setDataValue'](_0x1b82('0x2f'),null);this['setDataValue'](_0x1b82('0x30'),_0x17d214);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x31')},'vidaooNote':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return _0x1b82('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1b82('0x10')]}};
\ No newline at end of file
+var _0x54ef=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','rounded','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x157992,_0x2f66fe){var _0x4906c3=function(_0x273b06){while(--_0x273b06){_0x157992['push'](_0x157992['shift']());}};_0x4906c3(++_0x2f66fe);}(_0x54ef,0x112));var _0xf54e=function(_0x2bce45,_0x454378){_0x2bce45=_0x2bce45-0x0;var _0x2f261d=_0x54ef[_0x2bce45];return _0x2f261d;};'use strict';var Sequelize=require(_0xf54e('0x0'));var rs=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'unique':_0xf54e('0x4')},'description':{'type':Sequelize[_0xf54e('0x3')]},'mapKey':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x5')},'mapKeyOffline':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x6')},'customerAlias':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':_0xf54e('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf54e('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf54e('0x3')]},'animation':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf54e('0xa'),_0xf54e('0xb')),'defaultValue':_0xf54e('0xa')},'header_online':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0xc')},'header_offline':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xd')},'download_transcript':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf54e('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x12')},'placeholderMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x13')},'closingMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x14')},'closingMessageButton':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xc')},'skipMessageButton':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x15')},'conditionAgreement':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x16')},'ratingType':{'type':Sequelize[_0xf54e('0x17')](_0xf54e('0x18'),_0xf54e('0x19')),'defaultValue':_0xf54e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return JSON[_0xf54e('0x1a')]({'items':[{'type':_0xf54e('0x1b'),'variable':null,'config':{'placeholder':_0xf54e('0x1c'),'type':_0xf54e('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xf54e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf54e('0x5'),'type':_0xf54e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf54e('0x1e')](_0xf54e('0x1f'))?JSON[_0xf54e('0x20')](this[_0xf54e('0x1e')](_0xf54e('0x1f'))):{};},'set':function(_0x43488d){return this[_0xf54e('0x21')](_0xf54e('0x1f'),JSON[_0xf54e('0x1a')](_0x43488d));}},'offlineForm':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return JSON[_0xf54e('0x1a')]({'items':[{'type':'input','props':{'title':_0xf54e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf54e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf54e('0x22')},'props':{'title':_0xf54e('0x22'),'helpText':_0xf54e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xf54e('0x1e')](_0xf54e('0x24'))?JSON[_0xf54e('0x20')](this[_0xf54e('0x1e')]('offlineForm')):{};},'set':function(_0x4b3c73){return this[_0xf54e('0x21')](_0xf54e('0x24'),JSON[_0xf54e('0x1a')](_0x4b3c73));}},'token':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':function(){return rs[_0xf54e('0x25')]();}},'autoclose':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf54e('0x3')]},'forwardOffline':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x26')},'waitingMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x27')},'offlineMessageBody':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x15')},'sendUnmanaged':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return _0xf54e('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2c')},'messagesAlignment':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2d')},'defaultTitle':{'type':Sequelize[_0xf54e('0x3')]},'customerAvatar':{'type':Sequelize[_0xf54e('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':_0xf54e('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf54e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2f')},'systemAvatar':{'type':Sequelize[_0xf54e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf54e('0x8')],'comment':_0xf54e('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![],'comment':_0xf54e('0x31'),'set':function(_0x2087b3){if(!_0x2087b3)this[_0xf54e('0x21')](_0xf54e('0x32'),null);this[_0xf54e('0x21')](_0xf54e('0x33'),_0x2087b3);}},'vidaooEscalation':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':function(){return _0xf54e('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf54e('0xf')]}};
\ No newline at end of file
index 80b936e..71ca7b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c18=['fs-extra','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','limit','destroy','get','ChatWebsites','UserProfileResource','sendStatus','send','index','mandatoryDispositionPause','map','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','show','params','Pause','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','update','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','sort','pick','ChatWebsiteId','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','Applications','List','applications','orderBy','priority','asc','account','customerIp','cf-connecting-ip','x-forwarded-for','split','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','firstName','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Owner','fullname','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','inspect','Interval','Intervals','../../config/license/util','virtual','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','verticalAlignment','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','stack','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','fromKey','getOfflineMessages','Contact','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path'];(function(_0x193ec1,_0x4aca7d){var _0xb2b938=function(_0x3f7170){while(--_0x3f7170){_0x193ec1['push'](_0x193ec1['shift']());}};_0xb2b938(++_0x4aca7d);}(_0x9c18,0x125));var _0x89c1=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x9c18[_0x23e7c1];return _0x1add43;};'use strict';var BPromise=require(_0x89c1('0x0'));var Mustache=require(_0x89c1('0x1'));var util=require(_0x89c1('0x2'));var path=require(_0x89c1('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89c1('0x4'));var _=require('lodash');var querystring=require('querystring');var Redis=require(_0x89c1('0x5'));var qs=require(_0x89c1('0x6'));var logger=require(_0x89c1('0x7'))(_0x89c1('0x8'));var config=require('../../config/environment');var db=require(_0x89c1('0x9'))['db'];config[_0x89c1('0xa')]=_[_0x89c1('0xb')](config[_0x89c1('0xa')],{'host':_0x89c1('0xc'),'port':0x18eb});var socket=require(_0x89c1('0xd'))(new Redis(config[_0x89c1('0xa')]));require(_0x89c1('0xe'))['register'](socket);var htmlToText=require(_0x89c1('0xf'));var jayson=require(_0x89c1('0x10'));var client=jayson[_0x89c1('0x11')]['http']({'port':0x232c});var client9002=jayson['client'][_0x89c1('0x12')]({'port':0x232a});var client9003=jayson[_0x89c1('0x11')][_0x89c1('0x12')]({'port':0x232b});var client9001=jayson[_0x89c1('0x11')][_0x89c1('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x2f9c4b,_0x431b8a,_0xe5d576,_0x144abd){return new BPromise(function(_0x28360d,_0x167f62){var _0x2a8c48=_0x144abd||client;return _0x2a8c48[_0x89c1('0x13')](_0x2f9c4b,_0xe5d576)[_0x89c1('0x14')](function(_0x278a9f){logger[_0x89c1('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x431b8a,_0x89c1('0x16'));logger[_0x89c1('0x17')](_0x89c1('0x18'),_0x431b8a,_0x89c1('0x16'),JSON[_0x89c1('0x19')](_0x278a9f));if(_0x278a9f['error']){if(_0x278a9f[_0x89c1('0x1a')][_0x89c1('0x1b')]===0x1f4){logger[_0x89c1('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x431b8a,_0x278a9f['error']['message']);return _0x167f62(_0x278a9f['error']['message']);}logger[_0x89c1('0x1a')](_0x89c1('0x1c'),_0x431b8a,_0x278a9f[_0x89c1('0x1a')][_0x89c1('0x1d')]);return _0x28360d(_0x278a9f[_0x89c1('0x1a')]['message']);}else{logger[_0x89c1('0x15')](_0x89c1('0x1c'),_0x431b8a,_0x89c1('0x16'));_0x28360d(_0x278a9f[_0x89c1('0x1e')][_0x89c1('0x1d')]);}})[_0x89c1('0x1f')](function(_0x81cbda){logger['error'](_0x89c1('0x1c'),_0x431b8a,_0x81cbda);_0x167f62(_0x81cbda);});});}function respondWithStatusCode(_0x2a30e8,_0x44a3df){_0x44a3df=_0x44a3df||0xcc;return function(_0x3dea4e){if(_0x3dea4e){return _0x2a30e8['sendStatus'](_0x44a3df);}return _0x2a30e8[_0x89c1('0x20')](_0x44a3df)[_0x89c1('0x21')]();};}function respondWithResult(_0x55512b,_0xbc4328){_0xbc4328=_0xbc4328||0xc8;return function(_0x11577b){if(_0x11577b){return _0x55512b[_0x89c1('0x20')](_0xbc4328)[_0x89c1('0x22')](_0x11577b);}};}function respondWithFilteredResult(_0x5acd9e,_0x4095fd){return function(_0x337055){if(_0x337055){var _0x50acef=typeof _0x4095fd[_0x89c1('0x23')]===_0x89c1('0x24')&&typeof _0x4095fd['limit']===_0x89c1('0x24');var _0x4153c8=_0x337055[_0x89c1('0x25')];var _0x50c0df=_0x50acef?0x0:_0x4095fd[_0x89c1('0x23')];var _0x2040c4=_0x50acef?_0x337055[_0x89c1('0x25')]:_0x4095fd[_0x89c1('0x23')]+_0x4095fd[_0x89c1('0x26')];var _0x3708fe;if(_0x2040c4>=_0x4153c8){_0x2040c4=_0x4153c8;_0x3708fe=0xc8;}else{_0x3708fe=0xce;}_0x5acd9e[_0x89c1('0x20')](_0x3708fe);return _0x5acd9e['set']('Content-Range',_0x50c0df+'-'+_0x2040c4+'/'+_0x4153c8)[_0x89c1('0x22')](_0x337055);}return null;};}function saveUpdates(_0x4f133d){return function(_0x3ed363){if(_0x3ed363){return _0x3ed363['update'](_0x4f133d)['then'](function(_0xddbdc2){return _0xddbdc2;});}return null;};}function removeEntity(_0x2619d6){return function(_0x1694a3){if(_0x1694a3){return _0x1694a3[_0x89c1('0x27')]()[_0x89c1('0x14')](function(){var _0x162f5a=_0x1694a3[_0x89c1('0x28')]({'plain':!![]});var _0x577dea=_0x89c1('0x29');return db[_0x89c1('0x2a')]['destroy']({'where':{'type':_0x577dea,'resourceId':_0x162f5a['id']}})[_0x89c1('0x14')](function(){return _0x1694a3;});})[_0x89c1('0x14')](function(){_0x2619d6['status'](0xcc)[_0x89c1('0x21')]();});}};}function handleEntityNotFound(_0x8d315b){return function(_0x2da5eb){if(!_0x2da5eb){_0x8d315b[_0x89c1('0x2b')](0x194);}return _0x2da5eb;};}function handleError(_0x32ae02,_0x158237){_0x158237=_0x158237||0x1f4;return function(_0x220402){logger['error'](_0x220402['stack']);if(_0x220402['name']){delete _0x220402['name'];}_0x32ae02[_0x89c1('0x20')](_0x158237)[_0x89c1('0x2c')](_0x220402);};}exports[_0x89c1('0x2d')]=function(_0x26f675,_0x49663e){var _0x3ac0da={'include':[{'model':db['Pause'],'as':_0x89c1('0x2e')}]},_0x4fff8c={},_0x573568={'count':0x0,'rows':[]};var _0x2e97ae=_[_0x89c1('0x2f')](db['ChatWebsite']['rawAttributes'],function(_0x405e08){return{'name':_0x405e08[_0x89c1('0x30')],'type':_0x405e08[_0x89c1('0x31')][_0x89c1('0x32')]};});_0x4fff8c['model']=_[_0x89c1('0x2f')](_0x2e97ae,_0x89c1('0x33'));_0x4fff8c[_0x89c1('0x34')]=_[_0x89c1('0x35')](_0x26f675[_0x89c1('0x34')]);_0x4fff8c[_0x89c1('0x36')]=_[_0x89c1('0x37')](_0x4fff8c[_0x89c1('0x38')],_0x4fff8c[_0x89c1('0x34')]);_0x3ac0da[_0x89c1('0x39')]=_['intersection'](_0x4fff8c[_0x89c1('0x38')],qs['fields'](_0x26f675[_0x89c1('0x34')]['fields']));_0x3ac0da[_0x89c1('0x39')]=_0x3ac0da[_0x89c1('0x39')]['length']?_0x3ac0da['attributes']:_0x4fff8c['model'];if(!_0x26f675[_0x89c1('0x34')]['hasOwnProperty'](_0x89c1('0x3a'))){_0x3ac0da[_0x89c1('0x26')]=qs['limit'](_0x26f675['query'][_0x89c1('0x26')]);_0x3ac0da[_0x89c1('0x23')]=qs[_0x89c1('0x23')](_0x26f675[_0x89c1('0x34')]['offset']);}_0x3ac0da[_0x89c1('0x3b')]=qs['sort'](_0x26f675['query']['sort']);_0x3ac0da[_0x89c1('0x3c')]=qs[_0x89c1('0x36')](_['pick'](_0x26f675['query'],_0x4fff8c[_0x89c1('0x36')]),_0x2e97ae);if(_0x26f675['query'][_0x89c1('0x3d')]){_0x3ac0da[_0x89c1('0x3c')]=_[_0x89c1('0x3e')](_0x3ac0da['where'],{'$or':_['map'](_0x2e97ae,function(_0x3880f9){if(_0x3880f9[_0x89c1('0x31')]!==_0x89c1('0x3f')){var _0x135413={};_0x135413[_0x3880f9['name']]={'$like':'%'+_0x26f675[_0x89c1('0x34')]['filter']+'%'};return _0x135413;}})});}_0x3ac0da=_[_0x89c1('0x3e')]({},_0x3ac0da,_0x26f675[_0x89c1('0x40')]);var _0x2c2e49={'where':_0x3ac0da[_0x89c1('0x3c')]};return db[_0x89c1('0x41')]['count'](_0x2c2e49)[_0x89c1('0x14')](function(_0x4c5359){_0x573568[_0x89c1('0x25')]=_0x4c5359;if(_0x26f675['query'][_0x89c1('0x42')]){_0x3ac0da[_0x89c1('0x43')]=[{'all':!![]}];}return db[_0x89c1('0x41')][_0x89c1('0x44')](_0x3ac0da);})[_0x89c1('0x14')](function(_0x3e9814){_0x573568['rows']=_0x3e9814;return _0x573568;})[_0x89c1('0x14')](respondWithFilteredResult(_0x49663e,_0x3ac0da))['catch'](handleError(_0x49663e,null));};exports[_0x89c1('0x45')]=function(_0x463a0b,_0x8a6117){var _0x51827d={'raw':![],'where':{'id':_0x463a0b[_0x89c1('0x46')]['id']},'include':[{'model':db[_0x89c1('0x47')],'as':'mandatoryDispositionPause'}]},_0x1eaf21={};_0x1eaf21['model']=_['keys'](db[_0x89c1('0x41')]['rawAttributes']);_0x1eaf21['query']=_[_0x89c1('0x35')](_0x463a0b[_0x89c1('0x34')]);_0x1eaf21[_0x89c1('0x36')]=_[_0x89c1('0x37')](_0x1eaf21[_0x89c1('0x38')],_0x1eaf21[_0x89c1('0x34')]);_0x51827d[_0x89c1('0x39')]=_['intersection'](_0x1eaf21[_0x89c1('0x38')],qs['fields'](_0x463a0b[_0x89c1('0x34')][_0x89c1('0x48')]));_0x51827d['attributes']=_0x51827d['attributes'][_0x89c1('0x49')]?_0x51827d[_0x89c1('0x39')]:_0x1eaf21['model'];if(_0x463a0b[_0x89c1('0x34')]['includeAll']){_0x51827d['include']=[{'all':!![]}];}_0x51827d=_[_0x89c1('0x3e')]({},_0x51827d,_0x463a0b[_0x89c1('0x40')]);return db['ChatWebsite'][_0x89c1('0x4a')](_0x51827d)[_0x89c1('0x14')](handleEntityNotFound(_0x8a6117,null))[_0x89c1('0x14')](respondWithResult(_0x8a6117,null))[_0x89c1('0x1f')](handleError(_0x8a6117,null));};exports[_0x89c1('0x4b')]=function(_0x53f22f,_0x1a3acc){return db[_0x89c1('0x41')][_0x89c1('0x4b')](_0x53f22f[_0x89c1('0x4c')],{})[_0x89c1('0x14')](function(_0x9b9dca){var _0x7d12b1=_0x53f22f[_0x89c1('0x4d')][_0x89c1('0x28')]({'plain':!![]});if(!_0x7d12b1)throw new Error(_0x89c1('0x4e'));if(_0x7d12b1['role']===_0x89c1('0x4d')){var _0x237415=_0x9b9dca[_0x89c1('0x28')]({'plain':!![]});var _0x450ae2=_0x89c1('0x29');return db['UserProfileSection'][_0x89c1('0x4a')]({'where':{'name':_0x450ae2,'userProfileId':_0x7d12b1[_0x89c1('0x4f')]},'raw':!![]})['then'](function(_0x4799af){if(_0x4799af&&_0x4799af['autoAssociation']===0x0){return db['UserProfileResource'][_0x89c1('0x4b')]({'name':_0x237415[_0x89c1('0x33')],'resourceId':_0x237415['id'],'type':_0x4799af[_0x89c1('0x33')],'sectionId':_0x4799af['id']},{})['then'](function(){return _0x9b9dca;});}else{return _0x9b9dca;}})[_0x89c1('0x1f')](function(_0x17f044){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17f044);throw _0x17f044;});}return _0x9b9dca;})[_0x89c1('0x14')](respondWithResult(_0x1a3acc,0xc9))[_0x89c1('0x1f')](handleError(_0x1a3acc,null));};exports[_0x89c1('0x50')]=function(_0x1146cb,_0x40c4de){if(_0x1146cb['body']['id']){delete _0x1146cb[_0x89c1('0x4c')]['id'];}return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0x1146cb['params']['id']},'include':[{'model':db[_0x89c1('0x47')],'as':_0x89c1('0x2e')}]})[_0x89c1('0x14')](handleEntityNotFound(_0x40c4de,null))[_0x89c1('0x14')](saveUpdates(_0x1146cb['body'],null))[_0x89c1('0x14')](respondWithResult(_0x40c4de,null))[_0x89c1('0x1f')](handleError(_0x40c4de,null));};exports[_0x89c1('0x27')]=function(_0xf90b8a,_0x500eb3){return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0xf90b8a[_0x89c1('0x46')]['id']}})['then'](handleEntityNotFound(_0x500eb3,null))[_0x89c1('0x14')](removeEntity(_0x500eb3,null))[_0x89c1('0x1f')](handleError(_0x500eb3,null));};exports[_0x89c1('0x51')]=function(_0x419c70,_0x51bb1b){return db['ChatWebsite'][_0x89c1('0x51')]()['then'](respondWithResult(_0x51bb1b,null))[_0x89c1('0x1f')](handleError(_0x51bb1b,null));};exports[_0x89c1('0x52')]=function(_0x5aebd0,_0x36c7b0){if(_0x5aebd0[_0x89c1('0x4c')]['id']){delete _0x5aebd0[_0x89c1('0x4c')]['id'];}return db['ChatWebsite'][_0x89c1('0x4a')]({'where':{'id':_0x5aebd0[_0x89c1('0x46')]['id']}})['then'](handleEntityNotFound(_0x36c7b0,null))[_0x89c1('0x14')](function(_0x515088){if(_0x515088){_0x5aebd0[_0x89c1('0x4c')]['ChatWebsiteId']=_0x515088['id'];return db[_0x89c1('0x53')][_0x89c1('0x4b')](_0x5aebd0['body']);}})[_0x89c1('0x14')](respondWithResult(_0x36c7b0,null))[_0x89c1('0x1f')](handleError(_0x36c7b0,null));};exports[_0x89c1('0x54')]=function(_0x4efad1,_0x30b259){var _0x7de4d9={'raw':![],'where':{}};var _0xc40860={};var _0x32bd66={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x89c1('0x55')]({'where':{'id':_0x4efad1['params']['id']}})['then'](handleEntityNotFound(_0x30b259,null))[_0x89c1('0x14')](function(_0xb6ca4b){if(_0xb6ca4b){_0xc40860[_0x89c1('0x38')]=_[_0x89c1('0x35')](db[_0x89c1('0x53')][_0x89c1('0x56')]);_0xc40860[_0x89c1('0x34')]=_[_0x89c1('0x35')](_0x4efad1[_0x89c1('0x34')]);_0xc40860[_0x89c1('0x36')]=_['intersection'](_0xc40860[_0x89c1('0x38')],_0xc40860['query']);_0x7de4d9['attributes']=_[_0x89c1('0x37')](_0xc40860['model'],qs[_0x89c1('0x48')](_0x4efad1[_0x89c1('0x34')][_0x89c1('0x48')]));_0x7de4d9[_0x89c1('0x39')]=_0x7de4d9['attributes'][_0x89c1('0x49')]?_0x7de4d9[_0x89c1('0x39')]:_0xc40860[_0x89c1('0x38')];if(!_0x4efad1[_0x89c1('0x34')]['hasOwnProperty']('nolimit')){_0x7de4d9[_0x89c1('0x26')]=qs[_0x89c1('0x26')](_0x4efad1['query']['limit']);_0x7de4d9[_0x89c1('0x23')]=qs[_0x89c1('0x23')](_0x4efad1['query'][_0x89c1('0x23')]);}_0x7de4d9[_0x89c1('0x3b')]=qs[_0x89c1('0x57')](_0x4efad1[_0x89c1('0x34')][_0x89c1('0x57')]);_0x7de4d9['where']=qs[_0x89c1('0x36')](_[_0x89c1('0x58')](_0x4efad1[_0x89c1('0x34')],_0xc40860[_0x89c1('0x36')]));_0x7de4d9[_0x89c1('0x3c')][_0x89c1('0x59')]=_0xb6ca4b['id'];if(_0x4efad1[_0x89c1('0x34')][_0x89c1('0x3d')]){_0x7de4d9[_0x89c1('0x3c')]=_['merge'](_0x7de4d9[_0x89c1('0x3c')],{'$or':_['map'](_0x7de4d9['attributes'],function(_0x3e76aa){var _0x42f07e={};_0x42f07e[_0x3e76aa]={'$like':'%'+_0x4efad1[_0x89c1('0x34')]['filter']+'%'};return _0x42f07e;})});}_0x7de4d9=_['merge']({},_0x7de4d9,_0x4efad1[_0x89c1('0x40')]);return db[_0x89c1('0x53')][_0x89c1('0x25')]({'where':_0x7de4d9[_0x89c1('0x3c')]})[_0x89c1('0x14')](function(_0x2a34d0){_0x32bd66[_0x89c1('0x25')]=_0x2a34d0;if(_0x4efad1[_0x89c1('0x34')][_0x89c1('0x42')]){_0x7de4d9[_0x89c1('0x43')]=[{'all':!![]}];}return db['Disposition'][_0x89c1('0x44')](_0x7de4d9);})['then'](function(_0xe9522b){_0x32bd66['rows']=_0xe9522b;return _0x32bd66;});}})[_0x89c1('0x14')](respondWithFilteredResult(_0x30b259,_0x7de4d9))['catch'](handleError(_0x30b259,null));};exports[_0x89c1('0x5a')]=function(_0x58753f,_0x467d8c){return db[_0x89c1('0x41')]['find']({'where':{'id':_0x58753f[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x467d8c,null))['then'](function(_0x403cdf){if(_0x403cdf){return _0x403cdf[_0x89c1('0x5a')](_0x58753f[_0x89c1('0x34')][_0x89c1('0x5b')]);}})['then'](respondWithStatusCode(_0x467d8c,null))[_0x89c1('0x1f')](handleError(_0x467d8c,null));};exports['addAnswer']=function(_0x15cfec,_0x52f806){if(_0x15cfec[_0x89c1('0x4c')]['id']){delete _0x15cfec[_0x89c1('0x4c')]['id'];}return db['ChatWebsite'][_0x89c1('0x4a')]({'where':{'id':_0x15cfec[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x52f806,null))[_0x89c1('0x14')](function(_0x2f89db){if(_0x2f89db){_0x15cfec[_0x89c1('0x4c')][_0x89c1('0x59')]=_0x2f89db['id'];return db[_0x89c1('0x5c')][_0x89c1('0x4b')](_0x15cfec[_0x89c1('0x4c')]);}})['then'](respondWithResult(_0x52f806,null))[_0x89c1('0x1f')](handleError(_0x52f806,null));};exports[_0x89c1('0x5d')]=function(_0x871345,_0x4d85b2){var _0x15412f={'raw':![],'where':{}};var _0x5e8982={};var _0x4373e9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x89c1('0x55')]({'where':{'id':_0x871345[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x4d85b2,null))[_0x89c1('0x14')](function(_0x222712){if(_0x222712){_0x5e8982[_0x89c1('0x38')]=_[_0x89c1('0x35')](db['CannedAnswer'][_0x89c1('0x56')]);_0x5e8982[_0x89c1('0x34')]=_['keys'](_0x871345[_0x89c1('0x34')]);_0x5e8982['filters']=_[_0x89c1('0x37')](_0x5e8982[_0x89c1('0x38')],_0x5e8982[_0x89c1('0x34')]);_0x15412f[_0x89c1('0x39')]=_[_0x89c1('0x37')](_0x5e8982[_0x89c1('0x38')],qs[_0x89c1('0x48')](_0x871345['query'][_0x89c1('0x48')]));_0x15412f[_0x89c1('0x39')]=_0x15412f['attributes']['length']?_0x15412f[_0x89c1('0x39')]:_0x5e8982[_0x89c1('0x38')];if(!_0x871345[_0x89c1('0x34')][_0x89c1('0x5e')](_0x89c1('0x3a'))){_0x15412f[_0x89c1('0x26')]=qs[_0x89c1('0x26')](_0x871345[_0x89c1('0x34')]['limit']);_0x15412f[_0x89c1('0x23')]=qs[_0x89c1('0x23')](_0x871345[_0x89c1('0x34')][_0x89c1('0x23')]);}_0x15412f['order']=qs[_0x89c1('0x57')](_0x871345['query'][_0x89c1('0x57')]);_0x15412f[_0x89c1('0x3c')]=qs['filters'](_[_0x89c1('0x58')](_0x871345[_0x89c1('0x34')],_0x5e8982[_0x89c1('0x36')]));_0x15412f['where'][_0x89c1('0x59')]=_0x222712['id'];if(_0x871345['query'][_0x89c1('0x3d')]){_0x15412f[_0x89c1('0x3c')]=_[_0x89c1('0x3e')](_0x15412f['where'],{'$or':_['map'](_0x15412f[_0x89c1('0x39')],function(_0x1afe5e){var _0x27c348={};_0x27c348[_0x1afe5e]={'$like':'%'+_0x871345[_0x89c1('0x34')][_0x89c1('0x3d')]+'%'};return _0x27c348;})});}_0x15412f=_['merge']({},_0x15412f,_0x871345['options']);return db[_0x89c1('0x5c')]['count']({'where':_0x15412f[_0x89c1('0x3c')]})[_0x89c1('0x14')](function(_0x290dcb){_0x4373e9[_0x89c1('0x25')]=_0x290dcb;if(_0x871345[_0x89c1('0x34')][_0x89c1('0x42')]){_0x15412f[_0x89c1('0x43')]=[{'all':!![]}];}return db[_0x89c1('0x5c')]['findAll'](_0x15412f);})[_0x89c1('0x14')](function(_0x517bb3){_0x4373e9[_0x89c1('0x5f')]=_0x517bb3;return _0x4373e9;});}})[_0x89c1('0x14')](respondWithFilteredResult(_0x4d85b2,_0x15412f))['catch'](handleError(_0x4d85b2,null));};exports[_0x89c1('0x60')]=function(_0x4fa120,_0x438204){return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0x4fa120[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x438204,null))[_0x89c1('0x14')](function(_0x6d0401){if(_0x6d0401){return _0x6d0401[_0x89c1('0x60')](_0x4fa120[_0x89c1('0x34')][_0x89c1('0x5b')]);}})[_0x89c1('0x14')](respondWithStatusCode(_0x438204,null))['catch'](handleError(_0x438204,null));};exports[_0x89c1('0x61')]=function(_0x1e5a01,_0x286c82){_0x1e5a01[_0x89c1('0x4c')][_0x89c1('0x62')]=_0x1e5a01[_0x89c1('0x63')][_0x89c1('0x64')];return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0x1e5a01[_0x89c1('0x46')]['id']}})['then'](handleEntityNotFound(_0x286c82,null))[_0x89c1('0x14')](saveUpdates(_0x1e5a01[_0x89c1('0x4c')],null))[_0x89c1('0x14')](respondWithResult(_0x286c82,null))[_0x89c1('0x1f')](handleError(_0x286c82,null));};exports[_0x89c1('0x65')]=function(_0x32ce75,_0x2eba59){_0x32ce75[_0x89c1('0x4c')][_0x89c1('0x66')]=_0x32ce75[_0x89c1('0x63')][_0x89c1('0x64')];return db['ChatWebsite'][_0x89c1('0x4a')]({'where':{'id':_0x32ce75[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x2eba59,null))[_0x89c1('0x14')](saveUpdates(_0x32ce75[_0x89c1('0x4c')],null))[_0x89c1('0x14')](respondWithResult(_0x2eba59,null))[_0x89c1('0x1f')](handleError(_0x2eba59,null));};exports[_0x89c1('0x67')]=function(_0x5c9fb7,_0xc73d5){_0x5c9fb7['body'][_0x89c1('0x68')]=_0x5c9fb7[_0x89c1('0x63')][_0x89c1('0x64')];return db['ChatWebsite']['find']({'where':{'id':_0x5c9fb7[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0xc73d5,null))[_0x89c1('0x14')](saveUpdates(_0x5c9fb7[_0x89c1('0x4c')],null))[_0x89c1('0x14')](respondWithResult(_0xc73d5,null))[_0x89c1('0x1f')](handleError(_0xc73d5,null));};exports[_0x89c1('0x69')]=function(_0x16d9c9,_0x5e2829){_0x16d9c9[_0x89c1('0x4c')][_0x89c1('0x6a')]=_0x16d9c9[_0x89c1('0x63')]['filename'];return db['ChatWebsite'][_0x89c1('0x4a')]({'where':{'id':_0x16d9c9[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x5e2829,null))[_0x89c1('0x14')](saveUpdates(_0x16d9c9['body'],null))[_0x89c1('0x14')](respondWithResult(_0x5e2829,null))[_0x89c1('0x1f')](handleError(_0x5e2829,null));};exports[_0x89c1('0x6b')]=function(_0x2477a3,_0x16890f){var _0x4013dc=path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],'server/files/images/logos/default_logo.svg');var _0x36427c={'where':{'id':_0x2477a3['params']['id']},'attributes':['id',_0x89c1('0x62')],'raw':!![]};var _0x2c1846=![];return require('../../config/license/util')[_0x89c1('0x6e')]()[_0x89c1('0x14')](function(_0x5c1a8c){if(_0x5c1a8c){_0x2c1846=_0x5c1a8c[_0x89c1('0x6f')];}})['then'](function(){return db[_0x89c1('0x41')][_0x89c1('0x4a')](_0x36427c);})[_0x89c1('0x14')](handleEntityNotFound(_0x16890f,null))[_0x89c1('0x14')](function(_0x4a74a2){if(_0x4a74a2){if(!_[_0x89c1('0x70')](_0x4a74a2['sitepic'])){if(fs[_0x89c1('0x71')](path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],_0x89c1('0x72'),_0x4a74a2['sitepic']))&&_0x2c1846){_0x4013dc=path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],_0x89c1('0x72'),_0x4a74a2['sitepic']);}}return _0x16890f[_0x89c1('0x73')](_0x4013dc);}})[_0x89c1('0x1f')](handleError(_0x16890f,null));};exports[_0x89c1('0x74')]=function(_0x2e4655,_0x5d6388){var _0x10302c=path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],'server/files/images/avatars/default_avatar.png');var _0x1f414a={'where':{'id':_0x2e4655['params']['id']},'attributes':['id',_0x89c1('0x66')],'raw':!![]};return db['ChatWebsite']['find'](_0x1f414a)[_0x89c1('0x14')](handleEntityNotFound(_0x5d6388,null))[_0x89c1('0x14')](function(_0x43ef95){if(_0x43ef95){if(!_['isNil'](_0x43ef95[_0x89c1('0x66')])){if(fs[_0x89c1('0x71')](path['join'](config[_0x89c1('0x6d')],_0x89c1('0x75'),_0x43ef95[_0x89c1('0x66')]))){_0x10302c=path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],'server/files/images/avatars/',_0x43ef95['agentAvatar']);}}return _0x5d6388[_0x89c1('0x73')](_0x10302c);}})[_0x89c1('0x1f')](handleError(_0x5d6388,null));};exports[_0x89c1('0x76')]=function(_0x575de7,_0x49f181){var _0x3677b0=path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],_0x89c1('0x77'));var _0x1cdfc7={'where':{'id':_0x575de7[_0x89c1('0x46')]['id']},'attributes':['id',_0x89c1('0x68'),_0x89c1('0x78')],'raw':!![]};return db[_0x89c1('0x41')][_0x89c1('0x4a')](_0x1cdfc7)[_0x89c1('0x14')](handleEntityNotFound(_0x49f181,null))[_0x89c1('0x14')](function(_0x490859){if(_0x490859){if(!_[_0x89c1('0x70')](_0x490859[_0x89c1('0x68')])){if(fs[_0x89c1('0x71')](path['join'](config['root'],_0x89c1('0x75'),_0x490859[_0x89c1('0x68')]))&&_0x490859[_0x89c1('0x78')]){_0x3677b0=path['join'](config[_0x89c1('0x6d')],_0x89c1('0x75'),_0x490859[_0x89c1('0x68')]);}}return _0x49f181[_0x89c1('0x73')](_0x3677b0);}})[_0x89c1('0x1f')](handleError(_0x49f181,null));};exports['getSystemAvatar']=function(_0x15634d,_0x31dc2a){var _0x197af2=path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],_0x89c1('0x79'));var _0x536597={'where':{'id':_0x15634d[_0x89c1('0x46')]['id']},'attributes':['id',_0x89c1('0x6a')],'raw':!![]};return db[_0x89c1('0x41')][_0x89c1('0x4a')](_0x536597)[_0x89c1('0x14')](handleEntityNotFound(_0x31dc2a,null))[_0x89c1('0x14')](function(_0x3635d5){if(_0x3635d5){if(!_[_0x89c1('0x70')](_0x3635d5['systemAvatar'])){if(fs['existsSync'](path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],_0x89c1('0x75'),_0x3635d5['systemAvatar']))){_0x197af2=path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],_0x89c1('0x75'),_0x3635d5[_0x89c1('0x6a')]);}}return _0x31dc2a[_0x89c1('0x73')](_0x197af2);}})[_0x89c1('0x1f')](handleError(_0x31dc2a,null));};exports[_0x89c1('0x7a')]=function(_0x4a3e11,_0x3b9357){var _0x477c2e=require(_0x89c1('0x7b'));var _0x1da438=new _0x477c2e();var _0x56d3bd=_0x1da438[_0x89c1('0x7c')](_0x4a3e11[_0x89c1('0x7d')][_0x89c1('0x7e')])[_0x89c1('0x7f')]();var _0x4bc461={'body':_0x4a3e11[_0x89c1('0x4c')],'channel':_0x89c1('0x80')};var _0x1e1952=[];var _0x47e92f=[];var _0x21a1c9={};var _0x189d39=![];return db[_0x89c1('0x81')][_0x89c1('0x51')]()[_0x89c1('0x14')](function(_0x2981d6){if(!_0x2981d6){throw new db[(_0x89c1('0x82'))][(_0x89c1('0x83'))](_0x89c1('0x84'));}_0x1e1952=_[_0x89c1('0x85')](_['keys'](_0x2981d6),[_0x89c1('0x86'),'updatedAt']);_0x47e92f=_['difference'](_['keys'](_0x2981d6),['createdAt',_0x89c1('0x87'),_0x89c1('0x88'),_0x89c1('0x89')]);if(_0x4a3e11['body']['id']){delete _0x4a3e11[_0x89c1('0x4c')]['id'];}if(_[_0x89c1('0x70')](_0x4a3e11[_0x89c1('0x4c')]['from'])){throw new db[(_0x89c1('0x82'))][(_0x89c1('0x83'))]('from\x20is\x20mandatory');}if(_[_0x89c1('0x70')](_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0x4c')])||_0x4a3e11['body']['body']===''){throw new db[(_0x89c1('0x82'))]['ValidationError'](_0x89c1('0x8a'));}if(_['isNil'](_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0x8b')])){throw new db[(_0x89c1('0x82'))][(_0x89c1('0x83'))](_0x89c1('0x8c')+_0x47e92f);}if(!_['includes'](_0x47e92f,_0x4a3e11['body'][_0x89c1('0x8b')])){throw new db[(_0x89c1('0x82'))][(_0x89c1('0x83'))](_0x89c1('0x8d')+_0x47e92f);}_0x21a1c9[_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0x8b')]]=_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0x8e')];})[_0x89c1('0x14')](function(){return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0x4a3e11[_0x89c1('0x46')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x89c1('0x81')],'as':_0x89c1('0x8f'),'where':_0x21a1c9,'limit':0x1,'order':[['updatedAt',_0x89c1('0x90')]]}]},{'model':db['ChatApplication'],'as':_0x89c1('0x91')}]});})['then'](handleEntityNotFound(_0x3b9357,null))[_0x89c1('0x14')](function(_0x1e6019){if(_0x1e6019&&_0x1e6019[_0x89c1('0x92')]){_0x4bc461['account']=_0x1e6019;_0x4bc461[_0x89c1('0x93')]=_0x1e6019[_0x89c1('0x91')];_0x4bc461['list']=_0x1e6019['List'];_0x4bc461[_0x89c1('0x93')]=_[_0x89c1('0x94')](_0x4bc461[_0x89c1('0x93')],[_0x89c1('0x95')],[_0x89c1('0x96')]);if(_0x4bc461[_0x89c1('0x97')][_0x89c1('0x91')]){delete _0x4bc461['account'][_0x89c1('0x91')];}if(_0x4bc461[_0x89c1('0x97')][_0x89c1('0x92')]&&_0x4bc461[_0x89c1('0x97')][_0x89c1('0x92')][_0x89c1('0x8f')][_0x89c1('0x49')]){return _0x4bc461[_0x89c1('0x97')][_0x89c1('0x92')]['Contacts'][0x0];}var _0x3360d0=_[_0x89c1('0xb')](_0x4a3e11[_0x89c1('0x4c')],{'firstName':_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0x8e')],'ListId':_0x1e6019[_0x89c1('0x89')]});_0x3360d0[_0x4a3e11['body'][_0x89c1('0x8b')]]=_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0x8e')];return db[_0x89c1('0x81')][_0x89c1('0x4b')](_0x3360d0,{'fields':_0x1e1952,'raw':!![]});}})[_0x89c1('0x14')](handleEntityNotFound(_0x3b9357,null))[_0x89c1('0x14')](function(_0x2e51ab){_0x4bc461['contact']=_0x2e51ab;var _0x43827f=_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0x98')];if(_0x4a3e11['headers'][_0x89c1('0x99')]){_0x43827f=_0x4a3e11['headers'][_0x89c1('0x99')];}else if(_0x4a3e11[_0x89c1('0x7d')][_0x89c1('0x9a')]){_0x43827f=_['first'](_0x4a3e11[_0x89c1('0x7d')][_0x89c1('0x9a')][_0x89c1('0x9b')](','));}if(_0x2e51ab){var _0x100034={'ContactId':_0x2e51ab['id'],'ChatWebsiteId':_0x4a3e11[_0x89c1('0x46')]['id'],'from':(_0x2e51ab['firstName']||'')+'\x20'+(_0x2e51ab['lastName']||''),'customerIp':_0x43827f,'customerPort':_0x4a3e11[_0x89c1('0x7d')][_0x89c1('0x9c')]?_0x4a3e11['headers'][_0x89c1('0x9c')]:null,'referer':_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0x9d')],'browserName':_0x56d3bd[_0x89c1('0x9e')]['name']&&_0x56d3bd[_0x89c1('0x9e')][_0x89c1('0x9f')]?util[_0x89c1('0xa0')](_0x89c1('0xa1'),_0x56d3bd[_0x89c1('0x9e')][_0x89c1('0x33')],_0x56d3bd[_0x89c1('0x9e')][_0x89c1('0x9f')]):_0x89c1('0xa2'),'browserVersion':_0x56d3bd['browser'][_0x89c1('0x9f')]||_0x89c1('0xa2'),'osName':util['format'](_0x89c1('0xa1'),_0x56d3bd['os'][_0x89c1('0x33')],_0x56d3bd['os']['version']),'osVersion':_0x56d3bd['os'][_0x89c1('0x9f')],'deviceModel':_0x56d3bd[_0x89c1('0xa3')][_0x89c1('0x38')]&&_0x56d3bd['device'][_0x89c1('0xa4')]?util[_0x89c1('0xa0')](_0x89c1('0xa5'),_0x56d3bd[_0x89c1('0xa3')][_0x89c1('0x38')],_0x56d3bd[_0x89c1('0xa3')][_0x89c1('0xa4')],_0x56d3bd[_0x89c1('0xa3')][_0x89c1('0x31')]):null,'deviceVendor':_0x56d3bd[_0x89c1('0xa3')][_0x89c1('0xa4')],'deviceType':_0x56d3bd['device'][_0x89c1('0x31')],'formData':JSON['stringify'](_0x4a3e11[_0x89c1('0x4c')])};var _0x1fc5b0={'ChatWebsiteId':_0x4a3e11[_0x89c1('0x46')]['id'],'closed':![]};if(_0x4a3e11[_0x89c1('0x4c')]['threadId']){_0x1fc5b0['threadId']=_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xa6')];return db['ChatInteraction']['find']({'where':_0x1fc5b0})[_0x89c1('0x14')](function(_0x155370){if(_0x155370){return[_0x155370,![]];}_0x100034[_0x89c1('0xa6')]=_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xa6')];_0x100034[_0x89c1('0xa7')]=_0x4a3e11[_0x89c1('0x4c')]['externalUrl'];return db[_0x89c1('0xa8')][_0x89c1('0x4b')](_0x100034)[_0x89c1('0x14')](function(_0x367da1){return[_0x367da1,!![]];});});}_0x1fc5b0[_0x89c1('0xa9')]=_0x2e51ab['id'];if(_0x4a3e11['body']['interaction']&&_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xaa')]['id']){_0x1fc5b0['id']=_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xaa')]['id'];return db['ChatInteraction']['find']({'where':_0x1fc5b0})[_0x89c1('0x14')](function(_0x22e6b4){if(_0x22e6b4){return[_0x22e6b4,![]];}return db[_0x89c1('0xa8')][_0x89c1('0x4b')](_0x100034)[_0x89c1('0x14')](function(_0x2c7c9f){return[_0x2c7c9f,!![]];});});}return db[_0x89c1('0xa8')][_0x89c1('0x4b')](_0x100034)[_0x89c1('0x14')](function(_0x1860eb){return[_0x1860eb,!![]];});}})[_0x89c1('0xab')](function(_0x55de97,_0x4a0fa9){if(_0x55de97){_0x189d39=_0x4a0fa9;if(!_0x4a0fa9){var _0x237636={'from':(_0x4bc461[_0x89c1('0xac')][_0x89c1('0xad')]||'')+'\x20'+(_0x4bc461[_0x89c1('0xac')][_0x89c1('0xae')]||'')};if(_0x4a3e11['body'][_0x89c1('0xa6')]&&_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xaf')]&&_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xa6')]!=_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xaf')]){_0x237636[_0x89c1('0xa6')]=_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xaf')];}return _0x55de97[_0x89c1('0x50')](_0x237636);}else{return _0x55de97;}}})[_0x89c1('0x14')](function(_0x161de0){_0x4bc461[_0x89c1('0xaa')]=_0x161de0[_0x89c1('0x28')]({'plain':!![]});_0x4bc461['interaction'][_0x89c1('0xb0')]=_0x189d39;if(_0x4bc461[_0x89c1('0xaa')][_0x89c1('0xb0')]){if(_0x4bc461[_0x89c1('0x97')][_0x89c1('0xb1')]){_0x4bc461[_0x89c1('0x93')][_0x89c1('0xb2')]({'id':0x0,'priority':_0x4bc461[_0x89c1('0x93')][_0x89c1('0x49')]+0x1,'app':_0x89c1('0xb3'),'appdata':_0x89c1('0xb4'),'interval':_0x89c1('0xb5')});}}return db[_0x89c1('0xb6')][_0x89c1('0x4b')]({'body':_0x4a3e11[_0x89c1('0x4c')]['body'],'ChatWebsiteId':_0x4a3e11[_0x89c1('0x46')]['id'],'ChatInteractionId':_0x161de0['id'],'direction':'in','ContactId':_0x4bc461['contact']['id'],'AttachmentId':_0x4a3e11[_0x89c1('0x4c')][_0x89c1('0xb7')]});})['then'](function(_0x216ebb){_0x4bc461[_0x89c1('0x1d')]=_0x216ebb;if(_0x4bc461['interaction'][_0x89c1('0xb8')]){return db[_0x89c1('0xb9')][_0x89c1('0x4a')]({'attributes':['id',_0x89c1('0x33')],'where':{'id':_0x4bc461[_0x89c1('0xaa')][_0x89c1('0xb8')]}})['then'](function(_0x1edb1c){if(_0x1edb1c){_0x4bc461[_0x89c1('0x93')][_0x89c1('0xba')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1edb1c[_0x89c1('0x33')]+','+(_0x4bc461[_0x89c1('0x97')][_0x89c1('0xbb')]||0xa),'interval':'*,*,*,*'});_0x4bc461['forcedOwnership']=!![];}return respondWithRpcPromise('Start','startRouting',_0x4bc461);});}return respondWithRpcPromise(_0x89c1('0xbc'),_0x89c1('0xbd'),_0x4bc461);})['then'](function(_0x10f26f){respondWithRpcPromise(_0x89c1('0xbe'),_0x89c1('0xbe'),{'event':_0x89c1('0x7a'),'message':_0x10f26f},client9002);return _0x10f26f;})[_0x89c1('0x14')](respondWithResult(_0x3b9357,null))[_0x89c1('0x1f')](handleError(_0x3b9357,null));};exports[_0x89c1('0xbf')]=function(_0x1061a5,_0x584746){var _0xac0fbb,_0x104a28,_0x575d29;var _0x302f5a=[];var _0x210c7d={};var _0xa1706=_0x1061a5[_0x89c1('0xc0')]||[];var _0x330b8f=[];var _0xc6f78c;return db[_0x89c1('0x81')]['describe']()[_0x89c1('0x14')](function(_0x1adc4f){if(!_0x1adc4f){throw new db[(_0x89c1('0x82'))][(_0x89c1('0x83'))]('no\x20available\x20attributes');}_0x302f5a=_[_0x89c1('0x85')](_[_0x89c1('0x35')](_0x1adc4f),[_0x89c1('0x86'),'updatedAt',_0x89c1('0x88'),_0x89c1('0x89')]);if(_0x1061a5[_0x89c1('0x4c')]['id']){delete _0x1061a5[_0x89c1('0x4c')]['id'];}if(_['isNil'](_0x1061a5[_0x89c1('0x4c')][_0x89c1('0x8e')])){throw _0x584746['status'](0x1f4)[_0x89c1('0x2c')](new db[(_0x89c1('0x82'))][(_0x89c1('0x83'))](_0x89c1('0xc1')));}if(_[_0x89c1('0x70')](_0x1061a5['body'][_0x89c1('0x4c')])||_0x1061a5[_0x89c1('0x4c')]['body']===''){throw _0x584746['status'](0x1f4)[_0x89c1('0x2c')](new db[(_0x89c1('0x82'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x1061a5['body']['mapKeyOffline'])){throw _0x584746[_0x89c1('0x20')](0x1f4)[_0x89c1('0x2c')](new db[(_0x89c1('0x82'))][(_0x89c1('0x83'))](_0x89c1('0xc2')+_0x302f5a));}if(!_[_0x89c1('0xc3')](_0x302f5a,_0x1061a5[_0x89c1('0x4c')]['mapKeyOffline'])){throw _0x584746[_0x89c1('0x20')](0x1f4)[_0x89c1('0x2c')](new db['Sequelize'][(_0x89c1('0x83'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x302f5a));}_0x210c7d[_0x1061a5['body'][_0x89c1('0xc4')]]=_0x1061a5[_0x89c1('0x4c')][_0x89c1('0x8e')];})[_0x89c1('0x14')](function(){return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0x1061a5[_0x89c1('0x46')]['id']},'include':[{'model':db[_0x89c1('0xc5')],'as':_0x89c1('0x92')},{'model':db[_0x89c1('0xc6')],'as':_0x89c1('0xc6')}]});})['then'](handleEntityNotFound(_0x584746,null))[_0x89c1('0x14')](function(_0x20fb76){if(_0x20fb76&&_0x20fb76[_0x89c1('0x92')]){_0x104a28=_0x20fb76;var _0x172d3d=_['defaults'](_0x1061a5['body'],{'firstName':_0x1061a5['body'][_0x89c1('0x8e')],'phone':_0x1061a5[_0x89c1('0x4c')][_0x89c1('0x8e')],'ListId':_0x20fb76[_0x89c1('0x89')]});_0x172d3d[_0x1061a5[_0x89c1('0x4c')][_0x89c1('0xc4')]]=_0x1061a5[_0x89c1('0x4c')][_0x89c1('0x8e')];return db[_0x89c1('0x81')][_0x89c1('0xc7')]({'where':_0x210c7d,'defaults':_0x172d3d});}})[_0x89c1('0xab')](function(_0xbb21f2){if(_0xbb21f2){_0x575d29=_0xbb21f2;var _0x14f595=fs[_0x89c1('0xc8')](path[_0x89c1('0x6c')](config['root'],_0x89c1('0xc9')),_0x89c1('0xca'));var _0x40f29b=ejs[_0x89c1('0xcb')](_0x14f595,{'body':_[_0x89c1('0xcc')](_0x1061a5[_0x89c1('0x4c')][_0x89c1('0x4c')]),'bodyTitle':_0x104a28['offlineMessageBody']});return db[_0x89c1('0xcd')]['create']({'body':_0x40f29b,'plainBody':htmlToText['fromString'](_0x40f29b),'ContactId':_0xbb21f2['id'],'ChatWebsiteId':_0x104a28['id']});}})['then'](function(_0xfa3fbd){_0xc6f78c=_0xfa3fbd;if(_0xa1706['length']){var _0x2809b8=_0xa1706['map'](function(_0x22787f){return{'name':_0x22787f[_0x89c1('0xce')],'basename':_0x22787f['filename'],'type':_0x22787f[_0x89c1('0xcf')],'ChatOfflineMessageId':_0xfa3fbd['id']};});_0x330b8f=_0x2809b8['map'](_0x5e3103=>{var _0x43538e={'filename':_0x5e3103['name'],'path':path['join'](config[_0x89c1('0x6d')],_0x89c1('0xd0'),_0x89c1('0xc0'),_0x89c1('0xd1'),_0x89c1('0xd2'),_0x5e3103[_0x89c1('0xd3')])};return _0x43538e;});if(!_0x104a28[_0x89c1('0xd4')]){return db[_0x89c1('0xd5')][_0x89c1('0xd6')](function(_0x40a46c){return db[_0x89c1('0xd7')][_0x89c1('0xd8')](_0x2809b8,{'transaction':_0x40a46c});});}}})[_0x89c1('0x14')](function(){if(_0xc6f78c){_0xac0fbb=_0xc6f78c;return db[_0x89c1('0xc6')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x89c1('0xd9')],'as':_0x89c1('0xda'),'raw':!![],'include':[{'model':db[_0x89c1('0xdb')],'as':_0x89c1('0xdb'),'raw':!![]}]}]});}})[_0x89c1('0x14')](function(_0xfeb64){if(_0xfeb64&&_0xfeb64[_0x89c1('0xda')]&&_0x104a28[_0x89c1('0xdc')]&&_0x104a28[_0x89c1('0xdd')]){var _0x89afcc=_0xfeb64[_0x89c1('0xde')]();return respondWithRpcPromise(_0x89c1('0xdf'),_0x89c1('0xe0'),{'account':_0x89afcc,'message':{'from':util[_0x89c1('0xa0')](_0x89c1('0xe1'),_0xfeb64[_0x89c1('0x33')],_0xfeb64[_0x89c1('0xe2')]||_0xfeb64[_0x89c1('0xda')][_0x89c1('0x4d')]),'to':_0x104a28[_0x89c1('0xdd')],'subject':_0x104a28[_0x89c1('0xe3')],'html':_0xac0fbb[_0x89c1('0x4c')],'attachments':_0x330b8f}},client9003)['then'](function(){return _0xac0fbb;})['catch'](function(_0x4ab8b5){logger['error'](_0x4ab8b5);});}})[_0x89c1('0x14')](function(){if(_0x104a28&&_0x104a28[_0x89c1('0xd4')]&&_0x104a28[_0x89c1('0xe4')]){var _0x26df29=[];if(_0xa1706[_0x89c1('0x49')]){_0x26df29=_0xa1706[_0x89c1('0x2f')](function(_0xd8dcc){return{'name':_0xd8dcc[_0x89c1('0xce')],'basename':_0xd8dcc[_0x89c1('0x64')],'type':_0xd8dcc[_0x89c1('0xcf')],'ChatOfflineMessageId':_0xc6f78c['id']};});}var _0x57c9fc;if(!_[_0x89c1('0x70')](_0x104a28['subjectOffline'])){var _0x1599a9=_[_0x89c1('0x2f')](_0x1061a5[_0x89c1('0x4c')],function(_0x29d28e){return _0x29d28e;});var _0x530624=_[_0x89c1('0xe5')](_0x1599a9)[0x0];var _0x4c3dc9=_[_0x89c1('0xe6')](_0x530624,function(_0x4af9db){return _0x4af9db;});_0x57c9fc=_0x4c3dc9[0x1][_0x104a28[_0x89c1('0xe7')]];}var _0x4a239e={'from':_0x575d29[_0x89c1('0xe2')],'firstName':_0x575d29['firstName'],'lastName':_0x575d29[_0x89c1('0xae')],'mapKey':_0x89c1('0xe2'),'message':{'from':_0x575d29[_0x89c1('0xe2')],'to':_0x104a28[_0x89c1('0xc6')][_0x89c1('0xe2')],'cc':'','subject':_['isNil'](_0x57c9fc)?_0x104a28['offlineMessageSubject']:_0x57c9fc,'messageId':'','sentAt':new Date(),'attach':_0x26df29[_0x89c1('0x49')],'attachments':_0x26df29,'originChannel':_0x89c1('0xe8'),'ChatWebsiteId':_0x104a28['id'],'ChatOfflineMessageId':_0xac0fbb['id'],'originTo':_0x104a28[_0x89c1('0xc6')][_0x89c1('0xe2')]},'body':_0xac0fbb[_0x89c1('0x4c')]};var _0x5e59d0={'account':{'id':_0x104a28[_0x89c1('0xe4')]},'body':_0x4a239e,'log':_0x89c1('0xe9')};return respondWithRpcPromise(_0x89c1('0xe9'),_0x89c1('0xea'),_0x5e59d0,client9001)['then'](function(){return _0xac0fbb;})[_0x89c1('0x1f')](function(_0x691efb){logger[_0x89c1('0x1a')](_0x691efb);});}return;})[_0x89c1('0x14')](function(){if(_0xac0fbb){return _0xac0fbb;}})['then'](respondWithResult(_0x584746,null))[_0x89c1('0x1f')](function(_0x4bc5cb){logger[_0x89c1('0x1a')](_0x89c1('0x1f'),_0x4bc5cb);for(var _0x69ae3b of _0xa1706){var _0x5c0943=path[_0x89c1('0x6c')](config[_0x89c1('0x6d')],_0x89c1('0xd0'),_0x89c1('0xc0'),_0x89c1('0xd1'),_0x89c1('0xd2'),_0x69ae3b['filename']);fs_extra['remove'](_0x5c0943)[_0x89c1('0x1f')](function(_0x1acee7){logger[_0x89c1('0x1a')](_0x89c1('0xeb'),_0x5c0943,_0x1acee7);});}});};exports[_0x89c1('0xec')]=function(_0x21ddb4,_0x474599){return db[_0x89c1('0xa8')][_0x89c1('0x4a')]({'where':{'id':_0x21ddb4['params']['id']}})['then'](handleEntityNotFound(_0x474599,null))[_0x89c1('0x14')](function(_0xd7432d){if(_0xd7432d){return _0xd7432d['addInteraction'](_0x21ddb4[_0x89c1('0x4c')][_0x89c1('0x5b')],_['omit'](_0x21ddb4[_0x89c1('0x4c')],[_0x89c1('0x5b'),'id'])||{});}})[_0x89c1('0x14')](respondWithResult(_0x474599,null))[_0x89c1('0x1f')](handleError(_0x474599,null));};exports['getInteractions']=function(_0x155dba,_0x4f1d2d){var _0x583363={'raw':![],'where':{}};var _0x27f745={};var _0x2aef9d={'count':0x0,'rows':[]};return db[_0x89c1('0x41')]['findOne']({'where':{'id':_0x155dba[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x4f1d2d,null))[_0x89c1('0x14')](function(_0x2f2edf){if(_0x2f2edf){_0x27f745['model']=_['keys'](db[_0x89c1('0xa8')][_0x89c1('0x56')]);_0x27f745[_0x89c1('0x34')]=_['keys'](_0x155dba[_0x89c1('0x34')]);_0x27f745[_0x89c1('0x36')]=_[_0x89c1('0x37')](_0x27f745[_0x89c1('0x38')],_0x27f745[_0x89c1('0x34')]);_0x583363['attributes']=_[_0x89c1('0x37')](_0x27f745[_0x89c1('0x38')],qs[_0x89c1('0x48')](_0x155dba[_0x89c1('0x34')][_0x89c1('0x48')]));_0x583363[_0x89c1('0x39')]=_0x583363[_0x89c1('0x39')][_0x89c1('0x49')]?_0x583363[_0x89c1('0x39')]:_0x27f745[_0x89c1('0x38')];if(!_0x155dba[_0x89c1('0x34')][_0x89c1('0x5e')]('nolimit')){_0x583363[_0x89c1('0x26')]=qs[_0x89c1('0x26')](_0x155dba[_0x89c1('0x34')][_0x89c1('0x26')]);_0x583363[_0x89c1('0x23')]=qs['offset'](_0x155dba[_0x89c1('0x34')][_0x89c1('0x23')]);}_0x583363[_0x89c1('0x3b')]=qs[_0x89c1('0x57')](_0x155dba[_0x89c1('0x34')]['sort']);_0x583363[_0x89c1('0x3c')]=qs[_0x89c1('0x36')](_[_0x89c1('0x58')](_0x155dba['query'],_0x27f745[_0x89c1('0x36')]));_0x583363[_0x89c1('0x3c')][_0x89c1('0x59')]=_0x2f2edf['id'];if(_0x155dba[_0x89c1('0x34')]['filter']){_0x583363[_0x89c1('0x3c')]=_[_0x89c1('0x3e')](_0x583363[_0x89c1('0x3c')],{'$or':_[_0x89c1('0x2f')](_0x583363[_0x89c1('0x39')],function(_0x432752){var _0x25773e={};_0x25773e[_0x432752]={'$like':'%'+_0x155dba[_0x89c1('0x34')][_0x89c1('0x3d')]+'%'};return _0x25773e;})});}_0x583363=_[_0x89c1('0x3e')]({},_0x583363,_0x155dba[_0x89c1('0x40')]);return db[_0x89c1('0xa8')][_0x89c1('0x25')]({'where':_0x583363[_0x89c1('0x3c')]})[_0x89c1('0x14')](function(_0x2d7374){_0x2aef9d[_0x89c1('0x25')]=_0x2d7374;if(_0x155dba[_0x89c1('0x34')][_0x89c1('0x42')]){_0x583363[_0x89c1('0x43')]=[{'model':db[_0x89c1('0x81')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x89c1('0xed'),'attributes':[_0x89c1('0x33'),_0x89c1('0xee'),'internal'],'required':![]},{'model':db[_0x89c1('0xef')],'as':_0x89c1('0xf0'),'attributes':['id',_0x89c1('0x33'),_0x89c1('0xf1')],'where':_0x155dba[_0x89c1('0x34')][_0x89c1('0xf2')]?{'id':_0x155dba[_0x89c1('0x34')][_0x89c1('0xf2')]}:undefined,'required':_0x155dba[_0x89c1('0x34')][_0x89c1('0xf2')]?!![]:![]}];}return db[_0x89c1('0xa8')][_0x89c1('0x44')](_0x583363);})[_0x89c1('0x14')](function(_0x14e8a2){_0x2aef9d[_0x89c1('0x5f')]=_0x14e8a2;return _0x2aef9d;});}})[_0x89c1('0x14')](respondWithFilteredResult(_0x4f1d2d,_0x583363))[_0x89c1('0x1f')](handleError(_0x4f1d2d,null));};function iftimePromise(_0x152f63,_0x59c715){return respondWithRpcPromise('Command',_0x89c1('0xf3'),{'command':_0x59c715[_0x89c1('0xf4')]?util['format'](_0x89c1('0xf5'),_0x152f63['interval'],_0x59c715['timezone']):util['format'](_0x89c1('0xf6'),_0x152f63['interval'])},client9002)['then'](function(_0x2aef6c){var _0x4705cd=_0x2aef6c&&_0x2aef6c[_0x89c1('0xf7')]('true')>=0x0?!![]:![];logger[_0x89c1('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x59c715['id'],_0x152f63['id'],_0x152f63['interval'],_0x4705cd?'ONLINE':_0x89c1('0xf8'),_0x59c715[_0x89c1('0xf4')]?_0x59c715[_0x89c1('0xf4')]:_0x89c1('0xf9'));return _0x4705cd;})['catch'](function(_0x178866){logger[_0x89c1('0x1a')](_0x89c1('0xfa'),_0x59c715['id'],_0x152f63['id'],_0x152f63[_0x89c1('0xfb')],util[_0x89c1('0xfc')](_0x178866,{'showHidden':![],'depth':null}),_0x59c715[_0x89c1('0xf4')]?_0x59c715[_0x89c1('0xf4')]:_0x89c1('0xf9'));return![];});}exports['getSnippet']=function(_0x28f0b2,_0x47f27c){var _0x259f8=0x0;var _0x144495=0x0;var _0x1954a3=![];var _0x205c9e;var _0x5a7997;return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0x28f0b2[_0x89c1('0x46')]['id']},'include':[{'model':db['Interval'],'as':_0x89c1('0xfd'),'include':[{'model':db[_0x89c1('0xfd')],'as':_0x89c1('0xfe'),'attributes':['id',_0x89c1('0xfb')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x47f27c,null))[_0x89c1('0x14')](function(_0x338c87){if(_0x338c87){_0x205c9e=_0x338c87;return _0x338c87['getProactiveActions']({'raw':!![]});}})['then'](function(_0x431256){if(_0x205c9e){if(_0x431256){_0x5a7997=_0x431256;}}return require(_0x89c1('0xff'))[_0x89c1('0x6e')]();})['then'](function(_0x221431){if(_0x221431){_0x144495=_0x221431[_0x89c1('0x100')];_0x1954a3=_0x221431[_0x89c1('0x6f')];}})[_0x89c1('0x14')](function(){return db[_0x89c1('0xa8')]['count']({'where':{'closed':![]}});})[_0x89c1('0x14')](function(_0x4beae){_0x259f8=_0x4beae;if(_0x144495&&_0x4beae>_0x144495){return db[_0x89c1('0x101')][_0x89c1('0x55')]({'where':{'id':0x1}})[_0x89c1('0x14')](function(_0x5e1c5b){if(_0x5e1c5b){_0x5e1c5b[_0x89c1('0x102')](_0x89c1('0x103'));}});}})['then'](function(){if(_0x205c9e[_0x89c1('0xfd')]&&_0x205c9e[_0x89c1('0xfd')]['Intervals']){var _0x535fa0=[];for(var _0x1b9c86=0x0;_0x1b9c86<_0x205c9e['Interval'][_0x89c1('0xfe')][_0x89c1('0x49')];_0x1b9c86++){var _0x291bd1=_0x205c9e['Interval'][_0x89c1('0xfe')][_0x1b9c86][_0x89c1('0x28')]({'plain':!![]});_0x535fa0['push'](iftimePromise(_0x291bd1,_0x205c9e));}return BPromise['all'](_0x535fa0)['then'](function(_0x34b76f){return _[_0x89c1('0x104')](_0x34b76f);});}else{return!![];}})[_0x89c1('0x14')](function(_0x3cfd31){var _0x4350b9=fs[_0x89c1('0xc8')](path['join'](config[_0x89c1('0x6d')],_0x89c1('0x105')),_0x89c1('0xca'));var _0x10dacd={'remote':_0x205c9e[_0x89c1('0x106')],'query':querystring[_0x89c1('0x19')](_[_0x89c1('0x3e')](_0x205c9e['get']({'plain':!![]}),{'customerIp':_0x28f0b2[_0x89c1('0x7d')][_0x89c1('0x9a')]||_0x28f0b2[_0x89c1('0x7d')][_0x89c1('0x107')]||_0x28f0b2[_0x89c1('0x108')][_0x89c1('0x109')]||_0x28f0b2['ip'],'referer':_0x28f0b2['headers'][_0x89c1('0x9d')],'openedInteractions':_0x259f8,'maxInteractions':_0x144495,'virtual':_0x1954a3[_0x89c1('0x100')],'online':_0x3cfd31,'custom':_0x1954a3}))['replace'](/'/g,'\x5c\x27')};_0x47f27c[_0x89c1('0x2c')](ejs['render'](Mustache[_0x89c1('0xcb')](_0x4350b9,_0x10dacd),{'proactiveActions':_0x5a7997,'alignment':_0x205c9e['alignment'],'verticalAlignment':_0x205c9e[_0x89c1('0x10a')],'div_color':_0x205c9e[_0x89c1('0xf1')],'labelText':_0x205c9e['labelText'],'text_color':_0x205c9e[_0x89c1('0x10b')],'text_button_color':_0x205c9e[_0x89c1('0x10c')],'button_color':_0x205c9e['color_button'],'background_color':_0x205c9e[_0x89c1('0x10d')],'hideWhenOffline':_0x205c9e[_0x89c1('0x10e')],'interval':_0x205c9e[_0x89c1('0x10f')]}));})[_0x89c1('0x1f')](handleError(_0x47f27c,null));};exports[_0x89c1('0x110')]=function(_0x3c160b,_0x2b661a){var _0x1f8b10=_0x3c160b[_0x89c1('0x46')]['id'];var _0x2dc1e6=_0x3c160b[_0x89c1('0x4c')];var _0x2ea110=0xc8;var _0x499536=null;return db['sequelize'][_0x89c1('0xd6')]({'isolationLevel':db[_0x89c1('0xd5')][_0x89c1('0x111')][_0x89c1('0x112')][_0x89c1('0x113')]},function(_0x3f4c95){return db[_0x89c1('0x41')]['findOne']({'where':{'id':_0x1f8b10},'transaction':_0x3f4c95})['then'](function(_0x202f9c){if(_0x202f9c){return db['ChatApplication'][_0x89c1('0x27')]({'where':{'ChatWebsiteId':_0x1f8b10},'transaction':_0x3f4c95})[_0x89c1('0x14')](function(){var _0x38e2e9=_[_0x89c1('0x2f')](_0x2dc1e6,function(_0x699741){_0x699741[_0x89c1('0x59')]=_0x1f8b10;return _0x699741;});return db[_0x89c1('0x114')][_0x89c1('0xd8')](_0x38e2e9,{'transaction':_0x3f4c95});});}else{_0x2ea110=0x194;_0x499536=[];}});})['then'](function(){if(_0x2ea110!==0x194){return db[_0x89c1('0x114')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1f8b10},'order':_0x89c1('0x95')})[_0x89c1('0x14')](function(_0x1acab5){_0x499536=_0x1acab5;});}})[_0x89c1('0x1f')](function(_0x235b17){_0x2ea110=0x1f4;logger[_0x89c1('0x1a')](_0x235b17[_0x89c1('0x115')]);if(_0x235b17[_0x89c1('0x33')]){delete _0x235b17['name'];}_0x499536=_0x235b17;})['finally'](function(){if(_0x499536===null){_0x2b661a[_0x89c1('0x2b')](_0x2ea110);}else{if(_0x2ea110===0x1f4){_0x2b661a[_0x89c1('0x20')](_0x2ea110)[_0x89c1('0x2c')](_0x499536);}else{_0x2b661a[_0x89c1('0x20')](_0x2ea110)[_0x89c1('0x22')](_0x499536);}}});};exports['getApplications']=function(_0x5f65f4,_0x285c44){var _0x6e1ffd={};var _0xae202f={};var _0x15c6da;var _0x3a81a2;return db['ChatWebsite'][_0x89c1('0x55')]({'where':{'id':_0x5f65f4[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x285c44,null))[_0x89c1('0x14')](function(_0xfda9d8){if(_0xfda9d8){_0x15c6da=_0xfda9d8;_0xae202f['model']=_[_0x89c1('0x35')](db[_0x89c1('0x114')][_0x89c1('0x56')]);_0xae202f['query']=_[_0x89c1('0x35')](_0x5f65f4[_0x89c1('0x34')]);_0xae202f[_0x89c1('0x36')]=_[_0x89c1('0x37')](_0xae202f['model'],_0xae202f[_0x89c1('0x34')]);_0x6e1ffd[_0x89c1('0x39')]=_[_0x89c1('0x37')](_0xae202f[_0x89c1('0x38')],qs[_0x89c1('0x48')](_0x5f65f4[_0x89c1('0x34')][_0x89c1('0x48')]));_0x6e1ffd[_0x89c1('0x39')]=_0x6e1ffd[_0x89c1('0x39')][_0x89c1('0x49')]?_0x6e1ffd[_0x89c1('0x39')]:_0xae202f[_0x89c1('0x38')];_0x6e1ffd[_0x89c1('0x3b')]=qs[_0x89c1('0x57')](_0x5f65f4['query']['sort']);_0x6e1ffd[_0x89c1('0x3c')]=qs['filters'](_['pick'](_0x5f65f4[_0x89c1('0x34')],_0xae202f[_0x89c1('0x36')]));if(_0x5f65f4[_0x89c1('0x34')]['filter']){_0x6e1ffd['where']=_['merge'](_0x6e1ffd[_0x89c1('0x3c')],{'$or':_[_0x89c1('0x2f')](_0x6e1ffd[_0x89c1('0x39')],function(_0x44bfb7){var _0xe87f3b={};_0xe87f3b[_0x44bfb7]={'$like':'%'+_0x5f65f4[_0x89c1('0x34')][_0x89c1('0x3d')]+'%'};return _0xe87f3b;})});}_0x6e1ffd=_[_0x89c1('0x3e')]({},_0x6e1ffd,_0x5f65f4[_0x89c1('0x40')]);return _0x15c6da[_0x89c1('0x116')](_0x6e1ffd);}})['then'](function(_0x5ce6d6){if(_0x5ce6d6){_0x3a81a2=_0x5ce6d6['length'];if(!_0x5f65f4[_0x89c1('0x34')][_0x89c1('0x5e')](_0x89c1('0x3a'))){_0x6e1ffd['limit']=qs[_0x89c1('0x26')](_0x5f65f4['query'][_0x89c1('0x26')]);_0x6e1ffd[_0x89c1('0x23')]=qs[_0x89c1('0x23')](_0x5f65f4[_0x89c1('0x34')][_0x89c1('0x23')]);}return _0x15c6da['getApplications'](_0x6e1ffd);}})['then'](function(_0x58b398){if(_0x58b398){return _0x58b398?{'count':_0x3a81a2,'rows':_0x58b398}:null;}})[_0x89c1('0x14')](respondWithResult(_0x285c44,null))[_0x89c1('0x1f')](handleError(_0x285c44,null));};exports[_0x89c1('0x117')]=function(_0x45dcec,_0x24b5a0){return db[_0x89c1('0x118')]['find']({'where':{'id':_0x45dcec[_0x89c1('0x46')]['id']}})['then'](handleEntityNotFound(_0x24b5a0,null))[_0x89c1('0x14')](function(_0x1c23a6){if(_0x1c23a6){return _0x1c23a6[_0x89c1('0x117')](_0x45dcec[_0x89c1('0x4c')]['ids'],_['omit'](_0x45dcec[_0x89c1('0x4c')],[_0x89c1('0x5b'),'id'])||{});}})[_0x89c1('0x14')](respondWithResult(_0x24b5a0,null))[_0x89c1('0x1f')](handleError(_0x24b5a0,null));};exports[_0x89c1('0x119')]=function(_0x3f2124,_0x3862cf){var _0x9d9cd6={};var _0x360119={};var _0x2c2149;var _0x425b3e;return db['ChatWebsite'][_0x89c1('0x55')]({'where':{'id':_0x3f2124[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x3862cf,null))['then'](function(_0x54bb1c){if(_0x54bb1c){_0x2c2149=_0x54bb1c;_0x360119[_0x89c1('0x38')]=_[_0x89c1('0x35')](db[_0x89c1('0x11a')][_0x89c1('0x56')]);_0x360119[_0x89c1('0x34')]=_[_0x89c1('0x35')](_0x3f2124[_0x89c1('0x34')]);_0x360119[_0x89c1('0x36')]=_[_0x89c1('0x37')](_0x360119[_0x89c1('0x38')],_0x360119['query']);_0x9d9cd6[_0x89c1('0x39')]=_[_0x89c1('0x37')](_0x360119['model'],qs['fields'](_0x3f2124[_0x89c1('0x34')][_0x89c1('0x48')]));_0x9d9cd6[_0x89c1('0x39')]=_0x9d9cd6[_0x89c1('0x39')][_0x89c1('0x49')]?_0x9d9cd6[_0x89c1('0x39')]:_0x360119[_0x89c1('0x38')];_0x9d9cd6[_0x89c1('0x3b')]=qs['sort'](_0x3f2124[_0x89c1('0x34')][_0x89c1('0x57')]);_0x9d9cd6['where']=qs[_0x89c1('0x36')](_[_0x89c1('0x58')](_0x3f2124['query'],_0x360119[_0x89c1('0x36')]));if(_0x3f2124[_0x89c1('0x34')][_0x89c1('0x3d')]){_0x9d9cd6[_0x89c1('0x3c')]=_['merge'](_0x9d9cd6['where'],{'$or':_['map'](_0x9d9cd6[_0x89c1('0x39')],function(_0x4e0ec7){var _0x4f587f={};_0x4f587f[_0x4e0ec7]={'$like':'%'+_0x3f2124[_0x89c1('0x34')][_0x89c1('0x3d')]+'%'};return _0x4f587f;})});}_0x9d9cd6=_[_0x89c1('0x3e')]({},_0x9d9cd6,_0x3f2124[_0x89c1('0x40')]);return _0x2c2149[_0x89c1('0x119')](_0x9d9cd6);}})[_0x89c1('0x14')](function(_0x374cd9){if(_0x374cd9){_0x425b3e=_0x374cd9[_0x89c1('0x49')];if(!_0x3f2124['query'][_0x89c1('0x5e')](_0x89c1('0x3a'))){_0x9d9cd6[_0x89c1('0x26')]=qs[_0x89c1('0x26')](_0x3f2124[_0x89c1('0x34')][_0x89c1('0x26')]);_0x9d9cd6['offset']=qs['offset'](_0x3f2124[_0x89c1('0x34')][_0x89c1('0x23')]);}return _0x2c2149[_0x89c1('0x119')](_0x9d9cd6);}})[_0x89c1('0x14')](function(_0x3926e8){if(_0x3926e8){return _0x3926e8?{'count':_0x425b3e,'rows':_0x3926e8}:null;}})[_0x89c1('0x14')](respondWithResult(_0x3862cf,null))[_0x89c1('0x1f')](handleError(_0x3862cf,null));};exports[_0x89c1('0x11b')]=function(_0x27696b,_0x4d581a){var _0x34429d=_0x27696b[_0x89c1('0x34')][_0x89c1('0x11c')]===_0x89c1('0x11d')?_0x89c1('0x11e'):_0x89c1('0x11f');return db['ChatWebsite'][_0x89c1('0x4a')]({'attributes':['id',_0x34429d],'where':{'id':_0x27696b[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x4d581a,null))['then'](function(_0x4cb340){if(_0x4cb340){var _0x79ea5d=_0x4cb340[_0x34429d];var _0x297719=_0x79ea5d&&_0x79ea5d['items']?_0x79ea5d['items']:[];_0x4d581a[_0x89c1('0x2c')]({'fromKey':_[_0x89c1('0x70')](_0x79ea5d[_0x89c1('0x120')])?undefined:_0x79ea5d['fromKey'],'count':_0x297719['length'],'rows':_0x297719});}})['catch'](handleError(_0x4d581a,null));};exports[_0x89c1('0x121')]=function(_0x215a38,_0x34b2c1){var _0x5d4b78={'raw':![],'where':{}};var _0x1555f3={};var _0x54281b={'count':0x0,'rows':[]};return db[_0x89c1('0x41')][_0x89c1('0x55')]({'where':{'id':_0x215a38[_0x89c1('0x46')]['id']}})['then'](handleEntityNotFound(_0x34b2c1,null))[_0x89c1('0x14')](function(_0x2e02a9){if(_0x2e02a9){_0x1555f3[_0x89c1('0x38')]=_['keys'](db[_0x89c1('0xcd')][_0x89c1('0x56')]);_0x1555f3[_0x89c1('0x34')]=_[_0x89c1('0x35')](_0x215a38[_0x89c1('0x34')]);_0x1555f3[_0x89c1('0x36')]=_[_0x89c1('0x37')](_0x1555f3[_0x89c1('0x38')],_0x1555f3[_0x89c1('0x34')]);_0x5d4b78['attributes']=_[_0x89c1('0x37')](_0x1555f3['model'],qs[_0x89c1('0x48')](_0x215a38['query']['fields']));_0x5d4b78[_0x89c1('0x39')]=_0x5d4b78['attributes']['length']?_0x5d4b78[_0x89c1('0x39')]:_0x1555f3[_0x89c1('0x38')];if(!_0x215a38[_0x89c1('0x34')][_0x89c1('0x5e')]('nolimit')){_0x5d4b78[_0x89c1('0x26')]=qs[_0x89c1('0x26')](_0x215a38[_0x89c1('0x34')][_0x89c1('0x26')]);_0x5d4b78[_0x89c1('0x23')]=qs[_0x89c1('0x23')](_0x215a38[_0x89c1('0x34')][_0x89c1('0x23')]);}_0x5d4b78[_0x89c1('0x3b')]=qs['sort'](_0x215a38[_0x89c1('0x34')][_0x89c1('0x57')]);_0x5d4b78[_0x89c1('0x3c')]=qs[_0x89c1('0x36')](_['pick'](_0x215a38['query'],_0x1555f3[_0x89c1('0x36')]));_0x5d4b78[_0x89c1('0x3c')][_0x89c1('0x59')]=_0x2e02a9['id'];if(_0x215a38[_0x89c1('0x34')]['filter']){_0x5d4b78['where']=_['merge'](_0x5d4b78[_0x89c1('0x3c')],{'$or':_[_0x89c1('0x2f')](_0x5d4b78[_0x89c1('0x39')],function(_0x485550){var _0x54fbaa={};_0x54fbaa[_0x485550]={'$like':'%'+_0x215a38[_0x89c1('0x34')][_0x89c1('0x3d')]+'%'};return _0x54fbaa;})});}_0x5d4b78=_[_0x89c1('0x3e')]({},_0x5d4b78,_0x215a38[_0x89c1('0x40')]);return db[_0x89c1('0xcd')]['count']({'where':_0x5d4b78['where']})[_0x89c1('0x14')](function(_0x165821){_0x54281b[_0x89c1('0x25')]=_0x165821;if(_0x215a38['query'][_0x89c1('0x42')]){_0x5d4b78[_0x89c1('0x43')]=[{'all':!![]}];}else{_0x5d4b78[_0x89c1('0x43')]=[{'model':db['CmContact'],'as':_0x89c1('0x122'),'required':![]},{'model':db[_0x89c1('0xd7')],'as':'Attachments','required':![]}];}return db[_0x89c1('0xcd')]['findAll'](_0x5d4b78);})[_0x89c1('0x14')](function(_0x3c4c6f){_0x54281b[_0x89c1('0x5f')]=_0x3c4c6f;return _0x54281b;});}})['then'](respondWithFilteredResult(_0x34b2c1,_0x5d4b78))[_0x89c1('0x1f')](handleError(_0x34b2c1,null));};exports[_0x89c1('0x123')]=function(_0x20455b,_0x324c8b){return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0x20455b['params']['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x324c8b,null))[_0x89c1('0x14')](function(_0x86b62b){if(_0x86b62b){return _0x86b62b[_0x89c1('0x123')](_0x20455b['body']['ids'],_['omit'](_0x20455b[_0x89c1('0x4c')],[_0x89c1('0x5b'),'id'])||{})[_0x89c1('0xab')](function(_0x562a59){for(var _0x3f6cc9=0x0;_0x3f6cc9<_0x20455b['body'][_0x89c1('0x5b')][_0x89c1('0x49')];_0x3f6cc9+=0x1){socket[_0x89c1('0x124')]('userChatWebsite:save',{'UserId':Number(_0x20455b['body'][_0x89c1('0x5b')][_0x3f6cc9]),'ChatWebsiteId':Number(_0x20455b['params']['id'])});}return _0x562a59;});}})['then'](respondWithResult(_0x324c8b,null))[_0x89c1('0x1f')](handleError(_0x324c8b,null));};exports['removeAgents']=function(_0x8453aa,_0xd325f2){return db[_0x89c1('0x41')][_0x89c1('0x4a')]({'where':{'id':_0x8453aa[_0x89c1('0x46')]['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0xd325f2,null))[_0x89c1('0x14')](function(_0x59a576){if(_0x59a576){return _0x59a576[_0x89c1('0x125')](_0x8453aa[_0x89c1('0x34')][_0x89c1('0x5b')])[_0x89c1('0x14')](function(){if(_[_0x89c1('0x126')](_0x8453aa[_0x89c1('0x34')][_0x89c1('0x5b')])){for(var _0x274ac2=0x0;_0x274ac2<_0x8453aa[_0x89c1('0x34')][_0x89c1('0x5b')][_0x89c1('0x49')];_0x274ac2+=0x1){socket[_0x89c1('0x124')](_0x89c1('0x127'),{'UserId':Number(_0x8453aa[_0x89c1('0x34')][_0x89c1('0x5b')][_0x274ac2]),'ChatWebsiteId':Number(_0x8453aa['params']['id'])});}}else{socket['emit'](_0x89c1('0x127'),{'UserId':Number(_0x8453aa[_0x89c1('0x34')]['ids']),'ChatWebsiteId':Number(_0x8453aa[_0x89c1('0x46')]['id'])});}});}})[_0x89c1('0x14')](respondWithStatusCode(_0xd325f2,null))[_0x89c1('0x1f')](handleError(_0xd325f2,null));};exports[_0x89c1('0x128')]=function(_0x5a030e,_0x311033){var _0x50ab48={};var _0x32455a={};var _0x5470e4;var _0x2086fe;return db[_0x89c1('0x41')][_0x89c1('0x55')]({'where':{'id':_0x5a030e['params']['id']}})[_0x89c1('0x14')](handleEntityNotFound(_0x311033,null))[_0x89c1('0x14')](function(_0x3c91e3){if(_0x3c91e3){_0x5470e4=_0x3c91e3;_0x32455a[_0x89c1('0x38')]=_[_0x89c1('0x35')](db[_0x89c1('0xb9')]['rawAttributes']);_0x32455a[_0x89c1('0x34')]=_[_0x89c1('0x35')](_0x5a030e[_0x89c1('0x34')]);_0x32455a[_0x89c1('0x36')]=_[_0x89c1('0x37')](_0x32455a[_0x89c1('0x38')],_0x32455a[_0x89c1('0x34')]);_0x50ab48[_0x89c1('0x39')]=_[_0x89c1('0x37')](_0x32455a[_0x89c1('0x38')],qs[_0x89c1('0x48')](_0x5a030e[_0x89c1('0x34')][_0x89c1('0x48')]));_0x50ab48['attributes']=_0x50ab48[_0x89c1('0x39')][_0x89c1('0x49')]?_0x50ab48['attributes']:_0x32455a[_0x89c1('0x38')];_0x50ab48[_0x89c1('0x3b')]=qs[_0x89c1('0x57')](_0x5a030e[_0x89c1('0x34')][_0x89c1('0x57')]);_0x50ab48['where']=qs[_0x89c1('0x36')](_[_0x89c1('0x58')](_0x5a030e[_0x89c1('0x34')],_0x32455a['filters']));if(_0x5a030e[_0x89c1('0x34')][_0x89c1('0x3d')]){_0x50ab48['where']=_[_0x89c1('0x3e')](_0x50ab48[_0x89c1('0x3c')],{'$or':_[_0x89c1('0x2f')](_0x50ab48['attributes'],function(_0x53cf71){var _0x5c3ee4={};_0x5c3ee4[_0x53cf71]={'$like':'%'+_0x5a030e['query']['filter']+'%'};return _0x5c3ee4;})});}_0x50ab48=_[_0x89c1('0x3e')]({},_0x50ab48,_0x5a030e[_0x89c1('0x40')]);return _0x5470e4[_0x89c1('0x128')](_0x50ab48);}})[_0x89c1('0x14')](function(_0x450259){if(_0x450259){_0x2086fe=_0x450259[_0x89c1('0x49')];if(!_0x5a030e['query'][_0x89c1('0x5e')](_0x89c1('0x3a'))){_0x50ab48[_0x89c1('0x26')]=qs[_0x89c1('0x26')](_0x5a030e['query'][_0x89c1('0x26')]);_0x50ab48[_0x89c1('0x23')]=qs[_0x89c1('0x23')](_0x5a030e[_0x89c1('0x34')][_0x89c1('0x23')]);}return _0x5470e4['getAgents'](_0x50ab48);}})[_0x89c1('0x14')](function(_0x12964a){if(_0x12964a){return _0x12964a?{'count':_0x2086fe,'rows':_0x12964a}:null;}})['then'](respondWithResult(_0x311033,null))[_0x89c1('0x1f')](handleError(_0x311033,null));};
\ No newline at end of file
+var _0x4715=['push','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','addInteraction','getInteractions','Contact','fullname','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','textButtonColor','color_button','IntervalId','addApplications','Transaction','ChatApplication','finally','getApplications','addProactiveActions','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','fs-extra','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','ChatWebsite','findAll','rows','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','findOne','ids','addAnswer','CannedAnswer','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','getResult','chat','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','ValidationError','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','CmContact','Applications','List','applications','list','priority','asc','account','Contacts','from','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','created','autoclose'];(function(_0x54f6a6,_0xde810f){var _0x37a293=function(_0x3dad2c){while(--_0x3dad2c){_0x54f6a6['push'](_0x54f6a6['shift']());}};_0x37a293(++_0xde810f);}(_0x4715,0x71));var _0x5471=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x4715[_0x2b7764];return _0x848dcb;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x5471('0x0'));var util=require(_0x5471('0x1'));var path=require(_0x5471('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5471('0x3'));var _=require(_0x5471('0x4'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0x5471('0x5'));var logger=require(_0x5471('0x6'))(_0x5471('0x7'));var config=require(_0x5471('0x8'));var db=require(_0x5471('0x9'))['db'];config[_0x5471('0xa')]=_[_0x5471('0xb')](config[_0x5471('0xa')],{'host':_0x5471('0xc'),'port':0x18eb});var socket=require(_0x5471('0xd'))(new Redis(config[_0x5471('0xa')]));require('./chatWebsite.socket')[_0x5471('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x5471('0xf'));var client=jayson['client'][_0x5471('0x10')]({'port':0x232c});var client9002=jayson[_0x5471('0x11')]['http']({'port':0x232a});var client9003=jayson['client'][_0x5471('0x10')]({'port':0x232b});var client9001=jayson[_0x5471('0x11')][_0x5471('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x1422e0,_0x35960e,_0x3ad4fd,_0x57d141){return new BPromise(function(_0x414478,_0x4aa273){var _0xca82b7=_0x57d141||client;return _0xca82b7[_0x5471('0x12')](_0x1422e0,_0x3ad4fd)[_0x5471('0x13')](function(_0x5e8d9d){logger[_0x5471('0x14')](_0x5471('0x15'),_0x35960e,'request\x20sent');logger['debug'](_0x5471('0x16'),_0x35960e,_0x5471('0x17'),JSON[_0x5471('0x18')](_0x5e8d9d));if(_0x5e8d9d['error']){if(_0x5e8d9d[_0x5471('0x19')][_0x5471('0x1a')]===0x1f4){logger[_0x5471('0x19')](_0x5471('0x15'),_0x35960e,_0x5e8d9d['error']['message']);return _0x4aa273(_0x5e8d9d[_0x5471('0x19')][_0x5471('0x1b')]);}logger[_0x5471('0x19')](_0x5471('0x15'),_0x35960e,_0x5e8d9d[_0x5471('0x19')][_0x5471('0x1b')]);return _0x414478(_0x5e8d9d[_0x5471('0x19')][_0x5471('0x1b')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x35960e,_0x5471('0x17'));_0x414478(_0x5e8d9d[_0x5471('0x1c')][_0x5471('0x1b')]);}})[_0x5471('0x1d')](function(_0x3768c4){logger[_0x5471('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x35960e,_0x3768c4);_0x4aa273(_0x3768c4);});});}function respondWithStatusCode(_0x2689a7,_0x3178e5){_0x3178e5=_0x3178e5||0xcc;return function(_0x6c44d7){if(_0x6c44d7){return _0x2689a7[_0x5471('0x1e')](_0x3178e5);}return _0x2689a7[_0x5471('0x1f')](_0x3178e5)['end']();};}function respondWithResult(_0x436ce9,_0x4a1994){_0x4a1994=_0x4a1994||0xc8;return function(_0x53b085){if(_0x53b085){return _0x436ce9['status'](_0x4a1994)[_0x5471('0x20')](_0x53b085);}};}function respondWithFilteredResult(_0x3f4aec,_0x3cb1bf){return function(_0x226425){if(_0x226425){var _0x3d4f6e=typeof _0x3cb1bf[_0x5471('0x21')]===_0x5471('0x22')&&typeof _0x3cb1bf['limit']===_0x5471('0x22');var _0x24231a=_0x226425[_0x5471('0x23')];var _0x1f62cf=_0x3d4f6e?0x0:_0x3cb1bf['offset'];var _0x12f467=_0x3d4f6e?_0x226425[_0x5471('0x23')]:_0x3cb1bf[_0x5471('0x21')]+_0x3cb1bf[_0x5471('0x24')];var _0x5111ed;if(_0x12f467>=_0x24231a){_0x12f467=_0x24231a;_0x5111ed=0xc8;}else{_0x5111ed=0xce;}_0x3f4aec[_0x5471('0x1f')](_0x5111ed);return _0x3f4aec[_0x5471('0x25')](_0x5471('0x26'),_0x1f62cf+'-'+_0x12f467+'/'+_0x24231a)[_0x5471('0x20')](_0x226425);}return null;};}function saveUpdates(_0x577781){return function(_0x3e88af){if(_0x3e88af){return _0x3e88af[_0x5471('0x27')](_0x577781)[_0x5471('0x13')](function(_0x53e98c){return _0x53e98c;});}return null;};}function removeEntity(_0x412b25){return function(_0x27d6f0){if(_0x27d6f0){return _0x27d6f0[_0x5471('0x28')]()[_0x5471('0x13')](function(){var _0x1ce9fb=_0x27d6f0[_0x5471('0x29')]({'plain':!![]});var _0x1730f1=_0x5471('0x2a');return db[_0x5471('0x2b')][_0x5471('0x28')]({'where':{'type':_0x1730f1,'resourceId':_0x1ce9fb['id']}})[_0x5471('0x13')](function(){return _0x27d6f0;});})[_0x5471('0x13')](function(){_0x412b25['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a809){return function(_0x31823e){if(!_0x31823e){_0x49a809[_0x5471('0x1e')](0x194);}return _0x31823e;};}function handleError(_0x129943,_0x57cab4){_0x57cab4=_0x57cab4||0x1f4;return function(_0x255e05){logger[_0x5471('0x19')](_0x255e05[_0x5471('0x2c')]);if(_0x255e05[_0x5471('0x2d')]){delete _0x255e05[_0x5471('0x2d')];}_0x129943[_0x5471('0x1f')](_0x57cab4)[_0x5471('0x2e')](_0x255e05);};}exports['index']=function(_0x4223de,_0x3f35f4){var _0x334f2e={'include':[{'model':db[_0x5471('0x2f')],'as':'mandatoryDispositionPause'}]},_0x3211b6={},_0x981ce={'count':0x0,'rows':[]};var _0x41b400=_['map'](db['ChatWebsite'][_0x5471('0x30')],function(_0x13d4f7){return{'name':_0x13d4f7['fieldName'],'type':_0x13d4f7[_0x5471('0x31')][_0x5471('0x32')]};});_0x3211b6['model']=_[_0x5471('0x33')](_0x41b400,'name');_0x3211b6[_0x5471('0x34')]=_[_0x5471('0x35')](_0x4223de[_0x5471('0x34')]);_0x3211b6[_0x5471('0x36')]=_[_0x5471('0x37')](_0x3211b6[_0x5471('0x38')],_0x3211b6[_0x5471('0x34')]);_0x334f2e[_0x5471('0x39')]=_['intersection'](_0x3211b6['model'],qs[_0x5471('0x3a')](_0x4223de[_0x5471('0x34')][_0x5471('0x3a')]));_0x334f2e[_0x5471('0x39')]=_0x334f2e[_0x5471('0x39')]['length']?_0x334f2e[_0x5471('0x39')]:_0x3211b6[_0x5471('0x38')];if(!_0x4223de[_0x5471('0x34')][_0x5471('0x3b')](_0x5471('0x3c'))){_0x334f2e[_0x5471('0x24')]=qs[_0x5471('0x24')](_0x4223de['query'][_0x5471('0x24')]);_0x334f2e['offset']=qs[_0x5471('0x21')](_0x4223de[_0x5471('0x34')][_0x5471('0x21')]);}_0x334f2e[_0x5471('0x3d')]=qs[_0x5471('0x3e')](_0x4223de[_0x5471('0x34')]['sort']);_0x334f2e['where']=qs['filters'](_[_0x5471('0x3f')](_0x4223de[_0x5471('0x34')],_0x3211b6[_0x5471('0x36')]),_0x41b400);if(_0x4223de[_0x5471('0x34')][_0x5471('0x40')]){_0x334f2e[_0x5471('0x41')]=_[_0x5471('0x42')](_0x334f2e['where'],{'$or':_['map'](_0x41b400,function(_0x400b7c){if(_0x400b7c['type']!=='VIRTUAL'){var _0x33006d={};_0x33006d[_0x400b7c[_0x5471('0x2d')]]={'$like':'%'+_0x4223de['query'][_0x5471('0x40')]+'%'};return _0x33006d;}})});}_0x334f2e=_[_0x5471('0x42')]({},_0x334f2e,_0x4223de[_0x5471('0x43')]);var _0x1ea6f5={'where':_0x334f2e[_0x5471('0x41')]};return db['ChatWebsite'][_0x5471('0x23')](_0x1ea6f5)['then'](function(_0x4a0be9){_0x981ce['count']=_0x4a0be9;if(_0x4223de[_0x5471('0x34')][_0x5471('0x44')]){_0x334f2e['include']=[{'all':!![]}];}return db[_0x5471('0x45')][_0x5471('0x46')](_0x334f2e);})['then'](function(_0x287923){_0x981ce[_0x5471('0x47')]=_0x287923;return _0x981ce;})[_0x5471('0x13')](respondWithFilteredResult(_0x3f35f4,_0x334f2e))[_0x5471('0x1d')](handleError(_0x3f35f4,null));};exports[_0x5471('0x48')]=function(_0x62aac8,_0xd823da){var _0x17df21={'raw':![],'where':{'id':_0x62aac8[_0x5471('0x49')]['id']},'include':[{'model':db[_0x5471('0x2f')],'as':'mandatoryDispositionPause'}]},_0x392114={};_0x392114['model']=_[_0x5471('0x35')](db[_0x5471('0x45')][_0x5471('0x30')]);_0x392114[_0x5471('0x34')]=_[_0x5471('0x35')](_0x62aac8[_0x5471('0x34')]);_0x392114[_0x5471('0x36')]=_[_0x5471('0x37')](_0x392114[_0x5471('0x38')],_0x392114['query']);_0x17df21[_0x5471('0x39')]=_[_0x5471('0x37')](_0x392114['model'],qs[_0x5471('0x3a')](_0x62aac8[_0x5471('0x34')]['fields']));_0x17df21[_0x5471('0x39')]=_0x17df21[_0x5471('0x39')][_0x5471('0x4a')]?_0x17df21[_0x5471('0x39')]:_0x392114[_0x5471('0x38')];if(_0x62aac8['query'][_0x5471('0x44')]){_0x17df21[_0x5471('0x4b')]=[{'all':!![]}];}_0x17df21=_[_0x5471('0x42')]({},_0x17df21,_0x62aac8[_0x5471('0x43')]);return db[_0x5471('0x45')][_0x5471('0x4c')](_0x17df21)[_0x5471('0x13')](handleEntityNotFound(_0xd823da,null))[_0x5471('0x13')](respondWithResult(_0xd823da,null))[_0x5471('0x1d')](handleError(_0xd823da,null));};exports[_0x5471('0x4d')]=function(_0x64c3f5,_0x102154){return db[_0x5471('0x45')][_0x5471('0x4d')](_0x64c3f5[_0x5471('0x4e')],{})[_0x5471('0x13')](function(_0x2b73a9){var _0x5f1229=_0x64c3f5['user'][_0x5471('0x29')]({'plain':!![]});if(!_0x5f1229)throw new Error(_0x5471('0x4f'));if(_0x5f1229[_0x5471('0x50')]===_0x5471('0x51')){var _0x3a6fd5=_0x2b73a9['get']({'plain':!![]});var _0x2722e4='ChatWebsites';return db['UserProfileSection'][_0x5471('0x4c')]({'where':{'name':_0x2722e4,'userProfileId':_0x5f1229['userProfileId']},'raw':!![]})[_0x5471('0x13')](function(_0x27f03e){if(_0x27f03e&&_0x27f03e[_0x5471('0x52')]===0x0){return db[_0x5471('0x2b')][_0x5471('0x4d')]({'name':_0x3a6fd5[_0x5471('0x2d')],'resourceId':_0x3a6fd5['id'],'type':_0x27f03e[_0x5471('0x2d')],'sectionId':_0x27f03e['id']},{})[_0x5471('0x13')](function(){return _0x2b73a9;});}else{return _0x2b73a9;}})[_0x5471('0x1d')](function(_0x432e2c){logger[_0x5471('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x432e2c);throw _0x432e2c;});}return _0x2b73a9;})[_0x5471('0x13')](respondWithResult(_0x102154,0xc9))[_0x5471('0x1d')](handleError(_0x102154,null));};exports[_0x5471('0x27')]=function(_0x1520fd,_0x572c38){if(_0x1520fd[_0x5471('0x4e')]['id']){delete _0x1520fd[_0x5471('0x4e')]['id'];}return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x1520fd[_0x5471('0x49')]['id']},'include':[{'model':db[_0x5471('0x2f')],'as':_0x5471('0x53')}]})[_0x5471('0x13')](handleEntityNotFound(_0x572c38,null))['then'](saveUpdates(_0x1520fd[_0x5471('0x4e')],null))[_0x5471('0x13')](respondWithResult(_0x572c38,null))[_0x5471('0x1d')](handleError(_0x572c38,null));};exports['destroy']=function(_0x6e519a,_0x41622e){return db['ChatWebsite']['find']({'where':{'id':_0x6e519a[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x41622e,null))[_0x5471('0x13')](removeEntity(_0x41622e,null))[_0x5471('0x1d')](handleError(_0x41622e,null));};exports['describe']=function(_0x50867d,_0x4b3895){return db[_0x5471('0x45')][_0x5471('0x54')]()[_0x5471('0x13')](respondWithResult(_0x4b3895,null))['catch'](handleError(_0x4b3895,null));};exports[_0x5471('0x55')]=function(_0x398385,_0x3fb002){if(_0x398385['body']['id']){delete _0x398385[_0x5471('0x4e')]['id'];}return db[_0x5471('0x45')]['find']({'where':{'id':_0x398385[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x3fb002,null))[_0x5471('0x13')](function(_0x43b69d){if(_0x43b69d){_0x398385[_0x5471('0x4e')][_0x5471('0x56')]=_0x43b69d['id'];return db[_0x5471('0x57')]['create'](_0x398385[_0x5471('0x4e')]);}})[_0x5471('0x13')](respondWithResult(_0x3fb002,null))[_0x5471('0x1d')](handleError(_0x3fb002,null));};exports['getDispositions']=function(_0x2c8c7e,_0x1d8e9d){var _0x1fb49a={'raw':![],'where':{}};var _0x470cbe={};var _0x3f3648={'count':0x0,'rows':[]};return db[_0x5471('0x45')][_0x5471('0x58')]({'where':{'id':_0x2c8c7e['params']['id']}})['then'](handleEntityNotFound(_0x1d8e9d,null))['then'](function(_0x3cccc3){if(_0x3cccc3){_0x470cbe[_0x5471('0x38')]=_[_0x5471('0x35')](db[_0x5471('0x57')][_0x5471('0x30')]);_0x470cbe[_0x5471('0x34')]=_['keys'](_0x2c8c7e[_0x5471('0x34')]);_0x470cbe[_0x5471('0x36')]=_[_0x5471('0x37')](_0x470cbe[_0x5471('0x38')],_0x470cbe[_0x5471('0x34')]);_0x1fb49a[_0x5471('0x39')]=_['intersection'](_0x470cbe[_0x5471('0x38')],qs[_0x5471('0x3a')](_0x2c8c7e[_0x5471('0x34')][_0x5471('0x3a')]));_0x1fb49a[_0x5471('0x39')]=_0x1fb49a['attributes'][_0x5471('0x4a')]?_0x1fb49a[_0x5471('0x39')]:_0x470cbe['model'];if(!_0x2c8c7e['query'][_0x5471('0x3b')](_0x5471('0x3c'))){_0x1fb49a['limit']=qs[_0x5471('0x24')](_0x2c8c7e[_0x5471('0x34')][_0x5471('0x24')]);_0x1fb49a[_0x5471('0x21')]=qs['offset'](_0x2c8c7e['query'][_0x5471('0x21')]);}_0x1fb49a['order']=qs[_0x5471('0x3e')](_0x2c8c7e[_0x5471('0x34')][_0x5471('0x3e')]);_0x1fb49a[_0x5471('0x41')]=qs[_0x5471('0x36')](_[_0x5471('0x3f')](_0x2c8c7e[_0x5471('0x34')],_0x470cbe['filters']));_0x1fb49a[_0x5471('0x41')]['ChatWebsiteId']=_0x3cccc3['id'];if(_0x2c8c7e[_0x5471('0x34')][_0x5471('0x40')]){_0x1fb49a[_0x5471('0x41')]=_[_0x5471('0x42')](_0x1fb49a[_0x5471('0x41')],{'$or':_[_0x5471('0x33')](_0x1fb49a[_0x5471('0x39')],function(_0x143a34){var _0x24543e={};_0x24543e[_0x143a34]={'$like':'%'+_0x2c8c7e[_0x5471('0x34')][_0x5471('0x40')]+'%'};return _0x24543e;})});}_0x1fb49a=_[_0x5471('0x42')]({},_0x1fb49a,_0x2c8c7e[_0x5471('0x43')]);return db[_0x5471('0x57')][_0x5471('0x23')]({'where':_0x1fb49a[_0x5471('0x41')]})[_0x5471('0x13')](function(_0x50018d){_0x3f3648['count']=_0x50018d;if(_0x2c8c7e['query'][_0x5471('0x44')]){_0x1fb49a[_0x5471('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0x5471('0x46')](_0x1fb49a);})['then'](function(_0x1fa4c6){_0x3f3648[_0x5471('0x47')]=_0x1fa4c6;return _0x3f3648;});}})['then'](respondWithFilteredResult(_0x1d8e9d,_0x1fb49a))[_0x5471('0x1d')](handleError(_0x1d8e9d,null));};exports['removeDispositions']=function(_0x506307,_0x2303c2){return db['ChatWebsite'][_0x5471('0x4c')]({'where':{'id':_0x506307[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x2303c2,null))[_0x5471('0x13')](function(_0x6d8635){if(_0x6d8635){return _0x6d8635['removeDispositions'](_0x506307['query'][_0x5471('0x59')]);}})[_0x5471('0x13')](respondWithStatusCode(_0x2303c2,null))[_0x5471('0x1d')](handleError(_0x2303c2,null));};exports[_0x5471('0x5a')]=function(_0x5198b0,_0x394985){if(_0x5198b0[_0x5471('0x4e')]['id']){delete _0x5198b0['body']['id'];}return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x5198b0['params']['id']}})['then'](handleEntityNotFound(_0x394985,null))[_0x5471('0x13')](function(_0x2ece3e){if(_0x2ece3e){_0x5198b0[_0x5471('0x4e')][_0x5471('0x56')]=_0x2ece3e['id'];return db[_0x5471('0x5b')]['create'](_0x5198b0[_0x5471('0x4e')]);}})[_0x5471('0x13')](respondWithResult(_0x394985,null))[_0x5471('0x1d')](handleError(_0x394985,null));};exports['getAnswers']=function(_0x449835,_0x5c5fba){var _0x994107={'raw':![],'where':{}};var _0x2e9b5e={};var _0x48084f={'count':0x0,'rows':[]};return db[_0x5471('0x45')][_0x5471('0x58')]({'where':{'id':_0x449835['params']['id']}})['then'](handleEntityNotFound(_0x5c5fba,null))['then'](function(_0x3770c0){if(_0x3770c0){_0x2e9b5e[_0x5471('0x38')]=_[_0x5471('0x35')](db[_0x5471('0x5b')]['rawAttributes']);_0x2e9b5e['query']=_['keys'](_0x449835['query']);_0x2e9b5e['filters']=_[_0x5471('0x37')](_0x2e9b5e['model'],_0x2e9b5e[_0x5471('0x34')]);_0x994107[_0x5471('0x39')]=_['intersection'](_0x2e9b5e['model'],qs[_0x5471('0x3a')](_0x449835['query'][_0x5471('0x3a')]));_0x994107['attributes']=_0x994107['attributes']['length']?_0x994107[_0x5471('0x39')]:_0x2e9b5e[_0x5471('0x38')];if(!_0x449835['query'][_0x5471('0x3b')](_0x5471('0x3c'))){_0x994107['limit']=qs[_0x5471('0x24')](_0x449835[_0x5471('0x34')][_0x5471('0x24')]);_0x994107[_0x5471('0x21')]=qs[_0x5471('0x21')](_0x449835[_0x5471('0x34')][_0x5471('0x21')]);}_0x994107[_0x5471('0x3d')]=qs[_0x5471('0x3e')](_0x449835['query']['sort']);_0x994107['where']=qs[_0x5471('0x36')](_['pick'](_0x449835['query'],_0x2e9b5e['filters']));_0x994107[_0x5471('0x41')][_0x5471('0x56')]=_0x3770c0['id'];if(_0x449835['query'][_0x5471('0x40')]){_0x994107[_0x5471('0x41')]=_[_0x5471('0x42')](_0x994107[_0x5471('0x41')],{'$or':_[_0x5471('0x33')](_0x994107['attributes'],function(_0x45eeba){var _0x115f73={};_0x115f73[_0x45eeba]={'$like':'%'+_0x449835[_0x5471('0x34')]['filter']+'%'};return _0x115f73;})});}_0x994107=_[_0x5471('0x42')]({},_0x994107,_0x449835[_0x5471('0x43')]);return db[_0x5471('0x5b')]['count']({'where':_0x994107['where']})[_0x5471('0x13')](function(_0x31f4c4){_0x48084f[_0x5471('0x23')]=_0x31f4c4;if(_0x449835[_0x5471('0x34')][_0x5471('0x44')]){_0x994107[_0x5471('0x4b')]=[{'all':!![]}];}return db[_0x5471('0x5b')][_0x5471('0x46')](_0x994107);})[_0x5471('0x13')](function(_0x11f8ef){_0x48084f['rows']=_0x11f8ef;return _0x48084f;});}})[_0x5471('0x13')](respondWithFilteredResult(_0x5c5fba,_0x994107))[_0x5471('0x1d')](handleError(_0x5c5fba,null));};exports['removeAnswers']=function(_0x5848cd,_0x534e95){return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x5848cd[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x534e95,null))[_0x5471('0x13')](function(_0x13ce98){if(_0x13ce98){return _0x13ce98['removeAnswers'](_0x5848cd[_0x5471('0x34')][_0x5471('0x59')]);}})[_0x5471('0x13')](respondWithStatusCode(_0x534e95,null))['catch'](handleError(_0x534e95,null));};exports[_0x5471('0x5c')]=function(_0x31e3ad,_0x4c6288){_0x31e3ad[_0x5471('0x4e')][_0x5471('0x5d')]=_0x31e3ad[_0x5471('0x5e')][_0x5471('0x5f')];return db['ChatWebsite'][_0x5471('0x4c')]({'where':{'id':_0x31e3ad[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x4c6288,null))[_0x5471('0x13')](saveUpdates(_0x31e3ad['body'],null))[_0x5471('0x13')](respondWithResult(_0x4c6288,null))[_0x5471('0x1d')](handleError(_0x4c6288,null));};exports[_0x5471('0x60')]=function(_0x523912,_0x43a26d){_0x523912['body'][_0x5471('0x61')]=_0x523912['file'][_0x5471('0x5f')];return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x523912[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x43a26d,null))[_0x5471('0x13')](saveUpdates(_0x523912[_0x5471('0x4e')],null))['then'](respondWithResult(_0x43a26d,null))[_0x5471('0x1d')](handleError(_0x43a26d,null));};exports[_0x5471('0x62')]=function(_0x29fc6c,_0x19952c){_0x29fc6c['body'][_0x5471('0x63')]=_0x29fc6c[_0x5471('0x5e')]['filename'];return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x29fc6c[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x19952c,null))[_0x5471('0x13')](saveUpdates(_0x29fc6c[_0x5471('0x4e')],null))['then'](respondWithResult(_0x19952c,null))[_0x5471('0x1d')](handleError(_0x19952c,null));};exports[_0x5471('0x64')]=function(_0x2ad3e1,_0x36e5af){_0x2ad3e1[_0x5471('0x4e')][_0x5471('0x65')]=_0x2ad3e1[_0x5471('0x5e')][_0x5471('0x5f')];return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x2ad3e1['params']['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x36e5af,null))[_0x5471('0x13')](saveUpdates(_0x2ad3e1[_0x5471('0x4e')],null))[_0x5471('0x13')](respondWithResult(_0x36e5af,null))[_0x5471('0x1d')](handleError(_0x36e5af,null));};exports[_0x5471('0x66')]=function(_0x234481,_0x7f8c2a){var _0x59cfc1=path[_0x5471('0x67')](config[_0x5471('0x68')],_0x5471('0x69'));var _0x2a43c6={'where':{'id':_0x234481[_0x5471('0x49')]['id']},'attributes':['id',_0x5471('0x5d')],'raw':!![]};var _0x253ff9=![];return require('../../config/license/util')[_0x5471('0x6a')]()['then'](function(_0x2843fe){if(_0x2843fe){_0x253ff9=_0x2843fe[_0x5471('0x6b')];}})[_0x5471('0x13')](function(){return db['ChatWebsite']['find'](_0x2a43c6);})['then'](handleEntityNotFound(_0x7f8c2a,null))['then'](function(_0x4e8836){if(_0x4e8836){if(!_[_0x5471('0x6c')](_0x4e8836['sitepic'])){if(fs[_0x5471('0x6d')](path[_0x5471('0x67')](config[_0x5471('0x68')],'server/files/images/logos/',_0x4e8836[_0x5471('0x5d')]))&&_0x253ff9){_0x59cfc1=path[_0x5471('0x67')](config[_0x5471('0x68')],_0x5471('0x6e'),_0x4e8836[_0x5471('0x5d')]);}}return _0x7f8c2a[_0x5471('0x6f')](_0x59cfc1);}})[_0x5471('0x1d')](handleError(_0x7f8c2a,null));};exports[_0x5471('0x70')]=function(_0x4b2f70,_0x9172a5){var _0x2d6320=path[_0x5471('0x67')](config[_0x5471('0x68')],_0x5471('0x71'));var _0x56371b={'where':{'id':_0x4b2f70['params']['id']},'attributes':['id',_0x5471('0x61')],'raw':!![]};return db[_0x5471('0x45')]['find'](_0x56371b)['then'](handleEntityNotFound(_0x9172a5,null))[_0x5471('0x13')](function(_0xb4c825){if(_0xb4c825){if(!_[_0x5471('0x6c')](_0xb4c825[_0x5471('0x61')])){if(fs[_0x5471('0x6d')](path[_0x5471('0x67')](config[_0x5471('0x68')],_0x5471('0x72'),_0xb4c825['agentAvatar']))){_0x2d6320=path[_0x5471('0x67')](config[_0x5471('0x68')],_0x5471('0x72'),_0xb4c825[_0x5471('0x61')]);}}return _0x9172a5[_0x5471('0x6f')](_0x2d6320);}})['catch'](handleError(_0x9172a5,null));};exports['getCustomerAvatar']=function(_0x199034,_0x5dae4e){var _0x1f2979=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x4ed857={'where':{'id':_0x199034[_0x5471('0x49')]['id']},'attributes':['id',_0x5471('0x63'),'showCustomerAvatar'],'raw':!![]};return db[_0x5471('0x45')]['find'](_0x4ed857)[_0x5471('0x13')](handleEntityNotFound(_0x5dae4e,null))[_0x5471('0x13')](function(_0xd8af95){if(_0xd8af95){if(!_[_0x5471('0x6c')](_0xd8af95[_0x5471('0x63')])){if(fs[_0x5471('0x6d')](path[_0x5471('0x67')](config['root'],_0x5471('0x72'),_0xd8af95['customerAvatar']))&&_0xd8af95[_0x5471('0x73')]){_0x1f2979=path['join'](config['root'],_0x5471('0x72'),_0xd8af95[_0x5471('0x63')]);}}return _0x5dae4e['download'](_0x1f2979);}})[_0x5471('0x1d')](handleError(_0x5dae4e,null));};exports[_0x5471('0x74')]=function(_0x2c875d,_0x8bb15b){var _0x4c1b5b=path[_0x5471('0x67')](config['root'],_0x5471('0x75'));var _0x1b9e0d={'where':{'id':_0x2c875d[_0x5471('0x49')]['id']},'attributes':['id',_0x5471('0x65')],'raw':!![]};return db[_0x5471('0x45')][_0x5471('0x4c')](_0x1b9e0d)['then'](handleEntityNotFound(_0x8bb15b,null))['then'](function(_0x415414){if(_0x415414){if(!_[_0x5471('0x6c')](_0x415414[_0x5471('0x65')])){if(fs[_0x5471('0x6d')](path[_0x5471('0x67')](config[_0x5471('0x68')],_0x5471('0x72'),_0x415414[_0x5471('0x65')]))){_0x4c1b5b=path[_0x5471('0x67')](config[_0x5471('0x68')],'server/files/images/avatars/',_0x415414[_0x5471('0x65')]);}}return _0x8bb15b['download'](_0x4c1b5b);}})['catch'](handleError(_0x8bb15b,null));};exports[_0x5471('0x76')]=function(_0x5de834,_0x365a59){var _0x34e5d3=require(_0x5471('0x77'));var _0x2bfa9e=new _0x34e5d3();var _0x542bc1=_0x2bfa9e[_0x5471('0x78')](_0x5de834['headers']['user-agent'])[_0x5471('0x79')]();var _0x3c43f1={'body':_0x5de834[_0x5471('0x4e')],'channel':_0x5471('0x7a')};var _0x1c9bc8=[];var _0x3bda00=[];var _0x5816a1={};var _0x2f84b9=![];return db['CmContact'][_0x5471('0x54')]()[_0x5471('0x13')](function(_0x593b4f){if(!_0x593b4f){throw new db[(_0x5471('0x7b'))]['ValidationError'](_0x5471('0x7c'));}_0x1c9bc8=_[_0x5471('0x7d')](_[_0x5471('0x35')](_0x593b4f),[_0x5471('0x7e'),_0x5471('0x7f')]);_0x3bda00=_[_0x5471('0x7d')](_[_0x5471('0x35')](_0x593b4f),['createdAt',_0x5471('0x7f'),_0x5471('0x80'),_0x5471('0x81')]);if(_0x5de834[_0x5471('0x4e')]['id']){delete _0x5de834[_0x5471('0x4e')]['id'];}if(_[_0x5471('0x6c')](_0x5de834[_0x5471('0x4e')]['from'])){throw new db[(_0x5471('0x7b'))][(_0x5471('0x82'))](_0x5471('0x83'));}if(_['isNil'](_0x5de834[_0x5471('0x4e')][_0x5471('0x4e')])||_0x5de834[_0x5471('0x4e')][_0x5471('0x4e')]===''){throw new db[(_0x5471('0x7b'))][(_0x5471('0x82'))](_0x5471('0x84'));}if(_[_0x5471('0x6c')](_0x5de834[_0x5471('0x4e')][_0x5471('0x85')])){throw new db[(_0x5471('0x7b'))][(_0x5471('0x82'))](_0x5471('0x86')+_0x3bda00);}if(!_[_0x5471('0x87')](_0x3bda00,_0x5de834[_0x5471('0x4e')]['mapKey'])){throw new db[(_0x5471('0x7b'))][(_0x5471('0x82'))](_0x5471('0x88')+_0x3bda00);}_0x5816a1[_0x5de834[_0x5471('0x4e')][_0x5471('0x85')]]=_0x5de834[_0x5471('0x4e')]['from'];})['then'](function(){return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x5de834['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x5471('0x89')],'as':'Contacts','where':_0x5816a1,'limit':0x1,'order':[[_0x5471('0x7f'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x5471('0x8a')}]});})[_0x5471('0x13')](handleEntityNotFound(_0x365a59,null))[_0x5471('0x13')](function(_0x393918){if(_0x393918&&_0x393918[_0x5471('0x8b')]){_0x3c43f1['account']=_0x393918;_0x3c43f1[_0x5471('0x8c')]=_0x393918['Applications'];_0x3c43f1[_0x5471('0x8d')]=_0x393918[_0x5471('0x8b')];_0x3c43f1['applications']=_['orderBy'](_0x3c43f1['applications'],[_0x5471('0x8e')],[_0x5471('0x8f')]);if(_0x3c43f1[_0x5471('0x90')][_0x5471('0x8a')]){delete _0x3c43f1[_0x5471('0x90')]['Applications'];}if(_0x3c43f1[_0x5471('0x90')][_0x5471('0x8b')]&&_0x3c43f1[_0x5471('0x90')][_0x5471('0x8b')]['Contacts'][_0x5471('0x4a')]){return _0x3c43f1[_0x5471('0x90')][_0x5471('0x8b')][_0x5471('0x91')][0x0];}var _0x299e85=_[_0x5471('0xb')](_0x5de834['body'],{'firstName':_0x5de834[_0x5471('0x4e')][_0x5471('0x92')],'ListId':_0x393918[_0x5471('0x81')]});_0x299e85[_0x5de834[_0x5471('0x4e')][_0x5471('0x85')]]=_0x5de834['body'][_0x5471('0x92')];return db[_0x5471('0x89')][_0x5471('0x4d')](_0x299e85,{'fields':_0x1c9bc8,'raw':!![]});}})[_0x5471('0x13')](handleEntityNotFound(_0x365a59,null))[_0x5471('0x13')](function(_0x39cd15){_0x3c43f1[_0x5471('0x93')]=_0x39cd15;var _0x17c1a7=_0x5de834[_0x5471('0x4e')][_0x5471('0x94')];if(_0x5de834[_0x5471('0x95')][_0x5471('0x96')]){_0x17c1a7=_0x5de834[_0x5471('0x95')][_0x5471('0x96')];}else if(_0x5de834[_0x5471('0x95')][_0x5471('0x97')]){_0x17c1a7=_[_0x5471('0x98')](_0x5de834['headers']['x-forwarded-for'][_0x5471('0x99')](','));}if(_0x39cd15){var _0x23e46c={'ContactId':_0x39cd15['id'],'ChatWebsiteId':_0x5de834[_0x5471('0x49')]['id'],'from':(_0x39cd15['firstName']||'')+'\x20'+(_0x39cd15['lastName']||''),'customerIp':_0x17c1a7,'customerPort':_0x5de834[_0x5471('0x95')][_0x5471('0x9a')]?_0x5de834[_0x5471('0x95')][_0x5471('0x9a')]:null,'referer':_0x5de834[_0x5471('0x4e')][_0x5471('0x9b')],'browserName':_0x542bc1[_0x5471('0x9c')]['name']&&_0x542bc1[_0x5471('0x9c')][_0x5471('0x9d')]?util['format'](_0x5471('0x9e'),_0x542bc1[_0x5471('0x9c')][_0x5471('0x2d')],_0x542bc1['browser'][_0x5471('0x9d')]):_0x5471('0x9f'),'browserVersion':_0x542bc1[_0x5471('0x9c')][_0x5471('0x9d')]||_0x5471('0x9f'),'osName':util[_0x5471('0xa0')](_0x5471('0x9e'),_0x542bc1['os'][_0x5471('0x2d')],_0x542bc1['os'][_0x5471('0x9d')]),'osVersion':_0x542bc1['os'][_0x5471('0x9d')],'deviceModel':_0x542bc1[_0x5471('0xa1')][_0x5471('0x38')]&&_0x542bc1[_0x5471('0xa1')]['vendor']?util[_0x5471('0xa0')]('%s\x20%s\x20%s',_0x542bc1[_0x5471('0xa1')]['model'],_0x542bc1[_0x5471('0xa1')][_0x5471('0xa2')],_0x542bc1[_0x5471('0xa1')][_0x5471('0x31')]):null,'deviceVendor':_0x542bc1['device'][_0x5471('0xa2')],'deviceType':_0x542bc1[_0x5471('0xa1')][_0x5471('0x31')],'formData':JSON[_0x5471('0x18')](_0x5de834[_0x5471('0x4e')])};var _0x531d68={'ChatWebsiteId':_0x5de834[_0x5471('0x49')]['id'],'closed':![]};if(_0x5de834[_0x5471('0x4e')]['threadId']){_0x531d68['threadId']=_0x5de834[_0x5471('0x4e')][_0x5471('0xa3')];return db[_0x5471('0xa4')][_0x5471('0x4c')]({'where':_0x531d68})[_0x5471('0x13')](function(_0x32b306){if(_0x32b306){return[_0x32b306,![]];}_0x23e46c['threadId']=_0x5de834[_0x5471('0x4e')][_0x5471('0xa3')];_0x23e46c[_0x5471('0xa5')]=_0x5de834[_0x5471('0x4e')][_0x5471('0xa5')];return db[_0x5471('0xa4')][_0x5471('0x4d')](_0x23e46c)[_0x5471('0x13')](function(_0x134bcb){return[_0x134bcb,!![]];});});}_0x531d68[_0x5471('0xa6')]=_0x39cd15['id'];if(_0x5de834[_0x5471('0x4e')]['interaction']&&_0x5de834[_0x5471('0x4e')]['interaction']['id']){_0x531d68['id']=_0x5de834[_0x5471('0x4e')]['interaction']['id'];return db[_0x5471('0xa4')][_0x5471('0x4c')]({'where':_0x531d68})[_0x5471('0x13')](function(_0x4c166a){if(_0x4c166a){return[_0x4c166a,![]];}return db[_0x5471('0xa4')][_0x5471('0x4d')](_0x23e46c)['then'](function(_0x3e752b){return[_0x3e752b,!![]];});});}return db[_0x5471('0xa4')]['create'](_0x23e46c)['then'](function(_0x1a1eef){return[_0x1a1eef,!![]];});}})[_0x5471('0xa7')](function(_0x48c7d0,_0x6e1faa){if(_0x48c7d0){_0x2f84b9=_0x6e1faa;if(!_0x6e1faa){var _0x299f0d={'from':(_0x3c43f1[_0x5471('0x93')]['firstName']||'')+'\x20'+(_0x3c43f1[_0x5471('0x93')][_0x5471('0xa8')]||'')};if(_0x5de834['body'][_0x5471('0xa3')]&&_0x5de834['body'][_0x5471('0xa9')]&&_0x5de834[_0x5471('0x4e')][_0x5471('0xa3')]!=_0x5de834[_0x5471('0x4e')][_0x5471('0xa9')]){_0x299f0d[_0x5471('0xa3')]=_0x5de834[_0x5471('0x4e')][_0x5471('0xa9')];}return _0x48c7d0[_0x5471('0x27')](_0x299f0d);}else{return _0x48c7d0;}}})[_0x5471('0x13')](function(_0x3bef31){_0x3c43f1[_0x5471('0xaa')]=_0x3bef31[_0x5471('0x29')]({'plain':!![]});_0x3c43f1[_0x5471('0xaa')][_0x5471('0xab')]=_0x2f84b9;if(_0x3c43f1[_0x5471('0xaa')][_0x5471('0xab')]){if(_0x3c43f1['account'][_0x5471('0xac')]){_0x3c43f1[_0x5471('0x8c')][_0x5471('0xad')]({'id':0x0,'priority':_0x3c43f1[_0x5471('0x8c')][_0x5471('0x4a')]+0x1,'app':'close','appdata':_0x5471('0xae'),'interval':_0x5471('0xaf')});}}return db['ChatMessage'][_0x5471('0x4d')]({'body':_0x5de834['body'][_0x5471('0x4e')],'ChatWebsiteId':_0x5de834[_0x5471('0x49')]['id'],'ChatInteractionId':_0x3bef31['id'],'direction':'in','ContactId':_0x3c43f1[_0x5471('0x93')]['id'],'AttachmentId':_0x5de834[_0x5471('0x4e')]['AttachmentId']});})[_0x5471('0x13')](function(_0x27bebb){_0x3c43f1[_0x5471('0x1b')]=_0x27bebb;if(_0x3c43f1['interaction'][_0x5471('0xb0')]){return db[_0x5471('0xb1')][_0x5471('0x4c')]({'attributes':['id','name'],'where':{'id':_0x3c43f1[_0x5471('0xaa')][_0x5471('0xb0')]}})[_0x5471('0x13')](function(_0x35610f){if(_0x35610f){_0x3c43f1[_0x5471('0x8c')][_0x5471('0xb2')]({'id':0x0,'priority':0x0,'app':_0x5471('0xb3'),'appdata':_0x35610f[_0x5471('0x2d')]+','+(_0x3c43f1['account'][_0x5471('0xb4')]||0xa),'interval':_0x5471('0xaf')});_0x3c43f1[_0x5471('0xb5')]=!![];}return respondWithRpcPromise(_0x5471('0xb6'),_0x5471('0xb7'),_0x3c43f1);});}return respondWithRpcPromise(_0x5471('0xb6'),'startRouting',_0x3c43f1);})[_0x5471('0x13')](function(_0x12697e){respondWithRpcPromise(_0x5471('0xb8'),_0x5471('0xb8'),{'event':_0x5471('0x76'),'message':_0x12697e},client9002);return _0x12697e;})[_0x5471('0x13')](respondWithResult(_0x365a59,null))[_0x5471('0x1d')](handleError(_0x365a59,null));};exports[_0x5471('0xb9')]=function(_0x5968e2,_0x4593cf){var _0x34d5c1,_0xa86c3d,_0x107ee7;var _0x380c88=[];var _0x1e2b59={};var _0x5ba438=_0x5968e2[_0x5471('0xba')]||[];var _0x2a8814=[];var _0x76a03f;return db[_0x5471('0x89')][_0x5471('0x54')]()[_0x5471('0x13')](function(_0x5d691d){if(!_0x5d691d){throw new db[(_0x5471('0x7b'))][(_0x5471('0x82'))](_0x5471('0x7c'));}_0x380c88=_[_0x5471('0x7d')](_['keys'](_0x5d691d),[_0x5471('0x7e'),_0x5471('0x7f'),_0x5471('0x80'),_0x5471('0x81')]);if(_0x5968e2[_0x5471('0x4e')]['id']){delete _0x5968e2[_0x5471('0x4e')]['id'];}if(_[_0x5471('0x6c')](_0x5968e2[_0x5471('0x4e')][_0x5471('0x92')])){throw _0x4593cf[_0x5471('0x1f')](0x1f4)[_0x5471('0x2e')](new db[(_0x5471('0x7b'))]['ValidationError'](_0x5471('0x83')));}if(_[_0x5471('0x6c')](_0x5968e2[_0x5471('0x4e')][_0x5471('0x4e')])||_0x5968e2[_0x5471('0x4e')][_0x5471('0x4e')]===''){throw _0x4593cf['status'](0x1f4)[_0x5471('0x2e')](new db[(_0x5471('0x7b'))][(_0x5471('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5471('0x6c')](_0x5968e2['body'][_0x5471('0xbb')])){throw _0x4593cf['status'](0x1f4)[_0x5471('0x2e')](new db[(_0x5471('0x7b'))][(_0x5471('0x82'))](_0x5471('0xbc')+_0x380c88));}if(!_[_0x5471('0x87')](_0x380c88,_0x5968e2['body'][_0x5471('0xbb')])){throw _0x4593cf['status'](0x1f4)[_0x5471('0x2e')](new db[(_0x5471('0x7b'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x380c88));}_0x1e2b59[_0x5968e2[_0x5471('0x4e')][_0x5471('0xbb')]]=_0x5968e2[_0x5471('0x4e')]['from'];})[_0x5471('0x13')](function(){return db['ChatWebsite'][_0x5471('0x4c')]({'where':{'id':_0x5968e2[_0x5471('0x49')]['id']},'include':[{'model':db[_0x5471('0xbd')],'as':_0x5471('0x8b')},{'model':db[_0x5471('0xbe')],'as':'MailAccount'}]});})[_0x5471('0x13')](handleEntityNotFound(_0x4593cf,null))['then'](function(_0x121671){if(_0x121671&&_0x121671[_0x5471('0x8b')]){_0xa86c3d=_0x121671;var _0x2da9b1=_[_0x5471('0xb')](_0x5968e2[_0x5471('0x4e')],{'firstName':_0x5968e2[_0x5471('0x4e')]['from'],'phone':_0x5968e2[_0x5471('0x4e')]['from'],'ListId':_0x121671['ListId']});_0x2da9b1[_0x5968e2[_0x5471('0x4e')]['mapKeyOffline']]=_0x5968e2[_0x5471('0x4e')][_0x5471('0x92')];return db['CmContact'][_0x5471('0xbf')]({'where':_0x1e2b59,'defaults':_0x2da9b1});}})[_0x5471('0xa7')](function(_0x3782c1){if(_0x3782c1){_0x107ee7=_0x3782c1;var _0x24eb81=fs['readFileSync'](path['join'](config[_0x5471('0x68')],_0x5471('0xc0')),'utf8');var _0x1b96cd=ejs['render'](_0x24eb81,{'body':_['toPairs'](_0x5968e2[_0x5471('0x4e')][_0x5471('0x4e')]),'bodyTitle':_0xa86c3d[_0x5471('0xc1')]});return db[_0x5471('0xc2')]['create']({'body':_0x1b96cd,'plainBody':htmlToText['fromString'](_0x1b96cd),'ContactId':_0x3782c1['id'],'ChatWebsiteId':_0xa86c3d['id']});}})[_0x5471('0x13')](function(_0x8e06be){_0x76a03f=_0x8e06be;if(_0x5ba438[_0x5471('0x4a')]){var _0x4aad3f=_0x5ba438[_0x5471('0x33')](function(_0x5b85b0){return{'name':_0x5b85b0[_0x5471('0xc3')],'basename':_0x5b85b0[_0x5471('0x5f')],'type':_0x5b85b0['mimetype'],'ChatOfflineMessageId':_0x8e06be['id']};});_0x2a8814=_0x4aad3f[_0x5471('0x33')](_0x5e79f6=>{var _0x4d5ec9={'filename':_0x5e79f6['name'],'path':path['join'](config[_0x5471('0x68')],_0x5471('0xc4'),_0x5471('0xba'),_0x5471('0xc5'),'offline-chat',_0x5e79f6[_0x5471('0xc6')])};return _0x4d5ec9;});if(!_0xa86c3d[_0x5471('0xc7')]){return db[_0x5471('0xc8')][_0x5471('0xc9')](function(_0x268be9){return db['Attachment'][_0x5471('0xca')](_0x4aad3f,{'transaction':_0x268be9});});}}})[_0x5471('0x13')](function(){if(_0x76a03f){_0x34d5c1=_0x76a03f;return db[_0x5471('0xbe')][_0x5471('0x58')]({'where':{'service':!![]},'include':[{'model':db[_0x5471('0xcb')],'as':_0x5471('0xcc'),'raw':!![],'include':[{'model':db[_0x5471('0xcd')],'as':_0x5471('0xcd'),'raw':!![]}]}]});}})[_0x5471('0x13')](function(_0x1cacf8){if(_0x1cacf8&&_0x1cacf8[_0x5471('0xcc')]&&_0xa86c3d[_0x5471('0xce')]&&_0xa86c3d[_0x5471('0xcf')]){var _0x37da61=_0x1cacf8['getSmtpOptions']();return respondWithRpcPromise(_0x5471('0xd0'),'sendMail',{'account':_0x37da61,'message':{'from':util['format'](_0x5471('0xd1'),_0x1cacf8[_0x5471('0x2d')],_0x1cacf8[_0x5471('0xd2')]||_0x1cacf8[_0x5471('0xcc')][_0x5471('0x51')]),'to':_0xa86c3d[_0x5471('0xcf')],'subject':_0xa86c3d[_0x5471('0xd3')],'html':_0x34d5c1[_0x5471('0x4e')],'attachments':_0x2a8814}},client9003)['then'](function(){return _0x34d5c1;})['catch'](function(_0x4631cd){logger[_0x5471('0x19')](_0x4631cd);});}})[_0x5471('0x13')](function(){if(_0xa86c3d&&_0xa86c3d[_0x5471('0xc7')]&&_0xa86c3d['MailAccountId']){var _0x2357b5=[];if(_0x5ba438[_0x5471('0x4a')]){_0x2357b5=_0x5ba438[_0x5471('0x33')](function(_0x5b6458){return{'name':_0x5b6458[_0x5471('0xc3')],'basename':_0x5b6458['filename'],'type':_0x5b6458[_0x5471('0xd4')],'ChatOfflineMessageId':_0x76a03f['id']};});}var _0x4ce732;if(!_[_0x5471('0x6c')](_0xa86c3d[_0x5471('0xd5')])){var _0x42b23c=_[_0x5471('0x33')](_0x5968e2[_0x5471('0x4e')],function(_0x3bb7e4){return _0x3bb7e4;});var _0x349583=_[_0x5471('0xd6')](_0x42b23c)[0x0];var _0x478a69=_[_0x5471('0xd7')](_0x349583,function(_0xa81c4d){return _0xa81c4d;});_0x4ce732=_0x478a69[0x1][_0xa86c3d[_0x5471('0xd5')]];}var _0x48fb1a={'from':_0x107ee7[_0x5471('0xd2')],'firstName':_0x107ee7['firstName'],'lastName':_0x107ee7[_0x5471('0xa8')],'mapKey':_0x5471('0xd2'),'message':{'from':_0x107ee7['email'],'to':_0xa86c3d[_0x5471('0xbe')][_0x5471('0xd2')],'cc':'','subject':_['isNil'](_0x4ce732)?_0xa86c3d['offlineMessageSubject']:_0x4ce732,'messageId':'','sentAt':new Date(),'attach':_0x2357b5[_0x5471('0x4a')],'attachments':_0x2357b5,'originChannel':_0x5471('0xd8'),'ChatWebsiteId':_0xa86c3d['id'],'ChatOfflineMessageId':_0x34d5c1['id'],'originTo':_0xa86c3d[_0x5471('0xbe')][_0x5471('0xd2')]},'body':_0x34d5c1[_0x5471('0x4e')]};var _0x320bc7={'account':{'id':_0xa86c3d[_0x5471('0xd9')]},'body':_0x48fb1a,'log':_0x5471('0xda')};return respondWithRpcPromise(_0x5471('0xda'),_0x5471('0xdb'),_0x320bc7,client9001)['then'](function(){return _0x34d5c1;})[_0x5471('0x1d')](function(_0x23f6d2){logger[_0x5471('0x19')](_0x23f6d2);});}return;})[_0x5471('0x13')](function(){if(_0x34d5c1){return _0x34d5c1;}})[_0x5471('0x13')](respondWithResult(_0x4593cf,null))[_0x5471('0x1d')](function(_0x3381ee){logger[_0x5471('0x19')](_0x5471('0x1d'),_0x3381ee);for(var _0x5c1435 of _0x5ba438){var _0x46e0a2=path[_0x5471('0x67')](config[_0x5471('0x68')],_0x5471('0xc4'),_0x5471('0xba'),_0x5471('0xc5'),'offline-chat',_0x5c1435['filename']);fs_extra[_0x5471('0xdc')](_0x46e0a2)[_0x5471('0x1d')](function(_0x5daea3){logger[_0x5471('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x46e0a2,_0x5daea3);});}});};exports[_0x5471('0xdd')]=function(_0x9792b8,_0x535396){return db[_0x5471('0xa4')][_0x5471('0x4c')]({'where':{'id':_0x9792b8['params']['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x535396,null))[_0x5471('0x13')](function(_0xb905b4){if(_0xb905b4){return _0xb905b4[_0x5471('0xdd')](_0x9792b8[_0x5471('0x4e')]['ids'],_['omit'](_0x9792b8[_0x5471('0x4e')],[_0x5471('0x59'),'id'])||{});}})[_0x5471('0x13')](respondWithResult(_0x535396,null))[_0x5471('0x1d')](handleError(_0x535396,null));};exports[_0x5471('0xde')]=function(_0x39b583,_0x4d6bc0){var _0x157c62={'raw':![],'where':{}};var _0x4c63a9={};var _0x5ecc3f={'count':0x0,'rows':[]};return db[_0x5471('0x45')][_0x5471('0x58')]({'where':{'id':_0x39b583[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x4d6bc0,null))[_0x5471('0x13')](function(_0x557041){if(_0x557041){_0x4c63a9['model']=_[_0x5471('0x35')](db[_0x5471('0xa4')][_0x5471('0x30')]);_0x4c63a9['query']=_[_0x5471('0x35')](_0x39b583[_0x5471('0x34')]);_0x4c63a9[_0x5471('0x36')]=_[_0x5471('0x37')](_0x4c63a9[_0x5471('0x38')],_0x4c63a9[_0x5471('0x34')]);_0x157c62[_0x5471('0x39')]=_[_0x5471('0x37')](_0x4c63a9['model'],qs[_0x5471('0x3a')](_0x39b583[_0x5471('0x34')][_0x5471('0x3a')]));_0x157c62[_0x5471('0x39')]=_0x157c62['attributes'][_0x5471('0x4a')]?_0x157c62[_0x5471('0x39')]:_0x4c63a9['model'];if(!_0x39b583[_0x5471('0x34')][_0x5471('0x3b')](_0x5471('0x3c'))){_0x157c62[_0x5471('0x24')]=qs[_0x5471('0x24')](_0x39b583[_0x5471('0x34')][_0x5471('0x24')]);_0x157c62[_0x5471('0x21')]=qs['offset'](_0x39b583['query']['offset']);}_0x157c62[_0x5471('0x3d')]=qs[_0x5471('0x3e')](_0x39b583['query'][_0x5471('0x3e')]);_0x157c62[_0x5471('0x41')]=qs[_0x5471('0x36')](_[_0x5471('0x3f')](_0x39b583[_0x5471('0x34')],_0x4c63a9['filters']));_0x157c62['where'][_0x5471('0x56')]=_0x557041['id'];if(_0x39b583[_0x5471('0x34')][_0x5471('0x40')]){_0x157c62[_0x5471('0x41')]=_[_0x5471('0x42')](_0x157c62['where'],{'$or':_['map'](_0x157c62['attributes'],function(_0x11e1c0){var _0xb736fd={};_0xb736fd[_0x11e1c0]={'$like':'%'+_0x39b583[_0x5471('0x34')][_0x5471('0x40')]+'%'};return _0xb736fd;})});}_0x157c62=_[_0x5471('0x42')]({},_0x157c62,_0x39b583[_0x5471('0x43')]);return db[_0x5471('0xa4')][_0x5471('0x23')]({'where':_0x157c62[_0x5471('0x41')]})[_0x5471('0x13')](function(_0x2ccf6a){_0x5ecc3f[_0x5471('0x23')]=_0x2ccf6a;if(_0x39b583[_0x5471('0x34')][_0x5471('0x44')]){_0x157c62[_0x5471('0x4b')]=[{'model':db[_0x5471('0x89')],'as':_0x5471('0xdf'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x5471('0x2d'),_0x5471('0xe0'),'internal'],'required':![]},{'model':db[_0x5471('0xe1')],'as':_0x5471('0xe2'),'attributes':['id',_0x5471('0x2d'),'color'],'where':_0x39b583[_0x5471('0x34')]['tag']?{'id':_0x39b583['query']['tag']}:undefined,'required':_0x39b583[_0x5471('0x34')][_0x5471('0xe3')]?!![]:![]}];}return db[_0x5471('0xa4')][_0x5471('0x46')](_0x157c62);})[_0x5471('0x13')](function(_0x379d35){_0x5ecc3f[_0x5471('0x47')]=_0x379d35;return _0x5ecc3f;});}})[_0x5471('0x13')](respondWithFilteredResult(_0x4d6bc0,_0x157c62))[_0x5471('0x1d')](handleError(_0x4d6bc0,null));};function iftimePromise(_0x8a083e,_0x3e58c3){return respondWithRpcPromise(_0x5471('0xe4'),_0x5471('0xe5'),{'command':_0x3e58c3[_0x5471('0xe6')]?util[_0x5471('0xa0')](_0x5471('0xe7'),_0x8a083e[_0x5471('0xe8')],_0x3e58c3[_0x5471('0xe6')]):util[_0x5471('0xa0')](_0x5471('0xe9'),_0x8a083e[_0x5471('0xe8')])},client9002)['then'](function(_0x3d5884){var _0x3e6734=_0x3d5884&&_0x3d5884[_0x5471('0xea')](_0x5471('0xeb'))>=0x0?!![]:![];logger[_0x5471('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3e58c3['id'],_0x8a083e['id'],_0x8a083e[_0x5471('0xe8')],_0x3e6734?_0x5471('0xec'):_0x5471('0xed'),_0x3e58c3['timezone']?_0x3e58c3[_0x5471('0xe6')]:_0x5471('0xee'));return _0x3e6734;})[_0x5471('0x1d')](function(_0x2ca076){logger[_0x5471('0x19')](_0x5471('0xef'),_0x3e58c3['id'],_0x8a083e['id'],_0x8a083e[_0x5471('0xe8')],util[_0x5471('0xf0')](_0x2ca076,{'showHidden':![],'depth':null}),_0x3e58c3[_0x5471('0xe6')]?_0x3e58c3[_0x5471('0xe6')]:_0x5471('0xee'));return![];});}exports[_0x5471('0xe5')]=function(_0x43ec47,_0x429a0f){var _0x435829=0x0;var _0x28725b=0x0;var _0x34797f=![];var _0x2f46de;var _0x8d2c44;return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x43ec47['params']['id']},'include':[{'model':db[_0x5471('0xf1')],'as':_0x5471('0xf1'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x5471('0xe8')],'raw':!![]}]}]})[_0x5471('0x13')](handleEntityNotFound(_0x429a0f,null))[_0x5471('0x13')](function(_0x2ede3f){if(_0x2ede3f){_0x2f46de=_0x2ede3f;return _0x2ede3f[_0x5471('0xf2')]({'raw':!![]});}})[_0x5471('0x13')](function(_0x25c9f2){if(_0x2f46de){if(_0x25c9f2){_0x8d2c44=_0x25c9f2;}}return require(_0x5471('0xf3'))[_0x5471('0x6a')]();})[_0x5471('0x13')](function(_0x18cd92){if(_0x18cd92){_0x28725b=_0x18cd92[_0x5471('0xf4')];_0x34797f=_0x18cd92['custom'];}})[_0x5471('0x13')](function(){return db[_0x5471('0xa4')][_0x5471('0x23')]({'where':{'closed':![]}});})[_0x5471('0x13')](function(_0x31d5a8){_0x435829=_0x31d5a8;if(_0x28725b&&_0x31d5a8>_0x28725b){return db[_0x5471('0xf5')]['findOne']({'where':{'id':0x1}})[_0x5471('0x13')](function(_0x50bdfa){if(_0x50bdfa){_0x50bdfa[_0x5471('0xf6')](_0x5471('0xf7'));}});}})[_0x5471('0x13')](function(){if(_0x2f46de[_0x5471('0xf1')]&&_0x2f46de['Interval'][_0x5471('0xf8')]){var _0x128fe3=[];for(var _0x590dee=0x0;_0x590dee<_0x2f46de[_0x5471('0xf1')][_0x5471('0xf8')]['length'];_0x590dee++){var _0x2d3a4e=_0x2f46de[_0x5471('0xf1')][_0x5471('0xf8')][_0x590dee][_0x5471('0x29')]({'plain':!![]});_0x128fe3[_0x5471('0xad')](iftimePromise(_0x2d3a4e,_0x2f46de));}return BPromise[_0x5471('0xf9')](_0x128fe3)['then'](function(_0x18e768){return _[_0x5471('0xfa')](_0x18e768);});}else{return!![];}})[_0x5471('0x13')](function(_0x1454ed){var _0x318bcc=fs['readFileSync'](path[_0x5471('0x67')](config['root'],_0x5471('0xfb')),'utf8');var _0xc79596={'remote':_0x2f46de[_0x5471('0xfc')],'query':querystring['stringify'](_['merge'](_0x2f46de[_0x5471('0x29')]({'plain':!![]}),{'customerIp':_0x43ec47['headers'][_0x5471('0x97')]||_0x43ec47['headers'][_0x5471('0xfd')]||_0x43ec47[_0x5471('0xfe')][_0x5471('0xff')]||_0x43ec47['ip'],'referer':_0x43ec47[_0x5471('0x95')][_0x5471('0x9b')],'openedInteractions':_0x435829,'maxInteractions':_0x28725b,'virtual':_0x34797f[_0x5471('0xf4')],'online':_0x1454ed,'custom':_0x34797f}))[_0x5471('0x100')](/'/g,'\x5c\x27')};_0x429a0f[_0x5471('0x2e')](ejs[_0x5471('0x101')](Mustache[_0x5471('0x101')](_0x318bcc,_0xc79596),{'proactiveActions':_0x8d2c44,'alignment':_0x2f46de[_0x5471('0x102')],'verticalAlignment':_0x2f46de[_0x5471('0x103')],'div_color':_0x2f46de[_0x5471('0x104')],'labelText':_0x2f46de['labelText'],'text_color':_0x2f46de['textColor'],'text_button_color':_0x2f46de[_0x5471('0x105')],'button_color':_0x2f46de[_0x5471('0x106')],'background_color':_0x2f46de['backgroundColor'],'hideWhenOffline':_0x2f46de['hideWhenOffline'],'interval':_0x2f46de[_0x5471('0x107')]}));})[_0x5471('0x1d')](handleError(_0x429a0f,null));};exports[_0x5471('0x108')]=function(_0x40e4ae,_0x2b1d2f){var _0x2d9323=_0x40e4ae['params']['id'];var _0x1035cb=_0x40e4ae[_0x5471('0x4e')];var _0x3b6455=0xc8;var _0x17b177=null;return db[_0x5471('0xc8')]['transaction']({'isolationLevel':db[_0x5471('0xc8')][_0x5471('0x109')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0xc4ed6f){return db[_0x5471('0x45')][_0x5471('0x58')]({'where':{'id':_0x2d9323},'transaction':_0xc4ed6f})[_0x5471('0x13')](function(_0x24baab){if(_0x24baab){return db[_0x5471('0x10a')][_0x5471('0x28')]({'where':{'ChatWebsiteId':_0x2d9323},'transaction':_0xc4ed6f})['then'](function(){var _0x3d2f17=_['map'](_0x1035cb,function(_0x16b5bc){_0x16b5bc['ChatWebsiteId']=_0x2d9323;return _0x16b5bc;});return db['ChatApplication'][_0x5471('0xca')](_0x3d2f17,{'transaction':_0xc4ed6f});});}else{_0x3b6455=0x194;_0x17b177=[];}});})['then'](function(){if(_0x3b6455!==0x194){return db[_0x5471('0x10a')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2d9323},'order':_0x5471('0x8e')})[_0x5471('0x13')](function(_0x511603){_0x17b177=_0x511603;});}})[_0x5471('0x1d')](function(_0xd5c339){_0x3b6455=0x1f4;logger[_0x5471('0x19')](_0xd5c339[_0x5471('0x2c')]);if(_0xd5c339[_0x5471('0x2d')]){delete _0xd5c339[_0x5471('0x2d')];}_0x17b177=_0xd5c339;})[_0x5471('0x10b')](function(){if(_0x17b177===null){_0x2b1d2f[_0x5471('0x1e')](_0x3b6455);}else{if(_0x3b6455===0x1f4){_0x2b1d2f[_0x5471('0x1f')](_0x3b6455)[_0x5471('0x2e')](_0x17b177);}else{_0x2b1d2f['status'](_0x3b6455)[_0x5471('0x20')](_0x17b177);}}});};exports[_0x5471('0x10c')]=function(_0x20585e,_0xdaa954){var _0x141c38={};var _0x1e0fee={};var _0x41a508;var _0x244511;return db['ChatWebsite'][_0x5471('0x58')]({'where':{'id':_0x20585e[_0x5471('0x49')]['id']}})['then'](handleEntityNotFound(_0xdaa954,null))[_0x5471('0x13')](function(_0x319905){if(_0x319905){_0x41a508=_0x319905;_0x1e0fee['model']=_['keys'](db[_0x5471('0x10a')][_0x5471('0x30')]);_0x1e0fee['query']=_[_0x5471('0x35')](_0x20585e[_0x5471('0x34')]);_0x1e0fee[_0x5471('0x36')]=_[_0x5471('0x37')](_0x1e0fee[_0x5471('0x38')],_0x1e0fee[_0x5471('0x34')]);_0x141c38[_0x5471('0x39')]=_['intersection'](_0x1e0fee['model'],qs[_0x5471('0x3a')](_0x20585e[_0x5471('0x34')][_0x5471('0x3a')]));_0x141c38[_0x5471('0x39')]=_0x141c38[_0x5471('0x39')][_0x5471('0x4a')]?_0x141c38['attributes']:_0x1e0fee['model'];_0x141c38[_0x5471('0x3d')]=qs[_0x5471('0x3e')](_0x20585e[_0x5471('0x34')][_0x5471('0x3e')]);_0x141c38['where']=qs[_0x5471('0x36')](_[_0x5471('0x3f')](_0x20585e[_0x5471('0x34')],_0x1e0fee[_0x5471('0x36')]));if(_0x20585e['query'][_0x5471('0x40')]){_0x141c38[_0x5471('0x41')]=_[_0x5471('0x42')](_0x141c38[_0x5471('0x41')],{'$or':_['map'](_0x141c38[_0x5471('0x39')],function(_0x468b15){var _0x2295af={};_0x2295af[_0x468b15]={'$like':'%'+_0x20585e[_0x5471('0x34')][_0x5471('0x40')]+'%'};return _0x2295af;})});}_0x141c38=_['merge']({},_0x141c38,_0x20585e['options']);return _0x41a508[_0x5471('0x10c')](_0x141c38);}})[_0x5471('0x13')](function(_0x44b720){if(_0x44b720){_0x244511=_0x44b720[_0x5471('0x4a')];if(!_0x20585e['query'][_0x5471('0x3b')](_0x5471('0x3c'))){_0x141c38[_0x5471('0x24')]=qs[_0x5471('0x24')](_0x20585e['query'][_0x5471('0x24')]);_0x141c38[_0x5471('0x21')]=qs[_0x5471('0x21')](_0x20585e[_0x5471('0x34')][_0x5471('0x21')]);}return _0x41a508[_0x5471('0x10c')](_0x141c38);}})['then'](function(_0x270d17){if(_0x270d17){return _0x270d17?{'count':_0x244511,'rows':_0x270d17}:null;}})['then'](respondWithResult(_0xdaa954,null))[_0x5471('0x1d')](handleError(_0xdaa954,null));};exports[_0x5471('0x10d')]=function(_0x1242b0,_0x336e2f){return db['chatProactiveAction']['find']({'where':{'id':_0x1242b0[_0x5471('0x49')]['id']}})['then'](handleEntityNotFound(_0x336e2f,null))[_0x5471('0x13')](function(_0x4f8ee7){if(_0x4f8ee7){return _0x4f8ee7[_0x5471('0x10d')](_0x1242b0[_0x5471('0x4e')][_0x5471('0x59')],_[_0x5471('0x10e')](_0x1242b0[_0x5471('0x4e')],[_0x5471('0x59'),'id'])||{});}})['then'](respondWithResult(_0x336e2f,null))[_0x5471('0x1d')](handleError(_0x336e2f,null));};exports[_0x5471('0xf2')]=function(_0x1f8121,_0x18d3d5){var _0x2a54c0={};var _0x3c222f={};var _0x2d030f;var _0x42c840;return db['ChatWebsite'][_0x5471('0x58')]({'where':{'id':_0x1f8121[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x18d3d5,null))[_0x5471('0x13')](function(_0x3694d4){if(_0x3694d4){_0x2d030f=_0x3694d4;_0x3c222f[_0x5471('0x38')]=_[_0x5471('0x35')](db['ChatProactiveAction'][_0x5471('0x30')]);_0x3c222f[_0x5471('0x34')]=_[_0x5471('0x35')](_0x1f8121['query']);_0x3c222f[_0x5471('0x36')]=_['intersection'](_0x3c222f[_0x5471('0x38')],_0x3c222f[_0x5471('0x34')]);_0x2a54c0['attributes']=_[_0x5471('0x37')](_0x3c222f[_0x5471('0x38')],qs[_0x5471('0x3a')](_0x1f8121[_0x5471('0x34')][_0x5471('0x3a')]));_0x2a54c0[_0x5471('0x39')]=_0x2a54c0['attributes']['length']?_0x2a54c0[_0x5471('0x39')]:_0x3c222f[_0x5471('0x38')];_0x2a54c0[_0x5471('0x3d')]=qs[_0x5471('0x3e')](_0x1f8121['query']['sort']);_0x2a54c0[_0x5471('0x41')]=qs[_0x5471('0x36')](_[_0x5471('0x3f')](_0x1f8121[_0x5471('0x34')],_0x3c222f['filters']));if(_0x1f8121[_0x5471('0x34')][_0x5471('0x40')]){_0x2a54c0[_0x5471('0x41')]=_['merge'](_0x2a54c0[_0x5471('0x41')],{'$or':_['map'](_0x2a54c0[_0x5471('0x39')],function(_0x4d83a1){var _0x47d59a={};_0x47d59a[_0x4d83a1]={'$like':'%'+_0x1f8121[_0x5471('0x34')][_0x5471('0x40')]+'%'};return _0x47d59a;})});}_0x2a54c0=_['merge']({},_0x2a54c0,_0x1f8121[_0x5471('0x43')]);return _0x2d030f[_0x5471('0xf2')](_0x2a54c0);}})[_0x5471('0x13')](function(_0xead3ca){if(_0xead3ca){_0x42c840=_0xead3ca[_0x5471('0x4a')];if(!_0x1f8121['query'][_0x5471('0x3b')](_0x5471('0x3c'))){_0x2a54c0[_0x5471('0x24')]=qs[_0x5471('0x24')](_0x1f8121[_0x5471('0x34')][_0x5471('0x24')]);_0x2a54c0[_0x5471('0x21')]=qs[_0x5471('0x21')](_0x1f8121['query']['offset']);}return _0x2d030f[_0x5471('0xf2')](_0x2a54c0);}})[_0x5471('0x13')](function(_0x382fca){if(_0x382fca){return _0x382fca?{'count':_0x42c840,'rows':_0x382fca}:null;}})[_0x5471('0x13')](respondWithResult(_0x18d3d5,null))[_0x5471('0x1d')](handleError(_0x18d3d5,null));};exports[_0x5471('0x10f')]=function(_0x2f6270,_0x3708ac){var _0xfe60ae=_0x2f6270[_0x5471('0x34')][_0x5471('0x110')]===_0x5471('0x111')?_0x5471('0x112'):_0x5471('0x113');return db[_0x5471('0x45')]['find']({'attributes':['id',_0xfe60ae],'where':{'id':_0x2f6270[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x3708ac,null))[_0x5471('0x13')](function(_0x2e0a01){if(_0x2e0a01){var _0x112548=_0x2e0a01[_0xfe60ae];var _0x29525f=_0x112548&&_0x112548[_0x5471('0x114')]?_0x112548[_0x5471('0x114')]:[];_0x3708ac['send']({'fromKey':_[_0x5471('0x6c')](_0x112548['fromKey'])?undefined:_0x112548[_0x5471('0x115')],'count':_0x29525f[_0x5471('0x4a')],'rows':_0x29525f});}})[_0x5471('0x1d')](handleError(_0x3708ac,null));};exports[_0x5471('0x116')]=function(_0x27d77a,_0x13c906){var _0x2764e5={'raw':![],'where':{}};var _0x1eb6e2={};var _0xef2752={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x27d77a[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x13c906,null))[_0x5471('0x13')](function(_0x4acf54){if(_0x4acf54){_0x1eb6e2['model']=_[_0x5471('0x35')](db[_0x5471('0xc2')]['rawAttributes']);_0x1eb6e2[_0x5471('0x34')]=_[_0x5471('0x35')](_0x27d77a['query']);_0x1eb6e2[_0x5471('0x36')]=_['intersection'](_0x1eb6e2[_0x5471('0x38')],_0x1eb6e2[_0x5471('0x34')]);_0x2764e5['attributes']=_[_0x5471('0x37')](_0x1eb6e2[_0x5471('0x38')],qs[_0x5471('0x3a')](_0x27d77a[_0x5471('0x34')][_0x5471('0x3a')]));_0x2764e5[_0x5471('0x39')]=_0x2764e5[_0x5471('0x39')]['length']?_0x2764e5[_0x5471('0x39')]:_0x1eb6e2[_0x5471('0x38')];if(!_0x27d77a[_0x5471('0x34')][_0x5471('0x3b')](_0x5471('0x3c'))){_0x2764e5[_0x5471('0x24')]=qs['limit'](_0x27d77a[_0x5471('0x34')][_0x5471('0x24')]);_0x2764e5['offset']=qs[_0x5471('0x21')](_0x27d77a[_0x5471('0x34')][_0x5471('0x21')]);}_0x2764e5['order']=qs[_0x5471('0x3e')](_0x27d77a['query']['sort']);_0x2764e5[_0x5471('0x41')]=qs['filters'](_[_0x5471('0x3f')](_0x27d77a[_0x5471('0x34')],_0x1eb6e2[_0x5471('0x36')]));_0x2764e5['where'][_0x5471('0x56')]=_0x4acf54['id'];if(_0x27d77a[_0x5471('0x34')][_0x5471('0x40')]){_0x2764e5[_0x5471('0x41')]=_[_0x5471('0x42')](_0x2764e5[_0x5471('0x41')],{'$or':_[_0x5471('0x33')](_0x2764e5[_0x5471('0x39')],function(_0x2662b4){var _0x2f819c={};_0x2f819c[_0x2662b4]={'$like':'%'+_0x27d77a[_0x5471('0x34')][_0x5471('0x40')]+'%'};return _0x2f819c;})});}_0x2764e5=_[_0x5471('0x42')]({},_0x2764e5,_0x27d77a[_0x5471('0x43')]);return db[_0x5471('0xc2')]['count']({'where':_0x2764e5['where']})['then'](function(_0x59443d){_0xef2752[_0x5471('0x23')]=_0x59443d;if(_0x27d77a[_0x5471('0x34')]['includeAll']){_0x2764e5['include']=[{'all':!![]}];}else{_0x2764e5[_0x5471('0x4b')]=[{'model':db[_0x5471('0x89')],'as':'Contact','required':![]},{'model':db[_0x5471('0x117')],'as':_0x5471('0x118'),'required':![]}];}return db[_0x5471('0xc2')][_0x5471('0x46')](_0x2764e5);})[_0x5471('0x13')](function(_0x2a9f59){_0xef2752['rows']=_0x2a9f59;return _0xef2752;});}})['then'](respondWithFilteredResult(_0x13c906,_0x2764e5))['catch'](handleError(_0x13c906,null));};exports['addAgents']=function(_0x165e43,_0x1e4726){return db[_0x5471('0x45')][_0x5471('0x4c')]({'where':{'id':_0x165e43[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x1e4726,null))[_0x5471('0x13')](function(_0x331244){if(_0x331244){return _0x331244['addAgents'](_0x165e43['body']['ids'],_[_0x5471('0x10e')](_0x165e43['body'],[_0x5471('0x59'),'id'])||{})[_0x5471('0xa7')](function(_0x79be69){for(var _0x10cca8=0x0;_0x10cca8<_0x165e43['body'][_0x5471('0x59')][_0x5471('0x4a')];_0x10cca8+=0x1){socket[_0x5471('0x119')](_0x5471('0x11a'),{'UserId':Number(_0x165e43[_0x5471('0x4e')][_0x5471('0x59')][_0x10cca8]),'ChatWebsiteId':Number(_0x165e43['params']['id'])});}return _0x79be69;});}})[_0x5471('0x13')](respondWithResult(_0x1e4726,null))[_0x5471('0x1d')](handleError(_0x1e4726,null));};exports[_0x5471('0x11b')]=function(_0x406990,_0x6990bd){return db['ChatWebsite'][_0x5471('0x4c')]({'where':{'id':_0x406990[_0x5471('0x49')]['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x6990bd,null))['then'](function(_0xef433d){if(_0xef433d){return _0xef433d[_0x5471('0x11b')](_0x406990[_0x5471('0x34')][_0x5471('0x59')])[_0x5471('0x13')](function(){if(_['isArray'](_0x406990[_0x5471('0x34')][_0x5471('0x59')])){for(var _0x1b51f8=0x0;_0x1b51f8<_0x406990[_0x5471('0x34')]['ids'][_0x5471('0x4a')];_0x1b51f8+=0x1){socket['emit'](_0x5471('0x11c'),{'UserId':Number(_0x406990[_0x5471('0x34')][_0x5471('0x59')][_0x1b51f8]),'ChatWebsiteId':Number(_0x406990['params']['id'])});}}else{socket[_0x5471('0x119')](_0x5471('0x11c'),{'UserId':Number(_0x406990[_0x5471('0x34')][_0x5471('0x59')]),'ChatWebsiteId':Number(_0x406990['params']['id'])});}});}})['then'](respondWithStatusCode(_0x6990bd,null))[_0x5471('0x1d')](handleError(_0x6990bd,null));};exports['getAgents']=function(_0x236c39,_0x327edc){var _0x135b97={};var _0xe761b4={};var _0x6b7fd7;var _0x34f552;return db[_0x5471('0x45')][_0x5471('0x58')]({'where':{'id':_0x236c39['params']['id']}})[_0x5471('0x13')](handleEntityNotFound(_0x327edc,null))['then'](function(_0x5d5fb3){if(_0x5d5fb3){_0x6b7fd7=_0x5d5fb3;_0xe761b4['model']=_[_0x5471('0x35')](db[_0x5471('0xb1')][_0x5471('0x30')]);_0xe761b4[_0x5471('0x34')]=_[_0x5471('0x35')](_0x236c39['query']);_0xe761b4[_0x5471('0x36')]=_[_0x5471('0x37')](_0xe761b4[_0x5471('0x38')],_0xe761b4['query']);_0x135b97[_0x5471('0x39')]=_[_0x5471('0x37')](_0xe761b4['model'],qs[_0x5471('0x3a')](_0x236c39[_0x5471('0x34')][_0x5471('0x3a')]));_0x135b97[_0x5471('0x39')]=_0x135b97['attributes'][_0x5471('0x4a')]?_0x135b97[_0x5471('0x39')]:_0xe761b4['model'];_0x135b97[_0x5471('0x3d')]=qs['sort'](_0x236c39[_0x5471('0x34')][_0x5471('0x3e')]);_0x135b97[_0x5471('0x41')]=qs[_0x5471('0x36')](_[_0x5471('0x3f')](_0x236c39[_0x5471('0x34')],_0xe761b4['filters']));if(_0x236c39['query'][_0x5471('0x40')]){_0x135b97[_0x5471('0x41')]=_['merge'](_0x135b97[_0x5471('0x41')],{'$or':_[_0x5471('0x33')](_0x135b97[_0x5471('0x39')],function(_0x81ddb8){var _0x3dc003={};_0x3dc003[_0x81ddb8]={'$like':'%'+_0x236c39[_0x5471('0x34')][_0x5471('0x40')]+'%'};return _0x3dc003;})});}_0x135b97=_['merge']({},_0x135b97,_0x236c39[_0x5471('0x43')]);return _0x6b7fd7[_0x5471('0x11d')](_0x135b97);}})[_0x5471('0x13')](function(_0x51f43a){if(_0x51f43a){_0x34f552=_0x51f43a[_0x5471('0x4a')];if(!_0x236c39['query'][_0x5471('0x3b')](_0x5471('0x3c'))){_0x135b97[_0x5471('0x24')]=qs[_0x5471('0x24')](_0x236c39[_0x5471('0x34')][_0x5471('0x24')]);_0x135b97[_0x5471('0x21')]=qs[_0x5471('0x21')](_0x236c39['query'][_0x5471('0x21')]);}return _0x6b7fd7[_0x5471('0x11d')](_0x135b97);}})[_0x5471('0x13')](function(_0x2e1a7b){if(_0x2e1a7b){return _0x2e1a7b?{'count':_0x34f552,'rows':_0x2e1a7b}:null;}})[_0x5471('0x13')](respondWithResult(_0x327edc,null))[_0x5471('0x1d')](handleError(_0x327edc,null));};
\ No newline at end of file
index 43e114b..740c147 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe953=['hook','exports','update','remove','emit','hasOwnProperty'];(function(_0x165557,_0x5686a8){var _0x45d631=function(_0x15e182){while(--_0x15e182){_0x165557['push'](_0x165557['shift']());}};_0x45d631(++_0x5686a8);}(_0xe953,0x1d0));var _0x3e95=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe953[_0x2064e5];return _0x21a233;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3e95('0x0'),'afterDestroy':_0x3e95('0x1')};function emitEvent(_0x49d837){return function(_0x46f343,_0x5a0541,_0x12b498){ChatWebsiteEvents['emit'](_0x49d837+':'+_0x46f343['id'],_0x46f343);ChatWebsiteEvents[_0x3e95('0x2')](_0x49d837,_0x46f343);_0x12b498(null);};}for(var e in events){if(events[_0x3e95('0x3')](e)){var event=events[e];ChatWebsite[_0x3e95('0x4')](e,emitEvent(event));}}module[_0x3e95('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc818=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit'];(function(_0x5927a9,_0x3e13bb){var _0x44862d=function(_0x468a50){while(--_0x468a50){_0x5927a9['push'](_0x5927a9['shift']());}};_0x44862d(++_0x3e13bb);}(_0xc818,0x1e3));var _0x8c81=function(_0x2fbd34,_0x108a7d){_0x2fbd34=_0x2fbd34-0x0;var _0x5e7664=_0xc818[_0x2fbd34];return _0x5e7664;};'use strict';var EventEmitter=require(_0x8c81('0x0'));var ChatWebsite=require(_0x8c81('0x1'))['db'][_0x8c81('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8c81('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8c81('0x4'),'afterDestroy':_0x8c81('0x5')};function emitEvent(_0x40b19e){return function(_0x7e329f,_0x1a61ab,_0xb97ac){ChatWebsiteEvents[_0x8c81('0x6')](_0x40b19e+':'+_0x7e329f['id'],_0x7e329f);ChatWebsiteEvents['emit'](_0x40b19e,_0x7e329f);_0xb97ac(null);};}for(var e in events){if(events[_0x8c81('0x7')](e)){var event=events[e];ChatWebsite[_0x8c81('0x8')](e,emitEvent(event));}}module[_0x8c81('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
index 4e35453..92e2bf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fa7=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash'];(function(_0x51909b,_0x1f65b2){var _0x4905eb=function(_0x37f8e4){while(--_0x37f8e4){_0x51909b['push'](_0x51909b['shift']());}};_0x4905eb(++_0x1f65b2);}(_0x9fa7,0x11f));var _0x79fa=function(_0x2b94c8,_0x1d545b){_0x2b94c8=_0x2b94c8-0x0;var _0x468fb9=_0x9fa7[_0x2b94c8];return _0x468fb9;};'use strict';var _=require(_0x79fa('0x0'));var util=require(_0x79fa('0x1'));var logger=require(_0x79fa('0x2'))(_0x79fa('0x3'));var moment=require(_0x79fa('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x79fa('0x5'));var rimraf=require(_0x79fa('0x6'));var config=require(_0x79fa('0x7'));var attributes=require(_0x79fa('0x8'));module[_0x79fa('0x9')]=function(_0x1181d9,_0x4b264e){return _0x1181d9[_0x79fa('0xa')]('ChatWebsite',attributes,{'tableName':_0x79fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7e0=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','moment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd7e0,0xb7));var _0x0d7e=function(_0xac3a5b,_0x59b23a){_0xac3a5b=_0xac3a5b-0x0;var _0x5c0184=_0xd7e0[_0xac3a5b];return _0x5c0184;};'use strict';var _=require(_0x0d7e('0x0'));var util=require(_0x0d7e('0x1'));var logger=require(_0x0d7e('0x2'))('api');var moment=require(_0x0d7e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d7e('0x4'));var rimraf=require(_0x0d7e('0x5'));var config=require(_0x0d7e('0x6'));var attributes=require(_0x0d7e('0x7'));module[_0x0d7e('0x8')]=function(_0x39ac6b,_0x2536d1){return _0x39ac6b[_0x0d7e('0x9')](_0x0d7e('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df54e7a..f73f51f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa40a=['../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa40a,0x180));var _0xaa40=function(_0x364fd5,_0x3853b1){_0x364fd5=_0x364fd5-0x0;var _0x4f8f43=_0xa40a[_0x364fd5];return _0x4f8f43;};'use strict';var _=require(_0xaa40('0x0'));var util=require(_0xaa40('0x1'));var moment=require(_0xaa40('0x2'));var BPromise=require(_0xaa40('0x3'));var rs=require(_0xaa40('0x4'));var fs=require('fs');var Redis=require(_0xaa40('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa40('0x6'));var logger=require(_0xaa40('0x7'))(_0xaa40('0x8'));var config=require(_0xaa40('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xaa40('0xa')](config[_0xaa40('0xb')],{'host':_0xaa40('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa40('0xb')]));require(_0xaa40('0xd'))[_0xaa40('0xe')](socket);function respondWithRpcPromise(_0x2cd0b2,_0x1890ce,_0x2fd59a){return new BPromise(function(_0x17b911,_0x35e18f){return client[_0xaa40('0xf')](_0x2cd0b2,_0x2fd59a)['then'](function(_0x506ab7){logger[_0xaa40('0x10')](_0xaa40('0x11'),_0x1890ce,_0xaa40('0x12'));logger[_0xaa40('0x13')](_0xaa40('0x14'),_0x1890ce,_0xaa40('0x12'),JSON['stringify'](_0x506ab7));if(_0x506ab7[_0xaa40('0x15')]){if(_0x506ab7[_0xaa40('0x15')][_0xaa40('0x16')]===0x1f4){logger[_0xaa40('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1890ce,_0x506ab7[_0xaa40('0x15')]['message']);return _0x35e18f(_0x506ab7[_0xaa40('0x15')][_0xaa40('0x17')]);}logger[_0xaa40('0x15')](_0xaa40('0x11'),_0x1890ce,_0x506ab7[_0xaa40('0x15')][_0xaa40('0x17')]);return _0x17b911(_0x506ab7[_0xaa40('0x15')][_0xaa40('0x17')]);}else{logger[_0xaa40('0x10')](_0xaa40('0x11'),_0x1890ce,'request\x20sent');_0x17b911(_0x506ab7[_0xaa40('0x18')][_0xaa40('0x17')]);}})[_0xaa40('0x19')](function(_0x1ef59b){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1890ce,_0x1ef59b);_0x35e18f(_0x1ef59b);});});}
\ No newline at end of file
+var _0x4fc6=['message','catch','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error'];(function(_0x566106,_0x2b2ab7){var _0x27d883=function(_0x1e19c4){while(--_0x1e19c4){_0x566106['push'](_0x566106['shift']());}};_0x27d883(++_0x2b2ab7);}(_0x4fc6,0x189));var _0x64fc=function(_0x239caa,_0x3801aa){_0x239caa=_0x239caa-0x0;var _0xf9fab1=_0x4fc6[_0x239caa];return _0xf9fab1;};'use strict';var _=require(_0x64fc('0x0'));var util=require(_0x64fc('0x1'));var moment=require('moment');var BPromise=require(_0x64fc('0x2'));var rs=require(_0x64fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64fc('0x4'))(_0x64fc('0x5'));var config=require(_0x64fc('0x6'));var jayson=require(_0x64fc('0x7'));var client=jayson[_0x64fc('0x8')][_0x64fc('0x9')]({'port':0x232a});config[_0x64fc('0xa')]=_[_0x64fc('0xb')](config[_0x64fc('0xa')],{'host':_0x64fc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64fc('0xa')]));require(_0x64fc('0xd'))[_0x64fc('0xe')](socket);function respondWithRpcPromise(_0x20a44b,_0x1e2d78,_0x18e0b2){return new BPromise(function(_0xf81d93,_0x3af7aa){return client[_0x64fc('0xf')](_0x20a44b,_0x18e0b2)[_0x64fc('0x10')](function(_0x89df3f){logger[_0x64fc('0x11')](_0x64fc('0x12'),_0x1e2d78,_0x64fc('0x13'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1e2d78,'request\x20sent',JSON['stringify'](_0x89df3f));if(_0x89df3f[_0x64fc('0x14')]){if(_0x89df3f[_0x64fc('0x14')]['code']===0x1f4){logger[_0x64fc('0x14')](_0x64fc('0x12'),_0x1e2d78,_0x89df3f[_0x64fc('0x14')][_0x64fc('0x15')]);return _0x3af7aa(_0x89df3f[_0x64fc('0x14')][_0x64fc('0x15')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1e2d78,_0x89df3f['error'][_0x64fc('0x15')]);return _0xf81d93(_0x89df3f[_0x64fc('0x14')][_0x64fc('0x15')]);}else{logger[_0x64fc('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x1e2d78,_0x64fc('0x13'));_0xf81d93(_0x89df3f['result'][_0x64fc('0x15')]);}})[_0x64fc('0x16')](function(_0x10ad8c){logger[_0x64fc('0x14')](_0x64fc('0x12'),_0x1e2d78,_0x10ad8c);_0x3af7aa(_0x10ad8c);});});}
\ No newline at end of file
index b0f1a03..e285f4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e72=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x8e72,0x1e5));var _0x28e7=function(_0x21bc86,_0x4d0a69){_0x21bc86=_0x21bc86-0x0;var _0x47c2d4=_0x8e72[_0x21bc86];return _0x47c2d4;};'use strict';var ChatWebsiteEvents=require(_0x28e7('0x0'));var events=[_0x28e7('0x1'),_0x28e7('0x2'),_0x28e7('0x3')];function createListener(_0x24f5a3,_0x1837a4){return function(_0x48f38a){_0x1837a4[_0x28e7('0x4')](_0x24f5a3,_0x48f38a);};}function removeListener(_0xc43eb5,_0x2d5f76){return function(){ChatWebsiteEvents[_0x28e7('0x5')](_0xc43eb5,_0x2d5f76);};}exports[_0x28e7('0x6')]=function(_0x41f1d0){for(var _0x1d96ed=0x0,_0x5e9d5b=events[_0x28e7('0x7')];_0x1d96ed<_0x5e9d5b;_0x1d96ed++){var _0x369b97=events[_0x1d96ed];var _0x5a0617=createListener(_0x28e7('0x8')+_0x369b97,_0x41f1d0);ChatWebsiteEvents['on'](_0x369b97,_0x5a0617);}};
\ No newline at end of file
+var _0x61f0=['register','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener'];(function(_0x38f1fa,_0x4115f1){var _0x5c4561=function(_0x25853a){while(--_0x25853a){_0x38f1fa['push'](_0x38f1fa['shift']());}};_0x5c4561(++_0x4115f1);}(_0x61f0,0x64));var _0x061f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x61f0[_0x3bf83f];return _0x22c4a9;};'use strict';var ChatWebsiteEvents=require(_0x061f('0x0'));var events=[_0x061f('0x1'),'remove',_0x061f('0x2')];function createListener(_0x15f6f8,_0x4c3780){return function(_0x2fb43f){_0x4c3780[_0x061f('0x3')](_0x15f6f8,_0x2fb43f);};}function removeListener(_0x238db9,_0x56683b){return function(){ChatWebsiteEvents[_0x061f('0x4')](_0x238db9,_0x56683b);};}exports[_0x061f('0x5')]=function(_0x17cb85){for(var _0x54e605=0x0,_0x3cb623=events['length'];_0x54e605<_0x3cb623;_0x54e605++){var _0x4ac53b=events[_0x54e605];var _0x4ccbba=createListener(_0x061f('0x6')+_0x4ac53b,_0x17cb85);ChatWebsiteEvents['on'](_0x4ac53b,_0x4ccbba);}};
\ No newline at end of file
index 22a0202..19e1881 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x230d=['root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','file','addAvatar','server/files/images/avatars/','now','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','replace','/:id/offline','offline','addInteraction','addProactiveActions','put','update','delete','destroy','removeAnswers','removeAgents','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x230d,0xa6));var _0xd230=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x230d[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd230('0x0'));var express=require(_0xd230('0x1'));var router=express['Router']();var fs_extra=require(_0xd230('0x2'));var auth=require(_0xd230('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd230('0x4'));var controller=require(_0xd230('0x5'));router[_0xd230('0x6')]('/',auth[_0xd230('0x7')](),controller[_0xd230('0x8')]);router[_0xd230('0x6')](_0xd230('0x9'),auth[_0xd230('0x7')](),controller[_0xd230('0xa')]);router['get'](_0xd230('0xb'),auth[_0xd230('0x7')](),controller[_0xd230('0xc')]);router['get'](_0xd230('0xd'),auth['isAuthenticated'](),controller[_0xd230('0xe')]);router['get'](_0xd230('0xf'),auth[_0xd230('0x7')](),controller[_0xd230('0x10')]);router[_0xd230('0x6')]('/:id/logo',controller[_0xd230('0x11')]);router[_0xd230('0x6')](_0xd230('0x12'),controller[_0xd230('0x13')]);router[_0xd230('0x6')](_0xd230('0x14'),controller[_0xd230('0x15')]);router[_0xd230('0x6')](_0xd230('0x16'),controller[_0xd230('0x17')]);router[_0xd230('0x6')](_0xd230('0x18'),auth[_0xd230('0x7')](),controller[_0xd230('0x19')]);router[_0xd230('0x6')](_0xd230('0x1a'),controller[_0xd230('0x1b')]);router[_0xd230('0x6')](_0xd230('0x1c'),auth['isAuthenticated'](),controller[_0xd230('0x1d')]);router['get'](_0xd230('0x1e'),auth[_0xd230('0x7')](),controller[_0xd230('0x1f')]);router['get'](_0xd230('0x20'),controller['getFields']);router[_0xd230('0x6')]('/:id/offline_messages',auth[_0xd230('0x7')](),controller[_0xd230('0x21')]);router['get'](_0xd230('0x22'),auth['isAuthenticated'](),controller['getAgents']);router[_0xd230('0x23')]('/',auth[_0xd230('0x7')](),controller[_0xd230('0x24')]);router[_0xd230('0x23')](_0xd230('0xd'),auth[_0xd230('0x7')](),controller[_0xd230('0x25')]);router['post'](_0xd230('0xf'),auth[_0xd230('0x7')](),controller[_0xd230('0x26')]);var upload=multer({'storage':multer[_0xd230('0x27')]({'destination':function(_0x433ec2,_0x4a3a81,_0x152520){_0x152520(null,path[_0xd230('0x28')](config[_0xd230('0x29')],_0xd230('0x2a')));},'filename':function(_0x1650bd,_0x1a0aa9,_0xf2e737){_0xf2e737(null,util[_0xd230('0x2b')](_0xd230('0x2c'),Date['now'](),_0x1a0aa9[_0xd230('0x2d')]));}})});router['post'](_0xd230('0x2e'),upload[_0xd230('0x2f')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xd230('0x27')]({'destination':function(_0x23219d,_0x8d0cff,_0x53499b){_0x53499b(null,path[_0xd230('0x28')](config[_0xd230('0x29')],'server/files/images/avatars/'));},'filename':function(_0x3fbe1f,_0x12dc2a,_0x518969){_0x518969(null,util[_0xd230('0x2b')](_0xd230('0x2c'),Date['now'](),_0x12dc2a['originalname']));}})});router[_0xd230('0x23')](_0xd230('0x12'),upload[_0xd230('0x2f')](_0xd230('0x30')),controller[_0xd230('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x592548,_0x21a7ce,_0x3c7e32){_0x3c7e32(null,path[_0xd230('0x28')](config['root'],_0xd230('0x32')));},'filename':function(_0x2cd4ca,_0x3d7dd7,_0x5da131){_0x5da131(null,util['format']('%s-%s',Date[_0xd230('0x33')](),_0x3d7dd7[_0xd230('0x2d')]));}})});router[_0xd230('0x23')](_0xd230('0x14'),upload[_0xd230('0x2f')](_0xd230('0x30')),controller[_0xd230('0x34')]);var upload=multer({'storage':multer[_0xd230('0x27')]({'destination':function(_0x1d4896,_0x22a593,_0x290ff7){_0x290ff7(null,path['join'](config[_0xd230('0x29')],_0xd230('0x32')));},'filename':function(_0x9dd883,_0x2ebdcb,_0x6421cb){_0x6421cb(null,util[_0xd230('0x2b')]('%s-%s',Date[_0xd230('0x33')](),_0x2ebdcb['originalname']));}})});router['post'](_0xd230('0x16'),upload[_0xd230('0x2f')](_0xd230('0x30')),controller['addSystemAvatar']);router[_0xd230('0x23')](_0xd230('0x35'),controller[_0xd230('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xd230('0x27')]({'destination':function(_0x567fa9,_0x54cc36,_0xf08c50){const _0x57b3c2=path['join'](config[_0xd230('0x29')],_0xd230('0x37'),'attachments',_0xd230('0x38'));fs_extra['ensureDir'](_0x57b3c2,function(){_0xf08c50(null,_0x57b3c2);});},'filename':function(_0x340599,_0x28f38e,_0x494b18){const _0x477931=_0x28f38e[_0xd230('0x2d')][_0xd230('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x592f89=path['extname'](_0x477931);const _0x21580d=Date[_0xd230('0x33')]()+'-'+_0x477931[_0xd230('0x39')](_0x592f89,'')+_0x592f89;_0x494b18(null,_0x21580d);}})});router[_0xd230('0x23')](_0xd230('0x3a'),offlineUploadMulter['any'](),controller[_0xd230('0x3b')]);router[_0xd230('0x23')](_0xd230('0x18'),auth[_0xd230('0x7')](),controller[_0xd230('0x3c')]);router[_0xd230('0x23')](_0xd230('0x1c'),auth[_0xd230('0x7')](),controller['addApplications']);router[_0xd230('0x23')](_0xd230('0x1e'),auth[_0xd230('0x7')](),controller[_0xd230('0x3d')]);router[_0xd230('0x23')](_0xd230('0x22'),auth[_0xd230('0x7')](),controller['addAgents']);router[_0xd230('0x3e')](_0xd230('0xb'),auth['isAuthenticated'](),controller[_0xd230('0x3f')]);router[_0xd230('0x40')]('/:id',auth[_0xd230('0x7')](),controller[_0xd230('0x41')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xd230('0x40')](_0xd230('0xf'),auth[_0xd230('0x7')](),controller[_0xd230('0x42')]);router['delete'](_0xd230('0x22'),auth[_0xd230('0x7')](),controller[_0xd230('0x43')]);module[_0xd230('0x44')]=router;
\ No newline at end of file
+var _0x564d=['getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addAnswer','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','/:id/avatar','addAvatar','addCustomerAvatar','now','/:id/notify','notify','diskStorage','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo'];(function(_0x286078,_0x5c1014){var _0x1eba3f=function(_0x1fbbef){while(--_0x1fbbef){_0x286078['push'](_0x286078['shift']());}};_0x1eba3f(++_0x5c1014);}(_0x564d,0x110));var _0xd564=function(_0x15765d,_0x1c7082){_0x15765d=_0x15765d-0x0;var _0x17ce8b=_0x564d[_0x15765d];return _0x17ce8b;};'use strict';var multer=require(_0xd564('0x0'));var util=require('util');var path=require(_0xd564('0x1'));var timeout=require(_0xd564('0x2'));var express=require(_0xd564('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd564('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd564('0x5'));var controller=require(_0xd564('0x6'));router['get']('/',auth[_0xd564('0x7')](),controller[_0xd564('0x8')]);router['get']('/describe',auth[_0xd564('0x7')](),controller['describe']);router[_0xd564('0x9')](_0xd564('0xa'),auth[_0xd564('0x7')](),controller[_0xd564('0xb')]);router[_0xd564('0x9')](_0xd564('0xc'),auth[_0xd564('0x7')](),controller[_0xd564('0xd')]);router[_0xd564('0x9')](_0xd564('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xd564('0xf'),controller[_0xd564('0x10')]);router[_0xd564('0x9')]('/:id/avatar',controller['getAvatar']);router[_0xd564('0x9')](_0xd564('0x11'),controller[_0xd564('0x12')]);router['get'](_0xd564('0x13'),controller[_0xd564('0x14')]);router[_0xd564('0x9')](_0xd564('0x15'),auth[_0xd564('0x7')](),controller[_0xd564('0x16')]);router[_0xd564('0x9')](_0xd564('0x17'),controller[_0xd564('0x18')]);router[_0xd564('0x9')](_0xd564('0x19'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0xd564('0x1a'),auth[_0xd564('0x7')](),controller[_0xd564('0x1b')]);router[_0xd564('0x9')](_0xd564('0x1c'),controller[_0xd564('0x1d')]);router['get'](_0xd564('0x1e'),auth['isAuthenticated'](),controller[_0xd564('0x1f')]);router[_0xd564('0x9')]('/:id/users',auth[_0xd564('0x7')](),controller[_0xd564('0x20')]);router[_0xd564('0x21')]('/',auth[_0xd564('0x7')](),controller[_0xd564('0x22')]);router[_0xd564('0x21')](_0xd564('0xc'),auth['isAuthenticated'](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0xd564('0x7')](),controller[_0xd564('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2786cc,_0x242979,_0x1e9538){_0x1e9538(null,path[_0xd564('0x24')](config[_0xd564('0x25')],_0xd564('0x26')));},'filename':function(_0x2559ca,_0x4e3072,_0xcf5e90){_0xcf5e90(null,util[_0xd564('0x27')](_0xd564('0x28'),Date['now'](),_0x4e3072[_0xd564('0x29')]));}})});router['post'](_0xd564('0xf'),upload[_0xd564('0x2a')](_0xd564('0x2b')),controller[_0xd564('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3074f5,_0x17aa96,_0x27fb6a){_0x27fb6a(null,path[_0xd564('0x24')](config[_0xd564('0x25')],_0xd564('0x2d')));},'filename':function(_0x1ede43,_0x272af0,_0x2b5a1d){_0x2b5a1d(null,util[_0xd564('0x27')](_0xd564('0x28'),Date['now'](),_0x272af0[_0xd564('0x29')]));}})});router['post'](_0xd564('0x2e'),upload['single'](_0xd564('0x2b')),controller[_0xd564('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34645a,_0xaf27d3,_0x1dbeab){_0x1dbeab(null,path[_0xd564('0x24')](config[_0xd564('0x25')],'server/files/images/avatars/'));},'filename':function(_0x42d9c4,_0x4fc1e3,_0x53b4eb){_0x53b4eb(null,util['format'](_0xd564('0x28'),Date['now'](),_0x4fc1e3[_0xd564('0x29')]));}})});router[_0xd564('0x21')](_0xd564('0x11'),upload['single'](_0xd564('0x2b')),controller[_0xd564('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b881c,_0x415221,_0x12d746){_0x12d746(null,path[_0xd564('0x24')](config['root'],_0xd564('0x2d')));},'filename':function(_0x4c7488,_0x5176c3,_0x24cad6){_0x24cad6(null,util[_0xd564('0x27')]('%s-%s',Date[_0xd564('0x31')](),_0x5176c3[_0xd564('0x29')]));}})});router[_0xd564('0x21')](_0xd564('0x13'),upload[_0xd564('0x2a')]('file'),controller['addSystemAvatar']);router[_0xd564('0x21')](_0xd564('0x32'),controller[_0xd564('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xd564('0x34')]({'destination':function(_0x6bc103,_0x572354,_0x23a8be){const _0x1f5927=path[_0xd564('0x24')](config[_0xd564('0x25')],_0xd564('0x35'),_0xd564('0x36'),_0xd564('0x37'));fs_extra['ensureDir'](_0x1f5927,function(){_0x23a8be(null,_0x1f5927);});},'filename':function(_0x82f551,_0xa339a2,_0x59f427){const _0x196904=_0xa339a2[_0xd564('0x29')][_0xd564('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x442e6d=path[_0xd564('0x39')](_0x196904);const _0x2629b5=Date[_0xd564('0x31')]()+'-'+_0x196904[_0xd564('0x38')](_0x442e6d,'')+_0x442e6d;_0x59f427(null,_0x2629b5);}})});router[_0xd564('0x21')](_0xd564('0x3a'),offlineUploadMulter[_0xd564('0x3b')](),controller[_0xd564('0x3c')]);router[_0xd564('0x21')](_0xd564('0x15'),auth[_0xd564('0x7')](),controller[_0xd564('0x3d')]);router[_0xd564('0x21')](_0xd564('0x19'),auth['isAuthenticated'](),controller[_0xd564('0x3e')]);router[_0xd564('0x21')](_0xd564('0x1a'),auth[_0xd564('0x7')](),controller[_0xd564('0x3f')]);router['post'](_0xd564('0x40'),auth[_0xd564('0x7')](),controller['addAgents']);router['put'](_0xd564('0xa'),auth[_0xd564('0x7')](),controller[_0xd564('0x41')]);router['delete'](_0xd564('0xa'),auth['isAuthenticated'](),controller[_0xd564('0x42')]);router[_0xd564('0x43')](_0xd564('0xc'),auth[_0xd564('0x7')](),controller[_0xd564('0x44')]);router['delete'](_0xd564('0xe'),auth[_0xd564('0x7')](),controller[_0xd564('0x45')]);router[_0xd564('0x43')](_0xd564('0x40'),auth[_0xd564('0x7')](),controller[_0xd564('0x46')]);module[_0xd564('0x47')]=router;
\ No newline at end of file
index 9d46459..53daf31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfe4=['../components/auth/service','../config/environment','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports'];(function(_0x3a4bf3,_0x141540){var _0x29e014=function(_0x236775){while(--_0x236775){_0x3a4bf3['push'](_0x3a4bf3['shift']());}};_0x29e014(++_0x141540);}(_0xdfe4,0x136));var _0x4dfe=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xdfe4[_0x5783f4];return _0x28e380;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x4dfe('0x0'));var config=require(_0x4dfe('0x1'));var router=express['Router']();var isProduction=config['env']===_0x4dfe('0x2')||![];function clientSideLogs(_0x49793b,_0x38c4c6,_0x24c3a9){var _0x313dd6=_0x49793b['app'][_0x4dfe('0x3')](_0x4dfe('0x4'));if(!_0x313dd6){throw new Error(_0x4dfe('0x5'));}return beaverLogger[_0x4dfe('0x6')]({'uri':'/client-logs','logger':_0x313dd6,'enableCors':!isProduction})(_0x49793b,_0x38c4c6,_0x24c3a9);}router[_0x4dfe('0x7')](auth[_0x4dfe('0x8')](),clientSideLogs);module[_0x4dfe('0x9')]=router;
\ No newline at end of file
+var _0x5c8d=['app','get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','Router','env'];(function(_0x2e7c3b,_0x486011){var _0x32918f=function(_0x4aee05){while(--_0x4aee05){_0x2e7c3b['push'](_0x2e7c3b['shift']());}};_0x32918f(++_0x486011);}(_0x5c8d,0xd8));var _0xd5c8=function(_0x54d987,_0x492c15){_0x54d987=_0x54d987-0x0;var _0x25a405=_0x5c8d[_0x54d987];return _0x25a405;};var beaverLogger=require(_0xd5c8('0x0'));var express=require(_0xd5c8('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0xd5c8('0x2')]();var isProduction=config[_0xd5c8('0x3')]==='production'||![];function clientSideLogs(_0x2b87fd,_0x1dc1e6,_0x3c683){var _0x138b39=_0x2b87fd[_0xd5c8('0x4')][_0xd5c8('0x5')](_0xd5c8('0x6'));if(!_0x138b39){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xd5c8('0x7')]({'uri':'/client-logs','logger':_0x138b39,'enableCors':!isProduction})(_0x2b87fd,_0x1dc1e6,_0x3c683);}router[_0xd5c8('0x8')](auth[_0xd5c8('0x9')](),clientSideLogs);module[_0xd5c8('0xa')]=router;
\ No newline at end of file
index ab10117..0721c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72d9=['MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','exports','STRING','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x2be944,_0x3860ce){var _0x133dc8=function(_0x131921){while(--_0x131921){_0x2be944['push'](_0x2be944['shift']());}};_0x133dc8(++_0x3860ce);}(_0x72d9,0x1c5));var _0x972d=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x72d9[_0x725b8e];return _0x43ac45;};'use strict';var Sequelize=require('sequelize');module[_0x972d('0x0')]={'name':{'type':Sequelize[_0x972d('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x972d('0x2'),_0x972d('0x3'),_0x972d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x972d('0x5'),_0x972d('0x6'))},'data1':{'type':Sequelize[_0x972d('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x972d('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x972d('0x1')],'comment':_0x972d('0x7')},'data4':{'type':Sequelize[_0x972d('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x972d('0x8')],'comment':_0x972d('0x9')},'data6':{'type':Sequelize[_0x972d('0x8')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x52b3=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x52b3,0x1c0));var _0x352b=function(_0x3d8221,_0x50a3f3){_0x3d8221=_0x3d8221-0x0;var _0x13c6d1=_0x52b3[_0x3d8221];return _0x13c6d1;};'use strict';var Sequelize=require(_0x352b('0x0'));module['exports']={'name':{'type':Sequelize[_0x352b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x352b('0x2'),_0x352b('0x3'),_0x352b('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x352b('0x5'))},'data1':{'type':Sequelize[_0x352b('0x1')],'comment':_0x352b('0x6')},'data2':{'type':Sequelize[_0x352b('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x352b('0x1')],'comment':_0x352b('0x7')},'data4':{'type':Sequelize[_0x352b('0x1')],'comment':_0x352b('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x352b('0x9')],'comment':_0x352b('0xa')},'data7':{'type':Sequelize[_0x352b('0x9')],'comment':_0x352b('0xb')}};
\ No newline at end of file
index 9b0346e..a9aff30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe655=['decryptString','data3','catch','length','includeAll','options','find','create','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','id_token','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','name','send','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','include','service','MicrosoftAzure'];(function(_0x938d88,_0x56ed77){var _0x15b05f=function(_0x1cc106){while(--_0x1cc106){_0x938d88['push'](_0x938d88['shift']());}};_0x15b05f(++_0x56ed77);}(_0xe655,0xda));var _0x5e65=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe655[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x5e65('0x0'));var Redis=require(_0x5e65('0x1'));var qs=require(_0x5e65('0x2'));var encryptor=require(_0x5e65('0x3'));var config=require(_0x5e65('0x4'));var logger=require(_0x5e65('0x5'))(_0x5e65('0x6'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0x5e65('0x7')]=_[_0x5e65('0x8')](config[_0x5e65('0x7')],{'host':_0x5e65('0x9'),'port':0x18eb});var socket=require(_0x5e65('0xa'))(new Redis(config[_0x5e65('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x486266,_0x354cb5){_0x354cb5=_0x354cb5||0xcc;return function(_0xe54e96){if(_0xe54e96){return _0x486266[_0x5e65('0xb')](_0x354cb5);}return _0x486266[_0x5e65('0xc')](_0x354cb5)[_0x5e65('0xd')]();};}function respondWithResult(_0x501fef,_0x5ba9f3){_0x5ba9f3=_0x5ba9f3||0xc8;return function(_0x2dd98b){if(_0x2dd98b){return _0x501fef[_0x5e65('0xc')](_0x5ba9f3)[_0x5e65('0xe')](_0x2dd98b);}};}function respondWithFilteredResult(_0x5a4bb8,_0x400f0d){return function(_0x36ce90){if(_0x36ce90){var _0x483484=typeof _0x400f0d[_0x5e65('0xf')]===_0x5e65('0x10')&&typeof _0x400f0d[_0x5e65('0x11')]==='undefined';var _0x32e1e1=_0x36ce90[_0x5e65('0x12')];var _0x30f1d9=_0x483484?0x0:_0x400f0d['offset'];var _0x4406c8=_0x483484?_0x36ce90[_0x5e65('0x12')]:_0x400f0d['offset']+_0x400f0d['limit'];var _0x4b7caf;if(_0x4406c8>=_0x32e1e1){_0x4406c8=_0x32e1e1;_0x4b7caf=0xc8;}else{_0x4b7caf=0xce;}_0x5a4bb8[_0x5e65('0xc')](_0x4b7caf);return _0x5a4bb8[_0x5e65('0x13')](_0x5e65('0x14'),_0x30f1d9+'-'+_0x4406c8+'/'+_0x32e1e1)[_0x5e65('0xe')](_0x36ce90);}return null;};}function saveUpdates(_0xf5a43b){return function(_0x55ee93){if(_0x55ee93){return _0x55ee93['update'](_0xf5a43b)[_0x5e65('0x15')](function(_0x13e4b1){return _0x13e4b1;});}return null;};}function removeEntity(_0x528562){return function(_0x3f35e1){if(_0x3f35e1){return _0x3f35e1[_0x5e65('0x16')]()[_0x5e65('0x15')](function(){_0x528562[_0x5e65('0xc')](0xcc)[_0x5e65('0xd')]();});}};}function handleEntityNotFound(_0xf02be0){return function(_0x202808){if(!_0x202808){_0xf02be0['sendStatus'](0x194);}return _0x202808;};}function handleError(_0x5c928d,_0x1fd6c2){_0x1fd6c2=_0x1fd6c2||0x1f4;return function(_0xb5ee65){logger[_0x5e65('0x17')](_0xb5ee65['stack']);if(_0xb5ee65[_0x5e65('0x18')]){delete _0xb5ee65[_0x5e65('0x18')];}_0x5c928d[_0x5e65('0xc')](_0x1fd6c2)[_0x5e65('0x19')](_0xb5ee65);};}function maskClientSecret(_0x4e1105){return _['padEnd'](_0x4e1105[_0x5e65('0x1a')](0x0,0x3),0x14,'*');}exports[_0x5e65('0x1b')]=function(_0x1acfdd,_0x531872){var _0x3e87d6={},_0x1e86f7={},_0x26ca6b={'count':0x0,'rows':[]};var _0x1c2cbd=_[_0x5e65('0x1c')](db[_0x5e65('0x1d')][_0x5e65('0x1e')],function(_0x4bba10){return{'name':_0x4bba10[_0x5e65('0x1f')],'type':_0x4bba10[_0x5e65('0x20')][_0x5e65('0x21')]};});_0x1e86f7[_0x5e65('0x22')]=_[_0x5e65('0x1c')](_0x1c2cbd,_0x5e65('0x18'));_0x1e86f7['query']=_[_0x5e65('0x23')](_0x1acfdd[_0x5e65('0x24')]);_0x1e86f7[_0x5e65('0x25')]=_[_0x5e65('0x26')](_0x1e86f7['model'],_0x1e86f7[_0x5e65('0x24')]);_0x3e87d6[_0x5e65('0x27')]=_[_0x5e65('0x26')](_0x1e86f7[_0x5e65('0x22')],qs[_0x5e65('0x28')](_0x1acfdd[_0x5e65('0x24')][_0x5e65('0x28')]));_0x3e87d6[_0x5e65('0x27')]=_0x3e87d6[_0x5e65('0x27')]['length']?_0x3e87d6[_0x5e65('0x27')]:_0x1e86f7[_0x5e65('0x22')];if(!_0x1acfdd[_0x5e65('0x24')][_0x5e65('0x29')](_0x5e65('0x2a'))){_0x3e87d6[_0x5e65('0x11')]=qs[_0x5e65('0x11')](_0x1acfdd[_0x5e65('0x24')][_0x5e65('0x11')]);_0x3e87d6['offset']=qs[_0x5e65('0xf')](_0x1acfdd[_0x5e65('0x24')][_0x5e65('0xf')]);}_0x3e87d6[_0x5e65('0x2b')]=qs[_0x5e65('0x2c')](_0x1acfdd[_0x5e65('0x24')][_0x5e65('0x2c')]);_0x3e87d6[_0x5e65('0x2d')]=qs[_0x5e65('0x25')](_[_0x5e65('0x2e')](_0x1acfdd[_0x5e65('0x24')],_0x1e86f7[_0x5e65('0x25')]),_0x1c2cbd);if(_0x1acfdd[_0x5e65('0x24')]['filter']){_0x3e87d6[_0x5e65('0x2d')]=_[_0x5e65('0x2f')](_0x3e87d6['where'],{'$or':_[_0x5e65('0x1c')](_0x1c2cbd,function(_0x2a2a88){if(_0x2a2a88[_0x5e65('0x20')]!=='VIRTUAL'){var _0x3218d6={};_0x3218d6[_0x2a2a88[_0x5e65('0x18')]]={'$like':'%'+_0x1acfdd[_0x5e65('0x24')][_0x5e65('0x30')]+'%'};return _0x3218d6;}})});}_0x3e87d6=_[_0x5e65('0x2f')]({},_0x3e87d6,_0x1acfdd['options']);var _0x12692f={'where':_0x3e87d6[_0x5e65('0x2d')]};return db[_0x5e65('0x1d')][_0x5e65('0x12')](_0x12692f)[_0x5e65('0x15')](function(_0x5374bd){_0x26ca6b[_0x5e65('0x12')]=_0x5374bd;if(_0x1acfdd['query']['includeAll']){_0x3e87d6[_0x5e65('0x31')]=[{'all':!![]}];}return db[_0x5e65('0x1d')]['findAll'](_0x3e87d6);})[_0x5e65('0x15')](function(_0x3c0507){_0x26ca6b['rows']=_['map'](_0x3c0507,function(_0x34cbc3){if(_0x34cbc3[_0x5e65('0x32')]===_0x5e65('0x33')){var _0x2e84a7=encryptor[_0x5e65('0x34')](_0x34cbc3[_0x5e65('0x35')]);_0x34cbc3[_0x5e65('0x35')]=maskClientSecret(_0x2e84a7);}return _0x34cbc3;});return _0x26ca6b;})[_0x5e65('0x15')](respondWithFilteredResult(_0x531872,_0x3e87d6))[_0x5e65('0x36')](handleError(_0x531872,null));};exports['show']=function(_0xe393a4,_0x3eebce){var _0x2bcb3a={'raw':!![],'where':{'id':_0xe393a4['params']['id']}},_0x513a8a={};_0x513a8a[_0x5e65('0x22')]=_[_0x5e65('0x23')](db['CloudProvider'][_0x5e65('0x1e')]);_0x513a8a['query']=_[_0x5e65('0x23')](_0xe393a4[_0x5e65('0x24')]);_0x513a8a[_0x5e65('0x25')]=_[_0x5e65('0x26')](_0x513a8a[_0x5e65('0x22')],_0x513a8a[_0x5e65('0x24')]);_0x2bcb3a[_0x5e65('0x27')]=_[_0x5e65('0x26')](_0x513a8a['model'],qs[_0x5e65('0x28')](_0xe393a4['query'][_0x5e65('0x28')]));_0x2bcb3a[_0x5e65('0x27')]=_0x2bcb3a[_0x5e65('0x27')][_0x5e65('0x37')]?_0x2bcb3a['attributes']:_0x513a8a['model'];if(_0xe393a4[_0x5e65('0x24')][_0x5e65('0x38')]){_0x2bcb3a[_0x5e65('0x31')]=[{'all':!![]}];}_0x2bcb3a=_['merge']({},_0x2bcb3a,_0xe393a4[_0x5e65('0x39')]);return db[_0x5e65('0x1d')][_0x5e65('0x3a')](_0x2bcb3a)[_0x5e65('0x15')](handleEntityNotFound(_0x3eebce,null))[_0x5e65('0x15')](function(_0x434c17){if(_0x434c17[_0x5e65('0x32')]===_0x5e65('0x33')){var _0x1b6c3c=encryptor[_0x5e65('0x34')](_0x434c17[_0x5e65('0x35')]);_0x434c17[_0x5e65('0x35')]=maskClientSecret(_0x1b6c3c);}return _0x434c17;})[_0x5e65('0x15')](respondWithResult(_0x3eebce,null))['catch'](handleError(_0x3eebce,null));};exports[_0x5e65('0x3b')]=function(_0x4a3101,_0xaf4641){if(!_0x4a3101[_0x5e65('0x3c')][_0x5e65('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4a3101[_0x5e65('0x3c')][_0x5e65('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x348369=db[_0x5e65('0x1d')][_0x5e65('0x1e')][_0x5e65('0x32')][_0x5e65('0x3d')];if(!_0x348369[_0x5e65('0x3e')](_0x4a3101[_0x5e65('0x3c')][_0x5e65('0x32')]))throw new Error(_0x5e65('0x3f')+_0x348369[_0x5e65('0x40')](',\x20'));if(_0x4a3101[_0x5e65('0x3c')][_0x5e65('0x32')]===_0x5e65('0x33')&&_0x4a3101[_0x5e65('0x3c')][_0x5e65('0x35')]){_0x4a3101[_0x5e65('0x3c')][_0x5e65('0x35')]=encryptor[_0x5e65('0x41')](_0x4a3101[_0x5e65('0x3c')]['data3']);}return db[_0x5e65('0x1d')][_0x5e65('0x3b')](_0x4a3101['body'],{})['then'](respondWithResult(_0xaf4641,0xc9))[_0x5e65('0x36')](handleError(_0xaf4641,null));};exports[_0x5e65('0x42')]=function(_0x199757,_0x13cc30){if(_0x199757[_0x5e65('0x3c')]['id']){delete _0x199757[_0x5e65('0x3c')]['id'];}return db[_0x5e65('0x1d')][_0x5e65('0x3a')]({'where':{'id':_0x199757['params']['id']}})[_0x5e65('0x15')](handleEntityNotFound(_0x13cc30,null))[_0x5e65('0x15')](function(_0x5ada69){if(_0x5ada69[_0x5e65('0x32')]===_0x5e65('0x33')&&_0x199757['body'][_0x5e65('0x35')]){_0x199757['body'][_0x5e65('0x35')]=encryptor[_0x5e65('0x41')](_0x199757['body'][_0x5e65('0x35')]);}return _0x5ada69;})[_0x5e65('0x15')](saveUpdates(_0x199757[_0x5e65('0x3c')],null))['then'](respondWithResult(_0x13cc30,null))[_0x5e65('0x36')](handleError(_0x13cc30,null));};exports[_0x5e65('0x16')]=function(_0x56b621,_0x253afc){return db[_0x5e65('0x1d')]['find']({'where':{'id':_0x56b621[_0x5e65('0x43')]['id']}})[_0x5e65('0x15')](handleEntityNotFound(_0x253afc,null))[_0x5e65('0x15')](removeEntity(_0x253afc,null))[_0x5e65('0x36')](handleError(_0x253afc,null));};exports[_0x5e65('0x44')]=function(_0x591e1a,_0x324e9f){return db[_0x5e65('0x1d')][_0x5e65('0x45')]({'where':{'id':_0x591e1a['params']['id']},'raw':!![]})[_0x5e65('0x15')](function(_0x50ccb4){if(!_0x50ccb4)return _0x324e9f[_0x5e65('0xb')](0x194);return{'url':oauth[_0x5e65('0x46')](_0x50ccb4,_0x591e1a['user']['id'])};})[_0x5e65('0x15')](respondWithResult(_0x324e9f,null))['catch'](handleError(_0x324e9f,null));};exports['oauth2MicrosoftCallback']=function(_0x5ce96f,_0x198c58){var _0x34b0fa=_0x5ce96f['body'];var _0x3e05a9;var _0x4e7b37;if(_0x34b0fa['error'])throw _0x34b0fa;redis['get'](_0x34b0fa[_0x5e65('0x47')])[_0x5e65('0x15')](function(_0x4598fd){if(!_0x4598fd)throw new Error(_0x5e65('0x48'));_0x3e05a9=JSON[_0x5e65('0x49')](_0x4598fd);var _0x34ca92=Buffer['from'](_0x34b0fa['state'],_0x5e65('0x4a'))[_0x5e65('0x4b')](_0x5e65('0x4c'));_0x4e7b37=JSON['parse'](_0x34ca92);if(!oauth['isValidIdToken'](_0x34b0fa[_0x5e65('0x4d')],_0x3e05a9['oauth2Claims']))throw new Error(_0x5e65('0x4e'));redis[_0x5e65('0x4f')](_0x34b0fa[_0x5e65('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x34b0fa['code'],_0x3e05a9);})[_0x5e65('0x15')](function(_0x49424d){_0x3e05a9[_0x5e65('0x50')]=_0x49424d[_0x5e65('0x51')];_0x3e05a9[_0x5e65('0x52')]=_0x49424d[_0x5e65('0x53')];return db[_0x5e65('0x1d')][_0x5e65('0x42')]({'data5':_0x3e05a9['data5'],'data6':_0x3e05a9['data6']},{'where':{'id':_0x3e05a9['id']}});})[_0x5e65('0x15')](function(){oauth['startRefreshInterval'](_0x3e05a9);socket[_0x5e65('0x54')](_0x5e65('0x55'),{'id':_0x4e7b37['id']});return;})[_0x5e65('0x15')](respondWithStatusCode(_0x198c58,null))[_0x5e65('0x36')](function(_0x214888){if(_0x4e7b37){socket[_0x5e65('0x54')](_0x5e65('0x56'),{'id':_0x4e7b37['id']});}if(!_0x3e05a9){logger[_0x5e65('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x214888);return _0x198c58['status'](0x1f4)[_0x5e65('0x19')](_0x214888[_0x5e65('0x57')]);}logger[_0x5e65('0x17')](_0x5e65('0x58'),_0x3e05a9['id'],JSON[_0x5e65('0x59')](_0x214888));});};
\ No newline at end of file
+var _0x3714=['params','findOne','user','oauth2MicrosoftCallback','state','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','localhost','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','error','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','merge','options','includeAll','include','rows','MicrosoftAzure','decryptString','data3','catch','show','keys','length','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3714,0x122));var _0x4371=function(_0x1a5586,_0x3d0cdb){_0x1a5586=_0x1a5586-0x0;var _0x4ede1d=_0x3714[_0x1a5586];return _0x4ede1d;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x4371('0x0'));var encryptor=require(_0x4371('0x1'));var config=require(_0x4371('0x2'));var logger=require('../../config/logger')(_0x4371('0x3'));var db=require('../../mysqldb')['db'];var oauth=require(_0x4371('0x4'));config['redis']=_['defaults'](config[_0x4371('0x5')],{'host':_0x4371('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x233690,_0x13f5b3){_0x13f5b3=_0x13f5b3||0xcc;return function(_0x5004d1){if(_0x5004d1){return _0x233690[_0x4371('0x7')](_0x13f5b3);}return _0x233690[_0x4371('0x8')](_0x13f5b3)['end']();};}function respondWithResult(_0x3e6a8,_0x1eab3a){_0x1eab3a=_0x1eab3a||0xc8;return function(_0x89b7d9){if(_0x89b7d9){return _0x3e6a8[_0x4371('0x8')](_0x1eab3a)['json'](_0x89b7d9);}};}function respondWithFilteredResult(_0x2484ae,_0x25b22b){return function(_0x2689e1){if(_0x2689e1){var _0x5de1a2=typeof _0x25b22b['offset']===_0x4371('0x9')&&typeof _0x25b22b[_0x4371('0xa')]==='undefined';var _0x4215ac=_0x2689e1[_0x4371('0xb')];var _0x3abca6=_0x5de1a2?0x0:_0x25b22b['offset'];var _0x3d656c=_0x5de1a2?_0x2689e1[_0x4371('0xb')]:_0x25b22b[_0x4371('0xc')]+_0x25b22b[_0x4371('0xa')];var _0x4429fa;if(_0x3d656c>=_0x4215ac){_0x3d656c=_0x4215ac;_0x4429fa=0xc8;}else{_0x4429fa=0xce;}_0x2484ae[_0x4371('0x8')](_0x4429fa);return _0x2484ae[_0x4371('0xd')](_0x4371('0xe'),_0x3abca6+'-'+_0x3d656c+'/'+_0x4215ac)[_0x4371('0xf')](_0x2689e1);}return null;};}function saveUpdates(_0x5d5fcf){return function(_0x381c91){if(_0x381c91){return _0x381c91[_0x4371('0x10')](_0x5d5fcf)[_0x4371('0x11')](function(_0x2a1a8b){return _0x2a1a8b;});}return null;};}function removeEntity(_0x3b9011){return function(_0x5ef878){if(_0x5ef878){return _0x5ef878[_0x4371('0x12')]()[_0x4371('0x11')](function(){_0x3b9011[_0x4371('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x344c85){return function(_0xdea58e){if(!_0xdea58e){_0x344c85['sendStatus'](0x194);}return _0xdea58e;};}function handleError(_0x11e754,_0x3c66c1){_0x3c66c1=_0x3c66c1||0x1f4;return function(_0x750130){logger[_0x4371('0x13')](_0x750130[_0x4371('0x14')]);if(_0x750130[_0x4371('0x15')]){delete _0x750130[_0x4371('0x15')];}_0x11e754[_0x4371('0x8')](_0x3c66c1)[_0x4371('0x16')](_0x750130);};}function maskClientSecret(_0x164e5d){return _[_0x4371('0x17')](_0x164e5d['slice'](0x0,0x3),0x14,'*');}exports[_0x4371('0x18')]=function(_0x1c9d88,_0x577870){var _0x740217={},_0x5126da={},_0x461a4c={'count':0x0,'rows':[]};var _0x22062b=_[_0x4371('0x19')](db[_0x4371('0x1a')][_0x4371('0x1b')],function(_0xd02458){return{'name':_0xd02458[_0x4371('0x1c')],'type':_0xd02458[_0x4371('0x1d')]['key']};});_0x5126da['model']=_[_0x4371('0x19')](_0x22062b,_0x4371('0x15'));_0x5126da[_0x4371('0x1e')]=_['keys'](_0x1c9d88['query']);_0x5126da[_0x4371('0x1f')]=_[_0x4371('0x20')](_0x5126da[_0x4371('0x21')],_0x5126da['query']);_0x740217[_0x4371('0x22')]=_[_0x4371('0x20')](_0x5126da['model'],qs[_0x4371('0x23')](_0x1c9d88[_0x4371('0x1e')][_0x4371('0x23')]));_0x740217[_0x4371('0x22')]=_0x740217[_0x4371('0x22')]['length']?_0x740217[_0x4371('0x22')]:_0x5126da[_0x4371('0x21')];if(!_0x1c9d88[_0x4371('0x1e')][_0x4371('0x24')](_0x4371('0x25'))){_0x740217[_0x4371('0xa')]=qs[_0x4371('0xa')](_0x1c9d88[_0x4371('0x1e')][_0x4371('0xa')]);_0x740217[_0x4371('0xc')]=qs[_0x4371('0xc')](_0x1c9d88['query']['offset']);}_0x740217[_0x4371('0x26')]=qs['sort'](_0x1c9d88['query']['sort']);_0x740217[_0x4371('0x27')]=qs[_0x4371('0x1f')](_['pick'](_0x1c9d88[_0x4371('0x1e')],_0x5126da[_0x4371('0x1f')]),_0x22062b);if(_0x1c9d88[_0x4371('0x1e')]['filter']){_0x740217[_0x4371('0x27')]=_[_0x4371('0x28')](_0x740217['where'],{'$or':_[_0x4371('0x19')](_0x22062b,function(_0x56cc35){if(_0x56cc35[_0x4371('0x1d')]!=='VIRTUAL'){var _0x3c09d9={};_0x3c09d9[_0x56cc35[_0x4371('0x15')]]={'$like':'%'+_0x1c9d88[_0x4371('0x1e')]['filter']+'%'};return _0x3c09d9;}})});}_0x740217=_[_0x4371('0x28')]({},_0x740217,_0x1c9d88[_0x4371('0x29')]);var _0x99f378={'where':_0x740217[_0x4371('0x27')]};return db[_0x4371('0x1a')][_0x4371('0xb')](_0x99f378)[_0x4371('0x11')](function(_0x48542c){_0x461a4c[_0x4371('0xb')]=_0x48542c;if(_0x1c9d88[_0x4371('0x1e')][_0x4371('0x2a')]){_0x740217[_0x4371('0x2b')]=[{'all':!![]}];}return db[_0x4371('0x1a')]['findAll'](_0x740217);})['then'](function(_0x30dead){_0x461a4c[_0x4371('0x2c')]=_['map'](_0x30dead,function(_0x47cc61){if(_0x47cc61['service']===_0x4371('0x2d')){var _0x4f3aff=encryptor[_0x4371('0x2e')](_0x47cc61[_0x4371('0x2f')]);_0x47cc61[_0x4371('0x2f')]=maskClientSecret(_0x4f3aff);}return _0x47cc61;});return _0x461a4c;})[_0x4371('0x11')](respondWithFilteredResult(_0x577870,_0x740217))[_0x4371('0x30')](handleError(_0x577870,null));};exports[_0x4371('0x31')]=function(_0x17d2fb,_0x7ed02){var _0x3b71aa={'raw':!![],'where':{'id':_0x17d2fb['params']['id']}},_0x3a25d1={};_0x3a25d1[_0x4371('0x21')]=_['keys'](db[_0x4371('0x1a')][_0x4371('0x1b')]);_0x3a25d1[_0x4371('0x1e')]=_[_0x4371('0x32')](_0x17d2fb[_0x4371('0x1e')]);_0x3a25d1[_0x4371('0x1f')]=_[_0x4371('0x20')](_0x3a25d1['model'],_0x3a25d1[_0x4371('0x1e')]);_0x3b71aa[_0x4371('0x22')]=_[_0x4371('0x20')](_0x3a25d1[_0x4371('0x21')],qs[_0x4371('0x23')](_0x17d2fb[_0x4371('0x1e')][_0x4371('0x23')]));_0x3b71aa[_0x4371('0x22')]=_0x3b71aa[_0x4371('0x22')][_0x4371('0x33')]?_0x3b71aa[_0x4371('0x22')]:_0x3a25d1[_0x4371('0x21')];if(_0x17d2fb[_0x4371('0x1e')][_0x4371('0x2a')]){_0x3b71aa[_0x4371('0x2b')]=[{'all':!![]}];}_0x3b71aa=_[_0x4371('0x28')]({},_0x3b71aa,_0x17d2fb[_0x4371('0x29')]);return db['CloudProvider'][_0x4371('0x34')](_0x3b71aa)['then'](handleEntityNotFound(_0x7ed02,null))[_0x4371('0x11')](function(_0x448f94){if(_0x448f94[_0x4371('0x35')]===_0x4371('0x2d')){var _0x24802c=encryptor[_0x4371('0x2e')](_0x448f94[_0x4371('0x2f')]);_0x448f94[_0x4371('0x2f')]=maskClientSecret(_0x24802c);}return _0x448f94;})[_0x4371('0x11')](respondWithResult(_0x7ed02,null))[_0x4371('0x30')](handleError(_0x7ed02,null));};exports[_0x4371('0x36')]=function(_0x34577a,_0x5ef25b){if(!_0x34577a[_0x4371('0x37')][_0x4371('0x15')])throw new Error(_0x4371('0x38'));if(!_0x34577a['body'][_0x4371('0x35')])throw new Error(_0x4371('0x39'));var _0x533f52=db[_0x4371('0x1a')]['rawAttributes'][_0x4371('0x35')][_0x4371('0x3a')];if(!_0x533f52['includes'](_0x34577a[_0x4371('0x37')][_0x4371('0x35')]))throw new Error(_0x4371('0x3b')+_0x533f52[_0x4371('0x3c')](',\x20'));if(_0x34577a['body'][_0x4371('0x35')]===_0x4371('0x2d')&&_0x34577a[_0x4371('0x37')][_0x4371('0x2f')]){_0x34577a['body']['data3']=encryptor['encryptString'](_0x34577a[_0x4371('0x37')][_0x4371('0x2f')]);}return db['CloudProvider'][_0x4371('0x36')](_0x34577a['body'],{})[_0x4371('0x11')](respondWithResult(_0x5ef25b,0xc9))[_0x4371('0x30')](handleError(_0x5ef25b,null));};exports[_0x4371('0x10')]=function(_0x143a6a,_0x82ede){if(_0x143a6a[_0x4371('0x37')]['id']){delete _0x143a6a[_0x4371('0x37')]['id'];}return db[_0x4371('0x1a')][_0x4371('0x34')]({'where':{'id':_0x143a6a['params']['id']}})[_0x4371('0x11')](handleEntityNotFound(_0x82ede,null))[_0x4371('0x11')](function(_0xf86c80){if(_0xf86c80[_0x4371('0x35')]===_0x4371('0x2d')&&_0x143a6a['body'][_0x4371('0x2f')]){_0x143a6a[_0x4371('0x37')][_0x4371('0x2f')]=encryptor[_0x4371('0x3d')](_0x143a6a[_0x4371('0x37')][_0x4371('0x2f')]);}return _0xf86c80;})[_0x4371('0x11')](saveUpdates(_0x143a6a[_0x4371('0x37')],null))[_0x4371('0x11')](respondWithResult(_0x82ede,null))[_0x4371('0x30')](handleError(_0x82ede,null));};exports[_0x4371('0x12')]=function(_0x1b6a13,_0x158e5f){return db[_0x4371('0x1a')][_0x4371('0x34')]({'where':{'id':_0x1b6a13[_0x4371('0x3e')]['id']}})[_0x4371('0x11')](handleEntityNotFound(_0x158e5f,null))[_0x4371('0x11')](removeEntity(_0x158e5f,null))[_0x4371('0x30')](handleError(_0x158e5f,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4c81dc,_0x2ab686){return db['CloudProvider'][_0x4371('0x3f')]({'where':{'id':_0x4c81dc[_0x4371('0x3e')]['id']},'raw':!![]})[_0x4371('0x11')](function(_0x2a9ac9){if(!_0x2a9ac9)return _0x2ab686[_0x4371('0x7')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2a9ac9,_0x4c81dc[_0x4371('0x40')]['id'])};})['then'](respondWithResult(_0x2ab686,null))[_0x4371('0x30')](handleError(_0x2ab686,null));};exports[_0x4371('0x41')]=function(_0x38fe65,_0x58ef2f){var _0x8d677=_0x38fe65['body'];var _0x52aa84;var _0x2ede8d;if(_0x8d677[_0x4371('0x13')])throw _0x8d677;redis['get'](_0x8d677[_0x4371('0x42')])[_0x4371('0x11')](function(_0x1942ab){if(!_0x1942ab)throw new Error('Invalid\x20state\x20parameter');_0x52aa84=JSON[_0x4371('0x43')](_0x1942ab);var _0xe3a53=Buffer[_0x4371('0x44')](_0x8d677[_0x4371('0x42')],'base64')[_0x4371('0x45')](_0x4371('0x46'));_0x2ede8d=JSON[_0x4371('0x43')](_0xe3a53);if(!oauth[_0x4371('0x47')](_0x8d677[_0x4371('0x48')],_0x52aa84[_0x4371('0x49')]))throw new Error(_0x4371('0x4a'));redis[_0x4371('0x4b')](_0x8d677[_0x4371('0x42')]);return oauth[_0x4371('0x4c')](_0x8d677[_0x4371('0x4d')],_0x52aa84);})[_0x4371('0x11')](function(_0x1fbaf2){_0x52aa84[_0x4371('0x4e')]=_0x1fbaf2['access_token'];_0x52aa84['data6']=_0x1fbaf2[_0x4371('0x4f')];return db[_0x4371('0x1a')]['update']({'data5':_0x52aa84[_0x4371('0x4e')],'data6':_0x52aa84[_0x4371('0x50')]},{'where':{'id':_0x52aa84['id']}});})[_0x4371('0x11')](function(){oauth[_0x4371('0x51')](_0x52aa84);socket[_0x4371('0x52')](_0x4371('0x53'),{'id':_0x2ede8d['id']});return;})[_0x4371('0x11')](respondWithStatusCode(_0x58ef2f,null))[_0x4371('0x30')](function(_0x378f61){if(_0x2ede8d){socket[_0x4371('0x52')](_0x4371('0x54'),{'id':_0x2ede8d['id']});}if(!_0x52aa84){logger[_0x4371('0x13')](_0x4371('0x55'),_0x378f61);return _0x58ef2f[_0x4371('0x8')](0x1f4)['send'](_0x378f61[_0x4371('0x56')]);}logger['error'](_0x4371('0x57'),_0x52aa84['id'],JSON['stringify'](_0x378f61));});};
\ No newline at end of file
index 85adea8..2db38a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b99=['api','moment','bluebird','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x1d3dbf,_0x4ce37a){var _0x29df13=function(_0x37370a){while(--_0x37370a){_0x1d3dbf['push'](_0x1d3dbf['shift']());}};_0x29df13(++_0x4ce37a);}(_0x6b99,0x172));var _0x96b9=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0x6b99[_0x566168];return _0x4e1f7a;};'use strict';var _=require(_0x96b9('0x0'));var util=require(_0x96b9('0x1'));var logger=require('../../config/logger')(_0x96b9('0x2'));var moment=require(_0x96b9('0x3'));var BPromise=require(_0x96b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96b9('0x5'));var rimraf=require('rimraf');var config=require(_0x96b9('0x6'));var attributes=require(_0x96b9('0x7'));module[_0x96b9('0x8')]=function(_0x119b70,_0x3db117){return _0x119b70[_0x96b9('0x9')](_0x96b9('0xa'),attributes,{'tableName':_0x96b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa579=['CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cloudProvider.attributes','exports','define'];(function(_0x2ae1f0,_0x4ccb56){var _0x334705=function(_0x46ff47){while(--_0x46ff47){_0x2ae1f0['push'](_0x2ae1f0['shift']());}};_0x334705(++_0x4ccb56);}(_0xa579,0xce));var _0x9a57=function(_0x3032cb,_0x2b972b){_0x3032cb=_0x3032cb-0x0;var _0x285e76=_0xa579[_0x3032cb];return _0x285e76;};'use strict';var _=require(_0x9a57('0x0'));var util=require('util');var logger=require(_0x9a57('0x1'))(_0x9a57('0x2'));var moment=require(_0x9a57('0x3'));var BPromise=require(_0x9a57('0x4'));var rp=require(_0x9a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a57('0x6'));var config=require('../../config/environment');var attributes=require(_0x9a57('0x7'));module[_0x9a57('0x8')]=function(_0x418f6c,_0x2db4c6){return _0x418f6c[_0x9a57('0x9')](_0x9a57('0xa'),attributes,{'tableName':_0x9a57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2a5f205..64a44e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8027=['form_post','scope','state','nonce','login','key','value','oauth2Claims','oauth2/','set','decode','payload','audience','isAfter','unix','resolve','then','data3','findOne','data6','data4','decryptString','POST','access_token','refresh_token','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','push','data7','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','hex','client_id','data1','join','response_mode'];(function(_0x445971,_0x432a07){var _0x3e5e23=function(_0x4f91ee){while(--_0x4f91ee){_0x445971['push'](_0x445971['shift']());}};_0x3e5e23(++_0x432a07);}(_0x8027,0xb4));var _0x7802=function(_0x2f5810,_0x36dc97){_0x2f5810=_0x2f5810-0x0;var _0x4845cf=_0x8027[_0x2f5810];return _0x4845cf;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x7802('0x0'));var moment=require(_0x7802('0x1'));var Redis=require(_0x7802('0x2'));var rp=require(_0x7802('0x3'));var util=require(_0x7802('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0x7802('0x5'));var logger=require(_0x7802('0x6'))(_0x7802('0x7'));var schedule=require(_0x7802('0x8'));var db=require('../../mysqldb')['db'];config[_0x7802('0x9')]=_[_0x7802('0xa')](config[_0x7802('0x9')],{'host':_0x7802('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x7802('0xc'),'profile',_0x7802('0xd'),_0x7802('0xe'),_0x7802('0xf'),_0x7802('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x7802('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x7802('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x7802('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x37f5ee){var _0x5e17f6=_[_0x7802('0x13')](AZURE_AUTH_SCOPES[_0x37f5ee[_0x7802('0x14')]]);if(_0x37f5ee['type']===_0x7802('0x15'))_0x5e17f6[_0x7802('0x16')](_0x37f5ee[_0x7802('0x17')]+'/.default');return _0x5e17f6['join']('\x20');}function getAccessTokenScope(_0x370b2e){if(_0x370b2e[_0x7802('0x14')]===_0x7802('0x18'))return _0x7802('0xf');if(_0x370b2e['type']===_0x7802('0x15'))return _0x370b2e[_0x7802('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x1a7dba,_0x1213e3){var _0x329496=MICROSOFT_AUTH_URL[_0x7802('0x19')](_0x7802('0x1a'),_0x1a7dba[_0x7802('0x1b')]);var _0x4f87cc=[_0x7802('0x1c'),_0x7802('0x1d')];var _0xfa2d4e=Buffer[_0x7802('0x1e')](JSON[_0x7802('0x1f')]({'id':_0x1213e3}))[_0x7802('0x20')](_0x7802('0x21'));var _0x48adc5=crypto['randomBytes'](0x10)[_0x7802('0x20')](_0x7802('0x22'));var _0x32118b=getAuthorizationScopes(_0x1a7dba);var _0x37b46b=[{'key':_0x7802('0x23'),'value':_0x1a7dba[_0x7802('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x4f87cc[_0x7802('0x25')]('\x20'))},{'key':'redirect_uri','value':_0x1a7dba['data4']},{'key':_0x7802('0x26'),'value':_0x7802('0x27')},{'key':_0x7802('0x28'),'value':encodeURIComponent(_0x32118b)},{'key':_0x7802('0x29'),'value':_0xfa2d4e},{'key':_0x7802('0x2a'),'value':_0x48adc5},{'key':'prompt','value':_0x7802('0x2b')}];var _0x18f1e0=_0x329496+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x37b46b,function(_0x3314a3){return _0x3314a3[_0x7802('0x2c')]+'='+_0x3314a3[_0x7802('0x2d')];})[_0x7802('0x25')]('&');_0x1a7dba[_0x7802('0x2e')]={'issuer':_0x329496[_0x7802('0x19')](_0x7802('0x2f'),''),'audience':_0x1a7dba[_0x7802('0x24')],'state':_0xfa2d4e,'nonce':_0x48adc5};redis[_0x7802('0x30')](_0xfa2d4e,JSON['stringify'](_0x1a7dba));return _0x18f1e0;}function isValidIdToken(_0x5f2d29,_0x3f5ccf){try{var _0x59e565=jwt[_0x7802('0x31')](_0x5f2d29,{'complete':!![]});var _0x1a2299=_0x59e565[_0x7802('0x32')];if(_0x1a2299['iss']!==_0x3f5ccf['issuer'])return![];if(_0x1a2299['aud']!==_0x3f5ccf[_0x7802('0x33')])return![];if(_0x1a2299['nonce']!==_0x3f5ccf[_0x7802('0x2a')])return![];if(moment()[_0x7802('0x34')](moment[_0x7802('0x35')](_0x1a2299['exp'])))return![];return!![];}catch(_0x1d30e8){throw _0x1d30e8;}}function refreshOauth2MicrosoftAccessToken(_0x45470f){return Promise[_0x7802('0x36')]()[_0x7802('0x37')](function(){if(_0x45470f[_0x7802('0x38')])return _0x45470f;return db['CloudProvider'][_0x7802('0x39')]({'where':{'id':_0x45470f['id']},'raw':!![]});})[_0x7802('0x37')](function(_0x3d2c3){var _0x456cc5={'grant_type':'refresh_token','refresh_token':_0x3d2c3[_0x7802('0x3a')],'scope':getAccessTokenScope(_0x3d2c3),'redirect_uri':_0x3d2c3[_0x7802('0x3b')],'client_id':_0x3d2c3[_0x7802('0x24')],'client_secret':encryptor[_0x7802('0x3c')](_0x3d2c3[_0x7802('0x38')])};var _0x30324d={'method':_0x7802('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x7802('0x19')](_0x7802('0x1a'),_0x3d2c3['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x456cc5,'json':!![]};return rp(_0x30324d);})[_0x7802('0x37')](function(_0x1e5941){_0x45470f['data5']=_0x1e5941[_0x7802('0x3e')];_0x45470f[_0x7802('0x3a')]=_0x1e5941[_0x7802('0x3f')];return db[_0x7802('0x40')][_0x7802('0x41')]({'data5':_0x45470f['data5'],'data6':_0x45470f['data6']},{'where':{'id':_0x45470f['id']}});})[_0x7802('0x37')](function(){return _0x45470f;})[_0x7802('0x42')](function(_0x41dc15){logger['error'](_0x7802('0x43'),_0x45470f['id'],_0x41dc15);});}function getOauth2MicrosoftAccessToken(_0x2af016,_0x2035d9){var _0x324a5c={'grant_type':'authorization_code','code':_0x2af016,'scope':getAccessTokenScope(_0x2035d9),'redirect_uri':_0x2035d9[_0x7802('0x3b')],'client_id':_0x2035d9[_0x7802('0x24')],'client_secret':encryptor[_0x7802('0x3c')](_0x2035d9['data3'])};var _0x37bf00={'method':_0x7802('0x3d'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7802('0x1a'),_0x2035d9[_0x7802('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x324a5c,'json':!![]};return rp(_0x37bf00);}function startRefreshInterval(_0x29006b){var _0x352c47=schedule[_0x7802('0x44')];if(_0x352c47[_0x29006b['id']])clearInterval(_0x352c47[_0x29006b['id']]);_0x352c47[_0x29006b['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x29006b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7802('0x44')]=_0x352c47;}function startAllRefreshIntervals(){return db[_0x7802('0x40')][_0x7802('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x5271fb){var _0x1b9ca9=_0x5271fb['map'](function(_0x3694cf){return refreshOauth2MicrosoftAccessToken(_0x3694cf)[_0x7802('0x37')](function(_0x5557b9){startRefreshInterval(_0x5557b9);});});return Promise[_0x7802('0x46')](_0x1b9ca9);})[_0x7802('0x42')](function(_0x25f3eb){var _0x67e9f9=_0x25f3eb?util['inspect'](_0x25f3eb,{'showHidden':![],'depth':null}):'';logger[_0x7802('0x47')](_0x7802('0x48'),_0x67e9f9);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9df7=['CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','POST','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','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','type','Dynamics365','push','data7','join','Outlook365','/.default','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','form_post','nonce','login','map','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','unix','then','data3','data6','decryptString','access_token'];(function(_0xa059ea,_0x5cb91e){var _0x156a4c=function(_0x1b4717){while(--_0x1b4717){_0xa059ea['push'](_0xa059ea['shift']());}};_0x156a4c(++_0x5cb91e);}(_0x9df7,0xa8));var _0x79df=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0x9df7[_0x323d87];return _0x5e8f74;};'use strict';var _=require(_0x79df('0x0'));var crypto=require(_0x79df('0x1'));var jwt=require(_0x79df('0x2'));var moment=require(_0x79df('0x3'));var Redis=require(_0x79df('0x4'));var rp=require('request-promise');var util=require(_0x79df('0x5'));var encryptor=require(_0x79df('0x6'));var config=require(_0x79df('0x7'));var logger=require('../../config/logger')('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x79df('0x8'))['db'];config[_0x79df('0x9')]=_[_0x79df('0xa')](config[_0x79df('0x9')],{'host':_0x79df('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x79df('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x79df('0xd'),'profile',_0x79df('0xe'),_0x79df('0xf'),_0x79df('0x10'),_0x79df('0x11'),_0x79df('0x12')],'Dynamics365':[_0x79df('0xd'),_0x79df('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x79df('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x79df('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4522e7){var _0xd67721=_['map'](AZURE_AUTH_SCOPES[_0x4522e7[_0x79df('0x15')]]);if(_0x4522e7[_0x79df('0x15')]===_0x79df('0x16'))_0xd67721[_0x79df('0x17')](_0x4522e7[_0x79df('0x18')]+'/.default');return _0xd67721[_0x79df('0x19')]('\x20');}function getAccessTokenScope(_0x3ae3ae){if(_0x3ae3ae['type']===_0x79df('0x1a'))return _0x79df('0x10');if(_0x3ae3ae[_0x79df('0x15')]===_0x79df('0x16'))return _0x3ae3ae['data7']+_0x79df('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3b4569,_0x46907d){var _0x47ac86=MICROSOFT_AUTH_URL[_0x79df('0x1c')](_0x79df('0x1d'),_0x3b4569[_0x79df('0x1e')]);var _0x1416af=['code',_0x79df('0x1f')];var _0x26ffef=Buffer[_0x79df('0x20')](JSON[_0x79df('0x21')]({'id':_0x46907d}))[_0x79df('0x22')](_0x79df('0x23'));var _0x3d695a=crypto[_0x79df('0x24')](0x10)[_0x79df('0x22')](_0x79df('0x25'));var _0x5a8afb=getAuthorizationScopes(_0x3b4569);var _0x3923da=[{'key':_0x79df('0x26'),'value':_0x3b4569[_0x79df('0x27')]},{'key':_0x79df('0x28'),'value':encodeURIComponent(_0x1416af[_0x79df('0x19')]('\x20'))},{'key':_0x79df('0x29'),'value':_0x3b4569['data4']},{'key':'response_mode','value':_0x79df('0x2a')},{'key':'scope','value':encodeURIComponent(_0x5a8afb)},{'key':'state','value':_0x26ffef},{'key':_0x79df('0x2b'),'value':_0x3d695a},{'key':'prompt','value':_0x79df('0x2c')}];var _0x285886=_0x47ac86+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x79df('0x2d')](_0x3923da,function(_0x58a30c){return _0x58a30c[_0x79df('0x2e')]+'='+_0x58a30c[_0x79df('0x2f')];})[_0x79df('0x19')]('&');_0x3b4569[_0x79df('0x30')]={'issuer':_0x47ac86[_0x79df('0x1c')](_0x79df('0x31'),''),'audience':_0x3b4569[_0x79df('0x27')],'state':_0x26ffef,'nonce':_0x3d695a};redis[_0x79df('0x32')](_0x26ffef,JSON[_0x79df('0x21')](_0x3b4569));return _0x285886;}function isValidIdToken(_0x41bfb6,_0x1f6629){try{var _0x548610=jwt[_0x79df('0x33')](_0x41bfb6,{'complete':!![]});var _0x4c9248=_0x548610[_0x79df('0x34')];if(_0x4c9248[_0x79df('0x35')]!==_0x1f6629[_0x79df('0x36')])return![];if(_0x4c9248[_0x79df('0x37')]!==_0x1f6629[_0x79df('0x38')])return![];if(_0x4c9248['nonce']!==_0x1f6629['nonce'])return![];if(moment()['isAfter'](moment[_0x79df('0x39')](_0x4c9248['exp'])))return![];return!![];}catch(_0x3fb31b){throw _0x3fb31b;}}function refreshOauth2MicrosoftAccessToken(_0x34a50e){return Promise['resolve']()[_0x79df('0x3a')](function(){if(_0x34a50e[_0x79df('0x3b')])return _0x34a50e;return db['CloudProvider']['findOne']({'where':{'id':_0x34a50e['id']},'raw':!![]});})['then'](function(_0x2b723a){var _0x5167ff={'grant_type':'refresh_token','refresh_token':_0x2b723a[_0x79df('0x3c')],'scope':getAccessTokenScope(_0x2b723a),'redirect_uri':_0x2b723a['data4'],'client_id':_0x2b723a[_0x79df('0x27')],'client_secret':encryptor[_0x79df('0x3d')](_0x2b723a[_0x79df('0x3b')])};var _0xa262c3={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x79df('0x1d'),_0x2b723a[_0x79df('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5167ff,'json':!![]};return rp(_0xa262c3);})[_0x79df('0x3a')](function(_0x2acd34){_0x34a50e['data5']=_0x2acd34[_0x79df('0x3e')];_0x34a50e[_0x79df('0x3c')]=_0x2acd34['refresh_token'];return db[_0x79df('0x3f')][_0x79df('0x40')]({'data5':_0x34a50e['data5'],'data6':_0x34a50e[_0x79df('0x3c')]},{'where':{'id':_0x34a50e['id']}});})['then'](function(){return _0x34a50e;})[_0x79df('0x41')](function(_0x139f7c){logger[_0x79df('0x42')](_0x79df('0x43'),_0x34a50e['id'],_0x139f7c);});}function getOauth2MicrosoftAccessToken(_0x3c7d7f,_0x41467e){var _0xb90416={'grant_type':_0x79df('0x44'),'code':_0x3c7d7f,'scope':getAccessTokenScope(_0x41467e),'redirect_uri':_0x41467e[_0x79df('0x45')],'client_id':_0x41467e[_0x79df('0x27')],'client_secret':encryptor['decryptString'](_0x41467e[_0x79df('0x3b')])};var _0x6f98d8={'method':_0x79df('0x46'),'uri':MICROSOFT_AUTH_URL[_0x79df('0x1c')](_0x79df('0x1d'),_0x41467e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xb90416,'json':!![]};return rp(_0x6f98d8);}function startRefreshInterval(_0x167ee9){var _0x2242ec=schedule[_0x79df('0x47')];if(_0x2242ec[_0x167ee9['id']])clearInterval(_0x2242ec[_0x167ee9['id']]);_0x2242ec[_0x167ee9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x79df('0x48')](this,{'id':_0x167ee9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x79df('0x47')]=_0x2242ec;}function startAllRefreshIntervals(){return db[_0x79df('0x3f')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x79df('0x3a')](function(_0x5035c7){var _0x1e23bb=_0x5035c7[_0x79df('0x2d')](function(_0x106b80){return refreshOauth2MicrosoftAccessToken(_0x106b80)[_0x79df('0x3a')](function(_0x1ea2d2){startRefreshInterval(_0x1ea2d2);});});return Promise[_0x79df('0x49')](_0x1e23bb);})['catch'](function(_0x253c7d){var _0x5b2a3f=_0x253c7d?util[_0x79df('0x4a')](_0x253c7d,{'showHidden':![],'depth':null}):'';logger[_0x79df('0x42')](_0x79df('0x4b'),_0x5b2a3f);});}module[_0x79df('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index 07615c4..a969600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20d8=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x4c17fc,_0x5c7809){var _0x4d107f=function(_0x14e921){while(--_0x14e921){_0x4c17fc['push'](_0x4c17fc['shift']());}};_0x4d107f(++_0x5c7809);}(_0x20d8,0xee));var _0x820d=function(_0x2a5cd7,_0x296fd6){_0x2a5cd7=_0x2a5cd7-0x0;var _0x315db2=_0x20d8[_0x2a5cd7];return _0x315db2;};'use strict';var _=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var moment=require(_0x820d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x820d('0x3'));var db=require(_0x820d('0x4'))['db'];var utils=require(_0x820d('0x5'));var logger=require(_0x820d('0x6'))(_0x820d('0x7'));var config=require('../../config/environment');var jayson=require(_0x820d('0x8'));var client=jayson[_0x820d('0x9')][_0x820d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e23e3,_0x435a84,_0xa2751d){return new BPromise(function(_0x3b084c,_0x485bde){return client[_0x820d('0xb')](_0x4e23e3,_0xa2751d)['then'](function(_0x45fdd7){logger['info']('CloudProvider,\x20%s,\x20%s',_0x435a84,_0x820d('0xc'));logger['debug'](_0x820d('0xd'),_0x435a84,_0x820d('0xc'),JSON[_0x820d('0xe')](_0x45fdd7));if(_0x45fdd7['error']){if(_0x45fdd7[_0x820d('0xf')][_0x820d('0x10')]===0x1f4){logger['error'](_0x820d('0x11'),_0x435a84,_0x45fdd7['error'][_0x820d('0x12')]);return _0x485bde(_0x45fdd7[_0x820d('0xf')][_0x820d('0x12')]);}logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x45fdd7[_0x820d('0xf')]['message']);return _0x3b084c(_0x45fdd7['error'][_0x820d('0x12')]);}else{logger['info'](_0x820d('0x11'),_0x435a84,_0x820d('0xc'));_0x3b084c(_0x45fdd7[_0x820d('0x13')]['message']);}})[_0x820d('0x14')](function(_0x3466c1){logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x3466c1);_0x485bde(_0x3466c1);});});}
\ No newline at end of file
+var _0xbd8e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring'];(function(_0x114984,_0x5c9593){var _0x44822b=function(_0x10af37){while(--_0x10af37){_0x114984['push'](_0x114984['shift']());}};_0x44822b(++_0x5c9593);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbd8e[_0x432682];return _0x463d05;};'use strict';var _=require(_0xebd8('0x0'));var util=require(_0xebd8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xebd8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebd8('0x3'))['db'];var utils=require(_0xebd8('0x4'));var logger=require(_0xebd8('0x5'))(_0xebd8('0x6'));var config=require(_0xebd8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xebd8('0x8')][_0xebd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f2b2e,_0x3740bd,_0x3b92b9){return new BPromise(function(_0x4ac0d0,_0x19c8ee){return client[_0xebd8('0xa')](_0x3f2b2e,_0x3b92b9)[_0xebd8('0xb')](function(_0x13afa5){logger['info']('CloudProvider,\x20%s,\x20%s',_0x3740bd,'request\x20sent');logger[_0xebd8('0xc')](_0xebd8('0xd'),_0x3740bd,_0xebd8('0xe'),JSON[_0xebd8('0xf')](_0x13afa5));if(_0x13afa5[_0xebd8('0x10')]){if(_0x13afa5['error'][_0xebd8('0x11')]===0x1f4){logger['error'](_0xebd8('0x12'),_0x3740bd,_0x13afa5[_0xebd8('0x10')]['message']);return _0x19c8ee(_0x13afa5[_0xebd8('0x10')][_0xebd8('0x13')]);}logger[_0xebd8('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3740bd,_0x13afa5[_0xebd8('0x10')]['message']);return _0x4ac0d0(_0x13afa5[_0xebd8('0x10')]['message']);}else{logger['info'](_0xebd8('0x12'),_0x3740bd,_0xebd8('0xe'));_0x4ac0d0(_0x13afa5[_0xebd8('0x14')][_0xebd8('0x13')]);}})[_0xebd8('0x15')](function(_0x2b6ac4){logger[_0xebd8('0x10')](_0xebd8('0x12'),_0x3740bd,_0x2b6ac4);_0x19c8ee(_0x2b6ac4);});});}
\ No newline at end of file
index 6decd4a..f2ec7e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1bdbd8,_0x42e518){var _0x435911=function(_0x54944c){while(--_0x54944c){_0x1bdbd8['push'](_0x1bdbd8['shift']());}};_0x435911(++_0x42e518);}(_0xadb5,0xad));var _0x5adb=function(_0x5d91dd,_0x240202){_0x5d91dd=_0x5d91dd-0x0;var _0x41fb43=_0xadb5[_0x5d91dd];return _0x41fb43;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x484c1f,_0x4e6764){var _0x561185=function(_0x377917){while(--_0x377917){_0x484c1f['push'](_0x484c1f['shift']());}};_0x561185(++_0x4e6764);}(_0xdb28,0x106));var _0x8db2=function(_0x5051c2,_0x5b2cab){_0x5051c2=_0x5051c2-0x0;var _0xf5f703=_0xdb28[_0x5051c2];return _0xf5f703;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
index 63535e8..93f96e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ca8=['exports','name','STRING'];(function(_0x2dd253,_0x55b03a){var _0x50a6ab=function(_0x438a32){while(--_0x438a32){_0x2dd253['push'](_0x2dd253['shift']());}};_0x50a6ab(++_0x55b03a);}(_0x9ca8,0x123));var _0x89ca=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x9ca8[_0x1e1965];return _0x1a2e96;};'use strict';var Sequelize=require('sequelize');module[_0x89ca('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x89ca('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x89ca('0x2')]},'companyId':{'type':Sequelize[_0x89ca('0x2')]},'website':{'type':Sequelize[_0x89ca('0x2')]},'phone':{'type':Sequelize[_0x89ca('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x89ca('0x2')]},'street':{'type':Sequelize[_0x89ca('0x2')]},'postalCode':{'type':Sequelize[_0x89ca('0x2')]},'city':{'type':Sequelize[_0x89ca('0x2')]},'country':{'type':Sequelize[_0x89ca('0x2')]},'email':{'type':Sequelize[_0x89ca('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x89ca('0x2')]},'sStreet':{'type':Sequelize[_0x89ca('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x89ca('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2624=['STRING','sequelize','exports','name'];(function(_0x527dc5,_0x1de7e7){var _0x216de9=function(_0xde9c52){while(--_0xde9c52){_0x527dc5['push'](_0x527dc5['shift']());}};_0x216de9(++_0x1de7e7);}(_0x2624,0x75));var _0x4262=function(_0x566e44,_0x3f3bb4){_0x566e44=_0x566e44-0x0;var _0x2a879c=_0x2624[_0x566e44];return _0x2a879c;};'use strict';var Sequelize=require(_0x4262('0x0'));module[_0x4262('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4262('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4262('0x3')]},'companyId':{'type':Sequelize[_0x4262('0x3')]},'website':{'type':Sequelize[_0x4262('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4262('0x3')]},'type':{'type':Sequelize[_0x4262('0x3')]},'street':{'type':Sequelize[_0x4262('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x4262('0x3')]},'email':{'type':Sequelize[_0x4262('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4262('0x3')]},'sStreet':{'type':Sequelize[_0x4262('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x4262('0x3')]},'description':{'type':Sequelize[_0x4262('0x3')]}};
\ No newline at end of file
index 3e79bd8..d790f76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb79=['UserProfileSection','userProfileId','update','params','addContacts','CmContact','omit','ids','findOne','order','getContacts','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','map','merge','include','findAll','rows','catch','show','rawAttributes','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x190c49,_0x103457){var _0x475b9a=function(_0x44f13c){while(--_0x44f13c){_0x190c49['push'](_0x190c49['shift']());}};_0x475b9a(++_0x103457);}(_0xbb79,0x1d7));var _0x9bb7=function(_0xcf8b8c,_0xa57230){_0xcf8b8c=_0xcf8b8c-0x0;var _0x166662=_0xbb79[_0xcf8b8c];return _0x166662;};'use strict';var emlformat=require(_0x9bb7('0x0'));var rimraf=require(_0x9bb7('0x1'));var zipdir=require(_0x9bb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9bb7('0x3'));var moment=require(_0x9bb7('0x4'));var BPromise=require(_0x9bb7('0x5'));var Mustache=require(_0x9bb7('0x6'));var util=require(_0x9bb7('0x7'));var path=require(_0x9bb7('0x8'));var sox=require('sox');var csv=require(_0x9bb7('0x9'));var ejs=require(_0x9bb7('0xa'));var fs=require('fs');var fs_extra=require(_0x9bb7('0xb'));var _=require(_0x9bb7('0xc'));var squel=require(_0x9bb7('0xd'));var crypto=require(_0x9bb7('0xe'));var jsforce=require(_0x9bb7('0xf'));var deskjs=require(_0x9bb7('0x10'));var toCsv=require(_0x9bb7('0x9'));var querystring=require('querystring');var Papa=require(_0x9bb7('0x11'));var Redis=require(_0x9bb7('0x12'));var authService=require(_0x9bb7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9bb7('0x14'));var hardwareService=require(_0x9bb7('0x15'));var logger=require(_0x9bb7('0x16'))(_0x9bb7('0x17'));var utils=require(_0x9bb7('0x18'));var config=require(_0x9bb7('0x19'));var licenseUtil=require(_0x9bb7('0x1a'));var db=require(_0x9bb7('0x1b'))['db'];function respondWithStatusCode(_0x36f048,_0xb7d53){_0xb7d53=_0xb7d53||0xcc;return function(_0x3f080d){if(_0x3f080d){return _0x36f048[_0x9bb7('0x1c')](_0xb7d53);}return _0x36f048[_0x9bb7('0x1d')](_0xb7d53)[_0x9bb7('0x1e')]();};}function respondWithResult(_0x3234d6,_0x2b5e7f){_0x2b5e7f=_0x2b5e7f||0xc8;return function(_0x52b673){if(_0x52b673){return _0x3234d6[_0x9bb7('0x1d')](_0x2b5e7f)[_0x9bb7('0x1f')](_0x52b673);}};}function respondWithFilteredResult(_0xa20544,_0x18f78a){return function(_0x58cc29){if(_0x58cc29){var _0xd83e94=typeof _0x18f78a['offset']===_0x9bb7('0x20')&&typeof _0x18f78a[_0x9bb7('0x21')]==='undefined';var _0x3edea0=_0x58cc29['count'];var _0x2f8935=_0xd83e94?0x0:_0x18f78a['offset'];var _0x22e985=_0xd83e94?_0x58cc29[_0x9bb7('0x22')]:_0x18f78a[_0x9bb7('0x23')]+_0x18f78a[_0x9bb7('0x21')];var _0x39be29;if(_0x22e985>=_0x3edea0){_0x22e985=_0x3edea0;_0x39be29=0xc8;}else{_0x39be29=0xce;}_0xa20544[_0x9bb7('0x1d')](_0x39be29);return _0xa20544[_0x9bb7('0x24')](_0x9bb7('0x25'),_0x2f8935+'-'+_0x22e985+'/'+_0x3edea0)[_0x9bb7('0x1f')](_0x58cc29);}return null;};}function patchUpdates(_0x27e078){return function(_0x384c95){try{jsonpatch[_0x9bb7('0x26')](_0x384c95,_0x27e078,!![]);}catch(_0x38c763){return BPromise[_0x9bb7('0x27')](_0x38c763);}return _0x384c95[_0x9bb7('0x28')]();};}function saveUpdates(_0x740592,_0x2c6d7d){return function(_0xe6252e){if(_0xe6252e){return _0xe6252e['update'](_0x740592)[_0x9bb7('0x29')](function(_0x4fa99d){return _0x4fa99d;});}return null;};}function removeEntity(_0x236c3e,_0x21b21e){return function(_0x3b3264){if(_0x3b3264){return _0x3b3264[_0x9bb7('0x2a')]()[_0x9bb7('0x29')](function(){var _0x233c8e=_0x3b3264[_0x9bb7('0x2b')]({'plain':!![]});var _0x8a33=_0x9bb7('0x2c');return db[_0x9bb7('0x2d')][_0x9bb7('0x2a')]({'where':{'type':_0x8a33,'resourceId':_0x233c8e['id']}})[_0x9bb7('0x29')](function(){return _0x3b3264;});})[_0x9bb7('0x29')](function(){_0x236c3e[_0x9bb7('0x1d')](0xcc)[_0x9bb7('0x1e')]();});}};}function handleEntityNotFound(_0x416985,_0x22c654){return function(_0x3d0ae5){if(!_0x3d0ae5){_0x416985[_0x9bb7('0x1c')](0x194);}return _0x3d0ae5;};}function handleError(_0x3bd2fd,_0x1e52b9){_0x1e52b9=_0x1e52b9||0x1f4;return function(_0x3f1928){logger[_0x9bb7('0x2e')](_0x3f1928[_0x9bb7('0x2f')]);if(_0x3f1928[_0x9bb7('0x30')]){delete _0x3f1928['name'];}_0x3bd2fd[_0x9bb7('0x1d')](_0x1e52b9)[_0x9bb7('0x31')](_0x3f1928);};}exports[_0x9bb7('0x32')]=function(_0x33d3ae,_0x3c997b){var _0x380a64={},_0x5f2c8c={},_0x72f594={'count':0x0,'rows':[]};return db[_0x9bb7('0x33')][_0x9bb7('0x34')]()[_0x9bb7('0x29')](function(_0x3c3fbf){_0x5f2c8c[_0x9bb7('0x35')]=_['keys'](_0x3c3fbf);_0x5f2c8c[_0x9bb7('0x36')]=_['keys'](_0x33d3ae['query']);_0x5f2c8c['filters']=_[_0x9bb7('0x37')](_0x5f2c8c['model'],_0x5f2c8c[_0x9bb7('0x36')]);_0x380a64[_0x9bb7('0x38')]=_[_0x9bb7('0x37')](_0x5f2c8c['model'],qs['fields'](_0x33d3ae['query'][_0x9bb7('0x39')]));_0x380a64['attributes']=_0x380a64[_0x9bb7('0x38')][_0x9bb7('0x3a')]?_0x380a64[_0x9bb7('0x38')]:_0x5f2c8c[_0x9bb7('0x35')];if(!_0x33d3ae[_0x9bb7('0x36')]['hasOwnProperty'](_0x9bb7('0x3b'))){_0x380a64[_0x9bb7('0x21')]=qs[_0x9bb7('0x21')](_0x33d3ae[_0x9bb7('0x36')][_0x9bb7('0x21')]);_0x380a64[_0x9bb7('0x23')]=qs[_0x9bb7('0x23')](_0x33d3ae[_0x9bb7('0x36')][_0x9bb7('0x23')]);}_0x380a64['order']=qs[_0x9bb7('0x3c')](_0x33d3ae[_0x9bb7('0x36')]['sort']);_0x380a64[_0x9bb7('0x3d')]=qs['filters'](_[_0x9bb7('0x3e')](_0x33d3ae['query'],_0x5f2c8c[_0x9bb7('0x3f')]),_0x3c3fbf);if(_0x33d3ae[_0x9bb7('0x36')][_0x9bb7('0x40')]){_0x380a64[_0x9bb7('0x3d')]=_['merge'](_0x380a64[_0x9bb7('0x3d')],{'$or':_[_0x9bb7('0x41')](_0x380a64[_0x9bb7('0x38')],function(_0x176ab6){var _0x18adeb={};_0x18adeb[_0x176ab6]={'$like':'%'+_0x33d3ae[_0x9bb7('0x36')][_0x9bb7('0x40')]+'%'};return _0x18adeb;})});}_0x380a64=_[_0x9bb7('0x42')]({},_0x380a64,_0x33d3ae['options']);var _0x26ca82={'where':_0x380a64[_0x9bb7('0x3d')]};return db[_0x9bb7('0x33')]['count'](_0x26ca82)[_0x9bb7('0x29')](function(_0x2a8a21){_0x72f594[_0x9bb7('0x22')]=_0x2a8a21;if(_0x33d3ae[_0x9bb7('0x36')]['includeAll']){_0x380a64[_0x9bb7('0x43')]=[{'all':!![]}];}return db[_0x9bb7('0x33')][_0x9bb7('0x44')](_0x380a64);})[_0x9bb7('0x29')](function(_0x42d8d4){_0x72f594[_0x9bb7('0x45')]=_0x42d8d4;return _0x72f594;})['then'](respondWithFilteredResult(_0x3c997b,_0x380a64))[_0x9bb7('0x46')](handleError(_0x3c997b,null));})['catch'](handleError(_0x3c997b,null));};exports[_0x9bb7('0x47')]=function(_0x39c5d5,_0x51b890){var _0x40a317={'raw':![],'where':{'id':_0x39c5d5['params']['id']}},_0x5e7da1={};_0x5e7da1[_0x9bb7('0x35')]=_['keys'](db['CmCompany'][_0x9bb7('0x48')]);_0x5e7da1[_0x9bb7('0x36')]=_[_0x9bb7('0x49')](_0x39c5d5[_0x9bb7('0x36')]);_0x5e7da1[_0x9bb7('0x3f')]=_[_0x9bb7('0x37')](_0x5e7da1['model'],_0x5e7da1[_0x9bb7('0x36')]);_0x40a317[_0x9bb7('0x38')]=_[_0x9bb7('0x37')](_0x5e7da1['model'],qs['fields'](_0x39c5d5[_0x9bb7('0x36')]['fields']));_0x40a317[_0x9bb7('0x38')]=_0x40a317[_0x9bb7('0x38')]['length']?_0x40a317[_0x9bb7('0x38')]:_0x5e7da1[_0x9bb7('0x35')];if(_0x39c5d5[_0x9bb7('0x36')][_0x9bb7('0x4a')]){_0x40a317[_0x9bb7('0x43')]=[{'all':!![]}];}_0x40a317=_[_0x9bb7('0x42')]({},_0x40a317,_0x39c5d5[_0x9bb7('0x4b')]);return db[_0x9bb7('0x33')][_0x9bb7('0x4c')](_0x40a317)['then'](handleEntityNotFound(_0x51b890,null))[_0x9bb7('0x29')](respondWithResult(_0x51b890,null))[_0x9bb7('0x46')](handleError(_0x51b890,null));};exports[_0x9bb7('0x4d')]=function(_0x3d4b4d,_0x4b939e){return db[_0x9bb7('0x33')][_0x9bb7('0x4d')](_0x3d4b4d[_0x9bb7('0x4e')],{})[_0x9bb7('0x29')](function(_0x206d8a){var _0x491a60=_0x3d4b4d[_0x9bb7('0x4f')][_0x9bb7('0x2b')]({'plain':!![]});if(!_0x491a60)throw new Error(_0x9bb7('0x50'));if(_0x491a60['role']===_0x9bb7('0x4f')){var _0x4e91ae=_0x206d8a[_0x9bb7('0x2b')]({'plain':!![]});var _0x57292b=_0x9bb7('0x2c');return db[_0x9bb7('0x51')][_0x9bb7('0x4c')]({'where':{'name':_0x57292b,'userProfileId':_0x491a60[_0x9bb7('0x52')]},'raw':!![]})[_0x9bb7('0x29')](function(_0x23820b){if(_0x23820b&&_0x23820b['autoAssociation']===0x0){return db[_0x9bb7('0x2d')]['create']({'name':_0x4e91ae['name'],'resourceId':_0x4e91ae['id'],'type':_0x23820b[_0x9bb7('0x30')],'sectionId':_0x23820b['id']},{})[_0x9bb7('0x29')](function(){return _0x206d8a;});}else{return _0x206d8a;}})[_0x9bb7('0x46')](function(_0xde3047){logger[_0x9bb7('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xde3047);throw _0xde3047;});}return _0x206d8a;})[_0x9bb7('0x29')](respondWithResult(_0x4b939e,0xc9))[_0x9bb7('0x46')](handleError(_0x4b939e,null));};exports[_0x9bb7('0x53')]=function(_0xa1a9b6,_0x2a6c16){if(_0xa1a9b6[_0x9bb7('0x4e')]['id']){delete _0xa1a9b6[_0x9bb7('0x4e')]['id'];}return db['CmCompany'][_0x9bb7('0x4c')]({'where':{'id':_0xa1a9b6[_0x9bb7('0x54')]['id']}})[_0x9bb7('0x29')](handleEntityNotFound(_0x2a6c16,null))['then'](saveUpdates(_0xa1a9b6['body'],null))[_0x9bb7('0x29')](respondWithResult(_0x2a6c16,null))[_0x9bb7('0x46')](handleError(_0x2a6c16,null));};exports[_0x9bb7('0x2a')]=function(_0x36d8b3,_0x3352d6){return db[_0x9bb7('0x33')][_0x9bb7('0x4c')]({'where':{'id':_0x36d8b3[_0x9bb7('0x54')]['id']}})[_0x9bb7('0x29')](handleEntityNotFound(_0x3352d6,null))[_0x9bb7('0x29')](removeEntity(_0x3352d6,null))[_0x9bb7('0x46')](handleError(_0x3352d6,null));};exports['describe']=function(_0x211642,_0x332728){return db[_0x9bb7('0x33')][_0x9bb7('0x34')]()[_0x9bb7('0x29')](respondWithResult(_0x332728,null))[_0x9bb7('0x46')](handleError(_0x332728,null));};exports[_0x9bb7('0x55')]=function(_0x475b18,_0xcce3ed,_0x827179){return db[_0x9bb7('0x56')][_0x9bb7('0x4c')]({'where':{'id':_0x475b18['params']['id']}})[_0x9bb7('0x29')](handleEntityNotFound(_0xcce3ed,null))[_0x9bb7('0x29')](function(_0x1f1de4){if(_0x1f1de4){return _0x1f1de4[_0x9bb7('0x55')](_0x475b18['body']['ids'],_[_0x9bb7('0x57')](_0x475b18[_0x9bb7('0x4e')],[_0x9bb7('0x58'),'id'])||{});}})[_0x9bb7('0x29')](respondWithResult(_0xcce3ed,null))['catch'](handleError(_0xcce3ed,null));};exports['getContacts']=function(_0xd5bac2,_0x3ce6aa,_0x2c406a){var _0x30a704={};var _0x41eac7={};var _0x1b4f78;var _0x37a546;return db['CmCompany'][_0x9bb7('0x59')]({'where':{'id':_0xd5bac2['params']['id']}})[_0x9bb7('0x29')](handleEntityNotFound(_0x3ce6aa,null))[_0x9bb7('0x29')](function(_0x4cf461){if(_0x4cf461){_0x1b4f78=_0x4cf461;_0x41eac7['model']=_['keys'](db[_0x9bb7('0x56')]['rawAttributes']);_0x41eac7[_0x9bb7('0x36')]=_[_0x9bb7('0x49')](_0xd5bac2['query']);_0x41eac7[_0x9bb7('0x3f')]=_['intersection'](_0x41eac7[_0x9bb7('0x35')],_0x41eac7[_0x9bb7('0x36')]);_0x30a704['attributes']=_[_0x9bb7('0x37')](_0x41eac7[_0x9bb7('0x35')],qs[_0x9bb7('0x39')](_0xd5bac2[_0x9bb7('0x36')][_0x9bb7('0x39')]));_0x30a704[_0x9bb7('0x38')]=_0x30a704[_0x9bb7('0x38')]['length']?_0x30a704[_0x9bb7('0x38')]:_0x41eac7[_0x9bb7('0x35')];_0x30a704[_0x9bb7('0x5a')]=qs[_0x9bb7('0x3c')](_0xd5bac2[_0x9bb7('0x36')][_0x9bb7('0x3c')]);_0x30a704[_0x9bb7('0x3d')]=qs[_0x9bb7('0x3f')](_[_0x9bb7('0x3e')](_0xd5bac2['query'],_0x41eac7[_0x9bb7('0x3f')]));if(_0xd5bac2[_0x9bb7('0x36')]['filter']){_0x30a704[_0x9bb7('0x3d')]=_[_0x9bb7('0x42')](_0x30a704[_0x9bb7('0x3d')],{'$or':_[_0x9bb7('0x41')](_0x30a704[_0x9bb7('0x38')],function(_0x36fffd){var _0x54cf33={};_0x54cf33[_0x36fffd]={'$like':'%'+_0xd5bac2['query']['filter']+'%'};return _0x54cf33;})});}_0x30a704=_['merge']({},_0x30a704,_0xd5bac2[_0x9bb7('0x4b')]);return _0x1b4f78[_0x9bb7('0x5b')](_0x30a704);}})[_0x9bb7('0x29')](function(_0x1574e6){if(_0x1574e6){_0x37a546=_0x1574e6[_0x9bb7('0x3a')];if(!_0xd5bac2['query']['hasOwnProperty'](_0x9bb7('0x3b'))){_0x30a704[_0x9bb7('0x21')]=qs[_0x9bb7('0x21')](_0xd5bac2[_0x9bb7('0x36')][_0x9bb7('0x21')]);_0x30a704[_0x9bb7('0x23')]=qs['offset'](_0xd5bac2[_0x9bb7('0x36')][_0x9bb7('0x23')]);}return _0x1b4f78[_0x9bb7('0x5b')](_0x30a704);}})['then'](function(_0x575d57){if(_0x575d57){return _0x575d57?{'count':_0x37a546,'rows':_0x575d57}:null;}})[_0x9bb7('0x29')](respondWithResult(_0x3ce6aa,null))[_0x9bb7('0x46')](handleError(_0x3ce6aa,null));};
\ No newline at end of file
+var _0x7fbd=['set','apply','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','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','ids','omit','findOne','pick','getContacts','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','lodash','crypto','desk.js','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'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x7fbd,0x194));var _0xd7fb=function(_0x9f8671,_0x434bbc){_0x9f8671=_0x9f8671-0x0;var _0x4208fa=_0x7fbd[_0x9f8671];return _0x4208fa;};'use strict';var emlformat=require(_0xd7fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7fb('0x1'));var jsonpatch=require(_0xd7fb('0x2'));var rp=require(_0xd7fb('0x3'));var moment=require(_0xd7fb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd7fb('0x5'));var path=require(_0xd7fb('0x6'));var sox=require(_0xd7fb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd7fb('0x8'));var _=require(_0xd7fb('0x9'));var squel=require('squel');var crypto=require(_0xd7fb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd7fb('0xb'));var toCsv=require(_0xd7fb('0xc'));var querystring=require(_0xd7fb('0xd'));var Papa=require(_0xd7fb('0xe'));var Redis=require(_0xd7fb('0xf'));var authService=require(_0xd7fb('0x10'));var qs=require(_0xd7fb('0x11'));var as=require(_0xd7fb('0x12'));var hardwareService=require(_0xd7fb('0x13'));var logger=require('../../config/logger')(_0xd7fb('0x14'));var utils=require('../../config/utils');var config=require(_0xd7fb('0x15'));var licenseUtil=require(_0xd7fb('0x16'));var db=require(_0xd7fb('0x17'))['db'];function respondWithStatusCode(_0x23ca66,_0x1ffe85){_0x1ffe85=_0x1ffe85||0xcc;return function(_0x3ca72c){if(_0x3ca72c){return _0x23ca66[_0xd7fb('0x18')](_0x1ffe85);}return _0x23ca66[_0xd7fb('0x19')](_0x1ffe85)[_0xd7fb('0x1a')]();};}function respondWithResult(_0x47cbae,_0x39a984){_0x39a984=_0x39a984||0xc8;return function(_0x306d11){if(_0x306d11){return _0x47cbae[_0xd7fb('0x19')](_0x39a984)[_0xd7fb('0x1b')](_0x306d11);}};}function respondWithFilteredResult(_0x4d5d4b,_0x20d42e){return function(_0xf1e701){if(_0xf1e701){var _0x28ff8c=typeof _0x20d42e[_0xd7fb('0x1c')]===_0xd7fb('0x1d')&&typeof _0x20d42e[_0xd7fb('0x1e')]===_0xd7fb('0x1d');var _0x22a30a=_0xf1e701['count'];var _0xf7ccf3=_0x28ff8c?0x0:_0x20d42e[_0xd7fb('0x1c')];var _0x65c7b=_0x28ff8c?_0xf1e701['count']:_0x20d42e[_0xd7fb('0x1c')]+_0x20d42e[_0xd7fb('0x1e')];var _0x3d644b;if(_0x65c7b>=_0x22a30a){_0x65c7b=_0x22a30a;_0x3d644b=0xc8;}else{_0x3d644b=0xce;}_0x4d5d4b[_0xd7fb('0x19')](_0x3d644b);return _0x4d5d4b[_0xd7fb('0x1f')]('Content-Range',_0xf7ccf3+'-'+_0x65c7b+'/'+_0x22a30a)['json'](_0xf1e701);}return null;};}function patchUpdates(_0x42990b){return function(_0x449989){try{jsonpatch[_0xd7fb('0x20')](_0x449989,_0x42990b,!![]);}catch(_0x2428dd){return BPromise['reject'](_0x2428dd);}return _0x449989['save']();};}function saveUpdates(_0x3bffb7,_0x7bb90d){return function(_0x7e3c16){if(_0x7e3c16){return _0x7e3c16[_0xd7fb('0x21')](_0x3bffb7)[_0xd7fb('0x22')](function(_0xed41a9){return _0xed41a9;});}return null;};}function removeEntity(_0x464977,_0x35990d){return function(_0xdabea0){if(_0xdabea0){return _0xdabea0[_0xd7fb('0x23')]()[_0xd7fb('0x22')](function(){var _0x2cccac=_0xdabea0[_0xd7fb('0x24')]({'plain':!![]});var _0x5181fb=_0xd7fb('0x25');return db[_0xd7fb('0x26')]['destroy']({'where':{'type':_0x5181fb,'resourceId':_0x2cccac['id']}})['then'](function(){return _0xdabea0;});})['then'](function(){_0x464977[_0xd7fb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d004d,_0x2bce9e){return function(_0x38c642){if(!_0x38c642){_0x2d004d['sendStatus'](0x194);}return _0x38c642;};}function handleError(_0x28793e,_0x2f1247){_0x2f1247=_0x2f1247||0x1f4;return function(_0x48b80c){logger[_0xd7fb('0x27')](_0x48b80c[_0xd7fb('0x28')]);if(_0x48b80c[_0xd7fb('0x29')]){delete _0x48b80c[_0xd7fb('0x29')];}_0x28793e['status'](_0x2f1247)['send'](_0x48b80c);};}exports['index']=function(_0x5cecc2,_0x580791){var _0x59f471={},_0x327089={},_0x21a992={'count':0x0,'rows':[]};return db[_0xd7fb('0x2a')][_0xd7fb('0x2b')]()[_0xd7fb('0x22')](function(_0x5b405e){_0x327089[_0xd7fb('0x2c')]=_[_0xd7fb('0x2d')](_0x5b405e);_0x327089[_0xd7fb('0x2e')]=_[_0xd7fb('0x2d')](_0x5cecc2[_0xd7fb('0x2e')]);_0x327089[_0xd7fb('0x2f')]=_[_0xd7fb('0x30')](_0x327089[_0xd7fb('0x2c')],_0x327089[_0xd7fb('0x2e')]);_0x59f471[_0xd7fb('0x31')]=_[_0xd7fb('0x30')](_0x327089[_0xd7fb('0x2c')],qs[_0xd7fb('0x32')](_0x5cecc2[_0xd7fb('0x2e')][_0xd7fb('0x32')]));_0x59f471[_0xd7fb('0x31')]=_0x59f471['attributes'][_0xd7fb('0x33')]?_0x59f471['attributes']:_0x327089[_0xd7fb('0x2c')];if(!_0x5cecc2[_0xd7fb('0x2e')][_0xd7fb('0x34')](_0xd7fb('0x35'))){_0x59f471[_0xd7fb('0x1e')]=qs[_0xd7fb('0x1e')](_0x5cecc2[_0xd7fb('0x2e')]['limit']);_0x59f471[_0xd7fb('0x1c')]=qs[_0xd7fb('0x1c')](_0x5cecc2[_0xd7fb('0x2e')][_0xd7fb('0x1c')]);}_0x59f471[_0xd7fb('0x36')]=qs['sort'](_0x5cecc2[_0xd7fb('0x2e')][_0xd7fb('0x37')]);_0x59f471['where']=qs[_0xd7fb('0x2f')](_['pick'](_0x5cecc2[_0xd7fb('0x2e')],_0x327089[_0xd7fb('0x2f')]),_0x5b405e);if(_0x5cecc2[_0xd7fb('0x2e')][_0xd7fb('0x38')]){_0x59f471[_0xd7fb('0x39')]=_[_0xd7fb('0x3a')](_0x59f471[_0xd7fb('0x39')],{'$or':_[_0xd7fb('0x3b')](_0x59f471[_0xd7fb('0x31')],function(_0x589244){var _0x522699={};_0x522699[_0x589244]={'$like':'%'+_0x5cecc2[_0xd7fb('0x2e')][_0xd7fb('0x38')]+'%'};return _0x522699;})});}_0x59f471=_[_0xd7fb('0x3a')]({},_0x59f471,_0x5cecc2[_0xd7fb('0x3c')]);var _0xd3e770={'where':_0x59f471['where']};return db[_0xd7fb('0x2a')][_0xd7fb('0x3d')](_0xd3e770)[_0xd7fb('0x22')](function(_0x2a79c6){_0x21a992[_0xd7fb('0x3d')]=_0x2a79c6;if(_0x5cecc2[_0xd7fb('0x2e')][_0xd7fb('0x3e')]){_0x59f471[_0xd7fb('0x3f')]=[{'all':!![]}];}return db[_0xd7fb('0x2a')][_0xd7fb('0x40')](_0x59f471);})[_0xd7fb('0x22')](function(_0x18d719){_0x21a992[_0xd7fb('0x41')]=_0x18d719;return _0x21a992;})['then'](respondWithFilteredResult(_0x580791,_0x59f471))[_0xd7fb('0x42')](handleError(_0x580791,null));})['catch'](handleError(_0x580791,null));};exports[_0xd7fb('0x43')]=function(_0x285180,_0x1838df){var _0x7de7de={'raw':![],'where':{'id':_0x285180[_0xd7fb('0x44')]['id']}},_0x11187a={};_0x11187a[_0xd7fb('0x2c')]=_[_0xd7fb('0x2d')](db['CmCompany'][_0xd7fb('0x45')]);_0x11187a['query']=_[_0xd7fb('0x2d')](_0x285180[_0xd7fb('0x2e')]);_0x11187a['filters']=_['intersection'](_0x11187a[_0xd7fb('0x2c')],_0x11187a[_0xd7fb('0x2e')]);_0x7de7de[_0xd7fb('0x31')]=_['intersection'](_0x11187a[_0xd7fb('0x2c')],qs[_0xd7fb('0x32')](_0x285180[_0xd7fb('0x2e')][_0xd7fb('0x32')]));_0x7de7de[_0xd7fb('0x31')]=_0x7de7de[_0xd7fb('0x31')][_0xd7fb('0x33')]?_0x7de7de[_0xd7fb('0x31')]:_0x11187a['model'];if(_0x285180[_0xd7fb('0x2e')][_0xd7fb('0x3e')]){_0x7de7de[_0xd7fb('0x3f')]=[{'all':!![]}];}_0x7de7de=_['merge']({},_0x7de7de,_0x285180[_0xd7fb('0x3c')]);return db[_0xd7fb('0x2a')][_0xd7fb('0x46')](_0x7de7de)['then'](handleEntityNotFound(_0x1838df,null))['then'](respondWithResult(_0x1838df,null))[_0xd7fb('0x42')](handleError(_0x1838df,null));};exports['create']=function(_0x9fba06,_0x3ba105){return db[_0xd7fb('0x2a')][_0xd7fb('0x47')](_0x9fba06[_0xd7fb('0x48')],{})['then'](function(_0x1cd1eb){var _0x59e897=_0x9fba06[_0xd7fb('0x49')][_0xd7fb('0x24')]({'plain':!![]});if(!_0x59e897)throw new Error(_0xd7fb('0x4a'));if(_0x59e897[_0xd7fb('0x4b')]==='user'){var _0x531d12=_0x1cd1eb[_0xd7fb('0x24')]({'plain':!![]});var _0x278838=_0xd7fb('0x25');return db[_0xd7fb('0x4c')][_0xd7fb('0x46')]({'where':{'name':_0x278838,'userProfileId':_0x59e897[_0xd7fb('0x4d')]},'raw':!![]})[_0xd7fb('0x22')](function(_0x412af6){if(_0x412af6&&_0x412af6[_0xd7fb('0x4e')]===0x0){return db[_0xd7fb('0x26')][_0xd7fb('0x47')]({'name':_0x531d12[_0xd7fb('0x29')],'resourceId':_0x531d12['id'],'type':_0x412af6['name'],'sectionId':_0x412af6['id']},{})[_0xd7fb('0x22')](function(){return _0x1cd1eb;});}else{return _0x1cd1eb;}})[_0xd7fb('0x42')](function(_0x3c1148){logger[_0xd7fb('0x27')](_0xd7fb('0x4f'),_0x3c1148);throw _0x3c1148;});}return _0x1cd1eb;})[_0xd7fb('0x22')](respondWithResult(_0x3ba105,0xc9))[_0xd7fb('0x42')](handleError(_0x3ba105,null));};exports[_0xd7fb('0x21')]=function(_0x3006a5,_0x143cce){if(_0x3006a5[_0xd7fb('0x48')]['id']){delete _0x3006a5[_0xd7fb('0x48')]['id'];}return db['CmCompany'][_0xd7fb('0x46')]({'where':{'id':_0x3006a5[_0xd7fb('0x44')]['id']}})[_0xd7fb('0x22')](handleEntityNotFound(_0x143cce,null))[_0xd7fb('0x22')](saveUpdates(_0x3006a5[_0xd7fb('0x48')],null))[_0xd7fb('0x22')](respondWithResult(_0x143cce,null))['catch'](handleError(_0x143cce,null));};exports['destroy']=function(_0x3ee44e,_0x57add8){return db[_0xd7fb('0x2a')][_0xd7fb('0x46')]({'where':{'id':_0x3ee44e[_0xd7fb('0x44')]['id']}})[_0xd7fb('0x22')](handleEntityNotFound(_0x57add8,null))[_0xd7fb('0x22')](removeEntity(_0x57add8,null))[_0xd7fb('0x42')](handleError(_0x57add8,null));};exports[_0xd7fb('0x2b')]=function(_0x13e623,_0x312da8){return db[_0xd7fb('0x2a')]['describe']()[_0xd7fb('0x22')](respondWithResult(_0x312da8,null))[_0xd7fb('0x42')](handleError(_0x312da8,null));};exports[_0xd7fb('0x50')]=function(_0x1ab3bf,_0x18062e,_0xda9190){return db[_0xd7fb('0x51')]['find']({'where':{'id':_0x1ab3bf[_0xd7fb('0x44')]['id']}})[_0xd7fb('0x22')](handleEntityNotFound(_0x18062e,null))[_0xd7fb('0x22')](function(_0x26a11b){if(_0x26a11b){return _0x26a11b[_0xd7fb('0x50')](_0x1ab3bf['body'][_0xd7fb('0x52')],_[_0xd7fb('0x53')](_0x1ab3bf[_0xd7fb('0x48')],['ids','id'])||{});}})[_0xd7fb('0x22')](respondWithResult(_0x18062e,null))[_0xd7fb('0x42')](handleError(_0x18062e,null));};exports['getContacts']=function(_0x4b6e2f,_0x2def46,_0x25ef29){var _0x4b7db3={};var _0x365e91={};var _0x15ea59;var _0x58861b;return db['CmCompany'][_0xd7fb('0x54')]({'where':{'id':_0x4b6e2f[_0xd7fb('0x44')]['id']}})[_0xd7fb('0x22')](handleEntityNotFound(_0x2def46,null))[_0xd7fb('0x22')](function(_0x25b4b3){if(_0x25b4b3){_0x15ea59=_0x25b4b3;_0x365e91[_0xd7fb('0x2c')]=_[_0xd7fb('0x2d')](db[_0xd7fb('0x51')][_0xd7fb('0x45')]);_0x365e91[_0xd7fb('0x2e')]=_[_0xd7fb('0x2d')](_0x4b6e2f['query']);_0x365e91[_0xd7fb('0x2f')]=_[_0xd7fb('0x30')](_0x365e91[_0xd7fb('0x2c')],_0x365e91['query']);_0x4b7db3['attributes']=_[_0xd7fb('0x30')](_0x365e91['model'],qs['fields'](_0x4b6e2f[_0xd7fb('0x2e')]['fields']));_0x4b7db3[_0xd7fb('0x31')]=_0x4b7db3[_0xd7fb('0x31')][_0xd7fb('0x33')]?_0x4b7db3[_0xd7fb('0x31')]:_0x365e91[_0xd7fb('0x2c')];_0x4b7db3['order']=qs[_0xd7fb('0x37')](_0x4b6e2f['query'][_0xd7fb('0x37')]);_0x4b7db3[_0xd7fb('0x39')]=qs[_0xd7fb('0x2f')](_[_0xd7fb('0x55')](_0x4b6e2f['query'],_0x365e91['filters']));if(_0x4b6e2f[_0xd7fb('0x2e')][_0xd7fb('0x38')]){_0x4b7db3[_0xd7fb('0x39')]=_[_0xd7fb('0x3a')](_0x4b7db3['where'],{'$or':_[_0xd7fb('0x3b')](_0x4b7db3[_0xd7fb('0x31')],function(_0xa70f15){var _0x473c90={};_0x473c90[_0xa70f15]={'$like':'%'+_0x4b6e2f[_0xd7fb('0x2e')][_0xd7fb('0x38')]+'%'};return _0x473c90;})});}_0x4b7db3=_['merge']({},_0x4b7db3,_0x4b6e2f[_0xd7fb('0x3c')]);return _0x15ea59[_0xd7fb('0x56')](_0x4b7db3);}})[_0xd7fb('0x22')](function(_0x1f757b){if(_0x1f757b){_0x58861b=_0x1f757b[_0xd7fb('0x33')];if(!_0x4b6e2f[_0xd7fb('0x2e')][_0xd7fb('0x34')](_0xd7fb('0x35'))){_0x4b7db3[_0xd7fb('0x1e')]=qs[_0xd7fb('0x1e')](_0x4b6e2f['query'][_0xd7fb('0x1e')]);_0x4b7db3[_0xd7fb('0x1c')]=qs[_0xd7fb('0x1c')](_0x4b6e2f[_0xd7fb('0x2e')]['offset']);}return _0x15ea59[_0xd7fb('0x56')](_0x4b7db3);}})[_0xd7fb('0x22')](function(_0x10fcc5){if(_0x10fcc5){return _0x10fcc5?{'count':_0x58861b,'rows':_0x10fcc5}:null;}})[_0xd7fb('0x22')](respondWithResult(_0x2def46,null))[_0xd7fb('0x42')](handleError(_0x2def46,null));};
\ No newline at end of file
index 75f2355..803b482 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0392=['cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x5e46c0,_0x6ff1c){var _0x4a0626=function(_0x447803){while(--_0x447803){_0x5e46c0['push'](_0x5e46c0['shift']());}};_0x4a0626(++_0x6ff1c);}(_0x0392,0xb5));var _0x2039=function(_0x1993d4,_0x19d988){_0x1993d4=_0x1993d4-0x0;var _0x12b9ab=_0x0392[_0x1993d4];return _0x12b9ab;};'use strict';var _=require(_0x2039('0x0'));var util=require(_0x2039('0x1'));var logger=require(_0x2039('0x2'))(_0x2039('0x3'));var moment=require('moment');var BPromise=require(_0x2039('0x4'));var rp=require(_0x2039('0x5'));var fs=require('fs');var path=require(_0x2039('0x6'));var rimraf=require('rimraf');var config=require(_0x2039('0x7'));var attributes=require(_0x2039('0x8'));module[_0x2039('0x9')]=function(_0x11278a,_0x5c29bb){return _0x11278a[_0x2039('0xa')]('CmCompany',attributes,{'tableName':_0x2039('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e7c=['./cmCompany.attributes','exports','define','CmCompany','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e7c,0x12d));var _0xc5e7=function(_0x5035e0,_0x1aa0bb){_0x5035e0=_0x5035e0-0x0;var _0x2ae78d=_0x5e7c[_0x5035e0];return _0x2ae78d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc5e7('0x0'))('api');var moment=require(_0xc5e7('0x1'));var BPromise=require(_0xc5e7('0x2'));var rp=require(_0xc5e7('0x3'));var fs=require('fs');var path=require(_0xc5e7('0x4'));var rimraf=require(_0xc5e7('0x5'));var config=require(_0xc5e7('0x6'));var attributes=require(_0xc5e7('0x7'));module[_0xc5e7('0x8')]=function(_0x111b62,_0x2d1884){return _0x111b62[_0xc5e7('0x9')](_0xc5e7('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd555b3..3b0bdf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaff4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xe32de5,_0x32d7c7){var _0x124277=function(_0x9deff2){while(--_0x9deff2){_0xe32de5['push'](_0xe32de5['shift']());}};_0x124277(++_0x32d7c7);}(_0xaff4,0xa2));var _0x4aff=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xaff4[_0x2459fd];return _0x364cd2;};'use strict';var _=require(_0x4aff('0x0'));var util=require(_0x4aff('0x1'));var moment=require(_0x4aff('0x2'));var BPromise=require(_0x4aff('0x3'));var rs=require(_0x4aff('0x4'));var fs=require('fs');var Redis=require(_0x4aff('0x5'));var db=require(_0x4aff('0x6'))['db'];var utils=require(_0x4aff('0x7'));var logger=require(_0x4aff('0x8'))(_0x4aff('0x9'));var config=require(_0x4aff('0xa'));var jayson=require(_0x4aff('0xb'));var client=jayson[_0x4aff('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10482b,_0x3e77cc,_0x834d1d){return new BPromise(function(_0x2b9387,_0x252c5d){return client[_0x4aff('0xd')](_0x10482b,_0x834d1d)[_0x4aff('0xe')](function(_0x56f52b){logger[_0x4aff('0xf')]('CmCompany,\x20%s,\x20%s',_0x3e77cc,'request\x20sent');logger['debug'](_0x4aff('0x10'),_0x3e77cc,_0x4aff('0x11'),JSON[_0x4aff('0x12')](_0x56f52b));if(_0x56f52b['error']){if(_0x56f52b[_0x4aff('0x13')]['code']===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x3e77cc,_0x56f52b[_0x4aff('0x13')]['message']);return _0x252c5d(_0x56f52b[_0x4aff('0x13')][_0x4aff('0x14')]);}logger[_0x4aff('0x13')](_0x4aff('0x15'),_0x3e77cc,_0x56f52b[_0x4aff('0x13')][_0x4aff('0x14')]);return _0x2b9387(_0x56f52b[_0x4aff('0x13')][_0x4aff('0x14')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x3e77cc,_0x4aff('0x11'));_0x2b9387(_0x56f52b[_0x4aff('0x16')][_0x4aff('0x14')]);}})[_0x4aff('0x17')](function(_0x5bcfde){logger[_0x4aff('0x13')](_0x4aff('0x15'),_0x3e77cc,_0x5bcfde);_0x252c5d(_0x5bcfde);});});}
\ No newline at end of file
+var _0x36a0=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCompany,\x20%s,\x20%s'];(function(_0x496d47,_0x20ef95){var _0x1881e6=function(_0x37f490){while(--_0x37f490){_0x496d47['push'](_0x496d47['shift']());}};_0x1881e6(++_0x20ef95);}(_0x36a0,0x7b));var _0x036a=function(_0x8257c,_0x360819){_0x8257c=_0x8257c-0x0;var _0x4b0f8e=_0x36a0[_0x8257c];return _0x4b0f8e;};'use strict';var _=require(_0x036a('0x0'));var util=require(_0x036a('0x1'));var moment=require(_0x036a('0x2'));var BPromise=require(_0x036a('0x3'));var rs=require(_0x036a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x036a('0x5'))['db'];var utils=require(_0x036a('0x6'));var logger=require(_0x036a('0x7'))(_0x036a('0x8'));var config=require(_0x036a('0x9'));var jayson=require(_0x036a('0xa'));var client=jayson['client'][_0x036a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7ee008,_0x295596,_0x1bd26b){return new BPromise(function(_0x30ea2c,_0x524d61){return client[_0x036a('0xc')](_0x7ee008,_0x1bd26b)[_0x036a('0xd')](function(_0x15c3e9){logger['info'](_0x036a('0xe'),_0x295596,'request\x20sent');logger['debug'](_0x036a('0xf'),_0x295596,_0x036a('0x10'),JSON[_0x036a('0x11')](_0x15c3e9));if(_0x15c3e9[_0x036a('0x12')]){if(_0x15c3e9[_0x036a('0x12')][_0x036a('0x13')]===0x1f4){logger[_0x036a('0x12')](_0x036a('0xe'),_0x295596,_0x15c3e9['error'][_0x036a('0x14')]);return _0x524d61(_0x15c3e9[_0x036a('0x12')]['message']);}logger[_0x036a('0x12')](_0x036a('0xe'),_0x295596,_0x15c3e9[_0x036a('0x12')][_0x036a('0x14')]);return _0x30ea2c(_0x15c3e9[_0x036a('0x12')][_0x036a('0x14')]);}else{logger[_0x036a('0x15')]('CmCompany,\x20%s,\x20%s',_0x295596,_0x036a('0x10'));_0x30ea2c(_0x15c3e9[_0x036a('0x16')][_0x036a('0x14')]);}})['catch'](function(_0x5e1c40){logger['error']('CmCompany,\x20%s,\x20%s',_0x295596,_0x5e1c40);_0x524d61(_0x5e1c40);});});}
\ No newline at end of file
index 9b44e03..bb39a7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00f2=['express','Router','fs-extra','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','create','post','put','update','delete','destroy','util','connect-timeout'];(function(_0x251b53,_0x5e3392){var _0x3d723f=function(_0x108b2a){while(--_0x108b2a){_0x251b53['push'](_0x251b53['shift']());}};_0x3d723f(++_0x5e3392);}(_0x00f2,0x1e1));var _0x200f=function(_0x208a39,_0xd93d86){_0x208a39=_0x208a39-0x0;var _0x1c2c65=_0x00f2[_0x208a39];return _0x1c2c65;};'use strict';var multer=require('multer');var util=require(_0x200f('0x0'));var path=require('path');var timeout=require(_0x200f('0x1'));var express=require(_0x200f('0x2'));var router=express[_0x200f('0x3')]();var fs_extra=require(_0x200f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x200f('0x5'));var config=require('../../config/environment');var controller=require(_0x200f('0x6'));router[_0x200f('0x7')]('/',auth[_0x200f('0x8')](),controller[_0x200f('0x9')]);router[_0x200f('0x7')](_0x200f('0xa'),auth[_0x200f('0x8')](),controller[_0x200f('0xb')]);router['get'](_0x200f('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x200f('0xd'),auth[_0x200f('0x8')](),controller[_0x200f('0xe')]);router['post']('/',auth[_0x200f('0x8')](),controller[_0x200f('0xf')]);router[_0x200f('0x10')]('/:id/contacts',auth[_0x200f('0x8')](),controller['addContacts']);router[_0x200f('0x11')](_0x200f('0xc'),auth[_0x200f('0x8')](),controller[_0x200f('0x12')]);router[_0x200f('0x13')](_0x200f('0xc'),auth[_0x200f('0x8')](),controller[_0x200f('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x900c=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','describe','/:id/contacts','getContacts','post','addContacts','/:id'];(function(_0x17832d,_0x40a546){var _0x597e13=function(_0x2e98e2){while(--_0x2e98e2){_0x17832d['push'](_0x17832d['shift']());}};_0x597e13(++_0x40a546);}(_0x900c,0x134));var _0xc900=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x900c[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc900('0x0'));var util=require('util');var path=require(_0xc900('0x1'));var timeout=require(_0xc900('0x2'));var express=require(_0xc900('0x3'));var router=express[_0xc900('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc900('0x5'));var controller=require('./cmCompany.controller');router[_0xc900('0x6')]('/',auth[_0xc900('0x7')](),controller[_0xc900('0x8')]);router[_0xc900('0x6')]('/describe',auth[_0xc900('0x7')](),controller[_0xc900('0x9')]);router['get']('/:id',auth[_0xc900('0x7')](),controller['show']);router['get'](_0xc900('0xa'),auth['isAuthenticated'](),controller[_0xc900('0xb')]);router[_0xc900('0xc')]('/',auth[_0xc900('0x7')](),controller['create']);router[_0xc900('0xc')]('/:id/contacts',auth[_0xc900('0x7')](),controller[_0xc900('0xd')]);router['put'](_0xc900('0xe'),auth[_0xc900('0x7')](),controller[_0xc900('0xf')]);router[_0xc900('0x10')](_0xc900('0xe'),auth[_0xc900('0x7')](),controller[_0xc900('0x11')]);module[_0xc900('0x12')]=router;
\ No newline at end of file
index 600f4f3..843489a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc991=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x1a89ca,_0x27394b){var _0x29cbb2=function(_0x31e1f4){while(--_0x31e1f4){_0x1a89ca['push'](_0x1a89ca['shift']());}};_0x29cbb2(++_0x27394b);}(_0xc991,0x14e));var _0x1c99=function(_0xeda42e,_0x259fae){_0xeda42e=_0xeda42e-0x0;var _0x33aa69=_0xc991[_0xeda42e];return _0x33aa69;};'use strict';var _=require(_0x1c99('0x0'));var Sequelize=require(_0x1c99('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x1c99('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1c99('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1c99('0x2')]},'city':{'type':Sequelize[_0x1c99('0x2')]},'country':{'type':Sequelize[_0x1c99('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1c99('0x2')]},'description':{'type':Sequelize[_0x1c99('0x3')]},'phone':{'type':Sequelize[_0x1c99('0x2')]},'mobile':{'type':Sequelize[_0x1c99('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x1c99('0x2')]},'fb_data':{'type':Sequelize[_0x1c99('0x2')]},'twitter':{'type':Sequelize[_0x1c99('0x2')]},'skype':{'type':Sequelize[_0x1c99('0x2')]},'teams':{'type':Sequelize[_0x1c99('0x2')]},'viber':{'type':Sequelize[_0x1c99('0x2')]},'line':{'type':Sequelize[_0x1c99('0x2')]},'wechat':{'type':Sequelize[_0x1c99('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1c99('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1c99('0x4')](0x2)[_0x1c99('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1c99('0x6')],'defaultValue':Sequelize[_0x1c99('0x7')]},'dialTimezone':{'type':Sequelize[_0x1c99('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0b0e=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x2f27bf,_0x26183b){var _0x4ef755=function(_0x19be8e){while(--_0x19be8e){_0x2f27bf['push'](_0x2f27bf['shift']());}};_0x4ef755(++_0x26183b);}(_0x0b0e,0x187));var _0xe0b0=function(_0xed4881,_0x45771c){_0xed4881=_0xed4881-0x0;var _0x7fcbd5=_0x0b0e[_0xed4881];return _0x7fcbd5;};'use strict';var _=require(_0xe0b0('0x0'));var Sequelize=require('sequelize');module[_0xe0b0('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b0('0x2')]},'street':{'type':Sequelize[_0xe0b0('0x2')]},'postalCode':{'type':Sequelize[_0xe0b0('0x2')]},'city':{'type':Sequelize[_0xe0b0('0x2')]},'country':{'type':Sequelize[_0xe0b0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe0b0('0x2')]},'description':{'type':Sequelize[_0xe0b0('0x3')]},'phone':{'type':Sequelize[_0xe0b0('0x2')]},'mobile':{'type':Sequelize[_0xe0b0('0x2')]},'fax':{'type':Sequelize[_0xe0b0('0x2')]},'email':{'type':Sequelize[_0xe0b0('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe0b0('0x2')]},'twitter':{'type':Sequelize[_0xe0b0('0x2')]},'skype':{'type':Sequelize[_0xe0b0('0x2')]},'teams':{'type':Sequelize[_0xe0b0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe0b0('0x2')]},'wechat':{'type':Sequelize[_0xe0b0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b0('0x4')]},'priority':{'type':Sequelize[_0xe0b0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':Sequelize[_0xe0b0('0x6')]},'dialTimezone':{'type':Sequelize[_0xe0b0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index bc36df0..1dd692d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb503=['conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','buildExpression','end','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','SELECT','clone','c.id','having','t.id\x20IN\x20?','resolve','user','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','destroy','params','startsWith','columnName','displayName','alias','custom','hasOwnProperty','body','get','tags','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatOfflineMessage','update','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','dialTimezone','utcOffset','additionalPhones','duplicates','$or','findOrCreate','spread','contact','show','name','Phones','ContactItemType','ItemType','literal','CmCustomField','format','cf_%d','timezones','$and','findAll','omit','pickBy','table','cm_contacts','setFields','id\x20=\x20?','text','phone','getTags','rawAttributes','options','setTags','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','item','PHONE','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','CmContactId','toContactId','hopperId','getHoppers','ContactId','include','rows','getHopperFinals','includeAll','getJscriptySessions','No\x20ListId\x20specified','binding_keys','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','parse','meta','import','binding','fork','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','No\x20phone\x20column\x20specified','../../components/import/cm/csvUpdates','stringify','getJourney','mail','sms','openchannel','fax','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','uniqueid','callerid','endtime','duration','createdAt','userSecondDisposition','UserId','DESC','VoiceCallReport','findAndCountAll','fullname','startCase','chat','Website','closed','closedAt','note','secondDisposition','thirdDisposition','Account','key','Owner','color','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','substatus','externalUrl','threadId','Interaction','flatten','slice','moment','bluebird','util','path','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','then','sendStatus','error','send','index','CmContact','describe','keys','length','cf_','push','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','tools_tags','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','parseSearch','sqlOperator'];(function(_0x581aec,_0x497303){var _0x33461d=function(_0x40f74f){while(--_0x40f74f){_0x581aec['push'](_0x581aec['shift']());}};_0x33461d(++_0x497303);}(_0xb503,0xec));var _0x3b50=function(_0x47bd63,_0xb115ec){_0x47bd63=_0x47bd63-0x0;var _0x70dcee=_0xb503[_0x47bd63];return _0x70dcee;};'use strict';var moment=require(_0x3b50('0x0'));var BPromise=require(_0x3b50('0x1'));var util=require(_0x3b50('0x2'));var path=require(_0x3b50('0x3'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require(_0x3b50('0x4'));var Redis=require(_0x3b50('0x5'));var qs=require('../../components/parsers/qs');var as=require(_0x3b50('0x6'));var logger=require(_0x3b50('0x7'))('api');var config=require('../../config/environment');var shared=require(_0x3b50('0x8'));var db=require(_0x3b50('0x9'))['db'];config[_0x3b50('0xa')]=_[_0x3b50('0xb')](config[_0x3b50('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b50('0xc'))(new Redis(config[_0x3b50('0xa')]));require(_0x3b50('0xd'))[_0x3b50('0xe')](socket);function respondWithResult(_0x361dca,_0x340708){_0x340708=_0x340708||0xc8;return function(_0x504c91){if(_0x504c91){return _0x361dca[_0x3b50('0xf')](_0x340708)[_0x3b50('0x10')](_0x504c91);}};}function respondWithFilteredResult(_0x343bd4,_0x534b8f){return function(_0x3066d6){if(_0x3066d6){var _0x5690a6=typeof _0x534b8f[_0x3b50('0x11')]===_0x3b50('0x12')&&typeof _0x534b8f[_0x3b50('0x13')]==='undefined';var _0x290e7e=_0x3066d6['count'];var _0x1de1f8=_0x5690a6?0x0:_0x534b8f['offset'];var _0x1a8bbe=_0x5690a6?_0x3066d6[_0x3b50('0x14')]:_0x534b8f[_0x3b50('0x11')]+_0x534b8f[_0x3b50('0x13')];var _0x2e7425;if(_0x1a8bbe>=_0x290e7e){_0x1a8bbe=_0x290e7e;_0x2e7425=0xc8;}else{_0x2e7425=0xce;}_0x343bd4[_0x3b50('0xf')](_0x2e7425);return _0x343bd4['set'](_0x3b50('0x15'),_0x1de1f8+'-'+_0x1a8bbe+'/'+_0x290e7e)[_0x3b50('0x10')](_0x3066d6);}return null;};}function saveUpdates(_0x24ba10){return function(_0x3be98e){if(_0x3be98e){return _0x3be98e['update'](_0x24ba10)[_0x3b50('0x16')](function(_0x34cb06){return _0x34cb06;});}return null;};}function removeEntity(_0x5a755d){return function(_0x4a980d){if(_0x4a980d){return _0x4a980d['destroy']()['then'](function(){_0x5a755d[_0x3b50('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33fa8a){return function(_0x5bafd9){if(!_0x5bafd9){_0x33fa8a[_0x3b50('0x17')](0x194);}return _0x5bafd9;};}function handleError(_0x22dab2,_0x7f4c7e){_0x7f4c7e=_0x7f4c7e||0x1f4;return function(_0xdd7f9){logger[_0x3b50('0x18')](_0xdd7f9['stack']);if(_0xdd7f9['name']){delete _0xdd7f9['name'];}_0x22dab2[_0x3b50('0xf')](_0x7f4c7e)[_0x3b50('0x19')](_0xdd7f9);};}exports[_0x3b50('0x1a')]=function(_0x1f8ed3,_0x2fb9b3){var _0x81a17f={},_0x1e78b6={},_0xc5a3b5={'count':0x0,'rows':[]};return db[_0x3b50('0x1b')][_0x3b50('0x1c')]()[_0x3b50('0x16')](function(_0x1d0935){var _0x3820c8=[];for(var _0x1f5b82=0x0;_0x1f5b82<Object[_0x3b50('0x1d')](_0x1d0935)[_0x3b50('0x1e')];_0x1f5b82++){var _0x561126=Object[_0x3b50('0x1d')](_0x1d0935)[_0x1f5b82];if(_['startsWith'](_0x561126,_0x3b50('0x1f'))){_0x3820c8[_0x3b50('0x20')](db['CmCustomField'][_0x3b50('0x21')]({'where':{'id':_[_0x3b50('0x22')](_0x561126,_0x3b50('0x1f'))},'raw':!![]}));}}return BPromise[_0x3b50('0x23')](_0x3820c8)[_0x3b50('0x16')](function(_0x50a41a){for(var _0x43b281=0x0;_0x43b281<_0x50a41a[_0x3b50('0x1e')];_0x43b281++){if(_0x50a41a[_0x43b281]){var _0x42207e=_0x3b50('0x1f')+_0x50a41a[_0x43b281]['id'];var _0xd43261=_0x1d0935[_0x42207e];_0xd43261[_0x3b50('0x24')]=_0x50a41a[_0x43b281][_0x3b50('0x25')];}}return _0x1d0935;});})[_0x3b50('0x16')](function(_0x1446f4){_0x1e78b6[_0x3b50('0x26')]=_[_0x3b50('0x1d')](_0x1446f4);_0x1e78b6[_0x3b50('0x27')]=_[_0x3b50('0x1d')](_0x1f8ed3[_0x3b50('0x27')]);_0x1e78b6[_0x3b50('0x28')]=_[_0x3b50('0x29')](_0x1e78b6[_0x3b50('0x26')],_0x1e78b6[_0x3b50('0x27')]);_0x81a17f[_0x3b50('0x2a')]=_[_0x3b50('0x29')](_0x1e78b6[_0x3b50('0x26')],qs['fields'](_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x2b')]));_0x81a17f['attributes']=_0x81a17f[_0x3b50('0x2a')][_0x3b50('0x1e')]?_0x81a17f[_0x3b50('0x2a')]:_0x1e78b6[_0x3b50('0x26')];if(!_0x1f8ed3[_0x3b50('0x27')]['hasOwnProperty'](_0x3b50('0x2c'))){_0x81a17f[_0x3b50('0x13')]=qs[_0x3b50('0x13')](_0x1f8ed3['query']['limit']);_0x81a17f['offset']=qs['offset'](_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x11')]);}_0x81a17f[_0x3b50('0x2d')]=qs[_0x3b50('0x2e')](_0x1f8ed3[_0x3b50('0x27')]['sort']);_0x81a17f[_0x3b50('0x2f')]=qs['filters'](_[_0x3b50('0x30')](_0x1f8ed3[_0x3b50('0x27')],_0x1e78b6[_0x3b50('0x28')]),_0x1446f4);var _0x8d7832=[];var _0x16c34c=squel[_0x3b50('0x31')]()['field']('id')[_0x3b50('0x32')]('name')[_0x3b50('0x32')]('color')['from'](_0x3b50('0x33'));var _0x3d3d94=squel['select']()[_0x3b50('0x34')]('cm_contacts','c')[_0x3b50('0x35')](_0x3b50('0x36'),'uc',_0x3b50('0x37'))[_0x3b50('0x35')](_0x3b50('0x38'),'ct',_0x3b50('0x39'))[_0x3b50('0x35')](_0x3b50('0x33'),'t',_0x3b50('0x3a'))['where']('c.deletedAt\x20IS\x20NULL');var _0x54781b=squel[_0x3b50('0x3b')]();var _0x2c510c=[];var _0x59cee9=squel[_0x3b50('0x3b')]();var _0x251eac;if(_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x3c')]){_0x251eac=as[_0x3b50('0x3d')](_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x3c')]);var _0x572e3a=_0x251eac[_0x3b50('0x3e')];for(var _0x565570=0x0;_0x565570<_0x251eac['conditions'][_0x3b50('0x1e')];_0x565570++){var _0x1300aa=_0x251eac[_0x3b50('0x3f')][_0x565570];var _0x285ea3='c';var _0x108e8c=_(_0x1446f4)[_0x3b50('0x1d')]()[_0x3b50('0x40')](function(_0x4e1cb8){return _0x4e1cb8===_0x1300aa[_0x3b50('0x32')];});if(_0x108e8c)_0x108e8c=_0x1446f4[_0x1300aa[_0x3b50('0x32')]];if(!_0x108e8c){if(_0x1300aa[_0x3b50('0x32')]===_0x3b50('0x41')){var _0x4b2f67=_0x1300aa[_0x3b50('0x42')][_0x3b50('0x43')](',')[_0x3b50('0x44')](function(_0x243557){return Number(_0x243557);});_0x4b2f67[_0x3b50('0x45')](function(_0x23f919){_0x59cee9['or'](_0x3b50('0x46'),'%,'+_0x23f919+',%');});_0x2c510c=_['union'](_0x2c510c,_0x4b2f67);}else if(_0x1300aa['field']==='User'){_0x54781b[_0x3b50('0x47')](_0x3b50('0x48'),_0x1300aa[_0x3b50('0x42')]);}}else{if(_0x1300aa[_0x3b50('0x32')]==='dateOfBirth'||_0x108e8c[_0x3b50('0x24')]===_0x3b50('0x49'))_0x1300aa[_0x3b50('0x4a')]=_0x3b50('0x4b');var _0x48bec6=as[_0x3b50('0x4c')](_0x285ea3,_0x108e8c['type'],_0x1300aa);_0x54781b[_0x572e3a](_0x48bec6['text'],_0x48bec6[_0x3b50('0x42')]['start'],_0x48bec6[_0x3b50('0x42')][_0x3b50('0x4d')]);}}}else{var _0x353703=_(Object[_0x3b50('0x1d')](_0x1f8ed3[_0x3b50('0x27')]))[_0x3b50('0x44')](function(_0x3c6b8c){return _0x1446f4['hasOwnProperty'](_0x3c6b8c)?_0x3c6b8c:undefined;})[_0x3b50('0x4e')](function(_0x5210f6){return!_[_0x3b50('0x4f')](_0x5210f6);})[_0x3b50('0x42')]();if(_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x50')])_0x353703[_0x3b50('0x20')](_0x3b50('0x50'));if(!_[_0x3b50('0x51')](_0x353703)){_0x353703[_0x3b50('0x45')](function(_0x5ceadd){if(_0x5ceadd===_0x3b50('0x52')){_0x3d3d94[_0x3b50('0x2f')](_0x3b50('0x53'),[]['concat'](_0x1f8ed3['query'][_0x5ceadd]));}else if(_0x5ceadd===_0x3b50('0x50')){var _0x2448f8='%'+_0x1f8ed3[_0x3b50('0x27')][_0x5ceadd]+'%';_0x3d3d94[_0x3b50('0x2f')](_0x3b50('0x54'),_0x2448f8);}else{_0x3d3d94[_0x3b50('0x2f')]('c.'+_0x5ceadd+'\x20=\x20?',_0x1f8ed3[_0x3b50('0x27')][_0x5ceadd]);}});}if(_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x55')]){_0x2c510c=_[_0x3b50('0x56')](_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x55')])?_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x55')]:new Array(_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x55')]);_0x2c510c['forEach'](function(_0x5b1983){_0x59cee9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5b1983+',%');});}if(_0x1f8ed3['query'][_0x3b50('0x4e')]){var _0x536693=_0x1f8ed3['query'][_0x3b50('0x4e')][_0x3b50('0x57')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x536693[_0x3b50('0x43')]('\x20')['length']>0x1){_0x54781b['or'](_0x3b50('0x58'),qs[_0x3b50('0x59')](_0x536693),null);}else{if(qs[_0x3b50('0x5a')](_0x536693)){_0x54781b['or']('c.id\x20LIKE\x20?',_0x536693+'%');_0x54781b['or'](_0x3b50('0x5b'),_0x536693+'%');_0x54781b['or'](_0x3b50('0x5c'),_0x536693+'%');_0x54781b['or'](_0x3b50('0x5d'),_0x536693+'%');}else if(qs[_0x3b50('0x5e')](_0x536693)){_0x54781b['or']('c.email\x20LIKE\x20?',_0x536693+'%');}else{_0x54781b['or'](_0x3b50('0x5f'),'%'+_0x536693+'%');_0x54781b['or'](_0x3b50('0x60'),'%'+_0x536693+'%');_0x54781b['or'](_0x3b50('0x61'),'%'+_0x536693+'%');}}}}_0x3d3d94[_0x3b50('0x2f')](_0x54781b);_0x3d3d94[_0x3b50('0x62')]('c.id');var _0x292150={'type':db['Sequelize']['QueryTypes'][_0x3b50('0x63')],'raw':!![]};var _0x1fb67a=_0x3d3d94[_0x3b50('0x64')]()[_0x3b50('0x32')](_0x3b50('0x65'));if(_0x81a17f[_0x3b50('0x2d')]){_0x81a17f['order'][_0x3b50('0x45')](function(_0x4f261){_0x3d3d94['order']('c.'+_0x4f261[0x0],_0x4f261[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3b50('0x51')](_0x2c510c)){_0x3d3d94[_0x3b50('0x66')](_0x59cee9);_0x1fb67a[_0x3b50('0x2f')](_0x3b50('0x67'),_0x2c510c);}BPromise[_0x3b50('0x68')]()[_0x3b50('0x16')](function(){if(!_0x251eac)return;if(_0x1f8ed3[_0x3b50('0x69')][_0x3b50('0x6a')]!==_0x3b50('0x6b'))return;if(!_[_0x3b50('0x6c')](_0x251eac[_0x3b50('0x3f')],['field',_0x3b50('0x6d')])){return _0x1f8ed3[_0x3b50('0x69')][_0x3b50('0x6e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x10e34c){if(_[_0x3b50('0x51')](_0x10e34c)){_0x1fb67a[_0x3b50('0x2f')]('c.ListId\x20IS\x20NULL');_0x3d3d94[_0x3b50('0x2f')](_0x3b50('0x6f'));}else{_0x1fb67a[_0x3b50('0x2f')](_0x3b50('0x53'),_['map'](_0x10e34c,'id'));_0x3d3d94[_0x3b50('0x2f')](_0x3b50('0x53'),_[_0x3b50('0x44')](_0x10e34c,'id'));}});}})[_0x3b50('0x16')](function(){if(_0x1f8ed3[_0x3b50('0x69')][_0x3b50('0x6a')]==='agent'&&!_0x251eac&&!_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x52')])return[];return db[_0x3b50('0x70')][_0x3b50('0x27')](_0x1fb67a[_0x3b50('0x71')](),_0x292150);})[_0x3b50('0x16')](function(_0x8d6267){_0xc5a3b5['count']=_0x8d6267[_0x3b50('0x1e')];if(_0xc5a3b5[_0x3b50('0x14')]===0x0)return[];return db[_0x3b50('0x70')][_0x3b50('0x27')](_0x16c34c[_0x3b50('0x71')](),_0x292150)[_0x3b50('0x16')](function(_0x480177){_0x8d7832=_[_0x3b50('0x72')](_0x480177,'id');_0x292150=_[_0x3b50('0x73')](_0x292150,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1f8ed3[_0x3b50('0x27')][_0x3b50('0x2b')]){_0x81a17f[_0x3b50('0x2a')][_0x3b50('0x45')](function(_0x501e88){_0x3d3d94[_0x3b50('0x32')]('c.'+_0x501e88);});}else{_0x3d3d94[_0x3b50('0x32')](_0x3b50('0x65'));_0x3d3d94[_0x3b50('0x32')](_0x3b50('0x74'));_0x3d3d94[_0x3b50('0x32')](_0x3b50('0x75'));_0x3d3d94[_0x3b50('0x32')]('c.phone');_0x3d3d94[_0x3b50('0x32')]('c.mobile');_0x3d3d94[_0x3b50('0x32')]('c.fax');_0x3d3d94[_0x3b50('0x32')](_0x3b50('0x76'));_0x3d3d94[_0x3b50('0x32')](_0x3b50('0x77'));_0x3d3d94[_0x3b50('0x32')]('c.createdAt');_0x3d3d94[_0x3b50('0x32')](_0x3b50('0x78'));_0x3d3d94[_0x3b50('0x32')](_0x3b50('0x79'));_0x3d3d94[_0x3b50('0x32')](_0x3b50('0x7a'),'TagIds');}if(_0x81a17f[_0x3b50('0x13')])_0x3d3d94[_0x3b50('0x13')](_0x81a17f['limit']);if(_0x81a17f['offset'])_0x3d3d94[_0x3b50('0x11')](_0x81a17f['offset']);return db[_0x3b50('0x70')][_0x3b50('0x27')](_0x3d3d94[_0x3b50('0x71')](),_0x292150);});})[_0x3b50('0x16')](function(_0x5635c9){_0x5635c9['forEach'](function(_0x1c77a5){if(_0x1c77a5[_0x3b50('0x7b')]){_0x1c77a5[_0x3b50('0x7c')]=[];_0x1c77a5[_0x3b50('0x7b')][_0x3b50('0x43')](',')[_0x3b50('0x45')](function(_0x134a37){_0x1c77a5['Tags'][_0x3b50('0x20')](_0x8d7832[_0x134a37]);});}delete _0x1c77a5[_0x3b50('0x7b')];});_0xc5a3b5['rows']=_0x5635c9;return _0xc5a3b5;})[_0x3b50('0x16')](respondWithFilteredResult(_0x2fb9b3,_0x81a17f));})[_0x3b50('0x7d')](handleError(_0x2fb9b3,null));};exports[_0x3b50('0x7e')]=function(_0x348173,_0x4590c0){return db[_0x3b50('0x1b')][_0x3b50('0x40')]({'where':{'id':_0x348173[_0x3b50('0x7f')]['id']}})['then'](handleEntityNotFound(_0x4590c0,null))[_0x3b50('0x16')](removeEntity(_0x4590c0,null))['catch'](handleError(_0x4590c0,null));};exports[_0x3b50('0x1c')]=function(_0x29f836,_0x3794b9){return db[_0x3b50('0x1b')][_0x3b50('0x1c')]()['then'](function(_0xa330b){delete _0xa330b['tags'];for(var _0x3d8430=0x0;_0x3d8430<Object[_0x3b50('0x1d')](_0xa330b)[_0x3b50('0x1e')];_0x3d8430++){var _0x4e6293=Object[_0x3b50('0x1d')](_0xa330b)[_0x3d8430];if(!_[_0x3b50('0x80')](_0x4e6293,_0x3b50('0x1f'))){_0xa330b[_0x4e6293][_0x3b50('0x81')]=_0x4e6293;_0xa330b[_0x4e6293]['displayName']=_0x4e6293;}}return _0xa330b;})[_0x3b50('0x16')](function(_0x5de61e){var _0x4f9850={'where':Boolean(_0x29f836[_0x3b50('0x27')]['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x29f836[_0x3b50('0x27')]['id']},{'ListId':null}]},'raw':!![]};return db['CmCustomField']['findAll'](_0x4f9850)[_0x3b50('0x16')](function(_0x1370f9){for(var _0xb4384e=0x0;_0xb4384e<_0x1370f9[_0x3b50('0x1e')];_0xb4384e++){var _0x52c38a=_0x3b50('0x1f')+_0x1370f9[_0xb4384e]['id'];_0x5de61e[_0x52c38a]['columnName']=_0x52c38a;_0x5de61e[_0x52c38a][_0x3b50('0x82')]=_0x1370f9[_0xb4384e][_0x3b50('0x83')];_0x5de61e[_0x52c38a][_0x3b50('0x84')]={'type':_0x1370f9[_0xb4384e][_0x3b50('0x25')],'values':_0x1370f9[_0xb4384e]['values']};}Object['keys'](_0x5de61e)[_0x3b50('0x45')](function(_0x1df4f2){if(!_0x5de61e[_0x1df4f2][_0x3b50('0x85')](_0x3b50('0x81'))){delete _0x5de61e[_0x1df4f2];}});return _0x5de61e;});})[_0x3b50('0x16')](respondWithResult(_0x3794b9,null))[_0x3b50('0x7d')](handleError(_0x3794b9,null));};exports[_0x3b50('0x73')]=function(_0x2eba8f,_0x37a589){var _0x251305;var _0x4d7409;var _0x4049bc;if(_0x2eba8f[_0x3b50('0x86')]['id']){delete _0x2eba8f[_0x3b50('0x86')]['id'];}return db[_0x3b50('0x1b')]['findAll']({'where':{'id':[_0x2eba8f[_0x3b50('0x86')]['to'],_0x2eba8f[_0x3b50('0x86')][_0x3b50('0x34')]]}})['then'](function(_0x31f5c3){if(_0x31f5c3){if(_0x31f5c3[_0x3b50('0x1e')]!==0x2){return null;}_0x31f5c3[0x0]=_0x31f5c3[0x0][_0x3b50('0x87')]({'plain':!![]});_0x31f5c3[0x1]=_0x31f5c3[0x1][_0x3b50('0x87')]({'plain':!![]});delete _0x31f5c3[0x0]['id'];delete _0x31f5c3[0x1]['id'];return _['mergeWith'](_0x31f5c3[0x0],_0x31f5c3[0x1],function(_0x1e4a1a,_0x3915b9){if(Array['isArray'](_0x3915b9)&&!_0x3915b9[_0x3b50('0x1e')]){return _0x1e4a1a;}else if(!_0x3915b9){return _0x1e4a1a;}});}})[_0x3b50('0x16')](handleEntityNotFound(_0x37a589,null))[_0x3b50('0x16')](function(_0x3c08a3){if(_0x3c08a3){if(_0x3c08a3[_0x3b50('0x88')]&&_[_0x3b50('0x56')](_0x3c08a3[_0x3b50('0x88')])){_0x3c08a3[_0x3b50('0x88')]=_0x3c08a3[_0x3b50('0x88')][_0x3b50('0x89')]();}logger[_0x3b50('0x8a')]('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x2eba8f[_0x3b50('0x86')]['to'],_0x2eba8f[_0x3b50('0x86')]['from']);return db[_0x3b50('0x8b')]['destroy']({'where':{'ContactId':[_0x2eba8f[_0x3b50('0x86')]['to'],_0x2eba8f[_0x3b50('0x86')]['from']]}})[_0x3b50('0x16')](function(_0x4a035f){logger[_0x3b50('0x8a')](_0x3b50('0x8c'),_0x4a035f);return db[_0x3b50('0x8d')][_0x3b50('0x7e')]({'where':{'ContactId':[_0x2eba8f[_0x3b50('0x86')]['to'],_0x2eba8f[_0x3b50('0x86')]['from']]}})[_0x3b50('0x16')](function(_0x8d2a3e){logger[_0x3b50('0x8a')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x8d2a3e);return db['CmContact'][_0x3b50('0x8e')](_0x3c08a3);});});}})['then'](function(_0x533726){if(_0x533726){_0x251305=_0x533726;_0x4d7409={'ContactId':_0x251305['id']};_0x4049bc={'where':{'ContactId':[_0x2eba8f[_0x3b50('0x86')]['to'],_0x2eba8f[_0x3b50('0x86')][_0x3b50('0x34')]]}};return db['ChatInteraction']['update'](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db['ChatMessage']['update'](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x8f')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x91')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x92')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})['then'](function(){if(_0x251305){return db[_0x3b50('0x91')]['update'](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x92')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x93')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x94')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})['then'](function(){if(_0x251305){return db['FaxInteraction'][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db['FaxMessage'][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})['then'](function(){if(_0x251305){return db[_0x3b50('0x95')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db['OpenchannelMessage'][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x96')][_0x3b50('0x90')]({'CmContactId':_0x251305['id']},{'where':{'CmContactId':[_0x2eba8f[_0x3b50('0x86')]['to'],_0x2eba8f[_0x3b50('0x86')][_0x3b50('0x34')]]}});}})['then'](function(){if(_0x251305){return db[_0x3b50('0x97')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x98')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db['ReportAgentPreview']['update'](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db['VoiceCallReport']['update'](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db['ChatQueueReport'][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})['then'](function(){if(_0x251305){return db[_0x3b50('0x99')]['update'](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x9a')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x9b')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})['then'](function(){if(_0x251305){return db[_0x3b50('0x9c')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x9d')][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db[_0x3b50('0x9e')]['update'](_0x4d7409,_0x4049bc);}})['then'](function(){if(_0x251305){return db['WhatsappMessage']['update'](_0x4d7409,_0x4049bc);}})[_0x3b50('0x16')](function(){if(_0x251305){return db['WhatsappQueueReport'][_0x3b50('0x90')](_0x4d7409,_0x4049bc);}})['then'](function(){if(_0x251305){return db[_0x3b50('0x1b')][_0x3b50('0x7e')]({'where':{'id':[_0x2eba8f['body']['to'],_0x2eba8f[_0x3b50('0x86')][_0x3b50('0x34')]]}});}})['then'](function(){if(_0x251305){return _0x251305;}})[_0x3b50('0x16')](respondWithResult(_0x37a589,null))[_0x3b50('0x7d')](handleError(_0x37a589,null));};exports[_0x3b50('0x8e')]=function(_0x2eccff,_0x1caca7){return db['CmContact']['describe']()[_0x3b50('0x16')](function(_0x52ca1d){if(_0x2eccff[_0x3b50('0x86')][_0x3b50('0x88')]&&_[_0x3b50('0x56')](_0x2eccff[_0x3b50('0x86')][_0x3b50('0x88')])){if(_0x2eccff['body'][_0x3b50('0x88')][_0x3b50('0x1e')]){_0x2eccff['body'][_0x3b50('0x88')]=_0x2eccff[_0x3b50('0x86')]['tags'][_0x3b50('0x89')](';')+';';}else{_0x2eccff[_0x3b50('0x86')][_0x3b50('0x88')]=null;}}else{_0x2eccff[_0x3b50('0x86')][_0x3b50('0x88')]=null;}if(!_[_0x3b50('0x4f')](_0x2eccff[_0x3b50('0x86')][_0x3b50('0x9f')])){var _0x549a8d=_0x2eccff[_0x3b50('0x86')][_0x3b50('0x9f')];if(!_[_0x3b50('0x4f')](shared['timezones'][_0x549a8d]))_0x2eccff[_0x3b50('0x86')][_0x3b50('0xa0')]=shared['timezones'][_0x549a8d][_0x3b50('0xa0')];}return db['CmContact']['create'](_0x2eccff['body'],{'fields':_[_0x3b50('0x1d')](_0x52ca1d),'raw':!![]});})[_0x3b50('0x16')](function(_0x10d6a9){if(_0x2eccff[_0x3b50('0x86')][_0x3b50('0xa1')]){return insertAdditionalPhones(_0x10d6a9,_0x2eccff[_0x3b50('0x86')][_0x3b50('0xa1')]);}else{return _0x10d6a9;}})['then'](respondWithResult(_0x1caca7,0xc9))[_0x3b50('0x7d')](handleError(_0x1caca7,null));};exports['bulkCreate']=function(_0x2ec344,_0x2b0332){var _0x28545e=0x0;var _0x2729c1=0x0;var _0x3ba551=0x0;var _0x22b20b=[];return db[_0x3b50('0x1b')]['describe']()[_0x3b50('0x16')](function(_0x15f916){return BPromise['each'](_0x2ec344[_0x3b50('0x86')],function(_0x4a60c5){var _0xc02b54={'where':{'$or':[]},'defaults':_0x4a60c5,'fields':_[_0x3b50('0x1d')](_0x15f916),'raw':!![]};if(_0x4a60c5[_0x3b50('0xa2')]){for(var _0x3e8575=0x0;_0x3e8575<_0x4a60c5['duplicates'][_0x3b50('0x1e')];_0x3e8575++){var _0x4f3470={};_0x4f3470[_0x4a60c5[_0x3b50('0xa2')][_0x3e8575]]=_0x4a60c5[_0x4a60c5[_0x3b50('0xa2')][_0x3e8575]];_0xc02b54[_0x3b50('0x2f')][_0x3b50('0xa3')][_0x3b50('0x20')](_0x4f3470);}_0xc02b54['where'][_0x3b50('0x52')]=_0x4a60c5['ListId'];}return db['CmContact'][_0x3b50('0xa4')](_0xc02b54)[_0x3b50('0xa5')](function(_0x4e8e78,_0x3e4831){if(_0x3e4831){if(_0x4a60c5[_0x3b50('0x85')]('additionalPhones')){_0x22b20b[_0x3b50('0x20')]({'contact':_0x4e8e78,'additionalPhones':_0x4a60c5[_0x3b50('0xa1')]});}_0x28545e++;}else{_0x3ba551++;}})[_0x3b50('0x7d')](function(){_0x2729c1++;});});})[_0x3b50('0x16')](function(_0x360c4b){if(_0x360c4b){if(_0x22b20b['length']>0x0){return new Promise(function(_0x53e301,_0x4b7f69){var _0xdc34ff=[];for(var _0x1db62f=0x0;_0x1db62f<_0x22b20b[_0x3b50('0x1e')];_0x1db62f++){_0xdc34ff[_0x3b50('0x20')](insertAdditionalPhones(_0x22b20b[_0x1db62f][_0x3b50('0xa6')],_0x22b20b[_0x1db62f][_0x3b50('0xa1')]));}Promise[_0x3b50('0x23')](_0xdc34ff)[_0x3b50('0x16')](function(){_0x53e301(0x1);});})['then'](function(){return{'success':_0x28545e,'failure':_0x2729c1,'duplicates':_0x3ba551};});}else{return{'success':_0x28545e,'failure':_0x2729c1,'duplicates':_0x3ba551};}}})[_0x3b50('0x16')](respondWithResult(_0x2b0332,0xc9))[_0x3b50('0x7d')](handleError(_0x2b0332,null));};exports[_0x3b50('0xa7')]=function(_0x22a1bc,_0x5e9fa3){var _0x2ad35c;return db[_0x3b50('0x1b')]['describe']()['then'](function(_0x32883d){return db[_0x3b50('0x1b')][_0x3b50('0x40')]({'where':{'id':_0x22a1bc['params']['id']},'include':[{'model':db[_0x3b50('0x41')],'as':_0x3b50('0x7c'),'attributes':['id',_0x3b50('0xa8'),'color'],'required':_0x22a1bc[_0x3b50('0x27')]['tag']?!![]:![]},{'model':db[_0x3b50('0x96')],'as':_0x3b50('0xa9'),'where':{'CmContactId':_0x22a1bc[_0x3b50('0x7f')]['id']},'required':![],'include':[{'model':db[_0x3b50('0xaa')],'as':_0x3b50('0xab')}]}],'order':[db[_0x3b50('0x70')][_0x3b50('0xac')]('Phones.OrderBy')],'attributes':_['keys'](_0x32883d)});})['then'](function(_0x4001d3){if(!_['isNil'](_0x4001d3)){_0x2ad35c=_0x4001d3[_0x3b50('0x87')]({'plain':!![]});var _0x12896e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4001d3&&_0x4001d3[_0x3b50('0x52')]){if(_0x4001d3[_0x3b50('0x52')]){_0x12896e[_0x3b50('0x2f')]['$and'][_0x3b50('0x20')]({'ListId':{'$ne':_0x4001d3['ListId']}});}}return db[_0x3b50('0xad')]['findAll'](_0x12896e);}})['then'](function(_0x5b86f0){if(!_[_0x3b50('0x4f')](_0x5b86f0)){return _['omit'](_0x2ad35c,_[_0x3b50('0x44')](_0x5b86f0,function(_0x1aba0d){return util[_0x3b50('0xae')](_0x3b50('0xaf'),_0x1aba0d['id']);}));}})['then'](handleEntityNotFound(_0x5e9fa3,null))['then'](respondWithResult(_0x5e9fa3,null))[_0x3b50('0x7d')](handleError(_0x5e9fa3,null));};exports[_0x3b50('0x90')]=function(_0x17b848,_0x354452){var _0x25889d;if(_0x17b848[_0x3b50('0x86')]['id']){delete _0x17b848['body']['id'];}if(!_[_0x3b50('0x4f')](_0x17b848[_0x3b50('0x86')][_0x3b50('0x9f')])){var _0x41054e=_0x17b848[_0x3b50('0x86')][_0x3b50('0x9f')];if(!_['isNil'](shared[_0x3b50('0xb0')][_0x41054e]))_0x17b848[_0x3b50('0x86')][_0x3b50('0xa0')]=shared[_0x3b50('0xb0')][_0x41054e]['utcOffset'];}return db[_0x3b50('0x1b')]['find']({'where':{'id':_0x17b848[_0x3b50('0x7f')]['id']}})[_0x3b50('0x16')](handleEntityNotFound(_0x354452,null))[_0x3b50('0x16')](saveUpdates(_0x17b848['body'],null))[_0x3b50('0x16')](function(_0x58d5ac){_0x25889d=_0x58d5ac;var _0x19683c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x58d5ac&&_0x58d5ac[_0x3b50('0x52')]){if(_0x58d5ac[_0x3b50('0x52')]){_0x19683c[_0x3b50('0x2f')][_0x3b50('0xb1')][_0x3b50('0x20')]({'ListId':{'$ne':_0x58d5ac[_0x3b50('0x52')]}});}}return db[_0x3b50('0xad')][_0x3b50('0xb2')](_0x19683c);})[_0x3b50('0x16')](function(_0x219ccf){if(_0x219ccf){return _[_0x3b50('0xb3')](_[_0x3b50('0xb4')](_0x17b848[_0x3b50('0x86')],function(_0x455b91,_0x2e1f27){return _[_0x3b50('0x80')](_0x2e1f27,_0x3b50('0x1f'));}),_[_0x3b50('0x44')](_0x219ccf,function(_0x4d119f){return util['format'](_0x3b50('0xaf'),_0x4d119f['id']);}));}})['then'](function(_0x28b703){if(_0x28b703&&!_[_0x3b50('0x51')](_0x28b703)){var _0x3632c2=squel[_0x3b50('0x90')]()[_0x3b50('0xb5')](_0x3b50('0xb6'))[_0x3b50('0xb7')](_0x28b703)[_0x3b50('0x2f')](_0x3b50('0xb8'),_0x17b848[_0x3b50('0x7f')]['id'])['toParam']();return db[_0x3b50('0x70')][_0x3b50('0x27')](_0x3632c2[_0x3b50('0xb9')],{'replacements':_0x3632c2['values']});}})[_0x3b50('0x16')](function(){if(_0x17b848[_0x3b50('0x86')][_0x3b50('0xba')]&&_0x25889d){return db[_0x3b50('0x8b')]['update']({'phone':_0x17b848['body'][_0x3b50('0xba')],'OrderBy':0x0},{'where':{'ContactId':_0x25889d['id']}});}})['then'](function(){return _0x25889d;})[_0x3b50('0x16')](respondWithResult(_0x354452,null))[_0x3b50('0x7d')](handleError(_0x354452,null));};exports[_0x3b50('0xbb')]=function(_0x51d829,_0x1ca96d){var _0x41f5da={};var _0x438e44={};var _0x36704e;var _0xb07d8c;return db[_0x3b50('0x1b')][_0x3b50('0x21')]({'where':{'id':_0x51d829['params']['id']}})[_0x3b50('0x16')](handleEntityNotFound(_0x1ca96d,null))[_0x3b50('0x16')](function(_0x3f0154){if(_0x3f0154){_0x36704e=_0x3f0154;_0x438e44[_0x3b50('0x26')]=_[_0x3b50('0x1d')](db['Tag'][_0x3b50('0xbc')]);_0x438e44[_0x3b50('0x27')]=_[_0x3b50('0x1d')](_0x51d829['query']);_0x438e44[_0x3b50('0x28')]=_['intersection'](_0x438e44[_0x3b50('0x26')],_0x438e44[_0x3b50('0x27')]);_0x41f5da[_0x3b50('0x2a')]=_[_0x3b50('0x29')](_0x438e44['model'],qs[_0x3b50('0x2b')](_0x51d829[_0x3b50('0x27')][_0x3b50('0x2b')]));_0x41f5da[_0x3b50('0x2a')]=_0x41f5da[_0x3b50('0x2a')][_0x3b50('0x1e')]?_0x41f5da[_0x3b50('0x2a')]:_0x438e44[_0x3b50('0x26')];_0x41f5da['order']=qs[_0x3b50('0x2e')](_0x51d829[_0x3b50('0x27')][_0x3b50('0x2e')]);_0x41f5da[_0x3b50('0x2f')]=qs[_0x3b50('0x28')](_[_0x3b50('0x30')](_0x51d829[_0x3b50('0x27')],_0x438e44[_0x3b50('0x28')]));if(_0x51d829['query']['filter']){_0x41f5da['where']=_['merge'](_0x41f5da[_0x3b50('0x2f')],{'$or':_[_0x3b50('0x44')](_0x41f5da['attributes'],function(_0x57b101){var _0x38cdac={};_0x38cdac[_0x57b101]={'$like':'%'+_0x51d829[_0x3b50('0x27')][_0x3b50('0x4e')]+'%'};return _0x38cdac;})});}_0x41f5da=_[_0x3b50('0x73')]({},_0x41f5da,_0x51d829[_0x3b50('0xbd')]);return _0x36704e[_0x3b50('0xbb')](_0x41f5da);}})[_0x3b50('0x16')](function(_0x1d9645){if(_0x1d9645){_0xb07d8c=_0x1d9645[_0x3b50('0x1e')];if(!_0x51d829[_0x3b50('0x27')][_0x3b50('0x85')](_0x3b50('0x2c'))){_0x41f5da[_0x3b50('0x13')]=qs[_0x3b50('0x13')](_0x51d829['query'][_0x3b50('0x13')]);_0x41f5da['offset']=qs[_0x3b50('0x11')](_0x51d829['query'][_0x3b50('0x11')]);}return _0x36704e[_0x3b50('0xbb')](_0x41f5da);}})[_0x3b50('0x16')](function(_0x56f775){if(_0x56f775){return _0x56f775?{'count':_0xb07d8c,'rows':_0x56f775}:null;}})[_0x3b50('0x16')](respondWithResult(_0x1ca96d,null))['catch'](handleError(_0x1ca96d,null));};exports[_0x3b50('0xbe')]=function(_0x15c2de,_0x369b5c){if(_0x15c2de['body']['id']){delete _0x15c2de[_0x3b50('0x86')]['id'];}return db[_0x3b50('0x1b')][_0x3b50('0x21')]({'where':{'id':_0x15c2de[_0x3b50('0x7f')]['id']}})['then'](handleEntityNotFound(_0x369b5c,null))[_0x3b50('0x16')](function(_0x30648e){if(_0x30648e){return _0x30648e[_0x3b50('0xbe')](_0x15c2de['body']['ids']||[]);}return null;})[_0x3b50('0x16')](respondWithResult(_0x369b5c,null))[_0x3b50('0x7d')](handleError(_0x369b5c,null));};exports[_0x3b50('0xbf')]=function(_0x390ce5,_0x4ba8df){var _0x32187a=[];_0x32187a['push'](addAdditionalPhones(_0x390ce5['body']));Promise[_0x3b50('0x23')](_0x32187a)[_0x3b50('0x16')](function(){_0x32187a=[];_0x32187a[_0x3b50('0x20')](deleteCmHopperPhones(_0x390ce5['body']['id']));_0x32187a['push'](addCmHopperPhones(_0x390ce5[_0x3b50('0x86')]['id']));Promise[_0x3b50('0x23')](_0x32187a)[_0x3b50('0x16')](function(){return[0x1];})['then'](respondWithResult(_0x4ba8df,null));});};function addAdditionalPhones(_0x1f12a4){var _0x376e59;return new Promise(function(_0x75210e,_0x557561){return db['CmContactHasItem'][_0x3b50('0x7e')]({'where':{'CmContactId':_0x1f12a4['id']}})[_0x3b50('0x16')](function(){db[_0x3b50('0xaa')]['findAll']({'raw':!![],'attributes':['id',_0x3b50('0xc0')]})[_0x3b50('0x16')](function(_0xeebd45){var _0x298b2d=[];for(var _0x591c33=0x0;_0x591c33<_0x1f12a4[_0x3b50('0xc1')][_0x3b50('0x1e')];_0x591c33++){var _0x790913=_0x1f12a4[_0x3b50('0xc2')]?_['isNil'](_0x1f12a4[_0x3b50('0xc2')][_0x591c33])?'':_0x1f12a4['item_types'][_0x591c33]:_0x1f12a4[_0x3b50('0xc1')][_0x591c33][_0x3b50('0xc3')]?_0x1f12a4[_0x3b50('0xc1')][_0x591c33][_0x3b50('0xc3')]:'';var _0xc78e28=_['isNil'](_0x1f12a4['items'][_0x591c33][_0x3b50('0xc4')])?'':_0x1f12a4[_0x3b50('0xc1')][_0x591c33][_0x3b50('0xc4')];var _0x21b526=_0x790913+':'+_0x1f12a4['items'][_0x591c33][_0x3b50('0xba')]+'§'+_0xc78e28;if(_['isNil'](_0x376e59))_0x376e59=_0x21b526;else _0x376e59+=';'+_0x21b526;var _0x99ab5e=null;if(_0x1f12a4['item_types']){if(!_[_0x3b50('0x4f')](_0x1f12a4[_0x3b50('0xc2')][_0x591c33])){var _0x128ca8=_[_0x3b50('0x40')](_0xeebd45,function(_0x4a9bfa){return _0x4a9bfa['id']===_0x1f12a4[_0x3b50('0xc2')][_0x591c33];});if(!_[_0x3b50('0x4f')](_0x128ca8)){_0x99ab5e=_0x128ca8['OrderBy'];}}}else{if(!_[_0x3b50('0x4f')](_0x1f12a4[_0x3b50('0xc1')][_0x591c33])){var _0x128ca8=_[_0x3b50('0x40')](_0xeebd45,function(_0x13f2cd){return _0x13f2cd['id']===_0x1f12a4[_0x3b50('0xc1')][_0x591c33]['ItemTypeId'];});if(!_[_0x3b50('0x4f')](_0x128ca8)){_0x99ab5e=_0x591c33;}}}if(_[_0x3b50('0x4f')](_0x99ab5e)){_0x99ab5e=0x64;}_0x298b2d['push'](addAdditionalPhone(_0x1f12a4['id'],_0x1f12a4[_0x3b50('0xc1')][_0x591c33][_0x3b50('0xba')],_0x1f12a4[_0x3b50('0xc2')]?_[_0x3b50('0x4f')](_0x1f12a4[_0x3b50('0xc2')][_0x591c33])?null:_0x1f12a4[_0x3b50('0xc2')][_0x591c33]:_0x1f12a4[_0x3b50('0xc1')][_0x591c33][_0x3b50('0xc3')]?_0x1f12a4[_0x3b50('0xc1')][_0x591c33][_0x3b50('0xc3')]:null,_0x99ab5e,_0xc78e28));}Promise['all'](_0x298b2d)[_0x3b50('0x16')](function(){db[_0x3b50('0x1b')]['update']({'AdditionalPhones':_0x376e59},{'where':{'id':_0x1f12a4['id']}})['then'](function(){_0x75210e(0x1);});});});});});}function addAdditionalPhone(_0x9ae1f6,_0x2c9596,_0x1205b8,_0x3a9b2a,_0x2d714f){return db[_0x3b50('0x96')]['find']({'where':{'CmContactId':_0x9ae1f6,'item':_0x2c9596}})['then'](function(_0x61f226){if(_0x61f226)logger[_0x3b50('0x8a')](_0x3b50('0xc5'),_0x61f226);else{db[_0x3b50('0x96')]['create']({'CmContactId':_0x9ae1f6,'item':_0x2c9596,'ItemTypeId':_0x1205b8,'OrderBy':_0x3a9b2a,'ItemClass':'PHONE','description':_0x2d714f});}});}function deletePhones(_0x44d696){return db[_0x3b50('0x96')][_0x3b50('0x7e')]({'where':{'CmContactId':_0x44d696}});}function deleteCmHopperPhones(_0x5e6df1){return new Promise(function(_0x5dc71e,_0x22152f){return db[_0x3b50('0x8b')][_0x3b50('0xb2')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5e6df1}})[_0x3b50('0x16')](function(_0x1b54d0){db['CmHopperAdditionalPhone'][_0x3b50('0x7e')]({'where':{'CmHopperId':{'$in':_['map'](_0x1b54d0,'id')}}});})['then'](function(){_0x5dc71e(0x1);});});}function addCmHopperPhones(_0x29dc0d){return new Promise(function(_0x4962c8,_0x494198){return db[_0x3b50('0x8b')][_0x3b50('0xb2')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x29dc0d}})[_0x3b50('0x16')](function(_0x4e12b6){var _0x14d052=[];_[_0x3b50('0x44')](_0x4e12b6,function(_0x3db174){_0x14d052[_0x3b50('0x20')](createCmHopperPhone(_0x29dc0d,_0x3db174['id']));});Promise[_0x3b50('0x23')](_0x14d052)[_0x3b50('0x16')](function(){_0x4962c8(0x1);});});});}function createCmHopperPhone(_0x1048b9,_0x2b5fe7){return new Promise(function(_0x5b3a52,_0x17cce8){db[_0x3b50('0x96')]['findAll']({'raw':!![],'attributes':[_0x3b50('0xc6'),'OrderBy'],'where':{'CmContactId':_0x1048b9,'ItemClass':_0x3b50('0xc7')},'include':[{'model':db[_0x3b50('0xaa')],'attributes':[_0x3b50('0xc0')],'as':_0x3b50('0xab')}],'order':[_0x3b50('0xc0'),db[_0x3b50('0x70')][_0x3b50('0xac')](_0x3b50('0xc8'))]})[_0x3b50('0x16')](function(_0x429dd5){var _0xa156d9=0x1;var _0x192032=_['map'](_0x429dd5,function(_0x5cfabc){_0x5cfabc[_0x3b50('0xc9')]=_0x2b5fe7;_0x5cfabc[_0x3b50('0xba')]=_0x5cfabc[_0x3b50('0xc6')];_0x5cfabc[_0x3b50('0xc0')]=_0xa156d9;delete _0x5cfabc[_0x3b50('0xca')];_0xa156d9=_0xa156d9+0x1;return _0x5cfabc;});return db[_0x3b50('0xcb')]['bulkCreate'](_0x192032,{});})[_0x3b50('0x16')](function(){_0x5b3a52(0x1);});});}function insertAdditionalPhones(_0x10ed41,_0x388696){return new Promise(function(_0xd3f178,_0x17d73d){var _0x44814b=[];for(var _0x30132b=0x0;_0x30132b<_0x388696[_0x3b50('0x1e')];_0x30132b++){var _0x95bb80=_0x388696[_0x30132b];_0x44814b['push'](parseContactItemType(_0x95bb80));}Promise[_0x3b50('0x23')](_0x44814b)[_0x3b50('0x16')](function(){var _0x1326aa={'id':_0x10ed41['id'],'items':_0x388696};return addAdditionalPhones(_0x1326aa)[_0x3b50('0x16')](function(_0x3d9d89){return addCmHopperPhones(_0x10ed41['id']);});})[_0x3b50('0x16')](function(){_0xd3f178(_0x10ed41);});});}function parseContactItemType(_0x35afbb){return new Promise(function(_0x3171ca,_0x17e33c){if(_0x35afbb[_0x3b50('0x85')](_0x3b50('0xc3'))){_0x3171ca(_0x35afbb);}else{return db[_0x3b50('0xaa')][_0x3b50('0x40')]({'where':{'name':_0x35afbb['ItemType']}})[_0x3b50('0x16')](function(_0x504a95){if(_[_0x3b50('0x4f')](_0x504a95))_0x35afbb[_0x3b50('0xc3')]=null;else _0x35afbb[_0x3b50('0xc3')]=_0x504a95['id'];_0x3171ca(_0x35afbb);});}});}exports[_0x3b50('0xcc')]=function(_0x358eef,_0x10f62a){return db[_0x3b50('0x96')][_0x3b50('0xb2')]({'raw':!![],'where':{'CmContactId':_0x358eef[_0x3b50('0x7f')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x3b50('0xaa')],'as':_0x3b50('0xab')}],'order':[[_0x3b50('0xc0')],[db[_0x3b50('0x70')]['literal'](_0x3b50('0xc8'))]]})[_0x3b50('0x16')](function(_0x2c1a00){return _0x2c1a00;})[_0x3b50('0x16')](respondWithResult(_0x10f62a,null))[_0x3b50('0x7d')](handleError(_0x10f62a,null));};exports['duplicateAdditionalPhones']=function(_0x34013f,_0x16b398){return db[_0x3b50('0x96')][_0x3b50('0xb2')]({'raw':!![],'where':{'CmContactId':_0x34013f[_0x3b50('0x86')]['fromContactId']}})[_0x3b50('0x16')](function(_0x34b071){var _0x399d5e=_[_0x3b50('0x44')](_0x34b071,function(_0xc770bf){_0xc770bf[_0x3b50('0xcd')]=_0x34013f[_0x3b50('0x86')][_0x3b50('0xce')];return _0xc770bf;});return db[_0x3b50('0x96')]['bulkCreate'](_0x399d5e,{});})['then'](function(_0x217f39){return addCmHopperPhones(_0x34013f[_0x3b50('0x86')][_0x3b50('0xce')]);})[_0x3b50('0x16')](function(_0x2217ba){return['ok'];})[_0x3b50('0x16')](respondWithResult(_0x16b398,null))[_0x3b50('0x7d')](handleError(_0x16b398,null));};exports['rescheduleAdditionalPhones']=function(_0x588096,_0x528492){var _0x3b00cb=[];_0x3b00cb['push'](createCmHopperPhone(_0x588096[_0x3b50('0x86')]['id'],_0x588096[_0x3b50('0x86')][_0x3b50('0xcf')]));Promise['all'](_0x3b00cb)[_0x3b50('0x16')](function(){return[0x1];})[_0x3b50('0x16')](respondWithResult(_0x528492,null));};exports[_0x3b50('0xd0')]=function(_0x85948d,_0x5e843f){var _0xc5bf29={'raw':![],'where':{}};var _0x71f595={};var _0xede1ef={'count':0x0,'rows':[]};return db['CmContact'][_0x3b50('0x21')]({'where':{'id':_0x85948d[_0x3b50('0x7f')]['id']}})[_0x3b50('0x16')](handleEntityNotFound(_0x5e843f,null))[_0x3b50('0x16')](function(_0x4745de){if(_0x4745de){_0x71f595['model']=_[_0x3b50('0x1d')](db[_0x3b50('0x8b')][_0x3b50('0xbc')]);_0x71f595[_0x3b50('0x27')]=_[_0x3b50('0x1d')](_0x85948d['query']);_0x71f595['filters']=_[_0x3b50('0x29')](_0x71f595[_0x3b50('0x26')],_0x71f595[_0x3b50('0x27')]);_0xc5bf29[_0x3b50('0x2a')]=_[_0x3b50('0x29')](_0x71f595[_0x3b50('0x26')],qs[_0x3b50('0x2b')](_0x85948d[_0x3b50('0x27')][_0x3b50('0x2b')]));_0xc5bf29[_0x3b50('0x2a')]=_0xc5bf29[_0x3b50('0x2a')][_0x3b50('0x1e')]?_0xc5bf29[_0x3b50('0x2a')]:_0x71f595[_0x3b50('0x26')];if(!_0x85948d[_0x3b50('0x27')][_0x3b50('0x85')](_0x3b50('0x2c'))){_0xc5bf29['limit']=qs[_0x3b50('0x13')](_0x85948d[_0x3b50('0x27')]['limit']);_0xc5bf29['offset']=qs[_0x3b50('0x11')](_0x85948d[_0x3b50('0x27')][_0x3b50('0x11')]);}_0xc5bf29[_0x3b50('0x2d')]=qs[_0x3b50('0x2e')](_0x85948d['query'][_0x3b50('0x2e')]);_0xc5bf29[_0x3b50('0x2f')]=qs[_0x3b50('0x28')](_[_0x3b50('0x30')](_0x85948d[_0x3b50('0x27')],_0x71f595[_0x3b50('0x28')]));_0xc5bf29[_0x3b50('0x2f')][_0x3b50('0xd1')]=_0x4745de['id'];if(_0x85948d['query'][_0x3b50('0x4e')]){_0xc5bf29[_0x3b50('0x2f')]=_['merge'](_0xc5bf29[_0x3b50('0x2f')],{'$or':_['map'](_0xc5bf29['attributes'],function(_0x90bf03){var _0x11aab4={};_0x11aab4[_0x90bf03]={'$like':'%'+_0x85948d[_0x3b50('0x27')][_0x3b50('0x4e')]+'%'};return _0x11aab4;})});}_0xc5bf29=_[_0x3b50('0x73')]({},_0xc5bf29,_0x85948d[_0x3b50('0xbd')]);return db['CmHopper']['count']({'where':_0xc5bf29[_0x3b50('0x2f')]})[_0x3b50('0x16')](function(_0x350fa7){_0xede1ef['count']=_0x350fa7;if(_0x85948d[_0x3b50('0x27')]['includeAll']){_0xc5bf29[_0x3b50('0xd2')]=[{'all':!![]}];}return db['CmHopper'][_0x3b50('0xb2')](_0xc5bf29);})[_0x3b50('0x16')](function(_0x3b5783){_0xede1ef[_0x3b50('0xd3')]=_0x3b5783;return _0xede1ef;});}})[_0x3b50('0x16')](respondWithFilteredResult(_0x5e843f,_0xc5bf29))['catch'](handleError(_0x5e843f,null));};exports['getHopperHistories']=function(_0x5b0459,_0x5c1e0b){var _0x452e45={'raw':!![],'where':{}};var _0x376e2b={};var _0x59ae13={'count':0x0,'rows':[]};return db[_0x3b50('0x1b')][_0x3b50('0x21')]({'where':{'id':_0x5b0459[_0x3b50('0x7f')]['id']}})[_0x3b50('0x16')](handleEntityNotFound(_0x5c1e0b,null))['then'](function(_0x1a2354){if(_0x1a2354){_0x376e2b['model']=_[_0x3b50('0x1d')](db[_0x3b50('0x98')]['rawAttributes']);_0x376e2b[_0x3b50('0x27')]=_[_0x3b50('0x1d')](_0x5b0459['query']);_0x376e2b[_0x3b50('0x28')]=_[_0x3b50('0x29')](_0x376e2b[_0x3b50('0x26')],_0x376e2b[_0x3b50('0x27')]);_0x452e45[_0x3b50('0x2a')]=_[_0x3b50('0x29')](_0x376e2b[_0x3b50('0x26')],qs[_0x3b50('0x2b')](_0x5b0459['query'][_0x3b50('0x2b')]));_0x452e45[_0x3b50('0x2a')]=_0x452e45['attributes'][_0x3b50('0x1e')]?_0x452e45[_0x3b50('0x2a')]:_0x376e2b[_0x3b50('0x26')];if(!_0x5b0459[_0x3b50('0x27')][_0x3b50('0x85')](_0x3b50('0x2c'))){_0x452e45['limit']=qs['limit'](_0x5b0459[_0x3b50('0x27')]['limit']);_0x452e45['offset']=qs[_0x3b50('0x11')](_0x5b0459['query'][_0x3b50('0x11')]);}_0x452e45[_0x3b50('0x2d')]=qs[_0x3b50('0x2e')](_0x5b0459[_0x3b50('0x27')][_0x3b50('0x2e')]);_0x452e45['where']=qs[_0x3b50('0x28')](_[_0x3b50('0x30')](_0x5b0459[_0x3b50('0x27')],_0x376e2b[_0x3b50('0x28')]));_0x452e45[_0x3b50('0x2f')][_0x3b50('0xd1')]=_0x1a2354['id'];if(_0x5b0459['query'][_0x3b50('0x4e')]){_0x452e45[_0x3b50('0x2f')]=_[_0x3b50('0x73')](_0x452e45[_0x3b50('0x2f')],{'$or':_[_0x3b50('0x44')](_0x452e45['attributes'],function(_0x1f5fa3){var _0x296061={};_0x296061[_0x1f5fa3]={'$like':'%'+_0x5b0459[_0x3b50('0x27')]['filter']+'%'};return _0x296061;})});}_0x452e45=_[_0x3b50('0x73')]({},_0x452e45,_0x5b0459['options']);return db[_0x3b50('0x98')][_0x3b50('0x14')]({'where':_0x452e45[_0x3b50('0x2f')]})[_0x3b50('0x16')](function(_0x3263c6){_0x59ae13[_0x3b50('0x14')]=_0x3263c6;if(_0x5b0459[_0x3b50('0x27')]['includeAll']){_0x452e45['include']=[{'all':!![]}];}return db[_0x3b50('0x98')][_0x3b50('0xb2')](_0x452e45);})[_0x3b50('0x16')](function(_0x30200e){_0x59ae13[_0x3b50('0xd3')]=_0x30200e;return _0x59ae13;});}})[_0x3b50('0x16')](respondWithFilteredResult(_0x5c1e0b,_0x452e45))['catch'](handleError(_0x5c1e0b,null));};exports[_0x3b50('0xd4')]=function(_0x3d30cf,_0x16fa69){var _0x2a4bc2={'raw':!![],'where':{}};var _0xd26f10={};var _0x505460={'count':0x0,'rows':[]};return db['CmContact'][_0x3b50('0x21')]({'where':{'id':_0x3d30cf['params']['id']}})[_0x3b50('0x16')](handleEntityNotFound(_0x16fa69,null))[_0x3b50('0x16')](function(_0x29109f){if(_0x29109f){_0xd26f10[_0x3b50('0x26')]=_[_0x3b50('0x1d')](db['CmHopperFinal'][_0x3b50('0xbc')]);_0xd26f10[_0x3b50('0x27')]=_['keys'](_0x3d30cf[_0x3b50('0x27')]);_0xd26f10[_0x3b50('0x28')]=_[_0x3b50('0x29')](_0xd26f10[_0x3b50('0x26')],_0xd26f10[_0x3b50('0x27')]);_0x2a4bc2['attributes']=_[_0x3b50('0x29')](_0xd26f10['model'],qs['fields'](_0x3d30cf[_0x3b50('0x27')]['fields']));_0x2a4bc2['attributes']=_0x2a4bc2[_0x3b50('0x2a')]['length']?_0x2a4bc2['attributes']:_0xd26f10['model'];if(!_0x3d30cf[_0x3b50('0x27')][_0x3b50('0x85')](_0x3b50('0x2c'))){_0x2a4bc2[_0x3b50('0x13')]=qs[_0x3b50('0x13')](_0x3d30cf['query'][_0x3b50('0x13')]);_0x2a4bc2['offset']=qs[_0x3b50('0x11')](_0x3d30cf[_0x3b50('0x27')][_0x3b50('0x11')]);}_0x2a4bc2[_0x3b50('0x2d')]=qs['sort'](_0x3d30cf[_0x3b50('0x27')][_0x3b50('0x2e')]);_0x2a4bc2['where']=qs[_0x3b50('0x28')](_[_0x3b50('0x30')](_0x3d30cf[_0x3b50('0x27')],_0xd26f10[_0x3b50('0x28')]));_0x2a4bc2[_0x3b50('0x2f')][_0x3b50('0xd1')]=_0x29109f['id'];if(_0x3d30cf[_0x3b50('0x27')][_0x3b50('0x4e')]){_0x2a4bc2[_0x3b50('0x2f')]=_[_0x3b50('0x73')](_0x2a4bc2[_0x3b50('0x2f')],{'$or':_[_0x3b50('0x44')](_0x2a4bc2['attributes'],function(_0x51d6c0){var _0x42a462={};_0x42a462[_0x51d6c0]={'$like':'%'+_0x3d30cf[_0x3b50('0x27')]['filter']+'%'};return _0x42a462;})});}_0x2a4bc2=_[_0x3b50('0x73')]({},_0x2a4bc2,_0x3d30cf[_0x3b50('0xbd')]);return db[_0x3b50('0x97')]['count']({'where':_0x2a4bc2[_0x3b50('0x2f')]})[_0x3b50('0x16')](function(_0x7c603){_0x505460['count']=_0x7c603;if(_0x3d30cf[_0x3b50('0x27')][_0x3b50('0xd5')]){_0x2a4bc2[_0x3b50('0xd2')]=[{'all':!![]}];}return db[_0x3b50('0x97')][_0x3b50('0xb2')](_0x2a4bc2);})[_0x3b50('0x16')](function(_0x229a04){_0x505460['rows']=_0x229a04;return _0x505460;});}})[_0x3b50('0x16')](respondWithFilteredResult(_0x16fa69,_0x2a4bc2))[_0x3b50('0x7d')](handleError(_0x16fa69,null));};exports[_0x3b50('0xd6')]=function(_0x521482,_0x47a144){var _0x414829={'raw':!![],'where':{}};var _0x1427e3={};var _0x5a17ac={'count':0x0,'rows':[]};return db['CmContact'][_0x3b50('0x21')]({'where':{'id':_0x521482[_0x3b50('0x7f')]['id']}})[_0x3b50('0x16')](handleEntityNotFound(_0x47a144,null))['then'](function(_0xe346ee){if(_0xe346ee){_0x1427e3[_0x3b50('0x26')]=_['keys'](db['JscriptySessionReport'][_0x3b50('0xbc')]);_0x1427e3[_0x3b50('0x27')]=_[_0x3b50('0x1d')](_0x521482[_0x3b50('0x27')]);_0x1427e3[_0x3b50('0x28')]=_[_0x3b50('0x29')](_0x1427e3[_0x3b50('0x26')],_0x1427e3['query']);_0x414829[_0x3b50('0x2a')]=_[_0x3b50('0x29')](_0x1427e3['model'],qs['fields'](_0x521482[_0x3b50('0x27')][_0x3b50('0x2b')]));_0x414829[_0x3b50('0x2a')]=_0x414829[_0x3b50('0x2a')][_0x3b50('0x1e')]?_0x414829['attributes']:_0x1427e3[_0x3b50('0x26')];if(!_0x521482[_0x3b50('0x27')][_0x3b50('0x85')](_0x3b50('0x2c'))){_0x414829[_0x3b50('0x13')]=qs['limit'](_0x521482['query'][_0x3b50('0x13')]);_0x414829[_0x3b50('0x11')]=qs[_0x3b50('0x11')](_0x521482['query'][_0x3b50('0x11')]);}_0x414829[_0x3b50('0x2d')]=qs[_0x3b50('0x2e')](_0x521482[_0x3b50('0x27')][_0x3b50('0x2e')]);_0x414829[_0x3b50('0x2f')]=qs[_0x3b50('0x28')](_[_0x3b50('0x30')](_0x521482[_0x3b50('0x27')],_0x1427e3['filters']));_0x414829['where'][_0x3b50('0xd1')]=_0xe346ee['id'];if(_0x521482[_0x3b50('0x27')][_0x3b50('0x4e')]){_0x414829[_0x3b50('0x2f')]=_[_0x3b50('0x73')](_0x414829[_0x3b50('0x2f')],{'$or':_['map'](_0x414829[_0x3b50('0x2a')],function(_0x138911){var _0x9557b3={};_0x9557b3[_0x138911]={'$like':'%'+_0x521482[_0x3b50('0x27')]['filter']+'%'};return _0x9557b3;})});}_0x414829=_[_0x3b50('0x73')]({},_0x414829,_0x521482[_0x3b50('0xbd')]);return db[_0x3b50('0x9d')][_0x3b50('0x14')]({'where':_0x414829[_0x3b50('0x2f')]})[_0x3b50('0x16')](function(_0x1d8668){_0x5a17ac['count']=_0x1d8668;if(_0x521482[_0x3b50('0x27')][_0x3b50('0xd5')]){_0x414829[_0x3b50('0xd2')]=[{'all':!![]}];}return db[_0x3b50('0x9d')][_0x3b50('0xb2')](_0x414829);})[_0x3b50('0x16')](function(_0x1014e2){_0x5a17ac[_0x3b50('0xd3')]=_0x1014e2;return _0x5a17ac;});}})['then'](respondWithFilteredResult(_0x47a144,_0x414829))['catch'](handleError(_0x47a144,null));};exports['uploadCsv']=function(_0x3c6c24,_0x3a7de3){try{if(!_0x3c6c24[_0x3b50('0x86')][_0x3b50('0x52')]){throw new Error(_0x3b50('0xd7'));}if(!_0x3c6c24[_0x3b50('0x86')][_0x3b50('0xd8')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x3c6c24[_0x3b50('0x86')][_0x3b50('0xd9')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x3c6c24[_0x3b50('0x86')][_0x3b50('0xda')]){throw new Error(_0x3b50('0xdb'));}var _0x3f4e63=_0x3c6c24[_0x3b50('0x86')][_0x3b50('0xd8')][_0x3b50('0x43')](',');var _0x590ea9=_0x3c6c24[_0x3b50('0x86')][_0x3b50('0xd9')]['split'](',');if(!_0x3f4e63[_0x3b50('0x1e')]||!_0x590ea9[_0x3b50('0x1e')]||_0x3f4e63[_0x3b50('0x1e')]!==_0x590ea9[_0x3b50('0x1e')]){throw new Error(_0x3b50('0xdc'));}_0x3c6c24[_0x3b50('0x86')][_0x3b50('0x2b')]=_[_0x3b50('0xdd')](_0x3f4e63,_0x590ea9);if(!_0x3c6c24['body'][_0x3b50('0x2b')][_0x3b50('0xba')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x3c6c24['body']['fields'][_0x3b50('0xde')]){throw new Error(_0x3b50('0xdf'));}var _0x3b47e4=path[_0x3b50('0x89')](config[_0x3b50('0xe0')],'server/files/tmp',_0x3c6c24[_0x3b50('0xe1')]['filename']);fs[_0x3b50('0xe2')](_0x3b47e4,parseInt(_0x3b50('0xe3'),0x8));var _0x53daaf=require(_0x3b50('0xe4'))['fork'](path[_0x3b50('0x89')](__dirname,_0x3b50('0xe5')),[_0x3b47e4,_0x3c6c24[_0x3b50('0x86')][_0x3b50('0xd8')],_0x3c6c24['body'][_0x3b50('0xd9')],_0x3c6c24[_0x3b50('0x86')][_0x3b50('0x52')],_0x3c6c24[_0x3b50('0x86')][_0x3b50('0xe6')],_0x3c6c24['body']['duplicates'],_0x3c6c24[_0x3b50('0x86')][_0x3b50('0xda')]]);return _0x3a7de3['status'](0xc8)['json']({'message':'File\x20uploaded\x20correctly!','pid':_0x53daaf[_0x3b50('0xe7')]});}catch(_0x5bf2cc){return _0x3a7de3[_0x3b50('0xf')](0x1f4)['send'](_0x5bf2cc);}};exports[_0x3b50('0xe8')]=function(_0x29bdbb,_0x53cca1){var _0x529c15=fs[_0x3b50('0xe9')](_0x29bdbb['file']['path']);Papa[_0x3b50('0xea')](_0x529c15,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c0364){return _0x53cca1['status'](0xc8)[_0x3b50('0x10')]({'file':_0x29bdbb[_0x3b50('0xe1')],'fields':_0x5c0364[_0x3b50('0xeb')][_0x3b50('0x2b')]});}});};exports[_0x3b50('0xec')]=function(_0x11bf2b,_0x92c684){return db['User'][_0x3b50('0xb2')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x3b50('0x16')](function(_0x1c9318){var _0x245e6e=![];if(!_0x11bf2b[_0x3b50('0x86')][_0x3b50('0x52')]){throw new Error(_0x3b50('0xd7'));}if(!_0x11bf2b[_0x3b50('0x86')][_0x3b50('0xed')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x11bf2b[_0x3b50('0x86')][_0x3b50('0xed')][_0x3b50('0xde')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x11bf2b[_0x3b50('0x86')][_0x3b50('0xda')]){throw new Error(_0x3b50('0xdb'));}var _0x2b561e=require(_0x3b50('0xe4'))[_0x3b50('0xee')](path[_0x3b50('0x89')](__dirname,'../../components/import/cm/csv2'),[_0x11bf2b['params']['id'],JSON['stringify'](_0x11bf2b['body']),JSON['stringify'](_0x1c9318)]);_0x2b561e['on'](_0x3b50('0xef'),function(){_0x245e6e=!![];return _0x92c684['status'](0xc8)[_0x3b50('0x10')]({'message':_0x3b50('0xf0'),'pid':_0x2b561e[_0x3b50('0xe7')]});});_0x2b561e['on'](_0x3b50('0xf1'),function(_0x497889){if(_0x497889&&!_0x245e6e){return _0x92c684['status'](0x1f4)['json']({'message':_0x3b50('0xf2'),'pid':_0x2b561e[_0x3b50('0xe7')]});}});})[_0x3b50('0x7d')](handleError(_0x92c684,null));};exports[_0x3b50('0xf3')]=function(_0x767524,_0x5b4c7a,_0x42dbc1){return db[_0x3b50('0x6d')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x3b50('0x16')](function(_0x55b3eb){var _0x326c8f=![];if(!_0x767524['body'][_0x3b50('0x52')]){throw new Error(_0x3b50('0xd7'));}if(!_0x767524['body'][_0x3b50('0xed')][_0x3b50('0xba')]){throw new Error(_0x3b50('0xf4'));}if(!_0x767524[_0x3b50('0x86')][_0x3b50('0xed')][_0x3b50('0xde')]){throw new Error(_0x3b50('0xdf'));}if(!_0x767524[_0x3b50('0x86')][_0x3b50('0xda')]){throw new Error(_0x3b50('0xdb'));}var _0x3214e7=require('child_process')[_0x3b50('0xee')](path['join'](__dirname,_0x3b50('0xf5')),[_0x767524[_0x3b50('0x7f')]['id'],JSON[_0x3b50('0xf6')](_0x767524['body']),JSON[_0x3b50('0xf6')](_0x55b3eb)]);_0x3214e7['on'](_0x3b50('0xef'),function(_0x5846b7){_0x326c8f=!![];return _0x5b4c7a[_0x3b50('0xf')](0xc8)[_0x3b50('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x3214e7['pid']});});_0x3214e7['on']('exit',function(_0x37d25b){if(_0x37d25b&&!_0x326c8f){return _0x5b4c7a['status'](0x1f4)[_0x3b50('0x10')]({'message':_0x3b50('0xf2'),'pid':_0x3214e7[_0x3b50('0xe7')]});}});})[_0x3b50('0x7d')](handleError(_0x5b4c7a,null));};exports[_0x3b50('0xf7')]=function(_0x4e38cb,_0x4f7e75){var _0x3d606d=[_0x3b50('0xf8'),'chat',_0x3b50('0xf9'),_0x3b50('0xfa'),_0x3b50('0xfb'),'whatsapp',_0x3b50('0xfc')];var _0x49a5da={'offset':0x0,'order':qs[_0x3b50('0x2e')](_0x3b50('0xfd'))},_0x16e9ca={'count':0x0,'rows':[]};Promise[_0x3b50('0x68')]()[_0x3b50('0x16')](function(){if(_0x4e38cb[_0x3b50('0x27')]['channel']){if(!_[_0x3b50('0xfe')](_0x3d606d,_0x4e38cb[_0x3b50('0x27')][_0x3b50('0xff')][_0x3b50('0x100')]())){throw new Error(_0x3b50('0x101'));}_0x3d606d=[_0x4e38cb[_0x3b50('0x27')][_0x3b50('0xff')]['toLowerCase']()];}if(_0x4e38cb[_0x3b50('0x27')][_0x3b50('0x102')]){try{var _0x36cc4e=JSON['parse'](_0x4e38cb[_0x3b50('0x27')][_0x3b50('0x102')]);if(!moment(_0x36cc4e['from'])['isValid']()){throw new Error(_0x3b50('0x103'));}if(!moment(_0x36cc4e['to'])[_0x3b50('0x104')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x592dba){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x4e38cb[_0x3b50('0x27')][_0x3b50('0x85')]('nolimit')){_0x49a5da['limit']=qs[_0x3b50('0x13')](_0x4e38cb[_0x3b50('0x27')][_0x3b50('0x13')]||0xa);_0x49a5da[_0x3b50('0x11')]=qs[_0x3b50('0x11')](_0x4e38cb[_0x3b50('0x27')]['offset']);}var _0x2cd134=_0x3d606d[_0x3b50('0x44')](function(_0x18767a){if(_0x18767a===_0x3b50('0xfc')){var _0x218ae7={'attributes':['id',_0x3b50('0x105'),'type','source','destination',_0x3b50('0x106'),'starttime',_0x3b50('0x107'),_0x3b50('0x108'),'note',_0x3b50('0x109'),'userDisposition',_0x3b50('0x10a'),'userThirdDisposition',_0x3b50('0x10b')],'where':{'ContactId':_0x4e38cb[_0x3b50('0x7f')]['id']},'include':[{'model':db[_0x3b50('0x6d')],'as':_0x3b50('0x6d'),'attributes':['id',_0x3b50('0xa8'),'fullname',_0x3b50('0x83')]}],'order':[[_0x3b50('0x109'),_0x3b50('0x10c')]]};if(_0x4e38cb[_0x3b50('0x27')][_0x3b50('0x102')]){_0x218ae7['where']['createdAt']={'$gte':_0x36cc4e[_0x3b50('0x34')],'$lte':_0x36cc4e['to']};}return db[_0x3b50('0x10d')][_0x3b50('0x10e')](_0x218ae7)[_0x3b50('0x16')](function(_0x52025f){_0x16e9ca[_0x3b50('0x14')]+=_0x52025f['count'];return _[_0x3b50('0x44')](_0x52025f[_0x3b50('0xd3')],function(_0x175160){var _0x241d87=_0x175160[_0x3b50('0x87')]({'plain':!![]});_0x241d87[_0x3b50('0xff')]=_0x18767a;if(_0x241d87[_0x3b50('0x6d')]){_0x241d87[_0x3b50('0x6d')]={'id':_0x241d87[_0x3b50('0x6d')]['id'],'name':_0x241d87['User'][_0x3b50('0xa8')],'fullname':_0x241d87[_0x3b50('0x6d')][_0x3b50('0x10f')],'alias':_0x241d87[_0x3b50('0x6d')][_0x3b50('0x83')]};}return _0x241d87;});});}else{var _0x47e9ff=_[_0x3b50('0x110')](_0x18767a)+(_0x18767a===_0x3b50('0x111')?_0x3b50('0x112'):'Account');var _0x1114a6={'attributes':['id',_0x3b50('0x113'),_0x3b50('0x114'),_0x3b50('0x109'),_0x3b50('0x115'),'disposition',_0x3b50('0x116'),_0x3b50('0x117'),'UserId',_0x47e9ff+'Id'],'where':{'ContactId':_0x4e38cb[_0x3b50('0x7f')]['id']},'include':[{'model':db[_0x47e9ff],'as':_0x3b50('0x118'),'attributes':['id',_0x3b50('0xa8'),_0x3b50('0x119')]},{'model':db[_0x3b50('0x6d')],'as':_0x3b50('0x11a'),'attributes':['id',_0x3b50('0xa8'),_0x3b50('0x10f')]},{'model':db[_0x3b50('0x41')],'as':_0x3b50('0x7c'),'attributes':['id','name',_0x3b50('0x11b')],'through':{'attributes':[]}}],'order':[[_0x3b50('0x109'),_0x3b50('0x10c')]]};if(_0x4e38cb['query']['range']){_0x1114a6['where'][_0x3b50('0x109')]={'$gte':_0x36cc4e['from'],'$lte':_0x36cc4e['to']};}switch(_0x18767a){case'chat':_0x1114a6['attributes'][_0x3b50('0x20')](_0x3b50('0x11c'),_0x3b50('0x11d'),_0x3b50('0x11e'),_0x3b50('0x11f'),_0x3b50('0x120'),_0x3b50('0x121'),_0x3b50('0x122'),_0x3b50('0x123'),_0x3b50('0x124'));break;case'mail':_0x1114a6[_0x3b50('0x2a')][_0x3b50('0x20')]('subject',_0x3b50('0x125'));break;case _0x3b50('0xfa'):_0x1114a6[_0x3b50('0x2a')][_0x3b50('0x20')](_0x3b50('0x126'),_0x3b50('0x127'));break;}return db[_[_0x3b50('0x110')](_0x18767a)+_0x3b50('0x128')]['findAndCountAll'](_0x1114a6)[_0x3b50('0x16')](function(_0x12d60e){_0x16e9ca[_0x3b50('0x14')]+=_0x12d60e['count'];return _['map'](_0x12d60e[_0x3b50('0xd3')],function(_0x5e241a){var _0x75e3ae=_0x5e241a['get']({'plain':!![]});_0x75e3ae['channel']=_0x18767a;if(_0x75e3ae[_0x3b50('0x11a')]){_0x75e3ae[_0x3b50('0x11a')]={'id':_0x75e3ae[_0x3b50('0x11a')]['id'],'name':_0x75e3ae[_0x3b50('0x11a')]['name'],'fullname':_0x75e3ae[_0x3b50('0x11a')]['fullname']};}return _0x75e3ae;});});}});return Promise[_0x3b50('0x23')](_0x2cd134);})[_0x3b50('0x16')](function(_0x23c536){return _(_0x23c536)[_0x3b50('0x129')]()['sortBy'](_0x3b50('0x109'))['reverse']()[_0x3b50('0x42')]();})[_0x3b50('0x16')](function(_0x232427){_0x16e9ca[_0x3b50('0xd3')]=_0x49a5da[_0x3b50('0x13')]?_0x232427[_0x3b50('0x12a')](_0x49a5da[_0x3b50('0x11')],_0x49a5da['offset']+_0x49a5da[_0x3b50('0x13')]):_0x232427;return _0x16e9ca;})[_0x3b50('0x16')](respondWithFilteredResult(_0x4f7e75,_0x49a5da))[_0x3b50('0x7d')](handleError(_0x4f7e75,null));};
\ No newline at end of file
+var _0x94df=['merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','TagIds','Tags','rows','params','catch','tags','columnName','displayName','analytics','alias','custom','type','values','body','findAll','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','bulkCreate','each','duplicates','$or','spread','omit','format','cf_%d','table','id\x20=\x20?','toParam','phone','CmHopper','getTags','options','nolimit','setTags','ids','rawAttributes','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','source','destination','callerid','starttime','note','userDisposition','userThirdDisposition','UserId','fullname','createdAt','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','threadId','Interaction','findAndCountAll','all','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','fieldType','model','filters','attributes','intersection','fields','hasOwnProperty','query','order','sort','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','where','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','some','getLists','user','role','agent','sequelize','toString','keyBy'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0x94df,0xa3));var _0xf94d=function(_0x3f650f,_0x34cd4f){_0x3f650f=_0x3f650f-0x0;var _0x326fd8=_0x94df[_0x3f650f];return _0x326fd8;};'use strict';var moment=require(_0xf94d('0x0'));var BPromise=require(_0xf94d('0x1'));var util=require(_0xf94d('0x2'));var path=require(_0xf94d('0x3'));var fs=require('fs');var _=require(_0xf94d('0x4'));var squel=require(_0xf94d('0x5'));var Papa=require('papaparse');var Redis=require(_0xf94d('0x6'));var qs=require(_0xf94d('0x7'));var as=require(_0xf94d('0x8'));var logger=require(_0xf94d('0x9'))(_0xf94d('0xa'));var config=require(_0xf94d('0xb'));var shared=require(_0xf94d('0xc'));var db=require(_0xf94d('0xd'))['db'];config[_0xf94d('0xe')]=_[_0xf94d('0xf')](config[_0xf94d('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xf94d('0x10'))(new Redis(config[_0xf94d('0xe')]));require(_0xf94d('0x11'))[_0xf94d('0x12')](socket);function respondWithResult(_0xdaa8d6,_0x45739c){_0x45739c=_0x45739c||0xc8;return function(_0x47efc6){if(_0x47efc6){return _0xdaa8d6[_0xf94d('0x13')](_0x45739c)[_0xf94d('0x14')](_0x47efc6);}};}function respondWithFilteredResult(_0x225d46,_0x19b1de){return function(_0x3a1e7c){if(_0x3a1e7c){var _0x509bf2=typeof _0x19b1de['offset']===_0xf94d('0x15')&&typeof _0x19b1de[_0xf94d('0x16')]===_0xf94d('0x15');var _0x28bdf8=_0x3a1e7c[_0xf94d('0x17')];var _0x381a5f=_0x509bf2?0x0:_0x19b1de['offset'];var _0x596da8=_0x509bf2?_0x3a1e7c[_0xf94d('0x17')]:_0x19b1de[_0xf94d('0x18')]+_0x19b1de[_0xf94d('0x16')];var _0xcc1a3a;if(_0x596da8>=_0x28bdf8){_0x596da8=_0x28bdf8;_0xcc1a3a=0xc8;}else{_0xcc1a3a=0xce;}_0x225d46[_0xf94d('0x13')](_0xcc1a3a);return _0x225d46[_0xf94d('0x19')](_0xf94d('0x1a'),_0x381a5f+'-'+_0x596da8+'/'+_0x28bdf8)['json'](_0x3a1e7c);}return null;};}function saveUpdates(_0x431b19){return function(_0x5cd967){if(_0x5cd967){return _0x5cd967[_0xf94d('0x1b')](_0x431b19)['then'](function(_0x29f4bc){return _0x29f4bc;});}return null;};}function removeEntity(_0x559e0c){return function(_0x30d231){if(_0x30d231){return _0x30d231[_0xf94d('0x1c')]()[_0xf94d('0x1d')](function(){_0x559e0c[_0xf94d('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfea3ae){return function(_0x5e0133){if(!_0x5e0133){_0xfea3ae[_0xf94d('0x1e')](0x194);}return _0x5e0133;};}function handleError(_0x3d9c88,_0x45adeb){_0x45adeb=_0x45adeb||0x1f4;return function(_0x2ede5b){logger['error'](_0x2ede5b[_0xf94d('0x1f')]);if(_0x2ede5b['name']){delete _0x2ede5b[_0xf94d('0x20')];}_0x3d9c88[_0xf94d('0x13')](_0x45adeb)[_0xf94d('0x21')](_0x2ede5b);};}exports['index']=function(_0x3f6b24,_0x8f50){var _0x2142a1={},_0x3c2aa={},_0x47470d={'count':0x0,'rows':[]};return db['CmContact'][_0xf94d('0x22')]()['then'](function(_0x4701e1){var _0x2564a3=[];for(var _0x302abf=0x0;_0x302abf<Object[_0xf94d('0x23')](_0x4701e1)[_0xf94d('0x24')];_0x302abf++){var _0x1c4bdf=Object[_0xf94d('0x23')](_0x4701e1)[_0x302abf];if(_[_0xf94d('0x25')](_0x1c4bdf,_0xf94d('0x26'))){_0x2564a3[_0xf94d('0x27')](db[_0xf94d('0x28')][_0xf94d('0x29')]({'where':{'id':_[_0xf94d('0x2a')](_0x1c4bdf,'cf_')},'raw':!![]}));}}return BPromise['all'](_0x2564a3)['then'](function(_0x5e63bb){for(var _0xbb4a6=0x0;_0xbb4a6<_0x5e63bb[_0xf94d('0x24')];_0xbb4a6++){if(_0x5e63bb[_0xbb4a6]){var _0x56ab8c=_0xf94d('0x26')+_0x5e63bb[_0xbb4a6]['id'];var _0x1c123b=_0x4701e1[_0x56ab8c];_0x1c123b[_0xf94d('0x2b')]=_0x5e63bb[_0xbb4a6]['type'];}}return _0x4701e1;});})[_0xf94d('0x1d')](function(_0x5ab0c8){_0x3c2aa[_0xf94d('0x2c')]=_[_0xf94d('0x23')](_0x5ab0c8);_0x3c2aa['query']=_[_0xf94d('0x23')](_0x3f6b24['query']);_0x3c2aa[_0xf94d('0x2d')]=_['intersection'](_0x3c2aa['model'],_0x3c2aa['query']);_0x2142a1[_0xf94d('0x2e')]=_[_0xf94d('0x2f')](_0x3c2aa['model'],qs[_0xf94d('0x30')](_0x3f6b24['query'][_0xf94d('0x30')]));_0x2142a1[_0xf94d('0x2e')]=_0x2142a1['attributes'][_0xf94d('0x24')]?_0x2142a1['attributes']:_0x3c2aa[_0xf94d('0x2c')];if(!_0x3f6b24['query'][_0xf94d('0x31')]('nolimit')){_0x2142a1[_0xf94d('0x16')]=qs[_0xf94d('0x16')](_0x3f6b24[_0xf94d('0x32')][_0xf94d('0x16')]);_0x2142a1['offset']=qs['offset'](_0x3f6b24['query'][_0xf94d('0x18')]);}_0x2142a1[_0xf94d('0x33')]=qs[_0xf94d('0x34')](_0x3f6b24[_0xf94d('0x32')]['sort']);_0x2142a1['where']=qs['filters'](_[_0xf94d('0x35')](_0x3f6b24[_0xf94d('0x32')],_0x3c2aa[_0xf94d('0x2d')]),_0x5ab0c8);var _0x3d2a9a=[];var _0x5d5b34=squel[_0xf94d('0x36')]()[_0xf94d('0x37')]('id')[_0xf94d('0x37')](_0xf94d('0x20'))['field'](_0xf94d('0x38'))[_0xf94d('0x39')](_0xf94d('0x3a'));var _0x430d67=squel[_0xf94d('0x36')]()[_0xf94d('0x39')](_0xf94d('0x3b'),'c')[_0xf94d('0x3c')](_0xf94d('0x3d'),'uc',_0xf94d('0x3e'))['left_join']('cm_contact_has_tags','ct',_0xf94d('0x3f'))['left_join'](_0xf94d('0x3a'),'t','t.id\x20=\x20ct.TagId')[_0xf94d('0x40')](_0xf94d('0x41'));var _0x311bf7=squel[_0xf94d('0x42')]();var _0x2f6782=[];var _0x5e2a20=squel[_0xf94d('0x42')]();var _0x50f3a3;if(_0x3f6b24[_0xf94d('0x32')]['search']){_0x50f3a3=as[_0xf94d('0x43')](_0x3f6b24[_0xf94d('0x32')][_0xf94d('0x44')]);var _0x36b24e=_0x50f3a3[_0xf94d('0x45')];for(var _0x157b7f=0x0;_0x157b7f<_0x50f3a3[_0xf94d('0x46')]['length'];_0x157b7f++){var _0x36ac14=_0x50f3a3[_0xf94d('0x46')][_0x157b7f];var _0x439b96='c';var _0x5ed160=_(_0x5ab0c8)[_0xf94d('0x23')]()[_0xf94d('0x47')](function(_0x41c72d){return _0x41c72d===_0x36ac14[_0xf94d('0x37')];});if(_0x5ed160)_0x5ed160=_0x5ab0c8[_0x36ac14[_0xf94d('0x37')]];if(!_0x5ed160){if(_0x36ac14[_0xf94d('0x37')]===_0xf94d('0x48')){var _0x535b7f=_0x36ac14[_0xf94d('0x49')][_0xf94d('0x4a')](',')[_0xf94d('0x4b')](function(_0x239095){return Number(_0x239095);});_0x535b7f[_0xf94d('0x4c')](function(_0x2408c9){_0x5e2a20['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2408c9+',%');});_0x2f6782=_['union'](_0x2f6782,_0x535b7f);}else if(_0x36ac14[_0xf94d('0x37')]===_0xf94d('0x4d')){_0x311bf7[_0xf94d('0x4e')](_0xf94d('0x4f'),_0x36ac14[_0xf94d('0x49')]);}}else{if(_0x36ac14['field']===_0xf94d('0x50')||_0x5ed160['fieldType']===_0xf94d('0x51'))_0x36ac14[_0xf94d('0x52')]=_0xf94d('0x53');var _0x3e6f7a=as[_0xf94d('0x54')](_0x439b96,_0x5ed160['type'],_0x36ac14);_0x311bf7[_0x36b24e](_0x3e6f7a[_0xf94d('0x55')],_0x3e6f7a[_0xf94d('0x49')][_0xf94d('0x56')],_0x3e6f7a[_0xf94d('0x49')]['end']);}}}else{var _0x159fb8=_(Object['keys'](_0x3f6b24['query']))[_0xf94d('0x4b')](function(_0x3ee368){return _0x5ab0c8[_0xf94d('0x31')](_0x3ee368)?_0x3ee368:undefined;})['filter'](function(_0x336a47){return!_['isNil'](_0x336a47);})[_0xf94d('0x49')]();if(_0x3f6b24[_0xf94d('0x32')][_0xf94d('0x57')])_0x159fb8[_0xf94d('0x27')](_0xf94d('0x57'));if(!_[_0xf94d('0x58')](_0x159fb8)){_0x159fb8['forEach'](function(_0x213c7){if(_0x213c7===_0xf94d('0x59')){_0x430d67[_0xf94d('0x40')](_0xf94d('0x5a'),[]['concat'](_0x3f6b24[_0xf94d('0x32')][_0x213c7]));}else if(_0x213c7==='Contact'){var _0x3072c4='%'+_0x3f6b24['query'][_0x213c7]+'%';_0x430d67[_0xf94d('0x40')](_0xf94d('0x5b'),_0x3072c4);}else{_0x430d67[_0xf94d('0x40')]('c.'+_0x213c7+_0xf94d('0x5c'),_0x3f6b24[_0xf94d('0x32')][_0x213c7]);}});}if(_0x3f6b24['query']['tag']){_0x2f6782=_[_0xf94d('0x5d')](_0x3f6b24[_0xf94d('0x32')][_0xf94d('0x5e')])?_0x3f6b24[_0xf94d('0x32')][_0xf94d('0x5e')]:new Array(_0x3f6b24[_0xf94d('0x32')]['tag']);_0x2f6782[_0xf94d('0x4c')](function(_0x17471f){_0x5e2a20['or'](_0xf94d('0x5f'),'%,'+_0x17471f+',%');});}if(_0x3f6b24[_0xf94d('0x32')]['filter']){var _0x4d58cf=_0x3f6b24[_0xf94d('0x32')][_0xf94d('0x60')][_0xf94d('0x61')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x4d58cf[_0xf94d('0x4a')]('\x20')[_0xf94d('0x24')]>0x1){_0x311bf7['or'](_0xf94d('0x62'),qs[_0xf94d('0x63')](_0x4d58cf),null);}else{if(qs[_0xf94d('0x64')](_0x4d58cf)){_0x311bf7['or'](_0xf94d('0x65'),_0x4d58cf+'%');_0x311bf7['or'](_0xf94d('0x66'),_0x4d58cf+'%');_0x311bf7['or'](_0xf94d('0x67'),_0x4d58cf+'%');_0x311bf7['or'](_0xf94d('0x68'),_0x4d58cf+'%');}else if(qs['isEmail'](_0x4d58cf)){_0x311bf7['or'](_0xf94d('0x69'),_0x4d58cf+'%');}else{_0x311bf7['or']('c.firstName\x20LIKE\x20?','%'+_0x4d58cf+'%');_0x311bf7['or'](_0xf94d('0x6a'),'%'+_0x4d58cf+'%');_0x311bf7['or']('c.email\x20LIKE\x20?','%'+_0x4d58cf+'%');}}}}_0x430d67[_0xf94d('0x40')](_0x311bf7);_0x430d67[_0xf94d('0x6b')](_0xf94d('0x6c'));var _0x596797={'type':db[_0xf94d('0x6d')][_0xf94d('0x6e')][_0xf94d('0x6f')],'raw':!![]};var _0xe3752f=_0x430d67['clone']()['field'](_0xf94d('0x6c'));if(_0x2142a1['order']){_0x2142a1['order'][_0xf94d('0x4c')](function(_0xd77762){_0x430d67['order']('c.'+_0xd77762[0x0],_0xd77762[0x1]===_0xf94d('0x70')?![]:!![]);});}if(!_['isEmpty'](_0x2f6782)){_0x430d67['having'](_0x5e2a20);_0xe3752f['where'](_0xf94d('0x71'),_0x2f6782);}BPromise['resolve']()[_0xf94d('0x1d')](function(){if(!_0x50f3a3)return;if(_0x3f6b24['user']['role']!=='agent')return;if(!_[_0xf94d('0x72')](_0x50f3a3['conditions'],['field',_0xf94d('0x4d')])){return _0x3f6b24['user'][_0xf94d('0x73')]({'attributes':['id'],'raw':!![]})[_0xf94d('0x1d')](function(_0x5b9dec){if(_[_0xf94d('0x58')](_0x5b9dec)){_0xe3752f['where']('c.ListId\x20IS\x20NULL');_0x430d67[_0xf94d('0x40')]('c.ListId\x20IS\x20NULL');}else{_0xe3752f[_0xf94d('0x40')](_0xf94d('0x5a'),_[_0xf94d('0x4b')](_0x5b9dec,'id'));_0x430d67[_0xf94d('0x40')]('c.ListId\x20IN\x20?',_[_0xf94d('0x4b')](_0x5b9dec,'id'));}});}})[_0xf94d('0x1d')](function(){if(_0x3f6b24[_0xf94d('0x74')][_0xf94d('0x75')]===_0xf94d('0x76')&&!_0x50f3a3&&!_0x3f6b24[_0xf94d('0x32')]['ListId'])return[];return db[_0xf94d('0x77')][_0xf94d('0x32')](_0xe3752f[_0xf94d('0x78')](),_0x596797);})[_0xf94d('0x1d')](function(_0xeb5b82){_0x47470d['count']=_0xeb5b82[_0xf94d('0x24')];if(_0x47470d[_0xf94d('0x17')]===0x0)return[];return db[_0xf94d('0x77')][_0xf94d('0x32')](_0x5d5b34['toString'](),_0x596797)[_0xf94d('0x1d')](function(_0x68ffc1){_0x3d2a9a=_[_0xf94d('0x79')](_0x68ffc1,'id');_0x596797=_[_0xf94d('0x7a')](_0x596797,{'model':db[_0xf94d('0x7b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f6b24[_0xf94d('0x32')][_0xf94d('0x30')]){_0x2142a1[_0xf94d('0x2e')][_0xf94d('0x4c')](function(_0x18befa){_0x430d67[_0xf94d('0x37')]('c.'+_0x18befa);});}else{_0x430d67[_0xf94d('0x37')](_0xf94d('0x6c'));_0x430d67[_0xf94d('0x37')](_0xf94d('0x7c'));_0x430d67[_0xf94d('0x37')](_0xf94d('0x7d'));_0x430d67[_0xf94d('0x37')](_0xf94d('0x7e'));_0x430d67[_0xf94d('0x37')](_0xf94d('0x7f'));_0x430d67[_0xf94d('0x37')](_0xf94d('0x80'));_0x430d67['field']('c.email');_0x430d67[_0xf94d('0x37')](_0xf94d('0x81'));_0x430d67[_0xf94d('0x37')](_0xf94d('0x82'));_0x430d67['field'](_0xf94d('0x83'));_0x430d67[_0xf94d('0x37')]('c.CompanyId');_0x430d67[_0xf94d('0x37')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf94d('0x84'));}if(_0x2142a1[_0xf94d('0x16')])_0x430d67[_0xf94d('0x16')](_0x2142a1[_0xf94d('0x16')]);if(_0x2142a1[_0xf94d('0x18')])_0x430d67[_0xf94d('0x18')](_0x2142a1[_0xf94d('0x18')]);return db[_0xf94d('0x77')]['query'](_0x430d67[_0xf94d('0x78')](),_0x596797);});})[_0xf94d('0x1d')](function(_0x308c2e){_0x308c2e[_0xf94d('0x4c')](function(_0x326177){if(_0x326177[_0xf94d('0x84')]){_0x326177[_0xf94d('0x85')]=[];_0x326177[_0xf94d('0x84')]['split'](',')[_0xf94d('0x4c')](function(_0x229f53){_0x326177['Tags'][_0xf94d('0x27')](_0x3d2a9a[_0x229f53]);});}delete _0x326177[_0xf94d('0x84')];});_0x47470d[_0xf94d('0x86')]=_0x308c2e;return _0x47470d;})['then'](respondWithFilteredResult(_0x8f50,_0x2142a1));})['catch'](handleError(_0x8f50,null));};exports[_0xf94d('0x1c')]=function(_0x184153,_0xe3ab15){return db[_0xf94d('0x7b')]['find']({'where':{'id':_0x184153[_0xf94d('0x87')]['id']}})[_0xf94d('0x1d')](handleEntityNotFound(_0xe3ab15,null))[_0xf94d('0x1d')](removeEntity(_0xe3ab15,null))[_0xf94d('0x88')](handleError(_0xe3ab15,null));};exports['describe']=function(_0x2445e1,_0x19f9ff){return db[_0xf94d('0x7b')][_0xf94d('0x22')]()[_0xf94d('0x1d')](function(_0x5f29f5){delete _0x5f29f5[_0xf94d('0x89')];for(var _0x32cf0b=0x0;_0x32cf0b<Object['keys'](_0x5f29f5)[_0xf94d('0x24')];_0x32cf0b++){var _0x55256b=Object[_0xf94d('0x23')](_0x5f29f5)[_0x32cf0b];if(!_[_0xf94d('0x25')](_0x55256b,_0xf94d('0x26'))){_0x5f29f5[_0x55256b][_0xf94d('0x8a')]=_0x55256b;_0x5f29f5[_0x55256b][_0xf94d('0x8b')]=_0x55256b;}}return _0x5f29f5;})[_0xf94d('0x1d')](function(_0x6fd2f5){var _0x40b31d={'where':Boolean(_0x2445e1[_0xf94d('0x32')][_0xf94d('0x8c')])===!![]?undefined:{'$or':[{'ListId':_0x2445e1[_0xf94d('0x32')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xf94d('0x28')]['findAll'](_0x40b31d)[_0xf94d('0x1d')](function(_0x3cf35e){for(var _0x460a21=0x0;_0x460a21<_0x3cf35e[_0xf94d('0x24')];_0x460a21++){var _0x15f5b9=_0xf94d('0x26')+_0x3cf35e[_0x460a21]['id'];_0x6fd2f5[_0x15f5b9][_0xf94d('0x8a')]=_0x15f5b9;_0x6fd2f5[_0x15f5b9][_0xf94d('0x8b')]=_0x3cf35e[_0x460a21][_0xf94d('0x8d')];_0x6fd2f5[_0x15f5b9][_0xf94d('0x8e')]={'type':_0x3cf35e[_0x460a21][_0xf94d('0x8f')],'values':_0x3cf35e[_0x460a21][_0xf94d('0x90')]};}Object[_0xf94d('0x23')](_0x6fd2f5)['forEach'](function(_0x5c5821){if(!_0x6fd2f5[_0x5c5821][_0xf94d('0x31')](_0xf94d('0x8a'))){delete _0x6fd2f5[_0x5c5821];}});return _0x6fd2f5;});})[_0xf94d('0x1d')](respondWithResult(_0x19f9ff,null))['catch'](handleError(_0x19f9ff,null));};exports['merge']=function(_0x2fc907,_0x1cc9ec){var _0x3f6d20;var _0x1b0de1;var _0x49b1b9;if(_0x2fc907['body']['id']){delete _0x2fc907[_0xf94d('0x91')]['id'];}return db[_0xf94d('0x7b')][_0xf94d('0x92')]({'where':{'id':[_0x2fc907[_0xf94d('0x91')]['to'],_0x2fc907[_0xf94d('0x91')][_0xf94d('0x39')]]}})[_0xf94d('0x1d')](function(_0x50b98e){if(_0x50b98e){if(_0x50b98e['length']!==0x2){return null;}_0x50b98e[0x0]=_0x50b98e[0x0]['get']({'plain':!![]});_0x50b98e[0x1]=_0x50b98e[0x1][_0xf94d('0x93')]({'plain':!![]});delete _0x50b98e[0x0]['id'];delete _0x50b98e[0x1]['id'];return _[_0xf94d('0x94')](_0x50b98e[0x0],_0x50b98e[0x1],function(_0x1c79b7,_0x342345){if(Array[_0xf94d('0x5d')](_0x342345)&&!_0x342345[_0xf94d('0x24')]){return _0x1c79b7;}else if(!_0x342345){return _0x1c79b7;}});}})[_0xf94d('0x1d')](handleEntityNotFound(_0x1cc9ec,null))['then'](function(_0x3a92b0){if(_0x3a92b0){if(_0x3a92b0[_0xf94d('0x89')]&&_['isArray'](_0x3a92b0[_0xf94d('0x89')])){_0x3a92b0[_0xf94d('0x89')]=_0x3a92b0[_0xf94d('0x89')][_0xf94d('0x95')]();}logger[_0xf94d('0x96')](_0xf94d('0x97'),_0x2fc907[_0xf94d('0x91')]['to'],_0x2fc907[_0xf94d('0x91')][_0xf94d('0x39')]);return db['CmHopper'][_0xf94d('0x1c')]({'where':{'ContactId':[_0x2fc907['body']['to'],_0x2fc907['body']['from']]}})['then'](function(_0x16147){logger[_0xf94d('0x96')](_0xf94d('0x98'),_0x16147);return db['CmHopperBlack']['destroy']({'where':{'ContactId':[_0x2fc907[_0xf94d('0x91')]['to'],_0x2fc907[_0xf94d('0x91')][_0xf94d('0x39')]]}})['then'](function(_0x55548a){logger['info'](_0xf94d('0x99'),_0x55548a);return db[_0xf94d('0x7b')][_0xf94d('0x9a')](_0x3a92b0);});});}})[_0xf94d('0x1d')](function(_0x6f3733){if(_0x6f3733){_0x3f6d20=_0x6f3733;_0x1b0de1={'ContactId':_0x3f6d20['id']};_0x49b1b9={'where':{'ContactId':[_0x2fc907[_0xf94d('0x91')]['to'],_0x2fc907[_0xf94d('0x91')][_0xf94d('0x39')]]}};return db[_0xf94d('0x9b')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db['ChatMessage'][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0x9c')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0x9d')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db['MailMessage'][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0x9d')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})['then'](function(){if(_0x3f6d20){return db[_0xf94d('0x9e')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db['SmsInteraction'][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})['then'](function(){if(_0x3f6d20){return db[_0xf94d('0x9f')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xa0')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db['FaxMessage'][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xa1')]['update'](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db['OpenchannelMessage']['update'](_0x1b0de1,_0x49b1b9);}})['then'](function(){if(_0x3f6d20){return db[_0xf94d('0xa2')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})['then'](function(){if(_0x3f6d20){return db[_0xf94d('0xa3')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xa4')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xa5')]['update'](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xa6')]['update'](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xa7')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xa8')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db['OpenchannelQueueReport']['update'](_0x1b0de1,_0x49b1b9);}})['then'](function(){if(_0x3f6d20){return db[_0xf94d('0xa9')]['update'](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xaa')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db['WhatsappInteraction']['update'](_0x1b0de1,_0x49b1b9);}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return db[_0xf94d('0xab')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})['then'](function(){if(_0x3f6d20){return db[_0xf94d('0xac')][_0xf94d('0x1b')](_0x1b0de1,_0x49b1b9);}})['then'](function(){if(_0x3f6d20){return db[_0xf94d('0x7b')][_0xf94d('0x1c')]({'where':{'id':[_0x2fc907[_0xf94d('0x91')]['to'],_0x2fc907[_0xf94d('0x91')][_0xf94d('0x39')]]}});}})[_0xf94d('0x1d')](function(){if(_0x3f6d20){return _0x3f6d20;}})[_0xf94d('0x1d')](respondWithResult(_0x1cc9ec,null))[_0xf94d('0x88')](handleError(_0x1cc9ec,null));};exports[_0xf94d('0x9a')]=function(_0x12df5d,_0x56c413){return db[_0xf94d('0x7b')]['describe']()[_0xf94d('0x1d')](function(_0x4ae9a9){if(_0x12df5d[_0xf94d('0x91')][_0xf94d('0x89')]&&_[_0xf94d('0x5d')](_0x12df5d['body'][_0xf94d('0x89')])){if(_0x12df5d[_0xf94d('0x91')]['tags'][_0xf94d('0x24')]){_0x12df5d[_0xf94d('0x91')][_0xf94d('0x89')]=_0x12df5d['body'][_0xf94d('0x89')][_0xf94d('0x95')](';')+';';}else{_0x12df5d[_0xf94d('0x91')][_0xf94d('0x89')]=null;}}else{_0x12df5d[_0xf94d('0x91')][_0xf94d('0x89')]=null;}if(!_['isNil'](_0x12df5d['body'][_0xf94d('0xad')])){var _0x33b28d=_0x12df5d[_0xf94d('0x91')][_0xf94d('0xad')];if(!_[_0xf94d('0xae')](shared[_0xf94d('0xaf')][_0x33b28d]))_0x12df5d[_0xf94d('0x91')]['utcOffset']=shared['timezones'][_0x33b28d][_0xf94d('0xb0')];}return db[_0xf94d('0x7b')]['create'](_0x12df5d[_0xf94d('0x91')],{'fields':_[_0xf94d('0x23')](_0x4ae9a9),'raw':!![]});})['then'](respondWithResult(_0x56c413,0xc9))[_0xf94d('0x88')](handleError(_0x56c413,null));};exports[_0xf94d('0xb1')]=function(_0x2f9e55,_0x10388b){var _0x12cc32=0x0;var _0x571f32=0x0;var _0x5e6c3c=0x0;return db[_0xf94d('0x7b')]['describe']()['then'](function(_0x3736a2){return BPromise[_0xf94d('0xb2')](_0x2f9e55[_0xf94d('0x91')],function(_0x3c4021){var _0x3a67ba={'where':{'$or':[]},'defaults':_0x3c4021,'fields':_[_0xf94d('0x23')](_0x3736a2),'raw':!![]};if(_0x3c4021[_0xf94d('0xb3')]){for(var _0x1bf58a=0x0;_0x1bf58a<_0x3c4021['duplicates'][_0xf94d('0x24')];_0x1bf58a++){var _0x51ca5e={};_0x51ca5e[_0x3c4021['duplicates'][_0x1bf58a]]=_0x3c4021[_0x3c4021[_0xf94d('0xb3')][_0x1bf58a]];_0x3a67ba['where'][_0xf94d('0xb4')][_0xf94d('0x27')](_0x51ca5e);}_0x3a67ba[_0xf94d('0x40')][_0xf94d('0x59')]=_0x3c4021[_0xf94d('0x59')];}return db[_0xf94d('0x7b')]['findOrCreate'](_0x3a67ba)[_0xf94d('0xb5')](function(_0x430d86,_0x1bf78c){if(_0x1bf78c){_0x12cc32++;}else{_0x5e6c3c++;}})[_0xf94d('0x88')](function(){_0x571f32++;});});})[_0xf94d('0x1d')](function(_0xc44493){if(_0xc44493){return{'success':_0x12cc32,'failure':_0x571f32,'duplicates':_0x5e6c3c};}})[_0xf94d('0x1d')](respondWithResult(_0x10388b,0xc9))['catch'](handleError(_0x10388b,null));};exports['show']=function(_0x305397,_0x58f6e8){var _0x403733;return db[_0xf94d('0x7b')][_0xf94d('0x22')]()['then'](function(_0x19448c){return db[_0xf94d('0x7b')]['find']({'where':{'id':_0x305397[_0xf94d('0x87')]['id']},'include':[{'model':db['Tag'],'as':_0xf94d('0x85'),'attributes':['id',_0xf94d('0x20'),_0xf94d('0x38')],'required':_0x305397['query']['tag']?!![]:![]}],'attributes':_[_0xf94d('0x23')](_0x19448c)});})[_0xf94d('0x1d')](function(_0x2b74d5){if(!_['isNil'](_0x2b74d5)){_0x403733=_0x2b74d5[_0xf94d('0x93')]({'plain':!![]});var _0x321c03={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2b74d5&&_0x2b74d5['ListId']){if(_0x2b74d5[_0xf94d('0x59')]){_0x321c03[_0xf94d('0x40')]['$and'][_0xf94d('0x27')]({'ListId':{'$ne':_0x2b74d5[_0xf94d('0x59')]}});}}return db[_0xf94d('0x28')][_0xf94d('0x92')](_0x321c03);}})[_0xf94d('0x1d')](function(_0x49bd34){if(!_[_0xf94d('0xae')](_0x49bd34)){return _[_0xf94d('0xb6')](_0x403733,_[_0xf94d('0x4b')](_0x49bd34,function(_0x4b5a28){return util[_0xf94d('0xb7')](_0xf94d('0xb8'),_0x4b5a28['id']);}));}})[_0xf94d('0x1d')](handleEntityNotFound(_0x58f6e8,null))['then'](respondWithResult(_0x58f6e8,null))['catch'](handleError(_0x58f6e8,null));};exports[_0xf94d('0x1b')]=function(_0x138152,_0x194227){var _0x2acb1f;if(_0x138152[_0xf94d('0x91')]['id']){delete _0x138152[_0xf94d('0x91')]['id'];}if(!_[_0xf94d('0xae')](_0x138152[_0xf94d('0x91')][_0xf94d('0xad')])){var _0x27931f=_0x138152[_0xf94d('0x91')]['dialTimezone'];if(!_[_0xf94d('0xae')](shared[_0xf94d('0xaf')][_0x27931f]))_0x138152[_0xf94d('0x91')]['utcOffset']=shared[_0xf94d('0xaf')][_0x27931f]['utcOffset'];}return db[_0xf94d('0x7b')][_0xf94d('0x47')]({'where':{'id':_0x138152[_0xf94d('0x87')]['id']}})[_0xf94d('0x1d')](handleEntityNotFound(_0x194227,null))[_0xf94d('0x1d')](saveUpdates(_0x138152[_0xf94d('0x91')],null))[_0xf94d('0x1d')](function(_0x351b13){_0x2acb1f=_0x351b13;var _0x172f65={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x351b13&&_0x351b13[_0xf94d('0x59')]){if(_0x351b13[_0xf94d('0x59')]){_0x172f65[_0xf94d('0x40')]['$and'][_0xf94d('0x27')]({'ListId':{'$ne':_0x351b13[_0xf94d('0x59')]}});}}return db['CmCustomField'][_0xf94d('0x92')](_0x172f65);})[_0xf94d('0x1d')](function(_0x2ba857){if(_0x2ba857){return _[_0xf94d('0xb6')](_['pickBy'](_0x138152[_0xf94d('0x91')],function(_0x3127a2,_0x333f46){return _[_0xf94d('0x25')](_0x333f46,_0xf94d('0x26'));}),_[_0xf94d('0x4b')](_0x2ba857,function(_0x159d93){return util[_0xf94d('0xb7')](_0xf94d('0xb8'),_0x159d93['id']);}));}})[_0xf94d('0x1d')](function(_0x5f4ed6){if(_0x5f4ed6&&!_[_0xf94d('0x58')](_0x5f4ed6)){var _0x3ffc92=squel[_0xf94d('0x1b')]()[_0xf94d('0xb9')](_0xf94d('0x3b'))['setFields'](_0x5f4ed6)[_0xf94d('0x40')](_0xf94d('0xba'),_0x138152[_0xf94d('0x87')]['id'])[_0xf94d('0xbb')]();return db['sequelize'][_0xf94d('0x32')](_0x3ffc92['text'],{'replacements':_0x3ffc92['values']});}})[_0xf94d('0x1d')](function(){if(_0x138152[_0xf94d('0x91')][_0xf94d('0xbc')]&&_0x2acb1f){return db[_0xf94d('0xbd')][_0xf94d('0x1b')]({'phone':_0x138152[_0xf94d('0x91')][_0xf94d('0xbc')]},{'where':{'ContactId':_0x2acb1f['id']}});}})[_0xf94d('0x1d')](function(){return _0x2acb1f;})[_0xf94d('0x1d')](respondWithResult(_0x194227,null))[_0xf94d('0x88')](handleError(_0x194227,null));};exports[_0xf94d('0xbe')]=function(_0x48b684,_0x317799){var _0x1f3168={};var _0x5e8421={};var _0x341d21;var _0x5b7c93;return db[_0xf94d('0x7b')][_0xf94d('0x29')]({'where':{'id':_0x48b684[_0xf94d('0x87')]['id']}})[_0xf94d('0x1d')](handleEntityNotFound(_0x317799,null))[_0xf94d('0x1d')](function(_0x3422ac){if(_0x3422ac){_0x341d21=_0x3422ac;_0x5e8421['model']=_[_0xf94d('0x23')](db[_0xf94d('0x48')]['rawAttributes']);_0x5e8421[_0xf94d('0x32')]=_[_0xf94d('0x23')](_0x48b684[_0xf94d('0x32')]);_0x5e8421[_0xf94d('0x2d')]=_[_0xf94d('0x2f')](_0x5e8421[_0xf94d('0x2c')],_0x5e8421[_0xf94d('0x32')]);_0x1f3168[_0xf94d('0x2e')]=_['intersection'](_0x5e8421[_0xf94d('0x2c')],qs[_0xf94d('0x30')](_0x48b684['query']['fields']));_0x1f3168[_0xf94d('0x2e')]=_0x1f3168[_0xf94d('0x2e')][_0xf94d('0x24')]?_0x1f3168[_0xf94d('0x2e')]:_0x5e8421[_0xf94d('0x2c')];_0x1f3168[_0xf94d('0x33')]=qs[_0xf94d('0x34')](_0x48b684[_0xf94d('0x32')]['sort']);_0x1f3168[_0xf94d('0x40')]=qs['filters'](_['pick'](_0x48b684[_0xf94d('0x32')],_0x5e8421[_0xf94d('0x2d')]));if(_0x48b684['query']['filter']){_0x1f3168[_0xf94d('0x40')]=_['merge'](_0x1f3168[_0xf94d('0x40')],{'$or':_['map'](_0x1f3168[_0xf94d('0x2e')],function(_0x4ce3be){var _0x383218={};_0x383218[_0x4ce3be]={'$like':'%'+_0x48b684['query'][_0xf94d('0x60')]+'%'};return _0x383218;})});}_0x1f3168=_[_0xf94d('0x7a')]({},_0x1f3168,_0x48b684[_0xf94d('0xbf')]);return _0x341d21['getTags'](_0x1f3168);}})['then'](function(_0x34d096){if(_0x34d096){_0x5b7c93=_0x34d096[_0xf94d('0x24')];if(!_0x48b684[_0xf94d('0x32')][_0xf94d('0x31')](_0xf94d('0xc0'))){_0x1f3168['limit']=qs['limit'](_0x48b684['query'][_0xf94d('0x16')]);_0x1f3168['offset']=qs[_0xf94d('0x18')](_0x48b684[_0xf94d('0x32')][_0xf94d('0x18')]);}return _0x341d21[_0xf94d('0xbe')](_0x1f3168);}})[_0xf94d('0x1d')](function(_0x314220){if(_0x314220){return _0x314220?{'count':_0x5b7c93,'rows':_0x314220}:null;}})[_0xf94d('0x1d')](respondWithResult(_0x317799,null))['catch'](handleError(_0x317799,null));};exports[_0xf94d('0xc1')]=function(_0x68dfb3,_0xfbc8f2){if(_0x68dfb3[_0xf94d('0x91')]['id']){delete _0x68dfb3[_0xf94d('0x91')]['id'];}return db[_0xf94d('0x7b')][_0xf94d('0x29')]({'where':{'id':_0x68dfb3['params']['id']}})[_0xf94d('0x1d')](handleEntityNotFound(_0xfbc8f2,null))[_0xf94d('0x1d')](function(_0x483dee){if(_0x483dee){return _0x483dee[_0xf94d('0xc1')](_0x68dfb3['body'][_0xf94d('0xc2')]||[]);}return null;})[_0xf94d('0x1d')](respondWithResult(_0xfbc8f2,null))[_0xf94d('0x88')](handleError(_0xfbc8f2,null));};exports['getHoppers']=function(_0x13cd5a,_0x466ef1){var _0x29315d={'raw':![],'where':{}};var _0x3c543d={};var _0x3e1d75={'count':0x0,'rows':[]};return db[_0xf94d('0x7b')][_0xf94d('0x29')]({'where':{'id':_0x13cd5a[_0xf94d('0x87')]['id']}})[_0xf94d('0x1d')](handleEntityNotFound(_0x466ef1,null))['then'](function(_0x578f31){if(_0x578f31){_0x3c543d[_0xf94d('0x2c')]=_['keys'](db[_0xf94d('0xbd')][_0xf94d('0xc3')]);_0x3c543d[_0xf94d('0x32')]=_[_0xf94d('0x23')](_0x13cd5a[_0xf94d('0x32')]);_0x3c543d[_0xf94d('0x2d')]=_[_0xf94d('0x2f')](_0x3c543d['model'],_0x3c543d[_0xf94d('0x32')]);_0x29315d[_0xf94d('0x2e')]=_[_0xf94d('0x2f')](_0x3c543d['model'],qs['fields'](_0x13cd5a[_0xf94d('0x32')][_0xf94d('0x30')]));_0x29315d[_0xf94d('0x2e')]=_0x29315d['attributes'][_0xf94d('0x24')]?_0x29315d[_0xf94d('0x2e')]:_0x3c543d['model'];if(!_0x13cd5a[_0xf94d('0x32')][_0xf94d('0x31')]('nolimit')){_0x29315d[_0xf94d('0x16')]=qs[_0xf94d('0x16')](_0x13cd5a[_0xf94d('0x32')][_0xf94d('0x16')]);_0x29315d['offset']=qs[_0xf94d('0x18')](_0x13cd5a[_0xf94d('0x32')][_0xf94d('0x18')]);}_0x29315d[_0xf94d('0x33')]=qs[_0xf94d('0x34')](_0x13cd5a[_0xf94d('0x32')]['sort']);_0x29315d[_0xf94d('0x40')]=qs[_0xf94d('0x2d')](_[_0xf94d('0x35')](_0x13cd5a[_0xf94d('0x32')],_0x3c543d[_0xf94d('0x2d')]));_0x29315d[_0xf94d('0x40')][_0xf94d('0xc4')]=_0x578f31['id'];if(_0x13cd5a['query'][_0xf94d('0x60')]){_0x29315d[_0xf94d('0x40')]=_['merge'](_0x29315d[_0xf94d('0x40')],{'$or':_[_0xf94d('0x4b')](_0x29315d[_0xf94d('0x2e')],function(_0x41c9bc){var _0x4ec0d1={};_0x4ec0d1[_0x41c9bc]={'$like':'%'+_0x13cd5a[_0xf94d('0x32')][_0xf94d('0x60')]+'%'};return _0x4ec0d1;})});}_0x29315d=_[_0xf94d('0x7a')]({},_0x29315d,_0x13cd5a[_0xf94d('0xbf')]);return db[_0xf94d('0xbd')]['count']({'where':_0x29315d[_0xf94d('0x40')]})[_0xf94d('0x1d')](function(_0x20ad8d){_0x3e1d75[_0xf94d('0x17')]=_0x20ad8d;if(_0x13cd5a['query'][_0xf94d('0xc5')]){_0x29315d['include']=[{'all':!![]}];}return db[_0xf94d('0xbd')][_0xf94d('0x92')](_0x29315d);})[_0xf94d('0x1d')](function(_0x5db1d6){_0x3e1d75[_0xf94d('0x86')]=_0x5db1d6;return _0x3e1d75;});}})[_0xf94d('0x1d')](respondWithFilteredResult(_0x466ef1,_0x29315d))['catch'](handleError(_0x466ef1,null));};exports['getHopperHistories']=function(_0x5ba794,_0x5a039e){var _0x3e996e={'raw':!![],'where':{}};var _0x1adf46={};var _0x6cfb75={'count':0x0,'rows':[]};return db['CmContact'][_0xf94d('0x29')]({'where':{'id':_0x5ba794[_0xf94d('0x87')]['id']}})[_0xf94d('0x1d')](handleEntityNotFound(_0x5a039e,null))[_0xf94d('0x1d')](function(_0x254645){if(_0x254645){_0x1adf46[_0xf94d('0x2c')]=_[_0xf94d('0x23')](db[_0xf94d('0xa3')][_0xf94d('0xc3')]);_0x1adf46[_0xf94d('0x32')]=_[_0xf94d('0x23')](_0x5ba794[_0xf94d('0x32')]);_0x1adf46[_0xf94d('0x2d')]=_[_0xf94d('0x2f')](_0x1adf46[_0xf94d('0x2c')],_0x1adf46[_0xf94d('0x32')]);_0x3e996e[_0xf94d('0x2e')]=_[_0xf94d('0x2f')](_0x1adf46[_0xf94d('0x2c')],qs[_0xf94d('0x30')](_0x5ba794['query'][_0xf94d('0x30')]));_0x3e996e[_0xf94d('0x2e')]=_0x3e996e[_0xf94d('0x2e')]['length']?_0x3e996e[_0xf94d('0x2e')]:_0x1adf46[_0xf94d('0x2c')];if(!_0x5ba794[_0xf94d('0x32')][_0xf94d('0x31')](_0xf94d('0xc0'))){_0x3e996e[_0xf94d('0x16')]=qs[_0xf94d('0x16')](_0x5ba794['query'][_0xf94d('0x16')]);_0x3e996e['offset']=qs[_0xf94d('0x18')](_0x5ba794[_0xf94d('0x32')][_0xf94d('0x18')]);}_0x3e996e['order']=qs[_0xf94d('0x34')](_0x5ba794[_0xf94d('0x32')][_0xf94d('0x34')]);_0x3e996e[_0xf94d('0x40')]=qs[_0xf94d('0x2d')](_['pick'](_0x5ba794[_0xf94d('0x32')],_0x1adf46[_0xf94d('0x2d')]));_0x3e996e['where'][_0xf94d('0xc4')]=_0x254645['id'];if(_0x5ba794['query'][_0xf94d('0x60')]){_0x3e996e[_0xf94d('0x40')]=_['merge'](_0x3e996e[_0xf94d('0x40')],{'$or':_['map'](_0x3e996e[_0xf94d('0x2e')],function(_0x43a1d1){var _0x1d0de1={};_0x1d0de1[_0x43a1d1]={'$like':'%'+_0x5ba794['query'][_0xf94d('0x60')]+'%'};return _0x1d0de1;})});}_0x3e996e=_['merge']({},_0x3e996e,_0x5ba794['options']);return db[_0xf94d('0xa3')][_0xf94d('0x17')]({'where':_0x3e996e[_0xf94d('0x40')]})[_0xf94d('0x1d')](function(_0x510742){_0x6cfb75['count']=_0x510742;if(_0x5ba794['query']['includeAll']){_0x3e996e[_0xf94d('0xc6')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3e996e);})[_0xf94d('0x1d')](function(_0x3cb364){_0x6cfb75[_0xf94d('0x86')]=_0x3cb364;return _0x6cfb75;});}})[_0xf94d('0x1d')](respondWithFilteredResult(_0x5a039e,_0x3e996e))[_0xf94d('0x88')](handleError(_0x5a039e,null));};exports[_0xf94d('0xc7')]=function(_0x23186e,_0x97d972){var _0x51273f={'raw':!![],'where':{}};var _0x417446={};var _0x55febb={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x23186e[_0xf94d('0x87')]['id']}})['then'](handleEntityNotFound(_0x97d972,null))[_0xf94d('0x1d')](function(_0xcfe3cc){if(_0xcfe3cc){_0x417446['model']=_[_0xf94d('0x23')](db[_0xf94d('0xa2')]['rawAttributes']);_0x417446[_0xf94d('0x32')]=_[_0xf94d('0x23')](_0x23186e[_0xf94d('0x32')]);_0x417446['filters']=_[_0xf94d('0x2f')](_0x417446[_0xf94d('0x2c')],_0x417446[_0xf94d('0x32')]);_0x51273f['attributes']=_[_0xf94d('0x2f')](_0x417446[_0xf94d('0x2c')],qs['fields'](_0x23186e[_0xf94d('0x32')][_0xf94d('0x30')]));_0x51273f[_0xf94d('0x2e')]=_0x51273f['attributes'][_0xf94d('0x24')]?_0x51273f[_0xf94d('0x2e')]:_0x417446[_0xf94d('0x2c')];if(!_0x23186e[_0xf94d('0x32')][_0xf94d('0x31')](_0xf94d('0xc0'))){_0x51273f['limit']=qs[_0xf94d('0x16')](_0x23186e[_0xf94d('0x32')][_0xf94d('0x16')]);_0x51273f[_0xf94d('0x18')]=qs[_0xf94d('0x18')](_0x23186e[_0xf94d('0x32')][_0xf94d('0x18')]);}_0x51273f[_0xf94d('0x33')]=qs[_0xf94d('0x34')](_0x23186e[_0xf94d('0x32')]['sort']);_0x51273f[_0xf94d('0x40')]=qs['filters'](_[_0xf94d('0x35')](_0x23186e['query'],_0x417446['filters']));_0x51273f['where']['ContactId']=_0xcfe3cc['id'];if(_0x23186e[_0xf94d('0x32')][_0xf94d('0x60')]){_0x51273f['where']=_[_0xf94d('0x7a')](_0x51273f[_0xf94d('0x40')],{'$or':_[_0xf94d('0x4b')](_0x51273f['attributes'],function(_0x52e764){var _0x4c9e3a={};_0x4c9e3a[_0x52e764]={'$like':'%'+_0x23186e[_0xf94d('0x32')][_0xf94d('0x60')]+'%'};return _0x4c9e3a;})});}_0x51273f=_[_0xf94d('0x7a')]({},_0x51273f,_0x23186e[_0xf94d('0xbf')]);return db[_0xf94d('0xa2')][_0xf94d('0x17')]({'where':_0x51273f['where']})[_0xf94d('0x1d')](function(_0x40918c){_0x55febb[_0xf94d('0x17')]=_0x40918c;if(_0x23186e[_0xf94d('0x32')][_0xf94d('0xc5')]){_0x51273f[_0xf94d('0xc6')]=[{'all':!![]}];}return db[_0xf94d('0xa2')][_0xf94d('0x92')](_0x51273f);})[_0xf94d('0x1d')](function(_0x7862fd){_0x55febb['rows']=_0x7862fd;return _0x55febb;});}})[_0xf94d('0x1d')](respondWithFilteredResult(_0x97d972,_0x51273f))[_0xf94d('0x88')](handleError(_0x97d972,null));};exports[_0xf94d('0xc8')]=function(_0x36cef2,_0x1128e9){var _0x4561c1={'raw':!![],'where':{}};var _0x4d3b7f={};var _0x3beac4={'count':0x0,'rows':[]};return db[_0xf94d('0x7b')][_0xf94d('0x29')]({'where':{'id':_0x36cef2['params']['id']}})['then'](handleEntityNotFound(_0x1128e9,null))['then'](function(_0x5af67f){if(_0x5af67f){_0x4d3b7f[_0xf94d('0x2c')]=_[_0xf94d('0x23')](db['JscriptySessionReport'][_0xf94d('0xc3')]);_0x4d3b7f[_0xf94d('0x32')]=_[_0xf94d('0x23')](_0x36cef2[_0xf94d('0x32')]);_0x4d3b7f[_0xf94d('0x2d')]=_[_0xf94d('0x2f')](_0x4d3b7f[_0xf94d('0x2c')],_0x4d3b7f[_0xf94d('0x32')]);_0x4561c1[_0xf94d('0x2e')]=_['intersection'](_0x4d3b7f[_0xf94d('0x2c')],qs[_0xf94d('0x30')](_0x36cef2['query'][_0xf94d('0x30')]));_0x4561c1[_0xf94d('0x2e')]=_0x4561c1['attributes'][_0xf94d('0x24')]?_0x4561c1['attributes']:_0x4d3b7f['model'];if(!_0x36cef2['query'][_0xf94d('0x31')](_0xf94d('0xc0'))){_0x4561c1[_0xf94d('0x16')]=qs[_0xf94d('0x16')](_0x36cef2[_0xf94d('0x32')][_0xf94d('0x16')]);_0x4561c1[_0xf94d('0x18')]=qs['offset'](_0x36cef2['query']['offset']);}_0x4561c1['order']=qs['sort'](_0x36cef2['query']['sort']);_0x4561c1[_0xf94d('0x40')]=qs[_0xf94d('0x2d')](_[_0xf94d('0x35')](_0x36cef2[_0xf94d('0x32')],_0x4d3b7f[_0xf94d('0x2d')]));_0x4561c1[_0xf94d('0x40')][_0xf94d('0xc4')]=_0x5af67f['id'];if(_0x36cef2['query'][_0xf94d('0x60')]){_0x4561c1['where']=_[_0xf94d('0x7a')](_0x4561c1[_0xf94d('0x40')],{'$or':_['map'](_0x4561c1['attributes'],function(_0x4b40c1){var _0x3c3cab={};_0x3c3cab[_0x4b40c1]={'$like':'%'+_0x36cef2[_0xf94d('0x32')][_0xf94d('0x60')]+'%'};return _0x3c3cab;})});}_0x4561c1=_['merge']({},_0x4561c1,_0x36cef2[_0xf94d('0xbf')]);return db[_0xf94d('0xaa')][_0xf94d('0x17')]({'where':_0x4561c1[_0xf94d('0x40')]})[_0xf94d('0x1d')](function(_0x2a2d06){_0x3beac4[_0xf94d('0x17')]=_0x2a2d06;if(_0x36cef2['query'][_0xf94d('0xc5')]){_0x4561c1[_0xf94d('0xc6')]=[{'all':!![]}];}return db[_0xf94d('0xaa')]['findAll'](_0x4561c1);})[_0xf94d('0x1d')](function(_0x2c423b){_0x3beac4[_0xf94d('0x86')]=_0x2c423b;return _0x3beac4;});}})['then'](respondWithFilteredResult(_0x1128e9,_0x4561c1))[_0xf94d('0x88')](handleError(_0x1128e9,null));};exports[_0xf94d('0xc9')]=function(_0x2d6b97,_0x35e55c){try{if(!_0x2d6b97['body'][_0xf94d('0x59')]){throw new Error('No\x20ListId\x20specified');}if(!_0x2d6b97[_0xf94d('0x91')][_0xf94d('0xca')]){throw new Error(_0xf94d('0xcb'));}if(!_0x2d6b97['body'][_0xf94d('0xcc')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x2d6b97['body'][_0xf94d('0xcd')]){throw new Error(_0xf94d('0xce'));}var _0x5205e5=_0x2d6b97[_0xf94d('0x91')][_0xf94d('0xca')][_0xf94d('0x4a')](',');var _0xb7966d=_0x2d6b97[_0xf94d('0x91')][_0xf94d('0xcc')][_0xf94d('0x4a')](',');if(!_0x5205e5[_0xf94d('0x24')]||!_0xb7966d['length']||_0x5205e5[_0xf94d('0x24')]!==_0xb7966d[_0xf94d('0x24')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x2d6b97[_0xf94d('0x91')]['fields']=_[_0xf94d('0xcf')](_0x5205e5,_0xb7966d);if(!_0x2d6b97[_0xf94d('0x91')][_0xf94d('0x30')][_0xf94d('0xbc')]){throw new Error(_0xf94d('0xd0'));}if(!_0x2d6b97[_0xf94d('0x91')][_0xf94d('0x30')][_0xf94d('0xd1')]){throw new Error(_0xf94d('0xd2'));}var _0x79aaf2=path[_0xf94d('0x95')](config['root'],'server/files/tmp',_0x2d6b97[_0xf94d('0xd3')][_0xf94d('0xd4')]);fs[_0xf94d('0xd5')](_0x79aaf2,parseInt(_0xf94d('0xd6'),0x8));var _0x1afdbc=require(_0xf94d('0xd7'))[_0xf94d('0xd8')](path['join'](__dirname,_0xf94d('0xd9')),[_0x79aaf2,_0x2d6b97['body'][_0xf94d('0xca')],_0x2d6b97[_0xf94d('0x91')]['binding_values'],_0x2d6b97['body'][_0xf94d('0x59')],_0x2d6b97[_0xf94d('0x91')][_0xf94d('0xda')],_0x2d6b97[_0xf94d('0x91')][_0xf94d('0xb3')],_0x2d6b97[_0xf94d('0x91')][_0xf94d('0xcd')]]);return _0x35e55c[_0xf94d('0x13')](0xc8)['json']({'message':_0xf94d('0xdb'),'pid':_0x1afdbc[_0xf94d('0xdc')]});}catch(_0x43555d){return _0x35e55c[_0xf94d('0x13')](0x1f4)['send'](_0x43555d);}};exports[_0xf94d('0xdd')]=function(_0x52c06e,_0x1cf978){var _0x2af4ac=fs[_0xf94d('0xde')](_0x52c06e[_0xf94d('0xd3')][_0xf94d('0x3')]);Papa[_0xf94d('0xdf')](_0x2af4ac,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5505f7){return _0x1cf978[_0xf94d('0x13')](0xc8)[_0xf94d('0x14')]({'file':_0x52c06e[_0xf94d('0xd3')],'fields':_0x5505f7[_0xf94d('0xe0')][_0xf94d('0x30')]});}});};exports[_0xf94d('0xe1')]=function(_0x172469,_0x19a054){return db[_0xf94d('0x4d')][_0xf94d('0x92')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xf94d('0x1d')](function(_0x6f7ec1){var _0x68d056=![];if(!_0x172469['body'][_0xf94d('0x59')]){throw new Error(_0xf94d('0xe2'));}if(!_0x172469[_0xf94d('0x91')][_0xf94d('0xe3')][_0xf94d('0xbc')]){throw new Error(_0xf94d('0xd0'));}if(!_0x172469[_0xf94d('0x91')]['binding'][_0xf94d('0xd1')]){throw new Error(_0xf94d('0xd2'));}if(!_0x172469['body'][_0xf94d('0xcd')]){throw new Error(_0xf94d('0xce'));}var _0x22889b=require('child_process')[_0xf94d('0xd8')](path[_0xf94d('0x95')](__dirname,_0xf94d('0xe4')),[_0x172469['params']['id'],JSON[_0xf94d('0xe5')](_0x172469[_0xf94d('0x91')]),JSON[_0xf94d('0xe5')](_0x6f7ec1)]);_0x22889b['on'](_0xf94d('0xe6'),function(){_0x68d056=!![];return _0x19a054[_0xf94d('0x13')](0xc8)[_0xf94d('0x14')]({'message':_0xf94d('0xe7'),'pid':_0x22889b[_0xf94d('0xdc')]});});_0x22889b['on'](_0xf94d('0xe8'),function(_0x1cc80f){if(_0x1cc80f&&!_0x68d056){return _0x19a054[_0xf94d('0x13')](0x1f4)[_0xf94d('0x14')]({'message':_0xf94d('0xe9'),'pid':_0x22889b['pid']});}});})[_0xf94d('0x88')](handleError(_0x19a054,null));};exports[_0xf94d('0xea')]=function(_0x1501ed,_0x1139c3){var _0x1e1ef5=[_0xf94d('0xeb'),_0xf94d('0xec'),_0xf94d('0xed'),_0xf94d('0xee'),'fax',_0xf94d('0xef'),'voice'];var _0x4b1429={'offset':0x0,'order':qs[_0xf94d('0x34')](_0xf94d('0xf0'))},_0x444c18={'count':0x0,'rows':[]};Promise[_0xf94d('0xf1')]()['then'](function(){if(_0x1501ed[_0xf94d('0x32')][_0xf94d('0xf2')]){if(!_[_0xf94d('0xf3')](_0x1e1ef5,_0x1501ed['query'][_0xf94d('0xf2')][_0xf94d('0xf4')]())){throw new Error(_0xf94d('0xf5'));}_0x1e1ef5=[_0x1501ed[_0xf94d('0x32')]['channel'][_0xf94d('0xf4')]()];}if(_0x1501ed[_0xf94d('0x32')][_0xf94d('0xf6')]){try{var _0x28b70f=JSON['parse'](_0x1501ed[_0xf94d('0x32')]['range']);if(!moment(_0x28b70f[_0xf94d('0x39')])[_0xf94d('0xf7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x28b70f['to'])[_0xf94d('0xf7')]()){throw new Error(_0xf94d('0xf8'));}}catch(_0x1dcfa1){throw new Error(_0xf94d('0xf9'));}}if(!_0x1501ed[_0xf94d('0x32')][_0xf94d('0x31')](_0xf94d('0xc0'))){_0x4b1429[_0xf94d('0x16')]=qs['limit'](_0x1501ed['query'][_0xf94d('0x16')]||0xa);_0x4b1429[_0xf94d('0x18')]=qs[_0xf94d('0x18')](_0x1501ed[_0xf94d('0x32')][_0xf94d('0x18')]);}var _0x251cd2=_0x1e1ef5[_0xf94d('0x4b')](function(_0x466536){if(_0x466536===_0xf94d('0xfa')){var _0x6e2858={'attributes':['id','uniqueid',_0xf94d('0x8f'),_0xf94d('0xfb'),_0xf94d('0xfc'),_0xf94d('0xfd'),_0xf94d('0xfe'),'endtime','duration',_0xf94d('0xff'),'createdAt',_0xf94d('0x100'),'userSecondDisposition',_0xf94d('0x101'),_0xf94d('0x102')],'where':{'ContactId':_0x1501ed['params']['id']},'include':[{'model':db[_0xf94d('0x4d')],'as':'User','attributes':['id','name',_0xf94d('0x103'),'alias']}],'order':[[_0xf94d('0x104'),_0xf94d('0x70')]]};if(_0x1501ed['query'][_0xf94d('0xf6')]){_0x6e2858[_0xf94d('0x40')]['createdAt']={'$gte':_0x28b70f[_0xf94d('0x39')],'$lte':_0x28b70f['to']};}return db[_0xf94d('0xa5')]['findAndCountAll'](_0x6e2858)[_0xf94d('0x1d')](function(_0xc534bc){_0x444c18['count']+=_0xc534bc['count'];return _['map'](_0xc534bc[_0xf94d('0x86')],function(_0x285515){var _0x57867b=_0x285515[_0xf94d('0x93')]({'plain':!![]});_0x57867b[_0xf94d('0xf2')]=_0x466536;if(_0x57867b[_0xf94d('0x4d')]){_0x57867b[_0xf94d('0x4d')]={'id':_0x57867b['User']['id'],'name':_0x57867b['User']['name'],'fullname':_0x57867b[_0xf94d('0x4d')][_0xf94d('0x103')],'alias':_0x57867b[_0xf94d('0x4d')][_0xf94d('0x8d')]};}return _0x57867b;});});}else{var _0x2fa297=_[_0xf94d('0x105')](_0x466536)+(_0x466536===_0xf94d('0xec')?_0xf94d('0x106'):_0xf94d('0x107'));var _0x15297d={'attributes':['id',_0xf94d('0x108'),_0xf94d('0x109'),_0xf94d('0x104'),'note',_0xf94d('0x10a'),_0xf94d('0x10b'),_0xf94d('0x10c'),_0xf94d('0x102'),_0x2fa297+'Id'],'where':{'ContactId':_0x1501ed['params']['id']},'include':[{'model':db[_0x2fa297],'as':_0xf94d('0x107'),'attributes':['id','name',_0xf94d('0x10d')]},{'model':db[_0xf94d('0x4d')],'as':_0xf94d('0x10e'),'attributes':['id',_0xf94d('0x20'),_0xf94d('0x103')]},{'model':db[_0xf94d('0x48')],'as':'Tags','attributes':['id',_0xf94d('0x20'),_0xf94d('0x38')],'through':{'attributes':[]}}],'order':[[_0xf94d('0x104'),_0xf94d('0x70')]]};if(_0x1501ed[_0xf94d('0x32')][_0xf94d('0xf6')]){_0x15297d['where'][_0xf94d('0x104')]={'$gte':_0x28b70f[_0xf94d('0x39')],'$lte':_0x28b70f['to']};}switch(_0x466536){case _0xf94d('0xec'):_0x15297d[_0xf94d('0x2e')]['push'](_0xf94d('0x10f'),_0xf94d('0x110'),_0xf94d('0x111'),_0xf94d('0x112'),_0xf94d('0x113'),_0xf94d('0x114'),'ratingType',_0xf94d('0x115'),_0xf94d('0x116'));break;case _0xf94d('0xeb'):_0x15297d['attributes'][_0xf94d('0x27')](_0xf94d('0x117'),'substatus');break;case _0xf94d('0xee'):_0x15297d[_0xf94d('0x2e')][_0xf94d('0x27')]('externalUrl',_0xf94d('0x118'));break;}return db[_[_0xf94d('0x105')](_0x466536)+_0xf94d('0x119')][_0xf94d('0x11a')](_0x15297d)['then'](function(_0x56b592){_0x444c18[_0xf94d('0x17')]+=_0x56b592['count'];return _[_0xf94d('0x4b')](_0x56b592[_0xf94d('0x86')],function(_0x4f6746){var _0x2a26bf=_0x4f6746['get']({'plain':!![]});_0x2a26bf[_0xf94d('0xf2')]=_0x466536;if(_0x2a26bf[_0xf94d('0x10e')]){_0x2a26bf[_0xf94d('0x10e')]={'id':_0x2a26bf[_0xf94d('0x10e')]['id'],'name':_0x2a26bf[_0xf94d('0x10e')][_0xf94d('0x20')],'fullname':_0x2a26bf[_0xf94d('0x10e')][_0xf94d('0x103')]};}return _0x2a26bf;});});}});return Promise[_0xf94d('0x11b')](_0x251cd2);})[_0xf94d('0x1d')](function(_0x16ab7f){return _(_0x16ab7f)['flatten']()['sortBy'](_0xf94d('0x104'))['reverse']()[_0xf94d('0x49')]();})[_0xf94d('0x1d')](function(_0x897230){_0x444c18[_0xf94d('0x86')]=_0x4b1429[_0xf94d('0x16')]?_0x897230[_0xf94d('0x11c')](_0x4b1429[_0xf94d('0x18')],_0x4b1429[_0xf94d('0x18')]+_0x4b1429[_0xf94d('0x16')]):_0x897230;return _0x444c18;})[_0xf94d('0x1d')](respondWithFilteredResult(_0x1139c3,_0x4b1429))['catch'](handleError(_0x1139c3,null));};
\ No newline at end of file
index 7c3d62e..b8f4759 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d4=['CmContact','setMaxListeners','save','update','remove','emit'];(function(_0x4b2827,_0x1d90a5){var _0x42f3bf=function(_0x5d9056){while(--_0x5d9056){_0x4b2827['push'](_0x4b2827['shift']());}};_0x42f3bf(++_0x1d90a5);}(_0xc7d4,0x16e));var _0x4c7d=function(_0x5b8708,_0x4f1140){_0x5b8708=_0x5b8708-0x0;var _0xccf8fd=_0xc7d4[_0x5b8708];return _0xccf8fd;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db'][_0x4c7d('0x0')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x4c7d('0x1')](0x0);var events={'afterCreate':_0x4c7d('0x2'),'afterUpdate':_0x4c7d('0x3'),'afterDestroy':_0x4c7d('0x4')};function emitEvent(_0x366349){return function(_0x129a2d,_0x46e6dd,_0x5f370c){CmContactEvents[_0x4c7d('0x5')](_0x366349+':'+_0x129a2d['id'],_0x129a2d);CmContactEvents[_0x4c7d('0x5')](_0x366349,_0x129a2d);_0x5f370c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0xefb1=['save','update','remove','hasOwnProperty','events'];(function(_0x7822cb,_0x26769b){var _0x5cfde1=function(_0x5c6f7b){while(--_0x5c6f7b){_0x7822cb['push'](_0x7822cb['shift']());}};_0x5cfde1(++_0x26769b);}(_0xefb1,0x149));var _0x1efb=function(_0x1e7f67,_0x574965){_0x1e7f67=_0x1e7f67-0x0;var _0x1e1d78=_0xefb1[_0x1e7f67];return _0x1e1d78;};'use strict';var EventEmitter=require(_0x1efb('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1efb('0x1'),'afterUpdate':_0x1efb('0x2'),'afterDestroy':_0x1efb('0x3')};function emitEvent(_0x250c4a){return function(_0x3b934a,_0x220088,_0x154455){CmContactEvents['emit'](_0x250c4a+':'+_0x3b934a['id'],_0x3b934a);CmContactEvents['emit'](_0x250c4a,_0x3b934a);_0x154455(null);};}for(var e in events){if(events[_0x1efb('0x4')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
index cdbf501..ba8803a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddb5=['findOne','isNil','timezones','utcOffset','add','YYYY-MM-DD\x20HH:mm:ss','then','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','create','catch','afterCreate','Campaign','minutes','\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','outbound','dialCheckDuplicateType','CmList','length','get','always','findAll','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Lists','onlyIfOpen','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','api','moment','bluebird','request-promise','../../config/environment/shared','define','CmContact','phone','fti_cm_contacts','lastName','mobile','fax','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','inspect','scheduledat','format','dialTimezone','VoiceQueue'];(function(_0x143cce,_0x5f557f){var _0x3c5e3c=function(_0x3c27e0){while(--_0x3c27e0){_0x143cce['push'](_0x143cce['shift']());}};_0x3c5e3c(++_0x5f557f);}(_0xddb5,0x76));var _0x5ddb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xddb5[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5ddb('0x0'));var moment=require(_0x5ddb('0x1'));var BPromise=require(_0x5ddb('0x2'));var rp=require(_0x5ddb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require(_0x5ddb('0x4'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x2a97a3,_0x1cabb1){return _0x2a97a3[_0x5ddb('0x5')](_0x5ddb('0x6'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x5ddb('0x7'),'fields':[_0x5ddb('0x7')]},{'name':_0x5ddb('0x8'),'fields':['firstName',_0x5ddb('0x9'),_0x5ddb('0x7'),_0x5ddb('0xa'),_0x5ddb('0xb'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x5ddb('0xc'),'collate':_0x5ddb('0xd'),'hooks':{'afterCreate':function(_0x14a84f,_0x49be99,_0x367da5){var _0x53858a=_0x2a97a3[_0x5ddb('0xe')];var _0x46f021=_0x14a84f['get']({'plain':!![]});function _0xa49704(){return function(_0x71832c){logger[_0x5ddb('0xf')](_0x5ddb('0x10'),'afterCreate',util[_0x5ddb('0x11')](_0x71832c,{'showHidden':![],'depth':null}));};}function _0x5ccab0(_0x39caeb,_0x2342f1){var _0x11a53b=_0x2342f1[_0x5ddb('0x12')]?_0x2342f1[_0x5ddb('0x12')]:moment()[_0x5ddb('0x13')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x458920,_0x563f2e){if(_['isNil'](_0x2342f1[_0x5ddb('0x14')])){_0x458920({'ret':_0x11a53b});}else{_0x53858a[_0x5ddb('0x15')][_0x5ddb('0x16')]({'where':{'id':_0x39caeb['id']}})['then'](function(_0x1bed7e){if(!_['isNil'](_0x1bed7e)){var _0x187cef=_0x1bed7e[_0x5ddb('0x14')];if(!_[_0x5ddb('0x17')](_0x187cef)){var _0x57197f=shared[_0x5ddb('0x18')];var _0x467e8d=_0x57197f[_0x187cef];var _0x4265d7=_0x57197f[_0x2342f1[_0x5ddb('0x14')]];if(!_[_0x5ddb('0x17')](_0x467e8d)&&!_[_0x5ddb('0x17')](_0x4265d7)){var _0x12d502=_0x467e8d[_0x5ddb('0x19')]-_0x4265d7['utcOffset'];_0x11a53b=_0x2342f1[_0x5ddb('0x12')]?_0x2342f1[_0x5ddb('0x12')]:moment();var _0x579c3e=moment(_0x11a53b)[_0x5ddb('0x1a')](_0x12d502,'minutes');_0x458920({'ret':_0x579c3e[_0x5ddb('0x13')](_0x5ddb('0x1b'))});}else _0x458920({'ret':_0x11a53b});}else _0x458920({'ret':_0x11a53b});}else{_0x458920({'ret':_0x11a53b});}});}});return 0xa;}var _0x3ea679=function(_0x395552){return new BPromise(function(_0x16380b,_0x463cc5){_0x5ccab0(_0x395552,_0x46f021)[_0x5ddb('0x1c')](function(_0x4f51eb){_0x46f021['scheduledat']=_0x4f51eb[_0x5ddb('0x1d')];_0x53858a[_0x5ddb('0x1e')][_0x5ddb('0x16')]({'where':{'phone':_0x46f021[_0x5ddb('0x7')],'VoiceQueueId':_0x395552['id']}})['then'](function(_0x5a3739){if(!_[_0x5ddb('0x17')](_0x5a3739)){throw new Error('cmContact,\x20afterCreate\x20'+_0x46f021[_0x5ddb('0x7')]+_0x5ddb('0x1f')+_0x395552['id']);}return _0x53858a[_0x5ddb('0x1e')]['create']({'phone':_0x46f021[_0x5ddb('0x7')],'ContactId':_0x46f021['id'],'ListId':_0x46f021[_0x5ddb('0x20')],'priority':_0x46f021['priority']?_0x46f021[_0x5ddb('0x21')]:0x2,'scheduledat':_0x46f021['scheduledat']?_0x46f021['scheduledat']:moment()[_0x5ddb('0x13')](_0x5ddb('0x1b')),'callback':_0x46f021[_0x5ddb('0x22')]?!![]:![],'callbackuniqueid':_0x46f021[_0x5ddb('0x22')]?_0x46f021[_0x5ddb('0x22')]:undefined,'callbackat':_0x46f021[_0x5ddb('0x22')]?moment()[_0x5ddb('0x13')](_0x5ddb('0x1b')):undefined,'VoiceQueueId':_0x395552['id']});})['catch'](function(_0x5ebc4d){_0x463cc5(_0x5ebc4d);});});});};var _0x3f59b4=function(_0x2dfac0){return new BPromise(function(_0x373047,_0x4a3037){_0x5ccab0(_0x2dfac0,_0x46f021)['then'](function(_0x5ac429){_0x46f021[_0x5ddb('0x12')]=_0x5ac429[_0x5ddb('0x1d')];_0x53858a[_0x5ddb('0x1e')][_0x5ddb('0x16')]({'where':{'phone':_0x46f021[_0x5ddb('0x7')],'VoiceQueueId':_0x2dfac0['id']}})[_0x5ddb('0x1c')](function(_0x5a51cf){if(!_[_0x5ddb('0x17')](_0x5a51cf)){throw new Error(_0x5ddb('0x23')+_0x46f021[_0x5ddb('0x7')]+_0x5ddb('0x24')+_0x2dfac0['id']);}return _0x53858a[_0x5ddb('0x25')][_0x5ddb('0x16')]({'where':{'calleridnum':_0x46f021[_0x5ddb('0x7')],'VoiceQueueId':_0x2dfac0['id']}});})['then'](function(_0x228147){if(!_['isNil'](_0x228147)){throw new Error(_0x5ddb('0x26')+_0x46f021[_0x5ddb('0x7')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x2dfac0['id']);}return _0x53858a[_0x5ddb('0x1e')][_0x5ddb('0x27')]({'phone':_0x46f021[_0x5ddb('0x7')],'ContactId':_0x46f021['id'],'ListId':_0x46f021[_0x5ddb('0x20')],'priority':_0x46f021[_0x5ddb('0x21')]?_0x46f021['priority']:0x2,'scheduledat':_0x46f021[_0x5ddb('0x12')]?_0x46f021['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x46f021[_0x5ddb('0x22')]?!![]:![],'callbackuniqueid':_0x46f021[_0x5ddb('0x22')]?_0x46f021[_0x5ddb('0x22')]:undefined,'callbackat':_0x46f021[_0x5ddb('0x22')]?moment()['format'](_0x5ddb('0x1b')):undefined,'VoiceQueueId':_0x2dfac0['id']});})[_0x5ddb('0x28')](function(_0x409d08){_0x4a3037(_0x409d08);});});});};function _0x4f9131(){return function(_0xa1a45){logger[_0x5ddb('0xf')](_0x5ddb('0x10'),_0x5ddb('0x29'),util[_0x5ddb('0x11')](_0xa1a45,{'showHidden':![],'depth':null}));};}function _0xd8a886(_0x4e465f,_0x2ad83b){var _0x888888=_0x2ad83b[_0x5ddb('0x12')]?_0x2ad83b[_0x5ddb('0x12')]:moment()[_0x5ddb('0x13')](_0x5ddb('0x1b'));return new BPromise(function(_0x1fc449,_0x4f85e9){if(_[_0x5ddb('0x17')](_0x2ad83b[_0x5ddb('0x14')])){_0x1fc449({'ret':_0x888888});}else{_0x53858a[_0x5ddb('0x2a')]['findOne']({'where':{'id':_0x4e465f['id']}})['then'](function(_0x408ae0){if(!_[_0x5ddb('0x17')](_0x408ae0)){var _0x200990=_0x408ae0[_0x5ddb('0x14')];if(!_[_0x5ddb('0x17')](_0x200990)){var _0x5d492b=shared[_0x5ddb('0x18')];var _0x82d5b6=_0x5d492b[_0x200990];var _0x2a2466=_0x5d492b[_0x2ad83b[_0x5ddb('0x14')]];if(!_[_0x5ddb('0x17')](_0x82d5b6)&&!_[_0x5ddb('0x17')](_0x2a2466)){var _0x22a5e1=_0x82d5b6['utcOffset']-_0x2a2466[_0x5ddb('0x19')];_0x888888=_0x2ad83b['scheduledat']?_0x2ad83b[_0x5ddb('0x12')]:moment();var _0x359c16=moment(_0x888888)[_0x5ddb('0x1a')](_0x22a5e1,_0x5ddb('0x2b'));_0x1fc449({'ret':_0x359c16[_0x5ddb('0x13')](_0x5ddb('0x1b'))});}else _0x1fc449({'ret':_0x888888});}else _0x1fc449({'ret':_0x888888});}else{_0x1fc449({'ret':_0x888888});}});}});return 0xa;}var _0x47c82f=function(_0x2d4522){return new BPromise(function(_0x24696a,_0x43a9aa){_0xd8a886(_0x2d4522,_0x46f021)[_0x5ddb('0x1c')](function(_0x351490){_0x46f021['scheduledat']=_0x351490[_0x5ddb('0x1d')];_0x53858a[_0x5ddb('0x1e')][_0x5ddb('0x16')]({'where':{'phone':_0x46f021[_0x5ddb('0x7')],'CampaignId':_0x2d4522['id']}})[_0x5ddb('0x1c')](function(_0x9e2f8b){if(!_[_0x5ddb('0x17')](_0x9e2f8b)){throw new Error('cmContact,\x20afterCreate\x20'+_0x46f021['phone']+_0x5ddb('0x2c')+_0x2d4522['id']);}return _0x53858a[_0x5ddb('0x1e')][_0x5ddb('0x27')]({'phone':_0x46f021[_0x5ddb('0x7')],'ContactId':_0x46f021['id'],'ListId':_0x46f021[_0x5ddb('0x20')],'priority':_0x46f021[_0x5ddb('0x21')]?_0x46f021[_0x5ddb('0x21')]:0x2,'scheduledat':_0x46f021[_0x5ddb('0x12')]?_0x46f021['scheduledat']:moment()['format'](_0x5ddb('0x1b')),'callback':_0x46f021[_0x5ddb('0x22')]?!![]:![],'callbackuniqueid':_0x46f021['callbackUniqueid']?_0x46f021[_0x5ddb('0x22')]:undefined,'callbackat':_0x46f021[_0x5ddb('0x22')]?moment()[_0x5ddb('0x13')](_0x5ddb('0x1b')):undefined,'CampaignId':_0x2d4522['id']});})[_0x5ddb('0x28')](function(_0x51f1cb){_0x43a9aa(_0x51f1cb);});});});};var _0x58dcbe=function(_0x3d3f6c){return new BPromise(function(_0x23009d,_0x279c10){_0xd8a886(_0x3d3f6c,_0x46f021)[_0x5ddb('0x1c')](function(_0xd1546e){_0x46f021['scheduledat']=_0xd1546e[_0x5ddb('0x1d')];_0x53858a[_0x5ddb('0x1e')]['findOne']({'where':{'phone':_0x46f021[_0x5ddb('0x7')],'CampaignId':_0x3d3f6c['id']}})[_0x5ddb('0x1c')](function(_0x194c0c){if(!_[_0x5ddb('0x17')](_0x194c0c)){throw new Error(_0x5ddb('0x23')+_0x46f021[_0x5ddb('0x7')]+_0x5ddb('0x2d')+_0x3d3f6c['id']);}return _0x53858a[_0x5ddb('0x25')][_0x5ddb('0x16')]({'where':{'calleridnum':_0x46f021[_0x5ddb('0x7')],'CampaignId':_0x3d3f6c['id']}});})[_0x5ddb('0x1c')](function(_0x1a7639){if(!_['isNil'](_0x1a7639)){throw new Error(_0x5ddb('0x26')+_0x46f021[_0x5ddb('0x7')]+_0x5ddb('0x2e')+_0x3d3f6c['id']);}return _0x53858a[_0x5ddb('0x1e')][_0x5ddb('0x27')]({'phone':_0x46f021[_0x5ddb('0x7')],'ContactId':_0x46f021['id'],'ListId':_0x46f021['ListId'],'priority':_0x46f021[_0x5ddb('0x21')]?_0x46f021[_0x5ddb('0x21')]:0x2,'scheduledat':_0x46f021[_0x5ddb('0x12')]?_0x46f021[_0x5ddb('0x12')]:moment()[_0x5ddb('0x13')](_0x5ddb('0x1b')),'callback':_0x46f021[_0x5ddb('0x22')]?!![]:![],'callbackuniqueid':_0x46f021['callbackUniqueid']?_0x46f021[_0x5ddb('0x22')]:undefined,'callbackat':_0x46f021[_0x5ddb('0x22')]?moment()[_0x5ddb('0x13')](_0x5ddb('0x1b')):undefined,'CampaignId':_0x3d3f6c['id']});})[_0x5ddb('0x28')](function(_0x11fd5a){_0x279c10(_0x11fd5a);});});});};if(_0x46f021[_0x5ddb('0x20')]){_0x53858a[_0x5ddb('0x15')]['findAll']({'where':{'type':_0x5ddb('0x2f')},'attributes':['id',_0x5ddb('0x30'),_0x5ddb('0x14')],'include':[{'model':_0x53858a[_0x5ddb('0x31')],'as':'Lists','where':{'id':_0x46f021[_0x5ddb('0x20')]}}]})['then'](function(_0x4face7){if(_0x4face7){var _0x9a4d7b=[];for(var _0x24edf0=0x0,_0x5bf48b;_0x24edf0<_0x4face7[_0x5ddb('0x32')];_0x24edf0+=0x1){_0x5bf48b=_0x4face7[_0x24edf0][_0x5ddb('0x33')]({'plain':!![]});switch(_0x5bf48b[_0x5ddb('0x30')]){case _0x5ddb('0x34'):_0x3f59b4(_0x5bf48b)[_0x5ddb('0x28')](_0xa49704());break;case'onlyIfOpen':_0x3ea679(_0x5bf48b)[_0x5ddb('0x28')](_0xa49704());break;default:_0xd8a886(_0x5bf48b,_0x46f021)[_0x5ddb('0x1c')](function(_0x17a2a2){_0x46f021['scheduledat']=_0x17a2a2[_0x5ddb('0x1d')];_0x53858a[_0x5ddb('0x1e')][_0x5ddb('0x27')]({'phone':_0x46f021[_0x5ddb('0x7')],'ContactId':_0x46f021['id'],'ListId':_0x46f021['ListId'],'scheduledat':_0x46f021[_0x5ddb('0x12')]?_0x46f021['scheduledat']:moment()[_0x5ddb('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x46f021[_0x5ddb('0x21')]?_0x46f021[_0x5ddb('0x21')]:0x2,'callback':_0x46f021[_0x5ddb('0x22')]?!![]:![],'callbackuniqueid':_0x46f021[_0x5ddb('0x22')]?_0x46f021[_0x5ddb('0x22')]:undefined,'callbackat':_0x46f021[_0x5ddb('0x22')]?moment()[_0x5ddb('0x13')](_0x5ddb('0x1b')):undefined,'VoiceQueueId':_0x5bf48b['id']})[_0x5ddb('0x28')](_0xa49704());});}}}})['then'](function(){return _0x53858a[_0x5ddb('0x15')][_0x5ddb('0x35')]({'where':{'type':_0x5ddb('0x2f')},'attributes':['id'],'include':[{'model':_0x53858a['CmList'],'as':_0x5ddb('0x36'),'where':{'id':_0x46f021[_0x5ddb('0x20')]}}]})[_0x5ddb('0x1c')](function(_0x549a94){if(_0x549a94){var _0x14511a=[];for(var _0x162cda=0x0,_0x435f0a;_0x162cda<_0x549a94[_0x5ddb('0x32')];_0x162cda+=0x1){_0x435f0a=_0x549a94[_0x162cda][_0x5ddb('0x33')]({'plain':!![]});_0x53858a[_0x5ddb('0x37')][_0x5ddb('0x27')]({'phone':_0x46f021[_0x5ddb('0x7')],'ContactId':_0x46f021['id'],'ListId':_0x46f021[_0x5ddb('0x20')],'VoiceQueueId':_0x435f0a['id']})[_0x5ddb('0x28')](function(_0x471e1c){logger[_0x5ddb('0xf')](_0x5ddb('0x38'),'afterCreate',_0x471e1c[_0x5ddb('0x39')]);});}}});})['then'](function(){return _0x53858a[_0x5ddb('0x2a')]['findAll']({'attributes':['id',_0x5ddb('0x30'),_0x5ddb('0x14')],'include':[{'model':_0x53858a[_0x5ddb('0x31')],'as':_0x5ddb('0x3a'),'where':{'id':_0x46f021[_0x5ddb('0x20')]}}]})[_0x5ddb('0x1c')](function(_0x1c98d6){if(_0x1c98d6){var _0x398eb8=[];for(var _0x943367=0x0,_0x2cea4a;_0x943367<_0x1c98d6['length'];_0x943367+=0x1){_0x2cea4a=_0x1c98d6[_0x943367][_0x5ddb('0x33')]({'plain':!![]});switch(_0x2cea4a[_0x5ddb('0x30')]){case'always':_0x58dcbe(_0x2cea4a)['catch'](_0x4f9131());break;case _0x5ddb('0x3b'):_0x47c82f(_0x2cea4a)[_0x5ddb('0x28')](_0x4f9131());break;default:_0x53858a[_0x5ddb('0x1e')][_0x5ddb('0x27')]({'phone':_0x46f021['phone'],'ContactId':_0x46f021['id'],'ListId':_0x46f021[_0x5ddb('0x20')],'scheduledat':_0x46f021[_0x5ddb('0x12')]?_0x46f021[_0x5ddb('0x12')]:moment()[_0x5ddb('0x13')](_0x5ddb('0x1b')),'priority':_0x46f021[_0x5ddb('0x21')]?_0x46f021[_0x5ddb('0x21')]:0x2,'callback':_0x46f021[_0x5ddb('0x22')]?!![]:![],'callbackuniqueid':_0x46f021[_0x5ddb('0x22')]?_0x46f021[_0x5ddb('0x22')]:undefined,'callbackat':_0x46f021[_0x5ddb('0x22')]?moment()[_0x5ddb('0x13')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x2cea4a['id']})[_0x5ddb('0x28')](_0x4f9131());}}}});})[_0x5ddb('0x1c')](function(){return _0x53858a[_0x5ddb('0x2a')][_0x5ddb('0x35')]({'attributes':['id'],'include':[{'model':_0x53858a[_0x5ddb('0x31')],'as':_0x5ddb('0x36'),'where':{'id':_0x46f021[_0x5ddb('0x20')]}}]})[_0x5ddb('0x1c')](function(_0x1f8467){if(_0x1f8467){var _0xe47e27=[];for(var _0x3a6211=0x0,_0x282dc6;_0x3a6211<_0x1f8467[_0x5ddb('0x32')];_0x3a6211+=0x1){_0x282dc6=_0x1f8467[_0x3a6211][_0x5ddb('0x33')]({'plain':!![]});_0x53858a[_0x5ddb('0x37')][_0x5ddb('0x27')]({'phone':_0x46f021[_0x5ddb('0x7')],'ContactId':_0x46f021['id'],'ListId':_0x46f021[_0x5ddb('0x20')],'CampaignId':_0x282dc6['id']})[_0x5ddb('0x28')](function(_0x22e477){logger[_0x5ddb('0xf')]('cmContact,\x20%s,\x20%s',_0x5ddb('0x29'),_0x22e477['message']);});}}});})['then'](function(){_0x367da5();})[_0x5ddb('0x28')](function(_0x525f01){logger['error']('cmContact,\x20%s,\x20%s',_0x5ddb('0x29'),_0x525f01['message']);_0x367da5(_0x525f01);});}else{_0x367da5(new Error(_0x5ddb('0x3c')));}},'afterDestroy':function(_0x3b39b0,_0x38e4bd,_0x3c4f5a){var _0x55ff21=_0x2a97a3['models'];var _0x42cd9a=_0x3b39b0[_0x5ddb('0x33')]({'plain':!![]});return _0x55ff21[_0x5ddb('0x1e')]['findAll']({'raw':!![],'where':{'ListId':_0x42cd9a[_0x5ddb('0x20')],'ContactId':_0x42cd9a['id']}})[_0x5ddb('0x1c')](function(_0x525d6a){if(!_[_0x5ddb('0x3d')](_0x525d6a)){var _0x8f9795=[];for(var _0x4d5102=0x0;_0x4d5102<_0x525d6a[_0x5ddb('0x32')];_0x4d5102+=0x1){var _0x58d335=_0x55ff21[_0x5ddb('0x1e')][_0x5ddb('0x3e')]({'where':{'ListId':_0x525d6a[_0x4d5102]['ListId'],'ContactId':_0x525d6a[_0x4d5102][_0x5ddb('0x3f')],'VoiceQueueId':_0x525d6a[_0x4d5102][_0x5ddb('0x40')],'CampaignId':_0x525d6a[_0x4d5102][_0x5ddb('0x41')]}});_0x8f9795[_0x5ddb('0x42')](_0x58d335);}return BPromise[_0x5ddb('0x43')](_0x8f9795);}})[_0x5ddb('0x1c')](function(_0x50c487){logger[_0x5ddb('0x44')](_0x5ddb('0x45'),util[_0x5ddb('0x11')](_0x50c487,{'showHidden':![],'depth':null}));_0x3c4f5a();})[_0x5ddb('0x28')](function(_0x5f4ba2){logger[_0x5ddb('0xf')]('[CmContact][afterDestroy][Error]',util[_0x5ddb('0x11')](_0x5f4ba2,{'showHidden':![],'depth':null}));_0x3c4f5a(_0x5f4ba2);});}}});};
\ No newline at end of file
+var _0xbfa6=['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','ListId','catch','error','afterCreate','Campaign','add','\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','findAll','CmList','length','dialCheckDuplicateType','always','onlyIfOpen','BlackLists','CmHopperBlack','message','Lists','cmContact,\x20%s,\x20%s','List\x20not\x20found','destroy','ContactId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','api','bluebird','request-promise','../../config/environment/shared','./cmContact.attributes','exports','define','firstName','lastName','phone','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','models','get','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority'];(function(_0x431499,_0x4f3cfd){var _0x21a344=function(_0x55bdab){while(--_0x55bdab){_0x431499['push'](_0x431499['shift']());}};_0x21a344(++_0x4f3cfd);}(_0xbfa6,0x138));var _0x6bfa=function(_0x22f5ea,_0x3a6a30){_0x22f5ea=_0x22f5ea-0x0;var _0xe5955=_0xbfa6[_0x22f5ea];return _0xe5955;};'use strict';var _=require(_0x6bfa('0x0'));var util=require(_0x6bfa('0x1'));var logger=require('../../config/logger')(_0x6bfa('0x2'));var moment=require('moment');var BPromise=require(_0x6bfa('0x3'));var rp=require(_0x6bfa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require(_0x6bfa('0x5'));var attributes=require(_0x6bfa('0x6'));module[_0x6bfa('0x7')]=function(_0x3382a5,_0x5f34db){return _0x3382a5[_0x6bfa('0x8')]('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':'fti_cm_contacts','fields':[_0x6bfa('0x9'),_0x6bfa('0xa'),_0x6bfa('0xb'),_0x6bfa('0xc'),_0x6bfa('0xd'),_0x6bfa('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x6bfa('0xf'),'collate':_0x6bfa('0x10'),'hooks':{'afterCreate':function(_0x17a28c,_0x29ac2e,_0x32bfda){var _0x35cde4=_0x3382a5[_0x6bfa('0x11')];var _0x1555dc=_0x17a28c[_0x6bfa('0x12')]({'plain':!![]});function _0x3ee85d(){return function(_0x225de4){logger['error'](_0x6bfa('0x13'),'afterCreate',util[_0x6bfa('0x14')](_0x225de4,{'showHidden':![],'depth':null}));};}function _0x4a5359(_0x16bc2e,_0x4fb10f){var _0x56d134=_0x4fb10f['scheduledat']?_0x4fb10f[_0x6bfa('0x15')]:moment()[_0x6bfa('0x16')](_0x6bfa('0x17'));return new BPromise(function(_0x3fca38,_0x353b9d){if(_[_0x6bfa('0x18')](_0x4fb10f[_0x6bfa('0x19')])){_0x3fca38({'ret':_0x56d134});}else{_0x35cde4[_0x6bfa('0x1a')][_0x6bfa('0x1b')]({'where':{'id':_0x16bc2e['id']}})[_0x6bfa('0x1c')](function(_0x477a32){if(!_['isNil'](_0x477a32)){var _0x4ac492=_0x477a32[_0x6bfa('0x19')];if(!_['isNil'](_0x4ac492)){var _0x5cff38=shared[_0x6bfa('0x1d')];var _0x2caa5f=_0x5cff38[_0x4ac492];var _0x5a98c5=_0x5cff38[_0x4fb10f['dialTimezone']];if(!_[_0x6bfa('0x18')](_0x2caa5f)&&!_['isNil'](_0x5a98c5)){var _0x4bc3f3=_0x2caa5f[_0x6bfa('0x1e')]-_0x5a98c5[_0x6bfa('0x1e')];_0x56d134=_0x4fb10f['scheduledat']?_0x4fb10f[_0x6bfa('0x15')]:moment();var _0x36ac69=moment(_0x56d134)['add'](_0x4bc3f3,_0x6bfa('0x1f'));_0x3fca38({'ret':_0x36ac69['format'](_0x6bfa('0x17'))});}else _0x3fca38({'ret':_0x56d134});}else _0x3fca38({'ret':_0x56d134});}else{_0x3fca38({'ret':_0x56d134});}});}});return 0xa;}var _0x424cb3=function(_0x5cfe9d){return new BPromise(function(_0x4d3d7b,_0x3f513b){_0x4a5359(_0x5cfe9d,_0x1555dc)['then'](function(_0x139cc8){_0x1555dc[_0x6bfa('0x15')]=_0x139cc8[_0x6bfa('0x20')];_0x35cde4['CmHopper'][_0x6bfa('0x1b')]({'where':{'phone':_0x1555dc['phone'],'VoiceQueueId':_0x5cfe9d['id']}})[_0x6bfa('0x1c')](function(_0x18adad){if(!_['isNil'](_0x18adad)){throw new Error(_0x6bfa('0x21')+_0x1555dc[_0x6bfa('0xb')]+_0x6bfa('0x22')+_0x5cfe9d['id']);}return _0x35cde4[_0x6bfa('0x23')][_0x6bfa('0x24')]({'phone':_0x1555dc['phone'],'ContactId':_0x1555dc['id'],'ListId':_0x1555dc['ListId'],'priority':_0x1555dc[_0x6bfa('0x25')]?_0x1555dc[_0x6bfa('0x25')]:0x2,'scheduledat':_0x1555dc['scheduledat']?_0x1555dc[_0x6bfa('0x15')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1555dc[_0x6bfa('0x26')]?!![]:![],'callbackuniqueid':_0x1555dc['callbackUniqueid']?_0x1555dc[_0x6bfa('0x26')]:undefined,'callbackat':_0x1555dc[_0x6bfa('0x26')]?moment()[_0x6bfa('0x16')](_0x6bfa('0x17')):undefined,'VoiceQueueId':_0x5cfe9d['id']});})['catch'](function(_0x2fec1c){_0x3f513b(_0x2fec1c);});});});};var _0x5ca0a6=function(_0x115c4b){return new BPromise(function(_0x5be0a0,_0x37b2e7){_0x4a5359(_0x115c4b,_0x1555dc)[_0x6bfa('0x1c')](function(_0xcc035d){_0x1555dc[_0x6bfa('0x15')]=_0xcc035d[_0x6bfa('0x20')];_0x35cde4[_0x6bfa('0x23')]['findOne']({'where':{'phone':_0x1555dc[_0x6bfa('0xb')],'VoiceQueueId':_0x115c4b['id']}})[_0x6bfa('0x1c')](function(_0x1af80c){if(!_[_0x6bfa('0x18')](_0x1af80c)){throw new Error(_0x6bfa('0x21')+_0x1555dc[_0x6bfa('0xb')]+_0x6bfa('0x27')+_0x115c4b['id']);}return _0x35cde4[_0x6bfa('0x28')][_0x6bfa('0x1b')]({'where':{'calleridnum':_0x1555dc['phone'],'VoiceQueueId':_0x115c4b['id']}});})[_0x6bfa('0x1c')](function(_0x149959){if(!_[_0x6bfa('0x18')](_0x149959)){throw new Error(_0x6bfa('0x29')+_0x1555dc['phone']+_0x6bfa('0x2a')+_0x115c4b['id']);}return _0x35cde4['CmHopper']['create']({'phone':_0x1555dc[_0x6bfa('0xb')],'ContactId':_0x1555dc['id'],'ListId':_0x1555dc[_0x6bfa('0x2b')],'priority':_0x1555dc[_0x6bfa('0x25')]?_0x1555dc[_0x6bfa('0x25')]:0x2,'scheduledat':_0x1555dc['scheduledat']?_0x1555dc[_0x6bfa('0x15')]:moment()['format'](_0x6bfa('0x17')),'callback':_0x1555dc[_0x6bfa('0x26')]?!![]:![],'callbackuniqueid':_0x1555dc[_0x6bfa('0x26')]?_0x1555dc['callbackUniqueid']:undefined,'callbackat':_0x1555dc[_0x6bfa('0x26')]?moment()['format'](_0x6bfa('0x17')):undefined,'VoiceQueueId':_0x115c4b['id']});})[_0x6bfa('0x2c')](function(_0xfcb813){_0x37b2e7(_0xfcb813);});});});};function _0x273274(){return function(_0x4aa646){logger[_0x6bfa('0x2d')]('cmContact',_0x6bfa('0x2e'),util['inspect'](_0x4aa646,{'showHidden':![],'depth':null}));};}function _0x31660e(_0x17935d,_0x505ce6){var _0x319bfc=_0x505ce6[_0x6bfa('0x15')]?_0x505ce6[_0x6bfa('0x15')]:moment()[_0x6bfa('0x16')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x56b593,_0x437a8f){if(_[_0x6bfa('0x18')](_0x505ce6[_0x6bfa('0x19')])){_0x56b593({'ret':_0x319bfc});}else{_0x35cde4[_0x6bfa('0x2f')][_0x6bfa('0x1b')]({'where':{'id':_0x17935d['id']}})[_0x6bfa('0x1c')](function(_0xb9be2d){if(!_[_0x6bfa('0x18')](_0xb9be2d)){var _0x22dcd8=_0xb9be2d[_0x6bfa('0x19')];if(!_[_0x6bfa('0x18')](_0x22dcd8)){var _0x379327=shared['timezones'];var _0x1f174f=_0x379327[_0x22dcd8];var _0x5ca8d7=_0x379327[_0x505ce6['dialTimezone']];if(!_['isNil'](_0x1f174f)&&!_[_0x6bfa('0x18')](_0x5ca8d7)){var _0x2f2307=_0x1f174f[_0x6bfa('0x1e')]-_0x5ca8d7['utcOffset'];_0x319bfc=_0x505ce6[_0x6bfa('0x15')]?_0x505ce6[_0x6bfa('0x15')]:moment();var _0x53f8eb=moment(_0x319bfc)[_0x6bfa('0x30')](_0x2f2307,_0x6bfa('0x1f'));_0x56b593({'ret':_0x53f8eb[_0x6bfa('0x16')](_0x6bfa('0x17'))});}else _0x56b593({'ret':_0x319bfc});}else _0x56b593({'ret':_0x319bfc});}else{_0x56b593({'ret':_0x319bfc});}});}});return 0xa;}var _0x35c654=function(_0x40b88b){return new BPromise(function(_0x4ef646,_0x380b0f){_0x31660e(_0x40b88b,_0x1555dc)[_0x6bfa('0x1c')](function(_0x1944be){_0x1555dc['scheduledat']=_0x1944be[_0x6bfa('0x20')];_0x35cde4[_0x6bfa('0x23')][_0x6bfa('0x1b')]({'where':{'phone':_0x1555dc['phone'],'CampaignId':_0x40b88b['id']}})[_0x6bfa('0x1c')](function(_0x534067){if(!_[_0x6bfa('0x18')](_0x534067)){throw new Error(_0x6bfa('0x21')+_0x1555dc[_0x6bfa('0xb')]+_0x6bfa('0x31')+_0x40b88b['id']);}return _0x35cde4[_0x6bfa('0x23')]['create']({'phone':_0x1555dc['phone'],'ContactId':_0x1555dc['id'],'ListId':_0x1555dc[_0x6bfa('0x2b')],'priority':_0x1555dc[_0x6bfa('0x25')]?_0x1555dc[_0x6bfa('0x25')]:0x2,'scheduledat':_0x1555dc[_0x6bfa('0x15')]?_0x1555dc['scheduledat']:moment()[_0x6bfa('0x16')](_0x6bfa('0x17')),'callback':_0x1555dc[_0x6bfa('0x26')]?!![]:![],'callbackuniqueid':_0x1555dc['callbackUniqueid']?_0x1555dc[_0x6bfa('0x26')]:undefined,'callbackat':_0x1555dc[_0x6bfa('0x26')]?moment()[_0x6bfa('0x16')](_0x6bfa('0x17')):undefined,'CampaignId':_0x40b88b['id']});})['catch'](function(_0x286a66){_0x380b0f(_0x286a66);});});});};var _0x4e8cc2=function(_0x2c1e54){return new BPromise(function(_0x2f24ba,_0x5f145b){_0x31660e(_0x2c1e54,_0x1555dc)[_0x6bfa('0x1c')](function(_0x1c88da){_0x1555dc[_0x6bfa('0x15')]=_0x1c88da[_0x6bfa('0x20')];_0x35cde4[_0x6bfa('0x23')]['findOne']({'where':{'phone':_0x1555dc[_0x6bfa('0xb')],'CampaignId':_0x2c1e54['id']}})[_0x6bfa('0x1c')](function(_0x28ce3b){if(!_[_0x6bfa('0x18')](_0x28ce3b)){throw new Error(_0x6bfa('0x21')+_0x1555dc[_0x6bfa('0xb')]+_0x6bfa('0x32')+_0x2c1e54['id']);}return _0x35cde4[_0x6bfa('0x28')][_0x6bfa('0x1b')]({'where':{'calleridnum':_0x1555dc[_0x6bfa('0xb')],'CampaignId':_0x2c1e54['id']}});})[_0x6bfa('0x1c')](function(_0x4b6a46){if(!_[_0x6bfa('0x18')](_0x4b6a46)){throw new Error(_0x6bfa('0x29')+_0x1555dc[_0x6bfa('0xb')]+_0x6bfa('0x33')+_0x2c1e54['id']);}return _0x35cde4['CmHopper'][_0x6bfa('0x24')]({'phone':_0x1555dc[_0x6bfa('0xb')],'ContactId':_0x1555dc['id'],'ListId':_0x1555dc['ListId'],'priority':_0x1555dc[_0x6bfa('0x25')]?_0x1555dc['priority']:0x2,'scheduledat':_0x1555dc[_0x6bfa('0x15')]?_0x1555dc[_0x6bfa('0x15')]:moment()[_0x6bfa('0x16')](_0x6bfa('0x17')),'callback':_0x1555dc[_0x6bfa('0x26')]?!![]:![],'callbackuniqueid':_0x1555dc['callbackUniqueid']?_0x1555dc[_0x6bfa('0x26')]:undefined,'callbackat':_0x1555dc[_0x6bfa('0x26')]?moment()[_0x6bfa('0x16')](_0x6bfa('0x17')):undefined,'CampaignId':_0x2c1e54['id']});})[_0x6bfa('0x2c')](function(_0x3d2147){_0x5f145b(_0x3d2147);});});});};if(_0x1555dc['ListId']){_0x35cde4[_0x6bfa('0x1a')][_0x6bfa('0x34')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0x6bfa('0x19')],'include':[{'model':_0x35cde4[_0x6bfa('0x35')],'as':'Lists','where':{'id':_0x1555dc[_0x6bfa('0x2b')]}}]})['then'](function(_0x15a952){if(_0x15a952){var _0x89283=[];for(var _0x2661ad=0x0,_0x5ba3f1;_0x2661ad<_0x15a952[_0x6bfa('0x36')];_0x2661ad+=0x1){_0x5ba3f1=_0x15a952[_0x2661ad][_0x6bfa('0x12')]({'plain':!![]});switch(_0x5ba3f1[_0x6bfa('0x37')]){case _0x6bfa('0x38'):_0x5ca0a6(_0x5ba3f1)['catch'](_0x3ee85d());break;case _0x6bfa('0x39'):_0x424cb3(_0x5ba3f1)[_0x6bfa('0x2c')](_0x3ee85d());break;default:_0x31660e(_0x5ba3f1,_0x1555dc)['then'](function(_0x28ca3b){_0x1555dc[_0x6bfa('0x15')]=_0x28ca3b[_0x6bfa('0x20')];_0x35cde4[_0x6bfa('0x23')][_0x6bfa('0x24')]({'phone':_0x1555dc[_0x6bfa('0xb')],'ContactId':_0x1555dc['id'],'ListId':_0x1555dc[_0x6bfa('0x2b')],'scheduledat':_0x1555dc[_0x6bfa('0x15')]?_0x1555dc[_0x6bfa('0x15')]:moment()[_0x6bfa('0x16')](_0x6bfa('0x17')),'priority':_0x1555dc['priority']?_0x1555dc[_0x6bfa('0x25')]:0x2,'callback':_0x1555dc['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1555dc[_0x6bfa('0x26')]?_0x1555dc[_0x6bfa('0x26')]:undefined,'callbackat':_0x1555dc['callbackUniqueid']?moment()['format'](_0x6bfa('0x17')):undefined,'VoiceQueueId':_0x5ba3f1['id']})[_0x6bfa('0x2c')](_0x3ee85d());});}}}})[_0x6bfa('0x1c')](function(){return _0x35cde4['VoiceQueue'][_0x6bfa('0x34')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x35cde4[_0x6bfa('0x35')],'as':_0x6bfa('0x3a'),'where':{'id':_0x1555dc[_0x6bfa('0x2b')]}}]})[_0x6bfa('0x1c')](function(_0x2ddb98){if(_0x2ddb98){var _0x34b733=[];for(var _0x10a434=0x0,_0x5b4365;_0x10a434<_0x2ddb98[_0x6bfa('0x36')];_0x10a434+=0x1){_0x5b4365=_0x2ddb98[_0x10a434][_0x6bfa('0x12')]({'plain':!![]});_0x35cde4[_0x6bfa('0x3b')][_0x6bfa('0x24')]({'phone':_0x1555dc['phone'],'ContactId':_0x1555dc['id'],'ListId':_0x1555dc['ListId'],'VoiceQueueId':_0x5b4365['id']})[_0x6bfa('0x2c')](function(_0x5ed107){logger[_0x6bfa('0x2d')]('cmContact,\x20%s,\x20%s',_0x6bfa('0x2e'),_0x5ed107[_0x6bfa('0x3c')]);});}}});})['then'](function(){return _0x35cde4[_0x6bfa('0x2f')][_0x6bfa('0x34')]({'attributes':['id',_0x6bfa('0x37'),'dialTimezone'],'include':[{'model':_0x35cde4[_0x6bfa('0x35')],'as':_0x6bfa('0x3d'),'where':{'id':_0x1555dc['ListId']}}]})[_0x6bfa('0x1c')](function(_0x19af87){if(_0x19af87){var _0x317d5d=[];for(var _0xac32c2=0x0,_0x493e4e;_0xac32c2<_0x19af87[_0x6bfa('0x36')];_0xac32c2+=0x1){_0x493e4e=_0x19af87[_0xac32c2][_0x6bfa('0x12')]({'plain':!![]});switch(_0x493e4e[_0x6bfa('0x37')]){case _0x6bfa('0x38'):_0x4e8cc2(_0x493e4e)[_0x6bfa('0x2c')](_0x273274());break;case _0x6bfa('0x39'):_0x35c654(_0x493e4e)[_0x6bfa('0x2c')](_0x273274());break;default:_0x35cde4['CmHopper'][_0x6bfa('0x24')]({'phone':_0x1555dc[_0x6bfa('0xb')],'ContactId':_0x1555dc['id'],'ListId':_0x1555dc[_0x6bfa('0x2b')],'scheduledat':_0x1555dc[_0x6bfa('0x15')]?_0x1555dc[_0x6bfa('0x15')]:moment()[_0x6bfa('0x16')](_0x6bfa('0x17')),'priority':_0x1555dc[_0x6bfa('0x25')]?_0x1555dc[_0x6bfa('0x25')]:0x2,'callback':_0x1555dc[_0x6bfa('0x26')]?!![]:![],'callbackuniqueid':_0x1555dc[_0x6bfa('0x26')]?_0x1555dc[_0x6bfa('0x26')]:undefined,'callbackat':_0x1555dc[_0x6bfa('0x26')]?moment()[_0x6bfa('0x16')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x493e4e['id']})[_0x6bfa('0x2c')](_0x273274());}}}});})[_0x6bfa('0x1c')](function(){return _0x35cde4[_0x6bfa('0x2f')][_0x6bfa('0x34')]({'attributes':['id'],'include':[{'model':_0x35cde4['CmList'],'as':_0x6bfa('0x3a'),'where':{'id':_0x1555dc[_0x6bfa('0x2b')]}}]})[_0x6bfa('0x1c')](function(_0x367e5e){if(_0x367e5e){var _0x2a9d20=[];for(var _0x3cde42=0x0,_0x525802;_0x3cde42<_0x367e5e[_0x6bfa('0x36')];_0x3cde42+=0x1){_0x525802=_0x367e5e[_0x3cde42][_0x6bfa('0x12')]({'plain':!![]});_0x35cde4[_0x6bfa('0x3b')]['create']({'phone':_0x1555dc[_0x6bfa('0xb')],'ContactId':_0x1555dc['id'],'ListId':_0x1555dc['ListId'],'CampaignId':_0x525802['id']})['catch'](function(_0x5e6ede){logger[_0x6bfa('0x2d')]('cmContact,\x20%s,\x20%s','afterCreate',_0x5e6ede[_0x6bfa('0x3c')]);});}}});})['then'](function(){_0x32bfda();})[_0x6bfa('0x2c')](function(_0x3e818b){logger[_0x6bfa('0x2d')](_0x6bfa('0x3e'),_0x6bfa('0x2e'),_0x3e818b['message']);_0x32bfda(_0x3e818b);});}else{_0x32bfda(new Error(_0x6bfa('0x3f')));}},'afterDestroy':function(_0x4211e1,_0x43e841,_0x67743e){var _0x298aa2=_0x3382a5[_0x6bfa('0x11')];var _0x4f846c=_0x4211e1['get']({'plain':!![]});return _0x298aa2[_0x6bfa('0x23')][_0x6bfa('0x34')]({'raw':!![],'where':{'ListId':_0x4f846c[_0x6bfa('0x2b')],'ContactId':_0x4f846c['id']}})[_0x6bfa('0x1c')](function(_0x5713ee){if(!_['isEmpty'](_0x5713ee)){var _0x410f1c=[];for(var _0x894621=0x0;_0x894621<_0x5713ee['length'];_0x894621+=0x1){var _0x5da0c0=_0x298aa2[_0x6bfa('0x23')][_0x6bfa('0x40')]({'where':{'ListId':_0x5713ee[_0x894621]['ListId'],'ContactId':_0x5713ee[_0x894621][_0x6bfa('0x41')],'VoiceQueueId':_0x5713ee[_0x894621]['VoiceQueueId'],'CampaignId':_0x5713ee[_0x894621]['CampaignId']}});_0x410f1c[_0x6bfa('0x42')](_0x5da0c0);}return BPromise[_0x6bfa('0x43')](_0x410f1c);}})['then'](function(_0x5d2bb6){logger[_0x6bfa('0x44')](_0x6bfa('0x45'),util[_0x6bfa('0x14')](_0x5d2bb6,{'showHidden':![],'depth':null}));_0x67743e();})[_0x6bfa('0x2c')](function(_0x368607){logger[_0x6bfa('0x2d')]('[CmContact][afterDestroy][Error]',util[_0x6bfa('0x14')](_0x368607,{'showHidden':![],'depth':null}));_0x67743e(_0x368607);});}}});};
\ No newline at end of file
index 08da532..7eed6e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x3214c1,_0x88fc99){var _0x154849=function(_0x13ca3a){while(--_0x13ca3a){_0x3214c1['push'](_0x3214c1['shift']());}};_0x154849(++_0x88fc99);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
+var _0x7ace=['result','catch','GetCmContact','CmContact','findAll','options','attributes','limit','include','map','model','create','body','keys','startsWith','cf_','update','table','set','id\x20=\x20?','toString','sequelize','query','CreateCmContact','lodash','moment','bluebird','randomstring','squel','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5456b6,_0xde53bd){var _0x245d59=function(_0x26023a){while(--_0x26023a){_0x5456b6['push'](_0x5456b6['shift']());}};_0x245d59(++_0xde53bd);}(_0x7ace,0x168));var _0xe7ac=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x7ace[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xe7ac('0x0'));var util=require('util');var moment=require(_0xe7ac('0x1'));var BPromise=require(_0xe7ac('0x2'));var rs=require(_0xe7ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0xe7ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe7ac('0x5'))(_0xe7ac('0x6'));var config=require('../../config/environment');var jayson=require(_0xe7ac('0x7'));var client=jayson[_0xe7ac('0x8')][_0xe7ac('0x9')]({'port':0x232a});config[_0xe7ac('0xa')]=_['defaults'](config[_0xe7ac('0xa')],{'host':_0xe7ac('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe7ac('0xc'))[_0xe7ac('0xd')](socket);function respondWithRpcPromise(_0x9a5d45,_0x560fe0,_0x453a76){return new BPromise(function(_0xdc82f,_0x2b7886){return client[_0xe7ac('0xe')](_0x9a5d45,_0x453a76)[_0xe7ac('0xf')](function(_0x43461d){logger[_0xe7ac('0x10')](_0xe7ac('0x11'),_0x560fe0,_0xe7ac('0x12'));logger[_0xe7ac('0x13')](_0xe7ac('0x14'),_0x560fe0,_0xe7ac('0x12'),JSON[_0xe7ac('0x15')](_0x43461d));if(_0x43461d['error']){if(_0x43461d[_0xe7ac('0x16')]['code']===0x1f4){logger[_0xe7ac('0x16')](_0xe7ac('0x11'),_0x560fe0,_0x43461d[_0xe7ac('0x16')][_0xe7ac('0x17')]);return _0x2b7886(_0x43461d[_0xe7ac('0x16')][_0xe7ac('0x17')]);}logger['error'](_0xe7ac('0x11'),_0x560fe0,_0x43461d[_0xe7ac('0x16')][_0xe7ac('0x17')]);return _0xdc82f(_0x43461d[_0xe7ac('0x16')]['message']);}else{logger[_0xe7ac('0x10')](_0xe7ac('0x11'),_0x560fe0,_0xe7ac('0x12'));_0xdc82f(_0x43461d[_0xe7ac('0x18')][_0xe7ac('0x17')]);}})[_0xe7ac('0x19')](function(_0x12ef4a){logger[_0xe7ac('0x16')](_0xe7ac('0x11'),_0x560fe0,_0x12ef4a);_0x2b7886(_0x12ef4a);});});}exports[_0xe7ac('0x1a')]=function(_0x3b2c62){var _0x28f97a=this;return new Promise(function(_0x17d203,_0x287851){return db[_0xe7ac('0x1b')][_0xe7ac('0x1c')]({'raw':_0x3b2c62[_0xe7ac('0x1d')]?_0x3b2c62[_0xe7ac('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3b2c62[_0xe7ac('0x1d')]?_0x3b2c62[_0xe7ac('0x1d')]['where']||null:null,'attributes':_0x3b2c62[_0xe7ac('0x1d')]?_0x3b2c62['options'][_0xe7ac('0x1e')]||null:null,'limit':_0x3b2c62[_0xe7ac('0x1d')]?_0x3b2c62[_0xe7ac('0x1d')][_0xe7ac('0x1f')]||null:null,'include':_0x3b2c62[_0xe7ac('0x1d')]?_0x3b2c62[_0xe7ac('0x1d')][_0xe7ac('0x20')]?_[_0xe7ac('0x21')](_0x3b2c62[_0xe7ac('0x1d')][_0xe7ac('0x20')],function(_0x278949){return{'model':db[_0x278949[_0xe7ac('0x22')]],'as':_0x278949['as'],'attributes':_0x278949[_0xe7ac('0x1e')],'include':_0x278949['include']?_[_0xe7ac('0x21')](_0x278949['include'],function(_0x1ef969){return{'model':db[_0x1ef969['model']],'as':_0x1ef969['as'],'attributes':_0x1ef969[_0xe7ac('0x1e')],'include':_0x1ef969['include']?_[_0xe7ac('0x21')](_0x1ef969[_0xe7ac('0x20')],function(_0x13d069){return{'model':db[_0x13d069[_0xe7ac('0x22')]],'as':_0x13d069['as'],'attributes':_0x13d069[_0xe7ac('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe7ac('0xf')](function(_0x1b5dd8){logger['info'](_0xe7ac('0x1a'),_0x3b2c62);logger[_0xe7ac('0x13')]('GetCmContact',_0x3b2c62,JSON[_0xe7ac('0x15')](_0x1b5dd8));_0x17d203(_0x1b5dd8);})[_0xe7ac('0x19')](function(_0x20bd26){logger['error'](_0xe7ac('0x1a'),_0x20bd26[_0xe7ac('0x17')],_0x3b2c62);_0x287851(_0x28f97a[_0xe7ac('0x16')](0x1f4,_0x20bd26[_0xe7ac('0x17')]));});});};exports['CreateCmContact']=function(_0x16a65b){var _0x3f1267=this;return new Promise(function(_0x508ac6,_0xb81276){return db[_0xe7ac('0x1b')][_0xe7ac('0x23')](_0x16a65b[_0xe7ac('0x24')],{'raw':_0x16a65b[_0xe7ac('0x1d')]?_0x16a65b[_0xe7ac('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xe7ac('0xf')](function(_0x5e5728){var _0x1b75ac;for(var _0x2e0f8b=0x0;_0x2e0f8b<Object[_0xe7ac('0x25')](_0x16a65b[_0xe7ac('0x24')])['length'];_0x2e0f8b++){var _0x2854e0=Object[_0xe7ac('0x25')](_0x16a65b[_0xe7ac('0x24')])[_0x2e0f8b];if(_0x2854e0[_0xe7ac('0x26')](_0xe7ac('0x27'))){_0x1b75ac=squel[_0xe7ac('0x28')]()[_0xe7ac('0x29')]('cm_contacts')[_0xe7ac('0x2a')](_0x2854e0,_0x16a65b[_0xe7ac('0x24')][_0x2854e0])['where'](_0xe7ac('0x2b'),_0x5e5728['id'])[_0xe7ac('0x2c')]();break;}}if(!_0x1b75ac)return _0x5e5728;return db[_0xe7ac('0x2d')][_0xe7ac('0x2e')](_0x1b75ac)[_0xe7ac('0xf')](function(){return _0x5e5728;});})[_0xe7ac('0xf')](function(_0x38e2ad){logger[_0xe7ac('0x10')](_0xe7ac('0x2f'),_0x16a65b);logger[_0xe7ac('0x13')]('CreateCmContact',_0x16a65b,JSON[_0xe7ac('0x15')](_0x38e2ad));_0x508ac6(_0x38e2ad);})[_0xe7ac('0x19')](function(_0x5435d7){logger['error'](_0xe7ac('0x2f'),_0x5435d7[_0xe7ac('0x17')],_0x16a65b);_0xb81276(_0x3f1267[_0xe7ac('0x16')](0x1f4,_0x5435d7[_0xe7ac('0x17')]));});});};
\ No newline at end of file
index 0f10738..6dbb1c3 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 809a115..f3cf6b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x10a477,_0x173314){var _0x42f1c3=function(_0x592423){while(--_0x592423){_0x10a477['push'](_0x10a477['shift']());}};_0x42f1c3(++_0x173314);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);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('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
+var _0x16cf=['./cmContact.controller','get','isAuthenticated','index','/describe','describe','show','getTags','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getJourney','post','/merge','bulkCreate','setTags','join','originalname','format','extname','/csv','single','file','uploadCsv','diskStorage','root','server/files/tmp','replace','%s-%s%s','now','upload','/upload/:id','import','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x48730f,_0x501197){var _0x2e046b=function(_0x489d78){while(--_0x489d78){_0x48730f['push'](_0x48730f['shift']());}};_0x2e046b(++_0x501197);}(_0x16cf,0x178));var _0xf16c=function(_0x4084fe,_0x19aad9){_0x4084fe=_0x4084fe-0x0;var _0x598649=_0x16cf[_0x4084fe];return _0x598649;};'use strict';var multer=require(_0xf16c('0x0'));var util=require(_0xf16c('0x1'));var path=require(_0xf16c('0x2'));var timeout=require('connect-timeout');var express=require(_0xf16c('0x3'));var router=express['Router']();var fs_extra=require(_0xf16c('0x4'));var auth=require(_0xf16c('0x5'));var interaction=require(_0xf16c('0x6'));var config=require(_0xf16c('0x7'));var controller=require(_0xf16c('0x8'));router[_0xf16c('0x9')]('/',auth[_0xf16c('0xa')](),controller[_0xf16c('0xb')]);router[_0xf16c('0x9')](_0xf16c('0xc'),auth[_0xf16c('0xa')](),controller[_0xf16c('0xd')]);router[_0xf16c('0x9')]('/:id',auth[_0xf16c('0xa')](),controller[_0xf16c('0xe')]);router[_0xf16c('0x9')]('/:id/tags',auth[_0xf16c('0xa')](),controller[_0xf16c('0xf')]);router['get']('/:id/hoppers',auth[_0xf16c('0xa')](),controller[_0xf16c('0x10')]);router[_0xf16c('0x9')](_0xf16c('0x11'),auth[_0xf16c('0xa')](),controller['getHopperHistories']);router[_0xf16c('0x9')](_0xf16c('0x12'),auth[_0xf16c('0xa')](),controller[_0xf16c('0x13')]);router[_0xf16c('0x9')]('/:id/jscripty_sessions',auth[_0xf16c('0xa')](),controller['getJscriptySessions']);router['get']('/:id/journey',auth[_0xf16c('0xa')](),controller[_0xf16c('0x14')]);router[_0xf16c('0x15')](_0xf16c('0x16'),auth[_0xf16c('0xa')](),controller['merge']);router[_0xf16c('0x15')]('/',auth[_0xf16c('0xa')](),controller['create']);router[_0xf16c('0x15')]('/create_many',auth[_0xf16c('0xa')](),controller[_0xf16c('0x17')]);router['post']('/:id/tags',auth[_0xf16c('0xa')](),controller[_0xf16c('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b3a09,_0x14297c,_0x1ec6bf){_0x1ec6bf(null,path[_0xf16c('0x19')](config['root'],'server/files/tmp'));},'filename':function(_0x1215c5,_0x561c3c,_0x46a033){_0x561c3c[_0xf16c('0x1a')]=_0x561c3c[_0xf16c('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x46a033(null,util[_0xf16c('0x1b')]('%s-%s%s',path['basename'](_0x561c3c[_0xf16c('0x1a')],path[_0xf16c('0x1c')](_0x561c3c[_0xf16c('0x1a')])),Date['now'](),path[_0xf16c('0x1c')](_0x561c3c[_0xf16c('0x1a')])));}})});router['post'](_0xf16c('0x1d'),upload[_0xf16c('0x1e')](_0xf16c('0x1f')),controller[_0xf16c('0x20')]);var upload=multer({'storage':multer[_0xf16c('0x21')]({'destination':function(_0x8b0d98,_0x235bc1,_0x3134b5){_0x3134b5(null,path[_0xf16c('0x19')](config[_0xf16c('0x22')],_0xf16c('0x23')));},'filename':function(_0x59ce3c,_0x533312,_0x37548d){_0x533312['originalname']=_0x533312[_0xf16c('0x1a')][_0xf16c('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37548d(null,util[_0xf16c('0x1b')](_0xf16c('0x25'),path['basename'](_0x533312[_0xf16c('0x1a')],path['extname'](_0x533312[_0xf16c('0x1a')])),Date[_0xf16c('0x26')](),path[_0xf16c('0x1c')](_0x533312[_0xf16c('0x1a')])));}})});router[_0xf16c('0x15')]('/upload',upload[_0xf16c('0x1e')](_0xf16c('0x1f')),controller[_0xf16c('0x27')]);router[_0xf16c('0x15')](_0xf16c('0x28'),auth[_0xf16c('0xa')](),controller[_0xf16c('0x29')]);router[_0xf16c('0x2a')](_0xf16c('0x2b'),auth['isAuthenticated'](),controller[_0xf16c('0x2c')]);router[_0xf16c('0x2d')](_0xf16c('0x2b'),auth[_0xf16c('0xa')](),controller[_0xf16c('0x2e')]);module[_0xf16c('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js
deleted file mode 100644 (file)
index 07ba77f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xb43b=['INTEGER','STRING','PHONE','sequelize'];(function(_0x44cca6,_0x5e9271){var _0x175d04=function(_0x26d9e4){while(--_0x26d9e4){_0x44cca6['push'](_0x44cca6['shift']());}};_0x175d04(++_0x5e9271);}(_0xb43b,0xbf));var _0xbb43=function(_0xc8d592,_0xd07a48){_0xc8d592=_0xc8d592-0x0;var _0x1a33e1=_0xb43b[_0xc8d592];return _0x1a33e1;};'use strict';var Sequelize=require(_0xbb43('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xbb43('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xbb43('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x3')},'OrderBy':{'type':Sequelize[_0xbb43('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':null}};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js
deleted file mode 100644 (file)
index 754dbcb..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xa4c2=['set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','map','CmContactHasItem','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','userProfileId','autoAssociation','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x26cab7,_0x1ccfca){var _0x31ba06=function(_0x1ed04a){while(--_0x1ed04a){_0x26cab7['push'](_0x26cab7['shift']());}};_0x31ba06(++_0x1ccfca);}(_0xa4c2,0x1bb));var _0x2a4c=function(_0x2e6495,_0x358caf){_0x2e6495=_0x2e6495-0x0;var _0x4595fb=_0xa4c2[_0x2e6495];return _0x4595fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2a4c('0x0'));var jsonpatch=require(_0x2a4c('0x1'));var rp=require('request-promise');var moment=require(_0x2a4c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2a4c('0x3'));var util=require(_0x2a4c('0x4'));var path=require('path');var sox=require(_0x2a4c('0x5'));var csv=require(_0x2a4c('0x6'));var ejs=require(_0x2a4c('0x7'));var fs=require('fs');var fs_extra=require(_0x2a4c('0x8'));var _=require(_0x2a4c('0x9'));var squel=require(_0x2a4c('0xa'));var crypto=require(_0x2a4c('0xb'));var jsforce=require(_0x2a4c('0xc'));var deskjs=require(_0x2a4c('0xd'));var toCsv=require(_0x2a4c('0x6'));var querystring=require('querystring');var Papa=require(_0x2a4c('0xe'));var Redis=require(_0x2a4c('0xf'));var authService=require(_0x2a4c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a4c('0x11'));var logger=require(_0x2a4c('0x12'))(_0x2a4c('0x13'));var utils=require(_0x2a4c('0x14'));var config=require(_0x2a4c('0x15'));var licenseUtil=require(_0x2a4c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13227d,_0x2f783f){_0x2f783f=_0x2f783f||0xcc;return function(_0x5cf087){if(_0x5cf087){return _0x13227d[_0x2a4c('0x17')](_0x2f783f);}return _0x13227d[_0x2a4c('0x18')](_0x2f783f)[_0x2a4c('0x19')]();};}function respondWithResult(_0x24123a,_0x3fcab7){_0x3fcab7=_0x3fcab7||0xc8;return function(_0x2fcc0b){if(_0x2fcc0b){return _0x24123a[_0x2a4c('0x18')](_0x3fcab7)[_0x2a4c('0x1a')](_0x2fcc0b);}};}function respondWithFilteredResult(_0x1dac56,_0x267a67){return function(_0x4f1ea9){if(_0x4f1ea9){var _0x5c6baa=typeof _0x267a67[_0x2a4c('0x1b')]===_0x2a4c('0x1c')&&typeof _0x267a67[_0x2a4c('0x1d')]===_0x2a4c('0x1c');var _0x1f4a6b=_0x4f1ea9[_0x2a4c('0x1e')];var _0x15e34a=_0x5c6baa?0x0:_0x267a67['offset'];var _0x2ec39c=_0x5c6baa?_0x4f1ea9['count']:_0x267a67[_0x2a4c('0x1b')]+_0x267a67['limit'];var _0x4cf99d;if(_0x2ec39c>=_0x1f4a6b){_0x2ec39c=_0x1f4a6b;_0x4cf99d=0xc8;}else{_0x4cf99d=0xce;}_0x1dac56['status'](_0x4cf99d);return _0x1dac56[_0x2a4c('0x1f')](_0x2a4c('0x20'),_0x15e34a+'-'+_0x2ec39c+'/'+_0x1f4a6b)['json'](_0x4f1ea9);}return null;};}function patchUpdates(_0x2f9b72){return function(_0x3b4903){try{jsonpatch[_0x2a4c('0x21')](_0x3b4903,_0x2f9b72,!![]);}catch(_0x413364){return BPromise[_0x2a4c('0x22')](_0x413364);}return _0x3b4903[_0x2a4c('0x23')]();};}function saveUpdates(_0x1a3392,_0xf41207){return function(_0x55cca6){if(_0x55cca6){return _0x55cca6[_0x2a4c('0x24')](_0x1a3392)[_0x2a4c('0x25')](function(_0x5d507d){return _0x5d507d;});}return null;};}function removeEntity(_0x2d79ed,_0x58ce22){return function(_0x32acb7){if(_0x32acb7){return _0x32acb7[_0x2a4c('0x26')]()[_0x2a4c('0x25')](function(){var _0x1eb146=_0x32acb7[_0x2a4c('0x27')]({'plain':!![]});var _0x447f6a='CmContactHasItems';return db[_0x2a4c('0x28')][_0x2a4c('0x26')]({'where':{'type':_0x447f6a,'resourceId':_0x1eb146['id']}})[_0x2a4c('0x25')](function(){return _0x32acb7;});})['then'](function(){_0x2d79ed[_0x2a4c('0x18')](0xcc)[_0x2a4c('0x19')]();});}};}function handleEntityNotFound(_0x3f2374,_0x19233d){return function(_0x3c229f){if(!_0x3c229f){_0x3f2374['sendStatus'](0x194);}return _0x3c229f;};}function handleError(_0xf3d016,_0x41853f){_0x41853f=_0x41853f||0x1f4;return function(_0x52b5f3){logger[_0x2a4c('0x29')](_0x52b5f3['stack']);if(_0x52b5f3[_0x2a4c('0x2a')]){delete _0x52b5f3[_0x2a4c('0x2a')];}_0xf3d016[_0x2a4c('0x18')](_0x41853f)['send'](_0x52b5f3);};}exports['index']=function(_0x2da0ea,_0x5d1087){var _0x1d754b={},_0x62e9f3={},_0x3be760={'count':0x0,'rows':[]};var _0x154b26=_[_0x2a4c('0x2b')](db[_0x2a4c('0x2c')][_0x2a4c('0x2d')],function(_0x366386){return{'name':_0x366386[_0x2a4c('0x2e')],'type':_0x366386[_0x2a4c('0x2f')]['key']};});_0x62e9f3['model']=_[_0x2a4c('0x2b')](_0x154b26,_0x2a4c('0x2a'));_0x62e9f3[_0x2a4c('0x30')]=_[_0x2a4c('0x31')](_0x2da0ea['query']);_0x62e9f3[_0x2a4c('0x32')]=_[_0x2a4c('0x33')](_0x62e9f3[_0x2a4c('0x34')],_0x62e9f3[_0x2a4c('0x30')]);_0x1d754b[_0x2a4c('0x35')]=_[_0x2a4c('0x33')](_0x62e9f3['model'],qs[_0x2a4c('0x36')](_0x2da0ea[_0x2a4c('0x30')][_0x2a4c('0x36')]));_0x1d754b[_0x2a4c('0x35')]=_0x1d754b[_0x2a4c('0x35')][_0x2a4c('0x37')]?_0x1d754b[_0x2a4c('0x35')]:_0x62e9f3[_0x2a4c('0x34')];if(!_0x2da0ea['query'][_0x2a4c('0x38')](_0x2a4c('0x39'))){_0x1d754b['limit']=qs[_0x2a4c('0x1d')](_0x2da0ea[_0x2a4c('0x30')][_0x2a4c('0x1d')]);_0x1d754b[_0x2a4c('0x1b')]=qs[_0x2a4c('0x1b')](_0x2da0ea['query']['offset']);}_0x1d754b['order']=qs[_0x2a4c('0x3a')](_0x2da0ea[_0x2a4c('0x30')][_0x2a4c('0x3a')]);_0x1d754b[_0x2a4c('0x3b')]=qs[_0x2a4c('0x32')](_[_0x2a4c('0x3c')](_0x2da0ea[_0x2a4c('0x30')],_0x62e9f3['filters']),_0x154b26);if(_0x2da0ea[_0x2a4c('0x30')]['filter']){_0x1d754b[_0x2a4c('0x3b')]=_[_0x2a4c('0x3d')](_0x1d754b[_0x2a4c('0x3b')],{'$or':_['map'](_0x154b26,function(_0xf06302){if(_0xf06302[_0x2a4c('0x2f')]!==_0x2a4c('0x3e')){var _0x15775d={};_0x15775d[_0xf06302['name']]={'$like':'%'+_0x2da0ea[_0x2a4c('0x30')][_0x2a4c('0x3f')]+'%'};return _0x15775d;}})});}_0x1d754b=_[_0x2a4c('0x3d')]({},_0x1d754b,_0x2da0ea[_0x2a4c('0x40')]);var _0x303577={'where':_0x1d754b[_0x2a4c('0x3b')]};return db[_0x2a4c('0x2c')][_0x2a4c('0x1e')](_0x303577)[_0x2a4c('0x25')](function(_0x51bcd4){_0x3be760['count']=_0x51bcd4;if(_0x2da0ea[_0x2a4c('0x30')][_0x2a4c('0x41')]){_0x1d754b[_0x2a4c('0x42')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x2a4c('0x43')](_0x1d754b);})[_0x2a4c('0x25')](function(_0x46f96e){_0x3be760[_0x2a4c('0x44')]=_0x46f96e;return _0x3be760;})[_0x2a4c('0x25')](respondWithFilteredResult(_0x5d1087,_0x1d754b))['catch'](handleError(_0x5d1087,null));};exports['show']=function(_0x2e2086,_0x249d70){var _0x4faec6={'raw':!![],'where':{'id':_0x2e2086[_0x2a4c('0x45')]['id']}},_0x511fec={};_0x511fec['model']=_[_0x2a4c('0x31')](db[_0x2a4c('0x2c')]['rawAttributes']);_0x511fec['query']=_[_0x2a4c('0x31')](_0x2e2086[_0x2a4c('0x30')]);_0x511fec[_0x2a4c('0x32')]=_['intersection'](_0x511fec[_0x2a4c('0x34')],_0x511fec[_0x2a4c('0x30')]);_0x4faec6[_0x2a4c('0x35')]=_['intersection'](_0x511fec[_0x2a4c('0x34')],qs[_0x2a4c('0x36')](_0x2e2086[_0x2a4c('0x30')][_0x2a4c('0x36')]));_0x4faec6[_0x2a4c('0x35')]=_0x4faec6[_0x2a4c('0x35')][_0x2a4c('0x37')]?_0x4faec6['attributes']:_0x511fec[_0x2a4c('0x34')];if(_0x2e2086[_0x2a4c('0x30')][_0x2a4c('0x41')]){_0x4faec6[_0x2a4c('0x42')]=[{'all':!![]}];}_0x4faec6=_['merge']({},_0x4faec6,_0x2e2086[_0x2a4c('0x40')]);return db[_0x2a4c('0x2c')][_0x2a4c('0x46')](_0x4faec6)[_0x2a4c('0x25')](handleEntityNotFound(_0x249d70,null))[_0x2a4c('0x25')](respondWithResult(_0x249d70,null))[_0x2a4c('0x47')](handleError(_0x249d70,null));};exports[_0x2a4c('0x48')]=function(_0x124291,_0x528e70){return db[_0x2a4c('0x2c')][_0x2a4c('0x48')](_0x124291[_0x2a4c('0x49')],{})[_0x2a4c('0x25')](function(_0x152123){var _0x4746bd=_0x124291[_0x2a4c('0x4a')]['get']({'plain':!![]});if(!_0x4746bd)throw new Error(_0x2a4c('0x4b'));if(_0x4746bd['role']==='user'){var _0x1c9c2e=_0x152123['get']({'plain':!![]});var _0x11d1d1=_0x2a4c('0x4c');return db['UserProfileSection'][_0x2a4c('0x46')]({'where':{'name':_0x11d1d1,'userProfileId':_0x4746bd[_0x2a4c('0x4d')]},'raw':!![]})['then'](function(_0x9436ec){if(_0x9436ec&&_0x9436ec[_0x2a4c('0x4e')]===0x0){return db[_0x2a4c('0x28')][_0x2a4c('0x48')]({'name':_0x1c9c2e[_0x2a4c('0x2a')],'resourceId':_0x1c9c2e['id'],'type':_0x9436ec[_0x2a4c('0x2a')],'sectionId':_0x9436ec['id']},{})[_0x2a4c('0x25')](function(){return _0x152123;});}else{return _0x152123;}})[_0x2a4c('0x47')](function(_0x72dd04){logger[_0x2a4c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x72dd04);throw _0x72dd04;});}return _0x152123;})[_0x2a4c('0x25')](respondWithResult(_0x528e70,0xc9))[_0x2a4c('0x47')](handleError(_0x528e70,null));};exports['update']=function(_0x1e3375,_0x4697e1){if(_0x1e3375['body']['id']){delete _0x1e3375[_0x2a4c('0x49')]['id'];}return db[_0x2a4c('0x2c')][_0x2a4c('0x46')]({'where':{'id':_0x1e3375[_0x2a4c('0x45')]['id']}})[_0x2a4c('0x25')](handleEntityNotFound(_0x4697e1,null))['then'](saveUpdates(_0x1e3375[_0x2a4c('0x49')],null))[_0x2a4c('0x25')](respondWithResult(_0x4697e1,null))[_0x2a4c('0x47')](handleError(_0x4697e1,null));};exports[_0x2a4c('0x26')]=function(_0x4c7382,_0x20143b){return db[_0x2a4c('0x2c')][_0x2a4c('0x46')]({'where':{'id':_0x4c7382[_0x2a4c('0x45')]['id']}})['then'](handleEntityNotFound(_0x20143b,null))['then'](removeEntity(_0x20143b,null))['catch'](handleError(_0x20143b,null));};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js
deleted file mode 100644 (file)
index fa6a6b5..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0x8cd4=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem'];(function(_0x37f58b,_0x5c0876){var _0x4f3a64=function(_0x3bdc3e){while(--_0x3bdc3e){_0x37f58b['push'](_0x37f58b['shift']());}};_0x4f3a64(++_0x5c0876);}(_0x8cd4,0x113));var _0x48cd=function(_0x220882,_0x42619b){_0x220882=_0x220882-0x0;var _0xbcf788=_0x8cd4[_0x220882];return _0xbcf788;};'use strict';var _=require('lodash');var util=require(_0x48cd('0x0'));var logger=require(_0x48cd('0x1'))(_0x48cd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x48cd('0x3'));var fs=require('fs');var path=require(_0x48cd('0x4'));var rimraf=require(_0x48cd('0x5'));var config=require(_0x48cd('0x6'));var attributes=require(_0x48cd('0x7'));module[_0x48cd('0x8')]=function(_0xc5202c,_0x413e1){return _0xc5202c[_0x48cd('0x9')](_0x48cd('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js
deleted file mode 100644 (file)
index ec7fd60..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0x6a78=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x6a78,0x190));var _0x86a7=function(_0x4b72ba,_0x55ed08){_0x4b72ba=_0x4b72ba-0x0;var _0x5e8615=_0x6a78[_0x4b72ba];return _0x5e8615;};'use strict';var _=require('lodash');var util=require(_0x86a7('0x0'));var moment=require(_0x86a7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86a7('0x2'));var db=require(_0x86a7('0x3'))['db'];var utils=require(_0x86a7('0x4'));var logger=require(_0x86a7('0x5'))(_0x86a7('0x6'));var config=require(_0x86a7('0x7'));var jayson=require(_0x86a7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a890e,_0x7fd4e5,_0x3718ac){return new BPromise(function(_0x4e813c,_0x288db5){return client[_0x86a7('0x9')](_0x2a890e,_0x3718ac)[_0x86a7('0xa')](function(_0x10034d){logger[_0x86a7('0xb')](_0x86a7('0xc'),_0x7fd4e5,_0x86a7('0xd'));logger[_0x86a7('0xe')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x7fd4e5,_0x86a7('0xd'),JSON['stringify'](_0x10034d));if(_0x10034d[_0x86a7('0xf')]){if(_0x10034d[_0x86a7('0xf')][_0x86a7('0x10')]===0x1f4){logger[_0x86a7('0xf')](_0x86a7('0xc'),_0x7fd4e5,_0x10034d['error'][_0x86a7('0x11')]);return _0x288db5(_0x10034d[_0x86a7('0xf')][_0x86a7('0x11')]);}logger[_0x86a7('0xf')](_0x86a7('0xc'),_0x7fd4e5,_0x10034d[_0x86a7('0xf')][_0x86a7('0x11')]);return _0x4e813c(_0x10034d['error']['message']);}else{logger['info'](_0x86a7('0xc'),_0x7fd4e5,'request\x20sent');_0x4e813c(_0x10034d[_0x86a7('0x12')]['message']);}})[_0x86a7('0x13')](function(_0x127942){logger[_0x86a7('0xf')](_0x86a7('0xc'),_0x7fd4e5,_0x127942);_0x288db5(_0x127942);});});}
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js
deleted file mode 100644 (file)
index ed4a9b1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xd817=['/:id','show','post','create','put','delete','destroy','multer','util','express','../../components/interaction/service','./cmContactHasItem.controller','isAuthenticated','index','get'];(function(_0x999b40,_0x806ff6){var _0x410400=function(_0x58a334){while(--_0x58a334){_0x999b40['push'](_0x999b40['shift']());}};_0x410400(++_0x806ff6);}(_0xd817,0x1ba));var _0x7d81=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0xd817[_0x3b3210];return _0x5b5484;};'use strict';var multer=require(_0x7d81('0x0'));var util=require(_0x7d81('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7d81('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7d81('0x3'));var config=require('../../config/environment');var controller=require(_0x7d81('0x4'));router['get']('/',auth[_0x7d81('0x5')](),controller[_0x7d81('0x6')]);router[_0x7d81('0x7')](_0x7d81('0x8'),auth[_0x7d81('0x5')](),controller[_0x7d81('0x9')]);router[_0x7d81('0xa')]('/',auth[_0x7d81('0x5')](),controller[_0x7d81('0xb')]);router[_0x7d81('0xc')](_0x7d81('0x8'),auth[_0x7d81('0x5')](),controller['update']);router[_0x7d81('0xd')](_0x7d81('0x8'),auth[_0x7d81('0x5')](),controller[_0x7d81('0xe')]);module['exports']=router;
\ No newline at end of file
index b73eb35..7125f4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3d2=['select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue','STRING','setDataValue','alias','name','long','type'];(function(_0x1db646,_0x3021d1){var _0x2f4249=function(_0x8e0685){while(--_0x8e0685){_0x1db646['push'](_0x1db646['shift']());}};_0x2f4249(++_0x3021d1);}(_0xb3d2,0x1ee));var _0x2b3d=function(_0x23a362,_0x2f9dcd){_0x23a362=_0x23a362-0x0;var _0x148034=_0xb3d2[_0x23a362];return _0x148034;};'use strict';var Sequelize=require(_0x2b3d('0x0'));var _=require(_0x2b3d('0x1'));module[_0x2b3d('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5709a7){return this[_0x2b3d('0x3')]('alias');}},'alias':{'type':Sequelize[_0x2b3d('0x4')],'allowNull':![],'set':function(_0x3ba3c9){this[_0x2b3d('0x5')](_0x2b3d('0x6'),_0x3ba3c9?_0x3ba3c9:this[_0x2b3d('0x3')](_0x2b3d('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x2b3d('0x8')),'get':function(){if(this[_0x2b3d('0x3')](_0x2b3d('0x9'))===_0x2b3d('0xa')){return JSON[_0x2b3d('0xb')](this[_0x2b3d('0x3')](_0x2b3d('0xc')));}else{return this[_0x2b3d('0x3')](_0x2b3d('0xc'));}},'set':function(_0x354a05){if(Array[_0x2b3d('0xd')](_0x354a05)){this['setDataValue'](_0x2b3d('0xc'),JSON[_0x2b3d('0xe')](_0x354a05));}else{this[_0x2b3d('0x5')]('values',_0x354a05);}}},'required':{'type':Sequelize[_0x2b3d('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2b3d('0x10')](_0x2b3d('0x11'))}};
\ No newline at end of file
+var _0x30d1=['VIRTUAL','alias','STRING','setDataValue','long','getDataValue','type','select','values','isArray','BOOLEAN','ENUM','voice','lodash','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x30d1,0xdf));var _0x130d=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x30d1[_0x352d28];return _0x387d7e;};'use strict';var Sequelize=require('sequelize');var _=require(_0x130d('0x0'));module[_0x130d('0x1')]={'name':{'type':Sequelize[_0x130d('0x2')],'get':function(_0x5befbc){return this['getDataValue'](_0x130d('0x3'));}},'alias':{'type':Sequelize[_0x130d('0x4')],'allowNull':![],'set':function(_0xefd91e){this[_0x130d('0x5')](_0x130d('0x3'),_0xefd91e?_0xefd91e:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x130d('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x130d('0x6')),'get':function(){if(this[_0x130d('0x7')](_0x130d('0x8'))===_0x130d('0x9')){return JSON['parse'](this[_0x130d('0x7')]('values'));}else{return this[_0x130d('0x7')](_0x130d('0xa'));}},'set':function(_0x4a1050){if(Array[_0x130d('0xb')](_0x4a1050)){this[_0x130d('0x5')]('values',JSON['stringify'](_0x4a1050));}else{this['setDataValue'](_0x130d('0xa'),_0x4a1050);}}},'required':{'type':Sequelize[_0x130d('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x130d('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x130d('0xd')](_0x130d('0xe'))}};
\ No newline at end of file
index 9f1825f..d625c99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x220e=['index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','params','length','options','find','catch','create','sequelize','transaction','body','Sequelize','TEXT','text','number','switch','BOOLEAN','addColumn','cf_%d','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x271c4b,_0x36e46b){var _0x25aaf2=function(_0x377713){while(--_0x377713){_0x271c4b['push'](_0x271c4b['shift']());}};_0x25aaf2(++_0x36e46b);}(_0x220e,0x1e7));var _0xe220=function(_0xa8b370,_0x2b77db){_0xa8b370=_0xa8b370-0x0;var _0x643e37=_0x220e[_0xa8b370];return _0x643e37;};'use strict';var emlformat=require(_0xe220('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe220('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe220('0x2'));var moment=require(_0xe220('0x3'));var BPromise=require(_0xe220('0x4'));var Mustache=require(_0xe220('0x5'));var util=require(_0xe220('0x6'));var path=require(_0xe220('0x7'));var sox=require(_0xe220('0x8'));var csv=require(_0xe220('0x9'));var ejs=require(_0xe220('0xa'));var fs=require('fs');var fs_extra=require(_0xe220('0xb'));var _=require(_0xe220('0xc'));var squel=require(_0xe220('0xd'));var crypto=require('crypto');var jsforce=require(_0xe220('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe220('0x9'));var querystring=require(_0xe220('0xf'));var Papa=require(_0xe220('0x10'));var Redis=require(_0xe220('0x11'));var authService=require(_0xe220('0x12'));var qs=require(_0xe220('0x13'));var as=require(_0xe220('0x14'));var hardwareService=require(_0xe220('0x15'));var logger=require(_0xe220('0x16'))(_0xe220('0x17'));var utils=require(_0xe220('0x18'));var config=require(_0xe220('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe220('0x1a'))['db'];function respondWithStatusCode(_0x18203c,_0x5a36c6){_0x5a36c6=_0x5a36c6||0xcc;return function(_0x47a34f){if(_0x47a34f){return _0x18203c[_0xe220('0x1b')](_0x5a36c6);}return _0x18203c['status'](_0x5a36c6)[_0xe220('0x1c')]();};}function respondWithResult(_0x385f2f,_0x557010){_0x557010=_0x557010||0xc8;return function(_0x4ed814){if(_0x4ed814){return _0x385f2f[_0xe220('0x1d')](_0x557010)['json'](_0x4ed814);}};}function respondWithFilteredResult(_0x1aba23,_0xafb4a){return function(_0x35bb0c){if(_0x35bb0c){var _0x202d61=typeof _0xafb4a[_0xe220('0x1e')]===_0xe220('0x1f')&&typeof _0xafb4a[_0xe220('0x20')]===_0xe220('0x1f');var _0x315c32=_0x35bb0c[_0xe220('0x21')];var _0x29bc57=_0x202d61?0x0:_0xafb4a[_0xe220('0x1e')];var _0x1128b4=_0x202d61?_0x35bb0c[_0xe220('0x21')]:_0xafb4a[_0xe220('0x1e')]+_0xafb4a[_0xe220('0x20')];var _0x5d3034;if(_0x1128b4>=_0x315c32){_0x1128b4=_0x315c32;_0x5d3034=0xc8;}else{_0x5d3034=0xce;}_0x1aba23[_0xe220('0x1d')](_0x5d3034);return _0x1aba23[_0xe220('0x22')](_0xe220('0x23'),_0x29bc57+'-'+_0x1128b4+'/'+_0x315c32)[_0xe220('0x24')](_0x35bb0c);}return null;};}function patchUpdates(_0x4424be){return function(_0x11d0fa){try{jsonpatch[_0xe220('0x25')](_0x11d0fa,_0x4424be,!![]);}catch(_0x5984db){return BPromise[_0xe220('0x26')](_0x5984db);}return _0x11d0fa[_0xe220('0x27')]();};}function saveUpdates(_0x49b9fb,_0x2a93fe){return function(_0x23f928){if(_0x23f928){return _0x23f928[_0xe220('0x28')](_0x49b9fb)[_0xe220('0x29')](function(_0x1f1584){return _0x1f1584;});}return null;};}function removeEntity(_0x4d3817,_0x1d8f5d){return function(_0x1176ff){if(_0x1176ff){return _0x1176ff[_0xe220('0x2a')]()[_0xe220('0x29')](function(){_0x4d3817['status'](0xcc)[_0xe220('0x1c')]();});}};}function handleEntityNotFound(_0x633e77,_0x5167c4){return function(_0x87e3b){if(!_0x87e3b){_0x633e77[_0xe220('0x1b')](0x194);}return _0x87e3b;};}function handleError(_0x2ac8d4,_0x7a5e4a){_0x7a5e4a=_0x7a5e4a||0x1f4;return function(_0x256f13){logger[_0xe220('0x2b')](_0x256f13[_0xe220('0x2c')]);if(_0x256f13[_0xe220('0x2d')]){delete _0x256f13[_0xe220('0x2d')];}_0x2ac8d4[_0xe220('0x1d')](_0x7a5e4a)[_0xe220('0x2e')](_0x256f13);};}exports[_0xe220('0x2f')]=function(_0x5cfe85,_0x589dae){var _0x4d1488={},_0x184862={},_0xa47770={'count':0x0,'rows':[]};var _0x2eec=_[_0xe220('0x30')](db[_0xe220('0x31')][_0xe220('0x32')],function(_0x3c0fc9){return{'name':_0x3c0fc9[_0xe220('0x33')],'type':_0x3c0fc9[_0xe220('0x34')][_0xe220('0x35')]};});_0x184862[_0xe220('0x36')]=_[_0xe220('0x37')](_[_0xe220('0x30')](_0x2eec,_0xe220('0x2d')),[_0xe220('0x2d')]);_0x184862[_0xe220('0x38')]=_[_0xe220('0x39')](_0x5cfe85[_0xe220('0x38')]);_0x184862[_0xe220('0x3a')]=_[_0xe220('0x3b')](_0x184862[_0xe220('0x36')],_0x184862[_0xe220('0x38')]);_0x4d1488[_0xe220('0x3c')]=_['intersection'](_0x184862[_0xe220('0x36')],qs[_0xe220('0x3d')](_0x5cfe85[_0xe220('0x38')][_0xe220('0x3d')]));_0x4d1488[_0xe220('0x3c')]=_0x4d1488['attributes']['length']?_0x4d1488[_0xe220('0x3c')]:_0x184862[_0xe220('0x36')];if(!_0x5cfe85[_0xe220('0x38')][_0xe220('0x3e')](_0xe220('0x3f'))){_0x4d1488[_0xe220('0x20')]=qs[_0xe220('0x20')](_0x5cfe85[_0xe220('0x38')]['limit']);_0x4d1488[_0xe220('0x1e')]=qs[_0xe220('0x1e')](_0x5cfe85[_0xe220('0x38')][_0xe220('0x1e')]);}_0x4d1488[_0xe220('0x40')]=qs[_0xe220('0x41')](_0x5cfe85[_0xe220('0x38')][_0xe220('0x41')]);_0x4d1488[_0xe220('0x42')]=qs[_0xe220('0x3a')](_['pick'](_0x5cfe85[_0xe220('0x38')],_0x184862[_0xe220('0x3a')]),_0x2eec);if(_0x5cfe85[_0xe220('0x38')][_0xe220('0x43')]){_0x4d1488[_0xe220('0x42')]=_['merge'](_0x4d1488[_0xe220('0x42')],{'$or':_[_0xe220('0x30')](_0x2eec,function(_0x212d7a){if(_0x212d7a[_0xe220('0x34')]!==_0xe220('0x44')){var _0x3b270c={};_0x3b270c[_0x212d7a[_0xe220('0x2d')]]={'$like':'%'+_0x5cfe85[_0xe220('0x38')]['filter']+'%'};return _0x3b270c;}})});}_0x4d1488=_[_0xe220('0x45')]({},_0x4d1488,_0x5cfe85['options']);var _0x4d7338={'where':_0x4d1488[_0xe220('0x42')]};return db['CmCustomField']['count'](_0x4d7338)[_0xe220('0x29')](function(_0x368e84){_0xa47770['count']=_0x368e84;if(_0x5cfe85[_0xe220('0x38')][_0xe220('0x46')]){_0x4d1488[_0xe220('0x47')]=[{'all':!![]}];}return db[_0xe220('0x31')]['findAll'](_0x4d1488);})['then'](function(_0x30f04e){_0xa47770['rows']=_0x30f04e;return _0xa47770;})['then'](respondWithFilteredResult(_0x589dae,_0x4d1488))['catch'](handleError(_0x589dae,null));};exports['show']=function(_0x23d208,_0x16b953){var _0x453276={'raw':!![],'where':{'id':_0x23d208[_0xe220('0x48')]['id']}},_0x5c10e8={};_0x5c10e8[_0xe220('0x36')]=_['keys'](db[_0xe220('0x31')]['rawAttributes']);_0x5c10e8[_0xe220('0x38')]=_['keys'](_0x23d208[_0xe220('0x38')]);_0x5c10e8[_0xe220('0x3a')]=_[_0xe220('0x3b')](_0x5c10e8['model'],_0x5c10e8[_0xe220('0x38')]);_0x453276['attributes']=_['intersection'](_0x5c10e8[_0xe220('0x36')],qs[_0xe220('0x3d')](_0x23d208['query'][_0xe220('0x3d')]));_0x453276[_0xe220('0x3c')]=_0x453276['attributes'][_0xe220('0x49')]?_0x453276[_0xe220('0x3c')]:_0x5c10e8[_0xe220('0x36')];if(_0x23d208[_0xe220('0x38')][_0xe220('0x46')]){_0x453276[_0xe220('0x47')]=[{'all':!![]}];}_0x453276=_['merge']({},_0x453276,_0x23d208[_0xe220('0x4a')]);return db[_0xe220('0x31')][_0xe220('0x4b')](_0x453276)[_0xe220('0x29')](handleEntityNotFound(_0x16b953,null))[_0xe220('0x29')](respondWithResult(_0x16b953,null))[_0xe220('0x4c')](handleError(_0x16b953,null));};exports[_0xe220('0x28')]=function(_0x2416b9,_0xf09041){if(_0x2416b9['body']['id']){delete _0x2416b9['body']['id'];}return db[_0xe220('0x31')]['find']({'where':{'id':_0x2416b9['params']['id']}})[_0xe220('0x29')](handleEntityNotFound(_0xf09041,null))[_0xe220('0x29')](saveUpdates(_0x2416b9['body'],null))[_0xe220('0x29')](respondWithResult(_0xf09041,null))[_0xe220('0x4c')](handleError(_0xf09041,null));};exports[_0xe220('0x2a')]=function(_0x576d95,_0x325fd9){return db['CmCustomField'][_0xe220('0x4b')]({'where':{'id':_0x576d95[_0xe220('0x48')]['id']}})[_0xe220('0x29')](handleEntityNotFound(_0x325fd9,null))[_0xe220('0x29')](removeEntity(_0x325fd9,null))[_0xe220('0x4c')](handleError(_0x325fd9,null));};exports[_0xe220('0x4d')]=function(_0x47d04b,_0x588b51){var _0x863b47;return db[_0xe220('0x4e')][_0xe220('0x4f')](function(_0x17742f){return db['CmCustomField'][_0xe220('0x4d')](_0x47d04b[_0xe220('0x50')],{'transaction':_0x17742f})['then'](function(_0x516166){_0x863b47=_0x516166;var _0x24c201={'type':db[_0xe220('0x51')][_0xe220('0x52')],'transaction':_0x17742f};switch(_0x47d04b[_0xe220('0x50')][_0xe220('0x34')]){case _0xe220('0x53'):_0x24c201[_0xe220('0x34')]=db[_0xe220('0x51')][_0xe220('0x52')];break;case _0xe220('0x54'):_0x24c201[_0xe220('0x34')]=db[_0xe220('0x51')]['INTEGER'];break;case _0xe220('0x55'):_0x24c201[_0xe220('0x34')]=db[_0xe220('0x51')][_0xe220('0x56')];_0x24c201['defaultValue']=![];break;default:}return db[_0xe220('0x4e')]['queryInterface'][_0xe220('0x57')]('cm_contacts',util['format'](_0xe220('0x58'),_0x863b47['id']),_0x24c201);})[_0xe220('0x29')](function(){return _0x863b47;});})[_0xe220('0x29')](respondWithResult(_0x588b51,0xc9))[_0xe220('0x4c')](handleError(_0x588b51,null));};
\ No newline at end of file
+var _0xf93d=['options','includeAll','include','findAll','rows','catch','show','params','find','sequelize','transaction','create','body','Sequelize','text','TEXT','number','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge'];(function(_0x4d5368,_0x3ad27e){var _0x1b3568=function(_0x2ea251){while(--_0x2ea251){_0x4d5368['push'](_0x4d5368['shift']());}};_0x1b3568(++_0x3ad27e);}(_0xf93d,0x11f));var _0xdf93=function(_0x3af9f5,_0x5dfd41){_0x3af9f5=_0x3af9f5-0x0;var _0x12e7be=_0xf93d[_0x3af9f5];return _0x12e7be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf93('0x0'));var zipdir=require(_0xdf93('0x1'));var jsonpatch=require(_0xdf93('0x2'));var rp=require(_0xdf93('0x3'));var moment=require(_0xdf93('0x4'));var BPromise=require(_0xdf93('0x5'));var Mustache=require(_0xdf93('0x6'));var util=require(_0xdf93('0x7'));var path=require(_0xdf93('0x8'));var sox=require(_0xdf93('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf93('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdf93('0xb'));var jsforce=require(_0xdf93('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdf93('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdf93('0xe'));var authService=require(_0xdf93('0xf'));var qs=require(_0xdf93('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf93('0x11'))(_0xdf93('0x12'));var utils=require(_0xdf93('0x13'));var config=require(_0xdf93('0x14'));var licenseUtil=require(_0xdf93('0x15'));var db=require(_0xdf93('0x16'))['db'];function respondWithStatusCode(_0x43f5b0,_0x84fd35){_0x84fd35=_0x84fd35||0xcc;return function(_0x54df85){if(_0x54df85){return _0x43f5b0[_0xdf93('0x17')](_0x84fd35);}return _0x43f5b0[_0xdf93('0x18')](_0x84fd35)[_0xdf93('0x19')]();};}function respondWithResult(_0x4852d0,_0x35131d){_0x35131d=_0x35131d||0xc8;return function(_0x428ece){if(_0x428ece){return _0x4852d0['status'](_0x35131d)['json'](_0x428ece);}};}function respondWithFilteredResult(_0x11e894,_0x3232c0){return function(_0x3804bc){if(_0x3804bc){var _0x38560b=typeof _0x3232c0['offset']==='undefined'&&typeof _0x3232c0['limit']==='undefined';var _0x349a92=_0x3804bc[_0xdf93('0x1a')];var _0x261035=_0x38560b?0x0:_0x3232c0['offset'];var _0x44555d=_0x38560b?_0x3804bc['count']:_0x3232c0['offset']+_0x3232c0[_0xdf93('0x1b')];var _0x2dc87c;if(_0x44555d>=_0x349a92){_0x44555d=_0x349a92;_0x2dc87c=0xc8;}else{_0x2dc87c=0xce;}_0x11e894[_0xdf93('0x18')](_0x2dc87c);return _0x11e894['set'](_0xdf93('0x1c'),_0x261035+'-'+_0x44555d+'/'+_0x349a92)[_0xdf93('0x1d')](_0x3804bc);}return null;};}function patchUpdates(_0x184201){return function(_0x4b729d){try{jsonpatch[_0xdf93('0x1e')](_0x4b729d,_0x184201,!![]);}catch(_0x33eb3e){return BPromise[_0xdf93('0x1f')](_0x33eb3e);}return _0x4b729d[_0xdf93('0x20')]();};}function saveUpdates(_0x41613b,_0x1c4776){return function(_0x13d284){if(_0x13d284){return _0x13d284[_0xdf93('0x21')](_0x41613b)[_0xdf93('0x22')](function(_0x5959a2){return _0x5959a2;});}return null;};}function removeEntity(_0x4b850e,_0x2cb602){return function(_0x24a136){if(_0x24a136){return _0x24a136[_0xdf93('0x23')]()[_0xdf93('0x22')](function(){_0x4b850e[_0xdf93('0x18')](0xcc)[_0xdf93('0x19')]();});}};}function handleEntityNotFound(_0x18ea16,_0x38a5e6){return function(_0x4a3c9c){if(!_0x4a3c9c){_0x18ea16['sendStatus'](0x194);}return _0x4a3c9c;};}function handleError(_0x360a59,_0x38982c){_0x38982c=_0x38982c||0x1f4;return function(_0x42e35c){logger[_0xdf93('0x24')](_0x42e35c[_0xdf93('0x25')]);if(_0x42e35c[_0xdf93('0x26')]){delete _0x42e35c[_0xdf93('0x26')];}_0x360a59[_0xdf93('0x18')](_0x38982c)[_0xdf93('0x27')](_0x42e35c);};}exports[_0xdf93('0x28')]=function(_0x57c440,_0xe3e7b1){var _0x1b7c6a={},_0x27bb1b={},_0x2a9e3c={'count':0x0,'rows':[]};var _0x1af696=_[_0xdf93('0x29')](db[_0xdf93('0x2a')][_0xdf93('0x2b')],function(_0x36ead2){return{'name':_0x36ead2[_0xdf93('0x2c')],'type':_0x36ead2[_0xdf93('0x2d')][_0xdf93('0x2e')]};});_0x27bb1b[_0xdf93('0x2f')]=_[_0xdf93('0x30')](_[_0xdf93('0x29')](_0x1af696,'name'),[_0xdf93('0x26')]);_0x27bb1b[_0xdf93('0x31')]=_[_0xdf93('0x32')](_0x57c440[_0xdf93('0x31')]);_0x27bb1b[_0xdf93('0x33')]=_[_0xdf93('0x34')](_0x27bb1b[_0xdf93('0x2f')],_0x27bb1b[_0xdf93('0x31')]);_0x1b7c6a['attributes']=_[_0xdf93('0x34')](_0x27bb1b[_0xdf93('0x2f')],qs['fields'](_0x57c440[_0xdf93('0x31')][_0xdf93('0x35')]));_0x1b7c6a[_0xdf93('0x36')]=_0x1b7c6a[_0xdf93('0x36')][_0xdf93('0x37')]?_0x1b7c6a[_0xdf93('0x36')]:_0x27bb1b[_0xdf93('0x2f')];if(!_0x57c440['query'][_0xdf93('0x38')](_0xdf93('0x39'))){_0x1b7c6a[_0xdf93('0x1b')]=qs[_0xdf93('0x1b')](_0x57c440[_0xdf93('0x31')][_0xdf93('0x1b')]);_0x1b7c6a[_0xdf93('0x3a')]=qs[_0xdf93('0x3a')](_0x57c440[_0xdf93('0x31')][_0xdf93('0x3a')]);}_0x1b7c6a[_0xdf93('0x3b')]=qs[_0xdf93('0x3c')](_0x57c440[_0xdf93('0x31')][_0xdf93('0x3c')]);_0x1b7c6a[_0xdf93('0x3d')]=qs[_0xdf93('0x33')](_[_0xdf93('0x3e')](_0x57c440[_0xdf93('0x31')],_0x27bb1b[_0xdf93('0x33')]),_0x1af696);if(_0x57c440[_0xdf93('0x31')][_0xdf93('0x3f')]){_0x1b7c6a[_0xdf93('0x3d')]=_['merge'](_0x1b7c6a[_0xdf93('0x3d')],{'$or':_[_0xdf93('0x29')](_0x1af696,function(_0x523618){if(_0x523618[_0xdf93('0x2d')]!=='VIRTUAL'){var _0x3ab420={};_0x3ab420[_0x523618[_0xdf93('0x26')]]={'$like':'%'+_0x57c440[_0xdf93('0x31')][_0xdf93('0x3f')]+'%'};return _0x3ab420;}})});}_0x1b7c6a=_[_0xdf93('0x40')]({},_0x1b7c6a,_0x57c440[_0xdf93('0x41')]);var _0x3383e5={'where':_0x1b7c6a[_0xdf93('0x3d')]};return db['CmCustomField'][_0xdf93('0x1a')](_0x3383e5)[_0xdf93('0x22')](function(_0x557c16){_0x2a9e3c[_0xdf93('0x1a')]=_0x557c16;if(_0x57c440['query'][_0xdf93('0x42')]){_0x1b7c6a[_0xdf93('0x43')]=[{'all':!![]}];}return db[_0xdf93('0x2a')][_0xdf93('0x44')](_0x1b7c6a);})['then'](function(_0x2d01f5){_0x2a9e3c[_0xdf93('0x45')]=_0x2d01f5;return _0x2a9e3c;})[_0xdf93('0x22')](respondWithFilteredResult(_0xe3e7b1,_0x1b7c6a))[_0xdf93('0x46')](handleError(_0xe3e7b1,null));};exports[_0xdf93('0x47')]=function(_0x453db7,_0x36b0c5){var _0xb79c8c={'raw':!![],'where':{'id':_0x453db7[_0xdf93('0x48')]['id']}},_0x8f7fe9={};_0x8f7fe9[_0xdf93('0x2f')]=_[_0xdf93('0x32')](db[_0xdf93('0x2a')]['rawAttributes']);_0x8f7fe9['query']=_[_0xdf93('0x32')](_0x453db7[_0xdf93('0x31')]);_0x8f7fe9['filters']=_['intersection'](_0x8f7fe9['model'],_0x8f7fe9['query']);_0xb79c8c[_0xdf93('0x36')]=_[_0xdf93('0x34')](_0x8f7fe9[_0xdf93('0x2f')],qs['fields'](_0x453db7['query'][_0xdf93('0x35')]));_0xb79c8c[_0xdf93('0x36')]=_0xb79c8c[_0xdf93('0x36')][_0xdf93('0x37')]?_0xb79c8c['attributes']:_0x8f7fe9[_0xdf93('0x2f')];if(_0x453db7[_0xdf93('0x31')][_0xdf93('0x42')]){_0xb79c8c[_0xdf93('0x43')]=[{'all':!![]}];}_0xb79c8c=_[_0xdf93('0x40')]({},_0xb79c8c,_0x453db7[_0xdf93('0x41')]);return db['CmCustomField'][_0xdf93('0x49')](_0xb79c8c)['then'](handleEntityNotFound(_0x36b0c5,null))[_0xdf93('0x22')](respondWithResult(_0x36b0c5,null))[_0xdf93('0x46')](handleError(_0x36b0c5,null));};exports['update']=function(_0x329152,_0x5a0e83){if(_0x329152['body']['id']){delete _0x329152['body']['id'];}return db[_0xdf93('0x2a')]['find']({'where':{'id':_0x329152[_0xdf93('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a0e83,null))['then'](saveUpdates(_0x329152['body'],null))['then'](respondWithResult(_0x5a0e83,null))['catch'](handleError(_0x5a0e83,null));};exports[_0xdf93('0x23')]=function(_0x4c7947,_0x2659ce){return db[_0xdf93('0x2a')][_0xdf93('0x49')]({'where':{'id':_0x4c7947[_0xdf93('0x48')]['id']}})[_0xdf93('0x22')](handleEntityNotFound(_0x2659ce,null))[_0xdf93('0x22')](removeEntity(_0x2659ce,null))[_0xdf93('0x46')](handleError(_0x2659ce,null));};exports['create']=function(_0x5594cf,_0x431bd4){var _0xa66b31;return db[_0xdf93('0x4a')][_0xdf93('0x4b')](function(_0x32511a){return db['CmCustomField'][_0xdf93('0x4c')](_0x5594cf[_0xdf93('0x4d')],{'transaction':_0x32511a})[_0xdf93('0x22')](function(_0x2e2280){_0xa66b31=_0x2e2280;var _0x330031={'type':db[_0xdf93('0x4e')]['TEXT'],'transaction':_0x32511a};switch(_0x5594cf[_0xdf93('0x4d')][_0xdf93('0x2d')]){case _0xdf93('0x4f'):_0x330031['type']=db['Sequelize'][_0xdf93('0x50')];break;case _0xdf93('0x51'):_0x330031['type']=db[_0xdf93('0x4e')]['INTEGER'];break;case _0xdf93('0x52'):_0x330031[_0xdf93('0x2d')]=db[_0xdf93('0x4e')][_0xdf93('0x53')];_0x330031[_0xdf93('0x54')]=![];break;default:}return db[_0xdf93('0x4a')]['queryInterface'][_0xdf93('0x55')](_0xdf93('0x56'),util[_0xdf93('0x57')]('cf_%d',_0xa66b31['id']),_0x330031);})[_0xdf93('0x22')](function(){return _0xa66b31;});})[_0xdf93('0x22')](respondWithResult(_0x431bd4,0xc9))['catch'](handleError(_0x431bd4,null));};
\ No newline at end of file
index eda5304..b371d0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f51=['path','rimraf','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','moment','bluebird','request-promise'];(function(_0x3ef4bd,_0x297634){var _0x1c234e=function(_0xfa5088){while(--_0xfa5088){_0x3ef4bd['push'](_0x3ef4bd['shift']());}};_0x1c234e(++_0x297634);}(_0x7f51,0x1be));var _0x17f5=function(_0x3ef10e,_0x28dd61){_0x3ef10e=_0x3ef10e-0x0;var _0x41484c=_0x7f51[_0x3ef10e];return _0x41484c;};'use strict';var _=require(_0x17f5('0x0'));var util=require(_0x17f5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x17f5('0x2'));var BPromise=require(_0x17f5('0x3'));var rp=require(_0x17f5('0x4'));var fs=require('fs');var path=require(_0x17f5('0x5'));var rimraf=require(_0x17f5('0x6'));var config=require('../../config/environment');var attributes=require(_0x17f5('0x7'));module[_0x17f5('0x8')]=function(_0x3cc207,_0x1d7ac5){return _0x3cc207[_0x17f5('0x9')]('CmCustomField',attributes,{'tableName':_0x17f5('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99eb=['api','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0xc61e0e,_0x482f2d){var _0x469801=function(_0x1c85b7){while(--_0x1c85b7){_0xc61e0e['push'](_0xc61e0e['shift']());}};_0x469801(++_0x482f2d);}(_0x99eb,0x81));var _0xb99e=function(_0x2a4cb1,_0x53f3db){_0x2a4cb1=_0x2a4cb1-0x0;var _0x59d7a1=_0x99eb[_0x2a4cb1];return _0x59d7a1;};'use strict';var _=require(_0xb99e('0x0'));var util=require(_0xb99e('0x1'));var logger=require(_0xb99e('0x2'))(_0xb99e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb99e('0x4'));var rimraf=require('rimraf');var config=require(_0xb99e('0x5'));var attributes=require(_0xb99e('0x6'));module[_0xb99e('0x7')]=function(_0x4c43f7,_0x511a0c){return _0x4c43f7[_0xb99e('0x8')](_0xb99e('0x9'),attributes,{'tableName':_0xb99e('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6f830be..628d51c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84c7=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x360e1d,_0xebec31){var _0x221e1c=function(_0x26f4e5){while(--_0x26f4e5){_0x360e1d['push'](_0x360e1d['shift']());}};_0x221e1c(++_0xebec31);}(_0x84c7,0x66));var _0x784c=function(_0x56f8d7,_0x39fbc9){_0x56f8d7=_0x56f8d7-0x0;var _0x24a107=_0x84c7[_0x56f8d7];return _0x24a107;};'use strict';var _=require(_0x784c('0x0'));var util=require(_0x784c('0x1'));var moment=require('moment');var BPromise=require(_0x784c('0x2'));var rs=require(_0x784c('0x3'));var fs=require('fs');var Redis=require(_0x784c('0x4'));var db=require(_0x784c('0x5'))['db'];var utils=require(_0x784c('0x6'));var logger=require('../../config/logger')(_0x784c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x784c('0x8')][_0x784c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59ed6e,_0x3194a0,_0x48a43e){return new BPromise(function(_0x1ce596,_0x5cee99){return client['request'](_0x59ed6e,_0x48a43e)[_0x784c('0xa')](function(_0x3c3a83){logger[_0x784c('0xb')]('CmCustomField,\x20%s,\x20%s',_0x3194a0,_0x784c('0xc'));logger[_0x784c('0xd')](_0x784c('0xe'),_0x3194a0,_0x784c('0xc'),JSON['stringify'](_0x3c3a83));if(_0x3c3a83[_0x784c('0xf')]){if(_0x3c3a83[_0x784c('0xf')][_0x784c('0x10')]===0x1f4){logger[_0x784c('0xf')](_0x784c('0x11'),_0x3194a0,_0x3c3a83[_0x784c('0xf')][_0x784c('0x12')]);return _0x5cee99(_0x3c3a83[_0x784c('0xf')][_0x784c('0x12')]);}logger[_0x784c('0xf')](_0x784c('0x11'),_0x3194a0,_0x3c3a83[_0x784c('0xf')][_0x784c('0x12')]);return _0x1ce596(_0x3c3a83[_0x784c('0xf')][_0x784c('0x12')]);}else{logger['info'](_0x784c('0x11'),_0x3194a0,_0x784c('0xc'));_0x1ce596(_0x3c3a83[_0x784c('0x13')][_0x784c('0x12')]);}})[_0x784c('0x14')](function(_0x918dab){logger[_0x784c('0xf')]('CmCustomField,\x20%s,\x20%s',_0x3194a0,_0x918dab);_0x5cee99(_0x918dab);});});}
\ No newline at end of file
+var _0x7a98=['../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3307bd,_0x256dbf){var _0x2561be=function(_0x3ebf){while(--_0x3ebf){_0x3307bd['push'](_0x3307bd['shift']());}};_0x2561be(++_0x256dbf);}(_0x7a98,0x190));var _0x87a9=function(_0x13e906,_0x394176){_0x13e906=_0x13e906-0x0;var _0x2a2ca1=_0x7a98[_0x13e906];return _0x2a2ca1;};'use strict';var _=require(_0x87a9('0x0'));var util=require(_0x87a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x87a9('0x2'));var fs=require('fs');var Redis=require(_0x87a9('0x3'));var db=require(_0x87a9('0x4'))['db'];var utils=require(_0x87a9('0x5'));var logger=require(_0x87a9('0x6'))(_0x87a9('0x7'));var config=require(_0x87a9('0x8'));var jayson=require(_0x87a9('0x9'));var client=jayson[_0x87a9('0xa')][_0x87a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f9816,_0x4c0ed3,_0x54385c){return new BPromise(function(_0x176c45,_0xfa308b){return client[_0x87a9('0xc')](_0x4f9816,_0x54385c)[_0x87a9('0xd')](function(_0x2c069c){logger['info'](_0x87a9('0xe'),_0x4c0ed3,_0x87a9('0xf'));logger[_0x87a9('0x10')](_0x87a9('0x11'),_0x4c0ed3,'request\x20sent',JSON[_0x87a9('0x12')](_0x2c069c));if(_0x2c069c[_0x87a9('0x13')]){if(_0x2c069c[_0x87a9('0x13')]['code']===0x1f4){logger[_0x87a9('0x13')](_0x87a9('0xe'),_0x4c0ed3,_0x2c069c['error'][_0x87a9('0x14')]);return _0xfa308b(_0x2c069c[_0x87a9('0x13')][_0x87a9('0x14')]);}logger[_0x87a9('0x13')](_0x87a9('0xe'),_0x4c0ed3,_0x2c069c[_0x87a9('0x13')][_0x87a9('0x14')]);return _0x176c45(_0x2c069c[_0x87a9('0x13')][_0x87a9('0x14')]);}else{logger[_0x87a9('0x15')](_0x87a9('0xe'),_0x4c0ed3,_0x87a9('0xf'));_0x176c45(_0x2c069c[_0x87a9('0x16')][_0x87a9('0x14')]);}})[_0x87a9('0x17')](function(_0x58c180){logger[_0x87a9('0x13')](_0x87a9('0xe'),_0x4c0ed3,_0x58c180);_0xfa308b(_0x58c180);});});}
\ No newline at end of file
index 04c77d1..12d7bd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a5=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x4c8e1d,_0x543ff0){var _0x59cffe=function(_0x5c6791){while(--_0x5c6791){_0x4c8e1d['push'](_0x4c8e1d['shift']());}};_0x59cffe(++_0x543ff0);}(_0xc2a5,0x14e));var _0x5c2a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc2a5[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x5c2a('0x0'));var util=require(_0x5c2a('0x1'));var path=require(_0x5c2a('0x2'));var timeout=require(_0x5c2a('0x3'));var express=require(_0x5c2a('0x4'));var router=express['Router']();var fs_extra=require(_0x5c2a('0x5'));var auth=require(_0x5c2a('0x6'));var interaction=require(_0x5c2a('0x7'));var config=require(_0x5c2a('0x8'));var controller=require(_0x5c2a('0x9'));router[_0x5c2a('0xa')]('/',auth[_0x5c2a('0xb')](),controller[_0x5c2a('0xc')]);router['get'](_0x5c2a('0xd'),auth[_0x5c2a('0xb')](),controller[_0x5c2a('0xe')]);router[_0x5c2a('0xf')]('/',auth['isAuthenticated'](),controller[_0x5c2a('0x10')]);router[_0x5c2a('0x11')](_0x5c2a('0xd'),auth[_0x5c2a('0xb')](),controller[_0x5c2a('0x12')]);router[_0x5c2a('0x13')](_0x5c2a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5c2a('0x14')]=router;
\ No newline at end of file
+var _0x64f5=['fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','express'];(function(_0x2b4629,_0x2cfe26){var _0x1d8fa9=function(_0x54de40){while(--_0x54de40){_0x2b4629['push'](_0x2b4629['shift']());}};_0x1d8fa9(++_0x2cfe26);}(_0x64f5,0x17e));var _0x564f=function(_0x3efed1,_0xf64440){_0x3efed1=_0x3efed1-0x0;var _0x53d2a8=_0x64f5[_0x3efed1];return _0x53d2a8;};'use strict';var multer=require(_0x564f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x564f('0x1'));var router=express['Router']();var fs_extra=require(_0x564f('0x2'));var auth=require(_0x564f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x564f('0x4'));var controller=require(_0x564f('0x5'));router[_0x564f('0x6')]('/',auth[_0x564f('0x7')](),controller[_0x564f('0x8')]);router['get'](_0x564f('0x9'),auth[_0x564f('0x7')](),controller[_0x564f('0xa')]);router[_0x564f('0xb')]('/',auth[_0x564f('0x7')](),controller[_0x564f('0xc')]);router[_0x564f('0xd')](_0x564f('0x9'),auth[_0x564f('0x7')](),controller[_0x564f('0xe')]);router[_0x564f('0xf')](_0x564f('0x9'),auth[_0x564f('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 2eb6ce5..87de91c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab57=['STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','contactListQueue','moment','sequelize','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xab57,0x9d));var _0x7ab5=function(_0x17ffb0,_0x193478){_0x17ffb0=_0x17ffb0-0x0;var _0x582e6c=_0xab57[_0x17ffb0];return _0x582e6c;};'use strict';var moment=require(_0x7ab5('0x0'));var Sequelize=require(_0x7ab5('0x1'));module[_0x7ab5('0x2')]={'phone':{'type':Sequelize[_0x7ab5('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x7ab5('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x7ab5('0x5')](_0x7ab5('0x6'))},'countbusyretry':{'type':Sequelize[_0x7ab5('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7ab5('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7ab5('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7ab5('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7ab5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7ab5('0x8')]},'priority':{'type':Sequelize[_0x7ab5('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7ab5('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x7ab5('0x9')},'ListId':{'type':Sequelize[_0x7ab5('0x7')],'unique':_0x7ab5('0x9')},'UserId':{'type':Sequelize[_0x7ab5('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x7ab5('0x7')],'unique':_0x7ab5('0x9')},'CampaignId':{'type':Sequelize[_0x7ab5('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x7ab5('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7ab5('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7ab5('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7ab5('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x7ab5('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0x7708=['moment','sequelize','STRING','INTEGER','BOOLEAN','DATE','UNSIGNED','contactListQueue'];(function(_0x299ecf,_0x5e642b){var _0x4813c9=function(_0x4726e7){while(--_0x4726e7){_0x299ecf['push'](_0x299ecf['shift']());}};_0x4813c9(++_0x5e642b);}(_0x7708,0x188));var _0x8770=function(_0xb68772,_0x5253ac){_0xb68772=_0xb68772-0x0;var _0x4189bb=_0x7708[_0xb68772];return _0x4189bb;};'use strict';var moment=require(_0x8770('0x0'));var Sequelize=require(_0x8770('0x1'));module['exports']={'phone':{'type':Sequelize[_0x8770('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8770('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8770('0x5')]},'priority':{'type':Sequelize[_0x8770('0x3')](0x2)[_0x8770('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8770('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8770('0x3')],'unique':_0x8770('0x7')},'ListId':{'type':Sequelize[_0x8770('0x3')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x8770('0x3')]},'VoiceQueueId':{'type':Sequelize[_0x8770('0x3')],'unique':_0x8770('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8770('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8770('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x8770('0x5')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 22a3ade..0ddf549 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab6e=['$like','$notLike','$iLike','$notILike','$contains','$any','attributes','intersection','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','calleridnum','phone','campaigntype','queue','CmContact','ContactId','isNil','firstName','lastName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','findOne','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopper','fieldName','type','key','model','query','keys','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$notBetween','$in','$notIn'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xab6e,0x199));var _0xeab6=function(_0x4a1853,_0x46dbf8){_0x4a1853=_0x4a1853-0x0;var _0x303c5b=_0xab6e[_0x4a1853];return _0x303c5b;};'use strict';var emlformat=require(_0xeab6('0x0'));var rimraf=require(_0xeab6('0x1'));var zipdir=require(_0xeab6('0x2'));var jsonpatch=require(_0xeab6('0x3'));var rp=require('request-promise');var moment=require(_0xeab6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeab6('0x5'));var util=require(_0xeab6('0x6'));var path=require(_0xeab6('0x7'));var sox=require('sox');var csv=require(_0xeab6('0x8'));var ejs=require(_0xeab6('0x9'));var fs=require('fs');var fs_extra=require(_0xeab6('0xa'));var _=require(_0xeab6('0xb'));var squel=require(_0xeab6('0xc'));var crypto=require('crypto');var jsforce=require(_0xeab6('0xd'));var deskjs=require(_0xeab6('0xe'));var toCsv=require(_0xeab6('0x8'));var querystring=require('querystring');var Papa=require(_0xeab6('0xf'));var Redis=require(_0xeab6('0x10'));var authService=require(_0xeab6('0x11'));var qs=require(_0xeab6('0x12'));var as=require(_0xeab6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeab6('0x14'))(_0xeab6('0x15'));var utils=require('../../config/utils');var config=require(_0xeab6('0x16'));var shared=require(_0xeab6('0x16'));var licenseUtil=require(_0xeab6('0x17'));var db=require(_0xeab6('0x18'))['db'];function respondWithStatusCode(_0x315cee,_0x428aed){_0x428aed=_0x428aed||0xcc;return function(_0x4c320f){if(_0x4c320f){return _0x315cee[_0xeab6('0x19')](_0x428aed);}return _0x315cee['status'](_0x428aed)[_0xeab6('0x1a')]();};}function respondWithResult(_0x2666ac,_0x114be9){_0x114be9=_0x114be9||0xc8;return function(_0x9be063){if(_0x9be063){return _0x2666ac[_0xeab6('0x1b')](_0x114be9)['json'](_0x9be063);}};}function respondWithFilteredResult(_0x4b6eb5,_0x5ceeb5){return function(_0x477a88){if(_0x477a88){var _0x5ca4ab=typeof _0x5ceeb5[_0xeab6('0x1c')]===_0xeab6('0x1d')&&typeof _0x5ceeb5[_0xeab6('0x1e')]==='undefined';var _0x379d86=_0x477a88[_0xeab6('0x1f')];var _0x5c31ee=_0x5ca4ab?0x0:_0x5ceeb5[_0xeab6('0x1c')];var _0x47afba=_0x5ca4ab?_0x477a88[_0xeab6('0x1f')]:_0x5ceeb5[_0xeab6('0x1c')]+_0x5ceeb5['limit'];var _0x1ccaae;if(_0x47afba>=_0x379d86){_0x47afba=_0x379d86;_0x1ccaae=0xc8;}else{_0x1ccaae=0xce;}_0x4b6eb5[_0xeab6('0x1b')](_0x1ccaae);return _0x4b6eb5[_0xeab6('0x20')]('Content-Range',_0x5c31ee+'-'+_0x47afba+'/'+_0x379d86)[_0xeab6('0x21')](_0x477a88);}return null;};}function patchUpdates(_0x2118c9){return function(_0x141a59){try{jsonpatch[_0xeab6('0x22')](_0x141a59,_0x2118c9,!![]);}catch(_0x1715cb){return BPromise[_0xeab6('0x23')](_0x1715cb);}return _0x141a59[_0xeab6('0x24')]();};}function saveUpdates(_0x497b99,_0x5b9d48){return function(_0x2e4a35){if(_0x2e4a35){return _0x2e4a35[_0xeab6('0x25')](_0x497b99)[_0xeab6('0x26')](function(_0x32d4bb){return _0x32d4bb;});}return null;};}function removeEntity(_0x15d72b,_0x11dbe2){return function(_0x1dd9be){if(_0x1dd9be){return _0x1dd9be[_0xeab6('0x27')]()['then'](function(){_0x15d72b['status'](0xcc)[_0xeab6('0x1a')]();});}};}function handleEntityNotFound(_0x1d067b,_0x476018){return function(_0x58a0a8){if(!_0x58a0a8){_0x1d067b[_0xeab6('0x19')](0x194);}return _0x58a0a8;};}function handleError(_0x59e490,_0xa854f5){_0xa854f5=_0xa854f5||0x1f4;return function(_0x5761b9){logger[_0xeab6('0x28')](_0x5761b9[_0xeab6('0x29')]);if(_0x5761b9[_0xeab6('0x2a')]){delete _0x5761b9[_0xeab6('0x2a')];}_0x59e490[_0xeab6('0x1b')](_0xa854f5)[_0xeab6('0x2b')](_0x5761b9);};}exports['index']=function(_0x692960,_0x5222e9){var _0x321297={},_0x265391={},_0x23d602={'count':0x0,'rows':[]};var _0x2608db=_[_0xeab6('0x2c')](db[_0xeab6('0x2d')]['rawAttributes'],function(_0xcceb93){return{'name':_0xcceb93[_0xeab6('0x2e')],'type':_0xcceb93[_0xeab6('0x2f')][_0xeab6('0x30')]};});_0x265391[_0xeab6('0x31')]=_[_0xeab6('0x2c')](_0x2608db,_0xeab6('0x2a'));_0x265391[_0xeab6('0x32')]=_[_0xeab6('0x33')](_0x692960[_0xeab6('0x32')]);_0x265391[_0xeab6('0x34')]=_['intersection'](_0x265391['model'],_0x265391['query']);_0x265391[_0xeab6('0x34')]=_[_0xeab6('0x35')](_0x265391[_0xeab6('0x34')],[_0xeab6('0x36'),_0xeab6('0x37'),_0xeab6('0x38'),_0xeab6('0x39'),_0xeab6('0x3a'),_0xeab6('0x3b'),_0xeab6('0x3c'),'$eq',_0xeab6('0x3d'),'$between',_0xeab6('0x3e'),_0xeab6('0x3f'),_0xeab6('0x40'),_0xeab6('0x41'),_0xeab6('0x42'),_0xeab6('0x43'),_0xeab6('0x44'),_0xeab6('0x41'),'$overlap',_0xeab6('0x45'),'$contained',_0xeab6('0x46')]);_0x321297[_0xeab6('0x47')]=_[_0xeab6('0x48')](_0x265391['model'],qs[_0xeab6('0x49')](_0x692960[_0xeab6('0x32')][_0xeab6('0x49')]));_0x321297[_0xeab6('0x47')]=_0x321297['attributes'][_0xeab6('0x4a')]?_0x321297[_0xeab6('0x47')]:_0x265391[_0xeab6('0x31')];if(!_0x692960['query']['hasOwnProperty']('nolimit')){_0x321297['limit']=qs[_0xeab6('0x1e')](_0x692960[_0xeab6('0x32')][_0xeab6('0x1e')]);_0x321297['offset']=qs['offset'](_0x692960[_0xeab6('0x32')][_0xeab6('0x1c')]);}_0x321297[_0xeab6('0x4b')]=qs[_0xeab6('0x4c')](_0x692960[_0xeab6('0x32')][_0xeab6('0x4c')]);_0x321297[_0xeab6('0x4d')]=qs[_0xeab6('0x34')](_['pick'](_0x692960[_0xeab6('0x32')],_0x265391['filters']),_0x2608db);if(_0x692960[_0xeab6('0x32')]['filter']){_0x321297[_0xeab6('0x4d')]=_[_0xeab6('0x4e')](_0x321297[_0xeab6('0x4d')],{'$or':_[_0xeab6('0x2c')](_0x2608db,function(_0x317309){if(_0x317309[_0xeab6('0x2f')]!==_0xeab6('0x4f')){var _0xa1e8d1={};_0xa1e8d1[_0x317309[_0xeab6('0x2a')]]={'$like':'%'+_0x692960[_0xeab6('0x32')][_0xeab6('0x50')]+'%'};return _0xa1e8d1;}})});}_0x321297=_[_0xeab6('0x4e')]({},_0x321297,_0x692960[_0xeab6('0x51')]);var _0x18692e={'where':_0x321297[_0xeab6('0x4d')]};return db['CmHopper'][_0xeab6('0x1f')](_0x18692e)[_0xeab6('0x26')](function(_0x41880f){_0x23d602[_0xeab6('0x1f')]=_0x41880f;if(_0x692960[_0xeab6('0x32')][_0xeab6('0x52')]){_0x321297[_0xeab6('0x53')]=[{'all':!![]}];}return db[_0xeab6('0x2d')][_0xeab6('0x54')](_0x321297);})[_0xeab6('0x26')](function(_0x34424e){_0x23d602['rows']=_0x34424e;return _0x23d602;})[_0xeab6('0x26')](respondWithFilteredResult(_0x5222e9,_0x321297))[_0xeab6('0x55')](handleError(_0x5222e9,null));};exports['show']=function(_0x18f19a,_0x7e8346){var _0x332442={'raw':!![],'where':{'id':_0x18f19a[_0xeab6('0x56')]['id']}},_0x292a2a={};_0x292a2a['model']=_[_0xeab6('0x33')](db['CmHopper'][_0xeab6('0x57')]);_0x292a2a[_0xeab6('0x32')]=_[_0xeab6('0x33')](_0x18f19a[_0xeab6('0x32')]);_0x292a2a[_0xeab6('0x34')]=_['intersection'](_0x292a2a['model'],_0x292a2a[_0xeab6('0x32')]);_0x332442[_0xeab6('0x47')]=_['intersection'](_0x292a2a[_0xeab6('0x31')],qs[_0xeab6('0x49')](_0x18f19a[_0xeab6('0x32')][_0xeab6('0x49')]));_0x332442['attributes']=_0x332442['attributes']['length']?_0x332442[_0xeab6('0x47')]:_0x292a2a[_0xeab6('0x31')];if(_0x18f19a[_0xeab6('0x32')][_0xeab6('0x52')]){_0x332442[_0xeab6('0x53')]=[{'all':!![]}];}_0x332442=_[_0xeab6('0x4e')]({},_0x332442,_0x18f19a[_0xeab6('0x51')]);return db[_0xeab6('0x2d')][_0xeab6('0x58')](_0x332442)['then'](handleEntityNotFound(_0x7e8346,null))[_0xeab6('0x26')](respondWithResult(_0x7e8346,null))[_0xeab6('0x55')](handleError(_0x7e8346,null));};exports[_0xeab6('0x59')]=function(_0x162f13,_0x393e2d){return db[_0xeab6('0x2d')][_0xeab6('0x59')](_0x162f13[_0xeab6('0x5a')],{})['then'](respondWithResult(_0x393e2d,0xc9))[_0xeab6('0x55')](handleError(_0x393e2d,null));};exports['update']=function(_0x33ae3d,_0x1f10f9){if(_0x33ae3d['body']['id']){delete _0x33ae3d[_0xeab6('0x5a')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x33ae3d['params']['id']}})[_0xeab6('0x26')](handleEntityNotFound(_0x1f10f9,null))[_0xeab6('0x26')](saveUpdates(_0x33ae3d['body'],null))[_0xeab6('0x26')](respondWithResult(_0x1f10f9,null))['catch'](handleError(_0x1f10f9,null));};exports[_0xeab6('0x5b')]=function(_0x1f9587,_0x2a21aa){return db[_0xeab6('0x2d')][_0xeab6('0x5b')]()['then'](respondWithResult(_0x2a21aa,null))[_0xeab6('0x55')](handleError(_0x2a21aa,null));};exports['destroy']=function(_0x556d23,_0x6a8186){var _0x1832cb;var _0x183033=_0x556d23[_0xeab6('0x56')]['id'];return db[_0xeab6('0x2d')][_0xeab6('0x58')]({'where':{'id':_0x556d23['params']['id']}})[_0xeab6('0x26')](handleEntityNotFound(_0x6a8186,null))[_0xeab6('0x26')](function(_0x1ce3e0){if(_0x1ce3e0){return _0x1ce3e0[_0xeab6('0x27')]()[_0xeab6('0x26')](function(_0x3f2ae4){return _0x3f2ae4;});}})[_0xeab6('0x26')](function(_0x14fc95){_0x1832cb=_0x14fc95;if(_0x14fc95){if(_0x14fc95[_0xeab6('0x5c')]||_0x14fc95['CampaignId']){return db[_0x14fc95[_0xeab6('0x5c')]?_0xeab6('0x5d'):_0xeab6('0x5e')][_0xeab6('0x58')]({'where':{'id':_0x14fc95['VoiceQueueId']?_0x14fc95['VoiceQueueId']:_0x14fc95[_0xeab6('0x5f')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x393dcd){var _0x5e5821={};if(_0x393dcd){_[_0xeab6('0x4e')](_0x5e5821,_[_0xeab6('0x60')](_0x1832cb[_0xeab6('0x61')],[_0xeab6('0x62'),_0xeab6('0x63'),'id']));_0x5e5821[_0xeab6('0x64')]=0x15;_0x5e5821[_0xeab6('0x65')]=_0xeab6('0x66');_0x5e5821[_0xeab6('0x67')]=_0x393dcd['name'];_0x5e5821[_0xeab6('0x68')]=_0x556d23[_0xeab6('0x69')][_0xeab6('0x2a')];_0x5e5821[_0xeab6('0x6a')]=_0x556d23[_0xeab6('0x69')]['id'];_0x5e5821['deleted']=!![];_0x5e5821['deletedat']=moment()[_0xeab6('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e5821[_0xeab6('0x6c')]=_0x1832cb[_0xeab6('0x6d')];_0x5e5821[_0xeab6('0x6e')]=_0x1832cb[_0xeab6('0x5c')]?_0xeab6('0x6f'):'ivr';return db[_0xeab6('0x70')][_0xeab6('0x58')]({'where':{'id':_0x5e5821[_0xeab6('0x71')]},'attributes':['firstName','lastName']})[_0xeab6('0x26')](function(_0x243f1d){if(!_[_0xeab6('0x72')](_0x6a8186)&&!_[_0xeab6('0x72')](_0x243f1d['firstName'])){_0x5e5821['calleridname']=_0x243f1d[_0xeab6('0x73')];if(!_['isNil'](_0x243f1d[_0xeab6('0x74')])){_0x5e5821[_0xeab6('0x75')]+='\x20'+_0x243f1d['lastName'];}}})[_0xeab6('0x76')](function(){return db[_0xeab6('0x77')]['create'](_0x5e5821);});}})[_0xeab6('0x26')](function(_0x3ec706){return db[_0xeab6('0x78')][_0xeab6('0x27')]({'where':{'CmHopperId':_0x183033}});})[_0xeab6('0x26')](function(){return _0x6a8186[_0xeab6('0x1b')](0xcc)[_0xeab6('0x1a')]();})['catch'](handleError(_0x6a8186,null));};exports['getPreview']=function(_0x33ce6e,_0x20d077,_0x8135c2){var _0x17d8a4=[];return db['CmContact'][_0xeab6('0x5b')]()[_0xeab6('0x26')](function(_0x489a5a){_0x17d8a4=_[_0xeab6('0x33')](_0x489a5a);return _0x33ce6e[_0xeab6('0x69')][_0xeab6('0x79')]({'where':{'type':_0xeab6('0x7a'),'dialActive':!![],'dialMethod':_0xeab6('0x7b')},'attributes':['id',_0xeab6('0x7c'),_0xeab6('0x7d')],'raw':!![]});})[_0xeab6('0x26')](function(_0x43f0ff){if(_0x43f0ff&&_0x43f0ff[_0xeab6('0x4a')]){return db[_0xeab6('0x7e')][_0xeab6('0x7f')](function(_0x5603c6){var _0x419f3a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xeab6('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x43f0ff,'id')},'$or':[{'UserId':null},{'UserId':_0x33ce6e[_0xeab6('0x69')]['id']}]};var _0x498415={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x43f0ff)['filter']([_0xeab6('0x7d'),0x0])[_0xeab6('0x2c')]('id')[_0xeab6('0x80')]()},'$or':[{'UserId':null},{'UserId':_0x33ce6e[_0xeab6('0x69')]['id']}]};var _0x2e1f68={'$or':[_0x419f3a,_0x498415]};var _0x35766a=[];if(_0x33ce6e[_0xeab6('0x5a')][_0xeab6('0x81')]&&_0x33ce6e[_0xeab6('0x5a')][_0xeab6('0x81')]===_0xeab6('0x82')){if(!_[_0xeab6('0x83')](_0x33ce6e[_0xeab6('0x5a')][_0xeab6('0x84')])){_0x2e1f68['id']={'$in':_0x33ce6e[_0xeab6('0x5a')][_0xeab6('0x84')]};}_0x35766a=[[_0xeab6('0x85'),_0xeab6('0x86')],[_0xeab6('0x87'),_0x43f0ff[0x0][_0xeab6('0x7c')]===_0xeab6('0x86')?'DESC':_0xeab6('0x86')],db[_0xeab6('0x7e')][_0xeab6('0x88')](_0xeab6('0x89')),['id',_0xeab6('0x8a')]];}else{if(!_[_0xeab6('0x83')](_0x33ce6e['body'][_0xeab6('0x84')])){_0x2e1f68['id']={'$notIn':_0x33ce6e[_0xeab6('0x5a')][_0xeab6('0x84')]};}_0x35766a=[['priority','DESC'],[_0xeab6('0x87'),_0x43f0ff[0x0][_0xeab6('0x7c')]],db[_0xeab6('0x7e')][_0xeab6('0x88')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xeab6('0x86')]];}return db['CmHopper']['findOne']({'attributes':['id','scheduledat',_0xeab6('0x6d'),_0xeab6('0x8b')],'where':_0x2e1f68,'order':_0x35766a,'transaction':_0x5603c6,'lock':_0x5603c6[_0xeab6('0x8c')][_0xeab6('0x8d')],'include':[{'model':db['CmContact'],'as':_0xeab6('0x8e'),'attributes':_0x17d8a4,'include':[{'model':db[_0xeab6('0x8f')],'as':_0xeab6('0x90'),'attributes':['id',_0xeab6('0x2a')]}]},{'model':db[_0xeab6('0x91')],'as':_0xeab6('0x92'),'attributes':['id','name']},{'model':db[_0xeab6('0x5d')],'as':_0xeab6('0x93'),'attributes':['id','name',_0xeab6('0x94')]}]})[_0xeab6('0x26')](function(_0x1db81b){if(_0x1db81b){return _0x1db81b[_0xeab6('0x25')]({'UserId':_0x33ce6e[_0xeab6('0x69')]['id']},{'transaction':_0x5603c6});}});});}})[_0xeab6('0x26')](handleEntityNotFound(_0x20d077,null))[_0xeab6('0x26')](respondWithResult(_0x20d077,null))[_0xeab6('0x55')](handleError(_0x20d077,null));};exports[_0xeab6('0x95')]=function(_0x48c42e,_0x20ae0a,_0x2f1ebd){var _0x55a530=[];return db['CmContact'][_0xeab6('0x5b')]()['then'](function(_0x319ff2){_0x55a530=_[_0xeab6('0x33')](_0x319ff2);return _0x48c42e[_0xeab6('0x69')][_0xeab6('0x79')]({'where':{'type':_0xeab6('0x7a'),'dialActive':!![],'dialMethod':_0xeab6('0x7b')},'attributes':['id',_0xeab6('0x7c'),_0xeab6('0x7d')],'raw':!![]});})[_0xeab6('0x26')](function(_0x4d047f){if(_0x4d047f&&_0x4d047f[_0xeab6('0x4a')]){return db[_0xeab6('0x7e')][_0xeab6('0x7f')](function(_0x88378a){var _0x503b54={'active':![],'recallme':!![],'id':_0x48c42e[_0xeab6('0x5a')]['hopperId']};return db[_0xeab6('0x2d')][_0xeab6('0x96')]({'attributes':['id','scheduledat',_0xeab6('0x8b')],'where':_0x503b54,'transaction':_0x88378a,'lock':_0x88378a[_0xeab6('0x8c')][_0xeab6('0x8d')],'include':[{'model':db[_0xeab6('0x70')],'as':_0xeab6('0x8e'),'attributes':_0x55a530,'include':[{'model':db[_0xeab6('0x8f')],'as':_0xeab6('0x90'),'attributes':['id',_0xeab6('0x2a')]}]},{'model':db[_0xeab6('0x91')],'as':_0xeab6('0x92'),'attributes':['id',_0xeab6('0x2a')]},{'model':db['VoiceQueue'],'as':_0xeab6('0x93'),'attributes':['id','name',_0xeab6('0x94')]}]})['then'](function(_0x188775){if(_0x188775){return _0x188775[_0xeab6('0x25')]({'UserId':_0x48c42e[_0xeab6('0x69')]['id']},{'transaction':_0x88378a});}});});}})[_0xeab6('0x26')](handleEntityNotFound(_0x20ae0a,null))['then'](respondWithResult(_0x20ae0a,null))[_0xeab6('0x55')](handleError(_0x20ae0a,null));};exports['getOpenContacts']=function(_0x31f1e9,_0x248a41,_0x5a9d6b){return _0x31f1e9[_0xeab6('0x69')][_0xeab6('0x79')]({'where':{'type':_0xeab6('0x7a'),'dialActive':!![],'dialMethod':_0xeab6('0x7b')},'attributes':['id'],'raw':!![]})['then'](function(_0x1bce01){if(_0x1bce01&&_0x1bce01[_0xeab6('0x4a')]){return db[_0xeab6('0x2d')][_0xeab6('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xeab6('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xeab6('0x2c')](_0x1bce01,'id')},'$or':[{'UserId':null},{'UserId':_0x31f1e9[_0xeab6('0x69')]['id']}]}});}return 0x0;})[_0xeab6('0x26')](function(_0x2dd0ad){if(!_['isNil'](_0x2dd0ad)&&_['isNumber'](_0x2dd0ad)){return _0x248a41[_0xeab6('0x1b')](0xc8)[_0xeab6('0x21')]({'contacts':_0x2dd0ad});}else{logger[_0xeab6('0x28')](_0xeab6('0x97'),_0xeab6('0x98'),0x194,_0xeab6('0x99'));_0x248a41[_0xeab6('0x19')](0x194);}})[_0xeab6('0x55')](handleError(_0x248a41,null));};exports[_0xeab6('0x9a')]=function(_0x30a189,_0x139c6c,_0x91bba0){var _0x113f86=shared[_0xeab6('0x9b')];var _0xb23542=[];_['map'](_0x113f86,function(_0xe3c7b3){_0xb23542[_0xeab6('0x9c')]({'id':_0xe3c7b3[_0xeab6('0x2a')],'name':_0xe3c7b3[_0xeab6('0x2a')],'utcOffset':_0xe3c7b3[_0xeab6('0x9d')]});});return _0x139c6c[_0xeab6('0x1b')](0xc8)[_0xeab6('0x21')]({'tz':_0xb23542});};exports['getTimezone']=function(_0x1953c6,_0x48f045,_0x468ed9){var _0x3b8125=shared['timezones'];var _0x557d90={};if(!_[_0xeab6('0x72')](_0x3b8125[_0x1953c6[_0xeab6('0x5a')]['id']]))_0x557d90=_0x3b8125[_0x1953c6[_0xeab6('0x5a')]['id']];return _0x48f045[_0xeab6('0x1b')](0xc8)[_0xeab6('0x21')](_0x557d90);};
\ No newline at end of file
+var _0x1e72=['describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','ContactId','firstName','isNil','lastName','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','UPDATE','CmContact','Contact','CmCompany','CmList','List','Queue','getPreviewRecall','hopperId','findOne','LOCK','Company','dialActive','getOpenContacts','isNumber','error','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','key','query','keys','filters','intersection','$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$iLike','$contains','$any','fields','attributes','length','model','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','update','body'];(function(_0x4e9fed,_0x19f4f3){var _0x5c8cc0=function(_0x36116c){while(--_0x36116c){_0x4e9fed['push'](_0x4e9fed['shift']());}};_0x5c8cc0(++_0x19f4f3);}(_0x1e72,0xe9));var _0x21e7=function(_0x2a5ffb,_0x38697f){_0x2a5ffb=_0x2a5ffb-0x0;var _0x41c5af=_0x1e72[_0x2a5ffb];return _0x41c5af;};'use strict';var emlformat=require(_0x21e7('0x0'));var rimraf=require(_0x21e7('0x1'));var zipdir=require(_0x21e7('0x2'));var jsonpatch=require(_0x21e7('0x3'));var rp=require('request-promise');var moment=require(_0x21e7('0x4'));var BPromise=require(_0x21e7('0x5'));var Mustache=require(_0x21e7('0x6'));var util=require('util');var path=require(_0x21e7('0x7'));var sox=require(_0x21e7('0x8'));var csv=require('to-csv');var ejs=require(_0x21e7('0x9'));var fs=require('fs');var fs_extra=require(_0x21e7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x21e7('0xb'));var jsforce=require(_0x21e7('0xc'));var deskjs=require(_0x21e7('0xd'));var toCsv=require(_0x21e7('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x21e7('0xf'));var authService=require(_0x21e7('0x10'));var qs=require(_0x21e7('0x11'));var as=require(_0x21e7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21e7('0x13'))('api');var utils=require(_0x21e7('0x14'));var config=require(_0x21e7('0x15'));var shared=require(_0x21e7('0x15'));var licenseUtil=require(_0x21e7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x489e19,_0xf9ba8e){_0xf9ba8e=_0xf9ba8e||0xcc;return function(_0x3451b6){if(_0x3451b6){return _0x489e19[_0x21e7('0x17')](_0xf9ba8e);}return _0x489e19[_0x21e7('0x18')](_0xf9ba8e)[_0x21e7('0x19')]();};}function respondWithResult(_0x5e3e01,_0x7af096){_0x7af096=_0x7af096||0xc8;return function(_0x4e8263){if(_0x4e8263){return _0x5e3e01[_0x21e7('0x18')](_0x7af096)['json'](_0x4e8263);}};}function respondWithFilteredResult(_0x535e1c,_0x118277){return function(_0x4adb41){if(_0x4adb41){var _0x5d1bc4=typeof _0x118277['offset']===_0x21e7('0x1a')&&typeof _0x118277['limit']===_0x21e7('0x1a');var _0x31f4c9=_0x4adb41[_0x21e7('0x1b')];var _0x56e36b=_0x5d1bc4?0x0:_0x118277['offset'];var _0xebf475=_0x5d1bc4?_0x4adb41[_0x21e7('0x1b')]:_0x118277['offset']+_0x118277[_0x21e7('0x1c')];var _0x1f8266;if(_0xebf475>=_0x31f4c9){_0xebf475=_0x31f4c9;_0x1f8266=0xc8;}else{_0x1f8266=0xce;}_0x535e1c[_0x21e7('0x18')](_0x1f8266);return _0x535e1c[_0x21e7('0x1d')](_0x21e7('0x1e'),_0x56e36b+'-'+_0xebf475+'/'+_0x31f4c9)[_0x21e7('0x1f')](_0x4adb41);}return null;};}function patchUpdates(_0x3f7360){return function(_0x87fc10){try{jsonpatch[_0x21e7('0x20')](_0x87fc10,_0x3f7360,!![]);}catch(_0x42b88f){return BPromise[_0x21e7('0x21')](_0x42b88f);}return _0x87fc10[_0x21e7('0x22')]();};}function saveUpdates(_0x12e568,_0x526d9d){return function(_0x5d8312){if(_0x5d8312){return _0x5d8312['update'](_0x12e568)[_0x21e7('0x23')](function(_0x295b77){return _0x295b77;});}return null;};}function removeEntity(_0x3d3a4c,_0xe3d4d8){return function(_0x26a56b){if(_0x26a56b){return _0x26a56b['destroy']()[_0x21e7('0x23')](function(){_0x3d3a4c['status'](0xcc)[_0x21e7('0x19')]();});}};}function handleEntityNotFound(_0x44a721,_0x1a2659){return function(_0x4bdd02){if(!_0x4bdd02){_0x44a721[_0x21e7('0x17')](0x194);}return _0x4bdd02;};}function handleError(_0x4a2d94,_0x5348e6){_0x5348e6=_0x5348e6||0x1f4;return function(_0x46f2dd){logger['error'](_0x46f2dd[_0x21e7('0x24')]);if(_0x46f2dd[_0x21e7('0x25')]){delete _0x46f2dd[_0x21e7('0x25')];}_0x4a2d94['status'](_0x5348e6)[_0x21e7('0x26')](_0x46f2dd);};}exports[_0x21e7('0x27')]=function(_0x1fdbac,_0x2e8fe2){var _0x358a12={},_0x4fca09={},_0x3267f0={'count':0x0,'rows':[]};var _0x4e445d=_[_0x21e7('0x28')](db[_0x21e7('0x29')][_0x21e7('0x2a')],function(_0x23b0a9){return{'name':_0x23b0a9[_0x21e7('0x2b')],'type':_0x23b0a9['type'][_0x21e7('0x2c')]};});_0x4fca09['model']=_[_0x21e7('0x28')](_0x4e445d,_0x21e7('0x25'));_0x4fca09[_0x21e7('0x2d')]=_[_0x21e7('0x2e')](_0x1fdbac[_0x21e7('0x2d')]);_0x4fca09[_0x21e7('0x2f')]=_[_0x21e7('0x30')](_0x4fca09['model'],_0x4fca09[_0x21e7('0x2d')]);_0x4fca09['filters']=_['concat'](_0x4fca09[_0x21e7('0x2f')],[_0x21e7('0x31'),'$or',_0x21e7('0x32'),_0x21e7('0x33'),'$lt',_0x21e7('0x34'),_0x21e7('0x35'),_0x21e7('0x36'),_0x21e7('0x37'),_0x21e7('0x38'),'$notBetween',_0x21e7('0x39'),_0x21e7('0x3a'),_0x21e7('0x3b'),'$notLike',_0x21e7('0x3c'),'$notILike',_0x21e7('0x3b'),'$overlap',_0x21e7('0x3d'),'$contained',_0x21e7('0x3e')]);_0x358a12['attributes']=_[_0x21e7('0x30')](_0x4fca09['model'],qs[_0x21e7('0x3f')](_0x1fdbac['query'][_0x21e7('0x3f')]));_0x358a12['attributes']=_0x358a12[_0x21e7('0x40')][_0x21e7('0x41')]?_0x358a12['attributes']:_0x4fca09[_0x21e7('0x42')];if(!_0x1fdbac[_0x21e7('0x2d')][_0x21e7('0x43')](_0x21e7('0x44'))){_0x358a12['limit']=qs[_0x21e7('0x1c')](_0x1fdbac[_0x21e7('0x2d')]['limit']);_0x358a12[_0x21e7('0x45')]=qs[_0x21e7('0x45')](_0x1fdbac[_0x21e7('0x2d')][_0x21e7('0x45')]);}_0x358a12[_0x21e7('0x46')]=qs['sort'](_0x1fdbac['query'][_0x21e7('0x47')]);_0x358a12[_0x21e7('0x48')]=qs[_0x21e7('0x2f')](_[_0x21e7('0x49')](_0x1fdbac[_0x21e7('0x2d')],_0x4fca09['filters']),_0x4e445d);if(_0x1fdbac[_0x21e7('0x2d')][_0x21e7('0x4a')]){_0x358a12['where']=_[_0x21e7('0x4b')](_0x358a12[_0x21e7('0x48')],{'$or':_[_0x21e7('0x28')](_0x4e445d,function(_0x481a0d){if(_0x481a0d['type']!==_0x21e7('0x4c')){var _0x1c3d75={};_0x1c3d75[_0x481a0d['name']]={'$like':'%'+_0x1fdbac[_0x21e7('0x2d')][_0x21e7('0x4a')]+'%'};return _0x1c3d75;}})});}_0x358a12=_[_0x21e7('0x4b')]({},_0x358a12,_0x1fdbac[_0x21e7('0x4d')]);var _0x1d3f82={'where':_0x358a12['where']};return db['CmHopper']['count'](_0x1d3f82)[_0x21e7('0x23')](function(_0x19be3e){_0x3267f0[_0x21e7('0x1b')]=_0x19be3e;if(_0x1fdbac[_0x21e7('0x2d')]['includeAll']){_0x358a12[_0x21e7('0x4e')]=[{'all':!![]}];}return db[_0x21e7('0x29')][_0x21e7('0x4f')](_0x358a12);})['then'](function(_0x287de0){_0x3267f0[_0x21e7('0x50')]=_0x287de0;return _0x3267f0;})[_0x21e7('0x23')](respondWithFilteredResult(_0x2e8fe2,_0x358a12))['catch'](handleError(_0x2e8fe2,null));};exports[_0x21e7('0x51')]=function(_0x283cf2,_0x1a2296){var _0x58df0c={'raw':!![],'where':{'id':_0x283cf2[_0x21e7('0x52')]['id']}},_0x1a3e86={};_0x1a3e86[_0x21e7('0x42')]=_['keys'](db[_0x21e7('0x29')][_0x21e7('0x2a')]);_0x1a3e86[_0x21e7('0x2d')]=_[_0x21e7('0x2e')](_0x283cf2['query']);_0x1a3e86[_0x21e7('0x2f')]=_['intersection'](_0x1a3e86[_0x21e7('0x42')],_0x1a3e86['query']);_0x58df0c[_0x21e7('0x40')]=_[_0x21e7('0x30')](_0x1a3e86[_0x21e7('0x42')],qs[_0x21e7('0x3f')](_0x283cf2['query'][_0x21e7('0x3f')]));_0x58df0c[_0x21e7('0x40')]=_0x58df0c[_0x21e7('0x40')][_0x21e7('0x41')]?_0x58df0c['attributes']:_0x1a3e86[_0x21e7('0x42')];if(_0x283cf2[_0x21e7('0x2d')][_0x21e7('0x53')]){_0x58df0c[_0x21e7('0x4e')]=[{'all':!![]}];}_0x58df0c=_[_0x21e7('0x4b')]({},_0x58df0c,_0x283cf2['options']);return db[_0x21e7('0x29')][_0x21e7('0x54')](_0x58df0c)[_0x21e7('0x23')](handleEntityNotFound(_0x1a2296,null))['then'](respondWithResult(_0x1a2296,null))[_0x21e7('0x55')](handleError(_0x1a2296,null));};exports[_0x21e7('0x56')]=function(_0x1c06a9,_0x368654){return db[_0x21e7('0x29')][_0x21e7('0x56')](_0x1c06a9['body'],{})[_0x21e7('0x23')](respondWithResult(_0x368654,0xc9))[_0x21e7('0x55')](handleError(_0x368654,null));};exports[_0x21e7('0x57')]=function(_0x3196b4,_0x38662b){if(_0x3196b4['body']['id']){delete _0x3196b4[_0x21e7('0x58')]['id'];}return db['CmHopper'][_0x21e7('0x54')]({'where':{'id':_0x3196b4[_0x21e7('0x52')]['id']}})[_0x21e7('0x23')](handleEntityNotFound(_0x38662b,null))[_0x21e7('0x23')](saveUpdates(_0x3196b4[_0x21e7('0x58')],null))[_0x21e7('0x23')](respondWithResult(_0x38662b,null))[_0x21e7('0x55')](handleError(_0x38662b,null));};exports[_0x21e7('0x59')]=function(_0x42644d,_0x3657b6){return db[_0x21e7('0x29')][_0x21e7('0x59')]()['then'](respondWithResult(_0x3657b6,null))['catch'](handleError(_0x3657b6,null));};exports[_0x21e7('0x5a')]=function(_0x151b51,_0x7b1bb2){var _0x53a7d3;return db[_0x21e7('0x29')][_0x21e7('0x54')]({'where':{'id':_0x151b51[_0x21e7('0x52')]['id']}})[_0x21e7('0x23')](handleEntityNotFound(_0x7b1bb2,null))[_0x21e7('0x23')](function(_0x10cc37){if(_0x10cc37){return _0x10cc37[_0x21e7('0x5a')]()['then'](function(_0x422f7f){return _0x422f7f;});}})['then'](function(_0x300e9c){_0x53a7d3=_0x300e9c;if(_0x300e9c){if(_0x300e9c[_0x21e7('0x5b')]||_0x300e9c[_0x21e7('0x5c')]){return db[_0x300e9c[_0x21e7('0x5b')]?_0x21e7('0x5d'):_0x21e7('0x5e')][_0x21e7('0x54')]({'where':{'id':_0x300e9c[_0x21e7('0x5b')]?_0x300e9c[_0x21e7('0x5b')]:_0x300e9c[_0x21e7('0x5c')]},'attributes':['id',_0x21e7('0x25')],'raw':!![]});}}})[_0x21e7('0x23')](function(_0x183a4f){var _0x5e78f8={};if(_0x183a4f){_[_0x21e7('0x4b')](_0x5e78f8,_[_0x21e7('0x5f')](_0x53a7d3[_0x21e7('0x60')],[_0x21e7('0x61'),_0x21e7('0x62'),'id']));_0x5e78f8[_0x21e7('0x63')]=0x15;_0x5e78f8[_0x21e7('0x64')]=_0x21e7('0x65');_0x5e78f8[_0x21e7('0x66')]=_0x183a4f[_0x21e7('0x25')];_0x5e78f8[_0x21e7('0x67')]=_0x151b51['user']['name'];_0x5e78f8[_0x21e7('0x68')]=_0x151b51[_0x21e7('0x69')]['id'];_0x5e78f8[_0x21e7('0x65')]=!![];_0x5e78f8[_0x21e7('0x6a')]=moment()[_0x21e7('0x6b')](_0x21e7('0x6c'));_0x5e78f8['calleridnum']=_0x53a7d3[_0x21e7('0x6d')];_0x5e78f8[_0x21e7('0x6e')]=_0x53a7d3['VoiceQueueId']?_0x21e7('0x6f'):_0x21e7('0x70');return db['CmContact'][_0x21e7('0x54')]({'where':{'id':_0x5e78f8[_0x21e7('0x71')]},'attributes':[_0x21e7('0x72'),'lastName']})[_0x21e7('0x23')](function(_0x581118){if(!_['isNil'](_0x7b1bb2)&&!_[_0x21e7('0x73')](_0x581118[_0x21e7('0x72')])){_0x5e78f8['calleridname']=_0x581118[_0x21e7('0x72')];if(!_[_0x21e7('0x73')](_0x581118[_0x21e7('0x74')])){_0x5e78f8[_0x21e7('0x75')]+='\x20'+_0x581118[_0x21e7('0x74')];}}})[_0x21e7('0x76')](function(){return db['CmHopperFinal'][_0x21e7('0x56')](_0x5e78f8);});}})[_0x21e7('0x23')](function(){return _0x7b1bb2[_0x21e7('0x18')](0xcc)[_0x21e7('0x19')]();})[_0x21e7('0x55')](handleError(_0x7b1bb2,null));};exports[_0x21e7('0x77')]=function(_0x28bf47,_0x26b7cd,_0x2797bb){var _0x719e95=[];return db['CmContact'][_0x21e7('0x59')]()['then'](function(_0x115ce0){_0x719e95=_['keys'](_0x115ce0);return _0x28bf47[_0x21e7('0x69')][_0x21e7('0x78')]({'where':{'type':_0x21e7('0x79'),'dialActive':!![],'dialMethod':_0x21e7('0x7a')},'attributes':['id',_0x21e7('0x7b'),_0x21e7('0x7c')],'raw':!![]});})[_0x21e7('0x23')](function(_0xd73998){if(_0xd73998&&_0xd73998['length']){return db[_0x21e7('0x7d')][_0x21e7('0x7e')](function(_0x1b7014){var _0x17e8fb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x21e7('0x6b')](_0x21e7('0x6c'))},'VoiceQueueId':{'$in':_[_0x21e7('0x28')](_0xd73998,'id')},'$or':[{'UserId':null},{'UserId':_0x28bf47[_0x21e7('0x69')]['id']}]};var _0x4febcc={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xd73998)[_0x21e7('0x4a')](['dialPreviewAutoRecallMe',0x0])[_0x21e7('0x28')]('id')[_0x21e7('0x7f')]()},'$or':[{'UserId':null},{'UserId':_0x28bf47[_0x21e7('0x69')]['id']}]};var _0x5ada21={'$or':[_0x17e8fb,_0x4febcc]};var _0x62b159=[];if(_0x28bf47['body']['direction']&&_0x28bf47['body'][_0x21e7('0x80')]===_0x21e7('0x81')){if(!_[_0x21e7('0x82')](_0x28bf47[_0x21e7('0x58')]['hopperIds'])){_0x5ada21['id']={'$in':_0x28bf47[_0x21e7('0x58')][_0x21e7('0x83')]};}_0x62b159=[[_0x21e7('0x84'),_0x21e7('0x85')],[_0x21e7('0x86'),_0xd73998[0x0][_0x21e7('0x7b')]===_0x21e7('0x85')?_0x21e7('0x87'):_0x21e7('0x85')],db[_0x21e7('0x7d')][_0x21e7('0x88')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x21e7('0x87')]];}else{if(!_[_0x21e7('0x82')](_0x28bf47['body'][_0x21e7('0x83')])){_0x5ada21['id']={'$notIn':_0x28bf47[_0x21e7('0x58')][_0x21e7('0x83')]};}_0x62b159=[[_0x21e7('0x84'),_0x21e7('0x87')],[_0x21e7('0x86'),_0xd73998[0x0][_0x21e7('0x7b')]],db['sequelize'][_0x21e7('0x88')](_0x21e7('0x89')),['id','ASC']];}return db[_0x21e7('0x29')]['findOne']({'attributes':['id',_0x21e7('0x8a'),_0x21e7('0x8b')],'where':_0x5ada21,'order':_0x62b159,'transaction':_0x1b7014,'lock':_0x1b7014['LOCK'][_0x21e7('0x8c')],'include':[{'model':db[_0x21e7('0x8d')],'as':_0x21e7('0x8e'),'attributes':_0x719e95,'include':[{'model':db[_0x21e7('0x8f')],'as':'Company','attributes':['id',_0x21e7('0x25')]}]},{'model':db[_0x21e7('0x90')],'as':_0x21e7('0x91'),'attributes':['id',_0x21e7('0x25')]},{'model':db[_0x21e7('0x5d')],'as':_0x21e7('0x92'),'attributes':['id','name','dialActive']}]})[_0x21e7('0x23')](function(_0x440ca2){if(_0x440ca2){return _0x440ca2[_0x21e7('0x57')]({'UserId':_0x28bf47[_0x21e7('0x69')]['id']},{'transaction':_0x1b7014});}});});}})['then'](handleEntityNotFound(_0x26b7cd,null))[_0x21e7('0x23')](respondWithResult(_0x26b7cd,null))['catch'](handleError(_0x26b7cd,null));};exports[_0x21e7('0x93')]=function(_0xd9158c,_0x6c8795,_0x424243){var _0x5a2320=[];return db['CmContact']['describe']()['then'](function(_0x12c730){_0x5a2320=_['keys'](_0x12c730);return _0xd9158c[_0x21e7('0x69')][_0x21e7('0x78')]({'where':{'type':_0x21e7('0x79'),'dialActive':!![],'dialMethod':_0x21e7('0x7a')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0x21e7('0x23')](function(_0x577715){if(_0x577715&&_0x577715[_0x21e7('0x41')]){return db[_0x21e7('0x7d')][_0x21e7('0x7e')](function(_0xf6b271){var _0x38e248={'active':![],'recallme':!![],'id':_0xd9158c[_0x21e7('0x58')][_0x21e7('0x94')]};return db[_0x21e7('0x29')][_0x21e7('0x95')]({'attributes':['id','scheduledat','recallme'],'where':_0x38e248,'transaction':_0xf6b271,'lock':_0xf6b271[_0x21e7('0x96')][_0x21e7('0x8c')],'include':[{'model':db[_0x21e7('0x8d')],'as':_0x21e7('0x8e'),'attributes':_0x5a2320,'include':[{'model':db[_0x21e7('0x8f')],'as':_0x21e7('0x97'),'attributes':['id',_0x21e7('0x25')]}]},{'model':db[_0x21e7('0x90')],'as':'List','attributes':['id',_0x21e7('0x25')]},{'model':db[_0x21e7('0x5d')],'as':_0x21e7('0x92'),'attributes':['id',_0x21e7('0x25'),_0x21e7('0x98')]}]})[_0x21e7('0x23')](function(_0x4d65be){if(_0x4d65be){return _0x4d65be[_0x21e7('0x57')]({'UserId':_0xd9158c[_0x21e7('0x69')]['id']},{'transaction':_0xf6b271});}});});}})['then'](handleEntityNotFound(_0x6c8795,null))[_0x21e7('0x23')](respondWithResult(_0x6c8795,null))[_0x21e7('0x55')](handleError(_0x6c8795,null));};exports[_0x21e7('0x99')]=function(_0xecb92f,_0x57e970,_0x331a0d){return _0xecb92f['user'][_0x21e7('0x78')]({'where':{'type':_0x21e7('0x79'),'dialActive':!![],'dialMethod':_0x21e7('0x7a')},'attributes':['id'],'raw':!![]})[_0x21e7('0x23')](function(_0x20d9c0){if(_0x20d9c0&&_0x20d9c0[_0x21e7('0x41')]){return db[_0x21e7('0x29')][_0x21e7('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x21e7('0x6b')](_0x21e7('0x6c'))},'VoiceQueueId':{'$in':_['map'](_0x20d9c0,'id')},'$or':[{'UserId':null},{'UserId':_0xecb92f[_0x21e7('0x69')]['id']}]}});}return 0x0;})['then'](function(_0x201c66){if(!_['isNil'](_0x201c66)&&_[_0x21e7('0x9a')](_0x201c66)){return _0x57e970[_0x21e7('0x18')](0xc8)[_0x21e7('0x1f')]({'contacts':_0x201c66});}else{logger[_0x21e7('0x9b')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x21e7('0x99'),0x194,_0x21e7('0x9c'));_0x57e970[_0x21e7('0x17')](0x194);}})[_0x21e7('0x55')](handleError(_0x57e970,null));};exports[_0x21e7('0x9d')]=function(_0x2ad2e5,_0x2d8ec0,_0xa9c16c){var _0x445f97=shared[_0x21e7('0x9e')];var _0x5a265b=[];_['map'](_0x445f97,function(_0x5efb36){_0x5a265b[_0x21e7('0x9f')]({'id':_0x5efb36[_0x21e7('0x25')],'name':_0x5efb36['name'],'utcOffset':_0x5efb36[_0x21e7('0xa0')]});});return _0x2d8ec0[_0x21e7('0x18')](0xc8)[_0x21e7('0x1f')]({'tz':_0x5a265b});};exports['getTimezone']=function(_0x4fd9f5,_0x3fea25,_0xbabc0e){var _0x4dfc4c=shared['timezones'];var _0x326ed0={};if(!_[_0x21e7('0x73')](_0x4dfc4c[_0x4fd9f5[_0x21e7('0x58')]['id']]))_0x326ed0=_0x4dfc4c[_0x4fd9f5['body']['id']];return _0x3fea25[_0x21e7('0x18')](0xc8)[_0x21e7('0x1f')](_0x326ed0);};
\ No newline at end of file
index 35651d3..3b73561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['moment','bluebird','path','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x53ec,0x192));var _0xc53e=function(_0x31ade7,_0x4a2dab){_0x31ade7=_0x31ade7-0x0;var _0x1b20ad=_0x53ec[_0x31ade7];return _0x1b20ad;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]},{'name':_0xc53e('0xc'),'fields':[_0xc53e('0xc')]},{'name':_0xc53e('0xd'),'fields':[_0xc53e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0xd117,0x182));var _0x7d11=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0xd117[_0x213518];return _0x1baf75;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xe')]},{'name':_0x7d11('0xf'),'fields':['phone']},{'name':_0x7d11('0x10'),'fields':[_0x7d11('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
index a62f5ee..b7c7a8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ec5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','CmHopper,\x20%s,\x20%s','message','result','CmHopper','findAll','raw','options','where','attributes','map','include','model','GetCmHopper','stringify','catch','ShowCmHopper','find','CreateCmHopper','body','UpdateCmHopper','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','keys','name','push','update','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','order','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueId','interval','\x20MINUTE','User','voicePause','CmList','List','NOW()\x20+\x20INTERVAL\x20','CmHopperHandlePreviewRecallNotifications','lodash','util','bluebird','randomstring'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7ec5,0x158));var _0x57ec=function(_0x618644,_0x24242b){_0x618644=_0x618644-0x0;var _0x401623=_0x7ec5[_0x618644];return _0x401623;};'use strict';var _=require(_0x57ec('0x0'));var util=require(_0x57ec('0x1'));var moment=require('moment');var BPromise=require(_0x57ec('0x2'));var rs=require(_0x57ec('0x3'));var fs=require('fs');var Redis=require(_0x57ec('0x4'));var db=require(_0x57ec('0x5'))['db'];var utils=require(_0x57ec('0x6'));var logger=require(_0x57ec('0x7'))(_0x57ec('0x8'));var config=require(_0x57ec('0x9'));var jayson=require(_0x57ec('0xa'));const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson['client'][_0x57ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x256d8f,_0x1d607b,_0x4b17c0){return new BPromise(function(_0x3658f8,_0x5313db){return client[_0x57ec('0xc')](_0x256d8f,_0x4b17c0)[_0x57ec('0xd')](function(_0x528ec8){logger[_0x57ec('0xe')]('CmHopper,\x20%s,\x20%s',_0x1d607b,_0x57ec('0xf'));logger[_0x57ec('0x10')](_0x57ec('0x11'),_0x1d607b,_0x57ec('0xf'),JSON['stringify'](_0x528ec8));if(_0x528ec8[_0x57ec('0x12')]){if(_0x528ec8[_0x57ec('0x12')][_0x57ec('0x13')]===0x1f4){logger[_0x57ec('0x12')](_0x57ec('0x14'),_0x1d607b,_0x528ec8[_0x57ec('0x12')][_0x57ec('0x15')]);return _0x5313db(_0x528ec8[_0x57ec('0x12')][_0x57ec('0x15')]);}logger[_0x57ec('0x12')](_0x57ec('0x14'),_0x1d607b,_0x528ec8[_0x57ec('0x12')][_0x57ec('0x15')]);return _0x3658f8(_0x528ec8[_0x57ec('0x12')][_0x57ec('0x15')]);}else{logger[_0x57ec('0xe')](_0x57ec('0x14'),_0x1d607b,_0x57ec('0xf'));_0x3658f8(_0x528ec8[_0x57ec('0x16')]['message']);}})['catch'](function(_0x1c91db){logger['error'](_0x57ec('0x14'),_0x1d607b,_0x1c91db);_0x5313db(_0x1c91db);});});}exports['GetCmHopper']=function(_0x21f30d){var _0x3eaabc=this;return new Promise(function(_0xda1a9d,_0x32685f){return db[_0x57ec('0x17')][_0x57ec('0x18')]({'raw':_0x21f30d['options']?_0x21f30d['options'][_0x57ec('0x19')]===undefined?!![]:![]:!![],'where':_0x21f30d[_0x57ec('0x1a')]?_0x21f30d[_0x57ec('0x1a')][_0x57ec('0x1b')]||null:null,'attributes':_0x21f30d[_0x57ec('0x1a')]?_0x21f30d[_0x57ec('0x1a')][_0x57ec('0x1c')]||null:null,'limit':_0x21f30d['options']?_0x21f30d[_0x57ec('0x1a')]['limit']||null:null,'include':_0x21f30d[_0x57ec('0x1a')]?_0x21f30d[_0x57ec('0x1a')]['include']?_[_0x57ec('0x1d')](_0x21f30d['options'][_0x57ec('0x1e')],function(_0xdfbd27){return{'model':db[_0xdfbd27['model']],'as':_0xdfbd27['as'],'attributes':_0xdfbd27[_0x57ec('0x1c')],'include':_0xdfbd27[_0x57ec('0x1e')]?_[_0x57ec('0x1d')](_0xdfbd27[_0x57ec('0x1e')],function(_0xfce204){return{'model':db[_0xfce204[_0x57ec('0x1f')]],'as':_0xfce204['as'],'attributes':_0xfce204[_0x57ec('0x1c')],'include':_0xfce204['include']?_['map'](_0xfce204['include'],function(_0x22e475){return{'model':db[_0x22e475[_0x57ec('0x1f')]],'as':_0x22e475['as'],'attributes':_0x22e475['attributes']};}):[]};}):[]};}):[]:[]})[_0x57ec('0xd')](function(_0x46f521){logger[_0x57ec('0xe')](_0x57ec('0x20'),_0x21f30d);logger[_0x57ec('0x10')](_0x57ec('0x20'),_0x21f30d,JSON[_0x57ec('0x21')](_0x46f521));_0xda1a9d(_0x46f521);})[_0x57ec('0x22')](function(_0x1c6b2c){logger[_0x57ec('0x12')](_0x57ec('0x20'),_0x1c6b2c[_0x57ec('0x15')],_0x21f30d);_0x32685f(_0x3eaabc[_0x57ec('0x12')](0x1f4,_0x1c6b2c[_0x57ec('0x15')]));});});};exports[_0x57ec('0x23')]=function(_0x240c56){var _0x40b5bc=this;return new Promise(function(_0x1d65da,_0x4276a0){return db[_0x57ec('0x17')][_0x57ec('0x24')]({'raw':_0x240c56[_0x57ec('0x1a')]?_0x240c56[_0x57ec('0x1a')][_0x57ec('0x19')]===undefined?!![]:![]:!![],'where':_0x240c56[_0x57ec('0x1a')]?_0x240c56['options'][_0x57ec('0x1b')]||null:null,'attributes':_0x240c56[_0x57ec('0x1a')]?_0x240c56[_0x57ec('0x1a')][_0x57ec('0x1c')]||null:null,'include':_0x240c56[_0x57ec('0x1a')]?_0x240c56['options'][_0x57ec('0x1e')]?_[_0x57ec('0x1d')](_0x240c56[_0x57ec('0x1a')]['include'],function(_0x43b3a5){return{'model':db[_0x43b3a5['model']],'as':_0x43b3a5['as'],'attributes':_0x43b3a5[_0x57ec('0x1c')],'include':_0x43b3a5[_0x57ec('0x1e')]?_[_0x57ec('0x1d')](_0x43b3a5['include'],function(_0x13e5b3){return{'model':db[_0x13e5b3[_0x57ec('0x1f')]],'as':_0x13e5b3['as'],'attributes':_0x13e5b3['attributes'],'include':_0x13e5b3[_0x57ec('0x1e')]?_['map'](_0x13e5b3['include'],function(_0x58e762){return{'model':db[_0x58e762['model']],'as':_0x58e762['as'],'attributes':_0x58e762[_0x57ec('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4992b6){logger[_0x57ec('0xe')](_0x57ec('0x23'),_0x240c56);logger[_0x57ec('0x10')](_0x57ec('0x23'),_0x240c56,JSON[_0x57ec('0x21')](_0x4992b6));_0x1d65da(_0x4992b6);})[_0x57ec('0x22')](function(_0x360127){logger[_0x57ec('0x12')]('ShowCmHopper',_0x360127['message'],_0x240c56);_0x4276a0(_0x40b5bc[_0x57ec('0x12')](0x1f4,_0x360127['message']));});});};exports[_0x57ec('0x25')]=function(_0x1f7929){var _0x4fc787=this;return new Promise(function(_0x23ba66,_0x513037){return db[_0x57ec('0x17')]['create'](_0x1f7929[_0x57ec('0x26')],{'raw':_0x1f7929[_0x57ec('0x1a')]?_0x1f7929['options'][_0x57ec('0x19')]===undefined?!![]:![]:!![]})[_0x57ec('0xd')](function(_0x4989cb){logger[_0x57ec('0xe')](_0x57ec('0x25'),_0x1f7929);logger[_0x57ec('0x10')](_0x57ec('0x25'),_0x1f7929,JSON[_0x57ec('0x21')](_0x4989cb));_0x23ba66(_0x4989cb);})[_0x57ec('0x22')](function(_0x52a3ab){logger[_0x57ec('0x12')]('CreateCmHopper',_0x52a3ab[_0x57ec('0x15')],_0x1f7929);_0x513037(_0x4fc787[_0x57ec('0x12')](0x1f4,_0x52a3ab[_0x57ec('0x15')]));});});};exports[_0x57ec('0x27')]=function(_0x2e232a){var _0x2265df=this;return new Promise(function(_0x24aa03,_0x205c02){return db[_0x57ec('0x17')]['update'](_0x2e232a[_0x57ec('0x26')],{'raw':_0x2e232a[_0x57ec('0x1a')]?_0x2e232a[_0x57ec('0x1a')][_0x57ec('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e232a[_0x57ec('0x1a')]?_0x2e232a['options'][_0x57ec('0x1b')]||null:null,'attributes':_0x2e232a[_0x57ec('0x1a')]?_0x2e232a[_0x57ec('0x1a')][_0x57ec('0x1c')]||null:null,'limit':_0x2e232a['options']?_0x2e232a['options'][_0x57ec('0x28')]||null:null})[_0x57ec('0xd')](function(_0x2b02a7){logger[_0x57ec('0xe')](_0x57ec('0x27'),_0x2e232a);logger[_0x57ec('0xe')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x57ec('0x21')](_0x2e232a[_0x57ec('0x1a')][_0x57ec('0x1b')]),_0x2e232a['body']['active']);logger[_0x57ec('0x10')](_0x57ec('0x27'),_0x2e232a,JSON[_0x57ec('0x21')](_0x2b02a7));_0x24aa03(_0x2b02a7);})[_0x57ec('0x22')](function(_0x5b1349){logger[_0x57ec('0x12')]('UpdateCmHopper',_0x5b1349[_0x57ec('0x15')],_0x2e232a);_0x205c02(_0x2265df[_0x57ec('0x12')](0x1f4,_0x5b1349[_0x57ec('0x15')]));});});};exports[_0x57ec('0x29')]=function(_0x8b35f7){var _0x1987e8=this;return new Promise(function(_0x516537,_0x5ea7fe){return db[_0x57ec('0x17')][_0x57ec('0x2a')]({'where':_0x8b35f7[_0x57ec('0x1a')]?_0x8b35f7[_0x57ec('0x1a')]['where']||null:null})[_0x57ec('0xd')](function(_0x8a345b){logger[_0x57ec('0xe')](_0x57ec('0x29'),_0x8b35f7);logger['debug'](_0x57ec('0x29'),_0x8b35f7,JSON[_0x57ec('0x21')](_0x8a345b));_0x516537(_0x8a345b);})[_0x57ec('0x22')](function(_0x31e25d){logger[_0x57ec('0x12')](_0x57ec('0x29'),_0x31e25d[_0x57ec('0x15')],_0x8b35f7);_0x5ea7fe(_0x1987e8[_0x57ec('0x12')](0x1f4,_0x31e25d[_0x57ec('0x15')]));});});};exports[_0x57ec('0x2b')]=function(_0x30e7ae){var _0x7636a1=this;return new Promise(function(_0x1b50e0,_0x12d3eb){return db[_0x57ec('0x2c')][_0x57ec('0x2d')]()[_0x57ec('0xd')](function(_0x4926ce){return db[_0x57ec('0x2e')][_0x57ec('0x2f')](function(_0x18d7fa){return db[_0x57ec('0x17')][_0x57ec('0x18')]({'where':_0x30e7ae['options']?_0x30e7ae['options'][_0x57ec('0x1b')]||null:null,'attributes':_0x30e7ae[_0x57ec('0x1a')]?_0x30e7ae[_0x57ec('0x1a')][_0x57ec('0x1c')]||null:null,'limit':_0x30e7ae[_0x57ec('0x1a')]?_0x30e7ae[_0x57ec('0x1a')][_0x57ec('0x28')]||null:null,'order':_0x30e7ae[_0x57ec('0x1a')]?_0x30e7ae['options']['order']||null:null,'transaction':_0x18d7fa,'lock':_0x18d7fa[_0x57ec('0x30')][_0x57ec('0x31')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x57ec('0x32')](_0x4926ce)},{'model':db['User'],'as':'Agent','attributes':['id',_0x57ec('0x33'),'voicePause']}]})[_0x57ec('0xd')](function(_0x25ad93){var _0x13ab9d=[];var _0x9f8799=[];for(var _0x2bd874=0x0;_0x2bd874<_0x25ad93['length'];_0x2bd874+=0x1){var _0x1b8612=_0x25ad93[_0x2bd874]['UserId'];if(_0x1b8612===null){_0x13ab9d[_0x57ec('0x34')](_0x25ad93[_0x2bd874]['update'](_0x30e7ae[_0x57ec('0x26')],{'transaction':_0x18d7fa}));}else if(!_0x9f8799['includes'](_0x1b8612)){_0x9f8799[_0x57ec('0x34')](_0x1b8612);_0x13ab9d[_0x57ec('0x34')](_0x25ad93[_0x2bd874][_0x57ec('0x35')](_0x30e7ae[_0x57ec('0x26')],{'transaction':_0x18d7fa}));}}return BPromise[_0x57ec('0x36')](_0x13ab9d);});})['then'](function(_0x5671f7){logger[_0x57ec('0xe')](_0x57ec('0x2b'),_0x30e7ae);if(_0x5671f7[_0x57ec('0x37')]>0x0){logger[_0x57ec('0xe')](_0x57ec('0x38'),_0x5671f7[0x0]['dataValues']['id'],_0x5671f7[0x0][_0x57ec('0x39')]['ContactId'],_0x5671f7[0x0][_0x57ec('0x39')]['active']);}logger['debug'](_0x57ec('0x2b'),_0x30e7ae,JSON[_0x57ec('0x21')](_0x5671f7));_0x1b50e0(_0x5671f7);})[_0x57ec('0x22')](function(_0x107e53){logger[_0x57ec('0x12')](_0x57ec('0x2b'),_0x107e53['message'],_0x30e7ae);_0x12d3eb(_0x7636a1[_0x57ec('0x12')](0x1f4,_0x107e53[_0x57ec('0x15')]));});});});};exports[_0x57ec('0x3a')]=function(_0x260a63){var _0x39d1e9=this;return new Promise(function(_0x574432,_0x5aa317){return db['sequelize'][_0x57ec('0x2f')](function(_0x280929){return db['CmHopperFinal'][_0x57ec('0x3b')](_0x260a63[_0x57ec('0x26')],{'raw':_0x260a63[_0x57ec('0x1a')]?_0x260a63[_0x57ec('0x1a')][_0x57ec('0x19')]===undefined?!![]:![]:!![],'transaction':_0x280929})[_0x57ec('0xd')](function(){logger[_0x57ec('0xe')](_0x57ec('0x3c'),JSON[_0x57ec('0x21')](_0x260a63[_0x57ec('0x1a')][_0x57ec('0x1b')]),_0x260a63['options'][_0x57ec('0x1b')]['active']);return db['CmHopper'][_0x57ec('0x2a')]({'where':_0x260a63[_0x57ec('0x1a')]?_0x260a63['options'][_0x57ec('0x1b')]||null:null,'transaction':_0x280929});});})['then'](function(_0x7d7116){logger[_0x57ec('0xe')](_0x57ec('0x3a'),_0x260a63);logger[_0x57ec('0x10')]('MoveContactManagedDialer',_0x260a63,JSON[_0x57ec('0x21')](_0x7d7116));_0x574432(_0x7d7116);})[_0x57ec('0x22')](function(_0x572ccc){logger['error'](_0x57ec('0x3a'),_0x572ccc[_0x57ec('0x15')],_0x260a63);_0x5aa317(_0x39d1e9[_0x57ec('0x12')](0x1f4,_0x572ccc[_0x57ec('0x15')]));});});};exports['CountReScheduled']=function(_0x108383){var _0x45f180=this;return new Promise(function(_0x42bc91,_0x4de5dd){return db[_0x57ec('0x17')][_0x57ec('0x18')]({'raw':_0x108383[_0x57ec('0x1a')]?_0x108383[_0x57ec('0x1a')][_0x57ec('0x19')]===undefined?!![]:![]:!![],'where':_0x108383['options']?_0x108383[_0x57ec('0x1a')][_0x57ec('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x57ec('0x3d'),db[_0x57ec('0x2e')]['fn']('IF',db['sequelize'][_0x57ec('0x3e')](_0x57ec('0x3f')+util['format'](_0x57ec('0x40'),moment()[_0x57ec('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x57ec('0x42')))),'contactsRescheduled']]})['then'](function(_0x384db2){logger[_0x57ec('0xe')]('CountReScheduled',_0x108383);logger[_0x57ec('0x10')](_0x57ec('0x43'),_0x108383,JSON['stringify'](_0x384db2));_0x42bc91(_0x384db2);})['catch'](function(_0x1a008c){logger[_0x57ec('0x12')](_0x57ec('0x43'),_0x1a008c[_0x57ec('0x15')],_0x108383);_0x4de5dd(_0x45f180[_0x57ec('0x12')](0x1f4,_0x1a008c[_0x57ec('0x15')]));});});};exports[_0x57ec('0x44')]=function(_0x5e5ad6){var _0xab2478=this;return new Promise(function(_0x2c7bd1,_0x16e3ae){return db['CmContact'][_0x57ec('0x2d')]()[_0x57ec('0xd')](function(_0x2defa9){return db['sequelize'][_0x57ec('0x2f')](function(_0x365c4a){return db['CmHopper']['findAll']({'where':_0x5e5ad6[_0x57ec('0x1a')]?_0x5e5ad6[_0x57ec('0x1a')][_0x57ec('0x1b')]||null:null,'attributes':_0x5e5ad6['options']?_0x5e5ad6[_0x57ec('0x1a')][_0x57ec('0x1c')]||null:null,'limit':0x1,'order':_0x5e5ad6[_0x57ec('0x1a')]?_0x5e5ad6[_0x57ec('0x1a')][_0x57ec('0x45')]||null:null,'group':db[_0x57ec('0x17')]['UserId'],'transaction':_0x365c4a,'lock':_0x365c4a['LOCK'][_0x57ec('0x31')],'include':_0x5e5ad6[_0x57ec('0x1a')]?_0x5e5ad6['options'][_0x57ec('0x1e')]?_[_0x57ec('0x1d')](_0x5e5ad6[_0x57ec('0x1a')][_0x57ec('0x1e')],function(_0x3212ed){return{'model':db[_0x3212ed[_0x57ec('0x1f')]],'as':_0x3212ed['as'],'attributes':_0x3212ed[_0x57ec('0x1c')],'include':_0x3212ed['include']?_[_0x57ec('0x1d')](_0x3212ed['include'],function(_0x2d3d97){return{'model':db[_0x2d3d97[_0x57ec('0x1f')]],'as':_0x2d3d97['as'],'attributes':_0x2d3d97[_0x57ec('0x1c')],'include':_0x2d3d97['include']?_[_0x57ec('0x1d')](_0x2d3d97[_0x57ec('0x1e')],function(_0x15aed7){return{'model':db[_0x15aed7[_0x57ec('0x1f')]],'as':_0x15aed7['as'],'attributes':_0x15aed7[_0x57ec('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x57ec('0xd')](function(_0x3929a6){var _0x20cd1d=[];for(var _0x3dd076=0x0;_0x3dd076<_0x3929a6[_0x57ec('0x37')];_0x3dd076+=0x1){_0x20cd1d[_0x57ec('0x34')](_0x3929a6[_0x3dd076][_0x57ec('0x35')](_0x5e5ad6[_0x57ec('0x26')],{'transaction':_0x365c4a}));}return BPromise[_0x57ec('0x36')](_0x20cd1d);});})['then'](function(_0x1ae5cf){logger['info'](_0x57ec('0x44'),_0x5e5ad6);logger['debug'](_0x57ec('0x44'),_0x5e5ad6,JSON['stringify'](_0x1ae5cf));_0x2c7bd1(_0x1ae5cf);})[_0x57ec('0x22')](function(_0x57b6ef){logger[_0x57ec('0x12')]('GetContactRecallMe',_0x57b6ef['message'],_0x5e5ad6);_0x16e3ae(_0xab2478[_0x57ec('0x12')](0x1f4,_0x57b6ef[_0x57ec('0x15')]));});});});};exports[_0x57ec('0x46')]=function(_0x2cf5af){var _0x567475=this;return new Promise(function(_0x3d5bd7,_0xde6e74){db['CmContact'][_0x57ec('0x2d')]()[_0x57ec('0xd')](function(_0xcf95a7){return db[_0x57ec('0x17')]['findAll']({'raw':_0x2cf5af[_0x57ec('0x1a')]?_0x2cf5af[_0x57ec('0x1a')][_0x57ec('0x19')]===undefined?!![]:![]:!![],'where':_0x2cf5af[_0x57ec('0x1a')]?_0x2cf5af[_0x57ec('0x1a')][_0x57ec('0x1b')]||null:null,'attributes':_0x2cf5af['options']?_0x2cf5af[_0x57ec('0x1a')][_0x57ec('0x1c')]||null:null,'limit':_0x2cf5af[_0x57ec('0x1a')]?_0x2cf5af['options'][_0x57ec('0x28')]||null:null,'include':_0x2cf5af[_0x57ec('0x1a')]?_0x2cf5af[_0x57ec('0x1a')][_0x57ec('0x1e')]?_[_0x57ec('0x1d')](_0x2cf5af['options'][_0x57ec('0x1e')],function(_0x4620d8){return{'model':db[_0x4620d8[_0x57ec('0x1f')]],'as':_0x4620d8['as'],'attributes':_0x4620d8['as']===_0x57ec('0x47')?_[_0x57ec('0x32')](_0xcf95a7):_0x4620d8[_0x57ec('0x1c')],'include':_0x4620d8[_0x57ec('0x1e')]?_['map'](_0x4620d8['include'],function(_0x24437f){return{'model':db[_0x24437f['model']],'as':_0x24437f['as'],'attributes':_0x24437f[_0x57ec('0x1c')],'include':_0x24437f[_0x57ec('0x1e')]?_[_0x57ec('0x1d')](_0x24437f['include'],function(_0x8ca1e4){return{'model':db[_0x8ca1e4['model']],'as':_0x8ca1e4['as'],'attributes':_0x8ca1e4['attributes']};}):[]};}):[]};}):[]:[]})[_0x57ec('0xd')](function(_0x48a8a0){logger[_0x57ec('0xe')](_0x57ec('0x20'),_0x2cf5af);logger[_0x57ec('0x10')](_0x57ec('0x20'),_0x2cf5af,JSON['stringify'](_0x48a8a0));_0x3d5bd7(_0x48a8a0);})[_0x57ec('0x22')](function(_0x31799c){logger[_0x57ec('0x12')](_0x57ec('0x20'),_0x31799c[_0x57ec('0x15')],_0x2cf5af);_0xde6e74(_0x567475[_0x57ec('0x12')](0x1f4,_0x31799c['message']));});});});};exports[_0x57ec('0x48')]=function(_0x198c51){var _0x54fcfa=this;return new Promise(function(_0x5ba1d6,_0x2a8ba7){return db[_0x57ec('0x2c')][_0x57ec('0x49')]({'raw':!![],'where':{'phone':_0x198c51['options'][_0x57ec('0x1b')][_0x57ec('0x4a')]},'attributes':['id','dialTimezone'],'order':[['id',_0x57ec('0x4b')]]})[_0x57ec('0xd')](function(_0x20740b){logger[_0x57ec('0xe')](_0x57ec('0x4c'),_0x198c51);logger[_0x57ec('0x10')](_0x57ec('0x4c'),_0x198c51,JSON['stringify'](_0x20740b));_0x5ba1d6(_0x20740b);})[_0x57ec('0x22')](function(_0x539462){logger['error'](_0x57ec('0x4c'),_0x539462['message'],_0x198c51);_0x2a8ba7(_0x54fcfa[_0x57ec('0x12')](0x1f4,_0x539462[_0x57ec('0x15')]));});});};exports[_0x57ec('0x4d')]=function(_0x247944){var _0x4c43f0=this;return new Promise(function(_0x2a7150,_0x5a000e){return db[_0x57ec('0x2e')][_0x57ec('0x2f')](function(_0x3ea483){return db['CmHopper'][_0x57ec('0x35')]({'active':![]},{'where':{},'transaction':_0x3ea483})['then'](function(_0x41b082){logger['info'](_0x57ec('0x4d'),_0x247944);logger['debug'](_0x57ec('0x4d'),_0x247944,JSON[_0x57ec('0x21')](_0x41b082));_0x2a7150(_0x41b082);})[_0x57ec('0x22')](function(_0x1c92bc){logger[_0x57ec('0x12')](_0x57ec('0x4d'),_0x1c92bc[_0x57ec('0x15')],_0x247944);_0x5a000e(_0x4c43f0[_0x57ec('0x12')](0x1f4,_0x1c92bc['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x9f6d0d){var _0x2909b9=this;var _0x1566b0=_0x9f6d0d['body'][_0x57ec('0x1b')][_0x57ec('0x4e')];var _0x4a7cef=_0x9f6d0d['body'][_0x57ec('0x1b')][_0x57ec('0x4f')];return new Promise(function(_0x1161db,_0x792e67){return db[_0x57ec('0x17')]['findAll']({'where':{'voiceQueueId':_0x1566b0,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x57ec('0x2e')][_0x57ec('0x3e')]('NOW()\x20+\x20INTERVAL\x20'+_0x4a7cef+_0x57ec('0x50'))}},'include':[{'model':db[_0x57ec('0x2c')],'as':'Contact'},{'model':db[_0x57ec('0x51')],'as':'Agent','attributes':['id',_0x57ec('0x33'),_0x57ec('0x52')]},{'model':db[_0x57ec('0x53')],'as':_0x57ec('0x54')}]})[_0x57ec('0xd')](function(_0x154fcb){return db[_0x57ec('0x2e')][_0x57ec('0x2f')](function(_0x531cfb){return db[_0x57ec('0x17')]['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x1566b0,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x57ec('0x2e')][_0x57ec('0x3e')](_0x57ec('0x55')+_0x4a7cef+_0x57ec('0x50'))}},'transaction':_0x531cfb})[_0x57ec('0xd')](function(_0x3ab6d2){_0x1161db(_0x154fcb);})[_0x57ec('0x22')](function(_0x2551a1){logger[_0x57ec('0x12')](_0x57ec('0x56'),_0x2551a1['message'],_0x9f6d0d);_0x792e67(validateExpressRequest);});});})['catch'](function(_0x48f4f2){logger['error'](_0x57ec('0x56'),_0x48f4f2['message'],_0x9f6d0d);_0x792e67(_0x2909b9[_0x57ec('0x12')](0x1f4,_0x48f4f2[_0x57ec('0x15')]));});});};
\ No newline at end of file
+var _0xd045=['request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','CmHopper','options','include','map','attributes','model','ShowCmHopper','find','raw','CreateCmHopper','body','UpdateCmHopper','update','where','limit','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','LOCK','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','dataValues','ContactId','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','UPDATE','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','voiceQueueId','interval','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','then','info','CmHopper,\x20%s,\x20%s'];(function(_0x507c6e,_0x5b7703){var _0x236242=function(_0x39a756){while(--_0x39a756){_0x507c6e['push'](_0x507c6e['shift']());}};_0x236242(++_0x5b7703);}(_0xd045,0x1a4));var _0x5d04=function(_0x32a4a3,_0x3ba3cd){_0x32a4a3=_0x32a4a3-0x0;var _0x1b69fe=_0xd045[_0x32a4a3];return _0x1b69fe;};'use strict';var _=require(_0x5d04('0x0'));var util=require(_0x5d04('0x1'));var moment=require('moment');var BPromise=require(_0x5d04('0x2'));var rs=require(_0x5d04('0x3'));var fs=require('fs');var Redis=require(_0x5d04('0x4'));var db=require(_0x5d04('0x5'))['db'];var utils=require(_0x5d04('0x6'));var logger=require('../../config/logger')(_0x5d04('0x7'));var config=require(_0x5d04('0x8'));var jayson=require(_0x5d04('0x9'));const {validateExpressRequest}=require(_0x5d04('0xa'));var client=jayson[_0x5d04('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54607a,_0x41b44b,_0x25487a){return new BPromise(function(_0x57a11d,_0x4600b1){return client['request'](_0x54607a,_0x25487a)[_0x5d04('0xc')](function(_0x3b3ffd){logger[_0x5d04('0xd')](_0x5d04('0xe'),_0x41b44b,_0x5d04('0xf'));logger[_0x5d04('0x10')](_0x5d04('0x11'),_0x41b44b,_0x5d04('0xf'),JSON[_0x5d04('0x12')](_0x3b3ffd));if(_0x3b3ffd[_0x5d04('0x13')]){if(_0x3b3ffd[_0x5d04('0x13')][_0x5d04('0x14')]===0x1f4){logger['error'](_0x5d04('0xe'),_0x41b44b,_0x3b3ffd['error'][_0x5d04('0x15')]);return _0x4600b1(_0x3b3ffd['error'][_0x5d04('0x15')]);}logger[_0x5d04('0x13')](_0x5d04('0xe'),_0x41b44b,_0x3b3ffd[_0x5d04('0x13')][_0x5d04('0x15')]);return _0x57a11d(_0x3b3ffd[_0x5d04('0x13')][_0x5d04('0x15')]);}else{logger[_0x5d04('0xd')]('CmHopper,\x20%s,\x20%s',_0x41b44b,_0x5d04('0xf'));_0x57a11d(_0x3b3ffd['result']['message']);}})[_0x5d04('0x16')](function(_0x377a9a){logger[_0x5d04('0x13')]('CmHopper,\x20%s,\x20%s',_0x41b44b,_0x377a9a);_0x4600b1(_0x377a9a);});});}exports[_0x5d04('0x17')]=function(_0x15c74f){var _0x44c2a3=this;return new Promise(function(_0x3eb13f,_0x1a5e57){return db[_0x5d04('0x18')]['findAll']({'raw':_0x15c74f[_0x5d04('0x19')]?_0x15c74f[_0x5d04('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x15c74f[_0x5d04('0x19')]?_0x15c74f[_0x5d04('0x19')]['where']||null:null,'attributes':_0x15c74f['options']?_0x15c74f[_0x5d04('0x19')]['attributes']||null:null,'limit':_0x15c74f[_0x5d04('0x19')]?_0x15c74f[_0x5d04('0x19')]['limit']||null:null,'include':_0x15c74f[_0x5d04('0x19')]?_0x15c74f[_0x5d04('0x19')][_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0x15c74f[_0x5d04('0x19')][_0x5d04('0x1a')],function(_0xeaa212){return{'model':db[_0xeaa212['model']],'as':_0xeaa212['as'],'attributes':_0xeaa212[_0x5d04('0x1c')],'include':_0xeaa212[_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0xeaa212[_0x5d04('0x1a')],function(_0xbb91c5){return{'model':db[_0xbb91c5[_0x5d04('0x1d')]],'as':_0xbb91c5['as'],'attributes':_0xbb91c5[_0x5d04('0x1c')],'include':_0xbb91c5[_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0xbb91c5[_0x5d04('0x1a')],function(_0x893696){return{'model':db[_0x893696[_0x5d04('0x1d')]],'as':_0x893696['as'],'attributes':_0x893696[_0x5d04('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5d04('0xc')](function(_0x26ec40){logger[_0x5d04('0xd')](_0x5d04('0x17'),_0x15c74f);logger[_0x5d04('0x10')](_0x5d04('0x17'),_0x15c74f,JSON['stringify'](_0x26ec40));_0x3eb13f(_0x26ec40);})[_0x5d04('0x16')](function(_0x2245f1){logger[_0x5d04('0x13')](_0x5d04('0x17'),_0x2245f1['message'],_0x15c74f);_0x1a5e57(_0x44c2a3[_0x5d04('0x13')](0x1f4,_0x2245f1['message']));});});};exports[_0x5d04('0x1e')]=function(_0x36af9c){var _0x4e461f=this;return new Promise(function(_0x4490c4,_0x1073d6){return db['CmHopper'][_0x5d04('0x1f')]({'raw':_0x36af9c['options']?_0x36af9c[_0x5d04('0x19')][_0x5d04('0x20')]===undefined?!![]:![]:!![],'where':_0x36af9c[_0x5d04('0x19')]?_0x36af9c[_0x5d04('0x19')]['where']||null:null,'attributes':_0x36af9c[_0x5d04('0x19')]?_0x36af9c[_0x5d04('0x19')]['attributes']||null:null,'include':_0x36af9c[_0x5d04('0x19')]?_0x36af9c[_0x5d04('0x19')][_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0x36af9c[_0x5d04('0x19')]['include'],function(_0x5b48de){return{'model':db[_0x5b48de[_0x5d04('0x1d')]],'as':_0x5b48de['as'],'attributes':_0x5b48de[_0x5d04('0x1c')],'include':_0x5b48de[_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0x5b48de[_0x5d04('0x1a')],function(_0xd81761){return{'model':db[_0xd81761['model']],'as':_0xd81761['as'],'attributes':_0xd81761[_0x5d04('0x1c')],'include':_0xd81761[_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0xd81761[_0x5d04('0x1a')],function(_0x307d7a){return{'model':db[_0x307d7a[_0x5d04('0x1d')]],'as':_0x307d7a['as'],'attributes':_0x307d7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d04('0xc')](function(_0x26e282){logger[_0x5d04('0xd')](_0x5d04('0x1e'),_0x36af9c);logger[_0x5d04('0x10')]('ShowCmHopper',_0x36af9c,JSON[_0x5d04('0x12')](_0x26e282));_0x4490c4(_0x26e282);})[_0x5d04('0x16')](function(_0x24e7df){logger[_0x5d04('0x13')](_0x5d04('0x1e'),_0x24e7df[_0x5d04('0x15')],_0x36af9c);_0x1073d6(_0x4e461f[_0x5d04('0x13')](0x1f4,_0x24e7df['message']));});});};exports[_0x5d04('0x21')]=function(_0x45d30c){var _0x392363=this;return new Promise(function(_0x5de610,_0x2a3ea5){return db[_0x5d04('0x18')]['create'](_0x45d30c[_0x5d04('0x22')],{'raw':_0x45d30c['options']?_0x45d30c['options'][_0x5d04('0x20')]===undefined?!![]:![]:!![]})[_0x5d04('0xc')](function(_0x1bd9f4){logger[_0x5d04('0xd')](_0x5d04('0x21'),_0x45d30c);logger[_0x5d04('0x10')](_0x5d04('0x21'),_0x45d30c,JSON['stringify'](_0x1bd9f4));_0x5de610(_0x1bd9f4);})[_0x5d04('0x16')](function(_0x55363d){logger['error'](_0x5d04('0x21'),_0x55363d[_0x5d04('0x15')],_0x45d30c);_0x2a3ea5(_0x392363[_0x5d04('0x13')](0x1f4,_0x55363d[_0x5d04('0x15')]));});});};exports[_0x5d04('0x23')]=function(_0x2ac779){var _0x264289=this;return new Promise(function(_0x2d7e74,_0xf7f6a9){return db['CmHopper'][_0x5d04('0x24')](_0x2ac779[_0x5d04('0x22')],{'raw':_0x2ac779['options']?_0x2ac779[_0x5d04('0x19')][_0x5d04('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ac779[_0x5d04('0x19')]?_0x2ac779[_0x5d04('0x19')][_0x5d04('0x25')]||null:null,'attributes':_0x2ac779[_0x5d04('0x19')]?_0x2ac779[_0x5d04('0x19')][_0x5d04('0x1c')]||null:null,'limit':_0x2ac779[_0x5d04('0x19')]?_0x2ac779[_0x5d04('0x19')][_0x5d04('0x26')]||null:null})['then'](function(_0x50dea6){logger[_0x5d04('0xd')](_0x5d04('0x23'),_0x2ac779);logger[_0x5d04('0xd')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x2ac779[_0x5d04('0x19')]['where']),_0x2ac779[_0x5d04('0x22')][_0x5d04('0x27')]);logger[_0x5d04('0x10')](_0x5d04('0x23'),_0x2ac779,JSON['stringify'](_0x50dea6));_0x2d7e74(_0x50dea6);})[_0x5d04('0x16')](function(_0x1bfcfe){logger['error'](_0x5d04('0x23'),_0x1bfcfe[_0x5d04('0x15')],_0x2ac779);_0xf7f6a9(_0x264289[_0x5d04('0x13')](0x1f4,_0x1bfcfe[_0x5d04('0x15')]));});});};exports[_0x5d04('0x28')]=function(_0x3e1e84){var _0x16dc2d=this;return new Promise(function(_0x266637,_0x30e7c8){return db[_0x5d04('0x18')][_0x5d04('0x29')]({'where':_0x3e1e84[_0x5d04('0x19')]?_0x3e1e84[_0x5d04('0x19')]['where']||null:null})[_0x5d04('0xc')](function(_0x2d3330){logger[_0x5d04('0xd')](_0x5d04('0x28'),_0x3e1e84);logger['debug'](_0x5d04('0x28'),_0x3e1e84,JSON[_0x5d04('0x12')](_0x2d3330));_0x266637(_0x2d3330);})[_0x5d04('0x16')](function(_0x381bcc){logger['error'](_0x5d04('0x28'),_0x381bcc['message'],_0x3e1e84);_0x30e7c8(_0x16dc2d[_0x5d04('0x13')](0x1f4,_0x381bcc[_0x5d04('0x15')]));});});};exports[_0x5d04('0x2a')]=function(_0x56008b){var _0x42340e=this;return new Promise(function(_0x4d8e65,_0x3c69e4){return db[_0x5d04('0x2b')][_0x5d04('0x2c')]()[_0x5d04('0xc')](function(_0x23a934){return db[_0x5d04('0x2d')][_0x5d04('0x2e')](function(_0x1df255){return db[_0x5d04('0x18')][_0x5d04('0x2f')]({'where':_0x56008b[_0x5d04('0x19')]?_0x56008b[_0x5d04('0x19')][_0x5d04('0x25')]||null:null,'attributes':_0x56008b[_0x5d04('0x19')]?_0x56008b[_0x5d04('0x19')]['attributes']||null:null,'limit':_0x56008b[_0x5d04('0x19')]?_0x56008b[_0x5d04('0x19')][_0x5d04('0x26')]||null:null,'order':_0x56008b[_0x5d04('0x19')]?_0x56008b['options']['order']||null:null,'transaction':_0x1df255,'lock':_0x1df255[_0x5d04('0x30')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x5d04('0x31'),'attributes':_[_0x5d04('0x32')](_0x23a934)},{'model':db[_0x5d04('0x33')],'as':_0x5d04('0x34'),'attributes':['id',_0x5d04('0x35'),_0x5d04('0x36')]}]})[_0x5d04('0xc')](function(_0x5efec3){var _0x18aacd=[];var _0x58fff5=[];for(var _0x65d05f=0x0;_0x65d05f<_0x5efec3[_0x5d04('0x37')];_0x65d05f+=0x1){var _0x36dce5=_0x5efec3[_0x65d05f][_0x5d04('0x38')];if(_0x36dce5===null){_0x18aacd[_0x5d04('0x39')](_0x5efec3[_0x65d05f][_0x5d04('0x24')](_0x56008b[_0x5d04('0x22')],{'transaction':_0x1df255}));}else if(!_0x58fff5[_0x5d04('0x3a')](_0x36dce5)){_0x58fff5['push'](_0x36dce5);_0x18aacd['push'](_0x5efec3[_0x65d05f][_0x5d04('0x24')](_0x56008b['body'],{'transaction':_0x1df255}));}}return BPromise[_0x5d04('0x3b')](_0x18aacd);});})[_0x5d04('0xc')](function(_0x891ee5){logger[_0x5d04('0xd')](_0x5d04('0x2a'),_0x56008b);if(_0x891ee5[_0x5d04('0x37')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x891ee5[0x0][_0x5d04('0x3c')]['id'],_0x891ee5[0x0][_0x5d04('0x3c')][_0x5d04('0x3d')],_0x891ee5[0x0][_0x5d04('0x3c')][_0x5d04('0x27')]);}logger[_0x5d04('0x10')](_0x5d04('0x2a'),_0x56008b,JSON[_0x5d04('0x12')](_0x891ee5));_0x4d8e65(_0x891ee5);})[_0x5d04('0x16')](function(_0x2fb7c4){logger[_0x5d04('0x13')](_0x5d04('0x2a'),_0x2fb7c4['message'],_0x56008b);_0x3c69e4(_0x42340e[_0x5d04('0x13')](0x1f4,_0x2fb7c4[_0x5d04('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x1fa4b7){var _0x32c877=this;return new Promise(function(_0x184d19,_0x5c6b71){return db[_0x5d04('0x2d')][_0x5d04('0x2e')](function(_0x3f86d2){return db[_0x5d04('0x3e')][_0x5d04('0x3f')](_0x1fa4b7[_0x5d04('0x22')],{'raw':_0x1fa4b7['options']?_0x1fa4b7[_0x5d04('0x19')][_0x5d04('0x20')]===undefined?!![]:![]:!![],'transaction':_0x3f86d2})[_0x5d04('0xc')](function(){logger[_0x5d04('0xd')](_0x5d04('0x40'),JSON[_0x5d04('0x12')](_0x1fa4b7[_0x5d04('0x19')][_0x5d04('0x25')]),_0x1fa4b7[_0x5d04('0x19')][_0x5d04('0x25')][_0x5d04('0x27')]);return db['CmHopper'][_0x5d04('0x29')]({'where':_0x1fa4b7[_0x5d04('0x19')]?_0x1fa4b7[_0x5d04('0x19')][_0x5d04('0x25')]||null:null,'transaction':_0x3f86d2});});})[_0x5d04('0xc')](function(_0x3668c2){logger['info']('MoveContactManagedDialer',_0x1fa4b7);logger[_0x5d04('0x10')](_0x5d04('0x41'),_0x1fa4b7,JSON[_0x5d04('0x12')](_0x3668c2));_0x184d19(_0x3668c2);})[_0x5d04('0x16')](function(_0x176573){logger[_0x5d04('0x13')](_0x5d04('0x41'),_0x176573[_0x5d04('0x15')],_0x1fa4b7);_0x5c6b71(_0x32c877[_0x5d04('0x13')](0x1f4,_0x176573['message']));});});};exports[_0x5d04('0x42')]=function(_0x4903ea){var _0x3d2a76=this;return new Promise(function(_0x29c816,_0xe3cf97){return db[_0x5d04('0x18')][_0x5d04('0x2f')]({'raw':_0x4903ea[_0x5d04('0x19')]?_0x4903ea['options'][_0x5d04('0x20')]===undefined?!![]:![]:!![],'where':_0x4903ea[_0x5d04('0x19')]?_0x4903ea[_0x5d04('0x19')][_0x5d04('0x25')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x5d04('0x2d')]['fn']('IF',db[_0x5d04('0x2d')]['literal'](_0x5d04('0x43')+util['format'](_0x5d04('0x44'),moment()['format'](_0x5d04('0x45')))+_0x5d04('0x46')))),'contactsRescheduled']]})[_0x5d04('0xc')](function(_0x166016){logger[_0x5d04('0xd')](_0x5d04('0x42'),_0x4903ea);logger['debug'](_0x5d04('0x42'),_0x4903ea,JSON[_0x5d04('0x12')](_0x166016));_0x29c816(_0x166016);})[_0x5d04('0x16')](function(_0x13c87f){logger[_0x5d04('0x13')](_0x5d04('0x42'),_0x13c87f[_0x5d04('0x15')],_0x4903ea);_0xe3cf97(_0x3d2a76[_0x5d04('0x13')](0x1f4,_0x13c87f[_0x5d04('0x15')]));});});};exports[_0x5d04('0x47')]=function(_0x53cb9b){var _0x399723=this;return new Promise(function(_0x3b0381,_0x533b33){return db[_0x5d04('0x2b')][_0x5d04('0x2c')]()[_0x5d04('0xc')](function(_0x53e167){return db[_0x5d04('0x2d')][_0x5d04('0x2e')](function(_0x5e9c49){return db[_0x5d04('0x18')][_0x5d04('0x2f')]({'where':_0x53cb9b[_0x5d04('0x19')]?_0x53cb9b[_0x5d04('0x19')][_0x5d04('0x25')]||null:null,'attributes':_0x53cb9b[_0x5d04('0x19')]?_0x53cb9b[_0x5d04('0x19')]['attributes']||null:null,'limit':0x1,'order':_0x53cb9b['options']?_0x53cb9b['options']['order']||null:null,'group':db['CmHopper'][_0x5d04('0x38')],'transaction':_0x5e9c49,'lock':_0x5e9c49['LOCK'][_0x5d04('0x48')],'include':_0x53cb9b['options']?_0x53cb9b[_0x5d04('0x19')][_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0x53cb9b[_0x5d04('0x19')][_0x5d04('0x1a')],function(_0x4a3048){return{'model':db[_0x4a3048[_0x5d04('0x1d')]],'as':_0x4a3048['as'],'attributes':_0x4a3048[_0x5d04('0x1c')],'include':_0x4a3048[_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0x4a3048[_0x5d04('0x1a')],function(_0x52fabd){return{'model':db[_0x52fabd[_0x5d04('0x1d')]],'as':_0x52fabd['as'],'attributes':_0x52fabd['attributes'],'include':_0x52fabd[_0x5d04('0x1a')]?_[_0x5d04('0x1b')](_0x52fabd[_0x5d04('0x1a')],function(_0x14a5b){return{'model':db[_0x14a5b[_0x5d04('0x1d')]],'as':_0x14a5b['as'],'attributes':_0x14a5b[_0x5d04('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5d04('0xc')](function(_0x19c798){var _0x4663c7=[];for(var _0x141363=0x0;_0x141363<_0x19c798[_0x5d04('0x37')];_0x141363+=0x1){_0x4663c7[_0x5d04('0x39')](_0x19c798[_0x141363]['update'](_0x53cb9b[_0x5d04('0x22')],{'transaction':_0x5e9c49}));}return BPromise[_0x5d04('0x3b')](_0x4663c7);});})[_0x5d04('0xc')](function(_0x3d19ab){logger[_0x5d04('0xd')]('GetContactRecallMe',_0x53cb9b);logger[_0x5d04('0x10')](_0x5d04('0x47'),_0x53cb9b,JSON[_0x5d04('0x12')](_0x3d19ab));_0x3b0381(_0x3d19ab);})[_0x5d04('0x16')](function(_0x7e4538){logger['error']('GetContactRecallMe',_0x7e4538[_0x5d04('0x15')],_0x53cb9b);_0x533b33(_0x399723[_0x5d04('0x13')](0x1f4,_0x7e4538[_0x5d04('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x52c61a){var _0x5c0541=this;return new Promise(function(_0x5dd15e,_0x47d3d5){db[_0x5d04('0x2b')][_0x5d04('0x2c')]()[_0x5d04('0xc')](function(_0x305d24){return db[_0x5d04('0x18')][_0x5d04('0x2f')]({'raw':_0x52c61a[_0x5d04('0x19')]?_0x52c61a[_0x5d04('0x19')][_0x5d04('0x20')]===undefined?!![]:![]:!![],'where':_0x52c61a[_0x5d04('0x19')]?_0x52c61a[_0x5d04('0x19')][_0x5d04('0x25')]||null:null,'attributes':_0x52c61a[_0x5d04('0x19')]?_0x52c61a[_0x5d04('0x19')][_0x5d04('0x1c')]||null:null,'limit':_0x52c61a[_0x5d04('0x19')]?_0x52c61a[_0x5d04('0x19')][_0x5d04('0x26')]||null:null,'include':_0x52c61a[_0x5d04('0x19')]?_0x52c61a['options']['include']?_[_0x5d04('0x1b')](_0x52c61a['options'][_0x5d04('0x1a')],function(_0x5d3a28){return{'model':db[_0x5d3a28[_0x5d04('0x1d')]],'as':_0x5d3a28['as'],'attributes':_0x5d3a28['as']===_0x5d04('0x31')?_[_0x5d04('0x32')](_0x305d24):_0x5d3a28[_0x5d04('0x1c')],'include':_0x5d3a28[_0x5d04('0x1a')]?_['map'](_0x5d3a28[_0x5d04('0x1a')],function(_0x572b79){return{'model':db[_0x572b79[_0x5d04('0x1d')]],'as':_0x572b79['as'],'attributes':_0x572b79[_0x5d04('0x1c')],'include':_0x572b79['include']?_[_0x5d04('0x1b')](_0x572b79['include'],function(_0x1d288c){return{'model':db[_0x1d288c[_0x5d04('0x1d')]],'as':_0x1d288c['as'],'attributes':_0x1d288c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d04('0xc')](function(_0x5a9487){logger[_0x5d04('0xd')](_0x5d04('0x17'),_0x52c61a);logger[_0x5d04('0x10')](_0x5d04('0x17'),_0x52c61a,JSON[_0x5d04('0x12')](_0x5a9487));_0x5dd15e(_0x5a9487);})[_0x5d04('0x16')](function(_0x106715){logger[_0x5d04('0x13')](_0x5d04('0x17'),_0x106715[_0x5d04('0x15')],_0x52c61a);_0x47d3d5(_0x5c0541['error'](0x1f4,_0x106715['message']));});});});};exports[_0x5d04('0x49')]=function(_0x24a04f){var _0x1744ae=this;return new Promise(function(_0x256e10,_0x3fa321){return db[_0x5d04('0x2b')][_0x5d04('0x4a')]({'raw':!![],'where':{'phone':_0x24a04f[_0x5d04('0x19')][_0x5d04('0x25')][_0x5d04('0x4b')]},'attributes':['id',_0x5d04('0x4c')],'order':[['id','DESC']]})['then'](function(_0x310c6f){logger[_0x5d04('0xd')](_0x5d04('0x4d'),_0x24a04f);logger['debug'](_0x5d04('0x4d'),_0x24a04f,JSON[_0x5d04('0x12')](_0x310c6f));_0x256e10(_0x310c6f);})[_0x5d04('0x16')](function(_0xcf0672){logger[_0x5d04('0x13')]('getContactByPhone',_0xcf0672[_0x5d04('0x15')],_0x24a04f);_0x3fa321(_0x1744ae['error'](0x1f4,_0xcf0672[_0x5d04('0x15')]));});});};exports[_0x5d04('0x4e')]=function(_0x3c51ba){var _0x140e4a=this;return new Promise(function(_0x24e3a1,_0x418c04){return db[_0x5d04('0x2d')][_0x5d04('0x2e')](function(_0x4afc00){return db[_0x5d04('0x18')]['update']({'active':![]},{'where':{},'transaction':_0x4afc00})[_0x5d04('0xc')](function(_0x127714){logger[_0x5d04('0xd')]('ResetActiveCalls',_0x3c51ba);logger[_0x5d04('0x10')](_0x5d04('0x4e'),_0x3c51ba,JSON[_0x5d04('0x12')](_0x127714));_0x24e3a1(_0x127714);})[_0x5d04('0x16')](function(_0x34ef07){logger[_0x5d04('0x13')](_0x5d04('0x4e'),_0x34ef07[_0x5d04('0x15')],_0x3c51ba);_0x418c04(_0x140e4a[_0x5d04('0x13')](0x1f4,_0x34ef07['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x129497){var _0x409114=this;var _0x119d23=_0x129497[_0x5d04('0x22')]['where'][_0x5d04('0x4f')];var _0x16cc21=_0x129497['body']['where'][_0x5d04('0x50')];return new Promise(function(_0x164df9,_0x5842c7){return db['CmHopper'][_0x5d04('0x2f')]({'where':{'voiceQueueId':_0x119d23,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x5d04('0x2d')][_0x5d04('0x51')](_0x5d04('0x52')+_0x16cc21+_0x5d04('0x53'))}},'include':[{'model':db[_0x5d04('0x2b')],'as':_0x5d04('0x31')},{'model':db[_0x5d04('0x33')],'as':_0x5d04('0x34'),'attributes':['id',_0x5d04('0x35'),'voicePause']},{'model':db[_0x5d04('0x54')],'as':_0x5d04('0x55')}]})[_0x5d04('0xc')](function(_0x3773b9){return db[_0x5d04('0x2d')][_0x5d04('0x2e')](function(_0x121873){return db[_0x5d04('0x18')][_0x5d04('0x24')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x119d23,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x5d04('0x2d')][_0x5d04('0x51')](_0x5d04('0x52')+_0x16cc21+'\x20MINUTE')}},'transaction':_0x121873})['then'](function(_0xaf1bc3){_0x164df9(_0x3773b9);})['catch'](function(_0x41d3e1){logger[_0x5d04('0x13')](_0x5d04('0x56'),_0x41d3e1[_0x5d04('0x15')],_0x129497);_0x5842c7(validateExpressRequest);});});})[_0x5d04('0x16')](function(_0x2b8a6d){logger[_0x5d04('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x2b8a6d['message'],_0x129497);_0x5842c7(_0x409114[_0x5d04('0x13')](0x1f4,_0x2b8a6d[_0x5d04('0x15')]));});});};
\ No newline at end of file
index 30f1512..f86c6c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x266b=['getOpenContacts','/timezones','getTimezones','show','post','create','/preview','getPreview','/timezone','getTimezone','getPreviewRecall','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts'];(function(_0x3327fd,_0x109354){var _0x1c3210=function(_0x2ea7eb){while(--_0x2ea7eb){_0x3327fd['push'](_0x3327fd['shift']());}};_0x1c3210(++_0x109354);}(_0x266b,0xd0));var _0xb266=function(_0x416f3f,_0x2451b7){_0x416f3f=_0x416f3f-0x0;var _0x29ca77=_0x266b[_0x416f3f];return _0x29ca77;};'use strict';var multer=require(_0xb266('0x0'));var util=require(_0xb266('0x1'));var path=require(_0xb266('0x2'));var timeout=require(_0xb266('0x3'));var express=require(_0xb266('0x4'));var router=express[_0xb266('0x5')]();var fs_extra=require(_0xb266('0x6'));var auth=require(_0xb266('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb266('0x8'));var controller=require(_0xb266('0x9'));router['get']('/',auth[_0xb266('0xa')](),controller[_0xb266('0xb')]);router[_0xb266('0xc')](_0xb266('0xd'),auth['isAuthenticated'](),controller[_0xb266('0xe')]);router[_0xb266('0xc')](_0xb266('0xf'),auth[_0xb266('0xa')](),controller[_0xb266('0x10')]);router[_0xb266('0xc')](_0xb266('0x11'),auth['isAuthenticated'](),controller[_0xb266('0x12')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb266('0x13')]);router[_0xb266('0x14')]('/',auth[_0xb266('0xa')](),controller[_0xb266('0x15')]);router[_0xb266('0x14')](_0xb266('0x16'),auth[_0xb266('0xa')](),controller[_0xb266('0x17')]);router[_0xb266('0x14')](_0xb266('0x18'),auth[_0xb266('0xa')](),controller[_0xb266('0x19')]);router[_0xb266('0x14')]('/previewrecall',auth[_0xb266('0xa')](),controller[_0xb266('0x1a')]);router[_0xb266('0x1b')]('/:id',auth[_0xb266('0xa')](),controller[_0xb266('0x1c')]);router[_0xb266('0x1d')](_0xb266('0x1e'),auth[_0xb266('0xa')](),controller['destroy']);module[_0xb266('0x1f')]=router;
\ No newline at end of file
+var _0x4704=['describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','post','create','getPreview','/timezone','getTimezone','/previewrecall','getPreviewRecall','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0x4704,0x8a));var _0x4470=function(_0x18a4f7,_0x3f915c){_0x18a4f7=_0x18a4f7-0x0;var _0x368cf3=_0x4704[_0x18a4f7];return _0x368cf3;};'use strict';var multer=require(_0x4470('0x0'));var util=require('util');var path=require(_0x4470('0x1'));var timeout=require(_0x4470('0x2'));var express=require('express');var router=express[_0x4470('0x3')]();var fs_extra=require(_0x4470('0x4'));var auth=require(_0x4470('0x5'));var interaction=require(_0x4470('0x6'));var config=require(_0x4470('0x7'));var controller=require(_0x4470('0x8'));router[_0x4470('0x9')]('/',auth[_0x4470('0xa')](),controller[_0x4470('0xb')]);router[_0x4470('0x9')]('/describe',auth[_0x4470('0xa')](),controller[_0x4470('0xc')]);router[_0x4470('0x9')](_0x4470('0xd'),auth[_0x4470('0xa')](),controller[_0x4470('0xe')]);router[_0x4470('0x9')](_0x4470('0xf'),auth['isAuthenticated'](),controller[_0x4470('0x10')]);router[_0x4470('0x9')](_0x4470('0x11'),auth[_0x4470('0xa')](),controller['show']);router[_0x4470('0x12')]('/',auth[_0x4470('0xa')](),controller[_0x4470('0x13')]);router[_0x4470('0x12')]('/preview',auth[_0x4470('0xa')](),controller[_0x4470('0x14')]);router['post'](_0x4470('0x15'),auth[_0x4470('0xa')](),controller[_0x4470('0x16')]);router['post'](_0x4470('0x17'),auth[_0x4470('0xa')](),controller[_0x4470('0x18')]);router[_0x4470('0x19')](_0x4470('0x11'),auth[_0x4470('0xa')](),controller[_0x4470('0x1a')]);router[_0x4470('0x1b')](_0x4470('0x11'),auth['isAuthenticated'](),controller[_0x4470('0x1c')]);module[_0x4470('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
deleted file mode 100644 (file)
index b732618..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0x160c=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','INTEGER'];(function(_0x12cccd,_0x31017e){var _0x530d3b=function(_0x30a21f){while(--_0x30a21f){_0x12cccd['push'](_0x12cccd['shift']());}};_0x530d3b(++_0x31017e);}(_0x160c,0x12f));var _0xc160=function(_0x28e896,_0x1246d0){_0x28e896=_0x28e896-0x0;var _0x3308d3=_0x160c[_0x28e896];return _0x3308d3;};'use strict';var moment=require(_0xc160('0x0'));var Sequelize=require('sequelize');module[_0xc160('0x1')]={'CmHopperId':{'type':Sequelize[_0xc160('0x2')]},'phone':{'type':Sequelize[_0xc160('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc160('0x4')](_0xc160('0x5'))},'countbusyretry':{'type':Sequelize[_0xc160('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc160('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc160('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc160('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc160('0x2')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
deleted file mode 100644 (file)
index 41bc967..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xad25=['jsforce','desk.js','to-csv','querystring','../../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','apply','save','update','destroy','get','UserProfileResource','then','error','stack','name','index','CmHopperAdditionalPhone','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto'];(function(_0x179583,_0x5d41c6){var _0x3ddfc6=function(_0x3328c0){while(--_0x3328c0){_0x179583['push'](_0x179583['shift']());}};_0x3ddfc6(++_0x5d41c6);}(_0xad25,0x188));var _0x5ad2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xad25[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x5ad2('0x0'));var rimraf=require(_0x5ad2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ad2('0x2'));var rp=require(_0x5ad2('0x3'));var moment=require(_0x5ad2('0x4'));var BPromise=require(_0x5ad2('0x5'));var Mustache=require(_0x5ad2('0x6'));var util=require(_0x5ad2('0x7'));var path=require(_0x5ad2('0x8'));var sox=require(_0x5ad2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ad2('0xa'));var _=require('lodash');var squel=require(_0x5ad2('0xb'));var crypto=require(_0x5ad2('0xc'));var jsforce=require(_0x5ad2('0xd'));var deskjs=require(_0x5ad2('0xe'));var toCsv=require(_0x5ad2('0xf'));var querystring=require(_0x5ad2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ad2('0x11'));var as=require(_0x5ad2('0x12'));var hardwareService=require(_0x5ad2('0x13'));var logger=require('../../config/logger')(_0x5ad2('0x14'));var utils=require(_0x5ad2('0x15'));var config=require(_0x5ad2('0x16'));var licenseUtil=require(_0x5ad2('0x17'));var db=require(_0x5ad2('0x18'))['db'];function respondWithStatusCode(_0x317a22,_0x30f89e){_0x30f89e=_0x30f89e||0xcc;return function(_0x186f4e){if(_0x186f4e){return _0x317a22[_0x5ad2('0x19')](_0x30f89e);}return _0x317a22[_0x5ad2('0x1a')](_0x30f89e)[_0x5ad2('0x1b')]();};}function respondWithResult(_0x502d04,_0x23ed36){_0x23ed36=_0x23ed36||0xc8;return function(_0x6a18a7){if(_0x6a18a7){return _0x502d04[_0x5ad2('0x1a')](_0x23ed36)[_0x5ad2('0x1c')](_0x6a18a7);}};}function respondWithFilteredResult(_0x583f9f,_0x4ba392){return function(_0x5cd0ef){if(_0x5cd0ef){var _0x57ca19=typeof _0x4ba392[_0x5ad2('0x1d')]===_0x5ad2('0x1e')&&typeof _0x4ba392[_0x5ad2('0x1f')]==='undefined';var _0x8f7be2=_0x5cd0ef[_0x5ad2('0x20')];var _0x2a3c9e=_0x57ca19?0x0:_0x4ba392[_0x5ad2('0x1d')];var _0x20a2d6=_0x57ca19?_0x5cd0ef[_0x5ad2('0x20')]:_0x4ba392[_0x5ad2('0x1d')]+_0x4ba392[_0x5ad2('0x1f')];var _0x34a2bf;if(_0x20a2d6>=_0x8f7be2){_0x20a2d6=_0x8f7be2;_0x34a2bf=0xc8;}else{_0x34a2bf=0xce;}_0x583f9f['status'](_0x34a2bf);return _0x583f9f[_0x5ad2('0x21')]('Content-Range',_0x2a3c9e+'-'+_0x20a2d6+'/'+_0x8f7be2)[_0x5ad2('0x1c')](_0x5cd0ef);}return null;};}function patchUpdates(_0x475991){return function(_0x326eed){try{jsonpatch[_0x5ad2('0x22')](_0x326eed,_0x475991,!![]);}catch(_0x155836){return BPromise['reject'](_0x155836);}return _0x326eed[_0x5ad2('0x23')]();};}function saveUpdates(_0x149ca3,_0x448b6a){return function(_0x10790f){if(_0x10790f){return _0x10790f[_0x5ad2('0x24')](_0x149ca3)['then'](function(_0x4538ec){return _0x4538ec;});}return null;};}function removeEntity(_0x405d67,_0x1a851d){return function(_0x47c84a){if(_0x47c84a){return _0x47c84a[_0x5ad2('0x25')]()['then'](function(){var _0x1234f4=_0x47c84a[_0x5ad2('0x26')]({'plain':!![]});var _0x40b77b='CmHopperAdditionalPhones';return db[_0x5ad2('0x27')]['destroy']({'where':{'type':_0x40b77b,'resourceId':_0x1234f4['id']}})[_0x5ad2('0x28')](function(){return _0x47c84a;});})[_0x5ad2('0x28')](function(){_0x405d67[_0x5ad2('0x1a')](0xcc)[_0x5ad2('0x1b')]();});}};}function handleEntityNotFound(_0x4abf37,_0x33861a){return function(_0x255b19){if(!_0x255b19){_0x4abf37[_0x5ad2('0x19')](0x194);}return _0x255b19;};}function handleError(_0x1d70af,_0x4c4a67){_0x4c4a67=_0x4c4a67||0x1f4;return function(_0x4f31cf){logger[_0x5ad2('0x29')](_0x4f31cf[_0x5ad2('0x2a')]);if(_0x4f31cf[_0x5ad2('0x2b')]){delete _0x4f31cf['name'];}_0x1d70af['status'](_0x4c4a67)['send'](_0x4f31cf);};}exports[_0x5ad2('0x2c')]=function(_0x30d7a7,_0x3f0c22){var _0x1e6218={},_0x1307ea={},_0x526e46={'count':0x0,'rows':[]};var _0x4442a7=_['map'](db[_0x5ad2('0x2d')]['rawAttributes'],function(_0x4571cf){return{'name':_0x4571cf[_0x5ad2('0x2e')],'type':_0x4571cf[_0x5ad2('0x2f')]['key']};});_0x1307ea[_0x5ad2('0x30')]=_[_0x5ad2('0x31')](_0x4442a7,_0x5ad2('0x2b'));_0x1307ea['query']=_['keys'](_0x30d7a7[_0x5ad2('0x32')]);_0x1307ea['filters']=_[_0x5ad2('0x33')](_0x1307ea[_0x5ad2('0x30')],_0x1307ea['query']);_0x1e6218[_0x5ad2('0x34')]=_[_0x5ad2('0x33')](_0x1307ea[_0x5ad2('0x30')],qs['fields'](_0x30d7a7[_0x5ad2('0x32')][_0x5ad2('0x35')]));_0x1e6218['attributes']=_0x1e6218[_0x5ad2('0x34')][_0x5ad2('0x36')]?_0x1e6218[_0x5ad2('0x34')]:_0x1307ea[_0x5ad2('0x30')];if(!_0x30d7a7[_0x5ad2('0x32')]['hasOwnProperty'](_0x5ad2('0x37'))){_0x1e6218[_0x5ad2('0x1f')]=qs[_0x5ad2('0x1f')](_0x30d7a7[_0x5ad2('0x32')][_0x5ad2('0x1f')]);_0x1e6218[_0x5ad2('0x1d')]=qs[_0x5ad2('0x1d')](_0x30d7a7[_0x5ad2('0x32')][_0x5ad2('0x1d')]);}_0x1e6218['order']=qs['sort'](_0x30d7a7['query']['sort']);_0x1e6218[_0x5ad2('0x38')]=qs[_0x5ad2('0x39')](_[_0x5ad2('0x3a')](_0x30d7a7[_0x5ad2('0x32')],_0x1307ea[_0x5ad2('0x39')]),_0x4442a7);if(_0x30d7a7[_0x5ad2('0x32')][_0x5ad2('0x3b')]){_0x1e6218[_0x5ad2('0x38')]=_[_0x5ad2('0x3c')](_0x1e6218[_0x5ad2('0x38')],{'$or':_[_0x5ad2('0x31')](_0x4442a7,function(_0x57e0b5){if(_0x57e0b5['type']!==_0x5ad2('0x3d')){var _0x1f912a={};_0x1f912a[_0x57e0b5[_0x5ad2('0x2b')]]={'$like':'%'+_0x30d7a7['query']['filter']+'%'};return _0x1f912a;}})});}_0x1e6218=_[_0x5ad2('0x3c')]({},_0x1e6218,_0x30d7a7[_0x5ad2('0x3e')]);var _0x38ac8d={'where':_0x1e6218[_0x5ad2('0x38')]};return db[_0x5ad2('0x2d')][_0x5ad2('0x20')](_0x38ac8d)[_0x5ad2('0x28')](function(_0x26b902){_0x526e46[_0x5ad2('0x20')]=_0x26b902;if(_0x30d7a7[_0x5ad2('0x32')][_0x5ad2('0x3f')]){_0x1e6218[_0x5ad2('0x40')]=[{'all':!![]}];}return db[_0x5ad2('0x2d')][_0x5ad2('0x41')](_0x1e6218);})[_0x5ad2('0x28')](function(_0x6210af){_0x526e46[_0x5ad2('0x42')]=_0x6210af;return _0x526e46;})[_0x5ad2('0x28')](respondWithFilteredResult(_0x3f0c22,_0x1e6218))['catch'](handleError(_0x3f0c22,null));};exports[_0x5ad2('0x43')]=function(_0x4a628e,_0x52746a){var _0x5d1877={'raw':!![],'where':{'id':_0x4a628e[_0x5ad2('0x44')]['id']}},_0x5b48f0={};_0x5b48f0[_0x5ad2('0x30')]=_[_0x5ad2('0x45')](db['CmHopperAdditionalPhone'][_0x5ad2('0x46')]);_0x5b48f0['query']=_[_0x5ad2('0x45')](_0x4a628e[_0x5ad2('0x32')]);_0x5b48f0[_0x5ad2('0x39')]=_[_0x5ad2('0x33')](_0x5b48f0['model'],_0x5b48f0[_0x5ad2('0x32')]);_0x5d1877[_0x5ad2('0x34')]=_[_0x5ad2('0x33')](_0x5b48f0[_0x5ad2('0x30')],qs[_0x5ad2('0x35')](_0x4a628e['query']['fields']));_0x5d1877['attributes']=_0x5d1877[_0x5ad2('0x34')][_0x5ad2('0x36')]?_0x5d1877[_0x5ad2('0x34')]:_0x5b48f0[_0x5ad2('0x30')];if(_0x4a628e['query'][_0x5ad2('0x3f')]){_0x5d1877['include']=[{'all':!![]}];}_0x5d1877=_['merge']({},_0x5d1877,_0x4a628e[_0x5ad2('0x3e')]);return db['CmHopperAdditionalPhone'][_0x5ad2('0x47')](_0x5d1877)['then'](handleEntityNotFound(_0x52746a,null))[_0x5ad2('0x28')](respondWithResult(_0x52746a,null))['catch'](handleError(_0x52746a,null));};exports['create']=function(_0x430b0e,_0x48f86f){return db[_0x5ad2('0x2d')][_0x5ad2('0x48')](_0x430b0e['body'],{})[_0x5ad2('0x28')](function(_0x285d9b){var _0x33b613=_0x430b0e[_0x5ad2('0x49')][_0x5ad2('0x26')]({'plain':!![]});if(!_0x33b613)throw new Error(_0x5ad2('0x4a'));if(_0x33b613['role']===_0x5ad2('0x49')){var _0x1b1f5c=_0x285d9b[_0x5ad2('0x26')]({'plain':!![]});var _0x5ce816=_0x5ad2('0x4b');return db[_0x5ad2('0x4c')][_0x5ad2('0x47')]({'where':{'name':_0x5ce816,'userProfileId':_0x33b613['userProfileId']},'raw':!![]})['then'](function(_0x43d5e7){if(_0x43d5e7&&_0x43d5e7[_0x5ad2('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x1b1f5c[_0x5ad2('0x2b')],'resourceId':_0x1b1f5c['id'],'type':_0x43d5e7[_0x5ad2('0x2b')],'sectionId':_0x43d5e7['id']},{})['then'](function(){return _0x285d9b;});}else{return _0x285d9b;}})['catch'](function(_0x1d8654){logger[_0x5ad2('0x29')](_0x5ad2('0x4e'),_0x1d8654);throw _0x1d8654;});}return _0x285d9b;})['then'](respondWithResult(_0x48f86f,0xc9))[_0x5ad2('0x4f')](handleError(_0x48f86f,null));};exports[_0x5ad2('0x24')]=function(_0x863116,_0x3032ec){if(_0x863116[_0x5ad2('0x50')]['id']){delete _0x863116[_0x5ad2('0x50')]['id'];}return db[_0x5ad2('0x2d')]['find']({'where':{'id':_0x863116[_0x5ad2('0x44')]['id']}})[_0x5ad2('0x28')](handleEntityNotFound(_0x3032ec,null))[_0x5ad2('0x28')](saveUpdates(_0x863116[_0x5ad2('0x50')],null))[_0x5ad2('0x28')](respondWithResult(_0x3032ec,null))['catch'](handleError(_0x3032ec,null));};exports[_0x5ad2('0x25')]=function(_0x2d5606,_0x55c8ac){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x2d5606[_0x5ad2('0x44')]['id']}})['then'](handleEntityNotFound(_0x55c8ac,null))[_0x5ad2('0x28')](removeEntity(_0x55c8ac,null))[_0x5ad2('0x4f')](handleError(_0x55c8ac,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
deleted file mode 100644 (file)
index 1500763..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xa456=['rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xa456,0x162));var _0x6a45=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xa456[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x6a45('0x0'));var util=require('util');var logger=require(_0x6a45('0x1'))('api');var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rp=require(_0x6a45('0x4'));var fs=require('fs');var path=require(_0x6a45('0x5'));var rimraf=require(_0x6a45('0x6'));var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));module[_0x6a45('0x9')]=function(_0x5e5507,_0x39341e){return _0x5e5507[_0x6a45('0xa')](_0x6a45('0xb'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
deleted file mode 100644 (file)
index 67eed27..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xbdde=['CmHopperAdditionalPhone','OrderBy','then','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ASC','entity','dialGlobalMaxRetry','SwapAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbdde,0x180));var _0xebdd=function(_0x161f59,_0x42e9ff){_0x161f59=_0x161f59-0x0;var _0x3ffa0e=_0xbdde[_0x161f59];return _0x3ffa0e;};'use strict';var _=require(_0xebdd('0x0'));var util=require(_0xebdd('0x1'));var moment=require(_0xebdd('0x2'));var BPromise=require('bluebird');var rs=require(_0xebdd('0x3'));var fs=require('fs');var Redis=require(_0xebdd('0x4'));var db=require(_0xebdd('0x5'))['db'];var utils=require(_0xebdd('0x6'));var logger=require(_0xebdd('0x7'))('rpc');var config=require(_0xebdd('0x8'));var jayson=require(_0xebdd('0x9'));var client=jayson[_0xebdd('0xa')][_0xebdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x295271,_0x447d63,_0x51f079){return new BPromise(function(_0x428df4,_0x5efc29){return client['request'](_0x295271,_0x51f079)['then'](function(_0x4d5d97){logger[_0xebdd('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x447d63,_0xebdd('0xd'));logger[_0xebdd('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x447d63,'request\x20sent',JSON[_0xebdd('0xf')](_0x4d5d97));if(_0x4d5d97[_0xebdd('0x10')]){if(_0x4d5d97[_0xebdd('0x10')][_0xebdd('0x11')]===0x1f4){logger[_0xebdd('0x10')](_0xebdd('0x12'),_0x447d63,_0x4d5d97['error'][_0xebdd('0x13')]);return _0x5efc29(_0x4d5d97['error']['message']);}logger[_0xebdd('0x10')](_0xebdd('0x12'),_0x447d63,_0x4d5d97[_0xebdd('0x10')][_0xebdd('0x13')]);return _0x428df4(_0x4d5d97[_0xebdd('0x10')]['message']);}else{logger[_0xebdd('0xc')](_0xebdd('0x12'),_0x447d63,'request\x20sent');_0x428df4(_0x4d5d97[_0xebdd('0x14')][_0xebdd('0x13')]);}})[_0xebdd('0x15')](function(_0x3edf05){logger[_0xebdd('0x10')](_0xebdd('0x12'),_0x447d63,_0x3edf05);_0x5efc29(_0x3edf05);});});}exports[_0xebdd('0x16')]=function(_0x4860b8){var _0x2040b1=this;return new Promise(function(_0x43db35,_0x5cdfc4){return db['CmHopper'][_0xebdd('0x17')]({'raw':!![],'where':{'ContactId':_0x4860b8[_0xebdd('0x18')][_0xebdd('0x19')],'ListId':_0x4860b8[_0xebdd('0x18')][_0xebdd('0x1a')],'VoiceQueueId':_0x4860b8[_0xebdd('0x18')][_0xebdd('0x1b')]===undefined?null:_0x4860b8['body'][_0xebdd('0x1b')],'CampaignId':_0x4860b8[_0xebdd('0x18')][_0xebdd('0x1c')]===undefined?null:_0x4860b8[_0xebdd('0x18')][_0xebdd('0x1c')]}})['then'](function(_0x30ea47){if(_0x30ea47!=null){return db[_0xebdd('0x1d')][_0xebdd('0x17')]({'raw':!![],'where':{'CmHopperId':_0x30ea47['id'],'OrderBy':{'$gt':_0x30ea47['OrderBy']}},'order':[[_0xebdd('0x1e'),'ASC']]})[_0xebdd('0x1f')](function(_0x12e579){var _0x4559c8=0x0;if(_0x12e579){if(_0x12e579[_0xebdd('0x20')]+_0x12e579[_0xebdd('0x21')]+_0x12e579[_0xebdd('0x22')]+_0x12e579[_0xebdd('0x23')]+_0x12e579[_0xebdd('0x24')]+_0x12e579[_0xebdd('0x25')]+_0x12e579[_0xebdd('0x26')]+_0x12e579[_0xebdd('0x27')]<_0x4860b8['entity']['dialGlobalMaxRetry'])_0x4559c8=0x1;_0x43db35({'additional':_0x4559c8});}else{return db[_0xebdd('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x30ea47['id']},'order':[[_0xebdd('0x1e'),_0xebdd('0x28')]]})[_0xebdd('0x1f')](function(_0x1bf477){var _0x467dac=0x0;if(_0x1bf477){if(_0x1bf477[_0xebdd('0x20')]+_0x1bf477[_0xebdd('0x21')]+_0x1bf477[_0xebdd('0x22')]+_0x1bf477[_0xebdd('0x23')]+_0x1bf477[_0xebdd('0x24')]+_0x1bf477[_0xebdd('0x25')]+_0x1bf477[_0xebdd('0x26')]+_0x1bf477[_0xebdd('0x27')]<_0x4860b8[_0xebdd('0x29')][_0xebdd('0x2a')])_0x467dac=0x1;_0x43db35({'additional':_0x467dac});}else{_0x43db35({'additional':0x0});}})[_0xebdd('0x15')](function(_0x4f08f7){logger[_0xebdd('0x10')](_0xebdd('0x16'),_0x4f08f7['message']);_0x5cdfc4(_0x2040b1['error'](0x1f4,_0x4f08f7[_0xebdd('0x13')]));});}})[_0xebdd('0x15')](function(_0x4758a3){logger[_0xebdd('0x10')]('VerifyAdditionalPhones',_0x4758a3[_0xebdd('0x13')]);_0x5cdfc4(_0x2040b1[_0xebdd('0x10')](0x1f4,_0x4758a3[_0xebdd('0x13')]));});}else _0x43db35({'additional':0x0});});});};exports[_0xebdd('0x2b')]=function(_0x13db28){var _0x15340c=this;return new Promise(function(_0x57d5e6,_0x11d88b){return db[_0xebdd('0x2c')]['findOne']({'raw':!![],'where':{'ContactId':_0x13db28[_0xebdd('0x18')]['ContactId'],'ListId':_0x13db28[_0xebdd('0x18')][_0xebdd('0x1a')],'VoiceQueueId':_0x13db28['body'][_0xebdd('0x1b')]===undefined?null:_0x13db28['body']['VoiceQueueId'],'CampaignId':_0x13db28[_0xebdd('0x18')][_0xebdd('0x1c')]===undefined?null:_0x13db28[_0xebdd('0x18')][_0xebdd('0x1c')]}})['then'](function(_0x333009){if(_0x333009!=null){return db[_0xebdd('0x1d')][_0xebdd('0x17')]({'raw':!![],'where':{'CmHopperId':_0x333009['id'],'OrderBy':{'$gte':_0x333009[_0xebdd('0x1e')]}},'order':[[_0xebdd('0x1e'),'ASC']]})[_0xebdd('0x1f')](function(_0x36a08c){if(_0x36a08c)return activateAdditionalPhone(_0x333009,_0x13db28[_0xebdd('0x18')],_0x36a08c,_0x13db28[_0xebdd('0x2d')],_0x13db28[_0xebdd('0x2e')])['then'](function(_0x1ce50f){_0x57d5e6(_0x1ce50f);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x333009['id']},'order':[[_0xebdd('0x1e'),_0xebdd('0x28')]]})[_0xebdd('0x1f')](function(_0x41fd41){if(_0x41fd41)return activateAdditionalPhone(_0x333009,_0x13db28['body'],_0x41fd41,_0x13db28['duration'],_0x13db28[_0xebdd('0x2e')])[_0xebdd('0x1f')](function(_0x391a53){_0x57d5e6(_0x391a53);});else{_0x57d5e6({'id':_0x333009['id'],'phone':''});}})[_0xebdd('0x15')](function(_0x24162a){logger['error'](_0xebdd('0x16'),_0x24162a[_0xebdd('0x13')]);_0x11d88b(_0x15340c[_0xebdd('0x10')](0x1f4,_0x24162a[_0xebdd('0x13')]));});}})[_0xebdd('0x15')](function(_0x5cf440){logger[_0xebdd('0x10')](_0xebdd('0x16'),_0x5cf440[_0xebdd('0x13')]);_0x11d88b(_0x15340c[_0xebdd('0x10')](0x1f4,_0x5cf440[_0xebdd('0x13')]));});}else _0x57d5e6(0x1);});});};function activateAdditionalPhone(_0x2370cc,_0x2541ac,_0x1f09e9,_0x286b6e,_0x4721b2){return new Promise(function(_0x553ad2,_0x4bc74b){var _0x53fdea;if(_[_0xebdd('0x2f')](_0x1f09e9['scheduledat'])){_0x1f09e9[_0xebdd('0x30')]=moment();}if(moment()>moment(_0x1f09e9['scheduledat'])){_0x53fdea=moment()['add'](_0x4721b2||0x3,'minutes');}else{if(_0x1f09e9[_0xebdd('0x1e')]==0x0){_0x53fdea=moment(_0x1f09e9[_0xebdd('0x30')]);}else{_0x53fdea=moment()[_0xebdd('0x31')](_0x4721b2||0x3,_0xebdd('0x32'));}}if(_['isNil'](_0x53fdea)){_0x53fdea=moment()[_0xebdd('0x31')](_0x4721b2||0x3,'minutes');}var _0x49b1ce={'phone':_0x2370cc[_0xebdd('0x33')],'active':0x0,'OrderBy':_[_0xebdd('0x2f')](_0x2370cc['OrderBy'])?0x0:_0x2370cc[_0xebdd('0x1e')],'scheduledat':moment()[_0xebdd('0x31')](_0x286b6e||0x1,'minutes'),'countbusyretry':_0x2541ac[_0xebdd('0x20')],'countcongestionretry':_0x2541ac[_0xebdd('0x21')],'countnoanswerretry':_0x2541ac[_0xebdd('0x22')],'countnosuchnumberretry':_0x2541ac['countnosuchnumberretry'],'countdropretry':_0x2541ac['countdropretry'],'countabandonedretry':_0x2541ac[_0xebdd('0x25')],'countmachineretry':_0x2541ac[_0xebdd('0x26')],'countagentrejectretry':_0x2541ac['countagentrejectretry'],'createdAt':_0x2541ac[_0xebdd('0x34')],'updatedAt':_0x2541ac[_0xebdd('0x35')]};var _0x55dfe9={'CmHopperId':_0x2370cc['id'],'phone':_0x1f09e9['phone'],'active':0x0,'OrderBy':_[_0xebdd('0x2f')](_0x1f09e9['OrderBy'])?0x0:_0x1f09e9[_0xebdd('0x1e')],'scheduledat':_0x53fdea,'countbusyretry':_0x1f09e9[_0xebdd('0x20')],'countcongestionretry':_0x1f09e9['countcongestionretry'],'countnoanswerretry':_0x1f09e9[_0xebdd('0x22')],'countnosuchnumberretry':_0x1f09e9['countnosuchnumberretry'],'countdropretry':_0x1f09e9[_0xebdd('0x24')],'countabandonedretry':_0x1f09e9['countabandonedretry'],'countmachineretry':_0x1f09e9[_0xebdd('0x26')],'countagentrejectretry':_0x1f09e9[_0xebdd('0x27')],'createdAt':_0x1f09e9[_0xebdd('0x34')],'updatedAt':_0x1f09e9['updatedAt']};return db[_0xebdd('0x36')]['transaction'](function(_0x5c03e4){return db[_0xebdd('0x1d')]['update'](_0x49b1ce,{'where':{'id':_0x1f09e9['id']}},{'transaction':_0x5c03e4})[_0xebdd('0x1f')](function(){return db['CmHopper'][_0xebdd('0x37')](_0x55dfe9,{'where':{'id':_0x2370cc['id']}},{'transaction':_0x5c03e4});});})[_0xebdd('0x1f')](function(_0x442b3c){_0x553ad2({'id':_0x2370cc['id'],'phone':_0x1f09e9['phone']});})['catch'](function(_0x570611){logger[_0xebdd('0x10')](_0xebdd('0x38'),_0x570611[_0xebdd('0x13')]);_0x4bc74b({'error':_0x570611[_0xebdd('0x13')]});});});}exports[_0xebdd('0x39')]=function(_0x20e8e3){var _0x3ca36a=this;return new Promise(function(_0x1fab44,_0x32696a){return db[_0xebdd('0x2c')][_0xebdd('0x37')](_0x20e8e3[_0xebdd('0x18')][_0xebdd('0x3a')],{'where':{'id':_0x20e8e3[_0xebdd('0x18')]['id']}})[_0xebdd('0x1f')](function(_0xe8c255){_0x1fab44(_0xe8c255);})[_0xebdd('0x15')](function(_0x5d4752){logger[_0xebdd('0x10')](_0xebdd('0x39'),_0x5d4752['message']);_0x32696a(_0x3ca36a[_0xebdd('0x10')](0x1f4,_0x5d4752['message']));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js
deleted file mode 100644 (file)
index 093fef3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xc0e3=['update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xc0e3,0x1a5));var _0x3c0e=function(_0x2e1b41,_0x17914a){_0x2e1b41=_0x2e1b41-0x0;var _0x163368=_0xc0e3[_0x2e1b41];return _0x163368;};'use strict';var multer=require(_0x3c0e('0x0'));var util=require('util');var path=require(_0x3c0e('0x1'));var timeout=require(_0x3c0e('0x2'));var express=require('express');var router=express[_0x3c0e('0x3')]();var fs_extra=require(_0x3c0e('0x4'));var auth=require(_0x3c0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3c0e('0x6'));var controller=require(_0x3c0e('0x7'));router[_0x3c0e('0x8')]('/',auth[_0x3c0e('0x9')](),controller[_0x3c0e('0xa')]);router[_0x3c0e('0x8')]('/:id',auth[_0x3c0e('0x9')](),controller[_0x3c0e('0xb')]);router[_0x3c0e('0xc')]('/',auth[_0x3c0e('0x9')](),controller[_0x3c0e('0xd')]);router[_0x3c0e('0xe')](_0x3c0e('0xf'),auth['isAuthenticated'](),controller[_0x3c0e('0x10')]);router[_0x3c0e('0x11')](_0x3c0e('0xf'),auth['isAuthenticated'](),controller[_0x3c0e('0x12')]);module['exports']=router;
\ No newline at end of file
index 14ed7a2..cae784c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38ec=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x515a9e,_0x181fc0){var _0x38f54c=function(_0x355502){while(--_0x355502){_0x515a9e['push'](_0x515a9e['shift']());}};_0x38f54c(++_0x181fc0);}(_0x38ec,0xfa));var _0xc38e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x38ec[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0xc38e('0x0'));var Sequelize=require(_0xc38e('0x1'));module[_0xc38e('0x2')]={'phone':{'type':Sequelize[_0xc38e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc38e('0x4')],'unique':_0xc38e('0x5')},'ListId':{'type':Sequelize[_0xc38e('0x4')],'unique':_0xc38e('0x5')},'VoiceQueueId':{'type':Sequelize[_0xc38e('0x4')],'unique':'contactListQueue'}};
\ No newline at end of file
+var _0x59ec=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x4264fd,_0x105ff5){var _0x490a1b=function(_0x38484a){while(--_0x38484a){_0x4264fd['push'](_0x4264fd['shift']());}};_0x490a1b(++_0x105ff5);}(_0x59ec,0x102));var _0xc59e=function(_0x420a4e,_0x17dec7){_0x420a4e=_0x420a4e-0x0;var _0x1cb7ad=_0x59ec[_0x420a4e];return _0x1cb7ad;};'use strict';var moment=require(_0xc59e('0x0'));var Sequelize=require(_0xc59e('0x1'));module['exports']={'phone':{'type':Sequelize[_0xc59e('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc59e('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xc59e('0x3')],'unique':_0xc59e('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc59e('0x3')],'unique':_0xc59e('0x4')}};
\ No newline at end of file
index 90b90b9..88b13bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a36=['reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','CmHopperBlack','findAll','rows','catch','show','intersection','length','options','find','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','end','offset','undefined','limit','count','set','json','apply'];(function(_0x409554,_0xccf33c){var _0x3bda64=function(_0x17832b){while(--_0x17832b){_0x409554['push'](_0x409554['shift']());}};_0x3bda64(++_0xccf33c);}(_0x3a36,0x7e));var _0x63a3=function(_0x542901,_0x445166){_0x542901=_0x542901-0x0;var _0x533030=_0x3a36[_0x542901];return _0x533030;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63a3('0x0'));var zipdir=require(_0x63a3('0x1'));var jsonpatch=require(_0x63a3('0x2'));var rp=require(_0x63a3('0x3'));var moment=require(_0x63a3('0x4'));var BPromise=require(_0x63a3('0x5'));var Mustache=require(_0x63a3('0x6'));var util=require('util');var path=require(_0x63a3('0x7'));var sox=require(_0x63a3('0x8'));var csv=require(_0x63a3('0x9'));var ejs=require(_0x63a3('0xa'));var fs=require('fs');var fs_extra=require(_0x63a3('0xb'));var _=require(_0x63a3('0xc'));var squel=require(_0x63a3('0xd'));var crypto=require(_0x63a3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x63a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x63a3('0x10'));var Papa=require(_0x63a3('0x11'));var Redis=require(_0x63a3('0x12'));var authService=require(_0x63a3('0x13'));var qs=require(_0x63a3('0x14'));var as=require(_0x63a3('0x15'));var hardwareService=require(_0x63a3('0x16'));var logger=require(_0x63a3('0x17'))(_0x63a3('0x18'));var utils=require(_0x63a3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x63a3('0x1a'));var db=require(_0x63a3('0x1b'))['db'];function respondWithStatusCode(_0xad53ad,_0x4ddccb){_0x4ddccb=_0x4ddccb||0xcc;return function(_0x44fb44){if(_0x44fb44){return _0xad53ad[_0x63a3('0x1c')](_0x4ddccb);}return _0xad53ad[_0x63a3('0x1d')](_0x4ddccb)[_0x63a3('0x1e')]();};}function respondWithResult(_0x5877af,_0x56e603){_0x56e603=_0x56e603||0xc8;return function(_0x431754){if(_0x431754){return _0x5877af[_0x63a3('0x1d')](_0x56e603)['json'](_0x431754);}};}function respondWithFilteredResult(_0x38c080,_0x5cef19){return function(_0x5c024e){if(_0x5c024e){var _0x46ec72=typeof _0x5cef19[_0x63a3('0x1f')]===_0x63a3('0x20')&&typeof _0x5cef19[_0x63a3('0x21')]==='undefined';var _0x494927=_0x5c024e['count'];var _0x1dd1f4=_0x46ec72?0x0:_0x5cef19[_0x63a3('0x1f')];var _0x20323e=_0x46ec72?_0x5c024e[_0x63a3('0x22')]:_0x5cef19['offset']+_0x5cef19[_0x63a3('0x21')];var _0x2e6bcb;if(_0x20323e>=_0x494927){_0x20323e=_0x494927;_0x2e6bcb=0xc8;}else{_0x2e6bcb=0xce;}_0x38c080[_0x63a3('0x1d')](_0x2e6bcb);return _0x38c080[_0x63a3('0x23')]('Content-Range',_0x1dd1f4+'-'+_0x20323e+'/'+_0x494927)[_0x63a3('0x24')](_0x5c024e);}return null;};}function patchUpdates(_0xb45b6b){return function(_0x485362){try{jsonpatch[_0x63a3('0x25')](_0x485362,_0xb45b6b,!![]);}catch(_0x175252){return BPromise[_0x63a3('0x26')](_0x175252);}return _0x485362[_0x63a3('0x27')]();};}function saveUpdates(_0x25c03d,_0xd62d65){return function(_0x104a47){if(_0x104a47){return _0x104a47[_0x63a3('0x28')](_0x25c03d)[_0x63a3('0x29')](function(_0x5edb47){return _0x5edb47;});}return null;};}function removeEntity(_0x41c893,_0x577266){return function(_0x2db8a1){if(_0x2db8a1){return _0x2db8a1[_0x63a3('0x2a')]()[_0x63a3('0x29')](function(){_0x41c893[_0x63a3('0x1d')](0xcc)[_0x63a3('0x1e')]();});}};}function handleEntityNotFound(_0x1dffd8,_0x4829c3){return function(_0x14b4f0){if(!_0x14b4f0){_0x1dffd8[_0x63a3('0x1c')](0x194);}return _0x14b4f0;};}function handleError(_0x45b859,_0x2b58dd){_0x2b58dd=_0x2b58dd||0x1f4;return function(_0x540f14){logger[_0x63a3('0x2b')](_0x540f14[_0x63a3('0x2c')]);if(_0x540f14['name']){delete _0x540f14[_0x63a3('0x2d')];}_0x45b859[_0x63a3('0x1d')](_0x2b58dd)[_0x63a3('0x2e')](_0x540f14);};}exports[_0x63a3('0x2f')]=function(_0x31895c,_0x3b4c5b){var _0x5b5d7c={},_0xeb44a3={},_0x152b7b={'count':0x0,'rows':[]};var _0x2b4922=_[_0x63a3('0x30')](db['CmHopperBlack'][_0x63a3('0x31')],function(_0x2b58b7){return{'name':_0x2b58b7[_0x63a3('0x32')],'type':_0x2b58b7[_0x63a3('0x33')][_0x63a3('0x34')]};});_0xeb44a3[_0x63a3('0x35')]=_[_0x63a3('0x30')](_0x2b4922,'name');_0xeb44a3['query']=_[_0x63a3('0x36')](_0x31895c[_0x63a3('0x37')]);_0xeb44a3['filters']=_['intersection'](_0xeb44a3[_0x63a3('0x35')],_0xeb44a3[_0x63a3('0x37')]);_0x5b5d7c[_0x63a3('0x38')]=_['intersection'](_0xeb44a3[_0x63a3('0x35')],qs['fields'](_0x31895c[_0x63a3('0x37')][_0x63a3('0x39')]));_0x5b5d7c[_0x63a3('0x38')]=_0x5b5d7c[_0x63a3('0x38')]['length']?_0x5b5d7c[_0x63a3('0x38')]:_0xeb44a3[_0x63a3('0x35')];if(!_0x31895c[_0x63a3('0x37')][_0x63a3('0x3a')](_0x63a3('0x3b'))){_0x5b5d7c['limit']=qs[_0x63a3('0x21')](_0x31895c['query']['limit']);_0x5b5d7c[_0x63a3('0x1f')]=qs['offset'](_0x31895c['query'][_0x63a3('0x1f')]);}_0x5b5d7c[_0x63a3('0x3c')]=qs[_0x63a3('0x3d')](_0x31895c[_0x63a3('0x37')]['sort']);_0x5b5d7c['where']=qs[_0x63a3('0x3e')](_[_0x63a3('0x3f')](_0x31895c[_0x63a3('0x37')],_0xeb44a3[_0x63a3('0x3e')]),_0x2b4922);if(_0x31895c[_0x63a3('0x37')][_0x63a3('0x40')]){_0x5b5d7c[_0x63a3('0x41')]=_[_0x63a3('0x42')](_0x5b5d7c[_0x63a3('0x41')],{'$or':_[_0x63a3('0x30')](_0x2b4922,function(_0x598e2e){if(_0x598e2e['type']!==_0x63a3('0x43')){var _0x4b5efa={};_0x4b5efa[_0x598e2e[_0x63a3('0x2d')]]={'$like':'%'+_0x31895c[_0x63a3('0x37')][_0x63a3('0x40')]+'%'};return _0x4b5efa;}})});}_0x5b5d7c=_[_0x63a3('0x42')]({},_0x5b5d7c,_0x31895c['options']);var _0x48bc4a={'where':_0x5b5d7c[_0x63a3('0x41')]};return db['CmHopperBlack'][_0x63a3('0x22')](_0x48bc4a)[_0x63a3('0x29')](function(_0x212510){_0x152b7b[_0x63a3('0x22')]=_0x212510;if(_0x31895c[_0x63a3('0x37')][_0x63a3('0x44')]){_0x5b5d7c[_0x63a3('0x45')]=[{'all':!![]}];}return db[_0x63a3('0x46')][_0x63a3('0x47')](_0x5b5d7c);})[_0x63a3('0x29')](function(_0x2f1ea5){_0x152b7b[_0x63a3('0x48')]=_0x2f1ea5;return _0x152b7b;})[_0x63a3('0x29')](respondWithFilteredResult(_0x3b4c5b,_0x5b5d7c))[_0x63a3('0x49')](handleError(_0x3b4c5b,null));};exports[_0x63a3('0x4a')]=function(_0x23213d,_0x2fe5ab){var _0x4b4003={'raw':!![],'where':{'id':_0x23213d['params']['id']}},_0x411ffc={};_0x411ffc['model']=_[_0x63a3('0x36')](db[_0x63a3('0x46')][_0x63a3('0x31')]);_0x411ffc['query']=_[_0x63a3('0x36')](_0x23213d[_0x63a3('0x37')]);_0x411ffc['filters']=_['intersection'](_0x411ffc['model'],_0x411ffc[_0x63a3('0x37')]);_0x4b4003[_0x63a3('0x38')]=_[_0x63a3('0x4b')](_0x411ffc[_0x63a3('0x35')],qs[_0x63a3('0x39')](_0x23213d[_0x63a3('0x37')][_0x63a3('0x39')]));_0x4b4003[_0x63a3('0x38')]=_0x4b4003[_0x63a3('0x38')][_0x63a3('0x4c')]?_0x4b4003[_0x63a3('0x38')]:_0x411ffc[_0x63a3('0x35')];if(_0x23213d[_0x63a3('0x37')][_0x63a3('0x44')]){_0x4b4003['include']=[{'all':!![]}];}_0x4b4003=_['merge']({},_0x4b4003,_0x23213d[_0x63a3('0x4d')]);return db[_0x63a3('0x46')][_0x63a3('0x4e')](_0x4b4003)[_0x63a3('0x29')](handleEntityNotFound(_0x2fe5ab,null))[_0x63a3('0x29')](respondWithResult(_0x2fe5ab,null))[_0x63a3('0x49')](handleError(_0x2fe5ab,null));};exports[_0x63a3('0x28')]=function(_0x5a2960,_0x2dc2cf){if(_0x5a2960[_0x63a3('0x4f')]['id']){delete _0x5a2960['body']['id'];}return db['CmHopperBlack'][_0x63a3('0x4e')]({'where':{'id':_0x5a2960['params']['id']}})[_0x63a3('0x29')](handleEntityNotFound(_0x2dc2cf,null))[_0x63a3('0x29')](saveUpdates(_0x5a2960[_0x63a3('0x4f')],null))[_0x63a3('0x29')](respondWithResult(_0x2dc2cf,null))['catch'](handleError(_0x2dc2cf,null));};exports[_0x63a3('0x2a')]=function(_0x1e9617,_0x162dd9){return db[_0x63a3('0x46')]['find']({'where':{'id':_0x1e9617[_0x63a3('0x50')]['id']}})[_0x63a3('0x29')](handleEntityNotFound(_0x162dd9,null))[_0x63a3('0x29')](removeEntity(_0x162dd9,null))[_0x63a3('0x49')](handleError(_0x162dd9,null));};exports[_0x63a3('0x51')]=function(_0xa992e2,_0x32a29f){return db[_0x63a3('0x46')]['describe']()[_0x63a3('0x29')](respondWithResult(_0x32a29f,null))['catch'](handleError(_0x32a29f,null));};
\ No newline at end of file
+var _0xc053=['length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','include','params','keys','fields','includeAll','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','key','query','filters','intersection','model','attributes'];(function(_0x264a32,_0x4b16b5){var _0x5479c3=function(_0x8142ac){while(--_0x8142ac){_0x264a32['push'](_0x264a32['shift']());}};_0x5479c3(++_0x4b16b5);}(_0xc053,0x64));var _0x3c05=function(_0x50d5ae,_0x22a349){_0x50d5ae=_0x50d5ae-0x0;var _0x1e8d74=_0xc053[_0x50d5ae];return _0x1e8d74;};'use strict';var emlformat=require(_0x3c05('0x0'));var rimraf=require(_0x3c05('0x1'));var zipdir=require(_0x3c05('0x2'));var jsonpatch=require(_0x3c05('0x3'));var rp=require(_0x3c05('0x4'));var moment=require(_0x3c05('0x5'));var BPromise=require(_0x3c05('0x6'));var Mustache=require(_0x3c05('0x7'));var util=require(_0x3c05('0x8'));var path=require('path');var sox=require(_0x3c05('0x9'));var csv=require('to-csv');var ejs=require(_0x3c05('0xa'));var fs=require('fs');var fs_extra=require(_0x3c05('0xb'));var _=require(_0x3c05('0xc'));var squel=require(_0x3c05('0xd'));var crypto=require(_0x3c05('0xe'));var jsforce=require(_0x3c05('0xf'));var deskjs=require(_0x3c05('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3c05('0x11'));var Papa=require(_0x3c05('0x12'));var Redis=require(_0x3c05('0x13'));var authService=require(_0x3c05('0x14'));var qs=require(_0x3c05('0x15'));var as=require(_0x3c05('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c05('0x17'))(_0x3c05('0x18'));var utils=require(_0x3c05('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3c05('0x1a'));var db=require(_0x3c05('0x1b'))['db'];function respondWithStatusCode(_0x3c810c,_0x4dc8dc){_0x4dc8dc=_0x4dc8dc||0xcc;return function(_0x2e1223){if(_0x2e1223){return _0x3c810c[_0x3c05('0x1c')](_0x4dc8dc);}return _0x3c810c[_0x3c05('0x1d')](_0x4dc8dc)[_0x3c05('0x1e')]();};}function respondWithResult(_0xaac81f,_0x2d87db){_0x2d87db=_0x2d87db||0xc8;return function(_0x4b4541){if(_0x4b4541){return _0xaac81f[_0x3c05('0x1d')](_0x2d87db)[_0x3c05('0x1f')](_0x4b4541);}};}function respondWithFilteredResult(_0x3cdaea,_0x1b2ad0){return function(_0x3d2f7a){if(_0x3d2f7a){var _0x3b5d7e=typeof _0x1b2ad0['offset']===_0x3c05('0x20')&&typeof _0x1b2ad0[_0x3c05('0x21')]===_0x3c05('0x20');var _0x3ded8a=_0x3d2f7a['count'];var _0x2b8dca=_0x3b5d7e?0x0:_0x1b2ad0[_0x3c05('0x22')];var _0x2dce07=_0x3b5d7e?_0x3d2f7a['count']:_0x1b2ad0[_0x3c05('0x22')]+_0x1b2ad0[_0x3c05('0x21')];var _0x2b0f4d;if(_0x2dce07>=_0x3ded8a){_0x2dce07=_0x3ded8a;_0x2b0f4d=0xc8;}else{_0x2b0f4d=0xce;}_0x3cdaea[_0x3c05('0x1d')](_0x2b0f4d);return _0x3cdaea[_0x3c05('0x23')](_0x3c05('0x24'),_0x2b8dca+'-'+_0x2dce07+'/'+_0x3ded8a)['json'](_0x3d2f7a);}return null;};}function patchUpdates(_0x3dfccc){return function(_0x4c24ca){try{jsonpatch[_0x3c05('0x25')](_0x4c24ca,_0x3dfccc,!![]);}catch(_0x18e223){return BPromise[_0x3c05('0x26')](_0x18e223);}return _0x4c24ca['save']();};}function saveUpdates(_0x1eff7a,_0x35c15e){return function(_0x7ede41){if(_0x7ede41){return _0x7ede41[_0x3c05('0x27')](_0x1eff7a)[_0x3c05('0x28')](function(_0x228c47){return _0x228c47;});}return null;};}function removeEntity(_0x3980d0,_0xfb26c){return function(_0x5ca7be){if(_0x5ca7be){return _0x5ca7be[_0x3c05('0x29')]()[_0x3c05('0x28')](function(){_0x3980d0['status'](0xcc)[_0x3c05('0x1e')]();});}};}function handleEntityNotFound(_0x26145a,_0x40a9ec){return function(_0x49b9fb){if(!_0x49b9fb){_0x26145a[_0x3c05('0x1c')](0x194);}return _0x49b9fb;};}function handleError(_0x42c8d8,_0x14f71c){_0x14f71c=_0x14f71c||0x1f4;return function(_0x4bfdc1){logger[_0x3c05('0x2a')](_0x4bfdc1[_0x3c05('0x2b')]);if(_0x4bfdc1[_0x3c05('0x2c')]){delete _0x4bfdc1['name'];}_0x42c8d8[_0x3c05('0x1d')](_0x14f71c)[_0x3c05('0x2d')](_0x4bfdc1);};}exports[_0x3c05('0x2e')]=function(_0xca7b4,_0x31a8ef){var _0x4a2359={},_0x6a38f7={},_0x4a2e99={'count':0x0,'rows':[]};var _0x195037=_['map'](db[_0x3c05('0x2f')][_0x3c05('0x30')],function(_0x1d174b){return{'name':_0x1d174b[_0x3c05('0x31')],'type':_0x1d174b['type'][_0x3c05('0x32')]};});_0x6a38f7['model']=_['map'](_0x195037,_0x3c05('0x2c'));_0x6a38f7[_0x3c05('0x33')]=_['keys'](_0xca7b4[_0x3c05('0x33')]);_0x6a38f7[_0x3c05('0x34')]=_[_0x3c05('0x35')](_0x6a38f7[_0x3c05('0x36')],_0x6a38f7[_0x3c05('0x33')]);_0x4a2359[_0x3c05('0x37')]=_[_0x3c05('0x35')](_0x6a38f7[_0x3c05('0x36')],qs['fields'](_0xca7b4[_0x3c05('0x33')]['fields']));_0x4a2359[_0x3c05('0x37')]=_0x4a2359['attributes'][_0x3c05('0x38')]?_0x4a2359[_0x3c05('0x37')]:_0x6a38f7[_0x3c05('0x36')];if(!_0xca7b4[_0x3c05('0x33')][_0x3c05('0x39')]('nolimit')){_0x4a2359[_0x3c05('0x21')]=qs[_0x3c05('0x21')](_0xca7b4[_0x3c05('0x33')]['limit']);_0x4a2359[_0x3c05('0x22')]=qs[_0x3c05('0x22')](_0xca7b4[_0x3c05('0x33')][_0x3c05('0x22')]);}_0x4a2359[_0x3c05('0x3a')]=qs[_0x3c05('0x3b')](_0xca7b4[_0x3c05('0x33')][_0x3c05('0x3b')]);_0x4a2359[_0x3c05('0x3c')]=qs[_0x3c05('0x34')](_[_0x3c05('0x3d')](_0xca7b4[_0x3c05('0x33')],_0x6a38f7['filters']),_0x195037);if(_0xca7b4[_0x3c05('0x33')][_0x3c05('0x3e')]){_0x4a2359[_0x3c05('0x3c')]=_[_0x3c05('0x3f')](_0x4a2359['where'],{'$or':_[_0x3c05('0x40')](_0x195037,function(_0x58b910){if(_0x58b910[_0x3c05('0x41')]!==_0x3c05('0x42')){var _0x4eb63={};_0x4eb63[_0x58b910[_0x3c05('0x2c')]]={'$like':'%'+_0xca7b4['query']['filter']+'%'};return _0x4eb63;}})});}_0x4a2359=_[_0x3c05('0x3f')]({},_0x4a2359,_0xca7b4[_0x3c05('0x43')]);var _0x32b306={'where':_0x4a2359[_0x3c05('0x3c')]};return db[_0x3c05('0x2f')][_0x3c05('0x44')](_0x32b306)[_0x3c05('0x28')](function(_0x4e66f5){_0x4a2e99[_0x3c05('0x44')]=_0x4e66f5;if(_0xca7b4[_0x3c05('0x33')]['includeAll']){_0x4a2359[_0x3c05('0x45')]=[{'all':!![]}];}return db[_0x3c05('0x2f')]['findAll'](_0x4a2359);})['then'](function(_0x17a6ac){_0x4a2e99['rows']=_0x17a6ac;return _0x4a2e99;})[_0x3c05('0x28')](respondWithFilteredResult(_0x31a8ef,_0x4a2359))['catch'](handleError(_0x31a8ef,null));};exports['show']=function(_0x5c9e16,_0xf5ca24){var _0x31c717={'raw':!![],'where':{'id':_0x5c9e16[_0x3c05('0x46')]['id']}},_0x41904e={};_0x41904e['model']=_[_0x3c05('0x47')](db[_0x3c05('0x2f')]['rawAttributes']);_0x41904e[_0x3c05('0x33')]=_['keys'](_0x5c9e16[_0x3c05('0x33')]);_0x41904e[_0x3c05('0x34')]=_[_0x3c05('0x35')](_0x41904e[_0x3c05('0x36')],_0x41904e[_0x3c05('0x33')]);_0x31c717['attributes']=_[_0x3c05('0x35')](_0x41904e[_0x3c05('0x36')],qs[_0x3c05('0x48')](_0x5c9e16[_0x3c05('0x33')][_0x3c05('0x48')]));_0x31c717[_0x3c05('0x37')]=_0x31c717[_0x3c05('0x37')][_0x3c05('0x38')]?_0x31c717[_0x3c05('0x37')]:_0x41904e['model'];if(_0x5c9e16[_0x3c05('0x33')][_0x3c05('0x49')]){_0x31c717['include']=[{'all':!![]}];}_0x31c717=_[_0x3c05('0x3f')]({},_0x31c717,_0x5c9e16['options']);return db[_0x3c05('0x2f')][_0x3c05('0x4a')](_0x31c717)[_0x3c05('0x28')](handleEntityNotFound(_0xf5ca24,null))[_0x3c05('0x28')](respondWithResult(_0xf5ca24,null))[_0x3c05('0x4b')](handleError(_0xf5ca24,null));};exports[_0x3c05('0x27')]=function(_0x4c4efc,_0x23891c){if(_0x4c4efc[_0x3c05('0x4c')]['id']){delete _0x4c4efc[_0x3c05('0x4c')]['id'];}return db[_0x3c05('0x2f')][_0x3c05('0x4a')]({'where':{'id':_0x4c4efc['params']['id']}})[_0x3c05('0x28')](handleEntityNotFound(_0x23891c,null))['then'](saveUpdates(_0x4c4efc[_0x3c05('0x4c')],null))['then'](respondWithResult(_0x23891c,null))[_0x3c05('0x4b')](handleError(_0x23891c,null));};exports['destroy']=function(_0x18f50c,_0x1c519c){return db[_0x3c05('0x2f')][_0x3c05('0x4a')]({'where':{'id':_0x18f50c['params']['id']}})['then'](handleEntityNotFound(_0x1c519c,null))['then'](removeEntity(_0x1c519c,null))[_0x3c05('0x4b')](handleError(_0x1c519c,null));};exports[_0x3c05('0x4d')]=function(_0x1c6c20,_0x1663e5){return db[_0x3c05('0x2f')][_0x3c05('0x4d')]()[_0x3c05('0x28')](respondWithResult(_0x1663e5,null))['catch'](handleError(_0x1663e5,null));};
\ No newline at end of file
index ac956af..5a88c3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc6c=['path','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4dc75c,_0x5ce6de){var _0x1f3910=function(_0x58f089){while(--_0x58f089){_0x4dc75c['push'](_0x4dc75c['shift']());}};_0x1f3910(++_0x5ce6de);}(_0xfc6c,0x103));var _0xcfc6=function(_0x4d4bfb,_0x363bed){_0x4d4bfb=_0x4d4bfb-0x0;var _0x32ef22=_0xfc6c[_0x4d4bfb];return _0x32ef22;};'use strict';var _=require(_0xcfc6('0x0'));var util=require(_0xcfc6('0x1'));var logger=require(_0xcfc6('0x2'))(_0xcfc6('0x3'));var moment=require(_0xcfc6('0x4'));var BPromise=require(_0xcfc6('0x5'));var rp=require(_0xcfc6('0x6'));var fs=require('fs');var path=require(_0xcfc6('0x7'));var rimraf=require(_0xcfc6('0x8'));var config=require(_0xcfc6('0x9'));var attributes=require('./cmHopperBlack.attributes');module[_0xcfc6('0xa')]=function(_0x1e3234,_0x285a25){return _0x1e3234[_0xcfc6('0xb')](_0xcfc6('0xc'),attributes,{'tableName':_0xcfc6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce6f=['path','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xce6f,0x1b6));var _0xfce6=function(_0x483aa8,_0x501a61){_0x483aa8=_0x483aa8-0x0;var _0x350f2d=_0xce6f[_0x483aa8];return _0x350f2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfce6('0x0'))(_0xfce6('0x1'));var moment=require(_0xfce6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfce6('0x3'));var rimraf=require('rimraf');var config=require(_0xfce6('0x4'));var attributes=require(_0xfce6('0x5'));module[_0xfce6('0x6')]=function(_0x3f8b62,_0x2c6b81){return _0x3f8b62[_0xfce6('0x7')]('CmHopperBlack',attributes,{'tableName':_0xfce6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8e5068..2310b57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa667=['DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','info','result','catch','GetCmHopperBlack','findAll','options','where','attributes','include','map','model','UpdateCmHopperBlack','CmHopperBlack','update','body','raw','limit','destroy'];(function(_0x5e0416,_0x541afd){var _0x3dfc48=function(_0x5a4dcc){while(--_0x5a4dcc){_0x5e0416['push'](_0x5e0416['shift']());}};_0x3dfc48(++_0x541afd);}(_0xa667,0x160));var _0x7a66=function(_0x48f382,_0x8c0248){_0x48f382=_0x48f382-0x0;var _0x42517c=_0xa667[_0x48f382];return _0x42517c;};'use strict';var _=require(_0x7a66('0x0'));var util=require(_0x7a66('0x1'));var moment=require(_0x7a66('0x2'));var BPromise=require(_0x7a66('0x3'));var rs=require(_0x7a66('0x4'));var fs=require('fs');var Redis=require(_0x7a66('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7a66('0x6'))(_0x7a66('0x7'));var config=require(_0x7a66('0x8'));var jayson=require(_0x7a66('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18b5df,_0x4e6471,_0x26a093){return new BPromise(function(_0x2576ab,_0xf4d3d9){return client[_0x7a66('0xa')](_0x18b5df,_0x26a093)[_0x7a66('0xb')](function(_0x28db4b){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x4e6471,_0x7a66('0xc'));logger[_0x7a66('0xd')](_0x7a66('0xe'),_0x4e6471,_0x7a66('0xc'),JSON[_0x7a66('0xf')](_0x28db4b));if(_0x28db4b[_0x7a66('0x10')]){if(_0x28db4b['error'][_0x7a66('0x11')]===0x1f4){logger[_0x7a66('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4e6471,_0x28db4b[_0x7a66('0x10')][_0x7a66('0x12')]);return _0xf4d3d9(_0x28db4b[_0x7a66('0x10')][_0x7a66('0x12')]);}logger[_0x7a66('0x10')](_0x7a66('0x13'),_0x4e6471,_0x28db4b[_0x7a66('0x10')][_0x7a66('0x12')]);return _0x2576ab(_0x28db4b[_0x7a66('0x10')]['message']);}else{logger[_0x7a66('0x14')](_0x7a66('0x13'),_0x4e6471,'request\x20sent');_0x2576ab(_0x28db4b[_0x7a66('0x15')]['message']);}})[_0x7a66('0x16')](function(_0x1cedd1){logger[_0x7a66('0x10')](_0x7a66('0x13'),_0x4e6471,_0x1cedd1);_0xf4d3d9(_0x1cedd1);});});}exports[_0x7a66('0x17')]=function(_0x4fbcd5){var _0x2254f5=this;return new Promise(function(_0x395432,_0x547e98){return db['CmHopperBlack'][_0x7a66('0x18')]({'raw':_0x4fbcd5[_0x7a66('0x19')]?_0x4fbcd5['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fbcd5[_0x7a66('0x19')]?_0x4fbcd5[_0x7a66('0x19')][_0x7a66('0x1a')]||null:null,'attributes':_0x4fbcd5[_0x7a66('0x19')]?_0x4fbcd5[_0x7a66('0x19')][_0x7a66('0x1b')]||null:null,'limit':_0x4fbcd5['options']?_0x4fbcd5[_0x7a66('0x19')]['limit']||null:null,'include':_0x4fbcd5['options']?_0x4fbcd5[_0x7a66('0x19')][_0x7a66('0x1c')]?_[_0x7a66('0x1d')](_0x4fbcd5[_0x7a66('0x19')]['include'],function(_0x3ca4ae){return{'model':db[_0x3ca4ae[_0x7a66('0x1e')]],'as':_0x3ca4ae['as'],'attributes':_0x3ca4ae[_0x7a66('0x1b')],'include':_0x3ca4ae[_0x7a66('0x1c')]?_['map'](_0x3ca4ae[_0x7a66('0x1c')],function(_0x11ab11){return{'model':db[_0x11ab11[_0x7a66('0x1e')]],'as':_0x11ab11['as'],'attributes':_0x11ab11[_0x7a66('0x1b')],'include':_0x11ab11[_0x7a66('0x1c')]?_[_0x7a66('0x1d')](_0x11ab11[_0x7a66('0x1c')],function(_0x4c2298){return{'model':db[_0x4c2298[_0x7a66('0x1e')]],'as':_0x4c2298['as'],'attributes':_0x4c2298['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a66('0xb')](function(_0x5b85d2){logger[_0x7a66('0x14')]('GetCmHopperBlack',_0x4fbcd5);logger['debug'](_0x7a66('0x17'),_0x4fbcd5,JSON[_0x7a66('0xf')](_0x5b85d2));_0x395432(_0x5b85d2);})['catch'](function(_0x154e8f){logger[_0x7a66('0x10')](_0x7a66('0x17'),_0x154e8f[_0x7a66('0x12')],_0x4fbcd5);_0x547e98(_0x2254f5['error'](0x1f4,_0x154e8f['message']));});});};exports[_0x7a66('0x1f')]=function(_0x259e2d){var _0x1501aa=this;return new Promise(function(_0x190132,_0x41e933){return db[_0x7a66('0x20')][_0x7a66('0x21')](_0x259e2d[_0x7a66('0x22')],{'raw':_0x259e2d[_0x7a66('0x19')]?_0x259e2d['options'][_0x7a66('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x259e2d[_0x7a66('0x19')]?_0x259e2d['options'][_0x7a66('0x1a')]||null:null,'attributes':_0x259e2d['options']?_0x259e2d['options'][_0x7a66('0x1b')]||null:null,'limit':_0x259e2d['options']?_0x259e2d['options'][_0x7a66('0x24')]||null:null})[_0x7a66('0xb')](function(_0x2acb94){logger[_0x7a66('0x14')]('UpdateCmHopperBlack',_0x259e2d);logger[_0x7a66('0xd')](_0x7a66('0x1f'),_0x259e2d,JSON[_0x7a66('0xf')](_0x2acb94));_0x190132(_0x2acb94);})[_0x7a66('0x16')](function(_0x3382fe){logger[_0x7a66('0x10')]('UpdateCmHopperBlack',_0x3382fe[_0x7a66('0x12')],_0x259e2d);_0x41e933(_0x1501aa[_0x7a66('0x10')](0x1f4,_0x3382fe[_0x7a66('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x2d081f){var _0x539d53=this;return new Promise(function(_0xebfb65,_0x9860e4){return db['CmHopperBlack'][_0x7a66('0x25')]({'where':_0x2d081f['options']?_0x2d081f[_0x7a66('0x19')][_0x7a66('0x1a')]||null:null})['then'](function(_0x19451e){logger['info'](_0x7a66('0x26'),_0x2d081f);logger[_0x7a66('0xd')]('DestroyCmHopperBlack',_0x2d081f,JSON['stringify'](_0x19451e));_0xebfb65(_0x19451e);})[_0x7a66('0x16')](function(_0x77c6d7){logger['error']('DestroyCmHopperBlack',_0x77c6d7['message'],_0x2d081f);_0x9860e4(_0x539d53[_0x7a66('0x10')](0x1f4,_0x77c6d7['message']));});});};
\ No newline at end of file
+var _0x6eb5=['map','model','debug','catch','CmHopperBlack','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','message','CmHopperBlack,\x20%s,\x20%s','info','result','GetCmHopperBlack','findAll','options','where','attributes','include'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x6eb5,0x189));var _0x56eb=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0x6eb5[_0x101a17];return _0x3b76ee;};'use strict';var _=require(_0x56eb('0x0'));var util=require('util');var moment=require(_0x56eb('0x1'));var BPromise=require(_0x56eb('0x2'));var rs=require(_0x56eb('0x3'));var fs=require('fs');var Redis=require(_0x56eb('0x4'));var db=require(_0x56eb('0x5'))['db'];var utils=require(_0x56eb('0x6'));var logger=require(_0x56eb('0x7'))('rpc');var config=require(_0x56eb('0x8'));var jayson=require(_0x56eb('0x9'));var client=jayson[_0x56eb('0xa')][_0x56eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ecc83,_0x4fd35a,_0x2ba91b){return new BPromise(function(_0x274937,_0x4e10cb){return client[_0x56eb('0xc')](_0x4ecc83,_0x2ba91b)[_0x56eb('0xd')](function(_0x50a3df){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x4fd35a,'request\x20sent');logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4fd35a,_0x56eb('0xe'),JSON[_0x56eb('0xf')](_0x50a3df));if(_0x50a3df[_0x56eb('0x10')]){if(_0x50a3df[_0x56eb('0x10')]['code']===0x1f4){logger[_0x56eb('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4fd35a,_0x50a3df[_0x56eb('0x10')]['message']);return _0x4e10cb(_0x50a3df[_0x56eb('0x10')][_0x56eb('0x11')]);}logger[_0x56eb('0x10')](_0x56eb('0x12'),_0x4fd35a,_0x50a3df[_0x56eb('0x10')][_0x56eb('0x11')]);return _0x274937(_0x50a3df[_0x56eb('0x10')][_0x56eb('0x11')]);}else{logger[_0x56eb('0x13')](_0x56eb('0x12'),_0x4fd35a,'request\x20sent');_0x274937(_0x50a3df[_0x56eb('0x14')][_0x56eb('0x11')]);}})['catch'](function(_0x1bd098){logger[_0x56eb('0x10')](_0x56eb('0x12'),_0x4fd35a,_0x1bd098);_0x4e10cb(_0x1bd098);});});}exports[_0x56eb('0x15')]=function(_0x4d286b){var _0x26ccef=this;return new Promise(function(_0x2f3ecb,_0x28d5ca){return db['CmHopperBlack'][_0x56eb('0x16')]({'raw':_0x4d286b[_0x56eb('0x17')]?_0x4d286b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d286b['options']?_0x4d286b[_0x56eb('0x17')][_0x56eb('0x18')]||null:null,'attributes':_0x4d286b[_0x56eb('0x17')]?_0x4d286b[_0x56eb('0x17')][_0x56eb('0x19')]||null:null,'limit':_0x4d286b[_0x56eb('0x17')]?_0x4d286b['options']['limit']||null:null,'include':_0x4d286b[_0x56eb('0x17')]?_0x4d286b[_0x56eb('0x17')][_0x56eb('0x1a')]?_[_0x56eb('0x1b')](_0x4d286b['options'][_0x56eb('0x1a')],function(_0x181be6){return{'model':db[_0x181be6[_0x56eb('0x1c')]],'as':_0x181be6['as'],'attributes':_0x181be6[_0x56eb('0x19')],'include':_0x181be6['include']?_['map'](_0x181be6[_0x56eb('0x1a')],function(_0x452728){return{'model':db[_0x452728[_0x56eb('0x1c')]],'as':_0x452728['as'],'attributes':_0x452728[_0x56eb('0x19')],'include':_0x452728['include']?_[_0x56eb('0x1b')](_0x452728[_0x56eb('0x1a')],function(_0x31c7c3){return{'model':db[_0x31c7c3[_0x56eb('0x1c')]],'as':_0x31c7c3['as'],'attributes':_0x31c7c3[_0x56eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x56eb('0xd')](function(_0x360cf8){logger[_0x56eb('0x13')](_0x56eb('0x15'),_0x4d286b);logger[_0x56eb('0x1d')]('GetCmHopperBlack',_0x4d286b,JSON[_0x56eb('0xf')](_0x360cf8));_0x2f3ecb(_0x360cf8);})[_0x56eb('0x1e')](function(_0x437518){logger[_0x56eb('0x10')](_0x56eb('0x15'),_0x437518['message'],_0x4d286b);_0x28d5ca(_0x26ccef['error'](0x1f4,_0x437518[_0x56eb('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x482dce){var _0x424a30=this;return new Promise(function(_0x4270b9,_0x50867d){return db[_0x56eb('0x1f')]['update'](_0x482dce['body'],{'raw':_0x482dce[_0x56eb('0x17')]?_0x482dce[_0x56eb('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x482dce['options']?_0x482dce[_0x56eb('0x17')][_0x56eb('0x18')]||null:null,'attributes':_0x482dce['options']?_0x482dce[_0x56eb('0x17')][_0x56eb('0x19')]||null:null,'limit':_0x482dce[_0x56eb('0x17')]?_0x482dce['options']['limit']||null:null})[_0x56eb('0xd')](function(_0x18f2f2){logger[_0x56eb('0x13')](_0x56eb('0x20'),_0x482dce);logger[_0x56eb('0x1d')](_0x56eb('0x20'),_0x482dce,JSON[_0x56eb('0xf')](_0x18f2f2));_0x4270b9(_0x18f2f2);})['catch'](function(_0x2b0e50){logger[_0x56eb('0x10')](_0x56eb('0x20'),_0x2b0e50[_0x56eb('0x11')],_0x482dce);_0x50867d(_0x424a30[_0x56eb('0x10')](0x1f4,_0x2b0e50[_0x56eb('0x11')]));});});};exports[_0x56eb('0x21')]=function(_0x58453a){var _0x8d7f75=this;return new Promise(function(_0x407823,_0xd49c37){return db['CmHopperBlack'][_0x56eb('0x22')]({'where':_0x58453a[_0x56eb('0x17')]?_0x58453a['options'][_0x56eb('0x18')]||null:null})['then'](function(_0x584367){logger['info']('DestroyCmHopperBlack',_0x58453a);logger['debug'](_0x56eb('0x21'),_0x58453a,JSON['stringify'](_0x584367));_0x407823(_0x584367);})['catch'](function(_0x5c9e44){logger[_0x56eb('0x10')](_0x56eb('0x21'),_0x5c9e44['message'],_0x58453a);_0xd49c37(_0x8d7f75[_0x56eb('0x10')](0x1f4,_0x5c9e44['message']));});});};
\ No newline at end of file
index b511354..5711ca5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id','show','put','update','delete','exports','multer','path','express','Router'];(function(_0x3b9973,_0xb2a8f8){var _0x4d2343=function(_0x15d676){while(--_0x15d676){_0x3b9973['push'](_0x3b9973['shift']());}};_0x4d2343(++_0xb2a8f8);}(_0x31f0,0xb7));var _0x031f=function(_0x5cebbc,_0x2de914){_0x5cebbc=_0x5cebbc-0x0;var _0x12b054=_0x31f0[_0x5cebbc];return _0x12b054;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x031f('0x8')]('/describe',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0x8')](_0x031f('0xb'),auth['isAuthenticated'](),controller[_0x031f('0xc')]);router[_0x031f('0xd')](_0x031f('0xb'),auth[_0x031f('0x9')](),controller[_0x031f('0xe')]);router[_0x031f('0xf')](_0x031f('0xb'),auth[_0x031f('0x9')](),controller['destroy']);module[_0x031f('0x10')]=router;
\ No newline at end of file
+var _0xb016=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','put','/:id','destroy'];(function(_0x15feb5,_0x47247d){var _0xc95c53=function(_0x291fd9){while(--_0x291fd9){_0x15feb5['push'](_0x15feb5['shift']());}};_0xc95c53(++_0x47247d);}(_0xb016,0x159));var _0x6b01=function(_0x13cf98,_0x5d4fbd){_0x13cf98=_0x13cf98-0x0;var _0x44bf0c=_0xb016[_0x13cf98];return _0x44bf0c;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller['update']);router['delete'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);module['exports']=router;
\ No newline at end of file
index 87e497f..727fa0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32cb=['followuptime','BOOLEAN','sequelize','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x32cb,0x1ea));var _0xb32c=function(_0x2d6c1a,_0x5e45d8){_0x2d6c1a=_0x2d6c1a-0x0;var _0x33cf4a=_0x32cb[_0x2d6c1a];return _0x33cf4a;};'use strict';var Sequelize=require(_0xb32c('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xb32c('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xb32c('0x2')]},'originatecalleridname':{'type':Sequelize[_0xb32c('0x2')]},'calleridnum':{'type':Sequelize[_0xb32c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb32c('0x3')]},'droptime':{'type':Sequelize[_0xb32c('0x3')]},'endtime':{'type':Sequelize[_0xb32c('0x3')]},'ringtime':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb32c('0x2')]},'campaigntype':{'type':Sequelize[_0xb32c('0x2')]},'membername':{'type':Sequelize[_0xb32c('0x2')]},'reason':{'type':Sequelize[_0xb32c('0x2')]},'disposition':{'type':Sequelize[_0xb32c('0x2')]},'secondDisposition':{'type':Sequelize[_0xb32c('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb32c('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x386221){var _0x72ce37=this[_0xb32c('0x4')](_0xb32c('0x5'));if(_0x72ce37&&_0x386221){this['setDataValue'](_0xb32c('0x6'),moment(_0x386221)['diff'](moment(_0x72ce37),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xb32c('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb32c('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb32c('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb32c('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xb32c('0x7')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb32c('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb32c('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2ce9=['diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime'];(function(_0x4542e2,_0x58e18c){var _0x203ebe=function(_0x597121){while(--_0x597121){_0x4542e2['push'](_0x4542e2['shift']());}};_0x203ebe(++_0x58e18c);}(_0x2ce9,0xed));var _0x92ce=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0x2ce9[_0x531e48];return _0x202971;};'use strict';var Sequelize=require(_0x92ce('0x0'));var moment=require(_0x92ce('0x1'));module[_0x92ce('0x2')]={'state':{'type':Sequelize[_0x92ce('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x92ce('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x92ce('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x92ce('0x5')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x92ce('0x5')]},'calleridname':{'type':Sequelize[_0x92ce('0x5')]},'starttime':{'type':Sequelize[_0x92ce('0x4')]},'responsetime':{'type':Sequelize[_0x92ce('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x92ce('0x4')]},'ringtime':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x92ce('0x5')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x92ce('0x5')]},'reason':{'type':Sequelize[_0x92ce('0x5')]},'disposition':{'type':Sequelize[_0x92ce('0x5')]},'secondDisposition':{'type':Sequelize[_0x92ce('0x5')]},'thirdDisposition':{'type':Sequelize[_0x92ce('0x5')]},'dispositionat':{'type':Sequelize[_0x92ce('0x4')],'set':function(_0x583d58){var _0x58fc2b=this[_0x92ce('0x6')](_0x92ce('0x7'));if(_0x58fc2b&&_0x583d58){this[_0x92ce('0x8')](_0x92ce('0x9'),moment(_0x583d58)[_0x92ce('0xa')](moment(_0x58fc2b),_0x92ce('0xb')));}return this[_0x92ce('0x8')]('dispositionat',_0x583d58);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x92ce('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x92ce('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x92ce('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x92ce('0x4')]},'callback':{'type':Sequelize[_0x92ce('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x92ce('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x92ce('0x4')]},'deleted':{'type':Sequelize[_0x92ce('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x92ce('0x4')]},'recallme':{'type':Sequelize[_0x92ce('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x92ce('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x92ce('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 48dc096..5b2d20a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4888=['ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','find','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','CmHopperFinal','includeAll','include','rows','catch','params','options','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','createdAt','updatedAt','select','field','ANY_VALUE(ContactId)','ContactId'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0x4888,0x198));var _0x8488=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0x4888[_0x1c8cc6];return _0x522936;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':!![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')]()[_0x8488('0x21')](respondWithResult(_0x1f0516,null))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x42')]=function(_0x886a9e,_0x299d8e){if(_0x886a9e[_0x8488('0x43')][_0x8488('0x44')]){delete _0x886a9e[_0x8488('0x43')][_0x8488('0x44')];}return db[_0x8488('0x3a')]['find']({'where':{'uniqueid':_0x886a9e['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x299d8e,null))[_0x8488('0x21')](saveUpdates(_0x886a9e[_0x8488('0x43')],null))[_0x8488('0x21')](respondWithResult(_0x299d8e,null))[_0x8488('0x3e')](handleError(_0x299d8e,null));};exports[_0x8488('0x45')]=function(_0x25f2dc,_0x27dfd2,_0x24fa20){return db['CmHopperFinal'][_0x8488('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x25f2dc[_0x8488('0x3f')]['id']},'attributes':[[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),_0x8488('0x4c')],[db['sequelize']['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),_0x8488('0x4d')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x4f')))),'dropContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x52')))),_0x8488('0x53')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x27dfd2,null))[_0x8488('0x21')](respondWithResult(_0x27dfd2,null))[_0x8488('0x3e')](handleError(_0x27dfd2,null));};exports[_0x8488('0x55')]=function(_0x1971f3,_0x24ba2d,_0x4facfb){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x1971f3[_0x8488('0x3f')]['id']},'attributes':[[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x56')))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x57')))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8488('0x58')],[db[_0x8488('0x48')]['fn']('COUNT',db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x24ba2d,null))['then'](respondWithResult(_0x24ba2d,null))[_0x8488('0x3e')](handleError(_0x24ba2d,null));};exports[_0x8488('0x59')]=function(_0x44a50b,_0x5815cb,_0xbee86e){return db[_0x8488('0x5a')]['find']({'where':{'id':_0x44a50b['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x5815cb,null))[_0x8488('0x21')](function(_0xfedfd2){var _0x3ab1b6;if(_0xfedfd2){_0x3ab1b6=squel[_0x8488('0x5b')]()[_0x8488('0x5c')](_0x8488('0x5d'))[_0x8488('0x5e')]([_0x8488('0x5f'),_0x8488('0x60'),'ContactId',_0x8488('0x61'),'VoiceQueueId',_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')]('ANY_VALUE(calleridnum)',_0x8488('0x5f'))[_0x8488('0x65')]('NOW()',_0x8488('0x60'))['field'](_0x8488('0x66'),_0x8488('0x67'))[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x69'),_0x8488('0x6a'))['field'](_0x8488('0x6b'),'createdAt')['field'](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']())[_0x8488('0x35')](_0x8488('0x6e'),_0x44a50b[_0x8488('0x43')][_0x8488('0x6f')][_0x8488('0x70')]())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8488('0x35')](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x72'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x73')))[_0x8488('0x74')]('ContactId'))[_0x8488('0x70')]();return db['sequelize'][_0x8488('0x2c')](_0x3ab1b6);}return[];})['then'](respondWithResult(_0x5815cb,null))[_0x8488('0x3e')](handleError(_0x5815cb,null));};exports[_0x8488('0x75')]=function(_0x267401,_0x1e635a,_0x31ab35){return db[_0x8488('0x76')][_0x8488('0x77')]({'where':{'id':_0x267401[_0x8488('0x3f')]['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x1e635a,null))[_0x8488('0x21')](function(_0xce1d1a){var _0xc9c221;if(_0xce1d1a){_0xc9c221=squel[_0x8488('0x5b')]()[_0x8488('0x5c')]('cm_hopper')[_0x8488('0x5e')]([_0x8488('0x5f'),'scheduledAt',_0x8488('0x67'),_0x8488('0x61'),_0x8488('0x78'),_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x79'),_0x8488('0x5f'))[_0x8488('0x65')](_0x8488('0x6b'),'scheduledAt')[_0x8488('0x65')](_0x8488('0x66'),'ContactId')[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x7a'),'CampaignId')['field'](_0x8488('0x6b'),_0x8488('0x62'))[_0x8488('0x65')](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')](_0x8488('0x7b'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x6e'),_0x267401[_0x8488('0x43')][_0x8488('0x6f')]['toString']())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x72'))[_0x8488('0x6c')](_0x8488('0x7b'))['where'](_0x8488('0x7c'),_0x267401['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')]('state\x20=\x204'))['group'](_0x8488('0x67')))[_0x8488('0x70')]();return db[_0x8488('0x48')][_0x8488('0x2c')](_0xc9c221);}return[];})[_0x8488('0x21')](respondWithResult(_0x1e635a,null))['catch'](handleError(_0x1e635a,null));};exports[_0x8488('0x7d')]=function(_0x19c5c6,_0x50f773,_0x52c750){return db[_0x8488('0x7e')][_0x8488('0x7f')]({'where':{'VoiceQueueId':_0x19c5c6[_0x8488('0x43')]['VoiceQueueId'],'CampaignId':_0x19c5c6['body'][_0x8488('0x78')],'ContactId':_0x19c5c6[_0x8488('0x43')][_0x8488('0x67')]}})['then'](handleEntityNotFound(_0x50f773,null))[_0x8488('0x21')](function(_0x1e4e51){if(_0x1e4e51){return _0x1e4e51;}return null;})[_0x8488('0x21')](respondWithResult(_0x50f773,null))[_0x8488('0x3e')](handleError(_0x50f773,null));};
\ No newline at end of file
+var _0x4975=['ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','CmHopperFinal','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','noAnswerContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','phone','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','select'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4975,0x86));var _0x5497=function(_0x304ab8,_0xdcc6b5){_0x304ab8=_0x304ab8-0x0;var _0xb8e611=_0x4975[_0x304ab8];return _0xb8e611;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['CmHopperFinal'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['describe']()[_0x5497('0x24')](respondWithResult(_0x466287,null))[_0x5497('0x40')](handleError(_0x466287,null));};exports[_0x5497('0x23')]=function(_0x52a189,_0x3e4da2){if(_0x52a189['body'][_0x5497('0x46')]){delete _0x52a189[_0x5497('0x47')][_0x5497('0x46')];}return db['CmHopperFinal'][_0x5497('0x44')]({'where':{'uniqueid':_0x52a189[_0x5497('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e4da2,null))[_0x5497('0x24')](saveUpdates(_0x52a189['body'],null))[_0x5497('0x24')](respondWithResult(_0x3e4da2,null))['catch'](handleError(_0x3e4da2,null));};exports[_0x5497('0x48')]=function(_0x400860,_0x26fd9f,_0xf07541){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x400860[_0x5497('0x42')]['id']},'attributes':[[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize'][_0x5497('0x4d')]('`state`\x20=\x208,\x201,\x20null'))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x50')))),_0x5497('0x51')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x52')))),_0x5497('0x53')],[db['sequelize']['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x56')))),_0x5497('0x57')]]})[_0x5497('0x24')](handleEntityNotFound(_0x26fd9f,null))[_0x5497('0x24')](respondWithResult(_0x26fd9f,null))[_0x5497('0x40')](handleError(_0x26fd9f,null));};exports[_0x5497('0x58')]=function(_0x573f93,_0x18b30c,_0x3b0350){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'CampaignId':_0x573f93['params']['id']},'attributes':[[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x59')))),_0x5497('0x5a')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x5b')))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5497('0x51')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5497('0x53')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x56')))),_0x5497('0x57')]]})['then'](handleEntityNotFound(_0x18b30c,null))[_0x5497('0x24')](respondWithResult(_0x18b30c,null))[_0x5497('0x40')](handleError(_0x18b30c,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){return db[_0x5497('0x5d')][_0x5497('0x44')]({'where':{'id':_0x4ef195['params']['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x24')](function(_0x21c715){var _0x286af8;if(_0x21c715){_0x286af8=squel['insert']()[_0x5497('0x5e')](_0x5497('0x5f'))[_0x5497('0x60')](['phone',_0x5497('0x61'),_0x5497('0x62'),'ListId',_0x5497('0x63'),_0x5497('0x64'),_0x5497('0x65')],squel['select']()['field'](_0x5497('0x66'),_0x5497('0x67'))[_0x5497('0x68')](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x6d'),_0x5497('0x63'))[_0x5497('0x68')]('NOW()',_0x5497('0x64'))[_0x5497('0x68')]('NOW()',_0x5497('0x65'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4ef195[_0x5497('0x47')][_0x5497('0x73')]['toString']())[_0x5497('0x37')](_0x5497('0x74'))[_0x5497('0x37')](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x67'))['from'](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195[_0x5497('0x42')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5497('0x76'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id']['toString']())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x286af8);}return[];})[_0x5497('0x24')](respondWithResult(_0x5794ff,null))[_0x5497('0x40')](handleError(_0x5794ff,null));};exports[_0x5497('0x79')]=function(_0x4c41c4,_0x1515f1,_0x4118ec){return db[_0x5497('0x7a')][_0x5497('0x44')]({'where':{'id':_0x4c41c4[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x1515f1,null))['then'](function(_0x1ef7fc){var _0x5903b7;if(_0x1ef7fc){_0x5903b7=squel[_0x5497('0x7b')]()[_0x5497('0x5e')](_0x5497('0x5f'))['fromQuery'](['phone',_0x5497('0x61'),_0x5497('0x62'),_0x5497('0x6c'),_0x5497('0x7c'),_0x5497('0x64'),_0x5497('0x65')],squel[_0x5497('0x7d')]()[_0x5497('0x68')]('ANY_VALUE(calleridnum)','phone')['field'](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x7e'),_0x5497('0x7c'))[_0x5497('0x68')](_0x5497('0x69'),'createdAt')['field']('NOW()','updatedAt')['from'](_0x5497('0x6f'))['where'](_0x5497('0x7f'),_0x4c41c4['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4c41c4[_0x5497('0x47')][_0x5497('0x73')][_0x5497('0x71')]())['where'](_0x5497('0x74'))['where'](_0x5497('0x75'),squel[_0x5497('0x7d')]()[_0x5497('0x68')](_0x5497('0x67'))[_0x5497('0x6e')](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]()))['where'](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x76'))['from'](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x5903b7);}return[];})[_0x5497('0x24')](respondWithResult(_0x1515f1,null))[_0x5497('0x40')](handleError(_0x1515f1,null));};exports['checkContactHopper']=function(_0x37c17e,_0x163b5b,_0x3a31be){return db[_0x5497('0x80')][_0x5497('0x81')]({'where':{'VoiceQueueId':_0x37c17e['body'][_0x5497('0x63')],'CampaignId':_0x37c17e[_0x5497('0x47')]['CampaignId'],'ContactId':_0x37c17e['body'][_0x5497('0x62')]}})[_0x5497('0x24')](handleEntityNotFound(_0x163b5b,null))[_0x5497('0x24')](function(_0x14f693){if(_0x14f693){return _0x14f693;}return null;})[_0x5497('0x24')](respondWithResult(_0x163b5b,null))['catch'](handleError(_0x163b5b,null));};
\ No newline at end of file
index 57eb1fa..9225b26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9233=['calleridnum','uniqueid','lodash','util','api','bluebird','request-promise','path','./cmHopperFinal.attributes','exports','CmHopperFinal'];(function(_0x983dc2,_0x5cca11){var _0x4b0315=function(_0x1042f9){while(--_0x1042f9){_0x983dc2['push'](_0x983dc2['shift']());}};_0x4b0315(++_0x5cca11);}(_0x9233,0xe9));var _0x3923=function(_0x37fdf7,_0x201f20){_0x37fdf7=_0x37fdf7-0x0;var _0x1edb3b=_0x9233[_0x37fdf7];return _0x1edb3b;};'use strict';var _=require(_0x3923('0x0'));var util=require(_0x3923('0x1'));var logger=require('../../config/logger')(_0x3923('0x2'));var moment=require('moment');var BPromise=require(_0x3923('0x3'));var rp=require(_0x3923('0x4'));var fs=require('fs');var path=require(_0x3923('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3923('0x6'));module[_0x3923('0x7')]=function(_0x1b7d4a,_0xb38cdd){return _0x1b7d4a['define'](_0x3923('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x3923('0x9'),'fields':[_0x3923('0x9')]},{'name':_0x3923('0xa'),'fields':[_0x3923('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7248=['rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2b5c60,_0xddad37){var _0x40ef50=function(_0x103b03){while(--_0x103b03){_0x2b5c60['push'](_0x2b5c60['shift']());}};_0x40ef50(++_0xddad37);}(_0x7248,0x170));var _0x8724=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7248[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x8724('0x0'));var util=require(_0x8724('0x1'));var logger=require(_0x8724('0x2'))(_0x8724('0x3'));var moment=require(_0x8724('0x4'));var BPromise=require(_0x8724('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8724('0x6'));var rimraf=require(_0x8724('0x7'));var config=require('../../config/environment');var attributes=require(_0x8724('0x8'));module[_0x8724('0x9')]=function(_0x51f87c,_0x563338){return _0x51f87c[_0x8724('0xa')](_0x8724('0xb'),attributes,{'tableName':_0x8724('0xc'),'paranoid':![],'indexes':[{'name':_0x8724('0xd'),'fields':[_0x8724('0xd')]},{'name':_0x8724('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index d1997b9..77abab1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x2cd959,_0x196f29){var _0x1f4ae7=function(_0x476160){while(--_0x476160){_0x2cd959['push'](_0x2cd959['shift']());}};_0x1f4ae7(++_0x196f29);}(_0xb10b,0x12a));var _0xbb10=function(_0x2074fb,_0x26707f){_0x2074fb=_0x2074fb-0x0;var _0x4c71d3=_0xb10b[_0x2074fb];return _0x4c71d3;};'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
+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(_0x53f9ef,_0xe1f0ad){var _0x575bed=function(_0x83e365){while(--_0x83e365){_0x53f9ef['push'](_0x53f9ef['shift']());}};_0x575bed(++_0xe1f0ad);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xb10b[_0x4b91c4];return _0x25cb80;};'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 211545b..15bad91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3383=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10efa4,_0x101b65){var _0x545f7a=function(_0x252aaa){while(--_0x252aaa){_0x10efa4['push'](_0x10efa4['shift']());}};_0x545f7a(++_0x101b65);}(_0x3383,0x1cd));var _0x3338=function(_0x1e3482,_0x398e7f){_0x1e3482=_0x1e3482-0x0;var _0x6da1bd=_0x3383[_0x1e3482];return _0x6da1bd;};'use strict';var multer=require(_0x3338('0x0'));var util=require(_0x3338('0x1'));var path=require('path');var timeout=require(_0x3338('0x2'));var express=require(_0x3338('0x3'));var router=express[_0x3338('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3338('0x5'));var interaction=require(_0x3338('0x6'));var config=require(_0x3338('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x3338('0x8')]('/',auth[_0x3338('0x9')](),controller['index']);router[_0x3338('0x8')](_0x3338('0xa'),auth[_0x3338('0x9')](),controller[_0x3338('0xb')]);router[_0x3338('0x8')](_0x3338('0xc'),auth[_0x3338('0x9')](),controller[_0x3338('0xd')]);router[_0x3338('0x8')](_0x3338('0xe'),auth[_0x3338('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x3338('0x8')](_0x3338('0xf'),auth[_0x3338('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x3338('0x10'),auth[_0x3338('0x9')](),controller[_0x3338('0x11')]);router[_0x3338('0x12')](_0x3338('0x13'),auth['isAuthenticated'](),controller[_0x3338('0x14')]);router['post'](_0x3338('0x15'),auth[_0x3338('0x9')](),controller[_0x3338('0x16')]);router[_0x3338('0x17')](_0x3338('0xc'),auth[_0x3338('0x9')](),controller[_0x3338('0x18')]);module[_0x3338('0x19')]=router;
\ No newline at end of file
+var _0x038f=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','multer','util','path','express','Router','fs-extra','../../components/auth/service','./cmHopperFinal.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x41cdde,_0x4bd78c){var _0x2dec1e=function(_0xc4e978){while(--_0xc4e978){_0x41cdde['push'](_0x41cdde['shift']());}};_0x2dec1e(++_0x4bd78c);}(_0x038f,0x106));var _0xf038=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0x038f[_0x44fef1];return _0x3c3a04;};'use strict';var multer=require(_0xf038('0x0'));var util=require(_0xf038('0x1'));var path=require(_0xf038('0x2'));var timeout=require('connect-timeout');var express=require(_0xf038('0x3'));var router=express[_0xf038('0x4')]();var fs_extra=require(_0xf038('0x5'));var auth=require(_0xf038('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf038('0x7'));router[_0xf038('0x8')]('/',auth[_0xf038('0x9')](),controller[_0xf038('0xa')]);router[_0xf038('0x8')]('/describe',auth[_0xf038('0x9')](),controller[_0xf038('0xb')]);router['get'](_0xf038('0xc'),auth[_0xf038('0x9')](),controller[_0xf038('0xd')]);router['get']('/voice/queue/countAttributes/:id',auth[_0xf038('0x9')](),controller[_0xf038('0xe')]);router[_0xf038('0x8')](_0xf038('0xf'),auth[_0xf038('0x9')](),controller[_0xf038('0x10')]);router[_0xf038('0x11')](_0xf038('0x12'),auth['isAuthenticated'](),controller[_0xf038('0x13')]);router[_0xf038('0x11')](_0xf038('0x14'),auth[_0xf038('0x9')](),controller[_0xf038('0x15')]);router[_0xf038('0x11')](_0xf038('0x16'),auth[_0xf038('0x9')](),controller['checkContactHopper']);router['put'](_0xf038('0xc'),auth['isAuthenticated'](),controller['update']);module['exports']=router;
\ No newline at end of file
index bdee827..9d4620d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c7f=['BOOLEAN','sequelize','exports','DATE','INTEGER','STRING'];(function(_0x33ad1f,_0xfc2fc8){var _0x26ef22=function(_0x58f97c){while(--_0x58f97c){_0x33ad1f['push'](_0x33ad1f['shift']());}};_0x26ef22(++_0xfc2fc8);}(_0x7c7f,0x163));var _0xf7c7=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x7c7f[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require(_0xf7c7('0x0'));module[_0xf7c7('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf7c7('0x2')]},'countbusyretry':{'type':Sequelize[_0xf7c7('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf7c7('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf7c7('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf7c7('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf7c7('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xf7c7('0x2')]},'answertime':{'type':Sequelize[_0xf7c7('0x2')]},'droptime':{'type':Sequelize[_0xf7c7('0x2')]},'endtime':{'type':Sequelize[_0xf7c7('0x2')]},'ringtime':{'type':Sequelize[_0xf7c7('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf7c7('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf7c7('0x4')]},'campaign':{'type':Sequelize[_0xf7c7('0x4')]},'campaigntype':{'type':Sequelize[_0xf7c7('0x4')]},'membername':{'type':Sequelize[_0xf7c7('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xf7c7('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf7c7('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xf7c7('0x2')]},'edited':{'type':Sequelize[_0xf7c7('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xf7c7('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf7c7('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf7c7('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x75d9=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x75d9,0x162));var _0x975d=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0x75d9[_0x1e5cc3];return _0x15c596;};'use strict';var Sequelize=require(_0x975d('0x0'));module[_0x975d('0x1')]={'state':{'type':Sequelize[_0x975d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x975d('0x3')]},'scheduledat':{'type':Sequelize[_0x975d('0x4')]},'countbusyretry':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x975d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x975d('0x3')]},'originatecalleridname':{'type':Sequelize[_0x975d('0x3')]},'calleridnum':{'type':Sequelize[_0x975d('0x3')]},'calleridname':{'type':Sequelize[_0x975d('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x975d('0x4')]},'answertime':{'type':Sequelize[_0x975d('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x975d('0x4')]},'ringtime':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x975d('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x975d('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x975d('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x975d('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x975d('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x975d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x975d('0x4')]},'recallme':{'type':Sequelize[_0x975d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x975d('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x975d('0x3')]}};
\ No newline at end of file
index d113e3b..9d9730a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc96=['show','params','length','find','create','body','describe','uniqueid','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter','merge','map','options','CmHopperHistory','includeAll','include','findAll','rows','catch'];(function(_0x2149d4,_0x836230){var _0x9c283e=function(_0x476d67){while(--_0x476d67){_0x2149d4['push'](_0x2149d4['shift']());}};_0x9c283e(++_0x836230);}(_0xcc96,0xe0));var _0x6cc9=function(_0x286404,_0x293fa6){_0x286404=_0x286404-0x0;var _0x2aa821=_0xcc96[_0x286404];return _0x2aa821;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cc9('0x0'));var zipdir=require(_0x6cc9('0x1'));var jsonpatch=require(_0x6cc9('0x2'));var rp=require(_0x6cc9('0x3'));var moment=require(_0x6cc9('0x4'));var BPromise=require(_0x6cc9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6cc9('0x6'));var sox=require('sox');var csv=require(_0x6cc9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cc9('0x8'));var _=require(_0x6cc9('0x9'));var squel=require('squel');var crypto=require(_0x6cc9('0xa'));var jsforce=require(_0x6cc9('0xb'));var deskjs=require(_0x6cc9('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6cc9('0xd'));var Redis=require('ioredis');var authService=require(_0x6cc9('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6cc9('0xf'));var hardwareService=require(_0x6cc9('0x10'));var logger=require('../../config/logger')(_0x6cc9('0x11'));var utils=require('../../config/utils');var config=require(_0x6cc9('0x12'));var licenseUtil=require(_0x6cc9('0x13'));var db=require(_0x6cc9('0x14'))['db'];function respondWithStatusCode(_0x104552,_0xb4128){_0xb4128=_0xb4128||0xcc;return function(_0x2c67e0){if(_0x2c67e0){return _0x104552[_0x6cc9('0x15')](_0xb4128);}return _0x104552[_0x6cc9('0x16')](_0xb4128)[_0x6cc9('0x17')]();};}function respondWithResult(_0x621c84,_0x26186a){_0x26186a=_0x26186a||0xc8;return function(_0x526abb){if(_0x526abb){return _0x621c84['status'](_0x26186a)[_0x6cc9('0x18')](_0x526abb);}};}function respondWithFilteredResult(_0x2ceacd,_0x1cf8f4){return function(_0x4a4214){if(_0x4a4214){var _0x3476d3=typeof _0x1cf8f4[_0x6cc9('0x19')]===_0x6cc9('0x1a')&&typeof _0x1cf8f4['limit']===_0x6cc9('0x1a');var _0x56359b=_0x4a4214['count'];var _0x1bfe5e=_0x3476d3?0x0:_0x1cf8f4['offset'];var _0x234197=_0x3476d3?_0x4a4214[_0x6cc9('0x1b')]:_0x1cf8f4['offset']+_0x1cf8f4[_0x6cc9('0x1c')];var _0x2b99b7;if(_0x234197>=_0x56359b){_0x234197=_0x56359b;_0x2b99b7=0xc8;}else{_0x2b99b7=0xce;}_0x2ceacd[_0x6cc9('0x16')](_0x2b99b7);return _0x2ceacd['set'](_0x6cc9('0x1d'),_0x1bfe5e+'-'+_0x234197+'/'+_0x56359b)[_0x6cc9('0x18')](_0x4a4214);}return null;};}function patchUpdates(_0x3196fc){return function(_0x1bb4e7){try{jsonpatch[_0x6cc9('0x1e')](_0x1bb4e7,_0x3196fc,!![]);}catch(_0xdaf160){return BPromise['reject'](_0xdaf160);}return _0x1bb4e7['save']();};}function saveUpdates(_0x3fff40,_0x26ac18){return function(_0x66387c){if(_0x66387c){return _0x66387c[_0x6cc9('0x1f')](_0x3fff40)[_0x6cc9('0x20')](function(_0x5e2424){return _0x5e2424;});}return null;};}function removeEntity(_0x27191d,_0x3230f2){return function(_0x3ac64d){if(_0x3ac64d){return _0x3ac64d[_0x6cc9('0x21')]()[_0x6cc9('0x20')](function(){_0x27191d[_0x6cc9('0x16')](0xcc)[_0x6cc9('0x17')]();});}};}function handleEntityNotFound(_0xb0df55,_0x2bbe48){return function(_0x3a73c1){if(!_0x3a73c1){_0xb0df55['sendStatus'](0x194);}return _0x3a73c1;};}function handleError(_0x3f5bee,_0x5583a8){_0x5583a8=_0x5583a8||0x1f4;return function(_0x56dc32){logger[_0x6cc9('0x22')](_0x56dc32[_0x6cc9('0x23')]);if(_0x56dc32[_0x6cc9('0x24')]){delete _0x56dc32[_0x6cc9('0x24')];}_0x3f5bee['status'](_0x5583a8)[_0x6cc9('0x25')](_0x56dc32);};}exports[_0x6cc9('0x26')]=function(_0x369a70,_0x52b08d){var _0x2ba47b={},_0x2b0422={},_0x471adc={'count':0x0,'rows':[]};var _0xc0803d=_['map'](db['CmHopperHistory'][_0x6cc9('0x27')],function(_0x3de99a){return{'name':_0x3de99a[_0x6cc9('0x28')],'type':_0x3de99a[_0x6cc9('0x29')][_0x6cc9('0x2a')]};});_0x2b0422[_0x6cc9('0x2b')]=_['map'](_0xc0803d,'name');_0x2b0422[_0x6cc9('0x2c')]=_[_0x6cc9('0x2d')](_0x369a70['query']);_0x2b0422['filters']=_['intersection'](_0x2b0422[_0x6cc9('0x2b')],_0x2b0422[_0x6cc9('0x2c')]);_0x2ba47b[_0x6cc9('0x2e')]=_[_0x6cc9('0x2f')](_0x2b0422[_0x6cc9('0x2b')],qs[_0x6cc9('0x30')](_0x369a70[_0x6cc9('0x2c')][_0x6cc9('0x30')]));_0x2ba47b['attributes']=_0x2ba47b[_0x6cc9('0x2e')]['length']?_0x2ba47b[_0x6cc9('0x2e')]:_0x2b0422[_0x6cc9('0x2b')];if(!_0x369a70['query']['hasOwnProperty'](_0x6cc9('0x31'))){_0x2ba47b[_0x6cc9('0x1c')]=qs[_0x6cc9('0x1c')](_0x369a70['query'][_0x6cc9('0x1c')]);_0x2ba47b[_0x6cc9('0x19')]=qs['offset'](_0x369a70['query'][_0x6cc9('0x19')]);}_0x2ba47b['order']=qs[_0x6cc9('0x32')](_0x369a70[_0x6cc9('0x2c')]['sort']);_0x2ba47b[_0x6cc9('0x33')]=qs[_0x6cc9('0x34')](_[_0x6cc9('0x35')](_0x369a70[_0x6cc9('0x2c')],_0x2b0422[_0x6cc9('0x34')]),_0xc0803d);if(_0x369a70[_0x6cc9('0x2c')][_0x6cc9('0x36')]){_0x2ba47b['where']=_[_0x6cc9('0x37')](_0x2ba47b[_0x6cc9('0x33')],{'$or':_[_0x6cc9('0x38')](_0xc0803d,function(_0x2cc9f1){if(_0x2cc9f1[_0x6cc9('0x29')]!=='VIRTUAL'){var _0x4bde9d={};_0x4bde9d[_0x2cc9f1[_0x6cc9('0x24')]]={'$like':'%'+_0x369a70[_0x6cc9('0x2c')][_0x6cc9('0x36')]+'%'};return _0x4bde9d;}})});}_0x2ba47b=_[_0x6cc9('0x37')]({},_0x2ba47b,_0x369a70[_0x6cc9('0x39')]);var _0x591a7e={'where':_0x2ba47b['where']};return db[_0x6cc9('0x3a')][_0x6cc9('0x1b')](_0x591a7e)[_0x6cc9('0x20')](function(_0x5ddc19){_0x471adc['count']=_0x5ddc19;if(_0x369a70[_0x6cc9('0x2c')][_0x6cc9('0x3b')]){_0x2ba47b[_0x6cc9('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x6cc9('0x3d')](_0x2ba47b);})['then'](function(_0x33394e){_0x471adc[_0x6cc9('0x3e')]=_0x33394e;return _0x471adc;})[_0x6cc9('0x20')](respondWithFilteredResult(_0x52b08d,_0x2ba47b))[_0x6cc9('0x3f')](handleError(_0x52b08d,null));};exports[_0x6cc9('0x40')]=function(_0x18f857,_0x7f65c){var _0x46720c={'raw':!![],'where':{'id':_0x18f857[_0x6cc9('0x41')]['id']}},_0x1d93ba={};_0x1d93ba[_0x6cc9('0x2b')]=_[_0x6cc9('0x2d')](db['CmHopperHistory']['rawAttributes']);_0x1d93ba[_0x6cc9('0x2c')]=_[_0x6cc9('0x2d')](_0x18f857[_0x6cc9('0x2c')]);_0x1d93ba['filters']=_[_0x6cc9('0x2f')](_0x1d93ba['model'],_0x1d93ba[_0x6cc9('0x2c')]);_0x46720c[_0x6cc9('0x2e')]=_[_0x6cc9('0x2f')](_0x1d93ba['model'],qs[_0x6cc9('0x30')](_0x18f857['query'][_0x6cc9('0x30')]));_0x46720c['attributes']=_0x46720c[_0x6cc9('0x2e')][_0x6cc9('0x42')]?_0x46720c[_0x6cc9('0x2e')]:_0x1d93ba[_0x6cc9('0x2b')];if(_0x18f857['query']['includeAll']){_0x46720c[_0x6cc9('0x3c')]=[{'all':!![]}];}_0x46720c=_[_0x6cc9('0x37')]({},_0x46720c,_0x18f857['options']);return db[_0x6cc9('0x3a')][_0x6cc9('0x43')](_0x46720c)['then'](handleEntityNotFound(_0x7f65c,null))[_0x6cc9('0x20')](respondWithResult(_0x7f65c,null))[_0x6cc9('0x3f')](handleError(_0x7f65c,null));};exports[_0x6cc9('0x44')]=function(_0x471a67,_0x4fc60e){return db[_0x6cc9('0x3a')]['create'](_0x471a67[_0x6cc9('0x45')],{})[_0x6cc9('0x20')](respondWithResult(_0x4fc60e,0xc9))[_0x6cc9('0x3f')](handleError(_0x4fc60e,null));};exports[_0x6cc9('0x46')]=function(_0x19c2ab,_0x2e1e7e){return db[_0x6cc9('0x3a')][_0x6cc9('0x46')]()[_0x6cc9('0x20')](respondWithResult(_0x2e1e7e,null))[_0x6cc9('0x3f')](handleError(_0x2e1e7e,null));};exports['update']=function(_0x5d8765,_0x2b5cab){if(_0x5d8765[_0x6cc9('0x45')][_0x6cc9('0x47')]){delete _0x5d8765[_0x6cc9('0x45')][_0x6cc9('0x47')];}return db[_0x6cc9('0x3a')][_0x6cc9('0x43')]({'where':{'uniqueid':_0x5d8765[_0x6cc9('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b5cab,null))[_0x6cc9('0x20')](saveUpdates(_0x5d8765[_0x6cc9('0x45')],null))[_0x6cc9('0x20')](respondWithResult(_0x2b5cab,null))[_0x6cc9('0x3f')](handleError(_0x2b5cab,null));};
\ No newline at end of file
+var _0x1064=['describe','catch','body','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','update','destroy','then','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','keys','merge','create'];(function(_0x38813e,_0x23c271){var _0x2e968e=function(_0x36e6b1){while(--_0x36e6b1){_0x38813e['push'](_0x38813e['shift']());}};_0x2e968e(++_0x23c271);}(_0x1064,0x18b));var _0x4106=function(_0x5bfabd,_0x55619d){_0x5bfabd=_0x5bfabd-0x0;var _0x564b3c=_0x1064[_0x5bfabd];return _0x564b3c;};'use strict';var emlformat=require(_0x4106('0x0'));var rimraf=require(_0x4106('0x1'));var zipdir=require(_0x4106('0x2'));var jsonpatch=require(_0x4106('0x3'));var rp=require(_0x4106('0x4'));var moment=require(_0x4106('0x5'));var BPromise=require(_0x4106('0x6'));var Mustache=require(_0x4106('0x7'));var util=require('util');var path=require(_0x4106('0x8'));var sox=require(_0x4106('0x9'));var csv=require('to-csv');var ejs=require(_0x4106('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4106('0xb'));var squel=require(_0x4106('0xc'));var crypto=require(_0x4106('0xd'));var jsforce=require(_0x4106('0xe'));var deskjs=require(_0x4106('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4106('0x10'));var Redis=require(_0x4106('0x11'));var authService=require(_0x4106('0x12'));var qs=require(_0x4106('0x13'));var as=require(_0x4106('0x14'));var hardwareService=require(_0x4106('0x15'));var logger=require('../../config/logger')(_0x4106('0x16'));var utils=require(_0x4106('0x17'));var config=require(_0x4106('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4106('0x19'))['db'];function respondWithStatusCode(_0x556134,_0x3d33c8){_0x3d33c8=_0x3d33c8||0xcc;return function(_0xfdc16b){if(_0xfdc16b){return _0x556134[_0x4106('0x1a')](_0x3d33c8);}return _0x556134['status'](_0x3d33c8)[_0x4106('0x1b')]();};}function respondWithResult(_0x3e2593,_0x29315a){_0x29315a=_0x29315a||0xc8;return function(_0x1bac31){if(_0x1bac31){return _0x3e2593[_0x4106('0x1c')](_0x29315a)['json'](_0x1bac31);}};}function respondWithFilteredResult(_0x5658fe,_0x7f261e){return function(_0x565cb5){if(_0x565cb5){var _0x46b685=typeof _0x7f261e[_0x4106('0x1d')]===_0x4106('0x1e')&&typeof _0x7f261e[_0x4106('0x1f')]===_0x4106('0x1e');var _0x2b1b48=_0x565cb5['count'];var _0x2aeabe=_0x46b685?0x0:_0x7f261e['offset'];var _0x5106fb=_0x46b685?_0x565cb5[_0x4106('0x20')]:_0x7f261e[_0x4106('0x1d')]+_0x7f261e[_0x4106('0x1f')];var _0x39870d;if(_0x5106fb>=_0x2b1b48){_0x5106fb=_0x2b1b48;_0x39870d=0xc8;}else{_0x39870d=0xce;}_0x5658fe['status'](_0x39870d);return _0x5658fe[_0x4106('0x21')]('Content-Range',_0x2aeabe+'-'+_0x5106fb+'/'+_0x2b1b48)[_0x4106('0x22')](_0x565cb5);}return null;};}function patchUpdates(_0x3cdaf6){return function(_0x7e6e36){try{jsonpatch['apply'](_0x7e6e36,_0x3cdaf6,!![]);}catch(_0x4840b1){return BPromise[_0x4106('0x23')](_0x4840b1);}return _0x7e6e36[_0x4106('0x24')]();};}function saveUpdates(_0x152eb8,_0x5a1336){return function(_0x325a61){if(_0x325a61){return _0x325a61[_0x4106('0x25')](_0x152eb8)['then'](function(_0x1a77b9){return _0x1a77b9;});}return null;};}function removeEntity(_0x285c00,_0x1af18d){return function(_0x356c8b){if(_0x356c8b){return _0x356c8b[_0x4106('0x26')]()[_0x4106('0x27')](function(){_0x285c00[_0x4106('0x1c')](0xcc)[_0x4106('0x1b')]();});}};}function handleEntityNotFound(_0x54304c,_0x21c595){return function(_0x480279){if(!_0x480279){_0x54304c['sendStatus'](0x194);}return _0x480279;};}function handleError(_0x52ccd4,_0x4ecc44){_0x4ecc44=_0x4ecc44||0x1f4;return function(_0x1dd3a3){logger['error'](_0x1dd3a3[_0x4106('0x28')]);if(_0x1dd3a3[_0x4106('0x29')]){delete _0x1dd3a3['name'];}_0x52ccd4['status'](_0x4ecc44)[_0x4106('0x2a')](_0x1dd3a3);};}exports[_0x4106('0x2b')]=function(_0x1df01d,_0x12e790){var _0x22209a={},_0x85bb65={},_0x69d31b={'count':0x0,'rows':[]};var _0x2d78b3=_[_0x4106('0x2c')](db[_0x4106('0x2d')][_0x4106('0x2e')],function(_0x532eb1){return{'name':_0x532eb1[_0x4106('0x2f')],'type':_0x532eb1[_0x4106('0x30')][_0x4106('0x31')]};});_0x85bb65[_0x4106('0x32')]=_[_0x4106('0x2c')](_0x2d78b3,_0x4106('0x29'));_0x85bb65[_0x4106('0x33')]=_['keys'](_0x1df01d[_0x4106('0x33')]);_0x85bb65[_0x4106('0x34')]=_[_0x4106('0x35')](_0x85bb65[_0x4106('0x32')],_0x85bb65[_0x4106('0x33')]);_0x22209a[_0x4106('0x36')]=_['intersection'](_0x85bb65['model'],qs[_0x4106('0x37')](_0x1df01d[_0x4106('0x33')]['fields']));_0x22209a['attributes']=_0x22209a[_0x4106('0x36')][_0x4106('0x38')]?_0x22209a[_0x4106('0x36')]:_0x85bb65[_0x4106('0x32')];if(!_0x1df01d[_0x4106('0x33')]['hasOwnProperty'](_0x4106('0x39'))){_0x22209a['limit']=qs[_0x4106('0x1f')](_0x1df01d[_0x4106('0x33')][_0x4106('0x1f')]);_0x22209a[_0x4106('0x1d')]=qs['offset'](_0x1df01d[_0x4106('0x33')][_0x4106('0x1d')]);}_0x22209a[_0x4106('0x3a')]=qs['sort'](_0x1df01d[_0x4106('0x33')][_0x4106('0x3b')]);_0x22209a[_0x4106('0x3c')]=qs[_0x4106('0x34')](_[_0x4106('0x3d')](_0x1df01d[_0x4106('0x33')],_0x85bb65[_0x4106('0x34')]),_0x2d78b3);if(_0x1df01d[_0x4106('0x33')][_0x4106('0x3e')]){_0x22209a[_0x4106('0x3c')]=_['merge'](_0x22209a[_0x4106('0x3c')],{'$or':_[_0x4106('0x2c')](_0x2d78b3,function(_0x464127){if(_0x464127['type']!==_0x4106('0x3f')){var _0x97bd5a={};_0x97bd5a[_0x464127[_0x4106('0x29')]]={'$like':'%'+_0x1df01d[_0x4106('0x33')][_0x4106('0x3e')]+'%'};return _0x97bd5a;}})});}_0x22209a=_['merge']({},_0x22209a,_0x1df01d[_0x4106('0x40')]);var _0x1a1bc9={'where':_0x22209a[_0x4106('0x3c')]};return db['CmHopperHistory'][_0x4106('0x20')](_0x1a1bc9)[_0x4106('0x27')](function(_0x3647da){_0x69d31b[_0x4106('0x20')]=_0x3647da;if(_0x1df01d[_0x4106('0x33')][_0x4106('0x41')]){_0x22209a[_0x4106('0x42')]=[{'all':!![]}];}return db[_0x4106('0x2d')]['findAll'](_0x22209a);})[_0x4106('0x27')](function(_0x8666a7){_0x69d31b[_0x4106('0x43')]=_0x8666a7;return _0x69d31b;})['then'](respondWithFilteredResult(_0x12e790,_0x22209a))['catch'](handleError(_0x12e790,null));};exports[_0x4106('0x44')]=function(_0x2c1f2a,_0x88e84){var _0x2ae831={'raw':!![],'where':{'id':_0x2c1f2a[_0x4106('0x45')]['id']}},_0x1ab916={};_0x1ab916[_0x4106('0x32')]=_[_0x4106('0x46')](db[_0x4106('0x2d')]['rawAttributes']);_0x1ab916['query']=_[_0x4106('0x46')](_0x2c1f2a[_0x4106('0x33')]);_0x1ab916[_0x4106('0x34')]=_[_0x4106('0x35')](_0x1ab916['model'],_0x1ab916[_0x4106('0x33')]);_0x2ae831[_0x4106('0x36')]=_[_0x4106('0x35')](_0x1ab916['model'],qs[_0x4106('0x37')](_0x2c1f2a[_0x4106('0x33')][_0x4106('0x37')]));_0x2ae831['attributes']=_0x2ae831[_0x4106('0x36')][_0x4106('0x38')]?_0x2ae831[_0x4106('0x36')]:_0x1ab916[_0x4106('0x32')];if(_0x2c1f2a['query'][_0x4106('0x41')]){_0x2ae831[_0x4106('0x42')]=[{'all':!![]}];}_0x2ae831=_[_0x4106('0x47')]({},_0x2ae831,_0x2c1f2a['options']);return db[_0x4106('0x2d')]['find'](_0x2ae831)['then'](handleEntityNotFound(_0x88e84,null))[_0x4106('0x27')](respondWithResult(_0x88e84,null))['catch'](handleError(_0x88e84,null));};exports[_0x4106('0x48')]=function(_0x38d82c,_0x231899){return db[_0x4106('0x2d')][_0x4106('0x48')](_0x38d82c['body'],{})['then'](respondWithResult(_0x231899,0xc9))['catch'](handleError(_0x231899,null));};exports[_0x4106('0x49')]=function(_0x2bd402,_0x28c471){return db[_0x4106('0x2d')][_0x4106('0x49')]()[_0x4106('0x27')](respondWithResult(_0x28c471,null))[_0x4106('0x4a')](handleError(_0x28c471,null));};exports[_0x4106('0x25')]=function(_0x338b1a,_0x25bd66){if(_0x338b1a[_0x4106('0x4b')][_0x4106('0x4c')]){delete _0x338b1a['body']['uniqueid'];}return db[_0x4106('0x2d')][_0x4106('0x4d')]({'where':{'uniqueid':_0x338b1a[_0x4106('0x45')]['id']}})[_0x4106('0x27')](handleEntityNotFound(_0x25bd66,null))[_0x4106('0x27')](saveUpdates(_0x338b1a[_0x4106('0x4b')],null))[_0x4106('0x27')](respondWithResult(_0x25bd66,null))[_0x4106('0x4a')](handleError(_0x25bd66,null));};
\ No newline at end of file
index 543c8de..ed533ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23bb=['rimraf','../../config/environment','endtime','uniqueid','lodash','api','moment','bluebird','path'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x23bb,0x79));var _0xb23b=function(_0x172dca,_0xda5041){_0x172dca=_0x172dca-0x0;var _0x2a887f=_0x23bb[_0x172dca];return _0x2a887f;};'use strict';var _=require(_0xb23b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb23b('0x1'));var moment=require(_0xb23b('0x2'));var BPromise=require(_0xb23b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb23b('0x4'));var rimraf=require(_0xb23b('0x5'));var config=require(_0xb23b('0x6'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x50f8a8,_0x306f8b){return _0x50f8a8['define']('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xb23b('0x7'),'fields':['endtime']},{'name':_0xb23b('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c3c=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x26ee07,_0x374393){var _0x4d1a8d=function(_0x2068b2){while(--_0x2068b2){_0x26ee07['push'](_0x26ee07['shift']());}};_0x4d1a8d(++_0x374393);}(_0x5c3c,0x132));var _0xc5c3=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x5c3c[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xb')]},{'name':'uniqueid','fields':[_0xc5c3('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 17dc8be..94dab1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd57b=['message','info','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','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','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundRejectCallsDay','outboundReCallsDay','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s'];(function(_0x593635,_0x438a6b){var _0x45d8b5=function(_0x217155){while(--_0x217155){_0x593635['push'](_0x593635['shift']());}};_0x45d8b5(++_0x438a6b);}(_0xd57b,0x1be));var _0xbd57=function(_0x56f972,_0x49b459){_0x56f972=_0x56f972-0x0;var _0xf415ef=_0xd57b[_0x56f972];return _0xf415ef;};'use strict';var _=require(_0xbd57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd57('0x1'));var db=require(_0xbd57('0x2'))['db'];var utils=require(_0xbd57('0x3'));var logger=require('../../config/logger')(_0xbd57('0x4'));var config=require('../../config/environment');var jayson=require(_0xbd57('0x5'));var client=jayson['client'][_0xbd57('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a8df9,_0x453e94,_0xeba986){return new BPromise(function(_0x8fe30b,_0x32ee5f){return client[_0xbd57('0x7')](_0x1a8df9,_0xeba986)[_0xbd57('0x8')](function(_0x3aad6a){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x453e94,_0xbd57('0x9'));logger[_0xbd57('0xa')](_0xbd57('0xb'),_0x453e94,_0xbd57('0x9'),JSON[_0xbd57('0xc')](_0x3aad6a));if(_0x3aad6a[_0xbd57('0xd')]){if(_0x3aad6a[_0xbd57('0xd')][_0xbd57('0xe')]===0x1f4){logger[_0xbd57('0xd')](_0xbd57('0xf'),_0x453e94,_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);return _0x32ee5f(_0x3aad6a['error'][_0xbd57('0x10')]);}logger[_0xbd57('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x453e94,_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);return _0x8fe30b(_0x3aad6a[_0xbd57('0xd')][_0xbd57('0x10')]);}else{logger[_0xbd57('0x11')](_0xbd57('0xf'),_0x453e94,_0xbd57('0x9'));_0x8fe30b(_0x3aad6a['result']['message']);}})[_0xbd57('0x12')](function(_0x18da7e){logger[_0xbd57('0xd')](_0xbd57('0xf'),_0x453e94,_0x18da7e);_0x32ee5f(_0x18da7e);});});}exports['CreateCmHopperHistory']=function(_0x1bebd0){var _0x2d26fb=this;return new Promise(function(_0x2713e3,_0x593d33){return db[_0xbd57('0x13')][_0xbd57('0x14')](_0x1bebd0[_0xbd57('0x15')],{'raw':_0x1bebd0[_0xbd57('0x16')]?_0x1bebd0['options'][_0xbd57('0x17')]===undefined?!![]:![]:!![]})[_0xbd57('0x8')](function(_0x2048d6){logger['info'](_0xbd57('0x18'),_0x1bebd0);logger[_0xbd57('0xa')]('CreateCmHopperHistory',_0x1bebd0,JSON[_0xbd57('0xc')](_0x2048d6));_0x2713e3(_0x2048d6);})['catch'](function(_0x54f8fb){logger[_0xbd57('0xd')](_0xbd57('0x18'),_0x54f8fb[_0xbd57('0x10')],_0x1bebd0);_0x593d33(_0x2d26fb[_0xbd57('0xd')](0x1f4,_0x54f8fb['message']));});});};exports[_0xbd57('0x19')]=function(_0x51f6d0){var _0x1a7cf3=this;return new Promise(function(_0x57526b,_0xb53876){return db[_0xbd57('0x13')][_0xbd57('0x1a')]({'raw':_0x51f6d0[_0xbd57('0x16')]?_0x51f6d0[_0xbd57('0x16')][_0xbd57('0x17')]===undefined?!![]:![]:!![],'where':_0x51f6d0['options']?_0x51f6d0[_0xbd57('0x16')][_0xbd57('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')][_0xbd57('0x1e')]('id')),_0xbd57('0x1f')],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xbd57('0x21')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbd57('0x1d')]['literal'](_0xbd57('0x22')))),_0xbd57('0x23')],[db[_0xbd57('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),_0xbd57('0x24')],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x25'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x26')))),_0xbd57('0x27')],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x25'),db[_0xbd57('0x1d')]['fn']('IF',db['sequelize'][_0xbd57('0x20')](_0xbd57('0x28')))),_0xbd57('0x29')]]})[_0xbd57('0x8')](function(_0x275ef6){logger[_0xbd57('0x11')](_0xbd57('0x19'),_0x51f6d0);logger[_0xbd57('0xa')]('AvgHandleTime',_0x51f6d0,JSON[_0xbd57('0xc')](_0x275ef6));_0x57526b(_0x275ef6);})[_0xbd57('0x12')](function(_0x2eace9){logger[_0xbd57('0xd')](_0xbd57('0x19'),_0x2eace9[_0xbd57('0x10')],_0x51f6d0);_0xb53876(_0x1a7cf3[_0xbd57('0xd')](0x1f4,_0x2eace9[_0xbd57('0x10')]));});});};exports[_0xbd57('0x2a')]=function(_0x555d24){var _0x32620c=this;return new Promise(function(_0x399e6e,_0x2f3e9c){return db[_0xbd57('0x13')]['findAll']({'raw':_0x555d24[_0xbd57('0x16')]?_0x555d24['options']['raw']===undefined?!![]:![]:!![],'where':_0x555d24['options']?_0x555d24[_0xbd57('0x16')][_0xbd57('0x1b')]||null:null,'attributes':[[_0xbd57('0x2b'),'name'],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db['sequelize']['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x2c')))),_0xbd57('0x2d')],[db[_0xbd57('0x1d')]['fn']('COUNT',db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xbd57('0x2e')],[db['sequelize']['fn'](_0xbd57('0x1c'),db['sequelize']['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x2f')))),_0xbd57('0x30')],[db['sequelize']['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')]['literal'](_0xbd57('0x31')))),_0xbd57('0x32')],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x33')))),_0xbd57('0x34')],[db[_0xbd57('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x35')))),'outboundDropCallsDayTimeout'],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x36')))),_0xbd57('0x37')],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xbd57('0x38')))),_0xbd57('0x39')],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db['sequelize']['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x3a')))),_0xbd57('0x3b')],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x3c')))),'outboundOriginateFailureCallsDay'],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x3d')))),'outboundAnswerAgiCallsDay'],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db['sequelize'][_0xbd57('0x20')]('`state`\x20=\x2020,\x201,\x20null'))),_0xbd57('0x3e')],[db[_0xbd57('0x1d')]['fn']('COUNT',db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xbd57('0x3f')]],'group':['campaign']})[_0xbd57('0x8')](function(_0x30794d){logger[_0xbd57('0x11')](_0xbd57('0x2a'),_0x555d24);logger[_0xbd57('0xa')](_0xbd57('0x2a'),_0x555d24,JSON['stringify'](_0x30794d));_0x399e6e(_0x30794d);})[_0xbd57('0x12')](function(_0x431b72){logger[_0xbd57('0xd')]('GetVoiceQueueHopperHistory',_0x431b72[_0xbd57('0x10')],_0x555d24);_0x2f3e9c(_0x32620c[_0xbd57('0xd')](0x1f4,_0x431b72[_0xbd57('0x10')]));});});};exports['GetCampaignHopperHistory']=function(_0x131f8f){var _0x41037c=this;return new Promise(function(_0x45287d,_0x4b6af8){return db[_0xbd57('0x13')]['findAll']({'raw':_0x131f8f[_0xbd57('0x16')]?_0x131f8f[_0xbd57('0x16')][_0xbd57('0x17')]===undefined?!![]:![]:!![],'where':_0x131f8f['options']?_0x131f8f[_0xbd57('0x16')][_0xbd57('0x1b')]||null:null,'attributes':[[_0xbd57('0x2b'),'name'],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['col']('id')),'ivrTotalCallsDays'],[db[_0xbd57('0x1d')]['fn'](_0xbd57('0x1c'),db[_0xbd57('0x1d')]['fn']('IF',db[_0xbd57('0x1d')][_0xbd57('0x20')](_0xbd57('0x2f')))),_0xbd57('0x40')]],'group':[_0xbd57('0x2b')]})[_0xbd57('0x8')](function(_0x39adc1){logger[_0xbd57('0x11')](_0xbd57('0x41'),_0x131f8f);logger[_0xbd57('0xa')](_0xbd57('0x41'),_0x131f8f,JSON[_0xbd57('0xc')](_0x39adc1));_0x45287d(_0x39adc1);})[_0xbd57('0x12')](function(_0x52895a){logger['error'](_0xbd57('0x41'),_0x52895a['message'],_0x131f8f);_0x4b6af8(_0x41037c['error'](0x1f4,_0x52895a['message']));});});};
\ No newline at end of file
+var _0x1782=['sequelize','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`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','GetCampaignHopperHistory','campaign','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','COUNT'];(function(_0x5cca9f,_0x154684){var _0x55edda=function(_0x115aa2){while(--_0x115aa2){_0x5cca9f['push'](_0x5cca9f['shift']());}};_0x55edda(++_0x154684);}(_0x1782,0x13e));var _0x2178=function(_0x4ed324,_0x49d49c){_0x4ed324=_0x4ed324-0x0;var _0x128e1b=_0x1782[_0x4ed324];return _0x128e1b;};'use strict';var _=require(_0x2178('0x0'));var util=require('util');var moment=require(_0x2178('0x1'));var BPromise=require(_0x2178('0x2'));var rs=require(_0x2178('0x3'));var fs=require('fs');var Redis=require(_0x2178('0x4'));var db=require(_0x2178('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2178('0x6'))(_0x2178('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2178('0x8')][_0x2178('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad34,_0x53b9f9,_0x4cf22a){return new BPromise(function(_0x3b4115,_0x2b3991){return client[_0x2178('0xa')](_0x50ad34,_0x4cf22a)[_0x2178('0xb')](function(_0x1cb1e6){logger[_0x2178('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));logger[_0x2178('0xe')](_0x2178('0xf'),_0x53b9f9,_0x2178('0xd'),JSON[_0x2178('0x10')](_0x1cb1e6));if(_0x1cb1e6[_0x2178('0x11')]){if(_0x1cb1e6[_0x2178('0x11')][_0x2178('0x12')]===0x1f4){logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6['error'][_0x2178('0x14')]);return _0x2b3991(_0x1cb1e6[_0x2178('0x11')]['message']);}logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6[_0x2178('0x11')][_0x2178('0x14')]);return _0x3b4115(_0x1cb1e6[_0x2178('0x11')]['message']);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));_0x3b4115(_0x1cb1e6['result'][_0x2178('0x14')]);}})[_0x2178('0x15')](function(_0x5edc68){logger['error'](_0x2178('0x13'),_0x53b9f9,_0x5edc68);_0x2b3991(_0x5edc68);});});}exports[_0x2178('0x16')]=function(_0x561990){var _0x3d7e36=this;return new Promise(function(_0x39dd60,_0x1cece2){return db[_0x2178('0x17')][_0x2178('0x18')](_0x561990[_0x2178('0x19')],{'raw':_0x561990[_0x2178('0x1a')]?_0x561990[_0x2178('0x1a')][_0x2178('0x1b')]===undefined?!![]:![]:!![]})[_0x2178('0xb')](function(_0x1d2dd5){logger[_0x2178('0xc')]('CreateCmHopperHistory',_0x561990);logger[_0x2178('0xe')](_0x2178('0x16'),_0x561990,JSON[_0x2178('0x10')](_0x1d2dd5));_0x39dd60(_0x1d2dd5);})[_0x2178('0x15')](function(_0x4335f2){logger[_0x2178('0x11')](_0x2178('0x16'),_0x4335f2[_0x2178('0x14')],_0x561990);_0x1cece2(_0x3d7e36[_0x2178('0x11')](0x1f4,_0x4335f2[_0x2178('0x14')]));});});};exports[_0x2178('0x1c')]=function(_0x1506ec){var _0x1a402f=this;return new Promise(function(_0xea5159,_0x35dcb9){return db[_0x2178('0x17')][_0x2178('0x1d')]({'raw':_0x1506ec[_0x2178('0x1a')]?_0x1506ec[_0x2178('0x1a')][_0x2178('0x1b')]===undefined?!![]:![]:!![],'where':_0x1506ec[_0x2178('0x1a')]?_0x1506ec[_0x2178('0x1a')][_0x2178('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x2178('0x20')]['fn']('COUNT',db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db['sequelize']['literal'](_0x2178('0x22')))),_0x2178('0x23')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0x2178('0x24')],[db[_0x2178('0x20')]['fn']('AVG',db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x25')))),'predictiveIntervalAvgHoldtime'],[db[_0x2178('0x20')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x26')))),_0x2178('0x27')]]})[_0x2178('0xb')](function(_0x2400c0){logger[_0x2178('0xc')]('AvgHandleTime',_0x1506ec);logger[_0x2178('0xe')]('AvgHandleTime',_0x1506ec,JSON[_0x2178('0x10')](_0x2400c0));_0xea5159(_0x2400c0);})[_0x2178('0x15')](function(_0x4c1047){logger[_0x2178('0x11')](_0x2178('0x1c'),_0x4c1047[_0x2178('0x14')],_0x1506ec);_0x35dcb9(_0x1a402f[_0x2178('0x11')](0x1f4,_0x4c1047[_0x2178('0x14')]));});});};exports[_0x2178('0x28')]=function(_0x322351){var _0x5876d8=this;return new Promise(function(_0x515696,_0x5c91a5){return db['CmHopperHistory'][_0x2178('0x1d')]({'raw':_0x322351[_0x2178('0x1a')]?_0x322351[_0x2178('0x1a')][_0x2178('0x1b')]===undefined?!![]:![]:!![],'where':_0x322351[_0x2178('0x1a')]?_0x322351['options']['where']||null:null,'attributes':[['campaign','name'],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db['sequelize'][_0x2178('0x21')](_0x2178('0x29')))),_0x2178('0x2a')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x2b')))),_0x2178('0x2c')],[db[_0x2178('0x20')]['fn']('COUNT',db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x2d')))),_0x2178('0x2e')],[db['sequelize']['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x2f')))),_0x2178('0x30')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0x2178('0x31')],[db['sequelize']['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x32')))),_0x2178('0x33')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db['sequelize']['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x34')))),_0x2178('0x35')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x36')))),_0x2178('0x37')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db[_0x2178('0x20')]['literal'](_0x2178('0x38')))),'outboundBlacklistCallsDay'],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db['sequelize'][_0x2178('0x21')](_0x2178('0x39')))),_0x2178('0x3a')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db['sequelize']['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x3b')))),_0x2178('0x3c')],[db[_0x2178('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x3d')))),_0x2178('0x3e')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2178('0x20')][_0x2178('0x21')](_0x2178('0x3f')))),_0x2178('0x3c')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x2178('0x21')](_0x2178('0x40')))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0x299b82){logger[_0x2178('0xc')](_0x2178('0x28'),_0x322351);logger[_0x2178('0xe')]('GetVoiceQueueHopperHistory',_0x322351,JSON['stringify'](_0x299b82));_0x515696(_0x299b82);})[_0x2178('0x15')](function(_0x1f6a69){logger[_0x2178('0x11')](_0x2178('0x28'),_0x1f6a69[_0x2178('0x14')],_0x322351);_0x5c91a5(_0x5876d8[_0x2178('0x11')](0x1f4,_0x1f6a69['message']));});});};exports[_0x2178('0x41')]=function(_0x4a773c){var _0x55cc33=this;return new Promise(function(_0x572646,_0x4ecdce){return db[_0x2178('0x17')]['findAll']({'raw':_0x4a773c[_0x2178('0x1a')]?_0x4a773c[_0x2178('0x1a')][_0x2178('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a773c[_0x2178('0x1a')]?_0x4a773c[_0x2178('0x1a')][_0x2178('0x1e')]||null:null,'attributes':[[_0x2178('0x42'),'name'],[db[_0x2178('0x20')]['fn']('COUNT',db['sequelize'][_0x2178('0x43')]('id')),_0x2178('0x44')],[db[_0x2178('0x20')]['fn'](_0x2178('0x1f'),db[_0x2178('0x20')]['fn']('IF',db['sequelize']['literal'](_0x2178('0x2d')))),_0x2178('0x45')]],'group':[_0x2178('0x42')]})[_0x2178('0xb')](function(_0x513f1d){logger[_0x2178('0xc')](_0x2178('0x41'),_0x4a773c);logger['debug']('GetCampaignHopperHistory',_0x4a773c,JSON[_0x2178('0x10')](_0x513f1d));_0x572646(_0x513f1d);})[_0x2178('0x15')](function(_0x40a65f){logger['error']('GetCampaignHopperHistory',_0x40a65f[_0x2178('0x14')],_0x4a773c);_0x4ecdce(_0x55cc33[_0x2178('0x11')](0x1f4,_0x40a65f[_0x2178('0x14')]));});});};
\ No newline at end of file
index ce7a39c..601f8aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae2e=['show','post','create','put','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xae2e,0x1e6));var _0xeae2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xae2e[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xeae2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeae2('0x1'));var express=require(_0xeae2('0x2'));var router=express[_0xeae2('0x3')]();var fs_extra=require(_0xeae2('0x4'));var auth=require(_0xeae2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeae2('0x6'));var controller=require(_0xeae2('0x7'));router[_0xeae2('0x8')]('/',auth[_0xeae2('0x9')](),controller[_0xeae2('0xa')]);router['get'](_0xeae2('0xb'),auth['isAuthenticated'](),controller[_0xeae2('0xc')]);router[_0xeae2('0x8')](_0xeae2('0xd'),auth[_0xeae2('0x9')](),controller[_0xeae2('0xe')]);router[_0xeae2('0xf')]('/',auth[_0xeae2('0x9')](),controller[_0xeae2('0x10')]);router[_0xeae2('0x11')](_0xeae2('0xd'),auth['isAuthenticated'](),controller[_0xeae2('0x12')]);module[_0xeae2('0x13')]=router;
\ No newline at end of file
+var _0x65cf=['show','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x65cf,0x1f2));var _0xf65c=function(_0x42c903,_0x32f77d){_0x42c903=_0x42c903-0x0;var _0x5c4944=_0x65cf[_0x42c903];return _0x5c4944;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf65c('0x0'));var timeout=require(_0xf65c('0x1'));var express=require(_0xf65c('0x2'));var router=express[_0xf65c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf65c('0x4'));var interaction=require(_0xf65c('0x5'));var config=require(_0xf65c('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xf65c('0x7')]('/',auth[_0xf65c('0x8')](),controller[_0xf65c('0x9')]);router[_0xf65c('0x7')](_0xf65c('0xa'),auth[_0xf65c('0x8')](),controller[_0xf65c('0xb')]);router[_0xf65c('0x7')]('/:id',auth[_0xf65c('0x8')](),controller[_0xf65c('0xc')]);router['post']('/',auth[_0xf65c('0x8')](),controller['create']);router['put'](_0xf65c('0xd'),auth[_0xf65c('0x8')](),controller['update']);module[_0xf65c('0xe')]=router;
\ No newline at end of file
index a607af2..fad0e41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9b9=['name','STRING'];(function(_0x2c6991,_0x4b5775){var _0x4de9fa=function(_0x4ad213){while(--_0x4ad213){_0x2c6991['push'](_0x2c6991['shift']());}};_0x4de9fa(++_0x4b5775);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0xc9b9[_0x421e36];return _0x20b3e3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9c9b('0x0')],'unique':_0x9c9b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9c9b('0x0')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0b78=['STRING','sequelize','exports','name'];(function(_0x3c8ed7,_0x5b4105){var _0x54e9a6=function(_0x59ed92){while(--_0x59ed92){_0x3c8ed7['push'](_0x3c8ed7['shift']());}};_0x54e9a6(++_0x5b4105);}(_0x0b78,0x1ad));var _0x80b7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0b78[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x80b7('0x0'));module[_0x80b7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x80b7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x80b7('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 36a87e5..985bd10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf831=['socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Lists','error','stack','name','send','index','map','CmList','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','ListId','removeDispositions','ids','CmContact','tags','join','isArray','push','omit','dataValues','errors','json','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','raw','getContactsCsv','ContactItemType','OrderBy','CmCustomField','alias','from','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','customField_','CmContactId\x20=\x20c.id','description','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost'];(function(_0x5c8edb,_0x105253){var _0x5a1451=function(_0x5371f8){while(--_0x5371f8){_0x5c8edb['push'](_0x5c8edb['shift']());}};_0x5a1451(++_0x105253);}(_0xf831,0x1c1));var _0x1f83=function(_0x35cd61,_0x14e204){_0x35cd61=_0x35cd61-0x0;var _0x39eb70=_0xf831[_0x35cd61];return _0x39eb70;};'use strict';var emlformat=require(_0x1f83('0x0'));var rimraf=require(_0x1f83('0x1'));var zipdir=require(_0x1f83('0x2'));var jsonpatch=require(_0x1f83('0x3'));var rp=require(_0x1f83('0x4'));var moment=require(_0x1f83('0x5'));var BPromise=require(_0x1f83('0x6'));var Mustache=require(_0x1f83('0x7'));var util=require(_0x1f83('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x1f83('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f83('0xa'));var _=require(_0x1f83('0xb'));var squel=require(_0x1f83('0xc'));var crypto=require(_0x1f83('0xd'));var jsforce=require(_0x1f83('0xe'));var deskjs=require(_0x1f83('0xf'));var toCsv=require(_0x1f83('0x9'));var querystring=require('querystring');var Papa=require(_0x1f83('0x10'));var Redis=require(_0x1f83('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1f83('0x12'));var as=require(_0x1f83('0x13'));var hardwareService=require(_0x1f83('0x14'));var logger=require(_0x1f83('0x15'))('api');var utils=require(_0x1f83('0x16'));var config=require(_0x1f83('0x17'));var licenseUtil=require(_0x1f83('0x18'));var db=require('../../mysqldb')['db'];var csv_results;config['redis']=_[_0x1f83('0x19')](config[_0x1f83('0x1a')],{'host':_0x1f83('0x1b'),'port':0x18eb});var socket=require(_0x1f83('0x1c'))(new Redis(config['redis']));require('./cmList.socket')[_0x1f83('0x1d')](socket);function respondWithStatusCode(_0x1efb1e,_0x5f19aa){_0x5f19aa=_0x5f19aa||0xcc;return function(_0x43cf7e){if(_0x43cf7e){return _0x1efb1e[_0x1f83('0x1e')](_0x5f19aa);}return _0x1efb1e['status'](_0x5f19aa)[_0x1f83('0x1f')]();};}function respondWithResult(_0x1d972f,_0x32b1f3){_0x32b1f3=_0x32b1f3||0xc8;return function(_0x5797bf){if(_0x5797bf){return _0x1d972f[_0x1f83('0x20')](_0x32b1f3)['json'](_0x5797bf);}};}function respondWithFilteredResult(_0x239a42,_0x3b7e1b){return function(_0xda33b7){if(_0xda33b7){var _0x2dae8c=typeof _0x3b7e1b[_0x1f83('0x21')]===_0x1f83('0x22')&&typeof _0x3b7e1b[_0x1f83('0x23')]===_0x1f83('0x22');var _0x1ffc81=_0xda33b7[_0x1f83('0x24')];var _0x183d8c=_0x2dae8c?0x0:_0x3b7e1b[_0x1f83('0x21')];var _0xacc180=_0x2dae8c?_0xda33b7[_0x1f83('0x24')]:_0x3b7e1b['offset']+_0x3b7e1b[_0x1f83('0x23')];var _0x3e94a1;if(_0xacc180>=_0x1ffc81){_0xacc180=_0x1ffc81;_0x3e94a1=0xc8;}else{_0x3e94a1=0xce;}_0x239a42[_0x1f83('0x20')](_0x3e94a1);return _0x239a42[_0x1f83('0x25')](_0x1f83('0x26'),_0x183d8c+'-'+_0xacc180+'/'+_0x1ffc81)['json'](_0xda33b7);}return null;};}function patchUpdates(_0x2132a0){return function(_0x1e4f03){try{jsonpatch[_0x1f83('0x27')](_0x1e4f03,_0x2132a0,!![]);}catch(_0x3395f6){return BPromise['reject'](_0x3395f6);}return _0x1e4f03[_0x1f83('0x28')]();};}function saveUpdates(_0x3aeb84,_0x59e8af){return function(_0x44cd68){if(_0x44cd68){return _0x44cd68[_0x1f83('0x29')](_0x3aeb84)[_0x1f83('0x2a')](function(_0x505f43){return _0x505f43;});}return null;};}function removeEntity(_0x30ed55,_0x279021){return function(_0x264cbc){if(_0x264cbc){return _0x264cbc[_0x1f83('0x2b')]()[_0x1f83('0x2a')](function(){var _0x50eaa0=_0x264cbc['get']({'plain':!![]});var _0x5a10bf=_0x1f83('0x2c');return db['UserProfileResource'][_0x1f83('0x2b')]({'where':{'type':_0x5a10bf,'resourceId':_0x50eaa0['id']}})[_0x1f83('0x2a')](function(){return _0x264cbc;});})[_0x1f83('0x2a')](function(){_0x30ed55[_0x1f83('0x20')](0xcc)[_0x1f83('0x1f')]();});}};}function handleEntityNotFound(_0x57d625,_0x11ac2e){return function(_0x934947){if(!_0x934947){_0x57d625['sendStatus'](0x194);}return _0x934947;};}function handleError(_0x35c83e,_0x434d4a){_0x434d4a=_0x434d4a||0x1f4;return function(_0x5ebd4e){logger[_0x1f83('0x2d')](_0x5ebd4e[_0x1f83('0x2e')]);if(_0x5ebd4e[_0x1f83('0x2f')]){delete _0x5ebd4e['name'];}_0x35c83e[_0x1f83('0x20')](_0x434d4a)[_0x1f83('0x30')](_0x5ebd4e);};}exports[_0x1f83('0x31')]=function(_0xae46bd,_0x1d5e13){var _0x2b3fbf={},_0x3c51f3={},_0x12193b={'count':0x0,'rows':[]};var _0x4655f0=_[_0x1f83('0x32')](db[_0x1f83('0x33')][_0x1f83('0x34')],function(_0x4acc3b){return{'name':_0x4acc3b['fieldName'],'type':_0x4acc3b[_0x1f83('0x35')]['key']};});_0x3c51f3[_0x1f83('0x36')]=_[_0x1f83('0x32')](_0x4655f0,_0x1f83('0x2f'));_0x3c51f3[_0x1f83('0x37')]=_[_0x1f83('0x38')](_0xae46bd[_0x1f83('0x37')]);_0x3c51f3['filters']=_['intersection'](_0x3c51f3[_0x1f83('0x36')],_0x3c51f3['query']);_0x2b3fbf['attributes']=_[_0x1f83('0x39')](_0x3c51f3['model'],qs[_0x1f83('0x3a')](_0xae46bd[_0x1f83('0x37')][_0x1f83('0x3a')]));_0x2b3fbf[_0x1f83('0x3b')]=_0x2b3fbf[_0x1f83('0x3b')][_0x1f83('0x3c')]?_0x2b3fbf[_0x1f83('0x3b')]:_0x3c51f3[_0x1f83('0x36')];if(!_0xae46bd[_0x1f83('0x37')][_0x1f83('0x3d')](_0x1f83('0x3e'))){_0x2b3fbf[_0x1f83('0x23')]=qs[_0x1f83('0x23')](_0xae46bd[_0x1f83('0x37')][_0x1f83('0x23')]);_0x2b3fbf[_0x1f83('0x21')]=qs['offset'](_0xae46bd['query']['offset']);}_0x2b3fbf[_0x1f83('0x3f')]=qs[_0x1f83('0x40')](_0xae46bd[_0x1f83('0x37')][_0x1f83('0x40')]);_0x2b3fbf[_0x1f83('0x41')]=qs[_0x1f83('0x42')](_[_0x1f83('0x43')](_0xae46bd[_0x1f83('0x37')],_0x3c51f3[_0x1f83('0x42')]),_0x4655f0);if(_0xae46bd[_0x1f83('0x37')][_0x1f83('0x44')]){_0x2b3fbf[_0x1f83('0x41')]=_[_0x1f83('0x45')](_0x2b3fbf[_0x1f83('0x41')],{'$or':_[_0x1f83('0x32')](_0x4655f0,function(_0x386130){if(_0x386130['type']!=='VIRTUAL'){var _0xae2ea5={};_0xae2ea5[_0x386130[_0x1f83('0x2f')]]={'$like':'%'+_0xae46bd[_0x1f83('0x37')][_0x1f83('0x44')]+'%'};return _0xae2ea5;}})});}_0x2b3fbf=_[_0x1f83('0x45')]({},_0x2b3fbf,_0xae46bd['options']);var _0x466c5a={'where':_0x2b3fbf[_0x1f83('0x41')]};return db[_0x1f83('0x33')][_0x1f83('0x24')](_0x466c5a)[_0x1f83('0x2a')](function(_0x1ddae0){_0x12193b[_0x1f83('0x24')]=_0x1ddae0;if(_0xae46bd[_0x1f83('0x37')][_0x1f83('0x46')]){_0x2b3fbf['include']=[{'all':!![]}];}return db[_0x1f83('0x33')][_0x1f83('0x47')](_0x2b3fbf);})['then'](function(_0x1a8e00){_0x12193b[_0x1f83('0x48')]=_0x1a8e00;return _0x12193b;})[_0x1f83('0x2a')](respondWithFilteredResult(_0x1d5e13,_0x2b3fbf))[_0x1f83('0x49')](handleError(_0x1d5e13,null));};exports['show']=function(_0x491a17,_0x10ba9b){var _0x44b1fd={'raw':![],'where':{'id':_0x491a17[_0x1f83('0x4a')]['id']}},_0x148b9e={};_0x148b9e[_0x1f83('0x36')]=_[_0x1f83('0x38')](db[_0x1f83('0x33')][_0x1f83('0x34')]);_0x148b9e[_0x1f83('0x37')]=_['keys'](_0x491a17[_0x1f83('0x37')]);_0x148b9e[_0x1f83('0x42')]=_[_0x1f83('0x39')](_0x148b9e[_0x1f83('0x36')],_0x148b9e[_0x1f83('0x37')]);_0x44b1fd[_0x1f83('0x3b')]=_[_0x1f83('0x39')](_0x148b9e[_0x1f83('0x36')],qs[_0x1f83('0x3a')](_0x491a17[_0x1f83('0x37')][_0x1f83('0x3a')]));_0x44b1fd[_0x1f83('0x3b')]=_0x44b1fd[_0x1f83('0x3b')]['length']?_0x44b1fd[_0x1f83('0x3b')]:_0x148b9e[_0x1f83('0x36')];if(_0x491a17['query'][_0x1f83('0x46')]){_0x44b1fd[_0x1f83('0x4b')]=[{'all':!![]}];}_0x44b1fd=_[_0x1f83('0x45')]({},_0x44b1fd,_0x491a17[_0x1f83('0x4c')]);return db[_0x1f83('0x33')][_0x1f83('0x4d')](_0x44b1fd)['then'](handleEntityNotFound(_0x10ba9b,null))['then'](respondWithResult(_0x10ba9b,null))[_0x1f83('0x49')](handleError(_0x10ba9b,null));};exports[_0x1f83('0x4e')]=function(_0x57b878,_0x1fcc80){return db[_0x1f83('0x33')][_0x1f83('0x4e')](_0x57b878[_0x1f83('0x4f')],{})['then'](function(_0x532527){var _0x4a9a64=_0x57b878[_0x1f83('0x50')][_0x1f83('0x51')]({'plain':!![]});if(!_0x4a9a64)throw new Error(_0x1f83('0x52'));if(_0x4a9a64['role']===_0x1f83('0x50')){var _0x555244=_0x532527[_0x1f83('0x51')]({'plain':!![]});var _0x57e2e6=_0x1f83('0x2c');return db[_0x1f83('0x53')][_0x1f83('0x4d')]({'where':{'name':_0x57e2e6,'userProfileId':_0x4a9a64[_0x1f83('0x54')]},'raw':!![]})['then'](function(_0x508f0f){if(_0x508f0f&&_0x508f0f[_0x1f83('0x55')]===0x0){return db[_0x1f83('0x56')]['create']({'name':_0x555244['name'],'resourceId':_0x555244['id'],'type':_0x508f0f[_0x1f83('0x2f')],'sectionId':_0x508f0f['id']},{})[_0x1f83('0x2a')](function(){return _0x532527;});}else{return _0x532527;}})[_0x1f83('0x49')](function(_0x526cfb){logger[_0x1f83('0x2d')](_0x1f83('0x57'),_0x526cfb);throw _0x526cfb;});}return _0x532527;})[_0x1f83('0x2a')](respondWithResult(_0x1fcc80,0xc9))[_0x1f83('0x49')](handleError(_0x1fcc80,null));};exports[_0x1f83('0x29')]=function(_0x50fb5a,_0x31fd97){if(_0x50fb5a[_0x1f83('0x4f')]['id']){delete _0x50fb5a[_0x1f83('0x4f')]['id'];}return db[_0x1f83('0x33')][_0x1f83('0x4d')]({'where':{'id':_0x50fb5a['params']['id']}})[_0x1f83('0x2a')](handleEntityNotFound(_0x31fd97,null))['then'](saveUpdates(_0x50fb5a[_0x1f83('0x4f')],null))[_0x1f83('0x2a')](respondWithResult(_0x31fd97,null))[_0x1f83('0x49')](handleError(_0x31fd97,null));};exports[_0x1f83('0x2b')]=function(_0x336c4b,_0x28cd0c){return db[_0x1f83('0x33')]['find']({'where':{'id':_0x336c4b['params']['id']}})[_0x1f83('0x2a')](handleEntityNotFound(_0x28cd0c,null))[_0x1f83('0x2a')](removeEntity(_0x28cd0c,null))['catch'](handleError(_0x28cd0c,null));};exports['describe']=function(_0x4bbbbf,_0x106004){return db[_0x1f83('0x33')][_0x1f83('0x58')]()['then'](respondWithResult(_0x106004,null))['catch'](handleError(_0x106004,null));};exports['addDisposition']=function(_0x22a407,_0x189ea6,_0x28721b){if(_0x22a407['body']['id']){delete _0x22a407[_0x1f83('0x4f')]['id'];}return db['CmList']['find']({'where':{'id':_0x22a407['params']['id']}})[_0x1f83('0x2a')](handleEntityNotFound(_0x189ea6,null))[_0x1f83('0x2a')](function(_0x54e03d){if(_0x54e03d){_0x22a407[_0x1f83('0x4f')]['ListId']=_0x54e03d['id'];return db[_0x1f83('0x59')][_0x1f83('0x4e')](_0x22a407[_0x1f83('0x4f')]);}})[_0x1f83('0x2a')](respondWithResult(_0x189ea6,null))[_0x1f83('0x49')](handleError(_0x189ea6,null));};exports[_0x1f83('0x5a')]=function(_0x93356c,_0x8bc715,_0x53b600){var _0x44b65f={'raw':![],'where':{}};var _0x573688={};var _0x58fbf2={'count':0x0,'rows':[]};return db['CmList'][_0x1f83('0x5b')]({'where':{'id':_0x93356c[_0x1f83('0x4a')]['id']}})['then'](handleEntityNotFound(_0x8bc715,null))['then'](function(_0x57e581){if(_0x57e581){_0x573688['model']=_[_0x1f83('0x38')](db[_0x1f83('0x59')][_0x1f83('0x34')]);_0x573688['query']=_[_0x1f83('0x38')](_0x93356c[_0x1f83('0x37')]);_0x573688['filters']=_['intersection'](_0x573688[_0x1f83('0x36')],_0x573688[_0x1f83('0x37')]);_0x44b65f[_0x1f83('0x3b')]=_[_0x1f83('0x39')](_0x573688[_0x1f83('0x36')],qs[_0x1f83('0x3a')](_0x93356c[_0x1f83('0x37')]['fields']));_0x44b65f[_0x1f83('0x3b')]=_0x44b65f['attributes'][_0x1f83('0x3c')]?_0x44b65f['attributes']:_0x573688[_0x1f83('0x36')];if(!_0x93356c['query'][_0x1f83('0x3d')](_0x1f83('0x3e'))){_0x44b65f[_0x1f83('0x23')]=qs[_0x1f83('0x23')](_0x93356c['query'][_0x1f83('0x23')]);_0x44b65f[_0x1f83('0x21')]=qs['offset'](_0x93356c[_0x1f83('0x37')][_0x1f83('0x21')]);}_0x44b65f[_0x1f83('0x3f')]=qs[_0x1f83('0x40')](_0x93356c[_0x1f83('0x37')][_0x1f83('0x40')]);_0x44b65f['where']=qs[_0x1f83('0x42')](_[_0x1f83('0x43')](_0x93356c[_0x1f83('0x37')],_0x573688[_0x1f83('0x42')]));_0x44b65f[_0x1f83('0x41')][_0x1f83('0x5c')]=_0x57e581['id'];if(_0x93356c['query']['filter']){_0x44b65f['where']=_[_0x1f83('0x45')](_0x44b65f[_0x1f83('0x41')],{'$or':_[_0x1f83('0x32')](_0x44b65f[_0x1f83('0x3b')],function(_0x2b92aa){var _0x505b5b={};_0x505b5b[_0x2b92aa]={'$like':'%'+_0x93356c[_0x1f83('0x37')][_0x1f83('0x44')]+'%'};return _0x505b5b;})});}_0x44b65f=_[_0x1f83('0x45')]({},_0x44b65f,_0x93356c['options']);return db[_0x1f83('0x59')][_0x1f83('0x24')]({'where':_0x44b65f[_0x1f83('0x41')]})[_0x1f83('0x2a')](function(_0x17b0ac){_0x58fbf2['count']=_0x17b0ac;if(_0x93356c[_0x1f83('0x37')]['includeAll']){_0x44b65f[_0x1f83('0x4b')]=[{'all':!![]}];}return db[_0x1f83('0x59')][_0x1f83('0x47')](_0x44b65f);})[_0x1f83('0x2a')](function(_0x2442b0){_0x58fbf2[_0x1f83('0x48')]=_0x2442b0;return _0x58fbf2;});}})[_0x1f83('0x2a')](respondWithFilteredResult(_0x8bc715,_0x44b65f))['catch'](handleError(_0x8bc715,null));};exports[_0x1f83('0x5d')]=function(_0x4a7339,_0x44320c,_0xd97bb8){return db[_0x1f83('0x33')][_0x1f83('0x4d')]({'where':{'id':_0x4a7339[_0x1f83('0x4a')]['id']}})[_0x1f83('0x2a')](handleEntityNotFound(_0x44320c,null))[_0x1f83('0x2a')](function(_0xf96f50){if(_0xf96f50){return _0xf96f50[_0x1f83('0x5d')](_0x4a7339['query'][_0x1f83('0x5e')]);}})[_0x1f83('0x2a')](respondWithStatusCode(_0x44320c,null))[_0x1f83('0x49')](handleError(_0x44320c,null));};exports['addContacts']=function(_0x3ade27,_0x3296a4,_0x101041){return db['CmList'][_0x1f83('0x4d')]({'where':{'id':_0x3ade27[_0x1f83('0x4a')]['id']}})[_0x1f83('0x2a')](handleEntityNotFound(_0x3296a4,null))[_0x1f83('0x2a')](function(_0x552e95){if(_0x552e95){var _0x1087d1=[];var _0x1d8c02={'success':[],'errors':[]};return db[_0x1f83('0x5f')][_0x1f83('0x58')]()[_0x1f83('0x2a')](function(_0x450d66){if(_0x3ade27[_0x1f83('0x4f')][_0x1f83('0x60')]&&_['isArray'](_0x3ade27['body'][_0x1f83('0x60')])){if(_0x3ade27['body'][_0x1f83('0x60')][_0x1f83('0x3c')]){_0x3ade27[_0x1f83('0x4f')][_0x1f83('0x60')]=_0x3ade27[_0x1f83('0x4f')][_0x1f83('0x60')][_0x1f83('0x61')](';')+';';}else{_0x3ade27[_0x1f83('0x4f')]['tags']=null;}}else{_0x3ade27[_0x1f83('0x4f')][_0x1f83('0x60')]=null;}if(_0x3ade27[_0x1f83('0x4f')]&&_[_0x1f83('0x62')](_0x3ade27['body'])){for(var _0x53f22e=0x0;_0x53f22e<_0x3ade27['body'][_0x1f83('0x3c')];_0x53f22e+=0x1){_0x3ade27['body'][_0x53f22e][_0x1f83('0x5c')]=_0x3ade27[_0x1f83('0x4a')]['id'];_0x1087d1[_0x1f83('0x63')](_0x3ade27['body'][_0x53f22e]);}return BPromise['each'](_0x1087d1,function(_0x2daf2a){return db[_0x1f83('0x5f')][_0x1f83('0x4e')](_[_0x1f83('0x64')](_0x2daf2a,[_0x1f83('0x5e'),'id'])||{},{'fields':_[_0x1f83('0x38')](_0x450d66),'raw':!![]})[_0x1f83('0x2a')](function(_0x545e13){_0x1d8c02['success'][_0x1f83('0x63')](_0x545e13[_0x1f83('0x65')]);})['catch'](function(_0x41490a){_0x1d8c02[_0x1f83('0x66')][_0x1f83('0x63')]({'data':_0x2daf2a,'error':_0x41490a['message']});});})[_0x1f83('0x2a')](function(_0x5a70cb){return _0x1d8c02;})['catch'](function(_0x4ec9df){return _0x4ec9df;});}else{_0x3296a4[_0x1f83('0x20')](0x190)[_0x1f83('0x67')]({'message':_0x1f83('0x68')});}});}})[_0x1f83('0x2a')](respondWithResult(_0x3296a4,null))[_0x1f83('0x49')](handleError(_0x3296a4,null));};exports[_0x1f83('0x69')]=function(_0x3cc7c8,_0x5ecf25,_0x977bd1){var _0x36f4c7;return db[_0x1f83('0x33')][_0x1f83('0x4d')]({'where':{'id':_0x3cc7c8['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x1f83('0x6a')}]})[_0x1f83('0x2a')](handleEntityNotFound(_0x5ecf25,null))['then'](function(_0x5c7796){if(_0x5c7796){_0x36f4c7=_0x5c7796;return db[_0x1f83('0x5f')][_0x1f83('0x34')];}})[_0x1f83('0x2a')](function(_0x4ab4fb){if(_0x4ab4fb){var _0x3ca850={};var _0x33e763={};_0x33e763[_0x1f83('0x36')]=_[_0x1f83('0x6b')](_[_0x1f83('0x38')](_0x4ab4fb),_[_0x1f83('0x32')](_0x36f4c7[_0x1f83('0x6a')],function(_0x3442bc){return util[_0x1f83('0x6c')]('cf_%d',_0x3442bc['id']);}));_0x33e763[_0x1f83('0x37')]=_['keys'](_0x3cc7c8['query']);_0x33e763[_0x1f83('0x42')]=_[_0x1f83('0x39')](_0x33e763[_0x1f83('0x36')],_0x33e763['query']);_0x3ca850[_0x1f83('0x3b')]=_[_0x1f83('0x39')](_0x33e763[_0x1f83('0x36')],qs['fields'](_0x3cc7c8[_0x1f83('0x37')][_0x1f83('0x3a')]));_0x3ca850[_0x1f83('0x3b')]=_0x3ca850[_0x1f83('0x3b')]['length']?_0x3ca850[_0x1f83('0x3b')]:_0x33e763['model'];if(!_0x3cc7c8[_0x1f83('0x37')][_0x1f83('0x3d')](_0x1f83('0x3e'))){_0x3ca850[_0x1f83('0x23')]=qs[_0x1f83('0x23')](_0x3cc7c8[_0x1f83('0x37')][_0x1f83('0x23')]);_0x3ca850[_0x1f83('0x21')]=qs[_0x1f83('0x21')](_0x3cc7c8[_0x1f83('0x37')][_0x1f83('0x21')]);}_0x3ca850[_0x1f83('0x3f')]=qs[_0x1f83('0x40')](_0x3cc7c8['query']['sort']);_0x3ca850[_0x1f83('0x41')]=qs['filters'](_[_0x1f83('0x43')](_0x3cc7c8[_0x1f83('0x37')],_0x33e763['filters']));_0x3ca850[_0x1f83('0x6d')]=!![];if(_0x3cc7c8['query'][_0x1f83('0x44')]){_0x3ca850[_0x1f83('0x41')]=_[_0x1f83('0x45')](_0x3ca850[_0x1f83('0x41')],{'$or':_[_0x1f83('0x32')](_0x3ca850[_0x1f83('0x3b')],function(_0x176e05){var _0x252460={};_0x252460[_0x176e05]={'$like':'%'+_0x3cc7c8[_0x1f83('0x37')][_0x1f83('0x44')]+'%'};return _0x252460;})});}_0x3ca850=_[_0x1f83('0x45')]({},_0x3ca850,_0x3cc7c8[_0x1f83('0x4c')]);return _0x36f4c7['getContacts'](_0x3ca850);}})[_0x1f83('0x2a')](respondWithResult(_0x5ecf25,null))[_0x1f83('0x49')](handleError(_0x5ecf25,null));};exports[_0x1f83('0x6e')]=function(_0x567dbc,_0x33bdc5,_0x7d547){var _0x20282d;var _0x432dcb;var _0x5c7c83;var _0x21433e=_0x567dbc[_0x1f83('0x4a')]['id'];csv_results=[];return db[_0x1f83('0x6f')][_0x1f83('0x47')]({'attributes':['id',_0x1f83('0x2f')],'raw':!![],'order':[_0x1f83('0x70')]})['then'](function(_0x2ab9a0){_0x20282d=_0x2ab9a0;var _0x9af76b=_[_0x1f83('0x38')](db[_0x1f83('0x5f')][_0x1f83('0x34')]);return db[_0x1f83('0x71')][_0x1f83('0x47')]({'raw':!![],'attributes':['id',_0x1f83('0x72')]})[_0x1f83('0x2a')](function(_0x3dc418){_0x432dcb=_0x3dc418;var _0x15232c=squel['select']()['fields'](_0x9af76b)[_0x1f83('0x73')](_0x1f83('0x74'),'c')[_0x1f83('0x41')](_0x1f83('0x75'),_0x21433e)['where']('c.deletedAt\x20is\x20null')['distinct']();for(var _0x44bc9a=0x0;_0x44bc9a<_0x432dcb[_0x1f83('0x3c')];_0x44bc9a++){_0x15232c[_0x1f83('0x76')](_0x1f83('0x77')+_0x432dcb[_0x44bc9a]['id'],_0x1f83('0x78')+_0x432dcb[_0x44bc9a][_0x1f83('0x72')]);}for(var _0x44bc9a=0x0;_0x44bc9a<_0x20282d[_0x1f83('0x3c')];_0x44bc9a++){_0x15232c[_0x1f83('0x76')](squel['select']()[_0x1f83('0x76')]('item')[_0x1f83('0x73')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x20282d[_0x44bc9a]['id'])[_0x1f83('0x41')](_0x1f83('0x79')),'additionalPhone_'+_0x20282d[_0x44bc9a][_0x1f83('0x2f')]);_0x15232c[_0x1f83('0x76')](squel['select']()[_0x1f83('0x76')](_0x1f83('0x7a'))[_0x1f83('0x73')]('cm_contact_has_items')[_0x1f83('0x41')]('ItemTypeId\x20=\x20?',_0x20282d[_0x44bc9a]['id'])['where'](_0x1f83('0x79')),'description_additionalPhone_'+_0x20282d[_0x44bc9a][_0x1f83('0x2f')]);}var _0x16b885=[];_0x16b885[_0x1f83('0x63')](_0x15232c[_0x1f83('0x7b')]());BPromise[_0x1f83('0x7c')](_0x16b885,handleQuery)[_0x1f83('0x2a')](function(_0x1fb723){handleQuery(_0x15232c['toString']());var _0x32222f=csv_results[0x0];if(!_[_0x1f83('0x7d')](_0x32222f)){var _0x16c957=toCsv(_0x32222f);var _0x3c967e=Date[_0x1f83('0x7e')]();fs[_0x1f83('0x7f')](util[_0x1f83('0x6c')](_0x1f83('0x80'),_0x21433e,_0x3c967e),_0x16c957);_0x33bdc5['setHeader'](_0x1f83('0x81'),_0x1f83('0x82')+util[_0x1f83('0x6c')](_0x1f83('0x83'),_0x21433e,_0x3c967e));_0x33bdc5[_0x1f83('0x84')](_0x1f83('0x85'),_0x1f83('0x86'));return _0x33bdc5[_0x1f83('0x87')](util[_0x1f83('0x6c')](_0x1f83('0x80'),_0x21433e,_0x3c967e));}else{return _0x33bdc5[_0x1f83('0x1e')](0xcc);}});});});};exports['addCustomField']=function(_0x2a0955,_0x320a65,_0x185770){var _0x321a08;delete _0x2a0955['body']['id'];return db[_0x1f83('0x33')][_0x1f83('0x5b')]({'where':{'id':_0x2a0955[_0x1f83('0x4a')]['id']}})[_0x1f83('0x2a')](handleEntityNotFound(_0x320a65,null))[_0x1f83('0x2a')](function(_0x35e5a8){if(_0x35e5a8){return db[_0x1f83('0x88')][_0x1f83('0x89')](function(_0x5d30f3){return db[_0x1f83('0x71')]['create'](_0x2a0955[_0x1f83('0x4f')],{'transaction':_0x5d30f3})[_0x1f83('0x2a')](function(_0x50fc2b){_0x321a08=_0x50fc2b;return _0x35e5a8['addCustomFields'](_0x50fc2b,{'transaction':_0x5d30f3});})[_0x1f83('0x2a')](function(){var _0x4b07e4={'type':db[_0x1f83('0x8a')][_0x1f83('0x8b')],'transaction':_0x5d30f3};switch(_0x2a0955[_0x1f83('0x4f')]['type']){case _0x1f83('0x8c'):_0x4b07e4[_0x1f83('0x35')]=db[_0x1f83('0x8a')][_0x1f83('0x8b')];break;case _0x1f83('0x8d'):_0x4b07e4[_0x1f83('0x35')]=db[_0x1f83('0x8a')][_0x1f83('0x8e')];break;case _0x1f83('0x8f'):_0x4b07e4[_0x1f83('0x35')]=db['Sequelize'][_0x1f83('0x90')];_0x4b07e4[_0x1f83('0x91')]=![];break;default:}return db[_0x1f83('0x88')][_0x1f83('0x92')][_0x1f83('0x93')](_0x1f83('0x74'),util[_0x1f83('0x6c')]('cf_%s',_0x321a08['id']),_0x4b07e4);})[_0x1f83('0x2a')](function(){return _0x321a08;});});}})[_0x1f83('0x2a')](respondWithResult(_0x320a65,null))[_0x1f83('0x49')](handleError(_0x320a65,null));};exports[_0x1f83('0x94')]=function(_0x584365,_0x3dff77,_0xebf609){var _0x3238df={};var _0x505385={};var _0xff83fd;var _0x5ae51f;return db['CmList'][_0x1f83('0x5b')]({'where':{'id':_0x584365[_0x1f83('0x4a')]['id']}})[_0x1f83('0x2a')](handleEntityNotFound(_0x3dff77,null))['then'](function(_0x2f7e11){if(_0x2f7e11){_0xff83fd=_0x2f7e11;_0x505385['model']=_[_0x1f83('0x38')](db['CmCustomField'][_0x1f83('0x34')]);_0x505385[_0x1f83('0x37')]=_[_0x1f83('0x38')](_0x584365['query']);_0x505385[_0x1f83('0x42')]=_[_0x1f83('0x39')](_0x505385['model'],_0x505385[_0x1f83('0x37')]);_0x3238df[_0x1f83('0x3b')]=_[_0x1f83('0x39')](_0x505385['model'],qs[_0x1f83('0x3a')](_0x584365[_0x1f83('0x37')][_0x1f83('0x3a')]));_0x3238df[_0x1f83('0x3b')]=_0x3238df[_0x1f83('0x3b')][_0x1f83('0x3c')]?_0x3238df[_0x1f83('0x3b')]:_0x505385[_0x1f83('0x36')];_0x3238df[_0x1f83('0x3f')]=qs[_0x1f83('0x40')](_0x584365[_0x1f83('0x37')][_0x1f83('0x40')]);_0x3238df[_0x1f83('0x41')]=qs[_0x1f83('0x42')](_['pick'](_0x584365[_0x1f83('0x37')],_0x505385[_0x1f83('0x42')]));_0x3238df[_0x1f83('0x41')]=_['merge'](_0x3238df[_0x1f83('0x41')],{'$or':[{'ListId':_0x2f7e11['id']},{'ListId':null}]});if(_0x584365['query'][_0x1f83('0x44')]){_0x3238df[_0x1f83('0x41')]=_[_0x1f83('0x45')](_0x3238df[_0x1f83('0x41')],{'$or':_[_0x1f83('0x32')](_0x3238df[_0x1f83('0x3b')],function(_0x8a9357){var _0x22b456={};_0x22b456[_0x8a9357]={'$like':'%'+_0x584365[_0x1f83('0x37')]['filter']+'%'};return _0x22b456;})});}_0x3238df=_['merge']({},_0x3238df,_0x584365[_0x1f83('0x4c')]);return db['CmCustomField']['findAndCountAll'](_0x3238df);}})[_0x1f83('0x2a')](respondWithResult(_0x3dff77,null))[_0x1f83('0x49')](handleError(_0x3dff77,null));};exports[_0x1f83('0x95')]=function(_0x13e666,_0x2cacfb){return db['CmCustomField'][_0x1f83('0x96')]({'where':{'ListId':null}})[_0x1f83('0x2a')](handleEntityNotFound(_0x2cacfb,null))[_0x1f83('0x2a')](function(_0x5e3d9f){return _0x5e3d9f;})[_0x1f83('0x2a')](respondWithResult(_0x2cacfb,null))[_0x1f83('0x49')](handleError(_0x2cacfb,null));};exports[_0x1f83('0x97')]=function(_0x4c65b6,_0x2bbf91,_0xabe42e){return db['CmList'][_0x1f83('0x4d')]({'where':{'id':_0x4c65b6['params']['id']}})['then'](handleEntityNotFound(_0x2bbf91,null))[_0x1f83('0x2a')](function(_0x548bab){if(_0x548bab){return _0x548bab[_0x1f83('0x97')](_0x4c65b6[_0x1f83('0x4f')][_0x1f83('0x5e')],_['omit'](_0x4c65b6[_0x1f83('0x4f')],['ids','id'])||{})[_0x1f83('0x98')](function(_0x29e77d){for(var _0x4e40ce=0x0;_0x4e40ce<_0x4c65b6[_0x1f83('0x4f')]['ids'][_0x1f83('0x3c')];_0x4e40ce+=0x1){socket[_0x1f83('0x99')](_0x1f83('0x9a'),{'UserId':Number(_0x4c65b6['body'][_0x1f83('0x5e')][_0x4e40ce]),'CmListId':Number(_0x4c65b6[_0x1f83('0x4a')]['id'])});}return _0x29e77d;});}})[_0x1f83('0x2a')](respondWithResult(_0x2bbf91,null))['catch'](handleError(_0x2bbf91,null));};exports[_0x1f83('0x9b')]=function(_0x313edf,_0x64dae8,_0x388238){return db['CmList'][_0x1f83('0x4d')]({'where':{'id':_0x313edf[_0x1f83('0x4a')]['id']}})[_0x1f83('0x2a')](handleEntityNotFound(_0x64dae8,null))[_0x1f83('0x2a')](function(_0x4d614d){if(_0x4d614d){return _0x4d614d[_0x1f83('0x9b')](_0x313edf[_0x1f83('0x37')][_0x1f83('0x5e')])['then'](function(){if(_[_0x1f83('0x62')](_0x313edf[_0x1f83('0x37')]['ids'])){for(var _0x4fdcbe=0x0;_0x4fdcbe<_0x313edf[_0x1f83('0x37')]['ids'][_0x1f83('0x3c')];_0x4fdcbe+=0x1){socket[_0x1f83('0x99')]('userCmList:remove',{'UserId':Number(_0x313edf[_0x1f83('0x37')]['ids'][_0x4fdcbe]),'CmListId':Number(_0x313edf[_0x1f83('0x4a')]['id'])});}}else{socket['emit'](_0x1f83('0x9c'),{'UserId':Number(_0x313edf[_0x1f83('0x37')]['ids']),'CmListId':Number(_0x313edf[_0x1f83('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x64dae8,null))[_0x1f83('0x49')](handleError(_0x64dae8,null));};exports[_0x1f83('0x9d')]=function(_0x52c800,_0x2e4864,_0x317f9f){var _0x4a6462={};var _0x4c5b9e={};var _0xe08a8d;var _0x4671dc;return db[_0x1f83('0x33')][_0x1f83('0x5b')]({'where':{'id':_0x52c800['params']['id']}})['then'](handleEntityNotFound(_0x2e4864,null))[_0x1f83('0x2a')](function(_0x2d0244){if(_0x2d0244){_0xe08a8d=_0x2d0244;_0x4c5b9e[_0x1f83('0x36')]=_[_0x1f83('0x38')](db[_0x1f83('0x9e')]['rawAttributes']);_0x4c5b9e[_0x1f83('0x37')]=_[_0x1f83('0x38')](_0x52c800[_0x1f83('0x37')]);_0x4c5b9e['filters']=_['intersection'](_0x4c5b9e[_0x1f83('0x36')],_0x4c5b9e['query']);_0x4a6462[_0x1f83('0x3b')]=_[_0x1f83('0x39')](_0x4c5b9e[_0x1f83('0x36')],qs['fields'](_0x52c800[_0x1f83('0x37')]['fields']));_0x4a6462['attributes']=_0x4a6462['attributes'][_0x1f83('0x3c')]?_0x4a6462['attributes']:_0x4c5b9e['model'];_0x4a6462['order']=qs['sort'](_0x52c800['query'][_0x1f83('0x40')]);_0x4a6462['where']=qs[_0x1f83('0x42')](_[_0x1f83('0x43')](_0x52c800[_0x1f83('0x37')],_0x4c5b9e[_0x1f83('0x42')]));if(_0x52c800['query'][_0x1f83('0x44')]){_0x4a6462[_0x1f83('0x41')]=_['merge'](_0x4a6462[_0x1f83('0x41')],{'$or':_[_0x1f83('0x32')](_0x4a6462[_0x1f83('0x3b')],function(_0x1a6a86){var _0x257d98={};_0x257d98[_0x1a6a86]={'$like':'%'+_0x52c800[_0x1f83('0x37')]['filter']+'%'};return _0x257d98;})});}_0x4a6462=_[_0x1f83('0x45')]({},_0x4a6462,_0x52c800[_0x1f83('0x4c')]);return _0xe08a8d['getAgents'](_0x4a6462);}})[_0x1f83('0x2a')](function(_0x4fbb10){if(_0x4fbb10){_0x4671dc=_0x4fbb10[_0x1f83('0x3c')];if(!_0x52c800['query']['hasOwnProperty'](_0x1f83('0x3e'))){_0x4a6462[_0x1f83('0x23')]=qs[_0x1f83('0x23')](_0x52c800[_0x1f83('0x37')][_0x1f83('0x23')]);_0x4a6462[_0x1f83('0x21')]=qs[_0x1f83('0x21')](_0x52c800[_0x1f83('0x37')][_0x1f83('0x21')]);}return _0xe08a8d[_0x1f83('0x9d')](_0x4a6462);}})[_0x1f83('0x2a')](function(_0x5c2e37){if(_0x5c2e37){return _0x5c2e37?{'count':_0x4671dc,'rows':_0x5c2e37}:null;}})[_0x1f83('0x2a')](respondWithResult(_0x2e4864,null))['catch'](handleError(_0x2e4864,null));};function handleQuery(_0x30d694){logger['info'](_0x30d694);return db[_0x1f83('0x88')]['query'](_0x30d694)['spread'](function(_0x3964c3){csv_results[_0x1f83('0x63')](_0x3964c3);})['catch'](function(_0xde7fba){logger[_0x1f83('0x2d')](_0xde7fba['message']);});}
\ No newline at end of file
+var _0x0290=['getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','body','params','describe','addDisposition','ListId','Disposition','filter','removeDispositions','addContacts','CmContact','tags','isArray','omit','ids','dataValues','errors','push','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','getContacts','getContactsCsv','concat','cf_%d','raw','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','findOne','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User'];(function(_0x3543e7,_0x501fcf){var _0x42df23=function(_0x467049){while(--_0x467049){_0x3543e7['push'](_0x3543e7['shift']());}};_0x42df23(++_0x501fcf);}(_0x0290,0x12b));var _0x0029=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0290[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0029('0x0'));var zipdir=require(_0x0029('0x1'));var jsonpatch=require(_0x0029('0x2'));var rp=require(_0x0029('0x3'));var moment=require(_0x0029('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0029('0x5'));var util=require(_0x0029('0x6'));var path=require(_0x0029('0x7'));var sox=require(_0x0029('0x8'));var csv=require(_0x0029('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0029('0xa'));var squel=require(_0x0029('0xb'));var crypto=require(_0x0029('0xc'));var jsforce=require(_0x0029('0xd'));var deskjs=require(_0x0029('0xe'));var toCsv=require(_0x0029('0x9'));var querystring=require(_0x0029('0xf'));var Papa=require(_0x0029('0x10'));var Redis=require(_0x0029('0x11'));var authService=require(_0x0029('0x12'));var qs=require(_0x0029('0x13'));var as=require(_0x0029('0x14'));var hardwareService=require(_0x0029('0x15'));var logger=require(_0x0029('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x0029('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0029('0x18'))['db'];config[_0x0029('0x19')]=_['defaults'](config[_0x0029('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0029('0x1a'))(new Redis(config['redis']));require(_0x0029('0x1b'))[_0x0029('0x1c')](socket);function respondWithStatusCode(_0xe29f09,_0x4b2757){_0x4b2757=_0x4b2757||0xcc;return function(_0x486f75){if(_0x486f75){return _0xe29f09[_0x0029('0x1d')](_0x4b2757);}return _0xe29f09[_0x0029('0x1e')](_0x4b2757)['end']();};}function respondWithResult(_0x53c419,_0x3554cd){_0x3554cd=_0x3554cd||0xc8;return function(_0x2e737f){if(_0x2e737f){return _0x53c419[_0x0029('0x1e')](_0x3554cd)[_0x0029('0x1f')](_0x2e737f);}};}function respondWithFilteredResult(_0x5e4674,_0x165948){return function(_0x31361){if(_0x31361){var _0x574dd6=typeof _0x165948[_0x0029('0x20')]===_0x0029('0x21')&&typeof _0x165948['limit']===_0x0029('0x21');var _0x3cc41b=_0x31361[_0x0029('0x22')];var _0x13b27b=_0x574dd6?0x0:_0x165948[_0x0029('0x20')];var _0x76de47=_0x574dd6?_0x31361[_0x0029('0x22')]:_0x165948[_0x0029('0x20')]+_0x165948[_0x0029('0x23')];var _0x100814;if(_0x76de47>=_0x3cc41b){_0x76de47=_0x3cc41b;_0x100814=0xc8;}else{_0x100814=0xce;}_0x5e4674['status'](_0x100814);return _0x5e4674[_0x0029('0x24')](_0x0029('0x25'),_0x13b27b+'-'+_0x76de47+'/'+_0x3cc41b)['json'](_0x31361);}return null;};}function patchUpdates(_0x51cca0){return function(_0x586036){try{jsonpatch[_0x0029('0x26')](_0x586036,_0x51cca0,!![]);}catch(_0xacc842){return BPromise[_0x0029('0x27')](_0xacc842);}return _0x586036[_0x0029('0x28')]();};}function saveUpdates(_0x43abe0,_0x286dfb){return function(_0x13e2e6){if(_0x13e2e6){return _0x13e2e6[_0x0029('0x29')](_0x43abe0)[_0x0029('0x2a')](function(_0x4ac320){return _0x4ac320;});}return null;};}function removeEntity(_0x287931,_0x34bda9){return function(_0x21b55e){if(_0x21b55e){return _0x21b55e[_0x0029('0x2b')]()[_0x0029('0x2a')](function(){var _0xde8c4=_0x21b55e[_0x0029('0x2c')]({'plain':!![]});var _0x205fe9=_0x0029('0x2d');return db[_0x0029('0x2e')][_0x0029('0x2b')]({'where':{'type':_0x205fe9,'resourceId':_0xde8c4['id']}})[_0x0029('0x2a')](function(){return _0x21b55e;});})[_0x0029('0x2a')](function(){_0x287931[_0x0029('0x1e')](0xcc)[_0x0029('0x2f')]();});}};}function handleEntityNotFound(_0x681de5,_0x3203af){return function(_0x91b10a){if(!_0x91b10a){_0x681de5['sendStatus'](0x194);}return _0x91b10a;};}function handleError(_0x3b24b3,_0x544422){_0x544422=_0x544422||0x1f4;return function(_0x3fa4a3){logger[_0x0029('0x30')](_0x3fa4a3[_0x0029('0x31')]);if(_0x3fa4a3[_0x0029('0x32')]){delete _0x3fa4a3[_0x0029('0x32')];}_0x3b24b3[_0x0029('0x1e')](_0x544422)[_0x0029('0x33')](_0x3fa4a3);};}exports[_0x0029('0x34')]=function(_0x14c321,_0x450fb3){var _0x535473={},_0xf2f295={},_0x3f31d2={'count':0x0,'rows':[]};var _0x482d42=_['map'](db[_0x0029('0x35')][_0x0029('0x36')],function(_0x57e963){return{'name':_0x57e963[_0x0029('0x37')],'type':_0x57e963[_0x0029('0x38')][_0x0029('0x39')]};});_0xf2f295[_0x0029('0x3a')]=_[_0x0029('0x3b')](_0x482d42,_0x0029('0x32'));_0xf2f295[_0x0029('0x3c')]=_[_0x0029('0x3d')](_0x14c321[_0x0029('0x3c')]);_0xf2f295[_0x0029('0x3e')]=_[_0x0029('0x3f')](_0xf2f295['model'],_0xf2f295[_0x0029('0x3c')]);_0x535473[_0x0029('0x40')]=_[_0x0029('0x3f')](_0xf2f295[_0x0029('0x3a')],qs[_0x0029('0x41')](_0x14c321[_0x0029('0x3c')][_0x0029('0x41')]));_0x535473[_0x0029('0x40')]=_0x535473['attributes'][_0x0029('0x42')]?_0x535473[_0x0029('0x40')]:_0xf2f295[_0x0029('0x3a')];if(!_0x14c321[_0x0029('0x3c')][_0x0029('0x43')](_0x0029('0x44'))){_0x535473[_0x0029('0x23')]=qs[_0x0029('0x23')](_0x14c321['query'][_0x0029('0x23')]);_0x535473['offset']=qs['offset'](_0x14c321['query'][_0x0029('0x20')]);}_0x535473[_0x0029('0x45')]=qs[_0x0029('0x46')](_0x14c321['query'][_0x0029('0x46')]);_0x535473[_0x0029('0x47')]=qs[_0x0029('0x3e')](_[_0x0029('0x48')](_0x14c321[_0x0029('0x3c')],_0xf2f295[_0x0029('0x3e')]),_0x482d42);if(_0x14c321[_0x0029('0x3c')]['filter']){_0x535473[_0x0029('0x47')]=_[_0x0029('0x49')](_0x535473[_0x0029('0x47')],{'$or':_[_0x0029('0x3b')](_0x482d42,function(_0x293f56){if(_0x293f56['type']!==_0x0029('0x4a')){var _0x12fe41={};_0x12fe41[_0x293f56[_0x0029('0x32')]]={'$like':'%'+_0x14c321[_0x0029('0x3c')]['filter']+'%'};return _0x12fe41;}})});}_0x535473=_[_0x0029('0x49')]({},_0x535473,_0x14c321[_0x0029('0x4b')]);var _0x532af4={'where':_0x535473[_0x0029('0x47')]};return db[_0x0029('0x35')][_0x0029('0x22')](_0x532af4)['then'](function(_0xcc354){_0x3f31d2[_0x0029('0x22')]=_0xcc354;if(_0x14c321[_0x0029('0x3c')][_0x0029('0x4c')]){_0x535473[_0x0029('0x4d')]=[{'all':!![]}];}return db[_0x0029('0x35')][_0x0029('0x4e')](_0x535473);})[_0x0029('0x2a')](function(_0x4ed6e9){_0x3f31d2[_0x0029('0x4f')]=_0x4ed6e9;return _0x3f31d2;})[_0x0029('0x2a')](respondWithFilteredResult(_0x450fb3,_0x535473))['catch'](handleError(_0x450fb3,null));};exports[_0x0029('0x50')]=function(_0x22def5,_0x4e8089){var _0x36da7d={'raw':![],'where':{'id':_0x22def5['params']['id']}},_0x561ede={};_0x561ede['model']=_[_0x0029('0x3d')](db['CmList']['rawAttributes']);_0x561ede[_0x0029('0x3c')]=_[_0x0029('0x3d')](_0x22def5['query']);_0x561ede[_0x0029('0x3e')]=_[_0x0029('0x3f')](_0x561ede[_0x0029('0x3a')],_0x561ede[_0x0029('0x3c')]);_0x36da7d['attributes']=_[_0x0029('0x3f')](_0x561ede[_0x0029('0x3a')],qs['fields'](_0x22def5[_0x0029('0x3c')][_0x0029('0x41')]));_0x36da7d[_0x0029('0x40')]=_0x36da7d[_0x0029('0x40')][_0x0029('0x42')]?_0x36da7d['attributes']:_0x561ede[_0x0029('0x3a')];if(_0x22def5['query'][_0x0029('0x4c')]){_0x36da7d[_0x0029('0x4d')]=[{'all':!![]}];}_0x36da7d=_[_0x0029('0x49')]({},_0x36da7d,_0x22def5['options']);return db[_0x0029('0x35')]['find'](_0x36da7d)['then'](handleEntityNotFound(_0x4e8089,null))['then'](respondWithResult(_0x4e8089,null))[_0x0029('0x51')](handleError(_0x4e8089,null));};exports[_0x0029('0x52')]=function(_0x39417d,_0x405f3e){return db[_0x0029('0x35')][_0x0029('0x52')](_0x39417d['body'],{})[_0x0029('0x2a')](function(_0x44bbba){var _0x3d3801=_0x39417d['user'][_0x0029('0x2c')]({'plain':!![]});if(!_0x3d3801)throw new Error(_0x0029('0x53'));if(_0x3d3801['role']===_0x0029('0x54')){var _0x21e3ef=_0x44bbba[_0x0029('0x2c')]({'plain':!![]});var _0xce60f1=_0x0029('0x2d');return db[_0x0029('0x55')][_0x0029('0x56')]({'where':{'name':_0xce60f1,'userProfileId':_0x3d3801[_0x0029('0x57')]},'raw':!![]})[_0x0029('0x2a')](function(_0x3e69a8){if(_0x3e69a8&&_0x3e69a8[_0x0029('0x58')]===0x0){return db['UserProfileResource'][_0x0029('0x52')]({'name':_0x21e3ef[_0x0029('0x32')],'resourceId':_0x21e3ef['id'],'type':_0x3e69a8[_0x0029('0x32')],'sectionId':_0x3e69a8['id']},{})[_0x0029('0x2a')](function(){return _0x44bbba;});}else{return _0x44bbba;}})['catch'](function(_0x52cc29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52cc29);throw _0x52cc29;});}return _0x44bbba;})[_0x0029('0x2a')](respondWithResult(_0x405f3e,0xc9))[_0x0029('0x51')](handleError(_0x405f3e,null));};exports['update']=function(_0x3d8f01,_0x20f048){if(_0x3d8f01[_0x0029('0x59')]['id']){delete _0x3d8f01[_0x0029('0x59')]['id'];}return db[_0x0029('0x35')][_0x0029('0x56')]({'where':{'id':_0x3d8f01[_0x0029('0x5a')]['id']}})['then'](handleEntityNotFound(_0x20f048,null))[_0x0029('0x2a')](saveUpdates(_0x3d8f01[_0x0029('0x59')],null))[_0x0029('0x2a')](respondWithResult(_0x20f048,null))[_0x0029('0x51')](handleError(_0x20f048,null));};exports['destroy']=function(_0x2daa35,_0x7fdf4){return db[_0x0029('0x35')][_0x0029('0x56')]({'where':{'id':_0x2daa35['params']['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x7fdf4,null))[_0x0029('0x2a')](removeEntity(_0x7fdf4,null))[_0x0029('0x51')](handleError(_0x7fdf4,null));};exports[_0x0029('0x5b')]=function(_0x1d4076,_0x58315e){return db['CmList'][_0x0029('0x5b')]()[_0x0029('0x2a')](respondWithResult(_0x58315e,null))[_0x0029('0x51')](handleError(_0x58315e,null));};exports[_0x0029('0x5c')]=function(_0x4f8726,_0x46c953,_0x59066f){if(_0x4f8726[_0x0029('0x59')]['id']){delete _0x4f8726[_0x0029('0x59')]['id'];}return db['CmList'][_0x0029('0x56')]({'where':{'id':_0x4f8726['params']['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x46c953,null))[_0x0029('0x2a')](function(_0x5cbf69){if(_0x5cbf69){_0x4f8726[_0x0029('0x59')][_0x0029('0x5d')]=_0x5cbf69['id'];return db['Disposition'][_0x0029('0x52')](_0x4f8726[_0x0029('0x59')]);}})[_0x0029('0x2a')](respondWithResult(_0x46c953,null))[_0x0029('0x51')](handleError(_0x46c953,null));};exports['getDispositions']=function(_0x1ca970,_0x575896,_0x140a13){var _0x49ca4d={'raw':![],'where':{}};var _0x216d49={};var _0x487d4c={'count':0x0,'rows':[]};return db[_0x0029('0x35')]['findOne']({'where':{'id':_0x1ca970[_0x0029('0x5a')]['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x575896,null))[_0x0029('0x2a')](function(_0x89be1c){if(_0x89be1c){_0x216d49['model']=_[_0x0029('0x3d')](db[_0x0029('0x5e')][_0x0029('0x36')]);_0x216d49['query']=_[_0x0029('0x3d')](_0x1ca970[_0x0029('0x3c')]);_0x216d49['filters']=_[_0x0029('0x3f')](_0x216d49[_0x0029('0x3a')],_0x216d49[_0x0029('0x3c')]);_0x49ca4d[_0x0029('0x40')]=_[_0x0029('0x3f')](_0x216d49[_0x0029('0x3a')],qs['fields'](_0x1ca970[_0x0029('0x3c')]['fields']));_0x49ca4d[_0x0029('0x40')]=_0x49ca4d[_0x0029('0x40')][_0x0029('0x42')]?_0x49ca4d[_0x0029('0x40')]:_0x216d49[_0x0029('0x3a')];if(!_0x1ca970[_0x0029('0x3c')]['hasOwnProperty'](_0x0029('0x44'))){_0x49ca4d[_0x0029('0x23')]=qs[_0x0029('0x23')](_0x1ca970[_0x0029('0x3c')]['limit']);_0x49ca4d[_0x0029('0x20')]=qs[_0x0029('0x20')](_0x1ca970[_0x0029('0x3c')][_0x0029('0x20')]);}_0x49ca4d[_0x0029('0x45')]=qs[_0x0029('0x46')](_0x1ca970[_0x0029('0x3c')][_0x0029('0x46')]);_0x49ca4d[_0x0029('0x47')]=qs[_0x0029('0x3e')](_[_0x0029('0x48')](_0x1ca970[_0x0029('0x3c')],_0x216d49['filters']));_0x49ca4d[_0x0029('0x47')]['ListId']=_0x89be1c['id'];if(_0x1ca970['query'][_0x0029('0x5f')]){_0x49ca4d[_0x0029('0x47')]=_[_0x0029('0x49')](_0x49ca4d['where'],{'$or':_[_0x0029('0x3b')](_0x49ca4d[_0x0029('0x40')],function(_0x4cad55){var _0x54bc54={};_0x54bc54[_0x4cad55]={'$like':'%'+_0x1ca970[_0x0029('0x3c')][_0x0029('0x5f')]+'%'};return _0x54bc54;})});}_0x49ca4d=_[_0x0029('0x49')]({},_0x49ca4d,_0x1ca970[_0x0029('0x4b')]);return db[_0x0029('0x5e')][_0x0029('0x22')]({'where':_0x49ca4d[_0x0029('0x47')]})['then'](function(_0x282014){_0x487d4c[_0x0029('0x22')]=_0x282014;if(_0x1ca970['query'][_0x0029('0x4c')]){_0x49ca4d[_0x0029('0x4d')]=[{'all':!![]}];}return db[_0x0029('0x5e')][_0x0029('0x4e')](_0x49ca4d);})[_0x0029('0x2a')](function(_0x4d599c){_0x487d4c['rows']=_0x4d599c;return _0x487d4c;});}})[_0x0029('0x2a')](respondWithFilteredResult(_0x575896,_0x49ca4d))['catch'](handleError(_0x575896,null));};exports[_0x0029('0x60')]=function(_0x2d976d,_0x4c6caa,_0x27b544){return db[_0x0029('0x35')][_0x0029('0x56')]({'where':{'id':_0x2d976d[_0x0029('0x5a')]['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x4c6caa,null))['then'](function(_0x59eeef){if(_0x59eeef){return _0x59eeef['removeDispositions'](_0x2d976d[_0x0029('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x4c6caa,null))[_0x0029('0x51')](handleError(_0x4c6caa,null));};exports[_0x0029('0x61')]=function(_0x5100fe,_0x568bed,_0x25af5c){return db[_0x0029('0x35')][_0x0029('0x56')]({'where':{'id':_0x5100fe[_0x0029('0x5a')]['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x568bed,null))[_0x0029('0x2a')](function(_0x33ff14){if(_0x33ff14){var _0x51030c=[];var _0x5ac769={'success':[],'errors':[]};return db[_0x0029('0x62')][_0x0029('0x5b')]()[_0x0029('0x2a')](function(_0x56893e){if(_0x5100fe['body'][_0x0029('0x63')]&&_[_0x0029('0x64')](_0x5100fe[_0x0029('0x59')][_0x0029('0x63')])){if(_0x5100fe['body'][_0x0029('0x63')][_0x0029('0x42')]){_0x5100fe['body'][_0x0029('0x63')]=_0x5100fe[_0x0029('0x59')][_0x0029('0x63')]['join'](';')+';';}else{_0x5100fe['body'][_0x0029('0x63')]=null;}}else{_0x5100fe['body'][_0x0029('0x63')]=null;}if(_0x5100fe[_0x0029('0x59')]&&_[_0x0029('0x64')](_0x5100fe[_0x0029('0x59')])){for(var _0x3dbb41=0x0;_0x3dbb41<_0x5100fe[_0x0029('0x59')][_0x0029('0x42')];_0x3dbb41+=0x1){_0x5100fe['body'][_0x3dbb41][_0x0029('0x5d')]=_0x5100fe[_0x0029('0x5a')]['id'];_0x51030c['push'](_0x5100fe[_0x0029('0x59')][_0x3dbb41]);}return BPromise['each'](_0x51030c,function(_0x3f64bd){return db[_0x0029('0x62')][_0x0029('0x52')](_[_0x0029('0x65')](_0x3f64bd,[_0x0029('0x66'),'id'])||{},{'fields':_['keys'](_0x56893e),'raw':!![]})[_0x0029('0x2a')](function(_0x492b7c){_0x5ac769['success']['push'](_0x492b7c[_0x0029('0x67')]);})[_0x0029('0x51')](function(_0x3c86c7){_0x5ac769[_0x0029('0x68')][_0x0029('0x69')]({'data':_0x3f64bd,'error':_0x3c86c7[_0x0029('0x6a')]});});})[_0x0029('0x2a')](function(_0x939b15){return _0x5ac769;})[_0x0029('0x51')](function(_0x583f84){return _0x583f84;});}else{_0x568bed['status'](0x190)[_0x0029('0x1f')]({'message':_0x0029('0x6b')});}});}})[_0x0029('0x2a')](respondWithResult(_0x568bed,null))[_0x0029('0x51')](handleError(_0x568bed,null));};exports['getContacts']=function(_0x40141c,_0xe0b40,_0x3544c8){var _0x3b6335;return db[_0x0029('0x35')][_0x0029('0x56')]({'where':{'id':_0x40141c[_0x0029('0x5a')]['id']},'include':[{'model':db[_0x0029('0x6c')],'as':_0x0029('0x6d')}]})[_0x0029('0x2a')](handleEntityNotFound(_0xe0b40,null))[_0x0029('0x2a')](function(_0x57e24a){if(_0x57e24a){_0x3b6335=_0x57e24a;return db[_0x0029('0x62')][_0x0029('0x36')];}})['then'](function(_0x241a4c){if(_0x241a4c){var _0x2fb699={};var _0x48ee50={};_0x48ee50[_0x0029('0x3a')]=_['concat'](_[_0x0029('0x3d')](_0x241a4c),_['map'](_0x3b6335[_0x0029('0x6d')],function(_0x4a5907){return util['format']('cf_%d',_0x4a5907['id']);}));_0x48ee50['query']=_['keys'](_0x40141c[_0x0029('0x3c')]);_0x48ee50[_0x0029('0x3e')]=_[_0x0029('0x3f')](_0x48ee50[_0x0029('0x3a')],_0x48ee50['query']);_0x2fb699['attributes']=_[_0x0029('0x3f')](_0x48ee50[_0x0029('0x3a')],qs[_0x0029('0x41')](_0x40141c['query'][_0x0029('0x41')]));_0x2fb699['attributes']=_0x2fb699['attributes'][_0x0029('0x42')]?_0x2fb699['attributes']:_0x48ee50[_0x0029('0x3a')];if(!_0x40141c[_0x0029('0x3c')][_0x0029('0x43')]('nolimit')){_0x2fb699['limit']=qs[_0x0029('0x23')](_0x40141c[_0x0029('0x3c')][_0x0029('0x23')]);_0x2fb699[_0x0029('0x20')]=qs[_0x0029('0x20')](_0x40141c[_0x0029('0x3c')][_0x0029('0x20')]);}_0x2fb699['order']=qs[_0x0029('0x46')](_0x40141c[_0x0029('0x3c')][_0x0029('0x46')]);_0x2fb699['where']=qs[_0x0029('0x3e')](_['pick'](_0x40141c[_0x0029('0x3c')],_0x48ee50[_0x0029('0x3e')]));_0x2fb699['raw']=!![];if(_0x40141c[_0x0029('0x3c')][_0x0029('0x5f')]){_0x2fb699[_0x0029('0x47')]=_['merge'](_0x2fb699[_0x0029('0x47')],{'$or':_[_0x0029('0x3b')](_0x2fb699[_0x0029('0x40')],function(_0x236dad){var _0x223387={};_0x223387[_0x236dad]={'$like':'%'+_0x40141c[_0x0029('0x3c')][_0x0029('0x5f')]+'%'};return _0x223387;})});}_0x2fb699=_['merge']({},_0x2fb699,_0x40141c['options']);return _0x3b6335[_0x0029('0x6e')](_0x2fb699);}})[_0x0029('0x2a')](respondWithResult(_0xe0b40,null))[_0x0029('0x51')](handleError(_0xe0b40,null));};exports[_0x0029('0x6f')]=function(_0x32322a,_0x4c360b,_0x216a75){var _0x5d58bf;return db[_0x0029('0x35')][_0x0029('0x56')]({'where':{'id':_0x32322a['params']['id']},'include':[{'model':db[_0x0029('0x6c')],'as':_0x0029('0x6d')}]})['then'](handleEntityNotFound(_0x4c360b,null))[_0x0029('0x2a')](function(_0x9b9a77){if(_0x9b9a77){_0x5d58bf=_0x9b9a77;return db[_0x0029('0x62')]['rawAttributes'];}})['then'](function(_0x4edb8f){if(_0x4edb8f){var _0x21dbd3={};var _0x4834a3={};_0x4834a3[_0x0029('0x3a')]=_[_0x0029('0x70')](_[_0x0029('0x3d')](_0x4edb8f),_[_0x0029('0x3b')](_0x5d58bf[_0x0029('0x6d')],function(_0x2ab859){return util['format'](_0x0029('0x71'),_0x2ab859['id']);}));_0x4834a3[_0x0029('0x3c')]=_[_0x0029('0x3d')](_0x32322a[_0x0029('0x3c')]);_0x4834a3[_0x0029('0x3e')]=_['intersection'](_0x4834a3[_0x0029('0x3a')],_0x4834a3[_0x0029('0x3c')]);_0x21dbd3['attributes']=_[_0x0029('0x3f')](_0x4834a3[_0x0029('0x3a')],qs[_0x0029('0x41')](_0x32322a['query'][_0x0029('0x41')]));_0x21dbd3[_0x0029('0x40')]=_0x21dbd3[_0x0029('0x40')]['length']?_0x21dbd3['attributes']:_0x4834a3[_0x0029('0x3a')];if(!_0x32322a[_0x0029('0x3c')][_0x0029('0x43')](_0x0029('0x44'))){_0x21dbd3['limit']=qs[_0x0029('0x23')](_0x32322a[_0x0029('0x3c')][_0x0029('0x23')]);_0x21dbd3['offset']=qs[_0x0029('0x20')](_0x32322a[_0x0029('0x3c')][_0x0029('0x20')]);}_0x21dbd3[_0x0029('0x45')]=qs['sort'](_0x32322a[_0x0029('0x3c')][_0x0029('0x46')]);_0x21dbd3[_0x0029('0x47')]=qs[_0x0029('0x3e')](_['pick'](_0x32322a[_0x0029('0x3c')],_0x4834a3[_0x0029('0x3e')]));_0x21dbd3[_0x0029('0x72')]=!![];if(_0x32322a[_0x0029('0x3c')][_0x0029('0x5f')]){_0x21dbd3[_0x0029('0x47')]=_['merge'](_0x21dbd3[_0x0029('0x47')],{'$or':_[_0x0029('0x3b')](_0x21dbd3[_0x0029('0x40')],function(_0x2d4244){var _0x2aa608={};_0x2aa608[_0x2d4244]={'$like':'%'+_0x32322a[_0x0029('0x3c')][_0x0029('0x5f')]+'%'};return _0x2aa608;})});}_0x21dbd3=_[_0x0029('0x49')]({},_0x21dbd3,_0x32322a[_0x0029('0x4b')]);return _0x5d58bf[_0x0029('0x6e')](_0x21dbd3);}})[_0x0029('0x2a')](function(_0x1f8e70){if(!_['isEmpty'](_0x1f8e70)){var _0x5ca940=toCsv(_0x1f8e70);var _0x55c21b=Date['now']();fs[_0x0029('0x73')](util[_0x0029('0x74')](_0x0029('0x75'),_0x5d58bf['id'],_0x55c21b),_0x5ca940);_0x4c360b[_0x0029('0x76')](_0x0029('0x77'),_0x0029('0x78')+util[_0x0029('0x74')](_0x0029('0x79'),_0x5d58bf['id'],_0x55c21b));_0x4c360b[_0x0029('0x76')](_0x0029('0x7a'),_0x0029('0x7b'));return _0x4c360b[_0x0029('0x7c')](util[_0x0029('0x74')](_0x0029('0x75'),_0x5d58bf['id'],_0x55c21b));}else{return _0x4c360b[_0x0029('0x1d')](0xcc);}})[_0x0029('0x51')](handleError(_0x4c360b,null));};exports[_0x0029('0x7d')]=function(_0xcc0c9,_0x17c7fc,_0x435994){var _0x4dab25;delete _0xcc0c9[_0x0029('0x59')]['id'];return db[_0x0029('0x35')][_0x0029('0x7e')]({'where':{'id':_0xcc0c9['params']['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x17c7fc,null))[_0x0029('0x2a')](function(_0x2ae875){if(_0x2ae875){return db[_0x0029('0x7f')]['transaction'](function(_0x9b4a3d){return db[_0x0029('0x6c')][_0x0029('0x52')](_0xcc0c9[_0x0029('0x59')],{'transaction':_0x9b4a3d})[_0x0029('0x2a')](function(_0x4c80af){_0x4dab25=_0x4c80af;return _0x2ae875[_0x0029('0x80')](_0x4c80af,{'transaction':_0x9b4a3d});})[_0x0029('0x2a')](function(){var _0x1d04ef={'type':db[_0x0029('0x81')][_0x0029('0x82')],'transaction':_0x9b4a3d};switch(_0xcc0c9[_0x0029('0x59')]['type']){case _0x0029('0x83'):_0x1d04ef[_0x0029('0x38')]=db['Sequelize'][_0x0029('0x82')];break;case _0x0029('0x84'):_0x1d04ef[_0x0029('0x38')]=db[_0x0029('0x81')][_0x0029('0x85')];break;case _0x0029('0x86'):_0x1d04ef[_0x0029('0x38')]=db[_0x0029('0x81')]['BOOLEAN'];_0x1d04ef[_0x0029('0x87')]=![];break;default:}return db[_0x0029('0x7f')][_0x0029('0x88')][_0x0029('0x89')](_0x0029('0x8a'),util['format']('cf_%s',_0x4dab25['id']),_0x1d04ef);})['then'](function(){return _0x4dab25;});});}})[_0x0029('0x2a')](respondWithResult(_0x17c7fc,null))['catch'](handleError(_0x17c7fc,null));};exports[_0x0029('0x8b')]=function(_0x4d991a,_0x281690,_0x6226b5){var _0x356fd9={};var _0x3ac1fe={};var _0x22a31c;var _0x1ec1e7;return db[_0x0029('0x35')][_0x0029('0x7e')]({'where':{'id':_0x4d991a[_0x0029('0x5a')]['id']}})['then'](handleEntityNotFound(_0x281690,null))[_0x0029('0x2a')](function(_0xa2942){if(_0xa2942){_0x22a31c=_0xa2942;_0x3ac1fe['model']=_[_0x0029('0x3d')](db[_0x0029('0x6c')][_0x0029('0x36')]);_0x3ac1fe['query']=_['keys'](_0x4d991a[_0x0029('0x3c')]);_0x3ac1fe[_0x0029('0x3e')]=_[_0x0029('0x3f')](_0x3ac1fe[_0x0029('0x3a')],_0x3ac1fe[_0x0029('0x3c')]);_0x356fd9['attributes']=_[_0x0029('0x3f')](_0x3ac1fe[_0x0029('0x3a')],qs[_0x0029('0x41')](_0x4d991a[_0x0029('0x3c')][_0x0029('0x41')]));_0x356fd9[_0x0029('0x40')]=_0x356fd9[_0x0029('0x40')][_0x0029('0x42')]?_0x356fd9[_0x0029('0x40')]:_0x3ac1fe['model'];_0x356fd9[_0x0029('0x45')]=qs[_0x0029('0x46')](_0x4d991a[_0x0029('0x3c')]['sort']);_0x356fd9[_0x0029('0x47')]=qs[_0x0029('0x3e')](_[_0x0029('0x48')](_0x4d991a[_0x0029('0x3c')],_0x3ac1fe['filters']));_0x356fd9[_0x0029('0x47')]=_[_0x0029('0x49')](_0x356fd9[_0x0029('0x47')],{'$or':[{'ListId':_0xa2942['id']},{'ListId':null}]});if(_0x4d991a[_0x0029('0x3c')][_0x0029('0x5f')]){_0x356fd9[_0x0029('0x47')]=_['merge'](_0x356fd9[_0x0029('0x47')],{'$or':_[_0x0029('0x3b')](_0x356fd9[_0x0029('0x40')],function(_0x5d0d95){var _0x34a9ad={};_0x34a9ad[_0x5d0d95]={'$like':'%'+_0x4d991a[_0x0029('0x3c')][_0x0029('0x5f')]+'%'};return _0x34a9ad;})});}_0x356fd9=_['merge']({},_0x356fd9,_0x4d991a[_0x0029('0x4b')]);return db[_0x0029('0x6c')][_0x0029('0x8c')](_0x356fd9);}})['then'](respondWithResult(_0x281690,null))['catch'](handleError(_0x281690,null));};exports[_0x0029('0x8d')]=function(_0x5566af,_0x32e79b,_0x3048a8){return db[_0x0029('0x35')]['find']({'where':{'id':_0x5566af['params']['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x32e79b,null))[_0x0029('0x2a')](function(_0x36b328){if(_0x36b328){return _0x36b328[_0x0029('0x8d')](_0x5566af[_0x0029('0x59')][_0x0029('0x66')],_[_0x0029('0x65')](_0x5566af[_0x0029('0x59')],[_0x0029('0x66'),'id'])||{})[_0x0029('0x8e')](function(_0x1c75d9){for(var _0x520adb=0x0;_0x520adb<_0x5566af[_0x0029('0x59')]['ids'][_0x0029('0x42')];_0x520adb+=0x1){socket[_0x0029('0x8f')](_0x0029('0x90'),{'UserId':Number(_0x5566af[_0x0029('0x59')][_0x0029('0x66')][_0x520adb]),'CmListId':Number(_0x5566af[_0x0029('0x5a')]['id'])});}return _0x1c75d9;});}})['then'](respondWithResult(_0x32e79b,null))['catch'](handleError(_0x32e79b,null));};exports[_0x0029('0x91')]=function(_0x4253de,_0x274e60,_0x2421d7){return db[_0x0029('0x35')]['find']({'where':{'id':_0x4253de[_0x0029('0x5a')]['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x274e60,null))['then'](function(_0x503976){if(_0x503976){return _0x503976[_0x0029('0x91')](_0x4253de['query'][_0x0029('0x66')])['then'](function(){if(_[_0x0029('0x64')](_0x4253de[_0x0029('0x3c')][_0x0029('0x66')])){for(var _0x835745=0x0;_0x835745<_0x4253de['query']['ids'][_0x0029('0x42')];_0x835745+=0x1){socket['emit'](_0x0029('0x92'),{'UserId':Number(_0x4253de[_0x0029('0x3c')][_0x0029('0x66')][_0x835745]),'CmListId':Number(_0x4253de[_0x0029('0x5a')]['id'])});}}else{socket[_0x0029('0x8f')](_0x0029('0x92'),{'UserId':Number(_0x4253de[_0x0029('0x3c')][_0x0029('0x66')]),'CmListId':Number(_0x4253de[_0x0029('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x274e60,null))['catch'](handleError(_0x274e60,null));};exports['getAgents']=function(_0x1f5193,_0x1557b0,_0x362948){var _0x393471={};var _0x29a17f={};var _0x4938f2;var _0x59d093;return db[_0x0029('0x35')][_0x0029('0x7e')]({'where':{'id':_0x1f5193[_0x0029('0x5a')]['id']}})[_0x0029('0x2a')](handleEntityNotFound(_0x1557b0,null))['then'](function(_0x5a779c){if(_0x5a779c){_0x4938f2=_0x5a779c;_0x29a17f['model']=_['keys'](db[_0x0029('0x93')]['rawAttributes']);_0x29a17f[_0x0029('0x3c')]=_['keys'](_0x1f5193[_0x0029('0x3c')]);_0x29a17f[_0x0029('0x3e')]=_[_0x0029('0x3f')](_0x29a17f[_0x0029('0x3a')],_0x29a17f[_0x0029('0x3c')]);_0x393471[_0x0029('0x40')]=_[_0x0029('0x3f')](_0x29a17f['model'],qs[_0x0029('0x41')](_0x1f5193[_0x0029('0x3c')][_0x0029('0x41')]));_0x393471[_0x0029('0x40')]=_0x393471[_0x0029('0x40')][_0x0029('0x42')]?_0x393471[_0x0029('0x40')]:_0x29a17f['model'];_0x393471[_0x0029('0x45')]=qs[_0x0029('0x46')](_0x1f5193['query'][_0x0029('0x46')]);_0x393471[_0x0029('0x47')]=qs['filters'](_[_0x0029('0x48')](_0x1f5193[_0x0029('0x3c')],_0x29a17f[_0x0029('0x3e')]));if(_0x1f5193[_0x0029('0x3c')]['filter']){_0x393471[_0x0029('0x47')]=_[_0x0029('0x49')](_0x393471[_0x0029('0x47')],{'$or':_[_0x0029('0x3b')](_0x393471[_0x0029('0x40')],function(_0x3536e2){var _0x134c07={};_0x134c07[_0x3536e2]={'$like':'%'+_0x1f5193[_0x0029('0x3c')][_0x0029('0x5f')]+'%'};return _0x134c07;})});}_0x393471=_[_0x0029('0x49')]({},_0x393471,_0x1f5193[_0x0029('0x4b')]);return _0x4938f2[_0x0029('0x94')](_0x393471);}})['then'](function(_0x243542){if(_0x243542){_0x59d093=_0x243542[_0x0029('0x42')];if(!_0x1f5193[_0x0029('0x3c')][_0x0029('0x43')](_0x0029('0x44'))){_0x393471[_0x0029('0x23')]=qs['limit'](_0x1f5193['query'][_0x0029('0x23')]);_0x393471[_0x0029('0x20')]=qs[_0x0029('0x20')](_0x1f5193[_0x0029('0x3c')][_0x0029('0x20')]);}return _0x4938f2[_0x0029('0x94')](_0x393471);}})['then'](function(_0x283254){if(_0x283254){return _0x283254?{'count':_0x59d093,'rows':_0x283254}:null;}})[_0x0029('0x2a')](respondWithResult(_0x1557b0,null))['catch'](handleError(_0x1557b0,null));};
\ No newline at end of file
index 81b3dce..4ff65b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe14b,0x93));var _0xbe14=function(_0x794fbb,_0x3eecf0){_0x794fbb=_0x794fbb-0x0;var _0x199acd=_0xe14b[_0x794fbb];return _0x199acd;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents;
\ No newline at end of file
+var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x5fc3[_0x5d30b4];return _0x1acfb8;};'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 2cbef8e..79c2060 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['cm_lists','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./cmList.attributes','define','CmList'];(function(_0xeea7d0,_0x2a6c4f){var _0x1eb2e0=function(_0x2ffb69){while(--_0x2ffb69){_0xeea7d0['push'](_0xeea7d0['shift']());}};_0x1eb2e0(++_0x2a6c4f);}(_0x668b,0x140));var _0xb668=function(_0x54c695,_0x5d6677){_0x54c695=_0x54c695-0x0;var _0x3ce06b=_0x668b[_0x54c695];return _0x3ce06b;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));module['exports']=function(_0x9b99a8,_0x296fa9){return _0x9b99a8[_0xb668('0x8')](_0xb668('0x9'),attributes,{'tableName':_0xb668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b02=['define','CmList','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0xfdd78e,_0x48b895){var _0x32f78a=function(_0x5488fa){while(--_0x5488fa){_0xfdd78e['push'](_0xfdd78e['shift']());}};_0x32f78a(++_0x48b895);}(_0x5b02,0xe9));var _0x25b0=function(_0x32fd87,_0xf620fd){_0x32fd87=_0x32fd87-0x0;var _0x95e08=_0x5b02[_0x32fd87];return _0x95e08;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e3ebc50..b55b9e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0372=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0372,0x82));var _0x2037=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0x0372[_0x1c0f41];return _0x369a9f;};'use strict';var _=require(_0x2037('0x0'));var util=require(_0x2037('0x1'));var moment=require('moment');var BPromise=require(_0x2037('0x2'));var rs=require(_0x2037('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2037('0x4'))['db'];var utils=require(_0x2037('0x5'));var logger=require(_0x2037('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2037('0x7'));var client=jayson['client'][_0x2037('0x8')]({'port':0x232a});config[_0x2037('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x484b58,_0x3a7001,_0x3af37a){return new BPromise(function(_0x22cb8c,_0x2482f2){return client[_0x2037('0xa')](_0x484b58,_0x3af37a)[_0x2037('0xb')](function(_0x361c8e){logger['info'](_0x2037('0xc'),_0x3a7001,_0x2037('0xd'));logger[_0x2037('0xe')](_0x2037('0xf'),_0x3a7001,_0x2037('0xd'),JSON['stringify'](_0x361c8e));if(_0x361c8e['error']){if(_0x361c8e[_0x2037('0x10')][_0x2037('0x11')]===0x1f4){logger[_0x2037('0x10')](_0x2037('0xc'),_0x3a7001,_0x361c8e[_0x2037('0x10')][_0x2037('0x12')]);return _0x2482f2(_0x361c8e['error']['message']);}logger[_0x2037('0x10')](_0x2037('0xc'),_0x3a7001,_0x361c8e[_0x2037('0x10')][_0x2037('0x12')]);return _0x22cb8c(_0x361c8e[_0x2037('0x10')]['message']);}else{logger[_0x2037('0x13')](_0x2037('0xc'),_0x3a7001,_0x2037('0xd'));_0x22cb8c(_0x361c8e[_0x2037('0x14')][_0x2037('0x12')]);}})[_0x2037('0x15')](function(_0x34d400){logger['error'](_0x2037('0xc'),_0x3a7001,_0x34d400);_0x2482f2(_0x34d400);});});}
\ No newline at end of file
+var _0x5892=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util'];(function(_0x157378,_0x289db9){var _0x24a418=function(_0x245454){while(--_0x245454){_0x157378['push'](_0x157378['shift']());}};_0x24a418(++_0x289db9);}(_0x5892,0xfa));var _0x2589=function(_0x2ea6db,_0x4734bb){_0x2ea6db=_0x2ea6db-0x0;var _0xb560b5=_0x5892[_0x2ea6db];return _0xb560b5;};'use strict';var _=require(_0x2589('0x0'));var util=require(_0x2589('0x1'));var moment=require(_0x2589('0x2'));var BPromise=require(_0x2589('0x3'));var rs=require(_0x2589('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2589('0x5'))['db'];var utils=require(_0x2589('0x6'));var logger=require(_0x2589('0x7'))(_0x2589('0x8'));var config=require(_0x2589('0x9'));var jayson=require(_0x2589('0xa'));var client=jayson[_0x2589('0xb')][_0x2589('0xc')]({'port':0x232a});config[_0x2589('0xd')]=_[_0x2589('0xe')](config[_0x2589('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2589('0xd')]));require(_0x2589('0xf'))[_0x2589('0x10')](socket);function respondWithRpcPromise(_0x1dcd88,_0x2ccefc,_0x21ba4d){return new BPromise(function(_0x3b3723,_0x440b0f){return client[_0x2589('0x11')](_0x1dcd88,_0x21ba4d)[_0x2589('0x12')](function(_0x92b9eb){logger['info'](_0x2589('0x13'),_0x2ccefc,_0x2589('0x14'));logger[_0x2589('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x2ccefc,_0x2589('0x14'),JSON['stringify'](_0x92b9eb));if(_0x92b9eb[_0x2589('0x16')]){if(_0x92b9eb[_0x2589('0x16')][_0x2589('0x17')]===0x1f4){logger[_0x2589('0x16')](_0x2589('0x13'),_0x2ccefc,_0x92b9eb[_0x2589('0x16')][_0x2589('0x18')]);return _0x440b0f(_0x92b9eb[_0x2589('0x16')][_0x2589('0x18')]);}logger[_0x2589('0x16')](_0x2589('0x13'),_0x2ccefc,_0x92b9eb[_0x2589('0x16')][_0x2589('0x18')]);return _0x3b3723(_0x92b9eb[_0x2589('0x16')][_0x2589('0x18')]);}else{logger[_0x2589('0x19')](_0x2589('0x13'),_0x2ccefc,_0x2589('0x14'));_0x3b3723(_0x92b9eb[_0x2589('0x1a')][_0x2589('0x18')]);}})[_0x2589('0x1b')](function(_0x34e9d5){logger[_0x2589('0x16')](_0x2589('0x13'),_0x2ccefc,_0x34e9d5);_0x440b0f(_0x34e9d5);});});}
\ No newline at end of file
index 2bd5f91..3c9dd42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc93d=['removeListener','register','length','cmList:','./cmList.events','save','update','emit'];(function(_0x31b231,_0x356c73){var _0x2941e0=function(_0x3fe609){while(--_0x3fe609){_0x31b231['push'](_0x31b231['shift']());}};_0x2941e0(++_0x356c73);}(_0xc93d,0x64));var _0xdc93=function(_0x1c4951,_0x2038ee){_0x1c4951=_0x1c4951-0x0;var _0x345e1b=_0xc93d[_0x1c4951];return _0x345e1b;};'use strict';var CmListEvents=require(_0xdc93('0x0'));var events=[_0xdc93('0x1'),'remove',_0xdc93('0x2')];function createListener(_0x306e2a,_0x1e8c42){return function(_0x4e9693){_0x1e8c42[_0xdc93('0x3')](_0x306e2a,_0x4e9693);};}function removeListener(_0x2b4474,_0x33a29f){return function(){CmListEvents[_0xdc93('0x4')](_0x2b4474,_0x33a29f);};}exports[_0xdc93('0x5')]=function(_0x5abe89){for(var _0x2c4a81=0x0,_0x51d5e7=events[_0xdc93('0x6')];_0x2c4a81<_0x51d5e7;_0x2c4a81++){var _0x3398ac=events[_0x2c4a81];var _0x142088=createListener(_0xdc93('0x7')+_0x3398ac,_0x5abe89);CmListEvents['on'](_0x3398ac,_0x142088);}};
\ No newline at end of file
+var _0xbf44=['remove','update','emit','removeListener','register','cmList:','./cmList.events'];(function(_0x2227d4,_0x32a463){var _0x42c8e9=function(_0x496356){while(--_0x496356){_0x2227d4['push'](_0x2227d4['shift']());}};_0x42c8e9(++_0x32a463);}(_0xbf44,0xbc));var _0x4bf4=function(_0x3a72e4,_0x556adf){_0x3a72e4=_0x3a72e4-0x0;var _0xbf6a40=_0xbf44[_0x3a72e4];return _0xbf6a40;};'use strict';var CmListEvents=require(_0x4bf4('0x0'));var events=['save',_0x4bf4('0x1'),_0x4bf4('0x2')];function createListener(_0x13d685,_0x59598a){return function(_0x14d100){_0x59598a[_0x4bf4('0x3')](_0x13d685,_0x14d100);};}function removeListener(_0x2f2b6a,_0x162b00){return function(){CmListEvents[_0x4bf4('0x4')](_0x2f2b6a,_0x162b00);};}exports[_0x4bf4('0x5')]=function(_0x4a718c){for(var _0x48ff23=0x0,_0x1ca302=events['length'];_0x48ff23<_0x1ca302;_0x48ff23++){var _0x54053d=events[_0x48ff23];var _0x32e684=createListener(_0x4bf4('0x6')+_0x54053d,_0x4a718c);CmListEvents['on'](_0x54053d,_0x32e684);}};
\ No newline at end of file
index 710bdd6..c895a72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eec=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','Router'];(function(_0x23b9ad,_0x17de1e){var _0x54801e=function(_0x4d5c04){while(--_0x4d5c04){_0x23b9ad['push'](_0x23b9ad['shift']());}};_0x54801e(++_0x17de1e);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x61b988,_0x20d3a9){_0x61b988=_0x61b988-0x0;var _0x49bc55=_0x3eec[_0x61b988];return _0x49bc55;};'use strict';var multer=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var path=require(_0xc3ee('0x2'));var timeout=require(_0xc3ee('0x3'));var express=require('express');var router=express[_0xc3ee('0x4')]();var fs_extra=require(_0xc3ee('0x5'));var auth=require(_0xc3ee('0x6'));var interaction=require(_0xc3ee('0x7'));var config=require(_0xc3ee('0x8'));var controller=require(_0xc3ee('0x9'));router['get']('/',auth[_0xc3ee('0xa')](),controller[_0xc3ee('0xb')]);router[_0xc3ee('0xc')](_0xc3ee('0xd'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0xe')]);router[_0xc3ee('0xc')](_0xc3ee('0xf'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x10')]);router['get']('/:id',auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x11')]);router[_0xc3ee('0xc')](_0xc3ee('0x12'),auth['isAuthenticated'](),controller[_0xc3ee('0x13')]);router['get'](_0xc3ee('0x14'),auth[_0xc3ee('0xa')](),controller['getContacts']);router['get'](_0xc3ee('0x15'),auth['isAuthenticated'](),controller[_0xc3ee('0x16')]);router['get'](_0xc3ee('0x17'),auth['isAuthenticated'](),controller[_0xc3ee('0x18')]);router[_0xc3ee('0xc')](_0xc3ee('0x19'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x1a')]);router[_0xc3ee('0x1b')]('/',auth[_0xc3ee('0xa')](),controller['create']);router[_0xc3ee('0x1b')]('/:id/dispositions',auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x1c')]);router[_0xc3ee('0x1b')](_0xc3ee('0x14'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x1d')]);router[_0xc3ee('0x1b')](_0xc3ee('0x17'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x1e')]);router[_0xc3ee('0x1b')](_0xc3ee('0x19'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x1f')]);router[_0xc3ee('0x20')](_0xc3ee('0x21'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x22')]);router[_0xc3ee('0x23')](_0xc3ee('0x21'),auth[_0xc3ee('0xa')](),controller['destroy']);router['delete'](_0xc3ee('0x12'),auth[_0xc3ee('0xa')](),controller[_0xc3ee('0x24')]);router[_0xc3ee('0x23')](_0xc3ee('0x19'),auth[_0xc3ee('0xa')](),controller['removeAgents']);module[_0xc3ee('0x25')]=router;
\ No newline at end of file
+var _0x31fe=['get','isAuthenticated','/describe','describe','show','/:id/dispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','/:id/contacts','addCustomField','put','/:id','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller'];(function(_0x44ee0e,_0x322de2){var _0x2f1a38=function(_0x554da2){while(--_0x554da2){_0x44ee0e['push'](_0x44ee0e['shift']());}};_0x2f1a38(++_0x322de2);}(_0x31fe,0x1e6));var _0xe31f=function(_0x11471d,_0x47f2ad){_0x11471d=_0x11471d-0x0;var _0x197d16=_0x31fe[_0x11471d];return _0x197d16;};'use strict';var multer=require(_0xe31f('0x0'));var util=require(_0xe31f('0x1'));var path=require(_0xe31f('0x2'));var timeout=require(_0xe31f('0x3'));var express=require(_0xe31f('0x4'));var router=express[_0xe31f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe31f('0x6'));var interaction=require(_0xe31f('0x7'));var config=require('../../config/environment');var controller=require(_0xe31f('0x8'));router[_0xe31f('0x9')]('/',auth[_0xe31f('0xa')](),controller['index']);router['get'](_0xe31f('0xb'),auth[_0xe31f('0xa')](),controller[_0xe31f('0xc')]);router[_0xe31f('0x9')]('/:id',auth[_0xe31f('0xa')](),controller[_0xe31f('0xd')]);router['get'](_0xe31f('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xe31f('0x9')]('/:id/contacts',auth[_0xe31f('0xa')](),controller[_0xe31f('0xf')]);router[_0xe31f('0x9')](_0xe31f('0x10'),auth[_0xe31f('0xa')](),controller[_0xe31f('0x11')]);router['get'](_0xe31f('0x12'),auth[_0xe31f('0xa')](),controller[_0xe31f('0x13')]);router[_0xe31f('0x9')](_0xe31f('0x14'),auth[_0xe31f('0xa')](),controller[_0xe31f('0x15')]);router[_0xe31f('0x16')]('/',auth[_0xe31f('0xa')](),controller['create']);router['post']('/:id/dispositions',auth[_0xe31f('0xa')](),controller[_0xe31f('0x17')]);router[_0xe31f('0x16')](_0xe31f('0x18'),auth[_0xe31f('0xa')](),controller['addContacts']);router[_0xe31f('0x16')]('/:id/fields',auth[_0xe31f('0xa')](),controller[_0xe31f('0x19')]);router['post'](_0xe31f('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0xe31f('0x1a')](_0xe31f('0x1b'),auth['isAuthenticated'](),controller[_0xe31f('0x1c')]);router[_0xe31f('0x1d')]('/:id',auth[_0xe31f('0xa')](),controller[_0xe31f('0x1e')]);router['delete'](_0xe31f('0xe'),auth['isAuthenticated'](),controller[_0xe31f('0x1f')]);router['delete'](_0xe31f('0x14'),auth[_0xe31f('0xa')](),controller['removeAgents']);module[_0xe31f('0x20')]=router;
\ No newline at end of file
index c2e483c..f8e0e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4393=['sequelize','exports','STRING'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x4393,0xc3));var _0x3439=function(_0x3330f9,_0x46c3e5){_0x3330f9=_0x3330f9-0x0;var _0xdb9afb=_0x4393[_0x3330f9];return _0xdb9afb;};'use strict';var Sequelize=require(_0x3439('0x0'));module[_0x3439('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4b6325){return this['getDataValue']('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x3439('0x2')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x6daa=['sequelize','VIRTUAL','getDataValue','field','STRING'];(function(_0x4eb954,_0x1b8c20){var _0x27ebc1=function(_0x4798e1){while(--_0x4798e1){_0x4eb954['push'](_0x4eb954['shift']());}};_0x27ebc1(++_0x1b8c20);}(_0x6daa,0x1db));var _0xa6da=function(_0x4b8149,_0xfa00cc){_0x4b8149=_0x4b8149-0x0;var _0x5ea2d1=_0x6daa[_0x4b8149];return _0x5ea2d1;};'use strict';var Sequelize=require(_0xa6da('0x0'));module['exports']={'name':{'type':Sequelize[_0xa6da('0x1')],'get':function(_0x321a88){return this[_0xa6da('0x2')](_0xa6da('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xa6da('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xa6da('0x4')],'allowNull':![]}};
\ No newline at end of file
index 4b5eeb8..bd33554 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(_0x2e91c7,_0x51f82d){var _0x207f9b=function(_0x28fb05){while(--_0x28fb05){_0x2e91c7['push'](_0x2e91c7['shift']());}};_0x207f9b(++_0x51f82d);}(_0x7a54,0x106));var _0x47a5=function(_0x30f3c0,_0x18912f){_0x30f3c0=_0x30f3c0-0x0;var _0x4229b1=_0x7a54[_0x30f3c0];return _0x4229b1;};'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(_0x419bfb,_0x42463e){var _0x2da7c5=function(_0xcc24a4){while(--_0xcc24a4){_0x419bfb['push'](_0x419bfb['shift']());}};_0x2da7c5(++_0x42463e);}(_0x7a54,0x106));var _0x47a5=function(_0xf8b00f,_0x2b5252){_0xf8b00f=_0xf8b00f-0x0;var _0x4fe190=_0x7a54[_0xf8b00f];return _0x4fe190;};'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 9b99829..c7e823c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd66=['define','Condition','tools_conditions','lodash','util','api','path','rimraf','./condition.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbd66,0x143));var _0x6bd6=function(_0x4495a2,_0x11bbb8){_0x4495a2=_0x4495a2-0x0;var _0x35ce3f=_0xbd66[_0x4495a2];return _0x35ce3f;};'use strict';var _=require(_0x6bd6('0x0'));var util=require(_0x6bd6('0x1'));var logger=require('../../config/logger')(_0x6bd6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bd6('0x3'));var rimraf=require(_0x6bd6('0x4'));var config=require('../../config/environment');var attributes=require(_0x6bd6('0x5'));module[_0x6bd6('0x6')]=function(_0x50083c,_0x151f27){return _0x50083c[_0x6bd6('0x7')](_0x6bd6('0x8'),attributes,{'tableName':_0x6bd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd88=['Condition','tools_conditions','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports'];(function(_0xae9024,_0x17f58e){var _0x23e7d3=function(_0x5911fb){while(--_0x5911fb){_0xae9024['push'](_0xae9024['shift']());}};_0x23e7d3(++_0x17f58e);}(_0xdd88,0xda));var _0x8dd8=function(_0x180a7a,_0x12aa00){_0x180a7a=_0x180a7a-0x0;var _0x3c356b=_0xdd88[_0x180a7a];return _0x3c356b;};'use strict';var _=require(_0x8dd8('0x0'));var util=require(_0x8dd8('0x1'));var logger=require('../../config/logger')(_0x8dd8('0x2'));var moment=require(_0x8dd8('0x3'));var BPromise=require(_0x8dd8('0x4'));var rp=require(_0x8dd8('0x5'));var fs=require('fs');var path=require(_0x8dd8('0x6'));var rimraf=require('rimraf');var config=require(_0x8dd8('0x7'));var attributes=require(_0x8dd8('0x8'));module[_0x8dd8('0x9')]=function(_0x59db6b,_0x49a63c){return _0x59db6b['define'](_0x8dd8('0xa'),attributes,{'tableName':_0x8dd8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index adbb819..bdb1a19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4300=['code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x242de3,_0x444c03){var _0x4d2f23=function(_0x2f7f1a){while(--_0x2f7f1a){_0x242de3['push'](_0x242de3['shift']());}};_0x4d2f23(++_0x444c03);}(_0x4300,0x194));var _0x0430=function(_0x428801,_0x1a886b){_0x428801=_0x428801-0x0;var _0x299c10=_0x4300[_0x428801];return _0x299c10;};'use strict';var _=require(_0x0430('0x0'));var util=require(_0x0430('0x1'));var moment=require('moment');var BPromise=require(_0x0430('0x2'));var rs=require(_0x0430('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0430('0x4'));var logger=require(_0x0430('0x5'))(_0x0430('0x6'));var config=require(_0x0430('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fbcd0,_0x500f3f,_0x4824ab){return new BPromise(function(_0x3d6766,_0x289840){return client[_0x0430('0x8')](_0x3fbcd0,_0x4824ab)['then'](function(_0x5c7bc3){logger[_0x0430('0x9')](_0x0430('0xa'),_0x500f3f,_0x0430('0xb'));logger[_0x0430('0xc')](_0x0430('0xd'),_0x500f3f,_0x0430('0xb'),JSON[_0x0430('0xe')](_0x5c7bc3));if(_0x5c7bc3[_0x0430('0xf')]){if(_0x5c7bc3[_0x0430('0xf')][_0x0430('0x10')]===0x1f4){logger['error'](_0x0430('0xa'),_0x500f3f,_0x5c7bc3['error'][_0x0430('0x11')]);return _0x289840(_0x5c7bc3[_0x0430('0xf')]['message']);}logger[_0x0430('0xf')](_0x0430('0xa'),_0x500f3f,_0x5c7bc3['error'][_0x0430('0x11')]);return _0x3d6766(_0x5c7bc3[_0x0430('0xf')][_0x0430('0x11')]);}else{logger[_0x0430('0x9')](_0x0430('0xa'),_0x500f3f,_0x0430('0xb'));_0x3d6766(_0x5c7bc3[_0x0430('0x12')][_0x0430('0x11')]);}})[_0x0430('0x13')](function(_0x28d5f1){logger['error'](_0x0430('0xa'),_0x500f3f,_0x28d5f1);_0x289840(_0x28d5f1);});});}
\ No newline at end of file
+var _0xeff0=['debug','stringify','error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0xc3a851,_0x403f43){var _0xa10901=function(_0x1e839d){while(--_0x1e839d){_0xc3a851['push'](_0xc3a851['shift']());}};_0xa10901(++_0x403f43);}(_0xeff0,0x16f));var _0x0eff=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xeff0[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x0eff('0x0'));var util=require(_0x0eff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0eff('0x2'));var fs=require('fs');var Redis=require(_0x0eff('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0eff('0x4'))(_0x0eff('0x5'));var config=require(_0x0eff('0x6'));var jayson=require(_0x0eff('0x7'));var client=jayson['client'][_0x0eff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39d60c,_0x558af8,_0x4f23a2){return new BPromise(function(_0x3ce44d,_0x11fa66){return client[_0x0eff('0x9')](_0x39d60c,_0x4f23a2)[_0x0eff('0xa')](function(_0x1d4628){logger[_0x0eff('0xb')]('Condition,\x20%s,\x20%s',_0x558af8,_0x0eff('0xc'));logger[_0x0eff('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x558af8,_0x0eff('0xc'),JSON[_0x0eff('0xe')](_0x1d4628));if(_0x1d4628[_0x0eff('0xf')]){if(_0x1d4628[_0x0eff('0xf')]['code']===0x1f4){logger[_0x0eff('0xf')](_0x0eff('0x10'),_0x558af8,_0x1d4628[_0x0eff('0xf')][_0x0eff('0x11')]);return _0x11fa66(_0x1d4628[_0x0eff('0xf')][_0x0eff('0x11')]);}logger[_0x0eff('0xf')](_0x0eff('0x10'),_0x558af8,_0x1d4628[_0x0eff('0xf')]['message']);return _0x3ce44d(_0x1d4628[_0x0eff('0xf')][_0x0eff('0x11')]);}else{logger[_0x0eff('0xb')](_0x0eff('0x10'),_0x558af8,'request\x20sent');_0x3ce44d(_0x1d4628[_0x0eff('0x12')][_0x0eff('0x11')]);}})[_0x0eff('0x13')](function(_0x50f8f9){logger[_0x0eff('0xf')]('Condition,\x20%s,\x20%s',_0x558af8,_0x50f8f9);_0x11fa66(_0x50f8f9);});});}
\ No newline at end of file
index 7084532..fd15e49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef47=['../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','multer','util','path','Router','fs-extra'];(function(_0x5678c2,_0xd8cb89){var _0x263105=function(_0x4bb4e9){while(--_0x4bb4e9){_0x5678c2['push'](_0x5678c2['shift']());}};_0x263105(++_0xd8cb89);}(_0xef47,0x11b));var _0x7ef4=function(_0x190eee,_0x7a5516){_0x190eee=_0x190eee-0x0;var _0x19a4d6=_0xef47[_0x190eee];return _0x19a4d6;};'use strict';var multer=require(_0x7ef4('0x0'));var util=require(_0x7ef4('0x1'));var path=require(_0x7ef4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7ef4('0x3')]();var fs_extra=require(_0x7ef4('0x4'));var auth=require(_0x7ef4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7ef4('0x6'));var controller=require(_0x7ef4('0x7'));router['put'](_0x7ef4('0x8'),auth[_0x7ef4('0x9')](),controller[_0x7ef4('0xa')]);router[_0x7ef4('0xb')](_0x7ef4('0x8'),auth[_0x7ef4('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc884=['../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x3210c2,_0x2545fe){var _0x2889e3=function(_0x306b14){while(--_0x306b14){_0x3210c2['push'](_0x3210c2['shift']());}};_0x2889e3(++_0x2545fe);}(_0xc884,0x12e));var _0x4c88=function(_0x2b9249,_0x3824c7){_0x2b9249=_0x2b9249-0x0;var _0x5eb6a5=_0xc884[_0x2b9249];return _0x5eb6a5;};'use strict';var multer=require(_0x4c88('0x0'));var util=require(_0x4c88('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c88('0x2'));var router=express[_0x4c88('0x3')]();var fs_extra=require(_0x4c88('0x4'));var auth=require(_0x4c88('0x5'));var interaction=require(_0x4c88('0x6'));var config=require('../../config/environment');var controller=require(_0x4c88('0x7'));router[_0x4c88('0x8')](_0x4c88('0x9'),auth[_0x4c88('0xa')](),controller[_0x4c88('0xb')]);router['delete'](_0x4c88('0x9'),auth[_0x4c88('0xa')](),controller[_0x4c88('0xc')]);module[_0x4c88('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js
deleted file mode 100644 (file)
index 60ac8c2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xdc35=['exports','name','INTEGER','sequelize'];(function(_0xee6366,_0xe36b0a){var _0xe4d7bc=function(_0x1ce306){while(--_0x1ce306){_0xee6366['push'](_0xee6366['shift']());}};_0xe4d7bc(++_0xe36b0a);}(_0xdc35,0x15b));var _0x5dc3=function(_0x33bf42,_0xf89caf){_0x33bf42=_0x33bf42-0x0;var _0x14cc51=_0xdc35[_0x33bf42];return _0x14cc51;};'use strict';var Sequelize=require(_0x5dc3('0x0'));module[_0x5dc3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5dc3('0x2')},'OrderBy':{'type':Sequelize[_0x5dc3('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js
deleted file mode 100644 (file)
index 6858bec..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0x14a0=['undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','params','CmContactHasItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0x14a0,0x8e));var _0x014a=function(_0x3520ab,_0x2c3d27){_0x3520ab=_0x3520ab-0x0;var _0x3ce66e=_0x14a0[_0x3520ab];return _0x3ce66e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];function respondWithStatusCode(_0x43bfeb,_0x1bcd1){_0x1bcd1=_0x1bcd1||0xcc;return function(_0x20cb56){if(_0x20cb56){return _0x43bfeb[_0x014a('0x14')](_0x1bcd1);}return _0x43bfeb[_0x014a('0x15')](_0x1bcd1)[_0x014a('0x16')]();};}function respondWithResult(_0x71535d,_0x45cd80){_0x45cd80=_0x45cd80||0xc8;return function(_0x3c54c8){if(_0x3c54c8){return _0x71535d['status'](_0x45cd80)[_0x014a('0x17')](_0x3c54c8);}};}function respondWithFilteredResult(_0x3cf92f,_0x59f207){return function(_0x3a836f){if(_0x3a836f){var _0x128c46=typeof _0x59f207['offset']===_0x014a('0x18')&&typeof _0x59f207[_0x014a('0x19')]===_0x014a('0x18');var _0x12da95=_0x3a836f[_0x014a('0x1a')];var _0x12d339=_0x128c46?0x0:_0x59f207[_0x014a('0x1b')];var _0x263b07=_0x128c46?_0x3a836f[_0x014a('0x1a')]:_0x59f207[_0x014a('0x1b')]+_0x59f207[_0x014a('0x19')];var _0x89e132;if(_0x263b07>=_0x12da95){_0x263b07=_0x12da95;_0x89e132=0xc8;}else{_0x89e132=0xce;}_0x3cf92f[_0x014a('0x15')](_0x89e132);return _0x3cf92f[_0x014a('0x1c')]('Content-Range',_0x12d339+'-'+_0x263b07+'/'+_0x12da95)[_0x014a('0x17')](_0x3a836f);}return null;};}function patchUpdates(_0x109a9c){return function(_0x11065f){try{jsonpatch[_0x014a('0x1d')](_0x11065f,_0x109a9c,!![]);}catch(_0xc9a563){return BPromise[_0x014a('0x1e')](_0xc9a563);}return _0x11065f[_0x014a('0x1f')]();};}function saveUpdates(_0x3dd2d0,_0x290b86){return function(_0x486e66){if(_0x486e66){return _0x486e66[_0x014a('0x20')](_0x3dd2d0)['then'](function(_0x1a1318){return _0x1a1318;});}return null;};}function removeEntity(_0x26718b,_0x44d921){return function(_0x36d52b){if(_0x36d52b){return _0x36d52b[_0x014a('0x21')]()[_0x014a('0x22')](function(){var _0x3fec9f=_0x36d52b[_0x014a('0x23')]({'plain':!![]});var _0x165a42='ContactItemTypes';return db[_0x014a('0x24')]['destroy']({'where':{'type':_0x165a42,'resourceId':_0x3fec9f['id']}})[_0x014a('0x22')](function(){return _0x36d52b;});})[_0x014a('0x22')](function(){_0x26718b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a901f,_0x3f9719){return function(_0x143346){if(!_0x143346){_0x9a901f['sendStatus'](0x194);}return _0x143346;};}function handleError(_0x183f19,_0x3c1fa4){_0x3c1fa4=_0x3c1fa4||0x1f4;return function(_0x598179){logger[_0x014a('0x25')](_0x598179[_0x014a('0x26')]);if(_0x598179['name']){delete _0x598179['name'];}_0x183f19[_0x014a('0x15')](_0x3c1fa4)[_0x014a('0x27')](_0x598179);};}exports[_0x014a('0x28')]=function(_0x29fce5,_0x4ea00c){var _0x434038={},_0x147e7e={},_0x15af07={'count':0x0,'rows':[]};var _0x402d3b=_[_0x014a('0x29')](db[_0x014a('0x2a')][_0x014a('0x2b')],function(_0x1dae8e){return{'name':_0x1dae8e[_0x014a('0x2c')],'type':_0x1dae8e[_0x014a('0x2d')][_0x014a('0x2e')]};});_0x147e7e['model']=_[_0x014a('0x29')](_0x402d3b,_0x014a('0x2f'));_0x147e7e[_0x014a('0x30')]=_[_0x014a('0x31')](_0x29fce5[_0x014a('0x30')]);_0x147e7e[_0x014a('0x32')]=_[_0x014a('0x33')](_0x147e7e['model'],_0x147e7e[_0x014a('0x30')]);_0x434038[_0x014a('0x34')]=_['intersection'](_0x147e7e[_0x014a('0x35')],qs[_0x014a('0x36')](_0x29fce5[_0x014a('0x30')][_0x014a('0x36')]));_0x434038[_0x014a('0x34')]=_0x434038[_0x014a('0x34')][_0x014a('0x37')]?_0x434038[_0x014a('0x34')]:_0x147e7e['model'];if(!_0x29fce5[_0x014a('0x30')][_0x014a('0x38')](_0x014a('0x39'))){_0x434038[_0x014a('0x19')]=qs['limit'](_0x29fce5[_0x014a('0x30')][_0x014a('0x19')]);_0x434038[_0x014a('0x1b')]=qs[_0x014a('0x1b')](_0x29fce5[_0x014a('0x30')][_0x014a('0x1b')]);}_0x434038[_0x014a('0x3a')]=qs[_0x014a('0x3b')](_0x29fce5[_0x014a('0x30')]['sort']);_0x434038[_0x014a('0x3c')]=qs['filters'](_[_0x014a('0x3d')](_0x29fce5[_0x014a('0x30')],_0x147e7e[_0x014a('0x32')]),_0x402d3b);if(_0x29fce5[_0x014a('0x30')][_0x014a('0x3e')]){_0x434038['where']=_[_0x014a('0x3f')](_0x434038[_0x014a('0x3c')],{'$or':_['map'](_0x402d3b,function(_0x9227b8){if(_0x9227b8[_0x014a('0x2d')]!==_0x014a('0x40')){var _0x2e7a14={};_0x2e7a14[_0x9227b8[_0x014a('0x2f')]]={'$like':'%'+_0x29fce5[_0x014a('0x30')][_0x014a('0x3e')]+'%'};return _0x2e7a14;}})});}_0x434038=_[_0x014a('0x3f')]({},_0x434038,_0x29fce5[_0x014a('0x41')]);var _0x537bde={'where':_0x434038[_0x014a('0x3c')]};return db[_0x014a('0x2a')][_0x014a('0x1a')](_0x537bde)[_0x014a('0x22')](function(_0x5f1a91){_0x15af07[_0x014a('0x1a')]=_0x5f1a91;if(_0x29fce5[_0x014a('0x30')][_0x014a('0x42')]){_0x434038[_0x014a('0x43')]=[{'all':!![]}];}return db[_0x014a('0x2a')][_0x014a('0x44')](_0x434038);})['then'](function(_0x361866){_0x15af07[_0x014a('0x45')]=_0x361866;return _0x15af07;})['then'](respondWithFilteredResult(_0x4ea00c,_0x434038))[_0x014a('0x46')](handleError(_0x4ea00c,null));};exports[_0x014a('0x47')]=function(_0x2c45f1,_0x5dc092){var _0x5bcf8={'raw':!![],'where':{'id':_0x2c45f1['params']['id']}},_0x50a8f0={};_0x50a8f0[_0x014a('0x35')]=_[_0x014a('0x31')](db['ContactItemType'][_0x014a('0x2b')]);_0x50a8f0[_0x014a('0x30')]=_[_0x014a('0x31')](_0x2c45f1[_0x014a('0x30')]);_0x50a8f0[_0x014a('0x32')]=_[_0x014a('0x33')](_0x50a8f0['model'],_0x50a8f0[_0x014a('0x30')]);_0x5bcf8[_0x014a('0x34')]=_[_0x014a('0x33')](_0x50a8f0['model'],qs['fields'](_0x2c45f1[_0x014a('0x30')]['fields']));_0x5bcf8['attributes']=_0x5bcf8[_0x014a('0x34')]['length']?_0x5bcf8[_0x014a('0x34')]:_0x50a8f0[_0x014a('0x35')];if(_0x2c45f1[_0x014a('0x30')]['includeAll']){_0x5bcf8[_0x014a('0x43')]=[{'all':!![]}];}_0x5bcf8=_[_0x014a('0x3f')]({},_0x5bcf8,_0x2c45f1[_0x014a('0x41')]);return db[_0x014a('0x2a')][_0x014a('0x48')](_0x5bcf8)[_0x014a('0x22')](handleEntityNotFound(_0x5dc092,null))['then'](respondWithResult(_0x5dc092,null))[_0x014a('0x46')](handleError(_0x5dc092,null));};exports[_0x014a('0x49')]=function(_0x5a861c,_0x1a4df9){return db[_0x014a('0x2a')][_0x014a('0x49')](_0x5a861c[_0x014a('0x4a')],{})[_0x014a('0x22')](function(_0x357ca1){var _0x437f23=_0x5a861c[_0x014a('0x4b')]['get']({'plain':!![]});if(!_0x437f23)throw new Error(_0x014a('0x4c'));if(_0x437f23[_0x014a('0x4d')]===_0x014a('0x4b')){var _0x135e7e=_0x357ca1[_0x014a('0x23')]({'plain':!![]});var _0x4b2fdb=_0x014a('0x4e');return db['UserProfileSection'][_0x014a('0x48')]({'where':{'name':_0x4b2fdb,'userProfileId':_0x437f23[_0x014a('0x4f')]},'raw':!![]})[_0x014a('0x22')](function(_0x479dc0){if(_0x479dc0&&_0x479dc0[_0x014a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x135e7e['name'],'resourceId':_0x135e7e['id'],'type':_0x479dc0['name'],'sectionId':_0x479dc0['id']},{})[_0x014a('0x22')](function(){return _0x357ca1;});}else{return _0x357ca1;}})['catch'](function(_0x1fe253){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1fe253);throw _0x1fe253;});}return _0x357ca1;})[_0x014a('0x22')](respondWithResult(_0x1a4df9,0xc9))['catch'](handleError(_0x1a4df9,null));};exports[_0x014a('0x20')]=function(_0x1e778d,_0x400633){if(_0x1e778d[_0x014a('0x4a')]['id']){delete _0x1e778d[_0x014a('0x4a')]['id'];}return db[_0x014a('0x2a')][_0x014a('0x48')]({'where':{'id':_0x1e778d[_0x014a('0x51')]['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x400633,null))[_0x014a('0x22')](saveUpdates(_0x1e778d['body'],null))['then'](respondWithResult(_0x400633,null))[_0x014a('0x46')](handleError(_0x400633,null));};exports[_0x014a('0x21')]=function(_0x237345,_0x4cc246){return db['ContactItemType'][_0x014a('0x48')]({'where':{'id':_0x237345['params']['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x4cc246,null))[_0x014a('0x22')](db[_0x014a('0x52')][_0x014a('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x237345['params']['id']}}))[_0x014a('0x22')](removeEntity(_0x4cc246,null))[_0x014a('0x46')](handleError(_0x4cc246,null));};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js
deleted file mode 100644 (file)
index 62fa9ea..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xcce4=['rimraf','../../config/environment','./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','util','api','bluebird'];(function(_0x229e26,_0x29a073){var _0x3765eb=function(_0x1db6e0){while(--_0x1db6e0){_0x229e26['push'](_0x229e26['shift']());}};_0x3765eb(++_0x29a073);}(_0xcce4,0x146));var _0x4cce=function(_0xfbe06e,_0x2fb7ab){_0xfbe06e=_0xfbe06e-0x0;var _0x24e5b6=_0xcce4[_0xfbe06e];return _0x24e5b6;};'use strict';var _=require(_0x4cce('0x0'));var util=require(_0x4cce('0x1'));var logger=require('../../config/logger')(_0x4cce('0x2'));var moment=require('moment');var BPromise=require(_0x4cce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4cce('0x4'));var config=require(_0x4cce('0x5'));var attributes=require(_0x4cce('0x6'));module[_0x4cce('0x7')]=function(_0x2744dd,_0x162560){return _0x2744dd[_0x4cce('0x8')]('ContactItemType',attributes,{'tableName':_0x4cce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js
deleted file mode 100644 (file)
index b3a9b6a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0xc2fe=['then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5651ef,_0x4fd99a){var _0x392fba=function(_0x14c7dd){while(--_0x14c7dd){_0x5651ef['push'](_0x5651ef['shift']());}};_0x392fba(++_0x4fd99a);}(_0xc2fe,0x1d9));var _0xec2f=function(_0x3eae95,_0x36b551){_0x3eae95=_0x3eae95-0x0;var _0x398839=_0xc2fe[_0x3eae95];return _0x398839;};'use strict';var _=require(_0xec2f('0x0'));var util=require(_0xec2f('0x1'));var moment=require(_0xec2f('0x2'));var BPromise=require(_0xec2f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec2f('0x4'))['db'];var utils=require(_0xec2f('0x5'));var logger=require(_0xec2f('0x6'))('rpc');var config=require(_0xec2f('0x7'));var jayson=require(_0xec2f('0x8'));var client=jayson[_0xec2f('0x9')][_0xec2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b52a8,_0x2602d9,_0x4d0ed0){return new BPromise(function(_0x516ff3,_0x1fbd46){return client['request'](_0x4b52a8,_0x4d0ed0)[_0xec2f('0xb')](function(_0x31d706){logger[_0xec2f('0xc')](_0xec2f('0xd'),_0x2602d9,_0xec2f('0xe'));logger[_0xec2f('0xf')](_0xec2f('0x10'),_0x2602d9,'request\x20sent',JSON['stringify'](_0x31d706));if(_0x31d706[_0xec2f('0x11')]){if(_0x31d706['error'][_0xec2f('0x12')]===0x1f4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x2602d9,_0x31d706[_0xec2f('0x11')][_0xec2f('0x13')]);return _0x1fbd46(_0x31d706[_0xec2f('0x11')][_0xec2f('0x13')]);}logger['error'](_0xec2f('0xd'),_0x2602d9,_0x31d706['error'][_0xec2f('0x13')]);return _0x516ff3(_0x31d706[_0xec2f('0x11')][_0xec2f('0x13')]);}else{logger[_0xec2f('0xc')](_0xec2f('0xd'),_0x2602d9,_0xec2f('0xe'));_0x516ff3(_0x31d706[_0xec2f('0x14')][_0xec2f('0x13')]);}})[_0xec2f('0x15')](function(_0x1d4131){logger[_0xec2f('0x11')](_0xec2f('0xd'),_0x2602d9,_0x1d4131);_0x1fbd46(_0x1d4131);});});}
\ No newline at end of file
diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js
deleted file mode 100644 (file)
index 4463928..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0x798f=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete'];(function(_0x4264bf,_0x39db0f){var _0x515e5f=function(_0x130168){while(--_0x130168){_0x4264bf['push'](_0x4264bf['shift']());}};_0x515e5f(++_0x39db0f);}(_0x798f,0x95));var _0xf798=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x798f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf798('0x0'));var util=require('util');var path=require(_0xf798('0x1'));var timeout=require(_0xf798('0x2'));var express=require(_0xf798('0x3'));var router=express[_0xf798('0x4')]();var fs_extra=require(_0xf798('0x5'));var auth=require(_0xf798('0x6'));var interaction=require(_0xf798('0x7'));var config=require(_0xf798('0x8'));var controller=require(_0xf798('0x9'));router[_0xf798('0xa')]('/',auth[_0xf798('0xb')](),controller[_0xf798('0xc')]);router[_0xf798('0xa')]('/:id',auth[_0xf798('0xb')](),controller['show']);router[_0xf798('0xd')]('/',auth[_0xf798('0xb')](),controller[_0xf798('0xe')]);router[_0xf798('0xf')](_0xf798('0x10'),auth[_0xf798('0xb')](),controller[_0xf798('0x11')]);router[_0xf798('0x12')](_0xf798('0x10'),auth[_0xf798('0xb')](),controller[_0xf798('0x13')]);module[_0xf798('0x14')]=router;
\ No newline at end of file
index ba972fd..22006e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb7e7[_0x13ea00];return _0x1f7347;};'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
+var _0x2032=['name','exports','STRING'];(function(_0x64d76b,_0x5f301b){var _0x1dc73c=function(_0x4d6cee){while(--_0x4d6cee){_0x64d76b['push'](_0x64d76b['shift']());}};_0x1dc73c(++_0x5f301b);}(_0x2032,0xd9));var _0x2203=function(_0x81470a,_0x1a805d){_0x81470a=_0x81470a-0x0;var _0x1a44b8=_0x2032[_0x81470a];return _0x1a44b8;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index c324b16..af30951 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8ed=['./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','CustomDashboards','UserProfileResource','error','name','send','index','map','Dashboard','rawAttributes','fieldName','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','filter','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','UserProfileSection','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','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','defaults','localhost','redis'];(function(_0x5aef17,_0x592cd4){var _0x43f9d0=function(_0x49ea9c){while(--_0x49ea9c){_0x5aef17['push'](_0x5aef17['shift']());}};_0x43f9d0(++_0x592cd4);}(_0xc8ed,0x172));var _0xdc8e=function(_0xa79dd2,_0x427f58){_0xa79dd2=_0xa79dd2-0x0;var _0xb9d4ac=_0xc8ed[_0xa79dd2];return _0xb9d4ac;};'use strict';var emlformat=require(_0xdc8e('0x0'));var rimraf=require(_0xdc8e('0x1'));var zipdir=require(_0xdc8e('0x2'));var jsonpatch=require(_0xdc8e('0x3'));var rp=require('request-promise');var moment=require(_0xdc8e('0x4'));var BPromise=require(_0xdc8e('0x5'));var Mustache=require(_0xdc8e('0x6'));var util=require(_0xdc8e('0x7'));var path=require('path');var sox=require(_0xdc8e('0x8'));var csv=require(_0xdc8e('0x9'));var ejs=require(_0xdc8e('0xa'));var fs=require('fs');var fs_extra=require(_0xdc8e('0xb'));var _=require(_0xdc8e('0xc'));var squel=require('squel');var crypto=require(_0xdc8e('0xd'));var jsforce=require(_0xdc8e('0xe'));var deskjs=require(_0xdc8e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc8e('0x10'));var Redis=require(_0xdc8e('0x11'));var authService=require(_0xdc8e('0x12'));var qs=require(_0xdc8e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdc8e('0x14'));var logger=require(_0xdc8e('0x15'))(_0xdc8e('0x16'));var utils=require(_0xdc8e('0x17'));var config=require(_0xdc8e('0x18'));var licenseUtil=require(_0xdc8e('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdc8e('0x1a')](config['redis'],{'host':_0xdc8e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc8e('0x1c')]));require(_0xdc8e('0x1d'))[_0xdc8e('0x1e')](socket);function respondWithStatusCode(_0x238e3d,_0x297122){_0x297122=_0x297122||0xcc;return function(_0x43a33f){if(_0x43a33f){return _0x238e3d[_0xdc8e('0x1f')](_0x297122);}return _0x238e3d[_0xdc8e('0x20')](_0x297122)[_0xdc8e('0x21')]();};}function respondWithResult(_0x5008e3,_0x5e4745){_0x5e4745=_0x5e4745||0xc8;return function(_0x595b07){if(_0x595b07){return _0x5008e3['status'](_0x5e4745)[_0xdc8e('0x22')](_0x595b07);}};}function respondWithFilteredResult(_0x4b5aa4,_0x340ca9){return function(_0x1b8cd7){if(_0x1b8cd7){var _0x5ad81a=typeof _0x340ca9[_0xdc8e('0x23')]==='undefined'&&typeof _0x340ca9['limit']===_0xdc8e('0x24');var _0x19c916=_0x1b8cd7['count'];var _0xf650b7=_0x5ad81a?0x0:_0x340ca9[_0xdc8e('0x23')];var _0x304010=_0x5ad81a?_0x1b8cd7[_0xdc8e('0x25')]:_0x340ca9[_0xdc8e('0x23')]+_0x340ca9[_0xdc8e('0x26')];var _0x375aca;if(_0x304010>=_0x19c916){_0x304010=_0x19c916;_0x375aca=0xc8;}else{_0x375aca=0xce;}_0x4b5aa4[_0xdc8e('0x20')](_0x375aca);return _0x4b5aa4[_0xdc8e('0x27')](_0xdc8e('0x28'),_0xf650b7+'-'+_0x304010+'/'+_0x19c916)[_0xdc8e('0x22')](_0x1b8cd7);}return null;};}function patchUpdates(_0x692222){return function(_0x48bb28){try{jsonpatch[_0xdc8e('0x29')](_0x48bb28,_0x692222,!![]);}catch(_0x20f312){return BPromise['reject'](_0x20f312);}return _0x48bb28['save']();};}function saveUpdates(_0x2cc872,_0x1e7b80){return function(_0x48f6fd){if(_0x48f6fd){return _0x48f6fd[_0xdc8e('0x2a')](_0x2cc872)[_0xdc8e('0x2b')](function(_0x24eeeb){return _0x24eeeb;});}return null;};}function removeEntity(_0x434cc9,_0x4a1326){return function(_0x42f4db){if(_0x42f4db){return _0x42f4db[_0xdc8e('0x2c')]()[_0xdc8e('0x2b')](function(){var _0x1d401b=_0x42f4db[_0xdc8e('0x2d')]({'plain':!![]});var _0x1c84f5=_0xdc8e('0x2e');return db[_0xdc8e('0x2f')]['destroy']({'where':{'type':_0x1c84f5,'resourceId':_0x1d401b['id']}})[_0xdc8e('0x2b')](function(){return _0x42f4db;});})[_0xdc8e('0x2b')](function(){_0x434cc9[_0xdc8e('0x20')](0xcc)[_0xdc8e('0x21')]();});}};}function handleEntityNotFound(_0x11e2ea,_0x4a59a4){return function(_0x17149d){if(!_0x17149d){_0x11e2ea[_0xdc8e('0x1f')](0x194);}return _0x17149d;};}function handleError(_0x5b0cfd,_0x5e28a2){_0x5e28a2=_0x5e28a2||0x1f4;return function(_0x4901b8){logger[_0xdc8e('0x30')](_0x4901b8['stack']);if(_0x4901b8[_0xdc8e('0x31')]){delete _0x4901b8['name'];}_0x5b0cfd[_0xdc8e('0x20')](_0x5e28a2)[_0xdc8e('0x32')](_0x4901b8);};}exports[_0xdc8e('0x33')]=function(_0xa6532a,_0x5b535e){var _0xdaa354={},_0xad8278={},_0x455a8d={'count':0x0,'rows':[]};var _0x5ec3cc=_[_0xdc8e('0x34')](db[_0xdc8e('0x35')][_0xdc8e('0x36')],function(_0x5c0807){return{'name':_0x5c0807[_0xdc8e('0x37')],'type':_0x5c0807['type']['key']};});_0xad8278[_0xdc8e('0x38')]=_[_0xdc8e('0x34')](_0x5ec3cc,_0xdc8e('0x31'));_0xad8278['query']=_['keys'](_0xa6532a[_0xdc8e('0x39')]);_0xad8278['filters']=_['intersection'](_0xad8278[_0xdc8e('0x38')],_0xad8278[_0xdc8e('0x39')]);_0xdaa354['attributes']=_[_0xdc8e('0x3a')](_0xad8278[_0xdc8e('0x38')],qs[_0xdc8e('0x3b')](_0xa6532a[_0xdc8e('0x39')][_0xdc8e('0x3b')]));_0xdaa354['attributes']=_0xdaa354['attributes'][_0xdc8e('0x3c')]?_0xdaa354[_0xdc8e('0x3d')]:_0xad8278[_0xdc8e('0x38')];if(!_0xa6532a['query'][_0xdc8e('0x3e')](_0xdc8e('0x3f'))){_0xdaa354[_0xdc8e('0x26')]=qs[_0xdc8e('0x26')](_0xa6532a[_0xdc8e('0x39')][_0xdc8e('0x26')]);_0xdaa354[_0xdc8e('0x23')]=qs[_0xdc8e('0x23')](_0xa6532a['query'][_0xdc8e('0x23')]);}_0xdaa354['order']=qs[_0xdc8e('0x40')](_0xa6532a[_0xdc8e('0x39')]['sort']);_0xdaa354[_0xdc8e('0x41')]=qs[_0xdc8e('0x42')](_[_0xdc8e('0x43')](_0xa6532a[_0xdc8e('0x39')],_0xad8278['filters']),_0x5ec3cc);if(_0xa6532a[_0xdc8e('0x39')]['filter']){_0xdaa354['where']=_[_0xdc8e('0x44')](_0xdaa354['where'],{'$or':_[_0xdc8e('0x34')](_0x5ec3cc,function(_0x595a9c){if(_0x595a9c[_0xdc8e('0x45')]!=='VIRTUAL'){var _0x286728={};_0x286728[_0x595a9c[_0xdc8e('0x31')]]={'$like':'%'+_0xa6532a['query'][_0xdc8e('0x46')]+'%'};return _0x286728;}})});}_0xdaa354=_['merge']({},_0xdaa354,_0xa6532a[_0xdc8e('0x47')]);var _0x1c41af={'where':_0xdaa354['where']};return db[_0xdc8e('0x35')][_0xdc8e('0x25')](_0x1c41af)[_0xdc8e('0x2b')](function(_0x13647a){_0x455a8d[_0xdc8e('0x25')]=_0x13647a;if(_0xa6532a[_0xdc8e('0x39')]['includeAll']){_0xdaa354[_0xdc8e('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0xdc8e('0x49')](_0xdaa354);})[_0xdc8e('0x2b')](function(_0x429fc2){_0x455a8d[_0xdc8e('0x4a')]=_0x429fc2;return _0x455a8d;})[_0xdc8e('0x2b')](respondWithFilteredResult(_0x5b535e,_0xdaa354))[_0xdc8e('0x4b')](handleError(_0x5b535e,null));};exports[_0xdc8e('0x4c')]=function(_0x28d014,_0x1c6c1e){var _0x17908b={'raw':![],'where':{'id':_0x28d014['params']['id']}},_0x3710ea={};_0x3710ea['model']=_[_0xdc8e('0x4d')](db[_0xdc8e('0x35')][_0xdc8e('0x36')]);_0x3710ea[_0xdc8e('0x39')]=_[_0xdc8e('0x4d')](_0x28d014[_0xdc8e('0x39')]);_0x3710ea['filters']=_[_0xdc8e('0x3a')](_0x3710ea[_0xdc8e('0x38')],_0x3710ea[_0xdc8e('0x39')]);_0x17908b[_0xdc8e('0x3d')]=_[_0xdc8e('0x3a')](_0x3710ea[_0xdc8e('0x38')],qs['fields'](_0x28d014[_0xdc8e('0x39')]['fields']));_0x17908b[_0xdc8e('0x3d')]=_0x17908b[_0xdc8e('0x3d')][_0xdc8e('0x3c')]?_0x17908b[_0xdc8e('0x3d')]:_0x3710ea[_0xdc8e('0x38')];if(_0x28d014[_0xdc8e('0x39')][_0xdc8e('0x4e')]){_0x17908b['include']=[{'all':!![]}];}_0x17908b=_['merge']({},_0x17908b,_0x28d014['options']);return db[_0xdc8e('0x35')][_0xdc8e('0x4f')](_0x17908b)[_0xdc8e('0x2b')](handleEntityNotFound(_0x1c6c1e,null))[_0xdc8e('0x2b')](respondWithResult(_0x1c6c1e,null))['catch'](handleError(_0x1c6c1e,null));};exports['create']=function(_0x298d70,_0x5e0f0){return db[_0xdc8e('0x35')][_0xdc8e('0x50')](_0x298d70[_0xdc8e('0x51')],{})['then'](function(_0x648ae1){var _0x1f5bba=_0x298d70[_0xdc8e('0x52')][_0xdc8e('0x2d')]({'plain':!![]});if(!_0x1f5bba)throw new Error(_0xdc8e('0x53'));if(_0x1f5bba[_0xdc8e('0x54')]==='user'){var _0x355339=_0x648ae1['get']({'plain':!![]});var _0x37d409='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x37d409,'userProfileId':_0x1f5bba[_0xdc8e('0x55')]},'raw':!![]})[_0xdc8e('0x2b')](function(_0x2aebf1){if(_0x2aebf1&&_0x2aebf1['autoAssociation']===0x0){return db['UserProfileResource'][_0xdc8e('0x50')]({'name':_0x355339['name'],'resourceId':_0x355339['id'],'type':_0x2aebf1[_0xdc8e('0x31')],'sectionId':_0x2aebf1['id']},{})[_0xdc8e('0x2b')](function(){return _0x648ae1;});}else{return _0x648ae1;}})[_0xdc8e('0x4b')](function(_0x298e6e){logger['error'](_0xdc8e('0x56'),_0x298e6e);throw _0x298e6e;});}return _0x648ae1;})['then'](respondWithResult(_0x5e0f0,0xc9))[_0xdc8e('0x4b')](handleError(_0x5e0f0,null));};exports[_0xdc8e('0x57')]=function(_0x1fdad1,_0x5747bc){var _0x13d7a1={'where':{'id':_0x1fdad1[_0xdc8e('0x58')]['id']}},_0x2e1f21={};_0x2e1f21['model']=_['keys'](db[_0xdc8e('0x35')][_0xdc8e('0x36')]);_0x13d7a1[_0xdc8e('0x3d')]=_['intersection'](_0x2e1f21[_0xdc8e('0x38')],qs[_0xdc8e('0x3b')](_0x1fdad1[_0xdc8e('0x39')]['fields']));_0x13d7a1[_0xdc8e('0x3d')]=_0x13d7a1[_0xdc8e('0x3d')][_0xdc8e('0x3c')]?_0x13d7a1['attributes']:_0x2e1f21[_0xdc8e('0x38')];if(_0x1fdad1[_0xdc8e('0x39')][_0xdc8e('0x4e')]){_0x13d7a1['include']=[{'all':!![]}];}_0x13d7a1=_[_0xdc8e('0x44')]({},_0x13d7a1,_0x1fdad1['options']);return db['Dashboard'][_0xdc8e('0x4f')](_0x13d7a1)[_0xdc8e('0x2b')](handleEntityNotFound(_0x5747bc,null))[_0xdc8e('0x2b')](function(_0xc462f5){if(_0xc462f5){var _0x25ff4a=_0xc462f5[_0xdc8e('0x2d')]({'plain':!![]});_0x25ff4a=qs[_0xdc8e('0x59')](_0x25ff4a,['id',_0xdc8e('0x5a'),_0xdc8e('0x5b')]);_0x1fdad1[_0xdc8e('0x51')]=_[_0xdc8e('0x59')](_0x1fdad1[_0xdc8e('0x51')],['id',_0xdc8e('0x5a'),_0xdc8e('0x5b')]);return db[_0xdc8e('0x35')][_0xdc8e('0x50')](_[_0xdc8e('0x44')](_0x25ff4a,_0x1fdad1[_0xdc8e('0x51')]),{'include':_0x1fdad1[_0xdc8e('0x39')][_0xdc8e('0x4e')]?[{'all':!![]}]:undefined})[_0xdc8e('0x2b')](function(_0x262c57){var _0x4ba541=_0x1fdad1['user'][_0xdc8e('0x2d')]({'plain':!![]});if(!_0x4ba541)throw new Error(_0xdc8e('0x53'));if(_0x4ba541[_0xdc8e('0x54')]===_0xdc8e('0x52')){var _0x5621fb=_0x262c57[_0xdc8e('0x2d')]({'plain':!![]});var _0x8da8bb=_0xdc8e('0x2e');return db[_0xdc8e('0x5c')][_0xdc8e('0x4f')]({'where':{'name':_0x8da8bb,'userProfileId':_0x4ba541[_0xdc8e('0x55')]},'raw':!![]})['then'](function(_0x52af75){if(_0x52af75&&_0x52af75['autoAssociation']===0x0){return db['UserProfileResource'][_0xdc8e('0x50')]({'name':_0x5621fb['name'],'resourceId':_0x5621fb['id'],'type':_0x52af75[_0xdc8e('0x31')],'sectionId':_0x52af75['id']},{})['then'](function(){return _0x262c57;});}else{return _0x262c57;}})[_0xdc8e('0x4b')](function(_0x4d0069){logger[_0xdc8e('0x30')](_0xdc8e('0x56'),_0x4d0069);throw _0x4d0069;});}return _0x262c57;});}})[_0xdc8e('0x2b')](respondWithResult(_0x5747bc,0xc9))[_0xdc8e('0x4b')](handleError(_0x5747bc,null));};exports[_0xdc8e('0x2a')]=function(_0x26bb15,_0x45f1b4){if(_0x26bb15[_0xdc8e('0x51')]['id']){delete _0x26bb15[_0xdc8e('0x51')]['id'];}return db['Dashboard'][_0xdc8e('0x4f')]({'where':{'id':_0x26bb15[_0xdc8e('0x58')]['id']}})[_0xdc8e('0x2b')](handleEntityNotFound(_0x45f1b4,null))[_0xdc8e('0x2b')](saveUpdates(_0x26bb15[_0xdc8e('0x51')],null))['then'](respondWithResult(_0x45f1b4,null))[_0xdc8e('0x4b')](handleError(_0x45f1b4,null));};exports[_0xdc8e('0x2c')]=function(_0xee3c89,_0x4c2976){return db[_0xdc8e('0x35')][_0xdc8e('0x4f')]({'where':{'id':_0xee3c89[_0xdc8e('0x58')]['id']}})[_0xdc8e('0x2b')](handleEntityNotFound(_0x4c2976,null))['then'](removeEntity(_0x4c2976,null))['catch'](handleError(_0x4c2976,null));};function widgetAttributes(_0x5c8946){try{switch(_0x5c8946[_0xdc8e('0x45')]){case _0xdc8e('0x5d'):return[{'name':_0xdc8e('0x5e'),'value':_0x5c8946[_0xdc8e('0x5e')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x0]?_0x5c8946['attrs'][0x0][_0xdc8e('0x60')]:undefined)||_0xdc8e('0x61')}];case'custom':return[{'name':_0xdc8e('0x62'),'value':_0x5c8946[_0xdc8e('0x62')]||(_0x5c8946['attrs']&&_0x5c8946['attrs'][0x0]?_0x5c8946['attrs'][0x0][_0xdc8e('0x60')]:undefined)||''}];case _0xdc8e('0x63'):return[{'name':_0xdc8e('0x64'),'value':_0x5c8946[_0xdc8e('0x64')]||(_0x5c8946['attrs']&&_0x5c8946[_0xdc8e('0x5f')][0x0]?_0x5c8946[_0xdc8e('0x5f')][0x0][_0xdc8e('0x60')]:undefined)||_0xdc8e('0x65')},{'name':_0xdc8e('0x66'),'value':_0x5c8946[_0xdc8e('0x66')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x1]?_0x5c8946['attrs'][0x1][_0xdc8e('0x60')]:undefined)||_0xdc8e('0x67')},{'name':_0xdc8e('0x68'),'value':_0x5c8946['attrFontSize']||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x2]?_0x5c8946[_0xdc8e('0x5f')][0x2][_0xdc8e('0x60')]:undefined)||0xc}];case _0xdc8e('0x69'):return[{'name':_0xdc8e('0x6a'),'value':_0x5c8946[_0xdc8e('0x6a')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x0]?_0x5c8946['attrs'][0x0][_0xdc8e('0x60')]:undefined)||_0xdc8e('0x6b')},{'name':'attrVoiceQueues','value':_0x5c8946['attrVoiceQueues']||(_0x5c8946['attrs']&&_0x5c8946[_0xdc8e('0x5f')][0x1]?_0x5c8946[_0xdc8e('0x5f')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x5c8946[_0xdc8e('0x68')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946['attrs'][0x2]?_0x5c8946[_0xdc8e('0x5f')][0x2][_0xdc8e('0x60')]:undefined)||0x14},{'name':'attrChannel','value':_0x5c8946[_0xdc8e('0x6c')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x3]?_0x5c8946['attrs'][0x3][_0xdc8e('0x60')]:undefined)||_0xdc8e('0x6d')},{'name':'attrEmailAccounts','value':_0x5c8946[_0xdc8e('0x6e')]||(_0x5c8946['attrs']&&_0x5c8946['attrs'][0x4]?_0x5c8946[_0xdc8e('0x5f')][0x4][_0xdc8e('0x60')]:undefined)||''},{'name':_0xdc8e('0x6f'),'value':_0x5c8946[_0xdc8e('0x6f')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x5]?_0x5c8946[_0xdc8e('0x5f')][0x5][_0xdc8e('0x60')]:undefined)||''},{'name':_0xdc8e('0x70'),'value':_0x5c8946[_0xdc8e('0x70')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946['attrs'][0x6]?_0x5c8946[_0xdc8e('0x5f')][0x6]['value']:undefined)||''},{'name':_0xdc8e('0x71'),'value':_0x5c8946['attrOpenchannelAccounts']||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x7]?_0x5c8946[_0xdc8e('0x5f')][0x7][_0xdc8e('0x60')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5c8946[_0xdc8e('0x72')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946['attrs'][0x8]?_0x5c8946[_0xdc8e('0x5f')][0x8][_0xdc8e('0x60')]:undefined)||''},{'name':_0xdc8e('0x73'),'value':_0x5c8946[_0xdc8e('0x73')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x9]?_0x5c8946[_0xdc8e('0x5f')][0x9][_0xdc8e('0x60')]:undefined)||''}];case _0xdc8e('0x74'):case _0xdc8e('0x75'):return[{'name':_0xdc8e('0x76'),'value':_0x5c8946['attrSerie1']||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x0]?_0x5c8946['attrs'][0x0][_0xdc8e('0x60')]:undefined)||_0xdc8e('0x6b')},{'name':'attrSerie2','value':_0x5c8946[_0xdc8e('0x77')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x1]?_0x5c8946[_0xdc8e('0x5f')][0x1][_0xdc8e('0x60')]:undefined)||null},{'name':_0xdc8e('0x78'),'value':_0x5c8946['attrSerie3']||(_0x5c8946['attrs']&&_0x5c8946[_0xdc8e('0x5f')][0x2]?_0x5c8946['attrs'][0x2][_0xdc8e('0x60')]:undefined)||null},{'name':_0xdc8e('0x79'),'value':_0x5c8946['attrVoiceQueues']||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x3]?_0x5c8946['attrs'][0x3][_0xdc8e('0x60')]:undefined)||[]},{'name':_0xdc8e('0x6c'),'value':_0x5c8946[_0xdc8e('0x6c')]||(_0x5c8946['attrs']&&_0x5c8946['attrs'][0x4]?_0x5c8946['attrs'][0x4][_0xdc8e('0x60')]:undefined)||'voice'},{'name':_0xdc8e('0x6e'),'value':_0x5c8946['attrEmailAccounts']||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x5]?_0x5c8946[_0xdc8e('0x5f')][0x5]['value']:undefined)||''},{'name':_0xdc8e('0x6f'),'value':_0x5c8946['attrFaxAccounts']||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946['attrs'][0x6]?_0x5c8946['attrs'][0x6][_0xdc8e('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x5c8946[_0xdc8e('0x70')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x7]?_0x5c8946[_0xdc8e('0x5f')][0x7][_0xdc8e('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5c8946[_0xdc8e('0x71')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x8]?_0x5c8946[_0xdc8e('0x5f')][0x8]['value']:undefined)||''},{'name':_0xdc8e('0x72'),'value':_0x5c8946[_0xdc8e('0x72')]||(_0x5c8946['attrs']&&_0x5c8946[_0xdc8e('0x5f')][0x9]?_0x5c8946[_0xdc8e('0x5f')][0x9][_0xdc8e('0x60')]:undefined)||''},{'name':_0xdc8e('0x73'),'value':_0x5c8946[_0xdc8e('0x73')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0xa]?_0x5c8946[_0xdc8e('0x5f')][0xa][_0xdc8e('0x60')]:undefined)||''}];case _0xdc8e('0x7a'):return[{'name':'attrReport','type':_0x5c8946['reportType']||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946['attrs'][0x0]?_0x5c8946[_0xdc8e('0x5f')][0x0][_0xdc8e('0x45')]:undefined)||null,'value':_0x5c8946[_0xdc8e('0x7b')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946['attrs'][0x0]?_0x5c8946[_0xdc8e('0x5f')][0x0][_0xdc8e('0x60')]:undefined)||null},{'name':_0xdc8e('0x7c'),'value':_0x5c8946[_0xdc8e('0x7c')]||(_0x5c8946[_0xdc8e('0x5f')]&&_0x5c8946[_0xdc8e('0x5f')][0x1]?_0x5c8946[_0xdc8e('0x5f')][0x1][_0xdc8e('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x4be212){logger[_0xdc8e('0x30')](_0xdc8e('0x7d'),JSON[_0xdc8e('0x7e')](_0x4be212));return[];}}exports[_0xdc8e('0x7f')]=function(_0x12fd96,_0x46ec99,_0x3bccd4){if(_0x12fd96[_0xdc8e('0x51')]['id']){delete _0x12fd96[_0xdc8e('0x51')]['id'];}return db[_0xdc8e('0x35')][_0xdc8e('0x4f')]({'where':{'id':_0x12fd96[_0xdc8e('0x58')]['id']}})[_0xdc8e('0x2b')](handleEntityNotFound(_0x46ec99,null))[_0xdc8e('0x2b')](function(_0x635616){if(_0x635616){_0x12fd96[_0xdc8e('0x51')][_0xdc8e('0x80')]=_0x635616['id'];_0x12fd96['body'][_0xdc8e('0x5f')]=widgetAttributes(_0x12fd96['body']);return db[_0xdc8e('0x81')][_0xdc8e('0x50')](_0x12fd96[_0xdc8e('0x51')]);}})[_0xdc8e('0x2b')](respondWithResult(_0x46ec99,null))[_0xdc8e('0x4b')](handleError(_0x46ec99,null));};exports[_0xdc8e('0x82')]=function(_0x90a521,_0x819e72,_0xe3a01d){var _0x243850={};var _0x53dcf4={};var _0x4b15fc;var _0x44e4cf;return db[_0xdc8e('0x35')][_0xdc8e('0x83')]({'where':{'id':_0x90a521[_0xdc8e('0x58')]['id']}})['then'](handleEntityNotFound(_0x819e72,null))[_0xdc8e('0x2b')](function(_0x97ec50){if(_0x97ec50){_0x4b15fc=_0x97ec50;_0x53dcf4[_0xdc8e('0x38')]=_['keys'](db[_0xdc8e('0x81')][_0xdc8e('0x36')]);_0x53dcf4[_0xdc8e('0x39')]=_[_0xdc8e('0x4d')](_0x90a521[_0xdc8e('0x39')]);_0x53dcf4[_0xdc8e('0x42')]=_[_0xdc8e('0x3a')](_0x53dcf4[_0xdc8e('0x38')],_0x53dcf4[_0xdc8e('0x39')]);_0x243850[_0xdc8e('0x3d')]=_['intersection'](_0x53dcf4['model'],qs['fields'](_0x90a521['query']['fields']));_0x243850[_0xdc8e('0x3d')]=_0x243850['attributes'][_0xdc8e('0x3c')]?_0x243850[_0xdc8e('0x3d')]:_0x53dcf4['model'];_0x243850[_0xdc8e('0x84')]=qs[_0xdc8e('0x40')](_0x90a521[_0xdc8e('0x39')]['sort']);_0x243850[_0xdc8e('0x41')]=qs[_0xdc8e('0x42')](_[_0xdc8e('0x43')](_0x90a521['query'],_0x53dcf4[_0xdc8e('0x42')]));if(_0x90a521['query'][_0xdc8e('0x46')]){_0x243850['where']=_[_0xdc8e('0x44')](_0x243850['where'],{'$or':_[_0xdc8e('0x34')](_0x243850[_0xdc8e('0x3d')],function(_0x1856e6){var _0x58ad4f={};_0x58ad4f[_0x1856e6]={'$like':'%'+_0x90a521['query'][_0xdc8e('0x46')]+'%'};return _0x58ad4f;})});}_0x243850=_[_0xdc8e('0x44')]({},_0x243850,_0x90a521[_0xdc8e('0x47')]);return _0x4b15fc[_0xdc8e('0x82')](_0x243850);}})['then'](function(_0x588d0b){if(_0x588d0b){_0x44e4cf=_0x588d0b[_0xdc8e('0x3c')];if(!_0x90a521['query'][_0xdc8e('0x3e')](_0xdc8e('0x3f'))){_0x243850[_0xdc8e('0x26')]=qs['limit'](_0x90a521[_0xdc8e('0x39')]['limit']);_0x243850[_0xdc8e('0x23')]=qs[_0xdc8e('0x23')](_0x90a521[_0xdc8e('0x39')][_0xdc8e('0x23')]);}return _0x4b15fc[_0xdc8e('0x82')](_0x243850);}})[_0xdc8e('0x2b')](function(_0x5c30fd){if(_0x5c30fd){return _0x5c30fd?{'count':_0x44e4cf,'rows':_0x5c30fd}:null;}})[_0xdc8e('0x2b')](respondWithResult(_0x819e72,null))[_0xdc8e('0x4b')](handleError(_0x819e72,null));};
\ No newline at end of file
+var _0x6b1f=['attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','CustomDashboards','UserProfileResource','destroy','then','stack','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','include','Dashboard','findAll','rows','catch','show','params','rawAttributes','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','createdAt','omit','body','iframe','attrUrl','attrs','value','https://'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x6b1f,0x128));var _0xf6b1=function(_0x1f7233,_0x4563e9){_0x1f7233=_0x1f7233-0x0;var _0x4fb571=_0x6b1f[_0x1f7233];return _0x4fb571;};'use strict';var emlformat=require(_0xf6b1('0x0'));var rimraf=require(_0xf6b1('0x1'));var zipdir=require(_0xf6b1('0x2'));var jsonpatch=require(_0xf6b1('0x3'));var rp=require(_0xf6b1('0x4'));var moment=require(_0xf6b1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6b1('0x6'));var path=require(_0xf6b1('0x7'));var sox=require('sox');var csv=require(_0xf6b1('0x8'));var ejs=require(_0xf6b1('0x9'));var fs=require('fs');var fs_extra=require(_0xf6b1('0xa'));var _=require('lodash');var squel=require(_0xf6b1('0xb'));var crypto=require(_0xf6b1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf6b1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf6b1('0xe'));var Papa=require(_0xf6b1('0xf'));var Redis=require(_0xf6b1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf6b1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6b1('0x12'));var logger=require(_0xf6b1('0x13'))(_0xf6b1('0x14'));var utils=require(_0xf6b1('0x15'));var config=require(_0xf6b1('0x16'));var licenseUtil=require(_0xf6b1('0x17'));var db=require('../../mysqldb')['db'];config[_0xf6b1('0x18')]=_[_0xf6b1('0x19')](config[_0xf6b1('0x18')],{'host':_0xf6b1('0x1a'),'port':0x18eb});var socket=require(_0xf6b1('0x1b'))(new Redis(config['redis']));require(_0xf6b1('0x1c'))['register'](socket);function respondWithStatusCode(_0x2d0f67,_0x8212db){_0x8212db=_0x8212db||0xcc;return function(_0x2bb30c){if(_0x2bb30c){return _0x2d0f67[_0xf6b1('0x1d')](_0x8212db);}return _0x2d0f67[_0xf6b1('0x1e')](_0x8212db)[_0xf6b1('0x1f')]();};}function respondWithResult(_0xe2f39a,_0x43edb4){_0x43edb4=_0x43edb4||0xc8;return function(_0x5aae8d){if(_0x5aae8d){return _0xe2f39a[_0xf6b1('0x1e')](_0x43edb4)[_0xf6b1('0x20')](_0x5aae8d);}};}function respondWithFilteredResult(_0x44d578,_0x24fcc8){return function(_0x51c600){if(_0x51c600){var _0x46d990=typeof _0x24fcc8[_0xf6b1('0x21')]===_0xf6b1('0x22')&&typeof _0x24fcc8[_0xf6b1('0x23')]==='undefined';var _0x244cbb=_0x51c600[_0xf6b1('0x24')];var _0xeb4ba3=_0x46d990?0x0:_0x24fcc8[_0xf6b1('0x21')];var _0x2239a7=_0x46d990?_0x51c600[_0xf6b1('0x24')]:_0x24fcc8[_0xf6b1('0x21')]+_0x24fcc8['limit'];var _0x498fc0;if(_0x2239a7>=_0x244cbb){_0x2239a7=_0x244cbb;_0x498fc0=0xc8;}else{_0x498fc0=0xce;}_0x44d578[_0xf6b1('0x1e')](_0x498fc0);return _0x44d578[_0xf6b1('0x25')](_0xf6b1('0x26'),_0xeb4ba3+'-'+_0x2239a7+'/'+_0x244cbb)[_0xf6b1('0x20')](_0x51c600);}return null;};}function patchUpdates(_0x3341fc){return function(_0x454705){try{jsonpatch[_0xf6b1('0x27')](_0x454705,_0x3341fc,!![]);}catch(_0x2f8f7){return BPromise[_0xf6b1('0x28')](_0x2f8f7);}return _0x454705[_0xf6b1('0x29')]();};}function saveUpdates(_0x2c975e,_0x583c9d){return function(_0x49b48a){if(_0x49b48a){return _0x49b48a[_0xf6b1('0x2a')](_0x2c975e)['then'](function(_0xa21db0){return _0xa21db0;});}return null;};}function removeEntity(_0x177b87,_0x245fdf){return function(_0x331a37){if(_0x331a37){return _0x331a37['destroy']()['then'](function(){var _0x5a4b96=_0x331a37[_0xf6b1('0x2b')]({'plain':!![]});var _0x4c4d7d=_0xf6b1('0x2c');return db[_0xf6b1('0x2d')][_0xf6b1('0x2e')]({'where':{'type':_0x4c4d7d,'resourceId':_0x5a4b96['id']}})['then'](function(){return _0x331a37;});})[_0xf6b1('0x2f')](function(){_0x177b87[_0xf6b1('0x1e')](0xcc)[_0xf6b1('0x1f')]();});}};}function handleEntityNotFound(_0x20ef3e,_0x5ee1c6){return function(_0x107224){if(!_0x107224){_0x20ef3e[_0xf6b1('0x1d')](0x194);}return _0x107224;};}function handleError(_0x4ddb45,_0x5d0b36){_0x5d0b36=_0x5d0b36||0x1f4;return function(_0x320ee1){logger['error'](_0x320ee1[_0xf6b1('0x30')]);if(_0x320ee1[_0xf6b1('0x31')]){delete _0x320ee1['name'];}_0x4ddb45[_0xf6b1('0x1e')](_0x5d0b36)[_0xf6b1('0x32')](_0x320ee1);};}exports[_0xf6b1('0x33')]=function(_0x49388f,_0x4216ba){var _0x5d27ad={},_0x38868a={},_0xe3941d={'count':0x0,'rows':[]};var _0x2b7db3=_[_0xf6b1('0x34')](db['Dashboard']['rawAttributes'],function(_0xdac72){return{'name':_0xdac72[_0xf6b1('0x35')],'type':_0xdac72[_0xf6b1('0x36')][_0xf6b1('0x37')]};});_0x38868a[_0xf6b1('0x38')]=_['map'](_0x2b7db3,_0xf6b1('0x31'));_0x38868a['query']=_[_0xf6b1('0x39')](_0x49388f['query']);_0x38868a[_0xf6b1('0x3a')]=_[_0xf6b1('0x3b')](_0x38868a['model'],_0x38868a[_0xf6b1('0x3c')]);_0x5d27ad[_0xf6b1('0x3d')]=_[_0xf6b1('0x3b')](_0x38868a[_0xf6b1('0x38')],qs[_0xf6b1('0x3e')](_0x49388f[_0xf6b1('0x3c')][_0xf6b1('0x3e')]));_0x5d27ad[_0xf6b1('0x3d')]=_0x5d27ad[_0xf6b1('0x3d')][_0xf6b1('0x3f')]?_0x5d27ad[_0xf6b1('0x3d')]:_0x38868a['model'];if(!_0x49388f[_0xf6b1('0x3c')][_0xf6b1('0x40')]('nolimit')){_0x5d27ad[_0xf6b1('0x23')]=qs[_0xf6b1('0x23')](_0x49388f[_0xf6b1('0x3c')]['limit']);_0x5d27ad[_0xf6b1('0x21')]=qs[_0xf6b1('0x21')](_0x49388f[_0xf6b1('0x3c')][_0xf6b1('0x21')]);}_0x5d27ad[_0xf6b1('0x41')]=qs[_0xf6b1('0x42')](_0x49388f['query']['sort']);_0x5d27ad[_0xf6b1('0x43')]=qs[_0xf6b1('0x3a')](_['pick'](_0x49388f[_0xf6b1('0x3c')],_0x38868a[_0xf6b1('0x3a')]),_0x2b7db3);if(_0x49388f[_0xf6b1('0x3c')][_0xf6b1('0x44')]){_0x5d27ad['where']=_[_0xf6b1('0x45')](_0x5d27ad[_0xf6b1('0x43')],{'$or':_[_0xf6b1('0x34')](_0x2b7db3,function(_0x167843){if(_0x167843[_0xf6b1('0x36')]!==_0xf6b1('0x46')){var _0x4b9a0a={};_0x4b9a0a[_0x167843[_0xf6b1('0x31')]]={'$like':'%'+_0x49388f[_0xf6b1('0x3c')][_0xf6b1('0x44')]+'%'};return _0x4b9a0a;}})});}_0x5d27ad=_[_0xf6b1('0x45')]({},_0x5d27ad,_0x49388f['options']);var _0x17d1f0={'where':_0x5d27ad[_0xf6b1('0x43')]};return db['Dashboard']['count'](_0x17d1f0)[_0xf6b1('0x2f')](function(_0x2f0077){_0xe3941d[_0xf6b1('0x24')]=_0x2f0077;if(_0x49388f[_0xf6b1('0x3c')]['includeAll']){_0x5d27ad[_0xf6b1('0x47')]=[{'all':!![]}];}return db[_0xf6b1('0x48')][_0xf6b1('0x49')](_0x5d27ad);})[_0xf6b1('0x2f')](function(_0x456adc){_0xe3941d[_0xf6b1('0x4a')]=_0x456adc;return _0xe3941d;})[_0xf6b1('0x2f')](respondWithFilteredResult(_0x4216ba,_0x5d27ad))[_0xf6b1('0x4b')](handleError(_0x4216ba,null));};exports[_0xf6b1('0x4c')]=function(_0x119db4,_0x225439){var _0x2fac10={'raw':![],'where':{'id':_0x119db4[_0xf6b1('0x4d')]['id']}},_0x535af6={};_0x535af6[_0xf6b1('0x38')]=_['keys'](db[_0xf6b1('0x48')][_0xf6b1('0x4e')]);_0x535af6[_0xf6b1('0x3c')]=_[_0xf6b1('0x39')](_0x119db4[_0xf6b1('0x3c')]);_0x535af6[_0xf6b1('0x3a')]=_['intersection'](_0x535af6['model'],_0x535af6['query']);_0x2fac10[_0xf6b1('0x3d')]=_[_0xf6b1('0x3b')](_0x535af6[_0xf6b1('0x38')],qs[_0xf6b1('0x3e')](_0x119db4[_0xf6b1('0x3c')][_0xf6b1('0x3e')]));_0x2fac10[_0xf6b1('0x3d')]=_0x2fac10[_0xf6b1('0x3d')][_0xf6b1('0x3f')]?_0x2fac10[_0xf6b1('0x3d')]:_0x535af6['model'];if(_0x119db4[_0xf6b1('0x3c')][_0xf6b1('0x4f')]){_0x2fac10[_0xf6b1('0x47')]=[{'all':!![]}];}_0x2fac10=_['merge']({},_0x2fac10,_0x119db4['options']);return db[_0xf6b1('0x48')]['find'](_0x2fac10)[_0xf6b1('0x2f')](handleEntityNotFound(_0x225439,null))[_0xf6b1('0x2f')](respondWithResult(_0x225439,null))[_0xf6b1('0x4b')](handleError(_0x225439,null));};exports['create']=function(_0xc7994d,_0x17aa11){return db['Dashboard'][_0xf6b1('0x50')](_0xc7994d['body'],{})[_0xf6b1('0x2f')](function(_0x1bccf0){var _0x1e494d=_0xc7994d['user']['get']({'plain':!![]});if(!_0x1e494d)throw new Error(_0xf6b1('0x51'));if(_0x1e494d[_0xf6b1('0x52')]===_0xf6b1('0x53')){var _0x142d75=_0x1bccf0[_0xf6b1('0x2b')]({'plain':!![]});var _0x52e2cc='CustomDashboards';return db[_0xf6b1('0x54')][_0xf6b1('0x55')]({'where':{'name':_0x52e2cc,'userProfileId':_0x1e494d[_0xf6b1('0x56')]},'raw':!![]})['then'](function(_0x244cb7){if(_0x244cb7&&_0x244cb7[_0xf6b1('0x57')]===0x0){return db[_0xf6b1('0x2d')][_0xf6b1('0x50')]({'name':_0x142d75[_0xf6b1('0x31')],'resourceId':_0x142d75['id'],'type':_0x244cb7[_0xf6b1('0x31')],'sectionId':_0x244cb7['id']},{})[_0xf6b1('0x2f')](function(){return _0x1bccf0;});}else{return _0x1bccf0;}})[_0xf6b1('0x4b')](function(_0x33f4e8){logger[_0xf6b1('0x58')](_0xf6b1('0x59'),_0x33f4e8);throw _0x33f4e8;});}return _0x1bccf0;})[_0xf6b1('0x2f')](respondWithResult(_0x17aa11,0xc9))[_0xf6b1('0x4b')](handleError(_0x17aa11,null));};exports[_0xf6b1('0x5a')]=function(_0xd7275,_0x3f6662){var _0x8d3641={'where':{'id':_0xd7275[_0xf6b1('0x4d')]['id']}},_0x3464cf={};_0x3464cf['model']=_[_0xf6b1('0x39')](db[_0xf6b1('0x48')]['rawAttributes']);_0x8d3641[_0xf6b1('0x3d')]=_[_0xf6b1('0x3b')](_0x3464cf['model'],qs[_0xf6b1('0x3e')](_0xd7275[_0xf6b1('0x3c')][_0xf6b1('0x3e')]));_0x8d3641['attributes']=_0x8d3641[_0xf6b1('0x3d')]['length']?_0x8d3641[_0xf6b1('0x3d')]:_0x3464cf[_0xf6b1('0x38')];if(_0xd7275[_0xf6b1('0x3c')]['includeAll']){_0x8d3641['include']=[{'all':!![]}];}_0x8d3641=_[_0xf6b1('0x45')]({},_0x8d3641,_0xd7275[_0xf6b1('0x5b')]);return db[_0xf6b1('0x48')][_0xf6b1('0x55')](_0x8d3641)[_0xf6b1('0x2f')](handleEntityNotFound(_0x3f6662,null))[_0xf6b1('0x2f')](function(_0x176348){if(_0x176348){var _0x5a4812=_0x176348[_0xf6b1('0x2b')]({'plain':!![]});_0x5a4812=qs['omit'](_0x5a4812,['id',_0xf6b1('0x5c'),'updatedAt']);_0xd7275['body']=_[_0xf6b1('0x5d')](_0xd7275[_0xf6b1('0x5e')],['id',_0xf6b1('0x5c'),'updatedAt']);return db[_0xf6b1('0x48')][_0xf6b1('0x50')](_['merge'](_0x5a4812,_0xd7275['body']),{'include':_0xd7275[_0xf6b1('0x3c')][_0xf6b1('0x4f')]?[{'all':!![]}]:undefined})[_0xf6b1('0x2f')](function(_0x400ff1){var _0x12764d=_0xd7275['user']['get']({'plain':!![]});if(!_0x12764d)throw new Error(_0xf6b1('0x51'));if(_0x12764d[_0xf6b1('0x52')]===_0xf6b1('0x53')){var _0x53c359=_0x400ff1[_0xf6b1('0x2b')]({'plain':!![]});var _0x5bf819=_0xf6b1('0x2c');return db[_0xf6b1('0x54')][_0xf6b1('0x55')]({'where':{'name':_0x5bf819,'userProfileId':_0x12764d['userProfileId']},'raw':!![]})[_0xf6b1('0x2f')](function(_0x51d266){if(_0x51d266&&_0x51d266[_0xf6b1('0x57')]===0x0){return db[_0xf6b1('0x2d')]['create']({'name':_0x53c359['name'],'resourceId':_0x53c359['id'],'type':_0x51d266['name'],'sectionId':_0x51d266['id']},{})['then'](function(){return _0x400ff1;});}else{return _0x400ff1;}})['catch'](function(_0x151fb7){logger[_0xf6b1('0x58')](_0xf6b1('0x59'),_0x151fb7);throw _0x151fb7;});}return _0x400ff1;});}})['then'](respondWithResult(_0x3f6662,0xc9))['catch'](handleError(_0x3f6662,null));};exports[_0xf6b1('0x2a')]=function(_0x2df6de,_0x5b4b88){if(_0x2df6de[_0xf6b1('0x5e')]['id']){delete _0x2df6de[_0xf6b1('0x5e')]['id'];}return db[_0xf6b1('0x48')]['find']({'where':{'id':_0x2df6de['params']['id']}})[_0xf6b1('0x2f')](handleEntityNotFound(_0x5b4b88,null))[_0xf6b1('0x2f')](saveUpdates(_0x2df6de[_0xf6b1('0x5e')],null))[_0xf6b1('0x2f')](respondWithResult(_0x5b4b88,null))[_0xf6b1('0x4b')](handleError(_0x5b4b88,null));};exports[_0xf6b1('0x2e')]=function(_0x9a2e18,_0x528aa6){return db[_0xf6b1('0x48')][_0xf6b1('0x55')]({'where':{'id':_0x9a2e18[_0xf6b1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x528aa6,null))['then'](removeEntity(_0x528aa6,null))['catch'](handleError(_0x528aa6,null));};function widgetAttributes(_0x539a46){try{switch(_0x539a46[_0xf6b1('0x36')]){case _0xf6b1('0x5f'):return[{'name':_0xf6b1('0x60'),'value':_0x539a46['attrUrl']||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x0]?_0x539a46[_0xf6b1('0x61')][0x0][_0xf6b1('0x62')]:undefined)||_0xf6b1('0x63')}];case'custom':return[{'name':_0xf6b1('0x64'),'value':_0x539a46[_0xf6b1('0x64')]||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x0]?_0x539a46[_0xf6b1('0x61')][0x0][_0xf6b1('0x62')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x539a46['attrHourFormat']||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46['attrs'][0x0]?_0x539a46[_0xf6b1('0x61')][0x0]['value']:undefined)||_0xf6b1('0x65')},{'name':'attrTimezone','value':_0x539a46[_0xf6b1('0x66')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x1]?_0x539a46['attrs'][0x1][_0xf6b1('0x62')]:undefined)||_0xf6b1('0x67')},{'name':'attrFontSize','value':_0x539a46[_0xf6b1('0x68')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x2]?_0x539a46[_0xf6b1('0x61')][0x2][_0xf6b1('0x62')]:undefined)||0xc}];case _0xf6b1('0x69'):return[{'name':_0xf6b1('0x6a'),'value':_0x539a46[_0xf6b1('0x6a')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x0]?_0x539a46[_0xf6b1('0x61')][0x0]['value']:undefined)||_0xf6b1('0x6b')},{'name':'attrVoiceQueues','value':_0x539a46[_0xf6b1('0x6c')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x1]?_0x539a46[_0xf6b1('0x61')][0x1][_0xf6b1('0x62')]:undefined)||[]},{'name':_0xf6b1('0x68'),'value':_0x539a46[_0xf6b1('0x68')]||(_0x539a46['attrs']&&_0x539a46['attrs'][0x2]?_0x539a46[_0xf6b1('0x61')][0x2][_0xf6b1('0x62')]:undefined)||0x14},{'name':'attrChannel','value':_0x539a46[_0xf6b1('0x6d')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x3]?_0x539a46[_0xf6b1('0x61')][0x3]['value']:undefined)||_0xf6b1('0x6e')},{'name':_0xf6b1('0x6f'),'value':_0x539a46['attrEmailAccounts']||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x4]?_0x539a46['attrs'][0x4][_0xf6b1('0x62')]:undefined)||''},{'name':_0xf6b1('0x70'),'value':_0x539a46[_0xf6b1('0x70')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x5]?_0x539a46[_0xf6b1('0x61')][0x5][_0xf6b1('0x62')]:undefined)||''},{'name':_0xf6b1('0x71'),'value':_0x539a46[_0xf6b1('0x71')]||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x6]?_0x539a46[_0xf6b1('0x61')][0x6][_0xf6b1('0x62')]:undefined)||''},{'name':_0xf6b1('0x72'),'value':_0x539a46[_0xf6b1('0x72')]||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x7]?_0x539a46[_0xf6b1('0x61')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x539a46[_0xf6b1('0x73')]||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x8]?_0x539a46[_0xf6b1('0x61')][0x8][_0xf6b1('0x62')]:undefined)||''},{'name':'attrChatWebsites','value':_0x539a46[_0xf6b1('0x74')]||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x9]?_0x539a46['attrs'][0x9][_0xf6b1('0x62')]:undefined)||''}];case _0xf6b1('0x75'):case _0xf6b1('0x76'):return[{'name':_0xf6b1('0x77'),'value':_0x539a46[_0xf6b1('0x77')]||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x0]?_0x539a46[_0xf6b1('0x61')][0x0][_0xf6b1('0x62')]:undefined)||_0xf6b1('0x6b')},{'name':'attrSerie2','value':_0x539a46[_0xf6b1('0x78')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x1]?_0x539a46[_0xf6b1('0x61')][0x1][_0xf6b1('0x62')]:undefined)||null},{'name':_0xf6b1('0x79'),'value':_0x539a46[_0xf6b1('0x79')]||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x2]?_0x539a46['attrs'][0x2]['value']:undefined)||null},{'name':_0xf6b1('0x6c'),'value':_0x539a46['attrVoiceQueues']||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x3]?_0x539a46['attrs'][0x3][_0xf6b1('0x62')]:undefined)||[]},{'name':_0xf6b1('0x6d'),'value':_0x539a46[_0xf6b1('0x6d')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x4]?_0x539a46[_0xf6b1('0x61')][0x4]['value']:undefined)||_0xf6b1('0x6e')},{'name':_0xf6b1('0x6f'),'value':_0x539a46[_0xf6b1('0x6f')]||(_0x539a46['attrs']&&_0x539a46[_0xf6b1('0x61')][0x5]?_0x539a46[_0xf6b1('0x61')][0x5][_0xf6b1('0x62')]:undefined)||''},{'name':_0xf6b1('0x70'),'value':_0x539a46['attrFaxAccounts']||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46['attrs'][0x6]?_0x539a46[_0xf6b1('0x61')][0x6][_0xf6b1('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x539a46['attrSmsAccounts']||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x7]?_0x539a46[_0xf6b1('0x61')][0x7][_0xf6b1('0x62')]:undefined)||''},{'name':_0xf6b1('0x72'),'value':_0x539a46['attrOpenchannelAccounts']||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46['attrs'][0x8]?_0x539a46[_0xf6b1('0x61')][0x8][_0xf6b1('0x62')]:undefined)||''},{'name':_0xf6b1('0x73'),'value':_0x539a46[_0xf6b1('0x73')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x9]?_0x539a46[_0xf6b1('0x61')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x539a46[_0xf6b1('0x74')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0xa]?_0x539a46['attrs'][0xa]['value']:undefined)||''}];case _0xf6b1('0x7a'):return[{'name':_0xf6b1('0x7b'),'type':_0x539a46['reportType']||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x0]?_0x539a46['attrs'][0x0]['type']:undefined)||null,'value':_0x539a46['attrReport']||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x0]?_0x539a46['attrs'][0x0][_0xf6b1('0x62')]:undefined)||null},{'name':_0xf6b1('0x7c'),'value':_0x539a46[_0xf6b1('0x7c')]||(_0x539a46[_0xf6b1('0x61')]&&_0x539a46[_0xf6b1('0x61')][0x1]?_0x539a46[_0xf6b1('0x61')][0x1][_0xf6b1('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x590d8e){logger[_0xf6b1('0x58')](_0xf6b1('0x7d'),JSON[_0xf6b1('0x7e')](_0x590d8e));return[];}}exports[_0xf6b1('0x7f')]=function(_0x26b0a2,_0x39f6b8,_0x371157){if(_0x26b0a2[_0xf6b1('0x5e')]['id']){delete _0x26b0a2[_0xf6b1('0x5e')]['id'];}return db['Dashboard'][_0xf6b1('0x55')]({'where':{'id':_0x26b0a2[_0xf6b1('0x4d')]['id']}})[_0xf6b1('0x2f')](handleEntityNotFound(_0x39f6b8,null))[_0xf6b1('0x2f')](function(_0x3ff0ae){if(_0x3ff0ae){_0x26b0a2[_0xf6b1('0x5e')][_0xf6b1('0x80')]=_0x3ff0ae['id'];_0x26b0a2[_0xf6b1('0x5e')]['attrs']=widgetAttributes(_0x26b0a2[_0xf6b1('0x5e')]);return db[_0xf6b1('0x81')]['create'](_0x26b0a2[_0xf6b1('0x5e')]);}})[_0xf6b1('0x2f')](respondWithResult(_0x39f6b8,null))[_0xf6b1('0x4b')](handleError(_0x39f6b8,null));};exports[_0xf6b1('0x82')]=function(_0x31752b,_0x29b066,_0x32b170){var _0x46d5ba={};var _0x1bc51f={};var _0x46a8f1;var _0x120d36;return db[_0xf6b1('0x48')]['findOne']({'where':{'id':_0x31752b[_0xf6b1('0x4d')]['id']}})[_0xf6b1('0x2f')](handleEntityNotFound(_0x29b066,null))['then'](function(_0xa4fde0){if(_0xa4fde0){_0x46a8f1=_0xa4fde0;_0x1bc51f[_0xf6b1('0x38')]=_['keys'](db[_0xf6b1('0x81')][_0xf6b1('0x4e')]);_0x1bc51f[_0xf6b1('0x3c')]=_[_0xf6b1('0x39')](_0x31752b[_0xf6b1('0x3c')]);_0x1bc51f['filters']=_[_0xf6b1('0x3b')](_0x1bc51f[_0xf6b1('0x38')],_0x1bc51f['query']);_0x46d5ba[_0xf6b1('0x3d')]=_['intersection'](_0x1bc51f[_0xf6b1('0x38')],qs[_0xf6b1('0x3e')](_0x31752b['query'][_0xf6b1('0x3e')]));_0x46d5ba[_0xf6b1('0x3d')]=_0x46d5ba[_0xf6b1('0x3d')][_0xf6b1('0x3f')]?_0x46d5ba['attributes']:_0x1bc51f['model'];_0x46d5ba[_0xf6b1('0x41')]=qs['sort'](_0x31752b[_0xf6b1('0x3c')][_0xf6b1('0x42')]);_0x46d5ba[_0xf6b1('0x43')]=qs[_0xf6b1('0x3a')](_[_0xf6b1('0x83')](_0x31752b[_0xf6b1('0x3c')],_0x1bc51f[_0xf6b1('0x3a')]));if(_0x31752b[_0xf6b1('0x3c')][_0xf6b1('0x44')]){_0x46d5ba[_0xf6b1('0x43')]=_['merge'](_0x46d5ba[_0xf6b1('0x43')],{'$or':_[_0xf6b1('0x34')](_0x46d5ba[_0xf6b1('0x3d')],function(_0x1bc112){var _0x53e58c={};_0x53e58c[_0x1bc112]={'$like':'%'+_0x31752b[_0xf6b1('0x3c')][_0xf6b1('0x44')]+'%'};return _0x53e58c;})});}_0x46d5ba=_[_0xf6b1('0x45')]({},_0x46d5ba,_0x31752b[_0xf6b1('0x5b')]);return _0x46a8f1[_0xf6b1('0x82')](_0x46d5ba);}})[_0xf6b1('0x2f')](function(_0x35f208){if(_0x35f208){_0x120d36=_0x35f208[_0xf6b1('0x3f')];if(!_0x31752b[_0xf6b1('0x3c')][_0xf6b1('0x40')]('nolimit')){_0x46d5ba['limit']=qs[_0xf6b1('0x23')](_0x31752b[_0xf6b1('0x3c')]['limit']);_0x46d5ba[_0xf6b1('0x21')]=qs['offset'](_0x31752b[_0xf6b1('0x3c')][_0xf6b1('0x21')]);}return _0x46a8f1['getItems'](_0x46d5ba);}})[_0xf6b1('0x2f')](function(_0x56399d){if(_0x56399d){return _0x56399d?{'count':_0x120d36,'rows':_0x56399d}:null;}})[_0xf6b1('0x2f')](respondWithResult(_0x29b066,null))[_0xf6b1('0x4b')](handleError(_0x29b066,null));};
\ No newline at end of file
index c9c2fba..fcfa776 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40df=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x43fae4,_0x420cd1){var _0x440784=function(_0x125e38){while(--_0x125e38){_0x43fae4['push'](_0x43fae4['shift']());}};_0x440784(++_0x420cd1);}(_0x40df,0x1c9));var _0xf40d=function(_0x419b12,_0x5d34c0){_0x419b12=_0x419b12-0x0;var _0x32324f=_0x40df[_0x419b12];return _0x32324f;};'use strict';var EventEmitter=require(_0xf40d('0x0'));var Dashboard=require(_0xf40d('0x1'))['db'][_0xf40d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf40d('0x3')](0x0);var events={'afterCreate':_0xf40d('0x4'),'afterUpdate':_0xf40d('0x5'),'afterDestroy':_0xf40d('0x6')};function emitEvent(_0x11021f){return function(_0x5e95b0,_0x2dcf74,_0x34240f){DashboardEvents[_0xf40d('0x7')](_0x11021f+':'+_0x5e95b0['id'],_0x5e95b0);DashboardEvents[_0xf40d('0x7')](_0x11021f,_0x5e95b0);_0x34240f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xf40d('0x8')](e,emitEvent(event));}}module[_0xf40d('0x9')]=DashboardEvents;
\ No newline at end of file
+var _0x7d0e=['exports','events','Dashboard','update','emit','hasOwnProperty','hook'];(function(_0x495f5c,_0x2a6a99){var _0x649dc1=function(_0x4941d9){while(--_0x4941d9){_0x495f5c['push'](_0x495f5c['shift']());}};_0x649dc1(++_0x2a6a99);}(_0x7d0e,0x1f2));var _0xe7d0=function(_0x1f789d,_0x2e2f96){_0x1f789d=_0x1f789d-0x0;var _0x3c871e=_0x7d0e[_0x1f789d];return _0x3c871e;};'use strict';var EventEmitter=require(_0xe7d0('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xe7d0('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe7d0('0x2'),'afterDestroy':'remove'};function emitEvent(_0x137c49){return function(_0x49c1fc,_0x473783,_0x593e68){DashboardEvents[_0xe7d0('0x3')](_0x137c49+':'+_0x49c1fc['id'],_0x49c1fc);DashboardEvents[_0xe7d0('0x3')](_0x137c49,_0x49c1fc);_0x593e68(null);};}for(var e in events){if(events[_0xe7d0('0x4')](e)){var event=events[e];Dashboard[_0xe7d0('0x5')](e,emitEvent(event));}}module[_0xe7d0('0x6')]=DashboardEvents;
\ No newline at end of file
index ee21e73..ef49cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e0f=['moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','api'];(function(_0x54603a,_0x7f8d4a){var _0x21eb5b=function(_0x212c68){while(--_0x212c68){_0x54603a['push'](_0x54603a['shift']());}};_0x21eb5b(++_0x7f8d4a);}(_0x0e0f,0xe5));var _0xf0e0=function(_0x511c9f,_0xc6191f){_0x511c9f=_0x511c9f-0x0;var _0x4d1f9c=_0x0e0f[_0x511c9f];return _0x4d1f9c;};'use strict';var _=require(_0xf0e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf0e0('0x1'));var moment=require(_0xf0e0('0x2'));var BPromise=require(_0xf0e0('0x3'));var rp=require(_0xf0e0('0x4'));var fs=require('fs');var path=require(_0xf0e0('0x5'));var rimraf=require('rimraf');var config=require(_0xf0e0('0x6'));var attributes=require(_0xf0e0('0x7'));module['exports']=function(_0x6c3cb4,_0x198226){return _0x6c3cb4[_0xf0e0('0x8')](_0xf0e0('0x9'),attributes,{'tableName':_0xf0e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb73=['../../config/environment','./dashboard.attributes','exports','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4c1022,_0x34d48e){var _0x2727df=function(_0x3becd9){while(--_0x3becd9){_0x4c1022['push'](_0x4c1022['shift']());}};_0x2727df(++_0x34d48e);}(_0xbb73,0x81));var _0x3bb7=function(_0x42ba89,_0xc9cba){_0x42ba89=_0x42ba89-0x0;var _0x271cee=_0xbb73[_0x42ba89];return _0x271cee;};'use strict';var _=require(_0x3bb7('0x0'));var util=require('util');var logger=require(_0x3bb7('0x1'))(_0x3bb7('0x2'));var moment=require(_0x3bb7('0x3'));var BPromise=require(_0x3bb7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3bb7('0x5'));var config=require(_0x3bb7('0x6'));var attributes=require(_0x3bb7('0x7'));module[_0x3bb7('0x8')]=function(_0xefe415,_0x31edd5){return _0xefe415['define']('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 289f030..1d34d37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05a1=['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','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis'];(function(_0x414605,_0x4cc679){var _0x1cdf30=function(_0x28c66f){while(--_0x28c66f){_0x414605['push'](_0x414605['shift']());}};_0x1cdf30(++_0x4cc679);}(_0x05a1,0x1ec));var _0x105a=function(_0xdd349,_0x4593d3){_0xdd349=_0xdd349-0x0;var _0x4afffd=_0x05a1[_0xdd349];return _0x4afffd;};'use strict';var _=require(_0x105a('0x0'));var util=require('util');var moment=require(_0x105a('0x1'));var BPromise=require(_0x105a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x105a('0x3'));var db=require(_0x105a('0x4'))['db'];var utils=require(_0x105a('0x5'));var logger=require(_0x105a('0x6'))(_0x105a('0x7'));var config=require(_0x105a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x105a('0x9')]({'port':0x232a});config['redis']=_[_0x105a('0xa')](config[_0x105a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x105a('0xc'))(new Redis(config['redis']));require(_0x105a('0xd'))[_0x105a('0xe')](socket);function respondWithRpcPromise(_0x1eee00,_0x3c3b7d,_0x527034){return new BPromise(function(_0x3eee01,_0xcffa99){return client[_0x105a('0xf')](_0x1eee00,_0x527034)[_0x105a('0x10')](function(_0x5dc697){logger[_0x105a('0x11')](_0x105a('0x12'),_0x3c3b7d,_0x105a('0x13'));logger[_0x105a('0x14')](_0x105a('0x15'),_0x3c3b7d,'request\x20sent',JSON[_0x105a('0x16')](_0x5dc697));if(_0x5dc697[_0x105a('0x17')]){if(_0x5dc697['error'][_0x105a('0x18')]===0x1f4){logger['error'](_0x105a('0x12'),_0x3c3b7d,_0x5dc697[_0x105a('0x17')][_0x105a('0x19')]);return _0xcffa99(_0x5dc697['error'][_0x105a('0x19')]);}logger['error'](_0x105a('0x12'),_0x3c3b7d,_0x5dc697[_0x105a('0x17')]['message']);return _0x3eee01(_0x5dc697[_0x105a('0x17')]['message']);}else{logger[_0x105a('0x11')]('Dashboard,\x20%s,\x20%s',_0x3c3b7d,_0x105a('0x13'));_0x3eee01(_0x5dc697[_0x105a('0x1a')][_0x105a('0x19')]);}})[_0x105a('0x1b')](function(_0x4af457){logger[_0x105a('0x17')](_0x105a('0x12'),_0x3c3b7d,_0x4af457);_0xcffa99(_0x4af457);});});}
\ No newline at end of file
+var _0x8cd5=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','util','moment'];(function(_0x5c9e3e,_0xcb60fd){var _0x1e3b33=function(_0x2b2e24){while(--_0x2b2e24){_0x5c9e3e['push'](_0x5c9e3e['shift']());}};_0x1e3b33(++_0xcb60fd);}(_0x8cd5,0x1b0));var _0x58cd=function(_0x486879,_0x238800){_0x486879=_0x486879-0x0;var _0xe440e5=_0x8cd5[_0x486879];return _0xe440e5;};'use strict';var _=require(_0x58cd('0x0'));var util=require(_0x58cd('0x1'));var moment=require(_0x58cd('0x2'));var BPromise=require(_0x58cd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58cd('0x4'));var db=require(_0x58cd('0x5'))['db'];var utils=require(_0x58cd('0x6'));var logger=require('../../config/logger')(_0x58cd('0x7'));var config=require(_0x58cd('0x8'));var jayson=require(_0x58cd('0x9'));var client=jayson[_0x58cd('0xa')][_0x58cd('0xb')]({'port':0x232a});config[_0x58cd('0xc')]=_[_0x58cd('0xd')](config[_0x58cd('0xc')],{'host':_0x58cd('0xe'),'port':0x18eb});var socket=require(_0x58cd('0xf'))(new Redis(config['redis']));require(_0x58cd('0x10'))['register'](socket);function respondWithRpcPromise(_0x2c3e41,_0x82b430,_0x503913){return new BPromise(function(_0xca5cd6,_0x283fa7){return client[_0x58cd('0x11')](_0x2c3e41,_0x503913)[_0x58cd('0x12')](function(_0x5e4990){logger['info'](_0x58cd('0x13'),_0x82b430,_0x58cd('0x14'));logger[_0x58cd('0x15')](_0x58cd('0x16'),_0x82b430,'request\x20sent',JSON['stringify'](_0x5e4990));if(_0x5e4990['error']){if(_0x5e4990['error'][_0x58cd('0x17')]===0x1f4){logger[_0x58cd('0x18')](_0x58cd('0x13'),_0x82b430,_0x5e4990[_0x58cd('0x18')][_0x58cd('0x19')]);return _0x283fa7(_0x5e4990[_0x58cd('0x18')][_0x58cd('0x19')]);}logger[_0x58cd('0x18')](_0x58cd('0x13'),_0x82b430,_0x5e4990[_0x58cd('0x18')][_0x58cd('0x19')]);return _0xca5cd6(_0x5e4990[_0x58cd('0x18')][_0x58cd('0x19')]);}else{logger[_0x58cd('0x1a')](_0x58cd('0x13'),_0x82b430,_0x58cd('0x14'));_0xca5cd6(_0x5e4990[_0x58cd('0x1b')][_0x58cd('0x19')]);}})[_0x58cd('0x1c')](function(_0x5a3bb2){logger['error'](_0x58cd('0x13'),_0x82b430,_0x5a3bb2);_0x283fa7(_0x5a3bb2);});});}
\ No newline at end of file
index aecc422..2742953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9580=['removeListener','register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x1a3a08,_0x41e91b){var _0x55c399=function(_0x4ec720){while(--_0x4ec720){_0x1a3a08['push'](_0x1a3a08['shift']());}};_0x55c399(++_0x41e91b);}(_0x9580,0x94));var _0x0958=function(_0x1a26a1,_0x2e0927){_0x1a26a1=_0x1a26a1-0x0;var _0x5abcd3=_0x9580[_0x1a26a1];return _0x5abcd3;};'use strict';var DashboardEvents=require(_0x0958('0x0'));var events=[_0x0958('0x1'),_0x0958('0x2'),_0x0958('0x3')];function createListener(_0x42e024,_0x425508){return function(_0x1527f3){_0x425508[_0x0958('0x4')](_0x42e024,_0x1527f3);};}function removeListener(_0x4dea77,_0x23965f){return function(){DashboardEvents[_0x0958('0x5')](_0x4dea77,_0x23965f);};}exports[_0x0958('0x6')]=function(_0x3696db){for(var _0x454bb2=0x0,_0xd573c1=events[_0x0958('0x7')];_0x454bb2<_0xd573c1;_0x454bb2++){var _0x3b0094=events[_0x454bb2];var _0xf8b3c=createListener(_0x0958('0x8')+_0x3b0094,_0x3696db);DashboardEvents['on'](_0x3b0094,_0xf8b3c);}};
\ No newline at end of file
+var _0xda75=['length','dashboard:','./dashboard.events','save','remove','update','register'];(function(_0x3f12c0,_0x412b90){var _0x946a6c=function(_0x1c05f2){while(--_0x1c05f2){_0x3f12c0['push'](_0x3f12c0['shift']());}};_0x946a6c(++_0x412b90);}(_0xda75,0xaa));var _0x5da7=function(_0x3c5eb8,_0x29348c){_0x3c5eb8=_0x3c5eb8-0x0;var _0x4ab161=_0xda75[_0x3c5eb8];return _0x4ab161;};'use strict';var DashboardEvents=require(_0x5da7('0x0'));var events=[_0x5da7('0x1'),_0x5da7('0x2'),_0x5da7('0x3')];function createListener(_0x5cd4df,_0x4f51dc){return function(_0x33ca8c){_0x4f51dc['emit'](_0x5cd4df,_0x33ca8c);};}function removeListener(_0x561ab2,_0x44b897){return function(){DashboardEvents['removeListener'](_0x561ab2,_0x44b897);};}exports[_0x5da7('0x4')]=function(_0x7d6a18){for(var _0x21ba6a=0x0,_0x344931=events[_0x5da7('0x5')];_0x21ba6a<_0x344931;_0x21ba6a++){var _0x29d71c=events[_0x21ba6a];var _0x58dd43=createListener(_0x5da7('0x6')+_0x29d71c,_0x7d6a18);DashboardEvents['on'](_0x29d71c,_0x58dd43);}};
\ No newline at end of file
index 611da9b..2d88d2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90a1=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','clone','/:id/items','addItem','put','update','delete','destroy','util'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x90a1,0xba));var _0x190a=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x90a1[_0x172747];return _0x509692;};'use strict';var multer=require('multer');var util=require(_0x190a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x190a('0x1'));var auth=require(_0x190a('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x190a('0x3'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x190a('0x4')](),controller[_0x190a('0x5')]);router[_0x190a('0x6')](_0x190a('0x7'),auth[_0x190a('0x4')](),controller[_0x190a('0x8')]);router[_0x190a('0x6')]('/:id/items',auth[_0x190a('0x4')](),controller['getItems']);router['post']('/',auth[_0x190a('0x4')](),controller[_0x190a('0x9')]);router['post']('/:id/clone',auth[_0x190a('0x4')](),controller[_0x190a('0xa')]);router['post'](_0x190a('0xb'),auth[_0x190a('0x4')](),controller[_0x190a('0xc')]);router[_0x190a('0xd')](_0x190a('0x7'),auth[_0x190a('0x4')](),controller[_0x190a('0xe')]);router[_0x190a('0xf')](_0x190a('0x7'),auth[_0x190a('0x4')](),controller[_0x190a('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xc81e=['../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','getItems','post','create','/:id/clone','/:id/items','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x2241f8,_0x4f6bf6){var _0x317925=function(_0x5816e0){while(--_0x5816e0){_0x2241f8['push'](_0x2241f8['shift']());}};_0x317925(++_0x4f6bf6);}(_0xc81e,0x78));var _0xec81=function(_0x3b1e3f,_0xf8826b){_0x3b1e3f=_0x3b1e3f-0x0;var _0x3b1cd3=_0xc81e[_0x3b1e3f];return _0x3b1cd3;};'use strict';var multer=require(_0xec81('0x0'));var util=require(_0xec81('0x1'));var path=require(_0xec81('0x2'));var timeout=require(_0xec81('0x3'));var express=require(_0xec81('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xec81('0x5'));var interaction=require(_0xec81('0x6'));var config=require('../../config/environment');var controller=require(_0xec81('0x7'));router[_0xec81('0x8')]('/',auth[_0xec81('0x9')](),controller[_0xec81('0xa')]);router[_0xec81('0x8')](_0xec81('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xec81('0x8')]('/:id/items',auth['isAuthenticated'](),controller[_0xec81('0xc')]);router[_0xec81('0xd')]('/',auth['isAuthenticated'](),controller[_0xec81('0xe')]);router[_0xec81('0xd')](_0xec81('0xf'),auth[_0xec81('0x9')](),controller['clone']);router[_0xec81('0xd')](_0xec81('0x10'),auth[_0xec81('0x9')](),controller['addItem']);router[_0xec81('0x11')]('/:id',auth[_0xec81('0x9')](),controller[_0xec81('0x12')]);router[_0xec81('0x13')](_0xec81('0xb'),auth[_0xec81('0x9')](),controller[_0xec81('0x14')]);module['exports']=router;
\ No newline at end of file
index 2f2a569..69e507d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x1d0ed1,_0x3ef24b){var _0xb36789=function(_0x388792){while(--_0x388792){_0x1d0ed1['push'](_0x1d0ed1['shift']());}};_0xb36789(++_0x3ef24b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require(_0xac4a('0x0'));var squel=require(_0xac4a('0x1'));var _=require(_0xac4a('0x2'));module[_0xac4a('0x3')]={'title':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xac4a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0xac4a('0x5')](_0xac4a('0x6')));}catch(_0x730a38){return[];}},'set':function(_0x215f39){try{this[_0xac4a('0x7')](_0xac4a('0x6'),JSON[_0xac4a('0x8')](_0x215f39));}catch(_0x10525b){this['setDataValue']('attrs',JSON[_0xac4a('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xac4a('0x9')]},'background':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![],'defaultValue':_0xac4a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac4a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xac4a('0x9')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x7a54=['lodash','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7a54,0x106));var _0x47a5=function(_0x5117f6,_0x378d91){_0x5117f6=_0x5117f6-0x0;var _0x5b242e=_0x7a54[_0x5117f6];return _0x5b242e;};'use strict';var Sequelize=require(_0x47a5('0x0'));var squel=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));module['exports']={'title':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x47a5('0x4')),'get':function(){try{return JSON[_0x47a5('0x5')](this[_0x47a5('0x6')](_0x47a5('0x7')));}catch(_0xfdf934){return[];}},'set':function(_0x545a97){try{this[_0x47a5('0x8')]('attrs',JSON[_0x47a5('0x9')](_0x545a97));}catch(_0x30e405){this['setDataValue'](_0x47a5('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x47a5('0xa')]},'col':{'type':Sequelize[_0x47a5('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47a5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x47a5('0x3')]},'titleFontSize':{'type':Sequelize[_0x47a5('0xa')],'defaultValue':0xc}};
\ No newline at end of file
index 000b89e..4b6be26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cc7=['attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrEmailAccounts','attrReport','reportType','attrRefresh','error','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize'];(function(_0x31326c,_0x19d7dd){var _0x22d50d=function(_0x20f9ce){while(--_0x20f9ce){_0x31326c['push'](_0x31326c['shift']());}};_0x22d50d(++_0x19d7dd);}(_0x4cc7,0x1b6));var _0x74cc=function(_0xcc264e,_0x208f84){_0xcc264e=_0xcc264e-0x0;var _0x1b4960=_0x4cc7[_0xcc264e];return _0x1b4960;};'use strict';var emlformat=require(_0x74cc('0x0'));var rimraf=require(_0x74cc('0x1'));var zipdir=require(_0x74cc('0x2'));var jsonpatch=require(_0x74cc('0x3'));var rp=require(_0x74cc('0x4'));var moment=require(_0x74cc('0x5'));var BPromise=require(_0x74cc('0x6'));var Mustache=require(_0x74cc('0x7'));var util=require('util');var path=require(_0x74cc('0x8'));var sox=require(_0x74cc('0x9'));var csv=require(_0x74cc('0xa'));var ejs=require(_0x74cc('0xb'));var fs=require('fs');var fs_extra=require(_0x74cc('0xc'));var _=require(_0x74cc('0xd'));var squel=require(_0x74cc('0xe'));var crypto=require(_0x74cc('0xf'));var jsforce=require(_0x74cc('0x10'));var deskjs=require(_0x74cc('0x11'));var toCsv=require(_0x74cc('0xa'));var querystring=require(_0x74cc('0x12'));var Papa=require(_0x74cc('0x13'));var Redis=require('ioredis');var authService=require(_0x74cc('0x14'));var qs=require(_0x74cc('0x15'));var as=require(_0x74cc('0x16'));var hardwareService=require(_0x74cc('0x17'));var logger=require(_0x74cc('0x18'))(_0x74cc('0x19'));var utils=require(_0x74cc('0x1a'));var config=require(_0x74cc('0x1b'));var licenseUtil=require(_0x74cc('0x1c'));var db=require(_0x74cc('0x1d'))['db'];config[_0x74cc('0x1e')]=_[_0x74cc('0x1f')](config['redis'],{'host':_0x74cc('0x20'),'port':0x18eb});var socket=require(_0x74cc('0x21'))(new Redis(config[_0x74cc('0x1e')]));require('./dashboardItem.socket')[_0x74cc('0x22')](socket);function respondWithStatusCode(_0x1a2b8b,_0x300fda){_0x300fda=_0x300fda||0xcc;return function(_0x1d248c){if(_0x1d248c){return _0x1a2b8b[_0x74cc('0x23')](_0x300fda);}return _0x1a2b8b[_0x74cc('0x24')](_0x300fda)[_0x74cc('0x25')]();};}function respondWithResult(_0x47e76b,_0x363163){_0x363163=_0x363163||0xc8;return function(_0x5d8c7b){if(_0x5d8c7b){return _0x47e76b['status'](_0x363163)[_0x74cc('0x26')](_0x5d8c7b);}};}function respondWithFilteredResult(_0x388de9,_0x2339fe){return function(_0x1fb365){if(_0x1fb365){var _0x321995=typeof _0x2339fe['offset']===_0x74cc('0x27')&&typeof _0x2339fe[_0x74cc('0x28')]===_0x74cc('0x27');var _0x15bf31=_0x1fb365[_0x74cc('0x29')];var _0x744ea2=_0x321995?0x0:_0x2339fe[_0x74cc('0x2a')];var _0x261bf7=_0x321995?_0x1fb365[_0x74cc('0x29')]:_0x2339fe[_0x74cc('0x2a')]+_0x2339fe['limit'];var _0x44812d;if(_0x261bf7>=_0x15bf31){_0x261bf7=_0x15bf31;_0x44812d=0xc8;}else{_0x44812d=0xce;}_0x388de9[_0x74cc('0x24')](_0x44812d);return _0x388de9[_0x74cc('0x2b')](_0x74cc('0x2c'),_0x744ea2+'-'+_0x261bf7+'/'+_0x15bf31)[_0x74cc('0x26')](_0x1fb365);}return null;};}function patchUpdates(_0x18183c){return function(_0x2cc96f){try{jsonpatch[_0x74cc('0x2d')](_0x2cc96f,_0x18183c,!![]);}catch(_0x3d5f3c){return BPromise['reject'](_0x3d5f3c);}return _0x2cc96f[_0x74cc('0x2e')]();};}function saveUpdates(_0x3c327d,_0x5912ea){return function(_0x44c079){if(_0x44c079){return _0x44c079[_0x74cc('0x2f')](_0x3c327d)[_0x74cc('0x30')](function(_0x26aa57){return _0x26aa57;});}return null;};}function removeEntity(_0x21b42b,_0x4a14ad){return function(_0x33fc24){if(_0x33fc24){return _0x33fc24[_0x74cc('0x31')]()['then'](function(){_0x21b42b[_0x74cc('0x24')](0xcc)[_0x74cc('0x25')]();});}};}function handleEntityNotFound(_0x2843f6,_0x1a7739){return function(_0x31daaa){if(!_0x31daaa){_0x2843f6[_0x74cc('0x23')](0x194);}return _0x31daaa;};}function handleError(_0x581872,_0x2c671c){_0x2c671c=_0x2c671c||0x1f4;return function(_0x42a856){logger['error'](_0x42a856['stack']);if(_0x42a856[_0x74cc('0x32')]){delete _0x42a856[_0x74cc('0x32')];}_0x581872[_0x74cc('0x24')](_0x2c671c)[_0x74cc('0x33')](_0x42a856);};}exports[_0x74cc('0x34')]=function(_0x312053,_0x28923e){var _0x4ddc7e={'raw':![],'where':{'id':_0x312053[_0x74cc('0x35')]['id']}},_0x3ffe94={};_0x3ffe94[_0x74cc('0x36')]=_['keys'](db[_0x74cc('0x37')][_0x74cc('0x38')]);_0x3ffe94[_0x74cc('0x39')]=_[_0x74cc('0x3a')](_0x312053[_0x74cc('0x39')]);_0x3ffe94[_0x74cc('0x3b')]=_[_0x74cc('0x3c')](_0x3ffe94[_0x74cc('0x36')],_0x3ffe94[_0x74cc('0x39')]);_0x4ddc7e[_0x74cc('0x3d')]=_[_0x74cc('0x3c')](_0x3ffe94[_0x74cc('0x36')],qs[_0x74cc('0x3e')](_0x312053[_0x74cc('0x39')][_0x74cc('0x3e')]));_0x4ddc7e[_0x74cc('0x3d')]=_0x4ddc7e[_0x74cc('0x3d')]['length']?_0x4ddc7e['attributes']:_0x3ffe94[_0x74cc('0x36')];if(_0x312053[_0x74cc('0x39')][_0x74cc('0x3f')]){_0x4ddc7e[_0x74cc('0x40')]=[{'all':!![]}];}_0x4ddc7e=_[_0x74cc('0x41')]({},_0x4ddc7e,_0x312053[_0x74cc('0x42')]);return db[_0x74cc('0x37')][_0x74cc('0x43')](_0x4ddc7e)[_0x74cc('0x30')](handleEntityNotFound(_0x28923e,null))[_0x74cc('0x30')](respondWithResult(_0x28923e,null))[_0x74cc('0x44')](handleError(_0x28923e,null));};exports[_0x74cc('0x31')]=function(_0x597c1f,_0x573353){return db[_0x74cc('0x37')][_0x74cc('0x43')]({'where':{'id':_0x597c1f[_0x74cc('0x35')]['id']}})[_0x74cc('0x30')](handleEntityNotFound(_0x573353,null))[_0x74cc('0x30')](removeEntity(_0x573353,null))[_0x74cc('0x44')](handleError(_0x573353,null));};function widgetAttributes(_0x38d4e2){try{switch(_0x38d4e2[_0x74cc('0x45')]){case _0x74cc('0x46'):return[{'name':_0x74cc('0x47'),'value':_0x38d4e2[_0x74cc('0x47')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||_0x74cc('0x4a')}];case _0x74cc('0x4b'):return[{'name':_0x74cc('0x4c'),'value':_0x38d4e2[_0x74cc('0x4c')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||''}];case _0x74cc('0x4d'):return[{'name':_0x74cc('0x4e'),'value':_0x38d4e2['attrHourFormat']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||'HH:mm:ss'},{'name':_0x74cc('0x4f'),'value':_0x38d4e2['attrTimezone']||(_0x38d4e2['attrs']&&_0x38d4e2['attrs'][0x1]?_0x38d4e2[_0x74cc('0x48')][0x1][_0x74cc('0x49')]:undefined)||_0x74cc('0x50')},{'name':_0x74cc('0x51'),'value':_0x38d4e2[_0x74cc('0x51')]||(_0x38d4e2['attrs']&&_0x38d4e2['attrs'][0x2]?_0x38d4e2[_0x74cc('0x48')][0x2][_0x74cc('0x49')]:undefined)||0xc}];case'counter':return[{'name':_0x74cc('0x52'),'value':_0x38d4e2[_0x74cc('0x52')]||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2['attrs'][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x38d4e2[_0x74cc('0x53')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x1]?_0x38d4e2['attrs'][0x1]['value']:undefined)||[]},{'name':_0x74cc('0x51'),'value':_0x38d4e2['attrFontSize']||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x2]?_0x38d4e2['attrs'][0x2][_0x74cc('0x49')]:undefined)||0x14},{'name':_0x74cc('0x54'),'value':_0x38d4e2[_0x74cc('0x54')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x3]?_0x38d4e2[_0x74cc('0x48')][0x3][_0x74cc('0x49')]:undefined)||_0x74cc('0x55')},{'name':'attrEmailAccounts','value':_0x38d4e2['attrEmailAccounts']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x4]?_0x38d4e2['attrs'][0x4][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x56'),'value':_0x38d4e2[_0x74cc('0x56')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x5]?_0x38d4e2[_0x74cc('0x48')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x38d4e2[_0x74cc('0x57')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x6]?_0x38d4e2['attrs'][0x6]['value']:undefined)||''},{'name':_0x74cc('0x58'),'value':_0x38d4e2[_0x74cc('0x58')]||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x7]?_0x38d4e2[_0x74cc('0x48')][0x7][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x59'),'value':_0x38d4e2['attrWhatsappAccounts']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x8]?_0x38d4e2['attrs'][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x38d4e2[_0x74cc('0x5a')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x9]?_0x38d4e2[_0x74cc('0x48')][0x9][_0x74cc('0x49')]:undefined)||''}];case _0x74cc('0x5b'):case _0x74cc('0x5c'):return[{'name':_0x74cc('0x5d'),'value':_0x38d4e2['attrSerie1']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||_0x74cc('0x5e')},{'name':_0x74cc('0x5f'),'value':_0x38d4e2[_0x74cc('0x5f')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x1]?_0x38d4e2['attrs'][0x1][_0x74cc('0x49')]:undefined)||null},{'name':_0x74cc('0x60'),'value':_0x38d4e2[_0x74cc('0x60')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x2]?_0x38d4e2[_0x74cc('0x48')][0x2][_0x74cc('0x49')]:undefined)||null},{'name':_0x74cc('0x53'),'value':_0x38d4e2[_0x74cc('0x53')]||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x3]?_0x38d4e2[_0x74cc('0x48')][0x3][_0x74cc('0x49')]:undefined)||[]},{'name':_0x74cc('0x54'),'value':_0x38d4e2[_0x74cc('0x54')]||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x4]?_0x38d4e2['attrs'][0x4][_0x74cc('0x49')]:undefined)||'voice'},{'name':_0x74cc('0x61'),'value':_0x38d4e2[_0x74cc('0x61')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x5]?_0x38d4e2[_0x74cc('0x48')][0x5][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x56'),'value':_0x38d4e2['attrFaxAccounts']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x6]?_0x38d4e2[_0x74cc('0x48')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x38d4e2[_0x74cc('0x57')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x7]?_0x38d4e2[_0x74cc('0x48')][0x7][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x58'),'value':_0x38d4e2[_0x74cc('0x58')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x8]?_0x38d4e2[_0x74cc('0x48')][0x8][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x59'),'value':_0x38d4e2[_0x74cc('0x59')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x9]?_0x38d4e2['attrs'][0x9][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x5a'),'value':_0x38d4e2[_0x74cc('0x5a')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0xa]?_0x38d4e2['attrs'][0xa][_0x74cc('0x49')]:undefined)||''}];case'web-report':return[{'name':_0x74cc('0x62'),'type':_0x38d4e2[_0x74cc('0x63')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x45')]:undefined)||null,'value':_0x38d4e2['attrReport']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||null},{'name':'attrRefresh','value':_0x38d4e2[_0x74cc('0x64')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x1]?_0x38d4e2[_0x74cc('0x48')][0x1][_0x74cc('0x49')]:undefined)||0x0}];default:return[];}}catch(_0xf592e8){logger[_0x74cc('0x65')]('widgetAttributes:\x20%s',JSON['stringify'](_0xf592e8));return[];}}exports[_0x74cc('0x66')]=function(_0x2f4bc4,_0x3cdf35){if(_0x2f4bc4['body']){_0x2f4bc4[_0x74cc('0x67')]['attrs']=widgetAttributes(_0x2f4bc4['body']);}return db[_0x74cc('0x37')]['create'](_0x2f4bc4['body'],{})[_0x74cc('0x30')](respondWithResult(_0x3cdf35,0xc9))[_0x74cc('0x44')](handleError(_0x3cdf35,null));};exports[_0x74cc('0x2f')]=function(_0x42561d,_0x4af75f){if(_0x42561d[_0x74cc('0x67')]['id']){delete _0x42561d[_0x74cc('0x67')]['id'];}_0x42561d['body'][_0x74cc('0x48')]=widgetAttributes(_0x42561d[_0x74cc('0x67')]);return db[_0x74cc('0x37')]['find']({'where':{'id':_0x42561d[_0x74cc('0x35')]['id']}})[_0x74cc('0x30')](handleEntityNotFound(_0x4af75f,null))['then'](saveUpdates(_0x42561d[_0x74cc('0x67')],null))[_0x74cc('0x30')](respondWithResult(_0x4af75f,null))[_0x74cc('0x44')](handleError(_0x4af75f,null));};
\ No newline at end of file
+var _0xdbf5=['web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','show','params','model','rawAttributes','query','keys','filters','attributes','fields','length','includeAll','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrEmailAccounts','attrOpenchannelAccounts'];(function(_0x1f77c4,_0x2c03f8){var _0x7ccb2=function(_0x5b1f09){while(--_0x5b1f09){_0x1f77c4['push'](_0x1f77c4['shift']());}};_0x7ccb2(++_0x2c03f8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x119a90,_0x4762){_0x119a90=_0x119a90-0x0;var _0x65e317=_0xdbf5[_0x119a90];return _0x65e317;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];config[_0x5dbf('0x16')]=_[_0x5dbf('0x17')](config[_0x5dbf('0x16')],{'host':_0x5dbf('0x18'),'port':0x18eb});var socket=require(_0x5dbf('0x19'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x5dbf('0x1a')](socket);function respondWithStatusCode(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xcc;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x1b')](_0x48e7fd);}return _0x3480c8[_0x5dbf('0x1c')](_0x48e7fd)[_0x5dbf('0x1d')]();};}function respondWithResult(_0x181816,_0x472eb9){_0x472eb9=_0x472eb9||0xc8;return function(_0x2d32cc){if(_0x2d32cc){return _0x181816['status'](_0x472eb9)['json'](_0x2d32cc);}};}function respondWithFilteredResult(_0x16dc82,_0xc4cb1c){return function(_0x39c7aa){if(_0x39c7aa){var _0x14abf7=typeof _0xc4cb1c[_0x5dbf('0x1e')]==='undefined'&&typeof _0xc4cb1c[_0x5dbf('0x1f')]==='undefined';var _0x565efa=_0x39c7aa['count'];var _0x23d1e7=_0x14abf7?0x0:_0xc4cb1c[_0x5dbf('0x1e')];var _0x358d46=_0x14abf7?_0x39c7aa[_0x5dbf('0x20')]:_0xc4cb1c[_0x5dbf('0x1e')]+_0xc4cb1c['limit'];var _0x2764ea;if(_0x358d46>=_0x565efa){_0x358d46=_0x565efa;_0x2764ea=0xc8;}else{_0x2764ea=0xce;}_0x16dc82['status'](_0x2764ea);return _0x16dc82[_0x5dbf('0x21')](_0x5dbf('0x22'),_0x23d1e7+'-'+_0x358d46+'/'+_0x565efa)[_0x5dbf('0x23')](_0x39c7aa);}return null;};}function patchUpdates(_0x43a612){return function(_0x3b763c){try{jsonpatch[_0x5dbf('0x24')](_0x3b763c,_0x43a612,!![]);}catch(_0x58085e){return BPromise[_0x5dbf('0x25')](_0x58085e);}return _0x3b763c[_0x5dbf('0x26')]();};}function saveUpdates(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x27')](_0x2d3e1b)[_0x5dbf('0x28')](function(_0x20ab1b){return _0x20ab1b;});}return null;};}function removeEntity(_0x42f13b,_0x15a790){return function(_0x9e15ac){if(_0x9e15ac){return _0x9e15ac[_0x5dbf('0x29')]()[_0x5dbf('0x28')](function(){_0x42f13b[_0x5dbf('0x1c')](0xcc)[_0x5dbf('0x1d')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x1b')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x2a')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x2b')]){delete _0x471027[_0x5dbf('0x2b')];}_0x22ec42[_0x5dbf('0x1c')](_0x6a9757)[_0x5dbf('0x2c')](_0x471027);};}exports[_0x5dbf('0x2d')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={'raw':![],'where':{'id':_0x6a276d[_0x5dbf('0x2e')]['id']}},_0x406ce6={};_0x406ce6[_0x5dbf('0x2f')]=_['keys'](db['DashboardItem'][_0x5dbf('0x30')]);_0x406ce6[_0x5dbf('0x31')]=_[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x31')]);_0x406ce6[_0x5dbf('0x33')]=_['intersection'](_0x406ce6['model'],_0x406ce6[_0x5dbf('0x31')]);_0x31d57a[_0x5dbf('0x34')]=_['intersection'](_0x406ce6[_0x5dbf('0x2f')],qs[_0x5dbf('0x35')](_0x6a276d[_0x5dbf('0x31')][_0x5dbf('0x35')]));_0x31d57a[_0x5dbf('0x34')]=_0x31d57a['attributes'][_0x5dbf('0x36')]?_0x31d57a[_0x5dbf('0x34')]:_0x406ce6[_0x5dbf('0x2f')];if(_0x6a276d[_0x5dbf('0x31')][_0x5dbf('0x37')]){_0x31d57a['include']=[{'all':!![]}];}_0x31d57a=_[_0x5dbf('0x38')]({},_0x31d57a,_0x6a276d[_0x5dbf('0x39')]);return db[_0x5dbf('0x3a')][_0x5dbf('0x3b')](_0x31d57a)['then'](handleEntityNotFound(_0x2a65c5,null))[_0x5dbf('0x28')](respondWithResult(_0x2a65c5,null))[_0x5dbf('0x3c')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x29')]=function(_0x3439da,_0x3e309a){return db[_0x5dbf('0x3a')][_0x5dbf('0x3b')]({'where':{'id':_0x3439da[_0x5dbf('0x2e')]['id']}})[_0x5dbf('0x28')](handleEntityNotFound(_0x3e309a,null))[_0x5dbf('0x28')](removeEntity(_0x3e309a,null))[_0x5dbf('0x3c')](handleError(_0x3e309a,null));};function widgetAttributes(_0x51c667){try{switch(_0x51c667[_0x5dbf('0x3d')]){case _0x5dbf('0x3e'):return[{'name':_0x5dbf('0x3f'),'value':_0x51c667['attrUrl']||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x0]?_0x51c667[_0x5dbf('0x40')][0x0]['value']:undefined)||_0x5dbf('0x41')}];case _0x5dbf('0x42'):return[{'name':_0x5dbf('0x43'),'value':_0x51c667['attrPath']||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x0]?_0x51c667[_0x5dbf('0x40')][0x0][_0x5dbf('0x44')]:undefined)||''}];case _0x5dbf('0x45'):return[{'name':_0x5dbf('0x46'),'value':_0x51c667[_0x5dbf('0x46')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667['attrs'][0x0]?_0x51c667['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x5dbf('0x47'),'value':_0x51c667[_0x5dbf('0x47')]||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x1]?_0x51c667[_0x5dbf('0x40')][0x1]['value']:undefined)||_0x5dbf('0x48')},{'name':_0x5dbf('0x49'),'value':_0x51c667[_0x5dbf('0x49')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x2]?_0x51c667[_0x5dbf('0x40')][0x2][_0x5dbf('0x44')]:undefined)||0xc}];case _0x5dbf('0x4a'):return[{'name':_0x5dbf('0x4b'),'value':_0x51c667[_0x5dbf('0x4b')]||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x0]?_0x51c667[_0x5dbf('0x40')][0x0][_0x5dbf('0x44')]:undefined)||'total'},{'name':_0x5dbf('0x4c'),'value':_0x51c667[_0x5dbf('0x4c')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x1]?_0x51c667['attrs'][0x1][_0x5dbf('0x44')]:undefined)||[]},{'name':'attrFontSize','value':_0x51c667[_0x5dbf('0x49')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x2]?_0x51c667[_0x5dbf('0x40')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x51c667[_0x5dbf('0x4d')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x3]?_0x51c667['attrs'][0x3][_0x5dbf('0x44')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x51c667['attrEmailAccounts']||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x4]?_0x51c667[_0x5dbf('0x40')][0x4]['value']:undefined)||''},{'name':_0x5dbf('0x4e'),'value':_0x51c667[_0x5dbf('0x4e')]||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x5]?_0x51c667[_0x5dbf('0x40')][0x5]['value']:undefined)||''},{'name':_0x5dbf('0x4f'),'value':_0x51c667['attrSmsAccounts']||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x6]?_0x51c667[_0x5dbf('0x40')][0x6][_0x5dbf('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x51c667['attrOpenchannelAccounts']||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x7]?_0x51c667[_0x5dbf('0x40')][0x7][_0x5dbf('0x44')]:undefined)||''},{'name':_0x5dbf('0x50'),'value':_0x51c667[_0x5dbf('0x50')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x8]?_0x51c667['attrs'][0x8][_0x5dbf('0x44')]:undefined)||''},{'name':_0x5dbf('0x51'),'value':_0x51c667[_0x5dbf('0x51')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x9]?_0x51c667[_0x5dbf('0x40')][0x9][_0x5dbf('0x44')]:undefined)||''}];case'multibar-chart':case _0x5dbf('0x52'):return[{'name':'attrSerie1','value':_0x51c667[_0x5dbf('0x53')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x0]?_0x51c667[_0x5dbf('0x40')][0x0][_0x5dbf('0x44')]:undefined)||_0x5dbf('0x54')},{'name':_0x5dbf('0x55'),'value':_0x51c667['attrSerie2']||(_0x51c667['attrs']&&_0x51c667['attrs'][0x1]?_0x51c667[_0x5dbf('0x40')][0x1][_0x5dbf('0x44')]:undefined)||null},{'name':_0x5dbf('0x56'),'value':_0x51c667['attrSerie3']||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x2]?_0x51c667[_0x5dbf('0x40')][0x2][_0x5dbf('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x51c667[_0x5dbf('0x4c')]||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x3]?_0x51c667[_0x5dbf('0x40')][0x3][_0x5dbf('0x44')]:undefined)||[]},{'name':'attrChannel','value':_0x51c667['attrChannel']||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x4]?_0x51c667[_0x5dbf('0x40')][0x4][_0x5dbf('0x44')]:undefined)||'voice'},{'name':_0x5dbf('0x57'),'value':_0x51c667[_0x5dbf('0x57')]||(_0x51c667['attrs']&&_0x51c667['attrs'][0x5]?_0x51c667[_0x5dbf('0x40')][0x5][_0x5dbf('0x44')]:undefined)||''},{'name':_0x5dbf('0x4e'),'value':_0x51c667[_0x5dbf('0x4e')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x6]?_0x51c667['attrs'][0x6][_0x5dbf('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x51c667['attrSmsAccounts']||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x7]?_0x51c667['attrs'][0x7][_0x5dbf('0x44')]:undefined)||''},{'name':_0x5dbf('0x58'),'value':_0x51c667[_0x5dbf('0x58')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x8]?_0x51c667[_0x5dbf('0x40')][0x8][_0x5dbf('0x44')]:undefined)||''},{'name':_0x5dbf('0x50'),'value':_0x51c667[_0x5dbf('0x50')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x9]?_0x51c667[_0x5dbf('0x40')][0x9][_0x5dbf('0x44')]:undefined)||''},{'name':_0x5dbf('0x51'),'value':_0x51c667[_0x5dbf('0x51')]||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0xa]?_0x51c667['attrs'][0xa][_0x5dbf('0x44')]:undefined)||''}];case _0x5dbf('0x59'):return[{'name':_0x5dbf('0x5a'),'type':_0x51c667[_0x5dbf('0x5b')]||(_0x51c667['attrs']&&_0x51c667[_0x5dbf('0x40')][0x0]?_0x51c667[_0x5dbf('0x40')][0x0][_0x5dbf('0x3d')]:undefined)||null,'value':_0x51c667[_0x5dbf('0x5a')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x0]?_0x51c667['attrs'][0x0][_0x5dbf('0x44')]:undefined)||null},{'name':_0x5dbf('0x5c'),'value':_0x51c667[_0x5dbf('0x5c')]||(_0x51c667[_0x5dbf('0x40')]&&_0x51c667[_0x5dbf('0x40')][0x1]?_0x51c667[_0x5dbf('0x40')][0x1][_0x5dbf('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x1cc4eb){logger[_0x5dbf('0x2a')](_0x5dbf('0x5d'),JSON[_0x5dbf('0x5e')](_0x1cc4eb));return[];}}exports[_0x5dbf('0x5f')]=function(_0x5d7a37,_0x52109d){if(_0x5d7a37[_0x5dbf('0x60')]){_0x5d7a37[_0x5dbf('0x60')][_0x5dbf('0x40')]=widgetAttributes(_0x5d7a37[_0x5dbf('0x60')]);}return db[_0x5dbf('0x3a')][_0x5dbf('0x5f')](_0x5d7a37[_0x5dbf('0x60')],{})[_0x5dbf('0x28')](respondWithResult(_0x52109d,0xc9))[_0x5dbf('0x3c')](handleError(_0x52109d,null));};exports['update']=function(_0x486397,_0x49005c){if(_0x486397['body']['id']){delete _0x486397[_0x5dbf('0x60')]['id'];}_0x486397[_0x5dbf('0x60')][_0x5dbf('0x40')]=widgetAttributes(_0x486397[_0x5dbf('0x60')]);return db[_0x5dbf('0x3a')][_0x5dbf('0x3b')]({'where':{'id':_0x486397['params']['id']}})['then'](handleEntityNotFound(_0x49005c,null))[_0x5dbf('0x28')](saveUpdates(_0x486397[_0x5dbf('0x60')],null))['then'](respondWithResult(_0x49005c,null))[_0x5dbf('0x3c')](handleError(_0x49005c,null));};
\ No newline at end of file
index 5bb7583..4baef86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7da=['remove','emit','hasOwnProperty','hook','DashboardItem','setMaxListeners','save','update'];(function(_0x47666c,_0x553129){var _0x2291c1=function(_0x2afb17){while(--_0x2afb17){_0x47666c['push'](_0x47666c['shift']());}};_0x2291c1(++_0x553129);}(_0xd7da,0xec));var _0xad7d=function(_0x12dc45,_0x388e68){_0x12dc45=_0x12dc45-0x0;var _0x3691e4=_0xd7da[_0x12dc45];return _0x3691e4;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xad7d('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xad7d('0x1')](0x0);var events={'afterCreate':_0xad7d('0x2'),'afterUpdate':_0xad7d('0x3'),'afterDestroy':_0xad7d('0x4')};function emitEvent(_0x476980){return function(_0x666191,_0x1b8179,_0x5936c4){DashboardItemEvents[_0xad7d('0x5')](_0x476980+':'+_0x666191['id'],_0x666191);DashboardItemEvents[_0xad7d('0x5')](_0x476980,_0x666191);_0x5936c4(null);};}for(var e in events){if(events[_0xad7d('0x6')](e)){var event=events[e];DashboardItem[_0xad7d('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0x1857=['update','remove','emit','hasOwnProperty','hook','events','DashboardItem','save'];(function(_0x165189,_0x19a741){var _0x44826b=function(_0x25bf5a){while(--_0x25bf5a){_0x165189['push'](_0x165189['shift']());}};_0x44826b(++_0x19a741);}(_0x1857,0x125));var _0x7185=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1857[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x7185('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x7185('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7185('0x2'),'afterUpdate':_0x7185('0x3'),'afterDestroy':_0x7185('0x4')};function emitEvent(_0x2519e8){return function(_0x3291d3,_0x598204,_0x59e4dd){DashboardItemEvents['emit'](_0x2519e8+':'+_0x3291d3['id'],_0x3291d3);DashboardItemEvents[_0x7185('0x5')](_0x2519e8,_0x3291d3);_0x59e4dd(null);};}for(var e in events){if(events[_0x7185('0x6')](e)){var event=events[e];DashboardItem[_0x7185('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 489948f..0b11272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe511=['DashboardItem','dashboard_items','lodash','util','api','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','define'];(function(_0x2f4748,_0x24af55){var _0x18eece=function(_0x489dd6){while(--_0x489dd6){_0x2f4748['push'](_0x2f4748['shift']());}};_0x18eece(++_0x24af55);}(_0xe511,0xc8));var _0x1e51=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0xe511[_0x462999];return _0x4b1366;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e51('0x4'));var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module['exports']=function(_0x3ea522,_0x231c83){return _0x3ea522[_0x1e51('0x8')](_0x1e51('0x9'),attributes,{'tableName':_0x1e51('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea4a=['DashboardItem','dashboard_items','lodash','util','../../config/logger','moment','bluebird','path','./dashboardItem.attributes','exports','define'];(function(_0x1bf88c,_0x2d0aa2){var _0x146517=function(_0x4d705){while(--_0x4d705){_0x1bf88c['push'](_0x1bf88c['shift']());}};_0x146517(++_0x2d0aa2);}(_0xea4a,0x10a));var _0xaea4=function(_0xa7abbf,_0x4715fa){_0xa7abbf=_0xa7abbf-0x0;var _0x34d6a8=_0xea4a[_0xa7abbf];return _0x34d6a8;};'use strict';var _=require(_0xaea4('0x0'));var util=require(_0xaea4('0x1'));var logger=require(_0xaea4('0x2'))('api');var moment=require(_0xaea4('0x3'));var BPromise=require(_0xaea4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaea4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaea4('0x6'));module[_0xaea4('0x7')]=function(_0x3e99fc,_0xa41b8b){return _0x3e99fc[_0xaea4('0x8')](_0xaea4('0x9'),attributes,{'tableName':_0xaea4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b910887..e0021dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37f4=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2a04de,_0x3f3540){var _0x893e6=function(_0x1122ff){while(--_0x1122ff){_0x2a04de['push'](_0x2a04de['shift']());}};_0x893e6(++_0x3f3540);}(_0x37f4,0x1aa));var _0x437f=function(_0x5214e,_0x33c945){_0x5214e=_0x5214e-0x0;var _0x512902=_0x37f4[_0x5214e];return _0x512902;};'use strict';var _=require(_0x437f('0x0'));var util=require(_0x437f('0x1'));var moment=require(_0x437f('0x2'));var BPromise=require(_0x437f('0x3'));var rs=require(_0x437f('0x4'));var fs=require('fs');var Redis=require(_0x437f('0x5'));var db=require(_0x437f('0x6'))['db'];var utils=require(_0x437f('0x7'));var logger=require(_0x437f('0x8'))(_0x437f('0x9'));var config=require(_0x437f('0xa'));var jayson=require(_0x437f('0xb'));var client=jayson['client'][_0x437f('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x437f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x437f('0xe'))(new Redis(config[_0x437f('0xd')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x212816,_0x58c55b,_0x2150f4){return new BPromise(function(_0x312d2c,_0x3c619b){return client['request'](_0x212816,_0x2150f4)[_0x437f('0xf')](function(_0x10ae4b){logger[_0x437f('0x10')](_0x437f('0x11'),_0x58c55b,'request\x20sent');logger[_0x437f('0x12')](_0x437f('0x13'),_0x58c55b,'request\x20sent',JSON[_0x437f('0x14')](_0x10ae4b));if(_0x10ae4b[_0x437f('0x15')]){if(_0x10ae4b[_0x437f('0x15')][_0x437f('0x16')]===0x1f4){logger[_0x437f('0x15')]('DashboardItem,\x20%s,\x20%s',_0x58c55b,_0x10ae4b['error'][_0x437f('0x17')]);return _0x3c619b(_0x10ae4b[_0x437f('0x15')][_0x437f('0x17')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x58c55b,_0x10ae4b[_0x437f('0x15')][_0x437f('0x17')]);return _0x312d2c(_0x10ae4b[_0x437f('0x15')][_0x437f('0x17')]);}else{logger[_0x437f('0x10')]('DashboardItem,\x20%s,\x20%s',_0x58c55b,'request\x20sent');_0x312d2c(_0x10ae4b[_0x437f('0x18')][_0x437f('0x17')]);}})['catch'](function(_0x6d687f){logger[_0x437f('0x15')](_0x437f('0x11'),_0x58c55b,_0x6d687f);_0x3c619b(_0x6d687f);});});}
\ No newline at end of file
+var _0x7480=['rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x953a55,_0x736d43){var _0x43fa9a=function(_0x400790){while(--_0x400790){_0x953a55['push'](_0x953a55['shift']());}};_0x43fa9a(++_0x736d43);}(_0x7480,0x1af));var _0x0748=function(_0x15aae4,_0x3b004d){_0x15aae4=_0x15aae4-0x0;var _0x357be3=_0x7480[_0x15aae4];return _0x357be3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0748('0x0'));var BPromise=require(_0x0748('0x1'));var rs=require(_0x0748('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0748('0x3'))['db'];var utils=require(_0x0748('0x4'));var logger=require(_0x0748('0x5'))(_0x0748('0x6'));var config=require('../../config/environment');var jayson=require(_0x0748('0x7'));var client=jayson[_0x0748('0x8')]['http']({'port':0x232a});config[_0x0748('0x9')]=_[_0x0748('0xa')](config[_0x0748('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0748('0xb'))(new Redis(config[_0x0748('0x9')]));require('./dashboardItem.socket')[_0x0748('0xc')](socket);function respondWithRpcPromise(_0x3714ce,_0x2b43a1,_0x17d50a){return new BPromise(function(_0x238eb5,_0x2c7015){return client['request'](_0x3714ce,_0x17d50a)['then'](function(_0x38964c){logger[_0x0748('0xd')](_0x0748('0xe'),_0x2b43a1,'request\x20sent');logger[_0x0748('0xf')](_0x0748('0x10'),_0x2b43a1,'request\x20sent',JSON['stringify'](_0x38964c));if(_0x38964c[_0x0748('0x11')]){if(_0x38964c['error'][_0x0748('0x12')]===0x1f4){logger[_0x0748('0x11')](_0x0748('0xe'),_0x2b43a1,_0x38964c[_0x0748('0x11')]['message']);return _0x2c7015(_0x38964c[_0x0748('0x11')][_0x0748('0x13')]);}logger['error'](_0x0748('0xe'),_0x2b43a1,_0x38964c['error']['message']);return _0x238eb5(_0x38964c[_0x0748('0x11')][_0x0748('0x13')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x2b43a1,_0x0748('0x14'));_0x238eb5(_0x38964c[_0x0748('0x15')][_0x0748('0x13')]);}})[_0x0748('0x16')](function(_0x112dbc){logger[_0x0748('0x11')](_0x0748('0xe'),_0x2b43a1,_0x112dbc);_0x2c7015(_0x112dbc);});});}
\ No newline at end of file
index 8723d7b..c73f94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5728=['update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x3cdb7,_0x5861a6){var _0x354dcb=function(_0x4e0ead){while(--_0x4e0ead){_0x3cdb7['push'](_0x3cdb7['shift']());}};_0x354dcb(++_0x5861a6);}(_0x5728,0xd5));var _0x8572=function(_0x179d7e,_0x416543){_0x179d7e=_0x179d7e-0x0;var _0x73ea32=_0x5728[_0x179d7e];return _0x73ea32;};'use strict';var DashboardItemEvents=require(_0x8572('0x0'));var events=[_0x8572('0x1'),_0x8572('0x2'),_0x8572('0x3')];function createListener(_0x4dcfae,_0x447878){return function(_0x20acfa){_0x447878[_0x8572('0x4')](_0x4dcfae,_0x20acfa);};}function removeListener(_0x1d3f2a,_0x1940d8){return function(){DashboardItemEvents[_0x8572('0x5')](_0x1d3f2a,_0x1940d8);};}exports[_0x8572('0x6')]=function(_0x3ff12e){for(var _0x2feca7=0x0,_0x307fc1=events[_0x8572('0x7')];_0x2feca7<_0x307fc1;_0x2feca7++){var _0x290b92=events[_0x2feca7];var _0x37b48b=createListener(_0x8572('0x8')+_0x290b92,_0x3ff12e);DashboardItemEvents['on'](_0x290b92,_0x37b48b);}};
\ No newline at end of file
+var _0x0fad=['remove','update','emit','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x1d0032,_0x391ee5){var _0x383110=function(_0xf84e23){while(--_0xf84e23){_0x1d0032['push'](_0x1d0032['shift']());}};_0x383110(++_0x391ee5);}(_0x0fad,0x136));var _0xd0fa=function(_0x18b477,_0x555d04){_0x18b477=_0x18b477-0x0;var _0x240b92=_0x0fad[_0x18b477];return _0x240b92;};'use strict';var DashboardItemEvents=require(_0xd0fa('0x0'));var events=[_0xd0fa('0x1'),_0xd0fa('0x2'),_0xd0fa('0x3')];function createListener(_0x56afb0,_0x13a05b){return function(_0x4027c3){_0x13a05b[_0xd0fa('0x4')](_0x56afb0,_0x4027c3);};}function removeListener(_0x427447,_0x1ab8e5){return function(){DashboardItemEvents['removeListener'](_0x427447,_0x1ab8e5);};}exports[_0xd0fa('0x5')]=function(_0x42499d){for(var _0x517088=0x0,_0xd8e9c2=events[_0xd0fa('0x6')];_0x517088<_0xd8e9c2;_0x517088++){var _0x32b9f8=events[_0x517088];var _0x270db1=createListener(_0xd0fa('0x7')+_0x32b9f8,_0x42499d);DashboardItemEvents['on'](_0x32b9f8,_0x270db1);}};
\ No newline at end of file
index 31d8805..2163c0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0f=['put','update','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','create'];(function(_0x44a998,_0x2e1f91){var _0x1a8c53=function(_0x1cb567){while(--_0x1cb567){_0x44a998['push'](_0x44a998['shift']());}};_0x1a8c53(++_0x2e1f91);}(_0x0b0f,0x1d5));var _0xf0b0=function(_0x3302e6,_0x55a1e8){_0x3302e6=_0x3302e6-0x0;var _0x5a7bca=_0x0b0f[_0x3302e6];return _0x5a7bca;};'use strict';var multer=require(_0xf0b0('0x0'));var util=require('util');var path=require(_0xf0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0b0('0x2'));var router=express['Router']();var fs_extra=require(_0xf0b0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0b0('0x4'));var config=require(_0xf0b0('0x5'));var controller=require('./dashboardItem.controller');router[_0xf0b0('0x6')](_0xf0b0('0x7'),auth[_0xf0b0('0x8')](),controller[_0xf0b0('0x9')]);router['post']('/',auth[_0xf0b0('0x8')](),controller[_0xf0b0('0xa')]);router[_0xf0b0('0xb')](_0xf0b0('0x7'),auth[_0xf0b0('0x8')](),controller[_0xf0b0('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf0b0('0xd')]);module[_0xf0b0('0xe')]=router;
\ No newline at end of file
+var _0x4f1c=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','put'];(function(_0x2b7e53,_0x4d93e4){var _0x2a9acd=function(_0x2e3259){while(--_0x2e3259){_0x2b7e53['push'](_0x2b7e53['shift']());}};_0x2a9acd(++_0x4d93e4);}(_0x4f1c,0x135));var _0xc4f1=function(_0x21067b,_0x1738c4){_0x21067b=_0x21067b-0x0;var _0x8d53c6=_0x4f1c[_0x21067b];return _0x8d53c6;};'use strict';var multer=require('multer');var util=require(_0xc4f1('0x0'));var path=require(_0xc4f1('0x1'));var timeout=require(_0xc4f1('0x2'));var express=require(_0xc4f1('0x3'));var router=express[_0xc4f1('0x4')]();var fs_extra=require(_0xc4f1('0x5'));var auth=require(_0xc4f1('0x6'));var interaction=require(_0xc4f1('0x7'));var config=require(_0xc4f1('0x8'));var controller=require(_0xc4f1('0x9'));router['get'](_0xc4f1('0xa'),auth[_0xc4f1('0xb')](),controller[_0xc4f1('0xc')]);router[_0xc4f1('0xd')]('/',auth[_0xc4f1('0xb')](),controller['create']);router[_0xc4f1('0xe')](_0xc4f1('0xa'),auth[_0xc4f1('0xb')](),controller[_0xc4f1('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc4f1('0x10')]);module[_0xc4f1('0x11')]=router;
\ No newline at end of file
index bf54ca3..049e74c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x793a=['exports','second','first','sequelize'];(function(_0x219ecd,_0x4731aa){var _0x536a86=function(_0x4a6978){while(--_0x4a6978){_0x219ecd['push'](_0x219ecd['shift']());}};_0x536a86(++_0x4731aa);}(_0x793a,0x1a7));var _0xa793=function(_0x450f83,_0x5247b1){_0x450f83=_0x450f83-0x0;var _0x14317a=_0x793a[_0x450f83];return _0x14317a;};'use strict';var Sequelize=require(_0xa793('0x0'));module[_0xa793('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0xa793('0x2'),'third'),'allowNull':![],'defaultValue':_0xa793('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc2c7=['third','exports','STRING','ENUM','first','second'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0xc2c7,0x1bd));var _0x7c2c=function(_0x2ffaf9,_0xf77c48){_0x2ffaf9=_0x2ffaf9-0x0;var _0x309065=_0xc2c7[_0x2ffaf9];return _0x309065;};'use strict';var Sequelize=require('sequelize');module[_0x7c2c('0x0')]={'name':{'type':Sequelize[_0x7c2c('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x7c2c('0x2')](_0x7c2c('0x3'),_0x7c2c('0x4'),_0x7c2c('0x5')),'allowNull':![],'defaultValue':_0x7c2c('0x3')},'description':{'type':Sequelize[_0x7c2c('0x1')]}};
\ No newline at end of file
index 3135743..7102de8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x805b=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','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','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','Dispositions','UserProfileResource','then','error','stack','name','index','Disposition','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','user'];(function(_0xb6ef46,_0x44e005){var _0x45653a=function(_0x3e5150){while(--_0x3e5150){_0xb6ef46['push'](_0xb6ef46['shift']());}};_0x45653a(++_0x44e005);}(_0x805b,0xad));var _0xb805=function(_0x3c8587,_0x1776bf){_0x3c8587=_0x3c8587-0x0;var _0x5da887=_0x805b[_0x3c8587];return _0x5da887;};'use strict';var emlformat=require(_0xb805('0x0'));var rimraf=require(_0xb805('0x1'));var zipdir=require(_0xb805('0x2'));var jsonpatch=require(_0xb805('0x3'));var rp=require(_0xb805('0x4'));var moment=require(_0xb805('0x5'));var BPromise=require(_0xb805('0x6'));var Mustache=require(_0xb805('0x7'));var util=require(_0xb805('0x8'));var path=require(_0xb805('0x9'));var sox=require('sox');var csv=require(_0xb805('0xa'));var ejs=require(_0xb805('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb805('0xc'));var squel=require(_0xb805('0xd'));var crypto=require('crypto');var jsforce=require(_0xb805('0xe'));var deskjs=require(_0xb805('0xf'));var toCsv=require(_0xb805('0xa'));var querystring=require(_0xb805('0x10'));var Papa=require(_0xb805('0x11'));var Redis=require(_0xb805('0x12'));var authService=require(_0xb805('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb805('0x14'))('api');var utils=require(_0xb805('0x15'));var config=require(_0xb805('0x16'));var licenseUtil=require(_0xb805('0x17'));var db=require(_0xb805('0x18'))['db'];function respondWithStatusCode(_0x3ce023,_0x35144a){_0x35144a=_0x35144a||0xcc;return function(_0x12ed1e){if(_0x12ed1e){return _0x3ce023[_0xb805('0x19')](_0x35144a);}return _0x3ce023[_0xb805('0x1a')](_0x35144a)[_0xb805('0x1b')]();};}function respondWithResult(_0x44b55d,_0x395c36){_0x395c36=_0x395c36||0xc8;return function(_0x2fc804){if(_0x2fc804){return _0x44b55d[_0xb805('0x1a')](_0x395c36)[_0xb805('0x1c')](_0x2fc804);}};}function respondWithFilteredResult(_0x5a81f,_0x356ed7){return function(_0x1058be){if(_0x1058be){var _0x55407a=typeof _0x356ed7[_0xb805('0x1d')]===_0xb805('0x1e')&&typeof _0x356ed7[_0xb805('0x1f')]===_0xb805('0x1e');var _0x4f0b76=_0x1058be[_0xb805('0x20')];var _0x301985=_0x55407a?0x0:_0x356ed7[_0xb805('0x1d')];var _0x46dce4=_0x55407a?_0x1058be[_0xb805('0x20')]:_0x356ed7[_0xb805('0x1d')]+_0x356ed7[_0xb805('0x1f')];var _0x2ec73d;if(_0x46dce4>=_0x4f0b76){_0x46dce4=_0x4f0b76;_0x2ec73d=0xc8;}else{_0x2ec73d=0xce;}_0x5a81f[_0xb805('0x1a')](_0x2ec73d);return _0x5a81f[_0xb805('0x21')](_0xb805('0x22'),_0x301985+'-'+_0x46dce4+'/'+_0x4f0b76)['json'](_0x1058be);}return null;};}function patchUpdates(_0x44f5ad){return function(_0x4475a3){try{jsonpatch[_0xb805('0x23')](_0x4475a3,_0x44f5ad,!![]);}catch(_0x45ac5d){return BPromise[_0xb805('0x24')](_0x45ac5d);}return _0x4475a3['save']();};}function saveUpdates(_0x4b95fa,_0x59834f){return function(_0x1c235a){if(_0x1c235a){return _0x1c235a[_0xb805('0x25')](_0x4b95fa)['then'](function(_0x829d84){return _0x829d84;});}return null;};}function removeEntity(_0x105e43,_0x410aae){return function(_0x585b50){if(_0x585b50){return _0x585b50[_0xb805('0x26')]()['then'](function(){var _0x5d0ba1=_0x585b50[_0xb805('0x27')]({'plain':!![]});var _0x32a630=_0xb805('0x28');return db[_0xb805('0x29')][_0xb805('0x26')]({'where':{'type':_0x32a630,'resourceId':_0x5d0ba1['id']}})['then'](function(){return _0x585b50;});})[_0xb805('0x2a')](function(){_0x105e43['status'](0xcc)[_0xb805('0x1b')]();});}};}function handleEntityNotFound(_0x3d4c46,_0x376455){return function(_0x510e89){if(!_0x510e89){_0x3d4c46[_0xb805('0x19')](0x194);}return _0x510e89;};}function handleError(_0x1e7854,_0xdb5e9f){_0xdb5e9f=_0xdb5e9f||0x1f4;return function(_0x245396){logger[_0xb805('0x2b')](_0x245396[_0xb805('0x2c')]);if(_0x245396['name']){delete _0x245396[_0xb805('0x2d')];}_0x1e7854['status'](_0xdb5e9f)['send'](_0x245396);};}exports[_0xb805('0x2e')]=function(_0x2b21f8,_0x3e9273){var _0x27612c={},_0x27204f={},_0xe90973={'count':0x0,'rows':[]};var _0x708476=_['map'](db[_0xb805('0x2f')]['rawAttributes'],function(_0x2fc79a){return{'name':_0x2fc79a[_0xb805('0x30')],'type':_0x2fc79a['type'][_0xb805('0x31')]};});_0x27204f[_0xb805('0x32')]=_[_0xb805('0x33')](_0x708476,_0xb805('0x2d'));_0x27204f[_0xb805('0x34')]=_[_0xb805('0x35')](_0x2b21f8['query']);_0x27204f['filters']=_[_0xb805('0x36')](_0x27204f[_0xb805('0x32')],_0x27204f[_0xb805('0x34')]);_0x27612c[_0xb805('0x37')]=_[_0xb805('0x36')](_0x27204f[_0xb805('0x32')],qs[_0xb805('0x38')](_0x2b21f8[_0xb805('0x34')][_0xb805('0x38')]));_0x27612c[_0xb805('0x37')]=_0x27612c[_0xb805('0x37')][_0xb805('0x39')]?_0x27612c['attributes']:_0x27204f['model'];if(!_0x2b21f8['query']['hasOwnProperty'](_0xb805('0x3a'))){_0x27612c[_0xb805('0x1f')]=qs['limit'](_0x2b21f8['query']['limit']);_0x27612c[_0xb805('0x1d')]=qs[_0xb805('0x1d')](_0x2b21f8['query'][_0xb805('0x1d')]);}_0x27612c[_0xb805('0x3b')]=qs[_0xb805('0x3c')](_0x2b21f8[_0xb805('0x34')][_0xb805('0x3c')]);_0x27612c[_0xb805('0x3d')]=qs[_0xb805('0x3e')](_[_0xb805('0x3f')](_0x2b21f8['query'],_0x27204f[_0xb805('0x3e')]),_0x708476);if(_0x2b21f8[_0xb805('0x34')]['filter']){_0x27612c['where']=_[_0xb805('0x40')](_0x27612c[_0xb805('0x3d')],{'$or':_[_0xb805('0x33')](_0x708476,function(_0x5da89d){if(_0x5da89d[_0xb805('0x41')]!=='VIRTUAL'){var _0x523ee7={};_0x523ee7[_0x5da89d[_0xb805('0x2d')]]={'$like':'%'+_0x2b21f8[_0xb805('0x34')][_0xb805('0x42')]+'%'};return _0x523ee7;}})});}_0x27612c=_[_0xb805('0x40')]({},_0x27612c,_0x2b21f8[_0xb805('0x43')]);var _0x5c3762={'where':_0x27612c['where']};return db[_0xb805('0x2f')][_0xb805('0x20')](_0x5c3762)[_0xb805('0x2a')](function(_0xc91aba){_0xe90973[_0xb805('0x20')]=_0xc91aba;if(_0x2b21f8[_0xb805('0x34')][_0xb805('0x44')]){_0x27612c['include']=[{'all':!![]}];}return db['Disposition'][_0xb805('0x45')](_0x27612c);})[_0xb805('0x2a')](function(_0x3b82da){_0xe90973['rows']=_0x3b82da;return _0xe90973;})[_0xb805('0x2a')](respondWithFilteredResult(_0x3e9273,_0x27612c))[_0xb805('0x46')](handleError(_0x3e9273,null));};exports[_0xb805('0x47')]=function(_0xb0482e,_0x26624f){var _0x596170={'raw':!![],'where':{'id':_0xb0482e[_0xb805('0x48')]['id']}},_0x1894da={};_0x1894da[_0xb805('0x32')]=_['keys'](db['Disposition'][_0xb805('0x49')]);_0x1894da[_0xb805('0x34')]=_[_0xb805('0x35')](_0xb0482e['query']);_0x1894da[_0xb805('0x3e')]=_[_0xb805('0x36')](_0x1894da[_0xb805('0x32')],_0x1894da[_0xb805('0x34')]);_0x596170[_0xb805('0x37')]=_[_0xb805('0x36')](_0x1894da[_0xb805('0x32')],qs[_0xb805('0x38')](_0xb0482e[_0xb805('0x34')][_0xb805('0x38')]));_0x596170['attributes']=_0x596170[_0xb805('0x37')]['length']?_0x596170[_0xb805('0x37')]:_0x1894da[_0xb805('0x32')];if(_0xb0482e['query'][_0xb805('0x44')]){_0x596170[_0xb805('0x4a')]=[{'all':!![]}];}_0x596170=_[_0xb805('0x40')]({},_0x596170,_0xb0482e[_0xb805('0x43')]);return db['Disposition'][_0xb805('0x4b')](_0x596170)[_0xb805('0x2a')](handleEntityNotFound(_0x26624f,null))[_0xb805('0x2a')](respondWithResult(_0x26624f,null))[_0xb805('0x46')](handleError(_0x26624f,null));};exports[_0xb805('0x4c')]=function(_0x2df393,_0x2dc403){return db[_0xb805('0x2f')][_0xb805('0x4c')](_0x2df393[_0xb805('0x4d')],{})[_0xb805('0x2a')](function(_0x12eb97){var _0x5e12d5=_0x2df393[_0xb805('0x4e')][_0xb805('0x27')]({'plain':!![]});if(!_0x5e12d5)throw new Error(_0xb805('0x4f'));if(_0x5e12d5[_0xb805('0x50')]===_0xb805('0x4e')){var _0x233d84=_0x12eb97[_0xb805('0x27')]({'plain':!![]});var _0x1aa5c9=_0xb805('0x28');return db[_0xb805('0x51')][_0xb805('0x4b')]({'where':{'name':_0x1aa5c9,'userProfileId':_0x5e12d5['userProfileId']},'raw':!![]})[_0xb805('0x2a')](function(_0x321d3c){if(_0x321d3c&&_0x321d3c[_0xb805('0x52')]===0x0){return db[_0xb805('0x29')]['create']({'name':_0x233d84[_0xb805('0x2d')],'resourceId':_0x233d84['id'],'type':_0x321d3c['name'],'sectionId':_0x321d3c['id']},{})[_0xb805('0x2a')](function(){return _0x12eb97;});}else{return _0x12eb97;}})[_0xb805('0x46')](function(_0x3c70b2){logger['error'](_0xb805('0x53'),_0x3c70b2);throw _0x3c70b2;});}return _0x12eb97;})[_0xb805('0x2a')](respondWithResult(_0x2dc403,0xc9))[_0xb805('0x46')](handleError(_0x2dc403,null));};exports[_0xb805('0x25')]=function(_0x4cc65c,_0x46d266){if(_0x4cc65c[_0xb805('0x4d')]['id']){delete _0x4cc65c[_0xb805('0x4d')]['id'];}return db[_0xb805('0x2f')][_0xb805('0x4b')]({'where':{'id':_0x4cc65c[_0xb805('0x48')]['id']}})['then'](handleEntityNotFound(_0x46d266,null))[_0xb805('0x2a')](saveUpdates(_0x4cc65c[_0xb805('0x4d')],null))[_0xb805('0x2a')](respondWithResult(_0x46d266,null))[_0xb805('0x46')](handleError(_0x46d266,null));};exports[_0xb805('0x26')]=function(_0x24b840,_0x348d2c){return db['Disposition'][_0xb805('0x4b')]({'where':{'id':_0x24b840['params']['id']}})['then'](handleEntityNotFound(_0x348d2c,null))[_0xb805('0x2a')](removeEntity(_0x348d2c,null))[_0xb805('0x46')](handleError(_0x348d2c,null));};
\ No newline at end of file
+var _0xafb5=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','autoAssociation','update','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x5b75a6,_0x36d1b7){var _0x2db1ac=function(_0x53300a){while(--_0x53300a){_0x5b75a6['push'](_0x5b75a6['shift']());}};_0x2db1ac(++_0x36d1b7);}(_0xafb5,0xa0));var _0x5afb=function(_0x1214b0,_0x5a5785){_0x1214b0=_0x1214b0-0x0;var _0x5d9389=_0xafb5[_0x1214b0];return _0x5d9389;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5afb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5afb('0x1'));var rp=require(_0x5afb('0x2'));var moment=require(_0x5afb('0x3'));var BPromise=require(_0x5afb('0x4'));var Mustache=require(_0x5afb('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5afb('0x6'));var csv=require(_0x5afb('0x7'));var ejs=require(_0x5afb('0x8'));var fs=require('fs');var fs_extra=require(_0x5afb('0x9'));var _=require(_0x5afb('0xa'));var squel=require(_0x5afb('0xb'));var crypto=require(_0x5afb('0xc'));var jsforce=require(_0x5afb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5afb('0xe'));var Papa=require(_0x5afb('0xf'));var Redis=require(_0x5afb('0x10'));var authService=require(_0x5afb('0x11'));var qs=require(_0x5afb('0x12'));var as=require(_0x5afb('0x13'));var hardwareService=require(_0x5afb('0x14'));var logger=require('../../config/logger')(_0x5afb('0x15'));var utils=require(_0x5afb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5afb('0x17'));var db=require(_0x5afb('0x18'))['db'];function respondWithStatusCode(_0xe8ecc3,_0x3dbc0b){_0x3dbc0b=_0x3dbc0b||0xcc;return function(_0x42a9db){if(_0x42a9db){return _0xe8ecc3[_0x5afb('0x19')](_0x3dbc0b);}return _0xe8ecc3[_0x5afb('0x1a')](_0x3dbc0b)['end']();};}function respondWithResult(_0x32f3ee,_0x24eecb){_0x24eecb=_0x24eecb||0xc8;return function(_0x3ca7ce){if(_0x3ca7ce){return _0x32f3ee[_0x5afb('0x1a')](_0x24eecb)[_0x5afb('0x1b')](_0x3ca7ce);}};}function respondWithFilteredResult(_0x291ecd,_0x464f2e){return function(_0x472329){if(_0x472329){var _0x5c9459=typeof _0x464f2e[_0x5afb('0x1c')]===_0x5afb('0x1d')&&typeof _0x464f2e[_0x5afb('0x1e')]==='undefined';var _0x417b8b=_0x472329['count'];var _0x71109f=_0x5c9459?0x0:_0x464f2e[_0x5afb('0x1c')];var _0x3399e8=_0x5c9459?_0x472329[_0x5afb('0x1f')]:_0x464f2e[_0x5afb('0x1c')]+_0x464f2e[_0x5afb('0x1e')];var _0x128624;if(_0x3399e8>=_0x417b8b){_0x3399e8=_0x417b8b;_0x128624=0xc8;}else{_0x128624=0xce;}_0x291ecd[_0x5afb('0x1a')](_0x128624);return _0x291ecd[_0x5afb('0x20')](_0x5afb('0x21'),_0x71109f+'-'+_0x3399e8+'/'+_0x417b8b)['json'](_0x472329);}return null;};}function patchUpdates(_0x61314b){return function(_0x4260f6){try{jsonpatch[_0x5afb('0x22')](_0x4260f6,_0x61314b,!![]);}catch(_0x46261d){return BPromise[_0x5afb('0x23')](_0x46261d);}return _0x4260f6[_0x5afb('0x24')]();};}function saveUpdates(_0x4578e6,_0x32131c){return function(_0x2906d5){if(_0x2906d5){return _0x2906d5['update'](_0x4578e6)[_0x5afb('0x25')](function(_0x4ceee7){return _0x4ceee7;});}return null;};}function removeEntity(_0x222af7,_0x105a64){return function(_0x27665c){if(_0x27665c){return _0x27665c[_0x5afb('0x26')]()['then'](function(){var _0x15dc11=_0x27665c[_0x5afb('0x27')]({'plain':!![]});var _0x44ebf0='Dispositions';return db[_0x5afb('0x28')][_0x5afb('0x26')]({'where':{'type':_0x44ebf0,'resourceId':_0x15dc11['id']}})[_0x5afb('0x25')](function(){return _0x27665c;});})[_0x5afb('0x25')](function(){_0x222af7[_0x5afb('0x1a')](0xcc)[_0x5afb('0x29')]();});}};}function handleEntityNotFound(_0x449fd5,_0x3f7fbe){return function(_0x216e7e){if(!_0x216e7e){_0x449fd5[_0x5afb('0x19')](0x194);}return _0x216e7e;};}function handleError(_0x5550af,_0x2af8d3){_0x2af8d3=_0x2af8d3||0x1f4;return function(_0x127361){logger[_0x5afb('0x2a')](_0x127361[_0x5afb('0x2b')]);if(_0x127361[_0x5afb('0x2c')]){delete _0x127361['name'];}_0x5550af[_0x5afb('0x1a')](_0x2af8d3)[_0x5afb('0x2d')](_0x127361);};}exports[_0x5afb('0x2e')]=function(_0x25c5cf,_0x4fc175){var _0x10b13a={},_0x17b211={},_0x4cfb6b={'count':0x0,'rows':[]};var _0x71984e=_[_0x5afb('0x2f')](db[_0x5afb('0x30')][_0x5afb('0x31')],function(_0x5468f0){return{'name':_0x5468f0['fieldName'],'type':_0x5468f0[_0x5afb('0x32')][_0x5afb('0x33')]};});_0x17b211[_0x5afb('0x34')]=_[_0x5afb('0x2f')](_0x71984e,_0x5afb('0x2c'));_0x17b211[_0x5afb('0x35')]=_[_0x5afb('0x36')](_0x25c5cf[_0x5afb('0x35')]);_0x17b211[_0x5afb('0x37')]=_[_0x5afb('0x38')](_0x17b211[_0x5afb('0x34')],_0x17b211[_0x5afb('0x35')]);_0x10b13a[_0x5afb('0x39')]=_[_0x5afb('0x38')](_0x17b211['model'],qs[_0x5afb('0x3a')](_0x25c5cf[_0x5afb('0x35')]['fields']));_0x10b13a[_0x5afb('0x39')]=_0x10b13a['attributes']['length']?_0x10b13a['attributes']:_0x17b211['model'];if(!_0x25c5cf[_0x5afb('0x35')][_0x5afb('0x3b')](_0x5afb('0x3c'))){_0x10b13a[_0x5afb('0x1e')]=qs[_0x5afb('0x1e')](_0x25c5cf[_0x5afb('0x35')][_0x5afb('0x1e')]);_0x10b13a[_0x5afb('0x1c')]=qs[_0x5afb('0x1c')](_0x25c5cf[_0x5afb('0x35')]['offset']);}_0x10b13a[_0x5afb('0x3d')]=qs[_0x5afb('0x3e')](_0x25c5cf[_0x5afb('0x35')][_0x5afb('0x3e')]);_0x10b13a[_0x5afb('0x3f')]=qs[_0x5afb('0x37')](_[_0x5afb('0x40')](_0x25c5cf[_0x5afb('0x35')],_0x17b211[_0x5afb('0x37')]),_0x71984e);if(_0x25c5cf[_0x5afb('0x35')][_0x5afb('0x41')]){_0x10b13a[_0x5afb('0x3f')]=_[_0x5afb('0x42')](_0x10b13a[_0x5afb('0x3f')],{'$or':_['map'](_0x71984e,function(_0x237471){if(_0x237471[_0x5afb('0x32')]!==_0x5afb('0x43')){var _0x174332={};_0x174332[_0x237471['name']]={'$like':'%'+_0x25c5cf['query'][_0x5afb('0x41')]+'%'};return _0x174332;}})});}_0x10b13a=_[_0x5afb('0x42')]({},_0x10b13a,_0x25c5cf[_0x5afb('0x44')]);var _0x149cc0={'where':_0x10b13a['where']};return db[_0x5afb('0x30')][_0x5afb('0x1f')](_0x149cc0)[_0x5afb('0x25')](function(_0x2e2843){_0x4cfb6b[_0x5afb('0x1f')]=_0x2e2843;if(_0x25c5cf[_0x5afb('0x35')]['includeAll']){_0x10b13a[_0x5afb('0x45')]=[{'all':!![]}];}return db[_0x5afb('0x30')]['findAll'](_0x10b13a);})[_0x5afb('0x25')](function(_0x35c038){_0x4cfb6b[_0x5afb('0x46')]=_0x35c038;return _0x4cfb6b;})[_0x5afb('0x25')](respondWithFilteredResult(_0x4fc175,_0x10b13a))[_0x5afb('0x47')](handleError(_0x4fc175,null));};exports[_0x5afb('0x48')]=function(_0x3c4885,_0x5f02f8){var _0x3734a3={'raw':!![],'where':{'id':_0x3c4885[_0x5afb('0x49')]['id']}},_0x2c4487={};_0x2c4487[_0x5afb('0x34')]=_['keys'](db[_0x5afb('0x30')][_0x5afb('0x31')]);_0x2c4487[_0x5afb('0x35')]=_[_0x5afb('0x36')](_0x3c4885[_0x5afb('0x35')]);_0x2c4487[_0x5afb('0x37')]=_[_0x5afb('0x38')](_0x2c4487[_0x5afb('0x34')],_0x2c4487[_0x5afb('0x35')]);_0x3734a3[_0x5afb('0x39')]=_[_0x5afb('0x38')](_0x2c4487[_0x5afb('0x34')],qs['fields'](_0x3c4885[_0x5afb('0x35')][_0x5afb('0x3a')]));_0x3734a3[_0x5afb('0x39')]=_0x3734a3[_0x5afb('0x39')]['length']?_0x3734a3[_0x5afb('0x39')]:_0x2c4487[_0x5afb('0x34')];if(_0x3c4885[_0x5afb('0x35')][_0x5afb('0x4a')]){_0x3734a3[_0x5afb('0x45')]=[{'all':!![]}];}_0x3734a3=_[_0x5afb('0x42')]({},_0x3734a3,_0x3c4885['options']);return db[_0x5afb('0x30')][_0x5afb('0x4b')](_0x3734a3)[_0x5afb('0x25')](handleEntityNotFound(_0x5f02f8,null))[_0x5afb('0x25')](respondWithResult(_0x5f02f8,null))[_0x5afb('0x47')](handleError(_0x5f02f8,null));};exports['create']=function(_0x27541e,_0x28637b){return db[_0x5afb('0x30')][_0x5afb('0x4c')](_0x27541e['body'],{})[_0x5afb('0x25')](function(_0x1a3329){var _0x3dba74=_0x27541e[_0x5afb('0x4d')][_0x5afb('0x27')]({'plain':!![]});if(!_0x3dba74)throw new Error(_0x5afb('0x4e'));if(_0x3dba74[_0x5afb('0x4f')]===_0x5afb('0x4d')){var _0x5058de=_0x1a3329[_0x5afb('0x27')]({'plain':!![]});var _0xda776e=_0x5afb('0x50');return db[_0x5afb('0x51')][_0x5afb('0x4b')]({'where':{'name':_0xda776e,'userProfileId':_0x3dba74['userProfileId']},'raw':!![]})[_0x5afb('0x25')](function(_0x5df100){if(_0x5df100&&_0x5df100[_0x5afb('0x52')]===0x0){return db[_0x5afb('0x28')][_0x5afb('0x4c')]({'name':_0x5058de[_0x5afb('0x2c')],'resourceId':_0x5058de['id'],'type':_0x5df100['name'],'sectionId':_0x5df100['id']},{})[_0x5afb('0x25')](function(){return _0x1a3329;});}else{return _0x1a3329;}})[_0x5afb('0x47')](function(_0x44c848){logger[_0x5afb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44c848);throw _0x44c848;});}return _0x1a3329;})[_0x5afb('0x25')](respondWithResult(_0x28637b,0xc9))['catch'](handleError(_0x28637b,null));};exports[_0x5afb('0x53')]=function(_0x339a3d,_0x54604f){if(_0x339a3d[_0x5afb('0x54')]['id']){delete _0x339a3d[_0x5afb('0x54')]['id'];}return db[_0x5afb('0x30')]['find']({'where':{'id':_0x339a3d[_0x5afb('0x49')]['id']}})[_0x5afb('0x25')](handleEntityNotFound(_0x54604f,null))[_0x5afb('0x25')](saveUpdates(_0x339a3d['body'],null))[_0x5afb('0x25')](respondWithResult(_0x54604f,null))['catch'](handleError(_0x54604f,null));};exports[_0x5afb('0x26')]=function(_0x515865,_0x457883){return db[_0x5afb('0x30')]['find']({'where':{'id':_0x515865[_0x5afb('0x49')]['id']}})[_0x5afb('0x25')](handleEntityNotFound(_0x457883,null))[_0x5afb('0x25')](removeEntity(_0x457883,null))[_0x5afb('0x47')](handleError(_0x457883,null));};
\ No newline at end of file
index e37d72e..a6d008f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca93=['WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','ListId','name','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0xdeff21,_0x2ccfe7){var _0x4fccac=function(_0x3013e5){while(--_0x3013e5){_0xdeff21['push'](_0xdeff21['shift']());}};_0x4fccac(++_0x2ccfe7);}(_0xca93,0x139));var _0x3ca9=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xca93[_0x1c546c];return _0x2cc384;};'use strict';var _=require('lodash');var util=require(_0x3ca9('0x0'));var logger=require(_0x3ca9('0x1'))(_0x3ca9('0x2'));var moment=require(_0x3ca9('0x3'));var BPromise=require(_0x3ca9('0x4'));var rp=require(_0x3ca9('0x5'));var fs=require('fs');var path=require(_0x3ca9('0x6'));var rimraf=require('rimraf');var config=require(_0x3ca9('0x7'));var attributes=require(_0x3ca9('0x8'));module[_0x3ca9('0x9')]=function(_0x3e3a50,_0x4d80cf){return _0x3e3a50['define'](_0x3ca9('0xa'),attributes,{'tableName':_0x3ca9('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x3ca9('0xc'),'fields':['name',_0x3ca9('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0x3ca9('0xe'),_0x3ca9('0xf')]},{'unique':!![],'name':_0x3ca9('0x10'),'fields':[_0x3ca9('0xe'),_0x3ca9('0x11')]},{'unique':!![],'name':'name_sms','fields':['name',_0x3ca9('0x12')]},{'unique':!![],'name':_0x3ca9('0x13'),'fields':[_0x3ca9('0xe'),_0x3ca9('0x14')]},{'unique':!![],'name':_0x3ca9('0x15'),'fields':[_0x3ca9('0xe'),_0x3ca9('0x16')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x3ca9('0xe'),_0x3ca9('0x17')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1175=['tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','api','bluebird','path','../../config/environment','./disposition.attributes','define','Disposition'];(function(_0x27c2e4,_0x4daf61){var _0x13f2fa=function(_0x53bf2c){while(--_0x53bf2c){_0x27c2e4['push'](_0x27c2e4['shift']());}};_0x13f2fa(++_0x4daf61);}(_0x1175,0x1af));var _0x5117=function(_0x1b81e4,_0x35d5b2){_0x1b81e4=_0x1b81e4-0x0;var _0x5a7eb1=_0x1175[_0x1b81e4];return _0x5a7eb1;};'use strict';var _=require(_0x5117('0x0'));var util=require('util');var logger=require(_0x5117('0x1'))(_0x5117('0x2'));var moment=require('moment');var BPromise=require(_0x5117('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5117('0x4'));var rimraf=require('rimraf');var config=require(_0x5117('0x5'));var attributes=require(_0x5117('0x6'));module['exports']=function(_0x41ce5d,_0x3ba8e8){return _0x41ce5d[_0x5117('0x7')](_0x5117('0x8'),attributes,{'tableName':_0x5117('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5117('0xa'),'fields':[_0x5117('0xb'),_0x5117('0xc')]},{'unique':!![],'name':_0x5117('0xd'),'fields':[_0x5117('0xb'),_0x5117('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0x5117('0xb'),_0x5117('0xf')]},{'unique':!![],'name':_0x5117('0x10'),'fields':[_0x5117('0xb'),_0x5117('0x11')]},{'unique':!![],'name':_0x5117('0x12'),'fields':[_0x5117('0xb'),'FaxAccountId']},{'unique':!![],'name':_0x5117('0x13'),'fields':['name',_0x5117('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x5117('0x15')]}],'timestamps':!![]});};
\ No newline at end of file
index f7d3d39..80c84f6 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(_0x4d5771,_0x3e9961){var _0x444447=function(_0x2b1e52){while(--_0x2b1e52){_0x4d5771['push'](_0x4d5771['shift']());}};_0x444447(++_0x3e9961);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x6be94c,_0x7537d6){var _0xcdc03f=function(_0x569a47){while(--_0x569a47){_0x6be94c['push'](_0x6be94c['shift']());}};_0xcdc03f(++_0x7537d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 cc18f26..4683352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3c5=['index','/:id','show','post','create','update','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xd3c5,0x128));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5d3c('0x0'));var util=require(_0x5d3c('0x1'));var path=require(_0x5d3c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5d3c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5d3c('0x4'));var interaction=require(_0x5d3c('0x5'));var config=require(_0x5d3c('0x6'));var controller=require(_0x5d3c('0x7'));router[_0x5d3c('0x8')]('/',auth[_0x5d3c('0x9')](),controller[_0x5d3c('0xa')]);router[_0x5d3c('0x8')](_0x5d3c('0xb'),auth[_0x5d3c('0x9')](),controller[_0x5d3c('0xc')]);router[_0x5d3c('0xd')]('/',auth['isAuthenticated'](),controller[_0x5d3c('0xe')]);router['put'](_0x5d3c('0xb'),auth['isAuthenticated'](),controller[_0x5d3c('0xf')]);router['delete']('/:id',auth[_0x5d3c('0x9')](),controller['destroy']);module[_0x5d3c('0x10')]=router;
\ No newline at end of file
+var _0x0538=['../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0x0538,0xe9));var _0x8053=function(_0x5bf420,_0x2d068d){_0x5bf420=_0x5bf420-0x0;var _0x1c5255=_0x0538[_0x5bf420];return _0x1c5255;};'use strict';var multer=require(_0x8053('0x0'));var util=require(_0x8053('0x1'));var path=require('path');var timeout=require(_0x8053('0x2'));var express=require(_0x8053('0x3'));var router=express[_0x8053('0x4')]();var fs_extra=require(_0x8053('0x5'));var auth=require(_0x8053('0x6'));var interaction=require(_0x8053('0x7'));var config=require('../../config/environment');var controller=require(_0x8053('0x8'));router[_0x8053('0x9')]('/',auth[_0x8053('0xa')](),controller[_0x8053('0xb')]);router[_0x8053('0x9')](_0x8053('0xc'),auth['isAuthenticated'](),controller[_0x8053('0xd')]);router[_0x8053('0xe')]('/',auth[_0x8053('0xa')](),controller[_0x8053('0xf')]);router[_0x8053('0x10')](_0x8053('0xc'),auth[_0x8053('0xa')](),controller[_0x8053('0x11')]);router[_0x8053('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8053('0x13')]);module['exports']=router;
\ No newline at end of file
index d412f5d..3fc654d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ae6=['v17,v27,v29','INTEGER','SIP','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x5ae6,0x196));var _0x65ae=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0x5ae6[_0x6d6a66];return _0x11eb6e;};'use strict';var Sequelize=require('sequelize');module[_0x65ae('0x0')]={'name':{'type':Sequelize[_0x65ae('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x65ae('0x1')]},'ecm':{'type':Sequelize[_0x65ae('0x2')]('yes','no'),'defaultValue':_0x65ae('0x3')},'headerinfo':{'type':Sequelize[_0x65ae('0x1')],'defaultValue':_0x65ae('0x4')},'localstationid':{'type':Sequelize[_0x65ae('0x1')],'unique':_0x65ae('0x5')},'minrate':{'type':Sequelize[_0x65ae('0x2')](_0x65ae('0x6'),_0x65ae('0x7'),_0x65ae('0x8'),_0x65ae('0x9'),_0x65ae('0xa'),_0x65ae('0xb')),'defaultValue':_0x65ae('0x7')},'maxrate':{'type':Sequelize[_0x65ae('0x2')](_0x65ae('0x6'),_0x65ae('0x7'),_0x65ae('0x8'),'9600',_0x65ae('0xa'),_0x65ae('0xb')),'defaultValue':_0x65ae('0xb')},'modem':{'type':Sequelize[_0x65ae('0x1')],'defaultValue':_0x65ae('0xc')},'gateway':{'type':Sequelize[_0x65ae('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x65ae('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x65ae('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x65ae('0x2')](_0x65ae('0xe'),'IAX','DADHI',_0x65ae('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x65ae('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x65ae('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x65ae('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x65ae('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x65ae('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x65ae('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x65ae('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x65ae('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x65ae('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x65ae('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x65ae('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x65ae('0x13'),'set':function(_0x2b6525){if(!_0x2b6525)this['setDataValue'](_0x65ae('0x14'),null);this['setDataValue'](_0x65ae('0x15'),_0x2b6525);}}};
\ No newline at end of file
+var _0x2bfd=['12000','14400','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600'];(function(_0x1c7536,_0x48a10d){var _0x435b74=function(_0x38aecf){while(--_0x38aecf){_0x1c7536['push'](_0x1c7536['shift']());}};_0x435b74(++_0x48a10d);}(_0x2bfd,0x1f1));var _0xd2bf=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0x2bfd[_0x12b683];return _0xfb150b;};'use strict';var Sequelize=require('sequelize');module[_0xd2bf('0x0')]={'name':{'type':Sequelize[_0xd2bf('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd2bf('0x1')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xd2bf('0x1')],'defaultValue':_0xd2bf('0x2')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xd2bf('0x3')},'minrate':{'type':Sequelize[_0xd2bf('0x4')](_0xd2bf('0x5'),_0xd2bf('0x6'),_0xd2bf('0x7'),_0xd2bf('0x8'),_0xd2bf('0x9'),_0xd2bf('0xa')),'defaultValue':_0xd2bf('0x6')},'maxrate':{'type':Sequelize[_0xd2bf('0x4')](_0xd2bf('0x5'),_0xd2bf('0x6'),_0xd2bf('0x7'),_0xd2bf('0x8'),'12000','14400'),'defaultValue':_0xd2bf('0xa')},'modem':{'type':Sequelize[_0xd2bf('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xd2bf('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd2bf('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd2bf('0x4')]('SIP',_0xd2bf('0xc'),_0xd2bf('0xd'),_0xd2bf('0xe')),'defaultValue':_0xd2bf('0xf')},'key':{'type':Sequelize[_0xd2bf('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd2bf('0x10')],'defaultValue':function(){return _0xd2bf('0x11');}},'notificationSound':{'type':Sequelize[_0xd2bf('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd2bf('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd2bf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd2bf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd2bf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd2bf('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0xd2bf('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xd2bf('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x419279){if(!_0x419279)this['setDataValue'](_0xd2bf('0x14'),null);this['setDataValue'](_0xd2bf('0x15'),_0x419279);}}};
\ No newline at end of file
index 94c8ac4..2324e72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ab0=['Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','query','intersection','attributes','model','fields','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','FaxAccount','includeAll','include','show','params','keys','length','find','create','body','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','hasOwnProperty','findAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','send','getApplications','context','from-voip-provider','exten','localstationid','app','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','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','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','FaxAccounts','stack','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ab0,0x15b));var _0x05ab=function(_0x2a5af0,_0x21e237){_0x2a5af0=_0x2a5af0-0x0;var _0x5644db=_0x5ab0[_0x2a5af0];return _0x5644db;};'use strict';var emlformat=require(_0x05ab('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x05ab('0x1'));var rp=require('request-promise');var moment=require(_0x05ab('0x2'));var BPromise=require(_0x05ab('0x3'));var Mustache=require(_0x05ab('0x4'));var util=require('util');var path=require('path');var sox=require(_0x05ab('0x5'));var csv=require(_0x05ab('0x6'));var ejs=require(_0x05ab('0x7'));var fs=require('fs');var fs_extra=require(_0x05ab('0x8'));var _=require(_0x05ab('0x9'));var squel=require(_0x05ab('0xa'));var crypto=require(_0x05ab('0xb'));var jsforce=require(_0x05ab('0xc'));var deskjs=require(_0x05ab('0xd'));var toCsv=require(_0x05ab('0x6'));var querystring=require(_0x05ab('0xe'));var Papa=require(_0x05ab('0xf'));var Redis=require(_0x05ab('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x05ab('0x11'));var as=require(_0x05ab('0x12'));var hardwareService=require(_0x05ab('0x13'));var logger=require('../../config/logger')(_0x05ab('0x14'));var utils=require(_0x05ab('0x15'));var config=require(_0x05ab('0x16'));var licenseUtil=require(_0x05ab('0x17'));var db=require(_0x05ab('0x18'))['db'];config[_0x05ab('0x19')]=_[_0x05ab('0x1a')](config[_0x05ab('0x19')],{'host':_0x05ab('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05ab('0x19')]));require(_0x05ab('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x05ab('0x1d')][_0x05ab('0x1e')]({'port':0x232c});var client9002=jayson[_0x05ab('0x1d')][_0x05ab('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3280cd,_0x197447,_0x255919,_0x1a1f86){return new BPromise(function(_0x42f5bc,_0x223314){var _0xedd762=_0x1a1f86||client;return _0xedd762[_0x05ab('0x1f')](_0x3280cd,_0x255919)[_0x05ab('0x20')](function(_0x4f6c5d){logger['info'](_0x05ab('0x21'),_0x197447,_0x05ab('0x22'));logger[_0x05ab('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x197447,_0x05ab('0x22'),JSON['stringify'](_0x4f6c5d));if(_0x4f6c5d[_0x05ab('0x24')]){if(_0x4f6c5d[_0x05ab('0x24')][_0x05ab('0x25')]===0x1f4){logger[_0x05ab('0x24')](_0x05ab('0x21'),_0x197447,_0x4f6c5d[_0x05ab('0x24')]['message']);return _0x223314(_0x4f6c5d['error'][_0x05ab('0x26')]);}logger['error'](_0x05ab('0x21'),_0x197447,_0x4f6c5d['error'][_0x05ab('0x26')]);return _0x42f5bc(_0x4f6c5d[_0x05ab('0x24')][_0x05ab('0x26')]);}else{logger['info'](_0x05ab('0x21'),_0x197447,_0x05ab('0x22'));_0x42f5bc(_0x4f6c5d[_0x05ab('0x27')][_0x05ab('0x26')]);}})[_0x05ab('0x28')](function(_0x20fdd3){logger[_0x05ab('0x24')]('FaxAccount,\x20%s,\x20%s',_0x197447,_0x20fdd3);_0x223314(_0x20fdd3);});});}function respondWithStatusCode(_0x37af6a,_0x41b524){_0x41b524=_0x41b524||0xcc;return function(_0x20bba4){if(_0x20bba4){return _0x37af6a[_0x05ab('0x29')](_0x41b524);}return _0x37af6a[_0x05ab('0x2a')](_0x41b524)[_0x05ab('0x2b')]();};}function respondWithResult(_0x14795d,_0xa130ec){_0xa130ec=_0xa130ec||0xc8;return function(_0x232d13){if(_0x232d13){return _0x14795d['status'](_0xa130ec)[_0x05ab('0x2c')](_0x232d13);}};}function respondWithFilteredResult(_0x1bc34b,_0x32a00d){return function(_0xb07fdd){if(_0xb07fdd){var _0x11a3e2=typeof _0x32a00d[_0x05ab('0x2d')]===_0x05ab('0x2e')&&typeof _0x32a00d[_0x05ab('0x2f')]===_0x05ab('0x2e');var _0x26ccf3=_0xb07fdd[_0x05ab('0x30')];var _0x41be61=_0x11a3e2?0x0:_0x32a00d[_0x05ab('0x2d')];var _0x35dbc0=_0x11a3e2?_0xb07fdd[_0x05ab('0x30')]:_0x32a00d[_0x05ab('0x2d')]+_0x32a00d['limit'];var _0x20fbaa;if(_0x35dbc0>=_0x26ccf3){_0x35dbc0=_0x26ccf3;_0x20fbaa=0xc8;}else{_0x20fbaa=0xce;}_0x1bc34b[_0x05ab('0x2a')](_0x20fbaa);return _0x1bc34b[_0x05ab('0x31')](_0x05ab('0x32'),_0x41be61+'-'+_0x35dbc0+'/'+_0x26ccf3)[_0x05ab('0x2c')](_0xb07fdd);}return null;};}function patchUpdates(_0x15551a){return function(_0x4e86cc){try{jsonpatch['apply'](_0x4e86cc,_0x15551a,!![]);}catch(_0x2e207c){return BPromise['reject'](_0x2e207c);}return _0x4e86cc[_0x05ab('0x33')]();};}function saveUpdates(_0x5ed6ec,_0x3f4ab7){return function(_0x27a4ba){if(_0x27a4ba){return _0x27a4ba[_0x05ab('0x34')](_0x5ed6ec)[_0x05ab('0x20')](function(_0x3648ed){return _0x3648ed;});}return null;};}function removeEntity(_0x28ca4a,_0x5ebe81){return function(_0x1a2920){if(_0x1a2920){return _0x1a2920[_0x05ab('0x35')]()[_0x05ab('0x20')](function(){var _0x2ed1ca=_0x1a2920['get']({'plain':!![]});var _0x130f9c=_0x05ab('0x36');return db['UserProfileResource'][_0x05ab('0x35')]({'where':{'type':_0x130f9c,'resourceId':_0x2ed1ca['id']}})['then'](function(){return _0x1a2920;});})[_0x05ab('0x20')](function(){_0x28ca4a[_0x05ab('0x2a')](0xcc)[_0x05ab('0x2b')]();});}};}function handleEntityNotFound(_0x3aa7b1,_0x3de68e){return function(_0x329965){if(!_0x329965){_0x3aa7b1[_0x05ab('0x29')](0x194);}return _0x329965;};}function handleError(_0x39cc12,_0x39f4dc){_0x39f4dc=_0x39f4dc||0x1f4;return function(_0x50ee3c){logger[_0x05ab('0x24')](_0x50ee3c[_0x05ab('0x37')]);if(_0x50ee3c[_0x05ab('0x38')]){delete _0x50ee3c[_0x05ab('0x38')];}_0x39cc12[_0x05ab('0x2a')](_0x39f4dc)['send'](_0x50ee3c);};}exports['index']=function(_0x43a8af,_0x3b103e){var _0xad57c6={'include':[{'model':db[_0x05ab('0x39')],'as':_0x05ab('0x3a')}]},_0xd8a1b2={},_0x2e4d2b={'count':0x0,'rows':[]};var _0x57ddc6=_[_0x05ab('0x3b')](db['FaxAccount'][_0x05ab('0x3c')],function(_0x5a81c7){return{'name':_0x5a81c7[_0x05ab('0x3d')],'type':_0x5a81c7[_0x05ab('0x3e')]['key']};});_0xd8a1b2['model']=_[_0x05ab('0x3b')](_0x57ddc6,_0x05ab('0x38'));_0xd8a1b2[_0x05ab('0x3f')]=_['keys'](_0x43a8af['query']);_0xd8a1b2['filters']=_[_0x05ab('0x40')](_0xd8a1b2['model'],_0xd8a1b2[_0x05ab('0x3f')]);_0xad57c6[_0x05ab('0x41')]=_['intersection'](_0xd8a1b2[_0x05ab('0x42')],qs[_0x05ab('0x43')](_0x43a8af[_0x05ab('0x3f')][_0x05ab('0x43')]));_0xad57c6[_0x05ab('0x41')]=_0xad57c6[_0x05ab('0x41')]['length']?_0xad57c6[_0x05ab('0x41')]:_0xd8a1b2[_0x05ab('0x42')];if(!_0x43a8af[_0x05ab('0x3f')]['hasOwnProperty'](_0x05ab('0x44'))){_0xad57c6['limit']=qs[_0x05ab('0x2f')](_0x43a8af[_0x05ab('0x3f')]['limit']);_0xad57c6[_0x05ab('0x2d')]=qs[_0x05ab('0x2d')](_0x43a8af['query'][_0x05ab('0x2d')]);}_0xad57c6[_0x05ab('0x45')]=qs[_0x05ab('0x46')](_0x43a8af[_0x05ab('0x3f')]['sort']);_0xad57c6['where']=qs['filters'](_[_0x05ab('0x47')](_0x43a8af[_0x05ab('0x3f')],_0xd8a1b2[_0x05ab('0x48')]),_0x57ddc6);if(_0x43a8af[_0x05ab('0x3f')]['filter']){_0xad57c6[_0x05ab('0x49')]=_[_0x05ab('0x4a')](_0xad57c6[_0x05ab('0x49')],{'$or':_[_0x05ab('0x3b')](_0x57ddc6,function(_0x24d99d){if(_0x24d99d[_0x05ab('0x3e')]!==_0x05ab('0x4b')){var _0x3bea35={};_0x3bea35[_0x24d99d[_0x05ab('0x38')]]={'$like':'%'+_0x43a8af[_0x05ab('0x3f')][_0x05ab('0x4c')]+'%'};return _0x3bea35;}})});}_0xad57c6=_[_0x05ab('0x4a')]({},_0xad57c6,_0x43a8af[_0x05ab('0x4d')]);var _0x1b75ab={'where':_0xad57c6[_0x05ab('0x49')]};return db[_0x05ab('0x4e')][_0x05ab('0x30')](_0x1b75ab)['then'](function(_0x5b91ac){_0x2e4d2b['count']=_0x5b91ac;if(_0x43a8af[_0x05ab('0x3f')][_0x05ab('0x4f')]){_0xad57c6[_0x05ab('0x50')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0xad57c6);})[_0x05ab('0x20')](function(_0x51b36c){_0x2e4d2b['rows']=_0x51b36c;return _0x2e4d2b;})[_0x05ab('0x20')](respondWithFilteredResult(_0x3b103e,_0xad57c6))[_0x05ab('0x28')](handleError(_0x3b103e,null));};exports[_0x05ab('0x51')]=function(_0x1e1580,_0x375df4){var _0x53d9a2={'raw':![],'where':{'id':_0x1e1580[_0x05ab('0x52')]['id']},'include':[{'model':db[_0x05ab('0x39')],'as':_0x05ab('0x3a')}]},_0x29756e={};_0x29756e['model']=_['keys'](db[_0x05ab('0x4e')][_0x05ab('0x3c')]);_0x29756e['query']=_[_0x05ab('0x53')](_0x1e1580[_0x05ab('0x3f')]);_0x29756e[_0x05ab('0x48')]=_['intersection'](_0x29756e[_0x05ab('0x42')],_0x29756e[_0x05ab('0x3f')]);_0x53d9a2[_0x05ab('0x41')]=_[_0x05ab('0x40')](_0x29756e[_0x05ab('0x42')],qs[_0x05ab('0x43')](_0x1e1580[_0x05ab('0x3f')][_0x05ab('0x43')]));_0x53d9a2[_0x05ab('0x41')]=_0x53d9a2['attributes'][_0x05ab('0x54')]?_0x53d9a2[_0x05ab('0x41')]:_0x29756e[_0x05ab('0x42')];if(_0x1e1580['query']['includeAll']){_0x53d9a2[_0x05ab('0x50')]=[{'all':!![]}];}_0x53d9a2=_[_0x05ab('0x4a')]({},_0x53d9a2,_0x1e1580[_0x05ab('0x4d')]);return db[_0x05ab('0x4e')][_0x05ab('0x55')](_0x53d9a2)[_0x05ab('0x20')](handleEntityNotFound(_0x375df4,null))[_0x05ab('0x20')](respondWithResult(_0x375df4,null))[_0x05ab('0x28')](handleError(_0x375df4,null));};exports[_0x05ab('0x56')]=function(_0x3feffb,_0x1ff56d){return db[_0x05ab('0x4e')][_0x05ab('0x56')](_0x3feffb[_0x05ab('0x57')],{})[_0x05ab('0x20')](function(_0x38fa59){var _0x4379e8=_0x3feffb[_0x05ab('0x58')][_0x05ab('0x59')]({'plain':!![]});if(!_0x4379e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4379e8['role']===_0x05ab('0x58')){var _0x2bdc0=_0x38fa59['get']({'plain':!![]});var _0x501d19=_0x05ab('0x36');return db[_0x05ab('0x5a')][_0x05ab('0x55')]({'where':{'name':_0x501d19,'userProfileId':_0x4379e8['userProfileId']},'raw':!![]})[_0x05ab('0x20')](function(_0x5dbba9){if(_0x5dbba9&&_0x5dbba9[_0x05ab('0x5b')]===0x0){return db[_0x05ab('0x5c')][_0x05ab('0x56')]({'name':_0x2bdc0[_0x05ab('0x38')],'resourceId':_0x2bdc0['id'],'type':_0x5dbba9['name'],'sectionId':_0x5dbba9['id']},{})['then'](function(){return _0x38fa59;});}else{return _0x38fa59;}})[_0x05ab('0x28')](function(_0x3973b7){logger[_0x05ab('0x24')](_0x05ab('0x5d'),_0x3973b7);throw _0x3973b7;});}return _0x38fa59;})[_0x05ab('0x20')](respondWithResult(_0x1ff56d,0xc9))[_0x05ab('0x28')](handleError(_0x1ff56d,null));};exports[_0x05ab('0x34')]=function(_0x2c5fdd,_0x5229b6){if(_0x2c5fdd['body']['id']){delete _0x2c5fdd[_0x05ab('0x57')]['id'];}return db[_0x05ab('0x4e')][_0x05ab('0x55')]({'where':{'id':_0x2c5fdd[_0x05ab('0x52')]['id']},'include':[{'model':db[_0x05ab('0x39')],'as':_0x05ab('0x3a')}]})[_0x05ab('0x20')](handleEntityNotFound(_0x5229b6,null))['then'](saveUpdates(_0x2c5fdd['body'],null))['then'](respondWithResult(_0x5229b6,null))['catch'](handleError(_0x5229b6,null));};exports[_0x05ab('0x35')]=function(_0x599ea9,_0x1dc70c){return db['FaxAccount'][_0x05ab('0x55')]({'where':{'id':_0x599ea9['params']['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x1dc70c,null))[_0x05ab('0x20')](removeEntity(_0x1dc70c,null))[_0x05ab('0x28')](handleError(_0x1dc70c,null));};exports['describe']=function(_0x3f3fe9,_0x5935fd){return db['FaxAccount'][_0x05ab('0x5e')]()[_0x05ab('0x20')](respondWithResult(_0x5935fd,null))[_0x05ab('0x28')](handleError(_0x5935fd,null));};exports[_0x05ab('0x5f')]=function(_0x4a0b3d,_0x317bb9,_0x4ba71a){if(_0x4a0b3d['body']['id']){delete _0x4a0b3d[_0x05ab('0x57')]['id'];}return db['FaxAccount'][_0x05ab('0x55')]({'where':{'id':_0x4a0b3d['params']['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x317bb9,null))[_0x05ab('0x20')](function(_0x306a11){if(_0x306a11){_0x4a0b3d[_0x05ab('0x57')][_0x05ab('0x60')]=_0x306a11['id'];return db[_0x05ab('0x61')]['create'](_0x4a0b3d['body']);}})[_0x05ab('0x20')](respondWithResult(_0x317bb9,null))[_0x05ab('0x28')](handleError(_0x317bb9,null));};exports['getDispositions']=function(_0x329546,_0x3d3046,_0x1581b4){var _0x52811a={'raw':![],'where':{}};var _0x406e47={};var _0x511c88={'count':0x0,'rows':[]};return db[_0x05ab('0x4e')][_0x05ab('0x62')]({'where':{'id':_0x329546['params']['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x3d3046,null))[_0x05ab('0x20')](function(_0x409e75){if(_0x409e75){_0x406e47['model']=_[_0x05ab('0x53')](db[_0x05ab('0x61')][_0x05ab('0x3c')]);_0x406e47[_0x05ab('0x3f')]=_[_0x05ab('0x53')](_0x329546[_0x05ab('0x3f')]);_0x406e47[_0x05ab('0x48')]=_[_0x05ab('0x40')](_0x406e47[_0x05ab('0x42')],_0x406e47[_0x05ab('0x3f')]);_0x52811a[_0x05ab('0x41')]=_['intersection'](_0x406e47['model'],qs['fields'](_0x329546['query'][_0x05ab('0x43')]));_0x52811a[_0x05ab('0x41')]=_0x52811a[_0x05ab('0x41')][_0x05ab('0x54')]?_0x52811a['attributes']:_0x406e47[_0x05ab('0x42')];if(!_0x329546['query'][_0x05ab('0x63')](_0x05ab('0x44'))){_0x52811a['limit']=qs['limit'](_0x329546['query']['limit']);_0x52811a['offset']=qs['offset'](_0x329546['query'][_0x05ab('0x2d')]);}_0x52811a[_0x05ab('0x45')]=qs[_0x05ab('0x46')](_0x329546[_0x05ab('0x3f')][_0x05ab('0x46')]);_0x52811a['where']=qs[_0x05ab('0x48')](_[_0x05ab('0x47')](_0x329546[_0x05ab('0x3f')],_0x406e47[_0x05ab('0x48')]));_0x52811a[_0x05ab('0x49')][_0x05ab('0x60')]=_0x409e75['id'];if(_0x329546[_0x05ab('0x3f')]['filter']){_0x52811a[_0x05ab('0x49')]=_[_0x05ab('0x4a')](_0x52811a[_0x05ab('0x49')],{'$or':_['map'](_0x52811a[_0x05ab('0x41')],function(_0x31256d){var _0x406b53={};_0x406b53[_0x31256d]={'$like':'%'+_0x329546[_0x05ab('0x3f')][_0x05ab('0x4c')]+'%'};return _0x406b53;})});}_0x52811a=_[_0x05ab('0x4a')]({},_0x52811a,_0x329546[_0x05ab('0x4d')]);return db[_0x05ab('0x61')]['count']({'where':_0x52811a[_0x05ab('0x49')]})[_0x05ab('0x20')](function(_0xc47b76){_0x511c88[_0x05ab('0x30')]=_0xc47b76;if(_0x329546['query']['includeAll']){_0x52811a[_0x05ab('0x50')]=[{'all':!![]}];}return db[_0x05ab('0x61')][_0x05ab('0x64')](_0x52811a);})[_0x05ab('0x20')](function(_0x32f220){_0x511c88[_0x05ab('0x65')]=_0x32f220;return _0x511c88;});}})[_0x05ab('0x20')](respondWithFilteredResult(_0x3d3046,_0x52811a))[_0x05ab('0x28')](handleError(_0x3d3046,null));};exports[_0x05ab('0x66')]=function(_0x458804,_0xaf971e,_0x33dd88){return db[_0x05ab('0x4e')][_0x05ab('0x55')]({'where':{'id':_0x458804[_0x05ab('0x52')]['id']}})['then'](handleEntityNotFound(_0xaf971e,null))['then'](function(_0x5c2ce2){if(_0x5c2ce2){return _0x5c2ce2[_0x05ab('0x66')](_0x458804[_0x05ab('0x3f')][_0x05ab('0x67')]);}})[_0x05ab('0x20')](respondWithStatusCode(_0xaf971e,null))[_0x05ab('0x28')](handleError(_0xaf971e,null));};exports['addAnswer']=function(_0x20a6ab,_0x5df2d7,_0x544281){if(_0x20a6ab[_0x05ab('0x57')]['id']){delete _0x20a6ab[_0x05ab('0x57')]['id'];}return db['FaxAccount'][_0x05ab('0x55')]({'where':{'id':_0x20a6ab[_0x05ab('0x52')]['id']}})['then'](handleEntityNotFound(_0x5df2d7,null))['then'](function(_0x42096f){if(_0x42096f){_0x20a6ab[_0x05ab('0x57')][_0x05ab('0x60')]=_0x42096f['id'];return db[_0x05ab('0x68')]['create'](_0x20a6ab[_0x05ab('0x57')]);}})[_0x05ab('0x20')](respondWithResult(_0x5df2d7,null))[_0x05ab('0x28')](handleError(_0x5df2d7,null));};exports[_0x05ab('0x69')]=function(_0x7445cb,_0x298387,_0x4330b8){var _0x3e4b65={'raw':![],'where':{}};var _0x203ade={};var _0x4a57ca={'count':0x0,'rows':[]};return db[_0x05ab('0x4e')]['findOne']({'where':{'id':_0x7445cb[_0x05ab('0x52')]['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x298387,null))[_0x05ab('0x20')](function(_0x129bf0){if(_0x129bf0){_0x203ade['model']=_[_0x05ab('0x53')](db['CannedAnswer'][_0x05ab('0x3c')]);_0x203ade[_0x05ab('0x3f')]=_[_0x05ab('0x53')](_0x7445cb['query']);_0x203ade[_0x05ab('0x48')]=_[_0x05ab('0x40')](_0x203ade['model'],_0x203ade[_0x05ab('0x3f')]);_0x3e4b65[_0x05ab('0x41')]=_[_0x05ab('0x40')](_0x203ade[_0x05ab('0x42')],qs[_0x05ab('0x43')](_0x7445cb[_0x05ab('0x3f')][_0x05ab('0x43')]));_0x3e4b65['attributes']=_0x3e4b65[_0x05ab('0x41')]['length']?_0x3e4b65[_0x05ab('0x41')]:_0x203ade[_0x05ab('0x42')];if(!_0x7445cb[_0x05ab('0x3f')][_0x05ab('0x63')](_0x05ab('0x44'))){_0x3e4b65[_0x05ab('0x2f')]=qs[_0x05ab('0x2f')](_0x7445cb[_0x05ab('0x3f')][_0x05ab('0x2f')]);_0x3e4b65[_0x05ab('0x2d')]=qs[_0x05ab('0x2d')](_0x7445cb[_0x05ab('0x3f')][_0x05ab('0x2d')]);}_0x3e4b65[_0x05ab('0x45')]=qs[_0x05ab('0x46')](_0x7445cb[_0x05ab('0x3f')][_0x05ab('0x46')]);_0x3e4b65[_0x05ab('0x49')]=qs['filters'](_[_0x05ab('0x47')](_0x7445cb['query'],_0x203ade[_0x05ab('0x48')]));_0x3e4b65[_0x05ab('0x49')][_0x05ab('0x60')]=_0x129bf0['id'];if(_0x7445cb[_0x05ab('0x3f')][_0x05ab('0x4c')]){_0x3e4b65['where']=_[_0x05ab('0x4a')](_0x3e4b65[_0x05ab('0x49')],{'$or':_[_0x05ab('0x3b')](_0x3e4b65[_0x05ab('0x41')],function(_0x3d9aed){var _0x2830f9={};_0x2830f9[_0x3d9aed]={'$like':'%'+_0x7445cb['query'][_0x05ab('0x4c')]+'%'};return _0x2830f9;})});}_0x3e4b65=_[_0x05ab('0x4a')]({},_0x3e4b65,_0x7445cb['options']);return db[_0x05ab('0x68')][_0x05ab('0x30')]({'where':_0x3e4b65[_0x05ab('0x49')]})[_0x05ab('0x20')](function(_0x5ec054){_0x4a57ca[_0x05ab('0x30')]=_0x5ec054;if(_0x7445cb[_0x05ab('0x3f')][_0x05ab('0x4f')]){_0x3e4b65[_0x05ab('0x50')]=[{'all':!![]}];}return db[_0x05ab('0x68')]['findAll'](_0x3e4b65);})[_0x05ab('0x20')](function(_0x14a693){_0x4a57ca[_0x05ab('0x65')]=_0x14a693;return _0x4a57ca;});}})[_0x05ab('0x20')](respondWithFilteredResult(_0x298387,_0x3e4b65))['catch'](handleError(_0x298387,null));};exports[_0x05ab('0x6a')]=function(_0x2e62e1,_0x154d41,_0xc16cf0){return db['FaxAccount']['find']({'where':{'id':_0x2e62e1[_0x05ab('0x52')]['id']}})['then'](handleEntityNotFound(_0x154d41,null))[_0x05ab('0x20')](function(_0x3b0de9){if(_0x3b0de9){return _0x3b0de9[_0x05ab('0x6a')](_0x2e62e1[_0x05ab('0x3f')][_0x05ab('0x67')]);}})[_0x05ab('0x20')](respondWithStatusCode(_0x154d41,null))['catch'](handleError(_0x154d41,null));};exports[_0x05ab('0x6b')]=function(_0x1c327b,_0x44819c,_0x5057d3){return db[_0x05ab('0x6c')][_0x05ab('0x55')]({'where':{'id':_0x1c327b[_0x05ab('0x52')]['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x44819c,null))[_0x05ab('0x20')](function(_0x3d837f){if(_0x3d837f){return _0x3d837f['addInteraction'](_0x1c327b['body'][_0x05ab('0x67')],_[_0x05ab('0x6d')](_0x1c327b[_0x05ab('0x57')],[_0x05ab('0x67'),'id'])||{});}})['then'](respondWithResult(_0x44819c,null))[_0x05ab('0x28')](handleError(_0x44819c,null));};exports[_0x05ab('0x6e')]=function(_0x5eb740,_0x43beed,_0x4a1c02){var _0x5b3b28={'raw':![],'where':{}};var _0x44bb67={};var _0x8a95b5={'count':0x0,'rows':[]};return db['FaxAccount'][_0x05ab('0x62')]({'where':{'id':_0x5eb740[_0x05ab('0x52')]['id']}})['then'](handleEntityNotFound(_0x43beed,null))[_0x05ab('0x20')](function(_0x27a0e7){if(_0x27a0e7){_0x44bb67[_0x05ab('0x42')]=_[_0x05ab('0x53')](db[_0x05ab('0x6c')][_0x05ab('0x3c')]);_0x44bb67[_0x05ab('0x3f')]=_[_0x05ab('0x53')](_0x5eb740['query']);_0x44bb67[_0x05ab('0x48')]=_[_0x05ab('0x40')](_0x44bb67[_0x05ab('0x42')],_0x44bb67[_0x05ab('0x3f')]);_0x5b3b28[_0x05ab('0x41')]=_['intersection'](_0x44bb67[_0x05ab('0x42')],qs[_0x05ab('0x43')](_0x5eb740['query']['fields']));_0x5b3b28[_0x05ab('0x41')]=_0x5b3b28[_0x05ab('0x41')][_0x05ab('0x54')]?_0x5b3b28[_0x05ab('0x41')]:_0x44bb67[_0x05ab('0x42')];if(!_0x5eb740[_0x05ab('0x3f')]['hasOwnProperty']('nolimit')){_0x5b3b28[_0x05ab('0x2f')]=qs['limit'](_0x5eb740[_0x05ab('0x3f')]['limit']);_0x5b3b28['offset']=qs[_0x05ab('0x2d')](_0x5eb740['query'][_0x05ab('0x2d')]);}_0x5b3b28['order']=qs[_0x05ab('0x46')](_0x5eb740[_0x05ab('0x3f')][_0x05ab('0x46')]);_0x5b3b28['where']=qs['filters'](_['pick'](_0x5eb740['query'],_0x44bb67[_0x05ab('0x48')]));_0x5b3b28[_0x05ab('0x49')][_0x05ab('0x60')]=_0x27a0e7['id'];if(_0x5eb740[_0x05ab('0x3f')]['filter']){_0x5b3b28[_0x05ab('0x49')]=_['merge'](_0x5b3b28[_0x05ab('0x49')],{'$or':_[_0x05ab('0x3b')](_0x5b3b28[_0x05ab('0x41')],function(_0x3e8f4f){var _0x582023={};_0x582023[_0x3e8f4f]={'$like':'%'+_0x5eb740[_0x05ab('0x3f')][_0x05ab('0x4c')]+'%'};return _0x582023;})});}_0x5b3b28=_[_0x05ab('0x4a')]({},_0x5b3b28,_0x5eb740['options']);return db[_0x05ab('0x6c')]['count']({'where':_0x5b3b28[_0x05ab('0x49')]})[_0x05ab('0x20')](function(_0x5e946f){_0x8a95b5[_0x05ab('0x30')]=_0x5e946f;if(_0x5eb740[_0x05ab('0x3f')][_0x05ab('0x4f')]){_0x5b3b28[_0x05ab('0x50')]=[{'model':db[_0x05ab('0x6f')],'as':_0x05ab('0x70'),'required':![]},{'model':db[_0x05ab('0x71')],'as':_0x05ab('0x72'),'attributes':[_0x05ab('0x38'),_0x05ab('0x73'),_0x05ab('0x74')],'required':![]},{'model':db[_0x05ab('0x75')],'as':_0x05ab('0x76'),'attributes':['id','name','color'],'where':_0x5eb740[_0x05ab('0x3f')][_0x05ab('0x77')]?{'id':_0x5eb740[_0x05ab('0x3f')][_0x05ab('0x77')]}:undefined,'required':_0x5eb740[_0x05ab('0x3f')]['tag']?!![]:![]}];}return db[_0x05ab('0x6c')]['findAll'](_0x5b3b28);})['then'](function(_0x3bbf96){_0x8a95b5[_0x05ab('0x65')]=_0x3bbf96;return _0x8a95b5;});}})[_0x05ab('0x20')](respondWithFilteredResult(_0x43beed,_0x5b3b28))['catch'](handleError(_0x43beed,null));};exports[_0x05ab('0x78')]=function(_0x3d4461,_0x5db791){var _0x1ba4d1=_0x3d4461['params']['id'];var _0x705ff=_0x3d4461['body'];var _0x12eea1=0xc8;var _0x1d8482=null;return db['sequelize'][_0x05ab('0x79')]({'isolationLevel':db[_0x05ab('0x7a')][_0x05ab('0x7b')]['ISOLATION_LEVELS'][_0x05ab('0x7c')]},function(_0x17e775){return db[_0x05ab('0x4e')]['findOne']({'where':{'id':_0x1ba4d1},'transaction':_0x17e775})[_0x05ab('0x20')](function(_0x4119af){if(_0x4119af){return db[_0x05ab('0x7d')]['destroy']({'where':{'FaxAccountId':_0x1ba4d1},'transaction':_0x17e775})['then'](function(){var _0x3a6c17=_[_0x05ab('0x3b')](_0x705ff,function(_0x166f7f){_0x166f7f['FaxAccountId']=_0x1ba4d1;return _0x166f7f;});return db[_0x05ab('0x7d')]['bulkCreate'](_0x3a6c17,{'transaction':_0x17e775});});}else{_0x12eea1=0x194;_0x1d8482=[];}});})[_0x05ab('0x20')](function(){if(_0x12eea1!==0x194){return db['FaxApplication'][_0x05ab('0x7e')]({'where':{'FaxAccountId':_0x1ba4d1},'order':_0x05ab('0x7f')})['then'](function(_0x4af296){_0x1d8482=_0x4af296;});}})[_0x05ab('0x28')](function(_0x576485){_0x12eea1=0x1f4;logger['error'](_0x576485['stack']);if(_0x576485[_0x05ab('0x38')]){delete _0x576485[_0x05ab('0x38')];}_0x1d8482=_0x576485;})[_0x05ab('0x80')](function(){if(_0x1d8482===null){_0x5db791[_0x05ab('0x29')](_0x12eea1);}else{if(_0x12eea1===0x1f4){_0x5db791[_0x05ab('0x2a')](_0x12eea1)[_0x05ab('0x81')](_0x1d8482);}else{_0x5db791[_0x05ab('0x2a')](_0x12eea1)[_0x05ab('0x2c')](_0x1d8482);}}});};exports['getApplications']=function(_0x41f345,_0x17bf09,_0x4b3be9){var _0x418dbd={};var _0x367e0b={};var _0x501246;var _0x90ec9f;return db[_0x05ab('0x4e')][_0x05ab('0x62')]({'where':{'id':_0x41f345['params']['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x17bf09,null))[_0x05ab('0x20')](function(_0x568bba){if(_0x568bba){_0x501246=_0x568bba;_0x367e0b['model']=_['keys'](db[_0x05ab('0x7d')][_0x05ab('0x3c')]);_0x367e0b[_0x05ab('0x3f')]=_[_0x05ab('0x53')](_0x41f345['query']);_0x367e0b['filters']=_[_0x05ab('0x40')](_0x367e0b['model'],_0x367e0b[_0x05ab('0x3f')]);_0x418dbd[_0x05ab('0x41')]=_['intersection'](_0x367e0b[_0x05ab('0x42')],qs[_0x05ab('0x43')](_0x41f345[_0x05ab('0x3f')][_0x05ab('0x43')]));_0x418dbd[_0x05ab('0x41')]=_0x418dbd[_0x05ab('0x41')][_0x05ab('0x54')]?_0x418dbd[_0x05ab('0x41')]:_0x367e0b[_0x05ab('0x42')];_0x418dbd[_0x05ab('0x45')]=qs[_0x05ab('0x46')](_0x41f345[_0x05ab('0x3f')][_0x05ab('0x46')]);_0x418dbd[_0x05ab('0x49')]=qs[_0x05ab('0x48')](_[_0x05ab('0x47')](_0x41f345[_0x05ab('0x3f')],_0x367e0b[_0x05ab('0x48')]));if(_0x41f345[_0x05ab('0x3f')][_0x05ab('0x4c')]){_0x418dbd[_0x05ab('0x49')]=_[_0x05ab('0x4a')](_0x418dbd[_0x05ab('0x49')],{'$or':_[_0x05ab('0x3b')](_0x418dbd[_0x05ab('0x41')],function(_0x16ee92){var _0x46197a={};_0x46197a[_0x16ee92]={'$like':'%'+_0x41f345[_0x05ab('0x3f')][_0x05ab('0x4c')]+'%'};return _0x46197a;})});}_0x418dbd=_[_0x05ab('0x4a')]({},_0x418dbd,_0x41f345[_0x05ab('0x4d')]);return _0x501246['getApplications'](_0x418dbd);}})[_0x05ab('0x20')](function(_0x504fd8){if(_0x504fd8){_0x90ec9f=_0x504fd8['length'];if(!_0x41f345[_0x05ab('0x3f')]['hasOwnProperty'](_0x05ab('0x44'))){_0x418dbd[_0x05ab('0x2f')]=qs[_0x05ab('0x2f')](_0x41f345[_0x05ab('0x3f')][_0x05ab('0x2f')]);_0x418dbd[_0x05ab('0x2d')]=qs['offset'](_0x41f345[_0x05ab('0x3f')][_0x05ab('0x2d')]);}return _0x501246[_0x05ab('0x82')](_0x418dbd);}})[_0x05ab('0x20')](function(_0x11656a){if(_0x11656a){return _0x11656a?{'count':_0x90ec9f,'rows':_0x11656a}:null;}})['then'](respondWithResult(_0x17bf09,null))[_0x05ab('0x28')](handleError(_0x17bf09,null));};function Extension(_0x3bdacd,_0x7ec677,_0x3ef85c,_0x344aa4){this[_0x05ab('0x83')]=_0x05ab('0x84');this[_0x05ab('0x85')]=_0x3bdacd[_0x05ab('0x86')];this[_0x05ab('0x87')]=_0x344aa4;this['type']='system';this['description']='Fax\x20Extension';this[_0x05ab('0x60')]=_0x3bdacd['id'];this[_0x05ab('0x7f')]=_0x7ec677;this[_0x05ab('0x88')]=_0x3ef85c;}function createExtensionsReciveFax(_0x16e947){var _0x3547ba=0x1;var _0x55cc6a=[];_0x55cc6a[_0x05ab('0x89')](new Extension(_0x16e947,_0x3547ba,'',_0x05ab('0x8a')));_0x3547ba+=0x1;_0x55cc6a[_0x05ab('0x89')](new Extension(_0x16e947,_0x3547ba,_0x05ab('0x8b'),_0x05ab('0x8c')));_0x3547ba+=0x1;for(var _0x2a01d7 in _0x16e947){if(_0x16e947[_0x05ab('0x63')](_0x2a01d7)&&(_0x2a01d7===_0x05ab('0x8d')||_0x2a01d7===_0x05ab('0x86')||_0x2a01d7===_0x05ab('0x8e')||_0x2a01d7===_0x05ab('0x8f')||_0x2a01d7===_0x05ab('0x90')||_0x2a01d7===_0x05ab('0x91')||_0x2a01d7===_0x05ab('0x92')||_0x2a01d7===_0x05ab('0x93')||_0x2a01d7==='t38timeout')){_0x55cc6a[_0x05ab('0x89')](new Extension(_0x16e947,_0x3547ba,_0x05ab('0x94')+_0x2a01d7+')='+_0x16e947[_0x2a01d7],_0x05ab('0x8c')));_0x3547ba+=0x1;}}_0x55cc6a[_0x05ab('0x89')](new Extension(_0x16e947,_0x3547ba,'6',_0x05ab('0x95')));_0x3547ba+=0x1;_0x55cc6a[_0x05ab('0x89')](new Extension(_0x16e947,_0x3547ba,_0x05ab('0x96'),_0x05ab('0x97')));_0x3547ba=0x0;return _0x55cc6a;}exports[_0x05ab('0x98')]=function(_0xb60fb3,_0x357b93,_0x2aed49){var _0x434e46;return db[_0x05ab('0x7a')][_0x05ab('0x79')](function(_0xd36d23){return db[_0x05ab('0x4e')][_0x05ab('0x56')](_0xb60fb3[_0x05ab('0x57')],{'transaction':_0xd36d23})['then'](function(_0x271490){_0x434e46=_0x271490[_0x05ab('0x59')]({'plain':!![]});return db[_0x05ab('0x99')][_0x05ab('0x9a')](createExtensionsReciveFax(_0x434e46),{'transaction':_0xd36d23});});})['then'](function(){return _0x434e46;})[_0x05ab('0x20')](respondWithResult(_0x357b93,null))[_0x05ab('0x28')](handleError(_0x357b93,null));};exports[_0x05ab('0x9b')]=function(_0x510b72,_0x4e9a59,_0x41befe){var _0x4281c4;return db[_0x05ab('0x7a')][_0x05ab('0x79')](function(_0x11bf34){return db[_0x05ab('0x4e')]['update'](_0x510b72[_0x05ab('0x57')],{'where':{'id':_0x510b72[_0x05ab('0x57')]['id']},'transaction':_0x11bf34})[_0x05ab('0x20')](function(_0x159d07){return db[_0x05ab('0x99')][_0x05ab('0x35')]({'where':{'FaxAccountId':_0x510b72[_0x05ab('0x57')]['id']},'transaction':_0x11bf34})[_0x05ab('0x20')](function(_0xe00eff){return db['VoiceExtension'][_0x05ab('0x9a')](createExtensionsReciveFax(_[_0x05ab('0x6d')](_0x510b72['body'],[_0x05ab('0x9c'),_0x05ab('0x9d'),_0x05ab('0x9e'),_0x05ab('0x9f'),_0x05ab('0xa0'),_0x05ab('0xa1')])),{'transaction':_0x11bf34});});});})['then'](function(){return db[_0x05ab('0x4e')][_0x05ab('0xa2')](_0x510b72[_0x05ab('0x57')]['id']);})[_0x05ab('0x20')](respondWithResult(_0x4e9a59,null))[_0x05ab('0x28')](handleError(_0x4e9a59,null));};exports[_0x05ab('0xa3')]=function(_0xffb692,_0x56cd88,_0x46f613){var _0x52b5b6={'raw':!![],'where':{}};var _0x2c07bb={};var _0x590057={'count':0x0,'rows':[]};return db[_0x05ab('0x4e')]['findOne']({'where':{'id':_0xffb692[_0x05ab('0x52')]['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x56cd88,null))[_0x05ab('0x20')](function(_0x1b8986){if(_0x1b8986){_0x2c07bb[_0x05ab('0x42')]=_['keys'](db[_0x05ab('0xa4')][_0x05ab('0x3c')]);_0x2c07bb['query']=_['keys'](_0xffb692['query']);_0x2c07bb[_0x05ab('0x48')]=_[_0x05ab('0x40')](_0x2c07bb[_0x05ab('0x42')],_0x2c07bb[_0x05ab('0x3f')]);_0x52b5b6[_0x05ab('0x41')]=_[_0x05ab('0x40')](_0x2c07bb['model'],qs[_0x05ab('0x43')](_0xffb692[_0x05ab('0x3f')][_0x05ab('0x43')]));_0x52b5b6[_0x05ab('0x41')]=_0x52b5b6[_0x05ab('0x41')][_0x05ab('0x54')]?_0x52b5b6[_0x05ab('0x41')]:_0x2c07bb[_0x05ab('0x42')];if(!_0xffb692[_0x05ab('0x3f')][_0x05ab('0x63')](_0x05ab('0x44'))){_0x52b5b6[_0x05ab('0x2f')]=qs[_0x05ab('0x2f')](_0xffb692[_0x05ab('0x3f')][_0x05ab('0x2f')]);_0x52b5b6[_0x05ab('0x2d')]=qs['offset'](_0xffb692[_0x05ab('0x3f')][_0x05ab('0x2d')]);}_0x52b5b6[_0x05ab('0x45')]=qs[_0x05ab('0x46')](_0xffb692[_0x05ab('0x3f')][_0x05ab('0x46')]);_0x52b5b6[_0x05ab('0x49')]=qs[_0x05ab('0x48')](_[_0x05ab('0x47')](_0xffb692['query'],_0x2c07bb['filters']));_0x52b5b6[_0x05ab('0x49')][_0x05ab('0x60')]=_0x1b8986['id'];if(_0xffb692[_0x05ab('0x3f')][_0x05ab('0x4c')]){_0x52b5b6[_0x05ab('0x49')]=_['merge'](_0x52b5b6[_0x05ab('0x49')],{'$or':_[_0x05ab('0x3b')](_0x52b5b6[_0x05ab('0x41')],function(_0x3d713a){var _0x388545={};_0x388545[_0x3d713a]={'$like':'%'+_0xffb692['query'][_0x05ab('0x4c')]+'%'};return _0x388545;})});}if(_0xffb692['query']['$gte']){var _0x1c0355=_0xffb692[_0x05ab('0x3f')]['$gte'][_0x05ab('0xa5')](',');var _0x295bfc={};_0x295bfc[_0x1c0355[0x0]]={'$gte':moment(_0x1c0355[0x1])[_0x05ab('0xa6')](_0x05ab('0xa7'))};_0x52b5b6['where']=_['merge'](_0x52b5b6[_0x05ab('0x49')],_0x295bfc);}_0x52b5b6=_['merge']({},_0x52b5b6,_0xffb692['options']);return db[_0x05ab('0xa4')][_0x05ab('0x30')]({'where':_0x52b5b6[_0x05ab('0x49')]})[_0x05ab('0x20')](function(_0x2fa61b){_0x590057[_0x05ab('0x30')]=_0x2fa61b;if(_0xffb692[_0x05ab('0x3f')][_0x05ab('0x4f')]){_0x52b5b6[_0x05ab('0x50')]=[{'all':!![]}];}return db[_0x05ab('0xa4')][_0x05ab('0x64')](_0x52b5b6);})['then'](function(_0x11b428){_0x590057[_0x05ab('0x65')]=_0x11b428;return _0x590057;});}})[_0x05ab('0x20')](respondWithFilteredResult(_0x56cd88,_0x52b5b6))[_0x05ab('0x28')](handleError(_0x56cd88,null));};exports[_0x05ab('0x81')]=function(_0x20c7f8,_0x35ad4f,_0x5acc39){var _0x278559,_0x3ae099={},_0x2b62bb;if(_0x20c7f8[_0x05ab('0x57')]['to']){_0x2b62bb=_0x20c7f8['body']['to'][0x0];}return db[_0x05ab('0x4e')][_0x05ab('0x55')]({'where':{'id':_0x20c7f8[_0x05ab('0x52')]['id']},'include':[{'model':db[_0x05ab('0xa8')],'as':_0x05ab('0xa9'),'include':[{'model':db[_0x05ab('0x6f')],'as':_0x05ab('0xaa'),'where':{'fax':_0x2b62bb},'limit':0x1,'order':[['updatedAt',_0x05ab('0xab')]]}]}]})[_0x05ab('0x20')](handleEntityNotFound(_0x35ad4f,null))['then'](function(_0x3001f9){_0x278559=_0x3001f9;if(_0x20c7f8['body'][_0x05ab('0xac')]&&_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][_0x05ab('0x54')]){for(var _0x3e1b3d=0x0;_0x3e1b3d<_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][_0x05ab('0x54')];_0x3e1b3d+=0x1){_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][_0x3e1b3d]={'filename':_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][_0x3e1b3d][_0x05ab('0x38')],'id':_0x20c7f8[_0x05ab('0x57')]['attachments'][_0x3e1b3d]['id'],'path':path[_0x05ab('0xad')](config[_0x05ab('0xae')],_0x05ab('0xaf'),_0x20c7f8['body'][_0x05ab('0xac')][_0x3e1b3d][_0x05ab('0xb0')])};}}return respondWithRpcPromise(_0x05ab('0xb1'),_0x05ab('0xb1'),{'FaxAccountId':_['isNil'](_0x20c7f8[_0x05ab('0x52')]['id'])?undefined:_0x20c7f8[_0x05ab('0x52')]['id'],'path':_[_0x05ab('0xb2')](_0x20c7f8['body'][_0x05ab('0xac')][0x0][_0x05ab('0xb3')])?undefined:_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][0x0]['path'],'fax':_[_0x05ab('0xb2')](_0x20c7f8[_0x05ab('0x57')]['to'][0x0])?undefined:_0x20c7f8[_0x05ab('0x57')]['to'][0x0]},client9002);})[_0x05ab('0x20')](function(){if(_0x278559){if(_[_0x05ab('0xb2')](_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xb4')])){_0x20c7f8[_0x05ab('0x57')]['from']=util[_0x05ab('0xa6')](_0x05ab('0xb5'),_0x278559[_0x05ab('0x38')],_0x278559[_0x05ab('0xb6')]);}if(_0x278559['List']){if(_0x278559[_0x05ab('0xa9')][_0x05ab('0xaa')][_0x05ab('0x54')]){return _0x278559[_0x05ab('0xa9')][_0x05ab('0xaa')][0x0];}else{return db[_0x05ab('0x6f')][_0x05ab('0x56')](_[_0x05ab('0x1a')](_0x20c7f8['body'],{'firstName':_0x20c7f8['body']['to'][0x0],'phone':_0x20c7f8[_0x05ab('0x57')]['to'][0x0],'fax':_0x20c7f8[_0x05ab('0x57')]['to'][0x0],'ListId':_0x278559[_0x05ab('0xa1')]}));}}else{throw new Error(_0x05ab('0xb7'));}}else{throw new Error(_0x05ab('0xb8'));}})[_0x05ab('0x20')](function(_0x581642){if(_0x581642){return db['FaxInteraction']['find']({'where':{'ContactId':_0x581642['id'],'closed':![],'FaxAccountId':_0x278559['id']}})['then'](function(_0x1a1897){if(_0x1a1897){return[_0x1a1897,![]];}return db['FaxInteraction'][_0x05ab('0x56')]({'UserId':_0x20c7f8[_0x05ab('0x58')]['id'],'ContactId':_0x581642['id'],'FaxAccountId':_0x278559['id'],'fax':_0x20c7f8[_0x05ab('0x57')]['to'][0x0],'firstMsgDirection':_0x05ab('0xb9'),'Messages':[_[_0x05ab('0x4a')](_0x20c7f8[_0x05ab('0x57')],{'read':![],'body':_0x20c7f8[_0x05ab('0x57')]['attachments'][0x0][_0x05ab('0xba')],'FaxAccountId':_0x278559['id'],'UserId':_0x20c7f8[_0x05ab('0x58')]['id'],'ContactId':_0x581642['id'],'AttachmentId':_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x05ab('0xa4')],'as':_0x05ab('0xbb')}]})[_0x05ab('0x20')](function(_0x1f49b8){return[_0x1f49b8,!![]];});});}else{throw new Error(_0x05ab('0xbc'));}})[_0x05ab('0xbd')](function(_0x44515d,_0xca9391){if(_0xca9391){return _0x44515d;}return db[_0x05ab('0xa4')][_0x05ab('0x56')]({'direction':_0x05ab('0xb9'),'read':![],'body':_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][0x0][_0x05ab('0xba')],'FaxAccountId':_0x278559['id'],'FaxInteractionId':_0x44515d['id'],'UserId':_0x20c7f8[_0x05ab('0x58')]['id'],'ContactId':_0x44515d[_0x05ab('0xbe')],'AttachmentId':_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][0x0]['id']})[_0x05ab('0x20')](function(_0x26ddf2){_0x44515d[_0x05ab('0xbf')]['Messages']=[];_0x44515d[_0x05ab('0xbf')][_0x05ab('0xbb')][_0x05ab('0x89')](_0x26ddf2[_0x05ab('0xbf')]);return _0x44515d;});})['then'](function(_0x225346){respondWithRpcPromise(_0x05ab('0xc0'),'SendFax',{'FaxAccountId':_['isNil'](_0x20c7f8[_0x05ab('0x52')]['id'])?undefined:_0x20c7f8['params']['id'],'path':_[_0x05ab('0xb2')](_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][0x0][_0x05ab('0xb3')])?undefined:_0x20c7f8[_0x05ab('0x57')][_0x05ab('0xac')][0x0][_0x05ab('0xb3')],'fax':_[_0x05ab('0xb2')](_0x20c7f8['body']['to'][0x0])?undefined:_0x20c7f8[_0x05ab('0x57')]['to'][0x0],'AttachmentId':_0x20c7f8['body'][_0x05ab('0xac')][0x0]['id']},client9002)[_0x05ab('0x20')](function(_0x5450e5){logger[_0x05ab('0xc1')](_0x05ab('0xc2'),_0x5450e5);})[_0x05ab('0x28')](function(_0x56fa2f){logger[_0x05ab('0xc1')](_0x05ab('0xc2'),_0x56fa2f);});return _0x225346;})['then'](respondWithResult(_0x35ad4f,null))[_0x05ab('0x28')](handleError(_0x35ad4f,null));};exports[_0x05ab('0xc3')]=function(_0x32f03d,_0x4b75aa,_0x4cd9c7){return db['FaxAccount'][_0x05ab('0x55')]({'where':{'id':_0x32f03d[_0x05ab('0x52')]['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x4b75aa,null))[_0x05ab('0x20')](function(_0x202c2e){if(_0x202c2e){return _0x202c2e[_0x05ab('0xc3')](_0x32f03d[_0x05ab('0x57')][_0x05ab('0x67')],_[_0x05ab('0x6d')](_0x32f03d[_0x05ab('0x57')],['ids','id'])||{})[_0x05ab('0xbd')](function(_0x58aa32){for(var _0x40f5e4=0x0;_0x40f5e4<_0x32f03d[_0x05ab('0x57')][_0x05ab('0x67')][_0x05ab('0x54')];_0x40f5e4+=0x1){socket['emit'](_0x05ab('0xc4'),{'UserId':Number(_0x32f03d['body'][_0x05ab('0x67')][_0x40f5e4]),'FaxAccountId':Number(_0x32f03d['params']['id'])});}return _0x58aa32;});}})[_0x05ab('0x20')](respondWithResult(_0x4b75aa,null))[_0x05ab('0x28')](handleError(_0x4b75aa,null));};exports['removeAgents']=function(_0x4b0f94,_0xa6f269,_0x43d590){return db[_0x05ab('0x4e')][_0x05ab('0x55')]({'where':{'id':_0x4b0f94['params']['id']}})['then'](handleEntityNotFound(_0xa6f269,null))[_0x05ab('0x20')](function(_0x47824a){if(_0x47824a){return _0x47824a[_0x05ab('0xc5')](_0x4b0f94['query'][_0x05ab('0x67')])[_0x05ab('0x20')](function(){if(_[_0x05ab('0xc6')](_0x4b0f94[_0x05ab('0x3f')][_0x05ab('0x67')])){for(var _0x5f33be=0x0;_0x5f33be<_0x4b0f94[_0x05ab('0x3f')][_0x05ab('0x67')][_0x05ab('0x54')];_0x5f33be+=0x1){socket[_0x05ab('0xc7')]('userFaxAccount:remove',{'UserId':Number(_0x4b0f94[_0x05ab('0x3f')][_0x05ab('0x67')][_0x5f33be]),'FaxAccountId':Number(_0x4b0f94[_0x05ab('0x52')]['id'])});}}else{socket[_0x05ab('0xc7')](_0x05ab('0xc8'),{'UserId':Number(_0x4b0f94[_0x05ab('0x3f')][_0x05ab('0x67')]),'FaxAccountId':Number(_0x4b0f94[_0x05ab('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0xa6f269,null))[_0x05ab('0x28')](handleError(_0xa6f269,null));};exports[_0x05ab('0xc9')]=function(_0x3ce411,_0x2e58b0,_0x5432a8){var _0x4ef290={};var _0x52a46a={};var _0x1e83eb;var _0x45f95a;return db[_0x05ab('0x4e')][_0x05ab('0x62')]({'where':{'id':_0x3ce411[_0x05ab('0x52')]['id']}})[_0x05ab('0x20')](handleEntityNotFound(_0x2e58b0,null))['then'](function(_0x51e019){if(_0x51e019){_0x1e83eb=_0x51e019;_0x52a46a[_0x05ab('0x42')]=_['keys'](db['User'][_0x05ab('0x3c')]);_0x52a46a[_0x05ab('0x3f')]=_[_0x05ab('0x53')](_0x3ce411['query']);_0x52a46a[_0x05ab('0x48')]=_[_0x05ab('0x40')](_0x52a46a[_0x05ab('0x42')],_0x52a46a[_0x05ab('0x3f')]);_0x4ef290['attributes']=_[_0x05ab('0x40')](_0x52a46a[_0x05ab('0x42')],qs[_0x05ab('0x43')](_0x3ce411['query'][_0x05ab('0x43')]));_0x4ef290[_0x05ab('0x41')]=_0x4ef290[_0x05ab('0x41')][_0x05ab('0x54')]?_0x4ef290[_0x05ab('0x41')]:_0x52a46a[_0x05ab('0x42')];_0x4ef290[_0x05ab('0x45')]=qs[_0x05ab('0x46')](_0x3ce411['query'][_0x05ab('0x46')]);_0x4ef290[_0x05ab('0x49')]=qs[_0x05ab('0x48')](_[_0x05ab('0x47')](_0x3ce411[_0x05ab('0x3f')],_0x52a46a[_0x05ab('0x48')]));if(_0x3ce411[_0x05ab('0x3f')][_0x05ab('0x4c')]){_0x4ef290[_0x05ab('0x49')]=_[_0x05ab('0x4a')](_0x4ef290[_0x05ab('0x49')],{'$or':_[_0x05ab('0x3b')](_0x4ef290[_0x05ab('0x41')],function(_0x56858b){var _0x3236b4={};_0x3236b4[_0x56858b]={'$like':'%'+_0x3ce411[_0x05ab('0x3f')][_0x05ab('0x4c')]+'%'};return _0x3236b4;})});}_0x4ef290=_[_0x05ab('0x4a')]({},_0x4ef290,_0x3ce411[_0x05ab('0x4d')]);return _0x1e83eb[_0x05ab('0xc9')](_0x4ef290);}})[_0x05ab('0x20')](function(_0xea9a32){if(_0xea9a32){_0x45f95a=_0xea9a32['length'];if(!_0x3ce411[_0x05ab('0x3f')][_0x05ab('0x63')](_0x05ab('0x44'))){_0x4ef290['limit']=qs['limit'](_0x3ce411[_0x05ab('0x3f')][_0x05ab('0x2f')]);_0x4ef290[_0x05ab('0x2d')]=qs[_0x05ab('0x2d')](_0x3ce411[_0x05ab('0x3f')][_0x05ab('0x2d')]);}return _0x1e83eb['getAgents'](_0x4ef290);}})[_0x05ab('0x20')](function(_0x35d5b1){if(_0x35d5b1){return _0x35d5b1?{'count':_0x45f95a,'rows':_0x35d5b1}:null;}})['then'](respondWithResult(_0x2e58b0,null))['catch'](handleError(_0x2e58b0,null));};
\ No newline at end of file
+var _0x7bdb=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','CannedAnswer','removeAnswers','ids','FaxInteraction','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','send','json','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/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','updateAccountApplications','tech','updatedAt','TrunkId','findById','getMessages','$gte','split','format','FaxMessage','List','CmContact','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','Contacts','ListId','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','offset','undefined','count','limit','status','set','Content-Range','apply','save','destroy','end','stack','name','index','Pause','map','FaxAccount','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','includeAll','include','show','params','keys','rawAttributes','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts'];(function(_0x96687b,_0x104ca5){var _0x2ccb17=function(_0x43f4d7){while(--_0x43f4d7){_0x96687b['push'](_0x96687b['shift']());}};_0x2ccb17(++_0x104ca5);}(_0x7bdb,0x69));var _0xb7bd=function(_0xbbd83d,_0xfbe6f0){_0xbbd83d=_0xbbd83d-0x0;var _0x19cb4a=_0x7bdb[_0xbbd83d];return _0x19cb4a;};'use strict';var emlformat=require(_0xb7bd('0x0'));var rimraf=require(_0xb7bd('0x1'));var zipdir=require(_0xb7bd('0x2'));var jsonpatch=require(_0xb7bd('0x3'));var rp=require(_0xb7bd('0x4'));var moment=require(_0xb7bd('0x5'));var BPromise=require(_0xb7bd('0x6'));var Mustache=require('mustache');var util=require(_0xb7bd('0x7'));var path=require('path');var sox=require(_0xb7bd('0x8'));var csv=require(_0xb7bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb7bd('0xa'));var squel=require(_0xb7bd('0xb'));var crypto=require(_0xb7bd('0xc'));var jsforce=require(_0xb7bd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb7bd('0x9'));var querystring=require(_0xb7bd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb7bd('0xf'));var qs=require(_0xb7bd('0x10'));var as=require(_0xb7bd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb7bd('0x12'));var utils=require('../../config/utils');var config=require(_0xb7bd('0x13'));var licenseUtil=require(_0xb7bd('0x14'));var db=require(_0xb7bd('0x15'))['db'];config[_0xb7bd('0x16')]=_[_0xb7bd('0x17')](config[_0xb7bd('0x16')],{'host':_0xb7bd('0x18'),'port':0x18eb});var socket=require(_0xb7bd('0x19'))(new Redis(config['redis']));require(_0xb7bd('0x1a'))[_0xb7bd('0x1b')](socket);var jayson=require(_0xb7bd('0x1c'));var client=jayson['client'][_0xb7bd('0x1d')]({'port':0x232c});var client9002=jayson[_0xb7bd('0x1e')][_0xb7bd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x657d49,_0x26cc2d,_0x31b043,_0x40dfb1){return new BPromise(function(_0x46c26e,_0x4fa4c1){var _0x7da6c0=_0x40dfb1||client;return _0x7da6c0[_0xb7bd('0x1f')](_0x657d49,_0x31b043)[_0xb7bd('0x20')](function(_0x1917d5){logger['info'](_0xb7bd('0x21'),_0x26cc2d,_0xb7bd('0x22'));logger[_0xb7bd('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x26cc2d,'request\x20sent',JSON[_0xb7bd('0x24')](_0x1917d5));if(_0x1917d5[_0xb7bd('0x25')]){if(_0x1917d5[_0xb7bd('0x25')][_0xb7bd('0x26')]===0x1f4){logger[_0xb7bd('0x25')](_0xb7bd('0x21'),_0x26cc2d,_0x1917d5['error'][_0xb7bd('0x27')]);return _0x4fa4c1(_0x1917d5['error'][_0xb7bd('0x27')]);}logger[_0xb7bd('0x25')](_0xb7bd('0x21'),_0x26cc2d,_0x1917d5[_0xb7bd('0x25')]['message']);return _0x46c26e(_0x1917d5[_0xb7bd('0x25')][_0xb7bd('0x27')]);}else{logger[_0xb7bd('0x28')]('FaxAccount,\x20%s,\x20%s',_0x26cc2d,_0xb7bd('0x22'));_0x46c26e(_0x1917d5[_0xb7bd('0x29')][_0xb7bd('0x27')]);}})[_0xb7bd('0x2a')](function(_0x9e7e7){logger['error'](_0xb7bd('0x21'),_0x26cc2d,_0x9e7e7);_0x4fa4c1(_0x9e7e7);});});}function respondWithStatusCode(_0x15d9a1,_0x279b5c){_0x279b5c=_0x279b5c||0xcc;return function(_0x50222c){if(_0x50222c){return _0x15d9a1[_0xb7bd('0x2b')](_0x279b5c);}return _0x15d9a1['status'](_0x279b5c)['end']();};}function respondWithResult(_0x5241b7,_0x32fba5){_0x32fba5=_0x32fba5||0xc8;return function(_0x2710be){if(_0x2710be){return _0x5241b7['status'](_0x32fba5)['json'](_0x2710be);}};}function respondWithFilteredResult(_0x4001bb,_0x2f0bef){return function(_0x507730){if(_0x507730){var _0xc96459=typeof _0x2f0bef[_0xb7bd('0x2c')]===_0xb7bd('0x2d')&&typeof _0x2f0bef['limit']===_0xb7bd('0x2d');var _0x3f0e82=_0x507730['count'];var _0xdf3cf=_0xc96459?0x0:_0x2f0bef[_0xb7bd('0x2c')];var _0x489ae1=_0xc96459?_0x507730[_0xb7bd('0x2e')]:_0x2f0bef[_0xb7bd('0x2c')]+_0x2f0bef[_0xb7bd('0x2f')];var _0x5d09b4;if(_0x489ae1>=_0x3f0e82){_0x489ae1=_0x3f0e82;_0x5d09b4=0xc8;}else{_0x5d09b4=0xce;}_0x4001bb[_0xb7bd('0x30')](_0x5d09b4);return _0x4001bb[_0xb7bd('0x31')](_0xb7bd('0x32'),_0xdf3cf+'-'+_0x489ae1+'/'+_0x3f0e82)['json'](_0x507730);}return null;};}function patchUpdates(_0x2f8190){return function(_0x30c7a5){try{jsonpatch[_0xb7bd('0x33')](_0x30c7a5,_0x2f8190,!![]);}catch(_0x20955b){return BPromise['reject'](_0x20955b);}return _0x30c7a5[_0xb7bd('0x34')]();};}function saveUpdates(_0x1469e0,_0x5e29cd){return function(_0x1f14d7){if(_0x1f14d7){return _0x1f14d7['update'](_0x1469e0)['then'](function(_0xfeeec7){return _0xfeeec7;});}return null;};}function removeEntity(_0x52c166,_0x78efc7){return function(_0x1f50b6){if(_0x1f50b6){return _0x1f50b6[_0xb7bd('0x35')]()[_0xb7bd('0x20')](function(){var _0x7c5df2=_0x1f50b6['get']({'plain':!![]});var _0x534d8a='FaxAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x534d8a,'resourceId':_0x7c5df2['id']}})[_0xb7bd('0x20')](function(){return _0x1f50b6;});})[_0xb7bd('0x20')](function(){_0x52c166[_0xb7bd('0x30')](0xcc)[_0xb7bd('0x36')]();});}};}function handleEntityNotFound(_0x1f19ff,_0x7e8b58){return function(_0x478a0c){if(!_0x478a0c){_0x1f19ff[_0xb7bd('0x2b')](0x194);}return _0x478a0c;};}function handleError(_0x31e4fd,_0x44c0bc){_0x44c0bc=_0x44c0bc||0x1f4;return function(_0x3dc838){logger[_0xb7bd('0x25')](_0x3dc838[_0xb7bd('0x37')]);if(_0x3dc838['name']){delete _0x3dc838[_0xb7bd('0x38')];}_0x31e4fd[_0xb7bd('0x30')](_0x44c0bc)['send'](_0x3dc838);};}exports[_0xb7bd('0x39')]=function(_0x16b9f6,_0x38ff53){var _0x20c4fd={'include':[{'model':db[_0xb7bd('0x3a')],'as':'mandatoryDispositionPause'}]},_0xebdb72={},_0x49c582={'count':0x0,'rows':[]};var _0x45a43f=_[_0xb7bd('0x3b')](db[_0xb7bd('0x3c')]['rawAttributes'],function(_0x4890bc){return{'name':_0x4890bc['fieldName'],'type':_0x4890bc['type'][_0xb7bd('0x3d')]};});_0xebdb72[_0xb7bd('0x3e')]=_[_0xb7bd('0x3b')](_0x45a43f,'name');_0xebdb72[_0xb7bd('0x3f')]=_['keys'](_0x16b9f6['query']);_0xebdb72[_0xb7bd('0x40')]=_[_0xb7bd('0x41')](_0xebdb72[_0xb7bd('0x3e')],_0xebdb72[_0xb7bd('0x3f')]);_0x20c4fd['attributes']=_[_0xb7bd('0x41')](_0xebdb72[_0xb7bd('0x3e')],qs[_0xb7bd('0x42')](_0x16b9f6[_0xb7bd('0x3f')]['fields']));_0x20c4fd['attributes']=_0x20c4fd['attributes'][_0xb7bd('0x43')]?_0x20c4fd[_0xb7bd('0x44')]:_0xebdb72[_0xb7bd('0x3e')];if(!_0x16b9f6[_0xb7bd('0x3f')][_0xb7bd('0x45')](_0xb7bd('0x46'))){_0x20c4fd[_0xb7bd('0x2f')]=qs[_0xb7bd('0x2f')](_0x16b9f6[_0xb7bd('0x3f')][_0xb7bd('0x2f')]);_0x20c4fd['offset']=qs[_0xb7bd('0x2c')](_0x16b9f6[_0xb7bd('0x3f')][_0xb7bd('0x2c')]);}_0x20c4fd[_0xb7bd('0x47')]=qs[_0xb7bd('0x48')](_0x16b9f6[_0xb7bd('0x3f')][_0xb7bd('0x48')]);_0x20c4fd[_0xb7bd('0x49')]=qs[_0xb7bd('0x40')](_[_0xb7bd('0x4a')](_0x16b9f6[_0xb7bd('0x3f')],_0xebdb72[_0xb7bd('0x40')]),_0x45a43f);if(_0x16b9f6[_0xb7bd('0x3f')][_0xb7bd('0x4b')]){_0x20c4fd[_0xb7bd('0x49')]=_['merge'](_0x20c4fd[_0xb7bd('0x49')],{'$or':_['map'](_0x45a43f,function(_0x153068){if(_0x153068[_0xb7bd('0x4c')]!=='VIRTUAL'){var _0x49ed36={};_0x49ed36[_0x153068[_0xb7bd('0x38')]]={'$like':'%'+_0x16b9f6[_0xb7bd('0x3f')][_0xb7bd('0x4b')]+'%'};return _0x49ed36;}})});}_0x20c4fd=_[_0xb7bd('0x4d')]({},_0x20c4fd,_0x16b9f6['options']);var _0x2408ab={'where':_0x20c4fd[_0xb7bd('0x49')]};return db[_0xb7bd('0x3c')][_0xb7bd('0x2e')](_0x2408ab)[_0xb7bd('0x20')](function(_0x399c47){_0x49c582['count']=_0x399c47;if(_0x16b9f6[_0xb7bd('0x3f')][_0xb7bd('0x4e')]){_0x20c4fd[_0xb7bd('0x4f')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x20c4fd);})[_0xb7bd('0x20')](function(_0x443956){_0x49c582['rows']=_0x443956;return _0x49c582;})['then'](respondWithFilteredResult(_0x38ff53,_0x20c4fd))[_0xb7bd('0x2a')](handleError(_0x38ff53,null));};exports[_0xb7bd('0x50')]=function(_0x3547b4,_0x4588da){var _0x4041c2={'raw':![],'where':{'id':_0x3547b4[_0xb7bd('0x51')]['id']},'include':[{'model':db[_0xb7bd('0x3a')],'as':'mandatoryDispositionPause'}]},_0x3e1691={};_0x3e1691[_0xb7bd('0x3e')]=_[_0xb7bd('0x52')](db[_0xb7bd('0x3c')][_0xb7bd('0x53')]);_0x3e1691[_0xb7bd('0x3f')]=_['keys'](_0x3547b4[_0xb7bd('0x3f')]);_0x3e1691[_0xb7bd('0x40')]=_[_0xb7bd('0x41')](_0x3e1691[_0xb7bd('0x3e')],_0x3e1691[_0xb7bd('0x3f')]);_0x4041c2[_0xb7bd('0x44')]=_[_0xb7bd('0x41')](_0x3e1691[_0xb7bd('0x3e')],qs['fields'](_0x3547b4['query']['fields']));_0x4041c2[_0xb7bd('0x44')]=_0x4041c2['attributes'][_0xb7bd('0x43')]?_0x4041c2[_0xb7bd('0x44')]:_0x3e1691[_0xb7bd('0x3e')];if(_0x3547b4[_0xb7bd('0x3f')][_0xb7bd('0x4e')]){_0x4041c2[_0xb7bd('0x4f')]=[{'all':!![]}];}_0x4041c2=_[_0xb7bd('0x4d')]({},_0x4041c2,_0x3547b4[_0xb7bd('0x54')]);return db['FaxAccount'][_0xb7bd('0x55')](_0x4041c2)[_0xb7bd('0x20')](handleEntityNotFound(_0x4588da,null))['then'](respondWithResult(_0x4588da,null))[_0xb7bd('0x2a')](handleError(_0x4588da,null));};exports['create']=function(_0x4adabc,_0x2a4636){return db[_0xb7bd('0x3c')][_0xb7bd('0x56')](_0x4adabc['body'],{})['then'](function(_0x42e0ca){var _0x12c16a=_0x4adabc[_0xb7bd('0x57')][_0xb7bd('0x58')]({'plain':!![]});if(!_0x12c16a)throw new Error(_0xb7bd('0x59'));if(_0x12c16a[_0xb7bd('0x5a')]===_0xb7bd('0x57')){var _0xfc7f9=_0x42e0ca[_0xb7bd('0x58')]({'plain':!![]});var _0x5b293e=_0xb7bd('0x5b');return db[_0xb7bd('0x5c')]['find']({'where':{'name':_0x5b293e,'userProfileId':_0x12c16a[_0xb7bd('0x5d')]},'raw':!![]})['then'](function(_0x4323de){if(_0x4323de&&_0x4323de[_0xb7bd('0x5e')]===0x0){return db['UserProfileResource'][_0xb7bd('0x56')]({'name':_0xfc7f9['name'],'resourceId':_0xfc7f9['id'],'type':_0x4323de['name'],'sectionId':_0x4323de['id']},{})[_0xb7bd('0x20')](function(){return _0x42e0ca;});}else{return _0x42e0ca;}})[_0xb7bd('0x2a')](function(_0x3fc5b1){logger[_0xb7bd('0x25')](_0xb7bd('0x5f'),_0x3fc5b1);throw _0x3fc5b1;});}return _0x42e0ca;})[_0xb7bd('0x20')](respondWithResult(_0x2a4636,0xc9))[_0xb7bd('0x2a')](handleError(_0x2a4636,null));};exports[_0xb7bd('0x60')]=function(_0x2e07ba,_0x2adc7c){if(_0x2e07ba[_0xb7bd('0x61')]['id']){delete _0x2e07ba[_0xb7bd('0x61')]['id'];}return db[_0xb7bd('0x3c')]['find']({'where':{'id':_0x2e07ba[_0xb7bd('0x51')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xb7bd('0x20')](handleEntityNotFound(_0x2adc7c,null))[_0xb7bd('0x20')](saveUpdates(_0x2e07ba['body'],null))[_0xb7bd('0x20')](respondWithResult(_0x2adc7c,null))[_0xb7bd('0x2a')](handleError(_0x2adc7c,null));};exports['destroy']=function(_0x43a787,_0x3044d1){return db['FaxAccount'][_0xb7bd('0x55')]({'where':{'id':_0x43a787[_0xb7bd('0x51')]['id']}})['then'](handleEntityNotFound(_0x3044d1,null))[_0xb7bd('0x20')](removeEntity(_0x3044d1,null))[_0xb7bd('0x2a')](handleError(_0x3044d1,null));};exports[_0xb7bd('0x62')]=function(_0x2b7799,_0x469a05){return db[_0xb7bd('0x3c')][_0xb7bd('0x62')]()['then'](respondWithResult(_0x469a05,null))[_0xb7bd('0x2a')](handleError(_0x469a05,null));};exports[_0xb7bd('0x63')]=function(_0x3f8df7,_0x2fc9d7,_0x5df3d0){if(_0x3f8df7[_0xb7bd('0x61')]['id']){delete _0x3f8df7[_0xb7bd('0x61')]['id'];}return db['FaxAccount'][_0xb7bd('0x55')]({'where':{'id':_0x3f8df7['params']['id']}})['then'](handleEntityNotFound(_0x2fc9d7,null))['then'](function(_0x4fbbc7){if(_0x4fbbc7){_0x3f8df7[_0xb7bd('0x61')][_0xb7bd('0x64')]=_0x4fbbc7['id'];return db[_0xb7bd('0x65')][_0xb7bd('0x56')](_0x3f8df7['body']);}})[_0xb7bd('0x20')](respondWithResult(_0x2fc9d7,null))[_0xb7bd('0x2a')](handleError(_0x2fc9d7,null));};exports[_0xb7bd('0x66')]=function(_0x3042a7,_0x385d0b,_0x2785ba){var _0x5c7de4={'raw':![],'where':{}};var _0x509ab5={};var _0x1a33d6={'count':0x0,'rows':[]};return db[_0xb7bd('0x3c')][_0xb7bd('0x67')]({'where':{'id':_0x3042a7[_0xb7bd('0x51')]['id']}})[_0xb7bd('0x20')](handleEntityNotFound(_0x385d0b,null))['then'](function(_0x1c2733){if(_0x1c2733){_0x509ab5[_0xb7bd('0x3e')]=_['keys'](db[_0xb7bd('0x65')][_0xb7bd('0x53')]);_0x509ab5['query']=_[_0xb7bd('0x52')](_0x3042a7[_0xb7bd('0x3f')]);_0x509ab5[_0xb7bd('0x40')]=_[_0xb7bd('0x41')](_0x509ab5[_0xb7bd('0x3e')],_0x509ab5[_0xb7bd('0x3f')]);_0x5c7de4[_0xb7bd('0x44')]=_['intersection'](_0x509ab5[_0xb7bd('0x3e')],qs['fields'](_0x3042a7[_0xb7bd('0x3f')][_0xb7bd('0x42')]));_0x5c7de4[_0xb7bd('0x44')]=_0x5c7de4[_0xb7bd('0x44')]['length']?_0x5c7de4[_0xb7bd('0x44')]:_0x509ab5[_0xb7bd('0x3e')];if(!_0x3042a7[_0xb7bd('0x3f')][_0xb7bd('0x45')](_0xb7bd('0x46'))){_0x5c7de4['limit']=qs[_0xb7bd('0x2f')](_0x3042a7[_0xb7bd('0x3f')][_0xb7bd('0x2f')]);_0x5c7de4[_0xb7bd('0x2c')]=qs[_0xb7bd('0x2c')](_0x3042a7[_0xb7bd('0x3f')][_0xb7bd('0x2c')]);}_0x5c7de4[_0xb7bd('0x47')]=qs['sort'](_0x3042a7['query'][_0xb7bd('0x48')]);_0x5c7de4[_0xb7bd('0x49')]=qs[_0xb7bd('0x40')](_['pick'](_0x3042a7[_0xb7bd('0x3f')],_0x509ab5[_0xb7bd('0x40')]));_0x5c7de4[_0xb7bd('0x49')][_0xb7bd('0x64')]=_0x1c2733['id'];if(_0x3042a7[_0xb7bd('0x3f')][_0xb7bd('0x4b')]){_0x5c7de4[_0xb7bd('0x49')]=_[_0xb7bd('0x4d')](_0x5c7de4[_0xb7bd('0x49')],{'$or':_[_0xb7bd('0x3b')](_0x5c7de4[_0xb7bd('0x44')],function(_0x5861bd){var _0x311b92={};_0x311b92[_0x5861bd]={'$like':'%'+_0x3042a7[_0xb7bd('0x3f')][_0xb7bd('0x4b')]+'%'};return _0x311b92;})});}_0x5c7de4=_[_0xb7bd('0x4d')]({},_0x5c7de4,_0x3042a7['options']);return db[_0xb7bd('0x65')][_0xb7bd('0x2e')]({'where':_0x5c7de4[_0xb7bd('0x49')]})[_0xb7bd('0x20')](function(_0xb437fc){_0x1a33d6[_0xb7bd('0x2e')]=_0xb437fc;if(_0x3042a7[_0xb7bd('0x3f')][_0xb7bd('0x4e')]){_0x5c7de4[_0xb7bd('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0xb7bd('0x68')](_0x5c7de4);})[_0xb7bd('0x20')](function(_0x93f582){_0x1a33d6[_0xb7bd('0x69')]=_0x93f582;return _0x1a33d6;});}})[_0xb7bd('0x20')](respondWithFilteredResult(_0x385d0b,_0x5c7de4))[_0xb7bd('0x2a')](handleError(_0x385d0b,null));};exports[_0xb7bd('0x6a')]=function(_0x2ddde2,_0x164ade,_0x50c82f){return db[_0xb7bd('0x3c')]['find']({'where':{'id':_0x2ddde2[_0xb7bd('0x51')]['id']}})[_0xb7bd('0x20')](handleEntityNotFound(_0x164ade,null))[_0xb7bd('0x20')](function(_0x353289){if(_0x353289){return _0x353289[_0xb7bd('0x6a')](_0x2ddde2['query']['ids']);}})[_0xb7bd('0x20')](respondWithStatusCode(_0x164ade,null))[_0xb7bd('0x2a')](handleError(_0x164ade,null));};exports['addAnswer']=function(_0x5edf22,_0x4979f8,_0x2e395e){if(_0x5edf22[_0xb7bd('0x61')]['id']){delete _0x5edf22[_0xb7bd('0x61')]['id'];}return db[_0xb7bd('0x3c')][_0xb7bd('0x55')]({'where':{'id':_0x5edf22[_0xb7bd('0x51')]['id']}})['then'](handleEntityNotFound(_0x4979f8,null))[_0xb7bd('0x20')](function(_0x440680){if(_0x440680){_0x5edf22[_0xb7bd('0x61')]['FaxAccountId']=_0x440680['id'];return db['CannedAnswer'][_0xb7bd('0x56')](_0x5edf22[_0xb7bd('0x61')]);}})[_0xb7bd('0x20')](respondWithResult(_0x4979f8,null))[_0xb7bd('0x2a')](handleError(_0x4979f8,null));};exports['getAnswers']=function(_0x1060f9,_0x524133,_0x4619f3){var _0x2fb9ea={'raw':![],'where':{}};var _0xb03700={};var _0x17ec04={'count':0x0,'rows':[]};return db[_0xb7bd('0x3c')]['findOne']({'where':{'id':_0x1060f9[_0xb7bd('0x51')]['id']}})['then'](handleEntityNotFound(_0x524133,null))[_0xb7bd('0x20')](function(_0x1f1ddf){if(_0x1f1ddf){_0xb03700[_0xb7bd('0x3e')]=_['keys'](db[_0xb7bd('0x6b')][_0xb7bd('0x53')]);_0xb03700[_0xb7bd('0x3f')]=_[_0xb7bd('0x52')](_0x1060f9[_0xb7bd('0x3f')]);_0xb03700['filters']=_[_0xb7bd('0x41')](_0xb03700[_0xb7bd('0x3e')],_0xb03700[_0xb7bd('0x3f')]);_0x2fb9ea['attributes']=_[_0xb7bd('0x41')](_0xb03700[_0xb7bd('0x3e')],qs[_0xb7bd('0x42')](_0x1060f9[_0xb7bd('0x3f')][_0xb7bd('0x42')]));_0x2fb9ea['attributes']=_0x2fb9ea[_0xb7bd('0x44')][_0xb7bd('0x43')]?_0x2fb9ea[_0xb7bd('0x44')]:_0xb03700[_0xb7bd('0x3e')];if(!_0x1060f9['query'][_0xb7bd('0x45')](_0xb7bd('0x46'))){_0x2fb9ea[_0xb7bd('0x2f')]=qs[_0xb7bd('0x2f')](_0x1060f9['query'][_0xb7bd('0x2f')]);_0x2fb9ea[_0xb7bd('0x2c')]=qs[_0xb7bd('0x2c')](_0x1060f9[_0xb7bd('0x3f')][_0xb7bd('0x2c')]);}_0x2fb9ea['order']=qs[_0xb7bd('0x48')](_0x1060f9[_0xb7bd('0x3f')]['sort']);_0x2fb9ea[_0xb7bd('0x49')]=qs[_0xb7bd('0x40')](_[_0xb7bd('0x4a')](_0x1060f9[_0xb7bd('0x3f')],_0xb03700[_0xb7bd('0x40')]));_0x2fb9ea[_0xb7bd('0x49')][_0xb7bd('0x64')]=_0x1f1ddf['id'];if(_0x1060f9[_0xb7bd('0x3f')]['filter']){_0x2fb9ea[_0xb7bd('0x49')]=_['merge'](_0x2fb9ea[_0xb7bd('0x49')],{'$or':_[_0xb7bd('0x3b')](_0x2fb9ea['attributes'],function(_0x1645db){var _0x51955b={};_0x51955b[_0x1645db]={'$like':'%'+_0x1060f9[_0xb7bd('0x3f')][_0xb7bd('0x4b')]+'%'};return _0x51955b;})});}_0x2fb9ea=_[_0xb7bd('0x4d')]({},_0x2fb9ea,_0x1060f9[_0xb7bd('0x54')]);return db[_0xb7bd('0x6b')]['count']({'where':_0x2fb9ea[_0xb7bd('0x49')]})[_0xb7bd('0x20')](function(_0x664000){_0x17ec04[_0xb7bd('0x2e')]=_0x664000;if(_0x1060f9[_0xb7bd('0x3f')]['includeAll']){_0x2fb9ea['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xb7bd('0x68')](_0x2fb9ea);})[_0xb7bd('0x20')](function(_0x49f22a){_0x17ec04['rows']=_0x49f22a;return _0x17ec04;});}})['then'](respondWithFilteredResult(_0x524133,_0x2fb9ea))[_0xb7bd('0x2a')](handleError(_0x524133,null));};exports[_0xb7bd('0x6c')]=function(_0x46adca,_0x548116,_0x14ec59){return db[_0xb7bd('0x3c')][_0xb7bd('0x55')]({'where':{'id':_0x46adca[_0xb7bd('0x51')]['id']}})[_0xb7bd('0x20')](handleEntityNotFound(_0x548116,null))['then'](function(_0x373c3d){if(_0x373c3d){return _0x373c3d[_0xb7bd('0x6c')](_0x46adca['query'][_0xb7bd('0x6d')]);}})['then'](respondWithStatusCode(_0x548116,null))[_0xb7bd('0x2a')](handleError(_0x548116,null));};exports['addInteraction']=function(_0x1dfe4d,_0x4d052a,_0x2a8b5a){return db[_0xb7bd('0x6e')][_0xb7bd('0x55')]({'where':{'id':_0x1dfe4d['params']['id']}})[_0xb7bd('0x20')](handleEntityNotFound(_0x4d052a,null))[_0xb7bd('0x20')](function(_0x2169df){if(_0x2169df){return _0x2169df[_0xb7bd('0x6f')](_0x1dfe4d[_0xb7bd('0x61')]['ids'],_['omit'](_0x1dfe4d[_0xb7bd('0x61')],['ids','id'])||{});}})['then'](respondWithResult(_0x4d052a,null))[_0xb7bd('0x2a')](handleError(_0x4d052a,null));};exports[_0xb7bd('0x70')]=function(_0xf55ec7,_0x5e0fcd,_0x41a0f0){var _0x5425ff={'raw':![],'where':{}};var _0x10f1c1={};var _0x1d5508={'count':0x0,'rows':[]};return db[_0xb7bd('0x3c')][_0xb7bd('0x67')]({'where':{'id':_0xf55ec7[_0xb7bd('0x51')]['id']}})[_0xb7bd('0x20')](handleEntityNotFound(_0x5e0fcd,null))[_0xb7bd('0x20')](function(_0x1d490e){if(_0x1d490e){_0x10f1c1[_0xb7bd('0x3e')]=_[_0xb7bd('0x52')](db['FaxInteraction'][_0xb7bd('0x53')]);_0x10f1c1['query']=_[_0xb7bd('0x52')](_0xf55ec7[_0xb7bd('0x3f')]);_0x10f1c1[_0xb7bd('0x40')]=_['intersection'](_0x10f1c1[_0xb7bd('0x3e')],_0x10f1c1[_0xb7bd('0x3f')]);_0x5425ff[_0xb7bd('0x44')]=_[_0xb7bd('0x41')](_0x10f1c1[_0xb7bd('0x3e')],qs[_0xb7bd('0x42')](_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x42')]));_0x5425ff[_0xb7bd('0x44')]=_0x5425ff[_0xb7bd('0x44')][_0xb7bd('0x43')]?_0x5425ff[_0xb7bd('0x44')]:_0x10f1c1[_0xb7bd('0x3e')];if(!_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x45')](_0xb7bd('0x46'))){_0x5425ff[_0xb7bd('0x2f')]=qs[_0xb7bd('0x2f')](_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x2f')]);_0x5425ff[_0xb7bd('0x2c')]=qs[_0xb7bd('0x2c')](_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x2c')]);}_0x5425ff['order']=qs[_0xb7bd('0x48')](_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x48')]);_0x5425ff[_0xb7bd('0x49')]=qs[_0xb7bd('0x40')](_['pick'](_0xf55ec7[_0xb7bd('0x3f')],_0x10f1c1[_0xb7bd('0x40')]));_0x5425ff[_0xb7bd('0x49')]['FaxAccountId']=_0x1d490e['id'];if(_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x4b')]){_0x5425ff[_0xb7bd('0x49')]=_[_0xb7bd('0x4d')](_0x5425ff[_0xb7bd('0x49')],{'$or':_[_0xb7bd('0x3b')](_0x5425ff[_0xb7bd('0x44')],function(_0x472c27){var _0x4b472a={};_0x4b472a[_0x472c27]={'$like':'%'+_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x4b')]+'%'};return _0x4b472a;})});}_0x5425ff=_[_0xb7bd('0x4d')]({},_0x5425ff,_0xf55ec7['options']);return db[_0xb7bd('0x6e')][_0xb7bd('0x2e')]({'where':_0x5425ff[_0xb7bd('0x49')]})[_0xb7bd('0x20')](function(_0x3020c5){_0x1d5508['count']=_0x3020c5;if(_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x4e')]){_0x5425ff['include']=[{'model':db['CmContact'],'as':_0xb7bd('0x71'),'required':![]},{'model':db[_0xb7bd('0x72')],'as':_0xb7bd('0x73'),'attributes':[_0xb7bd('0x38'),_0xb7bd('0x74'),_0xb7bd('0x75')],'required':![]},{'model':db[_0xb7bd('0x76')],'as':_0xb7bd('0x77'),'attributes':['id','name',_0xb7bd('0x78')],'where':_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x79')]?{'id':_0xf55ec7['query'][_0xb7bd('0x79')]}:undefined,'required':_0xf55ec7[_0xb7bd('0x3f')][_0xb7bd('0x79')]?!![]:![]}];}return db[_0xb7bd('0x6e')][_0xb7bd('0x68')](_0x5425ff);})[_0xb7bd('0x20')](function(_0x4cdae5){_0x1d5508[_0xb7bd('0x69')]=_0x4cdae5;return _0x1d5508;});}})['then'](respondWithFilteredResult(_0x5e0fcd,_0x5425ff))[_0xb7bd('0x2a')](handleError(_0x5e0fcd,null));};exports[_0xb7bd('0x7a')]=function(_0x1b9b7f,_0x479796){var _0x4eab20=_0x1b9b7f[_0xb7bd('0x51')]['id'];var _0x5f0f6c=_0x1b9b7f[_0xb7bd('0x61')];var _0x3618c4=0xc8;var _0x41e901=null;return db['sequelize'][_0xb7bd('0x7b')]({'isolationLevel':db[_0xb7bd('0x7c')][_0xb7bd('0x7d')]['ISOLATION_LEVELS'][_0xb7bd('0x7e')]},function(_0x1515aa){return db[_0xb7bd('0x3c')][_0xb7bd('0x67')]({'where':{'id':_0x4eab20},'transaction':_0x1515aa})[_0xb7bd('0x20')](function(_0x57528a){if(_0x57528a){return db[_0xb7bd('0x7f')]['destroy']({'where':{'FaxAccountId':_0x4eab20},'transaction':_0x1515aa})[_0xb7bd('0x20')](function(){var _0x5f0861=_[_0xb7bd('0x3b')](_0x5f0f6c,function(_0x1200c7){_0x1200c7['FaxAccountId']=_0x4eab20;return _0x1200c7;});return db['FaxApplication'][_0xb7bd('0x80')](_0x5f0861,{'transaction':_0x1515aa});});}else{_0x3618c4=0x194;_0x41e901=[];}});})[_0xb7bd('0x20')](function(){if(_0x3618c4!==0x194){return db[_0xb7bd('0x7f')][_0xb7bd('0x81')]({'where':{'FaxAccountId':_0x4eab20},'order':_0xb7bd('0x82')})[_0xb7bd('0x20')](function(_0x2f31d0){_0x41e901=_0x2f31d0;});}})[_0xb7bd('0x2a')](function(_0x4640a4){_0x3618c4=0x1f4;logger[_0xb7bd('0x25')](_0x4640a4[_0xb7bd('0x37')]);if(_0x4640a4['name']){delete _0x4640a4[_0xb7bd('0x38')];}_0x41e901=_0x4640a4;})['finally'](function(){if(_0x41e901===null){_0x479796['sendStatus'](_0x3618c4);}else{if(_0x3618c4===0x1f4){_0x479796[_0xb7bd('0x30')](_0x3618c4)[_0xb7bd('0x83')](_0x41e901);}else{_0x479796[_0xb7bd('0x30')](_0x3618c4)[_0xb7bd('0x84')](_0x41e901);}}});};exports[_0xb7bd('0x85')]=function(_0x4bc2f7,_0xab396,_0x246506){var _0x505efc={};var _0xa770b4={};var _0x386425;var _0x38780e;return db[_0xb7bd('0x3c')][_0xb7bd('0x67')]({'where':{'id':_0x4bc2f7['params']['id']}})[_0xb7bd('0x20')](handleEntityNotFound(_0xab396,null))[_0xb7bd('0x20')](function(_0x271512){if(_0x271512){_0x386425=_0x271512;_0xa770b4[_0xb7bd('0x3e')]=_['keys'](db[_0xb7bd('0x7f')][_0xb7bd('0x53')]);_0xa770b4['query']=_[_0xb7bd('0x52')](_0x4bc2f7[_0xb7bd('0x3f')]);_0xa770b4[_0xb7bd('0x40')]=_[_0xb7bd('0x41')](_0xa770b4['model'],_0xa770b4[_0xb7bd('0x3f')]);_0x505efc['attributes']=_[_0xb7bd('0x41')](_0xa770b4[_0xb7bd('0x3e')],qs['fields'](_0x4bc2f7['query'][_0xb7bd('0x42')]));_0x505efc['attributes']=_0x505efc[_0xb7bd('0x44')][_0xb7bd('0x43')]?_0x505efc[_0xb7bd('0x44')]:_0xa770b4[_0xb7bd('0x3e')];_0x505efc['order']=qs['sort'](_0x4bc2f7['query'][_0xb7bd('0x48')]);_0x505efc[_0xb7bd('0x49')]=qs['filters'](_[_0xb7bd('0x4a')](_0x4bc2f7[_0xb7bd('0x3f')],_0xa770b4['filters']));if(_0x4bc2f7[_0xb7bd('0x3f')]['filter']){_0x505efc[_0xb7bd('0x49')]=_[_0xb7bd('0x4d')](_0x505efc[_0xb7bd('0x49')],{'$or':_[_0xb7bd('0x3b')](_0x505efc[_0xb7bd('0x44')],function(_0x539852){var _0x58fbc5={};_0x58fbc5[_0x539852]={'$like':'%'+_0x4bc2f7[_0xb7bd('0x3f')][_0xb7bd('0x4b')]+'%'};return _0x58fbc5;})});}_0x505efc=_[_0xb7bd('0x4d')]({},_0x505efc,_0x4bc2f7[_0xb7bd('0x54')]);return _0x386425[_0xb7bd('0x85')](_0x505efc);}})[_0xb7bd('0x20')](function(_0x5cf750){if(_0x5cf750){_0x38780e=_0x5cf750[_0xb7bd('0x43')];if(!_0x4bc2f7[_0xb7bd('0x3f')][_0xb7bd('0x45')](_0xb7bd('0x46'))){_0x505efc[_0xb7bd('0x2f')]=qs['limit'](_0x4bc2f7[_0xb7bd('0x3f')][_0xb7bd('0x2f')]);_0x505efc[_0xb7bd('0x2c')]=qs[_0xb7bd('0x2c')](_0x4bc2f7[_0xb7bd('0x3f')]['offset']);}return _0x386425[_0xb7bd('0x85')](_0x505efc);}})[_0xb7bd('0x20')](function(_0x5de2e2){if(_0x5de2e2){return _0x5de2e2?{'count':_0x38780e,'rows':_0x5de2e2}:null;}})[_0xb7bd('0x20')](respondWithResult(_0xab396,null))[_0xb7bd('0x2a')](handleError(_0xab396,null));};function Extension(_0x256aac,_0x398ade,_0x4777f8,_0x1d3f90){this['context']=_0xb7bd('0x86');this[_0xb7bd('0x87')]=_0x256aac[_0xb7bd('0x88')];this[_0xb7bd('0x89')]=_0x1d3f90;this[_0xb7bd('0x4c')]=_0xb7bd('0x8a');this[_0xb7bd('0x8b')]=_0xb7bd('0x8c');this[_0xb7bd('0x64')]=_0x256aac['id'];this[_0xb7bd('0x82')]=_0x398ade;this[_0xb7bd('0x8d')]=_0x4777f8;}function createExtensionsReciveFax(_0x9c2fb3){var _0x1b3ba1=0x1;var _0x4eee34=[];_0x4eee34['push'](new Extension(_0x9c2fb3,_0x1b3ba1,'',_0xb7bd('0x8e')));_0x1b3ba1+=0x1;_0x4eee34[_0xb7bd('0x8f')](new Extension(_0x9c2fb3,_0x1b3ba1,_0xb7bd('0x90'),_0xb7bd('0x91')));_0x1b3ba1+=0x1;for(var _0x4fdeb3 in _0x9c2fb3){if(_0x9c2fb3['hasOwnProperty'](_0x4fdeb3)&&(_0x4fdeb3==='ecm'||_0x4fdeb3===_0xb7bd('0x88')||_0x4fdeb3==='gateway'||_0x4fdeb3===_0xb7bd('0x92')||_0x4fdeb3===_0xb7bd('0x93')||_0x4fdeb3===_0xb7bd('0x94')||_0x4fdeb3===_0xb7bd('0x95')||_0x4fdeb3===_0xb7bd('0x96')||_0x4fdeb3===_0xb7bd('0x97'))){_0x4eee34[_0xb7bd('0x8f')](new Extension(_0x9c2fb3,_0x1b3ba1,_0xb7bd('0x98')+_0x4fdeb3+')='+_0x9c2fb3[_0x4fdeb3],_0xb7bd('0x91')));_0x1b3ba1+=0x1;}}_0x4eee34[_0xb7bd('0x8f')](new Extension(_0x9c2fb3,_0x1b3ba1,'6','Wait'));_0x1b3ba1+=0x1;_0x4eee34['push'](new Extension(_0x9c2fb3,_0x1b3ba1,_0xb7bd('0x99'),'ReceiveFax'));_0x1b3ba1=0x0;return _0x4eee34;}exports[_0xb7bd('0x9a')]=function(_0x4aa857,_0x2a8267,_0x27736b){var _0x420ee1;return db['sequelize'][_0xb7bd('0x7b')](function(_0x316849){return db[_0xb7bd('0x3c')][_0xb7bd('0x56')](_0x4aa857[_0xb7bd('0x61')],{'transaction':_0x316849})[_0xb7bd('0x20')](function(_0x2c0777){_0x420ee1=_0x2c0777[_0xb7bd('0x58')]({'plain':!![]});return db['VoiceExtension'][_0xb7bd('0x80')](createExtensionsReciveFax(_0x420ee1),{'transaction':_0x316849});});})['then'](function(){return _0x420ee1;})['then'](respondWithResult(_0x2a8267,null))['catch'](handleError(_0x2a8267,null));};exports[_0xb7bd('0x9b')]=function(_0x49b406,_0xab186a,_0x404d93){var _0x36c37b;return db[_0xb7bd('0x7c')][_0xb7bd('0x7b')](function(_0x237fc7){return db['FaxAccount']['update'](_0x49b406['body'],{'where':{'id':_0x49b406[_0xb7bd('0x61')]['id']},'transaction':_0x237fc7})[_0xb7bd('0x20')](function(_0x34edc0){return db['VoiceExtension'][_0xb7bd('0x35')]({'where':{'FaxAccountId':_0x49b406['body']['id']},'transaction':_0x237fc7})[_0xb7bd('0x20')](function(_0x19dbc8){return db['VoiceExtension'][_0xb7bd('0x80')](createExtensionsReciveFax(_['omit'](_0x49b406[_0xb7bd('0x61')],[_0xb7bd('0x9c'),'key','createdAt',_0xb7bd('0x9d'),_0xb7bd('0x9e'),'ListId'])),{'transaction':_0x237fc7});});});})[_0xb7bd('0x20')](function(){return db[_0xb7bd('0x3c')][_0xb7bd('0x9f')](_0x49b406[_0xb7bd('0x61')]['id']);})[_0xb7bd('0x20')](respondWithResult(_0xab186a,null))[_0xb7bd('0x2a')](handleError(_0xab186a,null));};exports[_0xb7bd('0xa0')]=function(_0x73fac8,_0x43838b,_0x277004){var _0x4360cb={'raw':!![],'where':{}};var _0x445787={};var _0x32127d={'count':0x0,'rows':[]};return db[_0xb7bd('0x3c')]['findOne']({'where':{'id':_0x73fac8[_0xb7bd('0x51')]['id']}})[_0xb7bd('0x20')](handleEntityNotFound(_0x43838b,null))['then'](function(_0x5c9390){if(_0x5c9390){_0x445787[_0xb7bd('0x3e')]=_[_0xb7bd('0x52')](db['FaxMessage'][_0xb7bd('0x53')]);_0x445787[_0xb7bd('0x3f')]=_[_0xb7bd('0x52')](_0x73fac8[_0xb7bd('0x3f')]);_0x445787[_0xb7bd('0x40')]=_[_0xb7bd('0x41')](_0x445787['model'],_0x445787['query']);_0x4360cb[_0xb7bd('0x44')]=_[_0xb7bd('0x41')](_0x445787[_0xb7bd('0x3e')],qs[_0xb7bd('0x42')](_0x73fac8['query'][_0xb7bd('0x42')]));_0x4360cb[_0xb7bd('0x44')]=_0x4360cb[_0xb7bd('0x44')][_0xb7bd('0x43')]?_0x4360cb['attributes']:_0x445787[_0xb7bd('0x3e')];if(!_0x73fac8[_0xb7bd('0x3f')]['hasOwnProperty'](_0xb7bd('0x46'))){_0x4360cb[_0xb7bd('0x2f')]=qs[_0xb7bd('0x2f')](_0x73fac8['query']['limit']);_0x4360cb[_0xb7bd('0x2c')]=qs[_0xb7bd('0x2c')](_0x73fac8[_0xb7bd('0x3f')]['offset']);}_0x4360cb[_0xb7bd('0x47')]=qs['sort'](_0x73fac8[_0xb7bd('0x3f')]['sort']);_0x4360cb[_0xb7bd('0x49')]=qs[_0xb7bd('0x40')](_[_0xb7bd('0x4a')](_0x73fac8[_0xb7bd('0x3f')],_0x445787[_0xb7bd('0x40')]));_0x4360cb['where'][_0xb7bd('0x64')]=_0x5c9390['id'];if(_0x73fac8[_0xb7bd('0x3f')][_0xb7bd('0x4b')]){_0x4360cb[_0xb7bd('0x49')]=_['merge'](_0x4360cb[_0xb7bd('0x49')],{'$or':_[_0xb7bd('0x3b')](_0x4360cb[_0xb7bd('0x44')],function(_0x1f62cc){var _0x20a6dd={};_0x20a6dd[_0x1f62cc]={'$like':'%'+_0x73fac8[_0xb7bd('0x3f')][_0xb7bd('0x4b')]+'%'};return _0x20a6dd;})});}if(_0x73fac8[_0xb7bd('0x3f')][_0xb7bd('0xa1')]){var _0x236bc7=_0x73fac8[_0xb7bd('0x3f')][_0xb7bd('0xa1')][_0xb7bd('0xa2')](',');var _0x35e416={};_0x35e416[_0x236bc7[0x0]]={'$gte':moment(_0x236bc7[0x1])[_0xb7bd('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4360cb[_0xb7bd('0x49')]=_['merge'](_0x4360cb[_0xb7bd('0x49')],_0x35e416);}_0x4360cb=_[_0xb7bd('0x4d')]({},_0x4360cb,_0x73fac8[_0xb7bd('0x54')]);return db[_0xb7bd('0xa4')][_0xb7bd('0x2e')]({'where':_0x4360cb[_0xb7bd('0x49')]})[_0xb7bd('0x20')](function(_0x549ae1){_0x32127d[_0xb7bd('0x2e')]=_0x549ae1;if(_0x73fac8[_0xb7bd('0x3f')][_0xb7bd('0x4e')]){_0x4360cb[_0xb7bd('0x4f')]=[{'all':!![]}];}return db[_0xb7bd('0xa4')][_0xb7bd('0x68')](_0x4360cb);})['then'](function(_0x276c13){_0x32127d['rows']=_0x276c13;return _0x32127d;});}})['then'](respondWithFilteredResult(_0x43838b,_0x4360cb))[_0xb7bd('0x2a')](handleError(_0x43838b,null));};exports[_0xb7bd('0x83')]=function(_0x1ace55,_0x3a8b4e,_0x5dd7af){var _0x12271a,_0x31a3c1={},_0x54360a;if(_0x1ace55[_0xb7bd('0x61')]['to']){_0x54360a=_0x1ace55['body']['to'][0x0];}return db[_0xb7bd('0x3c')][_0xb7bd('0x55')]({'where':{'id':_0x1ace55[_0xb7bd('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0xb7bd('0xa5'),'include':[{'model':db[_0xb7bd('0xa6')],'as':'Contacts','where':{'fax':_0x54360a},'limit':0x1,'order':[[_0xb7bd('0x9d'),_0xb7bd('0xa7')]]}]}]})[_0xb7bd('0x20')](handleEntityNotFound(_0x3a8b4e,null))[_0xb7bd('0x20')](function(_0x33f820){_0x12271a=_0x33f820;if(_0x1ace55[_0xb7bd('0x61')]['attachments']&&_0x1ace55[_0xb7bd('0x61')][_0xb7bd('0xa8')]['length']){for(var _0x46334c=0x0;_0x46334c<_0x1ace55['body'][_0xb7bd('0xa8')][_0xb7bd('0x43')];_0x46334c+=0x1){_0x1ace55[_0xb7bd('0x61')][_0xb7bd('0xa8')][_0x46334c]={'filename':_0x1ace55[_0xb7bd('0x61')][_0xb7bd('0xa8')][_0x46334c][_0xb7bd('0x38')],'id':_0x1ace55['body']['attachments'][_0x46334c]['id'],'path':path['join'](config[_0xb7bd('0xa9')],_0xb7bd('0xaa'),_0x1ace55['body'][_0xb7bd('0xa8')][_0x46334c]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0xb7bd('0xab'),{'FaxAccountId':_[_0xb7bd('0xac')](_0x1ace55['params']['id'])?undefined:_0x1ace55['params']['id'],'path':_[_0xb7bd('0xac')](_0x1ace55[_0xb7bd('0x61')][_0xb7bd('0xa8')][0x0][_0xb7bd('0xad')])?undefined:_0x1ace55[_0xb7bd('0x61')][_0xb7bd('0xa8')][0x0]['path'],'fax':_[_0xb7bd('0xac')](_0x1ace55[_0xb7bd('0x61')]['to'][0x0])?undefined:_0x1ace55[_0xb7bd('0x61')]['to'][0x0]},client9002);})[_0xb7bd('0x20')](function(){if(_0x12271a){if(_['isNil'](_0x1ace55[_0xb7bd('0x61')][_0xb7bd('0xae')])){_0x1ace55[_0xb7bd('0x61')][_0xb7bd('0xae')]=util[_0xb7bd('0xa3')](_0xb7bd('0xaf'),_0x12271a[_0xb7bd('0x38')],_0x12271a[_0xb7bd('0xb0')]);}if(_0x12271a[_0xb7bd('0xa5')]){if(_0x12271a[_0xb7bd('0xa5')][_0xb7bd('0xb1')][_0xb7bd('0x43')]){return _0x12271a[_0xb7bd('0xa5')][_0xb7bd('0xb1')][0x0];}else{return db['CmContact']['create'](_[_0xb7bd('0x17')](_0x1ace55[_0xb7bd('0x61')],{'firstName':_0x1ace55['body']['to'][0x0],'phone':_0x1ace55[_0xb7bd('0x61')]['to'][0x0],'fax':_0x1ace55[_0xb7bd('0x61')]['to'][0x0],'ListId':_0x12271a[_0xb7bd('0xb2')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xb7bd('0xb3'));}})[_0xb7bd('0x20')](function(_0x555cd2){if(_0x555cd2){return db[_0xb7bd('0x6e')][_0xb7bd('0x55')]({'where':{'ContactId':_0x555cd2['id'],'closed':![],'FaxAccountId':_0x12271a['id']}})['then'](function(_0x54a6fc){if(_0x54a6fc){return[_0x54a6fc,![]];}return db[_0xb7bd('0x6e')][_0xb7bd('0x56')]({'UserId':_0x1ace55['user']['id'],'ContactId':_0x555cd2['id'],'FaxAccountId':_0x12271a['id'],'fax':_0x1ace55[_0xb7bd('0x61')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xb7bd('0x4d')](_0x1ace55[_0xb7bd('0x61')],{'read':![],'body':_0x1ace55[_0xb7bd('0x61')]['attachments'][0x0][_0xb7bd('0xb4')],'FaxAccountId':_0x12271a['id'],'UserId':_0x1ace55[_0xb7bd('0x57')]['id'],'ContactId':_0x555cd2['id'],'AttachmentId':_0x1ace55[_0xb7bd('0x61')][_0xb7bd('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0xb7bd('0xa4')],'as':_0xb7bd('0xb5')}]})[_0xb7bd('0x20')](function(_0x1d20e2){return[_0x1d20e2,!![]];});});}else{throw new Error(_0xb7bd('0xb6'));}})[_0xb7bd('0xb7')](function(_0x161802,_0x5ae108){if(_0x5ae108){return _0x161802;}return db['FaxMessage']['create']({'direction':_0xb7bd('0xb8'),'read':![],'body':_0x1ace55['body'][_0xb7bd('0xa8')][0x0]['filename'],'FaxAccountId':_0x12271a['id'],'FaxInteractionId':_0x161802['id'],'UserId':_0x1ace55[_0xb7bd('0x57')]['id'],'ContactId':_0x161802[_0xb7bd('0xb9')],'AttachmentId':_0x1ace55['body'][_0xb7bd('0xa8')][0x0]['id']})[_0xb7bd('0x20')](function(_0x38f45b){_0x161802[_0xb7bd('0xba')][_0xb7bd('0xb5')]=[];_0x161802[_0xb7bd('0xba')][_0xb7bd('0xb5')][_0xb7bd('0x8f')](_0x38f45b[_0xb7bd('0xba')]);return _0x161802;});})[_0xb7bd('0x20')](function(_0x28cc53){respondWithRpcPromise(_0xb7bd('0xbb'),_0xb7bd('0xbb'),{'FaxAccountId':_[_0xb7bd('0xac')](_0x1ace55[_0xb7bd('0x51')]['id'])?undefined:_0x1ace55[_0xb7bd('0x51')]['id'],'path':_['isNil'](_0x1ace55['body'][_0xb7bd('0xa8')][0x0]['path'])?undefined:_0x1ace55['body'][_0xb7bd('0xa8')][0x0][_0xb7bd('0xad')],'fax':_[_0xb7bd('0xac')](_0x1ace55['body']['to'][0x0])?undefined:_0x1ace55[_0xb7bd('0x61')]['to'][0x0],'AttachmentId':_0x1ace55[_0xb7bd('0x61')]['attachments'][0x0]['id']},client9002)[_0xb7bd('0x20')](function(_0xc7721a){logger[_0xb7bd('0x28')](_0xb7bd('0xbc'),_0xc7721a);})[_0xb7bd('0x2a')](function(_0x23bfc7){logger[_0xb7bd('0x28')](_0xb7bd('0xbc'),_0x23bfc7);});return _0x28cc53;})[_0xb7bd('0x20')](respondWithResult(_0x3a8b4e,null))[_0xb7bd('0x2a')](handleError(_0x3a8b4e,null));};exports[_0xb7bd('0xbd')]=function(_0x2348c5,_0x2e672d,_0x1154ae){return db[_0xb7bd('0x3c')][_0xb7bd('0x55')]({'where':{'id':_0x2348c5[_0xb7bd('0x51')]['id']}})['then'](handleEntityNotFound(_0x2e672d,null))[_0xb7bd('0x20')](function(_0x27f3a1){if(_0x27f3a1){return _0x27f3a1[_0xb7bd('0xbd')](_0x2348c5['body'][_0xb7bd('0x6d')],_[_0xb7bd('0xbe')](_0x2348c5[_0xb7bd('0x61')],[_0xb7bd('0x6d'),'id'])||{})['spread'](function(_0xd14b88){for(var _0x3434f6=0x0;_0x3434f6<_0x2348c5[_0xb7bd('0x61')]['ids'][_0xb7bd('0x43')];_0x3434f6+=0x1){socket[_0xb7bd('0xbf')](_0xb7bd('0xc0'),{'UserId':Number(_0x2348c5[_0xb7bd('0x61')][_0xb7bd('0x6d')][_0x3434f6]),'FaxAccountId':Number(_0x2348c5[_0xb7bd('0x51')]['id'])});}return _0xd14b88;});}})[_0xb7bd('0x20')](respondWithResult(_0x2e672d,null))[_0xb7bd('0x2a')](handleError(_0x2e672d,null));};exports[_0xb7bd('0xc1')]=function(_0x39f0d4,_0x4a33ea,_0x41a8f0){return db['FaxAccount'][_0xb7bd('0x55')]({'where':{'id':_0x39f0d4['params']['id']}})['then'](handleEntityNotFound(_0x4a33ea,null))['then'](function(_0x57bb27){if(_0x57bb27){return _0x57bb27[_0xb7bd('0xc1')](_0x39f0d4['query']['ids'])[_0xb7bd('0x20')](function(){if(_[_0xb7bd('0xc2')](_0x39f0d4[_0xb7bd('0x3f')]['ids'])){for(var _0x4b62c2=0x0;_0x4b62c2<_0x39f0d4['query'][_0xb7bd('0x6d')][_0xb7bd('0x43')];_0x4b62c2+=0x1){socket[_0xb7bd('0xbf')](_0xb7bd('0xc3'),{'UserId':Number(_0x39f0d4['query'][_0xb7bd('0x6d')][_0x4b62c2]),'FaxAccountId':Number(_0x39f0d4[_0xb7bd('0x51')]['id'])});}}else{socket[_0xb7bd('0xbf')](_0xb7bd('0xc3'),{'UserId':Number(_0x39f0d4[_0xb7bd('0x3f')][_0xb7bd('0x6d')]),'FaxAccountId':Number(_0x39f0d4[_0xb7bd('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a33ea,null))[_0xb7bd('0x2a')](handleError(_0x4a33ea,null));};exports[_0xb7bd('0xc4')]=function(_0xeecc09,_0x204cd6,_0xe5d3dc){var _0x336856={};var _0x3de101={};var _0x59c86a;var _0x4080ac;return db['FaxAccount'][_0xb7bd('0x67')]({'where':{'id':_0xeecc09[_0xb7bd('0x51')]['id']}})[_0xb7bd('0x20')](handleEntityNotFound(_0x204cd6,null))[_0xb7bd('0x20')](function(_0x133254){if(_0x133254){_0x59c86a=_0x133254;_0x3de101[_0xb7bd('0x3e')]=_[_0xb7bd('0x52')](db['User'][_0xb7bd('0x53')]);_0x3de101[_0xb7bd('0x3f')]=_[_0xb7bd('0x52')](_0xeecc09[_0xb7bd('0x3f')]);_0x3de101['filters']=_[_0xb7bd('0x41')](_0x3de101[_0xb7bd('0x3e')],_0x3de101[_0xb7bd('0x3f')]);_0x336856[_0xb7bd('0x44')]=_[_0xb7bd('0x41')](_0x3de101[_0xb7bd('0x3e')],qs['fields'](_0xeecc09['query']['fields']));_0x336856['attributes']=_0x336856[_0xb7bd('0x44')][_0xb7bd('0x43')]?_0x336856[_0xb7bd('0x44')]:_0x3de101['model'];_0x336856[_0xb7bd('0x47')]=qs[_0xb7bd('0x48')](_0xeecc09[_0xb7bd('0x3f')][_0xb7bd('0x48')]);_0x336856[_0xb7bd('0x49')]=qs[_0xb7bd('0x40')](_['pick'](_0xeecc09[_0xb7bd('0x3f')],_0x3de101[_0xb7bd('0x40')]));if(_0xeecc09[_0xb7bd('0x3f')][_0xb7bd('0x4b')]){_0x336856[_0xb7bd('0x49')]=_[_0xb7bd('0x4d')](_0x336856[_0xb7bd('0x49')],{'$or':_[_0xb7bd('0x3b')](_0x336856['attributes'],function(_0x12744b){var _0xd1810e={};_0xd1810e[_0x12744b]={'$like':'%'+_0xeecc09[_0xb7bd('0x3f')]['filter']+'%'};return _0xd1810e;})});}_0x336856=_[_0xb7bd('0x4d')]({},_0x336856,_0xeecc09[_0xb7bd('0x54')]);return _0x59c86a['getAgents'](_0x336856);}})[_0xb7bd('0x20')](function(_0x531d6b){if(_0x531d6b){_0x4080ac=_0x531d6b[_0xb7bd('0x43')];if(!_0xeecc09[_0xb7bd('0x3f')][_0xb7bd('0x45')](_0xb7bd('0x46'))){_0x336856[_0xb7bd('0x2f')]=qs[_0xb7bd('0x2f')](_0xeecc09[_0xb7bd('0x3f')][_0xb7bd('0x2f')]);_0x336856['offset']=qs[_0xb7bd('0x2c')](_0xeecc09['query'][_0xb7bd('0x2c')]);}return _0x59c86a[_0xb7bd('0xc4')](_0x336856);}})[_0xb7bd('0x20')](function(_0xefcf68){if(_0xefcf68){return _0xefcf68?{'count':_0x4080ac,'rows':_0xefcf68}:null;}})[_0xb7bd('0x20')](respondWithResult(_0x204cd6,null))[_0xb7bd('0x2a')](handleError(_0x204cd6,null));};
\ No newline at end of file
index 5857625..146b5b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x737b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x342cd7,_0x52138a){var _0xaf9b53=function(_0x4f5ebd){while(--_0x4f5ebd){_0x342cd7['push'](_0x342cd7['shift']());}};_0xaf9b53(++_0x52138a);}(_0x737b,0x16c));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb737('0x0'));var FaxAccount=require(_0xb737('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb737('0x2')](0x0);var events={'afterCreate':_0xb737('0x3'),'afterUpdate':_0xb737('0x4'),'afterDestroy':_0xb737('0x5')};function emitEvent(_0x32275f){return function(_0x271e4a,_0x30277d,_0x2aa72e){FaxAccountEvents[_0xb737('0x6')](_0x32275f+':'+_0x271e4a['id'],_0x271e4a);FaxAccountEvents[_0xb737('0x6')](_0x32275f,_0x271e4a);_0x2aa72e(null);};}for(var e in events){if(events[_0xb737('0x7')](e)){var event=events[e];FaxAccount[_0xb737('0x8')](e,emitEvent(event));}}module[_0xb737('0x9')]=FaxAccountEvents;
\ No newline at end of file
+var _0x7cec=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','FaxAccount'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7cec,0x102));var _0xc7ce=function(_0x54193c,_0x37f06e){_0x54193c=_0x54193c-0x0;var _0x104e9a=_0x7cec[_0x54193c];return _0x104e9a;};'use strict';var EventEmitter=require(_0xc7ce('0x0'));var FaxAccount=require(_0xc7ce('0x1'))['db'][_0xc7ce('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc7ce('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc7ce('0x4'),'afterDestroy':_0xc7ce('0x5')};function emitEvent(_0x460d87){return function(_0x1eecdf,_0x22bcbd,_0x2c7102){FaxAccountEvents[_0xc7ce('0x6')](_0x460d87+':'+_0x1eecdf['id'],_0x1eecdf);FaxAccountEvents[_0xc7ce('0x6')](_0x460d87,_0x1eecdf);_0x2c7102(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xc7ce('0x7')](e,emitEvent(event));}}module[_0xc7ce('0x8')]=FaxAccountEvents;
\ No newline at end of file
index ebab1b5..09ee9c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc73=['../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x2e4c3f,_0x590cb7){var _0x3ad19d=function(_0x16a2a7){while(--_0x16a2a7){_0x2e4c3f['push'](_0x2e4c3f['shift']());}};_0x3ad19d(++_0x590cb7);}(_0xfc73,0x1a9));var _0x3fc7=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xfc73[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var logger=require('../../config/logger')(_0x3fc7('0x2'));var moment=require(_0x3fc7('0x3'));var BPromise=require(_0x3fc7('0x4'));var rp=require(_0x3fc7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3fc7('0x6'));var config=require(_0x3fc7('0x7'));var attributes=require(_0x3fc7('0x8'));module[_0x3fc7('0x9')]=function(_0x2c807e,_0x4347c3){return _0x2c807e['define'](_0x3fc7('0xa'),attributes,{'tableName':_0x3fc7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ec6=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','fax_accounts'];(function(_0x3653c7,_0xadb356){var _0x58a021=function(_0x20b237){while(--_0x20b237){_0x3653c7['push'](_0x3653c7['shift']());}};_0x58a021(++_0xadb356);}(_0x7ec6,0x1c2));var _0x67ec=function(_0xab58e1,_0x5d47ce){_0xab58e1=_0xab58e1-0x0;var _0x295351=_0x7ec6[_0xab58e1];return _0x295351;};'use strict';var _=require(_0x67ec('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x67ec('0x1'));var BPromise=require(_0x67ec('0x2'));var rp=require(_0x67ec('0x3'));var fs=require('fs');var path=require(_0x67ec('0x4'));var rimraf=require(_0x67ec('0x5'));var config=require(_0x67ec('0x6'));var attributes=require(_0x67ec('0x7'));module[_0x67ec('0x8')]=function(_0x5c8ca4,_0x3262cd){return _0x5c8ca4['define']('FaxAccount',attributes,{'tableName':_0x67ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1cad7a5..df4b5f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc71=['orderBy','priority','length','create','contact','FaxInteraction','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','FaxAccount','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','account','applications'];(function(_0x3b347f,_0x327059){var _0x56173b=function(_0x369e35){while(--_0x369e35){_0x3b347f['push'](_0x3b347f['shift']());}};_0x56173b(++_0x327059);}(_0xdc71,0x127));var _0x1dc7=function(_0x238fc6,_0x538ea3){_0x238fc6=_0x238fc6-0x0;var _0x37b15d=_0xdc71[_0x238fc6];return _0x37b15d;};'use strict';var _=require(_0x1dc7('0x0'));var util=require(_0x1dc7('0x1'));var moment=require(_0x1dc7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dc7('0x3'));var db=require(_0x1dc7('0x4'))['db'];var utils=require(_0x1dc7('0x5'));var logger=require(_0x1dc7('0x6'))(_0x1dc7('0x7'));var config=require(_0x1dc7('0x8'));var jayson=require(_0x1dc7('0x9'));var client=jayson[_0x1dc7('0xa')][_0x1dc7('0xb')]({'port':0x232c});config['redis']=_[_0x1dc7('0xc')](config[_0x1dc7('0xd')],{'host':_0x1dc7('0xe'),'port':0x18eb});var socket=require(_0x1dc7('0xf'))(new Redis(config[_0x1dc7('0xd')]));require(_0x1dc7('0x10'))[_0x1dc7('0x11')](socket);function respondWithRpcPromise(_0x5dc43f,_0x4d2df7,_0x2e4de1){return new BPromise(function(_0x59e186,_0x4a6b08){return client[_0x1dc7('0x12')](_0x5dc43f,_0x2e4de1)[_0x1dc7('0x13')](function(_0x21d3c2){logger[_0x1dc7('0x14')](_0x1dc7('0x15'),_0x4d2df7,_0x1dc7('0x16'));logger[_0x1dc7('0x17')](_0x1dc7('0x18'),_0x4d2df7,_0x1dc7('0x16'),JSON[_0x1dc7('0x19')](_0x21d3c2));if(_0x21d3c2[_0x1dc7('0x1a')]){if(_0x21d3c2[_0x1dc7('0x1a')]['code']===0x1f4){logger[_0x1dc7('0x1a')](_0x1dc7('0x15'),_0x4d2df7,_0x21d3c2[_0x1dc7('0x1a')][_0x1dc7('0x1b')]);return _0x4a6b08(_0x21d3c2[_0x1dc7('0x1a')][_0x1dc7('0x1b')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x4d2df7,_0x21d3c2[_0x1dc7('0x1a')]['message']);return _0x59e186(_0x21d3c2['error'][_0x1dc7('0x1b')]);}else{logger['info'](_0x1dc7('0x15'),_0x4d2df7,'request\x20sent');_0x59e186(_0x21d3c2['result']['message']);}})[_0x1dc7('0x1c')](function(_0x161e32){logger[_0x1dc7('0x1a')](_0x1dc7('0x15'),_0x4d2df7,_0x161e32);_0x4a6b08(_0x161e32);});});}exports['GetFaxAccount']=function(_0x395c9d){var _0x443a31=this;return new Promise(function(_0x3c5744,_0x1e2e7d){return db[_0x1dc7('0x1d')]['findAll']({'raw':_0x395c9d['options']?_0x395c9d[_0x1dc7('0x1e')][_0x1dc7('0x1f')]===undefined?!![]:![]:!![],'where':_0x395c9d[_0x1dc7('0x1e')]?_0x395c9d[_0x1dc7('0x1e')][_0x1dc7('0x20')]||null:null,'attributes':_0x395c9d['options']?_0x395c9d['options'][_0x1dc7('0x21')]||null:null,'limit':_0x395c9d[_0x1dc7('0x1e')]?_0x395c9d[_0x1dc7('0x1e')][_0x1dc7('0x22')]||null:null,'include':_0x395c9d[_0x1dc7('0x1e')]?_0x395c9d[_0x1dc7('0x1e')][_0x1dc7('0x23')]?_[_0x1dc7('0x24')](_0x395c9d['options'][_0x1dc7('0x23')],function(_0x3db423){return{'model':db[_0x3db423[_0x1dc7('0x25')]],'as':_0x3db423['as'],'attributes':_0x3db423[_0x1dc7('0x21')],'include':_0x3db423[_0x1dc7('0x23')]?_[_0x1dc7('0x24')](_0x3db423[_0x1dc7('0x23')],function(_0x1cfccf){return{'model':db[_0x1cfccf[_0x1dc7('0x25')]],'as':_0x1cfccf['as'],'attributes':_0x1cfccf[_0x1dc7('0x21')],'include':_0x1cfccf[_0x1dc7('0x23')]?_[_0x1dc7('0x24')](_0x1cfccf[_0x1dc7('0x23')],function(_0x2dcff8){return{'model':db[_0x2dcff8['model']],'as':_0x2dcff8['as'],'attributes':_0x2dcff8['attributes']};}):[]};}):[]};}):[]:[]})[_0x1dc7('0x13')](function(_0x3a48e){logger[_0x1dc7('0x14')](_0x1dc7('0x26'),_0x395c9d);logger[_0x1dc7('0x17')](_0x1dc7('0x26'),_0x395c9d,JSON[_0x1dc7('0x19')](_0x3a48e));_0x3c5744(_0x3a48e);})[_0x1dc7('0x1c')](function(_0x1d787a){logger[_0x1dc7('0x1a')](_0x1dc7('0x26'),_0x1d787a[_0x1dc7('0x1b')],_0x395c9d);_0x1e2e7d(_0x443a31[_0x1dc7('0x1a')](0x1f4,_0x1d787a['message']));});});};exports[_0x1dc7('0x27')]=function(_0x2db0fc,_0x21f105,_0x25bdce){var _0x6f70dc=this;return new Promise(function(_0x568c96,_0x439714){var _0x3527ad={'body':_0x2db0fc[_0x1dc7('0x28')],'channel':_0x1dc7('0x29')};var _0x343513=[];var _0x54c8a5=[];var _0x4843b2={};return db['CmContact'][_0x1dc7('0x2a')]()[_0x1dc7('0x13')](function(_0x3da9d8){if(!_0x3da9d8){throw new db[(_0x1dc7('0x2b'))][(_0x1dc7('0x2c'))](_0x1dc7('0x2d'));}_0x343513=_[_0x1dc7('0x2e')](_[_0x1dc7('0x2f')](_0x3da9d8),[_0x1dc7('0x30'),_0x1dc7('0x31')]);_0x54c8a5=_[_0x1dc7('0x2e')](_[_0x1dc7('0x2f')](_0x3da9d8),[_0x1dc7('0x30'),_0x1dc7('0x31'),_0x1dc7('0x32'),_0x1dc7('0x33')]);if(_0x2db0fc[_0x1dc7('0x28')]['id']){delete _0x2db0fc[_0x1dc7('0x28')]['id'];}if(_[_0x1dc7('0x34')](_0x2db0fc[_0x1dc7('0x28')][_0x1dc7('0x35')])){throw new db['Sequelize'][(_0x1dc7('0x2c'))]('from\x20is\x20mandatory');}if(_[_0x1dc7('0x34')](_0x2db0fc[_0x1dc7('0x28')][_0x1dc7('0x28')])||_0x2db0fc[_0x1dc7('0x28')][_0x1dc7('0x28')]===''){throw new db[(_0x1dc7('0x2b'))]['ValidationError'](_0x1dc7('0x36'));}if(_['isNil'](_0x2db0fc['body']['mapKey'])){throw new db[(_0x1dc7('0x2b'))][(_0x1dc7('0x2c'))](_0x1dc7('0x37')+_0x54c8a5);}if(!_['includes'](_0x54c8a5,_0x2db0fc[_0x1dc7('0x28')][_0x1dc7('0x38')])){throw new db[(_0x1dc7('0x2b'))][(_0x1dc7('0x2c'))](_0x1dc7('0x39')+_0x54c8a5);}_0x4843b2[_0x2db0fc['body'][_0x1dc7('0x38')]]=_0x2db0fc[_0x1dc7('0x28')][_0x1dc7('0x35')];})['then'](function(){return db[_0x1dc7('0x1d')][_0x1dc7('0x3a')]({'where':{'id':_0x2db0fc['account']['id']},'include':[{'model':db[_0x1dc7('0x3b')],'as':_0x1dc7('0x3c'),'include':[{'model':db[_0x1dc7('0x3d')],'as':_0x1dc7('0x3e'),'where':_0x4843b2,'limit':0x1,'order':[['updatedAt',_0x1dc7('0x3f')]]}]},{'model':db[_0x1dc7('0x40')],'as':_0x1dc7('0x41')}]});})['then'](function(_0x50aa9f){if(_0x50aa9f&&_0x50aa9f[_0x1dc7('0x3c')]){var _0x4bf91d=_0x50aa9f[_0x1dc7('0x42')]({'plain':!![]});_0x3527ad[_0x1dc7('0x43')]=_0x4bf91d;_0x3527ad['applications']=_0x4bf91d[_0x1dc7('0x41')];_0x3527ad['list']=_0x4bf91d[_0x1dc7('0x3c')];_0x3527ad[_0x1dc7('0x44')]=_[_0x1dc7('0x45')](_0x3527ad[_0x1dc7('0x44')],[_0x1dc7('0x46')],['asc']);if(_0x3527ad[_0x1dc7('0x43')][_0x1dc7('0x41')]){delete _0x3527ad['account']['Applications'];}if(_0x3527ad['account'][_0x1dc7('0x3c')]&&_0x3527ad[_0x1dc7('0x43')][_0x1dc7('0x3c')][_0x1dc7('0x3e')][_0x1dc7('0x47')]){return _0x3527ad[_0x1dc7('0x43')][_0x1dc7('0x3c')][_0x1dc7('0x3e')][0x0];}var _0x1ee7d8=_[_0x1dc7('0xc')](_0x2db0fc['body'],{'firstName':_0x2db0fc[_0x1dc7('0x28')]['from'],'ListId':_0x4bf91d['ListId']});_0x1ee7d8[_0x2db0fc['body'][_0x1dc7('0x38')]]=_0x2db0fc[_0x1dc7('0x28')]['from'];return db['CmContact'][_0x1dc7('0x48')](_0x1ee7d8,{'fields':_0x343513,'raw':!![]});}})[_0x1dc7('0x13')](function(_0x1c49f9){_0x3527ad[_0x1dc7('0x49')]=_0x1c49f9;if(_0x1c49f9){var _0x2fc908={'ContactId':_0x1c49f9['id'],'FaxAccountId':_0x2db0fc['account']['id'],'fax':_0x1c49f9['fax']};return db[_0x1dc7('0x4a')][_0x1dc7('0x3a')]({'where':{'ContactId':_0x1c49f9['id'],'closed':![],'FaxAccountId':_0x2db0fc['account']['id']}})[_0x1dc7('0x13')](function(_0x357fce){if(_0x357fce){return[_0x357fce,![]];}return db['FaxInteraction'][_0x1dc7('0x48')](_0x2fc908)['then'](function(_0x131759){return[_0x131759,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x496703,_0x471ab5){var _0x1c10d7=_0x496703[_0x1dc7('0x42')]({'plain':!![]});if(_0x471ab5){if(_0x3527ad[_0x1dc7('0x43')][_0x1dc7('0x4b')]){_0x3527ad[_0x1dc7('0x44')][_0x1dc7('0x4c')]({'id':0x0,'priority':_0x3527ad[_0x1dc7('0x44')][_0x1dc7('0x47')]+0x1,'app':_0x1dc7('0x4d'),'appdata':_0x1dc7('0x4e'),'interval':_0x1dc7('0x4f')});}_0x1c10d7['created']=!![];}else{_0x1c10d7[_0x1dc7('0x50')]=![];}_0x3527ad[_0x1dc7('0x51')]=_0x1c10d7;return db[_0x1dc7('0x52')]['create']({'body':_0x2db0fc[_0x1dc7('0x28')][_0x1dc7('0x28')],'FaxAccountId':_0x2db0fc[_0x1dc7('0x43')]['id'],'FaxInteractionId':_0x496703['id'],'direction':'in','ContactId':_0x496703[_0x1dc7('0x53')],'AttachmentId':_0x2db0fc[_0x1dc7('0x28')]['AttachmentId']});})[_0x1dc7('0x13')](function(_0x3b1c54){_0x3527ad[_0x1dc7('0x1b')]=_0x3b1c54;if(_0x3527ad['interaction'][_0x1dc7('0x54')]){return db[_0x1dc7('0x55')][_0x1dc7('0x3a')]({'attributes':['id',_0x1dc7('0x56')],'where':{'id':_0x3527ad[_0x1dc7('0x51')][_0x1dc7('0x54')]}})[_0x1dc7('0x13')](function(_0x35f7e5){if(_0x35f7e5){_0x3527ad['applications'][_0x1dc7('0x57')]({'id':0x0,'priority':0x0,'app':_0x1dc7('0x58'),'appdata':_0x35f7e5[_0x1dc7('0x56')]+','+(_0x3527ad['account'][_0x1dc7('0x59')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x1dc7('0x5a'),_0x3527ad);});}return respondWithRpcPromise('Start',_0x1dc7('0x5a'),_0x3527ad);})[_0x1dc7('0x13')](function(_0x4e72c6){_0x568c96(_0x4e72c6);})[_0x1dc7('0x1c')](function(_0x2428f3){_0x439714(_0x6f70dc[_0x1dc7('0x1a')](0x1f4,_0x2428f3[_0x1dc7('0x1b')]));});});};
\ No newline at end of file
+var _0x14f5=['mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','FaxApplication','Applications','get','account','applications','list','orderBy','priority','asc','length','ListId','from','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','options','where','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','body','isNil'];(function(_0x528efb,_0x54e24f){var _0x413270=function(_0xf4ce18){while(--_0xf4ce18){_0x528efb['push'](_0x528efb['shift']());}};_0x413270(++_0x54e24f);}(_0x14f5,0x85));var _0x514f=function(_0x4278d2,_0x34783f){_0x4278d2=_0x4278d2-0x0;var _0x3728d0=_0x14f5[_0x4278d2];return _0x3728d0;};'use strict';var _=require(_0x514f('0x0'));var util=require(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require(_0x514f('0x3'));var rs=require(_0x514f('0x4'));var fs=require('fs');var Redis=require(_0x514f('0x5'));var db=require(_0x514f('0x6'))['db'];var utils=require(_0x514f('0x7'));var logger=require(_0x514f('0x8'))('rpc');var config=require(_0x514f('0x9'));var jayson=require(_0x514f('0xa'));var client=jayson[_0x514f('0xb')][_0x514f('0xc')]({'port':0x232c});config[_0x514f('0xd')]=_[_0x514f('0xe')](config[_0x514f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x514f('0xf'))(new Redis(config[_0x514f('0xd')]));require(_0x514f('0x10'))['register'](socket);function respondWithRpcPromise(_0x4c0068,_0x3f583e,_0x46a56c){return new BPromise(function(_0x112452,_0x573f14){return client[_0x514f('0x11')](_0x4c0068,_0x46a56c)[_0x514f('0x12')](function(_0x25850c){logger[_0x514f('0x13')](_0x514f('0x14'),_0x3f583e,_0x514f('0x15'));logger[_0x514f('0x16')](_0x514f('0x17'),_0x3f583e,'request\x20sent',JSON[_0x514f('0x18')](_0x25850c));if(_0x25850c[_0x514f('0x19')]){if(_0x25850c[_0x514f('0x19')][_0x514f('0x1a')]===0x1f4){logger[_0x514f('0x19')](_0x514f('0x14'),_0x3f583e,_0x25850c[_0x514f('0x19')]['message']);return _0x573f14(_0x25850c[_0x514f('0x19')][_0x514f('0x1b')]);}logger['error'](_0x514f('0x14'),_0x3f583e,_0x25850c[_0x514f('0x19')][_0x514f('0x1b')]);return _0x112452(_0x25850c[_0x514f('0x19')]['message']);}else{logger[_0x514f('0x13')](_0x514f('0x14'),_0x3f583e,_0x514f('0x15'));_0x112452(_0x25850c[_0x514f('0x1c')][_0x514f('0x1b')]);}})[_0x514f('0x1d')](function(_0x5d0742){logger[_0x514f('0x19')](_0x514f('0x14'),_0x3f583e,_0x5d0742);_0x573f14(_0x5d0742);});});}exports['GetFaxAccount']=function(_0x11010f){var _0x1e657e=this;return new Promise(function(_0x421bb0,_0x473ad8){return db[_0x514f('0x1e')]['findAll']({'raw':_0x11010f[_0x514f('0x1f')]?_0x11010f['options']['raw']===undefined?!![]:![]:!![],'where':_0x11010f[_0x514f('0x1f')]?_0x11010f[_0x514f('0x1f')][_0x514f('0x20')]||null:null,'attributes':_0x11010f[_0x514f('0x1f')]?_0x11010f[_0x514f('0x1f')][_0x514f('0x21')]||null:null,'limit':_0x11010f[_0x514f('0x1f')]?_0x11010f[_0x514f('0x1f')][_0x514f('0x22')]||null:null,'include':_0x11010f['options']?_0x11010f['options'][_0x514f('0x23')]?_[_0x514f('0x24')](_0x11010f['options'][_0x514f('0x23')],function(_0x1a4ecb){return{'model':db[_0x1a4ecb[_0x514f('0x25')]],'as':_0x1a4ecb['as'],'attributes':_0x1a4ecb[_0x514f('0x21')],'include':_0x1a4ecb['include']?_['map'](_0x1a4ecb[_0x514f('0x23')],function(_0x5c7fa8){return{'model':db[_0x5c7fa8[_0x514f('0x25')]],'as':_0x5c7fa8['as'],'attributes':_0x5c7fa8[_0x514f('0x21')],'include':_0x5c7fa8[_0x514f('0x23')]?_[_0x514f('0x24')](_0x5c7fa8[_0x514f('0x23')],function(_0x5eff56){return{'model':db[_0x5eff56['model']],'as':_0x5eff56['as'],'attributes':_0x5eff56[_0x514f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x514f('0x12')](function(_0x3190f8){logger[_0x514f('0x13')](_0x514f('0x26'),_0x11010f);logger[_0x514f('0x16')](_0x514f('0x26'),_0x11010f,JSON[_0x514f('0x18')](_0x3190f8));_0x421bb0(_0x3190f8);})[_0x514f('0x1d')](function(_0x27ae63){logger['error'](_0x514f('0x26'),_0x27ae63[_0x514f('0x1b')],_0x11010f);_0x473ad8(_0x1e657e[_0x514f('0x19')](0x1f4,_0x27ae63[_0x514f('0x1b')]));});});};exports[_0x514f('0x27')]=function(_0x39917a,_0x2c9f74,_0x2aff33){var _0x308798=this;return new Promise(function(_0x1b38f9,_0xb5c195){var _0x5e324a={'body':_0x39917a['body'],'channel':_0x514f('0x28')};var _0x2543bd=[];var _0x34c741=[];var _0x3c0020={};return db[_0x514f('0x29')][_0x514f('0x2a')]()[_0x514f('0x12')](function(_0x271c22){if(!_0x271c22){throw new db[(_0x514f('0x2b'))][(_0x514f('0x2c'))](_0x514f('0x2d'));}_0x2543bd=_[_0x514f('0x2e')](_[_0x514f('0x2f')](_0x271c22),[_0x514f('0x30'),'updatedAt']);_0x34c741=_[_0x514f('0x2e')](_[_0x514f('0x2f')](_0x271c22),[_0x514f('0x30'),_0x514f('0x31'),_0x514f('0x32'),'ListId']);if(_0x39917a[_0x514f('0x33')]['id']){delete _0x39917a[_0x514f('0x33')]['id'];}if(_[_0x514f('0x34')](_0x39917a[_0x514f('0x33')]['from'])){throw new db[(_0x514f('0x2b'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x39917a[_0x514f('0x33')][_0x514f('0x33')])||_0x39917a[_0x514f('0x33')][_0x514f('0x33')]===''){throw new db[(_0x514f('0x2b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x514f('0x34')](_0x39917a['body'][_0x514f('0x35')])){throw new db[(_0x514f('0x2b'))][(_0x514f('0x2c'))](_0x514f('0x36')+_0x34c741);}if(!_['includes'](_0x34c741,_0x39917a[_0x514f('0x33')]['mapKey'])){throw new db[(_0x514f('0x2b'))]['ValidationError'](_0x514f('0x37')+_0x34c741);}_0x3c0020[_0x39917a[_0x514f('0x33')][_0x514f('0x35')]]=_0x39917a['body']['from'];})['then'](function(){return db[_0x514f('0x1e')][_0x514f('0x38')]({'where':{'id':_0x39917a['account']['id']},'include':[{'model':db[_0x514f('0x39')],'as':_0x514f('0x3a'),'include':[{'model':db['CmContact'],'as':_0x514f('0x3b'),'where':_0x3c0020,'limit':0x1,'order':[[_0x514f('0x31'),'DESC']]}]},{'model':db[_0x514f('0x3c')],'as':_0x514f('0x3d')}]});})[_0x514f('0x12')](function(_0x311a88){if(_0x311a88&&_0x311a88['List']){var _0x47f766=_0x311a88[_0x514f('0x3e')]({'plain':!![]});_0x5e324a[_0x514f('0x3f')]=_0x47f766;_0x5e324a[_0x514f('0x40')]=_0x47f766[_0x514f('0x3d')];_0x5e324a[_0x514f('0x41')]=_0x47f766[_0x514f('0x3a')];_0x5e324a[_0x514f('0x40')]=_[_0x514f('0x42')](_0x5e324a[_0x514f('0x40')],[_0x514f('0x43')],[_0x514f('0x44')]);if(_0x5e324a[_0x514f('0x3f')][_0x514f('0x3d')]){delete _0x5e324a[_0x514f('0x3f')][_0x514f('0x3d')];}if(_0x5e324a[_0x514f('0x3f')][_0x514f('0x3a')]&&_0x5e324a[_0x514f('0x3f')]['List'][_0x514f('0x3b')][_0x514f('0x45')]){return _0x5e324a['account'][_0x514f('0x3a')][_0x514f('0x3b')][0x0];}var _0x26a999=_[_0x514f('0xe')](_0x39917a[_0x514f('0x33')],{'firstName':_0x39917a['body']['from'],'ListId':_0x47f766[_0x514f('0x46')]});_0x26a999[_0x39917a['body'][_0x514f('0x35')]]=_0x39917a['body'][_0x514f('0x47')];return db[_0x514f('0x29')][_0x514f('0x48')](_0x26a999,{'fields':_0x2543bd,'raw':!![]});}})[_0x514f('0x12')](function(_0x387fce){_0x5e324a[_0x514f('0x49')]=_0x387fce;if(_0x387fce){var _0x56465c={'ContactId':_0x387fce['id'],'FaxAccountId':_0x39917a[_0x514f('0x3f')]['id'],'fax':_0x387fce[_0x514f('0x28')]};return db['FaxInteraction'][_0x514f('0x38')]({'where':{'ContactId':_0x387fce['id'],'closed':![],'FaxAccountId':_0x39917a[_0x514f('0x3f')]['id']}})[_0x514f('0x12')](function(_0x23da86){if(_0x23da86){return[_0x23da86,![]];}return db[_0x514f('0x4a')]['create'](_0x56465c)[_0x514f('0x12')](function(_0x40c8fa){return[_0x40c8fa,!![]];});});}else{throw new Error(_0x514f('0x4b'));}})['spread'](function(_0x4733cd,_0x1c6f42){var _0x18e769=_0x4733cd[_0x514f('0x3e')]({'plain':!![]});if(_0x1c6f42){if(_0x5e324a['account'][_0x514f('0x4c')]){_0x5e324a[_0x514f('0x40')][_0x514f('0x4d')]({'id':0x0,'priority':_0x5e324a[_0x514f('0x40')][_0x514f('0x45')]+0x1,'app':_0x514f('0x4e'),'appdata':_0x514f('0x4f'),'interval':_0x514f('0x50')});}_0x18e769[_0x514f('0x51')]=!![];}else{_0x18e769[_0x514f('0x51')]=![];}_0x5e324a[_0x514f('0x52')]=_0x18e769;return db['FaxMessage'][_0x514f('0x48')]({'body':_0x39917a['body'][_0x514f('0x33')],'FaxAccountId':_0x39917a[_0x514f('0x3f')]['id'],'FaxInteractionId':_0x4733cd['id'],'direction':'in','ContactId':_0x4733cd[_0x514f('0x53')],'AttachmentId':_0x39917a[_0x514f('0x33')][_0x514f('0x54')]});})[_0x514f('0x12')](function(_0x13b3ab){_0x5e324a[_0x514f('0x1b')]=_0x13b3ab;if(_0x5e324a[_0x514f('0x52')][_0x514f('0x55')]){return db[_0x514f('0x56')][_0x514f('0x38')]({'attributes':['id',_0x514f('0x57')],'where':{'id':_0x5e324a[_0x514f('0x52')][_0x514f('0x55')]}})['then'](function(_0x2d39c5){if(_0x2d39c5){_0x5e324a[_0x514f('0x40')][_0x514f('0x58')]({'id':0x0,'priority':0x0,'app':_0x514f('0x59'),'appdata':_0x2d39c5[_0x514f('0x57')]+','+(_0x5e324a[_0x514f('0x3f')][_0x514f('0x5a')]||0xa),'interval':_0x514f('0x50')});}return respondWithRpcPromise(_0x514f('0x5b'),'startRouting',_0x5e324a);});}return respondWithRpcPromise(_0x514f('0x5b'),_0x514f('0x5c'),_0x5e324a);})[_0x514f('0x12')](function(_0x47dce6){_0x1b38f9(_0x47dce6);})[_0x514f('0x1d')](function(_0x156504){_0xb5c195(_0x308798[_0x514f('0x19')](0x1f4,_0x156504[_0x514f('0x1b')]));});});};
\ No newline at end of file
index fbdfc4c..78c5850 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x700c=['length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x700c,0x80));var _0xc700=function(_0x385fd1,_0x427ec3){_0x385fd1=_0x385fd1-0x0;var _0x402c49=_0x700c[_0x385fd1];return _0x402c49;};'use strict';var FaxAccountEvents=require(_0xc700('0x0'));var events=[_0xc700('0x1'),_0xc700('0x2'),_0xc700('0x3')];function createListener(_0x21ecaf,_0x44836d){return function(_0x3b88bc){_0x44836d[_0xc700('0x4')](_0x21ecaf,_0x3b88bc);};}function removeListener(_0x3bc3f1,_0x1d589d){return function(){FaxAccountEvents[_0xc700('0x5')](_0x3bc3f1,_0x1d589d);};}exports[_0xc700('0x6')]=function(_0x5ba46f){for(var _0x2a4ccd=0x0,_0x5730a3=events[_0xc700('0x7')];_0x2a4ccd<_0x5730a3;_0x2a4ccd++){var _0x1b5645=events[_0x2a4ccd];var _0x346b33=createListener(_0xc700('0x8')+_0x1b5645,_0x5ba46f);FaxAccountEvents['on'](_0x1b5645,_0x346b33);}};
\ No newline at end of file
+var _0x4a22=['removeListener','register','length','faxAccount:','save','remove','emit'];(function(_0x514197,_0x2c20af){var _0x46da97=function(_0x4be6b9){while(--_0x4be6b9){_0x514197['push'](_0x514197['shift']());}};_0x46da97(++_0x2c20af);}(_0x4a22,0x90));var _0x24a2=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4a22[_0x199572];return _0x13cfa3;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x24a2('0x0'),_0x24a2('0x1'),'update'];function createListener(_0x11bf8c,_0x9d6d9c){return function(_0x54ad5a){_0x9d6d9c[_0x24a2('0x2')](_0x11bf8c,_0x54ad5a);};}function removeListener(_0x278759,_0xa20533){return function(){FaxAccountEvents[_0x24a2('0x3')](_0x278759,_0xa20533);};}exports[_0x24a2('0x4')]=function(_0x1c10bf){for(var _0x1f401c=0x0,_0x5de6d6=events[_0x24a2('0x5')];_0x1f401c<_0x5de6d6;_0x1f401c++){var _0xaf20cc=events[_0x1f401c];var _0x46f155=createListener(_0x24a2('0x6')+_0xaf20cc,_0x1c10bf);FaxAccountEvents['on'](_0xaf20cc,_0x46f155);}};
\ No newline at end of file
index 5bec0d4..2fa8ddf 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(_0x121041,_0x281f6c){var _0x290c7b=function(_0x5c2435){while(--_0x5c2435){_0x121041['push'](_0x121041['shift']());}};_0x290c7b(++_0x281f6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x2ac149,_0x59f4c3){var _0x6e04ec=function(_0x19a039){while(--_0x19a039){_0x2ac149['push'](_0x2ac149['shift']());}};_0x6e04ec(++_0x59f4c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 3dfa9d6..586610f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ff4=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x591cb7,_0x15ec37){var _0xcf9863=function(_0x100fea){while(--_0x100fea){_0x591cb7['push'](_0x591cb7['shift']());}};_0xcf9863(++_0x15ec37);}(_0x0ff4,0x125));var _0x40ff=function(_0xe74558,_0x5273d5){_0xe74558=_0xe74558-0x0;var _0x50e228=_0x0ff4[_0xe74558];return _0x50e228;};'use strict';var Sequelize=require(_0x40ff('0x0'));module[_0x40ff('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x40ff('0x2')],'allowNull':![],'defaultValue':_0x40ff('0x3')},'appdata':{'type':Sequelize[_0x40ff('0x4')]()},'description':{'type':Sequelize[_0x40ff('0x2')]},'interval':{'type':Sequelize[_0x40ff('0x2')],'defaultValue':_0x40ff('0x5')}};
\ No newline at end of file
+var _0xb6a1=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x32de46,_0x64bc21){var _0x4c7ced=function(_0x38b7fd){while(--_0x38b7fd){_0x32de46['push'](_0x32de46['shift']());}};_0x4c7ced(++_0x64bc21);}(_0xb6a1,0x1e6));var _0x1b6a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb6a1[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x1b6a('0x0'));module[_0x1b6a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1b6a('0x2')],'allowNull':![],'defaultValue':_0x1b6a('0x3')},'appdata':{'type':Sequelize[_0x1b6a('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1b6a('0x2')],'defaultValue':_0x1b6a('0x5')}};
\ No newline at end of file
index b41857c..73928a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc97d=['stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','rows','catch','show','params','create','body','update','find','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','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','json','offset','undefined','limit','set','Content-Range','apply','reject','then','error'];(function(_0x313849,_0x5d267a){var _0x802bf0=function(_0x32ca22){while(--_0x32ca22){_0x313849['push'](_0x313849['shift']());}};_0x802bf0(++_0x5d267a);}(_0xc97d,0x71));var _0xdc97=function(_0x56ab96,_0x56fc1c){_0x56ab96=_0x56ab96-0x0;var _0xbad7dd=_0xc97d[_0x56ab96];return _0xbad7dd;};'use strict';var emlformat=require(_0xdc97('0x0'));var rimraf=require(_0xdc97('0x1'));var zipdir=require(_0xdc97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc97('0x3'));var moment=require('moment');var BPromise=require(_0xdc97('0x4'));var Mustache=require('mustache');var util=require(_0xdc97('0x5'));var path=require(_0xdc97('0x6'));var sox=require(_0xdc97('0x7'));var csv=require(_0xdc97('0x8'));var ejs=require(_0xdc97('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc97('0xa'));var squel=require(_0xdc97('0xb'));var crypto=require('crypto');var jsforce=require(_0xdc97('0xc'));var deskjs=require(_0xdc97('0xd'));var toCsv=require(_0xdc97('0x8'));var querystring=require(_0xdc97('0xe'));var Papa=require('papaparse');var Redis=require(_0xdc97('0xf'));var authService=require(_0xdc97('0x10'));var qs=require(_0xdc97('0x11'));var as=require(_0xdc97('0x12'));var hardwareService=require(_0xdc97('0x13'));var logger=require(_0xdc97('0x14'))('api');var utils=require(_0xdc97('0x15'));var config=require(_0xdc97('0x16'));var licenseUtil=require(_0xdc97('0x17'));var db=require(_0xdc97('0x18'))['db'];function respondWithStatusCode(_0x2c2a97,_0xdfad62){_0xdfad62=_0xdfad62||0xcc;return function(_0x436f75){if(_0x436f75){return _0x2c2a97[_0xdc97('0x19')](_0xdfad62);}return _0x2c2a97['status'](_0xdfad62)['end']();};}function respondWithResult(_0x344e5c,_0x3637e7){_0x3637e7=_0x3637e7||0xc8;return function(_0x4a3d90){if(_0x4a3d90){return _0x344e5c[_0xdc97('0x1a')](_0x3637e7)[_0xdc97('0x1b')](_0x4a3d90);}};}function respondWithFilteredResult(_0x44545f,_0xc70b6e){return function(_0x30e07c){if(_0x30e07c){var _0x588f79=typeof _0xc70b6e[_0xdc97('0x1c')]===_0xdc97('0x1d')&&typeof _0xc70b6e['limit']===_0xdc97('0x1d');var _0xca0766=_0x30e07c['count'];var _0x4c84b4=_0x588f79?0x0:_0xc70b6e[_0xdc97('0x1c')];var _0x2ce4ae=_0x588f79?_0x30e07c['count']:_0xc70b6e[_0xdc97('0x1c')]+_0xc70b6e[_0xdc97('0x1e')];var _0x2be4fe;if(_0x2ce4ae>=_0xca0766){_0x2ce4ae=_0xca0766;_0x2be4fe=0xc8;}else{_0x2be4fe=0xce;}_0x44545f[_0xdc97('0x1a')](_0x2be4fe);return _0x44545f[_0xdc97('0x1f')](_0xdc97('0x20'),_0x4c84b4+'-'+_0x2ce4ae+'/'+_0xca0766)[_0xdc97('0x1b')](_0x30e07c);}return null;};}function patchUpdates(_0x2437e5){return function(_0x232793){try{jsonpatch[_0xdc97('0x21')](_0x232793,_0x2437e5,!![]);}catch(_0x211642){return BPromise[_0xdc97('0x22')](_0x211642);}return _0x232793['save']();};}function saveUpdates(_0x5d5275,_0x3f92e7){return function(_0x46f2f2){if(_0x46f2f2){return _0x46f2f2['update'](_0x5d5275)[_0xdc97('0x23')](function(_0x22f972){return _0x22f972;});}return null;};}function removeEntity(_0x551c22,_0x25269c){return function(_0xcf9d8e){if(_0xcf9d8e){return _0xcf9d8e['destroy']()[_0xdc97('0x23')](function(){_0x551c22[_0xdc97('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dff6e,_0x58245f){return function(_0x67c2c0){if(!_0x67c2c0){_0x4dff6e[_0xdc97('0x19')](0x194);}return _0x67c2c0;};}function handleError(_0x50307a,_0x5fa919){_0x5fa919=_0x5fa919||0x1f4;return function(_0x32ffbd){logger[_0xdc97('0x24')](_0x32ffbd[_0xdc97('0x25')]);if(_0x32ffbd[_0xdc97('0x26')]){delete _0x32ffbd[_0xdc97('0x26')];}_0x50307a[_0xdc97('0x1a')](_0x5fa919)[_0xdc97('0x27')](_0x32ffbd);};}exports[_0xdc97('0x28')]=function(_0x434c76,_0x3b76ae){var _0x172faf={},_0x3eec49={},_0x2af42f={'count':0x0,'rows':[]};var _0x10153f=_[_0xdc97('0x29')](db[_0xdc97('0x2a')][_0xdc97('0x2b')],function(_0x1b3bed){return{'name':_0x1b3bed[_0xdc97('0x2c')],'type':_0x1b3bed[_0xdc97('0x2d')][_0xdc97('0x2e')]};});_0x3eec49[_0xdc97('0x2f')]=_[_0xdc97('0x29')](_0x10153f,_0xdc97('0x26'));_0x3eec49[_0xdc97('0x30')]=_[_0xdc97('0x31')](_0x434c76[_0xdc97('0x30')]);_0x3eec49[_0xdc97('0x32')]=_[_0xdc97('0x33')](_0x3eec49[_0xdc97('0x2f')],_0x3eec49[_0xdc97('0x30')]);_0x172faf['attributes']=_[_0xdc97('0x33')](_0x3eec49[_0xdc97('0x2f')],qs[_0xdc97('0x34')](_0x434c76[_0xdc97('0x30')][_0xdc97('0x34')]));_0x172faf['attributes']=_0x172faf[_0xdc97('0x35')][_0xdc97('0x36')]?_0x172faf[_0xdc97('0x35')]:_0x3eec49['model'];if(!_0x434c76[_0xdc97('0x30')][_0xdc97('0x37')](_0xdc97('0x38'))){_0x172faf['limit']=qs['limit'](_0x434c76[_0xdc97('0x30')][_0xdc97('0x1e')]);_0x172faf[_0xdc97('0x1c')]=qs[_0xdc97('0x1c')](_0x434c76['query']['offset']);}_0x172faf[_0xdc97('0x39')]=qs[_0xdc97('0x3a')](_0x434c76[_0xdc97('0x30')][_0xdc97('0x3a')]);_0x172faf[_0xdc97('0x3b')]=qs[_0xdc97('0x32')](_[_0xdc97('0x3c')](_0x434c76[_0xdc97('0x30')],_0x3eec49['filters']),_0x10153f);if(_0x434c76[_0xdc97('0x30')][_0xdc97('0x3d')]){_0x172faf[_0xdc97('0x3b')]=_[_0xdc97('0x3e')](_0x172faf['where'],{'$or':_['map'](_0x10153f,function(_0x15b0b7){if(_0x15b0b7[_0xdc97('0x2d')]!=='VIRTUAL'){var _0x4d4c8a={};_0x4d4c8a[_0x15b0b7[_0xdc97('0x26')]]={'$like':'%'+_0x434c76[_0xdc97('0x30')]['filter']+'%'};return _0x4d4c8a;}})});}_0x172faf=_['merge']({},_0x172faf,_0x434c76[_0xdc97('0x3f')]);var _0x407618={'where':_0x172faf[_0xdc97('0x3b')]};return db[_0xdc97('0x2a')][_0xdc97('0x40')](_0x407618)[_0xdc97('0x23')](function(_0x50f4e7){_0x2af42f[_0xdc97('0x40')]=_0x50f4e7;if(_0x434c76['query'][_0xdc97('0x41')]){_0x172faf['include']=[{'all':!![]}];}return db[_0xdc97('0x2a')]['findAll'](_0x172faf);})[_0xdc97('0x23')](function(_0x49b163){_0x2af42f[_0xdc97('0x42')]=_0x49b163;return _0x2af42f;})[_0xdc97('0x23')](respondWithFilteredResult(_0x3b76ae,_0x172faf))[_0xdc97('0x43')](handleError(_0x3b76ae,null));};exports[_0xdc97('0x44')]=function(_0x9d81e1,_0x901e85){var _0x310674={'raw':!![],'where':{'id':_0x9d81e1[_0xdc97('0x45')]['id']}},_0x3a0d90={};_0x3a0d90[_0xdc97('0x2f')]=_[_0xdc97('0x31')](db[_0xdc97('0x2a')]['rawAttributes']);_0x3a0d90['query']=_['keys'](_0x9d81e1[_0xdc97('0x30')]);_0x3a0d90[_0xdc97('0x32')]=_[_0xdc97('0x33')](_0x3a0d90[_0xdc97('0x2f')],_0x3a0d90['query']);_0x310674[_0xdc97('0x35')]=_['intersection'](_0x3a0d90[_0xdc97('0x2f')],qs[_0xdc97('0x34')](_0x9d81e1[_0xdc97('0x30')][_0xdc97('0x34')]));_0x310674[_0xdc97('0x35')]=_0x310674['attributes'][_0xdc97('0x36')]?_0x310674[_0xdc97('0x35')]:_0x3a0d90[_0xdc97('0x2f')];if(_0x9d81e1['query']['includeAll']){_0x310674['include']=[{'all':!![]}];}_0x310674=_['merge']({},_0x310674,_0x9d81e1[_0xdc97('0x3f')]);return db[_0xdc97('0x2a')]['find'](_0x310674)[_0xdc97('0x23')](handleEntityNotFound(_0x901e85,null))[_0xdc97('0x23')](respondWithResult(_0x901e85,null))[_0xdc97('0x43')](handleError(_0x901e85,null));};exports[_0xdc97('0x46')]=function(_0x2855c6,_0x2d59fd){return db[_0xdc97('0x2a')][_0xdc97('0x46')](_0x2855c6[_0xdc97('0x47')],{})['then'](respondWithResult(_0x2d59fd,0xc9))[_0xdc97('0x43')](handleError(_0x2d59fd,null));};exports[_0xdc97('0x48')]=function(_0x3ce4c5,_0x2ff67d){if(_0x3ce4c5['body']['id']){delete _0x3ce4c5[_0xdc97('0x47')]['id'];}return db['FaxApplication'][_0xdc97('0x49')]({'where':{'id':_0x3ce4c5[_0xdc97('0x45')]['id']}})[_0xdc97('0x23')](handleEntityNotFound(_0x2ff67d,null))['then'](saveUpdates(_0x3ce4c5['body'],null))[_0xdc97('0x23')](respondWithResult(_0x2ff67d,null))[_0xdc97('0x43')](handleError(_0x2ff67d,null));};exports[_0xdc97('0x4a')]=function(_0x44be5e,_0x19afcb){return db[_0xdc97('0x2a')][_0xdc97('0x49')]({'where':{'id':_0x44be5e[_0xdc97('0x45')]['id']}})[_0xdc97('0x23')](handleEntityNotFound(_0x19afcb,null))['then'](removeEntity(_0x19afcb,null))[_0xdc97('0x43')](handleError(_0x19afcb,null));};
\ No newline at end of file
+var _0x58c0=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','length','find','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x3780bd,_0x81b109){var _0x2a7b7f=function(_0x5a221f){while(--_0x5a221f){_0x3780bd['push'](_0x3780bd['shift']());}};_0x2a7b7f(++_0x81b109);}(_0x58c0,0xd6));var _0x058c=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x58c0[_0x272638];return _0x19d027;};'use strict';var emlformat=require(_0x058c('0x0'));var rimraf=require(_0x058c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x058c('0x2'));var rp=require(_0x058c('0x3'));var moment=require(_0x058c('0x4'));var BPromise=require(_0x058c('0x5'));var Mustache=require('mustache');var util=require(_0x058c('0x6'));var path=require(_0x058c('0x7'));var sox=require(_0x058c('0x8'));var csv=require(_0x058c('0x9'));var ejs=require(_0x058c('0xa'));var fs=require('fs');var fs_extra=require(_0x058c('0xb'));var _=require('lodash');var squel=require(_0x058c('0xc'));var crypto=require(_0x058c('0xd'));var jsforce=require(_0x058c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x058c('0x9'));var querystring=require(_0x058c('0xf'));var Papa=require(_0x058c('0x10'));var Redis=require(_0x058c('0x11'));var authService=require(_0x058c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x058c('0x13'));var hardwareService=require(_0x058c('0x14'));var logger=require(_0x058c('0x15'))(_0x058c('0x16'));var utils=require(_0x058c('0x17'));var config=require(_0x058c('0x18'));var licenseUtil=require(_0x058c('0x19'));var db=require(_0x058c('0x1a'))['db'];function respondWithStatusCode(_0x4fbead,_0x541be5){_0x541be5=_0x541be5||0xcc;return function(_0x3a88d2){if(_0x3a88d2){return _0x4fbead[_0x058c('0x1b')](_0x541be5);}return _0x4fbead[_0x058c('0x1c')](_0x541be5)[_0x058c('0x1d')]();};}function respondWithResult(_0x44373d,_0x2aba52){_0x2aba52=_0x2aba52||0xc8;return function(_0xf683e2){if(_0xf683e2){return _0x44373d[_0x058c('0x1c')](_0x2aba52)[_0x058c('0x1e')](_0xf683e2);}};}function respondWithFilteredResult(_0xca7e8d,_0x485c8f){return function(_0x2d30bb){if(_0x2d30bb){var _0x3ae261=typeof _0x485c8f[_0x058c('0x1f')]===_0x058c('0x20')&&typeof _0x485c8f[_0x058c('0x21')]===_0x058c('0x20');var _0x4e57b9=_0x2d30bb['count'];var _0x58fc12=_0x3ae261?0x0:_0x485c8f[_0x058c('0x1f')];var _0x2c3938=_0x3ae261?_0x2d30bb[_0x058c('0x22')]:_0x485c8f['offset']+_0x485c8f[_0x058c('0x21')];var _0x8d59de;if(_0x2c3938>=_0x4e57b9){_0x2c3938=_0x4e57b9;_0x8d59de=0xc8;}else{_0x8d59de=0xce;}_0xca7e8d[_0x058c('0x1c')](_0x8d59de);return _0xca7e8d[_0x058c('0x23')]('Content-Range',_0x58fc12+'-'+_0x2c3938+'/'+_0x4e57b9)[_0x058c('0x1e')](_0x2d30bb);}return null;};}function patchUpdates(_0xf81f83){return function(_0x304762){try{jsonpatch[_0x058c('0x24')](_0x304762,_0xf81f83,!![]);}catch(_0x5ece8c){return BPromise[_0x058c('0x25')](_0x5ece8c);}return _0x304762[_0x058c('0x26')]();};}function saveUpdates(_0x28e979,_0x1e3113){return function(_0x6c14be){if(_0x6c14be){return _0x6c14be['update'](_0x28e979)[_0x058c('0x27')](function(_0x51d35e){return _0x51d35e;});}return null;};}function removeEntity(_0x1975a7,_0x512dca){return function(_0x3fcd80){if(_0x3fcd80){return _0x3fcd80[_0x058c('0x28')]()[_0x058c('0x27')](function(){_0x1975a7[_0x058c('0x1c')](0xcc)[_0x058c('0x1d')]();});}};}function handleEntityNotFound(_0x4ccad2,_0x35212b){return function(_0x911977){if(!_0x911977){_0x4ccad2[_0x058c('0x1b')](0x194);}return _0x911977;};}function handleError(_0x25767c,_0x2c641a){_0x2c641a=_0x2c641a||0x1f4;return function(_0x2e7c18){logger[_0x058c('0x29')](_0x2e7c18['stack']);if(_0x2e7c18[_0x058c('0x2a')]){delete _0x2e7c18[_0x058c('0x2a')];}_0x25767c[_0x058c('0x1c')](_0x2c641a)[_0x058c('0x2b')](_0x2e7c18);};}exports[_0x058c('0x2c')]=function(_0x4098c6,_0x3865a1){var _0x36dd56={},_0x200364={},_0x3f8d0e={'count':0x0,'rows':[]};var _0x3bd9dd=_[_0x058c('0x2d')](db[_0x058c('0x2e')][_0x058c('0x2f')],function(_0x4c33bf){return{'name':_0x4c33bf[_0x058c('0x30')],'type':_0x4c33bf[_0x058c('0x31')]['key']};});_0x200364[_0x058c('0x32')]=_[_0x058c('0x2d')](_0x3bd9dd,_0x058c('0x2a'));_0x200364[_0x058c('0x33')]=_[_0x058c('0x34')](_0x4098c6[_0x058c('0x33')]);_0x200364[_0x058c('0x35')]=_[_0x058c('0x36')](_0x200364[_0x058c('0x32')],_0x200364[_0x058c('0x33')]);_0x36dd56[_0x058c('0x37')]=_['intersection'](_0x200364[_0x058c('0x32')],qs[_0x058c('0x38')](_0x4098c6[_0x058c('0x33')]['fields']));_0x36dd56[_0x058c('0x37')]=_0x36dd56[_0x058c('0x37')]['length']?_0x36dd56[_0x058c('0x37')]:_0x200364[_0x058c('0x32')];if(!_0x4098c6[_0x058c('0x33')][_0x058c('0x39')](_0x058c('0x3a'))){_0x36dd56['limit']=qs[_0x058c('0x21')](_0x4098c6['query'][_0x058c('0x21')]);_0x36dd56[_0x058c('0x1f')]=qs['offset'](_0x4098c6[_0x058c('0x33')]['offset']);}_0x36dd56[_0x058c('0x3b')]=qs['sort'](_0x4098c6[_0x058c('0x33')][_0x058c('0x3c')]);_0x36dd56[_0x058c('0x3d')]=qs[_0x058c('0x35')](_['pick'](_0x4098c6['query'],_0x200364[_0x058c('0x35')]),_0x3bd9dd);if(_0x4098c6['query'][_0x058c('0x3e')]){_0x36dd56[_0x058c('0x3d')]=_[_0x058c('0x3f')](_0x36dd56['where'],{'$or':_[_0x058c('0x2d')](_0x3bd9dd,function(_0x18d9d1){if(_0x18d9d1[_0x058c('0x31')]!==_0x058c('0x40')){var _0x1a845d={};_0x1a845d[_0x18d9d1[_0x058c('0x2a')]]={'$like':'%'+_0x4098c6['query']['filter']+'%'};return _0x1a845d;}})});}_0x36dd56=_[_0x058c('0x3f')]({},_0x36dd56,_0x4098c6[_0x058c('0x41')]);var _0x2e73d7={'where':_0x36dd56[_0x058c('0x3d')]};return db['FaxApplication'][_0x058c('0x22')](_0x2e73d7)[_0x058c('0x27')](function(_0x52aea6){_0x3f8d0e[_0x058c('0x22')]=_0x52aea6;if(_0x4098c6[_0x058c('0x33')]['includeAll']){_0x36dd56[_0x058c('0x42')]=[{'all':!![]}];}return db['FaxApplication'][_0x058c('0x43')](_0x36dd56);})[_0x058c('0x27')](function(_0x4a7ba6){_0x3f8d0e[_0x058c('0x44')]=_0x4a7ba6;return _0x3f8d0e;})[_0x058c('0x27')](respondWithFilteredResult(_0x3865a1,_0x36dd56))[_0x058c('0x45')](handleError(_0x3865a1,null));};exports['show']=function(_0x305258,_0xdf04e8){var _0x25acb0={'raw':!![],'where':{'id':_0x305258['params']['id']}},_0x362c3b={};_0x362c3b['model']=_[_0x058c('0x34')](db[_0x058c('0x2e')]['rawAttributes']);_0x362c3b['query']=_[_0x058c('0x34')](_0x305258[_0x058c('0x33')]);_0x362c3b['filters']=_['intersection'](_0x362c3b[_0x058c('0x32')],_0x362c3b[_0x058c('0x33')]);_0x25acb0[_0x058c('0x37')]=_[_0x058c('0x36')](_0x362c3b[_0x058c('0x32')],qs[_0x058c('0x38')](_0x305258[_0x058c('0x33')][_0x058c('0x38')]));_0x25acb0[_0x058c('0x37')]=_0x25acb0[_0x058c('0x37')][_0x058c('0x46')]?_0x25acb0[_0x058c('0x37')]:_0x362c3b[_0x058c('0x32')];if(_0x305258[_0x058c('0x33')]['includeAll']){_0x25acb0[_0x058c('0x42')]=[{'all':!![]}];}_0x25acb0=_[_0x058c('0x3f')]({},_0x25acb0,_0x305258[_0x058c('0x41')]);return db['FaxApplication'][_0x058c('0x47')](_0x25acb0)[_0x058c('0x27')](handleEntityNotFound(_0xdf04e8,null))[_0x058c('0x27')](respondWithResult(_0xdf04e8,null))[_0x058c('0x45')](handleError(_0xdf04e8,null));};exports[_0x058c('0x48')]=function(_0x87e13b,_0x436913){return db[_0x058c('0x2e')]['create'](_0x87e13b[_0x058c('0x49')],{})[_0x058c('0x27')](respondWithResult(_0x436913,0xc9))['catch'](handleError(_0x436913,null));};exports[_0x058c('0x4a')]=function(_0x43aa9b,_0x3a8f3c){if(_0x43aa9b[_0x058c('0x49')]['id']){delete _0x43aa9b[_0x058c('0x49')]['id'];}return db[_0x058c('0x2e')]['find']({'where':{'id':_0x43aa9b[_0x058c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a8f3c,null))[_0x058c('0x27')](saveUpdates(_0x43aa9b[_0x058c('0x49')],null))[_0x058c('0x27')](respondWithResult(_0x3a8f3c,null))[_0x058c('0x45')](handleError(_0x3a8f3c,null));};exports[_0x058c('0x28')]=function(_0xf646e4,_0xc43992){return db[_0x058c('0x2e')][_0x058c('0x47')]({'where':{'id':_0xf646e4['params']['id']}})[_0x058c('0x27')](handleEntityNotFound(_0xc43992,null))[_0x058c('0x27')](removeEntity(_0xc43992,null))[_0x058c('0x45')](handleError(_0xc43992,null));};
\ No newline at end of file
index 6aae90f..d7fe386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e0c=['lodash','util','api','moment','bluebird','request-promise','rimraf','define','FaxApplication','fax_applications','utf8mb4_unicode_ci'];(function(_0x4a0e74,_0x46fee4){var _0x563479=function(_0x406f6a){while(--_0x406f6a){_0x4a0e74['push'](_0x4a0e74['shift']());}};_0x563479(++_0x46fee4);}(_0x0e0c,0x1a2));var _0xc0e0=function(_0x16cd5d,_0x3dc89a){_0x16cd5d=_0x16cd5d-0x0;var _0xb81543=_0x0e0c[_0x16cd5d];return _0xb81543;};'use strict';var _=require(_0xc0e0('0x0'));var util=require(_0xc0e0('0x1'));var logger=require('../../config/logger')(_0xc0e0('0x2'));var moment=require(_0xc0e0('0x3'));var BPromise=require(_0xc0e0('0x4'));var rp=require(_0xc0e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0e0('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x1c51fc,_0x42d111){return _0x1c51fc[_0xc0e0('0x7')](_0xc0e0('0x8'),attributes,{'tableName':_0xc0e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc0e0('0xa')});};
\ No newline at end of file
+var _0x927b=['../../config/logger','api','moment','bluebird','path','rimraf','fax_applications','utf8mb4','lodash','util'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0x927b,0xd0));var _0xb927=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0x927b[_0x50f0a9];return _0x5a33d9;};'use strict';var _=require(_0xb927('0x0'));var util=require(_0xb927('0x1'));var logger=require(_0xb927('0x2'))(_0xb927('0x3'));var moment=require(_0xb927('0x4'));var BPromise=require(_0xb927('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb927('0x6'));var rimraf=require(_0xb927('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x3e2afc,_0x135bf1){return _0x3e2afc['define']('FaxApplication',attributes,{'tableName':_0xb927('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb927('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index fa163ac..4cddf55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e69=['FaxApplication','body','options','where','attributes','limit','then','debug','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0x1e69,0x19d));var _0x91e6=function(_0x2faf52,_0x398229){_0x2faf52=_0x2faf52-0x0;var _0x58c8f3=_0x1e69[_0x2faf52];return _0x58c8f3;};'use strict';var _=require(_0x91e6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x91e6('0x1'));var rs=require(_0x91e6('0x2'));var fs=require('fs');var Redis=require(_0x91e6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x91e6('0x4'));var logger=require('../../config/logger')(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91e6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e0221,_0x331580,_0x521d81){return new BPromise(function(_0x2fcc4c,_0x496a5d){return client[_0x91e6('0x8')](_0x5e0221,_0x521d81)['then'](function(_0x178ae1){logger['info']('FaxApplication,\x20%s,\x20%s',_0x331580,_0x91e6('0x9'));logger['debug'](_0x91e6('0xa'),_0x331580,_0x91e6('0x9'),JSON[_0x91e6('0xb')](_0x178ae1));if(_0x178ae1[_0x91e6('0xc')]){if(_0x178ae1['error'][_0x91e6('0xd')]===0x1f4){logger[_0x91e6('0xc')](_0x91e6('0xe'),_0x331580,_0x178ae1['error'][_0x91e6('0xf')]);return _0x496a5d(_0x178ae1['error']['message']);}logger[_0x91e6('0xc')](_0x91e6('0xe'),_0x331580,_0x178ae1['error'][_0x91e6('0xf')]);return _0x2fcc4c(_0x178ae1[_0x91e6('0xc')]['message']);}else{logger['info'](_0x91e6('0xe'),_0x331580,_0x91e6('0x9'));_0x2fcc4c(_0x178ae1[_0x91e6('0x10')]['message']);}})[_0x91e6('0x11')](function(_0xcd61ae){logger['error']('FaxApplication,\x20%s,\x20%s',_0x331580,_0xcd61ae);_0x496a5d(_0xcd61ae);});});}exports[_0x91e6('0x12')]=function(_0x57f5cc){var _0x2a280b=this;return new Promise(function(_0x19d38d,_0x9e1360){return db[_0x91e6('0x13')]['update'](_0x57f5cc[_0x91e6('0x14')],{'raw':_0x57f5cc['options']?_0x57f5cc[_0x91e6('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57f5cc[_0x91e6('0x15')]?_0x57f5cc['options'][_0x91e6('0x16')]||null:null,'attributes':_0x57f5cc['options']?_0x57f5cc['options'][_0x91e6('0x17')]||null:null,'limit':_0x57f5cc['options']?_0x57f5cc['options'][_0x91e6('0x18')]||null:null})[_0x91e6('0x19')](function(_0x24d9a7){logger['info'](_0x91e6('0x12'),_0x57f5cc);logger[_0x91e6('0x1a')]('UpdateFaxApplication',_0x57f5cc,JSON[_0x91e6('0xb')](_0x24d9a7));_0x19d38d(_0x24d9a7);})[_0x91e6('0x11')](function(_0x4fcc40){logger[_0x91e6('0xc')](_0x91e6('0x12'),_0x4fcc40[_0x91e6('0xf')],_0x57f5cc);_0x9e1360(_0x2a280b[_0x91e6('0xc')](0x1f4,_0x4fcc40[_0x91e6('0xf')]));});});};
\ No newline at end of file
+var _0xe920=['rpc','jayson/promise','client','http','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x71342e,_0x319f7a){var _0xc788b5=function(_0x2da2a5){while(--_0x2da2a5){_0x71342e['push'](_0x71342e['shift']());}};_0xc788b5(++_0x319f7a);}(_0xe920,0x11c));var _0x0e92=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xe920[_0x5a60ce];return _0x393e5e;};'use strict';var _=require(_0x0e92('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0e92('0x1'));var fs=require('fs');var Redis=require(_0x0e92('0x2'));var db=require(_0x0e92('0x3'))['db'];var utils=require(_0x0e92('0x4'));var logger=require(_0x0e92('0x5'))(_0x0e92('0x6'));var config=require('../../config/environment');var jayson=require(_0x0e92('0x7'));var client=jayson[_0x0e92('0x8')][_0x0e92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcb25c4,_0x4d7660,_0x4ce78c){return new BPromise(function(_0xb81ed8,_0x20f1a7){return client['request'](_0xcb25c4,_0x4ce78c)['then'](function(_0x5234ea){logger[_0x0e92('0xa')](_0x0e92('0xb'),_0x4d7660,'request\x20sent');logger[_0x0e92('0xc')](_0x0e92('0xd'),_0x4d7660,'request\x20sent',JSON[_0x0e92('0xe')](_0x5234ea));if(_0x5234ea['error']){if(_0x5234ea[_0x0e92('0xf')][_0x0e92('0x10')]===0x1f4){logger[_0x0e92('0xf')]('FaxApplication,\x20%s,\x20%s',_0x4d7660,_0x5234ea[_0x0e92('0xf')][_0x0e92('0x11')]);return _0x20f1a7(_0x5234ea[_0x0e92('0xf')][_0x0e92('0x11')]);}logger['error'](_0x0e92('0xb'),_0x4d7660,_0x5234ea[_0x0e92('0xf')][_0x0e92('0x11')]);return _0xb81ed8(_0x5234ea[_0x0e92('0xf')][_0x0e92('0x11')]);}else{logger[_0x0e92('0xa')](_0x0e92('0xb'),_0x4d7660,_0x0e92('0x12'));_0xb81ed8(_0x5234ea[_0x0e92('0x13')][_0x0e92('0x11')]);}})[_0x0e92('0x14')](function(_0x16abda){logger[_0x0e92('0xf')](_0x0e92('0xb'),_0x4d7660,_0x16abda);_0x20f1a7(_0x16abda);});});}exports[_0x0e92('0x15')]=function(_0x58f708){var _0x335717=this;return new Promise(function(_0x5b2212,_0x3ad1e5){return db[_0x0e92('0x16')][_0x0e92('0x17')](_0x58f708[_0x0e92('0x18')],{'raw':_0x58f708['options']?_0x58f708[_0x0e92('0x19')][_0x0e92('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58f708[_0x0e92('0x19')]?_0x58f708['options']['where']||null:null,'attributes':_0x58f708[_0x0e92('0x19')]?_0x58f708['options'][_0x0e92('0x1b')]||null:null,'limit':_0x58f708['options']?_0x58f708[_0x0e92('0x19')]['limit']||null:null})[_0x0e92('0x1c')](function(_0x5f0d92){logger['info']('UpdateFaxApplication',_0x58f708);logger[_0x0e92('0xc')](_0x0e92('0x15'),_0x58f708,JSON[_0x0e92('0xe')](_0x5f0d92));_0x5b2212(_0x5f0d92);})[_0x0e92('0x14')](function(_0x6da9d9){logger[_0x0e92('0xf')]('UpdateFaxApplication',_0x6da9d9[_0x0e92('0x11')],_0x58f708);_0x3ad1e5(_0x335717['error'](0x1f4,_0x6da9d9[_0x0e92('0x11')]));});});};
\ No newline at end of file
index ccdbe19..7d7590f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefda,0x96));var _0xaefd=function(_0x4a31f6,_0x3a58d5){_0x4a31f6=_0x4a31f6-0x0;var _0x2a630d=_0xefda[_0x4a31f6];return _0x2a630d;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router;
\ No newline at end of file
+var _0xe5b5=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x325744,_0x3fad43){var _0x32ef8f=function(_0x2216ad){while(--_0x2216ad){_0x325744['push'](_0x325744['shift']());}};_0x32ef8f(++_0x3fad43);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xe5b5[_0x39096d];return _0x13da4f;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0x10')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0x12')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x13')]);router['delete'](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x14')]);module[_0x5e5b('0x15')]=router;
\ No newline at end of file
index 53b3425..52d2b68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf2a=['STRING','DATE','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x55c6e0,_0x1db49d){var _0x523cee=function(_0x4f9a02){while(--_0x4f9a02){_0x55c6e0['push'](_0x55c6e0['shift']());}};_0x523cee(++_0x1db49d);}(_0xaf2a,0x1c4));var _0xaaf2=function(_0xc1f662,_0x28415b){_0xc1f662=_0xc1f662-0x0;var _0x296892=_0xaf2a[_0xc1f662];return _0x296892;};'use strict';var Sequelize=require(_0xaaf2('0x0'));module[_0xaaf2('0x1')]={'closed':{'type':Sequelize[_0xaaf2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xaaf2('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaaf2('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xaaf2('0x4')]},'fax':{'type':Sequelize[_0xaaf2('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xaaf2('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaaf2('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xaaf2('0x6')]('in',_0xaaf2('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x1920=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x220e9b,_0x91ddb2){var _0x2a3524=function(_0x419347){while(--_0x419347){_0x220e9b['push'](_0x220e9b['shift']());}};_0x2a3524(++_0x91ddb2);}(_0x1920,0x129));var _0x0192=function(_0x5505b1,_0x2aa0f5){_0x5505b1=_0x5505b1-0x0;var _0x123ef5=_0x1920[_0x5505b1];return _0x123ef5;};'use strict';var Sequelize=require(_0x0192('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0192('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0192('0x2')]},'disposition':{'type':Sequelize[_0x0192('0x3')]},'secondDisposition':{'type':Sequelize[_0x0192('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0192('0x3')]},'note':{'type':Sequelize[_0x0192('0x3')]},'read1stAt':{'type':Sequelize[_0x0192('0x2')]},'fax':{'type':Sequelize[_0x0192('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0192('0x4')]('in',_0x0192('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0192('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0192('0x4')]('in',_0x0192('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index e559476..a74114b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5eb=['offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','waiting','unmanaged','closed','UserId','talking','answered','total','index','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','select','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','isEmpty','FaxAccountId','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','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','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','keyBy','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','pick','includeAll','findAll','spread','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','attachments','format','Messages','createdAt','get','mkdirSync','Attachment','basename','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','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','sendStatus','status','end','json'];(function(_0x23f6e5,_0xacd19e){var _0x1698d4=function(_0x49dd3f){while(--_0x49dd3f){_0x23f6e5['push'](_0x23f6e5['shift']());}};_0x1698d4(++_0xacd19e);}(_0xe5eb,0x19b));var _0xbe5e=function(_0x4549b0,_0x132a66){_0x4549b0=_0x4549b0-0x0;var _0x95552a=_0xe5eb[_0x4549b0];return _0x95552a;};'use strict';var emlformat=require(_0xbe5e('0x0'));var rimraf=require(_0xbe5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe5e('0x2'));var moment=require(_0xbe5e('0x3'));var BPromise=require(_0xbe5e('0x4'));var Mustache=require(_0xbe5e('0x5'));var util=require(_0xbe5e('0x6'));var path=require('path');var sox=require(_0xbe5e('0x7'));var csv=require(_0xbe5e('0x8'));var ejs=require(_0xbe5e('0x9'));var fs=require('fs');var fs_extra=require(_0xbe5e('0xa'));var _=require(_0xbe5e('0xb'));var squel=require('squel');var crypto=require(_0xbe5e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbe5e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbe5e('0xe'));var Papa=require(_0xbe5e('0xf'));var Redis=require(_0xbe5e('0x10'));var authService=require(_0xbe5e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbe5e('0x12'));var hardwareService=require(_0xbe5e('0x13'));var logger=require('../../config/logger')(_0xbe5e('0x14'));var utils=require(_0xbe5e('0x15'));var config=require(_0xbe5e('0x16'));var licenseUtil=require(_0xbe5e('0x17'));var db=require(_0xbe5e('0x18'))['db'];config[_0xbe5e('0x19')]=_[_0xbe5e('0x1a')](config['redis'],{'host':_0xbe5e('0x1b'),'port':0x18eb});var socket=require(_0xbe5e('0x1c'))(new Redis(config[_0xbe5e('0x19')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5dcc42,_0x5c4b4f){_0x5c4b4f=_0x5c4b4f||0xcc;return function(_0x2e8f35){if(_0x2e8f35){return _0x5dcc42[_0xbe5e('0x1d')](_0x5c4b4f);}return _0x5dcc42[_0xbe5e('0x1e')](_0x5c4b4f)[_0xbe5e('0x1f')]();};}function respondWithResult(_0x167fe8,_0x22fe6b){_0x22fe6b=_0x22fe6b||0xc8;return function(_0x26684b){if(_0x26684b){return _0x167fe8['status'](_0x22fe6b)[_0xbe5e('0x20')](_0x26684b);}};}function respondWithFilteredResult(_0x5ebc18,_0x5d78ab){return function(_0x160fb9){if(_0x160fb9){var _0x1a64c9=typeof _0x5d78ab[_0xbe5e('0x21')]===_0xbe5e('0x22')&&typeof _0x5d78ab[_0xbe5e('0x23')]===_0xbe5e('0x22');var _0x8300c6=_0x160fb9[_0xbe5e('0x24')];var _0x17c31a=_0x1a64c9?0x0:_0x5d78ab[_0xbe5e('0x21')];var _0x57d88a=_0x1a64c9?_0x160fb9[_0xbe5e('0x24')]:_0x5d78ab[_0xbe5e('0x21')]+_0x5d78ab['limit'];var _0x45862d;if(_0x57d88a>=_0x8300c6){_0x57d88a=_0x8300c6;_0x45862d=0xc8;}else{_0x45862d=0xce;}_0x5ebc18[_0xbe5e('0x1e')](_0x45862d);return _0x5ebc18[_0xbe5e('0x25')]('Content-Range',_0x17c31a+'-'+_0x57d88a+'/'+_0x8300c6)[_0xbe5e('0x20')](_0x160fb9);}return null;};}function patchUpdates(_0x30e24){return function(_0x1dfe40){try{jsonpatch[_0xbe5e('0x26')](_0x1dfe40,_0x30e24,!![]);}catch(_0x34a85a){return BPromise['reject'](_0x34a85a);}return _0x1dfe40[_0xbe5e('0x27')]();};}function saveUpdates(_0x393f0c,_0x18c6d3){return function(_0x463ab1){if(_0x463ab1){return _0x463ab1[_0xbe5e('0x28')](_0x393f0c)[_0xbe5e('0x29')](function(_0x1ee255){return _0x1ee255;});}return null;};}function removeEntity(_0x32d388,_0x3ff1e2){return function(_0x1687a7){if(_0x1687a7){return _0x1687a7[_0xbe5e('0x2a')]()['then'](function(){_0x32d388['status'](0xcc)[_0xbe5e('0x1f')]();});}};}function handleEntityNotFound(_0x2efee0,_0x5ab696){return function(_0x12cd02){if(!_0x12cd02){_0x2efee0[_0xbe5e('0x1d')](0x194);}return _0x12cd02;};}function handleError(_0x423b8c,_0x530046){_0x530046=_0x530046||0x1f4;return function(_0x4ffb90){logger[_0xbe5e('0x2b')](_0x4ffb90[_0xbe5e('0x2c')]);if(_0x4ffb90[_0xbe5e('0x2d')]){delete _0x4ffb90[_0xbe5e('0x2d')];}_0x423b8c[_0xbe5e('0x1e')](_0x530046)[_0xbe5e('0x2e')](_0x4ffb90);};}function getInteractionUsers(_0x10673d,_0x53ec63){return new BPromise(function(_0x159454,_0x36510a){try{if(_0x53ec63[_0x10673d['id']]){_0x10673d[_0xbe5e('0x2f')]=_[_0xbe5e('0x30')](_0x53ec63[_0x10673d['id']],function(_0x57811a){return{'id':_0x57811a['id'],'fullname':_0x57811a[_0xbe5e('0x31')]};});}}catch(_0x18aa7c){_0x36510a(_0x18aa7c);}_0x159454(_0x10673d);});}function getInteractionTags(_0x2d88c4,_0x1f118f){return new BPromise(function(_0x344e58,_0x4703d4){try{if(_0x2d88c4['TagIds']){_0x2d88c4['Tags']=[];_0x2d88c4[_0xbe5e('0x32')][_0xbe5e('0x33')](',')[_0xbe5e('0x34')](function(_0xa32a90){_0x2d88c4['Tags'][_0xbe5e('0x35')](_0x1f118f[_0xa32a90]);});}delete _0x2d88c4['TagIds'];}catch(_0x16cfbf){_0x4703d4(_0x16cfbf);}_0x344e58(_0x2d88c4);});}function updateFaxInteraction(_0x54a3c6,_0x25fa49,_0x3bae8a){return new BPromise(function(_0x213cf0,_0x9ce7f5){return getInteractionUsers(_0x54a3c6,_0x3bae8a)[_0xbe5e('0x29')](function(_0x3ea65b){return getInteractionTags(_0x3ea65b,_0x25fa49);})[_0xbe5e('0x29')](function(_0x474694){return getStateInteraction(_0x474694);})[_0xbe5e('0x29')](function(_0x50d8db){_0x213cf0(_0x50d8db);})[_0xbe5e('0x36')](function(_0x5051da){_0x9ce7f5(_0x5051da);});});}function getStateInteraction(_0x3db2b4){return new BPromise(function(_0x54499b){_0x3db2b4[_0xbe5e('0x37')]=0x0;_0x3db2b4['talking']=0x0;_0x3db2b4['answered']=0x0;_0x3db2b4[_0xbe5e('0x38')]=0x0;_0x3db2b4['total']=0x0;if(!_0x3db2b4[_0xbe5e('0x39')]&&!_0x3db2b4['UserId']){_0x3db2b4[_0xbe5e('0x37')]+=0x1;}if(!_0x3db2b4[_0xbe5e('0x39')]&&_0x3db2b4[_0xbe5e('0x3a')]){_0x3db2b4[_0xbe5e('0x3b')]+=0x1;if(_0x3db2b4[_0xbe5e('0x37')]){_0x3db2b4[_0xbe5e('0x37')]-=0x1;}}if(_0x3db2b4[_0xbe5e('0x39')]&&_0x3db2b4[_0xbe5e('0x3a')]){_0x3db2b4[_0xbe5e('0x3c')]+=0x1;if(_0x3db2b4['talking']){_0x3db2b4[_0xbe5e('0x3b')]-=0x1;}}if(_0x3db2b4['closed']&&!_0x3db2b4[_0xbe5e('0x3a')]){_0x3db2b4[_0xbe5e('0x38')]+=0x1;if(_0x3db2b4[_0xbe5e('0x37')]){_0x3db2b4['waiting']-=0x1;}}_0x3db2b4[_0xbe5e('0x3d')]+=0x1;_0x54499b(_0x3db2b4);});}exports[_0xbe5e('0x3e')]=function(_0x3e5d43,_0xcc0592){var _0x34832d={},_0x8d6ca3={},_0xa90b97={'count':0x0,'rows':[]};var _0x583d28=_[_0xbe5e('0x30')](db[_0xbe5e('0x3f')][_0xbe5e('0x40')],function(_0xa07e77){return{'name':_0xa07e77[_0xbe5e('0x41')],'type':_0xa07e77[_0xbe5e('0x42')][_0xbe5e('0x43')]};});_0x8d6ca3['model']=_[_0xbe5e('0x30')](_0x583d28,'name');_0x8d6ca3[_0xbe5e('0x44')]=_[_0xbe5e('0x45')](_0x3e5d43[_0xbe5e('0x44')]);_0x8d6ca3[_0xbe5e('0x46')]=_['intersection'](_0x8d6ca3[_0xbe5e('0x47')],_0x8d6ca3[_0xbe5e('0x44')]);_0x34832d[_0xbe5e('0x48')]=_[_0xbe5e('0x49')](_0x8d6ca3['model'],qs[_0xbe5e('0x4a')](_0x3e5d43[_0xbe5e('0x44')][_0xbe5e('0x4a')]));_0x34832d[_0xbe5e('0x48')]=_0x34832d[_0xbe5e('0x48')][_0xbe5e('0x4b')]?_0x34832d['attributes']:_0x8d6ca3[_0xbe5e('0x47')];if(!_0x3e5d43[_0xbe5e('0x44')][_0xbe5e('0x4c')](_0xbe5e('0x4d'))){_0x34832d['limit']=qs[_0xbe5e('0x23')](_0x3e5d43['query'][_0xbe5e('0x23')]);_0x34832d[_0xbe5e('0x21')]=qs[_0xbe5e('0x21')](_0x3e5d43[_0xbe5e('0x44')]['offset']);}_0x34832d[_0xbe5e('0x4e')]=qs['sort'](_0x3e5d43[_0xbe5e('0x44')][_0xbe5e('0x4f')]);_0x34832d[_0xbe5e('0x50')]=qs['filters'](_['pick'](_0x3e5d43[_0xbe5e('0x44')],_0x8d6ca3[_0xbe5e('0x46')]),_0x583d28);var _0x1bd371=[];var _0x2f13e2=squel['select']()[_0xbe5e('0x51')]('id')[_0xbe5e('0x51')](_0xbe5e('0x2d'))[_0xbe5e('0x51')](_0xbe5e('0x52'))[_0xbe5e('0x53')](_0xbe5e('0x54'));var _0x28573e=squel[_0xbe5e('0x55')]()[_0xbe5e('0x51')]('u.id')[_0xbe5e('0x51')](_0xbe5e('0x56'))['field'](_0xbe5e('0x57'))[_0xbe5e('0x53')]('user_has_fax_interactions','ui')[_0xbe5e('0x58')](_0xbe5e('0x59'),'u',_0xbe5e('0x5a'));var _0x370b58=squel[_0xbe5e('0x55')]()['from'](_0xbe5e('0x5b'),'i')[_0xbe5e('0x58')](_0xbe5e('0x5c'),'c',_0xbe5e('0x5d'))[_0xbe5e('0x58')](_0xbe5e('0x59'),'o',_0xbe5e('0x5e'))[_0xbe5e('0x58')](_0xbe5e('0x5f'),'a','a.id\x20=\x20i.FaxAccountId')[_0xbe5e('0x58')](_0xbe5e('0x60'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xbe5e('0x58')](_0xbe5e('0x61'),'it',_0xbe5e('0x62'))[_0xbe5e('0x58')](_0xbe5e('0x54'),'t','t.id\x20=\x20it.TagId');var _0x5718ae=squel['expr']();var _0x2e2523=[];var _0x169357=squel[_0xbe5e('0x63')]();var _0x23eabf;if(_0x3e5d43[_0xbe5e('0x44')][_0xbe5e('0x64')]){_0x23eabf=as['parseSearch'](_0x3e5d43['query'][_0xbe5e('0x64')]);var _0x5b7a03=_0x23eabf[_0xbe5e('0x65')];for(var _0x5687e2=0x0;_0x5687e2<_0x23eabf[_0xbe5e('0x66')][_0xbe5e('0x4b')];_0x5687e2++){var _0x594eb9=_0x23eabf[_0xbe5e('0x66')][_0x5687e2];var _0x24a977='i';var _0x5e0397=_[_0xbe5e('0x67')](_0x583d28,[_0xbe5e('0x2d'),_0x594eb9[_0xbe5e('0x51')]]);if(!_0x5e0397){switch(_0x594eb9['field']){case _0xbe5e('0x68'):if(_0x594eb9['value']==0x1){_0x370b58['having']('`'+_0x594eb9['field']+_0xbe5e('0x69'));}else{_0x370b58[_0xbe5e('0x6a')]('`'+_0x594eb9['field']+'`\x20>\x200');}break;case _0xbe5e('0x6b'):if(_0x594eb9[_0xbe5e('0x6c')]===_0xbe5e('0x6d')){if(_0x594eb9['value']['split']('\x20')[_0xbe5e('0x4b')]>0x1){_0x5718ae[_0x5b7a03]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbe5e('0x6e')](_0x594eb9[_0xbe5e('0x6f')]),null);}else{var _0x4183be='%'+_0x594eb9[_0xbe5e('0x6f')]+'%';_0x5718ae[_0x5b7a03](_0xbe5e('0x70'),_0x4183be,_0x4183be,_0x4183be);}}else{_0x5e0397=_[_0xbe5e('0x67')](_0x583d28,[_0xbe5e('0x2d'),_0xbe5e('0x71')]);_0x594eb9[_0xbe5e('0x51')]=_0xbe5e('0x71');_0x2017f7=as[_0xbe5e('0x72')](_0x24a977,_0x5e0397[_0xbe5e('0x42')],_0x594eb9);_0x5718ae[_0x5b7a03](_0x2017f7['text'],_0x2017f7[_0xbe5e('0x6f')][_0xbe5e('0x73')],_0x2017f7[_0xbe5e('0x6f')][_0xbe5e('0x1f')]);}break;case _0xbe5e('0x74'):var _0x1468d5=_0x594eb9[_0xbe5e('0x6f')][_0xbe5e('0x33')](',')[_0xbe5e('0x30')](function(_0x326021){return Number(_0x326021);});_0x1468d5[_0xbe5e('0x34')](function(_0x31bd8e){_0x169357['or'](_0xbe5e('0x75'),'%,'+_0x31bd8e+',%');});_0x2e2523=_[_0xbe5e('0x76')](_0x2e2523,_0x1468d5);break;case _0xbe5e('0x77'):if(_0x594eb9[_0xbe5e('0x6c')]==='$substring'){_0x5718ae[_0x5b7a03](_0xbe5e('0x78'),'%'+_0x594eb9[_0xbe5e('0x6f')]+'%',null);}else{_0x5e0397=_[_0xbe5e('0x67')](_0x583d28,[_0xbe5e('0x2d'),_0xbe5e('0x3a')]);_0x594eb9[_0xbe5e('0x51')]='UserId';_0x2017f7=as[_0xbe5e('0x72')](_0x24a977,_0x5e0397['type'],_0x594eb9);_0x5718ae[_0x5b7a03](_0x2017f7[_0xbe5e('0x79')],_0x2017f7[_0xbe5e('0x6f')][_0xbe5e('0x73')],_0x2017f7[_0xbe5e('0x6f')][_0xbe5e('0x1f')]);}break;case _0xbe5e('0x7a'):_0x2017f7=as[_0xbe5e('0x72')]('me',null,_0x594eb9);_0x5718ae[_0x5b7a03](_0x2017f7['text'],_0x2017f7[_0xbe5e('0x6f')][_0xbe5e('0x73')],_0x2017f7[_0xbe5e('0x6f')][_0xbe5e('0x1f')]);break;}}else{var _0x2017f7=as[_0xbe5e('0x72')](_0x24a977,_0x5e0397[_0xbe5e('0x42')],_0x594eb9);_0x5718ae[_0x5b7a03](_0x2017f7[_0xbe5e('0x79')],_0x2017f7[_0xbe5e('0x6f')]['start'],_0x2017f7[_0xbe5e('0x6f')][_0xbe5e('0x1f')]);}}}else{var _0x5f24df=_(_0x3e5d43[_0xbe5e('0x44')])[_0xbe5e('0x45')]()[_0xbe5e('0x30')](function(_0x3854b0){return _[_0xbe5e('0x7b')](_0x583d28,['name',_0x3854b0])?_0x3854b0:undefined;})['compact']()[_0xbe5e('0x6f')]();if(!_[_0xbe5e('0x7c')](_0x5f24df)){_0x5f24df[_0xbe5e('0x34')](function(_0x540a8b){if(_0x540a8b===_0xbe5e('0x7d')){_0x370b58[_0xbe5e('0x50')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x3e5d43[_0xbe5e('0x44')][_0x540a8b]));}else if(_0x540a8b==='createdAt'){var _0x284423=JSON[_0xbe5e('0x7e')](_0x3e5d43[_0xbe5e('0x44')][_0x540a8b])[_0xbe5e('0x7f')];var _0x2e614f=JSON[_0xbe5e('0x7e')](_0x3e5d43['query'][_0x540a8b])['$lte'];_0x370b58[_0xbe5e('0x50')](_0xbe5e('0x80'),_0x284423,_0x2e614f);}else{if(_0x3e5d43['query'][_0x540a8b]===_0xbe5e('0x81')){_0x370b58[_0xbe5e('0x50')]('i.'+_0x540a8b+_0xbe5e('0x82'));}else{_0x370b58['where']('i.'+_0x540a8b+_0xbe5e('0x83'),_0x3e5d43['query'][_0x540a8b]);}}});}if(_0x3e5d43[_0xbe5e('0x44')]['read']){if(_0x3e5d43[_0xbe5e('0x44')]['read']==0x1){_0x370b58[_0xbe5e('0x6a')](_0xbe5e('0x84'));}else{_0x370b58['having'](_0xbe5e('0x85'));}}if(_0x3e5d43[_0xbe5e('0x44')][_0xbe5e('0x86')]){_0x2e2523=_[_0xbe5e('0x87')](_0x3e5d43[_0xbe5e('0x44')][_0xbe5e('0x86')])?_0x3e5d43[_0xbe5e('0x44')][_0xbe5e('0x86')]:new Array(_0x3e5d43['query'][_0xbe5e('0x86')]);_0x2e2523['forEach'](function(_0x51254f){_0x169357['or'](_0xbe5e('0x75'),'%,'+_0x51254f+',%');});}if(_0x3e5d43[_0xbe5e('0x44')]['filter']){var _0x1535de=_0x3e5d43['query'][_0xbe5e('0x88')][_0xbe5e('0x89')]('\x5c','\x5c\x5c')[_0xbe5e('0x89')](/'/g,'\x27\x27');if(qs[_0xbe5e('0x8a')](_0x1535de)){_0x5718ae['or'](_0xbe5e('0x8b'),_0x1535de+'%')['or'](_0xbe5e('0x8c'),_0x1535de+'%');}_0x5718ae['or'](_0xbe5e('0x8d'),_0x1535de+'%');}}_0x370b58[_0xbe5e('0x50')](_0x5718ae);_0x370b58['group'](_0xbe5e('0x8e'));var _0x446481={'type':db[_0xbe5e('0x8f')][_0xbe5e('0x90')][_0xbe5e('0x91')],'raw':!![]};var _0x506823=_0x370b58[_0xbe5e('0x92')]();_0x506823['field'](_0xbe5e('0x8e'));_0x506823[_0xbe5e('0x51')](_0xbe5e('0x93'),_0xbe5e('0x68'));if(_0x34832d[_0xbe5e('0x4e')]){_0x34832d['order'][_0xbe5e('0x34')](function(_0x5dc4b5){var _0x292cc3=_0x5dc4b5[0x0]===_0xbe5e('0x94')?_0x5dc4b5[0x0]:'i.'+_0x5dc4b5[0x0];_0x370b58[_0xbe5e('0x4e')](_0x292cc3,_0x5dc4b5[0x1]===_0xbe5e('0x95')?![]:!![]);});}if(!_[_0xbe5e('0x7c')](_0x2e2523)){_0x370b58['having'](_0x169357);_0x506823[_0xbe5e('0x50')](_0xbe5e('0x96'),_0x2e2523);}BPromise['resolve']()[_0xbe5e('0x29')](function(){if(!_0x23eabf){if(_0x3e5d43['query'][_0xbe5e('0x7d')])return;_0x506823['where'](_0xbe5e('0x97'));_0x370b58[_0xbe5e('0x50')](_0xbe5e('0x97'));return;}if(_0x3e5d43[_0xbe5e('0x98')]['role']!==_0xbe5e('0x99'))return;return _0x3e5d43[_0xbe5e('0x98')][_0xbe5e('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x44e564){if(_[_0xbe5e('0x7c')](_0x44e564)){_0x506823['where'](_0xbe5e('0x9b'));_0x370b58[_0xbe5e('0x50')](_0xbe5e('0x9b'));}else{_0x506823[_0xbe5e('0x50')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x44e564,'id'));_0x370b58['where']('i.FaxAccountId\x20IN\x20?',_[_0xbe5e('0x30')](_0x44e564,'id'));}});})['then'](function(){if(_0x3e5d43['user'][_0xbe5e('0x9c')]===_0xbe5e('0x99')&&!_0x23eabf&&!_0x3e5d43[_0xbe5e('0x44')][_0xbe5e('0x7d')])return[];return db[_0xbe5e('0x9d')][_0xbe5e('0x44')](_0x506823['toString'](),_0x446481);})[_0xbe5e('0x29')](function(_0x372560){_0xa90b97[_0xbe5e('0x24')]=_0x372560['length'];if(_0xa90b97[_0xbe5e('0x24')]===0x0)return[];return db[_0xbe5e('0x9d')][_0xbe5e('0x44')](_0x2f13e2['toString'](),_0x446481)[_0xbe5e('0x29')](function(_0x72f35f){_0x1bd371=_[_0xbe5e('0x9e')](_0x72f35f,'id');_0x446481=_[_0xbe5e('0x9f')](_0x446481,{'model':db[_0xbe5e('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3e5d43[_0xbe5e('0x44')]['fields']){_0x34832d[_0xbe5e('0x48')][_0xbe5e('0x34')](function(_0x2dd12f){_0x370b58[_0xbe5e('0x51')]('i.'+_0x2dd12f);});}else{_0x370b58[_0xbe5e('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbe5e('0x68'));_0x370b58[_0xbe5e('0x51')]('a.key',_0xbe5e('0xa0'));_0x370b58[_0xbe5e('0x51')](_0xbe5e('0xa1'),_0xbe5e('0xa2'));_0x370b58['field'](_0xbe5e('0xa3'),'contactName');_0x370b58[_0xbe5e('0x51')]('i.*');_0x370b58[_0xbe5e('0x51')](_0xbe5e('0xa4'),_0xbe5e('0xa5'));_0x370b58[_0xbe5e('0x51')](_0xbe5e('0xa6'),_0xbe5e('0xa7'));_0x370b58['field']('c.email','Contact.email');_0x370b58[_0xbe5e('0x51')](_0xbe5e('0xa8'),_0xbe5e('0xa9'));_0x370b58[_0xbe5e('0x51')](_0xbe5e('0xaa'),'Contact.mobile');_0x370b58['field'](_0xbe5e('0xab'),_0xbe5e('0xac'));_0x370b58[_0xbe5e('0x51')](_0xbe5e('0xad'),_0xbe5e('0xae'));_0x370b58[_0xbe5e('0x51')]('o.internal',_0xbe5e('0xaf'));_0x370b58['field'](_0xbe5e('0xb0'),_0xbe5e('0x32'));}if(_0x34832d[_0xbe5e('0x23')])_0x370b58[_0xbe5e('0x23')](_0x34832d[_0xbe5e('0x23')]);if(_0x34832d[_0xbe5e('0x21')])_0x370b58[_0xbe5e('0x21')](_0x34832d[_0xbe5e('0x21')]);return db[_0xbe5e('0x9d')]['query'](_0x370b58[_0xbe5e('0xb1')](),_0x446481);})[_0xbe5e('0x29')](function(_0x1f2da7){if(_0x1f2da7[_0xbe5e('0x4b')]>0x0)_0x28573e[_0xbe5e('0x50')](_0xbe5e('0xb2'),_[_0xbe5e('0x30')](_0x1f2da7,'id'));return db[_0xbe5e('0x9d')][_0xbe5e('0x44')](_0x28573e[_0xbe5e('0xb1')](),_0x446481)[_0xbe5e('0x29')](function(_0x1c51b9){var _0xe15fc7=_[_0xbe5e('0xb3')](_0x1c51b9,_0xbe5e('0xb4'));var _0x30f7ba=[];_0x1f2da7[_0xbe5e('0x34')](function(_0x34d934){_0x30f7ba['push'](updateFaxInteraction(_0x34d934,_0x1bd371,_0xe15fc7));});return BPromise[_0xbe5e('0xb5')](_0x30f7ba);});});})[_0xbe5e('0x29')](function(_0x24dc2a){_0xa90b97[_0xbe5e('0xb6')]=_0x24dc2a;return _0xa90b97;})[_0xbe5e('0x29')](respondWithFilteredResult(_0xcc0592,_0x34832d))[_0xbe5e('0x36')](handleError(_0xcc0592,null));};exports[_0xbe5e('0xb7')]=function(_0x19bd88,_0x352c18){var _0x3d5e13={'raw':![],'where':{'id':_0x19bd88[_0xbe5e('0xb8')]['id']}},_0x51cc32={};_0x51cc32['model']=_[_0xbe5e('0x45')](db['FaxInteraction'][_0xbe5e('0x40')]);_0x51cc32[_0xbe5e('0x44')]=_['keys'](_0x19bd88[_0xbe5e('0x44')]);_0x51cc32[_0xbe5e('0x46')]=_[_0xbe5e('0x49')](_0x51cc32[_0xbe5e('0x47')],_0x51cc32[_0xbe5e('0x44')]);_0x3d5e13[_0xbe5e('0x48')]=_[_0xbe5e('0x49')](_0x51cc32[_0xbe5e('0x47')],qs['fields'](_0x19bd88[_0xbe5e('0x44')]['fields']));_0x3d5e13[_0xbe5e('0x48')]=_0x3d5e13[_0xbe5e('0x48')][_0xbe5e('0x4b')]?_0x3d5e13[_0xbe5e('0x48')]:_0x51cc32[_0xbe5e('0x47')];if(_0x19bd88[_0xbe5e('0x44')]['includeAll']){_0x3d5e13[_0xbe5e('0xb9')]=[{'all':!![]}];}_0x3d5e13=_[_0xbe5e('0x9f')]({},_0x3d5e13,_0x19bd88[_0xbe5e('0xba')]);return db[_0xbe5e('0x3f')][_0xbe5e('0x67')](_0x3d5e13)['then'](handleEntityNotFound(_0x352c18,null))[_0xbe5e('0x29')](respondWithResult(_0x352c18,null))[_0xbe5e('0x36')](handleError(_0x352c18,null));};exports[_0xbe5e('0xbb')]=function(_0xaa6094,_0x148b14){return db[_0xbe5e('0x3f')]['create'](_0xaa6094[_0xbe5e('0x7a')],{})[_0xbe5e('0x29')](respondWithResult(_0x148b14,0xc9))[_0xbe5e('0x36')](handleError(_0x148b14,null));};exports[_0xbe5e('0x28')]=function(_0x1a17fb,_0x25e079){if(_0x1a17fb['body']['id']){delete _0x1a17fb['body']['id'];}return db[_0xbe5e('0x3f')][_0xbe5e('0x67')]({'where':{'id':_0x1a17fb[_0xbe5e('0xb8')]['id']}})[_0xbe5e('0x29')](handleEntityNotFound(_0x25e079,null))[_0xbe5e('0x29')](saveUpdates(_0x1a17fb[_0xbe5e('0x7a')],null))[_0xbe5e('0x29')](respondWithResult(_0x25e079,null))['catch'](handleError(_0x25e079,null));};exports[_0xbe5e('0x2a')]=function(_0x2e23bb,_0x54457b){return db[_0xbe5e('0x3f')][_0xbe5e('0x67')]({'where':{'id':_0x2e23bb[_0xbe5e('0xb8')]['id']}})[_0xbe5e('0x29')](handleEntityNotFound(_0x54457b,null))['then'](removeEntity(_0x54457b,null))[_0xbe5e('0x36')](handleError(_0x54457b,null));};exports[_0xbe5e('0xbc')]=function(_0x50610a,_0x4eed71){return db[_0xbe5e('0x3f')][_0xbe5e('0xbc')]()[_0xbe5e('0x29')](respondWithResult(_0x4eed71,null))[_0xbe5e('0x36')](handleError(_0x4eed71,null));};exports[_0xbe5e('0xbd')]=function(_0x37451f,_0x247603,_0x21b2ec){return db[_0xbe5e('0xbe')][_0xbe5e('0x67')]({'where':{'id':_0x37451f[_0xbe5e('0xb8')]['id']}})[_0xbe5e('0x29')](handleEntityNotFound(_0x247603,null))['then'](function(_0x5ed14b){if(_0x5ed14b){return _0x5ed14b[_0xbe5e('0xbd')](_0x37451f[_0xbe5e('0x7a')][_0xbe5e('0xbf')],_[_0xbe5e('0xc0')](_0x37451f['body'],['ids','id'])||{});}})[_0xbe5e('0x29')](respondWithResult(_0x247603,null))[_0xbe5e('0x36')](handleError(_0x247603,null));};exports[_0xbe5e('0xc1')]=function(_0x59aec6,_0x20ec33,_0x392fb9){var _0x204bdc={'raw':![],'where':{}};var _0x26ce02={};var _0x1006e7={'count':0x0,'rows':[]};return db[_0xbe5e('0x3f')][_0xbe5e('0xc2')]({'where':{'id':_0x59aec6[_0xbe5e('0xb8')]['id']}})[_0xbe5e('0x29')](handleEntityNotFound(_0x20ec33,null))[_0xbe5e('0x29')](function(_0x5192a0){if(_0x5192a0){_0x26ce02[_0xbe5e('0x47')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x26ce02[_0xbe5e('0x44')]=_['keys'](_0x59aec6[_0xbe5e('0x44')]);_0x26ce02[_0xbe5e('0x46')]=_[_0xbe5e('0x49')](_0x26ce02[_0xbe5e('0x47')],_0x26ce02[_0xbe5e('0x44')]);_0x204bdc['attributes']=_[_0xbe5e('0x49')](_0x26ce02[_0xbe5e('0x47')],qs[_0xbe5e('0x4a')](_0x59aec6[_0xbe5e('0x44')]['fields']));_0x204bdc[_0xbe5e('0x48')]=_0x204bdc[_0xbe5e('0x48')][_0xbe5e('0x4b')]?_0x204bdc[_0xbe5e('0x48')]:_0x26ce02[_0xbe5e('0x47')];if(!_0x59aec6['query'][_0xbe5e('0x4c')]('nolimit')){_0x204bdc[_0xbe5e('0x23')]=qs['limit'](_0x59aec6[_0xbe5e('0x44')][_0xbe5e('0x23')]);_0x204bdc[_0xbe5e('0x21')]=qs['offset'](_0x59aec6[_0xbe5e('0x44')][_0xbe5e('0x21')]);}_0x204bdc[_0xbe5e('0x4e')]=qs['sort'](_0x59aec6[_0xbe5e('0x44')][_0xbe5e('0x4f')]);_0x204bdc['where']=qs[_0xbe5e('0x46')](_[_0xbe5e('0xc3')](_0x59aec6['query'],_0x26ce02[_0xbe5e('0x46')]));_0x204bdc['where']['FaxInteractionId']=_0x5192a0['id'];if(_0x59aec6[_0xbe5e('0x44')][_0xbe5e('0x88')]){_0x204bdc[_0xbe5e('0x50')]=_['merge'](_0x204bdc[_0xbe5e('0x50')],{'$or':_[_0xbe5e('0x30')](_0x204bdc[_0xbe5e('0x48')],function(_0x53b320){var _0x122cc6={};_0x122cc6[_0x53b320]={'$like':'%'+_0x59aec6['query']['filter']+'%'};return _0x122cc6;})});}if(_0x59aec6[_0xbe5e('0x44')][_0xbe5e('0x7f')]){var _0x29da38=_0x59aec6[_0xbe5e('0x44')][_0xbe5e('0x7f')]['split'](',');var _0x12cea2={};_0x12cea2[_0x29da38[0x0]]={'$gte':moment(_0x29da38[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x204bdc[_0xbe5e('0x50')]=_[_0xbe5e('0x9f')](_0x204bdc[_0xbe5e('0x50')],_0x12cea2);}_0x204bdc=_[_0xbe5e('0x9f')]({},_0x204bdc,_0x59aec6[_0xbe5e('0xba')]);return db[_0xbe5e('0xbe')][_0xbe5e('0x24')]({'where':_0x204bdc[_0xbe5e('0x50')]})[_0xbe5e('0x29')](function(_0xbf6d6d){_0x1006e7[_0xbe5e('0x24')]=_0xbf6d6d;if(_0x59aec6[_0xbe5e('0x44')][_0xbe5e('0xc4')]){_0x204bdc[_0xbe5e('0xb9')]=[{'all':!![]}];}return db[_0xbe5e('0xbe')][_0xbe5e('0xc5')](_0x204bdc);})[_0xbe5e('0x29')](function(_0x332c64){_0x1006e7[_0xbe5e('0xb6')]=_0x332c64;return _0x1006e7;});}})[_0xbe5e('0x29')](respondWithFilteredResult(_0x20ec33,_0x204bdc))[_0xbe5e('0x36')](handleError(_0x20ec33,null));};exports['addTags']=function(_0x524b74,_0x316598,_0xea4614){return db[_0xbe5e('0x3f')][_0xbe5e('0x67')]({'where':{'id':_0x524b74[_0xbe5e('0xb8')]['id']}})['then'](handleEntityNotFound(_0x316598,null))[_0xbe5e('0x29')](function(_0x4d2c42){if(_0x4d2c42){return _0x4d2c42['setTags'](_0x524b74['body'][_0xbe5e('0xbf')],_['omit'](_0x524b74[_0xbe5e('0x7a')],[_0xbe5e('0xbf'),'id'])||{})[_0xbe5e('0xc6')](function(){return db['Tag'][_0xbe5e('0xc5')]({'attributes':['id',_0xbe5e('0x2d'),_0xbe5e('0x52')],'where':{'id':_0x524b74['body'][_0xbe5e('0xbf')]}});})[_0xbe5e('0x29')](function(_0x2e60c3){socket['emit'](_0xbe5e('0xc7'),{'id':Number(_0x524b74[_0xbe5e('0xb8')]['id']),'tags':_0x2e60c3||[]});return{'id':Number(_0x524b74['params']['id']),'tags':_0x2e60c3||[]};});}})[_0xbe5e('0x29')](respondWithResult(_0x316598,null))[_0xbe5e('0x36')](handleError(_0x316598,null));};exports[_0xbe5e('0xc8')]=function(_0x34e7f4,_0x497ae4,_0x139925){return db[_0xbe5e('0x3f')][_0xbe5e('0x67')]({'where':{'id':_0x34e7f4['params']['id']}})['then'](handleEntityNotFound(_0x497ae4,null))[_0xbe5e('0x29')](function(_0x10e097){if(_0x10e097){return _0x10e097['removeTags'](_0x34e7f4[_0xbe5e('0x44')][_0xbe5e('0xbf')]);}})[_0xbe5e('0x29')](respondWithStatusCode(_0x497ae4,null))[_0xbe5e('0x36')](handleError(_0x497ae4,null));};exports[_0xbe5e('0xc9')]=function(_0x103b23,_0x194717){var _0x2f955a=moment()[_0xbe5e('0xca')]()['toString']();var _0x363e06=path[_0xbe5e('0xcb')](config[_0xbe5e('0xcc')],_0xbe5e('0xcd'),'files',_0xbe5e('0xce'));var _0x3eadb3=path[_0xbe5e('0xcb')](config[_0xbe5e('0xcc')],_0xbe5e('0xcd'),'files',_0xbe5e('0xcf'));var _0x4158d5=path[_0xbe5e('0xcb')](_0x363e06,_0x2f955a);var _0x29e65e=util[_0xbe5e('0xd0')]('transcript-%d-%s.zip',_0x103b23[_0xbe5e('0xb8')]['id'],_0x2f955a);var _0x298b68=path[_0xbe5e('0xcb')](_0x363e06,_0x29e65e);var _0x13057d=[];_0x13057d[_0xbe5e('0x35')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x66bbc2=[{'model':db[_0xbe5e('0xbe')],'as':_0xbe5e('0xd1'),'attributes':['id',_0xbe5e('0x7a'),_0xbe5e('0xd2')],'include':_0x13057d}];return db[_0xbe5e('0x3f')]['find']({'where':{'id':_0x103b23['params']['id']},'include':_0x66bbc2})['then'](handleEntityNotFound(_0x194717,null))['then'](function(_0x15f5ee){if(_0x15f5ee&&_0x15f5ee[_0xbe5e('0xd1')]){var _0x4187e6=_0x15f5ee[_0xbe5e('0xd3')]({'plain':!![]});fs[_0xbe5e('0xd4')](_0x4158d5);for(var _0x3a15d9=0x0;_0x3a15d9<_0x4187e6[_0xbe5e('0xd1')]['length'];_0x3a15d9++){var _0x2295a8=_0x4187e6[_0xbe5e('0xd1')][_0x3a15d9][_0xbe5e('0xd5')];if(_0x2295a8){var _0x300794=path[_0xbe5e('0xcb')](_0x3eadb3,_0x2295a8[_0xbe5e('0xd6')]);if(fs['existsSync'](_0x300794)){fs[_0xbe5e('0xd7')](_0x300794)[_0xbe5e('0xd8')](fs[_0xbe5e('0xd9')](path[_0xbe5e('0xcb')](_0x4158d5,_0x2295a8[_0xbe5e('0xd6')])));}}}return BPromise[_0xbe5e('0xda')]()['then'](function(){return new BPromise(function(_0xd25184,_0x1cbb84){zipdir(_0x4158d5,{'saveTo':_0x298b68},function(_0x540861,_0x360de9){if(_0x540861)return _0x1cbb84(_0x540861);return _0xd25184(_0x360de9);});})[_0xbe5e('0x29')](function(){return new BPromise(function(_0x498758,_0x3a558f){rimraf(_0x4158d5,function(_0x1718c5){if(_0x1718c5)_0x3a558f(_0x1718c5);return _0x498758();});});})[_0xbe5e('0x29')](function(){return _0x194717[_0xbe5e('0xc9')](_0x298b68,_0x29e65e,function(_0x45487c){if(_0x45487c){console[_0xbe5e('0xdb')](_0xbe5e('0xdc'),_0x45487c);}else{fs[_0xbe5e('0xdd')](_0x298b68);}});});});}else{return _0x194717[_0xbe5e('0x1d')](0xc8);}})['catch'](handleError(_0x194717,null));};
\ No newline at end of file
+var _0x81ba=['users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','start','compact','isEmpty','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','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)','contactName','DESC','t.id\x20IN\x20?','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','params','keys','includeAll','include','options','catch','create','body','describe','FaxMessage','addMessage','ids','getMessages','findOne','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','emit','removeTags','download','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','Attachment','createdAt','get','mkdirSync','Messages','basename','existsSync','createReadStream','createWriteStream','resolve','err','unlinkSync','eml-format','request-promise','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','map','fullname','TagIds','Tags','split','push','waiting','talking','answered','unmanaged','closed','UserId','total','index','FaxInteraction','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','left_join'];(function(_0x16e4f1,_0x30a75d){var _0x55b292=function(_0x5db60b){while(--_0x5db60b){_0x16e4f1['push'](_0x16e4f1['shift']());}};_0x55b292(++_0x30a75d);}(_0x81ba,0x8d));var _0xa81b=function(_0x4481a9,_0x54fd76){_0x4481a9=_0x4481a9-0x0;var _0xfbc02a=_0x81ba[_0x4481a9];return _0xfbc02a;};'use strict';var emlformat=require(_0xa81b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa81b('0x1'));var moment=require(_0xa81b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa81b('0x3'));var util=require(_0xa81b('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa81b('0x5'));var fs=require('fs');var fs_extra=require(_0xa81b('0x6'));var _=require(_0xa81b('0x7'));var squel=require(_0xa81b('0x8'));var crypto=require(_0xa81b('0x9'));var jsforce=require(_0xa81b('0xa'));var deskjs=require(_0xa81b('0xb'));var toCsv=require(_0xa81b('0xc'));var querystring=require(_0xa81b('0xd'));var Papa=require(_0xa81b('0xe'));var Redis=require('ioredis');var authService=require(_0xa81b('0xf'));var qs=require(_0xa81b('0x10'));var as=require(_0xa81b('0x11'));var hardwareService=require(_0xa81b('0x12'));var logger=require(_0xa81b('0x13'))(_0xa81b('0x14'));var utils=require(_0xa81b('0x15'));var config=require(_0xa81b('0x16'));var licenseUtil=require(_0xa81b('0x17'));var db=require(_0xa81b('0x18'))['db'];config[_0xa81b('0x19')]=_[_0xa81b('0x1a')](config[_0xa81b('0x19')],{'host':_0xa81b('0x1b'),'port':0x18eb});var socket=require(_0xa81b('0x1c'))(new Redis(config[_0xa81b('0x19')]));require('./faxInteraction.socket')[_0xa81b('0x1d')](socket);function respondWithStatusCode(_0x1d856b,_0x8569b4){_0x8569b4=_0x8569b4||0xcc;return function(_0x5851f7){if(_0x5851f7){return _0x1d856b['sendStatus'](_0x8569b4);}return _0x1d856b[_0xa81b('0x1e')](_0x8569b4)[_0xa81b('0x1f')]();};}function respondWithResult(_0x3034d3,_0x2eebc3){_0x2eebc3=_0x2eebc3||0xc8;return function(_0x5b2800){if(_0x5b2800){return _0x3034d3[_0xa81b('0x1e')](_0x2eebc3)[_0xa81b('0x20')](_0x5b2800);}};}function respondWithFilteredResult(_0x563182,_0x2d3e84){return function(_0x196c2e){if(_0x196c2e){var _0x4c2197=typeof _0x2d3e84[_0xa81b('0x21')]===_0xa81b('0x22')&&typeof _0x2d3e84[_0xa81b('0x23')]==='undefined';var _0x29b126=_0x196c2e[_0xa81b('0x24')];var _0x4d5165=_0x4c2197?0x0:_0x2d3e84[_0xa81b('0x21')];var _0x27c996=_0x4c2197?_0x196c2e[_0xa81b('0x24')]:_0x2d3e84[_0xa81b('0x21')]+_0x2d3e84[_0xa81b('0x23')];var _0x37e20c;if(_0x27c996>=_0x29b126){_0x27c996=_0x29b126;_0x37e20c=0xc8;}else{_0x37e20c=0xce;}_0x563182[_0xa81b('0x1e')](_0x37e20c);return _0x563182[_0xa81b('0x25')](_0xa81b('0x26'),_0x4d5165+'-'+_0x27c996+'/'+_0x29b126)[_0xa81b('0x20')](_0x196c2e);}return null;};}function patchUpdates(_0x16ddd7){return function(_0x4c595a){try{jsonpatch[_0xa81b('0x27')](_0x4c595a,_0x16ddd7,!![]);}catch(_0x641377){return BPromise['reject'](_0x641377);}return _0x4c595a[_0xa81b('0x28')]();};}function saveUpdates(_0x216dd0,_0x50fb09){return function(_0x583084){if(_0x583084){return _0x583084[_0xa81b('0x29')](_0x216dd0)[_0xa81b('0x2a')](function(_0x4d7147){return _0x4d7147;});}return null;};}function removeEntity(_0x5501f0,_0x4ed7c2){return function(_0x4bf674){if(_0x4bf674){return _0x4bf674[_0xa81b('0x2b')]()['then'](function(){_0x5501f0[_0xa81b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x260006,_0x4806c3){return function(_0x41d0ba){if(!_0x41d0ba){_0x260006[_0xa81b('0x2c')](0x194);}return _0x41d0ba;};}function handleError(_0x34685a,_0x5bc6d7){_0x5bc6d7=_0x5bc6d7||0x1f4;return function(_0x18afd5){logger[_0xa81b('0x2d')](_0x18afd5[_0xa81b('0x2e')]);if(_0x18afd5[_0xa81b('0x2f')]){delete _0x18afd5['name'];}_0x34685a[_0xa81b('0x1e')](_0x5bc6d7)['send'](_0x18afd5);};}function getInteractionUsers(_0x33dcbd,_0x290333){return new BPromise(function(_0x3fff38,_0x512f4a){try{if(_0x290333[_0x33dcbd['id']]){_0x33dcbd['Users']=_[_0xa81b('0x30')](_0x290333[_0x33dcbd['id']],function(_0x15ee65){return{'id':_0x15ee65['id'],'fullname':_0x15ee65[_0xa81b('0x31')]};});}}catch(_0x3be8c3){_0x512f4a(_0x3be8c3);}_0x3fff38(_0x33dcbd);});}function getInteractionTags(_0x45ef96,_0x41c46c){return new BPromise(function(_0x210781,_0x3ade8d){try{if(_0x45ef96[_0xa81b('0x32')]){_0x45ef96[_0xa81b('0x33')]=[];_0x45ef96[_0xa81b('0x32')][_0xa81b('0x34')](',')['forEach'](function(_0x14b014){_0x45ef96[_0xa81b('0x33')][_0xa81b('0x35')](_0x41c46c[_0x14b014]);});}delete _0x45ef96['TagIds'];}catch(_0x4d5cca){_0x3ade8d(_0x4d5cca);}_0x210781(_0x45ef96);});}function updateFaxInteraction(_0x19a87f,_0x304eb5,_0x195647){return new BPromise(function(_0xda115,_0x2cfdd4){return getInteractionUsers(_0x19a87f,_0x195647)['then'](function(_0x17001e){return getInteractionTags(_0x17001e,_0x304eb5);})['then'](function(_0x50c569){return getStateInteraction(_0x50c569);})[_0xa81b('0x2a')](function(_0x11b5a2){_0xda115(_0x11b5a2);})['catch'](function(_0x253893){_0x2cfdd4(_0x253893);});});}function getStateInteraction(_0x9be8e2){return new BPromise(function(_0x552e30){_0x9be8e2[_0xa81b('0x36')]=0x0;_0x9be8e2[_0xa81b('0x37')]=0x0;_0x9be8e2[_0xa81b('0x38')]=0x0;_0x9be8e2[_0xa81b('0x39')]=0x0;_0x9be8e2['total']=0x0;if(!_0x9be8e2[_0xa81b('0x3a')]&&!_0x9be8e2[_0xa81b('0x3b')]){_0x9be8e2['waiting']+=0x1;}if(!_0x9be8e2[_0xa81b('0x3a')]&&_0x9be8e2['UserId']){_0x9be8e2[_0xa81b('0x37')]+=0x1;if(_0x9be8e2['waiting']){_0x9be8e2[_0xa81b('0x36')]-=0x1;}}if(_0x9be8e2[_0xa81b('0x3a')]&&_0x9be8e2[_0xa81b('0x3b')]){_0x9be8e2[_0xa81b('0x38')]+=0x1;if(_0x9be8e2['talking']){_0x9be8e2[_0xa81b('0x37')]-=0x1;}}if(_0x9be8e2[_0xa81b('0x3a')]&&!_0x9be8e2['UserId']){_0x9be8e2['unmanaged']+=0x1;if(_0x9be8e2[_0xa81b('0x36')]){_0x9be8e2[_0xa81b('0x36')]-=0x1;}}_0x9be8e2[_0xa81b('0x3c')]+=0x1;_0x552e30(_0x9be8e2);});}exports[_0xa81b('0x3d')]=function(_0x432a58,_0x2c0e5c){var _0x42ee01={},_0x10aa44={},_0x165767={'count':0x0,'rows':[]};var _0x4b640b=_[_0xa81b('0x30')](db[_0xa81b('0x3e')]['rawAttributes'],function(_0x3f78a6){return{'name':_0x3f78a6[_0xa81b('0x3f')],'type':_0x3f78a6[_0xa81b('0x40')][_0xa81b('0x41')]};});_0x10aa44[_0xa81b('0x42')]=_[_0xa81b('0x30')](_0x4b640b,_0xa81b('0x2f'));_0x10aa44[_0xa81b('0x43')]=_['keys'](_0x432a58[_0xa81b('0x43')]);_0x10aa44[_0xa81b('0x44')]=_[_0xa81b('0x45')](_0x10aa44[_0xa81b('0x42')],_0x10aa44['query']);_0x42ee01[_0xa81b('0x46')]=_[_0xa81b('0x45')](_0x10aa44['model'],qs[_0xa81b('0x47')](_0x432a58[_0xa81b('0x43')][_0xa81b('0x47')]));_0x42ee01['attributes']=_0x42ee01[_0xa81b('0x46')]['length']?_0x42ee01[_0xa81b('0x46')]:_0x10aa44[_0xa81b('0x42')];if(!_0x432a58[_0xa81b('0x43')][_0xa81b('0x48')]('nolimit')){_0x42ee01['limit']=qs[_0xa81b('0x23')](_0x432a58[_0xa81b('0x43')][_0xa81b('0x23')]);_0x42ee01['offset']=qs[_0xa81b('0x21')](_0x432a58[_0xa81b('0x43')]['offset']);}_0x42ee01[_0xa81b('0x49')]=qs['sort'](_0x432a58[_0xa81b('0x43')][_0xa81b('0x4a')]);_0x42ee01[_0xa81b('0x4b')]=qs[_0xa81b('0x44')](_[_0xa81b('0x4c')](_0x432a58[_0xa81b('0x43')],_0x10aa44['filters']),_0x4b640b);var _0x42cbc1=[];var _0x371339=squel[_0xa81b('0x4d')]()[_0xa81b('0x4e')]('id')['field'](_0xa81b('0x2f'))[_0xa81b('0x4e')](_0xa81b('0x4f'))[_0xa81b('0x50')](_0xa81b('0x51'));var _0x46535f=squel[_0xa81b('0x4d')]()[_0xa81b('0x4e')](_0xa81b('0x52'))[_0xa81b('0x4e')](_0xa81b('0x53'))['field']('ui.FaxInteractionId')[_0xa81b('0x50')]('user_has_fax_interactions','ui')[_0xa81b('0x54')](_0xa81b('0x55'),'u',_0xa81b('0x56'));var _0x1d710=squel['select']()[_0xa81b('0x50')](_0xa81b('0x57'),'i')['left_join']('cm_contacts','c',_0xa81b('0x58'))['left_join'](_0xa81b('0x55'),'o',_0xa81b('0x59'))[_0xa81b('0x54')](_0xa81b('0x5a'),'a',_0xa81b('0x5b'))[_0xa81b('0x54')]('fax_messages','me',_0xa81b('0x5c'))[_0xa81b('0x54')](_0xa81b('0x5d'),'it',_0xa81b('0x5e'))[_0xa81b('0x54')](_0xa81b('0x51'),'t',_0xa81b('0x5f'));var _0x36ad14=squel[_0xa81b('0x60')]();var _0x3b6d9c=[];var _0x5937ba=squel[_0xa81b('0x60')]();var _0x9d27b0;if(_0x432a58[_0xa81b('0x43')]['search']){_0x9d27b0=as[_0xa81b('0x61')](_0x432a58[_0xa81b('0x43')][_0xa81b('0x62')]);var _0x471267=_0x9d27b0[_0xa81b('0x63')];for(var _0x5d6ab9=0x0;_0x5d6ab9<_0x9d27b0[_0xa81b('0x64')][_0xa81b('0x65')];_0x5d6ab9++){var _0x11be5a=_0x9d27b0[_0xa81b('0x64')][_0x5d6ab9];var _0x534b6f='i';var _0x3bf404=_[_0xa81b('0x66')](_0x4b640b,['name',_0x11be5a[_0xa81b('0x4e')]]);if(!_0x3bf404){switch(_0x11be5a[_0xa81b('0x4e')]){case'unreadMessages':if(_0x11be5a[_0xa81b('0x67')]==0x1){_0x1d710[_0xa81b('0x68')]('`'+_0x11be5a[_0xa81b('0x4e')]+_0xa81b('0x69'));}else{_0x1d710[_0xa81b('0x68')]('`'+_0x11be5a[_0xa81b('0x4e')]+_0xa81b('0x6a'));}break;case _0xa81b('0x6b'):if(_0x11be5a[_0xa81b('0x6c')]===_0xa81b('0x6d')){if(_0x11be5a[_0xa81b('0x67')][_0xa81b('0x34')]('\x20')['length']>0x1){_0x36ad14[_0x471267](_0xa81b('0x6e'),qs[_0xa81b('0x6f')](_0x11be5a[_0xa81b('0x67')]),null);}else{var _0x424d46='%'+_0x11be5a[_0xa81b('0x67')]+'%';_0x36ad14[_0x471267](_0xa81b('0x70'),_0x424d46,_0x424d46,_0x424d46);}}else{_0x3bf404=_['find'](_0x4b640b,[_0xa81b('0x2f'),'ContactId']);_0x11be5a[_0xa81b('0x4e')]='ContactId';_0x15493d=as[_0xa81b('0x71')](_0x534b6f,_0x3bf404[_0xa81b('0x40')],_0x11be5a);_0x36ad14[_0x471267](_0x15493d[_0xa81b('0x72')],_0x15493d[_0xa81b('0x67')]['start'],_0x15493d[_0xa81b('0x67')][_0xa81b('0x1f')]);}break;case _0xa81b('0x73'):var _0xba35e7=_0x11be5a['value'][_0xa81b('0x34')](',')[_0xa81b('0x30')](function(_0x474549){return Number(_0x474549);});_0xba35e7[_0xa81b('0x74')](function(_0x11540d){_0x5937ba['or'](_0xa81b('0x75'),'%,'+_0x11540d+',%');});_0x3b6d9c=_[_0xa81b('0x76')](_0x3b6d9c,_0xba35e7);break;case _0xa81b('0x77'):if(_0x11be5a[_0xa81b('0x6c')]==='$substring'){_0x36ad14[_0x471267]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x11be5a[_0xa81b('0x67')]+'%',null);}else{_0x3bf404=_['find'](_0x4b640b,['name','UserId']);_0x11be5a[_0xa81b('0x4e')]='UserId';_0x15493d=as[_0xa81b('0x71')](_0x534b6f,_0x3bf404[_0xa81b('0x40')],_0x11be5a);_0x36ad14[_0x471267](_0x15493d[_0xa81b('0x72')],_0x15493d[_0xa81b('0x67')]['start'],_0x15493d[_0xa81b('0x67')][_0xa81b('0x1f')]);}break;case'body':_0x15493d=as['buildExpression']('me',null,_0x11be5a);_0x36ad14[_0x471267](_0x15493d[_0xa81b('0x72')],_0x15493d[_0xa81b('0x67')][_0xa81b('0x78')],_0x15493d[_0xa81b('0x67')]['end']);break;}}else{var _0x15493d=as[_0xa81b('0x71')](_0x534b6f,_0x3bf404[_0xa81b('0x40')],_0x11be5a);_0x36ad14[_0x471267](_0x15493d[_0xa81b('0x72')],_0x15493d[_0xa81b('0x67')][_0xa81b('0x78')],_0x15493d[_0xa81b('0x67')][_0xa81b('0x1f')]);}}}else{var _0xb84818=_(_0x432a58[_0xa81b('0x43')])['keys']()[_0xa81b('0x30')](function(_0x53e1ae){return _['some'](_0x4b640b,[_0xa81b('0x2f'),_0x53e1ae])?_0x53e1ae:undefined;})[_0xa81b('0x79')]()[_0xa81b('0x67')]();if(!_[_0xa81b('0x7a')](_0xb84818)){_0xb84818[_0xa81b('0x74')](function(_0x1c6508){if(_0x1c6508==='FaxAccountId'){_0x1d710[_0xa81b('0x4b')](_0xa81b('0x7b'),[]['concat'](_0x432a58[_0xa81b('0x43')][_0x1c6508]));}else if(_0x1c6508==='createdAt'){var _0x2b2545=JSON[_0xa81b('0x7c')](_0x432a58[_0xa81b('0x43')][_0x1c6508])[_0xa81b('0x7d')];var _0x3c694e=JSON[_0xa81b('0x7c')](_0x432a58[_0xa81b('0x43')][_0x1c6508])[_0xa81b('0x7e')];_0x1d710[_0xa81b('0x4b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b2545,_0x3c694e);}else{if(_0x432a58[_0xa81b('0x43')][_0x1c6508]==='null'){_0x1d710[_0xa81b('0x4b')]('i.'+_0x1c6508+_0xa81b('0x7f'));}else{_0x1d710[_0xa81b('0x4b')]('i.'+_0x1c6508+'\x20=\x20?',_0x432a58[_0xa81b('0x43')][_0x1c6508]);}}});}if(_0x432a58[_0xa81b('0x43')][_0xa81b('0x80')]){if(_0x432a58[_0xa81b('0x43')][_0xa81b('0x80')]==0x1){_0x1d710['having'](_0xa81b('0x81'));}else{_0x1d710[_0xa81b('0x68')](_0xa81b('0x82'));}}if(_0x432a58[_0xa81b('0x43')][_0xa81b('0x83')]){_0x3b6d9c=_['isArray'](_0x432a58[_0xa81b('0x43')]['tag'])?_0x432a58[_0xa81b('0x43')][_0xa81b('0x83')]:new Array(_0x432a58[_0xa81b('0x43')]['tag']);_0x3b6d9c[_0xa81b('0x74')](function(_0xce9692){_0x5937ba['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xce9692+',%');});}if(_0x432a58[_0xa81b('0x43')][_0xa81b('0x84')]){var _0x5318a2=_0x432a58[_0xa81b('0x43')]['filter'][_0xa81b('0x85')]('\x5c','\x5c\x5c')[_0xa81b('0x85')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5318a2)){_0x36ad14['or'](_0xa81b('0x86'),_0x5318a2+'%')['or'](_0xa81b('0x87'),_0x5318a2+'%');}_0x36ad14['or'](_0xa81b('0x88'),_0x5318a2+'%');}}_0x1d710[_0xa81b('0x4b')](_0x36ad14);_0x1d710[_0xa81b('0x89')](_0xa81b('0x8a'));var _0x53b32c={'type':db[_0xa81b('0x8b')][_0xa81b('0x8c')][_0xa81b('0x8d')],'raw':!![]};var _0x43be32=_0x1d710[_0xa81b('0x8e')]();_0x43be32[_0xa81b('0x4e')](_0xa81b('0x8a'));_0x43be32[_0xa81b('0x4e')](_0xa81b('0x8f'),'unreadMessages');if(_0x42ee01['order']){_0x42ee01[_0xa81b('0x49')]['forEach'](function(_0x3f6c24){var _0x200dac=_0x3f6c24[0x0]===_0xa81b('0x90')?_0x3f6c24[0x0]:'i.'+_0x3f6c24[0x0];_0x1d710['order'](_0x200dac,_0x3f6c24[0x1]===_0xa81b('0x91')?![]:!![]);});}if(!_[_0xa81b('0x7a')](_0x3b6d9c)){_0x1d710['having'](_0x5937ba);_0x43be32[_0xa81b('0x4b')](_0xa81b('0x92'),_0x3b6d9c);}BPromise['resolve']()['then'](function(){if(!_0x9d27b0){if(_0x432a58[_0xa81b('0x43')][_0xa81b('0x93')])return;_0x43be32['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x1d710[_0xa81b('0x4b')](_0xa81b('0x94'));return;}if(_0x432a58['user'][_0xa81b('0x95')]!==_0xa81b('0x96'))return;return _0x432a58[_0xa81b('0x97')][_0xa81b('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0x30b62e){if(_[_0xa81b('0x7a')](_0x30b62e)){_0x43be32['where']('i.FaxAccountId\x20IS\x20NULL');_0x1d710[_0xa81b('0x4b')](_0xa81b('0x99'));}else{_0x43be32[_0xa81b('0x4b')](_0xa81b('0x7b'),_['map'](_0x30b62e,'id'));_0x1d710[_0xa81b('0x4b')](_0xa81b('0x7b'),_['map'](_0x30b62e,'id'));}});})[_0xa81b('0x2a')](function(){if(_0x432a58['user']['role']===_0xa81b('0x96')&&!_0x9d27b0&&!_0x432a58[_0xa81b('0x43')][_0xa81b('0x93')])return[];return db[_0xa81b('0x9a')][_0xa81b('0x43')](_0x43be32['toString'](),_0x53b32c);})[_0xa81b('0x2a')](function(_0x362d93){_0x165767[_0xa81b('0x24')]=_0x362d93[_0xa81b('0x65')];if(_0x165767[_0xa81b('0x24')]===0x0)return[];return db[_0xa81b('0x9a')][_0xa81b('0x43')](_0x371339[_0xa81b('0x9b')](),_0x53b32c)[_0xa81b('0x2a')](function(_0x1f045f){_0x42cbc1=_[_0xa81b('0x9c')](_0x1f045f,'id');_0x53b32c=_[_0xa81b('0x9d')](_0x53b32c,{'model':db[_0xa81b('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x432a58[_0xa81b('0x43')]['fields']){_0x42ee01['attributes']['forEach'](function(_0x29b978){_0x1d710['field']('i.'+_0x29b978);});}else{_0x1d710[_0xa81b('0x4e')](_0xa81b('0x8f'),_0xa81b('0x9e'));_0x1d710[_0xa81b('0x4e')](_0xa81b('0x9f'),_0xa81b('0xa0'));_0x1d710[_0xa81b('0x4e')](_0xa81b('0xa1'),_0xa81b('0xa2'));_0x1d710[_0xa81b('0x4e')]('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',_0xa81b('0x90'));_0x1d710['field'](_0xa81b('0xa3'));_0x1d710['field'](_0xa81b('0xa4'),_0xa81b('0xa5'));_0x1d710[_0xa81b('0x4e')]('c.lastName','Contact.lastName');_0x1d710[_0xa81b('0x4e')]('c.email','Contact.email');_0x1d710[_0xa81b('0x4e')](_0xa81b('0xa6'),_0xa81b('0xa7'));_0x1d710[_0xa81b('0x4e')](_0xa81b('0xa8'),_0xa81b('0xa9'));_0x1d710[_0xa81b('0x4e')](_0xa81b('0xaa'),_0xa81b('0xab'));_0x1d710[_0xa81b('0x4e')](_0xa81b('0xac'),_0xa81b('0xad'));_0x1d710[_0xa81b('0x4e')](_0xa81b('0xae'),_0xa81b('0xaf'));_0x1d710[_0xa81b('0x4e')](_0xa81b('0xb0'),'TagIds');}if(_0x42ee01[_0xa81b('0x23')])_0x1d710[_0xa81b('0x23')](_0x42ee01[_0xa81b('0x23')]);if(_0x42ee01[_0xa81b('0x21')])_0x1d710[_0xa81b('0x21')](_0x42ee01[_0xa81b('0x21')]);return db[_0xa81b('0x9a')][_0xa81b('0x43')](_0x1d710['toString'](),_0x53b32c);})[_0xa81b('0x2a')](function(_0x2f0d7b){if(_0x2f0d7b[_0xa81b('0x65')]>0x0)_0x46535f[_0xa81b('0x4b')](_0xa81b('0xb1'),_[_0xa81b('0x30')](_0x2f0d7b,'id'));return db[_0xa81b('0x9a')][_0xa81b('0x43')](_0x46535f[_0xa81b('0x9b')](),_0x53b32c)['then'](function(_0x443e41){var _0x4051e8=_[_0xa81b('0xb2')](_0x443e41,_0xa81b('0xb3'));var _0x156f23=[];_0x2f0d7b['forEach'](function(_0x19f405){_0x156f23[_0xa81b('0x35')](updateFaxInteraction(_0x19f405,_0x42cbc1,_0x4051e8));});return BPromise[_0xa81b('0xb4')](_0x156f23);});});})[_0xa81b('0x2a')](function(_0xb85f64){_0x165767[_0xa81b('0xb5')]=_0xb85f64;return _0x165767;})[_0xa81b('0x2a')](respondWithFilteredResult(_0x2c0e5c,_0x42ee01))['catch'](handleError(_0x2c0e5c,null));};exports['show']=function(_0x4b1c98,_0x112717){var _0x2b0e51={'raw':![],'where':{'id':_0x4b1c98[_0xa81b('0xb6')]['id']}},_0x57c6d5={};_0x57c6d5[_0xa81b('0x42')]=_[_0xa81b('0xb7')](db['FaxInteraction']['rawAttributes']);_0x57c6d5[_0xa81b('0x43')]=_[_0xa81b('0xb7')](_0x4b1c98[_0xa81b('0x43')]);_0x57c6d5[_0xa81b('0x44')]=_[_0xa81b('0x45')](_0x57c6d5[_0xa81b('0x42')],_0x57c6d5[_0xa81b('0x43')]);_0x2b0e51[_0xa81b('0x46')]=_[_0xa81b('0x45')](_0x57c6d5[_0xa81b('0x42')],qs['fields'](_0x4b1c98[_0xa81b('0x43')][_0xa81b('0x47')]));_0x2b0e51[_0xa81b('0x46')]=_0x2b0e51[_0xa81b('0x46')][_0xa81b('0x65')]?_0x2b0e51[_0xa81b('0x46')]:_0x57c6d5['model'];if(_0x4b1c98['query'][_0xa81b('0xb8')]){_0x2b0e51[_0xa81b('0xb9')]=[{'all':!![]}];}_0x2b0e51=_[_0xa81b('0x9d')]({},_0x2b0e51,_0x4b1c98[_0xa81b('0xba')]);return db[_0xa81b('0x3e')][_0xa81b('0x66')](_0x2b0e51)['then'](handleEntityNotFound(_0x112717,null))[_0xa81b('0x2a')](respondWithResult(_0x112717,null))[_0xa81b('0xbb')](handleError(_0x112717,null));};exports[_0xa81b('0xbc')]=function(_0x517d15,_0x458bd5){return db['FaxInteraction']['create'](_0x517d15[_0xa81b('0xbd')],{})[_0xa81b('0x2a')](respondWithResult(_0x458bd5,0xc9))[_0xa81b('0xbb')](handleError(_0x458bd5,null));};exports['update']=function(_0x37d827,_0x5dac64){if(_0x37d827[_0xa81b('0xbd')]['id']){delete _0x37d827['body']['id'];}return db[_0xa81b('0x3e')][_0xa81b('0x66')]({'where':{'id':_0x37d827['params']['id']}})[_0xa81b('0x2a')](handleEntityNotFound(_0x5dac64,null))[_0xa81b('0x2a')](saveUpdates(_0x37d827[_0xa81b('0xbd')],null))[_0xa81b('0x2a')](respondWithResult(_0x5dac64,null))[_0xa81b('0xbb')](handleError(_0x5dac64,null));};exports['destroy']=function(_0x1daca6,_0x1e2951){return db['FaxInteraction'][_0xa81b('0x66')]({'where':{'id':_0x1daca6[_0xa81b('0xb6')]['id']}})['then'](handleEntityNotFound(_0x1e2951,null))[_0xa81b('0x2a')](removeEntity(_0x1e2951,null))['catch'](handleError(_0x1e2951,null));};exports[_0xa81b('0xbe')]=function(_0x489246,_0x22adfb){return db['FaxInteraction'][_0xa81b('0xbe')]()['then'](respondWithResult(_0x22adfb,null))[_0xa81b('0xbb')](handleError(_0x22adfb,null));};exports['addMessage']=function(_0x109f24,_0x38031a,_0x1cdfec){return db[_0xa81b('0xbf')][_0xa81b('0x66')]({'where':{'id':_0x109f24[_0xa81b('0xb6')]['id']}})['then'](handleEntityNotFound(_0x38031a,null))['then'](function(_0x5524ff){if(_0x5524ff){return _0x5524ff[_0xa81b('0xc0')](_0x109f24[_0xa81b('0xbd')][_0xa81b('0xc1')],_['omit'](_0x109f24[_0xa81b('0xbd')],[_0xa81b('0xc1'),'id'])||{});}})[_0xa81b('0x2a')](respondWithResult(_0x38031a,null))[_0xa81b('0xbb')](handleError(_0x38031a,null));};exports[_0xa81b('0xc2')]=function(_0x4180e7,_0x3e5916,_0x388227){var _0x4f78f2={'raw':![],'where':{}};var _0x10cc47={};var _0x340f8b={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xa81b('0xc3')]({'where':{'id':_0x4180e7[_0xa81b('0xb6')]['id']}})[_0xa81b('0x2a')](handleEntityNotFound(_0x3e5916,null))[_0xa81b('0x2a')](function(_0x4a0182){if(_0x4a0182){_0x10cc47[_0xa81b('0x42')]=_[_0xa81b('0xb7')](db['FaxMessage']['rawAttributes']);_0x10cc47[_0xa81b('0x43')]=_[_0xa81b('0xb7')](_0x4180e7[_0xa81b('0x43')]);_0x10cc47[_0xa81b('0x44')]=_[_0xa81b('0x45')](_0x10cc47[_0xa81b('0x42')],_0x10cc47['query']);_0x4f78f2[_0xa81b('0x46')]=_[_0xa81b('0x45')](_0x10cc47['model'],qs[_0xa81b('0x47')](_0x4180e7['query']['fields']));_0x4f78f2[_0xa81b('0x46')]=_0x4f78f2[_0xa81b('0x46')]['length']?_0x4f78f2['attributes']:_0x10cc47[_0xa81b('0x42')];if(!_0x4180e7[_0xa81b('0x43')]['hasOwnProperty'](_0xa81b('0xc4'))){_0x4f78f2[_0xa81b('0x23')]=qs[_0xa81b('0x23')](_0x4180e7['query'][_0xa81b('0x23')]);_0x4f78f2[_0xa81b('0x21')]=qs['offset'](_0x4180e7[_0xa81b('0x43')]['offset']);}_0x4f78f2[_0xa81b('0x49')]=qs[_0xa81b('0x4a')](_0x4180e7['query'][_0xa81b('0x4a')]);_0x4f78f2['where']=qs[_0xa81b('0x44')](_[_0xa81b('0x4c')](_0x4180e7[_0xa81b('0x43')],_0x10cc47[_0xa81b('0x44')]));_0x4f78f2[_0xa81b('0x4b')][_0xa81b('0xb3')]=_0x4a0182['id'];if(_0x4180e7[_0xa81b('0x43')][_0xa81b('0x84')]){_0x4f78f2[_0xa81b('0x4b')]=_['merge'](_0x4f78f2[_0xa81b('0x4b')],{'$or':_[_0xa81b('0x30')](_0x4f78f2['attributes'],function(_0x36c894){var _0x93c130={};_0x93c130[_0x36c894]={'$like':'%'+_0x4180e7[_0xa81b('0x43')][_0xa81b('0x84')]+'%'};return _0x93c130;})});}if(_0x4180e7[_0xa81b('0x43')][_0xa81b('0x7d')]){var _0x166b34=_0x4180e7['query']['$gte'][_0xa81b('0x34')](',');var _0xe8eeaf={};_0xe8eeaf[_0x166b34[0x0]]={'$gte':moment(_0x166b34[0x1])['format'](_0xa81b('0xc5'))};_0x4f78f2['where']=_[_0xa81b('0x9d')](_0x4f78f2[_0xa81b('0x4b')],_0xe8eeaf);}_0x4f78f2=_[_0xa81b('0x9d')]({},_0x4f78f2,_0x4180e7[_0xa81b('0xba')]);return db[_0xa81b('0xbf')][_0xa81b('0x24')]({'where':_0x4f78f2[_0xa81b('0x4b')]})[_0xa81b('0x2a')](function(_0x239e88){_0x340f8b[_0xa81b('0x24')]=_0x239e88;if(_0x4180e7[_0xa81b('0x43')]['includeAll']){_0x4f78f2['include']=[{'all':!![]}];}return db[_0xa81b('0xbf')][_0xa81b('0xc6')](_0x4f78f2);})[_0xa81b('0x2a')](function(_0x2961ad){_0x340f8b[_0xa81b('0xb5')]=_0x2961ad;return _0x340f8b;});}})['then'](respondWithFilteredResult(_0x3e5916,_0x4f78f2))[_0xa81b('0xbb')](handleError(_0x3e5916,null));};exports[_0xa81b('0xc7')]=function(_0x3b7ba9,_0x511675,_0x45a739){return db[_0xa81b('0x3e')][_0xa81b('0x66')]({'where':{'id':_0x3b7ba9[_0xa81b('0xb6')]['id']}})[_0xa81b('0x2a')](handleEntityNotFound(_0x511675,null))['then'](function(_0x465752){if(_0x465752){return _0x465752[_0xa81b('0xc8')](_0x3b7ba9[_0xa81b('0xbd')][_0xa81b('0xc1')],_[_0xa81b('0xc9')](_0x3b7ba9[_0xa81b('0xbd')],[_0xa81b('0xc1'),'id'])||{})['spread'](function(){return db[_0xa81b('0x73')][_0xa81b('0xc6')]({'attributes':['id','name',_0xa81b('0x4f')],'where':{'id':_0x3b7ba9['body'][_0xa81b('0xc1')]}});})[_0xa81b('0x2a')](function(_0x958efe){socket[_0xa81b('0xca')]('faxInteractionTags:save',{'id':Number(_0x3b7ba9['params']['id']),'tags':_0x958efe||[]});return{'id':Number(_0x3b7ba9['params']['id']),'tags':_0x958efe||[]};});}})['then'](respondWithResult(_0x511675,null))['catch'](handleError(_0x511675,null));};exports[_0xa81b('0xcb')]=function(_0x22b654,_0x4a6ecd,_0x345169){return db[_0xa81b('0x3e')][_0xa81b('0x66')]({'where':{'id':_0x22b654[_0xa81b('0xb6')]['id']}})[_0xa81b('0x2a')](handleEntityNotFound(_0x4a6ecd,null))[_0xa81b('0x2a')](function(_0xb393f1){if(_0xb393f1){return _0xb393f1[_0xa81b('0xcb')](_0x22b654['query'][_0xa81b('0xc1')]);}})[_0xa81b('0x2a')](respondWithStatusCode(_0x4a6ecd,null))[_0xa81b('0xbb')](handleError(_0x4a6ecd,null));};exports[_0xa81b('0xcc')]=function(_0x3ed17a,_0x525b25){var _0x4f18a4=moment()[_0xa81b('0xcd')]()[_0xa81b('0x9b')]();var _0x237bb4=path['join'](config[_0xa81b('0xce')],_0xa81b('0xcf'),_0xa81b('0xd0'),_0xa81b('0xd1'));var _0x4fea40=path[_0xa81b('0xd2')](config[_0xa81b('0xce')],_0xa81b('0xcf'),_0xa81b('0xd0'),_0xa81b('0xd3'));var _0xc72381=path[_0xa81b('0xd2')](_0x237bb4,_0x4f18a4);var _0x3c0d2e=util[_0xa81b('0xd4')](_0xa81b('0xd5'),_0x3ed17a[_0xa81b('0xb6')]['id'],_0x4f18a4);var _0x109e91=path['join'](_0x237bb4,_0x3c0d2e);var _0x1513c2=[];_0x1513c2[_0xa81b('0x35')]({'model':db['Attachment'],'as':_0xa81b('0xd6'),'raw':!![]});var _0x40c493=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body',_0xa81b('0xd7')],'include':_0x1513c2}];return db[_0xa81b('0x3e')][_0xa81b('0x66')]({'where':{'id':_0x3ed17a[_0xa81b('0xb6')]['id']},'include':_0x40c493})[_0xa81b('0x2a')](handleEntityNotFound(_0x525b25,null))[_0xa81b('0x2a')](function(_0x5eb26d){if(_0x5eb26d&&_0x5eb26d['Messages']){var _0x1b1cfc=_0x5eb26d[_0xa81b('0xd8')]({'plain':!![]});fs[_0xa81b('0xd9')](_0xc72381);for(var _0x5d375a=0x0;_0x5d375a<_0x1b1cfc['Messages'][_0xa81b('0x65')];_0x5d375a++){var _0x5bf94e=_0x1b1cfc[_0xa81b('0xda')][_0x5d375a][_0xa81b('0xd6')];if(_0x5bf94e){var _0x30a360=path[_0xa81b('0xd2')](_0x4fea40,_0x5bf94e[_0xa81b('0xdb')]);if(fs[_0xa81b('0xdc')](_0x30a360)){fs[_0xa81b('0xdd')](_0x30a360)['pipe'](fs[_0xa81b('0xde')](path['join'](_0xc72381,_0x5bf94e[_0xa81b('0xdb')])));}}}return BPromise[_0xa81b('0xdf')]()[_0xa81b('0x2a')](function(){return new BPromise(function(_0x1a0a90,_0x39f335){zipdir(_0xc72381,{'saveTo':_0x109e91},function(_0x172584,_0x5bd499){if(_0x172584)return _0x39f335(_0x172584);return _0x1a0a90(_0x5bd499);});})['then'](function(){return new BPromise(function(_0xfde9da,_0x423467){rimraf(_0xc72381,function(_0x55c927){if(_0x55c927)_0x423467(_0x55c927);return _0xfde9da();});});})[_0xa81b('0x2a')](function(){return _0x525b25[_0xa81b('0xcc')](_0x109e91,_0x3c0d2e,function(_0x1d8081){if(_0x1d8081){console['log'](_0xa81b('0xe0'),_0x1d8081);}else{fs[_0xa81b('0xe1')](_0x109e91);}});});});}else{return _0x525b25[_0xa81b('0x2c')](0xc8);}})['catch'](handleError(_0x525b25,null));};
\ No newline at end of file
index 5785de3..4ff7127 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e56=['setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hook','exports','FaxInteraction','FaxMessage'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1e56,0x11e));var _0x61e5=function(_0xa5bc39,_0x4ac610){_0xa5bc39=_0xa5bc39-0x0;var _0x4a08a8=_0x1e56[_0xa5bc39];return _0x4a08a8;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x61e5('0x0')];var FaxMessage=require('../../mysqldb')['db'][_0x61e5('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x61e5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x61e5('0x3'),'afterDestroy':_0x61e5('0x4')};function emitEvent(_0xc5cc2b){return function(_0x4ae965,_0x1c0973,_0x217aa6){_0x4ae965[_0x61e5('0x5')]({'attributes':['id'],'raw':!![]})[_0x61e5('0x6')](function(_0x3922f4){_0x4ae965['setDataValue'](_0x61e5('0x7'),_0x3922f4[_0x61e5('0x8')](function(_0x1a707a){return{'id':_0x1a707a['id']};}));return FaxMessage[_0x61e5('0x9')]({'where':{'FaxInteractionId':_0x4ae965['id'],'direction':'in','read':![]},'raw':!![]});})[_0x61e5('0x6')](function(_0x1ac10f){_0x4ae965[_0x61e5('0xa')](_0x61e5('0xb'),_0x1ac10f['length']);FaxInteractionEvents['emit'](_0xc5cc2b+':'+_0x4ae965['id'],_0x4ae965);FaxInteractionEvents[_0x61e5('0xc')](_0xc5cc2b,_0x4ae965);_0x217aa6(null);})[_0x61e5('0xd')](_0x217aa6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x61e5('0xe')](e,emitEvent(event));}}module[_0x61e5('0xf')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x248c=['save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x3dd184,_0x57ef3a){var _0x49bcfd=function(_0x449224){while(--_0x449224){_0x3dd184['push'](_0x3dd184['shift']());}};_0x49bcfd(++_0x57ef3a);}(_0x248c,0x95));var _0xc248=function(_0x4962f4,_0x48c9bf){_0x4962f4=_0x4962f4-0x0;var _0x2270b3=_0x248c[_0x4962f4];return _0x2270b3;};'use strict';var EventEmitter=require(_0xc248('0x0'));var FaxInteraction=require(_0xc248('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xc248('0x1'))['db'][_0xc248('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc248('0x3')](0x0);var events={'afterCreate':_0xc248('0x4'),'afterUpdate':_0xc248('0x5'),'afterDestroy':_0xc248('0x6')};function emitEvent(_0x1a40f9){return function(_0x257df6,_0x1937b5,_0x2f888e){_0x257df6[_0xc248('0x7')]({'attributes':['id'],'raw':!![]})[_0xc248('0x8')](function(_0x4e54fc){_0x257df6[_0xc248('0x9')]('Users',_0x4e54fc[_0xc248('0xa')](function(_0x5c413c){return{'id':_0x5c413c['id']};}));return FaxMessage[_0xc248('0xb')]({'where':{'FaxInteractionId':_0x257df6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3bcf0e){_0x257df6[_0xc248('0x9')](_0xc248('0xc'),_0x3bcf0e[_0xc248('0xd')]);FaxInteractionEvents[_0xc248('0xe')](_0x1a40f9+':'+_0x257df6['id'],_0x257df6);FaxInteractionEvents['emit'](_0x1a40f9,_0x257df6);_0x2f888e(null);})['catch'](_0x2f888e(null));};}for(var e in events){if(events[_0xc248('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xc248('0x10')]=FaxInteractionEvents;
\ No newline at end of file
index 28a91ce..11437f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa200=['define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x3a8fca,_0x8532dc){var _0x4195ee=function(_0x32dd7f){while(--_0x32dd7f){_0x3a8fca['push'](_0x3a8fca['shift']());}};_0x4195ee(++_0x8532dc);}(_0xa200,0xd3));var _0x0a20=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa200[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x0a20('0x0'));var logger=require(_0x0a20('0x1'))(_0x0a20('0x2'));var moment=require(_0x0a20('0x3'));var BPromise=require('bluebird');var rp=require(_0x0a20('0x4'));var fs=require('fs');var path=require(_0x0a20('0x5'));var rimraf=require(_0x0a20('0x6'));var config=require(_0x0a20('0x7'));var attributes=require(_0x0a20('0x8'));module[_0x0a20('0x9')]=function(_0x22c22e,_0x279794){return _0x22c22e[_0x0a20('0xa')](_0x0a20('0xb'),attributes,{'tableName':_0x0a20('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4309a2,_0x2c0c6f,_0x12be0a){if(_0x4309a2[_0x0a20('0xd')](_0x0a20('0xe'))){_0x4309a2[_0x0a20('0xf')]=moment()['format'](_0x0a20('0x10'));}_0x12be0a(null,_0x4309a2);}}});};
\ No newline at end of file
+var _0x090a=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','path','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x18ac44,_0x5e525e){var _0x521d09=function(_0x512ee4){while(--_0x512ee4){_0x18ac44['push'](_0x18ac44['shift']());}};_0x521d09(++_0x5e525e);}(_0x090a,0x133));var _0xa090=function(_0x20d9e7,_0x293309){_0x20d9e7=_0x20d9e7-0x0;var _0x3e3e52=_0x090a[_0x20d9e7];return _0x3e3e52;};'use strict';var _=require(_0xa090('0x0'));var util=require(_0xa090('0x1'));var logger=require('../../config/logger')(_0xa090('0x2'));var moment=require(_0xa090('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa090('0x4'));var rimraf=require('rimraf');var config=require(_0xa090('0x5'));var attributes=require(_0xa090('0x6'));module[_0xa090('0x7')]=function(_0x348b86,_0x13af30){return _0x348b86[_0xa090('0x8')](_0xa090('0x9'),attributes,{'tableName':_0xa090('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39f0db,_0x9566e1,_0x39cb73){if(_0x39f0db[_0xa090('0xb')](_0xa090('0xc'))){_0x39f0db[_0xa090('0xd')]=moment()[_0xa090('0xe')](_0xa090('0xf'));}_0x39cb73(null,_0x39f0db);}}});};
\ No newline at end of file
index 8d3a9e8..ebbaae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4b4=['http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','catch','UpdateFaxInteraction','update','options','raw','where','limit','then','debug','AddTagsToFaxInteraction','FaxInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5ed65f,_0x23d121){var _0x1f43ae=function(_0x3b7368){while(--_0x3b7368){_0x5ed65f['push'](_0x5ed65f['shift']());}};_0x1f43ae(++_0x23d121);}(_0xc4b4,0xc8));var _0x4c4b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc4b4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4c4b('0x0'));var util=require(_0x4c4b('0x1'));var moment=require('moment');var BPromise=require(_0x4c4b('0x2'));var rs=require(_0x4c4b('0x3'));var fs=require('fs');var Redis=require(_0x4c4b('0x4'));var db=require(_0x4c4b('0x5'))['db'];var utils=require(_0x4c4b('0x6'));var logger=require(_0x4c4b('0x7'))(_0x4c4b('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c4b('0x9'));var client=jayson['client'][_0x4c4b('0xa')]({'port':0x232a});config[_0x4c4b('0xb')]=_['defaults'](config[_0x4c4b('0xb')],{'host':_0x4c4b('0xc'),'port':0x18eb});var socket=require(_0x4c4b('0xd'))(new Redis(config[_0x4c4b('0xb')]));require(_0x4c4b('0xe'))[_0x4c4b('0xf')](socket);function respondWithRpcPromise(_0x23772e,_0x299e39,_0xf70105){return new BPromise(function(_0x24076a,_0x5c3121){return client[_0x4c4b('0x10')](_0x23772e,_0xf70105)['then'](function(_0x2b709f){logger[_0x4c4b('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x299e39,_0x4c4b('0x12'));logger['debug'](_0x4c4b('0x13'),_0x299e39,_0x4c4b('0x12'),JSON[_0x4c4b('0x14')](_0x2b709f));if(_0x2b709f[_0x4c4b('0x15')]){if(_0x2b709f['error'][_0x4c4b('0x16')]===0x1f4){logger[_0x4c4b('0x15')](_0x4c4b('0x17'),_0x299e39,_0x2b709f[_0x4c4b('0x15')][_0x4c4b('0x18')]);return _0x5c3121(_0x2b709f['error'][_0x4c4b('0x18')]);}logger[_0x4c4b('0x15')](_0x4c4b('0x17'),_0x299e39,_0x2b709f[_0x4c4b('0x15')][_0x4c4b('0x18')]);return _0x24076a(_0x2b709f[_0x4c4b('0x15')][_0x4c4b('0x18')]);}else{logger[_0x4c4b('0x11')](_0x4c4b('0x17'),_0x299e39,_0x4c4b('0x12'));_0x24076a(_0x2b709f['result']['message']);}})[_0x4c4b('0x19')](function(_0x386d69){logger[_0x4c4b('0x15')](_0x4c4b('0x17'),_0x299e39,_0x386d69);_0x5c3121(_0x386d69);});});}exports[_0x4c4b('0x1a')]=function(_0xd749b4){var _0x40b222=this;return new Promise(function(_0xc618d3,_0x2dcf98){return db['FaxInteraction'][_0x4c4b('0x1b')](_0xd749b4['body'],{'raw':_0xd749b4['options']?_0xd749b4[_0x4c4b('0x1c')][_0x4c4b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd749b4['options']?_0xd749b4['options'][_0x4c4b('0x1e')]||null:null,'attributes':_0xd749b4[_0x4c4b('0x1c')]?_0xd749b4[_0x4c4b('0x1c')]['attributes']||null:null,'limit':_0xd749b4['options']?_0xd749b4['options'][_0x4c4b('0x1f')]||null:null})[_0x4c4b('0x20')](function(_0xb59d9b){logger[_0x4c4b('0x11')]('UpdateFaxInteraction',_0xd749b4);logger[_0x4c4b('0x21')](_0x4c4b('0x1a'),_0xd749b4,JSON[_0x4c4b('0x14')](_0xb59d9b));_0xc618d3(_0xb59d9b);})[_0x4c4b('0x19')](function(_0x260586){logger[_0x4c4b('0x15')](_0x4c4b('0x1a'),_0x260586[_0x4c4b('0x18')],_0xd749b4);_0x2dcf98(_0x40b222[_0x4c4b('0x15')](0x1f4,_0x260586[_0x4c4b('0x18')]));});});};exports[_0x4c4b('0x22')]=function(_0x31bec6){return new Promise(function(_0x4b5038,_0x509dcd){return db[_0x4c4b('0x23')][_0x4c4b('0x24')]({'where':_0x31bec6[_0x4c4b('0x1c')]?_0x31bec6[_0x4c4b('0x1c')][_0x4c4b('0x1e')]||null:null})[_0x4c4b('0x20')](function(_0x512e7a){if(_0x512e7a){return _0x512e7a[_0x4c4b('0x25')](_0x31bec6[_0x4c4b('0x26')][_0x4c4b('0x27')],_[_0x4c4b('0x28')](_0x31bec6[_0x4c4b('0x26')],[_0x4c4b('0x27'),'id'])||{});}})['spread'](function(_0x45724f){logger[_0x4c4b('0x11')](_0x4c4b('0x29'),_0x31bec6);logger[_0x4c4b('0x21')](_0x4c4b('0x29'),_0x31bec6,JSON[_0x4c4b('0x14')](_0x45724f));_0x4b5038(_0x45724f);})[_0x4c4b('0x19')](function(_0x46e2b3){logger[_0x4c4b('0x15')](_0x4c4b('0x29'),_0x46e2b3[_0x4c4b('0x18')],_0x31bec6);_0x509dcd(_this[_0x4c4b('0x15')](0x1f4,_0x46e2b3['message']));});});};
\ No newline at end of file
+var _0x1cc3=['stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','AddTagsToFaxInteraction','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x629b59,_0x58a964){var _0x484742=function(_0x2c76f2){while(--_0x2c76f2){_0x629b59['push'](_0x629b59['shift']());}};_0x484742(++_0x58a964);}(_0x1cc3,0x1e2));var _0x31cc=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1cc3[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x31cc('0x0'));var util=require(_0x31cc('0x1'));var moment=require('moment');var BPromise=require(_0x31cc('0x2'));var rs=require(_0x31cc('0x3'));var fs=require('fs');var Redis=require(_0x31cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x31cc('0x5'))(_0x31cc('0x6'));var config=require(_0x31cc('0x7'));var jayson=require(_0x31cc('0x8'));var client=jayson[_0x31cc('0x9')][_0x31cc('0xa')]({'port':0x232a});config[_0x31cc('0xb')]=_[_0x31cc('0xc')](config[_0x31cc('0xb')],{'host':_0x31cc('0xd'),'port':0x18eb});var socket=require(_0x31cc('0xe'))(new Redis(config['redis']));require(_0x31cc('0xf'))[_0x31cc('0x10')](socket);function respondWithRpcPromise(_0x27d8d4,_0x45a0b1,_0x1af6e3){return new BPromise(function(_0x4f0310,_0x310736){return client['request'](_0x27d8d4,_0x1af6e3)[_0x31cc('0x11')](function(_0x43c91a){logger['info'](_0x31cc('0x12'),_0x45a0b1,_0x31cc('0x13'));logger[_0x31cc('0x14')](_0x31cc('0x15'),_0x45a0b1,'request\x20sent',JSON[_0x31cc('0x16')](_0x43c91a));if(_0x43c91a[_0x31cc('0x17')]){if(_0x43c91a[_0x31cc('0x17')][_0x31cc('0x18')]===0x1f4){logger[_0x31cc('0x17')](_0x31cc('0x12'),_0x45a0b1,_0x43c91a[_0x31cc('0x17')][_0x31cc('0x19')]);return _0x310736(_0x43c91a[_0x31cc('0x17')][_0x31cc('0x19')]);}logger[_0x31cc('0x17')](_0x31cc('0x12'),_0x45a0b1,_0x43c91a[_0x31cc('0x17')][_0x31cc('0x19')]);return _0x4f0310(_0x43c91a[_0x31cc('0x17')][_0x31cc('0x19')]);}else{logger[_0x31cc('0x1a')](_0x31cc('0x12'),_0x45a0b1,'request\x20sent');_0x4f0310(_0x43c91a[_0x31cc('0x1b')]['message']);}})[_0x31cc('0x1c')](function(_0x3008fc){logger[_0x31cc('0x17')](_0x31cc('0x12'),_0x45a0b1,_0x3008fc);_0x310736(_0x3008fc);});});}exports[_0x31cc('0x1d')]=function(_0x33c829){var _0x382d8b=this;return new Promise(function(_0x2be046,_0x5b63a8){return db[_0x31cc('0x1e')][_0x31cc('0x1f')](_0x33c829[_0x31cc('0x20')],{'raw':_0x33c829['options']?_0x33c829[_0x31cc('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33c829[_0x31cc('0x21')]?_0x33c829['options']['where']||null:null,'attributes':_0x33c829[_0x31cc('0x21')]?_0x33c829[_0x31cc('0x21')][_0x31cc('0x22')]||null:null,'limit':_0x33c829[_0x31cc('0x21')]?_0x33c829[_0x31cc('0x21')]['limit']||null:null})[_0x31cc('0x11')](function(_0x538f21){logger[_0x31cc('0x1a')]('UpdateFaxInteraction',_0x33c829);logger[_0x31cc('0x14')](_0x31cc('0x1d'),_0x33c829,JSON[_0x31cc('0x16')](_0x538f21));_0x2be046(_0x538f21);})[_0x31cc('0x1c')](function(_0x3f636a){logger['error'](_0x31cc('0x1d'),_0x3f636a['message'],_0x33c829);_0x5b63a8(_0x382d8b[_0x31cc('0x17')](0x1f4,_0x3f636a[_0x31cc('0x19')]));});});};exports[_0x31cc('0x23')]=function(_0x2d51d3){return new Promise(function(_0xf72590,_0x3cf95b){return db['FaxInteraction']['find']({'where':_0x2d51d3[_0x31cc('0x21')]?_0x2d51d3['options'][_0x31cc('0x24')]||null:null})[_0x31cc('0x11')](function(_0x3c5184){if(_0x3c5184){return _0x3c5184[_0x31cc('0x25')](_0x2d51d3[_0x31cc('0x20')][_0x31cc('0x26')],_[_0x31cc('0x27')](_0x2d51d3[_0x31cc('0x20')],[_0x31cc('0x26'),'id'])||{});}})[_0x31cc('0x28')](function(_0xfa3a7a){logger[_0x31cc('0x1a')](_0x31cc('0x29'),_0x2d51d3);logger[_0x31cc('0x14')]('AddTags',_0x2d51d3,JSON['stringify'](_0xfa3a7a));_0xf72590(_0xfa3a7a);})[_0x31cc('0x1c')](function(_0x2e380c){logger[_0x31cc('0x17')]('AddTags',_0x2e380c[_0x31cc('0x19')],_0x2d51d3);_0x3cf95b(_this[_0x31cc('0x17')](0x1f4,_0x2e380c[_0x31cc('0x19')]));});});};
\ No newline at end of file
index 983c0f3..b65968a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2153=['save','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x27d4e7,_0x384cf0){var _0x437b99=function(_0x2ebf63){while(--_0x2ebf63){_0x27d4e7['push'](_0x27d4e7['shift']());}};_0x437b99(++_0x384cf0);}(_0x2153,0xb3));var _0x3215=function(_0xc71a49,_0x4c5df8){_0xc71a49=_0xc71a49-0x0;var _0x20157d=_0x2153[_0xc71a49];return _0x20157d;};'use strict';var FaxInteractionEvents=require(_0x3215('0x0'));var events=[_0x3215('0x1'),'remove','update'];function createListener(_0x3c3633,_0x1479c6){return function(_0x5f0f0c){_0x1479c6['emit'](_0x3c3633,_0x5f0f0c);};}function removeListener(_0x639270,_0x1a553d){return function(){FaxInteractionEvents[_0x3215('0x2')](_0x639270,_0x1a553d);};}exports[_0x3215('0x3')]=function(_0x57f3e7){for(var _0x37b8b1=0x0,_0x36f940=events[_0x3215('0x4')];_0x37b8b1<_0x36f940;_0x37b8b1++){var _0x1a1f4a=events[_0x37b8b1];var _0x5ae791=createListener(_0x3215('0x5')+_0x1a1f4a,_0x57f3e7);FaxInteractionEvents['on'](_0x1a1f4a,_0x5ae791);}};
\ No newline at end of file
+var _0x60bc=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x3b4f76,_0x3cbc9a){var _0x3250cb=function(_0x5da989){while(--_0x5da989){_0x3b4f76['push'](_0x3b4f76['shift']());}};_0x3250cb(++_0x3cbc9a);}(_0x60bc,0x166));var _0xc60b=function(_0x3958fe,_0x3c6605){_0x3958fe=_0x3958fe-0x0;var _0x1f27d6=_0x60bc[_0x3958fe];return _0x1f27d6;};'use strict';var FaxInteractionEvents=require(_0xc60b('0x0'));var events=['save',_0xc60b('0x1'),_0xc60b('0x2')];function createListener(_0x2162c9,_0x5b5820){return function(_0x3535e7){_0x5b5820[_0xc60b('0x3')](_0x2162c9,_0x3535e7);};}function removeListener(_0x4e4399,_0x5715df){return function(){FaxInteractionEvents[_0xc60b('0x4')](_0x4e4399,_0x5715df);};}exports[_0xc60b('0x5')]=function(_0x29c9ff){for(var _0x59e372=0x0,_0x3390b7=events[_0xc60b('0x6')];_0x59e372<_0x3390b7;_0x59e372++){var _0x5f99e9=events[_0x59e372];var _0x4892d0=createListener(_0xc60b('0x7')+_0x5f99e9,_0x29c9ff);FaxInteractionEvents['on'](_0x5f99e9,_0x4892d0);}};
\ No newline at end of file
index 95cdcbc..82fc7b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde4d=['describe','/:id','show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','get','/describe'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0xde4d,0x17a));var _0xdde4=function(_0xd1fb2,_0x40477c){_0xd1fb2=_0xd1fb2-0x0;var _0xd8336a=_0xde4d[_0xd1fb2];return _0xd8336a;};'use strict';var multer=require(_0xdde4('0x0'));var util=require(_0xdde4('0x1'));var path=require('path');var timeout=require(_0xdde4('0x2'));var express=require(_0xdde4('0x3'));var router=express[_0xdde4('0x4')]();var fs_extra=require(_0xdde4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdde4('0x6'));var config=require('../../config/environment');var controller=require(_0xdde4('0x7'));router['get']('/',auth[_0xdde4('0x8')](),controller[_0xdde4('0x9')]);router[_0xdde4('0xa')](_0xdde4('0xb'),auth[_0xdde4('0x8')](),controller[_0xdde4('0xc')]);router[_0xdde4('0xa')](_0xdde4('0xd'),auth[_0xdde4('0x8')](),controller[_0xdde4('0xe')]);router[_0xdde4('0xa')](_0xdde4('0xf'),auth[_0xdde4('0x8')](),controller[_0xdde4('0x10')]);router[_0xdde4('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xdde4('0x11')]('/',auth[_0xdde4('0x8')](),controller['create']);router[_0xdde4('0x11')](_0xdde4('0xf'),auth[_0xdde4('0x8')](),controller[_0xdde4('0x12')]);router[_0xdde4('0x11')](_0xdde4('0x13'),auth['isAuthenticated'](),interaction[_0xdde4('0x14')](_0xdde4('0x15'),_0xdde4('0x16')),controller['addTags']);router[_0xdde4('0x17')]('/:id',auth[_0xdde4('0x8')](),interaction['tracked'](_0xdde4('0x15'),_0xdde4('0x18')),controller[_0xdde4('0x19')]);router[_0xdde4('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0xdde4('0x14')](_0xdde4('0x15'),_0xdde4('0x1b')),controller['destroy']);router[_0xdde4('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0xdde4('0x1c')]);module[_0xdde4('0x1d')]=router;
\ No newline at end of file
+var _0xe296=['/describe','describe','isAuthenticated','show','/:id/messages','/:id/download','download','create','post','addMessage','tracked','fax','faxinteraction:addtags','addTags','/:id','faxinteraction:update','update','delete','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxInteraction.controller','get','index'];(function(_0x121ca2,_0x1068c9){var _0x1112fc=function(_0x1798d5){while(--_0x1798d5){_0x121ca2['push'](_0x121ca2['shift']());}};_0x1112fc(++_0x1068c9);}(_0xe296,0x195));var _0x6e29=function(_0x4b281d,_0x17ec63){_0x4b281d=_0x4b281d-0x0;var _0x103c12=_0xe296[_0x4b281d];return _0x103c12;};'use strict';var multer=require(_0x6e29('0x0'));var util=require(_0x6e29('0x1'));var path=require(_0x6e29('0x2'));var timeout=require(_0x6e29('0x3'));var express=require(_0x6e29('0x4'));var router=express[_0x6e29('0x5')]();var fs_extra=require(_0x6e29('0x6'));var auth=require(_0x6e29('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6e29('0x8'));router[_0x6e29('0x9')]('/',auth['isAuthenticated'](),controller[_0x6e29('0xa')]);router[_0x6e29('0x9')](_0x6e29('0xb'),auth['isAuthenticated'](),controller[_0x6e29('0xc')]);router[_0x6e29('0x9')]('/:id',auth[_0x6e29('0xd')](),controller[_0x6e29('0xe')]);router['get'](_0x6e29('0xf'),auth[_0x6e29('0xd')](),controller['getMessages']);router[_0x6e29('0x9')](_0x6e29('0x10'),auth[_0x6e29('0xd')](),controller[_0x6e29('0x11')]);router['post']('/',auth[_0x6e29('0xd')](),controller[_0x6e29('0x12')]);router[_0x6e29('0x13')](_0x6e29('0xf'),auth['isAuthenticated'](),controller[_0x6e29('0x14')]);router[_0x6e29('0x13')]('/:id/tags',auth[_0x6e29('0xd')](),interaction[_0x6e29('0x15')](_0x6e29('0x16'),_0x6e29('0x17')),controller[_0x6e29('0x18')]);router['put'](_0x6e29('0x19'),auth[_0x6e29('0xd')](),interaction[_0x6e29('0x15')]('fax',_0x6e29('0x1a')),controller[_0x6e29('0x1b')]);router[_0x6e29('0x1c')](_0x6e29('0x19'),auth['isAuthenticated'](),interaction[_0x6e29('0x15')](_0x6e29('0x16'),'faxinteraction:destroy'),controller[_0x6e29('0x1d')]);router['delete'](_0x6e29('0x1e'),auth[_0x6e29('0xd')](),controller[_0x6e29('0x1f')]);module['exports']=router;
\ No newline at end of file
index 4b43830..3d852fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb53=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xbb53,0x121));var _0x3bb5=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0xbb53[_0xf55e73];return _0x116b99;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'body':{'type':Sequelize[_0x3bb5('0x2')](_0x3bb5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3bb5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3bb5('0x5')]('in',_0x3bb5('0x6')),'defaultValue':_0x3bb5('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3bb5('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3bb5('0x7')]}};
\ No newline at end of file
+var _0xc831=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x3b4631,_0x2d7d37){var _0x40a54f=function(_0x37e6f8){while(--_0x37e6f8){_0x3b4631['push'](_0x3b4631['shift']());}};_0x40a54f(++_0x2d7d37);}(_0xc831,0x103));var _0x1c83=function(_0x243a7c,_0x5dddce){_0x243a7c=_0x243a7c-0x0;var _0x1de348=_0xc831[_0x243a7c];return _0x1de348;};'use strict';var Sequelize=require('sequelize');module[_0x1c83('0x0')]={'body':{'type':Sequelize[_0x1c83('0x1')](_0x1c83('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1c83('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1c83('0x4')]('in',_0x1c83('0x5')),'defaultValue':_0x1c83('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1c83('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1c83('0x6')]}};
\ No newline at end of file
index 2e55c8e..afaeb6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb45=['manual','interface','format','SIP/%s','channel','motionChannel','EventManager','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','event','rejectmessage','create','CmContact','isNil','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','attachments','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','map','FaxMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','merge','options','include','findAll','show','params','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteractionId','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal'];(function(_0xd1a252,_0x16396f){var _0x560ee1=function(_0x35dd90){while(--_0x35dd90){_0xd1a252['push'](_0xd1a252['shift']());}};_0x560ee1(++_0x16396f);}(_0xdb45,0x130));var _0x5db4=function(_0x21a87d,_0x2469e1){_0x21a87d=_0x21a87d-0x0;var _0x549694=_0xdb45[_0x21a87d];return _0x549694;};'use strict';var emlformat=require(_0x5db4('0x0'));var rimraf=require(_0x5db4('0x1'));var zipdir=require(_0x5db4('0x2'));var jsonpatch=require(_0x5db4('0x3'));var rp=require('request-promise');var moment=require(_0x5db4('0x4'));var BPromise=require(_0x5db4('0x5'));var Mustache=require(_0x5db4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5db4('0x7'));var csv=require(_0x5db4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5db4('0x9'));var _=require(_0x5db4('0xa'));var squel=require(_0x5db4('0xb'));var crypto=require(_0x5db4('0xc'));var jsforce=require(_0x5db4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5db4('0x8'));var querystring=require(_0x5db4('0xe'));var Papa=require(_0x5db4('0xf'));var Redis=require(_0x5db4('0x10'));var authService=require(_0x5db4('0x11'));var qs=require(_0x5db4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5db4('0x13'));var logger=require(_0x5db4('0x14'))(_0x5db4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5db4('0x16'));var db=require('../../mysqldb')['db'];config[_0x5db4('0x17')]=_[_0x5db4('0x18')](config[_0x5db4('0x17')],{'host':_0x5db4('0x19'),'port':0x18eb});var socket=require(_0x5db4('0x1a'))(new Redis(config[_0x5db4('0x17')]));require(_0x5db4('0x1b'))['register'](socket);var jayson=require(_0x5db4('0x1c'));var client=jayson[_0x5db4('0x1d')][_0x5db4('0x1e')]({'port':0x232c});var client9002=jayson[_0x5db4('0x1d')][_0x5db4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1326ad,_0x4d4738,_0x16088a,_0x3def56){return new BPromise(function(_0x97a3e4,_0x1418f9){var _0x433798=_0x3def56||client;return _0x433798['request'](_0x1326ad,_0x16088a)[_0x5db4('0x1f')](function(_0x3b159b){logger['info']('FaxMessage,\x20%s,\x20%s',_0x4d4738,_0x5db4('0x20'));logger[_0x5db4('0x21')](_0x5db4('0x22'),_0x4d4738,_0x5db4('0x20'),JSON[_0x5db4('0x23')](_0x3b159b));if(_0x3b159b[_0x5db4('0x24')]){if(_0x3b159b[_0x5db4('0x24')][_0x5db4('0x25')]===0x1f4){logger[_0x5db4('0x24')](_0x5db4('0x26'),_0x4d4738,_0x3b159b[_0x5db4('0x24')][_0x5db4('0x27')]);return _0x1418f9(_0x3b159b[_0x5db4('0x24')][_0x5db4('0x27')]);}logger['error'](_0x5db4('0x26'),_0x4d4738,_0x3b159b['error'][_0x5db4('0x27')]);return _0x97a3e4(_0x3b159b['error'][_0x5db4('0x27')]);}else{logger[_0x5db4('0x28')](_0x5db4('0x26'),_0x4d4738,_0x5db4('0x20'));_0x97a3e4(_0x3b159b['result'][_0x5db4('0x27')]);}})[_0x5db4('0x29')](function(_0x43e756){logger['error'](_0x5db4('0x26'),_0x4d4738,_0x43e756);_0x1418f9(_0x43e756);});});}function respondWithStatusCode(_0x4b6c50,_0x232bf6){_0x232bf6=_0x232bf6||0xcc;return function(_0x204870){if(_0x204870){return _0x4b6c50[_0x5db4('0x2a')](_0x232bf6);}return _0x4b6c50[_0x5db4('0x2b')](_0x232bf6)[_0x5db4('0x2c')]();};}function respondWithResult(_0x1ad66a,_0x4b0041){_0x4b0041=_0x4b0041||0xc8;return function(_0x5be55c){if(_0x5be55c){return _0x1ad66a[_0x5db4('0x2b')](_0x4b0041)['json'](_0x5be55c);}};}function respondWithFilteredResult(_0x293081,_0x44bb9e){return function(_0x59d7f7){if(_0x59d7f7){var _0x328666=typeof _0x44bb9e[_0x5db4('0x2d')]===_0x5db4('0x2e')&&typeof _0x44bb9e['limit']==='undefined';var _0x4c64f3=_0x59d7f7[_0x5db4('0x2f')];var _0x3d2a87=_0x328666?0x0:_0x44bb9e[_0x5db4('0x2d')];var _0x4376c2=_0x328666?_0x59d7f7[_0x5db4('0x2f')]:_0x44bb9e[_0x5db4('0x2d')]+_0x44bb9e[_0x5db4('0x30')];var _0x50d488;if(_0x4376c2>=_0x4c64f3){_0x4376c2=_0x4c64f3;_0x50d488=0xc8;}else{_0x50d488=0xce;}_0x293081['status'](_0x50d488);return _0x293081[_0x5db4('0x31')](_0x5db4('0x32'),_0x3d2a87+'-'+_0x4376c2+'/'+_0x4c64f3)[_0x5db4('0x33')](_0x59d7f7);}return null;};}function patchUpdates(_0x1c1733){return function(_0x1c23d5){try{jsonpatch[_0x5db4('0x34')](_0x1c23d5,_0x1c1733,!![]);}catch(_0x431f14){return BPromise[_0x5db4('0x35')](_0x431f14);}return _0x1c23d5[_0x5db4('0x36')]();};}function saveUpdates(_0x1c2a9b,_0x11d545){return function(_0x155d3d){if(_0x155d3d){return _0x155d3d[_0x5db4('0x37')](_0x1c2a9b)[_0x5db4('0x1f')](function(_0x5b86c8){return _0x5b86c8;});}return null;};}function removeEntity(_0xd12dc1,_0x199589){return function(_0x2bf231){if(_0x2bf231){return _0x2bf231['destroy']()[_0x5db4('0x1f')](function(){_0xd12dc1[_0x5db4('0x2b')](0xcc)[_0x5db4('0x2c')]();});}};}function handleEntityNotFound(_0x5144ec,_0x10558d){return function(_0x33bf26){if(!_0x33bf26){_0x5144ec[_0x5db4('0x2a')](0x194);}return _0x33bf26;};}function handleError(_0x83bdfc,_0x196f86){_0x196f86=_0x196f86||0x1f4;return function(_0x35f50e){logger[_0x5db4('0x24')](_0x35f50e[_0x5db4('0x38')]);if(_0x35f50e[_0x5db4('0x39')]){delete _0x35f50e['name'];}_0x83bdfc['status'](_0x196f86)[_0x5db4('0x3a')](_0x35f50e);};}exports[_0x5db4('0x3b')]=function(_0x871785,_0x285a1c){var _0x38fe17={},_0x543ec2={},_0x210ac0={'count':0x0,'rows':[]};var _0xe8649c=_[_0x5db4('0x3c')](db[_0x5db4('0x3d')]['rawAttributes'],function(_0x1259be){return{'name':_0x1259be[_0x5db4('0x3e')],'type':_0x1259be[_0x5db4('0x3f')]['key']};});_0x543ec2[_0x5db4('0x40')]=_[_0x5db4('0x3c')](_0xe8649c,_0x5db4('0x39'));_0x543ec2[_0x5db4('0x41')]=_[_0x5db4('0x42')](_0x871785[_0x5db4('0x41')]);_0x543ec2[_0x5db4('0x43')]=_[_0x5db4('0x44')](_0x543ec2['model'],_0x543ec2['query']);_0x38fe17[_0x5db4('0x45')]=_[_0x5db4('0x44')](_0x543ec2[_0x5db4('0x40')],qs[_0x5db4('0x46')](_0x871785[_0x5db4('0x41')][_0x5db4('0x46')]));_0x38fe17[_0x5db4('0x45')]=_0x38fe17[_0x5db4('0x45')][_0x5db4('0x47')]?_0x38fe17[_0x5db4('0x45')]:_0x543ec2[_0x5db4('0x40')];if(!_0x871785['query'][_0x5db4('0x48')]('nolimit')){_0x38fe17[_0x5db4('0x30')]=qs[_0x5db4('0x30')](_0x871785[_0x5db4('0x41')][_0x5db4('0x30')]);_0x38fe17[_0x5db4('0x2d')]=qs[_0x5db4('0x2d')](_0x871785[_0x5db4('0x41')][_0x5db4('0x2d')]);}_0x38fe17['order']=qs['sort'](_0x871785[_0x5db4('0x41')]['sort']);_0x38fe17[_0x5db4('0x49')]=qs[_0x5db4('0x43')](_['pick'](_0x871785['query'],_0x543ec2['filters']),_0xe8649c);if(_0x871785[_0x5db4('0x41')]['filter']){_0x38fe17[_0x5db4('0x49')]=_[_0x5db4('0x4a')](_0x38fe17[_0x5db4('0x49')],{'$or':_['map'](_0xe8649c,function(_0x1a7b7c){if(_0x1a7b7c[_0x5db4('0x3f')]!=='VIRTUAL'){var _0x131ddc={};_0x131ddc[_0x1a7b7c[_0x5db4('0x39')]]={'$like':'%'+_0x871785['query']['filter']+'%'};return _0x131ddc;}})});}_0x38fe17=_[_0x5db4('0x4a')]({},_0x38fe17,_0x871785[_0x5db4('0x4b')]);var _0x5d3e18={'where':_0x38fe17[_0x5db4('0x49')]};return db[_0x5db4('0x3d')][_0x5db4('0x2f')](_0x5d3e18)[_0x5db4('0x1f')](function(_0x5b0b2f){_0x210ac0[_0x5db4('0x2f')]=_0x5b0b2f;if(_0x871785[_0x5db4('0x41')]['includeAll']){_0x38fe17[_0x5db4('0x4c')]=[{'all':!![]}];}return db['FaxMessage'][_0x5db4('0x4d')](_0x38fe17);})[_0x5db4('0x1f')](function(_0x23b8e4){_0x210ac0['rows']=_0x23b8e4;return _0x210ac0;})[_0x5db4('0x1f')](respondWithFilteredResult(_0x285a1c,_0x38fe17))[_0x5db4('0x29')](handleError(_0x285a1c,null));};exports[_0x5db4('0x4e')]=function(_0x301d9b,_0x52fe8b){var _0x3d682d={'raw':!![],'where':{'id':_0x301d9b[_0x5db4('0x4f')]['id']}},_0x193510={};_0x193510[_0x5db4('0x40')]=_[_0x5db4('0x42')](db[_0x5db4('0x3d')]['rawAttributes']);_0x193510[_0x5db4('0x41')]=_[_0x5db4('0x42')](_0x301d9b[_0x5db4('0x41')]);_0x193510['filters']=_['intersection'](_0x193510['model'],_0x193510[_0x5db4('0x41')]);_0x3d682d['attributes']=_[_0x5db4('0x44')](_0x193510[_0x5db4('0x40')],qs[_0x5db4('0x46')](_0x301d9b['query'][_0x5db4('0x46')]));_0x3d682d[_0x5db4('0x45')]=_0x3d682d[_0x5db4('0x45')][_0x5db4('0x47')]?_0x3d682d[_0x5db4('0x45')]:_0x193510[_0x5db4('0x40')];if(_0x301d9b[_0x5db4('0x41')]['includeAll']){_0x3d682d[_0x5db4('0x4c')]=[{'all':!![]}];}_0x3d682d=_['merge']({},_0x3d682d,_0x301d9b[_0x5db4('0x4b')]);return db[_0x5db4('0x3d')][_0x5db4('0x50')](_0x3d682d)[_0x5db4('0x1f')](handleEntityNotFound(_0x52fe8b,null))['then'](respondWithResult(_0x52fe8b,null))['catch'](handleError(_0x52fe8b,null));};exports[_0x5db4('0x37')]=function(_0x3fd44e,_0x2da266){if(_0x3fd44e[_0x5db4('0x51')]['id']){delete _0x3fd44e['body']['id'];}return db['FaxMessage'][_0x5db4('0x50')]({'where':{'id':_0x3fd44e[_0x5db4('0x4f')]['id']}})[_0x5db4('0x1f')](handleEntityNotFound(_0x2da266,null))[_0x5db4('0x1f')](saveUpdates(_0x3fd44e[_0x5db4('0x51')],null))[_0x5db4('0x1f')](respondWithResult(_0x2da266,null))['catch'](handleError(_0x2da266,null));};exports[_0x5db4('0x52')]=function(_0x585e49,_0x56118c){return db[_0x5db4('0x3d')][_0x5db4('0x50')]({'where':{'id':_0x585e49[_0x5db4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x56118c,null))['then'](removeEntity(_0x56118c,null))['catch'](handleError(_0x56118c,null));};exports['describe']=function(_0x41eb3d,_0x4aaff0){return db['FaxMessage'][_0x5db4('0x53')]()[_0x5db4('0x1f')](respondWithResult(_0x4aaff0,null))[_0x5db4('0x29')](handleError(_0x4aaff0,null));};var interaction_log=require('../../config/logger')(_0x5db4('0x54'));exports[_0x5db4('0x55')]=function(_0x4df5d7,_0x21c766,_0x5ba217){var _0x57ff5a={'agent':{},'channel':_0x5db4('0x56')};if(_0x4df5d7[_0x5db4('0x51')]['id']){delete _0x4df5d7[_0x5db4('0x51')]['id'];}_0x4df5d7['body'][_0x5db4('0x57')]=!![];_0x4df5d7[_0x5db4('0x51')][_0x5db4('0x58')]=moment()['format'](_0x5db4('0x59'));_0x4df5d7['body'][_0x5db4('0x5a')]=_0x4df5d7[_0x5db4('0x51')][_0x5db4('0x5a')]||_0x4df5d7['user']['id'];_0x57ff5a[_0x5db4('0x5b')]['id']=_0x4df5d7[_0x5db4('0x51')]['UserId'];return db['FaxMessage'][_0x5db4('0x50')]({'where':{'id':_0x4df5d7[_0x5db4('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21c766,null))[_0x5db4('0x1f')](saveUpdates(_0x4df5d7[_0x5db4('0x51')],null))[_0x5db4('0x1f')](function(_0x18615f){if(_0x18615f){_0x57ff5a[_0x5db4('0x27')]=_0x18615f[_0x5db4('0x5c')]({'plain':!![]});return db['FaxInteraction'][_0x5db4('0x50')]({'where':{'id':_0x18615f[_0x5db4('0x5d')]}});}return null;})[_0x5db4('0x1f')](handleEntityNotFound(_0x21c766,null))['then'](function(_0x572a15){if(_0x572a15){return _0x572a15[_0x5db4('0x37')]({'UserId':_0x4df5d7[_0x5db4('0x51')][_0x5db4('0x5a')],'read1stAt':_['isNil'](_0x572a15['read1stAt'])?moment()['format'](_0x5db4('0x59')):undefined});}return null;})[_0x5db4('0x1f')](function(_0x2f7bee){if(_0x2f7bee){_0x57ff5a[_0x5db4('0x5e')]=_0x2f7bee[_0x5db4('0x5c')]({'plain':!![]});interaction_log[_0x5db4('0x28')](_0x5db4('0x5f'),_0x4df5d7['user']['id'],_0x4df5d7[_0x5db4('0x60')][_0x5db4('0x39')],_0x4df5d7[_0x5db4('0x60')][_0x5db4('0x61')],_0x57ff5a[_0x5db4('0x5e')]['id'],_0x4df5d7[_0x5db4('0x51')]?JSON[_0x5db4('0x23')](_0x4df5d7['body']):_0x5db4('0x62'));return respondWithRpcPromise(_0x5db4('0x63'),_0x5db4('0x64'),_0x57ff5a);}return null;})[_0x5db4('0x1f')](function(_0x3036b3){var _0x2096db=_0x5db4('0x65')+_0x3036b3[_0x5db4('0x27')][_0x5db4('0x66')];return db['sequelize'][_0x5db4('0x41')](_0x2096db,{'type':db[_0x5db4('0x67')][_0x5db4('0x68')]['SELECT'],'raw':!![]})[_0x5db4('0x1f')](function(_0x3e2924){return _0x3e2924;});})[_0x5db4('0x1f')](function(_0x3d265a){if(_0x3d265a){_0x57ff5a[_0x5db4('0x27')][_0x5db4('0x69')]=_0x3d265a[0x0];if(!_0x4df5d7[_0x5db4('0x51')]['UserId'])return;return db[_0x5db4('0x6a')][_0x5db4('0x50')]({'where':{'id':_0x4df5d7[_0x5db4('0x51')]['UserId'],'role':_0x5db4('0x5b')},'attributes':['id','name',_0x5db4('0x6b'),_0x5db4('0x6c'),_0x5db4('0x6d')],'raw':!![]});}return null;})[_0x5db4('0x1f')](function(_0x1ac0d2){if(!_0x1ac0d2)return null;_0x57ff5a[_0x5db4('0x27')][_0x5db4('0x5b')]=_0x1ac0d2;return _0x57ff5a;})[_0x5db4('0x1f')](function(_0x3cdd6f){if(_0x3cdd6f){if(_0x4df5d7[_0x5db4('0x51')][_0x5db4('0x6e')]){_0x57ff5a[_0x5db4('0x27')][_0x5db4('0x6f')]=util[_0x5db4('0x70')](_0x5db4('0x71'),_0x4df5d7[_0x5db4('0x60')][_0x5db4('0x39')]);_0x57ff5a['message'][_0x5db4('0x72')]=_0x57ff5a['channel'];_0x57ff5a[_0x5db4('0x27')][_0x5db4('0x73')]=_0x57ff5a[_0x5db4('0x72')];_0x57ff5a['message']['event']=_0x5db4('0x55');return respondWithRpcPromise(_0x5db4('0x74'),_0x5db4('0x74'),{'event':'acceptmessage','message':_0x57ff5a[_0x5db4('0x27')]},client9002)['then'](function(){return _0x57ff5a;});}return _0x57ff5a;}return null;})[_0x5db4('0x1f')](respondWithResult(_0x21c766,null))['catch'](handleError(_0x21c766,null));};var interaction_log=require(_0x5db4('0x14'))(_0x5db4('0x54'));exports[_0x5db4('0x35')]=function(_0x68b95f,_0x141f97,_0x3123e1){var _0x3bb41f={'agent':{},'channel':_0x5db4('0x56')};if(_0x68b95f[_0x5db4('0x51')]['id']){delete _0x68b95f[_0x5db4('0x51')]['id'];}_0x68b95f[_0x5db4('0x51')]['UserId']=_0x68b95f[_0x5db4('0x51')][_0x5db4('0x5a')]||_0x68b95f[_0x5db4('0x60')]['id'];_0x3bb41f['agent']['id']=_0x68b95f['body']['UserId'];return db[_0x5db4('0x3d')]['find']({'where':{'id':_0x68b95f['params']['id'],'UserId':null}})[_0x5db4('0x1f')](handleEntityNotFound(_0x141f97,null))[_0x5db4('0x1f')](function(_0x393377){if(_0x393377){_0x3bb41f[_0x5db4('0x27')]=_0x393377[_0x5db4('0x5c')]({'plain':!![]});return db[_0x5db4('0x75')][_0x5db4('0x50')]({'where':{'id':_0x393377[_0x5db4('0x5d')]}});}return null;})[_0x5db4('0x1f')](handleEntityNotFound(_0x141f97,null))[_0x5db4('0x1f')](function(_0x452561){if(_0x452561){_0x3bb41f[_0x5db4('0x5e')]=_0x452561[_0x5db4('0x5c')]({'plain':!![]});interaction_log[_0x5db4('0x28')](_0x5db4('0x76'),_0x68b95f[_0x5db4('0x60')]['id'],_0x68b95f[_0x5db4('0x60')][_0x5db4('0x39')],_0x68b95f['user']['role'],_0x3bb41f['interaction']['id'],_0x68b95f[_0x5db4('0x51')]?JSON[_0x5db4('0x23')](_0x68b95f[_0x5db4('0x51')]):_0x5db4('0x62'));return respondWithRpcPromise(_0x5db4('0x77'),_0x5db4('0x78'),_0x3bb41f);}return null;})[_0x5db4('0x1f')](function(_0x3656e9){var _0x2999e0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3656e9[_0x5db4('0x27')][_0x5db4('0x66')];return db[_0x5db4('0x79')][_0x5db4('0x41')](_0x2999e0,{'type':db[_0x5db4('0x67')][_0x5db4('0x68')]['SELECT'],'raw':!![]})['then'](function(_0x3a7643){return _0x3a7643;});})[_0x5db4('0x1f')](function(_0x3370e5){if(_0x3370e5){_0x3bb41f[_0x5db4('0x27')][_0x5db4('0x69')]=_0x3370e5[0x0];if(!_0x68b95f[_0x5db4('0x51')][_0x5db4('0x5a')])return;return db[_0x5db4('0x6a')][_0x5db4('0x50')]({'where':{'id':_0x68b95f[_0x5db4('0x51')][_0x5db4('0x5a')],'role':_0x5db4('0x5b')},'attributes':['id',_0x5db4('0x39'),_0x5db4('0x6b'),_0x5db4('0x6c'),'internal'],'raw':!![]});}return null;})[_0x5db4('0x1f')](function(_0x5861cd){if(!_0x5861cd)return null;_0x3bb41f[_0x5db4('0x27')][_0x5db4('0x5b')]=_0x5861cd;return _0x3bb41f;})[_0x5db4('0x1f')](function(_0xd06170){if(_0xd06170){_0xd06170[_0x5db4('0x27')][_0x5db4('0x6f')]=util['format'](_0x5db4('0x71'),_0x68b95f[_0x5db4('0x60')][_0x5db4('0x39')]);_0xd06170[_0x5db4('0x27')]['channel']=_0x3bb41f[_0x5db4('0x72')];_0xd06170[_0x5db4('0x27')][_0x5db4('0x73')]=_0x3bb41f['channel'];_0xd06170[_0x5db4('0x27')][_0x5db4('0x7a')]=_0x5db4('0x35');respondWithRpcPromise(_0x5db4('0x74'),_0x5db4('0x74'),{'event':_0x5db4('0x7b'),'message':_0xd06170[_0x5db4('0x27')]},client9002);return _0x3bb41f;}return null;})[_0x5db4('0x1f')](respondWithResult(_0x141f97,null))[_0x5db4('0x29')](handleError(_0x141f97,null));};exports[_0x5db4('0x7c')]=function(_0x55a2c6,_0x2a1d31){var _0x4ad959;return db['FaxMessage']['create'](_0x55a2c6[_0x5db4('0x51')],{})['then'](function(_0x21ff4b){_0x4ad959=_0x21ff4b;return db[_0x5db4('0x7d')]['findOne']({'where':{'id':_0x4ad959[_0x5db4('0x66')]}});})[_0x5db4('0x1f')](function(_0x9a7ff2){if(_[_0x5db4('0x7e')](_0x9a7ff2)){return;}else{_0x4ad959['fax']=_0x9a7ff2[_0x5db4('0x56')];return db[_0x5db4('0x7f')][_0x5db4('0x80')]({'where':{'id':_0x4ad959[_0x5db4('0x81')]}});}})[_0x5db4('0x1f')](function(_0x575760){return respondWithRpcPromise(_0x5db4('0x82'),_0x5db4('0x82'),{'FaxAccountId':_[_0x5db4('0x7e')](_0x55a2c6[_0x5db4('0x51')])?undefined:_0x55a2c6[_0x5db4('0x51')][_0x5db4('0x83')],'path':_[_0x5db4('0x7e')](_0x575760)?undefined:util[_0x5db4('0x70')](_0x5db4('0x84'),_0x575760[_0x5db4('0x85')]),'fax':_[_0x5db4('0x7e')](_0x4ad959[_0x5db4('0x56')])?undefined:_0x4ad959['fax'],'AttachmentId':_0x4ad959[_0x5db4('0x81')]},client9002);})['then'](respondWithResult(_0x2a1d31,0xc9))['catch'](handleError(_0x2a1d31,null));};exports['download']=function(_0x3ae326,_0x1e113d){var _0x2d3947=path[_0x5db4('0x86')](config[_0x5db4('0x87')],'server','files',_0x5db4('0x88'));return db[_0x5db4('0x3d')]['find']({'where':{'id':_0x3ae326[_0x5db4('0x4f')]['id']},'include':[{'model':db['Attachment'],'as':_0x5db4('0x7f')}]})[_0x5db4('0x1f')](handleEntityNotFound(_0x1e113d,null))[_0x5db4('0x1f')](function(_0x1bb4b2){if(_0x1bb4b2){return _0x1e113d[_0x5db4('0x89')](path[_0x5db4('0x86')](_0x2d3947,_0x1bb4b2[_0x5db4('0x7f')][_0x5db4('0x85')]));}})[_0x5db4('0x29')](handleError(_0x1e113d,null));};
\ No newline at end of file
+var _0xf389=['../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxMessage.socket','register','jayson/promise','client','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','undefined','offset','count','limit','set','json','save','update','then','destroy','sendStatus','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','rejectmessage','create','isNil','Attachment','findOne','SendFax','basename','AttachmentId','download','join','root','server','files','attachments','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x94b5dc,_0x30402c){var _0x4454c2=function(_0x4e1ac9){while(--_0x4e1ac9){_0x94b5dc['push'](_0x94b5dc['shift']());}};_0x4454c2(++_0x30402c);}(_0xf389,0x10d));var _0x9f38=function(_0x2e6a61,_0x2d0656){_0x2e6a61=_0x2e6a61-0x0;var _0x3eb55c=_0xf389[_0x2e6a61];return _0x3eb55c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f38('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f38('0x1'));var moment=require(_0x9f38('0x2'));var BPromise=require(_0x9f38('0x3'));var Mustache=require(_0x9f38('0x4'));var util=require(_0x9f38('0x5'));var path=require(_0x9f38('0x6'));var sox=require(_0x9f38('0x7'));var csv=require(_0x9f38('0x8'));var ejs=require(_0x9f38('0x9'));var fs=require('fs');var fs_extra=require(_0x9f38('0xa'));var _=require(_0x9f38('0xb'));var squel=require('squel');var crypto=require(_0x9f38('0xc'));var jsforce=require(_0x9f38('0xd'));var deskjs=require(_0x9f38('0xe'));var toCsv=require(_0x9f38('0x8'));var querystring=require(_0x9f38('0xf'));var Papa=require(_0x9f38('0x10'));var Redis=require(_0x9f38('0x11'));var authService=require(_0x9f38('0x12'));var qs=require(_0x9f38('0x13'));var as=require(_0x9f38('0x14'));var hardwareService=require(_0x9f38('0x15'));var logger=require(_0x9f38('0x16'))(_0x9f38('0x17'));var utils=require(_0x9f38('0x18'));var config=require(_0x9f38('0x19'));var licenseUtil=require(_0x9f38('0x1a'));var db=require(_0x9f38('0x1b'))['db'];config[_0x9f38('0x1c')]=_['defaults'](config[_0x9f38('0x1c')],{'host':_0x9f38('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f38('0x1c')]));require(_0x9f38('0x1e'))[_0x9f38('0x1f')](socket);var jayson=require(_0x9f38('0x20'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x9f38('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4438c2,_0x455e7a,_0xfa2d71,_0x396971){return new BPromise(function(_0x5186fd,_0x29aa5c){var _0x4ef1f0=_0x396971||client;return _0x4ef1f0[_0x9f38('0x22')](_0x4438c2,_0xfa2d71)['then'](function(_0x1323e0){logger[_0x9f38('0x23')](_0x9f38('0x24'),_0x455e7a,_0x9f38('0x25'));logger['debug'](_0x9f38('0x26'),_0x455e7a,_0x9f38('0x25'),JSON[_0x9f38('0x27')](_0x1323e0));if(_0x1323e0[_0x9f38('0x28')]){if(_0x1323e0['error'][_0x9f38('0x29')]===0x1f4){logger[_0x9f38('0x28')](_0x9f38('0x24'),_0x455e7a,_0x1323e0[_0x9f38('0x28')][_0x9f38('0x2a')]);return _0x29aa5c(_0x1323e0[_0x9f38('0x28')]['message']);}logger[_0x9f38('0x28')](_0x9f38('0x24'),_0x455e7a,_0x1323e0['error'][_0x9f38('0x2a')]);return _0x5186fd(_0x1323e0[_0x9f38('0x28')][_0x9f38('0x2a')]);}else{logger[_0x9f38('0x23')]('FaxMessage,\x20%s,\x20%s',_0x455e7a,_0x9f38('0x25'));_0x5186fd(_0x1323e0[_0x9f38('0x2b')][_0x9f38('0x2a')]);}})[_0x9f38('0x2c')](function(_0x261d34){logger[_0x9f38('0x28')](_0x9f38('0x24'),_0x455e7a,_0x261d34);_0x29aa5c(_0x261d34);});});}function respondWithStatusCode(_0x311a20,_0x1f4c97){_0x1f4c97=_0x1f4c97||0xcc;return function(_0x17b1bc){if(_0x17b1bc){return _0x311a20['sendStatus'](_0x1f4c97);}return _0x311a20[_0x9f38('0x2d')](_0x1f4c97)[_0x9f38('0x2e')]();};}function respondWithResult(_0x535d32,_0x452c6b){_0x452c6b=_0x452c6b||0xc8;return function(_0x16ce51){if(_0x16ce51){return _0x535d32[_0x9f38('0x2d')](_0x452c6b)['json'](_0x16ce51);}};}function respondWithFilteredResult(_0x89e13a,_0x3c041a){return function(_0x24a444){if(_0x24a444){var _0x178192=typeof _0x3c041a['offset']==='undefined'&&typeof _0x3c041a['limit']===_0x9f38('0x2f');var _0x5a476a=_0x24a444['count'];var _0x60cd0b=_0x178192?0x0:_0x3c041a[_0x9f38('0x30')];var _0x1fa709=_0x178192?_0x24a444[_0x9f38('0x31')]:_0x3c041a[_0x9f38('0x30')]+_0x3c041a[_0x9f38('0x32')];var _0x56f384;if(_0x1fa709>=_0x5a476a){_0x1fa709=_0x5a476a;_0x56f384=0xc8;}else{_0x56f384=0xce;}_0x89e13a[_0x9f38('0x2d')](_0x56f384);return _0x89e13a[_0x9f38('0x33')]('Content-Range',_0x60cd0b+'-'+_0x1fa709+'/'+_0x5a476a)[_0x9f38('0x34')](_0x24a444);}return null;};}function patchUpdates(_0x2fcad3){return function(_0x1409e9){try{jsonpatch['apply'](_0x1409e9,_0x2fcad3,!![]);}catch(_0xa5c582){return BPromise['reject'](_0xa5c582);}return _0x1409e9[_0x9f38('0x35')]();};}function saveUpdates(_0x277281,_0x2d9946){return function(_0x11733c){if(_0x11733c){return _0x11733c[_0x9f38('0x36')](_0x277281)[_0x9f38('0x37')](function(_0x556c70){return _0x556c70;});}return null;};}function removeEntity(_0x27e70f,_0x490255){return function(_0x33dc52){if(_0x33dc52){return _0x33dc52[_0x9f38('0x38')]()[_0x9f38('0x37')](function(){_0x27e70f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x512f98,_0x1fff33){return function(_0x34f257){if(!_0x34f257){_0x512f98[_0x9f38('0x39')](0x194);}return _0x34f257;};}function handleError(_0x2d792e,_0x35ec0a){_0x35ec0a=_0x35ec0a||0x1f4;return function(_0x15021a){logger[_0x9f38('0x28')](_0x15021a['stack']);if(_0x15021a['name']){delete _0x15021a[_0x9f38('0x3a')];}_0x2d792e[_0x9f38('0x2d')](_0x35ec0a)[_0x9f38('0x3b')](_0x15021a);};}exports[_0x9f38('0x3c')]=function(_0x586ff4,_0x535770){var _0x9ec7d0={},_0x38478f={},_0x51d091={'count':0x0,'rows':[]};var _0x24e11b=_[_0x9f38('0x3d')](db[_0x9f38('0x3e')][_0x9f38('0x3f')],function(_0x18cb72){return{'name':_0x18cb72[_0x9f38('0x40')],'type':_0x18cb72[_0x9f38('0x41')][_0x9f38('0x42')]};});_0x38478f['model']=_[_0x9f38('0x3d')](_0x24e11b,_0x9f38('0x3a'));_0x38478f[_0x9f38('0x43')]=_[_0x9f38('0x44')](_0x586ff4[_0x9f38('0x43')]);_0x38478f[_0x9f38('0x45')]=_[_0x9f38('0x46')](_0x38478f[_0x9f38('0x47')],_0x38478f[_0x9f38('0x43')]);_0x9ec7d0['attributes']=_[_0x9f38('0x46')](_0x38478f[_0x9f38('0x47')],qs['fields'](_0x586ff4['query'][_0x9f38('0x48')]));_0x9ec7d0[_0x9f38('0x49')]=_0x9ec7d0[_0x9f38('0x49')][_0x9f38('0x4a')]?_0x9ec7d0['attributes']:_0x38478f[_0x9f38('0x47')];if(!_0x586ff4[_0x9f38('0x43')]['hasOwnProperty']('nolimit')){_0x9ec7d0['limit']=qs['limit'](_0x586ff4[_0x9f38('0x43')]['limit']);_0x9ec7d0[_0x9f38('0x30')]=qs[_0x9f38('0x30')](_0x586ff4[_0x9f38('0x43')][_0x9f38('0x30')]);}_0x9ec7d0[_0x9f38('0x4b')]=qs[_0x9f38('0x4c')](_0x586ff4[_0x9f38('0x43')][_0x9f38('0x4c')]);_0x9ec7d0[_0x9f38('0x4d')]=qs['filters'](_[_0x9f38('0x4e')](_0x586ff4[_0x9f38('0x43')],_0x38478f[_0x9f38('0x45')]),_0x24e11b);if(_0x586ff4['query'][_0x9f38('0x4f')]){_0x9ec7d0[_0x9f38('0x4d')]=_[_0x9f38('0x50')](_0x9ec7d0[_0x9f38('0x4d')],{'$or':_[_0x9f38('0x3d')](_0x24e11b,function(_0x372e2d){if(_0x372e2d[_0x9f38('0x41')]!=='VIRTUAL'){var _0x46f5e6={};_0x46f5e6[_0x372e2d['name']]={'$like':'%'+_0x586ff4[_0x9f38('0x43')][_0x9f38('0x4f')]+'%'};return _0x46f5e6;}})});}_0x9ec7d0=_['merge']({},_0x9ec7d0,_0x586ff4[_0x9f38('0x51')]);var _0xc68fd0={'where':_0x9ec7d0[_0x9f38('0x4d')]};return db[_0x9f38('0x3e')][_0x9f38('0x31')](_0xc68fd0)[_0x9f38('0x37')](function(_0x965801){_0x51d091[_0x9f38('0x31')]=_0x965801;if(_0x586ff4[_0x9f38('0x43')][_0x9f38('0x52')]){_0x9ec7d0[_0x9f38('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0x9f38('0x54')](_0x9ec7d0);})[_0x9f38('0x37')](function(_0x260201){_0x51d091[_0x9f38('0x55')]=_0x260201;return _0x51d091;})['then'](respondWithFilteredResult(_0x535770,_0x9ec7d0))[_0x9f38('0x2c')](handleError(_0x535770,null));};exports['show']=function(_0x43b230,_0x3005eb){var _0x4d4972={'raw':!![],'where':{'id':_0x43b230[_0x9f38('0x56')]['id']}},_0x476645={};_0x476645['model']=_[_0x9f38('0x44')](db[_0x9f38('0x3e')]['rawAttributes']);_0x476645[_0x9f38('0x43')]=_[_0x9f38('0x44')](_0x43b230[_0x9f38('0x43')]);_0x476645[_0x9f38('0x45')]=_['intersection'](_0x476645[_0x9f38('0x47')],_0x476645[_0x9f38('0x43')]);_0x4d4972[_0x9f38('0x49')]=_[_0x9f38('0x46')](_0x476645[_0x9f38('0x47')],qs[_0x9f38('0x48')](_0x43b230[_0x9f38('0x43')]['fields']));_0x4d4972[_0x9f38('0x49')]=_0x4d4972[_0x9f38('0x49')][_0x9f38('0x4a')]?_0x4d4972[_0x9f38('0x49')]:_0x476645[_0x9f38('0x47')];if(_0x43b230[_0x9f38('0x43')][_0x9f38('0x52')]){_0x4d4972['include']=[{'all':!![]}];}_0x4d4972=_[_0x9f38('0x50')]({},_0x4d4972,_0x43b230[_0x9f38('0x51')]);return db[_0x9f38('0x3e')][_0x9f38('0x57')](_0x4d4972)[_0x9f38('0x37')](handleEntityNotFound(_0x3005eb,null))['then'](respondWithResult(_0x3005eb,null))[_0x9f38('0x2c')](handleError(_0x3005eb,null));};exports[_0x9f38('0x36')]=function(_0x1ba56c,_0x2ce2c9){if(_0x1ba56c[_0x9f38('0x58')]['id']){delete _0x1ba56c[_0x9f38('0x58')]['id'];}return db[_0x9f38('0x3e')][_0x9f38('0x57')]({'where':{'id':_0x1ba56c['params']['id']}})[_0x9f38('0x37')](handleEntityNotFound(_0x2ce2c9,null))['then'](saveUpdates(_0x1ba56c['body'],null))['then'](respondWithResult(_0x2ce2c9,null))[_0x9f38('0x2c')](handleError(_0x2ce2c9,null));};exports[_0x9f38('0x38')]=function(_0x49570b,_0x165917){return db[_0x9f38('0x3e')][_0x9f38('0x57')]({'where':{'id':_0x49570b['params']['id']}})['then'](handleEntityNotFound(_0x165917,null))[_0x9f38('0x37')](removeEntity(_0x165917,null))[_0x9f38('0x2c')](handleError(_0x165917,null));};exports['describe']=function(_0x38663c,_0x701e06){return db[_0x9f38('0x3e')][_0x9f38('0x59')]()[_0x9f38('0x37')](respondWithResult(_0x701e06,null))[_0x9f38('0x2c')](handleError(_0x701e06,null));};var interaction_log=require(_0x9f38('0x16'))(_0x9f38('0x5a'));exports[_0x9f38('0x5b')]=function(_0x27d995,_0x4cf4df,_0x4cc311){var _0x37cff1={'agent':{},'channel':_0x9f38('0x5c')};if(_0x27d995[_0x9f38('0x58')]['id']){delete _0x27d995[_0x9f38('0x58')]['id'];}_0x27d995[_0x9f38('0x58')][_0x9f38('0x5d')]=!![];_0x27d995[_0x9f38('0x58')][_0x9f38('0x5e')]=moment()[_0x9f38('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x27d995[_0x9f38('0x58')][_0x9f38('0x60')]=_0x27d995[_0x9f38('0x58')][_0x9f38('0x60')]||_0x27d995[_0x9f38('0x61')]['id'];_0x37cff1[_0x9f38('0x62')]['id']=_0x27d995[_0x9f38('0x58')]['UserId'];return db[_0x9f38('0x3e')][_0x9f38('0x57')]({'where':{'id':_0x27d995[_0x9f38('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cf4df,null))[_0x9f38('0x37')](saveUpdates(_0x27d995['body'],null))['then'](function(_0x4346ca){if(_0x4346ca){_0x37cff1[_0x9f38('0x2a')]=_0x4346ca[_0x9f38('0x63')]({'plain':!![]});return db[_0x9f38('0x64')][_0x9f38('0x57')]({'where':{'id':_0x4346ca[_0x9f38('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x4cf4df,null))[_0x9f38('0x37')](function(_0x1d9e8d){if(_0x1d9e8d){return _0x1d9e8d[_0x9f38('0x36')]({'UserId':_0x27d995[_0x9f38('0x58')][_0x9f38('0x60')],'read1stAt':_['isNil'](_0x1d9e8d[_0x9f38('0x66')])?moment()[_0x9f38('0x5f')](_0x9f38('0x67')):undefined});}return null;})[_0x9f38('0x37')](function(_0x4f46d4){if(_0x4f46d4){_0x37cff1[_0x9f38('0x68')]=_0x4f46d4[_0x9f38('0x63')]({'plain':!![]});interaction_log[_0x9f38('0x23')](_0x9f38('0x69'),_0x27d995['user']['id'],_0x27d995[_0x9f38('0x61')][_0x9f38('0x3a')],_0x27d995[_0x9f38('0x61')][_0x9f38('0x6a')],_0x37cff1[_0x9f38('0x68')]['id'],_0x27d995[_0x9f38('0x58')]?JSON[_0x9f38('0x27')](_0x27d995[_0x9f38('0x58')]):_0x9f38('0x6b'));return respondWithRpcPromise(_0x9f38('0x6c'),_0x9f38('0x6d'),_0x37cff1);}return null;})[_0x9f38('0x37')](function(_0x5298d7){var _0x56aeb0=_0x9f38('0x6e')+_0x5298d7['message'][_0x9f38('0x6f')];return db[_0x9f38('0x70')][_0x9f38('0x43')](_0x56aeb0,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x9f38('0x37')](function(_0x42c265){return _0x42c265;});})['then'](function(_0x2e4a86){if(_0x2e4a86){_0x37cff1[_0x9f38('0x2a')][_0x9f38('0x71')]=_0x2e4a86[0x0];if(!_0x27d995['body']['UserId'])return;return db[_0x9f38('0x72')]['find']({'where':{'id':_0x27d995[_0x9f38('0x58')][_0x9f38('0x60')],'role':_0x9f38('0x62')},'attributes':['id',_0x9f38('0x3a'),_0x9f38('0x73'),_0x9f38('0x74'),_0x9f38('0x75')],'raw':!![]});}return null;})[_0x9f38('0x37')](function(_0x536f19){if(!_0x536f19)return null;_0x37cff1[_0x9f38('0x2a')][_0x9f38('0x62')]=_0x536f19;return _0x37cff1;})[_0x9f38('0x37')](function(_0x36f880){if(_0x36f880){if(_0x27d995[_0x9f38('0x58')][_0x9f38('0x76')]){_0x37cff1['message'][_0x9f38('0x77')]=util[_0x9f38('0x5f')](_0x9f38('0x78'),_0x27d995[_0x9f38('0x61')][_0x9f38('0x3a')]);_0x37cff1[_0x9f38('0x2a')][_0x9f38('0x79')]=_0x37cff1[_0x9f38('0x79')];_0x37cff1[_0x9f38('0x2a')][_0x9f38('0x7a')]=_0x37cff1['channel'];_0x37cff1[_0x9f38('0x2a')][_0x9f38('0x7b')]=_0x9f38('0x5b');return respondWithRpcPromise(_0x9f38('0x7c'),_0x9f38('0x7c'),{'event':_0x9f38('0x7d'),'message':_0x37cff1['message']},client9002)[_0x9f38('0x37')](function(){return _0x37cff1;});}return _0x37cff1;}return null;})[_0x9f38('0x37')](respondWithResult(_0x4cf4df,null))['catch'](handleError(_0x4cf4df,null));};var interaction_log=require(_0x9f38('0x16'))('fax-interactions');exports[_0x9f38('0x7e')]=function(_0x211d4a,_0x24dd5c,_0x184a4b){var _0x2b93d5={'agent':{},'channel':_0x9f38('0x5c')};if(_0x211d4a[_0x9f38('0x58')]['id']){delete _0x211d4a[_0x9f38('0x58')]['id'];}_0x211d4a['body'][_0x9f38('0x60')]=_0x211d4a[_0x9f38('0x58')][_0x9f38('0x60')]||_0x211d4a[_0x9f38('0x61')]['id'];_0x2b93d5[_0x9f38('0x62')]['id']=_0x211d4a[_0x9f38('0x58')][_0x9f38('0x60')];return db[_0x9f38('0x3e')][_0x9f38('0x57')]({'where':{'id':_0x211d4a['params']['id'],'UserId':null}})[_0x9f38('0x37')](handleEntityNotFound(_0x24dd5c,null))[_0x9f38('0x37')](function(_0x27b341){if(_0x27b341){_0x2b93d5['message']=_0x27b341[_0x9f38('0x63')]({'plain':!![]});return db[_0x9f38('0x64')][_0x9f38('0x57')]({'where':{'id':_0x27b341[_0x9f38('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x24dd5c,null))['then'](function(_0x3f24f6){if(_0x3f24f6){_0x2b93d5[_0x9f38('0x68')]=_0x3f24f6[_0x9f38('0x63')]({'plain':!![]});interaction_log[_0x9f38('0x23')](_0x9f38('0x7f'),_0x211d4a[_0x9f38('0x61')]['id'],_0x211d4a[_0x9f38('0x61')][_0x9f38('0x3a')],_0x211d4a[_0x9f38('0x61')]['role'],_0x2b93d5['interaction']['id'],_0x211d4a[_0x9f38('0x58')]?JSON['stringify'](_0x211d4a[_0x9f38('0x58')]):_0x9f38('0x6b'));return respondWithRpcPromise(_0x9f38('0x80'),_0x9f38('0x81'),_0x2b93d5);}return null;})[_0x9f38('0x37')](function(_0x13e168){var _0x32f276=_0x9f38('0x6e')+_0x13e168['message'][_0x9f38('0x6f')];return db['sequelize'][_0x9f38('0x43')](_0x32f276,{'type':db[_0x9f38('0x82')][_0x9f38('0x83')][_0x9f38('0x84')],'raw':!![]})['then'](function(_0x2fa361){return _0x2fa361;});})[_0x9f38('0x37')](function(_0x77d7a2){if(_0x77d7a2){_0x2b93d5['message'][_0x9f38('0x71')]=_0x77d7a2[0x0];if(!_0x211d4a[_0x9f38('0x58')][_0x9f38('0x60')])return;return db[_0x9f38('0x72')][_0x9f38('0x57')]({'where':{'id':_0x211d4a[_0x9f38('0x58')][_0x9f38('0x60')],'role':'agent'},'attributes':['id',_0x9f38('0x3a'),'fullname',_0x9f38('0x74'),'internal'],'raw':!![]});}return null;})[_0x9f38('0x37')](function(_0xeb23ef){if(!_0xeb23ef)return null;_0x2b93d5[_0x9f38('0x2a')][_0x9f38('0x62')]=_0xeb23ef;return _0x2b93d5;})[_0x9f38('0x37')](function(_0x454091){if(_0x454091){_0x454091[_0x9f38('0x2a')][_0x9f38('0x77')]=util[_0x9f38('0x5f')](_0x9f38('0x78'),_0x211d4a['user'][_0x9f38('0x3a')]);_0x454091[_0x9f38('0x2a')][_0x9f38('0x79')]=_0x2b93d5['channel'];_0x454091[_0x9f38('0x2a')][_0x9f38('0x7a')]=_0x2b93d5[_0x9f38('0x79')];_0x454091['message'][_0x9f38('0x7b')]=_0x9f38('0x7e');respondWithRpcPromise(_0x9f38('0x7c'),'EventManager',{'event':_0x9f38('0x85'),'message':_0x454091[_0x9f38('0x2a')]},client9002);return _0x2b93d5;}return null;})['then'](respondWithResult(_0x24dd5c,null))[_0x9f38('0x2c')](handleError(_0x24dd5c,null));};exports[_0x9f38('0x86')]=function(_0x2f5965,_0x43a304){var _0x4b85cf;return db[_0x9f38('0x3e')][_0x9f38('0x86')](_0x2f5965[_0x9f38('0x58')],{})['then'](function(_0x2a6841){_0x4b85cf=_0x2a6841;return db['CmContact']['findOne']({'where':{'id':_0x4b85cf[_0x9f38('0x6f')]}});})[_0x9f38('0x37')](function(_0x44652e){if(_[_0x9f38('0x87')](_0x44652e)){return;}else{_0x4b85cf['fax']=_0x44652e[_0x9f38('0x5c')];return db[_0x9f38('0x88')][_0x9f38('0x89')]({'where':{'id':_0x4b85cf['AttachmentId']}});}})[_0x9f38('0x37')](function(_0x5e3474){return respondWithRpcPromise('SendFax',_0x9f38('0x8a'),{'FaxAccountId':_[_0x9f38('0x87')](_0x2f5965[_0x9f38('0x58')])?undefined:_0x2f5965['body']['FaxAccountId'],'path':_['isNil'](_0x5e3474)?undefined:util[_0x9f38('0x5f')]('/var/opt/motion2/server/files/attachments/%s',_0x5e3474[_0x9f38('0x8b')]),'fax':_[_0x9f38('0x87')](_0x4b85cf[_0x9f38('0x5c')])?undefined:_0x4b85cf['fax'],'AttachmentId':_0x4b85cf[_0x9f38('0x8c')]},client9002);})[_0x9f38('0x37')](respondWithResult(_0x43a304,0xc9))[_0x9f38('0x2c')](handleError(_0x43a304,null));};exports[_0x9f38('0x8d')]=function(_0x4ee4a7,_0x37c106){var _0x541190=path[_0x9f38('0x8e')](config[_0x9f38('0x8f')],_0x9f38('0x90'),_0x9f38('0x91'),_0x9f38('0x92'));return db['FaxMessage'][_0x9f38('0x57')]({'where':{'id':_0x4ee4a7[_0x9f38('0x56')]['id']},'include':[{'model':db[_0x9f38('0x88')],'as':_0x9f38('0x88')}]})[_0x9f38('0x37')](handleEntityNotFound(_0x37c106,null))[_0x9f38('0x37')](function(_0x5df7a2){if(_0x5df7a2){return _0x37c106[_0x9f38('0x8d')](path['join'](_0x541190,_0x5df7a2['Attachment']['basename']));}})[_0x9f38('0x2c')](handleError(_0x37c106,null));};
\ No newline at end of file
index 69a5359..e1e15cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee3c=['events','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xee3c,0x14a));var _0xcee3=function(_0x51e579,_0x2135d3){_0x51e579=_0x51e579-0x0;var _0xde671=_0xee3c[_0x51e579];return _0xde671;};'use strict';var EventEmitter=require(_0xcee3('0x0'));var FaxMessage=require(_0xcee3('0x1'))['db'][_0xcee3('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xcee3('0x3')](0x0);var events={'afterCreate':_0xcee3('0x4'),'afterUpdate':_0xcee3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a7681){return function(_0x435892,_0x4cd398,_0x39d2a8){FaxMessageEvents[_0xcee3('0x6')](_0x4a7681+':'+_0x435892['id'],_0x435892);FaxMessageEvents[_0xcee3('0x6')](_0x4a7681,_0x435892);_0x39d2a8(null);};}for(var e in events){if(events[_0xcee3('0x7')](e)){var event=events[e];FaxMessage[_0xcee3('0x8')](e,emitEvent(event));}}module[_0xcee3('0x9')]=FaxMessageEvents;
\ No newline at end of file
+var _0x3cb7=['save','update','remove','emit','hasOwnProperty','hook','exports','FaxMessage'];(function(_0x2f1c1f,_0x1bbf08){var _0x44365d=function(_0x10a97a){while(--_0x10a97a){_0x2f1c1f['push'](_0x2f1c1f['shift']());}};_0x44365d(++_0x1bbf08);}(_0x3cb7,0xcf));var _0x73cb=function(_0x5e7e1a,_0x38a7c6){_0x5e7e1a=_0x5e7e1a-0x0;var _0x46b94f=_0x3cb7[_0x5e7e1a];return _0x46b94f;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x73cb('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x73cb('0x1'),'afterUpdate':_0x73cb('0x2'),'afterDestroy':_0x73cb('0x3')};function emitEvent(_0x161127){return function(_0x1374a7,_0x3e3503,_0x14b044){FaxMessageEvents[_0x73cb('0x4')](_0x161127+':'+_0x1374a7['id'],_0x1374a7);FaxMessageEvents['emit'](_0x161127,_0x1374a7);_0x14b044(null);};}for(var e in events){if(events[_0x73cb('0x5')](e)){var event=events[e];FaxMessage[_0x73cb('0x6')](e,emitEvent(event));}}module[_0x73cb('0x7')]=FaxMessageEvents;
\ No newline at end of file
index 5995901..aa64841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d8b=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','models','get','direction','toLowerCase','out','isNil','FaxInteractionId','then','update','error','utf8mb4'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x0d8b,0x16d));var _0xb0d8=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x0d8b[_0x4914e2];return _0x2dcd07;};'use strict';var _=require('lodash');var util=require(_0xb0d8('0x0'));var logger=require(_0xb0d8('0x1'))(_0xb0d8('0x2'));var moment=require(_0xb0d8('0x3'));var BPromise=require(_0xb0d8('0x4'));var rp=require(_0xb0d8('0x5'));var fs=require('fs');var path=require(_0xb0d8('0x6'));var rimraf=require(_0xb0d8('0x7'));var config=require(_0xb0d8('0x8'));var attributes=require(_0xb0d8('0x9'));module[_0xb0d8('0xa')]=function(_0x309af7,_0x5d5ee4){return _0x309af7[_0xb0d8('0xb')](_0xb0d8('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xb0d8('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15385c,_0xa056c7,_0x4e088f){var _0x4d58dc=_0x309af7[_0xb0d8('0xe')];var _0x2eb6e1=_0x15385c[_0xb0d8('0xf')]({'plain':!![]});if(_0x2eb6e1[_0xb0d8('0x10')][_0xb0d8('0x11')]()==='in'||_0x2eb6e1[_0xb0d8('0x10')][_0xb0d8('0x11')]()===_0xb0d8('0x12')&&!_0x2eb6e1['secret']&&!_[_0xb0d8('0x13')](_0x2eb6e1['UserId'])){_0x4d58dc['FaxInteraction']['findOne']({'where':{'id':_0x2eb6e1[_0xb0d8('0x14')]}})[_0xb0d8('0x15')](function(_0x191635){if(_0x191635){_0x191635[_0xb0d8('0x16')]({'lastMsgAt':_0x2eb6e1['createdAt'],'lastMsgDirection':_0x2eb6e1['direction'][_0xb0d8('0x11')]()});}})['catch'](function(_0x48ffe4){console[_0xb0d8('0x17')](_0x48ffe4);});}_0x4e088f();}},'charset':_0xb0d8('0x18'),'collate':_0xb0d8('0x19')});};
\ No newline at end of file
+var _0x4c47=['exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','../../config/environment','./faxMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c47,0xa7));var _0x74c4=function(_0x5a5944,_0x19977c){_0x5a5944=_0x5a5944-0x0;var _0x48e566=_0x4c47[_0x5a5944];return _0x48e566;};'use strict';var _=require(_0x74c4('0x0'));var util=require('util');var logger=require(_0x74c4('0x1'))(_0x74c4('0x2'));var moment=require('moment');var BPromise=require(_0x74c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74c4('0x4'));var rimraf=require('rimraf');var config=require(_0x74c4('0x5'));var attributes=require(_0x74c4('0x6'));module[_0x74c4('0x7')]=function(_0x5d695a,_0x24e526){return _0x5d695a[_0x74c4('0x8')](_0x74c4('0x9'),attributes,{'tableName':_0x74c4('0xa'),'paranoid':![],'indexes':[{'name':_0x74c4('0xb'),'fields':[_0x74c4('0xc')],'type':_0x74c4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54e7b8,_0x203426,_0x48d337){var _0x5d1b0b=_0x5d695a[_0x74c4('0xe')];var _0x1e36e1=_0x54e7b8['get']({'plain':!![]});if(_0x1e36e1[_0x74c4('0xf')][_0x74c4('0x10')]()==='in'||_0x1e36e1[_0x74c4('0xf')][_0x74c4('0x10')]()===_0x74c4('0x11')&&!_0x1e36e1[_0x74c4('0x12')]&&!_[_0x74c4('0x13')](_0x1e36e1['UserId'])){_0x5d1b0b[_0x74c4('0x14')]['findOne']({'where':{'id':_0x1e36e1[_0x74c4('0x15')]}})[_0x74c4('0x16')](function(_0x42a550){if(_0x42a550){_0x42a550[_0x74c4('0x17')]({'lastMsgAt':_0x1e36e1[_0x74c4('0x18')],'lastMsgDirection':_0x1e36e1[_0x74c4('0xf')]['toLowerCase']()});}})[_0x74c4('0x19')](function(_0x3a4931){console[_0x74c4('0x1a')](_0x3a4931);});}_0x48d337();}},'charset':_0x74c4('0x1b'),'collate':_0x74c4('0x1c')});};
\ No newline at end of file
index ed91dd1..3371456 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['body','options','raw','CreateFaxMessage','debug','UpdateFaxMessage','limit','then','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxMessage','create'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9bde,0xe1));var _0xe9bd=function(_0x430f4b,_0x21a174){_0x430f4b=_0x430f4b-0x0;var _0x34b5de=_0x9bde[_0x430f4b];return _0x34b5de;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});config[_0xe9bd('0xa')]=_[_0xe9bd('0xb')](config[_0xe9bd('0xa')],{'host':_0xe9bd('0xc'),'port':0x18eb});var socket=require(_0xe9bd('0xd'))(new Redis(config[_0xe9bd('0xa')]));require(_0xe9bd('0xe'))[_0xe9bd('0xf')](socket);function respondWithRpcPromise(_0x45c7ba,_0x581602,_0x5f36c8){return new BPromise(function(_0x3c8e95,_0x145521){return client[_0xe9bd('0x10')](_0x45c7ba,_0x5f36c8)['then'](function(_0x12c96e){logger[_0xe9bd('0x11')](_0xe9bd('0x12'),_0x581602,_0xe9bd('0x13'));logger['debug'](_0xe9bd('0x14'),_0x581602,'request\x20sent',JSON[_0xe9bd('0x15')](_0x12c96e));if(_0x12c96e[_0xe9bd('0x16')]){if(_0x12c96e[_0xe9bd('0x16')]['code']===0x1f4){logger['error'](_0xe9bd('0x12'),_0x581602,_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);return _0x145521(_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);}logger[_0xe9bd('0x16')](_0xe9bd('0x12'),_0x581602,_0x12c96e['error'][_0xe9bd('0x17')]);return _0x3c8e95(_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);}else{logger['info'](_0xe9bd('0x12'),_0x581602,_0xe9bd('0x13'));_0x3c8e95(_0x12c96e[_0xe9bd('0x18')][_0xe9bd('0x17')]);}})['catch'](function(_0x20ec32){logger['error'](_0xe9bd('0x12'),_0x581602,_0x20ec32);_0x145521(_0x20ec32);});});}exports['CreateFaxMessage']=function(_0x26aa4a){var _0x417113=this;return new Promise(function(_0x134c4e,_0x3dda13){return db[_0xe9bd('0x19')][_0xe9bd('0x1a')](_0x26aa4a[_0xe9bd('0x1b')],{'raw':_0x26aa4a['options']?_0x26aa4a[_0xe9bd('0x1c')][_0xe9bd('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x37aec1){logger['info'](_0xe9bd('0x1e'),_0x26aa4a);logger[_0xe9bd('0x1f')](_0xe9bd('0x1e'),_0x26aa4a,JSON[_0xe9bd('0x15')](_0x37aec1));_0x134c4e(_0x37aec1);})['catch'](function(_0x24cf25){logger[_0xe9bd('0x16')](_0xe9bd('0x1e'),_0x24cf25[_0xe9bd('0x17')],_0x26aa4a);_0x3dda13(_0x417113[_0xe9bd('0x16')](0x1f4,_0x24cf25[_0xe9bd('0x17')]));});});};exports[_0xe9bd('0x20')]=function(_0x43ea90){var _0x1ae889=this;return new Promise(function(_0x5987af,_0x3c211a){return db[_0xe9bd('0x19')]['update'](_0x43ea90[_0xe9bd('0x1b')],{'raw':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')][_0xe9bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')]['where']||null:null,'attributes':_0x43ea90['options']?_0x43ea90[_0xe9bd('0x1c')]['attributes']||null:null,'limit':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')][_0xe9bd('0x21')]||null:null})[_0xe9bd('0x22')](function(_0x4057df){logger['info']('UpdateFaxMessage',_0x43ea90);logger[_0xe9bd('0x1f')](_0xe9bd('0x20'),_0x43ea90,JSON[_0xe9bd('0x15')](_0x4057df));_0x5987af(_0x4057df);})[_0xe9bd('0x23')](function(_0xe2436){logger[_0xe9bd('0x16')](_0xe9bd('0x20'),_0xe2436[_0xe9bd('0x17')],_0x43ea90);_0x3c211a(_0x1ae889[_0xe9bd('0x16')](0x1f4,_0xe2436['message']));});});};
\ No newline at end of file
+var _0x4c4e=['localhost','socket.io-emitter','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','debug','stringify','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x558bf8,_0x37ff22){var _0x961fce=function(_0x26400b){while(--_0x26400b){_0x558bf8['push'](_0x558bf8['shift']());}};_0x961fce(++_0x37ff22);}(_0x4c4e,0x152));var _0xe4c4=function(_0x36c042,_0x10cc58){_0x36c042=_0x36c042-0x0;var _0x97015d=_0x4c4e[_0x36c042];return _0x97015d;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});config[_0xe4c4('0xa')]=_[_0xe4c4('0xb')](config[_0xe4c4('0xa')],{'host':_0xe4c4('0xc'),'port':0x18eb});var socket=require(_0xe4c4('0xd'))(new Redis(config[_0xe4c4('0xa')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x31f879,_0x6f2545,_0x27ad42){return new BPromise(function(_0x1bc786,_0x333c08){return client[_0xe4c4('0xe')](_0x31f879,_0x27ad42)['then'](function(_0x303d89){logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));logger['debug'](_0xe4c4('0x12'),_0x6f2545,_0xe4c4('0x11'),JSON['stringify'](_0x303d89));if(_0x303d89[_0xe4c4('0x13')]){if(_0x303d89[_0xe4c4('0x13')]['code']===0x1f4){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89['error'][_0xe4c4('0x14')]);return _0x333c08(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);return _0x1bc786(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}else{logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));_0x1bc786(_0x303d89[_0xe4c4('0x15')][_0xe4c4('0x14')]);}})[_0xe4c4('0x16')](function(_0x5a32b5){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x5a32b5);_0x333c08(_0x5a32b5);});});}exports[_0xe4c4('0x17')]=function(_0x317cc8){var _0x5da165=this;return new Promise(function(_0x3d5856,_0x1cad5d){return db[_0xe4c4('0x18')][_0xe4c4('0x19')](_0x317cc8[_0xe4c4('0x1a')],{'raw':_0x317cc8[_0xe4c4('0x1b')]?_0x317cc8[_0xe4c4('0x1b')][_0xe4c4('0x1c')]===undefined?!![]:![]:!![]})[_0xe4c4('0x1d')](function(_0x1a7690){logger[_0xe4c4('0xf')](_0xe4c4('0x17'),_0x317cc8);logger[_0xe4c4('0x1e')](_0xe4c4('0x17'),_0x317cc8,JSON[_0xe4c4('0x1f')](_0x1a7690));_0x3d5856(_0x1a7690);})['catch'](function(_0x49cadc){logger[_0xe4c4('0x13')]('CreateFaxMessage',_0x49cadc[_0xe4c4('0x14')],_0x317cc8);_0x1cad5d(_0x5da165['error'](0x1f4,_0x49cadc[_0xe4c4('0x14')]));});});};exports['UpdateFaxMessage']=function(_0x34d667){var _0x583393=this;return new Promise(function(_0xba53ef,_0x4a0199){return db['FaxMessage']['update'](_0x34d667['body'],{'raw':_0x34d667[_0xe4c4('0x1b')]?_0x34d667['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d667[_0xe4c4('0x1b')]?_0x34d667[_0xe4c4('0x1b')]['where']||null:null,'attributes':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x20')]||null:null,'limit':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x21')]||null:null})[_0xe4c4('0x1d')](function(_0x48060e){logger['info'](_0xe4c4('0x22'),_0x34d667);logger[_0xe4c4('0x1e')](_0xe4c4('0x22'),_0x34d667,JSON[_0xe4c4('0x1f')](_0x48060e));_0xba53ef(_0x48060e);})['catch'](function(_0x49c913){logger[_0xe4c4('0x13')](_0xe4c4('0x22'),_0x49c913['message'],_0x34d667);_0x4a0199(_0x583393[_0xe4c4('0x13')](0x1f4,_0x49c913[_0xe4c4('0x14')]));});});};
\ No newline at end of file
index 016b0be..348cdd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5c9=['faxMessage:','save','remove','update','emit','removeListener','register','length'];(function(_0x591294,_0x266a3b){var _0x185708=function(_0x434e9b){while(--_0x434e9b){_0x591294['push'](_0x591294['shift']());}};_0x185708(++_0x266a3b);}(_0xc5c9,0x1b9));var _0x9c5c=function(_0x438878,_0x24a6c5){_0x438878=_0x438878-0x0;var _0x4012d1=_0xc5c9[_0x438878];return _0x4012d1;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x9c5c('0x0'),_0x9c5c('0x1'),_0x9c5c('0x2')];function createListener(_0x2eaffe,_0x1624ad){return function(_0xaff9c6){_0x1624ad[_0x9c5c('0x3')](_0x2eaffe,_0xaff9c6);};}function removeListener(_0x2646b5,_0x4da52e){return function(){FaxMessageEvents[_0x9c5c('0x4')](_0x2646b5,_0x4da52e);};}exports[_0x9c5c('0x5')]=function(_0x3f1b89){for(var _0x2a599f=0x0,_0x1f4ac0=events[_0x9c5c('0x6')];_0x2a599f<_0x1f4ac0;_0x2a599f++){var _0x56e903=events[_0x2a599f];var _0x3180ab=createListener(_0x9c5c('0x7')+_0x56e903,_0x3f1b89);FaxMessageEvents['on'](_0x56e903,_0x3180ab);}};
\ No newline at end of file
+var _0x9dc9=['length','./faxMessage.events','save','update','removeListener','register'];(function(_0xdfcfd1,_0x1ec03b){var _0x4e8035=function(_0x18d1c9){while(--_0x18d1c9){_0xdfcfd1['push'](_0xdfcfd1['shift']());}};_0x4e8035(++_0x1ec03b);}(_0x9dc9,0x1db));var _0x99dc=function(_0x4933eb,_0x18dcda){_0x4933eb=_0x4933eb-0x0;var _0x49ab12=_0x9dc9[_0x4933eb];return _0x49ab12;};'use strict';var FaxMessageEvents=require(_0x99dc('0x0'));var events=[_0x99dc('0x1'),'remove',_0x99dc('0x2')];function createListener(_0x188ef4,_0x306617){return function(_0xd6e8e4){_0x306617['emit'](_0x188ef4,_0xd6e8e4);};}function removeListener(_0x369b84,_0x4da0e3){return function(){FaxMessageEvents[_0x99dc('0x3')](_0x369b84,_0x4da0e3);};}exports[_0x99dc('0x4')]=function(_0xc50e4){for(var _0x54a510=0x0,_0x3a126b=events[_0x99dc('0x5')];_0x54a510<_0x3a126b;_0x54a510++){var _0x56ce88=events[_0x54a510];var _0x157a0d=createListener('faxMessage:'+_0x56ce88,_0xc50e4);FaxMessageEvents['on'](_0x56ce88,_0x157a0d);}};
\ No newline at end of file
index d9a60d5..4c7bc70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe205=['../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','tracked','fax','faxmessage:create','create','put','update','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x570b34,_0x537c5c){var _0x325f61=function(_0x3dfca6){while(--_0x3dfca6){_0x570b34['push'](_0x570b34['shift']());}};_0x325f61(++_0x537c5c);}(_0xe205,0xa7));var _0x5e20=function(_0x3ce433,_0x328120){_0x3ce433=_0x3ce433-0x0;var _0x474612=_0xe205[_0x3ce433];return _0x474612;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var fs_extra=require(_0x5e20('0x6'));var auth=require(_0x5e20('0x7'));var interaction=require(_0x5e20('0x8'));var config=require('../../config/environment');var controller=require(_0x5e20('0x9'));router[_0x5e20('0xa')]('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0xc')]);router['get']('/describe',auth[_0x5e20('0xb')](),controller['describe']);router['get'](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['show']);router[_0x5e20('0xa')](_0x5e20('0xe'),auth[_0x5e20('0xb')](),controller[_0x5e20('0xf')]);router['post']('/',auth[_0x5e20('0xb')](),interaction[_0x5e20('0x10')](_0x5e20('0x11'),_0x5e20('0x12')),controller[_0x5e20('0x13')]);router[_0x5e20('0x14')]('/:id',auth[_0x5e20('0xb')](),controller[_0x5e20('0x15')]);router[_0x5e20('0x14')]('/:id/accept',auth[_0x5e20('0xb')](),controller['accept']);router[_0x5e20('0x14')]('/:id/reject',auth[_0x5e20('0xb')](),controller[_0x5e20('0x16')]);router[_0x5e20('0x17')](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['destroy']);module[_0x5e20('0x18')]=router;
\ No newline at end of file
+var _0xb821=['path','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','reject','exports','util'];(function(_0x514e03,_0x57a3ff){var _0x5eea66=function(_0xe65f6e){while(--_0xe65f6e){_0x514e03['push'](_0x514e03['shift']());}};_0x5eea66(++_0x57a3ff);}(_0xb821,0xa7));var _0x1b82=function(_0x347762,_0x22734e){_0x347762=_0x347762-0x0;var _0x2c1069=_0xb821[_0x347762];return _0x2c1069;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x6')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xc')]);router['get'](_0x1b82('0xd'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0xf')]('/',auth[_0x1b82('0x9')](),interaction[_0x1b82('0x10')](_0x1b82('0x11'),_0x1b82('0x12')),controller['create']);router[_0x1b82('0x13')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0x14')]);router['put'](_0x1b82('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0x1b82('0x13')]('/:id/reject',auth[_0x1b82('0x9')](),controller[_0x1b82('0x16')]);router['delete'](_0x1b82('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1b82('0x17')]=router;
\ No newline at end of file
index a2b020e..f3eb822 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a01=['roundrobin','INTEGER','name','ENUM','beepall'];(function(_0x3866b8,_0x4ac3f){var _0xd5f235=function(_0x4f2269){while(--_0x4f2269){_0x3866b8['push'](_0x3866b8['shift']());}};_0xd5f235(++_0x4ac3f);}(_0x0a01,0x10b));var _0x10a0=function(_0x4d06b8,_0x3f69f1){_0x4d06b8=_0x4d06b8-0x0;var _0x4701ac=_0x0a01[_0x4d06b8];return _0x4701ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x10a0('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x10a0('0x1')]('rrmemory',_0x10a0('0x2'),_0x10a0('0x3')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x10a0('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xeb93=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x330951,_0x871acd){var _0x1d4555=function(_0x3adb9e){while(--_0x3adb9e){_0x330951['push'](_0x330951['shift']());}};_0x1d4555(++_0x871acd);}(_0xeb93,0x18d));var _0x3eb9=function(_0x24bd83,_0x1830c4){_0x24bd83=_0x24bd83-0x0;var _0x3a047e=_0xeb93[_0x24bd83];return _0x3a047e;};'use strict';var Sequelize=require(_0x3eb9('0x0'));module[_0x3eb9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3eb9('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3eb9('0x3')]},'timeout':{'type':Sequelize[_0x3eb9('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3eb9('0x5'),_0x3eb9('0x6'),_0x3eb9('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3eb9('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index c880ece..1994fb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x092d=['attributes','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','FaxQueue','includeAll','include','findAll','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','faxPause','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','Team','hasOwnProperty','User','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x092d,0xe0));var _0xd092=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0x092d[_0x198446];return _0x38d7b7;};'use strict';var emlformat=require(_0xd092('0x0'));var rimraf=require(_0xd092('0x1'));var zipdir=require(_0xd092('0x2'));var jsonpatch=require(_0xd092('0x3'));var rp=require(_0xd092('0x4'));var moment=require('moment');var BPromise=require(_0xd092('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd092('0x6'));var sox=require('sox');var csv=require(_0xd092('0x7'));var ejs=require(_0xd092('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd092('0x9'));var crypto=require(_0xd092('0xa'));var jsforce=require(_0xd092('0xb'));var deskjs=require(_0xd092('0xc'));var toCsv=require(_0xd092('0x7'));var querystring=require(_0xd092('0xd'));var Papa=require(_0xd092('0xe'));var Redis=require(_0xd092('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd092('0x10'));var as=require(_0xd092('0x11'));var hardwareService=require(_0xd092('0x12'));var logger=require(_0xd092('0x13'))(_0xd092('0x14'));var utils=require(_0xd092('0x15'));var config=require(_0xd092('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd092('0x17'))['db'];config[_0xd092('0x18')]=_[_0xd092('0x19')](config[_0xd092('0x18')],{'host':_0xd092('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd092('0x18')]));require(_0xd092('0x1b'))[_0xd092('0x1c')](socket);function respondWithStatusCode(_0x562ced,_0x499f2e){_0x499f2e=_0x499f2e||0xcc;return function(_0x1bd5c8){if(_0x1bd5c8){return _0x562ced[_0xd092('0x1d')](_0x499f2e);}return _0x562ced['status'](_0x499f2e)[_0xd092('0x1e')]();};}function respondWithResult(_0xfcd044,_0x291240){_0x291240=_0x291240||0xc8;return function(_0x43bf1c){if(_0x43bf1c){return _0xfcd044[_0xd092('0x1f')](_0x291240)[_0xd092('0x20')](_0x43bf1c);}};}function respondWithFilteredResult(_0x16be2b,_0x3aa8fc){return function(_0x4c65b8){if(_0x4c65b8){var _0x5a284e=typeof _0x3aa8fc[_0xd092('0x21')]===_0xd092('0x22')&&typeof _0x3aa8fc[_0xd092('0x23')]===_0xd092('0x22');var _0x46f5ee=_0x4c65b8[_0xd092('0x24')];var _0x44d9d4=_0x5a284e?0x0:_0x3aa8fc[_0xd092('0x21')];var _0x56148a=_0x5a284e?_0x4c65b8['count']:_0x3aa8fc['offset']+_0x3aa8fc[_0xd092('0x23')];var _0x1e8928;if(_0x56148a>=_0x46f5ee){_0x56148a=_0x46f5ee;_0x1e8928=0xc8;}else{_0x1e8928=0xce;}_0x16be2b[_0xd092('0x1f')](_0x1e8928);return _0x16be2b[_0xd092('0x25')](_0xd092('0x26'),_0x44d9d4+'-'+_0x56148a+'/'+_0x46f5ee)[_0xd092('0x20')](_0x4c65b8);}return null;};}function patchUpdates(_0x5102ff){return function(_0x123b7a){try{jsonpatch[_0xd092('0x27')](_0x123b7a,_0x5102ff,!![]);}catch(_0x3abe27){return BPromise[_0xd092('0x28')](_0x3abe27);}return _0x123b7a[_0xd092('0x29')]();};}function saveUpdates(_0x3731ac,_0x4a6eed){return function(_0xe84d6b){if(_0xe84d6b){return _0xe84d6b[_0xd092('0x2a')](_0x3731ac)['then'](function(_0x4b0ca5){return _0x4b0ca5;});}return null;};}function removeEntity(_0x23b725,_0xc37103){return function(_0x526938){if(_0x526938){return _0x526938[_0xd092('0x2b')]()[_0xd092('0x2c')](function(){var _0x40df05=_0x526938[_0xd092('0x2d')]({'plain':!![]});var _0x28d7d4=_0xd092('0x2e');return db[_0xd092('0x2f')][_0xd092('0x2b')]({'where':{'type':_0x28d7d4,'resourceId':_0x40df05['id']}})[_0xd092('0x2c')](function(){return _0x526938;});})[_0xd092('0x2c')](function(){_0x23b725[_0xd092('0x1f')](0xcc)[_0xd092('0x1e')]();});}};}function handleEntityNotFound(_0x209045,_0x4802c0){return function(_0x252139){if(!_0x252139){_0x209045[_0xd092('0x1d')](0x194);}return _0x252139;};}function handleError(_0x5f4d48,_0xa1b077){_0xa1b077=_0xa1b077||0x1f4;return function(_0x5487b7){logger[_0xd092('0x30')](_0x5487b7[_0xd092('0x31')]);if(_0x5487b7[_0xd092('0x32')]){delete _0x5487b7[_0xd092('0x32')];}_0x5f4d48[_0xd092('0x1f')](_0xa1b077)[_0xd092('0x33')](_0x5487b7);};}exports['index']=function(_0x3d92d9,_0x2419d3){var _0x3d8d2e={},_0x592d89={},_0x5c0430={'count':0x0,'rows':[]};var _0x22d7d3=_['map'](db['FaxQueue'][_0xd092('0x34')],function(_0x3d12e4){return{'name':_0x3d12e4[_0xd092('0x35')],'type':_0x3d12e4['type'][_0xd092('0x36')]};});_0x592d89[_0xd092('0x37')]=_[_0xd092('0x38')](_0x22d7d3,_0xd092('0x32'));_0x592d89[_0xd092('0x39')]=_[_0xd092('0x3a')](_0x3d92d9[_0xd092('0x39')]);_0x592d89[_0xd092('0x3b')]=_[_0xd092('0x3c')](_0x592d89[_0xd092('0x37')],_0x592d89['query']);_0x3d8d2e['attributes']=_[_0xd092('0x3c')](_0x592d89[_0xd092('0x37')],qs[_0xd092('0x3d')](_0x3d92d9[_0xd092('0x39')][_0xd092('0x3d')]));_0x3d8d2e[_0xd092('0x3e')]=_0x3d8d2e['attributes']['length']?_0x3d8d2e[_0xd092('0x3e')]:_0x592d89[_0xd092('0x37')];if(!_0x3d92d9[_0xd092('0x39')]['hasOwnProperty'](_0xd092('0x3f'))){_0x3d8d2e['limit']=qs['limit'](_0x3d92d9[_0xd092('0x39')]['limit']);_0x3d8d2e[_0xd092('0x21')]=qs[_0xd092('0x21')](_0x3d92d9['query'][_0xd092('0x21')]);}_0x3d8d2e[_0xd092('0x40')]=qs['sort'](_0x3d92d9['query'][_0xd092('0x41')]);_0x3d8d2e['where']=qs['filters'](_[_0xd092('0x42')](_0x3d92d9[_0xd092('0x39')],_0x592d89['filters']),_0x22d7d3);if(_0x3d92d9[_0xd092('0x39')][_0xd092('0x43')]){_0x3d8d2e[_0xd092('0x44')]=_[_0xd092('0x45')](_0x3d8d2e[_0xd092('0x44')],{'$or':_[_0xd092('0x38')](_0x22d7d3,function(_0x44b247){if(_0x44b247[_0xd092('0x46')]!==_0xd092('0x47')){var _0x47d313={};_0x47d313[_0x44b247[_0xd092('0x32')]]={'$like':'%'+_0x3d92d9['query'][_0xd092('0x43')]+'%'};return _0x47d313;}})});}_0x3d8d2e=_[_0xd092('0x45')]({},_0x3d8d2e,_0x3d92d9['options']);var _0x254e82={'where':_0x3d8d2e['where']};return db[_0xd092('0x48')][_0xd092('0x24')](_0x254e82)['then'](function(_0x4c17c3){_0x5c0430[_0xd092('0x24')]=_0x4c17c3;if(_0x3d92d9[_0xd092('0x39')][_0xd092('0x49')]){_0x3d8d2e[_0xd092('0x4a')]=[{'all':!![]}];}return db[_0xd092('0x48')][_0xd092('0x4b')](_0x3d8d2e);})[_0xd092('0x2c')](function(_0x41bc7a){_0x5c0430['rows']=_0x41bc7a;return _0x5c0430;})['then'](respondWithFilteredResult(_0x2419d3,_0x3d8d2e))[_0xd092('0x4c')](handleError(_0x2419d3,null));};exports[_0xd092('0x4d')]=function(_0x2a194b,_0x4e81eb){var _0x31b8f5={'raw':!![],'where':{'id':_0x2a194b[_0xd092('0x4e')]['id']}},_0x4b3086={};_0x4b3086['model']=_['keys'](db[_0xd092('0x48')][_0xd092('0x34')]);_0x4b3086[_0xd092('0x39')]=_[_0xd092('0x3a')](_0x2a194b[_0xd092('0x39')]);_0x4b3086[_0xd092('0x3b')]=_[_0xd092('0x3c')](_0x4b3086[_0xd092('0x37')],_0x4b3086[_0xd092('0x39')]);_0x31b8f5['attributes']=_[_0xd092('0x3c')](_0x4b3086[_0xd092('0x37')],qs[_0xd092('0x3d')](_0x2a194b[_0xd092('0x39')][_0xd092('0x3d')]));_0x31b8f5[_0xd092('0x3e')]=_0x31b8f5[_0xd092('0x3e')][_0xd092('0x4f')]?_0x31b8f5[_0xd092('0x3e')]:_0x4b3086[_0xd092('0x37')];if(_0x2a194b['query']['includeAll']){_0x31b8f5[_0xd092('0x4a')]=[{'all':!![]}];}_0x31b8f5=_['merge']({},_0x31b8f5,_0x2a194b[_0xd092('0x50')]);return db[_0xd092('0x48')][_0xd092('0x51')](_0x31b8f5)[_0xd092('0x2c')](handleEntityNotFound(_0x4e81eb,null))[_0xd092('0x2c')](respondWithResult(_0x4e81eb,null))[_0xd092('0x4c')](handleError(_0x4e81eb,null));};exports[_0xd092('0x52')]=function(_0x557d47,_0x3689a3){return db[_0xd092('0x48')][_0xd092('0x52')](_0x557d47['body'],{})[_0xd092('0x2c')](function(_0x3c4b60){var _0x36b64e=_0x557d47[_0xd092('0x53')]['get']({'plain':!![]});if(!_0x36b64e)throw new Error(_0xd092('0x54'));if(_0x36b64e['role']===_0xd092('0x53')){var _0x41fea0=_0x3c4b60['get']({'plain':!![]});var _0x2d3766='FaxQueues';return db['UserProfileSection'][_0xd092('0x51')]({'where':{'name':_0x2d3766,'userProfileId':_0x36b64e[_0xd092('0x55')]},'raw':!![]})[_0xd092('0x2c')](function(_0x2c6cd2){if(_0x2c6cd2&&_0x2c6cd2['autoAssociation']===0x0){return db['UserProfileResource'][_0xd092('0x52')]({'name':_0x41fea0[_0xd092('0x32')],'resourceId':_0x41fea0['id'],'type':_0x2c6cd2['name'],'sectionId':_0x2c6cd2['id']},{})[_0xd092('0x2c')](function(){return _0x3c4b60;});}else{return _0x3c4b60;}})[_0xd092('0x4c')](function(_0x3d07d9){logger[_0xd092('0x30')](_0xd092('0x56'),_0x3d07d9);throw _0x3d07d9;});}return _0x3c4b60;})['then'](respondWithResult(_0x3689a3,0xc9))[_0xd092('0x4c')](handleError(_0x3689a3,null));};exports[_0xd092('0x2a')]=function(_0x1e357f,_0x4c4c56){if(_0x1e357f[_0xd092('0x57')]['id']){delete _0x1e357f[_0xd092('0x57')]['id'];}return db[_0xd092('0x48')]['find']({'where':{'id':_0x1e357f[_0xd092('0x4e')]['id']}})[_0xd092('0x2c')](handleEntityNotFound(_0x4c4c56,null))[_0xd092('0x2c')](saveUpdates(_0x1e357f['body'],null))[_0xd092('0x2c')](respondWithResult(_0x4c4c56,null))[_0xd092('0x4c')](handleError(_0x4c4c56,null));};exports[_0xd092('0x2b')]=function(_0x35cbb3,_0x1d905b){return db[_0xd092('0x48')][_0xd092('0x51')]({'where':{'id':_0x35cbb3[_0xd092('0x4e')]['id']}})[_0xd092('0x2c')](handleEntityNotFound(_0x1d905b,null))[_0xd092('0x2c')](removeEntity(_0x1d905b,null))[_0xd092('0x4c')](handleError(_0x1d905b,null));};exports['describe']=function(_0x22f481,_0xedf71e){return db[_0xd092('0x48')][_0xd092('0x58')]()[_0xd092('0x2c')](respondWithResult(_0xedf71e,null))[_0xd092('0x4c')](handleError(_0xedf71e,null));};exports['getMembers']=function(_0x3a92d8,_0x992a81,_0x4c7345){var _0x46b228={'raw':!![],'where':{}},_0x27cfbb={},_0x324cf7;return db[_0xd092('0x48')][_0xd092('0x59')]({'where':{'id':_0x3a92d8[_0xd092('0x4e')]['id']}})[_0xd092('0x2c')](handleEntityNotFound(_0x992a81,null))[_0xd092('0x2c')](function(_0x43a1ca){if(_0x43a1ca){_0x324cf7=_0x43a1ca[_0xd092('0x2d')]({'plain':!![]});_0x27cfbb[_0xd092('0x37')]=_[_0xd092('0x3a')](db[_0xd092('0x5a')][_0xd092('0x34')]);_0x27cfbb[_0xd092('0x39')]=_[_0xd092('0x3a')](_0x3a92d8[_0xd092('0x39')]);_0x27cfbb[_0xd092('0x3b')]=_[_0xd092('0x3c')](_0x27cfbb['model'],_0x27cfbb[_0xd092('0x39')]);_0x46b228[_0xd092('0x3e')]=_[_0xd092('0x3c')](_0x27cfbb[_0xd092('0x37')],qs['fields'](_0x3a92d8[_0xd092('0x39')]['fields']));_0x46b228['attributes']=_0x46b228[_0xd092('0x3e')][_0xd092('0x4f')]?_0x46b228['attributes']:_0x27cfbb[_0xd092('0x37')];if(!_0x3a92d8[_0xd092('0x39')]['hasOwnProperty']('nolimit')){_0x46b228[_0xd092('0x23')]=qs[_0xd092('0x23')](_0x3a92d8[_0xd092('0x39')][_0xd092('0x23')]);_0x46b228['offset']=qs[_0xd092('0x21')](_0x3a92d8['query'][_0xd092('0x21')]);}_0x46b228['order']=qs[_0xd092('0x41')](_0x3a92d8['query'][_0xd092('0x41')]);_0x46b228['where']=qs[_0xd092('0x3b')](_['pick'](_0x3a92d8[_0xd092('0x39')],_0x27cfbb['filters']));_0x46b228[_0xd092('0x44')][_0xd092('0x5b')]=_0x43a1ca['id'];if(_0x3a92d8[_0xd092('0x39')][_0xd092('0x43')]){_0x46b228[_0xd092('0x44')]=_['merge'](_0x46b228[_0xd092('0x44')],{'$or':_[_0xd092('0x38')](_0x46b228[_0xd092('0x3e')],function(_0x2472cd){var _0x316090={};_0x316090[_0x2472cd]={'$like':'%'+_0x3a92d8[_0xd092('0x39')]['filter']+'%'};return _0x316090;})});}_0x46b228=_[_0xd092('0x45')]({},_0x46b228,_0x3a92d8[_0xd092('0x50')]);return db['UserFaxQueue'][_0xd092('0x4b')](_0x46b228);}})[_0xd092('0x2c')](function(_0x174b5e){if(_0x174b5e){return db['User'][_0xd092('0x5c')]({'where':{'id':_['map'](_0x174b5e,_0xd092('0x5d')),'role':'agent'},'attributes':['id',_0xd092('0x32'),_0xd092('0x5e'),'updatedAt',_0xd092('0x5f')]});}})[_0xd092('0x2c')](function(_0x2ff391){if(_0x2ff391){return{'count':_0x2ff391['count'],'rows':_[_0xd092('0x38')](_0x2ff391[_0xd092('0x60')],function(_0x471582){return{'membername':_0x471582[_0xd092('0x32')],'UserId':_0x471582['id'],'queue_name':_0x324cf7[_0xd092('0x32')],'FaxQueueId':_0x324cf7['id'],'interface':util[_0xd092('0x61')](_0xd092('0x62'),_0xd092('0x63'),_0x471582[_0xd092('0x32')]),'penalty':0x0,'paused':_0x471582['faxPause'],'createdAt':_0x471582[_0xd092('0x5f')],'updatedAt':_0x471582[_0xd092('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x992a81,_0x46b228))['catch'](handleError(_0x992a81,null));};exports[_0xd092('0x65')]=function(_0x5ef39b,_0x11d44e,_0xa7b77d){var _0x1949d8={};var _0x4f381f={};var _0x2ed2c7;var _0x334905;return db[_0xd092('0x48')][_0xd092('0x59')]({'where':{'id':_0x5ef39b[_0xd092('0x4e')]['id']}})[_0xd092('0x2c')](handleEntityNotFound(_0x11d44e,null))['then'](function(_0xfcc34){if(_0xfcc34){_0x2ed2c7=_0xfcc34;_0x4f381f[_0xd092('0x37')]=_[_0xd092('0x3a')](db[_0xd092('0x66')]['rawAttributes']);_0x4f381f[_0xd092('0x39')]=_['keys'](_0x5ef39b[_0xd092('0x39')]);_0x4f381f[_0xd092('0x3b')]=_['intersection'](_0x4f381f[_0xd092('0x37')],_0x4f381f['query']);_0x1949d8[_0xd092('0x3e')]=_['intersection'](_0x4f381f[_0xd092('0x37')],qs[_0xd092('0x3d')](_0x5ef39b['query'][_0xd092('0x3d')]));_0x1949d8[_0xd092('0x3e')]=_0x1949d8[_0xd092('0x3e')][_0xd092('0x4f')]?_0x1949d8[_0xd092('0x3e')]:_0x4f381f[_0xd092('0x37')];_0x1949d8[_0xd092('0x40')]=qs[_0xd092('0x41')](_0x5ef39b[_0xd092('0x39')][_0xd092('0x41')]);_0x1949d8[_0xd092('0x44')]=qs['filters'](_[_0xd092('0x42')](_0x5ef39b['query'],_0x4f381f[_0xd092('0x3b')]));if(_0x5ef39b[_0xd092('0x39')][_0xd092('0x43')]){_0x1949d8[_0xd092('0x44')]=_[_0xd092('0x45')](_0x1949d8['where'],{'$or':_[_0xd092('0x38')](_0x1949d8[_0xd092('0x3e')],function(_0x3c3052){var _0x26aa3f={};_0x26aa3f[_0x3c3052]={'$like':'%'+_0x5ef39b[_0xd092('0x39')][_0xd092('0x43')]+'%'};return _0x26aa3f;})});}_0x1949d8=_['merge']({},_0x1949d8,_0x5ef39b[_0xd092('0x50')]);return _0x2ed2c7['getTeams'](_0x1949d8);}})[_0xd092('0x2c')](function(_0x44b39e){if(_0x44b39e){_0x334905=_0x44b39e[_0xd092('0x4f')];if(!_0x5ef39b['query'][_0xd092('0x67')]('nolimit')){_0x1949d8[_0xd092('0x23')]=qs['limit'](_0x5ef39b[_0xd092('0x39')]['limit']);_0x1949d8[_0xd092('0x21')]=qs[_0xd092('0x21')](_0x5ef39b[_0xd092('0x39')]['offset']);}return _0x2ed2c7[_0xd092('0x65')](_0x1949d8);}})['then'](function(_0x3a2748){if(_0x3a2748){return _0x3a2748?{'count':_0x334905,'rows':_0x3a2748}:null;}})[_0xd092('0x2c')](respondWithResult(_0x11d44e,null))[_0xd092('0x4c')](handleError(_0x11d44e,null));};exports['addTeams']=function(_0x32c305,_0x41baae,_0x3b682b){var _0x14d1c7=_0x32c305['body']['ids'];return db['Team'][_0xd092('0x4b')]({'where':{'id':_0x14d1c7},'attributes':['id'],'include':[{'model':db[_0xd092('0x68')],'as':_0xd092('0x69'),'attributes':['id',_0xd092('0x32'),_0xd092('0x6a'),_0xd092('0x6b'),_0xd092('0x6c')],'raw':!![]}]})[_0xd092('0x2c')](function(_0x1c928d){if(_0x1c928d){var _0x13e57d=_[_0xd092('0x6d')](_0x1c928d,function(_0x59dacd){var _0x23b8e5=_0x59dacd[_0xd092('0x2d')]({'plain':!![]});return _0x23b8e5[_0xd092('0x69')];});return db[_0xd092('0x48')][_0xd092('0x51')]({'where':{'id':_0x32c305['params']['id']}})[_0xd092('0x2c')](function(_0x5e5fdc){return db['sequelize'][_0xd092('0x6e')](function(_0x5ae165){return _0x5e5fdc[_0xd092('0x6f')](_0x14d1c7,{'transaction':_0x5ae165})[_0xd092('0x2c')](function(){return BPromise[_0xd092('0x70')](_0x13e57d,function(_0x53eea5){return db[_0xd092('0x5a')]['findOrCreate']({'where':{'UserId':_0x53eea5['id'],'FaxQueueId':_0x32c305[_0xd092('0x4e')]['id']},'transaction':_0x5ae165});});})['then'](function(){_0x13e57d[_0xd092('0x71')](function(_0x18cddb){socket[_0xd092('0x72')]('userFaxQueue:save',{'UserId':_0x18cddb['id'],'FaxQueueId':_0x5e5fdc['id']});});});});});}})[_0xd092('0x2c')](respondWithStatusCode(_0x41baae,null))[_0xd092('0x4c')](handleError(_0x41baae,null));};exports[_0xd092('0x73')]=function(_0x1c1990,_0x311fe4,_0x2bd427){return db[_0xd092('0x66')][_0xd092('0x4b')]({'where':{'id':_0x1c1990[_0xd092('0x39')][_0xd092('0x74')]},'attributes':['id'],'include':[{'model':db[_0xd092('0x68')],'as':_0xd092('0x69'),'attributes':['id'],'raw':!![]}]})[_0xd092('0x2c')](handleEntityNotFound(_0x311fe4,null))[_0xd092('0x2c')](function(_0xd0c0fc){var _0x15f2e9=_[_0xd092('0x38')](_0xd0c0fc,'id');var _0x410ce9=[];var _0x406a59=[];var _0x570cb0=squel[_0xd092('0x75')]();_0x570cb0[_0xd092('0x76')](_0xd092('0x77'))[_0xd092('0x78')](_0xd092('0x79'),'tq')[_0xd092('0x7a')]('user_has_teams','ut',_0xd092('0x7b'))[_0xd092('0x44')](_0xd092('0x7c'),_0x1c1990[_0xd092('0x4e')]['id']);for(var _0x1bab2a=0x0;_0x1bab2a<_0xd0c0fc['length'];_0x1bab2a+=0x1){let _0x24396c=_0xd0c0fc[_0x1bab2a];for(var _0x2f6daa=0x0;_0x2f6daa<_0x24396c[_0xd092('0x69')]['length'];_0x2f6daa+=0x1){let _0x5df0e2=_0x24396c[_0xd092('0x69')][_0x2f6daa];var _0x4ee3dc=_0x570cb0[_0xd092('0x7d')]();_0x4ee3dc[_0xd092('0x44')]('ut.UserId\x20=\x20?',_0x5df0e2['id']);_0x406a59['push'](db[_0xd092('0x7e')][_0xd092('0x39')](_0x4ee3dc[_0xd092('0x7f')](),{'type':db[_0xd092('0x7e')][_0xd092('0x80')]['SELECT']})[_0xd092('0x2c')](function(_0x2ba48f){if(_0x2ba48f[_0xd092('0x4f')]===0x1){return _0x5df0e2['id'];}else{var _0x3f8ae4=_[_0xd092('0x81')](_[_0xd092('0x38')](_0x2ba48f,_0xd092('0x82')),function(_0x5c1fe8){return _[_0xd092('0x83')](_0x15f2e9,_0x5c1fe8);});if(_0x3f8ae4){return _0x5df0e2['id'];}}}));}}return BPromise[_0xd092('0x84')](_0x406a59)['then'](function(_0x495499){_0x410ce9=_(_0x410ce9)[_0xd092('0x85')](_0x495499)[_0xd092('0x86')]()[_0xd092('0x87')]();return db[_0xd092('0x48')]['find']({'where':{'id':_0x1c1990[_0xd092('0x4e')]['id']}})[_0xd092('0x2c')](function(_0x1b4de2){return db[_0xd092('0x7e')][_0xd092('0x6e')](function(_0x580d14){return _0x1b4de2[_0xd092('0x73')](_0x1c1990[_0xd092('0x39')]['ids'],{'transaction':_0x580d14})[_0xd092('0x2c')](function(){if(!_['isEmpty'](_0x410ce9)){return _0x1b4de2[_0xd092('0x88')](_0x410ce9,{'transaction':_0x580d14});}})[_0xd092('0x2c')](function(){_0x410ce9['forEach'](function(_0x361178){socket[_0xd092('0x72')](_0xd092('0x89'),{'UserId':_0x361178,'FaxQueueId':_0x1b4de2['id']});});});});});});})[_0xd092('0x2c')](respondWithStatusCode(_0x311fe4,null))[_0xd092('0x4c')](handleError(_0x311fe4,null));};exports['addAgents']=function(_0x23647c,_0x30d010,_0x4db281){return db[_0xd092('0x48')][_0xd092('0x51')]({'where':{'id':_0x23647c['params']['id']}})[_0xd092('0x2c')](handleEntityNotFound(_0x30d010,null))['then'](function(_0x37740b){if(_0x37740b){return _0x37740b[_0xd092('0x8a')](_0x23647c[_0xd092('0x57')][_0xd092('0x74')],_[_0xd092('0x8b')](_0x23647c[_0xd092('0x57')],['ids','id'])||{})[_0xd092('0x8c')](function(_0x514dc6){for(var _0x2ebcca=0x0;_0x2ebcca<_0x23647c['body'][_0xd092('0x74')][_0xd092('0x4f')];_0x2ebcca+=0x1){socket[_0xd092('0x72')]('userFaxQueue:save',{'UserId':Number(_0x23647c[_0xd092('0x57')][_0xd092('0x74')][_0x2ebcca]),'FaxQueueId':Number(_0x23647c[_0xd092('0x4e')]['id'])});}return _0x514dc6;});}})[_0xd092('0x2c')](respondWithResult(_0x30d010,null))[_0xd092('0x4c')](handleError(_0x30d010,null));};exports[_0xd092('0x88')]=function(_0x140332,_0x13b256,_0x25de90){return db[_0xd092('0x48')]['find']({'where':{'id':_0x140332[_0xd092('0x4e')]['id']}})[_0xd092('0x2c')](handleEntityNotFound(_0x13b256,null))['then'](function(_0x480900){if(_0x480900){return _0x480900[_0xd092('0x88')](_0x140332[_0xd092('0x39')][_0xd092('0x74')])[_0xd092('0x2c')](function(){if(_[_0xd092('0x8d')](_0x140332[_0xd092('0x39')][_0xd092('0x74')])){for(var _0x5d04e9=0x0;_0x5d04e9<_0x140332['query'][_0xd092('0x74')][_0xd092('0x4f')];_0x5d04e9+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x140332['query'][_0xd092('0x74')][_0x5d04e9]),'FaxQueueId':Number(_0x140332[_0xd092('0x4e')]['id'])});}}else{socket[_0xd092('0x72')](_0xd092('0x89'),{'UserId':Number(_0x140332['query'][_0xd092('0x74')]),'FaxQueueId':Number(_0x140332[_0xd092('0x4e')]['id'])});}});}})[_0xd092('0x2c')](respondWithStatusCode(_0x13b256,null))[_0xd092('0x4c')](handleError(_0x13b256,null));};exports[_0xd092('0x8e')]=function(_0x15bf33,_0x2b9cf5,_0x2deae7){var _0x4322e2={};var _0x2e228d={};var _0x3aa2f8;var _0x16c1b7;return db['FaxQueue'][_0xd092('0x59')]({'where':{'id':_0x15bf33[_0xd092('0x4e')]['id']}})[_0xd092('0x2c')](handleEntityNotFound(_0x2b9cf5,null))[_0xd092('0x2c')](function(_0x5b3269){if(_0x5b3269){_0x3aa2f8=_0x5b3269;_0x2e228d['model']=_[_0xd092('0x3a')](db['User'][_0xd092('0x34')]);_0x2e228d[_0xd092('0x39')]=_['keys'](_0x15bf33[_0xd092('0x39')]);_0x2e228d[_0xd092('0x3b')]=_[_0xd092('0x3c')](_0x2e228d[_0xd092('0x37')],_0x2e228d[_0xd092('0x39')]);_0x4322e2[_0xd092('0x3e')]=_[_0xd092('0x3c')](_0x2e228d[_0xd092('0x37')],qs[_0xd092('0x3d')](_0x15bf33[_0xd092('0x39')][_0xd092('0x3d')]));_0x4322e2[_0xd092('0x3e')]=_0x4322e2[_0xd092('0x3e')][_0xd092('0x4f')]?_0x4322e2['attributes']:_0x2e228d[_0xd092('0x37')];_0x4322e2['order']=qs['sort'](_0x15bf33[_0xd092('0x39')][_0xd092('0x41')]);_0x4322e2[_0xd092('0x44')]=qs[_0xd092('0x3b')](_['pick'](_0x15bf33['query'],_0x2e228d[_0xd092('0x3b')]));if(_0x15bf33[_0xd092('0x39')][_0xd092('0x43')]){_0x4322e2[_0xd092('0x44')]=_[_0xd092('0x45')](_0x4322e2[_0xd092('0x44')],{'$or':_[_0xd092('0x38')](_0x4322e2[_0xd092('0x3e')],function(_0x5f5eab){var _0x3fd835={};_0x3fd835[_0x5f5eab]={'$like':'%'+_0x15bf33[_0xd092('0x39')]['filter']+'%'};return _0x3fd835;})});}_0x4322e2=_[_0xd092('0x45')]({},_0x4322e2,_0x15bf33[_0xd092('0x50')]);return _0x3aa2f8['getAgents'](_0x4322e2);}})['then'](function(_0x2c1e53){if(_0x2c1e53){_0x16c1b7=_0x2c1e53[_0xd092('0x4f')];if(!_0x15bf33['query'][_0xd092('0x67')](_0xd092('0x3f'))){_0x4322e2['limit']=qs[_0xd092('0x23')](_0x15bf33[_0xd092('0x39')]['limit']);_0x4322e2[_0xd092('0x21')]=qs[_0xd092('0x21')](_0x15bf33[_0xd092('0x39')][_0xd092('0x21')]);}return _0x3aa2f8[_0xd092('0x8e')](_0x4322e2);}})['then'](function(_0x233dbd){if(_0x233dbd){return _0x233dbd?{'count':_0x16c1b7,'rows':_0x233dbd}:null;}})[_0xd092('0x2c')](respondWithResult(_0x2b9cf5,null))['catch'](handleError(_0x2b9cf5,null));};
\ No newline at end of file
+var _0x7cf1=['fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','sort','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','rows','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','all','compact','transaction','isEmpty','removeAgents','forEach','userFaxQueue:remove','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../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','./faxQueue.socket','register','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','get','FaxQueues','UserProfileResource','destroy','status','sendStatus','error','stack','name','send','index','map','FaxQueue','rawAttributes'];(function(_0x3c349b,_0x5207ab){var _0x3e3ec5=function(_0x17751f){while(--_0x17751f){_0x3c349b['push'](_0x3c349b['shift']());}};_0x3e3ec5(++_0x5207ab);}(_0x7cf1,0x16e));var _0x17cf=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x7cf1[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x17cf('0x0'));var rimraf=require(_0x17cf('0x1'));var zipdir=require(_0x17cf('0x2'));var jsonpatch=require(_0x17cf('0x3'));var rp=require('request-promise');var moment=require(_0x17cf('0x4'));var BPromise=require(_0x17cf('0x5'));var Mustache=require(_0x17cf('0x6'));var util=require('util');var path=require('path');var sox=require(_0x17cf('0x7'));var csv=require(_0x17cf('0x8'));var ejs=require(_0x17cf('0x9'));var fs=require('fs');var fs_extra=require(_0x17cf('0xa'));var _=require(_0x17cf('0xb'));var squel=require(_0x17cf('0xc'));var crypto=require(_0x17cf('0xd'));var jsforce=require(_0x17cf('0xe'));var deskjs=require(_0x17cf('0xf'));var toCsv=require(_0x17cf('0x8'));var querystring=require(_0x17cf('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x17cf('0x11'));var qs=require(_0x17cf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17cf('0x13'));var logger=require(_0x17cf('0x14'))(_0x17cf('0x15'));var utils=require(_0x17cf('0x16'));var config=require(_0x17cf('0x17'));var licenseUtil=require(_0x17cf('0x18'));var db=require(_0x17cf('0x19'))['db'];config['redis']=_['defaults'](config[_0x17cf('0x1a')],{'host':_0x17cf('0x1b'),'port':0x18eb});var socket=require(_0x17cf('0x1c'))(new Redis(config[_0x17cf('0x1a')]));require(_0x17cf('0x1d'))[_0x17cf('0x1e')](socket);function respondWithStatusCode(_0x165d0f,_0x5662dd){_0x5662dd=_0x5662dd||0xcc;return function(_0x26f457){if(_0x26f457){return _0x165d0f['sendStatus'](_0x5662dd);}return _0x165d0f['status'](_0x5662dd)[_0x17cf('0x1f')]();};}function respondWithResult(_0x4ec085,_0x1c1a85){_0x1c1a85=_0x1c1a85||0xc8;return function(_0x2f784a){if(_0x2f784a){return _0x4ec085['status'](_0x1c1a85)[_0x17cf('0x20')](_0x2f784a);}};}function respondWithFilteredResult(_0x54d8f8,_0x428fd3){return function(_0xcb18db){if(_0xcb18db){var _0x10e8d9=typeof _0x428fd3['offset']===_0x17cf('0x21')&&typeof _0x428fd3[_0x17cf('0x22')]===_0x17cf('0x21');var _0x5789ef=_0xcb18db[_0x17cf('0x23')];var _0x5905e1=_0x10e8d9?0x0:_0x428fd3['offset'];var _0x55890a=_0x10e8d9?_0xcb18db[_0x17cf('0x23')]:_0x428fd3[_0x17cf('0x24')]+_0x428fd3[_0x17cf('0x22')];var _0x45f34a;if(_0x55890a>=_0x5789ef){_0x55890a=_0x5789ef;_0x45f34a=0xc8;}else{_0x45f34a=0xce;}_0x54d8f8['status'](_0x45f34a);return _0x54d8f8[_0x17cf('0x25')](_0x17cf('0x26'),_0x5905e1+'-'+_0x55890a+'/'+_0x5789ef)['json'](_0xcb18db);}return null;};}function patchUpdates(_0x3b8da1){return function(_0x44632f){try{jsonpatch[_0x17cf('0x27')](_0x44632f,_0x3b8da1,!![]);}catch(_0x37d439){return BPromise['reject'](_0x37d439);}return _0x44632f[_0x17cf('0x28')]();};}function saveUpdates(_0x1e0082,_0x7e407d){return function(_0x41cb6b){if(_0x41cb6b){return _0x41cb6b[_0x17cf('0x29')](_0x1e0082)[_0x17cf('0x2a')](function(_0x38626f){return _0x38626f;});}return null;};}function removeEntity(_0xa39421,_0x3ff3fc){return function(_0x76027c){if(_0x76027c){return _0x76027c['destroy']()[_0x17cf('0x2a')](function(){var _0x257c56=_0x76027c[_0x17cf('0x2b')]({'plain':!![]});var _0x19a44f=_0x17cf('0x2c');return db[_0x17cf('0x2d')][_0x17cf('0x2e')]({'where':{'type':_0x19a44f,'resourceId':_0x257c56['id']}})['then'](function(){return _0x76027c;});})[_0x17cf('0x2a')](function(){_0xa39421[_0x17cf('0x2f')](0xcc)[_0x17cf('0x1f')]();});}};}function handleEntityNotFound(_0x146d58,_0xac27a1){return function(_0x36d12a){if(!_0x36d12a){_0x146d58[_0x17cf('0x30')](0x194);}return _0x36d12a;};}function handleError(_0x513606,_0x26d04b){_0x26d04b=_0x26d04b||0x1f4;return function(_0x5047d3){logger[_0x17cf('0x31')](_0x5047d3[_0x17cf('0x32')]);if(_0x5047d3[_0x17cf('0x33')]){delete _0x5047d3[_0x17cf('0x33')];}_0x513606['status'](_0x26d04b)[_0x17cf('0x34')](_0x5047d3);};}exports[_0x17cf('0x35')]=function(_0x35eef3,_0x236b08){var _0x570b93={},_0x4a7aed={},_0x3c24e5={'count':0x0,'rows':[]};var _0x47c2dd=_[_0x17cf('0x36')](db[_0x17cf('0x37')][_0x17cf('0x38')],function(_0x2e6ef6){return{'name':_0x2e6ef6[_0x17cf('0x39')],'type':_0x2e6ef6[_0x17cf('0x3a')][_0x17cf('0x3b')]};});_0x4a7aed[_0x17cf('0x3c')]=_['map'](_0x47c2dd,'name');_0x4a7aed['query']=_[_0x17cf('0x3d')](_0x35eef3[_0x17cf('0x3e')]);_0x4a7aed[_0x17cf('0x3f')]=_[_0x17cf('0x40')](_0x4a7aed[_0x17cf('0x3c')],_0x4a7aed['query']);_0x570b93[_0x17cf('0x41')]=_['intersection'](_0x4a7aed[_0x17cf('0x3c')],qs['fields'](_0x35eef3[_0x17cf('0x3e')][_0x17cf('0x42')]));_0x570b93[_0x17cf('0x41')]=_0x570b93['attributes'][_0x17cf('0x43')]?_0x570b93[_0x17cf('0x41')]:_0x4a7aed[_0x17cf('0x3c')];if(!_0x35eef3['query'][_0x17cf('0x44')](_0x17cf('0x45'))){_0x570b93[_0x17cf('0x22')]=qs['limit'](_0x35eef3[_0x17cf('0x3e')][_0x17cf('0x22')]);_0x570b93[_0x17cf('0x24')]=qs['offset'](_0x35eef3[_0x17cf('0x3e')][_0x17cf('0x24')]);}_0x570b93[_0x17cf('0x46')]=qs['sort'](_0x35eef3[_0x17cf('0x3e')]['sort']);_0x570b93[_0x17cf('0x47')]=qs['filters'](_[_0x17cf('0x48')](_0x35eef3[_0x17cf('0x3e')],_0x4a7aed['filters']),_0x47c2dd);if(_0x35eef3[_0x17cf('0x3e')][_0x17cf('0x49')]){_0x570b93[_0x17cf('0x47')]=_[_0x17cf('0x4a')](_0x570b93[_0x17cf('0x47')],{'$or':_[_0x17cf('0x36')](_0x47c2dd,function(_0x5b4554){if(_0x5b4554[_0x17cf('0x3a')]!=='VIRTUAL'){var _0x23ac6d={};_0x23ac6d[_0x5b4554['name']]={'$like':'%'+_0x35eef3[_0x17cf('0x3e')][_0x17cf('0x49')]+'%'};return _0x23ac6d;}})});}_0x570b93=_[_0x17cf('0x4a')]({},_0x570b93,_0x35eef3[_0x17cf('0x4b')]);var _0x5d0a80={'where':_0x570b93[_0x17cf('0x47')]};return db[_0x17cf('0x37')]['count'](_0x5d0a80)['then'](function(_0x2a6a1d){_0x3c24e5[_0x17cf('0x23')]=_0x2a6a1d;if(_0x35eef3[_0x17cf('0x3e')][_0x17cf('0x4c')]){_0x570b93[_0x17cf('0x4d')]=[{'all':!![]}];}return db[_0x17cf('0x37')][_0x17cf('0x4e')](_0x570b93);})[_0x17cf('0x2a')](function(_0xacc717){_0x3c24e5['rows']=_0xacc717;return _0x3c24e5;})[_0x17cf('0x2a')](respondWithFilteredResult(_0x236b08,_0x570b93))[_0x17cf('0x4f')](handleError(_0x236b08,null));};exports['show']=function(_0x5705f5,_0x2a6afb){var _0x318cf6={'raw':!![],'where':{'id':_0x5705f5[_0x17cf('0x50')]['id']}},_0x596aab={};_0x596aab[_0x17cf('0x3c')]=_[_0x17cf('0x3d')](db[_0x17cf('0x37')]['rawAttributes']);_0x596aab[_0x17cf('0x3e')]=_[_0x17cf('0x3d')](_0x5705f5[_0x17cf('0x3e')]);_0x596aab['filters']=_[_0x17cf('0x40')](_0x596aab['model'],_0x596aab['query']);_0x318cf6[_0x17cf('0x41')]=_[_0x17cf('0x40')](_0x596aab[_0x17cf('0x3c')],qs[_0x17cf('0x42')](_0x5705f5[_0x17cf('0x3e')][_0x17cf('0x42')]));_0x318cf6[_0x17cf('0x41')]=_0x318cf6['attributes']['length']?_0x318cf6['attributes']:_0x596aab['model'];if(_0x5705f5[_0x17cf('0x3e')][_0x17cf('0x4c')]){_0x318cf6[_0x17cf('0x4d')]=[{'all':!![]}];}_0x318cf6=_[_0x17cf('0x4a')]({},_0x318cf6,_0x5705f5[_0x17cf('0x4b')]);return db['FaxQueue']['find'](_0x318cf6)['then'](handleEntityNotFound(_0x2a6afb,null))[_0x17cf('0x2a')](respondWithResult(_0x2a6afb,null))[_0x17cf('0x4f')](handleError(_0x2a6afb,null));};exports[_0x17cf('0x51')]=function(_0x5d6e0e,_0x1adc76){return db[_0x17cf('0x37')][_0x17cf('0x51')](_0x5d6e0e[_0x17cf('0x52')],{})[_0x17cf('0x2a')](function(_0x3f7da4){var _0x2b6ccc=_0x5d6e0e[_0x17cf('0x53')][_0x17cf('0x2b')]({'plain':!![]});if(!_0x2b6ccc)throw new Error(_0x17cf('0x54'));if(_0x2b6ccc[_0x17cf('0x55')]===_0x17cf('0x53')){var _0x31c2be=_0x3f7da4[_0x17cf('0x2b')]({'plain':!![]});var _0x3357ae=_0x17cf('0x2c');return db[_0x17cf('0x56')]['find']({'where':{'name':_0x3357ae,'userProfileId':_0x2b6ccc['userProfileId']},'raw':!![]})[_0x17cf('0x2a')](function(_0x4c86bd){if(_0x4c86bd&&_0x4c86bd['autoAssociation']===0x0){return db[_0x17cf('0x2d')][_0x17cf('0x51')]({'name':_0x31c2be[_0x17cf('0x33')],'resourceId':_0x31c2be['id'],'type':_0x4c86bd[_0x17cf('0x33')],'sectionId':_0x4c86bd['id']},{})[_0x17cf('0x2a')](function(){return _0x3f7da4;});}else{return _0x3f7da4;}})['catch'](function(_0x33482a){logger[_0x17cf('0x31')](_0x17cf('0x57'),_0x33482a);throw _0x33482a;});}return _0x3f7da4;})['then'](respondWithResult(_0x1adc76,0xc9))['catch'](handleError(_0x1adc76,null));};exports['update']=function(_0x4366b4,_0x4d9e06){if(_0x4366b4[_0x17cf('0x52')]['id']){delete _0x4366b4[_0x17cf('0x52')]['id'];}return db[_0x17cf('0x37')]['find']({'where':{'id':_0x4366b4['params']['id']}})[_0x17cf('0x2a')](handleEntityNotFound(_0x4d9e06,null))[_0x17cf('0x2a')](saveUpdates(_0x4366b4[_0x17cf('0x52')],null))[_0x17cf('0x2a')](respondWithResult(_0x4d9e06,null))[_0x17cf('0x4f')](handleError(_0x4d9e06,null));};exports[_0x17cf('0x2e')]=function(_0x10ff93,_0x2f88c5){return db[_0x17cf('0x37')][_0x17cf('0x58')]({'where':{'id':_0x10ff93[_0x17cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f88c5,null))['then'](removeEntity(_0x2f88c5,null))['catch'](handleError(_0x2f88c5,null));};exports[_0x17cf('0x59')]=function(_0x20c7c4,_0x23c720){return db['FaxQueue'][_0x17cf('0x59')]()[_0x17cf('0x2a')](respondWithResult(_0x23c720,null))['catch'](handleError(_0x23c720,null));};exports[_0x17cf('0x5a')]=function(_0x160dcc,_0x4a1807,_0x415a39){var _0x328dd3={'raw':!![],'where':{}},_0x1f884f={},_0xba22d7;return db['FaxQueue'][_0x17cf('0x5b')]({'where':{'id':_0x160dcc[_0x17cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x4a1807,null))['then'](function(_0x35d9b1){if(_0x35d9b1){_0xba22d7=_0x35d9b1[_0x17cf('0x2b')]({'plain':!![]});_0x1f884f[_0x17cf('0x3c')]=_[_0x17cf('0x3d')](db['UserFaxQueue'][_0x17cf('0x38')]);_0x1f884f[_0x17cf('0x3e')]=_[_0x17cf('0x3d')](_0x160dcc['query']);_0x1f884f[_0x17cf('0x3f')]=_['intersection'](_0x1f884f[_0x17cf('0x3c')],_0x1f884f['query']);_0x328dd3[_0x17cf('0x41')]=_[_0x17cf('0x40')](_0x1f884f['model'],qs[_0x17cf('0x42')](_0x160dcc[_0x17cf('0x3e')]['fields']));_0x328dd3[_0x17cf('0x41')]=_0x328dd3[_0x17cf('0x41')]['length']?_0x328dd3['attributes']:_0x1f884f[_0x17cf('0x3c')];if(!_0x160dcc[_0x17cf('0x3e')][_0x17cf('0x44')](_0x17cf('0x45'))){_0x328dd3[_0x17cf('0x22')]=qs['limit'](_0x160dcc[_0x17cf('0x3e')][_0x17cf('0x22')]);_0x328dd3[_0x17cf('0x24')]=qs[_0x17cf('0x24')](_0x160dcc['query'][_0x17cf('0x24')]);}_0x328dd3[_0x17cf('0x46')]=qs[_0x17cf('0x5c')](_0x160dcc['query']['sort']);_0x328dd3[_0x17cf('0x47')]=qs[_0x17cf('0x3f')](_[_0x17cf('0x48')](_0x160dcc['query'],_0x1f884f[_0x17cf('0x3f')]));_0x328dd3['where'][_0x17cf('0x5d')]=_0x35d9b1['id'];if(_0x160dcc[_0x17cf('0x3e')]['filter']){_0x328dd3[_0x17cf('0x47')]=_[_0x17cf('0x4a')](_0x328dd3[_0x17cf('0x47')],{'$or':_[_0x17cf('0x36')](_0x328dd3['attributes'],function(_0x487e4b){var _0x1cf807={};_0x1cf807[_0x487e4b]={'$like':'%'+_0x160dcc[_0x17cf('0x3e')][_0x17cf('0x49')]+'%'};return _0x1cf807;})});}_0x328dd3=_[_0x17cf('0x4a')]({},_0x328dd3,_0x160dcc['options']);return db[_0x17cf('0x5e')][_0x17cf('0x4e')](_0x328dd3);}})['then'](function(_0x3870c9){if(_0x3870c9){return db[_0x17cf('0x5f')][_0x17cf('0x60')]({'where':{'id':_['map'](_0x3870c9,_0x17cf('0x61')),'role':_0x17cf('0x62')},'attributes':['id',_0x17cf('0x33'),_0x17cf('0x63'),_0x17cf('0x64'),'createdAt']});}})[_0x17cf('0x2a')](function(_0x1a16df){if(_0x1a16df){return{'count':_0x1a16df[_0x17cf('0x23')],'rows':_[_0x17cf('0x36')](_0x1a16df[_0x17cf('0x65')],function(_0x591e51){return{'membername':_0x591e51[_0x17cf('0x33')],'UserId':_0x591e51['id'],'queue_name':_0xba22d7['name'],'FaxQueueId':_0xba22d7['id'],'interface':util[_0x17cf('0x66')](_0x17cf('0x67'),_0x17cf('0x68'),_0x591e51[_0x17cf('0x33')]),'penalty':0x0,'paused':_0x591e51[_0x17cf('0x63')],'createdAt':_0x591e51[_0x17cf('0x69')],'updatedAt':_0x591e51['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a1807,_0x328dd3))['catch'](handleError(_0x4a1807,null));};exports['getTeams']=function(_0x5f1b6d,_0x26288c,_0x43cb8c){var _0x3cbf1a={};var _0x56f5d7={};var _0x31fe1a;var _0x3f4ef4;return db[_0x17cf('0x37')][_0x17cf('0x5b')]({'where':{'id':_0x5f1b6d[_0x17cf('0x50')]['id']}})[_0x17cf('0x2a')](handleEntityNotFound(_0x26288c,null))['then'](function(_0x59321e){if(_0x59321e){_0x31fe1a=_0x59321e;_0x56f5d7[_0x17cf('0x3c')]=_[_0x17cf('0x3d')](db[_0x17cf('0x6a')]['rawAttributes']);_0x56f5d7['query']=_['keys'](_0x5f1b6d[_0x17cf('0x3e')]);_0x56f5d7[_0x17cf('0x3f')]=_[_0x17cf('0x40')](_0x56f5d7[_0x17cf('0x3c')],_0x56f5d7[_0x17cf('0x3e')]);_0x3cbf1a[_0x17cf('0x41')]=_[_0x17cf('0x40')](_0x56f5d7[_0x17cf('0x3c')],qs[_0x17cf('0x42')](_0x5f1b6d[_0x17cf('0x3e')]['fields']));_0x3cbf1a[_0x17cf('0x41')]=_0x3cbf1a['attributes'][_0x17cf('0x43')]?_0x3cbf1a[_0x17cf('0x41')]:_0x56f5d7[_0x17cf('0x3c')];_0x3cbf1a[_0x17cf('0x46')]=qs['sort'](_0x5f1b6d['query'][_0x17cf('0x5c')]);_0x3cbf1a[_0x17cf('0x47')]=qs[_0x17cf('0x3f')](_[_0x17cf('0x48')](_0x5f1b6d[_0x17cf('0x3e')],_0x56f5d7[_0x17cf('0x3f')]));if(_0x5f1b6d['query'][_0x17cf('0x49')]){_0x3cbf1a[_0x17cf('0x47')]=_[_0x17cf('0x4a')](_0x3cbf1a[_0x17cf('0x47')],{'$or':_[_0x17cf('0x36')](_0x3cbf1a[_0x17cf('0x41')],function(_0x5f24e3){var _0x3b7be9={};_0x3b7be9[_0x5f24e3]={'$like':'%'+_0x5f1b6d[_0x17cf('0x3e')][_0x17cf('0x49')]+'%'};return _0x3b7be9;})});}_0x3cbf1a=_[_0x17cf('0x4a')]({},_0x3cbf1a,_0x5f1b6d['options']);return _0x31fe1a[_0x17cf('0x6b')](_0x3cbf1a);}})['then'](function(_0x4ca2be){if(_0x4ca2be){_0x3f4ef4=_0x4ca2be[_0x17cf('0x43')];if(!_0x5f1b6d['query'][_0x17cf('0x44')](_0x17cf('0x45'))){_0x3cbf1a[_0x17cf('0x22')]=qs[_0x17cf('0x22')](_0x5f1b6d[_0x17cf('0x3e')][_0x17cf('0x22')]);_0x3cbf1a[_0x17cf('0x24')]=qs[_0x17cf('0x24')](_0x5f1b6d['query'][_0x17cf('0x24')]);}return _0x31fe1a['getTeams'](_0x3cbf1a);}})['then'](function(_0x1c6a90){if(_0x1c6a90){return _0x1c6a90?{'count':_0x3f4ef4,'rows':_0x1c6a90}:null;}})['then'](respondWithResult(_0x26288c,null))[_0x17cf('0x4f')](handleError(_0x26288c,null));};exports[_0x17cf('0x6c')]=function(_0x21640f,_0x35018e,_0x52ee1f){var _0x4cff3e=_0x21640f[_0x17cf('0x52')][_0x17cf('0x6d')];return db[_0x17cf('0x6a')][_0x17cf('0x4e')]({'where':{'id':_0x4cff3e},'attributes':['id'],'include':[{'model':db[_0x17cf('0x5f')],'as':_0x17cf('0x6e'),'attributes':['id',_0x17cf('0x33'),_0x17cf('0x6f'),_0x17cf('0x70'),_0x17cf('0x71')],'raw':!![]}]})['then'](function(_0x5066f6){if(_0x5066f6){var _0x1cc245=_['flatMap'](_0x5066f6,function(_0x50c42b){var _0x594ea1=_0x50c42b[_0x17cf('0x2b')]({'plain':!![]});return _0x594ea1['Agents'];});return db[_0x17cf('0x37')][_0x17cf('0x58')]({'where':{'id':_0x21640f[_0x17cf('0x50')]['id']}})[_0x17cf('0x2a')](function(_0xacdbfa){return db[_0x17cf('0x72')]['transaction'](function(_0x150da7){return _0xacdbfa[_0x17cf('0x6c')](_0x4cff3e,{'transaction':_0x150da7})[_0x17cf('0x2a')](function(){return BPromise['each'](_0x1cc245,function(_0x12c7f5){return db[_0x17cf('0x5e')][_0x17cf('0x73')]({'where':{'UserId':_0x12c7f5['id'],'FaxQueueId':_0x21640f[_0x17cf('0x50')]['id']},'transaction':_0x150da7});});})[_0x17cf('0x2a')](function(){_0x1cc245['forEach'](function(_0xaf921d){socket[_0x17cf('0x74')](_0x17cf('0x75'),{'UserId':_0xaf921d['id'],'FaxQueueId':_0xacdbfa['id']});});});});});}})[_0x17cf('0x2a')](respondWithStatusCode(_0x35018e,null))[_0x17cf('0x4f')](handleError(_0x35018e,null));};exports[_0x17cf('0x76')]=function(_0x978173,_0x2a172b,_0x32ee77){return db['Team']['findAll']({'where':{'id':_0x978173[_0x17cf('0x3e')][_0x17cf('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x17cf('0x5f')],'as':_0x17cf('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2a172b,null))[_0x17cf('0x2a')](function(_0x53bda9){var _0x5125b3=_['map'](_0x53bda9,'id');var _0x41e052=[];var _0x199f08=[];var _0x1406f1=squel[_0x17cf('0x77')]();_0x1406f1[_0x17cf('0x78')]('tq.TeamId')[_0x17cf('0x79')](_0x17cf('0x7a'),'tq')[_0x17cf('0x7b')](_0x17cf('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x17cf('0x47')](_0x17cf('0x7d'),_0x978173[_0x17cf('0x50')]['id']);for(var _0x2c8975=0x0;_0x2c8975<_0x53bda9[_0x17cf('0x43')];_0x2c8975+=0x1){let _0x1b5465=_0x53bda9[_0x2c8975];for(var _0x178fcc=0x0;_0x178fcc<_0x1b5465[_0x17cf('0x6e')][_0x17cf('0x43')];_0x178fcc+=0x1){let _0x255f8a=_0x1b5465[_0x17cf('0x6e')][_0x178fcc];var _0x1d2038=_0x1406f1[_0x17cf('0x7e')]();_0x1d2038[_0x17cf('0x47')](_0x17cf('0x7f'),_0x255f8a['id']);_0x199f08[_0x17cf('0x80')](db[_0x17cf('0x72')]['query'](_0x1d2038[_0x17cf('0x81')](),{'type':db[_0x17cf('0x72')]['QueryTypes'][_0x17cf('0x82')]})[_0x17cf('0x2a')](function(_0xc4f38f){if(_0xc4f38f[_0x17cf('0x43')]===0x1){return _0x255f8a['id'];}else{var _0x1df106=_[_0x17cf('0x83')](_[_0x17cf('0x36')](_0xc4f38f,'TeamId'),function(_0xa642c8){return _['includes'](_0x5125b3,_0xa642c8);});if(_0x1df106){return _0x255f8a['id'];}}}));}}return BPromise[_0x17cf('0x84')](_0x199f08)[_0x17cf('0x2a')](function(_0x178002){_0x41e052=_(_0x41e052)['union'](_0x178002)[_0x17cf('0x85')]()['value']();return db['FaxQueue']['find']({'where':{'id':_0x978173[_0x17cf('0x50')]['id']}})[_0x17cf('0x2a')](function(_0x5f14b7){return db['sequelize'][_0x17cf('0x86')](function(_0x2dbf29){return _0x5f14b7[_0x17cf('0x76')](_0x978173['query'][_0x17cf('0x6d')],{'transaction':_0x2dbf29})['then'](function(){if(!_[_0x17cf('0x87')](_0x41e052)){return _0x5f14b7[_0x17cf('0x88')](_0x41e052,{'transaction':_0x2dbf29});}})[_0x17cf('0x2a')](function(){_0x41e052[_0x17cf('0x89')](function(_0x2d977c){socket[_0x17cf('0x74')](_0x17cf('0x8a'),{'UserId':_0x2d977c,'FaxQueueId':_0x5f14b7['id']});});});});});});})[_0x17cf('0x2a')](respondWithStatusCode(_0x2a172b,null))['catch'](handleError(_0x2a172b,null));};exports['addAgents']=function(_0x369f95,_0x19a5c5,_0x3f6a10){return db[_0x17cf('0x37')][_0x17cf('0x58')]({'where':{'id':_0x369f95['params']['id']}})[_0x17cf('0x2a')](handleEntityNotFound(_0x19a5c5,null))[_0x17cf('0x2a')](function(_0x3301f5){if(_0x3301f5){return _0x3301f5['addAgents'](_0x369f95['body'][_0x17cf('0x6d')],_['omit'](_0x369f95['body'],['ids','id'])||{})['spread'](function(_0x2ed67e){for(var _0x15e8b7=0x0;_0x15e8b7<_0x369f95[_0x17cf('0x52')][_0x17cf('0x6d')][_0x17cf('0x43')];_0x15e8b7+=0x1){socket[_0x17cf('0x74')]('userFaxQueue:save',{'UserId':Number(_0x369f95[_0x17cf('0x52')]['ids'][_0x15e8b7]),'FaxQueueId':Number(_0x369f95[_0x17cf('0x50')]['id'])});}return _0x2ed67e;});}})[_0x17cf('0x2a')](respondWithResult(_0x19a5c5,null))[_0x17cf('0x4f')](handleError(_0x19a5c5,null));};exports[_0x17cf('0x88')]=function(_0x42ea4b,_0x4b6944,_0x30bcd4){return db[_0x17cf('0x37')][_0x17cf('0x58')]({'where':{'id':_0x42ea4b[_0x17cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x4b6944,null))[_0x17cf('0x2a')](function(_0x2d09b9){if(_0x2d09b9){return _0x2d09b9['removeAgents'](_0x42ea4b[_0x17cf('0x3e')][_0x17cf('0x6d')])[_0x17cf('0x2a')](function(){if(_[_0x17cf('0x8b')](_0x42ea4b[_0x17cf('0x3e')]['ids'])){for(var _0x55bd62=0x0;_0x55bd62<_0x42ea4b[_0x17cf('0x3e')][_0x17cf('0x6d')][_0x17cf('0x43')];_0x55bd62+=0x1){socket['emit'](_0x17cf('0x8a'),{'UserId':Number(_0x42ea4b['query']['ids'][_0x55bd62]),'FaxQueueId':Number(_0x42ea4b[_0x17cf('0x50')]['id'])});}}else{socket[_0x17cf('0x74')](_0x17cf('0x8a'),{'UserId':Number(_0x42ea4b[_0x17cf('0x3e')][_0x17cf('0x6d')]),'FaxQueueId':Number(_0x42ea4b[_0x17cf('0x50')]['id'])});}});}})[_0x17cf('0x2a')](respondWithStatusCode(_0x4b6944,null))[_0x17cf('0x4f')](handleError(_0x4b6944,null));};exports[_0x17cf('0x8c')]=function(_0x403283,_0x2e5357,_0x3cf37f){var _0x46e465={};var _0x20bff3={};var _0x3dfc4e;var _0x5e6a00;return db['FaxQueue'][_0x17cf('0x5b')]({'where':{'id':_0x403283[_0x17cf('0x50')]['id']}})[_0x17cf('0x2a')](handleEntityNotFound(_0x2e5357,null))[_0x17cf('0x2a')](function(_0x38ab95){if(_0x38ab95){_0x3dfc4e=_0x38ab95;_0x20bff3[_0x17cf('0x3c')]=_[_0x17cf('0x3d')](db[_0x17cf('0x5f')][_0x17cf('0x38')]);_0x20bff3[_0x17cf('0x3e')]=_['keys'](_0x403283['query']);_0x20bff3[_0x17cf('0x3f')]=_['intersection'](_0x20bff3[_0x17cf('0x3c')],_0x20bff3[_0x17cf('0x3e')]);_0x46e465[_0x17cf('0x41')]=_[_0x17cf('0x40')](_0x20bff3['model'],qs[_0x17cf('0x42')](_0x403283['query'][_0x17cf('0x42')]));_0x46e465[_0x17cf('0x41')]=_0x46e465[_0x17cf('0x41')][_0x17cf('0x43')]?_0x46e465['attributes']:_0x20bff3[_0x17cf('0x3c')];_0x46e465[_0x17cf('0x46')]=qs['sort'](_0x403283[_0x17cf('0x3e')][_0x17cf('0x5c')]);_0x46e465['where']=qs[_0x17cf('0x3f')](_[_0x17cf('0x48')](_0x403283[_0x17cf('0x3e')],_0x20bff3['filters']));if(_0x403283[_0x17cf('0x3e')][_0x17cf('0x49')]){_0x46e465[_0x17cf('0x47')]=_[_0x17cf('0x4a')](_0x46e465[_0x17cf('0x47')],{'$or':_['map'](_0x46e465[_0x17cf('0x41')],function(_0x11461c){var _0x2497dc={};_0x2497dc[_0x11461c]={'$like':'%'+_0x403283[_0x17cf('0x3e')]['filter']+'%'};return _0x2497dc;})});}_0x46e465=_['merge']({},_0x46e465,_0x403283[_0x17cf('0x4b')]);return _0x3dfc4e[_0x17cf('0x8c')](_0x46e465);}})[_0x17cf('0x2a')](function(_0x1e32f6){if(_0x1e32f6){_0x5e6a00=_0x1e32f6[_0x17cf('0x43')];if(!_0x403283['query'][_0x17cf('0x44')](_0x17cf('0x45'))){_0x46e465[_0x17cf('0x22')]=qs['limit'](_0x403283[_0x17cf('0x3e')][_0x17cf('0x22')]);_0x46e465[_0x17cf('0x24')]=qs['offset'](_0x403283[_0x17cf('0x3e')][_0x17cf('0x24')]);}return _0x3dfc4e['getAgents'](_0x46e465);}})[_0x17cf('0x2a')](function(_0x182fa2){if(_0x182fa2){return _0x182fa2?{'count':_0x5e6a00,'rows':_0x182fa2}:null;}})['then'](respondWithResult(_0x2e5357,null))[_0x17cf('0x4f')](handleError(_0x2e5357,null));};
\ No newline at end of file
index 9593f34..6190e12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ab=['emit','hasOwnProperty','exports','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x352c13,_0x1a91cb){var _0x5b48e8=function(_0x1afcc2){while(--_0x1afcc2){_0x352c13['push'](_0x352c13['shift']());}};_0x5b48e8(++_0x1a91cb);}(_0xc4ab,0x15f));var _0xbc4a=function(_0x4d376d,_0x303592){_0x4d376d=_0x4d376d-0x0;var _0x434aeb=_0xc4ab[_0x4d376d];return _0x434aeb;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xbc4a('0x0'))['db'][_0xbc4a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xbc4a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x440ec0){return function(_0x935c49,_0x418ba4,_0x3d669b){FaxQueueEvents[_0xbc4a('0x3')](_0x440ec0+':'+_0x935c49['id'],_0x935c49);FaxQueueEvents[_0xbc4a('0x3')](_0x440ec0,_0x935c49);_0x3d669b(null);};}for(var e in events){if(events[_0xbc4a('0x4')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xbc4a('0x5')]=FaxQueueEvents;
\ No newline at end of file
+var _0x7a82=['FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x4c68cd,_0x5036ba){var _0x2f1c48=function(_0xeb8aaf){while(--_0xeb8aaf){_0x4c68cd['push'](_0x4c68cd['shift']());}};_0x2f1c48(++_0x5036ba);}(_0x7a82,0x99));var _0x27a8=function(_0xbcfe67,_0x7afc3c){_0xbcfe67=_0xbcfe67-0x0;var _0x1f4eb6=_0x7a82[_0xbcfe67];return _0x1f4eb6;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x27a8('0x0'))['db'][_0x27a8('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x27a8('0x2')](0x0);var events={'afterCreate':_0x27a8('0x3'),'afterUpdate':'update','afterDestroy':_0x27a8('0x4')};function emitEvent(_0x4c2b3e){return function(_0x569cb4,_0x55ae6c,_0x447f16){FaxQueueEvents[_0x27a8('0x5')](_0x4c2b3e+':'+_0x569cb4['id'],_0x569cb4);FaxQueueEvents['emit'](_0x4c2b3e,_0x569cb4);_0x447f16(null);};}for(var e in events){if(events[_0x27a8('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index 7d2c56a..8a1db8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe17b=['../../config/logger','request-promise','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe17b,0x1d2));var _0xbe17=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xe17b[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xbe17('0x0'));var util=require(_0xbe17('0x1'));var logger=require(_0xbe17('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbe17('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe17('0x4'));var attributes=require(_0xbe17('0x5'));module[_0xbe17('0x6')]=function(_0x47fd57,_0x50f8f3){return _0x47fd57[_0xbe17('0x7')](_0xbe17('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe964=['bluebird','request-promise','path','../../config/environment','define','FaxQueue','lodash','util'];(function(_0x101f15,_0x5c449b){var _0x1993bb=function(_0x248365){while(--_0x248365){_0x101f15['push'](_0x101f15['shift']());}};_0x1993bb(++_0x5c449b);}(_0xe964,0xee));var _0x4e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe964[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e96('0x0'));var util=require(_0x4e96('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4e96('0x2'));var rp=require(_0x4e96('0x3'));var fs=require('fs');var path=require(_0x4e96('0x4'));var rimraf=require('rimraf');var config=require(_0x4e96('0x5'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x1f52fc,_0x5b7de0){return _0x1f52fc[_0x4e96('0x6')](_0x4e96('0x7'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f185ed..96426b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9648=['message','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowFaxQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x2f4d6d,_0x4847df){var _0xda9396=function(_0x31cf44){while(--_0x31cf44){_0x2f4d6d['push'](_0x2f4d6d['shift']());}};_0xda9396(++_0x4847df);}(_0x9648,0x112));var _0x8964=function(_0x515b32,_0x19d34d){_0x515b32=_0x515b32-0x0;var _0x5bc099=_0x9648[_0x515b32];return _0x5bc099;};'use strict';var _=require('lodash');var util=require(_0x8964('0x0'));var moment=require(_0x8964('0x1'));var BPromise=require(_0x8964('0x2'));var rs=require(_0x8964('0x3'));var fs=require('fs');var Redis=require(_0x8964('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8964('0x5'));var logger=require(_0x8964('0x6'))(_0x8964('0x7'));var config=require('../../config/environment');var jayson=require(_0x8964('0x8'));var client=jayson['client'][_0x8964('0x9')]({'port':0x232a});config[_0x8964('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8964('0xb'))(new Redis(config['redis']));require(_0x8964('0xc'))[_0x8964('0xd')](socket);function respondWithRpcPromise(_0x23e860,_0x482eef,_0x4ce00a){return new BPromise(function(_0x20d48b,_0x46c481){return client[_0x8964('0xe')](_0x23e860,_0x4ce00a)[_0x8964('0xf')](function(_0xe92e87){logger[_0x8964('0x10')](_0x8964('0x11'),_0x482eef,_0x8964('0x12'));logger[_0x8964('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x482eef,'request\x20sent',JSON['stringify'](_0xe92e87));if(_0xe92e87['error']){if(_0xe92e87[_0x8964('0x14')][_0x8964('0x15')]===0x1f4){logger[_0x8964('0x14')]('FaxQueue,\x20%s,\x20%s',_0x482eef,_0xe92e87['error'][_0x8964('0x16')]);return _0x46c481(_0xe92e87[_0x8964('0x14')]['message']);}logger[_0x8964('0x14')](_0x8964('0x11'),_0x482eef,_0xe92e87[_0x8964('0x14')]['message']);return _0x20d48b(_0xe92e87[_0x8964('0x14')][_0x8964('0x16')]);}else{logger[_0x8964('0x10')](_0x8964('0x11'),_0x482eef,_0x8964('0x12'));_0x20d48b(_0xe92e87['result'][_0x8964('0x16')]);}})[_0x8964('0x17')](function(_0xe28b7a){logger[_0x8964('0x14')](_0x8964('0x11'),_0x482eef,_0xe28b7a);_0x46c481(_0xe28b7a);});});}exports[_0x8964('0x18')]=function(_0x1fb7aa){var _0x2469dd=this;return new Promise(function(_0x2d4dde,_0x1614e3){return db[_0x8964('0x19')]['findAll']({'raw':_0x1fb7aa[_0x8964('0x1a')]?_0x1fb7aa[_0x8964('0x1a')][_0x8964('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fb7aa[_0x8964('0x1a')]?_0x1fb7aa[_0x8964('0x1a')][_0x8964('0x1c')]||null:null,'attributes':_0x1fb7aa['options']?_0x1fb7aa[_0x8964('0x1a')][_0x8964('0x1d')]||null:null,'limit':_0x1fb7aa[_0x8964('0x1a')]?_0x1fb7aa[_0x8964('0x1a')][_0x8964('0x1e')]||null:null,'include':_0x1fb7aa[_0x8964('0x1a')]?_0x1fb7aa[_0x8964('0x1a')][_0x8964('0x1f')]?_[_0x8964('0x20')](_0x1fb7aa[_0x8964('0x1a')]['include'],function(_0x154fea){return{'model':db[_0x154fea[_0x8964('0x21')]],'as':_0x154fea['as'],'attributes':_0x154fea[_0x8964('0x1d')],'include':_0x154fea[_0x8964('0x1f')]?_[_0x8964('0x20')](_0x154fea[_0x8964('0x1f')],function(_0x34be55){return{'model':db[_0x34be55[_0x8964('0x21')]],'as':_0x34be55['as'],'attributes':_0x34be55['attributes'],'include':_0x34be55[_0x8964('0x1f')]?_[_0x8964('0x20')](_0x34be55[_0x8964('0x1f')],function(_0x218c8f){return{'model':db[_0x218c8f['model']],'as':_0x218c8f['as'],'attributes':_0x218c8f[_0x8964('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8964('0xf')](function(_0x28da04){logger[_0x8964('0x10')](_0x8964('0x18'),_0x1fb7aa);logger[_0x8964('0x13')]('GetFaxQueue',_0x1fb7aa,JSON[_0x8964('0x22')](_0x28da04));_0x2d4dde(_0x28da04);})[_0x8964('0x17')](function(_0x3434a5){logger['error']('GetFaxQueue',_0x3434a5[_0x8964('0x16')],_0x1fb7aa);_0x1614e3(_0x2469dd['error'](0x1f4,_0x3434a5[_0x8964('0x16')]));});});};exports['ShowFaxQueue']=function(_0x1c6a7e){var _0x465c75=this;return new Promise(function(_0x8efcca,_0x590653){return db[_0x8964('0x19')][_0x8964('0x23')]({'raw':_0x1c6a7e[_0x8964('0x1a')]?_0x1c6a7e['options'][_0x8964('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c6a7e[_0x8964('0x1a')]?_0x1c6a7e[_0x8964('0x1a')][_0x8964('0x1c')]||null:null,'attributes':_0x1c6a7e[_0x8964('0x1a')]?_0x1c6a7e[_0x8964('0x1a')][_0x8964('0x1d')]||null:null,'include':_0x1c6a7e[_0x8964('0x1a')]?_0x1c6a7e['options'][_0x8964('0x1f')]?_[_0x8964('0x20')](_0x1c6a7e[_0x8964('0x1a')][_0x8964('0x1f')],function(_0x3c8a64){return{'model':db[_0x3c8a64[_0x8964('0x21')]],'as':_0x3c8a64['as'],'attributes':_0x3c8a64[_0x8964('0x1d')],'include':_0x3c8a64[_0x8964('0x1f')]?_['map'](_0x3c8a64[_0x8964('0x1f')],function(_0x22739c){return{'model':db[_0x22739c[_0x8964('0x21')]],'as':_0x22739c['as'],'attributes':_0x22739c[_0x8964('0x1d')],'include':_0x22739c[_0x8964('0x1f')]?_[_0x8964('0x20')](_0x22739c[_0x8964('0x1f')],function(_0x447284){return{'model':db[_0x447284[_0x8964('0x21')]],'as':_0x447284['as'],'attributes':_0x447284['attributes']};}):[]};}):[]};}):[]:[]})[_0x8964('0xf')](function(_0x3b60d0){logger[_0x8964('0x10')](_0x8964('0x24'),_0x1c6a7e);logger[_0x8964('0x13')]('ShowFaxQueue',_0x1c6a7e,JSON[_0x8964('0x22')](_0x3b60d0));_0x8efcca(_0x3b60d0);})[_0x8964('0x17')](function(_0x40c5b6){logger[_0x8964('0x14')](_0x8964('0x24'),_0x40c5b6[_0x8964('0x16')],_0x1c6a7e);_0x590653(_0x465c75[_0x8964('0x14')](0x1f4,_0x40c5b6[_0x8964('0x16')]));});});};
\ No newline at end of file
+var _0xefeb=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxQueue','findAll','options','raw','where','attributes','include','map','model','GetFaxQueue','ShowFaxQueue','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x200a55,_0x43b726){var _0x2d7353=function(_0x5d1705){while(--_0x5d1705){_0x200a55['push'](_0x200a55['shift']());}};_0x2d7353(++_0x43b726);}(_0xefeb,0x85));var _0xbefe=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xefeb[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0xbefe('0x0'));var moment=require(_0xbefe('0x1'));var BPromise=require('bluebird');var rs=require(_0xbefe('0x2'));var fs=require('fs');var Redis=require(_0xbefe('0x3'));var db=require(_0xbefe('0x4'))['db'];var utils=require(_0xbefe('0x5'));var logger=require('../../config/logger')(_0xbefe('0x6'));var config=require(_0xbefe('0x7'));var jayson=require(_0xbefe('0x8'));var client=jayson[_0xbefe('0x9')]['http']({'port':0x232a});config[_0xbefe('0xa')]=_[_0xbefe('0xb')](config[_0xbefe('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbefe('0xc'))(new Redis(config[_0xbefe('0xa')]));require(_0xbefe('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f48b6,_0x5d19d5,_0x4748bf){return new BPromise(function(_0x25066e,_0x38209b){return client[_0xbefe('0xe')](_0x2f48b6,_0x4748bf)[_0xbefe('0xf')](function(_0x5b0ae9){logger[_0xbefe('0x10')](_0xbefe('0x11'),_0x5d19d5,_0xbefe('0x12'));logger[_0xbefe('0x13')](_0xbefe('0x14'),_0x5d19d5,_0xbefe('0x12'),JSON[_0xbefe('0x15')](_0x5b0ae9));if(_0x5b0ae9[_0xbefe('0x16')]){if(_0x5b0ae9[_0xbefe('0x16')][_0xbefe('0x17')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x5d19d5,_0x5b0ae9[_0xbefe('0x16')]['message']);return _0x38209b(_0x5b0ae9[_0xbefe('0x16')]['message']);}logger[_0xbefe('0x16')](_0xbefe('0x11'),_0x5d19d5,_0x5b0ae9[_0xbefe('0x16')]['message']);return _0x25066e(_0x5b0ae9[_0xbefe('0x16')][_0xbefe('0x18')]);}else{logger[_0xbefe('0x10')](_0xbefe('0x11'),_0x5d19d5,_0xbefe('0x12'));_0x25066e(_0x5b0ae9[_0xbefe('0x19')]['message']);}})['catch'](function(_0x2edb5a){logger['error'](_0xbefe('0x11'),_0x5d19d5,_0x2edb5a);_0x38209b(_0x2edb5a);});});}exports['GetFaxQueue']=function(_0x470de7){var _0x2d8b0e=this;return new Promise(function(_0x3328ef,_0x2e5e2a){return db[_0xbefe('0x1a')][_0xbefe('0x1b')]({'raw':_0x470de7[_0xbefe('0x1c')]?_0x470de7[_0xbefe('0x1c')][_0xbefe('0x1d')]===undefined?!![]:![]:!![],'where':_0x470de7['options']?_0x470de7[_0xbefe('0x1c')][_0xbefe('0x1e')]||null:null,'attributes':_0x470de7[_0xbefe('0x1c')]?_0x470de7['options'][_0xbefe('0x1f')]||null:null,'limit':_0x470de7['options']?_0x470de7['options']['limit']||null:null,'include':_0x470de7[_0xbefe('0x1c')]?_0x470de7['options'][_0xbefe('0x20')]?_[_0xbefe('0x21')](_0x470de7[_0xbefe('0x1c')][_0xbefe('0x20')],function(_0x5954de){return{'model':db[_0x5954de[_0xbefe('0x22')]],'as':_0x5954de['as'],'attributes':_0x5954de[_0xbefe('0x1f')],'include':_0x5954de[_0xbefe('0x20')]?_['map'](_0x5954de[_0xbefe('0x20')],function(_0x5da07a){return{'model':db[_0x5da07a[_0xbefe('0x22')]],'as':_0x5da07a['as'],'attributes':_0x5da07a[_0xbefe('0x1f')],'include':_0x5da07a['include']?_['map'](_0x5da07a[_0xbefe('0x20')],function(_0x53e7eb){return{'model':db[_0x53e7eb['model']],'as':_0x53e7eb['as'],'attributes':_0x53e7eb['attributes']};}):[]};}):[]};}):[]:[]})[_0xbefe('0xf')](function(_0x2cdc4b){logger['info'](_0xbefe('0x23'),_0x470de7);logger['debug'](_0xbefe('0x23'),_0x470de7,JSON[_0xbefe('0x15')](_0x2cdc4b));_0x3328ef(_0x2cdc4b);})['catch'](function(_0x4c2c39){logger[_0xbefe('0x16')](_0xbefe('0x23'),_0x4c2c39[_0xbefe('0x18')],_0x470de7);_0x2e5e2a(_0x2d8b0e[_0xbefe('0x16')](0x1f4,_0x4c2c39[_0xbefe('0x18')]));});});};exports[_0xbefe('0x24')]=function(_0x314d30){var _0x13e028=this;return new Promise(function(_0x2b233d,_0x66bb57){return db[_0xbefe('0x1a')]['find']({'raw':_0x314d30[_0xbefe('0x1c')]?_0x314d30['options'][_0xbefe('0x1d')]===undefined?!![]:![]:!![],'where':_0x314d30[_0xbefe('0x1c')]?_0x314d30[_0xbefe('0x1c')]['where']||null:null,'attributes':_0x314d30[_0xbefe('0x1c')]?_0x314d30[_0xbefe('0x1c')]['attributes']||null:null,'include':_0x314d30['options']?_0x314d30[_0xbefe('0x1c')]['include']?_[_0xbefe('0x21')](_0x314d30[_0xbefe('0x1c')][_0xbefe('0x20')],function(_0x35c182){return{'model':db[_0x35c182['model']],'as':_0x35c182['as'],'attributes':_0x35c182[_0xbefe('0x1f')],'include':_0x35c182[_0xbefe('0x20')]?_[_0xbefe('0x21')](_0x35c182['include'],function(_0xce8ae4){return{'model':db[_0xce8ae4[_0xbefe('0x22')]],'as':_0xce8ae4['as'],'attributes':_0xce8ae4[_0xbefe('0x1f')],'include':_0xce8ae4[_0xbefe('0x20')]?_[_0xbefe('0x21')](_0xce8ae4[_0xbefe('0x20')],function(_0x184cfc){return{'model':db[_0x184cfc[_0xbefe('0x22')]],'as':_0x184cfc['as'],'attributes':_0x184cfc[_0xbefe('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbefe('0xf')](function(_0x374829){logger['info']('ShowFaxQueue',_0x314d30);logger['debug']('ShowFaxQueue',_0x314d30,JSON[_0xbefe('0x15')](_0x374829));_0x2b233d(_0x374829);})[_0xbefe('0x25')](function(_0x3fc512){logger['error'](_0xbefe('0x24'),_0x3fc512['message'],_0x314d30);_0x66bb57(_0x13e028[_0xbefe('0x16')](0x1f4,_0x3fc512[_0xbefe('0x18')]));});});};
\ No newline at end of file
index 327e69f..96f7ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ff8=['emit','register','length','faxQueue:','./faxQueue.events','remove','update'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x1ff8,0x154));var _0x81ff=function(_0x5289ca,_0x429aac){_0x5289ca=_0x5289ca-0x0;var _0x2270e4=_0x1ff8[_0x5289ca];return _0x2270e4;};'use strict';var FaxQueueEvents=require(_0x81ff('0x0'));var events=['save',_0x81ff('0x1'),_0x81ff('0x2')];function createListener(_0x152d4d,_0x5aa348){return function(_0x4b95e2){_0x5aa348[_0x81ff('0x3')](_0x152d4d,_0x4b95e2);};}function removeListener(_0x57a2f2,_0x503332){return function(){FaxQueueEvents['removeListener'](_0x57a2f2,_0x503332);};}exports[_0x81ff('0x4')]=function(_0x5987d8){for(var _0x2096f6=0x0,_0x5b485a=events[_0x81ff('0x5')];_0x2096f6<_0x5b485a;_0x2096f6++){var _0x35adef=events[_0x2096f6];var _0x2c15dc=createListener(_0x81ff('0x6')+_0x35adef,_0x5987d8);FaxQueueEvents['on'](_0x35adef,_0x2c15dc);}};
\ No newline at end of file
+var _0xec39=['length','faxQueue:','./faxQueue.events','save','remove','update','removeListener'];(function(_0x483889,_0x4c80ad){var _0x477f7a=function(_0x574867){while(--_0x574867){_0x483889['push'](_0x483889['shift']());}};_0x477f7a(++_0x4c80ad);}(_0xec39,0x19f));var _0x9ec3=function(_0x368f24,_0x555f50){_0x368f24=_0x368f24-0x0;var _0x57a078=_0xec39[_0x368f24];return _0x57a078;};'use strict';var FaxQueueEvents=require(_0x9ec3('0x0'));var events=[_0x9ec3('0x1'),_0x9ec3('0x2'),_0x9ec3('0x3')];function createListener(_0x1fc7a7,_0xb3d117){return function(_0x3d481c){_0xb3d117['emit'](_0x1fc7a7,_0x3d481c);};}function removeListener(_0x1f43fb,_0x1c944d){return function(){FaxQueueEvents[_0x9ec3('0x4')](_0x1f43fb,_0x1c944d);};}exports['register']=function(_0x49ddff){for(var _0x55adba=0x0,_0x3742c5=events[_0x9ec3('0x5')];_0x55adba<_0x3742c5;_0x55adba++){var _0x29a6a2=events[_0x55adba];var _0x595e3a=createListener(_0x9ec3('0x6')+_0x29a6a2,_0x49ddff);FaxQueueEvents['on'](_0x29a6a2,_0x595e3a);}};
\ No newline at end of file
index d4e894e..263be3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf55=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeTeams'];(function(_0xb39181,_0x1f207a){var _0x2ccf32=function(_0x3d2815){while(--_0x3d2815){_0xb39181['push'](_0xb39181['shift']());}};_0x2ccf32(++_0x1f207a);}(_0xdf55,0x83));var _0x5df5=function(_0x588370,_0x4563b9){_0x588370=_0x588370-0x0;var _0x1b0dc1=_0xdf55[_0x588370];return _0x1b0dc1;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['get']('/:id/members',auth[_0x5df5('0x9')](),controller['getMembers']);router[_0x5df5('0x8')](_0x5df5('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0x5df5('0x8')](_0x5df5('0x10'),auth[_0x5df5('0x9')](),controller[_0x5df5('0x11')]);router[_0x5df5('0x12')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0x13')]);router[_0x5df5('0x12')](_0x5df5('0xf'),auth[_0x5df5('0x9')](),controller['addTeams']);router[_0x5df5('0x12')]('/:id/users',auth[_0x5df5('0x9')](),controller[_0x5df5('0x14')]);router[_0x5df5('0x15')](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller['update']);router[_0x5df5('0x16')](_0x5df5('0xd'),auth['isAuthenticated'](),controller[_0x5df5('0x17')]);router[_0x5df5('0x16')](_0x5df5('0xf'),auth[_0x5df5('0x9')](),controller[_0x5df5('0x18')]);router['delete']('/:id/users',auth[_0x5df5('0x9')](),controller['removeAgents']);module[_0x5df5('0x19')]=router;
\ No newline at end of file
+var _0xde46=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x583453,_0x1ce51c){var _0x4169de=function(_0x1296e5){while(--_0x1296e5){_0x583453['push'](_0x583453['shift']());}};_0x4169de(++_0x1ce51c);}(_0xde46,0x14e));var _0x6de4=function(_0x20b441,_0x30e600){_0x20b441=_0x20b441-0x0;var _0x18d5ed=_0xde46[_0x20b441];return _0x18d5ed;};'use strict';var multer=require(_0x6de4('0x0'));var util=require(_0x6de4('0x1'));var path=require(_0x6de4('0x2'));var timeout=require(_0x6de4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6de4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6de4('0x5'));var config=require(_0x6de4('0x6'));var controller=require(_0x6de4('0x7'));router[_0x6de4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6de4('0x8')]('/describe',auth[_0x6de4('0x9')](),controller[_0x6de4('0xa')]);router['get'](_0x6de4('0xb'),auth[_0x6de4('0x9')](),controller[_0x6de4('0xc')]);router[_0x6de4('0x8')](_0x6de4('0xd'),auth[_0x6de4('0x9')](),controller[_0x6de4('0xe')]);router[_0x6de4('0x8')](_0x6de4('0xf'),auth[_0x6de4('0x9')](),controller[_0x6de4('0x10')]);router['get'](_0x6de4('0x11'),auth[_0x6de4('0x9')](),controller[_0x6de4('0x12')]);router[_0x6de4('0x13')]('/',auth[_0x6de4('0x9')](),controller[_0x6de4('0x14')]);router[_0x6de4('0x13')](_0x6de4('0xf'),auth['isAuthenticated'](),controller[_0x6de4('0x15')]);router['post'](_0x6de4('0x11'),auth[_0x6de4('0x9')](),controller[_0x6de4('0x16')]);router['put'](_0x6de4('0xb'),auth[_0x6de4('0x9')](),controller[_0x6de4('0x17')]);router[_0x6de4('0x18')]('/:id',auth[_0x6de4('0x9')](),controller['destroy']);router['delete'](_0x6de4('0xf'),auth[_0x6de4('0x9')](),controller[_0x6de4('0x19')]);router[_0x6de4('0x18')](_0x6de4('0x11'),auth[_0x6de4('0x9')](),controller[_0x6de4('0x1a')]);module[_0x6de4('0x1b')]=router;
\ No newline at end of file
index 8ba7d11..b2343d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc918=['DATE','moment','sequelize','STRING'];(function(_0x5bd4f6,_0xf4e45c){var _0x33a165=function(_0x37eef6){while(--_0x37eef6){_0x5bd4f6['push'](_0x5bd4f6['shift']());}};_0x33a165(++_0xf4e45c);}(_0xc918,0xb9));var _0x8c91=function(_0xecce22,_0x41ab5d){_0xecce22=_0xecce22-0x0;var _0x51446e=_0xc918[_0xecce22];return _0x51446e;};'use strict';var moment=require(_0x8c91('0x0'));var Sequelize=require(_0x8c91('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8c91('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8c91('0x3')]},'leaveAt':{'type':Sequelize[_0x8c91('0x3')]},'acceptAt':{'type':Sequelize[_0x8c91('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8c91('0x2')]}};
\ No newline at end of file
+var _0x5e1f=['STRING','DATE','moment','sequelize','exports'];(function(_0xce9033,_0x30fbef){var _0x314c7d=function(_0x5ef099){while(--_0x5ef099){_0xce9033['push'](_0xce9033['shift']());}};_0x314c7d(++_0x30fbef);}(_0x5e1f,0xde));var _0xf5e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e1f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xf5e1('0x0'));var Sequelize=require(_0xf5e1('0x1'));module[_0xf5e1('0x2')]={'uniqueid':{'type':Sequelize[_0xf5e1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf5e1('0x3')]},'joinAt':{'type':Sequelize[_0xf5e1('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf5e1('0x4')]},'exitAt':{'type':Sequelize[_0xf5e1('0x4')]},'reason':{'type':Sequelize[_0xf5e1('0x3')]}};
\ No newline at end of file
index 19aa7d7..0a0b8a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf296=['create','body','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find'];(function(_0x3503ca,_0x2b78be){var _0x19ce65=function(_0x1a55bd){while(--_0x1a55bd){_0x3503ca['push'](_0x3503ca['shift']());}};_0x19ce65(++_0x2b78be);}(_0xf296,0x94));var _0x6f29=function(_0x3e1226,_0x4199d6){_0x3e1226=_0x3e1226-0x0;var _0x1ff634=_0xf296[_0x3e1226];return _0x1ff634;};'use strict';var emlformat=require(_0x6f29('0x0'));var rimraf=require(_0x6f29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f29('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6f29('0x3'));var Mustache=require(_0x6f29('0x4'));var util=require('util');var path=require(_0x6f29('0x5'));var sox=require(_0x6f29('0x6'));var csv=require(_0x6f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f29('0x8'));var _=require(_0x6f29('0x9'));var squel=require('squel');var crypto=require(_0x6f29('0xa'));var jsforce=require(_0x6f29('0xb'));var deskjs=require(_0x6f29('0xc'));var toCsv=require(_0x6f29('0x7'));var querystring=require(_0x6f29('0xd'));var Papa=require(_0x6f29('0xe'));var Redis=require(_0x6f29('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6f29('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6f29('0x11'));var utils=require('../../config/utils');var config=require(_0x6f29('0x12'));var licenseUtil=require(_0x6f29('0x13'));var db=require(_0x6f29('0x14'))['db'];function respondWithStatusCode(_0x56e2a4,_0x1ce6a2){_0x1ce6a2=_0x1ce6a2||0xcc;return function(_0x3cec2a){if(_0x3cec2a){return _0x56e2a4[_0x6f29('0x15')](_0x1ce6a2);}return _0x56e2a4[_0x6f29('0x16')](_0x1ce6a2)[_0x6f29('0x17')]();};}function respondWithResult(_0x4b9304,_0x429604){_0x429604=_0x429604||0xc8;return function(_0x115d08){if(_0x115d08){return _0x4b9304[_0x6f29('0x16')](_0x429604)['json'](_0x115d08);}};}function respondWithFilteredResult(_0x3602e4,_0x50e0d6){return function(_0x3959e4){if(_0x3959e4){var _0x2907e4=typeof _0x50e0d6[_0x6f29('0x18')]===_0x6f29('0x19')&&typeof _0x50e0d6['limit']==='undefined';var _0x28995e=_0x3959e4[_0x6f29('0x1a')];var _0x5b524d=_0x2907e4?0x0:_0x50e0d6['offset'];var _0x30e10f=_0x2907e4?_0x3959e4[_0x6f29('0x1a')]:_0x50e0d6[_0x6f29('0x18')]+_0x50e0d6[_0x6f29('0x1b')];var _0x29b580;if(_0x30e10f>=_0x28995e){_0x30e10f=_0x28995e;_0x29b580=0xc8;}else{_0x29b580=0xce;}_0x3602e4['status'](_0x29b580);return _0x3602e4[_0x6f29('0x1c')](_0x6f29('0x1d'),_0x5b524d+'-'+_0x30e10f+'/'+_0x28995e)[_0x6f29('0x1e')](_0x3959e4);}return null;};}function patchUpdates(_0x33afa3){return function(_0x1f7c53){try{jsonpatch[_0x6f29('0x1f')](_0x1f7c53,_0x33afa3,!![]);}catch(_0x56ca2d){return BPromise['reject'](_0x56ca2d);}return _0x1f7c53[_0x6f29('0x20')]();};}function saveUpdates(_0x430dc8,_0xf7309){return function(_0x4924ca){if(_0x4924ca){return _0x4924ca[_0x6f29('0x21')](_0x430dc8)[_0x6f29('0x22')](function(_0x1ae43e){return _0x1ae43e;});}return null;};}function removeEntity(_0x3e9977,_0x16eaa9){return function(_0x9d7eda){if(_0x9d7eda){return _0x9d7eda['destroy']()[_0x6f29('0x22')](function(){_0x3e9977[_0x6f29('0x16')](0xcc)[_0x6f29('0x17')]();});}};}function handleEntityNotFound(_0x54c05b,_0x5883e3){return function(_0x4fa5f9){if(!_0x4fa5f9){_0x54c05b[_0x6f29('0x15')](0x194);}return _0x4fa5f9;};}function handleError(_0x2593ba,_0x1b0ff7){_0x1b0ff7=_0x1b0ff7||0x1f4;return function(_0x301406){logger[_0x6f29('0x23')](_0x301406[_0x6f29('0x24')]);if(_0x301406[_0x6f29('0x25')]){delete _0x301406[_0x6f29('0x25')];}_0x2593ba['status'](_0x1b0ff7)[_0x6f29('0x26')](_0x301406);};}exports[_0x6f29('0x27')]=function(_0x4ceaea,_0x18f379){var _0x8e0348={},_0x3c6d71={},_0x305367={'count':0x0,'rows':[]};var _0x315116=_['map'](db[_0x6f29('0x28')][_0x6f29('0x29')],function(_0x5b57a3){return{'name':_0x5b57a3[_0x6f29('0x2a')],'type':_0x5b57a3[_0x6f29('0x2b')]['key']};});_0x3c6d71[_0x6f29('0x2c')]=_['map'](_0x315116,_0x6f29('0x25'));_0x3c6d71[_0x6f29('0x2d')]=_[_0x6f29('0x2e')](_0x4ceaea['query']);_0x3c6d71[_0x6f29('0x2f')]=_[_0x6f29('0x30')](_0x3c6d71[_0x6f29('0x2c')],_0x3c6d71['query']);_0x8e0348[_0x6f29('0x31')]=_[_0x6f29('0x30')](_0x3c6d71['model'],qs[_0x6f29('0x32')](_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x32')]));_0x8e0348[_0x6f29('0x31')]=_0x8e0348[_0x6f29('0x31')][_0x6f29('0x33')]?_0x8e0348[_0x6f29('0x31')]:_0x3c6d71[_0x6f29('0x2c')];if(!_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x34')]('nolimit')){_0x8e0348['limit']=qs[_0x6f29('0x1b')](_0x4ceaea['query'][_0x6f29('0x1b')]);_0x8e0348[_0x6f29('0x18')]=qs[_0x6f29('0x18')](_0x4ceaea['query'][_0x6f29('0x18')]);}_0x8e0348[_0x6f29('0x35')]=qs['sort'](_0x4ceaea[_0x6f29('0x2d')]['sort']);_0x8e0348[_0x6f29('0x36')]=qs[_0x6f29('0x2f')](_[_0x6f29('0x37')](_0x4ceaea['query'],_0x3c6d71[_0x6f29('0x2f')]),_0x315116);if(_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x38')]){_0x8e0348[_0x6f29('0x36')]=_[_0x6f29('0x39')](_0x8e0348[_0x6f29('0x36')],{'$or':_[_0x6f29('0x3a')](_0x315116,function(_0x2ebc0a){if(_0x2ebc0a[_0x6f29('0x2b')]!==_0x6f29('0x3b')){var _0x314004={};_0x314004[_0x2ebc0a[_0x6f29('0x25')]]={'$like':'%'+_0x4ceaea[_0x6f29('0x2d')]['filter']+'%'};return _0x314004;}})});}_0x8e0348=_['merge']({},_0x8e0348,_0x4ceaea[_0x6f29('0x3c')]);var _0x319ed2={'where':_0x8e0348[_0x6f29('0x36')]};return db[_0x6f29('0x28')][_0x6f29('0x1a')](_0x319ed2)[_0x6f29('0x22')](function(_0x1c3ed6){_0x305367['count']=_0x1c3ed6;if(_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x3d')]){_0x8e0348['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x6f29('0x3e')](_0x8e0348);})['then'](function(_0x35e4c2){_0x305367[_0x6f29('0x3f')]=_0x35e4c2;return _0x305367;})[_0x6f29('0x22')](respondWithFilteredResult(_0x18f379,_0x8e0348))[_0x6f29('0x40')](handleError(_0x18f379,null));};exports['show']=function(_0x4eb78d,_0x320b64){var _0x12ab79={'raw':!![],'where':{'id':_0x4eb78d[_0x6f29('0x41')]['id']}},_0x41d214={};_0x41d214[_0x6f29('0x2c')]=_[_0x6f29('0x2e')](db['FaxQueueReport'][_0x6f29('0x29')]);_0x41d214[_0x6f29('0x2d')]=_['keys'](_0x4eb78d[_0x6f29('0x2d')]);_0x41d214[_0x6f29('0x2f')]=_[_0x6f29('0x30')](_0x41d214[_0x6f29('0x2c')],_0x41d214[_0x6f29('0x2d')]);_0x12ab79[_0x6f29('0x31')]=_[_0x6f29('0x30')](_0x41d214[_0x6f29('0x2c')],qs[_0x6f29('0x32')](_0x4eb78d[_0x6f29('0x2d')][_0x6f29('0x32')]));_0x12ab79[_0x6f29('0x31')]=_0x12ab79[_0x6f29('0x31')][_0x6f29('0x33')]?_0x12ab79['attributes']:_0x41d214[_0x6f29('0x2c')];if(_0x4eb78d[_0x6f29('0x2d')]['includeAll']){_0x12ab79[_0x6f29('0x42')]=[{'all':!![]}];}_0x12ab79=_[_0x6f29('0x39')]({},_0x12ab79,_0x4eb78d[_0x6f29('0x3c')]);return db['FaxQueueReport'][_0x6f29('0x43')](_0x12ab79)[_0x6f29('0x22')](handleEntityNotFound(_0x320b64,null))['then'](respondWithResult(_0x320b64,null))[_0x6f29('0x40')](handleError(_0x320b64,null));};exports[_0x6f29('0x44')]=function(_0x2c97e7,_0x9e10e){return db[_0x6f29('0x28')][_0x6f29('0x44')](_0x2c97e7[_0x6f29('0x45')],{})[_0x6f29('0x22')](respondWithResult(_0x9e10e,0xc9))['catch'](handleError(_0x9e10e,null));};exports[_0x6f29('0x21')]=function(_0x27d36f,_0x1042c9){if(_0x27d36f[_0x6f29('0x45')]['id']){delete _0x27d36f[_0x6f29('0x45')]['id'];}return db['FaxQueueReport'][_0x6f29('0x43')]({'where':{'id':_0x27d36f[_0x6f29('0x41')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x1042c9,null))[_0x6f29('0x22')](saveUpdates(_0x27d36f['body'],null))[_0x6f29('0x22')](respondWithResult(_0x1042c9,null))[_0x6f29('0x40')](handleError(_0x1042c9,null));};exports[_0x6f29('0x46')]=function(_0x341f64,_0x58f431){return db[_0x6f29('0x28')][_0x6f29('0x43')]({'where':{'id':_0x341f64[_0x6f29('0x41')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x58f431,null))['then'](removeEntity(_0x58f431,null))['catch'](handleError(_0x58f431,null));};exports[_0x6f29('0x47')]=function(_0x117ffb,_0x436fb4){return db[_0x6f29('0x28')][_0x6f29('0x47')]()[_0x6f29('0x22')](respondWithResult(_0x436fb4,null))[_0x6f29('0x40')](handleError(_0x436fb4,null));};
\ No newline at end of file
+var _0x6d2e=['where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','FaxQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','sort'];(function(_0x833864,_0x53d6ff){var _0xc12c2d=function(_0x15b9cf){while(--_0x15b9cf){_0x833864['push'](_0x833864['shift']());}};_0xc12c2d(++_0x53d6ff);}(_0x6d2e,0x97));var _0xe6d2=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x6d2e[_0x27638d];return _0x35da35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6d2('0x0'));var zipdir=require(_0xe6d2('0x1'));var jsonpatch=require(_0xe6d2('0x2'));var rp=require(_0xe6d2('0x3'));var moment=require(_0xe6d2('0x4'));var BPromise=require(_0xe6d2('0x5'));var Mustache=require('mustache');var util=require(_0xe6d2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe6d2('0x7'));var ejs=require(_0xe6d2('0x8'));var fs=require('fs');var fs_extra=require(_0xe6d2('0x9'));var _=require('lodash');var squel=require(_0xe6d2('0xa'));var crypto=require('crypto');var jsforce=require(_0xe6d2('0xb'));var deskjs=require(_0xe6d2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe6d2('0xd'));var Papa=require(_0xe6d2('0xe'));var Redis=require('ioredis');var authService=require(_0xe6d2('0xf'));var qs=require(_0xe6d2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6d2('0x11'));var logger=require(_0xe6d2('0x12'))(_0xe6d2('0x13'));var utils=require(_0xe6d2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe6d2('0x15'));var db=require(_0xe6d2('0x16'))['db'];function respondWithStatusCode(_0x5ca636,_0x1c3dd5){_0x1c3dd5=_0x1c3dd5||0xcc;return function(_0x280b33){if(_0x280b33){return _0x5ca636['sendStatus'](_0x1c3dd5);}return _0x5ca636[_0xe6d2('0x17')](_0x1c3dd5)[_0xe6d2('0x18')]();};}function respondWithResult(_0x3068a9,_0x11a5f9){_0x11a5f9=_0x11a5f9||0xc8;return function(_0x208de4){if(_0x208de4){return _0x3068a9[_0xe6d2('0x17')](_0x11a5f9)[_0xe6d2('0x19')](_0x208de4);}};}function respondWithFilteredResult(_0x39db45,_0x22ade6){return function(_0xbe7cb9){if(_0xbe7cb9){var _0xf6a43e=typeof _0x22ade6[_0xe6d2('0x1a')]===_0xe6d2('0x1b')&&typeof _0x22ade6[_0xe6d2('0x1c')]===_0xe6d2('0x1b');var _0x55590d=_0xbe7cb9[_0xe6d2('0x1d')];var _0x35cc9c=_0xf6a43e?0x0:_0x22ade6[_0xe6d2('0x1a')];var _0x242bcb=_0xf6a43e?_0xbe7cb9[_0xe6d2('0x1d')]:_0x22ade6[_0xe6d2('0x1a')]+_0x22ade6[_0xe6d2('0x1c')];var _0x463ab1;if(_0x242bcb>=_0x55590d){_0x242bcb=_0x55590d;_0x463ab1=0xc8;}else{_0x463ab1=0xce;}_0x39db45['status'](_0x463ab1);return _0x39db45[_0xe6d2('0x1e')](_0xe6d2('0x1f'),_0x35cc9c+'-'+_0x242bcb+'/'+_0x55590d)['json'](_0xbe7cb9);}return null;};}function patchUpdates(_0x3da7b1){return function(_0x41032e){try{jsonpatch[_0xe6d2('0x20')](_0x41032e,_0x3da7b1,!![]);}catch(_0x4f2e5d){return BPromise[_0xe6d2('0x21')](_0x4f2e5d);}return _0x41032e['save']();};}function saveUpdates(_0x2d5acf,_0xa4fac9){return function(_0x2f374f){if(_0x2f374f){return _0x2f374f[_0xe6d2('0x22')](_0x2d5acf)[_0xe6d2('0x23')](function(_0xb05d8c){return _0xb05d8c;});}return null;};}function removeEntity(_0x4068bc,_0x3f5fc1){return function(_0x20c23f){if(_0x20c23f){return _0x20c23f['destroy']()[_0xe6d2('0x23')](function(){_0x4068bc[_0xe6d2('0x17')](0xcc)[_0xe6d2('0x18')]();});}};}function handleEntityNotFound(_0x1de5b3,_0xe3bfb0){return function(_0x5d327a){if(!_0x5d327a){_0x1de5b3['sendStatus'](0x194);}return _0x5d327a;};}function handleError(_0x4f1ccd,_0x1b4cad){_0x1b4cad=_0x1b4cad||0x1f4;return function(_0x4700b5){logger[_0xe6d2('0x24')](_0x4700b5[_0xe6d2('0x25')]);if(_0x4700b5[_0xe6d2('0x26')]){delete _0x4700b5[_0xe6d2('0x26')];}_0x4f1ccd[_0xe6d2('0x17')](_0x1b4cad)['send'](_0x4700b5);};}exports[_0xe6d2('0x27')]=function(_0x5d8299,_0x113540){var _0x2a811f={},_0x15b607={},_0x31d894={'count':0x0,'rows':[]};var _0x2dceba=_[_0xe6d2('0x28')](db[_0xe6d2('0x29')][_0xe6d2('0x2a')],function(_0x32056f){return{'name':_0x32056f['fieldName'],'type':_0x32056f[_0xe6d2('0x2b')][_0xe6d2('0x2c')]};});_0x15b607[_0xe6d2('0x2d')]=_[_0xe6d2('0x28')](_0x2dceba,'name');_0x15b607[_0xe6d2('0x2e')]=_[_0xe6d2('0x2f')](_0x5d8299[_0xe6d2('0x2e')]);_0x15b607[_0xe6d2('0x30')]=_[_0xe6d2('0x31')](_0x15b607['model'],_0x15b607[_0xe6d2('0x2e')]);_0x2a811f[_0xe6d2('0x32')]=_[_0xe6d2('0x31')](_0x15b607[_0xe6d2('0x2d')],qs[_0xe6d2('0x33')](_0x5d8299[_0xe6d2('0x2e')]['fields']));_0x2a811f[_0xe6d2('0x32')]=_0x2a811f[_0xe6d2('0x32')]['length']?_0x2a811f[_0xe6d2('0x32')]:_0x15b607[_0xe6d2('0x2d')];if(!_0x5d8299[_0xe6d2('0x2e')]['hasOwnProperty']('nolimit')){_0x2a811f[_0xe6d2('0x1c')]=qs[_0xe6d2('0x1c')](_0x5d8299[_0xe6d2('0x2e')]['limit']);_0x2a811f[_0xe6d2('0x1a')]=qs[_0xe6d2('0x1a')](_0x5d8299[_0xe6d2('0x2e')][_0xe6d2('0x1a')]);}_0x2a811f['order']=qs[_0xe6d2('0x34')](_0x5d8299[_0xe6d2('0x2e')][_0xe6d2('0x34')]);_0x2a811f[_0xe6d2('0x35')]=qs[_0xe6d2('0x30')](_['pick'](_0x5d8299['query'],_0x15b607[_0xe6d2('0x30')]),_0x2dceba);if(_0x5d8299[_0xe6d2('0x2e')][_0xe6d2('0x36')]){_0x2a811f[_0xe6d2('0x35')]=_[_0xe6d2('0x37')](_0x2a811f[_0xe6d2('0x35')],{'$or':_['map'](_0x2dceba,function(_0x2db295){if(_0x2db295[_0xe6d2('0x2b')]!=='VIRTUAL'){var _0x37c0bf={};_0x37c0bf[_0x2db295[_0xe6d2('0x26')]]={'$like':'%'+_0x5d8299[_0xe6d2('0x2e')][_0xe6d2('0x36')]+'%'};return _0x37c0bf;}})});}_0x2a811f=_['merge']({},_0x2a811f,_0x5d8299[_0xe6d2('0x38')]);var _0x4714a4={'where':_0x2a811f[_0xe6d2('0x35')]};return db[_0xe6d2('0x29')][_0xe6d2('0x1d')](_0x4714a4)[_0xe6d2('0x23')](function(_0x246b6a){_0x31d894[_0xe6d2('0x1d')]=_0x246b6a;if(_0x5d8299[_0xe6d2('0x2e')][_0xe6d2('0x39')]){_0x2a811f[_0xe6d2('0x3a')]=[{'all':!![]}];}return db[_0xe6d2('0x29')][_0xe6d2('0x3b')](_0x2a811f);})['then'](function(_0x3e21fc){_0x31d894[_0xe6d2('0x3c')]=_0x3e21fc;return _0x31d894;})[_0xe6d2('0x23')](respondWithFilteredResult(_0x113540,_0x2a811f))[_0xe6d2('0x3d')](handleError(_0x113540,null));};exports[_0xe6d2('0x3e')]=function(_0x235366,_0x49f673){var _0x1ca811={'raw':!![],'where':{'id':_0x235366[_0xe6d2('0x3f')]['id']}},_0x22eb15={};_0x22eb15[_0xe6d2('0x2d')]=_[_0xe6d2('0x2f')](db['FaxQueueReport']['rawAttributes']);_0x22eb15[_0xe6d2('0x2e')]=_[_0xe6d2('0x2f')](_0x235366[_0xe6d2('0x2e')]);_0x22eb15[_0xe6d2('0x30')]=_['intersection'](_0x22eb15[_0xe6d2('0x2d')],_0x22eb15[_0xe6d2('0x2e')]);_0x1ca811[_0xe6d2('0x32')]=_[_0xe6d2('0x31')](_0x22eb15[_0xe6d2('0x2d')],qs['fields'](_0x235366['query'][_0xe6d2('0x33')]));_0x1ca811[_0xe6d2('0x32')]=_0x1ca811[_0xe6d2('0x32')]['length']?_0x1ca811[_0xe6d2('0x32')]:_0x22eb15[_0xe6d2('0x2d')];if(_0x235366[_0xe6d2('0x2e')][_0xe6d2('0x39')]){_0x1ca811[_0xe6d2('0x3a')]=[{'all':!![]}];}_0x1ca811=_['merge']({},_0x1ca811,_0x235366[_0xe6d2('0x38')]);return db[_0xe6d2('0x29')][_0xe6d2('0x40')](_0x1ca811)['then'](handleEntityNotFound(_0x49f673,null))[_0xe6d2('0x23')](respondWithResult(_0x49f673,null))[_0xe6d2('0x3d')](handleError(_0x49f673,null));};exports[_0xe6d2('0x41')]=function(_0x29cd0e,_0x3c93b0){return db[_0xe6d2('0x29')][_0xe6d2('0x41')](_0x29cd0e['body'],{})[_0xe6d2('0x23')](respondWithResult(_0x3c93b0,0xc9))[_0xe6d2('0x3d')](handleError(_0x3c93b0,null));};exports[_0xe6d2('0x22')]=function(_0x3493f6,_0x3b7775){if(_0x3493f6[_0xe6d2('0x42')]['id']){delete _0x3493f6[_0xe6d2('0x42')]['id'];}return db[_0xe6d2('0x29')][_0xe6d2('0x40')]({'where':{'id':_0x3493f6[_0xe6d2('0x3f')]['id']}})[_0xe6d2('0x23')](handleEntityNotFound(_0x3b7775,null))[_0xe6d2('0x23')](saveUpdates(_0x3493f6[_0xe6d2('0x42')],null))[_0xe6d2('0x23')](respondWithResult(_0x3b7775,null))[_0xe6d2('0x3d')](handleError(_0x3b7775,null));};exports['destroy']=function(_0x26ff5f,_0x41552a){return db[_0xe6d2('0x29')]['find']({'where':{'id':_0x26ff5f[_0xe6d2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x41552a,null))['then'](removeEntity(_0x41552a,null))[_0xe6d2('0x3d')](handleError(_0x41552a,null));};exports[_0xe6d2('0x43')]=function(_0x26664c,_0x44b1f1){return db[_0xe6d2('0x29')]['describe']()['then'](respondWithResult(_0x44b1f1,null))[_0xe6d2('0x3d')](handleError(_0x44b1f1,null));};
\ No newline at end of file
index f53c887..cc7deaf 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(_0x43e9f9,_0x13bea9){var _0x159b8e=function(_0x44e720){while(--_0x44e720){_0x43e9f9['push'](_0x43e9f9['shift']());}};_0x159b8e(++_0x13bea9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'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 _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2af61a,_0x59d12e){var _0x3e92c7=function(_0x50e7e4){while(--_0x50e7e4){_0x2af61a['push'](_0x2af61a['shift']());}};_0x3e92c7(++_0x59d12e);}(_0x53ec,0x192));var _0xc53e=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x53ec[_0x54edc9];return _0x2ae7a9;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index e1a71a8..c13c1e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa207=['options','raw','then','catch','UpdateFaxQueueReport','update','body','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateFaxQueueReport','FaxQueueReport','create'];(function(_0x3b85d7,_0x2ac85d){var _0x2a5333=function(_0x4de215){while(--_0x4de215){_0x3b85d7['push'](_0x3b85d7['shift']());}};_0x2a5333(++_0x2ac85d);}(_0xa207,0x112));var _0x7a20=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa207[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x7a20('0x0'));var moment=require(_0x7a20('0x1'));var BPromise=require(_0x7a20('0x2'));var rs=require(_0x7a20('0x3'));var fs=require('fs');var Redis=require(_0x7a20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a20('0x5'));var logger=require('../../config/logger')(_0x7a20('0x6'));var config=require(_0x7a20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7a20('0x8')][_0x7a20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x281f8a,_0x171746,_0x532156){return new BPromise(function(_0x3d34fb,_0x3194a4){return client[_0x7a20('0xa')](_0x281f8a,_0x532156)['then'](function(_0x275dee){logger[_0x7a20('0xb')](_0x7a20('0xc'),_0x171746,'request\x20sent');logger[_0x7a20('0xd')](_0x7a20('0xe'),_0x171746,'request\x20sent',JSON[_0x7a20('0xf')](_0x275dee));if(_0x275dee['error']){if(_0x275dee['error'][_0x7a20('0x10')]===0x1f4){logger[_0x7a20('0x11')](_0x7a20('0xc'),_0x171746,_0x275dee[_0x7a20('0x11')][_0x7a20('0x12')]);return _0x3194a4(_0x275dee[_0x7a20('0x11')]['message']);}logger[_0x7a20('0x11')](_0x7a20('0xc'),_0x171746,_0x275dee[_0x7a20('0x11')][_0x7a20('0x12')]);return _0x3d34fb(_0x275dee['error'][_0x7a20('0x12')]);}else{logger[_0x7a20('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x171746,'request\x20sent');_0x3d34fb(_0x275dee[_0x7a20('0x13')][_0x7a20('0x12')]);}})['catch'](function(_0x1c1984){logger[_0x7a20('0x11')](_0x7a20('0xc'),_0x171746,_0x1c1984);_0x3194a4(_0x1c1984);});});}exports[_0x7a20('0x14')]=function(_0x1d66d1){var _0x4c0d04=this;return new Promise(function(_0x2127f1,_0x1cab73){return db[_0x7a20('0x15')][_0x7a20('0x16')](_0x1d66d1['body'],{'raw':_0x1d66d1[_0x7a20('0x17')]?_0x1d66d1[_0x7a20('0x17')][_0x7a20('0x18')]===undefined?!![]:![]:!![]})[_0x7a20('0x19')](function(_0x33026a){logger[_0x7a20('0xb')](_0x7a20('0x14'),_0x1d66d1);logger[_0x7a20('0xd')](_0x7a20('0x14'),_0x1d66d1,JSON[_0x7a20('0xf')](_0x33026a));_0x2127f1(_0x33026a);})[_0x7a20('0x1a')](function(_0x2fde62){logger[_0x7a20('0x11')]('CreateFaxQueueReport',_0x2fde62[_0x7a20('0x12')],_0x1d66d1);_0x1cab73(_0x4c0d04['error'](0x1f4,_0x2fde62[_0x7a20('0x12')]));});});};exports[_0x7a20('0x1b')]=function(_0x2d3b0){var _0x5eff3a=this;return new Promise(function(_0x41d935,_0x1dd8ab){return db[_0x7a20('0x15')][_0x7a20('0x1c')](_0x2d3b0[_0x7a20('0x1d')],{'raw':_0x2d3b0[_0x7a20('0x17')]?_0x2d3b0[_0x7a20('0x17')][_0x7a20('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d3b0[_0x7a20('0x17')]?_0x2d3b0[_0x7a20('0x17')][_0x7a20('0x1e')]||null:null,'attributes':_0x2d3b0[_0x7a20('0x17')]?_0x2d3b0[_0x7a20('0x17')][_0x7a20('0x1f')]||null:null,'limit':_0x2d3b0[_0x7a20('0x17')]?_0x2d3b0[_0x7a20('0x17')][_0x7a20('0x20')]||null:null})[_0x7a20('0x19')](function(_0x42b0e8){logger[_0x7a20('0xb')](_0x7a20('0x1b'),_0x2d3b0);logger[_0x7a20('0xd')]('UpdateFaxQueueReport',_0x2d3b0,JSON['stringify'](_0x42b0e8));_0x41d935(_0x42b0e8);})[_0x7a20('0x1a')](function(_0xa473d8){logger[_0x7a20('0x11')]('UpdateFaxQueueReport',_0xa473d8[_0x7a20('0x12')],_0x2d3b0);_0x1dd8ab(_0x5eff3a[_0x7a20('0x11')](0x1f4,_0xa473d8['message']));});});};
\ No newline at end of file
+var _0xadab=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','then','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','where','limit','util','moment','bluebird'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xadab,0xf2));var _0xbada=function(_0x1ac15c,_0x273d6e){_0x1ac15c=_0x1ac15c-0x0;var _0x5bfd19=_0xadab[_0x1ac15c];return _0x5bfd19;};'use strict';var _=require('lodash');var util=require(_0xbada('0x0'));var moment=require(_0xbada('0x1'));var BPromise=require(_0xbada('0x2'));var rs=require(_0xbada('0x3'));var fs=require('fs');var Redis=require(_0xbada('0x4'));var db=require(_0xbada('0x5'))['db'];var utils=require(_0xbada('0x6'));var logger=require(_0xbada('0x7'))('rpc');var config=require(_0xbada('0x8'));var jayson=require(_0xbada('0x9'));var client=jayson[_0xbada('0xa')][_0xbada('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x391539,_0x4fafc9,_0xad7c82){return new BPromise(function(_0x4361c6,_0x324e49){return client[_0xbada('0xc')](_0x391539,_0xad7c82)['then'](function(_0x3938eb){logger[_0xbada('0xd')](_0xbada('0xe'),_0x4fafc9,_0xbada('0xf'));logger[_0xbada('0x10')](_0xbada('0x11'),_0x4fafc9,'request\x20sent',JSON[_0xbada('0x12')](_0x3938eb));if(_0x3938eb[_0xbada('0x13')]){if(_0x3938eb[_0xbada('0x13')][_0xbada('0x14')]===0x1f4){logger[_0xbada('0x13')](_0xbada('0xe'),_0x4fafc9,_0x3938eb[_0xbada('0x13')][_0xbada('0x15')]);return _0x324e49(_0x3938eb[_0xbada('0x13')][_0xbada('0x15')]);}logger[_0xbada('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x4fafc9,_0x3938eb[_0xbada('0x13')][_0xbada('0x15')]);return _0x4361c6(_0x3938eb[_0xbada('0x13')][_0xbada('0x15')]);}else{logger[_0xbada('0xd')](_0xbada('0xe'),_0x4fafc9,_0xbada('0xf'));_0x4361c6(_0x3938eb[_0xbada('0x16')][_0xbada('0x15')]);}})[_0xbada('0x17')](function(_0x1c308d){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x4fafc9,_0x1c308d);_0x324e49(_0x1c308d);});});}exports['CreateFaxQueueReport']=function(_0x1c339d){var _0x1f51db=this;return new Promise(function(_0xfbee40,_0x39f7ca){return db['FaxQueueReport'][_0xbada('0x18')](_0x1c339d[_0xbada('0x19')],{'raw':_0x1c339d[_0xbada('0x1a')]?_0x1c339d['options'][_0xbada('0x1b')]===undefined?!![]:![]:!![]})[_0xbada('0x1c')](function(_0x40ade5){logger[_0xbada('0xd')](_0xbada('0x1d'),_0x1c339d);logger['debug']('CreateFaxQueueReport',_0x1c339d,JSON['stringify'](_0x40ade5));_0xfbee40(_0x40ade5);})['catch'](function(_0xd9d106){logger['error'](_0xbada('0x1d'),_0xd9d106[_0xbada('0x15')],_0x1c339d);_0x39f7ca(_0x1f51db[_0xbada('0x13')](0x1f4,_0xd9d106[_0xbada('0x15')]));});});};exports[_0xbada('0x1e')]=function(_0x51d1fd){var _0x58c530=this;return new Promise(function(_0x4a50cd,_0x33f177){return db[_0xbada('0x1f')][_0xbada('0x20')](_0x51d1fd[_0xbada('0x19')],{'raw':_0x51d1fd[_0xbada('0x1a')]?_0x51d1fd[_0xbada('0x1a')][_0xbada('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51d1fd[_0xbada('0x1a')]?_0x51d1fd[_0xbada('0x1a')][_0xbada('0x21')]||null:null,'attributes':_0x51d1fd[_0xbada('0x1a')]?_0x51d1fd[_0xbada('0x1a')]['attributes']||null:null,'limit':_0x51d1fd[_0xbada('0x1a')]?_0x51d1fd[_0xbada('0x1a')][_0xbada('0x22')]||null:null})[_0xbada('0x1c')](function(_0x5dd816){logger['info'](_0xbada('0x1e'),_0x51d1fd);logger[_0xbada('0x10')](_0xbada('0x1e'),_0x51d1fd,JSON[_0xbada('0x12')](_0x5dd816));_0x4a50cd(_0x5dd816);})['catch'](function(_0x48383f){logger[_0xbada('0x13')](_0xbada('0x1e'),_0x48383f[_0xbada('0x15')],_0x51d1fd);_0x33f177(_0x58c530[_0xbada('0x13')](0x1f4,_0x48383f[_0xbada('0x15')]));});});};
\ No newline at end of file
index 3ce9744..8010296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fc4=['fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x5e8dcb,_0x86993a){var _0x28b412=function(_0x454815){while(--_0x454815){_0x5e8dcb['push'](_0x5e8dcb['shift']());}};_0x28b412(++_0x86993a);}(_0x7fc4,0x19f));var _0x47fc=function(_0xe966d,_0x91c09b){_0xe966d=_0xe966d-0x0;var _0x39784d=_0x7fc4[_0xe966d];return _0x39784d;};'use strict';var multer=require('multer');var util=require(_0x47fc('0x0'));var path=require(_0x47fc('0x1'));var timeout=require(_0x47fc('0x2'));var express=require(_0x47fc('0x3'));var router=express[_0x47fc('0x4')]();var fs_extra=require(_0x47fc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x47fc('0x6'));var config=require(_0x47fc('0x7'));var controller=require(_0x47fc('0x8'));router[_0x47fc('0x9')]('/',auth[_0x47fc('0xa')](),controller[_0x47fc('0xb')]);router[_0x47fc('0x9')](_0x47fc('0xc'),auth[_0x47fc('0xa')](),controller[_0x47fc('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x47fc('0xe')]);router[_0x47fc('0xf')]('/',auth[_0x47fc('0xa')](),controller[_0x47fc('0x10')]);router[_0x47fc('0x11')](_0x47fc('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x47fc('0x12'),auth[_0x47fc('0xa')](),controller[_0x47fc('0x13')]);module[_0x47fc('0x14')]=router;
\ No newline at end of file
+var _0x7a80=['/:id','show','post','create','put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x5f2310,_0x5d7c83){var _0x5c3f18=function(_0x4aa380){while(--_0x4aa380){_0x5f2310['push'](_0x5f2310['shift']());}};_0x5c3f18(++_0x5d7c83);}(_0x7a80,0xf0));var _0x07a8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7a80[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x07a8('0x0'));var timeout=require(_0x07a8('0x1'));var express=require(_0x07a8('0x2'));var router=express[_0x07a8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x07a8('0x4'));var interaction=require(_0x07a8('0x5'));var config=require(_0x07a8('0x6'));var controller=require('./faxQueueReport.controller');router[_0x07a8('0x7')]('/',auth['isAuthenticated'](),controller[_0x07a8('0x8')]);router[_0x07a8('0x7')](_0x07a8('0x9'),auth[_0x07a8('0xa')](),controller[_0x07a8('0xb')]);router[_0x07a8('0x7')](_0x07a8('0xc'),auth[_0x07a8('0xa')](),controller[_0x07a8('0xd')]);router[_0x07a8('0xe')]('/',auth[_0x07a8('0xa')](),controller[_0x07a8('0xf')]);router[_0x07a8('0x10')](_0x07a8('0xc'),auth[_0x07a8('0xa')](),controller[_0x07a8('0x11')]);router['delete'](_0x07a8('0xc'),auth[_0x07a8('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index f42d3f4..53ed96d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x23fd19,_0x34b399){var _0x583ad9=function(_0x4a9096){while(--_0x4a9096){_0x23fd19['push'](_0x23fd19['shift']());}};_0x583ad9(++_0x34b399);}(_0x70e0,0x17b));var _0x070e=function(_0x332374,_0x42d01d){_0x332374=_0x332374-0x0;var _0x982bfd=_0x70e0[_0x332374];return _0x982bfd;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5e6dcc,_0x43e8b0){_0x5e6dcc=_0x5e6dcc-0x0;var _0x4bb06b=_0x9bde[_0x5e6dcc];return _0x4bb06b;};'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
index 0138455..587011b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9a1=['length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','FaxTransferReport','rows','catch','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','end','sendStatus','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes'];(function(_0x461bd9,_0x289683){var _0x150fae=function(_0x5c4624){while(--_0x5c4624){_0x461bd9['push'](_0x461bd9['shift']());}};_0x150fae(++_0x289683);}(_0xf9a1,0x199));var _0x1f9a=function(_0x216afc,_0x50e91f){_0x216afc=_0x216afc-0x0;var _0x39608b=_0xf9a1[_0x216afc];return _0x39608b;};'use strict';var emlformat=require(_0x1f9a('0x0'));var rimraf=require(_0x1f9a('0x1'));var zipdir=require(_0x1f9a('0x2'));var jsonpatch=require(_0x1f9a('0x3'));var rp=require(_0x1f9a('0x4'));var moment=require(_0x1f9a('0x5'));var BPromise=require(_0x1f9a('0x6'));var Mustache=require('mustache');var util=require(_0x1f9a('0x7'));var path=require(_0x1f9a('0x8'));var sox=require(_0x1f9a('0x9'));var csv=require(_0x1f9a('0xa'));var ejs=require(_0x1f9a('0xb'));var fs=require('fs');var fs_extra=require(_0x1f9a('0xc'));var _=require(_0x1f9a('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1f9a('0xe'));var deskjs=require(_0x1f9a('0xf'));var toCsv=require(_0x1f9a('0xa'));var querystring=require(_0x1f9a('0x10'));var Papa=require(_0x1f9a('0x11'));var Redis=require(_0x1f9a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1f9a('0x13'));var as=require(_0x1f9a('0x14'));var hardwareService=require(_0x1f9a('0x15'));var logger=require(_0x1f9a('0x16'))(_0x1f9a('0x17'));var utils=require(_0x1f9a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1f9a('0x19'));var db=require(_0x1f9a('0x1a'))['db'];function respondWithStatusCode(_0x48ce2c,_0x540ff4){_0x540ff4=_0x540ff4||0xcc;return function(_0x4bb783){if(_0x4bb783){return _0x48ce2c['sendStatus'](_0x540ff4);}return _0x48ce2c[_0x1f9a('0x1b')](_0x540ff4)['end']();};}function respondWithResult(_0x4fc8df,_0x506409){_0x506409=_0x506409||0xc8;return function(_0x49e5cb){if(_0x49e5cb){return _0x4fc8df[_0x1f9a('0x1b')](_0x506409)[_0x1f9a('0x1c')](_0x49e5cb);}};}function respondWithFilteredResult(_0x54fbf2,_0x27c1c0){return function(_0x3021bf){if(_0x3021bf){var _0x10f862=typeof _0x27c1c0[_0x1f9a('0x1d')]===_0x1f9a('0x1e')&&typeof _0x27c1c0['limit']==='undefined';var _0x4ac107=_0x3021bf[_0x1f9a('0x1f')];var _0x1f3a88=_0x10f862?0x0:_0x27c1c0[_0x1f9a('0x1d')];var _0x616623=_0x10f862?_0x3021bf[_0x1f9a('0x1f')]:_0x27c1c0[_0x1f9a('0x1d')]+_0x27c1c0['limit'];var _0x4f1739;if(_0x616623>=_0x4ac107){_0x616623=_0x4ac107;_0x4f1739=0xc8;}else{_0x4f1739=0xce;}_0x54fbf2['status'](_0x4f1739);return _0x54fbf2[_0x1f9a('0x20')](_0x1f9a('0x21'),_0x1f3a88+'-'+_0x616623+'/'+_0x4ac107)[_0x1f9a('0x1c')](_0x3021bf);}return null;};}function patchUpdates(_0x6d43c1){return function(_0x10f282){try{jsonpatch[_0x1f9a('0x22')](_0x10f282,_0x6d43c1,!![]);}catch(_0x2ae96b){return BPromise[_0x1f9a('0x23')](_0x2ae96b);}return _0x10f282['save']();};}function saveUpdates(_0x52e809,_0x3b2ed8){return function(_0x48e239){if(_0x48e239){return _0x48e239['update'](_0x52e809)[_0x1f9a('0x24')](function(_0x3c7ea3){return _0x3c7ea3;});}return null;};}function removeEntity(_0x25f85a,_0x2cca6f){return function(_0x43f56b){if(_0x43f56b){return _0x43f56b[_0x1f9a('0x25')]()[_0x1f9a('0x24')](function(){_0x25f85a[_0x1f9a('0x1b')](0xcc)[_0x1f9a('0x26')]();});}};}function handleEntityNotFound(_0x218431,_0x1530da){return function(_0xe42bda){if(!_0xe42bda){_0x218431[_0x1f9a('0x27')](0x194);}return _0xe42bda;};}function handleError(_0x4a1a97,_0x172803){_0x172803=_0x172803||0x1f4;return function(_0x56d518){logger[_0x1f9a('0x28')](_0x56d518[_0x1f9a('0x29')]);if(_0x56d518[_0x1f9a('0x2a')]){delete _0x56d518[_0x1f9a('0x2a')];}_0x4a1a97[_0x1f9a('0x1b')](_0x172803)['send'](_0x56d518);};}exports['index']=function(_0x5ebd68,_0x2b2ed9){var _0x3dbf15={},_0x670d9b={},_0x4d773c={'count':0x0,'rows':[]};var _0x11e083=_['map'](db['FaxTransferReport'][_0x1f9a('0x2b')],function(_0x2f80a6){return{'name':_0x2f80a6[_0x1f9a('0x2c')],'type':_0x2f80a6[_0x1f9a('0x2d')][_0x1f9a('0x2e')]};});_0x670d9b[_0x1f9a('0x2f')]=_[_0x1f9a('0x30')](_0x11e083,_0x1f9a('0x2a'));_0x670d9b[_0x1f9a('0x31')]=_['keys'](_0x5ebd68[_0x1f9a('0x31')]);_0x670d9b['filters']=_[_0x1f9a('0x32')](_0x670d9b[_0x1f9a('0x2f')],_0x670d9b[_0x1f9a('0x31')]);_0x3dbf15['attributes']=_[_0x1f9a('0x32')](_0x670d9b[_0x1f9a('0x2f')],qs[_0x1f9a('0x33')](_0x5ebd68[_0x1f9a('0x31')][_0x1f9a('0x33')]));_0x3dbf15[_0x1f9a('0x34')]=_0x3dbf15['attributes'][_0x1f9a('0x35')]?_0x3dbf15[_0x1f9a('0x34')]:_0x670d9b[_0x1f9a('0x2f')];if(!_0x5ebd68['query'][_0x1f9a('0x36')](_0x1f9a('0x37'))){_0x3dbf15['limit']=qs[_0x1f9a('0x38')](_0x5ebd68[_0x1f9a('0x31')]['limit']);_0x3dbf15[_0x1f9a('0x1d')]=qs[_0x1f9a('0x1d')](_0x5ebd68[_0x1f9a('0x31')][_0x1f9a('0x1d')]);}_0x3dbf15[_0x1f9a('0x39')]=qs[_0x1f9a('0x3a')](_0x5ebd68[_0x1f9a('0x31')][_0x1f9a('0x3a')]);_0x3dbf15[_0x1f9a('0x3b')]=qs[_0x1f9a('0x3c')](_[_0x1f9a('0x3d')](_0x5ebd68[_0x1f9a('0x31')],_0x670d9b[_0x1f9a('0x3c')]),_0x11e083);if(_0x5ebd68[_0x1f9a('0x31')][_0x1f9a('0x3e')]){_0x3dbf15[_0x1f9a('0x3b')]=_[_0x1f9a('0x3f')](_0x3dbf15[_0x1f9a('0x3b')],{'$or':_['map'](_0x11e083,function(_0x5971e3){if(_0x5971e3['type']!==_0x1f9a('0x40')){var _0x5f715b={};_0x5f715b[_0x5971e3['name']]={'$like':'%'+_0x5ebd68[_0x1f9a('0x31')][_0x1f9a('0x3e')]+'%'};return _0x5f715b;}})});}_0x3dbf15=_[_0x1f9a('0x3f')]({},_0x3dbf15,_0x5ebd68['options']);var _0x34d95c={'where':_0x3dbf15[_0x1f9a('0x3b')]};return db['FaxTransferReport'][_0x1f9a('0x1f')](_0x34d95c)[_0x1f9a('0x24')](function(_0x2a43ff){_0x4d773c[_0x1f9a('0x1f')]=_0x2a43ff;if(_0x5ebd68['query'][_0x1f9a('0x41')]){_0x3dbf15[_0x1f9a('0x42')]=[{'all':!![]}];}return db[_0x1f9a('0x43')]['findAll'](_0x3dbf15);})[_0x1f9a('0x24')](function(_0x51779e){_0x4d773c[_0x1f9a('0x44')]=_0x51779e;return _0x4d773c;})[_0x1f9a('0x24')](respondWithFilteredResult(_0x2b2ed9,_0x3dbf15))[_0x1f9a('0x45')](handleError(_0x2b2ed9,null));};exports['show']=function(_0x8ff14f,_0x5657b7){var _0x1c401c={'raw':!![],'where':{'id':_0x8ff14f['params']['id']}},_0x4a1664={};_0x4a1664[_0x1f9a('0x2f')]=_[_0x1f9a('0x46')](db['FaxTransferReport']['rawAttributes']);_0x4a1664[_0x1f9a('0x31')]=_[_0x1f9a('0x46')](_0x8ff14f[_0x1f9a('0x31')]);_0x4a1664['filters']=_[_0x1f9a('0x32')](_0x4a1664[_0x1f9a('0x2f')],_0x4a1664['query']);_0x1c401c[_0x1f9a('0x34')]=_['intersection'](_0x4a1664[_0x1f9a('0x2f')],qs['fields'](_0x8ff14f[_0x1f9a('0x31')][_0x1f9a('0x33')]));_0x1c401c['attributes']=_0x1c401c[_0x1f9a('0x34')]['length']?_0x1c401c[_0x1f9a('0x34')]:_0x4a1664[_0x1f9a('0x2f')];if(_0x8ff14f[_0x1f9a('0x31')][_0x1f9a('0x41')]){_0x1c401c[_0x1f9a('0x42')]=[{'all':!![]}];}_0x1c401c=_[_0x1f9a('0x3f')]({},_0x1c401c,_0x8ff14f['options']);return db[_0x1f9a('0x43')][_0x1f9a('0x47')](_0x1c401c)[_0x1f9a('0x24')](handleEntityNotFound(_0x5657b7,null))[_0x1f9a('0x24')](respondWithResult(_0x5657b7,null))[_0x1f9a('0x45')](handleError(_0x5657b7,null));};exports[_0x1f9a('0x48')]=function(_0x4e0db9,_0x1432d8){return db[_0x1f9a('0x43')]['create'](_0x4e0db9[_0x1f9a('0x49')],{})[_0x1f9a('0x24')](respondWithResult(_0x1432d8,0xc9))[_0x1f9a('0x45')](handleError(_0x1432d8,null));};exports[_0x1f9a('0x4a')]=function(_0x26adb5,_0xc9954d){if(_0x26adb5[_0x1f9a('0x49')]['id']){delete _0x26adb5['body']['id'];}return db[_0x1f9a('0x43')][_0x1f9a('0x47')]({'where':{'id':_0x26adb5[_0x1f9a('0x4b')]['id']}})[_0x1f9a('0x24')](handleEntityNotFound(_0xc9954d,null))['then'](saveUpdates(_0x26adb5[_0x1f9a('0x49')],null))['then'](respondWithResult(_0xc9954d,null))['catch'](handleError(_0xc9954d,null));};exports['destroy']=function(_0x4fbaa8,_0x30bcb7){return db[_0x1f9a('0x43')]['find']({'where':{'id':_0x4fbaa8[_0x1f9a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30bcb7,null))[_0x1f9a('0x24')](removeEntity(_0x30bcb7,null))[_0x1f9a('0x45')](handleError(_0x30bcb7,null));};exports[_0x1f9a('0x4c')]=function(_0x312a92,_0x4608d6){return db[_0x1f9a('0x43')][_0x1f9a('0x4c')]()['then'](respondWithResult(_0x4608d6,null))[_0x1f9a('0x45')](handleError(_0x4608d6,null));};
\ No newline at end of file
+var _0x5827=['pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','offset','count','limit','set','json','reject','then','end','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x491390,_0x105199){var _0x44c474=function(_0x471b35){while(--_0x471b35){_0x491390['push'](_0x491390['shift']());}};_0x44c474(++_0x105199);}(_0x5827,0x1d0));var _0x7582=function(_0x58c495,_0x295d26){_0x58c495=_0x58c495-0x0;var _0x38e489=_0x5827[_0x58c495];return _0x38e489;};'use strict';var emlformat=require(_0x7582('0x0'));var rimraf=require(_0x7582('0x1'));var zipdir=require(_0x7582('0x2'));var jsonpatch=require(_0x7582('0x3'));var rp=require(_0x7582('0x4'));var moment=require(_0x7582('0x5'));var BPromise=require(_0x7582('0x6'));var Mustache=require(_0x7582('0x7'));var util=require(_0x7582('0x8'));var path=require(_0x7582('0x9'));var sox=require(_0x7582('0xa'));var csv=require('to-csv');var ejs=require(_0x7582('0xb'));var fs=require('fs');var fs_extra=require(_0x7582('0xc'));var _=require(_0x7582('0xd'));var squel=require(_0x7582('0xe'));var crypto=require('crypto');var jsforce=require(_0x7582('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7582('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7582('0x11'));var qs=require(_0x7582('0x12'));var as=require(_0x7582('0x13'));var hardwareService=require(_0x7582('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7582('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x168308,_0x336d5b){_0x336d5b=_0x336d5b||0xcc;return function(_0x69074d){if(_0x69074d){return _0x168308[_0x7582('0x16')](_0x336d5b);}return _0x168308[_0x7582('0x17')](_0x336d5b)['end']();};}function respondWithResult(_0x10cca7,_0x3c3863){_0x3c3863=_0x3c3863||0xc8;return function(_0x206a63){if(_0x206a63){return _0x10cca7[_0x7582('0x17')](_0x3c3863)['json'](_0x206a63);}};}function respondWithFilteredResult(_0x27d2b6,_0x1152b0){return function(_0xd7dc6c){if(_0xd7dc6c){var _0x4fe537=typeof _0x1152b0[_0x7582('0x18')]==='undefined'&&typeof _0x1152b0['limit']==='undefined';var _0x1f3b8f=_0xd7dc6c[_0x7582('0x19')];var _0x216236=_0x4fe537?0x0:_0x1152b0[_0x7582('0x18')];var _0x1a0158=_0x4fe537?_0xd7dc6c[_0x7582('0x19')]:_0x1152b0['offset']+_0x1152b0[_0x7582('0x1a')];var _0x3a95fb;if(_0x1a0158>=_0x1f3b8f){_0x1a0158=_0x1f3b8f;_0x3a95fb=0xc8;}else{_0x3a95fb=0xce;}_0x27d2b6[_0x7582('0x17')](_0x3a95fb);return _0x27d2b6[_0x7582('0x1b')]('Content-Range',_0x216236+'-'+_0x1a0158+'/'+_0x1f3b8f)[_0x7582('0x1c')](_0xd7dc6c);}return null;};}function patchUpdates(_0x14d776){return function(_0xfdac96){try{jsonpatch['apply'](_0xfdac96,_0x14d776,!![]);}catch(_0x55d3af){return BPromise[_0x7582('0x1d')](_0x55d3af);}return _0xfdac96['save']();};}function saveUpdates(_0x8548b9,_0x18d1e1){return function(_0x5dff8e){if(_0x5dff8e){return _0x5dff8e['update'](_0x8548b9)[_0x7582('0x1e')](function(_0x363a75){return _0x363a75;});}return null;};}function removeEntity(_0x280012,_0x1fafc8){return function(_0x1fef70){if(_0x1fef70){return _0x1fef70['destroy']()['then'](function(){_0x280012[_0x7582('0x17')](0xcc)[_0x7582('0x1f')]();});}};}function handleEntityNotFound(_0x87f07b,_0x2a3cbd){return function(_0x5128da){if(!_0x5128da){_0x87f07b['sendStatus'](0x194);}return _0x5128da;};}function handleError(_0x2212d9,_0x1fc2d5){_0x1fc2d5=_0x1fc2d5||0x1f4;return function(_0xb5f9e9){logger[_0x7582('0x20')](_0xb5f9e9[_0x7582('0x21')]);if(_0xb5f9e9['name']){delete _0xb5f9e9[_0x7582('0x22')];}_0x2212d9['status'](_0x1fc2d5)[_0x7582('0x23')](_0xb5f9e9);};}exports[_0x7582('0x24')]=function(_0x13c2da,_0xfbf27){var _0x1c87bc={},_0x3ff054={},_0x117d80={'count':0x0,'rows':[]};var _0x2831cf=_[_0x7582('0x25')](db[_0x7582('0x26')][_0x7582('0x27')],function(_0x3faaca){return{'name':_0x3faaca[_0x7582('0x28')],'type':_0x3faaca['type'][_0x7582('0x29')]};});_0x3ff054[_0x7582('0x2a')]=_[_0x7582('0x25')](_0x2831cf,_0x7582('0x22'));_0x3ff054[_0x7582('0x2b')]=_[_0x7582('0x2c')](_0x13c2da['query']);_0x3ff054['filters']=_[_0x7582('0x2d')](_0x3ff054['model'],_0x3ff054[_0x7582('0x2b')]);_0x1c87bc[_0x7582('0x2e')]=_[_0x7582('0x2d')](_0x3ff054[_0x7582('0x2a')],qs[_0x7582('0x2f')](_0x13c2da['query'][_0x7582('0x2f')]));_0x1c87bc[_0x7582('0x2e')]=_0x1c87bc['attributes'][_0x7582('0x30')]?_0x1c87bc[_0x7582('0x2e')]:_0x3ff054[_0x7582('0x2a')];if(!_0x13c2da[_0x7582('0x2b')][_0x7582('0x31')](_0x7582('0x32'))){_0x1c87bc['limit']=qs[_0x7582('0x1a')](_0x13c2da[_0x7582('0x2b')]['limit']);_0x1c87bc[_0x7582('0x18')]=qs['offset'](_0x13c2da['query'][_0x7582('0x18')]);}_0x1c87bc[_0x7582('0x33')]=qs[_0x7582('0x34')](_0x13c2da[_0x7582('0x2b')]['sort']);_0x1c87bc['where']=qs[_0x7582('0x35')](_[_0x7582('0x36')](_0x13c2da[_0x7582('0x2b')],_0x3ff054['filters']),_0x2831cf);if(_0x13c2da[_0x7582('0x2b')][_0x7582('0x37')]){_0x1c87bc[_0x7582('0x38')]=_[_0x7582('0x39')](_0x1c87bc[_0x7582('0x38')],{'$or':_[_0x7582('0x25')](_0x2831cf,function(_0x441751){if(_0x441751[_0x7582('0x3a')]!==_0x7582('0x3b')){var _0x12baf3={};_0x12baf3[_0x441751[_0x7582('0x22')]]={'$like':'%'+_0x13c2da[_0x7582('0x2b')][_0x7582('0x37')]+'%'};return _0x12baf3;}})});}_0x1c87bc=_[_0x7582('0x39')]({},_0x1c87bc,_0x13c2da[_0x7582('0x3c')]);var _0xcd4282={'where':_0x1c87bc[_0x7582('0x38')]};return db['FaxTransferReport'][_0x7582('0x19')](_0xcd4282)[_0x7582('0x1e')](function(_0x14a232){_0x117d80[_0x7582('0x19')]=_0x14a232;if(_0x13c2da['query'][_0x7582('0x3d')]){_0x1c87bc[_0x7582('0x3e')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x7582('0x3f')](_0x1c87bc);})[_0x7582('0x1e')](function(_0x5216bc){_0x117d80[_0x7582('0x40')]=_0x5216bc;return _0x117d80;})[_0x7582('0x1e')](respondWithFilteredResult(_0xfbf27,_0x1c87bc))[_0x7582('0x41')](handleError(_0xfbf27,null));};exports[_0x7582('0x42')]=function(_0x2cb1b3,_0x4eac54){var _0x2dad84={'raw':!![],'where':{'id':_0x2cb1b3[_0x7582('0x43')]['id']}},_0x294c0e={};_0x294c0e[_0x7582('0x2a')]=_[_0x7582('0x2c')](db[_0x7582('0x26')][_0x7582('0x27')]);_0x294c0e[_0x7582('0x2b')]=_[_0x7582('0x2c')](_0x2cb1b3[_0x7582('0x2b')]);_0x294c0e['filters']=_[_0x7582('0x2d')](_0x294c0e['model'],_0x294c0e[_0x7582('0x2b')]);_0x2dad84[_0x7582('0x2e')]=_[_0x7582('0x2d')](_0x294c0e[_0x7582('0x2a')],qs[_0x7582('0x2f')](_0x2cb1b3[_0x7582('0x2b')][_0x7582('0x2f')]));_0x2dad84[_0x7582('0x2e')]=_0x2dad84[_0x7582('0x2e')][_0x7582('0x30')]?_0x2dad84['attributes']:_0x294c0e[_0x7582('0x2a')];if(_0x2cb1b3[_0x7582('0x2b')][_0x7582('0x3d')]){_0x2dad84[_0x7582('0x3e')]=[{'all':!![]}];}_0x2dad84=_['merge']({},_0x2dad84,_0x2cb1b3[_0x7582('0x3c')]);return db[_0x7582('0x26')][_0x7582('0x44')](_0x2dad84)['then'](handleEntityNotFound(_0x4eac54,null))[_0x7582('0x1e')](respondWithResult(_0x4eac54,null))[_0x7582('0x41')](handleError(_0x4eac54,null));};exports[_0x7582('0x45')]=function(_0x156148,_0x1e6871){return db['FaxTransferReport'][_0x7582('0x45')](_0x156148[_0x7582('0x46')],{})[_0x7582('0x1e')](respondWithResult(_0x1e6871,0xc9))[_0x7582('0x41')](handleError(_0x1e6871,null));};exports[_0x7582('0x47')]=function(_0x1cb122,_0x3945ea){if(_0x1cb122[_0x7582('0x46')]['id']){delete _0x1cb122[_0x7582('0x46')]['id'];}return db[_0x7582('0x26')][_0x7582('0x44')]({'where':{'id':_0x1cb122[_0x7582('0x43')]['id']}})[_0x7582('0x1e')](handleEntityNotFound(_0x3945ea,null))['then'](saveUpdates(_0x1cb122[_0x7582('0x46')],null))[_0x7582('0x1e')](respondWithResult(_0x3945ea,null))[_0x7582('0x41')](handleError(_0x3945ea,null));};exports[_0x7582('0x48')]=function(_0x44cfbd,_0xf61433){return db[_0x7582('0x26')][_0x7582('0x44')]({'where':{'id':_0x44cfbd[_0x7582('0x43')]['id']}})[_0x7582('0x1e')](handleEntityNotFound(_0xf61433,null))['then'](removeEntity(_0xf61433,null))['catch'](handleError(_0xf61433,null));};exports[_0x7582('0x49')]=function(_0x31ea59,_0xbfee1b){return db['FaxTransferReport'][_0x7582('0x49')]()['then'](respondWithResult(_0xbfee1b,null))['catch'](handleError(_0xbfee1b,null));};
\ No newline at end of file
index 33f254a..d9fb529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4959=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger'];(function(_0x5e2d1c,_0x3af275){var _0x1f53ec=function(_0x28a2ca){while(--_0x28a2ca){_0x5e2d1c['push'](_0x5e2d1c['shift']());}};_0x1f53ec(++_0x3af275);}(_0x4959,0x9b));var _0x9495=function(_0x31cb48,_0xb13e65){_0x31cb48=_0x31cb48-0x0;var _0x118b16=_0x4959[_0x31cb48];return _0x118b16;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9495('0x0'))(_0x9495('0x1'));var moment=require(_0x9495('0x2'));var BPromise=require('bluebird');var rp=require(_0x9495('0x3'));var fs=require('fs');var path=require(_0x9495('0x4'));var rimraf=require(_0x9495('0x5'));var config=require(_0x9495('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x9495('0x7')]=function(_0x2225a0,_0x2c716d){return _0x2225a0[_0x9495('0x8')](_0x9495('0x9'),attributes,{'tableName':_0x9495('0xa'),'paranoid':![],'indexes':[{'name':_0x9495('0xb'),'fields':[_0x9495('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a36=['path','rimraf','../../config/environment','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5a36,0x133));var _0x65a3=function(_0x30eea0,_0x63ad9b){_0x30eea0=_0x30eea0-0x0;var _0x4def89=_0x5a36[_0x30eea0];return _0x4def89;};'use strict';var _=require(_0x65a3('0x0'));var util=require(_0x65a3('0x1'));var logger=require(_0x65a3('0x2'))(_0x65a3('0x3'));var moment=require(_0x65a3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x65a3('0x5'));var rimraf=require(_0x65a3('0x6'));var config=require(_0x65a3('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x65a3('0x8')]=function(_0x3d1b8c,_0x3b61e4){return _0x3d1b8c[_0x65a3('0x9')]('FaxTransferReport',attributes,{'tableName':_0x65a3('0xa'),'paranoid':![],'indexes':[{'name':_0x65a3('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 73e766f..59aba8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x836a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x59f19b,_0x84afc7){var _0x3abd4e=function(_0x55e664){while(--_0x55e664){_0x59f19b['push'](_0x59f19b['shift']());}};_0x3abd4e(++_0x84afc7);}(_0x836a,0x105));var _0xa836=function(_0x11ce46,_0x7a1715){_0x11ce46=_0x11ce46-0x0;var _0x272001=_0x836a[_0x11ce46];return _0x272001;};'use strict';var _=require(_0xa836('0x0'));var util=require(_0xa836('0x1'));var moment=require(_0xa836('0x2'));var BPromise=require(_0xa836('0x3'));var rs=require(_0xa836('0x4'));var fs=require('fs');var Redis=require(_0xa836('0x5'));var db=require(_0xa836('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa836('0x7'))(_0xa836('0x8'));var config=require(_0xa836('0x9'));var jayson=require(_0xa836('0xa'));var client=jayson[_0xa836('0xb')][_0xa836('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40a1be,_0x2ccb0c,_0x268858){return new BPromise(function(_0x305e24,_0x504088){return client['request'](_0x40a1be,_0x268858)[_0xa836('0xd')](function(_0x183342){logger[_0xa836('0xe')](_0xa836('0xf'),_0x2ccb0c,_0xa836('0x10'));logger['debug'](_0xa836('0x11'),_0x2ccb0c,_0xa836('0x10'),JSON[_0xa836('0x12')](_0x183342));if(_0x183342[_0xa836('0x13')]){if(_0x183342[_0xa836('0x13')][_0xa836('0x14')]===0x1f4){logger[_0xa836('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x2ccb0c,_0x183342['error'][_0xa836('0x15')]);return _0x504088(_0x183342[_0xa836('0x13')][_0xa836('0x15')]);}logger['error'](_0xa836('0xf'),_0x2ccb0c,_0x183342[_0xa836('0x13')][_0xa836('0x15')]);return _0x305e24(_0x183342[_0xa836('0x13')][_0xa836('0x15')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x2ccb0c,_0xa836('0x10'));_0x305e24(_0x183342[_0xa836('0x16')][_0xa836('0x15')]);}})[_0xa836('0x17')](function(_0x349512){logger[_0xa836('0x13')](_0xa836('0xf'),_0x2ccb0c,_0x349512);_0x504088(_0x349512);});});}
\ No newline at end of file
+var _0xc2da=['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','../../config/environment','jayson/promise','client','request','then'];(function(_0x1b2f5f,_0x2a0fd4){var _0xfb18a=function(_0x572d1d){while(--_0x572d1d){_0x1b2f5f['push'](_0x1b2f5f['shift']());}};_0xfb18a(++_0x2a0fd4);}(_0xc2da,0x104));var _0xac2d=function(_0x346dba,_0x4301dd){_0x346dba=_0x346dba-0x0;var _0x3fafe1=_0xc2da[_0x346dba];return _0x3fafe1;};'use strict';var _=require(_0xac2d('0x0'));var util=require(_0xac2d('0x1'));var moment=require(_0xac2d('0x2'));var BPromise=require(_0xac2d('0x3'));var rs=require(_0xac2d('0x4'));var fs=require('fs');var Redis=require(_0xac2d('0x5'));var db=require(_0xac2d('0x6'))['db'];var utils=require(_0xac2d('0x7'));var logger=require(_0xac2d('0x8'))(_0xac2d('0x9'));var config=require(_0xac2d('0xa'));var jayson=require(_0xac2d('0xb'));var client=jayson[_0xac2d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38b7d8,_0xc139ff,_0x52b161){return new BPromise(function(_0x5bb146,_0x321182){return client[_0xac2d('0xd')](_0x38b7d8,_0x52b161)[_0xac2d('0xe')](function(_0x282f3a){logger[_0xac2d('0xf')](_0xac2d('0x10'),_0xc139ff,_0xac2d('0x11'));logger['debug'](_0xac2d('0x12'),_0xc139ff,_0xac2d('0x11'),JSON[_0xac2d('0x13')](_0x282f3a));if(_0x282f3a[_0xac2d('0x14')]){if(_0x282f3a[_0xac2d('0x14')][_0xac2d('0x15')]===0x1f4){logger[_0xac2d('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0xc139ff,_0x282f3a[_0xac2d('0x14')][_0xac2d('0x16')]);return _0x321182(_0x282f3a[_0xac2d('0x14')]['message']);}logger[_0xac2d('0x14')](_0xac2d('0x10'),_0xc139ff,_0x282f3a['error']['message']);return _0x5bb146(_0x282f3a[_0xac2d('0x14')]['message']);}else{logger[_0xac2d('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0xc139ff,_0xac2d('0x11'));_0x5bb146(_0x282f3a[_0xac2d('0x17')][_0xac2d('0x16')]);}})[_0xac2d('0x18')](function(_0x446f72){logger[_0xac2d('0x14')](_0xac2d('0x10'),_0xc139ff,_0x446f72);_0x321182(_0x446f72);});});}
\ No newline at end of file
index f897112..eb84890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39c4=['/describe','describe','/:id','show','post','create','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get'];(function(_0x409ef4,_0x435589){var _0x50036b=function(_0x4d12ff){while(--_0x4d12ff){_0x409ef4['push'](_0x409ef4['shift']());}};_0x50036b(++_0x435589);}(_0x39c4,0xa4));var _0x439c=function(_0x433a5b,_0x532d13){_0x433a5b=_0x433a5b-0x0;var _0x2c8afb=_0x39c4[_0x433a5b];return _0x2c8afb;};'use strict';var multer=require('multer');var util=require(_0x439c('0x0'));var path=require('path');var timeout=require(_0x439c('0x1'));var express=require(_0x439c('0x2'));var router=express[_0x439c('0x3')]();var fs_extra=require(_0x439c('0x4'));var auth=require(_0x439c('0x5'));var interaction=require(_0x439c('0x6'));var config=require(_0x439c('0x7'));var controller=require(_0x439c('0x8'));router['get']('/',auth[_0x439c('0x9')](),controller[_0x439c('0xa')]);router[_0x439c('0xb')](_0x439c('0xc'),auth[_0x439c('0x9')](),controller[_0x439c('0xd')]);router[_0x439c('0xb')](_0x439c('0xe'),auth[_0x439c('0x9')](),controller[_0x439c('0xf')]);router[_0x439c('0x10')]('/',auth[_0x439c('0x9')](),controller[_0x439c('0x11')]);router[_0x439c('0x12')]('/:id',auth[_0x439c('0x9')](),controller[_0x439c('0x13')]);router[_0x439c('0x14')]('/:id',auth[_0x439c('0x9')](),controller['destroy']);module[_0x439c('0x15')]=router;
\ No newline at end of file
+var _0x9323=['Router','fs-extra','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/:id','post','put','delete','multer','util','path','connect-timeout','express'];(function(_0x7c645f,_0x4177ab){var _0x1ae9c0=function(_0xb6be2c){while(--_0xb6be2c){_0x7c645f['push'](_0x7c645f['shift']());}};_0x1ae9c0(++_0x4177ab);}(_0x9323,0xab));var _0x3932=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9323[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x3932('0x0'));var util=require(_0x3932('0x1'));var path=require(_0x3932('0x2'));var timeout=require(_0x3932('0x3'));var express=require(_0x3932('0x4'));var router=express[_0x3932('0x5')]();var fs_extra=require(_0x3932('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3932('0x7'));var config=require('../../config/environment');var controller=require(_0x3932('0x8'));router[_0x3932('0x9')]('/',auth[_0x3932('0xa')](),controller[_0x3932('0xb')]);router[_0x3932('0x9')]('/describe',auth[_0x3932('0xa')](),controller['describe']);router[_0x3932('0x9')](_0x3932('0xc'),auth[_0x3932('0xa')](),controller['show']);router[_0x3932('0xd')]('/',auth[_0x3932('0xa')](),controller['create']);router[_0x3932('0xe')](_0x3932('0xc'),auth[_0x3932('0xa')](),controller['update']);router[_0x3932('0xf')](_0x3932('0xc'),auth[_0x3932('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index ea345bd..6860424 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6030=['addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x547f7c,_0x152efa){var _0x1e09c7=function(_0x7301f9){while(--_0x7301f9){_0x547f7c['push'](_0x547f7c['shift']());}};_0x1e09c7(++_0x152efa);}(_0x6030,0x18d));var _0x0603=function(_0x2036ae,_0x124955){_0x2036ae=_0x2036ae-0x0;var _0x5a487a=_0x6030[_0x2036ae];return _0x5a487a;};'use strict';var multer=require(_0x0603('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0603('0x1'));var express=require(_0x0603('0x2'));var router=express[_0x0603('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0603('0x4'));var interaction=require(_0x0603('0x5'));var config=require(_0x0603('0x6'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x0603('0x7')](),controller['index']);router[_0x0603('0x8')](_0x0603('0x9'),auth['isAuthenticated'](),controller[_0x0603('0xa')]);router[_0x0603('0x8')](_0x0603('0xb'),auth['isAuthenticated'](),controller[_0x0603('0xc')]);router['get'](_0x0603('0xd'),auth['isAuthenticated'](),controller[_0x0603('0xe')]);router[_0x0603('0xf')]('/',auth[_0x0603('0x7')](),controller[_0x0603('0x10')]);router[_0x0603('0xf')](_0x0603('0xb'),auth[_0x0603('0x7')](),controller[_0x0603('0x11')]);router[_0x0603('0x12')](_0x0603('0x9'),auth[_0x0603('0x7')](),controller[_0x0603('0x13')]);router[_0x0603('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0603('0x15')]);module[_0x0603('0x16')]=router;
\ No newline at end of file
+var _0x286f=['addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x31f96d,_0x37dad1){var _0xaac7a=function(_0x15e0c9){while(--_0x15e0c9){_0x31f96d['push'](_0x31f96d['shift']());}};_0xaac7a(++_0x37dad1);}(_0x286f,0x17d));var _0xf286=function(_0x8e3496,_0x308901){_0x8e3496=_0x8e3496-0x0;var _0x3c93d9=_0x286f[_0x8e3496];return _0x3c93d9;};'use strict';var multer=require(_0xf286('0x0'));var util=require(_0xf286('0x1'));var path=require(_0xf286('0x2'));var timeout=require(_0xf286('0x3'));var express=require('express');var router=express[_0xf286('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf286('0x5'));var interaction=require(_0xf286('0x6'));var config=require(_0xf286('0x7'));var controller=require(_0xf286('0x8'));router[_0xf286('0x9')]('/',auth[_0xf286('0xa')](),controller[_0xf286('0xb')]);router[_0xf286('0x9')](_0xf286('0xc'),auth[_0xf286('0xa')](),controller['show']);router[_0xf286('0x9')](_0xf286('0xd'),auth[_0xf286('0xa')](),controller[_0xf286('0xe')]);router[_0xf286('0x9')](_0xf286('0xf'),auth['isAuthenticated'](),controller[_0xf286('0x10')]);router[_0xf286('0x11')]('/',auth[_0xf286('0xa')](),controller[_0xf286('0x12')]);router[_0xf286('0x11')](_0xf286('0xd'),auth[_0xf286('0xa')](),controller[_0xf286('0x13')]);router[_0xf286('0x14')]('/:id',auth[_0xf286('0xa')](),controller[_0xf286('0x15')]);router[_0xf286('0x16')](_0xf286('0xc'),auth[_0xf286('0xa')](),controller[_0xf286('0x17')]);module[_0xf286('0x18')]=router;
\ No newline at end of file
index 3a09dfc..a8997be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a4=['integrationTab','newTab','exports','STRING','ENUM','basic'];(function(_0x25daed,_0x3ed039){var _0x20ad80=function(_0x3e2094){while(--_0x3e2094){_0x25daed['push'](_0x25daed['shift']());}};_0x20ad80(++_0x3ed039);}(_0x98a4,0x1d0));var _0x498a=function(_0x3f8d30,_0x57d905){_0x3f8d30=_0x3f8d30-0x0;var _0x22da37=_0x98a4[_0x3f8d30];return _0x22da37;};'use strict';var Sequelize=require('sequelize');module[_0x498a('0x0')]={'name':{'type':Sequelize[_0x498a('0x1')]},'description':{'type':Sequelize[_0x498a('0x1')]},'username':{'type':Sequelize[_0x498a('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x498a('0x2')](_0x498a('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x498a('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x498a('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x498a('0x4'),_0x498a('0x5')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x0d56=['basic','integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x0d56,0x146));var _0x60d5=function(_0x50d1c6,_0x40051c){_0x50d1c6=_0x50d1c6-0x0;var _0x3cd375=_0x0d56[_0x50d1c6];return _0x3cd375;};'use strict';var Sequelize=require(_0x60d5('0x0'));module[_0x60d5('0x1')]={'name':{'type':Sequelize[_0x60d5('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x60d5('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x60d5('0x3')](_0x60d5('0x4')),'defaultValue':_0x60d5('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x60d5('0x2')]},'consumerSecret':{'type':Sequelize[_0x60d5('0x2')]},'token':{'type':Sequelize[_0x60d5('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x60d5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x60d5('0x3')](_0x60d5('0x5'),'newTab'),'defaultValue':_0x60d5('0x5')}};
\ No newline at end of file
index 2f70786..e907efa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d04=['includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','DeskConfiguration','DeskField','priority','remoteUri','username','password','consumerKey','consumerSecret','tokenSecret','substring','lastIndexOf','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','%s:%s','toString','base64','entries','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','request-promise','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/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0x3b344f,_0x4655e7){var _0x48d3fb=function(_0x39033b){while(--_0x39033b){_0x3b344f['push'](_0x3b344f['shift']());}};_0x48d3fb(++_0x4655e7);}(_0x8d04,0xa0));var _0x48d0=function(_0x3761d0,_0x277938){_0x3761d0=_0x3761d0-0x0;var _0x44ef64=_0x8d04[_0x3761d0];return _0x44ef64;};'use strict';var emlformat=require(_0x48d0('0x0'));var rimraf=require(_0x48d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x48d0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x48d0('0x3'));var util=require('util');var path=require(_0x48d0('0x4'));var sox=require(_0x48d0('0x5'));var csv=require(_0x48d0('0x6'));var ejs=require(_0x48d0('0x7'));var fs=require('fs');var fs_extra=require(_0x48d0('0x8'));var _=require('lodash');var squel=require(_0x48d0('0x9'));var crypto=require(_0x48d0('0xa'));var jsforce=require(_0x48d0('0xb'));var deskjs=require(_0x48d0('0xc'));var toCsv=require(_0x48d0('0x6'));var querystring=require(_0x48d0('0xd'));var Papa=require(_0x48d0('0xe'));var Redis=require(_0x48d0('0xf'));var authService=require(_0x48d0('0x10'));var qs=require(_0x48d0('0x11'));var as=require(_0x48d0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48d0('0x13'))(_0x48d0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x48d0('0x15'));var db=require(_0x48d0('0x16'))['db'];var integrations=require(_0x48d0('0x17'));function respondWithStatusCode(_0x24f74f,_0x5529a1){_0x5529a1=_0x5529a1||0xcc;return function(_0x5dabd3){if(_0x5dabd3){return _0x24f74f[_0x48d0('0x18')](_0x5529a1);}return _0x24f74f['status'](_0x5529a1)[_0x48d0('0x19')]();};}function respondWithResult(_0x2fa2c9,_0x1b72fc){_0x1b72fc=_0x1b72fc||0xc8;return function(_0x1ac368){if(_0x1ac368){return _0x2fa2c9['status'](_0x1b72fc)[_0x48d0('0x1a')](_0x1ac368);}};}function respondWithFilteredResult(_0x415131,_0x34e735){return function(_0x4a33b8){if(_0x4a33b8){var _0x578127=typeof _0x34e735[_0x48d0('0x1b')]===_0x48d0('0x1c')&&typeof _0x34e735[_0x48d0('0x1d')]===_0x48d0('0x1c');var _0x4d6654=_0x4a33b8[_0x48d0('0x1e')];var _0x5d685f=_0x578127?0x0:_0x34e735['offset'];var _0x3fd703=_0x578127?_0x4a33b8[_0x48d0('0x1e')]:_0x34e735[_0x48d0('0x1b')]+_0x34e735['limit'];var _0x655e8f;if(_0x3fd703>=_0x4d6654){_0x3fd703=_0x4d6654;_0x655e8f=0xc8;}else{_0x655e8f=0xce;}_0x415131[_0x48d0('0x1f')](_0x655e8f);return _0x415131['set'](_0x48d0('0x20'),_0x5d685f+'-'+_0x3fd703+'/'+_0x4d6654)[_0x48d0('0x1a')](_0x4a33b8);}return null;};}function patchUpdates(_0xde0860){return function(_0x33ff85){try{jsonpatch[_0x48d0('0x21')](_0x33ff85,_0xde0860,!![]);}catch(_0x3c039d){return BPromise[_0x48d0('0x22')](_0x3c039d);}return _0x33ff85[_0x48d0('0x23')]();};}function saveUpdates(_0x336fd5,_0x5f5316){return function(_0x291715){if(_0x291715){return _0x291715[_0x48d0('0x24')](_0x336fd5)[_0x48d0('0x25')](function(_0x57b5e9){return _0x57b5e9;});}return null;};}function removeEntity(_0x484cf5,_0x58d062){return function(_0x3a82fe){if(_0x3a82fe){return _0x3a82fe[_0x48d0('0x26')]()[_0x48d0('0x25')](function(){_0x484cf5[_0x48d0('0x1f')](0xcc)[_0x48d0('0x19')]();});}};}function handleEntityNotFound(_0x478eba,_0x57c216){return function(_0x540d6c){if(!_0x540d6c){_0x478eba[_0x48d0('0x18')](0x194);}return _0x540d6c;};}function handleError(_0x105d39,_0x14e132){_0x14e132=_0x14e132||0x1f4;return function(_0x372030){logger[_0x48d0('0x27')](_0x372030[_0x48d0('0x28')]);if(_0x372030[_0x48d0('0x29')]){delete _0x372030[_0x48d0('0x29')];}_0x105d39[_0x48d0('0x1f')](_0x14e132)['send'](_0x372030);};}exports[_0x48d0('0x2a')]=function(_0x342013,_0x273990){var _0x44a814={},_0x202511={},_0x2a5f2c={'count':0x0,'rows':[]};var _0x21f945=_[_0x48d0('0x2b')](db[_0x48d0('0x2c')][_0x48d0('0x2d')],function(_0x23d6e3){return{'name':_0x23d6e3[_0x48d0('0x2e')],'type':_0x23d6e3['type']['key']};});_0x202511[_0x48d0('0x2f')]=_[_0x48d0('0x2b')](_0x21f945,_0x48d0('0x29'));_0x202511[_0x48d0('0x30')]=_[_0x48d0('0x31')](_0x342013['query']);_0x202511[_0x48d0('0x32')]=_[_0x48d0('0x33')](_0x202511[_0x48d0('0x2f')],_0x202511[_0x48d0('0x30')]);_0x44a814[_0x48d0('0x34')]=_[_0x48d0('0x33')](_0x202511[_0x48d0('0x2f')],qs[_0x48d0('0x35')](_0x342013[_0x48d0('0x30')]['fields']));_0x44a814['attributes']=_0x44a814[_0x48d0('0x34')]['length']?_0x44a814[_0x48d0('0x34')]:_0x202511['model'];if(!_0x342013[_0x48d0('0x30')][_0x48d0('0x36')](_0x48d0('0x37'))){_0x44a814[_0x48d0('0x1d')]=qs[_0x48d0('0x1d')](_0x342013['query'][_0x48d0('0x1d')]);_0x44a814['offset']=qs[_0x48d0('0x1b')](_0x342013[_0x48d0('0x30')]['offset']);}_0x44a814[_0x48d0('0x38')]=qs[_0x48d0('0x39')](_0x342013[_0x48d0('0x30')]['sort']);_0x44a814[_0x48d0('0x3a')]=qs[_0x48d0('0x32')](_['pick'](_0x342013['query'],_0x202511[_0x48d0('0x32')]),_0x21f945);if(_0x342013['query'][_0x48d0('0x3b')]){_0x44a814['where']=_[_0x48d0('0x3c')](_0x44a814[_0x48d0('0x3a')],{'$or':_[_0x48d0('0x2b')](_0x21f945,function(_0x15c730){if(_0x15c730[_0x48d0('0x3d')]!==_0x48d0('0x3e')){var _0x1bce32={};_0x1bce32[_0x15c730[_0x48d0('0x29')]]={'$like':'%'+_0x342013[_0x48d0('0x30')]['filter']+'%'};return _0x1bce32;}})});}_0x44a814=_[_0x48d0('0x3c')]({},_0x44a814,_0x342013[_0x48d0('0x3f')]);var _0x19fc90={'where':_0x44a814[_0x48d0('0x3a')]};return db[_0x48d0('0x2c')]['count'](_0x19fc90)[_0x48d0('0x25')](function(_0x5349a1){_0x2a5f2c[_0x48d0('0x1e')]=_0x5349a1;if(_0x342013['query'][_0x48d0('0x40')]){_0x44a814[_0x48d0('0x41')]=[{'all':!![]}];}return db[_0x48d0('0x2c')][_0x48d0('0x42')](_0x44a814);})[_0x48d0('0x25')](function(_0x1c166a){_0x2a5f2c[_0x48d0('0x43')]=_0x1c166a;return _0x2a5f2c;})['then'](respondWithFilteredResult(_0x273990,_0x44a814))[_0x48d0('0x44')](handleError(_0x273990,null));};exports[_0x48d0('0x45')]=function(_0x177d5a,_0x4506c4){var _0x3dd026={'raw':![],'where':{'id':_0x177d5a[_0x48d0('0x46')]['id']}},_0x51358d={};_0x51358d[_0x48d0('0x2f')]=_[_0x48d0('0x31')](db['DeskAccount']['rawAttributes']);_0x51358d[_0x48d0('0x30')]=_[_0x48d0('0x31')](_0x177d5a[_0x48d0('0x30')]);_0x51358d[_0x48d0('0x32')]=_[_0x48d0('0x33')](_0x51358d[_0x48d0('0x2f')],_0x51358d[_0x48d0('0x30')]);_0x3dd026[_0x48d0('0x34')]=_[_0x48d0('0x33')](_0x51358d['model'],qs[_0x48d0('0x35')](_0x177d5a[_0x48d0('0x30')][_0x48d0('0x35')]));_0x3dd026['attributes']=_0x3dd026['attributes'][_0x48d0('0x47')]?_0x3dd026[_0x48d0('0x34')]:_0x51358d[_0x48d0('0x2f')];if(_0x177d5a['query'][_0x48d0('0x40')]){_0x3dd026[_0x48d0('0x41')]=[{'all':!![]}];}_0x3dd026=_[_0x48d0('0x3c')]({},_0x3dd026,_0x177d5a[_0x48d0('0x3f')]);return db[_0x48d0('0x2c')][_0x48d0('0x48')](_0x3dd026)[_0x48d0('0x25')](handleEntityNotFound(_0x4506c4,null))['then'](respondWithResult(_0x4506c4,null))['catch'](handleError(_0x4506c4,null));};exports[_0x48d0('0x49')]=function(_0x4cea6d,_0x2b9605){return db[_0x48d0('0x2c')]['create'](_0x4cea6d[_0x48d0('0x4a')],{})[_0x48d0('0x25')](respondWithResult(_0x2b9605,0xc9))[_0x48d0('0x44')](handleError(_0x2b9605,null));};exports['update']=function(_0x3862c8,_0x3d3c71){if(_0x3862c8[_0x48d0('0x4a')]['id']){delete _0x3862c8[_0x48d0('0x4a')]['id'];}return db['DeskAccount'][_0x48d0('0x48')]({'where':{'id':_0x3862c8[_0x48d0('0x46')]['id']}})[_0x48d0('0x25')](handleEntityNotFound(_0x3d3c71,null))[_0x48d0('0x25')](saveUpdates(_0x3862c8[_0x48d0('0x4a')],null))[_0x48d0('0x25')](respondWithResult(_0x3d3c71,null))['catch'](handleError(_0x3d3c71,null));};exports['destroy']=function(_0x27f955,_0x3c2d0d){return db['DeskAccount']['find']({'where':{'id':_0x27f955[_0x48d0('0x46')]['id']}})[_0x48d0('0x25')](handleEntityNotFound(_0x3c2d0d,null))[_0x48d0('0x25')](removeEntity(_0x3c2d0d,null))[_0x48d0('0x44')](handleError(_0x3c2d0d,null));};exports[_0x48d0('0x4b')]=function(_0x28f0b6,_0xa495a0,_0x5df716){var _0x286659={};var _0x353ef2={};var _0x3f269b;var _0x25821a;return db[_0x48d0('0x2c')]['findOne']({'where':{'id':_0x28f0b6[_0x48d0('0x46')]['id']}})[_0x48d0('0x25')](handleEntityNotFound(_0xa495a0,null))[_0x48d0('0x25')](function(_0x501825){if(_0x501825){_0x3f269b=_0x501825;_0x353ef2['model']=_[_0x48d0('0x31')](db['DeskConfiguration'][_0x48d0('0x2d')]);_0x353ef2['query']=_[_0x48d0('0x31')](_0x28f0b6[_0x48d0('0x30')]);_0x353ef2[_0x48d0('0x32')]=_[_0x48d0('0x33')](_0x353ef2[_0x48d0('0x2f')],_0x353ef2['query']);_0x286659[_0x48d0('0x34')]=_[_0x48d0('0x33')](_0x353ef2[_0x48d0('0x2f')],qs[_0x48d0('0x35')](_0x28f0b6['query'][_0x48d0('0x35')]));_0x286659[_0x48d0('0x34')]=_0x286659['attributes'][_0x48d0('0x47')]?_0x286659[_0x48d0('0x34')]:_0x353ef2[_0x48d0('0x2f')];_0x286659['order']=qs[_0x48d0('0x39')](_0x28f0b6[_0x48d0('0x30')][_0x48d0('0x39')]);_0x286659[_0x48d0('0x3a')]=qs['filters'](_['pick'](_0x28f0b6[_0x48d0('0x30')],_0x353ef2[_0x48d0('0x32')]));if(_0x28f0b6[_0x48d0('0x30')][_0x48d0('0x3b')]){_0x286659[_0x48d0('0x3a')]=_[_0x48d0('0x3c')](_0x286659[_0x48d0('0x3a')],{'$or':_[_0x48d0('0x2b')](_0x286659[_0x48d0('0x34')],function(_0x1b4c9a){var _0x10c7c8={};_0x10c7c8[_0x1b4c9a]={'$like':'%'+_0x28f0b6[_0x48d0('0x30')]['filter']+'%'};return _0x10c7c8;})});}_0x286659=_[_0x48d0('0x3c')]({},_0x286659,_0x28f0b6[_0x48d0('0x3f')]);return _0x3f269b[_0x48d0('0x4b')](_0x286659);}})[_0x48d0('0x25')](function(_0x2c94db){if(_0x2c94db){_0x25821a=_0x2c94db['length'];if(!_0x28f0b6[_0x48d0('0x30')][_0x48d0('0x36')](_0x48d0('0x37'))){_0x286659[_0x48d0('0x1d')]=qs[_0x48d0('0x1d')](_0x28f0b6[_0x48d0('0x30')]['limit']);_0x286659[_0x48d0('0x1b')]=qs[_0x48d0('0x1b')](_0x28f0b6['query'][_0x48d0('0x1b')]);}return _0x3f269b[_0x48d0('0x4b')](_0x286659);}})[_0x48d0('0x25')](function(_0x1441fe){if(_0x1441fe){return _0x1441fe?{'count':_0x25821a,'rows':_0x1441fe}:null;}})[_0x48d0('0x25')](respondWithResult(_0xa495a0,null))['catch'](handleError(_0xa495a0,null));};exports[_0x48d0('0x4c')]=function(_0x2d996c,_0x3c4965,_0x588957){if(_0x2d996c[_0x48d0('0x4a')]['id']){delete _0x2d996c[_0x48d0('0x4a')]['id'];}return db[_0x48d0('0x2c')][_0x48d0('0x4d')]({'where':{'id':_0x2d996c[_0x48d0('0x46')]['id']}})[_0x48d0('0x25')](handleEntityNotFound(_0x3c4965,null))['then'](function(_0x4f9154){if(_0x4f9154){_0x2d996c[_0x48d0('0x4a')][_0x48d0('0x4e')]=_0x4f9154['id'];_0x2d996c[_0x48d0('0x4a')]['Subjects']=integrations[_0x48d0('0x4f')](_0x2d996c['body'][_0x48d0('0x50')],_0x2d996c['body'][_0x48d0('0x3d')]);_0x2d996c[_0x48d0('0x4a')][_0x48d0('0x51')]=integrations['getDescriptions'](_0x2d996c['body'][_0x48d0('0x50')],_0x2d996c['body'][_0x48d0('0x3d')]);return db[_0x48d0('0x52')][_0x48d0('0x49')](_0x2d996c[_0x48d0('0x4a')],{'include':[{'model':db[_0x48d0('0x53')],'as':'Subjects'},{'model':db[_0x48d0('0x53')],'as':_0x48d0('0x51')}]});}return null;})[_0x48d0('0x25')](respondWithResult(_0x3c4965,null))[_0x48d0('0x44')](handleError(_0x3c4965,null));};exports['getFields']=function(_0x38866e,_0x2ad66e,_0x5a34bc){var _0x4bec99=[{'name':_0x48d0('0x54'),'label':'priority','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 _0x1e4322='';return db[_0x48d0('0x2c')][_0x48d0('0x4d')]({'where':{'id':_0x38866e[_0x48d0('0x46')]['id']},'attributes':['id',_0x48d0('0x55'),'authType',_0x48d0('0x56'),_0x48d0('0x57'),_0x48d0('0x58'),_0x48d0('0x59'),'token',_0x48d0('0x5a')]})[_0x48d0('0x25')](handleEntityNotFound(_0x2ad66e,null))[_0x48d0('0x25')](function(_0x45d574){if(_0x45d574){_0x1e4322=_0x45d574['remoteUri'];var _0x3a2a0c=_0x1e4322['slice'](-0x1);if(_0x3a2a0c==='/'){_0x1e4322=_0x1e4322[_0x48d0('0x5b')](0x0,_0x1e4322[_0x48d0('0x5c')](_0x3a2a0c));}var _0x1cbb01={'method':'GET','uri':util[_0x48d0('0x5d')](_0x48d0('0x5e'),_0x1e4322),'headers':{'Content-Type':_0x48d0('0x5f'),'Accept':_0x48d0('0x5f')},'json':!![]};if(_0x45d574[_0x48d0('0x60')]===_0x48d0('0x61')){_0x1cbb01[_0x48d0('0x62')][_0x48d0('0x63')]=util[_0x48d0('0x5d')]('Basic\x20%s',new Buffer(util['format'](_0x48d0('0x64'),_0x45d574['username'],_0x45d574['password']))[_0x48d0('0x65')](_0x48d0('0x66')));}return rp(_0x1cbb01)[_0x48d0('0x25')](function(_0x42937b){return _0x4bec99['concat'](_[_0x48d0('0x2b')](_0x42937b['_embedded'][_0x48d0('0x67')],function(_0x5d04b8){return{'id':_0x5d04b8[_0x48d0('0x29')],'name':_0x5d04b8['name'],'type':_0x5d04b8[_0x48d0('0x3d')],'active':_0x5d04b8[_0x48d0('0x68')],'label':_0x5d04b8['label'],'custom':!![]};}));});}})[_0x48d0('0x25')](function(_0x312b3b){return{'count':_0x312b3b['length'],'rows':_0x312b3b};})['then'](respondWithResult(_0x2ad66e,null))[_0x48d0('0x44')](function(_0xd63f18){var _0x4d2d9d=_0x38866e[_0x48d0('0x30')]['test']?0x1f4:_0xd63f18[_0x48d0('0x69')]||0x1f4;logger[_0x48d0('0x27')](_0x48d0('0x6a'),_0x48d0('0x6b'),_0x4d2d9d,JSON[_0x48d0('0x6c')](_0xd63f18));delete _0xd63f18[_0x48d0('0x29')];if(_0x4d2d9d===0x191){_0x4d2d9d=0x190;}_0x2ad66e[_0x48d0('0x1f')](_0x4d2d9d)[_0x48d0('0x6d')](_0x38866e[_0x48d0('0x30')][_0x48d0('0x6e')]?{'message':_0x48d0('0x6f'),'statusCode':_0xd63f18[_0x48d0('0x69')]}:_0xd63f18);});};
\ No newline at end of file
+var _0xe30c=['Subjects','getDescriptions','channel','DeskField','Descriptions','getFields','priority','remoteUri','authType','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','basic','Authorization','%s:%s','username','password','toString','_embedded','active','label','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','DeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update','getConfigurations','findOne','DeskConfiguration','order','addConfiguration'];(function(_0x2f2a6f,_0xe63e10){var _0x14441d=function(_0x3ab031){while(--_0x3ab031){_0x2f2a6f['push'](_0x2f2a6f['shift']());}};_0x14441d(++_0xe63e10);}(_0xe30c,0x104));var _0xce30=function(_0xba2501,_0x538b91){_0xba2501=_0xba2501-0x0;var _0x576522=_0xe30c[_0xba2501];return _0x576522;};'use strict';var emlformat=require(_0xce30('0x0'));var rimraf=require(_0xce30('0x1'));var zipdir=require(_0xce30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce30('0x3'));var moment=require(_0xce30('0x4'));var BPromise=require(_0xce30('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xce30('0x6'));var csv=require(_0xce30('0x7'));var ejs=require(_0xce30('0x8'));var fs=require('fs');var fs_extra=require(_0xce30('0x9'));var _=require(_0xce30('0xa'));var squel=require('squel');var crypto=require(_0xce30('0xb'));var jsforce=require(_0xce30('0xc'));var deskjs=require(_0xce30('0xd'));var toCsv=require(_0xce30('0x7'));var querystring=require(_0xce30('0xe'));var Papa=require(_0xce30('0xf'));var Redis=require(_0xce30('0x10'));var authService=require(_0xce30('0x11'));var qs=require(_0xce30('0x12'));var as=require(_0xce30('0x13'));var hardwareService=require(_0xce30('0x14'));var logger=require(_0xce30('0x15'))(_0xce30('0x16'));var utils=require(_0xce30('0x17'));var config=require(_0xce30('0x18'));var licenseUtil=require(_0xce30('0x19'));var db=require(_0xce30('0x1a'))['db'];var integrations=require(_0xce30('0x1b'));function respondWithStatusCode(_0x2479a8,_0x2e3cea){_0x2e3cea=_0x2e3cea||0xcc;return function(_0x3e19df){if(_0x3e19df){return _0x2479a8[_0xce30('0x1c')](_0x2e3cea);}return _0x2479a8[_0xce30('0x1d')](_0x2e3cea)[_0xce30('0x1e')]();};}function respondWithResult(_0x1ff44f,_0x7981b0){_0x7981b0=_0x7981b0||0xc8;return function(_0xe093ff){if(_0xe093ff){return _0x1ff44f[_0xce30('0x1d')](_0x7981b0)[_0xce30('0x1f')](_0xe093ff);}};}function respondWithFilteredResult(_0x4fc66d,_0x5dfd66){return function(_0xab20c2){if(_0xab20c2){var _0x361824=typeof _0x5dfd66[_0xce30('0x20')]===_0xce30('0x21')&&typeof _0x5dfd66['limit']==='undefined';var _0x45686e=_0xab20c2[_0xce30('0x22')];var _0xfb316e=_0x361824?0x0:_0x5dfd66['offset'];var _0x3fef82=_0x361824?_0xab20c2['count']:_0x5dfd66['offset']+_0x5dfd66[_0xce30('0x23')];var _0x2f527f;if(_0x3fef82>=_0x45686e){_0x3fef82=_0x45686e;_0x2f527f=0xc8;}else{_0x2f527f=0xce;}_0x4fc66d['status'](_0x2f527f);return _0x4fc66d[_0xce30('0x24')](_0xce30('0x25'),_0xfb316e+'-'+_0x3fef82+'/'+_0x45686e)[_0xce30('0x1f')](_0xab20c2);}return null;};}function patchUpdates(_0x20494a){return function(_0x297902){try{jsonpatch[_0xce30('0x26')](_0x297902,_0x20494a,!![]);}catch(_0x2193df){return BPromise[_0xce30('0x27')](_0x2193df);}return _0x297902[_0xce30('0x28')]();};}function saveUpdates(_0x414b7c,_0x3d8841){return function(_0xfaca08){if(_0xfaca08){return _0xfaca08['update'](_0x414b7c)[_0xce30('0x29')](function(_0x51534f){return _0x51534f;});}return null;};}function removeEntity(_0x1373c4,_0x1f045b){return function(_0x490699){if(_0x490699){return _0x490699[_0xce30('0x2a')]()[_0xce30('0x29')](function(){_0x1373c4[_0xce30('0x1d')](0xcc)[_0xce30('0x1e')]();});}};}function handleEntityNotFound(_0x2c25b4,_0x384dc8){return function(_0x144bcf){if(!_0x144bcf){_0x2c25b4[_0xce30('0x1c')](0x194);}return _0x144bcf;};}function handleError(_0x467a85,_0x2aefac){_0x2aefac=_0x2aefac||0x1f4;return function(_0x4753bc){logger[_0xce30('0x2b')](_0x4753bc[_0xce30('0x2c')]);if(_0x4753bc[_0xce30('0x2d')]){delete _0x4753bc[_0xce30('0x2d')];}_0x467a85['status'](_0x2aefac)['send'](_0x4753bc);};}exports['index']=function(_0x2d300e,_0x1d7cf7){var _0x542764={},_0x5ede89={},_0x5de159={'count':0x0,'rows':[]};var _0x38701b=_[_0xce30('0x2e')](db[_0xce30('0x2f')]['rawAttributes'],function(_0x2deb09){return{'name':_0x2deb09[_0xce30('0x30')],'type':_0x2deb09[_0xce30('0x31')][_0xce30('0x32')]};});_0x5ede89[_0xce30('0x33')]=_[_0xce30('0x2e')](_0x38701b,'name');_0x5ede89[_0xce30('0x34')]=_[_0xce30('0x35')](_0x2d300e[_0xce30('0x34')]);_0x5ede89[_0xce30('0x36')]=_[_0xce30('0x37')](_0x5ede89[_0xce30('0x33')],_0x5ede89[_0xce30('0x34')]);_0x542764[_0xce30('0x38')]=_[_0xce30('0x37')](_0x5ede89[_0xce30('0x33')],qs[_0xce30('0x39')](_0x2d300e['query'][_0xce30('0x39')]));_0x542764['attributes']=_0x542764['attributes'][_0xce30('0x3a')]?_0x542764[_0xce30('0x38')]:_0x5ede89[_0xce30('0x33')];if(!_0x2d300e[_0xce30('0x34')][_0xce30('0x3b')]('nolimit')){_0x542764[_0xce30('0x23')]=qs[_0xce30('0x23')](_0x2d300e['query'][_0xce30('0x23')]);_0x542764['offset']=qs[_0xce30('0x20')](_0x2d300e[_0xce30('0x34')][_0xce30('0x20')]);}_0x542764['order']=qs[_0xce30('0x3c')](_0x2d300e[_0xce30('0x34')]['sort']);_0x542764[_0xce30('0x3d')]=qs[_0xce30('0x36')](_[_0xce30('0x3e')](_0x2d300e['query'],_0x5ede89[_0xce30('0x36')]),_0x38701b);if(_0x2d300e[_0xce30('0x34')][_0xce30('0x3f')]){_0x542764[_0xce30('0x3d')]=_[_0xce30('0x40')](_0x542764[_0xce30('0x3d')],{'$or':_[_0xce30('0x2e')](_0x38701b,function(_0x473e31){if(_0x473e31[_0xce30('0x31')]!=='VIRTUAL'){var _0x18dd9d={};_0x18dd9d[_0x473e31[_0xce30('0x2d')]]={'$like':'%'+_0x2d300e[_0xce30('0x34')][_0xce30('0x3f')]+'%'};return _0x18dd9d;}})});}_0x542764=_[_0xce30('0x40')]({},_0x542764,_0x2d300e[_0xce30('0x41')]);var _0x512209={'where':_0x542764['where']};return db[_0xce30('0x2f')][_0xce30('0x22')](_0x512209)[_0xce30('0x29')](function(_0x34cbcd){_0x5de159[_0xce30('0x22')]=_0x34cbcd;if(_0x2d300e['query'][_0xce30('0x42')]){_0x542764[_0xce30('0x43')]=[{'all':!![]}];}return db[_0xce30('0x2f')][_0xce30('0x44')](_0x542764);})[_0xce30('0x29')](function(_0x431ec2){_0x5de159['rows']=_0x431ec2;return _0x5de159;})[_0xce30('0x29')](respondWithFilteredResult(_0x1d7cf7,_0x542764))[_0xce30('0x45')](handleError(_0x1d7cf7,null));};exports[_0xce30('0x46')]=function(_0x364be2,_0x50bac7){var _0x238b8f={'raw':![],'where':{'id':_0x364be2[_0xce30('0x47')]['id']}},_0xe617f0={};_0xe617f0[_0xce30('0x33')]=_[_0xce30('0x35')](db[_0xce30('0x2f')][_0xce30('0x48')]);_0xe617f0['query']=_[_0xce30('0x35')](_0x364be2[_0xce30('0x34')]);_0xe617f0['filters']=_[_0xce30('0x37')](_0xe617f0[_0xce30('0x33')],_0xe617f0[_0xce30('0x34')]);_0x238b8f[_0xce30('0x38')]=_[_0xce30('0x37')](_0xe617f0['model'],qs[_0xce30('0x39')](_0x364be2[_0xce30('0x34')]['fields']));_0x238b8f['attributes']=_0x238b8f[_0xce30('0x38')]['length']?_0x238b8f['attributes']:_0xe617f0[_0xce30('0x33')];if(_0x364be2['query'][_0xce30('0x42')]){_0x238b8f['include']=[{'all':!![]}];}_0x238b8f=_['merge']({},_0x238b8f,_0x364be2[_0xce30('0x41')]);return db[_0xce30('0x2f')][_0xce30('0x49')](_0x238b8f)[_0xce30('0x29')](handleEntityNotFound(_0x50bac7,null))[_0xce30('0x29')](respondWithResult(_0x50bac7,null))[_0xce30('0x45')](handleError(_0x50bac7,null));};exports[_0xce30('0x4a')]=function(_0x1c94c8,_0x16b361){return db[_0xce30('0x2f')][_0xce30('0x4a')](_0x1c94c8[_0xce30('0x4b')],{})[_0xce30('0x29')](respondWithResult(_0x16b361,0xc9))[_0xce30('0x45')](handleError(_0x16b361,null));};exports[_0xce30('0x4c')]=function(_0x2c1c9f,_0x402b59){if(_0x2c1c9f[_0xce30('0x4b')]['id']){delete _0x2c1c9f['body']['id'];}return db['DeskAccount'][_0xce30('0x49')]({'where':{'id':_0x2c1c9f['params']['id']}})[_0xce30('0x29')](handleEntityNotFound(_0x402b59,null))['then'](saveUpdates(_0x2c1c9f[_0xce30('0x4b')],null))['then'](respondWithResult(_0x402b59,null))[_0xce30('0x45')](handleError(_0x402b59,null));};exports[_0xce30('0x2a')]=function(_0x2c62d1,_0x2a210c){return db['DeskAccount'][_0xce30('0x49')]({'where':{'id':_0x2c62d1[_0xce30('0x47')]['id']}})[_0xce30('0x29')](handleEntityNotFound(_0x2a210c,null))[_0xce30('0x29')](removeEntity(_0x2a210c,null))[_0xce30('0x45')](handleError(_0x2a210c,null));};exports[_0xce30('0x4d')]=function(_0x341d53,_0x2d556e,_0x31b797){var _0x4c5b00={};var _0x4b7ce1={};var _0x90a306;var _0x234cd9;return db[_0xce30('0x2f')][_0xce30('0x4e')]({'where':{'id':_0x341d53[_0xce30('0x47')]['id']}})[_0xce30('0x29')](handleEntityNotFound(_0x2d556e,null))[_0xce30('0x29')](function(_0x22612c){if(_0x22612c){_0x90a306=_0x22612c;_0x4b7ce1[_0xce30('0x33')]=_[_0xce30('0x35')](db[_0xce30('0x4f')][_0xce30('0x48')]);_0x4b7ce1[_0xce30('0x34')]=_[_0xce30('0x35')](_0x341d53[_0xce30('0x34')]);_0x4b7ce1[_0xce30('0x36')]=_[_0xce30('0x37')](_0x4b7ce1[_0xce30('0x33')],_0x4b7ce1[_0xce30('0x34')]);_0x4c5b00[_0xce30('0x38')]=_[_0xce30('0x37')](_0x4b7ce1[_0xce30('0x33')],qs['fields'](_0x341d53[_0xce30('0x34')]['fields']));_0x4c5b00[_0xce30('0x38')]=_0x4c5b00[_0xce30('0x38')][_0xce30('0x3a')]?_0x4c5b00[_0xce30('0x38')]:_0x4b7ce1[_0xce30('0x33')];_0x4c5b00[_0xce30('0x50')]=qs[_0xce30('0x3c')](_0x341d53[_0xce30('0x34')][_0xce30('0x3c')]);_0x4c5b00[_0xce30('0x3d')]=qs['filters'](_[_0xce30('0x3e')](_0x341d53[_0xce30('0x34')],_0x4b7ce1[_0xce30('0x36')]));if(_0x341d53[_0xce30('0x34')][_0xce30('0x3f')]){_0x4c5b00[_0xce30('0x3d')]=_[_0xce30('0x40')](_0x4c5b00[_0xce30('0x3d')],{'$or':_[_0xce30('0x2e')](_0x4c5b00[_0xce30('0x38')],function(_0x15960f){var _0xf1bf2e={};_0xf1bf2e[_0x15960f]={'$like':'%'+_0x341d53[_0xce30('0x34')]['filter']+'%'};return _0xf1bf2e;})});}_0x4c5b00=_[_0xce30('0x40')]({},_0x4c5b00,_0x341d53['options']);return _0x90a306[_0xce30('0x4d')](_0x4c5b00);}})[_0xce30('0x29')](function(_0x4fe9da){if(_0x4fe9da){_0x234cd9=_0x4fe9da[_0xce30('0x3a')];if(!_0x341d53[_0xce30('0x34')][_0xce30('0x3b')]('nolimit')){_0x4c5b00[_0xce30('0x23')]=qs[_0xce30('0x23')](_0x341d53['query'][_0xce30('0x23')]);_0x4c5b00[_0xce30('0x20')]=qs['offset'](_0x341d53[_0xce30('0x34')][_0xce30('0x20')]);}return _0x90a306[_0xce30('0x4d')](_0x4c5b00);}})[_0xce30('0x29')](function(_0x4554f7){if(_0x4554f7){return _0x4554f7?{'count':_0x234cd9,'rows':_0x4554f7}:null;}})[_0xce30('0x29')](respondWithResult(_0x2d556e,null))['catch'](handleError(_0x2d556e,null));};exports[_0xce30('0x51')]=function(_0x52b87d,_0x480c03,_0x51e7c6){if(_0x52b87d[_0xce30('0x4b')]['id']){delete _0x52b87d[_0xce30('0x4b')]['id'];}return db[_0xce30('0x2f')][_0xce30('0x4e')]({'where':{'id':_0x52b87d['params']['id']}})['then'](handleEntityNotFound(_0x480c03,null))['then'](function(_0x211674){if(_0x211674){_0x52b87d[_0xce30('0x4b')]['AccountId']=_0x211674['id'];_0x52b87d[_0xce30('0x4b')][_0xce30('0x52')]=integrations['getSubjects'](_0x52b87d[_0xce30('0x4b')]['channel'],_0x52b87d['body'][_0xce30('0x31')]);_0x52b87d[_0xce30('0x4b')]['Descriptions']=integrations[_0xce30('0x53')](_0x52b87d['body'][_0xce30('0x54')],_0x52b87d['body'][_0xce30('0x31')]);return db['DeskConfiguration'][_0xce30('0x4a')](_0x52b87d[_0xce30('0x4b')],{'include':[{'model':db[_0xce30('0x55')],'as':_0xce30('0x52')},{'model':db['DeskField'],'as':_0xce30('0x56')}]});}return null;})[_0xce30('0x29')](respondWithResult(_0x480c03,null))[_0xce30('0x45')](handleError(_0x480c03,null));};exports[_0xce30('0x57')]=function(_0x5a5cf5,_0xf64749,_0x4c2d89){var _0x21b78d=[{'name':'priority','label':_0xce30('0x58'),'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 _0x21c628='';return db[_0xce30('0x2f')][_0xce30('0x4e')]({'where':{'id':_0x5a5cf5[_0xce30('0x47')]['id']},'attributes':['id',_0xce30('0x59'),_0xce30('0x5a'),'username','password',_0xce30('0x5b'),'consumerSecret',_0xce30('0x5c'),_0xce30('0x5d')]})[_0xce30('0x29')](handleEntityNotFound(_0xf64749,null))[_0xce30('0x29')](function(_0x3915f8){if(_0x3915f8){_0x21c628=_0x3915f8['remoteUri'];var _0x4b8886=_0x21c628[_0xce30('0x5e')](-0x1);if(_0x4b8886==='/'){_0x21c628=_0x21c628[_0xce30('0x5f')](0x0,_0x21c628[_0xce30('0x60')](_0x4b8886));}var _0xc91dba={'method':_0xce30('0x61'),'uri':util[_0xce30('0x62')]('%s/custom_fields',_0x21c628),'headers':{'Content-Type':_0xce30('0x63'),'Accept':_0xce30('0x63')},'json':!![]};if(_0x3915f8[_0xce30('0x5a')]===_0xce30('0x64')){_0xc91dba['headers'][_0xce30('0x65')]=util[_0xce30('0x62')]('Basic\x20%s',new Buffer(util['format'](_0xce30('0x66'),_0x3915f8[_0xce30('0x67')],_0x3915f8[_0xce30('0x68')]))[_0xce30('0x69')]('base64'));}return rp(_0xc91dba)['then'](function(_0xea65bb){return _0x21b78d['concat'](_[_0xce30('0x2e')](_0xea65bb[_0xce30('0x6a')]['entries'],function(_0x4635ac){return{'id':_0x4635ac[_0xce30('0x2d')],'name':_0x4635ac['name'],'type':_0x4635ac[_0xce30('0x31')],'active':_0x4635ac[_0xce30('0x6b')],'label':_0x4635ac[_0xce30('0x6c')],'custom':!![]};}));});}})['then'](function(_0x86075c){return{'count':_0x86075c[_0xce30('0x3a')],'rows':_0x86075c};})['then'](respondWithResult(_0xf64749,null))[_0xce30('0x45')](function(_0x4b8033){var _0x14b3c4=_0x5a5cf5['query'][_0xce30('0x6d')]?0x1f4:_0x4b8033[_0xce30('0x6e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xce30('0x57'),_0x14b3c4,JSON[_0xce30('0x6f')](_0x4b8033));delete _0x4b8033[_0xce30('0x2d')];if(_0x14b3c4===0x191){_0x14b3c4=0x190;}_0xf64749['status'](_0x14b3c4)[_0xce30('0x70')](_0x5a5cf5[_0xce30('0x34')]['test']?{'message':_0xce30('0x71'),'statusCode':_0x4b8033['statusCode']}:_0x4b8033);});};
\ No newline at end of file
index e4e6c04..b12d738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8433=['request-promise','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','define','util','../../config/logger','moment','bluebird'];(function(_0x589887,_0xbeff7e){var _0x27bdc2=function(_0x106b39){while(--_0x106b39){_0x589887['push'](_0x589887['shift']());}};_0x27bdc2(++_0xbeff7e);}(_0x8433,0xdd));var _0x3843=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x8433[_0x25662e];return _0x59b7bc;};'use strict';var _=require('lodash');var util=require(_0x3843('0x0'));var logger=require(_0x3843('0x1'))('api');var moment=require(_0x3843('0x2'));var BPromise=require(_0x3843('0x3'));var rp=require(_0x3843('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3843('0x5'));var config=require('../../config/environment');var attributes=require(_0x3843('0x6'));var integrations=require(_0x3843('0x7'));module['exports']=function(_0x246068,_0x5cacc5){return _0x246068[_0x3843('0x8')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcbaf=['exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes'];(function(_0x3d7c68,_0x3024a3){var _0x4850db=function(_0x15fd71){while(--_0x15fd71){_0x3d7c68['push'](_0x3d7c68['shift']());}};_0x4850db(++_0x3024a3);}(_0xcbaf,0x147));var _0xfcba=function(_0x58c446,_0x5da229){_0x58c446=_0x58c446-0x0;var _0x2dec1f=_0xcbaf[_0x58c446];return _0x2dec1f;};'use strict';var _=require(_0xfcba('0x0'));var util=require(_0xfcba('0x1'));var logger=require(_0xfcba('0x2'))(_0xfcba('0x3'));var moment=require('moment');var BPromise=require(_0xfcba('0x4'));var rp=require(_0xfcba('0x5'));var fs=require('fs');var path=require(_0xfcba('0x6'));var rimraf=require('rimraf');var config=require(_0xfcba('0x7'));var attributes=require(_0xfcba('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xfcba('0x9')]=function(_0x4c2bbb,_0xaf4142){return _0x4c2bbb['define'](_0xfcba('0xa'),attributes,{'tableName':_0xfcba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2630e33..a9b6c83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87bd=['then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetDeskAccount','options','attributes','limit','map','include','model','ShowDeskAccount','DeskAccount','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x434748,_0x4fceb6){var _0x177733=function(_0x160c23){while(--_0x160c23){_0x434748['push'](_0x434748['shift']());}};_0x177733(++_0x4fceb6);}(_0x87bd,0x7b));var _0xd87b=function(_0x1b40df,_0x48fbea){_0x1b40df=_0x1b40df-0x0;var _0x115723=_0x87bd[_0x1b40df];return _0x115723;};'use strict';var _=require(_0xd87b('0x0'));var util=require(_0xd87b('0x1'));var moment=require(_0xd87b('0x2'));var BPromise=require(_0xd87b('0x3'));var rs=require(_0xd87b('0x4'));var fs=require('fs');var Redis=require(_0xd87b('0x5'));var db=require(_0xd87b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd87b('0x7'))(_0xd87b('0x8'));var config=require(_0xd87b('0x9'));var jayson=require(_0xd87b('0xa'));var client=jayson[_0xd87b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bf9e5,_0x48f9ae,_0x2c69f4){return new BPromise(function(_0x12ed1a,_0x59d7da){return client[_0xd87b('0xc')](_0x1bf9e5,_0x2c69f4)[_0xd87b('0xd')](function(_0x7c02af){logger[_0xd87b('0xe')](_0xd87b('0xf'),_0x48f9ae,_0xd87b('0x10'));logger[_0xd87b('0x11')](_0xd87b('0x12'),_0x48f9ae,_0xd87b('0x10'),JSON[_0xd87b('0x13')](_0x7c02af));if(_0x7c02af[_0xd87b('0x14')]){if(_0x7c02af[_0xd87b('0x14')]['code']===0x1f4){logger[_0xd87b('0x14')](_0xd87b('0xf'),_0x48f9ae,_0x7c02af[_0xd87b('0x14')][_0xd87b('0x15')]);return _0x59d7da(_0x7c02af[_0xd87b('0x14')]['message']);}logger[_0xd87b('0x14')](_0xd87b('0xf'),_0x48f9ae,_0x7c02af[_0xd87b('0x14')][_0xd87b('0x15')]);return _0x12ed1a(_0x7c02af[_0xd87b('0x14')]['message']);}else{logger[_0xd87b('0xe')](_0xd87b('0xf'),_0x48f9ae,'request\x20sent');_0x12ed1a(_0x7c02af['result'][_0xd87b('0x15')]);}})[_0xd87b('0x16')](function(_0x349c80){logger[_0xd87b('0x14')](_0xd87b('0xf'),_0x48f9ae,_0x349c80);_0x59d7da(_0x349c80);});});}exports[_0xd87b('0x17')]=function(_0x214cf7){var _0x25d2b4=this;return new Promise(function(_0x155ac9,_0x81652e){return db['DeskAccount']['findAll']({'raw':_0x214cf7[_0xd87b('0x18')]?_0x214cf7['options']['raw']===undefined?!![]:![]:!![],'where':_0x214cf7[_0xd87b('0x18')]?_0x214cf7[_0xd87b('0x18')]['where']||null:null,'attributes':_0x214cf7[_0xd87b('0x18')]?_0x214cf7[_0xd87b('0x18')][_0xd87b('0x19')]||null:null,'limit':_0x214cf7[_0xd87b('0x18')]?_0x214cf7[_0xd87b('0x18')][_0xd87b('0x1a')]||null:null,'include':_0x214cf7[_0xd87b('0x18')]?_0x214cf7[_0xd87b('0x18')]['include']?_[_0xd87b('0x1b')](_0x214cf7['options'][_0xd87b('0x1c')],function(_0x3a669d){return{'model':db[_0x3a669d[_0xd87b('0x1d')]],'as':_0x3a669d['as'],'attributes':_0x3a669d[_0xd87b('0x19')],'include':_0x3a669d['include']?_[_0xd87b('0x1b')](_0x3a669d[_0xd87b('0x1c')],function(_0x999eba){return{'model':db[_0x999eba[_0xd87b('0x1d')]],'as':_0x999eba['as'],'attributes':_0x999eba[_0xd87b('0x19')],'include':_0x999eba[_0xd87b('0x1c')]?_['map'](_0x999eba['include'],function(_0x52cb7f){return{'model':db[_0x52cb7f[_0xd87b('0x1d')]],'as':_0x52cb7f['as'],'attributes':_0x52cb7f[_0xd87b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd87b('0xd')](function(_0xda72cd){logger[_0xd87b('0xe')]('GetDeskAccount',_0x214cf7);logger['debug'](_0xd87b('0x17'),_0x214cf7,JSON['stringify'](_0xda72cd));_0x155ac9(_0xda72cd);})['catch'](function(_0x4b0a11){logger[_0xd87b('0x14')](_0xd87b('0x17'),_0x4b0a11['message'],_0x214cf7);_0x81652e(_0x25d2b4[_0xd87b('0x14')](0x1f4,_0x4b0a11[_0xd87b('0x15')]));});});};exports[_0xd87b('0x1e')]=function(_0x433b73){var _0x51933d=this;return new Promise(function(_0x2d6a7,_0x387c11){return db[_0xd87b('0x1f')]['find']({'raw':_0x433b73[_0xd87b('0x18')]?_0x433b73[_0xd87b('0x18')][_0xd87b('0x20')]===undefined?!![]:![]:!![],'where':_0x433b73[_0xd87b('0x18')]?_0x433b73[_0xd87b('0x18')][_0xd87b('0x21')]||null:null,'attributes':_0x433b73['options']?_0x433b73[_0xd87b('0x18')]['attributes']||null:null,'include':_0x433b73[_0xd87b('0x18')]?_0x433b73['options'][_0xd87b('0x1c')]?_[_0xd87b('0x1b')](_0x433b73[_0xd87b('0x18')][_0xd87b('0x1c')],function(_0x3dc983){return{'model':db[_0x3dc983[_0xd87b('0x1d')]],'as':_0x3dc983['as'],'attributes':_0x3dc983[_0xd87b('0x19')],'include':_0x3dc983[_0xd87b('0x1c')]?_[_0xd87b('0x1b')](_0x3dc983[_0xd87b('0x1c')],function(_0x3cf7a8){return{'model':db[_0x3cf7a8[_0xd87b('0x1d')]],'as':_0x3cf7a8['as'],'attributes':_0x3cf7a8['attributes'],'include':_0x3cf7a8[_0xd87b('0x1c')]?_[_0xd87b('0x1b')](_0x3cf7a8[_0xd87b('0x1c')],function(_0x4ca34b){return{'model':db[_0x4ca34b[_0xd87b('0x1d')]],'as':_0x4ca34b['as'],'attributes':_0x4ca34b[_0xd87b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35f32f){logger[_0xd87b('0xe')](_0xd87b('0x1e'),_0x433b73);logger[_0xd87b('0x11')](_0xd87b('0x1e'),_0x433b73,JSON['stringify'](_0x35f32f));_0x2d6a7(_0x35f32f);})[_0xd87b('0x16')](function(_0x28ecf9){logger['error'](_0xd87b('0x1e'),_0x28ecf9[_0xd87b('0x15')],_0x433b73);_0x387c11(_0x51933d[_0xd87b('0x14')](0x1f4,_0x28ecf9['message']));});});};
\ No newline at end of file
+var _0xceeb=['result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','map','include','model','attributes','find','ShowDeskAccount','debug','lodash','moment','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x52f6fd,_0x439dae){var _0x4b770a=function(_0x32561a){while(--_0x32561a){_0x52f6fd['push'](_0x52f6fd['shift']());}};_0x4b770a(++_0x439dae);}(_0xceeb,0x1cf));var _0xbcee=function(_0xb7385,_0x276ed5){_0xb7385=_0xb7385-0x0;var _0x89d92b=_0xceeb[_0xb7385];return _0x89d92b;};'use strict';var _=require(_0xbcee('0x0'));var util=require('util');var moment=require(_0xbcee('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcee('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbcee('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbcee('0x4'));var client=jayson[_0xbcee('0x5')][_0xbcee('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1211f4,_0x150108,_0x1ed29f){return new BPromise(function(_0x42cdea,_0x5d221f){return client[_0xbcee('0x7')](_0x1211f4,_0x1ed29f)[_0xbcee('0x8')](function(_0x31318b){logger[_0xbcee('0x9')](_0xbcee('0xa'),_0x150108,_0xbcee('0xb'));logger['debug'](_0xbcee('0xc'),_0x150108,_0xbcee('0xb'),JSON[_0xbcee('0xd')](_0x31318b));if(_0x31318b[_0xbcee('0xe')]){if(_0x31318b[_0xbcee('0xe')][_0xbcee('0xf')]===0x1f4){logger[_0xbcee('0xe')](_0xbcee('0xa'),_0x150108,_0x31318b[_0xbcee('0xe')][_0xbcee('0x10')]);return _0x5d221f(_0x31318b[_0xbcee('0xe')][_0xbcee('0x10')]);}logger[_0xbcee('0xe')](_0xbcee('0xa'),_0x150108,_0x31318b['error'][_0xbcee('0x10')]);return _0x42cdea(_0x31318b[_0xbcee('0xe')][_0xbcee('0x10')]);}else{logger['info'](_0xbcee('0xa'),_0x150108,_0xbcee('0xb'));_0x42cdea(_0x31318b[_0xbcee('0x11')]['message']);}})[_0xbcee('0x12')](function(_0x132fb4){logger['error'](_0xbcee('0xa'),_0x150108,_0x132fb4);_0x5d221f(_0x132fb4);});});}exports[_0xbcee('0x13')]=function(_0x2dfb01){var _0x5ab363=this;return new Promise(function(_0x3f911d,_0x4547ef){return db[_0xbcee('0x14')][_0xbcee('0x15')]({'raw':_0x2dfb01[_0xbcee('0x16')]?_0x2dfb01['options'][_0xbcee('0x17')]===undefined?!![]:![]:!![],'where':_0x2dfb01[_0xbcee('0x16')]?_0x2dfb01[_0xbcee('0x16')][_0xbcee('0x18')]||null:null,'attributes':_0x2dfb01[_0xbcee('0x16')]?_0x2dfb01[_0xbcee('0x16')]['attributes']||null:null,'limit':_0x2dfb01[_0xbcee('0x16')]?_0x2dfb01[_0xbcee('0x16')]['limit']||null:null,'include':_0x2dfb01[_0xbcee('0x16')]?_0x2dfb01[_0xbcee('0x16')]['include']?_[_0xbcee('0x19')](_0x2dfb01[_0xbcee('0x16')][_0xbcee('0x1a')],function(_0x5ce604){return{'model':db[_0x5ce604[_0xbcee('0x1b')]],'as':_0x5ce604['as'],'attributes':_0x5ce604[_0xbcee('0x1c')],'include':_0x5ce604[_0xbcee('0x1a')]?_[_0xbcee('0x19')](_0x5ce604[_0xbcee('0x1a')],function(_0x3b0c0b){return{'model':db[_0x3b0c0b[_0xbcee('0x1b')]],'as':_0x3b0c0b['as'],'attributes':_0x3b0c0b[_0xbcee('0x1c')],'include':_0x3b0c0b[_0xbcee('0x1a')]?_['map'](_0x3b0c0b[_0xbcee('0x1a')],function(_0x138dcc){return{'model':db[_0x138dcc[_0xbcee('0x1b')]],'as':_0x138dcc['as'],'attributes':_0x138dcc[_0xbcee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbcee('0x8')](function(_0x2d2c8){logger[_0xbcee('0x9')](_0xbcee('0x13'),_0x2dfb01);logger['debug'](_0xbcee('0x13'),_0x2dfb01,JSON['stringify'](_0x2d2c8));_0x3f911d(_0x2d2c8);})[_0xbcee('0x12')](function(_0x28aefc){logger[_0xbcee('0xe')](_0xbcee('0x13'),_0x28aefc[_0xbcee('0x10')],_0x2dfb01);_0x4547ef(_0x5ab363[_0xbcee('0xe')](0x1f4,_0x28aefc[_0xbcee('0x10')]));});});};exports['ShowDeskAccount']=function(_0x1b0b22){var _0x228a70=this;return new Promise(function(_0x3e5f74,_0x17a051){return db[_0xbcee('0x14')][_0xbcee('0x1d')]({'raw':_0x1b0b22['options']?_0x1b0b22[_0xbcee('0x16')][_0xbcee('0x17')]===undefined?!![]:![]:!![],'where':_0x1b0b22[_0xbcee('0x16')]?_0x1b0b22[_0xbcee('0x16')]['where']||null:null,'attributes':_0x1b0b22[_0xbcee('0x16')]?_0x1b0b22[_0xbcee('0x16')][_0xbcee('0x1c')]||null:null,'include':_0x1b0b22[_0xbcee('0x16')]?_0x1b0b22[_0xbcee('0x16')][_0xbcee('0x1a')]?_[_0xbcee('0x19')](_0x1b0b22[_0xbcee('0x16')]['include'],function(_0x12a512){return{'model':db[_0x12a512[_0xbcee('0x1b')]],'as':_0x12a512['as'],'attributes':_0x12a512['attributes'],'include':_0x12a512[_0xbcee('0x1a')]?_[_0xbcee('0x19')](_0x12a512['include'],function(_0x74f831){return{'model':db[_0x74f831[_0xbcee('0x1b')]],'as':_0x74f831['as'],'attributes':_0x74f831['attributes'],'include':_0x74f831[_0xbcee('0x1a')]?_[_0xbcee('0x19')](_0x74f831[_0xbcee('0x1a')],function(_0x32b46c){return{'model':db[_0x32b46c[_0xbcee('0x1b')]],'as':_0x32b46c['as'],'attributes':_0x32b46c[_0xbcee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbcee('0x8')](function(_0x5ccfbe){logger[_0xbcee('0x9')](_0xbcee('0x1e'),_0x1b0b22);logger[_0xbcee('0x1f')](_0xbcee('0x1e'),_0x1b0b22,JSON['stringify'](_0x5ccfbe));_0x3e5f74(_0x5ccfbe);})[_0xbcee('0x12')](function(_0x12700d){logger[_0xbcee('0xe')](_0xbcee('0x1e'),_0x12700d['message'],_0x1b0b22);_0x17a051(_0x228a70[_0xbcee('0xe')](0x1f4,_0x12700d['message']));});});};
\ No newline at end of file
index 7b074b2..b2a70af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x12e13a,_0x3f8461){var _0xf4cf3c=function(_0x54012f){while(--_0x54012f){_0x12e13a['push'](_0x12e13a['shift']());}};_0xf4cf3c(++_0x3f8461);}(_0x3e74,0x175));var _0x43e7=function(_0xac418e,_0x32196d){_0xac418e=_0xac418e-0x0;var _0x5340af=_0x3e74[_0xac418e];return _0x5340af;};'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/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router;
\ No newline at end of file
+var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x1c3b6c,_0x2407ac){var _0x5463e5=function(_0x125cc1){while(--_0x125cc1){_0x1c3b6c['push'](_0x1c3b6c['shift']());}};_0x5463e5(++_0x2407ac);}(_0x3e74,0x175));var _0x43e7=function(_0x3145d8,_0x3776a6){_0x3145d8=_0x3145d8-0x0;var _0x2256fb=_0x3e74[_0x3145d8];return _0x2256fb;};'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/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router;
\ No newline at end of file
index 156727d..98ce0b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde32=['STRING','sequelize'];(function(_0x44d3fe,_0x22b692){var _0x3cf76b=function(_0x40be79){while(--_0x40be79){_0x44d3fe['push'](_0x44d3fe['shift']());}};_0x3cf76b(++_0x22b692);}(_0xde32,0x12b));var _0x2de3=function(_0x32da01,_0xc772a2){_0x32da01=_0x32da01-0x0;var _0x324fbe=_0xde32[_0x32da01];return _0x324fbe;};'use strict';var Sequelize=require(_0x2de3('0x0'));module['exports']={'name':{'type':Sequelize[_0x2de3('0x1')]},'description':{'type':Sequelize[_0x2de3('0x1')]}};
\ No newline at end of file
+var _0x3ff9=['exports','STRING'];(function(_0x491719,_0x24a4ec){var _0x2b7d51=function(_0x1e8f0c){while(--_0x1e8f0c){_0x491719['push'](_0x491719['shift']());}};_0x2b7d51(++_0x24a4ec);}(_0x3ff9,0x1b4));var _0x93ff=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x3ff9[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require('sequelize');module[_0x93ff('0x0')]={'name':{'type':Sequelize[_0x93ff('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 51d0773..37b3497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a8a=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','status','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','DeskField','order','sort','getFields','findOne','getSubjects','getDescriptions','pick','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox'];(function(_0xec11e3,_0x56b091){var _0x42e7d5=function(_0x27acce){while(--_0x27acce){_0xec11e3['push'](_0xec11e3['shift']());}};_0x42e7d5(++_0x56b091);}(_0x2a8a,0xf4));var _0xa2a8=function(_0x75ea9f,_0x46e49b){_0x75ea9f=_0x75ea9f-0x0;var _0x420283=_0x2a8a[_0x75ea9f];return _0x420283;};'use strict';var emlformat=require(_0xa2a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa2a8('0x1'));var jsonpatch=require(_0xa2a8('0x2'));var rp=require(_0xa2a8('0x3'));var moment=require('moment');var BPromise=require(_0xa2a8('0x4'));var Mustache=require('mustache');var util=require(_0xa2a8('0x5'));var path=require(_0xa2a8('0x6'));var sox=require(_0xa2a8('0x7'));var csv=require('to-csv');var ejs=require(_0xa2a8('0x8'));var fs=require('fs');var fs_extra=require(_0xa2a8('0x9'));var _=require(_0xa2a8('0xa'));var squel=require(_0xa2a8('0xb'));var crypto=require(_0xa2a8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa2a8('0xd'));var toCsv=require(_0xa2a8('0xe'));var querystring=require(_0xa2a8('0xf'));var Papa=require(_0xa2a8('0x10'));var Redis=require(_0xa2a8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa2a8('0x12'));var as=require(_0xa2a8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2a8('0x14'))(_0xa2a8('0x15'));var utils=require(_0xa2a8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa2a8('0x17'));var db=require(_0xa2a8('0x18'))['db'];function respondWithStatusCode(_0x4f918b,_0x2a4de6){_0x2a4de6=_0x2a4de6||0xcc;return function(_0x1fe82a){if(_0x1fe82a){return _0x4f918b['sendStatus'](_0x2a4de6);}return _0x4f918b['status'](_0x2a4de6)[_0xa2a8('0x19')]();};}function respondWithResult(_0x212860,_0x2f2d1a){_0x2f2d1a=_0x2f2d1a||0xc8;return function(_0xee6c84){if(_0xee6c84){return _0x212860['status'](_0x2f2d1a)[_0xa2a8('0x1a')](_0xee6c84);}};}function respondWithFilteredResult(_0x55a3c7,_0x4ec6c6){return function(_0x338456){if(_0x338456){var _0x9957a6=typeof _0x4ec6c6[_0xa2a8('0x1b')]==='undefined'&&typeof _0x4ec6c6[_0xa2a8('0x1c')]===_0xa2a8('0x1d');var _0x5bed24=_0x338456['count'];var _0x1b36dd=_0x9957a6?0x0:_0x4ec6c6[_0xa2a8('0x1b')];var _0x269b7=_0x9957a6?_0x338456['count']:_0x4ec6c6[_0xa2a8('0x1b')]+_0x4ec6c6[_0xa2a8('0x1c')];var _0x4a56ed;if(_0x269b7>=_0x5bed24){_0x269b7=_0x5bed24;_0x4a56ed=0xc8;}else{_0x4a56ed=0xce;}_0x55a3c7[_0xa2a8('0x1e')](_0x4a56ed);return _0x55a3c7['set'](_0xa2a8('0x1f'),_0x1b36dd+'-'+_0x269b7+'/'+_0x5bed24)[_0xa2a8('0x1a')](_0x338456);}return null;};}function patchUpdates(_0x45cef6){return function(_0x2ae59a){try{jsonpatch[_0xa2a8('0x20')](_0x2ae59a,_0x45cef6,!![]);}catch(_0x445720){return BPromise[_0xa2a8('0x21')](_0x445720);}return _0x2ae59a[_0xa2a8('0x22')]();};}function saveUpdates(_0x3c0031,_0x54ed1f){return function(_0x5c43d3){if(_0x5c43d3){return _0x5c43d3['update'](_0x3c0031)[_0xa2a8('0x23')](function(_0x2046de){return _0x2046de;});}return null;};}function removeEntity(_0x37cf79,_0x428924){return function(_0x17d84d){if(_0x17d84d){return _0x17d84d[_0xa2a8('0x24')]()['then'](function(){_0x37cf79[_0xa2a8('0x1e')](0xcc)[_0xa2a8('0x19')]();});}};}function handleEntityNotFound(_0x38eda6,_0x5bae8a){return function(_0x1e5822){if(!_0x1e5822){_0x38eda6[_0xa2a8('0x25')](0x194);}return _0x1e5822;};}function handleError(_0x1599a0,_0x10d4bf){_0x10d4bf=_0x10d4bf||0x1f4;return function(_0x52126d){logger[_0xa2a8('0x26')](_0x52126d[_0xa2a8('0x27')]);if(_0x52126d[_0xa2a8('0x28')]){delete _0x52126d[_0xa2a8('0x28')];}_0x1599a0['status'](_0x10d4bf)['send'](_0x52126d);};}exports[_0xa2a8('0x29')]=function(_0xf6c5bd,_0x3687a1){var _0x15fec2={},_0x4ece61={},_0x26ecb9={'count':0x0,'rows':[]};var _0x2f6b4a=_[_0xa2a8('0x2a')](db[_0xa2a8('0x2b')][_0xa2a8('0x2c')],function(_0x45df0a){return{'name':_0x45df0a[_0xa2a8('0x2d')],'type':_0x45df0a['type']['key']};});_0x4ece61[_0xa2a8('0x2e')]=_[_0xa2a8('0x2a')](_0x2f6b4a,_0xa2a8('0x28'));_0x4ece61[_0xa2a8('0x2f')]=_[_0xa2a8('0x30')](_0xf6c5bd[_0xa2a8('0x2f')]);_0x4ece61[_0xa2a8('0x31')]=_['intersection'](_0x4ece61[_0xa2a8('0x2e')],_0x4ece61[_0xa2a8('0x2f')]);_0x15fec2[_0xa2a8('0x32')]=_[_0xa2a8('0x33')](_0x4ece61[_0xa2a8('0x2e')],qs[_0xa2a8('0x34')](_0xf6c5bd[_0xa2a8('0x2f')][_0xa2a8('0x34')]));_0x15fec2[_0xa2a8('0x32')]=_0x15fec2[_0xa2a8('0x32')][_0xa2a8('0x35')]?_0x15fec2[_0xa2a8('0x32')]:_0x4ece61['model'];if(!_0xf6c5bd[_0xa2a8('0x2f')][_0xa2a8('0x36')](_0xa2a8('0x37'))){_0x15fec2['limit']=qs[_0xa2a8('0x1c')](_0xf6c5bd[_0xa2a8('0x2f')][_0xa2a8('0x1c')]);_0x15fec2[_0xa2a8('0x1b')]=qs[_0xa2a8('0x1b')](_0xf6c5bd['query'][_0xa2a8('0x1b')]);}_0x15fec2['order']=qs['sort'](_0xf6c5bd[_0xa2a8('0x2f')]['sort']);_0x15fec2[_0xa2a8('0x38')]=qs[_0xa2a8('0x31')](_['pick'](_0xf6c5bd[_0xa2a8('0x2f')],_0x4ece61[_0xa2a8('0x31')]),_0x2f6b4a);if(_0xf6c5bd[_0xa2a8('0x2f')][_0xa2a8('0x39')]){_0x15fec2[_0xa2a8('0x38')]=_[_0xa2a8('0x3a')](_0x15fec2[_0xa2a8('0x38')],{'$or':_[_0xa2a8('0x2a')](_0x2f6b4a,function(_0x3c4fa3){if(_0x3c4fa3[_0xa2a8('0x3b')]!==_0xa2a8('0x3c')){var _0x410b81={};_0x410b81[_0x3c4fa3[_0xa2a8('0x28')]]={'$like':'%'+_0xf6c5bd[_0xa2a8('0x2f')][_0xa2a8('0x39')]+'%'};return _0x410b81;}})});}_0x15fec2=_[_0xa2a8('0x3a')]({},_0x15fec2,_0xf6c5bd[_0xa2a8('0x3d')]);var _0x5bd6cc={'where':_0x15fec2['where']};return db[_0xa2a8('0x2b')][_0xa2a8('0x3e')](_0x5bd6cc)['then'](function(_0x1cf38c){_0x26ecb9['count']=_0x1cf38c;if(_0xf6c5bd[_0xa2a8('0x2f')][_0xa2a8('0x3f')]){_0x15fec2['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0xa2a8('0x40')](_0x15fec2);})[_0xa2a8('0x23')](function(_0x2c5573){_0x26ecb9[_0xa2a8('0x41')]=_0x2c5573;return _0x26ecb9;})[_0xa2a8('0x23')](respondWithFilteredResult(_0x3687a1,_0x15fec2))[_0xa2a8('0x42')](handleError(_0x3687a1,null));};exports[_0xa2a8('0x43')]=function(_0x511473,_0x372494){var _0x2a89d2={'raw':![],'where':{'id':_0x511473['params']['id']}},_0x50debc={};_0x50debc[_0xa2a8('0x2e')]=_[_0xa2a8('0x30')](db[_0xa2a8('0x2b')][_0xa2a8('0x2c')]);_0x50debc[_0xa2a8('0x2f')]=_[_0xa2a8('0x30')](_0x511473[_0xa2a8('0x2f')]);_0x50debc[_0xa2a8('0x31')]=_[_0xa2a8('0x33')](_0x50debc[_0xa2a8('0x2e')],_0x50debc['query']);_0x2a89d2[_0xa2a8('0x32')]=_[_0xa2a8('0x33')](_0x50debc['model'],qs['fields'](_0x511473[_0xa2a8('0x2f')][_0xa2a8('0x34')]));_0x2a89d2[_0xa2a8('0x32')]=_0x2a89d2[_0xa2a8('0x32')][_0xa2a8('0x35')]?_0x2a89d2['attributes']:_0x50debc[_0xa2a8('0x2e')];if(_0x511473[_0xa2a8('0x2f')]['includeAll']){_0x2a89d2[_0xa2a8('0x44')]=[{'all':!![]}];}_0x2a89d2=_['merge']({},_0x2a89d2,_0x511473['options']);return db[_0xa2a8('0x2b')][_0xa2a8('0x45')](_0x2a89d2)[_0xa2a8('0x23')](handleEntityNotFound(_0x372494,null))[_0xa2a8('0x23')](respondWithResult(_0x372494,null))[_0xa2a8('0x42')](handleError(_0x372494,null));};exports['create']=function(_0x1106f2,_0x551faa){return db[_0xa2a8('0x2b')][_0xa2a8('0x46')](_0x1106f2[_0xa2a8('0x47')],{})[_0xa2a8('0x23')](respondWithResult(_0x551faa,0xc9))[_0xa2a8('0x42')](handleError(_0x551faa,null));};exports['update']=function(_0x3f7bea,_0x5c6441){if(_0x3f7bea[_0xa2a8('0x47')]['id']){delete _0x3f7bea['body']['id'];}return db['DeskConfiguration'][_0xa2a8('0x45')]({'where':{'id':_0x3f7bea['params']['id']}})[_0xa2a8('0x23')](handleEntityNotFound(_0x5c6441,null))[_0xa2a8('0x23')](saveUpdates(_0x3f7bea[_0xa2a8('0x47')],null))[_0xa2a8('0x23')](respondWithResult(_0x5c6441,null))['catch'](handleError(_0x5c6441,null));};exports[_0xa2a8('0x24')]=function(_0x2e181a,_0x7e0d59){return db['DeskConfiguration'][_0xa2a8('0x45')]({'where':{'id':_0x2e181a['params']['id']}})[_0xa2a8('0x23')](handleEntityNotFound(_0x7e0d59,null))[_0xa2a8('0x23')](removeEntity(_0x7e0d59,null))['catch'](handleError(_0x7e0d59,null));};exports['getFields']=function(_0x468b06,_0x2300e9,_0xb2ae8f){var _0x366082={};var _0xcec6f5={};var _0x22ab7c;var _0x57bb3d;return db['DeskConfiguration']['findOne']({'where':{'id':_0x468b06[_0xa2a8('0x48')]['id']}})[_0xa2a8('0x23')](handleEntityNotFound(_0x2300e9,null))[_0xa2a8('0x23')](function(_0x39722e){if(_0x39722e){_0x22ab7c=_0x39722e;_0xcec6f5['model']=_[_0xa2a8('0x30')](db[_0xa2a8('0x49')]['rawAttributes']);_0xcec6f5['query']=_[_0xa2a8('0x30')](_0x468b06[_0xa2a8('0x2f')]);_0xcec6f5[_0xa2a8('0x31')]=_[_0xa2a8('0x33')](_0xcec6f5[_0xa2a8('0x2e')],_0xcec6f5['query']);_0x366082[_0xa2a8('0x32')]=_['intersection'](_0xcec6f5[_0xa2a8('0x2e')],qs['fields'](_0x468b06[_0xa2a8('0x2f')][_0xa2a8('0x34')]));_0x366082[_0xa2a8('0x32')]=_0x366082[_0xa2a8('0x32')][_0xa2a8('0x35')]?_0x366082[_0xa2a8('0x32')]:_0xcec6f5[_0xa2a8('0x2e')];_0x366082[_0xa2a8('0x4a')]=qs[_0xa2a8('0x4b')](_0x468b06[_0xa2a8('0x2f')][_0xa2a8('0x4b')]);_0x366082['where']=qs[_0xa2a8('0x31')](_['pick'](_0x468b06[_0xa2a8('0x2f')],_0xcec6f5[_0xa2a8('0x31')]));if(_0x468b06[_0xa2a8('0x2f')][_0xa2a8('0x39')]){_0x366082[_0xa2a8('0x38')]=_[_0xa2a8('0x3a')](_0x366082[_0xa2a8('0x38')],{'$or':_['map'](_0x366082[_0xa2a8('0x32')],function(_0x342499){var _0x26350e={};_0x26350e[_0x342499]={'$like':'%'+_0x468b06['query'][_0xa2a8('0x39')]+'%'};return _0x26350e;})});}_0x366082=_[_0xa2a8('0x3a')]({},_0x366082,_0x468b06[_0xa2a8('0x3d')]);return _0x22ab7c[_0xa2a8('0x4c')](_0x366082);}})[_0xa2a8('0x23')](function(_0x47d3c5){if(_0x47d3c5){_0x57bb3d=_0x47d3c5[_0xa2a8('0x35')];if(!_0x468b06['query']['hasOwnProperty'](_0xa2a8('0x37'))){_0x366082['limit']=qs[_0xa2a8('0x1c')](_0x468b06['query'][_0xa2a8('0x1c')]);_0x366082['offset']=qs['offset'](_0x468b06[_0xa2a8('0x2f')]['offset']);}return _0x22ab7c[_0xa2a8('0x4c')](_0x366082);}})['then'](function(_0x246117){if(_0x246117){return _0x246117?{'count':_0x57bb3d,'rows':_0x246117}:null;}})[_0xa2a8('0x23')](respondWithResult(_0x2300e9,null))[_0xa2a8('0x42')](handleError(_0x2300e9,null));};exports['getSubjects']=function(_0xa53f97,_0x962593,_0x5b10d7){var _0xf3180f={};var _0x2359d0={};var _0x51dc2b;var _0x456d40;return db['DeskConfiguration'][_0xa2a8('0x4d')]({'where':{'id':_0xa53f97['params']['id']}})[_0xa2a8('0x23')](handleEntityNotFound(_0x962593,null))['then'](function(_0x5c3a8a){if(_0x5c3a8a){_0x51dc2b=_0x5c3a8a;_0x2359d0[_0xa2a8('0x2e')]=_[_0xa2a8('0x30')](db['DeskField'][_0xa2a8('0x2c')]);_0x2359d0[_0xa2a8('0x2f')]=_[_0xa2a8('0x30')](_0xa53f97[_0xa2a8('0x2f')]);_0x2359d0['filters']=_['intersection'](_0x2359d0[_0xa2a8('0x2e')],_0x2359d0[_0xa2a8('0x2f')]);_0xf3180f['attributes']=_[_0xa2a8('0x33')](_0x2359d0[_0xa2a8('0x2e')],qs[_0xa2a8('0x34')](_0xa53f97[_0xa2a8('0x2f')][_0xa2a8('0x34')]));_0xf3180f[_0xa2a8('0x32')]=_0xf3180f[_0xa2a8('0x32')][_0xa2a8('0x35')]?_0xf3180f[_0xa2a8('0x32')]:_0x2359d0[_0xa2a8('0x2e')];_0xf3180f['order']=qs[_0xa2a8('0x4b')](_0xa53f97[_0xa2a8('0x2f')][_0xa2a8('0x4b')]);_0xf3180f['where']=qs[_0xa2a8('0x31')](_['pick'](_0xa53f97['query'],_0x2359d0[_0xa2a8('0x31')]));if(_0xa53f97[_0xa2a8('0x2f')]['filter']){_0xf3180f[_0xa2a8('0x38')]=_[_0xa2a8('0x3a')](_0xf3180f['where'],{'$or':_[_0xa2a8('0x2a')](_0xf3180f['attributes'],function(_0x1acc13){var _0x2f6aa4={};_0x2f6aa4[_0x1acc13]={'$like':'%'+_0xa53f97['query']['filter']+'%'};return _0x2f6aa4;})});}_0xf3180f=_[_0xa2a8('0x3a')]({},_0xf3180f,_0xa53f97[_0xa2a8('0x3d')]);return _0x51dc2b[_0xa2a8('0x4e')](_0xf3180f);}})['then'](function(_0x46a227){if(_0x46a227){_0x456d40=_0x46a227[_0xa2a8('0x35')];if(!_0xa53f97[_0xa2a8('0x2f')][_0xa2a8('0x36')](_0xa2a8('0x37'))){_0xf3180f[_0xa2a8('0x1c')]=qs[_0xa2a8('0x1c')](_0xa53f97[_0xa2a8('0x2f')][_0xa2a8('0x1c')]);_0xf3180f['offset']=qs[_0xa2a8('0x1b')](_0xa53f97[_0xa2a8('0x2f')][_0xa2a8('0x1b')]);}return _0x51dc2b[_0xa2a8('0x4e')](_0xf3180f);}})[_0xa2a8('0x23')](function(_0x33bb26){if(_0x33bb26){return _0x33bb26?{'count':_0x456d40,'rows':_0x33bb26}:null;}})['then'](respondWithResult(_0x962593,null))['catch'](handleError(_0x962593,null));};exports[_0xa2a8('0x4f')]=function(_0x4a2745,_0x4d3d90,_0x357553){var _0x56991b={};var _0xc83c40={};var _0x35fca5;var _0x2f579f;return db[_0xa2a8('0x2b')][_0xa2a8('0x4d')]({'where':{'id':_0x4a2745['params']['id']}})[_0xa2a8('0x23')](handleEntityNotFound(_0x4d3d90,null))[_0xa2a8('0x23')](function(_0x141012){if(_0x141012){_0x35fca5=_0x141012;_0xc83c40[_0xa2a8('0x2e')]=_['keys'](db['DeskField'][_0xa2a8('0x2c')]);_0xc83c40[_0xa2a8('0x2f')]=_['keys'](_0x4a2745[_0xa2a8('0x2f')]);_0xc83c40['filters']=_['intersection'](_0xc83c40['model'],_0xc83c40[_0xa2a8('0x2f')]);_0x56991b[_0xa2a8('0x32')]=_[_0xa2a8('0x33')](_0xc83c40[_0xa2a8('0x2e')],qs[_0xa2a8('0x34')](_0x4a2745[_0xa2a8('0x2f')][_0xa2a8('0x34')]));_0x56991b['attributes']=_0x56991b['attributes'][_0xa2a8('0x35')]?_0x56991b[_0xa2a8('0x32')]:_0xc83c40[_0xa2a8('0x2e')];_0x56991b[_0xa2a8('0x4a')]=qs['sort'](_0x4a2745['query'][_0xa2a8('0x4b')]);_0x56991b['where']=qs[_0xa2a8('0x31')](_[_0xa2a8('0x50')](_0x4a2745[_0xa2a8('0x2f')],_0xc83c40[_0xa2a8('0x31')]));if(_0x4a2745[_0xa2a8('0x2f')][_0xa2a8('0x39')]){_0x56991b[_0xa2a8('0x38')]=_[_0xa2a8('0x3a')](_0x56991b[_0xa2a8('0x38')],{'$or':_[_0xa2a8('0x2a')](_0x56991b[_0xa2a8('0x32')],function(_0x2654e2){var _0x15d678={};_0x15d678[_0x2654e2]={'$like':'%'+_0x4a2745['query'][_0xa2a8('0x39')]+'%'};return _0x15d678;})});}_0x56991b=_[_0xa2a8('0x3a')]({},_0x56991b,_0x4a2745['options']);return _0x35fca5[_0xa2a8('0x4f')](_0x56991b);}})['then'](function(_0x278be0){if(_0x278be0){_0x2f579f=_0x278be0[_0xa2a8('0x35')];if(!_0x4a2745[_0xa2a8('0x2f')][_0xa2a8('0x36')]('nolimit')){_0x56991b[_0xa2a8('0x1c')]=qs[_0xa2a8('0x1c')](_0x4a2745['query'][_0xa2a8('0x1c')]);_0x56991b['offset']=qs[_0xa2a8('0x1b')](_0x4a2745[_0xa2a8('0x2f')]['offset']);}return _0x35fca5[_0xa2a8('0x4f')](_0x56991b);}})[_0xa2a8('0x23')](function(_0x3c55e9){if(_0x3c55e9){return _0x3c55e9?{'count':_0x2f579f,'rows':_0x3c55e9}:null;}})['then'](respondWithResult(_0x4d3d90,null))['catch'](handleError(_0x4d3d90,null));};exports[_0xa2a8('0x51')]=function(_0xceaeba,_0x10fd80,_0x1e139b){var _0x2cd602={};var _0x315db2={};var _0x43299a;var _0x42d382;return db[_0xa2a8('0x2b')][_0xa2a8('0x4d')]({'where':{'id':_0xceaeba[_0xa2a8('0x48')]['id']}})[_0xa2a8('0x23')](handleEntityNotFound(_0x10fd80,null))[_0xa2a8('0x23')](function(_0x5b0ba3){if(_0x5b0ba3){_0x43299a=_0x5b0ba3;_0x315db2[_0xa2a8('0x2e')]=_['keys'](db[_0xa2a8('0x52')][_0xa2a8('0x2c')]);_0x315db2[_0xa2a8('0x2f')]=_[_0xa2a8('0x30')](_0xceaeba[_0xa2a8('0x2f')]);_0x315db2[_0xa2a8('0x31')]=_[_0xa2a8('0x33')](_0x315db2[_0xa2a8('0x2e')],_0x315db2[_0xa2a8('0x2f')]);_0x2cd602[_0xa2a8('0x32')]=_[_0xa2a8('0x33')](_0x315db2[_0xa2a8('0x2e')],qs[_0xa2a8('0x34')](_0xceaeba[_0xa2a8('0x2f')][_0xa2a8('0x34')]));_0x2cd602[_0xa2a8('0x32')]=_0x2cd602[_0xa2a8('0x32')][_0xa2a8('0x35')]?_0x2cd602[_0xa2a8('0x32')]:_0x315db2[_0xa2a8('0x2e')];_0x2cd602[_0xa2a8('0x4a')]=qs[_0xa2a8('0x4b')](_0xceaeba['query']['sort']);_0x2cd602[_0xa2a8('0x38')]=qs['filters'](_[_0xa2a8('0x50')](_0xceaeba['query'],_0x315db2['filters']));if(_0xceaeba[_0xa2a8('0x2f')][_0xa2a8('0x39')]){_0x2cd602[_0xa2a8('0x38')]=_[_0xa2a8('0x3a')](_0x2cd602[_0xa2a8('0x38')],{'$or':_[_0xa2a8('0x2a')](_0x2cd602[_0xa2a8('0x32')],function(_0x101b60){var _0x3b8790={};_0x3b8790[_0x101b60]={'$like':'%'+_0xceaeba['query'][_0xa2a8('0x39')]+'%'};return _0x3b8790;})});}_0x2cd602=_['merge']({},_0x2cd602,_0xceaeba[_0xa2a8('0x3d')]);return _0x43299a[_0xa2a8('0x51')](_0x2cd602);}})[_0xa2a8('0x23')](function(_0x57783d){if(_0x57783d){_0x42d382=_0x57783d[_0xa2a8('0x35')];if(!_0xceaeba[_0xa2a8('0x2f')][_0xa2a8('0x36')]('nolimit')){_0x2cd602['limit']=qs[_0xa2a8('0x1c')](_0xceaeba['query']['limit']);_0x2cd602['offset']=qs['offset'](_0xceaeba[_0xa2a8('0x2f')][_0xa2a8('0x1b')]);}return _0x43299a[_0xa2a8('0x51')](_0x2cd602);}})[_0xa2a8('0x23')](function(_0x3be411){if(_0x3be411){return _0x3be411?{'count':_0x42d382,'rows':_0x3be411}:null;}})['then'](respondWithResult(_0x10fd80,null))[_0xa2a8('0x42')](handleError(_0x10fd80,null));};exports[_0xa2a8('0x53')]=function(_0x205815,_0x140bc8,_0xa6a51c){if(_0x205815[_0xa2a8('0x47')]['id']){delete _0x205815[_0xa2a8('0x47')]['id'];}return db[_0xa2a8('0x2b')][_0xa2a8('0x4d')]({'where':{'id':_0x205815[_0xa2a8('0x48')]['id']}})[_0xa2a8('0x23')](handleEntityNotFound(_0x140bc8,null))['then'](function(_0x4cf450){if(_0x4cf450){return _0x4cf450[_0xa2a8('0x53')](_0x205815['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x140bc8,null))[_0xa2a8('0x42')](handleError(_0x140bc8,null));};
\ No newline at end of file
+var _0xf1bd=['DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','destroy','then','sendStatus','error','name','index','DeskConfiguration','rawAttributes','fieldName','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','params','getFields','findOne'];(function(_0x57761f,_0x2c603b){var _0x4ad08e=function(_0x357d9a){while(--_0x357d9a){_0x57761f['push'](_0x57761f['shift']());}};_0x4ad08e(++_0x2c603b);}(_0xf1bd,0x183));var _0xdf1b=function(_0x3254c6,_0x4d1ef2){_0x3254c6=_0x3254c6-0x0;var _0x3ee349=_0xf1bd[_0x3254c6];return _0x3ee349;};'use strict';var emlformat=require(_0xdf1b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdf1b('0x1'));var rp=require(_0xdf1b('0x2'));var moment=require(_0xdf1b('0x3'));var BPromise=require(_0xdf1b('0x4'));var Mustache=require(_0xdf1b('0x5'));var util=require('util');var path=require(_0xdf1b('0x6'));var sox=require(_0xdf1b('0x7'));var csv=require(_0xdf1b('0x8'));var ejs=require(_0xdf1b('0x9'));var fs=require('fs');var fs_extra=require(_0xdf1b('0xa'));var _=require(_0xdf1b('0xb'));var squel=require(_0xdf1b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdf1b('0x8'));var querystring=require(_0xdf1b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdf1b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf1b('0xf'))(_0xdf1b('0x10'));var utils=require('../../config/utils');var config=require(_0xdf1b('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d5aeb,_0x13b981){_0x13b981=_0x13b981||0xcc;return function(_0x256c74){if(_0x256c74){return _0x3d5aeb['sendStatus'](_0x13b981);}return _0x3d5aeb[_0xdf1b('0x12')](_0x13b981)[_0xdf1b('0x13')]();};}function respondWithResult(_0x31a6d6,_0x17b4c3){_0x17b4c3=_0x17b4c3||0xc8;return function(_0x1103c7){if(_0x1103c7){return _0x31a6d6[_0xdf1b('0x12')](_0x17b4c3)['json'](_0x1103c7);}};}function respondWithFilteredResult(_0x27e2a7,_0x6ecfa4){return function(_0x284400){if(_0x284400){var _0x103364=typeof _0x6ecfa4[_0xdf1b('0x14')]===_0xdf1b('0x15')&&typeof _0x6ecfa4['limit']===_0xdf1b('0x15');var _0x5b244b=_0x284400[_0xdf1b('0x16')];var _0x7f9b55=_0x103364?0x0:_0x6ecfa4[_0xdf1b('0x14')];var _0x3b1f8a=_0x103364?_0x284400['count']:_0x6ecfa4['offset']+_0x6ecfa4[_0xdf1b('0x17')];var _0xb66692;if(_0x3b1f8a>=_0x5b244b){_0x3b1f8a=_0x5b244b;_0xb66692=0xc8;}else{_0xb66692=0xce;}_0x27e2a7[_0xdf1b('0x12')](_0xb66692);return _0x27e2a7['set'](_0xdf1b('0x18'),_0x7f9b55+'-'+_0x3b1f8a+'/'+_0x5b244b)[_0xdf1b('0x19')](_0x284400);}return null;};}function patchUpdates(_0x426c40){return function(_0x4de10a){try{jsonpatch[_0xdf1b('0x1a')](_0x4de10a,_0x426c40,!![]);}catch(_0x3d78cf){return BPromise[_0xdf1b('0x1b')](_0x3d78cf);}return _0x4de10a['save']();};}function saveUpdates(_0x4abbc9,_0x1b08f7){return function(_0x248220){if(_0x248220){return _0x248220[_0xdf1b('0x1c')](_0x4abbc9)['then'](function(_0xbb07bd){return _0xbb07bd;});}return null;};}function removeEntity(_0x2b7ca6,_0x406b8d){return function(_0x3bc4a4){if(_0x3bc4a4){return _0x3bc4a4[_0xdf1b('0x1d')]()[_0xdf1b('0x1e')](function(){_0x2b7ca6[_0xdf1b('0x12')](0xcc)[_0xdf1b('0x13')]();});}};}function handleEntityNotFound(_0x4d5e68,_0x3ea6ef){return function(_0x432906){if(!_0x432906){_0x4d5e68[_0xdf1b('0x1f')](0x194);}return _0x432906;};}function handleError(_0x4f5a1c,_0x205c7b){_0x205c7b=_0x205c7b||0x1f4;return function(_0x25aec8){logger[_0xdf1b('0x20')](_0x25aec8['stack']);if(_0x25aec8[_0xdf1b('0x21')]){delete _0x25aec8['name'];}_0x4f5a1c['status'](_0x205c7b)['send'](_0x25aec8);};}exports[_0xdf1b('0x22')]=function(_0x3d0c24,_0x4b9de4){var _0x5afa2b={},_0x5071cc={},_0x2e2f62={'count':0x0,'rows':[]};var _0x480339=_['map'](db[_0xdf1b('0x23')][_0xdf1b('0x24')],function(_0x481e78){return{'name':_0x481e78[_0xdf1b('0x25')],'type':_0x481e78['type']['key']};});_0x5071cc[_0xdf1b('0x26')]=_[_0xdf1b('0x27')](_0x480339,_0xdf1b('0x21'));_0x5071cc['query']=_[_0xdf1b('0x28')](_0x3d0c24[_0xdf1b('0x29')]);_0x5071cc[_0xdf1b('0x2a')]=_[_0xdf1b('0x2b')](_0x5071cc[_0xdf1b('0x26')],_0x5071cc[_0xdf1b('0x29')]);_0x5afa2b['attributes']=_[_0xdf1b('0x2b')](_0x5071cc[_0xdf1b('0x26')],qs[_0xdf1b('0x2c')](_0x3d0c24['query']['fields']));_0x5afa2b[_0xdf1b('0x2d')]=_0x5afa2b[_0xdf1b('0x2d')][_0xdf1b('0x2e')]?_0x5afa2b[_0xdf1b('0x2d')]:_0x5071cc[_0xdf1b('0x26')];if(!_0x3d0c24[_0xdf1b('0x29')][_0xdf1b('0x2f')](_0xdf1b('0x30'))){_0x5afa2b[_0xdf1b('0x17')]=qs[_0xdf1b('0x17')](_0x3d0c24['query'][_0xdf1b('0x17')]);_0x5afa2b[_0xdf1b('0x14')]=qs[_0xdf1b('0x14')](_0x3d0c24[_0xdf1b('0x29')][_0xdf1b('0x14')]);}_0x5afa2b[_0xdf1b('0x31')]=qs[_0xdf1b('0x32')](_0x3d0c24[_0xdf1b('0x29')][_0xdf1b('0x32')]);_0x5afa2b[_0xdf1b('0x33')]=qs['filters'](_[_0xdf1b('0x34')](_0x3d0c24[_0xdf1b('0x29')],_0x5071cc[_0xdf1b('0x2a')]),_0x480339);if(_0x3d0c24[_0xdf1b('0x29')][_0xdf1b('0x35')]){_0x5afa2b[_0xdf1b('0x33')]=_[_0xdf1b('0x36')](_0x5afa2b[_0xdf1b('0x33')],{'$or':_[_0xdf1b('0x27')](_0x480339,function(_0x398e49){if(_0x398e49[_0xdf1b('0x37')]!==_0xdf1b('0x38')){var _0x5c2b36={};_0x5c2b36[_0x398e49[_0xdf1b('0x21')]]={'$like':'%'+_0x3d0c24['query']['filter']+'%'};return _0x5c2b36;}})});}_0x5afa2b=_[_0xdf1b('0x36')]({},_0x5afa2b,_0x3d0c24[_0xdf1b('0x39')]);var _0x298ac6={'where':_0x5afa2b[_0xdf1b('0x33')]};return db['DeskConfiguration'][_0xdf1b('0x16')](_0x298ac6)[_0xdf1b('0x1e')](function(_0xba0254){_0x2e2f62[_0xdf1b('0x16')]=_0xba0254;if(_0x3d0c24[_0xdf1b('0x29')]['includeAll']){_0x5afa2b[_0xdf1b('0x3a')]=[{'all':!![]}];}return db[_0xdf1b('0x23')][_0xdf1b('0x3b')](_0x5afa2b);})['then'](function(_0x18ea5c){_0x2e2f62[_0xdf1b('0x3c')]=_0x18ea5c;return _0x2e2f62;})[_0xdf1b('0x1e')](respondWithFilteredResult(_0x4b9de4,_0x5afa2b))[_0xdf1b('0x3d')](handleError(_0x4b9de4,null));};exports['show']=function(_0x3bf9cb,_0x36d643){var _0x5b5c55={'raw':![],'where':{'id':_0x3bf9cb['params']['id']}},_0x3e294d={};_0x3e294d[_0xdf1b('0x26')]=_['keys'](db[_0xdf1b('0x23')][_0xdf1b('0x24')]);_0x3e294d['query']=_[_0xdf1b('0x28')](_0x3bf9cb[_0xdf1b('0x29')]);_0x3e294d['filters']=_['intersection'](_0x3e294d['model'],_0x3e294d['query']);_0x5b5c55['attributes']=_['intersection'](_0x3e294d[_0xdf1b('0x26')],qs[_0xdf1b('0x2c')](_0x3bf9cb[_0xdf1b('0x29')][_0xdf1b('0x2c')]));_0x5b5c55[_0xdf1b('0x2d')]=_0x5b5c55[_0xdf1b('0x2d')][_0xdf1b('0x2e')]?_0x5b5c55[_0xdf1b('0x2d')]:_0x3e294d[_0xdf1b('0x26')];if(_0x3bf9cb['query'][_0xdf1b('0x3e')]){_0x5b5c55[_0xdf1b('0x3a')]=[{'all':!![]}];}_0x5b5c55=_[_0xdf1b('0x36')]({},_0x5b5c55,_0x3bf9cb[_0xdf1b('0x39')]);return db['DeskConfiguration'][_0xdf1b('0x3f')](_0x5b5c55)[_0xdf1b('0x1e')](handleEntityNotFound(_0x36d643,null))[_0xdf1b('0x1e')](respondWithResult(_0x36d643,null))['catch'](handleError(_0x36d643,null));};exports[_0xdf1b('0x40')]=function(_0x41117d,_0x424bb5){return db[_0xdf1b('0x23')]['create'](_0x41117d['body'],{})[_0xdf1b('0x1e')](respondWithResult(_0x424bb5,0xc9))[_0xdf1b('0x3d')](handleError(_0x424bb5,null));};exports[_0xdf1b('0x1c')]=function(_0x31fda3,_0x4e6dd1){if(_0x31fda3['body']['id']){delete _0x31fda3[_0xdf1b('0x41')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x31fda3[_0xdf1b('0x42')]['id']}})[_0xdf1b('0x1e')](handleEntityNotFound(_0x4e6dd1,null))[_0xdf1b('0x1e')](saveUpdates(_0x31fda3['body'],null))[_0xdf1b('0x1e')](respondWithResult(_0x4e6dd1,null))[_0xdf1b('0x3d')](handleError(_0x4e6dd1,null));};exports['destroy']=function(_0x46cafe,_0x23ca8b){return db[_0xdf1b('0x23')][_0xdf1b('0x3f')]({'where':{'id':_0x46cafe[_0xdf1b('0x42')]['id']}})[_0xdf1b('0x1e')](handleEntityNotFound(_0x23ca8b,null))[_0xdf1b('0x1e')](removeEntity(_0x23ca8b,null))['catch'](handleError(_0x23ca8b,null));};exports[_0xdf1b('0x43')]=function(_0x378ec0,_0x369d27,_0x8e19a0){var _0x1f6fc1={};var _0x5c21a4={};var _0x412001;var _0x701347;return db[_0xdf1b('0x23')][_0xdf1b('0x44')]({'where':{'id':_0x378ec0[_0xdf1b('0x42')]['id']}})[_0xdf1b('0x1e')](handleEntityNotFound(_0x369d27,null))[_0xdf1b('0x1e')](function(_0x3355b1){if(_0x3355b1){_0x412001=_0x3355b1;_0x5c21a4['model']=_[_0xdf1b('0x28')](db[_0xdf1b('0x45')][_0xdf1b('0x24')]);_0x5c21a4['query']=_[_0xdf1b('0x28')](_0x378ec0[_0xdf1b('0x29')]);_0x5c21a4[_0xdf1b('0x2a')]=_[_0xdf1b('0x2b')](_0x5c21a4[_0xdf1b('0x26')],_0x5c21a4[_0xdf1b('0x29')]);_0x1f6fc1[_0xdf1b('0x2d')]=_[_0xdf1b('0x2b')](_0x5c21a4[_0xdf1b('0x26')],qs['fields'](_0x378ec0['query'][_0xdf1b('0x2c')]));_0x1f6fc1['attributes']=_0x1f6fc1['attributes'][_0xdf1b('0x2e')]?_0x1f6fc1[_0xdf1b('0x2d')]:_0x5c21a4['model'];_0x1f6fc1[_0xdf1b('0x31')]=qs[_0xdf1b('0x32')](_0x378ec0[_0xdf1b('0x29')][_0xdf1b('0x32')]);_0x1f6fc1['where']=qs[_0xdf1b('0x2a')](_[_0xdf1b('0x34')](_0x378ec0[_0xdf1b('0x29')],_0x5c21a4[_0xdf1b('0x2a')]));if(_0x378ec0[_0xdf1b('0x29')][_0xdf1b('0x35')]){_0x1f6fc1['where']=_[_0xdf1b('0x36')](_0x1f6fc1[_0xdf1b('0x33')],{'$or':_[_0xdf1b('0x27')](_0x1f6fc1[_0xdf1b('0x2d')],function(_0x1e53a6){var _0x396655={};_0x396655[_0x1e53a6]={'$like':'%'+_0x378ec0[_0xdf1b('0x29')]['filter']+'%'};return _0x396655;})});}_0x1f6fc1=_['merge']({},_0x1f6fc1,_0x378ec0['options']);return _0x412001[_0xdf1b('0x43')](_0x1f6fc1);}})[_0xdf1b('0x1e')](function(_0x28a45a){if(_0x28a45a){_0x701347=_0x28a45a[_0xdf1b('0x2e')];if(!_0x378ec0['query'][_0xdf1b('0x2f')](_0xdf1b('0x30'))){_0x1f6fc1[_0xdf1b('0x17')]=qs[_0xdf1b('0x17')](_0x378ec0[_0xdf1b('0x29')][_0xdf1b('0x17')]);_0x1f6fc1[_0xdf1b('0x14')]=qs[_0xdf1b('0x14')](_0x378ec0[_0xdf1b('0x29')]['offset']);}return _0x412001[_0xdf1b('0x43')](_0x1f6fc1);}})['then'](function(_0x5a08d2){if(_0x5a08d2){return _0x5a08d2?{'count':_0x701347,'rows':_0x5a08d2}:null;}})['then'](respondWithResult(_0x369d27,null))[_0xdf1b('0x3d')](handleError(_0x369d27,null));};exports['getSubjects']=function(_0x23f53f,_0x324e60,_0x158e59){var _0x3fde2d={};var _0x291dae={};var _0x21a9d3;var _0x1609c9;return db['DeskConfiguration'][_0xdf1b('0x44')]({'where':{'id':_0x23f53f[_0xdf1b('0x42')]['id']}})['then'](handleEntityNotFound(_0x324e60,null))[_0xdf1b('0x1e')](function(_0x1cde79){if(_0x1cde79){_0x21a9d3=_0x1cde79;_0x291dae[_0xdf1b('0x26')]=_[_0xdf1b('0x28')](db[_0xdf1b('0x45')][_0xdf1b('0x24')]);_0x291dae[_0xdf1b('0x29')]=_[_0xdf1b('0x28')](_0x23f53f[_0xdf1b('0x29')]);_0x291dae['filters']=_[_0xdf1b('0x2b')](_0x291dae[_0xdf1b('0x26')],_0x291dae[_0xdf1b('0x29')]);_0x3fde2d[_0xdf1b('0x2d')]=_[_0xdf1b('0x2b')](_0x291dae[_0xdf1b('0x26')],qs['fields'](_0x23f53f['query'][_0xdf1b('0x2c')]));_0x3fde2d[_0xdf1b('0x2d')]=_0x3fde2d[_0xdf1b('0x2d')][_0xdf1b('0x2e')]?_0x3fde2d[_0xdf1b('0x2d')]:_0x291dae['model'];_0x3fde2d[_0xdf1b('0x31')]=qs[_0xdf1b('0x32')](_0x23f53f['query']['sort']);_0x3fde2d[_0xdf1b('0x33')]=qs[_0xdf1b('0x2a')](_['pick'](_0x23f53f[_0xdf1b('0x29')],_0x291dae[_0xdf1b('0x2a')]));if(_0x23f53f[_0xdf1b('0x29')][_0xdf1b('0x35')]){_0x3fde2d['where']=_[_0xdf1b('0x36')](_0x3fde2d['where'],{'$or':_[_0xdf1b('0x27')](_0x3fde2d[_0xdf1b('0x2d')],function(_0x46b577){var _0x3ead6e={};_0x3ead6e[_0x46b577]={'$like':'%'+_0x23f53f[_0xdf1b('0x29')][_0xdf1b('0x35')]+'%'};return _0x3ead6e;})});}_0x3fde2d=_[_0xdf1b('0x36')]({},_0x3fde2d,_0x23f53f[_0xdf1b('0x39')]);return _0x21a9d3[_0xdf1b('0x46')](_0x3fde2d);}})[_0xdf1b('0x1e')](function(_0x2e867d){if(_0x2e867d){_0x1609c9=_0x2e867d[_0xdf1b('0x2e')];if(!_0x23f53f[_0xdf1b('0x29')][_0xdf1b('0x2f')]('nolimit')){_0x3fde2d[_0xdf1b('0x17')]=qs[_0xdf1b('0x17')](_0x23f53f['query']['limit']);_0x3fde2d[_0xdf1b('0x14')]=qs[_0xdf1b('0x14')](_0x23f53f[_0xdf1b('0x29')][_0xdf1b('0x14')]);}return _0x21a9d3['getSubjects'](_0x3fde2d);}})[_0xdf1b('0x1e')](function(_0x45be02){if(_0x45be02){return _0x45be02?{'count':_0x1609c9,'rows':_0x45be02}:null;}})[_0xdf1b('0x1e')](respondWithResult(_0x324e60,null))[_0xdf1b('0x3d')](handleError(_0x324e60,null));};exports[_0xdf1b('0x47')]=function(_0x5efd98,_0x1548a4,_0x1ae469){var _0x2688a8={};var _0x495bcb={};var _0x2b4d93;var _0x17a8b0;return db['DeskConfiguration'][_0xdf1b('0x44')]({'where':{'id':_0x5efd98[_0xdf1b('0x42')]['id']}})[_0xdf1b('0x1e')](handleEntityNotFound(_0x1548a4,null))[_0xdf1b('0x1e')](function(_0x19013f){if(_0x19013f){_0x2b4d93=_0x19013f;_0x495bcb['model']=_[_0xdf1b('0x28')](db[_0xdf1b('0x45')][_0xdf1b('0x24')]);_0x495bcb[_0xdf1b('0x29')]=_['keys'](_0x5efd98[_0xdf1b('0x29')]);_0x495bcb[_0xdf1b('0x2a')]=_[_0xdf1b('0x2b')](_0x495bcb[_0xdf1b('0x26')],_0x495bcb[_0xdf1b('0x29')]);_0x2688a8[_0xdf1b('0x2d')]=_[_0xdf1b('0x2b')](_0x495bcb['model'],qs[_0xdf1b('0x2c')](_0x5efd98[_0xdf1b('0x29')]['fields']));_0x2688a8[_0xdf1b('0x2d')]=_0x2688a8[_0xdf1b('0x2d')][_0xdf1b('0x2e')]?_0x2688a8[_0xdf1b('0x2d')]:_0x495bcb[_0xdf1b('0x26')];_0x2688a8['order']=qs[_0xdf1b('0x32')](_0x5efd98[_0xdf1b('0x29')][_0xdf1b('0x32')]);_0x2688a8[_0xdf1b('0x33')]=qs[_0xdf1b('0x2a')](_['pick'](_0x5efd98[_0xdf1b('0x29')],_0x495bcb[_0xdf1b('0x2a')]));if(_0x5efd98[_0xdf1b('0x29')]['filter']){_0x2688a8[_0xdf1b('0x33')]=_[_0xdf1b('0x36')](_0x2688a8[_0xdf1b('0x33')],{'$or':_['map'](_0x2688a8[_0xdf1b('0x2d')],function(_0x40e75c){var _0x55be74={};_0x55be74[_0x40e75c]={'$like':'%'+_0x5efd98[_0xdf1b('0x29')][_0xdf1b('0x35')]+'%'};return _0x55be74;})});}_0x2688a8=_[_0xdf1b('0x36')]({},_0x2688a8,_0x5efd98['options']);return _0x2b4d93[_0xdf1b('0x47')](_0x2688a8);}})['then'](function(_0x2f11ec){if(_0x2f11ec){_0x17a8b0=_0x2f11ec['length'];if(!_0x5efd98[_0xdf1b('0x29')]['hasOwnProperty']('nolimit')){_0x2688a8[_0xdf1b('0x17')]=qs[_0xdf1b('0x17')](_0x5efd98['query'][_0xdf1b('0x17')]);_0x2688a8[_0xdf1b('0x14')]=qs['offset'](_0x5efd98[_0xdf1b('0x29')]['offset']);}return _0x2b4d93['getDescriptions'](_0x2688a8);}})[_0xdf1b('0x1e')](function(_0x599c3a){if(_0x599c3a){return _0x599c3a?{'count':_0x17a8b0,'rows':_0x599c3a}:null;}})[_0xdf1b('0x1e')](respondWithResult(_0x1548a4,null))['catch'](handleError(_0x1548a4,null));};exports[_0xdf1b('0x48')]=function(_0x8047b9,_0x1082c2,_0x41b73b){var _0x5b6e37={};var _0x477e6a={};var _0x2fc26b;var _0x1ef949;return db[_0xdf1b('0x23')]['findOne']({'where':{'id':_0x8047b9['params']['id']}})[_0xdf1b('0x1e')](handleEntityNotFound(_0x1082c2,null))[_0xdf1b('0x1e')](function(_0x4a7a83){if(_0x4a7a83){_0x2fc26b=_0x4a7a83;_0x477e6a[_0xdf1b('0x26')]=_[_0xdf1b('0x28')](db[_0xdf1b('0x49')][_0xdf1b('0x24')]);_0x477e6a[_0xdf1b('0x29')]=_[_0xdf1b('0x28')](_0x8047b9['query']);_0x477e6a[_0xdf1b('0x2a')]=_[_0xdf1b('0x2b')](_0x477e6a['model'],_0x477e6a[_0xdf1b('0x29')]);_0x5b6e37[_0xdf1b('0x2d')]=_['intersection'](_0x477e6a[_0xdf1b('0x26')],qs['fields'](_0x8047b9[_0xdf1b('0x29')][_0xdf1b('0x2c')]));_0x5b6e37[_0xdf1b('0x2d')]=_0x5b6e37['attributes'][_0xdf1b('0x2e')]?_0x5b6e37[_0xdf1b('0x2d')]:_0x477e6a[_0xdf1b('0x26')];_0x5b6e37[_0xdf1b('0x31')]=qs['sort'](_0x8047b9[_0xdf1b('0x29')][_0xdf1b('0x32')]);_0x5b6e37[_0xdf1b('0x33')]=qs[_0xdf1b('0x2a')](_[_0xdf1b('0x34')](_0x8047b9[_0xdf1b('0x29')],_0x477e6a[_0xdf1b('0x2a')]));if(_0x8047b9['query'][_0xdf1b('0x35')]){_0x5b6e37[_0xdf1b('0x33')]=_[_0xdf1b('0x36')](_0x5b6e37[_0xdf1b('0x33')],{'$or':_[_0xdf1b('0x27')](_0x5b6e37[_0xdf1b('0x2d')],function(_0x5984e8){var _0x256411={};_0x256411[_0x5984e8]={'$like':'%'+_0x8047b9[_0xdf1b('0x29')][_0xdf1b('0x35')]+'%'};return _0x256411;})});}_0x5b6e37=_[_0xdf1b('0x36')]({},_0x5b6e37,_0x8047b9[_0xdf1b('0x39')]);return _0x2fc26b[_0xdf1b('0x48')](_0x5b6e37);}})[_0xdf1b('0x1e')](function(_0x3fa1d0){if(_0x3fa1d0){_0x1ef949=_0x3fa1d0[_0xdf1b('0x2e')];if(!_0x8047b9['query'][_0xdf1b('0x2f')](_0xdf1b('0x30'))){_0x5b6e37['limit']=qs[_0xdf1b('0x17')](_0x8047b9[_0xdf1b('0x29')][_0xdf1b('0x17')]);_0x5b6e37[_0xdf1b('0x14')]=qs[_0xdf1b('0x14')](_0x8047b9[_0xdf1b('0x29')][_0xdf1b('0x14')]);}return _0x2fc26b[_0xdf1b('0x48')](_0x5b6e37);}})[_0xdf1b('0x1e')](function(_0x25203f){if(_0x25203f){return _0x25203f?{'count':_0x1ef949,'rows':_0x25203f}:null;}})[_0xdf1b('0x1e')](respondWithResult(_0x1082c2,null))[_0xdf1b('0x3d')](handleError(_0x1082c2,null));};exports[_0xdf1b('0x4a')]=function(_0x3d1255,_0x5aabad,_0x24bc18){if(_0x3d1255[_0xdf1b('0x41')]['id']){delete _0x3d1255[_0xdf1b('0x41')]['id'];}return db[_0xdf1b('0x23')]['findOne']({'where':{'id':_0x3d1255[_0xdf1b('0x42')]['id']}})['then'](handleEntityNotFound(_0x5aabad,null))[_0xdf1b('0x1e')](function(_0x4d0185){if(_0x4d0185){return _0x4d0185[_0xdf1b('0x4a')](_0x3d1255[_0xdf1b('0x41')][_0xdf1b('0x4b')]||[]);}return null;})[_0xdf1b('0x1e')](respondWithResult(_0x5aabad,null))['catch'](handleError(_0x5aabad,null));};
\ No newline at end of file
index d988873..95ccb5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8480=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x8480,0xe6));var _0x0848=function(_0x103fac,_0x5a3a76){_0x103fac=_0x103fac-0x0;var _0x20e996=_0x8480[_0x103fac];return _0x20e996;};'use strict';var _=require(_0x0848('0x0'));var util=require('util');var logger=require(_0x0848('0x1'))(_0x0848('0x2'));var moment=require(_0x0848('0x3'));var BPromise=require(_0x0848('0x4'));var rp=require(_0x0848('0x5'));var fs=require('fs');var path=require(_0x0848('0x6'));var rimraf=require(_0x0848('0x7'));var config=require(_0x0848('0x8'));var attributes=require(_0x0848('0x9'));module[_0x0848('0xa')]=function(_0x1ec058,_0x9f9b71){return _0x1ec058['define'](_0x0848('0xb'),attributes,{'tableName':_0x0848('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2cb7=['request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment'];(function(_0xefe8df,_0x399303){var _0x55b239=function(_0xd0ba4f){while(--_0xd0ba4f){_0xefe8df['push'](_0xefe8df['shift']());}};_0x55b239(++_0x399303);}(_0x2cb7,0xcd));var _0x72cb=function(_0x2e0d2a,_0x8d568){_0x2e0d2a=_0x2e0d2a-0x0;var _0x4014f0=_0x2cb7[_0x2e0d2a];return _0x4014f0;};'use strict';var _=require(_0x72cb('0x0'));var util=require(_0x72cb('0x1'));var logger=require(_0x72cb('0x2'))('api');var moment=require(_0x72cb('0x3'));var BPromise=require('bluebird');var rp=require(_0x72cb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72cb('0x5'));var config=require(_0x72cb('0x6'));var attributes=require(_0x72cb('0x7'));module['exports']=function(_0x56a8a0,_0x4e756b){return _0x56a8a0[_0x72cb('0x8')](_0x72cb('0x9'),attributes,{'tableName':_0x72cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df86c6a..3fa74a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c8c=['../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x4c8c,0x1b3));var _0xc4c8=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x4c8c[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xc4c8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc4c8('0x1'));var rs=require(_0xc4c8('0x2'));var fs=require('fs');var Redis=require(_0xc4c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4c8('0x4'));var logger=require(_0xc4c8('0x5'))('rpc');var config=require(_0xc4c8('0x6'));var jayson=require(_0xc4c8('0x7'));var client=jayson['client'][_0xc4c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bee88,_0xb2b749,_0x4056ef){return new BPromise(function(_0x592ed9,_0x134144){return client[_0xc4c8('0x9')](_0x1bee88,_0x4056ef)['then'](function(_0x2b4513){logger[_0xc4c8('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0xb2b749,_0xc4c8('0xb'));logger[_0xc4c8('0xc')](_0xc4c8('0xd'),_0xb2b749,_0xc4c8('0xb'),JSON[_0xc4c8('0xe')](_0x2b4513));if(_0x2b4513[_0xc4c8('0xf')]){if(_0x2b4513[_0xc4c8('0xf')][_0xc4c8('0x10')]===0x1f4){logger[_0xc4c8('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0xb2b749,_0x2b4513[_0xc4c8('0xf')][_0xc4c8('0x11')]);return _0x134144(_0x2b4513[_0xc4c8('0xf')][_0xc4c8('0x11')]);}logger[_0xc4c8('0xf')](_0xc4c8('0x12'),_0xb2b749,_0x2b4513[_0xc4c8('0xf')][_0xc4c8('0x11')]);return _0x592ed9(_0x2b4513[_0xc4c8('0xf')]['message']);}else{logger[_0xc4c8('0xa')](_0xc4c8('0x12'),_0xb2b749,_0xc4c8('0xb'));_0x592ed9(_0x2b4513['result']['message']);}})[_0xc4c8('0x13')](function(_0x7fe08f){logger['error'](_0xc4c8('0x12'),_0xb2b749,_0x7fe08f);_0x134144(_0x7fe08f);});});}
\ No newline at end of file
+var _0x7d06=['DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x7d06,0x158));var _0x67d0=function(_0x3b82f2,_0x58b81e){_0x3b82f2=_0x3b82f2-0x0;var _0x5b6974=_0x7d06[_0x3b82f2];return _0x5b6974;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d0('0x5'))['db'];var utils=require(_0x67d0('0x6'));var logger=require(_0x67d0('0x7'))('rpc');var config=require(_0x67d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67d0('0x9')][_0x67d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f1d,_0xe4789b,_0x3c9976){return new BPromise(function(_0x481a08,_0x358986){return client['request'](_0x367f1d,_0x3c9976)[_0x67d0('0xb')](function(_0x5916d0){logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));logger[_0x67d0('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0xe4789b,_0x67d0('0xe'),JSON['stringify'](_0x5916d0));if(_0x5916d0['error']){if(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x11')]===0x1f4){logger['error'](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')]['message']);return _0x358986(_0x5916d0[_0x67d0('0x10')]['message']);}logger[_0x67d0('0x10')](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);return _0x481a08(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);}else{logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));_0x481a08(_0x5916d0[_0x67d0('0x13')]['message']);}})[_0x67d0('0x14')](function(_0xa1b889){logger['error'](_0x67d0('0xd'),_0xe4789b,_0xa1b889);_0x358986(_0xa1b889);});});}
\ No newline at end of file
index ed85b29..eaf3bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6560=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','create','put'];(function(_0x2d59e8,_0x4852b8){var _0x368125=function(_0x3b1459){while(--_0x3b1459){_0x2d59e8['push'](_0x2d59e8['shift']());}};_0x368125(++_0x4852b8);}(_0x6560,0x7c));var _0x0656=function(_0x4c86a0,_0x827465){_0x4c86a0=_0x4c86a0-0x0;var _0x517ab9=_0x6560[_0x4c86a0];return _0x517ab9;};'use strict';var multer=require(_0x0656('0x0'));var util=require('util');var path=require(_0x0656('0x1'));var timeout=require(_0x0656('0x2'));var express=require(_0x0656('0x3'));var router=express[_0x0656('0x4')]();var fs_extra=require(_0x0656('0x5'));var auth=require(_0x0656('0x6'));var interaction=require(_0x0656('0x7'));var config=require(_0x0656('0x8'));var controller=require(_0x0656('0x9'));router['get']('/',auth[_0x0656('0xa')](),controller[_0x0656('0xb')]);router[_0x0656('0xc')](_0x0656('0xd'),auth[_0x0656('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0656('0xe')]);router[_0x0656('0xf')](_0x0656('0xd'),auth['isAuthenticated'](),controller[_0x0656('0x10')]);router[_0x0656('0x11')](_0x0656('0xd'),auth[_0x0656('0xa')](),controller[_0x0656('0x12')]);module[_0x0656('0x13')]=router;
\ No newline at end of file
+var _0xd250=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update','destroy','multer','util'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0xd250,0x70));var _0x0d25=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0xd250[_0x31b31b];return _0x2c8fc2;};'use strict';var multer=require(_0x0d25('0x0'));var util=require(_0x0d25('0x1'));var path=require(_0x0d25('0x2'));var timeout=require(_0x0d25('0x3'));var express=require(_0x0d25('0x4'));var router=express[_0x0d25('0x5')]();var fs_extra=require(_0x0d25('0x6'));var auth=require(_0x0d25('0x7'));var interaction=require(_0x0d25('0x8'));var config=require(_0x0d25('0x9'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0x0d25('0xa')](),controller[_0x0d25('0xb')]);router[_0x0d25('0xc')](_0x0d25('0xd'),auth[_0x0d25('0xa')](),controller[_0x0d25('0xe')]);router[_0x0d25('0xf')]('/',auth[_0x0d25('0xa')](),controller['create']);router[_0x0d25('0x10')]('/:id',auth[_0x0d25('0xa')](),controller[_0x0d25('0x11')]);router['delete'](_0x0d25('0xd'),auth[_0x0d25('0xa')](),controller[_0x0d25('0x12')]);module['exports']=router;
\ No newline at end of file
index 4049351..bd1c9e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d5e=['exports','ENUM','string','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x3356d0,_0x17615a){var _0x54d632=function(_0x849e27){while(--_0x849e27){_0x3356d0['push'](_0x3356d0['shift']());}};_0x54d632(++_0x17615a);}(_0x7d5e,0x19c));var _0xe7d5=function(_0x492900,_0x7d47e9){_0x492900=_0x492900-0x0;var _0x11136b=_0x7d5e[_0x492900];return _0x11136b;};'use strict';var Sequelize=require(_0xe7d5('0x0'));module[_0xe7d5('0x1')]={'type':{'type':Sequelize[_0xe7d5('0x2')](_0xe7d5('0x3'),'variable','customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xe7d5('0x4')]},'key':{'type':Sequelize[_0xe7d5('0x4')]},'keyType':{'type':Sequelize[_0xe7d5('0x2')](_0xe7d5('0x3'),'variable',_0xe7d5('0x5'))},'keyContent':{'type':Sequelize[_0xe7d5('0x4')]},'idField':{'type':Sequelize[_0xe7d5('0x4')]},'nameField':{'type':Sequelize[_0xe7d5('0x4')]},'customField':{'type':Sequelize[_0xe7d5('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe7d5('0x4')]}};
\ No newline at end of file
+var _0x5f99=['keyValue','picklist','STRING','ENUM','BOOLEAN','exports','string','variable','customVariable'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5f99,0x1a3));var _0x95f9=function(_0x2742d8,_0x10ca96){_0x2742d8=_0x2742d8-0x0;var _0x205cb0=_0x5f99[_0x2742d8];return _0x205cb0;};'use strict';var Sequelize=require('sequelize');module[_0x95f9('0x0')]={'type':{'type':Sequelize['ENUM'](_0x95f9('0x1'),_0x95f9('0x2'),_0x95f9('0x3'),_0x95f9('0x4'),_0x95f9('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x95f9('0x6')]},'keyType':{'type':Sequelize[_0x95f9('0x7')](_0x95f9('0x1'),_0x95f9('0x2'),_0x95f9('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x95f9('0x6')]},'customField':{'type':Sequelize[_0x95f9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 84d4ab6..cf65ebc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed83=['path','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','DeskField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5d9cc6,_0x30448a){var _0x618b53=function(_0x3724b4){while(--_0x3724b4){_0x5d9cc6['push'](_0x5d9cc6['shift']());}};_0x618b53(++_0x30448a);}(_0xed83,0x160));var _0x3ed8=function(_0x1b00f1,_0x15ffa8){_0x1b00f1=_0x1b00f1-0x0;var _0x5c3dad=_0xed83[_0x1b00f1];return _0x5c3dad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ed8('0x0'));var zipdir=require(_0x3ed8('0x1'));var jsonpatch=require(_0x3ed8('0x2'));var rp=require(_0x3ed8('0x3'));var moment=require(_0x3ed8('0x4'));var BPromise=require(_0x3ed8('0x5'));var Mustache=require(_0x3ed8('0x6'));var util=require(_0x3ed8('0x7'));var path=require(_0x3ed8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3ed8('0x9'));var fs=require('fs');var fs_extra=require(_0x3ed8('0xa'));var _=require('lodash');var squel=require(_0x3ed8('0xb'));var crypto=require(_0x3ed8('0xc'));var jsforce=require(_0x3ed8('0xd'));var deskjs=require(_0x3ed8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3ed8('0xf'));var Redis=require('ioredis');var authService=require(_0x3ed8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3ed8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ed8('0x12'))(_0x3ed8('0x13'));var utils=require(_0x3ed8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3ed8('0x15'));var db=require(_0x3ed8('0x16'))['db'];function respondWithStatusCode(_0x829a8b,_0xfb5582){_0xfb5582=_0xfb5582||0xcc;return function(_0x4c51a7){if(_0x4c51a7){return _0x829a8b[_0x3ed8('0x17')](_0xfb5582);}return _0x829a8b['status'](_0xfb5582)[_0x3ed8('0x18')]();};}function respondWithResult(_0x579fdd,_0x4d55db){_0x4d55db=_0x4d55db||0xc8;return function(_0x41c024){if(_0x41c024){return _0x579fdd[_0x3ed8('0x19')](_0x4d55db)[_0x3ed8('0x1a')](_0x41c024);}};}function respondWithFilteredResult(_0x18b79a,_0x405344){return function(_0x211045){if(_0x211045){var _0x9861b2=typeof _0x405344[_0x3ed8('0x1b')]===_0x3ed8('0x1c')&&typeof _0x405344['limit']===_0x3ed8('0x1c');var _0x1fcc9b=_0x211045[_0x3ed8('0x1d')];var _0x281b2f=_0x9861b2?0x0:_0x405344[_0x3ed8('0x1b')];var _0x42556f=_0x9861b2?_0x211045[_0x3ed8('0x1d')]:_0x405344[_0x3ed8('0x1b')]+_0x405344[_0x3ed8('0x1e')];var _0x4f9ef5;if(_0x42556f>=_0x1fcc9b){_0x42556f=_0x1fcc9b;_0x4f9ef5=0xc8;}else{_0x4f9ef5=0xce;}_0x18b79a[_0x3ed8('0x19')](_0x4f9ef5);return _0x18b79a[_0x3ed8('0x1f')](_0x3ed8('0x20'),_0x281b2f+'-'+_0x42556f+'/'+_0x1fcc9b)['json'](_0x211045);}return null;};}function patchUpdates(_0x78ef01){return function(_0x3d6344){try{jsonpatch['apply'](_0x3d6344,_0x78ef01,!![]);}catch(_0x172807){return BPromise[_0x3ed8('0x21')](_0x172807);}return _0x3d6344[_0x3ed8('0x22')]();};}function saveUpdates(_0x31e062,_0x233906){return function(_0x54bc87){if(_0x54bc87){return _0x54bc87[_0x3ed8('0x23')](_0x31e062)[_0x3ed8('0x24')](function(_0x3c0bf2){return _0x3c0bf2;});}return null;};}function removeEntity(_0x5e3262,_0x4f7bbd){return function(_0x1d15da){if(_0x1d15da){return _0x1d15da[_0x3ed8('0x25')]()['then'](function(){_0x5e3262[_0x3ed8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8f1aaa,_0x3d91ff){return function(_0x5af6b8){if(!_0x5af6b8){_0x8f1aaa['sendStatus'](0x194);}return _0x5af6b8;};}function handleError(_0x2b97e7,_0x4a370d){_0x4a370d=_0x4a370d||0x1f4;return function(_0x22e306){logger[_0x3ed8('0x26')](_0x22e306[_0x3ed8('0x27')]);if(_0x22e306[_0x3ed8('0x28')]){delete _0x22e306[_0x3ed8('0x28')];}_0x2b97e7[_0x3ed8('0x19')](_0x4a370d)['send'](_0x22e306);};}exports[_0x3ed8('0x29')]=function(_0x1342c1,_0x13166e){var _0xbe10e6={},_0x56bb68={},_0xdaf9b9={'count':0x0,'rows':[]};var _0x4b679f=_['map'](db[_0x3ed8('0x2a')][_0x3ed8('0x2b')],function(_0x2c7efd){return{'name':_0x2c7efd[_0x3ed8('0x2c')],'type':_0x2c7efd[_0x3ed8('0x2d')][_0x3ed8('0x2e')]};});_0x56bb68[_0x3ed8('0x2f')]=_[_0x3ed8('0x30')](_0x4b679f,'name');_0x56bb68['query']=_[_0x3ed8('0x31')](_0x1342c1[_0x3ed8('0x32')]);_0x56bb68[_0x3ed8('0x33')]=_['intersection'](_0x56bb68[_0x3ed8('0x2f')],_0x56bb68['query']);_0xbe10e6[_0x3ed8('0x34')]=_[_0x3ed8('0x35')](_0x56bb68['model'],qs[_0x3ed8('0x36')](_0x1342c1['query'][_0x3ed8('0x36')]));_0xbe10e6[_0x3ed8('0x34')]=_0xbe10e6[_0x3ed8('0x34')][_0x3ed8('0x37')]?_0xbe10e6[_0x3ed8('0x34')]:_0x56bb68['model'];if(!_0x1342c1['query'][_0x3ed8('0x38')]('nolimit')){_0xbe10e6['limit']=qs['limit'](_0x1342c1[_0x3ed8('0x32')]['limit']);_0xbe10e6['offset']=qs['offset'](_0x1342c1[_0x3ed8('0x32')][_0x3ed8('0x1b')]);}_0xbe10e6[_0x3ed8('0x39')]=qs[_0x3ed8('0x3a')](_0x1342c1['query']['sort']);_0xbe10e6[_0x3ed8('0x3b')]=qs[_0x3ed8('0x33')](_['pick'](_0x1342c1['query'],_0x56bb68[_0x3ed8('0x33')]),_0x4b679f);if(_0x1342c1[_0x3ed8('0x32')][_0x3ed8('0x3c')]){_0xbe10e6[_0x3ed8('0x3b')]=_[_0x3ed8('0x3d')](_0xbe10e6[_0x3ed8('0x3b')],{'$or':_[_0x3ed8('0x30')](_0x4b679f,function(_0x138add){if(_0x138add[_0x3ed8('0x2d')]!==_0x3ed8('0x3e')){var _0x42be01={};_0x42be01[_0x138add['name']]={'$like':'%'+_0x1342c1['query'][_0x3ed8('0x3c')]+'%'};return _0x42be01;}})});}_0xbe10e6=_[_0x3ed8('0x3d')]({},_0xbe10e6,_0x1342c1['options']);var _0x2f7f1b={'where':_0xbe10e6[_0x3ed8('0x3b')]};return db[_0x3ed8('0x2a')]['count'](_0x2f7f1b)['then'](function(_0x27144a){_0xdaf9b9[_0x3ed8('0x1d')]=_0x27144a;if(_0x1342c1['query'][_0x3ed8('0x3f')]){_0xbe10e6[_0x3ed8('0x40')]=[{'all':!![]}];}return db[_0x3ed8('0x2a')][_0x3ed8('0x41')](_0xbe10e6);})['then'](function(_0x5b18f7){_0xdaf9b9['rows']=_0x5b18f7;return _0xdaf9b9;})[_0x3ed8('0x24')](respondWithFilteredResult(_0x13166e,_0xbe10e6))[_0x3ed8('0x42')](handleError(_0x13166e,null));};exports['show']=function(_0x1d534b,_0x54032b){var _0x102618={'raw':!![],'where':{'id':_0x1d534b['params']['id']}},_0x2a73da={};_0x2a73da[_0x3ed8('0x2f')]=_['keys'](db['DeskField'][_0x3ed8('0x2b')]);_0x2a73da['query']=_['keys'](_0x1d534b[_0x3ed8('0x32')]);_0x2a73da[_0x3ed8('0x33')]=_[_0x3ed8('0x35')](_0x2a73da[_0x3ed8('0x2f')],_0x2a73da['query']);_0x102618['attributes']=_[_0x3ed8('0x35')](_0x2a73da[_0x3ed8('0x2f')],qs[_0x3ed8('0x36')](_0x1d534b[_0x3ed8('0x32')][_0x3ed8('0x36')]));_0x102618['attributes']=_0x102618['attributes'][_0x3ed8('0x37')]?_0x102618[_0x3ed8('0x34')]:_0x2a73da[_0x3ed8('0x2f')];if(_0x1d534b['query']['includeAll']){_0x102618['include']=[{'all':!![]}];}_0x102618=_[_0x3ed8('0x3d')]({},_0x102618,_0x1d534b[_0x3ed8('0x43')]);return db['DeskField']['find'](_0x102618)[_0x3ed8('0x24')](handleEntityNotFound(_0x54032b,null))[_0x3ed8('0x24')](respondWithResult(_0x54032b,null))['catch'](handleError(_0x54032b,null));};exports['create']=function(_0x231713,_0x55defd){return db[_0x3ed8('0x2a')][_0x3ed8('0x44')](_0x231713[_0x3ed8('0x45')],{})[_0x3ed8('0x24')](respondWithResult(_0x55defd,0xc9))[_0x3ed8('0x42')](handleError(_0x55defd,null));};exports['update']=function(_0x37e6c3,_0x43f468){if(_0x37e6c3['body']['id']){delete _0x37e6c3[_0x3ed8('0x45')]['id'];}return db[_0x3ed8('0x2a')][_0x3ed8('0x46')]({'where':{'id':_0x37e6c3[_0x3ed8('0x47')]['id']}})['then'](handleEntityNotFound(_0x43f468,null))[_0x3ed8('0x24')](saveUpdates(_0x37e6c3[_0x3ed8('0x45')],null))[_0x3ed8('0x24')](respondWithResult(_0x43f468,null))[_0x3ed8('0x42')](handleError(_0x43f468,null));};exports[_0x3ed8('0x25')]=function(_0x2f838f,_0x2e91bd){return db[_0x3ed8('0x2a')]['find']({'where':{'id':_0x2f838f[_0x3ed8('0x47')]['id']}})['then'](handleEntityNotFound(_0x2e91bd,null))[_0x3ed8('0x24')](removeEntity(_0x2e91bd,null))['catch'](handleError(_0x2e91bd,null));};
\ No newline at end of file
+var _0x1696=['undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','end','error','send','map','DeskField','fieldName','type','model','keys','attributes','intersection','fields','hasOwnProperty','nolimit','query','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','include','rows','show','length','includeAll','find','catch','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x5b1b12,_0x4485c8){var _0x3642a6=function(_0x39db5e){while(--_0x39db5e){_0x5b1b12['push'](_0x5b1b12['shift']());}};_0x3642a6(++_0x4485c8);}(_0x1696,0x79));var _0x6169=function(_0x572799,_0x8764c8){_0x572799=_0x572799-0x0;var _0x4a855d=_0x1696[_0x572799];return _0x4a855d;};'use strict';var emlformat=require(_0x6169('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6169('0x1'));var jsonpatch=require(_0x6169('0x2'));var rp=require(_0x6169('0x3'));var moment=require(_0x6169('0x4'));var BPromise=require(_0x6169('0x5'));var Mustache=require(_0x6169('0x6'));var util=require(_0x6169('0x7'));var path=require(_0x6169('0x8'));var sox=require(_0x6169('0x9'));var csv=require('to-csv');var ejs=require(_0x6169('0xa'));var fs=require('fs');var fs_extra=require(_0x6169('0xb'));var _=require(_0x6169('0xc'));var squel=require(_0x6169('0xd'));var crypto=require(_0x6169('0xe'));var jsforce=require(_0x6169('0xf'));var deskjs=require(_0x6169('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6169('0x11'));var Papa=require('papaparse');var Redis=require(_0x6169('0x12'));var authService=require(_0x6169('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6169('0x14'));var hardwareService=require(_0x6169('0x15'));var logger=require(_0x6169('0x16'))(_0x6169('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6169('0x18'));var db=require(_0x6169('0x19'))['db'];function respondWithStatusCode(_0x5f342e,_0x9288c4){_0x9288c4=_0x9288c4||0xcc;return function(_0x2d6570){if(_0x2d6570){return _0x5f342e[_0x6169('0x1a')](_0x9288c4);}return _0x5f342e['status'](_0x9288c4)['end']();};}function respondWithResult(_0x4ba7bf,_0x2829cf){_0x2829cf=_0x2829cf||0xc8;return function(_0x2171d1){if(_0x2171d1){return _0x4ba7bf[_0x6169('0x1b')](_0x2829cf)[_0x6169('0x1c')](_0x2171d1);}};}function respondWithFilteredResult(_0x3ffa76,_0x5837d8){return function(_0x461294){if(_0x461294){var _0x3e2eb4=typeof _0x5837d8['offset']===_0x6169('0x1d')&&typeof _0x5837d8['limit']===_0x6169('0x1d');var _0x1e3b4e=_0x461294['count'];var _0xdfe11e=_0x3e2eb4?0x0:_0x5837d8[_0x6169('0x1e')];var _0xd47fea=_0x3e2eb4?_0x461294[_0x6169('0x1f')]:_0x5837d8[_0x6169('0x1e')]+_0x5837d8[_0x6169('0x20')];var _0x2b2e20;if(_0xd47fea>=_0x1e3b4e){_0xd47fea=_0x1e3b4e;_0x2b2e20=0xc8;}else{_0x2b2e20=0xce;}_0x3ffa76['status'](_0x2b2e20);return _0x3ffa76['set'](_0x6169('0x21'),_0xdfe11e+'-'+_0xd47fea+'/'+_0x1e3b4e)[_0x6169('0x1c')](_0x461294);}return null;};}function patchUpdates(_0x486186){return function(_0x34675a){try{jsonpatch[_0x6169('0x22')](_0x34675a,_0x486186,!![]);}catch(_0x2f3ef3){return BPromise[_0x6169('0x23')](_0x2f3ef3);}return _0x34675a[_0x6169('0x24')]();};}function saveUpdates(_0x51598d,_0x2506bb){return function(_0x5579b9){if(_0x5579b9){return _0x5579b9[_0x6169('0x25')](_0x51598d)[_0x6169('0x26')](function(_0x13e390){return _0x13e390;});}return null;};}function removeEntity(_0x4b35ca,_0x3b0e8a){return function(_0x1f90aa){if(_0x1f90aa){return _0x1f90aa['destroy']()['then'](function(){_0x4b35ca[_0x6169('0x1b')](0xcc)[_0x6169('0x27')]();});}};}function handleEntityNotFound(_0x3e706c,_0x20b40c){return function(_0x1b207e){if(!_0x1b207e){_0x3e706c[_0x6169('0x1a')](0x194);}return _0x1b207e;};}function handleError(_0x647f57,_0x3010f7){_0x3010f7=_0x3010f7||0x1f4;return function(_0x5f2e3b){logger[_0x6169('0x28')](_0x5f2e3b['stack']);if(_0x5f2e3b['name']){delete _0x5f2e3b['name'];}_0x647f57['status'](_0x3010f7)[_0x6169('0x29')](_0x5f2e3b);};}exports['index']=function(_0x4466f3,_0x136d11){var _0x15bef9={},_0x512977={},_0x51e2ea={'count':0x0,'rows':[]};var _0x544dcc=_[_0x6169('0x2a')](db[_0x6169('0x2b')]['rawAttributes'],function(_0x4c6036){return{'name':_0x4c6036[_0x6169('0x2c')],'type':_0x4c6036[_0x6169('0x2d')]['key']};});_0x512977[_0x6169('0x2e')]=_[_0x6169('0x2a')](_0x544dcc,'name');_0x512977['query']=_[_0x6169('0x2f')](_0x4466f3['query']);_0x512977['filters']=_['intersection'](_0x512977[_0x6169('0x2e')],_0x512977['query']);_0x15bef9[_0x6169('0x30')]=_[_0x6169('0x31')](_0x512977['model'],qs[_0x6169('0x32')](_0x4466f3['query'][_0x6169('0x32')]));_0x15bef9[_0x6169('0x30')]=_0x15bef9[_0x6169('0x30')]['length']?_0x15bef9['attributes']:_0x512977['model'];if(!_0x4466f3['query'][_0x6169('0x33')](_0x6169('0x34'))){_0x15bef9['limit']=qs[_0x6169('0x20')](_0x4466f3[_0x6169('0x35')][_0x6169('0x20')]);_0x15bef9['offset']=qs[_0x6169('0x1e')](_0x4466f3[_0x6169('0x35')][_0x6169('0x1e')]);}_0x15bef9[_0x6169('0x36')]=qs[_0x6169('0x37')](_0x4466f3[_0x6169('0x35')][_0x6169('0x37')]);_0x15bef9[_0x6169('0x38')]=qs[_0x6169('0x39')](_[_0x6169('0x3a')](_0x4466f3[_0x6169('0x35')],_0x512977['filters']),_0x544dcc);if(_0x4466f3[_0x6169('0x35')][_0x6169('0x3b')]){_0x15bef9['where']=_[_0x6169('0x3c')](_0x15bef9[_0x6169('0x38')],{'$or':_[_0x6169('0x2a')](_0x544dcc,function(_0xdfce5f){if(_0xdfce5f[_0x6169('0x2d')]!==_0x6169('0x3d')){var _0x388ca5={};_0x388ca5[_0xdfce5f[_0x6169('0x3e')]]={'$like':'%'+_0x4466f3[_0x6169('0x35')]['filter']+'%'};return _0x388ca5;}})});}_0x15bef9=_[_0x6169('0x3c')]({},_0x15bef9,_0x4466f3[_0x6169('0x3f')]);var _0x273730={'where':_0x15bef9['where']};return db[_0x6169('0x2b')][_0x6169('0x1f')](_0x273730)['then'](function(_0x3026d7){_0x51e2ea['count']=_0x3026d7;if(_0x4466f3[_0x6169('0x35')]['includeAll']){_0x15bef9[_0x6169('0x40')]=[{'all':!![]}];}return db[_0x6169('0x2b')]['findAll'](_0x15bef9);})[_0x6169('0x26')](function(_0x4969e3){_0x51e2ea[_0x6169('0x41')]=_0x4969e3;return _0x51e2ea;})[_0x6169('0x26')](respondWithFilteredResult(_0x136d11,_0x15bef9))['catch'](handleError(_0x136d11,null));};exports[_0x6169('0x42')]=function(_0x4b07e8,_0x34ad06){var _0x545863={'raw':!![],'where':{'id':_0x4b07e8['params']['id']}},_0x1a7849={};_0x1a7849['model']=_[_0x6169('0x2f')](db[_0x6169('0x2b')]['rawAttributes']);_0x1a7849[_0x6169('0x35')]=_['keys'](_0x4b07e8[_0x6169('0x35')]);_0x1a7849[_0x6169('0x39')]=_['intersection'](_0x1a7849[_0x6169('0x2e')],_0x1a7849['query']);_0x545863['attributes']=_[_0x6169('0x31')](_0x1a7849[_0x6169('0x2e')],qs['fields'](_0x4b07e8[_0x6169('0x35')]['fields']));_0x545863[_0x6169('0x30')]=_0x545863[_0x6169('0x30')][_0x6169('0x43')]?_0x545863['attributes']:_0x1a7849[_0x6169('0x2e')];if(_0x4b07e8[_0x6169('0x35')][_0x6169('0x44')]){_0x545863[_0x6169('0x40')]=[{'all':!![]}];}_0x545863=_[_0x6169('0x3c')]({},_0x545863,_0x4b07e8[_0x6169('0x3f')]);return db['DeskField'][_0x6169('0x45')](_0x545863)[_0x6169('0x26')](handleEntityNotFound(_0x34ad06,null))[_0x6169('0x26')](respondWithResult(_0x34ad06,null))[_0x6169('0x46')](handleError(_0x34ad06,null));};exports[_0x6169('0x47')]=function(_0x4d004e,_0x4ab194){return db[_0x6169('0x2b')][_0x6169('0x47')](_0x4d004e[_0x6169('0x48')],{})[_0x6169('0x26')](respondWithResult(_0x4ab194,0xc9))[_0x6169('0x46')](handleError(_0x4ab194,null));};exports[_0x6169('0x25')]=function(_0x11bc4b,_0xcffe00){if(_0x11bc4b[_0x6169('0x48')]['id']){delete _0x11bc4b[_0x6169('0x48')]['id'];}return db[_0x6169('0x2b')]['find']({'where':{'id':_0x11bc4b[_0x6169('0x49')]['id']}})['then'](handleEntityNotFound(_0xcffe00,null))[_0x6169('0x26')](saveUpdates(_0x11bc4b[_0x6169('0x48')],null))['then'](respondWithResult(_0xcffe00,null))[_0x6169('0x46')](handleError(_0xcffe00,null));};exports[_0x6169('0x4a')]=function(_0x291a5b,_0x1dd004){return db['DeskField'][_0x6169('0x45')]({'where':{'id':_0x291a5b['params']['id']}})[_0x6169('0x26')](handleEntityNotFound(_0x1dd004,null))[_0x6169('0x26')](removeEntity(_0x1dd004,null))[_0x6169('0x46')](handleError(_0x1dd004,null));};
\ No newline at end of file
index 8521902..00d4fbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2ea=['moment','bluebird','request-promise','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xa2ea,0x1eb));var _0xaa2e=function(_0x1731a9,_0x4fb551){_0x1731a9=_0x1731a9-0x0;var _0x22b9a5=_0xa2ea[_0x1731a9];return _0x22b9a5;};'use strict';var _=require(_0xaa2e('0x0'));var util=require(_0xaa2e('0x1'));var logger=require(_0xaa2e('0x2'))(_0xaa2e('0x3'));var moment=require(_0xaa2e('0x4'));var BPromise=require(_0xaa2e('0x5'));var rp=require(_0xaa2e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaa2e('0x7'));module[_0xaa2e('0x8')]=function(_0x4e9d91,_0x304a55){return _0x4e9d91[_0xaa2e('0x9')](_0xaa2e('0xa'),attributes,{'tableName':_0xaa2e('0xb'),'paranoid':![],'indexes':[{'name':_0xaa2e('0xc'),'fields':[_0xaa2e('0xd'),_0xaa2e('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x26ae=['int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','DeskField'];(function(_0x50933b,_0x2a1551){var _0x2b134e=function(_0x325d22){while(--_0x325d22){_0x50933b['push'](_0x50933b['shift']());}};_0x2b134e(++_0x2a1551);}(_0x26ae,0x194));var _0xe26a=function(_0x53323e,_0x383420){_0x53323e=_0x53323e-0x0;var _0x41d9e7=_0x26ae[_0x53323e];return _0x41d9e7;};'use strict';var _=require(_0xe26a('0x0'));var util=require(_0xe26a('0x1'));var logger=require(_0xe26a('0x2'))(_0xe26a('0x3'));var moment=require(_0xe26a('0x4'));var BPromise=require(_0xe26a('0x5'));var rp=require(_0xe26a('0x6'));var fs=require('fs');var path=require(_0xe26a('0x7'));var rimraf=require('rimraf');var config=require(_0xe26a('0x8'));var attributes=require(_0xe26a('0x9'));module[_0xe26a('0xa')]=function(_0x4b1385,_0x1d6477){return _0x4b1385['define'](_0xe26a('0xb'),attributes,{'tableName':_0xe26a('0xc'),'paranoid':![],'indexes':[{'name':_0xe26a('0xd'),'fields':[_0xe26a('0xe'),_0xe26a('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8182179..3ed39d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0216=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x4111b8,_0x471f2f){var _0x5e8f82=function(_0x3c0be9){while(--_0x3c0be9){_0x4111b8['push'](_0x4111b8['shift']());}};_0x5e8f82(++_0x471f2f);}(_0x0216,0x105));var _0x6021=function(_0x40d38a,_0x203731){_0x40d38a=_0x40d38a-0x0;var _0x7f26c8=_0x0216[_0x40d38a];return _0x7f26c8;};'use strict';var _=require(_0x6021('0x0'));var util=require('util');var moment=require(_0x6021('0x1'));var BPromise=require(_0x6021('0x2'));var rs=require(_0x6021('0x3'));var fs=require('fs');var Redis=require(_0x6021('0x4'));var db=require(_0x6021('0x5'))['db'];var utils=require(_0x6021('0x6'));var logger=require('../../config/logger')(_0x6021('0x7'));var config=require(_0x6021('0x8'));var jayson=require(_0x6021('0x9'));var client=jayson[_0x6021('0xa')][_0x6021('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b3ce0,_0x206123,_0x11e728){return new BPromise(function(_0x324f9a,_0x2e3790){return client[_0x6021('0xc')](_0x5b3ce0,_0x11e728)[_0x6021('0xd')](function(_0x52375d){logger[_0x6021('0xe')](_0x6021('0xf'),_0x206123,'request\x20sent');logger[_0x6021('0x10')](_0x6021('0x11'),_0x206123,_0x6021('0x12'),JSON[_0x6021('0x13')](_0x52375d));if(_0x52375d[_0x6021('0x14')]){if(_0x52375d[_0x6021('0x14')][_0x6021('0x15')]===0x1f4){logger[_0x6021('0x14')](_0x6021('0xf'),_0x206123,_0x52375d[_0x6021('0x14')][_0x6021('0x16')]);return _0x2e3790(_0x52375d[_0x6021('0x14')]['message']);}logger['error']('DeskField,\x20%s,\x20%s',_0x206123,_0x52375d[_0x6021('0x14')]['message']);return _0x324f9a(_0x52375d['error'][_0x6021('0x16')]);}else{logger['info'](_0x6021('0xf'),_0x206123,_0x6021('0x12'));_0x324f9a(_0x52375d['result']['message']);}})[_0x6021('0x17')](function(_0x1663df){logger[_0x6021('0x14')](_0x6021('0xf'),_0x206123,_0x1663df);_0x2e3790(_0x1663df);});});}
\ No newline at end of file
+var _0x1524=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','DeskField,\x20%s,\x20%s','message'];(function(_0x14279d,_0x118b77){var _0x4e53e7=function(_0x5f11f4){while(--_0x5f11f4){_0x14279d['push'](_0x14279d['shift']());}};_0x4e53e7(++_0x118b77);}(_0x1524,0x12c));var _0x4152=function(_0x56f0b2,_0xdcf225){_0x56f0b2=_0x56f0b2-0x0;var _0x194f36=_0x1524[_0x56f0b2];return _0x194f36;};'use strict';var _=require(_0x4152('0x0'));var util=require(_0x4152('0x1'));var moment=require(_0x4152('0x2'));var BPromise=require(_0x4152('0x3'));var rs=require(_0x4152('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4152('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4152('0x6'))(_0x4152('0x7'));var config=require(_0x4152('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4152('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d7ffd,_0x3b6cde,_0x667d8a){return new BPromise(function(_0x46fc2e,_0x8c097e){return client[_0x4152('0xa')](_0x2d7ffd,_0x667d8a)[_0x4152('0xb')](function(_0x8184f4){logger[_0x4152('0xc')]('DeskField,\x20%s,\x20%s',_0x3b6cde,_0x4152('0xd'));logger[_0x4152('0xe')](_0x4152('0xf'),_0x3b6cde,_0x4152('0xd'),JSON[_0x4152('0x10')](_0x8184f4));if(_0x8184f4[_0x4152('0x11')]){if(_0x8184f4[_0x4152('0x11')]['code']===0x1f4){logger[_0x4152('0x11')](_0x4152('0x12'),_0x3b6cde,_0x8184f4['error'][_0x4152('0x13')]);return _0x8c097e(_0x8184f4['error']['message']);}logger['error'](_0x4152('0x12'),_0x3b6cde,_0x8184f4[_0x4152('0x11')][_0x4152('0x13')]);return _0x46fc2e(_0x8184f4[_0x4152('0x11')][_0x4152('0x13')]);}else{logger[_0x4152('0xc')]('DeskField,\x20%s,\x20%s',_0x3b6cde,'request\x20sent');_0x46fc2e(_0x8184f4['result'][_0x4152('0x13')]);}})['catch'](function(_0x479bbe){logger[_0x4152('0x11')](_0x4152('0x12'),_0x3b6cde,_0x479bbe);_0x8c097e(_0x479bbe);});});}
\ No newline at end of file
index 0dedcc7..0aa7b05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda25=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x2f00ba,_0x2e6bf8){var _0x5630a8=function(_0x56ca53){while(--_0x56ca53){_0x2f00ba['push'](_0x2f00ba['shift']());}};_0x5630a8(++_0x2e6bf8);}(_0xda25,0x1ce));var _0x5da2=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xda25[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x5da2('0x0'));var util=require(_0x5da2('0x1'));var path=require(_0x5da2('0x2'));var timeout=require(_0x5da2('0x3'));var express=require(_0x5da2('0x4'));var router=express[_0x5da2('0x5')]();var fs_extra=require(_0x5da2('0x6'));var auth=require(_0x5da2('0x7'));var interaction=require(_0x5da2('0x8'));var config=require(_0x5da2('0x9'));var controller=require(_0x5da2('0xa'));router['get']('/',auth[_0x5da2('0xb')](),controller[_0x5da2('0xc')]);router[_0x5da2('0xd')](_0x5da2('0xe'),auth[_0x5da2('0xb')](),controller[_0x5da2('0xf')]);router['get'](_0x5da2('0x10'),auth[_0x5da2('0xb')](),controller[_0x5da2('0x11')]);router[_0x5da2('0xd')](_0x5da2('0x12'),auth[_0x5da2('0xb')](),controller[_0x5da2('0x13')]);router[_0x5da2('0x14')]('/',auth[_0x5da2('0xb')](),controller['create']);router[_0x5da2('0x14')](_0x5da2('0x10'),auth['isAuthenticated'](),controller[_0x5da2('0x15')]);router[_0x5da2('0x16')](_0x5da2('0xe'),auth[_0x5da2('0xb')](),controller[_0x5da2('0x17')]);router[_0x5da2('0x18')]('/:id',auth[_0x5da2('0xb')](),controller[_0x5da2('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x4cbf=['getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','show','isAuthenticated'];(function(_0x265c42,_0x5d0261){var _0x1d306b=function(_0xbec399){while(--_0xbec399){_0x265c42['push'](_0x265c42['shift']());}};_0x1d306b(++_0x5d0261);}(_0x4cbf,0xda));var _0xf4cb=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x4cbf[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0xf4cb('0x0'));var path=require(_0xf4cb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf4cb('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf4cb('0x3'));var interaction=require(_0xf4cb('0x4'));var config=require('../../config/environment');var controller=require(_0xf4cb('0x5'));router[_0xf4cb('0x6')]('/',auth['isAuthenticated'](),controller[_0xf4cb('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf4cb('0x8')]);router[_0xf4cb('0x6')]('/:id/configurations',auth[_0xf4cb('0x9')](),controller['getConfigurations']);router[_0xf4cb('0x6')]('/:id/fields',auth[_0xf4cb('0x9')](),controller[_0xf4cb('0xa')]);router[_0xf4cb('0xb')]('/',auth[_0xf4cb('0x9')](),controller[_0xf4cb('0xc')]);router[_0xf4cb('0xb')]('/:id/configurations',auth[_0xf4cb('0x9')](),controller[_0xf4cb('0xd')]);router['put'](_0xf4cb('0xe'),auth[_0xf4cb('0x9')](),controller[_0xf4cb('0xf')]);router[_0xf4cb('0x10')](_0xf4cb('0xe'),auth[_0xf4cb('0x9')](),controller[_0xf4cb('0x11')]);module[_0xf4cb('0x12')]=router;
\ No newline at end of file
index eb0cfe6..01fd6c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c32=['BOOLEAN','sequelize','STRING'];(function(_0x6ca726,_0xffe942){var _0x57f127=function(_0x386b0d){while(--_0x386b0d){_0x6ca726['push'](_0x6ca726['shift']());}};_0x57f127(++_0xffe942);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x26c3('0x0'));module['exports']={'name':{'type':Sequelize[_0x26c3('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x26c3('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x26c3('0x1')]},'clientId':{'type':Sequelize[_0x26c3('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x26c3('0x1')]},'modernAuthentication':{'type':Sequelize[_0x26c3('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x7d9f=['sequelize','exports','STRING'];(function(_0x57bd08,_0x26f954){var _0x3dc6a9=function(_0x564677){while(--_0x564677){_0x57bd08['push'](_0x57bd08['shift']());}};_0x3dc6a9(++_0x26f954);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x6be190,_0x25e8dd){_0x6be190=_0x6be190-0x0;var _0x3867df=_0x7d9f[_0x6be190];return _0x3867df;};'use strict';var Sequelize=require(_0xf7d9('0x0'));module[_0xf7d9('0x1')]={'name':{'type':Sequelize[_0xf7d9('0x2')]},'username':{'type':Sequelize[_0xf7d9('0x2')]},'password':{'type':Sequelize[_0xf7d9('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xf7d9('0x2')]},'clientId':{'type':Sequelize[_0xf7d9('0x2')]},'clientSecret':{'type':Sequelize[_0xf7d9('0x2')]},'serverUrl':{'type':Sequelize[_0xf7d9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf7d9('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 517255d..8c772e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb377=['slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','/oauth2/token','password','GET','Bearer\x20',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','isNil','BooleanAttributeMetadata','all','lastIndexOf','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','concat','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','Options','Label','Value','LogicalName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','UserLocalizedLabel','false',')/Microsoft.Dynamics.CRM.','DisplayName','util','../../components/parsers/qs','api','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','Dynamics365Account','includeAll','include','findAll','catch','show','model','options','find','create','update','body','params','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','Dynamics365Field','substring','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entityimage_timestamp','escalatedon','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','responsiblecontactidyominame','sentimentvalue'];(function(_0x22b98c,_0x3cc5dc){var _0x5e846e=function(_0x265144){while(--_0x265144){_0x22b98c['push'](_0x22b98c['shift']());}};_0x5e846e(++_0x3cc5dc);}(_0xb377,0xf7));var _0x7b37=function(_0x3d3a50,_0x41f5f5){_0x3d3a50=_0x3d3a50-0x0;var _0x53163b=_0xb377[_0x3d3a50];return _0x53163b;};'use strict';var rp=require('request-promise');var util=require(_0x7b37('0x0'));var _=require('lodash');var qs=require(_0x7b37('0x1'));var logger=require('../../config/logger')(_0x7b37('0x2'));var db=require(_0x7b37('0x3'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x2aac2e,_0x53a374){_0x53a374=_0x53a374||0xc8;return function(_0x3a5c1f){if(_0x3a5c1f){return _0x2aac2e[_0x7b37('0x4')](_0x53a374)[_0x7b37('0x5')](_0x3a5c1f);}};}function respondWithFilteredResult(_0x17aac0,_0x545345){return function(_0x12c506){if(_0x12c506){var _0x21b974=typeof _0x545345[_0x7b37('0x6')]===_0x7b37('0x7')&&typeof _0x545345['limit']===_0x7b37('0x7');var _0x13c213=_0x12c506[_0x7b37('0x8')];var _0x586b54=_0x21b974?0x0:_0x545345['offset'];var _0x33cd49=_0x21b974?_0x12c506[_0x7b37('0x8')]:_0x545345[_0x7b37('0x6')]+_0x545345[_0x7b37('0x9')];var _0x173c64;if(_0x33cd49>=_0x13c213){_0x33cd49=_0x13c213;_0x173c64=0xc8;}else{_0x173c64=0xce;}_0x17aac0[_0x7b37('0x4')](_0x173c64);return _0x17aac0[_0x7b37('0xa')](_0x7b37('0xb'),_0x586b54+'-'+_0x33cd49+'/'+_0x13c213)['json'](_0x12c506);}return null;};}function saveUpdates(_0x3e1e9d){return function(_0x22eefb){if(_0x22eefb){return _0x22eefb['update'](_0x3e1e9d)[_0x7b37('0xc')](function(_0x25e7eb){return _0x25e7eb;});}return null;};}function removeEntity(_0x3e48f7){return function(_0x5eef7f){if(_0x5eef7f){return _0x5eef7f['destroy']()[_0x7b37('0xc')](function(){_0x3e48f7[_0x7b37('0x4')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21bfdd){return function(_0x22e046){if(!_0x22e046){_0x21bfdd['sendStatus'](0x194);}return _0x22e046;};}function handleError(_0x551760,_0x1b7632){_0x1b7632=_0x1b7632||0x1f4;return function(_0x3b2a64){logger[_0x7b37('0xd')](_0x3b2a64[_0x7b37('0xe')]);if(_0x3b2a64[_0x7b37('0xf')]){delete _0x3b2a64[_0x7b37('0xf')];}_0x551760[_0x7b37('0x4')](_0x1b7632)[_0x7b37('0x10')](_0x3b2a64);};}exports[_0x7b37('0x11')]=function(_0x304847,_0x146588){var _0x16d653={},_0x20f29b={},_0x228770={'count':0x0,'rows':[]};var _0x213e88=_[_0x7b37('0x12')](db['Dynamics365Account'][_0x7b37('0x13')],function(_0x5b784e){return{'name':_0x5b784e[_0x7b37('0x14')],'type':_0x5b784e[_0x7b37('0x15')][_0x7b37('0x16')]};});_0x20f29b['model']=_[_0x7b37('0x12')](_0x213e88,_0x7b37('0xf'));_0x20f29b[_0x7b37('0x17')]=_[_0x7b37('0x18')](_0x304847['query']);_0x20f29b['filters']=_['intersection'](_0x20f29b['model'],_0x20f29b[_0x7b37('0x17')]);_0x16d653['attributes']=_[_0x7b37('0x19')](_0x20f29b['model'],qs['fields'](_0x304847[_0x7b37('0x17')][_0x7b37('0x1a')]));_0x16d653[_0x7b37('0x1b')]=_0x16d653['attributes'][_0x7b37('0x1c')]?_0x16d653[_0x7b37('0x1b')]:_0x20f29b['model'];if(!_0x304847[_0x7b37('0x17')][_0x7b37('0x1d')](_0x7b37('0x1e'))){_0x16d653[_0x7b37('0x9')]=qs['limit'](_0x304847[_0x7b37('0x17')][_0x7b37('0x9')]);_0x16d653[_0x7b37('0x6')]=qs[_0x7b37('0x6')](_0x304847[_0x7b37('0x17')][_0x7b37('0x6')]);}_0x16d653['order']=qs[_0x7b37('0x1f')](_0x304847['query'][_0x7b37('0x1f')]);_0x16d653['where']=qs['filters'](_[_0x7b37('0x20')](_0x304847[_0x7b37('0x17')],_0x20f29b[_0x7b37('0x21')]),_0x213e88);if(_0x304847[_0x7b37('0x17')][_0x7b37('0x22')]){_0x16d653[_0x7b37('0x23')]=_[_0x7b37('0x24')](_0x16d653[_0x7b37('0x23')],{'$or':_['map'](_0x213e88,function(_0xaead13){if(_0xaead13[_0x7b37('0x15')]!=='VIRTUAL'){var _0x29a218={};_0x29a218[_0xaead13['name']]={'$like':'%'+_0x304847[_0x7b37('0x17')][_0x7b37('0x22')]+'%'};return _0x29a218;}})});}_0x16d653=_[_0x7b37('0x24')]({},_0x16d653,_0x304847['options']);var _0x3b199e={'where':_0x16d653[_0x7b37('0x23')]};return db[_0x7b37('0x25')][_0x7b37('0x8')](_0x3b199e)['then'](function(_0x1610e7){_0x228770[_0x7b37('0x8')]=_0x1610e7;if(_0x304847[_0x7b37('0x17')][_0x7b37('0x26')]){_0x16d653[_0x7b37('0x27')]=[{'all':!![]}];}return db[_0x7b37('0x25')][_0x7b37('0x28')](_0x16d653);})[_0x7b37('0xc')](function(_0xdaa9ed){_0x228770['rows']=_0xdaa9ed;return _0x228770;})[_0x7b37('0xc')](respondWithFilteredResult(_0x146588,_0x16d653))[_0x7b37('0x29')](handleError(_0x146588,null));};exports[_0x7b37('0x2a')]=function(_0x53c7b0,_0x518863){var _0x2f8c3c={'raw':![],'where':{'id':_0x53c7b0['params']['id']}},_0x85a596={};_0x85a596['model']=_[_0x7b37('0x18')](db[_0x7b37('0x25')]['rawAttributes']);_0x85a596[_0x7b37('0x17')]=_[_0x7b37('0x18')](_0x53c7b0[_0x7b37('0x17')]);_0x85a596[_0x7b37('0x21')]=_[_0x7b37('0x19')](_0x85a596[_0x7b37('0x2b')],_0x85a596['query']);_0x2f8c3c['attributes']=_['intersection'](_0x85a596[_0x7b37('0x2b')],qs[_0x7b37('0x1a')](_0x53c7b0['query'][_0x7b37('0x1a')]));_0x2f8c3c[_0x7b37('0x1b')]=_0x2f8c3c[_0x7b37('0x1b')][_0x7b37('0x1c')]?_0x2f8c3c['attributes']:_0x85a596['model'];if(_0x53c7b0['query'][_0x7b37('0x26')]){_0x2f8c3c[_0x7b37('0x27')]=[{'all':!![]}];}_0x2f8c3c=_[_0x7b37('0x24')]({},_0x2f8c3c,_0x53c7b0[_0x7b37('0x2c')]);return db['Dynamics365Account'][_0x7b37('0x2d')](_0x2f8c3c)[_0x7b37('0xc')](handleEntityNotFound(_0x518863,null))[_0x7b37('0xc')](respondWithResult(_0x518863,null))[_0x7b37('0x29')](handleError(_0x518863,null));};exports['create']=function(_0x356b34,_0x34e306){return db[_0x7b37('0x25')][_0x7b37('0x2e')](_0x356b34['body'],{})[_0x7b37('0xc')](respondWithResult(_0x34e306,0xc9))[_0x7b37('0x29')](handleError(_0x34e306,null));};exports[_0x7b37('0x2f')]=function(_0x4a586d,_0x32d1fc){if(_0x4a586d['body']['id']){delete _0x4a586d[_0x7b37('0x30')]['id'];}return db[_0x7b37('0x25')][_0x7b37('0x2d')]({'where':{'id':_0x4a586d[_0x7b37('0x31')]['id']}})[_0x7b37('0xc')](handleEntityNotFound(_0x32d1fc,null))['then'](saveUpdates(_0x4a586d[_0x7b37('0x30')],null))[_0x7b37('0xc')](respondWithResult(_0x32d1fc,null))[_0x7b37('0x29')](handleError(_0x32d1fc,null));};exports['destroy']=function(_0x4acc58,_0x26f791){return db['Dynamics365Account'][_0x7b37('0x2d')]({'where':{'id':_0x4acc58[_0x7b37('0x31')]['id']}})['then'](handleEntityNotFound(_0x26f791,null))[_0x7b37('0xc')](removeEntity(_0x26f791,null))[_0x7b37('0x29')](handleError(_0x26f791,null));};exports[_0x7b37('0x32')]=function(_0x43f3e9,_0x43ce33){var _0x5672bf={};var _0x7edf38={};var _0x1d27c1;var _0x50b1a1;return db[_0x7b37('0x25')][_0x7b37('0x33')]({'where':{'id':_0x43f3e9['params']['id']}})['then'](handleEntityNotFound(_0x43ce33,null))[_0x7b37('0xc')](function(_0x52d4e8){if(_0x52d4e8){_0x1d27c1=_0x52d4e8;_0x7edf38[_0x7b37('0x2b')]=_['keys'](db[_0x7b37('0x34')]['rawAttributes']);_0x7edf38['query']=_[_0x7b37('0x18')](_0x43f3e9['query']);_0x7edf38[_0x7b37('0x21')]=_[_0x7b37('0x19')](_0x7edf38['model'],_0x7edf38[_0x7b37('0x17')]);_0x5672bf[_0x7b37('0x1b')]=_['intersection'](_0x7edf38[_0x7b37('0x2b')],qs[_0x7b37('0x1a')](_0x43f3e9[_0x7b37('0x17')]['fields']));_0x5672bf[_0x7b37('0x1b')]=_0x5672bf[_0x7b37('0x1b')]['length']?_0x5672bf[_0x7b37('0x1b')]:_0x7edf38[_0x7b37('0x2b')];_0x5672bf[_0x7b37('0x35')]=qs[_0x7b37('0x1f')](_0x43f3e9['query'][_0x7b37('0x1f')]);_0x5672bf['where']=qs[_0x7b37('0x21')](_[_0x7b37('0x20')](_0x43f3e9[_0x7b37('0x17')],_0x7edf38[_0x7b37('0x21')]));if(_0x43f3e9[_0x7b37('0x17')][_0x7b37('0x22')]){_0x5672bf[_0x7b37('0x23')]=_[_0x7b37('0x24')](_0x5672bf[_0x7b37('0x23')],{'$or':_[_0x7b37('0x12')](_0x5672bf[_0x7b37('0x1b')],function(_0x55f959){var _0x27d474={};_0x27d474[_0x55f959]={'$like':'%'+_0x43f3e9[_0x7b37('0x17')][_0x7b37('0x22')]+'%'};return _0x27d474;})});}_0x5672bf=_[_0x7b37('0x24')]({},_0x5672bf,_0x43f3e9['options']);return _0x1d27c1[_0x7b37('0x32')](_0x5672bf);}})[_0x7b37('0xc')](function(_0x4e6928){if(_0x4e6928){_0x50b1a1=_0x4e6928[_0x7b37('0x1c')];if(!_0x43f3e9[_0x7b37('0x17')]['hasOwnProperty'](_0x7b37('0x1e'))){_0x5672bf[_0x7b37('0x9')]=qs[_0x7b37('0x9')](_0x43f3e9[_0x7b37('0x17')][_0x7b37('0x9')]);_0x5672bf[_0x7b37('0x6')]=qs[_0x7b37('0x6')](_0x43f3e9[_0x7b37('0x17')][_0x7b37('0x6')]);}return _0x1d27c1[_0x7b37('0x32')](_0x5672bf);}})[_0x7b37('0xc')](function(_0x16c780){if(_0x16c780){return _0x16c780?{'count':_0x50b1a1,'rows':_0x16c780}:null;}})[_0x7b37('0xc')](respondWithResult(_0x43ce33,null))[_0x7b37('0x29')](handleError(_0x43ce33,null));};exports[_0x7b37('0x36')]=function(_0x25dc42,_0x382ae3){if(_0x25dc42[_0x7b37('0x30')]['id']){delete _0x25dc42[_0x7b37('0x30')]['id'];}return db['Dynamics365Account'][_0x7b37('0x33')]({'where':{'id':_0x25dc42[_0x7b37('0x31')]['id']}})[_0x7b37('0xc')](handleEntityNotFound(_0x382ae3,null))[_0x7b37('0xc')](function(_0x1a624d){if(_0x1a624d){_0x25dc42['body'][_0x7b37('0x37')]=_0x1a624d['id'];_0x25dc42[_0x7b37('0x30')][_0x7b37('0x38')]=integrations[_0x7b37('0x39')](_0x25dc42['body']['channel'],_0x25dc42[_0x7b37('0x30')][_0x7b37('0x15')]);_0x25dc42[_0x7b37('0x30')]['Descriptions']=integrations[_0x7b37('0x3a')](_0x25dc42[_0x7b37('0x30')][_0x7b37('0x3b')],_0x25dc42[_0x7b37('0x30')][_0x7b37('0x15')]);return db[_0x7b37('0x34')]['create'](_0x25dc42[_0x7b37('0x30')],{'include':[{'model':db[_0x7b37('0x3c')],'as':_0x7b37('0x38')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x7b37('0xc')](respondWithResult(_0x382ae3,null))['catch'](handleError(_0x382ae3,null));};function sanitizeRemoteUri(_0x22ba5a){var _0x4c0877=_0x22ba5a['slice'](-0x1);if(_0x4c0877==='/')return _0x22ba5a[_0x7b37('0x3d')](0x0,_0x22ba5a['lastIndexOf'](_0x4c0877));return _0x22ba5a;}function getWebApiUrl(_0x101513){return util[_0x7b37('0x3e')](_0x7b37('0x3f'),_0x101513);}exports[_0x7b37('0x40')]=function(_0x2cd809,_0x25caf3){var _0x580e84=_0x2cd809[_0x7b37('0x17')][_0x7b37('0x41')];var _0x337cfa=_0x580e84===_0x7b37('0x42')?_0x7b37('0x43'):'PhoneCall';var _0x3dd61f='';var _0x48fe2c='';var _0x3ad9d1='';var _0x2be1d0='';var _0x5ed148='';var _0x59ab77='';var _0x2b5d4f='';var _0x49723d='';var _0x4f5f11=[_0x7b37('0x44'),_0x7b37('0x45'),_0x7b37('0x46'),_0x7b37('0x47'),_0x7b37('0x48'),_0x7b37('0x49'),_0x7b37('0x4a'),_0x7b37('0x4b'),'directioncode',_0x7b37('0x4c')];var _0x5ea3b5=['accountidname',_0x7b37('0x4d'),'actualserviceunits',_0x7b37('0x4e'),_0x7b37('0x4f'),_0x7b37('0x50'),_0x7b37('0x51'),_0x7b37('0x52'),_0x7b37('0x53'),'createdbyexternalpartyyominame',_0x7b37('0x54'),_0x7b37('0x55'),_0x7b37('0x56'),_0x7b37('0x57'),_0x7b37('0x58'),_0x7b37('0x59'),_0x7b37('0x5a'),'customeridyominame',_0x7b37('0x5b'),'entitlementidname',_0x7b37('0x5c'),'entityimage_url',_0x7b37('0x5d'),'exchangerate','firstresponsebykpiidname',_0x7b37('0x5e'),_0x7b37('0x5f'),_0x7b37('0x60'),_0x7b37('0x61'),_0x7b37('0x62'),_0x7b37('0x63'),'modifiedbyexternalpartyname',_0x7b37('0x64'),_0x7b37('0x65'),_0x7b37('0x66'),_0x7b37('0x67'),'modifiedonbehalfbyname',_0x7b37('0x68'),_0x7b37('0x69'),_0x7b37('0x6a'),'numberofchildincidents',_0x7b37('0x6b'),_0x7b37('0x6c'),_0x7b37('0x6d'),_0x7b37('0x6e'),'owneridyominame',_0x7b37('0x6f'),_0x7b37('0x70'),_0x7b37('0x71'),_0x7b37('0x72'),'productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname',_0x7b37('0x73'),_0x7b37('0x74'),_0x7b37('0x75'),_0x7b37('0x76'),_0x7b37('0x77'),'statecode',_0x7b37('0x78'),_0x7b37('0x79'),'ticketnumber',_0x7b37('0x7a'),_0x7b37('0x7b'),_0x7b37('0x7c'),_0x7b37('0x7d'),_0x7b37('0x7e')];var _0x306534=_0x4f5f11['concat'](_0x5ea3b5);return db[_0x7b37('0x25')]['findOne']({'where':{'id':_0x2cd809[_0x7b37('0x31')]['id']},'attributes':['id',_0x7b37('0x7f'),'password','remoteUri',_0x7b37('0x80'),'clientId',_0x7b37('0x81'),_0x7b37('0x82')],'include':[{'model':db[_0x7b37('0x83')],'as':_0x7b37('0x83'),'attributes':['id',_0x7b37('0x84'),_0x7b37('0x85')]}]})[_0x7b37('0xc')](handleEntityNotFound(_0x25caf3,null))[_0x7b37('0xc')](function(_0x8907ea){if(_0x8907ea){if(_0x8907ea[_0x7b37('0x82')]){_0x8907ea['access_token']=_0x8907ea[_0x7b37('0x83')][_0x7b37('0x84')];_0x49723d=sanitizeRemoteUri(_0x8907ea[_0x7b37('0x83')][_0x7b37('0x85')]);_0x2b5d4f=getWebApiUrl(_0x49723d);return _0x8907ea;}_0x49723d=sanitizeRemoteUri(_0x8907ea['remoteUri']);_0x2b5d4f=getWebApiUrl(_0x49723d);var _0x1b9500={'method':_0x7b37('0x86'),'uri':'https://login.microsoftonline.com/'+_0x8907ea['tenantId']+_0x7b37('0x87'),'form':{'client_id':_0x8907ea['clientId'],'resource':_0x49723d,'username':_0x8907ea[_0x7b37('0x7f')],'password':_0x8907ea[_0x7b37('0x88')],'grant_type':'password','client_secret':_0x8907ea['clientSecret']},'json':!![]};return rp(_0x1b9500);}})['then'](function(_0x1083b5){_0x59ab77=_0x1083b5['access_token'];var _0xe05f3d={'method':_0x7b37('0x89'),'uri':encodeURI(_0x2b5d4f+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x337cfa+'\x27'),'headers':{'Authorization':_0x7b37('0x8a')+_0x59ab77,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xe05f3d);})[_0x7b37('0xc')](function(_0x4a1583){var _0xd8664e=_0x4a1583['value'][0x0];var _0x3cdbe1=_0xd8664e['MetadataId'];var _0x253e52={'method':_0x7b37('0x89'),'uri':_0x2b5d4f+'EntityDefinitions('+_0x3cdbe1+_0x7b37('0x8b'),'headers':{'Authorization':_0x7b37('0x8a')+_0x59ab77,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x253e52);})['then'](function(_0x16bf8c){_0x3dd61f=_0x16bf8c;_0x48fe2c=_0x3dd61f[_0x7b37('0x8c')];_0x48fe2c=_[_0x7b37('0x8d')](_0x48fe2c,function(_0x5da653){return!_0x306534[_0x7b37('0x8e')](_0x5da653['LogicalName']);});var _0x3cc825=[];var _0x4534a8=[];_0x48fe2c[_0x7b37('0x8f')](function(_0x287529){if(_0x287529[_0x7b37('0x90')]){var _0x3d55b2=_0x287529[_0x7b37('0x90')][_0x7b37('0x3d')](_0x287529[_0x7b37('0x90')]['lastIndexOf']('.')+0x1);if(_0x3d55b2===_0x7b37('0x91')){_0x3cc825['push'](getSelectList(_0x2b5d4f,_0x580e84,_0x4534a8,_0x3dd61f['MetadataId'],_0x287529[_0x7b37('0x92')],_0x59ab77));}}});return Promise['all'](_0x3cc825);})[_0x7b37('0xc')](function(_0x194100){_0x3ad9d1=_0x194100[0x0];var _0x89ce54=[];var _0x4ee5de=[];_0x48fe2c[_0x7b37('0x8f')](function(_0x479377){if(!_[_0x7b37('0x93')](_0x479377[_0x7b37('0x90')])){var _0x2a8788=_0x479377[_0x7b37('0x90')][_0x7b37('0x3d')](_0x479377[_0x7b37('0x90')]['lastIndexOf']('.')+0x1);if(_0x2a8788===_0x7b37('0x94')){_0x89ce54['push'](getBooleanList(_0x2b5d4f,_0x580e84,_0x4ee5de,_0x3dd61f[_0x7b37('0x92')],_0x479377[_0x7b37('0x92')],_0x59ab77));}}});return Promise[_0x7b37('0x95')](_0x89ce54);})[_0x7b37('0xc')](function(_0x1f10e7){_0x2be1d0=_0x1f10e7[0x0];var _0x449df5=[];var _0x58bb25=[];_0x48fe2c[_0x7b37('0x8f')](function(_0x3a82b7){if(_0x3a82b7[_0x7b37('0x90')]){var _0x3a71d4=_0x3a82b7['@odata.type'][_0x7b37('0x3d')](_0x3a82b7[_0x7b37('0x90')][_0x7b37('0x96')]('.')+0x1);if(_0x3a71d4===_0x7b37('0x97')||_0x3a71d4===_0x7b37('0x98')||_0x3a71d4===_0x7b37('0x99')||_0x3a71d4===_0x7b37('0x9a')||_0x3a71d4==='MemoAttributeMetadata'||_0x3a71d4===_0x7b37('0x9b')||_0x3a71d4===_0x7b37('0x9c')||_0x3a71d4===_0x7b37('0x9d')||_0x3a71d4===_0x7b37('0x9e')||_0x3a71d4===_0x7b37('0x9f')){_0x449df5[_0x7b37('0xa0')](getInputList(_0x2b5d4f,_0x580e84,_0x3a71d4,_0x58bb25,_0x3dd61f[_0x7b37('0x92')],_0x3a82b7[_0x7b37('0x92')],_0x59ab77));}}});return Promise['all'](_0x449df5);})[_0x7b37('0xc')](function(_0x1de23d){_0x5ed148=_0x1de23d[0x0];var _0x552dec=_0x3ad9d1[_0x7b37('0xa1')](_0x2be1d0)[_0x7b37('0xa1')](_0x5ed148);var _0x306b77={'count':_0x552dec[_0x7b37('0x1c')],'rows':_0x552dec};return _0x306b77;})['then'](respondWithResult(_0x25caf3,null))[_0x7b37('0x29')](function(_0x4ffb6e){var _0x3f4318=_0x2cd809[_0x7b37('0x17')][_0x7b37('0xa2')]?0x1f4:_0x4ffb6e[_0x7b37('0xa3')]||0x1f4;logger[_0x7b37('0xd')](_0x4ffb6e[_0x7b37('0xe')]);delete _0x4ffb6e[_0x7b37('0xf')];if(_0x3f4318===0x191){_0x3f4318=0x190;}_0x25caf3[_0x7b37('0x4')](_0x3f4318)[_0x7b37('0x10')](_0x2cd809['query'][_0x7b37('0xa2')]?{'message':_0x7b37('0xa4'),'statusCode':_0x4ffb6e['statusCode']}:_0x4ffb6e);});};function getSelectList(_0x576159,_0x3c7143,_0x5d0745,_0xbc67e,_0x32c0d8,_0x1d63bb){var _0x2607d1={'method':_0x7b37('0x89'),'uri':_0x576159+'EntityDefinitions('+_0xbc67e+_0x7b37('0xa5')+_0x32c0d8+_0x7b37('0xa6')+_0x7b37('0xa7'),'headers':{'Authorization':'Bearer\x20'+_0x1d63bb,'If-None-Match':null,'OData-Version':_0x7b37('0xa8')},'json':!![]};return rp(_0x2607d1)[_0x7b37('0xc')](function(_0x95c8b4){var _0x55dea1=[];var _0x3341b1=_0x95c8b4[_0x7b37('0xa9')][_0x7b37('0xaa')];_0x3341b1[_0x7b37('0x8f')](function(_0x3e6b7e){_0x55dea1['push']({'name':_0x3e6b7e[_0x7b37('0xab')]['UserLocalizedLabel'][_0x7b37('0xab')],'value':String(_0x3e6b7e[_0x7b37('0xac')])});});var _0x34ac4b={'id':_0x3c7143+'_'+_0x95c8b4[_0x7b37('0xad')],'name':_0x95c8b4['DisplayName']['UserLocalizedLabel'][_0x7b37('0xab')],'custom':![],'options':_0x55dea1};_0x5d0745['push'](_0x34ac4b);return _0x5d0745;});}function getBooleanList(_0x24237e,_0x1d96d8,_0x174047,_0x1d8a4c,_0xe4e737,_0x5dc644){var _0x599e9e={'method':_0x7b37('0x89'),'uri':_0x24237e+_0x7b37('0xae')+_0x1d8a4c+_0x7b37('0xa5')+_0xe4e737+_0x7b37('0xaf'),'headers':{'Authorization':_0x7b37('0x8a')+_0x5dc644,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x599e9e)[_0x7b37('0xc')](function(_0x268a35){var _0x11a39f=[];_0x11a39f[_0x7b37('0xa0')]({'name':_0x268a35[_0x7b37('0xa9')][_0x7b37('0xb0')][_0x7b37('0xab')]['UserLocalizedLabel'][_0x7b37('0xab')],'value':_0x7b37('0xb1')},{'name':_0x268a35[_0x7b37('0xa9')]['FalseOption'][_0x7b37('0xab')][_0x7b37('0xb2')]['Label'],'value':_0x7b37('0xb3')});var _0x183f4e={'id':_0x1d96d8+'_'+_0x268a35['LogicalName'],'name':_0x268a35['DisplayName'][_0x7b37('0xb2')]['Label'],'custom':![],'options':_0x11a39f};_0x174047[_0x7b37('0xa0')](_0x183f4e);return _0x174047;});}function getInputList(_0x3abf8c,_0xc826d8,_0x184301,_0x5ffac6,_0x398b02,_0x2b8005,_0x4e6a9b){var _0x33b6ff={'method':_0x7b37('0x89'),'uri':_0x3abf8c+_0x7b37('0xae')+_0x398b02+')/Attributes('+_0x2b8005+_0x7b37('0xb4')+_0x184301+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x7b37('0x8a')+_0x4e6a9b,'If-None-Match':null,'OData-Version':_0x7b37('0xa8')},'json':!![]};return rp(_0x33b6ff)[_0x7b37('0xc')](function(_0x51a8f5){var _0x5ba77e={'id':_0xc826d8+'_'+_0x51a8f5[_0x7b37('0xad')],'name':_0x51a8f5[_0x7b37('0xb5')][_0x7b37('0xb2')]?_0x51a8f5[_0x7b37('0xb5')][_0x7b37('0xb2')][_0x7b37('0xab')]:_0x51a8f5[_0x7b37('0xad')],'custom':![],'options':[]};_0x5ffac6[_0x7b37('0xa0')](_0x5ba77e);return _0x5ffac6;});}
\ No newline at end of file
+var _0x720e=['directioncode','phonecall_activity_parties','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','remoteUri','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','password','clientSecret','GET','Bearer\x20','4.0','MetadataId','EntityDefinitions(','remove','LogicalName','forEach','@odata.type','push','all','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','UserLocalizedLabel','true','FalseOption','false','?$select=DisplayName,LogicalName','DisplayName','request-promise','util','lodash','api','../../components/integrations/configuration','status','json','undefined','count','offset','limit','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Dynamics365Account','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','title','description','ownerid','caseorigincode','regardingobjectid'];(function(_0x11210e,_0x56de6f){var _0x3d4cef=function(_0x576878){while(--_0x576878){_0x11210e['push'](_0x11210e['shift']());}};_0x3d4cef(++_0x56de6f);}(_0x720e,0x1cb));var _0xe720=function(_0x22ee0f,_0x22e6d2){_0x22ee0f=_0x22ee0f-0x0;var _0x204696=_0x720e[_0x22ee0f];return _0x204696;};'use strict';var rp=require(_0xe720('0x0'));var util=require(_0xe720('0x1'));var _=require(_0xe720('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xe720('0x3'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe720('0x4'));function respondWithResult(_0x22eb1f,_0x42ebdc){_0x42ebdc=_0x42ebdc||0xc8;return function(_0x403cce){if(_0x403cce){return _0x22eb1f[_0xe720('0x5')](_0x42ebdc)[_0xe720('0x6')](_0x403cce);}};}function respondWithFilteredResult(_0x3952f0,_0x4ffe24){return function(_0x3e38ca){if(_0x3e38ca){var _0x19642d=typeof _0x4ffe24['offset']==='undefined'&&typeof _0x4ffe24['limit']===_0xe720('0x7');var _0x2e08e7=_0x3e38ca[_0xe720('0x8')];var _0x5b0926=_0x19642d?0x0:_0x4ffe24[_0xe720('0x9')];var _0x1d8689=_0x19642d?_0x3e38ca[_0xe720('0x8')]:_0x4ffe24[_0xe720('0x9')]+_0x4ffe24[_0xe720('0xa')];var _0x12f608;if(_0x1d8689>=_0x2e08e7){_0x1d8689=_0x2e08e7;_0x12f608=0xc8;}else{_0x12f608=0xce;}_0x3952f0['status'](_0x12f608);return _0x3952f0['set'](_0xe720('0xb'),_0x5b0926+'-'+_0x1d8689+'/'+_0x2e08e7)[_0xe720('0x6')](_0x3e38ca);}return null;};}function saveUpdates(_0x1a82cc){return function(_0xac0320){if(_0xac0320){return _0xac0320[_0xe720('0xc')](_0x1a82cc)[_0xe720('0xd')](function(_0xfe8967){return _0xfe8967;});}return null;};}function removeEntity(_0x19a910){return function(_0x3b25e5){if(_0x3b25e5){return _0x3b25e5['destroy']()['then'](function(){_0x19a910[_0xe720('0x5')](0xcc)[_0xe720('0xe')]();});}};}function handleEntityNotFound(_0x49a04a){return function(_0x312c36){if(!_0x312c36){_0x49a04a[_0xe720('0xf')](0x194);}return _0x312c36;};}function handleError(_0x539231,_0x2a17bc){_0x2a17bc=_0x2a17bc||0x1f4;return function(_0x5ac1e2){logger[_0xe720('0x10')](_0x5ac1e2[_0xe720('0x11')]);if(_0x5ac1e2['name']){delete _0x5ac1e2[_0xe720('0x12')];}_0x539231['status'](_0x2a17bc)[_0xe720('0x13')](_0x5ac1e2);};}exports[_0xe720('0x14')]=function(_0x37928b,_0x509956){var _0x1fb8db={},_0x5ef9a6={},_0x467b50={'count':0x0,'rows':[]};var _0x31166b=_[_0xe720('0x15')](db['Dynamics365Account']['rawAttributes'],function(_0x1e2196){return{'name':_0x1e2196['fieldName'],'type':_0x1e2196[_0xe720('0x16')][_0xe720('0x17')]};});_0x5ef9a6[_0xe720('0x18')]=_[_0xe720('0x15')](_0x31166b,_0xe720('0x12'));_0x5ef9a6[_0xe720('0x19')]=_['keys'](_0x37928b[_0xe720('0x19')]);_0x5ef9a6[_0xe720('0x1a')]=_[_0xe720('0x1b')](_0x5ef9a6['model'],_0x5ef9a6[_0xe720('0x19')]);_0x1fb8db[_0xe720('0x1c')]=_[_0xe720('0x1b')](_0x5ef9a6[_0xe720('0x18')],qs[_0xe720('0x1d')](_0x37928b[_0xe720('0x19')][_0xe720('0x1d')]));_0x1fb8db[_0xe720('0x1c')]=_0x1fb8db[_0xe720('0x1c')][_0xe720('0x1e')]?_0x1fb8db[_0xe720('0x1c')]:_0x5ef9a6[_0xe720('0x18')];if(!_0x37928b['query'][_0xe720('0x1f')](_0xe720('0x20'))){_0x1fb8db[_0xe720('0xa')]=qs[_0xe720('0xa')](_0x37928b['query'][_0xe720('0xa')]);_0x1fb8db[_0xe720('0x9')]=qs[_0xe720('0x9')](_0x37928b[_0xe720('0x19')][_0xe720('0x9')]);}_0x1fb8db[_0xe720('0x21')]=qs[_0xe720('0x22')](_0x37928b[_0xe720('0x19')]['sort']);_0x1fb8db[_0xe720('0x23')]=qs[_0xe720('0x1a')](_['pick'](_0x37928b['query'],_0x5ef9a6[_0xe720('0x1a')]),_0x31166b);if(_0x37928b[_0xe720('0x19')][_0xe720('0x24')]){_0x1fb8db['where']=_['merge'](_0x1fb8db[_0xe720('0x23')],{'$or':_[_0xe720('0x15')](_0x31166b,function(_0x2eb0db){if(_0x2eb0db[_0xe720('0x16')]!=='VIRTUAL'){var _0x40efd7={};_0x40efd7[_0x2eb0db[_0xe720('0x12')]]={'$like':'%'+_0x37928b[_0xe720('0x19')][_0xe720('0x24')]+'%'};return _0x40efd7;}})});}_0x1fb8db=_[_0xe720('0x25')]({},_0x1fb8db,_0x37928b[_0xe720('0x26')]);var _0x389f7a={'where':_0x1fb8db[_0xe720('0x23')]};return db[_0xe720('0x27')]['count'](_0x389f7a)['then'](function(_0x43e06a){_0x467b50['count']=_0x43e06a;if(_0x37928b[_0xe720('0x19')][_0xe720('0x28')]){_0x1fb8db[_0xe720('0x29')]=[{'all':!![]}];}return db[_0xe720('0x27')][_0xe720('0x2a')](_0x1fb8db);})['then'](function(_0x1b212f){_0x467b50['rows']=_0x1b212f;return _0x467b50;})[_0xe720('0xd')](respondWithFilteredResult(_0x509956,_0x1fb8db))[_0xe720('0x2b')](handleError(_0x509956,null));};exports[_0xe720('0x2c')]=function(_0x58eaab,_0x54e89e){var _0x121708={'raw':![],'where':{'id':_0x58eaab[_0xe720('0x2d')]['id']}},_0x1394fb={};_0x1394fb[_0xe720('0x18')]=_[_0xe720('0x2e')](db['Dynamics365Account'][_0xe720('0x2f')]);_0x1394fb['query']=_['keys'](_0x58eaab[_0xe720('0x19')]);_0x1394fb[_0xe720('0x1a')]=_['intersection'](_0x1394fb[_0xe720('0x18')],_0x1394fb[_0xe720('0x19')]);_0x121708[_0xe720('0x1c')]=_[_0xe720('0x1b')](_0x1394fb[_0xe720('0x18')],qs['fields'](_0x58eaab[_0xe720('0x19')][_0xe720('0x1d')]));_0x121708[_0xe720('0x1c')]=_0x121708[_0xe720('0x1c')][_0xe720('0x1e')]?_0x121708[_0xe720('0x1c')]:_0x1394fb[_0xe720('0x18')];if(_0x58eaab[_0xe720('0x19')][_0xe720('0x28')]){_0x121708[_0xe720('0x29')]=[{'all':!![]}];}_0x121708=_[_0xe720('0x25')]({},_0x121708,_0x58eaab[_0xe720('0x26')]);return db[_0xe720('0x27')][_0xe720('0x30')](_0x121708)[_0xe720('0xd')](handleEntityNotFound(_0x54e89e,null))[_0xe720('0xd')](respondWithResult(_0x54e89e,null))['catch'](handleError(_0x54e89e,null));};exports[_0xe720('0x31')]=function(_0x9b9279,_0x1877fe){return db[_0xe720('0x27')][_0xe720('0x31')](_0x9b9279[_0xe720('0x32')],{})[_0xe720('0xd')](respondWithResult(_0x1877fe,0xc9))[_0xe720('0x2b')](handleError(_0x1877fe,null));};exports[_0xe720('0xc')]=function(_0x3d821d,_0x43cbd8){if(_0x3d821d['body']['id']){delete _0x3d821d['body']['id'];}return db[_0xe720('0x27')][_0xe720('0x30')]({'where':{'id':_0x3d821d[_0xe720('0x2d')]['id']}})['then'](handleEntityNotFound(_0x43cbd8,null))[_0xe720('0xd')](saveUpdates(_0x3d821d['body'],null))[_0xe720('0xd')](respondWithResult(_0x43cbd8,null))[_0xe720('0x2b')](handleError(_0x43cbd8,null));};exports['destroy']=function(_0x1a5fdd,_0x57fd09){return db['Dynamics365Account'][_0xe720('0x30')]({'where':{'id':_0x1a5fdd[_0xe720('0x2d')]['id']}})[_0xe720('0xd')](handleEntityNotFound(_0x57fd09,null))[_0xe720('0xd')](removeEntity(_0x57fd09,null))[_0xe720('0x2b')](handleError(_0x57fd09,null));};exports['getConfigurations']=function(_0x42fe67,_0x5014d3){var _0x14f66d={};var _0x3bfd8c={};var _0x1c6103;var _0x36092c;return db['Dynamics365Account'][_0xe720('0x33')]({'where':{'id':_0x42fe67[_0xe720('0x2d')]['id']}})[_0xe720('0xd')](handleEntityNotFound(_0x5014d3,null))[_0xe720('0xd')](function(_0x41f93c){if(_0x41f93c){_0x1c6103=_0x41f93c;_0x3bfd8c[_0xe720('0x18')]=_['keys'](db[_0xe720('0x34')][_0xe720('0x2f')]);_0x3bfd8c['query']=_[_0xe720('0x2e')](_0x42fe67[_0xe720('0x19')]);_0x3bfd8c[_0xe720('0x1a')]=_['intersection'](_0x3bfd8c[_0xe720('0x18')],_0x3bfd8c[_0xe720('0x19')]);_0x14f66d[_0xe720('0x1c')]=_[_0xe720('0x1b')](_0x3bfd8c[_0xe720('0x18')],qs['fields'](_0x42fe67[_0xe720('0x19')]['fields']));_0x14f66d[_0xe720('0x1c')]=_0x14f66d[_0xe720('0x1c')]['length']?_0x14f66d[_0xe720('0x1c')]:_0x3bfd8c[_0xe720('0x18')];_0x14f66d[_0xe720('0x21')]=qs[_0xe720('0x22')](_0x42fe67[_0xe720('0x19')][_0xe720('0x22')]);_0x14f66d['where']=qs[_0xe720('0x1a')](_['pick'](_0x42fe67[_0xe720('0x19')],_0x3bfd8c['filters']));if(_0x42fe67[_0xe720('0x19')][_0xe720('0x24')]){_0x14f66d[_0xe720('0x23')]=_['merge'](_0x14f66d['where'],{'$or':_[_0xe720('0x15')](_0x14f66d[_0xe720('0x1c')],function(_0xea19e4){var _0x144f7d={};_0x144f7d[_0xea19e4]={'$like':'%'+_0x42fe67[_0xe720('0x19')][_0xe720('0x24')]+'%'};return _0x144f7d;})});}_0x14f66d=_[_0xe720('0x25')]({},_0x14f66d,_0x42fe67[_0xe720('0x26')]);return _0x1c6103[_0xe720('0x35')](_0x14f66d);}})['then'](function(_0x2acfb7){if(_0x2acfb7){_0x36092c=_0x2acfb7[_0xe720('0x1e')];if(!_0x42fe67['query'][_0xe720('0x1f')](_0xe720('0x20'))){_0x14f66d[_0xe720('0xa')]=qs[_0xe720('0xa')](_0x42fe67[_0xe720('0x19')]['limit']);_0x14f66d[_0xe720('0x9')]=qs['offset'](_0x42fe67[_0xe720('0x19')][_0xe720('0x9')]);}return _0x1c6103['getConfigurations'](_0x14f66d);}})[_0xe720('0xd')](function(_0x35c959){if(_0x35c959){return _0x35c959?{'count':_0x36092c,'rows':_0x35c959}:null;}})[_0xe720('0xd')](respondWithResult(_0x5014d3,null))[_0xe720('0x2b')](handleError(_0x5014d3,null));};exports[_0xe720('0x36')]=function(_0x3520a6,_0xb970fe){if(_0x3520a6['body']['id']){delete _0x3520a6[_0xe720('0x32')]['id'];}return db[_0xe720('0x27')][_0xe720('0x33')]({'where':{'id':_0x3520a6['params']['id']}})['then'](handleEntityNotFound(_0xb970fe,null))[_0xe720('0xd')](function(_0x103b5f){if(_0x103b5f){_0x3520a6[_0xe720('0x32')][_0xe720('0x37')]=_0x103b5f['id'];_0x3520a6[_0xe720('0x32')][_0xe720('0x38')]=integrations[_0xe720('0x39')](_0x3520a6[_0xe720('0x32')][_0xe720('0x3a')],_0x3520a6[_0xe720('0x32')][_0xe720('0x16')]);_0x3520a6['body'][_0xe720('0x3b')]=integrations[_0xe720('0x3c')](_0x3520a6[_0xe720('0x32')][_0xe720('0x3a')],_0x3520a6[_0xe720('0x32')][_0xe720('0x16')]);return db['Dynamics365Configuration'][_0xe720('0x31')](_0x3520a6['body'],{'include':[{'model':db[_0xe720('0x3d')],'as':_0xe720('0x38')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xe720('0xd')](respondWithResult(_0xb970fe,null))[_0xe720('0x2b')](handleError(_0xb970fe,null));};function sanitizeRemoteUri(_0x2d6e51){var _0x4075bd=_0x2d6e51[_0xe720('0x3e')](-0x1);if(_0x4075bd==='/')return _0x2d6e51[_0xe720('0x3f')](0x0,_0x2d6e51['lastIndexOf'](_0x4075bd));return _0x2d6e51;}function getWebApiUrl(_0xd3ce53){return util[_0xe720('0x40')](_0xe720('0x41'),_0xd3ce53);}exports[_0xe720('0x42')]=function(_0x300c73,_0x17a6c2){var _0x16af12=_0x300c73[_0xe720('0x19')][_0xe720('0x43')];var _0xdce1cf=_0x16af12==='incident'?_0xe720('0x44'):_0xe720('0x45');var _0x2cc328='';var _0x1099c0='';var _0x393355='';var _0x2b4871='';var _0x3f5b37='';var _0x52a8cc='';var _0x2d9b70='';var _0x4da5a0='';var _0x19e5ee=[_0xe720('0x46'),_0xe720('0x47'),'customerid',_0xe720('0x48'),_0xe720('0x49'),'subject','phonenumber',_0xe720('0x4a'),_0xe720('0x4b'),_0xe720('0x4c')];var _0x5d352a=['accountidname','accountidyominame',_0xe720('0x4d'),_0xe720('0x4e'),'contactidname',_0xe720('0x4f'),'contractdetailidname',_0xe720('0x50'),'createdbyexternalpartyname',_0xe720('0x51'),_0xe720('0x52'),_0xe720('0x53'),_0xe720('0x54'),_0xe720('0x55'),_0xe720('0x56'),'customeridname','customeridtype',_0xe720('0x57'),_0xe720('0x58'),_0xe720('0x59'),_0xe720('0x5a'),'entityimage_url','escalatedon',_0xe720('0x5b'),_0xe720('0x5c'),'followupby','importsequencenumber',_0xe720('0x5d'),_0xe720('0x5e'),_0xe720('0x5f'),_0xe720('0x60'),_0xe720('0x61'),_0xe720('0x62'),'modifiedbyname',_0xe720('0x63'),_0xe720('0x64'),'modifiedonbehalfbyname',_0xe720('0x65'),'msdyn_incidenttypename',_0xe720('0x66'),_0xe720('0x67'),_0xe720('0x68'),_0xe720('0x69'),'owneridname',_0xe720('0x6a'),'owneridyominame',_0xe720('0x6b'),_0xe720('0x6c'),'primarycontactidyominame',_0xe720('0x6d'),_0xe720('0x6e'),_0xe720('0x6f'),_0xe720('0x70'),_0xe720('0x71'),_0xe720('0x72'),'responsiblecontactidname',_0xe720('0x73'),_0xe720('0x74'),_0xe720('0x75'),'slaname',_0xe720('0x76'),_0xe720('0x77'),_0xe720('0x78'),_0xe720('0x79'),_0xe720('0x7a'),_0xe720('0x7b'),_0xe720('0x7c'),_0xe720('0x7d'),_0xe720('0x7e'),_0xe720('0x7f')];var _0x20e147=_0x19e5ee['concat'](_0x5d352a);return db[_0xe720('0x27')][_0xe720('0x33')]({'where':{'id':_0x300c73[_0xe720('0x2d')]['id']},'attributes':['id',_0xe720('0x80'),'password',_0xe720('0x81'),'tenantId','clientId','clientSecret',_0xe720('0x82')],'include':[{'model':db[_0xe720('0x83')],'as':_0xe720('0x83'),'attributes':['id',_0xe720('0x84'),_0xe720('0x85')]}]})[_0xe720('0xd')](handleEntityNotFound(_0x17a6c2,null))[_0xe720('0xd')](function(_0x1ff714){if(_0x1ff714){if(_0x1ff714['modernAuthentication']){_0x1ff714[_0xe720('0x86')]=_0x1ff714[_0xe720('0x83')][_0xe720('0x84')];_0x4da5a0=sanitizeRemoteUri(_0x1ff714['CloudProvider']['data7']);_0x2d9b70=getWebApiUrl(_0x4da5a0);return _0x1ff714;}_0x4da5a0=sanitizeRemoteUri(_0x1ff714[_0xe720('0x81')]);_0x2d9b70=getWebApiUrl(_0x4da5a0);var _0x7fd527={'method':_0xe720('0x87'),'uri':_0xe720('0x88')+_0x1ff714[_0xe720('0x89')]+_0xe720('0x8a'),'form':{'client_id':_0x1ff714[_0xe720('0x8b')],'resource':_0x4da5a0,'username':_0x1ff714[_0xe720('0x80')],'password':_0x1ff714[_0xe720('0x8c')],'grant_type':_0xe720('0x8c'),'client_secret':_0x1ff714[_0xe720('0x8d')]},'json':!![]};return rp(_0x7fd527);}})[_0xe720('0xd')](function(_0x1bc0e3){_0x52a8cc=_0x1bc0e3['access_token'];var _0x4346ec={'method':_0xe720('0x8e'),'uri':encodeURI(_0x2d9b70+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0xdce1cf+'\x27'),'headers':{'Authorization':_0xe720('0x8f')+_0x52a8cc,'If-None-Match':null,'OData-Version':_0xe720('0x90')},'json':!![]};return rp(_0x4346ec);})['then'](function(_0x2e646e){var _0x5f4a5f=_0x2e646e['value'][0x0];var _0x24310c=_0x5f4a5f[_0xe720('0x91')];var _0x3fea0e={'method':_0xe720('0x8e'),'uri':_0x2d9b70+_0xe720('0x92')+_0x24310c+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xe720('0x8f')+_0x52a8cc,'If-None-Match':null,'OData-Version':_0xe720('0x90')},'json':!![]};return rp(_0x3fea0e);})[_0xe720('0xd')](function(_0x13883a){_0x2cc328=_0x13883a;_0x1099c0=_0x2cc328['Attributes'];_0x1099c0=_[_0xe720('0x93')](_0x1099c0,function(_0x1e5a2f){return!_0x20e147['includes'](_0x1e5a2f[_0xe720('0x94')]);});var _0x2447f6=[];var _0x4adc11=[];_0x1099c0[_0xe720('0x95')](function(_0xc2c510){if(_0xc2c510[_0xe720('0x96')]){var _0x5e1707=_0xc2c510[_0xe720('0x96')][_0xe720('0x3f')](_0xc2c510[_0xe720('0x96')]['lastIndexOf']('.')+0x1);if(_0x5e1707==='PicklistAttributeMetadata'){_0x2447f6[_0xe720('0x97')](getSelectList(_0x2d9b70,_0x16af12,_0x4adc11,_0x2cc328[_0xe720('0x91')],_0xc2c510['MetadataId'],_0x52a8cc));}}});return Promise[_0xe720('0x98')](_0x2447f6);})[_0xe720('0xd')](function(_0x344b17){_0x393355=_0x344b17[0x0];var _0x6f584=[];var _0x396757=[];_0x1099c0['forEach'](function(_0x1e995b){if(!_[_0xe720('0x99')](_0x1e995b[_0xe720('0x96')])){var _0x3cd005=_0x1e995b[_0xe720('0x96')]['substring'](_0x1e995b[_0xe720('0x96')][_0xe720('0x9a')]('.')+0x1);if(_0x3cd005===_0xe720('0x9b')){_0x6f584[_0xe720('0x97')](getBooleanList(_0x2d9b70,_0x16af12,_0x396757,_0x2cc328[_0xe720('0x91')],_0x1e995b['MetadataId'],_0x52a8cc));}}});return Promise['all'](_0x6f584);})[_0xe720('0xd')](function(_0x2cf17e){_0x2b4871=_0x2cf17e[0x0];var _0x3e6639=[];var _0x37ae95=[];_0x1099c0['forEach'](function(_0x2d8d03){if(_0x2d8d03['@odata.type']){var _0x372947=_0x2d8d03[_0xe720('0x96')][_0xe720('0x3f')](_0x2d8d03[_0xe720('0x96')][_0xe720('0x9a')]('.')+0x1);if(_0x372947===_0xe720('0x9c')||_0x372947===_0xe720('0x9d')||_0x372947==='BigIntAttributeMetadata'||_0x372947==='IntegerAttributeMetadata'||_0x372947==='MemoAttributeMetadata'||_0x372947===_0xe720('0x9e')||_0x372947===_0xe720('0x9f')||_0x372947===_0xe720('0xa0')||_0x372947==='StateAttributeMetadata'||_0x372947===_0xe720('0xa1')){_0x3e6639[_0xe720('0x97')](getInputList(_0x2d9b70,_0x16af12,_0x372947,_0x37ae95,_0x2cc328[_0xe720('0x91')],_0x2d8d03[_0xe720('0x91')],_0x52a8cc));}}});return Promise[_0xe720('0x98')](_0x3e6639);})['then'](function(_0x2c9412){_0x3f5b37=_0x2c9412[0x0];var _0x226dcc=_0x393355[_0xe720('0xa2')](_0x2b4871)[_0xe720('0xa2')](_0x3f5b37);var _0x47b456={'count':_0x226dcc[_0xe720('0x1e')],'rows':_0x226dcc};return _0x47b456;})['then'](respondWithResult(_0x17a6c2,null))[_0xe720('0x2b')](function(_0x172485){var _0x59ed89=_0x300c73['query'][_0xe720('0xa3')]?0x1f4:_0x172485['statusCode']||0x1f4;logger['error'](_0x172485[_0xe720('0x11')]);delete _0x172485[_0xe720('0x12')];if(_0x59ed89===0x191){_0x59ed89=0x190;}_0x17a6c2['status'](_0x59ed89)[_0xe720('0x13')](_0x300c73[_0xe720('0x19')]['test']?{'message':_0xe720('0xa4'),'statusCode':_0x172485['statusCode']}:_0x172485);});};function getSelectList(_0x4b6c2a,_0x1ef8c2,_0xb00480,_0x3e965f,_0x5ece3a,_0xf3dd61){var _0x2d10ec={'method':_0xe720('0x8e'),'uri':_0x4b6c2a+'EntityDefinitions('+_0x3e965f+_0xe720('0xa5')+_0x5ece3a+_0xe720('0xa6')+_0xe720('0xa7'),'headers':{'Authorization':'Bearer\x20'+_0xf3dd61,'If-None-Match':null,'OData-Version':_0xe720('0x90')},'json':!![]};return rp(_0x2d10ec)[_0xe720('0xd')](function(_0x29792d){var _0x1bd046=[];var _0x404030=_0x29792d['OptionSet'][_0xe720('0xa8')];_0x404030[_0xe720('0x95')](function(_0x5da73a){_0x1bd046[_0xe720('0x97')]({'name':_0x5da73a[_0xe720('0xa9')]['UserLocalizedLabel'][_0xe720('0xa9')],'value':String(_0x5da73a[_0xe720('0xaa')])});});var _0x18c6e7={'id':_0x1ef8c2+'_'+_0x29792d[_0xe720('0x94')],'name':_0x29792d['DisplayName']['UserLocalizedLabel'][_0xe720('0xa9')],'custom':![],'options':_0x1bd046};_0xb00480[_0xe720('0x97')](_0x18c6e7);return _0xb00480;});}function getBooleanList(_0x3e0694,_0x1d1023,_0x45eb01,_0x45b3e3,_0xb8b013,_0x1b2da1){var _0x2a557a={'method':_0xe720('0x8e'),'uri':_0x3e0694+_0xe720('0x92')+_0x45b3e3+')/Attributes('+_0xb8b013+_0xe720('0xab'),'headers':{'Authorization':_0xe720('0x8f')+_0x1b2da1,'If-None-Match':null,'OData-Version':_0xe720('0x90')},'json':!![]};return rp(_0x2a557a)[_0xe720('0xd')](function(_0x144084){var _0x32401a=[];_0x32401a[_0xe720('0x97')]({'name':_0x144084['OptionSet']['TrueOption'][_0xe720('0xa9')][_0xe720('0xac')][_0xe720('0xa9')],'value':_0xe720('0xad')},{'name':_0x144084['OptionSet'][_0xe720('0xae')]['Label'][_0xe720('0xac')]['Label'],'value':_0xe720('0xaf')});var _0x20a169={'id':_0x1d1023+'_'+_0x144084[_0xe720('0x94')],'name':_0x144084['DisplayName'][_0xe720('0xac')][_0xe720('0xa9')],'custom':![],'options':_0x32401a};_0x45eb01['push'](_0x20a169);return _0x45eb01;});}function getInputList(_0x46423d,_0x372d78,_0x35ea8e,_0x5524d6,_0x50aa65,_0x2c844b,_0x530fd6){var _0xa9b93f={'method':_0xe720('0x8e'),'uri':_0x46423d+_0xe720('0x92')+_0x50aa65+_0xe720('0xa5')+_0x2c844b+')/Microsoft.Dynamics.CRM.'+_0x35ea8e+_0xe720('0xb0'),'headers':{'Authorization':_0xe720('0x8f')+_0x530fd6,'If-None-Match':null,'OData-Version':_0xe720('0x90')},'json':!![]};return rp(_0xa9b93f)[_0xe720('0xd')](function(_0x352524){var _0x544fe0={'id':_0x372d78+'_'+_0x352524[_0xe720('0x94')],'name':_0x352524[_0xe720('0xb1')][_0xe720('0xac')]?_0x352524[_0xe720('0xb1')][_0xe720('0xac')][_0xe720('0xa9')]:_0x352524[_0xe720('0x94')],'custom':![],'options':[]};_0x5524d6[_0xe720('0x97')](_0x544fe0);return _0x5524d6;});}
\ No newline at end of file
index e029dbc..f60e375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x5125cb,_0x5958a9){var _0x255735=function(_0x4b5d3c){while(--_0x4b5d3c){_0x5125cb['push'](_0x5125cb['shift']());}};_0x255735(++_0x5958a9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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(_0x46aed3,_0x43984f){var _0x513935=function(_0x3f5900){while(--_0x3f5900){_0x46aed3['push'](_0x46aed3['shift']());}};_0x513935(++_0x43984f);}(_0xe706,0xa3));var _0x6e70=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0xe706[_0x4cc280];return _0x16ed24;};'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
index aa72a7e..7d1f544 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x713c=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','limit','include','map','model','attributes','ShowDynamics365Account','where'];(function(_0xe0e617,_0x4de8b2){var _0x4fd220=function(_0x3a75f8){while(--_0x3a75f8){_0xe0e617['push'](_0xe0e617['shift']());}};_0x4fd220(++_0x4de8b2);}(_0x713c,0xd8));var _0xc713=function(_0x51c41e,_0x4dba8e){_0x51c41e=_0x51c41e-0x0;var _0x297604=_0x713c[_0x51c41e];return _0x297604;};'use strict';var _=require(_0xc713('0x0'));var util=require(_0xc713('0x1'));var moment=require(_0xc713('0x2'));var BPromise=require(_0xc713('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc713('0x4'));var db=require(_0xc713('0x5'))['db'];var utils=require(_0xc713('0x6'));var logger=require(_0xc713('0x7'))(_0xc713('0x8'));var config=require('../../config/environment');var jayson=require(_0xc713('0x9'));var client=jayson[_0xc713('0xa')][_0xc713('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5687ec,_0x32cef0,_0x1b9e3e){return new BPromise(function(_0x20d3a7,_0x5cafa5){return client[_0xc713('0xc')](_0x5687ec,_0x1b9e3e)[_0xc713('0xd')](function(_0x2a61f7){logger[_0xc713('0xe')](_0xc713('0xf'),_0x32cef0,'request\x20sent');logger[_0xc713('0x10')](_0xc713('0x11'),_0x32cef0,'request\x20sent',JSON[_0xc713('0x12')](_0x2a61f7));if(_0x2a61f7[_0xc713('0x13')]){if(_0x2a61f7[_0xc713('0x13')][_0xc713('0x14')]===0x1f4){logger['error'](_0xc713('0xf'),_0x32cef0,_0x2a61f7[_0xc713('0x13')][_0xc713('0x15')]);return _0x5cafa5(_0x2a61f7[_0xc713('0x13')][_0xc713('0x15')]);}logger['error'](_0xc713('0xf'),_0x32cef0,_0x2a61f7[_0xc713('0x13')]['message']);return _0x20d3a7(_0x2a61f7[_0xc713('0x13')][_0xc713('0x15')]);}else{logger[_0xc713('0xe')](_0xc713('0xf'),_0x32cef0,_0xc713('0x16'));_0x20d3a7(_0x2a61f7[_0xc713('0x17')][_0xc713('0x15')]);}})[_0xc713('0x18')](function(_0x4350c0){logger[_0xc713('0x13')](_0xc713('0xf'),_0x32cef0,_0x4350c0);_0x5cafa5(_0x4350c0);});});}exports[_0xc713('0x19')]=function(_0x4a9cab){var _0x36eb24=this;return new Promise(function(_0x17c6db,_0x5c9dbc){return db[_0xc713('0x1a')]['findAll']({'raw':_0x4a9cab[_0xc713('0x1b')]?_0x4a9cab[_0xc713('0x1b')][_0xc713('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a9cab[_0xc713('0x1b')]?_0x4a9cab[_0xc713('0x1b')]['where']||null:null,'attributes':_0x4a9cab[_0xc713('0x1b')]?_0x4a9cab['options']['attributes']||null:null,'limit':_0x4a9cab['options']?_0x4a9cab[_0xc713('0x1b')][_0xc713('0x1d')]||null:null,'include':_0x4a9cab['options']?_0x4a9cab[_0xc713('0x1b')][_0xc713('0x1e')]?_[_0xc713('0x1f')](_0x4a9cab[_0xc713('0x1b')][_0xc713('0x1e')],function(_0x537670){return{'model':db[_0x537670[_0xc713('0x20')]],'as':_0x537670['as'],'attributes':_0x537670[_0xc713('0x21')],'include':_0x537670[_0xc713('0x1e')]?_[_0xc713('0x1f')](_0x537670['include'],function(_0x350fa2){return{'model':db[_0x350fa2['model']],'as':_0x350fa2['as'],'attributes':_0x350fa2[_0xc713('0x21')],'include':_0x350fa2['include']?_[_0xc713('0x1f')](_0x350fa2[_0xc713('0x1e')],function(_0x3bc30b){return{'model':db[_0x3bc30b['model']],'as':_0x3bc30b['as'],'attributes':_0x3bc30b[_0xc713('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc713('0xd')](function(_0x4a9db0){logger[_0xc713('0xe')](_0xc713('0x19'),_0x4a9cab);logger[_0xc713('0x10')](_0xc713('0x19'),_0x4a9cab,JSON[_0xc713('0x12')](_0x4a9db0));_0x17c6db(_0x4a9db0);})[_0xc713('0x18')](function(_0x527cd9){logger[_0xc713('0x13')]('GetDynamics365Account',_0x527cd9[_0xc713('0x15')],_0x4a9cab);_0x5c9dbc(_0x36eb24[_0xc713('0x13')](0x1f4,_0x527cd9[_0xc713('0x15')]));});});};exports[_0xc713('0x22')]=function(_0x46d323){var _0x5207fa=this;return new Promise(function(_0x393a29,_0x27a527){return db[_0xc713('0x1a')]['find']({'raw':_0x46d323[_0xc713('0x1b')]?_0x46d323[_0xc713('0x1b')][_0xc713('0x1c')]===undefined?!![]:![]:!![],'where':_0x46d323[_0xc713('0x1b')]?_0x46d323[_0xc713('0x1b')][_0xc713('0x23')]||null:null,'attributes':_0x46d323[_0xc713('0x1b')]?_0x46d323[_0xc713('0x1b')][_0xc713('0x21')]||null:null,'include':_0x46d323['options']?_0x46d323['options'][_0xc713('0x1e')]?_[_0xc713('0x1f')](_0x46d323[_0xc713('0x1b')][_0xc713('0x1e')],function(_0x4b1258){return{'model':db[_0x4b1258[_0xc713('0x20')]],'as':_0x4b1258['as'],'attributes':_0x4b1258[_0xc713('0x21')],'include':_0x4b1258[_0xc713('0x1e')]?_['map'](_0x4b1258[_0xc713('0x1e')],function(_0x16a932){return{'model':db[_0x16a932[_0xc713('0x20')]],'as':_0x16a932['as'],'attributes':_0x16a932[_0xc713('0x21')],'include':_0x16a932['include']?_[_0xc713('0x1f')](_0x16a932[_0xc713('0x1e')],function(_0x4be771){return{'model':db[_0x4be771['model']],'as':_0x4be771['as'],'attributes':_0x4be771[_0xc713('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc713('0xd')](function(_0x2e38b3){logger[_0xc713('0xe')]('ShowDynamics365Account',_0x46d323);logger[_0xc713('0x10')](_0xc713('0x22'),_0x46d323,JSON[_0xc713('0x12')](_0x2e38b3));_0x393a29(_0x2e38b3);})['catch'](function(_0x17e7c7){logger[_0xc713('0x13')](_0xc713('0x22'),_0x17e7c7[_0xc713('0x15')],_0x46d323);_0x27a527(_0x5207fa[_0xc713('0x13')](0x1f4,_0x17e7c7[_0xc713('0x15')]));});});};
\ No newline at end of file
+var _0x36dc=['raw','where','attributes','limit','include','map','model','catch','ShowDynamics365Account','Dynamics365Account','find','stringify','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','GetDynamics365Account','options'];(function(_0x3f9098,_0x46a03f){var _0x1a1851=function(_0x1a5457){while(--_0x1a5457){_0x3f9098['push'](_0x3f9098['shift']());}};_0x1a1851(++_0x46a03f);}(_0x36dc,0x8c));var _0xc36d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x36dc[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xc36d('0x0'));var moment=require(_0xc36d('0x1'));var BPromise=require(_0xc36d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc36d('0x3'));var db=require(_0xc36d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc36d('0x5'));var config=require('../../config/environment');var jayson=require(_0xc36d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52dd48,_0x4d4607,_0x496f15){return new BPromise(function(_0x4d9eca,_0x54cf74){return client[_0xc36d('0x7')](_0x52dd48,_0x496f15)[_0xc36d('0x8')](function(_0x35d73){logger[_0xc36d('0x9')](_0xc36d('0xa'),_0x4d4607,_0xc36d('0xb'));logger[_0xc36d('0xc')](_0xc36d('0xd'),_0x4d4607,_0xc36d('0xb'),JSON['stringify'](_0x35d73));if(_0x35d73[_0xc36d('0xe')]){if(_0x35d73[_0xc36d('0xe')][_0xc36d('0xf')]===0x1f4){logger[_0xc36d('0xe')](_0xc36d('0xa'),_0x4d4607,_0x35d73['error'][_0xc36d('0x10')]);return _0x54cf74(_0x35d73[_0xc36d('0xe')][_0xc36d('0x10')]);}logger[_0xc36d('0xe')](_0xc36d('0xa'),_0x4d4607,_0x35d73[_0xc36d('0xe')][_0xc36d('0x10')]);return _0x4d9eca(_0x35d73[_0xc36d('0xe')]['message']);}else{logger[_0xc36d('0x9')]('Dynamics365Account,\x20%s,\x20%s',_0x4d4607,_0xc36d('0xb'));_0x4d9eca(_0x35d73[_0xc36d('0x11')][_0xc36d('0x10')]);}})['catch'](function(_0x7e0798){logger[_0xc36d('0xe')](_0xc36d('0xa'),_0x4d4607,_0x7e0798);_0x54cf74(_0x7e0798);});});}exports[_0xc36d('0x12')]=function(_0x2e39cd){var _0x4c3ded=this;return new Promise(function(_0x216551,_0x4c812d){return db['Dynamics365Account']['findAll']({'raw':_0x2e39cd['options']?_0x2e39cd[_0xc36d('0x13')][_0xc36d('0x14')]===undefined?!![]:![]:!![],'where':_0x2e39cd[_0xc36d('0x13')]?_0x2e39cd[_0xc36d('0x13')][_0xc36d('0x15')]||null:null,'attributes':_0x2e39cd[_0xc36d('0x13')]?_0x2e39cd['options'][_0xc36d('0x16')]||null:null,'limit':_0x2e39cd[_0xc36d('0x13')]?_0x2e39cd['options'][_0xc36d('0x17')]||null:null,'include':_0x2e39cd[_0xc36d('0x13')]?_0x2e39cd[_0xc36d('0x13')][_0xc36d('0x18')]?_[_0xc36d('0x19')](_0x2e39cd['options'][_0xc36d('0x18')],function(_0x2a2d3b){return{'model':db[_0x2a2d3b[_0xc36d('0x1a')]],'as':_0x2a2d3b['as'],'attributes':_0x2a2d3b['attributes'],'include':_0x2a2d3b[_0xc36d('0x18')]?_['map'](_0x2a2d3b['include'],function(_0x80ac75){return{'model':db[_0x80ac75[_0xc36d('0x1a')]],'as':_0x80ac75['as'],'attributes':_0x80ac75[_0xc36d('0x16')],'include':_0x80ac75['include']?_[_0xc36d('0x19')](_0x80ac75[_0xc36d('0x18')],function(_0x4c6cf2){return{'model':db[_0x4c6cf2[_0xc36d('0x1a')]],'as':_0x4c6cf2['as'],'attributes':_0x4c6cf2['attributes']};}):[]};}):[]};}):[]:[]})[_0xc36d('0x8')](function(_0x4ff60b){logger[_0xc36d('0x9')](_0xc36d('0x12'),_0x2e39cd);logger['debug'](_0xc36d('0x12'),_0x2e39cd,JSON['stringify'](_0x4ff60b));_0x216551(_0x4ff60b);})[_0xc36d('0x1b')](function(_0x3c52f5){logger[_0xc36d('0xe')](_0xc36d('0x12'),_0x3c52f5['message'],_0x2e39cd);_0x4c812d(_0x4c3ded[_0xc36d('0xe')](0x1f4,_0x3c52f5[_0xc36d('0x10')]));});});};exports[_0xc36d('0x1c')]=function(_0x4194f5){var _0x2555aa=this;return new Promise(function(_0x21c091,_0x60405b){return db[_0xc36d('0x1d')][_0xc36d('0x1e')]({'raw':_0x4194f5[_0xc36d('0x13')]?_0x4194f5[_0xc36d('0x13')][_0xc36d('0x14')]===undefined?!![]:![]:!![],'where':_0x4194f5[_0xc36d('0x13')]?_0x4194f5[_0xc36d('0x13')][_0xc36d('0x15')]||null:null,'attributes':_0x4194f5['options']?_0x4194f5[_0xc36d('0x13')][_0xc36d('0x16')]||null:null,'include':_0x4194f5[_0xc36d('0x13')]?_0x4194f5['options']['include']?_['map'](_0x4194f5[_0xc36d('0x13')][_0xc36d('0x18')],function(_0x2c7182){return{'model':db[_0x2c7182['model']],'as':_0x2c7182['as'],'attributes':_0x2c7182[_0xc36d('0x16')],'include':_0x2c7182[_0xc36d('0x18')]?_[_0xc36d('0x19')](_0x2c7182[_0xc36d('0x18')],function(_0x565315){return{'model':db[_0x565315['model']],'as':_0x565315['as'],'attributes':_0x565315[_0xc36d('0x16')],'include':_0x565315[_0xc36d('0x18')]?_[_0xc36d('0x19')](_0x565315['include'],function(_0x167827){return{'model':db[_0x167827[_0xc36d('0x1a')]],'as':_0x167827['as'],'attributes':_0x167827['attributes']};}):[]};}):[]};}):[]:[]})[_0xc36d('0x8')](function(_0x5c3248){logger[_0xc36d('0x9')]('ShowDynamics365Account',_0x4194f5);logger[_0xc36d('0xc')]('ShowDynamics365Account',_0x4194f5,JSON[_0xc36d('0x1f')](_0x5c3248));_0x21c091(_0x5c3248);})[_0xc36d('0x1b')](function(_0x241ac7){logger['error']('ShowDynamics365Account',_0x241ac7[_0xc36d('0x10')],_0x4194f5);_0x60405b(_0x2555aa['error'](0x1f4,_0x241ac7[_0xc36d('0x10')]));});});};
\ No newline at end of file
index 32a6ab4..ec8a05d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x332c=['getFields','/:id/subjects','getSubjects','getDescriptions','post','put','update','delete','/:id','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','/:id/fields'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x332c,0x11b));var _0xc332=function(_0x10083a,_0x1c9c98){_0x10083a=_0x10083a-0x0;var _0x420cff=_0x332c[_0x10083a];return _0x420cff;};'use strict';var multer=require(_0xc332('0x0'));var util=require(_0xc332('0x1'));var path=require(_0xc332('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc332('0x3')]();var fs_extra=require(_0xc332('0x4'));var auth=require(_0xc332('0x5'));var interaction=require(_0xc332('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xc332('0x7')]('/',auth[_0xc332('0x8')](),controller['index']);router[_0xc332('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc332('0x9')]);router[_0xc332('0x7')](_0xc332('0xa'),auth['isAuthenticated'](),controller[_0xc332('0xb')]);router[_0xc332('0x7')](_0xc332('0xc'),auth[_0xc332('0x8')](),controller[_0xc332('0xd')]);router['get']('/:id/descriptions',auth[_0xc332('0x8')](),controller[_0xc332('0xe')]);router[_0xc332('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc332('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc332('0x11')]);router[_0xc332('0x12')](_0xc332('0x13'),auth[_0xc332('0x8')](),controller['destroy']);module[_0xc332('0x14')]=router;
\ No newline at end of file
+var _0x439f=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy'];(function(_0x314305,_0x444a24){var _0x106c80=function(_0x2ffa80){while(--_0x2ffa80){_0x314305['push'](_0x314305['shift']());}};_0x106c80(++_0x444a24);}(_0x439f,0x1c3));var _0xf439=function(_0x466d24,_0x3a3d6c){_0x466d24=_0x466d24-0x0;var _0x535da6=_0x439f[_0x466d24];return _0x535da6;};'use strict';var multer=require(_0xf439('0x0'));var util=require('util');var path=require(_0xf439('0x1'));var timeout=require(_0xf439('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf439('0x3'));var auth=require(_0xf439('0x4'));var interaction=require(_0xf439('0x5'));var config=require(_0xf439('0x6'));var controller=require(_0xf439('0x7'));router[_0xf439('0x8')]('/',auth[_0xf439('0x9')](),controller[_0xf439('0xa')]);router[_0xf439('0x8')](_0xf439('0xb'),auth['isAuthenticated'](),controller[_0xf439('0xc')]);router[_0xf439('0x8')](_0xf439('0xd'),auth[_0xf439('0x9')](),controller[_0xf439('0xe')]);router['get'](_0xf439('0xf'),auth[_0xf439('0x9')](),controller[_0xf439('0x10')]);router['get'](_0xf439('0x11'),auth[_0xf439('0x9')](),controller['getDescriptions']);router[_0xf439('0x12')]('/',auth[_0xf439('0x9')](),controller[_0xf439('0x13')]);router[_0xf439('0x14')](_0xf439('0xb'),auth[_0xf439('0x9')](),controller[_0xf439('0x15')]);router[_0xf439('0x16')](_0xf439('0xb'),auth[_0xf439('0x9')](),controller[_0xf439('0x17')]);module[_0xf439('0x18')]=router;
\ No newline at end of file
index c8e3129..d88d8b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccaa=['STRING','ENUM','phonecall','incident','contact','nothing','sequelize','exports'];(function(_0xafe532,_0x33e803){var _0x5902fb=function(_0x5cff54){while(--_0x5cff54){_0xafe532['push'](_0xafe532['shift']());}};_0x5902fb(++_0x33e803);}(_0xccaa,0x116));var _0xacca=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0xccaa[_0xd02def];return _0x2e8374;};'use strict';var Sequelize=require(_0xacca('0x0'));module[_0xacca('0x1')]={'name':{'type':Sequelize[_0xacca('0x2')]},'description':{'type':Sequelize[_0xacca('0x2')]},'ticketType':{'type':Sequelize[_0xacca('0x3')]('incident',_0xacca('0x4')),'defaultValue':_0xacca('0x5')},'moduleCreate':{'type':Sequelize[_0xacca('0x3')](_0xacca('0x6'),_0xacca('0x7')),'defaultValue':_0xacca('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xacca('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xfd7d=['sequelize','exports','STRING','incident','phonecall','ENUM','contact','nothing'];(function(_0x2269e2,_0x269fdc){var _0x47d64e=function(_0x2cb201){while(--_0x2cb201){_0x2269e2['push'](_0x2269e2['shift']());}};_0x47d64e(++_0x269fdc);}(_0xfd7d,0x160));var _0xdfd7=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0xfd7d[_0x5a6de2];return _0x2c0525;};'use strict';var Sequelize=require(_0xdfd7('0x0'));module[_0xdfd7('0x1')]={'name':{'type':Sequelize[_0xdfd7('0x2')]},'description':{'type':Sequelize[_0xdfd7('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xdfd7('0x3'),_0xdfd7('0x4')),'defaultValue':_0xdfd7('0x3')},'moduleCreate':{'type':Sequelize[_0xdfd7('0x5')](_0xdfd7('0x6'),_0xdfd7('0x7')),'defaultValue':'contact','allowNull':![]}};
\ No newline at end of file
index 57f3b50..8dacb6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e1f=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e1f,0x9f));var _0xf4e1=function(_0x3d4a5c,_0x59cfa9){_0x3d4a5c=_0x3d4a5c-0x0;var _0x47fd9b=_0x4e1f[_0x3d4a5c];return _0x47fd9b;};'use strict';var emlformat=require(_0xf4e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4e1('0x1'));var jsonpatch=require(_0xf4e1('0x2'));var rp=require(_0xf4e1('0x3'));var moment=require(_0xf4e1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf4e1('0x5'));var path=require(_0xf4e1('0x6'));var sox=require(_0xf4e1('0x7'));var csv=require(_0xf4e1('0x8'));var ejs=require(_0xf4e1('0x9'));var fs=require('fs');var fs_extra=require(_0xf4e1('0xa'));var _=require('lodash');var squel=require(_0xf4e1('0xb'));var crypto=require(_0xf4e1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf4e1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf4e1('0xe'));var Papa=require(_0xf4e1('0xf'));var Redis=require(_0xf4e1('0x10'));var authService=require(_0xf4e1('0x11'));var qs=require(_0xf4e1('0x12'));var as=require(_0xf4e1('0x13'));var hardwareService=require(_0xf4e1('0x14'));var logger=require(_0xf4e1('0x15'))(_0xf4e1('0x16'));var utils=require('../../config/utils');var config=require(_0xf4e1('0x17'));var licenseUtil=require(_0xf4e1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b95b5,_0x2c2e46){_0x2c2e46=_0x2c2e46||0xcc;return function(_0x505a33){if(_0x505a33){return _0x2b95b5[_0xf4e1('0x19')](_0x2c2e46);}return _0x2b95b5[_0xf4e1('0x1a')](_0x2c2e46)['end']();};}function respondWithResult(_0x3bcae,_0x425d7c){_0x425d7c=_0x425d7c||0xc8;return function(_0x556bbc){if(_0x556bbc){return _0x3bcae[_0xf4e1('0x1a')](_0x425d7c)[_0xf4e1('0x1b')](_0x556bbc);}};}function respondWithFilteredResult(_0x3808b5,_0x593f87){return function(_0x5c99b2){if(_0x5c99b2){var _0x35a998=typeof _0x593f87[_0xf4e1('0x1c')]==='undefined'&&typeof _0x593f87[_0xf4e1('0x1d')]===_0xf4e1('0x1e');var _0x57c759=_0x5c99b2[_0xf4e1('0x1f')];var _0xfffe82=_0x35a998?0x0:_0x593f87[_0xf4e1('0x1c')];var _0x3f3817=_0x35a998?_0x5c99b2[_0xf4e1('0x1f')]:_0x593f87[_0xf4e1('0x1c')]+_0x593f87[_0xf4e1('0x1d')];var _0x5df911;if(_0x3f3817>=_0x57c759){_0x3f3817=_0x57c759;_0x5df911=0xc8;}else{_0x5df911=0xce;}_0x3808b5['status'](_0x5df911);return _0x3808b5[_0xf4e1('0x20')](_0xf4e1('0x21'),_0xfffe82+'-'+_0x3f3817+'/'+_0x57c759)[_0xf4e1('0x1b')](_0x5c99b2);}return null;};}function patchUpdates(_0x188a98){return function(_0x2dff6c){try{jsonpatch[_0xf4e1('0x22')](_0x2dff6c,_0x188a98,!![]);}catch(_0x1f13e){return BPromise[_0xf4e1('0x23')](_0x1f13e);}return _0x2dff6c[_0xf4e1('0x24')]();};}function saveUpdates(_0x1298e6,_0x33cc83){return function(_0x108c86){if(_0x108c86){return _0x108c86[_0xf4e1('0x25')](_0x1298e6)[_0xf4e1('0x26')](function(_0x3f7168){return _0x3f7168;});}return null;};}function removeEntity(_0x58f958,_0x1a294e){return function(_0x58cea3){if(_0x58cea3){return _0x58cea3[_0xf4e1('0x27')]()[_0xf4e1('0x26')](function(){_0x58f958[_0xf4e1('0x1a')](0xcc)[_0xf4e1('0x28')]();});}};}function handleEntityNotFound(_0x485759,_0x170d01){return function(_0x5e6fbc){if(!_0x5e6fbc){_0x485759[_0xf4e1('0x19')](0x194);}return _0x5e6fbc;};}function handleError(_0xc6f825,_0x13659c){_0x13659c=_0x13659c||0x1f4;return function(_0x327d6f){logger[_0xf4e1('0x29')](_0x327d6f[_0xf4e1('0x2a')]);if(_0x327d6f[_0xf4e1('0x2b')]){delete _0x327d6f[_0xf4e1('0x2b')];}_0xc6f825[_0xf4e1('0x1a')](_0x13659c)['send'](_0x327d6f);};}exports['index']=function(_0x156a5d,_0x360bb3){var _0x4d02ec={},_0x4ac89d={},_0x955583={'count':0x0,'rows':[]};var _0x5f7f95=_['map'](db[_0xf4e1('0x2c')][_0xf4e1('0x2d')],function(_0x4e5e09){return{'name':_0x4e5e09[_0xf4e1('0x2e')],'type':_0x4e5e09[_0xf4e1('0x2f')][_0xf4e1('0x30')]};});_0x4ac89d[_0xf4e1('0x31')]=_['map'](_0x5f7f95,_0xf4e1('0x2b'));_0x4ac89d[_0xf4e1('0x32')]=_[_0xf4e1('0x33')](_0x156a5d[_0xf4e1('0x32')]);_0x4ac89d['filters']=_[_0xf4e1('0x34')](_0x4ac89d[_0xf4e1('0x31')],_0x4ac89d['query']);_0x4d02ec[_0xf4e1('0x35')]=_['intersection'](_0x4ac89d[_0xf4e1('0x31')],qs[_0xf4e1('0x36')](_0x156a5d[_0xf4e1('0x32')]['fields']));_0x4d02ec[_0xf4e1('0x35')]=_0x4d02ec[_0xf4e1('0x35')][_0xf4e1('0x37')]?_0x4d02ec[_0xf4e1('0x35')]:_0x4ac89d[_0xf4e1('0x31')];if(!_0x156a5d[_0xf4e1('0x32')][_0xf4e1('0x38')](_0xf4e1('0x39'))){_0x4d02ec[_0xf4e1('0x1d')]=qs[_0xf4e1('0x1d')](_0x156a5d[_0xf4e1('0x32')][_0xf4e1('0x1d')]);_0x4d02ec[_0xf4e1('0x1c')]=qs[_0xf4e1('0x1c')](_0x156a5d[_0xf4e1('0x32')]['offset']);}_0x4d02ec[_0xf4e1('0x3a')]=qs[_0xf4e1('0x3b')](_0x156a5d[_0xf4e1('0x32')][_0xf4e1('0x3b')]);_0x4d02ec[_0xf4e1('0x3c')]=qs['filters'](_[_0xf4e1('0x3d')](_0x156a5d[_0xf4e1('0x32')],_0x4ac89d[_0xf4e1('0x3e')]),_0x5f7f95);if(_0x156a5d['query'][_0xf4e1('0x3f')]){_0x4d02ec[_0xf4e1('0x3c')]=_[_0xf4e1('0x40')](_0x4d02ec['where'],{'$or':_[_0xf4e1('0x41')](_0x5f7f95,function(_0x4d5f85){if(_0x4d5f85['type']!==_0xf4e1('0x42')){var _0x50ad18={};_0x50ad18[_0x4d5f85[_0xf4e1('0x2b')]]={'$like':'%'+_0x156a5d[_0xf4e1('0x32')][_0xf4e1('0x3f')]+'%'};return _0x50ad18;}})});}_0x4d02ec=_[_0xf4e1('0x40')]({},_0x4d02ec,_0x156a5d[_0xf4e1('0x43')]);var _0x3c6637={'where':_0x4d02ec[_0xf4e1('0x3c')]};return db[_0xf4e1('0x2c')]['count'](_0x3c6637)[_0xf4e1('0x26')](function(_0x5a5a87){_0x955583[_0xf4e1('0x1f')]=_0x5a5a87;if(_0x156a5d[_0xf4e1('0x32')]['includeAll']){_0x4d02ec[_0xf4e1('0x44')]=[{'all':!![]}];}return db[_0xf4e1('0x2c')][_0xf4e1('0x45')](_0x4d02ec);})[_0xf4e1('0x26')](function(_0x3d455c){_0x955583['rows']=_0x3d455c;return _0x955583;})[_0xf4e1('0x26')](respondWithFilteredResult(_0x360bb3,_0x4d02ec))[_0xf4e1('0x46')](handleError(_0x360bb3,null));};exports[_0xf4e1('0x47')]=function(_0x62413e,_0x271ef8){var _0x110c7a={'raw':![],'where':{'id':_0x62413e[_0xf4e1('0x48')]['id']}},_0x292410={};_0x292410[_0xf4e1('0x31')]=_['keys'](db[_0xf4e1('0x2c')][_0xf4e1('0x2d')]);_0x292410[_0xf4e1('0x32')]=_[_0xf4e1('0x33')](_0x62413e['query']);_0x292410[_0xf4e1('0x3e')]=_[_0xf4e1('0x34')](_0x292410['model'],_0x292410[_0xf4e1('0x32')]);_0x110c7a[_0xf4e1('0x35')]=_[_0xf4e1('0x34')](_0x292410[_0xf4e1('0x31')],qs[_0xf4e1('0x36')](_0x62413e[_0xf4e1('0x32')]['fields']));_0x110c7a['attributes']=_0x110c7a[_0xf4e1('0x35')]['length']?_0x110c7a[_0xf4e1('0x35')]:_0x292410['model'];if(_0x62413e[_0xf4e1('0x32')][_0xf4e1('0x49')]){_0x110c7a['include']=[{'all':!![]}];}_0x110c7a=_[_0xf4e1('0x40')]({},_0x110c7a,_0x62413e[_0xf4e1('0x43')]);return db[_0xf4e1('0x2c')]['find'](_0x110c7a)[_0xf4e1('0x26')](handleEntityNotFound(_0x271ef8,null))['then'](respondWithResult(_0x271ef8,null))[_0xf4e1('0x46')](handleError(_0x271ef8,null));};exports[_0xf4e1('0x4a')]=function(_0x27c39b,_0x66f0f3){return db['Dynamics365Configuration']['create'](_0x27c39b[_0xf4e1('0x4b')],{})[_0xf4e1('0x26')](respondWithResult(_0x66f0f3,0xc9))[_0xf4e1('0x46')](handleError(_0x66f0f3,null));};exports['update']=function(_0x29c148,_0x3e6411){if(_0x29c148[_0xf4e1('0x4b')]['id']){delete _0x29c148[_0xf4e1('0x4b')]['id'];}return db[_0xf4e1('0x2c')][_0xf4e1('0x4c')]({'where':{'id':_0x29c148[_0xf4e1('0x48')]['id']}})[_0xf4e1('0x26')](handleEntityNotFound(_0x3e6411,null))[_0xf4e1('0x26')](saveUpdates(_0x29c148[_0xf4e1('0x4b')],null))[_0xf4e1('0x26')](respondWithResult(_0x3e6411,null))[_0xf4e1('0x46')](handleError(_0x3e6411,null));};exports[_0xf4e1('0x27')]=function(_0x1d1261,_0x7c347a){return db[_0xf4e1('0x2c')][_0xf4e1('0x4c')]({'where':{'id':_0x1d1261[_0xf4e1('0x48')]['id']}})[_0xf4e1('0x26')](handleEntityNotFound(_0x7c347a,null))[_0xf4e1('0x26')](removeEntity(_0x7c347a,null))[_0xf4e1('0x46')](handleError(_0x7c347a,null));};exports[_0xf4e1('0x4d')]=function(_0x1d8602,_0x6981d2,_0x36328b){var _0x38e88a={};var _0x506ab4={};var _0x3c9f48;var _0x5f1810;return db['Dynamics365Configuration'][_0xf4e1('0x4e')]({'where':{'id':_0x1d8602['params']['id']}})[_0xf4e1('0x26')](handleEntityNotFound(_0x6981d2,null))[_0xf4e1('0x26')](function(_0x450f6f){if(_0x450f6f){_0x3c9f48=_0x450f6f;_0x506ab4[_0xf4e1('0x31')]=_[_0xf4e1('0x33')](db[_0xf4e1('0x4f')]['rawAttributes']);_0x506ab4[_0xf4e1('0x32')]=_[_0xf4e1('0x33')](_0x1d8602['query']);_0x506ab4[_0xf4e1('0x3e')]=_['intersection'](_0x506ab4['model'],_0x506ab4[_0xf4e1('0x32')]);_0x38e88a[_0xf4e1('0x35')]=_[_0xf4e1('0x34')](_0x506ab4['model'],qs['fields'](_0x1d8602[_0xf4e1('0x32')][_0xf4e1('0x36')]));_0x38e88a[_0xf4e1('0x35')]=_0x38e88a['attributes']['length']?_0x38e88a[_0xf4e1('0x35')]:_0x506ab4[_0xf4e1('0x31')];_0x38e88a['order']=qs['sort'](_0x1d8602[_0xf4e1('0x32')][_0xf4e1('0x3b')]);_0x38e88a['where']=qs[_0xf4e1('0x3e')](_[_0xf4e1('0x3d')](_0x1d8602['query'],_0x506ab4['filters']));if(_0x1d8602[_0xf4e1('0x32')][_0xf4e1('0x3f')]){_0x38e88a[_0xf4e1('0x3c')]=_['merge'](_0x38e88a[_0xf4e1('0x3c')],{'$or':_[_0xf4e1('0x41')](_0x38e88a[_0xf4e1('0x35')],function(_0x11cccf){var _0x543df1={};_0x543df1[_0x11cccf]={'$like':'%'+_0x1d8602[_0xf4e1('0x32')][_0xf4e1('0x3f')]+'%'};return _0x543df1;})});}_0x38e88a=_[_0xf4e1('0x40')]({},_0x38e88a,_0x1d8602[_0xf4e1('0x43')]);return _0x3c9f48[_0xf4e1('0x4d')](_0x38e88a);}})[_0xf4e1('0x26')](function(_0x105fe0){if(_0x105fe0){_0x5f1810=_0x105fe0[_0xf4e1('0x37')];if(!_0x1d8602['query'][_0xf4e1('0x38')](_0xf4e1('0x39'))){_0x38e88a['limit']=qs['limit'](_0x1d8602[_0xf4e1('0x32')][_0xf4e1('0x1d')]);_0x38e88a[_0xf4e1('0x1c')]=qs[_0xf4e1('0x1c')](_0x1d8602[_0xf4e1('0x32')][_0xf4e1('0x1c')]);}return _0x3c9f48[_0xf4e1('0x4d')](_0x38e88a);}})[_0xf4e1('0x26')](function(_0x4b4e7d){if(_0x4b4e7d){return _0x4b4e7d?{'count':_0x5f1810,'rows':_0x4b4e7d}:null;}})[_0xf4e1('0x26')](respondWithResult(_0x6981d2,null))['catch'](handleError(_0x6981d2,null));};exports[_0xf4e1('0x50')]=function(_0x275e6c,_0x4bb074,_0x55205a){var _0x32a53c={};var _0x572038={};var _0x71291b;var _0x5ad11a;return db[_0xf4e1('0x2c')][_0xf4e1('0x4e')]({'where':{'id':_0x275e6c[_0xf4e1('0x48')]['id']}})[_0xf4e1('0x26')](handleEntityNotFound(_0x4bb074,null))[_0xf4e1('0x26')](function(_0x2f1b0c){if(_0x2f1b0c){_0x71291b=_0x2f1b0c;_0x572038['model']=_[_0xf4e1('0x33')](db[_0xf4e1('0x4f')][_0xf4e1('0x2d')]);_0x572038[_0xf4e1('0x32')]=_[_0xf4e1('0x33')](_0x275e6c[_0xf4e1('0x32')]);_0x572038[_0xf4e1('0x3e')]=_['intersection'](_0x572038[_0xf4e1('0x31')],_0x572038[_0xf4e1('0x32')]);_0x32a53c[_0xf4e1('0x35')]=_[_0xf4e1('0x34')](_0x572038[_0xf4e1('0x31')],qs[_0xf4e1('0x36')](_0x275e6c[_0xf4e1('0x32')][_0xf4e1('0x36')]));_0x32a53c[_0xf4e1('0x35')]=_0x32a53c['attributes'][_0xf4e1('0x37')]?_0x32a53c[_0xf4e1('0x35')]:_0x572038[_0xf4e1('0x31')];_0x32a53c[_0xf4e1('0x3a')]=qs[_0xf4e1('0x3b')](_0x275e6c[_0xf4e1('0x32')][_0xf4e1('0x3b')]);_0x32a53c[_0xf4e1('0x3c')]=qs[_0xf4e1('0x3e')](_[_0xf4e1('0x3d')](_0x275e6c['query'],_0x572038[_0xf4e1('0x3e')]));if(_0x275e6c[_0xf4e1('0x32')][_0xf4e1('0x3f')]){_0x32a53c[_0xf4e1('0x3c')]=_['merge'](_0x32a53c[_0xf4e1('0x3c')],{'$or':_['map'](_0x32a53c[_0xf4e1('0x35')],function(_0x5537d7){var _0x22e404={};_0x22e404[_0x5537d7]={'$like':'%'+_0x275e6c[_0xf4e1('0x32')]['filter']+'%'};return _0x22e404;})});}_0x32a53c=_[_0xf4e1('0x40')]({},_0x32a53c,_0x275e6c[_0xf4e1('0x43')]);return _0x71291b[_0xf4e1('0x50')](_0x32a53c);}})['then'](function(_0x152b6b){if(_0x152b6b){_0x5ad11a=_0x152b6b[_0xf4e1('0x37')];if(!_0x275e6c[_0xf4e1('0x32')][_0xf4e1('0x38')](_0xf4e1('0x39'))){_0x32a53c[_0xf4e1('0x1d')]=qs['limit'](_0x275e6c[_0xf4e1('0x32')][_0xf4e1('0x1d')]);_0x32a53c[_0xf4e1('0x1c')]=qs[_0xf4e1('0x1c')](_0x275e6c[_0xf4e1('0x32')][_0xf4e1('0x1c')]);}return _0x71291b['getSubjects'](_0x32a53c);}})[_0xf4e1('0x26')](function(_0x52d7b0){if(_0x52d7b0){return _0x52d7b0?{'count':_0x5ad11a,'rows':_0x52d7b0}:null;}})[_0xf4e1('0x26')](respondWithResult(_0x4bb074,null))[_0xf4e1('0x46')](handleError(_0x4bb074,null));};exports[_0xf4e1('0x51')]=function(_0x2dc907,_0x1150ba,_0x5c1054){var _0x301728={};var _0x15e33b={};var _0xda3c99;var _0x3fcc66;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2dc907[_0xf4e1('0x48')]['id']}})[_0xf4e1('0x26')](handleEntityNotFound(_0x1150ba,null))['then'](function(_0xda818d){if(_0xda818d){_0xda3c99=_0xda818d;_0x15e33b[_0xf4e1('0x31')]=_['keys'](db[_0xf4e1('0x4f')][_0xf4e1('0x2d')]);_0x15e33b[_0xf4e1('0x32')]=_['keys'](_0x2dc907['query']);_0x15e33b[_0xf4e1('0x3e')]=_[_0xf4e1('0x34')](_0x15e33b['model'],_0x15e33b[_0xf4e1('0x32')]);_0x301728[_0xf4e1('0x35')]=_[_0xf4e1('0x34')](_0x15e33b[_0xf4e1('0x31')],qs[_0xf4e1('0x36')](_0x2dc907[_0xf4e1('0x32')][_0xf4e1('0x36')]));_0x301728[_0xf4e1('0x35')]=_0x301728[_0xf4e1('0x35')]['length']?_0x301728[_0xf4e1('0x35')]:_0x15e33b['model'];_0x301728[_0xf4e1('0x3a')]=qs[_0xf4e1('0x3b')](_0x2dc907[_0xf4e1('0x32')][_0xf4e1('0x3b')]);_0x301728['where']=qs[_0xf4e1('0x3e')](_['pick'](_0x2dc907[_0xf4e1('0x32')],_0x15e33b['filters']));if(_0x2dc907[_0xf4e1('0x32')][_0xf4e1('0x3f')]){_0x301728['where']=_[_0xf4e1('0x40')](_0x301728[_0xf4e1('0x3c')],{'$or':_['map'](_0x301728['attributes'],function(_0x101c32){var _0x4954e8={};_0x4954e8[_0x101c32]={'$like':'%'+_0x2dc907['query']['filter']+'%'};return _0x4954e8;})});}_0x301728=_[_0xf4e1('0x40')]({},_0x301728,_0x2dc907[_0xf4e1('0x43')]);return _0xda3c99[_0xf4e1('0x51')](_0x301728);}})[_0xf4e1('0x26')](function(_0x392d27){if(_0x392d27){_0x3fcc66=_0x392d27[_0xf4e1('0x37')];if(!_0x2dc907[_0xf4e1('0x32')]['hasOwnProperty'](_0xf4e1('0x39'))){_0x301728['limit']=qs[_0xf4e1('0x1d')](_0x2dc907[_0xf4e1('0x32')]['limit']);_0x301728['offset']=qs[_0xf4e1('0x1c')](_0x2dc907[_0xf4e1('0x32')][_0xf4e1('0x1c')]);}return _0xda3c99['getDescriptions'](_0x301728);}})['then'](function(_0x5c2263){if(_0x5c2263){return _0x5c2263?{'count':_0x3fcc66,'rows':_0x5c2263}:null;}})[_0xf4e1('0x26')](respondWithResult(_0x1150ba,null))[_0xf4e1('0x46')](handleError(_0x1150ba,null));};
\ No newline at end of file
+var _0x02be=['show','params','rawAttributes','intersection','catch','create','body','find','findOne','Dynamics365Field','options','getFields','getSubjects','pick','getDescriptions','rimraf','zip-dir','request-promise','bluebird','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','Dynamics365Configuration','includeAll','include','rows'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0x02be,0xa7));var _0xe02b=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x02be[_0x3826ad];return _0x17b900;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe02b('0x0'));var zipdir=require(_0xe02b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02b('0x2'));var moment=require('moment');var BPromise=require(_0xe02b('0x3'));var Mustache=require('mustache');var util=require(_0xe02b('0x4'));var path=require(_0xe02b('0x5'));var sox=require(_0xe02b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe02b('0x7'));var crypto=require(_0xe02b('0x8'));var jsforce=require(_0xe02b('0x9'));var deskjs=require(_0xe02b('0xa'));var toCsv=require(_0xe02b('0xb'));var querystring=require(_0xe02b('0xc'));var Papa=require(_0xe02b('0xd'));var Redis=require(_0xe02b('0xe'));var authService=require(_0xe02b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe02b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe02b('0x11'))(_0xe02b('0x12'));var utils=require('../../config/utils');var config=require(_0xe02b('0x13'));var licenseUtil=require(_0xe02b('0x14'));var db=require(_0xe02b('0x15'))['db'];function respondWithStatusCode(_0x2ff322,_0x34662b){_0x34662b=_0x34662b||0xcc;return function(_0xa17bc9){if(_0xa17bc9){return _0x2ff322[_0xe02b('0x16')](_0x34662b);}return _0x2ff322[_0xe02b('0x17')](_0x34662b)[_0xe02b('0x18')]();};}function respondWithResult(_0x5c2245,_0x214ec7){_0x214ec7=_0x214ec7||0xc8;return function(_0x5adffd){if(_0x5adffd){return _0x5c2245[_0xe02b('0x17')](_0x214ec7)[_0xe02b('0x19')](_0x5adffd);}};}function respondWithFilteredResult(_0x4cb16a,_0x56821c){return function(_0x332b30){if(_0x332b30){var _0x23c59f=typeof _0x56821c['offset']===_0xe02b('0x1a')&&typeof _0x56821c[_0xe02b('0x1b')]===_0xe02b('0x1a');var _0x4148a4=_0x332b30[_0xe02b('0x1c')];var _0x3d9c80=_0x23c59f?0x0:_0x56821c[_0xe02b('0x1d')];var _0x20b8ca=_0x23c59f?_0x332b30[_0xe02b('0x1c')]:_0x56821c[_0xe02b('0x1d')]+_0x56821c[_0xe02b('0x1b')];var _0x4f2a1c;if(_0x20b8ca>=_0x4148a4){_0x20b8ca=_0x4148a4;_0x4f2a1c=0xc8;}else{_0x4f2a1c=0xce;}_0x4cb16a[_0xe02b('0x17')](_0x4f2a1c);return _0x4cb16a['set'](_0xe02b('0x1e'),_0x3d9c80+'-'+_0x20b8ca+'/'+_0x4148a4)['json'](_0x332b30);}return null;};}function patchUpdates(_0x294fba){return function(_0x4f12de){try{jsonpatch[_0xe02b('0x1f')](_0x4f12de,_0x294fba,!![]);}catch(_0x35e09b){return BPromise[_0xe02b('0x20')](_0x35e09b);}return _0x4f12de[_0xe02b('0x21')]();};}function saveUpdates(_0x9a95db,_0x3e56db){return function(_0x4ebb0b){if(_0x4ebb0b){return _0x4ebb0b[_0xe02b('0x22')](_0x9a95db)[_0xe02b('0x23')](function(_0xbced16){return _0xbced16;});}return null;};}function removeEntity(_0xf5b3e9,_0x44b7e9){return function(_0x48d955){if(_0x48d955){return _0x48d955[_0xe02b('0x24')]()['then'](function(){_0xf5b3e9['status'](0xcc)[_0xe02b('0x18')]();});}};}function handleEntityNotFound(_0x94718c,_0xe5ff6d){return function(_0xa4903f){if(!_0xa4903f){_0x94718c[_0xe02b('0x16')](0x194);}return _0xa4903f;};}function handleError(_0x22825c,_0x445f7d){_0x445f7d=_0x445f7d||0x1f4;return function(_0xb6fcdf){logger[_0xe02b('0x25')](_0xb6fcdf[_0xe02b('0x26')]);if(_0xb6fcdf[_0xe02b('0x27')]){delete _0xb6fcdf[_0xe02b('0x27')];}_0x22825c[_0xe02b('0x17')](_0x445f7d)['send'](_0xb6fcdf);};}exports['index']=function(_0x2c2c60,_0x12ea68){var _0x54c2c8={},_0x443cb0={},_0x40ef19={'count':0x0,'rows':[]};var _0x50042e=_[_0xe02b('0x28')](db['Dynamics365Configuration']['rawAttributes'],function(_0x1d2bb4){return{'name':_0x1d2bb4[_0xe02b('0x29')],'type':_0x1d2bb4[_0xe02b('0x2a')]['key']};});_0x443cb0['model']=_[_0xe02b('0x28')](_0x50042e,_0xe02b('0x27'));_0x443cb0[_0xe02b('0x2b')]=_[_0xe02b('0x2c')](_0x2c2c60['query']);_0x443cb0['filters']=_['intersection'](_0x443cb0[_0xe02b('0x2d')],_0x443cb0[_0xe02b('0x2b')]);_0x54c2c8[_0xe02b('0x2e')]=_['intersection'](_0x443cb0[_0xe02b('0x2d')],qs[_0xe02b('0x2f')](_0x2c2c60['query']['fields']));_0x54c2c8[_0xe02b('0x2e')]=_0x54c2c8[_0xe02b('0x2e')][_0xe02b('0x30')]?_0x54c2c8[_0xe02b('0x2e')]:_0x443cb0[_0xe02b('0x2d')];if(!_0x2c2c60[_0xe02b('0x2b')][_0xe02b('0x31')](_0xe02b('0x32'))){_0x54c2c8[_0xe02b('0x1b')]=qs[_0xe02b('0x1b')](_0x2c2c60[_0xe02b('0x2b')][_0xe02b('0x1b')]);_0x54c2c8[_0xe02b('0x1d')]=qs[_0xe02b('0x1d')](_0x2c2c60[_0xe02b('0x2b')][_0xe02b('0x1d')]);}_0x54c2c8[_0xe02b('0x33')]=qs[_0xe02b('0x34')](_0x2c2c60[_0xe02b('0x2b')][_0xe02b('0x34')]);_0x54c2c8[_0xe02b('0x35')]=qs[_0xe02b('0x36')](_['pick'](_0x2c2c60[_0xe02b('0x2b')],_0x443cb0[_0xe02b('0x36')]),_0x50042e);if(_0x2c2c60[_0xe02b('0x2b')][_0xe02b('0x37')]){_0x54c2c8['where']=_['merge'](_0x54c2c8[_0xe02b('0x35')],{'$or':_[_0xe02b('0x28')](_0x50042e,function(_0x3245d7){if(_0x3245d7['type']!=='VIRTUAL'){var _0x201704={};_0x201704[_0x3245d7['name']]={'$like':'%'+_0x2c2c60[_0xe02b('0x2b')][_0xe02b('0x37')]+'%'};return _0x201704;}})});}_0x54c2c8=_[_0xe02b('0x38')]({},_0x54c2c8,_0x2c2c60['options']);var _0x5eab6e={'where':_0x54c2c8[_0xe02b('0x35')]};return db[_0xe02b('0x39')][_0xe02b('0x1c')](_0x5eab6e)[_0xe02b('0x23')](function(_0x982906){_0x40ef19[_0xe02b('0x1c')]=_0x982906;if(_0x2c2c60[_0xe02b('0x2b')][_0xe02b('0x3a')]){_0x54c2c8[_0xe02b('0x3b')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x54c2c8);})[_0xe02b('0x23')](function(_0xd5642a){_0x40ef19[_0xe02b('0x3c')]=_0xd5642a;return _0x40ef19;})[_0xe02b('0x23')](respondWithFilteredResult(_0x12ea68,_0x54c2c8))['catch'](handleError(_0x12ea68,null));};exports[_0xe02b('0x3d')]=function(_0x3a8146,_0x3a57a6){var _0x1d6020={'raw':![],'where':{'id':_0x3a8146[_0xe02b('0x3e')]['id']}},_0x4f4e3c={};_0x4f4e3c['model']=_[_0xe02b('0x2c')](db['Dynamics365Configuration'][_0xe02b('0x3f')]);_0x4f4e3c['query']=_[_0xe02b('0x2c')](_0x3a8146[_0xe02b('0x2b')]);_0x4f4e3c[_0xe02b('0x36')]=_[_0xe02b('0x40')](_0x4f4e3c[_0xe02b('0x2d')],_0x4f4e3c[_0xe02b('0x2b')]);_0x1d6020[_0xe02b('0x2e')]=_[_0xe02b('0x40')](_0x4f4e3c['model'],qs[_0xe02b('0x2f')](_0x3a8146[_0xe02b('0x2b')][_0xe02b('0x2f')]));_0x1d6020[_0xe02b('0x2e')]=_0x1d6020[_0xe02b('0x2e')][_0xe02b('0x30')]?_0x1d6020[_0xe02b('0x2e')]:_0x4f4e3c[_0xe02b('0x2d')];if(_0x3a8146[_0xe02b('0x2b')]['includeAll']){_0x1d6020['include']=[{'all':!![]}];}_0x1d6020=_[_0xe02b('0x38')]({},_0x1d6020,_0x3a8146['options']);return db[_0xe02b('0x39')]['find'](_0x1d6020)[_0xe02b('0x23')](handleEntityNotFound(_0x3a57a6,null))[_0xe02b('0x23')](respondWithResult(_0x3a57a6,null))[_0xe02b('0x41')](handleError(_0x3a57a6,null));};exports[_0xe02b('0x42')]=function(_0x43c54f,_0x58e1b7){return db['Dynamics365Configuration']['create'](_0x43c54f[_0xe02b('0x43')],{})[_0xe02b('0x23')](respondWithResult(_0x58e1b7,0xc9))['catch'](handleError(_0x58e1b7,null));};exports[_0xe02b('0x22')]=function(_0x1eaca0,_0x314c7c){if(_0x1eaca0[_0xe02b('0x43')]['id']){delete _0x1eaca0[_0xe02b('0x43')]['id'];}return db[_0xe02b('0x39')][_0xe02b('0x44')]({'where':{'id':_0x1eaca0[_0xe02b('0x3e')]['id']}})[_0xe02b('0x23')](handleEntityNotFound(_0x314c7c,null))[_0xe02b('0x23')](saveUpdates(_0x1eaca0[_0xe02b('0x43')],null))[_0xe02b('0x23')](respondWithResult(_0x314c7c,null))[_0xe02b('0x41')](handleError(_0x314c7c,null));};exports[_0xe02b('0x24')]=function(_0x79007a,_0x5e6eda){return db[_0xe02b('0x39')][_0xe02b('0x44')]({'where':{'id':_0x79007a[_0xe02b('0x3e')]['id']}})[_0xe02b('0x23')](handleEntityNotFound(_0x5e6eda,null))[_0xe02b('0x23')](removeEntity(_0x5e6eda,null))[_0xe02b('0x41')](handleError(_0x5e6eda,null));};exports['getFields']=function(_0x38279e,_0x50fd1d,_0x25ade5){var _0x13204f={};var _0x496664={};var _0x4af9cc;var _0x3e1e5a;return db[_0xe02b('0x39')][_0xe02b('0x45')]({'where':{'id':_0x38279e[_0xe02b('0x3e')]['id']}})[_0xe02b('0x23')](handleEntityNotFound(_0x50fd1d,null))[_0xe02b('0x23')](function(_0x146e19){if(_0x146e19){_0x4af9cc=_0x146e19;_0x496664[_0xe02b('0x2d')]=_[_0xe02b('0x2c')](db[_0xe02b('0x46')][_0xe02b('0x3f')]);_0x496664[_0xe02b('0x2b')]=_[_0xe02b('0x2c')](_0x38279e[_0xe02b('0x2b')]);_0x496664['filters']=_[_0xe02b('0x40')](_0x496664[_0xe02b('0x2d')],_0x496664[_0xe02b('0x2b')]);_0x13204f['attributes']=_['intersection'](_0x496664[_0xe02b('0x2d')],qs[_0xe02b('0x2f')](_0x38279e[_0xe02b('0x2b')][_0xe02b('0x2f')]));_0x13204f[_0xe02b('0x2e')]=_0x13204f[_0xe02b('0x2e')][_0xe02b('0x30')]?_0x13204f[_0xe02b('0x2e')]:_0x496664[_0xe02b('0x2d')];_0x13204f[_0xe02b('0x33')]=qs['sort'](_0x38279e[_0xe02b('0x2b')][_0xe02b('0x34')]);_0x13204f[_0xe02b('0x35')]=qs[_0xe02b('0x36')](_['pick'](_0x38279e['query'],_0x496664[_0xe02b('0x36')]));if(_0x38279e[_0xe02b('0x2b')][_0xe02b('0x37')]){_0x13204f[_0xe02b('0x35')]=_[_0xe02b('0x38')](_0x13204f[_0xe02b('0x35')],{'$or':_[_0xe02b('0x28')](_0x13204f[_0xe02b('0x2e')],function(_0x4cdde1){var _0x36581f={};_0x36581f[_0x4cdde1]={'$like':'%'+_0x38279e[_0xe02b('0x2b')][_0xe02b('0x37')]+'%'};return _0x36581f;})});}_0x13204f=_[_0xe02b('0x38')]({},_0x13204f,_0x38279e[_0xe02b('0x47')]);return _0x4af9cc[_0xe02b('0x48')](_0x13204f);}})[_0xe02b('0x23')](function(_0x278cde){if(_0x278cde){_0x3e1e5a=_0x278cde[_0xe02b('0x30')];if(!_0x38279e[_0xe02b('0x2b')][_0xe02b('0x31')]('nolimit')){_0x13204f['limit']=qs[_0xe02b('0x1b')](_0x38279e['query'][_0xe02b('0x1b')]);_0x13204f['offset']=qs[_0xe02b('0x1d')](_0x38279e[_0xe02b('0x2b')][_0xe02b('0x1d')]);}return _0x4af9cc[_0xe02b('0x48')](_0x13204f);}})['then'](function(_0x193fd8){if(_0x193fd8){return _0x193fd8?{'count':_0x3e1e5a,'rows':_0x193fd8}:null;}})[_0xe02b('0x23')](respondWithResult(_0x50fd1d,null))[_0xe02b('0x41')](handleError(_0x50fd1d,null));};exports[_0xe02b('0x49')]=function(_0x19c552,_0x18ab9a,_0xec1496){var _0x21639d={};var _0x33a683={};var _0x30f9da;var _0x46f521;return db[_0xe02b('0x39')]['findOne']({'where':{'id':_0x19c552[_0xe02b('0x3e')]['id']}})[_0xe02b('0x23')](handleEntityNotFound(_0x18ab9a,null))[_0xe02b('0x23')](function(_0x36ae8d){if(_0x36ae8d){_0x30f9da=_0x36ae8d;_0x33a683[_0xe02b('0x2d')]=_['keys'](db[_0xe02b('0x46')]['rawAttributes']);_0x33a683[_0xe02b('0x2b')]=_[_0xe02b('0x2c')](_0x19c552[_0xe02b('0x2b')]);_0x33a683[_0xe02b('0x36')]=_[_0xe02b('0x40')](_0x33a683[_0xe02b('0x2d')],_0x33a683[_0xe02b('0x2b')]);_0x21639d[_0xe02b('0x2e')]=_['intersection'](_0x33a683[_0xe02b('0x2d')],qs[_0xe02b('0x2f')](_0x19c552[_0xe02b('0x2b')]['fields']));_0x21639d[_0xe02b('0x2e')]=_0x21639d[_0xe02b('0x2e')]['length']?_0x21639d[_0xe02b('0x2e')]:_0x33a683[_0xe02b('0x2d')];_0x21639d['order']=qs[_0xe02b('0x34')](_0x19c552[_0xe02b('0x2b')][_0xe02b('0x34')]);_0x21639d[_0xe02b('0x35')]=qs[_0xe02b('0x36')](_[_0xe02b('0x4a')](_0x19c552[_0xe02b('0x2b')],_0x33a683[_0xe02b('0x36')]));if(_0x19c552['query'][_0xe02b('0x37')]){_0x21639d[_0xe02b('0x35')]=_[_0xe02b('0x38')](_0x21639d['where'],{'$or':_[_0xe02b('0x28')](_0x21639d[_0xe02b('0x2e')],function(_0x48e528){var _0x475969={};_0x475969[_0x48e528]={'$like':'%'+_0x19c552[_0xe02b('0x2b')][_0xe02b('0x37')]+'%'};return _0x475969;})});}_0x21639d=_['merge']({},_0x21639d,_0x19c552[_0xe02b('0x47')]);return _0x30f9da[_0xe02b('0x49')](_0x21639d);}})[_0xe02b('0x23')](function(_0x2cf472){if(_0x2cf472){_0x46f521=_0x2cf472['length'];if(!_0x19c552[_0xe02b('0x2b')][_0xe02b('0x31')]('nolimit')){_0x21639d['limit']=qs['limit'](_0x19c552['query'][_0xe02b('0x1b')]);_0x21639d[_0xe02b('0x1d')]=qs[_0xe02b('0x1d')](_0x19c552[_0xe02b('0x2b')]['offset']);}return _0x30f9da[_0xe02b('0x49')](_0x21639d);}})[_0xe02b('0x23')](function(_0x8e5c44){if(_0x8e5c44){return _0x8e5c44?{'count':_0x46f521,'rows':_0x8e5c44}:null;}})['then'](respondWithResult(_0x18ab9a,null))[_0xe02b('0x41')](handleError(_0x18ab9a,null));};exports[_0xe02b('0x4b')]=function(_0x2f4211,_0x4cbda6,_0x5c6da4){var _0x2eb574={};var _0x5ca5d1={};var _0x11c203;var _0x110f28;return db['Dynamics365Configuration'][_0xe02b('0x45')]({'where':{'id':_0x2f4211[_0xe02b('0x3e')]['id']}})[_0xe02b('0x23')](handleEntityNotFound(_0x4cbda6,null))[_0xe02b('0x23')](function(_0xac4806){if(_0xac4806){_0x11c203=_0xac4806;_0x5ca5d1[_0xe02b('0x2d')]=_['keys'](db[_0xe02b('0x46')][_0xe02b('0x3f')]);_0x5ca5d1['query']=_[_0xe02b('0x2c')](_0x2f4211[_0xe02b('0x2b')]);_0x5ca5d1[_0xe02b('0x36')]=_[_0xe02b('0x40')](_0x5ca5d1[_0xe02b('0x2d')],_0x5ca5d1['query']);_0x2eb574['attributes']=_[_0xe02b('0x40')](_0x5ca5d1[_0xe02b('0x2d')],qs['fields'](_0x2f4211[_0xe02b('0x2b')]['fields']));_0x2eb574[_0xe02b('0x2e')]=_0x2eb574[_0xe02b('0x2e')][_0xe02b('0x30')]?_0x2eb574[_0xe02b('0x2e')]:_0x5ca5d1[_0xe02b('0x2d')];_0x2eb574['order']=qs[_0xe02b('0x34')](_0x2f4211['query']['sort']);_0x2eb574[_0xe02b('0x35')]=qs[_0xe02b('0x36')](_['pick'](_0x2f4211[_0xe02b('0x2b')],_0x5ca5d1['filters']));if(_0x2f4211[_0xe02b('0x2b')][_0xe02b('0x37')]){_0x2eb574[_0xe02b('0x35')]=_[_0xe02b('0x38')](_0x2eb574['where'],{'$or':_[_0xe02b('0x28')](_0x2eb574[_0xe02b('0x2e')],function(_0x5d5385){var _0x5c3a98={};_0x5c3a98[_0x5d5385]={'$like':'%'+_0x2f4211[_0xe02b('0x2b')][_0xe02b('0x37')]+'%'};return _0x5c3a98;})});}_0x2eb574=_[_0xe02b('0x38')]({},_0x2eb574,_0x2f4211[_0xe02b('0x47')]);return _0x11c203[_0xe02b('0x4b')](_0x2eb574);}})[_0xe02b('0x23')](function(_0x3d5f12){if(_0x3d5f12){_0x110f28=_0x3d5f12[_0xe02b('0x30')];if(!_0x2f4211[_0xe02b('0x2b')][_0xe02b('0x31')](_0xe02b('0x32'))){_0x2eb574[_0xe02b('0x1b')]=qs['limit'](_0x2f4211[_0xe02b('0x2b')][_0xe02b('0x1b')]);_0x2eb574[_0xe02b('0x1d')]=qs['offset'](_0x2f4211['query'][_0xe02b('0x1d')]);}return _0x11c203[_0xe02b('0x4b')](_0x2eb574);}})[_0xe02b('0x23')](function(_0x286d65){if(_0x286d65){return _0x286d65?{'count':_0x110f28,'rows':_0x286d65}:null;}})[_0xe02b('0x23')](respondWithResult(_0x4cbda6,null))['catch'](handleError(_0x4cbda6,null));};
\ No newline at end of file
index 2cd31dc..2d26aa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x2626b4,_0x3826a7){var _0x3f817f=function(_0x454736){while(--_0x454736){_0x2626b4['push'](_0x2626b4['shift']());}};_0x3f817f(++_0x3826a7);}(_0x5b02,0xe9));var _0x25b0=function(_0x345e97,_0x454f72){_0x345e97=_0x345e97-0x0;var _0x1f9299=_0x5b02[_0x345e97];return _0x1f9299;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0xa4ee16,_0x2f306c){var _0xdf9fd4=function(_0x1a7c27){while(--_0x1a7c27){_0xa4ee16['push'](_0xa4ee16['shift']());}};_0xdf9fd4(++_0x2f306c);}(_0xdace,0xc5));var _0xedac=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0xdace[_0x9729d7];return _0x3c4ac6;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 831b2fc..426d774 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe30e=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','debug','request\x20sent','error','code','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xe30e,0xea));var _0xee30=function(_0x129a57,_0x330d03){_0x129a57=_0x129a57-0x0;var _0xa7147c=_0xe30e[_0x129a57];return _0xa7147c;};'use strict';var _=require(_0xee30('0x0'));var util=require(_0xee30('0x1'));var moment=require(_0xee30('0x2'));var BPromise=require(_0xee30('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee30('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xee30('0x5'));var logger=require(_0xee30('0x6'))(_0xee30('0x7'));var config=require(_0xee30('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee30('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f9f3e,_0x45052a,_0x3a0b68){return new BPromise(function(_0x678d6d,_0x7fb723){return client[_0xee30('0xa')](_0x4f9f3e,_0x3a0b68)[_0xee30('0xb')](function(_0x5ea746){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x45052a,'request\x20sent');logger[_0xee30('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x45052a,_0xee30('0xd'),JSON['stringify'](_0x5ea746));if(_0x5ea746[_0xee30('0xe')]){if(_0x5ea746[_0xee30('0xe')][_0xee30('0xf')]===0x1f4){logger[_0xee30('0xe')](_0xee30('0x10'),_0x45052a,_0x5ea746[_0xee30('0xe')]['message']);return _0x7fb723(_0x5ea746['error'][_0xee30('0x11')]);}logger[_0xee30('0xe')](_0xee30('0x10'),_0x45052a,_0x5ea746[_0xee30('0xe')][_0xee30('0x11')]);return _0x678d6d(_0x5ea746[_0xee30('0xe')]['message']);}else{logger[_0xee30('0x12')](_0xee30('0x10'),_0x45052a,_0xee30('0xd'));_0x678d6d(_0x5ea746[_0xee30('0x13')][_0xee30('0x11')]);}})[_0xee30('0x14')](function(_0x1974e3){logger['error'](_0xee30('0x10'),_0x45052a,_0x1974e3);_0x7fb723(_0x1974e3);});});}
\ No newline at end of file
+var _0x6691=['stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x54c6a9,_0x3cf415){var _0x1dc3ce=function(_0x176bee){while(--_0x176bee){_0x54c6a9['push'](_0x54c6a9['shift']());}};_0x1dc3ce(++_0x3cf415);}(_0x6691,0x1bc));var _0x1669=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6691[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require('../../config/logger')(_0x1669('0x8'));var config=require(_0x1669('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1669('0xa')][_0x1669('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26b51c,_0x530785,_0x109b81){return new BPromise(function(_0x57fb39,_0x4a028c){return client[_0x1669('0xc')](_0x26b51c,_0x109b81)[_0x1669('0xd')](function(_0x8482fe){logger[_0x1669('0xe')](_0x1669('0xf'),_0x530785,_0x1669('0x10'));logger['debug'](_0x1669('0x11'),_0x530785,_0x1669('0x10'),JSON[_0x1669('0x12')](_0x8482fe));if(_0x8482fe[_0x1669('0x13')]){if(_0x8482fe['error'][_0x1669('0x14')]===0x1f4){logger[_0x1669('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x530785,_0x8482fe['error'][_0x1669('0x15')]);return _0x4a028c(_0x8482fe[_0x1669('0x13')][_0x1669('0x15')]);}logger[_0x1669('0x13')](_0x1669('0xf'),_0x530785,_0x8482fe['error'][_0x1669('0x15')]);return _0x57fb39(_0x8482fe['error'][_0x1669('0x15')]);}else{logger[_0x1669('0xe')](_0x1669('0xf'),_0x530785,_0x1669('0x10'));_0x57fb39(_0x8482fe['result'][_0x1669('0x15')]);}})['catch'](function(_0x4d911a){logger[_0x1669('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x530785,_0x4d911a);_0x4a028c(_0x4d911a);});});}
\ No newline at end of file
index 75bf1be..3948037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6a8=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3bd04c,_0x3edee7){var _0x1da7d1=function(_0x4f4702){while(--_0x4f4702){_0x3bd04c['push'](_0x3bd04c['shift']());}};_0x1da7d1(++_0x3edee7);}(_0xc6a8,0x1a0));var _0x8c6a=function(_0x9db11d,_0x1efff9){_0x9db11d=_0x9db11d-0x0;var _0x1cf7cb=_0xc6a8[_0x9db11d];return _0x1cf7cb;};'use strict';var multer=require(_0x8c6a('0x0'));var util=require(_0x8c6a('0x1'));var path=require(_0x8c6a('0x2'));var timeout=require(_0x8c6a('0x3'));var express=require(_0x8c6a('0x4'));var router=express['Router']();var fs_extra=require(_0x8c6a('0x5'));var auth=require(_0x8c6a('0x6'));var interaction=require(_0x8c6a('0x7'));var config=require(_0x8c6a('0x8'));var controller=require(_0x8c6a('0x9'));router['get']('/',auth[_0x8c6a('0xa')](),controller[_0x8c6a('0xb')]);router[_0x8c6a('0xc')](_0x8c6a('0xd'),auth[_0x8c6a('0xa')](),controller[_0x8c6a('0xe')]);router[_0x8c6a('0xf')]('/',auth['isAuthenticated'](),controller[_0x8c6a('0x10')]);router[_0x8c6a('0x11')](_0x8c6a('0xd'),auth[_0x8c6a('0xa')](),controller[_0x8c6a('0x12')]);router[_0x8c6a('0x13')](_0x8c6a('0xd'),auth['isAuthenticated'](),controller[_0x8c6a('0x14')]);module[_0x8c6a('0x15')]=router;
\ No newline at end of file
+var _0x5dc8=['create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x28087c,_0x895c0f){var _0x329122=function(_0x25c2e9){while(--_0x25c2e9){_0x28087c['push'](_0x28087c['shift']());}};_0x329122(++_0x895c0f);}(_0x5dc8,0x195));var _0x85dc=function(_0x820843,_0x4b6f7e){_0x820843=_0x820843-0x0;var _0x2077c2=_0x5dc8[_0x820843];return _0x2077c2;};'use strict';var multer=require(_0x85dc('0x0'));var util=require(_0x85dc('0x1'));var path=require('path');var timeout=require(_0x85dc('0x2'));var express=require(_0x85dc('0x3'));var router=express[_0x85dc('0x4')]();var fs_extra=require(_0x85dc('0x5'));var auth=require(_0x85dc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x85dc('0x7'));var controller=require(_0x85dc('0x8'));router[_0x85dc('0x9')]('/',auth[_0x85dc('0xa')](),controller[_0x85dc('0xb')]);router[_0x85dc('0x9')](_0x85dc('0xc'),auth[_0x85dc('0xa')](),controller[_0x85dc('0xd')]);router[_0x85dc('0xe')]('/',auth[_0x85dc('0xa')](),controller[_0x85dc('0xf')]);router[_0x85dc('0x10')]('/:id',auth[_0x85dc('0xa')](),controller['update']);router[_0x85dc('0x11')](_0x85dc('0xc'),auth[_0x85dc('0xa')](),controller[_0x85dc('0x12')]);module[_0x85dc('0x13')]=router;
\ No newline at end of file
index 2a79d58..1804cb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf157=['string','variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xf157,0x170));var _0x7f15=function(_0x3cf9bc,_0x5abf71){_0x3cf9bc=_0x3cf9bc-0x0;var _0x44fb1d=_0xf157[_0x3cf9bc];return _0x44fb1d;};'use strict';var Sequelize=require(_0x7f15('0x0'));module[_0x7f15('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7f15('0x2'),_0x7f15('0x3'),'customVariable',_0x7f15('0x4'),_0x7f15('0x5')),'defaultValue':_0x7f15('0x2')},'content':{'type':Sequelize[_0x7f15('0x6')]},'key':{'type':Sequelize[_0x7f15('0x6')]},'keyType':{'type':Sequelize[_0x7f15('0x7')](_0x7f15('0x2'),_0x7f15('0x3'),_0x7f15('0x8'))},'keyContent':{'type':Sequelize[_0x7f15('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7f15('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7f15('0x6')]}};
\ No newline at end of file
+var _0x8328=['string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x52b547,_0x453c9f){var _0x14cd9d=function(_0x50bf6a){while(--_0x50bf6a){_0x52b547['push'](_0x52b547['shift']());}};_0x14cd9d(++_0x453c9f);}(_0x8328,0x124));var _0x8832=function(_0x2958c4,_0x3a68cd){_0x2958c4=_0x2958c4-0x0;var _0xceb0fd=_0x8328[_0x2958c4];return _0xceb0fd;};'use strict';var Sequelize=require(_0x8832('0x0'));module[_0x8832('0x1')]={'type':{'type':Sequelize[_0x8832('0x2')]('string',_0x8832('0x3'),_0x8832('0x4'),_0x8832('0x5'),_0x8832('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8832('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x8832('0x8'),_0x8832('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8832('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8832('0x7')]}};
\ No newline at end of file
index 2847d7b..2c3c6db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb16b=['where','pick','filter','VIRTUAL','merge','includeAll','include','Dynamics365Field','findAll','rows','catch','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5e944a,_0x2847b4){var _0x38f07b=function(_0x433e88){while(--_0x433e88){_0x5e944a['push'](_0x5e944a['shift']());}};_0x38f07b(++_0x2847b4);}(_0xb16b,0xae));var _0xbb16=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0xb16b[_0x2fbcf6];return _0x3e7265;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb16('0x0'));var zipdir=require(_0xbb16('0x1'));var jsonpatch=require(_0xbb16('0x2'));var rp=require('request-promise');var moment=require(_0xbb16('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbb16('0x4'));var util=require(_0xbb16('0x5'));var path=require(_0xbb16('0x6'));var sox=require(_0xbb16('0x7'));var csv=require(_0xbb16('0x8'));var ejs=require(_0xbb16('0x9'));var fs=require('fs');var fs_extra=require(_0xbb16('0xa'));var _=require(_0xbb16('0xb'));var squel=require(_0xbb16('0xc'));var crypto=require(_0xbb16('0xd'));var jsforce=require(_0xbb16('0xe'));var deskjs=require(_0xbb16('0xf'));var toCsv=require(_0xbb16('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbb16('0x10'));var authService=require(_0xbb16('0x11'));var qs=require(_0xbb16('0x12'));var as=require(_0xbb16('0x13'));var hardwareService=require(_0xbb16('0x14'));var logger=require(_0xbb16('0x15'))(_0xbb16('0x16'));var utils=require(_0xbb16('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbb16('0x18'));var db=require(_0xbb16('0x19'))['db'];function respondWithStatusCode(_0x1c1459,_0x102cba){_0x102cba=_0x102cba||0xcc;return function(_0x2115c8){if(_0x2115c8){return _0x1c1459[_0xbb16('0x1a')](_0x102cba);}return _0x1c1459[_0xbb16('0x1b')](_0x102cba)[_0xbb16('0x1c')]();};}function respondWithResult(_0x3f3a0c,_0xec7db1){_0xec7db1=_0xec7db1||0xc8;return function(_0x2c6018){if(_0x2c6018){return _0x3f3a0c['status'](_0xec7db1)[_0xbb16('0x1d')](_0x2c6018);}};}function respondWithFilteredResult(_0x2c0f46,_0x153fa7){return function(_0x50b45b){if(_0x50b45b){var _0x17d9f0=typeof _0x153fa7[_0xbb16('0x1e')]===_0xbb16('0x1f')&&typeof _0x153fa7[_0xbb16('0x20')]===_0xbb16('0x1f');var _0x132c8a=_0x50b45b[_0xbb16('0x21')];var _0x171cbf=_0x17d9f0?0x0:_0x153fa7[_0xbb16('0x1e')];var _0x136aa3=_0x17d9f0?_0x50b45b[_0xbb16('0x21')]:_0x153fa7[_0xbb16('0x1e')]+_0x153fa7[_0xbb16('0x20')];var _0x5aee39;if(_0x136aa3>=_0x132c8a){_0x136aa3=_0x132c8a;_0x5aee39=0xc8;}else{_0x5aee39=0xce;}_0x2c0f46[_0xbb16('0x1b')](_0x5aee39);return _0x2c0f46[_0xbb16('0x22')](_0xbb16('0x23'),_0x171cbf+'-'+_0x136aa3+'/'+_0x132c8a)['json'](_0x50b45b);}return null;};}function patchUpdates(_0x550fe9){return function(_0x538cba){try{jsonpatch[_0xbb16('0x24')](_0x538cba,_0x550fe9,!![]);}catch(_0x4b0ee9){return BPromise[_0xbb16('0x25')](_0x4b0ee9);}return _0x538cba[_0xbb16('0x26')]();};}function saveUpdates(_0xe58a98,_0x43fa2c){return function(_0x22a9e0){if(_0x22a9e0){return _0x22a9e0[_0xbb16('0x27')](_0xe58a98)[_0xbb16('0x28')](function(_0x416a1f){return _0x416a1f;});}return null;};}function removeEntity(_0x30214a,_0x31401f){return function(_0x2eb811){if(_0x2eb811){return _0x2eb811[_0xbb16('0x29')]()[_0xbb16('0x28')](function(){_0x30214a[_0xbb16('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29aadc,_0x4be57d){return function(_0x573489){if(!_0x573489){_0x29aadc[_0xbb16('0x1a')](0x194);}return _0x573489;};}function handleError(_0x543ff0,_0x2a6be0){_0x2a6be0=_0x2a6be0||0x1f4;return function(_0x2c9748){logger['error'](_0x2c9748[_0xbb16('0x2a')]);if(_0x2c9748[_0xbb16('0x2b')]){delete _0x2c9748[_0xbb16('0x2b')];}_0x543ff0[_0xbb16('0x1b')](_0x2a6be0)[_0xbb16('0x2c')](_0x2c9748);};}exports[_0xbb16('0x2d')]=function(_0x44b4f8,_0x5e434f){var _0x227fe4={},_0x19c96a={},_0xe83dd1={'count':0x0,'rows':[]};var _0x1c4ee7=_[_0xbb16('0x2e')](db['Dynamics365Field'][_0xbb16('0x2f')],function(_0x34adbe){return{'name':_0x34adbe[_0xbb16('0x30')],'type':_0x34adbe[_0xbb16('0x31')][_0xbb16('0x32')]};});_0x19c96a[_0xbb16('0x33')]=_[_0xbb16('0x2e')](_0x1c4ee7,_0xbb16('0x2b'));_0x19c96a[_0xbb16('0x34')]=_[_0xbb16('0x35')](_0x44b4f8[_0xbb16('0x34')]);_0x19c96a[_0xbb16('0x36')]=_[_0xbb16('0x37')](_0x19c96a[_0xbb16('0x33')],_0x19c96a['query']);_0x227fe4[_0xbb16('0x38')]=_[_0xbb16('0x37')](_0x19c96a[_0xbb16('0x33')],qs['fields'](_0x44b4f8['query'][_0xbb16('0x39')]));_0x227fe4[_0xbb16('0x38')]=_0x227fe4['attributes'][_0xbb16('0x3a')]?_0x227fe4[_0xbb16('0x38')]:_0x19c96a[_0xbb16('0x33')];if(!_0x44b4f8[_0xbb16('0x34')][_0xbb16('0x3b')](_0xbb16('0x3c'))){_0x227fe4['limit']=qs['limit'](_0x44b4f8['query'][_0xbb16('0x20')]);_0x227fe4[_0xbb16('0x1e')]=qs['offset'](_0x44b4f8[_0xbb16('0x34')][_0xbb16('0x1e')]);}_0x227fe4[_0xbb16('0x3d')]=qs[_0xbb16('0x3e')](_0x44b4f8[_0xbb16('0x34')][_0xbb16('0x3e')]);_0x227fe4[_0xbb16('0x3f')]=qs[_0xbb16('0x36')](_[_0xbb16('0x40')](_0x44b4f8[_0xbb16('0x34')],_0x19c96a[_0xbb16('0x36')]),_0x1c4ee7);if(_0x44b4f8[_0xbb16('0x34')][_0xbb16('0x41')]){_0x227fe4[_0xbb16('0x3f')]=_['merge'](_0x227fe4[_0xbb16('0x3f')],{'$or':_['map'](_0x1c4ee7,function(_0xbb941e){if(_0xbb941e['type']!==_0xbb16('0x42')){var _0x5b6f76={};_0x5b6f76[_0xbb941e['name']]={'$like':'%'+_0x44b4f8[_0xbb16('0x34')]['filter']+'%'};return _0x5b6f76;}})});}_0x227fe4=_[_0xbb16('0x43')]({},_0x227fe4,_0x44b4f8['options']);var _0x3e554f={'where':_0x227fe4[_0xbb16('0x3f')]};return db['Dynamics365Field'][_0xbb16('0x21')](_0x3e554f)[_0xbb16('0x28')](function(_0x2ed4b2){_0xe83dd1[_0xbb16('0x21')]=_0x2ed4b2;if(_0x44b4f8[_0xbb16('0x34')][_0xbb16('0x44')]){_0x227fe4[_0xbb16('0x45')]=[{'all':!![]}];}return db[_0xbb16('0x46')][_0xbb16('0x47')](_0x227fe4);})[_0xbb16('0x28')](function(_0x4a47a8){_0xe83dd1[_0xbb16('0x48')]=_0x4a47a8;return _0xe83dd1;})['then'](respondWithFilteredResult(_0x5e434f,_0x227fe4))[_0xbb16('0x49')](handleError(_0x5e434f,null));};exports['show']=function(_0x3ca96f,_0x2325ce){var _0x5b1221={'raw':!![],'where':{'id':_0x3ca96f[_0xbb16('0x4a')]['id']}},_0x33a479={};_0x33a479['model']=_[_0xbb16('0x35')](db['Dynamics365Field']['rawAttributes']);_0x33a479[_0xbb16('0x34')]=_['keys'](_0x3ca96f[_0xbb16('0x34')]);_0x33a479[_0xbb16('0x36')]=_['intersection'](_0x33a479[_0xbb16('0x33')],_0x33a479[_0xbb16('0x34')]);_0x5b1221[_0xbb16('0x38')]=_['intersection'](_0x33a479[_0xbb16('0x33')],qs['fields'](_0x3ca96f['query'][_0xbb16('0x39')]));_0x5b1221[_0xbb16('0x38')]=_0x5b1221[_0xbb16('0x38')][_0xbb16('0x3a')]?_0x5b1221[_0xbb16('0x38')]:_0x33a479[_0xbb16('0x33')];if(_0x3ca96f[_0xbb16('0x34')][_0xbb16('0x44')]){_0x5b1221[_0xbb16('0x45')]=[{'all':!![]}];}_0x5b1221=_[_0xbb16('0x43')]({},_0x5b1221,_0x3ca96f[_0xbb16('0x4b')]);return db[_0xbb16('0x46')][_0xbb16('0x4c')](_0x5b1221)['then'](handleEntityNotFound(_0x2325ce,null))['then'](respondWithResult(_0x2325ce,null))[_0xbb16('0x49')](handleError(_0x2325ce,null));};exports['create']=function(_0x2f0c5e,_0x4e8498){return db['Dynamics365Field'][_0xbb16('0x4d')](_0x2f0c5e['body'],{})[_0xbb16('0x28')](respondWithResult(_0x4e8498,0xc9))[_0xbb16('0x49')](handleError(_0x4e8498,null));};exports[_0xbb16('0x27')]=function(_0xe4c371,_0x1c9571){if(_0xe4c371[_0xbb16('0x4e')]['id']){delete _0xe4c371[_0xbb16('0x4e')]['id'];}return db[_0xbb16('0x46')]['find']({'where':{'id':_0xe4c371['params']['id']}})[_0xbb16('0x28')](handleEntityNotFound(_0x1c9571,null))[_0xbb16('0x28')](saveUpdates(_0xe4c371[_0xbb16('0x4e')],null))[_0xbb16('0x28')](respondWithResult(_0x1c9571,null))[_0xbb16('0x49')](handleError(_0x1c9571,null));};exports[_0xbb16('0x29')]=function(_0x37abcb,_0x5074d1){return db[_0xbb16('0x46')][_0xbb16('0x4c')]({'where':{'id':_0x37abcb['params']['id']}})[_0xbb16('0x28')](handleEntityNotFound(_0x5074d1,null))[_0xbb16('0x28')](removeEntity(_0x5074d1,null))[_0xbb16('0x49')](handleError(_0x5074d1,null));};
\ No newline at end of file
+var _0x3c19=['fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3c19,0x14d));var _0x93c1=function(_0x49748c,_0x3d2005){_0x49748c=_0x49748c-0x0;var _0xedf6b6=_0x3c19[_0x49748c];return _0xedf6b6;};'use strict';var emlformat=require(_0x93c1('0x0'));var rimraf=require(_0x93c1('0x1'));var zipdir=require(_0x93c1('0x2'));var jsonpatch=require(_0x93c1('0x3'));var rp=require(_0x93c1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x93c1('0x5'));var util=require(_0x93c1('0x6'));var path=require(_0x93c1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x93c1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93c1('0x9'));var squel=require(_0x93c1('0xa'));var crypto=require(_0x93c1('0xb'));var jsforce=require(_0x93c1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x93c1('0xd'));var querystring=require('querystring');var Papa=require(_0x93c1('0xe'));var Redis=require(_0x93c1('0xf'));var authService=require(_0x93c1('0x10'));var qs=require(_0x93c1('0x11'));var as=require(_0x93c1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93c1('0x13'))(_0x93c1('0x14'));var utils=require('../../config/utils');var config=require(_0x93c1('0x15'));var licenseUtil=require(_0x93c1('0x16'));var db=require(_0x93c1('0x17'))['db'];function respondWithStatusCode(_0x255062,_0x2af2bf){_0x2af2bf=_0x2af2bf||0xcc;return function(_0x33261c){if(_0x33261c){return _0x255062[_0x93c1('0x18')](_0x2af2bf);}return _0x255062[_0x93c1('0x19')](_0x2af2bf)[_0x93c1('0x1a')]();};}function respondWithResult(_0x440755,_0x1336de){_0x1336de=_0x1336de||0xc8;return function(_0x108c03){if(_0x108c03){return _0x440755[_0x93c1('0x19')](_0x1336de)['json'](_0x108c03);}};}function respondWithFilteredResult(_0x37f90a,_0x4f87e9){return function(_0x426880){if(_0x426880){var _0x260eca=typeof _0x4f87e9[_0x93c1('0x1b')]==='undefined'&&typeof _0x4f87e9[_0x93c1('0x1c')]===_0x93c1('0x1d');var _0x411966=_0x426880[_0x93c1('0x1e')];var _0x18893e=_0x260eca?0x0:_0x4f87e9['offset'];var _0x4374bb=_0x260eca?_0x426880[_0x93c1('0x1e')]:_0x4f87e9['offset']+_0x4f87e9[_0x93c1('0x1c')];var _0xbf7d68;if(_0x4374bb>=_0x411966){_0x4374bb=_0x411966;_0xbf7d68=0xc8;}else{_0xbf7d68=0xce;}_0x37f90a[_0x93c1('0x19')](_0xbf7d68);return _0x37f90a[_0x93c1('0x1f')]('Content-Range',_0x18893e+'-'+_0x4374bb+'/'+_0x411966)[_0x93c1('0x20')](_0x426880);}return null;};}function patchUpdates(_0x219aad){return function(_0x213b75){try{jsonpatch[_0x93c1('0x21')](_0x213b75,_0x219aad,!![]);}catch(_0x5c8069){return BPromise[_0x93c1('0x22')](_0x5c8069);}return _0x213b75[_0x93c1('0x23')]();};}function saveUpdates(_0x5c8519,_0x4d6375){return function(_0x30fd44){if(_0x30fd44){return _0x30fd44[_0x93c1('0x24')](_0x5c8519)['then'](function(_0x1badcc){return _0x1badcc;});}return null;};}function removeEntity(_0x31e60d,_0x3fcfe6){return function(_0x488741){if(_0x488741){return _0x488741[_0x93c1('0x25')]()[_0x93c1('0x26')](function(){_0x31e60d[_0x93c1('0x19')](0xcc)[_0x93c1('0x1a')]();});}};}function handleEntityNotFound(_0x553fc1,_0x5ef08a){return function(_0x726c2){if(!_0x726c2){_0x553fc1[_0x93c1('0x18')](0x194);}return _0x726c2;};}function handleError(_0x1ff66d,_0x13da30){_0x13da30=_0x13da30||0x1f4;return function(_0x2172c5){logger[_0x93c1('0x27')](_0x2172c5[_0x93c1('0x28')]);if(_0x2172c5[_0x93c1('0x29')]){delete _0x2172c5[_0x93c1('0x29')];}_0x1ff66d[_0x93c1('0x19')](_0x13da30)[_0x93c1('0x2a')](_0x2172c5);};}exports[_0x93c1('0x2b')]=function(_0x52c338,_0x340cef){var _0x14b77f={},_0x1d5936={},_0x5bdf58={'count':0x0,'rows':[]};var _0x49cc6a=_[_0x93c1('0x2c')](db[_0x93c1('0x2d')][_0x93c1('0x2e')],function(_0x5bc828){return{'name':_0x5bc828[_0x93c1('0x2f')],'type':_0x5bc828[_0x93c1('0x30')]['key']};});_0x1d5936[_0x93c1('0x31')]=_[_0x93c1('0x2c')](_0x49cc6a,_0x93c1('0x29'));_0x1d5936['query']=_['keys'](_0x52c338[_0x93c1('0x32')]);_0x1d5936[_0x93c1('0x33')]=_[_0x93c1('0x34')](_0x1d5936[_0x93c1('0x31')],_0x1d5936[_0x93c1('0x32')]);_0x14b77f[_0x93c1('0x35')]=_[_0x93c1('0x34')](_0x1d5936[_0x93c1('0x31')],qs[_0x93c1('0x36')](_0x52c338['query'][_0x93c1('0x36')]));_0x14b77f[_0x93c1('0x35')]=_0x14b77f[_0x93c1('0x35')][_0x93c1('0x37')]?_0x14b77f[_0x93c1('0x35')]:_0x1d5936[_0x93c1('0x31')];if(!_0x52c338['query'][_0x93c1('0x38')](_0x93c1('0x39'))){_0x14b77f['limit']=qs[_0x93c1('0x1c')](_0x52c338[_0x93c1('0x32')]['limit']);_0x14b77f[_0x93c1('0x1b')]=qs[_0x93c1('0x1b')](_0x52c338[_0x93c1('0x32')]['offset']);}_0x14b77f[_0x93c1('0x3a')]=qs['sort'](_0x52c338[_0x93c1('0x32')][_0x93c1('0x3b')]);_0x14b77f[_0x93c1('0x3c')]=qs[_0x93c1('0x33')](_[_0x93c1('0x3d')](_0x52c338[_0x93c1('0x32')],_0x1d5936['filters']),_0x49cc6a);if(_0x52c338[_0x93c1('0x32')]['filter']){_0x14b77f[_0x93c1('0x3c')]=_[_0x93c1('0x3e')](_0x14b77f[_0x93c1('0x3c')],{'$or':_[_0x93c1('0x2c')](_0x49cc6a,function(_0x1aef5e){if(_0x1aef5e[_0x93c1('0x30')]!==_0x93c1('0x3f')){var _0x243f43={};_0x243f43[_0x1aef5e['name']]={'$like':'%'+_0x52c338['query'][_0x93c1('0x40')]+'%'};return _0x243f43;}})});}_0x14b77f=_[_0x93c1('0x3e')]({},_0x14b77f,_0x52c338['options']);var _0x25f738={'where':_0x14b77f['where']};return db['Dynamics365Field'][_0x93c1('0x1e')](_0x25f738)['then'](function(_0x266ff3){_0x5bdf58[_0x93c1('0x1e')]=_0x266ff3;if(_0x52c338[_0x93c1('0x32')][_0x93c1('0x41')]){_0x14b77f[_0x93c1('0x42')]=[{'all':!![]}];}return db[_0x93c1('0x2d')][_0x93c1('0x43')](_0x14b77f);})[_0x93c1('0x26')](function(_0x264be3){_0x5bdf58[_0x93c1('0x44')]=_0x264be3;return _0x5bdf58;})[_0x93c1('0x26')](respondWithFilteredResult(_0x340cef,_0x14b77f))['catch'](handleError(_0x340cef,null));};exports['show']=function(_0x3b708c,_0x18a86e){var _0xeab323={'raw':!![],'where':{'id':_0x3b708c[_0x93c1('0x45')]['id']}},_0x2532bc={};_0x2532bc[_0x93c1('0x31')]=_[_0x93c1('0x46')](db['Dynamics365Field'][_0x93c1('0x2e')]);_0x2532bc[_0x93c1('0x32')]=_['keys'](_0x3b708c[_0x93c1('0x32')]);_0x2532bc['filters']=_[_0x93c1('0x34')](_0x2532bc[_0x93c1('0x31')],_0x2532bc[_0x93c1('0x32')]);_0xeab323['attributes']=_[_0x93c1('0x34')](_0x2532bc[_0x93c1('0x31')],qs[_0x93c1('0x36')](_0x3b708c['query'][_0x93c1('0x36')]));_0xeab323[_0x93c1('0x35')]=_0xeab323[_0x93c1('0x35')][_0x93c1('0x37')]?_0xeab323['attributes']:_0x2532bc[_0x93c1('0x31')];if(_0x3b708c[_0x93c1('0x32')][_0x93c1('0x41')]){_0xeab323[_0x93c1('0x42')]=[{'all':!![]}];}_0xeab323=_['merge']({},_0xeab323,_0x3b708c[_0x93c1('0x47')]);return db['Dynamics365Field'][_0x93c1('0x48')](_0xeab323)['then'](handleEntityNotFound(_0x18a86e,null))['then'](respondWithResult(_0x18a86e,null))[_0x93c1('0x49')](handleError(_0x18a86e,null));};exports[_0x93c1('0x4a')]=function(_0x163f6e,_0x23c69e){return db['Dynamics365Field'][_0x93c1('0x4a')](_0x163f6e[_0x93c1('0x4b')],{})[_0x93c1('0x26')](respondWithResult(_0x23c69e,0xc9))[_0x93c1('0x49')](handleError(_0x23c69e,null));};exports[_0x93c1('0x24')]=function(_0x1cbd31,_0x473da8){if(_0x1cbd31[_0x93c1('0x4b')]['id']){delete _0x1cbd31[_0x93c1('0x4b')]['id'];}return db[_0x93c1('0x2d')][_0x93c1('0x48')]({'where':{'id':_0x1cbd31['params']['id']}})[_0x93c1('0x26')](handleEntityNotFound(_0x473da8,null))[_0x93c1('0x26')](saveUpdates(_0x1cbd31['body'],null))['then'](respondWithResult(_0x473da8,null))['catch'](handleError(_0x473da8,null));};exports[_0x93c1('0x25')]=function(_0xbf55a6,_0x340cb8){return db['Dynamics365Field'][_0x93c1('0x48')]({'where':{'id':_0xbf55a6[_0x93c1('0x45')]['id']}})[_0x93c1('0x26')](handleEntityNotFound(_0x340cb8,null))[_0x93c1('0x26')](removeEntity(_0x340cb8,null))['catch'](handleError(_0x340cb8,null));};
\ No newline at end of file
index 20bebcc..0620c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76e2=['rimraf','../../config/environment','./intDynamics365Field.attributes','exports','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path'];(function(_0x3ba470,_0x15bdea){var _0x382ef3=function(_0x5698be){while(--_0x5698be){_0x3ba470['push'](_0x3ba470['shift']());}};_0x382ef3(++_0x15bdea);}(_0x76e2,0xa3));var _0x276e=function(_0x2b7db4,_0x446ae1){_0x2b7db4=_0x2b7db4-0x0;var _0x576a15=_0x76e2[_0x2b7db4];return _0x576a15;};'use strict';var _=require(_0x276e('0x0'));var util=require(_0x276e('0x1'));var logger=require(_0x276e('0x2'))(_0x276e('0x3'));var moment=require(_0x276e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x276e('0x5'));var rimraf=require(_0x276e('0x6'));var config=require(_0x276e('0x7'));var attributes=require(_0x276e('0x8'));module[_0x276e('0x9')]=function(_0x59fc41,_0x475860){return _0x59fc41['define']('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x276e('0xa'),'fields':[_0x276e('0xb'),_0x276e('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb91c=['FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','Dynamics365Field','int_dynamics365_fields','idField'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0xb91c,0x121));var _0xcb91=function(_0xc2df68,_0x3817c9){_0xc2df68=_0xc2df68-0x0;var _0x3e83eb=_0xb91c[_0xc2df68];return _0x3e83eb;};'use strict';var _=require(_0xcb91('0x0'));var util=require(_0xcb91('0x1'));var logger=require(_0xcb91('0x2'))(_0xcb91('0x3'));var moment=require(_0xcb91('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb91('0x5'));var rimraf=require(_0xcb91('0x6'));var config=require(_0xcb91('0x7'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x45eeae,_0x39b3ef){return _0x45eeae['define'](_0xcb91('0x8'),attributes,{'tableName':_0xcb91('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xcb91('0xa'),_0xcb91('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ca88057..f962bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96c6=['http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client'];(function(_0x2c3c5e,_0x21977b){var _0x60493b=function(_0x39812b){while(--_0x39812b){_0x2c3c5e['push'](_0x2c3c5e['shift']());}};_0x60493b(++_0x21977b);}(_0x96c6,0x1d4));var _0x696c=function(_0xf23eb9,_0xfdad6f){_0xf23eb9=_0xf23eb9-0x0;var _0x296737=_0x96c6[_0xf23eb9];return _0x296737;};'use strict';var _=require(_0x696c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x696c('0x1'));var rs=require(_0x696c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x696c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x696c('0x4'));var config=require(_0x696c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x696c('0x6')][_0x696c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3065ba,_0x113701,_0xd8ba00){return new BPromise(function(_0x3aa54e,_0x24a48e){return client[_0x696c('0x8')](_0x3065ba,_0xd8ba00)[_0x696c('0x9')](function(_0x1deb46){logger[_0x696c('0xa')](_0x696c('0xb'),_0x113701,_0x696c('0xc'));logger[_0x696c('0xd')](_0x696c('0xe'),_0x113701,_0x696c('0xc'),JSON[_0x696c('0xf')](_0x1deb46));if(_0x1deb46[_0x696c('0x10')]){if(_0x1deb46['error']['code']===0x1f4){logger['error'](_0x696c('0xb'),_0x113701,_0x1deb46['error'][_0x696c('0x11')]);return _0x24a48e(_0x1deb46['error'][_0x696c('0x11')]);}logger[_0x696c('0x10')](_0x696c('0xb'),_0x113701,_0x1deb46[_0x696c('0x10')][_0x696c('0x11')]);return _0x3aa54e(_0x1deb46[_0x696c('0x10')][_0x696c('0x11')]);}else{logger[_0x696c('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x113701,_0x696c('0xc'));_0x3aa54e(_0x1deb46[_0x696c('0x12')][_0x696c('0x11')]);}})['catch'](function(_0x2d3103){logger['error'](_0x696c('0xb'),_0x113701,_0x2d3103);_0x24a48e(_0x2d3103);});});}
\ No newline at end of file
+var _0x0a16=['lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x38a0c9,_0xa51600){var _0x578f4f=function(_0x511d11){while(--_0x511d11){_0x38a0c9['push'](_0x38a0c9['shift']());}};_0x578f4f(++_0xa51600);}(_0x0a16,0x104));var _0x60a1=function(_0x2291e8,_0x2286f1){_0x2291e8=_0x2291e8-0x0;var _0x418dd9=_0x0a16[_0x2291e8];return _0x418dd9;};'use strict';var _=require(_0x60a1('0x0'));var util=require(_0x60a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x60a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60a1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x60a1('0x4'))('rpc');var config=require(_0x60a1('0x5'));var jayson=require(_0x60a1('0x6'));var client=jayson[_0x60a1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa103,_0x58900d,_0x2082b0){return new BPromise(function(_0x1f2023,_0x10025d){return client[_0x60a1('0x8')](_0x3aa103,_0x2082b0)[_0x60a1('0x9')](function(_0x4f8327){logger[_0x60a1('0xa')](_0x60a1('0xb'),_0x58900d,_0x60a1('0xc'));logger[_0x60a1('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x58900d,_0x60a1('0xc'),JSON[_0x60a1('0xe')](_0x4f8327));if(_0x4f8327[_0x60a1('0xf')]){if(_0x4f8327['error'][_0x60a1('0x10')]===0x1f4){logger[_0x60a1('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x58900d,_0x4f8327[_0x60a1('0xf')][_0x60a1('0x11')]);return _0x10025d(_0x4f8327[_0x60a1('0xf')]['message']);}logger[_0x60a1('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x58900d,_0x4f8327[_0x60a1('0xf')][_0x60a1('0x11')]);return _0x1f2023(_0x4f8327[_0x60a1('0xf')][_0x60a1('0x11')]);}else{logger[_0x60a1('0xa')](_0x60a1('0xb'),_0x58900d,_0x60a1('0xc'));_0x1f2023(_0x4f8327[_0x60a1('0x12')][_0x60a1('0x11')]);}})[_0x60a1('0x13')](function(_0x1c4b5e){logger[_0x60a1('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x58900d,_0x1c4b5e);_0x10025d(_0x1c4b5e);});});}
\ No newline at end of file
index e6c01ec..ef2dbfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc90=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','path'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xbc90,0x19e));var _0x0bc9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbc90[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0bc9('0x0'));var util=require('util');var path=require(_0x0bc9('0x1'));var timeout=require(_0x0bc9('0x2'));var express=require(_0x0bc9('0x3'));var router=express[_0x0bc9('0x4')]();var fs_extra=require(_0x0bc9('0x5'));var auth=require(_0x0bc9('0x6'));var interaction=require(_0x0bc9('0x7'));var config=require(_0x0bc9('0x8'));var controller=require(_0x0bc9('0x9'));router[_0x0bc9('0xa')]('/',auth[_0x0bc9('0xb')](),controller[_0x0bc9('0xc')]);router[_0x0bc9('0xa')](_0x0bc9('0xd'),auth[_0x0bc9('0xb')](),controller[_0x0bc9('0xe')]);router[_0x0bc9('0xa')](_0x0bc9('0xf'),auth[_0x0bc9('0xb')](),controller['getConfigurations']);router[_0x0bc9('0xa')](_0x0bc9('0x10'),auth[_0x0bc9('0xb')](),controller[_0x0bc9('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0bc9('0x12')]);router[_0x0bc9('0x13')](_0x0bc9('0xf'),auth['isAuthenticated'](),controller[_0x0bc9('0x14')]);router[_0x0bc9('0x15')](_0x0bc9('0xd'),auth['isAuthenticated'](),controller[_0x0bc9('0x16')]);router[_0x0bc9('0x17')](_0x0bc9('0xd'),auth[_0x0bc9('0xb')](),controller[_0x0bc9('0x18')]);module[_0x0bc9('0x19')]=router;
\ No newline at end of file
+var _0xde4d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','destroy','exports','multer','util'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0xde4d,0x157));var _0xdde4=function(_0x56eacc,_0xe3d32d){_0x56eacc=_0x56eacc-0x0;var _0x2d2491=_0xde4d[_0x56eacc];return _0x2d2491;};'use strict';var multer=require(_0xdde4('0x0'));var util=require(_0xdde4('0x1'));var path=require(_0xdde4('0x2'));var timeout=require(_0xdde4('0x3'));var express=require(_0xdde4('0x4'));var router=express[_0xdde4('0x5')]();var fs_extra=require(_0xdde4('0x6'));var auth=require(_0xdde4('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdde4('0x8'));router[_0xdde4('0x9')]('/',auth[_0xdde4('0xa')](),controller['index']);router[_0xdde4('0x9')]('/:id',auth[_0xdde4('0xa')](),controller[_0xdde4('0xb')]);router[_0xdde4('0x9')](_0xdde4('0xc'),auth[_0xdde4('0xa')](),controller[_0xdde4('0xd')]);router[_0xdde4('0x9')](_0xdde4('0xe'),auth[_0xdde4('0xa')](),controller[_0xdde4('0xf')]);router[_0xdde4('0x10')]('/',auth[_0xdde4('0xa')](),controller[_0xdde4('0x11')]);router[_0xdde4('0x10')](_0xdde4('0xc'),auth[_0xdde4('0xa')](),controller[_0xdde4('0x12')]);router['put'](_0xdde4('0x13'),auth[_0xdde4('0xa')](),controller[_0xdde4('0x14')]);router['delete'](_0xdde4('0x13'),auth[_0xdde4('0xa')](),controller[_0xdde4('0x15')]);module[_0xdde4('0x16')]=router;
\ No newline at end of file
index baf1b06..f41addf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x065e=['sequelize','STRING','username'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0x065e,0x1a7));var _0xe065=function(_0xf231d0,_0x13c159){_0xf231d0=_0xf231d0-0x0;var _0x472a9d=_0x065e[_0xf231d0];return _0x472a9d;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe065('0x1')],'unique':_0xe065('0x2')},'apiKey':{'type':Sequelize[_0xe065('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe065('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xb78e=['username','remoteUri','sequelize','exports','STRING'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xb78e,0x1c9));var _0xeb78=function(_0x31fa37,_0x2bb26f){_0x31fa37=_0x31fa37-0x0;var _0x5e664b=_0xb78e[_0x31fa37];return _0x5e664b;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb78('0x2')]},'username':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x3')},'apiKey':{'type':Sequelize[_0xeb78('0x2')]},'remoteUri':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x4')},'serverUrl':{'type':Sequelize[_0xeb78('0x2')],'allowNull':![]}};
\ No newline at end of file
index 663f93c..d9fb83d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa477=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','find','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','channel','create','FreshdeskField','Subjects','remoteUri','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64','requester','description','priority','source','ticket_type','company','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x4d5696,_0xd1d510){var _0x3be99c=function(_0x4a7b13){while(--_0x4a7b13){_0x4d5696['push'](_0x4d5696['shift']());}};_0x3be99c(++_0xd1d510);}(_0xa477,0xe6));var _0x7a47=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa477[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0x7a47('0x0'));var rimraf=require(_0x7a47('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a47('0x2'));var rp=require(_0x7a47('0x3'));var moment=require(_0x7a47('0x4'));var BPromise=require(_0x7a47('0x5'));var Mustache=require(_0x7a47('0x6'));var util=require(_0x7a47('0x7'));var path=require(_0x7a47('0x8'));var sox=require('sox');var csv=require(_0x7a47('0x9'));var ejs=require(_0x7a47('0xa'));var fs=require('fs');var fs_extra=require(_0x7a47('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7a47('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7a47('0x9'));var querystring=require(_0x7a47('0xd'));var Papa=require('papaparse');var Redis=require(_0x7a47('0xe'));var authService=require(_0x7a47('0xf'));var qs=require(_0x7a47('0x10'));var as=require(_0x7a47('0x11'));var hardwareService=require(_0x7a47('0x12'));var logger=require('../../config/logger')(_0x7a47('0x13'));var utils=require(_0x7a47('0x14'));var config=require(_0x7a47('0x15'));var licenseUtil=require(_0x7a47('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7a47('0x17'));function respondWithStatusCode(_0x3e9a80,_0x207b83){_0x207b83=_0x207b83||0xcc;return function(_0x55ce6b){if(_0x55ce6b){return _0x3e9a80[_0x7a47('0x18')](_0x207b83);}return _0x3e9a80[_0x7a47('0x19')](_0x207b83)[_0x7a47('0x1a')]();};}function respondWithResult(_0x1664c8,_0x519654){_0x519654=_0x519654||0xc8;return function(_0x276ca5){if(_0x276ca5){return _0x1664c8[_0x7a47('0x19')](_0x519654)[_0x7a47('0x1b')](_0x276ca5);}};}function respondWithFilteredResult(_0x1dccd3,_0x5b952d){return function(_0x467e42){if(_0x467e42){var _0x224e89=typeof _0x5b952d['offset']==='undefined'&&typeof _0x5b952d[_0x7a47('0x1c')]===_0x7a47('0x1d');var _0x23c20d=_0x467e42['count'];var _0x444c48=_0x224e89?0x0:_0x5b952d['offset'];var _0x203ab4=_0x224e89?_0x467e42[_0x7a47('0x1e')]:_0x5b952d[_0x7a47('0x1f')]+_0x5b952d[_0x7a47('0x1c')];var _0x160d28;if(_0x203ab4>=_0x23c20d){_0x203ab4=_0x23c20d;_0x160d28=0xc8;}else{_0x160d28=0xce;}_0x1dccd3[_0x7a47('0x19')](_0x160d28);return _0x1dccd3[_0x7a47('0x20')](_0x7a47('0x21'),_0x444c48+'-'+_0x203ab4+'/'+_0x23c20d)[_0x7a47('0x1b')](_0x467e42);}return null;};}function patchUpdates(_0x500204){return function(_0x192b20){try{jsonpatch[_0x7a47('0x22')](_0x192b20,_0x500204,!![]);}catch(_0x24992c){return BPromise[_0x7a47('0x23')](_0x24992c);}return _0x192b20[_0x7a47('0x24')]();};}function saveUpdates(_0x322426,_0x288660){return function(_0x267ef6){if(_0x267ef6){return _0x267ef6[_0x7a47('0x25')](_0x322426)[_0x7a47('0x26')](function(_0x1832be){return _0x1832be;});}return null;};}function removeEntity(_0xe9bb12,_0x4ec7ff){return function(_0x4ef642){if(_0x4ef642){return _0x4ef642[_0x7a47('0x27')]()[_0x7a47('0x26')](function(){_0xe9bb12[_0x7a47('0x19')](0xcc)[_0x7a47('0x1a')]();});}};}function handleEntityNotFound(_0x5f3bf6,_0xf26ed5){return function(_0x158cb7){if(!_0x158cb7){_0x5f3bf6['sendStatus'](0x194);}return _0x158cb7;};}function handleError(_0x8f961d,_0x324a85){_0x324a85=_0x324a85||0x1f4;return function(_0x43f7a9){logger[_0x7a47('0x28')](_0x43f7a9[_0x7a47('0x29')]);if(_0x43f7a9['name']){delete _0x43f7a9[_0x7a47('0x2a')];}_0x8f961d[_0x7a47('0x19')](_0x324a85)[_0x7a47('0x2b')](_0x43f7a9);};}exports[_0x7a47('0x2c')]=function(_0x5e99ab,_0x5ee0a2){var _0x5d4b9c={},_0x56a3ff={},_0x4551aa={'count':0x0,'rows':[]};var _0x437486=_[_0x7a47('0x2d')](db[_0x7a47('0x2e')][_0x7a47('0x2f')],function(_0x153f45){return{'name':_0x153f45[_0x7a47('0x30')],'type':_0x153f45[_0x7a47('0x31')][_0x7a47('0x32')]};});_0x56a3ff[_0x7a47('0x33')]=_[_0x7a47('0x2d')](_0x437486,_0x7a47('0x2a'));_0x56a3ff['query']=_[_0x7a47('0x34')](_0x5e99ab[_0x7a47('0x35')]);_0x56a3ff[_0x7a47('0x36')]=_[_0x7a47('0x37')](_0x56a3ff[_0x7a47('0x33')],_0x56a3ff['query']);_0x5d4b9c[_0x7a47('0x38')]=_[_0x7a47('0x37')](_0x56a3ff['model'],qs['fields'](_0x5e99ab[_0x7a47('0x35')]['fields']));_0x5d4b9c[_0x7a47('0x38')]=_0x5d4b9c[_0x7a47('0x38')][_0x7a47('0x39')]?_0x5d4b9c[_0x7a47('0x38')]:_0x56a3ff[_0x7a47('0x33')];if(!_0x5e99ab[_0x7a47('0x35')][_0x7a47('0x3a')](_0x7a47('0x3b'))){_0x5d4b9c[_0x7a47('0x1c')]=qs[_0x7a47('0x1c')](_0x5e99ab[_0x7a47('0x35')]['limit']);_0x5d4b9c[_0x7a47('0x1f')]=qs['offset'](_0x5e99ab[_0x7a47('0x35')][_0x7a47('0x1f')]);}_0x5d4b9c[_0x7a47('0x3c')]=qs[_0x7a47('0x3d')](_0x5e99ab[_0x7a47('0x35')][_0x7a47('0x3d')]);_0x5d4b9c['where']=qs['filters'](_[_0x7a47('0x3e')](_0x5e99ab[_0x7a47('0x35')],_0x56a3ff['filters']),_0x437486);if(_0x5e99ab['query'][_0x7a47('0x3f')]){_0x5d4b9c[_0x7a47('0x40')]=_[_0x7a47('0x41')](_0x5d4b9c['where'],{'$or':_[_0x7a47('0x2d')](_0x437486,function(_0x42cb51){if(_0x42cb51['type']!==_0x7a47('0x42')){var _0x3f3b61={};_0x3f3b61[_0x42cb51[_0x7a47('0x2a')]]={'$like':'%'+_0x5e99ab[_0x7a47('0x35')][_0x7a47('0x3f')]+'%'};return _0x3f3b61;}})});}_0x5d4b9c=_[_0x7a47('0x41')]({},_0x5d4b9c,_0x5e99ab[_0x7a47('0x43')]);var _0x41fe24={'where':_0x5d4b9c[_0x7a47('0x40')]};return db[_0x7a47('0x2e')][_0x7a47('0x1e')](_0x41fe24)[_0x7a47('0x26')](function(_0x257145){_0x4551aa[_0x7a47('0x1e')]=_0x257145;if(_0x5e99ab[_0x7a47('0x35')]['includeAll']){_0x5d4b9c[_0x7a47('0x44')]=[{'all':!![]}];}return db[_0x7a47('0x2e')][_0x7a47('0x45')](_0x5d4b9c);})[_0x7a47('0x26')](function(_0x4d3ad8){_0x4551aa[_0x7a47('0x46')]=_0x4d3ad8;return _0x4551aa;})[_0x7a47('0x26')](respondWithFilteredResult(_0x5ee0a2,_0x5d4b9c))[_0x7a47('0x47')](handleError(_0x5ee0a2,null));};exports[_0x7a47('0x48')]=function(_0x506184,_0x5ef164){var _0x46dd80={'raw':![],'where':{'id':_0x506184[_0x7a47('0x49')]['id']}},_0x898ad5={};_0x898ad5[_0x7a47('0x33')]=_[_0x7a47('0x34')](db[_0x7a47('0x2e')][_0x7a47('0x2f')]);_0x898ad5['query']=_['keys'](_0x506184[_0x7a47('0x35')]);_0x898ad5[_0x7a47('0x36')]=_[_0x7a47('0x37')](_0x898ad5[_0x7a47('0x33')],_0x898ad5[_0x7a47('0x35')]);_0x46dd80['attributes']=_['intersection'](_0x898ad5['model'],qs[_0x7a47('0x4a')](_0x506184[_0x7a47('0x35')]['fields']));_0x46dd80[_0x7a47('0x38')]=_0x46dd80[_0x7a47('0x38')][_0x7a47('0x39')]?_0x46dd80[_0x7a47('0x38')]:_0x898ad5[_0x7a47('0x33')];if(_0x506184[_0x7a47('0x35')][_0x7a47('0x4b')]){_0x46dd80[_0x7a47('0x44')]=[{'all':!![]}];}_0x46dd80=_[_0x7a47('0x41')]({},_0x46dd80,_0x506184['options']);return db['FreshdeskAccount'][_0x7a47('0x4c')](_0x46dd80)[_0x7a47('0x26')](handleEntityNotFound(_0x5ef164,null))[_0x7a47('0x26')](respondWithResult(_0x5ef164,null))[_0x7a47('0x47')](handleError(_0x5ef164,null));};exports['create']=function(_0x12a5d6,_0x1191ca){return db[_0x7a47('0x2e')]['create'](_0x12a5d6[_0x7a47('0x4d')],{})[_0x7a47('0x26')](respondWithResult(_0x1191ca,0xc9))[_0x7a47('0x47')](handleError(_0x1191ca,null));};exports['update']=function(_0x34be7b,_0x345e7e){if(_0x34be7b['body']['id']){delete _0x34be7b[_0x7a47('0x4d')]['id'];}return db[_0x7a47('0x2e')]['find']({'where':{'id':_0x34be7b['params']['id']}})['then'](handleEntityNotFound(_0x345e7e,null))[_0x7a47('0x26')](saveUpdates(_0x34be7b[_0x7a47('0x4d')],null))[_0x7a47('0x26')](respondWithResult(_0x345e7e,null))[_0x7a47('0x47')](handleError(_0x345e7e,null));};exports[_0x7a47('0x27')]=function(_0x1130b1,_0x4a025c){return db[_0x7a47('0x2e')]['find']({'where':{'id':_0x1130b1[_0x7a47('0x49')]['id']}})[_0x7a47('0x26')](handleEntityNotFound(_0x4a025c,null))[_0x7a47('0x26')](removeEntity(_0x4a025c,null))[_0x7a47('0x47')](handleError(_0x4a025c,null));};exports[_0x7a47('0x4e')]=function(_0x15de61,_0x460adc,_0x9d0605){var _0x597314={};var _0x378d8c={};var _0x5f4845;var _0xbd2b2c;return db[_0x7a47('0x2e')][_0x7a47('0x4f')]({'where':{'id':_0x15de61[_0x7a47('0x49')]['id']}})['then'](handleEntityNotFound(_0x460adc,null))[_0x7a47('0x26')](function(_0x5b72a1){if(_0x5b72a1){_0x5f4845=_0x5b72a1;_0x378d8c[_0x7a47('0x33')]=_['keys'](db[_0x7a47('0x50')][_0x7a47('0x2f')]);_0x378d8c[_0x7a47('0x35')]=_[_0x7a47('0x34')](_0x15de61['query']);_0x378d8c[_0x7a47('0x36')]=_['intersection'](_0x378d8c[_0x7a47('0x33')],_0x378d8c['query']);_0x597314[_0x7a47('0x38')]=_['intersection'](_0x378d8c['model'],qs['fields'](_0x15de61[_0x7a47('0x35')][_0x7a47('0x4a')]));_0x597314[_0x7a47('0x38')]=_0x597314[_0x7a47('0x38')]['length']?_0x597314[_0x7a47('0x38')]:_0x378d8c[_0x7a47('0x33')];_0x597314[_0x7a47('0x3c')]=qs[_0x7a47('0x3d')](_0x15de61[_0x7a47('0x35')][_0x7a47('0x3d')]);_0x597314['where']=qs[_0x7a47('0x36')](_[_0x7a47('0x3e')](_0x15de61[_0x7a47('0x35')],_0x378d8c[_0x7a47('0x36')]));if(_0x15de61['query'][_0x7a47('0x3f')]){_0x597314[_0x7a47('0x40')]=_[_0x7a47('0x41')](_0x597314['where'],{'$or':_['map'](_0x597314[_0x7a47('0x38')],function(_0xc32fb3){var _0x1fc70b={};_0x1fc70b[_0xc32fb3]={'$like':'%'+_0x15de61[_0x7a47('0x35')][_0x7a47('0x3f')]+'%'};return _0x1fc70b;})});}_0x597314=_[_0x7a47('0x41')]({},_0x597314,_0x15de61[_0x7a47('0x43')]);return _0x5f4845[_0x7a47('0x4e')](_0x597314);}})[_0x7a47('0x26')](function(_0x5bf627){if(_0x5bf627){_0xbd2b2c=_0x5bf627[_0x7a47('0x39')];if(!_0x15de61[_0x7a47('0x35')][_0x7a47('0x3a')](_0x7a47('0x3b'))){_0x597314[_0x7a47('0x1c')]=qs[_0x7a47('0x1c')](_0x15de61[_0x7a47('0x35')]['limit']);_0x597314['offset']=qs['offset'](_0x15de61[_0x7a47('0x35')][_0x7a47('0x1f')]);}return _0x5f4845[_0x7a47('0x4e')](_0x597314);}})['then'](function(_0x3b2ea9){if(_0x3b2ea9){return _0x3b2ea9?{'count':_0xbd2b2c,'rows':_0x3b2ea9}:null;}})['then'](respondWithResult(_0x460adc,null))[_0x7a47('0x47')](handleError(_0x460adc,null));};exports[_0x7a47('0x51')]=function(_0x1115ef,_0x20255c,_0x49e6b1){if(_0x1115ef[_0x7a47('0x4d')]['id']){delete _0x1115ef[_0x7a47('0x4d')]['id'];}return db['FreshdeskAccount'][_0x7a47('0x4f')]({'where':{'id':_0x1115ef[_0x7a47('0x49')]['id']}})[_0x7a47('0x26')](handleEntityNotFound(_0x20255c,null))['then'](function(_0x23abe6){if(_0x23abe6){_0x1115ef[_0x7a47('0x4d')][_0x7a47('0x52')]=_0x23abe6['id'];_0x1115ef[_0x7a47('0x4d')]['Subjects']=integrations[_0x7a47('0x53')](_0x1115ef['body']['channel'],_0x1115ef[_0x7a47('0x4d')][_0x7a47('0x31')]);_0x1115ef[_0x7a47('0x4d')][_0x7a47('0x54')]=integrations['getDescriptions'](_0x1115ef[_0x7a47('0x4d')][_0x7a47('0x55')],_0x1115ef[_0x7a47('0x4d')][_0x7a47('0x31')]);return db[_0x7a47('0x50')][_0x7a47('0x56')](_0x1115ef[_0x7a47('0x4d')],{'include':[{'model':db[_0x7a47('0x57')],'as':_0x7a47('0x58')},{'model':db[_0x7a47('0x57')],'as':_0x7a47('0x54')}]});}return null;})[_0x7a47('0x26')](respondWithResult(_0x20255c,null))['catch'](handleError(_0x20255c,null));};exports['getFields']=function(_0x221604,_0x2178db,_0x44b75b){var _0x4a962a='';return db['FreshdeskAccount'][_0x7a47('0x4f')]({'where':{'id':_0x221604['params']['id']},'attributes':['id',_0x7a47('0x59'),'apiKey']})[_0x7a47('0x26')](handleEntityNotFound(_0x2178db,null))[_0x7a47('0x26')](function(_0x44da5e){if(_0x44da5e){_0x4a962a=_0x44da5e['remoteUri'];var _0x36eff6=_0x4a962a[_0x7a47('0x5a')](-0x1);if(_0x36eff6==='/'){_0x4a962a=_0x4a962a[_0x7a47('0x5b')](0x0,_0x4a962a[_0x7a47('0x5c')](_0x36eff6));}return rp({'method':'GET','uri':util[_0x7a47('0x5d')](_0x7a47('0x5e'),_0x4a962a,_0x7a47('0x5f')),'headers':{'Authorization':util[_0x7a47('0x5d')](_0x7a47('0x60'),new Buffer(util['format'](_0x7a47('0x61'),_0x44da5e[_0x7a47('0x62')]))['toString'](_0x7a47('0x63')))},'json':!![]});}})[_0x7a47('0x26')](function(_0x188da7){if(_0x188da7){var _0x5d8264=[_0x7a47('0x64'),'subject','agent',_0x7a47('0x65'),_0x7a47('0x19'),_0x7a47('0x66'),'group',_0x7a47('0x67'),_0x7a47('0x68'),'group',_0x7a47('0x69')];_['remove'](_0x188da7,function(_0x498481){return _0x5d8264[_0x7a47('0x6a')](_0x498481[_0x7a47('0x2a')])||!_0x498481[_0x7a47('0x6b')]&&_0x498481[_0x7a47('0x31')]!==_0x7a47('0x6c')&&_0x498481[_0x7a47('0x31')]!=='custom_dropdown';});return{'count':_0x188da7[_0x7a47('0x39')],'rows':_['map'](_0x188da7,function(_0x1bec80){return{'id':_0x1bec80[_0x7a47('0x2a')],'name':_0x1bec80[_0x7a47('0x6d')],'custom':!_0x1bec80['default'],'options':_0x1bec80[_0x7a47('0x6e')]?_[_0x7a47('0x2d')](_0x1bec80[_0x7a47('0x6e')],function(_0x108f7c){return{'name':_[_0x7a47('0x6f')](_0x108f7c),'value':_0x108f7c};}):[]};})};}})[_0x7a47('0x26')](respondWithResult(_0x2178db,null))[_0x7a47('0x47')](function(_0x3e1a46){var _0x2c4dbe=_0x221604[_0x7a47('0x35')][_0x7a47('0x70')]?0x1f4:_0x3e1a46[_0x7a47('0x71')]||0x1f4;logger[_0x7a47('0x28')](_0x7a47('0x72'),_0x7a47('0x73'),_0x2c4dbe,JSON[_0x7a47('0x74')](_0x3e1a46));delete _0x3e1a46[_0x7a47('0x2a')];if(_0x2c4dbe===0x191){_0x2c4dbe=0x190;}_0x2178db[_0x7a47('0x19')](_0x2c4dbe)[_0x7a47('0x2b')](_0x221604[_0x7a47('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3e1a46[_0x7a47('0x71')]}:_0x3e1a46);});};
\ No newline at end of file
+var _0x6b72=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','filter','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','group','source','ticket_type','remove','includes','default','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','keys','query','filters'];(function(_0x251fa3,_0x4ad3da){var _0x56827a=function(_0x5718b4){while(--_0x5718b4){_0x251fa3['push'](_0x251fa3['shift']());}};_0x56827a(++_0x4ad3da);}(_0x6b72,0x19d));var _0x26b7=function(_0x322225,_0x183371){_0x322225=_0x322225-0x0;var _0x151655=_0x6b72[_0x322225];return _0x151655;};'use strict';var emlformat=require(_0x26b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26b7('0x1'));var jsonpatch=require(_0x26b7('0x2'));var rp=require('request-promise');var moment=require(_0x26b7('0x3'));var BPromise=require(_0x26b7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x26b7('0x5'));var sox=require(_0x26b7('0x6'));var csv=require(_0x26b7('0x7'));var ejs=require(_0x26b7('0x8'));var fs=require('fs');var fs_extra=require(_0x26b7('0x9'));var _=require(_0x26b7('0xa'));var squel=require(_0x26b7('0xb'));var crypto=require(_0x26b7('0xc'));var jsforce=require(_0x26b7('0xd'));var deskjs=require(_0x26b7('0xe'));var toCsv=require(_0x26b7('0x7'));var querystring=require('querystring');var Papa=require(_0x26b7('0xf'));var Redis=require(_0x26b7('0x10'));var authService=require(_0x26b7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x26b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26b7('0x13'))('api');var utils=require(_0x26b7('0x14'));var config=require(_0x26b7('0x15'));var licenseUtil=require(_0x26b7('0x16'));var db=require(_0x26b7('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2d1fd1,_0x3def02){_0x3def02=_0x3def02||0xcc;return function(_0x28cf6d){if(_0x28cf6d){return _0x2d1fd1[_0x26b7('0x18')](_0x3def02);}return _0x2d1fd1[_0x26b7('0x19')](_0x3def02)[_0x26b7('0x1a')]();};}function respondWithResult(_0x33b34d,_0xf54dee){_0xf54dee=_0xf54dee||0xc8;return function(_0x21094d){if(_0x21094d){return _0x33b34d[_0x26b7('0x19')](_0xf54dee)['json'](_0x21094d);}};}function respondWithFilteredResult(_0x3304b1,_0x42f377){return function(_0x1ed5c0){if(_0x1ed5c0){var _0x16d856=typeof _0x42f377['offset']===_0x26b7('0x1b')&&typeof _0x42f377[_0x26b7('0x1c')]===_0x26b7('0x1b');var _0x319bcd=_0x1ed5c0[_0x26b7('0x1d')];var _0x5d80bb=_0x16d856?0x0:_0x42f377[_0x26b7('0x1e')];var _0x243b09=_0x16d856?_0x1ed5c0[_0x26b7('0x1d')]:_0x42f377['offset']+_0x42f377['limit'];var _0x373182;if(_0x243b09>=_0x319bcd){_0x243b09=_0x319bcd;_0x373182=0xc8;}else{_0x373182=0xce;}_0x3304b1[_0x26b7('0x19')](_0x373182);return _0x3304b1[_0x26b7('0x1f')](_0x26b7('0x20'),_0x5d80bb+'-'+_0x243b09+'/'+_0x319bcd)['json'](_0x1ed5c0);}return null;};}function patchUpdates(_0x97e10d){return function(_0x458130){try{jsonpatch['apply'](_0x458130,_0x97e10d,!![]);}catch(_0x5bb0ae){return BPromise['reject'](_0x5bb0ae);}return _0x458130[_0x26b7('0x21')]();};}function saveUpdates(_0x30c116,_0x9327dd){return function(_0x1c9a44){if(_0x1c9a44){return _0x1c9a44[_0x26b7('0x22')](_0x30c116)['then'](function(_0x545109){return _0x545109;});}return null;};}function removeEntity(_0x499eb9,_0x105036){return function(_0xe57899){if(_0xe57899){return _0xe57899[_0x26b7('0x23')]()[_0x26b7('0x24')](function(){_0x499eb9[_0x26b7('0x19')](0xcc)[_0x26b7('0x1a')]();});}};}function handleEntityNotFound(_0x1b7b0d,_0x3a0ec0){return function(_0x348f70){if(!_0x348f70){_0x1b7b0d['sendStatus'](0x194);}return _0x348f70;};}function handleError(_0x49eade,_0x16562d){_0x16562d=_0x16562d||0x1f4;return function(_0x4981ae){logger[_0x26b7('0x25')](_0x4981ae[_0x26b7('0x26')]);if(_0x4981ae[_0x26b7('0x27')]){delete _0x4981ae[_0x26b7('0x27')];}_0x49eade[_0x26b7('0x19')](_0x16562d)[_0x26b7('0x28')](_0x4981ae);};}exports[_0x26b7('0x29')]=function(_0x38dff9,_0x47e14f){var _0x58f1ee={},_0x1080f5={},_0xb0d375={'count':0x0,'rows':[]};var _0x3d99e6=_[_0x26b7('0x2a')](db[_0x26b7('0x2b')][_0x26b7('0x2c')],function(_0x2edc29){return{'name':_0x2edc29[_0x26b7('0x2d')],'type':_0x2edc29[_0x26b7('0x2e')][_0x26b7('0x2f')]};});_0x1080f5['model']=_[_0x26b7('0x2a')](_0x3d99e6,_0x26b7('0x27'));_0x1080f5['query']=_[_0x26b7('0x30')](_0x38dff9[_0x26b7('0x31')]);_0x1080f5[_0x26b7('0x32')]=_[_0x26b7('0x33')](_0x1080f5[_0x26b7('0x34')],_0x1080f5[_0x26b7('0x31')]);_0x58f1ee['attributes']=_['intersection'](_0x1080f5[_0x26b7('0x34')],qs[_0x26b7('0x35')](_0x38dff9[_0x26b7('0x31')]['fields']));_0x58f1ee[_0x26b7('0x36')]=_0x58f1ee[_0x26b7('0x36')][_0x26b7('0x37')]?_0x58f1ee[_0x26b7('0x36')]:_0x1080f5[_0x26b7('0x34')];if(!_0x38dff9[_0x26b7('0x31')][_0x26b7('0x38')](_0x26b7('0x39'))){_0x58f1ee[_0x26b7('0x1c')]=qs[_0x26b7('0x1c')](_0x38dff9[_0x26b7('0x31')]['limit']);_0x58f1ee['offset']=qs[_0x26b7('0x1e')](_0x38dff9['query']['offset']);}_0x58f1ee[_0x26b7('0x3a')]=qs[_0x26b7('0x3b')](_0x38dff9[_0x26b7('0x31')]['sort']);_0x58f1ee[_0x26b7('0x3c')]=qs[_0x26b7('0x32')](_['pick'](_0x38dff9['query'],_0x1080f5['filters']),_0x3d99e6);if(_0x38dff9[_0x26b7('0x31')]['filter']){_0x58f1ee[_0x26b7('0x3c')]=_[_0x26b7('0x3d')](_0x58f1ee[_0x26b7('0x3c')],{'$or':_[_0x26b7('0x2a')](_0x3d99e6,function(_0x327033){if(_0x327033['type']!==_0x26b7('0x3e')){var _0x1bd170={};_0x1bd170[_0x327033[_0x26b7('0x27')]]={'$like':'%'+_0x38dff9['query']['filter']+'%'};return _0x1bd170;}})});}_0x58f1ee=_[_0x26b7('0x3d')]({},_0x58f1ee,_0x38dff9[_0x26b7('0x3f')]);var _0x4a60c2={'where':_0x58f1ee[_0x26b7('0x3c')]};return db[_0x26b7('0x2b')][_0x26b7('0x1d')](_0x4a60c2)[_0x26b7('0x24')](function(_0x34f035){_0xb0d375[_0x26b7('0x1d')]=_0x34f035;if(_0x38dff9[_0x26b7('0x31')][_0x26b7('0x40')]){_0x58f1ee[_0x26b7('0x41')]=[{'all':!![]}];}return db[_0x26b7('0x2b')][_0x26b7('0x42')](_0x58f1ee);})[_0x26b7('0x24')](function(_0x3a7013){_0xb0d375[_0x26b7('0x43')]=_0x3a7013;return _0xb0d375;})['then'](respondWithFilteredResult(_0x47e14f,_0x58f1ee))[_0x26b7('0x44')](handleError(_0x47e14f,null));};exports[_0x26b7('0x45')]=function(_0x23d5e5,_0x2b9d53){var _0xa5ee4b={'raw':![],'where':{'id':_0x23d5e5[_0x26b7('0x46')]['id']}},_0x2d530f={};_0x2d530f[_0x26b7('0x34')]=_['keys'](db[_0x26b7('0x2b')]['rawAttributes']);_0x2d530f['query']=_[_0x26b7('0x30')](_0x23d5e5[_0x26b7('0x31')]);_0x2d530f[_0x26b7('0x32')]=_[_0x26b7('0x33')](_0x2d530f['model'],_0x2d530f[_0x26b7('0x31')]);_0xa5ee4b['attributes']=_['intersection'](_0x2d530f['model'],qs[_0x26b7('0x35')](_0x23d5e5[_0x26b7('0x31')][_0x26b7('0x35')]));_0xa5ee4b[_0x26b7('0x36')]=_0xa5ee4b[_0x26b7('0x36')][_0x26b7('0x37')]?_0xa5ee4b[_0x26b7('0x36')]:_0x2d530f[_0x26b7('0x34')];if(_0x23d5e5[_0x26b7('0x31')]['includeAll']){_0xa5ee4b['include']=[{'all':!![]}];}_0xa5ee4b=_['merge']({},_0xa5ee4b,_0x23d5e5[_0x26b7('0x3f')]);return db['FreshdeskAccount'][_0x26b7('0x47')](_0xa5ee4b)['then'](handleEntityNotFound(_0x2b9d53,null))['then'](respondWithResult(_0x2b9d53,null))[_0x26b7('0x44')](handleError(_0x2b9d53,null));};exports[_0x26b7('0x48')]=function(_0x492cdb,_0x42d1ac){return db[_0x26b7('0x2b')][_0x26b7('0x48')](_0x492cdb[_0x26b7('0x49')],{})['then'](respondWithResult(_0x42d1ac,0xc9))[_0x26b7('0x44')](handleError(_0x42d1ac,null));};exports[_0x26b7('0x22')]=function(_0x255d4c,_0x9ae592){if(_0x255d4c[_0x26b7('0x49')]['id']){delete _0x255d4c['body']['id'];}return db[_0x26b7('0x2b')][_0x26b7('0x47')]({'where':{'id':_0x255d4c['params']['id']}})['then'](handleEntityNotFound(_0x9ae592,null))[_0x26b7('0x24')](saveUpdates(_0x255d4c[_0x26b7('0x49')],null))[_0x26b7('0x24')](respondWithResult(_0x9ae592,null))[_0x26b7('0x44')](handleError(_0x9ae592,null));};exports[_0x26b7('0x23')]=function(_0x1fface,_0x493a6a){return db['FreshdeskAccount'][_0x26b7('0x47')]({'where':{'id':_0x1fface[_0x26b7('0x46')]['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x493a6a,null))[_0x26b7('0x24')](removeEntity(_0x493a6a,null))[_0x26b7('0x44')](handleError(_0x493a6a,null));};exports[_0x26b7('0x4a')]=function(_0xa57771,_0x5dac79,_0x5d2dee){var _0x32f63a={};var _0x3ba751={};var _0x167e4f;var _0x5ba4fa;return db[_0x26b7('0x2b')][_0x26b7('0x4b')]({'where':{'id':_0xa57771[_0x26b7('0x46')]['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x5dac79,null))[_0x26b7('0x24')](function(_0x4e74d9){if(_0x4e74d9){_0x167e4f=_0x4e74d9;_0x3ba751[_0x26b7('0x34')]=_[_0x26b7('0x30')](db[_0x26b7('0x4c')][_0x26b7('0x2c')]);_0x3ba751[_0x26b7('0x31')]=_[_0x26b7('0x30')](_0xa57771[_0x26b7('0x31')]);_0x3ba751[_0x26b7('0x32')]=_[_0x26b7('0x33')](_0x3ba751[_0x26b7('0x34')],_0x3ba751[_0x26b7('0x31')]);_0x32f63a[_0x26b7('0x36')]=_[_0x26b7('0x33')](_0x3ba751[_0x26b7('0x34')],qs['fields'](_0xa57771[_0x26b7('0x31')][_0x26b7('0x35')]));_0x32f63a[_0x26b7('0x36')]=_0x32f63a[_0x26b7('0x36')]['length']?_0x32f63a[_0x26b7('0x36')]:_0x3ba751[_0x26b7('0x34')];_0x32f63a['order']=qs[_0x26b7('0x3b')](_0xa57771[_0x26b7('0x31')][_0x26b7('0x3b')]);_0x32f63a[_0x26b7('0x3c')]=qs[_0x26b7('0x32')](_[_0x26b7('0x4d')](_0xa57771[_0x26b7('0x31')],_0x3ba751[_0x26b7('0x32')]));if(_0xa57771['query'][_0x26b7('0x4e')]){_0x32f63a[_0x26b7('0x3c')]=_[_0x26b7('0x3d')](_0x32f63a['where'],{'$or':_[_0x26b7('0x2a')](_0x32f63a[_0x26b7('0x36')],function(_0x29ed07){var _0x58e58c={};_0x58e58c[_0x29ed07]={'$like':'%'+_0xa57771[_0x26b7('0x31')][_0x26b7('0x4e')]+'%'};return _0x58e58c;})});}_0x32f63a=_[_0x26b7('0x3d')]({},_0x32f63a,_0xa57771[_0x26b7('0x3f')]);return _0x167e4f[_0x26b7('0x4a')](_0x32f63a);}})[_0x26b7('0x24')](function(_0x1f89d2){if(_0x1f89d2){_0x5ba4fa=_0x1f89d2[_0x26b7('0x37')];if(!_0xa57771['query']['hasOwnProperty'](_0x26b7('0x39'))){_0x32f63a[_0x26b7('0x1c')]=qs['limit'](_0xa57771[_0x26b7('0x31')][_0x26b7('0x1c')]);_0x32f63a[_0x26b7('0x1e')]=qs[_0x26b7('0x1e')](_0xa57771[_0x26b7('0x31')][_0x26b7('0x1e')]);}return _0x167e4f[_0x26b7('0x4a')](_0x32f63a);}})['then'](function(_0x1deda6){if(_0x1deda6){return _0x1deda6?{'count':_0x5ba4fa,'rows':_0x1deda6}:null;}})[_0x26b7('0x24')](respondWithResult(_0x5dac79,null))['catch'](handleError(_0x5dac79,null));};exports['addConfiguration']=function(_0x83ec37,_0x241683,_0x200d23){if(_0x83ec37[_0x26b7('0x49')]['id']){delete _0x83ec37[_0x26b7('0x49')]['id'];}return db[_0x26b7('0x2b')]['findOne']({'where':{'id':_0x83ec37[_0x26b7('0x46')]['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x241683,null))['then'](function(_0x4f5b9f){if(_0x4f5b9f){_0x83ec37[_0x26b7('0x49')][_0x26b7('0x4f')]=_0x4f5b9f['id'];_0x83ec37[_0x26b7('0x49')][_0x26b7('0x50')]=integrations[_0x26b7('0x51')](_0x83ec37[_0x26b7('0x49')]['channel'],_0x83ec37['body']['type']);_0x83ec37[_0x26b7('0x49')][_0x26b7('0x52')]=integrations[_0x26b7('0x53')](_0x83ec37[_0x26b7('0x49')][_0x26b7('0x54')],_0x83ec37[_0x26b7('0x49')][_0x26b7('0x2e')]);return db[_0x26b7('0x4c')][_0x26b7('0x48')](_0x83ec37['body'],{'include':[{'model':db[_0x26b7('0x55')],'as':_0x26b7('0x50')},{'model':db[_0x26b7('0x55')],'as':'Descriptions'}]});}return null;})[_0x26b7('0x24')](respondWithResult(_0x241683,null))['catch'](handleError(_0x241683,null));};exports[_0x26b7('0x56')]=function(_0x1b219c,_0x2ba693,_0x302868){var _0x581c59='';return db[_0x26b7('0x2b')][_0x26b7('0x4b')]({'where':{'id':_0x1b219c['params']['id']},'attributes':['id',_0x26b7('0x57'),_0x26b7('0x58')]})[_0x26b7('0x24')](handleEntityNotFound(_0x2ba693,null))['then'](function(_0x9c7424){if(_0x9c7424){_0x581c59=_0x9c7424[_0x26b7('0x57')];var _0x2d5491=_0x581c59[_0x26b7('0x59')](-0x1);if(_0x2d5491==='/'){_0x581c59=_0x581c59[_0x26b7('0x5a')](0x0,_0x581c59[_0x26b7('0x5b')](_0x2d5491));}return rp({'method':_0x26b7('0x5c'),'uri':util[_0x26b7('0x5d')](_0x26b7('0x5e'),_0x581c59,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x26b7('0x5d')](_0x26b7('0x5f'),new Buffer(util['format'](_0x26b7('0x60'),_0x9c7424[_0x26b7('0x58')]))[_0x26b7('0x61')](_0x26b7('0x62')))},'json':!![]});}})[_0x26b7('0x24')](function(_0x1c01fe){if(_0x1c01fe){var _0x29bcdc=[_0x26b7('0x63'),_0x26b7('0x64'),_0x26b7('0x65'),'description',_0x26b7('0x19'),'priority',_0x26b7('0x66'),_0x26b7('0x67'),_0x26b7('0x68'),_0x26b7('0x66'),'company'];_[_0x26b7('0x69')](_0x1c01fe,function(_0x5b8305){return _0x29bcdc[_0x26b7('0x6a')](_0x5b8305[_0x26b7('0x27')])||!_0x5b8305[_0x26b7('0x6b')]&&_0x5b8305[_0x26b7('0x2e')]!=='custom_text'&&_0x5b8305[_0x26b7('0x2e')]!==_0x26b7('0x6c');});return{'count':_0x1c01fe[_0x26b7('0x37')],'rows':_['map'](_0x1c01fe,function(_0x3f8be7){return{'id':_0x3f8be7[_0x26b7('0x27')],'name':_0x3f8be7[_0x26b7('0x6d')],'custom':!_0x3f8be7[_0x26b7('0x6b')],'options':_0x3f8be7[_0x26b7('0x6e')]?_[_0x26b7('0x2a')](_0x3f8be7['choices'],function(_0x3c2cfb){return{'name':_['capitalize'](_0x3c2cfb),'value':_0x3c2cfb};}):[]};})};}})['then'](respondWithResult(_0x2ba693,null))[_0x26b7('0x44')](function(_0x2d9694){var _0x6b3591=_0x1b219c['query'][_0x26b7('0x6f')]?0x1f4:_0x2d9694[_0x26b7('0x70')]||0x1f4;logger['error'](_0x26b7('0x71'),'getFields',_0x6b3591,JSON[_0x26b7('0x72')](_0x2d9694));delete _0x2d9694['name'];if(_0x6b3591===0x191){_0x6b3591=0x190;}_0x2ba693[_0x26b7('0x19')](_0x6b3591)[_0x26b7('0x28')](_0x1b219c['query'][_0x26b7('0x6f')]?{'message':_0x26b7('0x73'),'statusCode':_0x2d9694[_0x26b7('0x70')]}:_0x2d9694);});};
\ No newline at end of file
index 898a92d..6af5cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a95=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment'];(function(_0x37897a,_0x1a355a){var _0x2701fb=function(_0x545c7e){while(--_0x545c7e){_0x37897a['push'](_0x37897a['shift']());}};_0x2701fb(++_0x1a355a);}(_0x8a95,0x7e));var _0x58a9=function(_0x2a4f19,_0x2e4e36){_0x2a4f19=_0x2a4f19-0x0;var _0x5eeefe=_0x8a95[_0x2a4f19];return _0x5eeefe;};'use strict';var _=require(_0x58a9('0x0'));var util=require('util');var logger=require(_0x58a9('0x1'))(_0x58a9('0x2'));var moment=require(_0x58a9('0x3'));var BPromise=require(_0x58a9('0x4'));var rp=require(_0x58a9('0x5'));var fs=require('fs');var path=require(_0x58a9('0x6'));var rimraf=require(_0x58a9('0x7'));var config=require(_0x58a9('0x8'));var attributes=require(_0x58a9('0x9'));var integrations=require(_0x58a9('0xa'));module['exports']=function(_0x58d24f,_0x183b5b){return _0x58d24f['define'](_0x58a9('0xb'),attributes,{'tableName':_0x58a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1bef=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x41b0c6,_0x53a1fd){var _0x4e117d=function(_0x122804){while(--_0x122804){_0x41b0c6['push'](_0x41b0c6['shift']());}};_0x4e117d(++_0x53a1fd);}(_0x1bef,0x10d));var _0xf1be=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1bef[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf1be('0x0'));var util=require(_0xf1be('0x1'));var logger=require(_0xf1be('0x2'))(_0xf1be('0x3'));var moment=require(_0xf1be('0x4'));var BPromise=require(_0xf1be('0x5'));var rp=require(_0xf1be('0x6'));var fs=require('fs');var path=require(_0xf1be('0x7'));var rimraf=require(_0xf1be('0x8'));var config=require(_0xf1be('0x9'));var attributes=require(_0xf1be('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5d810f,_0x16d8e1){return _0x5d810f[_0xf1be('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xf1be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ba7b194..aaf361c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x991b=['limit','include','model','map','ShowFreshdeskAccount','find','raw','where','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFreshdeskAccount','findAll','options','attributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x991b,0x6b));var _0xb991=function(_0x54d68c,_0x30703c){_0x54d68c=_0x54d68c-0x0;var _0xaa7400=_0x991b[_0x54d68c];return _0xaa7400;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb991('0x0'));var rs=require(_0xb991('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb991('0x2'))['db'];var utils=require(_0xb991('0x3'));var logger=require(_0xb991('0x4'))('rpc');var config=require(_0xb991('0x5'));var jayson=require(_0xb991('0x6'));var client=jayson[_0xb991('0x7')][_0xb991('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51bbf1,_0xe91086,_0x4eca74){return new BPromise(function(_0x47450f,_0x26bafa){return client[_0xb991('0x9')](_0x51bbf1,_0x4eca74)[_0xb991('0xa')](function(_0x204ed6){logger[_0xb991('0xb')](_0xb991('0xc'),_0xe91086,'request\x20sent');logger[_0xb991('0xd')](_0xb991('0xe'),_0xe91086,'request\x20sent',JSON[_0xb991('0xf')](_0x204ed6));if(_0x204ed6['error']){if(_0x204ed6[_0xb991('0x10')][_0xb991('0x11')]===0x1f4){logger[_0xb991('0x10')](_0xb991('0xc'),_0xe91086,_0x204ed6[_0xb991('0x10')][_0xb991('0x12')]);return _0x26bafa(_0x204ed6[_0xb991('0x10')][_0xb991('0x12')]);}logger[_0xb991('0x10')](_0xb991('0xc'),_0xe91086,_0x204ed6['error'][_0xb991('0x12')]);return _0x47450f(_0x204ed6[_0xb991('0x10')][_0xb991('0x12')]);}else{logger[_0xb991('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0xe91086,_0xb991('0x13'));_0x47450f(_0x204ed6['result']['message']);}})[_0xb991('0x14')](function(_0x57c927){logger[_0xb991('0x10')](_0xb991('0xc'),_0xe91086,_0x57c927);_0x26bafa(_0x57c927);});});}exports[_0xb991('0x15')]=function(_0x86cadf){var _0x57af8f=this;return new Promise(function(_0x39e1bd,_0x2990b0){return db['FreshdeskAccount'][_0xb991('0x16')]({'raw':_0x86cadf['options']?_0x86cadf['options']['raw']===undefined?!![]:![]:!![],'where':_0x86cadf[_0xb991('0x17')]?_0x86cadf[_0xb991('0x17')]['where']||null:null,'attributes':_0x86cadf[_0xb991('0x17')]?_0x86cadf[_0xb991('0x17')][_0xb991('0x18')]||null:null,'limit':_0x86cadf[_0xb991('0x17')]?_0x86cadf[_0xb991('0x17')][_0xb991('0x19')]||null:null,'include':_0x86cadf[_0xb991('0x17')]?_0x86cadf['options'][_0xb991('0x1a')]?_['map'](_0x86cadf[_0xb991('0x17')]['include'],function(_0xa2a7ba){return{'model':db[_0xa2a7ba[_0xb991('0x1b')]],'as':_0xa2a7ba['as'],'attributes':_0xa2a7ba['attributes'],'include':_0xa2a7ba[_0xb991('0x1a')]?_[_0xb991('0x1c')](_0xa2a7ba[_0xb991('0x1a')],function(_0x247f40){return{'model':db[_0x247f40[_0xb991('0x1b')]],'as':_0x247f40['as'],'attributes':_0x247f40['attributes'],'include':_0x247f40[_0xb991('0x1a')]?_[_0xb991('0x1c')](_0x247f40[_0xb991('0x1a')],function(_0x26b236){return{'model':db[_0x26b236['model']],'as':_0x26b236['as'],'attributes':_0x26b236[_0xb991('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb991('0xa')](function(_0x734154){logger[_0xb991('0xb')](_0xb991('0x15'),_0x86cadf);logger['debug']('GetFreshdeskAccount',_0x86cadf,JSON[_0xb991('0xf')](_0x734154));_0x39e1bd(_0x734154);})[_0xb991('0x14')](function(_0x36c12e){logger[_0xb991('0x10')](_0xb991('0x15'),_0x36c12e[_0xb991('0x12')],_0x86cadf);_0x2990b0(_0x57af8f[_0xb991('0x10')](0x1f4,_0x36c12e[_0xb991('0x12')]));});});};exports[_0xb991('0x1d')]=function(_0x5a3dd7){var _0x4b2fbf=this;return new Promise(function(_0x217e76,_0x291fc1){return db['FreshdeskAccount'][_0xb991('0x1e')]({'raw':_0x5a3dd7[_0xb991('0x17')]?_0x5a3dd7[_0xb991('0x17')][_0xb991('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a3dd7[_0xb991('0x17')]?_0x5a3dd7[_0xb991('0x17')][_0xb991('0x20')]||null:null,'attributes':_0x5a3dd7[_0xb991('0x17')]?_0x5a3dd7[_0xb991('0x17')]['attributes']||null:null,'include':_0x5a3dd7[_0xb991('0x17')]?_0x5a3dd7[_0xb991('0x17')][_0xb991('0x1a')]?_['map'](_0x5a3dd7['options'][_0xb991('0x1a')],function(_0x38a58a){return{'model':db[_0x38a58a[_0xb991('0x1b')]],'as':_0x38a58a['as'],'attributes':_0x38a58a[_0xb991('0x18')],'include':_0x38a58a[_0xb991('0x1a')]?_[_0xb991('0x1c')](_0x38a58a[_0xb991('0x1a')],function(_0x24dc08){return{'model':db[_0x24dc08[_0xb991('0x1b')]],'as':_0x24dc08['as'],'attributes':_0x24dc08[_0xb991('0x18')],'include':_0x24dc08['include']?_[_0xb991('0x1c')](_0x24dc08[_0xb991('0x1a')],function(_0x3e80a8){return{'model':db[_0x3e80a8['model']],'as':_0x3e80a8['as'],'attributes':_0x3e80a8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16bcc0){logger[_0xb991('0xb')](_0xb991('0x1d'),_0x5a3dd7);logger[_0xb991('0xd')](_0xb991('0x1d'),_0x5a3dd7,JSON['stringify'](_0x16bcc0));_0x217e76(_0x16bcc0);})['catch'](function(_0x4aad33){logger[_0xb991('0x10')](_0xb991('0x1d'),_0x4aad33['message'],_0x5a3dd7);_0x291fc1(_0x4b2fbf['error'](0x1f4,_0x4aad33[_0xb991('0x12')]));});});};
\ No newline at end of file
+var _0x7a01=['error','message','request\x20sent','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetFreshdeskAccount','debug','stringify','ShowFreshdeskAccount','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1a86a2,_0x39a5dc){var _0x440952=function(_0x1b2bf2){while(--_0x1b2bf2){_0x1a86a2['push'](_0x1a86a2['shift']());}};_0x440952(++_0x39a5dc);}(_0x7a01,0x1f0));var _0x17a0=function(_0x36a9ef,_0x5dfce0){_0x36a9ef=_0x36a9ef-0x0;var _0x389099=_0x7a01[_0x36a9ef];return _0x389099;};'use strict';var _=require(_0x17a0('0x0'));var util=require(_0x17a0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17a0('0x2'));var db=require(_0x17a0('0x3'))['db'];var utils=require(_0x17a0('0x4'));var logger=require(_0x17a0('0x5'))(_0x17a0('0x6'));var config=require(_0x17a0('0x7'));var jayson=require(_0x17a0('0x8'));var client=jayson[_0x17a0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28c874,_0x398ec7,_0x523088){return new BPromise(function(_0x3b038b,_0x15430d){return client['request'](_0x28c874,_0x523088)[_0x17a0('0xa')](function(_0x43b4d0){logger[_0x17a0('0xb')](_0x17a0('0xc'),_0x398ec7,'request\x20sent');logger['debug'](_0x17a0('0xd'),_0x398ec7,'request\x20sent',JSON['stringify'](_0x43b4d0));if(_0x43b4d0[_0x17a0('0xe')]){if(_0x43b4d0['error']['code']===0x1f4){logger[_0x17a0('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x398ec7,_0x43b4d0[_0x17a0('0xe')][_0x17a0('0xf')]);return _0x15430d(_0x43b4d0[_0x17a0('0xe')][_0x17a0('0xf')]);}logger['error'](_0x17a0('0xc'),_0x398ec7,_0x43b4d0[_0x17a0('0xe')][_0x17a0('0xf')]);return _0x3b038b(_0x43b4d0[_0x17a0('0xe')][_0x17a0('0xf')]);}else{logger[_0x17a0('0xb')](_0x17a0('0xc'),_0x398ec7,_0x17a0('0x10'));_0x3b038b(_0x43b4d0[_0x17a0('0x11')][_0x17a0('0xf')]);}})[_0x17a0('0x12')](function(_0x16be13){logger[_0x17a0('0xe')](_0x17a0('0xc'),_0x398ec7,_0x16be13);_0x15430d(_0x16be13);});});}exports['GetFreshdeskAccount']=function(_0x1aba4a){var _0x1141b7=this;return new Promise(function(_0x54801b,_0x5da021){return db[_0x17a0('0x13')][_0x17a0('0x14')]({'raw':_0x1aba4a[_0x17a0('0x15')]?_0x1aba4a[_0x17a0('0x15')][_0x17a0('0x16')]===undefined?!![]:![]:!![],'where':_0x1aba4a[_0x17a0('0x15')]?_0x1aba4a[_0x17a0('0x15')][_0x17a0('0x17')]||null:null,'attributes':_0x1aba4a[_0x17a0('0x15')]?_0x1aba4a[_0x17a0('0x15')][_0x17a0('0x18')]||null:null,'limit':_0x1aba4a['options']?_0x1aba4a[_0x17a0('0x15')][_0x17a0('0x19')]||null:null,'include':_0x1aba4a[_0x17a0('0x15')]?_0x1aba4a['options']['include']?_[_0x17a0('0x1a')](_0x1aba4a['options'][_0x17a0('0x1b')],function(_0x4d94be){return{'model':db[_0x4d94be[_0x17a0('0x1c')]],'as':_0x4d94be['as'],'attributes':_0x4d94be[_0x17a0('0x18')],'include':_0x4d94be['include']?_[_0x17a0('0x1a')](_0x4d94be[_0x17a0('0x1b')],function(_0x5efdc3){return{'model':db[_0x5efdc3[_0x17a0('0x1c')]],'as':_0x5efdc3['as'],'attributes':_0x5efdc3[_0x17a0('0x18')],'include':_0x5efdc3[_0x17a0('0x1b')]?_[_0x17a0('0x1a')](_0x5efdc3['include'],function(_0x81a590){return{'model':db[_0x81a590[_0x17a0('0x1c')]],'as':_0x81a590['as'],'attributes':_0x81a590[_0x17a0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x17a0('0xa')](function(_0x2d8ce7){logger[_0x17a0('0xb')](_0x17a0('0x1d'),_0x1aba4a);logger[_0x17a0('0x1e')](_0x17a0('0x1d'),_0x1aba4a,JSON[_0x17a0('0x1f')](_0x2d8ce7));_0x54801b(_0x2d8ce7);})[_0x17a0('0x12')](function(_0x18d200){logger[_0x17a0('0xe')](_0x17a0('0x1d'),_0x18d200[_0x17a0('0xf')],_0x1aba4a);_0x5da021(_0x1141b7[_0x17a0('0xe')](0x1f4,_0x18d200['message']));});});};exports[_0x17a0('0x20')]=function(_0x492439){var _0x79ce28=this;return new Promise(function(_0x3b0d42,_0x159f0d){return db[_0x17a0('0x13')][_0x17a0('0x21')]({'raw':_0x492439[_0x17a0('0x15')]?_0x492439[_0x17a0('0x15')][_0x17a0('0x16')]===undefined?!![]:![]:!![],'where':_0x492439['options']?_0x492439[_0x17a0('0x15')][_0x17a0('0x17')]||null:null,'attributes':_0x492439[_0x17a0('0x15')]?_0x492439[_0x17a0('0x15')][_0x17a0('0x18')]||null:null,'include':_0x492439[_0x17a0('0x15')]?_0x492439[_0x17a0('0x15')]['include']?_[_0x17a0('0x1a')](_0x492439[_0x17a0('0x15')][_0x17a0('0x1b')],function(_0x40233c){return{'model':db[_0x40233c[_0x17a0('0x1c')]],'as':_0x40233c['as'],'attributes':_0x40233c[_0x17a0('0x18')],'include':_0x40233c['include']?_[_0x17a0('0x1a')](_0x40233c['include'],function(_0x5d115f){return{'model':db[_0x5d115f['model']],'as':_0x5d115f['as'],'attributes':_0x5d115f[_0x17a0('0x18')],'include':_0x5d115f['include']?_['map'](_0x5d115f['include'],function(_0x32da54){return{'model':db[_0x32da54['model']],'as':_0x32da54['as'],'attributes':_0x32da54[_0x17a0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x17a0('0xa')](function(_0x3854af){logger[_0x17a0('0xb')](_0x17a0('0x20'),_0x492439);logger[_0x17a0('0x1e')](_0x17a0('0x20'),_0x492439,JSON['stringify'](_0x3854af));_0x3b0d42(_0x3854af);})[_0x17a0('0x12')](function(_0x29e887){logger[_0x17a0('0xe')]('ShowFreshdeskAccount',_0x29e887['message'],_0x492439);_0x159f0d(_0x79ce28[_0x17a0('0xe')](0x1f4,_0x29e887[_0x17a0('0xf')]));});});};
\ No newline at end of file
index 633e147..acf32f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8471=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x24df62,_0x5e7282){var _0x539e27=function(_0x416f38){while(--_0x416f38){_0x24df62['push'](_0x24df62['shift']());}};_0x539e27(++_0x5e7282);}(_0x8471,0x131));var _0x1847=function(_0x501675,_0xdcad3a){_0x501675=_0x501675-0x0;var _0x9ad3b6=_0x8471[_0x501675];return _0x9ad3b6;};'use strict';var multer=require(_0x1847('0x0'));var util=require(_0x1847('0x1'));var path=require(_0x1847('0x2'));var timeout=require(_0x1847('0x3'));var express=require(_0x1847('0x4'));var router=express[_0x1847('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1847('0x6'));var interaction=require(_0x1847('0x7'));var config=require(_0x1847('0x8'));var controller=require(_0x1847('0x9'));router[_0x1847('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1847('0xa')](_0x1847('0xb'),auth[_0x1847('0xc')](),controller[_0x1847('0xd')]);router[_0x1847('0xa')](_0x1847('0xe'),auth['isAuthenticated'](),controller[_0x1847('0xf')]);router[_0x1847('0xa')](_0x1847('0x10'),auth[_0x1847('0xc')](),controller[_0x1847('0x11')]);router[_0x1847('0xa')](_0x1847('0x12'),auth[_0x1847('0xc')](),controller[_0x1847('0x13')]);router['get'](_0x1847('0x14'),auth[_0x1847('0xc')](),controller[_0x1847('0x15')]);router[_0x1847('0x16')]('/',auth['isAuthenticated'](),controller[_0x1847('0x17')]);router['post']('/:id/tags',auth[_0x1847('0xc')](),controller['setTags']);router[_0x1847('0x18')](_0x1847('0xb'),auth[_0x1847('0xc')](),controller[_0x1847('0x19')]);router['delete'](_0x1847('0xb'),auth[_0x1847('0xc')](),controller[_0x1847('0x1a')]);module[_0x1847('0x1b')]=router;
\ No newline at end of file
+var _0x3449=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x559e7b,_0x5de086){var _0xcba747=function(_0x1f980f){while(--_0x1f980f){_0x559e7b['push'](_0x559e7b['shift']());}};_0xcba747(++_0x5de086);}(_0x3449,0x7d));var _0x9344=function(_0x576d7e,_0xee99bd){_0x576d7e=_0x576d7e-0x0;var _0x100258=_0x3449[_0x576d7e];return _0x100258;};'use strict';var multer=require(_0x9344('0x0'));var util=require(_0x9344('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9344('0x2'));var router=express['Router']();var fs_extra=require(_0x9344('0x3'));var auth=require(_0x9344('0x4'));var interaction=require(_0x9344('0x5'));var config=require(_0x9344('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x9344('0x7')]('/',auth[_0x9344('0x8')](),controller[_0x9344('0x9')]);router['get'](_0x9344('0xa'),auth[_0x9344('0x8')](),controller[_0x9344('0xb')]);router[_0x9344('0x7')](_0x9344('0xc'),auth['isAuthenticated'](),controller[_0x9344('0xd')]);router[_0x9344('0x7')](_0x9344('0xe'),auth[_0x9344('0x8')](),controller[_0x9344('0xf')]);router[_0x9344('0x7')](_0x9344('0x10'),auth['isAuthenticated'](),controller[_0x9344('0x11')]);router[_0x9344('0x7')](_0x9344('0x12'),auth[_0x9344('0x8')](),controller[_0x9344('0x13')]);router[_0x9344('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9344('0x14')](_0x9344('0x12'),auth['isAuthenticated'](),controller[_0x9344('0x15')]);router[_0x9344('0x16')](_0x9344('0xa'),auth[_0x9344('0x8')](),controller[_0x9344('0x17')]);router[_0x9344('0x18')](_0x9344('0xa'),auth[_0x9344('0x8')](),controller[_0x9344('0x19')]);module['exports']=router;
\ No newline at end of file
index dfff659..588056e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4905=['exports','STRING','sequelize'];(function(_0x59d12e,_0x1128ff){var _0x2f5ee4=function(_0x213beb){while(--_0x213beb){_0x59d12e['push'](_0x59d12e['shift']());}};_0x2f5ee4(++_0x1128ff);}(_0x4905,0x1e5));var _0x5490=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x4905[_0x287a47];return _0x3fb726;};'use strict';var Sequelize=require(_0x5490('0x0'));module[_0x5490('0x1')]={'name':{'type':Sequelize[_0x5490('0x2')]},'description':{'type':Sequelize[_0x5490('0x2')]}};
\ No newline at end of file
+var _0x5d74=['exports','STRING'];(function(_0x5cd34f,_0x25d570){var _0x4bc23f=function(_0xb94fbb){while(--_0xb94fbb){_0x5cd34f['push'](_0x5cd34f['shift']());}};_0x4bc23f(++_0x25d570);}(_0x5d74,0xf0));var _0x45d7=function(_0xd765d4,_0x3068d9){_0xd765d4=_0xd765d4-0x0;var _0x3b180a=_0x5d74[_0xd765d4];return _0x3b180a;};'use strict';var Sequelize=require('sequelize');module[_0x45d7('0x0')]={'name':{'type':Sequelize[_0x45d7('0x1')]},'description':{'type':Sequelize[_0x45d7('0x1')]}};
\ No newline at end of file
index 6205130..b541a5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbde8=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','options','includeAll','include','findAll','rows','params','merge','find','create','catch','body','destroy','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','hasOwnProperty','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbde8,0xf2));var _0x8bde=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0xbde8[_0x4e0a03];return _0x2478fc;};'use strict';var emlformat=require(_0x8bde('0x0'));var rimraf=require(_0x8bde('0x1'));var zipdir=require(_0x8bde('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bde('0x3'));var moment=require(_0x8bde('0x4'));var BPromise=require(_0x8bde('0x5'));var Mustache=require('mustache');var util=require(_0x8bde('0x6'));var path=require(_0x8bde('0x7'));var sox=require(_0x8bde('0x8'));var csv=require('to-csv');var ejs=require(_0x8bde('0x9'));var fs=require('fs');var fs_extra=require(_0x8bde('0xa'));var _=require(_0x8bde('0xb'));var squel=require(_0x8bde('0xc'));var crypto=require('crypto');var jsforce=require(_0x8bde('0xd'));var deskjs=require(_0x8bde('0xe'));var toCsv=require(_0x8bde('0xf'));var querystring=require(_0x8bde('0x10'));var Papa=require(_0x8bde('0x11'));var Redis=require(_0x8bde('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bde('0x13'));var hardwareService=require(_0x8bde('0x14'));var logger=require(_0x8bde('0x15'))(_0x8bde('0x16'));var utils=require(_0x8bde('0x17'));var config=require(_0x8bde('0x18'));var licenseUtil=require(_0x8bde('0x19'));var db=require(_0x8bde('0x1a'))['db'];function respondWithStatusCode(_0x52246c,_0x1f4d3c){_0x1f4d3c=_0x1f4d3c||0xcc;return function(_0x839d22){if(_0x839d22){return _0x52246c['sendStatus'](_0x1f4d3c);}return _0x52246c[_0x8bde('0x1b')](_0x1f4d3c)[_0x8bde('0x1c')]();};}function respondWithResult(_0x3b590c,_0x166e21){_0x166e21=_0x166e21||0xc8;return function(_0x1126df){if(_0x1126df){return _0x3b590c[_0x8bde('0x1b')](_0x166e21)[_0x8bde('0x1d')](_0x1126df);}};}function respondWithFilteredResult(_0x2b8748,_0x3641b3){return function(_0x2b50ac){if(_0x2b50ac){var _0x4cd2dc=typeof _0x3641b3[_0x8bde('0x1e')]===_0x8bde('0x1f')&&typeof _0x3641b3['limit']===_0x8bde('0x1f');var _0x12e921=_0x2b50ac['count'];var _0x1d1212=_0x4cd2dc?0x0:_0x3641b3[_0x8bde('0x1e')];var _0x122945=_0x4cd2dc?_0x2b50ac[_0x8bde('0x20')]:_0x3641b3['offset']+_0x3641b3[_0x8bde('0x21')];var _0x4c324d;if(_0x122945>=_0x12e921){_0x122945=_0x12e921;_0x4c324d=0xc8;}else{_0x4c324d=0xce;}_0x2b8748[_0x8bde('0x1b')](_0x4c324d);return _0x2b8748[_0x8bde('0x22')]('Content-Range',_0x1d1212+'-'+_0x122945+'/'+_0x12e921)[_0x8bde('0x1d')](_0x2b50ac);}return null;};}function patchUpdates(_0x377ad4){return function(_0x392791){try{jsonpatch[_0x8bde('0x23')](_0x392791,_0x377ad4,!![]);}catch(_0x520e42){return BPromise['reject'](_0x520e42);}return _0x392791[_0x8bde('0x24')]();};}function saveUpdates(_0x403ed0,_0x282f6f){return function(_0xc41c72){if(_0xc41c72){return _0xc41c72[_0x8bde('0x25')](_0x403ed0)[_0x8bde('0x26')](function(_0x46367d){return _0x46367d;});}return null;};}function removeEntity(_0x31d1ed,_0x4bb3){return function(_0x247cbb){if(_0x247cbb){return _0x247cbb['destroy']()[_0x8bde('0x26')](function(){_0x31d1ed[_0x8bde('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x999367,_0x35fc8c){return function(_0xfda5ad){if(!_0xfda5ad){_0x999367[_0x8bde('0x27')](0x194);}return _0xfda5ad;};}function handleError(_0x14db99,_0x28a60c){_0x28a60c=_0x28a60c||0x1f4;return function(_0x120ce9){logger[_0x8bde('0x28')](_0x120ce9[_0x8bde('0x29')]);if(_0x120ce9[_0x8bde('0x2a')]){delete _0x120ce9['name'];}_0x14db99['status'](_0x28a60c)[_0x8bde('0x2b')](_0x120ce9);};}exports['index']=function(_0x2f9bd5,_0x4a897e){var _0x49e0b5={},_0x1f1024={},_0x19df11={'count':0x0,'rows':[]};var _0x219e25=_[_0x8bde('0x2c')](db[_0x8bde('0x2d')][_0x8bde('0x2e')],function(_0x11c45c){return{'name':_0x11c45c[_0x8bde('0x2f')],'type':_0x11c45c[_0x8bde('0x30')][_0x8bde('0x31')]};});_0x1f1024[_0x8bde('0x32')]=_['map'](_0x219e25,_0x8bde('0x2a'));_0x1f1024['query']=_[_0x8bde('0x33')](_0x2f9bd5[_0x8bde('0x34')]);_0x1f1024[_0x8bde('0x35')]=_[_0x8bde('0x36')](_0x1f1024[_0x8bde('0x32')],_0x1f1024[_0x8bde('0x34')]);_0x49e0b5['attributes']=_[_0x8bde('0x36')](_0x1f1024[_0x8bde('0x32')],qs['fields'](_0x2f9bd5[_0x8bde('0x34')][_0x8bde('0x37')]));_0x49e0b5[_0x8bde('0x38')]=_0x49e0b5[_0x8bde('0x38')][_0x8bde('0x39')]?_0x49e0b5['attributes']:_0x1f1024[_0x8bde('0x32')];if(!_0x2f9bd5['query']['hasOwnProperty'](_0x8bde('0x3a'))){_0x49e0b5[_0x8bde('0x21')]=qs['limit'](_0x2f9bd5['query'][_0x8bde('0x21')]);_0x49e0b5[_0x8bde('0x1e')]=qs['offset'](_0x2f9bd5[_0x8bde('0x34')][_0x8bde('0x1e')]);}_0x49e0b5[_0x8bde('0x3b')]=qs[_0x8bde('0x3c')](_0x2f9bd5[_0x8bde('0x34')][_0x8bde('0x3c')]);_0x49e0b5['where']=qs[_0x8bde('0x35')](_['pick'](_0x2f9bd5['query'],_0x1f1024[_0x8bde('0x35')]),_0x219e25);if(_0x2f9bd5[_0x8bde('0x34')][_0x8bde('0x3d')]){_0x49e0b5[_0x8bde('0x3e')]=_['merge'](_0x49e0b5[_0x8bde('0x3e')],{'$or':_[_0x8bde('0x2c')](_0x219e25,function(_0x1dc6f2){if(_0x1dc6f2['type']!=='VIRTUAL'){var _0x3cd8d9={};_0x3cd8d9[_0x1dc6f2[_0x8bde('0x2a')]]={'$like':'%'+_0x2f9bd5[_0x8bde('0x34')][_0x8bde('0x3d')]+'%'};return _0x3cd8d9;}})});}_0x49e0b5=_['merge']({},_0x49e0b5,_0x2f9bd5[_0x8bde('0x3f')]);var _0xff8e70={'where':_0x49e0b5[_0x8bde('0x3e')]};return db[_0x8bde('0x2d')]['count'](_0xff8e70)[_0x8bde('0x26')](function(_0x5bff17){_0x19df11['count']=_0x5bff17;if(_0x2f9bd5[_0x8bde('0x34')][_0x8bde('0x40')]){_0x49e0b5[_0x8bde('0x41')]=[{'all':!![]}];}return db[_0x8bde('0x2d')][_0x8bde('0x42')](_0x49e0b5);})[_0x8bde('0x26')](function(_0xc462fe){_0x19df11[_0x8bde('0x43')]=_0xc462fe;return _0x19df11;})[_0x8bde('0x26')](respondWithFilteredResult(_0x4a897e,_0x49e0b5))['catch'](handleError(_0x4a897e,null));};exports['show']=function(_0x3ab271,_0x4cd265){var _0x2c02ed={'raw':![],'where':{'id':_0x3ab271[_0x8bde('0x44')]['id']}},_0x536ee2={};_0x536ee2[_0x8bde('0x32')]=_[_0x8bde('0x33')](db['FreshdeskConfiguration']['rawAttributes']);_0x536ee2[_0x8bde('0x34')]=_[_0x8bde('0x33')](_0x3ab271['query']);_0x536ee2['filters']=_['intersection'](_0x536ee2[_0x8bde('0x32')],_0x536ee2['query']);_0x2c02ed['attributes']=_[_0x8bde('0x36')](_0x536ee2[_0x8bde('0x32')],qs[_0x8bde('0x37')](_0x3ab271[_0x8bde('0x34')]['fields']));_0x2c02ed['attributes']=_0x2c02ed['attributes']['length']?_0x2c02ed[_0x8bde('0x38')]:_0x536ee2[_0x8bde('0x32')];if(_0x3ab271['query'][_0x8bde('0x40')]){_0x2c02ed[_0x8bde('0x41')]=[{'all':!![]}];}_0x2c02ed=_[_0x8bde('0x45')]({},_0x2c02ed,_0x3ab271[_0x8bde('0x3f')]);return db[_0x8bde('0x2d')][_0x8bde('0x46')](_0x2c02ed)['then'](handleEntityNotFound(_0x4cd265,null))[_0x8bde('0x26')](respondWithResult(_0x4cd265,null))['catch'](handleError(_0x4cd265,null));};exports[_0x8bde('0x47')]=function(_0x2c1f44,_0x31f871){return db['FreshdeskConfiguration']['create'](_0x2c1f44['body'],{})[_0x8bde('0x26')](respondWithResult(_0x31f871,0xc9))[_0x8bde('0x48')](handleError(_0x31f871,null));};exports[_0x8bde('0x25')]=function(_0x27ba92,_0x920f05){if(_0x27ba92[_0x8bde('0x49')]['id']){delete _0x27ba92[_0x8bde('0x49')]['id'];}return db[_0x8bde('0x2d')]['find']({'where':{'id':_0x27ba92[_0x8bde('0x44')]['id']}})[_0x8bde('0x26')](handleEntityNotFound(_0x920f05,null))['then'](saveUpdates(_0x27ba92['body'],null))[_0x8bde('0x26')](respondWithResult(_0x920f05,null))[_0x8bde('0x48')](handleError(_0x920f05,null));};exports[_0x8bde('0x4a')]=function(_0x1c5a63,_0x4ee6b9){return db[_0x8bde('0x2d')][_0x8bde('0x46')]({'where':{'id':_0x1c5a63[_0x8bde('0x44')]['id']}})[_0x8bde('0x26')](handleEntityNotFound(_0x4ee6b9,null))['then'](removeEntity(_0x4ee6b9,null))[_0x8bde('0x48')](handleError(_0x4ee6b9,null));};exports[_0x8bde('0x4b')]=function(_0x412f06,_0x52cab3,_0x20f18a){var _0x4827e4={};var _0x3ad041={};var _0x3ca50c;var _0x4adab4;return db['FreshdeskConfiguration'][_0x8bde('0x4c')]({'where':{'id':_0x412f06[_0x8bde('0x44')]['id']}})[_0x8bde('0x26')](handleEntityNotFound(_0x52cab3,null))['then'](function(_0x3f5ffc){if(_0x3f5ffc){_0x3ca50c=_0x3f5ffc;_0x3ad041['model']=_[_0x8bde('0x33')](db[_0x8bde('0x4d')][_0x8bde('0x2e')]);_0x3ad041[_0x8bde('0x34')]=_[_0x8bde('0x33')](_0x412f06[_0x8bde('0x34')]);_0x3ad041[_0x8bde('0x35')]=_[_0x8bde('0x36')](_0x3ad041[_0x8bde('0x32')],_0x3ad041[_0x8bde('0x34')]);_0x4827e4['attributes']=_[_0x8bde('0x36')](_0x3ad041['model'],qs[_0x8bde('0x37')](_0x412f06[_0x8bde('0x34')][_0x8bde('0x37')]));_0x4827e4[_0x8bde('0x38')]=_0x4827e4[_0x8bde('0x38')][_0x8bde('0x39')]?_0x4827e4[_0x8bde('0x38')]:_0x3ad041['model'];_0x4827e4[_0x8bde('0x3b')]=qs[_0x8bde('0x3c')](_0x412f06[_0x8bde('0x34')][_0x8bde('0x3c')]);_0x4827e4[_0x8bde('0x3e')]=qs['filters'](_[_0x8bde('0x4e')](_0x412f06[_0x8bde('0x34')],_0x3ad041[_0x8bde('0x35')]));if(_0x412f06['query'][_0x8bde('0x3d')]){_0x4827e4[_0x8bde('0x3e')]=_[_0x8bde('0x45')](_0x4827e4[_0x8bde('0x3e')],{'$or':_['map'](_0x4827e4[_0x8bde('0x38')],function(_0x1e66cf){var _0x2a7776={};_0x2a7776[_0x1e66cf]={'$like':'%'+_0x412f06[_0x8bde('0x34')][_0x8bde('0x3d')]+'%'};return _0x2a7776;})});}_0x4827e4=_[_0x8bde('0x45')]({},_0x4827e4,_0x412f06['options']);return _0x3ca50c['getFields'](_0x4827e4);}})[_0x8bde('0x26')](function(_0x4abac2){if(_0x4abac2){_0x4adab4=_0x4abac2[_0x8bde('0x39')];if(!_0x412f06[_0x8bde('0x34')]['hasOwnProperty'](_0x8bde('0x3a'))){_0x4827e4[_0x8bde('0x21')]=qs[_0x8bde('0x21')](_0x412f06[_0x8bde('0x34')][_0x8bde('0x21')]);_0x4827e4['offset']=qs[_0x8bde('0x1e')](_0x412f06[_0x8bde('0x34')][_0x8bde('0x1e')]);}return _0x3ca50c[_0x8bde('0x4b')](_0x4827e4);}})[_0x8bde('0x26')](function(_0x236f5b){if(_0x236f5b){return _0x236f5b?{'count':_0x4adab4,'rows':_0x236f5b}:null;}})[_0x8bde('0x26')](respondWithResult(_0x52cab3,null))[_0x8bde('0x48')](handleError(_0x52cab3,null));};exports['getSubjects']=function(_0x387aa4,_0x2f58db,_0x2460a5){var _0x4d4ae4={};var _0x1cbd7d={};var _0x505905;var _0x381123;return db[_0x8bde('0x2d')][_0x8bde('0x4c')]({'where':{'id':_0x387aa4[_0x8bde('0x44')]['id']}})[_0x8bde('0x26')](handleEntityNotFound(_0x2f58db,null))[_0x8bde('0x26')](function(_0x5244ba){if(_0x5244ba){_0x505905=_0x5244ba;_0x1cbd7d[_0x8bde('0x32')]=_[_0x8bde('0x33')](db[_0x8bde('0x4d')][_0x8bde('0x2e')]);_0x1cbd7d[_0x8bde('0x34')]=_[_0x8bde('0x33')](_0x387aa4[_0x8bde('0x34')]);_0x1cbd7d[_0x8bde('0x35')]=_[_0x8bde('0x36')](_0x1cbd7d[_0x8bde('0x32')],_0x1cbd7d[_0x8bde('0x34')]);_0x4d4ae4['attributes']=_[_0x8bde('0x36')](_0x1cbd7d['model'],qs[_0x8bde('0x37')](_0x387aa4[_0x8bde('0x34')][_0x8bde('0x37')]));_0x4d4ae4[_0x8bde('0x38')]=_0x4d4ae4['attributes'][_0x8bde('0x39')]?_0x4d4ae4[_0x8bde('0x38')]:_0x1cbd7d[_0x8bde('0x32')];_0x4d4ae4[_0x8bde('0x3b')]=qs[_0x8bde('0x3c')](_0x387aa4['query']['sort']);_0x4d4ae4[_0x8bde('0x3e')]=qs[_0x8bde('0x35')](_[_0x8bde('0x4e')](_0x387aa4['query'],_0x1cbd7d['filters']));if(_0x387aa4[_0x8bde('0x34')][_0x8bde('0x3d')]){_0x4d4ae4[_0x8bde('0x3e')]=_['merge'](_0x4d4ae4[_0x8bde('0x3e')],{'$or':_[_0x8bde('0x2c')](_0x4d4ae4[_0x8bde('0x38')],function(_0x21dbc9){var _0x3aeff7={};_0x3aeff7[_0x21dbc9]={'$like':'%'+_0x387aa4[_0x8bde('0x34')]['filter']+'%'};return _0x3aeff7;})});}_0x4d4ae4=_[_0x8bde('0x45')]({},_0x4d4ae4,_0x387aa4['options']);return _0x505905[_0x8bde('0x4f')](_0x4d4ae4);}})[_0x8bde('0x26')](function(_0x3331e0){if(_0x3331e0){_0x381123=_0x3331e0['length'];if(!_0x387aa4['query']['hasOwnProperty']('nolimit')){_0x4d4ae4[_0x8bde('0x21')]=qs['limit'](_0x387aa4['query']['limit']);_0x4d4ae4[_0x8bde('0x1e')]=qs[_0x8bde('0x1e')](_0x387aa4['query'][_0x8bde('0x1e')]);}return _0x505905[_0x8bde('0x4f')](_0x4d4ae4);}})[_0x8bde('0x26')](function(_0x45aece){if(_0x45aece){return _0x45aece?{'count':_0x381123,'rows':_0x45aece}:null;}})['then'](respondWithResult(_0x2f58db,null))['catch'](handleError(_0x2f58db,null));};exports[_0x8bde('0x50')]=function(_0x59e1c6,_0x5a6b17,_0x49480a){var _0x285a74={};var _0x389c0f={};var _0x52db73;var _0x2bc698;return db[_0x8bde('0x2d')][_0x8bde('0x4c')]({'where':{'id':_0x59e1c6['params']['id']}})['then'](handleEntityNotFound(_0x5a6b17,null))['then'](function(_0x46847e){if(_0x46847e){_0x52db73=_0x46847e;_0x389c0f[_0x8bde('0x32')]=_[_0x8bde('0x33')](db[_0x8bde('0x4d')]['rawAttributes']);_0x389c0f['query']=_[_0x8bde('0x33')](_0x59e1c6[_0x8bde('0x34')]);_0x389c0f['filters']=_[_0x8bde('0x36')](_0x389c0f[_0x8bde('0x32')],_0x389c0f[_0x8bde('0x34')]);_0x285a74[_0x8bde('0x38')]=_[_0x8bde('0x36')](_0x389c0f[_0x8bde('0x32')],qs['fields'](_0x59e1c6[_0x8bde('0x34')][_0x8bde('0x37')]));_0x285a74['attributes']=_0x285a74['attributes'][_0x8bde('0x39')]?_0x285a74[_0x8bde('0x38')]:_0x389c0f[_0x8bde('0x32')];_0x285a74[_0x8bde('0x3b')]=qs[_0x8bde('0x3c')](_0x59e1c6[_0x8bde('0x34')]['sort']);_0x285a74[_0x8bde('0x3e')]=qs[_0x8bde('0x35')](_['pick'](_0x59e1c6[_0x8bde('0x34')],_0x389c0f[_0x8bde('0x35')]));if(_0x59e1c6['query']['filter']){_0x285a74['where']=_[_0x8bde('0x45')](_0x285a74[_0x8bde('0x3e')],{'$or':_['map'](_0x285a74[_0x8bde('0x38')],function(_0x1adc93){var _0x551480={};_0x551480[_0x1adc93]={'$like':'%'+_0x59e1c6[_0x8bde('0x34')]['filter']+'%'};return _0x551480;})});}_0x285a74=_['merge']({},_0x285a74,_0x59e1c6[_0x8bde('0x3f')]);return _0x52db73[_0x8bde('0x50')](_0x285a74);}})[_0x8bde('0x26')](function(_0x16c268){if(_0x16c268){_0x2bc698=_0x16c268[_0x8bde('0x39')];if(!_0x59e1c6[_0x8bde('0x34')][_0x8bde('0x51')](_0x8bde('0x3a'))){_0x285a74['limit']=qs[_0x8bde('0x21')](_0x59e1c6[_0x8bde('0x34')][_0x8bde('0x21')]);_0x285a74[_0x8bde('0x1e')]=qs[_0x8bde('0x1e')](_0x59e1c6[_0x8bde('0x34')]['offset']);}return _0x52db73[_0x8bde('0x50')](_0x285a74);}})[_0x8bde('0x26')](function(_0x5675bc){if(_0x5675bc){return _0x5675bc?{'count':_0x2bc698,'rows':_0x5675bc}:null;}})[_0x8bde('0x26')](respondWithResult(_0x5a6b17,null))['catch'](handleError(_0x5a6b17,null));};exports[_0x8bde('0x52')]=function(_0x493d6b,_0x2d396f,_0x33cc31){var _0x54460c={};var _0x2b5be8={};var _0x1a9711;var _0x4aa8e5;return db[_0x8bde('0x2d')][_0x8bde('0x4c')]({'where':{'id':_0x493d6b['params']['id']}})[_0x8bde('0x26')](handleEntityNotFound(_0x2d396f,null))[_0x8bde('0x26')](function(_0xc496ae){if(_0xc496ae){_0x1a9711=_0xc496ae;_0x2b5be8[_0x8bde('0x32')]=_[_0x8bde('0x33')](db[_0x8bde('0x53')][_0x8bde('0x2e')]);_0x2b5be8[_0x8bde('0x34')]=_[_0x8bde('0x33')](_0x493d6b['query']);_0x2b5be8[_0x8bde('0x35')]=_[_0x8bde('0x36')](_0x2b5be8['model'],_0x2b5be8[_0x8bde('0x34')]);_0x54460c[_0x8bde('0x38')]=_['intersection'](_0x2b5be8[_0x8bde('0x32')],qs[_0x8bde('0x37')](_0x493d6b[_0x8bde('0x34')][_0x8bde('0x37')]));_0x54460c['attributes']=_0x54460c[_0x8bde('0x38')]['length']?_0x54460c['attributes']:_0x2b5be8['model'];_0x54460c[_0x8bde('0x3b')]=qs[_0x8bde('0x3c')](_0x493d6b[_0x8bde('0x34')][_0x8bde('0x3c')]);_0x54460c[_0x8bde('0x3e')]=qs[_0x8bde('0x35')](_[_0x8bde('0x4e')](_0x493d6b[_0x8bde('0x34')],_0x2b5be8['filters']));if(_0x493d6b[_0x8bde('0x34')][_0x8bde('0x3d')]){_0x54460c[_0x8bde('0x3e')]=_[_0x8bde('0x45')](_0x54460c[_0x8bde('0x3e')],{'$or':_[_0x8bde('0x2c')](_0x54460c[_0x8bde('0x38')],function(_0x18d9a1){var _0x2ceedb={};_0x2ceedb[_0x18d9a1]={'$like':'%'+_0x493d6b[_0x8bde('0x34')][_0x8bde('0x3d')]+'%'};return _0x2ceedb;})});}_0x54460c=_['merge']({},_0x54460c,_0x493d6b[_0x8bde('0x3f')]);return _0x1a9711[_0x8bde('0x52')](_0x54460c);}})[_0x8bde('0x26')](function(_0x2fd0bc){if(_0x2fd0bc){_0x4aa8e5=_0x2fd0bc[_0x8bde('0x39')];if(!_0x493d6b[_0x8bde('0x34')][_0x8bde('0x51')](_0x8bde('0x3a'))){_0x54460c[_0x8bde('0x21')]=qs[_0x8bde('0x21')](_0x493d6b[_0x8bde('0x34')][_0x8bde('0x21')]);_0x54460c['offset']=qs['offset'](_0x493d6b['query'][_0x8bde('0x1e')]);}return _0x1a9711[_0x8bde('0x52')](_0x54460c);}})['then'](function(_0x722807){if(_0x722807){return _0x722807?{'count':_0x4aa8e5,'rows':_0x722807}:null;}})['then'](respondWithResult(_0x2d396f,null))[_0x8bde('0x48')](handleError(_0x2d396f,null));};exports[_0x8bde('0x54')]=function(_0x32fc5e,_0xbe3fe,_0x33b9cb){if(_0x32fc5e[_0x8bde('0x49')]['id']){delete _0x32fc5e[_0x8bde('0x49')]['id'];}return db[_0x8bde('0x2d')][_0x8bde('0x4c')]({'where':{'id':_0x32fc5e['params']['id']}})['then'](handleEntityNotFound(_0xbe3fe,null))[_0x8bde('0x26')](function(_0x13e1b0){if(_0x13e1b0){return _0x13e1b0[_0x8bde('0x54')](_0x32fc5e['body']['ids']||[]);}return null;})['then'](respondWithResult(_0xbe3fe,null))[_0x8bde('0x48')](handleError(_0xbe3fe,null));};
\ No newline at end of file
+var _0x0f2a=['findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','destroy','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','error','stack','name','index','map','fieldName','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskConfiguration','then','includeAll','include'];(function(_0xe58ae2,_0x30a065){var _0x369b69=function(_0xa6a029){while(--_0xa6a029){_0xe58ae2['push'](_0xe58ae2['shift']());}};_0x369b69(++_0x30a065);}(_0x0f2a,0x69));var _0xa0f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0f2a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0f2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa0f2('0x1'));var BPromise=require(_0xa0f2('0x2'));var Mustache=require(_0xa0f2('0x3'));var util=require(_0xa0f2('0x4'));var path=require(_0xa0f2('0x5'));var sox=require(_0xa0f2('0x6'));var csv=require(_0xa0f2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa0f2('0x8'));var _=require(_0xa0f2('0x9'));var squel=require(_0xa0f2('0xa'));var crypto=require(_0xa0f2('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa0f2('0x7'));var querystring=require(_0xa0f2('0xc'));var Papa=require('papaparse');var Redis=require(_0xa0f2('0xd'));var authService=require(_0xa0f2('0xe'));var qs=require(_0xa0f2('0xf'));var as=require(_0xa0f2('0x10'));var hardwareService=require(_0xa0f2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xa0f2('0x12'));var config=require(_0xa0f2('0x13'));var licenseUtil=require(_0xa0f2('0x14'));var db=require(_0xa0f2('0x15'))['db'];function respondWithStatusCode(_0x3dcf04,_0x199138){_0x199138=_0x199138||0xcc;return function(_0x9ad519){if(_0x9ad519){return _0x3dcf04[_0xa0f2('0x16')](_0x199138);}return _0x3dcf04[_0xa0f2('0x17')](_0x199138)[_0xa0f2('0x18')]();};}function respondWithResult(_0x50b4bf,_0x8f4876){_0x8f4876=_0x8f4876||0xc8;return function(_0x27b812){if(_0x27b812){return _0x50b4bf[_0xa0f2('0x17')](_0x8f4876)[_0xa0f2('0x19')](_0x27b812);}};}function respondWithFilteredResult(_0x5e5ffb,_0xc9ce2e){return function(_0x4597b6){if(_0x4597b6){var _0x3b1a59=typeof _0xc9ce2e['offset']==='undefined'&&typeof _0xc9ce2e['limit']===_0xa0f2('0x1a');var _0x3dd04f=_0x4597b6[_0xa0f2('0x1b')];var _0x228283=_0x3b1a59?0x0:_0xc9ce2e['offset'];var _0x263f75=_0x3b1a59?_0x4597b6[_0xa0f2('0x1b')]:_0xc9ce2e[_0xa0f2('0x1c')]+_0xc9ce2e[_0xa0f2('0x1d')];var _0x5e49ff;if(_0x263f75>=_0x3dd04f){_0x263f75=_0x3dd04f;_0x5e49ff=0xc8;}else{_0x5e49ff=0xce;}_0x5e5ffb[_0xa0f2('0x17')](_0x5e49ff);return _0x5e5ffb[_0xa0f2('0x1e')](_0xa0f2('0x1f'),_0x228283+'-'+_0x263f75+'/'+_0x3dd04f)['json'](_0x4597b6);}return null;};}function patchUpdates(_0x21f085){return function(_0x437208){try{jsonpatch[_0xa0f2('0x20')](_0x437208,_0x21f085,!![]);}catch(_0x59b813){return BPromise[_0xa0f2('0x21')](_0x59b813);}return _0x437208['save']();};}function saveUpdates(_0x3cc3a2,_0x16d7b3){return function(_0x215503){if(_0x215503){return _0x215503[_0xa0f2('0x22')](_0x3cc3a2)['then'](function(_0x5a8a1d){return _0x5a8a1d;});}return null;};}function removeEntity(_0x1738da,_0x919f39){return function(_0x182990){if(_0x182990){return _0x182990['destroy']()['then'](function(){_0x1738da[_0xa0f2('0x17')](0xcc)[_0xa0f2('0x18')]();});}};}function handleEntityNotFound(_0x2e1242,_0x5dbc33){return function(_0x2b76b9){if(!_0x2b76b9){_0x2e1242[_0xa0f2('0x16')](0x194);}return _0x2b76b9;};}function handleError(_0x15be43,_0x31024f){_0x31024f=_0x31024f||0x1f4;return function(_0x556d0a){logger[_0xa0f2('0x23')](_0x556d0a[_0xa0f2('0x24')]);if(_0x556d0a[_0xa0f2('0x25')]){delete _0x556d0a[_0xa0f2('0x25')];}_0x15be43[_0xa0f2('0x17')](_0x31024f)['send'](_0x556d0a);};}exports[_0xa0f2('0x26')]=function(_0x55fccc,_0x2f5a19){var _0x17d9ab={},_0x527f88={},_0x17f616={'count':0x0,'rows':[]};var _0x363ab1=_[_0xa0f2('0x27')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x128015){return{'name':_0x128015[_0xa0f2('0x28')],'type':_0x128015['type'][_0xa0f2('0x29')]};});_0x527f88['model']=_[_0xa0f2('0x27')](_0x363ab1,_0xa0f2('0x25'));_0x527f88[_0xa0f2('0x2a')]=_[_0xa0f2('0x2b')](_0x55fccc[_0xa0f2('0x2a')]);_0x527f88[_0xa0f2('0x2c')]=_['intersection'](_0x527f88[_0xa0f2('0x2d')],_0x527f88[_0xa0f2('0x2a')]);_0x17d9ab[_0xa0f2('0x2e')]=_['intersection'](_0x527f88[_0xa0f2('0x2d')],qs[_0xa0f2('0x2f')](_0x55fccc['query']['fields']));_0x17d9ab[_0xa0f2('0x2e')]=_0x17d9ab[_0xa0f2('0x2e')][_0xa0f2('0x30')]?_0x17d9ab['attributes']:_0x527f88['model'];if(!_0x55fccc[_0xa0f2('0x2a')][_0xa0f2('0x31')]('nolimit')){_0x17d9ab[_0xa0f2('0x1d')]=qs[_0xa0f2('0x1d')](_0x55fccc[_0xa0f2('0x2a')]['limit']);_0x17d9ab['offset']=qs[_0xa0f2('0x1c')](_0x55fccc[_0xa0f2('0x2a')]['offset']);}_0x17d9ab[_0xa0f2('0x32')]=qs[_0xa0f2('0x33')](_0x55fccc[_0xa0f2('0x2a')][_0xa0f2('0x33')]);_0x17d9ab[_0xa0f2('0x34')]=qs['filters'](_[_0xa0f2('0x35')](_0x55fccc[_0xa0f2('0x2a')],_0x527f88[_0xa0f2('0x2c')]),_0x363ab1);if(_0x55fccc[_0xa0f2('0x2a')][_0xa0f2('0x36')]){_0x17d9ab[_0xa0f2('0x34')]=_[_0xa0f2('0x37')](_0x17d9ab[_0xa0f2('0x34')],{'$or':_[_0xa0f2('0x27')](_0x363ab1,function(_0x58b256){if(_0x58b256[_0xa0f2('0x38')]!==_0xa0f2('0x39')){var _0x519279={};_0x519279[_0x58b256['name']]={'$like':'%'+_0x55fccc[_0xa0f2('0x2a')][_0xa0f2('0x36')]+'%'};return _0x519279;}})});}_0x17d9ab=_['merge']({},_0x17d9ab,_0x55fccc[_0xa0f2('0x3a')]);var _0x35fa86={'where':_0x17d9ab[_0xa0f2('0x34')]};return db[_0xa0f2('0x3b')]['count'](_0x35fa86)[_0xa0f2('0x3c')](function(_0x1bdf0b){_0x17f616[_0xa0f2('0x1b')]=_0x1bdf0b;if(_0x55fccc[_0xa0f2('0x2a')][_0xa0f2('0x3d')]){_0x17d9ab[_0xa0f2('0x3e')]=[{'all':!![]}];}return db[_0xa0f2('0x3b')][_0xa0f2('0x3f')](_0x17d9ab);})[_0xa0f2('0x3c')](function(_0x59302b){_0x17f616[_0xa0f2('0x40')]=_0x59302b;return _0x17f616;})[_0xa0f2('0x3c')](respondWithFilteredResult(_0x2f5a19,_0x17d9ab))[_0xa0f2('0x41')](handleError(_0x2f5a19,null));};exports[_0xa0f2('0x42')]=function(_0x3fd33a,_0x1e8c4e){var _0x12524b={'raw':![],'where':{'id':_0x3fd33a[_0xa0f2('0x43')]['id']}},_0x1edf71={};_0x1edf71[_0xa0f2('0x2d')]=_[_0xa0f2('0x2b')](db[_0xa0f2('0x3b')][_0xa0f2('0x44')]);_0x1edf71[_0xa0f2('0x2a')]=_[_0xa0f2('0x2b')](_0x3fd33a[_0xa0f2('0x2a')]);_0x1edf71[_0xa0f2('0x2c')]=_[_0xa0f2('0x45')](_0x1edf71['model'],_0x1edf71['query']);_0x12524b[_0xa0f2('0x2e')]=_[_0xa0f2('0x45')](_0x1edf71[_0xa0f2('0x2d')],qs['fields'](_0x3fd33a[_0xa0f2('0x2a')]['fields']));_0x12524b[_0xa0f2('0x2e')]=_0x12524b[_0xa0f2('0x2e')][_0xa0f2('0x30')]?_0x12524b[_0xa0f2('0x2e')]:_0x1edf71[_0xa0f2('0x2d')];if(_0x3fd33a[_0xa0f2('0x2a')][_0xa0f2('0x3d')]){_0x12524b['include']=[{'all':!![]}];}_0x12524b=_[_0xa0f2('0x37')]({},_0x12524b,_0x3fd33a['options']);return db[_0xa0f2('0x3b')][_0xa0f2('0x46')](_0x12524b)[_0xa0f2('0x3c')](handleEntityNotFound(_0x1e8c4e,null))[_0xa0f2('0x3c')](respondWithResult(_0x1e8c4e,null))[_0xa0f2('0x41')](handleError(_0x1e8c4e,null));};exports['create']=function(_0x52f023,_0x576b37){return db[_0xa0f2('0x3b')][_0xa0f2('0x47')](_0x52f023[_0xa0f2('0x48')],{})[_0xa0f2('0x3c')](respondWithResult(_0x576b37,0xc9))[_0xa0f2('0x41')](handleError(_0x576b37,null));};exports[_0xa0f2('0x22')]=function(_0x24fca2,_0x494784){if(_0x24fca2[_0xa0f2('0x48')]['id']){delete _0x24fca2['body']['id'];}return db[_0xa0f2('0x3b')]['find']({'where':{'id':_0x24fca2['params']['id']}})['then'](handleEntityNotFound(_0x494784,null))[_0xa0f2('0x3c')](saveUpdates(_0x24fca2[_0xa0f2('0x48')],null))[_0xa0f2('0x3c')](respondWithResult(_0x494784,null))['catch'](handleError(_0x494784,null));};exports[_0xa0f2('0x49')]=function(_0x32b25c,_0x2ddeb3){return db[_0xa0f2('0x3b')][_0xa0f2('0x46')]({'where':{'id':_0x32b25c[_0xa0f2('0x43')]['id']}})[_0xa0f2('0x3c')](handleEntityNotFound(_0x2ddeb3,null))[_0xa0f2('0x3c')](removeEntity(_0x2ddeb3,null))[_0xa0f2('0x41')](handleError(_0x2ddeb3,null));};exports[_0xa0f2('0x4a')]=function(_0x4c10aa,_0x5470a5,_0x5eae9f){var _0x208acc={};var _0x3d9dcb={};var _0x51eefe;var _0x203176;return db['FreshdeskConfiguration'][_0xa0f2('0x4b')]({'where':{'id':_0x4c10aa[_0xa0f2('0x43')]['id']}})['then'](handleEntityNotFound(_0x5470a5,null))['then'](function(_0x56e008){if(_0x56e008){_0x51eefe=_0x56e008;_0x3d9dcb[_0xa0f2('0x2d')]=_[_0xa0f2('0x2b')](db[_0xa0f2('0x4c')][_0xa0f2('0x44')]);_0x3d9dcb[_0xa0f2('0x2a')]=_['keys'](_0x4c10aa['query']);_0x3d9dcb['filters']=_[_0xa0f2('0x45')](_0x3d9dcb['model'],_0x3d9dcb[_0xa0f2('0x2a')]);_0x208acc['attributes']=_[_0xa0f2('0x45')](_0x3d9dcb[_0xa0f2('0x2d')],qs[_0xa0f2('0x2f')](_0x4c10aa[_0xa0f2('0x2a')]['fields']));_0x208acc[_0xa0f2('0x2e')]=_0x208acc['attributes'][_0xa0f2('0x30')]?_0x208acc[_0xa0f2('0x2e')]:_0x3d9dcb[_0xa0f2('0x2d')];_0x208acc[_0xa0f2('0x32')]=qs[_0xa0f2('0x33')](_0x4c10aa[_0xa0f2('0x2a')][_0xa0f2('0x33')]);_0x208acc['where']=qs[_0xa0f2('0x2c')](_[_0xa0f2('0x35')](_0x4c10aa[_0xa0f2('0x2a')],_0x3d9dcb[_0xa0f2('0x2c')]));if(_0x4c10aa[_0xa0f2('0x2a')][_0xa0f2('0x36')]){_0x208acc[_0xa0f2('0x34')]=_[_0xa0f2('0x37')](_0x208acc[_0xa0f2('0x34')],{'$or':_[_0xa0f2('0x27')](_0x208acc['attributes'],function(_0x353754){var _0x389bfb={};_0x389bfb[_0x353754]={'$like':'%'+_0x4c10aa[_0xa0f2('0x2a')]['filter']+'%'};return _0x389bfb;})});}_0x208acc=_['merge']({},_0x208acc,_0x4c10aa[_0xa0f2('0x3a')]);return _0x51eefe[_0xa0f2('0x4a')](_0x208acc);}})[_0xa0f2('0x3c')](function(_0x41add0){if(_0x41add0){_0x203176=_0x41add0[_0xa0f2('0x30')];if(!_0x4c10aa['query'][_0xa0f2('0x31')](_0xa0f2('0x4d'))){_0x208acc[_0xa0f2('0x1d')]=qs[_0xa0f2('0x1d')](_0x4c10aa[_0xa0f2('0x2a')]['limit']);_0x208acc[_0xa0f2('0x1c')]=qs[_0xa0f2('0x1c')](_0x4c10aa[_0xa0f2('0x2a')]['offset']);}return _0x51eefe[_0xa0f2('0x4a')](_0x208acc);}})[_0xa0f2('0x3c')](function(_0x342cad){if(_0x342cad){return _0x342cad?{'count':_0x203176,'rows':_0x342cad}:null;}})['then'](respondWithResult(_0x5470a5,null))[_0xa0f2('0x41')](handleError(_0x5470a5,null));};exports[_0xa0f2('0x4e')]=function(_0x5c5b7d,_0x1b2046,_0x2b01d9){var _0x16ae69={};var _0x18c54e={};var _0x56ab47;var _0x24e302;return db['FreshdeskConfiguration'][_0xa0f2('0x4b')]({'where':{'id':_0x5c5b7d[_0xa0f2('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b2046,null))[_0xa0f2('0x3c')](function(_0x4e176f){if(_0x4e176f){_0x56ab47=_0x4e176f;_0x18c54e[_0xa0f2('0x2d')]=_[_0xa0f2('0x2b')](db[_0xa0f2('0x4c')][_0xa0f2('0x44')]);_0x18c54e[_0xa0f2('0x2a')]=_[_0xa0f2('0x2b')](_0x5c5b7d[_0xa0f2('0x2a')]);_0x18c54e['filters']=_[_0xa0f2('0x45')](_0x18c54e[_0xa0f2('0x2d')],_0x18c54e['query']);_0x16ae69[_0xa0f2('0x2e')]=_[_0xa0f2('0x45')](_0x18c54e['model'],qs[_0xa0f2('0x2f')](_0x5c5b7d[_0xa0f2('0x2a')][_0xa0f2('0x2f')]));_0x16ae69[_0xa0f2('0x2e')]=_0x16ae69[_0xa0f2('0x2e')]['length']?_0x16ae69[_0xa0f2('0x2e')]:_0x18c54e[_0xa0f2('0x2d')];_0x16ae69[_0xa0f2('0x32')]=qs[_0xa0f2('0x33')](_0x5c5b7d[_0xa0f2('0x2a')][_0xa0f2('0x33')]);_0x16ae69[_0xa0f2('0x34')]=qs['filters'](_['pick'](_0x5c5b7d[_0xa0f2('0x2a')],_0x18c54e[_0xa0f2('0x2c')]));if(_0x5c5b7d['query'][_0xa0f2('0x36')]){_0x16ae69['where']=_[_0xa0f2('0x37')](_0x16ae69[_0xa0f2('0x34')],{'$or':_[_0xa0f2('0x27')](_0x16ae69[_0xa0f2('0x2e')],function(_0x4d5ac8){var _0x512907={};_0x512907[_0x4d5ac8]={'$like':'%'+_0x5c5b7d[_0xa0f2('0x2a')][_0xa0f2('0x36')]+'%'};return _0x512907;})});}_0x16ae69=_[_0xa0f2('0x37')]({},_0x16ae69,_0x5c5b7d[_0xa0f2('0x3a')]);return _0x56ab47[_0xa0f2('0x4e')](_0x16ae69);}})['then'](function(_0x415f08){if(_0x415f08){_0x24e302=_0x415f08[_0xa0f2('0x30')];if(!_0x5c5b7d[_0xa0f2('0x2a')][_0xa0f2('0x31')](_0xa0f2('0x4d'))){_0x16ae69[_0xa0f2('0x1d')]=qs[_0xa0f2('0x1d')](_0x5c5b7d[_0xa0f2('0x2a')][_0xa0f2('0x1d')]);_0x16ae69['offset']=qs[_0xa0f2('0x1c')](_0x5c5b7d[_0xa0f2('0x2a')][_0xa0f2('0x1c')]);}return _0x56ab47[_0xa0f2('0x4e')](_0x16ae69);}})[_0xa0f2('0x3c')](function(_0x1d56c8){if(_0x1d56c8){return _0x1d56c8?{'count':_0x24e302,'rows':_0x1d56c8}:null;}})[_0xa0f2('0x3c')](respondWithResult(_0x1b2046,null))[_0xa0f2('0x41')](handleError(_0x1b2046,null));};exports[_0xa0f2('0x4f')]=function(_0x41a015,_0x249390,_0x3bf8d7){var _0x424241={};var _0x1450bd={};var _0x4e20b0;var _0xcf999f;return db[_0xa0f2('0x3b')][_0xa0f2('0x4b')]({'where':{'id':_0x41a015['params']['id']}})[_0xa0f2('0x3c')](handleEntityNotFound(_0x249390,null))[_0xa0f2('0x3c')](function(_0x1859dd){if(_0x1859dd){_0x4e20b0=_0x1859dd;_0x1450bd[_0xa0f2('0x2d')]=_[_0xa0f2('0x2b')](db[_0xa0f2('0x4c')][_0xa0f2('0x44')]);_0x1450bd[_0xa0f2('0x2a')]=_[_0xa0f2('0x2b')](_0x41a015['query']);_0x1450bd[_0xa0f2('0x2c')]=_[_0xa0f2('0x45')](_0x1450bd['model'],_0x1450bd[_0xa0f2('0x2a')]);_0x424241[_0xa0f2('0x2e')]=_['intersection'](_0x1450bd['model'],qs[_0xa0f2('0x2f')](_0x41a015[_0xa0f2('0x2a')][_0xa0f2('0x2f')]));_0x424241[_0xa0f2('0x2e')]=_0x424241[_0xa0f2('0x2e')][_0xa0f2('0x30')]?_0x424241[_0xa0f2('0x2e')]:_0x1450bd[_0xa0f2('0x2d')];_0x424241[_0xa0f2('0x32')]=qs['sort'](_0x41a015[_0xa0f2('0x2a')][_0xa0f2('0x33')]);_0x424241[_0xa0f2('0x34')]=qs[_0xa0f2('0x2c')](_[_0xa0f2('0x35')](_0x41a015[_0xa0f2('0x2a')],_0x1450bd['filters']));if(_0x41a015[_0xa0f2('0x2a')][_0xa0f2('0x36')]){_0x424241[_0xa0f2('0x34')]=_[_0xa0f2('0x37')](_0x424241[_0xa0f2('0x34')],{'$or':_[_0xa0f2('0x27')](_0x424241[_0xa0f2('0x2e')],function(_0x534109){var _0xce3c29={};_0xce3c29[_0x534109]={'$like':'%'+_0x41a015['query'][_0xa0f2('0x36')]+'%'};return _0xce3c29;})});}_0x424241=_[_0xa0f2('0x37')]({},_0x424241,_0x41a015[_0xa0f2('0x3a')]);return _0x4e20b0['getDescriptions'](_0x424241);}})['then'](function(_0x5025b2){if(_0x5025b2){_0xcf999f=_0x5025b2[_0xa0f2('0x30')];if(!_0x41a015[_0xa0f2('0x2a')][_0xa0f2('0x31')](_0xa0f2('0x4d'))){_0x424241[_0xa0f2('0x1d')]=qs[_0xa0f2('0x1d')](_0x41a015[_0xa0f2('0x2a')][_0xa0f2('0x1d')]);_0x424241[_0xa0f2('0x1c')]=qs[_0xa0f2('0x1c')](_0x41a015[_0xa0f2('0x2a')][_0xa0f2('0x1c')]);}return _0x4e20b0['getDescriptions'](_0x424241);}})[_0xa0f2('0x3c')](function(_0x134a36){if(_0x134a36){return _0x134a36?{'count':_0xcf999f,'rows':_0x134a36}:null;}})[_0xa0f2('0x3c')](respondWithResult(_0x249390,null))['catch'](handleError(_0x249390,null));};exports[_0xa0f2('0x50')]=function(_0x14700d,_0x53fecb,_0x3c2d48){var _0x28bfba={};var _0x18ec90={};var _0xb85666;var _0x243548;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x14700d[_0xa0f2('0x43')]['id']}})[_0xa0f2('0x3c')](handleEntityNotFound(_0x53fecb,null))[_0xa0f2('0x3c')](function(_0x1f7407){if(_0x1f7407){_0xb85666=_0x1f7407;_0x18ec90[_0xa0f2('0x2d')]=_[_0xa0f2('0x2b')](db[_0xa0f2('0x51')][_0xa0f2('0x44')]);_0x18ec90[_0xa0f2('0x2a')]=_[_0xa0f2('0x2b')](_0x14700d[_0xa0f2('0x2a')]);_0x18ec90[_0xa0f2('0x2c')]=_['intersection'](_0x18ec90['model'],_0x18ec90[_0xa0f2('0x2a')]);_0x28bfba[_0xa0f2('0x2e')]=_[_0xa0f2('0x45')](_0x18ec90[_0xa0f2('0x2d')],qs['fields'](_0x14700d['query'][_0xa0f2('0x2f')]));_0x28bfba[_0xa0f2('0x2e')]=_0x28bfba[_0xa0f2('0x2e')][_0xa0f2('0x30')]?_0x28bfba[_0xa0f2('0x2e')]:_0x18ec90['model'];_0x28bfba[_0xa0f2('0x32')]=qs[_0xa0f2('0x33')](_0x14700d['query'][_0xa0f2('0x33')]);_0x28bfba[_0xa0f2('0x34')]=qs[_0xa0f2('0x2c')](_['pick'](_0x14700d['query'],_0x18ec90[_0xa0f2('0x2c')]));if(_0x14700d['query']['filter']){_0x28bfba[_0xa0f2('0x34')]=_[_0xa0f2('0x37')](_0x28bfba[_0xa0f2('0x34')],{'$or':_[_0xa0f2('0x27')](_0x28bfba[_0xa0f2('0x2e')],function(_0x2e44ff){var _0x299d27={};_0x299d27[_0x2e44ff]={'$like':'%'+_0x14700d[_0xa0f2('0x2a')][_0xa0f2('0x36')]+'%'};return _0x299d27;})});}_0x28bfba=_['merge']({},_0x28bfba,_0x14700d[_0xa0f2('0x3a')]);return _0xb85666[_0xa0f2('0x50')](_0x28bfba);}})[_0xa0f2('0x3c')](function(_0x21fd9b){if(_0x21fd9b){_0x243548=_0x21fd9b[_0xa0f2('0x30')];if(!_0x14700d['query'][_0xa0f2('0x31')](_0xa0f2('0x4d'))){_0x28bfba['limit']=qs['limit'](_0x14700d[_0xa0f2('0x2a')]['limit']);_0x28bfba[_0xa0f2('0x1c')]=qs[_0xa0f2('0x1c')](_0x14700d['query'][_0xa0f2('0x1c')]);}return _0xb85666[_0xa0f2('0x50')](_0x28bfba);}})[_0xa0f2('0x3c')](function(_0x427454){if(_0x427454){return _0x427454?{'count':_0x243548,'rows':_0x427454}:null;}})[_0xa0f2('0x3c')](respondWithResult(_0x53fecb,null))['catch'](handleError(_0x53fecb,null));};exports[_0xa0f2('0x52')]=function(_0x4d92e6,_0x160170,_0x11f400){if(_0x4d92e6[_0xa0f2('0x48')]['id']){delete _0x4d92e6[_0xa0f2('0x48')]['id'];}return db[_0xa0f2('0x3b')][_0xa0f2('0x4b')]({'where':{'id':_0x4d92e6[_0xa0f2('0x43')]['id']}})[_0xa0f2('0x3c')](handleEntityNotFound(_0x160170,null))[_0xa0f2('0x3c')](function(_0x2729e5){if(_0x2729e5){return _0x2729e5[_0xa0f2('0x52')](_0x4d92e6[_0xa0f2('0x48')][_0xa0f2('0x53')]||[]);}return null;})[_0xa0f2('0x3c')](respondWithResult(_0x160170,null))[_0xa0f2('0x41')](handleError(_0x160170,null));};
\ No newline at end of file
index 3d9f3e3..5dd2d8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf24d=['define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xf24d,0x1f2));var _0xdf24=function(_0x586642,_0x3b2e5d){_0x586642=_0x586642-0x0;var _0xef997a=_0xf24d[_0x586642];return _0xef997a;};'use strict';var _=require('lodash');var util=require(_0xdf24('0x0'));var logger=require(_0xdf24('0x1'))('api');var moment=require(_0xdf24('0x2'));var BPromise=require(_0xdf24('0x3'));var rp=require(_0xdf24('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdf24('0x5'));var attributes=require(_0xdf24('0x6'));module[_0xdf24('0x7')]=function(_0x3f6d20,_0x209501){return _0x3f6d20[_0xdf24('0x8')](_0xdf24('0x9'),attributes,{'tableName':_0xdf24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d18=['exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x4e46cd,_0x21bb28){var _0x5902fa=function(_0x4f746c){while(--_0x4f746c){_0x4e46cd['push'](_0x4e46cd['shift']());}};_0x5902fa(++_0x21bb28);}(_0x2d18,0x1ba));var _0x82d1=function(_0xcff906,_0x31c9b1){_0xcff906=_0xcff906-0x0;var _0x809bbc=_0x2d18[_0xcff906];return _0x809bbc;};'use strict';var _=require(_0x82d1('0x0'));var util=require(_0x82d1('0x1'));var logger=require(_0x82d1('0x2'))(_0x82d1('0x3'));var moment=require('moment');var BPromise=require(_0x82d1('0x4'));var rp=require(_0x82d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x82d1('0x6'));var attributes=require(_0x82d1('0x7'));module[_0x82d1('0x8')]=function(_0xd14b2f,_0x3ceb3e){return _0xd14b2f[_0x82d1('0x9')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 51624da..92d1414 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16e6=['error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x16e6,0xc1));var _0x616e=function(_0x11a962,_0x3cc338){_0x11a962=_0x11a962-0x0;var _0x55d423=_0x16e6[_0x11a962];return _0x55d423;};'use strict';var _=require(_0x616e('0x0'));var util=require('util');var moment=require(_0x616e('0x1'));var BPromise=require(_0x616e('0x2'));var rs=require(_0x616e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x616e('0x4'))['db'];var utils=require(_0x616e('0x5'));var logger=require(_0x616e('0x6'))(_0x616e('0x7'));var config=require(_0x616e('0x8'));var jayson=require(_0x616e('0x9'));var client=jayson['client'][_0x616e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x461fab,_0x38c1e0,_0x580bff){return new BPromise(function(_0x4dec00,_0x3835c0){return client[_0x616e('0xb')](_0x461fab,_0x580bff)[_0x616e('0xc')](function(_0x1eac4d){logger[_0x616e('0xd')](_0x616e('0xe'),_0x38c1e0,_0x616e('0xf'));logger['debug'](_0x616e('0x10'),_0x38c1e0,_0x616e('0xf'),JSON['stringify'](_0x1eac4d));if(_0x1eac4d['error']){if(_0x1eac4d[_0x616e('0x11')]['code']===0x1f4){logger[_0x616e('0x11')](_0x616e('0xe'),_0x38c1e0,_0x1eac4d[_0x616e('0x11')][_0x616e('0x12')]);return _0x3835c0(_0x1eac4d[_0x616e('0x11')][_0x616e('0x12')]);}logger[_0x616e('0x11')](_0x616e('0xe'),_0x38c1e0,_0x1eac4d[_0x616e('0x11')][_0x616e('0x12')]);return _0x4dec00(_0x1eac4d[_0x616e('0x11')][_0x616e('0x12')]);}else{logger['info'](_0x616e('0xe'),_0x38c1e0,_0x616e('0xf'));_0x4dec00(_0x1eac4d[_0x616e('0x13')][_0x616e('0x12')]);}})[_0x616e('0x14')](function(_0x2b25c8){logger[_0x616e('0x11')](_0x616e('0xe'),_0x38c1e0,_0x2b25c8);_0x3835c0(_0x2b25c8);});});}
\ No newline at end of file
+var _0x4872=['jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','../../mysqldb','rpc','../../config/environment'];(function(_0x426c85,_0x3eb32a){var _0x5a73e9=function(_0xc758f0){while(--_0xc758f0){_0x426c85['push'](_0x426c85['shift']());}};_0x5a73e9(++_0x3eb32a);}(_0x4872,0x1da));var _0x2487=function(_0x517648,_0x3e4708){_0x517648=_0x517648-0x0;var _0xb5372a=_0x4872[_0x517648];return _0xb5372a;};'use strict';var _=require('lodash');var util=require(_0x2487('0x0'));var moment=require(_0x2487('0x1'));var BPromise=require(_0x2487('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2487('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2487('0x4'));var config=require(_0x2487('0x5'));var jayson=require(_0x2487('0x6'));var client=jayson[_0x2487('0x7')][_0x2487('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaf663c,_0x2dd462,_0x123612){return new BPromise(function(_0x47d098,_0x1dce7f){return client[_0x2487('0x9')](_0xaf663c,_0x123612)[_0x2487('0xa')](function(_0x193383){logger[_0x2487('0xb')](_0x2487('0xc'),_0x2dd462,_0x2487('0xd'));logger[_0x2487('0xe')](_0x2487('0xf'),_0x2dd462,_0x2487('0xd'),JSON['stringify'](_0x193383));if(_0x193383['error']){if(_0x193383[_0x2487('0x10')][_0x2487('0x11')]===0x1f4){logger[_0x2487('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2dd462,_0x193383[_0x2487('0x10')][_0x2487('0x12')]);return _0x1dce7f(_0x193383['error'][_0x2487('0x12')]);}logger[_0x2487('0x10')](_0x2487('0xc'),_0x2dd462,_0x193383[_0x2487('0x10')][_0x2487('0x12')]);return _0x47d098(_0x193383['error'][_0x2487('0x12')]);}else{logger[_0x2487('0xb')](_0x2487('0xc'),_0x2dd462,_0x2487('0xd'));_0x47d098(_0x193383[_0x2487('0x13')][_0x2487('0x12')]);}})['catch'](function(_0x57c2d3){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2dd462,_0x57c2d3);_0x1dce7f(_0x57c2d3);});});}
\ No newline at end of file
index fb49d01..c93096a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x499d=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','post','put','/:id','update','destroy','exports','multer'];(function(_0xb358eb,_0x1c49c8){var _0x486599=function(_0x4c5c32){while(--_0x4c5c32){_0xb358eb['push'](_0xb358eb['shift']());}};_0x486599(++_0x1c49c8);}(_0x499d,0x1a1));var _0xd499=function(_0x43b6a7,_0xcd8217){_0x43b6a7=_0x43b6a7-0x0;var _0x4c010e=_0x499d[_0x43b6a7];return _0x4c010e;};'use strict';var multer=require(_0xd499('0x0'));var util=require(_0xd499('0x1'));var path=require('path');var timeout=require(_0xd499('0x2'));var express=require(_0xd499('0x3'));var router=express[_0xd499('0x4')]();var fs_extra=require(_0xd499('0x5'));var auth=require(_0xd499('0x6'));var interaction=require(_0xd499('0x7'));var config=require(_0xd499('0x8'));var controller=require(_0xd499('0x9'));router[_0xd499('0xa')]('/',auth[_0xd499('0xb')](),controller[_0xd499('0xc')]);router[_0xd499('0xa')]('/:id',auth[_0xd499('0xb')](),controller['show']);router[_0xd499('0xd')]('/',auth[_0xd499('0xb')](),controller['create']);router[_0xd499('0xe')](_0xd499('0xf'),auth['isAuthenticated'](),controller[_0xd499('0x10')]);router['delete'](_0xd499('0xf'),auth['isAuthenticated'](),controller[_0xd499('0x11')]);module[_0xd499('0x12')]=router;
\ No newline at end of file
+var _0x6634=['../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x123cc3,_0x361fd8){var _0x134ee0=function(_0xdccd6d){while(--_0xdccd6d){_0x123cc3['push'](_0x123cc3['shift']());}};_0x134ee0(++_0x361fd8);}(_0x6634,0x1ed));var _0x4663=function(_0x348daa,_0x596474){_0x348daa=_0x348daa-0x0;var _0xdd795d=_0x6634[_0x348daa];return _0xdd795d;};'use strict';var multer=require(_0x4663('0x0'));var util=require(_0x4663('0x1'));var path=require('path');var timeout=require(_0x4663('0x2'));var express=require(_0x4663('0x3'));var router=express['Router']();var fs_extra=require(_0x4663('0x4'));var auth=require(_0x4663('0x5'));var interaction=require(_0x4663('0x6'));var config=require(_0x4663('0x7'));var controller=require(_0x4663('0x8'));router[_0x4663('0x9')]('/',auth[_0x4663('0xa')](),controller[_0x4663('0xb')]);router[_0x4663('0x9')](_0x4663('0xc'),auth['isAuthenticated'](),controller[_0x4663('0xd')]);router[_0x4663('0xe')]('/',auth[_0x4663('0xa')](),controller[_0x4663('0xf')]);router['put']('/:id',auth[_0x4663('0xa')](),controller[_0x4663('0x10')]);router[_0x4663('0x11')](_0x4663('0xc'),auth[_0x4663('0xa')](),controller[_0x4663('0x12')]);module[_0x4663('0x13')]=router;
\ No newline at end of file
index 23cfb60..d73468e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78dd=['keyValue','picklist','string','STRING','ENUM','sequelize','exports','customVariable'];(function(_0x53580c,_0x213ff6){var _0x4d00ad=function(_0x4c8e9a){while(--_0x4c8e9a){_0x53580c['push'](_0x53580c['shift']());}};_0x4d00ad(++_0x213ff6);}(_0x78dd,0xd5));var _0xd78d=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0x78dd[_0x3df9dd];return _0x4f11e4;};'use strict';var Sequelize=require(_0xd78d('0x0'));module[_0xd78d('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xd78d('0x2'),_0xd78d('0x3'),_0xd78d('0x4')),'defaultValue':_0xd78d('0x5')},'content':{'type':Sequelize[_0xd78d('0x6')]},'key':{'type':Sequelize[_0xd78d('0x6')]},'keyType':{'type':Sequelize[_0xd78d('0x7')](_0xd78d('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd78d('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd78d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd78d('0x6')]}};
\ No newline at end of file
+var _0x1913=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x10df5c,_0x14c714){var _0x9fcba6=function(_0x4d4554){while(--_0x4d4554){_0x10df5c['push'](_0x10df5c['shift']());}};_0x9fcba6(++_0x14c714);}(_0x1913,0x138));var _0x3191=function(_0xe22c59,_0x89456a){_0xe22c59=_0xe22c59-0x0;var _0x90d37c=_0x1913[_0xe22c59];return _0x90d37c;};'use strict';var Sequelize=require(_0x3191('0x0'));module['exports']={'type':{'type':Sequelize[_0x3191('0x1')](_0x3191('0x2'),_0x3191('0x3'),_0x3191('0x4'),_0x3191('0x5'),'picklist'),'defaultValue':_0x3191('0x2')},'content':{'type':Sequelize[_0x3191('0x6')]},'key':{'type':Sequelize[_0x3191('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x3191('0x2'),'variable',_0x3191('0x4'))},'keyContent':{'type':Sequelize[_0x3191('0x6')]},'idField':{'type':Sequelize[_0x3191('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3191('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 89db084..37d8988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb74=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x7a1e2d,_0x5ee9a1){var _0x25b767=function(_0x146ffb){while(--_0x146ffb){_0x7a1e2d['push'](_0x7a1e2d['shift']());}};_0x25b767(++_0x5ee9a1);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4cd2ae,_0xfec891){_0x4cd2ae=_0x4cd2ae-0x0;var _0x573eb7=_0xeb74[_0x4cd2ae];return _0x573eb7;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={},_0x17030a={},_0x3ed224={'count':0x0,'rows':[]};var _0x50209d=_[_0x4eb7('0x2e')](db['FreshdeskField'][_0x4eb7('0x2f')],function(_0x13f71a){return{'name':_0x13f71a[_0x4eb7('0x30')],'type':_0x13f71a[_0x4eb7('0x31')][_0x4eb7('0x32')]};});_0x17030a[_0x4eb7('0x33')]=_[_0x4eb7('0x2e')](_0x50209d,_0x4eb7('0x2b'));_0x17030a[_0x4eb7('0x34')]=_['keys'](_0x33a2c1[_0x4eb7('0x34')]);_0x17030a['filters']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],_0x17030a['query']);_0x114c68['attributes']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x33a2c1[_0x4eb7('0x34')]['fields']));_0x114c68[_0x4eb7('0x37')]=_0x114c68[_0x4eb7('0x37')][_0x4eb7('0x38')]?_0x114c68[_0x4eb7('0x37')]:_0x17030a[_0x4eb7('0x33')];if(!_0x33a2c1['query'][_0x4eb7('0x39')](_0x4eb7('0x3a'))){_0x114c68[_0x4eb7('0x1d')]=qs['limit'](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x1d')]);_0x114c68[_0x4eb7('0x1b')]=qs['offset'](_0x33a2c1[_0x4eb7('0x34')]['offset']);}_0x114c68[_0x4eb7('0x3b')]=qs[_0x4eb7('0x3c')](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x3c')]);_0x114c68['where']=qs[_0x4eb7('0x3d')](_[_0x4eb7('0x3e')](_0x33a2c1[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x3d')]),_0x50209d);if(_0x33a2c1['query']['filter']){_0x114c68['where']=_[_0x4eb7('0x3f')](_0x114c68[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x2e')](_0x50209d,function(_0x20ac7b){if(_0x20ac7b[_0x4eb7('0x31')]!==_0x4eb7('0x41')){var _0x1038c1={};_0x1038c1[_0x20ac7b[_0x4eb7('0x2b')]]={'$like':'%'+_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x42')]+'%'};return _0x1038c1;}})});}_0x114c68=_['merge']({},_0x114c68,_0x33a2c1[_0x4eb7('0x43')]);var _0x38218f={'where':_0x114c68[_0x4eb7('0x40')]};return db[_0x4eb7('0x44')][_0x4eb7('0x1e')](_0x38218f)[_0x4eb7('0x25')](function(_0x704d4d){_0x3ed224[_0x4eb7('0x1e')]=_0x704d4d;if(_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x114c68[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x44')][_0x4eb7('0x47')](_0x114c68);})[_0x4eb7('0x25')](function(_0x38af1f){_0x3ed224[_0x4eb7('0x48')]=_0x38af1f;return _0x3ed224;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x28fda8,_0x114c68))[_0x4eb7('0x49')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x4a')]=function(_0x79aec5,_0x5eff9e){var _0x2fd5c2={'raw':!![],'where':{'id':_0x79aec5[_0x4eb7('0x4b')]['id']}},_0x2df542={};_0x2df542[_0x4eb7('0x33')]=_[_0x4eb7('0x4c')](db[_0x4eb7('0x44')][_0x4eb7('0x2f')]);_0x2df542[_0x4eb7('0x34')]=_[_0x4eb7('0x4c')](_0x79aec5['query']);_0x2df542[_0x4eb7('0x3d')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],_0x2df542[_0x4eb7('0x34')]);_0x2fd5c2[_0x4eb7('0x37')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x36')]));_0x2fd5c2['attributes']=_0x2fd5c2[_0x4eb7('0x37')]['length']?_0x2fd5c2[_0x4eb7('0x37')]:_0x2df542[_0x4eb7('0x33')];if(_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x2fd5c2[_0x4eb7('0x46')]=[{'all':!![]}];}_0x2fd5c2=_['merge']({},_0x2fd5c2,_0x79aec5['options']);return db[_0x4eb7('0x44')][_0x4eb7('0x4d')](_0x2fd5c2)[_0x4eb7('0x25')](handleEntityNotFound(_0x5eff9e,null))[_0x4eb7('0x25')](respondWithResult(_0x5eff9e,null))[_0x4eb7('0x49')](handleError(_0x5eff9e,null));};exports['create']=function(_0x6086,_0x104284){return db['FreshdeskField'][_0x4eb7('0x4e')](_0x6086[_0x4eb7('0x4f')],{})['then'](respondWithResult(_0x104284,0xc9))[_0x4eb7('0x49')](handleError(_0x104284,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){if(_0x3c8049[_0x4eb7('0x4f')]['id']){delete _0x3c8049['body']['id'];}return db['FreshdeskField'][_0x4eb7('0x4d')]({'where':{'id':_0x3c8049[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x25')](saveUpdates(_0x3c8049[_0x4eb7('0x4f')],null))[_0x4eb7('0x25')](respondWithResult(_0x5774d5,null))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports[_0x4eb7('0x26')]=function(_0x2913c5,_0x23c0d5){return db[_0x4eb7('0x44')][_0x4eb7('0x4d')]({'where':{'id':_0x2913c5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x23c0d5,null))[_0x4eb7('0x25')](removeEntity(_0x23c0d5,null))[_0x4eb7('0x49')](handleError(_0x23c0d5,null));};
\ No newline at end of file
+var _0x49e9=['status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','FreshdeskField','rawAttributes','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x949e('0x0'));var rimraf=require(_0x949e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x949e('0x2'));var rp=require(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x949e('0x5'));var path=require('path');var sox=require(_0x949e('0x6'));var csv=require(_0x949e('0x7'));var ejs=require(_0x949e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x949e('0x9'));var squel=require(_0x949e('0xa'));var crypto=require(_0x949e('0xb'));var jsforce=require(_0x949e('0xc'));var deskjs=require(_0x949e('0xd'));var toCsv=require(_0x949e('0x7'));var querystring=require(_0x949e('0xe'));var Papa=require('papaparse');var Redis=require(_0x949e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x949e('0x10'));var as=require(_0x949e('0x11'));var hardwareService=require(_0x949e('0x12'));var logger=require('../../config/logger')(_0x949e('0x13'));var utils=require(_0x949e('0x14'));var config=require(_0x949e('0x15'));var licenseUtil=require(_0x949e('0x16'));var db=require(_0x949e('0x17'))['db'];function respondWithStatusCode(_0x253d5e,_0x1871a5){_0x1871a5=_0x1871a5||0xcc;return function(_0x17d1f3){if(_0x17d1f3){return _0x253d5e[_0x949e('0x18')](_0x1871a5);}return _0x253d5e[_0x949e('0x19')](_0x1871a5)[_0x949e('0x1a')]();};}function respondWithResult(_0x7a8954,_0x3e0e54){_0x3e0e54=_0x3e0e54||0xc8;return function(_0x7f8be2){if(_0x7f8be2){return _0x7a8954[_0x949e('0x19')](_0x3e0e54)['json'](_0x7f8be2);}};}function respondWithFilteredResult(_0x257981,_0x3d81cd){return function(_0x587bff){if(_0x587bff){var _0xf1f41a=typeof _0x3d81cd['offset']===_0x949e('0x1b')&&typeof _0x3d81cd[_0x949e('0x1c')]==='undefined';var _0x37fd96=_0x587bff[_0x949e('0x1d')];var _0x43498d=_0xf1f41a?0x0:_0x3d81cd[_0x949e('0x1e')];var _0x20333c=_0xf1f41a?_0x587bff['count']:_0x3d81cd[_0x949e('0x1e')]+_0x3d81cd[_0x949e('0x1c')];var _0x476fa8;if(_0x20333c>=_0x37fd96){_0x20333c=_0x37fd96;_0x476fa8=0xc8;}else{_0x476fa8=0xce;}_0x257981[_0x949e('0x19')](_0x476fa8);return _0x257981[_0x949e('0x1f')](_0x949e('0x20'),_0x43498d+'-'+_0x20333c+'/'+_0x37fd96)[_0x949e('0x21')](_0x587bff);}return null;};}function patchUpdates(_0x2f21bd){return function(_0x104740){try{jsonpatch[_0x949e('0x22')](_0x104740,_0x2f21bd,!![]);}catch(_0x23fc20){return BPromise[_0x949e('0x23')](_0x23fc20);}return _0x104740[_0x949e('0x24')]();};}function saveUpdates(_0x1927ab,_0x199d53){return function(_0x2e81f2){if(_0x2e81f2){return _0x2e81f2['update'](_0x1927ab)[_0x949e('0x25')](function(_0x44ffb4){return _0x44ffb4;});}return null;};}function removeEntity(_0x5572ae,_0x48a1d1){return function(_0x23b38e){if(_0x23b38e){return _0x23b38e[_0x949e('0x26')]()[_0x949e('0x25')](function(){_0x5572ae[_0x949e('0x19')](0xcc)[_0x949e('0x1a')]();});}};}function handleEntityNotFound(_0x1185b3,_0x29e07b){return function(_0x255b11){if(!_0x255b11){_0x1185b3[_0x949e('0x18')](0x194);}return _0x255b11;};}function handleError(_0x20258c,_0x5dcc46){_0x5dcc46=_0x5dcc46||0x1f4;return function(_0x212224){logger[_0x949e('0x27')](_0x212224['stack']);if(_0x212224[_0x949e('0x28')]){delete _0x212224[_0x949e('0x28')];}_0x20258c['status'](_0x5dcc46)[_0x949e('0x29')](_0x212224);};}exports[_0x949e('0x2a')]=function(_0x5b9f28,_0x1867d9){var _0x5b2b0b={},_0x5e6e34={},_0x4e169d={'count':0x0,'rows':[]};var _0x54ad5d=_['map'](db[_0x949e('0x2b')][_0x949e('0x2c')],function(_0x3051ec){return{'name':_0x3051ec['fieldName'],'type':_0x3051ec['type']['key']};});_0x5e6e34['model']=_[_0x949e('0x2d')](_0x54ad5d,_0x949e('0x28'));_0x5e6e34[_0x949e('0x2e')]=_[_0x949e('0x2f')](_0x5b9f28['query']);_0x5e6e34[_0x949e('0x30')]=_[_0x949e('0x31')](_0x5e6e34[_0x949e('0x32')],_0x5e6e34['query']);_0x5b2b0b[_0x949e('0x33')]=_[_0x949e('0x31')](_0x5e6e34[_0x949e('0x32')],qs['fields'](_0x5b9f28['query'][_0x949e('0x34')]));_0x5b2b0b[_0x949e('0x33')]=_0x5b2b0b[_0x949e('0x33')][_0x949e('0x35')]?_0x5b2b0b['attributes']:_0x5e6e34[_0x949e('0x32')];if(!_0x5b9f28[_0x949e('0x2e')][_0x949e('0x36')](_0x949e('0x37'))){_0x5b2b0b[_0x949e('0x1c')]=qs[_0x949e('0x1c')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x1c')]);_0x5b2b0b['offset']=qs['offset'](_0x5b9f28[_0x949e('0x2e')]['offset']);}_0x5b2b0b['order']=qs[_0x949e('0x38')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x38')]);_0x5b2b0b[_0x949e('0x39')]=qs[_0x949e('0x30')](_[_0x949e('0x3a')](_0x5b9f28[_0x949e('0x2e')],_0x5e6e34[_0x949e('0x30')]),_0x54ad5d);if(_0x5b9f28[_0x949e('0x2e')][_0x949e('0x3b')]){_0x5b2b0b[_0x949e('0x39')]=_[_0x949e('0x3c')](_0x5b2b0b[_0x949e('0x39')],{'$or':_[_0x949e('0x2d')](_0x54ad5d,function(_0x26ad2b){if(_0x26ad2b[_0x949e('0x3d')]!==_0x949e('0x3e')){var _0x498fa3={};_0x498fa3[_0x26ad2b[_0x949e('0x28')]]={'$like':'%'+_0x5b9f28['query'][_0x949e('0x3b')]+'%'};return _0x498fa3;}})});}_0x5b2b0b=_[_0x949e('0x3c')]({},_0x5b2b0b,_0x5b9f28['options']);var _0x5084dc={'where':_0x5b2b0b['where']};return db[_0x949e('0x2b')][_0x949e('0x1d')](_0x5084dc)['then'](function(_0x59c024){_0x4e169d['count']=_0x59c024;if(_0x5b9f28[_0x949e('0x2e')][_0x949e('0x3f')]){_0x5b2b0b['include']=[{'all':!![]}];}return db[_0x949e('0x2b')][_0x949e('0x40')](_0x5b2b0b);})['then'](function(_0x3a1bc7){_0x4e169d[_0x949e('0x41')]=_0x3a1bc7;return _0x4e169d;})[_0x949e('0x25')](respondWithFilteredResult(_0x1867d9,_0x5b2b0b))[_0x949e('0x42')](handleError(_0x1867d9,null));};exports['show']=function(_0x58b34b,_0x2bca69){var _0x590aa7={'raw':!![],'where':{'id':_0x58b34b[_0x949e('0x43')]['id']}},_0x7201da={};_0x7201da[_0x949e('0x32')]=_[_0x949e('0x2f')](db[_0x949e('0x2b')]['rawAttributes']);_0x7201da['query']=_[_0x949e('0x2f')](_0x58b34b['query']);_0x7201da[_0x949e('0x30')]=_[_0x949e('0x31')](_0x7201da[_0x949e('0x32')],_0x7201da[_0x949e('0x2e')]);_0x590aa7[_0x949e('0x33')]=_[_0x949e('0x31')](_0x7201da['model'],qs['fields'](_0x58b34b[_0x949e('0x2e')][_0x949e('0x34')]));_0x590aa7[_0x949e('0x33')]=_0x590aa7[_0x949e('0x33')][_0x949e('0x35')]?_0x590aa7['attributes']:_0x7201da[_0x949e('0x32')];if(_0x58b34b[_0x949e('0x2e')]['includeAll']){_0x590aa7[_0x949e('0x44')]=[{'all':!![]}];}_0x590aa7=_[_0x949e('0x3c')]({},_0x590aa7,_0x58b34b[_0x949e('0x45')]);return db[_0x949e('0x2b')][_0x949e('0x46')](_0x590aa7)[_0x949e('0x25')](handleEntityNotFound(_0x2bca69,null))[_0x949e('0x25')](respondWithResult(_0x2bca69,null))[_0x949e('0x42')](handleError(_0x2bca69,null));};exports[_0x949e('0x47')]=function(_0x4913f5,_0x1599ea){return db['FreshdeskField'][_0x949e('0x47')](_0x4913f5[_0x949e('0x48')],{})['then'](respondWithResult(_0x1599ea,0xc9))[_0x949e('0x42')](handleError(_0x1599ea,null));};exports[_0x949e('0x49')]=function(_0x121355,_0x2e2b6a){if(_0x121355[_0x949e('0x48')]['id']){delete _0x121355[_0x949e('0x48')]['id'];}return db[_0x949e('0x2b')][_0x949e('0x46')]({'where':{'id':_0x121355['params']['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x2e2b6a,null))[_0x949e('0x25')](saveUpdates(_0x121355[_0x949e('0x48')],null))[_0x949e('0x25')](respondWithResult(_0x2e2b6a,null))[_0x949e('0x42')](handleError(_0x2e2b6a,null));};exports['destroy']=function(_0x5f23b2,_0x46a4fe){return db[_0x949e('0x2b')]['find']({'where':{'id':_0x5f23b2[_0x949e('0x43')]['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x46a4fe,null))[_0x949e('0x25')](removeEntity(_0x46a4fe,null))[_0x949e('0x42')](handleError(_0x46a4fe,null));};
\ No newline at end of file
index 3db9d09..6890e05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38a9=['define','int_freshdesk_fields','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x4defb4,_0x315d3e){var _0x46ab7c=function(_0x294767){while(--_0x294767){_0x4defb4['push'](_0x4defb4['shift']());}};_0x46ab7c(++_0x315d3e);}(_0x38a9,0xb6));var _0x938a=function(_0x4c33a9,_0x3cb96c){_0x4c33a9=_0x4c33a9-0x0;var _0x6b85e3=_0x38a9[_0x4c33a9];return _0x6b85e3;};'use strict';var _=require(_0x938a('0x0'));var util=require(_0x938a('0x1'));var logger=require(_0x938a('0x2'))(_0x938a('0x3'));var moment=require(_0x938a('0x4'));var BPromise=require('bluebird');var rp=require(_0x938a('0x5'));var fs=require('fs');var path=require(_0x938a('0x6'));var rimraf=require('rimraf');var config=require(_0x938a('0x7'));var attributes=require(_0x938a('0x8'));module[_0x938a('0x9')]=function(_0x1904d3,_0x22d249){return _0x1904d3[_0x938a('0xa')]('FreshdeskField',attributes,{'tableName':_0x938a('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0e4=['util','../../config/logger','api','moment','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','lodash'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xb0e4,0x15e));var _0x4b0e=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xb0e4[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x4b0e('0x0'));var util=require(_0x4b0e('0x1'));var logger=require(_0x4b0e('0x2'))(_0x4b0e('0x3'));var moment=require(_0x4b0e('0x4'));var BPromise=require('bluebird');var rp=require(_0x4b0e('0x5'));var fs=require('fs');var path=require(_0x4b0e('0x6'));var rimraf=require(_0x4b0e('0x7'));var config=require('../../config/environment');var attributes=require(_0x4b0e('0x8'));module[_0x4b0e('0x9')]=function(_0xbaa1b9,_0x5025fc){return _0xbaa1b9['define'](_0x4b0e('0xa'),attributes,{'tableName':_0x4b0e('0xb'),'paranoid':![],'indexes':[{'name':_0x4b0e('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6ee4f88..0bb09af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7f7=['request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x50cc6e,_0x599ef2){var _0x1e0984=function(_0x34b63e){while(--_0x34b63e){_0x50cc6e['push'](_0x50cc6e['shift']());}};_0x1e0984(++_0x599ef2);}(_0xe7f7,0x1d4));var _0x7e7f=function(_0x460f81,_0x553431){_0x460f81=_0x460f81-0x0;var _0x423f0d=_0xe7f7[_0x460f81];return _0x423f0d;};'use strict';var _=require(_0x7e7f('0x0'));var util=require('util');var moment=require(_0x7e7f('0x1'));var BPromise=require(_0x7e7f('0x2'));var rs=require(_0x7e7f('0x3'));var fs=require('fs');var Redis=require(_0x7e7f('0x4'));var db=require(_0x7e7f('0x5'))['db'];var utils=require(_0x7e7f('0x6'));var logger=require(_0x7e7f('0x7'))(_0x7e7f('0x8'));var config=require('../../config/environment');var jayson=require(_0x7e7f('0x9'));var client=jayson[_0x7e7f('0xa')][_0x7e7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d23cb,_0x5aeccd,_0xde63c2){return new BPromise(function(_0x345420,_0x19f9d1){return client[_0x7e7f('0xc')](_0x3d23cb,_0xde63c2)[_0x7e7f('0xd')](function(_0x387a90){logger[_0x7e7f('0xe')](_0x7e7f('0xf'),_0x5aeccd,_0x7e7f('0x10'));logger[_0x7e7f('0x11')](_0x7e7f('0x12'),_0x5aeccd,_0x7e7f('0x10'),JSON[_0x7e7f('0x13')](_0x387a90));if(_0x387a90[_0x7e7f('0x14')]){if(_0x387a90[_0x7e7f('0x14')]['code']===0x1f4){logger[_0x7e7f('0x14')](_0x7e7f('0xf'),_0x5aeccd,_0x387a90[_0x7e7f('0x14')][_0x7e7f('0x15')]);return _0x19f9d1(_0x387a90[_0x7e7f('0x14')][_0x7e7f('0x15')]);}logger[_0x7e7f('0x14')](_0x7e7f('0xf'),_0x5aeccd,_0x387a90[_0x7e7f('0x14')]['message']);return _0x345420(_0x387a90[_0x7e7f('0x14')][_0x7e7f('0x15')]);}else{logger[_0x7e7f('0xe')](_0x7e7f('0xf'),_0x5aeccd,_0x7e7f('0x10'));_0x345420(_0x387a90[_0x7e7f('0x16')][_0x7e7f('0x15')]);}})[_0x7e7f('0x17')](function(_0x162160){logger[_0x7e7f('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x5aeccd,_0x162160);_0x19f9d1(_0x162160);});});}
\ No newline at end of file
+var _0x6761=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','util','moment','bluebird'];(function(_0x56328b,_0x5e8093){var _0x21c020=function(_0xfb45a0){while(--_0xfb45a0){_0x56328b['push'](_0x56328b['shift']());}};_0x21c020(++_0x5e8093);}(_0x6761,0x184));var _0x1676=function(_0xdf196a,_0xecadb3){_0xdf196a=_0xdf196a-0x0;var _0x2f6100=_0x6761[_0xdf196a];return _0x2f6100;};'use strict';var _=require('lodash');var util=require(_0x1676('0x0'));var moment=require(_0x1676('0x1'));var BPromise=require(_0x1676('0x2'));var rs=require(_0x1676('0x3'));var fs=require('fs');var Redis=require(_0x1676('0x4'));var db=require(_0x1676('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1676('0x6'))(_0x1676('0x7'));var config=require('../../config/environment');var jayson=require(_0x1676('0x8'));var client=jayson[_0x1676('0x9')][_0x1676('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x243758,_0xe0cc74,_0x45bcaf){return new BPromise(function(_0x56e2f2,_0x4b428e){return client[_0x1676('0xb')](_0x243758,_0x45bcaf)[_0x1676('0xc')](function(_0x1136a8){logger['info'](_0x1676('0xd'),_0xe0cc74,'request\x20sent');logger['debug'](_0x1676('0xe'),_0xe0cc74,'request\x20sent',JSON[_0x1676('0xf')](_0x1136a8));if(_0x1136a8[_0x1676('0x10')]){if(_0x1136a8[_0x1676('0x10')][_0x1676('0x11')]===0x1f4){logger[_0x1676('0x10')](_0x1676('0xd'),_0xe0cc74,_0x1136a8[_0x1676('0x10')]['message']);return _0x4b428e(_0x1136a8['error'][_0x1676('0x12')]);}logger[_0x1676('0x10')](_0x1676('0xd'),_0xe0cc74,_0x1136a8[_0x1676('0x10')][_0x1676('0x12')]);return _0x56e2f2(_0x1136a8[_0x1676('0x10')][_0x1676('0x12')]);}else{logger[_0x1676('0x13')](_0x1676('0xd'),_0xe0cc74,_0x1676('0x14'));_0x56e2f2(_0x1136a8[_0x1676('0x15')][_0x1676('0x12')]);}})[_0x1676('0x16')](function(_0x3eb410){logger[_0x1676('0x10')](_0x1676('0xd'),_0xe0cc74,_0x3eb410);_0x4b428e(_0x3eb410);});});}
\ No newline at end of file
index ba303af..203ced9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x593e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','update'];(function(_0x4a80f6,_0x3d43ad){var _0x5bc762=function(_0x1ad68a){while(--_0x1ad68a){_0x4a80f6['push'](_0x4a80f6['shift']());}};_0x5bc762(++_0x3d43ad);}(_0x593e,0xcb));var _0xe593=function(_0xb717c,_0xb64183){_0xb717c=_0xb717c-0x0;var _0x463c17=_0x593e[_0xb717c];return _0x463c17;};'use strict';var multer=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var path=require(_0xe593('0x2'));var timeout=require(_0xe593('0x3'));var express=require(_0xe593('0x4'));var router=express[_0xe593('0x5')]();var fs_extra=require(_0xe593('0x6'));var auth=require(_0xe593('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe593('0x8'));var controller=require(_0xe593('0x9'));router[_0xe593('0xa')]('/',auth[_0xe593('0xb')](),controller[_0xe593('0xc')]);router[_0xe593('0xa')](_0xe593('0xd'),auth[_0xe593('0xb')](),controller[_0xe593('0xe')]);router[_0xe593('0xa')]('/:id/configurations',auth[_0xe593('0xb')](),controller[_0xe593('0xf')]);router[_0xe593('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xe593('0x10')]);router[_0xe593('0x11')]('/',auth[_0xe593('0xb')](),controller['create']);router[_0xe593('0x11')](_0xe593('0x12'),auth[_0xe593('0xb')](),controller[_0xe593('0x13')]);router[_0xe593('0x14')](_0xe593('0xd'),auth[_0xe593('0xb')](),controller[_0xe593('0x15')]);router[_0xe593('0x16')](_0xe593('0xd'),auth['isAuthenticated'](),controller[_0xe593('0x17')]);module[_0xe593('0x18')]=router;
\ No newline at end of file
+var _0xb62e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','show','/:id/configurations','/:id/fields','getFields','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x37c61d,_0x4d801a){var _0x9b2c4f=function(_0x3d2cee){while(--_0x3d2cee){_0x37c61d['push'](_0x37c61d['shift']());}};_0x9b2c4f(++_0x4d801a);}(_0xb62e,0x1de));var _0xeb62=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb62e[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xc')](_0xeb62('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xeb62('0xc')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')]('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x11')](_0xeb62('0xe'),auth[_0xeb62('0xa')](),controller['addConfiguration']);router[_0xeb62('0x13')](_0xeb62('0x14'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x15')]);router['delete'](_0xeb62('0x14'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x16')]);module['exports']=router;
\ No newline at end of file
index 587c1bc..0f0edc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4325=['exports','STRING','username','remoteUri','sequelize'];(function(_0x8c2b02,_0x59f71d){var _0xfeec1b=function(_0x525805){while(--_0x525805){_0x8c2b02['push'](_0x8c2b02['shift']());}};_0xfeec1b(++_0x59f71d);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5432('0x2')]},'username':{'type':Sequelize[_0x5432('0x2')],'unique':_0x5432('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5432('0x4')},'serverUrl':{'type':Sequelize[_0x5432('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x8f4c=['sequelize','exports','STRING','username','remoteUri'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5104ec,_0x11722d){_0x5104ec=_0x5104ec-0x0;var _0x22b805=_0x8f4c[_0x5104ec];return _0x22b805;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')]},'description':{'type':Sequelize[_0xc8f4('0x2')]},'username':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x4')},'serverUrl':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]}};
\ No newline at end of file
index 44204fb..cce0848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d45=['lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','FreshsalesAccount','body','params','find','FreshsalesConfiguration','sort','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','getFields','username','remoteUri','lastIndexOf','GET','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','mustache','util','path','to-csv','fs-extra'];(function(_0x34bf9a,_0x1376da){var _0x16266d=function(_0x3a5363){while(--_0x3a5363){_0x34bf9a['push'](_0x34bf9a['shift']());}};_0x16266d(++_0x1376da);}(_0x1d45,0x1e7));var _0x51d4=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x1d45[_0xbf8ebe];return _0x1e25e8;};'use strict';var emlformat=require(_0x51d4('0x0'));var rimraf=require(_0x51d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51d4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51d4('0x3'));var util=require(_0x51d4('0x4'));var path=require(_0x51d4('0x5'));var sox=require('sox');var csv=require(_0x51d4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51d4('0x7'));var _=require(_0x51d4('0x8'));var squel=require(_0x51d4('0x9'));var crypto=require(_0x51d4('0xa'));var jsforce=require(_0x51d4('0xb'));var deskjs=require(_0x51d4('0xc'));var toCsv=require(_0x51d4('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x51d4('0xd'));var authService=require(_0x51d4('0xe'));var qs=require(_0x51d4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x51d4('0x10'))(_0x51d4('0x11'));var utils=require(_0x51d4('0x12'));var config=require(_0x51d4('0x13'));var licenseUtil=require(_0x51d4('0x14'));var db=require(_0x51d4('0x15'))['db'];var integrations=require(_0x51d4('0x16'));function respondWithStatusCode(_0x171360,_0x58826c){_0x58826c=_0x58826c||0xcc;return function(_0x42ebc6){if(_0x42ebc6){return _0x171360[_0x51d4('0x17')](_0x58826c);}return _0x171360[_0x51d4('0x18')](_0x58826c)['end']();};}function respondWithResult(_0x1252bd,_0x51b40c){_0x51b40c=_0x51b40c||0xc8;return function(_0x55381f){if(_0x55381f){return _0x1252bd[_0x51d4('0x18')](_0x51b40c)[_0x51d4('0x19')](_0x55381f);}};}function respondWithFilteredResult(_0x56bfa8,_0x213c5e){return function(_0x29ed8f){if(_0x29ed8f){var _0x1049e4=typeof _0x213c5e[_0x51d4('0x1a')]==='undefined'&&typeof _0x213c5e['limit']===_0x51d4('0x1b');var _0xd4fb22=_0x29ed8f[_0x51d4('0x1c')];var _0x4bf81d=_0x1049e4?0x0:_0x213c5e[_0x51d4('0x1a')];var _0x3717e1=_0x1049e4?_0x29ed8f[_0x51d4('0x1c')]:_0x213c5e[_0x51d4('0x1a')]+_0x213c5e[_0x51d4('0x1d')];var _0x2ec09a;if(_0x3717e1>=_0xd4fb22){_0x3717e1=_0xd4fb22;_0x2ec09a=0xc8;}else{_0x2ec09a=0xce;}_0x56bfa8[_0x51d4('0x18')](_0x2ec09a);return _0x56bfa8[_0x51d4('0x1e')](_0x51d4('0x1f'),_0x4bf81d+'-'+_0x3717e1+'/'+_0xd4fb22)[_0x51d4('0x19')](_0x29ed8f);}return null;};}function patchUpdates(_0x12ba46){return function(_0x8181ce){try{jsonpatch[_0x51d4('0x20')](_0x8181ce,_0x12ba46,!![]);}catch(_0xaf5ab5){return BPromise[_0x51d4('0x21')](_0xaf5ab5);}return _0x8181ce[_0x51d4('0x22')]();};}function saveUpdates(_0x28982f,_0x5deda2){return function(_0x2a9490){if(_0x2a9490){return _0x2a9490[_0x51d4('0x23')](_0x28982f)[_0x51d4('0x24')](function(_0x33cfb4){return _0x33cfb4;});}return null;};}function removeEntity(_0xd69ffe,_0x59799d){return function(_0x2244f9){if(_0x2244f9){return _0x2244f9[_0x51d4('0x25')]()[_0x51d4('0x24')](function(){_0xd69ffe[_0x51d4('0x18')](0xcc)[_0x51d4('0x26')]();});}};}function handleEntityNotFound(_0x478cf6,_0x11bbf1){return function(_0x1c5b36){if(!_0x1c5b36){_0x478cf6[_0x51d4('0x17')](0x194);}return _0x1c5b36;};}function handleError(_0xfef259,_0x367960){_0x367960=_0x367960||0x1f4;return function(_0x4486e5){logger['error'](_0x4486e5['stack']);if(_0x4486e5[_0x51d4('0x27')]){delete _0x4486e5[_0x51d4('0x27')];}_0xfef259[_0x51d4('0x18')](_0x367960)[_0x51d4('0x28')](_0x4486e5);};}exports[_0x51d4('0x29')]=function(_0x4b4e61,_0x227a64){var _0x2616c4={},_0x493a8d={},_0x5ed513={'count':0x0,'rows':[]};var _0x818d9a=_[_0x51d4('0x2a')](db['FreshsalesAccount'][_0x51d4('0x2b')],function(_0x7156af){return{'name':_0x7156af[_0x51d4('0x2c')],'type':_0x7156af[_0x51d4('0x2d')][_0x51d4('0x2e')]};});_0x493a8d['model']=_['map'](_0x818d9a,'name');_0x493a8d[_0x51d4('0x2f')]=_[_0x51d4('0x30')](_0x4b4e61['query']);_0x493a8d['filters']=_['intersection'](_0x493a8d[_0x51d4('0x31')],_0x493a8d[_0x51d4('0x2f')]);_0x2616c4[_0x51d4('0x32')]=_[_0x51d4('0x33')](_0x493a8d[_0x51d4('0x31')],qs['fields'](_0x4b4e61[_0x51d4('0x2f')][_0x51d4('0x34')]));_0x2616c4[_0x51d4('0x32')]=_0x2616c4[_0x51d4('0x32')][_0x51d4('0x35')]?_0x2616c4[_0x51d4('0x32')]:_0x493a8d[_0x51d4('0x31')];if(!_0x4b4e61[_0x51d4('0x2f')]['hasOwnProperty'](_0x51d4('0x36'))){_0x2616c4[_0x51d4('0x1d')]=qs[_0x51d4('0x1d')](_0x4b4e61['query']['limit']);_0x2616c4['offset']=qs[_0x51d4('0x1a')](_0x4b4e61[_0x51d4('0x2f')][_0x51d4('0x1a')]);}_0x2616c4[_0x51d4('0x37')]=qs['sort'](_0x4b4e61['query']['sort']);_0x2616c4[_0x51d4('0x38')]=qs[_0x51d4('0x39')](_[_0x51d4('0x3a')](_0x4b4e61[_0x51d4('0x2f')],_0x493a8d['filters']),_0x818d9a);if(_0x4b4e61[_0x51d4('0x2f')][_0x51d4('0x3b')]){_0x2616c4[_0x51d4('0x38')]=_['merge'](_0x2616c4[_0x51d4('0x38')],{'$or':_[_0x51d4('0x2a')](_0x818d9a,function(_0x294add){if(_0x294add['type']!==_0x51d4('0x3c')){var _0x271c8a={};_0x271c8a[_0x294add[_0x51d4('0x27')]]={'$like':'%'+_0x4b4e61['query'][_0x51d4('0x3b')]+'%'};return _0x271c8a;}})});}_0x2616c4=_[_0x51d4('0x3d')]({},_0x2616c4,_0x4b4e61['options']);var _0xa8488d={'where':_0x2616c4[_0x51d4('0x38')]};return db['FreshsalesAccount'][_0x51d4('0x1c')](_0xa8488d)['then'](function(_0x54b56f){_0x5ed513[_0x51d4('0x1c')]=_0x54b56f;if(_0x4b4e61['query'][_0x51d4('0x3e')]){_0x2616c4[_0x51d4('0x3f')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x51d4('0x40')](_0x2616c4);})['then'](function(_0x55d078){_0x5ed513[_0x51d4('0x41')]=_0x55d078;return _0x5ed513;})[_0x51d4('0x24')](respondWithFilteredResult(_0x227a64,_0x2616c4))[_0x51d4('0x42')](handleError(_0x227a64,null));};exports[_0x51d4('0x43')]=function(_0xbef0ae,_0x160281){var _0x22772e={'raw':![],'where':{'id':_0xbef0ae['params']['id']}},_0x22116b={};_0x22116b['model']=_[_0x51d4('0x30')](db['FreshsalesAccount'][_0x51d4('0x2b')]);_0x22116b[_0x51d4('0x2f')]=_[_0x51d4('0x30')](_0xbef0ae[_0x51d4('0x2f')]);_0x22116b[_0x51d4('0x39')]=_['intersection'](_0x22116b[_0x51d4('0x31')],_0x22116b[_0x51d4('0x2f')]);_0x22772e[_0x51d4('0x32')]=_['intersection'](_0x22116b[_0x51d4('0x31')],qs[_0x51d4('0x34')](_0xbef0ae[_0x51d4('0x2f')][_0x51d4('0x34')]));_0x22772e['attributes']=_0x22772e[_0x51d4('0x32')]['length']?_0x22772e[_0x51d4('0x32')]:_0x22116b['model'];if(_0xbef0ae[_0x51d4('0x2f')][_0x51d4('0x3e')]){_0x22772e[_0x51d4('0x3f')]=[{'all':!![]}];}_0x22772e=_[_0x51d4('0x3d')]({},_0x22772e,_0xbef0ae['options']);return db[_0x51d4('0x44')]['find'](_0x22772e)[_0x51d4('0x24')](handleEntityNotFound(_0x160281,null))[_0x51d4('0x24')](respondWithResult(_0x160281,null))[_0x51d4('0x42')](handleError(_0x160281,null));};exports['create']=function(_0x545476,_0x13b746){return db['FreshsalesAccount']['create'](_0x545476[_0x51d4('0x45')],{})[_0x51d4('0x24')](respondWithResult(_0x13b746,0xc9))['catch'](handleError(_0x13b746,null));};exports[_0x51d4('0x23')]=function(_0x25751e,_0x21a47f){if(_0x25751e[_0x51d4('0x45')]['id']){delete _0x25751e[_0x51d4('0x45')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x25751e[_0x51d4('0x46')]['id']}})[_0x51d4('0x24')](handleEntityNotFound(_0x21a47f,null))[_0x51d4('0x24')](saveUpdates(_0x25751e[_0x51d4('0x45')],null))[_0x51d4('0x24')](respondWithResult(_0x21a47f,null))[_0x51d4('0x42')](handleError(_0x21a47f,null));};exports[_0x51d4('0x25')]=function(_0x5407cd,_0x10d65d){return db[_0x51d4('0x44')][_0x51d4('0x47')]({'where':{'id':_0x5407cd['params']['id']}})[_0x51d4('0x24')](handleEntityNotFound(_0x10d65d,null))[_0x51d4('0x24')](removeEntity(_0x10d65d,null))[_0x51d4('0x42')](handleError(_0x10d65d,null));};exports['getConfigurations']=function(_0x21df4f,_0x4a99e0,_0x162643){var _0x55e420={};var _0xd637f4={};var _0x1882a5;var _0x4261dd;return db[_0x51d4('0x44')]['findOne']({'where':{'id':_0x21df4f['params']['id']}})[_0x51d4('0x24')](handleEntityNotFound(_0x4a99e0,null))['then'](function(_0x15c1f5){if(_0x15c1f5){_0x1882a5=_0x15c1f5;_0xd637f4[_0x51d4('0x31')]=_[_0x51d4('0x30')](db[_0x51d4('0x48')][_0x51d4('0x2b')]);_0xd637f4['query']=_[_0x51d4('0x30')](_0x21df4f[_0x51d4('0x2f')]);_0xd637f4['filters']=_[_0x51d4('0x33')](_0xd637f4['model'],_0xd637f4[_0x51d4('0x2f')]);_0x55e420[_0x51d4('0x32')]=_[_0x51d4('0x33')](_0xd637f4['model'],qs[_0x51d4('0x34')](_0x21df4f['query'][_0x51d4('0x34')]));_0x55e420[_0x51d4('0x32')]=_0x55e420[_0x51d4('0x32')][_0x51d4('0x35')]?_0x55e420[_0x51d4('0x32')]:_0xd637f4['model'];_0x55e420['order']=qs['sort'](_0x21df4f[_0x51d4('0x2f')][_0x51d4('0x49')]);_0x55e420['where']=qs[_0x51d4('0x39')](_['pick'](_0x21df4f[_0x51d4('0x2f')],_0xd637f4[_0x51d4('0x39')]));if(_0x21df4f[_0x51d4('0x2f')][_0x51d4('0x3b')]){_0x55e420[_0x51d4('0x38')]=_['merge'](_0x55e420['where'],{'$or':_[_0x51d4('0x2a')](_0x55e420['attributes'],function(_0x418475){var _0x44cc4a={};_0x44cc4a[_0x418475]={'$like':'%'+_0x21df4f[_0x51d4('0x2f')][_0x51d4('0x3b')]+'%'};return _0x44cc4a;})});}_0x55e420=_['merge']({},_0x55e420,_0x21df4f['options']);return _0x1882a5['getConfigurations'](_0x55e420);}})[_0x51d4('0x24')](function(_0x24b1c7){if(_0x24b1c7){_0x4261dd=_0x24b1c7[_0x51d4('0x35')];if(!_0x21df4f['query'][_0x51d4('0x4a')](_0x51d4('0x36'))){_0x55e420[_0x51d4('0x1d')]=qs[_0x51d4('0x1d')](_0x21df4f[_0x51d4('0x2f')][_0x51d4('0x1d')]);_0x55e420[_0x51d4('0x1a')]=qs[_0x51d4('0x1a')](_0x21df4f[_0x51d4('0x2f')][_0x51d4('0x1a')]);}return _0x1882a5['getConfigurations'](_0x55e420);}})['then'](function(_0x39c10e){if(_0x39c10e){return _0x39c10e?{'count':_0x4261dd,'rows':_0x39c10e}:null;}})[_0x51d4('0x24')](respondWithResult(_0x4a99e0,null))[_0x51d4('0x42')](handleError(_0x4a99e0,null));};exports[_0x51d4('0x4b')]=function(_0x3bba71,_0x25d788,_0x39f4c2){if(_0x3bba71[_0x51d4('0x45')]['id']){delete _0x3bba71[_0x51d4('0x45')]['id'];}return db['FreshsalesAccount'][_0x51d4('0x4c')]({'where':{'id':_0x3bba71['params']['id']}})['then'](handleEntityNotFound(_0x25d788,null))[_0x51d4('0x24')](function(_0xb94e8a){if(_0xb94e8a){_0x3bba71[_0x51d4('0x45')][_0x51d4('0x4d')]=_0xb94e8a['id'];_0x3bba71[_0x51d4('0x45')][_0x51d4('0x4e')]=integrations[_0x51d4('0x4f')](_0x3bba71[_0x51d4('0x45')][_0x51d4('0x50')],_0x3bba71[_0x51d4('0x45')][_0x51d4('0x2d')]);_0x3bba71[_0x51d4('0x45')][_0x51d4('0x51')]=integrations[_0x51d4('0x52')](_0x3bba71[_0x51d4('0x45')][_0x51d4('0x50')],_0x3bba71[_0x51d4('0x45')][_0x51d4('0x2d')]);return db[_0x51d4('0x48')][_0x51d4('0x53')](_0x3bba71[_0x51d4('0x45')],{'include':[{'model':db['FreshsalesField'],'as':_0x51d4('0x4e')},{'model':db['FreshsalesField'],'as':_0x51d4('0x51')}]});}return null;})[_0x51d4('0x24')](respondWithResult(_0x25d788,null))[_0x51d4('0x42')](handleError(_0x25d788,null));};exports[_0x51d4('0x54')]=function(_0x5509f4,_0xfaa7af,_0x4b195e){var _0x1fe6fa='';var _0x36a5e2='';return db[_0x51d4('0x44')][_0x51d4('0x4c')]({'where':{'id':_0x5509f4['params']['id']},'attributes':['id',_0x51d4('0x55'),_0x51d4('0x56'),'apiKey']})[_0x51d4('0x24')](handleEntityNotFound(_0xfaa7af,null))[_0x51d4('0x24')](function(_0x5c488d){if(_0x5c488d){_0x36a5e2=_0x5c488d['username'];_0x1fe6fa=_0x5c488d[_0x51d4('0x56')];var _0x2fc13c=_0x5c488d['remoteUri']['slice'](-0x1);if(_0x2fc13c==='/'){_0x1fe6fa=_0x1fe6fa['substring'](0x0,_0x1fe6fa[_0x51d4('0x57')](_0x2fc13c));}return rp({'method':_0x51d4('0x58'),'uri':util['format'](_0x51d4('0x59'),_0x1fe6fa,'/api/selector/owners'),'headers':{'Authorization':_0x51d4('0x5a')+_0x5c488d['apiKey']},'json':!![]});}})[_0x51d4('0x24')](function(_0x23d8ac){if(_0x23d8ac){var _0x32aa0c=_0x23d8ac[_0x51d4('0x5b')];var _0x54232b=![];var _0x201984=null;for(_0x201984=0x0;_0x201984<_0x32aa0c['length'];_0x201984++){if(_0x32aa0c[_0x201984]['email']===_0x36a5e2){_0x54232b=!![];}}if(_0x54232b){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x51d4('0x5c')});}}})['then'](respondWithResult(_0xfaa7af,null))[_0x51d4('0x42')](function(_0x717b5){var _0x56dc09=_0x5509f4[_0x51d4('0x2f')][_0x51d4('0x5d')]?0x1f4:_0x717b5[_0x51d4('0x5e')]||0x1f4;logger[_0x51d4('0x5f')](_0x51d4('0x60'),'getFields',_0x56dc09,JSON[_0x51d4('0x61')](_0x717b5));delete _0x717b5['name'];if(_0x56dc09===0x191){_0x56dc09=0x190;}_0xfaa7af[_0x51d4('0x18')](_0x56dc09)['send'](_0x5509f4[_0x51d4('0x2f')][_0x51d4('0x5d')]?{'message':_0x51d4('0x62'),'statusCode':_0x717b5[_0x51d4('0x5e')]}:_0x717b5);});};
\ No newline at end of file
+var _0x35af=['Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','show','FreshsalesAccount','catch','create','body','find','params','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','error','getFields,\x20%s,\x20%s,\x20%s','test','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x371a09,_0x4af484){var _0xcc5945=function(_0x571a1d){while(--_0x571a1d){_0x371a09['push'](_0x371a09['shift']());}};_0xcc5945(++_0x4af484);}(_0x35af,0x10c));var _0xf35a=function(_0xe997f1,_0x5a36bd){_0xe997f1=_0xe997f1-0x0;var _0x182cef=_0x35af[_0xe997f1];return _0x182cef;};'use strict';var emlformat=require(_0xf35a('0x0'));var rimraf=require(_0xf35a('0x1'));var zipdir=require(_0xf35a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf35a('0x3'));var moment=require('moment');var BPromise=require(_0xf35a('0x4'));var Mustache=require(_0xf35a('0x5'));var util=require('util');var path=require(_0xf35a('0x6'));var sox=require('sox');var csv=require(_0xf35a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf35a('0x8'));var _=require(_0xf35a('0x9'));var squel=require('squel');var crypto=require(_0xf35a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf35a('0xb'));var toCsv=require(_0xf35a('0x7'));var querystring=require(_0xf35a('0xc'));var Papa=require(_0xf35a('0xd'));var Redis=require('ioredis');var authService=require(_0xf35a('0xe'));var qs=require(_0xf35a('0xf'));var as=require(_0xf35a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf35a('0x11'))(_0xf35a('0x12'));var utils=require('../../config/utils');var config=require(_0xf35a('0x13'));var licenseUtil=require(_0xf35a('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5abcde,_0x36e4ab){_0x36e4ab=_0x36e4ab||0xcc;return function(_0x31f0f6){if(_0x31f0f6){return _0x5abcde[_0xf35a('0x15')](_0x36e4ab);}return _0x5abcde[_0xf35a('0x16')](_0x36e4ab)[_0xf35a('0x17')]();};}function respondWithResult(_0x44c144,_0x193a03){_0x193a03=_0x193a03||0xc8;return function(_0x1e9743){if(_0x1e9743){return _0x44c144['status'](_0x193a03)['json'](_0x1e9743);}};}function respondWithFilteredResult(_0x1c62c3,_0xa78099){return function(_0x1f8d3e){if(_0x1f8d3e){var _0x4695cb=typeof _0xa78099[_0xf35a('0x18')]===_0xf35a('0x19')&&typeof _0xa78099[_0xf35a('0x1a')]===_0xf35a('0x19');var _0x432102=_0x1f8d3e[_0xf35a('0x1b')];var _0x46ee42=_0x4695cb?0x0:_0xa78099['offset'];var _0x552856=_0x4695cb?_0x1f8d3e['count']:_0xa78099[_0xf35a('0x18')]+_0xa78099['limit'];var _0x13319d;if(_0x552856>=_0x432102){_0x552856=_0x432102;_0x13319d=0xc8;}else{_0x13319d=0xce;}_0x1c62c3[_0xf35a('0x16')](_0x13319d);return _0x1c62c3[_0xf35a('0x1c')](_0xf35a('0x1d'),_0x46ee42+'-'+_0x552856+'/'+_0x432102)[_0xf35a('0x1e')](_0x1f8d3e);}return null;};}function patchUpdates(_0x290c19){return function(_0x135888){try{jsonpatch['apply'](_0x135888,_0x290c19,!![]);}catch(_0x3f6f5d){return BPromise[_0xf35a('0x1f')](_0x3f6f5d);}return _0x135888[_0xf35a('0x20')]();};}function saveUpdates(_0xee49ab,_0x41313c){return function(_0x3e7c34){if(_0x3e7c34){return _0x3e7c34[_0xf35a('0x21')](_0xee49ab)[_0xf35a('0x22')](function(_0x4c4740){return _0x4c4740;});}return null;};}function removeEntity(_0xe52b83,_0x510ec5){return function(_0x34a205){if(_0x34a205){return _0x34a205[_0xf35a('0x23')]()[_0xf35a('0x22')](function(){_0xe52b83[_0xf35a('0x16')](0xcc)[_0xf35a('0x17')]();});}};}function handleEntityNotFound(_0x3c3ae5,_0x2371c0){return function(_0x142455){if(!_0x142455){_0x3c3ae5[_0xf35a('0x15')](0x194);}return _0x142455;};}function handleError(_0xf54eac,_0x4036ba){_0x4036ba=_0x4036ba||0x1f4;return function(_0x46610d){logger['error'](_0x46610d[_0xf35a('0x24')]);if(_0x46610d['name']){delete _0x46610d[_0xf35a('0x25')];}_0xf54eac[_0xf35a('0x16')](_0x4036ba)[_0xf35a('0x26')](_0x46610d);};}exports[_0xf35a('0x27')]=function(_0x1e346c,_0x5e8a9c){var _0x2712b9={},_0x535328={},_0x9dbc66={'count':0x0,'rows':[]};var _0x58dd57=_[_0xf35a('0x28')](db['FreshsalesAccount'][_0xf35a('0x29')],function(_0x1d5a8f){return{'name':_0x1d5a8f[_0xf35a('0x2a')],'type':_0x1d5a8f['type'][_0xf35a('0x2b')]};});_0x535328[_0xf35a('0x2c')]=_[_0xf35a('0x28')](_0x58dd57,_0xf35a('0x25'));_0x535328[_0xf35a('0x2d')]=_[_0xf35a('0x2e')](_0x1e346c[_0xf35a('0x2d')]);_0x535328[_0xf35a('0x2f')]=_[_0xf35a('0x30')](_0x535328[_0xf35a('0x2c')],_0x535328['query']);_0x2712b9[_0xf35a('0x31')]=_[_0xf35a('0x30')](_0x535328[_0xf35a('0x2c')],qs['fields'](_0x1e346c[_0xf35a('0x2d')][_0xf35a('0x32')]));_0x2712b9['attributes']=_0x2712b9['attributes'][_0xf35a('0x33')]?_0x2712b9[_0xf35a('0x31')]:_0x535328['model'];if(!_0x1e346c[_0xf35a('0x2d')]['hasOwnProperty']('nolimit')){_0x2712b9['limit']=qs['limit'](_0x1e346c[_0xf35a('0x2d')][_0xf35a('0x1a')]);_0x2712b9[_0xf35a('0x18')]=qs[_0xf35a('0x18')](_0x1e346c[_0xf35a('0x2d')][_0xf35a('0x18')]);}_0x2712b9[_0xf35a('0x34')]=qs[_0xf35a('0x35')](_0x1e346c['query'][_0xf35a('0x35')]);_0x2712b9['where']=qs['filters'](_[_0xf35a('0x36')](_0x1e346c['query'],_0x535328['filters']),_0x58dd57);if(_0x1e346c[_0xf35a('0x2d')][_0xf35a('0x37')]){_0x2712b9[_0xf35a('0x38')]=_[_0xf35a('0x39')](_0x2712b9[_0xf35a('0x38')],{'$or':_['map'](_0x58dd57,function(_0x2a7b01){if(_0x2a7b01[_0xf35a('0x3a')]!=='VIRTUAL'){var _0x707a2d={};_0x707a2d[_0x2a7b01[_0xf35a('0x25')]]={'$like':'%'+_0x1e346c[_0xf35a('0x2d')]['filter']+'%'};return _0x707a2d;}})});}_0x2712b9=_[_0xf35a('0x39')]({},_0x2712b9,_0x1e346c[_0xf35a('0x3b')]);var _0x1a7039={'where':_0x2712b9['where']};return db['FreshsalesAccount'][_0xf35a('0x1b')](_0x1a7039)[_0xf35a('0x22')](function(_0x35f981){_0x9dbc66[_0xf35a('0x1b')]=_0x35f981;if(_0x1e346c[_0xf35a('0x2d')][_0xf35a('0x3c')]){_0x2712b9[_0xf35a('0x3d')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xf35a('0x3e')](_0x2712b9);})['then'](function(_0x208c55){_0x9dbc66[_0xf35a('0x3f')]=_0x208c55;return _0x9dbc66;})[_0xf35a('0x22')](respondWithFilteredResult(_0x5e8a9c,_0x2712b9))['catch'](handleError(_0x5e8a9c,null));};exports[_0xf35a('0x40')]=function(_0x2c43d1,_0x4819f6){var _0x3d1fb1={'raw':![],'where':{'id':_0x2c43d1['params']['id']}},_0x2f07b5={};_0x2f07b5['model']=_[_0xf35a('0x2e')](db[_0xf35a('0x41')][_0xf35a('0x29')]);_0x2f07b5[_0xf35a('0x2d')]=_[_0xf35a('0x2e')](_0x2c43d1[_0xf35a('0x2d')]);_0x2f07b5['filters']=_[_0xf35a('0x30')](_0x2f07b5[_0xf35a('0x2c')],_0x2f07b5[_0xf35a('0x2d')]);_0x3d1fb1[_0xf35a('0x31')]=_[_0xf35a('0x30')](_0x2f07b5[_0xf35a('0x2c')],qs[_0xf35a('0x32')](_0x2c43d1['query'][_0xf35a('0x32')]));_0x3d1fb1[_0xf35a('0x31')]=_0x3d1fb1[_0xf35a('0x31')]['length']?_0x3d1fb1[_0xf35a('0x31')]:_0x2f07b5[_0xf35a('0x2c')];if(_0x2c43d1['query']['includeAll']){_0x3d1fb1[_0xf35a('0x3d')]=[{'all':!![]}];}_0x3d1fb1=_['merge']({},_0x3d1fb1,_0x2c43d1[_0xf35a('0x3b')]);return db[_0xf35a('0x41')]['find'](_0x3d1fb1)[_0xf35a('0x22')](handleEntityNotFound(_0x4819f6,null))[_0xf35a('0x22')](respondWithResult(_0x4819f6,null))[_0xf35a('0x42')](handleError(_0x4819f6,null));};exports[_0xf35a('0x43')]=function(_0x5b0512,_0x3b5eb6){return db['FreshsalesAccount'][_0xf35a('0x43')](_0x5b0512[_0xf35a('0x44')],{})[_0xf35a('0x22')](respondWithResult(_0x3b5eb6,0xc9))['catch'](handleError(_0x3b5eb6,null));};exports[_0xf35a('0x21')]=function(_0x43a1d3,_0x1039ff){if(_0x43a1d3['body']['id']){delete _0x43a1d3['body']['id'];}return db[_0xf35a('0x41')][_0xf35a('0x45')]({'where':{'id':_0x43a1d3[_0xf35a('0x46')]['id']}})[_0xf35a('0x22')](handleEntityNotFound(_0x1039ff,null))[_0xf35a('0x22')](saveUpdates(_0x43a1d3[_0xf35a('0x44')],null))[_0xf35a('0x22')](respondWithResult(_0x1039ff,null))[_0xf35a('0x42')](handleError(_0x1039ff,null));};exports[_0xf35a('0x23')]=function(_0x7c5890,_0x67d488){return db['FreshsalesAccount']['find']({'where':{'id':_0x7c5890[_0xf35a('0x46')]['id']}})[_0xf35a('0x22')](handleEntityNotFound(_0x67d488,null))[_0xf35a('0x22')](removeEntity(_0x67d488,null))['catch'](handleError(_0x67d488,null));};exports['getConfigurations']=function(_0x235fb9,_0x242239,_0x462d14){var _0x1b358e={};var _0x2293bc={};var _0x5526c1;var _0x53d13a;return db[_0xf35a('0x41')][_0xf35a('0x47')]({'where':{'id':_0x235fb9[_0xf35a('0x46')]['id']}})[_0xf35a('0x22')](handleEntityNotFound(_0x242239,null))[_0xf35a('0x22')](function(_0x38c2dd){if(_0x38c2dd){_0x5526c1=_0x38c2dd;_0x2293bc[_0xf35a('0x2c')]=_[_0xf35a('0x2e')](db[_0xf35a('0x48')][_0xf35a('0x29')]);_0x2293bc[_0xf35a('0x2d')]=_[_0xf35a('0x2e')](_0x235fb9['query']);_0x2293bc[_0xf35a('0x2f')]=_[_0xf35a('0x30')](_0x2293bc['model'],_0x2293bc[_0xf35a('0x2d')]);_0x1b358e[_0xf35a('0x31')]=_['intersection'](_0x2293bc[_0xf35a('0x2c')],qs[_0xf35a('0x32')](_0x235fb9[_0xf35a('0x2d')][_0xf35a('0x32')]));_0x1b358e['attributes']=_0x1b358e[_0xf35a('0x31')][_0xf35a('0x33')]?_0x1b358e[_0xf35a('0x31')]:_0x2293bc[_0xf35a('0x2c')];_0x1b358e[_0xf35a('0x34')]=qs['sort'](_0x235fb9['query'][_0xf35a('0x35')]);_0x1b358e[_0xf35a('0x38')]=qs[_0xf35a('0x2f')](_['pick'](_0x235fb9[_0xf35a('0x2d')],_0x2293bc[_0xf35a('0x2f')]));if(_0x235fb9[_0xf35a('0x2d')][_0xf35a('0x37')]){_0x1b358e['where']=_[_0xf35a('0x39')](_0x1b358e['where'],{'$or':_[_0xf35a('0x28')](_0x1b358e[_0xf35a('0x31')],function(_0x204459){var _0x55d957={};_0x55d957[_0x204459]={'$like':'%'+_0x235fb9[_0xf35a('0x2d')][_0xf35a('0x37')]+'%'};return _0x55d957;})});}_0x1b358e=_[_0xf35a('0x39')]({},_0x1b358e,_0x235fb9[_0xf35a('0x3b')]);return _0x5526c1['getConfigurations'](_0x1b358e);}})[_0xf35a('0x22')](function(_0x4b344b){if(_0x4b344b){_0x53d13a=_0x4b344b['length'];if(!_0x235fb9[_0xf35a('0x2d')]['hasOwnProperty']('nolimit')){_0x1b358e[_0xf35a('0x1a')]=qs[_0xf35a('0x1a')](_0x235fb9['query'][_0xf35a('0x1a')]);_0x1b358e[_0xf35a('0x18')]=qs[_0xf35a('0x18')](_0x235fb9[_0xf35a('0x2d')][_0xf35a('0x18')]);}return _0x5526c1[_0xf35a('0x49')](_0x1b358e);}})[_0xf35a('0x22')](function(_0x473816){if(_0x473816){return _0x473816?{'count':_0x53d13a,'rows':_0x473816}:null;}})[_0xf35a('0x22')](respondWithResult(_0x242239,null))['catch'](handleError(_0x242239,null));};exports[_0xf35a('0x4a')]=function(_0x341d60,_0x19adac,_0x484088){if(_0x341d60[_0xf35a('0x44')]['id']){delete _0x341d60['body']['id'];}return db['FreshsalesAccount'][_0xf35a('0x47')]({'where':{'id':_0x341d60[_0xf35a('0x46')]['id']}})[_0xf35a('0x22')](handleEntityNotFound(_0x19adac,null))[_0xf35a('0x22')](function(_0xe8fa95){if(_0xe8fa95){_0x341d60['body']['AccountId']=_0xe8fa95['id'];_0x341d60[_0xf35a('0x44')][_0xf35a('0x4b')]=integrations[_0xf35a('0x4c')](_0x341d60[_0xf35a('0x44')][_0xf35a('0x4d')],_0x341d60['body']['type']);_0x341d60['body']['Descriptions']=integrations[_0xf35a('0x4e')](_0x341d60[_0xf35a('0x44')][_0xf35a('0x4d')],_0x341d60['body']['type']);return db[_0xf35a('0x48')]['create'](_0x341d60[_0xf35a('0x44')],{'include':[{'model':db['FreshsalesField'],'as':_0xf35a('0x4b')},{'model':db[_0xf35a('0x4f')],'as':_0xf35a('0x50')}]});}return null;})[_0xf35a('0x22')](respondWithResult(_0x19adac,null))[_0xf35a('0x42')](handleError(_0x19adac,null));};exports[_0xf35a('0x51')]=function(_0x1f1406,_0x58a8ff,_0x328b50){var _0x9015dd='';var _0x457a49='';return db[_0xf35a('0x41')]['findOne']({'where':{'id':_0x1f1406['params']['id']},'attributes':['id',_0xf35a('0x52'),_0xf35a('0x53'),_0xf35a('0x54')]})[_0xf35a('0x22')](handleEntityNotFound(_0x58a8ff,null))[_0xf35a('0x22')](function(_0x39fb1a){if(_0x39fb1a){_0x457a49=_0x39fb1a[_0xf35a('0x52')];_0x9015dd=_0x39fb1a['remoteUri'];var _0x49ea10=_0x39fb1a[_0xf35a('0x53')][_0xf35a('0x55')](-0x1);if(_0x49ea10==='/'){_0x9015dd=_0x9015dd[_0xf35a('0x56')](0x0,_0x9015dd[_0xf35a('0x57')](_0x49ea10));}return rp({'method':'GET','uri':util[_0xf35a('0x58')](_0xf35a('0x59'),_0x9015dd,_0xf35a('0x5a')),'headers':{'Authorization':_0xf35a('0x5b')+_0x39fb1a[_0xf35a('0x54')]},'json':!![]});}})['then'](function(_0x4066ad){if(_0x4066ad){var _0x2fddce=_0x4066ad[_0xf35a('0x5c')];var _0x206b9a=![];var _0x3b3434=null;for(_0x3b3434=0x0;_0x3b3434<_0x2fddce['length'];_0x3b3434++){if(_0x2fddce[_0x3b3434][_0xf35a('0x5d')]===_0x457a49){_0x206b9a=!![];}}if(_0x206b9a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf35a('0x5e')});}}})['then'](respondWithResult(_0x58a8ff,null))[_0xf35a('0x42')](function(_0x291c18){var _0x5dc936=_0x1f1406[_0xf35a('0x2d')]['test']?0x1f4:_0x291c18['statusCode']||0x1f4;logger[_0xf35a('0x5f')](_0xf35a('0x60'),_0xf35a('0x51'),_0x5dc936,JSON['stringify'](_0x291c18));delete _0x291c18[_0xf35a('0x25')];if(_0x5dc936===0x191){_0x5dc936=0x190;}_0x58a8ff[_0xf35a('0x16')](_0x5dc936)[_0xf35a('0x26')](_0x1f1406[_0xf35a('0x2d')][_0xf35a('0x61')]?{'message':'Wrong\x20credentials','statusCode':_0x291c18[_0xf35a('0x62')]}:_0x291c18);});};
\ No newline at end of file
index 351e2fa..4fb4eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x457104,_0xc58ec){_0x457104=_0x457104-0x0;var _0x58c7e7=_0xc6ac[_0x457104];return _0x58c7e7;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));var integrations=require(_0xcc6a('0xb'));module[_0xcc6a('0xc')]=function(_0x197bd7,_0x5f3887){return _0x197bd7[_0xcc6a('0xd')](_0xcc6a('0xe'),attributes,{'tableName':_0xcc6a('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x627e=['path','rimraf','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xd4497b,_0x122302){var _0x105f72=function(_0x62ed69){while(--_0x62ed69){_0xd4497b['push'](_0xd4497b['shift']());}};_0x105f72(++_0x122302);}(_0x627e,0x14a));var _0xe627=function(_0x59ad4f,_0xf7ad6f){_0x59ad4f=_0x59ad4f-0x0;var _0x16c7cd=_0x627e[_0x59ad4f];return _0x16c7cd;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var logger=require(_0xe627('0x2'))(_0xe627('0x3'));var moment=require(_0xe627('0x4'));var BPromise=require('bluebird');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('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xe627('0x8')]=function(_0x3f2791,_0x45e49a){return _0x3f2791[_0xe627('0x9')](_0xe627('0xa'),attributes,{'tableName':_0xe627('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97ad8ad..796684f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['limit','include','model','attributes','map','ShowFreshsalesAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x44c5dc,_0x2bd987){var _0x37b858=function(_0x5be429){while(--_0x5be429){_0x44c5dc['push'](_0x44c5dc['shift']());}};_0x37b858(++_0x2bd987);}(_0x896e,0x1e9));var _0xe896=function(_0x459dec,_0x1e12cd){_0x459dec=_0x459dec-0x0;var _0x19fbea=_0x896e[_0x459dec];return _0x19fbea;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')]({'raw':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')]['where']||null:null,'attributes':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options']['attributes']||null:null,'limit':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1d')]||null:null,'include':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options'][_0xe896('0x1e')]?_['map'](_0x32f86d['options'][_0xe896('0x1e')],function(_0x41e689){return{'model':db[_0x41e689[_0xe896('0x1f')]],'as':_0x41e689['as'],'attributes':_0x41e689[_0xe896('0x20')],'include':_0x41e689[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x41e689[_0xe896('0x1e')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x1f')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x1e')]?_['map'](_0x4b71cc[_0xe896('0x1e')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x1f')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0xe')](function(_0x3f8ceb){logger['info'](_0xe896('0x18'),_0x32f86d);logger[_0xe896('0x10')](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x3f8ceb));_0x5dc89d(_0x3f8ceb);})[_0xe896('0x17')](function(_0x5e0d9b){logger['error']('GetFreshsalesAccount',_0x5e0d9b['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0x5e0d9b[_0xe896('0x15')]));});});};exports[_0xe896('0x22')]=function(_0x10fd26){var _0x76c781=this;return new Promise(function(_0x3cd88e,_0x1a6090){return db[_0xe896('0x19')][_0xe896('0x23')]({'raw':_0x10fd26['options']?_0x10fd26['options'][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x10fd26[_0xe896('0x1b')]?_0x10fd26[_0xe896('0x1b')][_0xe896('0x24')]||null:null,'attributes':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')]['attributes']||null:null,'include':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')][_0xe896('0x1e')]?_[_0xe896('0x21')](_0x10fd26['options']['include'],function(_0x567589){return{'model':db[_0x567589[_0xe896('0x1f')]],'as':_0x567589['as'],'attributes':_0x567589[_0xe896('0x20')],'include':_0x567589[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x567589[_0xe896('0x1e')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x1f')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x486eb5[_0xe896('0x1e')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x1f')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f3fb){logger[_0xe896('0x16')]('ShowFreshsalesAccount',_0x10fd26);logger[_0xe896('0x10')]('ShowFreshsalesAccount',_0x10fd26,JSON[_0xe896('0x12')](_0x42f3fb));_0x3cd88e(_0x42f3fb);})['catch'](function(_0x42f445){logger['error'](_0xe896('0x22'),_0x42f445[_0xe896('0x15')],_0x10fd26);_0x1a6090(_0x76c781[_0xe896('0x13')](0x1f4,_0x42f445[_0xe896('0x15')]));});});};
\ No newline at end of file
+var _0x5f66=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','GetFreshsalesAccount','findAll','options','attributes','limit','include','model','map','ShowFreshsalesAccount','FreshsalesAccount','raw','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3c749f,_0x5d983f){var _0x34830d=function(_0x59bd5b){while(--_0x59bd5b){_0x3c749f['push'](_0x3c749f['shift']());}};_0x34830d(++_0x5d983f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['FreshsalesAccount'][_0x65f6('0x16')]({'raw':_0x1f974c['options']?_0x1f974c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')]['where']||null:null,'attributes':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x18')]||null:null,'limit':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x19')]||null:null,'include':_0x1f974c['options']?_0x1f974c[_0x65f6('0x17')]['include']?_['map'](_0x1f974c[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x524e42){return{'model':db[_0x524e42[_0x65f6('0x1b')]],'as':_0x524e42['as'],'attributes':_0x524e42[_0x65f6('0x18')],'include':_0x524e42[_0x65f6('0x1a')]?_[_0x65f6('0x1c')](_0x524e42['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x1b')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x18')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x1b')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x28f710){logger['info'](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON['stringify'](_0x28f710));_0x18380e(_0x28f710);})['catch'](function(_0x488d36){logger[_0x65f6('0x12')](_0x65f6('0x15'),_0x488d36[_0x65f6('0x11')],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x488d36[_0x65f6('0x11')]));});});};exports[_0x65f6('0x1d')]=function(_0x144e55){var _0x4ace4c=this;return new Promise(function(_0x4ea23d,_0x154cbd){return db[_0x65f6('0x1e')]['find']({'raw':_0x144e55['options']?_0x144e55[_0x65f6('0x17')][_0x65f6('0x1f')]===undefined?!![]:![]:!![],'where':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')][_0x65f6('0x20')]||null:null,'attributes':_0x144e55[_0x65f6('0x17')]?_0x144e55['options'][_0x65f6('0x18')]||null:null,'include':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')]['include']?_[_0x65f6('0x1c')](_0x144e55[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x45510a){return{'model':db[_0x45510a[_0x65f6('0x1b')]],'as':_0x45510a['as'],'attributes':_0x45510a[_0x65f6('0x18')],'include':_0x45510a['include']?_[_0x65f6('0x1c')](_0x45510a[_0x65f6('0x1a')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x1b')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1a')]?_['map'](_0x4f3e22[_0x65f6('0x1a')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x18')]};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x3b261d){logger['info']('ShowFreshsalesAccount',_0x144e55);logger[_0x65f6('0xd')]('ShowFreshsalesAccount',_0x144e55,JSON[_0x65f6('0xf')](_0x3b261d));_0x4ea23d(_0x3b261d);})['catch'](function(_0x22d760){logger[_0x65f6('0x12')]('ShowFreshsalesAccount',_0x22d760[_0x65f6('0x11')],_0x144e55);_0x154cbd(_0x4ace4c['error'](0x1f4,_0x22d760['message']));});});};
\ No newline at end of file
index dd9133d..a8acfbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x298e=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','post','create','put'];(function(_0x1e5afc,_0x1518bd){var _0x420e87=function(_0x4dc120){while(--_0x4dc120){_0x1e5afc['push'](_0x1e5afc['shift']());}};_0x420e87(++_0x1518bd);}(_0x298e,0xb4));var _0xe298=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x298e[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xe298('0x0'));var util=require(_0xe298('0x1'));var path=require(_0xe298('0x2'));var timeout=require('connect-timeout');var express=require(_0xe298('0x3'));var router=express['Router']();var fs_extra=require(_0xe298('0x4'));var auth=require(_0xe298('0x5'));var interaction=require(_0xe298('0x6'));var config=require('../../config/environment');var controller=require(_0xe298('0x7'));router[_0xe298('0x8')]('/',auth[_0xe298('0x9')](),controller[_0xe298('0xa')]);router[_0xe298('0x8')](_0xe298('0xb'),auth[_0xe298('0x9')](),controller[_0xe298('0xc')]);router[_0xe298('0x8')]('/:id/subjects',auth[_0xe298('0x9')](),controller[_0xe298('0xd')]);router[_0xe298('0x8')](_0xe298('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xe298('0x8')]('/:id/fields',auth[_0xe298('0x9')](),controller['getFields']);router[_0xe298('0xf')]('/',auth[_0xe298('0x9')](),controller[_0xe298('0x10')]);router[_0xe298('0x11')]('/:id',auth[_0xe298('0x9')](),controller[_0xe298('0x12')]);router[_0xe298('0x13')](_0xe298('0xb'),auth[_0xe298('0x9')](),controller[_0xe298('0x14')]);module[_0xe298('0x15')]=router;
\ No newline at end of file
+var _0xc17c=['/:id','isAuthenticated','show','getDescriptions','/:id/fields','getFields','post','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index'];(function(_0x4b4b4d,_0x375b83){var _0x4d826e=function(_0x20b350){while(--_0x20b350){_0x4b4b4d['push'](_0x4b4b4d['shift']());}};_0x4d826e(++_0x375b83);}(_0xc17c,0x199));var _0xcc17=function(_0x1fc6c0,_0x43ec61){_0x1fc6c0=_0x1fc6c0-0x0;var _0x34c3a1=_0xc17c[_0x1fc6c0];return _0x34c3a1;};'use strict';var multer=require(_0xcc17('0x0'));var util=require(_0xcc17('0x1'));var path=require(_0xcc17('0x2'));var timeout=require(_0xcc17('0x3'));var express=require(_0xcc17('0x4'));var router=express[_0xcc17('0x5')]();var fs_extra=require(_0xcc17('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcc17('0x7'));var config=require(_0xcc17('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xcc17('0x9')]('/',auth['isAuthenticated'](),controller[_0xcc17('0xa')]);router[_0xcc17('0x9')](_0xcc17('0xb'),auth[_0xcc17('0xc')](),controller[_0xcc17('0xd')]);router['get']('/:id/subjects',auth[_0xcc17('0xc')](),controller['getSubjects']);router[_0xcc17('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xcc17('0xe')]);router[_0xcc17('0x9')](_0xcc17('0xf'),auth[_0xcc17('0xc')](),controller[_0xcc17('0x10')]);router[_0xcc17('0x11')]('/',auth[_0xcc17('0xc')](),controller['create']);router['put'](_0xcc17('0xb'),auth[_0xcc17('0xc')](),controller[_0xcc17('0x12')]);router[_0xcc17('0x13')](_0xcc17('0xb'),auth[_0xcc17('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index b1338d2..805c757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf052=['exports','STRING','sequelize'];(function(_0x4ae082,_0x296c37){var _0x334bbd=function(_0x3724d3){while(--_0x3724d3){_0x4ae082['push'](_0x4ae082['shift']());}};_0x334bbd(++_0x296c37);}(_0xf052,0x188));var _0x2f05=function(_0x414584,_0x1a1da6){_0x414584=_0x414584-0x0;var _0x50b255=_0xf052[_0x414584];return _0x50b255;};'use strict';var Sequelize=require(_0x2f05('0x0'));module[_0x2f05('0x1')]={'name':{'type':Sequelize[_0x2f05('0x2')]},'description':{'type':Sequelize[_0x2f05('0x2')]}};
\ No newline at end of file
+var _0xd473=['STRING','sequelize','exports'];(function(_0x60cd3c,_0x5d5257){var _0x21f85e=function(_0x367ab1){while(--_0x367ab1){_0x60cd3c['push'](_0x60cd3c['shift']());}};_0x21f85e(++_0x5d5257);}(_0xd473,0xcd));var _0x3d47=function(_0x3a029b,_0x167dd1){_0x3a029b=_0x3a029b-0x0;var _0x455e3a=_0xd473[_0x3a029b];return _0x455e3a;};'use strict';var Sequelize=require(_0x3d47('0x0'));module[_0x3d47('0x1')]={'name':{'type':Sequelize[_0x3d47('0x2')]},'description':{'type':Sequelize[_0x3d47('0x2')]}};
\ No newline at end of file
index 59b5927..92e7cce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9261=['reject','save','update','then','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','getSubjects','findOne','FreshsalesField','length','order','pick','getDescriptions','hasOwnProperty','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','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','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9261,0x1de));var _0x1926=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x9261[_0x19b3f9];return _0x18c3f6;};'use strict';var emlformat=require(_0x1926('0x0'));var rimraf=require(_0x1926('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1926('0x2'));var rp=require(_0x1926('0x3'));var moment=require(_0x1926('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1926('0x5'));var util=require(_0x1926('0x6'));var path=require(_0x1926('0x7'));var sox=require(_0x1926('0x8'));var csv=require(_0x1926('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1926('0xa'));var _=require('lodash');var squel=require(_0x1926('0xb'));var crypto=require(_0x1926('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1926('0xd'));var toCsv=require(_0x1926('0x9'));var querystring=require(_0x1926('0xe'));var Papa=require(_0x1926('0xf'));var Redis=require(_0x1926('0x10'));var authService=require(_0x1926('0x11'));var qs=require(_0x1926('0x12'));var as=require(_0x1926('0x13'));var hardwareService=require(_0x1926('0x14'));var logger=require(_0x1926('0x15'))(_0x1926('0x16'));var utils=require(_0x1926('0x17'));var config=require(_0x1926('0x18'));var licenseUtil=require(_0x1926('0x19'));var db=require(_0x1926('0x1a'))['db'];function respondWithStatusCode(_0x3d4817,_0x10a758){_0x10a758=_0x10a758||0xcc;return function(_0x41f84d){if(_0x41f84d){return _0x3d4817[_0x1926('0x1b')](_0x10a758);}return _0x3d4817[_0x1926('0x1c')](_0x10a758)[_0x1926('0x1d')]();};}function respondWithResult(_0x33779c,_0x2ed996){_0x2ed996=_0x2ed996||0xc8;return function(_0x4ff9ff){if(_0x4ff9ff){return _0x33779c[_0x1926('0x1c')](_0x2ed996)[_0x1926('0x1e')](_0x4ff9ff);}};}function respondWithFilteredResult(_0x53f820,_0xe13cde){return function(_0x348117){if(_0x348117){var _0x42a80b=typeof _0xe13cde['offset']===_0x1926('0x1f')&&typeof _0xe13cde[_0x1926('0x20')]==='undefined';var _0x21e214=_0x348117[_0x1926('0x21')];var _0xdfa757=_0x42a80b?0x0:_0xe13cde[_0x1926('0x22')];var _0x1b8d73=_0x42a80b?_0x348117[_0x1926('0x21')]:_0xe13cde[_0x1926('0x22')]+_0xe13cde[_0x1926('0x20')];var _0x1e4b49;if(_0x1b8d73>=_0x21e214){_0x1b8d73=_0x21e214;_0x1e4b49=0xc8;}else{_0x1e4b49=0xce;}_0x53f820[_0x1926('0x1c')](_0x1e4b49);return _0x53f820[_0x1926('0x23')](_0x1926('0x24'),_0xdfa757+'-'+_0x1b8d73+'/'+_0x21e214)[_0x1926('0x1e')](_0x348117);}return null;};}function patchUpdates(_0x4e4657){return function(_0x4866f5){try{jsonpatch[_0x1926('0x25')](_0x4866f5,_0x4e4657,!![]);}catch(_0x32fb7a){return BPromise[_0x1926('0x26')](_0x32fb7a);}return _0x4866f5[_0x1926('0x27')]();};}function saveUpdates(_0x2361e2,_0x31d906){return function(_0x32bd70){if(_0x32bd70){return _0x32bd70[_0x1926('0x28')](_0x2361e2)[_0x1926('0x29')](function(_0x3e0ab0){return _0x3e0ab0;});}return null;};}function removeEntity(_0x328aa9,_0x49d367){return function(_0x5d00c7){if(_0x5d00c7){return _0x5d00c7['destroy']()['then'](function(){_0x328aa9[_0x1926('0x1c')](0xcc)[_0x1926('0x1d')]();});}};}function handleEntityNotFound(_0x11e28e,_0x462c85){return function(_0x4fc645){if(!_0x4fc645){_0x11e28e['sendStatus'](0x194);}return _0x4fc645;};}function handleError(_0x561b3a,_0x3659fa){_0x3659fa=_0x3659fa||0x1f4;return function(_0x142f45){logger['error'](_0x142f45[_0x1926('0x2a')]);if(_0x142f45[_0x1926('0x2b')]){delete _0x142f45[_0x1926('0x2b')];}_0x561b3a[_0x1926('0x1c')](_0x3659fa)[_0x1926('0x2c')](_0x142f45);};}exports[_0x1926('0x2d')]=function(_0x267513,_0xd60129){var _0x1c8290={},_0x521645={},_0x22e16e={'count':0x0,'rows':[]};var _0x42e41e=_[_0x1926('0x2e')](db[_0x1926('0x2f')]['rawAttributes'],function(_0x391915){return{'name':_0x391915[_0x1926('0x30')],'type':_0x391915[_0x1926('0x31')][_0x1926('0x32')]};});_0x521645[_0x1926('0x33')]=_['map'](_0x42e41e,_0x1926('0x2b'));_0x521645['query']=_[_0x1926('0x34')](_0x267513[_0x1926('0x35')]);_0x521645[_0x1926('0x36')]=_[_0x1926('0x37')](_0x521645['model'],_0x521645[_0x1926('0x35')]);_0x1c8290[_0x1926('0x38')]=_[_0x1926('0x37')](_0x521645['model'],qs[_0x1926('0x39')](_0x267513[_0x1926('0x35')][_0x1926('0x39')]));_0x1c8290[_0x1926('0x38')]=_0x1c8290[_0x1926('0x38')]['length']?_0x1c8290['attributes']:_0x521645[_0x1926('0x33')];if(!_0x267513['query']['hasOwnProperty'](_0x1926('0x3a'))){_0x1c8290['limit']=qs[_0x1926('0x20')](_0x267513[_0x1926('0x35')][_0x1926('0x20')]);_0x1c8290['offset']=qs[_0x1926('0x22')](_0x267513[_0x1926('0x35')]['offset']);}_0x1c8290['order']=qs[_0x1926('0x3b')](_0x267513[_0x1926('0x35')][_0x1926('0x3b')]);_0x1c8290[_0x1926('0x3c')]=qs[_0x1926('0x36')](_['pick'](_0x267513[_0x1926('0x35')],_0x521645[_0x1926('0x36')]),_0x42e41e);if(_0x267513[_0x1926('0x35')]['filter']){_0x1c8290[_0x1926('0x3c')]=_[_0x1926('0x3d')](_0x1c8290[_0x1926('0x3c')],{'$or':_[_0x1926('0x2e')](_0x42e41e,function(_0x44f157){if(_0x44f157[_0x1926('0x31')]!==_0x1926('0x3e')){var _0x436ed7={};_0x436ed7[_0x44f157[_0x1926('0x2b')]]={'$like':'%'+_0x267513[_0x1926('0x35')][_0x1926('0x3f')]+'%'};return _0x436ed7;}})});}_0x1c8290=_[_0x1926('0x3d')]({},_0x1c8290,_0x267513[_0x1926('0x40')]);var _0x372204={'where':_0x1c8290[_0x1926('0x3c')]};return db[_0x1926('0x2f')][_0x1926('0x21')](_0x372204)['then'](function(_0x285a2f){_0x22e16e[_0x1926('0x21')]=_0x285a2f;if(_0x267513['query'][_0x1926('0x41')]){_0x1c8290[_0x1926('0x42')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x1926('0x43')](_0x1c8290);})[_0x1926('0x29')](function(_0x362df6){_0x22e16e[_0x1926('0x44')]=_0x362df6;return _0x22e16e;})[_0x1926('0x29')](respondWithFilteredResult(_0xd60129,_0x1c8290))['catch'](handleError(_0xd60129,null));};exports[_0x1926('0x45')]=function(_0x313632,_0x54efec){var _0x164c26={'raw':![],'where':{'id':_0x313632[_0x1926('0x46')]['id']}},_0x5cff82={};_0x5cff82['model']=_[_0x1926('0x34')](db[_0x1926('0x2f')][_0x1926('0x47')]);_0x5cff82[_0x1926('0x35')]=_[_0x1926('0x34')](_0x313632['query']);_0x5cff82[_0x1926('0x36')]=_[_0x1926('0x37')](_0x5cff82[_0x1926('0x33')],_0x5cff82[_0x1926('0x35')]);_0x164c26[_0x1926('0x38')]=_[_0x1926('0x37')](_0x5cff82[_0x1926('0x33')],qs[_0x1926('0x39')](_0x313632[_0x1926('0x35')]['fields']));_0x164c26['attributes']=_0x164c26[_0x1926('0x38')]['length']?_0x164c26[_0x1926('0x38')]:_0x5cff82['model'];if(_0x313632[_0x1926('0x35')][_0x1926('0x41')]){_0x164c26[_0x1926('0x42')]=[{'all':!![]}];}_0x164c26=_[_0x1926('0x3d')]({},_0x164c26,_0x313632['options']);return db[_0x1926('0x2f')][_0x1926('0x48')](_0x164c26)[_0x1926('0x29')](handleEntityNotFound(_0x54efec,null))[_0x1926('0x29')](respondWithResult(_0x54efec,null))[_0x1926('0x49')](handleError(_0x54efec,null));};exports[_0x1926('0x4a')]=function(_0x503e40,_0x12c3a1){return db['FreshsalesConfiguration'][_0x1926('0x4a')](_0x503e40[_0x1926('0x4b')],{})[_0x1926('0x29')](respondWithResult(_0x12c3a1,0xc9))[_0x1926('0x49')](handleError(_0x12c3a1,null));};exports[_0x1926('0x28')]=function(_0x5dfd39,_0x9fb405){if(_0x5dfd39[_0x1926('0x4b')]['id']){delete _0x5dfd39[_0x1926('0x4b')]['id'];}return db[_0x1926('0x2f')][_0x1926('0x48')]({'where':{'id':_0x5dfd39['params']['id']}})[_0x1926('0x29')](handleEntityNotFound(_0x9fb405,null))[_0x1926('0x29')](saveUpdates(_0x5dfd39[_0x1926('0x4b')],null))['then'](respondWithResult(_0x9fb405,null))['catch'](handleError(_0x9fb405,null));};exports[_0x1926('0x4c')]=function(_0x44c541,_0x5ecc18){return db[_0x1926('0x2f')][_0x1926('0x48')]({'where':{'id':_0x44c541[_0x1926('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ecc18,null))[_0x1926('0x29')](removeEntity(_0x5ecc18,null))[_0x1926('0x49')](handleError(_0x5ecc18,null));};exports[_0x1926('0x4d')]=function(_0x3cca11,_0x47f9da,_0x3910d6){var _0x24912d={};var _0x360356={};var _0x3b8b0c;var _0x5a2440;return db['FreshsalesConfiguration'][_0x1926('0x4e')]({'where':{'id':_0x3cca11[_0x1926('0x46')]['id']}})[_0x1926('0x29')](handleEntityNotFound(_0x47f9da,null))[_0x1926('0x29')](function(_0xabdf02){if(_0xabdf02){_0x3b8b0c=_0xabdf02;_0x360356[_0x1926('0x33')]=_['keys'](db[_0x1926('0x4f')][_0x1926('0x47')]);_0x360356[_0x1926('0x35')]=_[_0x1926('0x34')](_0x3cca11[_0x1926('0x35')]);_0x360356['filters']=_['intersection'](_0x360356[_0x1926('0x33')],_0x360356[_0x1926('0x35')]);_0x24912d[_0x1926('0x38')]=_['intersection'](_0x360356['model'],qs['fields'](_0x3cca11[_0x1926('0x35')][_0x1926('0x39')]));_0x24912d[_0x1926('0x38')]=_0x24912d[_0x1926('0x38')][_0x1926('0x50')]?_0x24912d[_0x1926('0x38')]:_0x360356['model'];_0x24912d[_0x1926('0x51')]=qs[_0x1926('0x3b')](_0x3cca11[_0x1926('0x35')][_0x1926('0x3b')]);_0x24912d[_0x1926('0x3c')]=qs['filters'](_[_0x1926('0x52')](_0x3cca11[_0x1926('0x35')],_0x360356[_0x1926('0x36')]));if(_0x3cca11['query'][_0x1926('0x3f')]){_0x24912d['where']=_['merge'](_0x24912d[_0x1926('0x3c')],{'$or':_[_0x1926('0x2e')](_0x24912d[_0x1926('0x38')],function(_0x16a1c7){var _0x436fec={};_0x436fec[_0x16a1c7]={'$like':'%'+_0x3cca11[_0x1926('0x35')]['filter']+'%'};return _0x436fec;})});}_0x24912d=_[_0x1926('0x3d')]({},_0x24912d,_0x3cca11[_0x1926('0x40')]);return _0x3b8b0c['getSubjects'](_0x24912d);}})[_0x1926('0x29')](function(_0x3a4848){if(_0x3a4848){_0x5a2440=_0x3a4848[_0x1926('0x50')];if(!_0x3cca11[_0x1926('0x35')]['hasOwnProperty']('nolimit')){_0x24912d['limit']=qs[_0x1926('0x20')](_0x3cca11[_0x1926('0x35')][_0x1926('0x20')]);_0x24912d[_0x1926('0x22')]=qs['offset'](_0x3cca11[_0x1926('0x35')][_0x1926('0x22')]);}return _0x3b8b0c['getSubjects'](_0x24912d);}})[_0x1926('0x29')](function(_0x44995b){if(_0x44995b){return _0x44995b?{'count':_0x5a2440,'rows':_0x44995b}:null;}})['then'](respondWithResult(_0x47f9da,null))[_0x1926('0x49')](handleError(_0x47f9da,null));};exports[_0x1926('0x53')]=function(_0x370bb7,_0x24b871,_0x17ff8f){var _0x274f74={};var _0x5b54f8={};var _0x2e2f7b;var _0x47363f;return db[_0x1926('0x2f')]['findOne']({'where':{'id':_0x370bb7[_0x1926('0x46')]['id']}})[_0x1926('0x29')](handleEntityNotFound(_0x24b871,null))['then'](function(_0x60cac){if(_0x60cac){_0x2e2f7b=_0x60cac;_0x5b54f8['model']=_[_0x1926('0x34')](db[_0x1926('0x4f')][_0x1926('0x47')]);_0x5b54f8[_0x1926('0x35')]=_[_0x1926('0x34')](_0x370bb7['query']);_0x5b54f8[_0x1926('0x36')]=_[_0x1926('0x37')](_0x5b54f8[_0x1926('0x33')],_0x5b54f8[_0x1926('0x35')]);_0x274f74[_0x1926('0x38')]=_[_0x1926('0x37')](_0x5b54f8[_0x1926('0x33')],qs[_0x1926('0x39')](_0x370bb7[_0x1926('0x35')][_0x1926('0x39')]));_0x274f74['attributes']=_0x274f74[_0x1926('0x38')][_0x1926('0x50')]?_0x274f74[_0x1926('0x38')]:_0x5b54f8[_0x1926('0x33')];_0x274f74[_0x1926('0x51')]=qs['sort'](_0x370bb7[_0x1926('0x35')]['sort']);_0x274f74[_0x1926('0x3c')]=qs[_0x1926('0x36')](_[_0x1926('0x52')](_0x370bb7[_0x1926('0x35')],_0x5b54f8[_0x1926('0x36')]));if(_0x370bb7[_0x1926('0x35')][_0x1926('0x3f')]){_0x274f74[_0x1926('0x3c')]=_[_0x1926('0x3d')](_0x274f74[_0x1926('0x3c')],{'$or':_[_0x1926('0x2e')](_0x274f74['attributes'],function(_0x3ef725){var _0x160a00={};_0x160a00[_0x3ef725]={'$like':'%'+_0x370bb7['query'][_0x1926('0x3f')]+'%'};return _0x160a00;})});}_0x274f74=_[_0x1926('0x3d')]({},_0x274f74,_0x370bb7['options']);return _0x2e2f7b[_0x1926('0x53')](_0x274f74);}})['then'](function(_0x9cabce){if(_0x9cabce){_0x47363f=_0x9cabce[_0x1926('0x50')];if(!_0x370bb7[_0x1926('0x35')][_0x1926('0x54')]('nolimit')){_0x274f74[_0x1926('0x20')]=qs[_0x1926('0x20')](_0x370bb7[_0x1926('0x35')][_0x1926('0x20')]);_0x274f74[_0x1926('0x22')]=qs[_0x1926('0x22')](_0x370bb7[_0x1926('0x35')]['offset']);}return _0x2e2f7b[_0x1926('0x53')](_0x274f74);}})[_0x1926('0x29')](function(_0x27bfb1){if(_0x27bfb1){return _0x27bfb1?{'count':_0x47363f,'rows':_0x27bfb1}:null;}})[_0x1926('0x29')](respondWithResult(_0x24b871,null))[_0x1926('0x49')](handleError(_0x24b871,null));};exports[_0x1926('0x55')]=function(_0x5d0e8a,_0x5caf7d,_0x33dac7){var _0x52dcec={};var _0x49fa2f={};var _0x173b31;var _0x223af0;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x5d0e8a['params']['id']}})[_0x1926('0x29')](handleEntityNotFound(_0x5caf7d,null))[_0x1926('0x29')](function(_0x5d18f0){if(_0x5d18f0){_0x173b31=_0x5d18f0;_0x49fa2f[_0x1926('0x33')]=_[_0x1926('0x34')](db[_0x1926('0x4f')]['rawAttributes']);_0x49fa2f[_0x1926('0x35')]=_[_0x1926('0x34')](_0x5d0e8a['query']);_0x49fa2f[_0x1926('0x36')]=_[_0x1926('0x37')](_0x49fa2f[_0x1926('0x33')],_0x49fa2f[_0x1926('0x35')]);_0x52dcec[_0x1926('0x38')]=_[_0x1926('0x37')](_0x49fa2f[_0x1926('0x33')],qs[_0x1926('0x39')](_0x5d0e8a['query'][_0x1926('0x39')]));_0x52dcec[_0x1926('0x38')]=_0x52dcec[_0x1926('0x38')]['length']?_0x52dcec[_0x1926('0x38')]:_0x49fa2f[_0x1926('0x33')];_0x52dcec[_0x1926('0x51')]=qs[_0x1926('0x3b')](_0x5d0e8a[_0x1926('0x35')][_0x1926('0x3b')]);_0x52dcec['where']=qs['filters'](_[_0x1926('0x52')](_0x5d0e8a[_0x1926('0x35')],_0x49fa2f[_0x1926('0x36')]));if(_0x5d0e8a[_0x1926('0x35')][_0x1926('0x3f')]){_0x52dcec[_0x1926('0x3c')]=_[_0x1926('0x3d')](_0x52dcec[_0x1926('0x3c')],{'$or':_[_0x1926('0x2e')](_0x52dcec['attributes'],function(_0x4c0685){var _0x33786f={};_0x33786f[_0x4c0685]={'$like':'%'+_0x5d0e8a[_0x1926('0x35')][_0x1926('0x3f')]+'%'};return _0x33786f;})});}_0x52dcec=_[_0x1926('0x3d')]({},_0x52dcec,_0x5d0e8a['options']);return _0x173b31[_0x1926('0x55')](_0x52dcec);}})[_0x1926('0x29')](function(_0x2539ba){if(_0x2539ba){_0x223af0=_0x2539ba[_0x1926('0x50')];if(!_0x5d0e8a['query']['hasOwnProperty'](_0x1926('0x3a'))){_0x52dcec[_0x1926('0x20')]=qs['limit'](_0x5d0e8a[_0x1926('0x35')][_0x1926('0x20')]);_0x52dcec[_0x1926('0x22')]=qs[_0x1926('0x22')](_0x5d0e8a[_0x1926('0x35')][_0x1926('0x22')]);}return _0x173b31[_0x1926('0x55')](_0x52dcec);}})[_0x1926('0x29')](function(_0x8c5f1b){if(_0x8c5f1b){return _0x8c5f1b?{'count':_0x223af0,'rows':_0x8c5f1b}:null;}})['then'](respondWithResult(_0x5caf7d,null))[_0x1926('0x49')](handleError(_0x5caf7d,null));};
\ No newline at end of file
+var _0xb630=['sort','pick','merge','where','map','VIRTUAL','filter','options','include','FreshsalesConfiguration','findAll','catch','show','params','rawAttributes','intersection','includeAll','create','body','find','destroy','getSubjects','findOne','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x473199,_0x17bb65){var _0xf740c4=function(_0x259a1b){while(--_0x259a1b){_0x473199['push'](_0x473199['shift']());}};_0xf740c4(++_0x17bb65);}(_0xb630,0xbe));var _0x0b63=function(_0x20acdb,_0x210c8e){_0x20acdb=_0x20acdb-0x0;var _0x383b0d=_0xb630[_0x20acdb];return _0x383b0d;};'use strict';var emlformat=require(_0x0b63('0x0'));var rimraf=require(_0x0b63('0x1'));var zipdir=require(_0x0b63('0x2'));var jsonpatch=require(_0x0b63('0x3'));var rp=require(_0x0b63('0x4'));var moment=require(_0x0b63('0x5'));var BPromise=require(_0x0b63('0x6'));var Mustache=require('mustache');var util=require(_0x0b63('0x7'));var path=require('path');var sox=require(_0x0b63('0x8'));var csv=require(_0x0b63('0x9'));var ejs=require(_0x0b63('0xa'));var fs=require('fs');var fs_extra=require(_0x0b63('0xb'));var _=require(_0x0b63('0xc'));var squel=require(_0x0b63('0xd'));var crypto=require(_0x0b63('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0b63('0xf'));var toCsv=require(_0x0b63('0x9'));var querystring=require(_0x0b63('0x10'));var Papa=require(_0x0b63('0x11'));var Redis=require(_0x0b63('0x12'));var authService=require(_0x0b63('0x13'));var qs=require(_0x0b63('0x14'));var as=require(_0x0b63('0x15'));var hardwareService=require(_0x0b63('0x16'));var logger=require('../../config/logger')(_0x0b63('0x17'));var utils=require('../../config/utils');var config=require(_0x0b63('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b63('0x19'))['db'];function respondWithStatusCode(_0x36d0d0,_0x4bb57a){_0x4bb57a=_0x4bb57a||0xcc;return function(_0x1c613c){if(_0x1c613c){return _0x36d0d0[_0x0b63('0x1a')](_0x4bb57a);}return _0x36d0d0[_0x0b63('0x1b')](_0x4bb57a)['end']();};}function respondWithResult(_0x474467,_0x1e8893){_0x1e8893=_0x1e8893||0xc8;return function(_0x1c1056){if(_0x1c1056){return _0x474467[_0x0b63('0x1b')](_0x1e8893)[_0x0b63('0x1c')](_0x1c1056);}};}function respondWithFilteredResult(_0x13a93b,_0x16fbc3){return function(_0x1c0d1c){if(_0x1c0d1c){var _0x31b6c8=typeof _0x16fbc3[_0x0b63('0x1d')]===_0x0b63('0x1e')&&typeof _0x16fbc3[_0x0b63('0x1f')]===_0x0b63('0x1e');var _0x56661b=_0x1c0d1c['count'];var _0x480d7f=_0x31b6c8?0x0:_0x16fbc3[_0x0b63('0x1d')];var _0x402934=_0x31b6c8?_0x1c0d1c[_0x0b63('0x20')]:_0x16fbc3[_0x0b63('0x1d')]+_0x16fbc3[_0x0b63('0x1f')];var _0x4cf921;if(_0x402934>=_0x56661b){_0x402934=_0x56661b;_0x4cf921=0xc8;}else{_0x4cf921=0xce;}_0x13a93b[_0x0b63('0x1b')](_0x4cf921);return _0x13a93b[_0x0b63('0x21')](_0x0b63('0x22'),_0x480d7f+'-'+_0x402934+'/'+_0x56661b)[_0x0b63('0x1c')](_0x1c0d1c);}return null;};}function patchUpdates(_0x2d2086){return function(_0x4ab39f){try{jsonpatch[_0x0b63('0x23')](_0x4ab39f,_0x2d2086,!![]);}catch(_0x26f092){return BPromise[_0x0b63('0x24')](_0x26f092);}return _0x4ab39f['save']();};}function saveUpdates(_0x27b925,_0x35b5d5){return function(_0x4202fd){if(_0x4202fd){return _0x4202fd[_0x0b63('0x25')](_0x27b925)[_0x0b63('0x26')](function(_0x4c8063){return _0x4c8063;});}return null;};}function removeEntity(_0x22f8d1,_0x2bae44){return function(_0x224bd6){if(_0x224bd6){return _0x224bd6['destroy']()['then'](function(){_0x22f8d1[_0x0b63('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36661d,_0x372c1f){return function(_0x4bd0eb){if(!_0x4bd0eb){_0x36661d[_0x0b63('0x1a')](0x194);}return _0x4bd0eb;};}function handleError(_0x457aee,_0x20ee44){_0x20ee44=_0x20ee44||0x1f4;return function(_0x58c63c){logger[_0x0b63('0x27')](_0x58c63c[_0x0b63('0x28')]);if(_0x58c63c[_0x0b63('0x29')]){delete _0x58c63c['name'];}_0x457aee['status'](_0x20ee44)['send'](_0x58c63c);};}exports[_0x0b63('0x2a')]=function(_0x3ce13d,_0x4cab47){var _0x17a69b={},_0x58b437={},_0x419ccf={'count':0x0,'rows':[]};var _0x581726=_['map'](db['FreshsalesConfiguration']['rawAttributes'],function(_0x474f96){return{'name':_0x474f96[_0x0b63('0x2b')],'type':_0x474f96[_0x0b63('0x2c')][_0x0b63('0x2d')]};});_0x58b437['model']=_['map'](_0x581726,_0x0b63('0x29'));_0x58b437[_0x0b63('0x2e')]=_[_0x0b63('0x2f')](_0x3ce13d['query']);_0x58b437[_0x0b63('0x30')]=_['intersection'](_0x58b437[_0x0b63('0x31')],_0x58b437[_0x0b63('0x2e')]);_0x17a69b[_0x0b63('0x32')]=_['intersection'](_0x58b437[_0x0b63('0x31')],qs[_0x0b63('0x33')](_0x3ce13d[_0x0b63('0x2e')][_0x0b63('0x33')]));_0x17a69b['attributes']=_0x17a69b[_0x0b63('0x32')][_0x0b63('0x34')]?_0x17a69b['attributes']:_0x58b437[_0x0b63('0x31')];if(!_0x3ce13d['query'][_0x0b63('0x35')](_0x0b63('0x36'))){_0x17a69b[_0x0b63('0x1f')]=qs[_0x0b63('0x1f')](_0x3ce13d['query'][_0x0b63('0x1f')]);_0x17a69b['offset']=qs[_0x0b63('0x1d')](_0x3ce13d[_0x0b63('0x2e')]['offset']);}_0x17a69b[_0x0b63('0x37')]=qs[_0x0b63('0x38')](_0x3ce13d[_0x0b63('0x2e')][_0x0b63('0x38')]);_0x17a69b['where']=qs[_0x0b63('0x30')](_[_0x0b63('0x39')](_0x3ce13d[_0x0b63('0x2e')],_0x58b437[_0x0b63('0x30')]),_0x581726);if(_0x3ce13d[_0x0b63('0x2e')]['filter']){_0x17a69b['where']=_[_0x0b63('0x3a')](_0x17a69b[_0x0b63('0x3b')],{'$or':_[_0x0b63('0x3c')](_0x581726,function(_0x4e8cea){if(_0x4e8cea[_0x0b63('0x2c')]!==_0x0b63('0x3d')){var _0x13024e={};_0x13024e[_0x4e8cea['name']]={'$like':'%'+_0x3ce13d[_0x0b63('0x2e')][_0x0b63('0x3e')]+'%'};return _0x13024e;}})});}_0x17a69b=_[_0x0b63('0x3a')]({},_0x17a69b,_0x3ce13d[_0x0b63('0x3f')]);var _0x2c9e5f={'where':_0x17a69b[_0x0b63('0x3b')]};return db['FreshsalesConfiguration'][_0x0b63('0x20')](_0x2c9e5f)[_0x0b63('0x26')](function(_0x19048f){_0x419ccf['count']=_0x19048f;if(_0x3ce13d['query']['includeAll']){_0x17a69b[_0x0b63('0x40')]=[{'all':!![]}];}return db[_0x0b63('0x41')][_0x0b63('0x42')](_0x17a69b);})[_0x0b63('0x26')](function(_0x14301b){_0x419ccf['rows']=_0x14301b;return _0x419ccf;})['then'](respondWithFilteredResult(_0x4cab47,_0x17a69b))[_0x0b63('0x43')](handleError(_0x4cab47,null));};exports[_0x0b63('0x44')]=function(_0xba6d0a,_0x31fe40){var _0x48fa4a={'raw':![],'where':{'id':_0xba6d0a[_0x0b63('0x45')]['id']}},_0x3afa85={};_0x3afa85[_0x0b63('0x31')]=_[_0x0b63('0x2f')](db['FreshsalesConfiguration'][_0x0b63('0x46')]);_0x3afa85['query']=_['keys'](_0xba6d0a[_0x0b63('0x2e')]);_0x3afa85['filters']=_[_0x0b63('0x47')](_0x3afa85['model'],_0x3afa85[_0x0b63('0x2e')]);_0x48fa4a[_0x0b63('0x32')]=_[_0x0b63('0x47')](_0x3afa85[_0x0b63('0x31')],qs[_0x0b63('0x33')](_0xba6d0a[_0x0b63('0x2e')][_0x0b63('0x33')]));_0x48fa4a['attributes']=_0x48fa4a[_0x0b63('0x32')]['length']?_0x48fa4a[_0x0b63('0x32')]:_0x3afa85[_0x0b63('0x31')];if(_0xba6d0a[_0x0b63('0x2e')][_0x0b63('0x48')]){_0x48fa4a['include']=[{'all':!![]}];}_0x48fa4a=_[_0x0b63('0x3a')]({},_0x48fa4a,_0xba6d0a[_0x0b63('0x3f')]);return db[_0x0b63('0x41')]['find'](_0x48fa4a)[_0x0b63('0x26')](handleEntityNotFound(_0x31fe40,null))[_0x0b63('0x26')](respondWithResult(_0x31fe40,null))['catch'](handleError(_0x31fe40,null));};exports[_0x0b63('0x49')]=function(_0x58f5fe,_0x366f91){return db[_0x0b63('0x41')][_0x0b63('0x49')](_0x58f5fe[_0x0b63('0x4a')],{})[_0x0b63('0x26')](respondWithResult(_0x366f91,0xc9))[_0x0b63('0x43')](handleError(_0x366f91,null));};exports[_0x0b63('0x25')]=function(_0x32fe46,_0x399561){if(_0x32fe46[_0x0b63('0x4a')]['id']){delete _0x32fe46[_0x0b63('0x4a')]['id'];}return db['FreshsalesConfiguration'][_0x0b63('0x4b')]({'where':{'id':_0x32fe46[_0x0b63('0x45')]['id']}})['then'](handleEntityNotFound(_0x399561,null))[_0x0b63('0x26')](saveUpdates(_0x32fe46[_0x0b63('0x4a')],null))[_0x0b63('0x26')](respondWithResult(_0x399561,null))[_0x0b63('0x43')](handleError(_0x399561,null));};exports[_0x0b63('0x4c')]=function(_0x5c0ee4,_0x5cd797){return db[_0x0b63('0x41')][_0x0b63('0x4b')]({'where':{'id':_0x5c0ee4[_0x0b63('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cd797,null))[_0x0b63('0x26')](removeEntity(_0x5cd797,null))[_0x0b63('0x43')](handleError(_0x5cd797,null));};exports[_0x0b63('0x4d')]=function(_0x54cd68,_0x228230,_0x31d0b8){var _0x41e653={};var _0x329d0f={};var _0x1a8b6e;var _0x524c6f;return db['FreshsalesConfiguration'][_0x0b63('0x4e')]({'where':{'id':_0x54cd68[_0x0b63('0x45')]['id']}})[_0x0b63('0x26')](handleEntityNotFound(_0x228230,null))[_0x0b63('0x26')](function(_0x4ddc8c){if(_0x4ddc8c){_0x1a8b6e=_0x4ddc8c;_0x329d0f[_0x0b63('0x31')]=_[_0x0b63('0x2f')](db['FreshsalesField'][_0x0b63('0x46')]);_0x329d0f[_0x0b63('0x2e')]=_[_0x0b63('0x2f')](_0x54cd68[_0x0b63('0x2e')]);_0x329d0f[_0x0b63('0x30')]=_[_0x0b63('0x47')](_0x329d0f['model'],_0x329d0f[_0x0b63('0x2e')]);_0x41e653[_0x0b63('0x32')]=_[_0x0b63('0x47')](_0x329d0f[_0x0b63('0x31')],qs['fields'](_0x54cd68[_0x0b63('0x2e')][_0x0b63('0x33')]));_0x41e653['attributes']=_0x41e653['attributes'][_0x0b63('0x34')]?_0x41e653['attributes']:_0x329d0f[_0x0b63('0x31')];_0x41e653['order']=qs[_0x0b63('0x38')](_0x54cd68[_0x0b63('0x2e')][_0x0b63('0x38')]);_0x41e653['where']=qs['filters'](_[_0x0b63('0x39')](_0x54cd68['query'],_0x329d0f['filters']));if(_0x54cd68[_0x0b63('0x2e')]['filter']){_0x41e653['where']=_[_0x0b63('0x3a')](_0x41e653[_0x0b63('0x3b')],{'$or':_[_0x0b63('0x3c')](_0x41e653[_0x0b63('0x32')],function(_0x52989f){var _0x3b3abf={};_0x3b3abf[_0x52989f]={'$like':'%'+_0x54cd68[_0x0b63('0x2e')][_0x0b63('0x3e')]+'%'};return _0x3b3abf;})});}_0x41e653=_['merge']({},_0x41e653,_0x54cd68[_0x0b63('0x3f')]);return _0x1a8b6e[_0x0b63('0x4d')](_0x41e653);}})['then'](function(_0x21bfde){if(_0x21bfde){_0x524c6f=_0x21bfde['length'];if(!_0x54cd68['query'][_0x0b63('0x35')](_0x0b63('0x36'))){_0x41e653[_0x0b63('0x1f')]=qs['limit'](_0x54cd68['query'][_0x0b63('0x1f')]);_0x41e653[_0x0b63('0x1d')]=qs[_0x0b63('0x1d')](_0x54cd68['query'][_0x0b63('0x1d')]);}return _0x1a8b6e[_0x0b63('0x4d')](_0x41e653);}})['then'](function(_0x1af2f4){if(_0x1af2f4){return _0x1af2f4?{'count':_0x524c6f,'rows':_0x1af2f4}:null;}})[_0x0b63('0x26')](respondWithResult(_0x228230,null))['catch'](handleError(_0x228230,null));};exports[_0x0b63('0x4f')]=function(_0x114621,_0x359784,_0x2ad6e5){var _0x712f21={};var _0x1af16c={};var _0x7be513;var _0x4c1707;return db[_0x0b63('0x41')][_0x0b63('0x4e')]({'where':{'id':_0x114621[_0x0b63('0x45')]['id']}})[_0x0b63('0x26')](handleEntityNotFound(_0x359784,null))['then'](function(_0x313329){if(_0x313329){_0x7be513=_0x313329;_0x1af16c['model']=_[_0x0b63('0x2f')](db[_0x0b63('0x50')][_0x0b63('0x46')]);_0x1af16c['query']=_[_0x0b63('0x2f')](_0x114621['query']);_0x1af16c[_0x0b63('0x30')]=_[_0x0b63('0x47')](_0x1af16c[_0x0b63('0x31')],_0x1af16c['query']);_0x712f21[_0x0b63('0x32')]=_[_0x0b63('0x47')](_0x1af16c[_0x0b63('0x31')],qs[_0x0b63('0x33')](_0x114621[_0x0b63('0x2e')][_0x0b63('0x33')]));_0x712f21['attributes']=_0x712f21['attributes'][_0x0b63('0x34')]?_0x712f21[_0x0b63('0x32')]:_0x1af16c[_0x0b63('0x31')];_0x712f21[_0x0b63('0x37')]=qs['sort'](_0x114621[_0x0b63('0x2e')][_0x0b63('0x38')]);_0x712f21[_0x0b63('0x3b')]=qs[_0x0b63('0x30')](_[_0x0b63('0x39')](_0x114621[_0x0b63('0x2e')],_0x1af16c['filters']));if(_0x114621[_0x0b63('0x2e')][_0x0b63('0x3e')]){_0x712f21[_0x0b63('0x3b')]=_[_0x0b63('0x3a')](_0x712f21['where'],{'$or':_['map'](_0x712f21['attributes'],function(_0x3341d5){var _0x1a91e3={};_0x1a91e3[_0x3341d5]={'$like':'%'+_0x114621[_0x0b63('0x2e')][_0x0b63('0x3e')]+'%'};return _0x1a91e3;})});}_0x712f21=_[_0x0b63('0x3a')]({},_0x712f21,_0x114621[_0x0b63('0x3f')]);return _0x7be513['getDescriptions'](_0x712f21);}})[_0x0b63('0x26')](function(_0x220f05){if(_0x220f05){_0x4c1707=_0x220f05['length'];if(!_0x114621[_0x0b63('0x2e')][_0x0b63('0x35')]('nolimit')){_0x712f21[_0x0b63('0x1f')]=qs['limit'](_0x114621[_0x0b63('0x2e')]['limit']);_0x712f21[_0x0b63('0x1d')]=qs[_0x0b63('0x1d')](_0x114621[_0x0b63('0x2e')]['offset']);}return _0x7be513[_0x0b63('0x4f')](_0x712f21);}})['then'](function(_0x1dfb04){if(_0x1dfb04){return _0x1dfb04?{'count':_0x4c1707,'rows':_0x1dfb04}:null;}})[_0x0b63('0x26')](respondWithResult(_0x359784,null))['catch'](handleError(_0x359784,null));};exports[_0x0b63('0x51')]=function(_0x22c5c8,_0x3439df,_0x4d8c7a){var _0x4bab3d={};var _0x4f6139={};var _0x56cba0;var _0xe90e99;return db[_0x0b63('0x41')][_0x0b63('0x4e')]({'where':{'id':_0x22c5c8[_0x0b63('0x45')]['id']}})[_0x0b63('0x26')](handleEntityNotFound(_0x3439df,null))[_0x0b63('0x26')](function(_0x2ce5f5){if(_0x2ce5f5){_0x56cba0=_0x2ce5f5;_0x4f6139['model']=_[_0x0b63('0x2f')](db[_0x0b63('0x50')]['rawAttributes']);_0x4f6139['query']=_[_0x0b63('0x2f')](_0x22c5c8['query']);_0x4f6139[_0x0b63('0x30')]=_[_0x0b63('0x47')](_0x4f6139['model'],_0x4f6139[_0x0b63('0x2e')]);_0x4bab3d[_0x0b63('0x32')]=_['intersection'](_0x4f6139[_0x0b63('0x31')],qs['fields'](_0x22c5c8[_0x0b63('0x2e')][_0x0b63('0x33')]));_0x4bab3d[_0x0b63('0x32')]=_0x4bab3d[_0x0b63('0x32')]['length']?_0x4bab3d[_0x0b63('0x32')]:_0x4f6139[_0x0b63('0x31')];_0x4bab3d[_0x0b63('0x37')]=qs[_0x0b63('0x38')](_0x22c5c8[_0x0b63('0x2e')][_0x0b63('0x38')]);_0x4bab3d[_0x0b63('0x3b')]=qs['filters'](_['pick'](_0x22c5c8['query'],_0x4f6139[_0x0b63('0x30')]));if(_0x22c5c8['query'][_0x0b63('0x3e')]){_0x4bab3d[_0x0b63('0x3b')]=_[_0x0b63('0x3a')](_0x4bab3d[_0x0b63('0x3b')],{'$or':_['map'](_0x4bab3d[_0x0b63('0x32')],function(_0x3d2f89){var _0x7bcd60={};_0x7bcd60[_0x3d2f89]={'$like':'%'+_0x22c5c8[_0x0b63('0x2e')][_0x0b63('0x3e')]+'%'};return _0x7bcd60;})});}_0x4bab3d=_['merge']({},_0x4bab3d,_0x22c5c8['options']);return _0x56cba0[_0x0b63('0x51')](_0x4bab3d);}})[_0x0b63('0x26')](function(_0x54a9e1){if(_0x54a9e1){_0xe90e99=_0x54a9e1[_0x0b63('0x34')];if(!_0x22c5c8[_0x0b63('0x2e')]['hasOwnProperty'](_0x0b63('0x36'))){_0x4bab3d[_0x0b63('0x1f')]=qs[_0x0b63('0x1f')](_0x22c5c8['query'][_0x0b63('0x1f')]);_0x4bab3d['offset']=qs[_0x0b63('0x1d')](_0x22c5c8['query']['offset']);}return _0x56cba0['getFields'](_0x4bab3d);}})[_0x0b63('0x26')](function(_0x9439cb){if(_0x9439cb){return _0x9439cb?{'count':_0xe90e99,'rows':_0x9439cb}:null;}})[_0x0b63('0x26')](respondWithResult(_0x3439df,null))[_0x0b63('0x43')](handleError(_0x3439df,null));};
\ No newline at end of file
index fadb5c6..a7767c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbe2=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','../../config/logger','api','moment','path','rimraf','./intFreshsalesConfiguration.attributes'];(function(_0x4a2b84,_0x3c31db){var _0x297dc5=function(_0x122de1){while(--_0x122de1){_0x4a2b84['push'](_0x4a2b84['shift']());}};_0x297dc5(++_0x3c31db);}(_0xcbe2,0x144));var _0x2cbe=function(_0x594207,_0x45f9bd){_0x594207=_0x594207-0x0;var _0x2810e8=_0xcbe2[_0x594207];return _0x2810e8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2cbe('0x0'))(_0x2cbe('0x1'));var moment=require(_0x2cbe('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cbe('0x3'));var rimraf=require(_0x2cbe('0x4'));var config=require('../../config/environment');var attributes=require(_0x2cbe('0x5'));module[_0x2cbe('0x6')]=function(_0x101448,_0x2f6807){return _0x101448[_0x2cbe('0x7')](_0x2cbe('0x8'),attributes,{'tableName':_0x2cbe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x093a=['moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','lodash','util','../../config/logger','api'];(function(_0xb15d44,_0x56f418){var _0x355231=function(_0x2cb12d){while(--_0x2cb12d){_0xb15d44['push'](_0xb15d44['shift']());}};_0x355231(++_0x56f418);}(_0x093a,0xd4));var _0xa093=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x093a[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xa093('0x0'));var util=require(_0xa093('0x1'));var logger=require(_0xa093('0x2'))(_0xa093('0x3'));var moment=require(_0xa093('0x4'));var BPromise=require(_0xa093('0x5'));var rp=require(_0xa093('0x6'));var fs=require('fs');var path=require(_0xa093('0x7'));var rimraf=require('rimraf');var config=require(_0xa093('0x8'));var attributes=require(_0xa093('0x9'));module['exports']=function(_0x2d1244,_0x4aa85d){return _0x2d1244[_0xa093('0xa')](_0xa093('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0f6e24e..9875576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae55=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x338475,_0x5a391a){var _0x3bb2c0=function(_0x1d72c1){while(--_0x1d72c1){_0x338475['push'](_0x338475['shift']());}};_0x3bb2c0(++_0x5a391a);}(_0xae55,0x172));var _0x5ae5=function(_0x3aa3af,_0x3811e9){_0x3aa3af=_0x3aa3af-0x0;var _0x2f2d0a=_0xae55[_0x3aa3af];return _0x2f2d0a;};'use strict';var _=require(_0x5ae5('0x0'));var util=require(_0x5ae5('0x1'));var moment=require('moment');var BPromise=require(_0x5ae5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ae5('0x3'));var db=require(_0x5ae5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ae5('0x5'))(_0x5ae5('0x6'));var config=require(_0x5ae5('0x7'));var jayson=require(_0x5ae5('0x8'));var client=jayson[_0x5ae5('0x9')][_0x5ae5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x137fdb,_0x38dd6d,_0x59b5b1){return new BPromise(function(_0x2947d7,_0x178205){return client[_0x5ae5('0xb')](_0x137fdb,_0x59b5b1)[_0x5ae5('0xc')](function(_0x2fbc9b){logger[_0x5ae5('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x38dd6d,'request\x20sent');logger[_0x5ae5('0xe')](_0x5ae5('0xf'),_0x38dd6d,_0x5ae5('0x10'),JSON['stringify'](_0x2fbc9b));if(_0x2fbc9b[_0x5ae5('0x11')]){if(_0x2fbc9b[_0x5ae5('0x11')][_0x5ae5('0x12')]===0x1f4){logger[_0x5ae5('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x38dd6d,_0x2fbc9b[_0x5ae5('0x11')][_0x5ae5('0x13')]);return _0x178205(_0x2fbc9b[_0x5ae5('0x11')][_0x5ae5('0x13')]);}logger[_0x5ae5('0x11')](_0x5ae5('0x14'),_0x38dd6d,_0x2fbc9b[_0x5ae5('0x11')]['message']);return _0x2947d7(_0x2fbc9b[_0x5ae5('0x11')][_0x5ae5('0x13')]);}else{logger[_0x5ae5('0xd')](_0x5ae5('0x14'),_0x38dd6d,_0x5ae5('0x10'));_0x2947d7(_0x2fbc9b[_0x5ae5('0x15')][_0x5ae5('0x13')]);}})[_0x5ae5('0x16')](function(_0x5dc8b4){logger[_0x5ae5('0x11')](_0x5ae5('0x14'),_0x38dd6d,_0x5dc8b4);_0x178205(_0x5dc8b4);});});}
\ No newline at end of file
+var _0x8010=['lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch'];(function(_0x1ed9b1,_0x10b80f){var _0x2410ac=function(_0x44f6cf){while(--_0x44f6cf){_0x1ed9b1['push'](_0x1ed9b1['shift']());}};_0x2410ac(++_0x10b80f);}(_0x8010,0x104));var _0x0801=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8010[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0801('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0801('0x1'));var rs=require(_0x0801('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0801('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0801('0x4'))('rpc');var config=require(_0x0801('0x5'));var jayson=require(_0x0801('0x6'));var client=jayson[_0x0801('0x7')][_0x0801('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e45d9,_0x2c20a1,_0x3d3c44){return new BPromise(function(_0xa8a1a7,_0x9b4b59){return client[_0x0801('0x9')](_0x4e45d9,_0x3d3c44)[_0x0801('0xa')](function(_0x526e23){logger[_0x0801('0xb')](_0x0801('0xc'),_0x2c20a1,'request\x20sent');logger[_0x0801('0xd')](_0x0801('0xe'),_0x2c20a1,'request\x20sent',JSON[_0x0801('0xf')](_0x526e23));if(_0x526e23['error']){if(_0x526e23[_0x0801('0x10')]['code']===0x1f4){logger[_0x0801('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2c20a1,_0x526e23['error']['message']);return _0x9b4b59(_0x526e23[_0x0801('0x10')][_0x0801('0x11')]);}logger[_0x0801('0x10')](_0x0801('0xc'),_0x2c20a1,_0x526e23['error'][_0x0801('0x11')]);return _0xa8a1a7(_0x526e23[_0x0801('0x10')]['message']);}else{logger[_0x0801('0xb')](_0x0801('0xc'),_0x2c20a1,_0x0801('0x12'));_0xa8a1a7(_0x526e23['result']['message']);}})[_0x0801('0x13')](function(_0x4acb1a){logger[_0x0801('0x10')](_0x0801('0xc'),_0x2c20a1,_0x4acb1a);_0x9b4b59(_0x4acb1a);});});}
\ No newline at end of file
index 56b091f..28c9130 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d4e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x22639d,_0x1faaad){var _0x3e0df1=function(_0x560601){while(--_0x560601){_0x22639d['push'](_0x22639d['shift']());}};_0x3e0df1(++_0x1faaad);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0d4e[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var path=require(_0xe0d4('0x2'));var timeout=require(_0xe0d4('0x3'));var express=require(_0xe0d4('0x4'));var router=express[_0xe0d4('0x5')]();var fs_extra=require(_0xe0d4('0x6'));var auth=require(_0xe0d4('0x7'));var interaction=require(_0xe0d4('0x8'));var config=require('../../config/environment');var controller=require(_0xe0d4('0x9'));router[_0xe0d4('0xa')]('/',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xc')]);router['get']('/:id',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xd')]);router[_0xe0d4('0xe')]('/',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xf')]);router[_0xe0d4('0x10')](_0xe0d4('0x11'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x12')]);router[_0xe0d4('0x13')](_0xe0d4('0x11'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xe74e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','index','get','show','post','isAuthenticated','/:id','update','delete','exports'];(function(_0x2920e7,_0x44c390){var _0x4316a0=function(_0x1ec470){while(--_0x1ec470){_0x2920e7['push'](_0x2920e7['shift']());}};_0x4316a0(++_0x44c390);}(_0xe74e,0x10a));var _0xee74=function(_0x44b0c0,_0x580b3f){_0x44b0c0=_0x44b0c0-0x0;var _0x146cad=_0xe74e[_0x44b0c0];return _0x146cad;};'use strict';var multer=require('multer');var util=require(_0xee74('0x0'));var path=require(_0xee74('0x1'));var timeout=require(_0xee74('0x2'));var express=require(_0xee74('0x3'));var router=express[_0xee74('0x4')]();var fs_extra=require(_0xee74('0x5'));var auth=require(_0xee74('0x6'));var interaction=require(_0xee74('0x7'));var config=require(_0xee74('0x8'));var controller=require(_0xee74('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xee74('0xa')]);router[_0xee74('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xee74('0xc')]);router[_0xee74('0xd')]('/',auth[_0xee74('0xe')](),controller['create']);router['put'](_0xee74('0xf'),auth[_0xee74('0xe')](),controller[_0xee74('0x10')]);router[_0xee74('0x11')](_0xee74('0xf'),auth[_0xee74('0xe')](),controller['destroy']);module[_0xee74('0x12')]=router;
\ No newline at end of file
index b672f13..e633d06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cc9=['BOOLEAN','exports','ENUM','string','keyValue','picklist','STRING','variable','customVariable'];(function(_0xfa2e1e,_0x4002ed){var _0x2f1d12=function(_0x222fe6){while(--_0x222fe6){_0xfa2e1e['push'](_0xfa2e1e['shift']());}};_0x2f1d12(++_0x4002ed);}(_0x5cc9,0x1f0));var _0x95cc=function(_0x33d0c8,_0x3c4fbe){_0x33d0c8=_0x33d0c8-0x0;var _0x246c43=_0x5cc9[_0x33d0c8];return _0x246c43;};'use strict';var Sequelize=require('sequelize');module[_0x95cc('0x0')]={'type':{'type':Sequelize[_0x95cc('0x1')](_0x95cc('0x2'),'variable','customVariable',_0x95cc('0x3'),_0x95cc('0x4')),'defaultValue':_0x95cc('0x2')},'content':{'type':Sequelize[_0x95cc('0x5')]},'key':{'type':Sequelize[_0x95cc('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x95cc('0x6'),_0x95cc('0x7'))},'keyContent':{'type':Sequelize[_0x95cc('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x95cc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x95cc('0x5')]}};
\ No newline at end of file
+var _0x6442=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x31cc6c,_0x5a5385){var _0x44dc72=function(_0x3cabed){while(--_0x3cabed){_0x31cc6c['push'](_0x31cc6c['shift']());}};_0x44dc72(++_0x5a5385);}(_0x6442,0x187));var _0x2644=function(_0x37be36,_0x18fe03){_0x37be36=_0x37be36-0x0;var _0x47108e=_0x6442[_0x37be36];return _0x47108e;};'use strict';var Sequelize=require(_0x2644('0x0'));module[_0x2644('0x1')]={'type':{'type':Sequelize[_0x2644('0x2')](_0x2644('0x3'),'variable',_0x2644('0x4'),_0x2644('0x5'),_0x2644('0x6')),'defaultValue':_0x2644('0x3')},'content':{'type':Sequelize[_0x2644('0x7')]},'key':{'type':Sequelize[_0x2644('0x7')]},'keyType':{'type':Sequelize[_0x2644('0x2')](_0x2644('0x3'),'variable',_0x2644('0x4'))},'keyContent':{'type':Sequelize[_0x2644('0x7')]},'idField':{'type':Sequelize[_0x2644('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2644('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index be947a4..75f5828 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a9d=['map','FreshsalesField','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','merge','where','VIRTUAL','filter','options','then','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','end','error','stack','name','index'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7a9d,0x67));var _0xd7a9=function(_0x2dab4a,_0x428664){_0x2dab4a=_0x2dab4a-0x0;var _0x5c3663=_0x7a9d[_0x2dab4a];return _0x5c3663;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7a9('0x0'));var zipdir=require(_0xd7a9('0x1'));var jsonpatch=require(_0xd7a9('0x2'));var rp=require(_0xd7a9('0x3'));var moment=require(_0xd7a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd7a9('0x5'));var util=require(_0xd7a9('0x6'));var path=require('path');var sox=require(_0xd7a9('0x7'));var csv=require(_0xd7a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7a9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd7a9('0xa'));var deskjs=require(_0xd7a9('0xb'));var toCsv=require(_0xd7a9('0x8'));var querystring=require('querystring');var Papa=require(_0xd7a9('0xc'));var Redis=require('ioredis');var authService=require(_0xd7a9('0xd'));var qs=require(_0xd7a9('0xe'));var as=require(_0xd7a9('0xf'));var hardwareService=require(_0xd7a9('0x10'));var logger=require('../../config/logger')(_0xd7a9('0x11'));var utils=require(_0xd7a9('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd7a9('0x13'))['db'];function respondWithStatusCode(_0x1a4ac6,_0x3ba168){_0x3ba168=_0x3ba168||0xcc;return function(_0x60390c){if(_0x60390c){return _0x1a4ac6[_0xd7a9('0x14')](_0x3ba168);}return _0x1a4ac6[_0xd7a9('0x15')](_0x3ba168)['end']();};}function respondWithResult(_0x4cfc25,_0x3ba9aa){_0x3ba9aa=_0x3ba9aa||0xc8;return function(_0xb77cea){if(_0xb77cea){return _0x4cfc25[_0xd7a9('0x15')](_0x3ba9aa)[_0xd7a9('0x16')](_0xb77cea);}};}function respondWithFilteredResult(_0xb5e6c2,_0xe9567f){return function(_0x56c586){if(_0x56c586){var _0x4dbe65=typeof _0xe9567f[_0xd7a9('0x17')]===_0xd7a9('0x18')&&typeof _0xe9567f['limit']===_0xd7a9('0x18');var _0x2f45b9=_0x56c586[_0xd7a9('0x19')];var _0x3ef364=_0x4dbe65?0x0:_0xe9567f[_0xd7a9('0x17')];var _0x266718=_0x4dbe65?_0x56c586['count']:_0xe9567f[_0xd7a9('0x17')]+_0xe9567f[_0xd7a9('0x1a')];var _0x27959a;if(_0x266718>=_0x2f45b9){_0x266718=_0x2f45b9;_0x27959a=0xc8;}else{_0x27959a=0xce;}_0xb5e6c2['status'](_0x27959a);return _0xb5e6c2[_0xd7a9('0x1b')]('Content-Range',_0x3ef364+'-'+_0x266718+'/'+_0x2f45b9)[_0xd7a9('0x16')](_0x56c586);}return null;};}function patchUpdates(_0x42d6fa){return function(_0xc48b04){try{jsonpatch[_0xd7a9('0x1c')](_0xc48b04,_0x42d6fa,!![]);}catch(_0x3886de){return BPromise[_0xd7a9('0x1d')](_0x3886de);}return _0xc48b04[_0xd7a9('0x1e')]();};}function saveUpdates(_0x1be54e,_0x4caf00){return function(_0x365452){if(_0x365452){return _0x365452[_0xd7a9('0x1f')](_0x1be54e)['then'](function(_0x35e334){return _0x35e334;});}return null;};}function removeEntity(_0x14a730,_0x14fe8b){return function(_0x308861){if(_0x308861){return _0x308861['destroy']()['then'](function(){_0x14a730[_0xd7a9('0x15')](0xcc)[_0xd7a9('0x20')]();});}};}function handleEntityNotFound(_0x25125b,_0x44f6d6){return function(_0x235fc7){if(!_0x235fc7){_0x25125b['sendStatus'](0x194);}return _0x235fc7;};}function handleError(_0x5a986e,_0x410518){_0x410518=_0x410518||0x1f4;return function(_0x1a9c68){logger[_0xd7a9('0x21')](_0x1a9c68[_0xd7a9('0x22')]);if(_0x1a9c68[_0xd7a9('0x23')]){delete _0x1a9c68[_0xd7a9('0x23')];}_0x5a986e[_0xd7a9('0x15')](_0x410518)['send'](_0x1a9c68);};}exports[_0xd7a9('0x24')]=function(_0x39e932,_0x50afc1){var _0x35186e={},_0xd6b82b={},_0x3de0ff={'count':0x0,'rows':[]};var _0x1a4898=_[_0xd7a9('0x25')](db[_0xd7a9('0x26')]['rawAttributes'],function(_0x543b12){return{'name':_0x543b12[_0xd7a9('0x27')],'type':_0x543b12[_0xd7a9('0x28')][_0xd7a9('0x29')]};});_0xd6b82b[_0xd7a9('0x2a')]=_[_0xd7a9('0x25')](_0x1a4898,_0xd7a9('0x23'));_0xd6b82b['query']=_[_0xd7a9('0x2b')](_0x39e932[_0xd7a9('0x2c')]);_0xd6b82b[_0xd7a9('0x2d')]=_[_0xd7a9('0x2e')](_0xd6b82b[_0xd7a9('0x2a')],_0xd6b82b[_0xd7a9('0x2c')]);_0x35186e[_0xd7a9('0x2f')]=_['intersection'](_0xd6b82b[_0xd7a9('0x2a')],qs[_0xd7a9('0x30')](_0x39e932[_0xd7a9('0x2c')]['fields']));_0x35186e[_0xd7a9('0x2f')]=_0x35186e[_0xd7a9('0x2f')][_0xd7a9('0x31')]?_0x35186e[_0xd7a9('0x2f')]:_0xd6b82b['model'];if(!_0x39e932[_0xd7a9('0x2c')][_0xd7a9('0x32')](_0xd7a9('0x33'))){_0x35186e[_0xd7a9('0x1a')]=qs[_0xd7a9('0x1a')](_0x39e932['query'][_0xd7a9('0x1a')]);_0x35186e['offset']=qs[_0xd7a9('0x17')](_0x39e932[_0xd7a9('0x2c')][_0xd7a9('0x17')]);}_0x35186e['order']=qs[_0xd7a9('0x34')](_0x39e932[_0xd7a9('0x2c')]['sort']);_0x35186e['where']=qs[_0xd7a9('0x2d')](_['pick'](_0x39e932[_0xd7a9('0x2c')],_0xd6b82b['filters']),_0x1a4898);if(_0x39e932[_0xd7a9('0x2c')]['filter']){_0x35186e['where']=_[_0xd7a9('0x35')](_0x35186e[_0xd7a9('0x36')],{'$or':_['map'](_0x1a4898,function(_0x5e2682){if(_0x5e2682[_0xd7a9('0x28')]!==_0xd7a9('0x37')){var _0x5dd4ae={};_0x5dd4ae[_0x5e2682[_0xd7a9('0x23')]]={'$like':'%'+_0x39e932[_0xd7a9('0x2c')][_0xd7a9('0x38')]+'%'};return _0x5dd4ae;}})});}_0x35186e=_['merge']({},_0x35186e,_0x39e932[_0xd7a9('0x39')]);var _0x5979f4={'where':_0x35186e[_0xd7a9('0x36')]};return db[_0xd7a9('0x26')][_0xd7a9('0x19')](_0x5979f4)[_0xd7a9('0x3a')](function(_0x107e16){_0x3de0ff['count']=_0x107e16;if(_0x39e932[_0xd7a9('0x2c')][_0xd7a9('0x3b')]){_0x35186e['include']=[{'all':!![]}];}return db[_0xd7a9('0x26')][_0xd7a9('0x3c')](_0x35186e);})[_0xd7a9('0x3a')](function(_0x5acef9){_0x3de0ff[_0xd7a9('0x3d')]=_0x5acef9;return _0x3de0ff;})[_0xd7a9('0x3a')](respondWithFilteredResult(_0x50afc1,_0x35186e))[_0xd7a9('0x3e')](handleError(_0x50afc1,null));};exports['show']=function(_0x3ffbc5,_0x5199bb){var _0x283564={'raw':!![],'where':{'id':_0x3ffbc5[_0xd7a9('0x3f')]['id']}},_0x37891f={};_0x37891f[_0xd7a9('0x2a')]=_[_0xd7a9('0x2b')](db[_0xd7a9('0x26')][_0xd7a9('0x40')]);_0x37891f[_0xd7a9('0x2c')]=_['keys'](_0x3ffbc5[_0xd7a9('0x2c')]);_0x37891f[_0xd7a9('0x2d')]=_[_0xd7a9('0x2e')](_0x37891f[_0xd7a9('0x2a')],_0x37891f['query']);_0x283564['attributes']=_[_0xd7a9('0x2e')](_0x37891f[_0xd7a9('0x2a')],qs['fields'](_0x3ffbc5[_0xd7a9('0x2c')]['fields']));_0x283564[_0xd7a9('0x2f')]=_0x283564[_0xd7a9('0x2f')][_0xd7a9('0x31')]?_0x283564[_0xd7a9('0x2f')]:_0x37891f['model'];if(_0x3ffbc5[_0xd7a9('0x2c')][_0xd7a9('0x3b')]){_0x283564[_0xd7a9('0x41')]=[{'all':!![]}];}_0x283564=_['merge']({},_0x283564,_0x3ffbc5[_0xd7a9('0x39')]);return db[_0xd7a9('0x26')][_0xd7a9('0x42')](_0x283564)[_0xd7a9('0x3a')](handleEntityNotFound(_0x5199bb,null))[_0xd7a9('0x3a')](respondWithResult(_0x5199bb,null))['catch'](handleError(_0x5199bb,null));};exports[_0xd7a9('0x43')]=function(_0x119d9c,_0x497b39){return db[_0xd7a9('0x26')][_0xd7a9('0x43')](_0x119d9c[_0xd7a9('0x44')],{})[_0xd7a9('0x3a')](respondWithResult(_0x497b39,0xc9))[_0xd7a9('0x3e')](handleError(_0x497b39,null));};exports['update']=function(_0x1dbaf7,_0x72139c){if(_0x1dbaf7[_0xd7a9('0x44')]['id']){delete _0x1dbaf7[_0xd7a9('0x44')]['id'];}return db[_0xd7a9('0x26')][_0xd7a9('0x42')]({'where':{'id':_0x1dbaf7['params']['id']}})['then'](handleEntityNotFound(_0x72139c,null))[_0xd7a9('0x3a')](saveUpdates(_0x1dbaf7[_0xd7a9('0x44')],null))[_0xd7a9('0x3a')](respondWithResult(_0x72139c,null))['catch'](handleError(_0x72139c,null));};exports[_0xd7a9('0x45')]=function(_0x3c856d,_0x2746d9){return db[_0xd7a9('0x26')][_0xd7a9('0x42')]({'where':{'id':_0x3c856d[_0xd7a9('0x3f')]['id']}})[_0xd7a9('0x3a')](handleEntityNotFound(_0x2746d9,null))['then'](removeEntity(_0x2746d9,null))[_0xd7a9('0x3e')](handleError(_0x2746d9,null));};
\ No newline at end of file
+var _0xdcbe=['Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','FreshsalesField','includeAll','include','findAll','catch','show','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x16f862,_0x45cd6a){var _0x545053=function(_0x2f88ef){while(--_0x2f88ef){_0x16f862['push'](_0x16f862['shift']());}};_0x545053(++_0x45cd6a);}(_0xdcbe,0x1d8));var _0xedcb=function(_0x4b4918,_0x1c6851){_0x4b4918=_0x4b4918-0x0;var _0x600cee=_0xdcbe[_0x4b4918];return _0x600cee;};'use strict';var emlformat=require(_0xedcb('0x0'));var rimraf=require(_0xedcb('0x1'));var zipdir=require(_0xedcb('0x2'));var jsonpatch=require(_0xedcb('0x3'));var rp=require(_0xedcb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xedcb('0x5'));var util=require(_0xedcb('0x6'));var path=require(_0xedcb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xedcb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedcb('0x9'));var squel=require(_0xedcb('0xa'));var crypto=require(_0xedcb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xedcb('0xc'));var Papa=require(_0xedcb('0xd'));var Redis=require(_0xedcb('0xe'));var authService=require(_0xedcb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xedcb('0x10'));var hardwareService=require(_0xedcb('0x11'));var logger=require(_0xedcb('0x12'))(_0xedcb('0x13'));var utils=require(_0xedcb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xedcb('0x15'));var db=require(_0xedcb('0x16'))['db'];function respondWithStatusCode(_0x247fc5,_0x13c0b4){_0x13c0b4=_0x13c0b4||0xcc;return function(_0x5dfa1a){if(_0x5dfa1a){return _0x247fc5[_0xedcb('0x17')](_0x13c0b4);}return _0x247fc5[_0xedcb('0x18')](_0x13c0b4)[_0xedcb('0x19')]();};}function respondWithResult(_0x409841,_0x489729){_0x489729=_0x489729||0xc8;return function(_0xeec49f){if(_0xeec49f){return _0x409841[_0xedcb('0x18')](_0x489729)[_0xedcb('0x1a')](_0xeec49f);}};}function respondWithFilteredResult(_0x8ca21c,_0x4075aa){return function(_0x35f1e6){if(_0x35f1e6){var _0x3ed684=typeof _0x4075aa[_0xedcb('0x1b')]===_0xedcb('0x1c')&&typeof _0x4075aa[_0xedcb('0x1d')]===_0xedcb('0x1c');var _0xaf8979=_0x35f1e6[_0xedcb('0x1e')];var _0x14d5d9=_0x3ed684?0x0:_0x4075aa['offset'];var _0x493fe0=_0x3ed684?_0x35f1e6['count']:_0x4075aa[_0xedcb('0x1b')]+_0x4075aa['limit'];var _0x45aa3f;if(_0x493fe0>=_0xaf8979){_0x493fe0=_0xaf8979;_0x45aa3f=0xc8;}else{_0x45aa3f=0xce;}_0x8ca21c[_0xedcb('0x18')](_0x45aa3f);return _0x8ca21c[_0xedcb('0x1f')](_0xedcb('0x20'),_0x14d5d9+'-'+_0x493fe0+'/'+_0xaf8979)[_0xedcb('0x1a')](_0x35f1e6);}return null;};}function patchUpdates(_0x17480c){return function(_0x44578c){try{jsonpatch['apply'](_0x44578c,_0x17480c,!![]);}catch(_0x49432e){return BPromise[_0xedcb('0x21')](_0x49432e);}return _0x44578c[_0xedcb('0x22')]();};}function saveUpdates(_0x540057,_0x209af9){return function(_0x23b319){if(_0x23b319){return _0x23b319[_0xedcb('0x23')](_0x540057)[_0xedcb('0x24')](function(_0xe47a10){return _0xe47a10;});}return null;};}function removeEntity(_0x58304a,_0x5dae2c){return function(_0x3cba42){if(_0x3cba42){return _0x3cba42[_0xedcb('0x25')]()[_0xedcb('0x24')](function(){_0x58304a[_0xedcb('0x18')](0xcc)[_0xedcb('0x19')]();});}};}function handleEntityNotFound(_0x2a9798,_0x43bb1a){return function(_0x25e6bf){if(!_0x25e6bf){_0x2a9798[_0xedcb('0x17')](0x194);}return _0x25e6bf;};}function handleError(_0x1450ba,_0x1b1fba){_0x1b1fba=_0x1b1fba||0x1f4;return function(_0x15957c){logger['error'](_0x15957c[_0xedcb('0x26')]);if(_0x15957c[_0xedcb('0x27')]){delete _0x15957c[_0xedcb('0x27')];}_0x1450ba[_0xedcb('0x18')](_0x1b1fba)[_0xedcb('0x28')](_0x15957c);};}exports[_0xedcb('0x29')]=function(_0xc5b0b1,_0x14d067){var _0x45ee5e={},_0x10e129={},_0x2045fc={'count':0x0,'rows':[]};var _0x38a6c9=_[_0xedcb('0x2a')](db['FreshsalesField'][_0xedcb('0x2b')],function(_0x5e2991){return{'name':_0x5e2991[_0xedcb('0x2c')],'type':_0x5e2991['type'][_0xedcb('0x2d')]};});_0x10e129[_0xedcb('0x2e')]=_[_0xedcb('0x2a')](_0x38a6c9,_0xedcb('0x27'));_0x10e129[_0xedcb('0x2f')]=_[_0xedcb('0x30')](_0xc5b0b1[_0xedcb('0x2f')]);_0x10e129['filters']=_[_0xedcb('0x31')](_0x10e129[_0xedcb('0x2e')],_0x10e129[_0xedcb('0x2f')]);_0x45ee5e[_0xedcb('0x32')]=_[_0xedcb('0x31')](_0x10e129['model'],qs[_0xedcb('0x33')](_0xc5b0b1[_0xedcb('0x2f')][_0xedcb('0x33')]));_0x45ee5e['attributes']=_0x45ee5e['attributes'][_0xedcb('0x34')]?_0x45ee5e[_0xedcb('0x32')]:_0x10e129[_0xedcb('0x2e')];if(!_0xc5b0b1['query'][_0xedcb('0x35')](_0xedcb('0x36'))){_0x45ee5e[_0xedcb('0x1d')]=qs['limit'](_0xc5b0b1[_0xedcb('0x2f')][_0xedcb('0x1d')]);_0x45ee5e[_0xedcb('0x1b')]=qs[_0xedcb('0x1b')](_0xc5b0b1[_0xedcb('0x2f')][_0xedcb('0x1b')]);}_0x45ee5e['order']=qs[_0xedcb('0x37')](_0xc5b0b1[_0xedcb('0x2f')][_0xedcb('0x37')]);_0x45ee5e[_0xedcb('0x38')]=qs[_0xedcb('0x39')](_[_0xedcb('0x3a')](_0xc5b0b1[_0xedcb('0x2f')],_0x10e129['filters']),_0x38a6c9);if(_0xc5b0b1[_0xedcb('0x2f')][_0xedcb('0x3b')]){_0x45ee5e[_0xedcb('0x38')]=_[_0xedcb('0x3c')](_0x45ee5e[_0xedcb('0x38')],{'$or':_[_0xedcb('0x2a')](_0x38a6c9,function(_0x5e501d){if(_0x5e501d[_0xedcb('0x3d')]!==_0xedcb('0x3e')){var _0x1348b3={};_0x1348b3[_0x5e501d[_0xedcb('0x27')]]={'$like':'%'+_0xc5b0b1[_0xedcb('0x2f')]['filter']+'%'};return _0x1348b3;}})});}_0x45ee5e=_['merge']({},_0x45ee5e,_0xc5b0b1['options']);var _0x5f0d62={'where':_0x45ee5e[_0xedcb('0x38')]};return db[_0xedcb('0x3f')][_0xedcb('0x1e')](_0x5f0d62)[_0xedcb('0x24')](function(_0x4e7e3b){_0x2045fc[_0xedcb('0x1e')]=_0x4e7e3b;if(_0xc5b0b1[_0xedcb('0x2f')][_0xedcb('0x40')]){_0x45ee5e[_0xedcb('0x41')]=[{'all':!![]}];}return db[_0xedcb('0x3f')][_0xedcb('0x42')](_0x45ee5e);})[_0xedcb('0x24')](function(_0x3aeb34){_0x2045fc['rows']=_0x3aeb34;return _0x2045fc;})[_0xedcb('0x24')](respondWithFilteredResult(_0x14d067,_0x45ee5e))[_0xedcb('0x43')](handleError(_0x14d067,null));};exports[_0xedcb('0x44')]=function(_0x18c457,_0x2404af){var _0x485a2e={'raw':!![],'where':{'id':_0x18c457['params']['id']}},_0x1014a8={};_0x1014a8[_0xedcb('0x2e')]=_[_0xedcb('0x30')](db['FreshsalesField'][_0xedcb('0x2b')]);_0x1014a8[_0xedcb('0x2f')]=_[_0xedcb('0x30')](_0x18c457[_0xedcb('0x2f')]);_0x1014a8[_0xedcb('0x39')]=_[_0xedcb('0x31')](_0x1014a8[_0xedcb('0x2e')],_0x1014a8[_0xedcb('0x2f')]);_0x485a2e[_0xedcb('0x32')]=_['intersection'](_0x1014a8['model'],qs[_0xedcb('0x33')](_0x18c457[_0xedcb('0x2f')][_0xedcb('0x33')]));_0x485a2e['attributes']=_0x485a2e[_0xedcb('0x32')][_0xedcb('0x34')]?_0x485a2e['attributes']:_0x1014a8[_0xedcb('0x2e')];if(_0x18c457[_0xedcb('0x2f')][_0xedcb('0x40')]){_0x485a2e[_0xedcb('0x41')]=[{'all':!![]}];}_0x485a2e=_['merge']({},_0x485a2e,_0x18c457['options']);return db[_0xedcb('0x3f')]['find'](_0x485a2e)[_0xedcb('0x24')](handleEntityNotFound(_0x2404af,null))[_0xedcb('0x24')](respondWithResult(_0x2404af,null))[_0xedcb('0x43')](handleError(_0x2404af,null));};exports[_0xedcb('0x45')]=function(_0x220208,_0x5d98a3){return db[_0xedcb('0x3f')][_0xedcb('0x45')](_0x220208[_0xedcb('0x46')],{})[_0xedcb('0x24')](respondWithResult(_0x5d98a3,0xc9))[_0xedcb('0x43')](handleError(_0x5d98a3,null));};exports[_0xedcb('0x23')]=function(_0x36c6d6,_0x393088){if(_0x36c6d6[_0xedcb('0x46')]['id']){delete _0x36c6d6[_0xedcb('0x46')]['id'];}return db[_0xedcb('0x3f')]['find']({'where':{'id':_0x36c6d6[_0xedcb('0x47')]['id']}})['then'](handleEntityNotFound(_0x393088,null))['then'](saveUpdates(_0x36c6d6[_0xedcb('0x46')],null))[_0xedcb('0x24')](respondWithResult(_0x393088,null))[_0xedcb('0x43')](handleError(_0x393088,null));};exports['destroy']=function(_0x343ed5,_0x18c829){return db['FreshsalesField']['find']({'where':{'id':_0x343ed5[_0xedcb('0x47')]['id']}})[_0xedcb('0x24')](handleEntityNotFound(_0x18c829,null))[_0xedcb('0x24')](removeEntity(_0x18c829,null))[_0xedcb('0x43')](handleError(_0x18c829,null));};
\ No newline at end of file
index 94135cc..e6560f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0dd=['define','FreshsalesField','int_freshsales_fields','idField','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x2b3b76,_0x49dfbe){var _0x337357=function(_0x5ee5ce){while(--_0x5ee5ce){_0x2b3b76['push'](_0x2b3b76['shift']());}};_0x337357(++_0x49dfbe);}(_0xe0dd,0x163));var _0xde0d=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xe0dd[_0xf2662b];return _0x257dc7;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var logger=require('../../config/logger')(_0xde0d('0x2'));var moment=require(_0xde0d('0x3'));var BPromise=require(_0xde0d('0x4'));var rp=require(_0xde0d('0x5'));var fs=require('fs');var path=require(_0xde0d('0x6'));var rimraf=require(_0xde0d('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module[_0xde0d('0x8')]=function(_0x1c7bda,_0x5c58e5){return _0x1c7bda[_0xde0d('0x9')](_0xde0d('0xa'),attributes,{'tableName':_0xde0d('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xde0d('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ed9=['rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5f2920,_0x12e236){var _0x42a70f=function(_0x4dd2b6){while(--_0x4dd2b6){_0x5f2920['push'](_0x5f2920['shift']());}};_0x42a70f(++_0x12e236);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5ed9[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var logger=require('../../config/logger')(_0x95ed('0x2'));var moment=require(_0x95ed('0x3'));var BPromise=require(_0x95ed('0x4'));var rp=require(_0x95ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95ed('0x6'));var config=require(_0x95ed('0x7'));var attributes=require(_0x95ed('0x8'));module['exports']=function(_0x2c9009,_0x5a5117){return _0x2c9009[_0x95ed('0x9')](_0x95ed('0xa'),attributes,{'tableName':_0x95ed('0xb'),'paranoid':![],'indexes':[{'name':_0x95ed('0xc'),'fields':[_0x95ed('0xd'),_0x95ed('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 594dada..fe1fc4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4ea413,_0x51ff3a){var _0x51cf25=function(_0x3c6456){while(--_0x3c6456){_0x4ea413['push'](_0x4ea413['shift']());}};_0x51cf25(++_0x51ff3a);}(_0xadb5,0xad));var _0x5adb=function(_0x309bac,_0x4c416e){_0x309bac=_0x309bac-0x0;var _0x46ff44=_0xadb5[_0x309bac];return _0x46ff44;};'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']('FreshsalesField,\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);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x4975,0x86));var _0x5497=function(_0x14bcdd,_0x2ed5d2){_0x14bcdd=_0x14bcdd-0x0;var _0x606ec5=_0x4975[_0x14bcdd];return _0x606ec5;};'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')]('FreshsalesField,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
index 552217d..6b516b1 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(_0x1385ae,_0x2ea6ad){var _0x5cb3b9=function(_0x24d360){while(--_0x24d360){_0x1385ae['push'](_0x1385ae['shift']());}};_0x5cb3b9(++_0x2ea6ad);}(_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'));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(_0x10ce4c,_0xc5904a){var _0x2cb0fd=function(_0x3125ac){while(--_0x3125ac){_0x10ce4c['push'](_0x10ce4c['shift']());}};_0x2cb0fd(++_0xc5904a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 ee2deed..ed9a2f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x299a=['newTab','exports','STRING','ENUM','integrationTab'];(function(_0x3b0f80,_0x1a666a){var _0x52d4bf=function(_0x4ffda1){while(--_0x4ffda1){_0x3b0f80['push'](_0x3b0f80['shift']());}};_0x52d4bf(++_0x1a666a);}(_0x299a,0x182));var _0xa299=function(_0x2039d6,_0x3db5f9){_0x2039d6=_0x2039d6-0x0;var _0x5ac0ca=_0x299a[_0x2039d6];return _0x5ac0ca;};'use strict';var Sequelize=require('sequelize');module[_0xa299('0x0')]={'name':{'type':Sequelize[_0xa299('0x1')]},'description':{'type':Sequelize[_0xa299('0x1')]},'username':{'type':Sequelize[_0xa299('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xa299('0x1')]},'password':{'type':Sequelize[_0xa299('0x1')]},'clientId':{'type':Sequelize[_0xa299('0x1')]},'clientSecret':{'type':Sequelize[_0xa299('0x1')]},'securityToken':{'type':Sequelize[_0xa299('0x1')]},'serverUrl':{'type':Sequelize[_0xa299('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa299('0x2')](_0xa299('0x3'),_0xa299('0x4')),'defaultValue':_0xa299('0x3')}};
\ No newline at end of file
+var _0x6343=['STRING','ENUM','newTab','integrationTab'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6343,0x168));var _0x3634=function(_0x1f5de6,_0x11a325){_0x1f5de6=_0x1f5de6-0x0;var _0x3592da=_0x6343[_0x1f5de6];return _0x3592da;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3634('0x0')]},'description':{'type':Sequelize[_0x3634('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x3634('0x0')]},'clientSecret':{'type':Sequelize[_0x3634('0x0')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3634('0x1')]('integrationTab',_0x3634('0x2')),'defaultValue':_0x3634('0x3')}};
\ No newline at end of file
index db6d48b..165cb09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6434=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','filter','includeAll','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','options','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','Task','remoteUri','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientId','concat','isNil','ticketType','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','textarea','phone','remove','label','custom','picklistValues','value','true','False','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','type','model','query','keys'];(function(_0x5efaca,_0x39d68a){var _0x4ccdeb=function(_0x15f3ba){while(--_0x15f3ba){_0x5efaca['push'](_0x5efaca['shift']());}};_0x4ccdeb(++_0x39d68a);}(_0x6434,0x139));var _0x4643=function(_0x2fd6a4,_0x32d3e5){_0x2fd6a4=_0x2fd6a4-0x0;var _0x5282a4=_0x6434[_0x2fd6a4];return _0x5282a4;};'use strict';var emlformat=require(_0x4643('0x0'));var rimraf=require(_0x4643('0x1'));var zipdir=require(_0x4643('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4643('0x3'));var moment=require('moment');var BPromise=require(_0x4643('0x4'));var Mustache=require(_0x4643('0x5'));var util=require(_0x4643('0x6'));var path=require(_0x4643('0x7'));var sox=require(_0x4643('0x8'));var csv=require(_0x4643('0x9'));var ejs=require(_0x4643('0xa'));var fs=require('fs');var fs_extra=require(_0x4643('0xb'));var _=require(_0x4643('0xc'));var squel=require(_0x4643('0xd'));var crypto=require('crypto');var jsforce=require(_0x4643('0xe'));var deskjs=require(_0x4643('0xf'));var toCsv=require(_0x4643('0x9'));var querystring=require('querystring');var Papa=require(_0x4643('0x10'));var Redis=require(_0x4643('0x11'));var authService=require(_0x4643('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4643('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4643('0x14'))(_0x4643('0x15'));var utils=require(_0x4643('0x16'));var config=require(_0x4643('0x17'));var licenseUtil=require(_0x4643('0x18'));var db=require(_0x4643('0x19'))['db'];var integrations=require(_0x4643('0x1a'));function respondWithStatusCode(_0x6500c5,_0x589bb1){_0x589bb1=_0x589bb1||0xcc;return function(_0x3add2a){if(_0x3add2a){return _0x6500c5[_0x4643('0x1b')](_0x589bb1);}return _0x6500c5['status'](_0x589bb1)[_0x4643('0x1c')]();};}function respondWithResult(_0x4a4715,_0xc20564){_0xc20564=_0xc20564||0xc8;return function(_0x1168b0){if(_0x1168b0){return _0x4a4715[_0x4643('0x1d')](_0xc20564)[_0x4643('0x1e')](_0x1168b0);}};}function respondWithFilteredResult(_0x9d8212,_0x21e763){return function(_0x45ee60){if(_0x45ee60){var _0x2d4d17=typeof _0x21e763['offset']===_0x4643('0x1f')&&typeof _0x21e763[_0x4643('0x20')]===_0x4643('0x1f');var _0x577869=_0x45ee60[_0x4643('0x21')];var _0x34c672=_0x2d4d17?0x0:_0x21e763['offset'];var _0x5df860=_0x2d4d17?_0x45ee60[_0x4643('0x21')]:_0x21e763[_0x4643('0x22')]+_0x21e763[_0x4643('0x20')];var _0x5e3113;if(_0x5df860>=_0x577869){_0x5df860=_0x577869;_0x5e3113=0xc8;}else{_0x5e3113=0xce;}_0x9d8212[_0x4643('0x1d')](_0x5e3113);return _0x9d8212[_0x4643('0x23')](_0x4643('0x24'),_0x34c672+'-'+_0x5df860+'/'+_0x577869)[_0x4643('0x1e')](_0x45ee60);}return null;};}function patchUpdates(_0x247e55){return function(_0x4c8a78){try{jsonpatch['apply'](_0x4c8a78,_0x247e55,!![]);}catch(_0x273a7e){return BPromise[_0x4643('0x25')](_0x273a7e);}return _0x4c8a78[_0x4643('0x26')]();};}function saveUpdates(_0xc91049,_0x5a9eeb){return function(_0x13ddc5){if(_0x13ddc5){return _0x13ddc5[_0x4643('0x27')](_0xc91049)[_0x4643('0x28')](function(_0xf756df){return _0xf756df;});}return null;};}function removeEntity(_0x24fb65,_0x49440a){return function(_0x5348ca){if(_0x5348ca){return _0x5348ca[_0x4643('0x29')]()[_0x4643('0x28')](function(){_0x24fb65[_0x4643('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b5202,_0x2a539f){return function(_0x33bf00){if(!_0x33bf00){_0x1b5202[_0x4643('0x1b')](0x194);}return _0x33bf00;};}function handleError(_0x52a748,_0x298d1d){_0x298d1d=_0x298d1d||0x1f4;return function(_0x2e8c1f){logger['error'](_0x2e8c1f[_0x4643('0x2a')]);if(_0x2e8c1f[_0x4643('0x2b')]){delete _0x2e8c1f[_0x4643('0x2b')];}_0x52a748[_0x4643('0x1d')](_0x298d1d)[_0x4643('0x2c')](_0x2e8c1f);};}exports[_0x4643('0x2d')]=function(_0x2a5822,_0x44216e){var _0x10e9f6={},_0x4249ae={},_0x39012d={'count':0x0,'rows':[]};var _0x4442d9=_[_0x4643('0x2e')](db[_0x4643('0x2f')][_0x4643('0x30')],function(_0x4ea842){return{'name':_0x4ea842['fieldName'],'type':_0x4ea842[_0x4643('0x31')]['key']};});_0x4249ae[_0x4643('0x32')]=_[_0x4643('0x2e')](_0x4442d9,'name');_0x4249ae[_0x4643('0x33')]=_[_0x4643('0x34')](_0x2a5822[_0x4643('0x33')]);_0x4249ae['filters']=_['intersection'](_0x4249ae[_0x4643('0x32')],_0x4249ae['query']);_0x10e9f6[_0x4643('0x35')]=_[_0x4643('0x36')](_0x4249ae['model'],qs[_0x4643('0x37')](_0x2a5822['query'][_0x4643('0x37')]));_0x10e9f6[_0x4643('0x35')]=_0x10e9f6['attributes']['length']?_0x10e9f6[_0x4643('0x35')]:_0x4249ae[_0x4643('0x32')];if(!_0x2a5822[_0x4643('0x33')][_0x4643('0x38')](_0x4643('0x39'))){_0x10e9f6[_0x4643('0x20')]=qs['limit'](_0x2a5822[_0x4643('0x33')][_0x4643('0x20')]);_0x10e9f6[_0x4643('0x22')]=qs[_0x4643('0x22')](_0x2a5822[_0x4643('0x33')][_0x4643('0x22')]);}_0x10e9f6[_0x4643('0x3a')]=qs['sort'](_0x2a5822['query'][_0x4643('0x3b')]);_0x10e9f6['where']=qs[_0x4643('0x3c')](_[_0x4643('0x3d')](_0x2a5822[_0x4643('0x33')],_0x4249ae[_0x4643('0x3c')]),_0x4442d9);if(_0x2a5822[_0x4643('0x33')]['filter']){_0x10e9f6[_0x4643('0x3e')]=_[_0x4643('0x3f')](_0x10e9f6[_0x4643('0x3e')],{'$or':_['map'](_0x4442d9,function(_0x3636b8){if(_0x3636b8['type']!=='VIRTUAL'){var _0x466cdb={};_0x466cdb[_0x3636b8['name']]={'$like':'%'+_0x2a5822[_0x4643('0x33')][_0x4643('0x40')]+'%'};return _0x466cdb;}})});}_0x10e9f6=_[_0x4643('0x3f')]({},_0x10e9f6,_0x2a5822['options']);var _0x250d02={'where':_0x10e9f6[_0x4643('0x3e')]};return db[_0x4643('0x2f')][_0x4643('0x21')](_0x250d02)[_0x4643('0x28')](function(_0x5a0376){_0x39012d[_0x4643('0x21')]=_0x5a0376;if(_0x2a5822[_0x4643('0x33')][_0x4643('0x41')]){_0x10e9f6['include']=[{'all':!![]}];}return db[_0x4643('0x2f')][_0x4643('0x42')](_0x10e9f6);})[_0x4643('0x28')](function(_0x511323){_0x39012d[_0x4643('0x43')]=_0x511323;return _0x39012d;})['then'](respondWithFilteredResult(_0x44216e,_0x10e9f6))[_0x4643('0x44')](handleError(_0x44216e,null));};exports[_0x4643('0x45')]=function(_0x257cfb,_0x46400f){var _0x3259f1={'raw':![],'where':{'id':_0x257cfb[_0x4643('0x46')]['id']}},_0x1aa832={};_0x1aa832[_0x4643('0x32')]=_[_0x4643('0x34')](db[_0x4643('0x2f')][_0x4643('0x30')]);_0x1aa832['query']=_[_0x4643('0x34')](_0x257cfb[_0x4643('0x33')]);_0x1aa832['filters']=_[_0x4643('0x36')](_0x1aa832[_0x4643('0x32')],_0x1aa832[_0x4643('0x33')]);_0x3259f1['attributes']=_[_0x4643('0x36')](_0x1aa832[_0x4643('0x32')],qs[_0x4643('0x37')](_0x257cfb[_0x4643('0x33')]['fields']));_0x3259f1[_0x4643('0x35')]=_0x3259f1[_0x4643('0x35')][_0x4643('0x47')]?_0x3259f1[_0x4643('0x35')]:_0x1aa832[_0x4643('0x32')];if(_0x257cfb[_0x4643('0x33')][_0x4643('0x41')]){_0x3259f1['include']=[{'all':!![]}];}_0x3259f1=_['merge']({},_0x3259f1,_0x257cfb['options']);return db[_0x4643('0x2f')][_0x4643('0x48')](_0x3259f1)['then'](handleEntityNotFound(_0x46400f,null))[_0x4643('0x28')](respondWithResult(_0x46400f,null))[_0x4643('0x44')](handleError(_0x46400f,null));};exports[_0x4643('0x49')]=function(_0xd7b831,_0x589f4b){return db[_0x4643('0x2f')][_0x4643('0x49')](_0xd7b831[_0x4643('0x4a')],{})[_0x4643('0x28')](respondWithResult(_0x589f4b,0xc9))[_0x4643('0x44')](handleError(_0x589f4b,null));};exports[_0x4643('0x27')]=function(_0x257e95,_0x32ac95){if(_0x257e95[_0x4643('0x4a')]['id']){delete _0x257e95[_0x4643('0x4a')]['id'];}return db['SalesforceAccount'][_0x4643('0x48')]({'where':{'id':_0x257e95[_0x4643('0x46')]['id']}})['then'](handleEntityNotFound(_0x32ac95,null))['then'](saveUpdates(_0x257e95[_0x4643('0x4a')],null))[_0x4643('0x28')](respondWithResult(_0x32ac95,null))[_0x4643('0x44')](handleError(_0x32ac95,null));};exports[_0x4643('0x29')]=function(_0x32ce2d,_0x2f9138){return db['SalesforceAccount']['find']({'where':{'id':_0x32ce2d[_0x4643('0x46')]['id']}})[_0x4643('0x28')](handleEntityNotFound(_0x2f9138,null))[_0x4643('0x28')](removeEntity(_0x2f9138,null))[_0x4643('0x44')](handleError(_0x2f9138,null));};exports[_0x4643('0x4b')]=function(_0x3a07a8,_0x1ecd48,_0x531916){var _0x276654={};var _0x541a7d={};var _0x1b9df2;var _0x3f24ed;return db['SalesforceAccount'][_0x4643('0x4c')]({'where':{'id':_0x3a07a8[_0x4643('0x46')]['id']}})[_0x4643('0x28')](handleEntityNotFound(_0x1ecd48,null))[_0x4643('0x28')](function(_0x45912b){if(_0x45912b){_0x1b9df2=_0x45912b;_0x541a7d[_0x4643('0x32')]=_[_0x4643('0x34')](db['SalesforceConfiguration'][_0x4643('0x30')]);_0x541a7d[_0x4643('0x33')]=_[_0x4643('0x34')](_0x3a07a8['query']);_0x541a7d[_0x4643('0x3c')]=_[_0x4643('0x36')](_0x541a7d[_0x4643('0x32')],_0x541a7d['query']);_0x276654['attributes']=_['intersection'](_0x541a7d['model'],qs[_0x4643('0x37')](_0x3a07a8[_0x4643('0x33')][_0x4643('0x37')]));_0x276654[_0x4643('0x35')]=_0x276654[_0x4643('0x35')][_0x4643('0x47')]?_0x276654['attributes']:_0x541a7d[_0x4643('0x32')];_0x276654[_0x4643('0x3a')]=qs[_0x4643('0x3b')](_0x3a07a8[_0x4643('0x33')][_0x4643('0x3b')]);_0x276654[_0x4643('0x3e')]=qs[_0x4643('0x3c')](_['pick'](_0x3a07a8[_0x4643('0x33')],_0x541a7d['filters']));if(_0x3a07a8[_0x4643('0x33')]['filter']){_0x276654[_0x4643('0x3e')]=_[_0x4643('0x3f')](_0x276654[_0x4643('0x3e')],{'$or':_[_0x4643('0x2e')](_0x276654['attributes'],function(_0x30212d){var _0x19b056={};_0x19b056[_0x30212d]={'$like':'%'+_0x3a07a8['query'][_0x4643('0x40')]+'%'};return _0x19b056;})});}_0x276654=_[_0x4643('0x3f')]({},_0x276654,_0x3a07a8[_0x4643('0x4d')]);return _0x1b9df2[_0x4643('0x4b')](_0x276654);}})[_0x4643('0x28')](function(_0x15301f){if(_0x15301f){_0x3f24ed=_0x15301f['length'];if(!_0x3a07a8['query'][_0x4643('0x38')]('nolimit')){_0x276654[_0x4643('0x20')]=qs['limit'](_0x3a07a8[_0x4643('0x33')][_0x4643('0x20')]);_0x276654[_0x4643('0x22')]=qs[_0x4643('0x22')](_0x3a07a8[_0x4643('0x33')][_0x4643('0x22')]);}return _0x1b9df2['getConfigurations'](_0x276654);}})[_0x4643('0x28')](function(_0x17458e){if(_0x17458e){return _0x17458e?{'count':_0x3f24ed,'rows':_0x17458e}:null;}})[_0x4643('0x28')](respondWithResult(_0x1ecd48,null))['catch'](handleError(_0x1ecd48,null));};exports['addConfiguration']=function(_0x5e2737,_0x201bbc,_0x473652){if(_0x5e2737[_0x4643('0x4a')]['id']){delete _0x5e2737[_0x4643('0x4a')]['id'];}return db[_0x4643('0x2f')][_0x4643('0x4c')]({'where':{'id':_0x5e2737['params']['id']}})[_0x4643('0x28')](handleEntityNotFound(_0x201bbc,null))[_0x4643('0x28')](function(_0xb93020){if(_0xb93020){_0x5e2737[_0x4643('0x4a')]['AccountId']=_0xb93020['id'];_0x5e2737[_0x4643('0x4a')][_0x4643('0x4e')]=integrations[_0x4643('0x4f')](_0x5e2737['body'][_0x4643('0x50')],_0x5e2737[_0x4643('0x4a')][_0x4643('0x31')]);_0x5e2737[_0x4643('0x4a')]['Descriptions']=integrations[_0x4643('0x51')](_0x5e2737['body']['channel'],_0x5e2737[_0x4643('0x4a')][_0x4643('0x31')]);return db['SalesforceConfiguration']['create'](_0x5e2737[_0x4643('0x4a')],{'include':[{'model':db[_0x4643('0x52')],'as':'Subjects'},{'model':db[_0x4643('0x52')],'as':_0x4643('0x53')}]});}return null;})['then'](respondWithResult(_0x201bbc,null))[_0x4643('0x44')](handleError(_0x201bbc,null));};exports['getFields']=function(_0x595199,_0x3c71c4,_0x44847a){var _0x62a792;var _0x52a184='';var _0x5e4c92=_0x4643('0x54');return db[_0x4643('0x2f')]['findOne']({'where':{'id':_0x595199['params']['id']},'attributes':['id',_0x4643('0x55'),'clientId','clientSecret',_0x4643('0x56'),_0x4643('0x57'),_0x4643('0x58')]})[_0x4643('0x28')](handleEntityNotFound(_0x3c71c4,null))[_0x4643('0x28')](function(_0x3d658d){if(_0x3d658d){_0x52a184=_0x3d658d[_0x4643('0x55')];var _0x333318=_0x52a184[_0x4643('0x59')](-0x1);if(_0x333318==='/'){_0x52a184=_0x52a184[_0x4643('0x5a')](0x0,_0x52a184[_0x4643('0x5b')](_0x333318));}_0x62a792=new jsforce[(_0x4643('0x5c'))]({'oauth2':{'loginUrl':_0x52a184,'clientId':_0x3d658d[_0x4643('0x5d')],'clientSecret':_0x3d658d['clientSecret']}});return _0x62a792['login'](_0x3d658d['username'],_0x3d658d['password'][_0x4643('0x5e')](_0x3d658d[_0x4643('0x58')]));}})['then'](function(_0x3d5b02){if(_0x3d5b02){if(!_[_0x4643('0x5f')](_0x595199[_0x4643('0x33')][_0x4643('0x60')])){_0x5e4c92=_0x595199[_0x4643('0x33')][_0x4643('0x60')];}return _0x62a792['sobject'](_0x5e4c92)['describe']();}})[_0x4643('0x28')](function(_0x1d52bb){var _0x110f0c=[_0x4643('0x61'),_0x4643('0x62'),_0x4643('0x63'),_0x4643('0x64'),_0x4643('0x65'),_0x4643('0x66')];var _0x63fff=[_0x4643('0x67'),_0x4643('0x68'),_0x4643('0x69'),_0x4643('0x6a'),'email',_0x4643('0x6b'),_0x4643('0x6c')];if(_0x1d52bb){_[_0x4643('0x6d')](_0x1d52bb[_0x4643('0x37')],function(_0x42f37f){return _0x110f0c['includes'](_0x42f37f[_0x4643('0x2b')])||!_0x63fff['includes'](_0x42f37f[_0x4643('0x31')]);});return{'count':_0x1d52bb[_0x4643('0x37')][_0x4643('0x47')],'rows':_[_0x4643('0x2e')](_0x1d52bb['fields'],function(_0x5c1b23){return{'id':_0x5c1b23[_0x4643('0x2b')],'name':_0x5c1b23[_0x4643('0x6e')],'custom':_0x5c1b23[_0x4643('0x6f')],'options':_0x5c1b23[_0x4643('0x70')][_0x4643('0x47')]>0x0?_['map'](_0x5c1b23['picklistValues'],function(_0x28ea26){return{'name':_0x28ea26[_0x4643('0x6e')],'value':_0x28ea26[_0x4643('0x71')]};}):_0x5c1b23['type']==_0x4643('0x6a')?[{'name':'True','value':_0x4643('0x72')},{'name':_0x4643('0x73'),'value':'false'}]:[]};})};}})[_0x4643('0x28')](respondWithResult(_0x3c71c4,null))[_0x4643('0x44')](function(_0x5cfedb){var _0x3bd0f9=_0x595199[_0x4643('0x33')][_0x4643('0x74')]?0x1f4:_0x5cfedb['statusCode']||0x1f4;logger[_0x4643('0x75')](_0x4643('0x76'),_0x4643('0x77'),_0x3bd0f9,JSON['stringify'](_0x5cfedb));delete _0x5cfedb[_0x4643('0x2b')];if(_0x3bd0f9===0x191){_0x3bd0f9=0x190;}_0x3c71c4[_0x4643('0x1d')](_0x3bd0f9)[_0x4643('0x2c')](_0x595199[_0x4643('0x33')][_0x4643('0x74')]?{'message':_0x4643('0x78'),'statusCode':_0x5cfedb[_0x4643('0x79')]}:_0x5cfedb);});};
\ No newline at end of file
+var _0x9f7d=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','SalesforceAccount','includeAll','include','rows','catch','params','options','create','body','find','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','getSubjects','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientSecret','username','password','securityToken','slice','substring','Connection','clientId','login','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','Subject','Description','int','picklist','email','textarea','phone','remove','includes','custom','picklistValues','label','value','boolean','true','false','test','statusCode','stringify','send','Wrong\x20credentials','eml-format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9f7d,0x1d7));var _0xd9f7=function(_0x168e27,_0x59d509){_0x168e27=_0x168e27-0x0;var _0x6fb48=_0x9f7d[_0x168e27];return _0x6fb48;};'use strict';var emlformat=require(_0xd9f7('0x0'));var rimraf=require(_0xd9f7('0x1'));var zipdir=require(_0xd9f7('0x2'));var jsonpatch=require(_0xd9f7('0x3'));var rp=require('request-promise');var moment=require(_0xd9f7('0x4'));var BPromise=require(_0xd9f7('0x5'));var Mustache=require(_0xd9f7('0x6'));var util=require(_0xd9f7('0x7'));var path=require(_0xd9f7('0x8'));var sox=require('sox');var csv=require(_0xd9f7('0x9'));var ejs=require(_0xd9f7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd9f7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd9f7('0xc'));var toCsv=require(_0xd9f7('0x9'));var querystring=require('querystring');var Papa=require(_0xd9f7('0xd'));var Redis=require(_0xd9f7('0xe'));var authService=require(_0xd9f7('0xf'));var qs=require(_0xd9f7('0x10'));var as=require(_0xd9f7('0x11'));var hardwareService=require(_0xd9f7('0x12'));var logger=require('../../config/logger')(_0xd9f7('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd9f7('0x14'));var db=require(_0xd9f7('0x15'))['db'];var integrations=require(_0xd9f7('0x16'));function respondWithStatusCode(_0x4dd979,_0x8120e4){_0x8120e4=_0x8120e4||0xcc;return function(_0x1eda81){if(_0x1eda81){return _0x4dd979[_0xd9f7('0x17')](_0x8120e4);}return _0x4dd979[_0xd9f7('0x18')](_0x8120e4)[_0xd9f7('0x19')]();};}function respondWithResult(_0x42a94d,_0x396eeb){_0x396eeb=_0x396eeb||0xc8;return function(_0x190e20){if(_0x190e20){return _0x42a94d[_0xd9f7('0x18')](_0x396eeb)[_0xd9f7('0x1a')](_0x190e20);}};}function respondWithFilteredResult(_0x5d2567,_0x1a5a1a){return function(_0x2a59ed){if(_0x2a59ed){var _0x113616=typeof _0x1a5a1a[_0xd9f7('0x1b')]===_0xd9f7('0x1c')&&typeof _0x1a5a1a[_0xd9f7('0x1d')]===_0xd9f7('0x1c');var _0x1dc785=_0x2a59ed[_0xd9f7('0x1e')];var _0x42c62b=_0x113616?0x0:_0x1a5a1a[_0xd9f7('0x1b')];var _0xa45304=_0x113616?_0x2a59ed[_0xd9f7('0x1e')]:_0x1a5a1a[_0xd9f7('0x1b')]+_0x1a5a1a['limit'];var _0x154b2d;if(_0xa45304>=_0x1dc785){_0xa45304=_0x1dc785;_0x154b2d=0xc8;}else{_0x154b2d=0xce;}_0x5d2567['status'](_0x154b2d);return _0x5d2567['set'](_0xd9f7('0x1f'),_0x42c62b+'-'+_0xa45304+'/'+_0x1dc785)[_0xd9f7('0x1a')](_0x2a59ed);}return null;};}function patchUpdates(_0x423ec7){return function(_0x1965db){try{jsonpatch[_0xd9f7('0x20')](_0x1965db,_0x423ec7,!![]);}catch(_0x281367){return BPromise['reject'](_0x281367);}return _0x1965db[_0xd9f7('0x21')]();};}function saveUpdates(_0x185f3b,_0xff5471){return function(_0x4f072b){if(_0x4f072b){return _0x4f072b[_0xd9f7('0x22')](_0x185f3b)[_0xd9f7('0x23')](function(_0x486ef1){return _0x486ef1;});}return null;};}function removeEntity(_0x5c8007,_0xcc5b73){return function(_0x239394){if(_0x239394){return _0x239394[_0xd9f7('0x24')]()[_0xd9f7('0x23')](function(){_0x5c8007[_0xd9f7('0x18')](0xcc)[_0xd9f7('0x19')]();});}};}function handleEntityNotFound(_0x44b05e,_0x3bd8aa){return function(_0x3052d8){if(!_0x3052d8){_0x44b05e[_0xd9f7('0x17')](0x194);}return _0x3052d8;};}function handleError(_0x1141c0,_0x56c1b1){_0x56c1b1=_0x56c1b1||0x1f4;return function(_0x3bede3){logger[_0xd9f7('0x25')](_0x3bede3[_0xd9f7('0x26')]);if(_0x3bede3[_0xd9f7('0x27')]){delete _0x3bede3[_0xd9f7('0x27')];}_0x1141c0['status'](_0x56c1b1)['send'](_0x3bede3);};}exports[_0xd9f7('0x28')]=function(_0x5ba8d6,_0x48d3da){var _0x2eff49={},_0x152126={},_0x571ff9={'count':0x0,'rows':[]};var _0x461768=_[_0xd9f7('0x29')](db['SalesforceAccount'][_0xd9f7('0x2a')],function(_0x374699){return{'name':_0x374699[_0xd9f7('0x2b')],'type':_0x374699[_0xd9f7('0x2c')][_0xd9f7('0x2d')]};});_0x152126['model']=_[_0xd9f7('0x29')](_0x461768,_0xd9f7('0x27'));_0x152126[_0xd9f7('0x2e')]=_[_0xd9f7('0x2f')](_0x5ba8d6['query']);_0x152126[_0xd9f7('0x30')]=_[_0xd9f7('0x31')](_0x152126[_0xd9f7('0x32')],_0x152126[_0xd9f7('0x2e')]);_0x2eff49[_0xd9f7('0x33')]=_[_0xd9f7('0x31')](_0x152126[_0xd9f7('0x32')],qs[_0xd9f7('0x34')](_0x5ba8d6['query'][_0xd9f7('0x34')]));_0x2eff49['attributes']=_0x2eff49['attributes'][_0xd9f7('0x35')]?_0x2eff49['attributes']:_0x152126[_0xd9f7('0x32')];if(!_0x5ba8d6[_0xd9f7('0x2e')]['hasOwnProperty']('nolimit')){_0x2eff49[_0xd9f7('0x1d')]=qs[_0xd9f7('0x1d')](_0x5ba8d6['query'][_0xd9f7('0x1d')]);_0x2eff49[_0xd9f7('0x1b')]=qs['offset'](_0x5ba8d6[_0xd9f7('0x2e')][_0xd9f7('0x1b')]);}_0x2eff49[_0xd9f7('0x36')]=qs['sort'](_0x5ba8d6[_0xd9f7('0x2e')][_0xd9f7('0x37')]);_0x2eff49[_0xd9f7('0x38')]=qs[_0xd9f7('0x30')](_[_0xd9f7('0x39')](_0x5ba8d6[_0xd9f7('0x2e')],_0x152126[_0xd9f7('0x30')]),_0x461768);if(_0x5ba8d6[_0xd9f7('0x2e')][_0xd9f7('0x3a')]){_0x2eff49[_0xd9f7('0x38')]=_[_0xd9f7('0x3b')](_0x2eff49[_0xd9f7('0x38')],{'$or':_[_0xd9f7('0x29')](_0x461768,function(_0x306b95){if(_0x306b95[_0xd9f7('0x2c')]!==_0xd9f7('0x3c')){var _0xcd6671={};_0xcd6671[_0x306b95['name']]={'$like':'%'+_0x5ba8d6[_0xd9f7('0x2e')][_0xd9f7('0x3a')]+'%'};return _0xcd6671;}})});}_0x2eff49=_[_0xd9f7('0x3b')]({},_0x2eff49,_0x5ba8d6['options']);var _0x4e88ba={'where':_0x2eff49['where']};return db[_0xd9f7('0x3d')]['count'](_0x4e88ba)[_0xd9f7('0x23')](function(_0x14caf2){_0x571ff9[_0xd9f7('0x1e')]=_0x14caf2;if(_0x5ba8d6[_0xd9f7('0x2e')][_0xd9f7('0x3e')]){_0x2eff49[_0xd9f7('0x3f')]=[{'all':!![]}];}return db[_0xd9f7('0x3d')]['findAll'](_0x2eff49);})['then'](function(_0x50eeeb){_0x571ff9[_0xd9f7('0x40')]=_0x50eeeb;return _0x571ff9;})[_0xd9f7('0x23')](respondWithFilteredResult(_0x48d3da,_0x2eff49))[_0xd9f7('0x41')](handleError(_0x48d3da,null));};exports['show']=function(_0x39f4b,_0x1456eb){var _0x490614={'raw':![],'where':{'id':_0x39f4b[_0xd9f7('0x42')]['id']}},_0x4ed0b0={};_0x4ed0b0[_0xd9f7('0x32')]=_[_0xd9f7('0x2f')](db[_0xd9f7('0x3d')][_0xd9f7('0x2a')]);_0x4ed0b0[_0xd9f7('0x2e')]=_[_0xd9f7('0x2f')](_0x39f4b['query']);_0x4ed0b0['filters']=_[_0xd9f7('0x31')](_0x4ed0b0[_0xd9f7('0x32')],_0x4ed0b0[_0xd9f7('0x2e')]);_0x490614[_0xd9f7('0x33')]=_[_0xd9f7('0x31')](_0x4ed0b0['model'],qs['fields'](_0x39f4b[_0xd9f7('0x2e')][_0xd9f7('0x34')]));_0x490614[_0xd9f7('0x33')]=_0x490614[_0xd9f7('0x33')]['length']?_0x490614['attributes']:_0x4ed0b0['model'];if(_0x39f4b[_0xd9f7('0x2e')][_0xd9f7('0x3e')]){_0x490614['include']=[{'all':!![]}];}_0x490614=_[_0xd9f7('0x3b')]({},_0x490614,_0x39f4b[_0xd9f7('0x43')]);return db[_0xd9f7('0x3d')]['find'](_0x490614)[_0xd9f7('0x23')](handleEntityNotFound(_0x1456eb,null))[_0xd9f7('0x23')](respondWithResult(_0x1456eb,null))[_0xd9f7('0x41')](handleError(_0x1456eb,null));};exports[_0xd9f7('0x44')]=function(_0x2e1c8a,_0xae999f){return db[_0xd9f7('0x3d')]['create'](_0x2e1c8a[_0xd9f7('0x45')],{})[_0xd9f7('0x23')](respondWithResult(_0xae999f,0xc9))[_0xd9f7('0x41')](handleError(_0xae999f,null));};exports[_0xd9f7('0x22')]=function(_0x5d9ae8,_0x3bad46){if(_0x5d9ae8[_0xd9f7('0x45')]['id']){delete _0x5d9ae8[_0xd9f7('0x45')]['id'];}return db[_0xd9f7('0x3d')][_0xd9f7('0x46')]({'where':{'id':_0x5d9ae8[_0xd9f7('0x42')]['id']}})['then'](handleEntityNotFound(_0x3bad46,null))[_0xd9f7('0x23')](saveUpdates(_0x5d9ae8[_0xd9f7('0x45')],null))[_0xd9f7('0x23')](respondWithResult(_0x3bad46,null))['catch'](handleError(_0x3bad46,null));};exports['destroy']=function(_0x1c1339,_0x2cfb63){return db[_0xd9f7('0x3d')][_0xd9f7('0x46')]({'where':{'id':_0x1c1339[_0xd9f7('0x42')]['id']}})[_0xd9f7('0x23')](handleEntityNotFound(_0x2cfb63,null))[_0xd9f7('0x23')](removeEntity(_0x2cfb63,null))[_0xd9f7('0x41')](handleError(_0x2cfb63,null));};exports[_0xd9f7('0x47')]=function(_0x45b893,_0x11197d,_0x584bb5){var _0x5f5a98={};var _0x4bff7e={};var _0xaefdf1;var _0x23ab3b;return db[_0xd9f7('0x3d')][_0xd9f7('0x48')]({'where':{'id':_0x45b893[_0xd9f7('0x42')]['id']}})[_0xd9f7('0x23')](handleEntityNotFound(_0x11197d,null))[_0xd9f7('0x23')](function(_0xd4c735){if(_0xd4c735){_0xaefdf1=_0xd4c735;_0x4bff7e[_0xd9f7('0x32')]=_['keys'](db[_0xd9f7('0x49')]['rawAttributes']);_0x4bff7e[_0xd9f7('0x2e')]=_[_0xd9f7('0x2f')](_0x45b893['query']);_0x4bff7e[_0xd9f7('0x30')]=_[_0xd9f7('0x31')](_0x4bff7e[_0xd9f7('0x32')],_0x4bff7e[_0xd9f7('0x2e')]);_0x5f5a98['attributes']=_[_0xd9f7('0x31')](_0x4bff7e[_0xd9f7('0x32')],qs['fields'](_0x45b893[_0xd9f7('0x2e')][_0xd9f7('0x34')]));_0x5f5a98[_0xd9f7('0x33')]=_0x5f5a98['attributes'][_0xd9f7('0x35')]?_0x5f5a98[_0xd9f7('0x33')]:_0x4bff7e[_0xd9f7('0x32')];_0x5f5a98[_0xd9f7('0x36')]=qs['sort'](_0x45b893[_0xd9f7('0x2e')][_0xd9f7('0x37')]);_0x5f5a98[_0xd9f7('0x38')]=qs[_0xd9f7('0x30')](_['pick'](_0x45b893[_0xd9f7('0x2e')],_0x4bff7e['filters']));if(_0x45b893[_0xd9f7('0x2e')]['filter']){_0x5f5a98[_0xd9f7('0x38')]=_['merge'](_0x5f5a98['where'],{'$or':_[_0xd9f7('0x29')](_0x5f5a98[_0xd9f7('0x33')],function(_0x3fae51){var _0x31587f={};_0x31587f[_0x3fae51]={'$like':'%'+_0x45b893[_0xd9f7('0x2e')][_0xd9f7('0x3a')]+'%'};return _0x31587f;})});}_0x5f5a98=_[_0xd9f7('0x3b')]({},_0x5f5a98,_0x45b893['options']);return _0xaefdf1[_0xd9f7('0x47')](_0x5f5a98);}})[_0xd9f7('0x23')](function(_0x420e54){if(_0x420e54){_0x23ab3b=_0x420e54[_0xd9f7('0x35')];if(!_0x45b893[_0xd9f7('0x2e')][_0xd9f7('0x4a')]('nolimit')){_0x5f5a98['limit']=qs[_0xd9f7('0x1d')](_0x45b893[_0xd9f7('0x2e')][_0xd9f7('0x1d')]);_0x5f5a98[_0xd9f7('0x1b')]=qs[_0xd9f7('0x1b')](_0x45b893[_0xd9f7('0x2e')][_0xd9f7('0x1b')]);}return _0xaefdf1[_0xd9f7('0x47')](_0x5f5a98);}})['then'](function(_0x1f53fc){if(_0x1f53fc){return _0x1f53fc?{'count':_0x23ab3b,'rows':_0x1f53fc}:null;}})[_0xd9f7('0x23')](respondWithResult(_0x11197d,null))['catch'](handleError(_0x11197d,null));};exports['addConfiguration']=function(_0x52bc3d,_0x33c534,_0x329b35){if(_0x52bc3d['body']['id']){delete _0x52bc3d[_0xd9f7('0x45')]['id'];}return db[_0xd9f7('0x3d')]['findOne']({'where':{'id':_0x52bc3d[_0xd9f7('0x42')]['id']}})[_0xd9f7('0x23')](handleEntityNotFound(_0x33c534,null))['then'](function(_0x511ce8){if(_0x511ce8){_0x52bc3d['body']['AccountId']=_0x511ce8['id'];_0x52bc3d['body']['Subjects']=integrations[_0xd9f7('0x4b')](_0x52bc3d[_0xd9f7('0x45')]['channel'],_0x52bc3d[_0xd9f7('0x45')][_0xd9f7('0x2c')]);_0x52bc3d[_0xd9f7('0x45')][_0xd9f7('0x4c')]=integrations[_0xd9f7('0x4d')](_0x52bc3d[_0xd9f7('0x45')]['channel'],_0x52bc3d[_0xd9f7('0x45')][_0xd9f7('0x2c')]);return db[_0xd9f7('0x49')][_0xd9f7('0x44')](_0x52bc3d[_0xd9f7('0x45')],{'include':[{'model':db[_0xd9f7('0x4e')],'as':'Subjects'},{'model':db[_0xd9f7('0x4e')],'as':_0xd9f7('0x4c')}]});}return null;})[_0xd9f7('0x23')](respondWithResult(_0x33c534,null))[_0xd9f7('0x41')](handleError(_0x33c534,null));};exports[_0xd9f7('0x4f')]=function(_0x5c54d6,_0x3180bd,_0x50a23a){var _0x117498;var _0x21c133='';var _0x2e3618='Task';return db['SalesforceAccount']['findOne']({'where':{'id':_0x5c54d6['params']['id']},'attributes':['id',_0xd9f7('0x50'),'clientId',_0xd9f7('0x51'),_0xd9f7('0x52'),_0xd9f7('0x53'),_0xd9f7('0x54')]})['then'](handleEntityNotFound(_0x3180bd,null))['then'](function(_0x38db6b){if(_0x38db6b){_0x21c133=_0x38db6b[_0xd9f7('0x50')];var _0x527b61=_0x21c133[_0xd9f7('0x55')](-0x1);if(_0x527b61==='/'){_0x21c133=_0x21c133[_0xd9f7('0x56')](0x0,_0x21c133['lastIndexOf'](_0x527b61));}_0x117498=new jsforce[(_0xd9f7('0x57'))]({'oauth2':{'loginUrl':_0x21c133,'clientId':_0x38db6b[_0xd9f7('0x58')],'clientSecret':_0x38db6b[_0xd9f7('0x51')]}});return _0x117498[_0xd9f7('0x59')](_0x38db6b[_0xd9f7('0x52')],_0x38db6b[_0xd9f7('0x53')][_0xd9f7('0x5a')](_0x38db6b[_0xd9f7('0x54')]));}})['then'](function(_0x377986){if(_0x377986){if(!_[_0xd9f7('0x5b')](_0x5c54d6[_0xd9f7('0x2e')][_0xd9f7('0x5c')])){_0x2e3618=_0x5c54d6[_0xd9f7('0x2e')][_0xd9f7('0x5c')];}return _0x117498[_0xd9f7('0x5d')](_0x2e3618)[_0xd9f7('0x5e')]();}})[_0xd9f7('0x23')](function(_0x346368){var _0x4f76f3=['OwnerId',_0xd9f7('0x5f'),_0xd9f7('0x60'),'IsRecurrence',_0xd9f7('0x61'),_0xd9f7('0x62')];var _0x1dca48=['string',_0xd9f7('0x63'),_0xd9f7('0x64'),'boolean',_0xd9f7('0x65'),_0xd9f7('0x66'),_0xd9f7('0x67')];if(_0x346368){_[_0xd9f7('0x68')](_0x346368[_0xd9f7('0x34')],function(_0x5a2d16){return _0x4f76f3['includes'](_0x5a2d16[_0xd9f7('0x27')])||!_0x1dca48[_0xd9f7('0x69')](_0x5a2d16[_0xd9f7('0x2c')]);});return{'count':_0x346368[_0xd9f7('0x34')][_0xd9f7('0x35')],'rows':_['map'](_0x346368['fields'],function(_0x3d3bbc){return{'id':_0x3d3bbc[_0xd9f7('0x27')],'name':_0x3d3bbc['label'],'custom':_0x3d3bbc[_0xd9f7('0x6a')],'options':_0x3d3bbc['picklistValues'][_0xd9f7('0x35')]>0x0?_[_0xd9f7('0x29')](_0x3d3bbc[_0xd9f7('0x6b')],function(_0x53f110){return{'name':_0x53f110[_0xd9f7('0x6c')],'value':_0x53f110[_0xd9f7('0x6d')]};}):_0x3d3bbc[_0xd9f7('0x2c')]==_0xd9f7('0x6e')?[{'name':'True','value':_0xd9f7('0x6f')},{'name':'False','value':_0xd9f7('0x70')}]:[]};})};}})[_0xd9f7('0x23')](respondWithResult(_0x3180bd,null))['catch'](function(_0x3112e7){var _0x440a5f=_0x5c54d6[_0xd9f7('0x2e')][_0xd9f7('0x71')]?0x1f4:_0x3112e7[_0xd9f7('0x72')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x440a5f,JSON[_0xd9f7('0x73')](_0x3112e7));delete _0x3112e7[_0xd9f7('0x27')];if(_0x440a5f===0x191){_0x440a5f=0x190;}_0x3180bd[_0xd9f7('0x18')](_0x440a5f)[_0xd9f7('0x74')](_0x5c54d6['query'][_0xd9f7('0x71')]?{'message':_0xd9f7('0x75'),'statusCode':_0x3112e7[_0xd9f7('0x72')]}:_0x3112e7);});};
\ No newline at end of file
index e62222c..9d44f2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31ee=['api','moment','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x2ae35f,_0x2a97e4){var _0x35bc60=function(_0x44c9ed){while(--_0x44c9ed){_0x2ae35f['push'](_0x2ae35f['shift']());}};_0x35bc60(++_0x2a97e4);}(_0x31ee,0xf4));var _0xe31e=function(_0x249bb5,_0x25e243){_0x249bb5=_0x249bb5-0x0;var _0x21b641=_0x31ee[_0x249bb5];return _0x21b641;};'use strict';var _=require(_0xe31e('0x0'));var util=require(_0xe31e('0x1'));var logger=require(_0xe31e('0x2'))(_0xe31e('0x3'));var moment=require(_0xe31e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe31e('0x5'));var fs=require('fs');var path=require(_0xe31e('0x6'));var rimraf=require('rimraf');var config=require(_0xe31e('0x7'));var attributes=require(_0xe31e('0x8'));var integrations=require(_0xe31e('0x9'));module[_0xe31e('0xa')]=function(_0x10de21,_0x3ce090){return _0x10de21['define'](_0xe31e('0xb'),attributes,{'tableName':_0xe31e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x087f=['../../components/integrations/configuration','exports','util','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x087f,0x1a6));var _0xf087=function(_0x492a3e,_0xce3386){_0x492a3e=_0x492a3e-0x0;var _0x1cc452=_0x087f[_0x492a3e];return _0x1cc452;};'use strict';var _=require('lodash');var util=require(_0xf087('0x0'));var logger=require('../../config/logger')(_0xf087('0x1'));var moment=require(_0xf087('0x2'));var BPromise=require(_0xf087('0x3'));var rp=require(_0xf087('0x4'));var fs=require('fs');var path=require(_0xf087('0x5'));var rimraf=require(_0xf087('0x6'));var config=require('../../config/environment');var attributes=require(_0xf087('0x7'));var integrations=require(_0xf087('0x8'));module[_0xf087('0x9')]=function(_0xeaa514,_0x1b6b8c){return _0xeaa514['define']('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6754fee..7958261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa24e=['limit','include','map','model','attributes','ShowSalesforceAccount','raw','randomstring','../../mysqldb','../../config/logger','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','where'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xa24e,0x14b));var _0xea24=function(_0x1b6352,_0x44cea4){_0x1b6352=_0x1b6352-0x0;var _0x47c0e7=_0xa24e[_0x1b6352];return _0x47c0e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xea24('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea24('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0xea24('0x2'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xea24('0x3')][_0xea24('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x3b1836,_0x5b137f,_0xdbde70){return new BPromise(function(_0x534e84,_0x5de291){return client['request'](_0x3b1836,_0xdbde70)[_0xea24('0x5')](function(_0x133ee9){logger[_0xea24('0x6')](_0xea24('0x7'),_0x5b137f,'request\x20sent');logger[_0xea24('0x8')](_0xea24('0x9'),_0x5b137f,_0xea24('0xa'),JSON[_0xea24('0xb')](_0x133ee9));if(_0x133ee9[_0xea24('0xc')]){if(_0x133ee9['error']['code']===0x1f4){logger[_0xea24('0xc')](_0xea24('0x7'),_0x5b137f,_0x133ee9[_0xea24('0xc')]['message']);return _0x5de291(_0x133ee9['error'][_0xea24('0xd')]);}logger[_0xea24('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x5b137f,_0x133ee9[_0xea24('0xc')][_0xea24('0xd')]);return _0x534e84(_0x133ee9[_0xea24('0xc')]['message']);}else{logger['info'](_0xea24('0x7'),_0x5b137f,_0xea24('0xa'));_0x534e84(_0x133ee9[_0xea24('0xe')][_0xea24('0xd')]);}})[_0xea24('0xf')](function(_0x1a8ad8){logger['error'](_0xea24('0x7'),_0x5b137f,_0x1a8ad8);_0x5de291(_0x1a8ad8);});});}exports[_0xea24('0x10')]=function(_0x188efe){var _0x5e04c1=this;return new Promise(function(_0x28627f,_0x20315b){return db[_0xea24('0x11')]['findAll']({'raw':_0x188efe['options']?_0x188efe[_0xea24('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x188efe['options']?_0x188efe[_0xea24('0x12')][_0xea24('0x13')]||null:null,'attributes':_0x188efe[_0xea24('0x12')]?_0x188efe[_0xea24('0x12')]['attributes']||null:null,'limit':_0x188efe[_0xea24('0x12')]?_0x188efe['options'][_0xea24('0x14')]||null:null,'include':_0x188efe[_0xea24('0x12')]?_0x188efe[_0xea24('0x12')][_0xea24('0x15')]?_[_0xea24('0x16')](_0x188efe[_0xea24('0x12')][_0xea24('0x15')],function(_0x84b88f){return{'model':db[_0x84b88f[_0xea24('0x17')]],'as':_0x84b88f['as'],'attributes':_0x84b88f[_0xea24('0x18')],'include':_0x84b88f[_0xea24('0x15')]?_[_0xea24('0x16')](_0x84b88f['include'],function(_0x4d3ee1){return{'model':db[_0x4d3ee1[_0xea24('0x17')]],'as':_0x4d3ee1['as'],'attributes':_0x4d3ee1[_0xea24('0x18')],'include':_0x4d3ee1[_0xea24('0x15')]?_[_0xea24('0x16')](_0x4d3ee1[_0xea24('0x15')],function(_0x3fa46e){return{'model':db[_0x3fa46e[_0xea24('0x17')]],'as':_0x3fa46e['as'],'attributes':_0x3fa46e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1add78){logger['info'](_0xea24('0x10'),_0x188efe);logger[_0xea24('0x8')]('GetSalesforceAccount',_0x188efe,JSON[_0xea24('0xb')](_0x1add78));_0x28627f(_0x1add78);})[_0xea24('0xf')](function(_0x21f157){logger['error']('GetSalesforceAccount',_0x21f157[_0xea24('0xd')],_0x188efe);_0x20315b(_0x5e04c1[_0xea24('0xc')](0x1f4,_0x21f157[_0xea24('0xd')]));});});};exports[_0xea24('0x19')]=function(_0x358e01){var _0x326796=this;return new Promise(function(_0xd59613,_0x5ef88a){return db[_0xea24('0x11')]['find']({'raw':_0x358e01[_0xea24('0x12')]?_0x358e01[_0xea24('0x12')][_0xea24('0x1a')]===undefined?!![]:![]:!![],'where':_0x358e01[_0xea24('0x12')]?_0x358e01[_0xea24('0x12')]['where']||null:null,'attributes':_0x358e01[_0xea24('0x12')]?_0x358e01[_0xea24('0x12')]['attributes']||null:null,'include':_0x358e01[_0xea24('0x12')]?_0x358e01['options'][_0xea24('0x15')]?_['map'](_0x358e01[_0xea24('0x12')][_0xea24('0x15')],function(_0x752a17){return{'model':db[_0x752a17['model']],'as':_0x752a17['as'],'attributes':_0x752a17[_0xea24('0x18')],'include':_0x752a17['include']?_[_0xea24('0x16')](_0x752a17[_0xea24('0x15')],function(_0xa5aaab){return{'model':db[_0xa5aaab['model']],'as':_0xa5aaab['as'],'attributes':_0xa5aaab[_0xea24('0x18')],'include':_0xa5aaab['include']?_[_0xea24('0x16')](_0xa5aaab[_0xea24('0x15')],function(_0x61172f){return{'model':db[_0x61172f[_0xea24('0x17')]],'as':_0x61172f['as'],'attributes':_0x61172f[_0xea24('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18a139){logger[_0xea24('0x6')](_0xea24('0x19'),_0x358e01);logger['debug'](_0xea24('0x19'),_0x358e01,JSON[_0xea24('0xb')](_0x18a139));_0xd59613(_0x18a139);})['catch'](function(_0x2f769f){logger['error'](_0xea24('0x19'),_0x2f769f[_0xea24('0xd')],_0x358e01);_0x5ef88a(_0x326796[_0xea24('0xc')](0x1f4,_0x2f769f[_0xea24('0xd')]));});});};
\ No newline at end of file
+var _0x26cb=['where','limit','include','map','model','attributes','SalesforceAccount','ShowSalesforceAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetSalesforceAccount','options'];(function(_0x372047,_0x7f5c2b){var _0x44f282=function(_0x5a3d1c){while(--_0x5a3d1c){_0x372047['push'](_0x372047['shift']());}};_0x44f282(++_0x7f5c2b);}(_0x26cb,0x19b));var _0xb26c=function(_0x5cf320,_0x36e9c9){_0x5cf320=_0x5cf320-0x0;var _0x16ff96=_0x26cb[_0x5cf320];return _0x16ff96;};'use strict';var _=require(_0xb26c('0x0'));var util=require(_0xb26c('0x1'));var moment=require('moment');var BPromise=require(_0xb26c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb26c('0x3'));var db=require(_0xb26c('0x4'))['db'];var utils=require(_0xb26c('0x5'));var logger=require('../../config/logger')(_0xb26c('0x6'));var config=require('../../config/environment');var jayson=require(_0xb26c('0x7'));var client=jayson[_0xb26c('0x8')][_0xb26c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58ed03,_0x10bc9a,_0x58fffd){return new BPromise(function(_0x160d21,_0x5f0264){return client[_0xb26c('0xa')](_0x58ed03,_0x58fffd)[_0xb26c('0xb')](function(_0x48abdd){logger[_0xb26c('0xc')](_0xb26c('0xd'),_0x10bc9a,_0xb26c('0xe'));logger[_0xb26c('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x10bc9a,_0xb26c('0xe'),JSON[_0xb26c('0x10')](_0x48abdd));if(_0x48abdd[_0xb26c('0x11')]){if(_0x48abdd[_0xb26c('0x11')]['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x10bc9a,_0x48abdd[_0xb26c('0x11')][_0xb26c('0x12')]);return _0x5f0264(_0x48abdd[_0xb26c('0x11')][_0xb26c('0x12')]);}logger['error'](_0xb26c('0xd'),_0x10bc9a,_0x48abdd['error'][_0xb26c('0x12')]);return _0x160d21(_0x48abdd['error'][_0xb26c('0x12')]);}else{logger[_0xb26c('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x10bc9a,'request\x20sent');_0x160d21(_0x48abdd[_0xb26c('0x13')][_0xb26c('0x12')]);}})[_0xb26c('0x14')](function(_0x41a91e){logger[_0xb26c('0x11')](_0xb26c('0xd'),_0x10bc9a,_0x41a91e);_0x5f0264(_0x41a91e);});});}exports[_0xb26c('0x15')]=function(_0x107486){var _0xb93c8d=this;return new Promise(function(_0x1b29fb,_0x2c8e79){return db['SalesforceAccount']['findAll']({'raw':_0x107486['options']?_0x107486[_0xb26c('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x107486[_0xb26c('0x16')]?_0x107486[_0xb26c('0x16')][_0xb26c('0x17')]||null:null,'attributes':_0x107486[_0xb26c('0x16')]?_0x107486[_0xb26c('0x16')]['attributes']||null:null,'limit':_0x107486[_0xb26c('0x16')]?_0x107486[_0xb26c('0x16')][_0xb26c('0x18')]||null:null,'include':_0x107486['options']?_0x107486[_0xb26c('0x16')][_0xb26c('0x19')]?_[_0xb26c('0x1a')](_0x107486[_0xb26c('0x16')][_0xb26c('0x19')],function(_0x2c02ef){return{'model':db[_0x2c02ef[_0xb26c('0x1b')]],'as':_0x2c02ef['as'],'attributes':_0x2c02ef[_0xb26c('0x1c')],'include':_0x2c02ef[_0xb26c('0x19')]?_[_0xb26c('0x1a')](_0x2c02ef[_0xb26c('0x19')],function(_0xadfaa){return{'model':db[_0xadfaa['model']],'as':_0xadfaa['as'],'attributes':_0xadfaa['attributes'],'include':_0xadfaa[_0xb26c('0x19')]?_[_0xb26c('0x1a')](_0xadfaa['include'],function(_0x2e1b16){return{'model':db[_0x2e1b16['model']],'as':_0x2e1b16['as'],'attributes':_0x2e1b16['attributes']};}):[]};}):[]};}):[]:[]})[_0xb26c('0xb')](function(_0x24a59f){logger[_0xb26c('0xc')]('GetSalesforceAccount',_0x107486);logger[_0xb26c('0xf')](_0xb26c('0x15'),_0x107486,JSON['stringify'](_0x24a59f));_0x1b29fb(_0x24a59f);})[_0xb26c('0x14')](function(_0x4e0c7e){logger[_0xb26c('0x11')]('GetSalesforceAccount',_0x4e0c7e[_0xb26c('0x12')],_0x107486);_0x2c8e79(_0xb93c8d['error'](0x1f4,_0x4e0c7e[_0xb26c('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x3bcc2f){var _0x40798a=this;return new Promise(function(_0xd3136f,_0x468b43){return db[_0xb26c('0x1d')]['find']({'raw':_0x3bcc2f[_0xb26c('0x16')]?_0x3bcc2f[_0xb26c('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3bcc2f[_0xb26c('0x16')]?_0x3bcc2f[_0xb26c('0x16')]['where']||null:null,'attributes':_0x3bcc2f[_0xb26c('0x16')]?_0x3bcc2f[_0xb26c('0x16')]['attributes']||null:null,'include':_0x3bcc2f[_0xb26c('0x16')]?_0x3bcc2f[_0xb26c('0x16')][_0xb26c('0x19')]?_[_0xb26c('0x1a')](_0x3bcc2f[_0xb26c('0x16')][_0xb26c('0x19')],function(_0x4f8e1f){return{'model':db[_0x4f8e1f[_0xb26c('0x1b')]],'as':_0x4f8e1f['as'],'attributes':_0x4f8e1f['attributes'],'include':_0x4f8e1f[_0xb26c('0x19')]?_[_0xb26c('0x1a')](_0x4f8e1f[_0xb26c('0x19')],function(_0x1cff38){return{'model':db[_0x1cff38[_0xb26c('0x1b')]],'as':_0x1cff38['as'],'attributes':_0x1cff38[_0xb26c('0x1c')],'include':_0x1cff38['include']?_[_0xb26c('0x1a')](_0x1cff38[_0xb26c('0x19')],function(_0x5c8134){return{'model':db[_0x5c8134[_0xb26c('0x1b')]],'as':_0x5c8134['as'],'attributes':_0x5c8134[_0xb26c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb26c('0xb')](function(_0x27687c){logger[_0xb26c('0xc')](_0xb26c('0x1e'),_0x3bcc2f);logger[_0xb26c('0xf')](_0xb26c('0x1e'),_0x3bcc2f,JSON[_0xb26c('0x10')](_0x27687c));_0xd3136f(_0x27687c);})[_0xb26c('0x14')](function(_0x1b7831){logger[_0xb26c('0x11')](_0xb26c('0x1e'),_0x1b7831[_0xb26c('0x12')],_0x3bcc2f);_0x468b43(_0x40798a[_0xb26c('0x11')](0x1f4,_0x1b7831[_0xb26c('0x12')]));});});};
\ No newline at end of file
index caa08b5..ec63970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x10269d,_0x24ea57){var _0x1aaa80=function(_0x339a66){while(--_0x339a66){_0x10269d['push'](_0x10269d['shift']());}};_0x1aaa80(++_0x24ea57);}(_0xadb5,0xad));var _0x5adb=function(_0xbd884f,_0x2d3679){_0xbd884f=_0xbd884f-0x0;var _0x264b06=_0xadb5[_0xbd884f];return _0x264b06;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router;
\ No newline at end of file
+var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x15236b,_0x213d45){var _0x5467bb=function(_0x3a814e){while(--_0x3a814e){_0x15236b['push'](_0x15236b['shift']());}};_0x5467bb(++_0x213d45);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'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('./intSalesforceConfiguration.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['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router;
\ No newline at end of file
index fa68214..973f209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb7=['exports','STRING','Task','Case','ENUM','contact_lead','contact','lead','account_contact_lead','account','sequelize'];(function(_0x22ba6,_0x18dc12){var _0x4dca2e=function(_0xaa542c){while(--_0xaa542c){_0x22ba6['push'](_0x22ba6['shift']());}};_0x4dca2e(++_0x18dc12);}(_0x6bb7,0xd0));var _0x76bb=function(_0x2c0906,_0xa4c1f4){_0x2c0906=_0x2c0906-0x0;var _0x15cec8=_0x6bb7[_0x2c0906];return _0x15cec8;};'use strict';var Sequelize=require(_0x76bb('0x0'));module[_0x76bb('0x1')]={'name':{'type':Sequelize[_0x76bb('0x2')]},'description':{'type':Sequelize[_0x76bb('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x76bb('0x3'),_0x76bb('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x76bb('0x5')](_0x76bb('0x6'),_0x76bb('0x7'),_0x76bb('0x8'),_0x76bb('0x9'),'account'),'defaultValue':_0x76bb('0x6')},'moduleCreate':{'type':Sequelize[_0x76bb('0x5')]('nothing',_0x76bb('0x7'),_0x76bb('0x8'),_0x76bb('0xa')),'defaultValue':_0x76bb('0x8')},'leadId':{'type':Sequelize[_0x76bb('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x76bb('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x76bb('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x76bb('0x2')]}};
\ No newline at end of file
+var _0x5ae6=['STRING','sequelize','ENUM','Case','Task','contact_lead','lead','account_contact_lead','account','contact'];(function(_0x3ddf77,_0x8e8845){var _0x3e18ca=function(_0xcb53b0){while(--_0xcb53b0){_0x3ddf77['push'](_0x3ddf77['shift']());}};_0x3e18ca(++_0x8e8845);}(_0x5ae6,0x105));var _0x65ae=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0x5ae6[_0x5817e6];return _0x51916a;};'use strict';var Sequelize=require(_0x65ae('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x65ae('0x1')]('Task',_0x65ae('0x2')),'defaultValue':_0x65ae('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x65ae('0x4'),'contact',_0x65ae('0x5'),_0x65ae('0x6'),_0x65ae('0x7')),'defaultValue':_0x65ae('0x4')},'moduleCreate':{'type':Sequelize[_0x65ae('0x1')]('nothing',_0x65ae('0x8'),_0x65ae('0x5'),_0x65ae('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x65ae('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0x65ae('0x9')]},'additionalSearchContact':{'type':Sequelize[_0x65ae('0x9')]},'additionalSearchLead':{'type':Sequelize[_0x65ae('0x9')]}};
\ No newline at end of file
index 48fb290..fd2305e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa72f=['key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','SalesforceConfiguration','include','findAll','keys','rawAttributes','includeAll','catch','create','body','find','params','findOne','SalesforceField','pick','getFields','getSubjects','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','fieldName'];(function(_0x3beafb,_0x58d68c){var _0x31a9a4=function(_0x5b4fa6){while(--_0x5b4fa6){_0x3beafb['push'](_0x3beafb['shift']());}};_0x31a9a4(++_0x58d68c);}(_0xa72f,0x170));var _0xfa72=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0xa72f[_0x31172e];return _0x414ada;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa72('0x0'));var jsonpatch=require(_0xfa72('0x1'));var rp=require('request-promise');var moment=require(_0xfa72('0x2'));var BPromise=require(_0xfa72('0x3'));var Mustache=require(_0xfa72('0x4'));var util=require('util');var path=require(_0xfa72('0x5'));var sox=require(_0xfa72('0x6'));var csv=require(_0xfa72('0x7'));var ejs=require(_0xfa72('0x8'));var fs=require('fs');var fs_extra=require(_0xfa72('0x9'));var _=require(_0xfa72('0xa'));var squel=require('squel');var crypto=require(_0xfa72('0xb'));var jsforce=require(_0xfa72('0xc'));var deskjs=require(_0xfa72('0xd'));var toCsv=require(_0xfa72('0x7'));var querystring=require(_0xfa72('0xe'));var Papa=require('papaparse');var Redis=require(_0xfa72('0xf'));var authService=require(_0xfa72('0x10'));var qs=require(_0xfa72('0x11'));var as=require(_0xfa72('0x12'));var hardwareService=require(_0xfa72('0x13'));var logger=require(_0xfa72('0x14'))(_0xfa72('0x15'));var utils=require(_0xfa72('0x16'));var config=require(_0xfa72('0x17'));var licenseUtil=require(_0xfa72('0x18'));var db=require(_0xfa72('0x19'))['db'];function respondWithStatusCode(_0x2dd83e,_0x46af2a){_0x46af2a=_0x46af2a||0xcc;return function(_0xcd7e77){if(_0xcd7e77){return _0x2dd83e[_0xfa72('0x1a')](_0x46af2a);}return _0x2dd83e['status'](_0x46af2a)[_0xfa72('0x1b')]();};}function respondWithResult(_0x14f4ed,_0x310fdb){_0x310fdb=_0x310fdb||0xc8;return function(_0x4511b5){if(_0x4511b5){return _0x14f4ed[_0xfa72('0x1c')](_0x310fdb)[_0xfa72('0x1d')](_0x4511b5);}};}function respondWithFilteredResult(_0xb2f4ff,_0x4b5da3){return function(_0x554b8c){if(_0x554b8c){var _0x41ff22=typeof _0x4b5da3[_0xfa72('0x1e')]===_0xfa72('0x1f')&&typeof _0x4b5da3['limit']===_0xfa72('0x1f');var _0x193d37=_0x554b8c[_0xfa72('0x20')];var _0x1a0277=_0x41ff22?0x0:_0x4b5da3[_0xfa72('0x1e')];var _0x92d904=_0x41ff22?_0x554b8c[_0xfa72('0x20')]:_0x4b5da3[_0xfa72('0x1e')]+_0x4b5da3[_0xfa72('0x21')];var _0x14128a;if(_0x92d904>=_0x193d37){_0x92d904=_0x193d37;_0x14128a=0xc8;}else{_0x14128a=0xce;}_0xb2f4ff[_0xfa72('0x1c')](_0x14128a);return _0xb2f4ff[_0xfa72('0x22')](_0xfa72('0x23'),_0x1a0277+'-'+_0x92d904+'/'+_0x193d37)[_0xfa72('0x1d')](_0x554b8c);}return null;};}function patchUpdates(_0x37726b){return function(_0x32ff08){try{jsonpatch[_0xfa72('0x24')](_0x32ff08,_0x37726b,!![]);}catch(_0x3674e4){return BPromise['reject'](_0x3674e4);}return _0x32ff08[_0xfa72('0x25')]();};}function saveUpdates(_0x2b3f45,_0x5f3799){return function(_0x37a3e5){if(_0x37a3e5){return _0x37a3e5[_0xfa72('0x26')](_0x2b3f45)['then'](function(_0x124edc){return _0x124edc;});}return null;};}function removeEntity(_0x159f2f,_0x310011){return function(_0xe0fd67){if(_0xe0fd67){return _0xe0fd67[_0xfa72('0x27')]()[_0xfa72('0x28')](function(){_0x159f2f[_0xfa72('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7691c1,_0x59bb4b){return function(_0x428480){if(!_0x428480){_0x7691c1[_0xfa72('0x1a')](0x194);}return _0x428480;};}function handleError(_0x5402f6,_0x233968){_0x233968=_0x233968||0x1f4;return function(_0x782a9c){logger[_0xfa72('0x29')](_0x782a9c[_0xfa72('0x2a')]);if(_0x782a9c[_0xfa72('0x2b')]){delete _0x782a9c[_0xfa72('0x2b')];}_0x5402f6[_0xfa72('0x1c')](_0x233968)[_0xfa72('0x2c')](_0x782a9c);};}exports[_0xfa72('0x2d')]=function(_0x431a53,_0x1052ba){var _0x3dd624={},_0x33b338={},_0x5bae0e={'count':0x0,'rows':[]};var _0x7582eb=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x116be7){return{'name':_0x116be7[_0xfa72('0x2e')],'type':_0x116be7['type'][_0xfa72('0x2f')]};});_0x33b338[_0xfa72('0x30')]=_[_0xfa72('0x31')](_0x7582eb,_0xfa72('0x2b'));_0x33b338[_0xfa72('0x32')]=_['keys'](_0x431a53[_0xfa72('0x32')]);_0x33b338[_0xfa72('0x33')]=_[_0xfa72('0x34')](_0x33b338['model'],_0x33b338[_0xfa72('0x32')]);_0x3dd624['attributes']=_[_0xfa72('0x34')](_0x33b338[_0xfa72('0x30')],qs[_0xfa72('0x35')](_0x431a53['query']['fields']));_0x3dd624[_0xfa72('0x36')]=_0x3dd624[_0xfa72('0x36')][_0xfa72('0x37')]?_0x3dd624['attributes']:_0x33b338[_0xfa72('0x30')];if(!_0x431a53[_0xfa72('0x32')][_0xfa72('0x38')](_0xfa72('0x39'))){_0x3dd624[_0xfa72('0x21')]=qs[_0xfa72('0x21')](_0x431a53[_0xfa72('0x32')][_0xfa72('0x21')]);_0x3dd624['offset']=qs[_0xfa72('0x1e')](_0x431a53[_0xfa72('0x32')][_0xfa72('0x1e')]);}_0x3dd624[_0xfa72('0x3a')]=qs[_0xfa72('0x3b')](_0x431a53[_0xfa72('0x32')][_0xfa72('0x3b')]);_0x3dd624[_0xfa72('0x3c')]=qs['filters'](_['pick'](_0x431a53['query'],_0x33b338['filters']),_0x7582eb);if(_0x431a53['query']['filter']){_0x3dd624[_0xfa72('0x3c')]=_['merge'](_0x3dd624['where'],{'$or':_['map'](_0x7582eb,function(_0x417ec1){if(_0x417ec1[_0xfa72('0x3d')]!==_0xfa72('0x3e')){var _0x17bd6a={};_0x17bd6a[_0x417ec1[_0xfa72('0x2b')]]={'$like':'%'+_0x431a53[_0xfa72('0x32')][_0xfa72('0x3f')]+'%'};return _0x17bd6a;}})});}_0x3dd624=_[_0xfa72('0x40')]({},_0x3dd624,_0x431a53[_0xfa72('0x41')]);var _0x4bef35={'where':_0x3dd624[_0xfa72('0x3c')]};return db[_0xfa72('0x42')][_0xfa72('0x20')](_0x4bef35)[_0xfa72('0x28')](function(_0x236897){_0x5bae0e['count']=_0x236897;if(_0x431a53['query']['includeAll']){_0x3dd624[_0xfa72('0x43')]=[{'all':!![]}];}return db[_0xfa72('0x42')][_0xfa72('0x44')](_0x3dd624);})[_0xfa72('0x28')](function(_0x483b52){_0x5bae0e['rows']=_0x483b52;return _0x5bae0e;})[_0xfa72('0x28')](respondWithFilteredResult(_0x1052ba,_0x3dd624))['catch'](handleError(_0x1052ba,null));};exports['show']=function(_0x2850a8,_0x2f2a32){var _0x1c338d={'raw':![],'where':{'id':_0x2850a8['params']['id']}},_0x520d89={};_0x520d89['model']=_[_0xfa72('0x45')](db[_0xfa72('0x42')][_0xfa72('0x46')]);_0x520d89[_0xfa72('0x32')]=_['keys'](_0x2850a8['query']);_0x520d89[_0xfa72('0x33')]=_[_0xfa72('0x34')](_0x520d89[_0xfa72('0x30')],_0x520d89[_0xfa72('0x32')]);_0x1c338d[_0xfa72('0x36')]=_['intersection'](_0x520d89[_0xfa72('0x30')],qs['fields'](_0x2850a8[_0xfa72('0x32')][_0xfa72('0x35')]));_0x1c338d[_0xfa72('0x36')]=_0x1c338d['attributes'][_0xfa72('0x37')]?_0x1c338d[_0xfa72('0x36')]:_0x520d89['model'];if(_0x2850a8['query'][_0xfa72('0x47')]){_0x1c338d[_0xfa72('0x43')]=[{'all':!![]}];}_0x1c338d=_[_0xfa72('0x40')]({},_0x1c338d,_0x2850a8[_0xfa72('0x41')]);return db['SalesforceConfiguration']['find'](_0x1c338d)[_0xfa72('0x28')](handleEntityNotFound(_0x2f2a32,null))[_0xfa72('0x28')](respondWithResult(_0x2f2a32,null))[_0xfa72('0x48')](handleError(_0x2f2a32,null));};exports['create']=function(_0x1b35e0,_0x39d4ed){return db['SalesforceConfiguration'][_0xfa72('0x49')](_0x1b35e0[_0xfa72('0x4a')],{})[_0xfa72('0x28')](respondWithResult(_0x39d4ed,0xc9))[_0xfa72('0x48')](handleError(_0x39d4ed,null));};exports[_0xfa72('0x26')]=function(_0x3e2b12,_0x3722d6){if(_0x3e2b12[_0xfa72('0x4a')]['id']){delete _0x3e2b12[_0xfa72('0x4a')]['id'];}return db['SalesforceConfiguration'][_0xfa72('0x4b')]({'where':{'id':_0x3e2b12['params']['id']}})[_0xfa72('0x28')](handleEntityNotFound(_0x3722d6,null))[_0xfa72('0x28')](saveUpdates(_0x3e2b12['body'],null))[_0xfa72('0x28')](respondWithResult(_0x3722d6,null))['catch'](handleError(_0x3722d6,null));};exports['destroy']=function(_0x428099,_0x151f2d){return db[_0xfa72('0x42')]['find']({'where':{'id':_0x428099[_0xfa72('0x4c')]['id']}})[_0xfa72('0x28')](handleEntityNotFound(_0x151f2d,null))[_0xfa72('0x28')](removeEntity(_0x151f2d,null))[_0xfa72('0x48')](handleError(_0x151f2d,null));};exports['getFields']=function(_0x46efc9,_0x369d5e,_0x6e74af){var _0x4fb299={};var _0x1efd5e={};var _0x1541c4;var _0x2593c6;return db['SalesforceConfiguration'][_0xfa72('0x4d')]({'where':{'id':_0x46efc9[_0xfa72('0x4c')]['id']}})['then'](handleEntityNotFound(_0x369d5e,null))[_0xfa72('0x28')](function(_0x73d834){if(_0x73d834){_0x1541c4=_0x73d834;_0x1efd5e[_0xfa72('0x30')]=_[_0xfa72('0x45')](db[_0xfa72('0x4e')][_0xfa72('0x46')]);_0x1efd5e['query']=_['keys'](_0x46efc9[_0xfa72('0x32')]);_0x1efd5e[_0xfa72('0x33')]=_[_0xfa72('0x34')](_0x1efd5e[_0xfa72('0x30')],_0x1efd5e[_0xfa72('0x32')]);_0x4fb299['attributes']=_[_0xfa72('0x34')](_0x1efd5e[_0xfa72('0x30')],qs[_0xfa72('0x35')](_0x46efc9[_0xfa72('0x32')][_0xfa72('0x35')]));_0x4fb299[_0xfa72('0x36')]=_0x4fb299[_0xfa72('0x36')][_0xfa72('0x37')]?_0x4fb299[_0xfa72('0x36')]:_0x1efd5e[_0xfa72('0x30')];_0x4fb299[_0xfa72('0x3a')]=qs[_0xfa72('0x3b')](_0x46efc9['query'][_0xfa72('0x3b')]);_0x4fb299[_0xfa72('0x3c')]=qs[_0xfa72('0x33')](_[_0xfa72('0x4f')](_0x46efc9['query'],_0x1efd5e['filters']));if(_0x46efc9[_0xfa72('0x32')][_0xfa72('0x3f')]){_0x4fb299[_0xfa72('0x3c')]=_[_0xfa72('0x40')](_0x4fb299[_0xfa72('0x3c')],{'$or':_[_0xfa72('0x31')](_0x4fb299[_0xfa72('0x36')],function(_0x2485af){var _0x36ba53={};_0x36ba53[_0x2485af]={'$like':'%'+_0x46efc9['query']['filter']+'%'};return _0x36ba53;})});}_0x4fb299=_[_0xfa72('0x40')]({},_0x4fb299,_0x46efc9['options']);return _0x1541c4[_0xfa72('0x50')](_0x4fb299);}})[_0xfa72('0x28')](function(_0x20c304){if(_0x20c304){_0x2593c6=_0x20c304[_0xfa72('0x37')];if(!_0x46efc9['query'][_0xfa72('0x38')](_0xfa72('0x39'))){_0x4fb299[_0xfa72('0x21')]=qs[_0xfa72('0x21')](_0x46efc9[_0xfa72('0x32')][_0xfa72('0x21')]);_0x4fb299[_0xfa72('0x1e')]=qs[_0xfa72('0x1e')](_0x46efc9[_0xfa72('0x32')][_0xfa72('0x1e')]);}return _0x1541c4[_0xfa72('0x50')](_0x4fb299);}})[_0xfa72('0x28')](function(_0x1f09c9){if(_0x1f09c9){return _0x1f09c9?{'count':_0x2593c6,'rows':_0x1f09c9}:null;}})['then'](respondWithResult(_0x369d5e,null))[_0xfa72('0x48')](handleError(_0x369d5e,null));};exports[_0xfa72('0x51')]=function(_0x396bfe,_0x55ac3d,_0x309cff){var _0x427678={};var _0x488673={};var _0x2dfee4;var _0x1c8be1;return db[_0xfa72('0x42')][_0xfa72('0x4d')]({'where':{'id':_0x396bfe[_0xfa72('0x4c')]['id']}})[_0xfa72('0x28')](handleEntityNotFound(_0x55ac3d,null))[_0xfa72('0x28')](function(_0x31edc7){if(_0x31edc7){_0x2dfee4=_0x31edc7;_0x488673[_0xfa72('0x30')]=_[_0xfa72('0x45')](db[_0xfa72('0x4e')]['rawAttributes']);_0x488673['query']=_[_0xfa72('0x45')](_0x396bfe[_0xfa72('0x32')]);_0x488673['filters']=_[_0xfa72('0x34')](_0x488673['model'],_0x488673[_0xfa72('0x32')]);_0x427678['attributes']=_[_0xfa72('0x34')](_0x488673[_0xfa72('0x30')],qs[_0xfa72('0x35')](_0x396bfe[_0xfa72('0x32')][_0xfa72('0x35')]));_0x427678[_0xfa72('0x36')]=_0x427678['attributes'][_0xfa72('0x37')]?_0x427678[_0xfa72('0x36')]:_0x488673[_0xfa72('0x30')];_0x427678[_0xfa72('0x3a')]=qs[_0xfa72('0x3b')](_0x396bfe['query']['sort']);_0x427678[_0xfa72('0x3c')]=qs[_0xfa72('0x33')](_[_0xfa72('0x4f')](_0x396bfe[_0xfa72('0x32')],_0x488673[_0xfa72('0x33')]));if(_0x396bfe['query'][_0xfa72('0x3f')]){_0x427678[_0xfa72('0x3c')]=_['merge'](_0x427678[_0xfa72('0x3c')],{'$or':_[_0xfa72('0x31')](_0x427678[_0xfa72('0x36')],function(_0x54adcb){var _0x215a35={};_0x215a35[_0x54adcb]={'$like':'%'+_0x396bfe['query']['filter']+'%'};return _0x215a35;})});}_0x427678=_[_0xfa72('0x40')]({},_0x427678,_0x396bfe[_0xfa72('0x41')]);return _0x2dfee4['getSubjects'](_0x427678);}})[_0xfa72('0x28')](function(_0x27a1e){if(_0x27a1e){_0x1c8be1=_0x27a1e[_0xfa72('0x37')];if(!_0x396bfe[_0xfa72('0x32')][_0xfa72('0x38')](_0xfa72('0x39'))){_0x427678[_0xfa72('0x21')]=qs['limit'](_0x396bfe[_0xfa72('0x32')][_0xfa72('0x21')]);_0x427678[_0xfa72('0x1e')]=qs[_0xfa72('0x1e')](_0x396bfe['query']['offset']);}return _0x2dfee4[_0xfa72('0x51')](_0x427678);}})[_0xfa72('0x28')](function(_0x17cb49){if(_0x17cb49){return _0x17cb49?{'count':_0x1c8be1,'rows':_0x17cb49}:null;}})[_0xfa72('0x28')](respondWithResult(_0x55ac3d,null))['catch'](handleError(_0x55ac3d,null));};exports[_0xfa72('0x52')]=function(_0x461ce8,_0x1cf81a,_0x1314e5){var _0x31e469={};var _0x398875={};var _0x2b0190;var _0x3ff231;return db[_0xfa72('0x42')][_0xfa72('0x4d')]({'where':{'id':_0x461ce8[_0xfa72('0x4c')]['id']}})[_0xfa72('0x28')](handleEntityNotFound(_0x1cf81a,null))['then'](function(_0x2e426f){if(_0x2e426f){_0x2b0190=_0x2e426f;_0x398875['model']=_[_0xfa72('0x45')](db[_0xfa72('0x4e')][_0xfa72('0x46')]);_0x398875[_0xfa72('0x32')]=_['keys'](_0x461ce8['query']);_0x398875[_0xfa72('0x33')]=_[_0xfa72('0x34')](_0x398875['model'],_0x398875[_0xfa72('0x32')]);_0x31e469[_0xfa72('0x36')]=_[_0xfa72('0x34')](_0x398875[_0xfa72('0x30')],qs['fields'](_0x461ce8[_0xfa72('0x32')][_0xfa72('0x35')]));_0x31e469[_0xfa72('0x36')]=_0x31e469[_0xfa72('0x36')][_0xfa72('0x37')]?_0x31e469[_0xfa72('0x36')]:_0x398875[_0xfa72('0x30')];_0x31e469[_0xfa72('0x3a')]=qs[_0xfa72('0x3b')](_0x461ce8[_0xfa72('0x32')][_0xfa72('0x3b')]);_0x31e469[_0xfa72('0x3c')]=qs['filters'](_['pick'](_0x461ce8['query'],_0x398875[_0xfa72('0x33')]));if(_0x461ce8[_0xfa72('0x32')]['filter']){_0x31e469[_0xfa72('0x3c')]=_[_0xfa72('0x40')](_0x31e469[_0xfa72('0x3c')],{'$or':_[_0xfa72('0x31')](_0x31e469['attributes'],function(_0x112aae){var _0x4a6d2e={};_0x4a6d2e[_0x112aae]={'$like':'%'+_0x461ce8[_0xfa72('0x32')][_0xfa72('0x3f')]+'%'};return _0x4a6d2e;})});}_0x31e469=_[_0xfa72('0x40')]({},_0x31e469,_0x461ce8[_0xfa72('0x41')]);return _0x2b0190[_0xfa72('0x52')](_0x31e469);}})[_0xfa72('0x28')](function(_0x4eae9a){if(_0x4eae9a){_0x3ff231=_0x4eae9a[_0xfa72('0x37')];if(!_0x461ce8[_0xfa72('0x32')]['hasOwnProperty']('nolimit')){_0x31e469[_0xfa72('0x21')]=qs['limit'](_0x461ce8[_0xfa72('0x32')][_0xfa72('0x21')]);_0x31e469[_0xfa72('0x1e')]=qs['offset'](_0x461ce8['query'][_0xfa72('0x1e')]);}return _0x2b0190['getDescriptions'](_0x31e469);}})['then'](function(_0x1bcb84){if(_0x1bcb84){return _0x1bcb84?{'count':_0x3ff231,'rows':_0x1bcb84}:null;}})[_0xfa72('0x28')](respondWithResult(_0x1cf81a,null))[_0xfa72('0x48')](handleError(_0x1cf81a,null));};
\ No newline at end of file
+var _0xd6d2=['keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','getFields','SalesforceField','order','map','nolimit','getSubjects','hasOwnProperty','findOne','getDescriptions','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','SalesforceConfiguration','fieldName','key','model'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x23c02d,_0x114928){_0x23c02d=_0x23c02d-0x0;var _0x5bc286=_0xd6d2[_0x23c02d];return _0x5bc286;};'use strict';var emlformat=require(_0x2d6d('0x0'));var rimraf=require(_0x2d6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d6d('0x2'));var rp=require(_0x2d6d('0x3'));var moment=require('moment');var BPromise=require(_0x2d6d('0x4'));var Mustache=require('mustache');var util=require(_0x2d6d('0x5'));var path=require(_0x2d6d('0x6'));var sox=require(_0x2d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x2d6d('0x8'));var fs=require('fs');var fs_extra=require(_0x2d6d('0x9'));var _=require(_0x2d6d('0xa'));var squel=require(_0x2d6d('0xb'));var crypto=require(_0x2d6d('0xc'));var jsforce=require(_0x2d6d('0xd'));var deskjs=require(_0x2d6d('0xe'));var toCsv=require(_0x2d6d('0xf'));var querystring=require(_0x2d6d('0x10'));var Papa=require(_0x2d6d('0x11'));var Redis=require(_0x2d6d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2d6d('0x13'));var as=require(_0x2d6d('0x14'));var hardwareService=require(_0x2d6d('0x15'));var logger=require(_0x2d6d('0x16'))(_0x2d6d('0x17'));var utils=require('../../config/utils');var config=require(_0x2d6d('0x18'));var licenseUtil=require(_0x2d6d('0x19'));var db=require(_0x2d6d('0x1a'))['db'];function respondWithStatusCode(_0x2ad9fc,_0x5c4bf6){_0x5c4bf6=_0x5c4bf6||0xcc;return function(_0x5ef174){if(_0x5ef174){return _0x2ad9fc[_0x2d6d('0x1b')](_0x5c4bf6);}return _0x2ad9fc[_0x2d6d('0x1c')](_0x5c4bf6)[_0x2d6d('0x1d')]();};}function respondWithResult(_0x3528de,_0x58bd29){_0x58bd29=_0x58bd29||0xc8;return function(_0x1ec6aa){if(_0x1ec6aa){return _0x3528de[_0x2d6d('0x1c')](_0x58bd29)['json'](_0x1ec6aa);}};}function respondWithFilteredResult(_0x586085,_0x370096){return function(_0x17340f){if(_0x17340f){var _0x109b49=typeof _0x370096['offset']===_0x2d6d('0x1e')&&typeof _0x370096['limit']==='undefined';var _0x4c3092=_0x17340f[_0x2d6d('0x1f')];var _0x4179f2=_0x109b49?0x0:_0x370096[_0x2d6d('0x20')];var _0x3c527e=_0x109b49?_0x17340f[_0x2d6d('0x1f')]:_0x370096[_0x2d6d('0x20')]+_0x370096[_0x2d6d('0x21')];var _0xa2c4a7;if(_0x3c527e>=_0x4c3092){_0x3c527e=_0x4c3092;_0xa2c4a7=0xc8;}else{_0xa2c4a7=0xce;}_0x586085[_0x2d6d('0x1c')](_0xa2c4a7);return _0x586085['set'](_0x2d6d('0x22'),_0x4179f2+'-'+_0x3c527e+'/'+_0x4c3092)[_0x2d6d('0x23')](_0x17340f);}return null;};}function patchUpdates(_0x5b0c61){return function(_0x227e44){try{jsonpatch[_0x2d6d('0x24')](_0x227e44,_0x5b0c61,!![]);}catch(_0x15cb80){return BPromise[_0x2d6d('0x25')](_0x15cb80);}return _0x227e44[_0x2d6d('0x26')]();};}function saveUpdates(_0x59234a,_0x4aaa62){return function(_0x42c2f2){if(_0x42c2f2){return _0x42c2f2[_0x2d6d('0x27')](_0x59234a)[_0x2d6d('0x28')](function(_0x585b54){return _0x585b54;});}return null;};}function removeEntity(_0x47eb0e,_0x3ae8ad){return function(_0x4e7ec8){if(_0x4e7ec8){return _0x4e7ec8['destroy']()['then'](function(){_0x47eb0e[_0x2d6d('0x1c')](0xcc)[_0x2d6d('0x1d')]();});}};}function handleEntityNotFound(_0x3da83d,_0x3f89dd){return function(_0x3e5a92){if(!_0x3e5a92){_0x3da83d['sendStatus'](0x194);}return _0x3e5a92;};}function handleError(_0x16634d,_0x1b4964){_0x1b4964=_0x1b4964||0x1f4;return function(_0x455e71){logger[_0x2d6d('0x29')](_0x455e71[_0x2d6d('0x2a')]);if(_0x455e71[_0x2d6d('0x2b')]){delete _0x455e71[_0x2d6d('0x2b')];}_0x16634d[_0x2d6d('0x1c')](_0x1b4964)[_0x2d6d('0x2c')](_0x455e71);};}exports['index']=function(_0x1016e1,_0x26d299){var _0x2e7b32={},_0x34d485={},_0x486963={'count':0x0,'rows':[]};var _0x317bde=_['map'](db[_0x2d6d('0x2d')]['rawAttributes'],function(_0x58bfc7){return{'name':_0x58bfc7[_0x2d6d('0x2e')],'type':_0x58bfc7['type'][_0x2d6d('0x2f')]};});_0x34d485[_0x2d6d('0x30')]=_['map'](_0x317bde,_0x2d6d('0x2b'));_0x34d485['query']=_[_0x2d6d('0x31')](_0x1016e1[_0x2d6d('0x32')]);_0x34d485[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x34d485[_0x2d6d('0x30')],_0x34d485[_0x2d6d('0x32')]);_0x2e7b32[_0x2d6d('0x35')]=_[_0x2d6d('0x34')](_0x34d485['model'],qs[_0x2d6d('0x36')](_0x1016e1[_0x2d6d('0x32')]['fields']));_0x2e7b32[_0x2d6d('0x35')]=_0x2e7b32[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x2e7b32[_0x2d6d('0x35')]:_0x34d485[_0x2d6d('0x30')];if(!_0x1016e1['query']['hasOwnProperty']('nolimit')){_0x2e7b32[_0x2d6d('0x21')]=qs[_0x2d6d('0x21')](_0x1016e1[_0x2d6d('0x32')]['limit']);_0x2e7b32[_0x2d6d('0x20')]=qs[_0x2d6d('0x20')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x20')]);}_0x2e7b32['order']=qs[_0x2d6d('0x38')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x38')]);_0x2e7b32[_0x2d6d('0x39')]=qs[_0x2d6d('0x33')](_[_0x2d6d('0x3a')](_0x1016e1[_0x2d6d('0x32')],_0x34d485['filters']),_0x317bde);if(_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x3b')]){_0x2e7b32[_0x2d6d('0x39')]=_[_0x2d6d('0x3c')](_0x2e7b32[_0x2d6d('0x39')],{'$or':_['map'](_0x317bde,function(_0x1cad57){if(_0x1cad57[_0x2d6d('0x3d')]!==_0x2d6d('0x3e')){var _0x4616df={};_0x4616df[_0x1cad57[_0x2d6d('0x2b')]]={'$like':'%'+_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x3b')]+'%'};return _0x4616df;}})});}_0x2e7b32=_[_0x2d6d('0x3c')]({},_0x2e7b32,_0x1016e1[_0x2d6d('0x3f')]);var _0x38cce8={'where':_0x2e7b32[_0x2d6d('0x39')]};return db[_0x2d6d('0x2d')][_0x2d6d('0x1f')](_0x38cce8)[_0x2d6d('0x28')](function(_0x34fc23){_0x486963[_0x2d6d('0x1f')]=_0x34fc23;if(_0x1016e1[_0x2d6d('0x32')]['includeAll']){_0x2e7b32[_0x2d6d('0x40')]=[{'all':!![]}];}return db[_0x2d6d('0x2d')][_0x2d6d('0x41')](_0x2e7b32);})[_0x2d6d('0x28')](function(_0x246d6e){_0x486963['rows']=_0x246d6e;return _0x486963;})[_0x2d6d('0x28')](respondWithFilteredResult(_0x26d299,_0x2e7b32))[_0x2d6d('0x42')](handleError(_0x26d299,null));};exports[_0x2d6d('0x43')]=function(_0x41ab2e,_0x543b4b){var _0x3b62b1={'raw':![],'where':{'id':_0x41ab2e[_0x2d6d('0x44')]['id']}},_0x7f76ad={};_0x7f76ad[_0x2d6d('0x30')]=_[_0x2d6d('0x31')](db['SalesforceConfiguration'][_0x2d6d('0x45')]);_0x7f76ad[_0x2d6d('0x32')]=_['keys'](_0x41ab2e[_0x2d6d('0x32')]);_0x7f76ad[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x7f76ad['model'],_0x7f76ad[_0x2d6d('0x32')]);_0x3b62b1[_0x2d6d('0x35')]=_['intersection'](_0x7f76ad['model'],qs['fields'](_0x41ab2e[_0x2d6d('0x32')][_0x2d6d('0x36')]));_0x3b62b1['attributes']=_0x3b62b1[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x3b62b1[_0x2d6d('0x35')]:_0x7f76ad[_0x2d6d('0x30')];if(_0x41ab2e['query'][_0x2d6d('0x46')]){_0x3b62b1[_0x2d6d('0x40')]=[{'all':!![]}];}_0x3b62b1=_['merge']({},_0x3b62b1,_0x41ab2e[_0x2d6d('0x3f')]);return db[_0x2d6d('0x2d')][_0x2d6d('0x47')](_0x3b62b1)[_0x2d6d('0x28')](handleEntityNotFound(_0x543b4b,null))[_0x2d6d('0x28')](respondWithResult(_0x543b4b,null))[_0x2d6d('0x42')](handleError(_0x543b4b,null));};exports[_0x2d6d('0x48')]=function(_0x5ac5e9,_0xe6b038){return db[_0x2d6d('0x2d')][_0x2d6d('0x48')](_0x5ac5e9['body'],{})['then'](respondWithResult(_0xe6b038,0xc9))[_0x2d6d('0x42')](handleError(_0xe6b038,null));};exports[_0x2d6d('0x27')]=function(_0x422198,_0x4e5203){if(_0x422198[_0x2d6d('0x49')]['id']){delete _0x422198[_0x2d6d('0x49')]['id'];}return db['SalesforceConfiguration'][_0x2d6d('0x47')]({'where':{'id':_0x422198[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x4e5203,null))[_0x2d6d('0x28')](saveUpdates(_0x422198[_0x2d6d('0x49')],null))[_0x2d6d('0x28')](respondWithResult(_0x4e5203,null))[_0x2d6d('0x42')](handleError(_0x4e5203,null));};exports[_0x2d6d('0x4a')]=function(_0x42c125,_0x1ca9a2){return db['SalesforceConfiguration'][_0x2d6d('0x47')]({'where':{'id':_0x42c125[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x1ca9a2,null))['then'](removeEntity(_0x1ca9a2,null))[_0x2d6d('0x42')](handleError(_0x1ca9a2,null));};exports[_0x2d6d('0x4b')]=function(_0x3738b3,_0x2dbcdc,_0x37d0cf){var _0x2313e8={};var _0x3ad153={};var _0x4eb1d7;var _0x3131c5;return db[_0x2d6d('0x2d')]['findOne']({'where':{'id':_0x3738b3[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x2dbcdc,null))['then'](function(_0x11241d){if(_0x11241d){_0x4eb1d7=_0x11241d;_0x3ad153[_0x2d6d('0x30')]=_['keys'](db[_0x2d6d('0x4c')][_0x2d6d('0x45')]);_0x3ad153[_0x2d6d('0x32')]=_[_0x2d6d('0x31')](_0x3738b3[_0x2d6d('0x32')]);_0x3ad153[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x3ad153['model'],_0x3ad153['query']);_0x2313e8[_0x2d6d('0x35')]=_['intersection'](_0x3ad153[_0x2d6d('0x30')],qs[_0x2d6d('0x36')](_0x3738b3[_0x2d6d('0x32')]['fields']));_0x2313e8[_0x2d6d('0x35')]=_0x2313e8['attributes'][_0x2d6d('0x37')]?_0x2313e8[_0x2d6d('0x35')]:_0x3ad153[_0x2d6d('0x30')];_0x2313e8[_0x2d6d('0x4d')]=qs[_0x2d6d('0x38')](_0x3738b3[_0x2d6d('0x32')][_0x2d6d('0x38')]);_0x2313e8[_0x2d6d('0x39')]=qs['filters'](_[_0x2d6d('0x3a')](_0x3738b3[_0x2d6d('0x32')],_0x3ad153[_0x2d6d('0x33')]));if(_0x3738b3['query']['filter']){_0x2313e8['where']=_[_0x2d6d('0x3c')](_0x2313e8['where'],{'$or':_[_0x2d6d('0x4e')](_0x2313e8[_0x2d6d('0x35')],function(_0x1dacbf){var _0x3f9e3d={};_0x3f9e3d[_0x1dacbf]={'$like':'%'+_0x3738b3[_0x2d6d('0x32')][_0x2d6d('0x3b')]+'%'};return _0x3f9e3d;})});}_0x2313e8=_['merge']({},_0x2313e8,_0x3738b3[_0x2d6d('0x3f')]);return _0x4eb1d7[_0x2d6d('0x4b')](_0x2313e8);}})[_0x2d6d('0x28')](function(_0x2f28d4){if(_0x2f28d4){_0x3131c5=_0x2f28d4[_0x2d6d('0x37')];if(!_0x3738b3[_0x2d6d('0x32')]['hasOwnProperty'](_0x2d6d('0x4f'))){_0x2313e8[_0x2d6d('0x21')]=qs[_0x2d6d('0x21')](_0x3738b3[_0x2d6d('0x32')]['limit']);_0x2313e8[_0x2d6d('0x20')]=qs[_0x2d6d('0x20')](_0x3738b3[_0x2d6d('0x32')]['offset']);}return _0x4eb1d7[_0x2d6d('0x4b')](_0x2313e8);}})[_0x2d6d('0x28')](function(_0x190ff7){if(_0x190ff7){return _0x190ff7?{'count':_0x3131c5,'rows':_0x190ff7}:null;}})['then'](respondWithResult(_0x2dbcdc,null))[_0x2d6d('0x42')](handleError(_0x2dbcdc,null));};exports['getSubjects']=function(_0x28057e,_0x2cdb39,_0x2183ba){var _0x1ff88f={};var _0x2ab0a7={};var _0x179721;var _0x3540ed;return db[_0x2d6d('0x2d')]['findOne']({'where':{'id':_0x28057e[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x2cdb39,null))[_0x2d6d('0x28')](function(_0x3330cc){if(_0x3330cc){_0x179721=_0x3330cc;_0x2ab0a7[_0x2d6d('0x30')]=_['keys'](db[_0x2d6d('0x4c')]['rawAttributes']);_0x2ab0a7[_0x2d6d('0x32')]=_[_0x2d6d('0x31')](_0x28057e[_0x2d6d('0x32')]);_0x2ab0a7[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x2ab0a7[_0x2d6d('0x30')],_0x2ab0a7[_0x2d6d('0x32')]);_0x1ff88f[_0x2d6d('0x35')]=_['intersection'](_0x2ab0a7[_0x2d6d('0x30')],qs[_0x2d6d('0x36')](_0x28057e[_0x2d6d('0x32')][_0x2d6d('0x36')]));_0x1ff88f[_0x2d6d('0x35')]=_0x1ff88f['attributes']['length']?_0x1ff88f['attributes']:_0x2ab0a7[_0x2d6d('0x30')];_0x1ff88f[_0x2d6d('0x4d')]=qs[_0x2d6d('0x38')](_0x28057e[_0x2d6d('0x32')][_0x2d6d('0x38')]);_0x1ff88f[_0x2d6d('0x39')]=qs[_0x2d6d('0x33')](_[_0x2d6d('0x3a')](_0x28057e[_0x2d6d('0x32')],_0x2ab0a7['filters']));if(_0x28057e[_0x2d6d('0x32')]['filter']){_0x1ff88f[_0x2d6d('0x39')]=_[_0x2d6d('0x3c')](_0x1ff88f[_0x2d6d('0x39')],{'$or':_[_0x2d6d('0x4e')](_0x1ff88f[_0x2d6d('0x35')],function(_0x46277a){var _0x4d0f9b={};_0x4d0f9b[_0x46277a]={'$like':'%'+_0x28057e[_0x2d6d('0x32')][_0x2d6d('0x3b')]+'%'};return _0x4d0f9b;})});}_0x1ff88f=_['merge']({},_0x1ff88f,_0x28057e[_0x2d6d('0x3f')]);return _0x179721[_0x2d6d('0x50')](_0x1ff88f);}})[_0x2d6d('0x28')](function(_0x1e5e40){if(_0x1e5e40){_0x3540ed=_0x1e5e40[_0x2d6d('0x37')];if(!_0x28057e['query'][_0x2d6d('0x51')](_0x2d6d('0x4f'))){_0x1ff88f[_0x2d6d('0x21')]=qs[_0x2d6d('0x21')](_0x28057e[_0x2d6d('0x32')][_0x2d6d('0x21')]);_0x1ff88f[_0x2d6d('0x20')]=qs[_0x2d6d('0x20')](_0x28057e['query'][_0x2d6d('0x20')]);}return _0x179721[_0x2d6d('0x50')](_0x1ff88f);}})[_0x2d6d('0x28')](function(_0x1d1434){if(_0x1d1434){return _0x1d1434?{'count':_0x3540ed,'rows':_0x1d1434}:null;}})['then'](respondWithResult(_0x2cdb39,null))[_0x2d6d('0x42')](handleError(_0x2cdb39,null));};exports['getDescriptions']=function(_0x4b67d8,_0x55e5d1,_0x5c3218){var _0x54b0e0={};var _0x3b07e5={};var _0x309a9c;var _0x32dd62;return db[_0x2d6d('0x2d')][_0x2d6d('0x52')]({'where':{'id':_0x4b67d8[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x55e5d1,null))['then'](function(_0x2a3e73){if(_0x2a3e73){_0x309a9c=_0x2a3e73;_0x3b07e5[_0x2d6d('0x30')]=_['keys'](db[_0x2d6d('0x4c')][_0x2d6d('0x45')]);_0x3b07e5['query']=_[_0x2d6d('0x31')](_0x4b67d8[_0x2d6d('0x32')]);_0x3b07e5[_0x2d6d('0x33')]=_['intersection'](_0x3b07e5[_0x2d6d('0x30')],_0x3b07e5[_0x2d6d('0x32')]);_0x54b0e0[_0x2d6d('0x35')]=_[_0x2d6d('0x34')](_0x3b07e5[_0x2d6d('0x30')],qs['fields'](_0x4b67d8[_0x2d6d('0x32')]['fields']));_0x54b0e0[_0x2d6d('0x35')]=_0x54b0e0[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x54b0e0['attributes']:_0x3b07e5['model'];_0x54b0e0[_0x2d6d('0x4d')]=qs[_0x2d6d('0x38')](_0x4b67d8['query'][_0x2d6d('0x38')]);_0x54b0e0[_0x2d6d('0x39')]=qs['filters'](_[_0x2d6d('0x3a')](_0x4b67d8[_0x2d6d('0x32')],_0x3b07e5[_0x2d6d('0x33')]));if(_0x4b67d8[_0x2d6d('0x32')][_0x2d6d('0x3b')]){_0x54b0e0[_0x2d6d('0x39')]=_['merge'](_0x54b0e0[_0x2d6d('0x39')],{'$or':_[_0x2d6d('0x4e')](_0x54b0e0[_0x2d6d('0x35')],function(_0x27d38f){var _0x547272={};_0x547272[_0x27d38f]={'$like':'%'+_0x4b67d8[_0x2d6d('0x32')]['filter']+'%'};return _0x547272;})});}_0x54b0e0=_[_0x2d6d('0x3c')]({},_0x54b0e0,_0x4b67d8['options']);return _0x309a9c[_0x2d6d('0x53')](_0x54b0e0);}})[_0x2d6d('0x28')](function(_0x58e1a0){if(_0x58e1a0){_0x32dd62=_0x58e1a0[_0x2d6d('0x37')];if(!_0x4b67d8['query'][_0x2d6d('0x51')]('nolimit')){_0x54b0e0['limit']=qs[_0x2d6d('0x21')](_0x4b67d8[_0x2d6d('0x32')]['limit']);_0x54b0e0[_0x2d6d('0x20')]=qs[_0x2d6d('0x20')](_0x4b67d8['query'][_0x2d6d('0x20')]);}return _0x309a9c[_0x2d6d('0x53')](_0x54b0e0);}})[_0x2d6d('0x28')](function(_0x43b696){if(_0x43b696){return _0x43b696?{'count':_0x32dd62,'rows':_0x43b696}:null;}})[_0x2d6d('0x28')](respondWithResult(_0x55e5d1,null))['catch'](handleError(_0x55e5d1,null));};
\ No newline at end of file
index 0e6963c..8c160ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1195=['moment','request-promise','rimraf','../../config/environment','exports','define','SalesforceConfiguration','lodash','api'];(function(_0x1b6069,_0x4af027){var _0x487d7b=function(_0x1d2707){while(--_0x1d2707){_0x1b6069['push'](_0x1b6069['shift']());}};_0x487d7b(++_0x4af027);}(_0x1195,0xc4));var _0x5119=function(_0x29c6fc,_0x462633){_0x29c6fc=_0x29c6fc-0x0;var _0x1406ab=_0x1195[_0x29c6fc];return _0x1406ab;};'use strict';var _=require(_0x5119('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5119('0x1'));var moment=require(_0x5119('0x2'));var BPromise=require('bluebird');var rp=require(_0x5119('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5119('0x4'));var config=require(_0x5119('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x5119('0x6')]=function(_0x5d4064,_0x373f91){return _0x5d4064[_0x5119('0x7')](_0x5119('0x8'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb80=['bluebird','request-promise','path','rimraf','define','SalesforceConfiguration','int_salesforce_configurations','lodash','api','moment'];(function(_0x31bcbe,_0x4ce65b){var _0x485320=function(_0x1cb6d7){while(--_0x1cb6d7){_0x31bcbe['push'](_0x31bcbe['shift']());}};_0x485320(++_0x4ce65b);}(_0xeb80,0xc5));var _0x0eb8=function(_0x1a4ea9,_0x264b2a){_0x1a4ea9=_0x1a4ea9-0x0;var _0x405b90=_0xeb80[_0x1a4ea9];return _0x405b90;};'use strict';var _=require(_0x0eb8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0eb8('0x1'));var moment=require(_0x0eb8('0x2'));var BPromise=require(_0x0eb8('0x3'));var rp=require(_0x0eb8('0x4'));var fs=require('fs');var path=require(_0x0eb8('0x5'));var rimraf=require(_0x0eb8('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x12ab6c,_0x208072){return _0x12ab6c[_0x0eb8('0x7')](_0x0eb8('0x8'),attributes,{'tableName':_0x0eb8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf326af..7675a97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e06=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0xa286fe,_0x49d9c0){var _0x126992=function(_0x57e2a8){while(--_0x57e2a8){_0xa286fe['push'](_0xa286fe['shift']());}};_0x126992(++_0x49d9c0);}(_0x2e06,0x188));var _0x62e0=function(_0x1da61b,_0x54786f){_0x1da61b=_0x1da61b-0x0;var _0x7eb30c=_0x2e06[_0x1da61b];return _0x7eb30c;};'use strict';var _=require(_0x62e0('0x0'));var util=require(_0x62e0('0x1'));var moment=require(_0x62e0('0x2'));var BPromise=require(_0x62e0('0x3'));var rs=require(_0x62e0('0x4'));var fs=require('fs');var Redis=require(_0x62e0('0x5'));var db=require(_0x62e0('0x6'))['db'];var utils=require(_0x62e0('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62e0('0x8'));var jayson=require(_0x62e0('0x9'));var client=jayson[_0x62e0('0xa')][_0x62e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x196947,_0x262752,_0x609596){return new BPromise(function(_0xe83811,_0x28408b){return client[_0x62e0('0xc')](_0x196947,_0x609596)[_0x62e0('0xd')](function(_0x58941d){logger[_0x62e0('0xe')](_0x62e0('0xf'),_0x262752,'request\x20sent');logger['debug'](_0x62e0('0x10'),_0x262752,_0x62e0('0x11'),JSON[_0x62e0('0x12')](_0x58941d));if(_0x58941d[_0x62e0('0x13')]){if(_0x58941d['error']['code']===0x1f4){logger[_0x62e0('0x13')](_0x62e0('0xf'),_0x262752,_0x58941d[_0x62e0('0x13')][_0x62e0('0x14')]);return _0x28408b(_0x58941d['error'][_0x62e0('0x14')]);}logger[_0x62e0('0x13')](_0x62e0('0xf'),_0x262752,_0x58941d[_0x62e0('0x13')][_0x62e0('0x14')]);return _0xe83811(_0x58941d['error'][_0x62e0('0x14')]);}else{logger[_0x62e0('0xe')](_0x62e0('0xf'),_0x262752,_0x62e0('0x11'));_0xe83811(_0x58941d['result'][_0x62e0('0x14')]);}})[_0x62e0('0x15')](function(_0xb77121){logger[_0x62e0('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x262752,_0xb77121);_0x28408b(_0xb77121);});});}
\ No newline at end of file
+var _0x2d57=['../../mysqldb','jayson/promise','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','randomstring','ioredis'];(function(_0x1d734a,_0xf7cfec){var _0x3eef41=function(_0x5a8d18){while(--_0x5a8d18){_0x1d734a['push'](_0x1d734a['shift']());}};_0x3eef41(++_0xf7cfec);}(_0x2d57,0x11d));var _0x72d5=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x2d57[_0x3a78a0];return _0x48e917;};'use strict';var _=require(_0x72d5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x72d5('0x1'));var fs=require('fs');var Redis=require(_0x72d5('0x2'));var db=require(_0x72d5('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x72d5('0x4'));var client=jayson['client'][_0x72d5('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3e8326,_0x2d6211,_0x1cf240){return new BPromise(function(_0x206549,_0x589e4a){return client[_0x72d5('0x6')](_0x3e8326,_0x1cf240)['then'](function(_0x128544){logger[_0x72d5('0x7')](_0x72d5('0x8'),_0x2d6211,_0x72d5('0x9'));logger[_0x72d5('0xa')](_0x72d5('0xb'),_0x2d6211,_0x72d5('0x9'),JSON[_0x72d5('0xc')](_0x128544));if(_0x128544[_0x72d5('0xd')]){if(_0x128544['error']['code']===0x1f4){logger[_0x72d5('0xd')](_0x72d5('0x8'),_0x2d6211,_0x128544[_0x72d5('0xd')]['message']);return _0x589e4a(_0x128544[_0x72d5('0xd')][_0x72d5('0xe')]);}logger[_0x72d5('0xd')](_0x72d5('0x8'),_0x2d6211,_0x128544[_0x72d5('0xd')][_0x72d5('0xe')]);return _0x206549(_0x128544[_0x72d5('0xd')]['message']);}else{logger[_0x72d5('0x7')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d6211,_0x72d5('0x9'));_0x206549(_0x128544[_0x72d5('0xf')]['message']);}})['catch'](function(_0x577566){logger[_0x72d5('0xd')](_0x72d5('0x8'),_0x2d6211,_0x577566);_0x589e4a(_0x577566);});});}
\ No newline at end of file
index 42ce001..7adad8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb414=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3e94f0,_0x382afe){var _0x5ddbb2=function(_0x45f8a4){while(--_0x45f8a4){_0x3e94f0['push'](_0x3e94f0['shift']());}};_0x5ddbb2(++_0x382afe);}(_0xb414,0x13f));var _0x4b41=function(_0xa8bbe5,_0x18e938){_0xa8bbe5=_0xa8bbe5-0x0;var _0x2c7e5b=_0xb414[_0xa8bbe5];return _0x2c7e5b;};'use strict';var multer=require(_0x4b41('0x0'));var util=require(_0x4b41('0x1'));var path=require(_0x4b41('0x2'));var timeout=require(_0x4b41('0x3'));var express=require(_0x4b41('0x4'));var router=express[_0x4b41('0x5')]();var fs_extra=require(_0x4b41('0x6'));var auth=require(_0x4b41('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4b41('0x8'));var controller=require('./intSalesforceField.controller');router[_0x4b41('0x9')]('/',auth[_0x4b41('0xa')](),controller[_0x4b41('0xb')]);router[_0x4b41('0x9')](_0x4b41('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4b41('0xd')]('/',auth[_0x4b41('0xa')](),controller['create']);router[_0x4b41('0xe')](_0x4b41('0xc'),auth[_0x4b41('0xa')](),controller[_0x4b41('0xf')]);router[_0x4b41('0x10')](_0x4b41('0xc'),auth[_0x4b41('0xa')](),controller[_0x4b41('0x11')]);module[_0x4b41('0x12')]=router;
\ No newline at end of file
+var _0x584e=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x3c5433,_0x515ff7){var _0x425f26=function(_0x5bafca){while(--_0x5bafca){_0x3c5433['push'](_0x3c5433['shift']());}};_0x425f26(++_0x515ff7);}(_0x584e,0x121));var _0xe584=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x584e[_0x261b8a];return _0x3455e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe584('0x0'));var timeout=require(_0xe584('0x1'));var express=require(_0xe584('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe584('0x3'));var config=require(_0xe584('0x4'));var controller=require(_0xe584('0x5'));router['get']('/',auth[_0xe584('0x6')](),controller[_0xe584('0x7')]);router[_0xe584('0x8')](_0xe584('0x9'),auth[_0xe584('0x6')](),controller[_0xe584('0xa')]);router['post']('/',auth[_0xe584('0x6')](),controller[_0xe584('0xb')]);router[_0xe584('0xc')](_0xe584('0x9'),auth[_0xe584('0x6')](),controller[_0xe584('0xd')]);router[_0xe584('0xe')](_0xe584('0x9'),auth[_0xe584('0x6')](),controller[_0xe584('0xf')]);module[_0xe584('0x10')]=router;
\ No newline at end of file
index 5d28a71..edd19d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadca=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','customVariable'];(function(_0x1970e0,_0x336b9f){var _0xc4005a=function(_0x50073d){while(--_0x50073d){_0x1970e0['push'](_0x1970e0['shift']());}};_0xc4005a(++_0x336b9f);}(_0xadca,0x13b));var _0xaadc=function(_0x22541c,_0x5e7c24){_0x22541c=_0x22541c-0x0;var _0x2c5667=_0xadca[_0x22541c];return _0x2c5667;};'use strict';var Sequelize=require(_0xaadc('0x0'));module[_0xaadc('0x1')]={'type':{'type':Sequelize[_0xaadc('0x2')](_0xaadc('0x3'),'variable',_0xaadc('0x4'),_0xaadc('0x5'),_0xaadc('0x6')),'defaultValue':_0xaadc('0x3')},'content':{'type':Sequelize[_0xaadc('0x7')]},'key':{'type':Sequelize[_0xaadc('0x7')]},'keyType':{'type':Sequelize[_0xaadc('0x2')](_0xaadc('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xaadc('0x7')]},'idField':{'type':Sequelize[_0xaadc('0x7')]},'variableName':{'type':Sequelize[_0xaadc('0x7')]}};
\ No newline at end of file
+var _0x3ac9=['ENUM','variable','keyValue','picklist','STRING','string','customVariable','sequelize'];(function(_0x5e58b2,_0x1b7ed4){var _0x4facd0=function(_0x58d136){while(--_0x58d136){_0x5e58b2['push'](_0x5e58b2['shift']());}};_0x4facd0(++_0x1b7ed4);}(_0x3ac9,0x18f));var _0x93ac=function(_0x539ce2,_0x54efa0){_0x539ce2=_0x539ce2-0x0;var _0x1c85b0=_0x3ac9[_0x539ce2];return _0x1c85b0;};'use strict';var Sequelize=require(_0x93ac('0x0'));module['exports']={'type':{'type':Sequelize[_0x93ac('0x1')]('string',_0x93ac('0x2'),'customVariable',_0x93ac('0x3'),_0x93ac('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x93ac('0x5')]},'key':{'type':Sequelize[_0x93ac('0x5')]},'keyType':{'type':Sequelize[_0x93ac('0x1')](_0x93ac('0x6'),_0x93ac('0x2'),_0x93ac('0x7'))},'keyContent':{'type':Sequelize[_0x93ac('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x93ac('0x5')]}};
\ No newline at end of file
index c34aad6..5c48279 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe080=['model','query','keys','filters','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','intersection','fields','create','body','find','eml-format','rimraf','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','limit','Content-Range','apply','save','update','then','error','stack','name','index','map','SalesforceField','fieldName','type'];(function(_0x23411b,_0x279f66){var _0x5e9a5f=function(_0x4a5151){while(--_0x4a5151){_0x23411b['push'](_0x23411b['shift']());}};_0x5e9a5f(++_0x279f66);}(_0xe080,0x17c));var _0x0e08=function(_0xcb38e8,_0x54e652){_0xcb38e8=_0xcb38e8-0x0;var _0x358141=_0xe080[_0xcb38e8];return _0x358141;};'use strict';var emlformat=require(_0x0e08('0x0'));var rimraf=require(_0x0e08('0x1'));var zipdir=require(_0x0e08('0x2'));var jsonpatch=require(_0x0e08('0x3'));var rp=require(_0x0e08('0x4'));var moment=require(_0x0e08('0x5'));var BPromise=require(_0x0e08('0x6'));var Mustache=require(_0x0e08('0x7'));var util=require(_0x0e08('0x8'));var path=require('path');var sox=require(_0x0e08('0x9'));var csv=require(_0x0e08('0xa'));var ejs=require(_0x0e08('0xb'));var fs=require('fs');var fs_extra=require(_0x0e08('0xc'));var _=require(_0x0e08('0xd'));var squel=require(_0x0e08('0xe'));var crypto=require('crypto');var jsforce=require(_0x0e08('0xf'));var deskjs=require(_0x0e08('0x10'));var toCsv=require(_0x0e08('0xa'));var querystring=require(_0x0e08('0x11'));var Papa=require(_0x0e08('0x12'));var Redis=require(_0x0e08('0x13'));var authService=require(_0x0e08('0x14'));var qs=require(_0x0e08('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e08('0x16'));var logger=require(_0x0e08('0x17'))('api');var utils=require(_0x0e08('0x18'));var config=require(_0x0e08('0x19'));var licenseUtil=require(_0x0e08('0x1a'));var db=require(_0x0e08('0x1b'))['db'];function respondWithStatusCode(_0x4ca31e,_0x3cde27){_0x3cde27=_0x3cde27||0xcc;return function(_0xf248ad){if(_0xf248ad){return _0x4ca31e['sendStatus'](_0x3cde27);}return _0x4ca31e[_0x0e08('0x1c')](_0x3cde27)['end']();};}function respondWithResult(_0x120798,_0x4dc704){_0x4dc704=_0x4dc704||0xc8;return function(_0x205cfc){if(_0x205cfc){return _0x120798[_0x0e08('0x1c')](_0x4dc704)[_0x0e08('0x1d')](_0x205cfc);}};}function respondWithFilteredResult(_0x3f7571,_0x503102){return function(_0x10d289){if(_0x10d289){var _0x5ca950=typeof _0x503102[_0x0e08('0x1e')]==='undefined'&&typeof _0x503102['limit']==='undefined';var _0x11db75=_0x10d289[_0x0e08('0x1f')];var _0xf75af9=_0x5ca950?0x0:_0x503102[_0x0e08('0x1e')];var _0x47b044=_0x5ca950?_0x10d289['count']:_0x503102[_0x0e08('0x1e')]+_0x503102[_0x0e08('0x20')];var _0x516a8f;if(_0x47b044>=_0x11db75){_0x47b044=_0x11db75;_0x516a8f=0xc8;}else{_0x516a8f=0xce;}_0x3f7571[_0x0e08('0x1c')](_0x516a8f);return _0x3f7571['set'](_0x0e08('0x21'),_0xf75af9+'-'+_0x47b044+'/'+_0x11db75)[_0x0e08('0x1d')](_0x10d289);}return null;};}function patchUpdates(_0x14f8ae){return function(_0x5776c0){try{jsonpatch[_0x0e08('0x22')](_0x5776c0,_0x14f8ae,!![]);}catch(_0x59b062){return BPromise['reject'](_0x59b062);}return _0x5776c0[_0x0e08('0x23')]();};}function saveUpdates(_0x355dea,_0x35d46d){return function(_0x173e08){if(_0x173e08){return _0x173e08[_0x0e08('0x24')](_0x355dea)[_0x0e08('0x25')](function(_0x3225e8){return _0x3225e8;});}return null;};}function removeEntity(_0x133db2,_0x121a94){return function(_0x126b6e){if(_0x126b6e){return _0x126b6e['destroy']()[_0x0e08('0x25')](function(){_0x133db2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3400d4,_0x1e425f){return function(_0x342d7f){if(!_0x342d7f){_0x3400d4['sendStatus'](0x194);}return _0x342d7f;};}function handleError(_0x556cb5,_0x34b195){_0x34b195=_0x34b195||0x1f4;return function(_0x23bf34){logger[_0x0e08('0x26')](_0x23bf34[_0x0e08('0x27')]);if(_0x23bf34[_0x0e08('0x28')]){delete _0x23bf34['name'];}_0x556cb5[_0x0e08('0x1c')](_0x34b195)['send'](_0x23bf34);};}exports[_0x0e08('0x29')]=function(_0x379766,_0x5bbbf3){var _0x2976d6={},_0x465fba={},_0x17a73b={'count':0x0,'rows':[]};var _0x180917=_[_0x0e08('0x2a')](db[_0x0e08('0x2b')]['rawAttributes'],function(_0x4ddbe1){return{'name':_0x4ddbe1[_0x0e08('0x2c')],'type':_0x4ddbe1[_0x0e08('0x2d')]['key']};});_0x465fba[_0x0e08('0x2e')]=_[_0x0e08('0x2a')](_0x180917,_0x0e08('0x28'));_0x465fba[_0x0e08('0x2f')]=_[_0x0e08('0x30')](_0x379766['query']);_0x465fba[_0x0e08('0x31')]=_['intersection'](_0x465fba[_0x0e08('0x2e')],_0x465fba[_0x0e08('0x2f')]);_0x2976d6[_0x0e08('0x32')]=_['intersection'](_0x465fba[_0x0e08('0x2e')],qs['fields'](_0x379766[_0x0e08('0x2f')]['fields']));_0x2976d6['attributes']=_0x2976d6[_0x0e08('0x32')][_0x0e08('0x33')]?_0x2976d6[_0x0e08('0x32')]:_0x465fba[_0x0e08('0x2e')];if(!_0x379766[_0x0e08('0x2f')]['hasOwnProperty'](_0x0e08('0x34'))){_0x2976d6[_0x0e08('0x20')]=qs[_0x0e08('0x20')](_0x379766[_0x0e08('0x2f')][_0x0e08('0x20')]);_0x2976d6[_0x0e08('0x1e')]=qs['offset'](_0x379766['query'][_0x0e08('0x1e')]);}_0x2976d6['order']=qs[_0x0e08('0x35')](_0x379766['query'][_0x0e08('0x35')]);_0x2976d6[_0x0e08('0x36')]=qs[_0x0e08('0x31')](_[_0x0e08('0x37')](_0x379766[_0x0e08('0x2f')],_0x465fba['filters']),_0x180917);if(_0x379766[_0x0e08('0x2f')][_0x0e08('0x38')]){_0x2976d6[_0x0e08('0x36')]=_[_0x0e08('0x39')](_0x2976d6[_0x0e08('0x36')],{'$or':_['map'](_0x180917,function(_0x3f2c97){if(_0x3f2c97['type']!==_0x0e08('0x3a')){var _0x4e4014={};_0x4e4014[_0x3f2c97[_0x0e08('0x28')]]={'$like':'%'+_0x379766[_0x0e08('0x2f')]['filter']+'%'};return _0x4e4014;}})});}_0x2976d6=_[_0x0e08('0x39')]({},_0x2976d6,_0x379766['options']);var _0x4b6df9={'where':_0x2976d6[_0x0e08('0x36')]};return db['SalesforceField'][_0x0e08('0x1f')](_0x4b6df9)[_0x0e08('0x25')](function(_0x5af8a4){_0x17a73b[_0x0e08('0x1f')]=_0x5af8a4;if(_0x379766[_0x0e08('0x2f')][_0x0e08('0x3b')]){_0x2976d6[_0x0e08('0x3c')]=[{'all':!![]}];}return db[_0x0e08('0x2b')][_0x0e08('0x3d')](_0x2976d6);})[_0x0e08('0x25')](function(_0x367c09){_0x17a73b['rows']=_0x367c09;return _0x17a73b;})['then'](respondWithFilteredResult(_0x5bbbf3,_0x2976d6))[_0x0e08('0x3e')](handleError(_0x5bbbf3,null));};exports[_0x0e08('0x3f')]=function(_0x3352ff,_0x1ce83d){var _0x52e2bb={'raw':!![],'where':{'id':_0x3352ff[_0x0e08('0x40')]['id']}},_0x4e007b={};_0x4e007b['model']=_[_0x0e08('0x30')](db[_0x0e08('0x2b')][_0x0e08('0x41')]);_0x4e007b[_0x0e08('0x2f')]=_[_0x0e08('0x30')](_0x3352ff[_0x0e08('0x2f')]);_0x4e007b[_0x0e08('0x31')]=_[_0x0e08('0x42')](_0x4e007b['model'],_0x4e007b[_0x0e08('0x2f')]);_0x52e2bb['attributes']=_[_0x0e08('0x42')](_0x4e007b[_0x0e08('0x2e')],qs['fields'](_0x3352ff['query'][_0x0e08('0x43')]));_0x52e2bb[_0x0e08('0x32')]=_0x52e2bb[_0x0e08('0x32')][_0x0e08('0x33')]?_0x52e2bb[_0x0e08('0x32')]:_0x4e007b[_0x0e08('0x2e')];if(_0x3352ff[_0x0e08('0x2f')][_0x0e08('0x3b')]){_0x52e2bb['include']=[{'all':!![]}];}_0x52e2bb=_[_0x0e08('0x39')]({},_0x52e2bb,_0x3352ff['options']);return db['SalesforceField']['find'](_0x52e2bb)[_0x0e08('0x25')](handleEntityNotFound(_0x1ce83d,null))['then'](respondWithResult(_0x1ce83d,null))['catch'](handleError(_0x1ce83d,null));};exports[_0x0e08('0x44')]=function(_0x5b3bc7,_0x35556c){return db['SalesforceField']['create'](_0x5b3bc7[_0x0e08('0x45')],{})[_0x0e08('0x25')](respondWithResult(_0x35556c,0xc9))[_0x0e08('0x3e')](handleError(_0x35556c,null));};exports['update']=function(_0x35c887,_0x2aba24){if(_0x35c887[_0x0e08('0x45')]['id']){delete _0x35c887[_0x0e08('0x45')]['id'];}return db[_0x0e08('0x2b')][_0x0e08('0x46')]({'where':{'id':_0x35c887[_0x0e08('0x40')]['id']}})['then'](handleEntityNotFound(_0x2aba24,null))[_0x0e08('0x25')](saveUpdates(_0x35c887[_0x0e08('0x45')],null))[_0x0e08('0x25')](respondWithResult(_0x2aba24,null))['catch'](handleError(_0x2aba24,null));};exports['destroy']=function(_0x16462d,_0x4e2f2a){return db['SalesforceField'][_0x0e08('0x46')]({'where':{'id':_0x16462d['params']['id']}})['then'](handleEntityNotFound(_0x4e2f2a,null))[_0x0e08('0x25')](removeEntity(_0x4e2f2a,null))[_0x0e08('0x3e')](handleError(_0x4e2f2a,null));};
\ No newline at end of file
+var _0x52c2=['jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','catch','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash'];(function(_0x32233b,_0x361754){var _0x31568a=function(_0x3ac4cb){while(--_0x3ac4cb){_0x32233b['push'](_0x32233b['shift']());}};_0x31568a(++_0x361754);}(_0x52c2,0x110));var _0x252c=function(_0x464c59,_0x42df36){_0x464c59=_0x464c59-0x0;var _0x1ecafd=_0x52c2[_0x464c59];return _0x1ecafd;};'use strict';var emlformat=require(_0x252c('0x0'));var rimraf=require(_0x252c('0x1'));var zipdir=require(_0x252c('0x2'));var jsonpatch=require(_0x252c('0x3'));var rp=require(_0x252c('0x4'));var moment=require('moment');var BPromise=require(_0x252c('0x5'));var Mustache=require('mustache');var util=require(_0x252c('0x6'));var path=require(_0x252c('0x7'));var sox=require(_0x252c('0x8'));var csv=require('to-csv');var ejs=require(_0x252c('0x9'));var fs=require('fs');var fs_extra=require(_0x252c('0xa'));var _=require(_0x252c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x252c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x252c('0xd'));var querystring=require(_0x252c('0xe'));var Papa=require(_0x252c('0xf'));var Redis=require(_0x252c('0x10'));var authService=require(_0x252c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x252c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x252c('0x13'))(_0x252c('0x14'));var utils=require(_0x252c('0x15'));var config=require(_0x252c('0x16'));var licenseUtil=require(_0x252c('0x17'));var db=require(_0x252c('0x18'))['db'];function respondWithStatusCode(_0xcbaa6a,_0x49b9e2){_0x49b9e2=_0x49b9e2||0xcc;return function(_0x2b4c08){if(_0x2b4c08){return _0xcbaa6a['sendStatus'](_0x49b9e2);}return _0xcbaa6a[_0x252c('0x19')](_0x49b9e2)[_0x252c('0x1a')]();};}function respondWithResult(_0xe7d5b,_0x4cf1ad){_0x4cf1ad=_0x4cf1ad||0xc8;return function(_0x49bc3d){if(_0x49bc3d){return _0xe7d5b[_0x252c('0x19')](_0x4cf1ad)[_0x252c('0x1b')](_0x49bc3d);}};}function respondWithFilteredResult(_0xfb2f9a,_0x25febf){return function(_0x5384c9){if(_0x5384c9){var _0x37eb3a=typeof _0x25febf[_0x252c('0x1c')]===_0x252c('0x1d')&&typeof _0x25febf[_0x252c('0x1e')]===_0x252c('0x1d');var _0x516186=_0x5384c9[_0x252c('0x1f')];var _0x54b89e=_0x37eb3a?0x0:_0x25febf[_0x252c('0x1c')];var _0x234840=_0x37eb3a?_0x5384c9[_0x252c('0x1f')]:_0x25febf['offset']+_0x25febf['limit'];var _0x12e15c;if(_0x234840>=_0x516186){_0x234840=_0x516186;_0x12e15c=0xc8;}else{_0x12e15c=0xce;}_0xfb2f9a[_0x252c('0x19')](_0x12e15c);return _0xfb2f9a[_0x252c('0x20')](_0x252c('0x21'),_0x54b89e+'-'+_0x234840+'/'+_0x516186)[_0x252c('0x1b')](_0x5384c9);}return null;};}function patchUpdates(_0x5981b5){return function(_0x3ee1d8){try{jsonpatch['apply'](_0x3ee1d8,_0x5981b5,!![]);}catch(_0x224261){return BPromise[_0x252c('0x22')](_0x224261);}return _0x3ee1d8[_0x252c('0x23')]();};}function saveUpdates(_0x47e6ae,_0x4e81a9){return function(_0x1969f8){if(_0x1969f8){return _0x1969f8[_0x252c('0x24')](_0x47e6ae)[_0x252c('0x25')](function(_0x4f9aa4){return _0x4f9aa4;});}return null;};}function removeEntity(_0x2d7bb1,_0x5f43db){return function(_0x6467cb){if(_0x6467cb){return _0x6467cb['destroy']()['then'](function(){_0x2d7bb1[_0x252c('0x19')](0xcc)[_0x252c('0x1a')]();});}};}function handleEntityNotFound(_0xfd702a,_0x2bc111){return function(_0x5e6efc){if(!_0x5e6efc){_0xfd702a['sendStatus'](0x194);}return _0x5e6efc;};}function handleError(_0x499665,_0x5a741b){_0x5a741b=_0x5a741b||0x1f4;return function(_0x30f801){logger[_0x252c('0x26')](_0x30f801[_0x252c('0x27')]);if(_0x30f801[_0x252c('0x28')]){delete _0x30f801['name'];}_0x499665[_0x252c('0x19')](_0x5a741b)[_0x252c('0x29')](_0x30f801);};}exports[_0x252c('0x2a')]=function(_0xff6437,_0x28841e){var _0x300858={},_0x1b11f7={},_0x2d5bf1={'count':0x0,'rows':[]};var _0x50ed8a=_[_0x252c('0x2b')](db[_0x252c('0x2c')][_0x252c('0x2d')],function(_0x549b72){return{'name':_0x549b72[_0x252c('0x2e')],'type':_0x549b72[_0x252c('0x2f')][_0x252c('0x30')]};});_0x1b11f7[_0x252c('0x31')]=_[_0x252c('0x2b')](_0x50ed8a,_0x252c('0x28'));_0x1b11f7[_0x252c('0x32')]=_[_0x252c('0x33')](_0xff6437[_0x252c('0x32')]);_0x1b11f7['filters']=_[_0x252c('0x34')](_0x1b11f7['model'],_0x1b11f7[_0x252c('0x32')]);_0x300858[_0x252c('0x35')]=_[_0x252c('0x34')](_0x1b11f7[_0x252c('0x31')],qs[_0x252c('0x36')](_0xff6437['query'][_0x252c('0x36')]));_0x300858['attributes']=_0x300858[_0x252c('0x35')][_0x252c('0x37')]?_0x300858[_0x252c('0x35')]:_0x1b11f7[_0x252c('0x31')];if(!_0xff6437[_0x252c('0x32')]['hasOwnProperty'](_0x252c('0x38'))){_0x300858[_0x252c('0x1e')]=qs[_0x252c('0x1e')](_0xff6437['query'][_0x252c('0x1e')]);_0x300858['offset']=qs['offset'](_0xff6437[_0x252c('0x32')]['offset']);}_0x300858['order']=qs[_0x252c('0x39')](_0xff6437[_0x252c('0x32')][_0x252c('0x39')]);_0x300858[_0x252c('0x3a')]=qs[_0x252c('0x3b')](_[_0x252c('0x3c')](_0xff6437[_0x252c('0x32')],_0x1b11f7[_0x252c('0x3b')]),_0x50ed8a);if(_0xff6437[_0x252c('0x32')][_0x252c('0x3d')]){_0x300858[_0x252c('0x3a')]=_[_0x252c('0x3e')](_0x300858[_0x252c('0x3a')],{'$or':_[_0x252c('0x2b')](_0x50ed8a,function(_0x138476){if(_0x138476['type']!=='VIRTUAL'){var _0x2caa76={};_0x2caa76[_0x138476['name']]={'$like':'%'+_0xff6437[_0x252c('0x32')]['filter']+'%'};return _0x2caa76;}})});}_0x300858=_[_0x252c('0x3e')]({},_0x300858,_0xff6437['options']);var _0x1812b5={'where':_0x300858[_0x252c('0x3a')]};return db['SalesforceField']['count'](_0x1812b5)[_0x252c('0x25')](function(_0x70fee7){_0x2d5bf1[_0x252c('0x1f')]=_0x70fee7;if(_0xff6437[_0x252c('0x32')][_0x252c('0x3f')]){_0x300858[_0x252c('0x40')]=[{'all':!![]}];}return db[_0x252c('0x2c')]['findAll'](_0x300858);})[_0x252c('0x25')](function(_0xd1fdae){_0x2d5bf1['rows']=_0xd1fdae;return _0x2d5bf1;})['then'](respondWithFilteredResult(_0x28841e,_0x300858))[_0x252c('0x41')](handleError(_0x28841e,null));};exports['show']=function(_0x558fd7,_0x4bb0a4){var _0x881d8f={'raw':!![],'where':{'id':_0x558fd7[_0x252c('0x42')]['id']}},_0x11d1bb={};_0x11d1bb[_0x252c('0x31')]=_[_0x252c('0x33')](db[_0x252c('0x2c')][_0x252c('0x2d')]);_0x11d1bb[_0x252c('0x32')]=_[_0x252c('0x33')](_0x558fd7[_0x252c('0x32')]);_0x11d1bb['filters']=_[_0x252c('0x34')](_0x11d1bb[_0x252c('0x31')],_0x11d1bb['query']);_0x881d8f[_0x252c('0x35')]=_[_0x252c('0x34')](_0x11d1bb[_0x252c('0x31')],qs['fields'](_0x558fd7['query']['fields']));_0x881d8f[_0x252c('0x35')]=_0x881d8f[_0x252c('0x35')][_0x252c('0x37')]?_0x881d8f[_0x252c('0x35')]:_0x11d1bb[_0x252c('0x31')];if(_0x558fd7[_0x252c('0x32')][_0x252c('0x3f')]){_0x881d8f[_0x252c('0x40')]=[{'all':!![]}];}_0x881d8f=_['merge']({},_0x881d8f,_0x558fd7[_0x252c('0x43')]);return db[_0x252c('0x2c')][_0x252c('0x44')](_0x881d8f)['then'](handleEntityNotFound(_0x4bb0a4,null))[_0x252c('0x25')](respondWithResult(_0x4bb0a4,null))[_0x252c('0x41')](handleError(_0x4bb0a4,null));};exports[_0x252c('0x45')]=function(_0x585970,_0x57f38c){return db['SalesforceField']['create'](_0x585970['body'],{})[_0x252c('0x25')](respondWithResult(_0x57f38c,0xc9))['catch'](handleError(_0x57f38c,null));};exports[_0x252c('0x24')]=function(_0x634618,_0x2cf8c7){if(_0x634618[_0x252c('0x46')]['id']){delete _0x634618[_0x252c('0x46')]['id'];}return db[_0x252c('0x2c')][_0x252c('0x44')]({'where':{'id':_0x634618[_0x252c('0x42')]['id']}})[_0x252c('0x25')](handleEntityNotFound(_0x2cf8c7,null))[_0x252c('0x25')](saveUpdates(_0x634618['body'],null))[_0x252c('0x25')](respondWithResult(_0x2cf8c7,null))[_0x252c('0x41')](handleError(_0x2cf8c7,null));};exports['destroy']=function(_0x172926,_0x11413a){return db[_0x252c('0x2c')]['find']({'where':{'id':_0x172926[_0x252c('0x42')]['id']}})[_0x252c('0x25')](handleEntityNotFound(_0x11413a,null))[_0x252c('0x25')](removeEntity(_0x11413a,null))[_0x252c('0x41')](handleError(_0x11413a,null));};
\ No newline at end of file
index 00e1f73..807d91e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45d2=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x37464d,_0x29bf11){var _0x4e7573=function(_0x4de5e3){while(--_0x4de5e3){_0x37464d['push'](_0x37464d['shift']());}};_0x4e7573(++_0x29bf11);}(_0x45d2,0x127));var _0x245d=function(_0x5ca621,_0x565321){_0x5ca621=_0x5ca621-0x0;var _0x6603c0=_0x45d2[_0x5ca621];return _0x6603c0;};'use strict';var _=require(_0x245d('0x0'));var util=require('util');var logger=require(_0x245d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x245d('0x2'));var config=require(_0x245d('0x3'));var attributes=require(_0x245d('0x4'));module[_0x245d('0x5')]=function(_0x522b74,_0x3c8e43){return _0x522b74['define'](_0x245d('0x6'),attributes,{'tableName':_0x245d('0x7'),'paranoid':![],'indexes':[{'name':_0x245d('0x8'),'fields':[_0x245d('0x9'),_0x245d('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4938=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','idField','FieldId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4938,0xc3));var _0x8493=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0x4938[_0x29e0eb];return _0x597d2d;};'use strict';var _=require('lodash');var util=require(_0x8493('0x0'));var logger=require(_0x8493('0x1'))(_0x8493('0x2'));var moment=require(_0x8493('0x3'));var BPromise=require(_0x8493('0x4'));var rp=require(_0x8493('0x5'));var fs=require('fs');var path=require(_0x8493('0x6'));var rimraf=require(_0x8493('0x7'));var config=require(_0x8493('0x8'));var attributes=require(_0x8493('0x9'));module[_0x8493('0xa')]=function(_0x234d28,_0x2c1ec3){return _0x234d28['define']('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x8493('0xb'),_0x8493('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index f6056d1..120d3de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80a2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','SalesforceField,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','lodash','moment'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x80a2,0x1ca));var _0x280a=function(_0x4e3246,_0x244bd3){_0x4e3246=_0x4e3246-0x0;var _0x3f680b=_0x80a2[_0x4e3246];return _0x3f680b;};'use strict';var _=require(_0x280a('0x0'));var util=require('util');var moment=require(_0x280a('0x1'));var BPromise=require(_0x280a('0x2'));var rs=require(_0x280a('0x3'));var fs=require('fs');var Redis=require(_0x280a('0x4'));var db=require(_0x280a('0x5'))['db'];var utils=require(_0x280a('0x6'));var logger=require(_0x280a('0x7'))('rpc');var config=require(_0x280a('0x8'));var jayson=require(_0x280a('0x9'));var client=jayson[_0x280a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x114746,_0x1d3cf4,_0x17345a){return new BPromise(function(_0x222f7e,_0x3632eb){return client[_0x280a('0xb')](_0x114746,_0x17345a)['then'](function(_0x451ebd){logger[_0x280a('0xc')](_0x280a('0xd'),_0x1d3cf4,'request\x20sent');logger[_0x280a('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x1d3cf4,'request\x20sent',JSON['stringify'](_0x451ebd));if(_0x451ebd[_0x280a('0xf')]){if(_0x451ebd[_0x280a('0xf')]['code']===0x1f4){logger[_0x280a('0xf')]('SalesforceField,\x20%s,\x20%s',_0x1d3cf4,_0x451ebd[_0x280a('0xf')][_0x280a('0x10')]);return _0x3632eb(_0x451ebd[_0x280a('0xf')][_0x280a('0x10')]);}logger[_0x280a('0xf')](_0x280a('0xd'),_0x1d3cf4,_0x451ebd[_0x280a('0xf')][_0x280a('0x10')]);return _0x222f7e(_0x451ebd[_0x280a('0xf')][_0x280a('0x10')]);}else{logger[_0x280a('0xc')]('SalesforceField,\x20%s,\x20%s',_0x1d3cf4,_0x280a('0x11'));_0x222f7e(_0x451ebd[_0x280a('0x12')]['message']);}})[_0x280a('0x13')](function(_0x592bf1){logger['error']('SalesforceField,\x20%s,\x20%s',_0x1d3cf4,_0x592bf1);_0x3632eb(_0x592bf1);});});}
\ No newline at end of file
+var _0x0a22=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment'];(function(_0xa21528,_0x5702a5){var _0x51dc87=function(_0x451abc){while(--_0x451abc){_0xa21528['push'](_0xa21528['shift']());}};_0x51dc87(++_0x5702a5);}(_0x0a22,0xe8));var _0x20a2=function(_0x531ee2,_0x48c7ff){_0x531ee2=_0x531ee2-0x0;var _0x4e2fc8=_0x0a22[_0x531ee2];return _0x4e2fc8;};'use strict';var _=require('lodash');var util=require(_0x20a2('0x0'));var moment=require(_0x20a2('0x1'));var BPromise=require('bluebird');var rs=require(_0x20a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20a2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x20a2('0x4'))('rpc');var config=require(_0x20a2('0x5'));var jayson=require(_0x20a2('0x6'));var client=jayson[_0x20a2('0x7')][_0x20a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11aeff,_0x49f0fb,_0x5986b3){return new BPromise(function(_0x23341d,_0x4a781a){return client['request'](_0x11aeff,_0x5986b3)['then'](function(_0x16b81f){logger[_0x20a2('0x9')](_0x20a2('0xa'),_0x49f0fb,_0x20a2('0xb'));logger[_0x20a2('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x49f0fb,'request\x20sent',JSON['stringify'](_0x16b81f));if(_0x16b81f[_0x20a2('0xd')]){if(_0x16b81f[_0x20a2('0xd')][_0x20a2('0xe')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x49f0fb,_0x16b81f[_0x20a2('0xd')][_0x20a2('0xf')]);return _0x4a781a(_0x16b81f[_0x20a2('0xd')]['message']);}logger[_0x20a2('0xd')](_0x20a2('0xa'),_0x49f0fb,_0x16b81f[_0x20a2('0xd')][_0x20a2('0xf')]);return _0x23341d(_0x16b81f['error']['message']);}else{logger[_0x20a2('0x9')](_0x20a2('0xa'),_0x49f0fb,'request\x20sent');_0x23341d(_0x16b81f[_0x20a2('0x10')][_0x20a2('0xf')]);}})[_0x20a2('0x11')](function(_0x57f2fd){logger[_0x20a2('0xd')]('SalesforceField,\x20%s,\x20%s',_0x49f0fb,_0x57f2fd);_0x4a781a(_0x57f2fd);});});}
\ No newline at end of file
index 7ab8ea5..77794ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c0e=['post','create','/:id/configurations','addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','get','show','getConfigurations','/:id/fields','getFields'];(function(_0x126ee1,_0x4b9781){var _0x32524c=function(_0x2c7b1e){while(--_0x2c7b1e){_0x126ee1['push'](_0x126ee1['shift']());}};_0x32524c(++_0x4b9781);}(_0x4c0e,0x128));var _0xe4c0=function(_0xa74e4c,_0x152094){_0xa74e4c=_0xa74e4c-0x0;var _0x5aceaa=_0x4c0e[_0xa74e4c];return _0x5aceaa;};'use strict';var multer=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var path=require(_0xe4c0('0x2'));var timeout=require(_0xe4c0('0x3'));var express=require(_0xe4c0('0x4'));var router=express[_0xe4c0('0x5')]();var fs_extra=require(_0xe4c0('0x6'));var auth=require(_0xe4c0('0x7'));var interaction=require(_0xe4c0('0x8'));var config=require('../../config/environment');var controller=require(_0xe4c0('0x9'));router['get']('/',auth[_0xe4c0('0xa')](),controller['index']);router[_0xe4c0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe4c0('0xc')]);router[_0xe4c0('0xb')]('/:id/configurations',auth[_0xe4c0('0xa')](),controller[_0xe4c0('0xd')]);router[_0xe4c0('0xb')](_0xe4c0('0xe'),auth['isAuthenticated'](),controller[_0xe4c0('0xf')]);router[_0xe4c0('0x10')]('/',auth[_0xe4c0('0xa')](),controller[_0xe4c0('0x11')]);router[_0xe4c0('0x10')](_0xe4c0('0x12'),auth[_0xe4c0('0xa')](),controller[_0xe4c0('0x13')]);router[_0xe4c0('0x14')](_0xe4c0('0x15'),auth[_0xe4c0('0xa')](),controller['update']);router[_0xe4c0('0x16')](_0xe4c0('0x15'),auth[_0xe4c0('0xa')](),controller[_0xe4c0('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x82ee=['../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4e21ba,_0x18097f){var _0x55b94b=function(_0x3b9add){while(--_0x3b9add){_0x4e21ba['push'](_0x4e21ba['shift']());}};_0x55b94b(++_0x18097f);}(_0x82ee,0xeb));var _0xe82e=function(_0x1be7af,_0x2c2b51){_0x1be7af=_0x1be7af-0x0;var _0x12b517=_0x82ee[_0x1be7af];return _0x12b517;};'use strict';var multer=require('multer');var util=require(_0xe82e('0x0'));var path=require(_0xe82e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe82e('0x2'));var router=express[_0xe82e('0x3')]();var fs_extra=require(_0xe82e('0x4'));var auth=require(_0xe82e('0x5'));var interaction=require(_0xe82e('0x6'));var config=require(_0xe82e('0x7'));var controller=require(_0xe82e('0x8'));router[_0xe82e('0x9')]('/',auth[_0xe82e('0xa')](),controller['index']);router[_0xe82e('0x9')](_0xe82e('0xb'),auth[_0xe82e('0xa')](),controller['show']);router[_0xe82e('0x9')](_0xe82e('0xc'),auth[_0xe82e('0xa')](),controller['getConfigurations']);router[_0xe82e('0x9')](_0xe82e('0xd'),auth[_0xe82e('0xa')](),controller['getFields']);router[_0xe82e('0xe')]('/',auth['isAuthenticated'](),controller[_0xe82e('0xf')]);router['post'](_0xe82e('0xc'),auth['isAuthenticated'](),controller[_0xe82e('0x10')]);router[_0xe82e('0x11')](_0xe82e('0xb'),auth['isAuthenticated'](),controller[_0xe82e('0x12')]);router[_0xe82e('0x13')](_0xe82e('0xb'),auth[_0xe82e('0xa')](),controller[_0xe82e('0x14')]);module[_0xe82e('0x15')]=router;
\ No newline at end of file
index ad37b19..4eeb779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3df=['sequelize','exports','STRING','username'];(function(_0x140fd6,_0x5d8037){var _0x16a6ad=function(_0x5adbf7){while(--_0x5adbf7){_0x140fd6['push'](_0x140fd6['shift']());}};_0x16a6ad(++_0x5d8037);}(_0xc3df,0x178));var _0xfc3d=function(_0x3bfe1e,_0x4caabe){_0x3bfe1e=_0x3bfe1e-0x0;var _0x4ea26d=_0xc3df[_0x3bfe1e];return _0x4ea26d;};'use strict';var Sequelize=require(_0xfc3d('0x0'));module[_0xfc3d('0x1')]={'name':{'type':Sequelize[_0xfc3d('0x2')]},'description':{'type':Sequelize[_0xfc3d('0x2')]},'username':{'type':Sequelize[_0xfc3d('0x2')],'unique':_0xfc3d('0x3')},'password':{'type':Sequelize[_0xfc3d('0x2')]},'email':{'type':Sequelize[_0xfc3d('0x2')]},'remoteUri':{'type':Sequelize[_0xfc3d('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x1201=['sequelize','exports','STRING','username'];(function(_0x28301a,_0x46181b){var _0x48b8c3=function(_0x47bf1d){while(--_0x47bf1d){_0x28301a['push'](_0x28301a['shift']());}};_0x48b8c3(++_0x46181b);}(_0x1201,0xb4));var _0x1120=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x1201[_0xdd82b4];return _0x549bb2;};'use strict';var Sequelize=require(_0x1120('0x0'));module[_0x1120('0x1')]={'name':{'type':Sequelize[_0x1120('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1120('0x2')],'unique':_0x1120('0x3')},'password':{'type':Sequelize[_0x1120('0x2')]},'email':{'type':Sequelize[_0x1120('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 47a23cf..73ef29e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc079=['getDescriptions','getFields','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_created_by','calendar_stc','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','work_start','assignment_group','business_stc','description','calendar_duration','notify','sys_class_name','closed_by','follow_up','parent_incident','contact_type','urgency','company','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/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','includes','forEach','label','all','assign','log','internalType','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','type','Descriptions'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0xc079,0x1d3));var _0x9c07=function(_0x109e60,_0x1634ac){_0x109e60=_0x109e60-0x0;var _0x4b239d=_0xc079[_0x109e60];return _0x4b239d;};'use strict';var emlformat=require(_0x9c07('0x0'));var rimraf=require(_0x9c07('0x1'));var zipdir=require(_0x9c07('0x2'));var jsonpatch=require(_0x9c07('0x3'));var rp=require(_0x9c07('0x4'));var moment=require('moment');var BPromise=require(_0x9c07('0x5'));var Mustache=require(_0x9c07('0x6'));var util=require(_0x9c07('0x7'));var path=require(_0x9c07('0x8'));var sox=require('sox');var csv=require(_0x9c07('0x9'));var ejs=require(_0x9c07('0xa'));var fs=require('fs');var fs_extra=require(_0x9c07('0xb'));var _=require(_0x9c07('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c07('0x9'));var querystring=require(_0x9c07('0xd'));var Papa=require(_0x9c07('0xe'));var Redis=require(_0x9c07('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9c07('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c07('0x11'))(_0x9c07('0x12'));var utils=require(_0x9c07('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9c07('0x14'));var db=require(_0x9c07('0x15'))['db'];var integrations=require(_0x9c07('0x16'));function respondWithStatusCode(_0x377785,_0x4eed23){_0x4eed23=_0x4eed23||0xcc;return function(_0x14b73e){if(_0x14b73e){return _0x377785[_0x9c07('0x17')](_0x4eed23);}return _0x377785['status'](_0x4eed23)[_0x9c07('0x18')]();};}function respondWithResult(_0x3b8b3e,_0x597a2b){_0x597a2b=_0x597a2b||0xc8;return function(_0x3abca3){if(_0x3abca3){return _0x3b8b3e[_0x9c07('0x19')](_0x597a2b)[_0x9c07('0x1a')](_0x3abca3);}};}function respondWithFilteredResult(_0x3199c3,_0x249b18){return function(_0x16c851){if(_0x16c851){var _0x1b4338=typeof _0x249b18[_0x9c07('0x1b')]===_0x9c07('0x1c')&&typeof _0x249b18[_0x9c07('0x1d')]===_0x9c07('0x1c');var _0xc3b6c3=_0x16c851[_0x9c07('0x1e')];var _0xcc0e41=_0x1b4338?0x0:_0x249b18[_0x9c07('0x1b')];var _0x46ddf3=_0x1b4338?_0x16c851['count']:_0x249b18[_0x9c07('0x1b')]+_0x249b18[_0x9c07('0x1d')];var _0x1e4df6;if(_0x46ddf3>=_0xc3b6c3){_0x46ddf3=_0xc3b6c3;_0x1e4df6=0xc8;}else{_0x1e4df6=0xce;}_0x3199c3[_0x9c07('0x19')](_0x1e4df6);return _0x3199c3[_0x9c07('0x1f')](_0x9c07('0x20'),_0xcc0e41+'-'+_0x46ddf3+'/'+_0xc3b6c3)[_0x9c07('0x1a')](_0x16c851);}return null;};}function patchUpdates(_0x50cfe1){return function(_0x5f2b92){try{jsonpatch[_0x9c07('0x21')](_0x5f2b92,_0x50cfe1,!![]);}catch(_0x452409){return BPromise['reject'](_0x452409);}return _0x5f2b92['save']();};}function saveUpdates(_0x353f86,_0x26484a){return function(_0x4efe71){if(_0x4efe71){return _0x4efe71[_0x9c07('0x22')](_0x353f86)[_0x9c07('0x23')](function(_0x3fbf95){return _0x3fbf95;});}return null;};}function removeEntity(_0x549aad,_0x4413a1){return function(_0x34a0ad){if(_0x34a0ad){return _0x34a0ad['destroy']()['then'](function(){_0x549aad[_0x9c07('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f4f4a,_0x5969c6){return function(_0x3c603a){if(!_0x3c603a){_0x4f4f4a[_0x9c07('0x17')](0x194);}return _0x3c603a;};}function handleError(_0x362952,_0x313b75){_0x313b75=_0x313b75||0x1f4;return function(_0x46b961){logger[_0x9c07('0x24')](_0x46b961[_0x9c07('0x25')]);if(_0x46b961['name']){delete _0x46b961[_0x9c07('0x26')];}_0x362952[_0x9c07('0x19')](_0x313b75)[_0x9c07('0x27')](_0x46b961);};}exports['index']=function(_0x4b5d9e,_0xdefba4){var _0x27d0be={},_0x3d2ced={},_0x3b99c={'count':0x0,'rows':[]};var _0x5a2cf3=_[_0x9c07('0x28')](db[_0x9c07('0x29')][_0x9c07('0x2a')],function(_0x371da7){return{'name':_0x371da7[_0x9c07('0x2b')],'type':_0x371da7['type'][_0x9c07('0x2c')]};});_0x3d2ced[_0x9c07('0x2d')]=_['map'](_0x5a2cf3,_0x9c07('0x26'));_0x3d2ced[_0x9c07('0x2e')]=_[_0x9c07('0x2f')](_0x4b5d9e['query']);_0x3d2ced[_0x9c07('0x30')]=_[_0x9c07('0x31')](_0x3d2ced[_0x9c07('0x2d')],_0x3d2ced[_0x9c07('0x2e')]);_0x27d0be[_0x9c07('0x32')]=_[_0x9c07('0x31')](_0x3d2ced['model'],qs[_0x9c07('0x33')](_0x4b5d9e[_0x9c07('0x2e')][_0x9c07('0x33')]));_0x27d0be[_0x9c07('0x32')]=_0x27d0be[_0x9c07('0x32')][_0x9c07('0x34')]?_0x27d0be[_0x9c07('0x32')]:_0x3d2ced[_0x9c07('0x2d')];if(!_0x4b5d9e[_0x9c07('0x2e')]['hasOwnProperty'](_0x9c07('0x35'))){_0x27d0be['limit']=qs['limit'](_0x4b5d9e['query'][_0x9c07('0x1d')]);_0x27d0be[_0x9c07('0x1b')]=qs[_0x9c07('0x1b')](_0x4b5d9e[_0x9c07('0x2e')]['offset']);}_0x27d0be[_0x9c07('0x36')]=qs['sort'](_0x4b5d9e[_0x9c07('0x2e')][_0x9c07('0x37')]);_0x27d0be[_0x9c07('0x38')]=qs['filters'](_[_0x9c07('0x39')](_0x4b5d9e['query'],_0x3d2ced['filters']),_0x5a2cf3);if(_0x4b5d9e['query'][_0x9c07('0x3a')]){_0x27d0be[_0x9c07('0x38')]=_['merge'](_0x27d0be[_0x9c07('0x38')],{'$or':_[_0x9c07('0x28')](_0x5a2cf3,function(_0x3fff89){if(_0x3fff89['type']!==_0x9c07('0x3b')){var _0x1a22f5={};_0x1a22f5[_0x3fff89[_0x9c07('0x26')]]={'$like':'%'+_0x4b5d9e[_0x9c07('0x2e')]['filter']+'%'};return _0x1a22f5;}})});}_0x27d0be=_[_0x9c07('0x3c')]({},_0x27d0be,_0x4b5d9e[_0x9c07('0x3d')]);var _0x352cc0={'where':_0x27d0be[_0x9c07('0x38')]};return db[_0x9c07('0x29')][_0x9c07('0x1e')](_0x352cc0)[_0x9c07('0x23')](function(_0x7344fb){_0x3b99c[_0x9c07('0x1e')]=_0x7344fb;if(_0x4b5d9e['query'][_0x9c07('0x3e')]){_0x27d0be[_0x9c07('0x3f')]=[{'all':!![]}];}return db[_0x9c07('0x29')][_0x9c07('0x40')](_0x27d0be);})[_0x9c07('0x23')](function(_0xb0d3b6){_0x3b99c['rows']=_0xb0d3b6;return _0x3b99c;})[_0x9c07('0x23')](respondWithFilteredResult(_0xdefba4,_0x27d0be))[_0x9c07('0x41')](handleError(_0xdefba4,null));};exports[_0x9c07('0x42')]=function(_0x406806,_0x3d3c0b){var _0x5869ae={'raw':![],'where':{'id':_0x406806[_0x9c07('0x43')]['id']}},_0x10b955={};_0x10b955[_0x9c07('0x2d')]=_['keys'](db[_0x9c07('0x29')][_0x9c07('0x2a')]);_0x10b955['query']=_[_0x9c07('0x2f')](_0x406806[_0x9c07('0x2e')]);_0x10b955[_0x9c07('0x30')]=_[_0x9c07('0x31')](_0x10b955[_0x9c07('0x2d')],_0x10b955[_0x9c07('0x2e')]);_0x5869ae[_0x9c07('0x32')]=_[_0x9c07('0x31')](_0x10b955['model'],qs[_0x9c07('0x33')](_0x406806[_0x9c07('0x2e')][_0x9c07('0x33')]));_0x5869ae[_0x9c07('0x32')]=_0x5869ae[_0x9c07('0x32')][_0x9c07('0x34')]?_0x5869ae[_0x9c07('0x32')]:_0x10b955[_0x9c07('0x2d')];if(_0x406806[_0x9c07('0x2e')][_0x9c07('0x3e')]){_0x5869ae[_0x9c07('0x3f')]=[{'all':!![]}];}_0x5869ae=_[_0x9c07('0x3c')]({},_0x5869ae,_0x406806[_0x9c07('0x3d')]);return db[_0x9c07('0x29')][_0x9c07('0x44')](_0x5869ae)[_0x9c07('0x23')](handleEntityNotFound(_0x3d3c0b,null))[_0x9c07('0x23')](respondWithResult(_0x3d3c0b,null))[_0x9c07('0x41')](handleError(_0x3d3c0b,null));};exports[_0x9c07('0x45')]=function(_0x2a880c,_0x678520){return db[_0x9c07('0x29')]['create'](_0x2a880c[_0x9c07('0x46')],{})[_0x9c07('0x23')](respondWithResult(_0x678520,0xc9))['catch'](handleError(_0x678520,null));};exports[_0x9c07('0x22')]=function(_0x128a10,_0x5d8fcd){if(_0x128a10[_0x9c07('0x46')]['id']){delete _0x128a10[_0x9c07('0x46')]['id'];}return db[_0x9c07('0x29')][_0x9c07('0x44')]({'where':{'id':_0x128a10[_0x9c07('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d8fcd,null))['then'](saveUpdates(_0x128a10[_0x9c07('0x46')],null))[_0x9c07('0x23')](respondWithResult(_0x5d8fcd,null))[_0x9c07('0x41')](handleError(_0x5d8fcd,null));};exports[_0x9c07('0x47')]=function(_0xcd6b5,_0x46a6da){return db[_0x9c07('0x29')][_0x9c07('0x44')]({'where':{'id':_0xcd6b5['params']['id']}})[_0x9c07('0x23')](handleEntityNotFound(_0x46a6da,null))[_0x9c07('0x23')](removeEntity(_0x46a6da,null))['catch'](handleError(_0x46a6da,null));};exports[_0x9c07('0x48')]=function(_0x56fa43,_0x5459d9,_0x57131f){var _0x5ea1aa={};var _0x1830e7={};var _0x135e66;var _0x2b8377;return db[_0x9c07('0x29')][_0x9c07('0x49')]({'where':{'id':_0x56fa43['params']['id']}})[_0x9c07('0x23')](handleEntityNotFound(_0x5459d9,null))[_0x9c07('0x23')](function(_0x12e5a4){if(_0x12e5a4){_0x135e66=_0x12e5a4;_0x1830e7[_0x9c07('0x2d')]=_[_0x9c07('0x2f')](db[_0x9c07('0x4a')][_0x9c07('0x2a')]);_0x1830e7[_0x9c07('0x2e')]=_['keys'](_0x56fa43[_0x9c07('0x2e')]);_0x1830e7['filters']=_['intersection'](_0x1830e7['model'],_0x1830e7[_0x9c07('0x2e')]);_0x5ea1aa['attributes']=_[_0x9c07('0x31')](_0x1830e7[_0x9c07('0x2d')],qs[_0x9c07('0x33')](_0x56fa43[_0x9c07('0x2e')][_0x9c07('0x33')]));_0x5ea1aa['attributes']=_0x5ea1aa[_0x9c07('0x32')][_0x9c07('0x34')]?_0x5ea1aa[_0x9c07('0x32')]:_0x1830e7[_0x9c07('0x2d')];_0x5ea1aa[_0x9c07('0x36')]=qs[_0x9c07('0x37')](_0x56fa43[_0x9c07('0x2e')][_0x9c07('0x37')]);_0x5ea1aa['where']=qs['filters'](_[_0x9c07('0x39')](_0x56fa43[_0x9c07('0x2e')],_0x1830e7[_0x9c07('0x30')]));if(_0x56fa43[_0x9c07('0x2e')][_0x9c07('0x3a')]){_0x5ea1aa[_0x9c07('0x38')]=_['merge'](_0x5ea1aa[_0x9c07('0x38')],{'$or':_[_0x9c07('0x28')](_0x5ea1aa[_0x9c07('0x32')],function(_0x5722ca){var _0xc0f60e={};_0xc0f60e[_0x5722ca]={'$like':'%'+_0x56fa43[_0x9c07('0x2e')][_0x9c07('0x3a')]+'%'};return _0xc0f60e;})});}_0x5ea1aa=_[_0x9c07('0x3c')]({},_0x5ea1aa,_0x56fa43['options']);return _0x135e66[_0x9c07('0x48')](_0x5ea1aa);}})['then'](function(_0x3a7661){if(_0x3a7661){_0x2b8377=_0x3a7661[_0x9c07('0x34')];if(!_0x56fa43[_0x9c07('0x2e')][_0x9c07('0x4b')]('nolimit')){_0x5ea1aa[_0x9c07('0x1d')]=qs[_0x9c07('0x1d')](_0x56fa43[_0x9c07('0x2e')]['limit']);_0x5ea1aa[_0x9c07('0x1b')]=qs[_0x9c07('0x1b')](_0x56fa43[_0x9c07('0x2e')][_0x9c07('0x1b')]);}return _0x135e66['getConfigurations'](_0x5ea1aa);}})['then'](function(_0x40040f){if(_0x40040f){return _0x40040f?{'count':_0x2b8377,'rows':_0x40040f}:null;}})[_0x9c07('0x23')](respondWithResult(_0x5459d9,null))[_0x9c07('0x41')](handleError(_0x5459d9,null));};exports['addConfiguration']=function(_0x3b9a0b,_0x503a7d,_0x33c352){if(_0x3b9a0b['body']['id']){delete _0x3b9a0b[_0x9c07('0x46')]['id'];}return db[_0x9c07('0x29')][_0x9c07('0x49')]({'where':{'id':_0x3b9a0b[_0x9c07('0x43')]['id']}})[_0x9c07('0x23')](handleEntityNotFound(_0x503a7d,null))[_0x9c07('0x23')](function(_0x4b2b50){if(_0x4b2b50){_0x3b9a0b[_0x9c07('0x46')][_0x9c07('0x4c')]=_0x4b2b50['id'];_0x3b9a0b['body'][_0x9c07('0x4d')]=integrations[_0x9c07('0x4e')](_0x3b9a0b[_0x9c07('0x46')][_0x9c07('0x4f')],_0x3b9a0b[_0x9c07('0x46')][_0x9c07('0x50')]);_0x3b9a0b[_0x9c07('0x46')][_0x9c07('0x51')]=integrations[_0x9c07('0x52')](_0x3b9a0b[_0x9c07('0x46')][_0x9c07('0x4f')],_0x3b9a0b[_0x9c07('0x46')][_0x9c07('0x50')]);return db[_0x9c07('0x4a')]['create'](_0x3b9a0b[_0x9c07('0x46')],{'include':[{'model':db['ServicenowField'],'as':_0x9c07('0x4d')},{'model':db['ServicenowField'],'as':_0x9c07('0x51')}]});}return null;})[_0x9c07('0x23')](respondWithResult(_0x503a7d,null))[_0x9c07('0x41')](handleError(_0x503a7d,null));};exports[_0x9c07('0x53')]=function(_0x632213,_0x1968bb,_0x2fb4d2){var _0x6a8fbc=['made_sla',_0x9c07('0x54'),_0x9c07('0x55'),_0x9c07('0x56'),_0x9c07('0x57'),'notify',_0x9c07('0x58'),_0x9c07('0x59'),_0x9c07('0x5a')];var _0x4c9823=['parent',_0x9c07('0x5b'),_0x9c07('0x5c'),_0x9c07('0x5d'),_0x9c07('0x5e'),_0x9c07('0x5f'),'child_incidents','hold_reason',_0x9c07('0x60'),_0x9c07('0x61'),_0x9c07('0x62'),_0x9c07('0x63'),_0x9c07('0x64'),'user_input',_0x9c07('0x65'),'sys_domain','state',_0x9c07('0x66'),_0x9c07('0x55'),_0x9c07('0x36'),_0x9c07('0x67'),'closed_at','cmdb_ci',_0x9c07('0x68'),_0x9c07('0x69'),'active',_0x9c07('0x6a'),_0x9c07('0x6b'),_0x9c07('0x6c'),_0x9c07('0x6d'),'rfc',_0x9c07('0x6e'),_0x9c07('0x6f'),_0x9c07('0x70'),_0x9c07('0x71'),'group_list',_0x9c07('0x72'),_0x9c07('0x73'),_0x9c07('0x74'),_0x9c07('0x75'),_0x9c07('0x76'),_0x9c07('0x56'),'work_notes',_0x9c07('0x77'),_0x9c07('0x57'),_0x9c07('0x78'),'delivery_task',_0x9c07('0x79'),_0x9c07('0x7a'),_0x9c07('0x7b'),'additional_assignee_list',_0x9c07('0x7c'),_0x9c07('0x7d'),_0x9c07('0x7e'),_0x9c07('0x7f'),'close_notes',_0x9c07('0x80'),_0x9c07('0x81'),_0x9c07('0x82'),'sys_id',_0x9c07('0x83'),'reopened_by',_0x9c07('0x58'),_0x9c07('0x84'),'problem_id',_0x9c07('0x85'),'reassignment_count',_0x9c07('0x86'),_0x9c07('0x87'),_0x9c07('0x59'),_0x9c07('0x88'),_0x9c07('0x89'),_0x9c07('0x8a'),_0x9c07('0x8b'),_0x9c07('0x8c'),_0x9c07('0x8d'),_0x9c07('0x8e'),_0x9c07('0x8f'),_0x9c07('0x90'),_0x9c07('0x91'),_0x9c07('0x92'),_0x9c07('0x93'),_0x9c07('0x5a')];var _0x889eb1='';var _0x4190b5='';var _0x37069c=[];var _0x3f4269='';var _0x49a059='';var _0x2e081f=[];var _0x22750e='';var _0x7d5038='';var _0x18dbe8={};var _0x1112c3='';return db[_0x9c07('0x29')][_0x9c07('0x49')]({'where':{'id':_0x632213[_0x9c07('0x43')]['id']},'attributes':['id','username',_0x9c07('0x94'),_0x9c07('0x95'),'remoteUri',_0x9c07('0x96')]})[_0x9c07('0x23')](handleEntityNotFound(_0x1968bb,null))['then'](function(_0x430a30){if(_0x430a30){_0x1112c3=_0x430a30[_0x9c07('0x97')];var _0x35457e=_0x1112c3[_0x9c07('0x98')](-0x1);if(_0x35457e==='/'){_0x1112c3=_0x1112c3['substring'](0x0,_0x1112c3[_0x9c07('0x99')](_0x35457e));}_0x7d5038=util[_0x9c07('0x9a')](_0x9c07('0x9b'),_0x1112c3);_0x22750e=util[_0x9c07('0x9a')](_0x9c07('0x9c'),_0x1112c3);_0x18dbe8={'user':_0x430a30['username'],'pass':_0x430a30[_0x9c07('0x94')]};var _0x49eaa3={'method':_0x9c07('0x9d'),'uri':_0x7d5038+_0x9c07('0x9e'),'auth':_0x18dbe8,'json':!![]};return rp(_0x49eaa3);}})[_0x9c07('0x23')](function(_0xd6ea7c){if(_0xd6ea7c[_0x9c07('0x9f')]['length']>0x0){_0x889eb1=_0xd6ea7c[_0x9c07('0x9f')];}console['log'](_0x9c07('0xa0'),_0x889eb1);_0x2e081f=[];_0x4190b5=Object['assign']([],_0x889eb1);_[_0x9c07('0xa1')](_0x4190b5,function(_0x1938af){return!_0x6a8fbc[_0x9c07('0xa2')](_0x1938af[_0x9c07('0x26')]);});_0x4190b5[_0x9c07('0xa3')](function(_0x49ce4d){var _0x249d02=createFieldObject(_0x22750e,_0x18dbe8,_0x49ce4d['internalType'],_0x49ce4d['name'],_0x49ce4d[_0x9c07('0xa4')],![]);_0x2e081f['push'](_0x249d02);});return Promise[_0x9c07('0xa5')](_0x2e081f);})['then'](function(_0x2a966b){_0x37069c=_0x2a966b;_0x3f4269=Object[_0x9c07('0xa6')]([],_0x889eb1);console['log']('TCL:\x20_object',_0x889eb1);_[_0x9c07('0xa1')](_0x3f4269,function(_0x2fd787){return _0x4c9823[_0x9c07('0xa2')](_0x2fd787[_0x9c07('0x26')]);});console[_0x9c07('0xa7')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3f4269);_0x2e081f=[];_0x3f4269['forEach'](function(_0x103ff6){var _0x530ad6=createFieldObject(_0x22750e,_0x18dbe8,_0x103ff6[_0x9c07('0xa8')],_0x103ff6[_0x9c07('0x26')],_0x103ff6[_0x9c07('0xa4')],!![]);_0x2e081f[_0x9c07('0xa9')](_0x530ad6);});return Promise['all'](_0x2e081f);})[_0x9c07('0x23')](function(_0x4546e2){_0x49a059=_0x4546e2;var _0x8e7523=_0x37069c[_0x9c07('0xaa')](_0x49a059);return{'count':_0x8e7523[_0x9c07('0x34')],'rows':_0x8e7523};})[_0x9c07('0x23')](respondWithResult(_0x1968bb,null))[_0x9c07('0x41')](function(_0x7d90bf){console[_0x9c07('0xa7')](_0x9c07('0xab')+_0x7d90bf);var _0x503db0=_0x632213[_0x9c07('0x2e')][_0x9c07('0xac')]?0x1f4:_0x7d90bf[_0x9c07('0xad')]||0x1f4;logger[_0x9c07('0x24')](_0x7d90bf[_0x9c07('0x25')]);delete _0x7d90bf[_0x9c07('0x26')];if(_0x503db0===0x191){_0x503db0=0x190;}_0x1968bb['status'](_0x503db0)[_0x9c07('0x27')](_0x632213['query'][_0x9c07('0xac')]?{'message':_0x9c07('0xae'),'statusCode':_0x7d90bf[_0x9c07('0xad')]}:_0x7d90bf);});};function createFieldObject(_0x55005f,_0x33d02a,_0x147c41,_0x9edfd9,_0x506f92,_0x2934be){return new Promise(function(_0x216f22,_0x46fd93){var _0x5e4d4c={'id':_0x9edfd9,'name':_0x506f92,'custom':_0x2934be};if(_0x147c41===_0x9c07('0xaf')){_0x5e4d4c[_0x9c07('0x3d')]=[{'name':_0x9c07('0xb0'),'value':_0x9c07('0xb1')},{'name':_0x9c07('0xb2'),'value':_0x9c07('0xb3')}];_0x216f22(_0x5e4d4c);}else{var _0x5089b2={'method':'GET','uri':_0x55005f+_0x9c07('0xb4')+_0x9edfd9,'auth':_0x33d02a,'json':!![]};return rp(_0x5089b2)[_0x9c07('0x23')](function(_0xa72cbb){var _0x4eeee3=[];if(_0xa72cbb['result'][_0x9c07('0x34')]>0x0){_0xa72cbb[_0x9c07('0x9f')][_0x9c07('0xa3')](function(_0x420c12){if(_0x420c12[_0x9c07('0xb5')]===_0x9c07('0xb3')){var _0x4d0e77={'name':_0x420c12[_0x9c07('0xa4')],'value':_0x420c12[_0x9c07('0xb6')]};_0x4eeee3[_0x9c07('0xa9')](_0x4d0e77);}});}_0x5e4d4c[_0x9c07('0x3d')]=_0x4eeee3;if(_0x5e4d4c[_0x9c07('0x3d')][_0x9c07('0x34')]>0x0){_0x216f22(_0x5e4d4c);}else{if(_0x2934be==![]){_0x216f22();}else{_0x216f22(_0x5e4d4c);}}});}});}
\ No newline at end of file
+var _0x21e8=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','stack','name','index','map','ServicenowAccount','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','pick','nolimit','addConfiguration','getSubjects','channel','Descriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','closed_at','delivery_plan','impact','active','work_notes_list','priority','expected_start','group_list','work_end','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','calendar_duration','sys_class_name','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','all','concat','test','send','Wrong\x20credentials','true','False','false','value','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2565fb,_0x55c1ff){var _0x50fea3=function(_0x5bdb01){while(--_0x5bdb01){_0x2565fb['push'](_0x2565fb['shift']());}};_0x50fea3(++_0x55c1ff);}(_0x21e8,0x146));var _0x821e=function(_0x2d8512,_0x520e1a){_0x2d8512=_0x2d8512-0x0;var _0x441d4a=_0x21e8[_0x2d8512];return _0x441d4a;};'use strict';var emlformat=require(_0x821e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x821e('0x1'));var jsonpatch=require(_0x821e('0x2'));var rp=require(_0x821e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x821e('0x4'));var util=require(_0x821e('0x5'));var path=require('path');var sox=require(_0x821e('0x6'));var csv=require(_0x821e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x821e('0x8'));var _=require(_0x821e('0x9'));var squel=require('squel');var crypto=require(_0x821e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x821e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x821e('0xc'));var Papa=require(_0x821e('0xd'));var Redis=require(_0x821e('0xe'));var authService=require(_0x821e('0xf'));var qs=require(_0x821e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x821e('0x11'));var logger=require('../../config/logger')(_0x821e('0x12'));var utils=require(_0x821e('0x13'));var config=require(_0x821e('0x14'));var licenseUtil=require(_0x821e('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x821e('0x16'));function respondWithStatusCode(_0x25aad6,_0x1b5135){_0x1b5135=_0x1b5135||0xcc;return function(_0x13de0d){if(_0x13de0d){return _0x25aad6[_0x821e('0x17')](_0x1b5135);}return _0x25aad6[_0x821e('0x18')](_0x1b5135)[_0x821e('0x19')]();};}function respondWithResult(_0x26c7fd,_0x1a5234){_0x1a5234=_0x1a5234||0xc8;return function(_0x62d165){if(_0x62d165){return _0x26c7fd[_0x821e('0x18')](_0x1a5234)[_0x821e('0x1a')](_0x62d165);}};}function respondWithFilteredResult(_0x5b239d,_0x2f2c61){return function(_0x5c15a5){if(_0x5c15a5){var _0x429d22=typeof _0x2f2c61[_0x821e('0x1b')]===_0x821e('0x1c')&&typeof _0x2f2c61['limit']===_0x821e('0x1c');var _0x109e8f=_0x5c15a5[_0x821e('0x1d')];var _0x3c879c=_0x429d22?0x0:_0x2f2c61['offset'];var _0x47ec35=_0x429d22?_0x5c15a5[_0x821e('0x1d')]:_0x2f2c61['offset']+_0x2f2c61[_0x821e('0x1e')];var _0xd41f21;if(_0x47ec35>=_0x109e8f){_0x47ec35=_0x109e8f;_0xd41f21=0xc8;}else{_0xd41f21=0xce;}_0x5b239d[_0x821e('0x18')](_0xd41f21);return _0x5b239d[_0x821e('0x1f')](_0x821e('0x20'),_0x3c879c+'-'+_0x47ec35+'/'+_0x109e8f)[_0x821e('0x1a')](_0x5c15a5);}return null;};}function patchUpdates(_0x2cad73){return function(_0xab7cd8){try{jsonpatch[_0x821e('0x21')](_0xab7cd8,_0x2cad73,!![]);}catch(_0x3a9a2f){return BPromise['reject'](_0x3a9a2f);}return _0xab7cd8['save']();};}function saveUpdates(_0x470db4,_0x2f9af0){return function(_0x4b7b59){if(_0x4b7b59){return _0x4b7b59[_0x821e('0x22')](_0x470db4)[_0x821e('0x23')](function(_0x21a671){return _0x21a671;});}return null;};}function removeEntity(_0xe2e62a,_0x3e1b9f){return function(_0x5b4d81){if(_0x5b4d81){return _0x5b4d81[_0x821e('0x24')]()[_0x821e('0x23')](function(){_0xe2e62a[_0x821e('0x18')](0xcc)[_0x821e('0x19')]();});}};}function handleEntityNotFound(_0x17a7c2,_0x51e79c){return function(_0x34e679){if(!_0x34e679){_0x17a7c2[_0x821e('0x17')](0x194);}return _0x34e679;};}function handleError(_0x4c6e9b,_0x2eecb4){_0x2eecb4=_0x2eecb4||0x1f4;return function(_0x5f191e){logger['error'](_0x5f191e[_0x821e('0x25')]);if(_0x5f191e['name']){delete _0x5f191e[_0x821e('0x26')];}_0x4c6e9b[_0x821e('0x18')](_0x2eecb4)['send'](_0x5f191e);};}exports[_0x821e('0x27')]=function(_0x382dc1,_0x5b5200){var _0x799eea={},_0x3559c9={},_0x726752={'count':0x0,'rows':[]};var _0x369c3c=_[_0x821e('0x28')](db[_0x821e('0x29')][_0x821e('0x2a')],function(_0x22579b){return{'name':_0x22579b['fieldName'],'type':_0x22579b[_0x821e('0x2b')]['key']};});_0x3559c9['model']=_[_0x821e('0x28')](_0x369c3c,_0x821e('0x26'));_0x3559c9[_0x821e('0x2c')]=_[_0x821e('0x2d')](_0x382dc1[_0x821e('0x2c')]);_0x3559c9[_0x821e('0x2e')]=_['intersection'](_0x3559c9['model'],_0x3559c9['query']);_0x799eea['attributes']=_[_0x821e('0x2f')](_0x3559c9[_0x821e('0x30')],qs[_0x821e('0x31')](_0x382dc1[_0x821e('0x2c')][_0x821e('0x31')]));_0x799eea[_0x821e('0x32')]=_0x799eea[_0x821e('0x32')][_0x821e('0x33')]?_0x799eea[_0x821e('0x32')]:_0x3559c9['model'];if(!_0x382dc1['query'][_0x821e('0x34')]('nolimit')){_0x799eea[_0x821e('0x1e')]=qs[_0x821e('0x1e')](_0x382dc1[_0x821e('0x2c')][_0x821e('0x1e')]);_0x799eea[_0x821e('0x1b')]=qs['offset'](_0x382dc1['query'][_0x821e('0x1b')]);}_0x799eea[_0x821e('0x35')]=qs[_0x821e('0x36')](_0x382dc1[_0x821e('0x2c')][_0x821e('0x36')]);_0x799eea[_0x821e('0x37')]=qs[_0x821e('0x2e')](_['pick'](_0x382dc1[_0x821e('0x2c')],_0x3559c9[_0x821e('0x2e')]),_0x369c3c);if(_0x382dc1['query'][_0x821e('0x38')]){_0x799eea[_0x821e('0x37')]=_[_0x821e('0x39')](_0x799eea['where'],{'$or':_[_0x821e('0x28')](_0x369c3c,function(_0x176826){if(_0x176826[_0x821e('0x2b')]!==_0x821e('0x3a')){var _0x33f695={};_0x33f695[_0x176826[_0x821e('0x26')]]={'$like':'%'+_0x382dc1['query'][_0x821e('0x38')]+'%'};return _0x33f695;}})});}_0x799eea=_[_0x821e('0x39')]({},_0x799eea,_0x382dc1[_0x821e('0x3b')]);var _0x27bdd3={'where':_0x799eea[_0x821e('0x37')]};return db[_0x821e('0x29')][_0x821e('0x1d')](_0x27bdd3)[_0x821e('0x23')](function(_0xec751d){_0x726752[_0x821e('0x1d')]=_0xec751d;if(_0x382dc1['query'][_0x821e('0x3c')]){_0x799eea['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x821e('0x3d')](_0x799eea);})[_0x821e('0x23')](function(_0x169a27){_0x726752[_0x821e('0x3e')]=_0x169a27;return _0x726752;})[_0x821e('0x23')](respondWithFilteredResult(_0x5b5200,_0x799eea))[_0x821e('0x3f')](handleError(_0x5b5200,null));};exports['show']=function(_0x19809a,_0x4d258a){var _0x220f3b={'raw':![],'where':{'id':_0x19809a[_0x821e('0x40')]['id']}},_0x349dca={};_0x349dca[_0x821e('0x30')]=_[_0x821e('0x2d')](db[_0x821e('0x29')][_0x821e('0x2a')]);_0x349dca[_0x821e('0x2c')]=_[_0x821e('0x2d')](_0x19809a['query']);_0x349dca['filters']=_['intersection'](_0x349dca[_0x821e('0x30')],_0x349dca['query']);_0x220f3b[_0x821e('0x32')]=_['intersection'](_0x349dca[_0x821e('0x30')],qs['fields'](_0x19809a[_0x821e('0x2c')][_0x821e('0x31')]));_0x220f3b['attributes']=_0x220f3b['attributes']['length']?_0x220f3b[_0x821e('0x32')]:_0x349dca[_0x821e('0x30')];if(_0x19809a[_0x821e('0x2c')][_0x821e('0x3c')]){_0x220f3b['include']=[{'all':!![]}];}_0x220f3b=_['merge']({},_0x220f3b,_0x19809a[_0x821e('0x3b')]);return db[_0x821e('0x29')][_0x821e('0x41')](_0x220f3b)['then'](handleEntityNotFound(_0x4d258a,null))[_0x821e('0x23')](respondWithResult(_0x4d258a,null))[_0x821e('0x3f')](handleError(_0x4d258a,null));};exports['create']=function(_0x42bd44,_0x1f68af){return db['ServicenowAccount'][_0x821e('0x42')](_0x42bd44[_0x821e('0x43')],{})[_0x821e('0x23')](respondWithResult(_0x1f68af,0xc9))[_0x821e('0x3f')](handleError(_0x1f68af,null));};exports['update']=function(_0x383b16,_0x5129ca){if(_0x383b16[_0x821e('0x43')]['id']){delete _0x383b16[_0x821e('0x43')]['id'];}return db['ServicenowAccount'][_0x821e('0x41')]({'where':{'id':_0x383b16[_0x821e('0x40')]['id']}})[_0x821e('0x23')](handleEntityNotFound(_0x5129ca,null))[_0x821e('0x23')](saveUpdates(_0x383b16[_0x821e('0x43')],null))[_0x821e('0x23')](respondWithResult(_0x5129ca,null))[_0x821e('0x3f')](handleError(_0x5129ca,null));};exports[_0x821e('0x24')]=function(_0x5ac1fc,_0x1039eb){return db[_0x821e('0x29')][_0x821e('0x41')]({'where':{'id':_0x5ac1fc['params']['id']}})[_0x821e('0x23')](handleEntityNotFound(_0x1039eb,null))[_0x821e('0x23')](removeEntity(_0x1039eb,null))[_0x821e('0x3f')](handleError(_0x1039eb,null));};exports[_0x821e('0x44')]=function(_0x41ec28,_0x20155b,_0x111b8c){var _0x282604={};var _0xfe832b={};var _0x390768;var _0x48b478;return db[_0x821e('0x29')][_0x821e('0x45')]({'where':{'id':_0x41ec28[_0x821e('0x40')]['id']}})['then'](handleEntityNotFound(_0x20155b,null))[_0x821e('0x23')](function(_0x1c394b){if(_0x1c394b){_0x390768=_0x1c394b;_0xfe832b['model']=_[_0x821e('0x2d')](db[_0x821e('0x46')][_0x821e('0x2a')]);_0xfe832b[_0x821e('0x2c')]=_[_0x821e('0x2d')](_0x41ec28[_0x821e('0x2c')]);_0xfe832b[_0x821e('0x2e')]=_[_0x821e('0x2f')](_0xfe832b[_0x821e('0x30')],_0xfe832b[_0x821e('0x2c')]);_0x282604['attributes']=_['intersection'](_0xfe832b[_0x821e('0x30')],qs[_0x821e('0x31')](_0x41ec28[_0x821e('0x2c')][_0x821e('0x31')]));_0x282604[_0x821e('0x32')]=_0x282604['attributes'][_0x821e('0x33')]?_0x282604[_0x821e('0x32')]:_0xfe832b[_0x821e('0x30')];_0x282604[_0x821e('0x35')]=qs[_0x821e('0x36')](_0x41ec28[_0x821e('0x2c')]['sort']);_0x282604['where']=qs[_0x821e('0x2e')](_[_0x821e('0x47')](_0x41ec28['query'],_0xfe832b[_0x821e('0x2e')]));if(_0x41ec28[_0x821e('0x2c')][_0x821e('0x38')]){_0x282604[_0x821e('0x37')]=_[_0x821e('0x39')](_0x282604[_0x821e('0x37')],{'$or':_[_0x821e('0x28')](_0x282604['attributes'],function(_0x50d006){var _0x2106f2={};_0x2106f2[_0x50d006]={'$like':'%'+_0x41ec28[_0x821e('0x2c')][_0x821e('0x38')]+'%'};return _0x2106f2;})});}_0x282604=_[_0x821e('0x39')]({},_0x282604,_0x41ec28[_0x821e('0x3b')]);return _0x390768[_0x821e('0x44')](_0x282604);}})[_0x821e('0x23')](function(_0x1e4d6d){if(_0x1e4d6d){_0x48b478=_0x1e4d6d[_0x821e('0x33')];if(!_0x41ec28[_0x821e('0x2c')][_0x821e('0x34')](_0x821e('0x48'))){_0x282604['limit']=qs[_0x821e('0x1e')](_0x41ec28[_0x821e('0x2c')][_0x821e('0x1e')]);_0x282604[_0x821e('0x1b')]=qs['offset'](_0x41ec28[_0x821e('0x2c')][_0x821e('0x1b')]);}return _0x390768[_0x821e('0x44')](_0x282604);}})[_0x821e('0x23')](function(_0x41a651){if(_0x41a651){return _0x41a651?{'count':_0x48b478,'rows':_0x41a651}:null;}})[_0x821e('0x23')](respondWithResult(_0x20155b,null))[_0x821e('0x3f')](handleError(_0x20155b,null));};exports[_0x821e('0x49')]=function(_0x22ea6a,_0x318fa5,_0x2f44b3){if(_0x22ea6a[_0x821e('0x43')]['id']){delete _0x22ea6a[_0x821e('0x43')]['id'];}return db[_0x821e('0x29')][_0x821e('0x45')]({'where':{'id':_0x22ea6a[_0x821e('0x40')]['id']}})[_0x821e('0x23')](handleEntityNotFound(_0x318fa5,null))[_0x821e('0x23')](function(_0x117d36){if(_0x117d36){_0x22ea6a[_0x821e('0x43')]['AccountId']=_0x117d36['id'];_0x22ea6a['body']['Subjects']=integrations[_0x821e('0x4a')](_0x22ea6a[_0x821e('0x43')][_0x821e('0x4b')],_0x22ea6a[_0x821e('0x43')]['type']);_0x22ea6a[_0x821e('0x43')][_0x821e('0x4c')]=integrations['getDescriptions'](_0x22ea6a[_0x821e('0x43')]['channel'],_0x22ea6a[_0x821e('0x43')][_0x821e('0x2b')]);return db[_0x821e('0x46')][_0x821e('0x42')](_0x22ea6a[_0x821e('0x43')],{'include':[{'model':db[_0x821e('0x4d')],'as':_0x821e('0x4e')},{'model':db[_0x821e('0x4d')],'as':_0x821e('0x4c')}]});}return null;})[_0x821e('0x23')](respondWithResult(_0x318fa5,null))[_0x821e('0x3f')](handleError(_0x318fa5,null));};exports[_0x821e('0x4f')]=function(_0x2db5f5,_0x257544,_0x3252a5){var _0x542405=[_0x821e('0x50'),_0x821e('0x51'),_0x821e('0x52'),_0x821e('0x53'),_0x821e('0x54'),_0x821e('0x55'),_0x821e('0x56'),_0x821e('0x57'),_0x821e('0x58')];var _0x283290=[_0x821e('0x59'),'made_sla',_0x821e('0x5a'),'watch_list',_0x821e('0x5b'),_0x821e('0x5c'),_0x821e('0x5d'),_0x821e('0x51'),_0x821e('0x5e'),_0x821e('0x5f'),'resolved_by',_0x821e('0x60'),_0x821e('0x61'),'user_input',_0x821e('0x62'),_0x821e('0x63'),_0x821e('0x64'),_0x821e('0x65'),_0x821e('0x52'),_0x821e('0x35'),'calendar_stc',_0x821e('0x66'),'cmdb_ci',_0x821e('0x67'),_0x821e('0x68'),_0x821e('0x69'),_0x821e('0x6a'),'business_service',_0x821e('0x6b'),'sys_domain_path','rfc','time_worked',_0x821e('0x6c'),'opened_at','business_duration',_0x821e('0x6d'),_0x821e('0x6e'),'reopened_time','resolved_at',_0x821e('0x6f'),_0x821e('0x70'),_0x821e('0x53'),'work_notes',_0x821e('0x71'),_0x821e('0x54'),_0x821e('0x72'),_0x821e('0x73'),_0x821e('0x74'),_0x821e('0x75'),'business_stc',_0x821e('0x76'),'description',_0x821e('0x77'),_0x821e('0x55'),_0x821e('0x78'),'close_notes',_0x821e('0x79'),'follow_up',_0x821e('0x7a'),_0x821e('0x7b'),_0x821e('0x7c'),_0x821e('0x7d'),_0x821e('0x56'),_0x821e('0x7e'),_0x821e('0x7f'),_0x821e('0x80'),'reassignment_count',_0x821e('0x81'),_0x821e('0x82'),_0x821e('0x57'),_0x821e('0x83'),_0x821e('0x84'),'approval',_0x821e('0x85'),'due_date',_0x821e('0x86'),_0x821e('0x87'),_0x821e('0x88'),_0x821e('0x89'),_0x821e('0x8a'),_0x821e('0x8b'),'location',_0x821e('0x58')];var _0x2dd12b='';var _0x31529f='';var _0x364d09=[];var _0xeb2841='';var _0x1d80b0='';var _0x51c233=[];var _0x1019da='';var _0x1b9cbd='';var _0x575342={};var _0x3a0de7='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x2db5f5['params']['id']},'attributes':['id',_0x821e('0x8c'),'password',_0x821e('0x8d'),_0x821e('0x8e'),_0x821e('0x8f')]})['then'](handleEntityNotFound(_0x257544,null))[_0x821e('0x23')](function(_0x22f4fd){if(_0x22f4fd){_0x3a0de7=_0x22f4fd[_0x821e('0x8e')];var _0x3f70bc=_0x3a0de7[_0x821e('0x90')](-0x1);if(_0x3f70bc==='/'){_0x3a0de7=_0x3a0de7[_0x821e('0x91')](0x0,_0x3a0de7['lastIndexOf'](_0x3f70bc));}_0x1b9cbd=util['format']('%s/api/now/doc/table/schema/',_0x3a0de7);_0x1019da=util[_0x821e('0x92')](_0x821e('0x93'),_0x3a0de7);_0x575342={'user':_0x22f4fd[_0x821e('0x8c')],'pass':_0x22f4fd[_0x821e('0x94')]};var _0x26c9d9={'method':_0x821e('0x95'),'uri':_0x1b9cbd+_0x821e('0x96'),'auth':_0x575342,'json':!![]};return rp(_0x26c9d9);}})[_0x821e('0x23')](function(_0x36a2d0){if(_0x36a2d0['result'][_0x821e('0x33')]>0x0){_0x2dd12b=_0x36a2d0[_0x821e('0x97')];}console[_0x821e('0x98')](_0x821e('0x99'),_0x2dd12b);_0x51c233=[];_0x31529f=Object[_0x821e('0x9a')]([],_0x2dd12b);_[_0x821e('0x9b')](_0x31529f,function(_0x41e7e6){return!_0x542405[_0x821e('0x9c')](_0x41e7e6['name']);});_0x31529f[_0x821e('0x9d')](function(_0x4a3292){var _0x1362c6=createFieldObject(_0x1019da,_0x575342,_0x4a3292['internalType'],_0x4a3292[_0x821e('0x26')],_0x4a3292[_0x821e('0x9e')],![]);_0x51c233[_0x821e('0x9f')](_0x1362c6);});return Promise['all'](_0x51c233);})['then'](function(_0x559625){_0x364d09=_0x559625;_0xeb2841=Object[_0x821e('0x9a')]([],_0x2dd12b);console[_0x821e('0x98')]('TCL:\x20_object',_0x2dd12b);_[_0x821e('0x9b')](_0xeb2841,function(_0x26e717){return _0x283290[_0x821e('0x9c')](_0x26e717[_0x821e('0x26')]);});console[_0x821e('0x98')](_0x821e('0xa0'),_0xeb2841);_0x51c233=[];_0xeb2841[_0x821e('0x9d')](function(_0x33848e){var _0x45dd81=createFieldObject(_0x1019da,_0x575342,_0x33848e[_0x821e('0xa1')],_0x33848e[_0x821e('0x26')],_0x33848e[_0x821e('0x9e')],!![]);_0x51c233['push'](_0x45dd81);});return Promise[_0x821e('0xa2')](_0x51c233);})[_0x821e('0x23')](function(_0x59ffb9){_0x1d80b0=_0x59ffb9;var _0x4e2938=_0x364d09[_0x821e('0xa3')](_0x1d80b0);return{'count':_0x4e2938[_0x821e('0x33')],'rows':_0x4e2938};})[_0x821e('0x23')](respondWithResult(_0x257544,null))[_0x821e('0x3f')](function(_0x346157){console[_0x821e('0x98')]('ServiceNow\x20error:\x20'+_0x346157);var _0x798a65=_0x2db5f5[_0x821e('0x2c')][_0x821e('0xa4')]?0x1f4:_0x346157['statusCode']||0x1f4;logger['error'](_0x346157[_0x821e('0x25')]);delete _0x346157[_0x821e('0x26')];if(_0x798a65===0x191){_0x798a65=0x190;}_0x257544[_0x821e('0x18')](_0x798a65)[_0x821e('0xa5')](_0x2db5f5[_0x821e('0x2c')][_0x821e('0xa4')]?{'message':_0x821e('0xa6'),'statusCode':_0x346157['statusCode']}:_0x346157);});};function createFieldObject(_0x100029,_0x377e60,_0xd64f0d,_0x27943a,_0x2b43c6,_0x2f9246){return new Promise(function(_0x14f2bd,_0x55ac1f){var _0x2e4684={'id':_0x27943a,'name':_0x2b43c6,'custom':_0x2f9246};if(_0xd64f0d==='boolean'){_0x2e4684[_0x821e('0x3b')]=[{'name':'True','value':_0x821e('0xa7')},{'name':_0x821e('0xa8'),'value':_0x821e('0xa9')}];_0x14f2bd(_0x2e4684);}else{var _0x2208d9={'method':_0x821e('0x95'),'uri':_0x100029+'sys_choice?sysparm_query=name=incident^element='+_0x27943a,'auth':_0x377e60,'json':!![]};return rp(_0x2208d9)[_0x821e('0x23')](function(_0x1ebdfc){var _0x1832b0=[];if(_0x1ebdfc[_0x821e('0x97')][_0x821e('0x33')]>0x0){_0x1ebdfc['result'][_0x821e('0x9d')](function(_0x3de39f){if(_0x3de39f['inactive']===_0x821e('0xa9')){var _0x103170={'name':_0x3de39f[_0x821e('0x9e')],'value':_0x3de39f[_0x821e('0xaa')]};_0x1832b0[_0x821e('0x9f')](_0x103170);}});}_0x2e4684[_0x821e('0x3b')]=_0x1832b0;if(_0x2e4684['options'][_0x821e('0x33')]>0x0){_0x14f2bd(_0x2e4684);}else{if(_0x2f9246==![]){_0x14f2bd();}else{_0x14f2bd(_0x2e4684);}}});}});}
\ No newline at end of file
index 1212d9a..96f1b0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x7a54,0x106));var _0x47a5=function(_0x5b5d04,_0x444e55){_0x5b5d04=_0x5b5d04-0x0;var _0x2bf221=_0x7a54[_0x5b5d04];return _0x2bf221;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c09=['rimraf','../../config/environment','./intServicenowAccount.attributes','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2f31d0,_0x4fce9a){var _0x1d0256=function(_0x3f1ed5){while(--_0x3f1ed5){_0x2f31d0['push'](_0x2f31d0['shift']());}};_0x1d0256(++_0x4fce9a);}(_0x7c09,0x102));var _0x97c0=function(_0x3e01b5,_0x21e8ec){_0x3e01b5=_0x3e01b5-0x0;var _0x58ff1f=_0x7c09[_0x3e01b5];return _0x58ff1f;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x590368,_0x46fdd9){return _0x590368[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1ce1fe8..5ab0327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c2b=['ShowServicenowAccount','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','stringify'];(function(_0x56579d,_0x478feb){var _0x2187f1=function(_0x42d25c){while(--_0x42d25c){_0x56579d['push'](_0x56579d['shift']());}};_0x2187f1(++_0x478feb);}(_0x1c2b,0x1be));var _0xb1c2=function(_0x2d1d37,_0x1048d8){_0x2d1d37=_0x2d1d37-0x0;var _0x3e9649=_0x1c2b[_0x2d1d37];return _0x3e9649;};'use strict';var _=require('lodash');var util=require(_0xb1c2('0x0'));var moment=require(_0xb1c2('0x1'));var BPromise=require(_0xb1c2('0x2'));var rs=require(_0xb1c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1c2('0x4'))['db'];var utils=require(_0xb1c2('0x5'));var logger=require(_0xb1c2('0x6'))(_0xb1c2('0x7'));var config=require(_0xb1c2('0x8'));var jayson=require(_0xb1c2('0x9'));var client=jayson[_0xb1c2('0xa')][_0xb1c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d50d7,_0x491e84,_0x12c534){return new BPromise(function(_0x23ee25,_0x3043b8){return client[_0xb1c2('0xc')](_0x4d50d7,_0x12c534)[_0xb1c2('0xd')](function(_0xdb236f){logger['info'](_0xb1c2('0xe'),_0x491e84,_0xb1c2('0xf'));logger[_0xb1c2('0x10')](_0xb1c2('0x11'),_0x491e84,_0xb1c2('0xf'),JSON['stringify'](_0xdb236f));if(_0xdb236f['error']){if(_0xdb236f[_0xb1c2('0x12')][_0xb1c2('0x13')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x491e84,_0xdb236f[_0xb1c2('0x12')][_0xb1c2('0x14')]);return _0x3043b8(_0xdb236f[_0xb1c2('0x12')]['message']);}logger[_0xb1c2('0x12')](_0xb1c2('0xe'),_0x491e84,_0xdb236f[_0xb1c2('0x12')]['message']);return _0x23ee25(_0xdb236f[_0xb1c2('0x12')][_0xb1c2('0x14')]);}else{logger[_0xb1c2('0x15')](_0xb1c2('0xe'),_0x491e84,_0xb1c2('0xf'));_0x23ee25(_0xdb236f[_0xb1c2('0x16')][_0xb1c2('0x14')]);}})[_0xb1c2('0x17')](function(_0x12377b){logger['error'](_0xb1c2('0xe'),_0x491e84,_0x12377b);_0x3043b8(_0x12377b);});});}exports[_0xb1c2('0x18')]=function(_0x4e4cc4){var _0x3a1379=this;return new Promise(function(_0x218929,_0x11c26d){return db[_0xb1c2('0x19')][_0xb1c2('0x1a')]({'raw':_0x4e4cc4[_0xb1c2('0x1b')]?_0x4e4cc4[_0xb1c2('0x1b')][_0xb1c2('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e4cc4['options']?_0x4e4cc4['options'][_0xb1c2('0x1d')]||null:null,'attributes':_0x4e4cc4[_0xb1c2('0x1b')]?_0x4e4cc4['options'][_0xb1c2('0x1e')]||null:null,'limit':_0x4e4cc4[_0xb1c2('0x1b')]?_0x4e4cc4[_0xb1c2('0x1b')]['limit']||null:null,'include':_0x4e4cc4[_0xb1c2('0x1b')]?_0x4e4cc4[_0xb1c2('0x1b')][_0xb1c2('0x1f')]?_[_0xb1c2('0x20')](_0x4e4cc4[_0xb1c2('0x1b')][_0xb1c2('0x1f')],function(_0x33b2ba){return{'model':db[_0x33b2ba[_0xb1c2('0x21')]],'as':_0x33b2ba['as'],'attributes':_0x33b2ba['attributes'],'include':_0x33b2ba[_0xb1c2('0x1f')]?_['map'](_0x33b2ba['include'],function(_0x436720){return{'model':db[_0x436720[_0xb1c2('0x21')]],'as':_0x436720['as'],'attributes':_0x436720['attributes'],'include':_0x436720['include']?_[_0xb1c2('0x20')](_0x436720[_0xb1c2('0x1f')],function(_0x455775){return{'model':db[_0x455775[_0xb1c2('0x21')]],'as':_0x455775['as'],'attributes':_0x455775[_0xb1c2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a0570){logger['info']('GetServicenowAccount',_0x4e4cc4);logger[_0xb1c2('0x10')]('GetServicenowAccount',_0x4e4cc4,JSON[_0xb1c2('0x22')](_0x2a0570));_0x218929(_0x2a0570);})[_0xb1c2('0x17')](function(_0x245f14){logger['error'](_0xb1c2('0x18'),_0x245f14[_0xb1c2('0x14')],_0x4e4cc4);_0x11c26d(_0x3a1379[_0xb1c2('0x12')](0x1f4,_0x245f14['message']));});});};exports[_0xb1c2('0x23')]=function(_0x1b0bcd){var _0x21f037=this;return new Promise(function(_0xb85bb7,_0x59e96d){return db[_0xb1c2('0x19')][_0xb1c2('0x24')]({'raw':_0x1b0bcd[_0xb1c2('0x1b')]?_0x1b0bcd['options'][_0xb1c2('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b0bcd['options']?_0x1b0bcd[_0xb1c2('0x1b')][_0xb1c2('0x1d')]||null:null,'attributes':_0x1b0bcd['options']?_0x1b0bcd[_0xb1c2('0x1b')][_0xb1c2('0x1e')]||null:null,'include':_0x1b0bcd[_0xb1c2('0x1b')]?_0x1b0bcd['options'][_0xb1c2('0x1f')]?_[_0xb1c2('0x20')](_0x1b0bcd['options'][_0xb1c2('0x1f')],function(_0x2bd228){return{'model':db[_0x2bd228[_0xb1c2('0x21')]],'as':_0x2bd228['as'],'attributes':_0x2bd228[_0xb1c2('0x1e')],'include':_0x2bd228['include']?_[_0xb1c2('0x20')](_0x2bd228['include'],function(_0xb07ae8){return{'model':db[_0xb07ae8[_0xb1c2('0x21')]],'as':_0xb07ae8['as'],'attributes':_0xb07ae8[_0xb1c2('0x1e')],'include':_0xb07ae8['include']?_[_0xb1c2('0x20')](_0xb07ae8[_0xb1c2('0x1f')],function(_0x5ceed4){return{'model':db[_0x5ceed4[_0xb1c2('0x21')]],'as':_0x5ceed4['as'],'attributes':_0x5ceed4[_0xb1c2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb1c2('0xd')](function(_0x1de56f){logger['info'](_0xb1c2('0x23'),_0x1b0bcd);logger[_0xb1c2('0x10')](_0xb1c2('0x23'),_0x1b0bcd,JSON[_0xb1c2('0x22')](_0x1de56f));_0xb85bb7(_0x1de56f);})[_0xb1c2('0x17')](function(_0x64e3ce){logger[_0xb1c2('0x12')](_0xb1c2('0x23'),_0x64e3ce[_0xb1c2('0x14')],_0x1b0bcd);_0x59e96d(_0x21f037[_0xb1c2('0x12')](0x1f4,_0x64e3ce[_0xb1c2('0x14')]));});});};
\ No newline at end of file
+var _0x9a34=['ServicenowAccount','findAll','options','raw','limit','map','model','include','attributes','ShowServicenowAccount','find','where','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetServicenowAccount'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x9a34,0x16a));var _0x49a3=function(_0x3fb903,_0x31fdea){_0x3fb903=_0x3fb903-0x0;var _0x3fbb09=_0x9a34[_0x3fb903];return _0x3fbb09;};'use strict';var _=require(_0x49a3('0x0'));var util=require(_0x49a3('0x1'));var moment=require(_0x49a3('0x2'));var BPromise=require(_0x49a3('0x3'));var rs=require(_0x49a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x49a3('0x5'));var logger=require('../../config/logger')(_0x49a3('0x6'));var config=require(_0x49a3('0x7'));var jayson=require(_0x49a3('0x8'));var client=jayson[_0x49a3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d1b4c,_0x5121c2,_0xed825d){return new BPromise(function(_0x14d1d6,_0x550a8e){return client[_0x49a3('0xa')](_0x5d1b4c,_0xed825d)[_0x49a3('0xb')](function(_0x3d89c1){logger[_0x49a3('0xc')](_0x49a3('0xd'),_0x5121c2,'request\x20sent');logger[_0x49a3('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5121c2,_0x49a3('0xf'),JSON[_0x49a3('0x10')](_0x3d89c1));if(_0x3d89c1[_0x49a3('0x11')]){if(_0x3d89c1[_0x49a3('0x11')][_0x49a3('0x12')]===0x1f4){logger[_0x49a3('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x5121c2,_0x3d89c1['error'][_0x49a3('0x13')]);return _0x550a8e(_0x3d89c1[_0x49a3('0x11')][_0x49a3('0x13')]);}logger['error'](_0x49a3('0xd'),_0x5121c2,_0x3d89c1['error']['message']);return _0x14d1d6(_0x3d89c1[_0x49a3('0x11')][_0x49a3('0x13')]);}else{logger['info'](_0x49a3('0xd'),_0x5121c2,'request\x20sent');_0x14d1d6(_0x3d89c1[_0x49a3('0x14')][_0x49a3('0x13')]);}})[_0x49a3('0x15')](function(_0x45c3a7){logger[_0x49a3('0x11')](_0x49a3('0xd'),_0x5121c2,_0x45c3a7);_0x550a8e(_0x45c3a7);});});}exports[_0x49a3('0x16')]=function(_0x4ee5bc){var _0x1b17d6=this;return new Promise(function(_0x4b9c2c,_0x514a1b){return db[_0x49a3('0x17')][_0x49a3('0x18')]({'raw':_0x4ee5bc['options']?_0x4ee5bc[_0x49a3('0x19')][_0x49a3('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ee5bc[_0x49a3('0x19')]?_0x4ee5bc['options']['where']||null:null,'attributes':_0x4ee5bc[_0x49a3('0x19')]?_0x4ee5bc[_0x49a3('0x19')]['attributes']||null:null,'limit':_0x4ee5bc[_0x49a3('0x19')]?_0x4ee5bc[_0x49a3('0x19')][_0x49a3('0x1b')]||null:null,'include':_0x4ee5bc[_0x49a3('0x19')]?_0x4ee5bc[_0x49a3('0x19')]['include']?_[_0x49a3('0x1c')](_0x4ee5bc[_0x49a3('0x19')]['include'],function(_0x39ea23){return{'model':db[_0x39ea23[_0x49a3('0x1d')]],'as':_0x39ea23['as'],'attributes':_0x39ea23['attributes'],'include':_0x39ea23[_0x49a3('0x1e')]?_[_0x49a3('0x1c')](_0x39ea23[_0x49a3('0x1e')],function(_0x4db31f){return{'model':db[_0x4db31f['model']],'as':_0x4db31f['as'],'attributes':_0x4db31f[_0x49a3('0x1f')],'include':_0x4db31f[_0x49a3('0x1e')]?_[_0x49a3('0x1c')](_0x4db31f['include'],function(_0x1492e0){return{'model':db[_0x1492e0[_0x49a3('0x1d')]],'as':_0x1492e0['as'],'attributes':_0x1492e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x121969){logger[_0x49a3('0xc')](_0x49a3('0x16'),_0x4ee5bc);logger[_0x49a3('0xe')](_0x49a3('0x16'),_0x4ee5bc,JSON[_0x49a3('0x10')](_0x121969));_0x4b9c2c(_0x121969);})[_0x49a3('0x15')](function(_0x3736f1){logger[_0x49a3('0x11')](_0x49a3('0x16'),_0x3736f1[_0x49a3('0x13')],_0x4ee5bc);_0x514a1b(_0x1b17d6[_0x49a3('0x11')](0x1f4,_0x3736f1[_0x49a3('0x13')]));});});};exports[_0x49a3('0x20')]=function(_0x4a2764){var _0x34cef8=this;return new Promise(function(_0x215477,_0x1ef400){return db[_0x49a3('0x17')][_0x49a3('0x21')]({'raw':_0x4a2764[_0x49a3('0x19')]?_0x4a2764[_0x49a3('0x19')][_0x49a3('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a2764[_0x49a3('0x19')]?_0x4a2764['options'][_0x49a3('0x22')]||null:null,'attributes':_0x4a2764[_0x49a3('0x19')]?_0x4a2764[_0x49a3('0x19')][_0x49a3('0x1f')]||null:null,'include':_0x4a2764['options']?_0x4a2764['options'][_0x49a3('0x1e')]?_['map'](_0x4a2764[_0x49a3('0x19')][_0x49a3('0x1e')],function(_0x41701e){return{'model':db[_0x41701e['model']],'as':_0x41701e['as'],'attributes':_0x41701e[_0x49a3('0x1f')],'include':_0x41701e[_0x49a3('0x1e')]?_[_0x49a3('0x1c')](_0x41701e[_0x49a3('0x1e')],function(_0x123f06){return{'model':db[_0x123f06[_0x49a3('0x1d')]],'as':_0x123f06['as'],'attributes':_0x123f06['attributes'],'include':_0x123f06['include']?_['map'](_0x123f06['include'],function(_0x29f2dc){return{'model':db[_0x29f2dc[_0x49a3('0x1d')]],'as':_0x29f2dc['as'],'attributes':_0x29f2dc[_0x49a3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x49a3('0xb')](function(_0x184b9d){logger[_0x49a3('0xc')](_0x49a3('0x20'),_0x4a2764);logger['debug'](_0x49a3('0x20'),_0x4a2764,JSON['stringify'](_0x184b9d));_0x215477(_0x184b9d);})['catch'](function(_0x3bda86){logger['error'](_0x49a3('0x20'),_0x3bda86[_0x49a3('0x13')],_0x4a2764);_0x1ef400(_0x34cef8[_0x49a3('0x11')](0x1f4,_0x3bda86['message']));});});};
\ No newline at end of file
index 57161e0..e813f4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f6c=['get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowConfiguration.controller'];(function(_0x3672fd,_0x18429c){var _0x18d583=function(_0x573ddb){while(--_0x573ddb){_0x3672fd['push'](_0x3672fd['shift']());}};_0x18d583(++_0x18429c);}(_0x7f6c,0x1eb));var _0xc7f6=function(_0x328031,_0x1aef31){_0x328031=_0x328031-0x0;var _0x32b896=_0x7f6c[_0x328031];return _0x32b896;};'use strict';var multer=require(_0xc7f6('0x0'));var util=require(_0xc7f6('0x1'));var path=require(_0xc7f6('0x2'));var timeout=require(_0xc7f6('0x3'));var express=require(_0xc7f6('0x4'));var router=express[_0xc7f6('0x5')]();var fs_extra=require(_0xc7f6('0x6'));var auth=require(_0xc7f6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc7f6('0x8'));router[_0xc7f6('0x9')]('/',auth['isAuthenticated'](),controller[_0xc7f6('0xa')]);router[_0xc7f6('0x9')](_0xc7f6('0xb'),auth[_0xc7f6('0xc')](),controller[_0xc7f6('0xd')]);router[_0xc7f6('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc7f6('0xe')]);router[_0xc7f6('0x9')](_0xc7f6('0xf'),auth[_0xc7f6('0xc')](),controller[_0xc7f6('0x10')]);router[_0xc7f6('0x9')](_0xc7f6('0x11'),auth['isAuthenticated'](),controller[_0xc7f6('0x12')]);router[_0xc7f6('0x13')]('/',auth[_0xc7f6('0xc')](),controller[_0xc7f6('0x14')]);router[_0xc7f6('0x15')](_0xc7f6('0xb'),auth[_0xc7f6('0xc')](),controller[_0xc7f6('0x16')]);router[_0xc7f6('0x17')](_0xc7f6('0xb'),auth[_0xc7f6('0xc')](),controller['destroy']);module[_0xc7f6('0x18')]=router;
\ No newline at end of file
+var _0x0bb0=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','destroy','exports','util'];(function(_0x77d7d,_0x2d7035){var _0x4844e4=function(_0xc770f1){while(--_0xc770f1){_0x77d7d['push'](_0x77d7d['shift']());}};_0x4844e4(++_0x2d7035);}(_0x0bb0,0x113));var _0x00bb=function(_0x1d9808,_0x2a1a45){_0x1d9808=_0x1d9808-0x0;var _0x4e2d32=_0x0bb0[_0x1d9808];return _0x4e2d32;};'use strict';var multer=require('multer');var util=require(_0x00bb('0x0'));var path=require(_0x00bb('0x1'));var timeout=require(_0x00bb('0x2'));var express=require(_0x00bb('0x3'));var router=express[_0x00bb('0x4')]();var fs_extra=require(_0x00bb('0x5'));var auth=require(_0x00bb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x00bb('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x00bb('0x8')](),controller[_0x00bb('0x9')]);router[_0x00bb('0xa')](_0x00bb('0xb'),auth['isAuthenticated'](),controller[_0x00bb('0xc')]);router[_0x00bb('0xa')](_0x00bb('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x00bb('0xa')](_0x00bb('0xe'),auth[_0x00bb('0x8')](),controller[_0x00bb('0xf')]);router['get'](_0x00bb('0x10'),auth['isAuthenticated'](),controller[_0x00bb('0x11')]);router['post']('/',auth[_0x00bb('0x8')](),controller[_0x00bb('0x12')]);router[_0x00bb('0x13')](_0x00bb('0xb'),auth[_0x00bb('0x8')](),controller[_0x00bb('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x00bb('0x15')]);module[_0x00bb('0x16')]=router;
\ No newline at end of file
index 0731a19..45ac33f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eea=['STRING','sequelize','exports'];(function(_0x4d29a7,_0x378285){var _0x2a24c6=function(_0x44c240){while(--_0x44c240){_0x4d29a7['push'](_0x4d29a7['shift']());}};_0x2a24c6(++_0x378285);}(_0x1eea,0x157));var _0xa1ee=function(_0x44e6e3,_0x36a3fe){_0x44e6e3=_0x44e6e3-0x0;var _0x5256a7=_0x1eea[_0x44e6e3];return _0x5256a7;};'use strict';var Sequelize=require(_0xa1ee('0x0'));module[_0xa1ee('0x1')]={'name':{'type':Sequelize[_0xa1ee('0x2')]},'description':{'type':Sequelize[_0xa1ee('0x2')]}};
\ No newline at end of file
+var _0x82a6=['exports','STRING','sequelize'];(function(_0x256207,_0x494d43){var _0x888a8c=function(_0x4b1e9f){while(--_0x4b1e9f){_0x256207['push'](_0x256207['shift']());}};_0x888a8c(++_0x494d43);}(_0x82a6,0xd7));var _0x682a=function(_0x1e06c8,_0x2a1b74){_0x1e06c8=_0x1e06c8-0x0;var _0x2357a7=_0x82a6[_0x1e06c8];return _0x2357a7;};'use strict';var Sequelize=require(_0x682a('0x0'));module[_0x682a('0x1')]={'name':{'type':Sequelize[_0x682a('0x2')]},'description':{'type':Sequelize[_0x682a('0x2')]}};
\ No newline at end of file
index 73b5642..4755821 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a5d=['jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','ServicenowConfiguration','includeAll','include','findAll','catch','show','params','find','create','body','update','findOne','pick','filter','getFields','getSubjects','ServicenowField','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x1a5d,0x179));var _0xd1a5=function(_0x1f136d,_0x3d991f){_0x1f136d=_0x1f136d-0x0;var _0x5a091a=_0x1a5d[_0x1f136d];return _0x5a091a;};'use strict';var emlformat=require(_0xd1a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1a5('0x1'));var jsonpatch=require(_0xd1a5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd1a5('0x3'));var Mustache=require('mustache');var util=require(_0xd1a5('0x4'));var path=require(_0xd1a5('0x5'));var sox=require(_0xd1a5('0x6'));var csv=require(_0xd1a5('0x7'));var ejs=require(_0xd1a5('0x8'));var fs=require('fs');var fs_extra=require(_0xd1a5('0x9'));var _=require(_0xd1a5('0xa'));var squel=require(_0xd1a5('0xb'));var crypto=require(_0xd1a5('0xc'));var jsforce=require(_0xd1a5('0xd'));var deskjs=require(_0xd1a5('0xe'));var toCsv=require(_0xd1a5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd1a5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd1a5('0x10'));var as=require(_0xd1a5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1a5('0x12'))(_0xd1a5('0x13'));var utils=require(_0xd1a5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd1a5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x459393,_0x38fd8e){_0x38fd8e=_0x38fd8e||0xcc;return function(_0x1d9eb3){if(_0x1d9eb3){return _0x459393[_0xd1a5('0x16')](_0x38fd8e);}return _0x459393[_0xd1a5('0x17')](_0x38fd8e)[_0xd1a5('0x18')]();};}function respondWithResult(_0x108deb,_0x11dd81){_0x11dd81=_0x11dd81||0xc8;return function(_0x5cec72){if(_0x5cec72){return _0x108deb[_0xd1a5('0x17')](_0x11dd81)[_0xd1a5('0x19')](_0x5cec72);}};}function respondWithFilteredResult(_0x2972a7,_0x34b02f){return function(_0x3ec95a){if(_0x3ec95a){var _0x3a347c=typeof _0x34b02f[_0xd1a5('0x1a')]==='undefined'&&typeof _0x34b02f[_0xd1a5('0x1b')]==='undefined';var _0x624d86=_0x3ec95a[_0xd1a5('0x1c')];var _0x497a8f=_0x3a347c?0x0:_0x34b02f[_0xd1a5('0x1a')];var _0x4e01da=_0x3a347c?_0x3ec95a[_0xd1a5('0x1c')]:_0x34b02f['offset']+_0x34b02f[_0xd1a5('0x1b')];var _0x2ed058;if(_0x4e01da>=_0x624d86){_0x4e01da=_0x624d86;_0x2ed058=0xc8;}else{_0x2ed058=0xce;}_0x2972a7['status'](_0x2ed058);return _0x2972a7[_0xd1a5('0x1d')](_0xd1a5('0x1e'),_0x497a8f+'-'+_0x4e01da+'/'+_0x624d86)[_0xd1a5('0x19')](_0x3ec95a);}return null;};}function patchUpdates(_0x208709){return function(_0x55b8ee){try{jsonpatch[_0xd1a5('0x1f')](_0x55b8ee,_0x208709,!![]);}catch(_0x42346f){return BPromise[_0xd1a5('0x20')](_0x42346f);}return _0x55b8ee[_0xd1a5('0x21')]();};}function saveUpdates(_0x5ca483,_0x2b96d1){return function(_0x37dd26){if(_0x37dd26){return _0x37dd26['update'](_0x5ca483)['then'](function(_0x2456e1){return _0x2456e1;});}return null;};}function removeEntity(_0x1a6c05,_0x30d988){return function(_0x5710c0){if(_0x5710c0){return _0x5710c0[_0xd1a5('0x22')]()[_0xd1a5('0x23')](function(){_0x1a6c05[_0xd1a5('0x17')](0xcc)[_0xd1a5('0x18')]();});}};}function handleEntityNotFound(_0x3a8cb6,_0x1de56c){return function(_0x34c3aa){if(!_0x34c3aa){_0x3a8cb6['sendStatus'](0x194);}return _0x34c3aa;};}function handleError(_0x46c59e,_0x35b283){_0x35b283=_0x35b283||0x1f4;return function(_0x2599dd){logger[_0xd1a5('0x24')](_0x2599dd['stack']);if(_0x2599dd[_0xd1a5('0x25')]){delete _0x2599dd[_0xd1a5('0x25')];}_0x46c59e[_0xd1a5('0x17')](_0x35b283)[_0xd1a5('0x26')](_0x2599dd);};}exports[_0xd1a5('0x27')]=function(_0x564899,_0x2f6d27){var _0x52706f={},_0x284235={},_0x1f5411={'count':0x0,'rows':[]};var _0xa6990f=_[_0xd1a5('0x28')](db['ServicenowConfiguration'][_0xd1a5('0x29')],function(_0x5e2621){return{'name':_0x5e2621['fieldName'],'type':_0x5e2621[_0xd1a5('0x2a')][_0xd1a5('0x2b')]};});_0x284235['model']=_[_0xd1a5('0x28')](_0xa6990f,_0xd1a5('0x25'));_0x284235[_0xd1a5('0x2c')]=_[_0xd1a5('0x2d')](_0x564899['query']);_0x284235[_0xd1a5('0x2e')]=_['intersection'](_0x284235[_0xd1a5('0x2f')],_0x284235['query']);_0x52706f['attributes']=_[_0xd1a5('0x30')](_0x284235[_0xd1a5('0x2f')],qs['fields'](_0x564899[_0xd1a5('0x2c')][_0xd1a5('0x31')]));_0x52706f['attributes']=_0x52706f[_0xd1a5('0x32')][_0xd1a5('0x33')]?_0x52706f[_0xd1a5('0x32')]:_0x284235[_0xd1a5('0x2f')];if(!_0x564899[_0xd1a5('0x2c')][_0xd1a5('0x34')](_0xd1a5('0x35'))){_0x52706f[_0xd1a5('0x1b')]=qs[_0xd1a5('0x1b')](_0x564899[_0xd1a5('0x2c')][_0xd1a5('0x1b')]);_0x52706f[_0xd1a5('0x1a')]=qs['offset'](_0x564899[_0xd1a5('0x2c')][_0xd1a5('0x1a')]);}_0x52706f[_0xd1a5('0x36')]=qs[_0xd1a5('0x37')](_0x564899[_0xd1a5('0x2c')]['sort']);_0x52706f['where']=qs[_0xd1a5('0x2e')](_['pick'](_0x564899[_0xd1a5('0x2c')],_0x284235[_0xd1a5('0x2e')]),_0xa6990f);if(_0x564899[_0xd1a5('0x2c')]['filter']){_0x52706f['where']=_['merge'](_0x52706f[_0xd1a5('0x38')],{'$or':_['map'](_0xa6990f,function(_0xa0db23){if(_0xa0db23['type']!==_0xd1a5('0x39')){var _0x2d2f7c={};_0x2d2f7c[_0xa0db23['name']]={'$like':'%'+_0x564899[_0xd1a5('0x2c')]['filter']+'%'};return _0x2d2f7c;}})});}_0x52706f=_[_0xd1a5('0x3a')]({},_0x52706f,_0x564899[_0xd1a5('0x3b')]);var _0x172559={'where':_0x52706f[_0xd1a5('0x38')]};return db[_0xd1a5('0x3c')][_0xd1a5('0x1c')](_0x172559)[_0xd1a5('0x23')](function(_0x391ae2){_0x1f5411[_0xd1a5('0x1c')]=_0x391ae2;if(_0x564899[_0xd1a5('0x2c')][_0xd1a5('0x3d')]){_0x52706f[_0xd1a5('0x3e')]=[{'all':!![]}];}return db[_0xd1a5('0x3c')][_0xd1a5('0x3f')](_0x52706f);})[_0xd1a5('0x23')](function(_0x4913f2){_0x1f5411['rows']=_0x4913f2;return _0x1f5411;})[_0xd1a5('0x23')](respondWithFilteredResult(_0x2f6d27,_0x52706f))[_0xd1a5('0x40')](handleError(_0x2f6d27,null));};exports[_0xd1a5('0x41')]=function(_0x163ea5,_0xb114df){var _0x27bc71={'raw':![],'where':{'id':_0x163ea5[_0xd1a5('0x42')]['id']}},_0x550fdc={};_0x550fdc[_0xd1a5('0x2f')]=_['keys'](db[_0xd1a5('0x3c')][_0xd1a5('0x29')]);_0x550fdc[_0xd1a5('0x2c')]=_[_0xd1a5('0x2d')](_0x163ea5[_0xd1a5('0x2c')]);_0x550fdc['filters']=_['intersection'](_0x550fdc[_0xd1a5('0x2f')],_0x550fdc[_0xd1a5('0x2c')]);_0x27bc71[_0xd1a5('0x32')]=_[_0xd1a5('0x30')](_0x550fdc['model'],qs[_0xd1a5('0x31')](_0x163ea5[_0xd1a5('0x2c')][_0xd1a5('0x31')]));_0x27bc71[_0xd1a5('0x32')]=_0x27bc71[_0xd1a5('0x32')][_0xd1a5('0x33')]?_0x27bc71[_0xd1a5('0x32')]:_0x550fdc[_0xd1a5('0x2f')];if(_0x163ea5[_0xd1a5('0x2c')][_0xd1a5('0x3d')]){_0x27bc71[_0xd1a5('0x3e')]=[{'all':!![]}];}_0x27bc71=_[_0xd1a5('0x3a')]({},_0x27bc71,_0x163ea5[_0xd1a5('0x3b')]);return db[_0xd1a5('0x3c')][_0xd1a5('0x43')](_0x27bc71)[_0xd1a5('0x23')](handleEntityNotFound(_0xb114df,null))['then'](respondWithResult(_0xb114df,null))[_0xd1a5('0x40')](handleError(_0xb114df,null));};exports[_0xd1a5('0x44')]=function(_0x2b89ff,_0x15c932){return db[_0xd1a5('0x3c')]['create'](_0x2b89ff[_0xd1a5('0x45')],{})[_0xd1a5('0x23')](respondWithResult(_0x15c932,0xc9))[_0xd1a5('0x40')](handleError(_0x15c932,null));};exports[_0xd1a5('0x46')]=function(_0x1dd3a0,_0x3d6eb3){if(_0x1dd3a0[_0xd1a5('0x45')]['id']){delete _0x1dd3a0['body']['id'];}return db['ServicenowConfiguration'][_0xd1a5('0x43')]({'where':{'id':_0x1dd3a0[_0xd1a5('0x42')]['id']}})[_0xd1a5('0x23')](handleEntityNotFound(_0x3d6eb3,null))[_0xd1a5('0x23')](saveUpdates(_0x1dd3a0['body'],null))[_0xd1a5('0x23')](respondWithResult(_0x3d6eb3,null))['catch'](handleError(_0x3d6eb3,null));};exports['destroy']=function(_0x3487cf,_0x20e011){return db['ServicenowConfiguration']['find']({'where':{'id':_0x3487cf[_0xd1a5('0x42')]['id']}})[_0xd1a5('0x23')](handleEntityNotFound(_0x20e011,null))['then'](removeEntity(_0x20e011,null))['catch'](handleError(_0x20e011,null));};exports['getFields']=function(_0x18ab35,_0x5a2b40,_0x182bd8){var _0x452df7={};var _0x119baa={};var _0x1e624d;var _0x29f2fb;return db[_0xd1a5('0x3c')][_0xd1a5('0x47')]({'where':{'id':_0x18ab35[_0xd1a5('0x42')]['id']}})[_0xd1a5('0x23')](handleEntityNotFound(_0x5a2b40,null))[_0xd1a5('0x23')](function(_0x3ba2f5){if(_0x3ba2f5){_0x1e624d=_0x3ba2f5;_0x119baa[_0xd1a5('0x2f')]=_['keys'](db['ServicenowField'][_0xd1a5('0x29')]);_0x119baa['query']=_['keys'](_0x18ab35[_0xd1a5('0x2c')]);_0x119baa[_0xd1a5('0x2e')]=_[_0xd1a5('0x30')](_0x119baa[_0xd1a5('0x2f')],_0x119baa[_0xd1a5('0x2c')]);_0x452df7[_0xd1a5('0x32')]=_[_0xd1a5('0x30')](_0x119baa[_0xd1a5('0x2f')],qs[_0xd1a5('0x31')](_0x18ab35[_0xd1a5('0x2c')][_0xd1a5('0x31')]));_0x452df7['attributes']=_0x452df7[_0xd1a5('0x32')][_0xd1a5('0x33')]?_0x452df7['attributes']:_0x119baa[_0xd1a5('0x2f')];_0x452df7['order']=qs[_0xd1a5('0x37')](_0x18ab35[_0xd1a5('0x2c')]['sort']);_0x452df7[_0xd1a5('0x38')]=qs['filters'](_[_0xd1a5('0x48')](_0x18ab35['query'],_0x119baa[_0xd1a5('0x2e')]));if(_0x18ab35[_0xd1a5('0x2c')]['filter']){_0x452df7[_0xd1a5('0x38')]=_[_0xd1a5('0x3a')](_0x452df7[_0xd1a5('0x38')],{'$or':_[_0xd1a5('0x28')](_0x452df7[_0xd1a5('0x32')],function(_0x3a420a){var _0x43e4f2={};_0x43e4f2[_0x3a420a]={'$like':'%'+_0x18ab35[_0xd1a5('0x2c')][_0xd1a5('0x49')]+'%'};return _0x43e4f2;})});}_0x452df7=_[_0xd1a5('0x3a')]({},_0x452df7,_0x18ab35[_0xd1a5('0x3b')]);return _0x1e624d[_0xd1a5('0x4a')](_0x452df7);}})[_0xd1a5('0x23')](function(_0x54586a){if(_0x54586a){_0x29f2fb=_0x54586a[_0xd1a5('0x33')];if(!_0x18ab35['query']['hasOwnProperty'](_0xd1a5('0x35'))){_0x452df7['limit']=qs[_0xd1a5('0x1b')](_0x18ab35[_0xd1a5('0x2c')][_0xd1a5('0x1b')]);_0x452df7[_0xd1a5('0x1a')]=qs[_0xd1a5('0x1a')](_0x18ab35[_0xd1a5('0x2c')]['offset']);}return _0x1e624d[_0xd1a5('0x4a')](_0x452df7);}})['then'](function(_0xb1d3){if(_0xb1d3){return _0xb1d3?{'count':_0x29f2fb,'rows':_0xb1d3}:null;}})['then'](respondWithResult(_0x5a2b40,null))[_0xd1a5('0x40')](handleError(_0x5a2b40,null));};exports[_0xd1a5('0x4b')]=function(_0x5a216f,_0x2b1e3c,_0x1043dc){var _0xd1f529={};var _0x3cd7b5={};var _0x1b4280;var _0x2d84bc;return db['ServicenowConfiguration'][_0xd1a5('0x47')]({'where':{'id':_0x5a216f['params']['id']}})[_0xd1a5('0x23')](handleEntityNotFound(_0x2b1e3c,null))[_0xd1a5('0x23')](function(_0x4c043d){if(_0x4c043d){_0x1b4280=_0x4c043d;_0x3cd7b5[_0xd1a5('0x2f')]=_[_0xd1a5('0x2d')](db[_0xd1a5('0x4c')][_0xd1a5('0x29')]);_0x3cd7b5['query']=_[_0xd1a5('0x2d')](_0x5a216f[_0xd1a5('0x2c')]);_0x3cd7b5[_0xd1a5('0x2e')]=_['intersection'](_0x3cd7b5[_0xd1a5('0x2f')],_0x3cd7b5[_0xd1a5('0x2c')]);_0xd1f529[_0xd1a5('0x32')]=_['intersection'](_0x3cd7b5['model'],qs[_0xd1a5('0x31')](_0x5a216f[_0xd1a5('0x2c')][_0xd1a5('0x31')]));_0xd1f529[_0xd1a5('0x32')]=_0xd1f529[_0xd1a5('0x32')][_0xd1a5('0x33')]?_0xd1f529[_0xd1a5('0x32')]:_0x3cd7b5['model'];_0xd1f529[_0xd1a5('0x36')]=qs[_0xd1a5('0x37')](_0x5a216f[_0xd1a5('0x2c')][_0xd1a5('0x37')]);_0xd1f529['where']=qs[_0xd1a5('0x2e')](_['pick'](_0x5a216f[_0xd1a5('0x2c')],_0x3cd7b5[_0xd1a5('0x2e')]));if(_0x5a216f[_0xd1a5('0x2c')][_0xd1a5('0x49')]){_0xd1f529[_0xd1a5('0x38')]=_[_0xd1a5('0x3a')](_0xd1f529['where'],{'$or':_[_0xd1a5('0x28')](_0xd1f529[_0xd1a5('0x32')],function(_0x145a92){var _0x239d9a={};_0x239d9a[_0x145a92]={'$like':'%'+_0x5a216f[_0xd1a5('0x2c')]['filter']+'%'};return _0x239d9a;})});}_0xd1f529=_['merge']({},_0xd1f529,_0x5a216f[_0xd1a5('0x3b')]);return _0x1b4280[_0xd1a5('0x4b')](_0xd1f529);}})[_0xd1a5('0x23')](function(_0x4f70a9){if(_0x4f70a9){_0x2d84bc=_0x4f70a9[_0xd1a5('0x33')];if(!_0x5a216f[_0xd1a5('0x2c')][_0xd1a5('0x34')](_0xd1a5('0x35'))){_0xd1f529[_0xd1a5('0x1b')]=qs['limit'](_0x5a216f[_0xd1a5('0x2c')][_0xd1a5('0x1b')]);_0xd1f529['offset']=qs[_0xd1a5('0x1a')](_0x5a216f[_0xd1a5('0x2c')][_0xd1a5('0x1a')]);}return _0x1b4280[_0xd1a5('0x4b')](_0xd1f529);}})[_0xd1a5('0x23')](function(_0x2d6e93){if(_0x2d6e93){return _0x2d6e93?{'count':_0x2d84bc,'rows':_0x2d6e93}:null;}})[_0xd1a5('0x23')](respondWithResult(_0x2b1e3c,null))[_0xd1a5('0x40')](handleError(_0x2b1e3c,null));};exports[_0xd1a5('0x4d')]=function(_0x41ef61,_0x5d831e,_0x38f5a6){var _0x13608c={};var _0xb7e00b={};var _0x51cf6e;var _0x47a833;return db[_0xd1a5('0x3c')]['findOne']({'where':{'id':_0x41ef61['params']['id']}})['then'](handleEntityNotFound(_0x5d831e,null))[_0xd1a5('0x23')](function(_0x403ed4){if(_0x403ed4){_0x51cf6e=_0x403ed4;_0xb7e00b[_0xd1a5('0x2f')]=_[_0xd1a5('0x2d')](db[_0xd1a5('0x4c')][_0xd1a5('0x29')]);_0xb7e00b[_0xd1a5('0x2c')]=_[_0xd1a5('0x2d')](_0x41ef61['query']);_0xb7e00b[_0xd1a5('0x2e')]=_[_0xd1a5('0x30')](_0xb7e00b[_0xd1a5('0x2f')],_0xb7e00b[_0xd1a5('0x2c')]);_0x13608c[_0xd1a5('0x32')]=_[_0xd1a5('0x30')](_0xb7e00b[_0xd1a5('0x2f')],qs['fields'](_0x41ef61[_0xd1a5('0x2c')]['fields']));_0x13608c[_0xd1a5('0x32')]=_0x13608c[_0xd1a5('0x32')]['length']?_0x13608c[_0xd1a5('0x32')]:_0xb7e00b[_0xd1a5('0x2f')];_0x13608c[_0xd1a5('0x36')]=qs[_0xd1a5('0x37')](_0x41ef61['query']['sort']);_0x13608c[_0xd1a5('0x38')]=qs[_0xd1a5('0x2e')](_[_0xd1a5('0x48')](_0x41ef61[_0xd1a5('0x2c')],_0xb7e00b[_0xd1a5('0x2e')]));if(_0x41ef61[_0xd1a5('0x2c')][_0xd1a5('0x49')]){_0x13608c['where']=_[_0xd1a5('0x3a')](_0x13608c[_0xd1a5('0x38')],{'$or':_['map'](_0x13608c[_0xd1a5('0x32')],function(_0x42f9f6){var _0x5e2d3b={};_0x5e2d3b[_0x42f9f6]={'$like':'%'+_0x41ef61['query'][_0xd1a5('0x49')]+'%'};return _0x5e2d3b;})});}_0x13608c=_[_0xd1a5('0x3a')]({},_0x13608c,_0x41ef61[_0xd1a5('0x3b')]);return _0x51cf6e[_0xd1a5('0x4d')](_0x13608c);}})[_0xd1a5('0x23')](function(_0x25d1dc){if(_0x25d1dc){_0x47a833=_0x25d1dc['length'];if(!_0x41ef61['query']['hasOwnProperty'](_0xd1a5('0x35'))){_0x13608c['limit']=qs[_0xd1a5('0x1b')](_0x41ef61[_0xd1a5('0x2c')]['limit']);_0x13608c['offset']=qs[_0xd1a5('0x1a')](_0x41ef61[_0xd1a5('0x2c')][_0xd1a5('0x1a')]);}return _0x51cf6e[_0xd1a5('0x4d')](_0x13608c);}})[_0xd1a5('0x23')](function(_0x6d030b){if(_0x6d030b){return _0x6d030b?{'count':_0x47a833,'rows':_0x6d030b}:null;}})['then'](respondWithResult(_0x5d831e,null))[_0xd1a5('0x40')](handleError(_0x5d831e,null));};
\ No newline at end of file
+var _0x6a72=['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','reject','save','update','then','destroy','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','getFields','getSubjects','findOne','ServicenowField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x45c93c,_0x409642){var _0x5352a2=function(_0x3caa99){while(--_0x3caa99){_0x45c93c['push'](_0x45c93c['shift']());}};_0x5352a2(++_0x409642);}(_0x6a72,0x98));var _0x26a7=function(_0x788c48,_0x5c0e5e){_0x788c48=_0x788c48-0x0;var _0x299c14=_0x6a72[_0x788c48];return _0x299c14;};'use strict';var emlformat=require(_0x26a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26a7('0x1'));var jsonpatch=require(_0x26a7('0x2'));var rp=require(_0x26a7('0x3'));var moment=require(_0x26a7('0x4'));var BPromise=require(_0x26a7('0x5'));var Mustache=require(_0x26a7('0x6'));var util=require(_0x26a7('0x7'));var path=require('path');var sox=require(_0x26a7('0x8'));var csv=require(_0x26a7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26a7('0xa'));var _=require(_0x26a7('0xb'));var squel=require(_0x26a7('0xc'));var crypto=require(_0x26a7('0xd'));var jsforce=require(_0x26a7('0xe'));var deskjs=require(_0x26a7('0xf'));var toCsv=require(_0x26a7('0x9'));var querystring=require(_0x26a7('0x10'));var Papa=require(_0x26a7('0x11'));var Redis=require('ioredis');var authService=require(_0x26a7('0x12'));var qs=require(_0x26a7('0x13'));var as=require(_0x26a7('0x14'));var hardwareService=require(_0x26a7('0x15'));var logger=require(_0x26a7('0x16'))(_0x26a7('0x17'));var utils=require(_0x26a7('0x18'));var config=require(_0x26a7('0x19'));var licenseUtil=require(_0x26a7('0x1a'));var db=require(_0x26a7('0x1b'))['db'];function respondWithStatusCode(_0x1d04f0,_0x477718){_0x477718=_0x477718||0xcc;return function(_0x3c873b){if(_0x3c873b){return _0x1d04f0[_0x26a7('0x1c')](_0x477718);}return _0x1d04f0[_0x26a7('0x1d')](_0x477718)[_0x26a7('0x1e')]();};}function respondWithResult(_0x3070ad,_0x21ed2e){_0x21ed2e=_0x21ed2e||0xc8;return function(_0xaf69f2){if(_0xaf69f2){return _0x3070ad[_0x26a7('0x1d')](_0x21ed2e)[_0x26a7('0x1f')](_0xaf69f2);}};}function respondWithFilteredResult(_0x1aeb56,_0x39b79c){return function(_0x38e999){if(_0x38e999){var _0x47d73c=typeof _0x39b79c[_0x26a7('0x20')]===_0x26a7('0x21')&&typeof _0x39b79c[_0x26a7('0x22')]===_0x26a7('0x21');var _0x1ee6aa=_0x38e999['count'];var _0x584fd0=_0x47d73c?0x0:_0x39b79c[_0x26a7('0x20')];var _0x4c0f90=_0x47d73c?_0x38e999[_0x26a7('0x23')]:_0x39b79c[_0x26a7('0x20')]+_0x39b79c['limit'];var _0x1f6072;if(_0x4c0f90>=_0x1ee6aa){_0x4c0f90=_0x1ee6aa;_0x1f6072=0xc8;}else{_0x1f6072=0xce;}_0x1aeb56[_0x26a7('0x1d')](_0x1f6072);return _0x1aeb56[_0x26a7('0x24')](_0x26a7('0x25'),_0x584fd0+'-'+_0x4c0f90+'/'+_0x1ee6aa)['json'](_0x38e999);}return null;};}function patchUpdates(_0x494221){return function(_0x48e496){try{jsonpatch['apply'](_0x48e496,_0x494221,!![]);}catch(_0x4fd179){return BPromise[_0x26a7('0x26')](_0x4fd179);}return _0x48e496[_0x26a7('0x27')]();};}function saveUpdates(_0x1e25cb,_0x4b7d7b){return function(_0x2e10ee){if(_0x2e10ee){return _0x2e10ee[_0x26a7('0x28')](_0x1e25cb)[_0x26a7('0x29')](function(_0x30ef2f){return _0x30ef2f;});}return null;};}function removeEntity(_0x59223c,_0x555d7f){return function(_0x328211){if(_0x328211){return _0x328211[_0x26a7('0x2a')]()[_0x26a7('0x29')](function(){_0x59223c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dd495,_0x3bc6c5){return function(_0x2d8d31){if(!_0x2d8d31){_0x2dd495[_0x26a7('0x1c')](0x194);}return _0x2d8d31;};}function handleError(_0x34cf7f,_0x4df990){_0x4df990=_0x4df990||0x1f4;return function(_0xd1405c){logger['error'](_0xd1405c['stack']);if(_0xd1405c[_0x26a7('0x2b')]){delete _0xd1405c[_0x26a7('0x2b')];}_0x34cf7f[_0x26a7('0x1d')](_0x4df990)[_0x26a7('0x2c')](_0xd1405c);};}exports[_0x26a7('0x2d')]=function(_0x1687e1,_0x2e449a){var _0x5d938a={},_0xbc3a22={},_0x1b4403={'count':0x0,'rows':[]};var _0x42973e=_['map'](db[_0x26a7('0x2e')][_0x26a7('0x2f')],function(_0x232050){return{'name':_0x232050[_0x26a7('0x30')],'type':_0x232050[_0x26a7('0x31')][_0x26a7('0x32')]};});_0xbc3a22['model']=_[_0x26a7('0x33')](_0x42973e,_0x26a7('0x2b'));_0xbc3a22['query']=_[_0x26a7('0x34')](_0x1687e1[_0x26a7('0x35')]);_0xbc3a22[_0x26a7('0x36')]=_[_0x26a7('0x37')](_0xbc3a22[_0x26a7('0x38')],_0xbc3a22[_0x26a7('0x35')]);_0x5d938a['attributes']=_[_0x26a7('0x37')](_0xbc3a22['model'],qs['fields'](_0x1687e1[_0x26a7('0x35')][_0x26a7('0x39')]));_0x5d938a[_0x26a7('0x3a')]=_0x5d938a[_0x26a7('0x3a')][_0x26a7('0x3b')]?_0x5d938a['attributes']:_0xbc3a22[_0x26a7('0x38')];if(!_0x1687e1['query'][_0x26a7('0x3c')](_0x26a7('0x3d'))){_0x5d938a[_0x26a7('0x22')]=qs[_0x26a7('0x22')](_0x1687e1[_0x26a7('0x35')]['limit']);_0x5d938a[_0x26a7('0x20')]=qs[_0x26a7('0x20')](_0x1687e1[_0x26a7('0x35')][_0x26a7('0x20')]);}_0x5d938a[_0x26a7('0x3e')]=qs[_0x26a7('0x3f')](_0x1687e1[_0x26a7('0x35')][_0x26a7('0x3f')]);_0x5d938a['where']=qs[_0x26a7('0x36')](_[_0x26a7('0x40')](_0x1687e1['query'],_0xbc3a22['filters']),_0x42973e);if(_0x1687e1[_0x26a7('0x35')][_0x26a7('0x41')]){_0x5d938a[_0x26a7('0x42')]=_[_0x26a7('0x43')](_0x5d938a['where'],{'$or':_[_0x26a7('0x33')](_0x42973e,function(_0xdef7e6){if(_0xdef7e6[_0x26a7('0x31')]!==_0x26a7('0x44')){var _0x54c70d={};_0x54c70d[_0xdef7e6[_0x26a7('0x2b')]]={'$like':'%'+_0x1687e1[_0x26a7('0x35')][_0x26a7('0x41')]+'%'};return _0x54c70d;}})});}_0x5d938a=_[_0x26a7('0x43')]({},_0x5d938a,_0x1687e1[_0x26a7('0x45')]);var _0x136791={'where':_0x5d938a[_0x26a7('0x42')]};return db[_0x26a7('0x2e')][_0x26a7('0x23')](_0x136791)[_0x26a7('0x29')](function(_0x1a107b){_0x1b4403[_0x26a7('0x23')]=_0x1a107b;if(_0x1687e1[_0x26a7('0x35')][_0x26a7('0x46')]){_0x5d938a[_0x26a7('0x47')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x26a7('0x48')](_0x5d938a);})['then'](function(_0x5613c7){_0x1b4403['rows']=_0x5613c7;return _0x1b4403;})['then'](respondWithFilteredResult(_0x2e449a,_0x5d938a))[_0x26a7('0x49')](handleError(_0x2e449a,null));};exports[_0x26a7('0x4a')]=function(_0xfc6a76,_0x40d027){var _0x3a1de3={'raw':![],'where':{'id':_0xfc6a76['params']['id']}},_0x289b7f={};_0x289b7f[_0x26a7('0x38')]=_['keys'](db[_0x26a7('0x2e')][_0x26a7('0x2f')]);_0x289b7f[_0x26a7('0x35')]=_[_0x26a7('0x34')](_0xfc6a76[_0x26a7('0x35')]);_0x289b7f[_0x26a7('0x36')]=_['intersection'](_0x289b7f[_0x26a7('0x38')],_0x289b7f[_0x26a7('0x35')]);_0x3a1de3[_0x26a7('0x3a')]=_['intersection'](_0x289b7f[_0x26a7('0x38')],qs[_0x26a7('0x39')](_0xfc6a76[_0x26a7('0x35')][_0x26a7('0x39')]));_0x3a1de3['attributes']=_0x3a1de3[_0x26a7('0x3a')][_0x26a7('0x3b')]?_0x3a1de3[_0x26a7('0x3a')]:_0x289b7f[_0x26a7('0x38')];if(_0xfc6a76[_0x26a7('0x35')][_0x26a7('0x46')]){_0x3a1de3[_0x26a7('0x47')]=[{'all':!![]}];}_0x3a1de3=_[_0x26a7('0x43')]({},_0x3a1de3,_0xfc6a76['options']);return db['ServicenowConfiguration'][_0x26a7('0x4b')](_0x3a1de3)[_0x26a7('0x29')](handleEntityNotFound(_0x40d027,null))[_0x26a7('0x29')](respondWithResult(_0x40d027,null))[_0x26a7('0x49')](handleError(_0x40d027,null));};exports[_0x26a7('0x4c')]=function(_0x2ab93c,_0x1cc14d){return db[_0x26a7('0x2e')][_0x26a7('0x4c')](_0x2ab93c[_0x26a7('0x4d')],{})['then'](respondWithResult(_0x1cc14d,0xc9))['catch'](handleError(_0x1cc14d,null));};exports[_0x26a7('0x28')]=function(_0x38c566,_0x3e0b59){if(_0x38c566[_0x26a7('0x4d')]['id']){delete _0x38c566[_0x26a7('0x4d')]['id'];}return db[_0x26a7('0x2e')][_0x26a7('0x4b')]({'where':{'id':_0x38c566['params']['id']}})['then'](handleEntityNotFound(_0x3e0b59,null))[_0x26a7('0x29')](saveUpdates(_0x38c566[_0x26a7('0x4d')],null))[_0x26a7('0x29')](respondWithResult(_0x3e0b59,null))[_0x26a7('0x49')](handleError(_0x3e0b59,null));};exports[_0x26a7('0x2a')]=function(_0x2a200e,_0x378e06){return db['ServicenowConfiguration'][_0x26a7('0x4b')]({'where':{'id':_0x2a200e[_0x26a7('0x4e')]['id']}})[_0x26a7('0x29')](handleEntityNotFound(_0x378e06,null))['then'](removeEntity(_0x378e06,null))[_0x26a7('0x49')](handleError(_0x378e06,null));};exports[_0x26a7('0x4f')]=function(_0x3f23b1,_0x528086,_0x44712e){var _0x5dc515={};var _0x170595={};var _0x456f07;var _0x5497cb;return db[_0x26a7('0x2e')]['findOne']({'where':{'id':_0x3f23b1[_0x26a7('0x4e')]['id']}})[_0x26a7('0x29')](handleEntityNotFound(_0x528086,null))[_0x26a7('0x29')](function(_0x17af94){if(_0x17af94){_0x456f07=_0x17af94;_0x170595['model']=_[_0x26a7('0x34')](db['ServicenowField'][_0x26a7('0x2f')]);_0x170595[_0x26a7('0x35')]=_[_0x26a7('0x34')](_0x3f23b1[_0x26a7('0x35')]);_0x170595[_0x26a7('0x36')]=_[_0x26a7('0x37')](_0x170595[_0x26a7('0x38')],_0x170595[_0x26a7('0x35')]);_0x5dc515['attributes']=_[_0x26a7('0x37')](_0x170595[_0x26a7('0x38')],qs[_0x26a7('0x39')](_0x3f23b1['query'][_0x26a7('0x39')]));_0x5dc515[_0x26a7('0x3a')]=_0x5dc515[_0x26a7('0x3a')][_0x26a7('0x3b')]?_0x5dc515[_0x26a7('0x3a')]:_0x170595[_0x26a7('0x38')];_0x5dc515['order']=qs[_0x26a7('0x3f')](_0x3f23b1[_0x26a7('0x35')][_0x26a7('0x3f')]);_0x5dc515[_0x26a7('0x42')]=qs['filters'](_['pick'](_0x3f23b1[_0x26a7('0x35')],_0x170595['filters']));if(_0x3f23b1[_0x26a7('0x35')][_0x26a7('0x41')]){_0x5dc515[_0x26a7('0x42')]=_['merge'](_0x5dc515[_0x26a7('0x42')],{'$or':_[_0x26a7('0x33')](_0x5dc515[_0x26a7('0x3a')],function(_0x54ff19){var _0x2474b2={};_0x2474b2[_0x54ff19]={'$like':'%'+_0x3f23b1['query']['filter']+'%'};return _0x2474b2;})});}_0x5dc515=_['merge']({},_0x5dc515,_0x3f23b1[_0x26a7('0x45')]);return _0x456f07[_0x26a7('0x4f')](_0x5dc515);}})[_0x26a7('0x29')](function(_0x38e187){if(_0x38e187){_0x5497cb=_0x38e187[_0x26a7('0x3b')];if(!_0x3f23b1[_0x26a7('0x35')][_0x26a7('0x3c')](_0x26a7('0x3d'))){_0x5dc515[_0x26a7('0x22')]=qs['limit'](_0x3f23b1['query'][_0x26a7('0x22')]);_0x5dc515[_0x26a7('0x20')]=qs[_0x26a7('0x20')](_0x3f23b1[_0x26a7('0x35')][_0x26a7('0x20')]);}return _0x456f07[_0x26a7('0x4f')](_0x5dc515);}})[_0x26a7('0x29')](function(_0x173747){if(_0x173747){return _0x173747?{'count':_0x5497cb,'rows':_0x173747}:null;}})[_0x26a7('0x29')](respondWithResult(_0x528086,null))[_0x26a7('0x49')](handleError(_0x528086,null));};exports[_0x26a7('0x50')]=function(_0x3a9f4a,_0x4c8588,_0x16975b){var _0x2370a6={};var _0x5bf2ca={};var _0x415c83;var _0x1440ae;return db[_0x26a7('0x2e')][_0x26a7('0x51')]({'where':{'id':_0x3a9f4a['params']['id']}})['then'](handleEntityNotFound(_0x4c8588,null))[_0x26a7('0x29')](function(_0x922a97){if(_0x922a97){_0x415c83=_0x922a97;_0x5bf2ca[_0x26a7('0x38')]=_[_0x26a7('0x34')](db['ServicenowField'][_0x26a7('0x2f')]);_0x5bf2ca[_0x26a7('0x35')]=_[_0x26a7('0x34')](_0x3a9f4a[_0x26a7('0x35')]);_0x5bf2ca[_0x26a7('0x36')]=_['intersection'](_0x5bf2ca[_0x26a7('0x38')],_0x5bf2ca[_0x26a7('0x35')]);_0x2370a6[_0x26a7('0x3a')]=_[_0x26a7('0x37')](_0x5bf2ca[_0x26a7('0x38')],qs['fields'](_0x3a9f4a[_0x26a7('0x35')]['fields']));_0x2370a6[_0x26a7('0x3a')]=_0x2370a6[_0x26a7('0x3a')][_0x26a7('0x3b')]?_0x2370a6[_0x26a7('0x3a')]:_0x5bf2ca[_0x26a7('0x38')];_0x2370a6['order']=qs['sort'](_0x3a9f4a[_0x26a7('0x35')]['sort']);_0x2370a6['where']=qs[_0x26a7('0x36')](_[_0x26a7('0x40')](_0x3a9f4a['query'],_0x5bf2ca['filters']));if(_0x3a9f4a[_0x26a7('0x35')][_0x26a7('0x41')]){_0x2370a6[_0x26a7('0x42')]=_[_0x26a7('0x43')](_0x2370a6[_0x26a7('0x42')],{'$or':_[_0x26a7('0x33')](_0x2370a6[_0x26a7('0x3a')],function(_0xeb2d41){var _0x2f155b={};_0x2f155b[_0xeb2d41]={'$like':'%'+_0x3a9f4a[_0x26a7('0x35')][_0x26a7('0x41')]+'%'};return _0x2f155b;})});}_0x2370a6=_[_0x26a7('0x43')]({},_0x2370a6,_0x3a9f4a['options']);return _0x415c83[_0x26a7('0x50')](_0x2370a6);}})[_0x26a7('0x29')](function(_0x38be43){if(_0x38be43){_0x1440ae=_0x38be43[_0x26a7('0x3b')];if(!_0x3a9f4a[_0x26a7('0x35')]['hasOwnProperty'](_0x26a7('0x3d'))){_0x2370a6['limit']=qs[_0x26a7('0x22')](_0x3a9f4a[_0x26a7('0x35')][_0x26a7('0x22')]);_0x2370a6['offset']=qs[_0x26a7('0x20')](_0x3a9f4a[_0x26a7('0x35')][_0x26a7('0x20')]);}return _0x415c83[_0x26a7('0x50')](_0x2370a6);}})[_0x26a7('0x29')](function(_0x21b8e9){if(_0x21b8e9){return _0x21b8e9?{'count':_0x1440ae,'rows':_0x21b8e9}:null;}})[_0x26a7('0x29')](respondWithResult(_0x4c8588,null))[_0x26a7('0x49')](handleError(_0x4c8588,null));};exports['getDescriptions']=function(_0x4c7795,_0x2a0b47,_0x393241){var _0x17d044={};var _0x5666c0={};var _0x56fd1c;var _0x5267ac;return db[_0x26a7('0x2e')][_0x26a7('0x51')]({'where':{'id':_0x4c7795['params']['id']}})['then'](handleEntityNotFound(_0x2a0b47,null))['then'](function(_0x513145){if(_0x513145){_0x56fd1c=_0x513145;_0x5666c0[_0x26a7('0x38')]=_[_0x26a7('0x34')](db[_0x26a7('0x52')][_0x26a7('0x2f')]);_0x5666c0[_0x26a7('0x35')]=_[_0x26a7('0x34')](_0x4c7795['query']);_0x5666c0[_0x26a7('0x36')]=_['intersection'](_0x5666c0[_0x26a7('0x38')],_0x5666c0[_0x26a7('0x35')]);_0x17d044[_0x26a7('0x3a')]=_['intersection'](_0x5666c0['model'],qs[_0x26a7('0x39')](_0x4c7795[_0x26a7('0x35')][_0x26a7('0x39')]));_0x17d044[_0x26a7('0x3a')]=_0x17d044['attributes'][_0x26a7('0x3b')]?_0x17d044[_0x26a7('0x3a')]:_0x5666c0[_0x26a7('0x38')];_0x17d044['order']=qs[_0x26a7('0x3f')](_0x4c7795[_0x26a7('0x35')]['sort']);_0x17d044[_0x26a7('0x42')]=qs[_0x26a7('0x36')](_[_0x26a7('0x40')](_0x4c7795[_0x26a7('0x35')],_0x5666c0[_0x26a7('0x36')]));if(_0x4c7795[_0x26a7('0x35')]['filter']){_0x17d044[_0x26a7('0x42')]=_[_0x26a7('0x43')](_0x17d044[_0x26a7('0x42')],{'$or':_[_0x26a7('0x33')](_0x17d044[_0x26a7('0x3a')],function(_0x42f262){var _0x4a2d20={};_0x4a2d20[_0x42f262]={'$like':'%'+_0x4c7795[_0x26a7('0x35')][_0x26a7('0x41')]+'%'};return _0x4a2d20;})});}_0x17d044=_[_0x26a7('0x43')]({},_0x17d044,_0x4c7795[_0x26a7('0x45')]);return _0x56fd1c['getDescriptions'](_0x17d044);}})['then'](function(_0x31dc9d){if(_0x31dc9d){_0x5267ac=_0x31dc9d['length'];if(!_0x4c7795[_0x26a7('0x35')]['hasOwnProperty'](_0x26a7('0x3d'))){_0x17d044['limit']=qs[_0x26a7('0x22')](_0x4c7795['query'][_0x26a7('0x22')]);_0x17d044[_0x26a7('0x20')]=qs[_0x26a7('0x20')](_0x4c7795[_0x26a7('0x35')][_0x26a7('0x20')]);}return _0x56fd1c[_0x26a7('0x53')](_0x17d044);}})[_0x26a7('0x29')](function(_0x51fe4d){if(_0x51fe4d){return _0x51fe4d?{'count':_0x5267ac,'rows':_0x51fe4d}:null;}})['then'](respondWithResult(_0x2a0b47,null))[_0x26a7('0x49')](handleError(_0x2a0b47,null));};
\ No newline at end of file
index e8e961c..2e69d3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ea1=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0x2ea1,0xca));var _0x12ea=function(_0x38aea6,_0x1a9a83){_0x38aea6=_0x38aea6-0x0;var _0x5fda81=_0x2ea1[_0x38aea6];return _0x5fda81;};'use strict';var _=require(_0x12ea('0x0'));var util=require(_0x12ea('0x1'));var logger=require(_0x12ea('0x2'))(_0x12ea('0x3'));var moment=require(_0x12ea('0x4'));var BPromise=require(_0x12ea('0x5'));var rp=require(_0x12ea('0x6'));var fs=require('fs');var path=require(_0x12ea('0x7'));var rimraf=require('rimraf');var config=require(_0x12ea('0x8'));var attributes=require(_0x12ea('0x9'));module[_0x12ea('0xa')]=function(_0x551f0b,_0x132217){return _0x551f0b[_0x12ea('0xb')](_0x12ea('0xc'),attributes,{'tableName':_0x12ea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f7b=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x59ceb6,_0x3ad924){_0x59ceb6=_0x59ceb6-0x0;var _0x582767=_0x4f7b[_0x59ceb6];return _0x582767;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var logger=require(_0xb4f7('0x2'))(_0xb4f7('0x3'));var moment=require('moment');var BPromise=require(_0xb4f7('0x4'));var rp=require(_0xb4f7('0x5'));var fs=require('fs');var path=require(_0xb4f7('0x6'));var rimraf=require(_0xb4f7('0x7'));var config=require(_0xb4f7('0x8'));var attributes=require(_0xb4f7('0x9'));module[_0xb4f7('0xa')]=function(_0x15443c,_0x4d2d83){return _0x15443c[_0xb4f7('0xb')]('ServicenowConfiguration',attributes,{'tableName':_0xb4f7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4656868..5bb3818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x047e=['../../mysqldb','../../config/logger','client','http','request','then','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0x047e,0x121));var _0xe047=function(_0x44d235,_0x331ef9){_0x44d235=_0x44d235-0x0;var _0x534e9c=_0x047e[_0x44d235];return _0x534e9c;};'use strict';var _=require(_0xe047('0x0'));var util=require('util');var moment=require(_0xe047('0x1'));var BPromise=require(_0xe047('0x2'));var rs=require(_0xe047('0x3'));var fs=require('fs');var Redis=require(_0xe047('0x4'));var db=require(_0xe047('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe047('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe047('0x7')][_0xe047('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a0e18,_0x402fa8,_0x16e2e1){return new BPromise(function(_0x243e93,_0x182c95){return client[_0xe047('0x9')](_0x4a0e18,_0x16e2e1)[_0xe047('0xa')](function(_0x99e42a){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x402fa8,'request\x20sent');logger[_0xe047('0xb')](_0xe047('0xc'),_0x402fa8,_0xe047('0xd'),JSON[_0xe047('0xe')](_0x99e42a));if(_0x99e42a[_0xe047('0xf')]){if(_0x99e42a['error'][_0xe047('0x10')]===0x1f4){logger[_0xe047('0xf')](_0xe047('0x11'),_0x402fa8,_0x99e42a[_0xe047('0xf')]['message']);return _0x182c95(_0x99e42a[_0xe047('0xf')]['message']);}logger[_0xe047('0xf')](_0xe047('0x11'),_0x402fa8,_0x99e42a[_0xe047('0xf')][_0xe047('0x12')]);return _0x243e93(_0x99e42a['error'][_0xe047('0x12')]);}else{logger[_0xe047('0x13')](_0xe047('0x11'),_0x402fa8,_0xe047('0xd'));_0x243e93(_0x99e42a['result'][_0xe047('0x12')]);}})[_0xe047('0x14')](function(_0x310440){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x402fa8,_0x310440);_0x182c95(_0x310440);});});}
\ No newline at end of file
+var _0xf583=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x5f03d3,_0x4f9fdf){var _0x438b1e=function(_0x354151){while(--_0x354151){_0x5f03d3['push'](_0x5f03d3['shift']());}};_0x438b1e(++_0x4f9fdf);}(_0xf583,0x111));var _0x3f58=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xf583[_0x420b24];return _0x4da552;};'use strict';var _=require(_0x3f58('0x0'));var util=require(_0x3f58('0x1'));var moment=require('moment');var BPromise=require(_0x3f58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f58('0x3'))['db'];var utils=require(_0x3f58('0x4'));var logger=require(_0x3f58('0x5'))('rpc');var config=require(_0x3f58('0x6'));var jayson=require(_0x3f58('0x7'));var client=jayson[_0x3f58('0x8')][_0x3f58('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4623b6,_0x4fb65d,_0x2ae676){return new BPromise(function(_0x2a2b64,_0x357f1a){return client['request'](_0x4623b6,_0x2ae676)[_0x3f58('0xa')](function(_0xaa7cc9){logger[_0x3f58('0xb')](_0x3f58('0xc'),_0x4fb65d,_0x3f58('0xd'));logger[_0x3f58('0xe')](_0x3f58('0xf'),_0x4fb65d,_0x3f58('0xd'),JSON[_0x3f58('0x10')](_0xaa7cc9));if(_0xaa7cc9[_0x3f58('0x11')]){if(_0xaa7cc9[_0x3f58('0x11')]['code']===0x1f4){logger[_0x3f58('0x11')](_0x3f58('0xc'),_0x4fb65d,_0xaa7cc9[_0x3f58('0x11')]['message']);return _0x357f1a(_0xaa7cc9[_0x3f58('0x11')]['message']);}logger['error'](_0x3f58('0xc'),_0x4fb65d,_0xaa7cc9[_0x3f58('0x11')][_0x3f58('0x12')]);return _0x2a2b64(_0xaa7cc9[_0x3f58('0x11')]['message']);}else{logger[_0x3f58('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4fb65d,_0x3f58('0xd'));_0x2a2b64(_0xaa7cc9[_0x3f58('0x13')]['message']);}})[_0x3f58('0x14')](function(_0x25ac58){logger[_0x3f58('0x11')](_0x3f58('0xc'),_0x4fb65d,_0x25ac58);_0x357f1a(_0x25ac58);});});}
\ No newline at end of file
index 2063a5d..b4af2dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8509=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer','path'];(function(_0xa587a,_0xc7ebc7){var _0x2af6f3=function(_0x434495){while(--_0x434495){_0xa587a['push'](_0xa587a['shift']());}};_0x2af6f3(++_0xc7ebc7);}(_0x8509,0xb2));var _0x9850=function(_0x37ea15,_0x5a0470){_0x37ea15=_0x37ea15-0x0;var _0x453798=_0x8509[_0x37ea15];return _0x453798;};'use strict';var multer=require(_0x9850('0x0'));var util=require('util');var path=require(_0x9850('0x1'));var timeout=require('connect-timeout');var express=require(_0x9850('0x2'));var router=express['Router']();var fs_extra=require(_0x9850('0x3'));var auth=require(_0x9850('0x4'));var interaction=require(_0x9850('0x5'));var config=require(_0x9850('0x6'));var controller=require(_0x9850('0x7'));router[_0x9850('0x8')]('/',auth['isAuthenticated'](),controller[_0x9850('0x9')]);router[_0x9850('0x8')](_0x9850('0xa'),auth[_0x9850('0xb')](),controller[_0x9850('0xc')]);router[_0x9850('0xd')]('/',auth['isAuthenticated'](),controller[_0x9850('0xe')]);router['put'](_0x9850('0xa'),auth[_0x9850('0xb')](),controller[_0x9850('0xf')]);router['delete']('/:id',auth[_0x9850('0xb')](),controller[_0x9850('0x10')]);module[_0x9850('0x11')]=router;
\ No newline at end of file
+var _0xcd95=['../../config/environment','./intServicenowField.controller','get','/:id','show','create','put','update','isAuthenticated','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0xcd95,0xd0));var _0x5cd9=function(_0x263f81,_0x490cad){_0x263f81=_0x263f81-0x0;var _0xf2563=_0xcd95[_0x263f81];return _0xf2563;};'use strict';var multer=require(_0x5cd9('0x0'));var util=require(_0x5cd9('0x1'));var path=require(_0x5cd9('0x2'));var timeout=require(_0x5cd9('0x3'));var express=require(_0x5cd9('0x4'));var router=express['Router']();var fs_extra=require(_0x5cd9('0x5'));var auth=require(_0x5cd9('0x6'));var interaction=require(_0x5cd9('0x7'));var config=require(_0x5cd9('0x8'));var controller=require(_0x5cd9('0x9'));router[_0x5cd9('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5cd9('0xa')](_0x5cd9('0xb'),auth['isAuthenticated'](),controller[_0x5cd9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5cd9('0xd')]);router[_0x5cd9('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5cd9('0xf')]);router['delete'](_0x5cd9('0xb'),auth[_0x5cd9('0x10')](),controller[_0x5cd9('0x11')]);module['exports']=router;
\ No newline at end of file
index 967a1f1..1094c73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5083=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist','string','STRING'];(function(_0xf66a25,_0x527689){var _0x231422=function(_0x164b05){while(--_0x164b05){_0xf66a25['push'](_0xf66a25['shift']());}};_0x231422(++_0x527689);}(_0x5083,0x172));var _0x3508=function(_0x4377cd,_0xd73242){_0x4377cd=_0x4377cd-0x0;var _0x55ce9d=_0x5083[_0x4377cd];return _0x55ce9d;};'use strict';var Sequelize=require(_0x3508('0x0'));module[_0x3508('0x1')]={'type':{'type':Sequelize[_0x3508('0x2')]('string',_0x3508('0x3'),_0x3508('0x4'),'keyValue',_0x3508('0x5')),'defaultValue':_0x3508('0x6')},'content':{'type':Sequelize[_0x3508('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3508('0x2')](_0x3508('0x6'),_0x3508('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3508('0x7')]},'idField':{'type':Sequelize[_0x3508('0x7')]},'nameField':{'type':Sequelize[_0x3508('0x7')]},'customField':{'type':Sequelize[_0x3508('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3508('0x7')]}};
\ No newline at end of file
+var _0xae0c=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x32f91b,_0x460016){var _0x3ee8f3=function(_0x39b27d){while(--_0x39b27d){_0x32f91b['push'](_0x32f91b['shift']());}};_0x3ee8f3(++_0x460016);}(_0xae0c,0xa0));var _0xcae0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xae0c[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xcae0('0x0')]={'type':{'type':Sequelize[_0xcae0('0x1')](_0xcae0('0x2'),_0xcae0('0x3'),_0xcae0('0x4'),_0xcae0('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xcae0('0x6')]},'key':{'type':Sequelize[_0xcae0('0x6')]},'keyType':{'type':Sequelize[_0xcae0('0x1')](_0xcae0('0x2'),_0xcae0('0x3'),_0xcae0('0x4'))},'keyContent':{'type':Sequelize[_0xcae0('0x6')]},'idField':{'type':Sequelize[_0xcae0('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xcae0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcae0('0x6')]}};
\ No newline at end of file
index d26dbaa..19fb032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x808a=['rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','ServicenowField'];(function(_0x2fa51a,_0x4d691d){var _0xf7e4c0=function(_0x15ad9b){while(--_0x15ad9b){_0x2fa51a['push'](_0x2fa51a['shift']());}};_0xf7e4c0(++_0x4d691d);}(_0x808a,0x1b3));var _0xa808=function(_0x3d309c,_0x242f4c){_0x3d309c=_0x3d309c-0x0;var _0x241187=_0x808a[_0x3d309c];return _0x241187;};'use strict';var emlformat=require(_0xa808('0x0'));var rimraf=require(_0xa808('0x1'));var zipdir=require(_0xa808('0x2'));var jsonpatch=require(_0xa808('0x3'));var rp=require(_0xa808('0x4'));var moment=require(_0xa808('0x5'));var BPromise=require(_0xa808('0x6'));var Mustache=require(_0xa808('0x7'));var util=require(_0xa808('0x8'));var path=require(_0xa808('0x9'));var sox=require(_0xa808('0xa'));var csv=require(_0xa808('0xb'));var ejs=require(_0xa808('0xc'));var fs=require('fs');var fs_extra=require(_0xa808('0xd'));var _=require(_0xa808('0xe'));var squel=require(_0xa808('0xf'));var crypto=require(_0xa808('0x10'));var jsforce=require(_0xa808('0x11'));var deskjs=require(_0xa808('0x12'));var toCsv=require(_0xa808('0xb'));var querystring=require(_0xa808('0x13'));var Papa=require(_0xa808('0x14'));var Redis=require(_0xa808('0x15'));var authService=require(_0xa808('0x16'));var qs=require(_0xa808('0x17'));var as=require(_0xa808('0x18'));var hardwareService=require(_0xa808('0x19'));var logger=require(_0xa808('0x1a'))(_0xa808('0x1b'));var utils=require(_0xa808('0x1c'));var config=require('../../config/environment');var licenseUtil=require(_0xa808('0x1d'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2859e3,_0x5041b8){_0x5041b8=_0x5041b8||0xcc;return function(_0x5565f8){if(_0x5565f8){return _0x2859e3['sendStatus'](_0x5041b8);}return _0x2859e3[_0xa808('0x1e')](_0x5041b8)['end']();};}function respondWithResult(_0x1e1063,_0xf07d00){_0xf07d00=_0xf07d00||0xc8;return function(_0x3e60d7){if(_0x3e60d7){return _0x1e1063[_0xa808('0x1e')](_0xf07d00)[_0xa808('0x1f')](_0x3e60d7);}};}function respondWithFilteredResult(_0x37e120,_0x21ef28){return function(_0xa412d5){if(_0xa412d5){var _0x1ccd5d=typeof _0x21ef28['offset']===_0xa808('0x20')&&typeof _0x21ef28[_0xa808('0x21')]===_0xa808('0x20');var _0xaa65ab=_0xa412d5[_0xa808('0x22')];var _0x563f4c=_0x1ccd5d?0x0:_0x21ef28[_0xa808('0x23')];var _0x2549b8=_0x1ccd5d?_0xa412d5[_0xa808('0x22')]:_0x21ef28[_0xa808('0x23')]+_0x21ef28[_0xa808('0x21')];var _0x3e6c5a;if(_0x2549b8>=_0xaa65ab){_0x2549b8=_0xaa65ab;_0x3e6c5a=0xc8;}else{_0x3e6c5a=0xce;}_0x37e120[_0xa808('0x1e')](_0x3e6c5a);return _0x37e120['set'](_0xa808('0x24'),_0x563f4c+'-'+_0x2549b8+'/'+_0xaa65ab)[_0xa808('0x1f')](_0xa412d5);}return null;};}function patchUpdates(_0x8fd21){return function(_0x2bc359){try{jsonpatch['apply'](_0x2bc359,_0x8fd21,!![]);}catch(_0x4f72c7){return BPromise[_0xa808('0x25')](_0x4f72c7);}return _0x2bc359[_0xa808('0x26')]();};}function saveUpdates(_0x41cf21,_0x13f762){return function(_0x50bfc9){if(_0x50bfc9){return _0x50bfc9[_0xa808('0x27')](_0x41cf21)[_0xa808('0x28')](function(_0x103151){return _0x103151;});}return null;};}function removeEntity(_0x44eaee,_0x8b51c4){return function(_0x3f2b67){if(_0x3f2b67){return _0x3f2b67[_0xa808('0x29')]()[_0xa808('0x28')](function(){_0x44eaee[_0xa808('0x1e')](0xcc)[_0xa808('0x2a')]();});}};}function handleEntityNotFound(_0x5c02b5,_0x2f137d){return function(_0x3c8d57){if(!_0x3c8d57){_0x5c02b5[_0xa808('0x2b')](0x194);}return _0x3c8d57;};}function handleError(_0x2865f6,_0x56870b){_0x56870b=_0x56870b||0x1f4;return function(_0x51a698){logger[_0xa808('0x2c')](_0x51a698[_0xa808('0x2d')]);if(_0x51a698[_0xa808('0x2e')]){delete _0x51a698[_0xa808('0x2e')];}_0x2865f6[_0xa808('0x1e')](_0x56870b)[_0xa808('0x2f')](_0x51a698);};}exports[_0xa808('0x30')]=function(_0x5b62dc,_0x370308){var _0x5bf364={},_0x1479a5={},_0x5f19e6={'count':0x0,'rows':[]};var _0x5748c4=_[_0xa808('0x31')](db[_0xa808('0x32')][_0xa808('0x33')],function(_0x2935eb){return{'name':_0x2935eb[_0xa808('0x34')],'type':_0x2935eb['type'][_0xa808('0x35')]};});_0x1479a5[_0xa808('0x36')]=_[_0xa808('0x31')](_0x5748c4,_0xa808('0x2e'));_0x1479a5[_0xa808('0x37')]=_['keys'](_0x5b62dc[_0xa808('0x37')]);_0x1479a5[_0xa808('0x38')]=_['intersection'](_0x1479a5[_0xa808('0x36')],_0x1479a5['query']);_0x5bf364[_0xa808('0x39')]=_[_0xa808('0x3a')](_0x1479a5['model'],qs[_0xa808('0x3b')](_0x5b62dc[_0xa808('0x37')][_0xa808('0x3b')]));_0x5bf364['attributes']=_0x5bf364[_0xa808('0x39')][_0xa808('0x3c')]?_0x5bf364[_0xa808('0x39')]:_0x1479a5[_0xa808('0x36')];if(!_0x5b62dc[_0xa808('0x37')][_0xa808('0x3d')](_0xa808('0x3e'))){_0x5bf364['limit']=qs[_0xa808('0x21')](_0x5b62dc[_0xa808('0x37')][_0xa808('0x21')]);_0x5bf364['offset']=qs[_0xa808('0x23')](_0x5b62dc['query'][_0xa808('0x23')]);}_0x5bf364[_0xa808('0x3f')]=qs[_0xa808('0x40')](_0x5b62dc['query'][_0xa808('0x40')]);_0x5bf364[_0xa808('0x41')]=qs['filters'](_['pick'](_0x5b62dc[_0xa808('0x37')],_0x1479a5[_0xa808('0x38')]),_0x5748c4);if(_0x5b62dc['query'][_0xa808('0x42')]){_0x5bf364[_0xa808('0x41')]=_[_0xa808('0x43')](_0x5bf364[_0xa808('0x41')],{'$or':_[_0xa808('0x31')](_0x5748c4,function(_0x5d153c){if(_0x5d153c[_0xa808('0x44')]!==_0xa808('0x45')){var _0x345988={};_0x345988[_0x5d153c['name']]={'$like':'%'+_0x5b62dc['query'][_0xa808('0x42')]+'%'};return _0x345988;}})});}_0x5bf364=_[_0xa808('0x43')]({},_0x5bf364,_0x5b62dc[_0xa808('0x46')]);var _0x11c1a9={'where':_0x5bf364['where']};return db[_0xa808('0x32')][_0xa808('0x22')](_0x11c1a9)['then'](function(_0x12e2e6){_0x5f19e6[_0xa808('0x22')]=_0x12e2e6;if(_0x5b62dc[_0xa808('0x37')][_0xa808('0x47')]){_0x5bf364[_0xa808('0x48')]=[{'all':!![]}];}return db[_0xa808('0x32')][_0xa808('0x49')](_0x5bf364);})[_0xa808('0x28')](function(_0x1f5df7){_0x5f19e6[_0xa808('0x4a')]=_0x1f5df7;return _0x5f19e6;})['then'](respondWithFilteredResult(_0x370308,_0x5bf364))[_0xa808('0x4b')](handleError(_0x370308,null));};exports['show']=function(_0x50db0f,_0x153e99){var _0x547a72={'raw':!![],'where':{'id':_0x50db0f[_0xa808('0x4c')]['id']}},_0x3d7608={};_0x3d7608[_0xa808('0x36')]=_[_0xa808('0x4d')](db[_0xa808('0x32')][_0xa808('0x33')]);_0x3d7608[_0xa808('0x37')]=_[_0xa808('0x4d')](_0x50db0f['query']);_0x3d7608[_0xa808('0x38')]=_['intersection'](_0x3d7608['model'],_0x3d7608['query']);_0x547a72[_0xa808('0x39')]=_[_0xa808('0x3a')](_0x3d7608['model'],qs[_0xa808('0x3b')](_0x50db0f['query'][_0xa808('0x3b')]));_0x547a72[_0xa808('0x39')]=_0x547a72[_0xa808('0x39')][_0xa808('0x3c')]?_0x547a72[_0xa808('0x39')]:_0x3d7608[_0xa808('0x36')];if(_0x50db0f['query'][_0xa808('0x47')]){_0x547a72[_0xa808('0x48')]=[{'all':!![]}];}_0x547a72=_[_0xa808('0x43')]({},_0x547a72,_0x50db0f[_0xa808('0x46')]);return db[_0xa808('0x32')][_0xa808('0x4e')](_0x547a72)[_0xa808('0x28')](handleEntityNotFound(_0x153e99,null))['then'](respondWithResult(_0x153e99,null))[_0xa808('0x4b')](handleError(_0x153e99,null));};exports[_0xa808('0x4f')]=function(_0x51ed34,_0x4a4e94){return db['ServicenowField']['create'](_0x51ed34[_0xa808('0x50')],{})['then'](respondWithResult(_0x4a4e94,0xc9))[_0xa808('0x4b')](handleError(_0x4a4e94,null));};exports[_0xa808('0x27')]=function(_0xa4af2f,_0x33dafb){if(_0xa4af2f['body']['id']){delete _0xa4af2f[_0xa808('0x50')]['id'];}return db[_0xa808('0x32')][_0xa808('0x4e')]({'where':{'id':_0xa4af2f[_0xa808('0x4c')]['id']}})['then'](handleEntityNotFound(_0x33dafb,null))[_0xa808('0x28')](saveUpdates(_0xa4af2f['body'],null))[_0xa808('0x28')](respondWithResult(_0x33dafb,null))[_0xa808('0x4b')](handleError(_0x33dafb,null));};exports[_0xa808('0x29')]=function(_0x2e99fb,_0x1caa29){return db[_0xa808('0x32')][_0xa808('0x4e')]({'where':{'id':_0x2e99fb[_0xa808('0x4c')]['id']}})[_0xa808('0x28')](handleEntityNotFound(_0x1caa29,null))['then'](removeEntity(_0x1caa29,null))[_0xa808('0x4b')](handleError(_0x1caa29,null));};
\ No newline at end of file
+var _0x8f75=['to-csv','ejs','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','offset','limit','undefined','count','set','reject','save','update','then','end','stack','name','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','catch','params','intersection','include','find','create','body','destroy','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8f75,0x7f));var _0x58f7=function(_0x45da6b,_0x44d966){_0x45da6b=_0x45da6b-0x0;var _0x235217=_0x8f75[_0x45da6b];return _0x235217;};'use strict';var emlformat=require(_0x58f7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x58f7('0x1'));var rp=require(_0x58f7('0x2'));var moment=require('moment');var BPromise=require(_0x58f7('0x3'));var Mustache=require(_0x58f7('0x4'));var util=require(_0x58f7('0x5'));var path=require(_0x58f7('0x6'));var sox=require('sox');var csv=require(_0x58f7('0x7'));var ejs=require(_0x58f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x58f7('0x9'));var squel=require(_0x58f7('0xa'));var crypto=require(_0x58f7('0xb'));var jsforce=require(_0x58f7('0xc'));var deskjs=require(_0x58f7('0xd'));var toCsv=require(_0x58f7('0x7'));var querystring=require(_0x58f7('0xe'));var Papa=require(_0x58f7('0xf'));var Redis=require(_0x58f7('0x10'));var authService=require(_0x58f7('0x11'));var qs=require(_0x58f7('0x12'));var as=require(_0x58f7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x58f7('0x14'));var utils=require(_0x58f7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x58f7('0x16'));var db=require(_0x58f7('0x17'))['db'];function respondWithStatusCode(_0x550b85,_0x33401c){_0x33401c=_0x33401c||0xcc;return function(_0x4be16c){if(_0x4be16c){return _0x550b85[_0x58f7('0x18')](_0x33401c);}return _0x550b85[_0x58f7('0x19')](_0x33401c)['end']();};}function respondWithResult(_0x5c5107,_0x57ed7c){_0x57ed7c=_0x57ed7c||0xc8;return function(_0x2d8d6d){if(_0x2d8d6d){return _0x5c5107[_0x58f7('0x19')](_0x57ed7c)['json'](_0x2d8d6d);}};}function respondWithFilteredResult(_0x56b15a,_0x3085d5){return function(_0x2fdb45){if(_0x2fdb45){var _0x3dee67=typeof _0x3085d5[_0x58f7('0x1a')]==='undefined'&&typeof _0x3085d5[_0x58f7('0x1b')]===_0x58f7('0x1c');var _0x345a35=_0x2fdb45[_0x58f7('0x1d')];var _0xff8eb5=_0x3dee67?0x0:_0x3085d5[_0x58f7('0x1a')];var _0x26826e=_0x3dee67?_0x2fdb45[_0x58f7('0x1d')]:_0x3085d5['offset']+_0x3085d5[_0x58f7('0x1b')];var _0x111c32;if(_0x26826e>=_0x345a35){_0x26826e=_0x345a35;_0x111c32=0xc8;}else{_0x111c32=0xce;}_0x56b15a[_0x58f7('0x19')](_0x111c32);return _0x56b15a[_0x58f7('0x1e')]('Content-Range',_0xff8eb5+'-'+_0x26826e+'/'+_0x345a35)['json'](_0x2fdb45);}return null;};}function patchUpdates(_0x36907e){return function(_0xe4c481){try{jsonpatch['apply'](_0xe4c481,_0x36907e,!![]);}catch(_0x41b4cc){return BPromise[_0x58f7('0x1f')](_0x41b4cc);}return _0xe4c481[_0x58f7('0x20')]();};}function saveUpdates(_0x2666e7,_0x32b2cd){return function(_0x49c786){if(_0x49c786){return _0x49c786[_0x58f7('0x21')](_0x2666e7)[_0x58f7('0x22')](function(_0x2b79a0){return _0x2b79a0;});}return null;};}function removeEntity(_0x47aa6b,_0x4bbce1){return function(_0x13f51f){if(_0x13f51f){return _0x13f51f['destroy']()[_0x58f7('0x22')](function(){_0x47aa6b[_0x58f7('0x19')](0xcc)[_0x58f7('0x23')]();});}};}function handleEntityNotFound(_0x7213af,_0x333b2c){return function(_0x53b342){if(!_0x53b342){_0x7213af['sendStatus'](0x194);}return _0x53b342;};}function handleError(_0x5239f7,_0x232f9b){_0x232f9b=_0x232f9b||0x1f4;return function(_0x4e4967){logger['error'](_0x4e4967[_0x58f7('0x24')]);if(_0x4e4967[_0x58f7('0x25')]){delete _0x4e4967['name'];}_0x5239f7['status'](_0x232f9b)['send'](_0x4e4967);};}exports[_0x58f7('0x26')]=function(_0x4e78da,_0x41abad){var _0x459773={},_0x2a46b4={},_0x4b9bdb={'count':0x0,'rows':[]};var _0x1b7ab0=_[_0x58f7('0x27')](db[_0x58f7('0x28')][_0x58f7('0x29')],function(_0x4c8e70){return{'name':_0x4c8e70[_0x58f7('0x2a')],'type':_0x4c8e70[_0x58f7('0x2b')]['key']};});_0x2a46b4[_0x58f7('0x2c')]=_[_0x58f7('0x27')](_0x1b7ab0,_0x58f7('0x25'));_0x2a46b4[_0x58f7('0x2d')]=_[_0x58f7('0x2e')](_0x4e78da[_0x58f7('0x2d')]);_0x2a46b4[_0x58f7('0x2f')]=_['intersection'](_0x2a46b4[_0x58f7('0x2c')],_0x2a46b4[_0x58f7('0x2d')]);_0x459773[_0x58f7('0x30')]=_['intersection'](_0x2a46b4['model'],qs[_0x58f7('0x31')](_0x4e78da[_0x58f7('0x2d')][_0x58f7('0x31')]));_0x459773[_0x58f7('0x30')]=_0x459773[_0x58f7('0x30')][_0x58f7('0x32')]?_0x459773['attributes']:_0x2a46b4['model'];if(!_0x4e78da[_0x58f7('0x2d')][_0x58f7('0x33')]('nolimit')){_0x459773[_0x58f7('0x1b')]=qs[_0x58f7('0x1b')](_0x4e78da['query'][_0x58f7('0x1b')]);_0x459773[_0x58f7('0x1a')]=qs[_0x58f7('0x1a')](_0x4e78da[_0x58f7('0x2d')][_0x58f7('0x1a')]);}_0x459773[_0x58f7('0x34')]=qs[_0x58f7('0x35')](_0x4e78da[_0x58f7('0x2d')]['sort']);_0x459773[_0x58f7('0x36')]=qs['filters'](_[_0x58f7('0x37')](_0x4e78da[_0x58f7('0x2d')],_0x2a46b4[_0x58f7('0x2f')]),_0x1b7ab0);if(_0x4e78da[_0x58f7('0x2d')][_0x58f7('0x38')]){_0x459773[_0x58f7('0x36')]=_[_0x58f7('0x39')](_0x459773[_0x58f7('0x36')],{'$or':_[_0x58f7('0x27')](_0x1b7ab0,function(_0x5becad){if(_0x5becad['type']!=='VIRTUAL'){var _0x2a4991={};_0x2a4991[_0x5becad[_0x58f7('0x25')]]={'$like':'%'+_0x4e78da['query'][_0x58f7('0x38')]+'%'};return _0x2a4991;}})});}_0x459773=_[_0x58f7('0x39')]({},_0x459773,_0x4e78da[_0x58f7('0x3a')]);var _0x45b561={'where':_0x459773['where']};return db[_0x58f7('0x28')][_0x58f7('0x1d')](_0x45b561)[_0x58f7('0x22')](function(_0x4d7611){_0x4b9bdb[_0x58f7('0x1d')]=_0x4d7611;if(_0x4e78da[_0x58f7('0x2d')]['includeAll']){_0x459773['include']=[{'all':!![]}];}return db[_0x58f7('0x28')]['findAll'](_0x459773);})[_0x58f7('0x22')](function(_0x4ec13d){_0x4b9bdb['rows']=_0x4ec13d;return _0x4b9bdb;})[_0x58f7('0x22')](respondWithFilteredResult(_0x41abad,_0x459773))[_0x58f7('0x3b')](handleError(_0x41abad,null));};exports['show']=function(_0x4e1728,_0x1496b8){var _0x609ffa={'raw':!![],'where':{'id':_0x4e1728[_0x58f7('0x3c')]['id']}},_0x36697c={};_0x36697c[_0x58f7('0x2c')]=_[_0x58f7('0x2e')](db['ServicenowField'][_0x58f7('0x29')]);_0x36697c[_0x58f7('0x2d')]=_['keys'](_0x4e1728[_0x58f7('0x2d')]);_0x36697c[_0x58f7('0x2f')]=_['intersection'](_0x36697c['model'],_0x36697c['query']);_0x609ffa[_0x58f7('0x30')]=_[_0x58f7('0x3d')](_0x36697c['model'],qs['fields'](_0x4e1728[_0x58f7('0x2d')][_0x58f7('0x31')]));_0x609ffa[_0x58f7('0x30')]=_0x609ffa[_0x58f7('0x30')]['length']?_0x609ffa[_0x58f7('0x30')]:_0x36697c['model'];if(_0x4e1728['query']['includeAll']){_0x609ffa[_0x58f7('0x3e')]=[{'all':!![]}];}_0x609ffa=_[_0x58f7('0x39')]({},_0x609ffa,_0x4e1728[_0x58f7('0x3a')]);return db[_0x58f7('0x28')][_0x58f7('0x3f')](_0x609ffa)[_0x58f7('0x22')](handleEntityNotFound(_0x1496b8,null))[_0x58f7('0x22')](respondWithResult(_0x1496b8,null))[_0x58f7('0x3b')](handleError(_0x1496b8,null));};exports['create']=function(_0x190233,_0x396496){return db['ServicenowField'][_0x58f7('0x40')](_0x190233[_0x58f7('0x41')],{})[_0x58f7('0x22')](respondWithResult(_0x396496,0xc9))[_0x58f7('0x3b')](handleError(_0x396496,null));};exports[_0x58f7('0x21')]=function(_0x50037b,_0x504918){if(_0x50037b[_0x58f7('0x41')]['id']){delete _0x50037b[_0x58f7('0x41')]['id'];}return db['ServicenowField'][_0x58f7('0x3f')]({'where':{'id':_0x50037b['params']['id']}})[_0x58f7('0x22')](handleEntityNotFound(_0x504918,null))[_0x58f7('0x22')](saveUpdates(_0x50037b[_0x58f7('0x41')],null))[_0x58f7('0x22')](respondWithResult(_0x504918,null))[_0x58f7('0x3b')](handleError(_0x504918,null));};exports[_0x58f7('0x42')]=function(_0x3ba02b,_0x33ecca){return db[_0x58f7('0x28')][_0x58f7('0x3f')]({'where':{'id':_0x3ba02b[_0x58f7('0x3c')]['id']}})[_0x58f7('0x22')](handleEntityNotFound(_0x33ecca,null))[_0x58f7('0x22')](removeEntity(_0x33ecca,null))['catch'](handleError(_0x33ecca,null));};
\ No newline at end of file
index b9252b7..6fe404e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2802=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x4ab2aa,_0x24ad63){var _0x420443=function(_0x2f2fb3){while(--_0x2f2fb3){_0x4ab2aa['push'](_0x4ab2aa['shift']());}};_0x420443(++_0x24ad63);}(_0x2802,0xd2));var _0x2280=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x2802[_0x59f0dc];return _0x5b5445;};'use strict';var _=require(_0x2280('0x0'));var util=require(_0x2280('0x1'));var logger=require(_0x2280('0x2'))(_0x2280('0x3'));var moment=require(_0x2280('0x4'));var BPromise=require(_0x2280('0x5'));var rp=require(_0x2280('0x6'));var fs=require('fs');var path=require(_0x2280('0x7'));var rimraf=require(_0x2280('0x8'));var config=require(_0x2280('0x9'));var attributes=require(_0x2280('0xa'));module['exports']=function(_0x1df6bd,_0x28da5b){return _0x1df6bd[_0x2280('0xb')](_0x2280('0xc'),attributes,{'tableName':_0x2280('0xd'),'paranoid':![],'indexes':[{'name':_0x2280('0xe'),'fields':[_0x2280('0xf'),_0x2280('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f13=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x3ce224,_0x32623d){var _0x4036ad=function(_0x5e9aad){while(--_0x5e9aad){_0x3ce224['push'](_0x3ce224['shift']());}};_0x4036ad(++_0x32623d);}(_0x7f13,0xd2));var _0x37f1=function(_0x524207,_0x343c59){_0x524207=_0x524207-0x0;var _0x4575ac=_0x7f13[_0x524207];return _0x4575ac;};'use strict';var _=require(_0x37f1('0x0'));var util=require(_0x37f1('0x1'));var logger=require(_0x37f1('0x2'))(_0x37f1('0x3'));var moment=require(_0x37f1('0x4'));var BPromise=require(_0x37f1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x37f1('0x6'));var config=require(_0x37f1('0x7'));var attributes=require(_0x37f1('0x8'));module[_0x37f1('0x9')]=function(_0x3c135a,_0x1a1f69){return _0x3c135a[_0x37f1('0xa')](_0x37f1('0xb'),attributes,{'tableName':_0x37f1('0xc'),'paranoid':![],'indexes':[{'name':_0x37f1('0xd'),'fields':[_0x37f1('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 867355a..c322d48 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(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xac4a,0x13f));var _0xaac4=function(_0x4f0fa8,_0x5d80d1){_0x4f0fa8=_0x4f0fa8-0x0;var _0x41cfc3=_0xac4a[_0x4f0fa8];return _0x41cfc3;};'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 _0xf4eb=['ServicenowField,\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(_0x1cfba1,_0xceafc){var _0x4fd6aa=function(_0x27e430){while(--_0x27e430){_0x1cfba1['push'](_0x1cfba1['shift']());}};_0x4fd6aa(++_0xceafc);}(_0xf4eb,0xec));var _0xbf4e=function(_0x887c16,_0x37274a){_0x887c16=_0x887c16-0x0;var _0xa4a814=_0xf4eb[_0x887c16];return _0xa4a814;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
index 7fba95e..2569b85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x65a0ec,_0x2e167b){var _0x3d62b2=function(_0x58b517){while(--_0x58b517){_0x65a0ec['push'](_0x65a0ec['shift']());}};_0x3d62b2(++_0x2e167b);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x38bb02,_0x12259d){var _0x317b25=function(_0x1de8b8){while(--_0x1de8b8){_0x38bb02['push'](_0x38bb02['shift']());}};_0x317b25(++_0x12259d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 8385720..6432ef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5099b1,_0xaac67b){var _0x212e0a=function(_0x32508e){while(--_0x32508e){_0x5099b1['push'](_0x5099b1['shift']());}};_0x212e0a(++_0xaac67b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x181c32,_0x15a428){var _0x4d2df6=function(_0xa1e901){while(--_0xa1e901){_0x181c32['push'](_0x181c32['shift']());}};_0x4d2df6(++_0x15a428);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 cff456a..dabf42a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b15=['getConfigurations','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','remove','includes','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body'];(function(_0x432d97,_0xdd9c1d){var _0x5533d3=function(_0x204681){while(--_0x204681){_0x432d97['push'](_0x432d97['shift']());}};_0x5533d3(++_0xdd9c1d);}(_0x9b15,0xaa));var _0x59b1=function(_0x1619fc,_0x3377f8){_0x1619fc=_0x1619fc-0x0;var _0x4e36b8=_0x9b15[_0x1619fc];return _0x4e36b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59b1('0x0'));var zipdir=require(_0x59b1('0x1'));var jsonpatch=require(_0x59b1('0x2'));var rp=require(_0x59b1('0x3'));var moment=require(_0x59b1('0x4'));var BPromise=require(_0x59b1('0x5'));var Mustache=require(_0x59b1('0x6'));var util=require('util');var path=require(_0x59b1('0x7'));var sox=require('sox');var csv=require(_0x59b1('0x8'));var ejs=require(_0x59b1('0x9'));var fs=require('fs');var fs_extra=require(_0x59b1('0xa'));var _=require(_0x59b1('0xb'));var squel=require(_0x59b1('0xc'));var crypto=require(_0x59b1('0xd'));var jsforce=require(_0x59b1('0xe'));var deskjs=require(_0x59b1('0xf'));var toCsv=require(_0x59b1('0x8'));var querystring=require('querystring');var Papa=require(_0x59b1('0x10'));var Redis=require(_0x59b1('0x11'));var authService=require(_0x59b1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x59b1('0x13'));var hardwareService=require(_0x59b1('0x14'));var logger=require('../../config/logger')(_0x59b1('0x15'));var utils=require(_0x59b1('0x16'));var config=require(_0x59b1('0x17'));var licenseUtil=require(_0x59b1('0x18'));var db=require(_0x59b1('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4469d8,_0x31513b){_0x31513b=_0x31513b||0xcc;return function(_0x1ec253){if(_0x1ec253){return _0x4469d8[_0x59b1('0x1a')](_0x31513b);}return _0x4469d8[_0x59b1('0x1b')](_0x31513b)[_0x59b1('0x1c')]();};}function respondWithResult(_0x2eed35,_0x5f03b2){_0x5f03b2=_0x5f03b2||0xc8;return function(_0x3f2f41){if(_0x3f2f41){return _0x2eed35['status'](_0x5f03b2)[_0x59b1('0x1d')](_0x3f2f41);}};}function respondWithFilteredResult(_0x3dc088,_0x151663){return function(_0x47d814){if(_0x47d814){var _0x156b4e=typeof _0x151663[_0x59b1('0x1e')]==='undefined'&&typeof _0x151663[_0x59b1('0x1f')]===_0x59b1('0x20');var _0x5dfeaa=_0x47d814[_0x59b1('0x21')];var _0x437835=_0x156b4e?0x0:_0x151663[_0x59b1('0x1e')];var _0x213ab1=_0x156b4e?_0x47d814['count']:_0x151663[_0x59b1('0x1e')]+_0x151663[_0x59b1('0x1f')];var _0x154ae6;if(_0x213ab1>=_0x5dfeaa){_0x213ab1=_0x5dfeaa;_0x154ae6=0xc8;}else{_0x154ae6=0xce;}_0x3dc088[_0x59b1('0x1b')](_0x154ae6);return _0x3dc088[_0x59b1('0x22')](_0x59b1('0x23'),_0x437835+'-'+_0x213ab1+'/'+_0x5dfeaa)[_0x59b1('0x1d')](_0x47d814);}return null;};}function patchUpdates(_0x256726){return function(_0x1c8ad2){try{jsonpatch[_0x59b1('0x24')](_0x1c8ad2,_0x256726,!![]);}catch(_0xf67d68){return BPromise[_0x59b1('0x25')](_0xf67d68);}return _0x1c8ad2[_0x59b1('0x26')]();};}function saveUpdates(_0x1b0173,_0x3d6079){return function(_0x436afe){if(_0x436afe){return _0x436afe['update'](_0x1b0173)[_0x59b1('0x27')](function(_0x2003d9){return _0x2003d9;});}return null;};}function removeEntity(_0x49277f,_0x1ba97b){return function(_0x41c424){if(_0x41c424){return _0x41c424[_0x59b1('0x28')]()['then'](function(){_0x49277f['status'](0xcc)[_0x59b1('0x1c')]();});}};}function handleEntityNotFound(_0x4a3914,_0x324ac1){return function(_0x10ebbd){if(!_0x10ebbd){_0x4a3914[_0x59b1('0x1a')](0x194);}return _0x10ebbd;};}function handleError(_0x2cebd2,_0x1c4559){_0x1c4559=_0x1c4559||0x1f4;return function(_0x36665f){logger[_0x59b1('0x29')](_0x36665f[_0x59b1('0x2a')]);if(_0x36665f[_0x59b1('0x2b')]){delete _0x36665f['name'];}_0x2cebd2[_0x59b1('0x1b')](_0x1c4559)[_0x59b1('0x2c')](_0x36665f);};}exports[_0x59b1('0x2d')]=function(_0x4d4ab8,_0x4ee0df){var _0x5e7d36={},_0x5421f7={},_0x48fcaa={'count':0x0,'rows':[]};var _0x5253b3=_[_0x59b1('0x2e')](db[_0x59b1('0x2f')][_0x59b1('0x30')],function(_0x1e8999){return{'name':_0x1e8999[_0x59b1('0x31')],'type':_0x1e8999[_0x59b1('0x32')][_0x59b1('0x33')]};});_0x5421f7[_0x59b1('0x34')]=_[_0x59b1('0x2e')](_0x5253b3,_0x59b1('0x2b'));_0x5421f7[_0x59b1('0x35')]=_['keys'](_0x4d4ab8['query']);_0x5421f7[_0x59b1('0x36')]=_[_0x59b1('0x37')](_0x5421f7[_0x59b1('0x34')],_0x5421f7[_0x59b1('0x35')]);_0x5e7d36[_0x59b1('0x38')]=_[_0x59b1('0x37')](_0x5421f7['model'],qs[_0x59b1('0x39')](_0x4d4ab8[_0x59b1('0x35')]['fields']));_0x5e7d36[_0x59b1('0x38')]=_0x5e7d36[_0x59b1('0x38')][_0x59b1('0x3a')]?_0x5e7d36[_0x59b1('0x38')]:_0x5421f7['model'];if(!_0x4d4ab8[_0x59b1('0x35')][_0x59b1('0x3b')]('nolimit')){_0x5e7d36[_0x59b1('0x1f')]=qs[_0x59b1('0x1f')](_0x4d4ab8['query'][_0x59b1('0x1f')]);_0x5e7d36['offset']=qs[_0x59b1('0x1e')](_0x4d4ab8[_0x59b1('0x35')]['offset']);}_0x5e7d36[_0x59b1('0x3c')]=qs[_0x59b1('0x3d')](_0x4d4ab8[_0x59b1('0x35')][_0x59b1('0x3d')]);_0x5e7d36[_0x59b1('0x3e')]=qs[_0x59b1('0x36')](_[_0x59b1('0x3f')](_0x4d4ab8[_0x59b1('0x35')],_0x5421f7[_0x59b1('0x36')]),_0x5253b3);if(_0x4d4ab8[_0x59b1('0x35')][_0x59b1('0x40')]){_0x5e7d36[_0x59b1('0x3e')]=_['merge'](_0x5e7d36[_0x59b1('0x3e')],{'$or':_['map'](_0x5253b3,function(_0xe0e7ac){if(_0xe0e7ac[_0x59b1('0x32')]!==_0x59b1('0x41')){var _0x3b39a9={};_0x3b39a9[_0xe0e7ac[_0x59b1('0x2b')]]={'$like':'%'+_0x4d4ab8[_0x59b1('0x35')][_0x59b1('0x40')]+'%'};return _0x3b39a9;}})});}_0x5e7d36=_[_0x59b1('0x42')]({},_0x5e7d36,_0x4d4ab8[_0x59b1('0x43')]);var _0x56e488={'where':_0x5e7d36[_0x59b1('0x3e')]};return db[_0x59b1('0x2f')]['count'](_0x56e488)[_0x59b1('0x27')](function(_0x434fc4){_0x48fcaa[_0x59b1('0x21')]=_0x434fc4;if(_0x4d4ab8['query'][_0x59b1('0x44')]){_0x5e7d36[_0x59b1('0x45')]=[{'all':!![]}];}return db[_0x59b1('0x2f')][_0x59b1('0x46')](_0x5e7d36);})['then'](function(_0x406069){_0x48fcaa[_0x59b1('0x47')]=_0x406069;return _0x48fcaa;})[_0x59b1('0x27')](respondWithFilteredResult(_0x4ee0df,_0x5e7d36))[_0x59b1('0x48')](handleError(_0x4ee0df,null));};exports['show']=function(_0x5bd922,_0x2e15e5){var _0x849027={'raw':![],'where':{'id':_0x5bd922[_0x59b1('0x49')]['id']}},_0x50f5ea={};_0x50f5ea[_0x59b1('0x34')]=_[_0x59b1('0x4a')](db[_0x59b1('0x2f')][_0x59b1('0x30')]);_0x50f5ea['query']=_['keys'](_0x5bd922[_0x59b1('0x35')]);_0x50f5ea[_0x59b1('0x36')]=_[_0x59b1('0x37')](_0x50f5ea[_0x59b1('0x34')],_0x50f5ea[_0x59b1('0x35')]);_0x849027[_0x59b1('0x38')]=_[_0x59b1('0x37')](_0x50f5ea[_0x59b1('0x34')],qs['fields'](_0x5bd922[_0x59b1('0x35')][_0x59b1('0x39')]));_0x849027['attributes']=_0x849027['attributes'][_0x59b1('0x3a')]?_0x849027[_0x59b1('0x38')]:_0x50f5ea['model'];if(_0x5bd922[_0x59b1('0x35')]['includeAll']){_0x849027[_0x59b1('0x45')]=[{'all':!![]}];}_0x849027=_['merge']({},_0x849027,_0x5bd922[_0x59b1('0x43')]);return db['SugarcrmAccount'][_0x59b1('0x4b')](_0x849027)[_0x59b1('0x27')](handleEntityNotFound(_0x2e15e5,null))['then'](respondWithResult(_0x2e15e5,null))[_0x59b1('0x48')](handleError(_0x2e15e5,null));};exports[_0x59b1('0x4c')]=function(_0x304e8c,_0x5c3a8f){return db[_0x59b1('0x2f')][_0x59b1('0x4c')](_0x304e8c[_0x59b1('0x4d')],{})[_0x59b1('0x27')](respondWithResult(_0x5c3a8f,0xc9))[_0x59b1('0x48')](handleError(_0x5c3a8f,null));};exports['update']=function(_0x1e8416,_0x526509){if(_0x1e8416['body']['id']){delete _0x1e8416[_0x59b1('0x4d')]['id'];}return db['SugarcrmAccount'][_0x59b1('0x4b')]({'where':{'id':_0x1e8416[_0x59b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x526509,null))[_0x59b1('0x27')](saveUpdates(_0x1e8416[_0x59b1('0x4d')],null))[_0x59b1('0x27')](respondWithResult(_0x526509,null))[_0x59b1('0x48')](handleError(_0x526509,null));};exports[_0x59b1('0x28')]=function(_0x4f66cd,_0x2dcf0b){return db[_0x59b1('0x2f')][_0x59b1('0x4b')]({'where':{'id':_0x4f66cd['params']['id']}})['then'](handleEntityNotFound(_0x2dcf0b,null))[_0x59b1('0x27')](removeEntity(_0x2dcf0b,null))[_0x59b1('0x48')](handleError(_0x2dcf0b,null));};exports[_0x59b1('0x4e')]=function(_0x178d07,_0x5d3da6,_0x205e92){var _0x2500e0={};var _0x4936cf={};var _0x5dadc8;var _0x51add9;return db[_0x59b1('0x2f')][_0x59b1('0x4f')]({'where':{'id':_0x178d07[_0x59b1('0x49')]['id']}})[_0x59b1('0x27')](handleEntityNotFound(_0x5d3da6,null))[_0x59b1('0x27')](function(_0x51d6aa){if(_0x51d6aa){_0x5dadc8=_0x51d6aa;_0x4936cf[_0x59b1('0x34')]=_[_0x59b1('0x4a')](db['SugarcrmConfiguration'][_0x59b1('0x30')]);_0x4936cf[_0x59b1('0x35')]=_[_0x59b1('0x4a')](_0x178d07[_0x59b1('0x35')]);_0x4936cf['filters']=_[_0x59b1('0x37')](_0x4936cf[_0x59b1('0x34')],_0x4936cf[_0x59b1('0x35')]);_0x2500e0[_0x59b1('0x38')]=_['intersection'](_0x4936cf['model'],qs[_0x59b1('0x39')](_0x178d07[_0x59b1('0x35')][_0x59b1('0x39')]));_0x2500e0[_0x59b1('0x38')]=_0x2500e0['attributes'][_0x59b1('0x3a')]?_0x2500e0[_0x59b1('0x38')]:_0x4936cf['model'];_0x2500e0[_0x59b1('0x3c')]=qs[_0x59b1('0x3d')](_0x178d07[_0x59b1('0x35')][_0x59b1('0x3d')]);_0x2500e0[_0x59b1('0x3e')]=qs[_0x59b1('0x36')](_[_0x59b1('0x3f')](_0x178d07[_0x59b1('0x35')],_0x4936cf['filters']));if(_0x178d07['query'][_0x59b1('0x40')]){_0x2500e0[_0x59b1('0x3e')]=_['merge'](_0x2500e0[_0x59b1('0x3e')],{'$or':_[_0x59b1('0x2e')](_0x2500e0['attributes'],function(_0xdeca7d){var _0x42d141={};_0x42d141[_0xdeca7d]={'$like':'%'+_0x178d07['query'][_0x59b1('0x40')]+'%'};return _0x42d141;})});}_0x2500e0=_[_0x59b1('0x42')]({},_0x2500e0,_0x178d07[_0x59b1('0x43')]);return _0x5dadc8[_0x59b1('0x4e')](_0x2500e0);}})[_0x59b1('0x27')](function(_0xfc6f86){if(_0xfc6f86){_0x51add9=_0xfc6f86[_0x59b1('0x3a')];if(!_0x178d07['query'][_0x59b1('0x3b')]('nolimit')){_0x2500e0['limit']=qs[_0x59b1('0x1f')](_0x178d07[_0x59b1('0x35')]['limit']);_0x2500e0[_0x59b1('0x1e')]=qs[_0x59b1('0x1e')](_0x178d07[_0x59b1('0x35')][_0x59b1('0x1e')]);}return _0x5dadc8[_0x59b1('0x4e')](_0x2500e0);}})[_0x59b1('0x27')](function(_0x132e25){if(_0x132e25){return _0x132e25?{'count':_0x51add9,'rows':_0x132e25}:null;}})[_0x59b1('0x27')](respondWithResult(_0x5d3da6,null))['catch'](handleError(_0x5d3da6,null));};exports['addConfiguration']=function(_0x1d2890,_0x175175,_0x3b7b54){if(_0x1d2890['body']['id']){delete _0x1d2890[_0x59b1('0x4d')]['id'];}return db[_0x59b1('0x2f')][_0x59b1('0x4f')]({'where':{'id':_0x1d2890[_0x59b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x175175,null))[_0x59b1('0x27')](function(_0x2a3b69){if(_0x2a3b69){_0x1d2890[_0x59b1('0x4d')][_0x59b1('0x50')]=_0x2a3b69['id'];_0x1d2890[_0x59b1('0x4d')]['Subjects']=integrations[_0x59b1('0x51')](_0x1d2890[_0x59b1('0x4d')]['channel'],_0x1d2890[_0x59b1('0x4d')][_0x59b1('0x32')]);_0x1d2890[_0x59b1('0x4d')][_0x59b1('0x52')]=integrations[_0x59b1('0x53')](_0x1d2890[_0x59b1('0x4d')][_0x59b1('0x54')],_0x1d2890['body'][_0x59b1('0x32')]);return db['SugarcrmConfiguration']['create'](_0x1d2890[_0x59b1('0x4d')],{'include':[{'model':db['SugarcrmField'],'as':_0x59b1('0x55')},{'model':db[_0x59b1('0x56')],'as':_0x59b1('0x52')}]});}return null;})['then'](respondWithResult(_0x175175,null))['catch'](handleError(_0x175175,null));};exports[_0x59b1('0x57')]=function(_0x4b6b35,_0x5e8579,_0x3bd50f){var _0x5de96c='';var _0x3d889f=['id',_0x59b1('0x2b'),_0x59b1('0x58'),_0x59b1('0x59'),_0x59b1('0x5a'),_0x59b1('0x5b'),_0x59b1('0x5c'),_0x59b1('0x5d'),_0x59b1('0x5e'),'parent_type',_0x59b1('0x5f'),_0x59b1('0x60')];return db[_0x59b1('0x2f')][_0x59b1('0x4f')]({'where':{'id':_0x4b6b35[_0x59b1('0x49')]['id']},'attributes':['id',_0x59b1('0x61'),_0x59b1('0x62'),'remoteUri']})['then'](handleEntityNotFound(_0x5e8579,null))['then'](function(_0x37d639){if(_0x37d639){_0x5de96c=_0x37d639['remoteUri'];var _0x56d5a7=_0x5de96c[_0x59b1('0x63')](-0x1);if(_0x56d5a7==='/'){_0x5de96c=_0x5de96c[_0x59b1('0x64')](0x0,_0x5de96c[_0x59b1('0x65')](_0x56d5a7));}return rp({'method':_0x59b1('0x66'),'uri':util[_0x59b1('0x67')](_0x59b1('0x68'),_0x5de96c,_0x59b1('0x69')),'json':!![],'form':{'method':_0x59b1('0x6a'),'input_type':_0x59b1('0x6b'),'response_type':_0x59b1('0x6b'),'rest_data':JSON[_0x59b1('0x6c')]({'user_auth':{'user_name':_0x37d639[_0x59b1('0x61')],'password':_0x37d639[_0x59b1('0x62')],'encryption':_0x59b1('0x6d')},'application':_0x59b1('0x6e')})}});}})[_0x59b1('0x27')](function(_0x1aaaee){if(_0x1aaaee&&_0x1aaaee[_0x59b1('0x2b')]!==_0x59b1('0x6f')&&_0x1aaaee[_0x59b1('0x2b')]!==_0x59b1('0x70')){return rp({'method':_0x59b1('0x66'),'uri':util[_0x59b1('0x67')](_0x59b1('0x68'),_0x5de96c,_0x59b1('0x69')),'json':!![],'form':{'method':_0x59b1('0x71'),'input_type':_0x59b1('0x6b'),'response_type':_0x59b1('0x6b'),'rest_data':JSON[_0x59b1('0x6c')]({'session':_0x1aaaee['id'],'module_name':_0x59b1('0x72')})}})[_0x59b1('0x27')](function(_0xcb05e8){if(_0xcb05e8){var _0x133e9a=_['values'](_0xcb05e8[_0x59b1('0x73')]);_[_0x59b1('0x74')](_0x133e9a,function(_0x1ad15a){return _0x3d889f[_0x59b1('0x75')](_0x1ad15a[_0x59b1('0x2b')]);});return{'count':_0x133e9a[_0x59b1('0x3a')],'rows':_[_0x59b1('0x2e')](_0x133e9a,function(_0x3ba5f7){return{'id':_0x3ba5f7[_0x59b1('0x2b')],'name':_0x3ba5f7['label'],'custom':_['endsWith'](_0x3ba5f7[_0x59b1('0x2b')],'_c')?!![]:![],'options':_0x3ba5f7[_0x59b1('0x43')]?_[_0x59b1('0x2e')](_[_0x59b1('0x76')](_0x3ba5f7[_0x59b1('0x43')]),function(_0x25256f){return{'name':_0x25256f[_0x59b1('0x77')],'value':_0x25256f[_0x59b1('0x2b')]};}):[]};})};}})[_0x59b1('0x27')](respondWithResult(_0x5e8579,null))[_0x59b1('0x48')](function(_0x17ba7e){var _0x1d509d=_0x4b6b35[_0x59b1('0x35')][_0x59b1('0x78')]?0x1f4:_0x17ba7e[_0x59b1('0x79')]||0x1f4;logger[_0x59b1('0x29')](_0x59b1('0x7a'),_0x59b1('0x57'),_0x1d509d,JSON[_0x59b1('0x6c')](_0x17ba7e));delete _0x17ba7e[_0x59b1('0x2b')];if(_0x1d509d===0x191){_0x1d509d=0x190;}_0x5e8579[_0x59b1('0x1b')](_0x1d509d)[_0x59b1('0x2c')](_0x4b6b35[_0x59b1('0x35')][_0x59b1('0x78')]?{'message':_0x59b1('0x7b'),'statusCode':_0x17ba7e[_0x59b1('0x79')]}:_0x17ba7e);});}else{var _0x5e4510=0x1f4;_0x5e8579[_0x59b1('0x1b')](_0x5e4510)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0xd046=['duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','/service/v4_1/rest.php','login','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','%s%s','get_module_fields','JSON','Calls','values','module_fields','remove','endsWith','value','test','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','destroy','then','stack','name','send','map','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SugarcrmAccount','includeAll','findAll','rows','catch','params','include','options','find','create','body','update','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','getFields','assigned_user_id','created_by','description','duration_hours'];(function(_0x2158a6,_0x11993c){var _0x4da6ed=function(_0xadf211){while(--_0xadf211){_0x2158a6['push'](_0x2158a6['shift']());}};_0x4da6ed(++_0x11993c);}(_0xd046,0x177));var _0x6d04=function(_0x35586f,_0x35e12b){_0x35586f=_0x35586f-0x0;var _0x435ed9=_0xd046[_0x35586f];return _0x435ed9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6d04('0x0'));var jsonpatch=require(_0x6d04('0x1'));var rp=require('request-promise');var moment=require(_0x6d04('0x2'));var BPromise=require(_0x6d04('0x3'));var Mustache=require(_0x6d04('0x4'));var util=require(_0x6d04('0x5'));var path=require(_0x6d04('0x6'));var sox=require(_0x6d04('0x7'));var csv=require(_0x6d04('0x8'));var ejs=require(_0x6d04('0x9'));var fs=require('fs');var fs_extra=require(_0x6d04('0xa'));var _=require(_0x6d04('0xb'));var squel=require(_0x6d04('0xc'));var crypto=require('crypto');var jsforce=require(_0x6d04('0xd'));var deskjs=require(_0x6d04('0xe'));var toCsv=require(_0x6d04('0x8'));var querystring=require(_0x6d04('0xf'));var Papa=require('papaparse');var Redis=require(_0x6d04('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6d04('0x11'));var hardwareService=require(_0x6d04('0x12'));var logger=require(_0x6d04('0x13'))('api');var utils=require(_0x6d04('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d04('0x15'))['db'];var integrations=require(_0x6d04('0x16'));function respondWithStatusCode(_0x40c56c,_0x18ec9a){_0x18ec9a=_0x18ec9a||0xcc;return function(_0x51a0dc){if(_0x51a0dc){return _0x40c56c[_0x6d04('0x17')](_0x18ec9a);}return _0x40c56c[_0x6d04('0x18')](_0x18ec9a)['end']();};}function respondWithResult(_0x5f49ab,_0x12c1a6){_0x12c1a6=_0x12c1a6||0xc8;return function(_0x14a471){if(_0x14a471){return _0x5f49ab[_0x6d04('0x18')](_0x12c1a6)[_0x6d04('0x19')](_0x14a471);}};}function respondWithFilteredResult(_0x25e91a,_0x2bfe93){return function(_0x299ca8){if(_0x299ca8){var _0x150647=typeof _0x2bfe93['offset']===_0x6d04('0x1a')&&typeof _0x2bfe93[_0x6d04('0x1b')]===_0x6d04('0x1a');var _0x119dbf=_0x299ca8[_0x6d04('0x1c')];var _0x4fa303=_0x150647?0x0:_0x2bfe93[_0x6d04('0x1d')];var _0x284311=_0x150647?_0x299ca8['count']:_0x2bfe93[_0x6d04('0x1d')]+_0x2bfe93[_0x6d04('0x1b')];var _0x49e720;if(_0x284311>=_0x119dbf){_0x284311=_0x119dbf;_0x49e720=0xc8;}else{_0x49e720=0xce;}_0x25e91a[_0x6d04('0x18')](_0x49e720);return _0x25e91a[_0x6d04('0x1e')](_0x6d04('0x1f'),_0x4fa303+'-'+_0x284311+'/'+_0x119dbf)[_0x6d04('0x19')](_0x299ca8);}return null;};}function patchUpdates(_0x8731c){return function(_0xab782a){try{jsonpatch[_0x6d04('0x20')](_0xab782a,_0x8731c,!![]);}catch(_0x327b89){return BPromise['reject'](_0x327b89);}return _0xab782a['save']();};}function saveUpdates(_0x27f17c,_0x4ee04e){return function(_0x32844b){if(_0x32844b){return _0x32844b['update'](_0x27f17c)['then'](function(_0x1c43a5){return _0x1c43a5;});}return null;};}function removeEntity(_0x3ff4b1,_0x40fcde){return function(_0x58c1ad){if(_0x58c1ad){return _0x58c1ad[_0x6d04('0x21')]()[_0x6d04('0x22')](function(){_0x3ff4b1[_0x6d04('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fbbc4,_0x262660){return function(_0x69de26){if(!_0x69de26){_0x3fbbc4[_0x6d04('0x17')](0x194);}return _0x69de26;};}function handleError(_0x1fa383,_0x1e7f96){_0x1e7f96=_0x1e7f96||0x1f4;return function(_0x4bf3fa){logger['error'](_0x4bf3fa[_0x6d04('0x23')]);if(_0x4bf3fa[_0x6d04('0x24')]){delete _0x4bf3fa[_0x6d04('0x24')];}_0x1fa383[_0x6d04('0x18')](_0x1e7f96)[_0x6d04('0x25')](_0x4bf3fa);};}exports['index']=function(_0x29bba9,_0x4f8575){var _0x343efa={},_0x5d8b02={},_0x3b336c={'count':0x0,'rows':[]};var _0x2cb56d=_[_0x6d04('0x26')](db['SugarcrmAccount'][_0x6d04('0x27')],function(_0x1c99b2){return{'name':_0x1c99b2['fieldName'],'type':_0x1c99b2[_0x6d04('0x28')]['key']};});_0x5d8b02[_0x6d04('0x29')]=_[_0x6d04('0x26')](_0x2cb56d,_0x6d04('0x24'));_0x5d8b02[_0x6d04('0x2a')]=_[_0x6d04('0x2b')](_0x29bba9[_0x6d04('0x2a')]);_0x5d8b02['filters']=_[_0x6d04('0x2c')](_0x5d8b02[_0x6d04('0x29')],_0x5d8b02['query']);_0x343efa['attributes']=_[_0x6d04('0x2c')](_0x5d8b02[_0x6d04('0x29')],qs['fields'](_0x29bba9['query'][_0x6d04('0x2d')]));_0x343efa[_0x6d04('0x2e')]=_0x343efa[_0x6d04('0x2e')][_0x6d04('0x2f')]?_0x343efa[_0x6d04('0x2e')]:_0x5d8b02[_0x6d04('0x29')];if(!_0x29bba9[_0x6d04('0x2a')]['hasOwnProperty'](_0x6d04('0x30'))){_0x343efa[_0x6d04('0x1b')]=qs[_0x6d04('0x1b')](_0x29bba9['query'][_0x6d04('0x1b')]);_0x343efa[_0x6d04('0x1d')]=qs[_0x6d04('0x1d')](_0x29bba9[_0x6d04('0x2a')][_0x6d04('0x1d')]);}_0x343efa[_0x6d04('0x31')]=qs[_0x6d04('0x32')](_0x29bba9['query'][_0x6d04('0x32')]);_0x343efa[_0x6d04('0x33')]=qs[_0x6d04('0x34')](_[_0x6d04('0x35')](_0x29bba9[_0x6d04('0x2a')],_0x5d8b02[_0x6d04('0x34')]),_0x2cb56d);if(_0x29bba9[_0x6d04('0x2a')][_0x6d04('0x36')]){_0x343efa[_0x6d04('0x33')]=_[_0x6d04('0x37')](_0x343efa[_0x6d04('0x33')],{'$or':_['map'](_0x2cb56d,function(_0x684177){if(_0x684177[_0x6d04('0x28')]!==_0x6d04('0x38')){var _0x420f0d={};_0x420f0d[_0x684177['name']]={'$like':'%'+_0x29bba9[_0x6d04('0x2a')][_0x6d04('0x36')]+'%'};return _0x420f0d;}})});}_0x343efa=_[_0x6d04('0x37')]({},_0x343efa,_0x29bba9['options']);var _0x284f47={'where':_0x343efa[_0x6d04('0x33')]};return db[_0x6d04('0x39')][_0x6d04('0x1c')](_0x284f47)['then'](function(_0x2d9b67){_0x3b336c[_0x6d04('0x1c')]=_0x2d9b67;if(_0x29bba9[_0x6d04('0x2a')][_0x6d04('0x3a')]){_0x343efa['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x6d04('0x3b')](_0x343efa);})[_0x6d04('0x22')](function(_0x22dcfd){_0x3b336c[_0x6d04('0x3c')]=_0x22dcfd;return _0x3b336c;})['then'](respondWithFilteredResult(_0x4f8575,_0x343efa))[_0x6d04('0x3d')](handleError(_0x4f8575,null));};exports['show']=function(_0x3d7c55,_0x304302){var _0xef8313={'raw':![],'where':{'id':_0x3d7c55[_0x6d04('0x3e')]['id']}},_0x265e33={};_0x265e33[_0x6d04('0x29')]=_[_0x6d04('0x2b')](db[_0x6d04('0x39')][_0x6d04('0x27')]);_0x265e33[_0x6d04('0x2a')]=_[_0x6d04('0x2b')](_0x3d7c55[_0x6d04('0x2a')]);_0x265e33[_0x6d04('0x34')]=_[_0x6d04('0x2c')](_0x265e33[_0x6d04('0x29')],_0x265e33[_0x6d04('0x2a')]);_0xef8313[_0x6d04('0x2e')]=_[_0x6d04('0x2c')](_0x265e33[_0x6d04('0x29')],qs[_0x6d04('0x2d')](_0x3d7c55[_0x6d04('0x2a')]['fields']));_0xef8313[_0x6d04('0x2e')]=_0xef8313['attributes'][_0x6d04('0x2f')]?_0xef8313[_0x6d04('0x2e')]:_0x265e33[_0x6d04('0x29')];if(_0x3d7c55[_0x6d04('0x2a')][_0x6d04('0x3a')]){_0xef8313[_0x6d04('0x3f')]=[{'all':!![]}];}_0xef8313=_[_0x6d04('0x37')]({},_0xef8313,_0x3d7c55[_0x6d04('0x40')]);return db[_0x6d04('0x39')][_0x6d04('0x41')](_0xef8313)[_0x6d04('0x22')](handleEntityNotFound(_0x304302,null))[_0x6d04('0x22')](respondWithResult(_0x304302,null))[_0x6d04('0x3d')](handleError(_0x304302,null));};exports[_0x6d04('0x42')]=function(_0x4ba8ef,_0x1982c1){return db['SugarcrmAccount']['create'](_0x4ba8ef[_0x6d04('0x43')],{})[_0x6d04('0x22')](respondWithResult(_0x1982c1,0xc9))[_0x6d04('0x3d')](handleError(_0x1982c1,null));};exports[_0x6d04('0x44')]=function(_0x483330,_0x57ac31){if(_0x483330[_0x6d04('0x43')]['id']){delete _0x483330[_0x6d04('0x43')]['id'];}return db[_0x6d04('0x39')]['find']({'where':{'id':_0x483330[_0x6d04('0x3e')]['id']}})[_0x6d04('0x22')](handleEntityNotFound(_0x57ac31,null))['then'](saveUpdates(_0x483330[_0x6d04('0x43')],null))['then'](respondWithResult(_0x57ac31,null))[_0x6d04('0x3d')](handleError(_0x57ac31,null));};exports[_0x6d04('0x21')]=function(_0x5e5e24,_0x5d48e4){return db[_0x6d04('0x39')][_0x6d04('0x41')]({'where':{'id':_0x5e5e24[_0x6d04('0x3e')]['id']}})[_0x6d04('0x22')](handleEntityNotFound(_0x5d48e4,null))[_0x6d04('0x22')](removeEntity(_0x5d48e4,null))['catch'](handleError(_0x5d48e4,null));};exports[_0x6d04('0x45')]=function(_0x42bf63,_0x130d0e,_0x3114bc){var _0x1142c7={};var _0x314786={};var _0x3f3eac;var _0x19c47a;return db[_0x6d04('0x39')][_0x6d04('0x46')]({'where':{'id':_0x42bf63[_0x6d04('0x3e')]['id']}})['then'](handleEntityNotFound(_0x130d0e,null))[_0x6d04('0x22')](function(_0x38aa9a){if(_0x38aa9a){_0x3f3eac=_0x38aa9a;_0x314786[_0x6d04('0x29')]=_[_0x6d04('0x2b')](db['SugarcrmConfiguration']['rawAttributes']);_0x314786['query']=_[_0x6d04('0x2b')](_0x42bf63['query']);_0x314786['filters']=_[_0x6d04('0x2c')](_0x314786[_0x6d04('0x29')],_0x314786['query']);_0x1142c7['attributes']=_[_0x6d04('0x2c')](_0x314786['model'],qs['fields'](_0x42bf63['query'][_0x6d04('0x2d')]));_0x1142c7[_0x6d04('0x2e')]=_0x1142c7[_0x6d04('0x2e')]['length']?_0x1142c7[_0x6d04('0x2e')]:_0x314786[_0x6d04('0x29')];_0x1142c7[_0x6d04('0x31')]=qs['sort'](_0x42bf63[_0x6d04('0x2a')][_0x6d04('0x32')]);_0x1142c7['where']=qs[_0x6d04('0x34')](_['pick'](_0x42bf63[_0x6d04('0x2a')],_0x314786['filters']));if(_0x42bf63[_0x6d04('0x2a')][_0x6d04('0x36')]){_0x1142c7[_0x6d04('0x33')]=_['merge'](_0x1142c7[_0x6d04('0x33')],{'$or':_[_0x6d04('0x26')](_0x1142c7['attributes'],function(_0x269aac){var _0x18b8c9={};_0x18b8c9[_0x269aac]={'$like':'%'+_0x42bf63[_0x6d04('0x2a')][_0x6d04('0x36')]+'%'};return _0x18b8c9;})});}_0x1142c7=_[_0x6d04('0x37')]({},_0x1142c7,_0x42bf63[_0x6d04('0x40')]);return _0x3f3eac[_0x6d04('0x45')](_0x1142c7);}})[_0x6d04('0x22')](function(_0x1caae9){if(_0x1caae9){_0x19c47a=_0x1caae9[_0x6d04('0x2f')];if(!_0x42bf63['query'][_0x6d04('0x47')]('nolimit')){_0x1142c7[_0x6d04('0x1b')]=qs[_0x6d04('0x1b')](_0x42bf63['query'][_0x6d04('0x1b')]);_0x1142c7[_0x6d04('0x1d')]=qs[_0x6d04('0x1d')](_0x42bf63[_0x6d04('0x2a')][_0x6d04('0x1d')]);}return _0x3f3eac['getConfigurations'](_0x1142c7);}})[_0x6d04('0x22')](function(_0x4dd975){if(_0x4dd975){return _0x4dd975?{'count':_0x19c47a,'rows':_0x4dd975}:null;}})['then'](respondWithResult(_0x130d0e,null))[_0x6d04('0x3d')](handleError(_0x130d0e,null));};exports[_0x6d04('0x48')]=function(_0x21f60c,_0xcda8b8,_0x172004){if(_0x21f60c[_0x6d04('0x43')]['id']){delete _0x21f60c[_0x6d04('0x43')]['id'];}return db['SugarcrmAccount'][_0x6d04('0x46')]({'where':{'id':_0x21f60c['params']['id']}})[_0x6d04('0x22')](handleEntityNotFound(_0xcda8b8,null))['then'](function(_0x4bf2d9){if(_0x4bf2d9){_0x21f60c['body'][_0x6d04('0x49')]=_0x4bf2d9['id'];_0x21f60c[_0x6d04('0x43')][_0x6d04('0x4a')]=integrations[_0x6d04('0x4b')](_0x21f60c[_0x6d04('0x43')][_0x6d04('0x4c')],_0x21f60c[_0x6d04('0x43')][_0x6d04('0x28')]);_0x21f60c[_0x6d04('0x43')][_0x6d04('0x4d')]=integrations[_0x6d04('0x4e')](_0x21f60c['body'][_0x6d04('0x4c')],_0x21f60c[_0x6d04('0x43')][_0x6d04('0x28')]);return db[_0x6d04('0x4f')][_0x6d04('0x42')](_0x21f60c[_0x6d04('0x43')],{'include':[{'model':db['SugarcrmField'],'as':_0x6d04('0x4a')},{'model':db['SugarcrmField'],'as':_0x6d04('0x4d')}]});}return null;})[_0x6d04('0x22')](respondWithResult(_0xcda8b8,null))['catch'](handleError(_0xcda8b8,null));};exports[_0x6d04('0x50')]=function(_0x5851aa,_0x4b3965,_0x53fc63){var _0x4cf212='';var _0x5481c2=['id',_0x6d04('0x24'),_0x6d04('0x51'),_0x6d04('0x52'),_0x6d04('0x53'),'date_start',_0x6d04('0x54'),_0x6d04('0x55'),_0x6d04('0x56'),_0x6d04('0x57'),_0x6d04('0x58'),_0x6d04('0x59')];return db[_0x6d04('0x39')][_0x6d04('0x46')]({'where':{'id':_0x5851aa[_0x6d04('0x3e')]['id']},'attributes':['id',_0x6d04('0x5a'),_0x6d04('0x5b'),_0x6d04('0x5c')]})[_0x6d04('0x22')](handleEntityNotFound(_0x4b3965,null))[_0x6d04('0x22')](function(_0x31e165){if(_0x31e165){_0x4cf212=_0x31e165[_0x6d04('0x5c')];var _0x5ab6b3=_0x4cf212[_0x6d04('0x5d')](-0x1);if(_0x5ab6b3==='/'){_0x4cf212=_0x4cf212['substring'](0x0,_0x4cf212[_0x6d04('0x5e')](_0x5ab6b3));}return rp({'method':_0x6d04('0x5f'),'uri':util['format']('%s%s',_0x4cf212,_0x6d04('0x60')),'json':!![],'form':{'method':_0x6d04('0x61'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x6d04('0x62')]({'user_auth':{'user_name':_0x31e165[_0x6d04('0x5a')],'password':_0x31e165[_0x6d04('0x5b')],'encryption':_0x6d04('0x63')},'application':_0x6d04('0x64')})}});}})[_0x6d04('0x22')](function(_0x161992){if(_0x161992&&_0x161992[_0x6d04('0x24')]!==_0x6d04('0x65')&&_0x161992[_0x6d04('0x24')]!=='Password\x20Expired'){return rp({'method':_0x6d04('0x5f'),'uri':util[_0x6d04('0x66')](_0x6d04('0x67'),_0x4cf212,_0x6d04('0x60')),'json':!![],'form':{'method':_0x6d04('0x68'),'input_type':_0x6d04('0x69'),'response_type':_0x6d04('0x69'),'rest_data':JSON[_0x6d04('0x62')]({'session':_0x161992['id'],'module_name':_0x6d04('0x6a')})}})[_0x6d04('0x22')](function(_0x5ec86d){if(_0x5ec86d){var _0x4e6be4=_[_0x6d04('0x6b')](_0x5ec86d[_0x6d04('0x6c')]);_[_0x6d04('0x6d')](_0x4e6be4,function(_0x43e287){return _0x5481c2['includes'](_0x43e287[_0x6d04('0x24')]);});return{'count':_0x4e6be4[_0x6d04('0x2f')],'rows':_[_0x6d04('0x26')](_0x4e6be4,function(_0x430a61){return{'id':_0x430a61[_0x6d04('0x24')],'name':_0x430a61['label'],'custom':_[_0x6d04('0x6e')](_0x430a61[_0x6d04('0x24')],'_c')?!![]:![],'options':_0x430a61['options']?_[_0x6d04('0x26')](_['values'](_0x430a61[_0x6d04('0x40')]),function(_0x1c5dac){return{'name':_0x1c5dac[_0x6d04('0x6f')],'value':_0x1c5dac[_0x6d04('0x24')]};}):[]};})};}})[_0x6d04('0x22')](respondWithResult(_0x4b3965,null))[_0x6d04('0x3d')](function(_0x4b51da){var _0x2a2e66=_0x5851aa[_0x6d04('0x2a')][_0x6d04('0x70')]?0x1f4:_0x4b51da['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x6d04('0x50'),_0x2a2e66,JSON['stringify'](_0x4b51da));delete _0x4b51da[_0x6d04('0x24')];if(_0x2a2e66===0x191){_0x2a2e66=0x190;}_0x4b3965[_0x6d04('0x18')](_0x2a2e66)[_0x6d04('0x25')](_0x5851aa[_0x6d04('0x2a')]['test']?{'message':_0x6d04('0x71'),'statusCode':_0x4b51da[_0x6d04('0x72')]}:_0x4b51da);});}else{var _0x1776e0=0x1f4;_0x4b3965[_0x6d04('0x18')](_0x1776e0)[_0x6d04('0x25')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
index 690e0c6..fad9ffa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5005=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x55b3de,_0x300bce){var _0x4e3e03=function(_0x50fc70){while(--_0x50fc70){_0x55b3de['push'](_0x55b3de['shift']());}};_0x4e3e03(++_0x300bce);}(_0x5005,0x90));var _0x5500=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5005[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x5500('0x0'));var util=require(_0x5500('0x1'));var logger=require(_0x5500('0x2'))(_0x5500('0x3'));var moment=require(_0x5500('0x4'));var BPromise=require(_0x5500('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5500('0x6'));var config=require(_0x5500('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x5500('0x8'));module[_0x5500('0x9')]=function(_0x3643a4,_0x26ff42){return _0x3643a4['define'](_0x5500('0xa'),attributes,{'tableName':_0x5500('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1fbb=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','int_sugarcrm_accounts','lodash'];(function(_0x4c6a41,_0x27ae8c){var _0x4e350f=function(_0x1586e5){while(--_0x1586e5){_0x4c6a41['push'](_0x4c6a41['shift']());}};_0x4e350f(++_0x27ae8c);}(_0x1fbb,0x99));var _0xb1fb=function(_0x187067,_0x351263){_0x187067=_0x187067-0x0;var _0x448772=_0x1fbb[_0x187067];return _0x448772;};'use strict';var _=require(_0xb1fb('0x0'));var util=require(_0xb1fb('0x1'));var logger=require(_0xb1fb('0x2'))(_0xb1fb('0x3'));var moment=require('moment');var BPromise=require(_0xb1fb('0x4'));var rp=require(_0xb1fb('0x5'));var fs=require('fs');var path=require(_0xb1fb('0x6'));var rimraf=require(_0xb1fb('0x7'));var config=require(_0xb1fb('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xb1fb('0x9'));module['exports']=function(_0x5b1f9f,_0x27e1f0){return _0x5b1f9f['define']('SugarcrmAccount',attributes,{'tableName':_0xb1fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1381b0f..d90c446 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a2=['options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll'];(function(_0x401e25,_0x51ce02){var _0x192d3d=function(_0x1e43d3){while(--_0x1e43d3){_0x401e25['push'](_0x401e25['shift']());}};_0x192d3d(++_0x51ce02);}(_0x23a2,0x196));var _0x223a=function(_0x281ed1,_0x574ad1){_0x281ed1=_0x281ed1-0x0;var _0xe9ea94=_0x23a2[_0x281ed1];return _0xe9ea94;};'use strict';var _=require(_0x223a('0x0'));var util=require('util');var moment=require(_0x223a('0x1'));var BPromise=require(_0x223a('0x2'));var rs=require(_0x223a('0x3'));var fs=require('fs');var Redis=require(_0x223a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x223a('0x5'));var logger=require('../../config/logger')(_0x223a('0x6'));var config=require(_0x223a('0x7'));var jayson=require(_0x223a('0x8'));var client=jayson[_0x223a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ec4b8,_0x4aac0c,_0x32aca5){return new BPromise(function(_0x5679a3,_0x154cca){return client[_0x223a('0xa')](_0x4ec4b8,_0x32aca5)[_0x223a('0xb')](function(_0x2fbc76){logger[_0x223a('0xc')](_0x223a('0xd'),_0x4aac0c,_0x223a('0xe'));logger[_0x223a('0xf')](_0x223a('0x10'),_0x4aac0c,_0x223a('0xe'),JSON[_0x223a('0x11')](_0x2fbc76));if(_0x2fbc76['error']){if(_0x2fbc76[_0x223a('0x12')][_0x223a('0x13')]===0x1f4){logger[_0x223a('0x12')](_0x223a('0xd'),_0x4aac0c,_0x2fbc76[_0x223a('0x12')]['message']);return _0x154cca(_0x2fbc76[_0x223a('0x12')][_0x223a('0x14')]);}logger[_0x223a('0x12')](_0x223a('0xd'),_0x4aac0c,_0x2fbc76['error']['message']);return _0x5679a3(_0x2fbc76[_0x223a('0x12')][_0x223a('0x14')]);}else{logger['info'](_0x223a('0xd'),_0x4aac0c,_0x223a('0xe'));_0x5679a3(_0x2fbc76[_0x223a('0x15')]['message']);}})[_0x223a('0x16')](function(_0x54b8ec){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x4aac0c,_0x54b8ec);_0x154cca(_0x54b8ec);});});}exports[_0x223a('0x17')]=function(_0x524c6c){var _0x399b7c=this;return new Promise(function(_0x225ea1,_0x4d85f9){return db[_0x223a('0x18')][_0x223a('0x19')]({'raw':_0x524c6c[_0x223a('0x1a')]?_0x524c6c['options'][_0x223a('0x1b')]===undefined?!![]:![]:!![],'where':_0x524c6c[_0x223a('0x1a')]?_0x524c6c[_0x223a('0x1a')][_0x223a('0x1c')]||null:null,'attributes':_0x524c6c[_0x223a('0x1a')]?_0x524c6c[_0x223a('0x1a')][_0x223a('0x1d')]||null:null,'limit':_0x524c6c[_0x223a('0x1a')]?_0x524c6c[_0x223a('0x1a')][_0x223a('0x1e')]||null:null,'include':_0x524c6c[_0x223a('0x1a')]?_0x524c6c[_0x223a('0x1a')][_0x223a('0x1f')]?_[_0x223a('0x20')](_0x524c6c[_0x223a('0x1a')][_0x223a('0x1f')],function(_0x491ec4){return{'model':db[_0x491ec4[_0x223a('0x21')]],'as':_0x491ec4['as'],'attributes':_0x491ec4[_0x223a('0x1d')],'include':_0x491ec4[_0x223a('0x1f')]?_[_0x223a('0x20')](_0x491ec4[_0x223a('0x1f')],function(_0xc10699){return{'model':db[_0xc10699[_0x223a('0x21')]],'as':_0xc10699['as'],'attributes':_0xc10699[_0x223a('0x1d')],'include':_0xc10699['include']?_[_0x223a('0x20')](_0xc10699[_0x223a('0x1f')],function(_0xd55238){return{'model':db[_0xd55238[_0x223a('0x21')]],'as':_0xd55238['as'],'attributes':_0xd55238[_0x223a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x223a('0xb')](function(_0x5266bf){logger[_0x223a('0xc')](_0x223a('0x17'),_0x524c6c);logger['debug'](_0x223a('0x17'),_0x524c6c,JSON[_0x223a('0x11')](_0x5266bf));_0x225ea1(_0x5266bf);})[_0x223a('0x16')](function(_0x4c7f9c){logger[_0x223a('0x12')](_0x223a('0x17'),_0x4c7f9c[_0x223a('0x14')],_0x524c6c);_0x4d85f9(_0x399b7c[_0x223a('0x12')](0x1f4,_0x4c7f9c['message']));});});};exports[_0x223a('0x22')]=function(_0x540e14){var _0xb018a2=this;return new Promise(function(_0x1edfb6,_0x3dc60f){return db[_0x223a('0x18')][_0x223a('0x23')]({'raw':_0x540e14[_0x223a('0x1a')]?_0x540e14[_0x223a('0x1a')][_0x223a('0x1b')]===undefined?!![]:![]:!![],'where':_0x540e14['options']?_0x540e14[_0x223a('0x1a')][_0x223a('0x1c')]||null:null,'attributes':_0x540e14['options']?_0x540e14['options'][_0x223a('0x1d')]||null:null,'include':_0x540e14[_0x223a('0x1a')]?_0x540e14['options'][_0x223a('0x1f')]?_[_0x223a('0x20')](_0x540e14[_0x223a('0x1a')]['include'],function(_0x3a8c45){return{'model':db[_0x3a8c45[_0x223a('0x21')]],'as':_0x3a8c45['as'],'attributes':_0x3a8c45[_0x223a('0x1d')],'include':_0x3a8c45[_0x223a('0x1f')]?_['map'](_0x3a8c45[_0x223a('0x1f')],function(_0x1d463c){return{'model':db[_0x1d463c[_0x223a('0x21')]],'as':_0x1d463c['as'],'attributes':_0x1d463c[_0x223a('0x1d')],'include':_0x1d463c['include']?_[_0x223a('0x20')](_0x1d463c['include'],function(_0x5d7c95){return{'model':db[_0x5d7c95[_0x223a('0x21')]],'as':_0x5d7c95['as'],'attributes':_0x5d7c95[_0x223a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x223a('0xb')](function(_0x31da20){logger[_0x223a('0xc')](_0x223a('0x22'),_0x540e14);logger['debug'](_0x223a('0x22'),_0x540e14,JSON[_0x223a('0x11')](_0x31da20));_0x1edfb6(_0x31da20);})[_0x223a('0x16')](function(_0x29df6){logger[_0x223a('0x12')](_0x223a('0x22'),_0x29df6[_0x223a('0x14')],_0x540e14);_0x3dc60f(_0xb018a2['error'](0x1f4,_0x29df6[_0x223a('0x14')]));});});};
\ No newline at end of file
+var _0x20b9=['message','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','debug','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xf6ec8e,_0x5b3043){var _0x183d31=function(_0x374fea){while(--_0x374fea){_0xf6ec8e['push'](_0xf6ec8e['shift']());}};_0x183d31(++_0x5b3043);}(_0x20b9,0xb0));var _0x920b=function(_0x5e4b3d,_0x140952){_0x5e4b3d=_0x5e4b3d-0x0;var _0x2ddfa8=_0x20b9[_0x5e4b3d];return _0x2ddfa8;};'use strict';var _=require('lodash');var util=require(_0x920b('0x0'));var moment=require(_0x920b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x920b('0x2'));var db=require(_0x920b('0x3'))['db'];var utils=require(_0x920b('0x4'));var logger=require(_0x920b('0x5'))(_0x920b('0x6'));var config=require(_0x920b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x920b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfb7b7c,_0x56b1e1,_0x475f3c){return new BPromise(function(_0x402b15,_0x408c84){return client[_0x920b('0x9')](_0xfb7b7c,_0x475f3c)[_0x920b('0xa')](function(_0x49e146){logger[_0x920b('0xb')](_0x920b('0xc'),_0x56b1e1,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x56b1e1,_0x920b('0xd'),JSON[_0x920b('0xe')](_0x49e146));if(_0x49e146['error']){if(_0x49e146['error']['code']===0x1f4){logger[_0x920b('0xf')](_0x920b('0xc'),_0x56b1e1,_0x49e146[_0x920b('0xf')][_0x920b('0x10')]);return _0x408c84(_0x49e146[_0x920b('0xf')][_0x920b('0x10')]);}logger[_0x920b('0xf')](_0x920b('0xc'),_0x56b1e1,_0x49e146[_0x920b('0xf')][_0x920b('0x10')]);return _0x402b15(_0x49e146[_0x920b('0xf')][_0x920b('0x10')]);}else{logger['info'](_0x920b('0xc'),_0x56b1e1,_0x920b('0xd'));_0x402b15(_0x49e146['result'][_0x920b('0x10')]);}})[_0x920b('0x11')](function(_0x131262){logger[_0x920b('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x56b1e1,_0x131262);_0x408c84(_0x131262);});});}exports['GetSugarcrmAccount']=function(_0x3a67ea){var _0x1431b2=this;return new Promise(function(_0x54804a,_0x135cf4){return db[_0x920b('0x12')][_0x920b('0x13')]({'raw':_0x3a67ea[_0x920b('0x14')]?_0x3a67ea[_0x920b('0x14')][_0x920b('0x15')]===undefined?!![]:![]:!![],'where':_0x3a67ea[_0x920b('0x14')]?_0x3a67ea['options'][_0x920b('0x16')]||null:null,'attributes':_0x3a67ea[_0x920b('0x14')]?_0x3a67ea['options'][_0x920b('0x17')]||null:null,'limit':_0x3a67ea[_0x920b('0x14')]?_0x3a67ea[_0x920b('0x14')][_0x920b('0x18')]||null:null,'include':_0x3a67ea[_0x920b('0x14')]?_0x3a67ea[_0x920b('0x14')][_0x920b('0x19')]?_[_0x920b('0x1a')](_0x3a67ea[_0x920b('0x14')][_0x920b('0x19')],function(_0x3224c8){return{'model':db[_0x3224c8[_0x920b('0x1b')]],'as':_0x3224c8['as'],'attributes':_0x3224c8[_0x920b('0x17')],'include':_0x3224c8[_0x920b('0x19')]?_[_0x920b('0x1a')](_0x3224c8[_0x920b('0x19')],function(_0x89610c){return{'model':db[_0x89610c[_0x920b('0x1b')]],'as':_0x89610c['as'],'attributes':_0x89610c['attributes'],'include':_0x89610c[_0x920b('0x19')]?_[_0x920b('0x1a')](_0x89610c[_0x920b('0x19')],function(_0x7877b8){return{'model':db[_0x7877b8[_0x920b('0x1b')]],'as':_0x7877b8['as'],'attributes':_0x7877b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x920b('0xa')](function(_0x3b806c){logger[_0x920b('0xb')](_0x920b('0x1c'),_0x3a67ea);logger['debug'](_0x920b('0x1c'),_0x3a67ea,JSON[_0x920b('0xe')](_0x3b806c));_0x54804a(_0x3b806c);})[_0x920b('0x11')](function(_0x1abbf2){logger['error'](_0x920b('0x1c'),_0x1abbf2[_0x920b('0x10')],_0x3a67ea);_0x135cf4(_0x1431b2[_0x920b('0xf')](0x1f4,_0x1abbf2[_0x920b('0x10')]));});});};exports[_0x920b('0x1d')]=function(_0x143f48){var _0x36cd48=this;return new Promise(function(_0x4c8c8c,_0x1a4869){return db[_0x920b('0x12')][_0x920b('0x1e')]({'raw':_0x143f48[_0x920b('0x14')]?_0x143f48[_0x920b('0x14')][_0x920b('0x15')]===undefined?!![]:![]:!![],'where':_0x143f48[_0x920b('0x14')]?_0x143f48[_0x920b('0x14')][_0x920b('0x16')]||null:null,'attributes':_0x143f48[_0x920b('0x14')]?_0x143f48[_0x920b('0x14')][_0x920b('0x17')]||null:null,'include':_0x143f48['options']?_0x143f48['options'][_0x920b('0x19')]?_[_0x920b('0x1a')](_0x143f48[_0x920b('0x14')][_0x920b('0x19')],function(_0x3c1813){return{'model':db[_0x3c1813[_0x920b('0x1b')]],'as':_0x3c1813['as'],'attributes':_0x3c1813[_0x920b('0x17')],'include':_0x3c1813[_0x920b('0x19')]?_[_0x920b('0x1a')](_0x3c1813[_0x920b('0x19')],function(_0x2a6534){return{'model':db[_0x2a6534[_0x920b('0x1b')]],'as':_0x2a6534['as'],'attributes':_0x2a6534[_0x920b('0x17')],'include':_0x2a6534[_0x920b('0x19')]?_[_0x920b('0x1a')](_0x2a6534[_0x920b('0x19')],function(_0x2be3c4){return{'model':db[_0x2be3c4['model']],'as':_0x2be3c4['as'],'attributes':_0x2be3c4['attributes']};}):[]};}):[]};}):[]:[]})[_0x920b('0xa')](function(_0x46b645){logger[_0x920b('0xb')](_0x920b('0x1d'),_0x143f48);logger[_0x920b('0x1f')](_0x920b('0x1d'),_0x143f48,JSON[_0x920b('0xe')](_0x46b645));_0x4c8c8c(_0x46b645);})[_0x920b('0x11')](function(_0x4cbda7){logger['error']('ShowSugarcrmAccount',_0x4cbda7[_0x920b('0x10')],_0x143f48);_0x1a4869(_0x36cd48['error'](0x1f4,_0x4cbda7[_0x920b('0x10')]));});});};
\ No newline at end of file
index b87aea6..4d1baf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf253=['post','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x156b6d,_0x4b9128){var _0x39ea3b=function(_0x197cc5){while(--_0x197cc5){_0x156b6d['push'](_0x156b6d['shift']());}};_0x39ea3b(++_0x4b9128);}(_0xf253,0x139));var _0x3f25=function(_0x2c55bd,_0x3d272e){_0x2c55bd=_0x2c55bd-0x0;var _0x388c1a=_0xf253[_0x2c55bd];return _0x388c1a;};'use strict';var multer=require('multer');var util=require(_0x3f25('0x0'));var path=require(_0x3f25('0x1'));var timeout=require(_0x3f25('0x2'));var express=require(_0x3f25('0x3'));var router=express[_0x3f25('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3f25('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3f25('0x6'));var controller=require(_0x3f25('0x7'));router[_0x3f25('0x8')]('/',auth[_0x3f25('0x9')](),controller[_0x3f25('0xa')]);router[_0x3f25('0x8')](_0x3f25('0xb'),auth[_0x3f25('0x9')](),controller['show']);router[_0x3f25('0x8')](_0x3f25('0xc'),auth[_0x3f25('0x9')](),controller[_0x3f25('0xd')]);router[_0x3f25('0x8')](_0x3f25('0xe'),auth['isAuthenticated'](),controller[_0x3f25('0xf')]);router[_0x3f25('0x8')](_0x3f25('0x10'),auth[_0x3f25('0x9')](),controller['getDescriptions']);router[_0x3f25('0x11')]('/',auth[_0x3f25('0x9')](),controller['create']);router[_0x3f25('0x12')]('/:id',auth[_0x3f25('0x9')](),controller[_0x3f25('0x13')]);router['delete'](_0x3f25('0xb'),auth[_0x3f25('0x9')](),controller[_0x3f25('0x14')]);module[_0x3f25('0x15')]=router;
\ No newline at end of file
+var _0x2c91=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','post','create','update','delete','exports','multer'];(function(_0x3a7be9,_0x17d289){var _0x240707=function(_0x5b024e){while(--_0x5b024e){_0x3a7be9['push'](_0x3a7be9['shift']());}};_0x240707(++_0x17d289);}(_0x2c91,0x1cd));var _0x12c9=function(_0x2c04d7,_0x277df2){_0x2c04d7=_0x2c04d7-0x0;var _0x434eed=_0x2c91[_0x2c04d7];return _0x434eed;};'use strict';var multer=require(_0x12c9('0x0'));var util=require('util');var path=require(_0x12c9('0x1'));var timeout=require(_0x12c9('0x2'));var express=require('express');var router=express[_0x12c9('0x3')]();var fs_extra=require(_0x12c9('0x4'));var auth=require(_0x12c9('0x5'));var interaction=require(_0x12c9('0x6'));var config=require('../../config/environment');var controller=require(_0x12c9('0x7'));router[_0x12c9('0x8')]('/',auth[_0x12c9('0x9')](),controller[_0x12c9('0xa')]);router[_0x12c9('0x8')](_0x12c9('0xb'),auth[_0x12c9('0x9')](),controller[_0x12c9('0xc')]);router[_0x12c9('0x8')](_0x12c9('0xd'),auth['isAuthenticated'](),controller[_0x12c9('0xe')]);router[_0x12c9('0x8')]('/:id/subjects',auth[_0x12c9('0x9')](),controller['getSubjects']);router[_0x12c9('0x8')](_0x12c9('0xf'),auth[_0x12c9('0x9')](),controller['getDescriptions']);router[_0x12c9('0x10')]('/',auth[_0x12c9('0x9')](),controller[_0x12c9('0x11')]);router['put'](_0x12c9('0xb'),auth['isAuthenticated'](),controller[_0x12c9('0x12')]);router[_0x12c9('0x13')](_0x12c9('0xb'),auth[_0x12c9('0x9')](),controller['destroy']);module[_0x12c9('0x14')]=router;
\ No newline at end of file
index c055e49..805d57d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a3=['sequelize','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x98a3,0x11e));var _0x398a=function(_0x37bc47,_0x40e1dd){_0x37bc47=_0x37bc47-0x0;var _0xa57ce1=_0x98a3[_0x37bc47];return _0xa57ce1;};'use strict';var Sequelize=require(_0x398a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x398a('0x1')]}};
\ No newline at end of file
+var _0x6de5=['exports','STRING'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x6de5,0x108));var _0x56de=function(_0x5e606b,_0x51135c){_0x5e606b=_0x5e606b-0x0;var _0x4eb176=_0x6de5[_0x5e606b];return _0x4eb176;};'use strict';var Sequelize=require('sequelize');module[_0x56de('0x0')]={'name':{'type':Sequelize[_0x56de('0x1')]},'description':{'type':Sequelize[_0x56de('0x1')]}};
\ No newline at end of file
index 5ae002b..97de637 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44b5=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','keys','options','find','create','body','findOne','SugarcrmField','getFields','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','filters'];(function(_0x4839df,_0x196192){var _0x154355=function(_0x2e151d){while(--_0x2e151d){_0x4839df['push'](_0x4839df['shift']());}};_0x154355(++_0x196192);}(_0x44b5,0x1b3));var _0x544b=function(_0x10f309,_0x4404d9){_0x10f309=_0x10f309-0x0;var _0x129a15=_0x44b5[_0x10f309];return _0x129a15;};'use strict';var emlformat=require(_0x544b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x544b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x544b('0x2'));var moment=require(_0x544b('0x3'));var BPromise=require(_0x544b('0x4'));var Mustache=require(_0x544b('0x5'));var util=require(_0x544b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x544b('0x7'));var _=require(_0x544b('0x8'));var squel=require(_0x544b('0x9'));var crypto=require(_0x544b('0xa'));var jsforce=require(_0x544b('0xb'));var deskjs=require(_0x544b('0xc'));var toCsv=require(_0x544b('0xd'));var querystring=require('querystring');var Papa=require(_0x544b('0xe'));var Redis=require(_0x544b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x544b('0x10'));var as=require(_0x544b('0x11'));var hardwareService=require(_0x544b('0x12'));var logger=require('../../config/logger')(_0x544b('0x13'));var utils=require(_0x544b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x544b('0x15'));var db=require(_0x544b('0x16'))['db'];function respondWithStatusCode(_0x59e991,_0x30ccf6){_0x30ccf6=_0x30ccf6||0xcc;return function(_0x194551){if(_0x194551){return _0x59e991[_0x544b('0x17')](_0x30ccf6);}return _0x59e991[_0x544b('0x18')](_0x30ccf6)[_0x544b('0x19')]();};}function respondWithResult(_0x47b9fe,_0x14bb3d){_0x14bb3d=_0x14bb3d||0xc8;return function(_0x219808){if(_0x219808){return _0x47b9fe[_0x544b('0x18')](_0x14bb3d)['json'](_0x219808);}};}function respondWithFilteredResult(_0x40ed51,_0x15d071){return function(_0xeb7953){if(_0xeb7953){var _0x5048da=typeof _0x15d071[_0x544b('0x1a')]===_0x544b('0x1b')&&typeof _0x15d071[_0x544b('0x1c')]==='undefined';var _0x5a3006=_0xeb7953[_0x544b('0x1d')];var _0x247718=_0x5048da?0x0:_0x15d071[_0x544b('0x1a')];var _0x46fa93=_0x5048da?_0xeb7953[_0x544b('0x1d')]:_0x15d071['offset']+_0x15d071[_0x544b('0x1c')];var _0x1437e0;if(_0x46fa93>=_0x5a3006){_0x46fa93=_0x5a3006;_0x1437e0=0xc8;}else{_0x1437e0=0xce;}_0x40ed51[_0x544b('0x18')](_0x1437e0);return _0x40ed51[_0x544b('0x1e')]('Content-Range',_0x247718+'-'+_0x46fa93+'/'+_0x5a3006)[_0x544b('0x1f')](_0xeb7953);}return null;};}function patchUpdates(_0x43cd2f){return function(_0x2a3737){try{jsonpatch[_0x544b('0x20')](_0x2a3737,_0x43cd2f,!![]);}catch(_0x40e2bf){return BPromise[_0x544b('0x21')](_0x40e2bf);}return _0x2a3737[_0x544b('0x22')]();};}function saveUpdates(_0x27cb95,_0x28ea01){return function(_0x406e0f){if(_0x406e0f){return _0x406e0f[_0x544b('0x23')](_0x27cb95)[_0x544b('0x24')](function(_0x2df3a0){return _0x2df3a0;});}return null;};}function removeEntity(_0x592412,_0x57d886){return function(_0x257430){if(_0x257430){return _0x257430[_0x544b('0x25')]()[_0x544b('0x24')](function(){_0x592412['status'](0xcc)[_0x544b('0x19')]();});}};}function handleEntityNotFound(_0x36cd6e,_0x383f1e){return function(_0x3ddca8){if(!_0x3ddca8){_0x36cd6e[_0x544b('0x17')](0x194);}return _0x3ddca8;};}function handleError(_0x523d09,_0x4da0e1){_0x4da0e1=_0x4da0e1||0x1f4;return function(_0x75fb70){logger[_0x544b('0x26')](_0x75fb70[_0x544b('0x27')]);if(_0x75fb70[_0x544b('0x28')]){delete _0x75fb70[_0x544b('0x28')];}_0x523d09[_0x544b('0x18')](_0x4da0e1)[_0x544b('0x29')](_0x75fb70);};}exports[_0x544b('0x2a')]=function(_0x4c1a1a,_0x469440){var _0x34a70e={},_0x4ab4a0={},_0x4abde4={'count':0x0,'rows':[]};var _0x51fce4=_[_0x544b('0x2b')](db[_0x544b('0x2c')]['rawAttributes'],function(_0xe2022b){return{'name':_0xe2022b[_0x544b('0x2d')],'type':_0xe2022b[_0x544b('0x2e')][_0x544b('0x2f')]};});_0x4ab4a0[_0x544b('0x30')]=_[_0x544b('0x2b')](_0x51fce4,_0x544b('0x28'));_0x4ab4a0[_0x544b('0x31')]=_['keys'](_0x4c1a1a[_0x544b('0x31')]);_0x4ab4a0[_0x544b('0x32')]=_[_0x544b('0x33')](_0x4ab4a0['model'],_0x4ab4a0[_0x544b('0x31')]);_0x34a70e[_0x544b('0x34')]=_[_0x544b('0x33')](_0x4ab4a0[_0x544b('0x30')],qs[_0x544b('0x35')](_0x4c1a1a['query'][_0x544b('0x35')]));_0x34a70e[_0x544b('0x34')]=_0x34a70e['attributes'][_0x544b('0x36')]?_0x34a70e[_0x544b('0x34')]:_0x4ab4a0['model'];if(!_0x4c1a1a[_0x544b('0x31')][_0x544b('0x37')](_0x544b('0x38'))){_0x34a70e[_0x544b('0x1c')]=qs[_0x544b('0x1c')](_0x4c1a1a[_0x544b('0x31')]['limit']);_0x34a70e[_0x544b('0x1a')]=qs['offset'](_0x4c1a1a[_0x544b('0x31')][_0x544b('0x1a')]);}_0x34a70e[_0x544b('0x39')]=qs['sort'](_0x4c1a1a['query'][_0x544b('0x3a')]);_0x34a70e[_0x544b('0x3b')]=qs[_0x544b('0x32')](_[_0x544b('0x3c')](_0x4c1a1a['query'],_0x4ab4a0['filters']),_0x51fce4);if(_0x4c1a1a['query'][_0x544b('0x3d')]){_0x34a70e['where']=_[_0x544b('0x3e')](_0x34a70e[_0x544b('0x3b')],{'$or':_[_0x544b('0x2b')](_0x51fce4,function(_0x48c25e){if(_0x48c25e[_0x544b('0x2e')]!==_0x544b('0x3f')){var _0x5b7eb0={};_0x5b7eb0[_0x48c25e[_0x544b('0x28')]]={'$like':'%'+_0x4c1a1a[_0x544b('0x31')][_0x544b('0x3d')]+'%'};return _0x5b7eb0;}})});}_0x34a70e=_[_0x544b('0x3e')]({},_0x34a70e,_0x4c1a1a['options']);var _0x1631f2={'where':_0x34a70e['where']};return db[_0x544b('0x2c')][_0x544b('0x1d')](_0x1631f2)[_0x544b('0x24')](function(_0x216480){_0x4abde4[_0x544b('0x1d')]=_0x216480;if(_0x4c1a1a[_0x544b('0x31')]['includeAll']){_0x34a70e[_0x544b('0x40')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x544b('0x41')](_0x34a70e);})[_0x544b('0x24')](function(_0x16e205){_0x4abde4[_0x544b('0x42')]=_0x16e205;return _0x4abde4;})[_0x544b('0x24')](respondWithFilteredResult(_0x469440,_0x34a70e))[_0x544b('0x43')](handleError(_0x469440,null));};exports[_0x544b('0x44')]=function(_0x70268f,_0x3ffaa2){var _0x10eb09={'raw':![],'where':{'id':_0x70268f[_0x544b('0x45')]['id']}},_0x305d89={};_0x305d89[_0x544b('0x30')]=_['keys'](db['SugarcrmConfiguration'][_0x544b('0x46')]);_0x305d89[_0x544b('0x31')]=_[_0x544b('0x47')](_0x70268f[_0x544b('0x31')]);_0x305d89[_0x544b('0x32')]=_['intersection'](_0x305d89[_0x544b('0x30')],_0x305d89['query']);_0x10eb09[_0x544b('0x34')]=_['intersection'](_0x305d89[_0x544b('0x30')],qs[_0x544b('0x35')](_0x70268f[_0x544b('0x31')][_0x544b('0x35')]));_0x10eb09['attributes']=_0x10eb09[_0x544b('0x34')][_0x544b('0x36')]?_0x10eb09[_0x544b('0x34')]:_0x305d89[_0x544b('0x30')];if(_0x70268f[_0x544b('0x31')]['includeAll']){_0x10eb09[_0x544b('0x40')]=[{'all':!![]}];}_0x10eb09=_['merge']({},_0x10eb09,_0x70268f[_0x544b('0x48')]);return db[_0x544b('0x2c')][_0x544b('0x49')](_0x10eb09)[_0x544b('0x24')](handleEntityNotFound(_0x3ffaa2,null))[_0x544b('0x24')](respondWithResult(_0x3ffaa2,null))[_0x544b('0x43')](handleError(_0x3ffaa2,null));};exports[_0x544b('0x4a')]=function(_0x2d4b24,_0x52af42){return db['SugarcrmConfiguration'][_0x544b('0x4a')](_0x2d4b24[_0x544b('0x4b')],{})[_0x544b('0x24')](respondWithResult(_0x52af42,0xc9))[_0x544b('0x43')](handleError(_0x52af42,null));};exports[_0x544b('0x23')]=function(_0x411042,_0x3b5eea){if(_0x411042[_0x544b('0x4b')]['id']){delete _0x411042['body']['id'];}return db[_0x544b('0x2c')][_0x544b('0x49')]({'where':{'id':_0x411042[_0x544b('0x45')]['id']}})[_0x544b('0x24')](handleEntityNotFound(_0x3b5eea,null))['then'](saveUpdates(_0x411042[_0x544b('0x4b')],null))['then'](respondWithResult(_0x3b5eea,null))[_0x544b('0x43')](handleError(_0x3b5eea,null));};exports['destroy']=function(_0xbfe290,_0x1467bc){return db[_0x544b('0x2c')]['find']({'where':{'id':_0xbfe290[_0x544b('0x45')]['id']}})[_0x544b('0x24')](handleEntityNotFound(_0x1467bc,null))[_0x544b('0x24')](removeEntity(_0x1467bc,null))[_0x544b('0x43')](handleError(_0x1467bc,null));};exports['getFields']=function(_0x26b6fa,_0x26ddc7,_0xd3683f){var _0x7abb82={};var _0x3c4708={};var _0xee02d0;var _0x385e0c;return db['SugarcrmConfiguration'][_0x544b('0x4c')]({'where':{'id':_0x26b6fa[_0x544b('0x45')]['id']}})[_0x544b('0x24')](handleEntityNotFound(_0x26ddc7,null))[_0x544b('0x24')](function(_0x3a837d){if(_0x3a837d){_0xee02d0=_0x3a837d;_0x3c4708[_0x544b('0x30')]=_[_0x544b('0x47')](db[_0x544b('0x4d')][_0x544b('0x46')]);_0x3c4708['query']=_[_0x544b('0x47')](_0x26b6fa['query']);_0x3c4708[_0x544b('0x32')]=_['intersection'](_0x3c4708[_0x544b('0x30')],_0x3c4708[_0x544b('0x31')]);_0x7abb82['attributes']=_[_0x544b('0x33')](_0x3c4708[_0x544b('0x30')],qs['fields'](_0x26b6fa[_0x544b('0x31')][_0x544b('0x35')]));_0x7abb82[_0x544b('0x34')]=_0x7abb82[_0x544b('0x34')]['length']?_0x7abb82[_0x544b('0x34')]:_0x3c4708[_0x544b('0x30')];_0x7abb82[_0x544b('0x39')]=qs[_0x544b('0x3a')](_0x26b6fa[_0x544b('0x31')][_0x544b('0x3a')]);_0x7abb82['where']=qs['filters'](_[_0x544b('0x3c')](_0x26b6fa[_0x544b('0x31')],_0x3c4708[_0x544b('0x32')]));if(_0x26b6fa[_0x544b('0x31')]['filter']){_0x7abb82[_0x544b('0x3b')]=_[_0x544b('0x3e')](_0x7abb82[_0x544b('0x3b')],{'$or':_[_0x544b('0x2b')](_0x7abb82[_0x544b('0x34')],function(_0x161ae4){var _0x3dc4b2={};_0x3dc4b2[_0x161ae4]={'$like':'%'+_0x26b6fa[_0x544b('0x31')][_0x544b('0x3d')]+'%'};return _0x3dc4b2;})});}_0x7abb82=_['merge']({},_0x7abb82,_0x26b6fa[_0x544b('0x48')]);return _0xee02d0[_0x544b('0x4e')](_0x7abb82);}})['then'](function(_0x26097f){if(_0x26097f){_0x385e0c=_0x26097f[_0x544b('0x36')];if(!_0x26b6fa[_0x544b('0x31')]['hasOwnProperty']('nolimit')){_0x7abb82[_0x544b('0x1c')]=qs[_0x544b('0x1c')](_0x26b6fa[_0x544b('0x31')][_0x544b('0x1c')]);_0x7abb82[_0x544b('0x1a')]=qs[_0x544b('0x1a')](_0x26b6fa['query'][_0x544b('0x1a')]);}return _0xee02d0['getFields'](_0x7abb82);}})['then'](function(_0x45cf7b){if(_0x45cf7b){return _0x45cf7b?{'count':_0x385e0c,'rows':_0x45cf7b}:null;}})['then'](respondWithResult(_0x26ddc7,null))[_0x544b('0x43')](handleError(_0x26ddc7,null));};exports['getSubjects']=function(_0x5de5e7,_0x38c017,_0x2cb2fc){var _0x314af3={};var _0x1d08d3={};var _0x198dd2;var _0x476b4b;return db[_0x544b('0x2c')][_0x544b('0x4c')]({'where':{'id':_0x5de5e7[_0x544b('0x45')]['id']}})[_0x544b('0x24')](handleEntityNotFound(_0x38c017,null))[_0x544b('0x24')](function(_0x1747f5){if(_0x1747f5){_0x198dd2=_0x1747f5;_0x1d08d3[_0x544b('0x30')]=_[_0x544b('0x47')](db[_0x544b('0x4d')]['rawAttributes']);_0x1d08d3['query']=_[_0x544b('0x47')](_0x5de5e7[_0x544b('0x31')]);_0x1d08d3[_0x544b('0x32')]=_['intersection'](_0x1d08d3[_0x544b('0x30')],_0x1d08d3['query']);_0x314af3['attributes']=_[_0x544b('0x33')](_0x1d08d3[_0x544b('0x30')],qs['fields'](_0x5de5e7[_0x544b('0x31')]['fields']));_0x314af3['attributes']=_0x314af3[_0x544b('0x34')]['length']?_0x314af3[_0x544b('0x34')]:_0x1d08d3[_0x544b('0x30')];_0x314af3[_0x544b('0x39')]=qs[_0x544b('0x3a')](_0x5de5e7['query'][_0x544b('0x3a')]);_0x314af3[_0x544b('0x3b')]=qs[_0x544b('0x32')](_[_0x544b('0x3c')](_0x5de5e7['query'],_0x1d08d3[_0x544b('0x32')]));if(_0x5de5e7['query'][_0x544b('0x3d')]){_0x314af3[_0x544b('0x3b')]=_[_0x544b('0x3e')](_0x314af3[_0x544b('0x3b')],{'$or':_[_0x544b('0x2b')](_0x314af3[_0x544b('0x34')],function(_0x5e25e8){var _0x515739={};_0x515739[_0x5e25e8]={'$like':'%'+_0x5de5e7[_0x544b('0x31')][_0x544b('0x3d')]+'%'};return _0x515739;})});}_0x314af3=_['merge']({},_0x314af3,_0x5de5e7[_0x544b('0x48')]);return _0x198dd2['getSubjects'](_0x314af3);}})[_0x544b('0x24')](function(_0x562aab){if(_0x562aab){_0x476b4b=_0x562aab[_0x544b('0x36')];if(!_0x5de5e7[_0x544b('0x31')]['hasOwnProperty']('nolimit')){_0x314af3[_0x544b('0x1c')]=qs[_0x544b('0x1c')](_0x5de5e7[_0x544b('0x31')]['limit']);_0x314af3['offset']=qs[_0x544b('0x1a')](_0x5de5e7['query']['offset']);}return _0x198dd2[_0x544b('0x4f')](_0x314af3);}})[_0x544b('0x24')](function(_0x2b1695){if(_0x2b1695){return _0x2b1695?{'count':_0x476b4b,'rows':_0x2b1695}:null;}})[_0x544b('0x24')](respondWithResult(_0x38c017,null))[_0x544b('0x43')](handleError(_0x38c017,null));};exports[_0x544b('0x50')]=function(_0x53f5a4,_0x27c67c,_0x2864d5){var _0x104aa1={};var _0x3109b7={};var _0x1b8960;var _0x30d20e;return db[_0x544b('0x2c')][_0x544b('0x4c')]({'where':{'id':_0x53f5a4[_0x544b('0x45')]['id']}})[_0x544b('0x24')](handleEntityNotFound(_0x27c67c,null))['then'](function(_0x47a2c7){if(_0x47a2c7){_0x1b8960=_0x47a2c7;_0x3109b7['model']=_['keys'](db[_0x544b('0x4d')][_0x544b('0x46')]);_0x3109b7[_0x544b('0x31')]=_[_0x544b('0x47')](_0x53f5a4[_0x544b('0x31')]);_0x3109b7[_0x544b('0x32')]=_['intersection'](_0x3109b7[_0x544b('0x30')],_0x3109b7[_0x544b('0x31')]);_0x104aa1[_0x544b('0x34')]=_[_0x544b('0x33')](_0x3109b7['model'],qs[_0x544b('0x35')](_0x53f5a4[_0x544b('0x31')]['fields']));_0x104aa1[_0x544b('0x34')]=_0x104aa1[_0x544b('0x34')]['length']?_0x104aa1[_0x544b('0x34')]:_0x3109b7[_0x544b('0x30')];_0x104aa1[_0x544b('0x39')]=qs['sort'](_0x53f5a4[_0x544b('0x31')]['sort']);_0x104aa1[_0x544b('0x3b')]=qs['filters'](_[_0x544b('0x3c')](_0x53f5a4[_0x544b('0x31')],_0x3109b7[_0x544b('0x32')]));if(_0x53f5a4[_0x544b('0x31')][_0x544b('0x3d')]){_0x104aa1[_0x544b('0x3b')]=_['merge'](_0x104aa1[_0x544b('0x3b')],{'$or':_[_0x544b('0x2b')](_0x104aa1[_0x544b('0x34')],function(_0x591a2f){var _0x1c2132={};_0x1c2132[_0x591a2f]={'$like':'%'+_0x53f5a4[_0x544b('0x31')][_0x544b('0x3d')]+'%'};return _0x1c2132;})});}_0x104aa1=_[_0x544b('0x3e')]({},_0x104aa1,_0x53f5a4[_0x544b('0x48')]);return _0x1b8960[_0x544b('0x50')](_0x104aa1);}})[_0x544b('0x24')](function(_0x5c0a29){if(_0x5c0a29){_0x30d20e=_0x5c0a29[_0x544b('0x36')];if(!_0x53f5a4[_0x544b('0x31')][_0x544b('0x37')](_0x544b('0x38'))){_0x104aa1['limit']=qs[_0x544b('0x1c')](_0x53f5a4[_0x544b('0x31')][_0x544b('0x1c')]);_0x104aa1[_0x544b('0x1a')]=qs['offset'](_0x53f5a4[_0x544b('0x31')]['offset']);}return _0x1b8960[_0x544b('0x50')](_0x104aa1);}})[_0x544b('0x24')](function(_0x318119){if(_0x318119){return _0x318119?{'count':_0x30d20e,'rows':_0x318119}:null;}})[_0x544b('0x24')](respondWithResult(_0x27c67c,null))[_0x544b('0x43')](handleError(_0x27c67c,null));};
\ No newline at end of file
+var _0x16d7=['create','body','find','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','options','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','SugarcrmConfiguration','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','includeAll','include','rows','show','params','rawAttributes','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16d7,0xf4));var _0x716d=function(_0x4d25a0,_0x2dad8f){_0x4d25a0=_0x4d25a0-0x0;var _0x2502f0=_0x16d7[_0x4d25a0];return _0x2502f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x716d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x716d('0x1'));var rp=require(_0x716d('0x2'));var moment=require(_0x716d('0x3'));var BPromise=require(_0x716d('0x4'));var Mustache=require(_0x716d('0x5'));var util=require(_0x716d('0x6'));var path=require('path');var sox=require(_0x716d('0x7'));var csv=require(_0x716d('0x8'));var ejs=require(_0x716d('0x9'));var fs=require('fs');var fs_extra=require(_0x716d('0xa'));var _=require(_0x716d('0xb'));var squel=require('squel');var crypto=require(_0x716d('0xc'));var jsforce=require(_0x716d('0xd'));var deskjs=require(_0x716d('0xe'));var toCsv=require(_0x716d('0x8'));var querystring=require(_0x716d('0xf'));var Papa=require('papaparse');var Redis=require(_0x716d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x716d('0x11'));var as=require(_0x716d('0x12'));var hardwareService=require(_0x716d('0x13'));var logger=require(_0x716d('0x14'))(_0x716d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x716d('0x16'));var db=require(_0x716d('0x17'))['db'];function respondWithStatusCode(_0x3cf64a,_0x5e7186){_0x5e7186=_0x5e7186||0xcc;return function(_0x523b51){if(_0x523b51){return _0x3cf64a[_0x716d('0x18')](_0x5e7186);}return _0x3cf64a[_0x716d('0x19')](_0x5e7186)[_0x716d('0x1a')]();};}function respondWithResult(_0x17fae3,_0x46fe49){_0x46fe49=_0x46fe49||0xc8;return function(_0x49812f){if(_0x49812f){return _0x17fae3[_0x716d('0x19')](_0x46fe49)[_0x716d('0x1b')](_0x49812f);}};}function respondWithFilteredResult(_0x47c07c,_0xc2f5c2){return function(_0x529454){if(_0x529454){var _0xd10a3b=typeof _0xc2f5c2[_0x716d('0x1c')]==='undefined'&&typeof _0xc2f5c2[_0x716d('0x1d')]===_0x716d('0x1e');var _0x4a1636=_0x529454[_0x716d('0x1f')];var _0x34f153=_0xd10a3b?0x0:_0xc2f5c2[_0x716d('0x1c')];var _0x37929e=_0xd10a3b?_0x529454['count']:_0xc2f5c2[_0x716d('0x1c')]+_0xc2f5c2[_0x716d('0x1d')];var _0x4049fe;if(_0x37929e>=_0x4a1636){_0x37929e=_0x4a1636;_0x4049fe=0xc8;}else{_0x4049fe=0xce;}_0x47c07c['status'](_0x4049fe);return _0x47c07c[_0x716d('0x20')](_0x716d('0x21'),_0x34f153+'-'+_0x37929e+'/'+_0x4a1636)[_0x716d('0x1b')](_0x529454);}return null;};}function patchUpdates(_0x1f901a){return function(_0x37a958){try{jsonpatch[_0x716d('0x22')](_0x37a958,_0x1f901a,!![]);}catch(_0x363cda){return BPromise['reject'](_0x363cda);}return _0x37a958[_0x716d('0x23')]();};}function saveUpdates(_0x50d18f,_0x256609){return function(_0x258190){if(_0x258190){return _0x258190[_0x716d('0x24')](_0x50d18f)[_0x716d('0x25')](function(_0x4e1ecd){return _0x4e1ecd;});}return null;};}function removeEntity(_0x4f7d73,_0x449687){return function(_0x2207aa){if(_0x2207aa){return _0x2207aa[_0x716d('0x26')]()[_0x716d('0x25')](function(){_0x4f7d73[_0x716d('0x19')](0xcc)[_0x716d('0x1a')]();});}};}function handleEntityNotFound(_0x138ea7,_0x1a7b98){return function(_0x23f43b){if(!_0x23f43b){_0x138ea7[_0x716d('0x18')](0x194);}return _0x23f43b;};}function handleError(_0x1c3f2d,_0x41cb8d){_0x41cb8d=_0x41cb8d||0x1f4;return function(_0x3e7996){logger[_0x716d('0x27')](_0x3e7996['stack']);if(_0x3e7996[_0x716d('0x28')]){delete _0x3e7996['name'];}_0x1c3f2d['status'](_0x41cb8d)[_0x716d('0x29')](_0x3e7996);};}exports['index']=function(_0x270d10,_0x581359){var _0xe6e75d={},_0x4bb325={},_0x1d31eb={'count':0x0,'rows':[]};var _0x5495ea=_[_0x716d('0x2a')](db[_0x716d('0x2b')]['rawAttributes'],function(_0x183fa8){return{'name':_0x183fa8[_0x716d('0x2c')],'type':_0x183fa8['type']['key']};});_0x4bb325['model']=_['map'](_0x5495ea,_0x716d('0x28'));_0x4bb325[_0x716d('0x2d')]=_[_0x716d('0x2e')](_0x270d10[_0x716d('0x2d')]);_0x4bb325[_0x716d('0x2f')]=_[_0x716d('0x30')](_0x4bb325[_0x716d('0x31')],_0x4bb325['query']);_0xe6e75d[_0x716d('0x32')]=_['intersection'](_0x4bb325[_0x716d('0x31')],qs['fields'](_0x270d10[_0x716d('0x2d')][_0x716d('0x33')]));_0xe6e75d[_0x716d('0x32')]=_0xe6e75d[_0x716d('0x32')][_0x716d('0x34')]?_0xe6e75d[_0x716d('0x32')]:_0x4bb325[_0x716d('0x31')];if(!_0x270d10['query'][_0x716d('0x35')]('nolimit')){_0xe6e75d[_0x716d('0x1d')]=qs[_0x716d('0x1d')](_0x270d10[_0x716d('0x2d')]['limit']);_0xe6e75d['offset']=qs[_0x716d('0x1c')](_0x270d10[_0x716d('0x2d')][_0x716d('0x1c')]);}_0xe6e75d[_0x716d('0x36')]=qs[_0x716d('0x37')](_0x270d10[_0x716d('0x2d')][_0x716d('0x37')]);_0xe6e75d[_0x716d('0x38')]=qs[_0x716d('0x2f')](_[_0x716d('0x39')](_0x270d10[_0x716d('0x2d')],_0x4bb325[_0x716d('0x2f')]),_0x5495ea);if(_0x270d10[_0x716d('0x2d')][_0x716d('0x3a')]){_0xe6e75d['where']=_['merge'](_0xe6e75d['where'],{'$or':_[_0x716d('0x2a')](_0x5495ea,function(_0x416808){if(_0x416808[_0x716d('0x3b')]!=='VIRTUAL'){var _0x3e3966={};_0x3e3966[_0x416808[_0x716d('0x28')]]={'$like':'%'+_0x270d10[_0x716d('0x2d')][_0x716d('0x3a')]+'%'};return _0x3e3966;}})});}_0xe6e75d=_[_0x716d('0x3c')]({},_0xe6e75d,_0x270d10['options']);var _0x34fbe3={'where':_0xe6e75d[_0x716d('0x38')]};return db['SugarcrmConfiguration'][_0x716d('0x1f')](_0x34fbe3)[_0x716d('0x25')](function(_0x18764d){_0x1d31eb[_0x716d('0x1f')]=_0x18764d;if(_0x270d10[_0x716d('0x2d')][_0x716d('0x3d')]){_0xe6e75d[_0x716d('0x3e')]=[{'all':!![]}];}return db[_0x716d('0x2b')]['findAll'](_0xe6e75d);})[_0x716d('0x25')](function(_0x3266c6){_0x1d31eb[_0x716d('0x3f')]=_0x3266c6;return _0x1d31eb;})[_0x716d('0x25')](respondWithFilteredResult(_0x581359,_0xe6e75d))['catch'](handleError(_0x581359,null));};exports[_0x716d('0x40')]=function(_0x48a050,_0x3e0b59){var _0x2a5d11={'raw':![],'where':{'id':_0x48a050[_0x716d('0x41')]['id']}},_0x3f79ed={};_0x3f79ed[_0x716d('0x31')]=_[_0x716d('0x2e')](db[_0x716d('0x2b')][_0x716d('0x42')]);_0x3f79ed[_0x716d('0x2d')]=_['keys'](_0x48a050[_0x716d('0x2d')]);_0x3f79ed[_0x716d('0x2f')]=_[_0x716d('0x30')](_0x3f79ed[_0x716d('0x31')],_0x3f79ed[_0x716d('0x2d')]);_0x2a5d11[_0x716d('0x32')]=_[_0x716d('0x30')](_0x3f79ed[_0x716d('0x31')],qs[_0x716d('0x33')](_0x48a050[_0x716d('0x2d')][_0x716d('0x33')]));_0x2a5d11[_0x716d('0x32')]=_0x2a5d11[_0x716d('0x32')][_0x716d('0x34')]?_0x2a5d11['attributes']:_0x3f79ed[_0x716d('0x31')];if(_0x48a050[_0x716d('0x2d')][_0x716d('0x3d')]){_0x2a5d11[_0x716d('0x3e')]=[{'all':!![]}];}_0x2a5d11=_[_0x716d('0x3c')]({},_0x2a5d11,_0x48a050['options']);return db[_0x716d('0x2b')]['find'](_0x2a5d11)[_0x716d('0x25')](handleEntityNotFound(_0x3e0b59,null))[_0x716d('0x25')](respondWithResult(_0x3e0b59,null))[_0x716d('0x43')](handleError(_0x3e0b59,null));};exports['create']=function(_0x187e2a,_0x5d11cd){return db['SugarcrmConfiguration'][_0x716d('0x44')](_0x187e2a[_0x716d('0x45')],{})[_0x716d('0x25')](respondWithResult(_0x5d11cd,0xc9))[_0x716d('0x43')](handleError(_0x5d11cd,null));};exports[_0x716d('0x24')]=function(_0x41b1d9,_0x5852d8){if(_0x41b1d9[_0x716d('0x45')]['id']){delete _0x41b1d9[_0x716d('0x45')]['id'];}return db[_0x716d('0x2b')][_0x716d('0x46')]({'where':{'id':_0x41b1d9[_0x716d('0x41')]['id']}})['then'](handleEntityNotFound(_0x5852d8,null))[_0x716d('0x25')](saveUpdates(_0x41b1d9['body'],null))[_0x716d('0x25')](respondWithResult(_0x5852d8,null))[_0x716d('0x43')](handleError(_0x5852d8,null));};exports[_0x716d('0x26')]=function(_0x22ad1b,_0x3515f5){return db[_0x716d('0x2b')][_0x716d('0x46')]({'where':{'id':_0x22ad1b[_0x716d('0x41')]['id']}})['then'](handleEntityNotFound(_0x3515f5,null))['then'](removeEntity(_0x3515f5,null))['catch'](handleError(_0x3515f5,null));};exports[_0x716d('0x47')]=function(_0x29324f,_0x207226,_0xe671f2){var _0x40161d={};var _0x269860={};var _0x3e9b11;var _0x22d3de;return db['SugarcrmConfiguration'][_0x716d('0x48')]({'where':{'id':_0x29324f[_0x716d('0x41')]['id']}})['then'](handleEntityNotFound(_0x207226,null))[_0x716d('0x25')](function(_0x15884b){if(_0x15884b){_0x3e9b11=_0x15884b;_0x269860[_0x716d('0x31')]=_[_0x716d('0x2e')](db[_0x716d('0x49')]['rawAttributes']);_0x269860[_0x716d('0x2d')]=_[_0x716d('0x2e')](_0x29324f['query']);_0x269860[_0x716d('0x2f')]=_[_0x716d('0x30')](_0x269860['model'],_0x269860[_0x716d('0x2d')]);_0x40161d[_0x716d('0x32')]=_[_0x716d('0x30')](_0x269860['model'],qs[_0x716d('0x33')](_0x29324f['query']['fields']));_0x40161d[_0x716d('0x32')]=_0x40161d[_0x716d('0x32')][_0x716d('0x34')]?_0x40161d[_0x716d('0x32')]:_0x269860['model'];_0x40161d[_0x716d('0x36')]=qs[_0x716d('0x37')](_0x29324f[_0x716d('0x2d')][_0x716d('0x37')]);_0x40161d['where']=qs[_0x716d('0x2f')](_[_0x716d('0x39')](_0x29324f['query'],_0x269860[_0x716d('0x2f')]));if(_0x29324f[_0x716d('0x2d')][_0x716d('0x3a')]){_0x40161d[_0x716d('0x38')]=_[_0x716d('0x3c')](_0x40161d[_0x716d('0x38')],{'$or':_['map'](_0x40161d['attributes'],function(_0x23cee3){var _0x545c3c={};_0x545c3c[_0x23cee3]={'$like':'%'+_0x29324f[_0x716d('0x2d')]['filter']+'%'};return _0x545c3c;})});}_0x40161d=_['merge']({},_0x40161d,_0x29324f['options']);return _0x3e9b11[_0x716d('0x47')](_0x40161d);}})[_0x716d('0x25')](function(_0x53b39d){if(_0x53b39d){_0x22d3de=_0x53b39d[_0x716d('0x34')];if(!_0x29324f[_0x716d('0x2d')]['hasOwnProperty'](_0x716d('0x4a'))){_0x40161d[_0x716d('0x1d')]=qs['limit'](_0x29324f[_0x716d('0x2d')][_0x716d('0x1d')]);_0x40161d[_0x716d('0x1c')]=qs[_0x716d('0x1c')](_0x29324f[_0x716d('0x2d')][_0x716d('0x1c')]);}return _0x3e9b11[_0x716d('0x47')](_0x40161d);}})['then'](function(_0x1af347){if(_0x1af347){return _0x1af347?{'count':_0x22d3de,'rows':_0x1af347}:null;}})[_0x716d('0x25')](respondWithResult(_0x207226,null))['catch'](handleError(_0x207226,null));};exports[_0x716d('0x4b')]=function(_0x58f260,_0x8a2c81,_0x19d9b9){var _0x5c9d7e={};var _0xa692db={};var _0x202af8;var _0xb3fe16;return db[_0x716d('0x2b')][_0x716d('0x48')]({'where':{'id':_0x58f260[_0x716d('0x41')]['id']}})[_0x716d('0x25')](handleEntityNotFound(_0x8a2c81,null))[_0x716d('0x25')](function(_0x4fd2c9){if(_0x4fd2c9){_0x202af8=_0x4fd2c9;_0xa692db['model']=_[_0x716d('0x2e')](db['SugarcrmField'][_0x716d('0x42')]);_0xa692db['query']=_['keys'](_0x58f260['query']);_0xa692db[_0x716d('0x2f')]=_[_0x716d('0x30')](_0xa692db[_0x716d('0x31')],_0xa692db[_0x716d('0x2d')]);_0x5c9d7e[_0x716d('0x32')]=_[_0x716d('0x30')](_0xa692db[_0x716d('0x31')],qs[_0x716d('0x33')](_0x58f260[_0x716d('0x2d')][_0x716d('0x33')]));_0x5c9d7e['attributes']=_0x5c9d7e[_0x716d('0x32')]['length']?_0x5c9d7e[_0x716d('0x32')]:_0xa692db[_0x716d('0x31')];_0x5c9d7e[_0x716d('0x36')]=qs[_0x716d('0x37')](_0x58f260['query'][_0x716d('0x37')]);_0x5c9d7e[_0x716d('0x38')]=qs['filters'](_[_0x716d('0x39')](_0x58f260[_0x716d('0x2d')],_0xa692db[_0x716d('0x2f')]));if(_0x58f260[_0x716d('0x2d')][_0x716d('0x3a')]){_0x5c9d7e[_0x716d('0x38')]=_[_0x716d('0x3c')](_0x5c9d7e[_0x716d('0x38')],{'$or':_[_0x716d('0x2a')](_0x5c9d7e[_0x716d('0x32')],function(_0xed8a1b){var _0xd88054={};_0xd88054[_0xed8a1b]={'$like':'%'+_0x58f260['query'][_0x716d('0x3a')]+'%'};return _0xd88054;})});}_0x5c9d7e=_[_0x716d('0x3c')]({},_0x5c9d7e,_0x58f260['options']);return _0x202af8[_0x716d('0x4b')](_0x5c9d7e);}})['then'](function(_0xfb5730){if(_0xfb5730){_0xb3fe16=_0xfb5730[_0x716d('0x34')];if(!_0x58f260[_0x716d('0x2d')][_0x716d('0x35')]('nolimit')){_0x5c9d7e[_0x716d('0x1d')]=qs['limit'](_0x58f260[_0x716d('0x2d')][_0x716d('0x1d')]);_0x5c9d7e['offset']=qs['offset'](_0x58f260[_0x716d('0x2d')]['offset']);}return _0x202af8[_0x716d('0x4b')](_0x5c9d7e);}})[_0x716d('0x25')](function(_0x169e98){if(_0x169e98){return _0x169e98?{'count':_0xb3fe16,'rows':_0x169e98}:null;}})[_0x716d('0x25')](respondWithResult(_0x8a2c81,null))['catch'](handleError(_0x8a2c81,null));};exports[_0x716d('0x4c')]=function(_0x4f2787,_0x273f1d,_0x3e7601){var _0x2e50ec={};var _0x1acab2={};var _0xff896;var _0x5e377e;return db['SugarcrmConfiguration'][_0x716d('0x48')]({'where':{'id':_0x4f2787[_0x716d('0x41')]['id']}})[_0x716d('0x25')](handleEntityNotFound(_0x273f1d,null))['then'](function(_0x13b3de){if(_0x13b3de){_0xff896=_0x13b3de;_0x1acab2[_0x716d('0x31')]=_[_0x716d('0x2e')](db[_0x716d('0x49')]['rawAttributes']);_0x1acab2[_0x716d('0x2d')]=_[_0x716d('0x2e')](_0x4f2787[_0x716d('0x2d')]);_0x1acab2[_0x716d('0x2f')]=_['intersection'](_0x1acab2[_0x716d('0x31')],_0x1acab2[_0x716d('0x2d')]);_0x2e50ec[_0x716d('0x32')]=_[_0x716d('0x30')](_0x1acab2[_0x716d('0x31')],qs[_0x716d('0x33')](_0x4f2787['query'][_0x716d('0x33')]));_0x2e50ec[_0x716d('0x32')]=_0x2e50ec['attributes'][_0x716d('0x34')]?_0x2e50ec[_0x716d('0x32')]:_0x1acab2[_0x716d('0x31')];_0x2e50ec[_0x716d('0x36')]=qs[_0x716d('0x37')](_0x4f2787['query'][_0x716d('0x37')]);_0x2e50ec[_0x716d('0x38')]=qs[_0x716d('0x2f')](_['pick'](_0x4f2787[_0x716d('0x2d')],_0x1acab2[_0x716d('0x2f')]));if(_0x4f2787[_0x716d('0x2d')][_0x716d('0x3a')]){_0x2e50ec[_0x716d('0x38')]=_[_0x716d('0x3c')](_0x2e50ec['where'],{'$or':_[_0x716d('0x2a')](_0x2e50ec['attributes'],function(_0x1f4285){var _0x26a11e={};_0x26a11e[_0x1f4285]={'$like':'%'+_0x4f2787[_0x716d('0x2d')]['filter']+'%'};return _0x26a11e;})});}_0x2e50ec=_['merge']({},_0x2e50ec,_0x4f2787[_0x716d('0x4d')]);return _0xff896[_0x716d('0x4c')](_0x2e50ec);}})[_0x716d('0x25')](function(_0x2a8060){if(_0x2a8060){_0x5e377e=_0x2a8060[_0x716d('0x34')];if(!_0x4f2787[_0x716d('0x2d')]['hasOwnProperty'](_0x716d('0x4a'))){_0x2e50ec[_0x716d('0x1d')]=qs['limit'](_0x4f2787[_0x716d('0x2d')]['limit']);_0x2e50ec[_0x716d('0x1c')]=qs[_0x716d('0x1c')](_0x4f2787['query'][_0x716d('0x1c')]);}return _0xff896['getDescriptions'](_0x2e50ec);}})[_0x716d('0x25')](function(_0x42f2c6){if(_0x42f2c6){return _0x42f2c6?{'count':_0x5e377e,'rows':_0x42f2c6}:null;}})[_0x716d('0x25')](respondWithResult(_0x273f1d,null))[_0x716d('0x43')](handleError(_0x273f1d,null));};
\ No newline at end of file
index 202eb58..8f83115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb8d=['path','../../config/environment','./intSugarcrmConfiguration.attributes','define','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0xd19669,_0x55caec){var _0x72c348=function(_0x2de78f){while(--_0x2de78f){_0xd19669['push'](_0xd19669['shift']());}};_0x72c348(++_0x55caec);}(_0xdb8d,0xe5));var _0xddb8=function(_0x47623f,_0x148f3a){_0x47623f=_0x47623f-0x0;var _0x282ce8=_0xdb8d[_0x47623f];return _0x282ce8;};'use strict';var _=require(_0xddb8('0x0'));var util=require(_0xddb8('0x1'));var logger=require(_0xddb8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xddb8('0x3'));var rp=require(_0xddb8('0x4'));var fs=require('fs');var path=require(_0xddb8('0x5'));var rimraf=require('rimraf');var config=require(_0xddb8('0x6'));var attributes=require(_0xddb8('0x7'));module['exports']=function(_0x4408d1,_0x3ceefd){return _0x4408d1[_0xddb8('0x8')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c34=['define','SugarcrmConfiguration','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x571d73,_0x1be62d){var _0x3b0c0a=function(_0x1e89d0){while(--_0x1e89d0){_0x571d73['push'](_0x571d73['shift']());}};_0x3b0c0a(++_0x1be62d);}(_0x8c34,0x14c));var _0x48c3=function(_0x240e6b,_0x4bb6aa){_0x240e6b=_0x240e6b-0x0;var _0x281c85=_0x8c34[_0x240e6b];return _0x281c85;};'use strict';var _=require(_0x48c3('0x0'));var util=require(_0x48c3('0x1'));var logger=require('../../config/logger')(_0x48c3('0x2'));var moment=require(_0x48c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x48c3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48c3('0x5'));var config=require(_0x48c3('0x6'));var attributes=require(_0x48c3('0x7'));module[_0x48c3('0x8')]=function(_0x179fb5,_0x47507c){return _0x179fb5[_0x48c3('0x9')](_0x48c3('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9045965..0f50ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e85=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x0e85,0x182));var _0x50e8=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x0e85[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require(_0x50e8('0x2'));var BPromise=require(_0x50e8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50e8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x50e8('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x50e8('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x375ca3,_0x38957e,_0x168fa9){return new BPromise(function(_0x30a6f2,_0x6d3bc2){return client[_0x50e8('0x7')](_0x375ca3,_0x168fa9)[_0x50e8('0x8')](function(_0xe53f1d){logger[_0x50e8('0x9')](_0x50e8('0xa'),_0x38957e,_0x50e8('0xb'));logger[_0x50e8('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x38957e,_0x50e8('0xb'),JSON[_0x50e8('0xd')](_0xe53f1d));if(_0xe53f1d[_0x50e8('0xe')]){if(_0xe53f1d[_0x50e8('0xe')][_0x50e8('0xf')]===0x1f4){logger[_0x50e8('0xe')](_0x50e8('0xa'),_0x38957e,_0xe53f1d[_0x50e8('0xe')][_0x50e8('0x10')]);return _0x6d3bc2(_0xe53f1d[_0x50e8('0xe')][_0x50e8('0x10')]);}logger[_0x50e8('0xe')](_0x50e8('0xa'),_0x38957e,_0xe53f1d[_0x50e8('0xe')]['message']);return _0x30a6f2(_0xe53f1d[_0x50e8('0xe')][_0x50e8('0x10')]);}else{logger['info'](_0x50e8('0xa'),_0x38957e,_0x50e8('0xb'));_0x30a6f2(_0xe53f1d[_0x50e8('0x11')][_0x50e8('0x10')]);}})[_0x50e8('0x12')](function(_0x217e0b){logger[_0x50e8('0xe')](_0x50e8('0xa'),_0x38957e,_0x217e0b);_0x6d3bc2(_0x217e0b);});});}
\ No newline at end of file
+var _0x22bd=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x42a9ae,_0x3bfa36){var _0x3f53eb=function(_0x4f5b1c){while(--_0x4f5b1c){_0x42a9ae['push'](_0x42a9ae['shift']());}};_0x3f53eb(++_0x3bfa36);}(_0x22bd,0x187));var _0xd22b=function(_0x371e1b,_0xdd8c90){_0x371e1b=_0x371e1b-0x0;var _0x15b1d9=_0x22bd[_0x371e1b];return _0x15b1d9;};'use strict';var _=require('lodash');var util=require(_0xd22b('0x0'));var moment=require('moment');var BPromise=require(_0xd22b('0x1'));var rs=require(_0xd22b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd22b('0x3'))['db'];var utils=require(_0xd22b('0x4'));var logger=require(_0xd22b('0x5'))(_0xd22b('0x6'));var config=require('../../config/environment');var jayson=require(_0xd22b('0x7'));var client=jayson[_0xd22b('0x8')][_0xd22b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30e8d2,_0x3a3076,_0x4c8c70){return new BPromise(function(_0x117234,_0x2a1a55){return client[_0xd22b('0xa')](_0x30e8d2,_0x4c8c70)[_0xd22b('0xb')](function(_0x300aed){logger['info'](_0xd22b('0xc'),_0x3a3076,'request\x20sent');logger[_0xd22b('0xd')](_0xd22b('0xe'),_0x3a3076,_0xd22b('0xf'),JSON[_0xd22b('0x10')](_0x300aed));if(_0x300aed[_0xd22b('0x11')]){if(_0x300aed[_0xd22b('0x11')][_0xd22b('0x12')]===0x1f4){logger[_0xd22b('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3a3076,_0x300aed['error'][_0xd22b('0x13')]);return _0x2a1a55(_0x300aed[_0xd22b('0x11')][_0xd22b('0x13')]);}logger[_0xd22b('0x11')](_0xd22b('0xc'),_0x3a3076,_0x300aed['error'][_0xd22b('0x13')]);return _0x117234(_0x300aed['error'][_0xd22b('0x13')]);}else{logger[_0xd22b('0x14')](_0xd22b('0xc'),_0x3a3076,'request\x20sent');_0x117234(_0x300aed[_0xd22b('0x15')]['message']);}})[_0xd22b('0x16')](function(_0x11be2f){logger[_0xd22b('0x11')](_0xd22b('0xc'),_0x3a3076,_0x11be2f);_0x2a1a55(_0x11be2f);});});}
\ No newline at end of file
index deba02a..45b40bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe229=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x2cb900,_0x2b4852){var _0x1a4520=function(_0x4ae293){while(--_0x4ae293){_0x2cb900['push'](_0x2cb900['shift']());}};_0x1a4520(++_0x2b4852);}(_0xe229,0x7b));var _0x9e22=function(_0x1529a5,_0x2886f5){_0x1529a5=_0x1529a5-0x0;var _0x119d1a=_0xe229[_0x1529a5];return _0x119d1a;};'use strict';var multer=require(_0x9e22('0x0'));var util=require(_0x9e22('0x1'));var path=require('path');var timeout=require(_0x9e22('0x2'));var express=require(_0x9e22('0x3'));var router=express[_0x9e22('0x4')]();var fs_extra=require(_0x9e22('0x5'));var auth=require(_0x9e22('0x6'));var interaction=require(_0x9e22('0x7'));var config=require(_0x9e22('0x8'));var controller=require(_0x9e22('0x9'));router[_0x9e22('0xa')]('/',auth[_0x9e22('0xb')](),controller[_0x9e22('0xc')]);router[_0x9e22('0xa')](_0x9e22('0xd'),auth['isAuthenticated'](),controller[_0x9e22('0xe')]);router[_0x9e22('0xf')]('/',auth['isAuthenticated'](),controller[_0x9e22('0x10')]);router[_0x9e22('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9e22('0x12')]);router['delete']('/:id',auth[_0x9e22('0xb')](),controller[_0x9e22('0x13')]);module[_0x9e22('0x14')]=router;
\ No newline at end of file
+var _0x70ce=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','get','/:id','show','post','create','put','isAuthenticated'];(function(_0x522249,_0x565fb3){var _0x2e6dac=function(_0x539a84){while(--_0x539a84){_0x522249['push'](_0x522249['shift']());}};_0x2e6dac(++_0x565fb3);}(_0x70ce,0x17e));var _0xe70c=function(_0x3d4aed,_0x4244ab){_0x3d4aed=_0x3d4aed-0x0;var _0x3c1776=_0x70ce[_0x3d4aed];return _0x3c1776;};'use strict';var multer=require(_0xe70c('0x0'));var util=require('util');var path=require(_0xe70c('0x1'));var timeout=require(_0xe70c('0x2'));var express=require(_0xe70c('0x3'));var router=express['Router']();var fs_extra=require(_0xe70c('0x4'));var auth=require(_0xe70c('0x5'));var interaction=require(_0xe70c('0x6'));var config=require(_0xe70c('0x7'));var controller=require(_0xe70c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe70c('0x9')]);router[_0xe70c('0xa')](_0xe70c('0xb'),auth['isAuthenticated'](),controller[_0xe70c('0xc')]);router[_0xe70c('0xd')]('/',auth['isAuthenticated'](),controller[_0xe70c('0xe')]);router[_0xe70c('0xf')](_0xe70c('0xb'),auth[_0xe70c('0x10')](),controller[_0xe70c('0x11')]);router[_0xe70c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe70c('0x13')]);module[_0xe70c('0x14')]=router;
\ No newline at end of file
index 5f51a92..01c7bfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6a1=['keyValue','picklist','STRING','customVariable','sequelize','exports','ENUM','string','variable'];(function(_0x12c32c,_0x13af3b){var _0x39b809=function(_0x278d4e){while(--_0x278d4e){_0x12c32c['push'](_0x12c32c['shift']());}};_0x39b809(++_0x13af3b);}(_0xe6a1,0x1cf));var _0x1e6a=function(_0x43c9d4,_0x31437b){_0x43c9d4=_0x43c9d4-0x0;var _0x412ec4=_0xe6a1[_0x43c9d4];return _0x412ec4;};'use strict';var Sequelize=require(_0x1e6a('0x0'));module[_0x1e6a('0x1')]={'type':{'type':Sequelize[_0x1e6a('0x2')](_0x1e6a('0x3'),_0x1e6a('0x4'),'customVariable',_0x1e6a('0x5'),_0x1e6a('0x6')),'defaultValue':_0x1e6a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1e6a('0x7')]},'keyType':{'type':Sequelize[_0x1e6a('0x2')](_0x1e6a('0x3'),_0x1e6a('0x4'),_0x1e6a('0x8'))},'keyContent':{'type':Sequelize[_0x1e6a('0x7')]},'idField':{'type':Sequelize[_0x1e6a('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e6a('0x7')]}};
\ No newline at end of file
+var _0xa89d=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xa89d,0x1f3));var _0xda89=function(_0x4b501c,_0x293a2f){_0x4b501c=_0x4b501c-0x0;var _0x45daeb=_0xa89d[_0x4b501c];return _0x45daeb;};'use strict';var Sequelize=require(_0xda89('0x0'));module[_0xda89('0x1')]={'type':{'type':Sequelize[_0xda89('0x2')](_0xda89('0x3'),_0xda89('0x4'),'customVariable',_0xda89('0x5'),_0xda89('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xda89('0x7')]},'key':{'type':Sequelize[_0xda89('0x7')]},'keyType':{'type':Sequelize[_0xda89('0x2')](_0xda89('0x3'),_0xda89('0x4'),_0xda89('0x8'))},'keyContent':{'type':Sequelize[_0xda89('0x7')]},'idField':{'type':Sequelize[_0xda89('0x7')]},'nameField':{'type':Sequelize[_0xda89('0x7')]},'customField':{'type':Sequelize[_0xda89('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0b743e9..e26c346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a33=['fieldName','key','name','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','includeAll','rows','catch','show','include','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','index','map','SugarcrmField','rawAttributes'];(function(_0x44fd6b,_0x338098){var _0x7cba12=function(_0x5a6bb5){while(--_0x5a6bb5){_0x44fd6b['push'](_0x44fd6b['shift']());}};_0x7cba12(++_0x338098);}(_0x8a33,0xe1));var _0x38a3=function(_0x348b29,_0x3be5e9){_0x348b29=_0x348b29-0x0;var _0xc260c5=_0x8a33[_0x348b29];return _0xc260c5;};'use strict';var emlformat=require(_0x38a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38a3('0x1'));var jsonpatch=require(_0x38a3('0x2'));var rp=require(_0x38a3('0x3'));var moment=require(_0x38a3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x38a3('0x5'));var util=require(_0x38a3('0x6'));var path=require(_0x38a3('0x7'));var sox=require('sox');var csv=require(_0x38a3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38a3('0x9'));var _=require(_0x38a3('0xa'));var squel=require('squel');var crypto=require(_0x38a3('0xb'));var jsforce=require(_0x38a3('0xc'));var deskjs=require(_0x38a3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x38a3('0xe'));var Papa=require('papaparse');var Redis=require(_0x38a3('0xf'));var authService=require(_0x38a3('0x10'));var qs=require(_0x38a3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38a3('0x12'));var logger=require(_0x38a3('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28f822,_0x5dbe7b){_0x5dbe7b=_0x5dbe7b||0xcc;return function(_0x5c4a5f){if(_0x5c4a5f){return _0x28f822[_0x38a3('0x14')](_0x5dbe7b);}return _0x28f822[_0x38a3('0x15')](_0x5dbe7b)[_0x38a3('0x16')]();};}function respondWithResult(_0x53e988,_0x9e4e4d){_0x9e4e4d=_0x9e4e4d||0xc8;return function(_0x54b57a){if(_0x54b57a){return _0x53e988[_0x38a3('0x15')](_0x9e4e4d)[_0x38a3('0x17')](_0x54b57a);}};}function respondWithFilteredResult(_0x30720e,_0x1c0fd3){return function(_0x2c3deb){if(_0x2c3deb){var _0x18f392=typeof _0x1c0fd3['offset']==='undefined'&&typeof _0x1c0fd3[_0x38a3('0x18')]==='undefined';var _0xd6cd0b=_0x2c3deb['count'];var _0x5f1981=_0x18f392?0x0:_0x1c0fd3[_0x38a3('0x19')];var _0x4f14a1=_0x18f392?_0x2c3deb[_0x38a3('0x1a')]:_0x1c0fd3['offset']+_0x1c0fd3['limit'];var _0x1afa2b;if(_0x4f14a1>=_0xd6cd0b){_0x4f14a1=_0xd6cd0b;_0x1afa2b=0xc8;}else{_0x1afa2b=0xce;}_0x30720e[_0x38a3('0x15')](_0x1afa2b);return _0x30720e['set'](_0x38a3('0x1b'),_0x5f1981+'-'+_0x4f14a1+'/'+_0xd6cd0b)[_0x38a3('0x17')](_0x2c3deb);}return null;};}function patchUpdates(_0x4a57bf){return function(_0x2ec6fa){try{jsonpatch[_0x38a3('0x1c')](_0x2ec6fa,_0x4a57bf,!![]);}catch(_0x155a2b){return BPromise[_0x38a3('0x1d')](_0x155a2b);}return _0x2ec6fa[_0x38a3('0x1e')]();};}function saveUpdates(_0x144f2f,_0x443fb5){return function(_0x5506b2){if(_0x5506b2){return _0x5506b2[_0x38a3('0x1f')](_0x144f2f)[_0x38a3('0x20')](function(_0x101bba){return _0x101bba;});}return null;};}function removeEntity(_0x569455,_0x5b2483){return function(_0x593d01){if(_0x593d01){return _0x593d01[_0x38a3('0x21')]()[_0x38a3('0x20')](function(){_0x569455[_0x38a3('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c1d18,_0x2ee945){return function(_0x577947){if(!_0x577947){_0x3c1d18[_0x38a3('0x14')](0x194);}return _0x577947;};}function handleError(_0x50bb14,_0x14290f){_0x14290f=_0x14290f||0x1f4;return function(_0x161d6e){logger[_0x38a3('0x22')](_0x161d6e['stack']);if(_0x161d6e['name']){delete _0x161d6e['name'];}_0x50bb14[_0x38a3('0x15')](_0x14290f)['send'](_0x161d6e);};}exports[_0x38a3('0x23')]=function(_0x5ba9ef,_0x25272b){var _0x5d9f0a={},_0x3743e1={},_0x1c7e14={'count':0x0,'rows':[]};var _0x11bc30=_[_0x38a3('0x24')](db[_0x38a3('0x25')][_0x38a3('0x26')],function(_0x355bf2){return{'name':_0x355bf2[_0x38a3('0x27')],'type':_0x355bf2['type'][_0x38a3('0x28')]};});_0x3743e1['model']=_[_0x38a3('0x24')](_0x11bc30,_0x38a3('0x29'));_0x3743e1['query']=_[_0x38a3('0x2a')](_0x5ba9ef[_0x38a3('0x2b')]);_0x3743e1[_0x38a3('0x2c')]=_[_0x38a3('0x2d')](_0x3743e1['model'],_0x3743e1[_0x38a3('0x2b')]);_0x5d9f0a[_0x38a3('0x2e')]=_[_0x38a3('0x2d')](_0x3743e1[_0x38a3('0x2f')],qs['fields'](_0x5ba9ef[_0x38a3('0x2b')][_0x38a3('0x30')]));_0x5d9f0a['attributes']=_0x5d9f0a['attributes']['length']?_0x5d9f0a['attributes']:_0x3743e1[_0x38a3('0x2f')];if(!_0x5ba9ef['query'][_0x38a3('0x31')](_0x38a3('0x32'))){_0x5d9f0a[_0x38a3('0x18')]=qs['limit'](_0x5ba9ef['query']['limit']);_0x5d9f0a[_0x38a3('0x19')]=qs[_0x38a3('0x19')](_0x5ba9ef['query']['offset']);}_0x5d9f0a['order']=qs[_0x38a3('0x33')](_0x5ba9ef[_0x38a3('0x2b')][_0x38a3('0x33')]);_0x5d9f0a['where']=qs[_0x38a3('0x2c')](_[_0x38a3('0x34')](_0x5ba9ef['query'],_0x3743e1[_0x38a3('0x2c')]),_0x11bc30);if(_0x5ba9ef[_0x38a3('0x2b')][_0x38a3('0x35')]){_0x5d9f0a[_0x38a3('0x36')]=_[_0x38a3('0x37')](_0x5d9f0a['where'],{'$or':_['map'](_0x11bc30,function(_0x2f9bfe){if(_0x2f9bfe[_0x38a3('0x38')]!=='VIRTUAL'){var _0x268a5b={};_0x268a5b[_0x2f9bfe[_0x38a3('0x29')]]={'$like':'%'+_0x5ba9ef[_0x38a3('0x2b')][_0x38a3('0x35')]+'%'};return _0x268a5b;}})});}_0x5d9f0a=_['merge']({},_0x5d9f0a,_0x5ba9ef[_0x38a3('0x39')]);var _0x49bc06={'where':_0x5d9f0a['where']};return db['SugarcrmField'][_0x38a3('0x1a')](_0x49bc06)['then'](function(_0xd99d69){_0x1c7e14['count']=_0xd99d69;if(_0x5ba9ef[_0x38a3('0x2b')][_0x38a3('0x3a')]){_0x5d9f0a['include']=[{'all':!![]}];}return db[_0x38a3('0x25')]['findAll'](_0x5d9f0a);})['then'](function(_0x8de9b9){_0x1c7e14[_0x38a3('0x3b')]=_0x8de9b9;return _0x1c7e14;})[_0x38a3('0x20')](respondWithFilteredResult(_0x25272b,_0x5d9f0a))[_0x38a3('0x3c')](handleError(_0x25272b,null));};exports[_0x38a3('0x3d')]=function(_0x4b2b8e,_0x2da899){var _0x1fe97d={'raw':!![],'where':{'id':_0x4b2b8e['params']['id']}},_0x4ce612={};_0x4ce612[_0x38a3('0x2f')]=_[_0x38a3('0x2a')](db[_0x38a3('0x25')]['rawAttributes']);_0x4ce612[_0x38a3('0x2b')]=_[_0x38a3('0x2a')](_0x4b2b8e[_0x38a3('0x2b')]);_0x4ce612[_0x38a3('0x2c')]=_[_0x38a3('0x2d')](_0x4ce612[_0x38a3('0x2f')],_0x4ce612['query']);_0x1fe97d[_0x38a3('0x2e')]=_[_0x38a3('0x2d')](_0x4ce612[_0x38a3('0x2f')],qs[_0x38a3('0x30')](_0x4b2b8e[_0x38a3('0x2b')][_0x38a3('0x30')]));_0x1fe97d[_0x38a3('0x2e')]=_0x1fe97d['attributes']['length']?_0x1fe97d[_0x38a3('0x2e')]:_0x4ce612[_0x38a3('0x2f')];if(_0x4b2b8e['query'][_0x38a3('0x3a')]){_0x1fe97d[_0x38a3('0x3e')]=[{'all':!![]}];}_0x1fe97d=_[_0x38a3('0x37')]({},_0x1fe97d,_0x4b2b8e['options']);return db[_0x38a3('0x25')]['find'](_0x1fe97d)['then'](handleEntityNotFound(_0x2da899,null))[_0x38a3('0x20')](respondWithResult(_0x2da899,null))[_0x38a3('0x3c')](handleError(_0x2da899,null));};exports['create']=function(_0x4d4ec2,_0x40ff05){return db['SugarcrmField'][_0x38a3('0x3f')](_0x4d4ec2[_0x38a3('0x40')],{})[_0x38a3('0x20')](respondWithResult(_0x40ff05,0xc9))[_0x38a3('0x3c')](handleError(_0x40ff05,null));};exports[_0x38a3('0x1f')]=function(_0x2bc648,_0x1e370e){if(_0x2bc648[_0x38a3('0x40')]['id']){delete _0x2bc648['body']['id'];}return db[_0x38a3('0x25')]['find']({'where':{'id':_0x2bc648[_0x38a3('0x41')]['id']}})[_0x38a3('0x20')](handleEntityNotFound(_0x1e370e,null))['then'](saveUpdates(_0x2bc648[_0x38a3('0x40')],null))[_0x38a3('0x20')](respondWithResult(_0x1e370e,null))[_0x38a3('0x3c')](handleError(_0x1e370e,null));};exports[_0x38a3('0x21')]=function(_0x2dcda8,_0x33434a){return db['SugarcrmField']['find']({'where':{'id':_0x2dcda8['params']['id']}})['then'](handleEntityNotFound(_0x33434a,null))['then'](removeEntity(_0x33434a,null))[_0x38a3('0x3c')](handleError(_0x33434a,null));};
\ No newline at end of file
+var _0xc620=['pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','then','end','error','name','send','map','SugarcrmField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where'];(function(_0x1dbee4,_0x4058bc){var _0xacce92=function(_0xb1201d){while(--_0xb1201d){_0x1dbee4['push'](_0x1dbee4['shift']());}};_0xacce92(++_0x4058bc);}(_0xc620,0xa9));var _0x0c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc620[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c62('0x0'));var rimraf=require(_0x0c62('0x1'));var zipdir=require(_0x0c62('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c62('0x3'));var moment=require(_0x0c62('0x4'));var BPromise=require(_0x0c62('0x5'));var Mustache=require(_0x0c62('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0c62('0x7'));var ejs=require(_0x0c62('0x8'));var fs=require('fs');var fs_extra=require(_0x0c62('0x9'));var _=require(_0x0c62('0xa'));var squel=require(_0x0c62('0xb'));var crypto=require(_0x0c62('0xc'));var jsforce=require(_0x0c62('0xd'));var deskjs=require(_0x0c62('0xe'));var toCsv=require(_0x0c62('0x7'));var querystring=require(_0x0c62('0xf'));var Papa=require(_0x0c62('0x10'));var Redis=require(_0x0c62('0x11'));var authService=require(_0x0c62('0x12'));var qs=require(_0x0c62('0x13'));var as=require(_0x0c62('0x14'));var hardwareService=require(_0x0c62('0x15'));var logger=require(_0x0c62('0x16'))(_0x0c62('0x17'));var utils=require('../../config/utils');var config=require(_0x0c62('0x18'));var licenseUtil=require(_0x0c62('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403a5a,_0x490ef3){_0x490ef3=_0x490ef3||0xcc;return function(_0x142e98){if(_0x142e98){return _0x403a5a[_0x0c62('0x1a')](_0x490ef3);}return _0x403a5a['status'](_0x490ef3)['end']();};}function respondWithResult(_0x555323,_0x239e4f){_0x239e4f=_0x239e4f||0xc8;return function(_0x175d67){if(_0x175d67){return _0x555323[_0x0c62('0x1b')](_0x239e4f)[_0x0c62('0x1c')](_0x175d67);}};}function respondWithFilteredResult(_0x441c6b,_0x565f58){return function(_0x2a7a60){if(_0x2a7a60){var _0x41afb6=typeof _0x565f58[_0x0c62('0x1d')]===_0x0c62('0x1e')&&typeof _0x565f58['limit']===_0x0c62('0x1e');var _0x3998c7=_0x2a7a60[_0x0c62('0x1f')];var _0x5b1c83=_0x41afb6?0x0:_0x565f58[_0x0c62('0x1d')];var _0xe46d24=_0x41afb6?_0x2a7a60[_0x0c62('0x1f')]:_0x565f58[_0x0c62('0x1d')]+_0x565f58['limit'];var _0x19839f;if(_0xe46d24>=_0x3998c7){_0xe46d24=_0x3998c7;_0x19839f=0xc8;}else{_0x19839f=0xce;}_0x441c6b[_0x0c62('0x1b')](_0x19839f);return _0x441c6b[_0x0c62('0x20')]('Content-Range',_0x5b1c83+'-'+_0xe46d24+'/'+_0x3998c7)['json'](_0x2a7a60);}return null;};}function patchUpdates(_0x2f78aa){return function(_0x4a0723){try{jsonpatch[_0x0c62('0x21')](_0x4a0723,_0x2f78aa,!![]);}catch(_0x571bfb){return BPromise[_0x0c62('0x22')](_0x571bfb);}return _0x4a0723[_0x0c62('0x23')]();};}function saveUpdates(_0x396fe6,_0x754f8e){return function(_0x5a1def){if(_0x5a1def){return _0x5a1def[_0x0c62('0x24')](_0x396fe6)[_0x0c62('0x25')](function(_0x1bc05b){return _0x1bc05b;});}return null;};}function removeEntity(_0x5335a3,_0x26498d){return function(_0x19859f){if(_0x19859f){return _0x19859f['destroy']()[_0x0c62('0x25')](function(){_0x5335a3['status'](0xcc)[_0x0c62('0x26')]();});}};}function handleEntityNotFound(_0x29ba46,_0x36b985){return function(_0x23a8e4){if(!_0x23a8e4){_0x29ba46[_0x0c62('0x1a')](0x194);}return _0x23a8e4;};}function handleError(_0x51f181,_0x4c33fe){_0x4c33fe=_0x4c33fe||0x1f4;return function(_0x23bc2f){logger[_0x0c62('0x27')](_0x23bc2f['stack']);if(_0x23bc2f[_0x0c62('0x28')]){delete _0x23bc2f[_0x0c62('0x28')];}_0x51f181[_0x0c62('0x1b')](_0x4c33fe)[_0x0c62('0x29')](_0x23bc2f);};}exports['index']=function(_0x1f35c3,_0x12d8dc){var _0x494d42={},_0x2f4872={},_0x2e930d={'count':0x0,'rows':[]};var _0x3f7d59=_[_0x0c62('0x2a')](db[_0x0c62('0x2b')][_0x0c62('0x2c')],function(_0x2fa7e4){return{'name':_0x2fa7e4['fieldName'],'type':_0x2fa7e4[_0x0c62('0x2d')][_0x0c62('0x2e')]};});_0x2f4872[_0x0c62('0x2f')]=_[_0x0c62('0x2a')](_0x3f7d59,_0x0c62('0x28'));_0x2f4872[_0x0c62('0x30')]=_[_0x0c62('0x31')](_0x1f35c3[_0x0c62('0x30')]);_0x2f4872[_0x0c62('0x32')]=_[_0x0c62('0x33')](_0x2f4872[_0x0c62('0x2f')],_0x2f4872[_0x0c62('0x30')]);_0x494d42[_0x0c62('0x34')]=_[_0x0c62('0x33')](_0x2f4872['model'],qs[_0x0c62('0x35')](_0x1f35c3[_0x0c62('0x30')][_0x0c62('0x35')]));_0x494d42[_0x0c62('0x34')]=_0x494d42['attributes']['length']?_0x494d42[_0x0c62('0x34')]:_0x2f4872[_0x0c62('0x2f')];if(!_0x1f35c3[_0x0c62('0x30')]['hasOwnProperty'](_0x0c62('0x36'))){_0x494d42[_0x0c62('0x37')]=qs['limit'](_0x1f35c3[_0x0c62('0x30')][_0x0c62('0x37')]);_0x494d42[_0x0c62('0x1d')]=qs[_0x0c62('0x1d')](_0x1f35c3['query'][_0x0c62('0x1d')]);}_0x494d42[_0x0c62('0x38')]=qs[_0x0c62('0x39')](_0x1f35c3['query'][_0x0c62('0x39')]);_0x494d42[_0x0c62('0x3a')]=qs[_0x0c62('0x32')](_[_0x0c62('0x3b')](_0x1f35c3[_0x0c62('0x30')],_0x2f4872['filters']),_0x3f7d59);if(_0x1f35c3['query'][_0x0c62('0x3c')]){_0x494d42[_0x0c62('0x3a')]=_[_0x0c62('0x3d')](_0x494d42['where'],{'$or':_[_0x0c62('0x2a')](_0x3f7d59,function(_0x557931){if(_0x557931[_0x0c62('0x2d')]!==_0x0c62('0x3e')){var _0x48bdc2={};_0x48bdc2[_0x557931['name']]={'$like':'%'+_0x1f35c3[_0x0c62('0x30')][_0x0c62('0x3c')]+'%'};return _0x48bdc2;}})});}_0x494d42=_['merge']({},_0x494d42,_0x1f35c3['options']);var _0x27da78={'where':_0x494d42['where']};return db['SugarcrmField'][_0x0c62('0x1f')](_0x27da78)[_0x0c62('0x25')](function(_0x5a6f9a){_0x2e930d[_0x0c62('0x1f')]=_0x5a6f9a;if(_0x1f35c3[_0x0c62('0x30')]['includeAll']){_0x494d42[_0x0c62('0x3f')]=[{'all':!![]}];}return db[_0x0c62('0x2b')][_0x0c62('0x40')](_0x494d42);})[_0x0c62('0x25')](function(_0x291342){_0x2e930d[_0x0c62('0x41')]=_0x291342;return _0x2e930d;})[_0x0c62('0x25')](respondWithFilteredResult(_0x12d8dc,_0x494d42))[_0x0c62('0x42')](handleError(_0x12d8dc,null));};exports[_0x0c62('0x43')]=function(_0x451ee3,_0x2ecc52){var _0x49a3c9={'raw':!![],'where':{'id':_0x451ee3[_0x0c62('0x44')]['id']}},_0x1f6a0d={};_0x1f6a0d[_0x0c62('0x2f')]=_['keys'](db[_0x0c62('0x2b')][_0x0c62('0x2c')]);_0x1f6a0d[_0x0c62('0x30')]=_[_0x0c62('0x31')](_0x451ee3[_0x0c62('0x30')]);_0x1f6a0d[_0x0c62('0x32')]=_[_0x0c62('0x33')](_0x1f6a0d[_0x0c62('0x2f')],_0x1f6a0d['query']);_0x49a3c9[_0x0c62('0x34')]=_['intersection'](_0x1f6a0d['model'],qs[_0x0c62('0x35')](_0x451ee3[_0x0c62('0x30')][_0x0c62('0x35')]));_0x49a3c9[_0x0c62('0x34')]=_0x49a3c9['attributes'][_0x0c62('0x45')]?_0x49a3c9[_0x0c62('0x34')]:_0x1f6a0d[_0x0c62('0x2f')];if(_0x451ee3[_0x0c62('0x30')][_0x0c62('0x46')]){_0x49a3c9[_0x0c62('0x3f')]=[{'all':!![]}];}_0x49a3c9=_[_0x0c62('0x3d')]({},_0x49a3c9,_0x451ee3[_0x0c62('0x47')]);return db[_0x0c62('0x2b')][_0x0c62('0x48')](_0x49a3c9)[_0x0c62('0x25')](handleEntityNotFound(_0x2ecc52,null))[_0x0c62('0x25')](respondWithResult(_0x2ecc52,null))['catch'](handleError(_0x2ecc52,null));};exports['create']=function(_0xce1950,_0x4666c3){return db[_0x0c62('0x2b')][_0x0c62('0x49')](_0xce1950['body'],{})[_0x0c62('0x25')](respondWithResult(_0x4666c3,0xc9))[_0x0c62('0x42')](handleError(_0x4666c3,null));};exports[_0x0c62('0x24')]=function(_0xa45fe9,_0x44d48e){if(_0xa45fe9['body']['id']){delete _0xa45fe9[_0x0c62('0x4a')]['id'];}return db[_0x0c62('0x2b')][_0x0c62('0x48')]({'where':{'id':_0xa45fe9[_0x0c62('0x44')]['id']}})[_0x0c62('0x25')](handleEntityNotFound(_0x44d48e,null))['then'](saveUpdates(_0xa45fe9[_0x0c62('0x4a')],null))['then'](respondWithResult(_0x44d48e,null))['catch'](handleError(_0x44d48e,null));};exports[_0x0c62('0x4b')]=function(_0xf200fe,_0x1a61e9){return db[_0x0c62('0x2b')][_0x0c62('0x48')]({'where':{'id':_0xf200fe[_0x0c62('0x44')]['id']}})[_0x0c62('0x25')](handleEntityNotFound(_0x1a61e9,null))[_0x0c62('0x25')](removeEntity(_0x1a61e9,null))[_0x0c62('0x42')](handleError(_0x1a61e9,null));};
\ No newline at end of file
index 7642235..d4ba9e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2553=['../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4dd910,_0xfdef27){var _0x537e96=function(_0x2f5b79){while(--_0x2f5b79){_0x4dd910['push'](_0x4dd910['shift']());}};_0x537e96(++_0xfdef27);}(_0x2553,0x151));var _0x3255=function(_0x1b7ea6,_0x195a62){_0x1b7ea6=_0x1b7ea6-0x0;var _0x4fcea6=_0x2553[_0x1b7ea6];return _0x4fcea6;};'use strict';var _=require(_0x3255('0x0'));var util=require(_0x3255('0x1'));var logger=require(_0x3255('0x2'))(_0x3255('0x3'));var moment=require(_0x3255('0x4'));var BPromise=require(_0x3255('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3255('0x6'));var rimraf=require(_0x3255('0x7'));var config=require(_0x3255('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x3255('0x9')]=function(_0x4a5de2,_0xeb585c){return _0x4a5de2[_0x3255('0xa')](_0x3255('0xb'),attributes,{'tableName':_0x3255('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x3255('0xd'),_0x3255('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1762=['sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','SugarcrmField','int_sugarcrm_fields'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x1762,0x1a7));var _0x2176=function(_0x2382e2,_0x1c07e6){_0x2382e2=_0x2382e2-0x0;var _0x5e9fab=_0x1762[_0x2382e2];return _0x5e9fab;};'use strict';var _=require(_0x2176('0x0'));var util=require(_0x2176('0x1'));var logger=require(_0x2176('0x2'))(_0x2176('0x3'));var moment=require(_0x2176('0x4'));var BPromise=require('bluebird');var rp=require(_0x2176('0x5'));var fs=require('fs');var path=require(_0x2176('0x6'));var rimraf=require(_0x2176('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x2176('0x8')]=function(_0x5244ef,_0x1df247){return _0x5244ef[_0x2176('0x9')](_0x2176('0xa'),attributes,{'tableName':_0x2176('0xb'),'paranoid':![],'indexes':[{'name':_0x2176('0xc'),'fields':[_0x2176('0xd'),_0x2176('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 25ce881..3c017eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa766=['client','http','request','request\x20sent','debug','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0xa766,0x14f));var _0x6a76=function(_0x38fcd4,_0x156f7b){_0x38fcd4=_0x38fcd4-0x0;var _0x104a50=_0xa766[_0x38fcd4];return _0x104a50;};'use strict';var _=require(_0x6a76('0x0'));var util=require('util');var moment=require(_0x6a76('0x1'));var BPromise=require(_0x6a76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a76('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6a76('0x4'))(_0x6a76('0x5'));var config=require('../../config/environment');var jayson=require(_0x6a76('0x6'));var client=jayson[_0x6a76('0x7')][_0x6a76('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44dfd9,_0x1b59c9,_0x2f3ee7){return new BPromise(function(_0xb89713,_0x3c0a92){return client[_0x6a76('0x9')](_0x44dfd9,_0x2f3ee7)['then'](function(_0x4114c9){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1b59c9,_0x6a76('0xa'));logger[_0x6a76('0xb')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1b59c9,'request\x20sent',JSON[_0x6a76('0xc')](_0x4114c9));if(_0x4114c9['error']){if(_0x4114c9[_0x6a76('0xd')][_0x6a76('0xe')]===0x1f4){logger[_0x6a76('0xd')](_0x6a76('0xf'),_0x1b59c9,_0x4114c9['error']['message']);return _0x3c0a92(_0x4114c9[_0x6a76('0xd')][_0x6a76('0x10')]);}logger[_0x6a76('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x1b59c9,_0x4114c9[_0x6a76('0xd')][_0x6a76('0x10')]);return _0xb89713(_0x4114c9['error'][_0x6a76('0x10')]);}else{logger[_0x6a76('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1b59c9,_0x6a76('0xa'));_0xb89713(_0x4114c9['result'][_0x6a76('0x10')]);}})[_0x6a76('0x12')](function(_0x1f63c7){logger[_0x6a76('0xd')](_0x6a76('0xf'),_0x1b59c9,_0x1f63c7);_0x3c0a92(_0x1f63c7);});});}
\ No newline at end of file
+var _0xc368=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xc368,0x19d));var _0x8c36=function(_0x2fe1b1,_0x327ec7){_0x2fe1b1=_0x2fe1b1-0x0;var _0x501d06=_0xc368[_0x2fe1b1];return _0x501d06;};'use strict';var _=require(_0x8c36('0x0'));var util=require(_0x8c36('0x1'));var moment=require(_0x8c36('0x2'));var BPromise=require(_0x8c36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c36('0x4'));var db=require(_0x8c36('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c36('0x6'))(_0x8c36('0x7'));var config=require(_0x8c36('0x8'));var jayson=require(_0x8c36('0x9'));var client=jayson[_0x8c36('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c077c,_0x187dab,_0x1b3dcd){return new BPromise(function(_0x5989fe,_0x46b22d){return client[_0x8c36('0xb')](_0x4c077c,_0x1b3dcd)['then'](function(_0x35f605){logger[_0x8c36('0xc')](_0x8c36('0xd'),_0x187dab,_0x8c36('0xe'));logger['debug'](_0x8c36('0xf'),_0x187dab,_0x8c36('0xe'),JSON[_0x8c36('0x10')](_0x35f605));if(_0x35f605[_0x8c36('0x11')]){if(_0x35f605[_0x8c36('0x11')][_0x8c36('0x12')]===0x1f4){logger[_0x8c36('0x11')](_0x8c36('0xd'),_0x187dab,_0x35f605['error']['message']);return _0x46b22d(_0x35f605[_0x8c36('0x11')][_0x8c36('0x13')]);}logger['error'](_0x8c36('0xd'),_0x187dab,_0x35f605[_0x8c36('0x11')][_0x8c36('0x13')]);return _0x5989fe(_0x35f605[_0x8c36('0x11')]['message']);}else{logger[_0x8c36('0xc')](_0x8c36('0xd'),_0x187dab,_0x8c36('0xe'));_0x5989fe(_0x35f605[_0x8c36('0x14')][_0x8c36('0x13')]);}})[_0x8c36('0x15')](function(_0x5b4f46){logger[_0x8c36('0x11')](_0x8c36('0xd'),_0x187dab,_0x5b4f46);_0x46b22d(_0x5b4f46);});});}
\ No newline at end of file
index 09cb5f3..f584fdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x331c=['getFields','post','create','put','/:id','update','delete','destroy','exports','multer','path','Router','../../components/interaction/service','./intVtigerAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x4a2718,_0x2b8edb){var _0x41cddf=function(_0x2924d7){while(--_0x2924d7){_0x4a2718['push'](_0x4a2718['shift']());}};_0x41cddf(++_0x2b8edb);}(_0x331c,0xf0));var _0xc331=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x331c[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0xc331('0x0'));var util=require('util');var path=require(_0xc331('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc331('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc331('0x3'));var config=require('../../config/environment');var controller=require(_0xc331('0x4'));router[_0xc331('0x5')]('/',auth['isAuthenticated'](),controller[_0xc331('0x6')]);router[_0xc331('0x5')]('/:id',auth[_0xc331('0x7')](),controller[_0xc331('0x8')]);router[_0xc331('0x5')](_0xc331('0x9'),auth['isAuthenticated'](),controller[_0xc331('0xa')]);router['get'](_0xc331('0xb'),auth[_0xc331('0x7')](),controller[_0xc331('0xc')]);router[_0xc331('0xd')]('/',auth[_0xc331('0x7')](),controller[_0xc331('0xe')]);router[_0xc331('0xd')](_0xc331('0x9'),auth[_0xc331('0x7')](),controller['addConfiguration']);router[_0xc331('0xf')](_0xc331('0x10'),auth[_0xc331('0x7')](),controller[_0xc331('0x11')]);router[_0xc331('0x12')](_0xc331('0x10'),auth['isAuthenticated'](),controller[_0xc331('0x13')]);module[_0xc331('0x14')]=router;
\ No newline at end of file
+var _0xa854=['addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intVtigerAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa854,0x103));var _0x4a85=function(_0x20054b,_0x4e9bcb){_0x20054b=_0x20054b-0x0;var _0x396e66=_0xa854[_0x20054b];return _0x396e66;};'use strict';var multer=require(_0x4a85('0x0'));var util=require(_0x4a85('0x1'));var path=require(_0x4a85('0x2'));var timeout=require(_0x4a85('0x3'));var express=require(_0x4a85('0x4'));var router=express['Router']();var fs_extra=require(_0x4a85('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4a85('0x6'));var config=require('../../config/environment');var controller=require(_0x4a85('0x7'));router[_0x4a85('0x8')]('/',auth['isAuthenticated'](),controller[_0x4a85('0x9')]);router[_0x4a85('0x8')]('/:id',auth[_0x4a85('0xa')](),controller['show']);router[_0x4a85('0x8')](_0x4a85('0xb'),auth[_0x4a85('0xa')](),controller[_0x4a85('0xc')]);router[_0x4a85('0x8')](_0x4a85('0xd'),auth[_0x4a85('0xa')](),controller[_0x4a85('0xe')]);router[_0x4a85('0xf')]('/',auth['isAuthenticated'](),controller[_0x4a85('0x10')]);router[_0x4a85('0xf')](_0x4a85('0xb'),auth[_0x4a85('0xa')](),controller[_0x4a85('0x11')]);router[_0x4a85('0x12')](_0x4a85('0x13'),auth[_0x4a85('0xa')](),controller[_0x4a85('0x14')]);router['delete'](_0x4a85('0x13'),auth[_0x4a85('0xa')](),controller[_0x4a85('0x15')]);module[_0x4a85('0x16')]=router;
\ No newline at end of file
index 9e64e83..5c3361a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x220f=['STRING','sequelize'];(function(_0x377dcd,_0x3286ab){var _0x157cc0=function(_0x2f94a0){while(--_0x2f94a0){_0x377dcd['push'](_0x377dcd['shift']());}};_0x157cc0(++_0x3286ab);}(_0x220f,0xbd));var _0xf220=function(_0x1d33d6,_0xa760b7){_0x1d33d6=_0x1d33d6-0x0;var _0x440be6=_0x220f[_0x1d33d6];return _0x440be6;};'use strict';var Sequelize=require(_0xf220('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf220('0x1')]},'username':{'type':Sequelize[_0xf220('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xf220('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf220('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x6d79=['exports','STRING','HelpDesk','sequelize'];(function(_0x574285,_0x589bde){var _0x2d1343=function(_0x127cbc){while(--_0x127cbc){_0x574285['push'](_0x574285['shift']());}};_0x2d1343(++_0x589bde);}(_0x6d79,0x14b));var _0x96d7=function(_0x201d52,_0x42415b){_0x201d52=_0x201d52-0x0;var _0x5c9327=_0x6d79[_0x201d52];return _0x5c9327;};'use strict';var Sequelize=require(_0x96d7('0x0'));module[_0x96d7('0x1')]={'name':{'type':Sequelize[_0x96d7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x96d7('0x2')]},'username':{'type':Sequelize[_0x96d7('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x96d7('0x2')],'allowNull':![],'defaultValue':_0x96d7('0x3')},'remoteUri':{'type':Sequelize[_0x96d7('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x96d7('0x2')],'allowNull':![]}};
\ No newline at end of file
index 2286ded..fb991cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe100=['channel','Descriptions','VtigerField','getFields','serverUrl','accessKey','username','remoteUri','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','describe','sessionName','success','owner','remove','includes','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','sort','where','filters','filter','VIRTUAL','options','VtigerAccount','include','findAll','show','params','merge','find','catch','create','body','getConfigurations','findOne','pick','hasOwnProperty','nolimit','AccountId','Subjects'];(function(_0x3927a9,_0x253765){var _0xa3231a=function(_0x454f44){while(--_0x454f44){_0x3927a9['push'](_0x3927a9['shift']());}};_0xa3231a(++_0x253765);}(_0xe100,0x8e));var _0x0e10=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe100[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0e10('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e10('0x1'));var moment=require(_0x0e10('0x2'));var BPromise=require(_0x0e10('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0e10('0x4'));var sox=require(_0x0e10('0x5'));var csv=require(_0x0e10('0x6'));var ejs=require(_0x0e10('0x7'));var fs=require('fs');var fs_extra=require(_0x0e10('0x8'));var _=require(_0x0e10('0x9'));var squel=require('squel');var crypto=require(_0x0e10('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0e10('0xb'));var toCsv=require(_0x0e10('0x6'));var querystring=require(_0x0e10('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0e10('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e10('0xe'))(_0x0e10('0xf'));var utils=require(_0x0e10('0x10'));var config=require(_0x0e10('0x11'));var licenseUtil=require(_0x0e10('0x12'));var db=require(_0x0e10('0x13'))['db'];var integrations=require(_0x0e10('0x14'));function respondWithStatusCode(_0x13195c,_0x4885cb){_0x4885cb=_0x4885cb||0xcc;return function(_0x165556){if(_0x165556){return _0x13195c[_0x0e10('0x15')](_0x4885cb);}return _0x13195c[_0x0e10('0x16')](_0x4885cb)[_0x0e10('0x17')]();};}function respondWithResult(_0x130000,_0x22c232){_0x22c232=_0x22c232||0xc8;return function(_0x2fd6b9){if(_0x2fd6b9){return _0x130000[_0x0e10('0x16')](_0x22c232)['json'](_0x2fd6b9);}};}function respondWithFilteredResult(_0x28ecbd,_0x26a0b5){return function(_0x1fafcb){if(_0x1fafcb){var _0x1ae8d5=typeof _0x26a0b5['offset']===_0x0e10('0x18')&&typeof _0x26a0b5[_0x0e10('0x19')]===_0x0e10('0x18');var _0x4c20ff=_0x1fafcb[_0x0e10('0x1a')];var _0x3f58c0=_0x1ae8d5?0x0:_0x26a0b5[_0x0e10('0x1b')];var _0x415437=_0x1ae8d5?_0x1fafcb[_0x0e10('0x1a')]:_0x26a0b5['offset']+_0x26a0b5['limit'];var _0x4cbc3e;if(_0x415437>=_0x4c20ff){_0x415437=_0x4c20ff;_0x4cbc3e=0xc8;}else{_0x4cbc3e=0xce;}_0x28ecbd['status'](_0x4cbc3e);return _0x28ecbd['set'](_0x0e10('0x1c'),_0x3f58c0+'-'+_0x415437+'/'+_0x4c20ff)[_0x0e10('0x1d')](_0x1fafcb);}return null;};}function patchUpdates(_0x26fd54){return function(_0x8f7a61){try{jsonpatch[_0x0e10('0x1e')](_0x8f7a61,_0x26fd54,!![]);}catch(_0x3ad2df){return BPromise[_0x0e10('0x1f')](_0x3ad2df);}return _0x8f7a61[_0x0e10('0x20')]();};}function saveUpdates(_0x3d1e6a,_0x58848c){return function(_0x46689a){if(_0x46689a){return _0x46689a[_0x0e10('0x21')](_0x3d1e6a)[_0x0e10('0x22')](function(_0x334d2d){return _0x334d2d;});}return null;};}function removeEntity(_0x1cb72a,_0x1b9933){return function(_0x50a0f5){if(_0x50a0f5){return _0x50a0f5[_0x0e10('0x23')]()['then'](function(){_0x1cb72a[_0x0e10('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dee72,_0x4c501b){return function(_0x59af4b){if(!_0x59af4b){_0x3dee72[_0x0e10('0x15')](0x194);}return _0x59af4b;};}function handleError(_0x32babe,_0x485b83){_0x485b83=_0x485b83||0x1f4;return function(_0x3be6dd){logger[_0x0e10('0x24')](_0x3be6dd['stack']);if(_0x3be6dd['name']){delete _0x3be6dd[_0x0e10('0x25')];}_0x32babe['status'](_0x485b83)[_0x0e10('0x26')](_0x3be6dd);};}exports[_0x0e10('0x27')]=function(_0x531aab,_0x2f14c7){var _0x38ea41={},_0x9a6261={},_0x468b6b={'count':0x0,'rows':[]};var _0x52878e=_[_0x0e10('0x28')](db['VtigerAccount'][_0x0e10('0x29')],function(_0x2cd1e5){return{'name':_0x2cd1e5[_0x0e10('0x2a')],'type':_0x2cd1e5[_0x0e10('0x2b')]['key']};});_0x9a6261['model']=_[_0x0e10('0x28')](_0x52878e,_0x0e10('0x25'));_0x9a6261[_0x0e10('0x2c')]=_[_0x0e10('0x2d')](_0x531aab[_0x0e10('0x2c')]);_0x9a6261['filters']=_[_0x0e10('0x2e')](_0x9a6261[_0x0e10('0x2f')],_0x9a6261[_0x0e10('0x2c')]);_0x38ea41[_0x0e10('0x30')]=_[_0x0e10('0x2e')](_0x9a6261[_0x0e10('0x2f')],qs[_0x0e10('0x31')](_0x531aab[_0x0e10('0x2c')]['fields']));_0x38ea41[_0x0e10('0x30')]=_0x38ea41[_0x0e10('0x30')][_0x0e10('0x32')]?_0x38ea41[_0x0e10('0x30')]:_0x9a6261[_0x0e10('0x2f')];if(!_0x531aab[_0x0e10('0x2c')]['hasOwnProperty']('nolimit')){_0x38ea41[_0x0e10('0x19')]=qs[_0x0e10('0x19')](_0x531aab['query'][_0x0e10('0x19')]);_0x38ea41[_0x0e10('0x1b')]=qs[_0x0e10('0x1b')](_0x531aab[_0x0e10('0x2c')][_0x0e10('0x1b')]);}_0x38ea41['order']=qs[_0x0e10('0x33')](_0x531aab[_0x0e10('0x2c')][_0x0e10('0x33')]);_0x38ea41[_0x0e10('0x34')]=qs[_0x0e10('0x35')](_['pick'](_0x531aab[_0x0e10('0x2c')],_0x9a6261['filters']),_0x52878e);if(_0x531aab[_0x0e10('0x2c')][_0x0e10('0x36')]){_0x38ea41[_0x0e10('0x34')]=_['merge'](_0x38ea41[_0x0e10('0x34')],{'$or':_['map'](_0x52878e,function(_0x6e27e8){if(_0x6e27e8['type']!==_0x0e10('0x37')){var _0x24b7f8={};_0x24b7f8[_0x6e27e8[_0x0e10('0x25')]]={'$like':'%'+_0x531aab['query'][_0x0e10('0x36')]+'%'};return _0x24b7f8;}})});}_0x38ea41=_['merge']({},_0x38ea41,_0x531aab[_0x0e10('0x38')]);var _0x584391={'where':_0x38ea41[_0x0e10('0x34')]};return db[_0x0e10('0x39')][_0x0e10('0x1a')](_0x584391)[_0x0e10('0x22')](function(_0x448572){_0x468b6b[_0x0e10('0x1a')]=_0x448572;if(_0x531aab[_0x0e10('0x2c')]['includeAll']){_0x38ea41[_0x0e10('0x3a')]=[{'all':!![]}];}return db[_0x0e10('0x39')][_0x0e10('0x3b')](_0x38ea41);})[_0x0e10('0x22')](function(_0x4cfcf1){_0x468b6b['rows']=_0x4cfcf1;return _0x468b6b;})[_0x0e10('0x22')](respondWithFilteredResult(_0x2f14c7,_0x38ea41))['catch'](handleError(_0x2f14c7,null));};exports[_0x0e10('0x3c')]=function(_0x3e2557,_0x4ba14d){var _0x5675ac={'raw':![],'where':{'id':_0x3e2557[_0x0e10('0x3d')]['id']}},_0x86e4af={};_0x86e4af[_0x0e10('0x2f')]=_['keys'](db[_0x0e10('0x39')][_0x0e10('0x29')]);_0x86e4af['query']=_[_0x0e10('0x2d')](_0x3e2557[_0x0e10('0x2c')]);_0x86e4af[_0x0e10('0x35')]=_[_0x0e10('0x2e')](_0x86e4af[_0x0e10('0x2f')],_0x86e4af[_0x0e10('0x2c')]);_0x5675ac['attributes']=_[_0x0e10('0x2e')](_0x86e4af['model'],qs['fields'](_0x3e2557['query']['fields']));_0x5675ac[_0x0e10('0x30')]=_0x5675ac[_0x0e10('0x30')]['length']?_0x5675ac[_0x0e10('0x30')]:_0x86e4af[_0x0e10('0x2f')];if(_0x3e2557[_0x0e10('0x2c')]['includeAll']){_0x5675ac[_0x0e10('0x3a')]=[{'all':!![]}];}_0x5675ac=_[_0x0e10('0x3e')]({},_0x5675ac,_0x3e2557['options']);return db[_0x0e10('0x39')][_0x0e10('0x3f')](_0x5675ac)[_0x0e10('0x22')](handleEntityNotFound(_0x4ba14d,null))[_0x0e10('0x22')](respondWithResult(_0x4ba14d,null))[_0x0e10('0x40')](handleError(_0x4ba14d,null));};exports[_0x0e10('0x41')]=function(_0x5fcc23,_0x5f383c){return db['VtigerAccount'][_0x0e10('0x41')](_0x5fcc23['body'],{})[_0x0e10('0x22')](respondWithResult(_0x5f383c,0xc9))[_0x0e10('0x40')](handleError(_0x5f383c,null));};exports[_0x0e10('0x21')]=function(_0x3406d5,_0x4f6b5d){if(_0x3406d5['body']['id']){delete _0x3406d5[_0x0e10('0x42')]['id'];}return db[_0x0e10('0x39')][_0x0e10('0x3f')]({'where':{'id':_0x3406d5['params']['id']}})[_0x0e10('0x22')](handleEntityNotFound(_0x4f6b5d,null))[_0x0e10('0x22')](saveUpdates(_0x3406d5[_0x0e10('0x42')],null))[_0x0e10('0x22')](respondWithResult(_0x4f6b5d,null))['catch'](handleError(_0x4f6b5d,null));};exports[_0x0e10('0x23')]=function(_0x1a9978,_0x1e7fbf){return db[_0x0e10('0x39')][_0x0e10('0x3f')]({'where':{'id':_0x1a9978[_0x0e10('0x3d')]['id']}})[_0x0e10('0x22')](handleEntityNotFound(_0x1e7fbf,null))[_0x0e10('0x22')](removeEntity(_0x1e7fbf,null))[_0x0e10('0x40')](handleError(_0x1e7fbf,null));};exports[_0x0e10('0x43')]=function(_0x682a6,_0x44637f,_0x2a8a56){var _0x36142a={};var _0x96c3dc={};var _0x2246d5;var _0xd16e1d;return db[_0x0e10('0x39')][_0x0e10('0x44')]({'where':{'id':_0x682a6[_0x0e10('0x3d')]['id']}})['then'](handleEntityNotFound(_0x44637f,null))[_0x0e10('0x22')](function(_0x49310a){if(_0x49310a){_0x2246d5=_0x49310a;_0x96c3dc[_0x0e10('0x2f')]=_['keys'](db['VtigerConfiguration'][_0x0e10('0x29')]);_0x96c3dc['query']=_[_0x0e10('0x2d')](_0x682a6[_0x0e10('0x2c')]);_0x96c3dc['filters']=_['intersection'](_0x96c3dc[_0x0e10('0x2f')],_0x96c3dc['query']);_0x36142a[_0x0e10('0x30')]=_[_0x0e10('0x2e')](_0x96c3dc[_0x0e10('0x2f')],qs[_0x0e10('0x31')](_0x682a6['query'][_0x0e10('0x31')]));_0x36142a[_0x0e10('0x30')]=_0x36142a[_0x0e10('0x30')][_0x0e10('0x32')]?_0x36142a[_0x0e10('0x30')]:_0x96c3dc['model'];_0x36142a['order']=qs['sort'](_0x682a6['query']['sort']);_0x36142a[_0x0e10('0x34')]=qs['filters'](_[_0x0e10('0x45')](_0x682a6[_0x0e10('0x2c')],_0x96c3dc[_0x0e10('0x35')]));if(_0x682a6[_0x0e10('0x2c')]['filter']){_0x36142a['where']=_[_0x0e10('0x3e')](_0x36142a[_0x0e10('0x34')],{'$or':_[_0x0e10('0x28')](_0x36142a[_0x0e10('0x30')],function(_0x376b45){var _0x48db38={};_0x48db38[_0x376b45]={'$like':'%'+_0x682a6[_0x0e10('0x2c')][_0x0e10('0x36')]+'%'};return _0x48db38;})});}_0x36142a=_[_0x0e10('0x3e')]({},_0x36142a,_0x682a6[_0x0e10('0x38')]);return _0x2246d5['getConfigurations'](_0x36142a);}})[_0x0e10('0x22')](function(_0x2ea969){if(_0x2ea969){_0xd16e1d=_0x2ea969['length'];if(!_0x682a6[_0x0e10('0x2c')][_0x0e10('0x46')](_0x0e10('0x47'))){_0x36142a['limit']=qs['limit'](_0x682a6[_0x0e10('0x2c')]['limit']);_0x36142a[_0x0e10('0x1b')]=qs['offset'](_0x682a6[_0x0e10('0x2c')][_0x0e10('0x1b')]);}return _0x2246d5['getConfigurations'](_0x36142a);}})[_0x0e10('0x22')](function(_0x2b60dc){if(_0x2b60dc){return _0x2b60dc?{'count':_0xd16e1d,'rows':_0x2b60dc}:null;}})[_0x0e10('0x22')](respondWithResult(_0x44637f,null))[_0x0e10('0x40')](handleError(_0x44637f,null));};exports['addConfiguration']=function(_0x37c985,_0x1dbc36,_0x3dcb42){if(_0x37c985[_0x0e10('0x42')]['id']){delete _0x37c985[_0x0e10('0x42')]['id'];}return db[_0x0e10('0x39')][_0x0e10('0x44')]({'where':{'id':_0x37c985[_0x0e10('0x3d')]['id']}})[_0x0e10('0x22')](handleEntityNotFound(_0x1dbc36,null))[_0x0e10('0x22')](function(_0x43bcb1){if(_0x43bcb1){_0x37c985[_0x0e10('0x42')][_0x0e10('0x48')]=_0x43bcb1['id'];_0x37c985[_0x0e10('0x42')][_0x0e10('0x49')]=integrations['getSubjects'](_0x37c985[_0x0e10('0x42')][_0x0e10('0x4a')],_0x37c985[_0x0e10('0x42')][_0x0e10('0x2b')]);_0x37c985['body'][_0x0e10('0x4b')]=integrations['getDescriptions'](_0x37c985[_0x0e10('0x42')][_0x0e10('0x4a')],_0x37c985['body'][_0x0e10('0x2b')]);return db['VtigerConfiguration']['create'](_0x37c985[_0x0e10('0x42')],{'include':[{'model':db[_0x0e10('0x4c')],'as':_0x0e10('0x49')},{'model':db[_0x0e10('0x4c')],'as':_0x0e10('0x4b')}]});}return null;})['then'](respondWithResult(_0x1dbc36,null))[_0x0e10('0x40')](handleError(_0x1dbc36,null));};var md5=require('md5');exports[_0x0e10('0x4d')]=function(_0x3eae20,_0x4a8e6d,_0x471cec){var _0x4c71d5=null;var _0x222f86=null;var _0x3338ef=null;var _0x57bfbb=null;var _0x2c69b0='';return db[_0x0e10('0x39')][_0x0e10('0x44')]({'where':{'id':_0x3eae20[_0x0e10('0x3d')]['id']},'attributes':['id',_0x0e10('0x25'),'username','description','moduleName','remoteUri',_0x0e10('0x4e'),_0x0e10('0x4f')]})['then'](handleEntityNotFound(_0x4a8e6d,null))[_0x0e10('0x22')](function(_0x3ce94e){if(_0x3ce94e){_0x4c71d5=_0x3ce94e[_0x0e10('0x50')];_0x222f86=_0x3ce94e[_0x0e10('0x4f')];_0x3338ef=_0x3ce94e['moduleName'];_0x2c69b0=_0x3ce94e[_0x0e10('0x51')];var _0x5653f3=_0x2c69b0['slice'](-0x1);if(_0x5653f3==='/'){_0x2c69b0=_0x2c69b0['substring'](0x0,_0x2c69b0[_0x0e10('0x52')](_0x5653f3));}_0x57bfbb=util[_0x0e10('0x53')](_0x0e10('0x54'),_0x2c69b0);var _0x41a893={'method':_0x0e10('0x55'),'uri':_0x57bfbb,'qs':{'operation':_0x0e10('0x56'),'username':_0x3ce94e['username']},'json':!![]};return rp(_0x41a893);}})[_0x0e10('0x22')](function(_0x194867){if(_0x194867['success']){var _0x23aac3={'method':_0x0e10('0x57'),'uri':_0x57bfbb,'form':{'operation':_0x0e10('0x58'),'username':_0x4c71d5,'accessKey':md5(_0x194867[_0x0e10('0x59')][_0x0e10('0x5a')]+_0x222f86)},'json':!![]};return rp(_0x23aac3);}})[_0x0e10('0x22')](function(_0x1f0abb){if(_0x1f0abb['success']){var _0x5676ee={'method':_0x0e10('0x55'),'uri':_0x57bfbb,'qs':{'operation':_0x0e10('0x5b'),'username':_0x4c71d5,'sessionName':_0x1f0abb['result'][_0x0e10('0x5c')],'elementType':_0x3338ef},'json':!![]};return rp(_0x5676ee);}})[_0x0e10('0x22')](function(_0x37f98f){if(_0x37f98f[_0x0e10('0x5d')]){var _0x139317=['autogenerated','reference',_0x0e10('0x5e')];_[_0x0e10('0x5f')](_0x37f98f['result']['fields'],function(_0x50d17f){return _0x139317[_0x0e10('0x60')](_0x50d17f[_0x0e10('0x2b')][_0x0e10('0x25')]);});_[_0x0e10('0x5f')](_0x37f98f[_0x0e10('0x59')][_0x0e10('0x31')],function(_0x3654dc){return _0x3654dc['editable']==='false';});return{'count':_0x37f98f[_0x0e10('0x59')][_0x0e10('0x31')][_0x0e10('0x32')],'rows':_[_0x0e10('0x28')](_0x37f98f[_0x0e10('0x59')][_0x0e10('0x31')],function(_0x204608){return{'id':_0x204608[_0x0e10('0x25')],'name':_0x204608[_0x0e10('0x61')],'custom':_[_0x0e10('0x62')](_0x204608[_0x0e10('0x25')],'cf_')?!![]:![],'options':_0x204608[_0x0e10('0x2b')]['name']===_0x0e10('0x63')&&_0x204608[_0x0e10('0x2b')]['picklistValues']['length']>0x0?_[_0x0e10('0x28')](_0x204608['type'][_0x0e10('0x64')],function(_0x267931){return{'name':_0x267931[_0x0e10('0x61')],'value':_0x267931[_0x0e10('0x65')]};}):[]};})};}})[_0x0e10('0x22')](respondWithResult(_0x4a8e6d,null))[_0x0e10('0x40')](function(_0x496875){console['log'](_0x0e10('0x66')+_0x496875);var _0x580f9b=_0x3eae20['query']['test']?0x1f4:_0x496875['statusCode']||0x1f4;logger[_0x0e10('0x24')](_0x0e10('0x67'),'getFields',_0x580f9b,JSON[_0x0e10('0x68')](_0x496875));delete _0x496875[_0x0e10('0x25')];if(_0x580f9b===0x191){_0x580f9b=0x190;}_0x4a8e6d['status'](_0x580f9b)['send'](_0x3eae20[_0x0e10('0x2c')][_0x0e10('0x69')]?{'message':_0x0e10('0x6a'),'statusCode':_0x496875[_0x0e10('0x6b')]}:_0x496875);});};
\ No newline at end of file
+var _0xa118=['reject','save','update','then','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','VtigerAccount','count','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','findOne','VtigerConfiguration','nolimit','getConfigurations','addConfiguration','getSubjects','Descriptions','Subjects','VtigerField','md5','getFields','description','serverUrl','accessKey','username','moduleName','remoteUri','slice','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','token','describe','sessionName','autogenerated','reference','owner','remove','result','editable','label','cf_','picklist','picklistValues','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','apply'];(function(_0x398104,_0x1a4dc7){var _0x540851=function(_0x24051){while(--_0x24051){_0x398104['push'](_0x398104['shift']());}};_0x540851(++_0x1a4dc7);}(_0xa118,0x146));var _0x8a11=function(_0x375c5a,_0x3b2bdd){_0x375c5a=_0x375c5a-0x0;var _0xf8b9b2=_0xa118[_0x375c5a];return _0xf8b9b2;};'use strict';var emlformat=require(_0x8a11('0x0'));var rimraf=require(_0x8a11('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a11('0x2'));var rp=require(_0x8a11('0x3'));var moment=require(_0x8a11('0x4'));var BPromise=require(_0x8a11('0x5'));var Mustache=require(_0x8a11('0x6'));var util=require(_0x8a11('0x7'));var path=require('path');var sox=require(_0x8a11('0x8'));var csv=require('to-csv');var ejs=require(_0x8a11('0x9'));var fs=require('fs');var fs_extra=require(_0x8a11('0xa'));var _=require(_0x8a11('0xb'));var squel=require(_0x8a11('0xc'));var crypto=require(_0x8a11('0xd'));var jsforce=require(_0x8a11('0xe'));var deskjs=require(_0x8a11('0xf'));var toCsv=require(_0x8a11('0x10'));var querystring=require('querystring');var Papa=require(_0x8a11('0x11'));var Redis=require(_0x8a11('0x12'));var authService=require(_0x8a11('0x13'));var qs=require(_0x8a11('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a11('0x15'));var logger=require(_0x8a11('0x16'))('api');var utils=require(_0x8a11('0x17'));var config=require(_0x8a11('0x18'));var licenseUtil=require(_0x8a11('0x19'));var db=require(_0x8a11('0x1a'))['db'];var integrations=require(_0x8a11('0x1b'));function respondWithStatusCode(_0x106e7a,_0x519f5e){_0x519f5e=_0x519f5e||0xcc;return function(_0x560930){if(_0x560930){return _0x106e7a[_0x8a11('0x1c')](_0x519f5e);}return _0x106e7a[_0x8a11('0x1d')](_0x519f5e)[_0x8a11('0x1e')]();};}function respondWithResult(_0x3c57e0,_0x55b46c){_0x55b46c=_0x55b46c||0xc8;return function(_0x10c1d3){if(_0x10c1d3){return _0x3c57e0[_0x8a11('0x1d')](_0x55b46c)[_0x8a11('0x1f')](_0x10c1d3);}};}function respondWithFilteredResult(_0x5d070f,_0x718a21){return function(_0xa03ebe){if(_0xa03ebe){var _0x21db90=typeof _0x718a21[_0x8a11('0x20')]===_0x8a11('0x21')&&typeof _0x718a21[_0x8a11('0x22')]===_0x8a11('0x21');var _0x1db4a9=_0xa03ebe['count'];var _0x488830=_0x21db90?0x0:_0x718a21[_0x8a11('0x20')];var _0x4d7493=_0x21db90?_0xa03ebe['count']:_0x718a21[_0x8a11('0x20')]+_0x718a21[_0x8a11('0x22')];var _0x169d2e;if(_0x4d7493>=_0x1db4a9){_0x4d7493=_0x1db4a9;_0x169d2e=0xc8;}else{_0x169d2e=0xce;}_0x5d070f[_0x8a11('0x1d')](_0x169d2e);return _0x5d070f[_0x8a11('0x23')]('Content-Range',_0x488830+'-'+_0x4d7493+'/'+_0x1db4a9)[_0x8a11('0x1f')](_0xa03ebe);}return null;};}function patchUpdates(_0x24be74){return function(_0x57337a){try{jsonpatch[_0x8a11('0x24')](_0x57337a,_0x24be74,!![]);}catch(_0x5372ee){return BPromise[_0x8a11('0x25')](_0x5372ee);}return _0x57337a[_0x8a11('0x26')]();};}function saveUpdates(_0x3ba9cc,_0x2b19ea){return function(_0x2d42c8){if(_0x2d42c8){return _0x2d42c8[_0x8a11('0x27')](_0x3ba9cc)['then'](function(_0x550428){return _0x550428;});}return null;};}function removeEntity(_0x2a2f11,_0x4372eb){return function(_0x389923){if(_0x389923){return _0x389923['destroy']()[_0x8a11('0x28')](function(){_0x2a2f11[_0x8a11('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ba731,_0x44cbc6){return function(_0x3ac3b3){if(!_0x3ac3b3){_0x4ba731['sendStatus'](0x194);}return _0x3ac3b3;};}function handleError(_0x43bf9f,_0x5ec3fc){_0x5ec3fc=_0x5ec3fc||0x1f4;return function(_0x3d526f){logger[_0x8a11('0x29')](_0x3d526f[_0x8a11('0x2a')]);if(_0x3d526f['name']){delete _0x3d526f[_0x8a11('0x2b')];}_0x43bf9f[_0x8a11('0x1d')](_0x5ec3fc)[_0x8a11('0x2c')](_0x3d526f);};}exports['index']=function(_0x305a29,_0x3bdb1e){var _0x58eadf={},_0x38e9c0={},_0x281dd4={'count':0x0,'rows':[]};var _0x398115=_[_0x8a11('0x2d')](db['VtigerAccount'][_0x8a11('0x2e')],function(_0x26b5cb){return{'name':_0x26b5cb['fieldName'],'type':_0x26b5cb[_0x8a11('0x2f')][_0x8a11('0x30')]};});_0x38e9c0[_0x8a11('0x31')]=_[_0x8a11('0x2d')](_0x398115,_0x8a11('0x2b'));_0x38e9c0[_0x8a11('0x32')]=_[_0x8a11('0x33')](_0x305a29['query']);_0x38e9c0['filters']=_['intersection'](_0x38e9c0[_0x8a11('0x31')],_0x38e9c0['query']);_0x58eadf[_0x8a11('0x34')]=_['intersection'](_0x38e9c0['model'],qs['fields'](_0x305a29[_0x8a11('0x32')][_0x8a11('0x35')]));_0x58eadf[_0x8a11('0x34')]=_0x58eadf[_0x8a11('0x34')][_0x8a11('0x36')]?_0x58eadf[_0x8a11('0x34')]:_0x38e9c0['model'];if(!_0x305a29['query'][_0x8a11('0x37')]('nolimit')){_0x58eadf[_0x8a11('0x22')]=qs[_0x8a11('0x22')](_0x305a29['query'][_0x8a11('0x22')]);_0x58eadf[_0x8a11('0x20')]=qs[_0x8a11('0x20')](_0x305a29[_0x8a11('0x32')][_0x8a11('0x20')]);}_0x58eadf[_0x8a11('0x38')]=qs[_0x8a11('0x39')](_0x305a29[_0x8a11('0x32')][_0x8a11('0x39')]);_0x58eadf[_0x8a11('0x3a')]=qs[_0x8a11('0x3b')](_[_0x8a11('0x3c')](_0x305a29[_0x8a11('0x32')],_0x38e9c0[_0x8a11('0x3b')]),_0x398115);if(_0x305a29[_0x8a11('0x32')]['filter']){_0x58eadf[_0x8a11('0x3a')]=_[_0x8a11('0x3d')](_0x58eadf[_0x8a11('0x3a')],{'$or':_[_0x8a11('0x2d')](_0x398115,function(_0x11e0a8){if(_0x11e0a8[_0x8a11('0x2f')]!==_0x8a11('0x3e')){var _0x4e235c={};_0x4e235c[_0x11e0a8[_0x8a11('0x2b')]]={'$like':'%'+_0x305a29['query'][_0x8a11('0x3f')]+'%'};return _0x4e235c;}})});}_0x58eadf=_[_0x8a11('0x3d')]({},_0x58eadf,_0x305a29[_0x8a11('0x40')]);var _0x1f0d1f={'where':_0x58eadf[_0x8a11('0x3a')]};return db[_0x8a11('0x41')][_0x8a11('0x42')](_0x1f0d1f)[_0x8a11('0x28')](function(_0x1c25a3){_0x281dd4['count']=_0x1c25a3;if(_0x305a29[_0x8a11('0x32')][_0x8a11('0x43')]){_0x58eadf[_0x8a11('0x44')]=[{'all':!![]}];}return db[_0x8a11('0x41')][_0x8a11('0x45')](_0x58eadf);})['then'](function(_0x2d1512){_0x281dd4[_0x8a11('0x46')]=_0x2d1512;return _0x281dd4;})[_0x8a11('0x28')](respondWithFilteredResult(_0x3bdb1e,_0x58eadf))[_0x8a11('0x47')](handleError(_0x3bdb1e,null));};exports[_0x8a11('0x48')]=function(_0x52f9de,_0x223bbe){var _0x36f4ad={'raw':![],'where':{'id':_0x52f9de[_0x8a11('0x49')]['id']}},_0x5305da={};_0x5305da['model']=_['keys'](db['VtigerAccount'][_0x8a11('0x2e')]);_0x5305da['query']=_[_0x8a11('0x33')](_0x52f9de['query']);_0x5305da[_0x8a11('0x3b')]=_[_0x8a11('0x4a')](_0x5305da[_0x8a11('0x31')],_0x5305da['query']);_0x36f4ad[_0x8a11('0x34')]=_[_0x8a11('0x4a')](_0x5305da['model'],qs[_0x8a11('0x35')](_0x52f9de[_0x8a11('0x32')][_0x8a11('0x35')]));_0x36f4ad[_0x8a11('0x34')]=_0x36f4ad[_0x8a11('0x34')][_0x8a11('0x36')]?_0x36f4ad[_0x8a11('0x34')]:_0x5305da['model'];if(_0x52f9de[_0x8a11('0x32')][_0x8a11('0x43')]){_0x36f4ad[_0x8a11('0x44')]=[{'all':!![]}];}_0x36f4ad=_[_0x8a11('0x3d')]({},_0x36f4ad,_0x52f9de[_0x8a11('0x40')]);return db[_0x8a11('0x41')][_0x8a11('0x4b')](_0x36f4ad)[_0x8a11('0x28')](handleEntityNotFound(_0x223bbe,null))[_0x8a11('0x28')](respondWithResult(_0x223bbe,null))[_0x8a11('0x47')](handleError(_0x223bbe,null));};exports[_0x8a11('0x4c')]=function(_0x26cf7a,_0x5b4df4){return db[_0x8a11('0x41')][_0x8a11('0x4c')](_0x26cf7a[_0x8a11('0x4d')],{})[_0x8a11('0x28')](respondWithResult(_0x5b4df4,0xc9))[_0x8a11('0x47')](handleError(_0x5b4df4,null));};exports[_0x8a11('0x27')]=function(_0x36f819,_0x3fa68a){if(_0x36f819[_0x8a11('0x4d')]['id']){delete _0x36f819[_0x8a11('0x4d')]['id'];}return db[_0x8a11('0x41')][_0x8a11('0x4b')]({'where':{'id':_0x36f819[_0x8a11('0x49')]['id']}})[_0x8a11('0x28')](handleEntityNotFound(_0x3fa68a,null))[_0x8a11('0x28')](saveUpdates(_0x36f819[_0x8a11('0x4d')],null))[_0x8a11('0x28')](respondWithResult(_0x3fa68a,null))[_0x8a11('0x47')](handleError(_0x3fa68a,null));};exports['destroy']=function(_0x4b6662,_0x4c10ca){return db[_0x8a11('0x41')]['find']({'where':{'id':_0x4b6662[_0x8a11('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c10ca,null))[_0x8a11('0x28')](removeEntity(_0x4c10ca,null))[_0x8a11('0x47')](handleError(_0x4c10ca,null));};exports['getConfigurations']=function(_0x5a0c82,_0x905635,_0x2f9a5a){var _0xffa21b={};var _0x558bb3={};var _0x101163;var _0x239dab;return db[_0x8a11('0x41')][_0x8a11('0x4e')]({'where':{'id':_0x5a0c82[_0x8a11('0x49')]['id']}})[_0x8a11('0x28')](handleEntityNotFound(_0x905635,null))[_0x8a11('0x28')](function(_0x5c0146){if(_0x5c0146){_0x101163=_0x5c0146;_0x558bb3[_0x8a11('0x31')]=_['keys'](db[_0x8a11('0x4f')]['rawAttributes']);_0x558bb3[_0x8a11('0x32')]=_[_0x8a11('0x33')](_0x5a0c82[_0x8a11('0x32')]);_0x558bb3[_0x8a11('0x3b')]=_['intersection'](_0x558bb3[_0x8a11('0x31')],_0x558bb3['query']);_0xffa21b[_0x8a11('0x34')]=_[_0x8a11('0x4a')](_0x558bb3[_0x8a11('0x31')],qs[_0x8a11('0x35')](_0x5a0c82['query'][_0x8a11('0x35')]));_0xffa21b['attributes']=_0xffa21b[_0x8a11('0x34')][_0x8a11('0x36')]?_0xffa21b['attributes']:_0x558bb3[_0x8a11('0x31')];_0xffa21b[_0x8a11('0x38')]=qs[_0x8a11('0x39')](_0x5a0c82['query'][_0x8a11('0x39')]);_0xffa21b[_0x8a11('0x3a')]=qs[_0x8a11('0x3b')](_[_0x8a11('0x3c')](_0x5a0c82[_0x8a11('0x32')],_0x558bb3[_0x8a11('0x3b')]));if(_0x5a0c82['query'][_0x8a11('0x3f')]){_0xffa21b[_0x8a11('0x3a')]=_[_0x8a11('0x3d')](_0xffa21b[_0x8a11('0x3a')],{'$or':_[_0x8a11('0x2d')](_0xffa21b[_0x8a11('0x34')],function(_0x45b75d){var _0x17247a={};_0x17247a[_0x45b75d]={'$like':'%'+_0x5a0c82['query']['filter']+'%'};return _0x17247a;})});}_0xffa21b=_['merge']({},_0xffa21b,_0x5a0c82[_0x8a11('0x40')]);return _0x101163['getConfigurations'](_0xffa21b);}})[_0x8a11('0x28')](function(_0xf0b6cf){if(_0xf0b6cf){_0x239dab=_0xf0b6cf[_0x8a11('0x36')];if(!_0x5a0c82[_0x8a11('0x32')][_0x8a11('0x37')](_0x8a11('0x50'))){_0xffa21b['limit']=qs[_0x8a11('0x22')](_0x5a0c82['query'][_0x8a11('0x22')]);_0xffa21b[_0x8a11('0x20')]=qs[_0x8a11('0x20')](_0x5a0c82[_0x8a11('0x32')][_0x8a11('0x20')]);}return _0x101163[_0x8a11('0x51')](_0xffa21b);}})['then'](function(_0x4aaecd){if(_0x4aaecd){return _0x4aaecd?{'count':_0x239dab,'rows':_0x4aaecd}:null;}})[_0x8a11('0x28')](respondWithResult(_0x905635,null))[_0x8a11('0x47')](handleError(_0x905635,null));};exports[_0x8a11('0x52')]=function(_0x51e9a4,_0x4ac0dc,_0x5950ee){if(_0x51e9a4['body']['id']){delete _0x51e9a4[_0x8a11('0x4d')]['id'];}return db['VtigerAccount'][_0x8a11('0x4e')]({'where':{'id':_0x51e9a4['params']['id']}})[_0x8a11('0x28')](handleEntityNotFound(_0x4ac0dc,null))[_0x8a11('0x28')](function(_0x350fae){if(_0x350fae){_0x51e9a4[_0x8a11('0x4d')]['AccountId']=_0x350fae['id'];_0x51e9a4['body']['Subjects']=integrations[_0x8a11('0x53')](_0x51e9a4['body']['channel'],_0x51e9a4['body']['type']);_0x51e9a4[_0x8a11('0x4d')][_0x8a11('0x54')]=integrations['getDescriptions'](_0x51e9a4[_0x8a11('0x4d')]['channel'],_0x51e9a4[_0x8a11('0x4d')]['type']);return db['VtigerConfiguration'][_0x8a11('0x4c')](_0x51e9a4[_0x8a11('0x4d')],{'include':[{'model':db['VtigerField'],'as':_0x8a11('0x55')},{'model':db[_0x8a11('0x56')],'as':_0x8a11('0x54')}]});}return null;})[_0x8a11('0x28')](respondWithResult(_0x4ac0dc,null))[_0x8a11('0x47')](handleError(_0x4ac0dc,null));};var md5=require(_0x8a11('0x57'));exports[_0x8a11('0x58')]=function(_0x3610dd,_0x5bac5e,_0x1decf7){var _0x1c9a82=null;var _0x2dc419=null;var _0x58e4c1=null;var _0x1cc36f=null;var _0x53c7d8='';return db[_0x8a11('0x41')][_0x8a11('0x4e')]({'where':{'id':_0x3610dd['params']['id']},'attributes':['id',_0x8a11('0x2b'),'username',_0x8a11('0x59'),'moduleName','remoteUri',_0x8a11('0x5a'),_0x8a11('0x5b')]})[_0x8a11('0x28')](handleEntityNotFound(_0x5bac5e,null))[_0x8a11('0x28')](function(_0xefd319){if(_0xefd319){_0x1c9a82=_0xefd319[_0x8a11('0x5c')];_0x2dc419=_0xefd319[_0x8a11('0x5b')];_0x58e4c1=_0xefd319[_0x8a11('0x5d')];_0x53c7d8=_0xefd319[_0x8a11('0x5e')];var _0x1caf14=_0x53c7d8[_0x8a11('0x5f')](-0x1);if(_0x1caf14==='/'){_0x53c7d8=_0x53c7d8['substring'](0x0,_0x53c7d8[_0x8a11('0x60')](_0x1caf14));}_0x1cc36f=util[_0x8a11('0x61')](_0x8a11('0x62'),_0x53c7d8);var _0x5d98ff={'method':_0x8a11('0x63'),'uri':_0x1cc36f,'qs':{'operation':'getchallenge','username':_0xefd319[_0x8a11('0x5c')]},'json':!![]};return rp(_0x5d98ff);}})[_0x8a11('0x28')](function(_0x4f650a){if(_0x4f650a[_0x8a11('0x64')]){var _0x444193={'method':_0x8a11('0x65'),'uri':_0x1cc36f,'form':{'operation':_0x8a11('0x66'),'username':_0x1c9a82,'accessKey':md5(_0x4f650a['result'][_0x8a11('0x67')]+_0x2dc419)},'json':!![]};return rp(_0x444193);}})[_0x8a11('0x28')](function(_0x1630bf){if(_0x1630bf[_0x8a11('0x64')]){var _0xf74fe2={'method':_0x8a11('0x63'),'uri':_0x1cc36f,'qs':{'operation':_0x8a11('0x68'),'username':_0x1c9a82,'sessionName':_0x1630bf['result'][_0x8a11('0x69')],'elementType':_0x58e4c1},'json':!![]};return rp(_0xf74fe2);}})[_0x8a11('0x28')](function(_0x147f4f){if(_0x147f4f['success']){var _0x46e23e=[_0x8a11('0x6a'),_0x8a11('0x6b'),_0x8a11('0x6c')];_[_0x8a11('0x6d')](_0x147f4f[_0x8a11('0x6e')]['fields'],function(_0x26fc6f){return _0x46e23e['includes'](_0x26fc6f['type'][_0x8a11('0x2b')]);});_[_0x8a11('0x6d')](_0x147f4f[_0x8a11('0x6e')][_0x8a11('0x35')],function(_0x3cd07a){return _0x3cd07a[_0x8a11('0x6f')]==='false';});return{'count':_0x147f4f[_0x8a11('0x6e')][_0x8a11('0x35')][_0x8a11('0x36')],'rows':_[_0x8a11('0x2d')](_0x147f4f['result']['fields'],function(_0x311a79){return{'id':_0x311a79[_0x8a11('0x2b')],'name':_0x311a79[_0x8a11('0x70')],'custom':_['startsWith'](_0x311a79['name'],_0x8a11('0x71'))?!![]:![],'options':_0x311a79['type']['name']===_0x8a11('0x72')&&_0x311a79[_0x8a11('0x2f')][_0x8a11('0x73')]['length']>0x0?_[_0x8a11('0x2d')](_0x311a79[_0x8a11('0x2f')][_0x8a11('0x73')],function(_0x12d2b8){return{'name':_0x12d2b8[_0x8a11('0x70')],'value':_0x12d2b8['value']};}):[]};})};}})[_0x8a11('0x28')](respondWithResult(_0x5bac5e,null))[_0x8a11('0x47')](function(_0x2888fb){console[_0x8a11('0x74')]('vTiger\x20error:\x20'+_0x2888fb);var _0x319710=_0x3610dd['query']['test']?0x1f4:_0x2888fb[_0x8a11('0x75')]||0x1f4;logger[_0x8a11('0x29')](_0x8a11('0x76'),_0x8a11('0x58'),_0x319710,JSON['stringify'](_0x2888fb));delete _0x2888fb['name'];if(_0x319710===0x191){_0x319710=0x190;}_0x5bac5e['status'](_0x319710)[_0x8a11('0x2c')](_0x3610dd['query'][_0x8a11('0x77')]?{'message':_0x8a11('0x78'),'statusCode':_0x2888fb['statusCode']}:_0x2888fb);});};
\ No newline at end of file
index 6833e58..2309be3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a69=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x58d340,_0x4f54e7){var _0x449fc2=function(_0x232afc){while(--_0x232afc){_0x58d340['push'](_0x58d340['shift']());}};_0x449fc2(++_0x4f54e7);}(_0x2a69,0x118));var _0x92a6=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2a69[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x92a6('0x0'));var util=require('util');var logger=require(_0x92a6('0x1'))(_0x92a6('0x2'));var moment=require(_0x92a6('0x3'));var BPromise=require(_0x92a6('0x4'));var rp=require(_0x92a6('0x5'));var fs=require('fs');var path=require(_0x92a6('0x6'));var rimraf=require(_0x92a6('0x7'));var config=require(_0x92a6('0x8'));var attributes=require(_0x92a6('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x92a6('0xa')]=function(_0x1f268a,_0x3446fe){return _0x1f268a[_0x92a6('0xb')](_0x92a6('0xc'),attributes,{'tableName':_0x92a6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa81=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x6f069b,_0x5ed83e){var _0x32a3bc=function(_0x44449c){while(--_0x44449c){_0x6f069b['push'](_0x6f069b['shift']());}};_0x32a3bc(++_0x5ed83e);}(_0xfa81,0x1d6));var _0x1fa8=function(_0x9b81b1,_0x2583c6){_0x9b81b1=_0x9b81b1-0x0;var _0x2ba1fe=_0xfa81[_0x9b81b1];return _0x2ba1fe;};'use strict';var _=require(_0x1fa8('0x0'));var util=require(_0x1fa8('0x1'));var logger=require(_0x1fa8('0x2'))('api');var moment=require(_0x1fa8('0x3'));var BPromise=require(_0x1fa8('0x4'));var rp=require(_0x1fa8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fa8('0x6'));var config=require(_0x1fa8('0x7'));var attributes=require(_0x1fa8('0x8'));var integrations=require(_0x1fa8('0x9'));module[_0x1fa8('0xa')]=function(_0x384358,_0x309806){return _0x384358[_0x1fa8('0xb')](_0x1fa8('0xc'),attributes,{'tableName':_0x1fa8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6d4d669..6844f47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xe6e539,_0xa2b4f2){var _0x19deac=function(_0x2d565d){while(--_0x2d565d){_0xe6e539['push'](_0xe6e539['shift']());}};_0x19deac(++_0xa2b4f2);}(_0x153f,0x15b));var _0xf153=function(_0xb5306,_0x346e67){_0xb5306=_0xb5306-0x0;var _0x476a97=_0x153f[_0xb5306];return _0x476a97;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});}exports[_0xf153('0x17')]=function(_0x138dbe){var _0x44272e=this;return new Promise(function(_0x4e790d,_0x357d57){return db[_0xf153('0x18')][_0xf153('0x19')]({'raw':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1c')]||null:null,'attributes':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1d')]||null:null,'limit':_0x138dbe['options']?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1e')]||null:null,'include':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')]?_[_0xf153('0x20')](_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')],function(_0xf67cde){return{'model':db[_0xf67cde[_0xf153('0x21')]],'as':_0xf67cde['as'],'attributes':_0xf67cde[_0xf153('0x1d')],'include':_0xf67cde[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xf67cde[_0xf153('0x1f')],function(_0xe490f8){return{'model':db[_0xe490f8[_0xf153('0x21')]],'as':_0xe490f8['as'],'attributes':_0xe490f8[_0xf153('0x1d')],'include':_0xe490f8[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xe490f8[_0xf153('0x1f')],function(_0x48ebdc){return{'model':db[_0x48ebdc[_0xf153('0x21')]],'as':_0x48ebdc['as'],'attributes':_0x48ebdc[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16cdcd){logger[_0xf153('0xe')]('GetVtigerAccount',_0x138dbe);logger[_0xf153('0x11')](_0xf153('0x17'),_0x138dbe,JSON[_0xf153('0x12')](_0x16cdcd));_0x4e790d(_0x16cdcd);})[_0xf153('0x22')](function(_0x339e96){logger[_0xf153('0x13')](_0xf153('0x17'),_0x339e96[_0xf153('0x15')],_0x138dbe);_0x357d57(_0x44272e[_0xf153('0x13')](0x1f4,_0x339e96[_0xf153('0x15')]));});});};exports[_0xf153('0x23')]=function(_0x415a5f){var _0x5b5237=this;return new Promise(function(_0x258fb0,_0xbb3619){return db[_0xf153('0x18')][_0xf153('0x24')]({'raw':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1c')]||null:null,'attributes':_0x415a5f['options']?_0x415a5f[_0xf153('0x1a')]['attributes']||null:null,'include':_0x415a5f[_0xf153('0x1a')]?_0x415a5f[_0xf153('0x1a')]['include']?_[_0xf153('0x20')](_0x415a5f[_0xf153('0x1a')][_0xf153('0x1f')],function(_0x40be52){return{'model':db[_0x40be52[_0xf153('0x21')]],'as':_0x40be52['as'],'attributes':_0x40be52[_0xf153('0x1d')],'include':_0x40be52['include']?_[_0xf153('0x20')](_0x40be52['include'],function(_0x40834b){return{'model':db[_0x40834b[_0xf153('0x21')]],'as':_0x40834b['as'],'attributes':_0x40834b[_0xf153('0x1d')],'include':_0x40834b[_0xf153('0x1f')]?_[_0xf153('0x20')](_0x40834b[_0xf153('0x1f')],function(_0x4becf3){return{'model':db[_0x4becf3[_0xf153('0x21')]],'as':_0x4becf3['as'],'attributes':_0x4becf3[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf153('0xd')](function(_0x4e0634){logger[_0xf153('0xe')](_0xf153('0x23'),_0x415a5f);logger[_0xf153('0x11')](_0xf153('0x23'),_0x415a5f,JSON[_0xf153('0x12')](_0x4e0634));_0x258fb0(_0x4e0634);})[_0xf153('0x22')](function(_0x4cc481){logger[_0xf153('0x13')](_0xf153('0x23'),_0x4cc481['message'],_0x415a5f);_0xbb3619(_0x5b5237[_0xf153('0x13')](0x1f4,_0x4cc481[_0xf153('0x15')]));});});};
\ No newline at end of file
+var _0xab40=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','VtigerAccount','findAll','options','limit','include','model','map','attributes','GetVtigerAccount','ShowVtigerAccount','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19dabd,_0x74647a){var _0x25b707=function(_0x19f27d){while(--_0x19f27d){_0x19dabd['push'](_0x19dabd['shift']());}};_0x25b707(++_0x74647a);}(_0xab40,0xcd));var _0x0ab4=function(_0x368fba,_0x4b9aad){_0x368fba=_0x368fba-0x0;var _0x147829=_0xab40[_0x368fba];return _0x147829;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d92b,_0x46d16a,_0x11e99f){return new BPromise(function(_0x6d135d,_0x4cf8de){return client['request'](_0x10d92b,_0x11e99f)['then'](function(_0x24271e){logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));logger[_0x0ab4('0xb')](_0x0ab4('0xc'),_0x46d16a,_0x0ab4('0xa'),JSON[_0x0ab4('0xd')](_0x24271e));if(_0x24271e['error']){if(_0x24271e['error'][_0x0ab4('0xe')]===0x1f4){logger['error'](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x4cf8de(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}logger[_0x0ab4('0xf')](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x6d135d(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}else{logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));_0x6d135d(_0x24271e[_0x0ab4('0x11')][_0x0ab4('0x10')]);}})[_0x0ab4('0x12')](function(_0x2bdda7){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x46d16a,_0x2bdda7);_0x4cf8de(_0x2bdda7);});});}exports['GetVtigerAccount']=function(_0x17422f){var _0x30d5df=this;return new Promise(function(_0x2f50d2,_0x53723c){return db[_0x0ab4('0x13')][_0x0ab4('0x14')]({'raw':_0x17422f[_0x0ab4('0x15')]?_0x17422f[_0x0ab4('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x17422f['options']?_0x17422f[_0x0ab4('0x15')]['where']||null:null,'attributes':_0x17422f[_0x0ab4('0x15')]?_0x17422f[_0x0ab4('0x15')]['attributes']||null:null,'limit':_0x17422f[_0x0ab4('0x15')]?_0x17422f[_0x0ab4('0x15')][_0x0ab4('0x16')]||null:null,'include':_0x17422f[_0x0ab4('0x15')]?_0x17422f[_0x0ab4('0x15')]['include']?_['map'](_0x17422f[_0x0ab4('0x15')][_0x0ab4('0x17')],function(_0x392afe){return{'model':db[_0x392afe[_0x0ab4('0x18')]],'as':_0x392afe['as'],'attributes':_0x392afe['attributes'],'include':_0x392afe[_0x0ab4('0x17')]?_[_0x0ab4('0x19')](_0x392afe[_0x0ab4('0x17')],function(_0x4ea9aa){return{'model':db[_0x4ea9aa['model']],'as':_0x4ea9aa['as'],'attributes':_0x4ea9aa[_0x0ab4('0x1a')],'include':_0x4ea9aa[_0x0ab4('0x17')]?_[_0x0ab4('0x19')](_0x4ea9aa['include'],function(_0x519b23){return{'model':db[_0x519b23['model']],'as':_0x519b23['as'],'attributes':_0x519b23[_0x0ab4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bf844){logger[_0x0ab4('0x8')]('GetVtigerAccount',_0x17422f);logger['debug']('GetVtigerAccount',_0x17422f,JSON[_0x0ab4('0xd')](_0x3bf844));_0x2f50d2(_0x3bf844);})[_0x0ab4('0x12')](function(_0x1cfdad){logger[_0x0ab4('0xf')](_0x0ab4('0x1b'),_0x1cfdad['message'],_0x17422f);_0x53723c(_0x30d5df['error'](0x1f4,_0x1cfdad['message']));});});};exports[_0x0ab4('0x1c')]=function(_0x2b66d5){var _0x155d96=this;return new Promise(function(_0x182bbe,_0x46eda7){return db['VtigerAccount']['find']({'raw':_0x2b66d5[_0x0ab4('0x15')]?_0x2b66d5[_0x0ab4('0x15')][_0x0ab4('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b66d5['options']?_0x2b66d5['options'][_0x0ab4('0x1e')]||null:null,'attributes':_0x2b66d5['options']?_0x2b66d5[_0x0ab4('0x15')][_0x0ab4('0x1a')]||null:null,'include':_0x2b66d5[_0x0ab4('0x15')]?_0x2b66d5[_0x0ab4('0x15')][_0x0ab4('0x17')]?_[_0x0ab4('0x19')](_0x2b66d5['options'][_0x0ab4('0x17')],function(_0x4696fc){return{'model':db[_0x4696fc[_0x0ab4('0x18')]],'as':_0x4696fc['as'],'attributes':_0x4696fc[_0x0ab4('0x1a')],'include':_0x4696fc['include']?_['map'](_0x4696fc[_0x0ab4('0x17')],function(_0x3e65a1){return{'model':db[_0x3e65a1[_0x0ab4('0x18')]],'as':_0x3e65a1['as'],'attributes':_0x3e65a1['attributes'],'include':_0x3e65a1['include']?_['map'](_0x3e65a1[_0x0ab4('0x17')],function(_0x35eab3){return{'model':db[_0x35eab3[_0x0ab4('0x18')]],'as':_0x35eab3['as'],'attributes':_0x35eab3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x492943){logger[_0x0ab4('0x8')](_0x0ab4('0x1c'),_0x2b66d5);logger[_0x0ab4('0xb')](_0x0ab4('0x1c'),_0x2b66d5,JSON[_0x0ab4('0xd')](_0x492943));_0x182bbe(_0x492943);})[_0x0ab4('0x12')](function(_0x52d9bf){logger[_0x0ab4('0xf')](_0x0ab4('0x1c'),_0x52d9bf[_0x0ab4('0x10')],_0x2b66d5);_0x46eda7(_0x155d96['error'](0x1f4,_0x52d9bf[_0x0ab4('0x10')]));});});};
\ No newline at end of file
index 31ea7b5..ae711ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5845=['/:id/descriptions','getDescriptions','post','put','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects'];(function(_0x2052a2,_0x35c6fe){var _0x23c807=function(_0x35f7cb){while(--_0x35f7cb){_0x2052a2['push'](_0x2052a2['shift']());}};_0x23c807(++_0x35c6fe);}(_0x5845,0xa5));var _0x5584=function(_0x264961,_0x1ee881){_0x264961=_0x264961-0x0;var _0x329286=_0x5845[_0x264961];return _0x329286;};'use strict';var multer=require(_0x5584('0x0'));var util=require('util');var path=require(_0x5584('0x1'));var timeout=require(_0x5584('0x2'));var express=require(_0x5584('0x3'));var router=express[_0x5584('0x4')]();var fs_extra=require(_0x5584('0x5'));var auth=require(_0x5584('0x6'));var interaction=require(_0x5584('0x7'));var config=require('../../config/environment');var controller=require(_0x5584('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5584('0x9')](_0x5584('0xa'),auth[_0x5584('0xb')](),controller[_0x5584('0xc')]);router[_0x5584('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0x5584('0xd'),auth['isAuthenticated'](),controller[_0x5584('0xe')]);router[_0x5584('0x9')](_0x5584('0xf'),auth[_0x5584('0xb')](),controller[_0x5584('0x10')]);router[_0x5584('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5584('0x12')](_0x5584('0xa'),auth[_0x5584('0xb')](),controller['update']);router[_0x5584('0x13')]('/:id',auth[_0x5584('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfddb=['/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','index','get','isAuthenticated','show','getFields'];(function(_0x34360e,_0x1009d6){var _0x4c19c7=function(_0x2755bd){while(--_0x2755bd){_0x34360e['push'](_0x34360e['shift']());}};_0x4c19c7(++_0x1009d6);}(_0xfddb,0x1cc));var _0xbfdd=function(_0x3bb013,_0x19dbb8){_0x3bb013=_0x3bb013-0x0;var _0x34ea16=_0xfddb[_0x3bb013];return _0x34ea16;};'use strict';var multer=require(_0xbfdd('0x0'));var util=require(_0xbfdd('0x1'));var path=require(_0xbfdd('0x2'));var timeout=require(_0xbfdd('0x3'));var express=require(_0xbfdd('0x4'));var router=express[_0xbfdd('0x5')]();var fs_extra=require(_0xbfdd('0x6'));var auth=require(_0xbfdd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbfdd('0x8'));var controller=require(_0xbfdd('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xbfdd('0xa')]);router[_0xbfdd('0xb')]('/:id',auth[_0xbfdd('0xc')](),controller[_0xbfdd('0xd')]);router[_0xbfdd('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbfdd('0xe')]);router[_0xbfdd('0xb')](_0xbfdd('0xf'),auth[_0xbfdd('0xc')](),controller[_0xbfdd('0x10')]);router[_0xbfdd('0xb')]('/:id/descriptions',auth[_0xbfdd('0xc')](),controller[_0xbfdd('0x11')]);router[_0xbfdd('0x12')]('/',auth[_0xbfdd('0xc')](),controller[_0xbfdd('0x13')]);router[_0xbfdd('0x14')](_0xbfdd('0x15'),auth[_0xbfdd('0xc')](),controller['update']);router[_0xbfdd('0x16')](_0xbfdd('0x15'),auth['isAuthenticated'](),controller[_0xbfdd('0x17')]);module[_0xbfdd('0x18')]=router;
\ No newline at end of file
index b5d4a9e..74a65d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc862=['exports','STRING','sequelize'];(function(_0x4abe13,_0x32cd45){var _0x4d950b=function(_0x1199b5){while(--_0x1199b5){_0x4abe13['push'](_0x4abe13['shift']());}};_0x4d950b(++_0x32cd45);}(_0xc862,0x1d0));var _0x2c86=function(_0x3935d1,_0x7625d0){_0x3935d1=_0x3935d1-0x0;var _0x42f0f6=_0xc862[_0x3935d1];return _0x42f0f6;};'use strict';var Sequelize=require(_0x2c86('0x0'));module[_0x2c86('0x1')]={'name':{'type':Sequelize[_0x2c86('0x2')]},'description':{'type':Sequelize[_0x2c86('0x2')]}};
\ No newline at end of file
+var _0x7312=['STRING','sequelize','exports'];(function(_0x3f28a3,_0x24a190){var _0x31cd17=function(_0x1a2ff3){while(--_0x1a2ff3){_0x3f28a3['push'](_0x3f28a3['shift']());}};_0x31cd17(++_0x24a190);}(_0x7312,0x18a));var _0x2731=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x7312[_0x1f36bb];return _0xaf97fa;};'use strict';var Sequelize=require(_0x2731('0x0'));module[_0x2731('0x1')]={'name':{'type':Sequelize[_0x2731('0x2')]},'description':{'type':Sequelize[_0x2731('0x2')]}};
\ No newline at end of file
index 803da06..ef8732d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa98d=['getFields','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','options','find','create','body','update','catch','findOne','VtigerField','sort'];(function(_0x3d9e8c,_0x1771e8){var _0x1d1ed7=function(_0x1afa6f){while(--_0x1afa6f){_0x3d9e8c['push'](_0x3d9e8c['shift']());}};_0x1d1ed7(++_0x1771e8);}(_0xa98d,0xa3));var _0xda98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa98d[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xda98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda98('0x2'));var moment=require(_0xda98('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xda98('0x4'));var util=require(_0xda98('0x5'));var path=require(_0xda98('0x6'));var sox=require('sox');var csv=require(_0xda98('0x7'));var ejs=require(_0xda98('0x8'));var fs=require('fs');var fs_extra=require(_0xda98('0x9'));var _=require(_0xda98('0xa'));var squel=require(_0xda98('0xb'));var crypto=require(_0xda98('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xda98('0xd'));var toCsv=require('to-csv');var querystring=require(_0xda98('0xe'));var Papa=require(_0xda98('0xf'));var Redis=require('ioredis');var authService=require(_0xda98('0x10'));var qs=require(_0xda98('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda98('0x12'));var logger=require(_0xda98('0x13'))(_0xda98('0x14'));var utils=require('../../config/utils');var config=require(_0xda98('0x15'));var licenseUtil=require(_0xda98('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbe0f39,_0xc737b2){_0xc737b2=_0xc737b2||0xcc;return function(_0x440794){if(_0x440794){return _0xbe0f39[_0xda98('0x17')](_0xc737b2);}return _0xbe0f39[_0xda98('0x18')](_0xc737b2)[_0xda98('0x19')]();};}function respondWithResult(_0x46214d,_0x578dc9){_0x578dc9=_0x578dc9||0xc8;return function(_0x5c29f1){if(_0x5c29f1){return _0x46214d[_0xda98('0x18')](_0x578dc9)[_0xda98('0x1a')](_0x5c29f1);}};}function respondWithFilteredResult(_0x28c180,_0x5b04cb){return function(_0x44dd82){if(_0x44dd82){var _0xcc4fdb=typeof _0x5b04cb[_0xda98('0x1b')]===_0xda98('0x1c')&&typeof _0x5b04cb['limit']===_0xda98('0x1c');var _0x41cdb0=_0x44dd82[_0xda98('0x1d')];var _0x273e10=_0xcc4fdb?0x0:_0x5b04cb[_0xda98('0x1b')];var _0x51bb58=_0xcc4fdb?_0x44dd82[_0xda98('0x1d')]:_0x5b04cb[_0xda98('0x1b')]+_0x5b04cb[_0xda98('0x1e')];var _0x485654;if(_0x51bb58>=_0x41cdb0){_0x51bb58=_0x41cdb0;_0x485654=0xc8;}else{_0x485654=0xce;}_0x28c180['status'](_0x485654);return _0x28c180[_0xda98('0x1f')](_0xda98('0x20'),_0x273e10+'-'+_0x51bb58+'/'+_0x41cdb0)[_0xda98('0x1a')](_0x44dd82);}return null;};}function patchUpdates(_0x528c3e){return function(_0x12d759){try{jsonpatch[_0xda98('0x21')](_0x12d759,_0x528c3e,!![]);}catch(_0x401674){return BPromise[_0xda98('0x22')](_0x401674);}return _0x12d759[_0xda98('0x23')]();};}function saveUpdates(_0xad236e,_0x170bb7){return function(_0x51dc7e){if(_0x51dc7e){return _0x51dc7e['update'](_0xad236e)['then'](function(_0x578521){return _0x578521;});}return null;};}function removeEntity(_0x450714,_0x1a5390){return function(_0x46b4af){if(_0x46b4af){return _0x46b4af[_0xda98('0x24')]()[_0xda98('0x25')](function(){_0x450714['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de0ce,_0x52e920){return function(_0x265f20){if(!_0x265f20){_0x3de0ce['sendStatus'](0x194);}return _0x265f20;};}function handleError(_0x260fb6,_0x397343){_0x397343=_0x397343||0x1f4;return function(_0x2fad69){logger['error'](_0x2fad69[_0xda98('0x26')]);if(_0x2fad69[_0xda98('0x27')]){delete _0x2fad69['name'];}_0x260fb6[_0xda98('0x18')](_0x397343)[_0xda98('0x28')](_0x2fad69);};}exports['index']=function(_0x591be7,_0x312f53){var _0x3ddd61={},_0x3c0be3={},_0x21eb8c={'count':0x0,'rows':[]};var _0x49334c=_[_0xda98('0x29')](db[_0xda98('0x2a')][_0xda98('0x2b')],function(_0x24d5c1){return{'name':_0x24d5c1[_0xda98('0x2c')],'type':_0x24d5c1[_0xda98('0x2d')][_0xda98('0x2e')]};});_0x3c0be3[_0xda98('0x2f')]=_['map'](_0x49334c,_0xda98('0x27'));_0x3c0be3[_0xda98('0x30')]=_[_0xda98('0x31')](_0x591be7[_0xda98('0x30')]);_0x3c0be3[_0xda98('0x32')]=_[_0xda98('0x33')](_0x3c0be3[_0xda98('0x2f')],_0x3c0be3[_0xda98('0x30')]);_0x3ddd61[_0xda98('0x34')]=_[_0xda98('0x33')](_0x3c0be3[_0xda98('0x2f')],qs[_0xda98('0x35')](_0x591be7['query'][_0xda98('0x35')]));_0x3ddd61[_0xda98('0x34')]=_0x3ddd61[_0xda98('0x34')][_0xda98('0x36')]?_0x3ddd61['attributes']:_0x3c0be3[_0xda98('0x2f')];if(!_0x591be7[_0xda98('0x30')][_0xda98('0x37')](_0xda98('0x38'))){_0x3ddd61['limit']=qs[_0xda98('0x1e')](_0x591be7[_0xda98('0x30')][_0xda98('0x1e')]);_0x3ddd61['offset']=qs[_0xda98('0x1b')](_0x591be7['query']['offset']);}_0x3ddd61[_0xda98('0x39')]=qs['sort'](_0x591be7['query']['sort']);_0x3ddd61[_0xda98('0x3a')]=qs['filters'](_[_0xda98('0x3b')](_0x591be7['query'],_0x3c0be3[_0xda98('0x32')]),_0x49334c);if(_0x591be7[_0xda98('0x30')][_0xda98('0x3c')]){_0x3ddd61[_0xda98('0x3a')]=_['merge'](_0x3ddd61['where'],{'$or':_['map'](_0x49334c,function(_0x317ebd){if(_0x317ebd['type']!==_0xda98('0x3d')){var _0x3aa9ae={};_0x3aa9ae[_0x317ebd['name']]={'$like':'%'+_0x591be7[_0xda98('0x30')]['filter']+'%'};return _0x3aa9ae;}})});}_0x3ddd61=_[_0xda98('0x3e')]({},_0x3ddd61,_0x591be7['options']);var _0x56da1b={'where':_0x3ddd61[_0xda98('0x3a')]};return db[_0xda98('0x2a')][_0xda98('0x1d')](_0x56da1b)[_0xda98('0x25')](function(_0x123191){_0x21eb8c['count']=_0x123191;if(_0x591be7[_0xda98('0x30')][_0xda98('0x3f')]){_0x3ddd61['include']=[{'all':!![]}];}return db[_0xda98('0x2a')][_0xda98('0x40')](_0x3ddd61);})[_0xda98('0x25')](function(_0x1f0f0d){_0x21eb8c[_0xda98('0x41')]=_0x1f0f0d;return _0x21eb8c;})[_0xda98('0x25')](respondWithFilteredResult(_0x312f53,_0x3ddd61))['catch'](handleError(_0x312f53,null));};exports[_0xda98('0x42')]=function(_0x2eab38,_0xc0a259){var _0x136e46={'raw':![],'where':{'id':_0x2eab38[_0xda98('0x43')]['id']}},_0x1577cf={};_0x1577cf[_0xda98('0x2f')]=_[_0xda98('0x31')](db[_0xda98('0x2a')][_0xda98('0x2b')]);_0x1577cf[_0xda98('0x30')]=_[_0xda98('0x31')](_0x2eab38[_0xda98('0x30')]);_0x1577cf[_0xda98('0x32')]=_[_0xda98('0x33')](_0x1577cf['model'],_0x1577cf['query']);_0x136e46[_0xda98('0x34')]=_[_0xda98('0x33')](_0x1577cf['model'],qs[_0xda98('0x35')](_0x2eab38['query'][_0xda98('0x35')]));_0x136e46['attributes']=_0x136e46[_0xda98('0x34')][_0xda98('0x36')]?_0x136e46['attributes']:_0x1577cf['model'];if(_0x2eab38[_0xda98('0x30')][_0xda98('0x3f')]){_0x136e46['include']=[{'all':!![]}];}_0x136e46=_['merge']({},_0x136e46,_0x2eab38[_0xda98('0x44')]);return db['VtigerConfiguration'][_0xda98('0x45')](_0x136e46)['then'](handleEntityNotFound(_0xc0a259,null))[_0xda98('0x25')](respondWithResult(_0xc0a259,null))['catch'](handleError(_0xc0a259,null));};exports[_0xda98('0x46')]=function(_0x5aab8c,_0x506647){return db['VtigerConfiguration'][_0xda98('0x46')](_0x5aab8c[_0xda98('0x47')],{})['then'](respondWithResult(_0x506647,0xc9))['catch'](handleError(_0x506647,null));};exports[_0xda98('0x48')]=function(_0x49c48c,_0x1a977b){if(_0x49c48c[_0xda98('0x47')]['id']){delete _0x49c48c['body']['id'];}return db[_0xda98('0x2a')][_0xda98('0x45')]({'where':{'id':_0x49c48c[_0xda98('0x43')]['id']}})[_0xda98('0x25')](handleEntityNotFound(_0x1a977b,null))[_0xda98('0x25')](saveUpdates(_0x49c48c[_0xda98('0x47')],null))[_0xda98('0x25')](respondWithResult(_0x1a977b,null))['catch'](handleError(_0x1a977b,null));};exports['destroy']=function(_0x489b7a,_0x4a2e69){return db[_0xda98('0x2a')][_0xda98('0x45')]({'where':{'id':_0x489b7a[_0xda98('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a2e69,null))['then'](removeEntity(_0x4a2e69,null))[_0xda98('0x49')](handleError(_0x4a2e69,null));};exports['getFields']=function(_0xa43d9e,_0x81ab24,_0x164a92){var _0x14060f={};var _0x2820ba={};var _0x405eff;var _0x23ab80;return db['VtigerConfiguration'][_0xda98('0x4a')]({'where':{'id':_0xa43d9e[_0xda98('0x43')]['id']}})[_0xda98('0x25')](handleEntityNotFound(_0x81ab24,null))['then'](function(_0xcbcd3b){if(_0xcbcd3b){_0x405eff=_0xcbcd3b;_0x2820ba[_0xda98('0x2f')]=_[_0xda98('0x31')](db[_0xda98('0x4b')][_0xda98('0x2b')]);_0x2820ba[_0xda98('0x30')]=_[_0xda98('0x31')](_0xa43d9e[_0xda98('0x30')]);_0x2820ba[_0xda98('0x32')]=_[_0xda98('0x33')](_0x2820ba[_0xda98('0x2f')],_0x2820ba[_0xda98('0x30')]);_0x14060f[_0xda98('0x34')]=_[_0xda98('0x33')](_0x2820ba[_0xda98('0x2f')],qs[_0xda98('0x35')](_0xa43d9e[_0xda98('0x30')][_0xda98('0x35')]));_0x14060f[_0xda98('0x34')]=_0x14060f['attributes'][_0xda98('0x36')]?_0x14060f[_0xda98('0x34')]:_0x2820ba[_0xda98('0x2f')];_0x14060f['order']=qs[_0xda98('0x4c')](_0xa43d9e['query'][_0xda98('0x4c')]);_0x14060f[_0xda98('0x3a')]=qs[_0xda98('0x32')](_['pick'](_0xa43d9e[_0xda98('0x30')],_0x2820ba['filters']));if(_0xa43d9e[_0xda98('0x30')][_0xda98('0x3c')]){_0x14060f[_0xda98('0x3a')]=_['merge'](_0x14060f[_0xda98('0x3a')],{'$or':_[_0xda98('0x29')](_0x14060f[_0xda98('0x34')],function(_0x324237){var _0x2f18c4={};_0x2f18c4[_0x324237]={'$like':'%'+_0xa43d9e['query'][_0xda98('0x3c')]+'%'};return _0x2f18c4;})});}_0x14060f=_[_0xda98('0x3e')]({},_0x14060f,_0xa43d9e[_0xda98('0x44')]);return _0x405eff[_0xda98('0x4d')](_0x14060f);}})['then'](function(_0x48030f){if(_0x48030f){_0x23ab80=_0x48030f[_0xda98('0x36')];if(!_0xa43d9e[_0xda98('0x30')][_0xda98('0x37')](_0xda98('0x38'))){_0x14060f[_0xda98('0x1e')]=qs[_0xda98('0x1e')](_0xa43d9e[_0xda98('0x30')][_0xda98('0x1e')]);_0x14060f[_0xda98('0x1b')]=qs[_0xda98('0x1b')](_0xa43d9e[_0xda98('0x30')][_0xda98('0x1b')]);}return _0x405eff['getFields'](_0x14060f);}})[_0xda98('0x25')](function(_0x3b9e52){if(_0x3b9e52){return _0x3b9e52?{'count':_0x23ab80,'rows':_0x3b9e52}:null;}})[_0xda98('0x25')](respondWithResult(_0x81ab24,null))['catch'](handleError(_0x81ab24,null));};exports[_0xda98('0x4e')]=function(_0x47d0b5,_0x2a394a,_0x13c487){var _0x477cf6={};var _0x44055e={};var _0x36dadd;var _0x483af5;return db['VtigerConfiguration'][_0xda98('0x4a')]({'where':{'id':_0x47d0b5['params']['id']}})[_0xda98('0x25')](handleEntityNotFound(_0x2a394a,null))[_0xda98('0x25')](function(_0x222cef){if(_0x222cef){_0x36dadd=_0x222cef;_0x44055e[_0xda98('0x2f')]=_[_0xda98('0x31')](db[_0xda98('0x4b')]['rawAttributes']);_0x44055e[_0xda98('0x30')]=_[_0xda98('0x31')](_0x47d0b5[_0xda98('0x30')]);_0x44055e[_0xda98('0x32')]=_['intersection'](_0x44055e['model'],_0x44055e[_0xda98('0x30')]);_0x477cf6[_0xda98('0x34')]=_['intersection'](_0x44055e[_0xda98('0x2f')],qs[_0xda98('0x35')](_0x47d0b5['query']['fields']));_0x477cf6[_0xda98('0x34')]=_0x477cf6[_0xda98('0x34')][_0xda98('0x36')]?_0x477cf6['attributes']:_0x44055e[_0xda98('0x2f')];_0x477cf6[_0xda98('0x39')]=qs[_0xda98('0x4c')](_0x47d0b5[_0xda98('0x30')]['sort']);_0x477cf6['where']=qs[_0xda98('0x32')](_['pick'](_0x47d0b5[_0xda98('0x30')],_0x44055e[_0xda98('0x32')]));if(_0x47d0b5[_0xda98('0x30')][_0xda98('0x3c')]){_0x477cf6[_0xda98('0x3a')]=_['merge'](_0x477cf6['where'],{'$or':_[_0xda98('0x29')](_0x477cf6[_0xda98('0x34')],function(_0x5d110f){var _0x4e64a5={};_0x4e64a5[_0x5d110f]={'$like':'%'+_0x47d0b5[_0xda98('0x30')]['filter']+'%'};return _0x4e64a5;})});}_0x477cf6=_[_0xda98('0x3e')]({},_0x477cf6,_0x47d0b5[_0xda98('0x44')]);return _0x36dadd['getSubjects'](_0x477cf6);}})[_0xda98('0x25')](function(_0x583e2d){if(_0x583e2d){_0x483af5=_0x583e2d[_0xda98('0x36')];if(!_0x47d0b5[_0xda98('0x30')][_0xda98('0x37')]('nolimit')){_0x477cf6['limit']=qs[_0xda98('0x1e')](_0x47d0b5[_0xda98('0x30')][_0xda98('0x1e')]);_0x477cf6[_0xda98('0x1b')]=qs[_0xda98('0x1b')](_0x47d0b5[_0xda98('0x30')][_0xda98('0x1b')]);}return _0x36dadd[_0xda98('0x4e')](_0x477cf6);}})[_0xda98('0x25')](function(_0x151bfd){if(_0x151bfd){return _0x151bfd?{'count':_0x483af5,'rows':_0x151bfd}:null;}})['then'](respondWithResult(_0x2a394a,null))['catch'](handleError(_0x2a394a,null));};exports[_0xda98('0x4f')]=function(_0x336425,_0xe1df36,_0x2cebca){var _0x2ba9c4={};var _0x216858={};var _0x50ceaf;var _0x37a03b;return db[_0xda98('0x2a')][_0xda98('0x4a')]({'where':{'id':_0x336425[_0xda98('0x43')]['id']}})[_0xda98('0x25')](handleEntityNotFound(_0xe1df36,null))[_0xda98('0x25')](function(_0x36e84a){if(_0x36e84a){_0x50ceaf=_0x36e84a;_0x216858[_0xda98('0x2f')]=_[_0xda98('0x31')](db[_0xda98('0x4b')][_0xda98('0x2b')]);_0x216858[_0xda98('0x30')]=_[_0xda98('0x31')](_0x336425[_0xda98('0x30')]);_0x216858[_0xda98('0x32')]=_['intersection'](_0x216858['model'],_0x216858[_0xda98('0x30')]);_0x2ba9c4[_0xda98('0x34')]=_[_0xda98('0x33')](_0x216858[_0xda98('0x2f')],qs[_0xda98('0x35')](_0x336425[_0xda98('0x30')]['fields']));_0x2ba9c4['attributes']=_0x2ba9c4[_0xda98('0x34')][_0xda98('0x36')]?_0x2ba9c4[_0xda98('0x34')]:_0x216858[_0xda98('0x2f')];_0x2ba9c4[_0xda98('0x39')]=qs[_0xda98('0x4c')](_0x336425[_0xda98('0x30')][_0xda98('0x4c')]);_0x2ba9c4[_0xda98('0x3a')]=qs['filters'](_['pick'](_0x336425[_0xda98('0x30')],_0x216858[_0xda98('0x32')]));if(_0x336425[_0xda98('0x30')][_0xda98('0x3c')]){_0x2ba9c4[_0xda98('0x3a')]=_[_0xda98('0x3e')](_0x2ba9c4[_0xda98('0x3a')],{'$or':_[_0xda98('0x29')](_0x2ba9c4[_0xda98('0x34')],function(_0x7baf2f){var _0x362945={};_0x362945[_0x7baf2f]={'$like':'%'+_0x336425[_0xda98('0x30')]['filter']+'%'};return _0x362945;})});}_0x2ba9c4=_[_0xda98('0x3e')]({},_0x2ba9c4,_0x336425['options']);return _0x50ceaf[_0xda98('0x4f')](_0x2ba9c4);}})[_0xda98('0x25')](function(_0x2fef51){if(_0x2fef51){_0x37a03b=_0x2fef51[_0xda98('0x36')];if(!_0x336425['query'][_0xda98('0x37')](_0xda98('0x38'))){_0x2ba9c4[_0xda98('0x1e')]=qs[_0xda98('0x1e')](_0x336425[_0xda98('0x30')][_0xda98('0x1e')]);_0x2ba9c4[_0xda98('0x1b')]=qs[_0xda98('0x1b')](_0x336425[_0xda98('0x30')]['offset']);}return _0x50ceaf['getDescriptions'](_0x2ba9c4);}})['then'](function(_0x571af4){if(_0x571af4){return _0x571af4?{'count':_0x37a03b,'rows':_0x571af4}:null;}})['then'](respondWithResult(_0xe1df36,null))[_0xda98('0x49')](handleError(_0xe1df36,null));};
\ No newline at end of file
+var _0x3bc8=['end','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','update','getFields','VtigerField','nolimit','getSubjects','findOne','getDescriptions','pick','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then'];(function(_0x4f102c,_0x82cbff){var _0x449837=function(_0x343f01){while(--_0x343f01){_0x4f102c['push'](_0x4f102c['shift']());}};_0x449837(++_0x82cbff);}(_0x3bc8,0x1f3));var _0x83bc=function(_0x47fd45,_0x40dd67){_0x47fd45=_0x47fd45-0x0;var _0x363313=_0x3bc8[_0x47fd45];return _0x363313;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83bc('0x0'));var zipdir=require(_0x83bc('0x1'));var jsonpatch=require(_0x83bc('0x2'));var rp=require('request-promise');var moment=require(_0x83bc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x83bc('0x4'));var path=require(_0x83bc('0x5'));var sox=require(_0x83bc('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83bc('0x7'));var _=require('lodash');var squel=require(_0x83bc('0x8'));var crypto=require('crypto');var jsforce=require(_0x83bc('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x83bc('0xa'));var Papa=require(_0x83bc('0xb'));var Redis=require('ioredis');var authService=require(_0x83bc('0xc'));var qs=require(_0x83bc('0xd'));var as=require(_0x83bc('0xe'));var hardwareService=require(_0x83bc('0xf'));var logger=require('../../config/logger')(_0x83bc('0x10'));var utils=require(_0x83bc('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x83bc('0x12'));var db=require(_0x83bc('0x13'))['db'];function respondWithStatusCode(_0x3064c7,_0x470e3b){_0x470e3b=_0x470e3b||0xcc;return function(_0x179165){if(_0x179165){return _0x3064c7[_0x83bc('0x14')](_0x470e3b);}return _0x3064c7[_0x83bc('0x15')](_0x470e3b)['end']();};}function respondWithResult(_0x3b3d20,_0xd0ccc7){_0xd0ccc7=_0xd0ccc7||0xc8;return function(_0x2477e3){if(_0x2477e3){return _0x3b3d20[_0x83bc('0x15')](_0xd0ccc7)[_0x83bc('0x16')](_0x2477e3);}};}function respondWithFilteredResult(_0x267183,_0x1a7260){return function(_0x272798){if(_0x272798){var _0x26bec5=typeof _0x1a7260['offset']===_0x83bc('0x17')&&typeof _0x1a7260[_0x83bc('0x18')]===_0x83bc('0x17');var _0xaf5c7e=_0x272798[_0x83bc('0x19')];var _0x1b9955=_0x26bec5?0x0:_0x1a7260[_0x83bc('0x1a')];var _0x3eb1c0=_0x26bec5?_0x272798[_0x83bc('0x19')]:_0x1a7260[_0x83bc('0x1a')]+_0x1a7260[_0x83bc('0x18')];var _0x274454;if(_0x3eb1c0>=_0xaf5c7e){_0x3eb1c0=_0xaf5c7e;_0x274454=0xc8;}else{_0x274454=0xce;}_0x267183['status'](_0x274454);return _0x267183[_0x83bc('0x1b')](_0x83bc('0x1c'),_0x1b9955+'-'+_0x3eb1c0+'/'+_0xaf5c7e)[_0x83bc('0x16')](_0x272798);}return null;};}function patchUpdates(_0x4b8813){return function(_0x2c187d){try{jsonpatch[_0x83bc('0x1d')](_0x2c187d,_0x4b8813,!![]);}catch(_0x327c36){return BPromise[_0x83bc('0x1e')](_0x327c36);}return _0x2c187d[_0x83bc('0x1f')]();};}function saveUpdates(_0x37a226,_0x4f3409){return function(_0x50c2fc){if(_0x50c2fc){return _0x50c2fc['update'](_0x37a226)[_0x83bc('0x20')](function(_0x14db2d){return _0x14db2d;});}return null;};}function removeEntity(_0x354f42,_0x3123a1){return function(_0x32b308){if(_0x32b308){return _0x32b308['destroy']()[_0x83bc('0x20')](function(){_0x354f42['status'](0xcc)[_0x83bc('0x21')]();});}};}function handleEntityNotFound(_0x564703,_0x19993b){return function(_0x59f635){if(!_0x59f635){_0x564703[_0x83bc('0x14')](0x194);}return _0x59f635;};}function handleError(_0x1fb7ec,_0xdb4ff2){_0xdb4ff2=_0xdb4ff2||0x1f4;return function(_0x4e6ce2){logger['error'](_0x4e6ce2['stack']);if(_0x4e6ce2[_0x83bc('0x22')]){delete _0x4e6ce2['name'];}_0x1fb7ec['status'](_0xdb4ff2)[_0x83bc('0x23')](_0x4e6ce2);};}exports[_0x83bc('0x24')]=function(_0x3962a6,_0x596b14){var _0x51825={},_0x40f740={},_0x2d0506={'count':0x0,'rows':[]};var _0x54b48e=_[_0x83bc('0x25')](db[_0x83bc('0x26')][_0x83bc('0x27')],function(_0x55b38a){return{'name':_0x55b38a[_0x83bc('0x28')],'type':_0x55b38a[_0x83bc('0x29')][_0x83bc('0x2a')]};});_0x40f740['model']=_[_0x83bc('0x25')](_0x54b48e,'name');_0x40f740[_0x83bc('0x2b')]=_[_0x83bc('0x2c')](_0x3962a6['query']);_0x40f740[_0x83bc('0x2d')]=_['intersection'](_0x40f740[_0x83bc('0x2e')],_0x40f740[_0x83bc('0x2b')]);_0x51825[_0x83bc('0x2f')]=_[_0x83bc('0x30')](_0x40f740[_0x83bc('0x2e')],qs[_0x83bc('0x31')](_0x3962a6[_0x83bc('0x2b')][_0x83bc('0x31')]));_0x51825['attributes']=_0x51825[_0x83bc('0x2f')][_0x83bc('0x32')]?_0x51825[_0x83bc('0x2f')]:_0x40f740['model'];if(!_0x3962a6[_0x83bc('0x2b')][_0x83bc('0x33')]('nolimit')){_0x51825['limit']=qs[_0x83bc('0x18')](_0x3962a6['query'][_0x83bc('0x18')]);_0x51825['offset']=qs[_0x83bc('0x1a')](_0x3962a6['query'][_0x83bc('0x1a')]);}_0x51825[_0x83bc('0x34')]=qs[_0x83bc('0x35')](_0x3962a6[_0x83bc('0x2b')][_0x83bc('0x35')]);_0x51825[_0x83bc('0x36')]=qs['filters'](_['pick'](_0x3962a6[_0x83bc('0x2b')],_0x40f740[_0x83bc('0x2d')]),_0x54b48e);if(_0x3962a6[_0x83bc('0x2b')][_0x83bc('0x37')]){_0x51825[_0x83bc('0x36')]=_[_0x83bc('0x38')](_0x51825[_0x83bc('0x36')],{'$or':_[_0x83bc('0x25')](_0x54b48e,function(_0x46db0f){if(_0x46db0f[_0x83bc('0x29')]!==_0x83bc('0x39')){var _0x5539e7={};_0x5539e7[_0x46db0f[_0x83bc('0x22')]]={'$like':'%'+_0x3962a6[_0x83bc('0x2b')][_0x83bc('0x37')]+'%'};return _0x5539e7;}})});}_0x51825=_['merge']({},_0x51825,_0x3962a6[_0x83bc('0x3a')]);var _0x3ae6c4={'where':_0x51825['where']};return db[_0x83bc('0x26')]['count'](_0x3ae6c4)[_0x83bc('0x20')](function(_0x292458){_0x2d0506[_0x83bc('0x19')]=_0x292458;if(_0x3962a6[_0x83bc('0x2b')]['includeAll']){_0x51825[_0x83bc('0x3b')]=[{'all':!![]}];}return db[_0x83bc('0x26')][_0x83bc('0x3c')](_0x51825);})[_0x83bc('0x20')](function(_0x1fef9d){_0x2d0506[_0x83bc('0x3d')]=_0x1fef9d;return _0x2d0506;})[_0x83bc('0x20')](respondWithFilteredResult(_0x596b14,_0x51825))[_0x83bc('0x3e')](handleError(_0x596b14,null));};exports[_0x83bc('0x3f')]=function(_0x2a2d63,_0x496ad8){var _0x303b41={'raw':![],'where':{'id':_0x2a2d63[_0x83bc('0x40')]['id']}},_0x4d1d1f={};_0x4d1d1f[_0x83bc('0x2e')]=_[_0x83bc('0x2c')](db[_0x83bc('0x26')]['rawAttributes']);_0x4d1d1f['query']=_[_0x83bc('0x2c')](_0x2a2d63[_0x83bc('0x2b')]);_0x4d1d1f[_0x83bc('0x2d')]=_[_0x83bc('0x30')](_0x4d1d1f[_0x83bc('0x2e')],_0x4d1d1f[_0x83bc('0x2b')]);_0x303b41[_0x83bc('0x2f')]=_[_0x83bc('0x30')](_0x4d1d1f[_0x83bc('0x2e')],qs[_0x83bc('0x31')](_0x2a2d63['query'][_0x83bc('0x31')]));_0x303b41[_0x83bc('0x2f')]=_0x303b41['attributes'][_0x83bc('0x32')]?_0x303b41['attributes']:_0x4d1d1f[_0x83bc('0x2e')];if(_0x2a2d63['query']['includeAll']){_0x303b41['include']=[{'all':!![]}];}_0x303b41=_[_0x83bc('0x38')]({},_0x303b41,_0x2a2d63['options']);return db[_0x83bc('0x26')][_0x83bc('0x41')](_0x303b41)['then'](handleEntityNotFound(_0x496ad8,null))[_0x83bc('0x20')](respondWithResult(_0x496ad8,null))[_0x83bc('0x3e')](handleError(_0x496ad8,null));};exports[_0x83bc('0x42')]=function(_0x2ae033,_0x2f73bb){return db['VtigerConfiguration'][_0x83bc('0x42')](_0x2ae033[_0x83bc('0x43')],{})['then'](respondWithResult(_0x2f73bb,0xc9))[_0x83bc('0x3e')](handleError(_0x2f73bb,null));};exports[_0x83bc('0x44')]=function(_0xa183d4,_0x583649){if(_0xa183d4[_0x83bc('0x43')]['id']){delete _0xa183d4[_0x83bc('0x43')]['id'];}return db[_0x83bc('0x26')][_0x83bc('0x41')]({'where':{'id':_0xa183d4[_0x83bc('0x40')]['id']}})[_0x83bc('0x20')](handleEntityNotFound(_0x583649,null))[_0x83bc('0x20')](saveUpdates(_0xa183d4[_0x83bc('0x43')],null))[_0x83bc('0x20')](respondWithResult(_0x583649,null))['catch'](handleError(_0x583649,null));};exports['destroy']=function(_0x299563,_0x263820){return db[_0x83bc('0x26')]['find']({'where':{'id':_0x299563['params']['id']}})['then'](handleEntityNotFound(_0x263820,null))[_0x83bc('0x20')](removeEntity(_0x263820,null))[_0x83bc('0x3e')](handleError(_0x263820,null));};exports[_0x83bc('0x45')]=function(_0x418d4a,_0x568ad7,_0x1d42e8){var _0x398ee1={};var _0x2f744c={};var _0x38c3d1;var _0x4ab35d;return db[_0x83bc('0x26')]['findOne']({'where':{'id':_0x418d4a['params']['id']}})[_0x83bc('0x20')](handleEntityNotFound(_0x568ad7,null))[_0x83bc('0x20')](function(_0x5bdc2c){if(_0x5bdc2c){_0x38c3d1=_0x5bdc2c;_0x2f744c['model']=_['keys'](db[_0x83bc('0x46')][_0x83bc('0x27')]);_0x2f744c[_0x83bc('0x2b')]=_[_0x83bc('0x2c')](_0x418d4a['query']);_0x2f744c[_0x83bc('0x2d')]=_[_0x83bc('0x30')](_0x2f744c['model'],_0x2f744c['query']);_0x398ee1[_0x83bc('0x2f')]=_[_0x83bc('0x30')](_0x2f744c[_0x83bc('0x2e')],qs['fields'](_0x418d4a[_0x83bc('0x2b')][_0x83bc('0x31')]));_0x398ee1[_0x83bc('0x2f')]=_0x398ee1[_0x83bc('0x2f')][_0x83bc('0x32')]?_0x398ee1[_0x83bc('0x2f')]:_0x2f744c[_0x83bc('0x2e')];_0x398ee1['order']=qs[_0x83bc('0x35')](_0x418d4a[_0x83bc('0x2b')][_0x83bc('0x35')]);_0x398ee1['where']=qs[_0x83bc('0x2d')](_['pick'](_0x418d4a[_0x83bc('0x2b')],_0x2f744c[_0x83bc('0x2d')]));if(_0x418d4a[_0x83bc('0x2b')][_0x83bc('0x37')]){_0x398ee1['where']=_[_0x83bc('0x38')](_0x398ee1[_0x83bc('0x36')],{'$or':_[_0x83bc('0x25')](_0x398ee1[_0x83bc('0x2f')],function(_0x25f018){var _0x28ce82={};_0x28ce82[_0x25f018]={'$like':'%'+_0x418d4a[_0x83bc('0x2b')]['filter']+'%'};return _0x28ce82;})});}_0x398ee1=_[_0x83bc('0x38')]({},_0x398ee1,_0x418d4a['options']);return _0x38c3d1[_0x83bc('0x45')](_0x398ee1);}})['then'](function(_0x288e21){if(_0x288e21){_0x4ab35d=_0x288e21['length'];if(!_0x418d4a[_0x83bc('0x2b')][_0x83bc('0x33')](_0x83bc('0x47'))){_0x398ee1[_0x83bc('0x18')]=qs[_0x83bc('0x18')](_0x418d4a[_0x83bc('0x2b')]['limit']);_0x398ee1[_0x83bc('0x1a')]=qs[_0x83bc('0x1a')](_0x418d4a[_0x83bc('0x2b')]['offset']);}return _0x38c3d1['getFields'](_0x398ee1);}})[_0x83bc('0x20')](function(_0x574fd){if(_0x574fd){return _0x574fd?{'count':_0x4ab35d,'rows':_0x574fd}:null;}})[_0x83bc('0x20')](respondWithResult(_0x568ad7,null))[_0x83bc('0x3e')](handleError(_0x568ad7,null));};exports[_0x83bc('0x48')]=function(_0x4c5e4e,_0x51e42a,_0x55fedf){var _0x81b4c0={};var _0x5dcbf1={};var _0x134598;var _0x350f7a;return db[_0x83bc('0x26')][_0x83bc('0x49')]({'where':{'id':_0x4c5e4e['params']['id']}})[_0x83bc('0x20')](handleEntityNotFound(_0x51e42a,null))[_0x83bc('0x20')](function(_0x52143b){if(_0x52143b){_0x134598=_0x52143b;_0x5dcbf1[_0x83bc('0x2e')]=_[_0x83bc('0x2c')](db[_0x83bc('0x46')]['rawAttributes']);_0x5dcbf1[_0x83bc('0x2b')]=_[_0x83bc('0x2c')](_0x4c5e4e[_0x83bc('0x2b')]);_0x5dcbf1[_0x83bc('0x2d')]=_[_0x83bc('0x30')](_0x5dcbf1['model'],_0x5dcbf1['query']);_0x81b4c0[_0x83bc('0x2f')]=_[_0x83bc('0x30')](_0x5dcbf1['model'],qs[_0x83bc('0x31')](_0x4c5e4e['query']['fields']));_0x81b4c0[_0x83bc('0x2f')]=_0x81b4c0[_0x83bc('0x2f')][_0x83bc('0x32')]?_0x81b4c0[_0x83bc('0x2f')]:_0x5dcbf1[_0x83bc('0x2e')];_0x81b4c0[_0x83bc('0x34')]=qs['sort'](_0x4c5e4e[_0x83bc('0x2b')][_0x83bc('0x35')]);_0x81b4c0[_0x83bc('0x36')]=qs[_0x83bc('0x2d')](_['pick'](_0x4c5e4e[_0x83bc('0x2b')],_0x5dcbf1[_0x83bc('0x2d')]));if(_0x4c5e4e[_0x83bc('0x2b')][_0x83bc('0x37')]){_0x81b4c0[_0x83bc('0x36')]=_[_0x83bc('0x38')](_0x81b4c0[_0x83bc('0x36')],{'$or':_[_0x83bc('0x25')](_0x81b4c0[_0x83bc('0x2f')],function(_0x19c9fa){var _0x211f98={};_0x211f98[_0x19c9fa]={'$like':'%'+_0x4c5e4e['query'][_0x83bc('0x37')]+'%'};return _0x211f98;})});}_0x81b4c0=_[_0x83bc('0x38')]({},_0x81b4c0,_0x4c5e4e['options']);return _0x134598['getSubjects'](_0x81b4c0);}})[_0x83bc('0x20')](function(_0xf907){if(_0xf907){_0x350f7a=_0xf907[_0x83bc('0x32')];if(!_0x4c5e4e['query'][_0x83bc('0x33')]('nolimit')){_0x81b4c0[_0x83bc('0x18')]=qs[_0x83bc('0x18')](_0x4c5e4e[_0x83bc('0x2b')]['limit']);_0x81b4c0[_0x83bc('0x1a')]=qs['offset'](_0x4c5e4e[_0x83bc('0x2b')][_0x83bc('0x1a')]);}return _0x134598[_0x83bc('0x48')](_0x81b4c0);}})[_0x83bc('0x20')](function(_0x5e603c){if(_0x5e603c){return _0x5e603c?{'count':_0x350f7a,'rows':_0x5e603c}:null;}})['then'](respondWithResult(_0x51e42a,null))['catch'](handleError(_0x51e42a,null));};exports[_0x83bc('0x4a')]=function(_0x63ad87,_0x24e240,_0x3151fb){var _0xb84d45={};var _0x5d39b3={};var _0x579b54;var _0x5ecb9d;return db[_0x83bc('0x26')][_0x83bc('0x49')]({'where':{'id':_0x63ad87[_0x83bc('0x40')]['id']}})[_0x83bc('0x20')](handleEntityNotFound(_0x24e240,null))['then'](function(_0x19f5f3){if(_0x19f5f3){_0x579b54=_0x19f5f3;_0x5d39b3[_0x83bc('0x2e')]=_[_0x83bc('0x2c')](db['VtigerField'][_0x83bc('0x27')]);_0x5d39b3[_0x83bc('0x2b')]=_[_0x83bc('0x2c')](_0x63ad87[_0x83bc('0x2b')]);_0x5d39b3['filters']=_[_0x83bc('0x30')](_0x5d39b3['model'],_0x5d39b3['query']);_0xb84d45[_0x83bc('0x2f')]=_['intersection'](_0x5d39b3['model'],qs['fields'](_0x63ad87[_0x83bc('0x2b')][_0x83bc('0x31')]));_0xb84d45[_0x83bc('0x2f')]=_0xb84d45[_0x83bc('0x2f')]['length']?_0xb84d45['attributes']:_0x5d39b3[_0x83bc('0x2e')];_0xb84d45['order']=qs['sort'](_0x63ad87[_0x83bc('0x2b')][_0x83bc('0x35')]);_0xb84d45[_0x83bc('0x36')]=qs['filters'](_[_0x83bc('0x4b')](_0x63ad87[_0x83bc('0x2b')],_0x5d39b3['filters']));if(_0x63ad87[_0x83bc('0x2b')][_0x83bc('0x37')]){_0xb84d45[_0x83bc('0x36')]=_[_0x83bc('0x38')](_0xb84d45['where'],{'$or':_[_0x83bc('0x25')](_0xb84d45[_0x83bc('0x2f')],function(_0x3ae714){var _0x5b7131={};_0x5b7131[_0x3ae714]={'$like':'%'+_0x63ad87[_0x83bc('0x2b')][_0x83bc('0x37')]+'%'};return _0x5b7131;})});}_0xb84d45=_[_0x83bc('0x38')]({},_0xb84d45,_0x63ad87[_0x83bc('0x3a')]);return _0x579b54[_0x83bc('0x4a')](_0xb84d45);}})['then'](function(_0x51cb3d){if(_0x51cb3d){_0x5ecb9d=_0x51cb3d['length'];if(!_0x63ad87[_0x83bc('0x2b')][_0x83bc('0x33')]('nolimit')){_0xb84d45[_0x83bc('0x18')]=qs[_0x83bc('0x18')](_0x63ad87[_0x83bc('0x2b')][_0x83bc('0x18')]);_0xb84d45[_0x83bc('0x1a')]=qs['offset'](_0x63ad87[_0x83bc('0x2b')][_0x83bc('0x1a')]);}return _0x579b54['getDescriptions'](_0xb84d45);}})[_0x83bc('0x20')](function(_0x4bb800){if(_0x4bb800){return _0x4bb800?{'count':_0x5ecb9d,'rows':_0x4bb800}:null;}})[_0x83bc('0x20')](respondWithResult(_0x24e240,null))['catch'](handleError(_0x24e240,null));};
\ No newline at end of file
index 37d20d5..8883c31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7499=['path','rimraf','../../config/environment','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x406ae7,_0x12181b){var _0x5a5b9d=function(_0x3f20c2){while(--_0x3f20c2){_0x406ae7['push'](_0x406ae7['shift']());}};_0x5a5b9d(++_0x12181b);}(_0x7499,0x13b));var _0x9749=function(_0x42d1f8,_0x22e529){_0x42d1f8=_0x42d1f8-0x0;var _0x40d234=_0x7499[_0x42d1f8];return _0x40d234;};'use strict';var _=require(_0x9749('0x0'));var util=require(_0x9749('0x1'));var logger=require(_0x9749('0x2'))('api');var moment=require(_0x9749('0x3'));var BPromise=require(_0x9749('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9749('0x5'));var rimraf=require(_0x9749('0x6'));var config=require(_0x9749('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x45e14b,_0x20e94d){return _0x45e14b['define'](_0x9749('0x8'),attributes,{'tableName':_0x9749('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe609=['moment','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','api'];(function(_0x5b5571,_0xe8748f){var _0x2fadc=function(_0xf347db){while(--_0xf347db){_0x5b5571['push'](_0x5b5571['shift']());}};_0x2fadc(++_0xe8748f);}(_0xe609,0xa1));var _0x9e60=function(_0x11cd88,_0x3f3184){_0x11cd88=_0x11cd88-0x0;var _0x1d0b00=_0xe609[_0x11cd88];return _0x1d0b00;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9e60('0x0'));var moment=require(_0x9e60('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e60('0x2'));var rimraf=require(_0x9e60('0x3'));var config=require('../../config/environment');var attributes=require(_0x9e60('0x4'));module[_0x9e60('0x5')]=function(_0x72ad72,_0x331981){return _0x72ad72[_0x9e60('0x6')](_0x9e60('0x7'),attributes,{'tableName':_0x9e60('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b703674..d4d24ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a89=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x6975d,_0x1da421){var _0x3a69e5=function(_0x33363f){while(--_0x33363f){_0x6975d['push'](_0x6975d['shift']());}};_0x3a69e5(++_0x1da421);}(_0x9a89,0x18a));var _0x99a8=function(_0x14a4e0,_0x26362b){_0x14a4e0=_0x14a4e0-0x0;var _0x3af583=_0x9a89[_0x14a4e0];return _0x3af583;};'use strict';var _=require(_0x99a8('0x0'));var util=require(_0x99a8('0x1'));var moment=require('moment');var BPromise=require(_0x99a8('0x2'));var rs=require(_0x99a8('0x3'));var fs=require('fs');var Redis=require(_0x99a8('0x4'));var db=require(_0x99a8('0x5'))['db'];var utils=require(_0x99a8('0x6'));var logger=require(_0x99a8('0x7'))(_0x99a8('0x8'));var config=require(_0x99a8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x99a8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44e85d,_0x5a958b,_0x4b731f){return new BPromise(function(_0x30897b,_0x22b82c){return client[_0x99a8('0xb')](_0x44e85d,_0x4b731f)[_0x99a8('0xc')](function(_0x1cff72){logger[_0x99a8('0xd')](_0x99a8('0xe'),_0x5a958b,_0x99a8('0xf'));logger[_0x99a8('0x10')](_0x99a8('0x11'),_0x5a958b,_0x99a8('0xf'),JSON[_0x99a8('0x12')](_0x1cff72));if(_0x1cff72[_0x99a8('0x13')]){if(_0x1cff72[_0x99a8('0x13')][_0x99a8('0x14')]===0x1f4){logger[_0x99a8('0x13')](_0x99a8('0xe'),_0x5a958b,_0x1cff72[_0x99a8('0x13')]['message']);return _0x22b82c(_0x1cff72[_0x99a8('0x13')][_0x99a8('0x15')]);}logger[_0x99a8('0x13')](_0x99a8('0xe'),_0x5a958b,_0x1cff72['error'][_0x99a8('0x15')]);return _0x30897b(_0x1cff72[_0x99a8('0x13')]['message']);}else{logger[_0x99a8('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x5a958b,_0x99a8('0xf'));_0x30897b(_0x1cff72['result'][_0x99a8('0x15')]);}})['catch'](function(_0xa734f3){logger['error'](_0x99a8('0xe'),_0x5a958b,_0xa734f3);_0x22b82c(_0xa734f3);});});}
\ No newline at end of file
+var _0x3709=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','moment'];(function(_0x4785cd,_0x346e46){var _0x258099=function(_0x3cbb17){while(--_0x3cbb17){_0x4785cd['push'](_0x4785cd['shift']());}};_0x258099(++_0x346e46);}(_0x3709,0x1b6));var _0x9370=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3709[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x9370('0x0'));var util=require('util');var moment=require(_0x9370('0x1'));var BPromise=require('bluebird');var rs=require(_0x9370('0x2'));var fs=require('fs');var Redis=require(_0x9370('0x3'));var db=require(_0x9370('0x4'))['db'];var utils=require(_0x9370('0x5'));var logger=require('../../config/logger')(_0x9370('0x6'));var config=require(_0x9370('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9370('0x8')][_0x9370('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdc9dd1,_0x316558,_0x5d70a3){return new BPromise(function(_0x33956a,_0x48ca55){return client[_0x9370('0xa')](_0xdc9dd1,_0x5d70a3)[_0x9370('0xb')](function(_0x14c10e){logger[_0x9370('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x316558,_0x9370('0xd'));logger[_0x9370('0xe')](_0x9370('0xf'),_0x316558,_0x9370('0xd'),JSON[_0x9370('0x10')](_0x14c10e));if(_0x14c10e[_0x9370('0x11')]){if(_0x14c10e[_0x9370('0x11')][_0x9370('0x12')]===0x1f4){logger[_0x9370('0x11')](_0x9370('0x13'),_0x316558,_0x14c10e['error'][_0x9370('0x14')]);return _0x48ca55(_0x14c10e[_0x9370('0x11')][_0x9370('0x14')]);}logger[_0x9370('0x11')](_0x9370('0x13'),_0x316558,_0x14c10e[_0x9370('0x11')][_0x9370('0x14')]);return _0x33956a(_0x14c10e[_0x9370('0x11')][_0x9370('0x14')]);}else{logger[_0x9370('0xc')](_0x9370('0x13'),_0x316558,'request\x20sent');_0x33956a(_0x14c10e[_0x9370('0x15')][_0x9370('0x14')]);}})['catch'](function(_0x548975){logger[_0x9370('0x11')](_0x9370('0x13'),_0x316558,_0x548975);_0x48ca55(_0x548975);});});}
\ No newline at end of file
index 6a9565f..1159ba4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x463d=['./intVtigerField.controller','index','isAuthenticated','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x6ef396,_0x3b78e4){var _0x1c9001=function(_0x3194f6){while(--_0x3194f6){_0x6ef396['push'](_0x6ef396['shift']());}};_0x1c9001(++_0x3b78e4);}(_0x463d,0x14c));var _0xd463=function(_0x344b24,_0x2b6b0d){_0x344b24=_0x344b24-0x0;var _0x5b66cc=_0x463d[_0x344b24];return _0x5b66cc;};'use strict';var multer=require(_0xd463('0x0'));var util=require(_0xd463('0x1'));var path=require(_0xd463('0x2'));var timeout=require(_0xd463('0x3'));var express=require(_0xd463('0x4'));var router=express[_0xd463('0x5')]();var fs_extra=require(_0xd463('0x6'));var auth=require(_0xd463('0x7'));var interaction=require(_0xd463('0x8'));var config=require(_0xd463('0x9'));var controller=require(_0xd463('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xd463('0xb')]);router['get']('/:id',auth[_0xd463('0xc')](),controller['show']);router[_0xd463('0xd')]('/',auth['isAuthenticated'](),controller[_0xd463('0xe')]);router[_0xd463('0xf')](_0xd463('0x10'),auth[_0xd463('0xc')](),controller[_0xd463('0x11')]);router[_0xd463('0x12')](_0xd463('0x10'),auth[_0xd463('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5ae2=['/:id','show','post','create','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x1116bf,_0x3045c6){var _0x21b4d3=function(_0x464d04){while(--_0x464d04){_0x1116bf['push'](_0x1116bf['shift']());}};_0x21b4d3(++_0x3045c6);}(_0x5ae2,0x115));var _0x25ae=function(_0x8be9fb,_0x2f90d9){_0x8be9fb=_0x8be9fb-0x0;var _0x3b41ac=_0x5ae2[_0x8be9fb];return _0x3b41ac;};'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('../../components/interaction/service');var config=require(_0x25ae('0x6'));var controller=require(_0x25ae('0x7'));router[_0x25ae('0x8')]('/',auth[_0x25ae('0x9')](),controller[_0x25ae('0xa')]);router[_0x25ae('0x8')](_0x25ae('0xb'),auth[_0x25ae('0x9')](),controller[_0x25ae('0xc')]);router[_0x25ae('0xd')]('/',auth[_0x25ae('0x9')](),controller[_0x25ae('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x25ae('0xf')]);router['delete'](_0x25ae('0xb'),auth[_0x25ae('0x9')](),controller[_0x25ae('0x10')]);module[_0x25ae('0x11')]=router;
\ No newline at end of file
index d2ccf3b..0124e01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b7a=['sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0x3b7a,0xc6));var _0xa3b7=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3b7a[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xa3b7('0x0'));module[_0xa3b7('0x1')]={'type':{'type':Sequelize[_0xa3b7('0x2')]('string','variable',_0xa3b7('0x3'),_0xa3b7('0x4'),_0xa3b7('0x5')),'defaultValue':_0xa3b7('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa3b7('0x7')]},'keyType':{'type':Sequelize[_0xa3b7('0x2')](_0xa3b7('0x6'),'variable',_0xa3b7('0x3'))},'keyContent':{'type':Sequelize[_0xa3b7('0x7')]},'idField':{'type':Sequelize[_0xa3b7('0x7')]},'nameField':{'type':Sequelize[_0xa3b7('0x7')]},'customField':{'type':Sequelize[_0xa3b7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa3b7('0x7')]}};
\ No newline at end of file
+var _0x2351=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x3ab3a1,_0x120662){var _0x53174c=function(_0x2e6385){while(--_0x2e6385){_0x3ab3a1['push'](_0x3ab3a1['shift']());}};_0x53174c(++_0x120662);}(_0x2351,0xc4));var _0x1235=function(_0xf4306f,_0x26c067){_0xf4306f=_0xf4306f-0x0;var _0x352401=_0x2351[_0xf4306f];return _0x352401;};'use strict';var Sequelize=require(_0x1235('0x0'));module[_0x1235('0x1')]={'type':{'type':Sequelize[_0x1235('0x2')](_0x1235('0x3'),_0x1235('0x4'),_0x1235('0x5'),_0x1235('0x6'),_0x1235('0x7')),'defaultValue':_0x1235('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x1235('0x3'),_0x1235('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1235('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1235('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 587329c..8378315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70d7=['order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','index','map','VtigerField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x499ac9,_0x34e763){var _0x48fa8d=function(_0x415444){while(--_0x415444){_0x499ac9['push'](_0x499ac9['shift']());}};_0x48fa8d(++_0x34e763);}(_0x70d7,0xf8));var _0x770d=function(_0x18524c,_0x4a1955){_0x18524c=_0x18524c-0x0;var _0x38159f=_0x70d7[_0x18524c];return _0x38159f;};'use strict';var emlformat=require(_0x770d('0x0'));var rimraf=require(_0x770d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x770d('0x2'));var moment=require(_0x770d('0x3'));var BPromise=require(_0x770d('0x4'));var Mustache=require(_0x770d('0x5'));var util=require(_0x770d('0x6'));var path=require(_0x770d('0x7'));var sox=require('sox');var csv=require(_0x770d('0x8'));var ejs=require(_0x770d('0x9'));var fs=require('fs');var fs_extra=require(_0x770d('0xa'));var _=require(_0x770d('0xb'));var squel=require(_0x770d('0xc'));var crypto=require(_0x770d('0xd'));var jsforce=require(_0x770d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x770d('0x8'));var querystring=require(_0x770d('0xf'));var Papa=require(_0x770d('0x10'));var Redis=require(_0x770d('0x11'));var authService=require(_0x770d('0x12'));var qs=require(_0x770d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x770d('0x14'));var utils=require(_0x770d('0x15'));var config=require(_0x770d('0x16'));var licenseUtil=require(_0x770d('0x17'));var db=require(_0x770d('0x18'))['db'];function respondWithStatusCode(_0x3df0a6,_0x40f71e){_0x40f71e=_0x40f71e||0xcc;return function(_0x1d7836){if(_0x1d7836){return _0x3df0a6[_0x770d('0x19')](_0x40f71e);}return _0x3df0a6[_0x770d('0x1a')](_0x40f71e)[_0x770d('0x1b')]();};}function respondWithResult(_0x254ae6,_0x4ccc28){_0x4ccc28=_0x4ccc28||0xc8;return function(_0x2f259b){if(_0x2f259b){return _0x254ae6[_0x770d('0x1a')](_0x4ccc28)['json'](_0x2f259b);}};}function respondWithFilteredResult(_0x24b4f9,_0x4c3a9d){return function(_0x38c966){if(_0x38c966){var _0x836d18=typeof _0x4c3a9d[_0x770d('0x1c')]===_0x770d('0x1d')&&typeof _0x4c3a9d[_0x770d('0x1e')]===_0x770d('0x1d');var _0x3b3237=_0x38c966[_0x770d('0x1f')];var _0x18ca1a=_0x836d18?0x0:_0x4c3a9d[_0x770d('0x1c')];var _0x5262ac=_0x836d18?_0x38c966[_0x770d('0x1f')]:_0x4c3a9d['offset']+_0x4c3a9d[_0x770d('0x1e')];var _0x161351;if(_0x5262ac>=_0x3b3237){_0x5262ac=_0x3b3237;_0x161351=0xc8;}else{_0x161351=0xce;}_0x24b4f9[_0x770d('0x1a')](_0x161351);return _0x24b4f9[_0x770d('0x20')](_0x770d('0x21'),_0x18ca1a+'-'+_0x5262ac+'/'+_0x3b3237)[_0x770d('0x22')](_0x38c966);}return null;};}function patchUpdates(_0x4a56a7){return function(_0x58d574){try{jsonpatch[_0x770d('0x23')](_0x58d574,_0x4a56a7,!![]);}catch(_0x13b80f){return BPromise[_0x770d('0x24')](_0x13b80f);}return _0x58d574['save']();};}function saveUpdates(_0x2dad95,_0xaa3be){return function(_0x147986){if(_0x147986){return _0x147986['update'](_0x2dad95)[_0x770d('0x25')](function(_0x1fdf89){return _0x1fdf89;});}return null;};}function removeEntity(_0xb0a576,_0x539209){return function(_0x52a417){if(_0x52a417){return _0x52a417[_0x770d('0x26')]()[_0x770d('0x25')](function(){_0xb0a576[_0x770d('0x1a')](0xcc)[_0x770d('0x1b')]();});}};}function handleEntityNotFound(_0xde7cc5,_0x292d70){return function(_0x2fba9f){if(!_0x2fba9f){_0xde7cc5['sendStatus'](0x194);}return _0x2fba9f;};}function handleError(_0x277724,_0x4b722a){_0x4b722a=_0x4b722a||0x1f4;return function(_0x5b0aa6){logger[_0x770d('0x27')](_0x5b0aa6[_0x770d('0x28')]);if(_0x5b0aa6['name']){delete _0x5b0aa6[_0x770d('0x29')];}_0x277724[_0x770d('0x1a')](_0x4b722a)['send'](_0x5b0aa6);};}exports[_0x770d('0x2a')]=function(_0x2b262a,_0x3dcaf5){var _0x345d92={},_0x40d6a3={},_0x5925a1={'count':0x0,'rows':[]};var _0x5e390e=_[_0x770d('0x2b')](db[_0x770d('0x2c')][_0x770d('0x2d')],function(_0x101691){return{'name':_0x101691['fieldName'],'type':_0x101691['type'][_0x770d('0x2e')]};});_0x40d6a3[_0x770d('0x2f')]=_['map'](_0x5e390e,_0x770d('0x29'));_0x40d6a3[_0x770d('0x30')]=_[_0x770d('0x31')](_0x2b262a[_0x770d('0x30')]);_0x40d6a3[_0x770d('0x32')]=_[_0x770d('0x33')](_0x40d6a3[_0x770d('0x2f')],_0x40d6a3['query']);_0x345d92[_0x770d('0x34')]=_[_0x770d('0x33')](_0x40d6a3[_0x770d('0x2f')],qs[_0x770d('0x35')](_0x2b262a[_0x770d('0x30')][_0x770d('0x35')]));_0x345d92['attributes']=_0x345d92[_0x770d('0x34')][_0x770d('0x36')]?_0x345d92[_0x770d('0x34')]:_0x40d6a3['model'];if(!_0x2b262a['query']['hasOwnProperty'](_0x770d('0x37'))){_0x345d92[_0x770d('0x1e')]=qs['limit'](_0x2b262a[_0x770d('0x30')][_0x770d('0x1e')]);_0x345d92[_0x770d('0x1c')]=qs[_0x770d('0x1c')](_0x2b262a['query']['offset']);}_0x345d92[_0x770d('0x38')]=qs['sort'](_0x2b262a[_0x770d('0x30')][_0x770d('0x39')]);_0x345d92[_0x770d('0x3a')]=qs[_0x770d('0x32')](_[_0x770d('0x3b')](_0x2b262a[_0x770d('0x30')],_0x40d6a3[_0x770d('0x32')]),_0x5e390e);if(_0x2b262a[_0x770d('0x30')][_0x770d('0x3c')]){_0x345d92[_0x770d('0x3a')]=_[_0x770d('0x3d')](_0x345d92[_0x770d('0x3a')],{'$or':_[_0x770d('0x2b')](_0x5e390e,function(_0x44835e){if(_0x44835e[_0x770d('0x3e')]!==_0x770d('0x3f')){var _0x27fefa={};_0x27fefa[_0x44835e[_0x770d('0x29')]]={'$like':'%'+_0x2b262a[_0x770d('0x30')]['filter']+'%'};return _0x27fefa;}})});}_0x345d92=_[_0x770d('0x3d')]({},_0x345d92,_0x2b262a[_0x770d('0x40')]);var _0x38bf2a={'where':_0x345d92[_0x770d('0x3a')]};return db[_0x770d('0x2c')][_0x770d('0x1f')](_0x38bf2a)[_0x770d('0x25')](function(_0xc524e9){_0x5925a1[_0x770d('0x1f')]=_0xc524e9;if(_0x2b262a[_0x770d('0x30')][_0x770d('0x41')]){_0x345d92['include']=[{'all':!![]}];}return db[_0x770d('0x2c')][_0x770d('0x42')](_0x345d92);})['then'](function(_0x25482e){_0x5925a1[_0x770d('0x43')]=_0x25482e;return _0x5925a1;})[_0x770d('0x25')](respondWithFilteredResult(_0x3dcaf5,_0x345d92))[_0x770d('0x44')](handleError(_0x3dcaf5,null));};exports[_0x770d('0x45')]=function(_0x41c54e,_0x2340c9){var _0x2e4937={'raw':!![],'where':{'id':_0x41c54e[_0x770d('0x46')]['id']}},_0x413e26={};_0x413e26[_0x770d('0x2f')]=_[_0x770d('0x31')](db[_0x770d('0x2c')][_0x770d('0x2d')]);_0x413e26[_0x770d('0x30')]=_['keys'](_0x41c54e[_0x770d('0x30')]);_0x413e26[_0x770d('0x32')]=_[_0x770d('0x33')](_0x413e26[_0x770d('0x2f')],_0x413e26[_0x770d('0x30')]);_0x2e4937['attributes']=_[_0x770d('0x33')](_0x413e26[_0x770d('0x2f')],qs[_0x770d('0x35')](_0x41c54e[_0x770d('0x30')][_0x770d('0x35')]));_0x2e4937['attributes']=_0x2e4937[_0x770d('0x34')]['length']?_0x2e4937['attributes']:_0x413e26[_0x770d('0x2f')];if(_0x41c54e['query'][_0x770d('0x41')]){_0x2e4937[_0x770d('0x47')]=[{'all':!![]}];}_0x2e4937=_[_0x770d('0x3d')]({},_0x2e4937,_0x41c54e['options']);return db['VtigerField'][_0x770d('0x48')](_0x2e4937)[_0x770d('0x25')](handleEntityNotFound(_0x2340c9,null))[_0x770d('0x25')](respondWithResult(_0x2340c9,null))['catch'](handleError(_0x2340c9,null));};exports[_0x770d('0x49')]=function(_0x53655e,_0x5c58b4){return db[_0x770d('0x2c')][_0x770d('0x49')](_0x53655e[_0x770d('0x4a')],{})[_0x770d('0x25')](respondWithResult(_0x5c58b4,0xc9))[_0x770d('0x44')](handleError(_0x5c58b4,null));};exports[_0x770d('0x4b')]=function(_0x3346de,_0x84b14e){if(_0x3346de[_0x770d('0x4a')]['id']){delete _0x3346de[_0x770d('0x4a')]['id'];}return db[_0x770d('0x2c')][_0x770d('0x48')]({'where':{'id':_0x3346de[_0x770d('0x46')]['id']}})[_0x770d('0x25')](handleEntityNotFound(_0x84b14e,null))[_0x770d('0x25')](saveUpdates(_0x3346de['body'],null))[_0x770d('0x25')](respondWithResult(_0x84b14e,null))[_0x770d('0x44')](handleError(_0x84b14e,null));};exports[_0x770d('0x26')]=function(_0x147029,_0x409387){return db['VtigerField'][_0x770d('0x48')]({'where':{'id':_0x147029['params']['id']}})[_0x770d('0x25')](handleEntityNotFound(_0x409387,null))[_0x770d('0x25')](removeEntity(_0x409387,null))[_0x770d('0x44')](handleError(_0x409387,null));};
\ No newline at end of file
+var _0x4c3f=['attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','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','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','error','stack','name','index','map','VtigerField','rawAttributes','fieldName','model','query','keys','intersection'];(function(_0x268295,_0x39869b){var _0x20765b=function(_0x3c0794){while(--_0x3c0794){_0x268295['push'](_0x268295['shift']());}};_0x20765b(++_0x39869b);}(_0x4c3f,0xae));var _0xf4c3=function(_0x51c187,_0x5910f9){_0x51c187=_0x51c187-0x0;var _0x3a54c4=_0x4c3f[_0x51c187];return _0x3a54c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4c3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf4c3('0x1'));var moment=require(_0xf4c3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf4c3('0x3'));var util=require(_0xf4c3('0x4'));var path=require(_0xf4c3('0x5'));var sox=require(_0xf4c3('0x6'));var csv=require(_0xf4c3('0x7'));var ejs=require(_0xf4c3('0x8'));var fs=require('fs');var fs_extra=require(_0xf4c3('0x9'));var _=require(_0xf4c3('0xa'));var squel=require(_0xf4c3('0xb'));var crypto=require(_0xf4c3('0xc'));var jsforce=require(_0xf4c3('0xd'));var deskjs=require(_0xf4c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf4c3('0xf'));var Papa=require(_0xf4c3('0x10'));var Redis=require(_0xf4c3('0x11'));var authService=require(_0xf4c3('0x12'));var qs=require(_0xf4c3('0x13'));var as=require(_0xf4c3('0x14'));var hardwareService=require(_0xf4c3('0x15'));var logger=require(_0xf4c3('0x16'))(_0xf4c3('0x17'));var utils=require(_0xf4c3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf4c3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x488b10,_0x438a99){_0x438a99=_0x438a99||0xcc;return function(_0x1b00e4){if(_0x1b00e4){return _0x488b10[_0xf4c3('0x1a')](_0x438a99);}return _0x488b10[_0xf4c3('0x1b')](_0x438a99)[_0xf4c3('0x1c')]();};}function respondWithResult(_0x240d25,_0x289ce2){_0x289ce2=_0x289ce2||0xc8;return function(_0x40f91c){if(_0x40f91c){return _0x240d25[_0xf4c3('0x1b')](_0x289ce2)[_0xf4c3('0x1d')](_0x40f91c);}};}function respondWithFilteredResult(_0xb54790,_0x3a7449){return function(_0x208019){if(_0x208019){var _0x31a9ba=typeof _0x3a7449[_0xf4c3('0x1e')]===_0xf4c3('0x1f')&&typeof _0x3a7449['limit']===_0xf4c3('0x1f');var _0x459464=_0x208019[_0xf4c3('0x20')];var _0x481edc=_0x31a9ba?0x0:_0x3a7449[_0xf4c3('0x1e')];var _0x300180=_0x31a9ba?_0x208019['count']:_0x3a7449[_0xf4c3('0x1e')]+_0x3a7449[_0xf4c3('0x21')];var _0x38ae25;if(_0x300180>=_0x459464){_0x300180=_0x459464;_0x38ae25=0xc8;}else{_0x38ae25=0xce;}_0xb54790[_0xf4c3('0x1b')](_0x38ae25);return _0xb54790[_0xf4c3('0x22')](_0xf4c3('0x23'),_0x481edc+'-'+_0x300180+'/'+_0x459464)[_0xf4c3('0x1d')](_0x208019);}return null;};}function patchUpdates(_0x6d30da){return function(_0xf94bc5){try{jsonpatch[_0xf4c3('0x24')](_0xf94bc5,_0x6d30da,!![]);}catch(_0x1054fc){return BPromise['reject'](_0x1054fc);}return _0xf94bc5[_0xf4c3('0x25')]();};}function saveUpdates(_0x4497ab,_0x4bee4c){return function(_0x41faec){if(_0x41faec){return _0x41faec[_0xf4c3('0x26')](_0x4497ab)['then'](function(_0x594c0e){return _0x594c0e;});}return null;};}function removeEntity(_0x990d60,_0x5924a5){return function(_0xcc807){if(_0xcc807){return _0xcc807['destroy']()['then'](function(){_0x990d60['status'](0xcc)[_0xf4c3('0x1c')]();});}};}function handleEntityNotFound(_0x175ddd,_0x35c4df){return function(_0x2b4795){if(!_0x2b4795){_0x175ddd[_0xf4c3('0x1a')](0x194);}return _0x2b4795;};}function handleError(_0x16320e,_0x38ccc1){_0x38ccc1=_0x38ccc1||0x1f4;return function(_0xf501ac){logger[_0xf4c3('0x27')](_0xf501ac[_0xf4c3('0x28')]);if(_0xf501ac[_0xf4c3('0x29')]){delete _0xf501ac['name'];}_0x16320e[_0xf4c3('0x1b')](_0x38ccc1)['send'](_0xf501ac);};}exports[_0xf4c3('0x2a')]=function(_0x290dbe,_0x304292){var _0x444f12={},_0x458d69={},_0x327a0b={'count':0x0,'rows':[]};var _0x505514=_[_0xf4c3('0x2b')](db[_0xf4c3('0x2c')][_0xf4c3('0x2d')],function(_0x5287e9){return{'name':_0x5287e9[_0xf4c3('0x2e')],'type':_0x5287e9['type']['key']};});_0x458d69[_0xf4c3('0x2f')]=_[_0xf4c3('0x2b')](_0x505514,_0xf4c3('0x29'));_0x458d69[_0xf4c3('0x30')]=_[_0xf4c3('0x31')](_0x290dbe[_0xf4c3('0x30')]);_0x458d69['filters']=_[_0xf4c3('0x32')](_0x458d69[_0xf4c3('0x2f')],_0x458d69[_0xf4c3('0x30')]);_0x444f12[_0xf4c3('0x33')]=_['intersection'](_0x458d69[_0xf4c3('0x2f')],qs[_0xf4c3('0x34')](_0x290dbe[_0xf4c3('0x30')][_0xf4c3('0x34')]));_0x444f12[_0xf4c3('0x33')]=_0x444f12[_0xf4c3('0x33')][_0xf4c3('0x35')]?_0x444f12[_0xf4c3('0x33')]:_0x458d69[_0xf4c3('0x2f')];if(!_0x290dbe[_0xf4c3('0x30')][_0xf4c3('0x36')](_0xf4c3('0x37'))){_0x444f12[_0xf4c3('0x21')]=qs[_0xf4c3('0x21')](_0x290dbe[_0xf4c3('0x30')]['limit']);_0x444f12[_0xf4c3('0x1e')]=qs['offset'](_0x290dbe[_0xf4c3('0x30')]['offset']);}_0x444f12['order']=qs['sort'](_0x290dbe['query']['sort']);_0x444f12[_0xf4c3('0x38')]=qs[_0xf4c3('0x39')](_[_0xf4c3('0x3a')](_0x290dbe[_0xf4c3('0x30')],_0x458d69[_0xf4c3('0x39')]),_0x505514);if(_0x290dbe['query'][_0xf4c3('0x3b')]){_0x444f12[_0xf4c3('0x38')]=_[_0xf4c3('0x3c')](_0x444f12[_0xf4c3('0x38')],{'$or':_[_0xf4c3('0x2b')](_0x505514,function(_0x256dc4){if(_0x256dc4['type']!==_0xf4c3('0x3d')){var _0x538f52={};_0x538f52[_0x256dc4[_0xf4c3('0x29')]]={'$like':'%'+_0x290dbe['query'][_0xf4c3('0x3b')]+'%'};return _0x538f52;}})});}_0x444f12=_['merge']({},_0x444f12,_0x290dbe[_0xf4c3('0x3e')]);var _0x5e2062={'where':_0x444f12[_0xf4c3('0x38')]};return db[_0xf4c3('0x2c')][_0xf4c3('0x20')](_0x5e2062)[_0xf4c3('0x3f')](function(_0x36a9bc){_0x327a0b['count']=_0x36a9bc;if(_0x290dbe[_0xf4c3('0x30')][_0xf4c3('0x40')]){_0x444f12[_0xf4c3('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0xf4c3('0x42')](_0x444f12);})[_0xf4c3('0x3f')](function(_0x3ecaf0){_0x327a0b[_0xf4c3('0x43')]=_0x3ecaf0;return _0x327a0b;})['then'](respondWithFilteredResult(_0x304292,_0x444f12))[_0xf4c3('0x44')](handleError(_0x304292,null));};exports[_0xf4c3('0x45')]=function(_0x1bfcae,_0xaa38d){var _0x4a04d2={'raw':!![],'where':{'id':_0x1bfcae[_0xf4c3('0x46')]['id']}},_0x55f1ea={};_0x55f1ea[_0xf4c3('0x2f')]=_['keys'](db['VtigerField']['rawAttributes']);_0x55f1ea[_0xf4c3('0x30')]=_[_0xf4c3('0x31')](_0x1bfcae[_0xf4c3('0x30')]);_0x55f1ea[_0xf4c3('0x39')]=_[_0xf4c3('0x32')](_0x55f1ea['model'],_0x55f1ea[_0xf4c3('0x30')]);_0x4a04d2[_0xf4c3('0x33')]=_[_0xf4c3('0x32')](_0x55f1ea['model'],qs['fields'](_0x1bfcae[_0xf4c3('0x30')][_0xf4c3('0x34')]));_0x4a04d2[_0xf4c3('0x33')]=_0x4a04d2[_0xf4c3('0x33')][_0xf4c3('0x35')]?_0x4a04d2[_0xf4c3('0x33')]:_0x55f1ea['model'];if(_0x1bfcae['query'][_0xf4c3('0x40')]){_0x4a04d2[_0xf4c3('0x41')]=[{'all':!![]}];}_0x4a04d2=_[_0xf4c3('0x3c')]({},_0x4a04d2,_0x1bfcae[_0xf4c3('0x3e')]);return db['VtigerField'][_0xf4c3('0x47')](_0x4a04d2)[_0xf4c3('0x3f')](handleEntityNotFound(_0xaa38d,null))['then'](respondWithResult(_0xaa38d,null))[_0xf4c3('0x44')](handleError(_0xaa38d,null));};exports[_0xf4c3('0x48')]=function(_0x576e33,_0x104804){return db[_0xf4c3('0x2c')][_0xf4c3('0x48')](_0x576e33[_0xf4c3('0x49')],{})[_0xf4c3('0x3f')](respondWithResult(_0x104804,0xc9))['catch'](handleError(_0x104804,null));};exports[_0xf4c3('0x26')]=function(_0x122762,_0x39fa8d){if(_0x122762['body']['id']){delete _0x122762['body']['id'];}return db[_0xf4c3('0x2c')]['find']({'where':{'id':_0x122762[_0xf4c3('0x46')]['id']}})[_0xf4c3('0x3f')](handleEntityNotFound(_0x39fa8d,null))[_0xf4c3('0x3f')](saveUpdates(_0x122762['body'],null))[_0xf4c3('0x3f')](respondWithResult(_0x39fa8d,null))[_0xf4c3('0x44')](handleError(_0x39fa8d,null));};exports[_0xf4c3('0x4a')]=function(_0x3bda49,_0x504deb){return db[_0xf4c3('0x2c')][_0xf4c3('0x47')]({'where':{'id':_0x3bda49[_0xf4c3('0x46')]['id']}})['then'](handleEntityNotFound(_0x504deb,null))[_0xf4c3('0x3f')](removeEntity(_0x504deb,null))['catch'](handleError(_0x504deb,null));};
\ No newline at end of file
index 3c10c42..bfb7059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaec7=['int_vtiger_fields','idField','FieldId','lodash','util','api','moment','bluebird','path','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x2c921c,_0x3c6a85){var _0x440bf2=function(_0x4db0df){while(--_0x4db0df){_0x2c921c['push'](_0x2c921c['shift']());}};_0x440bf2(++_0x3c6a85);}(_0xaec7,0x17c));var _0x7aec=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0xaec7[_0xf91841];return _0x4b9c44;};'use strict';var _=require(_0x7aec('0x0'));var util=require(_0x7aec('0x1'));var logger=require('../../config/logger')(_0x7aec('0x2'));var moment=require(_0x7aec('0x3'));var BPromise=require(_0x7aec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7aec('0x5'));var rimraf=require('rimraf');var config=require(_0x7aec('0x6'));var attributes=require(_0x7aec('0x7'));module[_0x7aec('0x8')]=function(_0xf6ba35,_0x1a879c){return _0xf6ba35['define'](_0x7aec('0x9'),attributes,{'tableName':_0x7aec('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x7aec('0xb'),_0x7aec('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xff55=['bluebird','request-promise','path','rimraf','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','idField','util','../../config/logger'];(function(_0x5d9469,_0x1f6755){var _0x56f815=function(_0x3f82d6){while(--_0x3f82d6){_0x5d9469['push'](_0x5d9469['shift']());}};_0x56f815(++_0x1f6755);}(_0xff55,0x1c1));var _0x5ff5=function(_0x176c55,_0x32065c){_0x176c55=_0x176c55-0x0;var _0x44df9a=_0xff55[_0x176c55];return _0x44df9a;};'use strict';var _=require('lodash');var util=require(_0x5ff5('0x0'));var logger=require(_0x5ff5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5ff5('0x2'));var rp=require(_0x5ff5('0x3'));var fs=require('fs');var path=require(_0x5ff5('0x4'));var rimraf=require(_0x5ff5('0x5'));var config=require('../../config/environment');var attributes=require(_0x5ff5('0x6'));module['exports']=function(_0x59d9b8,_0x1165f2){return _0x59d9b8[_0x5ff5('0x7')](_0x5ff5('0x8'),attributes,{'tableName':_0x5ff5('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x5ff5('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 713addc..dee988a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1374=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerField,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x1ff7c0,_0x1974f3){var _0x25696a=function(_0x2b55e5){while(--_0x2b55e5){_0x1ff7c0['push'](_0x1ff7c0['shift']());}};_0x25696a(++_0x1974f3);}(_0x1374,0x1e0));var _0x4137=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1374[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x4137('0x0'));var util=require(_0x4137('0x1'));var moment=require(_0x4137('0x2'));var BPromise=require(_0x4137('0x3'));var rs=require(_0x4137('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4137('0x5'))(_0x4137('0x6'));var config=require(_0x4137('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4137('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b7188,_0x2ef80e,_0x214242){return new BPromise(function(_0xe6ef4e,_0x245325){return client[_0x4137('0x9')](_0x3b7188,_0x214242)['then'](function(_0x5bb986){logger[_0x4137('0xa')]('VtigerField,\x20%s,\x20%s',_0x2ef80e,_0x4137('0xb'));logger[_0x4137('0xc')](_0x4137('0xd'),_0x2ef80e,_0x4137('0xb'),JSON[_0x4137('0xe')](_0x5bb986));if(_0x5bb986[_0x4137('0xf')]){if(_0x5bb986[_0x4137('0xf')][_0x4137('0x10')]===0x1f4){logger[_0x4137('0xf')]('VtigerField,\x20%s,\x20%s',_0x2ef80e,_0x5bb986[_0x4137('0xf')][_0x4137('0x11')]);return _0x245325(_0x5bb986[_0x4137('0xf')][_0x4137('0x11')]);}logger['error'](_0x4137('0x12'),_0x2ef80e,_0x5bb986[_0x4137('0xf')][_0x4137('0x11')]);return _0xe6ef4e(_0x5bb986['error'][_0x4137('0x11')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x2ef80e,_0x4137('0xb'));_0xe6ef4e(_0x5bb986[_0x4137('0x13')][_0x4137('0x11')]);}})[_0x4137('0x14')](function(_0x501c40){logger[_0x4137('0xf')](_0x4137('0x12'),_0x2ef80e,_0x501c40);_0x245325(_0x501c40);});});}
\ No newline at end of file
+var _0x97fb=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1e46af,_0x2683a7){var _0x5016ae=function(_0x230ead){while(--_0x230ead){_0x1e46af['push'](_0x1e46af['shift']());}};_0x5016ae(++_0x2683a7);}(_0x97fb,0xf0));var _0xb97f=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x97fb[_0x4c2f17];return _0x20919e;};'use strict';var _=require('lodash');var util=require(_0xb97f('0x0'));var moment=require(_0xb97f('0x1'));var BPromise=require(_0xb97f('0x2'));var rs=require(_0xb97f('0x3'));var fs=require('fs');var Redis=require(_0xb97f('0x4'));var db=require(_0xb97f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb97f('0x6'))(_0xb97f('0x7'));var config=require(_0xb97f('0x8'));var jayson=require(_0xb97f('0x9'));var client=jayson[_0xb97f('0xa')][_0xb97f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbb6beb,_0x3d72f8,_0x1f8e0a){return new BPromise(function(_0x2eb7c1,_0x570e00){return client[_0xb97f('0xc')](_0xbb6beb,_0x1f8e0a)[_0xb97f('0xd')](function(_0x1e58e4){logger[_0xb97f('0xe')](_0xb97f('0xf'),_0x3d72f8,_0xb97f('0x10'));logger['debug'](_0xb97f('0x11'),_0x3d72f8,_0xb97f('0x10'),JSON[_0xb97f('0x12')](_0x1e58e4));if(_0x1e58e4['error']){if(_0x1e58e4[_0xb97f('0x13')][_0xb97f('0x14')]===0x1f4){logger[_0xb97f('0x13')](_0xb97f('0xf'),_0x3d72f8,_0x1e58e4['error'][_0xb97f('0x15')]);return _0x570e00(_0x1e58e4['error']['message']);}logger[_0xb97f('0x13')]('VtigerField,\x20%s,\x20%s',_0x3d72f8,_0x1e58e4[_0xb97f('0x13')][_0xb97f('0x15')]);return _0x2eb7c1(_0x1e58e4['error'][_0xb97f('0x15')]);}else{logger[_0xb97f('0xe')](_0xb97f('0xf'),_0x3d72f8,_0xb97f('0x10'));_0x2eb7c1(_0x1e58e4[_0xb97f('0x16')][_0xb97f('0x15')]);}})[_0xb97f('0x17')](function(_0x39e850){logger['error'](_0xb97f('0xf'),_0x3d72f8,_0x39e850);_0x570e00(_0x39e850);});});}
\ No newline at end of file
index f8b6438..cc35b51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a96=['/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations'];(function(_0x254c7e,_0x3744b5){var _0xd7c8d7=function(_0x51ad70){while(--_0x51ad70){_0x254c7e['push'](_0x254c7e['shift']());}};_0xd7c8d7(++_0x3744b5);}(_0x9a96,0xd0));var _0x69a9=function(_0x570c3b,_0x21e92c){_0x570c3b=_0x570c3b-0x0;var _0xd0c93f=_0x9a96[_0x570c3b];return _0xd0c93f;};'use strict';var multer=require(_0x69a9('0x0'));var util=require(_0x69a9('0x1'));var path=require(_0x69a9('0x2'));var timeout=require(_0x69a9('0x3'));var express=require(_0x69a9('0x4'));var router=express[_0x69a9('0x5')]();var fs_extra=require(_0x69a9('0x6'));var auth=require(_0x69a9('0x7'));var interaction=require(_0x69a9('0x8'));var config=require(_0x69a9('0x9'));var controller=require(_0x69a9('0xa'));router[_0x69a9('0xb')]('/',auth['isAuthenticated'](),controller[_0x69a9('0xc')]);router[_0x69a9('0xb')](_0x69a9('0xd'),auth[_0x69a9('0xe')](),controller['show']);router[_0x69a9('0xb')](_0x69a9('0xf'),auth[_0x69a9('0xe')](),controller[_0x69a9('0x10')]);router[_0x69a9('0xb')](_0x69a9('0x11'),auth[_0x69a9('0xe')](),controller['getFields']);router[_0x69a9('0x12')]('/',auth['isAuthenticated'](),controller[_0x69a9('0x13')]);router[_0x69a9('0x12')](_0x69a9('0xf'),auth['isAuthenticated'](),controller[_0x69a9('0x14')]);router[_0x69a9('0x15')](_0x69a9('0xd'),auth[_0x69a9('0xe')](),controller[_0x69a9('0x16')]);router[_0x69a9('0x17')](_0x69a9('0xd'),auth[_0x69a9('0xe')](),controller['destroy']);module[_0x69a9('0x18')]=router;
\ No newline at end of file
+var _0x1d8e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','destroy','exports','multer','util','path'];(function(_0x58e5eb,_0x182e0d){var _0x62cb5d=function(_0x4b2ceb){while(--_0x4b2ceb){_0x58e5eb['push'](_0x58e5eb['shift']());}};_0x62cb5d(++_0x182e0d);}(_0x1d8e,0xcc));var _0xe1d8=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x1d8e[_0x149a9b];return _0x2c2bf6;};'use strict';var multer=require(_0xe1d8('0x0'));var util=require(_0xe1d8('0x1'));var path=require(_0xe1d8('0x2'));var timeout=require(_0xe1d8('0x3'));var express=require(_0xe1d8('0x4'));var router=express[_0xe1d8('0x5')]();var fs_extra=require(_0xe1d8('0x6'));var auth=require(_0xe1d8('0x7'));var interaction=require(_0xe1d8('0x8'));var config=require(_0xe1d8('0x9'));var controller=require('./intZendeskAccount.controller');router[_0xe1d8('0xa')]('/',auth[_0xe1d8('0xb')](),controller[_0xe1d8('0xc')]);router[_0xe1d8('0xa')](_0xe1d8('0xd'),auth['isAuthenticated'](),controller[_0xe1d8('0xe')]);router[_0xe1d8('0xa')](_0xe1d8('0xf'),auth[_0xe1d8('0xb')](),controller[_0xe1d8('0x10')]);router['get'](_0xe1d8('0x11'),auth[_0xe1d8('0xb')](),controller[_0xe1d8('0x12')]);router['post']('/',auth[_0xe1d8('0xb')](),controller[_0xe1d8('0x13')]);router[_0xe1d8('0x14')](_0xe1d8('0xf'),auth[_0xe1d8('0xb')](),controller['addConfiguration']);router['put'](_0xe1d8('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe1d8('0xd'),auth[_0xe1d8('0xb')](),controller[_0xe1d8('0x15')]);module[_0xe1d8('0x16')]=router;
\ No newline at end of file
index 6f634f2..912e5fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf06c=['password','token','integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x1f237,_0x2df783){var _0x123209=function(_0x537bce){while(--_0x537bce){_0x1f237['push'](_0x1f237['shift']());}};_0x123209(++_0x2df783);}(_0xf06c,0xc7));var _0xcf06=function(_0x20346f,_0x20cb21){_0x20346f=_0x20346f-0x0;var _0x46c599=_0xf06c[_0x20346f];return _0x46c599;};'use strict';var Sequelize=require(_0xcf06('0x0'));module[_0xcf06('0x1')]={'name':{'type':Sequelize[_0xcf06('0x2')]},'description':{'type':Sequelize[_0xcf06('0x2')]},'username':{'type':Sequelize[_0xcf06('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xcf06('0x2')]},'token':{'type':Sequelize[_0xcf06('0x2')]},'remoteUri':{'type':Sequelize[_0xcf06('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xcf06('0x3')](_0xcf06('0x4'),_0xcf06('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xcf06('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xcf06('0x6'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x8ace=['password','token','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x435565,_0x7cfb2c){var _0xab6bfa=function(_0xf44994){while(--_0xf44994){_0x435565['push'](_0x435565['shift']());}};_0xab6bfa(++_0x7cfb2c);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x284885,_0x34b143){_0x284885=_0x284885-0x0;var _0x3a9710=_0x8ace[_0x284885];return _0x3a9710;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'name':{'type':Sequelize[_0xe8ac('0x2')]},'description':{'type':Sequelize[_0xe8ac('0x2')]},'username':{'type':Sequelize[_0xe8ac('0x2')],'unique':_0xe8ac('0x3')},'password':{'type':Sequelize[_0xe8ac('0x2')]},'token':{'type':Sequelize[_0xe8ac('0x2')]},'remoteUri':{'type':Sequelize[_0xe8ac('0x2')],'unique':_0xe8ac('0x4')},'authType':{'type':Sequelize[_0xe8ac('0x5')](_0xe8ac('0x6'),_0xe8ac('0x7')),'defaultValue':_0xe8ac('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe8ac('0x5')](_0xe8ac('0x8'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 404a689..b50c10b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb5=['offset','limit','undefined','count','set','json','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','ZendeskAccount','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','authType','remoteUri','substring','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x226171,_0x324758){var _0x21e5b2=function(_0x3d7aa2){while(--_0x3d7aa2){_0x226171['push'](_0x226171['shift']());}};_0x21e5b2(++_0x324758);}(_0x0bb5,0x148));var _0x50bb=function(_0x43c254,_0x17507a){_0x43c254=_0x43c254-0x0;var _0xe856d9=_0x0bb5[_0x43c254];return _0xe856d9;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x50bb('0x19'));function respondWithStatusCode(_0x58837d,_0x283f04){_0x283f04=_0x283f04||0xcc;return function(_0xd8ab27){if(_0xd8ab27){return _0x58837d[_0x50bb('0x1a')](_0x283f04);}return _0x58837d['status'](_0x283f04)[_0x50bb('0x1b')]();};}function respondWithResult(_0x309986,_0x3094f2){_0x3094f2=_0x3094f2||0xc8;return function(_0x5244b0){if(_0x5244b0){return _0x309986[_0x50bb('0x1c')](_0x3094f2)['json'](_0x5244b0);}};}function respondWithFilteredResult(_0x21befa,_0x3e1a51){return function(_0x253073){if(_0x253073){var _0x42ffab=typeof _0x3e1a51[_0x50bb('0x1d')]==='undefined'&&typeof _0x3e1a51[_0x50bb('0x1e')]===_0x50bb('0x1f');var _0x4b1f5f=_0x253073[_0x50bb('0x20')];var _0x4796ec=_0x42ffab?0x0:_0x3e1a51[_0x50bb('0x1d')];var _0x431ed4=_0x42ffab?_0x253073['count']:_0x3e1a51['offset']+_0x3e1a51[_0x50bb('0x1e')];var _0x1499dc;if(_0x431ed4>=_0x4b1f5f){_0x431ed4=_0x4b1f5f;_0x1499dc=0xc8;}else{_0x1499dc=0xce;}_0x21befa[_0x50bb('0x1c')](_0x1499dc);return _0x21befa[_0x50bb('0x21')]('Content-Range',_0x4796ec+'-'+_0x431ed4+'/'+_0x4b1f5f)[_0x50bb('0x22')](_0x253073);}return null;};}function patchUpdates(_0x32bfc3){return function(_0x4020a0){try{jsonpatch['apply'](_0x4020a0,_0x32bfc3,!![]);}catch(_0x3104c8){return BPromise[_0x50bb('0x23')](_0x3104c8);}return _0x4020a0[_0x50bb('0x24')]();};}function saveUpdates(_0x4825f8,_0x1dbba2){return function(_0x4cc7f9){if(_0x4cc7f9){return _0x4cc7f9[_0x50bb('0x25')](_0x4825f8)[_0x50bb('0x26')](function(_0x1a2a0b){return _0x1a2a0b;});}return null;};}function removeEntity(_0x2ee87a,_0x846311){return function(_0x342078){if(_0x342078){return _0x342078['destroy']()[_0x50bb('0x26')](function(){_0x2ee87a[_0x50bb('0x1c')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x3462c1,_0x5234d7){return function(_0x75fea6){if(!_0x75fea6){_0x3462c1['sendStatus'](0x194);}return _0x75fea6;};}function handleError(_0x55e87b,_0x2befd9){_0x2befd9=_0x2befd9||0x1f4;return function(_0x491632){logger['error'](_0x491632[_0x50bb('0x27')]);if(_0x491632[_0x50bb('0x28')]){delete _0x491632[_0x50bb('0x28')];}_0x55e87b[_0x50bb('0x1c')](_0x2befd9)[_0x50bb('0x29')](_0x491632);};}exports[_0x50bb('0x2a')]=function(_0x41a8ad,_0x41d479){var _0x4f7514={},_0x44ce86={},_0x461cf3={'count':0x0,'rows':[]};var _0x15ee2e=_[_0x50bb('0x2b')](db['ZendeskAccount'][_0x50bb('0x2c')],function(_0x1a62fb){return{'name':_0x1a62fb[_0x50bb('0x2d')],'type':_0x1a62fb[_0x50bb('0x2e')][_0x50bb('0x2f')]};});_0x44ce86[_0x50bb('0x30')]=_[_0x50bb('0x2b')](_0x15ee2e,_0x50bb('0x28'));_0x44ce86[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x41a8ad[_0x50bb('0x31')]);_0x44ce86[_0x50bb('0x33')]=_['intersection'](_0x44ce86[_0x50bb('0x30')],_0x44ce86[_0x50bb('0x31')]);_0x4f7514[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x44ce86[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x36')]));_0x4f7514[_0x50bb('0x34')]=_0x4f7514[_0x50bb('0x34')][_0x50bb('0x37')]?_0x4f7514['attributes']:_0x44ce86[_0x50bb('0x30')];if(!_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x38')](_0x50bb('0x39'))){_0x4f7514[_0x50bb('0x1e')]=qs[_0x50bb('0x1e')](_0x41a8ad['query']['limit']);_0x4f7514[_0x50bb('0x1d')]=qs['offset'](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x1d')]);}_0x4f7514[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x41a8ad[_0x50bb('0x31')]['sort']);_0x4f7514[_0x50bb('0x3c')]=qs['filters'](_[_0x50bb('0x3d')](_0x41a8ad[_0x50bb('0x31')],_0x44ce86[_0x50bb('0x33')]),_0x15ee2e);if(_0x41a8ad['query']['filter']){_0x4f7514[_0x50bb('0x3c')]=_[_0x50bb('0x3e')](_0x4f7514[_0x50bb('0x3c')],{'$or':_[_0x50bb('0x2b')](_0x15ee2e,function(_0x51750b){if(_0x51750b[_0x50bb('0x2e')]!=='VIRTUAL'){var _0x52059b={};_0x52059b[_0x51750b[_0x50bb('0x28')]]={'$like':'%'+_0x41a8ad['query'][_0x50bb('0x3f')]+'%'};return _0x52059b;}})});}_0x4f7514=_[_0x50bb('0x3e')]({},_0x4f7514,_0x41a8ad[_0x50bb('0x40')]);var _0x1f156e={'where':_0x4f7514[_0x50bb('0x3c')]};return db[_0x50bb('0x41')][_0x50bb('0x20')](_0x1f156e)[_0x50bb('0x26')](function(_0x46039a){_0x461cf3[_0x50bb('0x20')]=_0x46039a;if(_0x41a8ad['query']['includeAll']){_0x4f7514[_0x50bb('0x42')]=[{'all':!![]}];}return db[_0x50bb('0x41')][_0x50bb('0x43')](_0x4f7514);})[_0x50bb('0x26')](function(_0x5e8085){_0x461cf3[_0x50bb('0x44')]=_0x5e8085;return _0x461cf3;})['then'](respondWithFilteredResult(_0x41d479,_0x4f7514))[_0x50bb('0x45')](handleError(_0x41d479,null));};exports[_0x50bb('0x46')]=function(_0x379944,_0x40748d){var _0x1c438b={'raw':![],'where':{'id':_0x379944[_0x50bb('0x47')]['id']}},_0x355726={};_0x355726[_0x50bb('0x30')]=_[_0x50bb('0x32')](db[_0x50bb('0x41')][_0x50bb('0x2c')]);_0x355726[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x379944[_0x50bb('0x31')]);_0x355726[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x355726['model'],_0x355726[_0x50bb('0x31')]);_0x1c438b['attributes']=_[_0x50bb('0x35')](_0x355726[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x379944[_0x50bb('0x31')][_0x50bb('0x36')]));_0x1c438b[_0x50bb('0x34')]=_0x1c438b[_0x50bb('0x34')][_0x50bb('0x37')]?_0x1c438b[_0x50bb('0x34')]:_0x355726[_0x50bb('0x30')];if(_0x379944[_0x50bb('0x31')][_0x50bb('0x48')]){_0x1c438b[_0x50bb('0x42')]=[{'all':!![]}];}_0x1c438b=_[_0x50bb('0x3e')]({},_0x1c438b,_0x379944['options']);return db[_0x50bb('0x41')]['find'](_0x1c438b)[_0x50bb('0x26')](handleEntityNotFound(_0x40748d,null))[_0x50bb('0x26')](respondWithResult(_0x40748d,null))[_0x50bb('0x45')](handleError(_0x40748d,null));};exports[_0x50bb('0x49')]=function(_0x650e91,_0x39ac1a){return db[_0x50bb('0x41')][_0x50bb('0x49')](_0x650e91['body'],{})[_0x50bb('0x26')](respondWithResult(_0x39ac1a,0xc9))[_0x50bb('0x45')](handleError(_0x39ac1a,null));};exports[_0x50bb('0x25')]=function(_0x13afe2,_0x3659c4){if(_0x13afe2['body']['id']){delete _0x13afe2[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x13afe2[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3659c4,null))['then'](saveUpdates(_0x13afe2['body'],null))[_0x50bb('0x26')](respondWithResult(_0x3659c4,null))['catch'](handleError(_0x3659c4,null));};exports[_0x50bb('0x4c')]=function(_0x57ee0e,_0x4316e4){return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x57ee0e['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x4316e4,null))[_0x50bb('0x26')](removeEntity(_0x4316e4,null))['catch'](handleError(_0x4316e4,null));};exports[_0x50bb('0x4d')]=function(_0x1dff6a,_0x8d62af,_0x3c525c){var _0x55a4a6={};var _0x33e71f={};var _0x46b51e;var _0x2e0032;return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x1dff6a['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x8d62af,null))['then'](function(_0x38a775){if(_0x38a775){_0x46b51e=_0x38a775;_0x33e71f['model']=_['keys'](db[_0x50bb('0x4f')]['rawAttributes']);_0x33e71f['query']=_[_0x50bb('0x32')](_0x1dff6a[_0x50bb('0x31')]);_0x33e71f[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x33e71f[_0x50bb('0x30')],_0x33e71f[_0x50bb('0x31')]);_0x55a4a6[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x33e71f['model'],qs['fields'](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x36')]));_0x55a4a6[_0x50bb('0x34')]=_0x55a4a6[_0x50bb('0x34')][_0x50bb('0x37')]?_0x55a4a6[_0x50bb('0x34')]:_0x33e71f[_0x50bb('0x30')];_0x55a4a6['order']=qs[_0x50bb('0x3b')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3b')]);_0x55a4a6[_0x50bb('0x3c')]=qs[_0x50bb('0x33')](_['pick'](_0x1dff6a[_0x50bb('0x31')],_0x33e71f[_0x50bb('0x33')]));if(_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]){_0x55a4a6[_0x50bb('0x3c')]=_['merge'](_0x55a4a6[_0x50bb('0x3c')],{'$or':_['map'](_0x55a4a6['attributes'],function(_0x170761){var _0x3057f2={};_0x3057f2[_0x170761]={'$like':'%'+_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]+'%'};return _0x3057f2;})});}_0x55a4a6=_[_0x50bb('0x3e')]({},_0x55a4a6,_0x1dff6a[_0x50bb('0x40')]);return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x330299){if(_0x330299){_0x2e0032=_0x330299[_0x50bb('0x37')];if(!_0x1dff6a[_0x50bb('0x31')]['hasOwnProperty'](_0x50bb('0x39'))){_0x55a4a6['limit']=qs[_0x50bb('0x1e')](_0x1dff6a[_0x50bb('0x31')]['limit']);_0x55a4a6[_0x50bb('0x1d')]=qs[_0x50bb('0x1d')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x1d')]);}return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x2b7df6){if(_0x2b7df6){return _0x2b7df6?{'count':_0x2e0032,'rows':_0x2b7df6}:null;}})[_0x50bb('0x26')](respondWithResult(_0x8d62af,null))['catch'](handleError(_0x8d62af,null));};exports[_0x50bb('0x50')]=function(_0x2dc832,_0x3b17c8,_0x4a226d){if(_0x2dc832[_0x50bb('0x4a')]['id']){delete _0x2dc832[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x2dc832[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3b17c8,null))['then'](function(_0xf47641){if(_0xf47641){_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x51')]=_0xf47641['id'];_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x52')]=integrations[_0x50bb('0x53')](_0x2dc832['body'][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x2e')]);_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x55')]=integrations[_0x50bb('0x56')](_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')]['type']);return db[_0x50bb('0x4f')][_0x50bb('0x49')](_0x2dc832[_0x50bb('0x4a')],{'include':[{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x52')},{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x55')}]});}return null;})[_0x50bb('0x26')](respondWithResult(_0x3b17c8,null))[_0x50bb('0x45')](handleError(_0x3b17c8,null));};exports['getFields']=function(_0x58ad41,_0x5babbc,_0x4159ad){var _0x5ba597='';return db['ZendeskAccount'][_0x50bb('0x4e')]({'where':{'id':_0x58ad41[_0x50bb('0x47')]['id']},'attributes':['id',_0x50bb('0x58'),_0x50bb('0x59'),'token',_0x50bb('0x5a'),_0x50bb('0x5b')]})['then'](handleEntityNotFound(_0x5babbc,null))[_0x50bb('0x26')](function(_0x51e64f){if(_0x51e64f){_0x5ba597=_0x51e64f[_0x50bb('0x5b')];var _0x239a82=_0x5ba597['slice'](-0x1);if(_0x239a82==='/'){_0x5ba597=_0x5ba597[_0x50bb('0x5c')](0x0,_0x5ba597['lastIndexOf'](_0x239a82));}var _0x8f5df6={'method':_0x50bb('0x5d'),'uri':util['format'](_0x50bb('0x5e'),_0x5ba597,_0x50bb('0x5f')),'json':!![]};switch(_0x51e64f[_0x50bb('0x5a')]){case'password':_0x8f5df6[_0x50bb('0x60')]={'Authorization':util[_0x50bb('0x61')](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')]('%s:%s',_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x59')]))['toString']('base64'))};break;case _0x50bb('0x63'):_0x8f5df6[_0x50bb('0x60')]={'Authorization':util['format'](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')](_0x50bb('0x64'),_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x63')]))['toString']('base64'))};break;default:throw new db[(_0x50bb('0x65'))][(_0x50bb('0x66'))](_0x50bb('0x67'));}return rp(_0x8f5df6);}})[_0x50bb('0x26')](function(_0x4b51d4){if(_0x4b51d4){var _0x1975f7=['subject',_0x50bb('0x68'),_0x50bb('0x69'),_0x50bb('0x6a')];_[_0x50bb('0x6b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x217170){return _0x1975f7[_0x50bb('0x6c')](_0x217170['type']);});return{'count':_0x4b51d4[_0x50bb('0x5f')][_0x50bb('0x37')],'rows':_[_0x50bb('0x2b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x5d2dc4){return{'id':_0x5d2dc4['id'],'name':_0x5d2dc4[_0x50bb('0x6d')]>0x7?_0x5d2dc4[_0x50bb('0x6e')]:_0x5d2dc4['type'],'custom':_0x5d2dc4[_0x50bb('0x6d')]>0x7?!![]:![],'options':_0x5d2dc4[_0x50bb('0x6f')]?_0x5d2dc4[_0x50bb('0x6f')]:_0x5d2dc4[_0x50bb('0x70')]?_0x5d2dc4[_0x50bb('0x70')]:[]};})};}})['then'](respondWithResult(_0x5babbc,null))['catch'](function(_0x145cf8){var _0x47e80f=_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?0x1f4:_0x145cf8['statusCode']||0x1f4;logger['error'](_0x50bb('0x72'),_0x50bb('0x73'),_0x47e80f,JSON[_0x50bb('0x74')](_0x145cf8));delete _0x145cf8['name'];if(_0x47e80f===0x191){_0x47e80f=0x190;}_0x5babbc[_0x50bb('0x1c')](_0x47e80f)[_0x50bb('0x29')](_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?{'message':_0x50bb('0x75'),'statusCode':_0x145cf8[_0x50bb('0x76')]}:_0x145cf8);});};
\ No newline at end of file
+var _0xbc9d=['merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','find','create','update','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','getSubjects','channel','ZendeskField','Subjects','Descriptions','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','%s:%s','toString','base64','Basic\x20%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','send','index','ZendeskAccount','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0xbc9d,0xb4));var _0xdbc9=function(_0xb66336,_0x513d65){_0xb66336=_0xb66336-0x0;var _0x253665=_0xbc9d[_0xb66336];return _0x253665;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];var integrations=require(_0xdbc9('0x19'));function respondWithStatusCode(_0x48bc83,_0x567e71){_0x567e71=_0x567e71||0xcc;return function(_0x3d0fdd){if(_0x3d0fdd){return _0x48bc83[_0xdbc9('0x1a')](_0x567e71);}return _0x48bc83[_0xdbc9('0x1b')](_0x567e71)[_0xdbc9('0x1c')]();};}function respondWithResult(_0x53495d,_0x4a9dcb){_0x4a9dcb=_0x4a9dcb||0xc8;return function(_0x2b7bd){if(_0x2b7bd){return _0x53495d[_0xdbc9('0x1b')](_0x4a9dcb)[_0xdbc9('0x1d')](_0x2b7bd);}};}function respondWithFilteredResult(_0x4c7b4f,_0x1b4616){return function(_0x1abee8){if(_0x1abee8){var _0x4fdb81=typeof _0x1b4616[_0xdbc9('0x1e')]===_0xdbc9('0x1f')&&typeof _0x1b4616[_0xdbc9('0x20')]===_0xdbc9('0x1f');var _0x1f22f4=_0x1abee8[_0xdbc9('0x21')];var _0x9f343d=_0x4fdb81?0x0:_0x1b4616[_0xdbc9('0x1e')];var _0x2ad952=_0x4fdb81?_0x1abee8[_0xdbc9('0x21')]:_0x1b4616['offset']+_0x1b4616[_0xdbc9('0x20')];var _0x497be2;if(_0x2ad952>=_0x1f22f4){_0x2ad952=_0x1f22f4;_0x497be2=0xc8;}else{_0x497be2=0xce;}_0x4c7b4f[_0xdbc9('0x1b')](_0x497be2);return _0x4c7b4f[_0xdbc9('0x22')]('Content-Range',_0x9f343d+'-'+_0x2ad952+'/'+_0x1f22f4)[_0xdbc9('0x1d')](_0x1abee8);}return null;};}function patchUpdates(_0x5367dc){return function(_0x569f32){try{jsonpatch['apply'](_0x569f32,_0x5367dc,!![]);}catch(_0x4f3b5d){return BPromise[_0xdbc9('0x23')](_0x4f3b5d);}return _0x569f32[_0xdbc9('0x24')]();};}function saveUpdates(_0x570ad9,_0x16dcf7){return function(_0x20563e){if(_0x20563e){return _0x20563e['update'](_0x570ad9)[_0xdbc9('0x25')](function(_0x6b788){return _0x6b788;});}return null;};}function removeEntity(_0x1b1c0d,_0x119230){return function(_0x3400e7){if(_0x3400e7){return _0x3400e7[_0xdbc9('0x26')]()[_0xdbc9('0x25')](function(){_0x1b1c0d[_0xdbc9('0x1b')](0xcc)[_0xdbc9('0x1c')]();});}};}function handleEntityNotFound(_0x4a868b,_0x550bef){return function(_0xe309ae){if(!_0xe309ae){_0x4a868b[_0xdbc9('0x1a')](0x194);}return _0xe309ae;};}function handleError(_0x1053ca,_0x24fdec){_0x24fdec=_0x24fdec||0x1f4;return function(_0x50c3ee){logger[_0xdbc9('0x27')](_0x50c3ee[_0xdbc9('0x28')]);if(_0x50c3ee['name']){delete _0x50c3ee['name'];}_0x1053ca[_0xdbc9('0x1b')](_0x24fdec)[_0xdbc9('0x29')](_0x50c3ee);};}exports[_0xdbc9('0x2a')]=function(_0x59bfd2,_0x13a432){var _0x539e57={},_0x561f8e={},_0x210a40={'count':0x0,'rows':[]};var _0x49da36=_['map'](db[_0xdbc9('0x2b')][_0xdbc9('0x2c')],function(_0x1cb557){return{'name':_0x1cb557['fieldName'],'type':_0x1cb557[_0xdbc9('0x2d')][_0xdbc9('0x2e')]};});_0x561f8e['model']=_['map'](_0x49da36,_0xdbc9('0x2f'));_0x561f8e[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x59bfd2[_0xdbc9('0x30')]);_0x561f8e[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x561f8e[_0xdbc9('0x34')],_0x561f8e['query']);_0x539e57[_0xdbc9('0x35')]=_[_0xdbc9('0x33')](_0x561f8e[_0xdbc9('0x34')],qs[_0xdbc9('0x36')](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x36')]));_0x539e57['attributes']=_0x539e57[_0xdbc9('0x35')]['length']?_0x539e57['attributes']:_0x561f8e['model'];if(!_0x59bfd2['query']['hasOwnProperty'](_0xdbc9('0x37'))){_0x539e57[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x59bfd2['query'][_0xdbc9('0x20')]);_0x539e57[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x1e')]);}_0x539e57[_0xdbc9('0x38')]=qs['sort'](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x39')]);_0x539e57[_0xdbc9('0x3a')]=qs['filters'](_[_0xdbc9('0x3b')](_0x59bfd2[_0xdbc9('0x30')],_0x561f8e[_0xdbc9('0x32')]),_0x49da36);if(_0x59bfd2[_0xdbc9('0x30')]['filter']){_0x539e57['where']=_[_0xdbc9('0x3c')](_0x539e57[_0xdbc9('0x3a')],{'$or':_[_0xdbc9('0x3d')](_0x49da36,function(_0x1ef970){if(_0x1ef970['type']!==_0xdbc9('0x3e')){var _0x3827be={};_0x3827be[_0x1ef970[_0xdbc9('0x2f')]]={'$like':'%'+_0x59bfd2['query'][_0xdbc9('0x3f')]+'%'};return _0x3827be;}})});}_0x539e57=_[_0xdbc9('0x3c')]({},_0x539e57,_0x59bfd2[_0xdbc9('0x40')]);var _0x523c79={'where':_0x539e57[_0xdbc9('0x3a')]};return db[_0xdbc9('0x2b')]['count'](_0x523c79)['then'](function(_0xfc34d5){_0x210a40[_0xdbc9('0x21')]=_0xfc34d5;if(_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x41')]){_0x539e57['include']=[{'all':!![]}];}return db[_0xdbc9('0x2b')][_0xdbc9('0x42')](_0x539e57);})['then'](function(_0x8445b8){_0x210a40[_0xdbc9('0x43')]=_0x8445b8;return _0x210a40;})['then'](respondWithFilteredResult(_0x13a432,_0x539e57))[_0xdbc9('0x44')](handleError(_0x13a432,null));};exports[_0xdbc9('0x45')]=function(_0x2adb23,_0x3415c3){var _0x3ed4de={'raw':![],'where':{'id':_0x2adb23[_0xdbc9('0x46')]['id']}},_0x1cd538={};_0x1cd538['model']=_['keys'](db[_0xdbc9('0x2b')][_0xdbc9('0x2c')]);_0x1cd538[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x2adb23[_0xdbc9('0x30')]);_0x1cd538[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x1cd538[_0xdbc9('0x34')],_0x1cd538[_0xdbc9('0x30')]);_0x3ed4de[_0xdbc9('0x35')]=_[_0xdbc9('0x33')](_0x1cd538['model'],qs['fields'](_0x2adb23[_0xdbc9('0x30')][_0xdbc9('0x36')]));_0x3ed4de[_0xdbc9('0x35')]=_0x3ed4de[_0xdbc9('0x35')][_0xdbc9('0x47')]?_0x3ed4de[_0xdbc9('0x35')]:_0x1cd538[_0xdbc9('0x34')];if(_0x2adb23[_0xdbc9('0x30')]['includeAll']){_0x3ed4de['include']=[{'all':!![]}];}_0x3ed4de=_[_0xdbc9('0x3c')]({},_0x3ed4de,_0x2adb23[_0xdbc9('0x40')]);return db[_0xdbc9('0x2b')][_0xdbc9('0x48')](_0x3ed4de)[_0xdbc9('0x25')](handleEntityNotFound(_0x3415c3,null))[_0xdbc9('0x25')](respondWithResult(_0x3415c3,null))[_0xdbc9('0x44')](handleError(_0x3415c3,null));};exports[_0xdbc9('0x49')]=function(_0x43e3ec,_0x589557){return db[_0xdbc9('0x2b')][_0xdbc9('0x49')](_0x43e3ec['body'],{})['then'](respondWithResult(_0x589557,0xc9))[_0xdbc9('0x44')](handleError(_0x589557,null));};exports[_0xdbc9('0x4a')]=function(_0x133a13,_0x49a55c){if(_0x133a13[_0xdbc9('0x4b')]['id']){delete _0x133a13[_0xdbc9('0x4b')]['id'];}return db[_0xdbc9('0x2b')][_0xdbc9('0x48')]({'where':{'id':_0x133a13['params']['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x49a55c,null))[_0xdbc9('0x25')](saveUpdates(_0x133a13[_0xdbc9('0x4b')],null))[_0xdbc9('0x25')](respondWithResult(_0x49a55c,null))['catch'](handleError(_0x49a55c,null));};exports[_0xdbc9('0x26')]=function(_0x36c70e,_0x3f49b7){return db[_0xdbc9('0x2b')][_0xdbc9('0x48')]({'where':{'id':_0x36c70e[_0xdbc9('0x46')]['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x3f49b7,null))[_0xdbc9('0x25')](removeEntity(_0x3f49b7,null))['catch'](handleError(_0x3f49b7,null));};exports[_0xdbc9('0x4c')]=function(_0x4d09e1,_0x3f493e,_0x4279bc){var _0x53771a={};var _0x561737={};var _0xc7335d;var _0x4b55df;return db[_0xdbc9('0x2b')][_0xdbc9('0x4d')]({'where':{'id':_0x4d09e1[_0xdbc9('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f493e,null))[_0xdbc9('0x25')](function(_0x1c52e6){if(_0x1c52e6){_0xc7335d=_0x1c52e6;_0x561737[_0xdbc9('0x34')]=_[_0xdbc9('0x31')](db[_0xdbc9('0x4e')][_0xdbc9('0x2c')]);_0x561737[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x4d09e1['query']);_0x561737['filters']=_['intersection'](_0x561737[_0xdbc9('0x34')],_0x561737[_0xdbc9('0x30')]);_0x53771a[_0xdbc9('0x35')]=_['intersection'](_0x561737['model'],qs[_0xdbc9('0x36')](_0x4d09e1[_0xdbc9('0x30')]['fields']));_0x53771a['attributes']=_0x53771a[_0xdbc9('0x35')][_0xdbc9('0x47')]?_0x53771a[_0xdbc9('0x35')]:_0x561737[_0xdbc9('0x34')];_0x53771a[_0xdbc9('0x38')]=qs[_0xdbc9('0x39')](_0x4d09e1['query'][_0xdbc9('0x39')]);_0x53771a[_0xdbc9('0x3a')]=qs[_0xdbc9('0x32')](_['pick'](_0x4d09e1[_0xdbc9('0x30')],_0x561737[_0xdbc9('0x32')]));if(_0x4d09e1[_0xdbc9('0x30')]['filter']){_0x53771a[_0xdbc9('0x3a')]=_['merge'](_0x53771a[_0xdbc9('0x3a')],{'$or':_[_0xdbc9('0x3d')](_0x53771a[_0xdbc9('0x35')],function(_0x26ed1c){var _0x148061={};_0x148061[_0x26ed1c]={'$like':'%'+_0x4d09e1[_0xdbc9('0x30')]['filter']+'%'};return _0x148061;})});}_0x53771a=_[_0xdbc9('0x3c')]({},_0x53771a,_0x4d09e1['options']);return _0xc7335d[_0xdbc9('0x4c')](_0x53771a);}})[_0xdbc9('0x25')](function(_0x53fcd6){if(_0x53fcd6){_0x4b55df=_0x53fcd6[_0xdbc9('0x47')];if(!_0x4d09e1[_0xdbc9('0x30')]['hasOwnProperty']('nolimit')){_0x53771a[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x4d09e1[_0xdbc9('0x30')]['limit']);_0x53771a[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x4d09e1['query'][_0xdbc9('0x1e')]);}return _0xc7335d[_0xdbc9('0x4c')](_0x53771a);}})['then'](function(_0x4876f9){if(_0x4876f9){return _0x4876f9?{'count':_0x4b55df,'rows':_0x4876f9}:null;}})[_0xdbc9('0x25')](respondWithResult(_0x3f493e,null))[_0xdbc9('0x44')](handleError(_0x3f493e,null));};exports[_0xdbc9('0x4f')]=function(_0xa8b4d9,_0x3e93d3,_0x14cbf4){if(_0xa8b4d9[_0xdbc9('0x4b')]['id']){delete _0xa8b4d9[_0xdbc9('0x4b')]['id'];}return db['ZendeskAccount'][_0xdbc9('0x4d')]({'where':{'id':_0xa8b4d9[_0xdbc9('0x46')]['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x3e93d3,null))[_0xdbc9('0x25')](function(_0x38f7da){if(_0x38f7da){_0xa8b4d9[_0xdbc9('0x4b')][_0xdbc9('0x50')]=_0x38f7da['id'];_0xa8b4d9[_0xdbc9('0x4b')]['Subjects']=integrations[_0xdbc9('0x51')](_0xa8b4d9['body'][_0xdbc9('0x52')],_0xa8b4d9['body'][_0xdbc9('0x2d')]);_0xa8b4d9[_0xdbc9('0x4b')]['Descriptions']=integrations['getDescriptions'](_0xa8b4d9['body'][_0xdbc9('0x52')],_0xa8b4d9[_0xdbc9('0x4b')][_0xdbc9('0x2d')]);return db['ZendeskConfiguration'][_0xdbc9('0x49')](_0xa8b4d9[_0xdbc9('0x4b')],{'include':[{'model':db[_0xdbc9('0x53')],'as':_0xdbc9('0x54')},{'model':db[_0xdbc9('0x53')],'as':_0xdbc9('0x55')}]});}return null;})[_0xdbc9('0x25')](respondWithResult(_0x3e93d3,null))[_0xdbc9('0x44')](handleError(_0x3e93d3,null));};exports[_0xdbc9('0x56')]=function(_0x5e6522,_0x2787d9,_0x2c3223){var _0x511778='';return db['ZendeskAccount'][_0xdbc9('0x4d')]({'where':{'id':_0x5e6522[_0xdbc9('0x46')]['id']},'attributes':['id',_0xdbc9('0x57'),_0xdbc9('0x58'),_0xdbc9('0x59'),_0xdbc9('0x5a'),_0xdbc9('0x5b')]})['then'](handleEntityNotFound(_0x2787d9,null))[_0xdbc9('0x25')](function(_0x19af46){if(_0x19af46){_0x511778=_0x19af46[_0xdbc9('0x5b')];var _0x4a412e=_0x511778[_0xdbc9('0x5c')](-0x1);if(_0x4a412e==='/'){_0x511778=_0x511778[_0xdbc9('0x5d')](0x0,_0x511778[_0xdbc9('0x5e')](_0x4a412e));}var _0x2b4905={'method':_0xdbc9('0x5f'),'uri':util[_0xdbc9('0x60')](_0xdbc9('0x61'),_0x511778,_0xdbc9('0x62')),'json':!![]};switch(_0x19af46[_0xdbc9('0x5a')]){case _0xdbc9('0x58'):_0x2b4905[_0xdbc9('0x63')]={'Authorization':util[_0xdbc9('0x60')]('Basic\x20%s',new Buffer(util['format'](_0xdbc9('0x64'),_0x19af46['username'],_0x19af46['password']))[_0xdbc9('0x65')](_0xdbc9('0x66')))};break;case _0xdbc9('0x59'):_0x2b4905['headers']={'Authorization':util[_0xdbc9('0x60')](_0xdbc9('0x67'),new Buffer(util[_0xdbc9('0x60')]('%s/token:%s',_0x19af46[_0xdbc9('0x57')],_0x19af46[_0xdbc9('0x59')]))['toString'](_0xdbc9('0x66')))};break;default:throw new db[(_0xdbc9('0x68'))][(_0xdbc9('0x69'))](_0xdbc9('0x6a'));}return rp(_0x2b4905);}})[_0xdbc9('0x25')](function(_0x501754){if(_0x501754){var _0x4f984b=[_0xdbc9('0x6b'),_0xdbc9('0x6c'),'group',_0xdbc9('0x6d')];_[_0xdbc9('0x6e')](_0x501754[_0xdbc9('0x62')],function(_0x5802fc){return _0x4f984b[_0xdbc9('0x6f')](_0x5802fc[_0xdbc9('0x2d')]);});return{'count':_0x501754[_0xdbc9('0x62')][_0xdbc9('0x47')],'rows':_[_0xdbc9('0x3d')](_0x501754[_0xdbc9('0x62')],function(_0x1b053a){return{'id':_0x1b053a['id'],'name':_0x1b053a[_0xdbc9('0x70')]>0x7?_0x1b053a['title']:_0x1b053a[_0xdbc9('0x2d')],'custom':_0x1b053a[_0xdbc9('0x70')]>0x7?!![]:![],'options':_0x1b053a[_0xdbc9('0x71')]?_0x1b053a[_0xdbc9('0x71')]:_0x1b053a['custom_field_options']?_0x1b053a[_0xdbc9('0x72')]:[]};})};}})['then'](respondWithResult(_0x2787d9,null))['catch'](function(_0x34ebeb){var _0x3400d0=_0x5e6522['query'][_0xdbc9('0x73')]?0x1f4:_0x34ebeb[_0xdbc9('0x74')]||0x1f4;logger[_0xdbc9('0x27')](_0xdbc9('0x75'),_0xdbc9('0x56'),_0x3400d0,JSON[_0xdbc9('0x76')](_0x34ebeb));delete _0x34ebeb[_0xdbc9('0x2f')];if(_0x3400d0===0x191){_0x3400d0=0x190;}_0x2787d9['status'](_0x3400d0)['send'](_0x5e6522[_0xdbc9('0x30')][_0xdbc9('0x73')]?{'message':_0xdbc9('0x77'),'statusCode':_0x34ebeb['statusCode']}:_0x34ebeb);});};
\ No newline at end of file
index 381e633..64f4764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd7c=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','define'];(function(_0x542f89,_0x2715c0){var _0x46bff1=function(_0x4dbdec){while(--_0x4dbdec){_0x542f89['push'](_0x542f89['shift']());}};_0x46bff1(++_0x2715c0);}(_0xfd7c,0x1b8));var _0xcfd7=function(_0x5ed8a4,_0x6c22a5){_0x5ed8a4=_0x5ed8a4-0x0;var _0x36544d=_0xfd7c[_0x5ed8a4];return _0x36544d;};'use strict';var _=require('lodash');var util=require(_0xcfd7('0x0'));var logger=require(_0xcfd7('0x1'))(_0xcfd7('0x2'));var moment=require(_0xcfd7('0x3'));var BPromise=require(_0xcfd7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfd7('0x5'));var rimraf=require(_0xcfd7('0x6'));var config=require(_0xcfd7('0x7'));var attributes=require(_0xcfd7('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2357b8,_0x55511e){return _0x2357b8[_0xcfd7('0x9')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0577=['./intZendeskAccount.attributes','exports','define','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0577,0x1b1));var _0x7057=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0577[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x7057('0x0'));var util=require(_0x7057('0x1'));var logger=require(_0x7057('0x2'))(_0x7057('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7057('0x4'));var rimraf=require(_0x7057('0x5'));var config=require(_0x7057('0x6'));var attributes=require(_0x7057('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x7057('0x8')]=function(_0x494d6f,_0x3378fd){return _0x494d6f[_0x7057('0x9')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fdb9c34..c2903a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a7f=['where','ShowZendeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ZendeskAccount','findAll','options','raw','attributes','include','model','map','debug','find'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x1a7f,0xb1));var _0xf1a7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1a7f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xf1a7('0x0'));var util=require('util');var moment=require(_0xf1a7('0x1'));var BPromise=require(_0xf1a7('0x2'));var rs=require(_0xf1a7('0x3'));var fs=require('fs');var Redis=require(_0xf1a7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1a7('0x5'));var logger=require(_0xf1a7('0x6'))(_0xf1a7('0x7'));var config=require(_0xf1a7('0x8'));var jayson=require(_0xf1a7('0x9'));var client=jayson[_0xf1a7('0xa')][_0xf1a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c7053,_0x543ec3,_0x2e0873){return new BPromise(function(_0x2f8049,_0x2a9763){return client[_0xf1a7('0xc')](_0x4c7053,_0x2e0873)[_0xf1a7('0xd')](function(_0x363ff3){logger['info'](_0xf1a7('0xe'),_0x543ec3,_0xf1a7('0xf'));logger['debug'](_0xf1a7('0x10'),_0x543ec3,_0xf1a7('0xf'),JSON[_0xf1a7('0x11')](_0x363ff3));if(_0x363ff3[_0xf1a7('0x12')]){if(_0x363ff3[_0xf1a7('0x12')][_0xf1a7('0x13')]===0x1f4){logger[_0xf1a7('0x12')](_0xf1a7('0xe'),_0x543ec3,_0x363ff3[_0xf1a7('0x12')]['message']);return _0x2a9763(_0x363ff3[_0xf1a7('0x12')][_0xf1a7('0x14')]);}logger[_0xf1a7('0x12')](_0xf1a7('0xe'),_0x543ec3,_0x363ff3[_0xf1a7('0x12')][_0xf1a7('0x14')]);return _0x2f8049(_0x363ff3[_0xf1a7('0x12')][_0xf1a7('0x14')]);}else{logger[_0xf1a7('0x15')](_0xf1a7('0xe'),_0x543ec3,_0xf1a7('0xf'));_0x2f8049(_0x363ff3['result'][_0xf1a7('0x14')]);}})[_0xf1a7('0x16')](function(_0x598f4c){logger[_0xf1a7('0x12')](_0xf1a7('0xe'),_0x543ec3,_0x598f4c);_0x2a9763(_0x598f4c);});});}exports['GetZendeskAccount']=function(_0x4e152e){var _0x1da92d=this;return new Promise(function(_0x17174b,_0x39b0eb){return db[_0xf1a7('0x17')][_0xf1a7('0x18')]({'raw':_0x4e152e[_0xf1a7('0x19')]?_0x4e152e['options'][_0xf1a7('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e152e[_0xf1a7('0x19')]?_0x4e152e[_0xf1a7('0x19')]['where']||null:null,'attributes':_0x4e152e['options']?_0x4e152e[_0xf1a7('0x19')][_0xf1a7('0x1b')]||null:null,'limit':_0x4e152e[_0xf1a7('0x19')]?_0x4e152e[_0xf1a7('0x19')]['limit']||null:null,'include':_0x4e152e[_0xf1a7('0x19')]?_0x4e152e['options']['include']?_['map'](_0x4e152e[_0xf1a7('0x19')][_0xf1a7('0x1c')],function(_0x404d78){return{'model':db[_0x404d78[_0xf1a7('0x1d')]],'as':_0x404d78['as'],'attributes':_0x404d78[_0xf1a7('0x1b')],'include':_0x404d78[_0xf1a7('0x1c')]?_[_0xf1a7('0x1e')](_0x404d78[_0xf1a7('0x1c')],function(_0x5d14af){return{'model':db[_0x5d14af[_0xf1a7('0x1d')]],'as':_0x5d14af['as'],'attributes':_0x5d14af[_0xf1a7('0x1b')],'include':_0x5d14af[_0xf1a7('0x1c')]?_[_0xf1a7('0x1e')](_0x5d14af[_0xf1a7('0x1c')],function(_0x3e73b9){return{'model':db[_0x3e73b9[_0xf1a7('0x1d')]],'as':_0x3e73b9['as'],'attributes':_0x3e73b9[_0xf1a7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf1a7('0xd')](function(_0x5a16fb){logger[_0xf1a7('0x15')]('GetZendeskAccount',_0x4e152e);logger[_0xf1a7('0x1f')]('GetZendeskAccount',_0x4e152e,JSON[_0xf1a7('0x11')](_0x5a16fb));_0x17174b(_0x5a16fb);})[_0xf1a7('0x16')](function(_0x41e823){logger[_0xf1a7('0x12')]('GetZendeskAccount',_0x41e823['message'],_0x4e152e);_0x39b0eb(_0x1da92d['error'](0x1f4,_0x41e823[_0xf1a7('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x1ff573){var _0x537caa=this;return new Promise(function(_0x4e0d16,_0x17a932){return db[_0xf1a7('0x17')][_0xf1a7('0x20')]({'raw':_0x1ff573[_0xf1a7('0x19')]?_0x1ff573[_0xf1a7('0x19')][_0xf1a7('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ff573[_0xf1a7('0x19')]?_0x1ff573[_0xf1a7('0x19')][_0xf1a7('0x21')]||null:null,'attributes':_0x1ff573[_0xf1a7('0x19')]?_0x1ff573[_0xf1a7('0x19')][_0xf1a7('0x1b')]||null:null,'include':_0x1ff573[_0xf1a7('0x19')]?_0x1ff573[_0xf1a7('0x19')]['include']?_[_0xf1a7('0x1e')](_0x1ff573['options'][_0xf1a7('0x1c')],function(_0x44b557){return{'model':db[_0x44b557[_0xf1a7('0x1d')]],'as':_0x44b557['as'],'attributes':_0x44b557[_0xf1a7('0x1b')],'include':_0x44b557[_0xf1a7('0x1c')]?_['map'](_0x44b557[_0xf1a7('0x1c')],function(_0x539d08){return{'model':db[_0x539d08[_0xf1a7('0x1d')]],'as':_0x539d08['as'],'attributes':_0x539d08[_0xf1a7('0x1b')],'include':_0x539d08[_0xf1a7('0x1c')]?_[_0xf1a7('0x1e')](_0x539d08[_0xf1a7('0x1c')],function(_0x4eacdc){return{'model':db[_0x4eacdc[_0xf1a7('0x1d')]],'as':_0x4eacdc['as'],'attributes':_0x4eacdc['attributes']};}):[]};}):[]};}):[]:[]})[_0xf1a7('0xd')](function(_0xd36f5a){logger[_0xf1a7('0x15')](_0xf1a7('0x22'),_0x1ff573);logger[_0xf1a7('0x1f')]('ShowZendeskAccount',_0x1ff573,JSON[_0xf1a7('0x11')](_0xd36f5a));_0x4e0d16(_0xd36f5a);})[_0xf1a7('0x16')](function(_0x702eaa){logger[_0xf1a7('0x12')](_0xf1a7('0x22'),_0x702eaa[_0xf1a7('0x14')],_0x1ff573);_0x17a932(_0x537caa[_0xf1a7('0x12')](0x1f4,_0x702eaa[_0xf1a7('0x14')]));});});};
\ No newline at end of file
+var _0xaf3e=['ShowZendeskAccount','ZendeskAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','then','GetZendeskAccount'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xaf3e,0xcf));var _0xeaf3=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0xaf3e[_0x39609a];return _0xecd92;};'use strict';var _=require(_0xeaf3('0x0'));var util=require(_0xeaf3('0x1'));var moment=require('moment');var BPromise=require(_0xeaf3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaf3('0x3'));var db=require(_0xeaf3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeaf3('0x5'))(_0xeaf3('0x6'));var config=require(_0xeaf3('0x7'));var jayson=require(_0xeaf3('0x8'));var client=jayson[_0xeaf3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33071f,_0x1725b7,_0xa51f56){return new BPromise(function(_0x120b24,_0x3d599a){return client[_0xeaf3('0xa')](_0x33071f,_0xa51f56)['then'](function(_0x3e666b){logger['info'](_0xeaf3('0xb'),_0x1725b7,_0xeaf3('0xc'));logger[_0xeaf3('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1725b7,_0xeaf3('0xc'),JSON[_0xeaf3('0xe')](_0x3e666b));if(_0x3e666b['error']){if(_0x3e666b[_0xeaf3('0xf')]['code']===0x1f4){logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x3e666b[_0xeaf3('0xf')][_0xeaf3('0x10')]);return _0x3d599a(_0x3e666b['error'][_0xeaf3('0x10')]);}logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x3e666b[_0xeaf3('0xf')]['message']);return _0x120b24(_0x3e666b[_0xeaf3('0xf')]['message']);}else{logger[_0xeaf3('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x1725b7,'request\x20sent');_0x120b24(_0x3e666b[_0xeaf3('0x12')][_0xeaf3('0x10')]);}})[_0xeaf3('0x13')](function(_0x2aea53){logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x2aea53);_0x3d599a(_0x2aea53);});});}exports['GetZendeskAccount']=function(_0x440dab){var _0x4aab67=this;return new Promise(function(_0x2e1254,_0x4512dc){return db['ZendeskAccount'][_0xeaf3('0x14')]({'raw':_0x440dab[_0xeaf3('0x15')]?_0x440dab[_0xeaf3('0x15')][_0xeaf3('0x16')]===undefined?!![]:![]:!![],'where':_0x440dab[_0xeaf3('0x15')]?_0x440dab[_0xeaf3('0x15')][_0xeaf3('0x17')]||null:null,'attributes':_0x440dab[_0xeaf3('0x15')]?_0x440dab[_0xeaf3('0x15')][_0xeaf3('0x18')]||null:null,'limit':_0x440dab[_0xeaf3('0x15')]?_0x440dab[_0xeaf3('0x15')][_0xeaf3('0x19')]||null:null,'include':_0x440dab['options']?_0x440dab['options'][_0xeaf3('0x1a')]?_['map'](_0x440dab['options'][_0xeaf3('0x1a')],function(_0xdd12f5){return{'model':db[_0xdd12f5[_0xeaf3('0x1b')]],'as':_0xdd12f5['as'],'attributes':_0xdd12f5['attributes'],'include':_0xdd12f5['include']?_[_0xeaf3('0x1c')](_0xdd12f5[_0xeaf3('0x1a')],function(_0x5bedab){return{'model':db[_0x5bedab[_0xeaf3('0x1b')]],'as':_0x5bedab['as'],'attributes':_0x5bedab[_0xeaf3('0x18')],'include':_0x5bedab[_0xeaf3('0x1a')]?_[_0xeaf3('0x1c')](_0x5bedab[_0xeaf3('0x1a')],function(_0x179376){return{'model':db[_0x179376['model']],'as':_0x179376['as'],'attributes':_0x179376['attributes']};}):[]};}):[]};}):[]:[]})[_0xeaf3('0x1d')](function(_0xc184f2){logger[_0xeaf3('0x11')](_0xeaf3('0x1e'),_0x440dab);logger[_0xeaf3('0xd')](_0xeaf3('0x1e'),_0x440dab,JSON[_0xeaf3('0xe')](_0xc184f2));_0x2e1254(_0xc184f2);})[_0xeaf3('0x13')](function(_0x379cf5){logger['error']('GetZendeskAccount',_0x379cf5[_0xeaf3('0x10')],_0x440dab);_0x4512dc(_0x4aab67[_0xeaf3('0xf')](0x1f4,_0x379cf5[_0xeaf3('0x10')]));});});};exports[_0xeaf3('0x1f')]=function(_0x42c820){var _0x4b958=this;return new Promise(function(_0x937b6f,_0x38a81a){return db[_0xeaf3('0x20')][_0xeaf3('0x21')]({'raw':_0x42c820[_0xeaf3('0x15')]?_0x42c820[_0xeaf3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x42c820[_0xeaf3('0x15')]?_0x42c820['options'][_0xeaf3('0x17')]||null:null,'attributes':_0x42c820[_0xeaf3('0x15')]?_0x42c820[_0xeaf3('0x15')][_0xeaf3('0x18')]||null:null,'include':_0x42c820[_0xeaf3('0x15')]?_0x42c820['options'][_0xeaf3('0x1a')]?_['map'](_0x42c820['options'][_0xeaf3('0x1a')],function(_0x55bf35){return{'model':db[_0x55bf35['model']],'as':_0x55bf35['as'],'attributes':_0x55bf35[_0xeaf3('0x18')],'include':_0x55bf35[_0xeaf3('0x1a')]?_[_0xeaf3('0x1c')](_0x55bf35[_0xeaf3('0x1a')],function(_0xda4de2){return{'model':db[_0xda4de2['model']],'as':_0xda4de2['as'],'attributes':_0xda4de2[_0xeaf3('0x18')],'include':_0xda4de2[_0xeaf3('0x1a')]?_[_0xeaf3('0x1c')](_0xda4de2[_0xeaf3('0x1a')],function(_0x454054){return{'model':db[_0x454054[_0xeaf3('0x1b')]],'as':_0x454054['as'],'attributes':_0x454054[_0xeaf3('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeaf3('0x1d')](function(_0xc4d4f9){logger[_0xeaf3('0x11')](_0xeaf3('0x1f'),_0x42c820);logger[_0xeaf3('0xd')](_0xeaf3('0x1f'),_0x42c820,JSON[_0xeaf3('0xe')](_0xc4d4f9));_0x937b6f(_0xc4d4f9);})[_0xeaf3('0x13')](function(_0x269f6c){logger[_0xeaf3('0xf')](_0xeaf3('0x1f'),_0x269f6c[_0xeaf3('0x10')],_0x42c820);_0x38a81a(_0x4b958[_0xeaf3('0xf')](0x1f4,_0x269f6c[_0xeaf3('0x10')]));});});};
\ No newline at end of file
index 923c097..b9652b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c00=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0xef3abe,_0x2a4568){var _0x8bdbe8=function(_0x225af8){while(--_0x225af8){_0xef3abe['push'](_0xef3abe['shift']());}};_0x8bdbe8(++_0x2a4568);}(_0x5c00,0x17e));var _0x05c0=function(_0x5be46a,_0x2fb035){_0x5be46a=_0x5be46a-0x0;var _0x1ce3b8=_0x5c00[_0x5be46a];return _0x1ce3b8;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/fields',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/descriptions',auth[_0x05c0('0x9')](),controller['getDescriptions']);router[_0x05c0('0x8')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller['getTags']);router[_0x05c0('0x10')]('/',auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0x10')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller['update']);router[_0x05c0('0x15')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x16')]);module[_0x05c0('0x17')]=router;
\ No newline at end of file
+var _0x91a7=['util','path','connect-timeout','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','update','destroy','exports'];(function(_0x6e8cfe,_0x206499){var _0x2b5bf7=function(_0x3ed26c){while(--_0x3ed26c){_0x6e8cfe['push'](_0x6e8cfe['shift']());}};_0x2b5bf7(++_0x206499);}(_0x91a7,0xe7));var _0x791a=function(_0x4903d6,_0x217a7d){_0x4903d6=_0x4903d6-0x0;var _0x1e2ce6=_0x91a7[_0x4903d6];return _0x1e2ce6;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['show']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/subjects',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['get'](_0x791a('0xd'),auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0x6')](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['getTags']);router['post']('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router['post'](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['setTags']);router[_0x791a('0x11')](_0x791a('0x8'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router['delete'](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0x13')]);module[_0x791a('0x14')]=router;
\ No newline at end of file
index ea4530c..c89f080 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a51=['STRING','exports'];(function(_0x4ee307,_0x4ca9d9){var _0xed6a9e=function(_0x36ddbc){while(--_0x36ddbc){_0x4ee307['push'](_0x4ee307['shift']());}};_0xed6a9e(++_0x4ca9d9);}(_0x3a51,0x14b));var _0x13a5=function(_0x54b840,_0x5a4068){_0x54b840=_0x54b840-0x0;var _0x3bcf42=_0x3a51[_0x54b840];return _0x3bcf42;};'use strict';var Sequelize=require('sequelize');module[_0x13a5('0x0')]={'name':{'type':Sequelize[_0x13a5('0x1')]},'description':{'type':Sequelize[_0x13a5('0x1')]}};
\ No newline at end of file
+var _0x38db=['STRING','exports'];(function(_0x2b6f0b,_0x2b5cd5){var _0x455ded=function(_0xf2c27b){while(--_0xf2c27b){_0x2b6f0b['push'](_0x2b6f0b['shift']());}};_0x455ded(++_0x2b5cd5);}(_0x38db,0xdd));var _0xb38d=function(_0x49cc54,_0x4e1cc4){_0x49cc54=_0x49cc54-0x0;var _0x207660=_0x38db[_0x49cc54];return _0x207660;};'use strict';var Sequelize=require('sequelize');module[_0xb38d('0x0')]={'name':{'type':Sequelize[_0xb38d('0x1')]},'description':{'type':Sequelize[_0xb38d('0x1')]}};
\ No newline at end of file
index 5c5284b..c8fa93e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x338d=['body','getFields','findOne','ZendeskField','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create'];(function(_0x4fa0a4,_0xcc5636){var _0x622d5e=function(_0x4de1f8){while(--_0x4de1f8){_0x4fa0a4['push'](_0x4fa0a4['shift']());}};_0x622d5e(++_0xcc5636);}(_0x338d,0xb9));var _0xd338=function(_0x249884,_0xc6a47b){_0x249884=_0x249884-0x0;var _0x277db9=_0x338d[_0x249884];return _0x277db9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd338('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd338('0x1'));var moment=require(_0xd338('0x2'));var BPromise=require(_0xd338('0x3'));var Mustache=require(_0xd338('0x4'));var util=require(_0xd338('0x5'));var path=require(_0xd338('0x6'));var sox=require(_0xd338('0x7'));var csv=require(_0xd338('0x8'));var ejs=require(_0xd338('0x9'));var fs=require('fs');var fs_extra=require(_0xd338('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd338('0xb'));var jsforce=require(_0xd338('0xc'));var deskjs=require(_0xd338('0xd'));var toCsv=require(_0xd338('0x8'));var querystring=require(_0xd338('0xe'));var Papa=require(_0xd338('0xf'));var Redis=require(_0xd338('0x10'));var authService=require(_0xd338('0x11'));var qs=require(_0xd338('0x12'));var as=require(_0xd338('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd338('0x14'))(_0xd338('0x15'));var utils=require(_0xd338('0x16'));var config=require(_0xd338('0x17'));var licenseUtil=require(_0xd338('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e641a,_0x4519a4){_0x4519a4=_0x4519a4||0xcc;return function(_0x3d3630){if(_0x3d3630){return _0x3e641a[_0xd338('0x19')](_0x4519a4);}return _0x3e641a[_0xd338('0x1a')](_0x4519a4)[_0xd338('0x1b')]();};}function respondWithResult(_0x482dfc,_0x501720){_0x501720=_0x501720||0xc8;return function(_0x4e33f4){if(_0x4e33f4){return _0x482dfc['status'](_0x501720)[_0xd338('0x1c')](_0x4e33f4);}};}function respondWithFilteredResult(_0x58f2d2,_0x421ca2){return function(_0x1d677c){if(_0x1d677c){var _0x1585a8=typeof _0x421ca2[_0xd338('0x1d')]===_0xd338('0x1e')&&typeof _0x421ca2['limit']==='undefined';var _0x2da5b9=_0x1d677c[_0xd338('0x1f')];var _0x433506=_0x1585a8?0x0:_0x421ca2[_0xd338('0x1d')];var _0x2d5278=_0x1585a8?_0x1d677c[_0xd338('0x1f')]:_0x421ca2[_0xd338('0x1d')]+_0x421ca2['limit'];var _0x1d55d7;if(_0x2d5278>=_0x2da5b9){_0x2d5278=_0x2da5b9;_0x1d55d7=0xc8;}else{_0x1d55d7=0xce;}_0x58f2d2[_0xd338('0x1a')](_0x1d55d7);return _0x58f2d2[_0xd338('0x20')](_0xd338('0x21'),_0x433506+'-'+_0x2d5278+'/'+_0x2da5b9)[_0xd338('0x1c')](_0x1d677c);}return null;};}function patchUpdates(_0xb32b7e){return function(_0x2c7100){try{jsonpatch[_0xd338('0x22')](_0x2c7100,_0xb32b7e,!![]);}catch(_0x56e00f){return BPromise[_0xd338('0x23')](_0x56e00f);}return _0x2c7100[_0xd338('0x24')]();};}function saveUpdates(_0x22f6af,_0x43b4dc){return function(_0x3e6868){if(_0x3e6868){return _0x3e6868[_0xd338('0x25')](_0x22f6af)[_0xd338('0x26')](function(_0x375c47){return _0x375c47;});}return null;};}function removeEntity(_0x54b239,_0x323a33){return function(_0x596876){if(_0x596876){return _0x596876[_0xd338('0x27')]()[_0xd338('0x26')](function(){_0x54b239[_0xd338('0x1a')](0xcc)[_0xd338('0x1b')]();});}};}function handleEntityNotFound(_0x31c836,_0x210cc5){return function(_0x273229){if(!_0x273229){_0x31c836['sendStatus'](0x194);}return _0x273229;};}function handleError(_0xd30bca,_0x442d72){_0x442d72=_0x442d72||0x1f4;return function(_0x5b6e4f){logger[_0xd338('0x28')](_0x5b6e4f[_0xd338('0x29')]);if(_0x5b6e4f['name']){delete _0x5b6e4f[_0xd338('0x2a')];}_0xd30bca[_0xd338('0x1a')](_0x442d72)['send'](_0x5b6e4f);};}exports[_0xd338('0x2b')]=function(_0x367ae1,_0x1fde35){var _0x5e38d5={},_0xc731a7={},_0x4030ba={'count':0x0,'rows':[]};var _0x321b98=_[_0xd338('0x2c')](db[_0xd338('0x2d')][_0xd338('0x2e')],function(_0x2dc86b){return{'name':_0x2dc86b[_0xd338('0x2f')],'type':_0x2dc86b[_0xd338('0x30')][_0xd338('0x31')]};});_0xc731a7[_0xd338('0x32')]=_[_0xd338('0x2c')](_0x321b98,_0xd338('0x2a'));_0xc731a7['query']=_['keys'](_0x367ae1['query']);_0xc731a7[_0xd338('0x33')]=_[_0xd338('0x34')](_0xc731a7[_0xd338('0x32')],_0xc731a7[_0xd338('0x35')]);_0x5e38d5['attributes']=_[_0xd338('0x34')](_0xc731a7[_0xd338('0x32')],qs[_0xd338('0x36')](_0x367ae1['query'][_0xd338('0x36')]));_0x5e38d5[_0xd338('0x37')]=_0x5e38d5[_0xd338('0x37')][_0xd338('0x38')]?_0x5e38d5[_0xd338('0x37')]:_0xc731a7[_0xd338('0x32')];if(!_0x367ae1['query'][_0xd338('0x39')](_0xd338('0x3a'))){_0x5e38d5[_0xd338('0x3b')]=qs[_0xd338('0x3b')](_0x367ae1[_0xd338('0x35')]['limit']);_0x5e38d5['offset']=qs[_0xd338('0x1d')](_0x367ae1[_0xd338('0x35')][_0xd338('0x1d')]);}_0x5e38d5['order']=qs[_0xd338('0x3c')](_0x367ae1[_0xd338('0x35')][_0xd338('0x3c')]);_0x5e38d5[_0xd338('0x3d')]=qs[_0xd338('0x33')](_[_0xd338('0x3e')](_0x367ae1[_0xd338('0x35')],_0xc731a7[_0xd338('0x33')]),_0x321b98);if(_0x367ae1[_0xd338('0x35')][_0xd338('0x3f')]){_0x5e38d5[_0xd338('0x3d')]=_[_0xd338('0x40')](_0x5e38d5['where'],{'$or':_[_0xd338('0x2c')](_0x321b98,function(_0x4897ef){if(_0x4897ef[_0xd338('0x30')]!==_0xd338('0x41')){var _0x34cfde={};_0x34cfde[_0x4897ef[_0xd338('0x2a')]]={'$like':'%'+_0x367ae1[_0xd338('0x35')][_0xd338('0x3f')]+'%'};return _0x34cfde;}})});}_0x5e38d5=_[_0xd338('0x40')]({},_0x5e38d5,_0x367ae1[_0xd338('0x42')]);var _0x4d09d8={'where':_0x5e38d5[_0xd338('0x3d')]};return db[_0xd338('0x2d')][_0xd338('0x1f')](_0x4d09d8)[_0xd338('0x26')](function(_0x4f1684){_0x4030ba[_0xd338('0x1f')]=_0x4f1684;if(_0x367ae1['query'][_0xd338('0x43')]){_0x5e38d5[_0xd338('0x44')]=[{'all':!![]}];}return db[_0xd338('0x2d')][_0xd338('0x45')](_0x5e38d5);})[_0xd338('0x26')](function(_0x271f69){_0x4030ba[_0xd338('0x46')]=_0x271f69;return _0x4030ba;})['then'](respondWithFilteredResult(_0x1fde35,_0x5e38d5))[_0xd338('0x47')](handleError(_0x1fde35,null));};exports['show']=function(_0x5c426a,_0x3fa095){var _0x1029db={'raw':![],'where':{'id':_0x5c426a[_0xd338('0x48')]['id']}},_0x4f7879={};_0x4f7879[_0xd338('0x32')]=_[_0xd338('0x49')](db['ZendeskConfiguration'][_0xd338('0x2e')]);_0x4f7879[_0xd338('0x35')]=_['keys'](_0x5c426a[_0xd338('0x35')]);_0x4f7879['filters']=_['intersection'](_0x4f7879[_0xd338('0x32')],_0x4f7879[_0xd338('0x35')]);_0x1029db['attributes']=_[_0xd338('0x34')](_0x4f7879[_0xd338('0x32')],qs[_0xd338('0x36')](_0x5c426a[_0xd338('0x35')][_0xd338('0x36')]));_0x1029db['attributes']=_0x1029db[_0xd338('0x37')][_0xd338('0x38')]?_0x1029db[_0xd338('0x37')]:_0x4f7879[_0xd338('0x32')];if(_0x5c426a['query']['includeAll']){_0x1029db['include']=[{'all':!![]}];}_0x1029db=_[_0xd338('0x40')]({},_0x1029db,_0x5c426a[_0xd338('0x42')]);return db[_0xd338('0x2d')][_0xd338('0x4a')](_0x1029db)['then'](handleEntityNotFound(_0x3fa095,null))[_0xd338('0x26')](respondWithResult(_0x3fa095,null))[_0xd338('0x47')](handleError(_0x3fa095,null));};exports[_0xd338('0x4b')]=function(_0x1e1343,_0x4fc1a8){return db[_0xd338('0x2d')][_0xd338('0x4b')](_0x1e1343[_0xd338('0x4c')],{})[_0xd338('0x26')](respondWithResult(_0x4fc1a8,0xc9))['catch'](handleError(_0x4fc1a8,null));};exports['update']=function(_0x2940d4,_0xd26bf8){if(_0x2940d4[_0xd338('0x4c')]['id']){delete _0x2940d4[_0xd338('0x4c')]['id'];}return db['ZendeskConfiguration'][_0xd338('0x4a')]({'where':{'id':_0x2940d4[_0xd338('0x48')]['id']}})[_0xd338('0x26')](handleEntityNotFound(_0xd26bf8,null))[_0xd338('0x26')](saveUpdates(_0x2940d4[_0xd338('0x4c')],null))['then'](respondWithResult(_0xd26bf8,null))['catch'](handleError(_0xd26bf8,null));};exports[_0xd338('0x27')]=function(_0x219e32,_0x46c20c){return db[_0xd338('0x2d')]['find']({'where':{'id':_0x219e32[_0xd338('0x48')]['id']}})[_0xd338('0x26')](handleEntityNotFound(_0x46c20c,null))['then'](removeEntity(_0x46c20c,null))[_0xd338('0x47')](handleError(_0x46c20c,null));};exports[_0xd338('0x4d')]=function(_0x43106f,_0x32f5e3,_0x33457c){var _0x37a263={};var _0x99c036={};var _0x5601ce;var _0x115857;return db[_0xd338('0x2d')][_0xd338('0x4e')]({'where':{'id':_0x43106f[_0xd338('0x48')]['id']}})['then'](handleEntityNotFound(_0x32f5e3,null))[_0xd338('0x26')](function(_0x245565){if(_0x245565){_0x5601ce=_0x245565;_0x99c036['model']=_['keys'](db[_0xd338('0x4f')]['rawAttributes']);_0x99c036[_0xd338('0x35')]=_[_0xd338('0x49')](_0x43106f[_0xd338('0x35')]);_0x99c036[_0xd338('0x33')]=_['intersection'](_0x99c036[_0xd338('0x32')],_0x99c036[_0xd338('0x35')]);_0x37a263['attributes']=_[_0xd338('0x34')](_0x99c036['model'],qs['fields'](_0x43106f[_0xd338('0x35')][_0xd338('0x36')]));_0x37a263[_0xd338('0x37')]=_0x37a263[_0xd338('0x37')][_0xd338('0x38')]?_0x37a263[_0xd338('0x37')]:_0x99c036[_0xd338('0x32')];_0x37a263['order']=qs['sort'](_0x43106f[_0xd338('0x35')][_0xd338('0x3c')]);_0x37a263[_0xd338('0x3d')]=qs['filters'](_[_0xd338('0x3e')](_0x43106f[_0xd338('0x35')],_0x99c036[_0xd338('0x33')]));if(_0x43106f[_0xd338('0x35')][_0xd338('0x3f')]){_0x37a263[_0xd338('0x3d')]=_[_0xd338('0x40')](_0x37a263[_0xd338('0x3d')],{'$or':_[_0xd338('0x2c')](_0x37a263[_0xd338('0x37')],function(_0x4d5994){var _0x392615={};_0x392615[_0x4d5994]={'$like':'%'+_0x43106f[_0xd338('0x35')][_0xd338('0x3f')]+'%'};return _0x392615;})});}_0x37a263=_[_0xd338('0x40')]({},_0x37a263,_0x43106f['options']);return _0x5601ce[_0xd338('0x4d')](_0x37a263);}})[_0xd338('0x26')](function(_0x3ffdb7){if(_0x3ffdb7){_0x115857=_0x3ffdb7[_0xd338('0x38')];if(!_0x43106f[_0xd338('0x35')][_0xd338('0x39')]('nolimit')){_0x37a263[_0xd338('0x3b')]=qs[_0xd338('0x3b')](_0x43106f[_0xd338('0x35')][_0xd338('0x3b')]);_0x37a263[_0xd338('0x1d')]=qs['offset'](_0x43106f[_0xd338('0x35')][_0xd338('0x1d')]);}return _0x5601ce[_0xd338('0x4d')](_0x37a263);}})[_0xd338('0x26')](function(_0x5b6210){if(_0x5b6210){return _0x5b6210?{'count':_0x115857,'rows':_0x5b6210}:null;}})[_0xd338('0x26')](respondWithResult(_0x32f5e3,null))[_0xd338('0x47')](handleError(_0x32f5e3,null));};exports[_0xd338('0x50')]=function(_0x34e0e5,_0x3b9f7a,_0x106a5b){var _0x2a1b91={};var _0x3c1331={};var _0x1f61e2;var _0x3b4c5c;return db[_0xd338('0x2d')][_0xd338('0x4e')]({'where':{'id':_0x34e0e5[_0xd338('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b9f7a,null))['then'](function(_0x5907ae){if(_0x5907ae){_0x1f61e2=_0x5907ae;_0x3c1331[_0xd338('0x32')]=_[_0xd338('0x49')](db[_0xd338('0x4f')][_0xd338('0x2e')]);_0x3c1331[_0xd338('0x35')]=_['keys'](_0x34e0e5['query']);_0x3c1331[_0xd338('0x33')]=_[_0xd338('0x34')](_0x3c1331[_0xd338('0x32')],_0x3c1331[_0xd338('0x35')]);_0x2a1b91[_0xd338('0x37')]=_[_0xd338('0x34')](_0x3c1331[_0xd338('0x32')],qs['fields'](_0x34e0e5[_0xd338('0x35')]['fields']));_0x2a1b91['attributes']=_0x2a1b91[_0xd338('0x37')]['length']?_0x2a1b91[_0xd338('0x37')]:_0x3c1331[_0xd338('0x32')];_0x2a1b91[_0xd338('0x51')]=qs[_0xd338('0x3c')](_0x34e0e5[_0xd338('0x35')][_0xd338('0x3c')]);_0x2a1b91['where']=qs[_0xd338('0x33')](_[_0xd338('0x3e')](_0x34e0e5['query'],_0x3c1331[_0xd338('0x33')]));if(_0x34e0e5[_0xd338('0x35')][_0xd338('0x3f')]){_0x2a1b91[_0xd338('0x3d')]=_[_0xd338('0x40')](_0x2a1b91[_0xd338('0x3d')],{'$or':_[_0xd338('0x2c')](_0x2a1b91['attributes'],function(_0x25e0bb){var _0x407404={};_0x407404[_0x25e0bb]={'$like':'%'+_0x34e0e5[_0xd338('0x35')][_0xd338('0x3f')]+'%'};return _0x407404;})});}_0x2a1b91=_[_0xd338('0x40')]({},_0x2a1b91,_0x34e0e5[_0xd338('0x42')]);return _0x1f61e2['getSubjects'](_0x2a1b91);}})['then'](function(_0x283722){if(_0x283722){_0x3b4c5c=_0x283722[_0xd338('0x38')];if(!_0x34e0e5['query'][_0xd338('0x39')](_0xd338('0x3a'))){_0x2a1b91[_0xd338('0x3b')]=qs[_0xd338('0x3b')](_0x34e0e5[_0xd338('0x35')]['limit']);_0x2a1b91[_0xd338('0x1d')]=qs[_0xd338('0x1d')](_0x34e0e5[_0xd338('0x35')][_0xd338('0x1d')]);}return _0x1f61e2[_0xd338('0x50')](_0x2a1b91);}})[_0xd338('0x26')](function(_0x2a0d5c){if(_0x2a0d5c){return _0x2a0d5c?{'count':_0x3b4c5c,'rows':_0x2a0d5c}:null;}})[_0xd338('0x26')](respondWithResult(_0x3b9f7a,null))[_0xd338('0x47')](handleError(_0x3b9f7a,null));};exports[_0xd338('0x52')]=function(_0xc9e34f,_0xfe6a35,_0x3863ef){var _0x5d2486={};var _0x3f5cb2={};var _0x63bb93;var _0x3829e9;return db[_0xd338('0x2d')]['findOne']({'where':{'id':_0xc9e34f['params']['id']}})[_0xd338('0x26')](handleEntityNotFound(_0xfe6a35,null))[_0xd338('0x26')](function(_0x116e44){if(_0x116e44){_0x63bb93=_0x116e44;_0x3f5cb2[_0xd338('0x32')]=_[_0xd338('0x49')](db['ZendeskField'][_0xd338('0x2e')]);_0x3f5cb2[_0xd338('0x35')]=_['keys'](_0xc9e34f[_0xd338('0x35')]);_0x3f5cb2[_0xd338('0x33')]=_['intersection'](_0x3f5cb2[_0xd338('0x32')],_0x3f5cb2[_0xd338('0x35')]);_0x5d2486[_0xd338('0x37')]=_[_0xd338('0x34')](_0x3f5cb2[_0xd338('0x32')],qs[_0xd338('0x36')](_0xc9e34f['query'][_0xd338('0x36')]));_0x5d2486[_0xd338('0x37')]=_0x5d2486[_0xd338('0x37')]['length']?_0x5d2486[_0xd338('0x37')]:_0x3f5cb2[_0xd338('0x32')];_0x5d2486[_0xd338('0x51')]=qs['sort'](_0xc9e34f[_0xd338('0x35')]['sort']);_0x5d2486[_0xd338('0x3d')]=qs[_0xd338('0x33')](_[_0xd338('0x3e')](_0xc9e34f[_0xd338('0x35')],_0x3f5cb2[_0xd338('0x33')]));if(_0xc9e34f['query'][_0xd338('0x3f')]){_0x5d2486[_0xd338('0x3d')]=_[_0xd338('0x40')](_0x5d2486['where'],{'$or':_[_0xd338('0x2c')](_0x5d2486[_0xd338('0x37')],function(_0x1b1908){var _0xd0fc38={};_0xd0fc38[_0x1b1908]={'$like':'%'+_0xc9e34f[_0xd338('0x35')][_0xd338('0x3f')]+'%'};return _0xd0fc38;})});}_0x5d2486=_[_0xd338('0x40')]({},_0x5d2486,_0xc9e34f['options']);return _0x63bb93[_0xd338('0x52')](_0x5d2486);}})[_0xd338('0x26')](function(_0x5c6d3d){if(_0x5c6d3d){_0x3829e9=_0x5c6d3d['length'];if(!_0xc9e34f[_0xd338('0x35')][_0xd338('0x39')](_0xd338('0x3a'))){_0x5d2486[_0xd338('0x3b')]=qs[_0xd338('0x3b')](_0xc9e34f[_0xd338('0x35')][_0xd338('0x3b')]);_0x5d2486[_0xd338('0x1d')]=qs[_0xd338('0x1d')](_0xc9e34f[_0xd338('0x35')][_0xd338('0x1d')]);}return _0x63bb93['getDescriptions'](_0x5d2486);}})['then'](function(_0x589ae8){if(_0x589ae8){return _0x589ae8?{'count':_0x3829e9,'rows':_0x589ae8}:null;}})['then'](respondWithResult(_0xfe6a35,null))[_0xd338('0x47')](handleError(_0xfe6a35,null));};exports[_0xd338('0x53')]=function(_0x343e97,_0x28c4ac,_0x58eecd){var _0x4ecc9a={};var _0x2cb3ef={};var _0x556f16;var _0x1bfe14;return db[_0xd338('0x2d')][_0xd338('0x4e')]({'where':{'id':_0x343e97[_0xd338('0x48')]['id']}})[_0xd338('0x26')](handleEntityNotFound(_0x28c4ac,null))['then'](function(_0xc43ac){if(_0xc43ac){_0x556f16=_0xc43ac;_0x2cb3ef[_0xd338('0x32')]=_[_0xd338('0x49')](db[_0xd338('0x54')][_0xd338('0x2e')]);_0x2cb3ef[_0xd338('0x35')]=_[_0xd338('0x49')](_0x343e97[_0xd338('0x35')]);_0x2cb3ef['filters']=_[_0xd338('0x34')](_0x2cb3ef['model'],_0x2cb3ef['query']);_0x4ecc9a['attributes']=_[_0xd338('0x34')](_0x2cb3ef[_0xd338('0x32')],qs['fields'](_0x343e97['query'][_0xd338('0x36')]));_0x4ecc9a[_0xd338('0x37')]=_0x4ecc9a['attributes'][_0xd338('0x38')]?_0x4ecc9a['attributes']:_0x2cb3ef[_0xd338('0x32')];_0x4ecc9a['order']=qs[_0xd338('0x3c')](_0x343e97[_0xd338('0x35')][_0xd338('0x3c')]);_0x4ecc9a[_0xd338('0x3d')]=qs[_0xd338('0x33')](_['pick'](_0x343e97[_0xd338('0x35')],_0x2cb3ef['filters']));if(_0x343e97[_0xd338('0x35')]['filter']){_0x4ecc9a[_0xd338('0x3d')]=_[_0xd338('0x40')](_0x4ecc9a[_0xd338('0x3d')],{'$or':_['map'](_0x4ecc9a['attributes'],function(_0x12324a){var _0x207cb3={};_0x207cb3[_0x12324a]={'$like':'%'+_0x343e97[_0xd338('0x35')][_0xd338('0x3f')]+'%'};return _0x207cb3;})});}_0x4ecc9a=_[_0xd338('0x40')]({},_0x4ecc9a,_0x343e97[_0xd338('0x42')]);return _0x556f16[_0xd338('0x53')](_0x4ecc9a);}})[_0xd338('0x26')](function(_0x52ed6e){if(_0x52ed6e){_0x1bfe14=_0x52ed6e[_0xd338('0x38')];if(!_0x343e97[_0xd338('0x35')]['hasOwnProperty']('nolimit')){_0x4ecc9a[_0xd338('0x3b')]=qs[_0xd338('0x3b')](_0x343e97[_0xd338('0x35')][_0xd338('0x3b')]);_0x4ecc9a[_0xd338('0x1d')]=qs[_0xd338('0x1d')](_0x343e97[_0xd338('0x35')]['offset']);}return _0x556f16[_0xd338('0x53')](_0x4ecc9a);}})[_0xd338('0x26')](function(_0x568432){if(_0x568432){return _0x568432?{'count':_0x1bfe14,'rows':_0x568432}:null;}})[_0xd338('0x26')](respondWithResult(_0x28c4ac,null))[_0xd338('0x47')](handleError(_0x28c4ac,null));};exports[_0xd338('0x55')]=function(_0x1a6b8d,_0x1a048f,_0x4c6ec7){if(_0x1a6b8d[_0xd338('0x4c')]['id']){delete _0x1a6b8d[_0xd338('0x4c')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x1a6b8d[_0xd338('0x48')]['id']}})[_0xd338('0x26')](handleEntityNotFound(_0x1a048f,null))[_0xd338('0x26')](function(_0x2a66b5){if(_0x2a66b5){return _0x2a66b5['setTags'](_0x1a6b8d[_0xd338('0x4c')][_0xd338('0x56')]||[]);}return null;})['then'](respondWithResult(_0x1a048f,null))[_0xd338('0x47')](handleError(_0x1a048f,null));};
\ No newline at end of file
+var _0xdd7e=['findOne','getDescriptions','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','ZendeskConfiguration','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','length','includeAll','find','create','body','getFields','ZendeskField','rawAttributes','getSubjects'];(function(_0x11e001,_0xb3367b){var _0x417419=function(_0x33f535){while(--_0x33f535){_0x11e001['push'](_0x11e001['shift']());}};_0x417419(++_0xb3367b);}(_0xdd7e,0x1a4));var _0xedd7=function(_0x263362,_0x4fae27){_0x263362=_0x263362-0x0;var _0x4d82dd=_0xdd7e[_0x263362];return _0x4d82dd;};'use strict';var emlformat=require(_0xedd7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xedd7('0x1'));var rp=require(_0xedd7('0x2'));var moment=require(_0xedd7('0x3'));var BPromise=require(_0xedd7('0x4'));var Mustache=require('mustache');var util=require(_0xedd7('0x5'));var path=require('path');var sox=require(_0xedd7('0x6'));var csv=require(_0xedd7('0x7'));var ejs=require(_0xedd7('0x8'));var fs=require('fs');var fs_extra=require(_0xedd7('0x9'));var _=require(_0xedd7('0xa'));var squel=require(_0xedd7('0xb'));var crypto=require(_0xedd7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xedd7('0xd'));var toCsv=require(_0xedd7('0x7'));var querystring=require('querystring');var Papa=require(_0xedd7('0xe'));var Redis=require(_0xedd7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xedd7('0x10'));var as=require(_0xedd7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xedd7('0x12'))(_0xedd7('0x13'));var utils=require(_0xedd7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xedd7('0x15'));var db=require(_0xedd7('0x16'))['db'];function respondWithStatusCode(_0x254c63,_0xe8f77d){_0xe8f77d=_0xe8f77d||0xcc;return function(_0x557d87){if(_0x557d87){return _0x254c63[_0xedd7('0x17')](_0xe8f77d);}return _0x254c63['status'](_0xe8f77d)[_0xedd7('0x18')]();};}function respondWithResult(_0x11b03f,_0x16943c){_0x16943c=_0x16943c||0xc8;return function(_0x33fa6f){if(_0x33fa6f){return _0x11b03f[_0xedd7('0x19')](_0x16943c)[_0xedd7('0x1a')](_0x33fa6f);}};}function respondWithFilteredResult(_0x4dce1d,_0x1ebfc2){return function(_0x5cd30d){if(_0x5cd30d){var _0x3fd562=typeof _0x1ebfc2[_0xedd7('0x1b')]===_0xedd7('0x1c')&&typeof _0x1ebfc2[_0xedd7('0x1d')]===_0xedd7('0x1c');var _0xe53c7a=_0x5cd30d[_0xedd7('0x1e')];var _0x1f7b88=_0x3fd562?0x0:_0x1ebfc2['offset'];var _0x2061f3=_0x3fd562?_0x5cd30d[_0xedd7('0x1e')]:_0x1ebfc2['offset']+_0x1ebfc2['limit'];var _0x2b0baf;if(_0x2061f3>=_0xe53c7a){_0x2061f3=_0xe53c7a;_0x2b0baf=0xc8;}else{_0x2b0baf=0xce;}_0x4dce1d[_0xedd7('0x19')](_0x2b0baf);return _0x4dce1d[_0xedd7('0x1f')](_0xedd7('0x20'),_0x1f7b88+'-'+_0x2061f3+'/'+_0xe53c7a)[_0xedd7('0x1a')](_0x5cd30d);}return null;};}function patchUpdates(_0x28375a){return function(_0x3448fc){try{jsonpatch[_0xedd7('0x21')](_0x3448fc,_0x28375a,!![]);}catch(_0xec12c2){return BPromise['reject'](_0xec12c2);}return _0x3448fc[_0xedd7('0x22')]();};}function saveUpdates(_0xe480f1,_0x5d6a60){return function(_0x15fb36){if(_0x15fb36){return _0x15fb36[_0xedd7('0x23')](_0xe480f1)[_0xedd7('0x24')](function(_0x2c5730){return _0x2c5730;});}return null;};}function removeEntity(_0x306e35,_0x52f4fb){return function(_0x44fc3d){if(_0x44fc3d){return _0x44fc3d[_0xedd7('0x25')]()[_0xedd7('0x24')](function(){_0x306e35['status'](0xcc)[_0xedd7('0x18')]();});}};}function handleEntityNotFound(_0x197969,_0x54c2df){return function(_0x36af9c){if(!_0x36af9c){_0x197969['sendStatus'](0x194);}return _0x36af9c;};}function handleError(_0x58c525,_0x22de74){_0x22de74=_0x22de74||0x1f4;return function(_0x4cf918){logger[_0xedd7('0x26')](_0x4cf918['stack']);if(_0x4cf918[_0xedd7('0x27')]){delete _0x4cf918[_0xedd7('0x27')];}_0x58c525[_0xedd7('0x19')](_0x22de74)[_0xedd7('0x28')](_0x4cf918);};}exports[_0xedd7('0x29')]=function(_0x21c84a,_0x4fe0bd){var _0x1c7ba4={},_0x55aa7c={},_0x35d65d={'count':0x0,'rows':[]};var _0x2bcb6f=_[_0xedd7('0x2a')](db[_0xedd7('0x2b')]['rawAttributes'],function(_0x39192c){return{'name':_0x39192c[_0xedd7('0x2c')],'type':_0x39192c[_0xedd7('0x2d')][_0xedd7('0x2e')]};});_0x55aa7c['model']=_['map'](_0x2bcb6f,_0xedd7('0x27'));_0x55aa7c[_0xedd7('0x2f')]=_[_0xedd7('0x30')](_0x21c84a[_0xedd7('0x2f')]);_0x55aa7c[_0xedd7('0x31')]=_[_0xedd7('0x32')](_0x55aa7c['model'],_0x55aa7c[_0xedd7('0x2f')]);_0x1c7ba4[_0xedd7('0x33')]=_[_0xedd7('0x32')](_0x55aa7c[_0xedd7('0x34')],qs['fields'](_0x21c84a[_0xedd7('0x2f')][_0xedd7('0x35')]));_0x1c7ba4['attributes']=_0x1c7ba4[_0xedd7('0x33')]['length']?_0x1c7ba4[_0xedd7('0x33')]:_0x55aa7c['model'];if(!_0x21c84a[_0xedd7('0x2f')][_0xedd7('0x36')](_0xedd7('0x37'))){_0x1c7ba4[_0xedd7('0x1d')]=qs[_0xedd7('0x1d')](_0x21c84a['query'][_0xedd7('0x1d')]);_0x1c7ba4[_0xedd7('0x1b')]=qs[_0xedd7('0x1b')](_0x21c84a['query'][_0xedd7('0x1b')]);}_0x1c7ba4[_0xedd7('0x38')]=qs[_0xedd7('0x39')](_0x21c84a[_0xedd7('0x2f')]['sort']);_0x1c7ba4[_0xedd7('0x3a')]=qs[_0xedd7('0x31')](_[_0xedd7('0x3b')](_0x21c84a['query'],_0x55aa7c[_0xedd7('0x31')]),_0x2bcb6f);if(_0x21c84a[_0xedd7('0x2f')]['filter']){_0x1c7ba4[_0xedd7('0x3a')]=_[_0xedd7('0x3c')](_0x1c7ba4[_0xedd7('0x3a')],{'$or':_['map'](_0x2bcb6f,function(_0x376e0e){if(_0x376e0e[_0xedd7('0x2d')]!==_0xedd7('0x3d')){var _0x1cf117={};_0x1cf117[_0x376e0e[_0xedd7('0x27')]]={'$like':'%'+_0x21c84a[_0xedd7('0x2f')][_0xedd7('0x3e')]+'%'};return _0x1cf117;}})});}_0x1c7ba4=_['merge']({},_0x1c7ba4,_0x21c84a[_0xedd7('0x3f')]);var _0x3153bc={'where':_0x1c7ba4['where']};return db[_0xedd7('0x2b')][_0xedd7('0x1e')](_0x3153bc)[_0xedd7('0x24')](function(_0x3a0377){_0x35d65d[_0xedd7('0x1e')]=_0x3a0377;if(_0x21c84a['query']['includeAll']){_0x1c7ba4[_0xedd7('0x40')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xedd7('0x41')](_0x1c7ba4);})[_0xedd7('0x24')](function(_0x4aa063){_0x35d65d['rows']=_0x4aa063;return _0x35d65d;})[_0xedd7('0x24')](respondWithFilteredResult(_0x4fe0bd,_0x1c7ba4))[_0xedd7('0x42')](handleError(_0x4fe0bd,null));};exports[_0xedd7('0x43')]=function(_0x31aab5,_0x1eeb5c){var _0x3c17cf={'raw':![],'where':{'id':_0x31aab5[_0xedd7('0x44')]['id']}},_0x12c4e8={};_0x12c4e8[_0xedd7('0x34')]=_[_0xedd7('0x30')](db[_0xedd7('0x2b')]['rawAttributes']);_0x12c4e8[_0xedd7('0x2f')]=_[_0xedd7('0x30')](_0x31aab5['query']);_0x12c4e8[_0xedd7('0x31')]=_[_0xedd7('0x32')](_0x12c4e8['model'],_0x12c4e8[_0xedd7('0x2f')]);_0x3c17cf[_0xedd7('0x33')]=_['intersection'](_0x12c4e8[_0xedd7('0x34')],qs[_0xedd7('0x35')](_0x31aab5[_0xedd7('0x2f')][_0xedd7('0x35')]));_0x3c17cf[_0xedd7('0x33')]=_0x3c17cf[_0xedd7('0x33')][_0xedd7('0x45')]?_0x3c17cf[_0xedd7('0x33')]:_0x12c4e8[_0xedd7('0x34')];if(_0x31aab5['query'][_0xedd7('0x46')]){_0x3c17cf[_0xedd7('0x40')]=[{'all':!![]}];}_0x3c17cf=_[_0xedd7('0x3c')]({},_0x3c17cf,_0x31aab5[_0xedd7('0x3f')]);return db[_0xedd7('0x2b')][_0xedd7('0x47')](_0x3c17cf)[_0xedd7('0x24')](handleEntityNotFound(_0x1eeb5c,null))[_0xedd7('0x24')](respondWithResult(_0x1eeb5c,null))[_0xedd7('0x42')](handleError(_0x1eeb5c,null));};exports[_0xedd7('0x48')]=function(_0x22b80f,_0x1d423d){return db[_0xedd7('0x2b')][_0xedd7('0x48')](_0x22b80f[_0xedd7('0x49')],{})[_0xedd7('0x24')](respondWithResult(_0x1d423d,0xc9))[_0xedd7('0x42')](handleError(_0x1d423d,null));};exports[_0xedd7('0x23')]=function(_0x1cd980,_0x4438b1){if(_0x1cd980[_0xedd7('0x49')]['id']){delete _0x1cd980['body']['id'];}return db['ZendeskConfiguration'][_0xedd7('0x47')]({'where':{'id':_0x1cd980[_0xedd7('0x44')]['id']}})[_0xedd7('0x24')](handleEntityNotFound(_0x4438b1,null))[_0xedd7('0x24')](saveUpdates(_0x1cd980[_0xedd7('0x49')],null))[_0xedd7('0x24')](respondWithResult(_0x4438b1,null))['catch'](handleError(_0x4438b1,null));};exports[_0xedd7('0x25')]=function(_0x3df9f5,_0x4ae759){return db[_0xedd7('0x2b')][_0xedd7('0x47')]({'where':{'id':_0x3df9f5[_0xedd7('0x44')]['id']}})[_0xedd7('0x24')](handleEntityNotFound(_0x4ae759,null))[_0xedd7('0x24')](removeEntity(_0x4ae759,null))[_0xedd7('0x42')](handleError(_0x4ae759,null));};exports[_0xedd7('0x4a')]=function(_0x2d4979,_0x340aef,_0x25db7b){var _0x1e2072={};var _0x366967={};var _0x580663;var _0x3acf5b;return db[_0xedd7('0x2b')]['findOne']({'where':{'id':_0x2d4979['params']['id']}})[_0xedd7('0x24')](handleEntityNotFound(_0x340aef,null))[_0xedd7('0x24')](function(_0xe99840){if(_0xe99840){_0x580663=_0xe99840;_0x366967[_0xedd7('0x34')]=_['keys'](db[_0xedd7('0x4b')][_0xedd7('0x4c')]);_0x366967[_0xedd7('0x2f')]=_[_0xedd7('0x30')](_0x2d4979[_0xedd7('0x2f')]);_0x366967[_0xedd7('0x31')]=_['intersection'](_0x366967[_0xedd7('0x34')],_0x366967[_0xedd7('0x2f')]);_0x1e2072[_0xedd7('0x33')]=_['intersection'](_0x366967[_0xedd7('0x34')],qs[_0xedd7('0x35')](_0x2d4979[_0xedd7('0x2f')][_0xedd7('0x35')]));_0x1e2072[_0xedd7('0x33')]=_0x1e2072[_0xedd7('0x33')][_0xedd7('0x45')]?_0x1e2072[_0xedd7('0x33')]:_0x366967[_0xedd7('0x34')];_0x1e2072['order']=qs['sort'](_0x2d4979[_0xedd7('0x2f')]['sort']);_0x1e2072[_0xedd7('0x3a')]=qs[_0xedd7('0x31')](_[_0xedd7('0x3b')](_0x2d4979[_0xedd7('0x2f')],_0x366967[_0xedd7('0x31')]));if(_0x2d4979['query']['filter']){_0x1e2072['where']=_[_0xedd7('0x3c')](_0x1e2072[_0xedd7('0x3a')],{'$or':_['map'](_0x1e2072['attributes'],function(_0x3aa163){var _0x35d7a8={};_0x35d7a8[_0x3aa163]={'$like':'%'+_0x2d4979['query'][_0xedd7('0x3e')]+'%'};return _0x35d7a8;})});}_0x1e2072=_[_0xedd7('0x3c')]({},_0x1e2072,_0x2d4979['options']);return _0x580663[_0xedd7('0x4a')](_0x1e2072);}})[_0xedd7('0x24')](function(_0x15473c){if(_0x15473c){_0x3acf5b=_0x15473c[_0xedd7('0x45')];if(!_0x2d4979[_0xedd7('0x2f')]['hasOwnProperty'](_0xedd7('0x37'))){_0x1e2072[_0xedd7('0x1d')]=qs['limit'](_0x2d4979[_0xedd7('0x2f')][_0xedd7('0x1d')]);_0x1e2072['offset']=qs['offset'](_0x2d4979[_0xedd7('0x2f')][_0xedd7('0x1b')]);}return _0x580663[_0xedd7('0x4a')](_0x1e2072);}})['then'](function(_0x420273){if(_0x420273){return _0x420273?{'count':_0x3acf5b,'rows':_0x420273}:null;}})['then'](respondWithResult(_0x340aef,null))[_0xedd7('0x42')](handleError(_0x340aef,null));};exports[_0xedd7('0x4d')]=function(_0x3a6a80,_0xf01c0a,_0x5906d7){var _0x3c002b={};var _0x2c3a3d={};var _0x648d1d;var _0x38ea91;return db[_0xedd7('0x2b')][_0xedd7('0x4e')]({'where':{'id':_0x3a6a80[_0xedd7('0x44')]['id']}})[_0xedd7('0x24')](handleEntityNotFound(_0xf01c0a,null))[_0xedd7('0x24')](function(_0x78d214){if(_0x78d214){_0x648d1d=_0x78d214;_0x2c3a3d[_0xedd7('0x34')]=_[_0xedd7('0x30')](db[_0xedd7('0x4b')][_0xedd7('0x4c')]);_0x2c3a3d['query']=_['keys'](_0x3a6a80[_0xedd7('0x2f')]);_0x2c3a3d[_0xedd7('0x31')]=_[_0xedd7('0x32')](_0x2c3a3d[_0xedd7('0x34')],_0x2c3a3d[_0xedd7('0x2f')]);_0x3c002b[_0xedd7('0x33')]=_[_0xedd7('0x32')](_0x2c3a3d[_0xedd7('0x34')],qs[_0xedd7('0x35')](_0x3a6a80[_0xedd7('0x2f')][_0xedd7('0x35')]));_0x3c002b[_0xedd7('0x33')]=_0x3c002b['attributes']['length']?_0x3c002b[_0xedd7('0x33')]:_0x2c3a3d[_0xedd7('0x34')];_0x3c002b[_0xedd7('0x38')]=qs[_0xedd7('0x39')](_0x3a6a80[_0xedd7('0x2f')][_0xedd7('0x39')]);_0x3c002b[_0xedd7('0x3a')]=qs[_0xedd7('0x31')](_[_0xedd7('0x3b')](_0x3a6a80[_0xedd7('0x2f')],_0x2c3a3d['filters']));if(_0x3a6a80[_0xedd7('0x2f')][_0xedd7('0x3e')]){_0x3c002b['where']=_['merge'](_0x3c002b[_0xedd7('0x3a')],{'$or':_[_0xedd7('0x2a')](_0x3c002b[_0xedd7('0x33')],function(_0x1a43df){var _0x18d2e7={};_0x18d2e7[_0x1a43df]={'$like':'%'+_0x3a6a80[_0xedd7('0x2f')][_0xedd7('0x3e')]+'%'};return _0x18d2e7;})});}_0x3c002b=_['merge']({},_0x3c002b,_0x3a6a80[_0xedd7('0x3f')]);return _0x648d1d['getSubjects'](_0x3c002b);}})['then'](function(_0x322525){if(_0x322525){_0x38ea91=_0x322525[_0xedd7('0x45')];if(!_0x3a6a80[_0xedd7('0x2f')][_0xedd7('0x36')](_0xedd7('0x37'))){_0x3c002b[_0xedd7('0x1d')]=qs['limit'](_0x3a6a80[_0xedd7('0x2f')]['limit']);_0x3c002b[_0xedd7('0x1b')]=qs[_0xedd7('0x1b')](_0x3a6a80[_0xedd7('0x2f')][_0xedd7('0x1b')]);}return _0x648d1d[_0xedd7('0x4d')](_0x3c002b);}})[_0xedd7('0x24')](function(_0x5578c2){if(_0x5578c2){return _0x5578c2?{'count':_0x38ea91,'rows':_0x5578c2}:null;}})[_0xedd7('0x24')](respondWithResult(_0xf01c0a,null))[_0xedd7('0x42')](handleError(_0xf01c0a,null));};exports[_0xedd7('0x4f')]=function(_0x3caef8,_0x2decd1,_0x49c187){var _0x3cd3cc={};var _0x2f1cca={};var _0x423c7a;var _0x57451f;return db[_0xedd7('0x2b')][_0xedd7('0x4e')]({'where':{'id':_0x3caef8[_0xedd7('0x44')]['id']}})[_0xedd7('0x24')](handleEntityNotFound(_0x2decd1,null))[_0xedd7('0x24')](function(_0x54a6de){if(_0x54a6de){_0x423c7a=_0x54a6de;_0x2f1cca['model']=_[_0xedd7('0x30')](db[_0xedd7('0x4b')]['rawAttributes']);_0x2f1cca[_0xedd7('0x2f')]=_['keys'](_0x3caef8[_0xedd7('0x2f')]);_0x2f1cca[_0xedd7('0x31')]=_['intersection'](_0x2f1cca[_0xedd7('0x34')],_0x2f1cca[_0xedd7('0x2f')]);_0x3cd3cc[_0xedd7('0x33')]=_[_0xedd7('0x32')](_0x2f1cca[_0xedd7('0x34')],qs['fields'](_0x3caef8['query'][_0xedd7('0x35')]));_0x3cd3cc[_0xedd7('0x33')]=_0x3cd3cc['attributes'][_0xedd7('0x45')]?_0x3cd3cc[_0xedd7('0x33')]:_0x2f1cca[_0xedd7('0x34')];_0x3cd3cc[_0xedd7('0x38')]=qs[_0xedd7('0x39')](_0x3caef8[_0xedd7('0x2f')][_0xedd7('0x39')]);_0x3cd3cc[_0xedd7('0x3a')]=qs['filters'](_[_0xedd7('0x3b')](_0x3caef8[_0xedd7('0x2f')],_0x2f1cca['filters']));if(_0x3caef8[_0xedd7('0x2f')][_0xedd7('0x3e')]){_0x3cd3cc['where']=_[_0xedd7('0x3c')](_0x3cd3cc[_0xedd7('0x3a')],{'$or':_[_0xedd7('0x2a')](_0x3cd3cc[_0xedd7('0x33')],function(_0x133ab0){var _0x22f76f={};_0x22f76f[_0x133ab0]={'$like':'%'+_0x3caef8[_0xedd7('0x2f')][_0xedd7('0x3e')]+'%'};return _0x22f76f;})});}_0x3cd3cc=_[_0xedd7('0x3c')]({},_0x3cd3cc,_0x3caef8[_0xedd7('0x3f')]);return _0x423c7a[_0xedd7('0x4f')](_0x3cd3cc);}})[_0xedd7('0x24')](function(_0x59ff4e){if(_0x59ff4e){_0x57451f=_0x59ff4e['length'];if(!_0x3caef8[_0xedd7('0x2f')]['hasOwnProperty'](_0xedd7('0x37'))){_0x3cd3cc['limit']=qs[_0xedd7('0x1d')](_0x3caef8['query'][_0xedd7('0x1d')]);_0x3cd3cc[_0xedd7('0x1b')]=qs['offset'](_0x3caef8['query'][_0xedd7('0x1b')]);}return _0x423c7a[_0xedd7('0x4f')](_0x3cd3cc);}})['then'](function(_0x411501){if(_0x411501){return _0x411501?{'count':_0x57451f,'rows':_0x411501}:null;}})[_0xedd7('0x24')](respondWithResult(_0x2decd1,null))[_0xedd7('0x42')](handleError(_0x2decd1,null));};exports[_0xedd7('0x50')]=function(_0x150029,_0x376866,_0x909f4a){var _0x586a2d={};var _0x3e3941={};var _0x58c8b4;var _0x3200a2;return db['ZendeskConfiguration'][_0xedd7('0x4e')]({'where':{'id':_0x150029['params']['id']}})[_0xedd7('0x24')](handleEntityNotFound(_0x376866,null))[_0xedd7('0x24')](function(_0x21355b){if(_0x21355b){_0x58c8b4=_0x21355b;_0x3e3941[_0xedd7('0x34')]=_[_0xedd7('0x30')](db['Tag']['rawAttributes']);_0x3e3941[_0xedd7('0x2f')]=_[_0xedd7('0x30')](_0x150029[_0xedd7('0x2f')]);_0x3e3941['filters']=_[_0xedd7('0x32')](_0x3e3941[_0xedd7('0x34')],_0x3e3941[_0xedd7('0x2f')]);_0x586a2d[_0xedd7('0x33')]=_[_0xedd7('0x32')](_0x3e3941[_0xedd7('0x34')],qs[_0xedd7('0x35')](_0x150029[_0xedd7('0x2f')][_0xedd7('0x35')]));_0x586a2d[_0xedd7('0x33')]=_0x586a2d[_0xedd7('0x33')][_0xedd7('0x45')]?_0x586a2d['attributes']:_0x3e3941[_0xedd7('0x34')];_0x586a2d['order']=qs[_0xedd7('0x39')](_0x150029[_0xedd7('0x2f')][_0xedd7('0x39')]);_0x586a2d[_0xedd7('0x3a')]=qs[_0xedd7('0x31')](_[_0xedd7('0x3b')](_0x150029[_0xedd7('0x2f')],_0x3e3941[_0xedd7('0x31')]));if(_0x150029[_0xedd7('0x2f')]['filter']){_0x586a2d[_0xedd7('0x3a')]=_[_0xedd7('0x3c')](_0x586a2d[_0xedd7('0x3a')],{'$or':_[_0xedd7('0x2a')](_0x586a2d[_0xedd7('0x33')],function(_0x3ba20e){var _0x2610c3={};_0x2610c3[_0x3ba20e]={'$like':'%'+_0x150029['query']['filter']+'%'};return _0x2610c3;})});}_0x586a2d=_[_0xedd7('0x3c')]({},_0x586a2d,_0x150029[_0xedd7('0x3f')]);return _0x58c8b4[_0xedd7('0x50')](_0x586a2d);}})['then'](function(_0x40bc03){if(_0x40bc03){_0x3200a2=_0x40bc03[_0xedd7('0x45')];if(!_0x150029[_0xedd7('0x2f')]['hasOwnProperty'](_0xedd7('0x37'))){_0x586a2d['limit']=qs[_0xedd7('0x1d')](_0x150029['query'][_0xedd7('0x1d')]);_0x586a2d['offset']=qs[_0xedd7('0x1b')](_0x150029[_0xedd7('0x2f')][_0xedd7('0x1b')]);}return _0x58c8b4[_0xedd7('0x50')](_0x586a2d);}})[_0xedd7('0x24')](function(_0x548202){if(_0x548202){return _0x548202?{'count':_0x3200a2,'rows':_0x548202}:null;}})[_0xedd7('0x24')](respondWithResult(_0x376866,null))[_0xedd7('0x42')](handleError(_0x376866,null));};exports[_0xedd7('0x51')]=function(_0x5582e1,_0x41ccb0,_0x6d0425){if(_0x5582e1['body']['id']){delete _0x5582e1[_0xedd7('0x49')]['id'];}return db[_0xedd7('0x2b')][_0xedd7('0x4e')]({'where':{'id':_0x5582e1['params']['id']}})[_0xedd7('0x24')](handleEntityNotFound(_0x41ccb0,null))[_0xedd7('0x24')](function(_0x2dd7a7){if(_0x2dd7a7){return _0x2dd7a7[_0xedd7('0x51')](_0x5582e1[_0xedd7('0x49')][_0xedd7('0x52')]||[]);}return null;})[_0xedd7('0x24')](respondWithResult(_0x41ccb0,null))[_0xedd7('0x42')](handleError(_0x41ccb0,null));};
\ No newline at end of file
index 5f60991..85fb18b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a5=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define','ZendeskConfiguration','lodash','util'];(function(_0x5562fe,_0x4e809c){var _0x1829c7=function(_0x18919f){while(--_0x18919f){_0x5562fe['push'](_0x5562fe['shift']());}};_0x1829c7(++_0x4e809c);}(_0x63a5,0x18e));var _0x563a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x63a5[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var logger=require(_0x563a('0x2'))('api');var moment=require(_0x563a('0x3'));var BPromise=require('bluebird');var rp=require(_0x563a('0x4'));var fs=require('fs');var path=require(_0x563a('0x5'));var rimraf=require(_0x563a('0x6'));var config=require(_0x563a('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x1fdcb0,_0x5a6458){return _0x1fdcb0[_0x563a('0x8')](_0x563a('0x9'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x373d=['define','ZendeskConfiguration','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x373d,0x1e2));var _0xd373=function(_0x4812c9,_0x154b76){_0x4812c9=_0x4812c9-0x0;var _0x4de61f=_0x373d[_0x4812c9];return _0x4de61f;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var logger=require(_0xd373('0x1'))(_0xd373('0x2'));var moment=require(_0xd373('0x3'));var BPromise=require(_0xd373('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd373('0x5'));var rimraf=require(_0xd373('0x6'));var config=require(_0xd373('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x31a0fb,_0x3e4443){return _0x31a0fb[_0xd373('0x8')](_0xd373('0x9'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f80d9a6..c8cdecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01fe=['message','catch','util','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x57306f,_0x5260da){var _0x3ec2af=function(_0x4304e3){while(--_0x4304e3){_0x57306f['push'](_0x57306f['shift']());}};_0x3ec2af(++_0x5260da);}(_0x01fe,0x145));var _0xe01f=function(_0x2d340,_0x45f123){_0x2d340=_0x2d340-0x0;var _0x695c61=_0x01fe[_0x2d340];return _0x695c61;};'use strict';var _=require('lodash');var util=require(_0xe01f('0x0'));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(_0xe01f('0x1'));var logger=require('../../config/logger')(_0xe01f('0x2'));var config=require(_0xe01f('0x3'));var jayson=require(_0xe01f('0x4'));var client=jayson[_0xe01f('0x5')][_0xe01f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3cfcc6,_0x4e53c7,_0x191533){return new BPromise(function(_0x4e05a7,_0x5cd357){return client[_0xe01f('0x7')](_0x3cfcc6,_0x191533)[_0xe01f('0x8')](function(_0x28494a){logger[_0xe01f('0x9')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4e53c7,_0xe01f('0xa'));logger['debug'](_0xe01f('0xb'),_0x4e53c7,_0xe01f('0xa'),JSON[_0xe01f('0xc')](_0x28494a));if(_0x28494a[_0xe01f('0xd')]){if(_0x28494a[_0xe01f('0xd')]['code']===0x1f4){logger[_0xe01f('0xd')](_0xe01f('0xe'),_0x4e53c7,_0x28494a[_0xe01f('0xd')][_0xe01f('0xf')]);return _0x5cd357(_0x28494a[_0xe01f('0xd')][_0xe01f('0xf')]);}logger[_0xe01f('0xd')](_0xe01f('0xe'),_0x4e53c7,_0x28494a[_0xe01f('0xd')][_0xe01f('0xf')]);return _0x4e05a7(_0x28494a[_0xe01f('0xd')][_0xe01f('0xf')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x4e53c7,_0xe01f('0xa'));_0x4e05a7(_0x28494a['result'][_0xe01f('0xf')]);}})[_0xe01f('0x10')](function(_0x3e7e7d){logger[_0xe01f('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4e53c7,_0x3e7e7d);_0x5cd357(_0x3e7e7d);});});}
\ No newline at end of file
+var _0xf699=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','result','catch'];(function(_0x295ab9,_0x243013){var _0x436e65=function(_0x2cf101){while(--_0x2cf101){_0x295ab9['push'](_0x295ab9['shift']());}};_0x436e65(++_0x243013);}(_0xf699,0xbe));var _0x9f69=function(_0x56a15e,_0x45de7e){_0x56a15e=_0x56a15e-0x0;var _0x1b2394=_0xf699[_0x56a15e];return _0x1b2394;};'use strict';var _=require('lodash');var util=require(_0x9f69('0x0'));var moment=require('moment');var BPromise=require(_0x9f69('0x1'));var rs=require(_0x9f69('0x2'));var fs=require('fs');var Redis=require(_0x9f69('0x3'));var db=require(_0x9f69('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f69('0x5'))(_0x9f69('0x6'));var config=require('../../config/environment');var jayson=require(_0x9f69('0x7'));var client=jayson[_0x9f69('0x8')][_0x9f69('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d9528,_0x45c578,_0x4fae6b){return new BPromise(function(_0x43f63f,_0x14597e){return client[_0x9f69('0xa')](_0x1d9528,_0x4fae6b)['then'](function(_0xa0a51f){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x45c578,'request\x20sent');logger['debug'](_0x9f69('0xb'),_0x45c578,'request\x20sent',JSON[_0x9f69('0xc')](_0xa0a51f));if(_0xa0a51f['error']){if(_0xa0a51f[_0x9f69('0xd')]['code']===0x1f4){logger[_0x9f69('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x45c578,_0xa0a51f[_0x9f69('0xd')][_0x9f69('0xe')]);return _0x14597e(_0xa0a51f[_0x9f69('0xd')][_0x9f69('0xe')]);}logger[_0x9f69('0xd')](_0x9f69('0xf'),_0x45c578,_0xa0a51f['error'][_0x9f69('0xe')]);return _0x43f63f(_0xa0a51f[_0x9f69('0xd')][_0x9f69('0xe')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x45c578,_0x9f69('0x10'));_0x43f63f(_0xa0a51f[_0x9f69('0x11')][_0x9f69('0xe')]);}})[_0x9f69('0x12')](function(_0xb2e465){logger[_0x9f69('0xd')](_0x9f69('0xf'),_0x45c578,_0xb2e465);_0x14597e(_0xb2e465);});});}
\ No newline at end of file
index 585792e..da0a977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1842=['./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x433f89,_0x175692){var _0x5c7d8e=function(_0x3b660f){while(--_0x3b660f){_0x433f89['push'](_0x433f89['shift']());}};_0x5c7d8e(++_0x175692);}(_0x1842,0x1f2));var _0x2184=function(_0x4c9047,_0x431c63){_0x4c9047=_0x4c9047-0x0;var _0x58012a=_0x1842[_0x4c9047];return _0x58012a;};'use strict';var multer=require(_0x2184('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2184('0x1'));var express=require(_0x2184('0x2'));var router=express[_0x2184('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2184('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2184('0x5'));var controller=require(_0x2184('0x6'));router[_0x2184('0x7')]('/',auth[_0x2184('0x8')](),controller[_0x2184('0x9')]);router[_0x2184('0x7')](_0x2184('0xa'),auth[_0x2184('0x8')](),controller[_0x2184('0xb')]);router[_0x2184('0xc')]('/',auth[_0x2184('0x8')](),controller[_0x2184('0xd')]);router[_0x2184('0xe')](_0x2184('0xa'),auth['isAuthenticated'](),controller[_0x2184('0xf')]);router[_0x2184('0x10')](_0x2184('0xa'),auth[_0x2184('0x8')](),controller[_0x2184('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x468b=['../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/interaction/service'];(function(_0x2cbadc,_0x84c74f){var _0x544ef6=function(_0x8deed1){while(--_0x8deed1){_0x2cbadc['push'](_0x2cbadc['shift']());}};_0x544ef6(++_0x84c74f);}(_0x468b,0x1e2));var _0xb468=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x468b[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0xb468('0x0'));var path=require('path');var timeout=require(_0xb468('0x1'));var express=require(_0xb468('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb468('0x3'));var config=require(_0xb468('0x4'));var controller=require(_0xb468('0x5'));router[_0xb468('0x6')]('/',auth['isAuthenticated'](),controller[_0xb468('0x7')]);router[_0xb468('0x6')](_0xb468('0x8'),auth[_0xb468('0x9')](),controller[_0xb468('0xa')]);router[_0xb468('0xb')]('/',auth[_0xb468('0x9')](),controller[_0xb468('0xc')]);router[_0xb468('0xd')](_0xb468('0x8'),auth[_0xb468('0x9')](),controller[_0xb468('0xe')]);router[_0xb468('0xf')](_0xb468('0x8'),auth[_0xb468('0x9')](),controller[_0xb468('0x10')]);module[_0xb468('0x11')]=router;
\ No newline at end of file
index cee0bde..ce5ffc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72e7=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x32ceec,_0xdbd534){var _0x5b29c8=function(_0x8892b0){while(--_0x8892b0){_0x32ceec['push'](_0x32ceec['shift']());}};_0x5b29c8(++_0xdbd534);}(_0x72e7,0x1de));var _0x772e=function(_0x1856df,_0x360ad8){_0x1856df=_0x1856df-0x0;var _0x4c8c73=_0x72e7[_0x1856df];return _0x4c8c73;};'use strict';var Sequelize=require(_0x772e('0x0'));module[_0x772e('0x1')]={'type':{'type':Sequelize[_0x772e('0x2')](_0x772e('0x3'),_0x772e('0x4'),_0x772e('0x5'),_0x772e('0x6'),_0x772e('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x772e('0x2')](_0x772e('0x3'),_0x772e('0x4'),_0x772e('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x772e('0x8')]},'nameField':{'type':Sequelize[_0x772e('0x8')]},'customField':{'type':Sequelize[_0x772e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2ea4=['ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING'];(function(_0x206da1,_0x13f354){var _0x312b6f=function(_0x439865){while(--_0x439865){_0x206da1['push'](_0x206da1['shift']());}};_0x312b6f(++_0x13f354);}(_0x2ea4,0x125));var _0x42ea=function(_0x4c057f,_0x1ed571){_0x4c057f=_0x4c057f-0x0;var _0x154bbd=_0x2ea4[_0x4c057f];return _0x154bbd;};'use strict';var Sequelize=require(_0x42ea('0x0'));module[_0x42ea('0x1')]={'type':{'type':Sequelize['ENUM'](_0x42ea('0x2'),_0x42ea('0x3'),'customVariable',_0x42ea('0x4'),_0x42ea('0x5')),'defaultValue':_0x42ea('0x2')},'content':{'type':Sequelize[_0x42ea('0x6')]},'key':{'type':Sequelize[_0x42ea('0x6')]},'keyType':{'type':Sequelize[_0x42ea('0x7')]('string',_0x42ea('0x3'),_0x42ea('0x8'))},'keyContent':{'type':Sequelize[_0x42ea('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x42ea('0x6')]},'customField':{'type':Sequelize[_0x42ea('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x42ea('0x6')]}};
\ No newline at end of file
index 4e11f01..7e95bf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe23=['name','send','index','map','ZendeskField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','catch','show','params','find','body','eml-format','fast-json-patch','request-promise','moment','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/license/hardware','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','stack'];(function(_0x2e819c,_0x3f99a5){var _0x24e271=function(_0x27d596){while(--_0x27d596){_0x2e819c['push'](_0x2e819c['shift']());}};_0x24e271(++_0x3f99a5);}(_0xbe23,0x1c2));var _0x3be2=function(_0x2a6d98,_0x42b6f6){_0x2a6d98=_0x2a6d98-0x0;var _0x32e481=_0xbe23[_0x2a6d98];return _0x32e481;};'use strict';var emlformat=require(_0x3be2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3be2('0x1'));var rp=require(_0x3be2('0x2'));var moment=require(_0x3be2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3be2('0x4'));var util=require(_0x3be2('0x5'));var path=require(_0x3be2('0x6'));var sox=require(_0x3be2('0x7'));var csv=require(_0x3be2('0x8'));var ejs=require(_0x3be2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3be2('0xa'));var crypto=require(_0x3be2('0xb'));var jsforce=require(_0x3be2('0xc'));var deskjs=require(_0x3be2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3be2('0xe'));var Papa=require(_0x3be2('0xf'));var Redis=require(_0x3be2('0x10'));var authService=require(_0x3be2('0x11'));var qs=require(_0x3be2('0x12'));var as=require(_0x3be2('0x13'));var hardwareService=require(_0x3be2('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3be2('0x15'));var licenseUtil=require(_0x3be2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x274ca5,_0x423250){_0x423250=_0x423250||0xcc;return function(_0x46346f){if(_0x46346f){return _0x274ca5['sendStatus'](_0x423250);}return _0x274ca5[_0x3be2('0x17')](_0x423250)['end']();};}function respondWithResult(_0x5da702,_0x1a0fb8){_0x1a0fb8=_0x1a0fb8||0xc8;return function(_0x176389){if(_0x176389){return _0x5da702['status'](_0x1a0fb8)[_0x3be2('0x18')](_0x176389);}};}function respondWithFilteredResult(_0x53e619,_0x44cc10){return function(_0x51577b){if(_0x51577b){var _0x8fae14=typeof _0x44cc10[_0x3be2('0x19')]===_0x3be2('0x1a')&&typeof _0x44cc10[_0x3be2('0x1b')]===_0x3be2('0x1a');var _0x33a9ef=_0x51577b[_0x3be2('0x1c')];var _0x2fe4eb=_0x8fae14?0x0:_0x44cc10[_0x3be2('0x19')];var _0x1bd891=_0x8fae14?_0x51577b[_0x3be2('0x1c')]:_0x44cc10[_0x3be2('0x19')]+_0x44cc10[_0x3be2('0x1b')];var _0x4beb76;if(_0x1bd891>=_0x33a9ef){_0x1bd891=_0x33a9ef;_0x4beb76=0xc8;}else{_0x4beb76=0xce;}_0x53e619[_0x3be2('0x17')](_0x4beb76);return _0x53e619[_0x3be2('0x1d')](_0x3be2('0x1e'),_0x2fe4eb+'-'+_0x1bd891+'/'+_0x33a9ef)[_0x3be2('0x18')](_0x51577b);}return null;};}function patchUpdates(_0x5c89af){return function(_0x1a56cb){try{jsonpatch[_0x3be2('0x1f')](_0x1a56cb,_0x5c89af,!![]);}catch(_0x3f7780){return BPromise['reject'](_0x3f7780);}return _0x1a56cb[_0x3be2('0x20')]();};}function saveUpdates(_0x3b4fc0,_0x3df5ee){return function(_0xd2c980){if(_0xd2c980){return _0xd2c980[_0x3be2('0x21')](_0x3b4fc0)['then'](function(_0x44bf46){return _0x44bf46;});}return null;};}function removeEntity(_0x952bea,_0x425084){return function(_0x3e6f86){if(_0x3e6f86){return _0x3e6f86[_0x3be2('0x22')]()[_0x3be2('0x23')](function(){_0x952bea[_0x3be2('0x17')](0xcc)[_0x3be2('0x24')]();});}};}function handleEntityNotFound(_0x554c83,_0x4ae344){return function(_0x53157b){if(!_0x53157b){_0x554c83[_0x3be2('0x25')](0x194);}return _0x53157b;};}function handleError(_0xbcc4dd,_0x1f018b){_0x1f018b=_0x1f018b||0x1f4;return function(_0xf22677){logger[_0x3be2('0x26')](_0xf22677[_0x3be2('0x27')]);if(_0xf22677[_0x3be2('0x28')]){delete _0xf22677[_0x3be2('0x28')];}_0xbcc4dd[_0x3be2('0x17')](_0x1f018b)[_0x3be2('0x29')](_0xf22677);};}exports[_0x3be2('0x2a')]=function(_0x221117,_0x10aedd){var _0x360922={},_0x517913={},_0x2cc1e6={'count':0x0,'rows':[]};var _0x53f3e7=_[_0x3be2('0x2b')](db[_0x3be2('0x2c')][_0x3be2('0x2d')],function(_0x5887f0){return{'name':_0x5887f0['fieldName'],'type':_0x5887f0[_0x3be2('0x2e')][_0x3be2('0x2f')]};});_0x517913[_0x3be2('0x30')]=_[_0x3be2('0x2b')](_0x53f3e7,_0x3be2('0x28'));_0x517913['query']=_[_0x3be2('0x31')](_0x221117[_0x3be2('0x32')]);_0x517913[_0x3be2('0x33')]=_[_0x3be2('0x34')](_0x517913[_0x3be2('0x30')],_0x517913[_0x3be2('0x32')]);_0x360922[_0x3be2('0x35')]=_[_0x3be2('0x34')](_0x517913[_0x3be2('0x30')],qs[_0x3be2('0x36')](_0x221117[_0x3be2('0x32')][_0x3be2('0x36')]));_0x360922[_0x3be2('0x35')]=_0x360922[_0x3be2('0x35')][_0x3be2('0x37')]?_0x360922[_0x3be2('0x35')]:_0x517913[_0x3be2('0x30')];if(!_0x221117[_0x3be2('0x32')][_0x3be2('0x38')]('nolimit')){_0x360922['limit']=qs[_0x3be2('0x1b')](_0x221117[_0x3be2('0x32')]['limit']);_0x360922[_0x3be2('0x19')]=qs['offset'](_0x221117['query'][_0x3be2('0x19')]);}_0x360922[_0x3be2('0x39')]=qs[_0x3be2('0x3a')](_0x221117[_0x3be2('0x32')]['sort']);_0x360922[_0x3be2('0x3b')]=qs[_0x3be2('0x33')](_['pick'](_0x221117['query'],_0x517913['filters']),_0x53f3e7);if(_0x221117[_0x3be2('0x32')][_0x3be2('0x3c')]){_0x360922[_0x3be2('0x3b')]=_[_0x3be2('0x3d')](_0x360922[_0x3be2('0x3b')],{'$or':_[_0x3be2('0x2b')](_0x53f3e7,function(_0xacde1f){if(_0xacde1f['type']!=='VIRTUAL'){var _0x42ea99={};_0x42ea99[_0xacde1f[_0x3be2('0x28')]]={'$like':'%'+_0x221117[_0x3be2('0x32')][_0x3be2('0x3c')]+'%'};return _0x42ea99;}})});}_0x360922=_[_0x3be2('0x3d')]({},_0x360922,_0x221117[_0x3be2('0x3e')]);var _0x94bbed={'where':_0x360922[_0x3be2('0x3b')]};return db[_0x3be2('0x2c')][_0x3be2('0x1c')](_0x94bbed)['then'](function(_0x3bf1bf){_0x2cc1e6[_0x3be2('0x1c')]=_0x3bf1bf;if(_0x221117['query'][_0x3be2('0x3f')]){_0x360922[_0x3be2('0x40')]=[{'all':!![]}];}return db[_0x3be2('0x2c')]['findAll'](_0x360922);})[_0x3be2('0x23')](function(_0x1ef324){_0x2cc1e6['rows']=_0x1ef324;return _0x2cc1e6;})[_0x3be2('0x23')](respondWithFilteredResult(_0x10aedd,_0x360922))[_0x3be2('0x41')](handleError(_0x10aedd,null));};exports[_0x3be2('0x42')]=function(_0x419565,_0x116207){var _0x5a2364={'raw':!![],'where':{'id':_0x419565[_0x3be2('0x43')]['id']}},_0x3e472f={};_0x3e472f[_0x3be2('0x30')]=_[_0x3be2('0x31')](db[_0x3be2('0x2c')][_0x3be2('0x2d')]);_0x3e472f[_0x3be2('0x32')]=_[_0x3be2('0x31')](_0x419565[_0x3be2('0x32')]);_0x3e472f[_0x3be2('0x33')]=_['intersection'](_0x3e472f[_0x3be2('0x30')],_0x3e472f['query']);_0x5a2364[_0x3be2('0x35')]=_[_0x3be2('0x34')](_0x3e472f[_0x3be2('0x30')],qs[_0x3be2('0x36')](_0x419565[_0x3be2('0x32')][_0x3be2('0x36')]));_0x5a2364[_0x3be2('0x35')]=_0x5a2364[_0x3be2('0x35')]['length']?_0x5a2364[_0x3be2('0x35')]:_0x3e472f[_0x3be2('0x30')];if(_0x419565[_0x3be2('0x32')][_0x3be2('0x3f')]){_0x5a2364[_0x3be2('0x40')]=[{'all':!![]}];}_0x5a2364=_[_0x3be2('0x3d')]({},_0x5a2364,_0x419565['options']);return db[_0x3be2('0x2c')][_0x3be2('0x44')](_0x5a2364)[_0x3be2('0x23')](handleEntityNotFound(_0x116207,null))['then'](respondWithResult(_0x116207,null))[_0x3be2('0x41')](handleError(_0x116207,null));};exports['create']=function(_0x4f6458,_0x5c0dcf){return db[_0x3be2('0x2c')]['create'](_0x4f6458['body'],{})['then'](respondWithResult(_0x5c0dcf,0xc9))[_0x3be2('0x41')](handleError(_0x5c0dcf,null));};exports[_0x3be2('0x21')]=function(_0x175d45,_0x1b6c96){if(_0x175d45[_0x3be2('0x45')]['id']){delete _0x175d45[_0x3be2('0x45')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x175d45[_0x3be2('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b6c96,null))['then'](saveUpdates(_0x175d45[_0x3be2('0x45')],null))[_0x3be2('0x23')](respondWithResult(_0x1b6c96,null))[_0x3be2('0x41')](handleError(_0x1b6c96,null));};exports[_0x3be2('0x22')]=function(_0x35ed3d,_0x1d75a4){return db[_0x3be2('0x2c')][_0x3be2('0x44')]({'where':{'id':_0x35ed3d['params']['id']}})[_0x3be2('0x23')](handleEntityNotFound(_0x1d75a4,null))[_0x3be2('0x23')](removeEntity(_0x1d75a4,null))[_0x3be2('0x41')](handleError(_0x1d75a4,null));};
\ No newline at end of file
+var _0x5c7e=['attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','ZendeskField','fieldName','type','model','map','query','keys','intersection'];(function(_0x1c6599,_0x30dda7){var _0x478dd0=function(_0x100f7b){while(--_0x100f7b){_0x1c6599['push'](_0x1c6599['shift']());}};_0x478dd0(++_0x30dda7);}(_0x5c7e,0x16e));var _0xe5c7=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x5c7e[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require(_0xe5c7('0x0'));var rimraf=require(_0xe5c7('0x1'));var zipdir=require(_0xe5c7('0x2'));var jsonpatch=require(_0xe5c7('0x3'));var rp=require(_0xe5c7('0x4'));var moment=require('moment');var BPromise=require(_0xe5c7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe5c7('0x6'));var sox=require(_0xe5c7('0x7'));var csv=require(_0xe5c7('0x8'));var ejs=require(_0xe5c7('0x9'));var fs=require('fs');var fs_extra=require(_0xe5c7('0xa'));var _=require(_0xe5c7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe5c7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe5c7('0x8'));var querystring=require(_0xe5c7('0xd'));var Papa=require(_0xe5c7('0xe'));var Redis=require(_0xe5c7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe5c7('0x10'));var logger=require(_0xe5c7('0x11'))(_0xe5c7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe5c7('0x13'));var db=require(_0xe5c7('0x14'))['db'];function respondWithStatusCode(_0x429cf9,_0x3d510e){_0x3d510e=_0x3d510e||0xcc;return function(_0x3cd062){if(_0x3cd062){return _0x429cf9[_0xe5c7('0x15')](_0x3d510e);}return _0x429cf9[_0xe5c7('0x16')](_0x3d510e)['end']();};}function respondWithResult(_0x5a4c2b,_0x19fdc0){_0x19fdc0=_0x19fdc0||0xc8;return function(_0x314e80){if(_0x314e80){return _0x5a4c2b['status'](_0x19fdc0)[_0xe5c7('0x17')](_0x314e80);}};}function respondWithFilteredResult(_0xdec4b5,_0x11f6ed){return function(_0x5dbd1b){if(_0x5dbd1b){var _0x5e2020=typeof _0x11f6ed[_0xe5c7('0x18')]===_0xe5c7('0x19')&&typeof _0x11f6ed[_0xe5c7('0x1a')]===_0xe5c7('0x19');var _0x2157df=_0x5dbd1b[_0xe5c7('0x1b')];var _0x22aee7=_0x5e2020?0x0:_0x11f6ed[_0xe5c7('0x18')];var _0x2a4b04=_0x5e2020?_0x5dbd1b[_0xe5c7('0x1b')]:_0x11f6ed[_0xe5c7('0x18')]+_0x11f6ed[_0xe5c7('0x1a')];var _0x4936bf;if(_0x2a4b04>=_0x2157df){_0x2a4b04=_0x2157df;_0x4936bf=0xc8;}else{_0x4936bf=0xce;}_0xdec4b5[_0xe5c7('0x16')](_0x4936bf);return _0xdec4b5[_0xe5c7('0x1c')](_0xe5c7('0x1d'),_0x22aee7+'-'+_0x2a4b04+'/'+_0x2157df)['json'](_0x5dbd1b);}return null;};}function patchUpdates(_0x23e8b2){return function(_0x32bc4b){try{jsonpatch[_0xe5c7('0x1e')](_0x32bc4b,_0x23e8b2,!![]);}catch(_0x34cde1){return BPromise[_0xe5c7('0x1f')](_0x34cde1);}return _0x32bc4b[_0xe5c7('0x20')]();};}function saveUpdates(_0x1890b0,_0x4cac76){return function(_0x3239b5){if(_0x3239b5){return _0x3239b5[_0xe5c7('0x21')](_0x1890b0)[_0xe5c7('0x22')](function(_0x59513b){return _0x59513b;});}return null;};}function removeEntity(_0x2078ad,_0x53c412){return function(_0x47aed2){if(_0x47aed2){return _0x47aed2[_0xe5c7('0x23')]()['then'](function(){_0x2078ad[_0xe5c7('0x16')](0xcc)[_0xe5c7('0x24')]();});}};}function handleEntityNotFound(_0x4b979b,_0xde06e3){return function(_0x327c88){if(!_0x327c88){_0x4b979b[_0xe5c7('0x15')](0x194);}return _0x327c88;};}function handleError(_0x77f77c,_0x4dac3c){_0x4dac3c=_0x4dac3c||0x1f4;return function(_0x268e02){logger['error'](_0x268e02[_0xe5c7('0x25')]);if(_0x268e02['name']){delete _0x268e02[_0xe5c7('0x26')];}_0x77f77c['status'](_0x4dac3c)['send'](_0x268e02);};}exports[_0xe5c7('0x27')]=function(_0x2ac0f3,_0x543667){var _0x33d010={},_0x6c9375={},_0x18fda8={'count':0x0,'rows':[]};var _0x5cadd6=_['map'](db[_0xe5c7('0x28')]['rawAttributes'],function(_0x32eef9){return{'name':_0x32eef9[_0xe5c7('0x29')],'type':_0x32eef9[_0xe5c7('0x2a')]['key']};});_0x6c9375[_0xe5c7('0x2b')]=_[_0xe5c7('0x2c')](_0x5cadd6,_0xe5c7('0x26'));_0x6c9375[_0xe5c7('0x2d')]=_[_0xe5c7('0x2e')](_0x2ac0f3['query']);_0x6c9375['filters']=_[_0xe5c7('0x2f')](_0x6c9375[_0xe5c7('0x2b')],_0x6c9375[_0xe5c7('0x2d')]);_0x33d010[_0xe5c7('0x30')]=_['intersection'](_0x6c9375['model'],qs[_0xe5c7('0x31')](_0x2ac0f3[_0xe5c7('0x2d')][_0xe5c7('0x31')]));_0x33d010[_0xe5c7('0x30')]=_0x33d010[_0xe5c7('0x30')][_0xe5c7('0x32')]?_0x33d010[_0xe5c7('0x30')]:_0x6c9375[_0xe5c7('0x2b')];if(!_0x2ac0f3['query'][_0xe5c7('0x33')]('nolimit')){_0x33d010[_0xe5c7('0x1a')]=qs[_0xe5c7('0x1a')](_0x2ac0f3['query'][_0xe5c7('0x1a')]);_0x33d010[_0xe5c7('0x18')]=qs[_0xe5c7('0x18')](_0x2ac0f3[_0xe5c7('0x2d')]['offset']);}_0x33d010[_0xe5c7('0x34')]=qs['sort'](_0x2ac0f3['query'][_0xe5c7('0x35')]);_0x33d010[_0xe5c7('0x36')]=qs[_0xe5c7('0x37')](_['pick'](_0x2ac0f3['query'],_0x6c9375[_0xe5c7('0x37')]),_0x5cadd6);if(_0x2ac0f3[_0xe5c7('0x2d')][_0xe5c7('0x38')]){_0x33d010[_0xe5c7('0x36')]=_['merge'](_0x33d010[_0xe5c7('0x36')],{'$or':_[_0xe5c7('0x2c')](_0x5cadd6,function(_0x5a939f){if(_0x5a939f[_0xe5c7('0x2a')]!=='VIRTUAL'){var _0x125a0c={};_0x125a0c[_0x5a939f[_0xe5c7('0x26')]]={'$like':'%'+_0x2ac0f3[_0xe5c7('0x2d')][_0xe5c7('0x38')]+'%'};return _0x125a0c;}})});}_0x33d010=_[_0xe5c7('0x39')]({},_0x33d010,_0x2ac0f3[_0xe5c7('0x3a')]);var _0x5a7f22={'where':_0x33d010[_0xe5c7('0x36')]};return db[_0xe5c7('0x28')][_0xe5c7('0x1b')](_0x5a7f22)[_0xe5c7('0x22')](function(_0x406dd1){_0x18fda8[_0xe5c7('0x1b')]=_0x406dd1;if(_0x2ac0f3[_0xe5c7('0x2d')][_0xe5c7('0x3b')]){_0x33d010['include']=[{'all':!![]}];}return db['ZendeskField'][_0xe5c7('0x3c')](_0x33d010);})[_0xe5c7('0x22')](function(_0x4d32c2){_0x18fda8[_0xe5c7('0x3d')]=_0x4d32c2;return _0x18fda8;})[_0xe5c7('0x22')](respondWithFilteredResult(_0x543667,_0x33d010))[_0xe5c7('0x3e')](handleError(_0x543667,null));};exports[_0xe5c7('0x3f')]=function(_0x2059c1,_0x5ad79c){var _0x4c881c={'raw':!![],'where':{'id':_0x2059c1[_0xe5c7('0x40')]['id']}},_0x1e2605={};_0x1e2605[_0xe5c7('0x2b')]=_[_0xe5c7('0x2e')](db[_0xe5c7('0x28')][_0xe5c7('0x41')]);_0x1e2605['query']=_['keys'](_0x2059c1['query']);_0x1e2605[_0xe5c7('0x37')]=_['intersection'](_0x1e2605[_0xe5c7('0x2b')],_0x1e2605[_0xe5c7('0x2d')]);_0x4c881c[_0xe5c7('0x30')]=_[_0xe5c7('0x2f')](_0x1e2605[_0xe5c7('0x2b')],qs[_0xe5c7('0x31')](_0x2059c1[_0xe5c7('0x2d')]['fields']));_0x4c881c['attributes']=_0x4c881c[_0xe5c7('0x30')]['length']?_0x4c881c[_0xe5c7('0x30')]:_0x1e2605[_0xe5c7('0x2b')];if(_0x2059c1[_0xe5c7('0x2d')][_0xe5c7('0x3b')]){_0x4c881c[_0xe5c7('0x42')]=[{'all':!![]}];}_0x4c881c=_[_0xe5c7('0x39')]({},_0x4c881c,_0x2059c1['options']);return db[_0xe5c7('0x28')][_0xe5c7('0x43')](_0x4c881c)['then'](handleEntityNotFound(_0x5ad79c,null))[_0xe5c7('0x22')](respondWithResult(_0x5ad79c,null))[_0xe5c7('0x3e')](handleError(_0x5ad79c,null));};exports['create']=function(_0x17940d,_0x79ca7e){return db['ZendeskField']['create'](_0x17940d[_0xe5c7('0x44')],{})['then'](respondWithResult(_0x79ca7e,0xc9))[_0xe5c7('0x3e')](handleError(_0x79ca7e,null));};exports['update']=function(_0x4f40bb,_0x3adc3d){if(_0x4f40bb['body']['id']){delete _0x4f40bb['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x4f40bb[_0xe5c7('0x40')]['id']}})[_0xe5c7('0x22')](handleEntityNotFound(_0x3adc3d,null))[_0xe5c7('0x22')](saveUpdates(_0x4f40bb[_0xe5c7('0x44')],null))[_0xe5c7('0x22')](respondWithResult(_0x3adc3d,null))[_0xe5c7('0x3e')](handleError(_0x3adc3d,null));};exports[_0xe5c7('0x23')]=function(_0x3f148f,_0x557347){return db[_0xe5c7('0x28')][_0xe5c7('0x43')]({'where':{'id':_0x3f148f[_0xe5c7('0x40')]['id']}})[_0xe5c7('0x22')](handleEntityNotFound(_0x557347,null))[_0xe5c7('0x22')](removeEntity(_0x557347,null))[_0xe5c7('0x3e')](handleError(_0x557347,null));};
\ No newline at end of file
index 6ca4554..8e4419e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0692=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','define','zendesk_unique_index','idField','lodash','util'];(function(_0x5c4838,_0x43d6ec){var _0xfab99f=function(_0xb89337){while(--_0xb89337){_0x5c4838['push'](_0x5c4838['shift']());}};_0xfab99f(++_0x43d6ec);}(_0x0692,0xa7));var _0x2069=function(_0x2dd180,_0x55e1cb){_0x2dd180=_0x2dd180-0x0;var _0x3e6fde=_0x0692[_0x2dd180];return _0x3e6fde;};'use strict';var _=require(_0x2069('0x0'));var util=require(_0x2069('0x1'));var logger=require(_0x2069('0x2'))(_0x2069('0x3'));var moment=require(_0x2069('0x4'));var BPromise=require(_0x2069('0x5'));var rp=require(_0x2069('0x6'));var fs=require('fs');var path=require(_0x2069('0x7'));var rimraf=require(_0x2069('0x8'));var config=require('../../config/environment');var attributes=require(_0x2069('0x9'));module['exports']=function(_0x2a84a5,_0x3fe054){return _0x2a84a5[_0x2069('0xa')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x2069('0xb'),'fields':[_0x2069('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x050b=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x5a74dd,_0x337808){var _0x55c6b2=function(_0x42c301){while(--_0x42c301){_0x5a74dd['push'](_0x5a74dd['shift']());}};_0x55c6b2(++_0x337808);}(_0x050b,0x187));var _0xb050=function(_0x1d7de2,_0x374338){_0x1d7de2=_0x1d7de2-0x0;var _0x39c3a1=_0x050b[_0x1d7de2];return _0x39c3a1;};'use strict';var _=require(_0xb050('0x0'));var util=require(_0xb050('0x1'));var logger=require('../../config/logger')(_0xb050('0x2'));var moment=require('moment');var BPromise=require(_0xb050('0x3'));var rp=require(_0xb050('0x4'));var fs=require('fs');var path=require(_0xb050('0x5'));var rimraf=require(_0xb050('0x6'));var config=require(_0xb050('0x7'));var attributes=require(_0xb050('0x8'));module[_0xb050('0x9')]=function(_0x320b19,_0x1b6604){return _0x320b19[_0xb050('0xa')](_0xb050('0xb'),attributes,{'tableName':_0xb050('0xc'),'paranoid':![],'indexes':[{'name':_0xb050('0xd'),'fields':[_0xb050('0xe'),_0xb050('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d89b52d..56ec0d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7987=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x248162,_0x4ff747){var _0x15ccda=function(_0xe4d98b){while(--_0xe4d98b){_0x248162['push'](_0x248162['shift']());}};_0x15ccda(++_0x4ff747);}(_0x7987,0x1e8));var _0x7798=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0x7987[_0x4bfade];return _0x272465;};'use strict';var _=require(_0x7798('0x0'));var util=require(_0x7798('0x1'));var moment=require('moment');var BPromise=require(_0x7798('0x2'));var rs=require(_0x7798('0x3'));var fs=require('fs');var Redis=require(_0x7798('0x4'));var db=require(_0x7798('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7798('0x6'))(_0x7798('0x7'));var config=require(_0x7798('0x8'));var jayson=require(_0x7798('0x9'));var client=jayson[_0x7798('0xa')][_0x7798('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39eaa9,_0x225ce2,_0x59a31b){return new BPromise(function(_0x40c662,_0x22a8de){return client[_0x7798('0xc')](_0x39eaa9,_0x59a31b)[_0x7798('0xd')](function(_0x1d406f){logger[_0x7798('0xe')](_0x7798('0xf'),_0x225ce2,'request\x20sent');logger[_0x7798('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x225ce2,_0x7798('0x11'),JSON['stringify'](_0x1d406f));if(_0x1d406f[_0x7798('0x12')]){if(_0x1d406f[_0x7798('0x12')][_0x7798('0x13')]===0x1f4){logger[_0x7798('0x12')](_0x7798('0xf'),_0x225ce2,_0x1d406f[_0x7798('0x12')][_0x7798('0x14')]);return _0x22a8de(_0x1d406f['error'][_0x7798('0x14')]);}logger[_0x7798('0x12')](_0x7798('0xf'),_0x225ce2,_0x1d406f[_0x7798('0x12')][_0x7798('0x14')]);return _0x40c662(_0x1d406f['error'][_0x7798('0x14')]);}else{logger['info'](_0x7798('0xf'),_0x225ce2,'request\x20sent');_0x40c662(_0x1d406f[_0x7798('0x15')][_0x7798('0x14')]);}})[_0x7798('0x16')](function(_0x552449){logger['error']('ZendeskField,\x20%s,\x20%s',_0x225ce2,_0x552449);_0x22a8de(_0x552449);});});}
\ No newline at end of file
+var _0x5cca=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x285ed1,_0x23b6e7){var _0x5ea141=function(_0x4b9f34){while(--_0x4b9f34){_0x285ed1['push'](_0x285ed1['shift']());}};_0x5ea141(++_0x23b6e7);}(_0x5cca,0xdc));var _0xa5cc=function(_0x49579b,_0x528f4e){_0x49579b=_0x49579b-0x0;var _0x1a2d45=_0x5cca[_0x49579b];return _0x1a2d45;};'use strict';var _=require(_0xa5cc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa5cc('0x1'));var rs=require(_0xa5cc('0x2'));var fs=require('fs');var Redis=require(_0xa5cc('0x3'));var db=require(_0xa5cc('0x4'))['db'];var utils=require(_0xa5cc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5cc('0x6'));var jayson=require(_0xa5cc('0x7'));var client=jayson[_0xa5cc('0x8')][_0xa5cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc698ca,_0x34a579,_0x5d2a0d){return new BPromise(function(_0x2ac379,_0x5b0ce6){return client[_0xa5cc('0xa')](_0xc698ca,_0x5d2a0d)['then'](function(_0x254544){logger[_0xa5cc('0xb')](_0xa5cc('0xc'),_0x34a579,_0xa5cc('0xd'));logger[_0xa5cc('0xe')](_0xa5cc('0xf'),_0x34a579,_0xa5cc('0xd'),JSON[_0xa5cc('0x10')](_0x254544));if(_0x254544[_0xa5cc('0x11')]){if(_0x254544[_0xa5cc('0x11')][_0xa5cc('0x12')]===0x1f4){logger[_0xa5cc('0x11')](_0xa5cc('0xc'),_0x34a579,_0x254544['error']['message']);return _0x5b0ce6(_0x254544[_0xa5cc('0x11')][_0xa5cc('0x13')]);}logger[_0xa5cc('0x11')](_0xa5cc('0xc'),_0x34a579,_0x254544[_0xa5cc('0x11')][_0xa5cc('0x13')]);return _0x2ac379(_0x254544['error'][_0xa5cc('0x13')]);}else{logger[_0xa5cc('0xb')]('ZendeskField,\x20%s,\x20%s',_0x34a579,_0xa5cc('0xd'));_0x2ac379(_0x254544[_0xa5cc('0x14')][_0xa5cc('0x13')]);}})[_0xa5cc('0x15')](function(_0xfabd9d){logger['error']('ZendeskField,\x20%s,\x20%s',_0x34a579,_0xfabd9d);_0x5b0ce6(_0xfabd9d);});});}
\ No newline at end of file
index 4d6e956..0b4afee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2362=['./intZohoAccount.controller','index','get','/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x373a35,_0x5f3d2e){var _0x17888e=function(_0x18361b){while(--_0x18361b){_0x373a35['push'](_0x373a35['shift']());}};_0x17888e(++_0x5f3d2e);}(_0x2362,0x1dc));var _0x2236=function(_0x31ffb7,_0xa6351){_0x31ffb7=_0x31ffb7-0x0;var _0x2d31d0=_0x2362[_0x31ffb7];return _0x2d31d0;};'use strict';var multer=require(_0x2236('0x0'));var util=require(_0x2236('0x1'));var path=require(_0x2236('0x2'));var timeout=require(_0x2236('0x3'));var express=require(_0x2236('0x4'));var router=express[_0x2236('0x5')]();var fs_extra=require(_0x2236('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2236('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2236('0x8')]);router[_0x2236('0x9')](_0x2236('0xa'),auth[_0x2236('0xb')](),controller['show']);router[_0x2236('0x9')](_0x2236('0xc'),auth[_0x2236('0xb')](),controller['getConfigurations']);router['get'](_0x2236('0xd'),auth['isAuthenticated'](),controller[_0x2236('0xe')]);router[_0x2236('0xf')]('/',auth['isAuthenticated'](),controller[_0x2236('0x10')]);router[_0x2236('0xf')](_0x2236('0xc'),auth[_0x2236('0xb')](),controller[_0x2236('0x11')]);router[_0x2236('0x12')](_0x2236('0xa'),auth[_0x2236('0xb')](),controller[_0x2236('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2236('0x14')]=router;
\ No newline at end of file
+var _0x94d2=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','/:id','delete','destroy','exports'];(function(_0x3b9afb,_0x2133f4){var _0x136e05=function(_0x1fb7e2){while(--_0x1fb7e2){_0x3b9afb['push'](_0x3b9afb['shift']());}};_0x136e05(++_0x2133f4);}(_0x94d2,0x1e0));var _0x294d=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x94d2[_0x20cf8a];return _0x54e165;};'use strict';var multer=require(_0x294d('0x0'));var util=require(_0x294d('0x1'));var path=require(_0x294d('0x2'));var timeout=require(_0x294d('0x3'));var express=require(_0x294d('0x4'));var router=express[_0x294d('0x5')]();var fs_extra=require(_0x294d('0x6'));var auth=require(_0x294d('0x7'));var interaction=require(_0x294d('0x8'));var config=require('../../config/environment');var controller=require(_0x294d('0x9'));router[_0x294d('0xa')]('/',auth[_0x294d('0xb')](),controller[_0x294d('0xc')]);router[_0x294d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x294d('0xd')]);router[_0x294d('0xa')](_0x294d('0xe'),auth[_0x294d('0xb')](),controller['getConfigurations']);router['get'](_0x294d('0xf'),auth[_0x294d('0xb')](),controller[_0x294d('0x10')]);router['post']('/',auth[_0x294d('0xb')](),controller['create']);router[_0x294d('0x11')]('/:id/configurations',auth[_0x294d('0xb')](),controller[_0x294d('0x12')]);router[_0x294d('0x13')](_0x294d('0x14'),auth[_0x294d('0xb')](),controller['update']);router[_0x294d('0x15')](_0x294d('0x14'),auth[_0x294d('0xb')](),controller[_0x294d('0x16')]);module[_0x294d('0x17')]=router;
\ No newline at end of file
index ec45e7b..fcf570d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x702d=['sequelize','exports','STRING'];(function(_0xb64a62,_0x15ba35){var _0x17c811=function(_0x2ebef9){while(--_0x2ebef9){_0xb64a62['push'](_0xb64a62['shift']());}};_0x17c811(++_0x15ba35);}(_0x702d,0x147));var _0xd702=function(_0x36264d,_0x183197){_0x36264d=_0x36264d-0x0;var _0x4e1db5=_0x702d[_0x36264d];return _0x4e1db5;};'use strict';var Sequelize=require(_0xd702('0x0'));module[_0xd702('0x1')]={'name':{'type':Sequelize[_0xd702('0x2')]},'description':{'type':Sequelize[_0xd702('0x2')]},'host':{'type':Sequelize[_0xd702('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd702('0x2')]},'clientSecret':{'type':Sequelize[_0xd702('0x2')]},'serverUrl':{'type':Sequelize[_0xd702('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xd702('0x2')]},'refreshToken':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaa88=['exports','STRING','sequelize'];(function(_0xc8209d,_0x4d0b20){var _0x58ad90=function(_0x30c079){while(--_0x30c079){_0xc8209d['push'](_0xc8209d['shift']());}};_0x58ad90(++_0x4d0b20);}(_0xaa88,0x137));var _0x8aa8=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xaa88[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'name':{'type':Sequelize[_0x8aa8('0x2')]},'description':{'type':Sequelize[_0x8aa8('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x8aa8('0x2')]},'clientId':{'type':Sequelize[_0x8aa8('0x2')]},'clientSecret':{'type':Sequelize[_0x8aa8('0x2')]},'serverUrl':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x8aa8('0x2')]},'refreshToken':{'type':Sequelize[_0x8aa8('0x2')]}};
\ No newline at end of file
index e8bc0e6..8dbd828 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aa7=['options','find','catch','create','body','params','destroy','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientSecret','serverUrl','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','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','getFields','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','count','include','findAll','rows','show','keys','includeAll'];(function(_0x282ea2,_0x78ae12){var _0x3e0d2b=function(_0x980c96){while(--_0x980c96){_0x282ea2['push'](_0x282ea2['shift']());}};_0x3e0d2b(++_0x78ae12);}(_0x7aa7,0xc4));var _0x77aa=function(_0x50df20,_0x14aba7){_0x50df20=_0x50df20-0x0;var _0x3a1b8d=_0x7aa7[_0x50df20];return _0x3a1b8d;};'use strict';var emlformat=require(_0x77aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x77aa('0x1'));var jsonpatch=require(_0x77aa('0x2'));var rp=require(_0x77aa('0x3'));var moment=require(_0x77aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77aa('0x5'));var util=require(_0x77aa('0x6'));var path=require(_0x77aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77aa('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x77aa('0x9'));var deskjs=require(_0x77aa('0xa'));var toCsv=require('to-csv');var querystring=require(_0x77aa('0xb'));var Papa=require(_0x77aa('0xc'));var Redis=require(_0x77aa('0xd'));var authService=require(_0x77aa('0xe'));var qs=require(_0x77aa('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77aa('0x10'));var logger=require(_0x77aa('0x11'))(_0x77aa('0x12'));var utils=require(_0x77aa('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x77aa('0x14'));var db=require(_0x77aa('0x15'))['db'];var integrations=require(_0x77aa('0x16'));function respondWithStatusCode(_0x3a322b,_0x7bc75f){_0x7bc75f=_0x7bc75f||0xcc;return function(_0x2ef066){if(_0x2ef066){return _0x3a322b[_0x77aa('0x17')](_0x7bc75f);}return _0x3a322b[_0x77aa('0x18')](_0x7bc75f)['end']();};}function respondWithResult(_0x40ef3e,_0x175d4d){_0x175d4d=_0x175d4d||0xc8;return function(_0x5e710a){if(_0x5e710a){return _0x40ef3e[_0x77aa('0x18')](_0x175d4d)[_0x77aa('0x19')](_0x5e710a);}};}function respondWithFilteredResult(_0x4a061a,_0x5a08e0){return function(_0x5374ea){if(_0x5374ea){var _0x361632=typeof _0x5a08e0['offset']===_0x77aa('0x1a')&&typeof _0x5a08e0[_0x77aa('0x1b')]===_0x77aa('0x1a');var _0x24b100=_0x5374ea['count'];var _0x1a18e8=_0x361632?0x0:_0x5a08e0[_0x77aa('0x1c')];var _0x1ff554=_0x361632?_0x5374ea['count']:_0x5a08e0[_0x77aa('0x1c')]+_0x5a08e0[_0x77aa('0x1b')];var _0x5496c9;if(_0x1ff554>=_0x24b100){_0x1ff554=_0x24b100;_0x5496c9=0xc8;}else{_0x5496c9=0xce;}_0x4a061a[_0x77aa('0x18')](_0x5496c9);return _0x4a061a[_0x77aa('0x1d')](_0x77aa('0x1e'),_0x1a18e8+'-'+_0x1ff554+'/'+_0x24b100)[_0x77aa('0x19')](_0x5374ea);}return null;};}function patchUpdates(_0x4eb76e){return function(_0x5b8740){try{jsonpatch[_0x77aa('0x1f')](_0x5b8740,_0x4eb76e,!![]);}catch(_0x16f3a8){return BPromise[_0x77aa('0x20')](_0x16f3a8);}return _0x5b8740[_0x77aa('0x21')]();};}function saveUpdates(_0x4006a0,_0x56e3b3){return function(_0x4bbdee){if(_0x4bbdee){return _0x4bbdee[_0x77aa('0x22')](_0x4006a0)[_0x77aa('0x23')](function(_0x56bc22){return _0x56bc22;});}return null;};}function removeEntity(_0x93d68b,_0x2c09cf){return function(_0x1f7bdf){if(_0x1f7bdf){return _0x1f7bdf['destroy']()[_0x77aa('0x23')](function(){_0x93d68b[_0x77aa('0x18')](0xcc)[_0x77aa('0x24')]();});}};}function handleEntityNotFound(_0x1beea6,_0x29a3fa){return function(_0x436a45){if(!_0x436a45){_0x1beea6[_0x77aa('0x17')](0x194);}return _0x436a45;};}function handleError(_0x5d5ffc,_0x33a05e){_0x33a05e=_0x33a05e||0x1f4;return function(_0x1ee57e){logger[_0x77aa('0x25')](_0x1ee57e[_0x77aa('0x26')]);if(_0x1ee57e[_0x77aa('0x27')]){delete _0x1ee57e[_0x77aa('0x27')];}_0x5d5ffc[_0x77aa('0x18')](_0x33a05e)[_0x77aa('0x28')](_0x1ee57e);};}exports[_0x77aa('0x29')]=function(_0x43c1c4,_0x346abe){var _0x1f5b8a={},_0x578b04={},_0x1afc26={'count':0x0,'rows':[]};var _0x3e9383=_[_0x77aa('0x2a')](db[_0x77aa('0x2b')][_0x77aa('0x2c')],function(_0x224456){return{'name':_0x224456[_0x77aa('0x2d')],'type':_0x224456[_0x77aa('0x2e')][_0x77aa('0x2f')]};});_0x578b04['model']=_[_0x77aa('0x2a')](_0x3e9383,_0x77aa('0x27'));_0x578b04[_0x77aa('0x30')]=_['keys'](_0x43c1c4[_0x77aa('0x30')]);_0x578b04[_0x77aa('0x31')]=_[_0x77aa('0x32')](_0x578b04[_0x77aa('0x33')],_0x578b04[_0x77aa('0x30')]);_0x1f5b8a['attributes']=_['intersection'](_0x578b04[_0x77aa('0x33')],qs['fields'](_0x43c1c4[_0x77aa('0x30')][_0x77aa('0x34')]));_0x1f5b8a[_0x77aa('0x35')]=_0x1f5b8a[_0x77aa('0x35')][_0x77aa('0x36')]?_0x1f5b8a[_0x77aa('0x35')]:_0x578b04['model'];if(!_0x43c1c4[_0x77aa('0x30')][_0x77aa('0x37')](_0x77aa('0x38'))){_0x1f5b8a[_0x77aa('0x1b')]=qs[_0x77aa('0x1b')](_0x43c1c4[_0x77aa('0x30')][_0x77aa('0x1b')]);_0x1f5b8a['offset']=qs[_0x77aa('0x1c')](_0x43c1c4[_0x77aa('0x30')][_0x77aa('0x1c')]);}_0x1f5b8a[_0x77aa('0x39')]=qs[_0x77aa('0x3a')](_0x43c1c4[_0x77aa('0x30')]['sort']);_0x1f5b8a[_0x77aa('0x3b')]=qs[_0x77aa('0x31')](_[_0x77aa('0x3c')](_0x43c1c4[_0x77aa('0x30')],_0x578b04['filters']),_0x3e9383);if(_0x43c1c4[_0x77aa('0x30')]['filter']){_0x1f5b8a[_0x77aa('0x3b')]=_[_0x77aa('0x3d')](_0x1f5b8a['where'],{'$or':_[_0x77aa('0x2a')](_0x3e9383,function(_0x177de6){if(_0x177de6[_0x77aa('0x2e')]!=='VIRTUAL'){var _0x4e7730={};_0x4e7730[_0x177de6[_0x77aa('0x27')]]={'$like':'%'+_0x43c1c4[_0x77aa('0x30')][_0x77aa('0x3e')]+'%'};return _0x4e7730;}})});}_0x1f5b8a=_[_0x77aa('0x3d')]({},_0x1f5b8a,_0x43c1c4['options']);var _0x1919ae={'where':_0x1f5b8a['where']};return db[_0x77aa('0x2b')][_0x77aa('0x3f')](_0x1919ae)[_0x77aa('0x23')](function(_0x1acc5f){_0x1afc26['count']=_0x1acc5f;if(_0x43c1c4[_0x77aa('0x30')]['includeAll']){_0x1f5b8a[_0x77aa('0x40')]=[{'all':!![]}];}return db['ZohoAccount'][_0x77aa('0x41')](_0x1f5b8a);})[_0x77aa('0x23')](function(_0x1c3154){_0x1afc26[_0x77aa('0x42')]=_0x1c3154;return _0x1afc26;})[_0x77aa('0x23')](respondWithFilteredResult(_0x346abe,_0x1f5b8a))['catch'](handleError(_0x346abe,null));};exports[_0x77aa('0x43')]=function(_0x3d8858,_0x4169ff){var _0x528618={'raw':![],'where':{'id':_0x3d8858['params']['id']}},_0x1df079={};_0x1df079[_0x77aa('0x33')]=_[_0x77aa('0x44')](db[_0x77aa('0x2b')][_0x77aa('0x2c')]);_0x1df079[_0x77aa('0x30')]=_[_0x77aa('0x44')](_0x3d8858[_0x77aa('0x30')]);_0x1df079[_0x77aa('0x31')]=_[_0x77aa('0x32')](_0x1df079['model'],_0x1df079[_0x77aa('0x30')]);_0x528618[_0x77aa('0x35')]=_[_0x77aa('0x32')](_0x1df079['model'],qs['fields'](_0x3d8858['query'][_0x77aa('0x34')]));_0x528618[_0x77aa('0x35')]=_0x528618[_0x77aa('0x35')]['length']?_0x528618[_0x77aa('0x35')]:_0x1df079[_0x77aa('0x33')];if(_0x3d8858[_0x77aa('0x30')][_0x77aa('0x45')]){_0x528618['include']=[{'all':!![]}];}_0x528618=_['merge']({},_0x528618,_0x3d8858[_0x77aa('0x46')]);return db[_0x77aa('0x2b')][_0x77aa('0x47')](_0x528618)[_0x77aa('0x23')](handleEntityNotFound(_0x4169ff,null))[_0x77aa('0x23')](respondWithResult(_0x4169ff,null))[_0x77aa('0x48')](handleError(_0x4169ff,null));};exports[_0x77aa('0x49')]=function(_0x16f97f,_0x10a1f1){return db[_0x77aa('0x2b')][_0x77aa('0x49')](_0x16f97f[_0x77aa('0x4a')],{})['then'](respondWithResult(_0x10a1f1,0xc9))['catch'](handleError(_0x10a1f1,null));};exports[_0x77aa('0x22')]=function(_0x21244c,_0x5d5a01){if(_0x21244c[_0x77aa('0x4a')]['id']){delete _0x21244c[_0x77aa('0x4a')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x21244c[_0x77aa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5d5a01,null))[_0x77aa('0x23')](saveUpdates(_0x21244c[_0x77aa('0x4a')],null))[_0x77aa('0x23')](respondWithResult(_0x5d5a01,null))[_0x77aa('0x48')](handleError(_0x5d5a01,null));};exports[_0x77aa('0x4c')]=function(_0x3522ed,_0x502012){return db[_0x77aa('0x2b')][_0x77aa('0x47')]({'where':{'id':_0x3522ed[_0x77aa('0x4b')]['id']}})[_0x77aa('0x23')](handleEntityNotFound(_0x502012,null))[_0x77aa('0x23')](removeEntity(_0x502012,null))[_0x77aa('0x48')](handleError(_0x502012,null));};exports[_0x77aa('0x4d')]=function(_0x1af9f9,_0x4202ce,_0xa10dad){var _0x38c11f={};var _0x4f3f73={};var _0x25cd28;var _0x258aa9;return db[_0x77aa('0x2b')][_0x77aa('0x4e')]({'where':{'id':_0x1af9f9[_0x77aa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4202ce,null))[_0x77aa('0x23')](function(_0x19088c){if(_0x19088c){_0x25cd28=_0x19088c;_0x4f3f73['model']=_['keys'](db[_0x77aa('0x4f')][_0x77aa('0x2c')]);_0x4f3f73['query']=_[_0x77aa('0x44')](_0x1af9f9['query']);_0x4f3f73[_0x77aa('0x31')]=_[_0x77aa('0x32')](_0x4f3f73[_0x77aa('0x33')],_0x4f3f73['query']);_0x38c11f[_0x77aa('0x35')]=_['intersection'](_0x4f3f73['model'],qs[_0x77aa('0x34')](_0x1af9f9[_0x77aa('0x30')][_0x77aa('0x34')]));_0x38c11f[_0x77aa('0x35')]=_0x38c11f[_0x77aa('0x35')][_0x77aa('0x36')]?_0x38c11f[_0x77aa('0x35')]:_0x4f3f73[_0x77aa('0x33')];_0x38c11f[_0x77aa('0x39')]=qs[_0x77aa('0x3a')](_0x1af9f9[_0x77aa('0x30')][_0x77aa('0x3a')]);_0x38c11f['where']=qs[_0x77aa('0x31')](_[_0x77aa('0x3c')](_0x1af9f9[_0x77aa('0x30')],_0x4f3f73[_0x77aa('0x31')]));if(_0x1af9f9['query'][_0x77aa('0x3e')]){_0x38c11f[_0x77aa('0x3b')]=_[_0x77aa('0x3d')](_0x38c11f[_0x77aa('0x3b')],{'$or':_[_0x77aa('0x2a')](_0x38c11f[_0x77aa('0x35')],function(_0x13ac70){var _0xeebee1={};_0xeebee1[_0x13ac70]={'$like':'%'+_0x1af9f9[_0x77aa('0x30')][_0x77aa('0x3e')]+'%'};return _0xeebee1;})});}_0x38c11f=_[_0x77aa('0x3d')]({},_0x38c11f,_0x1af9f9['options']);return _0x25cd28['getConfigurations'](_0x38c11f);}})[_0x77aa('0x23')](function(_0x11e5d4){if(_0x11e5d4){_0x258aa9=_0x11e5d4['length'];if(!_0x1af9f9['query']['hasOwnProperty']('nolimit')){_0x38c11f[_0x77aa('0x1b')]=qs[_0x77aa('0x1b')](_0x1af9f9['query'][_0x77aa('0x1b')]);_0x38c11f['offset']=qs[_0x77aa('0x1c')](_0x1af9f9[_0x77aa('0x30')][_0x77aa('0x1c')]);}return _0x25cd28[_0x77aa('0x4d')](_0x38c11f);}})[_0x77aa('0x23')](function(_0x3f60e3){if(_0x3f60e3){return _0x3f60e3?{'count':_0x258aa9,'rows':_0x3f60e3}:null;}})['then'](respondWithResult(_0x4202ce,null))[_0x77aa('0x48')](handleError(_0x4202ce,null));};exports[_0x77aa('0x50')]=function(_0x3708dd,_0xbecc79,_0x3f88ed){if(_0x3708dd[_0x77aa('0x4a')]['id']){delete _0x3708dd['body']['id'];}return db[_0x77aa('0x2b')][_0x77aa('0x4e')]({'where':{'id':_0x3708dd[_0x77aa('0x4b')]['id']}})['then'](handleEntityNotFound(_0xbecc79,null))[_0x77aa('0x23')](function(_0x519d92){if(_0x519d92){_0x3708dd[_0x77aa('0x4a')][_0x77aa('0x51')]=_0x519d92['id'];_0x3708dd['body'][_0x77aa('0x52')]=integrations[_0x77aa('0x53')](_0x3708dd[_0x77aa('0x4a')][_0x77aa('0x54')],_0x3708dd[_0x77aa('0x4a')]['type']);_0x3708dd[_0x77aa('0x4a')][_0x77aa('0x55')]=integrations['getDescriptions'](_0x3708dd[_0x77aa('0x4a')][_0x77aa('0x54')],_0x3708dd['body'][_0x77aa('0x2e')]);return db[_0x77aa('0x4f')][_0x77aa('0x49')](_0x3708dd[_0x77aa('0x4a')],{'include':[{'model':db[_0x77aa('0x56')],'as':_0x77aa('0x52')},{'model':db[_0x77aa('0x56')],'as':_0x77aa('0x55')}]});}return null;})[_0x77aa('0x23')](respondWithResult(_0xbecc79,null))[_0x77aa('0x48')](handleError(_0xbecc79,null));};function getAccessToken(_0x1255f4){return new Promise(function(_0x7153a0,_0x10d8a0){var _0x240c5a;switch(_0x1255f4[_0x77aa('0x57')]){case'US':_0x240c5a='https://accounts.zoho.com';break;case'AU':_0x240c5a=_0x77aa('0x58');break;case'EU':_0x240c5a=_0x77aa('0x59');break;case'IN':_0x240c5a=_0x77aa('0x5a');break;case'CN':_0x240c5a=_0x77aa('0x5b');break;default:_0x240c5a=_0x77aa('0x59');break;}var _0x2b6f43={'method':_0x77aa('0x5c'),'uri':_0x240c5a+_0x77aa('0x5d'),'qs':{'refresh_token':_0x1255f4[_0x77aa('0x5e')],'client_id':_0x1255f4[_0x77aa('0x5f')],'client_secret':_0x1255f4['clientSecret'],'grant_type':_0x77aa('0x60')},'json':!![]};return rp(_0x2b6f43)[_0x77aa('0x23')](function(_0x2d3643){if(_0x2d3643[_0x77aa('0x61')]){_0x7153a0(_0x2d3643[_0x77aa('0x61')]);}else{_0x10d8a0(_0x77aa('0x62'));}})['catch'](function(_0x159c14){_0x10d8a0(_0x159c14);});});}exports['getFields']=function(_0x4e8612,_0x390f39,_0x396909){var _0x123b65,_0x25ff85,_0x5e70f9,_0x4aa8d2,_0x15579f;return db['ZohoAccount'][_0x77aa('0x4e')]({'where':{'id':_0x4e8612[_0x77aa('0x4b')]['id']},'attributes':['id',_0x77aa('0x63'),_0x77aa('0x57'),_0x77aa('0x5f'),_0x77aa('0x64'),_0x77aa('0x65'),'code',_0x77aa('0x5e')]})[_0x77aa('0x23')](handleEntityNotFound(_0x390f39,null))[_0x77aa('0x23')](function(_0x271380){_0x15579f=_0x271380;_0x123b65=_0x15579f['host'];_0x25ff85=_0x123b65===_0x77aa('0x66')?'eu':_0x77aa('0x67');_0x5e70f9=_0x15579f[_0x77aa('0x65')];var _0x15e93e=_0x5e70f9[_0x77aa('0x68')](-0x1);if(_0x15e93e==='/'||_0x15e93e==='\x5c'||_0x15e93e===':'){_0x5e70f9=_0x5e70f9['substring'](0x0,_0x5e70f9[_0x77aa('0x69')](_0x15e93e));}if(!_0x15579f['refreshToken']){throw new Error(_0x77aa('0x6a'));}return getAccessToken(_0x15579f);})[_0x77aa('0x23')](function(_0x31267b){if(_0x31267b){return rp({'method':'GET','uri':util[_0x77aa('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x25ff85),'qs':{'module':_0x77aa('0x6c')},'headers':{'Authorization':_0x77aa('0x6d')+_0x31267b},'json':!![]});}})['then'](function(_0x194505){if(_0x194505){if(_0x194505[_0x77aa('0x6e')]&&_0x194505[_0x77aa('0x6e')][_0x77aa('0x25')]){throw new Error(_0x194505['response'][_0x77aa('0x25')][_0x77aa('0x6f')]);}var _0x10b7c7=[];var _0xb1014a=[];var _0xf4da27=[_0x77aa('0x70'),_0x77aa('0x71'),_0x77aa('0x72'),_0x77aa('0x73'),_0x77aa('0x74'),_0x77aa('0x75'),_0x77aa('0x76'),_0x77aa('0x77')];_0xb1014a=_[_0x77aa('0x78')](_0x194505[_0x77aa('0x34')],function(_0x5c447e){return _0xf4da27[_0x77aa('0x79')](_0x5c447e[_0x77aa('0x7a')]);});for(var _0x21cf9e=0x0;_0x21cf9e<_0xb1014a[_0x77aa('0x36')];_0x21cf9e++){if(_0xb1014a[_0x21cf9e][_0x77aa('0x7b')]===![]){_0x10b7c7[_0x77aa('0x7c')]({'id':_0xb1014a[_0x21cf9e]['id'],'name':_0xb1014a[_0x21cf9e]['display_label'],'custom':_0xb1014a[_0x21cf9e][_0x77aa('0x7d')],'options':_0xb1014a[_0x21cf9e][_0x77aa('0x7e')]===_0x77aa('0x7f')&&_0xb1014a[_0x21cf9e][_0x77aa('0x80')][_0x77aa('0x36')]>-0x1?_[_0x77aa('0x2a')](_0xb1014a[_0x21cf9e]['pick_list_values'],function(_0x583f0a){return{'name':_0x583f0a,'value':_0x583f0a};}):[]});}}return{'count':_0x10b7c7[_0x77aa('0x36')],'rows':_0x10b7c7};}else{return{'count':0x0,'rows':[]};}})[_0x77aa('0x23')](respondWithResult(_0x390f39,null))[_0x77aa('0x48')](function(_0x3976d1){var _0x172880=_0x4e8612[_0x77aa('0x30')][_0x77aa('0x81')]?0x1f4:_0x3976d1['statusCode']||0x1f4;logger[_0x77aa('0x25')](_0x77aa('0x82'),_0x77aa('0x83'),_0x172880,JSON['stringify'](_0x3976d1));delete _0x3976d1[_0x77aa('0x27')];if(_0x172880===0x191){_0x172880=0x190;}_0x390f39['status'](_0x172880)[_0x77aa('0x28')](_0x4e8612[_0x77aa('0x30')][_0x77aa('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x3976d1[_0x77aa('0x84')]}:_0x3976d1);});};
\ No newline at end of file
+var _0x15d4=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','ZohoAccount','fieldName','type','key','model','map','query','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','rawAttributes','intersection','options','find','create','body','getConfigurations','findOne','ZohoConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientSecret','serverUrl','code','refreshToken','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset'];(function(_0x46d54d,_0x105c39){var _0x5a8e5a=function(_0x57fe2b){while(--_0x57fe2b){_0x46d54d['push'](_0x46d54d['shift']());}};_0x5a8e5a(++_0x105c39);}(_0x15d4,0x68));var _0x415d=function(_0x3a4772,_0x4fb4e2){_0x3a4772=_0x3a4772-0x0;var _0x54f1bd=_0x15d4[_0x3a4772];return _0x54f1bd;};'use strict';var emlformat=require(_0x415d('0x0'));var rimraf=require(_0x415d('0x1'));var zipdir=require(_0x415d('0x2'));var jsonpatch=require(_0x415d('0x3'));var rp=require('request-promise');var moment=require(_0x415d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x415d('0x5'));var util=require(_0x415d('0x6'));var path=require(_0x415d('0x7'));var sox=require(_0x415d('0x8'));var csv=require('to-csv');var ejs=require(_0x415d('0x9'));var fs=require('fs');var fs_extra=require(_0x415d('0xa'));var _=require(_0x415d('0xb'));var squel=require(_0x415d('0xc'));var crypto=require(_0x415d('0xd'));var jsforce=require(_0x415d('0xe'));var deskjs=require(_0x415d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x415d('0x10'));var Papa=require(_0x415d('0x11'));var Redis=require(_0x415d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x415d('0x13'));var as=require(_0x415d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x415d('0x15'))('api');var utils=require(_0x415d('0x16'));var config=require(_0x415d('0x17'));var licenseUtil=require(_0x415d('0x18'));var db=require(_0x415d('0x19'))['db'];var integrations=require(_0x415d('0x1a'));function respondWithStatusCode(_0x422088,_0x3c5dbe){_0x3c5dbe=_0x3c5dbe||0xcc;return function(_0x1d4b38){if(_0x1d4b38){return _0x422088[_0x415d('0x1b')](_0x3c5dbe);}return _0x422088[_0x415d('0x1c')](_0x3c5dbe)['end']();};}function respondWithResult(_0x422fba,_0x4ee963){_0x4ee963=_0x4ee963||0xc8;return function(_0x55d9c6){if(_0x55d9c6){return _0x422fba[_0x415d('0x1c')](_0x4ee963)[_0x415d('0x1d')](_0x55d9c6);}};}function respondWithFilteredResult(_0x82372c,_0x4cadf){return function(_0x2e9b5c){if(_0x2e9b5c){var _0x77a5e8=typeof _0x4cadf[_0x415d('0x1e')]===_0x415d('0x1f')&&typeof _0x4cadf['limit']===_0x415d('0x1f');var _0x5b8f3a=_0x2e9b5c[_0x415d('0x20')];var _0x3350cd=_0x77a5e8?0x0:_0x4cadf[_0x415d('0x1e')];var _0xb50f91=_0x77a5e8?_0x2e9b5c[_0x415d('0x20')]:_0x4cadf[_0x415d('0x1e')]+_0x4cadf[_0x415d('0x21')];var _0x4c860b;if(_0xb50f91>=_0x5b8f3a){_0xb50f91=_0x5b8f3a;_0x4c860b=0xc8;}else{_0x4c860b=0xce;}_0x82372c[_0x415d('0x1c')](_0x4c860b);return _0x82372c[_0x415d('0x22')](_0x415d('0x23'),_0x3350cd+'-'+_0xb50f91+'/'+_0x5b8f3a)[_0x415d('0x1d')](_0x2e9b5c);}return null;};}function patchUpdates(_0x5e6962){return function(_0x5e52a1){try{jsonpatch[_0x415d('0x24')](_0x5e52a1,_0x5e6962,!![]);}catch(_0x1d8a99){return BPromise[_0x415d('0x25')](_0x1d8a99);}return _0x5e52a1[_0x415d('0x26')]();};}function saveUpdates(_0x118b50,_0x5e2651){return function(_0x2cea47){if(_0x2cea47){return _0x2cea47[_0x415d('0x27')](_0x118b50)[_0x415d('0x28')](function(_0x11ff06){return _0x11ff06;});}return null;};}function removeEntity(_0x27bb30,_0x1c4b95){return function(_0x54772c){if(_0x54772c){return _0x54772c[_0x415d('0x29')]()[_0x415d('0x28')](function(){_0x27bb30['status'](0xcc)[_0x415d('0x2a')]();});}};}function handleEntityNotFound(_0x50171d,_0x13ab27){return function(_0x4e4c11){if(!_0x4e4c11){_0x50171d[_0x415d('0x1b')](0x194);}return _0x4e4c11;};}function handleError(_0x234542,_0x4b54ba){_0x4b54ba=_0x4b54ba||0x1f4;return function(_0x3492e6){logger[_0x415d('0x2b')](_0x3492e6['stack']);if(_0x3492e6['name']){delete _0x3492e6[_0x415d('0x2c')];}_0x234542[_0x415d('0x1c')](_0x4b54ba)[_0x415d('0x2d')](_0x3492e6);};}exports[_0x415d('0x2e')]=function(_0x16e5b0,_0x1972f1){var _0x5b744d={},_0x4b0203={},_0x5da6b4={'count':0x0,'rows':[]};var _0x12fe6f=_['map'](db[_0x415d('0x2f')]['rawAttributes'],function(_0x315e39){return{'name':_0x315e39[_0x415d('0x30')],'type':_0x315e39[_0x415d('0x31')][_0x415d('0x32')]};});_0x4b0203[_0x415d('0x33')]=_[_0x415d('0x34')](_0x12fe6f,_0x415d('0x2c'));_0x4b0203[_0x415d('0x35')]=_['keys'](_0x16e5b0[_0x415d('0x35')]);_0x4b0203['filters']=_['intersection'](_0x4b0203[_0x415d('0x33')],_0x4b0203[_0x415d('0x35')]);_0x5b744d[_0x415d('0x36')]=_['intersection'](_0x4b0203['model'],qs[_0x415d('0x37')](_0x16e5b0[_0x415d('0x35')]['fields']));_0x5b744d['attributes']=_0x5b744d[_0x415d('0x36')][_0x415d('0x38')]?_0x5b744d[_0x415d('0x36')]:_0x4b0203[_0x415d('0x33')];if(!_0x16e5b0[_0x415d('0x35')][_0x415d('0x39')]('nolimit')){_0x5b744d[_0x415d('0x21')]=qs[_0x415d('0x21')](_0x16e5b0[_0x415d('0x35')]['limit']);_0x5b744d[_0x415d('0x1e')]=qs[_0x415d('0x1e')](_0x16e5b0['query'][_0x415d('0x1e')]);}_0x5b744d['order']=qs[_0x415d('0x3a')](_0x16e5b0[_0x415d('0x35')][_0x415d('0x3a')]);_0x5b744d[_0x415d('0x3b')]=qs[_0x415d('0x3c')](_[_0x415d('0x3d')](_0x16e5b0['query'],_0x4b0203[_0x415d('0x3c')]),_0x12fe6f);if(_0x16e5b0[_0x415d('0x35')]['filter']){_0x5b744d[_0x415d('0x3b')]=_[_0x415d('0x3e')](_0x5b744d[_0x415d('0x3b')],{'$or':_[_0x415d('0x34')](_0x12fe6f,function(_0x39c779){if(_0x39c779[_0x415d('0x31')]!==_0x415d('0x3f')){var _0x2cd581={};_0x2cd581[_0x39c779[_0x415d('0x2c')]]={'$like':'%'+_0x16e5b0[_0x415d('0x35')][_0x415d('0x40')]+'%'};return _0x2cd581;}})});}_0x5b744d=_['merge']({},_0x5b744d,_0x16e5b0['options']);var _0x4a2866={'where':_0x5b744d[_0x415d('0x3b')]};return db[_0x415d('0x2f')]['count'](_0x4a2866)['then'](function(_0x347832){_0x5da6b4[_0x415d('0x20')]=_0x347832;if(_0x16e5b0[_0x415d('0x35')][_0x415d('0x41')]){_0x5b744d[_0x415d('0x42')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x5b744d);})[_0x415d('0x28')](function(_0x329bfc){_0x5da6b4[_0x415d('0x43')]=_0x329bfc;return _0x5da6b4;})['then'](respondWithFilteredResult(_0x1972f1,_0x5b744d))[_0x415d('0x44')](handleError(_0x1972f1,null));};exports[_0x415d('0x45')]=function(_0x1dc1ad,_0x3b912c){var _0x323e5e={'raw':![],'where':{'id':_0x1dc1ad[_0x415d('0x46')]['id']}},_0x4ec7d7={};_0x4ec7d7[_0x415d('0x33')]=_[_0x415d('0x47')](db['ZohoAccount'][_0x415d('0x48')]);_0x4ec7d7[_0x415d('0x35')]=_['keys'](_0x1dc1ad[_0x415d('0x35')]);_0x4ec7d7[_0x415d('0x3c')]=_[_0x415d('0x49')](_0x4ec7d7['model'],_0x4ec7d7[_0x415d('0x35')]);_0x323e5e[_0x415d('0x36')]=_[_0x415d('0x49')](_0x4ec7d7[_0x415d('0x33')],qs[_0x415d('0x37')](_0x1dc1ad[_0x415d('0x35')][_0x415d('0x37')]));_0x323e5e[_0x415d('0x36')]=_0x323e5e[_0x415d('0x36')][_0x415d('0x38')]?_0x323e5e['attributes']:_0x4ec7d7[_0x415d('0x33')];if(_0x1dc1ad[_0x415d('0x35')]['includeAll']){_0x323e5e[_0x415d('0x42')]=[{'all':!![]}];}_0x323e5e=_[_0x415d('0x3e')]({},_0x323e5e,_0x1dc1ad[_0x415d('0x4a')]);return db[_0x415d('0x2f')][_0x415d('0x4b')](_0x323e5e)[_0x415d('0x28')](handleEntityNotFound(_0x3b912c,null))['then'](respondWithResult(_0x3b912c,null))['catch'](handleError(_0x3b912c,null));};exports['create']=function(_0xcb09f3,_0x2aad40){return db[_0x415d('0x2f')][_0x415d('0x4c')](_0xcb09f3['body'],{})[_0x415d('0x28')](respondWithResult(_0x2aad40,0xc9))['catch'](handleError(_0x2aad40,null));};exports[_0x415d('0x27')]=function(_0x305de0,_0x54b6cf){if(_0x305de0[_0x415d('0x4d')]['id']){delete _0x305de0[_0x415d('0x4d')]['id'];}return db[_0x415d('0x2f')]['find']({'where':{'id':_0x305de0[_0x415d('0x46')]['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x54b6cf,null))['then'](saveUpdates(_0x305de0[_0x415d('0x4d')],null))['then'](respondWithResult(_0x54b6cf,null))['catch'](handleError(_0x54b6cf,null));};exports[_0x415d('0x29')]=function(_0x2d72d0,_0x3f3d5f){return db['ZohoAccount'][_0x415d('0x4b')]({'where':{'id':_0x2d72d0['params']['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x3f3d5f,null))[_0x415d('0x28')](removeEntity(_0x3f3d5f,null))[_0x415d('0x44')](handleError(_0x3f3d5f,null));};exports[_0x415d('0x4e')]=function(_0x469731,_0x1a0924,_0x13a286){var _0x10ee9a={};var _0x2efc14={};var _0x5e1724;var _0x2c0a97;return db[_0x415d('0x2f')][_0x415d('0x4f')]({'where':{'id':_0x469731['params']['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x1a0924,null))['then'](function(_0x13b073){if(_0x13b073){_0x5e1724=_0x13b073;_0x2efc14['model']=_[_0x415d('0x47')](db[_0x415d('0x50')][_0x415d('0x48')]);_0x2efc14[_0x415d('0x35')]=_[_0x415d('0x47')](_0x469731[_0x415d('0x35')]);_0x2efc14[_0x415d('0x3c')]=_[_0x415d('0x49')](_0x2efc14[_0x415d('0x33')],_0x2efc14[_0x415d('0x35')]);_0x10ee9a['attributes']=_['intersection'](_0x2efc14[_0x415d('0x33')],qs[_0x415d('0x37')](_0x469731['query'][_0x415d('0x37')]));_0x10ee9a[_0x415d('0x36')]=_0x10ee9a['attributes']['length']?_0x10ee9a[_0x415d('0x36')]:_0x2efc14[_0x415d('0x33')];_0x10ee9a[_0x415d('0x51')]=qs[_0x415d('0x3a')](_0x469731[_0x415d('0x35')][_0x415d('0x3a')]);_0x10ee9a[_0x415d('0x3b')]=qs[_0x415d('0x3c')](_[_0x415d('0x3d')](_0x469731[_0x415d('0x35')],_0x2efc14[_0x415d('0x3c')]));if(_0x469731['query']['filter']){_0x10ee9a[_0x415d('0x3b')]=_['merge'](_0x10ee9a[_0x415d('0x3b')],{'$or':_['map'](_0x10ee9a[_0x415d('0x36')],function(_0x2fd49f){var _0x14f9f7={};_0x14f9f7[_0x2fd49f]={'$like':'%'+_0x469731[_0x415d('0x35')][_0x415d('0x40')]+'%'};return _0x14f9f7;})});}_0x10ee9a=_[_0x415d('0x3e')]({},_0x10ee9a,_0x469731[_0x415d('0x4a')]);return _0x5e1724[_0x415d('0x4e')](_0x10ee9a);}})[_0x415d('0x28')](function(_0x33ac0e){if(_0x33ac0e){_0x2c0a97=_0x33ac0e['length'];if(!_0x469731[_0x415d('0x35')][_0x415d('0x39')](_0x415d('0x52'))){_0x10ee9a[_0x415d('0x21')]=qs[_0x415d('0x21')](_0x469731['query'][_0x415d('0x21')]);_0x10ee9a['offset']=qs[_0x415d('0x1e')](_0x469731[_0x415d('0x35')]['offset']);}return _0x5e1724[_0x415d('0x4e')](_0x10ee9a);}})[_0x415d('0x28')](function(_0x3848de){if(_0x3848de){return _0x3848de?{'count':_0x2c0a97,'rows':_0x3848de}:null;}})[_0x415d('0x28')](respondWithResult(_0x1a0924,null))[_0x415d('0x44')](handleError(_0x1a0924,null));};exports[_0x415d('0x53')]=function(_0x36d17a,_0x91c53a,_0x5e05e1){if(_0x36d17a[_0x415d('0x4d')]['id']){delete _0x36d17a[_0x415d('0x4d')]['id'];}return db[_0x415d('0x2f')]['findOne']({'where':{'id':_0x36d17a['params']['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x91c53a,null))[_0x415d('0x28')](function(_0x2a036c){if(_0x2a036c){_0x36d17a[_0x415d('0x4d')][_0x415d('0x54')]=_0x2a036c['id'];_0x36d17a[_0x415d('0x4d')][_0x415d('0x55')]=integrations[_0x415d('0x56')](_0x36d17a[_0x415d('0x4d')][_0x415d('0x57')],_0x36d17a[_0x415d('0x4d')][_0x415d('0x31')]);_0x36d17a[_0x415d('0x4d')][_0x415d('0x58')]=integrations[_0x415d('0x59')](_0x36d17a[_0x415d('0x4d')][_0x415d('0x57')],_0x36d17a[_0x415d('0x4d')][_0x415d('0x31')]);return db['ZohoConfiguration'][_0x415d('0x4c')](_0x36d17a[_0x415d('0x4d')],{'include':[{'model':db[_0x415d('0x5a')],'as':'Subjects'},{'model':db[_0x415d('0x5a')],'as':_0x415d('0x58')}]});}return null;})['then'](respondWithResult(_0x91c53a,null))[_0x415d('0x44')](handleError(_0x91c53a,null));};function getAccessToken(_0x3c463f){return new Promise(function(_0x30134a,_0x2e3722){var _0x1f64b1;switch(_0x3c463f['zone']){case'US':_0x1f64b1=_0x415d('0x5b');break;case'AU':_0x1f64b1=_0x415d('0x5c');break;case'EU':_0x1f64b1='https://accounts.zoho.eu';break;case'IN':_0x1f64b1='https://accounts.zoho.in';break;case'CN':_0x1f64b1='https://accounts.zoho.com.cn';break;default:_0x1f64b1=_0x415d('0x5d');break;}var _0x2cbc6f={'method':'POST','uri':_0x1f64b1+_0x415d('0x5e'),'qs':{'refresh_token':_0x3c463f['refreshToken'],'client_id':_0x3c463f[_0x415d('0x5f')],'client_secret':_0x3c463f['clientSecret'],'grant_type':_0x415d('0x60')},'json':!![]};return rp(_0x2cbc6f)[_0x415d('0x28')](function(_0x368c7f){if(_0x368c7f[_0x415d('0x61')]){_0x30134a(_0x368c7f[_0x415d('0x61')]);}else{_0x2e3722(_0x415d('0x62'));}})[_0x415d('0x44')](function(_0x2a5c26){_0x2e3722(_0x2a5c26);});});}exports[_0x415d('0x63')]=function(_0x14728e,_0x5677f4,_0x35bd24){var _0x51acec,_0x4c31cf,_0x3f6ae4,_0x558972,_0x5c30f7;return db[_0x415d('0x2f')][_0x415d('0x4f')]({'where':{'id':_0x14728e[_0x415d('0x46')]['id']},'attributes':['id',_0x415d('0x64'),_0x415d('0x65'),'clientId',_0x415d('0x66'),_0x415d('0x67'),_0x415d('0x68'),_0x415d('0x69')]})['then'](handleEntityNotFound(_0x5677f4,null))['then'](function(_0x367dde){_0x5c30f7=_0x367dde;_0x51acec=_0x5c30f7[_0x415d('0x64')];_0x4c31cf=_0x51acec===_0x415d('0x6a')?'eu':'com';_0x3f6ae4=_0x5c30f7['serverUrl'];var _0x2385cc=_0x3f6ae4[_0x415d('0x6b')](-0x1);if(_0x2385cc==='/'||_0x2385cc==='\x5c'||_0x2385cc===':'){_0x3f6ae4=_0x3f6ae4[_0x415d('0x6c')](0x0,_0x3f6ae4[_0x415d('0x6d')](_0x2385cc));}if(!_0x5c30f7['refreshToken']){throw new Error(_0x415d('0x6e'));}return getAccessToken(_0x5c30f7);})[_0x415d('0x28')](function(_0x430bac){if(_0x430bac){return rp({'method':_0x415d('0x6f'),'uri':util['format'](_0x415d('0x70'),_0x4c31cf),'qs':{'module':_0x415d('0x71')},'headers':{'Authorization':_0x415d('0x72')+_0x430bac},'json':!![]});}})['then'](function(_0x1bcea8){if(_0x1bcea8){if(_0x1bcea8['response']&&_0x1bcea8[_0x415d('0x73')]['error']){throw new Error(_0x1bcea8[_0x415d('0x73')][_0x415d('0x2b')][_0x415d('0x74')]);}var _0x3a2b5d=[];var _0x44ce65=[];var _0x231aa8=['Owner',_0x415d('0x75'),'Description',_0x415d('0x76'),_0x415d('0x77'),_0x415d('0x78'),_0x415d('0x79'),'Call_Type'];_0x44ce65=_[_0x415d('0x7a')](_0x1bcea8[_0x415d('0x37')],function(_0x43c16f){return _0x231aa8[_0x415d('0x7b')](_0x43c16f[_0x415d('0x7c')]);});for(var _0x2e7b28=0x0;_0x2e7b28<_0x44ce65['length'];_0x2e7b28++){if(_0x44ce65[_0x2e7b28][_0x415d('0x7d')]===![]){_0x3a2b5d[_0x415d('0x7e')]({'id':_0x44ce65[_0x2e7b28]['id'],'name':_0x44ce65[_0x2e7b28][_0x415d('0x7f')],'custom':_0x44ce65[_0x2e7b28][_0x415d('0x80')],'options':_0x44ce65[_0x2e7b28][_0x415d('0x81')]===_0x415d('0x82')&&_0x44ce65[_0x2e7b28][_0x415d('0x83')][_0x415d('0x38')]>-0x1?_[_0x415d('0x34')](_0x44ce65[_0x2e7b28][_0x415d('0x83')],function(_0x3045cb){return{'name':_0x3045cb,'value':_0x3045cb};}):[]});}}return{'count':_0x3a2b5d['length'],'rows':_0x3a2b5d};}else{return{'count':0x0,'rows':[]};}})[_0x415d('0x28')](respondWithResult(_0x5677f4,null))[_0x415d('0x44')](function(_0x42fb2c){var _0x27c2da=_0x14728e['query'][_0x415d('0x84')]?0x1f4:_0x42fb2c[_0x415d('0x85')]||0x1f4;logger[_0x415d('0x2b')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x27c2da,JSON['stringify'](_0x42fb2c));delete _0x42fb2c[_0x415d('0x2c')];if(_0x27c2da===0x191){_0x27c2da=0x190;}_0x5677f4[_0x415d('0x1c')](_0x27c2da)['send'](_0x14728e[_0x415d('0x35')][_0x415d('0x84')]?{'message':_0x415d('0x86'),'statusCode':_0x42fb2c[_0x415d('0x85')]}:_0x42fb2c);});};
\ No newline at end of file
index 5fc88fa..a8794d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1f3=['changed','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','lastIndexOf','https://accounts.zoho.com','parse','refreshToken','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','zone'];(function(_0x55cd29,_0x38b611){var _0x2f03a8=function(_0x14803d){while(--_0x14803d){_0x55cd29['push'](_0x55cd29['shift']());}};_0x2f03a8(++_0x38b611);}(_0xc1f3,0xa2));var _0x3c1f=function(_0x259c3d,_0x13e83c){_0x259c3d=_0x259c3d-0x0;var _0x3f67ce=_0xc1f3[_0x259c3d];return _0x3f67ce;};'use strict';var _=require(_0x3c1f('0x0'));var util=require(_0x3c1f('0x1'));var logger=require(_0x3c1f('0x2'))(_0x3c1f('0x3'));var moment=require(_0x3c1f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3c1f('0x5'));var fs=require('fs');var path=require(_0x3c1f('0x6'));var rimraf=require(_0x3c1f('0x7'));var config=require(_0x3c1f('0x8'));var attributes=require(_0x3c1f('0x9'));var integrations=require(_0x3c1f('0xa'));module[_0x3c1f('0xb')]=function(_0x1c3aae,_0x3a041c){return _0x1c3aae[_0x3c1f('0xc')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3b908d,_0x3eb47d,_0x538683){if(_0x3b908d['changed'](_0x3c1f('0xd'))||_0x3b908d[_0x3c1f('0xe')](_0x3c1f('0xf'))||_0x3b908d['changed'](_0x3c1f('0x10'))||_0x3b908d['changed'](_0x3c1f('0x11'))||_0x3b908d[_0x3c1f('0xe')](_0x3c1f('0x12'))||_0x3b908d['changed'](_0x3c1f('0x13'))){var _0x3f3972,_0x29058e;_0x3f3972=_0x3b908d[_0x3c1f('0xf')];var _0x33bcdd=_0x3f3972[_0x3c1f('0x14')](-0x1);if(_0x33bcdd==='/'||_0x33bcdd==='\x5c'||_0x33bcdd===':'){_0x3f3972=_0x3f3972[_0x3c1f('0x15')](0x0,_0x3f3972['lastIndexOf'](_0x33bcdd));}switch(_0x3b908d[_0x3c1f('0xd')]){case'US':_0x29058e='https://accounts.zoho.com';break;case'AU':_0x29058e=_0x3c1f('0x16');break;case'IN':_0x29058e=_0x3c1f('0x17');break;case'CN':_0x29058e=_0x3c1f('0x18');break;default:_0x29058e=_0x3c1f('0x19');break;}var _0x31be35={'method':_0x3c1f('0x1a'),'uri':_0x29058e+_0x3c1f('0x1b'),'form':{'grant_type':_0x3c1f('0x1c'),'client_id':_0x3b908d[_0x3c1f('0x10')],'client_secret':_0x3b908d[_0x3c1f('0x11')],'redirect_uri':_0x3b908d[_0x3c1f('0xf')],'code':_0x3b908d[_0x3c1f('0x12')]},'headers':{'Content-Type':_0x3c1f('0x1d')}};return rp(_0x31be35)[_0x3c1f('0x1e')](function(_0x57727c){var _0x1e69f9=JSON['parse'](_0x57727c);if(_0x1e69f9[_0x3c1f('0x1f')]){_0x3b908d['refreshToken']=_0x1e69f9[_0x3c1f('0x1f')];logger[_0x3c1f('0x20')](util[_0x3c1f('0x21')](_0x3c1f('0x22'),_0x3b908d['name'],_0x3b908d['id']));}else{logger[_0x3c1f('0x23')](util[_0x3c1f('0x21')](_0x3c1f('0x24'),_0x3b908d[_0x3c1f('0x25')],_0x3b908d['id']),util[_0x3c1f('0x26')](_0x1e69f9,{'showHidden':![],'depth':null}));}return _0x538683(null,_0x3eb47d);})[_0x3c1f('0x27')](function(_0xd07f38){logger[_0x3c1f('0x23')](util['format'](_0x3c1f('0x24'),_0x3b908d[_0x3c1f('0x25')],_0x3b908d['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x538683(_0xd07f38);});}else{return _0x538683(null,_0x3eb47d);}},'beforeUpdate':function(_0x43f451,_0x231f5e,_0x464261){if(_0x43f451[_0x3c1f('0xe')]('zone')||_0x43f451[_0x3c1f('0xe')]('serverUrl')||_0x43f451[_0x3c1f('0xe')](_0x3c1f('0x10'))||_0x43f451[_0x3c1f('0xe')](_0x3c1f('0x11'))||_0x43f451[_0x3c1f('0xe')](_0x3c1f('0x12'))||_0x43f451[_0x3c1f('0xe')](_0x3c1f('0x13'))){var _0x5d04d3,_0x473f3a;_0x5d04d3=_0x43f451[_0x3c1f('0xf')];var _0x55ab2f=_0x5d04d3[_0x3c1f('0x14')](-0x1);if(_0x55ab2f==='/'||_0x55ab2f==='\x5c'||_0x55ab2f===':'){_0x5d04d3=_0x5d04d3[_0x3c1f('0x15')](0x0,_0x5d04d3[_0x3c1f('0x28')](_0x55ab2f));}switch(_0x43f451[_0x3c1f('0xd')]){case'US':_0x473f3a=_0x3c1f('0x29');break;case'AU':_0x473f3a=_0x3c1f('0x16');break;case'IN':_0x473f3a=_0x3c1f('0x17');break;case'CN':_0x473f3a=_0x3c1f('0x18');break;default:_0x473f3a=_0x3c1f('0x19');break;}var _0x24f6d2={'method':'POST','uri':_0x473f3a+_0x3c1f('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x43f451[_0x3c1f('0x10')],'client_secret':_0x43f451[_0x3c1f('0x11')],'redirect_uri':_0x43f451[_0x3c1f('0xf')],'code':_0x43f451['code']},'headers':{'Content-Type':_0x3c1f('0x1d')}};return rp(_0x24f6d2)[_0x3c1f('0x1e')](function(_0x1bdd9d){var _0xcf1c0=JSON[_0x3c1f('0x2a')](_0x1bdd9d);if(_0xcf1c0['refresh_token']){_0x43f451[_0x3c1f('0x2b')]=_0xcf1c0[_0x3c1f('0x1f')];logger['info'](util[_0x3c1f('0x21')](_0x3c1f('0x22'),_0x43f451[_0x3c1f('0x25')],_0x43f451['id']));}else{logger[_0x3c1f('0x23')](util[_0x3c1f('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x43f451[_0x3c1f('0x25')],_0x43f451['id']),util[_0x3c1f('0x26')](_0xcf1c0,{'showHidden':![],'depth':null}));}return _0x464261(null,_0x231f5e);})[_0x3c1f('0x27')](function(_0x5b775c){logger[_0x3c1f('0x23')](util[_0x3c1f('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x43f451[_0x3c1f('0x25')],_0x43f451['id']),util[_0x3c1f('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x464261(_0x5b775c);});}else{return _0x464261(null,_0x231f5e);}}}});};
\ No newline at end of file
+var _0x1b26=['parse','refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','authorization_code','application/x-www-form-urlencoded','then','info','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','changed','serverUrl','clientId','clientSecret','code','host','slice','zone','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'];(function(_0x3be82b,_0x3ef4fb){var _0x293c0e=function(_0x6af388){while(--_0x6af388){_0x3be82b['push'](_0x3be82b['shift']());}};_0x293c0e(++_0x3ef4fb);}(_0x1b26,0x15f));var _0x61b2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x1b26[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x61b2('0x0'));var util=require('util');var logger=require(_0x61b2('0x1'))('api');var moment=require(_0x61b2('0x2'));var BPromise=require(_0x61b2('0x3'));var rp=require(_0x61b2('0x4'));var fs=require('fs');var path=require(_0x61b2('0x5'));var rimraf=require(_0x61b2('0x6'));var config=require(_0x61b2('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x61b2('0x8'));module[_0x61b2('0x9')]=function(_0x59764b,_0x5e6d2f){return _0x59764b[_0x61b2('0xa')](_0x61b2('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1505bf,_0x423d5b,_0x328981){if(_0x1505bf[_0x61b2('0xc')]('zone')||_0x1505bf['changed'](_0x61b2('0xd'))||_0x1505bf['changed'](_0x61b2('0xe'))||_0x1505bf['changed'](_0x61b2('0xf'))||_0x1505bf[_0x61b2('0xc')](_0x61b2('0x10'))||_0x1505bf[_0x61b2('0xc')](_0x61b2('0x11'))){var _0x1c9859,_0x568cdf;_0x1c9859=_0x1505bf[_0x61b2('0xd')];var _0x48a564=_0x1c9859[_0x61b2('0x12')](-0x1);if(_0x48a564==='/'||_0x48a564==='\x5c'||_0x48a564===':'){_0x1c9859=_0x1c9859['substring'](0x0,_0x1c9859['lastIndexOf'](_0x48a564));}switch(_0x1505bf[_0x61b2('0x13')]){case'US':_0x568cdf=_0x61b2('0x14');break;case'AU':_0x568cdf=_0x61b2('0x15');break;case'IN':_0x568cdf=_0x61b2('0x16');break;case'CN':_0x568cdf=_0x61b2('0x17');break;default:_0x568cdf=_0x61b2('0x18');break;}var _0x3383ca={'method':_0x61b2('0x19'),'uri':_0x568cdf+_0x61b2('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x1505bf[_0x61b2('0xe')],'client_secret':_0x1505bf[_0x61b2('0xf')],'redirect_uri':_0x1505bf['serverUrl'],'code':_0x1505bf[_0x61b2('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3383ca)['then'](function(_0x1de1a6){var _0x261c4d=JSON[_0x61b2('0x1b')](_0x1de1a6);if(_0x261c4d[_0x61b2('0x1c')]){_0x1505bf[_0x61b2('0x1d')]=_0x261c4d[_0x61b2('0x1c')];logger['info'](util['format'](_0x61b2('0x1e'),_0x1505bf[_0x61b2('0x1f')],_0x1505bf['id']));}else{logger[_0x61b2('0x20')](util[_0x61b2('0x21')](_0x61b2('0x22'),_0x1505bf[_0x61b2('0x1f')],_0x1505bf['id']),util[_0x61b2('0x23')](_0x261c4d,{'showHidden':![],'depth':null}));}return _0x328981(null,_0x423d5b);})[_0x61b2('0x24')](function(_0x3345ab){logger[_0x61b2('0x20')](util['format'](_0x61b2('0x22'),_0x1505bf[_0x61b2('0x1f')],_0x1505bf['id']),util[_0x61b2('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x328981(_0x3345ab);});}else{return _0x328981(null,_0x423d5b);}},'beforeUpdate':function(_0x40f9eb,_0xc2691b,_0x3b51a5){if(_0x40f9eb[_0x61b2('0xc')]('zone')||_0x40f9eb[_0x61b2('0xc')](_0x61b2('0xd'))||_0x40f9eb[_0x61b2('0xc')]('clientId')||_0x40f9eb[_0x61b2('0xc')](_0x61b2('0xf'))||_0x40f9eb[_0x61b2('0xc')]('code')||_0x40f9eb[_0x61b2('0xc')](_0x61b2('0x11'))){var _0x2ed0d3,_0x516df0;_0x2ed0d3=_0x40f9eb[_0x61b2('0xd')];var _0x429386=_0x2ed0d3['slice'](-0x1);if(_0x429386==='/'||_0x429386==='\x5c'||_0x429386===':'){_0x2ed0d3=_0x2ed0d3[_0x61b2('0x25')](0x0,_0x2ed0d3['lastIndexOf'](_0x429386));}switch(_0x40f9eb[_0x61b2('0x13')]){case'US':_0x516df0=_0x61b2('0x14');break;case'AU':_0x516df0='https://accounts.zoho.com.au';break;case'IN':_0x516df0=_0x61b2('0x16');break;case'CN':_0x516df0=_0x61b2('0x17');break;default:_0x516df0=_0x61b2('0x18');break;}var _0x10100a={'method':_0x61b2('0x19'),'uri':_0x516df0+_0x61b2('0x1a'),'form':{'grant_type':_0x61b2('0x26'),'client_id':_0x40f9eb[_0x61b2('0xe')],'client_secret':_0x40f9eb[_0x61b2('0xf')],'redirect_uri':_0x40f9eb['serverUrl'],'code':_0x40f9eb[_0x61b2('0x10')]},'headers':{'Content-Type':_0x61b2('0x27')}};return rp(_0x10100a)[_0x61b2('0x28')](function(_0x4a5be4){var _0x28c6aa=JSON[_0x61b2('0x1b')](_0x4a5be4);if(_0x28c6aa['refresh_token']){_0x40f9eb[_0x61b2('0x1d')]=_0x28c6aa[_0x61b2('0x1c')];logger[_0x61b2('0x29')](util[_0x61b2('0x21')](_0x61b2('0x1e'),_0x40f9eb[_0x61b2('0x1f')],_0x40f9eb['id']));}else{logger['error'](util[_0x61b2('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x40f9eb[_0x61b2('0x1f')],_0x40f9eb['id']),util[_0x61b2('0x23')](_0x28c6aa,{'showHidden':![],'depth':null}));}return _0x3b51a5(null,_0xc2691b);})[_0x61b2('0x24')](function(_0x1178b3){logger[_0x61b2('0x20')](util[_0x61b2('0x21')](_0x61b2('0x22'),_0x40f9eb['name'],_0x40f9eb['id']),util[_0x61b2('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3b51a5(_0x1178b3);});}else{return _0x3b51a5(null,_0xc2691b);}}}});};
\ No newline at end of file
index 30c57cb..85fca7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb515=['request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','ZohoAccount','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','ShowZohoAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x18a313,_0x54020e){var _0x44ac80=function(_0xf53027){while(--_0xf53027){_0x18a313['push'](_0x18a313['shift']());}};_0x44ac80(++_0x54020e);}(_0xb515,0x1b8));var _0x5b51=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0xb515[_0x5f49c0];return _0x5ab653;};'use strict';var _=require(_0x5b51('0x0'));var util=require('util');var moment=require(_0x5b51('0x1'));var BPromise=require(_0x5b51('0x2'));var rs=require(_0x5b51('0x3'));var fs=require('fs');var Redis=require(_0x5b51('0x4'));var db=require(_0x5b51('0x5'))['db'];var utils=require(_0x5b51('0x6'));var logger=require(_0x5b51('0x7'))(_0x5b51('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b51('0x9'));var client=jayson[_0x5b51('0xa')][_0x5b51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x293d82,_0x396b3f,_0x2c6d86){return new BPromise(function(_0x1d5082,_0x226e9c){return client[_0x5b51('0xc')](_0x293d82,_0x2c6d86)[_0x5b51('0xd')](function(_0x1085e6){logger[_0x5b51('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x396b3f,_0x5b51('0xf'));logger[_0x5b51('0x10')](_0x5b51('0x11'),_0x396b3f,_0x5b51('0xf'),JSON[_0x5b51('0x12')](_0x1085e6));if(_0x1085e6[_0x5b51('0x13')]){if(_0x1085e6['error']['code']===0x1f4){logger['error'](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x226e9c(_0x1085e6[_0x5b51('0x13')]['message']);}logger[_0x5b51('0x13')](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x1d5082(_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);}else{logger[_0x5b51('0xe')](_0x5b51('0x14'),_0x396b3f,_0x5b51('0xf'));_0x1d5082(_0x1085e6[_0x5b51('0x16')][_0x5b51('0x15')]);}})[_0x5b51('0x17')](function(_0x520686){logger[_0x5b51('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x396b3f,_0x520686);_0x226e9c(_0x520686);});});}exports['GetZohoAccount']=function(_0x3d570d){var _0x2142ad=this;return new Promise(function(_0x56e747,_0xb030d5){return db[_0x5b51('0x18')]['findAll']({'raw':_0x3d570d[_0x5b51('0x19')]?_0x3d570d['options'][_0x5b51('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d570d[_0x5b51('0x19')]?_0x3d570d[_0x5b51('0x19')][_0x5b51('0x1b')]||null:null,'attributes':_0x3d570d[_0x5b51('0x19')]?_0x3d570d[_0x5b51('0x19')][_0x5b51('0x1c')]||null:null,'limit':_0x3d570d[_0x5b51('0x19')]?_0x3d570d['options'][_0x5b51('0x1d')]||null:null,'include':_0x3d570d[_0x5b51('0x19')]?_0x3d570d[_0x5b51('0x19')][_0x5b51('0x1e')]?_[_0x5b51('0x1f')](_0x3d570d[_0x5b51('0x19')]['include'],function(_0x59e842){return{'model':db[_0x59e842[_0x5b51('0x20')]],'as':_0x59e842['as'],'attributes':_0x59e842[_0x5b51('0x1c')],'include':_0x59e842['include']?_[_0x5b51('0x1f')](_0x59e842[_0x5b51('0x1e')],function(_0x4356fc){return{'model':db[_0x4356fc[_0x5b51('0x20')]],'as':_0x4356fc['as'],'attributes':_0x4356fc['attributes'],'include':_0x4356fc[_0x5b51('0x1e')]?_[_0x5b51('0x1f')](_0x4356fc[_0x5b51('0x1e')],function(_0x399d2a){return{'model':db[_0x399d2a[_0x5b51('0x20')]],'as':_0x399d2a['as'],'attributes':_0x399d2a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b51('0xd')](function(_0x5346c3){logger[_0x5b51('0xe')](_0x5b51('0x21'),_0x3d570d);logger[_0x5b51('0x10')](_0x5b51('0x21'),_0x3d570d,JSON[_0x5b51('0x12')](_0x5346c3));_0x56e747(_0x5346c3);})[_0x5b51('0x17')](function(_0xbefb98){logger[_0x5b51('0x13')](_0x5b51('0x21'),_0xbefb98[_0x5b51('0x15')],_0x3d570d);_0xb030d5(_0x2142ad['error'](0x1f4,_0xbefb98[_0x5b51('0x15')]));});});};exports[_0x5b51('0x22')]=function(_0x43d2e3){var _0xe456a9=this;return new Promise(function(_0x151955,_0x4ef6e0){return db[_0x5b51('0x18')]['find']({'raw':_0x43d2e3['options']?_0x43d2e3[_0x5b51('0x19')][_0x5b51('0x1a')]===undefined?!![]:![]:!![],'where':_0x43d2e3[_0x5b51('0x19')]?_0x43d2e3[_0x5b51('0x19')][_0x5b51('0x1b')]||null:null,'attributes':_0x43d2e3['options']?_0x43d2e3[_0x5b51('0x19')][_0x5b51('0x1c')]||null:null,'include':_0x43d2e3['options']?_0x43d2e3[_0x5b51('0x19')]['include']?_[_0x5b51('0x1f')](_0x43d2e3[_0x5b51('0x19')][_0x5b51('0x1e')],function(_0xaa1cd){return{'model':db[_0xaa1cd[_0x5b51('0x20')]],'as':_0xaa1cd['as'],'attributes':_0xaa1cd[_0x5b51('0x1c')],'include':_0xaa1cd[_0x5b51('0x1e')]?_[_0x5b51('0x1f')](_0xaa1cd[_0x5b51('0x1e')],function(_0x50d2ba){return{'model':db[_0x50d2ba['model']],'as':_0x50d2ba['as'],'attributes':_0x50d2ba[_0x5b51('0x1c')],'include':_0x50d2ba['include']?_[_0x5b51('0x1f')](_0x50d2ba[_0x5b51('0x1e')],function(_0x3d6127){return{'model':db[_0x3d6127[_0x5b51('0x20')]],'as':_0x3d6127['as'],'attributes':_0x3d6127[_0x5b51('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5b51('0xd')](function(_0x38b5ab){logger['info'](_0x5b51('0x22'),_0x43d2e3);logger[_0x5b51('0x10')](_0x5b51('0x22'),_0x43d2e3,JSON[_0x5b51('0x12')](_0x38b5ab));_0x151955(_0x38b5ab);})['catch'](function(_0x42867e){logger[_0x5b51('0x13')]('ShowZohoAccount',_0x42867e[_0x5b51('0x15')],_0x43d2e3);_0x4ef6e0(_0xe456a9[_0x5b51('0x13')](0x1f4,_0x42867e[_0x5b51('0x15')]));});});};
\ No newline at end of file
+var _0x29b1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','info','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0x29b1,0x16d));var _0x129b=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x29b1[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x129b('0x0'));var util=require(_0x129b('0x1'));var moment=require(_0x129b('0x2'));var BPromise=require(_0x129b('0x3'));var rs=require(_0x129b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x129b('0x5'))['db'];var utils=require(_0x129b('0x6'));var logger=require(_0x129b('0x7'))(_0x129b('0x8'));var config=require(_0x129b('0x9'));var jayson=require(_0x129b('0xa'));var client=jayson[_0x129b('0xb')][_0x129b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ce8f9,_0x3ef769,_0x5ac368){return new BPromise(function(_0x2c99a1,_0x1e29d6){return client['request'](_0x5ce8f9,_0x5ac368)[_0x129b('0xd')](function(_0x1abf45){logger['info'](_0x129b('0xe'),_0x3ef769,'request\x20sent');logger[_0x129b('0xf')](_0x129b('0x10'),_0x3ef769,_0x129b('0x11'),JSON['stringify'](_0x1abf45));if(_0x1abf45[_0x129b('0x12')]){if(_0x1abf45[_0x129b('0x12')][_0x129b('0x13')]===0x1f4){logger[_0x129b('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x3ef769,_0x1abf45['error']['message']);return _0x1e29d6(_0x1abf45[_0x129b('0x12')]['message']);}logger[_0x129b('0x12')](_0x129b('0xe'),_0x3ef769,_0x1abf45[_0x129b('0x12')]['message']);return _0x2c99a1(_0x1abf45[_0x129b('0x12')]['message']);}else{logger[_0x129b('0x14')](_0x129b('0xe'),_0x3ef769,_0x129b('0x11'));_0x2c99a1(_0x1abf45['result'][_0x129b('0x15')]);}})[_0x129b('0x16')](function(_0x1364f8){logger[_0x129b('0x12')](_0x129b('0xe'),_0x3ef769,_0x1364f8);_0x1e29d6(_0x1364f8);});});}exports[_0x129b('0x17')]=function(_0x135b42){var _0x169d4c=this;return new Promise(function(_0x299bb5,_0xecba14){return db[_0x129b('0x18')][_0x129b('0x19')]({'raw':_0x135b42['options']?_0x135b42[_0x129b('0x1a')][_0x129b('0x1b')]===undefined?!![]:![]:!![],'where':_0x135b42[_0x129b('0x1a')]?_0x135b42[_0x129b('0x1a')][_0x129b('0x1c')]||null:null,'attributes':_0x135b42[_0x129b('0x1a')]?_0x135b42[_0x129b('0x1a')][_0x129b('0x1d')]||null:null,'limit':_0x135b42[_0x129b('0x1a')]?_0x135b42[_0x129b('0x1a')][_0x129b('0x1e')]||null:null,'include':_0x135b42[_0x129b('0x1a')]?_0x135b42['options'][_0x129b('0x1f')]?_[_0x129b('0x20')](_0x135b42[_0x129b('0x1a')][_0x129b('0x1f')],function(_0x4d4b76){return{'model':db[_0x4d4b76['model']],'as':_0x4d4b76['as'],'attributes':_0x4d4b76[_0x129b('0x1d')],'include':_0x4d4b76['include']?_[_0x129b('0x20')](_0x4d4b76[_0x129b('0x1f')],function(_0x4c733d){return{'model':db[_0x4c733d['model']],'as':_0x4c733d['as'],'attributes':_0x4c733d[_0x129b('0x1d')],'include':_0x4c733d[_0x129b('0x1f')]?_[_0x129b('0x20')](_0x4c733d[_0x129b('0x1f')],function(_0x45e6be){return{'model':db[_0x45e6be[_0x129b('0x21')]],'as':_0x45e6be['as'],'attributes':_0x45e6be[_0x129b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x129b('0xd')](function(_0x4aaa74){logger[_0x129b('0x14')](_0x129b('0x17'),_0x135b42);logger['debug'](_0x129b('0x17'),_0x135b42,JSON['stringify'](_0x4aaa74));_0x299bb5(_0x4aaa74);})[_0x129b('0x16')](function(_0x4d1017){logger[_0x129b('0x12')](_0x129b('0x17'),_0x4d1017[_0x129b('0x15')],_0x135b42);_0xecba14(_0x169d4c[_0x129b('0x12')](0x1f4,_0x4d1017[_0x129b('0x15')]));});});};exports[_0x129b('0x22')]=function(_0x296461){var _0x2906ef=this;return new Promise(function(_0x371e89,_0x501e01){return db[_0x129b('0x18')][_0x129b('0x23')]({'raw':_0x296461['options']?_0x296461[_0x129b('0x1a')][_0x129b('0x1b')]===undefined?!![]:![]:!![],'where':_0x296461[_0x129b('0x1a')]?_0x296461['options'][_0x129b('0x1c')]||null:null,'attributes':_0x296461[_0x129b('0x1a')]?_0x296461['options']['attributes']||null:null,'include':_0x296461[_0x129b('0x1a')]?_0x296461['options'][_0x129b('0x1f')]?_['map'](_0x296461[_0x129b('0x1a')][_0x129b('0x1f')],function(_0x5ba68d){return{'model':db[_0x5ba68d[_0x129b('0x21')]],'as':_0x5ba68d['as'],'attributes':_0x5ba68d[_0x129b('0x1d')],'include':_0x5ba68d[_0x129b('0x1f')]?_['map'](_0x5ba68d[_0x129b('0x1f')],function(_0x1d0b95){return{'model':db[_0x1d0b95[_0x129b('0x21')]],'as':_0x1d0b95['as'],'attributes':_0x1d0b95[_0x129b('0x1d')],'include':_0x1d0b95['include']?_['map'](_0x1d0b95[_0x129b('0x1f')],function(_0x67b898){return{'model':db[_0x67b898['model']],'as':_0x67b898['as'],'attributes':_0x67b898[_0x129b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x129b('0xd')](function(_0x13b6b9){logger['info']('ShowZohoAccount',_0x296461);logger[_0x129b('0xf')](_0x129b('0x22'),_0x296461,JSON[_0x129b('0x24')](_0x13b6b9));_0x371e89(_0x13b6b9);})['catch'](function(_0x25569f){logger[_0x129b('0x12')]('ShowZohoAccount',_0x25569f[_0x129b('0x15')],_0x296461);_0x501e01(_0x2906ef[_0x129b('0x12')](0x1f4,_0x25569f['message']));});});};
\ No newline at end of file
index f8688d7..5cf3c3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f68=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5f68,0x1eb));var _0x85f6=function(_0x36f797,_0x351603){_0x36f797=_0x36f797-0x0;var _0x44ba30=_0x5f68[_0x36f797];return _0x44ba30;};'use strict';var multer=require(_0x85f6('0x0'));var util=require('util');var path=require(_0x85f6('0x1'));var timeout=require(_0x85f6('0x2'));var express=require(_0x85f6('0x3'));var router=express[_0x85f6('0x4')]();var fs_extra=require(_0x85f6('0x5'));var auth=require(_0x85f6('0x6'));var interaction=require(_0x85f6('0x7'));var config=require(_0x85f6('0x8'));var controller=require(_0x85f6('0x9'));router[_0x85f6('0xa')]('/',auth[_0x85f6('0xb')](),controller[_0x85f6('0xc')]);router[_0x85f6('0xa')](_0x85f6('0xd'),auth[_0x85f6('0xb')](),controller[_0x85f6('0xe')]);router[_0x85f6('0xa')](_0x85f6('0xf'),auth[_0x85f6('0xb')](),controller[_0x85f6('0x10')]);router[_0x85f6('0xa')](_0x85f6('0x11'),auth[_0x85f6('0xb')](),controller['getSubjects']);router[_0x85f6('0xa')](_0x85f6('0x12'),auth[_0x85f6('0xb')](),controller[_0x85f6('0x13')]);router[_0x85f6('0x14')]('/',auth[_0x85f6('0xb')](),controller[_0x85f6('0x15')]);router[_0x85f6('0x16')](_0x85f6('0xd'),auth['isAuthenticated'](),controller[_0x85f6('0x17')]);router['delete']('/:id',auth[_0x85f6('0xb')](),controller[_0x85f6('0x18')]);module[_0x85f6('0x19')]=router;
\ No newline at end of file
+var _0x9bb0=['index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoConfiguration.controller','get'];(function(_0x3f37a3,_0x13c68c){var _0x5b0252=function(_0x30b081){while(--_0x30b081){_0x3f37a3['push'](_0x3f37a3['shift']());}};_0x5b0252(++_0x13c68c);}(_0x9bb0,0x73));var _0x09bb=function(_0x5a6ee4,_0x2e1727){_0x5a6ee4=_0x5a6ee4-0x0;var _0x5906fa=_0x9bb0[_0x5a6ee4];return _0x5906fa;};'use strict';var multer=require(_0x09bb('0x0'));var util=require(_0x09bb('0x1'));var path=require(_0x09bb('0x2'));var timeout=require(_0x09bb('0x3'));var express=require(_0x09bb('0x4'));var router=express[_0x09bb('0x5')]();var fs_extra=require(_0x09bb('0x6'));var auth=require(_0x09bb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x09bb('0x8'));router[_0x09bb('0x9')]('/',auth['isAuthenticated'](),controller[_0x09bb('0xa')]);router[_0x09bb('0x9')]('/:id',auth[_0x09bb('0xb')](),controller[_0x09bb('0xc')]);router[_0x09bb('0x9')](_0x09bb('0xd'),auth[_0x09bb('0xb')](),controller[_0x09bb('0xe')]);router['get'](_0x09bb('0xf'),auth[_0x09bb('0xb')](),controller[_0x09bb('0x10')]);router[_0x09bb('0x9')](_0x09bb('0x11'),auth[_0x09bb('0xb')](),controller[_0x09bb('0x12')]);router[_0x09bb('0x13')]('/',auth[_0x09bb('0xb')](),controller[_0x09bb('0x14')]);router[_0x09bb('0x15')](_0x09bb('0x16'),auth[_0x09bb('0xb')](),controller[_0x09bb('0x17')]);router[_0x09bb('0x18')](_0x09bb('0x16'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 0247669..259e31f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf1e=['nothing','ENUM','contact_lead','STRING','lead','contact'];(function(_0x4b34c1,_0x4dcff0){var _0xf2544d=function(_0x51214a){while(--_0x51214a){_0x4b34c1['push'](_0x4b34c1['shift']());}};_0xf2544d(++_0x4dcff0);}(_0xbf1e,0x75));var _0xebf1=function(_0x1c53b2,_0x170d9a){_0x1c53b2=_0x1c53b2-0x0;var _0x5a03a4=_0xbf1e[_0x1c53b2];return _0x5a03a4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xebf1('0x0')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xebf1('0x1'),_0xebf1('0x2'),_0xebf1('0x3')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xebf1('0x4')](_0xebf1('0x5'),_0xebf1('0x2'),_0xebf1('0x1')),'defaultValue':_0xebf1('0x5')},'description':{'type':Sequelize[_0xebf1('0x0')]}};
\ No newline at end of file
+var _0xeb9e=['ENUM','lead','contact','nothing','contact_lead','exports'];(function(_0x20463f,_0x4cc37a){var _0x143ee4=function(_0x30bc31){while(--_0x30bc31){_0x20463f['push'](_0x20463f['shift']());}};_0x143ee4(++_0x4cc37a);}(_0xeb9e,0x143));var _0xeeb9=function(_0x50ea32,_0x4f00aa){_0x50ea32=_0x50ea32-0x0;var _0x1941ed=_0xeb9e[_0x50ea32];return _0x1941ed;};'use strict';var Sequelize=require('sequelize');module[_0xeeb9('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xeeb9('0x1')](_0xeeb9('0x2'),_0xeeb9('0x3'),_0xeeb9('0x4')),'defaultValue':_0xeeb9('0x2')},'moduleSearch':{'type':Sequelize[_0xeeb9('0x1')](_0xeeb9('0x5'),_0xeeb9('0x3'),_0xeeb9('0x2')),'defaultValue':_0xeeb9('0x5')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e4f54ee..cbf578b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a3e=['body','find','findOne','ZohoField','pick','nolimit','getFields','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','end','error','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','create'];(function(_0x24df8b,_0x45186d){var _0x5cfb5f=function(_0x45d613){while(--_0x45d613){_0x24df8b['push'](_0x24df8b['shift']());}};_0x5cfb5f(++_0x45186d);}(_0x8a3e,0x145));var _0xe8a3=function(_0x4d2366,_0x36582b){_0x4d2366=_0x4d2366-0x0;var _0x3b4356=_0x8a3e[_0x4d2366];return _0x3b4356;};'use strict';var emlformat=require(_0xe8a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe8a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8a3('0x2'));var moment=require(_0xe8a3('0x3'));var BPromise=require(_0xe8a3('0x4'));var Mustache=require(_0xe8a3('0x5'));var util=require(_0xe8a3('0x6'));var path=require(_0xe8a3('0x7'));var sox=require(_0xe8a3('0x8'));var csv=require(_0xe8a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8a3('0xa'));var _=require(_0xe8a3('0xb'));var squel=require('squel');var crypto=require(_0xe8a3('0xc'));var jsforce=require(_0xe8a3('0xd'));var deskjs=require(_0xe8a3('0xe'));var toCsv=require(_0xe8a3('0x9'));var querystring=require(_0xe8a3('0xf'));var Papa=require('papaparse');var Redis=require(_0xe8a3('0x10'));var authService=require(_0xe8a3('0x11'));var qs=require(_0xe8a3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8a3('0x13'))(_0xe8a3('0x14'));var utils=require(_0xe8a3('0x15'));var config=require(_0xe8a3('0x16'));var licenseUtil=require(_0xe8a3('0x17'));var db=require(_0xe8a3('0x18'))['db'];function respondWithStatusCode(_0x4e150c,_0xe90397){_0xe90397=_0xe90397||0xcc;return function(_0x45e79c){if(_0x45e79c){return _0x4e150c[_0xe8a3('0x19')](_0xe90397);}return _0x4e150c[_0xe8a3('0x1a')](_0xe90397)['end']();};}function respondWithResult(_0x32fd04,_0x4b1561){_0x4b1561=_0x4b1561||0xc8;return function(_0x4ec5f8){if(_0x4ec5f8){return _0x32fd04[_0xe8a3('0x1a')](_0x4b1561)[_0xe8a3('0x1b')](_0x4ec5f8);}};}function respondWithFilteredResult(_0x30d64e,_0x2feb8e){return function(_0x4ea64f){if(_0x4ea64f){var _0x2f373e=typeof _0x2feb8e[_0xe8a3('0x1c')]===_0xe8a3('0x1d')&&typeof _0x2feb8e[_0xe8a3('0x1e')]===_0xe8a3('0x1d');var _0x2d7252=_0x4ea64f['count'];var _0x150df2=_0x2f373e?0x0:_0x2feb8e[_0xe8a3('0x1c')];var _0xaf46f=_0x2f373e?_0x4ea64f[_0xe8a3('0x1f')]:_0x2feb8e[_0xe8a3('0x1c')]+_0x2feb8e['limit'];var _0x402e86;if(_0xaf46f>=_0x2d7252){_0xaf46f=_0x2d7252;_0x402e86=0xc8;}else{_0x402e86=0xce;}_0x30d64e[_0xe8a3('0x1a')](_0x402e86);return _0x30d64e['set'](_0xe8a3('0x20'),_0x150df2+'-'+_0xaf46f+'/'+_0x2d7252)[_0xe8a3('0x1b')](_0x4ea64f);}return null;};}function patchUpdates(_0x31e24a){return function(_0x45a1fb){try{jsonpatch['apply'](_0x45a1fb,_0x31e24a,!![]);}catch(_0x422f19){return BPromise[_0xe8a3('0x21')](_0x422f19);}return _0x45a1fb['save']();};}function saveUpdates(_0x4157f5,_0x3cae1b){return function(_0x3a179e){if(_0x3a179e){return _0x3a179e[_0xe8a3('0x22')](_0x4157f5)[_0xe8a3('0x23')](function(_0x184b15){return _0x184b15;});}return null;};}function removeEntity(_0x689473,_0x2db7a8){return function(_0x4d12b7){if(_0x4d12b7){return _0x4d12b7['destroy']()['then'](function(){_0x689473[_0xe8a3('0x1a')](0xcc)[_0xe8a3('0x24')]();});}};}function handleEntityNotFound(_0x328f2b,_0x14b23d){return function(_0x483d60){if(!_0x483d60){_0x328f2b['sendStatus'](0x194);}return _0x483d60;};}function handleError(_0x4beb6f,_0x58e48b){_0x58e48b=_0x58e48b||0x1f4;return function(_0x5e82f6){logger[_0xe8a3('0x25')](_0x5e82f6[_0xe8a3('0x26')]);if(_0x5e82f6[_0xe8a3('0x27')]){delete _0x5e82f6[_0xe8a3('0x27')];}_0x4beb6f[_0xe8a3('0x1a')](_0x58e48b)[_0xe8a3('0x28')](_0x5e82f6);};}exports['index']=function(_0x19b6c5,_0x5f62fe){var _0x19d1f7={},_0x16c45c={},_0xd179ea={'count':0x0,'rows':[]};var _0x5ee488=_[_0xe8a3('0x29')](db[_0xe8a3('0x2a')][_0xe8a3('0x2b')],function(_0x5a7cf2){return{'name':_0x5a7cf2[_0xe8a3('0x2c')],'type':_0x5a7cf2[_0xe8a3('0x2d')][_0xe8a3('0x2e')]};});_0x16c45c[_0xe8a3('0x2f')]=_['map'](_0x5ee488,'name');_0x16c45c[_0xe8a3('0x30')]=_[_0xe8a3('0x31')](_0x19b6c5[_0xe8a3('0x30')]);_0x16c45c[_0xe8a3('0x32')]=_['intersection'](_0x16c45c['model'],_0x16c45c[_0xe8a3('0x30')]);_0x19d1f7['attributes']=_[_0xe8a3('0x33')](_0x16c45c['model'],qs['fields'](_0x19b6c5['query'][_0xe8a3('0x34')]));_0x19d1f7[_0xe8a3('0x35')]=_0x19d1f7[_0xe8a3('0x35')][_0xe8a3('0x36')]?_0x19d1f7[_0xe8a3('0x35')]:_0x16c45c[_0xe8a3('0x2f')];if(!_0x19b6c5[_0xe8a3('0x30')][_0xe8a3('0x37')]('nolimit')){_0x19d1f7[_0xe8a3('0x1e')]=qs[_0xe8a3('0x1e')](_0x19b6c5[_0xe8a3('0x30')][_0xe8a3('0x1e')]);_0x19d1f7[_0xe8a3('0x1c')]=qs[_0xe8a3('0x1c')](_0x19b6c5[_0xe8a3('0x30')]['offset']);}_0x19d1f7[_0xe8a3('0x38')]=qs[_0xe8a3('0x39')](_0x19b6c5[_0xe8a3('0x30')]['sort']);_0x19d1f7['where']=qs[_0xe8a3('0x32')](_['pick'](_0x19b6c5[_0xe8a3('0x30')],_0x16c45c['filters']),_0x5ee488);if(_0x19b6c5['query'][_0xe8a3('0x3a')]){_0x19d1f7[_0xe8a3('0x3b')]=_[_0xe8a3('0x3c')](_0x19d1f7[_0xe8a3('0x3b')],{'$or':_['map'](_0x5ee488,function(_0x431f1c){if(_0x431f1c[_0xe8a3('0x2d')]!==_0xe8a3('0x3d')){var _0x5ad4b4={};_0x5ad4b4[_0x431f1c['name']]={'$like':'%'+_0x19b6c5[_0xe8a3('0x30')][_0xe8a3('0x3a')]+'%'};return _0x5ad4b4;}})});}_0x19d1f7=_['merge']({},_0x19d1f7,_0x19b6c5['options']);var _0x5de2ac={'where':_0x19d1f7[_0xe8a3('0x3b')]};return db[_0xe8a3('0x2a')][_0xe8a3('0x1f')](_0x5de2ac)[_0xe8a3('0x23')](function(_0x1c4fe7){_0xd179ea[_0xe8a3('0x1f')]=_0x1c4fe7;if(_0x19b6c5['query'][_0xe8a3('0x3e')]){_0x19d1f7[_0xe8a3('0x3f')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xe8a3('0x40')](_0x19d1f7);})[_0xe8a3('0x23')](function(_0x3ef5b7){_0xd179ea[_0xe8a3('0x41')]=_0x3ef5b7;return _0xd179ea;})[_0xe8a3('0x23')](respondWithFilteredResult(_0x5f62fe,_0x19d1f7))[_0xe8a3('0x42')](handleError(_0x5f62fe,null));};exports['show']=function(_0x1f09bc,_0x2e0282){var _0x227325={'raw':![],'where':{'id':_0x1f09bc[_0xe8a3('0x43')]['id']}},_0x3f5ce6={};_0x3f5ce6[_0xe8a3('0x2f')]=_[_0xe8a3('0x31')](db[_0xe8a3('0x2a')][_0xe8a3('0x2b')]);_0x3f5ce6[_0xe8a3('0x30')]=_['keys'](_0x1f09bc['query']);_0x3f5ce6['filters']=_[_0xe8a3('0x33')](_0x3f5ce6[_0xe8a3('0x2f')],_0x3f5ce6[_0xe8a3('0x30')]);_0x227325['attributes']=_[_0xe8a3('0x33')](_0x3f5ce6['model'],qs[_0xe8a3('0x34')](_0x1f09bc[_0xe8a3('0x30')]['fields']));_0x227325[_0xe8a3('0x35')]=_0x227325[_0xe8a3('0x35')]['length']?_0x227325[_0xe8a3('0x35')]:_0x3f5ce6[_0xe8a3('0x2f')];if(_0x1f09bc[_0xe8a3('0x30')][_0xe8a3('0x3e')]){_0x227325[_0xe8a3('0x3f')]=[{'all':!![]}];}_0x227325=_['merge']({},_0x227325,_0x1f09bc[_0xe8a3('0x44')]);return db['ZohoConfiguration']['find'](_0x227325)['then'](handleEntityNotFound(_0x2e0282,null))['then'](respondWithResult(_0x2e0282,null))[_0xe8a3('0x42')](handleError(_0x2e0282,null));};exports[_0xe8a3('0x45')]=function(_0x3f0348,_0x4231db){return db[_0xe8a3('0x2a')][_0xe8a3('0x45')](_0x3f0348[_0xe8a3('0x46')],{})['then'](respondWithResult(_0x4231db,0xc9))[_0xe8a3('0x42')](handleError(_0x4231db,null));};exports['update']=function(_0x2b74f3,_0x3961a0){if(_0x2b74f3['body']['id']){delete _0x2b74f3[_0xe8a3('0x46')]['id'];}return db[_0xe8a3('0x2a')]['find']({'where':{'id':_0x2b74f3[_0xe8a3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3961a0,null))['then'](saveUpdates(_0x2b74f3['body'],null))[_0xe8a3('0x23')](respondWithResult(_0x3961a0,null))[_0xe8a3('0x42')](handleError(_0x3961a0,null));};exports['destroy']=function(_0x17df9e,_0x38f539){return db[_0xe8a3('0x2a')][_0xe8a3('0x47')]({'where':{'id':_0x17df9e['params']['id']}})[_0xe8a3('0x23')](handleEntityNotFound(_0x38f539,null))[_0xe8a3('0x23')](removeEntity(_0x38f539,null))[_0xe8a3('0x42')](handleError(_0x38f539,null));};exports['getFields']=function(_0x221129,_0x3364c0,_0x57a1df){var _0x235d77={};var _0x2c2716={};var _0x51edff;var _0x34ac45;return db[_0xe8a3('0x2a')][_0xe8a3('0x48')]({'where':{'id':_0x221129[_0xe8a3('0x43')]['id']}})[_0xe8a3('0x23')](handleEntityNotFound(_0x3364c0,null))[_0xe8a3('0x23')](function(_0x39faff){if(_0x39faff){_0x51edff=_0x39faff;_0x2c2716[_0xe8a3('0x2f')]=_[_0xe8a3('0x31')](db[_0xe8a3('0x49')][_0xe8a3('0x2b')]);_0x2c2716[_0xe8a3('0x30')]=_[_0xe8a3('0x31')](_0x221129[_0xe8a3('0x30')]);_0x2c2716[_0xe8a3('0x32')]=_['intersection'](_0x2c2716['model'],_0x2c2716['query']);_0x235d77['attributes']=_[_0xe8a3('0x33')](_0x2c2716[_0xe8a3('0x2f')],qs[_0xe8a3('0x34')](_0x221129[_0xe8a3('0x30')]['fields']));_0x235d77[_0xe8a3('0x35')]=_0x235d77['attributes'][_0xe8a3('0x36')]?_0x235d77[_0xe8a3('0x35')]:_0x2c2716['model'];_0x235d77[_0xe8a3('0x38')]=qs[_0xe8a3('0x39')](_0x221129[_0xe8a3('0x30')]['sort']);_0x235d77['where']=qs['filters'](_[_0xe8a3('0x4a')](_0x221129[_0xe8a3('0x30')],_0x2c2716[_0xe8a3('0x32')]));if(_0x221129[_0xe8a3('0x30')][_0xe8a3('0x3a')]){_0x235d77[_0xe8a3('0x3b')]=_[_0xe8a3('0x3c')](_0x235d77[_0xe8a3('0x3b')],{'$or':_[_0xe8a3('0x29')](_0x235d77[_0xe8a3('0x35')],function(_0x55c7bc){var _0x6c7950={};_0x6c7950[_0x55c7bc]={'$like':'%'+_0x221129[_0xe8a3('0x30')][_0xe8a3('0x3a')]+'%'};return _0x6c7950;})});}_0x235d77=_[_0xe8a3('0x3c')]({},_0x235d77,_0x221129[_0xe8a3('0x44')]);return _0x51edff['getFields'](_0x235d77);}})['then'](function(_0x359dc4){if(_0x359dc4){_0x34ac45=_0x359dc4['length'];if(!_0x221129[_0xe8a3('0x30')][_0xe8a3('0x37')](_0xe8a3('0x4b'))){_0x235d77['limit']=qs['limit'](_0x221129[_0xe8a3('0x30')][_0xe8a3('0x1e')]);_0x235d77[_0xe8a3('0x1c')]=qs[_0xe8a3('0x1c')](_0x221129[_0xe8a3('0x30')][_0xe8a3('0x1c')]);}return _0x51edff[_0xe8a3('0x4c')](_0x235d77);}})['then'](function(_0x26e728){if(_0x26e728){return _0x26e728?{'count':_0x34ac45,'rows':_0x26e728}:null;}})[_0xe8a3('0x23')](respondWithResult(_0x3364c0,null))['catch'](handleError(_0x3364c0,null));};exports[_0xe8a3('0x4d')]=function(_0x31b14c,_0x19cde1,_0x436f5b){var _0x42e9fc={};var _0x12c317={};var _0x39b820;var _0x3715dc;return db['ZohoConfiguration'][_0xe8a3('0x48')]({'where':{'id':_0x31b14c['params']['id']}})[_0xe8a3('0x23')](handleEntityNotFound(_0x19cde1,null))['then'](function(_0x21d470){if(_0x21d470){_0x39b820=_0x21d470;_0x12c317[_0xe8a3('0x2f')]=_[_0xe8a3('0x31')](db[_0xe8a3('0x49')][_0xe8a3('0x2b')]);_0x12c317[_0xe8a3('0x30')]=_['keys'](_0x31b14c[_0xe8a3('0x30')]);_0x12c317[_0xe8a3('0x32')]=_[_0xe8a3('0x33')](_0x12c317['model'],_0x12c317['query']);_0x42e9fc[_0xe8a3('0x35')]=_['intersection'](_0x12c317[_0xe8a3('0x2f')],qs['fields'](_0x31b14c[_0xe8a3('0x30')][_0xe8a3('0x34')]));_0x42e9fc['attributes']=_0x42e9fc[_0xe8a3('0x35')][_0xe8a3('0x36')]?_0x42e9fc[_0xe8a3('0x35')]:_0x12c317[_0xe8a3('0x2f')];_0x42e9fc[_0xe8a3('0x38')]=qs['sort'](_0x31b14c[_0xe8a3('0x30')]['sort']);_0x42e9fc[_0xe8a3('0x3b')]=qs['filters'](_['pick'](_0x31b14c[_0xe8a3('0x30')],_0x12c317[_0xe8a3('0x32')]));if(_0x31b14c[_0xe8a3('0x30')]['filter']){_0x42e9fc['where']=_[_0xe8a3('0x3c')](_0x42e9fc[_0xe8a3('0x3b')],{'$or':_[_0xe8a3('0x29')](_0x42e9fc['attributes'],function(_0x42da9b){var _0x83ca3e={};_0x83ca3e[_0x42da9b]={'$like':'%'+_0x31b14c['query']['filter']+'%'};return _0x83ca3e;})});}_0x42e9fc=_['merge']({},_0x42e9fc,_0x31b14c['options']);return _0x39b820[_0xe8a3('0x4d')](_0x42e9fc);}})[_0xe8a3('0x23')](function(_0x34ce18){if(_0x34ce18){_0x3715dc=_0x34ce18[_0xe8a3('0x36')];if(!_0x31b14c[_0xe8a3('0x30')][_0xe8a3('0x37')](_0xe8a3('0x4b'))){_0x42e9fc[_0xe8a3('0x1e')]=qs[_0xe8a3('0x1e')](_0x31b14c[_0xe8a3('0x30')]['limit']);_0x42e9fc[_0xe8a3('0x1c')]=qs[_0xe8a3('0x1c')](_0x31b14c['query'][_0xe8a3('0x1c')]);}return _0x39b820['getSubjects'](_0x42e9fc);}})[_0xe8a3('0x23')](function(_0x3d31f7){if(_0x3d31f7){return _0x3d31f7?{'count':_0x3715dc,'rows':_0x3d31f7}:null;}})[_0xe8a3('0x23')](respondWithResult(_0x19cde1,null))[_0xe8a3('0x42')](handleError(_0x19cde1,null));};exports[_0xe8a3('0x4e')]=function(_0x1e317f,_0x45994b,_0x2032e6){var _0xbcb2={};var _0xc8528c={};var _0x4b5d34;var _0x383cbc;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x1e317f[_0xe8a3('0x43')]['id']}})['then'](handleEntityNotFound(_0x45994b,null))[_0xe8a3('0x23')](function(_0x241a12){if(_0x241a12){_0x4b5d34=_0x241a12;_0xc8528c['model']=_['keys'](db[_0xe8a3('0x49')]['rawAttributes']);_0xc8528c[_0xe8a3('0x30')]=_[_0xe8a3('0x31')](_0x1e317f['query']);_0xc8528c['filters']=_['intersection'](_0xc8528c[_0xe8a3('0x2f')],_0xc8528c[_0xe8a3('0x30')]);_0xbcb2[_0xe8a3('0x35')]=_[_0xe8a3('0x33')](_0xc8528c['model'],qs[_0xe8a3('0x34')](_0x1e317f[_0xe8a3('0x30')][_0xe8a3('0x34')]));_0xbcb2['attributes']=_0xbcb2[_0xe8a3('0x35')][_0xe8a3('0x36')]?_0xbcb2[_0xe8a3('0x35')]:_0xc8528c[_0xe8a3('0x2f')];_0xbcb2[_0xe8a3('0x38')]=qs['sort'](_0x1e317f['query'][_0xe8a3('0x39')]);_0xbcb2[_0xe8a3('0x3b')]=qs['filters'](_[_0xe8a3('0x4a')](_0x1e317f[_0xe8a3('0x30')],_0xc8528c[_0xe8a3('0x32')]));if(_0x1e317f[_0xe8a3('0x30')][_0xe8a3('0x3a')]){_0xbcb2['where']=_[_0xe8a3('0x3c')](_0xbcb2['where'],{'$or':_[_0xe8a3('0x29')](_0xbcb2[_0xe8a3('0x35')],function(_0x2afdd9){var _0xccc895={};_0xccc895[_0x2afdd9]={'$like':'%'+_0x1e317f['query'][_0xe8a3('0x3a')]+'%'};return _0xccc895;})});}_0xbcb2=_[_0xe8a3('0x3c')]({},_0xbcb2,_0x1e317f[_0xe8a3('0x44')]);return _0x4b5d34[_0xe8a3('0x4e')](_0xbcb2);}})[_0xe8a3('0x23')](function(_0x52805c){if(_0x52805c){_0x383cbc=_0x52805c['length'];if(!_0x1e317f[_0xe8a3('0x30')][_0xe8a3('0x37')](_0xe8a3('0x4b'))){_0xbcb2[_0xe8a3('0x1e')]=qs[_0xe8a3('0x1e')](_0x1e317f[_0xe8a3('0x30')][_0xe8a3('0x1e')]);_0xbcb2[_0xe8a3('0x1c')]=qs[_0xe8a3('0x1c')](_0x1e317f[_0xe8a3('0x30')]['offset']);}return _0x4b5d34['getDescriptions'](_0xbcb2);}})[_0xe8a3('0x23')](function(_0x171db9){if(_0x171db9){return _0x171db9?{'count':_0x383cbc,'rows':_0x171db9}:null;}})[_0xe8a3('0x23')](respondWithResult(_0x45994b,null))[_0xe8a3('0x42')](handleError(_0x45994b,null));};
\ No newline at end of file
+var _0xe153=['set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status'];(function(_0x54211e,_0x39c424){var _0x43010c=function(_0x3c1d66){while(--_0x3c1d66){_0x54211e['push'](_0x54211e['shift']());}};_0x43010c(++_0x39c424);}(_0xe153,0xdd));var _0x3e15=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe153[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x3e15('0x0'));var rimraf=require(_0x3e15('0x1'));var zipdir=require(_0x3e15('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e15('0x3'));var moment=require(_0x3e15('0x4'));var BPromise=require(_0x3e15('0x5'));var Mustache=require(_0x3e15('0x6'));var util=require(_0x3e15('0x7'));var path=require(_0x3e15('0x8'));var sox=require(_0x3e15('0x9'));var csv=require('to-csv');var ejs=require(_0x3e15('0xa'));var fs=require('fs');var fs_extra=require(_0x3e15('0xb'));var _=require('lodash');var squel=require(_0x3e15('0xc'));var crypto=require(_0x3e15('0xd'));var jsforce=require(_0x3e15('0xe'));var deskjs=require(_0x3e15('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3e15('0x10'));var Papa=require(_0x3e15('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e15('0x12'));var as=require(_0x3e15('0x13'));var hardwareService=require(_0x3e15('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3e15('0x15'));var config=require(_0x3e15('0x16'));var licenseUtil=require(_0x3e15('0x17'));var db=require(_0x3e15('0x18'))['db'];function respondWithStatusCode(_0x33b74c,_0x492f1d){_0x492f1d=_0x492f1d||0xcc;return function(_0x2ca7ba){if(_0x2ca7ba){return _0x33b74c['sendStatus'](_0x492f1d);}return _0x33b74c['status'](_0x492f1d)[_0x3e15('0x19')]();};}function respondWithResult(_0x1552db,_0x1f55d9){_0x1f55d9=_0x1f55d9||0xc8;return function(_0x536867){if(_0x536867){return _0x1552db['status'](_0x1f55d9)['json'](_0x536867);}};}function respondWithFilteredResult(_0xc1f940,_0x1d39fd){return function(_0xa4a1af){if(_0xa4a1af){var _0x3d1bc6=typeof _0x1d39fd[_0x3e15('0x1a')]===_0x3e15('0x1b')&&typeof _0x1d39fd[_0x3e15('0x1c')]==='undefined';var _0x43558a=_0xa4a1af[_0x3e15('0x1d')];var _0x18feb1=_0x3d1bc6?0x0:_0x1d39fd[_0x3e15('0x1a')];var _0x10a9cf=_0x3d1bc6?_0xa4a1af['count']:_0x1d39fd[_0x3e15('0x1a')]+_0x1d39fd['limit'];var _0x239d19;if(_0x10a9cf>=_0x43558a){_0x10a9cf=_0x43558a;_0x239d19=0xc8;}else{_0x239d19=0xce;}_0xc1f940[_0x3e15('0x1e')](_0x239d19);return _0xc1f940[_0x3e15('0x1f')](_0x3e15('0x20'),_0x18feb1+'-'+_0x10a9cf+'/'+_0x43558a)[_0x3e15('0x21')](_0xa4a1af);}return null;};}function patchUpdates(_0xc410ca){return function(_0x4e3b31){try{jsonpatch[_0x3e15('0x22')](_0x4e3b31,_0xc410ca,!![]);}catch(_0x216f8d){return BPromise[_0x3e15('0x23')](_0x216f8d);}return _0x4e3b31[_0x3e15('0x24')]();};}function saveUpdates(_0x511f7a,_0x6892c0){return function(_0x13933b){if(_0x13933b){return _0x13933b[_0x3e15('0x25')](_0x511f7a)[_0x3e15('0x26')](function(_0x4dc9b0){return _0x4dc9b0;});}return null;};}function removeEntity(_0x50abf0,_0x3c9f9c){return function(_0x4a029c){if(_0x4a029c){return _0x4a029c['destroy']()[_0x3e15('0x26')](function(){_0x50abf0[_0x3e15('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bbee4,_0x2a86a3){return function(_0x3e5bf5){if(!_0x3e5bf5){_0x4bbee4[_0x3e15('0x27')](0x194);}return _0x3e5bf5;};}function handleError(_0x1159ec,_0x2e050c){_0x2e050c=_0x2e050c||0x1f4;return function(_0x3c36b2){logger[_0x3e15('0x28')](_0x3c36b2[_0x3e15('0x29')]);if(_0x3c36b2[_0x3e15('0x2a')]){delete _0x3c36b2[_0x3e15('0x2a')];}_0x1159ec[_0x3e15('0x1e')](_0x2e050c)[_0x3e15('0x2b')](_0x3c36b2);};}exports[_0x3e15('0x2c')]=function(_0x24d473,_0x31695f){var _0x4556eb={},_0x3e0afe={},_0x19b8a7={'count':0x0,'rows':[]};var _0x3aec31=_[_0x3e15('0x2d')](db[_0x3e15('0x2e')][_0x3e15('0x2f')],function(_0x51ba6a){return{'name':_0x51ba6a[_0x3e15('0x30')],'type':_0x51ba6a[_0x3e15('0x31')][_0x3e15('0x32')]};});_0x3e0afe[_0x3e15('0x33')]=_[_0x3e15('0x2d')](_0x3aec31,_0x3e15('0x2a'));_0x3e0afe['query']=_[_0x3e15('0x34')](_0x24d473[_0x3e15('0x35')]);_0x3e0afe['filters']=_[_0x3e15('0x36')](_0x3e0afe[_0x3e15('0x33')],_0x3e0afe[_0x3e15('0x35')]);_0x4556eb[_0x3e15('0x37')]=_[_0x3e15('0x36')](_0x3e0afe[_0x3e15('0x33')],qs[_0x3e15('0x38')](_0x24d473[_0x3e15('0x35')][_0x3e15('0x38')]));_0x4556eb[_0x3e15('0x37')]=_0x4556eb[_0x3e15('0x37')]['length']?_0x4556eb[_0x3e15('0x37')]:_0x3e0afe[_0x3e15('0x33')];if(!_0x24d473[_0x3e15('0x35')][_0x3e15('0x39')](_0x3e15('0x3a'))){_0x4556eb[_0x3e15('0x1c')]=qs[_0x3e15('0x1c')](_0x24d473[_0x3e15('0x35')]['limit']);_0x4556eb[_0x3e15('0x1a')]=qs[_0x3e15('0x1a')](_0x24d473[_0x3e15('0x35')][_0x3e15('0x1a')]);}_0x4556eb[_0x3e15('0x3b')]=qs[_0x3e15('0x3c')](_0x24d473[_0x3e15('0x35')][_0x3e15('0x3c')]);_0x4556eb[_0x3e15('0x3d')]=qs[_0x3e15('0x3e')](_[_0x3e15('0x3f')](_0x24d473[_0x3e15('0x35')],_0x3e0afe[_0x3e15('0x3e')]),_0x3aec31);if(_0x24d473[_0x3e15('0x35')][_0x3e15('0x40')]){_0x4556eb[_0x3e15('0x3d')]=_[_0x3e15('0x41')](_0x4556eb['where'],{'$or':_['map'](_0x3aec31,function(_0x3c9fa4){if(_0x3c9fa4[_0x3e15('0x31')]!=='VIRTUAL'){var _0x41f87b={};_0x41f87b[_0x3c9fa4[_0x3e15('0x2a')]]={'$like':'%'+_0x24d473[_0x3e15('0x35')][_0x3e15('0x40')]+'%'};return _0x41f87b;}})});}_0x4556eb=_[_0x3e15('0x41')]({},_0x4556eb,_0x24d473[_0x3e15('0x42')]);var _0xcf6f9a={'where':_0x4556eb[_0x3e15('0x3d')]};return db[_0x3e15('0x2e')]['count'](_0xcf6f9a)[_0x3e15('0x26')](function(_0x2eb932){_0x19b8a7['count']=_0x2eb932;if(_0x24d473[_0x3e15('0x35')][_0x3e15('0x43')]){_0x4556eb[_0x3e15('0x44')]=[{'all':!![]}];}return db[_0x3e15('0x2e')][_0x3e15('0x45')](_0x4556eb);})[_0x3e15('0x26')](function(_0x47e20a){_0x19b8a7[_0x3e15('0x46')]=_0x47e20a;return _0x19b8a7;})['then'](respondWithFilteredResult(_0x31695f,_0x4556eb))[_0x3e15('0x47')](handleError(_0x31695f,null));};exports[_0x3e15('0x48')]=function(_0x18d2c9,_0x57ca8e){var _0x5267fe={'raw':![],'where':{'id':_0x18d2c9[_0x3e15('0x49')]['id']}},_0x6d266e={};_0x6d266e[_0x3e15('0x33')]=_['keys'](db[_0x3e15('0x2e')][_0x3e15('0x2f')]);_0x6d266e[_0x3e15('0x35')]=_[_0x3e15('0x34')](_0x18d2c9[_0x3e15('0x35')]);_0x6d266e['filters']=_[_0x3e15('0x36')](_0x6d266e[_0x3e15('0x33')],_0x6d266e[_0x3e15('0x35')]);_0x5267fe['attributes']=_[_0x3e15('0x36')](_0x6d266e['model'],qs['fields'](_0x18d2c9[_0x3e15('0x35')][_0x3e15('0x38')]));_0x5267fe[_0x3e15('0x37')]=_0x5267fe['attributes'][_0x3e15('0x4a')]?_0x5267fe['attributes']:_0x6d266e[_0x3e15('0x33')];if(_0x18d2c9['query'][_0x3e15('0x43')]){_0x5267fe['include']=[{'all':!![]}];}_0x5267fe=_[_0x3e15('0x41')]({},_0x5267fe,_0x18d2c9[_0x3e15('0x42')]);return db['ZohoConfiguration'][_0x3e15('0x4b')](_0x5267fe)[_0x3e15('0x26')](handleEntityNotFound(_0x57ca8e,null))[_0x3e15('0x26')](respondWithResult(_0x57ca8e,null))[_0x3e15('0x47')](handleError(_0x57ca8e,null));};exports['create']=function(_0x183a81,_0x4daa7d){return db[_0x3e15('0x2e')][_0x3e15('0x4c')](_0x183a81[_0x3e15('0x4d')],{})[_0x3e15('0x26')](respondWithResult(_0x4daa7d,0xc9))[_0x3e15('0x47')](handleError(_0x4daa7d,null));};exports[_0x3e15('0x25')]=function(_0x2761bc,_0x133db8){if(_0x2761bc['body']['id']){delete _0x2761bc[_0x3e15('0x4d')]['id'];}return db[_0x3e15('0x2e')][_0x3e15('0x4b')]({'where':{'id':_0x2761bc[_0x3e15('0x49')]['id']}})['then'](handleEntityNotFound(_0x133db8,null))[_0x3e15('0x26')](saveUpdates(_0x2761bc[_0x3e15('0x4d')],null))[_0x3e15('0x26')](respondWithResult(_0x133db8,null))[_0x3e15('0x47')](handleError(_0x133db8,null));};exports[_0x3e15('0x4e')]=function(_0x2751ad,_0x2bef08){return db[_0x3e15('0x2e')][_0x3e15('0x4b')]({'where':{'id':_0x2751ad['params']['id']}})[_0x3e15('0x26')](handleEntityNotFound(_0x2bef08,null))['then'](removeEntity(_0x2bef08,null))[_0x3e15('0x47')](handleError(_0x2bef08,null));};exports[_0x3e15('0x4f')]=function(_0x3e52bb,_0x97dbaa,_0x3eb3ab){var _0x385d55={};var _0x57397d={};var _0x441ea6;var _0x16e4ce;return db['ZohoConfiguration'][_0x3e15('0x50')]({'where':{'id':_0x3e52bb[_0x3e15('0x49')]['id']}})[_0x3e15('0x26')](handleEntityNotFound(_0x97dbaa,null))[_0x3e15('0x26')](function(_0x4157cd){if(_0x4157cd){_0x441ea6=_0x4157cd;_0x57397d[_0x3e15('0x33')]=_['keys'](db[_0x3e15('0x51')][_0x3e15('0x2f')]);_0x57397d[_0x3e15('0x35')]=_[_0x3e15('0x34')](_0x3e52bb[_0x3e15('0x35')]);_0x57397d[_0x3e15('0x3e')]=_['intersection'](_0x57397d[_0x3e15('0x33')],_0x57397d['query']);_0x385d55[_0x3e15('0x37')]=_[_0x3e15('0x36')](_0x57397d[_0x3e15('0x33')],qs['fields'](_0x3e52bb[_0x3e15('0x35')][_0x3e15('0x38')]));_0x385d55[_0x3e15('0x37')]=_0x385d55[_0x3e15('0x37')][_0x3e15('0x4a')]?_0x385d55['attributes']:_0x57397d['model'];_0x385d55[_0x3e15('0x3b')]=qs['sort'](_0x3e52bb['query'][_0x3e15('0x3c')]);_0x385d55[_0x3e15('0x3d')]=qs['filters'](_[_0x3e15('0x3f')](_0x3e52bb[_0x3e15('0x35')],_0x57397d[_0x3e15('0x3e')]));if(_0x3e52bb[_0x3e15('0x35')][_0x3e15('0x40')]){_0x385d55[_0x3e15('0x3d')]=_[_0x3e15('0x41')](_0x385d55[_0x3e15('0x3d')],{'$or':_['map'](_0x385d55['attributes'],function(_0x1c5a54){var _0x4d02d8={};_0x4d02d8[_0x1c5a54]={'$like':'%'+_0x3e52bb[_0x3e15('0x35')][_0x3e15('0x40')]+'%'};return _0x4d02d8;})});}_0x385d55=_[_0x3e15('0x41')]({},_0x385d55,_0x3e52bb['options']);return _0x441ea6[_0x3e15('0x4f')](_0x385d55);}})[_0x3e15('0x26')](function(_0x5af3cc){if(_0x5af3cc){_0x16e4ce=_0x5af3cc[_0x3e15('0x4a')];if(!_0x3e52bb[_0x3e15('0x35')][_0x3e15('0x39')](_0x3e15('0x3a'))){_0x385d55[_0x3e15('0x1c')]=qs[_0x3e15('0x1c')](_0x3e52bb[_0x3e15('0x35')][_0x3e15('0x1c')]);_0x385d55[_0x3e15('0x1a')]=qs[_0x3e15('0x1a')](_0x3e52bb[_0x3e15('0x35')][_0x3e15('0x1a')]);}return _0x441ea6[_0x3e15('0x4f')](_0x385d55);}})[_0x3e15('0x26')](function(_0x451c6a){if(_0x451c6a){return _0x451c6a?{'count':_0x16e4ce,'rows':_0x451c6a}:null;}})[_0x3e15('0x26')](respondWithResult(_0x97dbaa,null))[_0x3e15('0x47')](handleError(_0x97dbaa,null));};exports[_0x3e15('0x52')]=function(_0x4e3204,_0xa133db,_0x1f0dbb){var _0x2d6202={};var _0x9056cb={};var _0x5c2972;var _0x4b2945;return db[_0x3e15('0x2e')][_0x3e15('0x50')]({'where':{'id':_0x4e3204[_0x3e15('0x49')]['id']}})[_0x3e15('0x26')](handleEntityNotFound(_0xa133db,null))[_0x3e15('0x26')](function(_0xfe6cf4){if(_0xfe6cf4){_0x5c2972=_0xfe6cf4;_0x9056cb[_0x3e15('0x33')]=_[_0x3e15('0x34')](db[_0x3e15('0x51')]['rawAttributes']);_0x9056cb[_0x3e15('0x35')]=_['keys'](_0x4e3204[_0x3e15('0x35')]);_0x9056cb[_0x3e15('0x3e')]=_['intersection'](_0x9056cb[_0x3e15('0x33')],_0x9056cb['query']);_0x2d6202[_0x3e15('0x37')]=_['intersection'](_0x9056cb['model'],qs[_0x3e15('0x38')](_0x4e3204[_0x3e15('0x35')]['fields']));_0x2d6202[_0x3e15('0x37')]=_0x2d6202[_0x3e15('0x37')][_0x3e15('0x4a')]?_0x2d6202[_0x3e15('0x37')]:_0x9056cb['model'];_0x2d6202[_0x3e15('0x3b')]=qs[_0x3e15('0x3c')](_0x4e3204[_0x3e15('0x35')][_0x3e15('0x3c')]);_0x2d6202[_0x3e15('0x3d')]=qs[_0x3e15('0x3e')](_[_0x3e15('0x3f')](_0x4e3204[_0x3e15('0x35')],_0x9056cb[_0x3e15('0x3e')]));if(_0x4e3204[_0x3e15('0x35')][_0x3e15('0x40')]){_0x2d6202[_0x3e15('0x3d')]=_[_0x3e15('0x41')](_0x2d6202['where'],{'$or':_[_0x3e15('0x2d')](_0x2d6202[_0x3e15('0x37')],function(_0x4a04ba){var _0x3d44b3={};_0x3d44b3[_0x4a04ba]={'$like':'%'+_0x4e3204[_0x3e15('0x35')][_0x3e15('0x40')]+'%'};return _0x3d44b3;})});}_0x2d6202=_[_0x3e15('0x41')]({},_0x2d6202,_0x4e3204[_0x3e15('0x42')]);return _0x5c2972['getSubjects'](_0x2d6202);}})['then'](function(_0x5ef67a){if(_0x5ef67a){_0x4b2945=_0x5ef67a[_0x3e15('0x4a')];if(!_0x4e3204['query'][_0x3e15('0x39')]('nolimit')){_0x2d6202[_0x3e15('0x1c')]=qs['limit'](_0x4e3204['query'][_0x3e15('0x1c')]);_0x2d6202['offset']=qs[_0x3e15('0x1a')](_0x4e3204[_0x3e15('0x35')][_0x3e15('0x1a')]);}return _0x5c2972['getSubjects'](_0x2d6202);}})[_0x3e15('0x26')](function(_0x2a85e9){if(_0x2a85e9){return _0x2a85e9?{'count':_0x4b2945,'rows':_0x2a85e9}:null;}})[_0x3e15('0x26')](respondWithResult(_0xa133db,null))[_0x3e15('0x47')](handleError(_0xa133db,null));};exports[_0x3e15('0x53')]=function(_0x5e8de4,_0x4e2972,_0x1a544a){var _0x1f9b76={};var _0x16b835={};var _0x39a410;var _0x598d24;return db[_0x3e15('0x2e')][_0x3e15('0x50')]({'where':{'id':_0x5e8de4['params']['id']}})[_0x3e15('0x26')](handleEntityNotFound(_0x4e2972,null))[_0x3e15('0x26')](function(_0x858231){if(_0x858231){_0x39a410=_0x858231;_0x16b835[_0x3e15('0x33')]=_[_0x3e15('0x34')](db[_0x3e15('0x51')][_0x3e15('0x2f')]);_0x16b835[_0x3e15('0x35')]=_['keys'](_0x5e8de4[_0x3e15('0x35')]);_0x16b835[_0x3e15('0x3e')]=_[_0x3e15('0x36')](_0x16b835[_0x3e15('0x33')],_0x16b835[_0x3e15('0x35')]);_0x1f9b76[_0x3e15('0x37')]=_['intersection'](_0x16b835[_0x3e15('0x33')],qs[_0x3e15('0x38')](_0x5e8de4[_0x3e15('0x35')][_0x3e15('0x38')]));_0x1f9b76[_0x3e15('0x37')]=_0x1f9b76[_0x3e15('0x37')][_0x3e15('0x4a')]?_0x1f9b76['attributes']:_0x16b835[_0x3e15('0x33')];_0x1f9b76['order']=qs['sort'](_0x5e8de4['query'][_0x3e15('0x3c')]);_0x1f9b76['where']=qs[_0x3e15('0x3e')](_['pick'](_0x5e8de4['query'],_0x16b835[_0x3e15('0x3e')]));if(_0x5e8de4[_0x3e15('0x35')][_0x3e15('0x40')]){_0x1f9b76[_0x3e15('0x3d')]=_[_0x3e15('0x41')](_0x1f9b76['where'],{'$or':_[_0x3e15('0x2d')](_0x1f9b76[_0x3e15('0x37')],function(_0x131716){var _0x3f78b3={};_0x3f78b3[_0x131716]={'$like':'%'+_0x5e8de4[_0x3e15('0x35')][_0x3e15('0x40')]+'%'};return _0x3f78b3;})});}_0x1f9b76=_[_0x3e15('0x41')]({},_0x1f9b76,_0x5e8de4[_0x3e15('0x42')]);return _0x39a410[_0x3e15('0x53')](_0x1f9b76);}})[_0x3e15('0x26')](function(_0x909a26){if(_0x909a26){_0x598d24=_0x909a26[_0x3e15('0x4a')];if(!_0x5e8de4[_0x3e15('0x35')][_0x3e15('0x39')]('nolimit')){_0x1f9b76[_0x3e15('0x1c')]=qs[_0x3e15('0x1c')](_0x5e8de4[_0x3e15('0x35')][_0x3e15('0x1c')]);_0x1f9b76['offset']=qs['offset'](_0x5e8de4[_0x3e15('0x35')][_0x3e15('0x1a')]);}return _0x39a410[_0x3e15('0x53')](_0x1f9b76);}})[_0x3e15('0x26')](function(_0x26a6b4){if(_0x26a6b4){return _0x26a6b4?{'count':_0x598d24,'rows':_0x26a6b4}:null;}})[_0x3e15('0x26')](respondWithResult(_0x4e2972,null))[_0x3e15('0x47')](handleError(_0x4e2972,null));};
\ No newline at end of file
index 9cdef98..c33a58a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e77=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x5a2916,_0x4902a7){var _0x2e0efd=function(_0x4ed41e){while(--_0x4ed41e){_0x5a2916['push'](_0x5a2916['shift']());}};_0x2e0efd(++_0x4902a7);}(_0x4e77,0xfc));var _0x74e7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e77[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x74e7('0x0'));var util=require(_0x74e7('0x1'));var logger=require(_0x74e7('0x2'))(_0x74e7('0x3'));var moment=require('moment');var BPromise=require(_0x74e7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74e7('0x5'));var rimraf=require(_0x74e7('0x6'));var config=require(_0x74e7('0x7'));var attributes=require(_0x74e7('0x8'));module['exports']=function(_0x10ff77,_0x12f65a){return _0x10ff77['define'](_0x74e7('0x9'),attributes,{'tableName':_0x74e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d16=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','ZohoConfiguration'];(function(_0x340342,_0x2d07af){var _0x574f66=function(_0x2ca107){while(--_0x2ca107){_0x340342['push'](_0x340342['shift']());}};_0x574f66(++_0x2d07af);}(_0x7d16,0x19a));var _0x67d1=function(_0x2f1f03,_0xb66b6f){_0x2f1f03=_0x2f1f03-0x0;var _0x4d1013=_0x7d16[_0x2f1f03];return _0x4d1013;};'use strict';var _=require(_0x67d1('0x0'));var util=require(_0x67d1('0x1'));var logger=require(_0x67d1('0x2'))('api');var moment=require(_0x67d1('0x3'));var BPromise=require(_0x67d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67d1('0x5'));var rimraf=require(_0x67d1('0x6'));var config=require(_0x67d1('0x7'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x15a156,_0x3b9df5){return _0x15a156[_0x67d1('0x8')](_0x67d1('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe68d9c..b380be4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2956=['debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x2956,0x1d2));var _0x6295=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x2956[_0x102ff9];return _0x24fa97;};'use strict';var _=require('lodash');var util=require(_0x6295('0x0'));var moment=require(_0x6295('0x1'));var BPromise=require(_0x6295('0x2'));var rs=require(_0x6295('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6295('0x4'));var logger=require(_0x6295('0x5'))('rpc');var config=require(_0x6295('0x6'));var jayson=require(_0x6295('0x7'));var client=jayson[_0x6295('0x8')][_0x6295('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c5f0e,_0x5a0eb5,_0x4501cf){return new BPromise(function(_0x36918d,_0x38c48b){return client[_0x6295('0xa')](_0x5c5f0e,_0x4501cf)['then'](function(_0x10af1a){logger[_0x6295('0xb')](_0x6295('0xc'),_0x5a0eb5,_0x6295('0xd'));logger[_0x6295('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5a0eb5,_0x6295('0xd'),JSON[_0x6295('0xf')](_0x10af1a));if(_0x10af1a[_0x6295('0x10')]){if(_0x10af1a[_0x6295('0x10')]['code']===0x1f4){logger[_0x6295('0x10')](_0x6295('0xc'),_0x5a0eb5,_0x10af1a[_0x6295('0x10')][_0x6295('0x11')]);return _0x38c48b(_0x10af1a[_0x6295('0x10')][_0x6295('0x11')]);}logger[_0x6295('0x10')](_0x6295('0xc'),_0x5a0eb5,_0x10af1a['error']['message']);return _0x36918d(_0x10af1a[_0x6295('0x10')]['message']);}else{logger[_0x6295('0xb')](_0x6295('0xc'),_0x5a0eb5,_0x6295('0xd'));_0x36918d(_0x10af1a[_0x6295('0x12')][_0x6295('0x11')]);}})[_0x6295('0x13')](function(_0x3516be){logger[_0x6295('0x10')](_0x6295('0xc'),_0x5a0eb5,_0x3516be);_0x38c48b(_0x3516be);});});}
\ No newline at end of file
+var _0xe520=['rpc','../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4c918f,_0x3a7dae){var _0x12228c=function(_0x5075cb){while(--_0x5075cb){_0x4c918f['push'](_0x4c918f['shift']());}};_0x12228c(++_0x3a7dae);}(_0xe520,0x6c));var _0x0e52=function(_0x453141,_0x5c3355){_0x453141=_0x453141-0x0;var _0xc2cb9d=_0xe520[_0x453141];return _0xc2cb9d;};'use strict';var _=require(_0x0e52('0x0'));var util=require(_0x0e52('0x1'));var moment=require(_0x0e52('0x2'));var BPromise=require('bluebird');var rs=require(_0x0e52('0x3'));var fs=require('fs');var Redis=require(_0x0e52('0x4'));var db=require(_0x0e52('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e52('0x6'))(_0x0e52('0x7'));var config=require(_0x0e52('0x8'));var jayson=require(_0x0e52('0x9'));var client=jayson[_0x0e52('0xa')][_0x0e52('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bb6e1,_0x470228,_0x40990c){return new BPromise(function(_0x4ad747,_0x50bd98){return client[_0x0e52('0xc')](_0x5bb6e1,_0x40990c)['then'](function(_0x195bc1){logger['info'](_0x0e52('0xd'),_0x470228,_0x0e52('0xe'));logger[_0x0e52('0xf')](_0x0e52('0x10'),_0x470228,_0x0e52('0xe'),JSON['stringify'](_0x195bc1));if(_0x195bc1[_0x0e52('0x11')]){if(_0x195bc1[_0x0e52('0x11')][_0x0e52('0x12')]===0x1f4){logger[_0x0e52('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x470228,_0x195bc1['error'][_0x0e52('0x13')]);return _0x50bd98(_0x195bc1['error'][_0x0e52('0x13')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x470228,_0x195bc1[_0x0e52('0x11')][_0x0e52('0x13')]);return _0x4ad747(_0x195bc1['error']['message']);}else{logger[_0x0e52('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x470228,_0x0e52('0xe'));_0x4ad747(_0x195bc1[_0x0e52('0x15')][_0x0e52('0x13')]);}})[_0x0e52('0x16')](function(_0x16c04c){logger[_0x0e52('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x470228,_0x16c04c);_0x50bd98(_0x16c04c);});});}
\ No newline at end of file
index ecb2b59..22a73cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x818c=['put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xcb5d84,_0x52b951){var _0x51ec8c=function(_0x3e278e){while(--_0x3e278e){_0xcb5d84['push'](_0xcb5d84['shift']());}};_0x51ec8c(++_0x52b951);}(_0x818c,0xdc));var _0xc818=function(_0x2a77d0,_0x267e27){_0x2a77d0=_0x2a77d0-0x0;var _0x41589f=_0x818c[_0x2a77d0];return _0x41589f;};'use strict';var multer=require(_0xc818('0x0'));var util=require(_0xc818('0x1'));var path=require(_0xc818('0x2'));var timeout=require(_0xc818('0x3'));var express=require(_0xc818('0x4'));var router=express['Router']();var fs_extra=require(_0xc818('0x5'));var auth=require(_0xc818('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc818('0x7'));var controller=require(_0xc818('0x8'));router[_0xc818('0x9')]('/',auth[_0xc818('0xa')](),controller[_0xc818('0xb')]);router[_0xc818('0x9')](_0xc818('0xc'),auth[_0xc818('0xa')](),controller[_0xc818('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc818('0xe')]('/:id',auth[_0xc818('0xa')](),controller[_0xc818('0xf')]);router['delete'](_0xc818('0xc'),auth[_0xc818('0xa')](),controller[_0xc818('0x10')]);module[_0xc818('0x11')]=router;
\ No newline at end of file
+var _0x0347=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','/:id','post','create'];(function(_0x31911a,_0x2bc0af){var _0x4c5c2c=function(_0x64918e){while(--_0x64918e){_0x31911a['push'](_0x31911a['shift']());}};_0x4c5c2c(++_0x2bc0af);}(_0x0347,0xbf));var _0x7034=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0347[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x7034('0x0'));var util=require('util');var path=require(_0x7034('0x1'));var timeout=require(_0x7034('0x2'));var express=require(_0x7034('0x3'));var router=express[_0x7034('0x4')]();var fs_extra=require(_0x7034('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7034('0x6'));var config=require('../../config/environment');var controller=require(_0x7034('0x7'));router[_0x7034('0x8')]('/',auth[_0x7034('0x9')](),controller['index']);router[_0x7034('0x8')](_0x7034('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7034('0xb')]('/',auth[_0x7034('0x9')](),controller[_0x7034('0xc')]);router[_0x7034('0xd')](_0x7034('0xa'),auth[_0x7034('0x9')](),controller['update']);router[_0x7034('0xe')]('/:id',auth[_0x7034('0x9')](),controller[_0x7034('0xf')]);module[_0x7034('0x10')]=router;
\ No newline at end of file
index c117a57..7004d9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dcb=['customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x12bb88,_0x338673){var _0x160e30=function(_0x3414b5){while(--_0x3414b5){_0x12bb88['push'](_0x12bb88['shift']());}};_0x160e30(++_0x338673);}(_0x7dcb,0x176));var _0xb7dc=function(_0x2cb516,_0x585e04){_0x2cb516=_0x2cb516-0x0;var _0x41fdb8=_0x7dcb[_0x2cb516];return _0x41fdb8;};'use strict';var Sequelize=require(_0xb7dc('0x0'));module[_0xb7dc('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb7dc('0x2'),_0xb7dc('0x3'),_0xb7dc('0x4'),'keyValue',_0xb7dc('0x5')),'defaultValue':_0xb7dc('0x2')},'content':{'type':Sequelize[_0xb7dc('0x6')]},'key':{'type':Sequelize[_0xb7dc('0x6')]},'keyType':{'type':Sequelize[_0xb7dc('0x7')](_0xb7dc('0x2'),_0xb7dc('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb7dc('0x6')]},'customField':{'type':Sequelize[_0xb7dc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb7dc('0x6')]}};
\ No newline at end of file
+var _0x31ca=['picklist','STRING','BOOLEAN','sequelize','string','variable','customVariable','keyValue'];(function(_0x3140ed,_0x16829d){var _0x1301ed=function(_0x704c1){while(--_0x704c1){_0x3140ed['push'](_0x3140ed['shift']());}};_0x1301ed(++_0x16829d);}(_0x31ca,0xbb));var _0xa31c=function(_0x10e36e,_0x398d5d){_0x10e36e=_0x10e36e-0x0;var _0x2a7104=_0x31ca[_0x10e36e];return _0x2a7104;};'use strict';var Sequelize=require(_0xa31c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xa31c('0x1'),_0xa31c('0x2'),_0xa31c('0x3'),_0xa31c('0x4'),_0xa31c('0x5')),'defaultValue':_0xa31c('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xa31c('0x2'),_0xa31c('0x3'))},'keyContent':{'type':Sequelize[_0xa31c('0x6')]},'idField':{'type':Sequelize[_0xa31c('0x6')]},'nameField':{'type':Sequelize[_0xa31c('0x6')]},'customField':{'type':Sequelize[_0xa31c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 652c96f..6dcec02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['ZohoField','includeAll','findAll','catch','params','length','include','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options'];(function(_0x3bd2fd,_0xbb9c3f){var _0x583e79=function(_0x282d0f){while(--_0x282d0f){_0x3bd2fd['push'](_0x3bd2fd['shift']());}};_0x583e79(++_0xbb9c3f);}(_0xfff0,0x139));var _0x0fff=function(_0x5ec87a,_0x319ae0){_0x5ec87a=_0x5ec87a-0x0;var _0x3f05aa=_0xfff0[_0x5ec87a];return _0x3f05aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];function respondWithStatusCode(_0x13f768,_0x5abecd){_0x5abecd=_0x5abecd||0xcc;return function(_0x1fb243){if(_0x1fb243){return _0x13f768['sendStatus'](_0x5abecd);}return _0x13f768[_0x0fff('0x19')](_0x5abecd)[_0x0fff('0x1a')]();};}function respondWithResult(_0x38fc82,_0x2c0322){_0x2c0322=_0x2c0322||0xc8;return function(_0x55e5fa){if(_0x55e5fa){return _0x38fc82['status'](_0x2c0322)[_0x0fff('0x1b')](_0x55e5fa);}};}function respondWithFilteredResult(_0x50a9e4,_0x5636fd){return function(_0x51ceea){if(_0x51ceea){var _0x1fb430=typeof _0x5636fd[_0x0fff('0x1c')]==='undefined'&&typeof _0x5636fd[_0x0fff('0x1d')]===_0x0fff('0x1e');var _0x540a67=_0x51ceea['count'];var _0x48f36d=_0x1fb430?0x0:_0x5636fd[_0x0fff('0x1c')];var _0x606792=_0x1fb430?_0x51ceea[_0x0fff('0x1f')]:_0x5636fd[_0x0fff('0x1c')]+_0x5636fd[_0x0fff('0x1d')];var _0xe89b4a;if(_0x606792>=_0x540a67){_0x606792=_0x540a67;_0xe89b4a=0xc8;}else{_0xe89b4a=0xce;}_0x50a9e4['status'](_0xe89b4a);return _0x50a9e4[_0x0fff('0x20')](_0x0fff('0x21'),_0x48f36d+'-'+_0x606792+'/'+_0x540a67)[_0x0fff('0x1b')](_0x51ceea);}return null;};}function patchUpdates(_0x49d211){return function(_0x5e27df){try{jsonpatch[_0x0fff('0x22')](_0x5e27df,_0x49d211,!![]);}catch(_0x330e29){return BPromise[_0x0fff('0x23')](_0x330e29);}return _0x5e27df[_0x0fff('0x24')]();};}function saveUpdates(_0x502393,_0x155132){return function(_0x2f8665){if(_0x2f8665){return _0x2f8665[_0x0fff('0x25')](_0x502393)[_0x0fff('0x26')](function(_0x16e7f4){return _0x16e7f4;});}return null;};}function removeEntity(_0x17fba6,_0x580b8e){return function(_0x6a116c){if(_0x6a116c){return _0x6a116c[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){_0x17fba6[_0x0fff('0x19')](0xcc)[_0x0fff('0x1a')]();});}};}function handleEntityNotFound(_0x23d9f8,_0x482e1e){return function(_0x2c9725){if(!_0x2c9725){_0x23d9f8[_0x0fff('0x28')](0x194);}return _0x2c9725;};}function handleError(_0x2d1610,_0x440f56){_0x440f56=_0x440f56||0x1f4;return function(_0x36d268){logger[_0x0fff('0x29')](_0x36d268[_0x0fff('0x2a')]);if(_0x36d268[_0x0fff('0x2b')]){delete _0x36d268[_0x0fff('0x2b')];}_0x2d1610[_0x0fff('0x19')](_0x440f56)[_0x0fff('0x2c')](_0x36d268);};}exports[_0x0fff('0x2d')]=function(_0x495734,_0x7046a3){var _0x2d1800={},_0x17ab6f={},_0x42441e={'count':0x0,'rows':[]};var _0x1f643d=_[_0x0fff('0x2e')](db['ZohoField'][_0x0fff('0x2f')],function(_0xa16c29){return{'name':_0xa16c29[_0x0fff('0x30')],'type':_0xa16c29['type'][_0x0fff('0x31')]};});_0x17ab6f[_0x0fff('0x32')]=_['map'](_0x1f643d,_0x0fff('0x2b'));_0x17ab6f[_0x0fff('0x33')]=_[_0x0fff('0x34')](_0x495734[_0x0fff('0x33')]);_0x17ab6f[_0x0fff('0x35')]=_[_0x0fff('0x36')](_0x17ab6f[_0x0fff('0x32')],_0x17ab6f[_0x0fff('0x33')]);_0x2d1800[_0x0fff('0x37')]=_[_0x0fff('0x36')](_0x17ab6f['model'],qs[_0x0fff('0x38')](_0x495734[_0x0fff('0x33')][_0x0fff('0x38')]));_0x2d1800[_0x0fff('0x37')]=_0x2d1800[_0x0fff('0x37')]['length']?_0x2d1800['attributes']:_0x17ab6f[_0x0fff('0x32')];if(!_0x495734[_0x0fff('0x33')][_0x0fff('0x39')](_0x0fff('0x3a'))){_0x2d1800['limit']=qs[_0x0fff('0x1d')](_0x495734[_0x0fff('0x33')][_0x0fff('0x1d')]);_0x2d1800[_0x0fff('0x1c')]=qs['offset'](_0x495734[_0x0fff('0x33')][_0x0fff('0x1c')]);}_0x2d1800[_0x0fff('0x3b')]=qs[_0x0fff('0x3c')](_0x495734[_0x0fff('0x33')][_0x0fff('0x3c')]);_0x2d1800[_0x0fff('0x3d')]=qs[_0x0fff('0x35')](_[_0x0fff('0x3e')](_0x495734[_0x0fff('0x33')],_0x17ab6f[_0x0fff('0x35')]),_0x1f643d);if(_0x495734[_0x0fff('0x33')]['filter']){_0x2d1800[_0x0fff('0x3d')]=_[_0x0fff('0x3f')](_0x2d1800[_0x0fff('0x3d')],{'$or':_[_0x0fff('0x2e')](_0x1f643d,function(_0xd65638){if(_0xd65638[_0x0fff('0x40')]!=='VIRTUAL'){var _0x10ff9d={};_0x10ff9d[_0xd65638[_0x0fff('0x2b')]]={'$like':'%'+_0x495734[_0x0fff('0x33')][_0x0fff('0x41')]+'%'};return _0x10ff9d;}})});}_0x2d1800=_[_0x0fff('0x3f')]({},_0x2d1800,_0x495734[_0x0fff('0x42')]);var _0x3dc0b8={'where':_0x2d1800[_0x0fff('0x3d')]};return db[_0x0fff('0x43')]['count'](_0x3dc0b8)[_0x0fff('0x26')](function(_0x4d89c0){_0x42441e[_0x0fff('0x1f')]=_0x4d89c0;if(_0x495734[_0x0fff('0x33')][_0x0fff('0x44')]){_0x2d1800['include']=[{'all':!![]}];}return db['ZohoField'][_0x0fff('0x45')](_0x2d1800);})[_0x0fff('0x26')](function(_0x311348){_0x42441e['rows']=_0x311348;return _0x42441e;})['then'](respondWithFilteredResult(_0x7046a3,_0x2d1800))[_0x0fff('0x46')](handleError(_0x7046a3,null));};exports['show']=function(_0xd6ebeb,_0x957265){var _0x8352c1={'raw':!![],'where':{'id':_0xd6ebeb[_0x0fff('0x47')]['id']}},_0x309d75={};_0x309d75[_0x0fff('0x32')]=_['keys'](db[_0x0fff('0x43')][_0x0fff('0x2f')]);_0x309d75[_0x0fff('0x33')]=_[_0x0fff('0x34')](_0xd6ebeb[_0x0fff('0x33')]);_0x309d75[_0x0fff('0x35')]=_[_0x0fff('0x36')](_0x309d75['model'],_0x309d75[_0x0fff('0x33')]);_0x8352c1[_0x0fff('0x37')]=_[_0x0fff('0x36')](_0x309d75['model'],qs[_0x0fff('0x38')](_0xd6ebeb[_0x0fff('0x33')][_0x0fff('0x38')]));_0x8352c1[_0x0fff('0x37')]=_0x8352c1[_0x0fff('0x37')][_0x0fff('0x48')]?_0x8352c1[_0x0fff('0x37')]:_0x309d75[_0x0fff('0x32')];if(_0xd6ebeb[_0x0fff('0x33')][_0x0fff('0x44')]){_0x8352c1[_0x0fff('0x49')]=[{'all':!![]}];}_0x8352c1=_['merge']({},_0x8352c1,_0xd6ebeb[_0x0fff('0x42')]);return db[_0x0fff('0x43')]['find'](_0x8352c1)[_0x0fff('0x26')](handleEntityNotFound(_0x957265,null))[_0x0fff('0x26')](respondWithResult(_0x957265,null))[_0x0fff('0x46')](handleError(_0x957265,null));};exports['create']=function(_0x502037,_0x2a0b10){return db['ZohoField']['create'](_0x502037[_0x0fff('0x4a')],{})[_0x0fff('0x26')](respondWithResult(_0x2a0b10,0xc9))[_0x0fff('0x46')](handleError(_0x2a0b10,null));};exports[_0x0fff('0x25')]=function(_0x3b4b8e,_0x1a7677){if(_0x3b4b8e['body']['id']){delete _0x3b4b8e[_0x0fff('0x4a')]['id'];}return db[_0x0fff('0x43')][_0x0fff('0x4b')]({'where':{'id':_0x3b4b8e[_0x0fff('0x47')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x1a7677,null))[_0x0fff('0x26')](saveUpdates(_0x3b4b8e['body'],null))[_0x0fff('0x26')](respondWithResult(_0x1a7677,null))[_0x0fff('0x46')](handleError(_0x1a7677,null));};exports['destroy']=function(_0x1fc872,_0x4bae35){return db['ZohoField']['find']({'where':{'id':_0x1fc872[_0x0fff('0x47')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x4bae35,null))[_0x0fff('0x26')](removeEntity(_0x4bae35,null))[_0x0fff('0x46')](handleError(_0x4bae35,null));};
\ No newline at end of file
+var _0xf347=['model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','reject','save','then','error','name','index','map','ZohoField','fieldName','type'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0xf347,0xef));var _0x7f34=function(_0x2292d0,_0x19f10f){_0x2292d0=_0x2292d0-0x0;var _0x20160d=_0xf347[_0x2292d0];return _0x20160d;};'use strict';var emlformat=require(_0x7f34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f34('0x1'));var jsonpatch=require(_0x7f34('0x2'));var rp=require('request-promise');var moment=require(_0x7f34('0x3'));var BPromise=require(_0x7f34('0x4'));var Mustache=require(_0x7f34('0x5'));var util=require(_0x7f34('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7f34('0x7'));var ejs=require(_0x7f34('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f34('0x9'));var squel=require(_0x7f34('0xa'));var crypto=require(_0x7f34('0xb'));var jsforce=require(_0x7f34('0xc'));var deskjs=require(_0x7f34('0xd'));var toCsv=require(_0x7f34('0x7'));var querystring=require('querystring');var Papa=require(_0x7f34('0xe'));var Redis=require(_0x7f34('0xf'));var authService=require(_0x7f34('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f34('0x11'));var logger=require('../../config/logger')(_0x7f34('0x12'));var utils=require(_0x7f34('0x13'));var config=require(_0x7f34('0x14'));var licenseUtil=require(_0x7f34('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2684e3,_0x1c4ecf){_0x1c4ecf=_0x1c4ecf||0xcc;return function(_0x1d9674){if(_0x1d9674){return _0x2684e3[_0x7f34('0x16')](_0x1c4ecf);}return _0x2684e3[_0x7f34('0x17')](_0x1c4ecf)[_0x7f34('0x18')]();};}function respondWithResult(_0x1b2a63,_0x2510fb){_0x2510fb=_0x2510fb||0xc8;return function(_0x375f73){if(_0x375f73){return _0x1b2a63[_0x7f34('0x17')](_0x2510fb)['json'](_0x375f73);}};}function respondWithFilteredResult(_0x3bb529,_0x3d0e32){return function(_0x5deb70){if(_0x5deb70){var _0x2b1031=typeof _0x3d0e32[_0x7f34('0x19')]==='undefined'&&typeof _0x3d0e32[_0x7f34('0x1a')]===_0x7f34('0x1b');var _0x2aa52f=_0x5deb70[_0x7f34('0x1c')];var _0x2fc328=_0x2b1031?0x0:_0x3d0e32[_0x7f34('0x19')];var _0x4928f4=_0x2b1031?_0x5deb70[_0x7f34('0x1c')]:_0x3d0e32[_0x7f34('0x19')]+_0x3d0e32[_0x7f34('0x1a')];var _0x27654e;if(_0x4928f4>=_0x2aa52f){_0x4928f4=_0x2aa52f;_0x27654e=0xc8;}else{_0x27654e=0xce;}_0x3bb529[_0x7f34('0x17')](_0x27654e);return _0x3bb529['set'](_0x7f34('0x1d'),_0x2fc328+'-'+_0x4928f4+'/'+_0x2aa52f)['json'](_0x5deb70);}return null;};}function patchUpdates(_0x13faa7){return function(_0xe0da78){try{jsonpatch[_0x7f34('0x1e')](_0xe0da78,_0x13faa7,!![]);}catch(_0x1e577e){return BPromise[_0x7f34('0x1f')](_0x1e577e);}return _0xe0da78[_0x7f34('0x20')]();};}function saveUpdates(_0x323634,_0x38736a){return function(_0x5cdba8){if(_0x5cdba8){return _0x5cdba8['update'](_0x323634)[_0x7f34('0x21')](function(_0x427b56){return _0x427b56;});}return null;};}function removeEntity(_0x4fb1e4,_0x124450){return function(_0x51e60d){if(_0x51e60d){return _0x51e60d['destroy']()[_0x7f34('0x21')](function(){_0x4fb1e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ed430,_0x1eb49a){return function(_0x3fbf49){if(!_0x3fbf49){_0x5ed430['sendStatus'](0x194);}return _0x3fbf49;};}function handleError(_0x405dd4,_0x5385db){_0x5385db=_0x5385db||0x1f4;return function(_0x54911c){logger[_0x7f34('0x22')](_0x54911c['stack']);if(_0x54911c[_0x7f34('0x23')]){delete _0x54911c[_0x7f34('0x23')];}_0x405dd4['status'](_0x5385db)['send'](_0x54911c);};}exports[_0x7f34('0x24')]=function(_0x2f1179,_0xff525a){var _0x28040a={},_0x212b07={},_0x4c8126={'count':0x0,'rows':[]};var _0x54b627=_[_0x7f34('0x25')](db[_0x7f34('0x26')]['rawAttributes'],function(_0x16ff62){return{'name':_0x16ff62[_0x7f34('0x27')],'type':_0x16ff62[_0x7f34('0x28')]['key']};});_0x212b07[_0x7f34('0x29')]=_[_0x7f34('0x25')](_0x54b627,'name');_0x212b07[_0x7f34('0x2a')]=_[_0x7f34('0x2b')](_0x2f1179[_0x7f34('0x2a')]);_0x212b07['filters']=_['intersection'](_0x212b07[_0x7f34('0x29')],_0x212b07[_0x7f34('0x2a')]);_0x28040a[_0x7f34('0x2c')]=_[_0x7f34('0x2d')](_0x212b07['model'],qs['fields'](_0x2f1179[_0x7f34('0x2a')][_0x7f34('0x2e')]));_0x28040a[_0x7f34('0x2c')]=_0x28040a[_0x7f34('0x2c')]['length']?_0x28040a[_0x7f34('0x2c')]:_0x212b07[_0x7f34('0x29')];if(!_0x2f1179[_0x7f34('0x2a')]['hasOwnProperty'](_0x7f34('0x2f'))){_0x28040a[_0x7f34('0x1a')]=qs[_0x7f34('0x1a')](_0x2f1179[_0x7f34('0x2a')]['limit']);_0x28040a[_0x7f34('0x19')]=qs['offset'](_0x2f1179[_0x7f34('0x2a')][_0x7f34('0x19')]);}_0x28040a[_0x7f34('0x30')]=qs['sort'](_0x2f1179[_0x7f34('0x2a')][_0x7f34('0x31')]);_0x28040a[_0x7f34('0x32')]=qs[_0x7f34('0x33')](_[_0x7f34('0x34')](_0x2f1179['query'],_0x212b07[_0x7f34('0x33')]),_0x54b627);if(_0x2f1179[_0x7f34('0x2a')][_0x7f34('0x35')]){_0x28040a[_0x7f34('0x32')]=_['merge'](_0x28040a['where'],{'$or':_[_0x7f34('0x25')](_0x54b627,function(_0x4169e8){if(_0x4169e8[_0x7f34('0x28')]!==_0x7f34('0x36')){var _0xc6fa10={};_0xc6fa10[_0x4169e8['name']]={'$like':'%'+_0x2f1179[_0x7f34('0x2a')][_0x7f34('0x35')]+'%'};return _0xc6fa10;}})});}_0x28040a=_[_0x7f34('0x37')]({},_0x28040a,_0x2f1179[_0x7f34('0x38')]);var _0x31c5bf={'where':_0x28040a['where']};return db[_0x7f34('0x26')][_0x7f34('0x1c')](_0x31c5bf)[_0x7f34('0x21')](function(_0x41c830){_0x4c8126[_0x7f34('0x1c')]=_0x41c830;if(_0x2f1179[_0x7f34('0x2a')][_0x7f34('0x39')]){_0x28040a['include']=[{'all':!![]}];}return db[_0x7f34('0x26')][_0x7f34('0x3a')](_0x28040a);})[_0x7f34('0x21')](function(_0x3b3a26){_0x4c8126[_0x7f34('0x3b')]=_0x3b3a26;return _0x4c8126;})[_0x7f34('0x21')](respondWithFilteredResult(_0xff525a,_0x28040a))[_0x7f34('0x3c')](handleError(_0xff525a,null));};exports[_0x7f34('0x3d')]=function(_0x4950a1,_0x116dac){var _0x1c1e42={'raw':!![],'where':{'id':_0x4950a1[_0x7f34('0x3e')]['id']}},_0x4b870d={};_0x4b870d['model']=_['keys'](db[_0x7f34('0x26')][_0x7f34('0x3f')]);_0x4b870d[_0x7f34('0x2a')]=_[_0x7f34('0x2b')](_0x4950a1[_0x7f34('0x2a')]);_0x4b870d[_0x7f34('0x33')]=_['intersection'](_0x4b870d['model'],_0x4b870d[_0x7f34('0x2a')]);_0x1c1e42[_0x7f34('0x2c')]=_[_0x7f34('0x2d')](_0x4b870d[_0x7f34('0x29')],qs[_0x7f34('0x2e')](_0x4950a1[_0x7f34('0x2a')][_0x7f34('0x2e')]));_0x1c1e42[_0x7f34('0x2c')]=_0x1c1e42[_0x7f34('0x2c')][_0x7f34('0x40')]?_0x1c1e42['attributes']:_0x4b870d[_0x7f34('0x29')];if(_0x4950a1[_0x7f34('0x2a')][_0x7f34('0x39')]){_0x1c1e42[_0x7f34('0x41')]=[{'all':!![]}];}_0x1c1e42=_['merge']({},_0x1c1e42,_0x4950a1[_0x7f34('0x38')]);return db['ZohoField'][_0x7f34('0x42')](_0x1c1e42)['then'](handleEntityNotFound(_0x116dac,null))[_0x7f34('0x21')](respondWithResult(_0x116dac,null))[_0x7f34('0x3c')](handleError(_0x116dac,null));};exports[_0x7f34('0x43')]=function(_0x58737c,_0x55c199){return db['ZohoField'][_0x7f34('0x43')](_0x58737c[_0x7f34('0x44')],{})['then'](respondWithResult(_0x55c199,0xc9))[_0x7f34('0x3c')](handleError(_0x55c199,null));};exports['update']=function(_0x2da853,_0x57c6e8){if(_0x2da853[_0x7f34('0x44')]['id']){delete _0x2da853[_0x7f34('0x44')]['id'];}return db[_0x7f34('0x26')]['find']({'where':{'id':_0x2da853[_0x7f34('0x3e')]['id']}})[_0x7f34('0x21')](handleEntityNotFound(_0x57c6e8,null))['then'](saveUpdates(_0x2da853[_0x7f34('0x44')],null))[_0x7f34('0x21')](respondWithResult(_0x57c6e8,null))['catch'](handleError(_0x57c6e8,null));};exports[_0x7f34('0x45')]=function(_0x26d8c2,_0x1d44c8){return db[_0x7f34('0x26')][_0x7f34('0x42')]({'where':{'id':_0x26d8c2[_0x7f34('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1d44c8,null))[_0x7f34('0x21')](removeEntity(_0x1d44c8,null))['catch'](handleError(_0x1d44c8,null));};
\ No newline at end of file
index df8f692..3a32c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['bluebird','request-promise','path','rimraf','exports','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x18dc34,_0x205f71){var _0x4ab15b=function(_0x50572f){while(--_0x50572f){_0x18dc34['push'](_0x18dc34['shift']());}};_0x4ab15b(++_0x205f71);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4b8d84,_0x585586){_0x4b8d84=_0x4b8d84-0x0;var _0x4a027b=_0xc2c7[_0x4b8d84];return _0x4a027b;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var logger=require(_0x7c2c('0x1'))(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var rp=require(_0x7c2c('0x5'));var fs=require('fs');var path=require(_0x7c2c('0x6'));var rimraf=require(_0x7c2c('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x7c2c('0x8')]=function(_0x42ecc9,_0x23c038){return _0x42ecc9['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x7c2c('0x9'),'fields':[_0x7c2c('0xa'),_0x7c2c('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xafb9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','int_zoho_fields','zoho_unique_index','idField'];(function(_0x57c80f,_0x3ff22f){var _0x1f508e=function(_0x254e91){while(--_0x254e91){_0x57c80f['push'](_0x57c80f['shift']());}};_0x1f508e(++_0x3ff22f);}(_0xafb9,0x68));var _0x9afb=function(_0x14b9b8,_0x2d3c89){_0x14b9b8=_0x14b9b8-0x0;var _0x5206d1=_0xafb9[_0x14b9b8];return _0x5206d1;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('ZohoField',attributes,{'tableName':_0x9afb('0xa'),'paranoid':![],'indexes':[{'name':_0x9afb('0xb'),'fields':[_0x9afb('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7f02fb9..a4ea0b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda6c=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x8075f2,_0x118505){var _0x5c4aa5=function(_0x53b882){while(--_0x53b882){_0x8075f2['push'](_0x8075f2['shift']());}};_0x5c4aa5(++_0x118505);}(_0xda6c,0x68));var _0xcda6=function(_0x2dfb49,_0x171828){_0x2dfb49=_0x2dfb49-0x0;var _0x4d5d92=_0xda6c[_0x2dfb49];return _0x4d5d92;};'use strict';var _=require(_0xcda6('0x0'));var util=require(_0xcda6('0x1'));var moment=require(_0xcda6('0x2'));var BPromise=require(_0xcda6('0x3'));var rs=require(_0xcda6('0x4'));var fs=require('fs');var Redis=require(_0xcda6('0x5'));var db=require(_0xcda6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcda6('0x7'))(_0xcda6('0x8'));var config=require(_0xcda6('0x9'));var jayson=require(_0xcda6('0xa'));var client=jayson[_0xcda6('0xb')][_0xcda6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c21c3,_0x15842d,_0x143df0){return new BPromise(function(_0x5a09ba,_0x255ea8){return client[_0xcda6('0xd')](_0x3c21c3,_0x143df0)[_0xcda6('0xe')](function(_0x27cfe7){logger['info'](_0xcda6('0xf'),_0x15842d,_0xcda6('0x10'));logger['debug'](_0xcda6('0x11'),_0x15842d,'request\x20sent',JSON[_0xcda6('0x12')](_0x27cfe7));if(_0x27cfe7['error']){if(_0x27cfe7['error'][_0xcda6('0x13')]===0x1f4){logger[_0xcda6('0x14')]('ZohoField,\x20%s,\x20%s',_0x15842d,_0x27cfe7[_0xcda6('0x14')][_0xcda6('0x15')]);return _0x255ea8(_0x27cfe7['error'][_0xcda6('0x15')]);}logger['error'](_0xcda6('0xf'),_0x15842d,_0x27cfe7[_0xcda6('0x14')][_0xcda6('0x15')]);return _0x5a09ba(_0x27cfe7[_0xcda6('0x14')][_0xcda6('0x15')]);}else{logger[_0xcda6('0x16')](_0xcda6('0xf'),_0x15842d,_0xcda6('0x10'));_0x5a09ba(_0x27cfe7[_0xcda6('0x17')][_0xcda6('0x15')]);}})[_0xcda6('0x18')](function(_0x4985f4){logger[_0xcda6('0x14')](_0xcda6('0xf'),_0x15842d,_0x4985f4);_0x255ea8(_0x4985f4);});});}
\ No newline at end of file
+var _0xbf98=['then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','request'];(function(_0x226c6c,_0x5ec5c3){var _0x355671=function(_0x44d83d){while(--_0x44d83d){_0x226c6c['push'](_0x226c6c['shift']());}};_0x355671(++_0x5ec5c3);}(_0xbf98,0xe8));var _0x8bf9=function(_0x2e9155,_0x32eb3f){_0x2e9155=_0x2e9155-0x0;var _0x45092a=_0xbf98[_0x2e9155];return _0x45092a;};'use strict';var _=require(_0x8bf9('0x0'));var util=require('util');var moment=require(_0x8bf9('0x1'));var BPromise=require('bluebird');var rs=require(_0x8bf9('0x2'));var fs=require('fs');var Redis=require(_0x8bf9('0x3'));var db=require(_0x8bf9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bf9('0x5'))(_0x8bf9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x273938,_0x29cbb4,_0x350203){return new BPromise(function(_0x1916c2,_0x391fb0){return client[_0x8bf9('0x7')](_0x273938,_0x350203)[_0x8bf9('0x8')](function(_0x2f3723){logger[_0x8bf9('0x9')](_0x8bf9('0xa'),_0x29cbb4,_0x8bf9('0xb'));logger[_0x8bf9('0xc')](_0x8bf9('0xd'),_0x29cbb4,_0x8bf9('0xb'),JSON[_0x8bf9('0xe')](_0x2f3723));if(_0x2f3723['error']){if(_0x2f3723[_0x8bf9('0xf')][_0x8bf9('0x10')]===0x1f4){logger['error'](_0x8bf9('0xa'),_0x29cbb4,_0x2f3723[_0x8bf9('0xf')][_0x8bf9('0x11')]);return _0x391fb0(_0x2f3723[_0x8bf9('0xf')]['message']);}logger[_0x8bf9('0xf')](_0x8bf9('0xa'),_0x29cbb4,_0x2f3723[_0x8bf9('0xf')][_0x8bf9('0x11')]);return _0x1916c2(_0x2f3723[_0x8bf9('0xf')]['message']);}else{logger[_0x8bf9('0x9')]('ZohoField,\x20%s,\x20%s',_0x29cbb4,_0x8bf9('0xb'));_0x1916c2(_0x2f3723[_0x8bf9('0x12')]['message']);}})[_0x8bf9('0x13')](function(_0x3275c9){logger[_0x8bf9('0xf')](_0x8bf9('0xa'),_0x29cbb4,_0x3275c9);_0x391fb0(_0x3275c9);});});}
\ No newline at end of file
index 346a4ca..9c99981 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(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x19af2b,_0x274ecc){var _0x1d7b79=function(_0x37e6ab){while(--_0x37e6ab){_0x19af2b['push'](_0x19af2b['shift']());}};_0x1d7b79(++_0x274ecc);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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 300bb91..7f6c95b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6489=['unique_name_and_version','app.js','BOOLEAN','state','sequelize','STRING'];(function(_0x1c5d82,_0x1812b9){var _0x5c99ae=function(_0x41b727){while(--_0x41b727){_0x1c5d82['push'](_0x1c5d82['shift']());}};_0x5c99ae(++_0x1812b9);}(_0x6489,0x124));var _0x9648=function(_0xe3b14a,_0x78ed90){_0xe3b14a=_0xe3b14a-0x0;var _0x53a646=_0x6489[_0xe3b14a];return _0x53a646;};'use strict';var Sequelize=require(_0x9648('0x0'));module['exports']={'name':{'type':Sequelize[_0x9648('0x1')],'allowNull':![],'unique':_0x9648('0x2')},'version':{'type':Sequelize[_0x9648('0x1')],'allowNull':![],'unique':_0x9648('0x2')},'main':{'type':Sequelize[_0x9648('0x1')],'defaultValue':_0x9648('0x3')},'filename':{'type':Sequelize[_0x9648('0x1')]},'path':{'type':Sequelize[_0x9648('0x1')]},'type':{'type':Sequelize[_0x9648('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x9648('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x9648('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x9648('0x1')],'unique':_0x9648('0x5')},'description':{'type':Sequelize[_0x9648('0x1')]},'title':{'type':Sequelize[_0x9648('0x1')]},'remoteUri':{'type':Sequelize[_0x9648('0x1')]},'link':{'type':Sequelize[_0x9648('0x1')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xbea3=['STRING','unique_name_and_version','app.js','BOOLEAN','state','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbea3,0x137));var _0x3bea=function(_0xa24002,_0xd0e8e1){_0xa24002=_0xa24002-0x0;var _0x16cbf6=_0xbea3[_0xa24002];return _0x16cbf6;};'use strict';var Sequelize=require('sequelize');module[_0x3bea('0x0')]={'name':{'type':Sequelize[_0x3bea('0x1')],'allowNull':![],'unique':_0x3bea('0x2')},'version':{'type':Sequelize[_0x3bea('0x1')],'allowNull':![],'unique':_0x3bea('0x2')},'main':{'type':Sequelize[_0x3bea('0x1')],'defaultValue':_0x3bea('0x3')},'filename':{'type':Sequelize[_0x3bea('0x1')]},'path':{'type':Sequelize[_0x3bea('0x1')]},'type':{'type':Sequelize[_0x3bea('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3bea('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x3bea('0x1')]},'state':{'type':Sequelize[_0x3bea('0x1')],'unique':_0x3bea('0x5')},'description':{'type':Sequelize[_0x3bea('0x1')]},'title':{'type':Sequelize[_0x3bea('0x1')]},'remoteUri':{'type':Sequelize[_0x3bea('0x1')]},'link':{'type':Sequelize[_0x3bea('0x1')],'defaultValue':'#'}};
\ No newline at end of file
index 649e0a2..3d5aba6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdbd=['findAll','rows','show','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x7addab,_0x4af866){var _0x14b552=function(_0x1160fc){while(--_0x1160fc){_0x7addab['push'](_0x7addab['shift']());}};_0x14b552(++_0x4af866);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1d3019,_0x8dbbd5){_0x1d3019=_0x1d3019-0x0;var _0x36458e=_0xfdbd[_0x1d3019];return _0x36458e;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['Integration'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['Integration']['create'](_0x1c08fb[_0xdfdb('0x4b')],{})[_0xdfdb('0x26')](respondWithResult(_0x273477,0xc9))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports['update']=function(_0x36149e,_0x4d4c90){if(_0x36149e[_0xdfdb('0x4b')]['id']){delete _0x36149e[_0xdfdb('0x4b')]['id'];}return db['Integration'][_0xdfdb('0x48')]({'where':{'id':_0x36149e[_0xdfdb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d4c90,null))[_0xdfdb('0x26')](saveUpdates(_0x36149e[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x4d4c90,null))[_0xdfdb('0x49')](handleError(_0x4d4c90,null));};exports[_0xdfdb('0x25')]=function(_0x10b490,_0x17dfdb){return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'id':_0x10b490['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x17dfdb,null))['then'](removeEntity(_0x17dfdb,null))[_0xdfdb('0x49')](handleError(_0x17dfdb,null));};
\ No newline at end of file
+var _0x1623=['model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','Integration','findAll','rows','catch','show','params','length','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x1623,0xab));var _0x3162=function(_0x38d985,_0x3e1455){_0x38d985=_0x38d985-0x0;var _0x41d6f6=_0x1623[_0x38d985];return _0x41d6f6;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['Integration'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));};
\ No newline at end of file
index c47f596..176afc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c3=['path','rimraf','../../config/environment','./integration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x398bd6,_0x42b9eb){var _0x3a1ed6=function(_0x248542){while(--_0x248542){_0x398bd6['push'](_0x398bd6['shift']());}};_0x3a1ed6(++_0x42b9eb);}(_0x81c3,0xea));var _0x381c=function(_0x2c7eee,_0x2545b5){_0x2c7eee=_0x2c7eee-0x0;var _0x539dbb=_0x81c3[_0x2c7eee];return _0x539dbb;};'use strict';var _=require(_0x381c('0x0'));var util=require('util');var logger=require(_0x381c('0x1'))(_0x381c('0x2'));var moment=require(_0x381c('0x3'));var BPromise=require(_0x381c('0x4'));var rp=require(_0x381c('0x5'));var fs=require('fs');var path=require(_0x381c('0x6'));var rimraf=require(_0x381c('0x7'));var config=require(_0x381c('0x8'));var attributes=require(_0x381c('0x9'));module[_0x381c('0xa')]=function(_0x382a3d,_0x197f1f){return _0x382a3d[_0x381c('0xb')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3a8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0xc3a8,0x109));var _0x8c3a=function(_0x18be96,_0x15e628){_0x18be96=_0x18be96-0x0;var _0x4b9baa=_0xc3a8[_0x18be96];return _0x4b9baa;};'use strict';var _=require(_0x8c3a('0x0'));var util=require(_0x8c3a('0x1'));var logger=require(_0x8c3a('0x2'))(_0x8c3a('0x3'));var moment=require(_0x8c3a('0x4'));var BPromise=require(_0x8c3a('0x5'));var rp=require(_0x8c3a('0x6'));var fs=require('fs');var path=require(_0x8c3a('0x7'));var rimraf=require(_0x8c3a('0x8'));var config=require(_0x8c3a('0x9'));var attributes=require(_0x8c3a('0xa'));module[_0x8c3a('0xb')]=function(_0x29f1e3,_0x5f53ce){return _0x29f1e3['define'](_0x8c3a('0xc'),attributes,{'tableName':_0x8c3a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f92bb23..1a55e88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1e3179,_0x2f17dc){var _0x30616b=function(_0x4087ab){while(--_0x4087ab){_0x1e3179['push'](_0x1e3179['shift']());}};_0x30616b(++_0x2f17dc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28d8d7,_0x375c0f){_0x28d8d7=_0x28d8d7-0x0;var _0x2eb53e=_0x5f2f[_0x28d8d7];return _0x2eb53e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0xda2d,0x102));var _0xdda2=function(_0x3584b5,_0x18f48a){_0x3584b5=_0x3584b5-0x0;var _0x5d8d87=_0xda2d[_0x3584b5];return _0x5d8d87;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}
\ No newline at end of file
index 921b468..29cc535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xdb28,0x106));var _0x8db2=function(_0xaf80cf,_0x4c1383){_0xaf80cf=_0xaf80cf-0x0;var _0x26c81c=_0xdb28[_0xaf80cf];return _0x26c81c;};'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('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router;
\ No newline at end of file
+var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'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('./integrationReport.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['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router;
\ No newline at end of file
index d7963d4..4d050d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x359a=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x451a8d,_0x576f7d){var _0x3ec026=function(_0xe860c5){while(--_0xe860c5){_0x451a8d['push'](_0x451a8d['shift']());}};_0x3ec026(++_0x576f7d);}(_0x359a,0x1a8));var _0xa359=function(_0x335bb,_0x351882){_0x335bb=_0x335bb-0x0;var _0x15a501=_0x359a[_0x335bb];return _0x15a501;};'use strict';var Sequelize=require('sequelize');module[_0xa359('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xa359('0x1')]},'integrationId':{'type':Sequelize[_0xa359('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa359('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa359('0x1')]},'interface':{'type':Sequelize[_0xa359('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xa359('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xa359('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa359('0x3')]},'talktime':{'type':Sequelize[_0xa359('0x2')]},'agentacw':{'type':Sequelize[_0xa359('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xa359('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xa359('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xa359('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xa359('0x1')]},'channel':{'type':Sequelize[_0xa359('0x1')]},'channelstate':{'type':Sequelize[_0xa359('0x2')]},'channelstatedesc':{'type':Sequelize[_0xa359('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa359('0x1')]},'connectedlinename':{'type':Sequelize[_0xa359('0x1')]},'language':{'type':Sequelize[_0xa359('0x1')]},'accountcode':{'type':Sequelize[_0xa359('0x1')]},'context':{'type':Sequelize[_0xa359('0x1')]},'exten':{'type':Sequelize[_0xa359('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xa359('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa359('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa359('0x1')]},'destcalleridname':{'type':Sequelize[_0xa359('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xa359('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xa359('0x1')]},'destcontext':{'type':Sequelize[_0xa359('0x1')]},'destexten':{'type':Sequelize[_0xa359('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xa359('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xa359('0x1')]},'subject':{'type':Sequelize[_0xa359('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xa359('0x1')]},'cc':{'type':Sequelize[_0xa359('0x1')]},'attachment':{'type':Sequelize[_0xa359('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xa359('0x5')]},'status':{'type':Sequelize[_0xa359('0x6')](_0xa359('0x7'),_0xa359('0x8'),_0xa359('0x9'),_0xa359('0xa'))},'url':{'type':Sequelize[_0xa359('0x1')]},'app':{'type':Sequelize[_0xa359('0x1')]},'appdata':{'type':Sequelize[_0xa359('0x1')]},'projectId':{'type':Sequelize[_0xa359('0x2')]}};
\ No newline at end of file
+var _0x3df9=['ENUM','SENT','SENDING','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT'];(function(_0xdef69,_0x3a9e7a){var _0xbacc5d=function(_0x115968){while(--_0x115968){_0xdef69['push'](_0xdef69['shift']());}};_0xbacc5d(++_0x3a9e7a);}(_0x3df9,0x67));var _0x93df=function(_0x45138b,_0xec2bd6){_0x45138b=_0x45138b-0x0;var _0x398884=_0x3df9[_0x45138b];return _0x398884;};'use strict';var Sequelize=require(_0x93df('0x0'));module[_0x93df('0x1')]={'integration':{'type':Sequelize[_0x93df('0x2')]},'eventChannel':{'type':Sequelize[_0x93df('0x2')]},'exitStatus':{'type':Sequelize[_0x93df('0x2')]},'ticketId':{'type':Sequelize[_0x93df('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x93df('0x2')]},'uniqueid':{'type':Sequelize[_0x93df('0x2')]},'calleridnum':{'type':Sequelize[_0x93df('0x2')]},'calleridname':{'type':Sequelize[_0x93df('0x2')]},'queue':{'type':Sequelize[_0x93df('0x2')]},'interface':{'type':Sequelize[_0x93df('0x2')]},'membername':{'type':Sequelize[_0x93df('0x2')]},'agentcalledAt':{'type':Sequelize[_0x93df('0x3')]},'agentconnectAt':{'type':Sequelize[_0x93df('0x3')]},'holdtime':{'type':Sequelize[_0x93df('0x4')]},'agentcomplete':{'type':Sequelize[_0x93df('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x93df('0x3')]},'talktime':{'type':Sequelize[_0x93df('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x93df('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x93df('0x3')]},'agentdump':{'type':Sequelize[_0x93df('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x93df('0x3')]},'lastevent':{'type':Sequelize[_0x93df('0x2')]},'channel':{'type':Sequelize[_0x93df('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x93df('0x2')]},'connectedlinename':{'type':Sequelize[_0x93df('0x2')]},'language':{'type':Sequelize[_0x93df('0x2')]},'accountcode':{'type':Sequelize[_0x93df('0x2')]},'context':{'type':Sequelize[_0x93df('0x2')]},'exten':{'type':Sequelize[_0x93df('0x2')]},'priority':{'type':Sequelize[_0x93df('0x2')]},'destchannel':{'type':Sequelize[_0x93df('0x2')]},'destchannelstate':{'type':Sequelize[_0x93df('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x93df('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x93df('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x93df('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x93df('0x2')]},'destlanguage':{'type':Sequelize[_0x93df('0x2')]},'destaccountcode':{'type':Sequelize[_0x93df('0x2')]},'destcontext':{'type':Sequelize[_0x93df('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x93df('0x2')]},'messageId':{'type':Sequelize[_0x93df('0x2')]},'inReplyTo':{'type':Sequelize[_0x93df('0x2')]},'subject':{'type':Sequelize[_0x93df('0x2')]},'from':{'type':Sequelize[_0x93df('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x93df('0x2')]},'attachment':{'type':Sequelize[_0x93df('0x6')]},'html':{'type':Sequelize[_0x93df('0x6')]},'text':{'type':Sequelize[_0x93df('0x6')]},'status':{'type':Sequelize[_0x93df('0x7')](_0x93df('0x8'),_0x93df('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x93df('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x93df('0x2')]},'projectId':{'type':Sequelize[_0x93df('0x4')]}};
\ No newline at end of file
index aa85d2e..ae9263d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b1e=['fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','params','IntegrationReport','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7b1e,0x137));var _0xe7b1=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x7b1e[_0xbeb808];return _0x5d6909;};'use strict';var emlformat=require(_0xe7b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe7b1('0x1'));var jsonpatch=require(_0xe7b1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe7b1('0x3'));var Mustache=require('mustache');var util=require(_0xe7b1('0x4'));var path=require(_0xe7b1('0x5'));var sox=require('sox');var csv=require(_0xe7b1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe7b1('0x7'));var _=require(_0xe7b1('0x8'));var squel=require(_0xe7b1('0x9'));var crypto=require(_0xe7b1('0xa'));var jsforce=require(_0xe7b1('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe7b1('0xc'));var Papa=require(_0xe7b1('0xd'));var Redis=require(_0xe7b1('0xe'));var authService=require(_0xe7b1('0xf'));var qs=require(_0xe7b1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7b1('0x11'));var logger=require('../../config/logger')(_0xe7b1('0x12'));var utils=require(_0xe7b1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe7b1('0x14'))['db'];function respondWithStatusCode(_0x3c7343,_0x5484da){_0x5484da=_0x5484da||0xcc;return function(_0x1fe5da){if(_0x1fe5da){return _0x3c7343[_0xe7b1('0x15')](_0x5484da);}return _0x3c7343[_0xe7b1('0x16')](_0x5484da)[_0xe7b1('0x17')]();};}function respondWithResult(_0x499548,_0x2bb603){_0x2bb603=_0x2bb603||0xc8;return function(_0x57ef31){if(_0x57ef31){return _0x499548[_0xe7b1('0x16')](_0x2bb603)[_0xe7b1('0x18')](_0x57ef31);}};}function respondWithFilteredResult(_0x3fc4ea,_0x12d417){return function(_0x36a753){if(_0x36a753){var _0xe88ab=typeof _0x12d417[_0xe7b1('0x19')]===_0xe7b1('0x1a')&&typeof _0x12d417['limit']===_0xe7b1('0x1a');var _0x5b3405=_0x36a753['count'];var _0x2e4731=_0xe88ab?0x0:_0x12d417['offset'];var _0x5c1319=_0xe88ab?_0x36a753[_0xe7b1('0x1b')]:_0x12d417['offset']+_0x12d417[_0xe7b1('0x1c')];var _0x667dcf;if(_0x5c1319>=_0x5b3405){_0x5c1319=_0x5b3405;_0x667dcf=0xc8;}else{_0x667dcf=0xce;}_0x3fc4ea['status'](_0x667dcf);return _0x3fc4ea['set'](_0xe7b1('0x1d'),_0x2e4731+'-'+_0x5c1319+'/'+_0x5b3405)[_0xe7b1('0x18')](_0x36a753);}return null;};}function patchUpdates(_0x2a2e8f){return function(_0x25ccf0){try{jsonpatch['apply'](_0x25ccf0,_0x2a2e8f,!![]);}catch(_0x48302d){return BPromise[_0xe7b1('0x1e')](_0x48302d);}return _0x25ccf0[_0xe7b1('0x1f')]();};}function saveUpdates(_0x431f01,_0x56bc17){return function(_0x5d97fa){if(_0x5d97fa){return _0x5d97fa[_0xe7b1('0x20')](_0x431f01)[_0xe7b1('0x21')](function(_0x1a3164){return _0x1a3164;});}return null;};}function removeEntity(_0xde7697,_0x183b7f){return function(_0x28494b){if(_0x28494b){return _0x28494b[_0xe7b1('0x22')]()[_0xe7b1('0x21')](function(){_0xde7697[_0xe7b1('0x16')](0xcc)[_0xe7b1('0x17')]();});}};}function handleEntityNotFound(_0xa317dc,_0x223302){return function(_0x5ee834){if(!_0x5ee834){_0xa317dc['sendStatus'](0x194);}return _0x5ee834;};}function handleError(_0x14bca7,_0x520318){_0x520318=_0x520318||0x1f4;return function(_0x34a01f){logger[_0xe7b1('0x23')](_0x34a01f[_0xe7b1('0x24')]);if(_0x34a01f[_0xe7b1('0x25')]){delete _0x34a01f[_0xe7b1('0x25')];}_0x14bca7['status'](_0x520318)[_0xe7b1('0x26')](_0x34a01f);};}exports[_0xe7b1('0x27')]=function(_0x4752dd,_0x39f3bb){var _0x1a1213={},_0xa0aca8={},_0x12a3ee={'count':0x0,'rows':[]};var _0x153928=_['map'](db['IntegrationReport'][_0xe7b1('0x28')],function(_0x298985){return{'name':_0x298985['fieldName'],'type':_0x298985[_0xe7b1('0x29')][_0xe7b1('0x2a')]};});_0xa0aca8[_0xe7b1('0x2b')]=_[_0xe7b1('0x2c')](_0x153928,_0xe7b1('0x25'));_0xa0aca8[_0xe7b1('0x2d')]=_[_0xe7b1('0x2e')](_0x4752dd['query']);_0xa0aca8[_0xe7b1('0x2f')]=_[_0xe7b1('0x30')](_0xa0aca8[_0xe7b1('0x2b')],_0xa0aca8[_0xe7b1('0x2d')]);_0x1a1213['attributes']=_[_0xe7b1('0x30')](_0xa0aca8[_0xe7b1('0x2b')],qs[_0xe7b1('0x31')](_0x4752dd['query'][_0xe7b1('0x31')]));_0x1a1213['attributes']=_0x1a1213[_0xe7b1('0x32')][_0xe7b1('0x33')]?_0x1a1213[_0xe7b1('0x32')]:_0xa0aca8[_0xe7b1('0x2b')];if(!_0x4752dd['query'][_0xe7b1('0x34')](_0xe7b1('0x35'))){_0x1a1213[_0xe7b1('0x1c')]=qs[_0xe7b1('0x1c')](_0x4752dd['query'][_0xe7b1('0x1c')]);_0x1a1213[_0xe7b1('0x19')]=qs['offset'](_0x4752dd[_0xe7b1('0x2d')][_0xe7b1('0x19')]);}_0x1a1213['order']=qs[_0xe7b1('0x36')](_0x4752dd[_0xe7b1('0x2d')][_0xe7b1('0x36')]);_0x1a1213['where']=qs['filters'](_[_0xe7b1('0x37')](_0x4752dd[_0xe7b1('0x2d')],_0xa0aca8[_0xe7b1('0x2f')]),_0x153928);if(_0x4752dd['query'][_0xe7b1('0x38')]){_0x1a1213['where']=_['merge'](_0x1a1213[_0xe7b1('0x39')],{'$or':_[_0xe7b1('0x2c')](_0x153928,function(_0x5d1aa3){if(_0x5d1aa3[_0xe7b1('0x29')]!==_0xe7b1('0x3a')){var _0x467751={};_0x467751[_0x5d1aa3['name']]={'$like':'%'+_0x4752dd['query'][_0xe7b1('0x38')]+'%'};return _0x467751;}})});}_0x1a1213=_[_0xe7b1('0x3b')]({},_0x1a1213,_0x4752dd['options']);var _0x4d5c2c={'where':_0x1a1213['where']};return db['IntegrationReport'][_0xe7b1('0x1b')](_0x4d5c2c)[_0xe7b1('0x21')](function(_0x22b2d5){_0x12a3ee[_0xe7b1('0x1b')]=_0x22b2d5;if(_0x4752dd['query']['includeAll']){_0x1a1213[_0xe7b1('0x3c')]=[{'all':!![]}];}return db['IntegrationReport'][_0xe7b1('0x3d')](_0x1a1213);})['then'](function(_0x3d6830){_0x12a3ee[_0xe7b1('0x3e')]=_0x3d6830;return _0x12a3ee;})[_0xe7b1('0x21')](respondWithFilteredResult(_0x39f3bb,_0x1a1213))[_0xe7b1('0x3f')](handleError(_0x39f3bb,null));};exports[_0xe7b1('0x40')]=function(_0x15fdb1,_0xc9632){var _0x97f9c6={'raw':![],'where':{'id':_0x15fdb1[_0xe7b1('0x41')]['id']}},_0x3ce6ef={};_0x3ce6ef[_0xe7b1('0x2b')]=_['keys'](db[_0xe7b1('0x42')]['rawAttributes']);_0x3ce6ef[_0xe7b1('0x2d')]=_[_0xe7b1('0x2e')](_0x15fdb1[_0xe7b1('0x2d')]);_0x3ce6ef[_0xe7b1('0x2f')]=_[_0xe7b1('0x30')](_0x3ce6ef[_0xe7b1('0x2b')],_0x3ce6ef[_0xe7b1('0x2d')]);_0x97f9c6['attributes']=_[_0xe7b1('0x30')](_0x3ce6ef[_0xe7b1('0x2b')],qs[_0xe7b1('0x31')](_0x15fdb1[_0xe7b1('0x2d')][_0xe7b1('0x31')]));_0x97f9c6[_0xe7b1('0x32')]=_0x97f9c6[_0xe7b1('0x32')][_0xe7b1('0x33')]?_0x97f9c6[_0xe7b1('0x32')]:_0x3ce6ef[_0xe7b1('0x2b')];if(_0x15fdb1['query'][_0xe7b1('0x43')]){_0x97f9c6[_0xe7b1('0x3c')]=[{'all':!![]}];}_0x97f9c6=_[_0xe7b1('0x3b')]({},_0x97f9c6,_0x15fdb1['options']);return db['IntegrationReport']['find'](_0x97f9c6)[_0xe7b1('0x21')](handleEntityNotFound(_0xc9632,null))[_0xe7b1('0x21')](respondWithResult(_0xc9632,null))[_0xe7b1('0x3f')](handleError(_0xc9632,null));};exports[_0xe7b1('0x44')]=function(_0x317766,_0x1ede06){return db[_0xe7b1('0x42')][_0xe7b1('0x44')](_0x317766[_0xe7b1('0x45')],{})[_0xe7b1('0x21')](respondWithResult(_0x1ede06,0xc9))[_0xe7b1('0x3f')](handleError(_0x1ede06,null));};exports['update']=function(_0x5d850c,_0xb92d2c){if(_0x5d850c['body']['id']){delete _0x5d850c[_0xe7b1('0x45')]['id'];}return db[_0xe7b1('0x42')][_0xe7b1('0x46')]({'where':{'id':_0x5d850c['params']['id']}})['then'](handleEntityNotFound(_0xb92d2c,null))[_0xe7b1('0x21')](saveUpdates(_0x5d850c[_0xe7b1('0x45')],null))['then'](respondWithResult(_0xb92d2c,null))[_0xe7b1('0x3f')](handleError(_0xb92d2c,null));};exports[_0xe7b1('0x22')]=function(_0x4159e2,_0x3275d2){return db[_0xe7b1('0x42')][_0xe7b1('0x46')]({'where':{'id':_0x4159e2[_0xe7b1('0x41')]['id']}})['then'](handleEntityNotFound(_0x3275d2,null))[_0xe7b1('0x21')](removeEntity(_0x3275d2,null))[_0xe7b1('0x3f')](handleError(_0x3275d2,null));};exports[_0xe7b1('0x47')]=function(_0x5f6df1,_0x1c1d6d){return db[_0xe7b1('0x42')][_0xe7b1('0x47')]()['then'](respondWithResult(_0x1c1d6d,null))['catch'](handleError(_0x1c1d6d,null));};
\ No newline at end of file
+var _0x8e7c=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','destroy','then','error','stack','name','send','index','IntegrationReport','fieldName','type','key','model','map','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra'];(function(_0x1d8005,_0x272160){var _0x237dc6=function(_0x7ef412){while(--_0x7ef412){_0x1d8005['push'](_0x1d8005['shift']());}};_0x237dc6(++_0x272160);}(_0x8e7c,0x1a1));var _0xc8e7=function(_0x4b356c,_0x55cbbc){_0x4b356c=_0x4b356c-0x0;var _0x4fb17d=_0x8e7c[_0x4b356c];return _0x4fb17d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8e7('0x0'));var jsonpatch=require(_0xc8e7('0x1'));var rp=require(_0xc8e7('0x2'));var moment=require(_0xc8e7('0x3'));var BPromise=require(_0xc8e7('0x4'));var Mustache=require(_0xc8e7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc8e7('0x6'));var csv=require(_0xc8e7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8e7('0x8'));var _=require(_0xc8e7('0x9'));var squel=require(_0xc8e7('0xa'));var crypto=require(_0xc8e7('0xb'));var jsforce=require(_0xc8e7('0xc'));var deskjs=require(_0xc8e7('0xd'));var toCsv=require(_0xc8e7('0x7'));var querystring=require('querystring');var Papa=require(_0xc8e7('0xe'));var Redis=require(_0xc8e7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc8e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8e7('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xc8e7('0x12'));var licenseUtil=require(_0xc8e7('0x13'));var db=require(_0xc8e7('0x14'))['db'];function respondWithStatusCode(_0x14cf71,_0x3707d7){_0x3707d7=_0x3707d7||0xcc;return function(_0x6e689){if(_0x6e689){return _0x14cf71[_0xc8e7('0x15')](_0x3707d7);}return _0x14cf71[_0xc8e7('0x16')](_0x3707d7)[_0xc8e7('0x17')]();};}function respondWithResult(_0x3e02ef,_0x1c1658){_0x1c1658=_0x1c1658||0xc8;return function(_0x2ea933){if(_0x2ea933){return _0x3e02ef[_0xc8e7('0x16')](_0x1c1658)[_0xc8e7('0x18')](_0x2ea933);}};}function respondWithFilteredResult(_0x3c08c7,_0x158108){return function(_0x4b9c9d){if(_0x4b9c9d){var _0x46a657=typeof _0x158108[_0xc8e7('0x19')]===_0xc8e7('0x1a')&&typeof _0x158108[_0xc8e7('0x1b')]===_0xc8e7('0x1a');var _0xdf92aa=_0x4b9c9d['count'];var _0x5507cc=_0x46a657?0x0:_0x158108['offset'];var _0x52cf21=_0x46a657?_0x4b9c9d['count']:_0x158108[_0xc8e7('0x19')]+_0x158108[_0xc8e7('0x1b')];var _0x7d6063;if(_0x52cf21>=_0xdf92aa){_0x52cf21=_0xdf92aa;_0x7d6063=0xc8;}else{_0x7d6063=0xce;}_0x3c08c7[_0xc8e7('0x16')](_0x7d6063);return _0x3c08c7[_0xc8e7('0x1c')]('Content-Range',_0x5507cc+'-'+_0x52cf21+'/'+_0xdf92aa)[_0xc8e7('0x18')](_0x4b9c9d);}return null;};}function patchUpdates(_0x2d7282){return function(_0x36ad18){try{jsonpatch[_0xc8e7('0x1d')](_0x36ad18,_0x2d7282,!![]);}catch(_0xf0aa85){return BPromise[_0xc8e7('0x1e')](_0xf0aa85);}return _0x36ad18['save']();};}function saveUpdates(_0x12c637,_0x2b2a1c){return function(_0x2e63f4){if(_0x2e63f4){return _0x2e63f4['update'](_0x12c637)['then'](function(_0x8ed4bd){return _0x8ed4bd;});}return null;};}function removeEntity(_0x5ca944,_0x146844){return function(_0x203f0d){if(_0x203f0d){return _0x203f0d[_0xc8e7('0x1f')]()[_0xc8e7('0x20')](function(){_0x5ca944['status'](0xcc)[_0xc8e7('0x17')]();});}};}function handleEntityNotFound(_0x359166,_0x18844a){return function(_0x44c3db){if(!_0x44c3db){_0x359166[_0xc8e7('0x15')](0x194);}return _0x44c3db;};}function handleError(_0x462c1e,_0x2401af){_0x2401af=_0x2401af||0x1f4;return function(_0xa3e14f){logger[_0xc8e7('0x21')](_0xa3e14f[_0xc8e7('0x22')]);if(_0xa3e14f[_0xc8e7('0x23')]){delete _0xa3e14f['name'];}_0x462c1e[_0xc8e7('0x16')](_0x2401af)[_0xc8e7('0x24')](_0xa3e14f);};}exports[_0xc8e7('0x25')]=function(_0x327af1,_0x57ada4){var _0x17f727={},_0x14501f={},_0x568dfe={'count':0x0,'rows':[]};var _0xd93ebd=_['map'](db[_0xc8e7('0x26')]['rawAttributes'],function(_0x52bc5b){return{'name':_0x52bc5b[_0xc8e7('0x27')],'type':_0x52bc5b[_0xc8e7('0x28')][_0xc8e7('0x29')]};});_0x14501f[_0xc8e7('0x2a')]=_[_0xc8e7('0x2b')](_0xd93ebd,'name');_0x14501f['query']=_[_0xc8e7('0x2c')](_0x327af1['query']);_0x14501f[_0xc8e7('0x2d')]=_['intersection'](_0x14501f[_0xc8e7('0x2a')],_0x14501f[_0xc8e7('0x2e')]);_0x17f727[_0xc8e7('0x2f')]=_['intersection'](_0x14501f[_0xc8e7('0x2a')],qs[_0xc8e7('0x30')](_0x327af1[_0xc8e7('0x2e')][_0xc8e7('0x30')]));_0x17f727[_0xc8e7('0x2f')]=_0x17f727[_0xc8e7('0x2f')][_0xc8e7('0x31')]?_0x17f727[_0xc8e7('0x2f')]:_0x14501f['model'];if(!_0x327af1[_0xc8e7('0x2e')][_0xc8e7('0x32')](_0xc8e7('0x33'))){_0x17f727['limit']=qs[_0xc8e7('0x1b')](_0x327af1['query'][_0xc8e7('0x1b')]);_0x17f727[_0xc8e7('0x19')]=qs[_0xc8e7('0x19')](_0x327af1[_0xc8e7('0x2e')]['offset']);}_0x17f727['order']=qs[_0xc8e7('0x34')](_0x327af1[_0xc8e7('0x2e')][_0xc8e7('0x34')]);_0x17f727[_0xc8e7('0x35')]=qs[_0xc8e7('0x2d')](_[_0xc8e7('0x36')](_0x327af1[_0xc8e7('0x2e')],_0x14501f[_0xc8e7('0x2d')]),_0xd93ebd);if(_0x327af1['query'][_0xc8e7('0x37')]){_0x17f727['where']=_[_0xc8e7('0x38')](_0x17f727[_0xc8e7('0x35')],{'$or':_[_0xc8e7('0x2b')](_0xd93ebd,function(_0x2d3731){if(_0x2d3731[_0xc8e7('0x28')]!==_0xc8e7('0x39')){var _0x308799={};_0x308799[_0x2d3731[_0xc8e7('0x23')]]={'$like':'%'+_0x327af1[_0xc8e7('0x2e')]['filter']+'%'};return _0x308799;}})});}_0x17f727=_[_0xc8e7('0x38')]({},_0x17f727,_0x327af1['options']);var _0x43a5bf={'where':_0x17f727['where']};return db[_0xc8e7('0x26')][_0xc8e7('0x3a')](_0x43a5bf)['then'](function(_0x17368e){_0x568dfe[_0xc8e7('0x3a')]=_0x17368e;if(_0x327af1[_0xc8e7('0x2e')][_0xc8e7('0x3b')]){_0x17f727[_0xc8e7('0x3c')]=[{'all':!![]}];}return db[_0xc8e7('0x26')][_0xc8e7('0x3d')](_0x17f727);})[_0xc8e7('0x20')](function(_0x43f69d){_0x568dfe[_0xc8e7('0x3e')]=_0x43f69d;return _0x568dfe;})['then'](respondWithFilteredResult(_0x57ada4,_0x17f727))[_0xc8e7('0x3f')](handleError(_0x57ada4,null));};exports['show']=function(_0x5c9095,_0x19a6c7){var _0x200970={'raw':![],'where':{'id':_0x5c9095[_0xc8e7('0x40')]['id']}},_0x3b5272={};_0x3b5272['model']=_['keys'](db['IntegrationReport'][_0xc8e7('0x41')]);_0x3b5272[_0xc8e7('0x2e')]=_[_0xc8e7('0x2c')](_0x5c9095[_0xc8e7('0x2e')]);_0x3b5272['filters']=_['intersection'](_0x3b5272['model'],_0x3b5272[_0xc8e7('0x2e')]);_0x200970['attributes']=_['intersection'](_0x3b5272['model'],qs[_0xc8e7('0x30')](_0x5c9095[_0xc8e7('0x2e')]['fields']));_0x200970[_0xc8e7('0x2f')]=_0x200970['attributes'][_0xc8e7('0x31')]?_0x200970[_0xc8e7('0x2f')]:_0x3b5272[_0xc8e7('0x2a')];if(_0x5c9095[_0xc8e7('0x2e')][_0xc8e7('0x3b')]){_0x200970[_0xc8e7('0x3c')]=[{'all':!![]}];}_0x200970=_['merge']({},_0x200970,_0x5c9095[_0xc8e7('0x42')]);return db[_0xc8e7('0x26')][_0xc8e7('0x43')](_0x200970)[_0xc8e7('0x20')](handleEntityNotFound(_0x19a6c7,null))[_0xc8e7('0x20')](respondWithResult(_0x19a6c7,null))['catch'](handleError(_0x19a6c7,null));};exports[_0xc8e7('0x44')]=function(_0x24c0ed,_0x18f4b8){return db[_0xc8e7('0x26')]['create'](_0x24c0ed[_0xc8e7('0x45')],{})[_0xc8e7('0x20')](respondWithResult(_0x18f4b8,0xc9))['catch'](handleError(_0x18f4b8,null));};exports['update']=function(_0x3c03de,_0x81db75){if(_0x3c03de[_0xc8e7('0x45')]['id']){delete _0x3c03de[_0xc8e7('0x45')]['id'];}return db[_0xc8e7('0x26')][_0xc8e7('0x43')]({'where':{'id':_0x3c03de['params']['id']}})[_0xc8e7('0x20')](handleEntityNotFound(_0x81db75,null))['then'](saveUpdates(_0x3c03de[_0xc8e7('0x45')],null))[_0xc8e7('0x20')](respondWithResult(_0x81db75,null))['catch'](handleError(_0x81db75,null));};exports[_0xc8e7('0x1f')]=function(_0x3cb06a,_0x48bb9f){return db[_0xc8e7('0x26')][_0xc8e7('0x43')]({'where':{'id':_0x3cb06a[_0xc8e7('0x40')]['id']}})[_0xc8e7('0x20')](handleEntityNotFound(_0x48bb9f,null))[_0xc8e7('0x20')](removeEntity(_0x48bb9f,null))[_0xc8e7('0x3f')](handleError(_0x48bb9f,null));};exports[_0xc8e7('0x46')]=function(_0x434d50,_0x2a533c){return db['IntegrationReport'][_0xc8e7('0x46')]()[_0xc8e7('0x20')](respondWithResult(_0x2a533c,null))['catch'](handleError(_0x2a533c,null));};
\ No newline at end of file
index aa8cad5..4d03097 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bf2=['moment','path','../../config/environment','./integrationReport.attributes','define','lodash','api'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0x6bf2,0xad));var _0x26bf=function(_0x371b12,_0xe33e57){_0x371b12=_0x371b12-0x0;var _0x3fdc4f=_0x6bf2[_0x371b12];return _0x3fdc4f;};'use strict';var _=require(_0x26bf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x26bf('0x1'));var moment=require(_0x26bf('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x26bf('0x3'));var rimraf=require('rimraf');var config=require(_0x26bf('0x4'));var attributes=require(_0x26bf('0x5'));module['exports']=function(_0x10ba84,_0x47a6ea){return _0x10ba84[_0x26bf('0x6')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x047a=['api','moment','path','rimraf','./integrationReport.attributes','define','IntegrationReport','lodash','util','../../config/logger'];(function(_0x4378e3,_0x566339){var _0xc1d2bd=function(_0x192fef){while(--_0x192fef){_0x4378e3['push'](_0x4378e3['shift']());}};_0xc1d2bd(++_0x566339);}(_0x047a,0x75));var _0xa047=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x047a[_0x137d1d];return _0x485108;};'use strict';var _=require(_0xa047('0x0'));var util=require(_0xa047('0x1'));var logger=require(_0xa047('0x2'))(_0xa047('0x3'));var moment=require(_0xa047('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa047('0x5'));var rimraf=require(_0xa047('0x6'));var config=require('../../config/environment');var attributes=require(_0xa047('0x7'));module['exports']=function(_0x2cd878,_0x478b5f){return _0x2cd878[_0xa047('0x8')](_0xa047('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a185125..28011e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x1ee005,_0x910f40){var _0x1b8166=function(_0x4acf70){while(--_0x4acf70){_0x1ee005['push'](_0x1ee005['shift']());}};_0x1b8166(++_0x910f40);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x341128,_0x4b9012){var _0x2b3457=function(_0x2ea9f0){while(--_0x2ea9f0){_0x341128['push'](_0x341128['shift']());}};_0x2b3457(++_0x4b9012);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e4b63,_0x2ba304){_0x1e4b63=_0x1e4b63-0x0;var _0x114365=_0x2ef3[_0x1e4b63];return _0x114365;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
index b94ad64..f5408cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe237=['multer','util','express','Router','fs-extra','../../components/auth/service','./interval.controller','index','get','/:id','isAuthenticated','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','put','update','delete','destroy'];(function(_0x3d7040,_0x3ce7d1){var _0x56d28f=function(_0x1c9cd7){while(--_0x1c9cd7){_0x3d7040['push'](_0x3d7040['shift']());}};_0x56d28f(++_0x3ce7d1);}(_0xe237,0xdc));var _0x7e23=function(_0x1d88d9,_0x6116a5){_0x1d88d9=_0x1d88d9-0x0;var _0xd3c570=_0xe237[_0x1d88d9];return _0xd3c570;};'use strict';var multer=require(_0x7e23('0x0'));var util=require(_0x7e23('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7e23('0x2'));var router=express[_0x7e23('0x3')]();var fs_extra=require(_0x7e23('0x4'));var auth=require(_0x7e23('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7e23('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7e23('0x7')]);router[_0x7e23('0x8')](_0x7e23('0x9'),auth[_0x7e23('0xa')](),controller['show']);router['get'](_0x7e23('0xb'),auth[_0x7e23('0xa')](),controller[_0x7e23('0xc')]);router['post']('/',auth[_0x7e23('0xa')](),controller['create']);router[_0x7e23('0xd')]('/:id/sub_intervals',auth[_0x7e23('0xa')](),controller[_0x7e23('0xe')]);router['post'](_0x7e23('0xf'),auth[_0x7e23('0xa')](),controller['addIntervals']);router[_0x7e23('0x10')](_0x7e23('0x9'),auth[_0x7e23('0xa')](),controller[_0x7e23('0x11')]);router[_0x7e23('0x12')](_0x7e23('0x9'),auth[_0x7e23('0xa')](),controller[_0x7e23('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x9df5=['post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals'];(function(_0x479da6,_0x23b84e){var _0x3f0ac4=function(_0x797c0){while(--_0x797c0){_0x479da6['push'](_0x479da6['shift']());}};_0x3f0ac4(++_0x23b84e);}(_0x9df5,0x9b));var _0x59df=function(_0x2bbd92,_0x527fc6){_0x2bbd92=_0x2bbd92-0x0;var _0x309984=_0x9df5[_0x2bbd92];return _0x309984;};'use strict';var multer=require(_0x59df('0x0'));var util=require(_0x59df('0x1'));var path=require(_0x59df('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x59df('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x59df('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x59df('0x5'));var controller=require(_0x59df('0x6'));router[_0x59df('0x7')]('/',auth[_0x59df('0x8')](),controller['index']);router[_0x59df('0x7')](_0x59df('0x9'),auth['isAuthenticated'](),controller[_0x59df('0xa')]);router[_0x59df('0x7')](_0x59df('0xb'),auth[_0x59df('0x8')](),controller[_0x59df('0xc')]);router[_0x59df('0xd')]('/',auth[_0x59df('0x8')](),controller[_0x59df('0xe')]);router[_0x59df('0xd')](_0x59df('0xb'),auth['isAuthenticated'](),controller[_0x59df('0xf')]);router[_0x59df('0xd')](_0x59df('0x10'),auth[_0x59df('0x8')](),controller[_0x59df('0x11')]);router['put']('/:id',auth[_0x59df('0x8')](),controller[_0x59df('0x12')]);router[_0x59df('0x13')](_0x59df('0x9'),auth[_0x59df('0x8')](),controller['destroy']);module[_0x59df('0x14')]=router;
\ No newline at end of file
index 7004227..ee1e1fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b81=['STRING','exports'];(function(_0x3995dd,_0x24f96f){var _0x410f8a=function(_0xe2c273){while(--_0xe2c273){_0x3995dd['push'](_0x3995dd['shift']());}};_0x410f8a(++_0x24f96f);}(_0x6b81,0x19f));var _0x16b8=function(_0x2776c0,_0x3bdc05){_0x2776c0=_0x2776c0-0x0;var _0x42b7b7=_0x6b81[_0x2776c0];return _0x42b7b7;};'use strict';var Sequelize=require('sequelize');module[_0x16b8('0x0')]={'name':{'type':Sequelize[_0x16b8('0x1')]},'description':{'type':Sequelize[_0x16b8('0x1')]},'interval':{'type':Sequelize[_0x16b8('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x786e=['STRING','exports'];(function(_0x50c0bf,_0x1d8667){var _0x3c6ff1=function(_0x3d4c0c){while(--_0x3d4c0c){_0x50c0bf['push'](_0x50c0bf['shift']());}};_0x3c6ff1(++_0x1d8667);}(_0x786e,0x65));var _0xe786=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0x786e[_0x1ae8ab];return _0x1ad705;};'use strict';var Sequelize=require('sequelize');module[_0xe786('0x0')]={'name':{'type':Sequelize[_0xe786('0x1')]},'description':{'type':Sequelize[_0xe786('0x1')]},'interval':{'type':Sequelize[_0xe786('0x1')],'allowNull':!![]}};
\ No newline at end of file
index d67a201..d3fa009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc51a=['Interval','includeAll','include','findAll','rows','show','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x3d6b48,_0x4782d7){var _0x4d1144=function(_0x472341){while(--_0x472341){_0x3d6b48['push'](_0x3d6b48['shift']());}};_0x4d1144(++_0x4782d7);}(_0xc51a,0x18e));var _0xac51=function(_0xea5238,_0x1de71e){_0xea5238=_0xea5238-0x0;var _0x31bfc2=_0xc51a[_0xea5238];return _0x31bfc2;};'use strict';var emlformat=require(_0xac51('0x0'));var rimraf=require(_0xac51('0x1'));var zipdir=require(_0xac51('0x2'));var jsonpatch=require(_0xac51('0x3'));var rp=require('request-promise');var moment=require(_0xac51('0x4'));var BPromise=require(_0xac51('0x5'));var Mustache=require(_0xac51('0x6'));var util=require('util');var path=require(_0xac51('0x7'));var sox=require(_0xac51('0x8'));var csv=require(_0xac51('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac51('0xa'));var squel=require('squel');var crypto=require(_0xac51('0xb'));var jsforce=require(_0xac51('0xc'));var deskjs=require(_0xac51('0xd'));var toCsv=require(_0xac51('0x9'));var querystring=require(_0xac51('0xe'));var Papa=require(_0xac51('0xf'));var Redis=require(_0xac51('0x10'));var authService=require(_0xac51('0x11'));var qs=require(_0xac51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac51('0x13'));var logger=require('../../config/logger')(_0xac51('0x14'));var utils=require(_0xac51('0x15'));var config=require(_0xac51('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0xac51('0x17'));function respondWithStatusCode(_0x5c3f17,_0x3a0af5){_0x3a0af5=_0x3a0af5||0xcc;return function(_0x3fd77c){if(_0x3fd77c){return _0x5c3f17[_0xac51('0x18')](_0x3a0af5);}return _0x5c3f17[_0xac51('0x19')](_0x3a0af5)['end']();};}function respondWithResult(_0x44456a,_0x362ddb){_0x362ddb=_0x362ddb||0xc8;return function(_0x199112){if(_0x199112){return _0x44456a[_0xac51('0x19')](_0x362ddb)[_0xac51('0x1a')](_0x199112);}};}function respondWithFilteredResult(_0x2876c4,_0x506b0d){return function(_0x40bd21){if(_0x40bd21){var _0x34a35e=typeof _0x506b0d['offset']===_0xac51('0x1b')&&typeof _0x506b0d[_0xac51('0x1c')]===_0xac51('0x1b');var _0x1a6668=_0x40bd21[_0xac51('0x1d')];var _0x1d1d07=_0x34a35e?0x0:_0x506b0d[_0xac51('0x1e')];var _0x285e81=_0x34a35e?_0x40bd21[_0xac51('0x1d')]:_0x506b0d[_0xac51('0x1e')]+_0x506b0d['limit'];var _0x53a06c;if(_0x285e81>=_0x1a6668){_0x285e81=_0x1a6668;_0x53a06c=0xc8;}else{_0x53a06c=0xce;}_0x2876c4['status'](_0x53a06c);return _0x2876c4[_0xac51('0x1f')](_0xac51('0x20'),_0x1d1d07+'-'+_0x285e81+'/'+_0x1a6668)[_0xac51('0x1a')](_0x40bd21);}return null;};}function patchUpdates(_0x229893){return function(_0x510627){try{jsonpatch[_0xac51('0x21')](_0x510627,_0x229893,!![]);}catch(_0x4cbc1f){return BPromise['reject'](_0x4cbc1f);}return _0x510627[_0xac51('0x22')]();};}function saveUpdates(_0x414f09,_0xdebfd7){return function(_0x1f2d47){if(_0x1f2d47){return _0x1f2d47[_0xac51('0x23')](_0x414f09)[_0xac51('0x24')](function(_0x1758ae){return _0x1758ae;});}return null;};}function removeEntity(_0xbb9e0c,_0x47e16f){return function(_0x1353e2){if(_0x1353e2){return _0x1353e2[_0xac51('0x25')]()[_0xac51('0x24')](function(){var _0x8d02be=_0x1353e2[_0xac51('0x26')]({'plain':!![]});var _0x2cc823=_0xac51('0x27');return db[_0xac51('0x28')][_0xac51('0x25')]({'where':{'type':_0x2cc823,'resourceId':_0x8d02be['id']}})[_0xac51('0x24')](function(){return _0x1353e2;});})['then'](function(){_0xbb9e0c['status'](0xcc)[_0xac51('0x29')]();});}};}function handleEntityNotFound(_0x854807,_0x534911){return function(_0x56b9a2){if(!_0x56b9a2){_0x854807[_0xac51('0x18')](0x194);}return _0x56b9a2;};}function handleError(_0x1ffa0e,_0x2edfe2){_0x2edfe2=_0x2edfe2||0x1f4;return function(_0x9c9df){logger[_0xac51('0x2a')](_0x9c9df[_0xac51('0x2b')]);if(_0x9c9df[_0xac51('0x2c')]){delete _0x9c9df[_0xac51('0x2c')];}_0x1ffa0e[_0xac51('0x19')](_0x2edfe2)[_0xac51('0x2d')](_0x9c9df);};}exports[_0xac51('0x2e')]=function(_0x290f61,_0x168e03){var _0x436b34={},_0x5f2d55={},_0x91e06c={'count':0x0,'rows':[]};var _0x43b01d=_[_0xac51('0x2f')](db['Interval'][_0xac51('0x30')],function(_0x55f547){return{'name':_0x55f547['fieldName'],'type':_0x55f547[_0xac51('0x31')][_0xac51('0x32')]};});_0x5f2d55[_0xac51('0x33')]=_[_0xac51('0x2f')](_0x43b01d,_0xac51('0x2c'));_0x5f2d55[_0xac51('0x34')]=_[_0xac51('0x35')](_0x290f61[_0xac51('0x34')]);_0x5f2d55['filters']=_[_0xac51('0x36')](_0x5f2d55['model'],_0x5f2d55[_0xac51('0x34')]);_0x436b34[_0xac51('0x37')]=_[_0xac51('0x36')](_0x5f2d55[_0xac51('0x33')],qs[_0xac51('0x38')](_0x290f61[_0xac51('0x34')]['fields']));_0x436b34[_0xac51('0x37')]=_0x436b34[_0xac51('0x37')]['length']?_0x436b34[_0xac51('0x37')]:_0x5f2d55[_0xac51('0x33')];if(!_0x290f61[_0xac51('0x34')]['hasOwnProperty'](_0xac51('0x39'))){_0x436b34['limit']=qs[_0xac51('0x1c')](_0x290f61['query'][_0xac51('0x1c')]);_0x436b34[_0xac51('0x1e')]=qs[_0xac51('0x1e')](_0x290f61[_0xac51('0x34')]['offset']);}_0x436b34[_0xac51('0x3a')]=qs['sort'](_0x290f61[_0xac51('0x34')][_0xac51('0x3b')]);_0x436b34[_0xac51('0x3c')]=qs[_0xac51('0x3d')](_[_0xac51('0x3e')](_0x290f61[_0xac51('0x34')],_0x5f2d55['filters']),_0x43b01d);if(_0x290f61[_0xac51('0x34')][_0xac51('0x3f')]){_0x436b34[_0xac51('0x3c')]=_[_0xac51('0x40')](_0x436b34[_0xac51('0x3c')],{'$or':_[_0xac51('0x2f')](_0x43b01d,function(_0x231b74){if(_0x231b74[_0xac51('0x31')]!==_0xac51('0x41')){var _0x25682f={};_0x25682f[_0x231b74[_0xac51('0x2c')]]={'$like':'%'+_0x290f61[_0xac51('0x34')]['filter']+'%'};return _0x25682f;}})});}_0x436b34=_[_0xac51('0x40')]({},_0x436b34,_0x290f61[_0xac51('0x42')]);var _0x10dc2e={'where':_0x436b34[_0xac51('0x3c')]};return db[_0xac51('0x43')][_0xac51('0x1d')](_0x10dc2e)['then'](function(_0x146714){_0x91e06c[_0xac51('0x1d')]=_0x146714;if(_0x290f61[_0xac51('0x34')][_0xac51('0x44')]){_0x436b34[_0xac51('0x45')]=[{'all':!![]}];}return db[_0xac51('0x43')][_0xac51('0x46')](_0x436b34);})[_0xac51('0x24')](function(_0x309545){_0x91e06c[_0xac51('0x47')]=_0x309545;return _0x91e06c;})['then'](respondWithFilteredResult(_0x168e03,_0x436b34))['catch'](handleError(_0x168e03,null));};exports[_0xac51('0x48')]=function(_0x23ccb3,_0x2c9264){var _0x51442d={'raw':!![],'where':{'id':_0x23ccb3['params']['id']}},_0x9bb36b={};_0x9bb36b[_0xac51('0x33')]=_['keys'](db[_0xac51('0x43')]['rawAttributes']);_0x9bb36b[_0xac51('0x34')]=_[_0xac51('0x35')](_0x23ccb3[_0xac51('0x34')]);_0x9bb36b[_0xac51('0x3d')]=_[_0xac51('0x36')](_0x9bb36b[_0xac51('0x33')],_0x9bb36b[_0xac51('0x34')]);_0x51442d['attributes']=_[_0xac51('0x36')](_0x9bb36b['model'],qs[_0xac51('0x38')](_0x23ccb3[_0xac51('0x34')][_0xac51('0x38')]));_0x51442d['attributes']=_0x51442d['attributes'][_0xac51('0x49')]?_0x51442d[_0xac51('0x37')]:_0x9bb36b[_0xac51('0x33')];if(_0x23ccb3['query'][_0xac51('0x44')]){_0x51442d['include']=[{'all':!![]}];}_0x51442d=_[_0xac51('0x40')]({},_0x51442d,_0x23ccb3[_0xac51('0x42')]);return db[_0xac51('0x43')][_0xac51('0x4a')](_0x51442d)['then'](handleEntityNotFound(_0x2c9264,null))[_0xac51('0x24')](respondWithResult(_0x2c9264,null))[_0xac51('0x4b')](handleError(_0x2c9264,null));};exports[_0xac51('0x4c')]=function(_0x5655c7,_0x589cb2){return db[_0xac51('0x43')][_0xac51('0x4c')](_0x5655c7[_0xac51('0x4d')],{})[_0xac51('0x24')](function(_0x4e6b6b){var _0x1d5d02=_0x5655c7[_0xac51('0x4e')]['get']({'plain':!![]});if(!_0x1d5d02)throw new Error(_0xac51('0x4f'));if(_0x1d5d02[_0xac51('0x50')]===_0xac51('0x4e')){var _0x1cf78f=_0x4e6b6b[_0xac51('0x26')]({'plain':!![]});var _0x477bc3=_0xac51('0x27');return db[_0xac51('0x51')][_0xac51('0x4a')]({'where':{'name':_0x477bc3,'userProfileId':_0x1d5d02[_0xac51('0x52')]},'raw':!![]})['then'](function(_0x497404){if(_0x497404&&_0x497404['autoAssociation']===0x0){return db[_0xac51('0x28')][_0xac51('0x4c')]({'name':_0x1cf78f[_0xac51('0x2c')],'resourceId':_0x1cf78f['id'],'type':_0x497404['name'],'sectionId':_0x497404['id']},{})['then'](function(){return _0x4e6b6b;});}else{return _0x4e6b6b;}})[_0xac51('0x4b')](function(_0x13fffe){logger[_0xac51('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13fffe);throw _0x13fffe;});}return _0x4e6b6b;})[_0xac51('0x24')](respondWithResult(_0x589cb2,0xc9))[_0xac51('0x4b')](handleError(_0x589cb2,null));};exports[_0xac51('0x23')]=function(_0x44fa28,_0x167d0f){if(_0x44fa28['body']['id']){delete _0x44fa28[_0xac51('0x4d')]['id'];}return db[_0xac51('0x43')][_0xac51('0x4a')]({'where':{'id':_0x44fa28[_0xac51('0x53')]['id']}})[_0xac51('0x24')](handleEntityNotFound(_0x167d0f,null))[_0xac51('0x24')](saveUpdates(_0x44fa28[_0xac51('0x4d')],null))[_0xac51('0x24')](respondWithResult(_0x167d0f,null))[_0xac51('0x4b')](handleError(_0x167d0f,null));};exports['destroy']=function(_0x2f8771,_0x3c7ad2){return db[_0xac51('0x43')]['find']({'where':{'id':_0x2f8771[_0xac51('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c7ad2,null))['then'](removeEntity(_0x3c7ad2,null))[_0xac51('0x4b')](handleError(_0x3c7ad2,null));};exports[_0xac51('0x54')]=function(_0x5ec122,_0x5c03b0,_0x4e8585){if(_0x5ec122[_0xac51('0x4d')]['id']){delete _0x5ec122[_0xac51('0x4d')]['id'];}return db[_0xac51('0x43')][_0xac51('0x4a')]({'where':{'id':_0x5ec122['params']['id']}})[_0xac51('0x24')](handleEntityNotFound(_0x5c03b0,null))[_0xac51('0x24')](function(_0x44be00){if(_0x44be00){_0x5ec122[_0xac51('0x4d')][_0xac51('0x55')]=_0x44be00['id'];return db[_0xac51('0x43')][_0xac51('0x4c')](_0x5ec122[_0xac51('0x4d')]);}})[_0xac51('0x24')](respondWithResult(_0x5c03b0,null))[_0xac51('0x4b')](handleError(_0x5c03b0,null));};exports[_0xac51('0x56')]=function(_0x3b530d,_0x308027,_0x1d04e3){var _0x1c1e94={};var _0xb25c2a={};var _0xbce874;var _0x267f52;return db['Interval'][_0xac51('0x57')]({'where':{'id':_0x3b530d[_0xac51('0x53')]['id']}})['then'](handleEntityNotFound(_0x308027,null))[_0xac51('0x24')](function(_0x5cad18){if(_0x5cad18){_0xbce874=_0x5cad18;_0xb25c2a[_0xac51('0x33')]=_[_0xac51('0x35')](db['Interval'][_0xac51('0x30')]);_0xb25c2a[_0xac51('0x34')]=_[_0xac51('0x35')](_0x3b530d[_0xac51('0x34')]);_0xb25c2a['filters']=_[_0xac51('0x36')](_0xb25c2a[_0xac51('0x33')],_0xb25c2a['query']);_0x1c1e94['attributes']=_[_0xac51('0x36')](_0xb25c2a[_0xac51('0x33')],qs[_0xac51('0x38')](_0x3b530d['query'][_0xac51('0x38')]));_0x1c1e94[_0xac51('0x37')]=_0x1c1e94[_0xac51('0x37')]['length']?_0x1c1e94[_0xac51('0x37')]:_0xb25c2a['model'];_0x1c1e94[_0xac51('0x3a')]=qs['sort'](_0x3b530d[_0xac51('0x34')][_0xac51('0x3b')]);_0x1c1e94[_0xac51('0x3c')]=qs[_0xac51('0x3d')](_['pick'](_0x3b530d[_0xac51('0x34')],_0xb25c2a[_0xac51('0x3d')]));if(_0x3b530d[_0xac51('0x34')]['filter']){_0x1c1e94[_0xac51('0x3c')]=_[_0xac51('0x40')](_0x1c1e94['where'],{'$or':_[_0xac51('0x2f')](_0x1c1e94[_0xac51('0x37')],function(_0x2e6ff2){var _0x5ad775={};_0x5ad775[_0x2e6ff2]={'$like':'%'+_0x3b530d[_0xac51('0x34')][_0xac51('0x3f')]+'%'};return _0x5ad775;})});}_0x1c1e94=_[_0xac51('0x40')]({},_0x1c1e94,_0x3b530d[_0xac51('0x42')]);return _0xbce874[_0xac51('0x56')](_0x1c1e94);}})[_0xac51('0x24')](function(_0x538e04){if(_0x538e04){_0x267f52=_0x538e04[_0xac51('0x49')];if(!_0x3b530d[_0xac51('0x34')][_0xac51('0x58')](_0xac51('0x39'))){_0x1c1e94[_0xac51('0x1c')]=qs[_0xac51('0x1c')](_0x3b530d[_0xac51('0x34')][_0xac51('0x1c')]);_0x1c1e94[_0xac51('0x1e')]=qs[_0xac51('0x1e')](_0x3b530d[_0xac51('0x34')][_0xac51('0x1e')]);}return _0xbce874[_0xac51('0x56')](_0x1c1e94);}})['then'](function(_0x196dbb){if(_0x196dbb){return _0x196dbb?{'count':_0x267f52,'rows':_0x196dbb}:null;}})[_0xac51('0x24')](respondWithResult(_0x308027,null))[_0xac51('0x4b')](handleError(_0x308027,null));};exports[_0xac51('0x59')]=function(_0x2dcb0,_0x33c806,_0x26d949){return db['Interval'][_0xac51('0x57')]({'where':{'id':_0x2dcb0[_0xac51('0x53')]['id']}})[_0xac51('0x24')](handleEntityNotFound(_0x33c806,null))[_0xac51('0x24')](function(_0x53a9ed){if(_0x53a9ed){return db[_0xac51('0x5a')][_0xac51('0x5b')](function(_0x528e39){return db['Interval'][_0xac51('0x25')]({'where':{'IntervalId':_0x2dcb0['params']['id']},'transaction':_0x528e39})['then'](function(_0xa8a216){var _0x25f140=_['map'](_0x2dcb0['body'],function(_0x3c5f0c){delete _0x3c5f0c['id'];_0x3c5f0c[_0xac51('0x55')]=_0x2dcb0[_0xac51('0x53')]['id'];return _0x3c5f0c;});return db[_0xac51('0x43')][_0xac51('0x5c')](_0x25f140,{'transaction':_0x528e39});});})[_0xac51('0x24')](function(){return db[_0xac51('0x43')][_0xac51('0x46')]({'where':{'IntervalId':_0x2dcb0[_0xac51('0x53')]['id']}});});}})[_0xac51('0x24')](respondWithResult(_0x33c806,null))[_0xac51('0x4b')](handleError(_0x33c806,null));};
\ No newline at end of file
+var _0xc8f3=['pick','filters','filter','VIRTUAL','options','findAll','rows','catch','show','length','includeAll','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','IntervalId','findOne','order','getIntervals','addIntervals','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','then','get','Intervals','UserProfileResource','end','stack','name','index','map','Interval','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x2f506e,_0x2bef86){var _0x1a67b2=function(_0x59dd14){while(--_0x59dd14){_0x2f506e['push'](_0x2f506e['shift']());}};_0x1a67b2(++_0x2bef86);}(_0xc8f3,0x1e4));var _0x3c8f=function(_0x4defbd,_0x4f788f){_0x4defbd=_0x4defbd-0x0;var _0x7a49ec=_0xc8f3[_0x4defbd];return _0x7a49ec;};'use strict';var emlformat=require(_0x3c8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c8f('0x1'));var jsonpatch=require(_0x3c8f('0x2'));var rp=require('request-promise');var moment=require(_0x3c8f('0x3'));var BPromise=require(_0x3c8f('0x4'));var Mustache=require(_0x3c8f('0x5'));var util=require(_0x3c8f('0x6'));var path=require(_0x3c8f('0x7'));var sox=require(_0x3c8f('0x8'));var csv=require(_0x3c8f('0x9'));var ejs=require(_0x3c8f('0xa'));var fs=require('fs');var fs_extra=require(_0x3c8f('0xb'));var _=require(_0x3c8f('0xc'));var squel=require(_0x3c8f('0xd'));var crypto=require('crypto');var jsforce=require(_0x3c8f('0xe'));var deskjs=require(_0x3c8f('0xf'));var toCsv=require(_0x3c8f('0x9'));var querystring=require(_0x3c8f('0x10'));var Papa=require('papaparse');var Redis=require(_0x3c8f('0x11'));var authService=require(_0x3c8f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3c8f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c8f('0x14'))('api');var utils=require(_0x3c8f('0x15'));var config=require(_0x3c8f('0x16'));var licenseUtil=require(_0x3c8f('0x17'));var db=require(_0x3c8f('0x18'))['db'];var extensions=require(_0x3c8f('0x19'));function respondWithStatusCode(_0x1235a3,_0x3165f1){_0x3165f1=_0x3165f1||0xcc;return function(_0x3f1d79){if(_0x3f1d79){return _0x1235a3[_0x3c8f('0x1a')](_0x3165f1);}return _0x1235a3[_0x3c8f('0x1b')](_0x3165f1)['end']();};}function respondWithResult(_0x20a8cb,_0x4e72a5){_0x4e72a5=_0x4e72a5||0xc8;return function(_0x164cd8){if(_0x164cd8){return _0x20a8cb[_0x3c8f('0x1b')](_0x4e72a5)[_0x3c8f('0x1c')](_0x164cd8);}};}function respondWithFilteredResult(_0x5ba2e6,_0x174737){return function(_0x20bea8){if(_0x20bea8){var _0xbe552=typeof _0x174737[_0x3c8f('0x1d')]==='undefined'&&typeof _0x174737[_0x3c8f('0x1e')]===_0x3c8f('0x1f');var _0x44bacf=_0x20bea8[_0x3c8f('0x20')];var _0x5c8cd8=_0xbe552?0x0:_0x174737['offset'];var _0x3ae537=_0xbe552?_0x20bea8[_0x3c8f('0x20')]:_0x174737[_0x3c8f('0x1d')]+_0x174737[_0x3c8f('0x1e')];var _0x517324;if(_0x3ae537>=_0x44bacf){_0x3ae537=_0x44bacf;_0x517324=0xc8;}else{_0x517324=0xce;}_0x5ba2e6['status'](_0x517324);return _0x5ba2e6['set'](_0x3c8f('0x21'),_0x5c8cd8+'-'+_0x3ae537+'/'+_0x44bacf)[_0x3c8f('0x1c')](_0x20bea8);}return null;};}function patchUpdates(_0x3b315c){return function(_0x14973b){try{jsonpatch['apply'](_0x14973b,_0x3b315c,!![]);}catch(_0x15b3fd){return BPromise[_0x3c8f('0x22')](_0x15b3fd);}return _0x14973b[_0x3c8f('0x23')]();};}function saveUpdates(_0x4eba39,_0x129ae3){return function(_0x4b093c){if(_0x4b093c){return _0x4b093c[_0x3c8f('0x24')](_0x4eba39)['then'](function(_0x29c266){return _0x29c266;});}return null;};}function removeEntity(_0x58571e,_0x29334e){return function(_0x17ba51){if(_0x17ba51){return _0x17ba51[_0x3c8f('0x25')]()[_0x3c8f('0x26')](function(){var _0x2f3c8d=_0x17ba51[_0x3c8f('0x27')]({'plain':!![]});var _0x2a6827=_0x3c8f('0x28');return db[_0x3c8f('0x29')]['destroy']({'where':{'type':_0x2a6827,'resourceId':_0x2f3c8d['id']}})[_0x3c8f('0x26')](function(){return _0x17ba51;});})['then'](function(){_0x58571e[_0x3c8f('0x1b')](0xcc)[_0x3c8f('0x2a')]();});}};}function handleEntityNotFound(_0x2afcc1,_0x5e9ffd){return function(_0x5d15d9){if(!_0x5d15d9){_0x2afcc1[_0x3c8f('0x1a')](0x194);}return _0x5d15d9;};}function handleError(_0x46e88c,_0x135bbe){_0x135bbe=_0x135bbe||0x1f4;return function(_0x120c39){logger['error'](_0x120c39[_0x3c8f('0x2b')]);if(_0x120c39[_0x3c8f('0x2c')]){delete _0x120c39[_0x3c8f('0x2c')];}_0x46e88c[_0x3c8f('0x1b')](_0x135bbe)['send'](_0x120c39);};}exports[_0x3c8f('0x2d')]=function(_0x1b922c,_0x449901){var _0x2a0520={},_0x180ee5={},_0x25ec46={'count':0x0,'rows':[]};var _0x433179=_[_0x3c8f('0x2e')](db[_0x3c8f('0x2f')][_0x3c8f('0x30')],function(_0x771016){return{'name':_0x771016[_0x3c8f('0x31')],'type':_0x771016[_0x3c8f('0x32')][_0x3c8f('0x33')]};});_0x180ee5['model']=_[_0x3c8f('0x2e')](_0x433179,'name');_0x180ee5[_0x3c8f('0x34')]=_[_0x3c8f('0x35')](_0x1b922c[_0x3c8f('0x34')]);_0x180ee5['filters']=_[_0x3c8f('0x36')](_0x180ee5[_0x3c8f('0x37')],_0x180ee5[_0x3c8f('0x34')]);_0x2a0520[_0x3c8f('0x38')]=_[_0x3c8f('0x36')](_0x180ee5[_0x3c8f('0x37')],qs[_0x3c8f('0x39')](_0x1b922c[_0x3c8f('0x34')][_0x3c8f('0x39')]));_0x2a0520['attributes']=_0x2a0520[_0x3c8f('0x38')]['length']?_0x2a0520['attributes']:_0x180ee5[_0x3c8f('0x37')];if(!_0x1b922c[_0x3c8f('0x34')][_0x3c8f('0x3a')](_0x3c8f('0x3b'))){_0x2a0520[_0x3c8f('0x1e')]=qs[_0x3c8f('0x1e')](_0x1b922c[_0x3c8f('0x34')][_0x3c8f('0x1e')]);_0x2a0520[_0x3c8f('0x1d')]=qs['offset'](_0x1b922c[_0x3c8f('0x34')][_0x3c8f('0x1d')]);}_0x2a0520['order']=qs[_0x3c8f('0x3c')](_0x1b922c['query'][_0x3c8f('0x3c')]);_0x2a0520[_0x3c8f('0x3d')]=qs['filters'](_[_0x3c8f('0x3e')](_0x1b922c[_0x3c8f('0x34')],_0x180ee5[_0x3c8f('0x3f')]),_0x433179);if(_0x1b922c[_0x3c8f('0x34')][_0x3c8f('0x40')]){_0x2a0520[_0x3c8f('0x3d')]=_['merge'](_0x2a0520[_0x3c8f('0x3d')],{'$or':_[_0x3c8f('0x2e')](_0x433179,function(_0x3d1557){if(_0x3d1557[_0x3c8f('0x32')]!==_0x3c8f('0x41')){var _0x14d9e1={};_0x14d9e1[_0x3d1557[_0x3c8f('0x2c')]]={'$like':'%'+_0x1b922c[_0x3c8f('0x34')]['filter']+'%'};return _0x14d9e1;}})});}_0x2a0520=_['merge']({},_0x2a0520,_0x1b922c[_0x3c8f('0x42')]);var _0x3afc45={'where':_0x2a0520['where']};return db['Interval']['count'](_0x3afc45)[_0x3c8f('0x26')](function(_0x25af7b){_0x25ec46[_0x3c8f('0x20')]=_0x25af7b;if(_0x1b922c[_0x3c8f('0x34')]['includeAll']){_0x2a0520['include']=[{'all':!![]}];}return db[_0x3c8f('0x2f')][_0x3c8f('0x43')](_0x2a0520);})[_0x3c8f('0x26')](function(_0x1b2693){_0x25ec46[_0x3c8f('0x44')]=_0x1b2693;return _0x25ec46;})[_0x3c8f('0x26')](respondWithFilteredResult(_0x449901,_0x2a0520))[_0x3c8f('0x45')](handleError(_0x449901,null));};exports[_0x3c8f('0x46')]=function(_0xc378e,_0x562e92){var _0x2f123f={'raw':!![],'where':{'id':_0xc378e['params']['id']}},_0x1d5ab3={};_0x1d5ab3[_0x3c8f('0x37')]=_[_0x3c8f('0x35')](db[_0x3c8f('0x2f')][_0x3c8f('0x30')]);_0x1d5ab3[_0x3c8f('0x34')]=_[_0x3c8f('0x35')](_0xc378e[_0x3c8f('0x34')]);_0x1d5ab3[_0x3c8f('0x3f')]=_['intersection'](_0x1d5ab3['model'],_0x1d5ab3[_0x3c8f('0x34')]);_0x2f123f[_0x3c8f('0x38')]=_['intersection'](_0x1d5ab3[_0x3c8f('0x37')],qs[_0x3c8f('0x39')](_0xc378e[_0x3c8f('0x34')]['fields']));_0x2f123f[_0x3c8f('0x38')]=_0x2f123f[_0x3c8f('0x38')][_0x3c8f('0x47')]?_0x2f123f[_0x3c8f('0x38')]:_0x1d5ab3['model'];if(_0xc378e[_0x3c8f('0x34')][_0x3c8f('0x48')]){_0x2f123f['include']=[{'all':!![]}];}_0x2f123f=_[_0x3c8f('0x49')]({},_0x2f123f,_0xc378e[_0x3c8f('0x42')]);return db['Interval'][_0x3c8f('0x4a')](_0x2f123f)[_0x3c8f('0x26')](handleEntityNotFound(_0x562e92,null))[_0x3c8f('0x26')](respondWithResult(_0x562e92,null))[_0x3c8f('0x45')](handleError(_0x562e92,null));};exports['create']=function(_0x1eba40,_0x525270){return db['Interval'][_0x3c8f('0x4b')](_0x1eba40[_0x3c8f('0x4c')],{})[_0x3c8f('0x26')](function(_0x54a600){var _0xb595b2=_0x1eba40['user'][_0x3c8f('0x27')]({'plain':!![]});if(!_0xb595b2)throw new Error(_0x3c8f('0x4d'));if(_0xb595b2['role']===_0x3c8f('0x4e')){var _0x2c5f3d=_0x54a600[_0x3c8f('0x27')]({'plain':!![]});var _0x44073c=_0x3c8f('0x28');return db[_0x3c8f('0x4f')]['find']({'where':{'name':_0x44073c,'userProfileId':_0xb595b2[_0x3c8f('0x50')]},'raw':!![]})[_0x3c8f('0x26')](function(_0x4c8772){if(_0x4c8772&&_0x4c8772[_0x3c8f('0x51')]===0x0){return db[_0x3c8f('0x29')][_0x3c8f('0x4b')]({'name':_0x2c5f3d['name'],'resourceId':_0x2c5f3d['id'],'type':_0x4c8772[_0x3c8f('0x2c')],'sectionId':_0x4c8772['id']},{})[_0x3c8f('0x26')](function(){return _0x54a600;});}else{return _0x54a600;}})[_0x3c8f('0x45')](function(_0xb68368){logger['error'](_0x3c8f('0x52'),_0xb68368);throw _0xb68368;});}return _0x54a600;})[_0x3c8f('0x26')](respondWithResult(_0x525270,0xc9))[_0x3c8f('0x45')](handleError(_0x525270,null));};exports['update']=function(_0xa62a89,_0x9ab6eb){if(_0xa62a89[_0x3c8f('0x4c')]['id']){delete _0xa62a89[_0x3c8f('0x4c')]['id'];}return db['Interval']['find']({'where':{'id':_0xa62a89['params']['id']}})[_0x3c8f('0x26')](handleEntityNotFound(_0x9ab6eb,null))[_0x3c8f('0x26')](saveUpdates(_0xa62a89[_0x3c8f('0x4c')],null))[_0x3c8f('0x26')](respondWithResult(_0x9ab6eb,null))[_0x3c8f('0x45')](handleError(_0x9ab6eb,null));};exports[_0x3c8f('0x25')]=function(_0x2df8b3,_0x2b3abb){return db[_0x3c8f('0x2f')]['find']({'where':{'id':_0x2df8b3[_0x3c8f('0x53')]['id']}})[_0x3c8f('0x26')](handleEntityNotFound(_0x2b3abb,null))[_0x3c8f('0x26')](removeEntity(_0x2b3abb,null))[_0x3c8f('0x45')](handleError(_0x2b3abb,null));};exports['addInterval']=function(_0x406641,_0x35fc55,_0x3f79f5){if(_0x406641[_0x3c8f('0x4c')]['id']){delete _0x406641[_0x3c8f('0x4c')]['id'];}return db[_0x3c8f('0x2f')]['find']({'where':{'id':_0x406641[_0x3c8f('0x53')]['id']}})[_0x3c8f('0x26')](handleEntityNotFound(_0x35fc55,null))[_0x3c8f('0x26')](function(_0x4a5f1d){if(_0x4a5f1d){_0x406641[_0x3c8f('0x4c')][_0x3c8f('0x54')]=_0x4a5f1d['id'];return db[_0x3c8f('0x2f')][_0x3c8f('0x4b')](_0x406641[_0x3c8f('0x4c')]);}})['then'](respondWithResult(_0x35fc55,null))[_0x3c8f('0x45')](handleError(_0x35fc55,null));};exports['getIntervals']=function(_0x103d1a,_0x2f1d4d,_0x55571a){var _0x1fa5dc={};var _0x35865f={};var _0x1cbfff;var _0x56ea59;return db[_0x3c8f('0x2f')][_0x3c8f('0x55')]({'where':{'id':_0x103d1a[_0x3c8f('0x53')]['id']}})[_0x3c8f('0x26')](handleEntityNotFound(_0x2f1d4d,null))[_0x3c8f('0x26')](function(_0xd7d579){if(_0xd7d579){_0x1cbfff=_0xd7d579;_0x35865f['model']=_['keys'](db[_0x3c8f('0x2f')][_0x3c8f('0x30')]);_0x35865f[_0x3c8f('0x34')]=_[_0x3c8f('0x35')](_0x103d1a[_0x3c8f('0x34')]);_0x35865f['filters']=_['intersection'](_0x35865f[_0x3c8f('0x37')],_0x35865f[_0x3c8f('0x34')]);_0x1fa5dc[_0x3c8f('0x38')]=_['intersection'](_0x35865f[_0x3c8f('0x37')],qs[_0x3c8f('0x39')](_0x103d1a[_0x3c8f('0x34')][_0x3c8f('0x39')]));_0x1fa5dc[_0x3c8f('0x38')]=_0x1fa5dc[_0x3c8f('0x38')]['length']?_0x1fa5dc[_0x3c8f('0x38')]:_0x35865f['model'];_0x1fa5dc[_0x3c8f('0x56')]=qs[_0x3c8f('0x3c')](_0x103d1a[_0x3c8f('0x34')][_0x3c8f('0x3c')]);_0x1fa5dc[_0x3c8f('0x3d')]=qs[_0x3c8f('0x3f')](_[_0x3c8f('0x3e')](_0x103d1a[_0x3c8f('0x34')],_0x35865f['filters']));if(_0x103d1a[_0x3c8f('0x34')][_0x3c8f('0x40')]){_0x1fa5dc[_0x3c8f('0x3d')]=_['merge'](_0x1fa5dc[_0x3c8f('0x3d')],{'$or':_[_0x3c8f('0x2e')](_0x1fa5dc[_0x3c8f('0x38')],function(_0x72e912){var _0x130375={};_0x130375[_0x72e912]={'$like':'%'+_0x103d1a[_0x3c8f('0x34')]['filter']+'%'};return _0x130375;})});}_0x1fa5dc=_[_0x3c8f('0x49')]({},_0x1fa5dc,_0x103d1a[_0x3c8f('0x42')]);return _0x1cbfff[_0x3c8f('0x57')](_0x1fa5dc);}})[_0x3c8f('0x26')](function(_0x453600){if(_0x453600){_0x56ea59=_0x453600[_0x3c8f('0x47')];if(!_0x103d1a['query'][_0x3c8f('0x3a')](_0x3c8f('0x3b'))){_0x1fa5dc[_0x3c8f('0x1e')]=qs[_0x3c8f('0x1e')](_0x103d1a[_0x3c8f('0x34')][_0x3c8f('0x1e')]);_0x1fa5dc['offset']=qs['offset'](_0x103d1a[_0x3c8f('0x34')]['offset']);}return _0x1cbfff[_0x3c8f('0x57')](_0x1fa5dc);}})[_0x3c8f('0x26')](function(_0x4a3c11){if(_0x4a3c11){return _0x4a3c11?{'count':_0x56ea59,'rows':_0x4a3c11}:null;}})[_0x3c8f('0x26')](respondWithResult(_0x2f1d4d,null))[_0x3c8f('0x45')](handleError(_0x2f1d4d,null));};exports[_0x3c8f('0x58')]=function(_0x4be1a1,_0x2fcbc3,_0x288d8d){return db['Interval'][_0x3c8f('0x55')]({'where':{'id':_0x4be1a1['params']['id']}})[_0x3c8f('0x26')](handleEntityNotFound(_0x2fcbc3,null))[_0x3c8f('0x26')](function(_0x1fbb2d){if(_0x1fbb2d){return db['sequelize'][_0x3c8f('0x59')](function(_0x277141){return db[_0x3c8f('0x2f')][_0x3c8f('0x25')]({'where':{'IntervalId':_0x4be1a1['params']['id']},'transaction':_0x277141})['then'](function(_0x3b6ffa){var _0x531a4c=_[_0x3c8f('0x2e')](_0x4be1a1[_0x3c8f('0x4c')],function(_0x195d81){delete _0x195d81['id'];_0x195d81[_0x3c8f('0x54')]=_0x4be1a1['params']['id'];return _0x195d81;});return db[_0x3c8f('0x2f')][_0x3c8f('0x5a')](_0x531a4c,{'transaction':_0x277141});});})[_0x3c8f('0x26')](function(){return db[_0x3c8f('0x2f')][_0x3c8f('0x43')]({'where':{'IntervalId':_0x4be1a1[_0x3c8f('0x53')]['id']}});});}})[_0x3c8f('0x26')](respondWithResult(_0x2fcbc3,null))[_0x3c8f('0x45')](handleError(_0x2fcbc3,null));};
\ No newline at end of file
index bb035bf..73e9afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51b4=['api','moment','bluebird','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51b4,0x1a1));var _0x451b=function(_0x5eaff5,_0x5e0e35){_0x5eaff5=_0x5eaff5-0x0;var _0x3602ae=_0x51b4[_0x5eaff5];return _0x3602ae;};'use strict';var _=require(_0x451b('0x0'));var util=require(_0x451b('0x1'));var logger=require(_0x451b('0x2'))(_0x451b('0x3'));var moment=require(_0x451b('0x4'));var BPromise=require(_0x451b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x451b('0x6'));var rimraf=require('rimraf');var config=require(_0x451b('0x7'));var attributes=require(_0x451b('0x8'));var extensions=require(_0x451b('0x9'));module[_0x451b('0xa')]=function(_0x279999,_0x2d2106){return _0x279999[_0x451b('0xb')](_0x451b('0xc'),attributes,{'tableName':_0x451b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x10a89c,_0x4d0358){extensions['rewrite'](_0x279999,_0x10a89c);},'afterBulkCreate':function(_0x5ad33d,_0x56ad87,_0x4b010f){_0x4b010f();extensions[_0x451b('0xe')](_0x279999,_0x5ad33d[0x0]);},'afterUpdate':function(_0x2e2c52,_0x28a162){extensions[_0x451b('0xe')](_0x279999,_0x2e2c52);},'afterDestroy':function(_0x19f953,_0x325442){extensions[_0x451b('0xe')](_0x279999,_0x19f953);}}});};
\ No newline at end of file
+var _0x2099=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x442b6b,_0x2856a2){var _0x7cfac0=function(_0x36fd5d){while(--_0x36fd5d){_0x442b6b['push'](_0x442b6b['shift']());}};_0x7cfac0(++_0x2856a2);}(_0x2099,0x140));var _0x9209=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2099[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9209('0x0'));var util=require(_0x9209('0x1'));var logger=require(_0x9209('0x2'))(_0x9209('0x3'));var moment=require(_0x9209('0x4'));var BPromise=require(_0x9209('0x5'));var rp=require(_0x9209('0x6'));var fs=require('fs');var path=require(_0x9209('0x7'));var rimraf=require('rimraf');var config=require(_0x9209('0x8'));var attributes=require(_0x9209('0x9'));var extensions=require(_0x9209('0xa'));module[_0x9209('0xb')]=function(_0x2083f2,_0x211509){return _0x2083f2[_0x9209('0xc')](_0x9209('0xd'),attributes,{'tableName':_0x9209('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1adc13,_0x158f96){extensions[_0x9209('0xf')](_0x2083f2,_0x1adc13);},'afterBulkCreate':function(_0x4e167b,_0xc095b,_0x2aab6d){_0x2aab6d();extensions[_0x9209('0xf')](_0x2083f2,_0x4e167b[0x0]);},'afterUpdate':function(_0x84819f,_0x1b489e){extensions[_0x9209('0xf')](_0x2083f2,_0x84819f);},'afterDestroy':function(_0x1fe4b3,_0x4508e9){extensions[_0x9209('0xf')](_0x2083f2,_0x1fe4b3);}}});};
\ No newline at end of file
index 8c88c69..ef1fce6 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(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 4ac33d8..3d59289 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x5236af,_0x46f4d9){var _0x17758d=function(_0x496fa6){while(--_0x496fa6){_0x5236af['push'](_0x5236af['shift']());}};_0x17758d(++_0x46f4d9);}(_0x2032,0xd9));var _0x2203=function(_0x294394,_0xff3071){_0x294394=_0x294394-0x0;var _0x4720f3=_0x2032[_0x294394];return _0x4720f3;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2ea7a1,_0x447de8){var _0x1488de=function(_0x9f96cb){while(--_0x9f96cb){_0x2ea7a1['push'](_0x2ea7a1['shift']());}};_0x1488de(++_0x447de8);}(_0x2032,0xd9));var _0x2203=function(_0x32658c,_0x4d7ce1){_0x32658c=_0x32658c-0x0;var _0x356001=_0x2032[_0x32658c];return _0x356001;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router;
\ No newline at end of file
index 5c270ed..cae5df3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e31=['/rest/api/2/issue','POST','application/json','toString','setEncoding','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','remoteAddress','socket','connection','https','../../config/logger','api','MOTGUI','description','stringify','issuetype','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','track.xcallymotion.com'];(function(_0x1ff030,_0x3d7fc4){var _0xef9b7f=function(_0x567937){while(--_0x567937){_0x1ff030['push'](_0x1ff030['shift']());}};_0xef9b7f(++_0x3d7fc4);}(_0x0e31,0xb6));var _0x10e3=function(_0x3855f4,_0x16073b){_0x3855f4=_0x3855f4-0x0;var _0x3d4e63=_0x0e31[_0x3855f4];return _0x3d4e63;};'use strict';var BPromise=require('bluebird');var https=require(_0x10e3('0x0'));var logger=require(_0x10e3('0x1'))(_0x10e3('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x3bd1a1,_0x1d51cd){var _0xbcdd39={'fields':{'project':{'key':_0x3bd1a1['key']||_0x10e3('0x3')},'summary':(_0x3bd1a1['summary']||'Report')+'\x20from\x20'+_0x3bd1a1['ip'],'description':_0x3bd1a1[_0x10e3('0x4')]||JSON[_0x10e3('0x5')](_0x3bd1a1),'issuetype':{'name':_0x3bd1a1[_0x10e3('0x6')]||'Bug'}}};_0xbcdd39['fields'][_0x10e3('0x7')]=_0x3bd1a1[_0x10e3('0x8')];_0xbcdd39[_0x10e3('0x9')][_0x10e3('0xa')]=_0x3bd1a1[_0x10e3('0xb')];_0xbcdd39[_0x10e3('0x9')][_0x10e3('0xc')]=_0x3bd1a1[_0x10e3('0xd')];_0xbcdd39['fields'][_0x10e3('0xe')]=_0x3bd1a1[_0x10e3('0xf')];_0xbcdd39['fields'][_0x10e3('0x10')]=_0x3bd1a1['reason'];_0xbcdd39['fields']['customfield_10102']=_0x3bd1a1['ip'];var _0x126698={'host':_0x10e3('0x11'),'port':0x1bb,'path':_0x10e3('0x12'),'method':_0x10e3('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x10e3('0x14'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x10e3('0x15')]('base64')}};var _0x35761a=JSON[_0x10e3('0x5')](_0xbcdd39);var _0x370025=https['request'](_0x126698,function(_0x32bccb){_0x32bccb[_0x10e3('0x16')](_0x10e3('0x17'));var _0x11288f='';_0x32bccb['on'](_0x10e3('0x18'),function(_0x27107c){_0x11288f+=_0x27107c;});_0x32bccb['on'](_0x10e3('0x19'),function(){if(_0x1d51cd){return _0x1d51cd[_0x10e3('0x1a')](_0x32bccb['statusCode'])[_0x10e3('0x1b')](JSON[_0x10e3('0x1c')](_0x11288f));}});});_0x370025['on'](_0x10e3('0x1d'),function(_0x37a450){if(_0x1d51cd){return _0x1d51cd[_0x10e3('0x1a')](0x1f4)['json']({'errors':[{'message':_0x10e3('0x1e'),'type':_0x10e3('0x1f')}]});}});_0x370025[_0x10e3('0x20')](_0x35761a);_0x370025[_0x10e3('0x19')]();}exports[_0x10e3('0x21')]=openIssue;exports[_0x10e3('0x22')]=function(_0x50590d,_0x14df54){_0x50590d[_0x10e3('0x23')]['ip']=_0x50590d['headers'][_0x10e3('0x24')]||_0x50590d['connection'][_0x10e3('0x25')]||_0x50590d[_0x10e3('0x26')]['remoteAddress']||_0x50590d[_0x10e3('0x27')][_0x10e3('0x26')][_0x10e3('0x25')];return openIssue(_0x50590d[_0x10e3('0x23')],_0x14df54);};
\ No newline at end of file
+var _0xb04d=['newToken','name','customfield_11504','customfield_10102','track.xcallymotion.com','Basic\x20','toString','request','setEncoding','utf8','data','end','status','statusCode','json','error','api.jira','write','send','body','headers','x-forwarded-for','remoteAddress','socket','connection','https','../../config/logger','api','support','3eAmWpBVP0','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','fields','customfield_11501','oldToken','customfield_11502'];(function(_0x30054c,_0x3609cd){var _0xf86cd6=function(_0x387e4a){while(--_0x387e4a){_0x30054c['push'](_0x30054c['shift']());}};_0xf86cd6(++_0x3609cd);}(_0xb04d,0x6d));var _0xdb04=function(_0x5a0732,_0x4601b5){_0x5a0732=_0x5a0732-0x0;var _0x31f781=_0xb04d[_0x5a0732];return _0x31f781;};'use strict';var BPromise=require('bluebird');var https=require(_0xdb04('0x0'));var logger=require(_0xdb04('0x1'))(_0xdb04('0x2'));var USERNAME=_0xdb04('0x3');var PASSWORD=_0xdb04('0x4');function openIssue(_0x25568d,_0x14cc0a){var _0xd6ffd6={'fields':{'project':{'key':_0x25568d['key']||'MOTGUI'},'summary':(_0x25568d[_0xdb04('0x5')]||_0xdb04('0x6'))+_0xdb04('0x7')+_0x25568d['ip'],'description':_0x25568d[_0xdb04('0x8')]||JSON[_0xdb04('0x9')](_0x25568d),'issuetype':{'name':_0x25568d[_0xdb04('0xa')]||_0xdb04('0xb')}}};_0xd6ffd6['fields'][_0xdb04('0xc')]=_0x25568d['email'];_0xd6ffd6[_0xdb04('0xd')][_0xdb04('0xe')]=_0x25568d[_0xdb04('0xf')];_0xd6ffd6[_0xdb04('0xd')][_0xdb04('0x10')]=_0x25568d[_0xdb04('0x11')];_0xd6ffd6['fields']['customfield_11503']=_0x25568d[_0xdb04('0x12')];_0xd6ffd6['fields'][_0xdb04('0x13')]=_0x25568d['reason'];_0xd6ffd6[_0xdb04('0xd')][_0xdb04('0x14')]=_0x25568d['ip'];var _0x52a9fa={'host':_0xdb04('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xdb04('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xdb04('0x17')]('base64')}};var _0x2485c0=JSON['stringify'](_0xd6ffd6);var _0x64567b=https[_0xdb04('0x18')](_0x52a9fa,function(_0x15cbbe){_0x15cbbe[_0xdb04('0x19')](_0xdb04('0x1a'));var _0x5a337b='';_0x15cbbe['on'](_0xdb04('0x1b'),function(_0x34d726){_0x5a337b+=_0x34d726;});_0x15cbbe['on'](_0xdb04('0x1c'),function(){if(_0x14cc0a){return _0x14cc0a[_0xdb04('0x1d')](_0x15cbbe[_0xdb04('0x1e')])[_0xdb04('0x1f')](JSON['parse'](_0x5a337b));}});});_0x64567b['on'](_0xdb04('0x20'),function(_0x280b44){if(_0x14cc0a){return _0x14cc0a[_0xdb04('0x1d')](0x1f4)[_0xdb04('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xdb04('0x21')}]});}});_0x64567b[_0xdb04('0x22')](_0x2485c0);_0x64567b['end']();}exports['openIssue']=openIssue;exports[_0xdb04('0x23')]=function(_0x11e47a,_0x72d00a){_0x11e47a[_0xdb04('0x24')]['ip']=_0x11e47a[_0xdb04('0x25')][_0xdb04('0x26')]||_0x11e47a['connection'][_0xdb04('0x27')]||_0x11e47a[_0xdb04('0x28')][_0xdb04('0x27')]||_0x11e47a[_0xdb04('0x29')][_0xdb04('0x28')][_0xdb04('0x27')];return openIssue(_0x11e47a['body'],_0x72d00a);};
\ No newline at end of file
index 95c1c85..2461e6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','describe','get','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x54b7fb,_0x506ac3){var _0x4fb34e=function(_0x938497){while(--_0x938497){_0x54b7fb['push'](_0x54b7fb['shift']());}};_0x4fb34e(++_0x506ac3);}(_0x70e0,0x17b));var _0x070e=function(_0x3865ca,_0x4ef35a){_0x3865ca=_0x3865ca-0x0;var _0x4914df=_0x70e0[_0x3865ca];return _0x4914df;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x070e('0xe')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x11')]);module[_0x070e('0x12')]=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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x702d,0x147));var _0xd702=function(_0x2ca67a,_0x28e3d5){_0x2ca67a=_0x2ca67a-0x0;var _0x3e3540=_0x702d[_0x2ca67a];return _0x3e3540;};'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 96fcb77..45928ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7a54,0x106));var _0x47a5=function(_0x43a313,_0x469b54){_0x43a313=_0x43a313-0x0;var _0x448df4=_0x7a54[_0x43a313];return _0x448df4;};'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(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x3584a9,_0x70ca8e){_0x3584a9=_0x3584a9-0x0;var _0x24cb9f=_0x7a54[_0x3584a9];return _0x24cb9f;};'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 7d7e124..c40bd54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdded=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','then','destroy','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','include','findAll','catch','show','params','length','includeAll','merge','options','find','create','body','describe','eml-format','rimraf'];(function(_0x338c0d,_0x5d2c35){var _0x288058=function(_0x467eb3){while(--_0x467eb3){_0x338c0d['push'](_0x338c0d['shift']());}};_0x288058(++_0x5d2c35);}(_0xdded,0x17a));var _0xddde=function(_0x42d6a2,_0x1738d5){_0x42d6a2=_0x42d6a2-0x0;var _0x17fffc=_0xdded[_0x42d6a2];return _0x17fffc;};'use strict';var emlformat=require(_0xddde('0x0'));var rimraf=require(_0xddde('0x1'));var zipdir=require(_0xddde('0x2'));var jsonpatch=require(_0xddde('0x3'));var rp=require(_0xddde('0x4'));var moment=require(_0xddde('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xddde('0x6'));var util=require(_0xddde('0x7'));var path=require(_0xddde('0x8'));var sox=require(_0xddde('0x9'));var csv=require(_0xddde('0xa'));var ejs=require(_0xddde('0xb'));var fs=require('fs');var fs_extra=require(_0xddde('0xc'));var _=require(_0xddde('0xd'));var squel=require(_0xddde('0xe'));var crypto=require(_0xddde('0xf'));var jsforce=require(_0xddde('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xddde('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xddde('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xddde('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xddde('0x13'))(_0xddde('0x14'));var utils=require(_0xddde('0x15'));var config=require(_0xddde('0x16'));var licenseUtil=require(_0xddde('0x17'));var db=require(_0xddde('0x18'))['db'];function respondWithStatusCode(_0x25fadc,_0x35172e){_0x35172e=_0x35172e||0xcc;return function(_0x57e121){if(_0x57e121){return _0x25fadc[_0xddde('0x19')](_0x35172e);}return _0x25fadc[_0xddde('0x1a')](_0x35172e)[_0xddde('0x1b')]();};}function respondWithResult(_0x860ff4,_0x7cbcee){_0x7cbcee=_0x7cbcee||0xc8;return function(_0x31c111){if(_0x31c111){return _0x860ff4['status'](_0x7cbcee)[_0xddde('0x1c')](_0x31c111);}};}function respondWithFilteredResult(_0xbe1df5,_0x3698d4){return function(_0x48f602){if(_0x48f602){var _0x5de7ce=typeof _0x3698d4[_0xddde('0x1d')]==='undefined'&&typeof _0x3698d4[_0xddde('0x1e')]===_0xddde('0x1f');var _0x338fa7=_0x48f602[_0xddde('0x20')];var _0x2f0e58=_0x5de7ce?0x0:_0x3698d4['offset'];var _0x249f19=_0x5de7ce?_0x48f602[_0xddde('0x20')]:_0x3698d4['offset']+_0x3698d4[_0xddde('0x1e')];var _0x1185f9;if(_0x249f19>=_0x338fa7){_0x249f19=_0x338fa7;_0x1185f9=0xc8;}else{_0x1185f9=0xce;}_0xbe1df5['status'](_0x1185f9);return _0xbe1df5['set'](_0xddde('0x21'),_0x2f0e58+'-'+_0x249f19+'/'+_0x338fa7)['json'](_0x48f602);}return null;};}function patchUpdates(_0x1ef35a){return function(_0x5175bd){try{jsonpatch[_0xddde('0x22')](_0x5175bd,_0x1ef35a,!![]);}catch(_0xea045b){return BPromise['reject'](_0xea045b);}return _0x5175bd['save']();};}function saveUpdates(_0x3cfd91,_0x107bca){return function(_0x97bb0f){if(_0x97bb0f){return _0x97bb0f[_0xddde('0x23')](_0x3cfd91)[_0xddde('0x24')](function(_0xa663e4){return _0xa663e4;});}return null;};}function removeEntity(_0x3bc4bf,_0x56a33a){return function(_0x59320f){if(_0x59320f){return _0x59320f[_0xddde('0x25')]()[_0xddde('0x24')](function(){_0x3bc4bf[_0xddde('0x1a')](0xcc)[_0xddde('0x1b')]();});}};}function handleEntityNotFound(_0xdb57ef,_0x533332){return function(_0x394da0){if(!_0x394da0){_0xdb57ef[_0xddde('0x19')](0x194);}return _0x394da0;};}function handleError(_0x4ca351,_0x4bd409){_0x4bd409=_0x4bd409||0x1f4;return function(_0xa60e85){logger[_0xddde('0x26')](_0xa60e85['stack']);if(_0xa60e85[_0xddde('0x27')]){delete _0xa60e85[_0xddde('0x27')];}_0x4ca351['status'](_0x4bd409)[_0xddde('0x28')](_0xa60e85);};}exports[_0xddde('0x29')]=function(_0x2dd131,_0x32be0f){var _0x477d44={},_0xb5d4b6={},_0x450bac={'count':0x0,'rows':[]};var _0x7c0c18=_[_0xddde('0x2a')](db[_0xddde('0x2b')][_0xddde('0x2c')],function(_0x1ff3e2){return{'name':_0x1ff3e2[_0xddde('0x2d')],'type':_0x1ff3e2[_0xddde('0x2e')][_0xddde('0x2f')]};});_0xb5d4b6[_0xddde('0x30')]=_[_0xddde('0x2a')](_0x7c0c18,_0xddde('0x27'));_0xb5d4b6[_0xddde('0x31')]=_[_0xddde('0x32')](_0x2dd131['query']);_0xb5d4b6['filters']=_[_0xddde('0x33')](_0xb5d4b6[_0xddde('0x30')],_0xb5d4b6[_0xddde('0x31')]);_0x477d44['attributes']=_['intersection'](_0xb5d4b6[_0xddde('0x30')],qs[_0xddde('0x34')](_0x2dd131[_0xddde('0x31')][_0xddde('0x34')]));_0x477d44['attributes']=_0x477d44[_0xddde('0x35')]['length']?_0x477d44[_0xddde('0x35')]:_0xb5d4b6[_0xddde('0x30')];if(!_0x2dd131[_0xddde('0x31')][_0xddde('0x36')](_0xddde('0x37'))){_0x477d44[_0xddde('0x1e')]=qs[_0xddde('0x1e')](_0x2dd131[_0xddde('0x31')][_0xddde('0x1e')]);_0x477d44[_0xddde('0x1d')]=qs[_0xddde('0x1d')](_0x2dd131[_0xddde('0x31')]['offset']);}_0x477d44[_0xddde('0x38')]=qs[_0xddde('0x39')](_0x2dd131['query']['sort']);_0x477d44['where']=qs[_0xddde('0x3a')](_[_0xddde('0x3b')](_0x2dd131[_0xddde('0x31')],_0xb5d4b6[_0xddde('0x3a')]),_0x7c0c18);if(_0x2dd131[_0xddde('0x31')][_0xddde('0x3c')]){_0x477d44[_0xddde('0x3d')]=_['merge'](_0x477d44['where'],{'$or':_[_0xddde('0x2a')](_0x7c0c18,function(_0x5595a7){if(_0x5595a7[_0xddde('0x2e')]!==_0xddde('0x3e')){var _0x4c356a={};_0x4c356a[_0x5595a7[_0xddde('0x27')]]={'$like':'%'+_0x2dd131[_0xddde('0x31')][_0xddde('0x3c')]+'%'};return _0x4c356a;}})});}_0x477d44=_['merge']({},_0x477d44,_0x2dd131['options']);var _0x434868={'where':_0x477d44['where']};return db[_0xddde('0x2b')][_0xddde('0x20')](_0x434868)[_0xddde('0x24')](function(_0x216b12){_0x450bac[_0xddde('0x20')]=_0x216b12;if(_0x2dd131[_0xddde('0x31')]['includeAll']){_0x477d44[_0xddde('0x3f')]=[{'all':!![]}];}return db[_0xddde('0x2b')][_0xddde('0x40')](_0x477d44);})[_0xddde('0x24')](function(_0x10d9d3){_0x450bac['rows']=_0x10d9d3;return _0x450bac;})[_0xddde('0x24')](respondWithFilteredResult(_0x32be0f,_0x477d44))[_0xddde('0x41')](handleError(_0x32be0f,null));};exports[_0xddde('0x42')]=function(_0x3a52b5,_0x21b469){var _0xb0c016={'raw':!![],'where':{'id':_0x3a52b5[_0xddde('0x43')]['id']}},_0x6cbadb={};_0x6cbadb[_0xddde('0x30')]=_['keys'](db[_0xddde('0x2b')]['rawAttributes']);_0x6cbadb[_0xddde('0x31')]=_[_0xddde('0x32')](_0x3a52b5['query']);_0x6cbadb[_0xddde('0x3a')]=_[_0xddde('0x33')](_0x6cbadb[_0xddde('0x30')],_0x6cbadb['query']);_0xb0c016['attributes']=_['intersection'](_0x6cbadb[_0xddde('0x30')],qs[_0xddde('0x34')](_0x3a52b5[_0xddde('0x31')][_0xddde('0x34')]));_0xb0c016['attributes']=_0xb0c016[_0xddde('0x35')][_0xddde('0x44')]?_0xb0c016[_0xddde('0x35')]:_0x6cbadb['model'];if(_0x3a52b5[_0xddde('0x31')][_0xddde('0x45')]){_0xb0c016[_0xddde('0x3f')]=[{'all':!![]}];}_0xb0c016=_[_0xddde('0x46')]({},_0xb0c016,_0x3a52b5[_0xddde('0x47')]);return db['JscriptyAnswerReport'][_0xddde('0x48')](_0xb0c016)['then'](handleEntityNotFound(_0x21b469,null))[_0xddde('0x24')](respondWithResult(_0x21b469,null))['catch'](handleError(_0x21b469,null));};exports[_0xddde('0x49')]=function(_0x3c3c6c,_0x1db505){return db[_0xddde('0x2b')][_0xddde('0x49')](_0x3c3c6c[_0xddde('0x4a')],{})[_0xddde('0x24')](respondWithResult(_0x1db505,0xc9))[_0xddde('0x41')](handleError(_0x1db505,null));};exports['update']=function(_0x3ad9b6,_0x1b4a00){if(_0x3ad9b6[_0xddde('0x4a')]['id']){delete _0x3ad9b6[_0xddde('0x4a')]['id'];}return db[_0xddde('0x2b')][_0xddde('0x48')]({'where':{'id':_0x3ad9b6['params']['id']}})[_0xddde('0x24')](handleEntityNotFound(_0x1b4a00,null))[_0xddde('0x24')](saveUpdates(_0x3ad9b6[_0xddde('0x4a')],null))[_0xddde('0x24')](respondWithResult(_0x1b4a00,null))[_0xddde('0x41')](handleError(_0x1b4a00,null));};exports['destroy']=function(_0x2a8537,_0x42a325){return db[_0xddde('0x2b')][_0xddde('0x48')]({'where':{'id':_0x2a8537[_0xddde('0x43')]['id']}})[_0xddde('0x24')](handleEntityNotFound(_0x42a325,null))[_0xddde('0x24')](removeEntity(_0x42a325,null))[_0xddde('0x41')](handleError(_0x42a325,null));};exports[_0xddde('0x4b')]=function(_0xff548d,_0x43fcf6){return db[_0xddde('0x2b')][_0xddde('0x4b')]()[_0xddde('0x24')](respondWithResult(_0x43fcf6,null))[_0xddde('0x41')](handleError(_0x43fcf6,null));};
\ No newline at end of file
+var _0xd2bb=['destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../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','count','limit','set','Content-Range','apply','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','create','body','find'];(function(_0x17e652,_0x16a06e){var _0x48bcf2=function(_0x1d2c18){while(--_0x1d2c18){_0x17e652['push'](_0x17e652['shift']());}};_0x48bcf2(++_0x16a06e);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x541d1e,_0x52175f){_0x541d1e=_0x541d1e-0x0;var _0x476d5d=_0xd2bb[_0x541d1e];return _0x476d5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd2b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd2b('0x1'));var rp=require(_0xbd2b('0x2'));var moment=require(_0xbd2b('0x3'));var BPromise=require(_0xbd2b('0x4'));var Mustache=require(_0xbd2b('0x5'));var util=require(_0xbd2b('0x6'));var path=require('path');var sox=require(_0xbd2b('0x7'));var csv=require(_0xbd2b('0x8'));var ejs=require(_0xbd2b('0x9'));var fs=require('fs');var fs_extra=require(_0xbd2b('0xa'));var _=require(_0xbd2b('0xb'));var squel=require(_0xbd2b('0xc'));var crypto=require(_0xbd2b('0xd'));var jsforce=require(_0xbd2b('0xe'));var deskjs=require(_0xbd2b('0xf'));var toCsv=require(_0xbd2b('0x8'));var querystring=require('querystring');var Papa=require(_0xbd2b('0x10'));var Redis=require('ioredis');var authService=require(_0xbd2b('0x11'));var qs=require(_0xbd2b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd2b('0x13'));var logger=require(_0xbd2b('0x14'))(_0xbd2b('0x15'));var utils=require(_0xbd2b('0x16'));var config=require(_0xbd2b('0x17'));var licenseUtil=require(_0xbd2b('0x18'));var db=require(_0xbd2b('0x19'))['db'];function respondWithStatusCode(_0x275b60,_0x5722a4){_0x5722a4=_0x5722a4||0xcc;return function(_0x35c2c0){if(_0x35c2c0){return _0x275b60[_0xbd2b('0x1a')](_0x5722a4);}return _0x275b60[_0xbd2b('0x1b')](_0x5722a4)[_0xbd2b('0x1c')]();};}function respondWithResult(_0x29f3d1,_0x5f246b){_0x5f246b=_0x5f246b||0xc8;return function(_0x1ccc21){if(_0x1ccc21){return _0x29f3d1[_0xbd2b('0x1b')](_0x5f246b)[_0xbd2b('0x1d')](_0x1ccc21);}};}function respondWithFilteredResult(_0x1018dc,_0x1815b3){return function(_0x2d8352){if(_0x2d8352){var _0x29c6a6=typeof _0x1815b3[_0xbd2b('0x1e')]===_0xbd2b('0x1f')&&typeof _0x1815b3['limit']===_0xbd2b('0x1f');var _0x268025=_0x2d8352[_0xbd2b('0x20')];var _0x19ee5c=_0x29c6a6?0x0:_0x1815b3[_0xbd2b('0x1e')];var _0x112b5e=_0x29c6a6?_0x2d8352[_0xbd2b('0x20')]:_0x1815b3[_0xbd2b('0x1e')]+_0x1815b3[_0xbd2b('0x21')];var _0x17c63d;if(_0x112b5e>=_0x268025){_0x112b5e=_0x268025;_0x17c63d=0xc8;}else{_0x17c63d=0xce;}_0x1018dc['status'](_0x17c63d);return _0x1018dc[_0xbd2b('0x22')](_0xbd2b('0x23'),_0x19ee5c+'-'+_0x112b5e+'/'+_0x268025)[_0xbd2b('0x1d')](_0x2d8352);}return null;};}function patchUpdates(_0x12d252){return function(_0xc1ce31){try{jsonpatch[_0xbd2b('0x24')](_0xc1ce31,_0x12d252,!![]);}catch(_0x2a66a3){return BPromise['reject'](_0x2a66a3);}return _0xc1ce31['save']();};}function saveUpdates(_0x4a3588,_0x2fb14b){return function(_0x51fd7b){if(_0x51fd7b){return _0x51fd7b[_0xbd2b('0x25')](_0x4a3588)[_0xbd2b('0x26')](function(_0x48d06d){return _0x48d06d;});}return null;};}function removeEntity(_0x5b6b31,_0x1a2b3d){return function(_0x1e3609){if(_0x1e3609){return _0x1e3609['destroy']()['then'](function(){_0x5b6b31['status'](0xcc)[_0xbd2b('0x1c')]();});}};}function handleEntityNotFound(_0x43a7c5,_0x9c5ba7){return function(_0xf22365){if(!_0xf22365){_0x43a7c5[_0xbd2b('0x1a')](0x194);}return _0xf22365;};}function handleError(_0x21ce4d,_0x5bf25b){_0x5bf25b=_0x5bf25b||0x1f4;return function(_0x51e091){logger[_0xbd2b('0x27')](_0x51e091[_0xbd2b('0x28')]);if(_0x51e091['name']){delete _0x51e091[_0xbd2b('0x29')];}_0x21ce4d[_0xbd2b('0x1b')](_0x5bf25b)[_0xbd2b('0x2a')](_0x51e091);};}exports[_0xbd2b('0x2b')]=function(_0x54ad15,_0x21dcd8){var _0x5cb9a0={},_0x28ba11={},_0x364755={'count':0x0,'rows':[]};var _0x32d59c=_[_0xbd2b('0x2c')](db[_0xbd2b('0x2d')][_0xbd2b('0x2e')],function(_0x117c1f){return{'name':_0x117c1f['fieldName'],'type':_0x117c1f[_0xbd2b('0x2f')]['key']};});_0x28ba11[_0xbd2b('0x30')]=_[_0xbd2b('0x2c')](_0x32d59c,'name');_0x28ba11['query']=_[_0xbd2b('0x31')](_0x54ad15[_0xbd2b('0x32')]);_0x28ba11[_0xbd2b('0x33')]=_[_0xbd2b('0x34')](_0x28ba11[_0xbd2b('0x30')],_0x28ba11['query']);_0x5cb9a0[_0xbd2b('0x35')]=_[_0xbd2b('0x34')](_0x28ba11[_0xbd2b('0x30')],qs[_0xbd2b('0x36')](_0x54ad15[_0xbd2b('0x32')][_0xbd2b('0x36')]));_0x5cb9a0[_0xbd2b('0x35')]=_0x5cb9a0['attributes'][_0xbd2b('0x37')]?_0x5cb9a0['attributes']:_0x28ba11['model'];if(!_0x54ad15[_0xbd2b('0x32')][_0xbd2b('0x38')](_0xbd2b('0x39'))){_0x5cb9a0['limit']=qs['limit'](_0x54ad15[_0xbd2b('0x32')][_0xbd2b('0x21')]);_0x5cb9a0[_0xbd2b('0x1e')]=qs[_0xbd2b('0x1e')](_0x54ad15[_0xbd2b('0x32')]['offset']);}_0x5cb9a0[_0xbd2b('0x3a')]=qs[_0xbd2b('0x3b')](_0x54ad15['query'][_0xbd2b('0x3b')]);_0x5cb9a0['where']=qs[_0xbd2b('0x33')](_[_0xbd2b('0x3c')](_0x54ad15[_0xbd2b('0x32')],_0x28ba11[_0xbd2b('0x33')]),_0x32d59c);if(_0x54ad15['query'][_0xbd2b('0x3d')]){_0x5cb9a0[_0xbd2b('0x3e')]=_[_0xbd2b('0x3f')](_0x5cb9a0[_0xbd2b('0x3e')],{'$or':_['map'](_0x32d59c,function(_0xa1134d){if(_0xa1134d['type']!==_0xbd2b('0x40')){var _0x3122da={};_0x3122da[_0xa1134d[_0xbd2b('0x29')]]={'$like':'%'+_0x54ad15[_0xbd2b('0x32')][_0xbd2b('0x3d')]+'%'};return _0x3122da;}})});}_0x5cb9a0=_['merge']({},_0x5cb9a0,_0x54ad15[_0xbd2b('0x41')]);var _0x5050de={'where':_0x5cb9a0[_0xbd2b('0x3e')]};return db['JscriptyAnswerReport'][_0xbd2b('0x20')](_0x5050de)[_0xbd2b('0x26')](function(_0x10ad62){_0x364755[_0xbd2b('0x20')]=_0x10ad62;if(_0x54ad15[_0xbd2b('0x32')][_0xbd2b('0x42')]){_0x5cb9a0['include']=[{'all':!![]}];}return db[_0xbd2b('0x2d')][_0xbd2b('0x43')](_0x5cb9a0);})[_0xbd2b('0x26')](function(_0x4bcdee){_0x364755['rows']=_0x4bcdee;return _0x364755;})['then'](respondWithFilteredResult(_0x21dcd8,_0x5cb9a0))[_0xbd2b('0x44')](handleError(_0x21dcd8,null));};exports[_0xbd2b('0x45')]=function(_0x1c5b08,_0x903b22){var _0x309ad2={'raw':!![],'where':{'id':_0x1c5b08[_0xbd2b('0x46')]['id']}},_0x47b68d={};_0x47b68d['model']=_[_0xbd2b('0x31')](db['JscriptyAnswerReport'][_0xbd2b('0x2e')]);_0x47b68d[_0xbd2b('0x32')]=_[_0xbd2b('0x31')](_0x1c5b08['query']);_0x47b68d['filters']=_[_0xbd2b('0x34')](_0x47b68d['model'],_0x47b68d[_0xbd2b('0x32')]);_0x309ad2[_0xbd2b('0x35')]=_[_0xbd2b('0x34')](_0x47b68d[_0xbd2b('0x30')],qs[_0xbd2b('0x36')](_0x1c5b08[_0xbd2b('0x32')][_0xbd2b('0x36')]));_0x309ad2[_0xbd2b('0x35')]=_0x309ad2['attributes'][_0xbd2b('0x37')]?_0x309ad2['attributes']:_0x47b68d['model'];if(_0x1c5b08['query'][_0xbd2b('0x42')]){_0x309ad2['include']=[{'all':!![]}];}_0x309ad2=_[_0xbd2b('0x3f')]({},_0x309ad2,_0x1c5b08[_0xbd2b('0x41')]);return db[_0xbd2b('0x2d')]['find'](_0x309ad2)[_0xbd2b('0x26')](handleEntityNotFound(_0x903b22,null))['then'](respondWithResult(_0x903b22,null))[_0xbd2b('0x44')](handleError(_0x903b22,null));};exports[_0xbd2b('0x47')]=function(_0x10b28a,_0x2dae90){return db[_0xbd2b('0x2d')][_0xbd2b('0x47')](_0x10b28a['body'],{})[_0xbd2b('0x26')](respondWithResult(_0x2dae90,0xc9))[_0xbd2b('0x44')](handleError(_0x2dae90,null));};exports[_0xbd2b('0x25')]=function(_0x18361d,_0x3cf8be){if(_0x18361d[_0xbd2b('0x48')]['id']){delete _0x18361d[_0xbd2b('0x48')]['id'];}return db['JscriptyAnswerReport'][_0xbd2b('0x49')]({'where':{'id':_0x18361d['params']['id']}})[_0xbd2b('0x26')](handleEntityNotFound(_0x3cf8be,null))[_0xbd2b('0x26')](saveUpdates(_0x18361d[_0xbd2b('0x48')],null))[_0xbd2b('0x26')](respondWithResult(_0x3cf8be,null))[_0xbd2b('0x44')](handleError(_0x3cf8be,null));};exports[_0xbd2b('0x4a')]=function(_0x304d11,_0x35ccf5){return db[_0xbd2b('0x2d')][_0xbd2b('0x49')]({'where':{'id':_0x304d11[_0xbd2b('0x46')]['id']}})['then'](handleEntityNotFound(_0x35ccf5,null))[_0xbd2b('0x26')](removeEntity(_0x35ccf5,null))['catch'](handleError(_0x35ccf5,null));};exports[_0xbd2b('0x4b')]=function(_0x4a88db,_0x21ee9e){return db[_0xbd2b('0x2d')][_0xbd2b('0x4b')]()[_0xbd2b('0x26')](respondWithResult(_0x21ee9e,null))['catch'](handleError(_0x21ee9e,null));};
\ No newline at end of file
index ea888b7..184f475 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfe6=['path','rimraf','../../config/environment','exports','JscriptyAnswerReport','lodash','util','request-promise'];(function(_0xde8a49,_0x266768){var _0x44052d=function(_0x4b6a55){while(--_0x4b6a55){_0xde8a49['push'](_0xde8a49['shift']());}};_0x44052d(++_0x266768);}(_0xcfe6,0x165));var _0x6cfe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfe6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6cfe('0x0'));var util=require(_0x6cfe('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6cfe('0x2'));var fs=require('fs');var path=require(_0x6cfe('0x3'));var rimraf=require(_0x6cfe('0x4'));var config=require(_0x6cfe('0x5'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x6cfe('0x6')]=function(_0x58c6ab,_0x40f30e){return _0x58c6ab['define'](_0x6cfe('0x7'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96c7=['api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','lodash','util','../../config/logger'];(function(_0xcc9483,_0x5adf1b){var _0x927b74=function(_0x5c59f9){while(--_0x5c59f9){_0xcc9483['push'](_0xcc9483['shift']());}};_0x927b74(++_0x5adf1b);}(_0x96c7,0x189));var _0x796c=function(_0xb0ad22,_0x27723b){_0xb0ad22=_0xb0ad22-0x0;var _0x40de30=_0x96c7[_0xb0ad22];return _0x40de30;};'use strict';var _=require(_0x796c('0x0'));var util=require(_0x796c('0x1'));var logger=require(_0x796c('0x2'))(_0x796c('0x3'));var moment=require('moment');var BPromise=require(_0x796c('0x4'));var rp=require(_0x796c('0x5'));var fs=require('fs');var path=require(_0x796c('0x6'));var rimraf=require(_0x796c('0x7'));var config=require(_0x796c('0x8'));var attributes=require(_0x796c('0x9'));module['exports']=function(_0xa66e40,_0x3983f6){return _0xa66e40[_0x796c('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0x796c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8131537..4a2c331 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeccf=['../../config/environment','jayson/promise','client','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x330918,_0x4a4e02){var _0x4a5c3e=function(_0x5ae919){while(--_0x5ae919){_0x330918['push'](_0x330918['shift']());}};_0x4a5c3e(++_0x4a4e02);}(_0xeccf,0x134));var _0xfecc=function(_0x5c374f,_0x328bfe){_0x5c374f=_0x5c374f-0x0;var _0x1b7dd5=_0xeccf[_0x5c374f];return _0x1b7dd5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfecc('0x0'));var BPromise=require(_0xfecc('0x1'));var rs=require(_0xfecc('0x2'));var fs=require('fs');var Redis=require(_0xfecc('0x3'));var db=require(_0xfecc('0x4'))['db'];var utils=require(_0xfecc('0x5'));var logger=require(_0xfecc('0x6'))('rpc');var config=require(_0xfecc('0x7'));var jayson=require(_0xfecc('0x8'));var client=jayson[_0xfecc('0x9')][_0xfecc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28c222,_0x425838,_0x2a6b4b){return new BPromise(function(_0x221212,_0x2cdc45){return client[_0xfecc('0xb')](_0x28c222,_0x2a6b4b)['then'](function(_0x194d07){logger['info'](_0xfecc('0xc'),_0x425838,_0xfecc('0xd'));logger[_0xfecc('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x425838,_0xfecc('0xd'),JSON[_0xfecc('0xf')](_0x194d07));if(_0x194d07[_0xfecc('0x10')]){if(_0x194d07[_0xfecc('0x10')][_0xfecc('0x11')]===0x1f4){logger[_0xfecc('0x10')](_0xfecc('0xc'),_0x425838,_0x194d07['error'][_0xfecc('0x12')]);return _0x2cdc45(_0x194d07[_0xfecc('0x10')][_0xfecc('0x12')]);}logger[_0xfecc('0x10')](_0xfecc('0xc'),_0x425838,_0x194d07['error']['message']);return _0x221212(_0x194d07[_0xfecc('0x10')][_0xfecc('0x12')]);}else{logger[_0xfecc('0x13')](_0xfecc('0xc'),_0x425838,_0xfecc('0xd'));_0x221212(_0x194d07[_0xfecc('0x14')][_0xfecc('0x12')]);}})['catch'](function(_0x3532c8){logger['error'](_0xfecc('0xc'),_0x425838,_0x3532c8);_0x2cdc45(_0x3532c8);});});}
\ No newline at end of file
+var _0x3ae4=['client','request','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise'];(function(_0x21e6da,_0x48a534){var _0x5e0094=function(_0x1b9876){while(--_0x1b9876){_0x21e6da['push'](_0x21e6da['shift']());}};_0x5e0094(++_0x48a534);}(_0x3ae4,0xae));var _0x43ae=function(_0x1d33ea,_0x2c96d3){_0x1d33ea=_0x1d33ea-0x0;var _0x271bca=_0x3ae4[_0x1d33ea];return _0x271bca;};'use strict';var _=require(_0x43ae('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x43ae('0x1'));var rs=require(_0x43ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43ae('0x3'));var logger=require(_0x43ae('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x43ae('0x5'));var client=jayson[_0x43ae('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22e78c,_0x393d61,_0x4444c5){return new BPromise(function(_0x935c39,_0x58a276){return client[_0x43ae('0x7')](_0x22e78c,_0x4444c5)['then'](function(_0x30021e){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x393d61,_0x43ae('0x8'));logger[_0x43ae('0x9')](_0x43ae('0xa'),_0x393d61,_0x43ae('0x8'),JSON['stringify'](_0x30021e));if(_0x30021e['error']){if(_0x30021e[_0x43ae('0xb')][_0x43ae('0xc')]===0x1f4){logger['error'](_0x43ae('0xd'),_0x393d61,_0x30021e[_0x43ae('0xb')][_0x43ae('0xe')]);return _0x58a276(_0x30021e[_0x43ae('0xb')][_0x43ae('0xe')]);}logger[_0x43ae('0xb')](_0x43ae('0xd'),_0x393d61,_0x30021e[_0x43ae('0xb')][_0x43ae('0xe')]);return _0x935c39(_0x30021e['error'][_0x43ae('0xe')]);}else{logger[_0x43ae('0xf')](_0x43ae('0xd'),_0x393d61,_0x43ae('0x8'));_0x935c39(_0x30021e[_0x43ae('0x10')][_0x43ae('0xe')]);}})[_0x43ae('0x11')](function(_0x22e2d7){logger['error'](_0x43ae('0xd'),_0x393d61,_0x22e2d7);_0x58a276(_0x22e2d7);});});}
\ No newline at end of file
index 7d7e405..7a81a64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd05a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','/:id','isAuthenticated','get','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x5ec8b0,_0xe832f3){var _0x388a10=function(_0x467e67){while(--_0x467e67){_0x5ec8b0['push'](_0x5ec8b0['shift']());}};_0x388a10(++_0xe832f3);}(_0xd05a,0xdb));var _0xad05=function(_0x22e610,_0x109f47){_0x22e610=_0x22e610-0x0;var _0x3ed9ad=_0xd05a[_0x22e610];return _0x3ed9ad;};'use strict';var multer=require(_0xad05('0x0'));var util=require(_0xad05('0x1'));var path=require('path');var timeout=require(_0xad05('0x2'));var express=require('express');var router=express[_0xad05('0x3')]();var fs_extra=require(_0xad05('0x4'));var auth=require(_0xad05('0x5'));var interaction=require(_0xad05('0x6'));var config=require(_0xad05('0x7'));var controller=require(_0xad05('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xad05('0x9')]);router['get'](_0xad05('0xa'),auth[_0xad05('0xb')](),controller['show']);router[_0xad05('0xc')](_0xad05('0xd'),auth['isAuthenticated'](),controller[_0xad05('0xe')]);router['get'](_0xad05('0xf'),auth[_0xad05('0xb')](),controller[_0xad05('0x10')]);router[_0xad05('0xc')](_0xad05('0x11'),auth[_0xad05('0xb')](),timeout(_0xad05('0x12')),controller['getSummary']);router[_0xad05('0x13')]('/',auth[_0xad05('0xb')](),controller[_0xad05('0x14')]);router[_0xad05('0x13')](_0xad05('0x15'),auth[_0xad05('0xb')](),controller[_0xad05('0x16')]);router[_0xad05('0x17')](_0xad05('0xa'),auth[_0xad05('0xb')](),controller[_0xad05('0x18')]);router[_0xad05('0x19')]('/:id',auth[_0xad05('0xb')](),controller[_0xad05('0x1a')]);module[_0xad05('0x1b')]=router;
\ No newline at end of file
+var _0x9cbf=['./jscriptyProject.controller','get','isAuthenticated','index','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','put','/:id','update','delete','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3700d9,_0x52962f){var _0x1cd957=function(_0x5861cd){while(--_0x5861cd){_0x3700d9['push'](_0x3700d9['shift']());}};_0x1cd957(++_0x52962f);}(_0x9cbf,0x170));var _0xf9cb=function(_0x742573,_0x3eaa5d){_0x742573=_0x742573-0x0;var _0xedb17a=_0x9cbf[_0x742573];return _0xedb17a;};'use strict';var multer=require(_0xf9cb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf9cb('0x1'));var express=require(_0xf9cb('0x2'));var router=express['Router']();var fs_extra=require(_0xf9cb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf9cb('0x4'));var config=require(_0xf9cb('0x5'));var controller=require(_0xf9cb('0x6'));router[_0xf9cb('0x7')]('/',auth[_0xf9cb('0x8')](),controller[_0xf9cb('0x9')]);router[_0xf9cb('0x7')]('/:id',auth[_0xf9cb('0x8')](),controller['show']);router[_0xf9cb('0x7')]('/:id/sessions',auth[_0xf9cb('0x8')](),controller[_0xf9cb('0xa')]);router[_0xf9cb('0x7')]('/:id/answers',auth[_0xf9cb('0x8')](),controller[_0xf9cb('0xb')]);router[_0xf9cb('0x7')](_0xf9cb('0xc'),auth[_0xf9cb('0x8')](),timeout(_0xf9cb('0xd')),controller[_0xf9cb('0xe')]);router[_0xf9cb('0xf')]('/',auth['isAuthenticated'](),controller[_0xf9cb('0x10')]);router[_0xf9cb('0xf')](_0xf9cb('0x11'),auth[_0xf9cb('0x8')](),controller['clone']);router[_0xf9cb('0x12')](_0xf9cb('0x13'),auth[_0xf9cb('0x8')](),controller[_0xf9cb('0x14')]);router[_0xf9cb('0x15')](_0xf9cb('0x13'),auth[_0xf9cb('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 22d9af8..5450ff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24db=['exports','STRING','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util'];(function(_0x581604,_0x323093){var _0x26c1e7=function(_0x3a8a18){while(--_0x3a8a18){_0x581604['push'](_0x581604['shift']());}};_0x26c1e7(++_0x323093);}(_0x24db,0x124));var _0xb24d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24db[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb24d('0x0'));var _=require('lodash');var util=require(_0xb24d('0x1'));module[_0xb24d('0x2')]={'name':{'type':Sequelize[_0xb24d('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb24d('0x4')),'set':function(_0x30b10e){if(_['isObjectLike'](_0x30b10e)){this[_0xb24d('0x5')](_0xb24d('0x6'),JSON[_0xb24d('0x7')](_0x30b10e));}else if(_[_0xb24d('0x8')](_0x30b10e)){this[_0xb24d('0x5')]('formData',_0x30b10e);}else{this[_0xb24d('0x5')](_0xb24d('0x6'),util[_0xb24d('0x9')](_0xb24d('0xa'),this[_0xb24d('0xb')]('name')||'',this[_0xb24d('0xb')](_0xb24d('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb24d('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x548e=['description','BOOLEAN','STRING','name','TEXT','long','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x548e,0x13a));var _0xe548=function(_0x42d2c1,_0x21db77){_0x42d2c1=_0x42d2c1-0x0;var _0x574988=_0x548e[_0x42d2c1];return _0x574988;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0xe548('0x0')],'unique':_0xe548('0x1')},'description':{'type':Sequelize[_0xe548('0x0')]},'formData':{'type':Sequelize[_0xe548('0x2')](_0xe548('0x3')),'set':function(_0x4a2f5c){if(_['isObjectLike'](_0x4a2f5c)){this['setDataValue'](_0xe548('0x4'),JSON['stringify'](_0x4a2f5c));}else if(_[_0xe548('0x5')](_0x4a2f5c)){this['setDataValue'](_0xe548('0x4'),_0x4a2f5c);}else{this[_0xe548('0x6')](_0xe548('0x4'),util[_0xe548('0x7')](_0xe548('0x8'),this['getDataValue'](_0xe548('0x1'))||'',this[_0xe548('0x9')](_0xe548('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe548('0xb')],'defaultValue':![]}};
\ No newline at end of file
index 6613af0..82e691d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a21=['question','starttime','format','SessionId','isEmpty','writeFileSync','attachment;\x20filename=','setHeader','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Projects','UserProfileResource','then','end','error','index','JscriptyProject','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','role','getSessions','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId'];(function(_0x3c02c0,_0x370073){var _0xb65fb9=function(_0x29d5a2){while(--_0x29d5a2){_0x3c02c0['push'](_0x3c02c0['shift']());}};_0xb65fb9(++_0x370073);}(_0x1a21,0x1d9));var _0x11a2=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0x1a21[_0x2d8f6c];return _0x3a00f6;};'use strict';var emlformat=require(_0x11a2('0x0'));var rimraf=require(_0x11a2('0x1'));var zipdir=require(_0x11a2('0x2'));var jsonpatch=require(_0x11a2('0x3'));var rp=require(_0x11a2('0x4'));var moment=require(_0x11a2('0x5'));var BPromise=require(_0x11a2('0x6'));var Mustache=require(_0x11a2('0x7'));var util=require(_0x11a2('0x8'));var path=require(_0x11a2('0x9'));var sox=require(_0x11a2('0xa'));var csv=require('to-csv');var ejs=require(_0x11a2('0xb'));var fs=require('fs');var fs_extra=require(_0x11a2('0xc'));var _=require(_0x11a2('0xd'));var squel=require(_0x11a2('0xe'));var crypto=require(_0x11a2('0xf'));var jsforce=require(_0x11a2('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x11a2('0x11'));var querystring=require(_0x11a2('0x12'));var Papa=require(_0x11a2('0x13'));var Redis=require(_0x11a2('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x11a2('0x15'));var as=require(_0x11a2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x11a2('0x17'));var utils=require('../../config/utils');var config=require(_0x11a2('0x18'));var licenseUtil=require(_0x11a2('0x19'));var db=require(_0x11a2('0x1a'))['db'];function respondWithStatusCode(_0x5140ba,_0x357a0c){_0x357a0c=_0x357a0c||0xcc;return function(_0x2782f2){if(_0x2782f2){return _0x5140ba[_0x11a2('0x1b')](_0x357a0c);}return _0x5140ba['status'](_0x357a0c)['end']();};}function respondWithResult(_0x8a8a32,_0x1311e3){_0x1311e3=_0x1311e3||0xc8;return function(_0x48589e){if(_0x48589e){return _0x8a8a32[_0x11a2('0x1c')](_0x1311e3)[_0x11a2('0x1d')](_0x48589e);}};}function respondWithFilteredResult(_0x19063e,_0xd8878b){return function(_0x2e2899){if(_0x2e2899){var _0x162775=typeof _0xd8878b[_0x11a2('0x1e')]===_0x11a2('0x1f')&&typeof _0xd8878b[_0x11a2('0x20')]===_0x11a2('0x1f');var _0x42a318=_0x2e2899[_0x11a2('0x21')];var _0x2c1745=_0x162775?0x0:_0xd8878b['offset'];var _0x2764b9=_0x162775?_0x2e2899[_0x11a2('0x21')]:_0xd8878b[_0x11a2('0x1e')]+_0xd8878b['limit'];var _0x2805e8;if(_0x2764b9>=_0x42a318){_0x2764b9=_0x42a318;_0x2805e8=0xc8;}else{_0x2805e8=0xce;}_0x19063e[_0x11a2('0x1c')](_0x2805e8);return _0x19063e[_0x11a2('0x22')](_0x11a2('0x23'),_0x2c1745+'-'+_0x2764b9+'/'+_0x42a318)[_0x11a2('0x1d')](_0x2e2899);}return null;};}function patchUpdates(_0x16ad25){return function(_0x49aef0){try{jsonpatch[_0x11a2('0x24')](_0x49aef0,_0x16ad25,!![]);}catch(_0x3b1239){return BPromise[_0x11a2('0x25')](_0x3b1239);}return _0x49aef0[_0x11a2('0x26')]();};}function saveUpdates(_0x41e5b9,_0x4047da){return function(_0x5d427e){if(_0x5d427e){return _0x5d427e[_0x11a2('0x27')](_0x41e5b9)['then'](function(_0x5ae102){return _0x5ae102;});}return null;};}function removeEntity(_0x2761b1,_0x509b4b){return function(_0x69ec99){if(_0x69ec99){return _0x69ec99[_0x11a2('0x28')]()['then'](function(){var _0x1348a4=_0x69ec99[_0x11a2('0x29')]({'plain':!![]});var _0xe913b5=_0x11a2('0x2a');return db[_0x11a2('0x2b')]['destroy']({'where':{'type':_0xe913b5,'resourceId':_0x1348a4['id']}})[_0x11a2('0x2c')](function(){return _0x69ec99;});})[_0x11a2('0x2c')](function(){_0x2761b1[_0x11a2('0x1c')](0xcc)[_0x11a2('0x2d')]();});}};}function handleEntityNotFound(_0x346f0c,_0x5d79b6){return function(_0x36c2ad){if(!_0x36c2ad){_0x346f0c[_0x11a2('0x1b')](0x194);}return _0x36c2ad;};}function handleError(_0x3a39af,_0x1cb6ad){_0x1cb6ad=_0x1cb6ad||0x1f4;return function(_0x4879db){logger[_0x11a2('0x2e')](_0x4879db['stack']);if(_0x4879db['name']){delete _0x4879db['name'];}_0x3a39af[_0x11a2('0x1c')](_0x1cb6ad)['send'](_0x4879db);};}exports[_0x11a2('0x2f')]=function(_0x30eaaa,_0x22ad24){var _0x24ac23={},_0x41a277={},_0x2ae261={'count':0x0,'rows':[]};var _0xc06b35=_['map'](db[_0x11a2('0x30')]['rawAttributes'],function(_0x592347){return{'name':_0x592347[_0x11a2('0x31')],'type':_0x592347[_0x11a2('0x32')][_0x11a2('0x33')]};});_0x41a277[_0x11a2('0x34')]=_[_0x11a2('0x35')](_0xc06b35,_0x11a2('0x36'));_0x41a277[_0x11a2('0x37')]=_[_0x11a2('0x38')](_0x30eaaa['query']);_0x41a277[_0x11a2('0x39')]=_[_0x11a2('0x3a')](_0x41a277[_0x11a2('0x34')],_0x41a277[_0x11a2('0x37')]);_0x24ac23[_0x11a2('0x3b')]=_[_0x11a2('0x3a')](_0x41a277[_0x11a2('0x34')],qs[_0x11a2('0x3c')](_0x30eaaa[_0x11a2('0x37')][_0x11a2('0x3c')]));_0x24ac23[_0x11a2('0x3b')]=_0x24ac23[_0x11a2('0x3b')][_0x11a2('0x3d')]?_0x24ac23[_0x11a2('0x3b')]:_0x41a277[_0x11a2('0x34')];if(!_0x30eaaa['query'][_0x11a2('0x3e')](_0x11a2('0x3f'))){_0x24ac23[_0x11a2('0x20')]=qs[_0x11a2('0x20')](_0x30eaaa['query'][_0x11a2('0x20')]);_0x24ac23['offset']=qs['offset'](_0x30eaaa['query'][_0x11a2('0x1e')]);}_0x24ac23[_0x11a2('0x40')]=qs['sort'](_0x30eaaa['query'][_0x11a2('0x41')]);_0x24ac23[_0x11a2('0x42')]=qs[_0x11a2('0x39')](_[_0x11a2('0x43')](_0x30eaaa[_0x11a2('0x37')],_0x41a277[_0x11a2('0x39')]),_0xc06b35);if(_0x30eaaa[_0x11a2('0x37')][_0x11a2('0x44')]){_0x24ac23[_0x11a2('0x42')]=_[_0x11a2('0x45')](_0x24ac23[_0x11a2('0x42')],{'$or':_[_0x11a2('0x35')](_0xc06b35,function(_0x5e4e50){if(_0x5e4e50[_0x11a2('0x32')]!=='VIRTUAL'){var _0x209852={};_0x209852[_0x5e4e50[_0x11a2('0x36')]]={'$like':'%'+_0x30eaaa['query']['filter']+'%'};return _0x209852;}})});}_0x24ac23=_[_0x11a2('0x45')]({},_0x24ac23,_0x30eaaa[_0x11a2('0x46')]);var _0x3d0de2={'where':_0x24ac23[_0x11a2('0x42')]};return db[_0x11a2('0x30')][_0x11a2('0x21')](_0x3d0de2)[_0x11a2('0x2c')](function(_0x521c4f){_0x2ae261[_0x11a2('0x21')]=_0x521c4f;if(_0x30eaaa['query'][_0x11a2('0x47')]){_0x24ac23[_0x11a2('0x48')]=[{'all':!![]}];}return db[_0x11a2('0x30')][_0x11a2('0x49')](_0x24ac23);})[_0x11a2('0x2c')](function(_0x3bd8ed){_0x2ae261[_0x11a2('0x4a')]=_0x3bd8ed;return _0x2ae261;})[_0x11a2('0x2c')](respondWithFilteredResult(_0x22ad24,_0x24ac23))[_0x11a2('0x4b')](handleError(_0x22ad24,null));};exports[_0x11a2('0x4c')]=function(_0x464aab,_0x255b37){var _0x2c30c8={'raw':![],'where':{'id':_0x464aab[_0x11a2('0x4d')]['id']}},_0x143e5c={};_0x143e5c[_0x11a2('0x34')]=_['keys'](db[_0x11a2('0x30')][_0x11a2('0x4e')]);_0x143e5c[_0x11a2('0x37')]=_[_0x11a2('0x38')](_0x464aab[_0x11a2('0x37')]);_0x143e5c[_0x11a2('0x39')]=_[_0x11a2('0x3a')](_0x143e5c[_0x11a2('0x34')],_0x143e5c[_0x11a2('0x37')]);_0x2c30c8[_0x11a2('0x3b')]=_[_0x11a2('0x3a')](_0x143e5c[_0x11a2('0x34')],qs[_0x11a2('0x3c')](_0x464aab[_0x11a2('0x37')][_0x11a2('0x3c')]));_0x2c30c8[_0x11a2('0x3b')]=_0x2c30c8[_0x11a2('0x3b')][_0x11a2('0x3d')]?_0x2c30c8[_0x11a2('0x3b')]:_0x143e5c[_0x11a2('0x34')];if(_0x464aab[_0x11a2('0x37')][_0x11a2('0x47')]){_0x2c30c8[_0x11a2('0x48')]=[{'all':!![]}];}_0x2c30c8=_[_0x11a2('0x45')]({},_0x2c30c8,_0x464aab[_0x11a2('0x46')]);return db[_0x11a2('0x30')][_0x11a2('0x4f')](_0x2c30c8)[_0x11a2('0x2c')](handleEntityNotFound(_0x255b37,null))['then'](respondWithResult(_0x255b37,null))[_0x11a2('0x4b')](handleError(_0x255b37,null));};exports['create']=function(_0x2f6954,_0x12775c){return db[_0x11a2('0x30')][_0x11a2('0x50')](_0x2f6954[_0x11a2('0x51')],{})[_0x11a2('0x2c')](function(_0x211c0e){var _0x59297a=_0x2f6954[_0x11a2('0x52')][_0x11a2('0x29')]({'plain':!![]});if(!_0x59297a)throw new Error(_0x11a2('0x53'));if(_0x59297a['role']===_0x11a2('0x52')){var _0x38db03=_0x211c0e[_0x11a2('0x29')]({'plain':!![]});var _0x53e06c=_0x11a2('0x2a');return db[_0x11a2('0x54')]['find']({'where':{'name':_0x53e06c,'userProfileId':_0x59297a[_0x11a2('0x55')]},'raw':!![]})['then'](function(_0x1a061f){if(_0x1a061f&&_0x1a061f[_0x11a2('0x56')]===0x0){return db[_0x11a2('0x2b')][_0x11a2('0x50')]({'name':_0x38db03[_0x11a2('0x36')],'resourceId':_0x38db03['id'],'type':_0x1a061f[_0x11a2('0x36')],'sectionId':_0x1a061f['id']},{})[_0x11a2('0x2c')](function(){return _0x211c0e;});}else{return _0x211c0e;}})[_0x11a2('0x4b')](function(_0xffdcf0){logger[_0x11a2('0x2e')](_0x11a2('0x57'),_0xffdcf0);throw _0xffdcf0;});}return _0x211c0e;})[_0x11a2('0x2c')](respondWithResult(_0x12775c,0xc9))[_0x11a2('0x4b')](handleError(_0x12775c,null));};exports['clone']=function(_0x27ffb6,_0x595185){var _0x4ee492={'where':{'id':_0x27ffb6[_0x11a2('0x4d')]['id']}},_0x4f1334={};_0x4f1334['model']=_[_0x11a2('0x38')](db[_0x11a2('0x30')][_0x11a2('0x4e')]);_0x4ee492[_0x11a2('0x3b')]=_[_0x11a2('0x3a')](_0x4f1334[_0x11a2('0x34')],qs[_0x11a2('0x3c')](_0x27ffb6[_0x11a2('0x37')][_0x11a2('0x3c')]));_0x4ee492[_0x11a2('0x3b')]=_0x4ee492[_0x11a2('0x3b')][_0x11a2('0x3d')]?_0x4ee492[_0x11a2('0x3b')]:_0x4f1334[_0x11a2('0x34')];if(_0x27ffb6[_0x11a2('0x37')]['includeAll']){_0x4ee492[_0x11a2('0x48')]=[{'all':!![]}];}_0x4ee492=_['merge']({},_0x4ee492,_0x27ffb6[_0x11a2('0x46')]);return db[_0x11a2('0x30')][_0x11a2('0x4f')](_0x4ee492)[_0x11a2('0x2c')](handleEntityNotFound(_0x595185,null))[_0x11a2('0x2c')](function(_0x368b3a){if(_0x368b3a){var _0x583ea9=_0x368b3a[_0x11a2('0x29')]({'plain':!![]});_0x583ea9=qs['omit'](_0x583ea9,['id',_0x11a2('0x58'),_0x11a2('0x59')]);_0x27ffb6[_0x11a2('0x51')]=_[_0x11a2('0x5a')](_0x27ffb6[_0x11a2('0x51')],['id','createdAt',_0x11a2('0x59')]);return db[_0x11a2('0x30')][_0x11a2('0x50')](_['merge'](_0x583ea9,_0x27ffb6[_0x11a2('0x51')]),{'include':_0x27ffb6[_0x11a2('0x37')][_0x11a2('0x47')]?[{'all':!![]}]:undefined})[_0x11a2('0x2c')](function(_0x3dec9f){var _0x2aa8f8=_0x27ffb6[_0x11a2('0x52')]['get']({'plain':!![]});if(!_0x2aa8f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2aa8f8[_0x11a2('0x5b')]==='user'){var _0x5340fb=_0x3dec9f[_0x11a2('0x29')]({'plain':!![]});var _0x72b542='Projects';return db[_0x11a2('0x54')][_0x11a2('0x4f')]({'where':{'name':_0x72b542,'userProfileId':_0x2aa8f8['userProfileId']},'raw':!![]})[_0x11a2('0x2c')](function(_0x1000fa){if(_0x1000fa&&_0x1000fa[_0x11a2('0x56')]===0x0){return db[_0x11a2('0x2b')][_0x11a2('0x50')]({'name':_0x5340fb[_0x11a2('0x36')],'resourceId':_0x5340fb['id'],'type':_0x1000fa['name'],'sectionId':_0x1000fa['id']},{})[_0x11a2('0x2c')](function(){return _0x3dec9f;});}else{return _0x3dec9f;}})[_0x11a2('0x4b')](function(_0x2fa9f3){logger[_0x11a2('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fa9f3);throw _0x2fa9f3;});}return _0x3dec9f;});}})[_0x11a2('0x2c')](respondWithResult(_0x595185,0xc9))['catch'](handleError(_0x595185,null));};exports[_0x11a2('0x27')]=function(_0x49b101,_0x38a83a){if(_0x49b101['body']['id']){delete _0x49b101[_0x11a2('0x51')]['id'];}return db[_0x11a2('0x30')]['find']({'where':{'id':_0x49b101[_0x11a2('0x4d')]['id']}})[_0x11a2('0x2c')](handleEntityNotFound(_0x38a83a,null))[_0x11a2('0x2c')](saveUpdates(_0x49b101[_0x11a2('0x51')],null))[_0x11a2('0x2c')](respondWithResult(_0x38a83a,null))[_0x11a2('0x4b')](handleError(_0x38a83a,null));};exports[_0x11a2('0x28')]=function(_0x6b7dfc,_0x25718b){return db[_0x11a2('0x30')][_0x11a2('0x4f')]({'where':{'id':_0x6b7dfc[_0x11a2('0x4d')]['id']}})[_0x11a2('0x2c')](handleEntityNotFound(_0x25718b,null))[_0x11a2('0x2c')](removeEntity(_0x25718b,null))[_0x11a2('0x4b')](handleError(_0x25718b,null));};exports[_0x11a2('0x5c')]=function(_0x517e47,_0x41af0f,_0x48284c){var _0x143365={'raw':!![],'where':{}};var _0x401b2c={};var _0x594554={'count':0x0,'rows':[]};return db[_0x11a2('0x30')][_0x11a2('0x5d')]({'where':{'id':_0x517e47[_0x11a2('0x4d')]['id']}})[_0x11a2('0x2c')](handleEntityNotFound(_0x41af0f,null))[_0x11a2('0x2c')](function(_0x43a692){if(_0x43a692){_0x401b2c[_0x11a2('0x34')]=_[_0x11a2('0x38')](db[_0x11a2('0x5e')][_0x11a2('0x4e')]);_0x401b2c[_0x11a2('0x37')]=_['keys'](_0x517e47[_0x11a2('0x37')]);_0x401b2c[_0x11a2('0x39')]=_[_0x11a2('0x3a')](_0x401b2c[_0x11a2('0x34')],_0x401b2c[_0x11a2('0x37')]);_0x143365[_0x11a2('0x3b')]=_[_0x11a2('0x3a')](_0x401b2c[_0x11a2('0x34')],qs['fields'](_0x517e47[_0x11a2('0x37')][_0x11a2('0x3c')]));_0x143365[_0x11a2('0x3b')]=_0x143365['attributes'][_0x11a2('0x3d')]?_0x143365[_0x11a2('0x3b')]:_0x401b2c[_0x11a2('0x34')];if(!_0x517e47[_0x11a2('0x37')][_0x11a2('0x3e')](_0x11a2('0x3f'))){_0x143365[_0x11a2('0x20')]=qs[_0x11a2('0x20')](_0x517e47[_0x11a2('0x37')][_0x11a2('0x20')]);_0x143365['offset']=qs['offset'](_0x517e47[_0x11a2('0x37')][_0x11a2('0x1e')]);}_0x143365[_0x11a2('0x40')]=qs['sort'](_0x517e47[_0x11a2('0x37')]['sort']);_0x143365[_0x11a2('0x42')]=qs[_0x11a2('0x39')](_[_0x11a2('0x43')](_0x517e47[_0x11a2('0x37')],_0x401b2c['filters']));_0x143365[_0x11a2('0x42')][_0x11a2('0x5f')]=_0x43a692['id'];if(_0x517e47[_0x11a2('0x37')][_0x11a2('0x44')]){_0x143365[_0x11a2('0x42')]=_[_0x11a2('0x45')](_0x143365[_0x11a2('0x42')],{'$or':_['map'](_0x143365[_0x11a2('0x3b')],function(_0xc49063){var _0x54110f={};_0x54110f[_0xc49063]={'$like':'%'+_0x517e47['query'][_0x11a2('0x44')]+'%'};return _0x54110f;})});}_0x143365=_['merge']({},_0x143365,_0x517e47[_0x11a2('0x46')]);return db[_0x11a2('0x5e')][_0x11a2('0x21')]({'where':_0x143365[_0x11a2('0x42')]})[_0x11a2('0x2c')](function(_0x295070){_0x594554['count']=_0x295070;if(_0x517e47[_0x11a2('0x37')][_0x11a2('0x47')]){_0x143365['include']=[{'all':!![]}];}return db[_0x11a2('0x5e')][_0x11a2('0x49')](_0x143365);})[_0x11a2('0x2c')](function(_0x4d05c6){_0x594554['rows']=_0x4d05c6;return _0x594554;});}})[_0x11a2('0x2c')](respondWithFilteredResult(_0x41af0f,_0x143365))[_0x11a2('0x4b')](handleError(_0x41af0f,null));};exports['getAnswers']=function(_0x32fcc3,_0x1d09ad,_0x251b3c){var _0x560183={'raw':!![],'where':{}};var _0x309505={};var _0x5984c3={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x11a2('0x5d')]({'where':{'id':_0x32fcc3[_0x11a2('0x4d')]['id']}})[_0x11a2('0x2c')](handleEntityNotFound(_0x1d09ad,null))[_0x11a2('0x2c')](function(_0x2dc7ad){if(_0x2dc7ad){_0x309505[_0x11a2('0x34')]=_['keys'](db[_0x11a2('0x60')]['rawAttributes']);_0x309505[_0x11a2('0x37')]=_[_0x11a2('0x38')](_0x32fcc3[_0x11a2('0x37')]);_0x309505[_0x11a2('0x39')]=_[_0x11a2('0x3a')](_0x309505[_0x11a2('0x34')],_0x309505['query']);_0x560183[_0x11a2('0x3b')]=_[_0x11a2('0x3a')](_0x309505[_0x11a2('0x34')],qs['fields'](_0x32fcc3[_0x11a2('0x37')][_0x11a2('0x3c')]));_0x560183[_0x11a2('0x3b')]=_0x560183[_0x11a2('0x3b')][_0x11a2('0x3d')]?_0x560183[_0x11a2('0x3b')]:_0x309505['model'];if(!_0x32fcc3[_0x11a2('0x37')][_0x11a2('0x3e')](_0x11a2('0x3f'))){_0x560183[_0x11a2('0x20')]=qs[_0x11a2('0x20')](_0x32fcc3[_0x11a2('0x37')]['limit']);_0x560183['offset']=qs[_0x11a2('0x1e')](_0x32fcc3['query']['offset']);}_0x560183['order']=qs[_0x11a2('0x41')](_0x32fcc3['query'][_0x11a2('0x41')]);_0x560183[_0x11a2('0x42')]=qs['filters'](_['pick'](_0x32fcc3[_0x11a2('0x37')],_0x309505[_0x11a2('0x39')]));_0x560183[_0x11a2('0x42')][_0x11a2('0x5f')]=_0x2dc7ad['id'];if(_0x32fcc3[_0x11a2('0x37')][_0x11a2('0x44')]){_0x560183[_0x11a2('0x42')]=_['merge'](_0x560183[_0x11a2('0x42')],{'$or':_[_0x11a2('0x35')](_0x560183[_0x11a2('0x3b')],function(_0x456701){var _0x4053db={};_0x4053db[_0x456701]={'$like':'%'+_0x32fcc3['query'][_0x11a2('0x44')]+'%'};return _0x4053db;})});}_0x560183=_[_0x11a2('0x45')]({},_0x560183,_0x32fcc3['options']);return db[_0x11a2('0x60')][_0x11a2('0x21')]({'where':_0x560183['where']})[_0x11a2('0x2c')](function(_0x153e9e){_0x5984c3['count']=_0x153e9e;if(_0x32fcc3[_0x11a2('0x37')][_0x11a2('0x47')]){_0x560183[_0x11a2('0x48')]=[{'all':!![]}];}return db[_0x11a2('0x60')][_0x11a2('0x49')](_0x560183);})[_0x11a2('0x2c')](function(_0x221fc5){_0x5984c3['rows']=_0x221fc5;return _0x5984c3;});}})['then'](respondWithFilteredResult(_0x1d09ad,_0x560183))[_0x11a2('0x4b')](handleError(_0x1d09ad,null));};function char(_0xbb8751){return _0x11a2('0x61')===typeof _0xbb8751?String[_0x11a2('0x62')][_0x11a2('0x24')](null,arguments):_0xbb8751;}function needsEncapsulation(_0x2f35b8){return!!_0x2f35b8&&(_0x2f35b8[_0x11a2('0x63')]()['indexOf'](char(0xd))>=0x0||_0x2f35b8[_0x11a2('0x63')]()[_0x11a2('0x64')](char(0xa))>=0x0||_0x2f35b8['toString']()[_0x11a2('0x64')](char(0x2c))>=0x0||_0x2f35b8[_0x11a2('0x63')]()[_0x11a2('0x64')](char(0x22))>=0x0);}function encapsulate(_0x4d6580){var _0x2086a9=char(0x22),_0x2c3ed8='\x5c'+char(0x22),_0x567ffd=_0x4d6580[_0x11a2('0x63')]()[_0x11a2('0x65')](new RegExp(_0x2086a9,'g'),_0x2c3ed8);return _0x2086a9+_0x567ffd+_0x2086a9;}exports[_0x11a2('0x66')]=function(_0x526576,_0x2514f7,_0x154007){var _0x15fbd5,_0x3eb9a3;var _0x3e3be4={'where':{'ProjectId':_0x526576[_0x11a2('0x4d')]['id']}};if(_0x526576['query'][_0x11a2('0x67')]){_0x3e3be4['where']['starttime']=JSON['parse'](_0x526576[_0x11a2('0x37')][_0x11a2('0x67')]);}return db['JscriptySessionReport'][_0x11a2('0x49')](_0x3e3be4)[_0x11a2('0x2c')](handleEntityNotFound(_0x2514f7,null))[_0x11a2('0x2c')](function(_0x4ab37c){if(_0x4ab37c){_0x15fbd5=_0x4ab37c;return db[_0x11a2('0x68')][_0x11a2('0x49')]({'where':{'SessionId':{'$in':_['map'](_0x15fbd5,'id')},'ProjectId':_0x526576[_0x11a2('0x4d')]['id']},'order':_0x11a2('0x69')});}})[_0x11a2('0x2c')](handleEntityNotFound(_0x2514f7,null))['then'](function(_0x564248){if(_0x564248){_0x3eb9a3=_0x564248;var _0xe78fa7={};for(var _0x5a0673=0x0,_0x2379b6=_0x3eb9a3[_0x11a2('0x3d')];_0x5a0673<_0x2379b6;_0x5a0673++){if(!_0xe78fa7[_0x11a2('0x3e')](_0x3eb9a3[_0x5a0673]['questionId'])){_0xe78fa7[_0x3eb9a3[_0x5a0673][_0x11a2('0x6a')]]=needsEncapsulation(_0x3eb9a3[_0x5a0673][_0x11a2('0x6b')])?encapsulate(_0x3eb9a3[_0x5a0673][_0x11a2('0x6b')]):_0x3eb9a3[_0x5a0673][_0x11a2('0x6b')];}}var _0x4b86f0=[],_0x12bcbc={};for(var _0x371950=0x0,_0xf32de6=_0x15fbd5[_0x11a2('0x3d')];_0x371950<_0xf32de6;_0x371950++){_0x12bcbc={'ProjectId':_0x526576[_0x11a2('0x4d')]['id'],'SessionId':_0x15fbd5[_0x371950]['id'],'StartTime':moment(_0x15fbd5[_0x371950][_0x11a2('0x6c')])[_0x11a2('0x6d')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x4494f5=0x0,_0x248f03=_0x3eb9a3[_0x11a2('0x3d')];_0x4494f5<_0x248f03;_0x4494f5++){if(_0x3eb9a3[_0x4494f5][_0x11a2('0x6e')]==_0x15fbd5[_0x371950]['id']&&_0xe78fa7[_0x11a2('0x3e')](_0x3eb9a3[_0x4494f5]['questionId'])){_0x12bcbc[_0xe78fa7[_0x3eb9a3[_0x4494f5]['questionId']]]=_0x3eb9a3[_0x4494f5]['answer'];}}for(var _0x136301 in _0xe78fa7){if(!_0x12bcbc[_0x11a2('0x3e')](_0xe78fa7[_0x136301])){_0x12bcbc[_0xe78fa7[_0x136301]]=null;}}_0x4b86f0['push'](_0x12bcbc);}return _0x4b86f0;}})['then'](function(_0x24ad98){if(!_[_0x11a2('0x6f')](_0x24ad98)){var _0x48b2a6=toCsv(_0x24ad98);var _0x359e0a=Date['now']();fs[_0x11a2('0x70')](util[_0x11a2('0x6d')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x526576[_0x11a2('0x4d')]['id'],_0x359e0a),_0x48b2a6);_0x2514f7['setHeader']('Content-disposition',_0x11a2('0x71')+util[_0x11a2('0x6d')]('Jscripty_Project_%d_Summary_%s.csv',_0x526576[_0x11a2('0x4d')]['id'],_0x359e0a));_0x2514f7[_0x11a2('0x72')]('Content-type','text/csv');return _0x2514f7['download'](util[_0x11a2('0x6d')](_0x11a2('0x73'),_0x526576[_0x11a2('0x4d')]['id'],_0x359e0a));}else{return _0x2514f7[_0x11a2('0x1b')](0xcc);}})[_0x11a2('0x4b')](handleError(_0x2514f7,null));};
\ No newline at end of file
+var _0xa1aa=['length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','getSessions','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','hasOwnProperty','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields'];(function(_0x828934,_0x1fee9b){var _0x124f27=function(_0x2920ed){while(--_0x2920ed){_0x828934['push'](_0x828934['shift']());}};_0x124f27(++_0x1fee9b);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x21a56c,_0x233a99){_0x21a56c=_0x21a56c-0x0;var _0x500bdf=_0xa1aa[_0x21a56c];return _0x500bdf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa1a('0x0'));var zipdir=require(_0xaa1a('0x1'));var jsonpatch=require(_0xaa1a('0x2'));var rp=require(_0xaa1a('0x3'));var moment=require(_0xaa1a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa1a('0x5'));var path=require(_0xaa1a('0x6'));var sox=require('sox');var csv=require(_0xaa1a('0x7'));var ejs=require(_0xaa1a('0x8'));var fs=require('fs');var fs_extra=require(_0xaa1a('0x9'));var _=require('lodash');var squel=require(_0xaa1a('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa1a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaa1a('0x7'));var querystring=require(_0xaa1a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa1a('0xd'));var qs=require(_0xaa1a('0xe'));var as=require(_0xaa1a('0xf'));var hardwareService=require(_0xaa1a('0x10'));var logger=require('../../config/logger')(_0xaa1a('0x11'));var utils=require(_0xaa1a('0x12'));var config=require(_0xaa1a('0x13'));var licenseUtil=require(_0xaa1a('0x14'));var db=require(_0xaa1a('0x15'))['db'];function respondWithStatusCode(_0x278079,_0x25ae41){_0x25ae41=_0x25ae41||0xcc;return function(_0x2f018d){if(_0x2f018d){return _0x278079[_0xaa1a('0x16')](_0x25ae41);}return _0x278079[_0xaa1a('0x17')](_0x25ae41)['end']();};}function respondWithResult(_0x5b131c,_0x38715a){_0x38715a=_0x38715a||0xc8;return function(_0x3a577f){if(_0x3a577f){return _0x5b131c[_0xaa1a('0x17')](_0x38715a)[_0xaa1a('0x18')](_0x3a577f);}};}function respondWithFilteredResult(_0x43bd93,_0x5da087){return function(_0x90ef70){if(_0x90ef70){var _0x480a27=typeof _0x5da087[_0xaa1a('0x19')]===_0xaa1a('0x1a')&&typeof _0x5da087[_0xaa1a('0x1b')]===_0xaa1a('0x1a');var _0x5ba030=_0x90ef70['count'];var _0x1b3174=_0x480a27?0x0:_0x5da087[_0xaa1a('0x19')];var _0x56ff91=_0x480a27?_0x90ef70[_0xaa1a('0x1c')]:_0x5da087[_0xaa1a('0x19')]+_0x5da087[_0xaa1a('0x1b')];var _0x120080;if(_0x56ff91>=_0x5ba030){_0x56ff91=_0x5ba030;_0x120080=0xc8;}else{_0x120080=0xce;}_0x43bd93[_0xaa1a('0x17')](_0x120080);return _0x43bd93[_0xaa1a('0x1d')]('Content-Range',_0x1b3174+'-'+_0x56ff91+'/'+_0x5ba030)[_0xaa1a('0x18')](_0x90ef70);}return null;};}function patchUpdates(_0x400a06){return function(_0x8586aa){try{jsonpatch[_0xaa1a('0x1e')](_0x8586aa,_0x400a06,!![]);}catch(_0x2c0238){return BPromise[_0xaa1a('0x1f')](_0x2c0238);}return _0x8586aa[_0xaa1a('0x20')]();};}function saveUpdates(_0x5c01b2,_0xa32c54){return function(_0x282f07){if(_0x282f07){return _0x282f07[_0xaa1a('0x21')](_0x5c01b2)['then'](function(_0x262f83){return _0x262f83;});}return null;};}function removeEntity(_0x15b366,_0x583c90){return function(_0x4accdf){if(_0x4accdf){return _0x4accdf[_0xaa1a('0x22')]()[_0xaa1a('0x23')](function(){var _0xd3225b=_0x4accdf[_0xaa1a('0x24')]({'plain':!![]});var _0x582843=_0xaa1a('0x25');return db[_0xaa1a('0x26')]['destroy']({'where':{'type':_0x582843,'resourceId':_0xd3225b['id']}})[_0xaa1a('0x23')](function(){return _0x4accdf;});})[_0xaa1a('0x23')](function(){_0x15b366[_0xaa1a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43688f,_0x2d1c8f){return function(_0x1b1b67){if(!_0x1b1b67){_0x43688f[_0xaa1a('0x16')](0x194);}return _0x1b1b67;};}function handleError(_0x3f29a8,_0x380a5a){_0x380a5a=_0x380a5a||0x1f4;return function(_0x26fdea){logger['error'](_0x26fdea['stack']);if(_0x26fdea['name']){delete _0x26fdea[_0xaa1a('0x27')];}_0x3f29a8[_0xaa1a('0x17')](_0x380a5a)[_0xaa1a('0x28')](_0x26fdea);};}exports[_0xaa1a('0x29')]=function(_0x559050,_0x14a189){var _0x22ba1d={},_0x2767be={},_0x22b4e3={'count':0x0,'rows':[]};var _0x13afce=_[_0xaa1a('0x2a')](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')],function(_0x2a0d68){return{'name':_0x2a0d68[_0xaa1a('0x2d')],'type':_0x2a0d68[_0xaa1a('0x2e')][_0xaa1a('0x2f')]};});_0x2767be[_0xaa1a('0x30')]=_[_0xaa1a('0x2a')](_0x13afce,_0xaa1a('0x27'));_0x2767be['query']=_['keys'](_0x559050[_0xaa1a('0x31')]);_0x2767be['filters']=_[_0xaa1a('0x32')](_0x2767be[_0xaa1a('0x30')],_0x2767be[_0xaa1a('0x31')]);_0x22ba1d[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0x2767be[_0xaa1a('0x30')],qs['fields'](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x22ba1d[_0xaa1a('0x33')]=_0x22ba1d[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x22ba1d[_0xaa1a('0x33')]:_0x2767be[_0xaa1a('0x30')];if(!_0x559050[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0x22ba1d[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x1b')]);_0x22ba1d[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0x22ba1d[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0x22ba1d[_0xaa1a('0x39')]=qs[_0xaa1a('0x3a')](_[_0xaa1a('0x3b')](_0x559050['query'],_0x2767be['filters']),_0x13afce);if(_0x559050[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x22ba1d[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0x22ba1d[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x13afce,function(_0x48f1b3){if(_0x48f1b3[_0xaa1a('0x2e')]!=='VIRTUAL'){var _0x3da635={};_0x3da635[_0x48f1b3['name']]={'$like':'%'+_0x559050[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x3da635;}})});}_0x22ba1d=_[_0xaa1a('0x3d')]({},_0x22ba1d,_0x559050[_0xaa1a('0x3e')]);var _0x5f0170={'where':_0x22ba1d['where']};return db[_0xaa1a('0x2b')][_0xaa1a('0x1c')](_0x5f0170)['then'](function(_0x27971e){_0x22b4e3[_0xaa1a('0x1c')]=_0x27971e;if(_0x559050['query']['includeAll']){_0x22ba1d[_0xaa1a('0x3f')]=[{'all':!![]}];}return db['JscriptyProject'][_0xaa1a('0x40')](_0x22ba1d);})[_0xaa1a('0x23')](function(_0x30011d){_0x22b4e3[_0xaa1a('0x41')]=_0x30011d;return _0x22b4e3;})[_0xaa1a('0x23')](respondWithFilteredResult(_0x14a189,_0x22ba1d))[_0xaa1a('0x42')](handleError(_0x14a189,null));};exports['show']=function(_0x54f7bd,_0x4a2a49){var _0x5ce7f1={'raw':![],'where':{'id':_0x54f7bd['params']['id']}},_0x27fcfd={};_0x27fcfd[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')]);_0x27fcfd[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x54f7bd[_0xaa1a('0x31')]);_0x27fcfd[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x27fcfd[_0xaa1a('0x30')],_0x27fcfd[_0xaa1a('0x31')]);_0x5ce7f1['attributes']=_[_0xaa1a('0x32')](_0x27fcfd[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x54f7bd['query'][_0xaa1a('0x34')]));_0x5ce7f1['attributes']=_0x5ce7f1[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x5ce7f1[_0xaa1a('0x33')]:_0x27fcfd[_0xaa1a('0x30')];if(_0x54f7bd['query'][_0xaa1a('0x44')]){_0x5ce7f1[_0xaa1a('0x3f')]=[{'all':!![]}];}_0x5ce7f1=_[_0xaa1a('0x3d')]({},_0x5ce7f1,_0x54f7bd[_0xaa1a('0x3e')]);return db[_0xaa1a('0x2b')][_0xaa1a('0x45')](_0x5ce7f1)[_0xaa1a('0x23')](handleEntityNotFound(_0x4a2a49,null))[_0xaa1a('0x23')](respondWithResult(_0x4a2a49,null))[_0xaa1a('0x42')](handleError(_0x4a2a49,null));};exports['create']=function(_0x9a63c0,_0x4327b9){return db[_0xaa1a('0x2b')][_0xaa1a('0x46')](_0x9a63c0[_0xaa1a('0x47')],{})[_0xaa1a('0x23')](function(_0x1aad3a){var _0x3a19be=_0x9a63c0[_0xaa1a('0x48')][_0xaa1a('0x24')]({'plain':!![]});if(!_0x3a19be)throw new Error(_0xaa1a('0x49'));if(_0x3a19be[_0xaa1a('0x4a')]===_0xaa1a('0x48')){var _0x169e85=_0x1aad3a[_0xaa1a('0x24')]({'plain':!![]});var _0x42c5e5=_0xaa1a('0x25');return db[_0xaa1a('0x4b')]['find']({'where':{'name':_0x42c5e5,'userProfileId':_0x3a19be[_0xaa1a('0x4c')]},'raw':!![]})[_0xaa1a('0x23')](function(_0x1b0596){if(_0x1b0596&&_0x1b0596['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa1a('0x46')]({'name':_0x169e85['name'],'resourceId':_0x169e85['id'],'type':_0x1b0596[_0xaa1a('0x27')],'sectionId':_0x1b0596['id']},{})['then'](function(){return _0x1aad3a;});}else{return _0x1aad3a;}})[_0xaa1a('0x42')](function(_0x5bad29){logger[_0xaa1a('0x4d')](_0xaa1a('0x4e'),_0x5bad29);throw _0x5bad29;});}return _0x1aad3a;})[_0xaa1a('0x23')](respondWithResult(_0x4327b9,0xc9))[_0xaa1a('0x42')](handleError(_0x4327b9,null));};exports[_0xaa1a('0x4f')]=function(_0x4fc334,_0x57550d){var _0x4cd226={'where':{'id':_0x4fc334[_0xaa1a('0x50')]['id']}},_0x2ce080={};_0x2ce080[_0xaa1a('0x30')]=_['keys'](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')]);_0x4cd226['attributes']=_['intersection'](_0x2ce080[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x4cd226[_0xaa1a('0x33')]=_0x4cd226[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x4cd226[_0xaa1a('0x33')]:_0x2ce080[_0xaa1a('0x30')];if(_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x44')]){_0x4cd226[_0xaa1a('0x3f')]=[{'all':!![]}];}_0x4cd226=_['merge']({},_0x4cd226,_0x4fc334[_0xaa1a('0x3e')]);return db['JscriptyProject'][_0xaa1a('0x45')](_0x4cd226)[_0xaa1a('0x23')](handleEntityNotFound(_0x57550d,null))['then'](function(_0x55ad1f){if(_0x55ad1f){var _0xc0cbb8=_0x55ad1f['get']({'plain':!![]});_0xc0cbb8=qs[_0xaa1a('0x51')](_0xc0cbb8,['id',_0xaa1a('0x52'),_0xaa1a('0x53')]);_0x4fc334[_0xaa1a('0x47')]=_[_0xaa1a('0x51')](_0x4fc334[_0xaa1a('0x47')],['id',_0xaa1a('0x52'),_0xaa1a('0x53')]);return db['JscriptyProject'][_0xaa1a('0x46')](_[_0xaa1a('0x3d')](_0xc0cbb8,_0x4fc334['body']),{'include':_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x44')]?[{'all':!![]}]:undefined})[_0xaa1a('0x23')](function(_0x27aa45){var _0x1c5550=_0x4fc334[_0xaa1a('0x48')]['get']({'plain':!![]});if(!_0x1c5550)throw new Error(_0xaa1a('0x49'));if(_0x1c5550[_0xaa1a('0x4a')]===_0xaa1a('0x48')){var _0x48ce6f=_0x27aa45['get']({'plain':!![]});var _0x43ce51=_0xaa1a('0x25');return db[_0xaa1a('0x4b')]['find']({'where':{'name':_0x43ce51,'userProfileId':_0x1c5550['userProfileId']},'raw':!![]})[_0xaa1a('0x23')](function(_0x37f941){if(_0x37f941&&_0x37f941['autoAssociation']===0x0){return db[_0xaa1a('0x26')][_0xaa1a('0x46')]({'name':_0x48ce6f[_0xaa1a('0x27')],'resourceId':_0x48ce6f['id'],'type':_0x37f941[_0xaa1a('0x27')],'sectionId':_0x37f941['id']},{})[_0xaa1a('0x23')](function(){return _0x27aa45;});}else{return _0x27aa45;}})[_0xaa1a('0x42')](function(_0x50732e){logger[_0xaa1a('0x4d')](_0xaa1a('0x4e'),_0x50732e);throw _0x50732e;});}return _0x27aa45;});}})[_0xaa1a('0x23')](respondWithResult(_0x57550d,0xc9))[_0xaa1a('0x42')](handleError(_0x57550d,null));};exports[_0xaa1a('0x21')]=function(_0x40d6a9,_0x1b2c53){if(_0x40d6a9['body']['id']){delete _0x40d6a9[_0xaa1a('0x47')]['id'];}return db['JscriptyProject'][_0xaa1a('0x45')]({'where':{'id':_0x40d6a9[_0xaa1a('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b2c53,null))[_0xaa1a('0x23')](saveUpdates(_0x40d6a9[_0xaa1a('0x47')],null))[_0xaa1a('0x23')](respondWithResult(_0x1b2c53,null))[_0xaa1a('0x42')](handleError(_0x1b2c53,null));};exports[_0xaa1a('0x22')]=function(_0x2d0476,_0x16c704){return db[_0xaa1a('0x2b')][_0xaa1a('0x45')]({'where':{'id':_0x2d0476[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x16c704,null))[_0xaa1a('0x23')](removeEntity(_0x16c704,null))[_0xaa1a('0x42')](handleError(_0x16c704,null));};exports[_0xaa1a('0x54')]=function(_0x234c53,_0x57f8a1,_0x4b88b0){var _0xec75db={'raw':!![],'where':{}};var _0xba71f7={};var _0x2d038c={'count':0x0,'rows':[]};return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x234c53[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x57f8a1,null))[_0xaa1a('0x23')](function(_0x5942d4){if(_0x5942d4){_0xba71f7[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db['JscriptySessionReport']['rawAttributes']);_0xba71f7[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x234c53[_0xaa1a('0x31')]);_0xba71f7[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0xba71f7[_0xaa1a('0x30')],_0xba71f7[_0xaa1a('0x31')]);_0xec75db[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0xba71f7[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0xec75db[_0xaa1a('0x33')]=_0xec75db[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0xec75db[_0xaa1a('0x33')]:_0xba71f7[_0xaa1a('0x30')];if(!_0x234c53[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0xec75db[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x234c53[_0xaa1a('0x31')]['limit']);_0xec75db[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0xec75db[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0xec75db[_0xaa1a('0x39')]=qs['filters'](_[_0xaa1a('0x3b')](_0x234c53[_0xaa1a('0x31')],_0xba71f7['filters']));_0xec75db['where'][_0xaa1a('0x56')]=_0x5942d4['id'];if(_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0xec75db[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0xec75db[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0xec75db['attributes'],function(_0x14ed12){var _0x5ac42e={};_0x5ac42e[_0x14ed12]={'$like':'%'+_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x5ac42e;})});}_0xec75db=_['merge']({},_0xec75db,_0x234c53['options']);return db['JscriptySessionReport'][_0xaa1a('0x1c')]({'where':_0xec75db['where']})[_0xaa1a('0x23')](function(_0x573b33){_0x2d038c[_0xaa1a('0x1c')]=_0x573b33;if(_0x234c53['query'][_0xaa1a('0x44')]){_0xec75db[_0xaa1a('0x3f')]=[{'all':!![]}];}return db[_0xaa1a('0x57')]['findAll'](_0xec75db);})['then'](function(_0x1f3682){_0x2d038c[_0xaa1a('0x41')]=_0x1f3682;return _0x2d038c;});}})[_0xaa1a('0x23')](respondWithFilteredResult(_0x57f8a1,_0xec75db))[_0xaa1a('0x42')](handleError(_0x57f8a1,null));};exports[_0xaa1a('0x58')]=function(_0x21d6b3,_0x1223be,_0x26f73f){var _0x409aa2={'raw':!![],'where':{}};var _0x1dfbc1={};var _0xb4a868={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xaa1a('0x55')]({'where':{'id':_0x21d6b3[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x1223be,null))[_0xaa1a('0x23')](function(_0x35c539){if(_0x35c539){_0x1dfbc1['model']=_[_0xaa1a('0x43')](db[_0xaa1a('0x59')]['rawAttributes']);_0x1dfbc1['query']=_['keys'](_0x21d6b3[_0xaa1a('0x31')]);_0x1dfbc1[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x1dfbc1['model'],_0x1dfbc1[_0xaa1a('0x31')]);_0x409aa2['attributes']=_['intersection'](_0x1dfbc1[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x409aa2['attributes']=_0x409aa2[_0xaa1a('0x33')]['length']?_0x409aa2[_0xaa1a('0x33')]:_0x1dfbc1[_0xaa1a('0x30')];if(!_0x21d6b3[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0x409aa2[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x21d6b3['query']['limit']);_0x409aa2['offset']=qs[_0xaa1a('0x19')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0x409aa2[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0x409aa2['where']=qs[_0xaa1a('0x3a')](_[_0xaa1a('0x3b')](_0x21d6b3[_0xaa1a('0x31')],_0x1dfbc1[_0xaa1a('0x3a')]));_0x409aa2[_0xaa1a('0x39')][_0xaa1a('0x56')]=_0x35c539['id'];if(_0x21d6b3['query']['filter']){_0x409aa2['where']=_[_0xaa1a('0x3d')](_0x409aa2[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x409aa2[_0xaa1a('0x33')],function(_0x23ee8c){var _0x9fcf4b={};_0x9fcf4b[_0x23ee8c]={'$like':'%'+_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x9fcf4b;})});}_0x409aa2=_['merge']({},_0x409aa2,_0x21d6b3[_0xaa1a('0x3e')]);return db[_0xaa1a('0x59')]['count']({'where':_0x409aa2[_0xaa1a('0x39')]})[_0xaa1a('0x23')](function(_0x984c47){_0xb4a868['count']=_0x984c47;if(_0x21d6b3[_0xaa1a('0x31')]['includeAll']){_0x409aa2['include']=[{'all':!![]}];}return db[_0xaa1a('0x59')][_0xaa1a('0x40')](_0x409aa2);})[_0xaa1a('0x23')](function(_0x82bd71){_0xb4a868[_0xaa1a('0x41')]=_0x82bd71;return _0xb4a868;});}})[_0xaa1a('0x23')](respondWithFilteredResult(_0x1223be,_0x409aa2))[_0xaa1a('0x42')](handleError(_0x1223be,null));};function char(_0x5eaea4){return'number'===typeof _0x5eaea4?String[_0xaa1a('0x5a')][_0xaa1a('0x1e')](null,arguments):_0x5eaea4;}function needsEncapsulation(_0x589d75){return!!_0x589d75&&(_0x589d75[_0xaa1a('0x5b')]()[_0xaa1a('0x5c')](char(0xd))>=0x0||_0x589d75[_0xaa1a('0x5b')]()[_0xaa1a('0x5c')](char(0xa))>=0x0||_0x589d75[_0xaa1a('0x5b')]()[_0xaa1a('0x5c')](char(0x2c))>=0x0||_0x589d75[_0xaa1a('0x5b')]()[_0xaa1a('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x3917cb){var _0x2d8990=char(0x22),_0x2f0a51='\x5c'+char(0x22),_0x4a3349=_0x3917cb[_0xaa1a('0x5b')]()[_0xaa1a('0x5d')](new RegExp(_0x2d8990,'g'),_0x2f0a51);return _0x2d8990+_0x4a3349+_0x2d8990;}exports[_0xaa1a('0x5e')]=function(_0x3e89a4,_0x110b9b,_0x4389fb){var _0xa2bd51,_0x2f2ee0;var _0x5d56bd={'where':{'ProjectId':_0x3e89a4['params']['id']}};if(_0x3e89a4[_0xaa1a('0x31')]['startTime']){_0x5d56bd[_0xaa1a('0x39')][_0xaa1a('0x5f')]=JSON['parse'](_0x3e89a4[_0xaa1a('0x31')][_0xaa1a('0x60')]);}return db[_0xaa1a('0x57')][_0xaa1a('0x40')](_0x5d56bd)[_0xaa1a('0x23')](handleEntityNotFound(_0x110b9b,null))[_0xaa1a('0x23')](function(_0x44dfdd){if(_0x44dfdd){_0xa2bd51=_0x44dfdd;return db[_0xaa1a('0x61')][_0xaa1a('0x40')]({'where':{'SessionId':{'$in':_[_0xaa1a('0x2a')](_0xa2bd51,'id')},'ProjectId':_0x3e89a4['params']['id']},'order':_0xaa1a('0x62')});}})[_0xaa1a('0x23')](handleEntityNotFound(_0x110b9b,null))['then'](function(_0x4f3ef9){if(_0x4f3ef9){_0x2f2ee0=_0x4f3ef9;var _0x30a781={};for(var _0x4b5d8d=0x0,_0x46e198=_0x2f2ee0['length'];_0x4b5d8d<_0x46e198;_0x4b5d8d++){if(!_0x30a781['hasOwnProperty'](_0x2f2ee0[_0x4b5d8d][_0xaa1a('0x63')])){_0x30a781[_0x2f2ee0[_0x4b5d8d]['questionId']]=needsEncapsulation(_0x2f2ee0[_0x4b5d8d]['question'])?encapsulate(_0x2f2ee0[_0x4b5d8d][_0xaa1a('0x64')]):_0x2f2ee0[_0x4b5d8d][_0xaa1a('0x64')];}}var _0x142abc=[],_0x440c6f={};for(var _0x1ecc6f=0x0,_0x26df16=_0xa2bd51[_0xaa1a('0x35')];_0x1ecc6f<_0x26df16;_0x1ecc6f++){_0x440c6f={'ProjectId':_0x3e89a4[_0xaa1a('0x50')]['id'],'SessionId':_0xa2bd51[_0x1ecc6f]['id'],'StartTime':moment(_0xa2bd51[_0x1ecc6f][_0xaa1a('0x5f')])[_0xaa1a('0x65')](_0xaa1a('0x66'))};for(var _0x248c7f=0x0,_0xa23325=_0x2f2ee0[_0xaa1a('0x35')];_0x248c7f<_0xa23325;_0x248c7f++){if(_0x2f2ee0[_0x248c7f][_0xaa1a('0x67')]==_0xa2bd51[_0x1ecc6f]['id']&&_0x30a781['hasOwnProperty'](_0x2f2ee0[_0x248c7f][_0xaa1a('0x63')])){_0x440c6f[_0x30a781[_0x2f2ee0[_0x248c7f][_0xaa1a('0x63')]]]=_0x2f2ee0[_0x248c7f][_0xaa1a('0x68')];}}for(var _0x443ecb in _0x30a781){if(!_0x440c6f[_0xaa1a('0x69')](_0x30a781[_0x443ecb])){_0x440c6f[_0x30a781[_0x443ecb]]=null;}}_0x142abc['push'](_0x440c6f);}return _0x142abc;}})[_0xaa1a('0x23')](function(_0x46ed30){if(!_[_0xaa1a('0x6a')](_0x46ed30)){var _0x5f2347=toCsv(_0x46ed30);var _0x3f4cba=Date[_0xaa1a('0x6b')]();fs[_0xaa1a('0x6c')](util['format'](_0xaa1a('0x6d'),_0x3e89a4[_0xaa1a('0x50')]['id'],_0x3f4cba),_0x5f2347);_0x110b9b[_0xaa1a('0x6e')]('Content-disposition',_0xaa1a('0x6f')+util[_0xaa1a('0x65')](_0xaa1a('0x70'),_0x3e89a4[_0xaa1a('0x50')]['id'],_0x3f4cba));_0x110b9b['setHeader'](_0xaa1a('0x71'),_0xaa1a('0x72'));return _0x110b9b[_0xaa1a('0x73')](util[_0xaa1a('0x65')](_0xaa1a('0x6d'),_0x3e89a4['params']['id'],_0x3f4cba));}else{return _0x110b9b[_0xaa1a('0x16')](0xcc);}})[_0xaa1a('0x42')](handleError(_0x110b9b,null));};
\ No newline at end of file
index 8a15cd1..87b3246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b8=['../../config/logger','moment','path','rimraf','../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x61b8,0x169));var _0x861b=function(_0x5563e6,_0x3cf16c){_0x5563e6=_0x5563e6-0x0;var _0x37bc39=_0x61b8[_0x5563e6];return _0x37bc39;};'use strict';var _=require(_0x861b('0x0'));var util=require(_0x861b('0x1'));var logger=require(_0x861b('0x2'))('api');var moment=require(_0x861b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x861b('0x4'));var rimraf=require(_0x861b('0x5'));var config=require(_0x861b('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x861b('0x7')]=function(_0x422a5f,_0x1cfc62){return _0x422a5f[_0x861b('0x8')](_0x861b('0x9'),attributes,{'tableName':_0x861b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a9c=['bluebird','path','rimraf','../../config/environment','define','JscriptyProject','lodash','util','../../config/logger','api','moment'];(function(_0x45fc8e,_0x54cdf3){var _0x303bd8=function(_0x193862){while(--_0x193862){_0x45fc8e['push'](_0x45fc8e['shift']());}};_0x303bd8(++_0x54cdf3);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x4def6f,_0x573cbf){_0x4def6f=_0x4def6f-0x0;var _0x3f3e1c=_0x4a9c[_0x4def6f];return _0x3f3e1c;};'use strict';var _=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var logger=require(_0xc4a9('0x2'))(_0xc4a9('0x3'));var moment=require(_0xc4a9('0x4'));var BPromise=require(_0xc4a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4a9('0x6'));var rimraf=require(_0xc4a9('0x7'));var config=require(_0xc4a9('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x95d3f6,_0x2f35e4){return _0x95d3f6[_0xc4a9('0x9')](_0xc4a9('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b2b25ad..9d50aba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xac4a,0x13f));var _0xaac4=function(_0x6b160e,_0x533e4f){_0x6b160e=_0x6b160e-0x0;var _0x5efc05=_0xac4a[_0x6b160e];return _0x5efc05;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
+var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x4e7afc,_0x5668ee){var _0x126794=function(_0x3aae9d){while(--_0x3aae9d){_0x4e7afc['push'](_0x4e7afc['shift']());}};_0x126794(++_0x5668ee);}(_0x54ef,0x112));var _0xf54e=function(_0x19db9b,_0x213095){_0x19db9b=_0x19db9b-0x0;var _0x156fb3=_0x54ef[_0x19db9b];return _0x156fb3;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});}
\ No newline at end of file
index f1077e4..6f351c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5cd=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path'];(function(_0x459937,_0x458aa1){var _0x573881=function(_0x183445){while(--_0x183445){_0x459937['push'](_0x459937['shift']());}};_0x573881(++_0x458aa1);}(_0xa5cd,0x9e));var _0xda5c=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xa5cd[_0x341e0f];return _0x59555a;};'use strict';var multer=require(_0xda5c('0x0'));var util=require('util');var path=require(_0xda5c('0x1'));var timeout=require(_0xda5c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xda5c('0x3'));var interaction=require(_0xda5c('0x4'));var config=require(_0xda5c('0x5'));var controller=require(_0xda5c('0x6'));router[_0xda5c('0x7')]('/',auth[_0xda5c('0x8')](),controller[_0xda5c('0x9')]);router[_0xda5c('0x7')](_0xda5c('0xa'),auth[_0xda5c('0x8')](),controller[_0xda5c('0xb')]);router[_0xda5c('0x7')](_0xda5c('0xc'),auth[_0xda5c('0x8')](),controller[_0xda5c('0xd')]);router[_0xda5c('0xe')]('/',auth[_0xda5c('0x8')](),controller['create']);router[_0xda5c('0xf')](_0xda5c('0xc'),auth[_0xda5c('0x8')](),controller[_0xda5c('0x10')]);router[_0xda5c('0x11')](_0xda5c('0xc'),auth['isAuthenticated'](),controller[_0xda5c('0x12')]);module[_0xda5c('0x13')]=router;
\ No newline at end of file
+var _0x0fc3=['../../config/environment','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2d5934,_0x1acc4f){var _0x5807c8=function(_0x326cc5){while(--_0x326cc5){_0x2d5934['push'](_0x2d5934['shift']());}};_0x5807c8(++_0x1acc4f);}(_0x0fc3,0xc0));var _0x30fc=function(_0x1033a4,_0x278adf){_0x1033a4=_0x1033a4-0x0;var _0x14360b=_0x0fc3[_0x1033a4];return _0x14360b;};'use strict';var multer=require(_0x30fc('0x0'));var util=require(_0x30fc('0x1'));var path=require(_0x30fc('0x2'));var timeout=require(_0x30fc('0x3'));var express=require(_0x30fc('0x4'));var router=express[_0x30fc('0x5')]();var fs_extra=require(_0x30fc('0x6'));var auth=require(_0x30fc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x30fc('0x8'));var controller=require(_0x30fc('0x9'));router[_0x30fc('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x30fc('0xa')](_0x30fc('0xb'),auth[_0x30fc('0xc')](),controller[_0x30fc('0xd')]);router['get'](_0x30fc('0xe'),auth[_0x30fc('0xc')](),controller['show']);router[_0x30fc('0xf')]('/',auth[_0x30fc('0xc')](),controller[_0x30fc('0x10')]);router[_0x30fc('0x11')](_0x30fc('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x30fc('0x12')]('/:id',auth[_0x30fc('0xc')](),controller[_0x30fc('0x13')]);module['exports']=router;
\ No newline at end of file
index ecc52f2..0a48c4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x2e25e1,_0x24f261){_0x2e25e1=_0x2e25e1-0x0;var _0x79d2=_0x7a54[_0x2e25e1];return _0x79d2;};'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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x1aaed5,_0xbc6194){_0x1aaed5=_0x1aaed5-0x0;var _0x6bf7cf=_0x7a54[_0x1aaed5];return _0x6bf7cf;};'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 d6831c5..4761b1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23ce=['fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs'];(function(_0x50ed93,_0x111d19){var _0x433f8e=function(_0x3b423c){while(--_0x3b423c){_0x50ed93['push'](_0x50ed93['shift']());}};_0x433f8e(++_0x111d19);}(_0x23ce,0x8c));var _0xe23c=function(_0x7201b5,_0x15b1cd){_0x7201b5=_0x7201b5-0x0;var _0x2d10ed=_0x23ce[_0x7201b5];return _0x2d10ed;};'use strict';var emlformat=require(_0xe23c('0x0'));var rimraf=require(_0xe23c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe23c('0x2'));var rp=require(_0xe23c('0x3'));var moment=require(_0xe23c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe23c('0x5'));var util=require(_0xe23c('0x6'));var path=require(_0xe23c('0x7'));var sox=require('sox');var csv=require(_0xe23c('0x8'));var ejs=require(_0xe23c('0x9'));var fs=require('fs');var fs_extra=require(_0xe23c('0xa'));var _=require(_0xe23c('0xb'));var squel=require('squel');var crypto=require(_0xe23c('0xc'));var jsforce=require(_0xe23c('0xd'));var deskjs=require(_0xe23c('0xe'));var toCsv=require(_0xe23c('0x8'));var querystring=require('querystring');var Papa=require(_0xe23c('0xf'));var Redis=require(_0xe23c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe23c('0x11'));var as=require(_0xe23c('0x12'));var hardwareService=require(_0xe23c('0x13'));var logger=require(_0xe23c('0x14'))(_0xe23c('0x15'));var utils=require(_0xe23c('0x16'));var config=require(_0xe23c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe23c('0x18'))['db'];function respondWithStatusCode(_0x23af18,_0x293208){_0x293208=_0x293208||0xcc;return function(_0x220d6b){if(_0x220d6b){return _0x23af18[_0xe23c('0x19')](_0x293208);}return _0x23af18[_0xe23c('0x1a')](_0x293208)[_0xe23c('0x1b')]();};}function respondWithResult(_0x128d71,_0x3b5bd8){_0x3b5bd8=_0x3b5bd8||0xc8;return function(_0x574cc5){if(_0x574cc5){return _0x128d71[_0xe23c('0x1a')](_0x3b5bd8)[_0xe23c('0x1c')](_0x574cc5);}};}function respondWithFilteredResult(_0x148e87,_0x39e372){return function(_0x498284){if(_0x498284){var _0x5d11c2=typeof _0x39e372['offset']===_0xe23c('0x1d')&&typeof _0x39e372[_0xe23c('0x1e')]===_0xe23c('0x1d');var _0x2c385d=_0x498284[_0xe23c('0x1f')];var _0x134bd8=_0x5d11c2?0x0:_0x39e372[_0xe23c('0x20')];var _0x4405cf=_0x5d11c2?_0x498284[_0xe23c('0x1f')]:_0x39e372[_0xe23c('0x20')]+_0x39e372[_0xe23c('0x1e')];var _0x2cafe6;if(_0x4405cf>=_0x2c385d){_0x4405cf=_0x2c385d;_0x2cafe6=0xc8;}else{_0x2cafe6=0xce;}_0x148e87[_0xe23c('0x1a')](_0x2cafe6);return _0x148e87[_0xe23c('0x21')](_0xe23c('0x22'),_0x134bd8+'-'+_0x4405cf+'/'+_0x2c385d)['json'](_0x498284);}return null;};}function patchUpdates(_0x495e61){return function(_0x3d7de1){try{jsonpatch[_0xe23c('0x23')](_0x3d7de1,_0x495e61,!![]);}catch(_0x426d1e){return BPromise['reject'](_0x426d1e);}return _0x3d7de1[_0xe23c('0x24')]();};}function saveUpdates(_0x3a2e19,_0x41e0da){return function(_0x1d9c0e){if(_0x1d9c0e){return _0x1d9c0e[_0xe23c('0x25')](_0x3a2e19)['then'](function(_0x356456){return _0x356456;});}return null;};}function removeEntity(_0x1e4f6a,_0xdce6b5){return function(_0x1611ea){if(_0x1611ea){return _0x1611ea[_0xe23c('0x26')]()[_0xe23c('0x27')](function(){_0x1e4f6a[_0xe23c('0x1a')](0xcc)[_0xe23c('0x1b')]();});}};}function handleEntityNotFound(_0x493370,_0x2bf123){return function(_0x2a947a){if(!_0x2a947a){_0x493370[_0xe23c('0x19')](0x194);}return _0x2a947a;};}function handleError(_0x5bd54d,_0x3000bd){_0x3000bd=_0x3000bd||0x1f4;return function(_0x56df1f){logger[_0xe23c('0x28')](_0x56df1f['stack']);if(_0x56df1f['name']){delete _0x56df1f[_0xe23c('0x29')];}_0x5bd54d[_0xe23c('0x1a')](_0x3000bd)[_0xe23c('0x2a')](_0x56df1f);};}exports[_0xe23c('0x2b')]=function(_0x5ed9e8,_0x59f8a1){var _0x189f59={},_0x390e61={},_0x3e2631={'count':0x0,'rows':[]};var _0x528778=_[_0xe23c('0x2c')](db[_0xe23c('0x2d')][_0xe23c('0x2e')],function(_0x140210){return{'name':_0x140210['fieldName'],'type':_0x140210[_0xe23c('0x2f')][_0xe23c('0x30')]};});_0x390e61[_0xe23c('0x31')]=_[_0xe23c('0x2c')](_0x528778,_0xe23c('0x29'));_0x390e61[_0xe23c('0x32')]=_[_0xe23c('0x33')](_0x5ed9e8['query']);_0x390e61[_0xe23c('0x34')]=_[_0xe23c('0x35')](_0x390e61['model'],_0x390e61[_0xe23c('0x32')]);_0x189f59['attributes']=_['intersection'](_0x390e61[_0xe23c('0x31')],qs['fields'](_0x5ed9e8[_0xe23c('0x32')][_0xe23c('0x36')]));_0x189f59[_0xe23c('0x37')]=_0x189f59[_0xe23c('0x37')][_0xe23c('0x38')]?_0x189f59[_0xe23c('0x37')]:_0x390e61[_0xe23c('0x31')];if(!_0x5ed9e8[_0xe23c('0x32')]['hasOwnProperty'](_0xe23c('0x39'))){_0x189f59[_0xe23c('0x1e')]=qs['limit'](_0x5ed9e8['query'][_0xe23c('0x1e')]);_0x189f59[_0xe23c('0x20')]=qs['offset'](_0x5ed9e8[_0xe23c('0x32')]['offset']);}_0x189f59['order']=qs[_0xe23c('0x3a')](_0x5ed9e8[_0xe23c('0x32')][_0xe23c('0x3a')]);_0x189f59[_0xe23c('0x3b')]=qs['filters'](_[_0xe23c('0x3c')](_0x5ed9e8['query'],_0x390e61[_0xe23c('0x34')]),_0x528778);if(_0x5ed9e8[_0xe23c('0x32')][_0xe23c('0x3d')]){_0x189f59[_0xe23c('0x3b')]=_[_0xe23c('0x3e')](_0x189f59[_0xe23c('0x3b')],{'$or':_[_0xe23c('0x2c')](_0x528778,function(_0x5339af){if(_0x5339af['type']!=='VIRTUAL'){var _0x30b642={};_0x30b642[_0x5339af['name']]={'$like':'%'+_0x5ed9e8['query'][_0xe23c('0x3d')]+'%'};return _0x30b642;}})});}_0x189f59=_[_0xe23c('0x3e')]({},_0x189f59,_0x5ed9e8[_0xe23c('0x3f')]);var _0x54db7a={'where':_0x189f59[_0xe23c('0x3b')]};return db[_0xe23c('0x2d')][_0xe23c('0x1f')](_0x54db7a)['then'](function(_0x466cd1){_0x3e2631['count']=_0x466cd1;if(_0x5ed9e8[_0xe23c('0x32')][_0xe23c('0x40')]){_0x189f59[_0xe23c('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xe23c('0x42')](_0x189f59);})[_0xe23c('0x27')](function(_0xed7092){_0x3e2631[_0xe23c('0x43')]=_0xed7092;return _0x3e2631;})[_0xe23c('0x27')](respondWithFilteredResult(_0x59f8a1,_0x189f59))[_0xe23c('0x44')](handleError(_0x59f8a1,null));};exports[_0xe23c('0x45')]=function(_0x5a8d74,_0x884c8){var _0x2025e6={'raw':!![],'where':{'id':_0x5a8d74[_0xe23c('0x46')]['id']}},_0x4ec9e8={};_0x4ec9e8[_0xe23c('0x31')]=_['keys'](db[_0xe23c('0x2d')][_0xe23c('0x2e')]);_0x4ec9e8['query']=_[_0xe23c('0x33')](_0x5a8d74[_0xe23c('0x32')]);_0x4ec9e8[_0xe23c('0x34')]=_[_0xe23c('0x35')](_0x4ec9e8[_0xe23c('0x31')],_0x4ec9e8[_0xe23c('0x32')]);_0x2025e6[_0xe23c('0x37')]=_[_0xe23c('0x35')](_0x4ec9e8[_0xe23c('0x31')],qs[_0xe23c('0x36')](_0x5a8d74[_0xe23c('0x32')][_0xe23c('0x36')]));_0x2025e6[_0xe23c('0x37')]=_0x2025e6[_0xe23c('0x37')][_0xe23c('0x38')]?_0x2025e6[_0xe23c('0x37')]:_0x4ec9e8['model'];if(_0x5a8d74[_0xe23c('0x32')][_0xe23c('0x40')]){_0x2025e6[_0xe23c('0x41')]=[{'all':!![]}];}_0x2025e6=_[_0xe23c('0x3e')]({},_0x2025e6,_0x5a8d74['options']);return db[_0xe23c('0x2d')][_0xe23c('0x47')](_0x2025e6)[_0xe23c('0x27')](handleEntityNotFound(_0x884c8,null))[_0xe23c('0x27')](respondWithResult(_0x884c8,null))[_0xe23c('0x44')](handleError(_0x884c8,null));};exports[_0xe23c('0x48')]=function(_0x2b3f3f,_0x3a0b0b){return db[_0xe23c('0x2d')][_0xe23c('0x48')](_0x2b3f3f[_0xe23c('0x49')],{})[_0xe23c('0x27')](respondWithResult(_0x3a0b0b,0xc9))[_0xe23c('0x44')](handleError(_0x3a0b0b,null));};exports[_0xe23c('0x25')]=function(_0x3ec9ce,_0x2cf2c5){if(_0x3ec9ce[_0xe23c('0x49')]['id']){delete _0x3ec9ce[_0xe23c('0x49')]['id'];}return db[_0xe23c('0x2d')][_0xe23c('0x47')]({'where':{'id':_0x3ec9ce[_0xe23c('0x46')]['id']}})[_0xe23c('0x27')](handleEntityNotFound(_0x2cf2c5,null))['then'](saveUpdates(_0x3ec9ce[_0xe23c('0x49')],null))[_0xe23c('0x27')](respondWithResult(_0x2cf2c5,null))[_0xe23c('0x44')](handleError(_0x2cf2c5,null));};exports[_0xe23c('0x26')]=function(_0x401c71,_0x38a2ba){return db[_0xe23c('0x2d')][_0xe23c('0x47')]({'where':{'id':_0x401c71[_0xe23c('0x46')]['id']}})[_0xe23c('0x27')](handleEntityNotFound(_0x38a2ba,null))[_0xe23c('0x27')](removeEntity(_0x38a2ba,null))[_0xe23c('0x44')](handleError(_0x38a2ba,null));};exports[_0xe23c('0x4a')]=function(_0x580198,_0x4159c1){return db[_0xe23c('0x2d')][_0xe23c('0x4a')]()[_0xe23c('0x27')](respondWithResult(_0x4159c1,null))[_0xe23c('0x44')](handleError(_0x4159c1,null));};
\ No newline at end of file
+var _0xef5a=['type','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','status','error','stack','name','index','map','JscriptyQuestionReport','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x1ebdc1,_0x2ec1b1){var _0x2a4933=function(_0xc03392){while(--_0xc03392){_0x1ebdc1['push'](_0x1ebdc1['shift']());}};_0x2a4933(++_0x2ec1b1);}(_0xef5a,0x1e0));var _0xaef5=function(_0x418c4c,_0x189f5f){_0x418c4c=_0x418c4c-0x0;var _0x7f71a2=_0xef5a[_0x418c4c];return _0x7f71a2;};'use strict';var emlformat=require(_0xaef5('0x0'));var rimraf=require(_0xaef5('0x1'));var zipdir=require(_0xaef5('0x2'));var jsonpatch=require(_0xaef5('0x3'));var rp=require(_0xaef5('0x4'));var moment=require(_0xaef5('0x5'));var BPromise=require(_0xaef5('0x6'));var Mustache=require(_0xaef5('0x7'));var util=require(_0xaef5('0x8'));var path=require('path');var sox=require(_0xaef5('0x9'));var csv=require(_0xaef5('0xa'));var ejs=require(_0xaef5('0xb'));var fs=require('fs');var fs_extra=require(_0xaef5('0xc'));var _=require(_0xaef5('0xd'));var squel=require(_0xaef5('0xe'));var crypto=require('crypto');var jsforce=require(_0xaef5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xaef5('0xa'));var querystring=require(_0xaef5('0x10'));var Papa=require(_0xaef5('0x11'));var Redis=require(_0xaef5('0x12'));var authService=require(_0xaef5('0x13'));var qs=require(_0xaef5('0x14'));var as=require(_0xaef5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaef5('0x16'))(_0xaef5('0x17'));var utils=require(_0xaef5('0x18'));var config=require(_0xaef5('0x19'));var licenseUtil=require(_0xaef5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ec5fd,_0x55f600){_0x55f600=_0x55f600||0xcc;return function(_0x5cf653){if(_0x5cf653){return _0x4ec5fd[_0xaef5('0x1b')](_0x55f600);}return _0x4ec5fd['status'](_0x55f600)[_0xaef5('0x1c')]();};}function respondWithResult(_0x560b44,_0x28c9b8){_0x28c9b8=_0x28c9b8||0xc8;return function(_0x5b6ede){if(_0x5b6ede){return _0x560b44['status'](_0x28c9b8)['json'](_0x5b6ede);}};}function respondWithFilteredResult(_0xce318a,_0x1c33b5){return function(_0x134fc9){if(_0x134fc9){var _0x38b32e=typeof _0x1c33b5[_0xaef5('0x1d')]===_0xaef5('0x1e')&&typeof _0x1c33b5['limit']===_0xaef5('0x1e');var _0x380566=_0x134fc9[_0xaef5('0x1f')];var _0x22abac=_0x38b32e?0x0:_0x1c33b5[_0xaef5('0x1d')];var _0x5ad611=_0x38b32e?_0x134fc9[_0xaef5('0x1f')]:_0x1c33b5[_0xaef5('0x1d')]+_0x1c33b5[_0xaef5('0x20')];var _0x42c0a9;if(_0x5ad611>=_0x380566){_0x5ad611=_0x380566;_0x42c0a9=0xc8;}else{_0x42c0a9=0xce;}_0xce318a['status'](_0x42c0a9);return _0xce318a[_0xaef5('0x21')](_0xaef5('0x22'),_0x22abac+'-'+_0x5ad611+'/'+_0x380566)[_0xaef5('0x23')](_0x134fc9);}return null;};}function patchUpdates(_0x27d37c){return function(_0x493c7d){try{jsonpatch[_0xaef5('0x24')](_0x493c7d,_0x27d37c,!![]);}catch(_0x509f27){return BPromise[_0xaef5('0x25')](_0x509f27);}return _0x493c7d[_0xaef5('0x26')]();};}function saveUpdates(_0x3c62fb,_0x384497){return function(_0x5683b7){if(_0x5683b7){return _0x5683b7[_0xaef5('0x27')](_0x3c62fb)['then'](function(_0x5d7680){return _0x5d7680;});}return null;};}function removeEntity(_0x32d62c,_0x43e7af){return function(_0x2e7544){if(_0x2e7544){return _0x2e7544[_0xaef5('0x28')]()[_0xaef5('0x29')](function(){_0x32d62c[_0xaef5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e620a,_0x10559c){return function(_0x3465e7){if(!_0x3465e7){_0x3e620a[_0xaef5('0x1b')](0x194);}return _0x3465e7;};}function handleError(_0x29cabb,_0x195283){_0x195283=_0x195283||0x1f4;return function(_0x50e681){logger[_0xaef5('0x2b')](_0x50e681[_0xaef5('0x2c')]);if(_0x50e681[_0xaef5('0x2d')]){delete _0x50e681['name'];}_0x29cabb[_0xaef5('0x2a')](_0x195283)['send'](_0x50e681);};}exports[_0xaef5('0x2e')]=function(_0x418aaa,_0x5d475f){var _0x510b21={},_0x35b062={},_0x4ac506={'count':0x0,'rows':[]};var _0x102ef7=_[_0xaef5('0x2f')](db[_0xaef5('0x30')]['rawAttributes'],function(_0x4997b9){return{'name':_0x4997b9[_0xaef5('0x31')],'type':_0x4997b9['type'][_0xaef5('0x32')]};});_0x35b062[_0xaef5('0x33')]=_[_0xaef5('0x2f')](_0x102ef7,'name');_0x35b062['query']=_[_0xaef5('0x34')](_0x418aaa[_0xaef5('0x35')]);_0x35b062[_0xaef5('0x36')]=_[_0xaef5('0x37')](_0x35b062[_0xaef5('0x33')],_0x35b062[_0xaef5('0x35')]);_0x510b21[_0xaef5('0x38')]=_[_0xaef5('0x37')](_0x35b062[_0xaef5('0x33')],qs[_0xaef5('0x39')](_0x418aaa[_0xaef5('0x35')][_0xaef5('0x39')]));_0x510b21[_0xaef5('0x38')]=_0x510b21[_0xaef5('0x38')][_0xaef5('0x3a')]?_0x510b21['attributes']:_0x35b062[_0xaef5('0x33')];if(!_0x418aaa['query'][_0xaef5('0x3b')](_0xaef5('0x3c'))){_0x510b21[_0xaef5('0x20')]=qs['limit'](_0x418aaa['query'][_0xaef5('0x20')]);_0x510b21[_0xaef5('0x1d')]=qs['offset'](_0x418aaa[_0xaef5('0x35')][_0xaef5('0x1d')]);}_0x510b21['order']=qs['sort'](_0x418aaa[_0xaef5('0x35')][_0xaef5('0x3d')]);_0x510b21[_0xaef5('0x3e')]=qs[_0xaef5('0x36')](_[_0xaef5('0x3f')](_0x418aaa['query'],_0x35b062[_0xaef5('0x36')]),_0x102ef7);if(_0x418aaa[_0xaef5('0x35')][_0xaef5('0x40')]){_0x510b21[_0xaef5('0x3e')]=_[_0xaef5('0x41')](_0x510b21[_0xaef5('0x3e')],{'$or':_[_0xaef5('0x2f')](_0x102ef7,function(_0x348038){if(_0x348038[_0xaef5('0x42')]!=='VIRTUAL'){var _0x1a7354={};_0x1a7354[_0x348038[_0xaef5('0x2d')]]={'$like':'%'+_0x418aaa[_0xaef5('0x35')][_0xaef5('0x40')]+'%'};return _0x1a7354;}})});}_0x510b21=_[_0xaef5('0x41')]({},_0x510b21,_0x418aaa[_0xaef5('0x43')]);var _0x2f037={'where':_0x510b21[_0xaef5('0x3e')]};return db[_0xaef5('0x30')][_0xaef5('0x1f')](_0x2f037)[_0xaef5('0x29')](function(_0x290704){_0x4ac506[_0xaef5('0x1f')]=_0x290704;if(_0x418aaa[_0xaef5('0x35')][_0xaef5('0x44')]){_0x510b21[_0xaef5('0x45')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x510b21);})[_0xaef5('0x29')](function(_0x3c5ad5){_0x4ac506['rows']=_0x3c5ad5;return _0x4ac506;})[_0xaef5('0x29')](respondWithFilteredResult(_0x5d475f,_0x510b21))[_0xaef5('0x46')](handleError(_0x5d475f,null));};exports[_0xaef5('0x47')]=function(_0x149562,_0x2111aa){var _0xa823e2={'raw':!![],'where':{'id':_0x149562[_0xaef5('0x48')]['id']}},_0x143da5={};_0x143da5['model']=_[_0xaef5('0x34')](db[_0xaef5('0x30')][_0xaef5('0x49')]);_0x143da5[_0xaef5('0x35')]=_[_0xaef5('0x34')](_0x149562[_0xaef5('0x35')]);_0x143da5['filters']=_[_0xaef5('0x37')](_0x143da5[_0xaef5('0x33')],_0x143da5['query']);_0xa823e2[_0xaef5('0x38')]=_[_0xaef5('0x37')](_0x143da5[_0xaef5('0x33')],qs[_0xaef5('0x39')](_0x149562[_0xaef5('0x35')][_0xaef5('0x39')]));_0xa823e2[_0xaef5('0x38')]=_0xa823e2['attributes'][_0xaef5('0x3a')]?_0xa823e2[_0xaef5('0x38')]:_0x143da5[_0xaef5('0x33')];if(_0x149562[_0xaef5('0x35')][_0xaef5('0x44')]){_0xa823e2['include']=[{'all':!![]}];}_0xa823e2=_[_0xaef5('0x41')]({},_0xa823e2,_0x149562[_0xaef5('0x43')]);return db['JscriptyQuestionReport'][_0xaef5('0x4a')](_0xa823e2)[_0xaef5('0x29')](handleEntityNotFound(_0x2111aa,null))['then'](respondWithResult(_0x2111aa,null))[_0xaef5('0x46')](handleError(_0x2111aa,null));};exports[_0xaef5('0x4b')]=function(_0x11c5e2,_0x401206){return db['JscriptyQuestionReport'][_0xaef5('0x4b')](_0x11c5e2[_0xaef5('0x4c')],{})[_0xaef5('0x29')](respondWithResult(_0x401206,0xc9))[_0xaef5('0x46')](handleError(_0x401206,null));};exports[_0xaef5('0x27')]=function(_0x2ed3ec,_0x32bc78){if(_0x2ed3ec['body']['id']){delete _0x2ed3ec[_0xaef5('0x4c')]['id'];}return db[_0xaef5('0x30')][_0xaef5('0x4a')]({'where':{'id':_0x2ed3ec[_0xaef5('0x48')]['id']}})[_0xaef5('0x29')](handleEntityNotFound(_0x32bc78,null))['then'](saveUpdates(_0x2ed3ec[_0xaef5('0x4c')],null))[_0xaef5('0x29')](respondWithResult(_0x32bc78,null))['catch'](handleError(_0x32bc78,null));};exports[_0xaef5('0x28')]=function(_0x116751,_0x26e76c){return db['JscriptyQuestionReport'][_0xaef5('0x4a')]({'where':{'id':_0x116751[_0xaef5('0x48')]['id']}})[_0xaef5('0x29')](handleEntityNotFound(_0x26e76c,null))[_0xaef5('0x29')](removeEntity(_0x26e76c,null))[_0xaef5('0x46')](handleError(_0x26e76c,null));};exports[_0xaef5('0x4d')]=function(_0x3e695b,_0x442fc1){return db[_0xaef5('0x30')]['describe']()[_0xaef5('0x29')](respondWithResult(_0x442fc1,null))[_0xaef5('0x46')](handleError(_0x442fc1,null));};
\ No newline at end of file
index e5cda18..99680d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cfb=['report_jscripty_questions','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyQuestionReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3cfb,0x16c));var _0xb3cf=function(_0x4d75e2,_0x1243d4){_0x4d75e2=_0x4d75e2-0x0;var _0x44d222=_0x3cfb[_0x4d75e2];return _0x44d222;};'use strict';var _=require('lodash');var util=require(_0xb3cf('0x0'));var logger=require('../../config/logger')(_0xb3cf('0x1'));var moment=require(_0xb3cf('0x2'));var BPromise=require('bluebird');var rp=require(_0xb3cf('0x3'));var fs=require('fs');var path=require(_0xb3cf('0x4'));var rimraf=require(_0xb3cf('0x5'));var config=require(_0xb3cf('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xb3cf('0x7')]=function(_0x5da4ba,_0x153f9a){return _0x5da4ba[_0xb3cf('0x8')](_0xb3cf('0x9'),attributes,{'tableName':_0xb3cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f01=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x11cf32,_0x560d24){var _0x163a94=function(_0x6a41b8){while(--_0x6a41b8){_0x11cf32['push'](_0x11cf32['shift']());}};_0x163a94(++_0x560d24);}(_0x7f01,0x1bf));var _0x17f0=function(_0x5dbefe,_0x489209){_0x5dbefe=_0x5dbefe-0x0;var _0xa1635e=_0x7f01[_0x5dbefe];return _0xa1635e;};'use strict';var _=require(_0x17f0('0x0'));var util=require(_0x17f0('0x1'));var logger=require(_0x17f0('0x2'))(_0x17f0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x17f0('0x4'));var fs=require('fs');var path=require(_0x17f0('0x5'));var rimraf=require('rimraf');var config=require(_0x17f0('0x6'));var attributes=require(_0x17f0('0x7'));module[_0x17f0('0x8')]=function(_0x55ecb1,_0x57d560){return _0x55ecb1[_0x17f0('0x9')](_0x17f0('0xa'),attributes,{'tableName':_0x17f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a300080..991afed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a3c=['jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a3c,0xe7));var _0xc3a3=function(_0x3d57b9,_0x287b2c){_0x3d57b9=_0x3d57b9-0x0;var _0x40dd90=_0x3a3c[_0x3d57b9];return _0x40dd90;};'use strict';var _=require(_0xc3a3('0x0'));var util=require(_0xc3a3('0x1'));var moment=require(_0xc3a3('0x2'));var BPromise=require(_0xc3a3('0x3'));var rs=require(_0xc3a3('0x4'));var fs=require('fs');var Redis=require(_0xc3a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3a3('0x6'));var logger=require(_0xc3a3('0x7'))('rpc');var config=require(_0xc3a3('0x8'));var jayson=require(_0xc3a3('0x9'));var client=jayson[_0xc3a3('0xa')][_0xc3a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x142575,_0x534e91,_0x5cff95){return new BPromise(function(_0x1f6835,_0x40df83){return client[_0xc3a3('0xc')](_0x142575,_0x5cff95)[_0xc3a3('0xd')](function(_0x14e5b2){logger['info'](_0xc3a3('0xe'),_0x534e91,_0xc3a3('0xf'));logger[_0xc3a3('0x10')](_0xc3a3('0x11'),_0x534e91,'request\x20sent',JSON[_0xc3a3('0x12')](_0x14e5b2));if(_0x14e5b2[_0xc3a3('0x13')]){if(_0x14e5b2[_0xc3a3('0x13')][_0xc3a3('0x14')]===0x1f4){logger[_0xc3a3('0x13')](_0xc3a3('0xe'),_0x534e91,_0x14e5b2['error'][_0xc3a3('0x15')]);return _0x40df83(_0x14e5b2[_0xc3a3('0x13')][_0xc3a3('0x15')]);}logger[_0xc3a3('0x13')](_0xc3a3('0xe'),_0x534e91,_0x14e5b2[_0xc3a3('0x13')]['message']);return _0x1f6835(_0x14e5b2[_0xc3a3('0x13')][_0xc3a3('0x15')]);}else{logger[_0xc3a3('0x16')](_0xc3a3('0xe'),_0x534e91,_0xc3a3('0xf'));_0x1f6835(_0x14e5b2['result'][_0xc3a3('0x15')]);}})[_0xc3a3('0x17')](function(_0x1d1e6b){logger['error'](_0xc3a3('0xe'),_0x534e91,_0x1d1e6b);_0x40df83(_0x1d1e6b);});});}
\ No newline at end of file
+var _0x705f=['message','request\x20sent','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1e2bce,_0x2339de){var _0x14d227=function(_0x143a69){while(--_0x143a69){_0x1e2bce['push'](_0x1e2bce['shift']());}};_0x14d227(++_0x2339de);}(_0x705f,0x11f));var _0xf705=function(_0x4d9947,_0x12e363){_0x4d9947=_0x4d9947-0x0;var _0x264ae9=_0x705f[_0x4d9947];return _0x264ae9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf705('0x0'));var BPromise=require('bluebird');var rs=require(_0xf705('0x1'));var fs=require('fs');var Redis=require(_0xf705('0x2'));var db=require(_0xf705('0x3'))['db'];var utils=require(_0xf705('0x4'));var logger=require(_0xf705('0x5'))(_0xf705('0x6'));var config=require(_0xf705('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf705('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17831d,_0x1dcff6,_0x536eae){return new BPromise(function(_0x160a72,_0x59c4cb){return client[_0xf705('0x9')](_0x17831d,_0x536eae)[_0xf705('0xa')](function(_0x1fae78){logger[_0xf705('0xb')](_0xf705('0xc'),_0x1dcff6,'request\x20sent');logger[_0xf705('0xd')](_0xf705('0xe'),_0x1dcff6,'request\x20sent',JSON['stringify'](_0x1fae78));if(_0x1fae78[_0xf705('0xf')]){if(_0x1fae78[_0xf705('0xf')][_0xf705('0x10')]===0x1f4){logger[_0xf705('0xf')](_0xf705('0xc'),_0x1dcff6,_0x1fae78[_0xf705('0xf')][_0xf705('0x11')]);return _0x59c4cb(_0x1fae78[_0xf705('0xf')][_0xf705('0x11')]);}logger[_0xf705('0xf')](_0xf705('0xc'),_0x1dcff6,_0x1fae78[_0xf705('0xf')][_0xf705('0x11')]);return _0x160a72(_0x1fae78['error']['message']);}else{logger[_0xf705('0xb')](_0xf705('0xc'),_0x1dcff6,_0xf705('0x12'));_0x160a72(_0x1fae78['result'][_0xf705('0x11')]);}})['catch'](function(_0x22b674){logger[_0xf705('0xf')](_0xf705('0xc'),_0x1dcff6,_0x22b674);_0x59c4cb(_0x22b674);});});}
\ No newline at end of file
index 00a2cd6..9aa8650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fec=['./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','show','/:id/questions','getQuestions','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x6fec,0x80));var _0xc6fe=function(_0xeeb2bc,_0x3a5c02){_0xeeb2bc=_0xeeb2bc-0x0;var _0x4b9dcf=_0x6fec[_0xeeb2bc];return _0x4b9dcf;};'use strict';var multer=require(_0xc6fe('0x0'));var util=require(_0xc6fe('0x1'));var path=require(_0xc6fe('0x2'));var timeout=require(_0xc6fe('0x3'));var express=require(_0xc6fe('0x4'));var router=express[_0xc6fe('0x5')]();var fs_extra=require(_0xc6fe('0x6'));var auth=require(_0xc6fe('0x7'));var interaction=require(_0xc6fe('0x8'));var config=require(_0xc6fe('0x9'));var controller=require(_0xc6fe('0xa'));router[_0xc6fe('0xb')]('/',auth[_0xc6fe('0xc')](),controller[_0xc6fe('0xd')]);router[_0xc6fe('0xb')]('/describe',auth[_0xc6fe('0xc')](),controller[_0xc6fe('0xe')]);router[_0xc6fe('0xb')](_0xc6fe('0xf'),auth['isAuthenticated'](),controller[_0xc6fe('0x10')]);router[_0xc6fe('0xb')](_0xc6fe('0x11'),auth[_0xc6fe('0xc')](),controller[_0xc6fe('0x12')]);router[_0xc6fe('0x13')]('/',auth[_0xc6fe('0xc')](),controller['create']);router[_0xc6fe('0x14')](_0xc6fe('0xf'),auth[_0xc6fe('0xc')](),controller['update']);router['delete'](_0xc6fe('0xf'),auth['isAuthenticated'](),controller[_0xc6fe('0x15')]);module[_0xc6fe('0x16')]=router;
\ No newline at end of file
+var _0x46e4=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/:id','isAuthenticated','show','/:id/questions','getQuestions','post','put','delete','destroy','exports','multer','util','path'];(function(_0x28b34a,_0xa6b502){var _0x403f86=function(_0x2fd878){while(--_0x2fd878){_0x28b34a['push'](_0x28b34a['shift']());}};_0x403f86(++_0xa6b502);}(_0x46e4,0xcf));var _0x446e=function(_0x3b04f3,_0x507854){_0x3b04f3=_0x3b04f3-0x0;var _0x2fbc54=_0x46e4[_0x3b04f3];return _0x2fbc54;};'use strict';var multer=require(_0x446e('0x0'));var util=require(_0x446e('0x1'));var path=require(_0x446e('0x2'));var timeout=require(_0x446e('0x3'));var express=require('express');var router=express[_0x446e('0x4')]();var fs_extra=require(_0x446e('0x5'));var auth=require(_0x446e('0x6'));var interaction=require(_0x446e('0x7'));var config=require(_0x446e('0x8'));var controller=require(_0x446e('0x9'));router[_0x446e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x446e('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x446e('0xb'),auth[_0x446e('0xc')](),controller[_0x446e('0xd')]);router[_0x446e('0xa')](_0x446e('0xe'),auth[_0x446e('0xc')](),controller[_0x446e('0xf')]);router[_0x446e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x446e('0x11')](_0x446e('0xb'),auth[_0x446e('0xc')](),controller['update']);router[_0x446e('0x12')](_0x446e('0xb'),auth[_0x446e('0xc')](),controller[_0x446e('0x13')]);module[_0x446e('0x14')]=router;
\ No newline at end of file
index d5dc192..0ba34cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb442=['exports','DATE','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize'];(function(_0x529d93,_0x18017e){var _0x302538=function(_0x261dd0){while(--_0x261dd0){_0x529d93['push'](_0x529d93['shift']());}};_0x302538(++_0x18017e);}(_0xb442,0x7d));var _0x2b44=function(_0x58f1ef,_0x4cf4d5){_0x58f1ef=_0x58f1ef-0x0;var _0x2ef772=_0xb442[_0x58f1ef];return _0x2ef772;};'use strict';var moment=require('moment');var Sequelize=require(_0x2b44('0x0'));module[_0x2b44('0x1')]={'starttime':{'type':Sequelize[_0x2b44('0x2')],'set':function(_0x1c5bab){this[_0x2b44('0x3')](_0x2b44('0x4'),_0x1c5bab);this['setDataValue']('endtime',moment()['format'](_0x2b44('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2b44('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2b44('0x6')]},'calleridnum':{'type':Sequelize[_0x2b44('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xed98=['moment','sequelize','exports','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x48ebe8,_0x300832){var _0x5c65fb=function(_0x55a95b){while(--_0x55a95b){_0x48ebe8['push'](_0x48ebe8['shift']());}};_0x5c65fb(++_0x300832);}(_0xed98,0x17c));var _0x8ed9=function(_0x5b39ad,_0xdab682){_0x5b39ad=_0x5b39ad-0x0;var _0x1d4c17=_0xed98[_0x5b39ad];return _0x1d4c17;};'use strict';var moment=require(_0x8ed9('0x0'));var Sequelize=require(_0x8ed9('0x1'));module[_0x8ed9('0x2')]={'starttime':{'type':Sequelize[_0x8ed9('0x3')],'set':function(_0x23e9dd){this[_0x8ed9('0x4')](_0x8ed9('0x5'),_0x23e9dd);this[_0x8ed9('0x4')]('endtime',moment()[_0x8ed9('0x6')](_0x8ed9('0x7')));}},'endtime':{'type':Sequelize[_0x8ed9('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x8ed9('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8ed9('0x8')]},'calleridname':{'type':Sequelize[_0x8ed9('0x8')]},'calleridnum':{'type':Sequelize[_0x8ed9('0x8')]},'completed':{'type':Sequelize[_0x8ed9('0x9')],'defaultValue':![]}};
\ No newline at end of file
index 0b7981f..36fb1cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a89=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','destroy','then','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','merge','options','include','JscriptySessionReport','findAll','rows','show','params','includeAll','catch','create','body','find','describe','getQuestions','findOne','sort','JscriptyQuestionReport','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8a89,0x8e));var _0x98a8=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0x8a89[_0x5b740b];return _0x6f8f4e;};'use strict';var emlformat=require(_0x98a8('0x0'));var rimraf=require(_0x98a8('0x1'));var zipdir=require(_0x98a8('0x2'));var jsonpatch=require(_0x98a8('0x3'));var rp=require(_0x98a8('0x4'));var moment=require(_0x98a8('0x5'));var BPromise=require(_0x98a8('0x6'));var Mustache=require('mustache');var util=require(_0x98a8('0x7'));var path=require(_0x98a8('0x8'));var sox=require(_0x98a8('0x9'));var csv=require(_0x98a8('0xa'));var ejs=require(_0x98a8('0xb'));var fs=require('fs');var fs_extra=require(_0x98a8('0xc'));var _=require(_0x98a8('0xd'));var squel=require(_0x98a8('0xe'));var crypto=require(_0x98a8('0xf'));var jsforce=require(_0x98a8('0x10'));var deskjs=require(_0x98a8('0x11'));var toCsv=require(_0x98a8('0xa'));var querystring=require(_0x98a8('0x12'));var Papa=require(_0x98a8('0x13'));var Redis=require(_0x98a8('0x14'));var authService=require(_0x98a8('0x15'));var qs=require(_0x98a8('0x16'));var as=require(_0x98a8('0x17'));var hardwareService=require(_0x98a8('0x18'));var logger=require(_0x98a8('0x19'))('api');var utils=require(_0x98a8('0x1a'));var config=require(_0x98a8('0x1b'));var licenseUtil=require(_0x98a8('0x1c'));var db=require(_0x98a8('0x1d'))['db'];function respondWithStatusCode(_0x3843f3,_0x4c3cb5){_0x4c3cb5=_0x4c3cb5||0xcc;return function(_0x59ae40){if(_0x59ae40){return _0x3843f3[_0x98a8('0x1e')](_0x4c3cb5);}return _0x3843f3[_0x98a8('0x1f')](_0x4c3cb5)[_0x98a8('0x20')]();};}function respondWithResult(_0x43a583,_0x1fb3f4){_0x1fb3f4=_0x1fb3f4||0xc8;return function(_0x252c0e){if(_0x252c0e){return _0x43a583[_0x98a8('0x1f')](_0x1fb3f4)[_0x98a8('0x21')](_0x252c0e);}};}function respondWithFilteredResult(_0x5ed0cc,_0x5eb8b5){return function(_0x363514){if(_0x363514){var _0x463825=typeof _0x5eb8b5[_0x98a8('0x22')]==='undefined'&&typeof _0x5eb8b5[_0x98a8('0x23')]===_0x98a8('0x24');var _0xc9c8f2=_0x363514[_0x98a8('0x25')];var _0x2c5c3a=_0x463825?0x0:_0x5eb8b5[_0x98a8('0x22')];var _0x520f3c=_0x463825?_0x363514[_0x98a8('0x25')]:_0x5eb8b5['offset']+_0x5eb8b5[_0x98a8('0x23')];var _0x2fd5cb;if(_0x520f3c>=_0xc9c8f2){_0x520f3c=_0xc9c8f2;_0x2fd5cb=0xc8;}else{_0x2fd5cb=0xce;}_0x5ed0cc[_0x98a8('0x1f')](_0x2fd5cb);return _0x5ed0cc['set'](_0x98a8('0x26'),_0x2c5c3a+'-'+_0x520f3c+'/'+_0xc9c8f2)[_0x98a8('0x21')](_0x363514);}return null;};}function patchUpdates(_0x33189e){return function(_0x2cc434){try{jsonpatch[_0x98a8('0x27')](_0x2cc434,_0x33189e,!![]);}catch(_0x3d4dd6){return BPromise['reject'](_0x3d4dd6);}return _0x2cc434['save']();};}function saveUpdates(_0x3bbe1c,_0x520c8d){return function(_0x357d87){if(_0x357d87){return _0x357d87[_0x98a8('0x28')](_0x3bbe1c)['then'](function(_0x387996){return _0x387996;});}return null;};}function removeEntity(_0x135c5f,_0x4af888){return function(_0x5e1e5f){if(_0x5e1e5f){return _0x5e1e5f[_0x98a8('0x29')]()[_0x98a8('0x2a')](function(){_0x135c5f[_0x98a8('0x1f')](0xcc)[_0x98a8('0x20')]();});}};}function handleEntityNotFound(_0x1e7e6b,_0x1bf072){return function(_0x2bafa3){if(!_0x2bafa3){_0x1e7e6b['sendStatus'](0x194);}return _0x2bafa3;};}function handleError(_0xcfaf43,_0x4eeb75){_0x4eeb75=_0x4eeb75||0x1f4;return function(_0x3f445a){logger['error'](_0x3f445a['stack']);if(_0x3f445a[_0x98a8('0x2b')]){delete _0x3f445a[_0x98a8('0x2b')];}_0xcfaf43[_0x98a8('0x1f')](_0x4eeb75)[_0x98a8('0x2c')](_0x3f445a);};}exports[_0x98a8('0x2d')]=function(_0x435f54,_0x8e738c){var _0x5d0647={},_0x521671={},_0x43c439={'count':0x0,'rows':[]};var _0x1d4c2a=_[_0x98a8('0x2e')](db['JscriptySessionReport'][_0x98a8('0x2f')],function(_0x48563d){return{'name':_0x48563d[_0x98a8('0x30')],'type':_0x48563d['type'][_0x98a8('0x31')]};});_0x521671[_0x98a8('0x32')]=_[_0x98a8('0x2e')](_0x1d4c2a,_0x98a8('0x2b'));_0x521671[_0x98a8('0x33')]=_[_0x98a8('0x34')](_0x435f54[_0x98a8('0x33')]);_0x521671[_0x98a8('0x35')]=_[_0x98a8('0x36')](_0x521671['model'],_0x521671[_0x98a8('0x33')]);_0x5d0647[_0x98a8('0x37')]=_[_0x98a8('0x36')](_0x521671[_0x98a8('0x32')],qs['fields'](_0x435f54[_0x98a8('0x33')][_0x98a8('0x38')]));_0x5d0647[_0x98a8('0x37')]=_0x5d0647[_0x98a8('0x37')][_0x98a8('0x39')]?_0x5d0647[_0x98a8('0x37')]:_0x521671[_0x98a8('0x32')];if(!_0x435f54[_0x98a8('0x33')][_0x98a8('0x3a')](_0x98a8('0x3b'))){_0x5d0647[_0x98a8('0x23')]=qs[_0x98a8('0x23')](_0x435f54[_0x98a8('0x33')][_0x98a8('0x23')]);_0x5d0647[_0x98a8('0x22')]=qs[_0x98a8('0x22')](_0x435f54['query'][_0x98a8('0x22')]);}_0x5d0647[_0x98a8('0x3c')]=qs['sort'](_0x435f54[_0x98a8('0x33')]['sort']);_0x5d0647[_0x98a8('0x3d')]=qs[_0x98a8('0x35')](_[_0x98a8('0x3e')](_0x435f54['query'],_0x521671[_0x98a8('0x35')]),_0x1d4c2a);if(_0x435f54[_0x98a8('0x33')][_0x98a8('0x3f')]){_0x5d0647[_0x98a8('0x3d')]=_['merge'](_0x5d0647[_0x98a8('0x3d')],{'$or':_[_0x98a8('0x2e')](_0x1d4c2a,function(_0x483813){if(_0x483813[_0x98a8('0x40')]!==_0x98a8('0x41')){var _0xac51fe={};_0xac51fe[_0x483813[_0x98a8('0x2b')]]={'$like':'%'+_0x435f54[_0x98a8('0x33')][_0x98a8('0x3f')]+'%'};return _0xac51fe;}})});}_0x5d0647=_[_0x98a8('0x42')]({},_0x5d0647,_0x435f54[_0x98a8('0x43')]);var _0x26ee35={'where':_0x5d0647[_0x98a8('0x3d')]};return db['JscriptySessionReport'][_0x98a8('0x25')](_0x26ee35)['then'](function(_0x43f21d){_0x43c439[_0x98a8('0x25')]=_0x43f21d;if(_0x435f54[_0x98a8('0x33')]['includeAll']){_0x5d0647[_0x98a8('0x44')]=[{'all':!![]}];}return db[_0x98a8('0x45')][_0x98a8('0x46')](_0x5d0647);})[_0x98a8('0x2a')](function(_0x5448c2){_0x43c439[_0x98a8('0x47')]=_0x5448c2;return _0x43c439;})[_0x98a8('0x2a')](respondWithFilteredResult(_0x8e738c,_0x5d0647))['catch'](handleError(_0x8e738c,null));};exports[_0x98a8('0x48')]=function(_0x4ab9cd,_0x56f863){var _0x3344b7={'raw':!![],'where':{'id':_0x4ab9cd[_0x98a8('0x49')]['id']}},_0x546d6a={};_0x546d6a[_0x98a8('0x32')]=_[_0x98a8('0x34')](db['JscriptySessionReport'][_0x98a8('0x2f')]);_0x546d6a[_0x98a8('0x33')]=_[_0x98a8('0x34')](_0x4ab9cd[_0x98a8('0x33')]);_0x546d6a[_0x98a8('0x35')]=_[_0x98a8('0x36')](_0x546d6a[_0x98a8('0x32')],_0x546d6a[_0x98a8('0x33')]);_0x3344b7['attributes']=_[_0x98a8('0x36')](_0x546d6a[_0x98a8('0x32')],qs['fields'](_0x4ab9cd[_0x98a8('0x33')]['fields']));_0x3344b7[_0x98a8('0x37')]=_0x3344b7[_0x98a8('0x37')]['length']?_0x3344b7['attributes']:_0x546d6a[_0x98a8('0x32')];if(_0x4ab9cd[_0x98a8('0x33')][_0x98a8('0x4a')]){_0x3344b7['include']=[{'all':!![]}];}_0x3344b7=_['merge']({},_0x3344b7,_0x4ab9cd[_0x98a8('0x43')]);return db[_0x98a8('0x45')]['find'](_0x3344b7)['then'](handleEntityNotFound(_0x56f863,null))[_0x98a8('0x2a')](respondWithResult(_0x56f863,null))[_0x98a8('0x4b')](handleError(_0x56f863,null));};exports['create']=function(_0xb1a1a2,_0x37ae5a){return db['JscriptySessionReport'][_0x98a8('0x4c')](_0xb1a1a2[_0x98a8('0x4d')],{})['then'](respondWithResult(_0x37ae5a,0xc9))[_0x98a8('0x4b')](handleError(_0x37ae5a,null));};exports['update']=function(_0x111a87,_0x46d374){if(_0x111a87[_0x98a8('0x4d')]['id']){delete _0x111a87[_0x98a8('0x4d')]['id'];}return db[_0x98a8('0x45')][_0x98a8('0x4e')]({'where':{'id':_0x111a87[_0x98a8('0x49')]['id']}})['then'](handleEntityNotFound(_0x46d374,null))[_0x98a8('0x2a')](saveUpdates(_0x111a87[_0x98a8('0x4d')],null))['then'](respondWithResult(_0x46d374,null))[_0x98a8('0x4b')](handleError(_0x46d374,null));};exports[_0x98a8('0x29')]=function(_0x565f4c,_0xae4099){return db[_0x98a8('0x45')][_0x98a8('0x4e')]({'where':{'id':_0x565f4c[_0x98a8('0x49')]['id']}})[_0x98a8('0x2a')](handleEntityNotFound(_0xae4099,null))[_0x98a8('0x2a')](removeEntity(_0xae4099,null))[_0x98a8('0x4b')](handleError(_0xae4099,null));};exports['describe']=function(_0x26bf8f,_0x2abdc1){return db[_0x98a8('0x45')][_0x98a8('0x4f')]()['then'](respondWithResult(_0x2abdc1,null))[_0x98a8('0x4b')](handleError(_0x2abdc1,null));};exports[_0x98a8('0x50')]=function(_0x4b2a1a,_0x43457e,_0x5e3c2f){var _0x460c6d={'raw':!![],'where':{}};var _0x3fe0f1={};var _0x43b103={'count':0x0,'rows':[]};return db[_0x98a8('0x45')][_0x98a8('0x51')]({'where':{'id':_0x4b2a1a[_0x98a8('0x49')]['id']}})[_0x98a8('0x2a')](handleEntityNotFound(_0x43457e,null))[_0x98a8('0x2a')](function(_0x38eb3f){if(_0x38eb3f){_0x3fe0f1[_0x98a8('0x32')]=_[_0x98a8('0x34')](db['JscriptyQuestionReport']['rawAttributes']);_0x3fe0f1[_0x98a8('0x33')]=_['keys'](_0x4b2a1a[_0x98a8('0x33')]);_0x3fe0f1[_0x98a8('0x35')]=_['intersection'](_0x3fe0f1[_0x98a8('0x32')],_0x3fe0f1[_0x98a8('0x33')]);_0x460c6d[_0x98a8('0x37')]=_[_0x98a8('0x36')](_0x3fe0f1[_0x98a8('0x32')],qs['fields'](_0x4b2a1a['query'][_0x98a8('0x38')]));_0x460c6d[_0x98a8('0x37')]=_0x460c6d[_0x98a8('0x37')][_0x98a8('0x39')]?_0x460c6d[_0x98a8('0x37')]:_0x3fe0f1[_0x98a8('0x32')];if(!_0x4b2a1a[_0x98a8('0x33')]['hasOwnProperty'](_0x98a8('0x3b'))){_0x460c6d[_0x98a8('0x23')]=qs[_0x98a8('0x23')](_0x4b2a1a[_0x98a8('0x33')][_0x98a8('0x23')]);_0x460c6d[_0x98a8('0x22')]=qs['offset'](_0x4b2a1a[_0x98a8('0x33')][_0x98a8('0x22')]);}_0x460c6d['order']=qs[_0x98a8('0x52')](_0x4b2a1a[_0x98a8('0x33')][_0x98a8('0x52')]);_0x460c6d[_0x98a8('0x3d')]=qs['filters'](_['pick'](_0x4b2a1a[_0x98a8('0x33')],_0x3fe0f1['filters']));_0x460c6d[_0x98a8('0x3d')]['SessionId']=_0x38eb3f['id'];if(_0x4b2a1a[_0x98a8('0x33')][_0x98a8('0x3f')]){_0x460c6d[_0x98a8('0x3d')]=_[_0x98a8('0x42')](_0x460c6d[_0x98a8('0x3d')],{'$or':_[_0x98a8('0x2e')](_0x460c6d[_0x98a8('0x37')],function(_0x51c9f5){var _0x312bd3={};_0x312bd3[_0x51c9f5]={'$like':'%'+_0x4b2a1a['query'][_0x98a8('0x3f')]+'%'};return _0x312bd3;})});}_0x460c6d=_[_0x98a8('0x42')]({},_0x460c6d,_0x4b2a1a[_0x98a8('0x43')]);return db[_0x98a8('0x53')]['count']({'where':_0x460c6d[_0x98a8('0x3d')]})[_0x98a8('0x2a')](function(_0x251612){_0x43b103[_0x98a8('0x25')]=_0x251612;if(_0x4b2a1a[_0x98a8('0x33')]['includeAll']){_0x460c6d[_0x98a8('0x44')]=[{'all':!![]}];}return db[_0x98a8('0x53')][_0x98a8('0x46')](_0x460c6d);})[_0x98a8('0x2a')](function(_0x1a1f31){_0x43b103[_0x98a8('0x47')]=_0x1a1f31;return _0x43b103;});}})[_0x98a8('0x2a')](respondWithFilteredResult(_0x43457e,_0x460c6d))[_0x98a8('0x4b')](handleError(_0x43457e,null));};
\ No newline at end of file
+var _0x04a2=['set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','JscriptySessionReport','rawAttributes','fieldName','model','keys','intersection','attributes','fields','length','query','nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status','offset','undefined','count','limit'];(function(_0x4d36c2,_0x46dac6){var _0x4fb262=function(_0x1fd56b){while(--_0x1fd56b){_0x4d36c2['push'](_0x4d36c2['shift']());}};_0x4fb262(++_0x46dac6);}(_0x04a2,0x1a2));var _0x204a=function(_0x46c684,_0x1f7b77){_0x46c684=_0x46c684-0x0;var _0x384b0d=_0x04a2[_0x46c684];return _0x384b0d;};'use strict';var emlformat=require(_0x204a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x204a('0x1'));var jsonpatch=require(_0x204a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x204a('0x3'));var Mustache=require(_0x204a('0x4'));var util=require(_0x204a('0x5'));var path=require(_0x204a('0x6'));var sox=require('sox');var csv=require(_0x204a('0x7'));var ejs=require(_0x204a('0x8'));var fs=require('fs');var fs_extra=require(_0x204a('0x9'));var _=require(_0x204a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x204a('0xb'));var deskjs=require(_0x204a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x204a('0xd'));var Redis=require('ioredis');var authService=require(_0x204a('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x204a('0xf'));var logger=require(_0x204a('0x10'))(_0x204a('0x11'));var utils=require(_0x204a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x204a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd5060b,_0xfb43c9){_0xfb43c9=_0xfb43c9||0xcc;return function(_0x4f42da){if(_0x4f42da){return _0xd5060b['sendStatus'](_0xfb43c9);}return _0xd5060b['status'](_0xfb43c9)[_0x204a('0x14')]();};}function respondWithResult(_0x213141,_0x253ad0){_0x253ad0=_0x253ad0||0xc8;return function(_0x2e4434){if(_0x2e4434){return _0x213141[_0x204a('0x15')](_0x253ad0)['json'](_0x2e4434);}};}function respondWithFilteredResult(_0x4a1b02,_0x5344f0){return function(_0x7fea25){if(_0x7fea25){var _0x50e367=typeof _0x5344f0[_0x204a('0x16')]===_0x204a('0x17')&&typeof _0x5344f0['limit']===_0x204a('0x17');var _0x10f80d=_0x7fea25[_0x204a('0x18')];var _0x54786e=_0x50e367?0x0:_0x5344f0[_0x204a('0x16')];var _0x1fd117=_0x50e367?_0x7fea25[_0x204a('0x18')]:_0x5344f0[_0x204a('0x16')]+_0x5344f0[_0x204a('0x19')];var _0x42d59f;if(_0x1fd117>=_0x10f80d){_0x1fd117=_0x10f80d;_0x42d59f=0xc8;}else{_0x42d59f=0xce;}_0x4a1b02['status'](_0x42d59f);return _0x4a1b02[_0x204a('0x1a')](_0x204a('0x1b'),_0x54786e+'-'+_0x1fd117+'/'+_0x10f80d)[_0x204a('0x1c')](_0x7fea25);}return null;};}function patchUpdates(_0x34bd61){return function(_0x438ae6){try{jsonpatch[_0x204a('0x1d')](_0x438ae6,_0x34bd61,!![]);}catch(_0x34a58e){return BPromise[_0x204a('0x1e')](_0x34a58e);}return _0x438ae6[_0x204a('0x1f')]();};}function saveUpdates(_0x4b4062,_0x3bb673){return function(_0x54fddc){if(_0x54fddc){return _0x54fddc[_0x204a('0x20')](_0x4b4062)[_0x204a('0x21')](function(_0x237cd0){return _0x237cd0;});}return null;};}function removeEntity(_0x45c6b7,_0x3a33f1){return function(_0x1cc89b){if(_0x1cc89b){return _0x1cc89b[_0x204a('0x22')]()[_0x204a('0x21')](function(){_0x45c6b7[_0x204a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x397c84,_0xaeea7e){return function(_0x3d0c6b){if(!_0x3d0c6b){_0x397c84['sendStatus'](0x194);}return _0x3d0c6b;};}function handleError(_0x290962,_0x3a1b8b){_0x3a1b8b=_0x3a1b8b||0x1f4;return function(_0x4e9439){logger[_0x204a('0x23')](_0x4e9439[_0x204a('0x24')]);if(_0x4e9439[_0x204a('0x25')]){delete _0x4e9439[_0x204a('0x25')];}_0x290962['status'](_0x3a1b8b)['send'](_0x4e9439);};}exports['index']=function(_0x363bbb,_0x19305f){var _0x1c6246={},_0x13441d={},_0x5c4027={'count':0x0,'rows':[]};var _0x4eaa29=_[_0x204a('0x26')](db[_0x204a('0x27')][_0x204a('0x28')],function(_0xb3ae78){return{'name':_0xb3ae78[_0x204a('0x29')],'type':_0xb3ae78['type']['key']};});_0x13441d[_0x204a('0x2a')]=_[_0x204a('0x26')](_0x4eaa29,'name');_0x13441d['query']=_[_0x204a('0x2b')](_0x363bbb['query']);_0x13441d['filters']=_[_0x204a('0x2c')](_0x13441d[_0x204a('0x2a')],_0x13441d['query']);_0x1c6246[_0x204a('0x2d')]=_['intersection'](_0x13441d[_0x204a('0x2a')],qs[_0x204a('0x2e')](_0x363bbb['query'][_0x204a('0x2e')]));_0x1c6246[_0x204a('0x2d')]=_0x1c6246[_0x204a('0x2d')][_0x204a('0x2f')]?_0x1c6246[_0x204a('0x2d')]:_0x13441d['model'];if(!_0x363bbb[_0x204a('0x30')]['hasOwnProperty'](_0x204a('0x31'))){_0x1c6246[_0x204a('0x19')]=qs['limit'](_0x363bbb['query'][_0x204a('0x19')]);_0x1c6246['offset']=qs[_0x204a('0x16')](_0x363bbb[_0x204a('0x30')][_0x204a('0x16')]);}_0x1c6246[_0x204a('0x32')]=qs[_0x204a('0x33')](_0x363bbb[_0x204a('0x30')][_0x204a('0x33')]);_0x1c6246['where']=qs[_0x204a('0x34')](_[_0x204a('0x35')](_0x363bbb[_0x204a('0x30')],_0x13441d[_0x204a('0x34')]),_0x4eaa29);if(_0x363bbb['query'][_0x204a('0x36')]){_0x1c6246['where']=_[_0x204a('0x37')](_0x1c6246[_0x204a('0x38')],{'$or':_['map'](_0x4eaa29,function(_0x2df634){if(_0x2df634[_0x204a('0x39')]!==_0x204a('0x3a')){var _0x36a830={};_0x36a830[_0x2df634[_0x204a('0x25')]]={'$like':'%'+_0x363bbb['query'][_0x204a('0x36')]+'%'};return _0x36a830;}})});}_0x1c6246=_[_0x204a('0x37')]({},_0x1c6246,_0x363bbb[_0x204a('0x3b')]);var _0x442d62={'where':_0x1c6246[_0x204a('0x38')]};return db[_0x204a('0x27')][_0x204a('0x18')](_0x442d62)['then'](function(_0x1fb8a1){_0x5c4027[_0x204a('0x18')]=_0x1fb8a1;if(_0x363bbb['query'][_0x204a('0x3c')]){_0x1c6246['include']=[{'all':!![]}];}return db[_0x204a('0x27')][_0x204a('0x3d')](_0x1c6246);})['then'](function(_0x41c06d){_0x5c4027[_0x204a('0x3e')]=_0x41c06d;return _0x5c4027;})[_0x204a('0x21')](respondWithFilteredResult(_0x19305f,_0x1c6246))[_0x204a('0x3f')](handleError(_0x19305f,null));};exports[_0x204a('0x40')]=function(_0x4c15f6,_0x53b552){var _0x3e6b38={'raw':!![],'where':{'id':_0x4c15f6[_0x204a('0x41')]['id']}},_0x735a4d={};_0x735a4d['model']=_['keys'](db[_0x204a('0x27')][_0x204a('0x28')]);_0x735a4d[_0x204a('0x30')]=_[_0x204a('0x2b')](_0x4c15f6[_0x204a('0x30')]);_0x735a4d[_0x204a('0x34')]=_[_0x204a('0x2c')](_0x735a4d[_0x204a('0x2a')],_0x735a4d['query']);_0x3e6b38[_0x204a('0x2d')]=_[_0x204a('0x2c')](_0x735a4d[_0x204a('0x2a')],qs['fields'](_0x4c15f6['query'][_0x204a('0x2e')]));_0x3e6b38[_0x204a('0x2d')]=_0x3e6b38[_0x204a('0x2d')][_0x204a('0x2f')]?_0x3e6b38[_0x204a('0x2d')]:_0x735a4d['model'];if(_0x4c15f6[_0x204a('0x30')][_0x204a('0x3c')]){_0x3e6b38[_0x204a('0x42')]=[{'all':!![]}];}_0x3e6b38=_['merge']({},_0x3e6b38,_0x4c15f6[_0x204a('0x3b')]);return db[_0x204a('0x27')]['find'](_0x3e6b38)[_0x204a('0x21')](handleEntityNotFound(_0x53b552,null))[_0x204a('0x21')](respondWithResult(_0x53b552,null))[_0x204a('0x3f')](handleError(_0x53b552,null));};exports[_0x204a('0x43')]=function(_0x2440c7,_0xef0071){return db[_0x204a('0x27')][_0x204a('0x43')](_0x2440c7[_0x204a('0x44')],{})['then'](respondWithResult(_0xef0071,0xc9))['catch'](handleError(_0xef0071,null));};exports[_0x204a('0x20')]=function(_0x5e05e8,_0x4821c1){if(_0x5e05e8[_0x204a('0x44')]['id']){delete _0x5e05e8[_0x204a('0x44')]['id'];}return db[_0x204a('0x27')]['find']({'where':{'id':_0x5e05e8[_0x204a('0x41')]['id']}})[_0x204a('0x21')](handleEntityNotFound(_0x4821c1,null))['then'](saveUpdates(_0x5e05e8[_0x204a('0x44')],null))[_0x204a('0x21')](respondWithResult(_0x4821c1,null))[_0x204a('0x3f')](handleError(_0x4821c1,null));};exports[_0x204a('0x22')]=function(_0x44e496,_0x4550f1){return db[_0x204a('0x27')][_0x204a('0x45')]({'where':{'id':_0x44e496[_0x204a('0x41')]['id']}})[_0x204a('0x21')](handleEntityNotFound(_0x4550f1,null))['then'](removeEntity(_0x4550f1,null))['catch'](handleError(_0x4550f1,null));};exports[_0x204a('0x46')]=function(_0x2903f3,_0x2d3a00){return db['JscriptySessionReport'][_0x204a('0x46')]()[_0x204a('0x21')](respondWithResult(_0x2d3a00,null))[_0x204a('0x3f')](handleError(_0x2d3a00,null));};exports[_0x204a('0x47')]=function(_0x31fffb,_0x28bbfc,_0x3ff100){var _0x3fd51e={'raw':!![],'where':{}};var _0x5755be={};var _0x3bd569={'count':0x0,'rows':[]};return db[_0x204a('0x27')][_0x204a('0x48')]({'where':{'id':_0x31fffb['params']['id']}})[_0x204a('0x21')](handleEntityNotFound(_0x28bbfc,null))[_0x204a('0x21')](function(_0x5853e4){if(_0x5853e4){_0x5755be[_0x204a('0x2a')]=_[_0x204a('0x2b')](db[_0x204a('0x49')][_0x204a('0x28')]);_0x5755be[_0x204a('0x30')]=_[_0x204a('0x2b')](_0x31fffb[_0x204a('0x30')]);_0x5755be[_0x204a('0x34')]=_[_0x204a('0x2c')](_0x5755be['model'],_0x5755be[_0x204a('0x30')]);_0x3fd51e[_0x204a('0x2d')]=_['intersection'](_0x5755be[_0x204a('0x2a')],qs[_0x204a('0x2e')](_0x31fffb[_0x204a('0x30')][_0x204a('0x2e')]));_0x3fd51e[_0x204a('0x2d')]=_0x3fd51e[_0x204a('0x2d')][_0x204a('0x2f')]?_0x3fd51e[_0x204a('0x2d')]:_0x5755be['model'];if(!_0x31fffb[_0x204a('0x30')]['hasOwnProperty'](_0x204a('0x31'))){_0x3fd51e[_0x204a('0x19')]=qs[_0x204a('0x19')](_0x31fffb[_0x204a('0x30')]['limit']);_0x3fd51e['offset']=qs[_0x204a('0x16')](_0x31fffb[_0x204a('0x30')][_0x204a('0x16')]);}_0x3fd51e[_0x204a('0x32')]=qs[_0x204a('0x33')](_0x31fffb['query'][_0x204a('0x33')]);_0x3fd51e[_0x204a('0x38')]=qs[_0x204a('0x34')](_[_0x204a('0x35')](_0x31fffb[_0x204a('0x30')],_0x5755be[_0x204a('0x34')]));_0x3fd51e[_0x204a('0x38')]['SessionId']=_0x5853e4['id'];if(_0x31fffb['query'][_0x204a('0x36')]){_0x3fd51e[_0x204a('0x38')]=_[_0x204a('0x37')](_0x3fd51e[_0x204a('0x38')],{'$or':_[_0x204a('0x26')](_0x3fd51e[_0x204a('0x2d')],function(_0x9d0791){var _0x249c91={};_0x249c91[_0x9d0791]={'$like':'%'+_0x31fffb[_0x204a('0x30')][_0x204a('0x36')]+'%'};return _0x249c91;})});}_0x3fd51e=_[_0x204a('0x37')]({},_0x3fd51e,_0x31fffb[_0x204a('0x3b')]);return db[_0x204a('0x49')][_0x204a('0x18')]({'where':_0x3fd51e[_0x204a('0x38')]})[_0x204a('0x21')](function(_0x3082fa){_0x3bd569[_0x204a('0x18')]=_0x3082fa;if(_0x31fffb['query'][_0x204a('0x3c')]){_0x3fd51e[_0x204a('0x42')]=[{'all':!![]}];}return db[_0x204a('0x49')][_0x204a('0x3d')](_0x3fd51e);})[_0x204a('0x21')](function(_0x5c5420){_0x3bd569[_0x204a('0x3e')]=_0x5c5420;return _0x3bd569;});}})[_0x204a('0x21')](respondWithFilteredResult(_0x28bbfc,_0x3fd51e))[_0x204a('0x3f')](handleError(_0x28bbfc,null));};
\ No newline at end of file
index 310f622..eaca40c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x47e915,_0x1bca18){_0x47e915=_0x47e915-0x0;var _0x390142=_0xc6ac[_0x47e915];return _0x390142;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2675=['lodash','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x28a245,_0x1d817a){var _0x1bfce6=function(_0x41558a){while(--_0x41558a){_0x28a245['push'](_0x28a245['shift']());}};_0x1bfce6(++_0x1d817a);}(_0x2675,0x75));var _0x5267=function(_0x562f58,_0x5251ef){_0x562f58=_0x562f58-0x0;var _0x4d5767=_0x2675[_0x562f58];return _0x4d5767;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));module[_0x5267('0x6')]=function(_0x4bd042,_0x10f92c){return _0x4bd042[_0x5267('0x7')](_0x5267('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 23f88c1..37f7b30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0xe98db2,_0x34fa2b){var _0x4041d6=function(_0x3c41b5){while(--_0x3c41b5){_0xe98db2['push'](_0xe98db2['shift']());}};_0x4041d6(++_0x34fa2b);}(_0x2542,0x169));var _0x2254=function(_0x31cd5f,_0x2436ab){_0x31cd5f=_0x31cd5f-0x0;var _0x58efba=_0x2542[_0x31cd5f];return _0x58efba;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}
\ No newline at end of file
+var _0x2da6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x2da6,0x1dd));var _0x62da=function(_0xdc4d3a,_0x3dce09){_0xdc4d3a=_0xdc4d3a-0x0;var _0x306660=_0x2da6[_0xdc4d3a];return _0x306660;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}
\ No newline at end of file
index 53cb5ce..c510ee3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9079=['downloadLogFile','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','/download_log_file'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x9079,0xd4));var _0x9907=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9079[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9907('0x0'));var util=require(_0x9907('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9907('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9907('0x3'));var interaction=require(_0x9907('0x4'));var config=require(_0x9907('0x5'));var controller=require(_0x9907('0x6'));router[_0x9907('0x7')]('/',controller['index']);router[_0x9907('0x8')](_0x9907('0x9'),auth[_0x9907('0xa')](),controller[_0x9907('0xb')]);router['get'](_0x9907('0xc'),auth[_0x9907('0xa')](),controller[_0x9907('0xd')]);module[_0x9907('0xe')]=router;
\ No newline at end of file
+var _0x4e43=['/:id','isAuthenticated','update','get','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./license.controller','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e43,0x101));var _0x34e4=function(_0x54b5bd,_0x133fe1){_0x54b5bd=_0x54b5bd-0x0;var _0xcba844=_0x4e43[_0x54b5bd];return _0xcba844;};'use strict';var multer=require(_0x34e4('0x0'));var util=require('util');var path=require(_0x34e4('0x1'));var timeout=require(_0x34e4('0x2'));var express=require(_0x34e4('0x3'));var router=express[_0x34e4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x34e4('0x5'));var config=require(_0x34e4('0x6'));var controller=require(_0x34e4('0x7'));router['get']('/',controller['index']);router[_0x34e4('0x8')](_0x34e4('0x9'),auth[_0x34e4('0xa')](),controller[_0x34e4('0xb')]);router[_0x34e4('0xc')]('/download_log_file',auth[_0x34e4('0xa')](),controller['downloadLogFile']);module[_0x34e4('0xd')]=router;
\ No newline at end of file
index c7b0492..13236a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69c9=['STRING','INTEGER','exports','TEXT'];(function(_0x2417f9,_0x803ba4){var _0x142d82=function(_0xd430d1){while(--_0xd430d1){_0x2417f9['push'](_0x2417f9['shift']());}};_0x142d82(++_0x803ba4);}(_0x69c9,0xce));var _0x969c=function(_0x27c744,_0x47bd7c){_0x27c744=_0x27c744-0x0;var _0x1b7cbe=_0x69c9[_0x27c744];return _0x1b7cbe;};'use strict';var Sequelize=require('sequelize');module[_0x969c('0x0')]={'license':{'type':Sequelize[_0x969c('0x1')]},'data1':{'type':Sequelize[_0x969c('0x2')]},'data2':{'type':Sequelize[_0x969c('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x969c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd643=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x91148f,_0x480e9a){var _0x692714=function(_0x1086bc){while(--_0x1086bc){_0x91148f['push'](_0x91148f['shift']());}};_0x692714(++_0x480e9a);}(_0xd643,0x1c4));var _0x3d64=function(_0xcf1e2,_0x3dcdf5){_0xcf1e2=_0xcf1e2-0x0;var _0x539205=_0xd643[_0xcf1e2];return _0x539205;};'use strict';var Sequelize=require(_0x3d64('0x0'));module[_0x3d64('0x1')]={'license':{'type':Sequelize[_0x3d64('0x2')]},'data1':{'type':Sequelize[_0x3d64('0x3')]},'data2':{'type':Sequelize[_0x3d64('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x3d64('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 8ddee10..387f725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4490=['key','demo','catch','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','sendStatus','stack','name','send','index','model','License','rawAttributes','query','keys','filters','intersection','attributes','fields','merge','options','getLicense','body','find','get','checkLicense'];(function(_0x25a7ea,_0xd5995d){var _0x5e96f7=function(_0x1fba76){while(--_0x1fba76){_0x25a7ea['push'](_0x25a7ea['shift']());}};_0x5e96f7(++_0xd5995d);}(_0x4490,0x9e));var _0x0449=function(_0x50d7a8,_0x22b6a6){_0x50d7a8=_0x50d7a8-0x0;var _0x4e4dae=_0x4490[_0x50d7a8];return _0x4e4dae;};'use strict';var emlformat=require(_0x0449('0x0'));var rimraf=require(_0x0449('0x1'));var zipdir=require(_0x0449('0x2'));var jsonpatch=require(_0x0449('0x3'));var rp=require(_0x0449('0x4'));var moment=require('moment');var BPromise=require(_0x0449('0x5'));var Mustache=require(_0x0449('0x6'));var util=require('util');var path=require(_0x0449('0x7'));var sox=require(_0x0449('0x8'));var csv=require(_0x0449('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0449('0xa'));var _=require(_0x0449('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0449('0xc'));var toCsv=require(_0x0449('0x9'));var querystring=require(_0x0449('0xd'));var Papa=require(_0x0449('0xe'));var Redis=require(_0x0449('0xf'));var authService=require(_0x0449('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0449('0x11'));var hardwareService=require(_0x0449('0x12'));var logger=require(_0x0449('0x13'))(_0x0449('0x14'));var utils=require(_0x0449('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0449('0x16'));var db=require(_0x0449('0x17'))['db'];function respondWithStatusCode(_0x160bcd,_0x7d42dd){_0x7d42dd=_0x7d42dd||0xcc;return function(_0x5f7649){if(_0x5f7649){return _0x160bcd['sendStatus'](_0x7d42dd);}return _0x160bcd[_0x0449('0x18')](_0x7d42dd)[_0x0449('0x19')]();};}function respondWithResult(_0x2d2ac4,_0x1715b0){_0x1715b0=_0x1715b0||0xc8;return function(_0x88bef3){if(_0x88bef3){return _0x2d2ac4[_0x0449('0x18')](_0x1715b0)[_0x0449('0x1a')](_0x88bef3);}};}function respondWithFilteredResult(_0x140a22,_0x1d54d9){return function(_0x1f6442){if(_0x1f6442){var _0xad538c=typeof _0x1d54d9[_0x0449('0x1b')]==='undefined'&&typeof _0x1d54d9['limit']===_0x0449('0x1c');var _0x1f18a3=_0x1f6442[_0x0449('0x1d')];var _0x11c3ae=_0xad538c?0x0:_0x1d54d9[_0x0449('0x1b')];var _0x3222f1=_0xad538c?_0x1f6442['count']:_0x1d54d9[_0x0449('0x1b')]+_0x1d54d9[_0x0449('0x1e')];var _0x1c9ecf;if(_0x3222f1>=_0x1f18a3){_0x3222f1=_0x1f18a3;_0x1c9ecf=0xc8;}else{_0x1c9ecf=0xce;}_0x140a22[_0x0449('0x18')](_0x1c9ecf);return _0x140a22[_0x0449('0x1f')](_0x0449('0x20'),_0x11c3ae+'-'+_0x3222f1+'/'+_0x1f18a3)['json'](_0x1f6442);}return null;};}function patchUpdates(_0x5ee0eb){return function(_0x3769e4){try{jsonpatch['apply'](_0x3769e4,_0x5ee0eb,!![]);}catch(_0x1717bc){return BPromise[_0x0449('0x21')](_0x1717bc);}return _0x3769e4['save']();};}function saveUpdates(_0x456d09,_0x1e3a4b){return function(_0x100e58){if(_0x100e58){return _0x100e58[_0x0449('0x22')](_0x456d09)[_0x0449('0x23')](function(_0xb83eac){return _0xb83eac;});}return null;};}function removeEntity(_0x165acd,_0x1ba405){return function(_0x8661b6){if(_0x8661b6){return _0x8661b6[_0x0449('0x24')]()[_0x0449('0x23')](function(){_0x165acd['status'](0xcc)[_0x0449('0x19')]();});}};}function handleEntityNotFound(_0x5df440,_0x5d966f){return function(_0x5a5ebd){if(!_0x5a5ebd){_0x5df440[_0x0449('0x25')](0x194);}return _0x5a5ebd;};}function handleError(_0x19711e,_0x1bbeeb){_0x1bbeeb=_0x1bbeeb||0x1f4;return function(_0x3d3b6f){logger['error'](_0x3d3b6f[_0x0449('0x26')]);if(_0x3d3b6f[_0x0449('0x27')]){delete _0x3d3b6f[_0x0449('0x27')];}_0x19711e[_0x0449('0x18')](_0x1bbeeb)[_0x0449('0x28')](_0x3d3b6f);};}var utilLicense=require(_0x0449('0x16'));exports[_0x0449('0x29')]=function(_0x5c7548,_0x3e9db1){var _0x7bf1ef={'raw':!![],'where':{'id':0x1}},_0x5d8cc7={};_0x5d8cc7[_0x0449('0x2a')]=_['keys'](db[_0x0449('0x2b')][_0x0449('0x2c')]);_0x5d8cc7[_0x0449('0x2d')]=_[_0x0449('0x2e')](_0x5c7548[_0x0449('0x2d')]);_0x5d8cc7[_0x0449('0x2f')]=_[_0x0449('0x30')](_0x5d8cc7['model'],_0x5d8cc7[_0x0449('0x2d')]);_0x7bf1ef[_0x0449('0x31')]=_[_0x0449('0x30')](_0x5d8cc7[_0x0449('0x2a')],qs[_0x0449('0x32')](_0x5c7548['query'][_0x0449('0x32')]));_0x7bf1ef[_0x0449('0x31')]=_0x7bf1ef['attributes']['length']?_0x7bf1ef[_0x0449('0x31')]:_0x5d8cc7['model'];_0x7bf1ef=_[_0x0449('0x33')]({},_0x7bf1ef,_0x5c7548[_0x0449('0x34')]);return utilLicense[_0x0449('0x35')](_0x7bf1ef)[_0x0449('0x23')](respondWithResult(_0x3e9db1,null))['catch'](handleError(_0x3e9db1,null));};exports['update']=function(_0xe0b80a,_0x1367cf){if(_0xe0b80a['body']['id']){delete _0xe0b80a[_0x0449('0x36')]['id'];}return db['License'][_0x0449('0x37')]({'where':{'id':_0xe0b80a['params']['id']}})[_0x0449('0x23')](handleEntityNotFound(_0x1367cf,null))[_0x0449('0x23')](function(_0x3181d7){var _0x727b62=_0x3181d7[_0x0449('0x38')]({'plain':!![]});return utilLicense[_0x0449('0x39')](_0x727b62,_0xe0b80a['body'][_0x0449('0x3a')]);})[_0x0449('0x23')](function(_0x8601f9){if(!_0x8601f9[_0x0449('0x3b')]){return saveUpdates(_0xe0b80a[_0x0449('0x36')],null);}return _0x8601f9;})[_0x0449('0x23')](respondWithResult(_0x1367cf,null))[_0x0449('0x3c')](handleError(_0x1367cf,null));};exports[_0x0449('0x3d')]=function(_0x71a672,_0x1926bc){var _0x21fc85=_0x0449('0x3e');var _0x192a03=path[_0x0449('0x3f')](_0x0449('0x40'),_0x0449('0x41'),_0x0449('0x42'),_0x21fc85);_0x1926bc[_0x0449('0x43')](_0x0449('0x44'),'attachment;\x20filename='+_0x21fc85);_0x1926bc['set'](_0x0449('0x45'),_0x0449('0x46'));_0x1926bc[_0x0449('0x47')](_0x192a03);};
\ No newline at end of file
+var _0x2c16=['../../components/auth/service','../../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','reject','update','then','destroy','error','stack','name','index','keys','query','filters','intersection','model','attributes','fields','merge','options','getLicense','catch','body','License','find','get','checkLicense','key','license-info.log','/var','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','lodash','squel','crypto','querystring','papaparse'];(function(_0x4144e7,_0x4cfbfc){var _0x3baa4a=function(_0x3157a4){while(--_0x3157a4){_0x4144e7['push'](_0x4144e7['shift']());}};_0x3baa4a(++_0x4cfbfc);}(_0x2c16,0x1b3));var _0x62c1=function(_0xd5552f,_0x719f2){_0xd5552f=_0xd5552f-0x0;var _0x53fa6a=_0x2c16[_0xd5552f];return _0x53fa6a;};'use strict';var emlformat=require(_0x62c1('0x0'));var rimraf=require(_0x62c1('0x1'));var zipdir=require(_0x62c1('0x2'));var jsonpatch=require(_0x62c1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x62c1('0x4'));var Mustache=require(_0x62c1('0x5'));var util=require(_0x62c1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x62c1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62c1('0x8'));var squel=require(_0x62c1('0x9'));var crypto=require(_0x62c1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x62c1('0x7'));var querystring=require(_0x62c1('0xb'));var Papa=require(_0x62c1('0xc'));var Redis=require('ioredis');var authService=require(_0x62c1('0xd'));var qs=require(_0x62c1('0xe'));var as=require(_0x62c1('0xf'));var hardwareService=require(_0x62c1('0x10'));var logger=require(_0x62c1('0x11'))('api');var utils=require(_0x62c1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x62c1('0x13'));var db=require(_0x62c1('0x14'))['db'];function respondWithStatusCode(_0x26223b,_0x35af7a){_0x35af7a=_0x35af7a||0xcc;return function(_0x24d31a){if(_0x24d31a){return _0x26223b[_0x62c1('0x15')](_0x35af7a);}return _0x26223b[_0x62c1('0x16')](_0x35af7a)[_0x62c1('0x17')]();};}function respondWithResult(_0x4d8d8a,_0x259f8a){_0x259f8a=_0x259f8a||0xc8;return function(_0x152028){if(_0x152028){return _0x4d8d8a['status'](_0x259f8a)[_0x62c1('0x18')](_0x152028);}};}function respondWithFilteredResult(_0x3281c4,_0x3260a9){return function(_0x302205){if(_0x302205){var _0x228507=typeof _0x3260a9[_0x62c1('0x19')]===_0x62c1('0x1a')&&typeof _0x3260a9[_0x62c1('0x1b')]===_0x62c1('0x1a');var _0x4f87ff=_0x302205[_0x62c1('0x1c')];var _0x2238d0=_0x228507?0x0:_0x3260a9[_0x62c1('0x19')];var _0x260c39=_0x228507?_0x302205[_0x62c1('0x1c')]:_0x3260a9[_0x62c1('0x19')]+_0x3260a9[_0x62c1('0x1b')];var _0xe37cd6;if(_0x260c39>=_0x4f87ff){_0x260c39=_0x4f87ff;_0xe37cd6=0xc8;}else{_0xe37cd6=0xce;}_0x3281c4[_0x62c1('0x16')](_0xe37cd6);return _0x3281c4[_0x62c1('0x1d')](_0x62c1('0x1e'),_0x2238d0+'-'+_0x260c39+'/'+_0x4f87ff)[_0x62c1('0x18')](_0x302205);}return null;};}function patchUpdates(_0x2576a8){return function(_0x5e7dcb){try{jsonpatch[_0x62c1('0x1f')](_0x5e7dcb,_0x2576a8,!![]);}catch(_0x35b108){return BPromise[_0x62c1('0x20')](_0x35b108);}return _0x5e7dcb['save']();};}function saveUpdates(_0xff4338,_0x302a52){return function(_0x4e9854){if(_0x4e9854){return _0x4e9854[_0x62c1('0x21')](_0xff4338)[_0x62c1('0x22')](function(_0x554350){return _0x554350;});}return null;};}function removeEntity(_0x244928,_0x5f2e89){return function(_0x2da4f9){if(_0x2da4f9){return _0x2da4f9[_0x62c1('0x23')]()[_0x62c1('0x22')](function(){_0x244928[_0x62c1('0x16')](0xcc)[_0x62c1('0x17')]();});}};}function handleEntityNotFound(_0x37bb65,_0x1b9e40){return function(_0x13784f){if(!_0x13784f){_0x37bb65[_0x62c1('0x15')](0x194);}return _0x13784f;};}function handleError(_0x430617,_0x2a5b7e){_0x2a5b7e=_0x2a5b7e||0x1f4;return function(_0x49d891){logger[_0x62c1('0x24')](_0x49d891[_0x62c1('0x25')]);if(_0x49d891[_0x62c1('0x26')]){delete _0x49d891[_0x62c1('0x26')];}_0x430617[_0x62c1('0x16')](_0x2a5b7e)['send'](_0x49d891);};}var utilLicense=require(_0x62c1('0x13'));exports[_0x62c1('0x27')]=function(_0x1293e5,_0x3e7746){var _0x3418c8={'raw':!![],'where':{'id':0x1}},_0x485c06={};_0x485c06['model']=_[_0x62c1('0x28')](db['License']['rawAttributes']);_0x485c06[_0x62c1('0x29')]=_[_0x62c1('0x28')](_0x1293e5[_0x62c1('0x29')]);_0x485c06[_0x62c1('0x2a')]=_[_0x62c1('0x2b')](_0x485c06[_0x62c1('0x2c')],_0x485c06[_0x62c1('0x29')]);_0x3418c8[_0x62c1('0x2d')]=_[_0x62c1('0x2b')](_0x485c06[_0x62c1('0x2c')],qs[_0x62c1('0x2e')](_0x1293e5[_0x62c1('0x29')]['fields']));_0x3418c8[_0x62c1('0x2d')]=_0x3418c8[_0x62c1('0x2d')]['length']?_0x3418c8[_0x62c1('0x2d')]:_0x485c06[_0x62c1('0x2c')];_0x3418c8=_[_0x62c1('0x2f')]({},_0x3418c8,_0x1293e5[_0x62c1('0x30')]);return utilLicense[_0x62c1('0x31')](_0x3418c8)['then'](respondWithResult(_0x3e7746,null))[_0x62c1('0x32')](handleError(_0x3e7746,null));};exports['update']=function(_0x3eeddc,_0x3b4da7){if(_0x3eeddc[_0x62c1('0x33')]['id']){delete _0x3eeddc[_0x62c1('0x33')]['id'];}return db[_0x62c1('0x34')][_0x62c1('0x35')]({'where':{'id':_0x3eeddc['params']['id']}})[_0x62c1('0x22')](handleEntityNotFound(_0x3b4da7,null))['then'](function(_0x57e4fd){var _0x200068=_0x57e4fd[_0x62c1('0x36')]({'plain':!![]});return utilLicense[_0x62c1('0x37')](_0x200068,_0x3eeddc[_0x62c1('0x33')][_0x62c1('0x38')]);})[_0x62c1('0x22')](function(_0x2f6d85){if(!_0x2f6d85['demo']){return saveUpdates(_0x3eeddc[_0x62c1('0x33')],null);}return _0x2f6d85;})['then'](respondWithResult(_0x3b4da7,null))['catch'](handleError(_0x3b4da7,null));};exports['downloadLogFile']=function(_0x298d5e,_0x2c378f){var _0x2dca10=_0x62c1('0x39');var _0x138bb5=path['join'](_0x62c1('0x3a'),'log','xcally',_0x2dca10);_0x2c378f[_0x62c1('0x3b')](_0x62c1('0x3c'),_0x62c1('0x3d')+_0x2dca10);_0x2c378f['set']('Content-Type',_0x62c1('0x3e'));_0x2c378f[_0x62c1('0x3f')](_0x138bb5);};
\ No newline at end of file
index 2c54128..9a4d019 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a94=['path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9a94,0x8f));var _0x49a9=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0x9a94[_0x7c0074];return _0x13e95b;};'use strict';var _=require(_0x49a9('0x0'));var util=require(_0x49a9('0x1'));var logger=require(_0x49a9('0x2'))(_0x49a9('0x3'));var moment=require(_0x49a9('0x4'));var BPromise=require(_0x49a9('0x5'));var rp=require(_0x49a9('0x6'));var fs=require('fs');var path=require(_0x49a9('0x7'));var rimraf=require(_0x49a9('0x8'));var config=require(_0x49a9('0x9'));var attributes=require(_0x49a9('0xa'));module[_0x49a9('0xb')]=function(_0x58c027,_0x28d84e){return _0x58c027[_0x49a9('0xc')](_0x49a9('0xd'),attributes,{'tableName':_0x49a9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9116=['api','bluebird','path','../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger'];(function(_0x37dd30,_0x32eb78){var _0x4d8acb=function(_0x31af40){while(--_0x31af40){_0x37dd30['push'](_0x37dd30['shift']());}};_0x4d8acb(++_0x32eb78);}(_0x9116,0x111));var _0x6911=function(_0x849e8d,_0x21b681){_0x849e8d=_0x849e8d-0x0;var _0x53d15d=_0x9116[_0x849e8d];return _0x53d15d;};'use strict';var _=require(_0x6911('0x0'));var util=require('util');var logger=require(_0x6911('0x1'))(_0x6911('0x2'));var moment=require('moment');var BPromise=require(_0x6911('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6911('0x4'));var rimraf=require('rimraf');var config=require(_0x6911('0x5'));var attributes=require(_0x6911('0x6'));module[_0x6911('0x7')]=function(_0x148dfc,_0x1b222c){return _0x148dfc[_0x6911('0x8')](_0x6911('0x9'),attributes,{'tableName':_0x6911('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4417688..369319c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4338=['License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4338,0x93));var _0x8433=function(_0x4bf4bc,_0xb389d0){_0x4bf4bc=_0x4bf4bc-0x0;var _0x1d2deb=_0x4338[_0x4bf4bc];return _0x1d2deb;};'use strict';var _=require(_0x8433('0x0'));var util=require(_0x8433('0x1'));var moment=require(_0x8433('0x2'));var BPromise=require(_0x8433('0x3'));var rs=require(_0x8433('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8433('0x5'))['db'];var utils=require(_0x8433('0x6'));var logger=require('../../config/logger')(_0x8433('0x7'));var config=require(_0x8433('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8433('0x9')][_0x8433('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x405c58,_0x25a772,_0x305b63){return new BPromise(function(_0x369895,_0x28a499){return client[_0x8433('0xb')](_0x405c58,_0x305b63)[_0x8433('0xc')](function(_0x2c47fe){logger[_0x8433('0xd')](_0x8433('0xe'),_0x25a772,'request\x20sent');logger[_0x8433('0xf')](_0x8433('0x10'),_0x25a772,_0x8433('0x11'),JSON[_0x8433('0x12')](_0x2c47fe));if(_0x2c47fe[_0x8433('0x13')]){if(_0x2c47fe[_0x8433('0x13')][_0x8433('0x14')]===0x1f4){logger[_0x8433('0x13')](_0x8433('0xe'),_0x25a772,_0x2c47fe['error'][_0x8433('0x15')]);return _0x28a499(_0x2c47fe[_0x8433('0x13')][_0x8433('0x15')]);}logger[_0x8433('0x13')](_0x8433('0xe'),_0x25a772,_0x2c47fe[_0x8433('0x13')][_0x8433('0x15')]);return _0x369895(_0x2c47fe[_0x8433('0x13')][_0x8433('0x15')]);}else{logger['info']('License,\x20%s,\x20%s',_0x25a772,_0x8433('0x11'));_0x369895(_0x2c47fe['result'][_0x8433('0x15')]);}})[_0x8433('0x16')](function(_0x45a09a){logger[_0x8433('0x13')](_0x8433('0xe'),_0x25a772,_0x45a09a);_0x28a499(_0x45a09a);});});}
\ No newline at end of file
+var _0x1e76=['../../config/utils','../../config/logger','client','http','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x38855b,_0x248c15){var _0xea0aaa=function(_0x459c39){while(--_0x459c39){_0x38855b['push'](_0x38855b['shift']());}};_0xea0aaa(++_0x248c15);}(_0x1e76,0x1e8));var _0x61e7=function(_0x1e0cfd,_0x3c9315){_0x1e0cfd=_0x1e0cfd-0x0;var _0x18aca5=_0x1e76[_0x1e0cfd];return _0x18aca5;};'use strict';var _=require(_0x61e7('0x0'));var util=require(_0x61e7('0x1'));var moment=require(_0x61e7('0x2'));var BPromise=require(_0x61e7('0x3'));var rs=require(_0x61e7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61e7('0x5'))['db'];var utils=require(_0x61e7('0x6'));var logger=require(_0x61e7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x61e7('0x8')][_0x61e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35121b,_0x54789d,_0x51dc7b){return new BPromise(function(_0x3c95df,_0x549d80){return client['request'](_0x35121b,_0x51dc7b)[_0x61e7('0xa')](function(_0x2e009b){logger[_0x61e7('0xb')](_0x61e7('0xc'),_0x54789d,_0x61e7('0xd'));logger['debug'](_0x61e7('0xe'),_0x54789d,_0x61e7('0xd'),JSON['stringify'](_0x2e009b));if(_0x2e009b[_0x61e7('0xf')]){if(_0x2e009b[_0x61e7('0xf')]['code']===0x1f4){logger[_0x61e7('0xf')]('License,\x20%s,\x20%s',_0x54789d,_0x2e009b[_0x61e7('0xf')][_0x61e7('0x10')]);return _0x549d80(_0x2e009b[_0x61e7('0xf')][_0x61e7('0x10')]);}logger['error'](_0x61e7('0xc'),_0x54789d,_0x2e009b[_0x61e7('0xf')]['message']);return _0x3c95df(_0x2e009b[_0x61e7('0xf')][_0x61e7('0x10')]);}else{logger[_0x61e7('0xb')](_0x61e7('0xc'),_0x54789d,'request\x20sent');_0x3c95df(_0x2e009b[_0x61e7('0x11')]['message']);}})[_0x61e7('0x12')](function(_0x5410d4){logger[_0x61e7('0xf')](_0x61e7('0xc'),_0x54789d,_0x5410d4);_0x549d80(_0x5410d4);});});}
\ No newline at end of file
index 32c2fc3..0ff7540 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb716=['getApplications','getMessages','verifySmtp','/:id/users','getAgents','addDisposition','post','addAnswer','create','/:id/in_servers','addImap','addInteraction','/:id/applications','addApplications','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getImap','/:id/out_servers','getSmtp','/:id/interactions'];(function(_0x4c8c8e,_0x2a11aa){var _0x3ae2d3=function(_0x2f001d){while(--_0x2f001d){_0x4c8c8e['push'](_0x4c8c8e['shift']());}};_0x3ae2d3(++_0x2a11aa);}(_0xb716,0x1ef));var _0x6b71=function(_0x5cb99c,_0x517687){_0x5cb99c=_0x5cb99c-0x0;var _0x24c9e6=_0xb716[_0x5cb99c];return _0x24c9e6;};'use strict';var multer=require(_0x6b71('0x0'));var util=require('util');var path=require(_0x6b71('0x1'));var timeout=require(_0x6b71('0x2'));var express=require(_0x6b71('0x3'));var router=express[_0x6b71('0x4')]();var fs_extra=require(_0x6b71('0x5'));var auth=require(_0x6b71('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b71('0x7'));var controller=require(_0x6b71('0x8'));router[_0x6b71('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6b71('0xa'),auth[_0x6b71('0xb')](),controller[_0x6b71('0xc')]);router[_0x6b71('0x9')](_0x6b71('0xd'),auth[_0x6b71('0xb')](),controller[_0x6b71('0xe')]);router[_0x6b71('0x9')](_0x6b71('0xf'),auth[_0x6b71('0xb')](),controller[_0x6b71('0x10')]);router['get'](_0x6b71('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x6b71('0x9')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x6b71('0x12')]);router[_0x6b71('0x9')](_0x6b71('0x13'),auth['isAuthenticated'](),controller[_0x6b71('0x14')]);router[_0x6b71('0x9')](_0x6b71('0x15'),auth[_0x6b71('0xb')](),controller['getInteractions']);router[_0x6b71('0x9')]('/:id/applications',auth[_0x6b71('0xb')](),controller[_0x6b71('0x16')]);router[_0x6b71('0x9')]('/:id/messages',auth[_0x6b71('0xb')](),controller[_0x6b71('0x17')]);router[_0x6b71('0x9')]('/:id/verify',auth[_0x6b71('0xb')](),controller[_0x6b71('0x18')]);router[_0x6b71('0x9')](_0x6b71('0x19'),auth['isAuthenticated'](),controller[_0x6b71('0x1a')]);router['post']('/:id/dispositions',auth[_0x6b71('0xb')](),controller[_0x6b71('0x1b')]);router[_0x6b71('0x1c')](_0x6b71('0x11'),auth[_0x6b71('0xb')](),controller[_0x6b71('0x1d')]);router[_0x6b71('0x1c')]('/',auth[_0x6b71('0xb')](),controller[_0x6b71('0x1e')]);router[_0x6b71('0x1c')](_0x6b71('0x1f'),auth[_0x6b71('0xb')](),controller[_0x6b71('0x20')]);router[_0x6b71('0x1c')](_0x6b71('0x13'),auth[_0x6b71('0xb')](),controller['addSmtp']);router[_0x6b71('0x1c')]('/:id/interactions',auth[_0x6b71('0xb')](),controller[_0x6b71('0x21')]);router[_0x6b71('0x1c')](_0x6b71('0x22'),auth[_0x6b71('0xb')](),controller[_0x6b71('0x23')]);router[_0x6b71('0x1c')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x6b71('0x1c')](_0x6b71('0x19'),auth['isAuthenticated'](),controller[_0x6b71('0x24')]);router[_0x6b71('0x25')](_0x6b71('0xd'),auth[_0x6b71('0xb')](),controller[_0x6b71('0x26')]);router[_0x6b71('0x27')]('/:id/dispositions',auth[_0x6b71('0xb')](),controller[_0x6b71('0x28')]);router[_0x6b71('0x27')](_0x6b71('0x11'),auth[_0x6b71('0xb')](),controller[_0x6b71('0x29')]);router['delete']('/:id/in_servers',auth[_0x6b71('0xb')](),controller[_0x6b71('0x2a')]);router[_0x6b71('0x27')]('/:id/out_servers',auth[_0x6b71('0xb')](),controller[_0x6b71('0x2b')]);router['delete'](_0x6b71('0xd'),auth[_0x6b71('0xb')](),controller[_0x6b71('0x2c')]);router['delete'](_0x6b71('0x19'),auth[_0x6b71('0xb')](),controller[_0x6b71('0x2d')]);module[_0x6b71('0x2e')]=router;
\ No newline at end of file
+var _0xf139=['put','update','removeDispositions','delete','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/in_servers','getImap','getSmtp','/:id/interactions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf139,0x1ab));var _0x9f13=function(_0x735ce8,_0xee53a8){_0x735ce8=_0x735ce8-0x0;var _0x311399=_0xf139[_0x735ce8];return _0x311399;};'use strict';var multer=require(_0x9f13('0x0'));var util=require('util');var path=require(_0x9f13('0x1'));var timeout=require(_0x9f13('0x2'));var express=require(_0x9f13('0x3'));var router=express[_0x9f13('0x4')]();var fs_extra=require(_0x9f13('0x5'));var auth=require(_0x9f13('0x6'));var interaction=require(_0x9f13('0x7'));var config=require(_0x9f13('0x8'));var controller=require(_0x9f13('0x9'));router[_0x9f13('0xa')]('/',auth[_0x9f13('0xb')](),controller[_0x9f13('0xc')]);router[_0x9f13('0xa')](_0x9f13('0xd'),auth[_0x9f13('0xb')](),controller[_0x9f13('0xe')]);router[_0x9f13('0xa')](_0x9f13('0xf'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x10')]);router[_0x9f13('0xa')]('/:id/dispositions',auth[_0x9f13('0xb')](),controller['getDispositions']);router[_0x9f13('0xa')]('/:id/canned_answers',auth[_0x9f13('0xb')](),controller['getAnswers']);router[_0x9f13('0xa')](_0x9f13('0x11'),auth['isAuthenticated'](),controller[_0x9f13('0x12')]);router['get']('/:id/out_servers',auth[_0x9f13('0xb')](),controller[_0x9f13('0x13')]);router['get'](_0x9f13('0x14'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x9f13('0xa')](_0x9f13('0x15'),auth[_0x9f13('0xb')](),controller['getApplications']);router[_0x9f13('0xa')](_0x9f13('0x16'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x17')]);router[_0x9f13('0xa')](_0x9f13('0x18'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x19')]);router[_0x9f13('0xa')]('/:id/users',auth[_0x9f13('0xb')](),controller[_0x9f13('0x1a')]);router[_0x9f13('0x1b')](_0x9f13('0x1c'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x1d')]);router[_0x9f13('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9f13('0x1e')]);router[_0x9f13('0x1b')]('/',auth[_0x9f13('0xb')](),controller[_0x9f13('0x1f')]);router[_0x9f13('0x1b')](_0x9f13('0x11'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x20')]);router[_0x9f13('0x1b')](_0x9f13('0x21'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x22')]);router[_0x9f13('0x1b')](_0x9f13('0x14'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x23')]);router[_0x9f13('0x1b')]('/:id/applications',auth[_0x9f13('0xb')](),controller[_0x9f13('0x24')]);router[_0x9f13('0x1b')](_0x9f13('0x25'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x26')]);router[_0x9f13('0x1b')](_0x9f13('0x27'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x28')]);router[_0x9f13('0x29')](_0x9f13('0xf'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x2a')]);router['delete'](_0x9f13('0x1c'),auth['isAuthenticated'](),controller[_0x9f13('0x2b')]);router[_0x9f13('0x2c')](_0x9f13('0x2d'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x2e')]);router[_0x9f13('0x2c')](_0x9f13('0x11'),auth['isAuthenticated'](),controller[_0x9f13('0x2f')]);router['delete'](_0x9f13('0x21'),auth[_0x9f13('0xb')](),controller[_0x9f13('0x30')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9f13('0x31')]);router[_0x9f13('0x2c')]('/:id/users',auth[_0x9f13('0xb')](),controller[_0x9f13('0x32')]);module[_0x9f13('0x33')]=router;
\ No newline at end of file
index ccef6cd..bbbe2d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fa5=['getDataValue','custom','provider','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','hotmail','yahoo','outlook365'];(function(_0x282da6,_0x2270d9){var _0x1fe6e0=function(_0x435a23){while(--_0x435a23){_0x282da6['push'](_0x282da6['shift']());}};_0x1fe6e0(++_0x2270d9);}(_0x3fa5,0x168));var _0x53fa=function(_0x3406e8,_0x26f332){_0x3406e8=_0x3406e8-0x0;var _0x1ec98a=_0x3fa5[_0x3406e8];return _0x1ec98a;};'use strict';var Sequelize=require(_0x53fa('0x0'));module['exports']={'description':{'type':Sequelize[_0x53fa('0x1')]},'name':{'type':Sequelize[_0x53fa('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x53fa('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x53fa('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x53fa('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x53fa('0x3')]},'markAsUnread':{'type':Sequelize[_0x53fa('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x53fa('0x1')],'allowNull':![],'defaultValue':_0x53fa('0x4')},'fontSize':{'type':Sequelize[_0x53fa('0x5')](0x2)[_0x53fa('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x53fa('0x3')],'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['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x53fa('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x53fa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x53fa('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x53fa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x53fa('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x53fa('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x53fa('0x2')],'defaultValue':![],'comment':_0x53fa('0x7'),'set':function(_0x281843){if(!_0x281843)this[_0x53fa('0x8')]('mandatoryDispositionPauseId',null);this[_0x53fa('0x8')](_0x53fa('0x9'),_0x281843);}},'provider':{'type':Sequelize[_0x53fa('0xa')]('gmail',_0x53fa('0xb'),_0x53fa('0xc'),_0x53fa('0xd')),'defaultValue':null,'get':function(){if(!this[_0x53fa('0xe')]('provider'))return _0x53fa('0xf');return this['getDataValue'](_0x53fa('0x10'));},'set':function(_0x2696da){if(_0x2696da==='custom')_0x2696da=null;return this[_0x53fa('0x8')](_0x53fa('0x10'),_0x2696da);}}};
\ No newline at end of file
+var _0xde99=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','provider','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}'];(function(_0x2f8a49,_0xd8e697){var _0x285564=function(_0x2c90a4){while(--_0x2c90a4){_0x2f8a49['push'](_0x2f8a49['shift']());}};_0x285564(++_0xd8e697);}(_0xde99,0x1a8));var _0x9de9=function(_0x5bb0be,_0x387b95){_0x5bb0be=_0x5bb0be-0x0;var _0x14b5c3=_0xde99[_0x5bb0be];return _0x14b5c3;};'use strict';var Sequelize=require(_0x9de9('0x0'));module[_0x9de9('0x1')]={'description':{'type':Sequelize[_0x9de9('0x2')]},'name':{'type':Sequelize[_0x9de9('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x9de9('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x9de9('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9de9('0x2')],'allowNull':![],'defaultValue':_0x9de9('0x4')},'fontSize':{'type':Sequelize[_0x9de9('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9de9('0x6')],'defaultValue':function(){return _0x9de9('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9de9('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9de9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9de9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9de9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9de9('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9de9('0x3')],'defaultValue':![],'comment':_0x9de9('0x8'),'set':function(_0x178df3){if(!_0x178df3)this[_0x9de9('0x9')](_0x9de9('0xa'),null);this['setDataValue'](_0x9de9('0xb'),_0x178df3);}},'provider':{'type':Sequelize['ENUM'](_0x9de9('0xc'),_0x9de9('0xd'),_0x9de9('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x9de9('0xf')))return'custom';return this['getDataValue'](_0x9de9('0xf'));},'set':function(_0x490ee4){if(_0x490ee4==='custom')_0x490ee4=null;return this[_0x9de9('0x9')](_0x9de9('0xf'),_0x490ee4);}}};
\ No newline at end of file
index 3132ae5..6038ea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5328=['authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','body','provider','Mail\x20Account\x20not\x20found','describe','MailAccountId','create','getDispositions','findOne','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','custom','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','getImap','addImap','removeImap','getSmtp','addSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','ListId','attach','out','messageId','Interaction','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','code','error','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','limit','count','update','UserProfileResource','destroy','stack','name','send','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service'];(function(_0x176178,_0x439cfb){var _0x38f217=function(_0x2c6a54){while(--_0x2c6a54){_0x176178['push'](_0x176178['shift']());}};_0x38f217(++_0x439cfb);}(_0x5328,0x82));var _0x8532=function(_0x13f704,_0x5f649e){_0x13f704=_0x13f704-0x0;var _0x4f6348=_0x5328[_0x13f704];return _0x4f6348;};'use strict';var moment=require('moment');var BPromise=require(_0x8532('0x0'));var util=require('util');var path=require(_0x8532('0x1'));var _=require(_0x8532('0x2'));var juice=require(_0x8532('0x3'));var Redis=require(_0x8532('0x4'));var qs=require(_0x8532('0x5'));var logger=require(_0x8532('0x6'))(_0x8532('0x7'));var config=require(_0x8532('0x8'));var db=require('../../mysqldb')['db'];config[_0x8532('0x9')]=_[_0x8532('0xa')](config[_0x8532('0x9')],{'host':_0x8532('0xb'),'port':0x18eb});var socket=require(_0x8532('0xc'))(new Redis(config[_0x8532('0x9')]));require(_0x8532('0xd'))[_0x8532('0xe')](socket);var jayson=require(_0x8532('0xf'));var client=jayson[_0x8532('0x10')]['http']({'port':0x232b});function respondWithRpcPromise(_0x35305d,_0x166d83,_0xcd84b5,_0x1c65e5){return new BPromise(function(_0x1851f1,_0x1ec641){var _0x4fd840=_0x1c65e5||client;return _0x4fd840[_0x8532('0x11')](_0x35305d,_0xcd84b5)[_0x8532('0x12')](function(_0x2e193f){logger[_0x8532('0x13')]('MailAccount,\x20%s,\x20%s',_0x166d83,_0x8532('0x14'));logger[_0x8532('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x166d83,'request\x20sent',JSON[_0x8532('0x16')](_0x2e193f));if(_0x2e193f['error']){if(_0x2e193f['error'][_0x8532('0x17')]===0x1f4){logger[_0x8532('0x18')](_0x8532('0x19'),_0x166d83,_0x2e193f[_0x8532('0x18')][_0x8532('0x1a')]);return _0x1ec641(_0x2e193f[_0x8532('0x18')][_0x8532('0x1a')]);}logger[_0x8532('0x18')](_0x8532('0x19'),_0x166d83,_0x2e193f[_0x8532('0x18')][_0x8532('0x1a')]);return _0x1851f1(_0x2e193f[_0x8532('0x18')][_0x8532('0x1a')]);}else{logger[_0x8532('0x13')](_0x8532('0x19'),_0x166d83,_0x8532('0x14'));_0x1851f1(_0x2e193f[_0x8532('0x1b')][_0x8532('0x1a')]);}})['catch'](function(_0x544a35){logger[_0x8532('0x18')](_0x8532('0x19'),_0x166d83,_0x544a35);_0x1ec641(_0x544a35);});});}function respondWithStatusCode(_0x718001,_0x37bf6a){_0x37bf6a=_0x37bf6a||0xcc;return function(_0x35918f){if(_0x35918f){return _0x718001[_0x8532('0x1c')](_0x37bf6a);}return _0x718001['status'](_0x37bf6a)[_0x8532('0x1d')]();};}function respondWithResult(_0x5ce90e,_0x36c96d){_0x36c96d=_0x36c96d||0xc8;return function(_0x3c1c10){if(_0x3c1c10){return _0x5ce90e[_0x8532('0x1e')](_0x36c96d)[_0x8532('0x1f')](_0x3c1c10);}};}function respondWithFilteredResult(_0x29b82d,_0x1972df){return function(_0x9891df){if(_0x9891df){var _0x1557f1=typeof _0x1972df[_0x8532('0x20')]===_0x8532('0x21')&&typeof _0x1972df[_0x8532('0x22')]===_0x8532('0x21');var _0x47c61f=_0x9891df[_0x8532('0x23')];var _0x4b75cb=_0x1557f1?0x0:_0x1972df[_0x8532('0x20')];var _0x2a83e7=_0x1557f1?_0x9891df[_0x8532('0x23')]:_0x1972df[_0x8532('0x20')]+_0x1972df['limit'];var _0x5a7e9a;if(_0x2a83e7>=_0x47c61f){_0x2a83e7=_0x47c61f;_0x5a7e9a=0xc8;}else{_0x5a7e9a=0xce;}_0x29b82d[_0x8532('0x1e')](_0x5a7e9a);return _0x29b82d['set']('Content-Range',_0x4b75cb+'-'+_0x2a83e7+'/'+_0x47c61f)[_0x8532('0x1f')](_0x9891df);}return null;};}function saveUpdates(_0x44db04){return function(_0x1c1157){if(_0x1c1157){return _0x1c1157[_0x8532('0x24')](_0x44db04)[_0x8532('0x12')](function(_0x3cd294){return _0x3cd294;});}return null;};}function removeEntity(_0x3ab015){return function(_0x5cf422){if(_0x5cf422){return _0x5cf422['destroy']()['then'](function(){var _0x44b907=_0x5cf422['get']({'plain':!![]});var _0x3748f6='MailAccounts';return db[_0x8532('0x25')][_0x8532('0x26')]({'where':{'type':_0x3748f6,'resourceId':_0x44b907['id']}})[_0x8532('0x12')](function(){return _0x5cf422;});})[_0x8532('0x12')](function(){_0x3ab015[_0x8532('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589f59){return function(_0x57885e){if(!_0x57885e){_0x589f59[_0x8532('0x1c')](0x194);}return _0x57885e;};}function handleError(_0x2b65d5,_0x24bea1){_0x24bea1=_0x24bea1||0x1f4;return function(_0x3d01fe){logger[_0x8532('0x18')](_0x3d01fe[_0x8532('0x27')]);if(_0x3d01fe[_0x8532('0x28')]){delete _0x3d01fe[_0x8532('0x28')];}_0x2b65d5['status'](_0x24bea1)[_0x8532('0x29')](_0x3d01fe);};}function getImapHost(_0x3d6e63){switch(_0x3d6e63){case'gmail':return _0x8532('0x2a');case _0x8532('0x2b'):return'imap.mail.yahoo.com';case _0x8532('0x2c'):return _0x8532('0x2d');case'outlook365':return _0x8532('0x2e');}throw new Error(_0x8532('0x2f'),_0x3d6e63);}function getSmtpHost(_0x30f571){switch(_0x30f571){case _0x8532('0x30'):return _0x8532('0x31');case _0x8532('0x2b'):return _0x8532('0x32');case'hotmail':return _0x8532('0x33');case _0x8532('0x34'):return _0x8532('0x35');}throw new Error(_0x8532('0x2f'),_0x30f571);}function getAuthenticationOptions(_0x26f93d,_0x3eca21){var _0x10121a={};var _0x1122b3={};if(_0x26f93d){_0x10121a[_0x8532('0x36')]=_0x1122b3['user']=_0x3eca21[_0x8532('0x37')];_0x10121a[_0x8532('0x38')]=_0x1122b3[_0x8532('0x39')]=_0x3eca21['password'];if(_0x3eca21[_0x8532('0x3a')]){_0x10121a[_0x8532('0x3a')]=_0x1122b3[_0x8532('0x3a')]=!![];_0x10121a[_0x8532('0x3b')]=_0x1122b3[_0x8532('0x3b')]=_0x3eca21[_0x8532('0x3b')];_0x10121a['password']=_0x1122b3[_0x8532('0x39')]=null;}else{_0x10121a[_0x8532('0x3b')]=_0x1122b3['CloudProviderId']=null;}_0x10121a[_0x8532('0x3c')]=getImapHost(_0x26f93d);_0x10121a[_0x8532('0x3d')]=0x3e1;_0x1122b3[_0x8532('0x3c')]=getSmtpHost(_0x26f93d);_0x1122b3[_0x8532('0x3d')]=0x24b;_0x1122b3[_0x8532('0x3e')]=![];_0x10121a[_0x8532('0x3f')]=_0x1122b3[_0x8532('0x3f')]=null;}else{if(_0x3eca21[_0x8532('0x40')]){_0x10121a['user']=_0x1122b3[_0x8532('0x36')]=_0x3eca21[_0x8532('0x37')];_0x10121a[_0x8532('0x38')]=_0x1122b3[_0x8532('0x39')]=_0x3eca21[_0x8532('0x38')];}else{_0x10121a[_0x8532('0x40')]=_0x1122b3[_0x8532('0x40')]=![];_0x10121a['user']=_0x1122b3[_0x8532('0x36')]=null;_0x10121a[_0x8532('0x38')]=_0x1122b3[_0x8532('0x39')]=null;}_0x10121a[_0x8532('0x3c')]=_0x3eca21[_0x8532('0x41')][_0x8532('0x3c')];_0x10121a[_0x8532('0x3d')]=_0x3eca21['Imap'][_0x8532('0x3d')];_0x1122b3[_0x8532('0x3c')]=_0x3eca21[_0x8532('0x42')][_0x8532('0x3c')];_0x1122b3[_0x8532('0x3d')]=_0x3eca21[_0x8532('0x42')][_0x8532('0x3d')];}return{'Imap':_0x10121a,'Smtp':_0x1122b3};}exports[_0x8532('0x43')]=function(_0x300ad9,_0x243f01){var _0x4cdb8d={'include':[{'model':db[_0x8532('0x44')],'as':_0x8532('0x41')},{'model':db[_0x8532('0x45')],'as':'Smtp'},{'model':db[_0x8532('0x46')],'as':_0x8532('0x47')}]},_0x4f4143={},_0x27afd8={'count':0x0,'rows':[]};var _0x25bb0a=_['map'](db[_0x8532('0x48')][_0x8532('0x49')],function(_0x2d645b){return{'name':_0x2d645b[_0x8532('0x4a')],'type':_0x2d645b['type'][_0x8532('0x4b')]};});_0x4f4143[_0x8532('0x4c')]=_[_0x8532('0x4d')](_0x25bb0a,_0x8532('0x28'));_0x4f4143['query']=_[_0x8532('0x4e')](_0x300ad9[_0x8532('0x4f')]);_0x4f4143[_0x8532('0x50')]=_[_0x8532('0x51')](_0x4f4143[_0x8532('0x4c')],_0x4f4143[_0x8532('0x4f')]);_0x4cdb8d[_0x8532('0x52')]=_['intersection'](_0x4f4143['model'],qs[_0x8532('0x53')](_0x300ad9[_0x8532('0x4f')][_0x8532('0x53')]));_0x4cdb8d[_0x8532('0x52')]=_0x4cdb8d[_0x8532('0x52')][_0x8532('0x54')]?_0x4cdb8d[_0x8532('0x52')]:_0x4f4143[_0x8532('0x4c')];if(!_0x300ad9['query'][_0x8532('0x55')](_0x8532('0x56'))){_0x4cdb8d[_0x8532('0x22')]=qs['limit'](_0x300ad9['query'][_0x8532('0x22')]);_0x4cdb8d[_0x8532('0x20')]=qs[_0x8532('0x20')](_0x300ad9[_0x8532('0x4f')][_0x8532('0x20')]);}_0x4cdb8d[_0x8532('0x57')]=qs[_0x8532('0x58')](_0x300ad9['query']['sort']);_0x4cdb8d[_0x8532('0x59')]=qs[_0x8532('0x50')](_['pick'](_0x300ad9[_0x8532('0x4f')],_0x4f4143[_0x8532('0x50')]),_0x25bb0a);if(_0x300ad9[_0x8532('0x4f')][_0x8532('0x5a')]){_0x4cdb8d[_0x8532('0x59')]=_['merge'](_0x4cdb8d[_0x8532('0x59')],{'$or':_[_0x8532('0x4d')](_0x25bb0a,function(_0x58f82c){if(_0x58f82c[_0x8532('0x5b')]!==_0x8532('0x5c')){var _0x59e75b={};_0x59e75b[_0x58f82c[_0x8532('0x28')]]={'$like':'%'+_0x300ad9[_0x8532('0x4f')][_0x8532('0x5a')]+'%'};return _0x59e75b;}})});}_0x4cdb8d=_[_0x8532('0x5d')]({},_0x4cdb8d,_0x300ad9[_0x8532('0x5e')]);var _0x46ad4d={'where':_0x4cdb8d[_0x8532('0x59')]};return db[_0x8532('0x48')][_0x8532('0x23')](_0x46ad4d)[_0x8532('0x12')](function(_0x28267b){_0x27afd8[_0x8532('0x23')]=_0x28267b;if(_0x300ad9[_0x8532('0x4f')][_0x8532('0x5f')]){_0x4cdb8d[_0x8532('0x60')]=[{'all':!![]}];}return db[_0x8532('0x48')][_0x8532('0x61')](_0x4cdb8d);})['then'](function(_0x46b225){_0x27afd8[_0x8532('0x62')]=_0x46b225;return _0x27afd8;})[_0x8532('0x12')](respondWithFilteredResult(_0x243f01,_0x4cdb8d))['catch'](handleError(_0x243f01,null));};exports[_0x8532('0x63')]=function(_0x5accf8,_0x41ecea){var _0x5c8c2d={'raw':![],'where':{'id':_0x5accf8[_0x8532('0x64')]['id']},'include':[{'model':db[_0x8532('0x44')],'as':'Imap'},{'model':db[_0x8532('0x45')],'as':'Smtp'},{'model':db[_0x8532('0x46')],'as':_0x8532('0x47')}]},_0x233bc7={};_0x233bc7['model']=_['keys'](db[_0x8532('0x48')]['rawAttributes']);_0x233bc7[_0x8532('0x4f')]=_['keys'](_0x5accf8['query']);_0x233bc7[_0x8532('0x50')]=_[_0x8532('0x51')](_0x233bc7[_0x8532('0x4c')],_0x233bc7[_0x8532('0x4f')]);_0x5c8c2d[_0x8532('0x52')]=_[_0x8532('0x51')](_0x233bc7['model'],qs[_0x8532('0x53')](_0x5accf8[_0x8532('0x4f')]['fields']));_0x5c8c2d[_0x8532('0x52')]=_0x5c8c2d[_0x8532('0x52')][_0x8532('0x54')]?_0x5c8c2d[_0x8532('0x52')]:_0x233bc7[_0x8532('0x4c')];if(_0x5accf8['query'][_0x8532('0x5f')]){_0x5c8c2d[_0x8532('0x60')]=[{'all':!![]}];}_0x5c8c2d=_[_0x8532('0x5d')]({},_0x5c8c2d,_0x5accf8[_0x8532('0x5e')]);return db[_0x8532('0x48')][_0x8532('0x65')](_0x5c8c2d)['then'](handleEntityNotFound(_0x41ecea,null))[_0x8532('0x12')](respondWithResult(_0x41ecea,null))[_0x8532('0x66')](handleError(_0x41ecea,null));};exports['update']=function(_0x3605cd,_0x13e34b){if(_0x3605cd['body']['id']){delete _0x3605cd[_0x8532('0x67')]['id'];}var _0x399c6f=_0x3605cd[_0x8532('0x67')]['provider']==='custom'?null:_0x3605cd['body'][_0x8532('0x68')];var _0x490e84=_0x3605cd['body'][_0x8532('0x41')]||{};var _0x1d315f=_0x3605cd['body'][_0x8532('0x42')]||{};if(_0x399c6f){_0x490e84[_0x8532('0x3c')]=getImapHost(_0x399c6f);_0x490e84[_0x8532('0x3d')]=0x3e1;_0x1d315f[_0x8532('0x3c')]=getSmtpHost(_0x399c6f);_0x1d315f[_0x8532('0x3d')]=0x24b;_0x1d315f['secure']=![];}if(_0x1d315f[_0x8532('0x3a')]){_0x1d315f['secure']=![];}else{_0x1d315f['CloudProviderId']=null;}if(!_0x490e84[_0x8532('0x3a')])_0x490e84[_0x8532('0x3b')]=null;_0x3605cd[_0x8532('0x67')][_0x8532('0x41')]=_0x490e84;_0x3605cd[_0x8532('0x67')][_0x8532('0x42')]=_0x1d315f;return db[_0x8532('0x48')][_0x8532('0x65')]({'where':{'id':_0x3605cd[_0x8532('0x64')]['id']},'include':[{'model':db[_0x8532('0x44')],'as':'Imap'},{'model':db[_0x8532('0x45')],'as':_0x8532('0x42')},{'model':db[_0x8532('0x46')],'as':_0x8532('0x47')}]})[_0x8532('0x12')](handleEntityNotFound(_0x13e34b,null))[_0x8532('0x12')](function(_0x55781e){if(!_0x55781e)throw new Error(_0x8532('0x69'));if(_0x55781e[_0x8532('0x3f')])delete _0x3605cd[_0x8532('0x67')][_0x8532('0x41')];return _0x55781e;})[_0x8532('0x12')](saveUpdates(_0x3605cd[_0x8532('0x67')],null))[_0x8532('0x12')](function(_0x37e5a1){if(!_0x3605cd['body'][_0x8532('0x41')])return _0x37e5a1;return db['MailServerIn'][_0x8532('0x24')](_0x3605cd['body'][_0x8532('0x41')],{'where':{'MailAccountId':_0x37e5a1['id']}})[_0x8532('0x12')](function(){return _0x37e5a1;});})['then'](function(_0x40d02a){if(!_0x3605cd[_0x8532('0x67')][_0x8532('0x42')])return _0x40d02a;return db['MailServerOut']['update'](_0x3605cd[_0x8532('0x67')][_0x8532('0x42')],{'where':{'MailAccountId':_0x40d02a['id']}})[_0x8532('0x12')](function(){return _0x40d02a;});})[_0x8532('0x12')](respondWithResult(_0x13e34b,null))[_0x8532('0x66')](handleError(_0x13e34b,null));};exports[_0x8532('0x6a')]=function(_0x6fc4e0,_0x8ae3c9){return db['MailAccount'][_0x8532('0x6a')]()[_0x8532('0x12')](respondWithResult(_0x8ae3c9,null))['catch'](handleError(_0x8ae3c9,null));};exports['addDisposition']=function(_0x101378,_0x4153da){if(_0x101378[_0x8532('0x67')]['id']){delete _0x101378['body']['id'];}return db[_0x8532('0x48')][_0x8532('0x65')]({'where':{'id':_0x101378['params']['id']}})['then'](handleEntityNotFound(_0x4153da,null))[_0x8532('0x12')](function(_0x406791){if(_0x406791){_0x101378['body'][_0x8532('0x6b')]=_0x406791['id'];return db['Disposition'][_0x8532('0x6c')](_0x101378[_0x8532('0x67')]);}})[_0x8532('0x12')](respondWithResult(_0x4153da,null))['catch'](handleError(_0x4153da,null));};exports[_0x8532('0x6d')]=function(_0x40c15b,_0x3b6168){var _0x57907c={'raw':![],'where':{}};var _0x41e1fb={};var _0x4f67f4={'count':0x0,'rows':[]};return db[_0x8532('0x48')][_0x8532('0x6e')]({'where':{'id':_0x40c15b['params']['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x3b6168,null))[_0x8532('0x12')](function(_0x3b5f69){if(_0x3b5f69){_0x41e1fb[_0x8532('0x4c')]=_[_0x8532('0x4e')](db[_0x8532('0x6f')][_0x8532('0x49')]);_0x41e1fb['query']=_[_0x8532('0x4e')](_0x40c15b[_0x8532('0x4f')]);_0x41e1fb[_0x8532('0x50')]=_[_0x8532('0x51')](_0x41e1fb[_0x8532('0x4c')],_0x41e1fb[_0x8532('0x4f')]);_0x57907c[_0x8532('0x52')]=_[_0x8532('0x51')](_0x41e1fb['model'],qs[_0x8532('0x53')](_0x40c15b[_0x8532('0x4f')][_0x8532('0x53')]));_0x57907c[_0x8532('0x52')]=_0x57907c[_0x8532('0x52')]['length']?_0x57907c[_0x8532('0x52')]:_0x41e1fb[_0x8532('0x4c')];if(!_0x40c15b[_0x8532('0x4f')]['hasOwnProperty'](_0x8532('0x56'))){_0x57907c['limit']=qs['limit'](_0x40c15b[_0x8532('0x4f')][_0x8532('0x22')]);_0x57907c['offset']=qs[_0x8532('0x20')](_0x40c15b[_0x8532('0x4f')][_0x8532('0x20')]);}_0x57907c['order']=qs[_0x8532('0x58')](_0x40c15b[_0x8532('0x4f')][_0x8532('0x58')]);_0x57907c[_0x8532('0x59')]=qs[_0x8532('0x50')](_['pick'](_0x40c15b[_0x8532('0x4f')],_0x41e1fb[_0x8532('0x50')]));_0x57907c['where'][_0x8532('0x6b')]=_0x3b5f69['id'];if(_0x40c15b[_0x8532('0x4f')][_0x8532('0x5a')]){_0x57907c['where']=_['merge'](_0x57907c[_0x8532('0x59')],{'$or':_[_0x8532('0x4d')](_0x57907c[_0x8532('0x52')],function(_0x53c208){var _0x4cd1b5={};_0x4cd1b5[_0x53c208]={'$like':'%'+_0x40c15b[_0x8532('0x4f')]['filter']+'%'};return _0x4cd1b5;})});}_0x57907c=_[_0x8532('0x5d')]({},_0x57907c,_0x40c15b['options']);return db[_0x8532('0x6f')][_0x8532('0x23')]({'where':_0x57907c['where']})[_0x8532('0x12')](function(_0x35b871){_0x4f67f4[_0x8532('0x23')]=_0x35b871;if(_0x40c15b[_0x8532('0x4f')][_0x8532('0x5f')]){_0x57907c[_0x8532('0x60')]=[{'all':!![]}];}return db[_0x8532('0x6f')]['findAll'](_0x57907c);})['then'](function(_0x5e3f5c){_0x4f67f4['rows']=_0x5e3f5c;return _0x4f67f4;});}})['then'](respondWithFilteredResult(_0x3b6168,_0x57907c))['catch'](handleError(_0x3b6168,null));};exports[_0x8532('0x70')]=function(_0x434d62,_0x2658f7){return db[_0x8532('0x48')][_0x8532('0x65')]({'where':{'id':_0x434d62[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x2658f7,null))['then'](function(_0x1c6f16){if(_0x1c6f16){return _0x1c6f16[_0x8532('0x70')](_0x434d62[_0x8532('0x4f')][_0x8532('0x71')]);}})[_0x8532('0x12')](respondWithStatusCode(_0x2658f7,null))['catch'](handleError(_0x2658f7,null));};exports['addAnswer']=function(_0x4d8c09,_0x1d8a08){if(_0x4d8c09[_0x8532('0x67')]['id']){delete _0x4d8c09['body']['id'];}return db['MailAccount'][_0x8532('0x65')]({'where':{'id':_0x4d8c09[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x1d8a08,null))['then'](function(_0x307167){if(_0x307167){_0x4d8c09[_0x8532('0x67')][_0x8532('0x6b')]=_0x307167['id'];return db[_0x8532('0x72')][_0x8532('0x6c')](_0x4d8c09[_0x8532('0x67')]);}})['then'](respondWithResult(_0x1d8a08,null))[_0x8532('0x66')](handleError(_0x1d8a08,null));};exports[_0x8532('0x73')]=function(_0x1e269f,_0x1baa5d){var _0x1320f7={'raw':![],'where':{}};var _0x1c7d7a={};var _0x824392={'count':0x0,'rows':[]};return db[_0x8532('0x48')][_0x8532('0x6e')]({'where':{'id':_0x1e269f[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x1baa5d,null))[_0x8532('0x12')](function(_0x270b85){if(_0x270b85){_0x1c7d7a['model']=_[_0x8532('0x4e')](db[_0x8532('0x72')][_0x8532('0x49')]);_0x1c7d7a[_0x8532('0x4f')]=_['keys'](_0x1e269f[_0x8532('0x4f')]);_0x1c7d7a[_0x8532('0x50')]=_[_0x8532('0x51')](_0x1c7d7a[_0x8532('0x4c')],_0x1c7d7a['query']);_0x1320f7[_0x8532('0x52')]=_[_0x8532('0x51')](_0x1c7d7a[_0x8532('0x4c')],qs[_0x8532('0x53')](_0x1e269f[_0x8532('0x4f')][_0x8532('0x53')]));_0x1320f7[_0x8532('0x52')]=_0x1320f7[_0x8532('0x52')][_0x8532('0x54')]?_0x1320f7['attributes']:_0x1c7d7a[_0x8532('0x4c')];if(!_0x1e269f[_0x8532('0x4f')][_0x8532('0x55')]('nolimit')){_0x1320f7['limit']=qs[_0x8532('0x22')](_0x1e269f[_0x8532('0x4f')][_0x8532('0x22')]);_0x1320f7[_0x8532('0x20')]=qs['offset'](_0x1e269f[_0x8532('0x4f')][_0x8532('0x20')]);}_0x1320f7[_0x8532('0x57')]=qs[_0x8532('0x58')](_0x1e269f[_0x8532('0x4f')]['sort']);_0x1320f7['where']=qs['filters'](_[_0x8532('0x74')](_0x1e269f[_0x8532('0x4f')],_0x1c7d7a[_0x8532('0x50')]));_0x1320f7[_0x8532('0x59')][_0x8532('0x6b')]=_0x270b85['id'];if(_0x1e269f[_0x8532('0x4f')][_0x8532('0x5a')]){_0x1320f7['where']=_['merge'](_0x1320f7[_0x8532('0x59')],{'$or':_[_0x8532('0x4d')](_0x1320f7['attributes'],function(_0x498e50){var _0x544236={};_0x544236[_0x498e50]={'$like':'%'+_0x1e269f[_0x8532('0x4f')][_0x8532('0x5a')]+'%'};return _0x544236;})});}_0x1320f7=_[_0x8532('0x5d')]({},_0x1320f7,_0x1e269f[_0x8532('0x5e')]);return db['CannedAnswer'][_0x8532('0x23')]({'where':_0x1320f7['where']})[_0x8532('0x12')](function(_0x1880f7){_0x824392['count']=_0x1880f7;if(_0x1e269f[_0x8532('0x4f')][_0x8532('0x5f')]){_0x1320f7[_0x8532('0x60')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8532('0x61')](_0x1320f7);})['then'](function(_0x48b29c){_0x824392[_0x8532('0x62')]=_0x48b29c;return _0x824392;});}})['then'](respondWithFilteredResult(_0x1baa5d,_0x1320f7))[_0x8532('0x66')](handleError(_0x1baa5d,null));};exports['removeAnswers']=function(_0x23fa57,_0x579fd7){return db[_0x8532('0x48')][_0x8532('0x65')]({'where':{'id':_0x23fa57[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x579fd7,null))['then'](function(_0x294387){if(_0x294387){return _0x294387[_0x8532('0x75')](_0x23fa57[_0x8532('0x4f')]['ids']);}})[_0x8532('0x12')](respondWithStatusCode(_0x579fd7,null))[_0x8532('0x66')](handleError(_0x579fd7,null));};exports['create']=function(_0x5116b8,_0x5e0e94){var _0x3c182e={'name':_0x5116b8['body'][_0x8532('0x28')],'key':_0x5116b8[_0x8532('0x67')][_0x8532('0x4b')],'provider':_0x5116b8[_0x8532('0x67')][_0x8532('0x68')]===_0x8532('0x76')?null:_0x5116b8[_0x8532('0x67')][_0x8532('0x68')],'email':_0x5116b8[_0x8532('0x67')]['email'],'ListId':_0x5116b8[_0x8532('0x67')]['ListId'],'active':!_[_0x8532('0x77')](_0x5116b8[_0x8532('0x67')][_0x8532('0x78')])?_0x5116b8[_0x8532('0x67')][_0x8532('0x78')]:!![],'description':_0x5116b8[_0x8532('0x67')]['description']||null};var _0x513cfd=getAuthenticationOptions(_0x3c182e['provider'],_0x5116b8['body']);_0x3c182e['Imap']=_0x513cfd[_0x8532('0x41')];_0x3c182e['Smtp']=_0x513cfd[_0x8532('0x42')];return db[_0x8532('0x48')]['create'](_0x3c182e,{'include':[{'model':db[_0x8532('0x45')],'as':_0x8532('0x42')},{'model':db[_0x8532('0x44')],'as':_0x8532('0x41')}]})[_0x8532('0x12')](function(_0x441b45){var _0x1b4714=_0x5116b8[_0x8532('0x36')]['get']({'plain':!![]});if(!_0x1b4714)throw new Error(_0x8532('0x79'));if(_0x1b4714[_0x8532('0x7a')]===_0x8532('0x36')){var _0x5365e4=_0x441b45[_0x8532('0x7b')]({'plain':!![]});return db[_0x8532('0x7c')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x1b4714['userProfileId']},'raw':!![]})[_0x8532('0x12')](function(_0x563b0e){if(_0x563b0e&&_0x563b0e[_0x8532('0x7d')]===0x0){return db[_0x8532('0x25')][_0x8532('0x6c')]({'name':_0x5365e4[_0x8532('0x28')],'resourceId':_0x5365e4['id'],'type':_0x563b0e[_0x8532('0x28')],'sectionId':_0x563b0e['id']},{})[_0x8532('0x12')](function(){return _0x441b45;});}else{return _0x441b45;}})[_0x8532('0x66')](function(_0xc131c7){logger[_0x8532('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc131c7);throw _0xc131c7;});}return _0x441b45;})['then'](respondWithResult(_0x5e0e94,0xc9))[_0x8532('0x66')](handleError(_0x5e0e94,null));};exports[_0x8532('0x7e')]=function(_0x1f9b14,_0x28ffc5){return db[_0x8532('0x48')][_0x8532('0x6e')]({'where':{'id':_0x1f9b14['params']['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x28ffc5,null))[_0x8532('0x12')](function(_0x22eec3){if(_0x22eec3){return _0x22eec3[_0x8532('0x7e')]();}return null;})[_0x8532('0x12')](respondWithResult(_0x28ffc5,null))[_0x8532('0x66')](handleError(_0x28ffc5,null));};exports[_0x8532('0x7f')]=function(_0x48bb20,_0x1146d0){if(_0x48bb20[_0x8532('0x67')]['id']){delete _0x48bb20[_0x8532('0x67')]['id'];}return db['MailAccount'][_0x8532('0x65')]({'where':{'id':_0x48bb20[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x1146d0,null))[_0x8532('0x12')](function(_0x467f14){if(_0x467f14){_0x48bb20['body']['MailAccountId']=_0x467f14['id'];return db['MailServerIn']['create'](_0x48bb20[_0x8532('0x67')]);}})[_0x8532('0x12')](respondWithResult(_0x1146d0,null))[_0x8532('0x66')](handleError(_0x1146d0,null));};exports[_0x8532('0x80')]=function(_0xbdd258,_0xa694dc){return db[_0x8532('0x48')][_0x8532('0x6e')]({'where':{'id':_0xbdd258['params']['id']}})[_0x8532('0x12')](handleEntityNotFound(_0xa694dc,null))[_0x8532('0x12')](function(_0x139516){if(_0x139516){return _0x139516['setImap'](null);}return null;})[_0x8532('0x12')](respondWithStatusCode(_0xa694dc,null))[_0x8532('0x66')](handleError(_0xa694dc,null));};exports[_0x8532('0x81')]=function(_0xceba0f,_0x4c9321){return db['MailAccount'][_0x8532('0x6e')]({'where':{'id':_0xceba0f['params']['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x4c9321,null))['then'](function(_0x1b2de7){if(_0x1b2de7){return _0x1b2de7[_0x8532('0x81')]();}return null;})[_0x8532('0x12')](respondWithResult(_0x4c9321,null))['catch'](handleError(_0x4c9321,null));};exports[_0x8532('0x82')]=function(_0x250a52,_0x5ba4a4){if(_0x250a52['body']['id']){delete _0x250a52[_0x8532('0x67')]['id'];}return db[_0x8532('0x48')][_0x8532('0x65')]({'where':{'id':_0x250a52[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x5ba4a4,null))[_0x8532('0x12')](function(_0x48d3ae){if(_0x48d3ae){_0x250a52[_0x8532('0x67')][_0x8532('0x6b')]=_0x48d3ae['id'];return db[_0x8532('0x45')][_0x8532('0x6c')](_0x250a52[_0x8532('0x67')]);}})[_0x8532('0x12')](respondWithResult(_0x5ba4a4,null))[_0x8532('0x66')](handleError(_0x5ba4a4,null));};exports['removeSmtp']=function(_0x2f77a2,_0x6e70b5){return db[_0x8532('0x48')][_0x8532('0x6e')]({'where':{'id':_0x2f77a2[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x6e70b5,null))[_0x8532('0x12')](function(_0x5112a3){if(_0x5112a3){return _0x5112a3[_0x8532('0x83')](null);}return null;})[_0x8532('0x12')](respondWithStatusCode(_0x6e70b5,null))[_0x8532('0x66')](handleError(_0x6e70b5,null));};exports[_0x8532('0x84')]=function(_0xf4036d,_0x189e25){return db['MailInteraction'][_0x8532('0x65')]({'where':{'id':_0xf4036d['params']['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x189e25,null))[_0x8532('0x12')](function(_0x55feee){if(_0x55feee){return _0x55feee[_0x8532('0x84')](_0xf4036d[_0x8532('0x67')][_0x8532('0x71')],_[_0x8532('0x85')](_0xf4036d[_0x8532('0x67')],[_0x8532('0x71'),'id'])||{});}})['then'](respondWithResult(_0x189e25,null))[_0x8532('0x66')](handleError(_0x189e25,null));};exports[_0x8532('0x86')]=function(_0x30b1a7,_0x5933b8){var _0xcdb25c={'raw':![],'where':{}};var _0x4631fb={};var _0x344892={'count':0x0,'rows':[]};return db[_0x8532('0x48')][_0x8532('0x6e')]({'where':{'id':_0x30b1a7['params']['id']}})['then'](handleEntityNotFound(_0x5933b8,null))[_0x8532('0x12')](function(_0x183992){if(_0x183992){_0x4631fb[_0x8532('0x4c')]=_[_0x8532('0x4e')](db[_0x8532('0x87')][_0x8532('0x49')]);_0x4631fb['query']=_[_0x8532('0x4e')](_0x30b1a7['query']);_0x4631fb[_0x8532('0x50')]=_[_0x8532('0x51')](_0x4631fb[_0x8532('0x4c')],_0x4631fb[_0x8532('0x4f')]);_0xcdb25c['attributes']=_['intersection'](_0x4631fb[_0x8532('0x4c')],qs[_0x8532('0x53')](_0x30b1a7[_0x8532('0x4f')][_0x8532('0x53')]));_0xcdb25c[_0x8532('0x52')]=_0xcdb25c['attributes'][_0x8532('0x54')]?_0xcdb25c[_0x8532('0x52')]:_0x4631fb[_0x8532('0x4c')];if(!_0x30b1a7['query']['hasOwnProperty']('nolimit')){_0xcdb25c['limit']=qs[_0x8532('0x22')](_0x30b1a7['query'][_0x8532('0x22')]);_0xcdb25c[_0x8532('0x20')]=qs['offset'](_0x30b1a7[_0x8532('0x4f')][_0x8532('0x20')]);}_0xcdb25c[_0x8532('0x57')]=qs['sort'](_0x30b1a7[_0x8532('0x4f')][_0x8532('0x58')]);_0xcdb25c[_0x8532('0x59')]=qs[_0x8532('0x50')](_['pick'](_0x30b1a7['query'],_0x4631fb['filters']));_0xcdb25c[_0x8532('0x59')]['MailAccountId']=_0x183992['id'];if(_0x30b1a7[_0x8532('0x4f')][_0x8532('0x5a')]){_0xcdb25c[_0x8532('0x59')]=_[_0x8532('0x5d')](_0xcdb25c['where'],{'$or':_['map'](_0xcdb25c[_0x8532('0x52')],function(_0xf13293){var _0x4f8d66={};_0x4f8d66[_0xf13293]={'$like':'%'+_0x30b1a7[_0x8532('0x4f')][_0x8532('0x5a')]+'%'};return _0x4f8d66;})});}_0xcdb25c=_[_0x8532('0x5d')]({},_0xcdb25c,_0x30b1a7[_0x8532('0x5e')]);return db[_0x8532('0x87')][_0x8532('0x23')]({'where':_0xcdb25c[_0x8532('0x59')]})['then'](function(_0x2a71b0){_0x344892[_0x8532('0x23')]=_0x2a71b0;if(_0x30b1a7['query'][_0x8532('0x5f')]){_0xcdb25c[_0x8532('0x60')]=[{'model':db[_0x8532('0x88')],'as':_0x8532('0x89'),'required':![]},{'model':db[_0x8532('0x8a')],'as':_0x8532('0x8b'),'attributes':[_0x8532('0x28'),_0x8532('0x8c'),_0x8532('0x8d')],'required':![]},{'model':db[_0x8532('0x8e')],'as':_0x8532('0x8f'),'attributes':['id',_0x8532('0x28'),'color'],'where':_0x30b1a7[_0x8532('0x4f')][_0x8532('0x90')]?{'id':_0x30b1a7[_0x8532('0x4f')][_0x8532('0x90')]}:undefined,'required':_0x30b1a7[_0x8532('0x4f')][_0x8532('0x90')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0xcdb25c);})[_0x8532('0x12')](function(_0xdb8563){_0x344892['rows']=_0xdb8563;return _0x344892;});}})[_0x8532('0x12')](respondWithFilteredResult(_0x5933b8,_0xcdb25c))[_0x8532('0x66')](handleError(_0x5933b8,null));};exports[_0x8532('0x91')]=function addApplications(_0x15cc44,_0x50b51d){var _0xb4870e=_0x15cc44[_0x8532('0x64')]['id'];var _0x4d1685=_0x15cc44[_0x8532('0x67')];var _0x987561=0xc8;var _0x6b6f37=null;return db[_0x8532('0x92')][_0x8532('0x93')]({'isolationLevel':db[_0x8532('0x92')]['Transaction']['ISOLATION_LEVELS'][_0x8532('0x94')]},function(_0x36247d){return db[_0x8532('0x48')][_0x8532('0x6e')]({'where':{'id':_0xb4870e},'transaction':_0x36247d})['then'](function(_0x1bcf60){if(_0x1bcf60){return db[_0x8532('0x95')][_0x8532('0x26')]({'where':{'MailAccountId':_0xb4870e},'transaction':_0x36247d})[_0x8532('0x12')](function(){var _0x3b6229=_[_0x8532('0x4d')](_0x4d1685,function(_0x2c6f69){_0x2c6f69[_0x8532('0x6b')]=_0xb4870e;return _0x2c6f69;});return db[_0x8532('0x95')][_0x8532('0x96')](_0x3b6229,{'transaction':_0x36247d});});}else{_0x987561=0x194;_0x6b6f37=[];}});})['then'](function(){if(_0x987561!==0x194){return db[_0x8532('0x95')][_0x8532('0x97')]({'where':{'MailAccountId':_0xb4870e},'order':_0x8532('0x98')})[_0x8532('0x12')](function(_0x409adb){_0x6b6f37=_0x409adb;});}})['catch'](function(_0x3aeb90){_0x987561=0x1f4;logger['error'](_0x3aeb90['stack']);if(_0x3aeb90[_0x8532('0x28')]){delete _0x3aeb90[_0x8532('0x28')];}_0x6b6f37=_0x3aeb90;})[_0x8532('0x99')](function(){if(_0x6b6f37===null){_0x50b51d['sendStatus'](_0x987561);}else{if(_0x987561===0x1f4){_0x50b51d[_0x8532('0x1e')](_0x987561)['send'](_0x6b6f37);}else{_0x50b51d['status'](_0x987561)[_0x8532('0x1f')](_0x6b6f37);}}});};exports['getApplications']=function(_0x359cb7,_0x2b1c32){var _0x51a607={};var _0x588c23={};var _0x575de5;var _0xb79976;return db[_0x8532('0x48')][_0x8532('0x6e')]({'where':{'id':_0x359cb7[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x2b1c32,null))[_0x8532('0x12')](function(_0x4a74be){if(_0x4a74be){_0x575de5=_0x4a74be;_0x588c23[_0x8532('0x4c')]=_[_0x8532('0x4e')](db[_0x8532('0x95')][_0x8532('0x49')]);_0x588c23[_0x8532('0x4f')]=_['keys'](_0x359cb7['query']);_0x588c23[_0x8532('0x50')]=_[_0x8532('0x51')](_0x588c23['model'],_0x588c23[_0x8532('0x4f')]);_0x51a607[_0x8532('0x52')]=_[_0x8532('0x51')](_0x588c23[_0x8532('0x4c')],qs[_0x8532('0x53')](_0x359cb7[_0x8532('0x4f')]['fields']));_0x51a607[_0x8532('0x52')]=_0x51a607['attributes'][_0x8532('0x54')]?_0x51a607[_0x8532('0x52')]:_0x588c23[_0x8532('0x4c')];_0x51a607['order']=qs[_0x8532('0x58')](_0x359cb7[_0x8532('0x4f')][_0x8532('0x58')]);_0x51a607['where']=qs[_0x8532('0x50')](_['pick'](_0x359cb7[_0x8532('0x4f')],_0x588c23[_0x8532('0x50')]));if(_0x359cb7[_0x8532('0x4f')][_0x8532('0x5a')]){_0x51a607[_0x8532('0x59')]=_[_0x8532('0x5d')](_0x51a607[_0x8532('0x59')],{'$or':_[_0x8532('0x4d')](_0x51a607['attributes'],function(_0x1bccf5){var _0x3ae73f={};_0x3ae73f[_0x1bccf5]={'$like':'%'+_0x359cb7[_0x8532('0x4f')]['filter']+'%'};return _0x3ae73f;})});}_0x51a607=_[_0x8532('0x5d')]({},_0x51a607,_0x359cb7[_0x8532('0x5e')]);return _0x575de5[_0x8532('0x9a')](_0x51a607);}})[_0x8532('0x12')](function(_0x284afc){if(_0x284afc){_0xb79976=_0x284afc['length'];if(!_0x359cb7['query']['hasOwnProperty'](_0x8532('0x56'))){_0x51a607[_0x8532('0x22')]=qs[_0x8532('0x22')](_0x359cb7['query'][_0x8532('0x22')]);_0x51a607['offset']=qs[_0x8532('0x20')](_0x359cb7[_0x8532('0x4f')][_0x8532('0x20')]);}return _0x575de5[_0x8532('0x9a')](_0x51a607);}})[_0x8532('0x12')](function(_0x36eb7d){if(_0x36eb7d){return _0x36eb7d?{'count':_0xb79976,'rows':_0x36eb7d}:null;}})[_0x8532('0x12')](respondWithResult(_0x2b1c32,null))[_0x8532('0x66')](handleError(_0x2b1c32,null));};exports[_0x8532('0x9b')]=function(_0x51f264,_0x4974da){var _0x352b6c={'raw':!![],'where':{}};var _0x1af8dd={};var _0x32a8dc={'count':0x0,'rows':[]};return db[_0x8532('0x48')]['findOne']({'where':{'id':_0x51f264[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x4974da,null))[_0x8532('0x12')](function(_0x487ca9){if(_0x487ca9){_0x1af8dd['model']=_['keys'](db[_0x8532('0x9c')]['rawAttributes']);_0x1af8dd[_0x8532('0x4f')]=_['keys'](_0x51f264[_0x8532('0x4f')]);_0x1af8dd['filters']=_[_0x8532('0x51')](_0x1af8dd[_0x8532('0x4c')],_0x1af8dd[_0x8532('0x4f')]);_0x352b6c['attributes']=_[_0x8532('0x51')](_0x1af8dd[_0x8532('0x4c')],qs[_0x8532('0x53')](_0x51f264[_0x8532('0x4f')][_0x8532('0x53')]));_0x352b6c[_0x8532('0x52')]=_0x352b6c[_0x8532('0x52')][_0x8532('0x54')]?_0x352b6c[_0x8532('0x52')]:_0x1af8dd[_0x8532('0x4c')];if(!_0x51f264[_0x8532('0x4f')]['hasOwnProperty']('nolimit')){_0x352b6c[_0x8532('0x22')]=qs['limit'](_0x51f264[_0x8532('0x4f')]['limit']);_0x352b6c['offset']=qs['offset'](_0x51f264[_0x8532('0x4f')]['offset']);}_0x352b6c['order']=qs[_0x8532('0x58')](_0x51f264[_0x8532('0x4f')][_0x8532('0x58')]);_0x352b6c[_0x8532('0x59')]=qs[_0x8532('0x50')](_[_0x8532('0x74')](_0x51f264[_0x8532('0x4f')],_0x1af8dd[_0x8532('0x50')]));_0x352b6c[_0x8532('0x59')]['MailAccountId']=_0x487ca9['id'];if(_0x51f264[_0x8532('0x4f')]['filter']){_0x352b6c[_0x8532('0x59')]=_[_0x8532('0x5d')](_0x352b6c['where'],{'$or':_[_0x8532('0x4d')](_0x352b6c[_0x8532('0x52')],function(_0x28dd9f){var _0x1ae5c2={};_0x1ae5c2[_0x28dd9f]={'$like':'%'+_0x51f264[_0x8532('0x4f')][_0x8532('0x5a')]+'%'};return _0x1ae5c2;})});}if(_0x51f264[_0x8532('0x4f')][_0x8532('0x9d')]){var _0xc24b45=_0x51f264[_0x8532('0x4f')]['$gte'][_0x8532('0x9e')](',');var _0x3852c4={};_0x3852c4[_0xc24b45[0x0]]={'$gte':moment(_0xc24b45[0x1])[_0x8532('0x9f')](_0x8532('0xa0'))};_0x352b6c[_0x8532('0x59')]=_['merge'](_0x352b6c[_0x8532('0x59')],_0x3852c4);}_0x352b6c=_[_0x8532('0x5d')]({},_0x352b6c,_0x51f264[_0x8532('0x5e')]);return db[_0x8532('0x9c')][_0x8532('0x23')]({'where':_0x352b6c[_0x8532('0x59')]})['then'](function(_0x3a2e95){_0x32a8dc['count']=_0x3a2e95;if(_0x51f264[_0x8532('0x4f')][_0x8532('0x5f')]){_0x352b6c[_0x8532('0x60')]=[{'all':!![]}];}return db[_0x8532('0x9c')]['findAll'](_0x352b6c);})[_0x8532('0x12')](function(_0x1b8302){if(_0x51f264['query'][_0x8532('0xa1')]==='true'){for(var _0x40956e=0x0;_0x40956e<_0x1b8302[_0x8532('0x54')];_0x40956e++){_0x1b8302[_0x40956e][_0x8532('0x67')]=juice(_0x1b8302[_0x40956e][_0x8532('0x67')]);}}_0x32a8dc['rows']=_0x1b8302;return _0x32a8dc;});}})[_0x8532('0x12')](respondWithFilteredResult(_0x4974da,_0x352b6c))['catch'](handleError(_0x4974da,null));};exports[_0x8532('0x29')]=function(_0x52adf2,_0x4c7c66){var _0x5340da,_0x3c8dde={},_0x41354f;if(_0x52adf2[_0x8532('0x67')]['to']){_0x41354f=_0x52adf2[_0x8532('0x67')]['to'][_0x8532('0x9e')](',')[0x0];}return db[_0x8532('0x48')]['find']({'where':{'id':_0x52adf2[_0x8532('0x64')]['id']},'include':[{'model':db['CmList'],'as':_0x8532('0xa2'),'include':[{'model':db[_0x8532('0x88')],'as':_0x8532('0xa3'),'where':{'email':_0x41354f},'limit':0x1,'order':[[_0x8532('0xa4'),_0x8532('0xa5')]]}]},{'model':db[_0x8532('0x45')],'as':_0x8532('0x42'),'raw':!![],'include':[{'model':db[_0x8532('0xa6')],'as':_0x8532('0xa6'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4c7c66,null))[_0x8532('0x12')](function(_0x4898c8){if(!_0x4898c8)return;_0x5340da=_0x4898c8;if(!_0x4898c8[_0x8532('0x42')])throw new Error(_0x8532('0xa7'));if(_[_0x8532('0x77')](_0x52adf2[_0x8532('0x67')][_0x8532('0xa8')])){_0x52adf2[_0x8532('0x67')][_0x8532('0xa8')]=util['format'](_0x8532('0xa9'),_0x4898c8[_0x8532('0x28')],_0x4898c8['email']||_0x4898c8[_0x8532('0x42')][_0x8532('0x36')]);}if(_0x52adf2[_0x8532('0x67')][_0x8532('0xaa')]&&_0x52adf2['body']['attachments']['length']){for(var _0x30cd38=0x0;_0x30cd38<_0x52adf2[_0x8532('0x67')][_0x8532('0xaa')][_0x8532('0x54')];_0x30cd38+=0x1){_0x52adf2[_0x8532('0x67')][_0x8532('0xaa')][_0x30cd38]={'filename':_0x52adf2['body'][_0x8532('0xaa')][_0x30cd38][_0x8532('0x28')],'path':path[_0x8532('0xab')](config[_0x8532('0xac')],_0x8532('0xad'),_0x52adf2[_0x8532('0x67')][_0x8532('0xaa')][_0x30cd38][_0x8532('0xae')])};}}var _0x3c48c7=_0x4898c8[_0x8532('0xaf')]();return respondWithRpcPromise('SendMail',_0x8532('0xb0'),{'account':_0x3c48c7,'message':_0x52adf2[_0x8532('0x67')]});})[_0x8532('0x12')](function(_0x4ead2b){if(!_0x4ead2b)return;_0x3c8dde=_0x4ead2b;if(!_0x5340da[_0x8532('0xa2')])throw new Error(_0x8532('0xb1'));if(_0x5340da[_0x8532('0xa2')][_0x8532('0xa3')][_0x8532('0x54')])return _0x5340da[_0x8532('0xa2')]['Contacts'][0x0];return db[_0x8532('0x88')][_0x8532('0x6c')](_[_0x8532('0xa')](_0x52adf2[_0x8532('0x67')],{'firstName':_0x52adf2['body']['to'],'email':_0x52adf2[_0x8532('0x67')]['to'],'phone':_0x52adf2[_0x8532('0x67')]['to'],'ListId':_0x5340da[_0x8532('0xb2')]}));})['then'](function(_0x34801a){if(!_0x34801a)return;var _0x4fad60={'UserId':_0x52adf2[_0x8532('0x36')]['id'],'ContactId':_0x34801a['id'],'MailAccountId':_0x5340da['id'],'inReplyTo':_0x3c8dde['messageId'],'to':_0x52adf2[_0x8532('0x67')]['from'],'cc':_0x52adf2['body']['cc'],'subject':_0x52adf2[_0x8532('0x67')]['subject'],'attach':_0x52adf2['body'][_0x8532('0xb3')],'firstMsgDirection':_0x8532('0xb4'),'lastMsgAt':moment()['format'](_0x8532('0xa0')),'lastMsgDirection':_0x8532('0xb4'),'Messages':[_[_0x8532('0x5d')](_0x52adf2[_0x8532('0x67')],{'messageId':_0x3c8dde[_0x8532('0xb5')],'sentAt':moment()[_0x8532('0x9f')](_0x8532('0xa0')),'read':!![],'MailAccountId':_0x5340da['id'],'UserId':_0x52adf2[_0x8532('0x36')]['id'],'ContactId':_0x34801a['id']})]};if(_0x52adf2[_0x8532('0x67')][_0x8532('0xb6')]){_0x4fad60=_['merge'](_0x4fad60,_0x52adf2[_0x8532('0x67')]['Interaction']);}return db[_0x8532('0x87')]['create'](_0x4fad60,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x8532('0x12')](respondWithResult(_0x4c7c66,null))[_0x8532('0x66')](handleError(_0x4c7c66,null));};exports[_0x8532('0xb7')]=function(_0x255c6b,_0x4751ad){return db[_0x8532('0x48')]['find']({'where':{'id':_0x255c6b[_0x8532('0x64')]['id']},'include':[{'model':db[_0x8532('0x45')],'as':_0x8532('0x42'),'raw':!![],'include':[{'model':db[_0x8532('0xa6')],'as':_0x8532('0xa6'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4751ad,null))['then'](function(_0x41e71b){if(!_0x41e71b[_0x8532('0x42')])return;var _0x3e98d3=_0x41e71b[_0x8532('0xaf')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x3e98d3});})[_0x8532('0x12')](respondWithResult(_0x4751ad,null))[_0x8532('0x66')](handleError(_0x4751ad,null));};exports[_0x8532('0x26')]=function(_0x42332c,_0x105560){return db[_0x8532('0x48')][_0x8532('0x65')]({'where':{'id':_0x42332c[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x105560,null))[_0x8532('0x12')](function(_0x28d4b9){if(_0x28d4b9&&_0x28d4b9[_0x8532('0x3f')]){throw new db[(_0x8532('0xb8'))][(_0x8532('0xb9'))](_0x8532('0xba'));}return _0x28d4b9;})[_0x8532('0x12')](removeEntity(_0x105560,null))[_0x8532('0x66')](handleError(_0x105560,null));};exports[_0x8532('0xbb')]=function(_0x4af8d1,_0x17253b){return db['MailAccount'][_0x8532('0x65')]({'where':{'id':_0x4af8d1['params']['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x17253b,null))[_0x8532('0x12')](function(_0x433e5c){if(_0x433e5c){return _0x433e5c[_0x8532('0xbb')](_0x4af8d1['body'][_0x8532('0x71')],_[_0x8532('0x85')](_0x4af8d1[_0x8532('0x67')],['ids','id'])||{})[_0x8532('0xbc')](function(_0x25ea19){for(var _0x5e2919=0x0;_0x5e2919<_0x4af8d1[_0x8532('0x67')]['ids']['length'];_0x5e2919+=0x1){socket[_0x8532('0xbd')](_0x8532('0xbe'),{'UserId':Number(_0x4af8d1[_0x8532('0x67')]['ids'][_0x5e2919]),'MailAccountId':Number(_0x4af8d1[_0x8532('0x64')]['id'])});}return _0x25ea19;});}})['then'](respondWithResult(_0x17253b,null))[_0x8532('0x66')](handleError(_0x17253b,null));};exports[_0x8532('0xbf')]=function(_0x146430,_0xedcb80){return db[_0x8532('0x48')][_0x8532('0x65')]({'where':{'id':_0x146430[_0x8532('0x64')]['id']}})['then'](handleEntityNotFound(_0xedcb80,null))[_0x8532('0x12')](function(_0x3a9b81){if(_0x3a9b81){return _0x3a9b81['removeAgents'](_0x146430[_0x8532('0x4f')][_0x8532('0x71')])['then'](function(){if(_['isArray'](_0x146430['query']['ids'])){for(var _0x5d518d=0x0;_0x5d518d<_0x146430['query']['ids'][_0x8532('0x54')];_0x5d518d+=0x1){socket[_0x8532('0xbd')](_0x8532('0xc0'),{'UserId':Number(_0x146430['query'][_0x8532('0x71')][_0x5d518d]),'MailAccountId':Number(_0x146430['params']['id'])});}}else{socket['emit'](_0x8532('0xc0'),{'UserId':Number(_0x146430[_0x8532('0x4f')][_0x8532('0x71')]),'MailAccountId':Number(_0x146430[_0x8532('0x64')]['id'])});}});}})[_0x8532('0x12')](respondWithStatusCode(_0xedcb80,null))[_0x8532('0x66')](handleError(_0xedcb80,null));};exports[_0x8532('0xc1')]=function(_0x4710ed,_0x39b66c){var _0x50f851={};var _0x434303={};var _0x4a1f5a;var _0xa06e84;return db['MailAccount']['findOne']({'where':{'id':_0x4710ed[_0x8532('0x64')]['id']}})[_0x8532('0x12')](handleEntityNotFound(_0x39b66c,null))['then'](function(_0x1ce365){if(_0x1ce365){_0x4a1f5a=_0x1ce365;_0x434303[_0x8532('0x4c')]=_[_0x8532('0x4e')](db['User']['rawAttributes']);_0x434303[_0x8532('0x4f')]=_[_0x8532('0x4e')](_0x4710ed[_0x8532('0x4f')]);_0x434303[_0x8532('0x50')]=_[_0x8532('0x51')](_0x434303[_0x8532('0x4c')],_0x434303[_0x8532('0x4f')]);_0x50f851[_0x8532('0x52')]=_[_0x8532('0x51')](_0x434303[_0x8532('0x4c')],qs[_0x8532('0x53')](_0x4710ed[_0x8532('0x4f')][_0x8532('0x53')]));_0x50f851['attributes']=_0x50f851['attributes'][_0x8532('0x54')]?_0x50f851[_0x8532('0x52')]:_0x434303[_0x8532('0x4c')];_0x50f851[_0x8532('0x57')]=qs[_0x8532('0x58')](_0x4710ed[_0x8532('0x4f')][_0x8532('0x58')]);_0x50f851[_0x8532('0x59')]=qs['filters'](_[_0x8532('0x74')](_0x4710ed[_0x8532('0x4f')],_0x434303[_0x8532('0x50')]));if(_0x4710ed[_0x8532('0x4f')]['filter']){_0x50f851[_0x8532('0x59')]=_[_0x8532('0x5d')](_0x50f851['where'],{'$or':_[_0x8532('0x4d')](_0x50f851[_0x8532('0x52')],function(_0x3c9dbf){var _0x326d91={};_0x326d91[_0x3c9dbf]={'$like':'%'+_0x4710ed[_0x8532('0x4f')]['filter']+'%'};return _0x326d91;})});}_0x50f851=_[_0x8532('0x5d')]({},_0x50f851,_0x4710ed['options']);return _0x4a1f5a[_0x8532('0xc1')](_0x50f851);}})[_0x8532('0x12')](function(_0x47b4c4){if(_0x47b4c4){_0xa06e84=_0x47b4c4[_0x8532('0x54')];if(!_0x4710ed[_0x8532('0x4f')][_0x8532('0x55')]('nolimit')){_0x50f851['limit']=qs[_0x8532('0x22')](_0x4710ed[_0x8532('0x4f')][_0x8532('0x22')]);_0x50f851[_0x8532('0x20')]=qs[_0x8532('0x20')](_0x4710ed[_0x8532('0x4f')][_0x8532('0x20')]);}return _0x4a1f5a[_0x8532('0xc1')](_0x50f851);}})[_0x8532('0x12')](function(_0x32d0a6){if(_0x32d0a6){return _0x32d0a6?{'count':_0xa06e84,'rows':_0x32d0a6}:null;}})[_0x8532('0x12')](respondWithResult(_0x39b66c,null))[_0x8532('0x66')](handleError(_0x39b66c,null));};
\ No newline at end of file
+var _0xd4ba=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','setSmtp','addInteraction','MailInteraction','CmContact','Contact','Owner','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','ListId','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','end','undefined','count','offset','limit','json','update','then','get','UserProfileResource','destroy','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','port','secure','authentication','username','Imap','host','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','provider','custom','Mail\x20Account\x20not\x20found','service','describe','addDisposition','create','getDispositions','findOne','Disposition','nolimit','MailAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','email','active','description','UserProfileSection','MailAccounts','userProfileId'];(function(_0x38619e,_0x5cfc2f){var _0x476ebb=function(_0x2a801d){while(--_0x2a801d){_0x38619e['push'](_0x38619e['shift']());}};_0x476ebb(++_0x5cfc2f);}(_0xd4ba,0x1c8));var _0xad4b=function(_0x5374c8,_0x565f68){_0x5374c8=_0x5374c8-0x0;var _0x9c8d0c=_0xd4ba[_0x5374c8];return _0x9c8d0c;};'use strict';var moment=require(_0xad4b('0x0'));var BPromise=require(_0xad4b('0x1'));var util=require(_0xad4b('0x2'));var path=require(_0xad4b('0x3'));var _=require(_0xad4b('0x4'));var juice=require('juice');var Redis=require(_0xad4b('0x5'));var qs=require(_0xad4b('0x6'));var logger=require(_0xad4b('0x7'))(_0xad4b('0x8'));var config=require(_0xad4b('0x9'));var db=require(_0xad4b('0xa'))['db'];config['redis']=_[_0xad4b('0xb')](config[_0xad4b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xad4b('0xd'))[_0xad4b('0xe')](socket);var jayson=require(_0xad4b('0xf'));var client=jayson[_0xad4b('0x10')][_0xad4b('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x5213dd,_0x10fdb8,_0x5673e4,_0x33bf2c){return new BPromise(function(_0xf35407,_0x254dee){var _0x5920c7=_0x33bf2c||client;return _0x5920c7[_0xad4b('0x12')](_0x5213dd,_0x5673e4)['then'](function(_0x4a65b4){logger[_0xad4b('0x13')](_0xad4b('0x14'),_0x10fdb8,_0xad4b('0x15'));logger[_0xad4b('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x10fdb8,_0xad4b('0x15'),JSON[_0xad4b('0x17')](_0x4a65b4));if(_0x4a65b4[_0xad4b('0x18')]){if(_0x4a65b4['error'][_0xad4b('0x19')]===0x1f4){logger[_0xad4b('0x18')](_0xad4b('0x14'),_0x10fdb8,_0x4a65b4[_0xad4b('0x18')][_0xad4b('0x1a')]);return _0x254dee(_0x4a65b4[_0xad4b('0x18')]['message']);}logger[_0xad4b('0x18')](_0xad4b('0x14'),_0x10fdb8,_0x4a65b4[_0xad4b('0x18')][_0xad4b('0x1a')]);return _0xf35407(_0x4a65b4['error'][_0xad4b('0x1a')]);}else{logger[_0xad4b('0x13')]('MailAccount,\x20%s,\x20%s',_0x10fdb8,_0xad4b('0x15'));_0xf35407(_0x4a65b4['result'][_0xad4b('0x1a')]);}})['catch'](function(_0x591cf7){logger[_0xad4b('0x18')](_0xad4b('0x14'),_0x10fdb8,_0x591cf7);_0x254dee(_0x591cf7);});});}function respondWithStatusCode(_0x38ae1a,_0xc13e78){_0xc13e78=_0xc13e78||0xcc;return function(_0xf97d25){if(_0xf97d25){return _0x38ae1a[_0xad4b('0x1b')](_0xc13e78);}return _0x38ae1a[_0xad4b('0x1c')](_0xc13e78)[_0xad4b('0x1d')]();};}function respondWithResult(_0x263d69,_0x2b14b6){_0x2b14b6=_0x2b14b6||0xc8;return function(_0x641693){if(_0x641693){return _0x263d69['status'](_0x2b14b6)['json'](_0x641693);}};}function respondWithFilteredResult(_0x24e5c4,_0x142e41){return function(_0x91b772){if(_0x91b772){var _0x48705e=typeof _0x142e41['offset']===_0xad4b('0x1e')&&typeof _0x142e41['limit']==='undefined';var _0x6f4042=_0x91b772[_0xad4b('0x1f')];var _0xa313b7=_0x48705e?0x0:_0x142e41[_0xad4b('0x20')];var _0x19b22d=_0x48705e?_0x91b772[_0xad4b('0x1f')]:_0x142e41[_0xad4b('0x20')]+_0x142e41[_0xad4b('0x21')];var _0x9621ab;if(_0x19b22d>=_0x6f4042){_0x19b22d=_0x6f4042;_0x9621ab=0xc8;}else{_0x9621ab=0xce;}_0x24e5c4[_0xad4b('0x1c')](_0x9621ab);return _0x24e5c4['set']('Content-Range',_0xa313b7+'-'+_0x19b22d+'/'+_0x6f4042)[_0xad4b('0x22')](_0x91b772);}return null;};}function saveUpdates(_0x5dbb89){return function(_0x5011bb){if(_0x5011bb){return _0x5011bb[_0xad4b('0x23')](_0x5dbb89)[_0xad4b('0x24')](function(_0x434872){return _0x434872;});}return null;};}function removeEntity(_0x3ca209){return function(_0x106777){if(_0x106777){return _0x106777['destroy']()[_0xad4b('0x24')](function(){var _0x37149d=_0x106777[_0xad4b('0x25')]({'plain':!![]});var _0x44888d='MailAccounts';return db[_0xad4b('0x26')][_0xad4b('0x27')]({'where':{'type':_0x44888d,'resourceId':_0x37149d['id']}})[_0xad4b('0x24')](function(){return _0x106777;});})[_0xad4b('0x24')](function(){_0x3ca209['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x199c40){return function(_0x5105fb){if(!_0x5105fb){_0x199c40[_0xad4b('0x1b')](0x194);}return _0x5105fb;};}function handleError(_0x375702,_0x2693bf){_0x2693bf=_0x2693bf||0x1f4;return function(_0x3860c9){logger[_0xad4b('0x18')](_0x3860c9[_0xad4b('0x28')]);if(_0x3860c9[_0xad4b('0x29')]){delete _0x3860c9[_0xad4b('0x29')];}_0x375702[_0xad4b('0x1c')](_0x2693bf)[_0xad4b('0x2a')](_0x3860c9);};}function getImapHost(_0x67e1f){switch(_0x67e1f){case _0xad4b('0x2b'):return'imap.gmail.com';case _0xad4b('0x2c'):return _0xad4b('0x2d');case _0xad4b('0x2e'):return'imap-mail.outlook.com';case _0xad4b('0x2f'):return _0xad4b('0x30');}throw new Error(_0xad4b('0x31'),_0x67e1f);}function getSmtpHost(_0x6153cd){switch(_0x6153cd){case _0xad4b('0x2b'):return _0xad4b('0x32');case _0xad4b('0x2c'):return'smtp.mail.yahoo.com';case _0xad4b('0x2e'):return _0xad4b('0x33');case'outlook365':return _0xad4b('0x34');}throw new Error(_0xad4b('0x31'),_0x6153cd);}function getAuthenticationOptions(_0x2c2f64,_0x2d63a8){var _0x5f48d6={};var _0x1df451={};if(_0x2c2f64){_0x5f48d6[_0xad4b('0x35')]=_0x1df451[_0xad4b('0x35')]=_0x2d63a8['username'];_0x5f48d6[_0xad4b('0x36')]=_0x1df451[_0xad4b('0x37')]=_0x2d63a8[_0xad4b('0x36')];if(_0x2d63a8[_0xad4b('0x38')]){_0x5f48d6['modernAuthentication']=_0x1df451[_0xad4b('0x38')]=!![];_0x5f48d6[_0xad4b('0x39')]=_0x1df451[_0xad4b('0x39')]=_0x2d63a8[_0xad4b('0x39')];_0x5f48d6[_0xad4b('0x36')]=_0x1df451[_0xad4b('0x37')]=null;}else{_0x5f48d6[_0xad4b('0x39')]=_0x1df451[_0xad4b('0x39')]=null;}_0x5f48d6['host']=getImapHost(_0x2c2f64);_0x5f48d6[_0xad4b('0x3a')]=0x3e1;_0x1df451['host']=getSmtpHost(_0x2c2f64);_0x1df451[_0xad4b('0x3a')]=0x24b;_0x1df451[_0xad4b('0x3b')]=![];_0x5f48d6['service']=_0x1df451['service']=null;}else{if(_0x2d63a8[_0xad4b('0x3c')]){_0x5f48d6[_0xad4b('0x35')]=_0x1df451['user']=_0x2d63a8[_0xad4b('0x3d')];_0x5f48d6[_0xad4b('0x36')]=_0x1df451[_0xad4b('0x37')]=_0x2d63a8[_0xad4b('0x36')];}else{_0x5f48d6[_0xad4b('0x3c')]=_0x1df451[_0xad4b('0x3c')]=![];_0x5f48d6[_0xad4b('0x35')]=_0x1df451[_0xad4b('0x35')]=null;_0x5f48d6['password']=_0x1df451['pass']=null;}_0x5f48d6['host']=_0x2d63a8[_0xad4b('0x3e')][_0xad4b('0x3f')];_0x5f48d6[_0xad4b('0x3a')]=_0x2d63a8['Imap']['port'];_0x1df451[_0xad4b('0x3f')]=_0x2d63a8['Smtp'][_0xad4b('0x3f')];_0x1df451['port']=_0x2d63a8['Smtp'][_0xad4b('0x3a')];}return{'Imap':_0x5f48d6,'Smtp':_0x1df451};}exports['index']=function(_0x5c4fcd,_0x50d8f1){var _0x49bea1={'include':[{'model':db[_0xad4b('0x40')],'as':_0xad4b('0x3e')},{'model':db[_0xad4b('0x41')],'as':_0xad4b('0x42')},{'model':db[_0xad4b('0x43')],'as':_0xad4b('0x44')}]},_0xafa7bf={},_0xe6abd4={'count':0x0,'rows':[]};var _0x14dc0e=_['map'](db[_0xad4b('0x45')][_0xad4b('0x46')],function(_0x13c543){return{'name':_0x13c543[_0xad4b('0x47')],'type':_0x13c543[_0xad4b('0x48')][_0xad4b('0x49')]};});_0xafa7bf[_0xad4b('0x4a')]=_[_0xad4b('0x4b')](_0x14dc0e,'name');_0xafa7bf[_0xad4b('0x4c')]=_['keys'](_0x5c4fcd[_0xad4b('0x4c')]);_0xafa7bf['filters']=_[_0xad4b('0x4d')](_0xafa7bf[_0xad4b('0x4a')],_0xafa7bf[_0xad4b('0x4c')]);_0x49bea1['attributes']=_[_0xad4b('0x4d')](_0xafa7bf[_0xad4b('0x4a')],qs[_0xad4b('0x4e')](_0x5c4fcd[_0xad4b('0x4c')][_0xad4b('0x4e')]));_0x49bea1[_0xad4b('0x4f')]=_0x49bea1['attributes'][_0xad4b('0x50')]?_0x49bea1['attributes']:_0xafa7bf['model'];if(!_0x5c4fcd[_0xad4b('0x4c')][_0xad4b('0x51')]('nolimit')){_0x49bea1[_0xad4b('0x21')]=qs[_0xad4b('0x21')](_0x5c4fcd[_0xad4b('0x4c')][_0xad4b('0x21')]);_0x49bea1[_0xad4b('0x20')]=qs[_0xad4b('0x20')](_0x5c4fcd[_0xad4b('0x4c')][_0xad4b('0x20')]);}_0x49bea1[_0xad4b('0x52')]=qs[_0xad4b('0x53')](_0x5c4fcd[_0xad4b('0x4c')][_0xad4b('0x53')]);_0x49bea1['where']=qs[_0xad4b('0x54')](_[_0xad4b('0x55')](_0x5c4fcd['query'],_0xafa7bf[_0xad4b('0x54')]),_0x14dc0e);if(_0x5c4fcd['query']['filter']){_0x49bea1['where']=_['merge'](_0x49bea1[_0xad4b('0x56')],{'$or':_['map'](_0x14dc0e,function(_0x1f77ac){if(_0x1f77ac[_0xad4b('0x48')]!=='VIRTUAL'){var _0x544863={};_0x544863[_0x1f77ac[_0xad4b('0x29')]]={'$like':'%'+_0x5c4fcd[_0xad4b('0x4c')][_0xad4b('0x57')]+'%'};return _0x544863;}})});}_0x49bea1=_[_0xad4b('0x58')]({},_0x49bea1,_0x5c4fcd[_0xad4b('0x59')]);var _0x39bfca={'where':_0x49bea1[_0xad4b('0x56')]};return db[_0xad4b('0x45')][_0xad4b('0x1f')](_0x39bfca)['then'](function(_0x412d82){_0xe6abd4['count']=_0x412d82;if(_0x5c4fcd[_0xad4b('0x4c')][_0xad4b('0x5a')]){_0x49bea1[_0xad4b('0x5b')]=[{'all':!![]}];}return db[_0xad4b('0x45')][_0xad4b('0x5c')](_0x49bea1);})['then'](function(_0x51897a){_0xe6abd4[_0xad4b('0x5d')]=_0x51897a;return _0xe6abd4;})[_0xad4b('0x24')](respondWithFilteredResult(_0x50d8f1,_0x49bea1))[_0xad4b('0x5e')](handleError(_0x50d8f1,null));};exports[_0xad4b('0x5f')]=function(_0x269fcd,_0x9e10ba){var _0x10de69={'raw':![],'where':{'id':_0x269fcd[_0xad4b('0x60')]['id']},'include':[{'model':db[_0xad4b('0x40')],'as':_0xad4b('0x3e')},{'model':db[_0xad4b('0x41')],'as':_0xad4b('0x42')},{'model':db[_0xad4b('0x43')],'as':_0xad4b('0x44')}]},_0x466b13={};_0x466b13[_0xad4b('0x4a')]=_['keys'](db['MailAccount'][_0xad4b('0x46')]);_0x466b13[_0xad4b('0x4c')]=_[_0xad4b('0x61')](_0x269fcd[_0xad4b('0x4c')]);_0x466b13[_0xad4b('0x54')]=_['intersection'](_0x466b13[_0xad4b('0x4a')],_0x466b13[_0xad4b('0x4c')]);_0x10de69[_0xad4b('0x4f')]=_[_0xad4b('0x4d')](_0x466b13[_0xad4b('0x4a')],qs[_0xad4b('0x4e')](_0x269fcd[_0xad4b('0x4c')][_0xad4b('0x4e')]));_0x10de69[_0xad4b('0x4f')]=_0x10de69[_0xad4b('0x4f')][_0xad4b('0x50')]?_0x10de69['attributes']:_0x466b13['model'];if(_0x269fcd[_0xad4b('0x4c')]['includeAll']){_0x10de69[_0xad4b('0x5b')]=[{'all':!![]}];}_0x10de69=_[_0xad4b('0x58')]({},_0x10de69,_0x269fcd['options']);return db['MailAccount'][_0xad4b('0x62')](_0x10de69)[_0xad4b('0x24')](handleEntityNotFound(_0x9e10ba,null))['then'](respondWithResult(_0x9e10ba,null))[_0xad4b('0x5e')](handleError(_0x9e10ba,null));};exports['update']=function(_0x42ed2d,_0x545137){if(_0x42ed2d[_0xad4b('0x63')]['id']){delete _0x42ed2d[_0xad4b('0x63')]['id'];}var _0x41f11b=_0x42ed2d['body'][_0xad4b('0x64')]===_0xad4b('0x65')?null:_0x42ed2d['body'][_0xad4b('0x64')];var _0x227302=_0x42ed2d[_0xad4b('0x63')][_0xad4b('0x3e')]||{};var _0x39f530=_0x42ed2d[_0xad4b('0x63')][_0xad4b('0x42')]||{};if(_0x41f11b){_0x227302[_0xad4b('0x3f')]=getImapHost(_0x41f11b);_0x227302[_0xad4b('0x3a')]=0x3e1;_0x39f530[_0xad4b('0x3f')]=getSmtpHost(_0x41f11b);_0x39f530['port']=0x24b;_0x39f530['secure']=![];}if(_0x39f530[_0xad4b('0x38')]){_0x39f530['secure']=![];}else{_0x39f530[_0xad4b('0x39')]=null;}if(!_0x227302[_0xad4b('0x38')])_0x227302[_0xad4b('0x39')]=null;_0x42ed2d[_0xad4b('0x63')][_0xad4b('0x3e')]=_0x227302;_0x42ed2d[_0xad4b('0x63')]['Smtp']=_0x39f530;return db[_0xad4b('0x45')]['find']({'where':{'id':_0x42ed2d['params']['id']},'include':[{'model':db[_0xad4b('0x40')],'as':_0xad4b('0x3e')},{'model':db[_0xad4b('0x41')],'as':_0xad4b('0x42')},{'model':db[_0xad4b('0x43')],'as':_0xad4b('0x44')}]})[_0xad4b('0x24')](handleEntityNotFound(_0x545137,null))[_0xad4b('0x24')](function(_0x589903){if(!_0x589903)throw new Error(_0xad4b('0x66'));if(_0x589903[_0xad4b('0x67')])delete _0x42ed2d[_0xad4b('0x63')][_0xad4b('0x3e')];return _0x589903;})['then'](saveUpdates(_0x42ed2d[_0xad4b('0x63')],null))[_0xad4b('0x24')](function(_0x45eea8){if(!_0x42ed2d[_0xad4b('0x63')][_0xad4b('0x3e')])return _0x45eea8;return db[_0xad4b('0x40')][_0xad4b('0x23')](_0x42ed2d['body'][_0xad4b('0x3e')],{'where':{'MailAccountId':_0x45eea8['id']}})[_0xad4b('0x24')](function(){return _0x45eea8;});})['then'](function(_0x2341c6){if(!_0x42ed2d['body'][_0xad4b('0x42')])return _0x2341c6;return db[_0xad4b('0x41')][_0xad4b('0x23')](_0x42ed2d[_0xad4b('0x63')][_0xad4b('0x42')],{'where':{'MailAccountId':_0x2341c6['id']}})[_0xad4b('0x24')](function(){return _0x2341c6;});})[_0xad4b('0x24')](respondWithResult(_0x545137,null))['catch'](handleError(_0x545137,null));};exports[_0xad4b('0x68')]=function(_0x170d0b,_0x515cb3){return db['MailAccount'][_0xad4b('0x68')]()['then'](respondWithResult(_0x515cb3,null))[_0xad4b('0x5e')](handleError(_0x515cb3,null));};exports[_0xad4b('0x69')]=function(_0x2c1021,_0x4f7755){if(_0x2c1021[_0xad4b('0x63')]['id']){delete _0x2c1021[_0xad4b('0x63')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2c1021['params']['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x4f7755,null))[_0xad4b('0x24')](function(_0x566105){if(_0x566105){_0x2c1021[_0xad4b('0x63')]['MailAccountId']=_0x566105['id'];return db['Disposition'][_0xad4b('0x6a')](_0x2c1021['body']);}})[_0xad4b('0x24')](respondWithResult(_0x4f7755,null))[_0xad4b('0x5e')](handleError(_0x4f7755,null));};exports[_0xad4b('0x6b')]=function(_0x51865e,_0x36fb4e){var _0x1ee196={'raw':![],'where':{}};var _0x5bfbd5={};var _0x219ff2={'count':0x0,'rows':[]};return db[_0xad4b('0x45')][_0xad4b('0x6c')]({'where':{'id':_0x51865e[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x36fb4e,null))[_0xad4b('0x24')](function(_0x46f1f6){if(_0x46f1f6){_0x5bfbd5[_0xad4b('0x4a')]=_['keys'](db[_0xad4b('0x6d')]['rawAttributes']);_0x5bfbd5[_0xad4b('0x4c')]=_[_0xad4b('0x61')](_0x51865e[_0xad4b('0x4c')]);_0x5bfbd5[_0xad4b('0x54')]=_[_0xad4b('0x4d')](_0x5bfbd5[_0xad4b('0x4a')],_0x5bfbd5[_0xad4b('0x4c')]);_0x1ee196[_0xad4b('0x4f')]=_[_0xad4b('0x4d')](_0x5bfbd5[_0xad4b('0x4a')],qs[_0xad4b('0x4e')](_0x51865e[_0xad4b('0x4c')][_0xad4b('0x4e')]));_0x1ee196[_0xad4b('0x4f')]=_0x1ee196[_0xad4b('0x4f')][_0xad4b('0x50')]?_0x1ee196[_0xad4b('0x4f')]:_0x5bfbd5[_0xad4b('0x4a')];if(!_0x51865e[_0xad4b('0x4c')]['hasOwnProperty'](_0xad4b('0x6e'))){_0x1ee196[_0xad4b('0x21')]=qs[_0xad4b('0x21')](_0x51865e['query'][_0xad4b('0x21')]);_0x1ee196[_0xad4b('0x20')]=qs['offset'](_0x51865e['query'][_0xad4b('0x20')]);}_0x1ee196[_0xad4b('0x52')]=qs[_0xad4b('0x53')](_0x51865e[_0xad4b('0x4c')][_0xad4b('0x53')]);_0x1ee196['where']=qs[_0xad4b('0x54')](_[_0xad4b('0x55')](_0x51865e['query'],_0x5bfbd5[_0xad4b('0x54')]));_0x1ee196[_0xad4b('0x56')][_0xad4b('0x6f')]=_0x46f1f6['id'];if(_0x51865e[_0xad4b('0x4c')][_0xad4b('0x57')]){_0x1ee196[_0xad4b('0x56')]=_[_0xad4b('0x58')](_0x1ee196['where'],{'$or':_[_0xad4b('0x4b')](_0x1ee196[_0xad4b('0x4f')],function(_0x50129a){var _0x79525={};_0x79525[_0x50129a]={'$like':'%'+_0x51865e[_0xad4b('0x4c')]['filter']+'%'};return _0x79525;})});}_0x1ee196=_['merge']({},_0x1ee196,_0x51865e[_0xad4b('0x59')]);return db[_0xad4b('0x6d')]['count']({'where':_0x1ee196[_0xad4b('0x56')]})[_0xad4b('0x24')](function(_0x4144a1){_0x219ff2[_0xad4b('0x1f')]=_0x4144a1;if(_0x51865e[_0xad4b('0x4c')][_0xad4b('0x5a')]){_0x1ee196[_0xad4b('0x5b')]=[{'all':!![]}];}return db[_0xad4b('0x6d')]['findAll'](_0x1ee196);})['then'](function(_0x1dfea2){_0x219ff2[_0xad4b('0x5d')]=_0x1dfea2;return _0x219ff2;});}})[_0xad4b('0x24')](respondWithFilteredResult(_0x36fb4e,_0x1ee196))[_0xad4b('0x5e')](handleError(_0x36fb4e,null));};exports[_0xad4b('0x70')]=function(_0x44e6c7,_0xb8c1e0){return db['MailAccount'][_0xad4b('0x62')]({'where':{'id':_0x44e6c7[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0xb8c1e0,null))[_0xad4b('0x24')](function(_0x3e9b6f){if(_0x3e9b6f){return _0x3e9b6f[_0xad4b('0x70')](_0x44e6c7[_0xad4b('0x4c')][_0xad4b('0x71')]);}})[_0xad4b('0x24')](respondWithStatusCode(_0xb8c1e0,null))['catch'](handleError(_0xb8c1e0,null));};exports['addAnswer']=function(_0x398b99,_0xe19730){if(_0x398b99[_0xad4b('0x63')]['id']){delete _0x398b99[_0xad4b('0x63')]['id'];}return db[_0xad4b('0x45')][_0xad4b('0x62')]({'where':{'id':_0x398b99[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0xe19730,null))[_0xad4b('0x24')](function(_0x42ba92){if(_0x42ba92){_0x398b99[_0xad4b('0x63')][_0xad4b('0x6f')]=_0x42ba92['id'];return db[_0xad4b('0x72')][_0xad4b('0x6a')](_0x398b99[_0xad4b('0x63')]);}})['then'](respondWithResult(_0xe19730,null))[_0xad4b('0x5e')](handleError(_0xe19730,null));};exports[_0xad4b('0x73')]=function(_0x18904a,_0x57c555){var _0x14877f={'raw':![],'where':{}};var _0x5df464={};var _0x23fd91={'count':0x0,'rows':[]};return db['MailAccount'][_0xad4b('0x6c')]({'where':{'id':_0x18904a[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x57c555,null))['then'](function(_0x309dc7){if(_0x309dc7){_0x5df464['model']=_[_0xad4b('0x61')](db[_0xad4b('0x72')][_0xad4b('0x46')]);_0x5df464['query']=_[_0xad4b('0x61')](_0x18904a[_0xad4b('0x4c')]);_0x5df464[_0xad4b('0x54')]=_[_0xad4b('0x4d')](_0x5df464[_0xad4b('0x4a')],_0x5df464[_0xad4b('0x4c')]);_0x14877f['attributes']=_[_0xad4b('0x4d')](_0x5df464[_0xad4b('0x4a')],qs[_0xad4b('0x4e')](_0x18904a[_0xad4b('0x4c')][_0xad4b('0x4e')]));_0x14877f[_0xad4b('0x4f')]=_0x14877f['attributes'][_0xad4b('0x50')]?_0x14877f['attributes']:_0x5df464[_0xad4b('0x4a')];if(!_0x18904a[_0xad4b('0x4c')][_0xad4b('0x51')](_0xad4b('0x6e'))){_0x14877f[_0xad4b('0x21')]=qs[_0xad4b('0x21')](_0x18904a['query']['limit']);_0x14877f[_0xad4b('0x20')]=qs[_0xad4b('0x20')](_0x18904a[_0xad4b('0x4c')]['offset']);}_0x14877f[_0xad4b('0x52')]=qs[_0xad4b('0x53')](_0x18904a[_0xad4b('0x4c')][_0xad4b('0x53')]);_0x14877f['where']=qs[_0xad4b('0x54')](_[_0xad4b('0x55')](_0x18904a[_0xad4b('0x4c')],_0x5df464['filters']));_0x14877f[_0xad4b('0x56')]['MailAccountId']=_0x309dc7['id'];if(_0x18904a[_0xad4b('0x4c')][_0xad4b('0x57')]){_0x14877f[_0xad4b('0x56')]=_['merge'](_0x14877f[_0xad4b('0x56')],{'$or':_['map'](_0x14877f['attributes'],function(_0x39ac6f){var _0x94d20d={};_0x94d20d[_0x39ac6f]={'$like':'%'+_0x18904a[_0xad4b('0x4c')][_0xad4b('0x57')]+'%'};return _0x94d20d;})});}_0x14877f=_[_0xad4b('0x58')]({},_0x14877f,_0x18904a['options']);return db[_0xad4b('0x72')][_0xad4b('0x1f')]({'where':_0x14877f['where']})[_0xad4b('0x24')](function(_0x5ab151){_0x23fd91['count']=_0x5ab151;if(_0x18904a[_0xad4b('0x4c')]['includeAll']){_0x14877f[_0xad4b('0x5b')]=[{'all':!![]}];}return db[_0xad4b('0x72')][_0xad4b('0x5c')](_0x14877f);})['then'](function(_0x5e78ee){_0x23fd91['rows']=_0x5e78ee;return _0x23fd91;});}})['then'](respondWithFilteredResult(_0x57c555,_0x14877f))[_0xad4b('0x5e')](handleError(_0x57c555,null));};exports['removeAnswers']=function(_0x198fc7,_0x439b53){return db[_0xad4b('0x45')][_0xad4b('0x62')]({'where':{'id':_0x198fc7[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x439b53,null))['then'](function(_0x2d2c38){if(_0x2d2c38){return _0x2d2c38[_0xad4b('0x74')](_0x198fc7[_0xad4b('0x4c')]['ids']);}})[_0xad4b('0x24')](respondWithStatusCode(_0x439b53,null))[_0xad4b('0x5e')](handleError(_0x439b53,null));};exports[_0xad4b('0x6a')]=function(_0x437d50,_0x20a374){var _0x4aae71={'name':_0x437d50['body'][_0xad4b('0x29')],'key':_0x437d50[_0xad4b('0x63')][_0xad4b('0x49')],'provider':_0x437d50['body']['provider']==='custom'?null:_0x437d50[_0xad4b('0x63')]['provider'],'email':_0x437d50['body'][_0xad4b('0x75')],'ListId':_0x437d50[_0xad4b('0x63')]['ListId'],'active':!_['isNil'](_0x437d50[_0xad4b('0x63')]['active'])?_0x437d50[_0xad4b('0x63')][_0xad4b('0x76')]:!![],'description':_0x437d50['body'][_0xad4b('0x77')]||null};var _0x505152=getAuthenticationOptions(_0x4aae71[_0xad4b('0x64')],_0x437d50[_0xad4b('0x63')]);_0x4aae71['Imap']=_0x505152[_0xad4b('0x3e')];_0x4aae71[_0xad4b('0x42')]=_0x505152[_0xad4b('0x42')];return db[_0xad4b('0x45')][_0xad4b('0x6a')](_0x4aae71,{'include':[{'model':db[_0xad4b('0x41')],'as':_0xad4b('0x42')},{'model':db[_0xad4b('0x40')],'as':'Imap'}]})[_0xad4b('0x24')](function(_0x2491a3){var _0x31a917=_0x437d50[_0xad4b('0x35')]['get']({'plain':!![]});if(!_0x31a917)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31a917['role']===_0xad4b('0x35')){var _0x2ec134=_0x2491a3['get']({'plain':!![]});return db[_0xad4b('0x78')][_0xad4b('0x62')]({'where':{'name':_0xad4b('0x79'),'userProfileId':_0x31a917[_0xad4b('0x7a')]},'raw':!![]})['then'](function(_0x79485e){if(_0x79485e&&_0x79485e[_0xad4b('0x7b')]===0x0){return db[_0xad4b('0x26')][_0xad4b('0x6a')]({'name':_0x2ec134[_0xad4b('0x29')],'resourceId':_0x2ec134['id'],'type':_0x79485e[_0xad4b('0x29')],'sectionId':_0x79485e['id']},{})['then'](function(){return _0x2491a3;});}else{return _0x2491a3;}})[_0xad4b('0x5e')](function(_0x388df7){logger[_0xad4b('0x18')](_0xad4b('0x7c'),_0x388df7);throw _0x388df7;});}return _0x2491a3;})['then'](respondWithResult(_0x20a374,0xc9))[_0xad4b('0x5e')](handleError(_0x20a374,null));};exports[_0xad4b('0x7d')]=function(_0x56d0bd,_0x27edef){return db[_0xad4b('0x45')][_0xad4b('0x6c')]({'where':{'id':_0x56d0bd[_0xad4b('0x60')]['id']}})['then'](handleEntityNotFound(_0x27edef,null))[_0xad4b('0x24')](function(_0x304363){if(_0x304363){return _0x304363[_0xad4b('0x7d')]();}return null;})[_0xad4b('0x24')](respondWithResult(_0x27edef,null))[_0xad4b('0x5e')](handleError(_0x27edef,null));};exports[_0xad4b('0x7e')]=function(_0x5e586c,_0x430cd2){if(_0x5e586c[_0xad4b('0x63')]['id']){delete _0x5e586c['body']['id'];}return db[_0xad4b('0x45')][_0xad4b('0x62')]({'where':{'id':_0x5e586c[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x430cd2,null))[_0xad4b('0x24')](function(_0x327d1e){if(_0x327d1e){_0x5e586c[_0xad4b('0x63')][_0xad4b('0x6f')]=_0x327d1e['id'];return db[_0xad4b('0x40')]['create'](_0x5e586c[_0xad4b('0x63')]);}})[_0xad4b('0x24')](respondWithResult(_0x430cd2,null))[_0xad4b('0x5e')](handleError(_0x430cd2,null));};exports[_0xad4b('0x7f')]=function(_0x20ec34,_0x16ef66){return db[_0xad4b('0x45')][_0xad4b('0x6c')]({'where':{'id':_0x20ec34[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x16ef66,null))[_0xad4b('0x24')](function(_0x1d4bf1){if(_0x1d4bf1){return _0x1d4bf1[_0xad4b('0x80')](null);}return null;})[_0xad4b('0x24')](respondWithStatusCode(_0x16ef66,null))[_0xad4b('0x5e')](handleError(_0x16ef66,null));};exports[_0xad4b('0x81')]=function(_0x3d5bc9,_0x43668b){return db[_0xad4b('0x45')][_0xad4b('0x6c')]({'where':{'id':_0x3d5bc9[_0xad4b('0x60')]['id']}})['then'](handleEntityNotFound(_0x43668b,null))[_0xad4b('0x24')](function(_0x4b296d){if(_0x4b296d){return _0x4b296d[_0xad4b('0x81')]();}return null;})[_0xad4b('0x24')](respondWithResult(_0x43668b,null))[_0xad4b('0x5e')](handleError(_0x43668b,null));};exports['addSmtp']=function(_0x337312,_0x293467){if(_0x337312[_0xad4b('0x63')]['id']){delete _0x337312['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x337312[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x293467,null))[_0xad4b('0x24')](function(_0x343a19){if(_0x343a19){_0x337312['body'][_0xad4b('0x6f')]=_0x343a19['id'];return db[_0xad4b('0x41')][_0xad4b('0x6a')](_0x337312[_0xad4b('0x63')]);}})[_0xad4b('0x24')](respondWithResult(_0x293467,null))[_0xad4b('0x5e')](handleError(_0x293467,null));};exports['removeSmtp']=function(_0x47c953,_0x4165d2){return db[_0xad4b('0x45')][_0xad4b('0x6c')]({'where':{'id':_0x47c953[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x4165d2,null))[_0xad4b('0x24')](function(_0x3f88f8){if(_0x3f88f8){return _0x3f88f8[_0xad4b('0x82')](null);}return null;})[_0xad4b('0x24')](respondWithStatusCode(_0x4165d2,null))[_0xad4b('0x5e')](handleError(_0x4165d2,null));};exports[_0xad4b('0x83')]=function(_0x17b649,_0x2341f6){return db[_0xad4b('0x84')][_0xad4b('0x62')]({'where':{'id':_0x17b649[_0xad4b('0x60')]['id']}})['then'](handleEntityNotFound(_0x2341f6,null))[_0xad4b('0x24')](function(_0x1b796e){if(_0x1b796e){return _0x1b796e[_0xad4b('0x83')](_0x17b649[_0xad4b('0x63')][_0xad4b('0x71')],_['omit'](_0x17b649[_0xad4b('0x63')],[_0xad4b('0x71'),'id'])||{});}})[_0xad4b('0x24')](respondWithResult(_0x2341f6,null))[_0xad4b('0x5e')](handleError(_0x2341f6,null));};exports['getInteractions']=function(_0x4621c2,_0x30ed9b){var _0xe99f5f={'raw':![],'where':{}};var _0x14a01a={};var _0x126d78={'count':0x0,'rows':[]};return db['MailAccount'][_0xad4b('0x6c')]({'where':{'id':_0x4621c2[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x30ed9b,null))[_0xad4b('0x24')](function(_0x37907b){if(_0x37907b){_0x14a01a[_0xad4b('0x4a')]=_[_0xad4b('0x61')](db[_0xad4b('0x84')][_0xad4b('0x46')]);_0x14a01a[_0xad4b('0x4c')]=_[_0xad4b('0x61')](_0x4621c2[_0xad4b('0x4c')]);_0x14a01a[_0xad4b('0x54')]=_[_0xad4b('0x4d')](_0x14a01a[_0xad4b('0x4a')],_0x14a01a[_0xad4b('0x4c')]);_0xe99f5f[_0xad4b('0x4f')]=_[_0xad4b('0x4d')](_0x14a01a[_0xad4b('0x4a')],qs[_0xad4b('0x4e')](_0x4621c2['query'][_0xad4b('0x4e')]));_0xe99f5f[_0xad4b('0x4f')]=_0xe99f5f['attributes']['length']?_0xe99f5f['attributes']:_0x14a01a[_0xad4b('0x4a')];if(!_0x4621c2[_0xad4b('0x4c')][_0xad4b('0x51')]('nolimit')){_0xe99f5f[_0xad4b('0x21')]=qs[_0xad4b('0x21')](_0x4621c2[_0xad4b('0x4c')][_0xad4b('0x21')]);_0xe99f5f['offset']=qs[_0xad4b('0x20')](_0x4621c2[_0xad4b('0x4c')][_0xad4b('0x20')]);}_0xe99f5f[_0xad4b('0x52')]=qs['sort'](_0x4621c2[_0xad4b('0x4c')][_0xad4b('0x53')]);_0xe99f5f[_0xad4b('0x56')]=qs[_0xad4b('0x54')](_['pick'](_0x4621c2[_0xad4b('0x4c')],_0x14a01a['filters']));_0xe99f5f[_0xad4b('0x56')][_0xad4b('0x6f')]=_0x37907b['id'];if(_0x4621c2[_0xad4b('0x4c')][_0xad4b('0x57')]){_0xe99f5f[_0xad4b('0x56')]=_[_0xad4b('0x58')](_0xe99f5f[_0xad4b('0x56')],{'$or':_[_0xad4b('0x4b')](_0xe99f5f['attributes'],function(_0xcbc859){var _0x55551c={};_0x55551c[_0xcbc859]={'$like':'%'+_0x4621c2[_0xad4b('0x4c')][_0xad4b('0x57')]+'%'};return _0x55551c;})});}_0xe99f5f=_[_0xad4b('0x58')]({},_0xe99f5f,_0x4621c2['options']);return db[_0xad4b('0x84')][_0xad4b('0x1f')]({'where':_0xe99f5f['where']})['then'](function(_0xc384f8){_0x126d78[_0xad4b('0x1f')]=_0xc384f8;if(_0x4621c2[_0xad4b('0x4c')]['includeAll']){_0xe99f5f['include']=[{'model':db[_0xad4b('0x85')],'as':_0xad4b('0x86'),'required':![]},{'model':db['User'],'as':_0xad4b('0x87'),'attributes':[_0xad4b('0x29'),'fullname','internal'],'required':![]},{'model':db[_0xad4b('0x88')],'as':_0xad4b('0x89'),'attributes':['id',_0xad4b('0x29'),_0xad4b('0x8a')],'where':_0x4621c2[_0xad4b('0x4c')][_0xad4b('0x8b')]?{'id':_0x4621c2[_0xad4b('0x4c')][_0xad4b('0x8b')]}:undefined,'required':_0x4621c2['query'][_0xad4b('0x8b')]?!![]:![]}];}return db[_0xad4b('0x84')]['findAll'](_0xe99f5f);})['then'](function(_0x49c1ba){_0x126d78[_0xad4b('0x5d')]=_0x49c1ba;return _0x126d78;});}})[_0xad4b('0x24')](respondWithFilteredResult(_0x30ed9b,_0xe99f5f))[_0xad4b('0x5e')](handleError(_0x30ed9b,null));};exports[_0xad4b('0x8c')]=function addApplications(_0x1ff6bb,_0x498b55){var _0x136f4c=_0x1ff6bb[_0xad4b('0x60')]['id'];var _0x5e7af6=_0x1ff6bb[_0xad4b('0x63')];var _0x3525c5=0xc8;var _0x52e5fd=null;return db[_0xad4b('0x8d')]['transaction']({'isolationLevel':db['sequelize'][_0xad4b('0x8e')][_0xad4b('0x8f')][_0xad4b('0x90')]},function(_0x49780d){return db[_0xad4b('0x45')][_0xad4b('0x6c')]({'where':{'id':_0x136f4c},'transaction':_0x49780d})[_0xad4b('0x24')](function(_0x45f6d0){if(_0x45f6d0){return db['MailApplication'][_0xad4b('0x27')]({'where':{'MailAccountId':_0x136f4c},'transaction':_0x49780d})['then'](function(){var _0x3fbc97=_[_0xad4b('0x4b')](_0x5e7af6,function(_0x595cf6){_0x595cf6['MailAccountId']=_0x136f4c;return _0x595cf6;});return db[_0xad4b('0x91')][_0xad4b('0x92')](_0x3fbc97,{'transaction':_0x49780d});});}else{_0x3525c5=0x194;_0x52e5fd=[];}});})[_0xad4b('0x24')](function(){if(_0x3525c5!==0x194){return db[_0xad4b('0x91')][_0xad4b('0x93')]({'where':{'MailAccountId':_0x136f4c},'order':'priority'})[_0xad4b('0x24')](function(_0x1d24e2){_0x52e5fd=_0x1d24e2;});}})['catch'](function(_0x2dfd0a){_0x3525c5=0x1f4;logger[_0xad4b('0x18')](_0x2dfd0a[_0xad4b('0x28')]);if(_0x2dfd0a[_0xad4b('0x29')]){delete _0x2dfd0a['name'];}_0x52e5fd=_0x2dfd0a;})[_0xad4b('0x94')](function(){if(_0x52e5fd===null){_0x498b55['sendStatus'](_0x3525c5);}else{if(_0x3525c5===0x1f4){_0x498b55['status'](_0x3525c5)['send'](_0x52e5fd);}else{_0x498b55[_0xad4b('0x1c')](_0x3525c5)[_0xad4b('0x22')](_0x52e5fd);}}});};exports[_0xad4b('0x95')]=function(_0x2957f4,_0x598909){var _0x288f92={};var _0x39d77f={};var _0x2d32da;var _0x59e975;return db[_0xad4b('0x45')][_0xad4b('0x6c')]({'where':{'id':_0x2957f4[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x598909,null))[_0xad4b('0x24')](function(_0x3587cf){if(_0x3587cf){_0x2d32da=_0x3587cf;_0x39d77f[_0xad4b('0x4a')]=_[_0xad4b('0x61')](db[_0xad4b('0x91')][_0xad4b('0x46')]);_0x39d77f['query']=_['keys'](_0x2957f4[_0xad4b('0x4c')]);_0x39d77f['filters']=_[_0xad4b('0x4d')](_0x39d77f['model'],_0x39d77f[_0xad4b('0x4c')]);_0x288f92[_0xad4b('0x4f')]=_[_0xad4b('0x4d')](_0x39d77f[_0xad4b('0x4a')],qs['fields'](_0x2957f4[_0xad4b('0x4c')][_0xad4b('0x4e')]));_0x288f92[_0xad4b('0x4f')]=_0x288f92['attributes'][_0xad4b('0x50')]?_0x288f92['attributes']:_0x39d77f[_0xad4b('0x4a')];_0x288f92[_0xad4b('0x52')]=qs[_0xad4b('0x53')](_0x2957f4['query'][_0xad4b('0x53')]);_0x288f92[_0xad4b('0x56')]=qs[_0xad4b('0x54')](_[_0xad4b('0x55')](_0x2957f4[_0xad4b('0x4c')],_0x39d77f['filters']));if(_0x2957f4[_0xad4b('0x4c')][_0xad4b('0x57')]){_0x288f92[_0xad4b('0x56')]=_['merge'](_0x288f92[_0xad4b('0x56')],{'$or':_[_0xad4b('0x4b')](_0x288f92[_0xad4b('0x4f')],function(_0x28bf71){var _0x19895f={};_0x19895f[_0x28bf71]={'$like':'%'+_0x2957f4[_0xad4b('0x4c')][_0xad4b('0x57')]+'%'};return _0x19895f;})});}_0x288f92=_[_0xad4b('0x58')]({},_0x288f92,_0x2957f4[_0xad4b('0x59')]);return _0x2d32da['getApplications'](_0x288f92);}})[_0xad4b('0x24')](function(_0x1b1f09){if(_0x1b1f09){_0x59e975=_0x1b1f09[_0xad4b('0x50')];if(!_0x2957f4['query']['hasOwnProperty'](_0xad4b('0x6e'))){_0x288f92[_0xad4b('0x21')]=qs[_0xad4b('0x21')](_0x2957f4[_0xad4b('0x4c')]['limit']);_0x288f92[_0xad4b('0x20')]=qs[_0xad4b('0x20')](_0x2957f4['query']['offset']);}return _0x2d32da['getApplications'](_0x288f92);}})['then'](function(_0x50219f){if(_0x50219f){return _0x50219f?{'count':_0x59e975,'rows':_0x50219f}:null;}})[_0xad4b('0x24')](respondWithResult(_0x598909,null))[_0xad4b('0x5e')](handleError(_0x598909,null));};exports[_0xad4b('0x96')]=function(_0x2c33bc,_0x150ddf){var _0x5582fb={'raw':!![],'where':{}};var _0x50005a={};var _0xa060c4={'count':0x0,'rows':[]};return db['MailAccount'][_0xad4b('0x6c')]({'where':{'id':_0x2c33bc[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x150ddf,null))[_0xad4b('0x24')](function(_0x180a81){if(_0x180a81){_0x50005a['model']=_[_0xad4b('0x61')](db[_0xad4b('0x97')]['rawAttributes']);_0x50005a[_0xad4b('0x4c')]=_[_0xad4b('0x61')](_0x2c33bc['query']);_0x50005a[_0xad4b('0x54')]=_['intersection'](_0x50005a['model'],_0x50005a[_0xad4b('0x4c')]);_0x5582fb[_0xad4b('0x4f')]=_[_0xad4b('0x4d')](_0x50005a[_0xad4b('0x4a')],qs[_0xad4b('0x4e')](_0x2c33bc[_0xad4b('0x4c')]['fields']));_0x5582fb['attributes']=_0x5582fb[_0xad4b('0x4f')][_0xad4b('0x50')]?_0x5582fb[_0xad4b('0x4f')]:_0x50005a[_0xad4b('0x4a')];if(!_0x2c33bc[_0xad4b('0x4c')][_0xad4b('0x51')](_0xad4b('0x6e'))){_0x5582fb[_0xad4b('0x21')]=qs[_0xad4b('0x21')](_0x2c33bc['query']['limit']);_0x5582fb['offset']=qs['offset'](_0x2c33bc[_0xad4b('0x4c')][_0xad4b('0x20')]);}_0x5582fb[_0xad4b('0x52')]=qs[_0xad4b('0x53')](_0x2c33bc[_0xad4b('0x4c')][_0xad4b('0x53')]);_0x5582fb[_0xad4b('0x56')]=qs[_0xad4b('0x54')](_[_0xad4b('0x55')](_0x2c33bc[_0xad4b('0x4c')],_0x50005a[_0xad4b('0x54')]));_0x5582fb['where'][_0xad4b('0x6f')]=_0x180a81['id'];if(_0x2c33bc[_0xad4b('0x4c')][_0xad4b('0x57')]){_0x5582fb[_0xad4b('0x56')]=_[_0xad4b('0x58')](_0x5582fb['where'],{'$or':_['map'](_0x5582fb[_0xad4b('0x4f')],function(_0x243b87){var _0x4bf62d={};_0x4bf62d[_0x243b87]={'$like':'%'+_0x2c33bc['query'][_0xad4b('0x57')]+'%'};return _0x4bf62d;})});}if(_0x2c33bc['query'][_0xad4b('0x98')]){var _0x1cb236=_0x2c33bc[_0xad4b('0x4c')][_0xad4b('0x98')]['split'](',');var _0x16b99a={};_0x16b99a[_0x1cb236[0x0]]={'$gte':moment(_0x1cb236[0x1])[_0xad4b('0x99')](_0xad4b('0x9a'))};_0x5582fb['where']=_[_0xad4b('0x58')](_0x5582fb[_0xad4b('0x56')],_0x16b99a);}_0x5582fb=_[_0xad4b('0x58')]({},_0x5582fb,_0x2c33bc[_0xad4b('0x59')]);return db[_0xad4b('0x97')][_0xad4b('0x1f')]({'where':_0x5582fb[_0xad4b('0x56')]})[_0xad4b('0x24')](function(_0x3210a9){_0xa060c4[_0xad4b('0x1f')]=_0x3210a9;if(_0x2c33bc['query'][_0xad4b('0x5a')]){_0x5582fb[_0xad4b('0x5b')]=[{'all':!![]}];}return db[_0xad4b('0x97')][_0xad4b('0x5c')](_0x5582fb);})[_0xad4b('0x24')](function(_0x22d83b){if(_0x2c33bc[_0xad4b('0x4c')][_0xad4b('0x9b')]==='true'){for(var _0x199916=0x0;_0x199916<_0x22d83b['length'];_0x199916++){_0x22d83b[_0x199916]['body']=juice(_0x22d83b[_0x199916][_0xad4b('0x63')]);}}_0xa060c4[_0xad4b('0x5d')]=_0x22d83b;return _0xa060c4;});}})['then'](respondWithFilteredResult(_0x150ddf,_0x5582fb))[_0xad4b('0x5e')](handleError(_0x150ddf,null));};exports['send']=function(_0x52c486,_0x3a93c4){var _0x149f6b,_0x48b90d={},_0x8b70f;if(_0x52c486[_0xad4b('0x63')]['to']){_0x8b70f=_0x52c486['body']['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x52c486[_0xad4b('0x60')]['id']},'include':[{'model':db[_0xad4b('0x9c')],'as':_0xad4b('0x9d'),'include':[{'model':db['CmContact'],'as':_0xad4b('0x9e'),'where':{'email':_0x8b70f},'limit':0x1,'order':[[_0xad4b('0x9f'),_0xad4b('0xa0')]]}]},{'model':db[_0xad4b('0x41')],'as':_0xad4b('0x42'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xad4b('0xa1'),'raw':!![]}]}]})[_0xad4b('0x24')](handleEntityNotFound(_0x3a93c4,null))[_0xad4b('0x24')](function(_0x5a208f){if(!_0x5a208f)return;_0x149f6b=_0x5a208f;if(!_0x5a208f[_0xad4b('0x42')])throw new Error(_0xad4b('0xa2'));if(_['isNil'](_0x52c486['body'][_0xad4b('0xa3')])){_0x52c486[_0xad4b('0x63')][_0xad4b('0xa3')]=util['format'](_0xad4b('0xa4'),_0x5a208f[_0xad4b('0x29')],_0x5a208f['email']||_0x5a208f[_0xad4b('0x42')][_0xad4b('0x35')]);}if(_0x52c486[_0xad4b('0x63')][_0xad4b('0xa5')]&&_0x52c486['body'][_0xad4b('0xa5')][_0xad4b('0x50')]){for(var _0x298a18=0x0;_0x298a18<_0x52c486[_0xad4b('0x63')]['attachments'][_0xad4b('0x50')];_0x298a18+=0x1){_0x52c486[_0xad4b('0x63')][_0xad4b('0xa5')][_0x298a18]={'filename':_0x52c486[_0xad4b('0x63')][_0xad4b('0xa5')][_0x298a18][_0xad4b('0x29')],'path':path[_0xad4b('0xa6')](config[_0xad4b('0xa7')],_0xad4b('0xa8'),_0x52c486[_0xad4b('0x63')][_0xad4b('0xa5')][_0x298a18][_0xad4b('0xa9')])};}}var _0xaaf2b4=_0x5a208f[_0xad4b('0xaa')]();return respondWithRpcPromise(_0xad4b('0xab'),_0xad4b('0xac'),{'account':_0xaaf2b4,'message':_0x52c486[_0xad4b('0x63')]});})[_0xad4b('0x24')](function(_0xd7a1a4){if(!_0xd7a1a4)return;_0x48b90d=_0xd7a1a4;if(!_0x149f6b[_0xad4b('0x9d')])throw new Error('List\x20not\x20found');if(_0x149f6b['List'][_0xad4b('0x9e')][_0xad4b('0x50')])return _0x149f6b[_0xad4b('0x9d')]['Contacts'][0x0];return db[_0xad4b('0x85')]['create'](_[_0xad4b('0xb')](_0x52c486['body'],{'firstName':_0x52c486['body']['to'],'email':_0x52c486[_0xad4b('0x63')]['to'],'phone':_0x52c486[_0xad4b('0x63')]['to'],'ListId':_0x149f6b[_0xad4b('0xad')]}));})[_0xad4b('0x24')](function(_0x5ed227){if(!_0x5ed227)return;var _0x1a05f3={'UserId':_0x52c486[_0xad4b('0x35')]['id'],'ContactId':_0x5ed227['id'],'MailAccountId':_0x149f6b['id'],'inReplyTo':_0x48b90d[_0xad4b('0xae')],'to':_0x52c486['body'][_0xad4b('0xa3')],'cc':_0x52c486[_0xad4b('0x63')]['cc'],'subject':_0x52c486[_0xad4b('0x63')][_0xad4b('0xaf')],'attach':_0x52c486[_0xad4b('0x63')][_0xad4b('0xb0')],'firstMsgDirection':_0xad4b('0xb1'),'lastMsgAt':moment()[_0xad4b('0x99')](_0xad4b('0x9a')),'lastMsgDirection':_0xad4b('0xb1'),'Messages':[_[_0xad4b('0x58')](_0x52c486['body'],{'messageId':_0x48b90d[_0xad4b('0xae')],'sentAt':moment()[_0xad4b('0x99')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x149f6b['id'],'UserId':_0x52c486[_0xad4b('0x35')]['id'],'ContactId':_0x5ed227['id']})]};if(_0x52c486[_0xad4b('0x63')]['Interaction']){_0x1a05f3=_[_0xad4b('0x58')](_0x1a05f3,_0x52c486['body'][_0xad4b('0xb2')]);}return db['MailInteraction'][_0xad4b('0x6a')](_0x1a05f3,{'include':[{'model':db[_0xad4b('0x97')],'as':'Messages'}]});})[_0xad4b('0x24')](respondWithResult(_0x3a93c4,null))[_0xad4b('0x5e')](handleError(_0x3a93c4,null));};exports[_0xad4b('0xb3')]=function(_0x20fa87,_0x55f376){return db[_0xad4b('0x45')]['find']({'where':{'id':_0x20fa87[_0xad4b('0x60')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xad4b('0x42'),'raw':!![],'include':[{'model':db[_0xad4b('0xa1')],'as':_0xad4b('0xa1'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x55f376,null))['then'](function(_0xf5c825){if(!_0xf5c825[_0xad4b('0x42')])return;var _0x351131=_0xf5c825[_0xad4b('0xaa')]();return respondWithRpcPromise(_0xad4b('0xb4'),_0xad4b('0xb3'),{'account':_0x351131});})[_0xad4b('0x24')](respondWithResult(_0x55f376,null))[_0xad4b('0x5e')](handleError(_0x55f376,null));};exports[_0xad4b('0x27')]=function(_0xc88c20,_0x1431e1){return db[_0xad4b('0x45')][_0xad4b('0x62')]({'where':{'id':_0xc88c20[_0xad4b('0x60')]['id']}})['then'](handleEntityNotFound(_0x1431e1,null))['then'](function(_0x39f8ce){if(_0x39f8ce&&_0x39f8ce[_0xad4b('0x67')]){throw new db[(_0xad4b('0xb5'))][(_0xad4b('0xb6'))](_0xad4b('0xb7'));}return _0x39f8ce;})[_0xad4b('0x24')](removeEntity(_0x1431e1,null))[_0xad4b('0x5e')](handleError(_0x1431e1,null));};exports['addAgents']=function(_0xa91277,_0x3bf2fa){return db['MailAccount'][_0xad4b('0x62')]({'where':{'id':_0xa91277['params']['id']}})['then'](handleEntityNotFound(_0x3bf2fa,null))['then'](function(_0x17382a){if(_0x17382a){return _0x17382a[_0xad4b('0xb8')](_0xa91277[_0xad4b('0x63')][_0xad4b('0x71')],_[_0xad4b('0xb9')](_0xa91277[_0xad4b('0x63')],[_0xad4b('0x71'),'id'])||{})[_0xad4b('0xba')](function(_0x5f046a){for(var _0x2da565=0x0;_0x2da565<_0xa91277[_0xad4b('0x63')]['ids']['length'];_0x2da565+=0x1){socket[_0xad4b('0xbb')]('userMailAccount:save',{'UserId':Number(_0xa91277[_0xad4b('0x63')][_0xad4b('0x71')][_0x2da565]),'MailAccountId':Number(_0xa91277[_0xad4b('0x60')]['id'])});}return _0x5f046a;});}})[_0xad4b('0x24')](respondWithResult(_0x3bf2fa,null))[_0xad4b('0x5e')](handleError(_0x3bf2fa,null));};exports['removeAgents']=function(_0x28e130,_0x58a2b6){return db[_0xad4b('0x45')][_0xad4b('0x62')]({'where':{'id':_0x28e130[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x58a2b6,null))[_0xad4b('0x24')](function(_0x56ba3d){if(_0x56ba3d){return _0x56ba3d[_0xad4b('0xbc')](_0x28e130[_0xad4b('0x4c')][_0xad4b('0x71')])[_0xad4b('0x24')](function(){if(_[_0xad4b('0xbd')](_0x28e130[_0xad4b('0x4c')][_0xad4b('0x71')])){for(var _0x5737ea=0x0;_0x5737ea<_0x28e130['query'][_0xad4b('0x71')][_0xad4b('0x50')];_0x5737ea+=0x1){socket[_0xad4b('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x28e130[_0xad4b('0x4c')][_0xad4b('0x71')][_0x5737ea]),'MailAccountId':Number(_0x28e130[_0xad4b('0x60')]['id'])});}}else{socket[_0xad4b('0xbb')](_0xad4b('0xbe'),{'UserId':Number(_0x28e130[_0xad4b('0x4c')][_0xad4b('0x71')]),'MailAccountId':Number(_0x28e130['params']['id'])});}});}})[_0xad4b('0x24')](respondWithStatusCode(_0x58a2b6,null))[_0xad4b('0x5e')](handleError(_0x58a2b6,null));};exports['getAgents']=function(_0x379651,_0x3c28d6){var _0x16157a={};var _0x1606b3={};var _0x1bbb24;var _0x2a467b;return db['MailAccount'][_0xad4b('0x6c')]({'where':{'id':_0x379651[_0xad4b('0x60')]['id']}})[_0xad4b('0x24')](handleEntityNotFound(_0x3c28d6,null))[_0xad4b('0x24')](function(_0x4fe20b){if(_0x4fe20b){_0x1bbb24=_0x4fe20b;_0x1606b3['model']=_[_0xad4b('0x61')](db[_0xad4b('0xbf')][_0xad4b('0x46')]);_0x1606b3[_0xad4b('0x4c')]=_[_0xad4b('0x61')](_0x379651[_0xad4b('0x4c')]);_0x1606b3['filters']=_[_0xad4b('0x4d')](_0x1606b3[_0xad4b('0x4a')],_0x1606b3[_0xad4b('0x4c')]);_0x16157a[_0xad4b('0x4f')]=_[_0xad4b('0x4d')](_0x1606b3[_0xad4b('0x4a')],qs[_0xad4b('0x4e')](_0x379651[_0xad4b('0x4c')]['fields']));_0x16157a[_0xad4b('0x4f')]=_0x16157a[_0xad4b('0x4f')]['length']?_0x16157a[_0xad4b('0x4f')]:_0x1606b3[_0xad4b('0x4a')];_0x16157a['order']=qs['sort'](_0x379651['query'][_0xad4b('0x53')]);_0x16157a['where']=qs[_0xad4b('0x54')](_[_0xad4b('0x55')](_0x379651[_0xad4b('0x4c')],_0x1606b3[_0xad4b('0x54')]));if(_0x379651[_0xad4b('0x4c')][_0xad4b('0x57')]){_0x16157a['where']=_[_0xad4b('0x58')](_0x16157a[_0xad4b('0x56')],{'$or':_['map'](_0x16157a['attributes'],function(_0x346049){var _0x7222f={};_0x7222f[_0x346049]={'$like':'%'+_0x379651[_0xad4b('0x4c')][_0xad4b('0x57')]+'%'};return _0x7222f;})});}_0x16157a=_[_0xad4b('0x58')]({},_0x16157a,_0x379651[_0xad4b('0x59')]);return _0x1bbb24[_0xad4b('0xc0')](_0x16157a);}})['then'](function(_0x4ca8f9){if(_0x4ca8f9){_0x2a467b=_0x4ca8f9[_0xad4b('0x50')];if(!_0x379651['query'][_0xad4b('0x51')](_0xad4b('0x6e'))){_0x16157a[_0xad4b('0x21')]=qs['limit'](_0x379651['query'][_0xad4b('0x21')]);_0x16157a[_0xad4b('0x20')]=qs['offset'](_0x379651[_0xad4b('0x4c')][_0xad4b('0x20')]);}return _0x1bbb24['getAgents'](_0x16157a);}})[_0xad4b('0x24')](function(_0x5f20e7){if(_0x5f20e7){return _0x5f20e7?{'count':_0x2a467b,'rows':_0x5f20e7}:null;}})[_0xad4b('0x24')](respondWithResult(_0x3c28d6,null))[_0xad4b('0x5e')](handleError(_0x3c28d6,null));};
\ No newline at end of file
index 8c16187..61e1bad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd92a=['hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd92a,0x1bc));var _0xad92=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd92a[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xad92('0x0'))['db'][_0xad92('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xad92('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad92('0x3'),'afterDestroy':_0xad92('0x4')};function emitEvent(_0x502130){return function(_0x4baac5,_0x5782bf,_0x226a1f){MailAccountEvents[_0xad92('0x5')](_0x502130+':'+_0x4baac5['id'],_0x4baac5);MailAccountEvents['emit'](_0x502130,_0x4baac5);_0x226a1f(null);};}for(var e in events){if(events[_0xad92('0x6')](e)){var event=events[e];MailAccount[_0xad92('0x7')](e,emitEvent(event));}}module[_0xad92('0x8')]=MailAccountEvents;
\ No newline at end of file
+var _0xf5c0=['update','emit','hasOwnProperty','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xf5c0,0x9d));var _0x0f5c=function(_0x3d80b2,_0x3477b9){_0x3d80b2=_0x3d80b2-0x0;var _0x5c334c=_0xf5c0[_0x3d80b2];return _0x5c334c;};'use strict';var EventEmitter=require(_0x0f5c('0x0'));var MailAccount=require(_0x0f5c('0x1'))['db'][_0x0f5c('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0f5c('0x3')](0x0);var events={'afterCreate':_0x0f5c('0x4'),'afterUpdate':_0x0f5c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x339c91){return function(_0x55527c,_0x2e28f6,_0x2dcfeb){MailAccountEvents['emit'](_0x339c91+':'+_0x55527c['id'],_0x55527c);MailAccountEvents[_0x0f5c('0x6')](_0x339c91,_0x55527c);_0x2dcfeb(null);};}for(var e in events){if(events[_0x0f5c('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x0f5c('0x8')]=MailAccountEvents;
\ No newline at end of file
index c7dd1e4..ae05d3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a3f=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','host','Smtp','port','secure','authentication','modernAuthentication'];(function(_0x5ee5af,_0x52369f){var _0x1fdd47=function(_0x906004){while(--_0x906004){_0x5ee5af['push'](_0x5ee5af['shift']());}};_0x1fdd47(++_0x52369f);}(_0x9a3f,0x93));var _0xf9a3=function(_0x76f526,_0x2113c0){_0x76f526=_0x76f526-0x0;var _0x5ab06c=_0x9a3f[_0x76f526];return _0x5ab06c;};'use strict';var attributes=require(_0xf9a3('0x0'));module[_0xf9a3('0x1')]=function(_0x26e51b){return _0x26e51b[_0xf9a3('0x2')](_0xf9a3('0x3'),attributes,{'tableName':_0xf9a3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4687ce=this;var _0x2f5039={'id':_0x4687ce['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4687ce[_0xf9a3('0x5')]!==_0xf9a3('0x6')){_0x2f5039['service']=_0x4687ce[_0xf9a3('0x5')];}else{_0x2f5039[_0xf9a3('0x7')]=_0x4687ce['Smtp'][_0xf9a3('0x7')];_0x2f5039['port']=_0x4687ce[_0xf9a3('0x8')][_0xf9a3('0x9')];_0x2f5039['secure']=_0x4687ce[_0xf9a3('0x8')][_0xf9a3('0xa')];}if(_0x4687ce['Smtp'][_0xf9a3('0xb')]){if(_0x4687ce['Smtp'][_0xf9a3('0xc')]){if(!_0x4687ce[_0xf9a3('0x8')][_0xf9a3('0xd')])throw new Error(_0xf9a3('0xe'));_0x2f5039[_0xf9a3('0xf')]={'type':_0xf9a3('0x10'),'user':_0x4687ce[_0xf9a3('0x8')]['user'],'accessToken':_0x4687ce['Smtp'][_0xf9a3('0xd')][_0xf9a3('0x11')]};}else{_0x2f5039[_0xf9a3('0xf')]={'user':_0x4687ce[_0xf9a3('0x8')][_0xf9a3('0x12')],'pass':_0x4687ce['Smtp'][_0xf9a3('0x13')]};}}return _0x2f5039;}}});};
\ No newline at end of file
+var _0x1ea2=['host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','mail_accounts','provider','custom'];(function(_0x2c0fa9,_0x18d57a){var _0x5acb02=function(_0xb0c0b8){while(--_0xb0c0b8){_0x2c0fa9['push'](_0x2c0fa9['shift']());}};_0x5acb02(++_0x18d57a);}(_0x1ea2,0xc1));var _0x21ea=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x1ea2[_0x2f1762];return _0x8ab21;};'use strict';var attributes=require(_0x21ea('0x0'));module[_0x21ea('0x1')]=function(_0x16668a){return _0x16668a['define']('MailAccount',attributes,{'tableName':_0x21ea('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x18a449=this;var _0x20a3d5={'id':_0x18a449['id'],'tls':{'rejectUnauthorized':![]}};if(_0x18a449[_0x21ea('0x3')]!==_0x21ea('0x4')){_0x20a3d5['service']=_0x18a449[_0x21ea('0x3')];}else{_0x20a3d5[_0x21ea('0x5')]=_0x18a449[_0x21ea('0x6')][_0x21ea('0x5')];_0x20a3d5[_0x21ea('0x7')]=_0x18a449[_0x21ea('0x6')][_0x21ea('0x7')];_0x20a3d5['secure']=_0x18a449['Smtp'][_0x21ea('0x8')];}if(_0x18a449[_0x21ea('0x6')][_0x21ea('0x9')]){if(_0x18a449[_0x21ea('0x6')][_0x21ea('0xa')]){if(!_0x18a449[_0x21ea('0x6')][_0x21ea('0xb')])throw new Error(_0x21ea('0xc'));_0x20a3d5[_0x21ea('0xd')]={'type':_0x21ea('0xe'),'user':_0x18a449[_0x21ea('0x6')][_0x21ea('0xf')],'accessToken':_0x18a449[_0x21ea('0x6')][_0x21ea('0xb')][_0x21ea('0x10')]};}else{_0x20a3d5[_0x21ea('0xd')]={'user':_0x18a449[_0x21ea('0x6')][_0x21ea('0xf')],'pass':_0x18a449[_0x21ea('0x6')][_0x21ea('0x11')]};}}return _0x20a3d5;}}});};
\ No newline at end of file
index 166d4e7..04e34ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['update','interaction','created','contact','attachments','originTo','bcc','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','attributes','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','applications','list','orderBy','priority','asc','autoclose','length','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread'];(function(_0xf7a357,_0x1b9a26){var _0x57c8b=function(_0x509f6e){while(--_0x509f6e){_0xf7a357['push'](_0xf7a357['shift']());}};_0x57c8b(++_0x1b9a26);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xccb680,_0x1b170b){_0xccb680=_0xccb680-0x0;var _0x44d49=_0xc6ac[_0xccb680];return _0x44d49;};'use strict';var _=require(_0xcc6a('0x0'));var moment=require(_0xcc6a('0x1'));var BPromise=require(_0xcc6a('0x2'));var rs=require(_0xcc6a('0x3'));var Redis=require(_0xcc6a('0x4'));var db=require(_0xcc6a('0x5'))['db'];var logger=require(_0xcc6a('0x6'))(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));var jayson=require(_0xcc6a('0x9'));var client=jayson[_0xcc6a('0xa')][_0xcc6a('0xb')]({'port':0x232c});config[_0xcc6a('0xc')]=_[_0xcc6a('0xd')](config['redis'],{'host':_0xcc6a('0xe'),'port':0x18eb});var socket=require(_0xcc6a('0xf'))(new Redis(config[_0xcc6a('0xc')]));require('./mailAccount.socket')[_0xcc6a('0x10')](socket);function respondWithRpcPromise(_0x210f63,_0x7806a0,_0x463ebb){return new BPromise(function(_0x3eb04a,_0x5e91a2){return client[_0xcc6a('0x11')](_0x210f63,_0x463ebb)[_0xcc6a('0x12')](function(_0x109693){logger['info'](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));logger[_0xcc6a('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x7806a0,'request\x20sent',JSON[_0xcc6a('0x16')](_0x109693));if(_0x109693[_0xcc6a('0x17')]){if(_0x109693[_0xcc6a('0x17')]['code']===0x1f4){logger['error'](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);return _0x5e91a2(_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);}logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')]['message']);return _0x3eb04a(_0x109693['error']['message']);}else{logger[_0xcc6a('0x19')](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));_0x3eb04a(_0x109693[_0xcc6a('0x1a')][_0xcc6a('0x18')]);}})[_0xcc6a('0x1b')](function(_0x2d9585){logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x2d9585);_0x5e91a2(_0x2d9585);});});}exports[_0xcc6a('0x1c')]=function(_0x1d20a3){var _0x5b657e=this;return new Promise(function(_0xfec60f,_0x3e1fda){return db[_0xcc6a('0x1d')][_0xcc6a('0x1e')]({'raw':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')]['attributes']||null:null,'limit':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x22')]||null:null,'include':_0x1d20a3['options']?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x5fc697){return{'model':db[_0x5fc697['model']],'as':_0x5fc697['as'],'attributes':_0x5fc697[_0xcc6a('0x25')],'include':_0x5fc697[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x5fc697['include'],function(_0x3afb3a){return{'model':db[_0x3afb3a[_0xcc6a('0x26')]],'as':_0x3afb3a['as'],'attributes':_0x3afb3a['attributes'],'include':_0x3afb3a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x3afb3a[_0xcc6a('0x23')],function(_0x473f88){return{'model':db[_0x473f88['model']],'as':_0x473f88['as'],'attributes':_0x473f88[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x2c6d88){logger['info'](_0xcc6a('0x1c'),_0x1d20a3);logger['debug']('GetMailAccount',_0x1d20a3,JSON[_0xcc6a('0x16')](_0x2c6d88));_0xfec60f(_0x2c6d88);})[_0xcc6a('0x1b')](function(_0x3aa315){logger[_0xcc6a('0x17')](_0xcc6a('0x1c'),_0x3aa315[_0xcc6a('0x18')],_0x1d20a3);_0x3e1fda(_0x5b657e['error'](0x1f4,_0x3aa315[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x27')]=function(_0x147aff){var _0x2faeb5=this;return new Promise(function(_0x211a8c,_0x152ebd){return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'raw':_0x147aff['options']?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')]['attributes']||null:null,'include':_0x147aff[_0xcc6a('0x1f')]?_0x147aff['options']['include']?_['map'](_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x1101ec){return{'model':db[_0x1101ec[_0xcc6a('0x26')]],'as':_0x1101ec['as'],'attributes':_0x1101ec[_0xcc6a('0x25')],'include':_0x1101ec['include']?_['map'](_0x1101ec[_0xcc6a('0x23')],function(_0x11173a){return{'model':db[_0x11173a[_0xcc6a('0x26')]],'as':_0x11173a['as'],'attributes':_0x11173a['attributes'],'include':_0x11173a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x11173a[_0xcc6a('0x23')],function(_0xa326b2){return{'model':db[_0xa326b2[_0xcc6a('0x26')]],'as':_0xa326b2['as'],'attributes':_0xa326b2[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x18a252){if(_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x29')]===!![])_0x18a252[_0xcc6a('0x2a')](_0xcc6a('0x2b'),_0x18a252[_0xcc6a('0x2c')]());logger[_0xcc6a('0x19')](_0xcc6a('0x27'),_0x147aff);logger[_0xcc6a('0x15')](_0xcc6a('0x27'),_0x147aff,JSON[_0xcc6a('0x16')](_0x18a252));_0x211a8c(_0x18a252);})['catch'](function(_0x553e66){logger[_0xcc6a('0x17')](_0xcc6a('0x27'),_0x553e66[_0xcc6a('0x18')],_0x147aff);_0x152ebd(_0x2faeb5[_0xcc6a('0x17')](0x1f4,_0x553e66[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x2d')]=function(_0x3273bc){var _0x1199f1=this;return new Promise(function(_0x49b65c,_0x56bc7d){var _0x470e3b={'body':_0x3273bc['body'],'channel':'mail'};var _0x5cf1ba=_[_0xcc6a('0x2e')](_[_0xcc6a('0x2f')](db[_0xcc6a('0x30')][_0xcc6a('0x31')]),[_0xcc6a('0x32'),'updatedAt',_0xcc6a('0x33'),_0xcc6a('0x34')]);var _0x17e5a0=![];if(_0x3273bc[_0xcc6a('0x35')]['id']){delete _0x3273bc[_0xcc6a('0x35')]['id'];}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x37')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x38')));}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x35')])||_0x3273bc['body'][_0xcc6a('0x35')]===''){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x39')));}if(_['isNil'](_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5cf1ba));}if(!_['includes'](_0x5cf1ba,_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x3b')+_0x5cf1ba));}var _0x345e94={};_0x345e94[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')]['from'];return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'where':{'id':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x3d')],'as':_0xcc6a('0x3e'),'include':[{'model':db[_0xcc6a('0x30')],'as':'Contacts','where':_0x345e94,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xcc6a('0x3f')],'as':_0xcc6a('0x40')},{'model':db[_0xcc6a('0x41')],'as':_0xcc6a('0x42'),'include':[{'model':db['CloudProvider'],'as':_0xcc6a('0x43')}]}]})['then'](function(_0x3aa7dd){if(_0x3aa7dd&&_0x3aa7dd[_0xcc6a('0x3e')]){var _0xcfc540=_0x3aa7dd[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x3c')]=_[_0xcc6a('0x45')](_0xcfc540,['Applications',_0xcc6a('0x3e')]);_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x2b')]=_0x3aa7dd[_0xcc6a('0x2c')]();_0x470e3b[_0xcc6a('0x46')]=_0xcfc540[_0xcc6a('0x40')];_0x470e3b[_0xcc6a('0x47')]=_0xcfc540[_0xcc6a('0x3e')];_0x470e3b[_0xcc6a('0x46')]=_[_0xcc6a('0x48')](_0x470e3b['applications'],[_0xcc6a('0x49')],[_0xcc6a('0x4a')]);if(_0x470e3b[_0xcc6a('0x3c')]&&_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x4b')]){_0x470e3b[_0xcc6a('0x46')]['push']({'id':0x0,'priority':_0x470e3b['applications'][_0xcc6a('0x4c')]+0x1,'app':'close','appdata':_0xcc6a('0x4b'),'interval':_0xcc6a('0x4d')});}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')];}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')];}if(_0xcfc540[_0xcc6a('0x3e')]['Contacts'][_0xcc6a('0x4c')]){return _0xcfc540['List'][_0xcc6a('0x4e')][0x0];}var _0x1570fe=_[_0xcc6a('0xd')](_0x3273bc['body'],{'firstName':_0x3273bc[_0xcc6a('0x35')]['from'],'ListId':_0xcfc540[_0xcc6a('0x34')]});_0x1570fe[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x37')];return db[_0xcc6a('0x30')][_0xcc6a('0x4f')](_0x1570fe);}else{throw new Error(_0xcc6a('0x50'));}})[_0xcc6a('0x12')](function(_0x11459f){_0x470e3b['contact']=_0x11459f;if(_0x11459f){if(!_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x51')]){_0x3273bc['body'][_0xcc6a('0x18')][_0xcc6a('0x51')]=rs[_0xcc6a('0x52')]()+'\x20'+_0x3273bc['body'][_0xcc6a('0x18')]['from'];}var _0x5e53e4={'ContactId':_0x11459f['id'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x54')],'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'};return db[_0xcc6a('0x57')]['find']({'where':{'closed':![],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x58')],'as':_0xcc6a('0x59'),'attributes':[_0xcc6a('0x51')],'where':{'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x5a')]}}]})[_0xcc6a('0x12')](function(_0x2686c8){if(_0x2686c8){return[_0x2686c8,![]];}return db[_0xcc6a('0x57')]['create'](_0x5e53e4)['then'](function(_0x4fe041){return[_0x4fe041,!![]];});});}else{throw new Error(_0xcc6a('0x5b'));}})[_0xcc6a('0x5c')](function(_0x9c444,_0x4a9f34){if(_0x9c444){_0x17e5a0=_0x4a9f34;if(!_0x4a9f34){return _0x9c444[_0xcc6a('0x5d')]({'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc['body']['message'][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x53')],'attach':_0x9c444[_0xcc6a('0x54')]?_0x9c444[_0xcc6a('0x54')]:_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xcc6a('0x56')),'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'});}else{return _0x9c444;}}})[_0xcc6a('0x12')](function(_0x56a3a0){_0x470e3b['interaction']=_0x56a3a0[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x5f')]=_0x17e5a0;return db[_0xcc6a('0x58')]['create']({'body':_0x3273bc['body']['body'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'MailInteractionId':_0x56a3a0['id'],'direction':'in','ContactId':_0x470e3b[_0xcc6a('0x60')]['id'],'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['messageId'],'from':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['from'],'to':_0x3273bc[_0xcc6a('0x35')]['message']['to'],'cc':_0x3273bc[_0xcc6a('0x35')]['message']['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc['body'][_0xcc6a('0x18')]['attach'],'Attachments':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x61')],'originTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x62')],'originCc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originCc'],'bcc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x63')],'ChatWebsiteId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['ChatWebsiteId']||null,'originChannel':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originChannel']||'Email','ChatOfflineMessageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x64')]||null},{'include':[{'model':db[_0xcc6a('0x65')],'as':_0xcc6a('0x66')}]});})[_0xcc6a('0x12')](function(_0x598833){_0x470e3b[_0xcc6a('0x18')]=_0x598833;if(_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x67')]){return db[_0xcc6a('0x68')][_0xcc6a('0x28')]({'attributes':['id',_0xcc6a('0x69')],'where':{'id':_0x470e3b['interaction']['UserId']}})[_0xcc6a('0x12')](function(_0x43cbee){if(_0x43cbee){_0x470e3b[_0xcc6a('0x46')][_0xcc6a('0x6a')]({'id':0x0,'priority':0x0,'app':_0xcc6a('0x6b'),'appdata':_0x43cbee[_0xcc6a('0x69')]+','+(_0x470e3b[_0xcc6a('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':_0xcc6a('0x4d')});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);})[_0xcc6a('0x12')](function(_0x5e8e19){_0x49b65c(_0x5e8e19);})[_0xcc6a('0x1b')](function(_0x4688d3){_0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0x4688d3['message']));});});};
\ No newline at end of file
+var _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0xc6e81e,_0x346a40){var _0x5e068b=function(_0xabc9b2){while(--_0xabc9b2){_0xc6e81e['push'](_0xc6e81e['shift']());}};_0x5e068b(++_0x346a40);}(_0x687b,0x14a));var _0xb687=function(_0xd746ed,_0x81920c){_0xd746ed=_0xd746ed-0x0;var _0x5ef2a6=_0x687b[_0xd746ed];return _0x5ef2a6;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});};
\ No newline at end of file
index 6cec179..a358ba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x492b=['save','remove','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x492b,0x1c7));var _0xb492=function(_0xbb1a5d,_0x6778f4){_0xbb1a5d=_0xbb1a5d-0x0;var _0x3f4051=_0x492b[_0xbb1a5d];return _0x3f4051;};'use strict';var MailAccountEvents=require(_0xb492('0x0'));var events=[_0xb492('0x1'),_0xb492('0x2'),'update'];function createListener(_0x2364d7,_0x147096){return function(_0x30e274){_0x147096[_0xb492('0x3')](_0x2364d7,_0x30e274);};}function removeListener(_0x4d753e,_0x37b273){return function(){MailAccountEvents[_0xb492('0x4')](_0x4d753e,_0x37b273);};}exports[_0xb492('0x5')]=function(_0x2a3c8e){for(var _0x4d42ce=0x0,_0x245350=events[_0xb492('0x6')];_0x4d42ce<_0x245350;_0x4d42ce++){var _0x460059=events[_0x4d42ce];var _0x26b187=createListener(_0xb492('0x7')+_0x460059,_0x2a3c8e);MailAccountEvents['on'](_0x460059,_0x26b187);}};
\ No newline at end of file
+var _0x5943=['length','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x2b216a,_0x5ebea4){var _0x39ab62=function(_0x37b9bd){while(--_0x37b9bd){_0x2b216a['push'](_0x2b216a['shift']());}};_0x39ab62(++_0x5ebea4);}(_0x5943,0x1f2));var _0x3594=function(_0x413f53,_0x420a2e){_0x413f53=_0x413f53-0x0;var _0x2bfaf9=_0x5943[_0x413f53];return _0x2bfaf9;};'use strict';var MailAccountEvents=require(_0x3594('0x0'));var events=[_0x3594('0x1'),_0x3594('0x2'),_0x3594('0x3')];function createListener(_0x180826,_0x3d1f7a){return function(_0x9df518){_0x3d1f7a[_0x3594('0x4')](_0x180826,_0x9df518);};}function removeListener(_0x5d1683,_0x4a1425){return function(){MailAccountEvents[_0x3594('0x5')](_0x5d1683,_0x4a1425);};}exports['register']=function(_0x41b527){for(var _0x168e14=0x0,_0x80b96e=events[_0x3594('0x6')];_0x168e14<_0x80b96e;_0x168e14++){var _0x18ef03=events[_0x168e14];var _0x8bbf95=createListener(_0x3594('0x7')+_0x18ef03,_0x41b527);MailAccountEvents['on'](_0x18ef03,_0x8bbf95);}};
\ No newline at end of file
index eea7a7c..576c29d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e03=['./mailApplication.controller','get','/:id','isAuthenticated','put','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4e03,0xd8));var _0x34e0=function(_0xbc217d,_0x1b5005){_0xbc217d=_0xbc217d-0x0;var _0x3f1e13=_0x4e03[_0xbc217d];return _0x3f1e13;};'use strict';var multer=require('multer');var util=require(_0x34e0('0x0'));var path=require('path');var timeout=require(_0x34e0('0x1'));var express=require(_0x34e0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34e0('0x3'));var interaction=require(_0x34e0('0x4'));var config=require('../../config/environment');var controller=require(_0x34e0('0x5'));router[_0x34e0('0x6')](_0x34e0('0x7'),auth[_0x34e0('0x8')](),controller['show']);router[_0x34e0('0x9')](_0x34e0('0x7'),auth[_0x34e0('0x8')](),controller['update']);router[_0x34e0('0xa')](_0x34e0('0x7'),auth[_0x34e0('0x8')](),controller[_0x34e0('0xb')]);module[_0x34e0('0xc')]=router;
\ No newline at end of file
+var _0x6d08=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util'];(function(_0x465185,_0xc5bad5){var _0x85be69=function(_0x403ede){while(--_0x403ede){_0x465185['push'](_0x465185['shift']());}};_0x85be69(++_0xc5bad5);}(_0x6d08,0xee));var _0x86d0=function(_0xb0adfb,_0x5c4bb4){_0xb0adfb=_0xb0adfb-0x0;var _0x3e77c4=_0x6d08[_0xb0adfb];return _0x3e77c4;};'use strict';var multer=require(_0x86d0('0x0'));var util=require(_0x86d0('0x1'));var path=require('path');var timeout=require(_0x86d0('0x2'));var express=require(_0x86d0('0x3'));var router=express['Router']();var fs_extra=require(_0x86d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x86d0('0x5'));var config=require(_0x86d0('0x6'));var controller=require(_0x86d0('0x7'));router[_0x86d0('0x8')](_0x86d0('0x9'),auth[_0x86d0('0xa')](),controller[_0x86d0('0xb')]);router[_0x86d0('0xc')](_0x86d0('0x9'),auth[_0x86d0('0xa')](),controller['update']);router[_0x86d0('0xd')](_0x86d0('0x9'),auth[_0x86d0('0xa')](),controller[_0x86d0('0xe')]);module[_0x86d0('0xf')]=router;
\ No newline at end of file
index d5f7552..d67bec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe173=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x3b83d4,_0x471d18){var _0x1ac20c=function(_0x222ca5){while(--_0x222ca5){_0x3b83d4['push'](_0x3b83d4['shift']());}};_0x1ac20c(++_0x471d18);}(_0xe173,0x1a5));var _0x3e17=function(_0x403381,_0xf2faa4){_0x403381=_0x403381-0x0;var _0x48840a=_0xe173[_0x403381];return _0x48840a;};'use strict';var Sequelize=require(_0x3e17('0x0'));module[_0x3e17('0x1')]={'priority':{'type':Sequelize[_0x3e17('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3e17('0x3')]()},'description':{'type':Sequelize[_0x3e17('0x4')]},'interval':{'type':Sequelize[_0x3e17('0x4')],'defaultValue':_0x3e17('0x5')}};
\ No newline at end of file
+var _0x6d80=['*,*,*,*','exports','STRING'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x6d80,0x70));var _0x06d8=function(_0x50f389,_0x212bbc){_0x50f389=_0x50f389-0x0;var _0x486a1a=_0x6d80[_0x50f389];return _0x486a1a;};'use strict';var Sequelize=require('sequelize');module[_0x06d8('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x06d8('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x06d8('0x2')}};
\ No newline at end of file
index 860dacd..6bb509a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x16a5a4,_0x222426){var _0x5468d2=function(_0x53030d){while(--_0x53030d){_0x16a5a4['push'](_0x16a5a4['shift']());}};_0x5468d2(++_0x222426);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));};
\ No newline at end of file
+var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x32c98a,_0x5e6eb0){var _0x1796d3=function(_0x560640){while(--_0x560640){_0x32c98a['push'](_0x32c98a['shift']());}};_0x1796d3(++_0x5e6eb0);}(_0xe706,0xa3));var _0x6e70=function(_0x399131,_0x2db855){_0x399131=_0x399131-0x0;var _0xce76e2=_0xe706[_0x399131];return _0xce76e2;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));};
\ No newline at end of file
index d2624af..87ee98f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c2d=['rimraf','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x111835,_0x4d646c){var _0x3e6f07=function(_0xb41839){while(--_0xb41839){_0x111835['push'](_0x111835['shift']());}};_0x3e6f07(++_0x4d646c);}(_0x3c2d,0x157));var _0xd3c2=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x3c2d[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xd3c2('0x0'));var util=require(_0xd3c2('0x1'));var logger=require(_0xd3c2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd3c2('0x3'));var rp=require(_0xd3c2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3c2('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xd3c2('0x6')]=function(_0x426113,_0x4d471d){return _0x426113[_0xd3c2('0x7')](_0xd3c2('0x8'),attributes,{'tableName':_0xd3c2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd3c2('0xa'),'collate':_0xd3c2('0xb')});};
\ No newline at end of file
+var _0xd114=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailApplication'];(function(_0x54444f,_0xdad4d0){var _0x4eb0b1=function(_0x14067a){while(--_0x14067a){_0x54444f['push'](_0x54444f['shift']());}};_0x4eb0b1(++_0xdad4d0);}(_0xd114,0x1c9));var _0x4d11=function(_0x338b87,_0x3cdb26){_0x338b87=_0x338b87-0x0;var _0x15ba38=_0xd114[_0x338b87];return _0x15ba38;};'use strict';var _=require(_0x4d11('0x0'));var util=require(_0x4d11('0x1'));var logger=require(_0x4d11('0x2'))(_0x4d11('0x3'));var moment=require('moment');var BPromise=require(_0x4d11('0x4'));var rp=require(_0x4d11('0x5'));var fs=require('fs');var path=require(_0x4d11('0x6'));var rimraf=require(_0x4d11('0x7'));var config=require(_0x4d11('0x8'));var attributes=require('./mailApplication.attributes');module[_0x4d11('0x9')]=function(_0xfb3602,_0x2ed15a){return _0xfb3602['define'](_0x4d11('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4d11('0xb'),'collate':_0x4d11('0xc')});};
\ No newline at end of file
index bb60073..900abed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c00=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','options','raw','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x28fb38,_0x567ec3){var _0x44cc0d=function(_0x3d00ee){while(--_0x3d00ee){_0x28fb38['push'](_0x28fb38['shift']());}};_0x44cc0d(++_0x567ec3);}(_0x6c00,0x14d));var _0x06c0=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0x6c00[_0x9a7ea6];return _0x1c2040;};'use strict';var _=require(_0x06c0('0x0'));var util=require(_0x06c0('0x1'));var moment=require(_0x06c0('0x2'));var BPromise=require(_0x06c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c0('0x4'));var db=require(_0x06c0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x06c0('0x6'))(_0x06c0('0x7'));var config=require(_0x06c0('0x8'));var jayson=require(_0x06c0('0x9'));var client=jayson[_0x06c0('0xa')][_0x06c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22c0ca,_0x423040,_0x1d26f8){return new BPromise(function(_0x869c74,_0x152830){return client[_0x06c0('0xc')](_0x22c0ca,_0x1d26f8)[_0x06c0('0xd')](function(_0x222d1d){logger[_0x06c0('0xe')]('MailApplication,\x20%s,\x20%s',_0x423040,_0x06c0('0xf'));logger[_0x06c0('0x10')](_0x06c0('0x11'),_0x423040,_0x06c0('0xf'),JSON[_0x06c0('0x12')](_0x222d1d));if(_0x222d1d['error']){if(_0x222d1d[_0x06c0('0x13')][_0x06c0('0x14')]===0x1f4){logger[_0x06c0('0x13')](_0x06c0('0x15'),_0x423040,_0x222d1d[_0x06c0('0x13')][_0x06c0('0x16')]);return _0x152830(_0x222d1d['error'][_0x06c0('0x16')]);}logger[_0x06c0('0x13')](_0x06c0('0x15'),_0x423040,_0x222d1d['error'][_0x06c0('0x16')]);return _0x869c74(_0x222d1d[_0x06c0('0x13')][_0x06c0('0x16')]);}else{logger[_0x06c0('0xe')](_0x06c0('0x15'),_0x423040,'request\x20sent');_0x869c74(_0x222d1d[_0x06c0('0x17')][_0x06c0('0x16')]);}})[_0x06c0('0x18')](function(_0x44467c){logger['error'](_0x06c0('0x15'),_0x423040,_0x44467c);_0x152830(_0x44467c);});});}exports[_0x06c0('0x19')]=function(_0x253c27){var _0x11143e=this;return new Promise(function(_0x3452ab,_0x421226){return db['MailApplication'][_0x06c0('0x1a')](_0x253c27['body'],{'raw':_0x253c27[_0x06c0('0x1b')]?_0x253c27[_0x06c0('0x1b')][_0x06c0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x253c27[_0x06c0('0x1b')]?_0x253c27[_0x06c0('0x1b')][_0x06c0('0x1d')]||null:null,'attributes':_0x253c27[_0x06c0('0x1b')]?_0x253c27[_0x06c0('0x1b')][_0x06c0('0x1e')]||null:null,'limit':_0x253c27[_0x06c0('0x1b')]?_0x253c27[_0x06c0('0x1b')]['limit']||null:null})[_0x06c0('0xd')](function(_0x181182){logger[_0x06c0('0xe')](_0x06c0('0x19'),_0x253c27);logger[_0x06c0('0x10')]('UpdateMailApplication',_0x253c27,JSON['stringify'](_0x181182));_0x3452ab(_0x181182);})['catch'](function(_0x4522cb){logger['error'](_0x06c0('0x19'),_0x4522cb[_0x06c0('0x16')],_0x253c27);_0x421226(_0x11143e[_0x06c0('0x13')](0x1f4,_0x4522cb[_0x06c0('0x16')]));});});};
\ No newline at end of file
+var _0x828d=['UpdateMailApplication','MailApplication','update','body','options','raw','attributes','then','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x283616,_0x8b8617){var _0x34f265=function(_0x147911){while(--_0x147911){_0x283616['push'](_0x283616['shift']());}};_0x34f265(++_0x8b8617);}(_0x828d,0x131));var _0xd828=function(_0xb5adf8,_0x5147f0){_0xb5adf8=_0xb5adf8-0x0;var _0x53c5c1=_0x828d[_0xb5adf8];return _0x53c5c1;};'use strict';var _=require(_0xd828('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd828('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd828('0x2'))['db'];var utils=require(_0xd828('0x3'));var logger=require(_0xd828('0x4'))('rpc');var config=require(_0xd828('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd828('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x782d6e,_0x30c290,_0x5c40fb){return new BPromise(function(_0x508db0,_0x557c7e){return client[_0xd828('0x7')](_0x782d6e,_0x5c40fb)['then'](function(_0x46fec1){logger[_0xd828('0x8')](_0xd828('0x9'),_0x30c290,_0xd828('0xa'));logger[_0xd828('0xb')](_0xd828('0xc'),_0x30c290,_0xd828('0xa'),JSON[_0xd828('0xd')](_0x46fec1));if(_0x46fec1[_0xd828('0xe')]){if(_0x46fec1['error'][_0xd828('0xf')]===0x1f4){logger[_0xd828('0xe')](_0xd828('0x9'),_0x30c290,_0x46fec1[_0xd828('0xe')][_0xd828('0x10')]);return _0x557c7e(_0x46fec1[_0xd828('0xe')]['message']);}logger[_0xd828('0xe')]('MailApplication,\x20%s,\x20%s',_0x30c290,_0x46fec1[_0xd828('0xe')][_0xd828('0x10')]);return _0x508db0(_0x46fec1[_0xd828('0xe')][_0xd828('0x10')]);}else{logger[_0xd828('0x8')]('MailApplication,\x20%s,\x20%s',_0x30c290,_0xd828('0xa'));_0x508db0(_0x46fec1[_0xd828('0x11')]['message']);}})[_0xd828('0x12')](function(_0x45aef2){logger['error'](_0xd828('0x9'),_0x30c290,_0x45aef2);_0x557c7e(_0x45aef2);});});}exports[_0xd828('0x13')]=function(_0x262396){var _0x3bb650=this;return new Promise(function(_0x35651b,_0x443666){return db[_0xd828('0x14')][_0xd828('0x15')](_0x262396[_0xd828('0x16')],{'raw':_0x262396[_0xd828('0x17')]?_0x262396[_0xd828('0x17')][_0xd828('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x262396[_0xd828('0x17')]?_0x262396[_0xd828('0x17')]['where']||null:null,'attributes':_0x262396[_0xd828('0x17')]?_0x262396[_0xd828('0x17')][_0xd828('0x19')]||null:null,'limit':_0x262396[_0xd828('0x17')]?_0x262396[_0xd828('0x17')]['limit']||null:null})[_0xd828('0x1a')](function(_0x3dbf9a){logger[_0xd828('0x8')](_0xd828('0x13'),_0x262396);logger[_0xd828('0xb')](_0xd828('0x13'),_0x262396,JSON[_0xd828('0xd')](_0x3dbf9a));_0x35651b(_0x3dbf9a);})[_0xd828('0x12')](function(_0x4126e6){logger[_0xd828('0xe')](_0xd828('0x13'),_0x4126e6['message'],_0x262396);_0x443666(_0x3bb650[_0xd828('0xe')](0x1f4,_0x4126e6[_0xd828('0x10')]));});});};
\ No newline at end of file
index 7c04cca..6847f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bd6=['put','tracked','update','mail','destroy','delete','removeTags','Router','../../components/interaction/service','./mailInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','mailinteraction:addtags'];(function(_0x5b670f,_0x3ad110){var _0xa4d1a3=function(_0x6e589f){while(--_0x6e589f){_0x5b670f['push'](_0x5b670f['shift']());}};_0xa4d1a3(++_0x3ad110);}(_0x8bd6,0x67));var _0x68bd=function(_0x179bf2,_0x14a7df){_0x179bf2=_0x179bf2-0x0;var _0x325e74=_0x8bd6[_0x179bf2];return _0x325e74;};'use strict';var express=require('express');var router=express[_0x68bd('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x68bd('0x1'));var controller=require(_0x68bd('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x68bd('0x3')]);router[_0x68bd('0x4')](_0x68bd('0x5'),auth[_0x68bd('0x6')](),controller[_0x68bd('0x7')]);router[_0x68bd('0x4')](_0x68bd('0x8'),auth['isAuthenticated'](),controller[_0x68bd('0x9')]);router['get'](_0x68bd('0xa'),auth[_0x68bd('0x6')](),controller['getMessages']);router['get'](_0x68bd('0xb'),auth[_0x68bd('0x6')](),controller['download']);router[_0x68bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x68bd('0xd')]);router[_0x68bd('0xc')](_0x68bd('0xa'),auth['isAuthenticated'](),controller[_0x68bd('0xe')]);router[_0x68bd('0xc')](_0x68bd('0xf'),auth[_0x68bd('0x6')](),interaction['tracked']('mail',_0x68bd('0x10')),controller['addTags']);router[_0x68bd('0x11')](_0x68bd('0x8'),auth[_0x68bd('0x6')](),interaction[_0x68bd('0x12')]('mail','mailinteraction:update'),controller[_0x68bd('0x13')]);router['delete'](_0x68bd('0x8'),auth['isAuthenticated'](),interaction[_0x68bd('0x12')](_0x68bd('0x14'),'mailinteraction:destroy'),controller[_0x68bd('0x15')]);router[_0x68bd('0x16')]('/:id/tags',auth[_0x68bd('0x6')](),controller[_0x68bd('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xc341=['./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','create','/:id/messages','addMessage','tracked','mailinteraction:addtags','addTags','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x41b90a,_0x4d0754){var _0x1919fc=function(_0x2980f3){while(--_0x2980f3){_0x41b90a['push'](_0x41b90a['shift']());}};_0x1919fc(++_0x4d0754);}(_0xc341,0x158));var _0x1c34=function(_0x43d21f,_0x4ed851){_0x43d21f=_0x43d21f-0x0;var _0x5770f9=_0xc341[_0x43d21f];return _0x5770f9;};'use strict';var express=require(_0x1c34('0x0'));var router=express[_0x1c34('0x1')]();var auth=require(_0x1c34('0x2'));var interaction=require(_0x1c34('0x3'));var controller=require(_0x1c34('0x4'));router[_0x1c34('0x5')]('/',auth[_0x1c34('0x6')](),controller[_0x1c34('0x7')]);router[_0x1c34('0x5')](_0x1c34('0x8'),auth[_0x1c34('0x6')](),controller[_0x1c34('0x9')]);router['get'](_0x1c34('0xa'),auth[_0x1c34('0x6')](),controller['show']);router[_0x1c34('0x5')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x1c34('0xb'),auth[_0x1c34('0x6')](),controller[_0x1c34('0xc')]);router[_0x1c34('0xd')]('/',auth[_0x1c34('0x6')](),controller[_0x1c34('0xe')]);router['post'](_0x1c34('0xf'),auth['isAuthenticated'](),controller[_0x1c34('0x10')]);router[_0x1c34('0xd')]('/:id/tags',auth[_0x1c34('0x6')](),interaction[_0x1c34('0x11')]('mail',_0x1c34('0x12')),controller[_0x1c34('0x13')]);router['put'](_0x1c34('0xa'),auth[_0x1c34('0x6')](),interaction[_0x1c34('0x11')](_0x1c34('0x14'),_0x1c34('0x15')),controller[_0x1c34('0x16')]);router[_0x1c34('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x1c34('0x11')](_0x1c34('0x14'),_0x1c34('0x18')),controller[_0x1c34('0x19')]);router[_0x1c34('0x17')](_0x1c34('0x1a'),auth[_0x1c34('0x6')](),controller[_0x1c34('0x1b')]);module[_0x1c34('0x1c')]=router;
\ No newline at end of file
index 4f913f0..d545f6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf450=['long','TEXT','ENUM','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0xf450,0x133));var _0x0f45=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf450[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x0f45('0x0'));module[_0x0f45('0x1')]={'closed':{'type':Sequelize[_0x0f45('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0f45('0x3')]},'disposition':{'type':Sequelize[_0x0f45('0x4')]},'secondDisposition':{'type':Sequelize[_0x0f45('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0f45('0x4')]},'note':{'type':Sequelize[_0x0f45('0x4')]},'inReplyTo':{'type':Sequelize[_0x0f45('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x0f45('0x5'))},'subject':{'type':Sequelize[_0x0f45('0x6')]()},'attach':{'type':Sequelize[_0x0f45('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0f45('0x3')]},'substatus':{'type':Sequelize[_0x0f45('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x0f45('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0f45('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0f45('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0f45('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2b92=['long','BOOLEAN','ENUM','sequelize','iconv','DATE','STRING','TEXT'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0x2b92,0x9b));var _0x22b9=function(_0x5f1e53,_0x4f83f9){_0x5f1e53=_0x5f1e53-0x0;var _0x516a79=_0x2b92[_0x5f1e53];return _0x516a79;};'use strict';var Sequelize=require(_0x22b9('0x0'));var iconv=require(_0x22b9('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x22b9('0x2')]},'disposition':{'type':Sequelize[_0x22b9('0x3')]},'secondDisposition':{'type':Sequelize[_0x22b9('0x3')]},'thirdDisposition':{'type':Sequelize[_0x22b9('0x3')]},'note':{'type':Sequelize[_0x22b9('0x3')]},'inReplyTo':{'type':Sequelize[_0x22b9('0x3')](0x1fe)},'to':{'type':Sequelize[_0x22b9('0x3')]},'cc':{'type':Sequelize[_0x22b9('0x4')](_0x22b9('0x5'))},'subject':{'type':Sequelize[_0x22b9('0x4')]()},'attach':{'type':Sequelize[_0x22b9('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x22b9('0x2')]},'substatus':{'type':Sequelize[_0x22b9('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x22b9('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x22b9('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x22b9('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x22b9('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x22b9('0x6')],'defaultValue':![]}};
\ No newline at end of file
index b246e4a..25a3528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a61=['describe','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','sort','format','inlineCss','true','rows','addTags','spread','Tag','emit','mailInteractionTags:save','removeTags','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','each','headers','basename','writeFileSync','download','unlinkSync','eml-format','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','order','where','pick','select','field','color','from','tools_tags','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','MailInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','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','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','all','show','params','includeAll','include','merge','options','create','body'];(function(_0x30f63d,_0xf0902b){var _0x4f59f4=function(_0x4479d7){while(--_0x4479d7){_0x30f63d['push'](_0x30f63d['shift']());}};_0x4f59f4(++_0xf0902b);}(_0x1a61,0x1e6));var _0x11a6=function(_0x128361,_0x364987){_0x128361=_0x128361-0x0;var _0x1e4aae=_0x1a61[_0x128361];return _0x1e4aae;};'use strict';var emlformat=require(_0x11a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11a6('0x1'));var moment=require('moment');var BPromise=require(_0x11a6('0x2'));var util=require(_0x11a6('0x3'));var path=require(_0x11a6('0x4'));var fs=require('fs');var _=require(_0x11a6('0x5'));var squel=require('squel');var juice=require('juice');var Redis=require(_0x11a6('0x6'));var qs=require(_0x11a6('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x11a6('0x8'))(_0x11a6('0x9'));var config=require(_0x11a6('0xa'));var db=require(_0x11a6('0xb'))['db'];var htmlEntities=require(_0x11a6('0xc'));config[_0x11a6('0xd')]=_[_0x11a6('0xe')](config[_0x11a6('0xd')],{'host':_0x11a6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x11a6('0x10')](socket);function respondWithStatusCode(_0x3cf410,_0x5d2fb5){_0x5d2fb5=_0x5d2fb5||0xcc;return function(_0x3cbb05){if(_0x3cbb05){return _0x3cf410[_0x11a6('0x11')](_0x5d2fb5);}return _0x3cf410[_0x11a6('0x12')](_0x5d2fb5)[_0x11a6('0x13')]();};}function respondWithResult(_0x12c976,_0x41c4aa){_0x41c4aa=_0x41c4aa||0xc8;return function(_0x52f39a){if(_0x52f39a){return _0x12c976['status'](_0x41c4aa)[_0x11a6('0x14')](_0x52f39a);}};}function respondWithFilteredResult(_0x318253,_0x5462c7){return function(_0x1d3123){if(_0x1d3123){var _0x15d140=typeof _0x5462c7['offset']===_0x11a6('0x15')&&typeof _0x5462c7[_0x11a6('0x16')]==='undefined';var _0x345c70=_0x1d3123[_0x11a6('0x17')];var _0x1fec24=_0x15d140?0x0:_0x5462c7[_0x11a6('0x18')];var _0x4bdbf3=_0x15d140?_0x1d3123[_0x11a6('0x17')]:_0x5462c7[_0x11a6('0x18')]+_0x5462c7[_0x11a6('0x16')];var _0x289fff;if(_0x4bdbf3>=_0x345c70){_0x4bdbf3=_0x345c70;_0x289fff=0xc8;}else{_0x289fff=0xce;}_0x318253[_0x11a6('0x12')](_0x289fff);return _0x318253[_0x11a6('0x19')](_0x11a6('0x1a'),_0x1fec24+'-'+_0x4bdbf3+'/'+_0x345c70)[_0x11a6('0x14')](_0x1d3123);}return null;};}function saveUpdates(_0x312cc6){return function(_0x152160){if(_0x152160){return _0x152160[_0x11a6('0x1b')](_0x312cc6)[_0x11a6('0x1c')](function(_0x25a4c5){return _0x25a4c5;});}return null;};}function removeEntity(_0x1e8b38){return function(_0x595d3c){if(_0x595d3c){return _0x595d3c[_0x11a6('0x1d')]()[_0x11a6('0x1c')](function(){_0x1e8b38[_0x11a6('0x12')](0xcc)[_0x11a6('0x13')]();});}};}function handleEntityNotFound(_0x4e37f8){return function(_0x540516){if(!_0x540516){_0x4e37f8[_0x11a6('0x11')](0x194);}return _0x540516;};}function handleError(_0x521f50,_0x707dd2){_0x707dd2=_0x707dd2||0x1f4;return function(_0x4c42ec){logger['error'](_0x4c42ec['stack']);if(_0x4c42ec['name']){delete _0x4c42ec[_0x11a6('0x1e')];}_0x521f50['status'](_0x707dd2)[_0x11a6('0x1f')](_0x4c42ec);};}function getInteractionUsers(_0x364375,_0x5dbc63){return new BPromise(function(_0x5281d7,_0x2ffd7f){try{if(_0x5dbc63[_0x364375['id']]){_0x364375[_0x11a6('0x20')]=_[_0x11a6('0x21')](_0x5dbc63[_0x364375['id']],function(_0x2715d5){return{'id':_0x2715d5['id'],'fullname':_0x2715d5[_0x11a6('0x22')]};});}}catch(_0x407ae0){_0x2ffd7f(_0x407ae0);}_0x5281d7(_0x364375);});}function getInteractionTags(_0x40e3b4,_0x131e5f){return new BPromise(function(_0x111e74,_0x349915){try{if(_0x40e3b4[_0x11a6('0x23')]){_0x40e3b4[_0x11a6('0x24')]=[];_0x40e3b4[_0x11a6('0x23')][_0x11a6('0x25')](',')[_0x11a6('0x26')](function(_0x453453){_0x40e3b4[_0x11a6('0x24')][_0x11a6('0x27')](_0x131e5f[_0x453453]);});}delete _0x40e3b4[_0x11a6('0x23')];}catch(_0x2bfdf6){_0x349915(_0x2bfdf6);}_0x111e74(_0x40e3b4);});}function getLastMessageText(_0x270533){return new BPromise(function(_0x3869a0,_0x2d7ab7){return db[_0x11a6('0x28')][_0x11a6('0x29')]({'where':{'$and':[{'MailInteractionId':_0x270533['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x11a6('0x2a')],'order':'-id','raw':!![]})[_0x11a6('0x1c')](function(_0x459bde){if(_0x459bde&&_0x459bde[_0x11a6('0x2a')]){_0x270533[_0x11a6('0x2b')]=_[_0x11a6('0x2c')](_0x459bde['plainBody']);}_0x3869a0(_0x270533);})[_0x11a6('0x2d')](function(_0x3bc3d2){_0x2d7ab7(_0x3bc3d2);});});}function updateMailInteraction(_0x4e53bf,_0x478b0a,_0x50e37d,_0x3f4ac6){return new BPromise(function(_0x471d94,_0x4c5d5b){return getInteractionUsers(_0x4e53bf,_0x50e37d)[_0x11a6('0x1c')](function(_0x16f911){return getInteractionTags(_0x16f911,_0x478b0a);})[_0x11a6('0x1c')](function(_0x3f04bd){return getStateInteraction(_0x3f04bd);})[_0x11a6('0x1c')](function(_0x4c44fc){if(_0x3f4ac6){_0x471d94(getLastMessageText(_0x4c44fc));}else{_0x471d94(_0x4c44fc);}})[_0x11a6('0x2d')](function(_0x226546){_0x4c5d5b(_0x226546);});});}function getStateInteraction(_0x46d825){return new BPromise(function(_0x2449fb){_0x46d825[_0x11a6('0x2e')]=0x0;_0x46d825[_0x11a6('0x2f')]=0x0;_0x46d825[_0x11a6('0x30')]=0x0;_0x46d825[_0x11a6('0x31')]=0x0;_0x46d825[_0x11a6('0x32')]=0x0;if(!_0x46d825[_0x11a6('0x33')]&&!_0x46d825[_0x11a6('0x34')]){_0x46d825[_0x11a6('0x2e')]+=0x1;}if(!_0x46d825[_0x11a6('0x33')]&&_0x46d825['UserId']){_0x46d825[_0x11a6('0x2f')]+=0x1;if(_0x46d825[_0x11a6('0x2e')]){_0x46d825[_0x11a6('0x2e')]-=0x1;}}if(_0x46d825[_0x11a6('0x33')]&&_0x46d825[_0x11a6('0x34')]){_0x46d825[_0x11a6('0x30')]+=0x1;if(_0x46d825[_0x11a6('0x2f')]){_0x46d825[_0x11a6('0x2f')]-=0x1;}}if(_0x46d825[_0x11a6('0x33')]&&!_0x46d825['UserId']){_0x46d825[_0x11a6('0x31')]+=0x1;if(_0x46d825[_0x11a6('0x2e')]){_0x46d825['waiting']-=0x1;}}_0x46d825[_0x11a6('0x32')]+=0x1;_0x2449fb(_0x46d825);});}exports[_0x11a6('0x35')]=function(_0x38aaa7,_0x4bbe0e){var _0x3cd532={},_0x97e288={},_0x5eb8e9={'count':0x0,'rows':[]};var _0x5dbdda=_[_0x11a6('0x21')](db['MailInteraction'][_0x11a6('0x36')],function(_0x2221e3){return{'name':_0x2221e3['fieldName'],'type':_0x2221e3[_0x11a6('0x37')]['key']};});_0x97e288[_0x11a6('0x38')]=_[_0x11a6('0x21')](_0x5dbdda,'name');_0x97e288[_0x11a6('0x39')]=_[_0x11a6('0x3a')](_0x38aaa7[_0x11a6('0x39')]);_0x97e288[_0x11a6('0x3b')]=_[_0x11a6('0x3c')](_0x97e288[_0x11a6('0x38')],_0x97e288[_0x11a6('0x39')]);_0x3cd532['attributes']=_[_0x11a6('0x3c')](_0x97e288[_0x11a6('0x38')],qs['fields'](_0x38aaa7[_0x11a6('0x39')][_0x11a6('0x3d')]));_0x3cd532['attributes']=_0x3cd532[_0x11a6('0x3e')][_0x11a6('0x3f')]?_0x3cd532[_0x11a6('0x3e')]:_0x97e288['model'];if(!_0x38aaa7['query']['hasOwnProperty']('nolimit')){_0x3cd532[_0x11a6('0x16')]=qs['limit'](_0x38aaa7[_0x11a6('0x39')][_0x11a6('0x16')]);_0x3cd532['offset']=qs['offset'](_0x38aaa7['query'][_0x11a6('0x18')]);}_0x3cd532[_0x11a6('0x40')]=qs['sort'](_0x38aaa7[_0x11a6('0x39')]['sort']);_0x3cd532[_0x11a6('0x41')]=qs['filters'](_[_0x11a6('0x42')](_0x38aaa7[_0x11a6('0x39')],_0x97e288['filters']),_0x5dbdda);var _0x40043f=[];var _0x47c6a2=squel[_0x11a6('0x43')]()[_0x11a6('0x44')]('id')[_0x11a6('0x44')](_0x11a6('0x1e'))['field'](_0x11a6('0x45'))[_0x11a6('0x46')](_0x11a6('0x47'));var _0x22fe68=squel[_0x11a6('0x43')]()[_0x11a6('0x44')]('u.id')[_0x11a6('0x44')](_0x11a6('0x48'))[_0x11a6('0x44')]('ui.MailInteractionId')[_0x11a6('0x46')](_0x11a6('0x49'),'ui')[_0x11a6('0x4a')](_0x11a6('0x4b'),'u',_0x11a6('0x4c'));var _0x2d8316=squel[_0x11a6('0x43')]()[_0x11a6('0x46')](_0x11a6('0x4d'),'i')[_0x11a6('0x4a')](_0x11a6('0x4e'),'c',_0x11a6('0x4f'))[_0x11a6('0x4a')](_0x11a6('0x4b'),'o',_0x11a6('0x50'))[_0x11a6('0x4a')](_0x11a6('0x51'),'a',_0x11a6('0x52'))['left_join'](_0x11a6('0x53'),'me','me.MailInteractionId\x20=\x20i.id')[_0x11a6('0x4a')]('mail_interaction_has_tags','it',_0x11a6('0x54'))[_0x11a6('0x4a')](_0x11a6('0x47'),'t',_0x11a6('0x55'));var _0x5825ed=squel[_0x11a6('0x56')]();var _0x2d9464=[];var _0x5a7044=squel[_0x11a6('0x56')]();var _0x18064c;if(_0x38aaa7[_0x11a6('0x39')][_0x11a6('0x57')]){_0x18064c=as[_0x11a6('0x58')](_0x38aaa7['query'][_0x11a6('0x57')]);var _0x3ac3be=_0x18064c[_0x11a6('0x59')];for(var _0x369355=0x0;_0x369355<_0x18064c[_0x11a6('0x5a')]['length'];_0x369355++){var _0x1d66ff=_0x18064c[_0x11a6('0x5a')][_0x369355];var _0x3ee886='i';var _0x439705=_[_0x11a6('0x5b')](_0x5dbdda,[_0x11a6('0x1e'),_0x1d66ff['field']]);if(!_0x439705){switch(_0x1d66ff[_0x11a6('0x44')]){case _0x11a6('0x5c'):if(_0x1d66ff[_0x11a6('0x5d')]==0x1){_0x2d8316[_0x11a6('0x5e')]('`'+_0x1d66ff[_0x11a6('0x44')]+_0x11a6('0x5f'));}else{_0x2d8316[_0x11a6('0x5e')]('`'+_0x1d66ff[_0x11a6('0x44')]+'`\x20>\x200');}break;case _0x11a6('0x60'):if(_0x1d66ff[_0x11a6('0x61')]===_0x11a6('0x62')){if(_0x1d66ff['value'][_0x11a6('0x25')]('\x20')[_0x11a6('0x3f')]>0x1){_0x5825ed[_0x3ac3be](_0x11a6('0x63'),qs['getFullTextValue'](_0x1d66ff[_0x11a6('0x5d')]),null);}else{var _0x2d89c0='%'+_0x1d66ff[_0x11a6('0x5d')]+'%';_0x5825ed[_0x3ac3be](_0x11a6('0x64'),_0x2d89c0,_0x2d89c0,_0x2d89c0);}}else{_0x439705=_[_0x11a6('0x5b')](_0x5dbdda,[_0x11a6('0x1e'),'ContactId']);_0x1d66ff[_0x11a6('0x44')]=_0x11a6('0x65');_0x2f52df=as[_0x11a6('0x66')](_0x3ee886,_0x439705['type'],_0x1d66ff);_0x5825ed[_0x3ac3be](_0x2f52df[_0x11a6('0x67')],_0x2f52df[_0x11a6('0x5d')][_0x11a6('0x68')],_0x2f52df[_0x11a6('0x5d')][_0x11a6('0x13')]);}break;case'Tag':var _0x3cc318=_0x1d66ff[_0x11a6('0x5d')][_0x11a6('0x25')](',')[_0x11a6('0x21')](function(_0x1c1a69){return Number(_0x1c1a69);});_0x3cc318[_0x11a6('0x26')](function(_0xad18db){_0x5a7044['or'](_0x11a6('0x69'),'%,'+_0xad18db+',%');});_0x2d9464=_[_0x11a6('0x6a')](_0x2d9464,_0x3cc318);break;case'User':if(_0x1d66ff[_0x11a6('0x61')]===_0x11a6('0x62')){_0x5825ed[_0x3ac3be](_0x11a6('0x6b'),'%'+_0x1d66ff[_0x11a6('0x5d')]+'%',null);}else{_0x439705=_[_0x11a6('0x5b')](_0x5dbdda,[_0x11a6('0x1e'),_0x11a6('0x34')]);_0x1d66ff[_0x11a6('0x44')]=_0x11a6('0x34');_0x2f52df=as[_0x11a6('0x66')](_0x3ee886,_0x439705[_0x11a6('0x37')],_0x1d66ff);_0x5825ed[_0x3ac3be](_0x2f52df[_0x11a6('0x67')],_0x2f52df['value'][_0x11a6('0x68')],_0x2f52df[_0x11a6('0x5d')][_0x11a6('0x13')]);}break;case'plainBody':_0x2f52df=as[_0x11a6('0x66')]('me',null,_0x1d66ff);_0x5825ed[_0x3ac3be](_0x2f52df[_0x11a6('0x67')],_0x2f52df['value']['start'],_0x2f52df['value'][_0x11a6('0x13')]);break;}}else{var _0x2f52df=as[_0x11a6('0x66')](_0x3ee886,_0x439705[_0x11a6('0x37')],_0x1d66ff);_0x5825ed[_0x3ac3be](_0x2f52df[_0x11a6('0x67')],_0x2f52df[_0x11a6('0x5d')][_0x11a6('0x68')],_0x2f52df[_0x11a6('0x5d')][_0x11a6('0x13')]);}}}else{var _0x28119b=_(_0x38aaa7['query'])[_0x11a6('0x3a')]()[_0x11a6('0x21')](function(_0x2e26d9){return _['some'](_0x5dbdda,[_0x11a6('0x1e'),_0x2e26d9])?_0x2e26d9:undefined;})[_0x11a6('0x6c')]()[_0x11a6('0x5d')]();if(!_[_0x11a6('0x6d')](_0x28119b)){_0x28119b[_0x11a6('0x26')](function(_0x2e504d){if(_0x2e504d===_0x11a6('0x6e')){_0x2d8316[_0x11a6('0x41')](_0x11a6('0x6f'),[][_0x11a6('0x70')](_0x38aaa7[_0x11a6('0x39')][_0x2e504d]));}else if(_0x2e504d===_0x11a6('0x71')){var _0x4f773e=JSON[_0x11a6('0x72')](_0x38aaa7[_0x11a6('0x39')][_0x2e504d])[_0x11a6('0x73')];var _0x472a52=JSON[_0x11a6('0x72')](_0x38aaa7['query'][_0x2e504d])[_0x11a6('0x74')];_0x2d8316[_0x11a6('0x41')](_0x11a6('0x75'),_0x4f773e,_0x472a52);}else{if(_0x38aaa7[_0x11a6('0x39')][_0x2e504d]===_0x11a6('0x76')){_0x2d8316['where']('i.'+_0x2e504d+_0x11a6('0x77'));}else{_0x2d8316['where']('i.'+_0x2e504d+'\x20=\x20?',_0x38aaa7[_0x11a6('0x39')][_0x2e504d]);}}});}if(_0x38aaa7[_0x11a6('0x39')]['read']){if(_0x38aaa7[_0x11a6('0x39')][_0x11a6('0x78')]==0x1){_0x2d8316[_0x11a6('0x5e')](_0x11a6('0x79'));}else{_0x2d8316[_0x11a6('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x38aaa7[_0x11a6('0x39')]['tag']){_0x2d9464=_['isArray'](_0x38aaa7['query']['tag'])?_0x38aaa7[_0x11a6('0x39')][_0x11a6('0x7a')]:new Array(_0x38aaa7[_0x11a6('0x39')][_0x11a6('0x7a')]);_0x2d9464[_0x11a6('0x26')](function(_0x54e123){_0x5a7044['or'](_0x11a6('0x69'),'%,'+_0x54e123+',%');});}if(_0x38aaa7[_0x11a6('0x39')]['filter']){var _0x1a273b=_0x38aaa7['query'][_0x11a6('0x7b')][_0x11a6('0x7c')]('\x5c','\x5c\x5c')[_0x11a6('0x7c')](/'/g,'\x27\x27');if(qs[_0x11a6('0x7d')](_0x1a273b)){_0x5825ed['or']('i.id\x20LIKE\x20?',_0x1a273b+'%');}else if(qs[_0x11a6('0x7e')](_0x1a273b)){_0x5825ed['or']('c.email\x20LIKE\x20?',_0x1a273b+'%');}else{_0x5825ed['or'](_0x11a6('0x7f'),qs[_0x11a6('0x80')](_0x1a273b))['or'](_0x11a6('0x81'),qs[_0x11a6('0x80')](_0x1a273b));}}}_0x2d8316[_0x11a6('0x41')](_0x5825ed);_0x2d8316['group'](_0x11a6('0x82'));var _0x41c954={'type':db[_0x11a6('0x83')][_0x11a6('0x84')][_0x11a6('0x85')],'raw':!![]};var _0x3172e7=_0x2d8316[_0x11a6('0x86')]();_0x3172e7[_0x11a6('0x44')](_0x11a6('0x82'));_0x3172e7[_0x11a6('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x11a6('0x5c'));if(_0x3cd532[_0x11a6('0x40')]){_0x3cd532[_0x11a6('0x40')][_0x11a6('0x26')](function(_0x5d4471){var _0x32fe09=_0x5d4471[0x0]===_0x11a6('0x87')?_0x5d4471[0x0]:'i.'+_0x5d4471[0x0];_0x2d8316[_0x11a6('0x40')](_0x32fe09,_0x5d4471[0x1]==='DESC'?![]:!![]);});}if(!_[_0x11a6('0x6d')](_0x2d9464)){_0x2d8316[_0x11a6('0x5e')](_0x5a7044);_0x3172e7[_0x11a6('0x41')](_0x11a6('0x88'),_0x2d9464);}BPromise[_0x11a6('0x89')]()[_0x11a6('0x1c')](function(){if(!_0x18064c){if(_0x38aaa7[_0x11a6('0x39')][_0x11a6('0x6e')])return;_0x3172e7[_0x11a6('0x41')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x2d8316['where'](_0x11a6('0x8a'));return;}if(_0x38aaa7[_0x11a6('0x8b')][_0x11a6('0x8c')]!==_0x11a6('0x8d'))return;return _0x38aaa7[_0x11a6('0x8b')][_0x11a6('0x8e')]({'attributes':['id'],'raw':!![]})[_0x11a6('0x1c')](function(_0x2bca49){if(_[_0x11a6('0x6d')](_0x2bca49)){_0x3172e7[_0x11a6('0x41')](_0x11a6('0x8f'));_0x2d8316[_0x11a6('0x41')](_0x11a6('0x8f'));}else{_0x3172e7['where'](_0x11a6('0x6f'),_['map'](_0x2bca49,'id'));_0x2d8316[_0x11a6('0x41')]('i.MailAccountId\x20IN\x20?',_['map'](_0x2bca49,'id'));}});})[_0x11a6('0x1c')](function(){if(_0x38aaa7[_0x11a6('0x8b')][_0x11a6('0x8c')]===_0x11a6('0x8d')&&!_0x18064c&&!_0x38aaa7[_0x11a6('0x39')][_0x11a6('0x6e')])return[];return db[_0x11a6('0x90')][_0x11a6('0x39')](_0x3172e7[_0x11a6('0x91')](),_0x41c954);})[_0x11a6('0x1c')](function(_0x4fed71){_0x5eb8e9[_0x11a6('0x17')]=_0x4fed71[_0x11a6('0x3f')];if(_0x5eb8e9['count']===0x0)return[];return db[_0x11a6('0x90')][_0x11a6('0x39')](_0x47c6a2[_0x11a6('0x91')](),_0x41c954)[_0x11a6('0x1c')](function(_0x2d71fc){_0x40043f=_[_0x11a6('0x92')](_0x2d71fc,'id');_0x41c954=_['merge'](_0x41c954,{'model':db[_0x11a6('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38aaa7[_0x11a6('0x39')]['fields']){_0x3cd532[_0x11a6('0x3e')][_0x11a6('0x26')](function(_0x1773a0){_0x2d8316['field']('i.'+_0x1773a0);});}else{_0x2d8316[_0x11a6('0x44')](_0x11a6('0x94'),_0x11a6('0x5c'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0x95'),_0x11a6('0x96'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0x97'),'Account.mandatoryDisposition');_0x2d8316['field'](_0x11a6('0x98'),_0x11a6('0x87'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0x82'));_0x2d8316[_0x11a6('0x44')]('i.createdAt');_0x2d8316[_0x11a6('0x44')](_0x11a6('0x99'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0x9a'));_0x2d8316[_0x11a6('0x44')]('i.closedAt');_0x2d8316[_0x11a6('0x44')](_0x11a6('0x9b'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0x9c'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0x9d'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0x9e'));_0x2d8316['field'](_0x11a6('0x9f'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0xa0'));_0x2d8316[_0x11a6('0x44')]('i.thirdDisposition');_0x2d8316[_0x11a6('0x44')](_0x11a6('0xa1'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0xa2'));_0x2d8316['field']('i.ContactId');_0x2d8316[_0x11a6('0x44')](_0x11a6('0xa3'));_0x2d8316[_0x11a6('0x44')]('i.UserId');_0x2d8316[_0x11a6('0x44')]('c.firstName',_0x11a6('0xa4'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0xa5'),'Contact.lastName');_0x2d8316[_0x11a6('0x44')](_0x11a6('0xa6'),_0x11a6('0xa7'));_0x2d8316['field']('c.phone',_0x11a6('0xa8'));_0x2d8316[_0x11a6('0x44')]('c.mobile',_0x11a6('0xa9'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0xaa'),_0x11a6('0xab'));_0x2d8316[_0x11a6('0x44')]('o.fullname',_0x11a6('0xac'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0xad'),_0x11a6('0xae'));_0x2d8316[_0x11a6('0x44')](_0x11a6('0xaf'),_0x11a6('0x23'));}if(_0x3cd532[_0x11a6('0x16')])_0x2d8316['limit'](_0x3cd532[_0x11a6('0x16')]);if(_0x3cd532[_0x11a6('0x18')])_0x2d8316['offset'](_0x3cd532[_0x11a6('0x18')]);return db[_0x11a6('0x90')][_0x11a6('0x39')](_0x2d8316[_0x11a6('0x91')](),_0x41c954);})[_0x11a6('0x1c')](function(_0x213f9a){if(_0x213f9a[_0x11a6('0x3f')]>0x0)_0x22fe68['where'](_0x11a6('0xb0'),_['map'](_0x213f9a,'id'));return db['sequelize'][_0x11a6('0x39')](_0x22fe68[_0x11a6('0x91')](),_0x41c954)[_0x11a6('0x1c')](function(_0x2e0e01){var _0x2bd0eb=_['groupBy'](_0x2e0e01,_0x11a6('0xb1'));var _0x34f440=[];return db[_0x11a6('0xb2')][_0x11a6('0x29')]({'attributes':[_0x11a6('0xb3')],'raw':!![]})[_0x11a6('0x1c')](function(_0x533ddd){var _0x148e98=_0x533ddd[_0x11a6('0xb3')];_0x213f9a['forEach'](function(_0xc7b6c7){_0x34f440[_0x11a6('0x27')](updateMailInteraction(_0xc7b6c7,_0x40043f,_0x2bd0eb,_0x148e98));});return BPromise[_0x11a6('0xb4')](_0x34f440);});});});})[_0x11a6('0x1c')](function(_0x2abc85){_0x5eb8e9['rows']=_0x2abc85;return _0x5eb8e9;})[_0x11a6('0x1c')](respondWithFilteredResult(_0x4bbe0e,_0x3cd532))[_0x11a6('0x2d')](handleError(_0x4bbe0e,null));};exports[_0x11a6('0xb5')]=function(_0x3586ac,_0x43149f){var _0x3b212f={'raw':![],'where':{'id':_0x3586ac[_0x11a6('0xb6')]['id']}},_0x47489d={};_0x47489d[_0x11a6('0x38')]=_[_0x11a6('0x3a')](db['MailInteraction']['rawAttributes']);_0x47489d[_0x11a6('0x39')]=_[_0x11a6('0x3a')](_0x3586ac['query']);_0x47489d['filters']=_[_0x11a6('0x3c')](_0x47489d[_0x11a6('0x38')],_0x47489d[_0x11a6('0x39')]);_0x3b212f['attributes']=_[_0x11a6('0x3c')](_0x47489d[_0x11a6('0x38')],qs[_0x11a6('0x3d')](_0x3586ac['query'][_0x11a6('0x3d')]));_0x3b212f[_0x11a6('0x3e')]=_0x3b212f[_0x11a6('0x3e')][_0x11a6('0x3f')]?_0x3b212f[_0x11a6('0x3e')]:_0x47489d[_0x11a6('0x38')];if(_0x3586ac[_0x11a6('0x39')][_0x11a6('0xb7')]){_0x3b212f[_0x11a6('0xb8')]=[{'all':!![]}];}_0x3b212f=_[_0x11a6('0xb9')]({},_0x3b212f,_0x3586ac[_0x11a6('0xba')]);return db[_0x11a6('0x93')][_0x11a6('0x5b')](_0x3b212f)[_0x11a6('0x1c')](handleEntityNotFound(_0x43149f,null))[_0x11a6('0x1c')](respondWithResult(_0x43149f,null))[_0x11a6('0x2d')](handleError(_0x43149f,null));};exports[_0x11a6('0xbb')]=function(_0x5532e4,_0x13c8cc){return db[_0x11a6('0x93')][_0x11a6('0xbb')](_0x5532e4[_0x11a6('0xbc')],{})[_0x11a6('0x1c')](respondWithResult(_0x13c8cc,0xc9))[_0x11a6('0x2d')](handleError(_0x13c8cc,null));};exports[_0x11a6('0x1b')]=function(_0x4add15,_0x3983ad){if(_0x4add15[_0x11a6('0xbc')]['id']){delete _0x4add15['body']['id'];}return db[_0x11a6('0x93')][_0x11a6('0x5b')]({'where':{'id':_0x4add15['params']['id']}})[_0x11a6('0x1c')](handleEntityNotFound(_0x3983ad,null))['then'](saveUpdates(_0x4add15[_0x11a6('0xbc')],null))[_0x11a6('0x1c')](respondWithResult(_0x3983ad,null))[_0x11a6('0x2d')](handleError(_0x3983ad,null));};exports[_0x11a6('0x1d')]=function(_0x1b3cd7,_0x107c45){return db[_0x11a6('0x93')][_0x11a6('0x5b')]({'where':{'id':_0x1b3cd7[_0x11a6('0xb6')]['id']}})[_0x11a6('0x1c')](handleEntityNotFound(_0x107c45,null))[_0x11a6('0x1c')](removeEntity(_0x107c45,null))[_0x11a6('0x2d')](handleError(_0x107c45,null));};exports[_0x11a6('0xbd')]=function(_0x386b4b,_0x35404e){return db['MailInteraction'][_0x11a6('0xbd')]()[_0x11a6('0x1c')](respondWithResult(_0x35404e,null))['catch'](handleError(_0x35404e,null));};exports[_0x11a6('0xbe')]=function(_0x453988,_0x5da508){return db[_0x11a6('0x28')][_0x11a6('0x5b')]({'where':{'id':_0x453988[_0x11a6('0xb6')]['id']}})[_0x11a6('0x1c')](handleEntityNotFound(_0x5da508,null))[_0x11a6('0x1c')](function(_0x43b5da){if(_0x43b5da){return _0x43b5da[_0x11a6('0xbe')](_0x453988[_0x11a6('0xbc')][_0x11a6('0xbf')],_[_0x11a6('0xc0')](_0x453988[_0x11a6('0xbc')],['ids','id'])||{});}})[_0x11a6('0x1c')](respondWithResult(_0x5da508,null))[_0x11a6('0x2d')](handleError(_0x5da508,null));};exports[_0x11a6('0xc1')]=function(_0x112b2e,_0x4b542e){var _0xc4bb86={'raw':![],'where':{}};var _0x476037={};var _0x527d34={'count':0x0,'rows':[]};return db[_0x11a6('0x93')]['findOne']({'where':{'id':_0x112b2e['params']['id']}})[_0x11a6('0x1c')](handleEntityNotFound(_0x4b542e,null))['then'](function(_0x5106e3){if(_0x5106e3){_0x476037[_0x11a6('0x38')]=_[_0x11a6('0x3a')](db[_0x11a6('0x28')][_0x11a6('0x36')]);_0x476037[_0x11a6('0x39')]=_[_0x11a6('0x3a')](_0x112b2e[_0x11a6('0x39')]);_0x476037['filters']=_[_0x11a6('0x3c')](_0x476037[_0x11a6('0x38')],_0x476037[_0x11a6('0x39')]);_0xc4bb86['attributes']=_['intersection'](_0x476037[_0x11a6('0x38')],qs[_0x11a6('0x3d')](_0x112b2e['query'][_0x11a6('0x3d')]));_0xc4bb86[_0x11a6('0x3e')]=_0xc4bb86[_0x11a6('0x3e')][_0x11a6('0x3f')]?_0xc4bb86[_0x11a6('0x3e')]:_0x476037[_0x11a6('0x38')];if(!_0x112b2e[_0x11a6('0x39')][_0x11a6('0xc2')](_0x11a6('0xc3'))){_0xc4bb86[_0x11a6('0x16')]=qs[_0x11a6('0x16')](_0x112b2e[_0x11a6('0x39')][_0x11a6('0x16')]);_0xc4bb86[_0x11a6('0x18')]=qs[_0x11a6('0x18')](_0x112b2e[_0x11a6('0x39')][_0x11a6('0x18')]);}_0xc4bb86[_0x11a6('0x40')]=qs[_0x11a6('0xc4')](_0x112b2e['query'][_0x11a6('0xc4')]);_0xc4bb86[_0x11a6('0x41')]=qs[_0x11a6('0x3b')](_['pick'](_0x112b2e['query'],_0x476037[_0x11a6('0x3b')]));_0xc4bb86['where'][_0x11a6('0xb1')]=_0x5106e3['id'];if(_0x112b2e[_0x11a6('0x39')][_0x11a6('0x7b')]){_0xc4bb86[_0x11a6('0x41')]=_['merge'](_0xc4bb86['where'],{'$or':_[_0x11a6('0x21')](_0xc4bb86[_0x11a6('0x3e')],function(_0xd4c4af){var _0x296620={};_0x296620[_0xd4c4af]={'$like':'%'+_0x112b2e['query'][_0x11a6('0x7b')]+'%'};return _0x296620;})});}if(_0x112b2e[_0x11a6('0x39')]['$gte']){var _0x3e40b8=_0x112b2e[_0x11a6('0x39')][_0x11a6('0x73')][_0x11a6('0x25')](',');var _0x3c8bd1={};_0x3c8bd1[_0x3e40b8[0x0]]={'$gte':moment(_0x3e40b8[0x1])[_0x11a6('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0xc4bb86[_0x11a6('0x41')]=_['merge'](_0xc4bb86[_0x11a6('0x41')],_0x3c8bd1);}_0xc4bb86=_[_0x11a6('0xb9')]({},_0xc4bb86,_0x112b2e[_0x11a6('0xba')]);return db[_0x11a6('0x28')][_0x11a6('0x17')]({'where':_0xc4bb86['where']})[_0x11a6('0x1c')](function(_0x372a48){_0x527d34[_0x11a6('0x17')]=_0x372a48;if(_0x112b2e[_0x11a6('0x39')][_0x11a6('0xb7')]){_0xc4bb86[_0x11a6('0xb8')]=[{'all':!![]}];}return db[_0x11a6('0x28')]['findAll'](_0xc4bb86);})[_0x11a6('0x1c')](function(_0x32db27){if(_0x112b2e[_0x11a6('0x39')][_0x11a6('0xc6')]===_0x11a6('0xc7')){for(var _0x548f0c=0x0;_0x548f0c<_0x32db27['length'];_0x548f0c++){_0x32db27[_0x548f0c][_0x11a6('0xbc')]=juice(_0x32db27[_0x548f0c]['body']);}}_0x527d34[_0x11a6('0xc8')]=_0x32db27;return _0x527d34;});}})[_0x11a6('0x1c')](respondWithFilteredResult(_0x4b542e,_0xc4bb86))[_0x11a6('0x2d')](handleError(_0x4b542e,null));};exports[_0x11a6('0xc9')]=function(_0x458f7f,_0x2d973f){return db[_0x11a6('0x93')][_0x11a6('0x5b')]({'where':{'id':_0x458f7f[_0x11a6('0xb6')]['id']}})[_0x11a6('0x1c')](handleEntityNotFound(_0x2d973f,null))[_0x11a6('0x1c')](function(_0x597e2a){if(_0x597e2a){return _0x597e2a['setTags'](_0x458f7f[_0x11a6('0xbc')][_0x11a6('0xbf')],_[_0x11a6('0xc0')](_0x458f7f[_0x11a6('0xbc')],[_0x11a6('0xbf'),'id'])||{})[_0x11a6('0xca')](function(){return db[_0x11a6('0xcb')]['findAll']({'attributes':['id',_0x11a6('0x1e'),_0x11a6('0x45')],'where':{'id':_0x458f7f[_0x11a6('0xbc')][_0x11a6('0xbf')]}});})['then'](function(_0x51b8f3){socket[_0x11a6('0xcc')](_0x11a6('0xcd'),{'id':Number(_0x458f7f[_0x11a6('0xb6')]['id']),'tags':_0x51b8f3||[]});return{'id':Number(_0x458f7f['params']['id']),'tags':_0x51b8f3||[]};});}})['then'](respondWithResult(_0x2d973f,null))['catch'](handleError(_0x2d973f,null));};exports['removeTags']=function(_0x87a364,_0x15d30a){return db['MailInteraction'][_0x11a6('0x5b')]({'where':{'id':_0x87a364['params']['id']}})['then'](handleEntityNotFound(_0x15d30a,null))[_0x11a6('0x1c')](function(_0x3b74eb){if(_0x3b74eb){return _0x3b74eb[_0x11a6('0xce')](_0x87a364[_0x11a6('0x39')][_0x11a6('0xbf')]);}})[_0x11a6('0x1c')](respondWithStatusCode(_0x15d30a,null))[_0x11a6('0x2d')](handleError(_0x15d30a,null));};exports['download']=function(_0x32edd2,_0x2dde49){var _0x25173f=moment()['unix']()['toString']();var _0x29c8b6=path['join'](config[_0x11a6('0xcf')],_0x11a6('0xd0'),_0x11a6('0xd1'),_0x11a6('0xd2'));var _0x22729a=path[_0x11a6('0xd3')](config[_0x11a6('0xcf')],'server',_0x11a6('0xd1'),_0x11a6('0xd4'));var _0x15ed11=path[_0x11a6('0xd3')](_0x29c8b6,_0x25173f);var _0x41fc52=util[_0x11a6('0xc5')](_0x11a6('0xd5'),_0x32edd2['params']['id'],_0x25173f);var _0x212c1e=path[_0x11a6('0xd3')](_0x29c8b6,_0x41fc52);var _0x20b5a7=[];if(_0x32edd2['query'][_0x11a6('0xd4')]){_0x20b5a7[_0x11a6('0x27')]({'model':db[_0x11a6('0xd6')],'as':_0x11a6('0xd7'),'raw':!![]});}var _0x94cca4=[{'model':db['MailMessage'],'as':_0x11a6('0xd8'),'attributes':['id',_0x11a6('0xbc'),_0x11a6('0x46'),'to','cc',_0x11a6('0xd9'),'subject',_0x11a6('0x71')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x20b5a7}];return db[_0x11a6('0x93')]['find']({'where':{'id':_0x32edd2[_0x11a6('0xb6')]['id']},'include':_0x94cca4})[_0x11a6('0x1c')](handleEntityNotFound(_0x2dde49,null))[_0x11a6('0x1c')](function(_0x440769){if(_0x440769&&_0x440769[_0x11a6('0xd8')]){var _0x30a7f3=_0x440769[_0x11a6('0xda')]({'plain':!![]});fs['mkdirSync'](_0x15ed11);return BPromise[_0x11a6('0xdb')](_0x30a7f3[_0x11a6('0xd8')],function(_0x4bac91,_0x298cfd){var _0x2954c7={'from':_0x4bac91[_0x11a6('0x46')],'to':_0x4bac91['to'],'subject':_0x4bac91['subject'],'html':htmlEntities['decode'](_0x4bac91['body']),'headers':{'Date':moment(_0x4bac91['createdAt'])[_0x11a6('0xc5')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4bac91['cc']){_0x2954c7[_0x11a6('0xdc')]['Cc']=_0x4bac91['cc'];}if(_0x4bac91[_0x11a6('0xd9')]){_0x2954c7['headers']['Bcc']=_0x4bac91[_0x11a6('0xd9')];}return new BPromise(function(_0x20af8a,_0x7d1cf3){if(_0x4bac91['Attachments']){for(var _0x3561ba=0x0;_0x3561ba<_0x4bac91[_0x11a6('0xd7')]['length'];_0x3561ba++){var _0x2fe53d=_0x4bac91[_0x11a6('0xd7')][_0x3561ba];var _0x4cdbda=path['join'](_0x22729a,_0x2fe53d[_0x11a6('0xdd')]);if(fs['existsSync'](_0x4cdbda)){_0x2954c7['attachments'][_0x11a6('0x27')]({'name':_0x2fe53d[_0x11a6('0x1e')],'contentType':_0x2fe53d['type'],'data':fs['readFileSync'](_0x4cdbda)});}}}emlformat['build'](_0x2954c7,function(_0x53c60f,_0x187cb8){if(_0x53c60f)return _0x7d1cf3(_0x53c60f);fs[_0x11a6('0xde')](path[_0x11a6('0xd3')](_0x15ed11,util[_0x11a6('0xc5')]('message%d.eml',_0x298cfd)),_0x187cb8);return _0x20af8a(_0x187cb8);});});})['then'](function(){return new BPromise(function(_0x4cda0a,_0x47e1ac){zipdir(_0x15ed11,{'saveTo':_0x212c1e},function(_0x31a59c,_0x15075f){if(_0x31a59c)return _0x47e1ac(_0x31a59c);return _0x4cda0a(_0x15075f);});})['then'](function(){return new BPromise(function(_0x4ba295,_0x375132){rimraf(_0x15ed11,function(_0x3522b5){if(_0x3522b5)_0x375132(_0x3522b5);return _0x4ba295();});});})['then'](function(){return _0x2dde49[_0x11a6('0xdf')](_0x212c1e,_0x41fc52,function(_0x24af01){if(!_0x24af01)fs[_0x11a6('0xe0')](_0x212c1e);});});});}else{return _0x2dde49['sendStatus'](0xc8);}})['catch'](handleError(_0x2dde49,null));};
\ No newline at end of file
+var _0xce22=['rimraf','zip-dir','moment','bluebird','path','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','name','send','map','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','plainBody','-id','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.MailInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','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','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','MailInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','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','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','rows','show','includeAll','include','create','body','destroy','params','describe','addMessage','ids','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','addTags','omit','spread','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','writeFileSync','eml-format'];(function(_0x243f4e,_0x33b570){var _0x245ad1=function(_0x28cf76){while(--_0x28cf76){_0x243f4e['push'](_0x243f4e['shift']());}};_0x245ad1(++_0x33b570);}(_0xce22,0xea));var _0x2ce2=function(_0x5a710e,_0x2b74e0){_0x5a710e=_0x5a710e-0x0;var _0x3e8a16=_0xce22[_0x5a710e];return _0x3e8a16;};'use strict';var emlformat=require(_0x2ce2('0x0'));var rimraf=require(_0x2ce2('0x1'));var zipdir=require(_0x2ce2('0x2'));var moment=require(_0x2ce2('0x3'));var BPromise=require(_0x2ce2('0x4'));var util=require('util');var path=require(_0x2ce2('0x5'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2ce2('0x6'));var juice=require(_0x2ce2('0x7'));var Redis=require(_0x2ce2('0x8'));var qs=require(_0x2ce2('0x9'));var as=require(_0x2ce2('0xa'));var logger=require(_0x2ce2('0xb'))(_0x2ce2('0xc'));var config=require('../../config/environment');var db=require(_0x2ce2('0xd'))['db'];var htmlEntities=require(_0x2ce2('0xe'));config[_0x2ce2('0xf')]=_[_0x2ce2('0x10')](config[_0x2ce2('0xf')],{'host':_0x2ce2('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ce2('0xf')]));require(_0x2ce2('0x12'))['register'](socket);function respondWithStatusCode(_0x26218a,_0x3c9b36){_0x3c9b36=_0x3c9b36||0xcc;return function(_0x524303){if(_0x524303){return _0x26218a[_0x2ce2('0x13')](_0x3c9b36);}return _0x26218a[_0x2ce2('0x14')](_0x3c9b36)[_0x2ce2('0x15')]();};}function respondWithResult(_0x3dbbbe,_0x4b2407){_0x4b2407=_0x4b2407||0xc8;return function(_0x1b4a4f){if(_0x1b4a4f){return _0x3dbbbe[_0x2ce2('0x14')](_0x4b2407)[_0x2ce2('0x16')](_0x1b4a4f);}};}function respondWithFilteredResult(_0x5efaa1,_0x2a45ea){return function(_0x4d3490){if(_0x4d3490){var _0x4874a5=typeof _0x2a45ea[_0x2ce2('0x17')]===_0x2ce2('0x18')&&typeof _0x2a45ea[_0x2ce2('0x19')]===_0x2ce2('0x18');var _0x1ac6e9=_0x4d3490[_0x2ce2('0x1a')];var _0x313e91=_0x4874a5?0x0:_0x2a45ea['offset'];var _0x4d0a0f=_0x4874a5?_0x4d3490['count']:_0x2a45ea[_0x2ce2('0x17')]+_0x2a45ea[_0x2ce2('0x19')];var _0x2493b0;if(_0x4d0a0f>=_0x1ac6e9){_0x4d0a0f=_0x1ac6e9;_0x2493b0=0xc8;}else{_0x2493b0=0xce;}_0x5efaa1[_0x2ce2('0x14')](_0x2493b0);return _0x5efaa1[_0x2ce2('0x1b')]('Content-Range',_0x313e91+'-'+_0x4d0a0f+'/'+_0x1ac6e9)[_0x2ce2('0x16')](_0x4d3490);}return null;};}function saveUpdates(_0x52d535){return function(_0x280e3d){if(_0x280e3d){return _0x280e3d[_0x2ce2('0x1c')](_0x52d535)[_0x2ce2('0x1d')](function(_0x21e948){return _0x21e948;});}return null;};}function removeEntity(_0x291a17){return function(_0x301874){if(_0x301874){return _0x301874['destroy']()['then'](function(){_0x291a17[_0x2ce2('0x14')](0xcc)[_0x2ce2('0x15')]();});}};}function handleEntityNotFound(_0x3328ad){return function(_0x8f6615){if(!_0x8f6615){_0x3328ad['sendStatus'](0x194);}return _0x8f6615;};}function handleError(_0x5b2b79,_0x5b0eb3){_0x5b0eb3=_0x5b0eb3||0x1f4;return function(_0x17d3b2){logger[_0x2ce2('0x1e')](_0x17d3b2['stack']);if(_0x17d3b2[_0x2ce2('0x1f')]){delete _0x17d3b2[_0x2ce2('0x1f')];}_0x5b2b79[_0x2ce2('0x14')](_0x5b0eb3)[_0x2ce2('0x20')](_0x17d3b2);};}function getInteractionUsers(_0x3cd92f,_0xcba5ca){return new BPromise(function(_0x3f3927,_0x5c748f){try{if(_0xcba5ca[_0x3cd92f['id']]){_0x3cd92f['Users']=_[_0x2ce2('0x21')](_0xcba5ca[_0x3cd92f['id']],function(_0x5741f8){return{'id':_0x5741f8['id'],'fullname':_0x5741f8[_0x2ce2('0x22')]};});}}catch(_0x2e3296){_0x5c748f(_0x2e3296);}_0x3f3927(_0x3cd92f);});}function getInteractionTags(_0x3a701e,_0x44018f){return new BPromise(function(_0x17be99,_0x5a79da){try{if(_0x3a701e['TagIds']){_0x3a701e[_0x2ce2('0x23')]=[];_0x3a701e['TagIds'][_0x2ce2('0x24')](',')[_0x2ce2('0x25')](function(_0x15a245){_0x3a701e[_0x2ce2('0x23')][_0x2ce2('0x26')](_0x44018f[_0x15a245]);});}delete _0x3a701e[_0x2ce2('0x27')];}catch(_0x4b201e){_0x5a79da(_0x4b201e);}_0x17be99(_0x3a701e);});}function getLastMessageText(_0x2f63a7){return new BPromise(function(_0x1d813d,_0xd35aee){return db[_0x2ce2('0x28')][_0x2ce2('0x29')]({'where':{'$and':[{'MailInteractionId':_0x2f63a7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2ce2('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2ce2('0x2b')],'order':_0x2ce2('0x2c'),'raw':!![]})['then'](function(_0xddabc0){if(_0xddabc0&&_0xddabc0['plainBody']){_0x2f63a7['lastMsgText']=_[_0x2ce2('0x2d')](_0xddabc0[_0x2ce2('0x2b')]);}_0x1d813d(_0x2f63a7);})['catch'](function(_0x36474b){_0xd35aee(_0x36474b);});});}function updateMailInteraction(_0x471f3d,_0x3c13bc,_0x46b46d,_0x3cdcb2){return new BPromise(function(_0xda0756,_0x56f6e0){return getInteractionUsers(_0x471f3d,_0x46b46d)[_0x2ce2('0x1d')](function(_0x1d01cb){return getInteractionTags(_0x1d01cb,_0x3c13bc);})[_0x2ce2('0x1d')](function(_0x3da6e6){return getStateInteraction(_0x3da6e6);})['then'](function(_0x46fab3){if(_0x3cdcb2){_0xda0756(getLastMessageText(_0x46fab3));}else{_0xda0756(_0x46fab3);}})[_0x2ce2('0x2e')](function(_0x247f6f){_0x56f6e0(_0x247f6f);});});}function getStateInteraction(_0x417923){return new BPromise(function(_0x339263){_0x417923[_0x2ce2('0x2f')]=0x0;_0x417923[_0x2ce2('0x30')]=0x0;_0x417923[_0x2ce2('0x31')]=0x0;_0x417923[_0x2ce2('0x32')]=0x0;_0x417923[_0x2ce2('0x33')]=0x0;if(!_0x417923[_0x2ce2('0x34')]&&!_0x417923['UserId']){_0x417923[_0x2ce2('0x2f')]+=0x1;}if(!_0x417923[_0x2ce2('0x34')]&&_0x417923[_0x2ce2('0x35')]){_0x417923[_0x2ce2('0x30')]+=0x1;if(_0x417923[_0x2ce2('0x2f')]){_0x417923[_0x2ce2('0x2f')]-=0x1;}}if(_0x417923[_0x2ce2('0x34')]&&_0x417923[_0x2ce2('0x35')]){_0x417923[_0x2ce2('0x31')]+=0x1;if(_0x417923[_0x2ce2('0x30')]){_0x417923[_0x2ce2('0x30')]-=0x1;}}if(_0x417923[_0x2ce2('0x34')]&&!_0x417923['UserId']){_0x417923[_0x2ce2('0x32')]+=0x1;if(_0x417923[_0x2ce2('0x2f')]){_0x417923['waiting']-=0x1;}}_0x417923[_0x2ce2('0x33')]+=0x1;_0x339263(_0x417923);});}exports[_0x2ce2('0x36')]=function(_0x3b5f23,_0xe3f498){var _0x33d95f={},_0x5b8454={},_0x4629f5={'count':0x0,'rows':[]};var _0x2b07fc=_[_0x2ce2('0x21')](db['MailInteraction'][_0x2ce2('0x37')],function(_0x1705a8){return{'name':_0x1705a8[_0x2ce2('0x38')],'type':_0x1705a8[_0x2ce2('0x39')][_0x2ce2('0x3a')]};});_0x5b8454[_0x2ce2('0x3b')]=_[_0x2ce2('0x21')](_0x2b07fc,'name');_0x5b8454['query']=_[_0x2ce2('0x3c')](_0x3b5f23[_0x2ce2('0x3d')]);_0x5b8454[_0x2ce2('0x3e')]=_[_0x2ce2('0x3f')](_0x5b8454[_0x2ce2('0x3b')],_0x5b8454[_0x2ce2('0x3d')]);_0x33d95f['attributes']=_[_0x2ce2('0x3f')](_0x5b8454[_0x2ce2('0x3b')],qs[_0x2ce2('0x40')](_0x3b5f23[_0x2ce2('0x3d')]['fields']));_0x33d95f['attributes']=_0x33d95f[_0x2ce2('0x41')][_0x2ce2('0x42')]?_0x33d95f[_0x2ce2('0x41')]:_0x5b8454['model'];if(!_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x43')](_0x2ce2('0x44'))){_0x33d95f[_0x2ce2('0x19')]=qs[_0x2ce2('0x19')](_0x3b5f23['query']['limit']);_0x33d95f[_0x2ce2('0x17')]=qs[_0x2ce2('0x17')](_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x17')]);}_0x33d95f[_0x2ce2('0x45')]=qs[_0x2ce2('0x46')](_0x3b5f23['query']['sort']);_0x33d95f[_0x2ce2('0x47')]=qs[_0x2ce2('0x3e')](_[_0x2ce2('0x48')](_0x3b5f23[_0x2ce2('0x3d')],_0x5b8454[_0x2ce2('0x3e')]),_0x2b07fc);var _0xf8d9d=[];var _0x59fe0c=squel[_0x2ce2('0x49')]()[_0x2ce2('0x4a')]('id')['field'](_0x2ce2('0x1f'))[_0x2ce2('0x4a')](_0x2ce2('0x4b'))['from'](_0x2ce2('0x4c'));var _0x39cfd8=squel[_0x2ce2('0x49')]()['field']('u.id')[_0x2ce2('0x4a')](_0x2ce2('0x4d'))[_0x2ce2('0x4a')](_0x2ce2('0x4e'))[_0x2ce2('0x4f')]('user_has_mail_interactions','ui')[_0x2ce2('0x50')](_0x2ce2('0x51'),'u',_0x2ce2('0x52'));var _0x14d34c=squel[_0x2ce2('0x49')]()[_0x2ce2('0x4f')]('mail_interactions','i')['left_join'](_0x2ce2('0x53'),'c',_0x2ce2('0x54'))[_0x2ce2('0x50')](_0x2ce2('0x51'),'o',_0x2ce2('0x55'))[_0x2ce2('0x50')](_0x2ce2('0x56'),'a','a.id\x20=\x20i.MailAccountId')['left_join']('mail_messages','me',_0x2ce2('0x57'))[_0x2ce2('0x50')](_0x2ce2('0x58'),'it',_0x2ce2('0x59'))[_0x2ce2('0x50')](_0x2ce2('0x4c'),'t',_0x2ce2('0x5a'));var _0x1c8b64=squel['expr']();var _0x454d12=[];var _0x9dd1ba=squel[_0x2ce2('0x5b')]();var _0x2e6f01;if(_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x5c')]){_0x2e6f01=as[_0x2ce2('0x5d')](_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x5c')]);var _0x267e23=_0x2e6f01[_0x2ce2('0x5e')];for(var _0x2fd01f=0x0;_0x2fd01f<_0x2e6f01[_0x2ce2('0x5f')]['length'];_0x2fd01f++){var _0x38a5da=_0x2e6f01[_0x2ce2('0x5f')][_0x2fd01f];var _0x2d52b4='i';var _0x59fbd0=_[_0x2ce2('0x60')](_0x2b07fc,['name',_0x38a5da[_0x2ce2('0x4a')]]);if(!_0x59fbd0){switch(_0x38a5da[_0x2ce2('0x4a')]){case _0x2ce2('0x61'):if(_0x38a5da[_0x2ce2('0x62')]==0x1){_0x14d34c[_0x2ce2('0x63')]('`'+_0x38a5da[_0x2ce2('0x4a')]+_0x2ce2('0x64'));}else{_0x14d34c[_0x2ce2('0x63')]('`'+_0x38a5da[_0x2ce2('0x4a')]+'`\x20>\x200');}break;case _0x2ce2('0x65'):if(_0x38a5da[_0x2ce2('0x66')]==='$substring'){if(_0x38a5da[_0x2ce2('0x62')][_0x2ce2('0x24')]('\x20')[_0x2ce2('0x42')]>0x1){_0x1c8b64[_0x267e23](_0x2ce2('0x67'),qs[_0x2ce2('0x68')](_0x38a5da[_0x2ce2('0x62')]),null);}else{var _0x4e3d16='%'+_0x38a5da[_0x2ce2('0x62')]+'%';_0x1c8b64[_0x267e23](_0x2ce2('0x69'),_0x4e3d16,_0x4e3d16,_0x4e3d16);}}else{_0x59fbd0=_[_0x2ce2('0x60')](_0x2b07fc,[_0x2ce2('0x1f'),_0x2ce2('0x6a')]);_0x38a5da['field']=_0x2ce2('0x6a');_0x2e796e=as[_0x2ce2('0x6b')](_0x2d52b4,_0x59fbd0[_0x2ce2('0x39')],_0x38a5da);_0x1c8b64[_0x267e23](_0x2e796e['text'],_0x2e796e[_0x2ce2('0x62')][_0x2ce2('0x6c')],_0x2e796e[_0x2ce2('0x62')][_0x2ce2('0x15')]);}break;case'Tag':var _0x4ef75f=_0x38a5da['value'][_0x2ce2('0x24')](',')['map'](function(_0x3649af){return Number(_0x3649af);});_0x4ef75f[_0x2ce2('0x25')](function(_0x3b7687){_0x9dd1ba['or'](_0x2ce2('0x6d'),'%,'+_0x3b7687+',%');});_0x454d12=_[_0x2ce2('0x6e')](_0x454d12,_0x4ef75f);break;case'User':if(_0x38a5da[_0x2ce2('0x66')]==='$substring'){_0x1c8b64[_0x267e23](_0x2ce2('0x6f'),'%'+_0x38a5da[_0x2ce2('0x62')]+'%',null);}else{_0x59fbd0=_[_0x2ce2('0x60')](_0x2b07fc,[_0x2ce2('0x1f'),_0x2ce2('0x35')]);_0x38a5da['field']='UserId';_0x2e796e=as['buildExpression'](_0x2d52b4,_0x59fbd0['type'],_0x38a5da);_0x1c8b64[_0x267e23](_0x2e796e[_0x2ce2('0x70')],_0x2e796e[_0x2ce2('0x62')][_0x2ce2('0x6c')],_0x2e796e[_0x2ce2('0x62')][_0x2ce2('0x15')]);}break;case'plainBody':_0x2e796e=as[_0x2ce2('0x6b')]('me',null,_0x38a5da);_0x1c8b64[_0x267e23](_0x2e796e['text'],_0x2e796e[_0x2ce2('0x62')][_0x2ce2('0x6c')],_0x2e796e[_0x2ce2('0x62')][_0x2ce2('0x15')]);break;}}else{var _0x2e796e=as[_0x2ce2('0x6b')](_0x2d52b4,_0x59fbd0['type'],_0x38a5da);_0x1c8b64[_0x267e23](_0x2e796e[_0x2ce2('0x70')],_0x2e796e[_0x2ce2('0x62')][_0x2ce2('0x6c')],_0x2e796e['value'][_0x2ce2('0x15')]);}}}else{var _0x18ca8e=_(_0x3b5f23[_0x2ce2('0x3d')])['keys']()[_0x2ce2('0x21')](function(_0x457378){return _[_0x2ce2('0x71')](_0x2b07fc,[_0x2ce2('0x1f'),_0x457378])?_0x457378:undefined;})[_0x2ce2('0x72')]()['value']();if(!_[_0x2ce2('0x73')](_0x18ca8e)){_0x18ca8e['forEach'](function(_0x5e09c0){if(_0x5e09c0===_0x2ce2('0x74')){_0x14d34c['where'](_0x2ce2('0x75'),[][_0x2ce2('0x76')](_0x3b5f23[_0x2ce2('0x3d')][_0x5e09c0]));}else if(_0x5e09c0===_0x2ce2('0x77')){var _0x5a3848=JSON[_0x2ce2('0x78')](_0x3b5f23[_0x2ce2('0x3d')][_0x5e09c0])['$gte'];var _0x19a269=JSON[_0x2ce2('0x78')](_0x3b5f23['query'][_0x5e09c0])[_0x2ce2('0x79')];_0x14d34c[_0x2ce2('0x47')](_0x2ce2('0x7a'),_0x5a3848,_0x19a269);}else{if(_0x3b5f23[_0x2ce2('0x3d')][_0x5e09c0]===_0x2ce2('0x7b')){_0x14d34c[_0x2ce2('0x47')]('i.'+_0x5e09c0+_0x2ce2('0x7c'));}else{_0x14d34c['where']('i.'+_0x5e09c0+_0x2ce2('0x7d'),_0x3b5f23[_0x2ce2('0x3d')][_0x5e09c0]);}}});}if(_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x7e')]){if(_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x7e')]==0x1){_0x14d34c[_0x2ce2('0x63')](_0x2ce2('0x7f'));}else{_0x14d34c[_0x2ce2('0x63')](_0x2ce2('0x80'));}}if(_0x3b5f23['query'][_0x2ce2('0x81')]){_0x454d12=_[_0x2ce2('0x82')](_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x81')])?_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x81')]:new Array(_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x81')]);_0x454d12[_0x2ce2('0x25')](function(_0x597fa1){_0x9dd1ba['or'](_0x2ce2('0x6d'),'%,'+_0x597fa1+',%');});}if(_0x3b5f23[_0x2ce2('0x3d')][_0x2ce2('0x83')]){var _0x25ef37=_0x3b5f23['query'][_0x2ce2('0x83')][_0x2ce2('0x84')]('\x5c','\x5c\x5c')[_0x2ce2('0x84')](/'/g,'\x27\x27');if(qs[_0x2ce2('0x85')](_0x25ef37)){_0x1c8b64['or'](_0x2ce2('0x86'),_0x25ef37+'%');}else if(qs['isEmail'](_0x25ef37)){_0x1c8b64['or'](_0x2ce2('0x87'),_0x25ef37+'%');}else{_0x1c8b64['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2ce2('0x68')](_0x25ef37))['or'](_0x2ce2('0x88'),qs[_0x2ce2('0x68')](_0x25ef37));}}}_0x14d34c[_0x2ce2('0x47')](_0x1c8b64);_0x14d34c[_0x2ce2('0x89')](_0x2ce2('0x8a'));var _0xad0b2c={'type':db[_0x2ce2('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x15d38b=_0x14d34c[_0x2ce2('0x8c')]();_0x15d38b[_0x2ce2('0x4a')]('i.id');_0x15d38b[_0x2ce2('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x33d95f['order']){_0x33d95f[_0x2ce2('0x45')]['forEach'](function(_0x350cda){var _0x4a54bd=_0x350cda[0x0]==='contactName'?_0x350cda[0x0]:'i.'+_0x350cda[0x0];_0x14d34c[_0x2ce2('0x45')](_0x4a54bd,_0x350cda[0x1]===_0x2ce2('0x8d')?![]:!![]);});}if(!_[_0x2ce2('0x73')](_0x454d12)){_0x14d34c['having'](_0x9dd1ba);_0x15d38b[_0x2ce2('0x47')](_0x2ce2('0x8e'),_0x454d12);}BPromise[_0x2ce2('0x8f')]()[_0x2ce2('0x1d')](function(){if(!_0x2e6f01){if(_0x3b5f23['query'][_0x2ce2('0x74')])return;_0x15d38b[_0x2ce2('0x47')](_0x2ce2('0x90'));_0x14d34c[_0x2ce2('0x47')](_0x2ce2('0x90'));return;}if(_0x3b5f23[_0x2ce2('0x91')][_0x2ce2('0x92')]!==_0x2ce2('0x93'))return;return _0x3b5f23[_0x2ce2('0x91')][_0x2ce2('0x94')]({'attributes':['id'],'raw':!![]})[_0x2ce2('0x1d')](function(_0x521fb3){if(_[_0x2ce2('0x73')](_0x521fb3)){_0x15d38b['where']('i.MailAccountId\x20IS\x20NULL');_0x14d34c[_0x2ce2('0x47')](_0x2ce2('0x95'));}else{_0x15d38b[_0x2ce2('0x47')](_0x2ce2('0x75'),_[_0x2ce2('0x21')](_0x521fb3,'id'));_0x14d34c[_0x2ce2('0x47')]('i.MailAccountId\x20IN\x20?',_[_0x2ce2('0x21')](_0x521fb3,'id'));}});})[_0x2ce2('0x1d')](function(){if(_0x3b5f23[_0x2ce2('0x91')][_0x2ce2('0x92')]==='agent'&&!_0x2e6f01&&!_0x3b5f23['query']['MailAccountId'])return[];return db['sequelize']['query'](_0x15d38b[_0x2ce2('0x96')](),_0xad0b2c);})['then'](function(_0x52b271){_0x4629f5[_0x2ce2('0x1a')]=_0x52b271[_0x2ce2('0x42')];if(_0x4629f5['count']===0x0)return[];return db[_0x2ce2('0x97')][_0x2ce2('0x3d')](_0x59fe0c['toString'](),_0xad0b2c)[_0x2ce2('0x1d')](function(_0x1246e3){_0xf8d9d=_[_0x2ce2('0x98')](_0x1246e3,'id');_0xad0b2c=_[_0x2ce2('0x99')](_0xad0b2c,{'model':db[_0x2ce2('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3b5f23[_0x2ce2('0x3d')]['fields']){_0x33d95f[_0x2ce2('0x41')]['forEach'](function(_0x2c5df3){_0x14d34c[_0x2ce2('0x4a')]('i.'+_0x2c5df3);});}else{_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0x9b'),'unreadMessages');_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0x9c'),_0x2ce2('0x9d'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0x9e'),'Account.mandatoryDisposition');_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0x9f'),'contactName');_0x14d34c['field'](_0x2ce2('0x8a'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa0'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa1'));_0x14d34c[_0x2ce2('0x4a')]('i.closed');_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa2'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa3'));_0x14d34c['field'](_0x2ce2('0xa4'));_0x14d34c[_0x2ce2('0x4a')]('i.lastMsgDirection');_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa5'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa6'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa7'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa8'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xa9'));_0x14d34c['field'](_0x2ce2('0xaa'));_0x14d34c['field'](_0x2ce2('0xab'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xac'));_0x14d34c['field'](_0x2ce2('0xad'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xae'),_0x2ce2('0xaf'));_0x14d34c['field']('c.lastName',_0x2ce2('0xb0'));_0x14d34c[_0x2ce2('0x4a')]('c.email','Contact.email');_0x14d34c['field']('c.phone','Contact.phone');_0x14d34c['field']('c.mobile',_0x2ce2('0xb1'));_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xb2'),_0x2ce2('0xb3'));_0x14d34c[_0x2ce2('0x4a')]('o.fullname','Owner.fullname');_0x14d34c[_0x2ce2('0x4a')](_0x2ce2('0xb4'),_0x2ce2('0xb5'));_0x14d34c['field'](_0x2ce2('0xb6'),'TagIds');}if(_0x33d95f['limit'])_0x14d34c[_0x2ce2('0x19')](_0x33d95f[_0x2ce2('0x19')]);if(_0x33d95f[_0x2ce2('0x17')])_0x14d34c['offset'](_0x33d95f[_0x2ce2('0x17')]);return db[_0x2ce2('0x97')][_0x2ce2('0x3d')](_0x14d34c['toString'](),_0xad0b2c);})[_0x2ce2('0x1d')](function(_0x30b17e){if(_0x30b17e[_0x2ce2('0x42')]>0x0)_0x39cfd8[_0x2ce2('0x47')](_0x2ce2('0xb7'),_['map'](_0x30b17e,'id'));return db['sequelize'][_0x2ce2('0x3d')](_0x39cfd8['toString'](),_0xad0b2c)['then'](function(_0x24a297){var _0x22226a=_['groupBy'](_0x24a297,_0x2ce2('0xb8'));var _0x10b85b=[];return db[_0x2ce2('0xb9')][_0x2ce2('0x29')]({'attributes':[_0x2ce2('0xba')],'raw':!![]})[_0x2ce2('0x1d')](function(_0x4bfb7a){var _0x27304c=_0x4bfb7a['enableEmailPreview'];_0x30b17e[_0x2ce2('0x25')](function(_0x495f09){_0x10b85b[_0x2ce2('0x26')](updateMailInteraction(_0x495f09,_0xf8d9d,_0x22226a,_0x27304c));});return BPromise['all'](_0x10b85b);});});});})['then'](function(_0x2f0208){_0x4629f5[_0x2ce2('0xbb')]=_0x2f0208;return _0x4629f5;})[_0x2ce2('0x1d')](respondWithFilteredResult(_0xe3f498,_0x33d95f))[_0x2ce2('0x2e')](handleError(_0xe3f498,null));};exports[_0x2ce2('0xbc')]=function(_0x367a3d,_0x33d1a3){var _0x4157bc={'raw':![],'where':{'id':_0x367a3d['params']['id']}},_0x16c1ef={};_0x16c1ef[_0x2ce2('0x3b')]=_[_0x2ce2('0x3c')](db['MailInteraction'][_0x2ce2('0x37')]);_0x16c1ef['query']=_[_0x2ce2('0x3c')](_0x367a3d[_0x2ce2('0x3d')]);_0x16c1ef['filters']=_[_0x2ce2('0x3f')](_0x16c1ef[_0x2ce2('0x3b')],_0x16c1ef[_0x2ce2('0x3d')]);_0x4157bc[_0x2ce2('0x41')]=_[_0x2ce2('0x3f')](_0x16c1ef[_0x2ce2('0x3b')],qs[_0x2ce2('0x40')](_0x367a3d[_0x2ce2('0x3d')][_0x2ce2('0x40')]));_0x4157bc['attributes']=_0x4157bc[_0x2ce2('0x41')][_0x2ce2('0x42')]?_0x4157bc[_0x2ce2('0x41')]:_0x16c1ef[_0x2ce2('0x3b')];if(_0x367a3d[_0x2ce2('0x3d')][_0x2ce2('0xbd')]){_0x4157bc[_0x2ce2('0xbe')]=[{'all':!![]}];}_0x4157bc=_[_0x2ce2('0x99')]({},_0x4157bc,_0x367a3d['options']);return db[_0x2ce2('0x9a')][_0x2ce2('0x60')](_0x4157bc)[_0x2ce2('0x1d')](handleEntityNotFound(_0x33d1a3,null))[_0x2ce2('0x1d')](respondWithResult(_0x33d1a3,null))[_0x2ce2('0x2e')](handleError(_0x33d1a3,null));};exports[_0x2ce2('0xbf')]=function(_0x3ba86b,_0x54ccc4){return db['MailInteraction']['create'](_0x3ba86b['body'],{})['then'](respondWithResult(_0x54ccc4,0xc9))[_0x2ce2('0x2e')](handleError(_0x54ccc4,null));};exports[_0x2ce2('0x1c')]=function(_0x3e3eb8,_0x2e3342){if(_0x3e3eb8[_0x2ce2('0xc0')]['id']){delete _0x3e3eb8[_0x2ce2('0xc0')]['id'];}return db[_0x2ce2('0x9a')][_0x2ce2('0x60')]({'where':{'id':_0x3e3eb8['params']['id']}})[_0x2ce2('0x1d')](handleEntityNotFound(_0x2e3342,null))[_0x2ce2('0x1d')](saveUpdates(_0x3e3eb8[_0x2ce2('0xc0')],null))[_0x2ce2('0x1d')](respondWithResult(_0x2e3342,null))[_0x2ce2('0x2e')](handleError(_0x2e3342,null));};exports[_0x2ce2('0xc1')]=function(_0x3bb119,_0x5f5500){return db[_0x2ce2('0x9a')][_0x2ce2('0x60')]({'where':{'id':_0x3bb119[_0x2ce2('0xc2')]['id']}})['then'](handleEntityNotFound(_0x5f5500,null))[_0x2ce2('0x1d')](removeEntity(_0x5f5500,null))[_0x2ce2('0x2e')](handleError(_0x5f5500,null));};exports[_0x2ce2('0xc3')]=function(_0x51938c,_0x35293d){return db[_0x2ce2('0x9a')]['describe']()[_0x2ce2('0x1d')](respondWithResult(_0x35293d,null))[_0x2ce2('0x2e')](handleError(_0x35293d,null));};exports['addMessage']=function(_0xebc603,_0x108b7b){return db[_0x2ce2('0x28')][_0x2ce2('0x60')]({'where':{'id':_0xebc603[_0x2ce2('0xc2')]['id']}})[_0x2ce2('0x1d')](handleEntityNotFound(_0x108b7b,null))[_0x2ce2('0x1d')](function(_0x5941c6){if(_0x5941c6){return _0x5941c6[_0x2ce2('0xc4')](_0xebc603['body'][_0x2ce2('0xc5')],_['omit'](_0xebc603[_0x2ce2('0xc0')],[_0x2ce2('0xc5'),'id'])||{});}})[_0x2ce2('0x1d')](respondWithResult(_0x108b7b,null))[_0x2ce2('0x2e')](handleError(_0x108b7b,null));};exports[_0x2ce2('0xc6')]=function(_0x5ab13f,_0x309201){var _0x4b3f88={'raw':![],'where':{}};var _0xa0beb={};var _0x31c731={'count':0x0,'rows':[]};return db[_0x2ce2('0x9a')]['findOne']({'where':{'id':_0x5ab13f[_0x2ce2('0xc2')]['id']}})[_0x2ce2('0x1d')](handleEntityNotFound(_0x309201,null))[_0x2ce2('0x1d')](function(_0x15d1da){if(_0x15d1da){_0xa0beb['model']=_[_0x2ce2('0x3c')](db[_0x2ce2('0x28')][_0x2ce2('0x37')]);_0xa0beb['query']=_[_0x2ce2('0x3c')](_0x5ab13f[_0x2ce2('0x3d')]);_0xa0beb[_0x2ce2('0x3e')]=_['intersection'](_0xa0beb[_0x2ce2('0x3b')],_0xa0beb[_0x2ce2('0x3d')]);_0x4b3f88[_0x2ce2('0x41')]=_[_0x2ce2('0x3f')](_0xa0beb[_0x2ce2('0x3b')],qs['fields'](_0x5ab13f[_0x2ce2('0x3d')][_0x2ce2('0x40')]));_0x4b3f88[_0x2ce2('0x41')]=_0x4b3f88[_0x2ce2('0x41')][_0x2ce2('0x42')]?_0x4b3f88[_0x2ce2('0x41')]:_0xa0beb[_0x2ce2('0x3b')];if(!_0x5ab13f[_0x2ce2('0x3d')][_0x2ce2('0x43')](_0x2ce2('0x44'))){_0x4b3f88[_0x2ce2('0x19')]=qs[_0x2ce2('0x19')](_0x5ab13f['query'][_0x2ce2('0x19')]);_0x4b3f88[_0x2ce2('0x17')]=qs[_0x2ce2('0x17')](_0x5ab13f[_0x2ce2('0x3d')][_0x2ce2('0x17')]);}_0x4b3f88[_0x2ce2('0x45')]=qs[_0x2ce2('0x46')](_0x5ab13f['query']['sort']);_0x4b3f88[_0x2ce2('0x47')]=qs['filters'](_[_0x2ce2('0x48')](_0x5ab13f[_0x2ce2('0x3d')],_0xa0beb['filters']));_0x4b3f88['where'][_0x2ce2('0xb8')]=_0x15d1da['id'];if(_0x5ab13f[_0x2ce2('0x3d')]['filter']){_0x4b3f88['where']=_[_0x2ce2('0x99')](_0x4b3f88['where'],{'$or':_['map'](_0x4b3f88[_0x2ce2('0x41')],function(_0x444f6c){var _0xe2e4f5={};_0xe2e4f5[_0x444f6c]={'$like':'%'+_0x5ab13f[_0x2ce2('0x3d')][_0x2ce2('0x83')]+'%'};return _0xe2e4f5;})});}if(_0x5ab13f['query']['$gte']){var _0x1102ef=_0x5ab13f['query'][_0x2ce2('0xc7')][_0x2ce2('0x24')](',');var _0x4da776={};_0x4da776[_0x1102ef[0x0]]={'$gte':moment(_0x1102ef[0x1])[_0x2ce2('0xc8')](_0x2ce2('0xc9'))};_0x4b3f88['where']=_['merge'](_0x4b3f88[_0x2ce2('0x47')],_0x4da776);}_0x4b3f88=_['merge']({},_0x4b3f88,_0x5ab13f[_0x2ce2('0xca')]);return db[_0x2ce2('0x28')][_0x2ce2('0x1a')]({'where':_0x4b3f88[_0x2ce2('0x47')]})[_0x2ce2('0x1d')](function(_0x4be666){_0x31c731[_0x2ce2('0x1a')]=_0x4be666;if(_0x5ab13f[_0x2ce2('0x3d')][_0x2ce2('0xbd')]){_0x4b3f88[_0x2ce2('0xbe')]=[{'all':!![]}];}return db[_0x2ce2('0x28')][_0x2ce2('0xcb')](_0x4b3f88);})[_0x2ce2('0x1d')](function(_0x467a73){if(_0x5ab13f[_0x2ce2('0x3d')][_0x2ce2('0xcc')]===_0x2ce2('0xcd')){for(var _0x2683a1=0x0;_0x2683a1<_0x467a73[_0x2ce2('0x42')];_0x2683a1++){_0x467a73[_0x2683a1][_0x2ce2('0xc0')]=juice(_0x467a73[_0x2683a1][_0x2ce2('0xc0')]);}}_0x31c731[_0x2ce2('0xbb')]=_0x467a73;return _0x31c731;});}})[_0x2ce2('0x1d')](respondWithFilteredResult(_0x309201,_0x4b3f88))[_0x2ce2('0x2e')](handleError(_0x309201,null));};exports[_0x2ce2('0xce')]=function(_0x5e1ad3,_0x24481f){return db[_0x2ce2('0x9a')][_0x2ce2('0x60')]({'where':{'id':_0x5e1ad3[_0x2ce2('0xc2')]['id']}})[_0x2ce2('0x1d')](handleEntityNotFound(_0x24481f,null))['then'](function(_0x41a514){if(_0x41a514){return _0x41a514['setTags'](_0x5e1ad3['body'][_0x2ce2('0xc5')],_[_0x2ce2('0xcf')](_0x5e1ad3[_0x2ce2('0xc0')],[_0x2ce2('0xc5'),'id'])||{})[_0x2ce2('0xd0')](function(){return db['Tag'][_0x2ce2('0xcb')]({'attributes':['id',_0x2ce2('0x1f'),_0x2ce2('0x4b')],'where':{'id':_0x5e1ad3[_0x2ce2('0xc0')]['ids']}});})[_0x2ce2('0x1d')](function(_0x919a6d){socket['emit'](_0x2ce2('0xd1'),{'id':Number(_0x5e1ad3[_0x2ce2('0xc2')]['id']),'tags':_0x919a6d||[]});return{'id':Number(_0x5e1ad3[_0x2ce2('0xc2')]['id']),'tags':_0x919a6d||[]};});}})[_0x2ce2('0x1d')](respondWithResult(_0x24481f,null))['catch'](handleError(_0x24481f,null));};exports[_0x2ce2('0xd2')]=function(_0x320c4b,_0x493e12){return db[_0x2ce2('0x9a')][_0x2ce2('0x60')]({'where':{'id':_0x320c4b[_0x2ce2('0xc2')]['id']}})[_0x2ce2('0x1d')](handleEntityNotFound(_0x493e12,null))[_0x2ce2('0x1d')](function(_0x194d9d){if(_0x194d9d){return _0x194d9d[_0x2ce2('0xd2')](_0x320c4b[_0x2ce2('0x3d')][_0x2ce2('0xc5')]);}})[_0x2ce2('0x1d')](respondWithStatusCode(_0x493e12,null))[_0x2ce2('0x2e')](handleError(_0x493e12,null));};exports[_0x2ce2('0xd3')]=function(_0x1eaf48,_0x18e8df){var _0x8bc7b2=moment()[_0x2ce2('0xd4')]()['toString']();var _0xdd7759=path[_0x2ce2('0xd5')](config[_0x2ce2('0xd6')],_0x2ce2('0xd7'),_0x2ce2('0xd8'),_0x2ce2('0xd9'));var _0x48e5c2=path[_0x2ce2('0xd5')](config['root'],_0x2ce2('0xd7'),'files',_0x2ce2('0xda'));var _0x5c4e86=path[_0x2ce2('0xd5')](_0xdd7759,_0x8bc7b2);var _0xaa29a0=util[_0x2ce2('0xc8')](_0x2ce2('0xdb'),_0x1eaf48[_0x2ce2('0xc2')]['id'],_0x8bc7b2);var _0x3ece4f=path[_0x2ce2('0xd5')](_0xdd7759,_0xaa29a0);var _0x21f922=[];if(_0x1eaf48[_0x2ce2('0x3d')][_0x2ce2('0xda')]){_0x21f922['push']({'model':db[_0x2ce2('0xdc')],'as':_0x2ce2('0xdd'),'raw':!![]});}var _0x35f744=[{'model':db['MailMessage'],'as':_0x2ce2('0xde'),'attributes':['id',_0x2ce2('0xc0'),_0x2ce2('0x4f'),'to','cc',_0x2ce2('0xdf'),_0x2ce2('0xe0'),'createdAt'],'where':{'secret':![]},'order':qs[_0x2ce2('0x46')]('id'),'include':_0x21f922}];return db[_0x2ce2('0x9a')][_0x2ce2('0x60')]({'where':{'id':_0x1eaf48[_0x2ce2('0xc2')]['id']},'include':_0x35f744})[_0x2ce2('0x1d')](handleEntityNotFound(_0x18e8df,null))['then'](function(_0x241231){if(_0x241231&&_0x241231[_0x2ce2('0xde')]){var _0x3a1a7a=_0x241231[_0x2ce2('0xe1')]({'plain':!![]});fs[_0x2ce2('0xe2')](_0x5c4e86);return BPromise[_0x2ce2('0xe3')](_0x3a1a7a[_0x2ce2('0xde')],function(_0x445bbe,_0xc70d3c){var _0x3d79ca={'from':_0x445bbe[_0x2ce2('0x4f')],'to':_0x445bbe['to'],'subject':_0x445bbe[_0x2ce2('0xe0')],'html':htmlEntities[_0x2ce2('0xe4')](_0x445bbe[_0x2ce2('0xc0')]),'headers':{'Date':moment(_0x445bbe[_0x2ce2('0x77')])[_0x2ce2('0xc8')](_0x2ce2('0xe5'))},'attachments':[]};if(_0x445bbe['cc']){_0x3d79ca[_0x2ce2('0xe6')]['Cc']=_0x445bbe['cc'];}if(_0x445bbe['bcc']){_0x3d79ca['headers']['Bcc']=_0x445bbe['bcc'];}return new BPromise(function(_0x1ef164,_0x171549){if(_0x445bbe[_0x2ce2('0xdd')]){for(var _0x433136=0x0;_0x433136<_0x445bbe['Attachments'][_0x2ce2('0x42')];_0x433136++){var _0x2d565a=_0x445bbe[_0x2ce2('0xdd')][_0x433136];var _0x3e4eff=path[_0x2ce2('0xd5')](_0x48e5c2,_0x2d565a[_0x2ce2('0xe7')]);if(fs[_0x2ce2('0xe8')](_0x3e4eff)){_0x3d79ca[_0x2ce2('0xda')][_0x2ce2('0x26')]({'name':_0x2d565a[_0x2ce2('0x1f')],'contentType':_0x2d565a[_0x2ce2('0x39')],'data':fs[_0x2ce2('0xe9')](_0x3e4eff)});}}}emlformat['build'](_0x3d79ca,function(_0x362644,_0x1260eb){if(_0x362644)return _0x171549(_0x362644);fs[_0x2ce2('0xea')](path[_0x2ce2('0xd5')](_0x5c4e86,util[_0x2ce2('0xc8')]('message%d.eml',_0xc70d3c)),_0x1260eb);return _0x1ef164(_0x1260eb);});});})['then'](function(){return new BPromise(function(_0x3657a2,_0x5d6987){zipdir(_0x5c4e86,{'saveTo':_0x3ece4f},function(_0x54ed43,_0x37fd25){if(_0x54ed43)return _0x5d6987(_0x54ed43);return _0x3657a2(_0x37fd25);});})[_0x2ce2('0x1d')](function(){return new BPromise(function(_0x5e8d1b,_0x54a4f2){rimraf(_0x5c4e86,function(_0x4163ff){if(_0x4163ff)_0x54a4f2(_0x4163ff);return _0x5e8d1b();});});})[_0x2ce2('0x1d')](function(){return _0x18e8df[_0x2ce2('0xd3')](_0x3ece4f,_0xaa29a0,function(_0x24eb33){if(!_0x24eb33)fs['unlinkSync'](_0x3ece4f);});});});}else{return _0x18e8df['sendStatus'](0xc8);}})[_0x2ce2('0x2e')](handleError(_0x18e8df,null));};
\ No newline at end of file
index b5c6e72..e7de1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9559=['Users','map','findAll','then','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','MailInteraction','MailMessage','setMaxListeners','update','remove','getUsers'];(function(_0x12f2a0,_0x264c43){var _0x3e4d9a=function(_0x55cbd3){while(--_0x55cbd3){_0x12f2a0['push'](_0x12f2a0['shift']());}};_0x3e4d9a(++_0x264c43);}(_0x9559,0x12b));var _0x9955=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x9559[_0x4de9e8];return _0x4db0de;};'use strict';var EventEmitter=require(_0x9955('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x9955('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x9955('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9955('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9955('0x4'),'afterDestroy':_0x9955('0x5')};function emitEvent(_0x4b4dc8){return function(_0x42f034,_0x53c9b6,_0x64d0be){_0x42f034[_0x9955('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1c8c81){_0x42f034['setDataValue'](_0x9955('0x7'),_0x1c8c81[_0x9955('0x8')](function(_0x45976f){return{'id':_0x45976f['id']};}));return MailMessage[_0x9955('0x9')]({'where':{'MailInteractionId':_0x42f034['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9955('0xa')](function(_0x584476){_0x42f034['setDataValue'](_0x9955('0xb'),_0x584476[_0x9955('0xc')]);MailInteractionEvents['emit'](_0x4b4dc8+':'+_0x42f034['id'],_0x42f034);MailInteractionEvents['emit'](_0x4b4dc8,_0x42f034);_0x64d0be(null);})[_0x9955('0xd')](_0x64d0be(null));};}for(var e in events){if(events[_0x9955('0xe')](e)){var event=events[e];MailInteraction[_0x9955('0xf')](e,emitEvent(event));}}module[_0x9955('0x10')]=MailInteractionEvents;
\ No newline at end of file
+var _0xe918=['MailInteraction','MailMessage','setMaxListeners','getUsers','setDataValue','map','findAll','then','length','emit','hook','events','../../mysqldb'];(function(_0x297cc5,_0x193925){var _0x4d56e8=function(_0x268197){while(--_0x268197){_0x297cc5['push'](_0x297cc5['shift']());}};_0x4d56e8(++_0x193925);}(_0xe918,0x66));var _0x8e91=function(_0x111764,_0x2cd071){_0x111764=_0x111764-0x0;var _0x100d8d=_0xe918[_0x111764];return _0x100d8d;};'use strict';var EventEmitter=require(_0x8e91('0x0'));var MailInteraction=require(_0x8e91('0x1'))['db'][_0x8e91('0x2')];var MailMessage=require(_0x8e91('0x1'))['db'][_0x8e91('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x8e91('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x453ac5){return function(_0x213cea,_0x3586f5,_0x2d43e3){_0x213cea[_0x8e91('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0xe34b53){_0x213cea[_0x8e91('0x6')]('Users',_0xe34b53[_0x8e91('0x7')](function(_0x55ee8a){return{'id':_0x55ee8a['id']};}));return MailMessage[_0x8e91('0x8')]({'where':{'MailInteractionId':_0x213cea['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8e91('0x9')](function(_0x33d329){_0x213cea['setDataValue']('unreadMessages',_0x33d329[_0x8e91('0xa')]);MailInteractionEvents[_0x8e91('0xb')](_0x453ac5+':'+_0x213cea['id'],_0x213cea);MailInteractionEvents['emit'](_0x453ac5,_0x213cea);_0x2d43e3(null);})['catch'](_0x2d43e3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x8e91('0xc')](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
index b5d4326..9b19bd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8658=['define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','substatus','changed','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','rimraf','./mailInteraction.attributes','exports'];(function(_0x23f788,_0x1d1480){var _0x5cd313=function(_0x2b6e33){while(--_0x2b6e33){_0x23f788['push'](_0x23f788['shift']());}};_0x5cd313(++_0x1d1480);}(_0x8658,0x14b));var _0x8865=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x8658[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x8865('0x0'));var util=require(_0x8865('0x1'));var logger=require('../../config/logger')(_0x8865('0x2'));var moment=require('moment');var BPromise=require(_0x8865('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8865('0x4'));var config=require('../../config/environment');var attributes=require(_0x8865('0x5'));module[_0x8865('0x6')]=function(_0x3a62b3,_0x2176e2){return _0x3a62b3[_0x8865('0x7')](_0x8865('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x8865('0x9'),'fields':[_0x8865('0xa'),'to'],'type':_0x8865('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x245c34,_0x4f3368,_0x543d41){if(_0x245c34['substatus']){_0x245c34[_0x8865('0xc')]=moment()['format'](_0x8865('0xd'));}if(_0x245c34[_0x8865('0xe')]){_0x245c34[_0x8865('0xf')]=moment()[_0x8865('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x543d41(null,_0x4f3368);},'beforeUpdate':function(_0x75a8a0,_0x47a274,_0x4b13f9){if(_0x75a8a0['changed'](_0x8865('0x11'))){_0x75a8a0['substatusAt']=_0x75a8a0[_0x8865('0x11')]?moment()[_0x8865('0x10')](_0x8865('0xd')):null;}if(_0x75a8a0[_0x8865('0x12')](_0x8865('0xe'))){_0x75a8a0[_0x8865('0xf')]=moment()[_0x8865('0x10')](_0x8865('0xd'));_0x75a8a0[_0x8865('0x11')]=null;_0x75a8a0[_0x8865('0xc')]=null;}_0x4b13f9(null,_0x75a8a0);},'afterUpdate':function(_0x323929,_0x3376e6,_0x3be3d2){var _0x1a896b=_0x3a62b3[_0x8865('0x13')];var _0x44ffe0=_0x323929[_0x8865('0x14')]({'plain':!![]});if(_0x44ffe0[_0x8865('0xe')]){return _0x1a896b[_0x8865('0x15')][_0x8865('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x44ffe0['id']}})[_0x8865('0x17')](function(){_0x3be3d2();})['catch'](function(_0x3f45b9){_0x3be3d2(_0x3f45b9);});}else{_0x3be3d2();}}},'charset':_0x8865('0x18'),'collate':_0x8865('0x19')});};
\ No newline at end of file
+var _0x1c9b=['path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closedAt','format','changed','closed','substatusAt','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x17fdd1,_0x3563a0){var _0x196c8b=function(_0x558677){while(--_0x558677){_0x17fdd1['push'](_0x17fdd1['shift']());}};_0x196c8b(++_0x3563a0);}(_0x1c9b,0x156));var _0xb1c9=function(_0x3064a3,_0x20e71a){_0x3064a3=_0x3064a3-0x0;var _0x4319b6=_0x1c9b[_0x3064a3];return _0x4319b6;};'use strict';var _=require(_0xb1c9('0x0'));var util=require(_0xb1c9('0x1'));var logger=require(_0xb1c9('0x2'))('api');var moment=require(_0xb1c9('0x3'));var BPromise=require(_0xb1c9('0x4'));var rp=require(_0xb1c9('0x5'));var fs=require('fs');var path=require(_0xb1c9('0x6'));var rimraf=require(_0xb1c9('0x7'));var config=require(_0xb1c9('0x8'));var attributes=require(_0xb1c9('0x9'));module['exports']=function(_0x574781,_0x5e5aa3){return _0x574781[_0xb1c9('0xa')](_0xb1c9('0xb'),attributes,{'tableName':_0xb1c9('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xb1c9('0xd'),'to'],'type':_0xb1c9('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x597f57,_0x450232,_0xc84c4a){if(_0x597f57[_0xb1c9('0xf')]){_0x597f57['substatusAt']=moment()['format'](_0xb1c9('0x10'));}if(_0x597f57['closed']){_0x597f57[_0xb1c9('0x11')]=moment()[_0xb1c9('0x12')](_0xb1c9('0x10'));}_0xc84c4a(null,_0x450232);},'beforeUpdate':function(_0x42a2a8,_0x266187,_0x26d0ea){if(_0x42a2a8[_0xb1c9('0x13')](_0xb1c9('0xf'))){_0x42a2a8['substatusAt']=_0x42a2a8['substatus']?moment()[_0xb1c9('0x12')](_0xb1c9('0x10')):null;}if(_0x42a2a8['changed'](_0xb1c9('0x14'))){_0x42a2a8[_0xb1c9('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x42a2a8[_0xb1c9('0xf')]=null;_0x42a2a8[_0xb1c9('0x15')]=null;}_0x26d0ea(null,_0x42a2a8);},'afterUpdate':function(_0x224817,_0x19d83b,_0x25fdb6){var _0x2d4aab=_0x574781[_0xb1c9('0x16')];var _0x267555=_0x224817[_0xb1c9('0x17')]({'plain':!![]});if(_0x267555['closed']){return _0x2d4aab[_0xb1c9('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x267555['id']}})[_0xb1c9('0x19')](function(){_0x25fdb6();})[_0xb1c9('0x1a')](function(_0x554374){_0x25fdb6(_0x554374);});}else{_0x25fdb6();}}},'charset':_0xb1c9('0x1b'),'collate':_0xb1c9('0x1c')});};
\ No newline at end of file
index ac36481..d7bafd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dd7=['register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','find','ids','omit','AddTags','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket'];(function(_0x1acf4b,_0x5a750c){var _0x4eca09=function(_0xedef3a){while(--_0xedef3a){_0x1acf4b['push'](_0x1acf4b['shift']());}};_0x4eca09(++_0x5a750c);}(_0x0dd7,0x140));var _0x70dd=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x0dd7[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require(_0x70dd('0x0'));var util=require(_0x70dd('0x1'));var moment=require('moment');var BPromise=require(_0x70dd('0x2'));var rs=require(_0x70dd('0x3'));var fs=require('fs');var Redis=require(_0x70dd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70dd('0x5'));var logger=require(_0x70dd('0x6'))(_0x70dd('0x7'));var config=require(_0x70dd('0x8'));var jayson=require(_0x70dd('0x9'));var client=jayson[_0x70dd('0xa')][_0x70dd('0xb')]({'port':0x232a});config[_0x70dd('0xc')]=_['defaults'](config[_0x70dd('0xc')],{'host':_0x70dd('0xd'),'port':0x18eb});var socket=require(_0x70dd('0xe'))(new Redis(config[_0x70dd('0xc')]));require(_0x70dd('0xf'))[_0x70dd('0x10')](socket);function respondWithRpcPromise(_0x1d8428,_0x4324b0,_0x3a24c3){return new BPromise(function(_0x2ad3ce,_0x475bd4){return client[_0x70dd('0x11')](_0x1d8428,_0x3a24c3)['then'](function(_0x1fcd00){logger[_0x70dd('0x12')](_0x70dd('0x13'),_0x4324b0,_0x70dd('0x14'));logger[_0x70dd('0x15')](_0x70dd('0x16'),_0x4324b0,_0x70dd('0x14'),JSON['stringify'](_0x1fcd00));if(_0x1fcd00[_0x70dd('0x17')]){if(_0x1fcd00[_0x70dd('0x17')][_0x70dd('0x18')]===0x1f4){logger[_0x70dd('0x17')](_0x70dd('0x13'),_0x4324b0,_0x1fcd00[_0x70dd('0x17')]['message']);return _0x475bd4(_0x1fcd00[_0x70dd('0x17')][_0x70dd('0x19')]);}logger['error'](_0x70dd('0x13'),_0x4324b0,_0x1fcd00[_0x70dd('0x17')][_0x70dd('0x19')]);return _0x2ad3ce(_0x1fcd00['error'][_0x70dd('0x19')]);}else{logger[_0x70dd('0x12')]('MailInteraction,\x20%s,\x20%s',_0x4324b0,'request\x20sent');_0x2ad3ce(_0x1fcd00['result']['message']);}})[_0x70dd('0x1a')](function(_0x334f7){logger[_0x70dd('0x17')](_0x70dd('0x13'),_0x4324b0,_0x334f7);_0x475bd4(_0x334f7);});});}exports['UpdateMailInteraction']=function(_0x179f15){var _0x51271a=this;return new Promise(function(_0x42df86,_0x43c284){return db['MailInteraction'][_0x70dd('0x1b')](_0x179f15[_0x70dd('0x1c')],{'raw':_0x179f15[_0x70dd('0x1d')]?_0x179f15[_0x70dd('0x1d')][_0x70dd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x179f15[_0x70dd('0x1d')]?_0x179f15[_0x70dd('0x1d')][_0x70dd('0x1f')]||null:null,'attributes':_0x179f15[_0x70dd('0x1d')]?_0x179f15[_0x70dd('0x1d')][_0x70dd('0x20')]||null:null,'limit':_0x179f15[_0x70dd('0x1d')]?_0x179f15[_0x70dd('0x1d')][_0x70dd('0x21')]||null:null})['then'](function(_0x45c179){logger[_0x70dd('0x12')](_0x70dd('0x22'),_0x179f15);logger[_0x70dd('0x15')](_0x70dd('0x22'),_0x179f15,JSON['stringify'](_0x45c179));_0x42df86(_0x45c179);})['catch'](function(_0x543367){logger[_0x70dd('0x17')](_0x70dd('0x22'),_0x543367[_0x70dd('0x19')],_0x179f15);_0x43c284(_0x51271a[_0x70dd('0x17')](0x1f4,_0x543367[_0x70dd('0x19')]));});});};exports[_0x70dd('0x23')]=function(_0x32363e){return new Promise(function(_0x58a575,_0x4740fb){return db[_0x70dd('0x24')][_0x70dd('0x25')]({'where':_0x32363e['options']?_0x32363e['options'][_0x70dd('0x1f')]||null:null})['then'](function(_0x4bfc0e){if(_0x4bfc0e){return _0x4bfc0e['addTags'](_0x32363e['body'][_0x70dd('0x26')],_[_0x70dd('0x27')](_0x32363e[_0x70dd('0x1c')],['ids','id'])||{});}})['spread'](function(_0x46bbda){logger[_0x70dd('0x12')]('AddTags',_0x32363e);logger['debug'](_0x70dd('0x28'),_0x32363e,JSON[_0x70dd('0x29')](_0x46bbda));_0x58a575(_0x46bbda);})[_0x70dd('0x1a')](function(_0x1e4392){logger['error'](_0x70dd('0x28'),_0x1e4392[_0x70dd('0x19')],_0x32363e);_0x4740fb(_this['error'](0x1f4,_0x1e4392[_0x70dd('0x19')]));});});};
\ No newline at end of file
+var _0x463e=['then','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateMailInteraction','update','options','where','limit','debug','AddTagsToMailInteraction','find','addTags','body','ids','spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x463e,0x13f));var _0xe463=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x463e[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xe463('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe463('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe463('0x2'));var db=require(_0xe463('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe463('0x4'))(_0xe463('0x5'));var config=require(_0xe463('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe463('0x7')]({'port':0x232a});config[_0xe463('0x8')]=_[_0xe463('0x9')](config[_0xe463('0x8')],{'host':_0xe463('0xa'),'port':0x18eb});var socket=require(_0xe463('0xb'))(new Redis(config['redis']));require(_0xe463('0xc'))['register'](socket);function respondWithRpcPromise(_0x2d77f3,_0x116cf0,_0x2733be){return new BPromise(function(_0x23dea3,_0x360725){return client[_0xe463('0xd')](_0x2d77f3,_0x2733be)[_0xe463('0xe')](function(_0x4d16fc){logger['info'](_0xe463('0xf'),_0x116cf0,_0xe463('0x10'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x116cf0,_0xe463('0x10'),JSON[_0xe463('0x11')](_0x4d16fc));if(_0x4d16fc[_0xe463('0x12')]){if(_0x4d16fc[_0xe463('0x12')][_0xe463('0x13')]===0x1f4){logger[_0xe463('0x12')]('MailInteraction,\x20%s,\x20%s',_0x116cf0,_0x4d16fc[_0xe463('0x12')][_0xe463('0x14')]);return _0x360725(_0x4d16fc['error'][_0xe463('0x14')]);}logger[_0xe463('0x12')](_0xe463('0xf'),_0x116cf0,_0x4d16fc[_0xe463('0x12')]['message']);return _0x23dea3(_0x4d16fc[_0xe463('0x12')][_0xe463('0x14')]);}else{logger[_0xe463('0x15')](_0xe463('0xf'),_0x116cf0,'request\x20sent');_0x23dea3(_0x4d16fc[_0xe463('0x16')][_0xe463('0x14')]);}})[_0xe463('0x17')](function(_0x32430f){logger['error'](_0xe463('0xf'),_0x116cf0,_0x32430f);_0x360725(_0x32430f);});});}exports[_0xe463('0x18')]=function(_0x2dc56c){var _0x169f64=this;return new Promise(function(_0x16a677,_0x502410){return db['MailInteraction'][_0xe463('0x19')](_0x2dc56c['body'],{'raw':_0x2dc56c[_0xe463('0x1a')]?_0x2dc56c[_0xe463('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dc56c['options']?_0x2dc56c[_0xe463('0x1a')][_0xe463('0x1b')]||null:null,'attributes':_0x2dc56c[_0xe463('0x1a')]?_0x2dc56c[_0xe463('0x1a')]['attributes']||null:null,'limit':_0x2dc56c[_0xe463('0x1a')]?_0x2dc56c[_0xe463('0x1a')][_0xe463('0x1c')]||null:null})[_0xe463('0xe')](function(_0x157ea4){logger[_0xe463('0x15')](_0xe463('0x18'),_0x2dc56c);logger[_0xe463('0x1d')](_0xe463('0x18'),_0x2dc56c,JSON[_0xe463('0x11')](_0x157ea4));_0x16a677(_0x157ea4);})['catch'](function(_0x1e8a3){logger['error'](_0xe463('0x18'),_0x1e8a3[_0xe463('0x14')],_0x2dc56c);_0x502410(_0x169f64[_0xe463('0x12')](0x1f4,_0x1e8a3['message']));});});};exports[_0xe463('0x1e')]=function(_0x96940b){return new Promise(function(_0x22cae,_0xe6ab8){return db['MailInteraction'][_0xe463('0x1f')]({'where':_0x96940b[_0xe463('0x1a')]?_0x96940b['options'][_0xe463('0x1b')]||null:null})[_0xe463('0xe')](function(_0x119c64){if(_0x119c64){return _0x119c64[_0xe463('0x20')](_0x96940b[_0xe463('0x21')]['ids'],_['omit'](_0x96940b[_0xe463('0x21')],[_0xe463('0x22'),'id'])||{});}})[_0xe463('0x23')](function(_0x33ee35){logger[_0xe463('0x15')](_0xe463('0x24'),_0x96940b);logger[_0xe463('0x1d')]('AddTags',_0x96940b,JSON['stringify'](_0x33ee35));_0x22cae(_0x33ee35);})[_0xe463('0x17')](function(_0x167c98){logger['error']('AddTags',_0x167c98[_0xe463('0x14')],_0x96940b);_0xe6ab8(_this['error'](0x1f4,_0x167c98[_0xe463('0x14')]));});});};
\ No newline at end of file
index 3fc1b9d..70f2437 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe36d=['emit','removeListener','register','length','remove','update'];(function(_0x147ab3,_0x1f855b){var _0x34b2d6=function(_0x2588c3){while(--_0x2588c3){_0x147ab3['push'](_0x147ab3['shift']());}};_0x34b2d6(++_0x1f855b);}(_0xe36d,0x1a8));var _0xde36=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0xe36d[_0xfb0281];return _0x408dd3;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xde36('0x0'),_0xde36('0x1')];function createListener(_0x591b49,_0x132791){return function(_0x251095){_0x132791[_0xde36('0x2')](_0x591b49,_0x251095);};}function removeListener(_0x4c49e9,_0x44cb4b){return function(){MailInteractionEvents[_0xde36('0x3')](_0x4c49e9,_0x44cb4b);};}exports[_0xde36('0x4')]=function(_0x1ca40c){for(var _0x1c03fd=0x0,_0x16f49d=events[_0xde36('0x5')];_0x1c03fd<_0x16f49d;_0x1c03fd++){var _0x138642=events[_0x1c03fd];var _0x11aad6=createListener('mailInteraction:'+_0x138642,_0x1ca40c);MailInteractionEvents['on'](_0x138642,_0x11aad6);}};
\ No newline at end of file
+var _0x37ad=['removeListener','register','length','./mailInteraction.events','save','remove','update'];(function(_0x469ea8,_0x150851){var _0x1abd65=function(_0x157c54){while(--_0x157c54){_0x469ea8['push'](_0x469ea8['shift']());}};_0x1abd65(++_0x150851);}(_0x37ad,0x1b5));var _0xd37a=function(_0x12d69b,_0x5345bb){_0x12d69b=_0x12d69b-0x0;var _0xaec0be=_0x37ad[_0x12d69b];return _0xaec0be;};'use strict';var MailInteractionEvents=require(_0xd37a('0x0'));var events=[_0xd37a('0x1'),_0xd37a('0x2'),_0xd37a('0x3')];function createListener(_0x14a5cb,_0x291241){return function(_0x1dd9df){_0x291241['emit'](_0x14a5cb,_0x1dd9df);};}function removeListener(_0x75eace,_0x285102){return function(){MailInteractionEvents[_0xd37a('0x4')](_0x75eace,_0x285102);};}exports[_0xd37a('0x5')]=function(_0xbfad27){for(var _0x22f2fc=0x0,_0x5bc0f9=events[_0xd37a('0x6')];_0x22f2fc<_0x5bc0f9;_0x22f2fc++){var _0x106ed5=events[_0x22f2fc];var _0x3bf501=createListener('mailInteraction:'+_0x106ed5,_0xbfad27);MailInteractionEvents['on'](_0x106ed5,_0x3bf501);}};
\ No newline at end of file
index 926e24a..56e95df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c0=['mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','download','post','tracked','mail'];(function(_0x46b7ed,_0x211e80){var _0x25ffb4=function(_0x95e398){while(--_0x95e398){_0x46b7ed['push'](_0x46b7ed['shift']());}};_0x25ffb4(++_0x211e80);}(_0x47c0,0x1dc));var _0x047c=function(_0x239049,_0x39fa86){_0x239049=_0x239049-0x0;var _0x1d70d9=_0x47c0[_0x239049];return _0x1d70d9;};'use strict';var multer=require(_0x047c('0x0'));var util=require(_0x047c('0x1'));var path=require(_0x047c('0x2'));var timeout=require('connect-timeout');var express=require(_0x047c('0x3'));var router=express[_0x047c('0x4')]();var fs_extra=require(_0x047c('0x5'));var auth=require(_0x047c('0x6'));var interaction=require(_0x047c('0x7'));var config=require(_0x047c('0x8'));var controller=require('./mailMessage.controller');router[_0x047c('0x9')]('/',auth['isAuthenticated'](),controller[_0x047c('0xa')]);router[_0x047c('0x9')]('/describe',auth[_0x047c('0xb')](),controller[_0x047c('0xc')]);router[_0x047c('0x9')](_0x047c('0xd'),auth[_0x047c('0xb')](),controller['show']);router[_0x047c('0x9')]('/:id/download',auth[_0x047c('0xb')](),controller[_0x047c('0xe')]);router[_0x047c('0xf')]('/',auth['isAuthenticated'](),interaction[_0x047c('0x10')](_0x047c('0x11'),_0x047c('0x12')),controller[_0x047c('0x13')]);router[_0x047c('0x14')](_0x047c('0xd'),auth[_0x047c('0xb')](),controller[_0x047c('0x15')]);router[_0x047c('0x14')](_0x047c('0x16'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x047c('0x17'),auth[_0x047c('0xb')](),controller[_0x047c('0x18')]);router[_0x047c('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfc65=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','mail','mailmessage:create','create','update','put','/:id/accept','reject','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xfc65,0x1b4));var _0x5fc6=function(_0x4fe574,_0x5d0cca){_0x4fe574=_0x4fe574-0x0;var _0x44c126=_0xfc65[_0x4fe574];return _0x44c126;};'use strict';var multer=require(_0x5fc6('0x0'));var util=require(_0x5fc6('0x1'));var path=require(_0x5fc6('0x2'));var timeout=require(_0x5fc6('0x3'));var express=require(_0x5fc6('0x4'));var router=express[_0x5fc6('0x5')]();var fs_extra=require(_0x5fc6('0x6'));var auth=require(_0x5fc6('0x7'));var interaction=require(_0x5fc6('0x8'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0x5fc6('0x9')]('/',auth[_0x5fc6('0xa')](),controller[_0x5fc6('0xb')]);router[_0x5fc6('0x9')](_0x5fc6('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x5fc6('0x9')](_0x5fc6('0xd'),auth[_0x5fc6('0xa')](),controller['show']);router[_0x5fc6('0x9')](_0x5fc6('0xe'),auth['isAuthenticated'](),controller[_0x5fc6('0xf')]);router[_0x5fc6('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x5fc6('0x11'),_0x5fc6('0x12')),controller[_0x5fc6('0x13')]);router['put'](_0x5fc6('0xd'),auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x14')]);router[_0x5fc6('0x15')](_0x5fc6('0x16'),auth[_0x5fc6('0xa')](),controller['accept']);router[_0x5fc6('0x15')]('/:id/reject',auth[_0x5fc6('0xa')](),controller[_0x5fc6('0x17')]);router[_0x5fc6('0x18')](_0x5fc6('0xd'),auth['isAuthenticated'](),controller[_0x5fc6('0x19')]);module['exports']=router;
\ No newline at end of file
index bdddbd0..251eb56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4dc=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long'];(function(_0xf8c6d6,_0x36cd21){var _0x4fc1c9=function(_0x7d500f){while(--_0x7d500f){_0xf8c6d6['push'](_0xf8c6d6['shift']());}};_0x4fc1c9(++_0x36cd21);}(_0xd4dc,0xbe));var _0xcd4d=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xd4dc[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0xcd4d('0x0'));var _=require(_0xcd4d('0x1'));module[_0xcd4d('0x2')]={'body':{'type':Sequelize[_0xcd4d('0x3')](_0xcd4d('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xcd4d('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcd4d('0x6')]('in',_0xcd4d('0x7')),'defaultValue':_0xcd4d('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcd4d('0x8')](0x1fe)},'from':{'type':Sequelize[_0xcd4d('0x8')]},'to':{'type':Sequelize[_0xcd4d('0x3')](_0xcd4d('0x4'))},'cc':{'type':Sequelize[_0xcd4d('0x3')]('long')},'bcc':{'type':Sequelize[_0xcd4d('0x3')](_0xcd4d('0x4'))},'subject':{'type':Sequelize[_0xcd4d('0x3')]},'sentAt':{'type':Sequelize[_0xcd4d('0x9')]},'attach':{'type':Sequelize[_0xcd4d('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcd4d('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xcd4d('0x9')]},'originTo':{'type':Sequelize[_0xcd4d('0x3')](_0xcd4d('0x4'))},'originCc':{'type':Sequelize[_0xcd4d('0x3')](_0xcd4d('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0xcd4d('0xb'),_0xcd4d('0xc')),'defaultValue':_0xcd4d('0xb'),'allowNull':![]}};
\ No newline at end of file
+var _0xbccd=['long','ENUM','out','STRING','INTEGER','BOOLEAN','DATE','Chat','Email','lodash','TEXT'];(function(_0x1d3892,_0x47d5fe){var _0x574ff2=function(_0x5cc441){while(--_0x5cc441){_0x1d3892['push'](_0x1d3892['shift']());}};_0x574ff2(++_0x47d5fe);}(_0xbccd,0x1ab));var _0xdbcc=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xbccd[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require('sequelize');var _=require(_0xdbcc('0x0'));module['exports']={'body':{'type':Sequelize[_0xdbcc('0x1')](_0xdbcc('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xdbcc('0x1')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdbcc('0x3')]('in',_0xdbcc('0x4')),'defaultValue':_0xdbcc('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdbcc('0x5')](0x1fe)},'from':{'type':Sequelize[_0xdbcc('0x5')]},'to':{'type':Sequelize[_0xdbcc('0x1')](_0xdbcc('0x2'))},'cc':{'type':Sequelize[_0xdbcc('0x1')](_0xdbcc('0x2'))},'bcc':{'type':Sequelize[_0xdbcc('0x1')](_0xdbcc('0x2'))},'subject':{'type':Sequelize[_0xdbcc('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xdbcc('0x6')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xdbcc('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0xdbcc('0x2'))},'originCc':{'type':Sequelize[_0xdbcc('0x1')](_0xdbcc('0x2'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0xdbcc('0x9')),'defaultValue':_0xdbcc('0xa'),'allowNull':![]}};
\ No newline at end of file
index 606c59f..4bceedc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ff1=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','User','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','email','reject','rejectmessage','download','unix','toString','server','files','tmp','bcc','subject','createdAt','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','build','writeFileSync','eml-format','moment','bluebird','path','lodash','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','undefined','limit','count','offset','status','Content-Range','json','update','then','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','options','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','Contacts','defaults','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','user','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage'];(function(_0xc92b81,_0x1ba725){var _0x38d666=function(_0x1c849b){while(--_0x1c849b){_0xc92b81['push'](_0xc92b81['shift']());}};_0x38d666(++_0x1ba725);}(_0x4ff1,0x157));var _0x14ff=function(_0x5e7990,_0x20fcbe){_0x5e7990=_0x5e7990-0x0;var _0x5d5b2e=_0x4ff1[_0x5e7990];return _0x5d5b2e;};'use strict';var emlformat=require(_0x14ff('0x0'));var moment=require(_0x14ff('0x1'));var BPromise=require(_0x14ff('0x2'));var util=require('util');var path=require(_0x14ff('0x3'));var fs=require('fs');var _=require(_0x14ff('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x14ff('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x14ff('0x6'))(_0x14ff('0x7'));var interaction_log=require(_0x14ff('0x6'))(_0x14ff('0x8'));var config=require(_0x14ff('0x9'));var db=require(_0x14ff('0xa'))['db'];config[_0x14ff('0xb')]=_['defaults'](config[_0x14ff('0xb')],{'host':_0x14ff('0xc'),'port':0x18eb});var socket=require(_0x14ff('0xd'))(new Redis(config[_0x14ff('0xb')]));var htmlEntities=require(_0x14ff('0xe'));require('./mailMessage.socket')[_0x14ff('0xf')](socket);var jayson=require(_0x14ff('0x10'));var client=jayson[_0x14ff('0x11')][_0x14ff('0x12')]({'port':0x232c});var client9003=jayson[_0x14ff('0x11')]['http']({'port':0x232b});var client9002=jayson[_0x14ff('0x11')][_0x14ff('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x2f57bf,_0x2e4c02,_0x7f76a2,_0x491bc0){return new BPromise(function(_0x52b38e,_0xb276cf){var _0x365520=_0x491bc0||client;return _0x365520[_0x14ff('0x13')](_0x2f57bf,_0x7f76a2)['then'](function(_0x25b8a0){logger[_0x14ff('0x14')](_0x14ff('0x15'),_0x2e4c02,'request\x20sent');logger[_0x14ff('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2e4c02,_0x14ff('0x17'),JSON[_0x14ff('0x18')](_0x25b8a0));if(_0x25b8a0[_0x14ff('0x19')]){if(_0x25b8a0[_0x14ff('0x19')][_0x14ff('0x1a')]===0x1f4){logger['error'](_0x14ff('0x15'),_0x2e4c02,_0x25b8a0['error'][_0x14ff('0x1b')]);return _0xb276cf(_0x25b8a0[_0x14ff('0x19')][_0x14ff('0x1b')]);}logger[_0x14ff('0x19')](_0x14ff('0x15'),_0x2e4c02,_0x25b8a0['error'][_0x14ff('0x1b')]);return _0x52b38e(_0x25b8a0[_0x14ff('0x19')][_0x14ff('0x1b')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x2e4c02,'request\x20sent');_0x52b38e(_0x25b8a0['result'][_0x14ff('0x1b')]);}})['catch'](function(_0x409f47){logger[_0x14ff('0x19')](_0x14ff('0x15'),_0x2e4c02,_0x409f47);_0xb276cf(_0x409f47);});});}function respondWithResult(_0x138b3a,_0xb30810){_0xb30810=_0xb30810||0xc8;return function(_0x2955f7){if(_0x2955f7){return _0x138b3a['status'](_0xb30810)['json'](_0x2955f7);}};}function respondWithFilteredResult(_0x5ae74a,_0x4dea84){return function(_0xa0376f){if(_0xa0376f){var _0x57c8fb=typeof _0x4dea84['offset']===_0x14ff('0x1c')&&typeof _0x4dea84[_0x14ff('0x1d')]===_0x14ff('0x1c');var _0x1c123b=_0xa0376f[_0x14ff('0x1e')];var _0x5aaa4b=_0x57c8fb?0x0:_0x4dea84['offset'];var _0x57c9e9=_0x57c8fb?_0xa0376f[_0x14ff('0x1e')]:_0x4dea84[_0x14ff('0x1f')]+_0x4dea84['limit'];var _0x4e4864;if(_0x57c9e9>=_0x1c123b){_0x57c9e9=_0x1c123b;_0x4e4864=0xc8;}else{_0x4e4864=0xce;}_0x5ae74a[_0x14ff('0x20')](_0x4e4864);return _0x5ae74a['set'](_0x14ff('0x21'),_0x5aaa4b+'-'+_0x57c9e9+'/'+_0x1c123b)[_0x14ff('0x22')](_0xa0376f);}return null;};}function saveUpdates(_0x2fb5e5){return function(_0x4bdc7e){if(_0x4bdc7e){return _0x4bdc7e[_0x14ff('0x23')](_0x2fb5e5)[_0x14ff('0x24')](function(_0x506402){return _0x506402;});}return null;};}function removeEntity(_0x2127c9){return function(_0x10a4c7){if(_0x10a4c7){return _0x10a4c7[_0x14ff('0x25')]()[_0x14ff('0x24')](function(){_0x2127c9[_0x14ff('0x20')](0xcc)[_0x14ff('0x26')]();});}};}function handleEntityNotFound(_0x30f6f6){return function(_0x312cda){if(!_0x312cda){_0x30f6f6[_0x14ff('0x27')](0x194);}return _0x312cda;};}function handleError(_0x554960,_0x3612de){_0x3612de=_0x3612de||0x1f4;return function(_0x5bddca){logger[_0x14ff('0x19')](_0x5bddca['stack']);if(_0x5bddca[_0x14ff('0x28')]){delete _0x5bddca[_0x14ff('0x28')];}_0x554960[_0x14ff('0x20')](_0x3612de)[_0x14ff('0x29')](_0x5bddca);};}exports[_0x14ff('0x2a')]=function(_0x2fe827,_0x556f5e){var _0x1ab880={},_0x5f1db5={},_0x28d317={'count':0x0,'rows':[]};var _0x545386=_[_0x14ff('0x2b')](db[_0x14ff('0x2c')][_0x14ff('0x2d')],function(_0x5b13b1){return{'name':_0x5b13b1['fieldName'],'type':_0x5b13b1[_0x14ff('0x2e')]['key']};});_0x5f1db5[_0x14ff('0x2f')]=_[_0x14ff('0x2b')](_0x545386,_0x14ff('0x28'));_0x5f1db5[_0x14ff('0x30')]=_[_0x14ff('0x31')](_0x2fe827[_0x14ff('0x30')]);_0x5f1db5[_0x14ff('0x32')]=_['intersection'](_0x5f1db5['model'],_0x5f1db5[_0x14ff('0x30')]);_0x1ab880['attributes']=_[_0x14ff('0x33')](_0x5f1db5[_0x14ff('0x2f')],qs['fields'](_0x2fe827[_0x14ff('0x30')][_0x14ff('0x34')]));_0x1ab880[_0x14ff('0x35')]=_0x1ab880[_0x14ff('0x35')][_0x14ff('0x36')]?_0x1ab880[_0x14ff('0x35')]:_0x5f1db5['model'];if(!_0x2fe827['query']['hasOwnProperty']('nolimit')){_0x1ab880[_0x14ff('0x1d')]=qs[_0x14ff('0x1d')](_0x2fe827[_0x14ff('0x30')]['limit']);_0x1ab880[_0x14ff('0x1f')]=qs[_0x14ff('0x1f')](_0x2fe827[_0x14ff('0x30')][_0x14ff('0x1f')]);}_0x1ab880['order']=qs[_0x14ff('0x37')](_0x2fe827[_0x14ff('0x30')][_0x14ff('0x37')]);_0x1ab880[_0x14ff('0x38')]=qs[_0x14ff('0x32')](_['pick'](_0x2fe827[_0x14ff('0x30')],_0x5f1db5[_0x14ff('0x32')]),_0x545386);if(_0x2fe827[_0x14ff('0x30')][_0x14ff('0x39')]){_0x1ab880['where']=_[_0x14ff('0x3a')](_0x1ab880[_0x14ff('0x38')],{'$or':_[_0x14ff('0x2b')](_0x545386,function(_0x270990){if(_0x270990[_0x14ff('0x2e')]!==_0x14ff('0x3b')){var _0x2bedb6={};_0x2bedb6[_0x270990[_0x14ff('0x28')]]={'$like':'%'+_0x2fe827[_0x14ff('0x30')][_0x14ff('0x39')]+'%'};return _0x2bedb6;}})});}_0x1ab880=_[_0x14ff('0x3a')]({},_0x1ab880,_0x2fe827['options']);var _0x4dca22={'where':_0x1ab880[_0x14ff('0x38')]};return db['MailMessage'][_0x14ff('0x1e')](_0x4dca22)['then'](function(_0x1ed075){_0x28d317[_0x14ff('0x1e')]=_0x1ed075;if(_0x2fe827['query']['includeAll']){_0x1ab880['include']=[{'all':!![]}];}return db[_0x14ff('0x2c')][_0x14ff('0x3c')](_0x1ab880);})['then'](function(_0x1907a6){_0x28d317[_0x14ff('0x3d')]=_0x1907a6;return _0x28d317;})['then'](respondWithFilteredResult(_0x556f5e,_0x1ab880))[_0x14ff('0x3e')](handleError(_0x556f5e,null));};exports[_0x14ff('0x3f')]=function(_0x2e57ac,_0xd981ed){var _0x482af2={'raw':!![],'where':{'id':_0x2e57ac[_0x14ff('0x40')]['id']}},_0x3c3d44={};_0x3c3d44[_0x14ff('0x2f')]=_[_0x14ff('0x31')](db[_0x14ff('0x2c')][_0x14ff('0x2d')]);_0x3c3d44[_0x14ff('0x30')]=_[_0x14ff('0x31')](_0x2e57ac['query']);_0x3c3d44[_0x14ff('0x32')]=_['intersection'](_0x3c3d44[_0x14ff('0x2f')],_0x3c3d44[_0x14ff('0x30')]);_0x482af2[_0x14ff('0x35')]=_[_0x14ff('0x33')](_0x3c3d44[_0x14ff('0x2f')],qs[_0x14ff('0x34')](_0x2e57ac[_0x14ff('0x30')]['fields']));_0x482af2[_0x14ff('0x35')]=_0x482af2[_0x14ff('0x35')][_0x14ff('0x36')]?_0x482af2['attributes']:_0x3c3d44['model'];if(_0x2e57ac[_0x14ff('0x30')][_0x14ff('0x41')]){_0x482af2[_0x14ff('0x42')]=[{'all':!![]}];}_0x482af2=_[_0x14ff('0x3a')]({},_0x482af2,_0x2e57ac[_0x14ff('0x43')]);return db[_0x14ff('0x2c')][_0x14ff('0x44')](_0x482af2)[_0x14ff('0x24')](handleEntityNotFound(_0xd981ed,null))[_0x14ff('0x24')](respondWithResult(_0xd981ed,null))['catch'](handleError(_0xd981ed,null));};exports[_0x14ff('0x23')]=function(_0x171198,_0x1f7470){if(_0x171198[_0x14ff('0x45')]['id']){delete _0x171198[_0x14ff('0x45')]['id'];}return db['MailMessage'][_0x14ff('0x44')]({'where':{'id':_0x171198[_0x14ff('0x40')]['id']}})[_0x14ff('0x24')](handleEntityNotFound(_0x1f7470,null))[_0x14ff('0x24')](saveUpdates(_0x171198[_0x14ff('0x45')],null))['then'](respondWithResult(_0x1f7470,null))['catch'](handleError(_0x1f7470,null));};exports[_0x14ff('0x25')]=function(_0x4ba356,_0x34fc90){return db['MailMessage'][_0x14ff('0x44')]({'where':{'id':_0x4ba356[_0x14ff('0x40')]['id']}})[_0x14ff('0x24')](handleEntityNotFound(_0x34fc90,null))[_0x14ff('0x24')](removeEntity(_0x34fc90,null))[_0x14ff('0x3e')](handleError(_0x34fc90,null));};exports[_0x14ff('0x46')]=function(_0x38b1ae,_0x4f30ca){return db['MailMessage'][_0x14ff('0x46')]()[_0x14ff('0x24')](respondWithResult(_0x4f30ca,null))[_0x14ff('0x3e')](handleError(_0x4f30ca,null));};exports[_0x14ff('0x47')]=function(_0xe74574,_0x1b6cff){return db[_0x14ff('0x2c')][_0x14ff('0x47')](_0xe74574[_0x14ff('0x45')])[_0x14ff('0x24')](function(_0x5a05e4){if(_0x5a05e4){if(_0x5a05e4[_0x14ff('0x48')]===_0x14ff('0x49')&&!_0x5a05e4[_0x14ff('0x4a')]){var _0x40c76b,_0x173959,_0x429d7a;if(_0xe74574[_0x14ff('0x45')]['to']){_0x173959=_0xe74574[_0x14ff('0x45')]['to'][_0x14ff('0x4b')](',')[0x0];}return db[_0x14ff('0x4c')][_0x14ff('0x4d')]({'where':{'id':_0x5a05e4['MailAccountId']},'include':[{'model':db[_0x14ff('0x4e')],'as':_0x14ff('0x4f'),'include':[{'model':db[_0x14ff('0x50')],'as':'Contacts','where':{'email':_0x173959},'limit':0x1,'order':[[_0x14ff('0x51'),_0x14ff('0x52')]]}]},{'model':db[_0x14ff('0x53')],'as':_0x14ff('0x54'),'raw':!![],'include':[{'model':db[_0x14ff('0x55')],'as':_0x14ff('0x55'),'raw':!![]}]}]})[_0x14ff('0x24')](function(_0x2c0cd4){_0x40c76b=_0x2c0cd4;if(!_0x40c76b||!_0x40c76b[_0x14ff('0x54')])return;var _0x1d225e=_0x40c76b[_0x14ff('0x56')]();if(_0xe74574['body'][_0x14ff('0x57')]&&_0xe74574[_0x14ff('0x45')][_0x14ff('0x57')][_0x14ff('0x36')]){for(var _0x1dbd6c=0x0;_0x1dbd6c<_0xe74574[_0x14ff('0x45')][_0x14ff('0x57')][_0x14ff('0x36')];_0x1dbd6c+=0x1){_0xe74574[_0x14ff('0x45')][_0x14ff('0x57')][_0x1dbd6c]={'filename':_0xe74574[_0x14ff('0x45')]['attachments'][_0x1dbd6c][_0x14ff('0x28')],'path':path[_0x14ff('0x58')](config[_0x14ff('0x59')],'server/files/attachments',_0xe74574['body'][_0x14ff('0x57')][_0x1dbd6c][_0x14ff('0x5a')])};}}_0x429d7a={'account':_0x1d225e,'message':_0xe74574[_0x14ff('0x45')]};return;})[_0x14ff('0x24')](function(){if(_0x40c76b[_0x14ff('0x4f')]){if(_0x40c76b[_0x14ff('0x4f')][_0x14ff('0x5b')][_0x14ff('0x36')]){return _0x40c76b[_0x14ff('0x4f')][_0x14ff('0x5b')][0x0];}else{return db[_0x14ff('0x50')][_0x14ff('0x47')](_[_0x14ff('0x5c')](_0xe74574[_0x14ff('0x45')],{'firstName':_0xe74574[_0x14ff('0x45')]['to'],'email':_0xe74574['body']['to'],'phone':_0xe74574[_0x14ff('0x45')]['to'],'ListId':_0x40c76b['ListId']}));}}else{throw new Error(_0x14ff('0x5d'));}})[_0x14ff('0x24')](function(){if(_0x429d7a){return respondWithRpcPromise('SendMail',_0x14ff('0x5e'),_0x429d7a,client9003)[_0x14ff('0x24')](function(_0x479d29){return _0x5a05e4[_0x14ff('0x23')]({'read':!![],'messageId':_0x479d29[_0x14ff('0x5f')],'sentAt':moment()[_0x14ff('0x60')](_0x14ff('0x61'))});})[_0x14ff('0x3e')](function(_0xc93d3){logger[_0x14ff('0x19')]('%s',JSON[_0x14ff('0x18')](_0xc93d3));return _0x5a05e4;});}return _0x5a05e4;});}return _0x5a05e4;}})['then'](respondWithResult(_0x1b6cff,0xc9))[_0x14ff('0x3e')](handleError(_0x1b6cff,null));};exports[_0x14ff('0x62')]=function(_0x1fd891,_0x325081){var _0x22724c={'agent':{},'channel':_0x14ff('0x63')};if(_0x1fd891[_0x14ff('0x45')]['id']){delete _0x1fd891[_0x14ff('0x45')]['id'];}_0x1fd891[_0x14ff('0x45')]['read']=!![];_0x1fd891[_0x14ff('0x45')][_0x14ff('0x64')]=moment()[_0x14ff('0x60')](_0x14ff('0x61'));_0x1fd891['body'][_0x14ff('0x65')]=_0x1fd891[_0x14ff('0x45')][_0x14ff('0x65')]||_0x1fd891[_0x14ff('0x66')]['id'];_0x22724c['agent']['id']=_0x1fd891[_0x14ff('0x45')][_0x14ff('0x65')];return db[_0x14ff('0x2c')][_0x14ff('0x44')]({'where':{'id':_0x1fd891[_0x14ff('0x40')]['id'],'UserId':null}})[_0x14ff('0x24')](handleEntityNotFound(_0x325081,null))['then'](saveUpdates(_0x1fd891[_0x14ff('0x45')],null))[_0x14ff('0x24')](function(_0x32cfc1){if(_0x32cfc1){_0x22724c[_0x14ff('0x1b')]=_0x32cfc1[_0x14ff('0x67')]({'plain':!![]});return db[_0x14ff('0x68')][_0x14ff('0x44')]({'where':{'id':_0x32cfc1[_0x14ff('0x69')]}});}return null;})[_0x14ff('0x24')](handleEntityNotFound(_0x325081,null))[_0x14ff('0x24')](function(_0x3d0db9){if(_0x3d0db9){return _0x3d0db9[_0x14ff('0x23')]({'UserId':_0x1fd891[_0x14ff('0x45')]['UserId'],'read1stAt':_[_0x14ff('0x6a')](_0x3d0db9['read1stAt'])?moment()[_0x14ff('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x14ff('0x24')](function(_0x437bed){if(_0x437bed){_0x22724c[_0x14ff('0x6b')]=_0x437bed[_0x14ff('0x67')]({'plain':!![]});interaction_log['info'](_0x14ff('0x6c'),_0x1fd891['user']['id'],_0x1fd891['user']['name'],_0x1fd891['user'][_0x14ff('0x6d')],_0x22724c[_0x14ff('0x6b')]['id'],_0x1fd891[_0x14ff('0x45')]?JSON['stringify'](_0x1fd891[_0x14ff('0x45')]):_0x14ff('0x6e'));return respondWithRpcPromise(_0x14ff('0x6f'),_0x14ff('0x70'),_0x22724c);}return null;})[_0x14ff('0x24')](function(_0x5e4fd8){var _0x17c2bc=_0x14ff('0x71')+_0x5e4fd8[_0x14ff('0x1b')][_0x14ff('0x72')];return db['sequelize']['query'](_0x17c2bc,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x37367e){return _0x37367e;});})[_0x14ff('0x24')](function(_0x224339){if(_0x224339){_0x22724c['message'][_0x14ff('0x73')]=_0x224339[0x0];if(!_0x1fd891[_0x14ff('0x45')][_0x14ff('0x65')])return;return db[_0x14ff('0x74')][_0x14ff('0x44')]({'where':{'id':_0x1fd891[_0x14ff('0x45')][_0x14ff('0x65')],'role':_0x14ff('0x75')},'attributes':['id',_0x14ff('0x28'),_0x14ff('0x76'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0xb349cf){if(!_0xb349cf)return null;_0x22724c['message'][_0x14ff('0x75')]=_0xb349cf;return _0x22724c;})['then'](function(_0x4781f3){if(_0x4781f3){if(_0x1fd891['body'][_0x14ff('0x77')]){_0x22724c[_0x14ff('0x1b')][_0x14ff('0x78')]=util[_0x14ff('0x60')](_0x14ff('0x79'),_0x1fd891[_0x14ff('0x66')]['name']);_0x22724c[_0x14ff('0x1b')]['channel']=_0x22724c[_0x14ff('0x7a')];_0x22724c['message'][_0x14ff('0x7b')]=_0x22724c[_0x14ff('0x7a')];_0x22724c[_0x14ff('0x1b')][_0x14ff('0x7c')]=_0x14ff('0x62');_0x22724c[_0x14ff('0x1b')][_0x14ff('0x45')]=htmlToText[_0x14ff('0x7d')](_0x22724c['message'][_0x14ff('0x45')]);return respondWithRpcPromise('EventManager',_0x14ff('0x7e'),{'event':'acceptmessage','message':_0x22724c[_0x14ff('0x1b')]},client9002)['then'](function(){return _0x22724c;});}return _0x22724c;}return null;})['then'](respondWithResult(_0x325081,null))[_0x14ff('0x3e')](handleError(_0x325081,null));};exports['reject']=function(_0xbac8ba,_0x1d5394){var _0x2e764e={'agent':{},'channel':_0x14ff('0x63')};if(_0xbac8ba[_0x14ff('0x45')]['id']){delete _0xbac8ba[_0x14ff('0x45')]['id'];}_0xbac8ba['body'][_0x14ff('0x65')]=_0xbac8ba[_0x14ff('0x45')][_0x14ff('0x65')]||_0xbac8ba[_0x14ff('0x66')]['id'];_0x2e764e[_0x14ff('0x75')]['id']=_0xbac8ba[_0x14ff('0x45')][_0x14ff('0x65')];return db[_0x14ff('0x2c')][_0x14ff('0x44')]({'where':{'id':_0xbac8ba[_0x14ff('0x40')]['id'],'UserId':null}})[_0x14ff('0x24')](handleEntityNotFound(_0x1d5394,null))[_0x14ff('0x24')](function(_0x536fa5){if(_0x536fa5){_0x2e764e[_0x14ff('0x1b')]=_0x536fa5['get']({'plain':!![]});return db[_0x14ff('0x68')][_0x14ff('0x44')]({'where':{'id':_0x536fa5[_0x14ff('0x69')]}});}return null;})[_0x14ff('0x24')](handleEntityNotFound(_0x1d5394,null))[_0x14ff('0x24')](function(_0x483135){if(_0x483135){_0x2e764e[_0x14ff('0x6b')]=_0x483135[_0x14ff('0x67')]({'plain':!![]});interaction_log['info'](_0x14ff('0x7f'),_0xbac8ba[_0x14ff('0x66')]['id'],_0xbac8ba['user']['name'],_0xbac8ba['user'][_0x14ff('0x6d')],_0x2e764e['interaction']['id'],_0xbac8ba[_0x14ff('0x45')]?JSON[_0x14ff('0x18')](_0xbac8ba[_0x14ff('0x45')]):_0x14ff('0x6e'));return respondWithRpcPromise(_0x14ff('0x80'),_0x14ff('0x81'),_0x2e764e);}return null;})['then'](function(_0xb7111b){var _0x542651=_0x14ff('0x71')+_0xb7111b[_0x14ff('0x1b')]['ContactId'];return db[_0x14ff('0x82')][_0x14ff('0x30')](_0x542651,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x14ff('0x24')](function(_0x2c592c){return _0x2c592c;});})[_0x14ff('0x24')](function(_0xda13db){if(_0xda13db){_0x2e764e['message'][_0x14ff('0x73')]=_0xda13db[0x0];if(!_0xbac8ba[_0x14ff('0x45')]['UserId'])return;return db[_0x14ff('0x74')][_0x14ff('0x44')]({'where':{'id':_0xbac8ba[_0x14ff('0x45')][_0x14ff('0x65')],'role':_0x14ff('0x75')},'attributes':['id',_0x14ff('0x28'),'fullname',_0x14ff('0x83'),'internal'],'raw':!![]});}return null;})['then'](function(_0x20367e){if(!_0x20367e)return null;_0x2e764e[_0x14ff('0x1b')][_0x14ff('0x75')]=_0x20367e;return _0x2e764e;})[_0x14ff('0x24')](function(_0x160fbf){if(_0x160fbf){_0x160fbf['message']['interface']=util[_0x14ff('0x60')](_0x14ff('0x79'),_0xbac8ba[_0x14ff('0x66')][_0x14ff('0x28')]);_0x160fbf[_0x14ff('0x1b')]['channel']=_0x2e764e[_0x14ff('0x7a')];_0x160fbf[_0x14ff('0x1b')][_0x14ff('0x7b')]=_0x2e764e[_0x14ff('0x7a')];_0x160fbf[_0x14ff('0x1b')][_0x14ff('0x7c')]=_0x14ff('0x84');_0x160fbf[_0x14ff('0x1b')]['body']=htmlToText['fromString'](_0x2e764e[_0x14ff('0x1b')][_0x14ff('0x45')]);respondWithRpcPromise(_0x14ff('0x7e'),_0x14ff('0x7e'),{'event':_0x14ff('0x85'),'message':_0x160fbf[_0x14ff('0x1b')]},client9002);return _0x2e764e;}return null;})[_0x14ff('0x24')](respondWithResult(_0x1d5394,null))[_0x14ff('0x3e')](handleError(_0x1d5394,null));};exports[_0x14ff('0x86')]=function(_0xa4ea2b,_0x20feef){var _0x12ca58=moment()[_0x14ff('0x87')]()[_0x14ff('0x88')]();var _0x137eba=path[_0x14ff('0x58')](config[_0x14ff('0x59')],_0x14ff('0x89'),_0x14ff('0x8a'),_0x14ff('0x8b'));var _0x161697=path['join'](config['root'],_0x14ff('0x89'),'files','attachments');var _0x4d5aaf=util[_0x14ff('0x60')]('message-%s.eml',_0x12ca58);return db[_0x14ff('0x2c')]['find']({'where':{'id':_0xa4ea2b[_0x14ff('0x40')]['id']},'attributes':['id',_0x14ff('0x45'),'from','to','cc',_0x14ff('0x8c'),_0x14ff('0x8d'),_0x14ff('0x8e')],'include':_0xa4ea2b['query'][_0x14ff('0x57')]?[{'model':db['Attachment'],'as':_0x14ff('0x8f')}]:undefined})[_0x14ff('0x24')](handleEntityNotFound(_0x20feef,null))[_0x14ff('0x24')](function(_0x3650f0){if(_0x3650f0){var _0x6f951=_0x3650f0;var _0x289ae0={'from':_0x6f951[_0x14ff('0x90')],'to':_0x6f951['to'],'subject':_0x6f951[_0x14ff('0x8d')],'html':htmlEntities[_0x14ff('0x91')](_0x6f951[_0x14ff('0x45')]),'headers':{'Date':moment(_0x6f951['createdAt'])[_0x14ff('0x60')](_0x14ff('0x92'))},'attachments':[]};if(_0x3650f0['cc']){_0x289ae0[_0x14ff('0x93')]['Cc']=_0x3650f0['cc'];}if(_0x3650f0[_0x14ff('0x8c')]){_0x289ae0[_0x14ff('0x93')]['Bcc']=_0x3650f0['bcc'];}return new BPromise(function(_0x53ffe4,_0x23eaad){if(_0x3650f0[_0x14ff('0x8f')]){for(var _0x14683b=0x0;_0x14683b<_0x3650f0[_0x14ff('0x8f')][_0x14ff('0x36')];_0x14683b++){var _0x504eb1=_0x3650f0[_0x14ff('0x8f')][_0x14683b];var _0x480a02=path[_0x14ff('0x58')](_0x161697,_0x504eb1[_0x14ff('0x5a')]);if(fs[_0x14ff('0x94')](_0x480a02)){_0x289ae0[_0x14ff('0x57')][_0x14ff('0x95')]({'name':_0x504eb1[_0x14ff('0x28')],'contentType':_0x504eb1['type'],'data':fs['readFileSync'](_0x480a02)});}}}emlformat[_0x14ff('0x96')](_0x289ae0,function(_0x4749b6,_0xf54d25){if(_0x4749b6)return _0x23eaad(_0x4749b6);fs[_0x14ff('0x97')](path['join'](_0x137eba,_0x4d5aaf),_0xf54d25);return _0x53ffe4(_0xf54d25);});});}})[_0x14ff('0x24')](function(_0x2b8b60){if(_0x2b8b60){return _0x20feef[_0x14ff('0x86')](path[_0x14ff('0x58')](_0x137eba,_0x4d5aaf),_0x4d5aaf,function(_0x4ab4cc){if(!_0x4ab4cc)fs['unlinkSync'](path['join'](_0x137eba,_0x4d5aaf));});}})[_0x14ff('0x3e')](handleError(_0x20feef,null));};
\ No newline at end of file
+var _0xe805=['read','readAt','format','UserId','agent','MailInteractionId','interaction','get','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','interface','motionChannel','rejectmessage','unix','toString','server','files','message-%s.eml','from','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','build','download','unlinkSync','moment','bluebird','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','status','json','offset','undefined','limit','count','set','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','query','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','filters','find','update','body','describe','direction','out','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','create','ListId','List\x20not\x20found','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail'];(function(_0x2dde8e,_0x5438ca){var _0x437977=function(_0x117b4b){while(--_0x117b4b){_0x2dde8e['push'](_0x2dde8e['shift']());}};_0x437977(++_0x5438ca);}(_0xe805,0xd4));var _0x5e80=function(_0x3c1d34,_0x465fce){_0x3c1d34=_0x3c1d34-0x0;var _0x22c6e8=_0xe805[_0x3c1d34];return _0x22c6e8;};'use strict';var emlformat=require('eml-format');var moment=require(_0x5e80('0x0'));var BPromise=require(_0x5e80('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x5e80('0x2'));var Redis=require(_0x5e80('0x3'));var htmlToText=require(_0x5e80('0x4'));var qs=require(_0x5e80('0x5'));var logger=require('../../config/logger')(_0x5e80('0x6'));var interaction_log=require(_0x5e80('0x7'))(_0x5e80('0x8'));var config=require(_0x5e80('0x9'));var db=require(_0x5e80('0xa'))['db'];config[_0x5e80('0xb')]=_[_0x5e80('0xc')](config[_0x5e80('0xb')],{'host':_0x5e80('0xd'),'port':0x18eb});var socket=require(_0x5e80('0xe'))(new Redis(config['redis']));var htmlEntities=require(_0x5e80('0xf'));require(_0x5e80('0x10'))[_0x5e80('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5e80('0x12')][_0x5e80('0x13')]({'port':0x232c});var client9003=jayson[_0x5e80('0x12')]['http']({'port':0x232b});var client9002=jayson['client'][_0x5e80('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x267ddf,_0x28eb12,_0x9ab4a4,_0x560efb){return new BPromise(function(_0x2baaa1,_0x226d56){var _0x39fee8=_0x560efb||client;return _0x39fee8[_0x5e80('0x14')](_0x267ddf,_0x9ab4a4)[_0x5e80('0x15')](function(_0x14fa1b){logger['info']('MailMessage,\x20%s,\x20%s',_0x28eb12,'request\x20sent');logger['debug'](_0x5e80('0x16'),_0x28eb12,_0x5e80('0x17'),JSON[_0x5e80('0x18')](_0x14fa1b));if(_0x14fa1b['error']){if(_0x14fa1b[_0x5e80('0x19')][_0x5e80('0x1a')]===0x1f4){logger[_0x5e80('0x19')]('MailMessage,\x20%s,\x20%s',_0x28eb12,_0x14fa1b[_0x5e80('0x19')]['message']);return _0x226d56(_0x14fa1b[_0x5e80('0x19')][_0x5e80('0x1b')]);}logger[_0x5e80('0x19')]('MailMessage,\x20%s,\x20%s',_0x28eb12,_0x14fa1b[_0x5e80('0x19')]['message']);return _0x2baaa1(_0x14fa1b['error'][_0x5e80('0x1b')]);}else{logger['info'](_0x5e80('0x1c'),_0x28eb12,_0x5e80('0x17'));_0x2baaa1(_0x14fa1b[_0x5e80('0x1d')][_0x5e80('0x1b')]);}})[_0x5e80('0x1e')](function(_0x2ae463){logger[_0x5e80('0x19')](_0x5e80('0x1c'),_0x28eb12,_0x2ae463);_0x226d56(_0x2ae463);});});}function respondWithResult(_0x4ea679,_0xe1713a){_0xe1713a=_0xe1713a||0xc8;return function(_0x4e23ef){if(_0x4e23ef){return _0x4ea679[_0x5e80('0x1f')](_0xe1713a)[_0x5e80('0x20')](_0x4e23ef);}};}function respondWithFilteredResult(_0x174f4b,_0xe6cff2){return function(_0x2fc0fd){if(_0x2fc0fd){var _0x2aeb80=typeof _0xe6cff2[_0x5e80('0x21')]===_0x5e80('0x22')&&typeof _0xe6cff2[_0x5e80('0x23')]==='undefined';var _0x20a6d4=_0x2fc0fd[_0x5e80('0x24')];var _0x18ef9c=_0x2aeb80?0x0:_0xe6cff2[_0x5e80('0x21')];var _0x129281=_0x2aeb80?_0x2fc0fd[_0x5e80('0x24')]:_0xe6cff2[_0x5e80('0x21')]+_0xe6cff2[_0x5e80('0x23')];var _0x52eeff;if(_0x129281>=_0x20a6d4){_0x129281=_0x20a6d4;_0x52eeff=0xc8;}else{_0x52eeff=0xce;}_0x174f4b[_0x5e80('0x1f')](_0x52eeff);return _0x174f4b[_0x5e80('0x25')]('Content-Range',_0x18ef9c+'-'+_0x129281+'/'+_0x20a6d4)[_0x5e80('0x20')](_0x2fc0fd);}return null;};}function saveUpdates(_0x4f921d){return function(_0xe4d4b0){if(_0xe4d4b0){return _0xe4d4b0['update'](_0x4f921d)[_0x5e80('0x15')](function(_0x43a866){return _0x43a866;});}return null;};}function removeEntity(_0x346a2){return function(_0x3e5fc7){if(_0x3e5fc7){return _0x3e5fc7[_0x5e80('0x26')]()[_0x5e80('0x15')](function(){_0x346a2[_0x5e80('0x1f')](0xcc)[_0x5e80('0x27')]();});}};}function handleEntityNotFound(_0x41b81f){return function(_0x1c5408){if(!_0x1c5408){_0x41b81f[_0x5e80('0x28')](0x194);}return _0x1c5408;};}function handleError(_0x516479,_0x284a31){_0x284a31=_0x284a31||0x1f4;return function(_0xa7d769){logger[_0x5e80('0x19')](_0xa7d769['stack']);if(_0xa7d769[_0x5e80('0x29')]){delete _0xa7d769[_0x5e80('0x29')];}_0x516479[_0x5e80('0x1f')](_0x284a31)[_0x5e80('0x2a')](_0xa7d769);};}exports[_0x5e80('0x2b')]=function(_0x29eb06,_0x3f291e){var _0x51634e={},_0x283574={},_0x7ba62f={'count':0x0,'rows':[]};var _0xc4fff=_[_0x5e80('0x2c')](db[_0x5e80('0x2d')][_0x5e80('0x2e')],function(_0x16660b){return{'name':_0x16660b[_0x5e80('0x2f')],'type':_0x16660b['type']['key']};});_0x283574['model']=_['map'](_0xc4fff,_0x5e80('0x29'));_0x283574[_0x5e80('0x30')]=_['keys'](_0x29eb06[_0x5e80('0x30')]);_0x283574['filters']=_[_0x5e80('0x31')](_0x283574['model'],_0x283574[_0x5e80('0x30')]);_0x51634e[_0x5e80('0x32')]=_['intersection'](_0x283574[_0x5e80('0x33')],qs[_0x5e80('0x34')](_0x29eb06[_0x5e80('0x30')][_0x5e80('0x34')]));_0x51634e[_0x5e80('0x32')]=_0x51634e[_0x5e80('0x32')][_0x5e80('0x35')]?_0x51634e[_0x5e80('0x32')]:_0x283574[_0x5e80('0x33')];if(!_0x29eb06[_0x5e80('0x30')][_0x5e80('0x36')]('nolimit')){_0x51634e[_0x5e80('0x23')]=qs[_0x5e80('0x23')](_0x29eb06[_0x5e80('0x30')][_0x5e80('0x23')]);_0x51634e[_0x5e80('0x21')]=qs[_0x5e80('0x21')](_0x29eb06[_0x5e80('0x30')]['offset']);}_0x51634e[_0x5e80('0x37')]=qs[_0x5e80('0x38')](_0x29eb06[_0x5e80('0x30')][_0x5e80('0x38')]);_0x51634e[_0x5e80('0x39')]=qs['filters'](_['pick'](_0x29eb06[_0x5e80('0x30')],_0x283574['filters']),_0xc4fff);if(_0x29eb06[_0x5e80('0x30')][_0x5e80('0x3a')]){_0x51634e[_0x5e80('0x39')]=_['merge'](_0x51634e[_0x5e80('0x39')],{'$or':_[_0x5e80('0x2c')](_0xc4fff,function(_0x53f139){if(_0x53f139[_0x5e80('0x3b')]!==_0x5e80('0x3c')){var _0x59ae21={};_0x59ae21[_0x53f139[_0x5e80('0x29')]]={'$like':'%'+_0x29eb06[_0x5e80('0x30')][_0x5e80('0x3a')]+'%'};return _0x59ae21;}})});}_0x51634e=_[_0x5e80('0x3d')]({},_0x51634e,_0x29eb06[_0x5e80('0x3e')]);var _0x3e72f8={'where':_0x51634e[_0x5e80('0x39')]};return db[_0x5e80('0x2d')][_0x5e80('0x24')](_0x3e72f8)['then'](function(_0x39c1a0){_0x7ba62f['count']=_0x39c1a0;if(_0x29eb06['query'][_0x5e80('0x3f')]){_0x51634e[_0x5e80('0x40')]=[{'all':!![]}];}return db['MailMessage'][_0x5e80('0x41')](_0x51634e);})[_0x5e80('0x15')](function(_0x23b7ec){_0x7ba62f[_0x5e80('0x42')]=_0x23b7ec;return _0x7ba62f;})[_0x5e80('0x15')](respondWithFilteredResult(_0x3f291e,_0x51634e))['catch'](handleError(_0x3f291e,null));};exports['show']=function(_0x10bc81,_0x56d2f7){var _0x34e622={'raw':!![],'where':{'id':_0x10bc81[_0x5e80('0x43')]['id']}},_0x3a03ec={};_0x3a03ec['model']=_[_0x5e80('0x44')](db[_0x5e80('0x2d')][_0x5e80('0x2e')]);_0x3a03ec[_0x5e80('0x30')]=_[_0x5e80('0x44')](_0x10bc81['query']);_0x3a03ec[_0x5e80('0x45')]=_[_0x5e80('0x31')](_0x3a03ec[_0x5e80('0x33')],_0x3a03ec[_0x5e80('0x30')]);_0x34e622[_0x5e80('0x32')]=_[_0x5e80('0x31')](_0x3a03ec[_0x5e80('0x33')],qs[_0x5e80('0x34')](_0x10bc81['query'][_0x5e80('0x34')]));_0x34e622['attributes']=_0x34e622[_0x5e80('0x32')][_0x5e80('0x35')]?_0x34e622[_0x5e80('0x32')]:_0x3a03ec[_0x5e80('0x33')];if(_0x10bc81[_0x5e80('0x30')][_0x5e80('0x3f')]){_0x34e622[_0x5e80('0x40')]=[{'all':!![]}];}_0x34e622=_[_0x5e80('0x3d')]({},_0x34e622,_0x10bc81[_0x5e80('0x3e')]);return db[_0x5e80('0x2d')][_0x5e80('0x46')](_0x34e622)[_0x5e80('0x15')](handleEntityNotFound(_0x56d2f7,null))['then'](respondWithResult(_0x56d2f7,null))[_0x5e80('0x1e')](handleError(_0x56d2f7,null));};exports[_0x5e80('0x47')]=function(_0x424772,_0x1493de){if(_0x424772['body']['id']){delete _0x424772[_0x5e80('0x48')]['id'];}return db[_0x5e80('0x2d')][_0x5e80('0x46')]({'where':{'id':_0x424772[_0x5e80('0x43')]['id']}})[_0x5e80('0x15')](handleEntityNotFound(_0x1493de,null))['then'](saveUpdates(_0x424772[_0x5e80('0x48')],null))['then'](respondWithResult(_0x1493de,null))[_0x5e80('0x1e')](handleError(_0x1493de,null));};exports[_0x5e80('0x26')]=function(_0x593cf1,_0x312411){return db[_0x5e80('0x2d')]['find']({'where':{'id':_0x593cf1[_0x5e80('0x43')]['id']}})[_0x5e80('0x15')](handleEntityNotFound(_0x312411,null))[_0x5e80('0x15')](removeEntity(_0x312411,null))[_0x5e80('0x1e')](handleError(_0x312411,null));};exports[_0x5e80('0x49')]=function(_0x4605b4,_0x584791){return db[_0x5e80('0x2d')][_0x5e80('0x49')]()[_0x5e80('0x15')](respondWithResult(_0x584791,null))[_0x5e80('0x1e')](handleError(_0x584791,null));};exports['create']=function(_0x31c323,_0x143ff0){return db['MailMessage']['create'](_0x31c323[_0x5e80('0x48')])[_0x5e80('0x15')](function(_0x2358fa){if(_0x2358fa){if(_0x2358fa[_0x5e80('0x4a')]===_0x5e80('0x4b')&&!_0x2358fa['secret']){var _0x373f97,_0x36529d,_0x39593e;if(_0x31c323[_0x5e80('0x48')]['to']){_0x36529d=_0x31c323[_0x5e80('0x48')]['to'][_0x5e80('0x4c')](',')[0x0];}return db['MailAccount'][_0x5e80('0x4d')]({'where':{'id':_0x2358fa[_0x5e80('0x4e')]},'include':[{'model':db[_0x5e80('0x4f')],'as':_0x5e80('0x50'),'include':[{'model':db[_0x5e80('0x51')],'as':_0x5e80('0x52'),'where':{'email':_0x36529d},'limit':0x1,'order':[[_0x5e80('0x53'),_0x5e80('0x54')]]}]},{'model':db[_0x5e80('0x55')],'as':_0x5e80('0x56'),'raw':!![],'include':[{'model':db[_0x5e80('0x57')],'as':_0x5e80('0x57'),'raw':!![]}]}]})[_0x5e80('0x15')](function(_0xddc0a1){_0x373f97=_0xddc0a1;if(!_0x373f97||!_0x373f97[_0x5e80('0x56')])return;var _0x39b88b=_0x373f97[_0x5e80('0x58')]();if(_0x31c323[_0x5e80('0x48')][_0x5e80('0x59')]&&_0x31c323[_0x5e80('0x48')][_0x5e80('0x59')][_0x5e80('0x35')]){for(var _0x2254e0=0x0;_0x2254e0<_0x31c323['body'][_0x5e80('0x59')]['length'];_0x2254e0+=0x1){_0x31c323['body']['attachments'][_0x2254e0]={'filename':_0x31c323[_0x5e80('0x48')][_0x5e80('0x59')][_0x2254e0][_0x5e80('0x29')],'path':path[_0x5e80('0x5a')](config[_0x5e80('0x5b')],_0x5e80('0x5c'),_0x31c323[_0x5e80('0x48')][_0x5e80('0x59')][_0x2254e0][_0x5e80('0x5d')])};}}_0x39593e={'account':_0x39b88b,'message':_0x31c323[_0x5e80('0x48')]};return;})[_0x5e80('0x15')](function(){if(_0x373f97[_0x5e80('0x50')]){if(_0x373f97[_0x5e80('0x50')][_0x5e80('0x52')]['length']){return _0x373f97['List']['Contacts'][0x0];}else{return db[_0x5e80('0x51')][_0x5e80('0x5e')](_[_0x5e80('0xc')](_0x31c323['body'],{'firstName':_0x31c323[_0x5e80('0x48')]['to'],'email':_0x31c323[_0x5e80('0x48')]['to'],'phone':_0x31c323['body']['to'],'ListId':_0x373f97[_0x5e80('0x5f')]}));}}else{throw new Error(_0x5e80('0x60'));}})[_0x5e80('0x15')](function(){if(_0x39593e){return respondWithRpcPromise(_0x5e80('0x61'),'sendMail',_0x39593e,client9003)['then'](function(_0x3eea56){return _0x2358fa[_0x5e80('0x47')]({'read':!![],'messageId':_0x3eea56[_0x5e80('0x62')],'sentAt':moment()['format'](_0x5e80('0x63'))});})[_0x5e80('0x1e')](function(_0xc4498){logger[_0x5e80('0x19')]('%s',JSON[_0x5e80('0x18')](_0xc4498));return _0x2358fa;});}return _0x2358fa;});}return _0x2358fa;}})[_0x5e80('0x15')](respondWithResult(_0x143ff0,0xc9))[_0x5e80('0x1e')](handleError(_0x143ff0,null));};exports[_0x5e80('0x64')]=function(_0x4db335,_0x202042){var _0x125129={'agent':{},'channel':_0x5e80('0x65')};if(_0x4db335[_0x5e80('0x48')]['id']){delete _0x4db335[_0x5e80('0x48')]['id'];}_0x4db335['body'][_0x5e80('0x66')]=!![];_0x4db335[_0x5e80('0x48')][_0x5e80('0x67')]=moment()[_0x5e80('0x68')](_0x5e80('0x63'));_0x4db335['body'][_0x5e80('0x69')]=_0x4db335[_0x5e80('0x48')][_0x5e80('0x69')]||_0x4db335['user']['id'];_0x125129[_0x5e80('0x6a')]['id']=_0x4db335['body'][_0x5e80('0x69')];return db[_0x5e80('0x2d')][_0x5e80('0x46')]({'where':{'id':_0x4db335['params']['id'],'UserId':null}})[_0x5e80('0x15')](handleEntityNotFound(_0x202042,null))[_0x5e80('0x15')](saveUpdates(_0x4db335[_0x5e80('0x48')],null))[_0x5e80('0x15')](function(_0x12ae0d){if(_0x12ae0d){_0x125129[_0x5e80('0x1b')]=_0x12ae0d['get']({'plain':!![]});return db['MailInteraction'][_0x5e80('0x46')]({'where':{'id':_0x12ae0d[_0x5e80('0x6b')]}});}return null;})[_0x5e80('0x15')](handleEntityNotFound(_0x202042,null))[_0x5e80('0x15')](function(_0x25dfde){if(_0x25dfde){return _0x25dfde[_0x5e80('0x47')]({'UserId':_0x4db335['body'][_0x5e80('0x69')],'read1stAt':_['isNil'](_0x25dfde['read1stAt'])?moment()[_0x5e80('0x68')](_0x5e80('0x63')):undefined});}return null;})[_0x5e80('0x15')](function(_0x421152){if(_0x421152){_0x125129[_0x5e80('0x6c')]=_0x421152[_0x5e80('0x6d')]({'plain':!![]});interaction_log[_0x5e80('0x6e')](_0x5e80('0x6f'),_0x4db335[_0x5e80('0x70')]['id'],_0x4db335[_0x5e80('0x70')][_0x5e80('0x29')],_0x4db335['user'][_0x5e80('0x71')],_0x125129[_0x5e80('0x6c')]['id'],_0x4db335[_0x5e80('0x48')]?JSON['stringify'](_0x4db335[_0x5e80('0x48')]):'null');return respondWithRpcPromise(_0x5e80('0x72'),'acceptMessage',_0x125129);}return null;})[_0x5e80('0x15')](function(_0x492017){var _0x423ca7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x492017[_0x5e80('0x1b')][_0x5e80('0x73')];return db[_0x5e80('0x74')]['query'](_0x423ca7,{'type':db[_0x5e80('0x75')]['QueryTypes'][_0x5e80('0x76')],'raw':!![]})['then'](function(_0x139e12){return _0x139e12;});})[_0x5e80('0x15')](function(_0x1bcb56){if(_0x1bcb56){_0x125129['message'][_0x5e80('0x77')]=_0x1bcb56[0x0];if(!_0x4db335[_0x5e80('0x48')][_0x5e80('0x69')])return;return db[_0x5e80('0x78')]['find']({'where':{'id':_0x4db335[_0x5e80('0x48')][_0x5e80('0x69')],'role':_0x5e80('0x6a')},'attributes':['id',_0x5e80('0x29'),_0x5e80('0x79'),_0x5e80('0x7a'),_0x5e80('0x7b')],'raw':!![]});}return null;})[_0x5e80('0x15')](function(_0x3594d8){if(!_0x3594d8)return null;_0x125129[_0x5e80('0x1b')]['agent']=_0x3594d8;return _0x125129;})[_0x5e80('0x15')](function(_0x349fdd){if(_0x349fdd){if(_0x4db335[_0x5e80('0x48')][_0x5e80('0x7c')]){_0x125129[_0x5e80('0x1b')]['interface']=util[_0x5e80('0x68')](_0x5e80('0x7d'),_0x4db335['user']['name']);_0x125129['message']['channel']=_0x125129[_0x5e80('0x7e')];_0x125129[_0x5e80('0x1b')]['motionChannel']=_0x125129[_0x5e80('0x7e')];_0x125129[_0x5e80('0x1b')][_0x5e80('0x7f')]=_0x5e80('0x64');_0x125129[_0x5e80('0x1b')][_0x5e80('0x48')]=htmlToText[_0x5e80('0x80')](_0x125129[_0x5e80('0x1b')][_0x5e80('0x48')]);return respondWithRpcPromise(_0x5e80('0x81'),_0x5e80('0x81'),{'event':_0x5e80('0x82'),'message':_0x125129['message']},client9002)[_0x5e80('0x15')](function(){return _0x125129;});}return _0x125129;}return null;})['then'](respondWithResult(_0x202042,null))[_0x5e80('0x1e')](handleError(_0x202042,null));};exports[_0x5e80('0x83')]=function(_0x527f11,_0x450afb){var _0x100c43={'agent':{},'channel':_0x5e80('0x65')};if(_0x527f11[_0x5e80('0x48')]['id']){delete _0x527f11[_0x5e80('0x48')]['id'];}_0x527f11[_0x5e80('0x48')][_0x5e80('0x69')]=_0x527f11[_0x5e80('0x48')][_0x5e80('0x69')]||_0x527f11[_0x5e80('0x70')]['id'];_0x100c43[_0x5e80('0x6a')]['id']=_0x527f11[_0x5e80('0x48')][_0x5e80('0x69')];return db[_0x5e80('0x2d')][_0x5e80('0x46')]({'where':{'id':_0x527f11[_0x5e80('0x43')]['id'],'UserId':null}})[_0x5e80('0x15')](handleEntityNotFound(_0x450afb,null))[_0x5e80('0x15')](function(_0x40d7a5){if(_0x40d7a5){_0x100c43[_0x5e80('0x1b')]=_0x40d7a5['get']({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x40d7a5[_0x5e80('0x6b')]}});}return null;})[_0x5e80('0x15')](handleEntityNotFound(_0x450afb,null))['then'](function(_0x56a2dd){if(_0x56a2dd){_0x100c43[_0x5e80('0x6c')]=_0x56a2dd[_0x5e80('0x6d')]({'plain':!![]});interaction_log[_0x5e80('0x6e')](_0x5e80('0x84'),_0x527f11[_0x5e80('0x70')]['id'],_0x527f11[_0x5e80('0x70')][_0x5e80('0x29')],_0x527f11[_0x5e80('0x70')][_0x5e80('0x71')],_0x100c43[_0x5e80('0x6c')]['id'],_0x527f11[_0x5e80('0x48')]?JSON[_0x5e80('0x18')](_0x527f11[_0x5e80('0x48')]):'null');return respondWithRpcPromise(_0x5e80('0x85'),_0x5e80('0x86'),_0x100c43);}return null;})[_0x5e80('0x15')](function(_0xed29c4){var _0xd7d832='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xed29c4[_0x5e80('0x1b')][_0x5e80('0x73')];return db[_0x5e80('0x74')][_0x5e80('0x30')](_0xd7d832,{'type':db[_0x5e80('0x75')][_0x5e80('0x87')][_0x5e80('0x76')],'raw':!![]})['then'](function(_0x5245f4){return _0x5245f4;});})[_0x5e80('0x15')](function(_0x255e8c){if(_0x255e8c){_0x100c43[_0x5e80('0x1b')][_0x5e80('0x77')]=_0x255e8c[0x0];if(!_0x527f11['body'][_0x5e80('0x69')])return;return db[_0x5e80('0x78')][_0x5e80('0x46')]({'where':{'id':_0x527f11[_0x5e80('0x48')][_0x5e80('0x69')],'role':_0x5e80('0x6a')},'attributes':['id',_0x5e80('0x29'),_0x5e80('0x79'),_0x5e80('0x7a'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3ff30a){if(!_0x3ff30a)return null;_0x100c43[_0x5e80('0x1b')][_0x5e80('0x6a')]=_0x3ff30a;return _0x100c43;})[_0x5e80('0x15')](function(_0x5dda75){if(_0x5dda75){_0x5dda75[_0x5e80('0x1b')][_0x5e80('0x88')]=util[_0x5e80('0x68')](_0x5e80('0x7d'),_0x527f11[_0x5e80('0x70')][_0x5e80('0x29')]);_0x5dda75[_0x5e80('0x1b')]['channel']=_0x100c43[_0x5e80('0x7e')];_0x5dda75[_0x5e80('0x1b')][_0x5e80('0x89')]=_0x100c43[_0x5e80('0x7e')];_0x5dda75[_0x5e80('0x1b')][_0x5e80('0x7f')]='reject';_0x5dda75[_0x5e80('0x1b')][_0x5e80('0x48')]=htmlToText[_0x5e80('0x80')](_0x100c43[_0x5e80('0x1b')]['body']);respondWithRpcPromise(_0x5e80('0x81'),_0x5e80('0x81'),{'event':_0x5e80('0x8a'),'message':_0x5dda75[_0x5e80('0x1b')]},client9002);return _0x100c43;}return null;})[_0x5e80('0x15')](respondWithResult(_0x450afb,null))[_0x5e80('0x1e')](handleError(_0x450afb,null));};exports['download']=function(_0x5a7c65,_0x2cfdbf){var _0x43d50a=moment()[_0x5e80('0x8b')]()[_0x5e80('0x8c')]();var _0x1d0edf=path[_0x5e80('0x5a')](config['root'],_0x5e80('0x8d'),_0x5e80('0x8e'),'tmp');var _0x3e1850=path[_0x5e80('0x5a')](config[_0x5e80('0x5b')],_0x5e80('0x8d'),_0x5e80('0x8e'),_0x5e80('0x59'));var _0x5b7c6a=util['format'](_0x5e80('0x8f'),_0x43d50a);return db[_0x5e80('0x2d')][_0x5e80('0x46')]({'where':{'id':_0x5a7c65[_0x5e80('0x43')]['id']},'attributes':['id',_0x5e80('0x48'),_0x5e80('0x90'),'to','cc','bcc',_0x5e80('0x91'),_0x5e80('0x92')],'include':_0x5a7c65[_0x5e80('0x30')]['attachments']?[{'model':db['Attachment'],'as':_0x5e80('0x93')}]:undefined})[_0x5e80('0x15')](handleEntityNotFound(_0x2cfdbf,null))[_0x5e80('0x15')](function(_0x12eb08){if(_0x12eb08){var _0x5ac281=_0x12eb08;var _0x2f9b4f={'from':_0x5ac281[_0x5e80('0x90')],'to':_0x5ac281['to'],'subject':_0x5ac281[_0x5e80('0x91')],'html':htmlEntities[_0x5e80('0x94')](_0x5ac281[_0x5e80('0x48')]),'headers':{'Date':moment(_0x5ac281['createdAt'])['format'](_0x5e80('0x95'))},'attachments':[]};if(_0x12eb08['cc']){_0x2f9b4f[_0x5e80('0x96')]['Cc']=_0x12eb08['cc'];}if(_0x12eb08[_0x5e80('0x97')]){_0x2f9b4f[_0x5e80('0x96')][_0x5e80('0x98')]=_0x12eb08[_0x5e80('0x97')];}return new BPromise(function(_0x365552,_0x401f9a){if(_0x12eb08[_0x5e80('0x93')]){for(var _0x51a7a9=0x0;_0x51a7a9<_0x12eb08[_0x5e80('0x93')][_0x5e80('0x35')];_0x51a7a9++){var _0x22e33c=_0x12eb08[_0x5e80('0x93')][_0x51a7a9];var _0x2595bf=path[_0x5e80('0x5a')](_0x3e1850,_0x22e33c[_0x5e80('0x5d')]);if(fs[_0x5e80('0x99')](_0x2595bf)){_0x2f9b4f[_0x5e80('0x59')]['push']({'name':_0x22e33c['name'],'contentType':_0x22e33c[_0x5e80('0x3b')],'data':fs['readFileSync'](_0x2595bf)});}}}emlformat[_0x5e80('0x9a')](_0x2f9b4f,function(_0x1f1436,_0x480d22){if(_0x1f1436)return _0x401f9a(_0x1f1436);fs['writeFileSync'](path[_0x5e80('0x5a')](_0x1d0edf,_0x5b7c6a),_0x480d22);return _0x365552(_0x480d22);});});}})[_0x5e80('0x15')](function(_0x37bdd6){if(_0x37bdd6){return _0x2cfdbf[_0x5e80('0x9b')](path['join'](_0x1d0edf,_0x5b7c6a),_0x5b7c6a,function(_0x5062fa){if(!_0x5062fa)fs[_0x5e80('0x9c')](path[_0x5e80('0x5a')](_0x1d0edf,_0x5b7c6a));});}})['catch'](handleError(_0x2cfdbf,null));};
\ No newline at end of file
index d2d4c5b..f0f0f45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6b9=['remove','emit','hasOwnProperty','hook','MailMessage','setMaxListeners','save','update'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc6b9,0x15c));var _0x9c6b=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xc6b9[_0x53abe5];return _0xc1c37e;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x9c6b('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9c6b('0x1')](0x0);var events={'afterCreate':_0x9c6b('0x2'),'afterUpdate':_0x9c6b('0x3'),'afterDestroy':_0x9c6b('0x4')};function emitEvent(_0x372a61){return function(_0x3c7a8d,_0xe89644,_0x2b703c){MailMessageEvents[_0x9c6b('0x5')](_0x372a61+':'+_0x3c7a8d['id'],_0x3c7a8d);MailMessageEvents[_0x9c6b('0x5')](_0x372a61,_0x3c7a8d);_0x2b703c(null);};}for(var e in events){if(events[_0x9c6b('0x6')](e)){var event=events[e];MailMessage[_0x9c6b('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x0af8=['setMaxListeners','save','remove','hasOwnProperty','events','../../mysqldb','MailMessage'];(function(_0x412c46,_0x2afcd4){var _0x4bded3=function(_0x1621a2){while(--_0x1621a2){_0x412c46['push'](_0x412c46['shift']());}};_0x4bded3(++_0x2afcd4);}(_0x0af8,0x1cb));var _0x80af=function(_0x12c68c,_0x46d9cc){_0x12c68c=_0x12c68c-0x0;var _0x8128db=_0x0af8[_0x12c68c];return _0x8128db;};'use strict';var EventEmitter=require(_0x80af('0x0'));var MailMessage=require(_0x80af('0x1'))['db'][_0x80af('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x80af('0x3')](0x0);var events={'afterCreate':_0x80af('0x4'),'afterUpdate':'update','afterDestroy':_0x80af('0x5')};function emitEvent(_0x4c1c2a){return function(_0x437167,_0x1930e8,_0x3940c1){MailMessageEvents['emit'](_0x4c1c2a+':'+_0x437167['id'],_0x437167);MailMessageEvents['emit'](_0x4c1c2a,_0x437167);_0x3940c1(null);};}for(var e in events){if(events[_0x80af('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index 6dd3fd7..6733d71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d93=['FULLTEXT','body','fromString','get','direction','toLowerCase','out','secret','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject'];(function(_0x2cf3ba,_0xc53ab){var _0x16ade0=function(_0x17d785){while(--_0x17d785){_0x2cf3ba['push'](_0x2cf3ba['shift']());}};_0x16ade0(++_0xc53ab);}(_0x2d93,0x72));var _0x32d9=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x2d93[_0xb99421];return _0x4b3ec7;};'use strict';var _=require('lodash');var util=require(_0x32d9('0x0'));var logger=require('../../config/logger')(_0x32d9('0x1'));var moment=require(_0x32d9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x32d9('0x3'));var rimraf=require(_0x32d9('0x4'));var config=require(_0x32d9('0x5'));var attributes=require(_0x32d9('0x6'));module[_0x32d9('0x7')]=function(_0x37801f,_0x789e1e){return _0x37801f[_0x32d9('0x8')](_0x32d9('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x32d9('0xa'),'fields':['messageId']},{'name':_0x32d9('0xb'),'fields':[_0x32d9('0xc'),_0x32d9('0xd')],'type':_0x32d9('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4fa5e0,_0x586674,_0xad4dfb){if(_0x4fa5e0[_0x32d9('0xf')]){_0x4fa5e0['plainBody']=htmlToText[_0x32d9('0x10')](_0x4fa5e0[_0x32d9('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xad4dfb(null,_0x586674);},'afterCreate':function(_0x1b7775,_0x46e263,_0x2b713c){var _0x357f3c=_0x37801f['models'];var _0x428daf=_0x1b7775[_0x32d9('0x11')]({'plain':!![]});if(_0x428daf[_0x32d9('0x12')][_0x32d9('0x13')]()==='in'||_0x428daf['direction'][_0x32d9('0x13')]()===_0x32d9('0x14')&&!_0x428daf[_0x32d9('0x15')]&&!_['isNil'](_0x428daf[_0x32d9('0x16')])){_0x357f3c[_0x32d9('0x17')]['findOne']({'where':{'id':_0x428daf[_0x32d9('0x18')]}})[_0x32d9('0x19')](function(_0x14d679){if(_0x14d679){_0x14d679[_0x32d9('0x1a')]({'lastMsgAt':_0x428daf[_0x32d9('0x1b')],'lastMsgDirection':_0x428daf[_0x32d9('0x12')][_0x32d9('0x13')]()});}})[_0x32d9('0x1c')](function(_0x4bd65a){console[_0x32d9('0x1d')](_0x4bd65a);});}_0x2b713c();}},'charset':_0x32d9('0x1e'),'collate':_0x32d9('0x1f')});};
\ No newline at end of file
+var _0x619c=['fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','bluebird','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','fti_mail_messages','plainBody','FULLTEXT','body'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x619c,0xa7));var _0xc619=function(_0x2a4258,_0x31ec92){_0x2a4258=_0x2a4258-0x0;var _0x37eae0=_0x619c[_0x2a4258];return _0x37eae0;};'use strict';var _=require(_0xc619('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc619('0x1'));var rp=require('request-promise');var htmlToText=require(_0xc619('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc619('0x3'));var config=require(_0xc619('0x4'));var attributes=require(_0xc619('0x5'));module[_0xc619('0x6')]=function(_0x58cdd2,_0x575b80){return _0x58cdd2[_0xc619('0x7')](_0xc619('0x8'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xc619('0x9'),'fields':[_0xc619('0xa'),'subject'],'type':_0xc619('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x407d40,_0x10a080,_0x383fdc){if(_0x407d40[_0xc619('0xc')]){_0x407d40[_0xc619('0xa')]=htmlToText[_0xc619('0xd')](_0x407d40[_0xc619('0xc')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x383fdc(null,_0x10a080);},'afterCreate':function(_0x58ad5d,_0x1c0a37,_0x4e45ce){var _0x4f8c64=_0x58cdd2[_0xc619('0xe')];var _0x5e16c1=_0x58ad5d[_0xc619('0xf')]({'plain':!![]});if(_0x5e16c1[_0xc619('0x10')]['toLowerCase']()==='in'||_0x5e16c1[_0xc619('0x10')][_0xc619('0x11')]()===_0xc619('0x12')&&!_0x5e16c1[_0xc619('0x13')]&&!_[_0xc619('0x14')](_0x5e16c1[_0xc619('0x15')])){_0x4f8c64['MailInteraction'][_0xc619('0x16')]({'where':{'id':_0x5e16c1[_0xc619('0x17')]}})[_0xc619('0x18')](function(_0x158dd3){if(_0x158dd3){_0x158dd3[_0xc619('0x19')]({'lastMsgAt':_0x5e16c1[_0xc619('0x1a')],'lastMsgDirection':_0x5e16c1[_0xc619('0x10')][_0xc619('0x11')]()});}})[_0xc619('0x1b')](function(_0x160ec0){console[_0xc619('0x1c')](_0x160ec0);});}_0x4e45ce();}},'charset':'utf8mb4','collate':_0xc619('0x1d')});};
\ No newline at end of file
index b87a564..49358b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailMessage','body','options','CreateMailMessage','lodash'];(function(_0x3c270e,_0x351044){var _0x558155=function(_0x34e2de){while(--_0x34e2de){_0x3c270e['push'](_0x3c270e['shift']());}};_0x558155(++_0x351044);}(_0x5204,0xdf));var _0x4520=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0x5204[_0x52bfa5];return _0x26f80b;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});config[_0x4520('0xb')]=_[_0x4520('0xc')](config[_0x4520('0xb')],{'host':_0x4520('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4520('0xb')]));require('./mailMessage.socket')[_0x4520('0xe')](socket);function respondWithRpcPromise(_0x37a617,_0x1a5324,_0x30ca43){return new BPromise(function(_0x4d767b,_0x297f8d){return client[_0x4520('0xf')](_0x37a617,_0x30ca43)[_0x4520('0x10')](function(_0x2a2a2f){logger[_0x4520('0x11')](_0x4520('0x12'),_0x1a5324,_0x4520('0x13'));logger[_0x4520('0x14')](_0x4520('0x15'),_0x1a5324,_0x4520('0x13'),JSON[_0x4520('0x16')](_0x2a2a2f));if(_0x2a2a2f[_0x4520('0x17')]){if(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x18')]===0x1f4){logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x2a2a2f['error'][_0x4520('0x19')]);return _0x297f8d(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x19')]);}logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x2a2a2f['error'][_0x4520('0x19')]);return _0x4d767b(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x19')]);}else{logger[_0x4520('0x11')](_0x4520('0x12'),_0x1a5324,_0x4520('0x13'));_0x4d767b(_0x2a2a2f[_0x4520('0x1a')][_0x4520('0x19')]);}})[_0x4520('0x1b')](function(_0x11eaea){logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x11eaea);_0x297f8d(_0x11eaea);});});}exports['CreateMailMessage']=function(_0xc016a3){var _0x52ca8c=this;return new Promise(function(_0x5ceff6,_0x4c46c5){return db[_0x4520('0x1c')]['create'](_0xc016a3[_0x4520('0x1d')],{'raw':_0xc016a3[_0x4520('0x1e')]?_0xc016a3[_0x4520('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x4520('0x10')](function(_0x4000d4){logger[_0x4520('0x11')]('CreateMailMessage',_0xc016a3);logger[_0x4520('0x14')](_0x4520('0x1f'),_0xc016a3,JSON[_0x4520('0x16')](_0x4000d4));_0x5ceff6(_0x4000d4);})[_0x4520('0x1b')](function(_0x2a8528){logger['error'](_0x4520('0x1f'),_0x2a8528[_0x4520('0x19')],_0xc016a3);_0x4c46c5(_0x52ca8c[_0x4520('0x17')](0x1f4,_0x2a8528[_0x4520('0x19')]));});});};
\ No newline at end of file
+var _0x8e3f=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});config[_0xf8e3('0xb')]=_['defaults'](config[_0xf8e3('0xb')],{'host':_0xf8e3('0xc'),'port':0x18eb});var socket=require(_0xf8e3('0xd'))(new Redis(config[_0xf8e3('0xb')]));require(_0xf8e3('0xe'))[_0xf8e3('0xf')](socket);function respondWithRpcPromise(_0x299a7e,_0x2a3b59,_0x2d914d){return new BPromise(function(_0x2bc3cd,_0x28f5f0){return client[_0xf8e3('0x10')](_0x299a7e,_0x2d914d)['then'](function(_0xb7d14f){logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,'request\x20sent');logger[_0xf8e3('0x13')](_0xf8e3('0x14'),_0x2a3b59,_0xf8e3('0x15'),JSON[_0xf8e3('0x16')](_0xb7d14f));if(_0xb7d14f['error']){if(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x18')]===0x1f4){logger[_0xf8e3('0x17')]('MailMessage,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f[_0xf8e3('0x17')]['message']);return _0x28f5f0(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}logger[_0xf8e3('0x17')]('MailMessage,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f['error'][_0xf8e3('0x19')]);return _0x2bc3cd(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}else{logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,_0xf8e3('0x15'));_0x2bc3cd(_0xb7d14f[_0xf8e3('0x1a')][_0xf8e3('0x19')]);}})[_0xf8e3('0x1b')](function(_0x13fb31){logger['error'](_0xf8e3('0x12'),_0x2a3b59,_0x13fb31);_0x28f5f0(_0x13fb31);});});}exports[_0xf8e3('0x1c')]=function(_0x24e8d6){var _0x31f55d=this;return new Promise(function(_0x3128ad,_0x11c58e){return db[_0xf8e3('0x1d')][_0xf8e3('0x1e')](_0x24e8d6['body'],{'raw':_0x24e8d6[_0xf8e3('0x1f')]?_0x24e8d6[_0xf8e3('0x1f')][_0xf8e3('0x20')]===undefined?!![]:![]:!![]})[_0xf8e3('0x21')](function(_0x4a1e5f){logger[_0xf8e3('0x11')]('CreateMailMessage',_0x24e8d6);logger[_0xf8e3('0x13')](_0xf8e3('0x1c'),_0x24e8d6,JSON[_0xf8e3('0x16')](_0x4a1e5f));_0x3128ad(_0x4a1e5f);})[_0xf8e3('0x1b')](function(_0x1f4b68){logger[_0xf8e3('0x17')]('CreateMailMessage',_0x1f4b68[_0xf8e3('0x19')],_0x24e8d6);_0x11c58e(_0x31f55d[_0xf8e3('0x17')](0x1f4,_0x1f4b68[_0xf8e3('0x19')]));});});};
\ No newline at end of file
index 91242e5..09b3233 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bef=['update','emit','register','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bef,0x185));var _0xf3be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bef[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require(_0xf3be('0x0'));var events=[_0xf3be('0x1'),_0xf3be('0x2'),_0xf3be('0x3')];function createListener(_0x432a61,_0x2e37d1){return function(_0xdc837){_0x2e37d1[_0xf3be('0x4')](_0x432a61,_0xdc837);};}function removeListener(_0x34c0a3,_0x1098df){return function(){MailMessageEvents['removeListener'](_0x34c0a3,_0x1098df);};}exports[_0xf3be('0x5')]=function(_0x83a255){for(var _0x30494e=0x0,_0x1835bf=events[_0xf3be('0x6')];_0x30494e<_0x1835bf;_0x30494e++){var _0x48e92c=events[_0x30494e];var _0x363b33=createListener(_0xf3be('0x7')+_0x48e92c,_0x83a255);MailMessageEvents['on'](_0x48e92c,_0x363b33);}};
\ No newline at end of file
+var _0x38ac=['register','length','mailMessage:','./mailMessage.events','save','emit','removeListener'];(function(_0xd6f15d,_0x41a4e0){var _0xfea245=function(_0x28dd02){while(--_0x28dd02){_0xd6f15d['push'](_0xd6f15d['shift']());}};_0xfea245(++_0x41a4e0);}(_0x38ac,0x161));var _0xc38a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x38ac[_0x465a0c];return _0x1e202e;};'use strict';var MailMessageEvents=require(_0xc38a('0x0'));var events=[_0xc38a('0x1'),'remove','update'];function createListener(_0x5f462e,_0x12aafc){return function(_0x50c42c){_0x12aafc[_0xc38a('0x2')](_0x5f462e,_0x50c42c);};}function removeListener(_0x349a8f,_0xc583e7){return function(){MailMessageEvents[_0xc38a('0x3')](_0x349a8f,_0xc583e7);};}exports[_0xc38a('0x4')]=function(_0x4463d7){for(var _0x232e23=0x0,_0x32354b=events[_0xc38a('0x5')];_0x232e23<_0x32354b;_0x232e23++){var _0x576768=events[_0x232e23];var _0x2f32da=createListener(_0xc38a('0x6')+_0x576768,_0x4463d7);MailMessageEvents['on'](_0x576768,_0x2f32da);}};
\ No newline at end of file
index 0754de8..d18ce92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x449b=['destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','update','delete'];(function(_0x1af25d,_0x5e28a0){var _0x4216ec=function(_0x15fd4c){while(--_0x15fd4c){_0x1af25d['push'](_0x1af25d['shift']());}};_0x4216ec(++_0x5e28a0);}(_0x449b,0x1ea));var _0xb449=function(_0x349f87,_0x5426cb){_0x349f87=_0x349f87-0x0;var _0x45cc81=_0x449b[_0x349f87];return _0x45cc81;};'use strict';var multer=require('multer');var util=require(_0xb449('0x0'));var path=require(_0xb449('0x1'));var timeout=require(_0xb449('0x2'));var express=require(_0xb449('0x3'));var router=express['Router']();var fs_extra=require(_0xb449('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb449('0x5'));var controller=require(_0xb449('0x6'));router[_0xb449('0x7')]('/',auth[_0xb449('0x8')](),controller[_0xb449('0x9')]);router[_0xb449('0x7')]('/describe',auth[_0xb449('0x8')](),controller[_0xb449('0xa')]);router[_0xb449('0x7')](_0xb449('0xb'),auth['isAuthenticated'](),controller[_0xb449('0xc')]);router[_0xb449('0x7')](_0xb449('0xd'),auth[_0xb449('0x8')](),controller[_0xb449('0xe')]);router[_0xb449('0x7')](_0xb449('0xf'),auth['isAuthenticated'](),controller[_0xb449('0x10')]);router['get'](_0xb449('0x11'),auth[_0xb449('0x8')](),controller['getAgents']);router[_0xb449('0x12')]('/',auth['isAuthenticated'](),controller[_0xb449('0x13')]);router['post'](_0xb449('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xb449('0x11'),auth[_0xb449('0x8')](),controller[_0xb449('0x14')]);router['put'](_0xb449('0xb'),auth['isAuthenticated'](),controller[_0xb449('0x15')]);router[_0xb449('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb449('0x17')]);router['delete'](_0xb449('0xf'),auth[_0xb449('0x8')](),controller[_0xb449('0x18')]);router[_0xb449('0x16')](_0xb449('0x11'),auth[_0xb449('0x8')](),controller[_0xb449('0x19')]);module[_0xb449('0x1a')]=router;
\ No newline at end of file
+var _0x33c4=['/:id/members','isAuthenticated','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','destroy','removeTeams','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/:id','show'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x33c4,0xdd));var _0x433c=function(_0x8aec06,_0x3d5724){_0x8aec06=_0x8aec06-0x0;var _0x4c3613=_0x33c4[_0x8aec06];return _0x4c3613;};'use strict';var multer=require('multer');var util=require(_0x433c('0x0'));var path=require(_0x433c('0x1'));var timeout=require(_0x433c('0x2'));var express=require(_0x433c('0x3'));var router=express[_0x433c('0x4')]();var fs_extra=require(_0x433c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x433c('0x6'));var config=require(_0x433c('0x7'));var controller=require(_0x433c('0x8'));router[_0x433c('0x9')]('/',auth['isAuthenticated'](),controller[_0x433c('0xa')]);router[_0x433c('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x433c('0x9')](_0x433c('0xb'),auth['isAuthenticated'](),controller[_0x433c('0xc')]);router[_0x433c('0x9')](_0x433c('0xd'),auth[_0x433c('0xe')](),controller['getMembers']);router[_0x433c('0x9')](_0x433c('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0x433c('0x9')](_0x433c('0x10'),auth['isAuthenticated'](),controller[_0x433c('0x11')]);router[_0x433c('0x12')]('/',auth[_0x433c('0xe')](),controller['create']);router[_0x433c('0x12')]('/:id/teams',auth[_0x433c('0xe')](),controller[_0x433c('0x13')]);router[_0x433c('0x12')](_0x433c('0x10'),auth[_0x433c('0xe')](),controller[_0x433c('0x14')]);router[_0x433c('0x15')](_0x433c('0xb'),auth['isAuthenticated'](),controller[_0x433c('0x16')]);router['delete']('/:id',auth[_0x433c('0xe')](),controller[_0x433c('0x17')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x433c('0x18')]);router['delete'](_0x433c('0x10'),auth[_0x433c('0xe')](),controller[_0x433c('0x19')]);module['exports']=router;
\ No newline at end of file
index 857889d..7979df3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f9e=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x48574d,_0x5069c4){var _0x50487f=function(_0x31aba4){while(--_0x31aba4){_0x48574d['push'](_0x48574d['shift']());}};_0x50487f(++_0x5069c4);}(_0x7f9e,0x157));var _0xe7f9=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x7f9e[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0xe7f9('0x0'));module[_0xe7f9('0x1')]={'name':{'type':Sequelize[_0xe7f9('0x2')],'unique':_0xe7f9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe7f9('0x2')]},'timeout':{'type':Sequelize[_0xe7f9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe7f9('0x5'),_0xe7f9('0x6'),_0xe7f9('0x7'))}};
\ No newline at end of file
+var _0x9af5=['STRING','name','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0x9af5,0x1da));var _0x59af=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9af5[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x59af('0x0'));module[_0x59af('0x1')]={'name':{'type':Sequelize[_0x59af('0x2')],'unique':_0x59af('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x59af('0x4')](_0x59af('0x5'),'beepall',_0x59af('0x6'))}};
\ No newline at end of file
index 649015c..7549147 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f71=['QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','emit','addAgents','spread','removeAgents','isArray','userMailQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','MailQueues','UserProfileResource','destroy','error','stack','name','index','MailQueue','fieldName','map','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserMailQueue','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','createdAt','format','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString'];(function(_0x3db937,_0x15cee6){var _0x39c008=function(_0x36ebd0){while(--_0x36ebd0){_0x3db937['push'](_0x3db937['shift']());}};_0x39c008(++_0x15cee6);}(_0x6f71,0x1aa));var _0x16f7=function(_0x4c54fa,_0x1b4e71){_0x4c54fa=_0x4c54fa-0x0;var _0x198bcc=_0x6f71[_0x4c54fa];return _0x198bcc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16f7('0x0'));var zipdir=require(_0x16f7('0x1'));var jsonpatch=require(_0x16f7('0x2'));var rp=require(_0x16f7('0x3'));var moment=require('moment');var BPromise=require(_0x16f7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x16f7('0x5'));var sox=require(_0x16f7('0x6'));var csv=require(_0x16f7('0x7'));var ejs=require(_0x16f7('0x8'));var fs=require('fs');var fs_extra=require(_0x16f7('0x9'));var _=require(_0x16f7('0xa'));var squel=require(_0x16f7('0xb'));var crypto=require(_0x16f7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x16f7('0xd'));var toCsv=require(_0x16f7('0x7'));var querystring=require('querystring');var Papa=require(_0x16f7('0xe'));var Redis=require(_0x16f7('0xf'));var authService=require(_0x16f7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16f7('0x11'));var hardwareService=require(_0x16f7('0x12'));var logger=require('../../config/logger')(_0x16f7('0x13'));var utils=require(_0x16f7('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x16f7('0x15')]=_[_0x16f7('0x16')](config['redis'],{'host':_0x16f7('0x17'),'port':0x18eb});var socket=require(_0x16f7('0x18'))(new Redis(config[_0x16f7('0x15')]));require('./mailQueue.socket')[_0x16f7('0x19')](socket);function respondWithStatusCode(_0x425f23,_0x4223e9){_0x4223e9=_0x4223e9||0xcc;return function(_0x497598){if(_0x497598){return _0x425f23[_0x16f7('0x1a')](_0x4223e9);}return _0x425f23[_0x16f7('0x1b')](_0x4223e9)[_0x16f7('0x1c')]();};}function respondWithResult(_0x1b0011,_0x2c1a53){_0x2c1a53=_0x2c1a53||0xc8;return function(_0x21eb04){if(_0x21eb04){return _0x1b0011[_0x16f7('0x1b')](_0x2c1a53)[_0x16f7('0x1d')](_0x21eb04);}};}function respondWithFilteredResult(_0x5be598,_0x1d231c){return function(_0x74bd49){if(_0x74bd49){var _0x19f9d6=typeof _0x1d231c[_0x16f7('0x1e')]===_0x16f7('0x1f')&&typeof _0x1d231c['limit']===_0x16f7('0x1f');var _0x5e88cf=_0x74bd49[_0x16f7('0x20')];var _0xb8826c=_0x19f9d6?0x0:_0x1d231c[_0x16f7('0x1e')];var _0x37c270=_0x19f9d6?_0x74bd49[_0x16f7('0x20')]:_0x1d231c[_0x16f7('0x1e')]+_0x1d231c['limit'];var _0x24df0e;if(_0x37c270>=_0x5e88cf){_0x37c270=_0x5e88cf;_0x24df0e=0xc8;}else{_0x24df0e=0xce;}_0x5be598['status'](_0x24df0e);return _0x5be598[_0x16f7('0x21')](_0x16f7('0x22'),_0xb8826c+'-'+_0x37c270+'/'+_0x5e88cf)[_0x16f7('0x1d')](_0x74bd49);}return null;};}function patchUpdates(_0x1f9018){return function(_0x26b8e8){try{jsonpatch[_0x16f7('0x23')](_0x26b8e8,_0x1f9018,!![]);}catch(_0x1cd2a8){return BPromise[_0x16f7('0x24')](_0x1cd2a8);}return _0x26b8e8[_0x16f7('0x25')]();};}function saveUpdates(_0x1bbe0c,_0xc852ca){return function(_0x99fdda){if(_0x99fdda){return _0x99fdda['update'](_0x1bbe0c)[_0x16f7('0x26')](function(_0x6203a3){return _0x6203a3;});}return null;};}function removeEntity(_0x4692e7,_0x5d0dd4){return function(_0x3dfd15){if(_0x3dfd15){return _0x3dfd15['destroy']()['then'](function(){var _0x3d439f=_0x3dfd15['get']({'plain':!![]});var _0x3c6c25=_0x16f7('0x27');return db[_0x16f7('0x28')][_0x16f7('0x29')]({'where':{'type':_0x3c6c25,'resourceId':_0x3d439f['id']}})[_0x16f7('0x26')](function(){return _0x3dfd15;});})[_0x16f7('0x26')](function(){_0x4692e7[_0x16f7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42099c,_0x4db617){return function(_0xf59528){if(!_0xf59528){_0x42099c[_0x16f7('0x1a')](0x194);}return _0xf59528;};}function handleError(_0x58cec7,_0x2aa146){_0x2aa146=_0x2aa146||0x1f4;return function(_0x33d121){logger[_0x16f7('0x2a')](_0x33d121[_0x16f7('0x2b')]);if(_0x33d121[_0x16f7('0x2c')]){delete _0x33d121['name'];}_0x58cec7[_0x16f7('0x1b')](_0x2aa146)['send'](_0x33d121);};}exports[_0x16f7('0x2d')]=function(_0x4e8b58,_0x4d0fc5){var _0x457106={},_0x1ba660={},_0x4fe857={'count':0x0,'rows':[]};var _0x9f6a81=_['map'](db[_0x16f7('0x2e')]['rawAttributes'],function(_0xf30077){return{'name':_0xf30077[_0x16f7('0x2f')],'type':_0xf30077['type']['key']};});_0x1ba660['model']=_[_0x16f7('0x30')](_0x9f6a81,'name');_0x1ba660['query']=_[_0x16f7('0x31')](_0x4e8b58['query']);_0x1ba660[_0x16f7('0x32')]=_[_0x16f7('0x33')](_0x1ba660[_0x16f7('0x34')],_0x1ba660[_0x16f7('0x35')]);_0x457106[_0x16f7('0x36')]=_['intersection'](_0x1ba660[_0x16f7('0x34')],qs[_0x16f7('0x37')](_0x4e8b58['query'][_0x16f7('0x37')]));_0x457106[_0x16f7('0x36')]=_0x457106[_0x16f7('0x36')][_0x16f7('0x38')]?_0x457106[_0x16f7('0x36')]:_0x1ba660[_0x16f7('0x34')];if(!_0x4e8b58[_0x16f7('0x35')][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x457106[_0x16f7('0x3b')]=qs[_0x16f7('0x3b')](_0x4e8b58[_0x16f7('0x35')]['limit']);_0x457106[_0x16f7('0x1e')]=qs[_0x16f7('0x1e')](_0x4e8b58[_0x16f7('0x35')]['offset']);}_0x457106[_0x16f7('0x3c')]=qs[_0x16f7('0x3d')](_0x4e8b58[_0x16f7('0x35')][_0x16f7('0x3d')]);_0x457106[_0x16f7('0x3e')]=qs['filters'](_[_0x16f7('0x3f')](_0x4e8b58[_0x16f7('0x35')],_0x1ba660[_0x16f7('0x32')]),_0x9f6a81);if(_0x4e8b58['query'][_0x16f7('0x40')]){_0x457106[_0x16f7('0x3e')]=_[_0x16f7('0x41')](_0x457106[_0x16f7('0x3e')],{'$or':_['map'](_0x9f6a81,function(_0x37acb5){if(_0x37acb5[_0x16f7('0x42')]!==_0x16f7('0x43')){var _0x1ca5a1={};_0x1ca5a1[_0x37acb5[_0x16f7('0x2c')]]={'$like':'%'+_0x4e8b58[_0x16f7('0x35')][_0x16f7('0x40')]+'%'};return _0x1ca5a1;}})});}_0x457106=_[_0x16f7('0x41')]({},_0x457106,_0x4e8b58[_0x16f7('0x44')]);var _0x3a5cad={'where':_0x457106[_0x16f7('0x3e')]};return db[_0x16f7('0x2e')][_0x16f7('0x20')](_0x3a5cad)[_0x16f7('0x26')](function(_0x35c61e){_0x4fe857[_0x16f7('0x20')]=_0x35c61e;if(_0x4e8b58[_0x16f7('0x35')][_0x16f7('0x45')]){_0x457106[_0x16f7('0x46')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x457106);})[_0x16f7('0x26')](function(_0x2330ff){_0x4fe857[_0x16f7('0x47')]=_0x2330ff;return _0x4fe857;})['then'](respondWithFilteredResult(_0x4d0fc5,_0x457106))['catch'](handleError(_0x4d0fc5,null));};exports['show']=function(_0x5d16be,_0x455cb3){var _0x6eb787={'raw':!![],'where':{'id':_0x5d16be['params']['id']}},_0x3a8542={};_0x3a8542[_0x16f7('0x34')]=_[_0x16f7('0x31')](db[_0x16f7('0x2e')][_0x16f7('0x48')]);_0x3a8542[_0x16f7('0x35')]=_[_0x16f7('0x31')](_0x5d16be[_0x16f7('0x35')]);_0x3a8542[_0x16f7('0x32')]=_[_0x16f7('0x33')](_0x3a8542['model'],_0x3a8542[_0x16f7('0x35')]);_0x6eb787[_0x16f7('0x36')]=_['intersection'](_0x3a8542[_0x16f7('0x34')],qs[_0x16f7('0x37')](_0x5d16be[_0x16f7('0x35')][_0x16f7('0x37')]));_0x6eb787[_0x16f7('0x36')]=_0x6eb787[_0x16f7('0x36')][_0x16f7('0x38')]?_0x6eb787[_0x16f7('0x36')]:_0x3a8542[_0x16f7('0x34')];if(_0x5d16be['query']['includeAll']){_0x6eb787['include']=[{'all':!![]}];}_0x6eb787=_['merge']({},_0x6eb787,_0x5d16be[_0x16f7('0x44')]);return db[_0x16f7('0x2e')][_0x16f7('0x49')](_0x6eb787)[_0x16f7('0x26')](handleEntityNotFound(_0x455cb3,null))['then'](respondWithResult(_0x455cb3,null))[_0x16f7('0x4a')](handleError(_0x455cb3,null));};exports[_0x16f7('0x4b')]=function(_0x5da8c1,_0x430080){return db['MailQueue'][_0x16f7('0x4b')](_0x5da8c1[_0x16f7('0x4c')],{})[_0x16f7('0x26')](function(_0x3b0af8){var _0x3f9a42=_0x5da8c1['user'][_0x16f7('0x4d')]({'plain':!![]});if(!_0x3f9a42)throw new Error(_0x16f7('0x4e'));if(_0x3f9a42[_0x16f7('0x4f')]==='user'){var _0x466762=_0x3b0af8[_0x16f7('0x4d')]({'plain':!![]});var _0x11654c='MailQueues';return db['UserProfileSection'][_0x16f7('0x49')]({'where':{'name':_0x11654c,'userProfileId':_0x3f9a42[_0x16f7('0x50')]},'raw':!![]})[_0x16f7('0x26')](function(_0x2cb8a2){if(_0x2cb8a2&&_0x2cb8a2[_0x16f7('0x51')]===0x0){return db[_0x16f7('0x28')]['create']({'name':_0x466762[_0x16f7('0x2c')],'resourceId':_0x466762['id'],'type':_0x2cb8a2['name'],'sectionId':_0x2cb8a2['id']},{})[_0x16f7('0x26')](function(){return _0x3b0af8;});}else{return _0x3b0af8;}})['catch'](function(_0x1f902c){logger[_0x16f7('0x2a')](_0x16f7('0x52'),_0x1f902c);throw _0x1f902c;});}return _0x3b0af8;})[_0x16f7('0x26')](respondWithResult(_0x430080,0xc9))[_0x16f7('0x4a')](handleError(_0x430080,null));};exports['update']=function(_0x436489,_0x1daaa7){if(_0x436489[_0x16f7('0x4c')]['id']){delete _0x436489['body']['id'];}return db[_0x16f7('0x2e')][_0x16f7('0x49')]({'where':{'id':_0x436489[_0x16f7('0x53')]['id']}})[_0x16f7('0x26')](handleEntityNotFound(_0x1daaa7,null))[_0x16f7('0x26')](saveUpdates(_0x436489[_0x16f7('0x4c')],null))[_0x16f7('0x26')](respondWithResult(_0x1daaa7,null))[_0x16f7('0x4a')](handleError(_0x1daaa7,null));};exports[_0x16f7('0x29')]=function(_0x2d20d8,_0x2458cc){return db['MailQueue'][_0x16f7('0x49')]({'where':{'id':_0x2d20d8['params']['id']}})['then'](handleEntityNotFound(_0x2458cc,null))[_0x16f7('0x26')](removeEntity(_0x2458cc,null))['catch'](handleError(_0x2458cc,null));};exports[_0x16f7('0x54')]=function(_0x497636,_0x867fcd){return db[_0x16f7('0x2e')][_0x16f7('0x54')]()[_0x16f7('0x26')](respondWithResult(_0x867fcd,null))['catch'](handleError(_0x867fcd,null));};exports[_0x16f7('0x55')]=function(_0x322c66,_0x42f57a,_0x3419ee){var _0x429e9e={'raw':!![],'where':{}},_0x4f4d0a={},_0x5b7696;return db[_0x16f7('0x2e')]['findOne']({'where':{'id':_0x322c66[_0x16f7('0x53')]['id']}})[_0x16f7('0x26')](handleEntityNotFound(_0x42f57a,null))[_0x16f7('0x26')](function(_0xcbfa9a){if(_0xcbfa9a){_0x5b7696=_0xcbfa9a[_0x16f7('0x4d')]({'plain':!![]});_0x4f4d0a['model']=_[_0x16f7('0x31')](db[_0x16f7('0x56')][_0x16f7('0x48')]);_0x4f4d0a['query']=_[_0x16f7('0x31')](_0x322c66['query']);_0x4f4d0a[_0x16f7('0x32')]=_['intersection'](_0x4f4d0a[_0x16f7('0x34')],_0x4f4d0a['query']);_0x429e9e[_0x16f7('0x36')]=_[_0x16f7('0x33')](_0x4f4d0a[_0x16f7('0x34')],qs[_0x16f7('0x37')](_0x322c66[_0x16f7('0x35')][_0x16f7('0x37')]));_0x429e9e[_0x16f7('0x36')]=_0x429e9e[_0x16f7('0x36')][_0x16f7('0x38')]?_0x429e9e[_0x16f7('0x36')]:_0x4f4d0a[_0x16f7('0x34')];if(!_0x322c66['query'][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x429e9e[_0x16f7('0x3b')]=qs[_0x16f7('0x3b')](_0x322c66[_0x16f7('0x35')][_0x16f7('0x3b')]);_0x429e9e[_0x16f7('0x1e')]=qs[_0x16f7('0x1e')](_0x322c66['query']['offset']);}_0x429e9e[_0x16f7('0x3c')]=qs[_0x16f7('0x3d')](_0x322c66[_0x16f7('0x35')][_0x16f7('0x3d')]);_0x429e9e[_0x16f7('0x3e')]=qs[_0x16f7('0x32')](_[_0x16f7('0x3f')](_0x322c66[_0x16f7('0x35')],_0x4f4d0a[_0x16f7('0x32')]));_0x429e9e[_0x16f7('0x3e')][_0x16f7('0x57')]=_0xcbfa9a['id'];if(_0x322c66[_0x16f7('0x35')][_0x16f7('0x40')]){_0x429e9e['where']=_['merge'](_0x429e9e['where'],{'$or':_[_0x16f7('0x30')](_0x429e9e[_0x16f7('0x36')],function(_0x136c8e){var _0x2da4da={};_0x2da4da[_0x136c8e]={'$like':'%'+_0x322c66[_0x16f7('0x35')][_0x16f7('0x40')]+'%'};return _0x2da4da;})});}_0x429e9e=_[_0x16f7('0x41')]({},_0x429e9e,_0x322c66['options']);return db['UserMailQueue'][_0x16f7('0x58')](_0x429e9e);}})[_0x16f7('0x26')](function(_0x1d9b15){if(_0x1d9b15){return db[_0x16f7('0x59')][_0x16f7('0x5a')]({'where':{'id':_[_0x16f7('0x30')](_0x1d9b15,_0x16f7('0x5b')),'role':_0x16f7('0x5c')},'attributes':['id',_0x16f7('0x2c'),_0x16f7('0x5d'),'updatedAt',_0x16f7('0x5e')]});}})[_0x16f7('0x26')](function(_0x5867e){if(_0x5867e){return{'count':_0x5867e[_0x16f7('0x20')],'rows':_[_0x16f7('0x30')](_0x5867e['rows'],function(_0x404340){return{'membername':_0x404340[_0x16f7('0x2c')],'UserId':_0x404340['id'],'queue_name':_0x5b7696[_0x16f7('0x2c')],'MailQueueId':_0x5b7696['id'],'interface':util[_0x16f7('0x5f')]('%s/%s','SIP',_0x404340[_0x16f7('0x2c')]),'penalty':0x0,'paused':_0x404340[_0x16f7('0x5d')],'createdAt':_0x404340['createdAt'],'updatedAt':_0x404340[_0x16f7('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x16f7('0x26')](respondWithFilteredResult(_0x42f57a,_0x429e9e))[_0x16f7('0x4a')](handleError(_0x42f57a,null));};exports[_0x16f7('0x61')]=function(_0x9160a9,_0xe56300,_0x28f74f){var _0xfb10b9={};var _0x50972e={};var _0x59d443;var _0x3fe9d2;return db[_0x16f7('0x2e')][_0x16f7('0x62')]({'where':{'id':_0x9160a9[_0x16f7('0x53')]['id']}})['then'](handleEntityNotFound(_0xe56300,null))[_0x16f7('0x26')](function(_0x5cd281){if(_0x5cd281){_0x59d443=_0x5cd281;_0x50972e[_0x16f7('0x34')]=_[_0x16f7('0x31')](db[_0x16f7('0x63')][_0x16f7('0x48')]);_0x50972e[_0x16f7('0x35')]=_[_0x16f7('0x31')](_0x9160a9[_0x16f7('0x35')]);_0x50972e['filters']=_[_0x16f7('0x33')](_0x50972e['model'],_0x50972e['query']);_0xfb10b9[_0x16f7('0x36')]=_[_0x16f7('0x33')](_0x50972e[_0x16f7('0x34')],qs[_0x16f7('0x37')](_0x9160a9['query'][_0x16f7('0x37')]));_0xfb10b9['attributes']=_0xfb10b9['attributes'][_0x16f7('0x38')]?_0xfb10b9[_0x16f7('0x36')]:_0x50972e[_0x16f7('0x34')];_0xfb10b9[_0x16f7('0x3c')]=qs['sort'](_0x9160a9[_0x16f7('0x35')][_0x16f7('0x3d')]);_0xfb10b9[_0x16f7('0x3e')]=qs['filters'](_['pick'](_0x9160a9[_0x16f7('0x35')],_0x50972e[_0x16f7('0x32')]));if(_0x9160a9['query']['filter']){_0xfb10b9[_0x16f7('0x3e')]=_[_0x16f7('0x41')](_0xfb10b9[_0x16f7('0x3e')],{'$or':_[_0x16f7('0x30')](_0xfb10b9[_0x16f7('0x36')],function(_0x42525f){var _0xd1ad79={};_0xd1ad79[_0x42525f]={'$like':'%'+_0x9160a9[_0x16f7('0x35')][_0x16f7('0x40')]+'%'};return _0xd1ad79;})});}_0xfb10b9=_[_0x16f7('0x41')]({},_0xfb10b9,_0x9160a9['options']);return _0x59d443[_0x16f7('0x61')](_0xfb10b9);}})[_0x16f7('0x26')](function(_0x567462){if(_0x567462){_0x3fe9d2=_0x567462[_0x16f7('0x38')];if(!_0x9160a9[_0x16f7('0x35')][_0x16f7('0x39')](_0x16f7('0x3a'))){_0xfb10b9['limit']=qs[_0x16f7('0x3b')](_0x9160a9[_0x16f7('0x35')][_0x16f7('0x3b')]);_0xfb10b9['offset']=qs['offset'](_0x9160a9[_0x16f7('0x35')][_0x16f7('0x1e')]);}return _0x59d443[_0x16f7('0x61')](_0xfb10b9);}})[_0x16f7('0x26')](function(_0x3090fb){if(_0x3090fb){return _0x3090fb?{'count':_0x3fe9d2,'rows':_0x3090fb}:null;}})[_0x16f7('0x26')](respondWithResult(_0xe56300,null))[_0x16f7('0x4a')](handleError(_0xe56300,null));};exports[_0x16f7('0x64')]=function(_0x44ebdd,_0x3ebdc7,_0x1af458){var _0x184785=_0x44ebdd[_0x16f7('0x4c')][_0x16f7('0x65')];return db[_0x16f7('0x63')][_0x16f7('0x58')]({'where':{'id':_0x184785},'attributes':['id'],'include':[{'model':db[_0x16f7('0x59')],'as':_0x16f7('0x66'),'attributes':['id',_0x16f7('0x2c'),_0x16f7('0x67'),_0x16f7('0x68'),_0x16f7('0x69')],'raw':!![]}]})['then'](function(_0x231e78){if(_0x231e78){var _0x2ee673=_[_0x16f7('0x6a')](_0x231e78,function(_0x5e55cd){var _0x296dca=_0x5e55cd[_0x16f7('0x4d')]({'plain':!![]});return _0x296dca['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x44ebdd[_0x16f7('0x53')]['id']}})[_0x16f7('0x26')](function(_0x320265){return db['sequelize'][_0x16f7('0x6b')](function(_0x33c191){return _0x320265[_0x16f7('0x64')](_0x184785,{'transaction':_0x33c191})['then'](function(){return BPromise[_0x16f7('0x6c')](_0x2ee673,function(_0x1dda96){return db[_0x16f7('0x56')][_0x16f7('0x6d')]({'where':{'UserId':_0x1dda96['id'],'MailQueueId':_0x44ebdd[_0x16f7('0x53')]['id']},'transaction':_0x33c191});});})[_0x16f7('0x26')](function(){_0x2ee673[_0x16f7('0x6e')](function(_0x5b625d){socket['emit'](_0x16f7('0x6f'),{'UserId':_0x5b625d['id'],'MailQueueId':_0x320265['id']});});});});});}})[_0x16f7('0x26')](respondWithStatusCode(_0x3ebdc7,null))[_0x16f7('0x4a')](handleError(_0x3ebdc7,null));};exports[_0x16f7('0x70')]=function(_0x140488,_0x4d9e05,_0x3bb59d){return db[_0x16f7('0x63')][_0x16f7('0x58')]({'where':{'id':_0x140488[_0x16f7('0x35')][_0x16f7('0x65')]},'attributes':['id'],'include':[{'model':db[_0x16f7('0x59')],'as':_0x16f7('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d9e05,null))['then'](function(_0x5db2b8){var _0x21e278=_[_0x16f7('0x30')](_0x5db2b8,'id');var _0x5a7459=[];var _0x354599=[];var _0x865695=squel[_0x16f7('0x71')]();_0x865695[_0x16f7('0x72')](_0x16f7('0x73'))['from'](_0x16f7('0x74'),'tq')['join']('user_has_teams','ut',_0x16f7('0x75'))['where']('MailQueueId\x20=\x20?',_0x140488['params']['id']);for(var _0x1e9705=0x0;_0x1e9705<_0x5db2b8[_0x16f7('0x38')];_0x1e9705+=0x1){let _0x2b29c9=_0x5db2b8[_0x1e9705];for(var _0x320b91=0x0;_0x320b91<_0x2b29c9[_0x16f7('0x66')][_0x16f7('0x38')];_0x320b91+=0x1){let _0x563f81=_0x2b29c9[_0x16f7('0x66')][_0x320b91];var _0x17078e=_0x865695[_0x16f7('0x76')]();_0x17078e[_0x16f7('0x3e')](_0x16f7('0x77'),_0x563f81['id']);_0x354599['push'](db[_0x16f7('0x78')][_0x16f7('0x35')](_0x17078e[_0x16f7('0x79')](),{'type':db['sequelize'][_0x16f7('0x7a')][_0x16f7('0x7b')]})[_0x16f7('0x26')](function(_0x16d926){if(_0x16d926[_0x16f7('0x38')]===0x1){return _0x563f81['id'];}else{var _0x241f6d=_[_0x16f7('0x7c')](_[_0x16f7('0x30')](_0x16d926,_0x16f7('0x7d')),function(_0x6ab045){return _[_0x16f7('0x7e')](_0x21e278,_0x6ab045);});if(_0x241f6d){return _0x563f81['id'];}}}));}}return BPromise[_0x16f7('0x7f')](_0x354599)[_0x16f7('0x26')](function(_0x318f8e){_0x5a7459=_(_0x5a7459)[_0x16f7('0x80')](_0x318f8e)['compact']()['value']();return db[_0x16f7('0x2e')][_0x16f7('0x49')]({'where':{'id':_0x140488[_0x16f7('0x53')]['id']}})[_0x16f7('0x26')](function(_0x42669d){return db['sequelize'][_0x16f7('0x6b')](function(_0x4f6a0c){return _0x42669d[_0x16f7('0x70')](_0x140488[_0x16f7('0x35')][_0x16f7('0x65')],{'transaction':_0x4f6a0c})['then'](function(){if(!_[_0x16f7('0x81')](_0x5a7459)){return _0x42669d['removeAgents'](_0x5a7459,{'transaction':_0x4f6a0c});}})[_0x16f7('0x26')](function(){_0x5a7459[_0x16f7('0x6e')](function(_0x3eebd4){socket[_0x16f7('0x82')]('userMailQueue:remove',{'UserId':_0x3eebd4,'MailQueueId':_0x42669d['id']});});});});});});})[_0x16f7('0x26')](respondWithStatusCode(_0x4d9e05,null))[_0x16f7('0x4a')](handleError(_0x4d9e05,null));};exports[_0x16f7('0x83')]=function(_0x26916b,_0x336d33,_0xf3d2b6){return db[_0x16f7('0x2e')][_0x16f7('0x49')]({'where':{'id':_0x26916b[_0x16f7('0x53')]['id']}})['then'](handleEntityNotFound(_0x336d33,null))[_0x16f7('0x26')](function(_0x433562){if(_0x433562){return _0x433562[_0x16f7('0x83')](_0x26916b['body'][_0x16f7('0x65')],_['omit'](_0x26916b[_0x16f7('0x4c')],[_0x16f7('0x65'),'id'])||{})[_0x16f7('0x84')](function(_0x15c334){for(var _0x821551=0x0;_0x821551<_0x26916b[_0x16f7('0x4c')][_0x16f7('0x65')][_0x16f7('0x38')];_0x821551+=0x1){socket[_0x16f7('0x82')](_0x16f7('0x6f'),{'UserId':Number(_0x26916b[_0x16f7('0x4c')][_0x16f7('0x65')][_0x821551]),'MailQueueId':Number(_0x26916b[_0x16f7('0x53')]['id'])});}return _0x15c334;});}})[_0x16f7('0x26')](respondWithResult(_0x336d33,null))[_0x16f7('0x4a')](handleError(_0x336d33,null));};exports['removeAgents']=function(_0xdeea53,_0x48965f,_0x9384bb){return db['MailQueue']['find']({'where':{'id':_0xdeea53[_0x16f7('0x53')]['id']}})[_0x16f7('0x26')](handleEntityNotFound(_0x48965f,null))['then'](function(_0x9f95c0){if(_0x9f95c0){return _0x9f95c0[_0x16f7('0x85')](_0xdeea53[_0x16f7('0x35')][_0x16f7('0x65')])[_0x16f7('0x26')](function(){if(_[_0x16f7('0x86')](_0xdeea53['query'][_0x16f7('0x65')])){for(var _0x3e5341=0x0;_0x3e5341<_0xdeea53[_0x16f7('0x35')][_0x16f7('0x65')][_0x16f7('0x38')];_0x3e5341+=0x1){socket[_0x16f7('0x82')](_0x16f7('0x87'),{'UserId':Number(_0xdeea53[_0x16f7('0x35')][_0x16f7('0x65')][_0x3e5341]),'MailQueueId':Number(_0xdeea53[_0x16f7('0x53')]['id'])});}}else{socket[_0x16f7('0x82')]('userMailQueue:remove',{'UserId':Number(_0xdeea53[_0x16f7('0x35')][_0x16f7('0x65')]),'MailQueueId':Number(_0xdeea53[_0x16f7('0x53')]['id'])});}});}})[_0x16f7('0x26')](respondWithStatusCode(_0x48965f,null))[_0x16f7('0x4a')](handleError(_0x48965f,null));};exports[_0x16f7('0x88')]=function(_0x34ac69,_0xfd9330,_0x2e128e){var _0xd43e3d={};var _0xb1c448={};var _0x2dd059;var _0xea9878;return db[_0x16f7('0x2e')]['findOne']({'where':{'id':_0x34ac69['params']['id']}})['then'](handleEntityNotFound(_0xfd9330,null))['then'](function(_0x1e7b39){if(_0x1e7b39){_0x2dd059=_0x1e7b39;_0xb1c448[_0x16f7('0x34')]=_['keys'](db[_0x16f7('0x59')][_0x16f7('0x48')]);_0xb1c448[_0x16f7('0x35')]=_[_0x16f7('0x31')](_0x34ac69[_0x16f7('0x35')]);_0xb1c448[_0x16f7('0x32')]=_[_0x16f7('0x33')](_0xb1c448[_0x16f7('0x34')],_0xb1c448['query']);_0xd43e3d[_0x16f7('0x36')]=_[_0x16f7('0x33')](_0xb1c448[_0x16f7('0x34')],qs[_0x16f7('0x37')](_0x34ac69['query'][_0x16f7('0x37')]));_0xd43e3d[_0x16f7('0x36')]=_0xd43e3d[_0x16f7('0x36')][_0x16f7('0x38')]?_0xd43e3d[_0x16f7('0x36')]:_0xb1c448[_0x16f7('0x34')];_0xd43e3d[_0x16f7('0x3c')]=qs[_0x16f7('0x3d')](_0x34ac69['query'][_0x16f7('0x3d')]);_0xd43e3d[_0x16f7('0x3e')]=qs[_0x16f7('0x32')](_['pick'](_0x34ac69[_0x16f7('0x35')],_0xb1c448[_0x16f7('0x32')]));if(_0x34ac69['query'][_0x16f7('0x40')]){_0xd43e3d[_0x16f7('0x3e')]=_[_0x16f7('0x41')](_0xd43e3d[_0x16f7('0x3e')],{'$or':_[_0x16f7('0x30')](_0xd43e3d[_0x16f7('0x36')],function(_0x747272){var _0x3876ea={};_0x3876ea[_0x747272]={'$like':'%'+_0x34ac69[_0x16f7('0x35')][_0x16f7('0x40')]+'%'};return _0x3876ea;})});}_0xd43e3d=_['merge']({},_0xd43e3d,_0x34ac69[_0x16f7('0x44')]);return _0x2dd059[_0x16f7('0x88')](_0xd43e3d);}})[_0x16f7('0x26')](function(_0x234119){if(_0x234119){_0xea9878=_0x234119[_0x16f7('0x38')];if(!_0x34ac69[_0x16f7('0x35')][_0x16f7('0x39')](_0x16f7('0x3a'))){_0xd43e3d[_0x16f7('0x3b')]=qs[_0x16f7('0x3b')](_0x34ac69[_0x16f7('0x35')][_0x16f7('0x3b')]);_0xd43e3d['offset']=qs[_0x16f7('0x1e')](_0x34ac69[_0x16f7('0x35')][_0x16f7('0x1e')]);}return _0x2dd059[_0x16f7('0x88')](_0xd43e3d);}})[_0x16f7('0x26')](function(_0x32c28f){if(_0x32c28f){return _0x32c28f?{'count':_0xea9878,'rows':_0x32c28f}:null;}})[_0x16f7('0x26')](respondWithResult(_0xfd9330,null))[_0x16f7('0x4a')](handleError(_0xfd9330,null));};
\ No newline at end of file
+var _0x3d50=['update','then','destroy','end','send','MailQueue','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','name','filter','options','includeAll','rows','catch','show','keys','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','MailQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserMailQueue','rawAttributes','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','format','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject'];(function(_0x1d54e5,_0x33eee9){var _0x409263=function(_0x76a6af){while(--_0x76a6af){_0x1d54e5['push'](_0x1d54e5['shift']());}};_0x409263(++_0x33eee9);}(_0x3d50,0xf1));var _0x03d5=function(_0x4a707c,_0x222988){_0x4a707c=_0x4a707c-0x0;var _0x25bd93=_0x3d50[_0x4a707c];return _0x25bd93;};'use strict';var emlformat=require(_0x03d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03d5('0x1'));var jsonpatch=require(_0x03d5('0x2'));var rp=require(_0x03d5('0x3'));var moment=require(_0x03d5('0x4'));var BPromise=require(_0x03d5('0x5'));var Mustache=require(_0x03d5('0x6'));var util=require('util');var path=require(_0x03d5('0x7'));var sox=require(_0x03d5('0x8'));var csv=require(_0x03d5('0x9'));var ejs=require(_0x03d5('0xa'));var fs=require('fs');var fs_extra=require(_0x03d5('0xb'));var _=require(_0x03d5('0xc'));var squel=require(_0x03d5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x03d5('0xe'));var toCsv=require(_0x03d5('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x03d5('0xf'));var authService=require(_0x03d5('0x10'));var qs=require(_0x03d5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03d5('0x12'));var logger=require(_0x03d5('0x13'))(_0x03d5('0x14'));var utils=require(_0x03d5('0x15'));var config=require(_0x03d5('0x16'));var licenseUtil=require(_0x03d5('0x17'));var db=require(_0x03d5('0x18'))['db'];config[_0x03d5('0x19')]=_[_0x03d5('0x1a')](config[_0x03d5('0x19')],{'host':_0x03d5('0x1b'),'port':0x18eb});var socket=require(_0x03d5('0x1c'))(new Redis(config[_0x03d5('0x19')]));require(_0x03d5('0x1d'))[_0x03d5('0x1e')](socket);function respondWithStatusCode(_0x33c771,_0x595d45){_0x595d45=_0x595d45||0xcc;return function(_0x159130){if(_0x159130){return _0x33c771[_0x03d5('0x1f')](_0x595d45);}return _0x33c771[_0x03d5('0x20')](_0x595d45)['end']();};}function respondWithResult(_0x88fcd2,_0x44e25d){_0x44e25d=_0x44e25d||0xc8;return function(_0x169060){if(_0x169060){return _0x88fcd2['status'](_0x44e25d)[_0x03d5('0x21')](_0x169060);}};}function respondWithFilteredResult(_0x1a7be7,_0x161d04){return function(_0x3948a0){if(_0x3948a0){var _0xc2484b=typeof _0x161d04[_0x03d5('0x22')]===_0x03d5('0x23')&&typeof _0x161d04[_0x03d5('0x24')]==='undefined';var _0x3e4181=_0x3948a0[_0x03d5('0x25')];var _0x46a1ae=_0xc2484b?0x0:_0x161d04['offset'];var _0x25899f=_0xc2484b?_0x3948a0[_0x03d5('0x25')]:_0x161d04[_0x03d5('0x22')]+_0x161d04[_0x03d5('0x24')];var _0x57821e;if(_0x25899f>=_0x3e4181){_0x25899f=_0x3e4181;_0x57821e=0xc8;}else{_0x57821e=0xce;}_0x1a7be7[_0x03d5('0x20')](_0x57821e);return _0x1a7be7[_0x03d5('0x26')]('Content-Range',_0x46a1ae+'-'+_0x25899f+'/'+_0x3e4181)[_0x03d5('0x21')](_0x3948a0);}return null;};}function patchUpdates(_0x2348bf){return function(_0x200097){try{jsonpatch[_0x03d5('0x27')](_0x200097,_0x2348bf,!![]);}catch(_0x461285){return BPromise[_0x03d5('0x28')](_0x461285);}return _0x200097['save']();};}function saveUpdates(_0x1259d3,_0x31b316){return function(_0x8bfcbc){if(_0x8bfcbc){return _0x8bfcbc[_0x03d5('0x29')](_0x1259d3)[_0x03d5('0x2a')](function(_0xbf1423){return _0xbf1423;});}return null;};}function removeEntity(_0x58642b,_0x2535c0){return function(_0x3073d5){if(_0x3073d5){return _0x3073d5[_0x03d5('0x2b')]()[_0x03d5('0x2a')](function(){var _0x248c6b=_0x3073d5['get']({'plain':!![]});var _0xffa9c0='MailQueues';return db['UserProfileResource'][_0x03d5('0x2b')]({'where':{'type':_0xffa9c0,'resourceId':_0x248c6b['id']}})['then'](function(){return _0x3073d5;});})['then'](function(){_0x58642b['status'](0xcc)[_0x03d5('0x2c')]();});}};}function handleEntityNotFound(_0x4ebe22,_0x5d2bf2){return function(_0x9b8068){if(!_0x9b8068){_0x4ebe22[_0x03d5('0x1f')](0x194);}return _0x9b8068;};}function handleError(_0x15f22e,_0x20a16b){_0x20a16b=_0x20a16b||0x1f4;return function(_0x3ee25d){logger['error'](_0x3ee25d['stack']);if(_0x3ee25d['name']){delete _0x3ee25d['name'];}_0x15f22e[_0x03d5('0x20')](_0x20a16b)[_0x03d5('0x2d')](_0x3ee25d);};}exports['index']=function(_0x20aec7,_0x376700){var _0x2dc417={},_0x49d9ad={},_0x44a95e={'count':0x0,'rows':[]};var _0x29829a=_['map'](db[_0x03d5('0x2e')]['rawAttributes'],function(_0x1afd81){return{'name':_0x1afd81[_0x03d5('0x2f')],'type':_0x1afd81[_0x03d5('0x30')][_0x03d5('0x31')]};});_0x49d9ad[_0x03d5('0x32')]=_[_0x03d5('0x33')](_0x29829a,'name');_0x49d9ad[_0x03d5('0x34')]=_['keys'](_0x20aec7[_0x03d5('0x34')]);_0x49d9ad[_0x03d5('0x35')]=_[_0x03d5('0x36')](_0x49d9ad[_0x03d5('0x32')],_0x49d9ad['query']);_0x2dc417[_0x03d5('0x37')]=_['intersection'](_0x49d9ad[_0x03d5('0x32')],qs[_0x03d5('0x38')](_0x20aec7[_0x03d5('0x34')]['fields']));_0x2dc417[_0x03d5('0x37')]=_0x2dc417['attributes'][_0x03d5('0x39')]?_0x2dc417[_0x03d5('0x37')]:_0x49d9ad['model'];if(!_0x20aec7[_0x03d5('0x34')][_0x03d5('0x3a')](_0x03d5('0x3b'))){_0x2dc417[_0x03d5('0x24')]=qs[_0x03d5('0x24')](_0x20aec7[_0x03d5('0x34')][_0x03d5('0x24')]);_0x2dc417[_0x03d5('0x22')]=qs['offset'](_0x20aec7[_0x03d5('0x34')][_0x03d5('0x22')]);}_0x2dc417[_0x03d5('0x3c')]=qs[_0x03d5('0x3d')](_0x20aec7[_0x03d5('0x34')]['sort']);_0x2dc417[_0x03d5('0x3e')]=qs[_0x03d5('0x35')](_[_0x03d5('0x3f')](_0x20aec7[_0x03d5('0x34')],_0x49d9ad[_0x03d5('0x35')]),_0x29829a);if(_0x20aec7['query']['filter']){_0x2dc417[_0x03d5('0x3e')]=_[_0x03d5('0x40')](_0x2dc417[_0x03d5('0x3e')],{'$or':_[_0x03d5('0x33')](_0x29829a,function(_0x58c7f9){if(_0x58c7f9[_0x03d5('0x30')]!=='VIRTUAL'){var _0x211682={};_0x211682[_0x58c7f9[_0x03d5('0x41')]]={'$like':'%'+_0x20aec7[_0x03d5('0x34')][_0x03d5('0x42')]+'%'};return _0x211682;}})});}_0x2dc417=_[_0x03d5('0x40')]({},_0x2dc417,_0x20aec7[_0x03d5('0x43')]);var _0x17703a={'where':_0x2dc417[_0x03d5('0x3e')]};return db[_0x03d5('0x2e')][_0x03d5('0x25')](_0x17703a)['then'](function(_0x74374b){_0x44a95e[_0x03d5('0x25')]=_0x74374b;if(_0x20aec7['query'][_0x03d5('0x44')]){_0x2dc417['include']=[{'all':!![]}];}return db[_0x03d5('0x2e')]['findAll'](_0x2dc417);})[_0x03d5('0x2a')](function(_0x3e0db0){_0x44a95e[_0x03d5('0x45')]=_0x3e0db0;return _0x44a95e;})[_0x03d5('0x2a')](respondWithFilteredResult(_0x376700,_0x2dc417))[_0x03d5('0x46')](handleError(_0x376700,null));};exports[_0x03d5('0x47')]=function(_0x5c186d,_0xfaacc9){var _0x15d8e5={'raw':!![],'where':{'id':_0x5c186d['params']['id']}},_0x56ef6c={};_0x56ef6c['model']=_[_0x03d5('0x48')](db[_0x03d5('0x2e')]['rawAttributes']);_0x56ef6c['query']=_[_0x03d5('0x48')](_0x5c186d[_0x03d5('0x34')]);_0x56ef6c[_0x03d5('0x35')]=_[_0x03d5('0x36')](_0x56ef6c[_0x03d5('0x32')],_0x56ef6c[_0x03d5('0x34')]);_0x15d8e5[_0x03d5('0x37')]=_[_0x03d5('0x36')](_0x56ef6c['model'],qs['fields'](_0x5c186d[_0x03d5('0x34')][_0x03d5('0x38')]));_0x15d8e5[_0x03d5('0x37')]=_0x15d8e5[_0x03d5('0x37')][_0x03d5('0x39')]?_0x15d8e5['attributes']:_0x56ef6c[_0x03d5('0x32')];if(_0x5c186d[_0x03d5('0x34')]['includeAll']){_0x15d8e5[_0x03d5('0x49')]=[{'all':!![]}];}_0x15d8e5=_[_0x03d5('0x40')]({},_0x15d8e5,_0x5c186d[_0x03d5('0x43')]);return db[_0x03d5('0x2e')][_0x03d5('0x4a')](_0x15d8e5)[_0x03d5('0x2a')](handleEntityNotFound(_0xfaacc9,null))['then'](respondWithResult(_0xfaacc9,null))[_0x03d5('0x46')](handleError(_0xfaacc9,null));};exports[_0x03d5('0x4b')]=function(_0x1fae45,_0x317878){return db['MailQueue']['create'](_0x1fae45['body'],{})[_0x03d5('0x2a')](function(_0x2e94a3){var _0x10f23b=_0x1fae45['user']['get']({'plain':!![]});if(!_0x10f23b)throw new Error(_0x03d5('0x4c'));if(_0x10f23b['role']===_0x03d5('0x4d')){var _0x392e20=_0x2e94a3[_0x03d5('0x4e')]({'plain':!![]});var _0x5c4e9d=_0x03d5('0x4f');return db[_0x03d5('0x50')][_0x03d5('0x4a')]({'where':{'name':_0x5c4e9d,'userProfileId':_0x10f23b[_0x03d5('0x51')]},'raw':!![]})['then'](function(_0x190b42){if(_0x190b42&&_0x190b42[_0x03d5('0x52')]===0x0){return db[_0x03d5('0x53')][_0x03d5('0x4b')]({'name':_0x392e20[_0x03d5('0x41')],'resourceId':_0x392e20['id'],'type':_0x190b42[_0x03d5('0x41')],'sectionId':_0x190b42['id']},{})[_0x03d5('0x2a')](function(){return _0x2e94a3;});}else{return _0x2e94a3;}})[_0x03d5('0x46')](function(_0x5406a7){logger[_0x03d5('0x54')](_0x03d5('0x55'),_0x5406a7);throw _0x5406a7;});}return _0x2e94a3;})[_0x03d5('0x2a')](respondWithResult(_0x317878,0xc9))[_0x03d5('0x46')](handleError(_0x317878,null));};exports[_0x03d5('0x29')]=function(_0x306b86,_0x4b0a7c){if(_0x306b86[_0x03d5('0x56')]['id']){delete _0x306b86[_0x03d5('0x56')]['id'];}return db[_0x03d5('0x2e')][_0x03d5('0x4a')]({'where':{'id':_0x306b86[_0x03d5('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b0a7c,null))['then'](saveUpdates(_0x306b86[_0x03d5('0x56')],null))[_0x03d5('0x2a')](respondWithResult(_0x4b0a7c,null))['catch'](handleError(_0x4b0a7c,null));};exports[_0x03d5('0x2b')]=function(_0x185a42,_0x13b9c4){return db['MailQueue'][_0x03d5('0x4a')]({'where':{'id':_0x185a42[_0x03d5('0x57')]['id']}})[_0x03d5('0x2a')](handleEntityNotFound(_0x13b9c4,null))['then'](removeEntity(_0x13b9c4,null))['catch'](handleError(_0x13b9c4,null));};exports[_0x03d5('0x58')]=function(_0x451910,_0x12ae3c){return db[_0x03d5('0x2e')][_0x03d5('0x58')]()['then'](respondWithResult(_0x12ae3c,null))[_0x03d5('0x46')](handleError(_0x12ae3c,null));};exports[_0x03d5('0x59')]=function(_0x351302,_0x1761ec,_0x336c47){var _0x3b4070={'raw':!![],'where':{}},_0x4d9fdc={},_0xd6b899;return db[_0x03d5('0x2e')][_0x03d5('0x5a')]({'where':{'id':_0x351302[_0x03d5('0x57')]['id']}})['then'](handleEntityNotFound(_0x1761ec,null))[_0x03d5('0x2a')](function(_0x5cea4c){if(_0x5cea4c){_0xd6b899=_0x5cea4c['get']({'plain':!![]});_0x4d9fdc[_0x03d5('0x32')]=_['keys'](db[_0x03d5('0x5b')][_0x03d5('0x5c')]);_0x4d9fdc[_0x03d5('0x34')]=_[_0x03d5('0x48')](_0x351302[_0x03d5('0x34')]);_0x4d9fdc['filters']=_[_0x03d5('0x36')](_0x4d9fdc['model'],_0x4d9fdc[_0x03d5('0x34')]);_0x3b4070[_0x03d5('0x37')]=_[_0x03d5('0x36')](_0x4d9fdc[_0x03d5('0x32')],qs[_0x03d5('0x38')](_0x351302[_0x03d5('0x34')][_0x03d5('0x38')]));_0x3b4070[_0x03d5('0x37')]=_0x3b4070[_0x03d5('0x37')]['length']?_0x3b4070[_0x03d5('0x37')]:_0x4d9fdc[_0x03d5('0x32')];if(!_0x351302[_0x03d5('0x34')][_0x03d5('0x3a')]('nolimit')){_0x3b4070[_0x03d5('0x24')]=qs['limit'](_0x351302[_0x03d5('0x34')][_0x03d5('0x24')]);_0x3b4070[_0x03d5('0x22')]=qs[_0x03d5('0x22')](_0x351302['query'][_0x03d5('0x22')]);}_0x3b4070[_0x03d5('0x3c')]=qs[_0x03d5('0x3d')](_0x351302[_0x03d5('0x34')][_0x03d5('0x3d')]);_0x3b4070[_0x03d5('0x3e')]=qs[_0x03d5('0x35')](_[_0x03d5('0x3f')](_0x351302[_0x03d5('0x34')],_0x4d9fdc[_0x03d5('0x35')]));_0x3b4070[_0x03d5('0x3e')][_0x03d5('0x5d')]=_0x5cea4c['id'];if(_0x351302[_0x03d5('0x34')][_0x03d5('0x42')]){_0x3b4070[_0x03d5('0x3e')]=_[_0x03d5('0x40')](_0x3b4070[_0x03d5('0x3e')],{'$or':_[_0x03d5('0x33')](_0x3b4070[_0x03d5('0x37')],function(_0x49f671){var _0x3ce2be={};_0x3ce2be[_0x49f671]={'$like':'%'+_0x351302[_0x03d5('0x34')][_0x03d5('0x42')]+'%'};return _0x3ce2be;})});}_0x3b4070=_[_0x03d5('0x40')]({},_0x3b4070,_0x351302[_0x03d5('0x43')]);return db[_0x03d5('0x5b')][_0x03d5('0x5e')](_0x3b4070);}})['then'](function(_0x5a5806){if(_0x5a5806){return db[_0x03d5('0x5f')][_0x03d5('0x60')]({'where':{'id':_[_0x03d5('0x33')](_0x5a5806,_0x03d5('0x61')),'role':_0x03d5('0x62')},'attributes':['id','name',_0x03d5('0x63'),'updatedAt','createdAt']});}})[_0x03d5('0x2a')](function(_0xa8d3bf){if(_0xa8d3bf){return{'count':_0xa8d3bf[_0x03d5('0x25')],'rows':_[_0x03d5('0x33')](_0xa8d3bf['rows'],function(_0x1d4559){return{'membername':_0x1d4559[_0x03d5('0x41')],'UserId':_0x1d4559['id'],'queue_name':_0xd6b899['name'],'MailQueueId':_0xd6b899['id'],'interface':util[_0x03d5('0x64')]('%s/%s',_0x03d5('0x65'),_0x1d4559[_0x03d5('0x41')]),'penalty':0x0,'paused':_0x1d4559[_0x03d5('0x63')],'createdAt':_0x1d4559['createdAt'],'updatedAt':_0x1d4559[_0x03d5('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x03d5('0x2a')](respondWithFilteredResult(_0x1761ec,_0x3b4070))['catch'](handleError(_0x1761ec,null));};exports['getTeams']=function(_0x525762,_0x4c09ae,_0x4ee862){var _0x10a54e={};var _0x40c277={};var _0x468f6d;var _0x6f3cf3;return db[_0x03d5('0x2e')][_0x03d5('0x5a')]({'where':{'id':_0x525762[_0x03d5('0x57')]['id']}})[_0x03d5('0x2a')](handleEntityNotFound(_0x4c09ae,null))[_0x03d5('0x2a')](function(_0x1b330d){if(_0x1b330d){_0x468f6d=_0x1b330d;_0x40c277['model']=_[_0x03d5('0x48')](db[_0x03d5('0x67')]['rawAttributes']);_0x40c277['query']=_[_0x03d5('0x48')](_0x525762[_0x03d5('0x34')]);_0x40c277['filters']=_[_0x03d5('0x36')](_0x40c277['model'],_0x40c277[_0x03d5('0x34')]);_0x10a54e[_0x03d5('0x37')]=_[_0x03d5('0x36')](_0x40c277['model'],qs[_0x03d5('0x38')](_0x525762['query'][_0x03d5('0x38')]));_0x10a54e[_0x03d5('0x37')]=_0x10a54e['attributes'][_0x03d5('0x39')]?_0x10a54e[_0x03d5('0x37')]:_0x40c277[_0x03d5('0x32')];_0x10a54e[_0x03d5('0x3c')]=qs['sort'](_0x525762[_0x03d5('0x34')][_0x03d5('0x3d')]);_0x10a54e[_0x03d5('0x3e')]=qs[_0x03d5('0x35')](_['pick'](_0x525762[_0x03d5('0x34')],_0x40c277['filters']));if(_0x525762[_0x03d5('0x34')][_0x03d5('0x42')]){_0x10a54e[_0x03d5('0x3e')]=_[_0x03d5('0x40')](_0x10a54e[_0x03d5('0x3e')],{'$or':_['map'](_0x10a54e[_0x03d5('0x37')],function(_0x3e92d6){var _0x86f5d3={};_0x86f5d3[_0x3e92d6]={'$like':'%'+_0x525762[_0x03d5('0x34')]['filter']+'%'};return _0x86f5d3;})});}_0x10a54e=_[_0x03d5('0x40')]({},_0x10a54e,_0x525762[_0x03d5('0x43')]);return _0x468f6d[_0x03d5('0x68')](_0x10a54e);}})[_0x03d5('0x2a')](function(_0x41df0f){if(_0x41df0f){_0x6f3cf3=_0x41df0f['length'];if(!_0x525762[_0x03d5('0x34')][_0x03d5('0x3a')]('nolimit')){_0x10a54e[_0x03d5('0x24')]=qs[_0x03d5('0x24')](_0x525762[_0x03d5('0x34')][_0x03d5('0x24')]);_0x10a54e[_0x03d5('0x22')]=qs['offset'](_0x525762[_0x03d5('0x34')][_0x03d5('0x22')]);}return _0x468f6d[_0x03d5('0x68')](_0x10a54e);}})[_0x03d5('0x2a')](function(_0x5bc7ca){if(_0x5bc7ca){return _0x5bc7ca?{'count':_0x6f3cf3,'rows':_0x5bc7ca}:null;}})['then'](respondWithResult(_0x4c09ae,null))[_0x03d5('0x46')](handleError(_0x4c09ae,null));};exports[_0x03d5('0x69')]=function(_0x1183c0,_0x232341,_0x108bdf){var _0x11901e=_0x1183c0[_0x03d5('0x56')][_0x03d5('0x6a')];return db[_0x03d5('0x67')]['findAll']({'where':{'id':_0x11901e},'attributes':['id'],'include':[{'model':db[_0x03d5('0x5f')],'as':_0x03d5('0x6b'),'attributes':['id',_0x03d5('0x41'),'online',_0x03d5('0x6c'),'interface'],'raw':!![]}]})['then'](function(_0x3d8c4e){if(_0x3d8c4e){var _0x36c117=_[_0x03d5('0x6d')](_0x3d8c4e,function(_0x1214c3){var _0x1caf12=_0x1214c3[_0x03d5('0x4e')]({'plain':!![]});return _0x1caf12[_0x03d5('0x6b')];});return db[_0x03d5('0x2e')]['find']({'where':{'id':_0x1183c0[_0x03d5('0x57')]['id']}})[_0x03d5('0x2a')](function(_0x363fe0){return db[_0x03d5('0x6e')][_0x03d5('0x6f')](function(_0x4040de){return _0x363fe0['addTeams'](_0x11901e,{'transaction':_0x4040de})['then'](function(){return BPromise[_0x03d5('0x70')](_0x36c117,function(_0x211564){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x211564['id'],'MailQueueId':_0x1183c0[_0x03d5('0x57')]['id']},'transaction':_0x4040de});});})[_0x03d5('0x2a')](function(){_0x36c117[_0x03d5('0x71')](function(_0x1fade5){socket[_0x03d5('0x72')](_0x03d5('0x73'),{'UserId':_0x1fade5['id'],'MailQueueId':_0x363fe0['id']});});});});});}})[_0x03d5('0x2a')](respondWithStatusCode(_0x232341,null))[_0x03d5('0x46')](handleError(_0x232341,null));};exports['removeTeams']=function(_0x26a69c,_0xc18328,_0x3a375a){return db['Team'][_0x03d5('0x5e')]({'where':{'id':_0x26a69c[_0x03d5('0x34')][_0x03d5('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x03d5('0x5f')],'as':_0x03d5('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x03d5('0x2a')](handleEntityNotFound(_0xc18328,null))[_0x03d5('0x2a')](function(_0x362ce5){var _0x4ff6e1=_[_0x03d5('0x33')](_0x362ce5,'id');var _0x5362b8=[];var _0x1a74de=[];var _0x18a6b5=squel[_0x03d5('0x74')]();_0x18a6b5[_0x03d5('0x75')](_0x03d5('0x76'))[_0x03d5('0x77')](_0x03d5('0x78'),'tq')[_0x03d5('0x79')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x03d5('0x3e')](_0x03d5('0x7a'),_0x26a69c[_0x03d5('0x57')]['id']);for(var _0x3115cc=0x0;_0x3115cc<_0x362ce5[_0x03d5('0x39')];_0x3115cc+=0x1){let _0x2f4421=_0x362ce5[_0x3115cc];for(var _0x46e36b=0x0;_0x46e36b<_0x2f4421[_0x03d5('0x6b')][_0x03d5('0x39')];_0x46e36b+=0x1){let _0x3722ba=_0x2f4421['Agents'][_0x46e36b];var _0x69012a=_0x18a6b5[_0x03d5('0x7b')]();_0x69012a[_0x03d5('0x3e')](_0x03d5('0x7c'),_0x3722ba['id']);_0x1a74de[_0x03d5('0x7d')](db[_0x03d5('0x6e')][_0x03d5('0x34')](_0x69012a['toString'](),{'type':db[_0x03d5('0x6e')][_0x03d5('0x7e')]['SELECT']})[_0x03d5('0x2a')](function(_0x367017){if(_0x367017['length']===0x1){return _0x3722ba['id'];}else{var _0x5efceb=_[_0x03d5('0x7f')](_[_0x03d5('0x33')](_0x367017,_0x03d5('0x80')),function(_0x4289b3){return _[_0x03d5('0x81')](_0x4ff6e1,_0x4289b3);});if(_0x5efceb){return _0x3722ba['id'];}}}));}}return BPromise[_0x03d5('0x82')](_0x1a74de)[_0x03d5('0x2a')](function(_0x140783){_0x5362b8=_(_0x5362b8)[_0x03d5('0x83')](_0x140783)[_0x03d5('0x84')]()[_0x03d5('0x85')]();return db['MailQueue']['find']({'where':{'id':_0x26a69c[_0x03d5('0x57')]['id']}})[_0x03d5('0x2a')](function(_0x1565c7){return db[_0x03d5('0x6e')][_0x03d5('0x6f')](function(_0x59facc){return _0x1565c7[_0x03d5('0x86')](_0x26a69c[_0x03d5('0x34')][_0x03d5('0x6a')],{'transaction':_0x59facc})[_0x03d5('0x2a')](function(){if(!_[_0x03d5('0x87')](_0x5362b8)){return _0x1565c7[_0x03d5('0x88')](_0x5362b8,{'transaction':_0x59facc});}})[_0x03d5('0x2a')](function(){_0x5362b8['forEach'](function(_0x46e155){socket[_0x03d5('0x72')](_0x03d5('0x89'),{'UserId':_0x46e155,'MailQueueId':_0x1565c7['id']});});});});});});})[_0x03d5('0x2a')](respondWithStatusCode(_0xc18328,null))[_0x03d5('0x46')](handleError(_0xc18328,null));};exports[_0x03d5('0x8a')]=function(_0x185c19,_0x12f43a,_0x12763d){return db[_0x03d5('0x2e')]['find']({'where':{'id':_0x185c19[_0x03d5('0x57')]['id']}})[_0x03d5('0x2a')](handleEntityNotFound(_0x12f43a,null))[_0x03d5('0x2a')](function(_0x1661f0){if(_0x1661f0){return _0x1661f0[_0x03d5('0x8a')](_0x185c19[_0x03d5('0x56')]['ids'],_['omit'](_0x185c19[_0x03d5('0x56')],[_0x03d5('0x6a'),'id'])||{})[_0x03d5('0x8b')](function(_0x53771f){for(var _0x436e4b=0x0;_0x436e4b<_0x185c19[_0x03d5('0x56')][_0x03d5('0x6a')][_0x03d5('0x39')];_0x436e4b+=0x1){socket['emit'](_0x03d5('0x73'),{'UserId':Number(_0x185c19[_0x03d5('0x56')][_0x03d5('0x6a')][_0x436e4b]),'MailQueueId':Number(_0x185c19[_0x03d5('0x57')]['id'])});}return _0x53771f;});}})[_0x03d5('0x2a')](respondWithResult(_0x12f43a,null))[_0x03d5('0x46')](handleError(_0x12f43a,null));};exports[_0x03d5('0x88')]=function(_0x5d75a5,_0x726157,_0x159125){return db[_0x03d5('0x2e')][_0x03d5('0x4a')]({'where':{'id':_0x5d75a5['params']['id']}})[_0x03d5('0x2a')](handleEntityNotFound(_0x726157,null))[_0x03d5('0x2a')](function(_0x423b9a){if(_0x423b9a){return _0x423b9a[_0x03d5('0x88')](_0x5d75a5[_0x03d5('0x34')][_0x03d5('0x6a')])['then'](function(){if(_['isArray'](_0x5d75a5[_0x03d5('0x34')][_0x03d5('0x6a')])){for(var _0xc239ef=0x0;_0xc239ef<_0x5d75a5[_0x03d5('0x34')]['ids']['length'];_0xc239ef+=0x1){socket[_0x03d5('0x72')](_0x03d5('0x89'),{'UserId':Number(_0x5d75a5[_0x03d5('0x34')][_0x03d5('0x6a')][_0xc239ef]),'MailQueueId':Number(_0x5d75a5['params']['id'])});}}else{socket[_0x03d5('0x72')](_0x03d5('0x89'),{'UserId':Number(_0x5d75a5[_0x03d5('0x34')]['ids']),'MailQueueId':Number(_0x5d75a5[_0x03d5('0x57')]['id'])});}});}})[_0x03d5('0x2a')](respondWithStatusCode(_0x726157,null))[_0x03d5('0x46')](handleError(_0x726157,null));};exports[_0x03d5('0x8c')]=function(_0x5200eb,_0x51bef1,_0xcae7a1){var _0x3f0492={};var _0x49be88={};var _0x1d9f1d;var _0x4d131c;return db[_0x03d5('0x2e')]['findOne']({'where':{'id':_0x5200eb[_0x03d5('0x57')]['id']}})[_0x03d5('0x2a')](handleEntityNotFound(_0x51bef1,null))[_0x03d5('0x2a')](function(_0x4a40df){if(_0x4a40df){_0x1d9f1d=_0x4a40df;_0x49be88[_0x03d5('0x32')]=_[_0x03d5('0x48')](db[_0x03d5('0x5f')]['rawAttributes']);_0x49be88[_0x03d5('0x34')]=_[_0x03d5('0x48')](_0x5200eb[_0x03d5('0x34')]);_0x49be88['filters']=_[_0x03d5('0x36')](_0x49be88[_0x03d5('0x32')],_0x49be88[_0x03d5('0x34')]);_0x3f0492[_0x03d5('0x37')]=_['intersection'](_0x49be88[_0x03d5('0x32')],qs[_0x03d5('0x38')](_0x5200eb['query'][_0x03d5('0x38')]));_0x3f0492['attributes']=_0x3f0492[_0x03d5('0x37')]['length']?_0x3f0492[_0x03d5('0x37')]:_0x49be88[_0x03d5('0x32')];_0x3f0492[_0x03d5('0x3c')]=qs[_0x03d5('0x3d')](_0x5200eb[_0x03d5('0x34')]['sort']);_0x3f0492['where']=qs[_0x03d5('0x35')](_[_0x03d5('0x3f')](_0x5200eb['query'],_0x49be88[_0x03d5('0x35')]));if(_0x5200eb[_0x03d5('0x34')]['filter']){_0x3f0492[_0x03d5('0x3e')]=_[_0x03d5('0x40')](_0x3f0492[_0x03d5('0x3e')],{'$or':_['map'](_0x3f0492[_0x03d5('0x37')],function(_0x3786db){var _0x2d58fd={};_0x2d58fd[_0x3786db]={'$like':'%'+_0x5200eb[_0x03d5('0x34')][_0x03d5('0x42')]+'%'};return _0x2d58fd;})});}_0x3f0492=_[_0x03d5('0x40')]({},_0x3f0492,_0x5200eb['options']);return _0x1d9f1d['getAgents'](_0x3f0492);}})['then'](function(_0x68fd47){if(_0x68fd47){_0x4d131c=_0x68fd47[_0x03d5('0x39')];if(!_0x5200eb[_0x03d5('0x34')][_0x03d5('0x3a')](_0x03d5('0x3b'))){_0x3f0492[_0x03d5('0x24')]=qs[_0x03d5('0x24')](_0x5200eb[_0x03d5('0x34')][_0x03d5('0x24')]);_0x3f0492[_0x03d5('0x22')]=qs['offset'](_0x5200eb[_0x03d5('0x34')][_0x03d5('0x22')]);}return _0x1d9f1d[_0x03d5('0x8c')](_0x3f0492);}})[_0x03d5('0x2a')](function(_0x48a2e9){if(_0x48a2e9){return _0x48a2e9?{'count':_0x4d131c,'rows':_0x48a2e9}:null;}})[_0x03d5('0x2a')](respondWithResult(_0x51bef1,null))['catch'](handleError(_0x51bef1,null));};
\ No newline at end of file
index 7ad2f97..f43cac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cd1=['exports','events','../../mysqldb','MailQueue','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x1cd1,0xf4));var _0x11cd=function(_0x24d92e,_0x583aa8){_0x24d92e=_0x24d92e-0x0;var _0x1ba423=_0x1cd1[_0x24d92e];return _0x1ba423;};'use strict';var EventEmitter=require(_0x11cd('0x0'));var MailQueue=require(_0x11cd('0x1'))['db'][_0x11cd('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x11cd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x11cd('0x4')};function emitEvent(_0x4cea90){return function(_0x314a3d,_0x243e3a,_0x11115a){MailQueueEvents['emit'](_0x4cea90+':'+_0x314a3d['id'],_0x314a3d);MailQueueEvents[_0x11cd('0x5')](_0x4cea90,_0x314a3d);_0x11115a(null);};}for(var e in events){if(events[_0x11cd('0x6')](e)){var event=events[e];MailQueue[_0x11cd('0x7')](e,emitEvent(event));}}module[_0x11cd('0x8')]=MailQueueEvents;
\ No newline at end of file
+var _0x677b=['setMaxListeners','save','hasOwnProperty','../../mysqldb','MailQueue'];(function(_0x5bbc05,_0x3c84dc){var _0x3e9923=function(_0x163d66){while(--_0x163d66){_0x5bbc05['push'](_0x5bbc05['shift']());}};_0x3e9923(++_0x3c84dc);}(_0x677b,0x148));var _0xb677=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x677b[_0x7275e9];return _0x17b99d;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xb677('0x0'))['db'][_0xb677('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb677('0x2')](0x0);var events={'afterCreate':_0xb677('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x313f58){return function(_0x5907fb,_0x1bb834,_0x4737ad){MailQueueEvents['emit'](_0x313f58+':'+_0x5907fb['id'],_0x5907fb);MailQueueEvents['emit'](_0x313f58,_0x5907fb);_0x4737ad(null);};}for(var e in events){if(events[_0xb677('0x4')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
index b59a9f9..c902c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d2b=['path','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','lodash','util','api','bluebird','request-promise'];(function(_0x1a7a09,_0x1ddfab){var _0x11a7b1=function(_0x4902cb){while(--_0x4902cb){_0x1a7a09['push'](_0x1a7a09['shift']());}};_0x11a7b1(++_0x1ddfab);}(_0x5d2b,0x69));var _0xb5d2=function(_0x1fa2a2,_0x99ae74){_0x1fa2a2=_0x1fa2a2-0x0;var _0x434331=_0x5d2b[_0x1fa2a2];return _0x434331;};'use strict';var _=require(_0xb5d2('0x0'));var util=require(_0xb5d2('0x1'));var logger=require('../../config/logger')(_0xb5d2('0x2'));var moment=require('moment');var BPromise=require(_0xb5d2('0x3'));var rp=require(_0xb5d2('0x4'));var fs=require('fs');var path=require(_0xb5d2('0x5'));var rimraf=require('rimraf');var config=require(_0xb5d2('0x6'));var attributes=require(_0xb5d2('0x7'));module[_0xb5d2('0x8')]=function(_0x16440f,_0x355dac){return _0x16440f[_0xb5d2('0x9')]('MailQueue',attributes,{'tableName':_0xb5d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ded=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger'];(function(_0x2c6e4e,_0x5d4d2d){var _0x5eba6e=function(_0x31c5fd){while(--_0x31c5fd){_0x2c6e4e['push'](_0x2c6e4e['shift']());}};_0x5eba6e(++_0x5d4d2d);}(_0x5ded,0x165));var _0xd5de=function(_0x4e4bf2,_0x1a25ea){_0x4e4bf2=_0x4e4bf2-0x0;var _0x5c03b3=_0x5ded[_0x4e4bf2];return _0x5c03b3;};'use strict';var _=require(_0xd5de('0x0'));var util=require(_0xd5de('0x1'));var logger=require(_0xd5de('0x2'))(_0xd5de('0x3'));var moment=require(_0xd5de('0x4'));var BPromise=require(_0xd5de('0x5'));var rp=require(_0xd5de('0x6'));var fs=require('fs');var path=require(_0xd5de('0x7'));var rimraf=require(_0xd5de('0x8'));var config=require(_0xd5de('0x9'));var attributes=require(_0xd5de('0xa'));module[_0xd5de('0xb')]=function(_0x25f227,_0x1f369d){return _0x25f227[_0xd5de('0xc')](_0xd5de('0xd'),attributes,{'tableName':_0xd5de('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 301fca8..778c88b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3da5=['register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','model','map','ShowMailQueue','where','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./mailQueue.socket'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x3da5,0x131));var _0x53da=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3da5[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x53da('0x0'));var util=require(_0x53da('0x1'));var moment=require('moment');var BPromise=require(_0x53da('0x2'));var rs=require(_0x53da('0x3'));var fs=require('fs');var Redis=require(_0x53da('0x4'));var db=require(_0x53da('0x5'))['db'];var utils=require(_0x53da('0x6'));var logger=require(_0x53da('0x7'))(_0x53da('0x8'));var config=require('../../config/environment');var jayson=require(_0x53da('0x9'));var client=jayson[_0x53da('0xa')][_0x53da('0xb')]({'port':0x232a});config[_0x53da('0xc')]=_['defaults'](config['redis'],{'host':_0x53da('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53da('0xc')]));require(_0x53da('0xe'))[_0x53da('0xf')](socket);function respondWithRpcPromise(_0x3969d1,_0x11ef97,_0x4e8601){return new BPromise(function(_0x2fd936,_0x13978e){return client[_0x53da('0x10')](_0x3969d1,_0x4e8601)[_0x53da('0x11')](function(_0x5ee239){logger[_0x53da('0x12')](_0x53da('0x13'),_0x11ef97,_0x53da('0x14'));logger[_0x53da('0x15')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x11ef97,_0x53da('0x14'),JSON[_0x53da('0x16')](_0x5ee239));if(_0x5ee239[_0x53da('0x17')]){if(_0x5ee239[_0x53da('0x17')][_0x53da('0x18')]===0x1f4){logger['error'](_0x53da('0x13'),_0x11ef97,_0x5ee239[_0x53da('0x17')][_0x53da('0x19')]);return _0x13978e(_0x5ee239['error'][_0x53da('0x19')]);}logger[_0x53da('0x17')](_0x53da('0x13'),_0x11ef97,_0x5ee239[_0x53da('0x17')][_0x53da('0x19')]);return _0x2fd936(_0x5ee239[_0x53da('0x17')][_0x53da('0x19')]);}else{logger[_0x53da('0x12')](_0x53da('0x13'),_0x11ef97,_0x53da('0x14'));_0x2fd936(_0x5ee239[_0x53da('0x1a')]['message']);}})['catch'](function(_0x382ffe){logger[_0x53da('0x17')](_0x53da('0x13'),_0x11ef97,_0x382ffe);_0x13978e(_0x382ffe);});});}exports[_0x53da('0x1b')]=function(_0x1d0245){var _0x5e9f51=this;return new Promise(function(_0x5bfcc5,_0x28125d){return db[_0x53da('0x1c')][_0x53da('0x1d')]({'raw':_0x1d0245['options']?_0x1d0245[_0x53da('0x1e')][_0x53da('0x1f')]===undefined?!![]:![]:!![],'where':_0x1d0245[_0x53da('0x1e')]?_0x1d0245[_0x53da('0x1e')]['where']||null:null,'attributes':_0x1d0245[_0x53da('0x1e')]?_0x1d0245[_0x53da('0x1e')][_0x53da('0x20')]||null:null,'limit':_0x1d0245['options']?_0x1d0245[_0x53da('0x1e')][_0x53da('0x21')]||null:null,'include':_0x1d0245['options']?_0x1d0245['options'][_0x53da('0x22')]?_['map'](_0x1d0245['options']['include'],function(_0x5c0ad5){return{'model':db[_0x5c0ad5[_0x53da('0x23')]],'as':_0x5c0ad5['as'],'attributes':_0x5c0ad5[_0x53da('0x20')],'include':_0x5c0ad5[_0x53da('0x22')]?_[_0x53da('0x24')](_0x5c0ad5[_0x53da('0x22')],function(_0x78125f){return{'model':db[_0x78125f[_0x53da('0x23')]],'as':_0x78125f['as'],'attributes':_0x78125f['attributes'],'include':_0x78125f[_0x53da('0x22')]?_['map'](_0x78125f['include'],function(_0x3cdbc8){return{'model':db[_0x3cdbc8[_0x53da('0x23')]],'as':_0x3cdbc8['as'],'attributes':_0x3cdbc8[_0x53da('0x20')]};}):[]};}):[]};}):[]:[]})[_0x53da('0x11')](function(_0x24f561){logger[_0x53da('0x12')](_0x53da('0x1b'),_0x1d0245);logger['debug'](_0x53da('0x1b'),_0x1d0245,JSON[_0x53da('0x16')](_0x24f561));_0x5bfcc5(_0x24f561);})['catch'](function(_0x581a3b){logger['error'](_0x53da('0x1b'),_0x581a3b[_0x53da('0x19')],_0x1d0245);_0x28125d(_0x5e9f51['error'](0x1f4,_0x581a3b[_0x53da('0x19')]));});});};exports[_0x53da('0x25')]=function(_0x52f695){var _0x34e1e8=this;return new Promise(function(_0x24c6e5,_0x14258b){return db[_0x53da('0x1c')]['find']({'raw':_0x52f695[_0x53da('0x1e')]?_0x52f695[_0x53da('0x1e')][_0x53da('0x1f')]===undefined?!![]:![]:!![],'where':_0x52f695['options']?_0x52f695[_0x53da('0x1e')][_0x53da('0x26')]||null:null,'attributes':_0x52f695[_0x53da('0x1e')]?_0x52f695['options'][_0x53da('0x20')]||null:null,'include':_0x52f695[_0x53da('0x1e')]?_0x52f695[_0x53da('0x1e')][_0x53da('0x22')]?_[_0x53da('0x24')](_0x52f695[_0x53da('0x1e')][_0x53da('0x22')],function(_0x1ff34c){return{'model':db[_0x1ff34c[_0x53da('0x23')]],'as':_0x1ff34c['as'],'attributes':_0x1ff34c[_0x53da('0x20')],'include':_0x1ff34c[_0x53da('0x22')]?_[_0x53da('0x24')](_0x1ff34c[_0x53da('0x22')],function(_0x2a1a03){return{'model':db[_0x2a1a03[_0x53da('0x23')]],'as':_0x2a1a03['as'],'attributes':_0x2a1a03[_0x53da('0x20')],'include':_0x2a1a03['include']?_[_0x53da('0x24')](_0x2a1a03[_0x53da('0x22')],function(_0x442010){return{'model':db[_0x442010[_0x53da('0x23')]],'as':_0x442010['as'],'attributes':_0x442010['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c73a5){logger[_0x53da('0x12')](_0x53da('0x25'),_0x52f695);logger['debug']('ShowMailQueue',_0x52f695,JSON[_0x53da('0x16')](_0x1c73a5));_0x24c6e5(_0x1c73a5);})[_0x53da('0x27')](function(_0x4d557b){logger['error'](_0x53da('0x25'),_0x4d557b['message'],_0x52f695);_0x14258b(_0x34e1e8[_0x53da('0x17')](0x1f4,_0x4d557b[_0x53da('0x19')]));});});};
\ No newline at end of file
+var _0x2f03=['register','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','MailQueue,\x20%s,\x20%s','message','info','MailQueue','options','raw','attributes','limit','include','map','model','then','GetMailQueue','stringify','catch','ShowMailQueue','find','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','localhost','socket.io-emitter','redis','./mailQueue.socket'];(function(_0x3641fe,_0x4aedd9){var _0x4cfe7a=function(_0x447cb6){while(--_0x447cb6){_0x3641fe['push'](_0x3641fe['shift']());}};_0x4cfe7a(++_0x4aedd9);}(_0x2f03,0xfd));var _0x32f0=function(_0x257de9,_0x1181aa){_0x257de9=_0x257de9-0x0;var _0x2fade5=_0x2f03[_0x257de9];return _0x2fade5;};'use strict';var _=require('lodash');var util=require(_0x32f0('0x0'));var moment=require('moment');var BPromise=require(_0x32f0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32f0('0x2'));var db=require(_0x32f0('0x3'))['db'];var utils=require(_0x32f0('0x4'));var logger=require('../../config/logger')(_0x32f0('0x5'));var config=require('../../config/environment');var jayson=require(_0x32f0('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x32f0('0x7'),'port':0x18eb});var socket=require(_0x32f0('0x8'))(new Redis(config[_0x32f0('0x9')]));require(_0x32f0('0xa'))[_0x32f0('0xb')](socket);function respondWithRpcPromise(_0x46ae15,_0x11bebd,_0x4b4b87){return new BPromise(function(_0xc63b31,_0x408c7b){return client['request'](_0x46ae15,_0x4b4b87)['then'](function(_0x108130){logger['info']('MailQueue,\x20%s,\x20%s',_0x11bebd,'request\x20sent');logger[_0x32f0('0xc')](_0x32f0('0xd'),_0x11bebd,'request\x20sent',JSON['stringify'](_0x108130));if(_0x108130[_0x32f0('0xe')]){if(_0x108130[_0x32f0('0xe')][_0x32f0('0xf')]===0x1f4){logger['error'](_0x32f0('0x10'),_0x11bebd,_0x108130[_0x32f0('0xe')]['message']);return _0x408c7b(_0x108130[_0x32f0('0xe')][_0x32f0('0x11')]);}logger[_0x32f0('0xe')](_0x32f0('0x10'),_0x11bebd,_0x108130['error'][_0x32f0('0x11')]);return _0xc63b31(_0x108130[_0x32f0('0xe')][_0x32f0('0x11')]);}else{logger[_0x32f0('0x12')](_0x32f0('0x10'),_0x11bebd,'request\x20sent');_0xc63b31(_0x108130['result'][_0x32f0('0x11')]);}})['catch'](function(_0x1640f4){logger['error'](_0x32f0('0x10'),_0x11bebd,_0x1640f4);_0x408c7b(_0x1640f4);});});}exports['GetMailQueue']=function(_0x1402a3){var _0x85e4a2=this;return new Promise(function(_0x238bbf,_0x4b861f){return db[_0x32f0('0x13')]['findAll']({'raw':_0x1402a3[_0x32f0('0x14')]?_0x1402a3[_0x32f0('0x14')][_0x32f0('0x15')]===undefined?!![]:![]:!![],'where':_0x1402a3[_0x32f0('0x14')]?_0x1402a3['options']['where']||null:null,'attributes':_0x1402a3[_0x32f0('0x14')]?_0x1402a3[_0x32f0('0x14')][_0x32f0('0x16')]||null:null,'limit':_0x1402a3[_0x32f0('0x14')]?_0x1402a3['options'][_0x32f0('0x17')]||null:null,'include':_0x1402a3[_0x32f0('0x14')]?_0x1402a3[_0x32f0('0x14')][_0x32f0('0x18')]?_[_0x32f0('0x19')](_0x1402a3[_0x32f0('0x14')]['include'],function(_0x2585c1){return{'model':db[_0x2585c1[_0x32f0('0x1a')]],'as':_0x2585c1['as'],'attributes':_0x2585c1['attributes'],'include':_0x2585c1['include']?_[_0x32f0('0x19')](_0x2585c1[_0x32f0('0x18')],function(_0x381061){return{'model':db[_0x381061[_0x32f0('0x1a')]],'as':_0x381061['as'],'attributes':_0x381061[_0x32f0('0x16')],'include':_0x381061[_0x32f0('0x18')]?_['map'](_0x381061[_0x32f0('0x18')],function(_0x5559b1){return{'model':db[_0x5559b1['model']],'as':_0x5559b1['as'],'attributes':_0x5559b1[_0x32f0('0x16')]};}):[]};}):[]};}):[]:[]})[_0x32f0('0x1b')](function(_0x22d0fb){logger[_0x32f0('0x12')]('GetMailQueue',_0x1402a3);logger[_0x32f0('0xc')](_0x32f0('0x1c'),_0x1402a3,JSON[_0x32f0('0x1d')](_0x22d0fb));_0x238bbf(_0x22d0fb);})[_0x32f0('0x1e')](function(_0x337240){logger['error'](_0x32f0('0x1c'),_0x337240[_0x32f0('0x11')],_0x1402a3);_0x4b861f(_0x85e4a2[_0x32f0('0xe')](0x1f4,_0x337240['message']));});});};exports[_0x32f0('0x1f')]=function(_0x44f930){var _0x4f290b=this;return new Promise(function(_0x58b7ac,_0x4ab5f2){return db[_0x32f0('0x13')][_0x32f0('0x20')]({'raw':_0x44f930[_0x32f0('0x14')]?_0x44f930['options'][_0x32f0('0x15')]===undefined?!![]:![]:!![],'where':_0x44f930[_0x32f0('0x14')]?_0x44f930[_0x32f0('0x14')]['where']||null:null,'attributes':_0x44f930[_0x32f0('0x14')]?_0x44f930['options']['attributes']||null:null,'include':_0x44f930[_0x32f0('0x14')]?_0x44f930['options']['include']?_[_0x32f0('0x19')](_0x44f930['options'][_0x32f0('0x18')],function(_0x767066){return{'model':db[_0x767066['model']],'as':_0x767066['as'],'attributes':_0x767066[_0x32f0('0x16')],'include':_0x767066[_0x32f0('0x18')]?_['map'](_0x767066[_0x32f0('0x18')],function(_0x28a80d){return{'model':db[_0x28a80d[_0x32f0('0x1a')]],'as':_0x28a80d['as'],'attributes':_0x28a80d[_0x32f0('0x16')],'include':_0x28a80d[_0x32f0('0x18')]?_[_0x32f0('0x19')](_0x28a80d[_0x32f0('0x18')],function(_0xadba93){return{'model':db[_0xadba93[_0x32f0('0x1a')]],'as':_0xadba93['as'],'attributes':_0xadba93[_0x32f0('0x16')]};}):[]};}):[]};}):[]:[]})[_0x32f0('0x1b')](function(_0x17990d){logger['info'](_0x32f0('0x1f'),_0x44f930);logger['debug'](_0x32f0('0x1f'),_0x44f930,JSON['stringify'](_0x17990d));_0x58b7ac(_0x17990d);})[_0x32f0('0x1e')](function(_0x2737d4){logger[_0x32f0('0xe')](_0x32f0('0x1f'),_0x2737d4['message'],_0x44f930);_0x4ab5f2(_0x4f290b['error'](0x1f4,_0x2737d4[_0x32f0('0x11')]));});});};
\ No newline at end of file
index d9c0ece..b43594b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cb1=['update','removeListener','register','length','mailQueue:','remove'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4cb1,0x167));var _0x14cb=function(_0x6bff53,_0x2059eb){_0x6bff53=_0x6bff53-0x0;var _0x1f9e00=_0x4cb1[_0x6bff53];return _0x1f9e00;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0x14cb('0x0'),_0x14cb('0x1')];function createListener(_0x2dc27c,_0xca40db){return function(_0x15a9af){_0xca40db['emit'](_0x2dc27c,_0x15a9af);};}function removeListener(_0x5e68f6,_0x557768){return function(){MailQueueEvents[_0x14cb('0x2')](_0x5e68f6,_0x557768);};}exports[_0x14cb('0x3')]=function(_0x108136){for(var _0x6de6d9=0x0,_0x23aa5f=events[_0x14cb('0x4')];_0x6de6d9<_0x23aa5f;_0x6de6d9++){var _0x9ed853=events[_0x6de6d9];var _0x1fd724=createListener(_0x14cb('0x5')+_0x9ed853,_0x108136);MailQueueEvents['on'](_0x9ed853,_0x1fd724);}};
\ No newline at end of file
+var _0x98f1=['length','remove','update','emit','removeListener','register'];(function(_0x57383a,_0x20b8b7){var _0x3b2f46=function(_0x3b9024){while(--_0x3b9024){_0x57383a['push'](_0x57383a['shift']());}};_0x3b2f46(++_0x20b8b7);}(_0x98f1,0x1cf));var _0x198f=function(_0x3e4a34,_0x452723){_0x3e4a34=_0x3e4a34-0x0;var _0x2d2d2e=_0x98f1[_0x3e4a34];return _0x2d2d2e;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0x198f('0x0'),_0x198f('0x1')];function createListener(_0x37b286,_0x54953b){return function(_0x1eac33){_0x54953b[_0x198f('0x2')](_0x37b286,_0x1eac33);};}function removeListener(_0x549617,_0x12c7dd){return function(){MailQueueEvents[_0x198f('0x3')](_0x549617,_0x12c7dd);};}exports[_0x198f('0x4')]=function(_0x589abf){for(var _0x3b9901=0x0,_0x193097=events[_0x198f('0x5')];_0x3b9901<_0x193097;_0x3b9901++){var _0x5f55ad=events[_0x3b9901];var _0x36474d=createListener('mailQueue:'+_0x5f55ad,_0x589abf);MailQueueEvents['on'](_0x5f55ad,_0x36474d);}};
\ No newline at end of file
index ea318eb..2b05301 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc088=['../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2f6926,_0x3daccf){var _0x17538b=function(_0x941a2a){while(--_0x941a2a){_0x2f6926['push'](_0x2f6926['shift']());}};_0x17538b(++_0x3daccf);}(_0xc088,0x13f));var _0x8c08=function(_0x5d2bb7,_0x58dc45){_0x5d2bb7=_0x5d2bb7-0x0;var _0xf52381=_0xc088[_0x5d2bb7];return _0xf52381;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8c08('0x0'));var express=require('express');var router=express[_0x8c08('0x1')]();var fs_extra=require(_0x8c08('0x2'));var auth=require(_0x8c08('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8c08('0x4'));var controller=require(_0x8c08('0x5'));router[_0x8c08('0x6')]('/',auth['isAuthenticated'](),controller[_0x8c08('0x7')]);router['get'](_0x8c08('0x8'),auth[_0x8c08('0x9')](),controller['describe']);router[_0x8c08('0x6')](_0x8c08('0xa'),auth[_0x8c08('0x9')](),controller[_0x8c08('0xb')]);router[_0x8c08('0xc')]('/',auth[_0x8c08('0x9')](),controller[_0x8c08('0xd')]);router[_0x8c08('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8c08('0xf')]);router[_0x8c08('0x10')](_0x8c08('0xa'),auth[_0x8c08('0x9')](),controller[_0x8c08('0x11')]);module[_0x8c08('0x12')]=router;
\ No newline at end of file
+var _0xd284=['fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','util','express','Router'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xd284,0x12f));var _0x4d28=function(_0x29d41b,_0xd389f){_0x29d41b=_0x29d41b-0x0;var _0x19e40d=_0xd284[_0x29d41b];return _0x19e40d;};'use strict';var multer=require('multer');var util=require(_0x4d28('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d28('0x1'));var router=express[_0x4d28('0x2')]();var fs_extra=require(_0x4d28('0x3'));var auth=require(_0x4d28('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4d28('0x5'));var controller=require(_0x4d28('0x6'));router[_0x4d28('0x7')]('/',auth[_0x4d28('0x8')](),controller['index']);router[_0x4d28('0x7')](_0x4d28('0x9'),auth[_0x4d28('0x8')](),controller['describe']);router[_0x4d28('0x7')](_0x4d28('0xa'),auth[_0x4d28('0x8')](),controller[_0x4d28('0xb')]);router[_0x4d28('0xc')]('/',auth[_0x4d28('0x8')](),controller[_0x4d28('0xd')]);router[_0x4d28('0xe')]('/:id',auth[_0x4d28('0x8')](),controller[_0x4d28('0xf')]);router[_0x4d28('0x10')](_0x4d28('0xa'),auth[_0x4d28('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 112ce77..5d90cf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fc8=['DATE','moment','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0fc8,0xe1));var _0x80fc=function(_0x36669a,_0x5943fe){_0x36669a=_0x36669a-0x0;var _0x272d35=_0x0fc8[_0x36669a];return _0x272d35;};'use strict';var moment=require(_0x80fc('0x0'));var Sequelize=require(_0x80fc('0x1'));module[_0x80fc('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x80fc('0x3')]},'leaveAt':{'type':Sequelize[_0x80fc('0x3')]},'acceptAt':{'type':Sequelize[_0x80fc('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf60b=['moment','sequelize','exports','STRING','DATE'];(function(_0x315ff7,_0x418160){var _0x23fba2=function(_0xbc13ea){while(--_0xbc13ea){_0x315ff7['push'](_0x315ff7['shift']());}};_0x23fba2(++_0x418160);}(_0xf60b,0x190));var _0xbf60=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0xf60b[_0x5465e6];return _0x10044e;};'use strict';var moment=require(_0xbf60('0x0'));var Sequelize=require(_0xbf60('0x1'));module[_0xbf60('0x2')]={'uniqueid':{'type':Sequelize[_0xbf60('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xbf60('0x3')]},'joinAt':{'type':Sequelize[_0xbf60('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbf60('0x4')]},'exitAt':{'type':Sequelize[_0xbf60('0x4')]},'reason':{'type':Sequelize[_0xbf60('0x3')]}};
\ No newline at end of file
index 82ca564..e37b900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailQueueReport','includeAll','rows','catch','show'];(function(_0x2ed51e,_0x20d606){var _0x44318c=function(_0x1df2bd){while(--_0x1df2bd){_0x2ed51e['push'](_0x2ed51e['shift']());}};_0x44318c(++_0x20d606);}(_0x0295,0x1f0));var _0x5029=function(_0xe13e13,_0x402131){_0xe13e13=_0xe13e13-0x0;var _0x3b3d61=_0x0295[_0xe13e13];return _0x3b3d61;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['MailQueueReport'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['MailQueueReport'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));};
\ No newline at end of file
+var _0x68b3=['path','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x29a370,_0x42ebc9){var _0x403b8d=function(_0x27624d){while(--_0x27624d){_0x29a370['push'](_0x29a370['shift']());}};_0x403b8d(++_0x42ebc9);}(_0x68b3,0x1d8));var _0x368b=function(_0x4665bd,_0x3499f9){_0x4665bd=_0x4665bd-0x0;var _0x1cc4a2=_0x68b3[_0x4665bd];return _0x1cc4a2;};'use strict';var emlformat=require(_0x368b('0x0'));var rimraf=require(_0x368b('0x1'));var zipdir=require(_0x368b('0x2'));var jsonpatch=require(_0x368b('0x3'));var rp=require(_0x368b('0x4'));var moment=require('moment');var BPromise=require(_0x368b('0x5'));var Mustache=require(_0x368b('0x6'));var util=require(_0x368b('0x7'));var path=require(_0x368b('0x8'));var sox=require('sox');var csv=require(_0x368b('0x9'));var ejs=require(_0x368b('0xa'));var fs=require('fs');var fs_extra=require(_0x368b('0xb'));var _=require(_0x368b('0xc'));var squel=require(_0x368b('0xd'));var crypto=require(_0x368b('0xe'));var jsforce=require(_0x368b('0xf'));var deskjs=require(_0x368b('0x10'));var toCsv=require(_0x368b('0x9'));var querystring=require(_0x368b('0x11'));var Papa=require(_0x368b('0x12'));var Redis=require('ioredis');var authService=require(_0x368b('0x13'));var qs=require(_0x368b('0x14'));var as=require(_0x368b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x368b('0x16'))(_0x368b('0x17'));var utils=require(_0x368b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x368b('0x19'));var db=require(_0x368b('0x1a'))['db'];function respondWithStatusCode(_0x514dc7,_0x109a90){_0x109a90=_0x109a90||0xcc;return function(_0x250697){if(_0x250697){return _0x514dc7[_0x368b('0x1b')](_0x109a90);}return _0x514dc7[_0x368b('0x1c')](_0x109a90)[_0x368b('0x1d')]();};}function respondWithResult(_0x4fffe5,_0x2b326c){_0x2b326c=_0x2b326c||0xc8;return function(_0x40faa0){if(_0x40faa0){return _0x4fffe5['status'](_0x2b326c)[_0x368b('0x1e')](_0x40faa0);}};}function respondWithFilteredResult(_0x2aabb9,_0x30c245){return function(_0x515350){if(_0x515350){var _0x220cd5=typeof _0x30c245[_0x368b('0x1f')]===_0x368b('0x20')&&typeof _0x30c245['limit']===_0x368b('0x20');var _0x1b9e65=_0x515350[_0x368b('0x21')];var _0x540f57=_0x220cd5?0x0:_0x30c245['offset'];var _0x3e2e9f=_0x220cd5?_0x515350[_0x368b('0x21')]:_0x30c245[_0x368b('0x1f')]+_0x30c245[_0x368b('0x22')];var _0x1a4f20;if(_0x3e2e9f>=_0x1b9e65){_0x3e2e9f=_0x1b9e65;_0x1a4f20=0xc8;}else{_0x1a4f20=0xce;}_0x2aabb9['status'](_0x1a4f20);return _0x2aabb9[_0x368b('0x23')](_0x368b('0x24'),_0x540f57+'-'+_0x3e2e9f+'/'+_0x1b9e65)[_0x368b('0x1e')](_0x515350);}return null;};}function patchUpdates(_0x1c927f){return function(_0x23da8f){try{jsonpatch[_0x368b('0x25')](_0x23da8f,_0x1c927f,!![]);}catch(_0x397185){return BPromise[_0x368b('0x26')](_0x397185);}return _0x23da8f['save']();};}function saveUpdates(_0x13e750,_0x2f08d9){return function(_0x18869a){if(_0x18869a){return _0x18869a[_0x368b('0x27')](_0x13e750)[_0x368b('0x28')](function(_0x4c2fca){return _0x4c2fca;});}return null;};}function removeEntity(_0x286641,_0x1ca429){return function(_0x3a22bd){if(_0x3a22bd){return _0x3a22bd[_0x368b('0x29')]()[_0x368b('0x28')](function(){_0x286641[_0x368b('0x1c')](0xcc)[_0x368b('0x1d')]();});}};}function handleEntityNotFound(_0x11ea2d,_0x3123c1){return function(_0x3f7f89){if(!_0x3f7f89){_0x11ea2d[_0x368b('0x1b')](0x194);}return _0x3f7f89;};}function handleError(_0x344d8a,_0xceec4b){_0xceec4b=_0xceec4b||0x1f4;return function(_0x376e61){logger[_0x368b('0x2a')](_0x376e61[_0x368b('0x2b')]);if(_0x376e61[_0x368b('0x2c')]){delete _0x376e61[_0x368b('0x2c')];}_0x344d8a[_0x368b('0x1c')](_0xceec4b)[_0x368b('0x2d')](_0x376e61);};}exports[_0x368b('0x2e')]=function(_0xc12627,_0x107d2f){var _0x3c80b5={},_0x5db0b4={},_0x4af77a={'count':0x0,'rows':[]};var _0x381324=_[_0x368b('0x2f')](db[_0x368b('0x30')][_0x368b('0x31')],function(_0x5d6ebf){return{'name':_0x5d6ebf[_0x368b('0x32')],'type':_0x5d6ebf[_0x368b('0x33')][_0x368b('0x34')]};});_0x5db0b4[_0x368b('0x35')]=_[_0x368b('0x2f')](_0x381324,'name');_0x5db0b4[_0x368b('0x36')]=_[_0x368b('0x37')](_0xc12627[_0x368b('0x36')]);_0x5db0b4[_0x368b('0x38')]=_['intersection'](_0x5db0b4['model'],_0x5db0b4['query']);_0x3c80b5[_0x368b('0x39')]=_[_0x368b('0x3a')](_0x5db0b4[_0x368b('0x35')],qs[_0x368b('0x3b')](_0xc12627[_0x368b('0x36')]['fields']));_0x3c80b5[_0x368b('0x39')]=_0x3c80b5[_0x368b('0x39')]['length']?_0x3c80b5[_0x368b('0x39')]:_0x5db0b4[_0x368b('0x35')];if(!_0xc12627['query'][_0x368b('0x3c')](_0x368b('0x3d'))){_0x3c80b5['limit']=qs[_0x368b('0x22')](_0xc12627['query']['limit']);_0x3c80b5['offset']=qs[_0x368b('0x1f')](_0xc12627[_0x368b('0x36')][_0x368b('0x1f')]);}_0x3c80b5[_0x368b('0x3e')]=qs[_0x368b('0x3f')](_0xc12627[_0x368b('0x36')][_0x368b('0x3f')]);_0x3c80b5[_0x368b('0x40')]=qs[_0x368b('0x38')](_[_0x368b('0x41')](_0xc12627['query'],_0x5db0b4[_0x368b('0x38')]),_0x381324);if(_0xc12627[_0x368b('0x36')]['filter']){_0x3c80b5[_0x368b('0x40')]=_[_0x368b('0x42')](_0x3c80b5[_0x368b('0x40')],{'$or':_[_0x368b('0x2f')](_0x381324,function(_0x248b2b){if(_0x248b2b['type']!==_0x368b('0x43')){var _0x4287c6={};_0x4287c6[_0x248b2b[_0x368b('0x2c')]]={'$like':'%'+_0xc12627[_0x368b('0x36')]['filter']+'%'};return _0x4287c6;}})});}_0x3c80b5=_['merge']({},_0x3c80b5,_0xc12627[_0x368b('0x44')]);var _0x3d00f9={'where':_0x3c80b5[_0x368b('0x40')]};return db[_0x368b('0x30')][_0x368b('0x21')](_0x3d00f9)[_0x368b('0x28')](function(_0x1d990c){_0x4af77a[_0x368b('0x21')]=_0x1d990c;if(_0xc12627[_0x368b('0x36')][_0x368b('0x45')]){_0x3c80b5['include']=[{'all':!![]}];}return db[_0x368b('0x30')][_0x368b('0x46')](_0x3c80b5);})['then'](function(_0x25e713){_0x4af77a[_0x368b('0x47')]=_0x25e713;return _0x4af77a;})[_0x368b('0x28')](respondWithFilteredResult(_0x107d2f,_0x3c80b5))[_0x368b('0x48')](handleError(_0x107d2f,null));};exports['show']=function(_0x490eb6,_0x151711){var _0x4a0275={'raw':!![],'where':{'id':_0x490eb6[_0x368b('0x49')]['id']}},_0x91bb0b={};_0x91bb0b[_0x368b('0x35')]=_['keys'](db[_0x368b('0x30')][_0x368b('0x31')]);_0x91bb0b[_0x368b('0x36')]=_['keys'](_0x490eb6['query']);_0x91bb0b[_0x368b('0x38')]=_[_0x368b('0x3a')](_0x91bb0b['model'],_0x91bb0b[_0x368b('0x36')]);_0x4a0275[_0x368b('0x39')]=_[_0x368b('0x3a')](_0x91bb0b[_0x368b('0x35')],qs[_0x368b('0x3b')](_0x490eb6[_0x368b('0x36')][_0x368b('0x3b')]));_0x4a0275[_0x368b('0x39')]=_0x4a0275[_0x368b('0x39')][_0x368b('0x4a')]?_0x4a0275[_0x368b('0x39')]:_0x91bb0b[_0x368b('0x35')];if(_0x490eb6[_0x368b('0x36')]['includeAll']){_0x4a0275[_0x368b('0x4b')]=[{'all':!![]}];}_0x4a0275=_[_0x368b('0x42')]({},_0x4a0275,_0x490eb6[_0x368b('0x44')]);return db[_0x368b('0x30')][_0x368b('0x4c')](_0x4a0275)['then'](handleEntityNotFound(_0x151711,null))['then'](respondWithResult(_0x151711,null))[_0x368b('0x48')](handleError(_0x151711,null));};exports[_0x368b('0x4d')]=function(_0x1c8755,_0x5a9d70){return db[_0x368b('0x30')][_0x368b('0x4d')](_0x1c8755[_0x368b('0x4e')],{})[_0x368b('0x28')](respondWithResult(_0x5a9d70,0xc9))[_0x368b('0x48')](handleError(_0x5a9d70,null));};exports[_0x368b('0x27')]=function(_0x8f35b,_0x1174fa){if(_0x8f35b[_0x368b('0x4e')]['id']){delete _0x8f35b[_0x368b('0x4e')]['id'];}return db['MailQueueReport'][_0x368b('0x4c')]({'where':{'id':_0x8f35b['params']['id']}})[_0x368b('0x28')](handleEntityNotFound(_0x1174fa,null))['then'](saveUpdates(_0x8f35b[_0x368b('0x4e')],null))['then'](respondWithResult(_0x1174fa,null))[_0x368b('0x48')](handleError(_0x1174fa,null));};exports[_0x368b('0x29')]=function(_0x3b8a12,_0x458d9a){return db['MailQueueReport'][_0x368b('0x4c')]({'where':{'id':_0x3b8a12[_0x368b('0x49')]['id']}})[_0x368b('0x28')](handleEntityNotFound(_0x458d9a,null))[_0x368b('0x28')](removeEntity(_0x458d9a,null))[_0x368b('0x48')](handleError(_0x458d9a,null));};exports[_0x368b('0x4f')]=function(_0x3898a8,_0x15078b){return db[_0x368b('0x30')]['describe']()[_0x368b('0x28')](respondWithResult(_0x15078b,null))[_0x368b('0x48')](handleError(_0x15078b,null));};
\ No newline at end of file
index cd26d74..61ce7da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dc9=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailQueueReport.attributes','exports','report_mail_queue'];(function(_0x5919d7,_0x11f019){var _0x58efed=function(_0x18e8ed){while(--_0x18e8ed){_0x5919d7['push'](_0x5919d7['shift']());}};_0x58efed(++_0x11f019);}(_0x9dc9,0x121));var _0x99dc=function(_0x479a14,_0x5b2980){_0x479a14=_0x479a14-0x0;var _0x3f22fd=_0x9dc9[_0x479a14];return _0x3f22fd;};'use strict';var _=require(_0x99dc('0x0'));var util=require(_0x99dc('0x1'));var logger=require(_0x99dc('0x2'))(_0x99dc('0x3'));var moment=require(_0x99dc('0x4'));var BPromise=require(_0x99dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x99dc('0x6'));var config=require(_0x99dc('0x7'));var attributes=require(_0x99dc('0x8'));module[_0x99dc('0x9')]=function(_0x13dc99,_0x136b58){return _0x13dc99['define']('MailQueueReport',attributes,{'tableName':_0x99dc('0xa'),'paranoid':![],'indexes':[{'name':_0x99dc('0xb'),'fields':[_0x99dc('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe546=['../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe546,0x6e));var _0x6e54=function(_0x58ccd3,_0x2f741a){_0x58ccd3=_0x58ccd3-0x0;var _0x1f91b3=_0xe546[_0x58ccd3];return _0x1f91b3;};'use strict';var _=require(_0x6e54('0x0'));var util=require('util');var logger=require(_0x6e54('0x1'))(_0x6e54('0x2'));var moment=require(_0x6e54('0x3'));var BPromise=require(_0x6e54('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e54('0x5'));var rimraf=require(_0x6e54('0x6'));var config=require(_0x6e54('0x7'));var attributes=require(_0x6e54('0x8'));module[_0x6e54('0x9')]=function(_0x5e69be,_0x41f411){return _0x5e69be[_0x6e54('0xa')]('MailQueueReport',attributes,{'tableName':_0x6e54('0xb'),'paranoid':![],'indexes':[{'name':_0x6e54('0xc'),'fields':[_0x6e54('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 8a234e9..ca74928 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0xe90d8a,_0x46a605){var _0x2e9c75=function(_0x5b75a7){while(--_0x5b75a7){_0xe90d8a['push'](_0xe90d8a['shift']());}};_0x2e9c75(++_0x46a605);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'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')]('MailQueueReport,\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);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});};
\ No newline at end of file
+var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x5a0642,_0x5a0ae1){var _0x29c0f0=function(_0x3a6884){while(--_0x3a6884){_0x5a0642['push'](_0x5a0642['shift']());}};_0x29c0f0(++_0x5a0ae1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'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')]('MailQueueReport,\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);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});};
\ No newline at end of file
index 2c12176..c2f1651 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(_0x11bc1b,_0x5dd8f8){var _0x27d89c=function(_0x165ef2){while(--_0x165ef2){_0x11bc1b['push'](_0x11bc1b['shift']());}};_0x27d89c(++_0x5dd8f8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0xcb91[_0x404957];return _0x4e0365;};'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(_0x30be97,_0x3ea719){var _0x1d3a90=function(_0x512e8a){while(--_0x512e8a){_0x30be97['push'](_0x30be97['shift']());}};_0x1d3a90(++_0x3ea719);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'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 b2d1d31..f4ae209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236c=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x35612b,_0x1aa6f0){var _0x1393f3=function(_0x99c903){while(--_0x99c903){_0x35612b['push'](_0x35612b['shift']());}};_0x1393f3(++_0x1aa6f0);}(_0x236c,0x176));var _0xc236=function(_0x4e3608,_0x17b4df){_0x4e3608=_0x4e3608-0x0;var _0x13c7e2=_0x236c[_0x4e3608];return _0x13c7e2;};'use strict';var Sequelize=require(_0xc236('0x0'));module[_0xc236('0x1')]={'description':{'type':Sequelize[_0xc236('0x2')]},'host':{'type':Sequelize[_0xc236('0x2')]},'authentication':{'type':Sequelize[_0xc236('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc236('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xc236('0x4')]},'tls':{'type':Sequelize[_0xc236('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xc236('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc236('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc236('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x09da=['INBOX','INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x32610f,_0x3bdce7){var _0x2a707f=function(_0x1a0332){while(--_0x1a0332){_0x32610f['push'](_0x32610f['shift']());}};_0x2a707f(++_0x3bdce7);}(_0x09da,0x19a));var _0xa09d=function(_0x2f0d92,_0xc0bbbb){_0x2f0d92=_0x2f0d92-0x0;var _0x261527=_0x09da[_0x2f0d92];return _0x261527;};'use strict';var Sequelize=require(_0xa09d('0x0'));module[_0xa09d('0x1')]={'description':{'type':Sequelize[_0xa09d('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xa09d('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa09d('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa09d('0x2')],'defaultValue':_0xa09d('0x4')},'connTimeout':{'type':Sequelize[_0xa09d('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xa09d('0x2')]},'modernAuthentication':{'type':Sequelize[_0xa09d('0x3')],'defaultValue':![]}};
\ No newline at end of file
index cd94af5..527b811 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf2e=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash'];(function(_0x2309fc,_0x54e227){var _0x186ee8=function(_0x5a6db7){while(--_0x5a6db7){_0x2309fc['push'](_0x2309fc['shift']());}};_0x186ee8(++_0x54e227);}(_0xcf2e,0xc5));var _0xecf2=function(_0x22d68a,_0x3f6978){_0x22d68a=_0x22d68a-0x0;var _0x131c53=_0xcf2e[_0x22d68a];return _0x131c53;};'use strict';var _=require(_0xecf2('0x0'));var util=require(_0xecf2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xecf2('0x2'));var BPromise=require(_0xecf2('0x3'));var rp=require(_0xecf2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecf2('0x5'));var config=require(_0xecf2('0x6'));var attributes=require(_0xecf2('0x7'));module[_0xecf2('0x8')]=function(_0x42ae96,_0x3959c6){return _0x42ae96[_0xecf2('0x9')]('MailServerIn',attributes,{'tableName':_0xecf2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c71=['path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x485352,_0x269f0b){var _0x331cac=function(_0x211897){while(--_0x211897){_0x485352['push'](_0x485352['shift']());}};_0x331cac(++_0x269f0b);}(_0x2c71,0x134));var _0x12c7=function(_0x2b5777,_0x4cc039){_0x2b5777=_0x2b5777-0x0;var _0x5385fd=_0x2c71[_0x2b5777];return _0x5385fd;};'use strict';var _=require(_0x12c7('0x0'));var util=require(_0x12c7('0x1'));var logger=require(_0x12c7('0x2'))(_0x12c7('0x3'));var moment=require(_0x12c7('0x4'));var BPromise=require(_0x12c7('0x5'));var rp=require(_0x12c7('0x6'));var fs=require('fs');var path=require(_0x12c7('0x7'));var rimraf=require(_0x12c7('0x8'));var config=require(_0x12c7('0x9'));var attributes=require(_0x12c7('0xa'));module[_0x12c7('0xb')]=function(_0x31572e,_0x579e4b){return _0x31572e[_0x12c7('0xc')](_0x12c7('0xd'),attributes,{'tableName':_0x12c7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4e9c08e..04b6b3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x552a=['debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','info','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x552a,0xaf));var _0xa552=function(_0x878830,_0x3c7bf3){_0x878830=_0x878830-0x0;var _0xa5edbb=_0x552a[_0x878830];return _0xa5edbb;};'use strict';var _=require('lodash');var util=require(_0xa552('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa552('0x1'));var fs=require('fs');var Redis=require(_0xa552('0x2'));var db=require(_0xa552('0x3'))['db'];var utils=require(_0xa552('0x4'));var logger=require('../../config/logger')(_0xa552('0x5'));var config=require('../../config/environment');var jayson=require(_0xa552('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a55bb,_0x341054,_0x42ae3e){return new BPromise(function(_0x26cacf,_0x400561){return client[_0xa552('0x7')](_0x5a55bb,_0x42ae3e)[_0xa552('0x8')](function(_0x47546d){logger['info'](_0xa552('0x9'),_0x341054,_0xa552('0xa'));logger[_0xa552('0xb')](_0xa552('0xc'),_0x341054,_0xa552('0xa'),JSON[_0xa552('0xd')](_0x47546d));if(_0x47546d[_0xa552('0xe')]){if(_0x47546d[_0xa552('0xe')][_0xa552('0xf')]===0x1f4){logger[_0xa552('0xe')]('MailServerIn,\x20%s,\x20%s',_0x341054,_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);return _0x400561(_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);}logger[_0xa552('0xe')]('MailServerIn,\x20%s,\x20%s',_0x341054,_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);return _0x26cacf(_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);}else{logger['info'](_0xa552('0x9'),_0x341054,_0xa552('0xa'));_0x26cacf(_0x47546d[_0xa552('0x11')][_0xa552('0x10')]);}})['catch'](function(_0x169be4){logger[_0xa552('0xe')](_0xa552('0x9'),_0x341054,_0x169be4);_0x400561(_0x169be4);});});}exports[_0xa552('0x12')]=function(_0x5780ad){var _0x2db3df=this;return new Promise(function(_0x1cdb04,_0x3616f9){return db[_0xa552('0x13')][_0xa552('0x14')]({'raw':_0x5780ad[_0xa552('0x15')]?_0x5780ad['options'][_0xa552('0x16')]===undefined?!![]:![]:!![],'where':_0x5780ad['options']?_0x5780ad[_0xa552('0x15')][_0xa552('0x17')]||null:null,'attributes':_0x5780ad[_0xa552('0x15')]?_0x5780ad['options'][_0xa552('0x18')]||null:null,'limit':_0x5780ad[_0xa552('0x15')]?_0x5780ad[_0xa552('0x15')][_0xa552('0x19')]||null:null,'include':_0x5780ad[_0xa552('0x15')]?_0x5780ad[_0xa552('0x15')][_0xa552('0x1a')]?_['map'](_0x5780ad[_0xa552('0x15')][_0xa552('0x1a')],function(_0x575a62){return{'model':db[_0x575a62[_0xa552('0x1b')]],'as':_0x575a62['as'],'attributes':_0x575a62['attributes'],'include':_0x575a62[_0xa552('0x1a')]?_[_0xa552('0x1c')](_0x575a62[_0xa552('0x1a')],function(_0xf4d071){return{'model':db[_0xf4d071[_0xa552('0x1b')]],'as':_0xf4d071['as'],'attributes':_0xf4d071['attributes'],'include':_0xf4d071[_0xa552('0x1a')]?_['map'](_0xf4d071['include'],function(_0x36a048){return{'model':db[_0x36a048['model']],'as':_0x36a048['as'],'attributes':_0x36a048[_0xa552('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa552('0x8')](function(_0x5e20e2){logger[_0xa552('0x1d')](_0xa552('0x12'),_0x5780ad);logger[_0xa552('0xb')](_0xa552('0x12'),_0x5780ad,JSON[_0xa552('0xd')](_0x5e20e2));_0x1cdb04(_0x5e20e2);})[_0xa552('0x1e')](function(_0xd1afcf){logger[_0xa552('0xe')]('GetMailServerIn',_0xd1afcf[_0xa552('0x10')],_0x5780ad);_0x3616f9(_0x2db3df[_0xa552('0xe')](0x1f4,_0xd1afcf[_0xa552('0x10')]));});});};
\ No newline at end of file
+var _0xf531=['MailServerIn','findAll','options','raw','where','attributes','include','model','map','lodash','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','MailServerIn,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetMailServerIn'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf531,0x7d));var _0x1f53=function(_0x1428d3,_0x925d43){_0x1428d3=_0x1428d3-0x0;var _0x103810=_0xf531[_0x1428d3];return _0x103810;};'use strict';var _=require(_0x1f53('0x0'));var util=require('util');var moment=require(_0x1f53('0x1'));var BPromise=require(_0x1f53('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1f53('0x3'))(_0x1f53('0x4'));var config=require(_0x1f53('0x5'));var jayson=require(_0x1f53('0x6'));var client=jayson[_0x1f53('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36eaff,_0x381c13,_0xb7fe22){return new BPromise(function(_0x4a6deb,_0x275b4a){return client['request'](_0x36eaff,_0xb7fe22)[_0x1f53('0x8')](function(_0x1a3ee7){logger[_0x1f53('0x9')](_0x1f53('0xa'),_0x381c13,'request\x20sent');logger[_0x1f53('0xb')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x381c13,'request\x20sent',JSON[_0x1f53('0xc')](_0x1a3ee7));if(_0x1a3ee7[_0x1f53('0xd')]){if(_0x1a3ee7['error'][_0x1f53('0xe')]===0x1f4){logger[_0x1f53('0xd')](_0x1f53('0xa'),_0x381c13,_0x1a3ee7['error']['message']);return _0x275b4a(_0x1a3ee7[_0x1f53('0xd')][_0x1f53('0xf')]);}logger[_0x1f53('0xd')](_0x1f53('0xa'),_0x381c13,_0x1a3ee7[_0x1f53('0xd')][_0x1f53('0xf')]);return _0x4a6deb(_0x1a3ee7[_0x1f53('0xd')]['message']);}else{logger[_0x1f53('0x9')](_0x1f53('0xa'),_0x381c13,_0x1f53('0x10'));_0x4a6deb(_0x1a3ee7[_0x1f53('0x11')][_0x1f53('0xf')]);}})[_0x1f53('0x12')](function(_0x575d95){logger[_0x1f53('0xd')](_0x1f53('0xa'),_0x381c13,_0x575d95);_0x275b4a(_0x575d95);});});}exports[_0x1f53('0x13')]=function(_0x170d2a){var _0x27d42c=this;return new Promise(function(_0x495e2a,_0x119efb){return db[_0x1f53('0x14')][_0x1f53('0x15')]({'raw':_0x170d2a[_0x1f53('0x16')]?_0x170d2a['options'][_0x1f53('0x17')]===undefined?!![]:![]:!![],'where':_0x170d2a[_0x1f53('0x16')]?_0x170d2a[_0x1f53('0x16')][_0x1f53('0x18')]||null:null,'attributes':_0x170d2a['options']?_0x170d2a[_0x1f53('0x16')][_0x1f53('0x19')]||null:null,'limit':_0x170d2a[_0x1f53('0x16')]?_0x170d2a[_0x1f53('0x16')]['limit']||null:null,'include':_0x170d2a['options']?_0x170d2a['options'][_0x1f53('0x1a')]?_['map'](_0x170d2a['options'][_0x1f53('0x1a')],function(_0x4dcfa0){return{'model':db[_0x4dcfa0[_0x1f53('0x1b')]],'as':_0x4dcfa0['as'],'attributes':_0x4dcfa0[_0x1f53('0x19')],'include':_0x4dcfa0[_0x1f53('0x1a')]?_['map'](_0x4dcfa0[_0x1f53('0x1a')],function(_0x5d16c7){return{'model':db[_0x5d16c7[_0x1f53('0x1b')]],'as':_0x5d16c7['as'],'attributes':_0x5d16c7[_0x1f53('0x19')],'include':_0x5d16c7[_0x1f53('0x1a')]?_[_0x1f53('0x1c')](_0x5d16c7[_0x1f53('0x1a')],function(_0x475aed){return{'model':db[_0x475aed[_0x1f53('0x1b')]],'as':_0x475aed['as'],'attributes':_0x475aed['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f53('0x8')](function(_0x37d3c5){logger[_0x1f53('0x9')](_0x1f53('0x13'),_0x170d2a);logger[_0x1f53('0xb')](_0x1f53('0x13'),_0x170d2a,JSON[_0x1f53('0xc')](_0x37d3c5));_0x495e2a(_0x37d3c5);})[_0x1f53('0x12')](function(_0x4c7c86){logger[_0x1f53('0xd')](_0x1f53('0x13'),_0x4c7c86[_0x1f53('0xf')],_0x170d2a);_0x119efb(_0x27d42c[_0x1f53('0xd')](0x1f4,_0x4c7c86[_0x1f53('0xf')]));});});};
\ No newline at end of file
index 53e6078..cc1aa57 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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x2c000f,_0x50a168){_0x2c000f=_0x2c000f-0x0;var _0x347ad8=_0x7a54[_0x2c000f];return _0x347ad8;};'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(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 7abccf0..40b550b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb4=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x482c8e,_0x31410b){var _0x59ec07=function(_0x199c95){while(--_0x199c95){_0x482c8e['push'](_0x482c8e['shift']());}};_0x59ec07(++_0x31410b);}(_0x6cb4,0xff));var _0x46cb=function(_0x3c8cf5,_0x1b578d){_0x3c8cf5=_0x3c8cf5-0x0;var _0x21cbb0=_0x6cb4[_0x3c8cf5];return _0x21cbb0;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'description':{'type':Sequelize[_0x46cb('0x2')]},'host':{'type':Sequelize[_0x46cb('0x2')]},'user':{'type':Sequelize[_0x46cb('0x2')]},'pass':{'type':Sequelize[_0x46cb('0x2')]},'port':{'type':Sequelize[_0x46cb('0x3')]},'secure':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x46cb('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc900=['INTEGER','BOOLEAN','STRING'];(function(_0x59d71c,_0x4ddd90){var _0x383ba9=function(_0xe5c93d){while(--_0xe5c93d){_0x59d71c['push'](_0x59d71c['shift']());}};_0x383ba9(++_0x4ddd90);}(_0xc900,0xb3));var _0x0c90=function(_0x75648a,_0x30d039){_0x75648a=_0x75648a-0x0;var _0x181d4b=_0xc900[_0x75648a];return _0x181d4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x0c90('0x0')]},'host':{'type':Sequelize[_0x0c90('0x0')]},'user':{'type':Sequelize[_0x0c90('0x0')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0c90('0x1')]},'secure':{'type':Sequelize[_0x0c90('0x2')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0c90('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x0c90('0x2')],'defaultValue':![]}};
\ No newline at end of file
index b6a918e..0b244ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69b=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','catch','body','find','rimraf','zip-dir','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x51ab05,_0xf830){var _0x3dd4c8=function(_0x3f8443){while(--_0x3f8443){_0x51ab05['push'](_0x51ab05['shift']());}};_0x3dd4c8(++_0xf830);}(_0xf69b,0xad));var _0xbf69=function(_0xfd21e2,_0x4578a5){_0xfd21e2=_0xfd21e2-0x0;var _0x495674=_0xf69b[_0xfd21e2];return _0x495674;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf69('0x0'));var zipdir=require(_0xbf69('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf69('0x2'));var moment=require('moment');var BPromise=require(_0xbf69('0x3'));var Mustache=require(_0xbf69('0x4'));var util=require(_0xbf69('0x5'));var path=require(_0xbf69('0x6'));var sox=require(_0xbf69('0x7'));var csv=require(_0xbf69('0x8'));var ejs=require(_0xbf69('0x9'));var fs=require('fs');var fs_extra=require(_0xbf69('0xa'));var _=require(_0xbf69('0xb'));var squel=require(_0xbf69('0xc'));var crypto=require(_0xbf69('0xd'));var jsforce=require(_0xbf69('0xe'));var deskjs=require(_0xbf69('0xf'));var toCsv=require(_0xbf69('0x8'));var querystring=require('querystring');var Papa=require(_0xbf69('0x10'));var Redis=require(_0xbf69('0x11'));var authService=require(_0xbf69('0x12'));var qs=require(_0xbf69('0x13'));var as=require(_0xbf69('0x14'));var hardwareService=require(_0xbf69('0x15'));var logger=require('../../config/logger')(_0xbf69('0x16'));var utils=require(_0xbf69('0x17'));var config=require(_0xbf69('0x18'));var licenseUtil=require(_0xbf69('0x19'));var db=require(_0xbf69('0x1a'))['db'];function respondWithStatusCode(_0x1e90f1,_0x449fe8){_0x449fe8=_0x449fe8||0xcc;return function(_0x39f300){if(_0x39f300){return _0x1e90f1[_0xbf69('0x1b')](_0x449fe8);}return _0x1e90f1[_0xbf69('0x1c')](_0x449fe8)[_0xbf69('0x1d')]();};}function respondWithResult(_0x4ada0e,_0x42bcc1){_0x42bcc1=_0x42bcc1||0xc8;return function(_0x1d76ca){if(_0x1d76ca){return _0x4ada0e[_0xbf69('0x1c')](_0x42bcc1)[_0xbf69('0x1e')](_0x1d76ca);}};}function respondWithFilteredResult(_0x23cdce,_0x4edfb2){return function(_0x35fb50){if(_0x35fb50){var _0xb76abd=typeof _0x4edfb2['offset']===_0xbf69('0x1f')&&typeof _0x4edfb2[_0xbf69('0x20')]===_0xbf69('0x1f');var _0x508834=_0x35fb50[_0xbf69('0x21')];var _0x5f03a8=_0xb76abd?0x0:_0x4edfb2[_0xbf69('0x22')];var _0x1025f0=_0xb76abd?_0x35fb50[_0xbf69('0x21')]:_0x4edfb2[_0xbf69('0x22')]+_0x4edfb2[_0xbf69('0x20')];var _0x53ed99;if(_0x1025f0>=_0x508834){_0x1025f0=_0x508834;_0x53ed99=0xc8;}else{_0x53ed99=0xce;}_0x23cdce['status'](_0x53ed99);return _0x23cdce['set'](_0xbf69('0x23'),_0x5f03a8+'-'+_0x1025f0+'/'+_0x508834)[_0xbf69('0x1e')](_0x35fb50);}return null;};}function patchUpdates(_0xfb1701){return function(_0x2dd4ed){try{jsonpatch[_0xbf69('0x24')](_0x2dd4ed,_0xfb1701,!![]);}catch(_0x2d4024){return BPromise[_0xbf69('0x25')](_0x2d4024);}return _0x2dd4ed[_0xbf69('0x26')]();};}function saveUpdates(_0x226916,_0x136eee){return function(_0x111134){if(_0x111134){return _0x111134[_0xbf69('0x27')](_0x226916)[_0xbf69('0x28')](function(_0x1666a3){return _0x1666a3;});}return null;};}function removeEntity(_0x425331,_0x27c728){return function(_0x5c8386){if(_0x5c8386){return _0x5c8386[_0xbf69('0x29')]()[_0xbf69('0x28')](function(){_0x425331['status'](0xcc)[_0xbf69('0x1d')]();});}};}function handleEntityNotFound(_0x35754d,_0x59354a){return function(_0x1a805a){if(!_0x1a805a){_0x35754d[_0xbf69('0x1b')](0x194);}return _0x1a805a;};}function handleError(_0x9a684e,_0x37f143){_0x37f143=_0x37f143||0x1f4;return function(_0x57a069){logger[_0xbf69('0x2a')](_0x57a069[_0xbf69('0x2b')]);if(_0x57a069[_0xbf69('0x2c')]){delete _0x57a069[_0xbf69('0x2c')];}_0x9a684e['status'](_0x37f143)[_0xbf69('0x2d')](_0x57a069);};}exports[_0xbf69('0x2e')]=function(_0x4b24e1,_0x4ed73b){var _0x3edc63={},_0x51cf6a={},_0x40dfea={'count':0x0,'rows':[]};var _0x4a9821=_[_0xbf69('0x2f')](db[_0xbf69('0x30')][_0xbf69('0x31')],function(_0x20e5e7){return{'name':_0x20e5e7['fieldName'],'type':_0x20e5e7[_0xbf69('0x32')][_0xbf69('0x33')]};});_0x51cf6a['model']=_[_0xbf69('0x2f')](_0x4a9821,_0xbf69('0x2c'));_0x51cf6a[_0xbf69('0x34')]=_[_0xbf69('0x35')](_0x4b24e1[_0xbf69('0x34')]);_0x51cf6a[_0xbf69('0x36')]=_[_0xbf69('0x37')](_0x51cf6a[_0xbf69('0x38')],_0x51cf6a[_0xbf69('0x34')]);_0x3edc63[_0xbf69('0x39')]=_[_0xbf69('0x37')](_0x51cf6a[_0xbf69('0x38')],qs[_0xbf69('0x3a')](_0x4b24e1[_0xbf69('0x34')][_0xbf69('0x3a')]));_0x3edc63['attributes']=_0x3edc63[_0xbf69('0x39')][_0xbf69('0x3b')]?_0x3edc63[_0xbf69('0x39')]:_0x51cf6a[_0xbf69('0x38')];if(!_0x4b24e1['query'][_0xbf69('0x3c')](_0xbf69('0x3d'))){_0x3edc63[_0xbf69('0x20')]=qs['limit'](_0x4b24e1[_0xbf69('0x34')][_0xbf69('0x20')]);_0x3edc63[_0xbf69('0x22')]=qs['offset'](_0x4b24e1[_0xbf69('0x34')]['offset']);}_0x3edc63[_0xbf69('0x3e')]=qs[_0xbf69('0x3f')](_0x4b24e1[_0xbf69('0x34')][_0xbf69('0x3f')]);_0x3edc63[_0xbf69('0x40')]=qs['filters'](_[_0xbf69('0x41')](_0x4b24e1['query'],_0x51cf6a[_0xbf69('0x36')]),_0x4a9821);if(_0x4b24e1[_0xbf69('0x34')][_0xbf69('0x42')]){_0x3edc63['where']=_['merge'](_0x3edc63[_0xbf69('0x40')],{'$or':_[_0xbf69('0x2f')](_0x4a9821,function(_0x3b0942){if(_0x3b0942[_0xbf69('0x32')]!==_0xbf69('0x43')){var _0x226ad8={};_0x226ad8[_0x3b0942[_0xbf69('0x2c')]]={'$like':'%'+_0x4b24e1[_0xbf69('0x34')][_0xbf69('0x42')]+'%'};return _0x226ad8;}})});}_0x3edc63=_[_0xbf69('0x44')]({},_0x3edc63,_0x4b24e1[_0xbf69('0x45')]);var _0x659b89={'where':_0x3edc63[_0xbf69('0x40')]};return db[_0xbf69('0x30')][_0xbf69('0x21')](_0x659b89)[_0xbf69('0x28')](function(_0x2c7bdd){_0x40dfea[_0xbf69('0x21')]=_0x2c7bdd;if(_0x4b24e1['query'][_0xbf69('0x46')]){_0x3edc63['include']=[{'all':!![]}];}return db[_0xbf69('0x30')][_0xbf69('0x47')](_0x3edc63);})[_0xbf69('0x28')](function(_0x584b17){_0x40dfea[_0xbf69('0x48')]=_0x584b17;return _0x40dfea;})[_0xbf69('0x28')](respondWithFilteredResult(_0x4ed73b,_0x3edc63))['catch'](handleError(_0x4ed73b,null));};exports[_0xbf69('0x49')]=function(_0xc86596,_0x28697d){var _0x278e36={'raw':!![],'where':{'id':_0xc86596[_0xbf69('0x4a')]['id']}},_0x10dd4e={};_0x10dd4e['model']=_[_0xbf69('0x35')](db['MailServerOut']['rawAttributes']);_0x10dd4e[_0xbf69('0x34')]=_[_0xbf69('0x35')](_0xc86596[_0xbf69('0x34')]);_0x10dd4e[_0xbf69('0x36')]=_[_0xbf69('0x37')](_0x10dd4e['model'],_0x10dd4e[_0xbf69('0x34')]);_0x278e36[_0xbf69('0x39')]=_[_0xbf69('0x37')](_0x10dd4e[_0xbf69('0x38')],qs[_0xbf69('0x3a')](_0xc86596[_0xbf69('0x34')]['fields']));_0x278e36[_0xbf69('0x39')]=_0x278e36[_0xbf69('0x39')]['length']?_0x278e36['attributes']:_0x10dd4e[_0xbf69('0x38')];if(_0xc86596[_0xbf69('0x34')][_0xbf69('0x46')]){_0x278e36['include']=[{'all':!![]}];}_0x278e36=_[_0xbf69('0x44')]({},_0x278e36,_0xc86596[_0xbf69('0x45')]);return db[_0xbf69('0x30')]['find'](_0x278e36)[_0xbf69('0x28')](handleEntityNotFound(_0x28697d,null))[_0xbf69('0x28')](respondWithResult(_0x28697d,null))['catch'](handleError(_0x28697d,null));};exports['create']=function(_0x37cff1,_0x52bdd2){return db[_0xbf69('0x30')]['create'](_0x37cff1['body'],{})[_0xbf69('0x28')](respondWithResult(_0x52bdd2,0xc9))[_0xbf69('0x4b')](handleError(_0x52bdd2,null));};exports[_0xbf69('0x27')]=function(_0x543e90,_0x286f0a){if(_0x543e90[_0xbf69('0x4c')]['id']){delete _0x543e90[_0xbf69('0x4c')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x543e90[_0xbf69('0x4a')]['id']}})[_0xbf69('0x28')](handleEntityNotFound(_0x286f0a,null))[_0xbf69('0x28')](saveUpdates(_0x543e90[_0xbf69('0x4c')],null))[_0xbf69('0x28')](respondWithResult(_0x286f0a,null))[_0xbf69('0x4b')](handleError(_0x286f0a,null));};exports[_0xbf69('0x29')]=function(_0x40f84e,_0x14e0f0){return db[_0xbf69('0x30')][_0xbf69('0x4d')]({'where':{'id':_0x40f84e[_0xbf69('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14e0f0,null))[_0xbf69('0x28')](removeEntity(_0x14e0f0,null))['catch'](handleError(_0x14e0f0,null));};
\ No newline at end of file
+var _0x5a98=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','catch','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3b8c09,_0x16d046){var _0x40c768=function(_0x240e2e){while(--_0x240e2e){_0x3b8c09['push'](_0x3b8c09['shift']());}};_0x40c768(++_0x16d046);}(_0x5a98,0x82));var _0x85a9=function(_0x5d2f7e,_0x44acd9){_0x5d2f7e=_0x5d2f7e-0x0;var _0x448f77=_0x5a98[_0x5d2f7e];return _0x448f77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x85a9('0x0'));var zipdir=require(_0x85a9('0x1'));var jsonpatch=require(_0x85a9('0x2'));var rp=require('request-promise');var moment=require(_0x85a9('0x3'));var BPromise=require(_0x85a9('0x4'));var Mustache=require(_0x85a9('0x5'));var util=require(_0x85a9('0x6'));var path=require(_0x85a9('0x7'));var sox=require(_0x85a9('0x8'));var csv=require(_0x85a9('0x9'));var ejs=require(_0x85a9('0xa'));var fs=require('fs');var fs_extra=require(_0x85a9('0xb'));var _=require(_0x85a9('0xc'));var squel=require(_0x85a9('0xd'));var crypto=require(_0x85a9('0xe'));var jsforce=require(_0x85a9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x85a9('0x9'));var querystring=require(_0x85a9('0x10'));var Papa=require(_0x85a9('0x11'));var Redis=require(_0x85a9('0x12'));var authService=require(_0x85a9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x85a9('0x14'));var hardwareService=require(_0x85a9('0x15'));var logger=require(_0x85a9('0x16'))(_0x85a9('0x17'));var utils=require(_0x85a9('0x18'));var config=require(_0x85a9('0x19'));var licenseUtil=require(_0x85a9('0x1a'));var db=require(_0x85a9('0x1b'))['db'];function respondWithStatusCode(_0x273714,_0xdf77dd){_0xdf77dd=_0xdf77dd||0xcc;return function(_0x1dbd9b){if(_0x1dbd9b){return _0x273714[_0x85a9('0x1c')](_0xdf77dd);}return _0x273714[_0x85a9('0x1d')](_0xdf77dd)[_0x85a9('0x1e')]();};}function respondWithResult(_0x5e30ee,_0x32e909){_0x32e909=_0x32e909||0xc8;return function(_0x52349c){if(_0x52349c){return _0x5e30ee[_0x85a9('0x1d')](_0x32e909)[_0x85a9('0x1f')](_0x52349c);}};}function respondWithFilteredResult(_0x45dc10,_0x2e113f){return function(_0x5256eb){if(_0x5256eb){var _0x4d7f62=typeof _0x2e113f[_0x85a9('0x20')]===_0x85a9('0x21')&&typeof _0x2e113f[_0x85a9('0x22')]===_0x85a9('0x21');var _0x2f7937=_0x5256eb['count'];var _0x28c38a=_0x4d7f62?0x0:_0x2e113f[_0x85a9('0x20')];var _0x3c6609=_0x4d7f62?_0x5256eb[_0x85a9('0x23')]:_0x2e113f[_0x85a9('0x20')]+_0x2e113f[_0x85a9('0x22')];var _0x56f56d;if(_0x3c6609>=_0x2f7937){_0x3c6609=_0x2f7937;_0x56f56d=0xc8;}else{_0x56f56d=0xce;}_0x45dc10[_0x85a9('0x1d')](_0x56f56d);return _0x45dc10[_0x85a9('0x24')](_0x85a9('0x25'),_0x28c38a+'-'+_0x3c6609+'/'+_0x2f7937)['json'](_0x5256eb);}return null;};}function patchUpdates(_0x4c2d7c){return function(_0x46f830){try{jsonpatch[_0x85a9('0x26')](_0x46f830,_0x4c2d7c,!![]);}catch(_0x53daf7){return BPromise[_0x85a9('0x27')](_0x53daf7);}return _0x46f830[_0x85a9('0x28')]();};}function saveUpdates(_0x3a4a90,_0x3bd135){return function(_0x4716b3){if(_0x4716b3){return _0x4716b3[_0x85a9('0x29')](_0x3a4a90)[_0x85a9('0x2a')](function(_0x145e98){return _0x145e98;});}return null;};}function removeEntity(_0x4c5ae2,_0x3a2376){return function(_0x3f6d0a){if(_0x3f6d0a){return _0x3f6d0a[_0x85a9('0x2b')]()[_0x85a9('0x2a')](function(){_0x4c5ae2[_0x85a9('0x1d')](0xcc)[_0x85a9('0x1e')]();});}};}function handleEntityNotFound(_0x166641,_0x5cb7ee){return function(_0x1c55df){if(!_0x1c55df){_0x166641[_0x85a9('0x1c')](0x194);}return _0x1c55df;};}function handleError(_0x2d7d5b,_0x58401d){_0x58401d=_0x58401d||0x1f4;return function(_0x3b24dd){logger[_0x85a9('0x2c')](_0x3b24dd[_0x85a9('0x2d')]);if(_0x3b24dd[_0x85a9('0x2e')]){delete _0x3b24dd[_0x85a9('0x2e')];}_0x2d7d5b[_0x85a9('0x1d')](_0x58401d)[_0x85a9('0x2f')](_0x3b24dd);};}exports['index']=function(_0x18f839,_0x44e3bf){var _0x4e667d={},_0x51eb1b={},_0x287123={'count':0x0,'rows':[]};var _0x229157=_[_0x85a9('0x30')](db[_0x85a9('0x31')][_0x85a9('0x32')],function(_0x2093c8){return{'name':_0x2093c8[_0x85a9('0x33')],'type':_0x2093c8[_0x85a9('0x34')][_0x85a9('0x35')]};});_0x51eb1b[_0x85a9('0x36')]=_[_0x85a9('0x30')](_0x229157,_0x85a9('0x2e'));_0x51eb1b[_0x85a9('0x37')]=_[_0x85a9('0x38')](_0x18f839['query']);_0x51eb1b[_0x85a9('0x39')]=_[_0x85a9('0x3a')](_0x51eb1b[_0x85a9('0x36')],_0x51eb1b[_0x85a9('0x37')]);_0x4e667d[_0x85a9('0x3b')]=_[_0x85a9('0x3a')](_0x51eb1b['model'],qs[_0x85a9('0x3c')](_0x18f839[_0x85a9('0x37')][_0x85a9('0x3c')]));_0x4e667d[_0x85a9('0x3b')]=_0x4e667d[_0x85a9('0x3b')][_0x85a9('0x3d')]?_0x4e667d['attributes']:_0x51eb1b['model'];if(!_0x18f839[_0x85a9('0x37')]['hasOwnProperty'](_0x85a9('0x3e'))){_0x4e667d[_0x85a9('0x22')]=qs[_0x85a9('0x22')](_0x18f839[_0x85a9('0x37')][_0x85a9('0x22')]);_0x4e667d[_0x85a9('0x20')]=qs['offset'](_0x18f839[_0x85a9('0x37')][_0x85a9('0x20')]);}_0x4e667d[_0x85a9('0x3f')]=qs['sort'](_0x18f839[_0x85a9('0x37')][_0x85a9('0x40')]);_0x4e667d[_0x85a9('0x41')]=qs[_0x85a9('0x39')](_['pick'](_0x18f839['query'],_0x51eb1b['filters']),_0x229157);if(_0x18f839[_0x85a9('0x37')]['filter']){_0x4e667d['where']=_[_0x85a9('0x42')](_0x4e667d['where'],{'$or':_[_0x85a9('0x30')](_0x229157,function(_0x39cff5){if(_0x39cff5[_0x85a9('0x34')]!==_0x85a9('0x43')){var _0x45a1dc={};_0x45a1dc[_0x39cff5[_0x85a9('0x2e')]]={'$like':'%'+_0x18f839[_0x85a9('0x37')][_0x85a9('0x44')]+'%'};return _0x45a1dc;}})});}_0x4e667d=_[_0x85a9('0x42')]({},_0x4e667d,_0x18f839[_0x85a9('0x45')]);var _0x2f0b60={'where':_0x4e667d['where']};return db['MailServerOut']['count'](_0x2f0b60)[_0x85a9('0x2a')](function(_0x14b24e){_0x287123[_0x85a9('0x23')]=_0x14b24e;if(_0x18f839['query']['includeAll']){_0x4e667d[_0x85a9('0x46')]=[{'all':!![]}];}return db[_0x85a9('0x31')][_0x85a9('0x47')](_0x4e667d);})[_0x85a9('0x2a')](function(_0x2aefac){_0x287123['rows']=_0x2aefac;return _0x287123;})[_0x85a9('0x2a')](respondWithFilteredResult(_0x44e3bf,_0x4e667d))[_0x85a9('0x48')](handleError(_0x44e3bf,null));};exports['show']=function(_0x170e63,_0x27eccf){var _0x49f376={'raw':!![],'where':{'id':_0x170e63[_0x85a9('0x49')]['id']}},_0x104579={};_0x104579['model']=_[_0x85a9('0x38')](db['MailServerOut'][_0x85a9('0x32')]);_0x104579[_0x85a9('0x37')]=_[_0x85a9('0x38')](_0x170e63['query']);_0x104579[_0x85a9('0x39')]=_[_0x85a9('0x3a')](_0x104579[_0x85a9('0x36')],_0x104579[_0x85a9('0x37')]);_0x49f376[_0x85a9('0x3b')]=_['intersection'](_0x104579[_0x85a9('0x36')],qs[_0x85a9('0x3c')](_0x170e63[_0x85a9('0x37')][_0x85a9('0x3c')]));_0x49f376['attributes']=_0x49f376[_0x85a9('0x3b')]['length']?_0x49f376[_0x85a9('0x3b')]:_0x104579[_0x85a9('0x36')];if(_0x170e63['query'][_0x85a9('0x4a')]){_0x49f376[_0x85a9('0x46')]=[{'all':!![]}];}_0x49f376=_['merge']({},_0x49f376,_0x170e63[_0x85a9('0x45')]);return db[_0x85a9('0x31')][_0x85a9('0x4b')](_0x49f376)[_0x85a9('0x2a')](handleEntityNotFound(_0x27eccf,null))[_0x85a9('0x2a')](respondWithResult(_0x27eccf,null))[_0x85a9('0x48')](handleError(_0x27eccf,null));};exports['create']=function(_0x47fbce,_0x4b8c89){return db['MailServerOut'][_0x85a9('0x4c')](_0x47fbce['body'],{})['then'](respondWithResult(_0x4b8c89,0xc9))[_0x85a9('0x48')](handleError(_0x4b8c89,null));};exports['update']=function(_0x130682,_0x501b7a){if(_0x130682[_0x85a9('0x4d')]['id']){delete _0x130682[_0x85a9('0x4d')]['id'];}return db['MailServerOut'][_0x85a9('0x4b')]({'where':{'id':_0x130682[_0x85a9('0x49')]['id']}})[_0x85a9('0x2a')](handleEntityNotFound(_0x501b7a,null))[_0x85a9('0x2a')](saveUpdates(_0x130682[_0x85a9('0x4d')],null))[_0x85a9('0x2a')](respondWithResult(_0x501b7a,null))[_0x85a9('0x48')](handleError(_0x501b7a,null));};exports[_0x85a9('0x2b')]=function(_0xd3c862,_0x4b5168){return db[_0x85a9('0x31')][_0x85a9('0x4b')]({'where':{'id':_0xd3c862[_0x85a9('0x49')]['id']}})[_0x85a9('0x2a')](handleEntityNotFound(_0x4b5168,null))[_0x85a9('0x2a')](removeEntity(_0x4b5168,null))[_0x85a9('0x48')](handleError(_0x4b5168,null));};
\ No newline at end of file
index a4e0e33..5ed525a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e83=['path','rimraf','../../config/environment','./mailServerOut.attributes','MailServerOut','mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3e5516,_0x1b1c6c){var _0x4e0d4b=function(_0x47ccd1){while(--_0x47ccd1){_0x3e5516['push'](_0x3e5516['shift']());}};_0x4e0d4b(++_0x1b1c6c);}(_0x7e83,0xc6));var _0x37e8=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x7e83[_0x162780];return _0x1ea2dc;};'use strict';var _=require('lodash');var util=require(_0x37e8('0x0'));var logger=require(_0x37e8('0x1'))(_0x37e8('0x2'));var moment=require(_0x37e8('0x3'));var BPromise=require(_0x37e8('0x4'));var rp=require(_0x37e8('0x5'));var fs=require('fs');var path=require(_0x37e8('0x6'));var rimraf=require(_0x37e8('0x7'));var config=require(_0x37e8('0x8'));var attributes=require(_0x37e8('0x9'));module['exports']=function(_0x7b20fc,_0x33df4e){return _0x7b20fc['define'](_0x37e8('0xa'),attributes,{'tableName':_0x37e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd41=['api','moment','request-promise','path','rimraf','./mailServerOut.attributes','exports','MailServerOut','util','../../config/logger'];(function(_0x315aea,_0x318a80){var _0x4a4bdb=function(_0x7c049c){while(--_0x7c049c){_0x315aea['push'](_0x315aea['shift']());}};_0x4a4bdb(++_0x318a80);}(_0xcd41,0xa8));var _0x1cd4=function(_0x39111e,_0x5acc1d){_0x39111e=_0x39111e-0x0;var _0x22c496=_0xcd41[_0x39111e];return _0x22c496;};'use strict';var _=require('lodash');var util=require(_0x1cd4('0x0'));var logger=require(_0x1cd4('0x1'))(_0x1cd4('0x2'));var moment=require(_0x1cd4('0x3'));var BPromise=require('bluebird');var rp=require(_0x1cd4('0x4'));var fs=require('fs');var path=require(_0x1cd4('0x5'));var rimraf=require(_0x1cd4('0x6'));var config=require('../../config/environment');var attributes=require(_0x1cd4('0x7'));module[_0x1cd4('0x8')]=function(_0x106b03,_0x2dbbca){return _0x106b03['define'](_0x1cd4('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 79ec245..985ff34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x12a57d,_0x738bd1){var _0x4b26f6=function(_0x3c54b5){while(--_0x3c54b5){_0x12a57d['push'](_0x12a57d['shift']());}};_0x4b26f6(++_0x738bd1);}(_0xadb5,0xad));var _0x5adb=function(_0x23d641,_0x239d17){_0x23d641=_0x23d641-0x0;var _0x4c4afa=_0xadb5[_0x23d641];return _0x4c4afa;};'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']('MailServerOut,\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);});});}
\ No newline at end of file
+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(_0x268390,_0x10406c){var _0x4cce8a=function(_0x32c3e9){while(--_0x32c3e9){_0x268390['push'](_0x268390['shift']());}};_0x4cce8a(++_0x10406c);}(_0x1261,0x144));var _0x1126=function(_0x50a19b,_0x80c4d0){_0x50a19b=_0x50a19b-0x0;var _0x19b42d=_0x1261[_0x50a19b];return _0x19b42d;};'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
index 5d69016..f61e8b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4213=['../../components/interaction/service','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3392e6,_0x2596cc){var _0x5098ee=function(_0x234567){while(--_0x234567){_0x3392e6['push'](_0x3392e6['shift']());}};_0x5098ee(++_0x2596cc);}(_0x4213,0x14e));var _0x3421=function(_0x14e79f,_0x57fee7){_0x14e79f=_0x14e79f-0x0;var _0x1e00a8=_0x4213[_0x14e79f];return _0x1e00a8;};'use strict';var multer=require(_0x3421('0x0'));var util=require('util');var path=require(_0x3421('0x1'));var timeout=require('connect-timeout');var express=require(_0x3421('0x2'));var router=express[_0x3421('0x3')]();var fs_extra=require(_0x3421('0x4'));var auth=require(_0x3421('0x5'));var interaction=require(_0x3421('0x6'));var config=require('../../config/environment');var controller=require(_0x3421('0x7'));router['get']('/',auth[_0x3421('0x8')](),controller[_0x3421('0x9')]);router[_0x3421('0xa')](_0x3421('0xb'),auth[_0x3421('0x8')](),controller[_0x3421('0xc')]);router['get'](_0x3421('0xd'),auth[_0x3421('0x8')](),controller[_0x3421('0xe')]);router[_0x3421('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3421('0x10')](_0x3421('0xd'),auth[_0x3421('0x8')](),controller[_0x3421('0x11')]);router[_0x3421('0x12')](_0x3421('0xd'),auth['isAuthenticated'](),controller[_0x3421('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa162=['/describe','describe','/:id','isAuthenticated','show','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index'];(function(_0x17d848,_0x25fc02){var _0x31b436=function(_0x41004e){while(--_0x41004e){_0x17d848['push'](_0x17d848['shift']());}};_0x31b436(++_0x25fc02);}(_0xa162,0x1ac));var _0x2a16=function(_0x5caf3c,_0x15059e){_0x5caf3c=_0x5caf3c-0x0;var _0x1d2d65=_0xa162[_0x5caf3c];return _0x1d2d65;};'use strict';var multer=require('multer');var util=require(_0x2a16('0x0'));var path=require(_0x2a16('0x1'));var timeout=require(_0x2a16('0x2'));var express=require(_0x2a16('0x3'));var router=express[_0x2a16('0x4')]();var fs_extra=require(_0x2a16('0x5'));var auth=require(_0x2a16('0x6'));var interaction=require(_0x2a16('0x7'));var config=require(_0x2a16('0x8'));var controller=require(_0x2a16('0x9'));router[_0x2a16('0xa')]('/',auth['isAuthenticated'](),controller[_0x2a16('0xb')]);router[_0x2a16('0xa')](_0x2a16('0xc'),auth['isAuthenticated'](),controller[_0x2a16('0xd')]);router[_0x2a16('0xa')](_0x2a16('0xe'),auth[_0x2a16('0xf')](),controller[_0x2a16('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a16('0x11')]);router[_0x2a16('0x12')]('/:id',auth[_0x2a16('0xf')](),controller[_0x2a16('0x13')]);router['delete']('/:id',auth[_0x2a16('0xf')](),controller[_0x2a16('0x14')]);module[_0x2a16('0x15')]=router;
\ No newline at end of file
index a6e1379..c6fdb20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7278=['name','sequelize','exports','STRING'];(function(_0x203b5c,_0x2384f1){var _0x20a057=function(_0x511230){while(--_0x511230){_0x203b5c['push'](_0x203b5c['shift']());}};_0x20a057(++_0x2384f1);}(_0x7278,0x161));var _0x8727=function(_0x5edbd2,_0x1e7c9d){_0x5edbd2=_0x5edbd2-0x0;var _0x991abe=_0x7278[_0x5edbd2];return _0x991abe;};'use strict';var Sequelize=require(_0x8727('0x0'));module[_0x8727('0x1')]={'name':{'type':Sequelize[_0x8727('0x2')],'unique':_0x8727('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8727('0x2')]}};
\ No newline at end of file
+var _0x7fbe=['STRING','name'];(function(_0x3dfacc,_0x272cb8){var _0x2f6d08=function(_0x1b912e){while(--_0x1b912e){_0x3dfacc['push'](_0x3dfacc['shift']());}};_0x2f6d08(++_0x272cb8);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x51fb0c,_0x937d84){_0x51fb0c=_0x51fb0c-0x0;var _0x6b1d12=_0x7fbe[_0x51fb0c];return _0x6b1d12;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'unique':_0xe7fb('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe7fb('0x0')]}};
\ No newline at end of file
index ba77fd0..ea7b5bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78be=['rows','catch','show','include','find','create','update','body','params','describe','eml-format','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','json','apply','save','then','destroy','error','stack','name','send','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','options','includeAll'];(function(_0x2ae5ce,_0x481760){var _0x3ccd3c=function(_0x3b870c){while(--_0x3b870c){_0x2ae5ce['push'](_0x2ae5ce['shift']());}};_0x3ccd3c(++_0x481760);}(_0x78be,0x11a));var _0xe78b=function(_0x28dc68,_0x51a30b){_0x28dc68=_0x28dc68-0x0;var _0x2bb61b=_0x78be[_0x28dc68];return _0x2bb61b;};'use strict';var emlformat=require(_0xe78b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe78b('0x1'));var rp=require(_0xe78b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe78b('0x3'));var util=require(_0xe78b('0x4'));var path=require('path');var sox=require(_0xe78b('0x5'));var csv=require(_0xe78b('0x6'));var ejs=require(_0xe78b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe78b('0x8'));var squel=require(_0xe78b('0x9'));var crypto=require(_0xe78b('0xa'));var jsforce=require(_0xe78b('0xb'));var deskjs=require(_0xe78b('0xc'));var toCsv=require(_0xe78b('0x6'));var querystring=require(_0xe78b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe78b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe78b('0xf'))(_0xe78b('0x10'));var utils=require(_0xe78b('0x11'));var config=require(_0xe78b('0x12'));var licenseUtil=require(_0xe78b('0x13'));var db=require(_0xe78b('0x14'))['db'];function respondWithStatusCode(_0xafa476,_0x5e1cb4){_0x5e1cb4=_0x5e1cb4||0xcc;return function(_0x43d725){if(_0x43d725){return _0xafa476[_0xe78b('0x15')](_0x5e1cb4);}return _0xafa476[_0xe78b('0x16')](_0x5e1cb4)[_0xe78b('0x17')]();};}function respondWithResult(_0x1d43de,_0x3cbdfb){_0x3cbdfb=_0x3cbdfb||0xc8;return function(_0x57e861){if(_0x57e861){return _0x1d43de[_0xe78b('0x16')](_0x3cbdfb)['json'](_0x57e861);}};}function respondWithFilteredResult(_0x3942d0,_0x4a758b){return function(_0x168b72){if(_0x168b72){var _0x51f2fd=typeof _0x4a758b['offset']===_0xe78b('0x18')&&typeof _0x4a758b['limit']===_0xe78b('0x18');var _0x26baf8=_0x168b72['count'];var _0x41d721=_0x51f2fd?0x0:_0x4a758b['offset'];var _0x19b50c=_0x51f2fd?_0x168b72[_0xe78b('0x19')]:_0x4a758b[_0xe78b('0x1a')]+_0x4a758b[_0xe78b('0x1b')];var _0x2e094e;if(_0x19b50c>=_0x26baf8){_0x19b50c=_0x26baf8;_0x2e094e=0xc8;}else{_0x2e094e=0xce;}_0x3942d0[_0xe78b('0x16')](_0x2e094e);return _0x3942d0['set']('Content-Range',_0x41d721+'-'+_0x19b50c+'/'+_0x26baf8)[_0xe78b('0x1c')](_0x168b72);}return null;};}function patchUpdates(_0x2eea23){return function(_0x1e8df6){try{jsonpatch[_0xe78b('0x1d')](_0x1e8df6,_0x2eea23,!![]);}catch(_0x35e77f){return BPromise['reject'](_0x35e77f);}return _0x1e8df6[_0xe78b('0x1e')]();};}function saveUpdates(_0xa920f8,_0x2ba64e){return function(_0x55d7db){if(_0x55d7db){return _0x55d7db['update'](_0xa920f8)[_0xe78b('0x1f')](function(_0x48a73e){return _0x48a73e;});}return null;};}function removeEntity(_0x22c95d,_0x4b996f){return function(_0x2d4acb){if(_0x2d4acb){return _0x2d4acb[_0xe78b('0x20')]()[_0xe78b('0x1f')](function(){_0x22c95d['status'](0xcc)[_0xe78b('0x17')]();});}};}function handleEntityNotFound(_0x1b5578,_0x5e6edf){return function(_0x177578){if(!_0x177578){_0x1b5578[_0xe78b('0x15')](0x194);}return _0x177578;};}function handleError(_0x47f933,_0x2ed90d){_0x2ed90d=_0x2ed90d||0x1f4;return function(_0x124fad){logger[_0xe78b('0x21')](_0x124fad[_0xe78b('0x22')]);if(_0x124fad[_0xe78b('0x23')]){delete _0x124fad[_0xe78b('0x23')];}_0x47f933[_0xe78b('0x16')](_0x2ed90d)[_0xe78b('0x24')](_0x124fad);};}exports['index']=function(_0x4267c3,_0x4e30f1){var _0x165a64={},_0xdfec1b={},_0x589ff9={'count':0x0,'rows':[]};var _0x53b3f2=_[_0xe78b('0x25')](db[_0xe78b('0x26')][_0xe78b('0x27')],function(_0x496c31){return{'name':_0x496c31['fieldName'],'type':_0x496c31[_0xe78b('0x28')][_0xe78b('0x29')]};});_0xdfec1b[_0xe78b('0x2a')]=_[_0xe78b('0x25')](_0x53b3f2,_0xe78b('0x23'));_0xdfec1b[_0xe78b('0x2b')]=_[_0xe78b('0x2c')](_0x4267c3[_0xe78b('0x2b')]);_0xdfec1b[_0xe78b('0x2d')]=_[_0xe78b('0x2e')](_0xdfec1b[_0xe78b('0x2a')],_0xdfec1b[_0xe78b('0x2b')]);_0x165a64['attributes']=_[_0xe78b('0x2e')](_0xdfec1b[_0xe78b('0x2a')],qs[_0xe78b('0x2f')](_0x4267c3[_0xe78b('0x2b')][_0xe78b('0x2f')]));_0x165a64['attributes']=_0x165a64[_0xe78b('0x30')][_0xe78b('0x31')]?_0x165a64['attributes']:_0xdfec1b['model'];if(!_0x4267c3[_0xe78b('0x2b')][_0xe78b('0x32')]('nolimit')){_0x165a64[_0xe78b('0x1b')]=qs[_0xe78b('0x1b')](_0x4267c3[_0xe78b('0x2b')][_0xe78b('0x1b')]);_0x165a64['offset']=qs[_0xe78b('0x1a')](_0x4267c3[_0xe78b('0x2b')][_0xe78b('0x1a')]);}_0x165a64[_0xe78b('0x33')]=qs[_0xe78b('0x34')](_0x4267c3['query']['sort']);_0x165a64[_0xe78b('0x35')]=qs[_0xe78b('0x2d')](_['pick'](_0x4267c3[_0xe78b('0x2b')],_0xdfec1b[_0xe78b('0x2d')]),_0x53b3f2);if(_0x4267c3[_0xe78b('0x2b')]['filter']){_0x165a64['where']=_['merge'](_0x165a64['where'],{'$or':_[_0xe78b('0x25')](_0x53b3f2,function(_0x5df826){if(_0x5df826[_0xe78b('0x28')]!==_0xe78b('0x36')){var _0x3fb3b3={};_0x3fb3b3[_0x5df826[_0xe78b('0x23')]]={'$like':'%'+_0x4267c3['query']['filter']+'%'};return _0x3fb3b3;}})});}_0x165a64=_[_0xe78b('0x37')]({},_0x165a64,_0x4267c3[_0xe78b('0x38')]);var _0x45b609={'where':_0x165a64['where']};return db[_0xe78b('0x26')][_0xe78b('0x19')](_0x45b609)['then'](function(_0x4ac8af){_0x589ff9['count']=_0x4ac8af;if(_0x4267c3[_0xe78b('0x2b')][_0xe78b('0x39')]){_0x165a64['include']=[{'all':!![]}];}return db[_0xe78b('0x26')]['findAll'](_0x165a64);})[_0xe78b('0x1f')](function(_0xcdb46d){_0x589ff9[_0xe78b('0x3a')]=_0xcdb46d;return _0x589ff9;})[_0xe78b('0x1f')](respondWithFilteredResult(_0x4e30f1,_0x165a64))[_0xe78b('0x3b')](handleError(_0x4e30f1,null));};exports[_0xe78b('0x3c')]=function(_0x45a289,_0x4a2edd){var _0x17268b={'raw':!![],'where':{'id':_0x45a289['params']['id']}},_0x4d60f8={};_0x4d60f8['model']=_['keys'](db[_0xe78b('0x26')]['rawAttributes']);_0x4d60f8[_0xe78b('0x2b')]=_['keys'](_0x45a289['query']);_0x4d60f8[_0xe78b('0x2d')]=_[_0xe78b('0x2e')](_0x4d60f8[_0xe78b('0x2a')],_0x4d60f8['query']);_0x17268b[_0xe78b('0x30')]=_['intersection'](_0x4d60f8[_0xe78b('0x2a')],qs[_0xe78b('0x2f')](_0x45a289[_0xe78b('0x2b')][_0xe78b('0x2f')]));_0x17268b['attributes']=_0x17268b[_0xe78b('0x30')][_0xe78b('0x31')]?_0x17268b[_0xe78b('0x30')]:_0x4d60f8['model'];if(_0x45a289[_0xe78b('0x2b')][_0xe78b('0x39')]){_0x17268b[_0xe78b('0x3d')]=[{'all':!![]}];}_0x17268b=_[_0xe78b('0x37')]({},_0x17268b,_0x45a289['options']);return db[_0xe78b('0x26')][_0xe78b('0x3e')](_0x17268b)[_0xe78b('0x1f')](handleEntityNotFound(_0x4a2edd,null))[_0xe78b('0x1f')](respondWithResult(_0x4a2edd,null))[_0xe78b('0x3b')](handleError(_0x4a2edd,null));};exports[_0xe78b('0x3f')]=function(_0xa8ebdc,_0x41b4b5){return db[_0xe78b('0x26')]['create'](_0xa8ebdc['body'],{})[_0xe78b('0x1f')](respondWithResult(_0x41b4b5,0xc9))[_0xe78b('0x3b')](handleError(_0x41b4b5,null));};exports[_0xe78b('0x40')]=function(_0x321256,_0x187639){if(_0x321256[_0xe78b('0x41')]['id']){delete _0x321256[_0xe78b('0x41')]['id'];}return db['MailSubstatus'][_0xe78b('0x3e')]({'where':{'id':_0x321256[_0xe78b('0x42')]['id']}})[_0xe78b('0x1f')](handleEntityNotFound(_0x187639,null))[_0xe78b('0x1f')](saveUpdates(_0x321256[_0xe78b('0x41')],null))[_0xe78b('0x1f')](respondWithResult(_0x187639,null))['catch'](handleError(_0x187639,null));};exports[_0xe78b('0x20')]=function(_0x148947,_0x1d9f3a){return db[_0xe78b('0x26')][_0xe78b('0x3e')]({'where':{'id':_0x148947['params']['id']}})[_0xe78b('0x1f')](handleEntityNotFound(_0x1d9f3a,null))['then'](removeEntity(_0x1d9f3a,null))[_0xe78b('0x3b')](handleError(_0x1d9f3a,null));};exports[_0xe78b('0x43')]=function(_0x4571c3,_0x25efd0){return db[_0xe78b('0x26')][_0xe78b('0x43')]()[_0xe78b('0x1f')](respondWithResult(_0x25efd0,null))[_0xe78b('0x3b')](handleError(_0x25efd0,null));};
\ No newline at end of file
+var _0x8d0c=['where','pick','filter','merge','VIRTUAL','count','includeAll','rows','catch','params','include','create','body','find','describe','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','error','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0c,0x1d7));var _0xc8d0=function(_0x50b80d,_0x3aea9b){_0x50b80d=_0x50b80d-0x0;var _0xff58c2=_0x8d0c[_0x50b80d];return _0xff58c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8d0('0x0'));var zipdir=require(_0xc8d0('0x1'));var jsonpatch=require(_0xc8d0('0x2'));var rp=require(_0xc8d0('0x3'));var moment=require(_0xc8d0('0x4'));var BPromise=require(_0xc8d0('0x5'));var Mustache=require(_0xc8d0('0x6'));var util=require('util');var path=require(_0xc8d0('0x7'));var sox=require(_0xc8d0('0x8'));var csv=require('to-csv');var ejs=require(_0xc8d0('0x9'));var fs=require('fs');var fs_extra=require(_0xc8d0('0xa'));var _=require(_0xc8d0('0xb'));var squel=require(_0xc8d0('0xc'));var crypto=require(_0xc8d0('0xd'));var jsforce=require(_0xc8d0('0xe'));var deskjs=require(_0xc8d0('0xf'));var toCsv=require(_0xc8d0('0x10'));var querystring=require('querystring');var Papa=require(_0xc8d0('0x11'));var Redis=require(_0xc8d0('0x12'));var authService=require(_0xc8d0('0x13'));var qs=require(_0xc8d0('0x14'));var as=require(_0xc8d0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc8d0('0x16'));var utils=require(_0xc8d0('0x17'));var config=require(_0xc8d0('0x18'));var licenseUtil=require(_0xc8d0('0x19'));var db=require(_0xc8d0('0x1a'))['db'];function respondWithStatusCode(_0x348835,_0x3f0b49){_0x3f0b49=_0x3f0b49||0xcc;return function(_0x5c8cef){if(_0x5c8cef){return _0x348835[_0xc8d0('0x1b')](_0x3f0b49);}return _0x348835[_0xc8d0('0x1c')](_0x3f0b49)[_0xc8d0('0x1d')]();};}function respondWithResult(_0x4a5884,_0x256d14){_0x256d14=_0x256d14||0xc8;return function(_0x118c35){if(_0x118c35){return _0x4a5884[_0xc8d0('0x1c')](_0x256d14)[_0xc8d0('0x1e')](_0x118c35);}};}function respondWithFilteredResult(_0x3d466e,_0x443fb7){return function(_0x4537a2){if(_0x4537a2){var _0xfc0364=typeof _0x443fb7[_0xc8d0('0x1f')]===_0xc8d0('0x20')&&typeof _0x443fb7[_0xc8d0('0x21')]===_0xc8d0('0x20');var _0x31034f=_0x4537a2['count'];var _0x446ee4=_0xfc0364?0x0:_0x443fb7[_0xc8d0('0x1f')];var _0x477564=_0xfc0364?_0x4537a2['count']:_0x443fb7[_0xc8d0('0x1f')]+_0x443fb7[_0xc8d0('0x21')];var _0x3e5362;if(_0x477564>=_0x31034f){_0x477564=_0x31034f;_0x3e5362=0xc8;}else{_0x3e5362=0xce;}_0x3d466e[_0xc8d0('0x1c')](_0x3e5362);return _0x3d466e[_0xc8d0('0x22')]('Content-Range',_0x446ee4+'-'+_0x477564+'/'+_0x31034f)['json'](_0x4537a2);}return null;};}function patchUpdates(_0x46b733){return function(_0x3437b3){try{jsonpatch[_0xc8d0('0x23')](_0x3437b3,_0x46b733,!![]);}catch(_0x53e276){return BPromise[_0xc8d0('0x24')](_0x53e276);}return _0x3437b3['save']();};}function saveUpdates(_0xedd83,_0x411252){return function(_0xbca6c8){if(_0xbca6c8){return _0xbca6c8[_0xc8d0('0x25')](_0xedd83)[_0xc8d0('0x26')](function(_0x5ee5ae){return _0x5ee5ae;});}return null;};}function removeEntity(_0xec01d1,_0x240acb){return function(_0x2cb750){if(_0x2cb750){return _0x2cb750[_0xc8d0('0x27')]()['then'](function(){_0xec01d1[_0xc8d0('0x1c')](0xcc)[_0xc8d0('0x1d')]();});}};}function handleEntityNotFound(_0x298577,_0x33c937){return function(_0x21663b){if(!_0x21663b){_0x298577[_0xc8d0('0x1b')](0x194);}return _0x21663b;};}function handleError(_0x25ad92,_0x197943){_0x197943=_0x197943||0x1f4;return function(_0x3fb2f2){logger[_0xc8d0('0x28')](_0x3fb2f2['stack']);if(_0x3fb2f2[_0xc8d0('0x29')]){delete _0x3fb2f2['name'];}_0x25ad92['status'](_0x197943)[_0xc8d0('0x2a')](_0x3fb2f2);};}exports[_0xc8d0('0x2b')]=function(_0x3fa5db,_0xab30e6){var _0x487e08={},_0x56c4db={},_0x8acc70={'count':0x0,'rows':[]};var _0x53f444=_[_0xc8d0('0x2c')](db[_0xc8d0('0x2d')][_0xc8d0('0x2e')],function(_0x434d9f){return{'name':_0x434d9f['fieldName'],'type':_0x434d9f[_0xc8d0('0x2f')][_0xc8d0('0x30')]};});_0x56c4db[_0xc8d0('0x31')]=_[_0xc8d0('0x2c')](_0x53f444,'name');_0x56c4db['query']=_[_0xc8d0('0x32')](_0x3fa5db[_0xc8d0('0x33')]);_0x56c4db[_0xc8d0('0x34')]=_['intersection'](_0x56c4db[_0xc8d0('0x31')],_0x56c4db['query']);_0x487e08['attributes']=_[_0xc8d0('0x35')](_0x56c4db[_0xc8d0('0x31')],qs[_0xc8d0('0x36')](_0x3fa5db[_0xc8d0('0x33')]['fields']));_0x487e08[_0xc8d0('0x37')]=_0x487e08[_0xc8d0('0x37')][_0xc8d0('0x38')]?_0x487e08[_0xc8d0('0x37')]:_0x56c4db['model'];if(!_0x3fa5db[_0xc8d0('0x33')][_0xc8d0('0x39')](_0xc8d0('0x3a'))){_0x487e08[_0xc8d0('0x21')]=qs['limit'](_0x3fa5db[_0xc8d0('0x33')]['limit']);_0x487e08[_0xc8d0('0x1f')]=qs['offset'](_0x3fa5db['query'][_0xc8d0('0x1f')]);}_0x487e08[_0xc8d0('0x3b')]=qs[_0xc8d0('0x3c')](_0x3fa5db[_0xc8d0('0x33')][_0xc8d0('0x3c')]);_0x487e08[_0xc8d0('0x3d')]=qs[_0xc8d0('0x34')](_[_0xc8d0('0x3e')](_0x3fa5db['query'],_0x56c4db[_0xc8d0('0x34')]),_0x53f444);if(_0x3fa5db['query'][_0xc8d0('0x3f')]){_0x487e08[_0xc8d0('0x3d')]=_[_0xc8d0('0x40')](_0x487e08[_0xc8d0('0x3d')],{'$or':_['map'](_0x53f444,function(_0x51b6b0){if(_0x51b6b0[_0xc8d0('0x2f')]!==_0xc8d0('0x41')){var _0x4dd286={};_0x4dd286[_0x51b6b0['name']]={'$like':'%'+_0x3fa5db['query'][_0xc8d0('0x3f')]+'%'};return _0x4dd286;}})});}_0x487e08=_[_0xc8d0('0x40')]({},_0x487e08,_0x3fa5db['options']);var _0x27befd={'where':_0x487e08[_0xc8d0('0x3d')]};return db[_0xc8d0('0x2d')][_0xc8d0('0x42')](_0x27befd)[_0xc8d0('0x26')](function(_0x53b5f4){_0x8acc70[_0xc8d0('0x42')]=_0x53b5f4;if(_0x3fa5db[_0xc8d0('0x33')][_0xc8d0('0x43')]){_0x487e08['include']=[{'all':!![]}];}return db[_0xc8d0('0x2d')]['findAll'](_0x487e08);})[_0xc8d0('0x26')](function(_0x4e9283){_0x8acc70[_0xc8d0('0x44')]=_0x4e9283;return _0x8acc70;})[_0xc8d0('0x26')](respondWithFilteredResult(_0xab30e6,_0x487e08))[_0xc8d0('0x45')](handleError(_0xab30e6,null));};exports['show']=function(_0x2659e8,_0x43c294){var _0x47509c={'raw':!![],'where':{'id':_0x2659e8[_0xc8d0('0x46')]['id']}},_0x522f10={};_0x522f10['model']=_[_0xc8d0('0x32')](db[_0xc8d0('0x2d')]['rawAttributes']);_0x522f10['query']=_[_0xc8d0('0x32')](_0x2659e8['query']);_0x522f10['filters']=_['intersection'](_0x522f10[_0xc8d0('0x31')],_0x522f10['query']);_0x47509c[_0xc8d0('0x37')]=_[_0xc8d0('0x35')](_0x522f10['model'],qs[_0xc8d0('0x36')](_0x2659e8[_0xc8d0('0x33')][_0xc8d0('0x36')]));_0x47509c[_0xc8d0('0x37')]=_0x47509c[_0xc8d0('0x37')][_0xc8d0('0x38')]?_0x47509c['attributes']:_0x522f10['model'];if(_0x2659e8[_0xc8d0('0x33')]['includeAll']){_0x47509c[_0xc8d0('0x47')]=[{'all':!![]}];}_0x47509c=_[_0xc8d0('0x40')]({},_0x47509c,_0x2659e8['options']);return db['MailSubstatus']['find'](_0x47509c)[_0xc8d0('0x26')](handleEntityNotFound(_0x43c294,null))[_0xc8d0('0x26')](respondWithResult(_0x43c294,null))[_0xc8d0('0x45')](handleError(_0x43c294,null));};exports[_0xc8d0('0x48')]=function(_0x1886a1,_0x71fb99){return db[_0xc8d0('0x2d')][_0xc8d0('0x48')](_0x1886a1[_0xc8d0('0x49')],{})[_0xc8d0('0x26')](respondWithResult(_0x71fb99,0xc9))[_0xc8d0('0x45')](handleError(_0x71fb99,null));};exports['update']=function(_0x303b3f,_0x1c43b1){if(_0x303b3f[_0xc8d0('0x49')]['id']){delete _0x303b3f[_0xc8d0('0x49')]['id'];}return db['MailSubstatus'][_0xc8d0('0x4a')]({'where':{'id':_0x303b3f[_0xc8d0('0x46')]['id']}})[_0xc8d0('0x26')](handleEntityNotFound(_0x1c43b1,null))[_0xc8d0('0x26')](saveUpdates(_0x303b3f['body'],null))['then'](respondWithResult(_0x1c43b1,null))[_0xc8d0('0x45')](handleError(_0x1c43b1,null));};exports['destroy']=function(_0x56a9b1,_0x3fa114){return db['MailSubstatus'][_0xc8d0('0x4a')]({'where':{'id':_0x56a9b1[_0xc8d0('0x46')]['id']}})[_0xc8d0('0x26')](handleEntityNotFound(_0x3fa114,null))['then'](removeEntity(_0x3fa114,null))[_0xc8d0('0x45')](handleError(_0x3fa114,null));};exports[_0xc8d0('0x4b')]=function(_0xc8ff44,_0x2abfed){return db['MailSubstatus'][_0xc8d0('0x4b')]()['then'](respondWithResult(_0x2abfed,null))['catch'](handleError(_0x2abfed,null));};
\ No newline at end of file
index 0b3792d..cd7cb10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb6=['exports','events','../../mysqldb','MailSubstatus','emit','hasOwnProperty','hook'];(function(_0x4721a5,_0x2e5cd8){var _0x21e6d8=function(_0x1f7388){while(--_0x1f7388){_0x4721a5['push'](_0x4721a5['shift']());}};_0x21e6d8(++_0x2e5cd8);}(_0x0bb6,0x189));var _0x60bb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bb6[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x60bb('0x0'));var MailSubstatus=require(_0x60bb('0x1'))['db'][_0x60bb('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0xeac874){return function(_0x3dc4bf,_0x5049a8,_0x95ecff){MailSubstatusEvents[_0x60bb('0x3')](_0xeac874+':'+_0x3dc4bf['id'],_0x3dc4bf);MailSubstatusEvents[_0x60bb('0x3')](_0xeac874,_0x3dc4bf);_0x95ecff(null);};}for(var e in events){if(events[_0x60bb('0x4')](e)){var event=events[e];MailSubstatus[_0x60bb('0x5')](e,emitEvent(event));}}module[_0x60bb('0x6')]=MailSubstatusEvents;
\ No newline at end of file
+var _0x5816=['hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x5816,0x17c));var _0x6581=function(_0x1bd0fa,_0x23e68d){_0x1bd0fa=_0x1bd0fa-0x0;var _0x54928e=_0x5816[_0x1bd0fa];return _0x54928e;};'use strict';var EventEmitter=require(_0x6581('0x0'));var MailSubstatus=require(_0x6581('0x1'))['db'][_0x6581('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6581('0x3')](0x0);var events={'afterUpdate':_0x6581('0x4')};function emitEvent(_0x57f34b){return function(_0x332578,_0x3d83c2,_0x538c81){MailSubstatusEvents[_0x6581('0x5')](_0x57f34b+':'+_0x332578['id'],_0x332578);MailSubstatusEvents[_0x6581('0x5')](_0x57f34b,_0x332578);_0x538c81(null);};}for(var e in events){if(events[_0x6581('0x6')](e)){var event=events[e];MailSubstatus[_0x6581('0x7')](e,emitEvent(event));}}module[_0x6581('0x8')]=MailSubstatusEvents;
\ No newline at end of file
index 3b6220b..8d294db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbcd=['exports','models','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','./mailSubstatus.attributes'];(function(_0x3a1dac,_0x612251){var _0x273a6a=function(_0x3da077){while(--_0x3da077){_0x3a1dac['push'](_0x3a1dac['shift']());}};_0x273a6a(++_0x612251);}(_0xbbcd,0xa1));var _0xdbbc=function(_0x211fa9,_0x112feb){_0x211fa9=_0x211fa9-0x0;var _0x475890=_0xbbcd[_0x211fa9];return _0x475890;};'use strict';var attributes=require(_0xdbbc('0x0'));module[_0xdbbc('0x1')]=function(_0x21df39){var _0x286930=_0x21df39[_0xdbbc('0x2')];return _0x21df39['define']('MailSubstatus',attributes,{'tableName':_0xdbbc('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1583e0,_0x4ea70e,_0x21a390){return _0x286930[_0xdbbc('0x4')][_0xdbbc('0x5')]({'value':_0x1583e0[_0xdbbc('0x6')]},{'where':{'field':_0xdbbc('0x7'),'value':_0x1583e0[_0xdbbc('0x8')][_0xdbbc('0x6')]}})['then'](function(){_0x21a390();})['catch'](function(_0x28d593){_0x21a390(_0x28d593);});}}});};
\ No newline at end of file
+var _0x99dd=['Condition','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses'];(function(_0x5e6ad8,_0x236f10){var _0xf0db10=function(_0x22dd37){while(--_0x22dd37){_0x5e6ad8['push'](_0x5e6ad8['shift']());}};_0xf0db10(++_0x236f10);}(_0x99dd,0x118));var _0xd99d=function(_0x274bbf,_0x194006){_0x274bbf=_0x274bbf-0x0;var _0x1d107e=_0x99dd[_0x274bbf];return _0x1d107e;};'use strict';var attributes=require(_0xd99d('0x0'));module[_0xd99d('0x1')]=function(_0x5c60a2){var _0x19bb9d=_0x5c60a2[_0xd99d('0x2')];return _0x5c60a2[_0xd99d('0x3')](_0xd99d('0x4'),attributes,{'tableName':_0xd99d('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1d30b8,_0x24085f,_0x21aedc){return _0x19bb9d[_0xd99d('0x6')]['update']({'value':_0x1d30b8[_0xd99d('0x7')]},{'where':{'field':_0xd99d('0x8'),'value':_0x1d30b8['_previousDataValues'][_0xd99d('0x7')]}})[_0xd99d('0x9')](function(){_0x21aedc();})[_0xd99d('0xa')](function(_0x449e07){_0x21aedc(_0x449e07);});}}});};
\ No newline at end of file
index 6165230..f6b1e94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb04c=['result','catch','util','moment','randomstring','ioredis','jayson/promise','client','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0xf41c4a,_0xff3cd0){var _0x384392=function(_0x1a22a4){while(--_0x1a22a4){_0xf41c4a['push'](_0xf41c4a['shift']());}};_0x384392(++_0xff3cd0);}(_0xb04c,0x1b7));var _0xcb04=function(_0x1a1dfa,_0x3acac3){_0x1a1dfa=_0x1a1dfa-0x0;var _0x2b07e6=_0xb04c[_0x1a1dfa];return _0x2b07e6;};'use strict';var _=require('lodash');var util=require(_0xcb04('0x0'));var moment=require(_0xcb04('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb04('0x2'));var fs=require('fs');var Redis=require(_0xcb04('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcb04('0x4'));var client=jayson[_0xcb04('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ac503,_0x296b03,_0x10ec59){return new BPromise(function(_0x38faff,_0x48fa7b){return client[_0xcb04('0x6')](_0x2ac503,_0x10ec59)[_0xcb04('0x7')](function(_0x5f0791){logger['info'](_0xcb04('0x8'),_0x296b03,_0xcb04('0x9'));logger[_0xcb04('0xa')](_0xcb04('0xb'),_0x296b03,_0xcb04('0x9'),JSON[_0xcb04('0xc')](_0x5f0791));if(_0x5f0791['error']){if(_0x5f0791[_0xcb04('0xd')][_0xcb04('0xe')]===0x1f4){logger[_0xcb04('0xd')](_0xcb04('0x8'),_0x296b03,_0x5f0791[_0xcb04('0xd')]['message']);return _0x48fa7b(_0x5f0791[_0xcb04('0xd')][_0xcb04('0xf')]);}logger[_0xcb04('0xd')](_0xcb04('0x8'),_0x296b03,_0x5f0791[_0xcb04('0xd')][_0xcb04('0xf')]);return _0x38faff(_0x5f0791[_0xcb04('0xd')][_0xcb04('0xf')]);}else{logger[_0xcb04('0x10')](_0xcb04('0x8'),_0x296b03,_0xcb04('0x9'));_0x38faff(_0x5f0791[_0xcb04('0x11')]['message']);}})[_0xcb04('0x12')](function(_0x4de95c){logger[_0xcb04('0xd')](_0xcb04('0x8'),_0x296b03,_0x4de95c);_0x48fa7b(_0x4de95c);});});}
\ No newline at end of file
+var _0x477b=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x132875,_0x524c0b){var _0x5b5ae5=function(_0x58031e){while(--_0x58031e){_0x132875['push'](_0x132875['shift']());}};_0x5b5ae5(++_0x524c0b);}(_0x477b,0x164));var _0xb477=function(_0x69c0d0,_0x5b07c8){_0x69c0d0=_0x69c0d0-0x0;var _0xe7cf0d=_0x477b[_0x69c0d0];return _0xe7cf0d;};'use strict';var _=require(_0xb477('0x0'));var util=require(_0xb477('0x1'));var moment=require(_0xb477('0x2'));var BPromise=require('bluebird');var rs=require(_0xb477('0x3'));var fs=require('fs');var Redis=require(_0xb477('0x4'));var db=require(_0xb477('0x5'))['db'];var utils=require(_0xb477('0x6'));var logger=require('../../config/logger')(_0xb477('0x7'));var config=require(_0xb477('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb477('0x9')][_0xb477('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x221b6e,_0x10cb11,_0x29fc4d){return new BPromise(function(_0x352af0,_0x2337bd){return client[_0xb477('0xb')](_0x221b6e,_0x29fc4d)[_0xb477('0xc')](function(_0x326e4f){logger[_0xb477('0xd')](_0xb477('0xe'),_0x10cb11,_0xb477('0xf'));logger[_0xb477('0x10')](_0xb477('0x11'),_0x10cb11,_0xb477('0xf'),JSON[_0xb477('0x12')](_0x326e4f));if(_0x326e4f['error']){if(_0x326e4f[_0xb477('0x13')][_0xb477('0x14')]===0x1f4){logger[_0xb477('0x13')](_0xb477('0xe'),_0x10cb11,_0x326e4f[_0xb477('0x13')][_0xb477('0x15')]);return _0x2337bd(_0x326e4f[_0xb477('0x13')][_0xb477('0x15')]);}logger['error'](_0xb477('0xe'),_0x10cb11,_0x326e4f[_0xb477('0x13')][_0xb477('0x15')]);return _0x352af0(_0x326e4f[_0xb477('0x13')][_0xb477('0x15')]);}else{logger[_0xb477('0xd')](_0xb477('0xe'),_0x10cb11,_0xb477('0xf'));_0x352af0(_0x326e4f[_0xb477('0x16')]['message']);}})[_0xb477('0x17')](function(_0x402b50){logger[_0xb477('0x13')](_0xb477('0xe'),_0x10cb11,_0x402b50);_0x2337bd(_0x402b50);});});}
\ No newline at end of file
index 40e5a72..1eb4a56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4c3=['../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','path','express','fs-extra','../../components/auth/service'];(function(_0x2a89c2,_0x145aab){var _0x1063ad=function(_0x2dc476){while(--_0x2dc476){_0x2a89c2['push'](_0x2a89c2['shift']());}};_0x1063ad(++_0x145aab);}(_0xb4c3,0x1f0));var _0x3b4c=function(_0x33e137,_0x33edcc){_0x33e137=_0x33e137-0x0;var _0x4f105d=_0xb4c3[_0x33e137];return _0x4f105d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3b4c('0x0'));var timeout=require('connect-timeout');var express=require(_0x3b4c('0x1'));var router=express['Router']();var fs_extra=require(_0x3b4c('0x2'));var auth=require(_0x3b4c('0x3'));var interaction=require(_0x3b4c('0x4'));var config=require(_0x3b4c('0x5'));var controller=require(_0x3b4c('0x6'));router['get']('/',auth[_0x3b4c('0x7')](),controller[_0x3b4c('0x8')]);router[_0x3b4c('0x9')](_0x3b4c('0xa'),auth['isAuthenticated'](),controller[_0x3b4c('0xb')]);router[_0x3b4c('0x9')](_0x3b4c('0xc'),auth[_0x3b4c('0x7')](),controller[_0x3b4c('0xd')]);router[_0x3b4c('0xe')]('/',auth[_0x3b4c('0x7')](),controller[_0x3b4c('0xf')]);router[_0x3b4c('0x10')](_0x3b4c('0xc'),auth[_0x3b4c('0x7')](),controller[_0x3b4c('0x11')]);router[_0x3b4c('0x12')](_0x3b4c('0xc'),auth[_0x3b4c('0x7')](),controller[_0x3b4c('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x3b51=['./mailTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2d0d9f,_0x22c0d8){var _0x30243d=function(_0x29a92b){while(--_0x29a92b){_0x2d0d9f['push'](_0x2d0d9f['shift']());}};_0x30243d(++_0x22c0d8);}(_0x3b51,0x64));var _0x13b5=function(_0x56a74a,_0x1ebcc4){_0x56a74a=_0x56a74a-0x0;var _0x136f4d=_0x3b51[_0x56a74a];return _0x136f4d;};'use strict';var multer=require(_0x13b5('0x0'));var util=require(_0x13b5('0x1'));var path=require(_0x13b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x13b5('0x3'));var router=express[_0x13b5('0x4')]();var fs_extra=require(_0x13b5('0x5'));var auth=require(_0x13b5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x13b5('0x7'));var controller=require(_0x13b5('0x8'));router[_0x13b5('0x9')]('/',auth[_0x13b5('0xa')](),controller[_0x13b5('0xb')]);router[_0x13b5('0x9')](_0x13b5('0xc'),auth[_0x13b5('0xa')](),controller['describe']);router[_0x13b5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x13b5('0xd')]);router[_0x13b5('0xe')]('/',auth['isAuthenticated'](),controller[_0x13b5('0xf')]);router['put'](_0x13b5('0x10'),auth['isAuthenticated'](),controller[_0x13b5('0x11')]);router['delete'](_0x13b5('0x10'),auth[_0x13b5('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9869176..478738a 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(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0xb43b,0x1b2));var _0xbb43=function(_0xeefb1a,_0x36f52c){_0xeefb1a=_0xeefb1a-0x0;var _0x450af8=_0xb43b[_0xeefb1a];return _0x450af8;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0x9bde,0xe1));var _0xe9bd=function(_0xa0e5ca,_0x4280c6){_0xa0e5ca=_0xa0e5ca-0x0;var _0x95a646=_0x9bde[_0xa0e5ca];return _0x95a646;};'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
index a856852..83d2ae8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf30b=['save','then','end','error','name','send','index','MailTransferReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','include','findAll','rows','catch','params','length','includeAll','options','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject'];(function(_0x38d3e8,_0x3206c9){var _0x278f18=function(_0x1df591){while(--_0x1df591){_0x38d3e8['push'](_0x38d3e8['shift']());}};_0x278f18(++_0x3206c9);}(_0xf30b,0x74));var _0xbf30=function(_0x20e79a,_0x322d4e){_0x20e79a=_0x20e79a-0x0;var _0x70801f=_0xf30b[_0x20e79a];return _0x70801f;};'use strict';var emlformat=require(_0xbf30('0x0'));var rimraf=require(_0xbf30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf30('0x2'));var rp=require(_0xbf30('0x3'));var moment=require('moment');var BPromise=require(_0xbf30('0x4'));var Mustache=require(_0xbf30('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbf30('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf30('0x7'));var _=require(_0xbf30('0x8'));var squel=require(_0xbf30('0x9'));var crypto=require('crypto');var jsforce=require(_0xbf30('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbf30('0xb'));var Papa=require(_0xbf30('0xc'));var Redis=require('ioredis');var authService=require(_0xbf30('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xbf30('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf30('0xf'))(_0xbf30('0x10'));var utils=require('../../config/utils');var config=require(_0xbf30('0x11'));var licenseUtil=require(_0xbf30('0x12'));var db=require(_0xbf30('0x13'))['db'];function respondWithStatusCode(_0xea9a45,_0x27ef47){_0x27ef47=_0x27ef47||0xcc;return function(_0xf7500b){if(_0xf7500b){return _0xea9a45[_0xbf30('0x14')](_0x27ef47);}return _0xea9a45[_0xbf30('0x15')](_0x27ef47)['end']();};}function respondWithResult(_0x227dea,_0x43d2e8){_0x43d2e8=_0x43d2e8||0xc8;return function(_0xbfb9ea){if(_0xbfb9ea){return _0x227dea[_0xbf30('0x15')](_0x43d2e8)[_0xbf30('0x16')](_0xbfb9ea);}};}function respondWithFilteredResult(_0xb40ac4,_0x3eaede){return function(_0x165d70){if(_0x165d70){var _0x139132=typeof _0x3eaede[_0xbf30('0x17')]==='undefined'&&typeof _0x3eaede[_0xbf30('0x18')]===_0xbf30('0x19');var _0x221505=_0x165d70['count'];var _0x616538=_0x139132?0x0:_0x3eaede[_0xbf30('0x17')];var _0x2a20a4=_0x139132?_0x165d70['count']:_0x3eaede[_0xbf30('0x17')]+_0x3eaede[_0xbf30('0x18')];var _0xb74a91;if(_0x2a20a4>=_0x221505){_0x2a20a4=_0x221505;_0xb74a91=0xc8;}else{_0xb74a91=0xce;}_0xb40ac4[_0xbf30('0x15')](_0xb74a91);return _0xb40ac4[_0xbf30('0x1a')](_0xbf30('0x1b'),_0x616538+'-'+_0x2a20a4+'/'+_0x221505)[_0xbf30('0x16')](_0x165d70);}return null;};}function patchUpdates(_0x48db1d){return function(_0xe154c1){try{jsonpatch[_0xbf30('0x1c')](_0xe154c1,_0x48db1d,!![]);}catch(_0x547e37){return BPromise[_0xbf30('0x1d')](_0x547e37);}return _0xe154c1[_0xbf30('0x1e')]();};}function saveUpdates(_0x56de9a,_0x3f7c09){return function(_0x14f69f){if(_0x14f69f){return _0x14f69f['update'](_0x56de9a)['then'](function(_0x53b6e6){return _0x53b6e6;});}return null;};}function removeEntity(_0x3ec829,_0x5cea39){return function(_0xcac30e){if(_0xcac30e){return _0xcac30e['destroy']()[_0xbf30('0x1f')](function(){_0x3ec829[_0xbf30('0x15')](0xcc)[_0xbf30('0x20')]();});}};}function handleEntityNotFound(_0x166f0e,_0x55e4ae){return function(_0x5cefa1){if(!_0x5cefa1){_0x166f0e[_0xbf30('0x14')](0x194);}return _0x5cefa1;};}function handleError(_0x324f33,_0x6b1c22){_0x6b1c22=_0x6b1c22||0x1f4;return function(_0x285d98){logger[_0xbf30('0x21')](_0x285d98['stack']);if(_0x285d98['name']){delete _0x285d98[_0xbf30('0x22')];}_0x324f33['status'](_0x6b1c22)[_0xbf30('0x23')](_0x285d98);};}exports[_0xbf30('0x24')]=function(_0x589352,_0x2e70f8){var _0x53b9f4={},_0x2edc39={},_0x184cdd={'count':0x0,'rows':[]};var _0x46b49e=_['map'](db[_0xbf30('0x25')][_0xbf30('0x26')],function(_0x5416bb){return{'name':_0x5416bb[_0xbf30('0x27')],'type':_0x5416bb[_0xbf30('0x28')]['key']};});_0x2edc39[_0xbf30('0x29')]=_[_0xbf30('0x2a')](_0x46b49e,_0xbf30('0x22'));_0x2edc39['query']=_[_0xbf30('0x2b')](_0x589352[_0xbf30('0x2c')]);_0x2edc39[_0xbf30('0x2d')]=_[_0xbf30('0x2e')](_0x2edc39[_0xbf30('0x29')],_0x2edc39['query']);_0x53b9f4[_0xbf30('0x2f')]=_[_0xbf30('0x2e')](_0x2edc39[_0xbf30('0x29')],qs[_0xbf30('0x30')](_0x589352[_0xbf30('0x2c')]['fields']));_0x53b9f4[_0xbf30('0x2f')]=_0x53b9f4[_0xbf30('0x2f')]['length']?_0x53b9f4['attributes']:_0x2edc39[_0xbf30('0x29')];if(!_0x589352[_0xbf30('0x2c')][_0xbf30('0x31')](_0xbf30('0x32'))){_0x53b9f4[_0xbf30('0x18')]=qs['limit'](_0x589352['query'][_0xbf30('0x18')]);_0x53b9f4[_0xbf30('0x17')]=qs[_0xbf30('0x17')](_0x589352[_0xbf30('0x2c')][_0xbf30('0x17')]);}_0x53b9f4[_0xbf30('0x33')]=qs[_0xbf30('0x34')](_0x589352[_0xbf30('0x2c')][_0xbf30('0x34')]);_0x53b9f4[_0xbf30('0x35')]=qs[_0xbf30('0x2d')](_[_0xbf30('0x36')](_0x589352[_0xbf30('0x2c')],_0x2edc39[_0xbf30('0x2d')]),_0x46b49e);if(_0x589352['query']['filter']){_0x53b9f4[_0xbf30('0x35')]=_[_0xbf30('0x37')](_0x53b9f4['where'],{'$or':_['map'](_0x46b49e,function(_0x547100){if(_0x547100[_0xbf30('0x28')]!==_0xbf30('0x38')){var _0x3abd47={};_0x3abd47[_0x547100['name']]={'$like':'%'+_0x589352[_0xbf30('0x2c')][_0xbf30('0x39')]+'%'};return _0x3abd47;}})});}_0x53b9f4=_['merge']({},_0x53b9f4,_0x589352['options']);var _0x1abf53={'where':_0x53b9f4[_0xbf30('0x35')]};return db[_0xbf30('0x25')][_0xbf30('0x3a')](_0x1abf53)[_0xbf30('0x1f')](function(_0x3125fe){_0x184cdd['count']=_0x3125fe;if(_0x589352[_0xbf30('0x2c')]['includeAll']){_0x53b9f4[_0xbf30('0x3b')]=[{'all':!![]}];}return db[_0xbf30('0x25')][_0xbf30('0x3c')](_0x53b9f4);})[_0xbf30('0x1f')](function(_0x365580){_0x184cdd[_0xbf30('0x3d')]=_0x365580;return _0x184cdd;})[_0xbf30('0x1f')](respondWithFilteredResult(_0x2e70f8,_0x53b9f4))[_0xbf30('0x3e')](handleError(_0x2e70f8,null));};exports['show']=function(_0xdecd86,_0x477024){var _0x40494c={'raw':!![],'where':{'id':_0xdecd86[_0xbf30('0x3f')]['id']}},_0x439639={};_0x439639[_0xbf30('0x29')]=_[_0xbf30('0x2b')](db[_0xbf30('0x25')]['rawAttributes']);_0x439639['query']=_[_0xbf30('0x2b')](_0xdecd86['query']);_0x439639[_0xbf30('0x2d')]=_[_0xbf30('0x2e')](_0x439639[_0xbf30('0x29')],_0x439639[_0xbf30('0x2c')]);_0x40494c['attributes']=_[_0xbf30('0x2e')](_0x439639[_0xbf30('0x29')],qs[_0xbf30('0x30')](_0xdecd86[_0xbf30('0x2c')][_0xbf30('0x30')]));_0x40494c[_0xbf30('0x2f')]=_0x40494c['attributes'][_0xbf30('0x40')]?_0x40494c['attributes']:_0x439639['model'];if(_0xdecd86[_0xbf30('0x2c')][_0xbf30('0x41')]){_0x40494c['include']=[{'all':!![]}];}_0x40494c=_[_0xbf30('0x37')]({},_0x40494c,_0xdecd86[_0xbf30('0x42')]);return db[_0xbf30('0x25')][_0xbf30('0x43')](_0x40494c)[_0xbf30('0x1f')](handleEntityNotFound(_0x477024,null))[_0xbf30('0x1f')](respondWithResult(_0x477024,null))[_0xbf30('0x3e')](handleError(_0x477024,null));};exports[_0xbf30('0x44')]=function(_0x463e34,_0x3f1e7f){return db[_0xbf30('0x25')][_0xbf30('0x44')](_0x463e34[_0xbf30('0x45')],{})['then'](respondWithResult(_0x3f1e7f,0xc9))[_0xbf30('0x3e')](handleError(_0x3f1e7f,null));};exports[_0xbf30('0x46')]=function(_0x13c966,_0x40d88d){if(_0x13c966[_0xbf30('0x45')]['id']){delete _0x13c966[_0xbf30('0x45')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x13c966[_0xbf30('0x3f')]['id']}})[_0xbf30('0x1f')](handleEntityNotFound(_0x40d88d,null))[_0xbf30('0x1f')](saveUpdates(_0x13c966['body'],null))[_0xbf30('0x1f')](respondWithResult(_0x40d88d,null))[_0xbf30('0x3e')](handleError(_0x40d88d,null));};exports[_0xbf30('0x47')]=function(_0x581839,_0x52e384){return db['MailTransferReport'][_0xbf30('0x43')]({'where':{'id':_0x581839[_0xbf30('0x3f')]['id']}})['then'](handleEntityNotFound(_0x52e384,null))['then'](removeEntity(_0x52e384,null))['catch'](handleError(_0x52e384,null));};exports[_0xbf30('0x48')]=function(_0x26c554,_0x5a301e){return db[_0xbf30('0x25')][_0xbf30('0x48')]()[_0xbf30('0x1f')](respondWithResult(_0x5a301e,null))[_0xbf30('0x3e')](handleError(_0x5a301e,null));};
\ No newline at end of file
+var _0x3ebe=['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/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','save','update','then','destroy','error','stack','name','index','map','MailTransferReport','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x3ebe,0xd4));var _0xe3eb=function(_0x1bfc21,_0x3ae170){_0x1bfc21=_0x1bfc21-0x0;var _0x6b486a=_0x3ebe[_0x1bfc21];return _0x6b486a;};'use strict';var emlformat=require(_0xe3eb('0x0'));var rimraf=require(_0xe3eb('0x1'));var zipdir=require(_0xe3eb('0x2'));var jsonpatch=require(_0xe3eb('0x3'));var rp=require(_0xe3eb('0x4'));var moment=require(_0xe3eb('0x5'));var BPromise=require(_0xe3eb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe3eb('0x7'));var sox=require('sox');var csv=require(_0xe3eb('0x8'));var ejs=require(_0xe3eb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3eb('0xa'));var squel=require(_0xe3eb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe3eb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe3eb('0xd'));var Papa=require(_0xe3eb('0xe'));var Redis=require(_0xe3eb('0xf'));var authService=require(_0xe3eb('0x10'));var qs=require(_0xe3eb('0x11'));var as=require(_0xe3eb('0x12'));var hardwareService=require(_0xe3eb('0x13'));var logger=require(_0xe3eb('0x14'))(_0xe3eb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe3eb('0x16'));var db=require(_0xe3eb('0x17'))['db'];function respondWithStatusCode(_0x41cb54,_0x489703){_0x489703=_0x489703||0xcc;return function(_0x9682e2){if(_0x9682e2){return _0x41cb54[_0xe3eb('0x18')](_0x489703);}return _0x41cb54[_0xe3eb('0x19')](_0x489703)[_0xe3eb('0x1a')]();};}function respondWithResult(_0x354d9b,_0x5c36fe){_0x5c36fe=_0x5c36fe||0xc8;return function(_0x1535b6){if(_0x1535b6){return _0x354d9b[_0xe3eb('0x19')](_0x5c36fe)[_0xe3eb('0x1b')](_0x1535b6);}};}function respondWithFilteredResult(_0xa160d4,_0x5ea014){return function(_0x4193a3){if(_0x4193a3){var _0x612e0=typeof _0x5ea014['offset']==='undefined'&&typeof _0x5ea014[_0xe3eb('0x1c')]===_0xe3eb('0x1d');var _0x2d56ee=_0x4193a3[_0xe3eb('0x1e')];var _0x545eb0=_0x612e0?0x0:_0x5ea014[_0xe3eb('0x1f')];var _0x347f92=_0x612e0?_0x4193a3['count']:_0x5ea014[_0xe3eb('0x1f')]+_0x5ea014[_0xe3eb('0x1c')];var _0x10947f;if(_0x347f92>=_0x2d56ee){_0x347f92=_0x2d56ee;_0x10947f=0xc8;}else{_0x10947f=0xce;}_0xa160d4[_0xe3eb('0x19')](_0x10947f);return _0xa160d4[_0xe3eb('0x20')]('Content-Range',_0x545eb0+'-'+_0x347f92+'/'+_0x2d56ee)[_0xe3eb('0x1b')](_0x4193a3);}return null;};}function patchUpdates(_0x460535){return function(_0x91927){try{jsonpatch[_0xe3eb('0x21')](_0x91927,_0x460535,!![]);}catch(_0x29d98f){return BPromise['reject'](_0x29d98f);}return _0x91927[_0xe3eb('0x22')]();};}function saveUpdates(_0x22231a,_0x3d5921){return function(_0x3fa501){if(_0x3fa501){return _0x3fa501[_0xe3eb('0x23')](_0x22231a)[_0xe3eb('0x24')](function(_0x4cb57b){return _0x4cb57b;});}return null;};}function removeEntity(_0x199ad2,_0x3b17c1){return function(_0x38e9e0){if(_0x38e9e0){return _0x38e9e0[_0xe3eb('0x25')]()[_0xe3eb('0x24')](function(){_0x199ad2[_0xe3eb('0x19')](0xcc)[_0xe3eb('0x1a')]();});}};}function handleEntityNotFound(_0x3fe99a,_0x44dc8f){return function(_0x2c2332){if(!_0x2c2332){_0x3fe99a['sendStatus'](0x194);}return _0x2c2332;};}function handleError(_0x5ec8ea,_0x458f05){_0x458f05=_0x458f05||0x1f4;return function(_0x532a57){logger[_0xe3eb('0x26')](_0x532a57[_0xe3eb('0x27')]);if(_0x532a57[_0xe3eb('0x28')]){delete _0x532a57['name'];}_0x5ec8ea[_0xe3eb('0x19')](_0x458f05)['send'](_0x532a57);};}exports[_0xe3eb('0x29')]=function(_0x383048,_0x2df1a7){var _0x3130b6={},_0x294e1b={},_0x59d285={'count':0x0,'rows':[]};var _0xdb58e9=_[_0xe3eb('0x2a')](db[_0xe3eb('0x2b')][_0xe3eb('0x2c')],function(_0x2e9573){return{'name':_0x2e9573['fieldName'],'type':_0x2e9573[_0xe3eb('0x2d')]['key']};});_0x294e1b['model']=_['map'](_0xdb58e9,_0xe3eb('0x28'));_0x294e1b['query']=_[_0xe3eb('0x2e')](_0x383048[_0xe3eb('0x2f')]);_0x294e1b[_0xe3eb('0x30')]=_[_0xe3eb('0x31')](_0x294e1b[_0xe3eb('0x32')],_0x294e1b['query']);_0x3130b6[_0xe3eb('0x33')]=_['intersection'](_0x294e1b['model'],qs[_0xe3eb('0x34')](_0x383048[_0xe3eb('0x2f')]['fields']));_0x3130b6[_0xe3eb('0x33')]=_0x3130b6[_0xe3eb('0x33')][_0xe3eb('0x35')]?_0x3130b6['attributes']:_0x294e1b['model'];if(!_0x383048[_0xe3eb('0x2f')]['hasOwnProperty']('nolimit')){_0x3130b6[_0xe3eb('0x1c')]=qs['limit'](_0x383048[_0xe3eb('0x2f')][_0xe3eb('0x1c')]);_0x3130b6[_0xe3eb('0x1f')]=qs[_0xe3eb('0x1f')](_0x383048[_0xe3eb('0x2f')][_0xe3eb('0x1f')]);}_0x3130b6[_0xe3eb('0x36')]=qs[_0xe3eb('0x37')](_0x383048[_0xe3eb('0x2f')]['sort']);_0x3130b6['where']=qs[_0xe3eb('0x30')](_[_0xe3eb('0x38')](_0x383048['query'],_0x294e1b[_0xe3eb('0x30')]),_0xdb58e9);if(_0x383048[_0xe3eb('0x2f')][_0xe3eb('0x39')]){_0x3130b6[_0xe3eb('0x3a')]=_[_0xe3eb('0x3b')](_0x3130b6[_0xe3eb('0x3a')],{'$or':_[_0xe3eb('0x2a')](_0xdb58e9,function(_0x2b1a9a){if(_0x2b1a9a['type']!==_0xe3eb('0x3c')){var _0xd201f9={};_0xd201f9[_0x2b1a9a[_0xe3eb('0x28')]]={'$like':'%'+_0x383048[_0xe3eb('0x2f')]['filter']+'%'};return _0xd201f9;}})});}_0x3130b6=_[_0xe3eb('0x3b')]({},_0x3130b6,_0x383048[_0xe3eb('0x3d')]);var _0x1a0a8d={'where':_0x3130b6[_0xe3eb('0x3a')]};return db[_0xe3eb('0x2b')][_0xe3eb('0x1e')](_0x1a0a8d)[_0xe3eb('0x24')](function(_0x5b9154){_0x59d285['count']=_0x5b9154;if(_0x383048['query'][_0xe3eb('0x3e')]){_0x3130b6[_0xe3eb('0x3f')]=[{'all':!![]}];}return db[_0xe3eb('0x2b')][_0xe3eb('0x40')](_0x3130b6);})[_0xe3eb('0x24')](function(_0x69b775){_0x59d285[_0xe3eb('0x41')]=_0x69b775;return _0x59d285;})['then'](respondWithFilteredResult(_0x2df1a7,_0x3130b6))['catch'](handleError(_0x2df1a7,null));};exports[_0xe3eb('0x42')]=function(_0x13b010,_0x4716ef){var _0x4f38f8={'raw':!![],'where':{'id':_0x13b010[_0xe3eb('0x43')]['id']}},_0x10f48b={};_0x10f48b[_0xe3eb('0x32')]=_[_0xe3eb('0x2e')](db[_0xe3eb('0x2b')]['rawAttributes']);_0x10f48b[_0xe3eb('0x2f')]=_[_0xe3eb('0x2e')](_0x13b010[_0xe3eb('0x2f')]);_0x10f48b[_0xe3eb('0x30')]=_[_0xe3eb('0x31')](_0x10f48b[_0xe3eb('0x32')],_0x10f48b[_0xe3eb('0x2f')]);_0x4f38f8[_0xe3eb('0x33')]=_['intersection'](_0x10f48b[_0xe3eb('0x32')],qs['fields'](_0x13b010[_0xe3eb('0x2f')][_0xe3eb('0x34')]));_0x4f38f8[_0xe3eb('0x33')]=_0x4f38f8[_0xe3eb('0x33')][_0xe3eb('0x35')]?_0x4f38f8['attributes']:_0x10f48b[_0xe3eb('0x32')];if(_0x13b010[_0xe3eb('0x2f')][_0xe3eb('0x3e')]){_0x4f38f8['include']=[{'all':!![]}];}_0x4f38f8=_['merge']({},_0x4f38f8,_0x13b010[_0xe3eb('0x3d')]);return db['MailTransferReport']['find'](_0x4f38f8)[_0xe3eb('0x24')](handleEntityNotFound(_0x4716ef,null))[_0xe3eb('0x24')](respondWithResult(_0x4716ef,null))['catch'](handleError(_0x4716ef,null));};exports[_0xe3eb('0x44')]=function(_0x380be6,_0x2a4444){return db[_0xe3eb('0x2b')][_0xe3eb('0x44')](_0x380be6['body'],{})[_0xe3eb('0x24')](respondWithResult(_0x2a4444,0xc9))[_0xe3eb('0x45')](handleError(_0x2a4444,null));};exports[_0xe3eb('0x23')]=function(_0x2d2a0d,_0xd40f1d){if(_0x2d2a0d[_0xe3eb('0x46')]['id']){delete _0x2d2a0d[_0xe3eb('0x46')]['id'];}return db[_0xe3eb('0x2b')][_0xe3eb('0x47')]({'where':{'id':_0x2d2a0d[_0xe3eb('0x43')]['id']}})[_0xe3eb('0x24')](handleEntityNotFound(_0xd40f1d,null))[_0xe3eb('0x24')](saveUpdates(_0x2d2a0d['body'],null))[_0xe3eb('0x24')](respondWithResult(_0xd40f1d,null))[_0xe3eb('0x45')](handleError(_0xd40f1d,null));};exports[_0xe3eb('0x25')]=function(_0x3eaf8f,_0x5361c7){return db[_0xe3eb('0x2b')][_0xe3eb('0x47')]({'where':{'id':_0x3eaf8f['params']['id']}})[_0xe3eb('0x24')](handleEntityNotFound(_0x5361c7,null))[_0xe3eb('0x24')](removeEntity(_0x5361c7,null))[_0xe3eb('0x45')](handleError(_0x5361c7,null));};exports[_0xe3eb('0x48')]=function(_0x5d957b,_0x18099d){return db[_0xe3eb('0x2b')][_0xe3eb('0x48')]()[_0xe3eb('0x24')](respondWithResult(_0x18099d,null))['catch'](handleError(_0x18099d,null));};
\ No newline at end of file
index 489adce..81f67ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafa5=['bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0xcc3c28,_0xc7872){var _0x3cb500=function(_0x504c97){while(--_0x504c97){_0xcc3c28['push'](_0xcc3c28['shift']());}};_0x3cb500(++_0xc7872);}(_0xafa5,0x1af));var _0x5afa=function(_0x498a5b,_0x59bd7c){_0x498a5b=_0x498a5b-0x0;var _0x217f46=_0xafa5[_0x498a5b];return _0x217f46;};'use strict';var _=require('lodash');var util=require(_0x5afa('0x0'));var logger=require(_0x5afa('0x1'))(_0x5afa('0x2'));var moment=require(_0x5afa('0x3'));var BPromise=require(_0x5afa('0x4'));var rp=require(_0x5afa('0x5'));var fs=require('fs');var path=require(_0x5afa('0x6'));var rimraf=require(_0x5afa('0x7'));var config=require(_0x5afa('0x8'));var attributes=require(_0x5afa('0x9'));module[_0x5afa('0xa')]=function(_0x58998c,_0x166388){return _0x58998c[_0x5afa('0xb')](_0x5afa('0xc'),attributes,{'tableName':_0x5afa('0xd'),'paranoid':![],'indexes':[{'name':_0x5afa('0xe'),'fields':[_0x5afa('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe292=['../../config/logger','api','request-promise','path','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe292,0x19e));var _0x2e29=function(_0x5da41d,_0x265859){_0x5da41d=_0x5da41d-0x0;var _0x4edb8b=_0xe292[_0x5da41d];return _0x4edb8b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e29('0x0'))(_0x2e29('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e29('0x2'));var fs=require('fs');var path=require(_0x2e29('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e29('0x4'));module['exports']=function(_0x5bd6cc,_0xcdccd7){return _0x5bd6cc[_0x2e29('0x5')](_0x2e29('0x6'),attributes,{'tableName':_0x2e29('0x7'),'paranoid':![],'indexes':[{'name':_0x2e29('0x8'),'fields':[_0x2e29('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index b2eb1f3..5771321 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b42=['rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','MailTransferReport,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b42,0x1f3));var _0x24b4=function(_0x278704,_0x5db146){_0x278704=_0x278704-0x0;var _0x2a71ba=_0x4b42[_0x278704];return _0x2a71ba;};'use strict';var _=require('lodash');var util=require(_0x24b4('0x0'));var moment=require(_0x24b4('0x1'));var BPromise=require('bluebird');var rs=require(_0x24b4('0x2'));var fs=require('fs');var Redis=require(_0x24b4('0x3'));var db=require(_0x24b4('0x4'))['db'];var utils=require(_0x24b4('0x5'));var logger=require(_0x24b4('0x6'))(_0x24b4('0x7'));var config=require(_0x24b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24b4('0x9')][_0x24b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25c216,_0x503f4d,_0x5b2f57){return new BPromise(function(_0x5954c9,_0x9cfe7a){return client[_0x24b4('0xb')](_0x25c216,_0x5b2f57)[_0x24b4('0xc')](function(_0x32e10e){logger[_0x24b4('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x503f4d,_0x24b4('0xe'));logger[_0x24b4('0xf')](_0x24b4('0x10'),_0x503f4d,_0x24b4('0xe'),JSON[_0x24b4('0x11')](_0x32e10e));if(_0x32e10e[_0x24b4('0x12')]){if(_0x32e10e[_0x24b4('0x12')]['code']===0x1f4){logger[_0x24b4('0x12')](_0x24b4('0x13'),_0x503f4d,_0x32e10e[_0x24b4('0x12')][_0x24b4('0x14')]);return _0x9cfe7a(_0x32e10e[_0x24b4('0x12')][_0x24b4('0x14')]);}logger['error'](_0x24b4('0x13'),_0x503f4d,_0x32e10e[_0x24b4('0x12')]['message']);return _0x5954c9(_0x32e10e['error']['message']);}else{logger[_0x24b4('0xd')](_0x24b4('0x13'),_0x503f4d,_0x24b4('0xe'));_0x5954c9(_0x32e10e[_0x24b4('0x15')][_0x24b4('0x14')]);}})['catch'](function(_0x28696f){logger[_0x24b4('0x12')](_0x24b4('0x13'),_0x503f4d,_0x28696f);_0x9cfe7a(_0x28696f);});});}
\ No newline at end of file
+var _0xea1e=['MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x38a888,_0x1dd134){var _0xca2e3c=function(_0x5e2c94){while(--_0x5e2c94){_0x38a888['push'](_0x38a888['shift']());}};_0xca2e3c(++_0x1dd134);}(_0xea1e,0x1ab));var _0xeea1=function(_0x2b8acf,_0x4b5b2b){_0x2b8acf=_0x2b8acf-0x0;var _0x5da2fb=_0xea1e[_0x2b8acf];return _0x5da2fb;};'use strict';var _=require(_0xeea1('0x0'));var util=require(_0xeea1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeea1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeea1('0x3'))['db'];var utils=require(_0xeea1('0x4'));var logger=require('../../config/logger')(_0xeea1('0x5'));var config=require(_0xeea1('0x6'));var jayson=require(_0xeea1('0x7'));var client=jayson['client'][_0xeea1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4820f3,_0x17d252,_0x3d5a33){return new BPromise(function(_0x5f518e,_0x3d0308){return client[_0xeea1('0x9')](_0x4820f3,_0x3d5a33)['then'](function(_0x39ffa0){logger[_0xeea1('0xa')](_0xeea1('0xb'),_0x17d252,_0xeea1('0xc'));logger[_0xeea1('0xd')](_0xeea1('0xe'),_0x17d252,_0xeea1('0xc'),JSON[_0xeea1('0xf')](_0x39ffa0));if(_0x39ffa0[_0xeea1('0x10')]){if(_0x39ffa0[_0xeea1('0x10')][_0xeea1('0x11')]===0x1f4){logger[_0xeea1('0x10')](_0xeea1('0xb'),_0x17d252,_0x39ffa0['error'][_0xeea1('0x12')]);return _0x3d0308(_0x39ffa0[_0xeea1('0x10')][_0xeea1('0x12')]);}logger[_0xeea1('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x17d252,_0x39ffa0[_0xeea1('0x10')][_0xeea1('0x12')]);return _0x5f518e(_0x39ffa0[_0xeea1('0x10')]['message']);}else{logger[_0xeea1('0xa')](_0xeea1('0xb'),_0x17d252,_0xeea1('0xc'));_0x5f518e(_0x39ffa0[_0xeea1('0x13')][_0xeea1('0x12')]);}})[_0xeea1('0x14')](function(_0x4aa97e){logger[_0xeea1('0x10')](_0xeea1('0xb'),_0x17d252,_0x4aa97e);_0x3d0308(_0x4aa97e);});});}
\ No newline at end of file
index 3fa7d97..71726a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbb1=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcbb1,0xb5));var _0x1cbb=function(_0x1658c4,_0x216814){_0x1658c4=_0x1658c4-0x0;var _0x1c755a=_0xcbb1[_0x1658c4];return _0x1c755a;};'use strict';var multer=require(_0x1cbb('0x0'));var util=require(_0x1cbb('0x1'));var path=require(_0x1cbb('0x2'));var timeout=require('connect-timeout');var express=require(_0x1cbb('0x3'));var router=express[_0x1cbb('0x4')]();var fs_extra=require(_0x1cbb('0x5'));var auth=require(_0x1cbb('0x6'));var interaction=require(_0x1cbb('0x7'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x1cbb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1cbb('0x8')](_0x1cbb('0x9'),auth[_0x1cbb('0xa')](),controller[_0x1cbb('0xb')]);router['get'](_0x1cbb('0xc'),auth[_0x1cbb('0xa')](),controller[_0x1cbb('0xd')]);router[_0x1cbb('0xe')]('/',auth[_0x1cbb('0xa')](),controller[_0x1cbb('0xf')]);router[_0x1cbb('0x10')](_0x1cbb('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1cbb('0x11')]('/:id',auth[_0x1cbb('0xa')](),controller[_0x1cbb('0x12')]);module[_0x1cbb('0x13')]=router;
\ No newline at end of file
+var _0x044c=['/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index'];(function(_0x4b2887,_0x55bbe8){var _0x186e4a=function(_0x3f5304){while(--_0x3f5304){_0x4b2887['push'](_0x4b2887['shift']());}};_0x186e4a(++_0x55bbe8);}(_0x044c,0x89));var _0xc044=function(_0x152968,_0x31e0c9){_0x152968=_0x152968-0x0;var _0x2514cc=_0x044c[_0x152968];return _0x2514cc;};'use strict';var multer=require(_0xc044('0x0'));var util=require('util');var path=require(_0xc044('0x1'));var timeout=require('connect-timeout');var express=require(_0xc044('0x2'));var router=express[_0xc044('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc044('0x4'));var interaction=require(_0xc044('0x5'));var config=require(_0xc044('0x6'));var controller=require(_0xc044('0x7'));router[_0xc044('0x8')]('/',auth['isAuthenticated'](),controller[_0xc044('0x9')]);router[_0xc044('0x8')](_0xc044('0xa'),auth[_0xc044('0xb')](),controller['describe']);router[_0xc044('0x8')](_0xc044('0xc'),auth[_0xc044('0xb')](),controller[_0xc044('0xd')]);router[_0xc044('0xe')]('/',auth['isAuthenticated'](),controller[_0xc044('0xf')]);router[_0xc044('0x10')]('/:id',auth[_0xc044('0xb')](),controller[_0xc044('0x11')]);router[_0xc044('0x12')](_0xc044('0xc'),auth['isAuthenticated'](),controller[_0xc044('0x13')]);module[_0xc044('0x14')]=router;
\ No newline at end of file
index 1be9e43..7e0cbe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5309=['DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','INTEGER','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x5962a5,_0x474081){var _0x3a489a=function(_0x39fc18){while(--_0x39fc18){_0x5962a5['push'](_0x5962a5['shift']());}};_0x3a489a(++_0x474081);}(_0x5309,0x156));var _0x9530=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x5309[_0x58175c];return _0x55b88f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9530('0x0'));module['exports']={'channel':{'type':Sequelize[_0x9530('0x1')]},'membername':{'type':Sequelize[_0x9530('0x1')]},'interface':{'type':Sequelize[_0x9530('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x9530('0x2')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x9530('0x3')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x32a707){var _0xb720bc=moment(_0x32a707);var _0x78732=moment(this[_0x9530('0x4')](_0x9530('0x5')));var _0x3f3248=_0xb720bc[_0x9530('0x6')](_0x78732,_0x9530('0x7'));this['setDataValue']('exitAt',_0x32a707);this[_0x9530('0x8')](_0x9530('0x9'),_0x3f3248>=0x0?_0x3f3248:null);}},'data1':{'type':Sequelize[_0x9530('0x1')],'comment':_0x9530('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0x9530('0xb')},'data3':{'type':Sequelize[_0x9530('0x1')],'comment':_0x9530('0xc')},'data4':{'type':Sequelize[_0x9530('0x1')],'comment':_0x9530('0xd')},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x9530('0x1')]},'internal':{'type':Sequelize[_0x9530('0xe')]},'uniqueid':{'type':Sequelize[_0x9530('0x1')]}};
\ No newline at end of file
+var _0xce7b=['DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING'];(function(_0x48561b,_0x12aa79){var _0x1bf221=function(_0x47af03){while(--_0x47af03){_0x48561b['push'](_0x48561b['shift']());}};_0x1bf221(++_0x12aa79);}(_0xce7b,0x161));var _0xbce7=function(_0x3d082c,_0x44027c){_0x3d082c=_0x3d082c-0x0;var _0x479fe2=_0xce7b[_0x3d082c];return _0x479fe2;};'use strict';var Sequelize=require(_0xbce7('0x0'));var moment=require(_0xbce7('0x1'));module[_0xbce7('0x2')]={'channel':{'type':Sequelize[_0xbce7('0x3')]},'membername':{'type':Sequelize[_0xbce7('0x3')]},'interface':{'type':Sequelize[_0xbce7('0x3')]},'type':{'type':Sequelize[_0xbce7('0x3')],'defaultValue':_0xbce7('0x4'),'comment':_0xbce7('0x5')},'duration':{'type':Sequelize[_0xbce7('0x6')]},'enterAt':{'type':Sequelize[_0xbce7('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x43f86f){var _0xe7a902=moment(_0x43f86f);var _0x3ccc79=moment(this['getDataValue'](_0xbce7('0x8')));var _0x2cddb3=_0xe7a902[_0xbce7('0x9')](_0x3ccc79,_0xbce7('0xa'));this['setDataValue']('exitAt',_0x43f86f);this[_0xbce7('0xb')](_0xbce7('0xc'),_0x2cddb3>=0x0?_0x2cddb3:null);}},'data1':{'type':Sequelize[_0xbce7('0x3')],'comment':_0xbce7('0xd')},'data2':{'type':Sequelize[_0xbce7('0x3')],'comment':_0xbce7('0xe')},'data3':{'type':Sequelize[_0xbce7('0x3')],'comment':_0xbce7('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0xbce7('0x10')},'data5':{'type':Sequelize[_0xbce7('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xbce7('0x6')]},'uniqueid':{'type':Sequelize[_0xbce7('0x3')]}};
\ No newline at end of file
index 29faf95..f394724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['path','sox','to-csv','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/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x34e8,0x12c));var _0x834e=function(_0x1482e8,_0x1d8d4b){_0x1482e8=_0x1482e8-0x0;var _0x36d018=_0x34e8[_0x1482e8];return _0x36d018;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));};
\ No newline at end of file
+var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','MemberReport','fieldName','type','model','name','keys'];(function(_0x4e7019,_0x3beb18){var _0x4b49e7=function(_0x31bd02){while(--_0x31bd02){_0x4e7019['push'](_0x4e7019['shift']());}};_0x4b49e7(++_0x3beb18);}(_0x7217,0x19e));var _0x7721=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x7217[_0xbe200f];return _0x192597;};'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('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));};
\ No newline at end of file
index f2b3ea6..ffd7f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d6f=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface'];(function(_0x3ed41d,_0x4f3867){var _0x36d556=function(_0x322bbc){while(--_0x322bbc){_0x3ed41d['push'](_0x3ed41d['shift']());}};_0x36d556(++_0x4f3867);}(_0x6d6f,0xb6));var _0xf6d6=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x6d6f[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0xf6d6('0x0'));var util=require(_0xf6d6('0x1'));var logger=require(_0xf6d6('0x2'))('api');var moment=require(_0xf6d6('0x3'));var BPromise=require(_0xf6d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6d6('0x5'));var rimraf=require(_0xf6d6('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6d6('0x7'));module[_0xf6d6('0x8')]=function(_0x94f8e5,_0x5590a5){return _0x94f8e5['define'](_0xf6d6('0x9'),attributes,{'tableName':_0xf6d6('0xa'),'paranoid':![],'indexes':[{'name':_0xf6d6('0xb'),'fields':[_0xf6d6('0xc'),_0xf6d6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xed41=['define','report_member','membername','interface','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x2e9681,_0x3386e7){var _0x3d1c9f=function(_0x279ea7){while(--_0x279ea7){_0x2e9681['push'](_0x2e9681['shift']());}};_0x3d1c9f(++_0x3386e7);}(_0xed41,0x19a));var _0x1ed4=function(_0x23f845,_0x34b4f5){_0x23f845=_0x23f845-0x0;var _0x4cd3e5=_0xed41[_0x23f845];return _0x4cd3e5;};'use strict';var _=require(_0x1ed4('0x0'));var util=require(_0x1ed4('0x1'));var logger=require('../../config/logger')(_0x1ed4('0x2'));var moment=require('moment');var BPromise=require(_0x1ed4('0x3'));var rp=require(_0x1ed4('0x4'));var fs=require('fs');var path=require(_0x1ed4('0x5'));var rimraf=require(_0x1ed4('0x6'));var config=require(_0x1ed4('0x7'));var attributes=require(_0x1ed4('0x8'));module[_0x1ed4('0x9')]=function(_0x3e980a,_0xfb832c){return _0x3e980a[_0x1ed4('0xa')]('MemberReport',attributes,{'tableName':_0x1ed4('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x1ed4('0xc'),_0x1ed4('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index d991de2..eb0a14a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb091=['CreateMemberReport','create','UpdateMemberReport','MemberReport','update','body','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','map','model'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb091,0x16e));var _0x1b09=function(_0x35f731,_0x3c4364){_0x35f731=_0x35f731-0x0;var _0x12e917=_0xb091[_0x35f731];return _0x12e917;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bf4f6,_0x5ce726,_0x142c33){return new BPromise(function(_0x8c26a5,_0x2f359f){return client[_0x1b09('0x9')](_0x2bf4f6,_0x142c33)[_0x1b09('0xa')](function(_0x3362e4){logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));logger[_0x1b09('0xe')](_0x1b09('0xf'),_0x5ce726,'request\x20sent',JSON[_0x1b09('0x10')](_0x3362e4));if(_0x3362e4[_0x1b09('0x11')]){if(_0x3362e4['error']['code']===0x1f4){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);return _0x2f359f(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}logger[_0x1b09('0x11')]('MemberReport,\x20%s,\x20%s',_0x5ce726,_0x3362e4[_0x1b09('0x11')]['message']);return _0x8c26a5(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}else{logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));_0x8c26a5(_0x3362e4[_0x1b09('0x13')][_0x1b09('0x12')]);}})[_0x1b09('0x14')](function(_0x1196b2){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x1196b2);_0x2f359f(_0x1196b2);});});}exports[_0x1b09('0x15')]=function(_0x646575){var _0x4c64e1=this;return new Promise(function(_0x214c6b,_0x1c1ef9){return db['MemberReport']['findAll']({'raw':_0x646575[_0x1b09('0x16')]?_0x646575['options'][_0x1b09('0x17')]===undefined?!![]:![]:!![],'where':_0x646575['options']?_0x646575[_0x1b09('0x16')][_0x1b09('0x18')]||null:null,'attributes':_0x646575[_0x1b09('0x16')]?_0x646575[_0x1b09('0x16')][_0x1b09('0x19')]||null:null,'limit':_0x646575[_0x1b09('0x16')]?_0x646575[_0x1b09('0x16')][_0x1b09('0x1a')]||null:null,'include':_0x646575['options']?_0x646575['options'][_0x1b09('0x1b')]?_[_0x1b09('0x1c')](_0x646575['options'][_0x1b09('0x1b')],function(_0x11d0d5){return{'model':db[_0x11d0d5[_0x1b09('0x1d')]],'as':_0x11d0d5['as'],'attributes':_0x11d0d5[_0x1b09('0x19')],'include':_0x11d0d5['include']?_[_0x1b09('0x1c')](_0x11d0d5[_0x1b09('0x1b')],function(_0x4936d0){return{'model':db[_0x4936d0[_0x1b09('0x1d')]],'as':_0x4936d0['as'],'attributes':_0x4936d0[_0x1b09('0x19')],'include':_0x4936d0['include']?_[_0x1b09('0x1c')](_0x4936d0[_0x1b09('0x1b')],function(_0xa71272){return{'model':db[_0xa71272[_0x1b09('0x1d')]],'as':_0xa71272['as'],'attributes':_0xa71272['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b09('0xa')](function(_0x3cdbc5){logger['info'](_0x1b09('0x15'),_0x646575);logger[_0x1b09('0xe')](_0x1b09('0x15'),_0x646575,JSON[_0x1b09('0x10')](_0x3cdbc5));_0x214c6b(_0x3cdbc5);})[_0x1b09('0x14')](function(_0x1aa179){logger[_0x1b09('0x11')]('GetMemberReport',_0x1aa179[_0x1b09('0x12')],_0x646575);_0x1c1ef9(_0x4c64e1[_0x1b09('0x11')](0x1f4,_0x1aa179['message']));});});};exports[_0x1b09('0x1e')]=function(_0x1a6130){var _0x1b98da=this;return new Promise(function(_0x122b1c,_0x62a96b){return db['MemberReport'][_0x1b09('0x1f')](_0x1a6130['body'],{'raw':_0x1a6130[_0x1b09('0x16')]?_0x1a6130['options'][_0x1b09('0x17')]===undefined?!![]:![]:!![]})[_0x1b09('0xa')](function(_0x381e76){logger[_0x1b09('0xb')](_0x1b09('0x1e'),_0x1a6130);logger[_0x1b09('0xe')](_0x1b09('0x1e'),_0x1a6130,JSON[_0x1b09('0x10')](_0x381e76));_0x122b1c(_0x381e76);})[_0x1b09('0x14')](function(_0x33bca2){logger['error'](_0x1b09('0x1e'),_0x33bca2[_0x1b09('0x12')],_0x1a6130);_0x62a96b(_0x1b98da[_0x1b09('0x11')](0x1f4,_0x33bca2['message']));});});};exports[_0x1b09('0x20')]=function(_0x339b66){var _0x4662d6=this;return new Promise(function(_0x3ce2a9,_0x12a720){return db[_0x1b09('0x21')][_0x1b09('0x22')](_0x339b66[_0x1b09('0x23')],{'raw':_0x339b66['options']?_0x339b66[_0x1b09('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x339b66[_0x1b09('0x16')]?_0x339b66['options'][_0x1b09('0x18')]||null:null,'attributes':_0x339b66[_0x1b09('0x16')]?_0x339b66[_0x1b09('0x16')][_0x1b09('0x19')]||null:null,'limit':_0x339b66[_0x1b09('0x16')]?_0x339b66[_0x1b09('0x16')][_0x1b09('0x1a')]||null:null})[_0x1b09('0xa')](function(_0x43032f){logger[_0x1b09('0xb')](_0x1b09('0x20'),_0x339b66);logger[_0x1b09('0xe')](_0x1b09('0x20'),_0x339b66,JSON['stringify'](_0x43032f));_0x3ce2a9(_0x43032f);})['catch'](function(_0x23ce9a){logger[_0x1b09('0x11')](_0x1b09('0x20'),_0x23ce9a[_0x1b09('0x12')],_0x339b66);_0x12a720(_0x4662d6[_0x1b09('0x11')](0x1f4,_0x23ce9a[_0x1b09('0x12')]));});});};
\ No newline at end of file
+var _0x8ace=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','attributes','limit','include','map','model','then','CreateMemberReport','body','raw','UpdateMemberReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3689fb,_0xdf07c5){var _0x149f80=function(_0x1b7a2c){while(--_0x1b7a2c){_0x3689fb['push'](_0x3689fb['shift']());}};_0x149f80(++_0xdf07c5);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x1d0343,_0x472470){_0x1d0343=_0x1d0343-0x0;var _0xeba613=_0x8ace[_0x1d0343];return _0xeba613;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('MemberReport,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});}exports[_0xe8ac('0x19')]=function(_0x36759c){var _0x4892d0=this;return new Promise(function(_0x59df3d,_0x5f3433){return db[_0xe8ac('0x1a')][_0xe8ac('0x1b')]({'raw':_0x36759c['options']?_0x36759c[_0xe8ac('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x36759c[_0xe8ac('0x1c')]?_0x36759c[_0xe8ac('0x1c')]['where']||null:null,'attributes':_0x36759c[_0xe8ac('0x1c')]?_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1d')]||null:null,'limit':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1e')]||null:null,'include':_0x36759c['options']?_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1f')]?_[_0xe8ac('0x20')](_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1f')],function(_0x31956a){return{'model':db[_0x31956a[_0xe8ac('0x21')]],'as':_0x31956a['as'],'attributes':_0x31956a['attributes'],'include':_0x31956a[_0xe8ac('0x1f')]?_[_0xe8ac('0x20')](_0x31956a[_0xe8ac('0x1f')],function(_0x7c3450){return{'model':db[_0x7c3450[_0xe8ac('0x21')]],'as':_0x7c3450['as'],'attributes':_0x7c3450[_0xe8ac('0x1d')],'include':_0x7c3450[_0xe8ac('0x1f')]?_[_0xe8ac('0x20')](_0x7c3450[_0xe8ac('0x1f')],function(_0x562e44){return{'model':db[_0x562e44['model']],'as':_0x562e44['as'],'attributes':_0x562e44[_0xe8ac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe8ac('0x22')](function(_0x59512c){logger[_0xe8ac('0xf')](_0xe8ac('0x19'),_0x36759c);logger['debug']('GetMemberReport',_0x36759c,JSON[_0xe8ac('0x14')](_0x59512c));_0x59df3d(_0x59512c);})[_0xe8ac('0x18')](function(_0x3798c5){logger[_0xe8ac('0x15')](_0xe8ac('0x19'),_0x3798c5[_0xe8ac('0x16')],_0x36759c);_0x5f3433(_0x4892d0[_0xe8ac('0x15')](0x1f4,_0x3798c5['message']));});});};exports[_0xe8ac('0x23')]=function(_0x5459e5){var _0x2aef04=this;return new Promise(function(_0x5c4089,_0x498427){return db['MemberReport']['create'](_0x5459e5[_0xe8ac('0x24')],{'raw':_0x5459e5[_0xe8ac('0x1c')]?_0x5459e5[_0xe8ac('0x1c')][_0xe8ac('0x25')]===undefined?!![]:![]:!![]})[_0xe8ac('0x22')](function(_0xce819c){logger[_0xe8ac('0xf')]('CreateMemberReport',_0x5459e5);logger[_0xe8ac('0x12')]('CreateMemberReport',_0x5459e5,JSON['stringify'](_0xce819c));_0x5c4089(_0xce819c);})['catch'](function(_0x8a4478){logger[_0xe8ac('0x15')](_0xe8ac('0x23'),_0x8a4478['message'],_0x5459e5);_0x498427(_0x2aef04['error'](0x1f4,_0x8a4478[_0xe8ac('0x16')]));});});};exports[_0xe8ac('0x26')]=function(_0x307f67){var _0x2850a7=this;return new Promise(function(_0x54605b,_0x194e17){return db[_0xe8ac('0x1a')][_0xe8ac('0x27')](_0x307f67[_0xe8ac('0x24')],{'raw':_0x307f67[_0xe8ac('0x1c')]?_0x307f67[_0xe8ac('0x1c')][_0xe8ac('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x307f67['options']?_0x307f67[_0xe8ac('0x1c')][_0xe8ac('0x28')]||null:null,'attributes':_0x307f67['options']?_0x307f67[_0xe8ac('0x1c')][_0xe8ac('0x1d')]||null:null,'limit':_0x307f67[_0xe8ac('0x1c')]?_0x307f67[_0xe8ac('0x1c')]['limit']||null:null})[_0xe8ac('0x22')](function(_0x5e63b3){logger['info'](_0xe8ac('0x26'),_0x307f67);logger[_0xe8ac('0x12')](_0xe8ac('0x26'),_0x307f67,JSON[_0xe8ac('0x14')](_0x5e63b3));_0x54605b(_0x5e63b3);})[_0xe8ac('0x18')](function(_0x22d90b){logger[_0xe8ac('0x15')](_0xe8ac('0x26'),_0x22d90b[_0xe8ac('0x16')],_0x307f67);_0x194e17(_0x2850a7['error'](0x1f4,_0x22d90b['message']));});});};
\ No newline at end of file
index 13d4fac..913992d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x714a=['../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','util','connect-timeout','express','Router'];(function(_0x126539,_0x2e58e3){var _0x28d7bd=function(_0x531c0b){while(--_0x531c0b){_0x126539['push'](_0x126539['shift']());}};_0x28d7bd(++_0x2e58e3);}(_0x714a,0xd8));var _0xa714=function(_0x3477e7,_0x3e29ba){_0x3477e7=_0x3477e7-0x0;var _0x53cb48=_0x714a[_0x3477e7];return _0x53cb48;};'use strict';var multer=require('multer');var util=require(_0xa714('0x0'));var path=require('path');var timeout=require(_0xa714('0x1'));var express=require(_0xa714('0x2'));var router=express[_0xa714('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa714('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa714('0x5'));var controller=require(_0xa714('0x6'));router[_0xa714('0x7')]('/',controller[_0xa714('0x8')]);module[_0xa714('0x9')]=router;
\ No newline at end of file
+var _0xcfeb=['../../components/interaction/service','get','index','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x5372bb,_0x3ec135){var _0x30f8b5=function(_0x54678b){while(--_0x54678b){_0x5372bb['push'](_0x5372bb['shift']());}};_0x30f8b5(++_0x3ec135);}(_0xcfeb,0x1b2));var _0xbcfe=function(_0x3a8704,_0x5e5d87){_0x3a8704=_0x3a8704-0x0;var _0x5b119d=_0xcfeb[_0x3a8704];return _0x5b119d;};'use strict';var multer=require(_0xbcfe('0x0'));var util=require(_0xbcfe('0x1'));var path=require(_0xbcfe('0x2'));var timeout=require(_0xbcfe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbcfe('0x4'));var auth=require(_0xbcfe('0x5'));var interaction=require(_0xbcfe('0x6'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0xbcfe('0x7')]('/',controller[_0xbcfe('0x8')]);module[_0xbcfe('0x9')]=router;
\ No newline at end of file
index e605477..2b5150a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9cf=['STRING','version','exports'];(function(_0x333a7a,_0x13734f){var _0x332efd=function(_0x54f812){while(--_0x54f812){_0x333a7a['push'](_0x333a7a['shift']());}};_0x332efd(++_0x13734f);}(_0xe9cf,0x12b));var _0xfe9c=function(_0x29c6fc,_0x462633){_0x29c6fc=_0x29c6fc-0x0;var _0x1406ab=_0xe9cf[_0x29c6fc];return _0x1406ab;};'use strict';var Sequelize=require('sequelize');module[_0xfe9c('0x0')]={'version':{'type':Sequelize[_0xfe9c('0x1')],'unique':_0xfe9c('0x2')}};
\ No newline at end of file
+var _0x1cab=['STRING','version','sequelize','exports'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0x1cab,0x1b6));var _0xb1ca=function(_0x531ae4,_0x5705c5){_0x531ae4=_0x531ae4-0x0;var _0x2affd0=_0x1cab[_0x531ae4];return _0x2affd0;};'use strict';var Sequelize=require(_0xb1ca('0x0'));module[_0xb1ca('0x1')]={'version':{'type':Sequelize[_0xb1ca('0x2')],'unique':_0xb1ca('0x3')}};
\ No newline at end of file
index 3042065..25bef15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9365=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','index','Migration','type','key','map','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','include','findAll','rows','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x171a21,_0x3c9a2c){var _0x2ceb6e=function(_0x353ccd){while(--_0x353ccd){_0x171a21['push'](_0x171a21['shift']());}};_0x2ceb6e(++_0x3c9a2c);}(_0x9365,0xe9));var _0x5936=function(_0x4c70c4,_0x963969){_0x4c70c4=_0x4c70c4-0x0;var _0x437865=_0x9365[_0x4c70c4];return _0x437865;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5936('0x0'));var zipdir=require(_0x5936('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5936('0x2'));var moment=require(_0x5936('0x3'));var BPromise=require(_0x5936('0x4'));var Mustache=require('mustache');var util=require(_0x5936('0x5'));var path=require('path');var sox=require(_0x5936('0x6'));var csv=require(_0x5936('0x7'));var ejs=require(_0x5936('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5936('0x9'));var squel=require('squel');var crypto=require(_0x5936('0xa'));var jsforce=require(_0x5936('0xb'));var deskjs=require(_0x5936('0xc'));var toCsv=require(_0x5936('0x7'));var querystring=require(_0x5936('0xd'));var Papa=require(_0x5936('0xe'));var Redis=require(_0x5936('0xf'));var authService=require(_0x5936('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5936('0x11'));var hardwareService=require(_0x5936('0x12'));var logger=require(_0x5936('0x13'))(_0x5936('0x14'));var utils=require('../../config/utils');var config=require(_0x5936('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5936('0x16'))['db'];function respondWithStatusCode(_0x15b74d,_0x375d99){_0x375d99=_0x375d99||0xcc;return function(_0x33bca7){if(_0x33bca7){return _0x15b74d[_0x5936('0x17')](_0x375d99);}return _0x15b74d['status'](_0x375d99)[_0x5936('0x18')]();};}function respondWithResult(_0xf2ae2d,_0x292850){_0x292850=_0x292850||0xc8;return function(_0x3dbcd7){if(_0x3dbcd7){return _0xf2ae2d['status'](_0x292850)[_0x5936('0x19')](_0x3dbcd7);}};}function respondWithFilteredResult(_0x52a180,_0x32eef7){return function(_0x425490){if(_0x425490){var _0x34eb9c=typeof _0x32eef7['offset']===_0x5936('0x1a')&&typeof _0x32eef7['limit']===_0x5936('0x1a');var _0x4e52a1=_0x425490[_0x5936('0x1b')];var _0x4b7ab8=_0x34eb9c?0x0:_0x32eef7[_0x5936('0x1c')];var _0x1fd316=_0x34eb9c?_0x425490[_0x5936('0x1b')]:_0x32eef7['offset']+_0x32eef7[_0x5936('0x1d')];var _0x4de110;if(_0x1fd316>=_0x4e52a1){_0x1fd316=_0x4e52a1;_0x4de110=0xc8;}else{_0x4de110=0xce;}_0x52a180['status'](_0x4de110);return _0x52a180['set'](_0x5936('0x1e'),_0x4b7ab8+'-'+_0x1fd316+'/'+_0x4e52a1)[_0x5936('0x19')](_0x425490);}return null;};}function patchUpdates(_0x451b07){return function(_0x22e2d9){try{jsonpatch[_0x5936('0x1f')](_0x22e2d9,_0x451b07,!![]);}catch(_0x2fcafc){return BPromise[_0x5936('0x20')](_0x2fcafc);}return _0x22e2d9[_0x5936('0x21')]();};}function saveUpdates(_0x16d179,_0x4f3c21){return function(_0x2dd27f){if(_0x2dd27f){return _0x2dd27f[_0x5936('0x22')](_0x16d179)[_0x5936('0x23')](function(_0x54a03c){return _0x54a03c;});}return null;};}function removeEntity(_0x44fb55,_0x469994){return function(_0x4bc38f){if(_0x4bc38f){return _0x4bc38f['destroy']()['then'](function(){_0x44fb55['status'](0xcc)[_0x5936('0x18')]();});}};}function handleEntityNotFound(_0x40bb91,_0xd1410){return function(_0x24cb8a){if(!_0x24cb8a){_0x40bb91[_0x5936('0x17')](0x194);}return _0x24cb8a;};}function handleError(_0x1f0a53,_0x925f09){_0x925f09=_0x925f09||0x1f4;return function(_0x5d1051){logger[_0x5936('0x24')](_0x5d1051[_0x5936('0x25')]);if(_0x5d1051[_0x5936('0x26')]){delete _0x5d1051['name'];}_0x1f0a53['status'](_0x925f09)['send'](_0x5d1051);};}exports[_0x5936('0x27')]=function(_0x57b928,_0x5cd02a){var _0x420d2f={},_0x468bcf={},_0x3c032d={'count':0x0,'rows':[]};var _0x3a9b85=_['map'](db[_0x5936('0x28')]['rawAttributes'],function(_0x903815){return{'name':_0x903815['fieldName'],'type':_0x903815[_0x5936('0x29')][_0x5936('0x2a')]};});_0x468bcf['model']=_[_0x5936('0x2b')](_0x3a9b85,'name');_0x468bcf['query']=_[_0x5936('0x2c')](_0x57b928[_0x5936('0x2d')]);_0x468bcf['filters']=_[_0x5936('0x2e')](_0x468bcf['model'],_0x468bcf['query']);_0x420d2f['attributes']=_[_0x5936('0x2e')](_0x468bcf[_0x5936('0x2f')],qs[_0x5936('0x30')](_0x57b928[_0x5936('0x2d')][_0x5936('0x30')]));_0x420d2f['attributes']=_0x420d2f[_0x5936('0x31')]['length']?_0x420d2f[_0x5936('0x31')]:_0x468bcf['model'];if(!_0x57b928[_0x5936('0x2d')][_0x5936('0x32')](_0x5936('0x33'))){_0x420d2f[_0x5936('0x1d')]=qs['limit'](_0x57b928[_0x5936('0x2d')]['limit']);_0x420d2f[_0x5936('0x1c')]=qs[_0x5936('0x1c')](_0x57b928['query'][_0x5936('0x1c')]);}_0x420d2f[_0x5936('0x34')]=qs['sort'](_0x57b928[_0x5936('0x2d')][_0x5936('0x35')]);_0x420d2f[_0x5936('0x36')]=qs['filters'](_[_0x5936('0x37')](_0x57b928[_0x5936('0x2d')],_0x468bcf[_0x5936('0x38')]),_0x3a9b85);if(_0x57b928[_0x5936('0x2d')][_0x5936('0x39')]){_0x420d2f[_0x5936('0x36')]=_[_0x5936('0x3a')](_0x420d2f['where'],{'$or':_['map'](_0x3a9b85,function(_0x2aa276){if(_0x2aa276['type']!=='VIRTUAL'){var _0x4a2de5={};_0x4a2de5[_0x2aa276['name']]={'$like':'%'+_0x57b928[_0x5936('0x2d')][_0x5936('0x39')]+'%'};return _0x4a2de5;}})});}_0x420d2f=_[_0x5936('0x3a')]({},_0x420d2f,_0x57b928[_0x5936('0x3b')]);var _0x275f49={'where':_0x420d2f[_0x5936('0x36')]};return db['Migration'][_0x5936('0x1b')](_0x275f49)[_0x5936('0x23')](function(_0x101135){_0x3c032d[_0x5936('0x1b')]=_0x101135;if(_0x57b928['query']['includeAll']){_0x420d2f[_0x5936('0x3c')]=[{'all':!![]}];}return db[_0x5936('0x28')][_0x5936('0x3d')](_0x420d2f);})[_0x5936('0x23')](function(_0x47eb35){_0x3c032d[_0x5936('0x3e')]=_0x47eb35;return _0x3c032d;})[_0x5936('0x23')](respondWithFilteredResult(_0x5cd02a,_0x420d2f))['catch'](handleError(_0x5cd02a,null));};
\ No newline at end of file
+var _0xed63=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Migration','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','VIRTUAL','merge','options','includeAll','include','rows','catch','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/auth/service'];(function(_0x2fc8ca,_0x4c4aad){var _0x41b7b7=function(_0x56e4df){while(--_0x56e4df){_0x2fc8ca['push'](_0x2fc8ca['shift']());}};_0x41b7b7(++_0x4c4aad);}(_0xed63,0x138));var _0x3ed6=function(_0x3eb7c8,_0x47ee58){_0x3eb7c8=_0x3eb7c8-0x0;var _0x593510=_0xed63[_0x3eb7c8];return _0x593510;};'use strict';var emlformat=require(_0x3ed6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ed6('0x1'));var jsonpatch=require(_0x3ed6('0x2'));var rp=require('request-promise');var moment=require(_0x3ed6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3ed6('0x4'));var path=require('path');var sox=require(_0x3ed6('0x5'));var csv=require(_0x3ed6('0x6'));var ejs=require(_0x3ed6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3ed6('0x8'));var crypto=require(_0x3ed6('0x9'));var jsforce=require(_0x3ed6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3ed6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3ed6('0xb'));var authService=require(_0x3ed6('0xc'));var qs=require(_0x3ed6('0xd'));var as=require(_0x3ed6('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ed6('0xf'))(_0x3ed6('0x10'));var utils=require(_0x3ed6('0x11'));var config=require(_0x3ed6('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ed6('0x13'))['db'];function respondWithStatusCode(_0x492261,_0x2ac8cf){_0x2ac8cf=_0x2ac8cf||0xcc;return function(_0x9c66be){if(_0x9c66be){return _0x492261[_0x3ed6('0x14')](_0x2ac8cf);}return _0x492261[_0x3ed6('0x15')](_0x2ac8cf)[_0x3ed6('0x16')]();};}function respondWithResult(_0x45db22,_0x1c140d){_0x1c140d=_0x1c140d||0xc8;return function(_0x55dc8a){if(_0x55dc8a){return _0x45db22['status'](_0x1c140d)[_0x3ed6('0x17')](_0x55dc8a);}};}function respondWithFilteredResult(_0x24ad89,_0x1973bd){return function(_0x3476a9){if(_0x3476a9){var _0x1e4401=typeof _0x1973bd['offset']===_0x3ed6('0x18')&&typeof _0x1973bd['limit']===_0x3ed6('0x18');var _0x46d5b6=_0x3476a9[_0x3ed6('0x19')];var _0x25a2f6=_0x1e4401?0x0:_0x1973bd[_0x3ed6('0x1a')];var _0x205bd1=_0x1e4401?_0x3476a9['count']:_0x1973bd[_0x3ed6('0x1a')]+_0x1973bd[_0x3ed6('0x1b')];var _0x10f59b;if(_0x205bd1>=_0x46d5b6){_0x205bd1=_0x46d5b6;_0x10f59b=0xc8;}else{_0x10f59b=0xce;}_0x24ad89['status'](_0x10f59b);return _0x24ad89[_0x3ed6('0x1c')](_0x3ed6('0x1d'),_0x25a2f6+'-'+_0x205bd1+'/'+_0x46d5b6)[_0x3ed6('0x17')](_0x3476a9);}return null;};}function patchUpdates(_0x276626){return function(_0x1daf3a){try{jsonpatch[_0x3ed6('0x1e')](_0x1daf3a,_0x276626,!![]);}catch(_0x8b3359){return BPromise[_0x3ed6('0x1f')](_0x8b3359);}return _0x1daf3a[_0x3ed6('0x20')]();};}function saveUpdates(_0x32a82e,_0x3a93f6){return function(_0xeb38e1){if(_0xeb38e1){return _0xeb38e1[_0x3ed6('0x21')](_0x32a82e)[_0x3ed6('0x22')](function(_0x143de1){return _0x143de1;});}return null;};}function removeEntity(_0x2e657f,_0x201683){return function(_0x56ac56){if(_0x56ac56){return _0x56ac56[_0x3ed6('0x23')]()[_0x3ed6('0x22')](function(){_0x2e657f[_0x3ed6('0x15')](0xcc)[_0x3ed6('0x16')]();});}};}function handleEntityNotFound(_0x5abd88,_0x3aec37){return function(_0x526cdd){if(!_0x526cdd){_0x5abd88[_0x3ed6('0x14')](0x194);}return _0x526cdd;};}function handleError(_0x49068c,_0x5cf1bf){_0x5cf1bf=_0x5cf1bf||0x1f4;return function(_0x5ad40a){logger[_0x3ed6('0x24')](_0x5ad40a[_0x3ed6('0x25')]);if(_0x5ad40a[_0x3ed6('0x26')]){delete _0x5ad40a['name'];}_0x49068c[_0x3ed6('0x15')](_0x5cf1bf)[_0x3ed6('0x27')](_0x5ad40a);};}exports[_0x3ed6('0x28')]=function(_0xdfd0b,_0x52cd07){var _0x44a86f={},_0x3a885a={},_0x331cd6={'count':0x0,'rows':[]};var _0xbddf9d=_['map'](db[_0x3ed6('0x29')][_0x3ed6('0x2a')],function(_0x20b7b7){return{'name':_0x20b7b7[_0x3ed6('0x2b')],'type':_0x20b7b7[_0x3ed6('0x2c')][_0x3ed6('0x2d')]};});_0x3a885a[_0x3ed6('0x2e')]=_[_0x3ed6('0x2f')](_0xbddf9d,_0x3ed6('0x26'));_0x3a885a['query']=_[_0x3ed6('0x30')](_0xdfd0b[_0x3ed6('0x31')]);_0x3a885a['filters']=_[_0x3ed6('0x32')](_0x3a885a[_0x3ed6('0x2e')],_0x3a885a['query']);_0x44a86f[_0x3ed6('0x33')]=_[_0x3ed6('0x32')](_0x3a885a[_0x3ed6('0x2e')],qs[_0x3ed6('0x34')](_0xdfd0b[_0x3ed6('0x31')]['fields']));_0x44a86f[_0x3ed6('0x33')]=_0x44a86f[_0x3ed6('0x33')][_0x3ed6('0x35')]?_0x44a86f[_0x3ed6('0x33')]:_0x3a885a['model'];if(!_0xdfd0b[_0x3ed6('0x31')]['hasOwnProperty'](_0x3ed6('0x36'))){_0x44a86f['limit']=qs[_0x3ed6('0x1b')](_0xdfd0b[_0x3ed6('0x31')][_0x3ed6('0x1b')]);_0x44a86f[_0x3ed6('0x1a')]=qs[_0x3ed6('0x1a')](_0xdfd0b[_0x3ed6('0x31')]['offset']);}_0x44a86f['order']=qs[_0x3ed6('0x37')](_0xdfd0b[_0x3ed6('0x31')][_0x3ed6('0x37')]);_0x44a86f[_0x3ed6('0x38')]=qs[_0x3ed6('0x39')](_['pick'](_0xdfd0b['query'],_0x3a885a[_0x3ed6('0x39')]),_0xbddf9d);if(_0xdfd0b[_0x3ed6('0x31')]['filter']){_0x44a86f[_0x3ed6('0x38')]=_['merge'](_0x44a86f[_0x3ed6('0x38')],{'$or':_[_0x3ed6('0x2f')](_0xbddf9d,function(_0x500227){if(_0x500227[_0x3ed6('0x2c')]!==_0x3ed6('0x3a')){var _0x2386c5={};_0x2386c5[_0x500227[_0x3ed6('0x26')]]={'$like':'%'+_0xdfd0b[_0x3ed6('0x31')]['filter']+'%'};return _0x2386c5;}})});}_0x44a86f=_[_0x3ed6('0x3b')]({},_0x44a86f,_0xdfd0b[_0x3ed6('0x3c')]);var _0x24386b={'where':_0x44a86f[_0x3ed6('0x38')]};return db['Migration'][_0x3ed6('0x19')](_0x24386b)[_0x3ed6('0x22')](function(_0x3a4d81){_0x331cd6[_0x3ed6('0x19')]=_0x3a4d81;if(_0xdfd0b[_0x3ed6('0x31')][_0x3ed6('0x3d')]){_0x44a86f[_0x3ed6('0x3e')]=[{'all':!![]}];}return db[_0x3ed6('0x29')]['findAll'](_0x44a86f);})[_0x3ed6('0x22')](function(_0x30972f){_0x331cd6[_0x3ed6('0x3f')]=_0x30972f;return _0x331cd6;})['then'](respondWithFilteredResult(_0x52cd07,_0x44a86f))[_0x3ed6('0x40')](handleError(_0x52cd07,null));};
\ No newline at end of file
index 57dcd46..ceb6457 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9279=['migrations','lodash','util','moment','bluebird','request-promise','path','../../config/environment','exports','define','Migration'];(function(_0x31f220,_0x3dd8fb){var _0x6547c4=function(_0x29e958){while(--_0x29e958){_0x31f220['push'](_0x31f220['shift']());}};_0x6547c4(++_0x3dd8fb);}(_0x9279,0x18d));var _0x9927=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x9279[_0x4e11d5];return _0x5e4e4c;};'use strict';var _=require(_0x9927('0x0'));var util=require(_0x9927('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9927('0x2'));var BPromise=require(_0x9927('0x3'));var rp=require(_0x9927('0x4'));var fs=require('fs');var path=require(_0x9927('0x5'));var rimraf=require('rimraf');var config=require(_0x9927('0x6'));var attributes=require('./migration.attributes');module[_0x9927('0x7')]=function(_0x433a7e,_0x45d9db){return _0x433a7e[_0x9927('0x8')](_0x9927('0x9'),attributes,{'tableName':_0x9927('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe786=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','define','migrations','lodash'];(function(_0x5e25f1,_0x537d76){var _0x4b5b4d=function(_0x59e481){while(--_0x59e481){_0x5e25f1['push'](_0x5e25f1['shift']());}};_0x4b5b4d(++_0x537d76);}(_0xe786,0xfb));var _0x6e78=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xe786[_0xe4d6c6];return _0x3a8935;};'use strict';var _=require(_0x6e78('0x0'));var util=require(_0x6e78('0x1'));var logger=require(_0x6e78('0x2'))(_0x6e78('0x3'));var moment=require(_0x6e78('0x4'));var BPromise=require(_0x6e78('0x5'));var rp=require(_0x6e78('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e78('0x7'));var config=require(_0x6e78('0x8'));var attributes=require(_0x6e78('0x9'));module['exports']=function(_0x162c76,_0x22ebcf){return _0x162c76[_0x6e78('0xa')]('Migration',attributes,{'tableName':_0x6e78('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7a8214d..9c26db5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3308=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x33528e,_0x1aa826){var _0x4664b9=function(_0x10e7f3){while(--_0x10e7f3){_0x33528e['push'](_0x33528e['shift']());}};_0x4664b9(++_0x1aa826);}(_0x3308,0x160));var _0x8330=function(_0x490cc2,_0x57cd3f){_0x490cc2=_0x490cc2-0x0;var _0x3b35f6=_0x3308[_0x490cc2];return _0x3b35f6;};'use strict';var _=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var moment=require(_0x8330('0x2'));var BPromise=require(_0x8330('0x3'));var rs=require(_0x8330('0x4'));var fs=require('fs');var Redis=require(_0x8330('0x5'));var db=require(_0x8330('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8330('0x7'));var config=require('../../config/environment');var jayson=require(_0x8330('0x8'));var client=jayson[_0x8330('0x9')][_0x8330('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59c19e,_0x413cac,_0x1d5fd6){return new BPromise(function(_0x1244a7,_0x2dcc17){return client[_0x8330('0xb')](_0x59c19e,_0x1d5fd6)[_0x8330('0xc')](function(_0x4f917e){logger[_0x8330('0xd')](_0x8330('0xe'),_0x413cac,_0x8330('0xf'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x413cac,'request\x20sent',JSON['stringify'](_0x4f917e));if(_0x4f917e['error']){if(_0x4f917e['error'][_0x8330('0x10')]===0x1f4){logger['error'](_0x8330('0xe'),_0x413cac,_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);return _0x2dcc17(_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);}logger['error'](_0x8330('0xe'),_0x413cac,_0x4f917e['error'][_0x8330('0x12')]);return _0x1244a7(_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);}else{logger[_0x8330('0xd')](_0x8330('0xe'),_0x413cac,_0x8330('0xf'));_0x1244a7(_0x4f917e[_0x8330('0x13')][_0x8330('0x12')]);}})[_0x8330('0x14')](function(_0x4d9662){logger[_0x8330('0x11')](_0x8330('0xe'),_0x413cac,_0x4d9662);_0x2dcc17(_0x4d9662);});});}
\ No newline at end of file
+var _0xbd20=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','info','result','catch'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xbd20,0x14a));var _0x0bd2=function(_0x583e98,_0x5534f5){_0x583e98=_0x583e98-0x0;var _0x84cc30=_0xbd20[_0x583e98];return _0x84cc30;};'use strict';var _=require(_0x0bd2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0bd2('0x1'));var rs=require(_0x0bd2('0x2'));var fs=require('fs');var Redis=require(_0x0bd2('0x3'));var db=require(_0x0bd2('0x4'))['db'];var utils=require(_0x0bd2('0x5'));var logger=require('../../config/logger')(_0x0bd2('0x6'));var config=require(_0x0bd2('0x7'));var jayson=require(_0x0bd2('0x8'));var client=jayson['client'][_0x0bd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45b631,_0x57f5a7,_0x57dc02){return new BPromise(function(_0x377853,_0x29335c){return client[_0x0bd2('0xa')](_0x45b631,_0x57dc02)[_0x0bd2('0xb')](function(_0x473068){logger['info']('Migration,\x20%s,\x20%s',_0x57f5a7,_0x0bd2('0xc'));logger[_0x0bd2('0xd')](_0x0bd2('0xe'),_0x57f5a7,_0x0bd2('0xc'),JSON[_0x0bd2('0xf')](_0x473068));if(_0x473068['error']){if(_0x473068[_0x0bd2('0x10')]['code']===0x1f4){logger[_0x0bd2('0x10')](_0x0bd2('0x11'),_0x57f5a7,_0x473068['error']['message']);return _0x29335c(_0x473068[_0x0bd2('0x10')][_0x0bd2('0x12')]);}logger[_0x0bd2('0x10')](_0x0bd2('0x11'),_0x57f5a7,_0x473068[_0x0bd2('0x10')]['message']);return _0x377853(_0x473068['error'][_0x0bd2('0x12')]);}else{logger[_0x0bd2('0x13')]('Migration,\x20%s,\x20%s',_0x57f5a7,_0x0bd2('0xc'));_0x377853(_0x473068[_0x0bd2('0x14')][_0x0bd2('0x12')]);}})[_0x0bd2('0x15')](function(_0x3baf2e){logger[_0x0bd2('0x10')](_0x0bd2('0x11'),_0x57f5a7,_0x3baf2e);_0x29335c(_0x3baf2e);});});}
\ No newline at end of file
index af4213b..857e124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a5e=['./network.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x163742,_0x467e36){var _0x1152ac=function(_0x40a83d){while(--_0x40a83d){_0x163742['push'](_0x163742['shift']());}};_0x1152ac(++_0x467e36);}(_0x9a5e,0xee));var _0xe9a5=function(_0x7989b3,_0x2a140a){_0x7989b3=_0x7989b3-0x0;var _0x38e397=_0x9a5e[_0x7989b3];return _0x38e397;};'use strict';var multer=require(_0xe9a5('0x0'));var util=require(_0xe9a5('0x1'));var path=require(_0xe9a5('0x2'));var timeout=require(_0xe9a5('0x3'));var express=require(_0xe9a5('0x4'));var router=express[_0xe9a5('0x5')]();var fs_extra=require(_0xe9a5('0x6'));var auth=require(_0xe9a5('0x7'));var interaction=require(_0xe9a5('0x8'));var config=require('../../config/environment');var controller=require(_0xe9a5('0x9'));router[_0xe9a5('0xa')]('/',auth[_0xe9a5('0xb')](),controller['index']);router['get'](_0xe9a5('0xc'),auth['isAuthenticated'](),controller[_0xe9a5('0xd')]);router['post']('/',auth[_0xe9a5('0xb')](),controller[_0xe9a5('0xe')]);router[_0xe9a5('0xf')](_0xe9a5('0xc'),auth['isAuthenticated'](),controller[_0xe9a5('0x10')]);router[_0xe9a5('0x11')](_0xe9a5('0xc'),auth['isAuthenticated'](),controller[_0xe9a5('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x6197=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x238285,_0x196e21){var _0x368180=function(_0x8208c1){while(--_0x8208c1){_0x238285['push'](_0x238285['shift']());}};_0x368180(++_0x196e21);}(_0x6197,0x142));var _0x7619=function(_0x46f91c,_0x2fe23e){_0x46f91c=_0x46f91c-0x0;var _0x5645e1=_0x6197[_0x46f91c];return _0x5645e1;};'use strict';var multer=require(_0x7619('0x0'));var util=require('util');var path=require(_0x7619('0x1'));var timeout=require('connect-timeout');var express=require(_0x7619('0x2'));var router=express[_0x7619('0x3')]();var fs_extra=require(_0x7619('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7619('0x5'));var config=require(_0x7619('0x6'));var controller=require(_0x7619('0x7'));router[_0x7619('0x8')]('/',auth[_0x7619('0x9')](),controller[_0x7619('0xa')]);router[_0x7619('0x8')](_0x7619('0xb'),auth[_0x7619('0x9')](),controller[_0x7619('0xc')]);router[_0x7619('0xd')]('/',auth[_0x7619('0x9')](),controller[_0x7619('0xe')]);router[_0x7619('0xf')](_0x7619('0xb'),auth['isAuthenticated'](),controller[_0x7619('0x10')]);router[_0x7619('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7619('0x12')]);module[_0x7619('0x13')]=router;
\ No newline at end of file
index 9743e85..66fa040 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9e9=['sequelize','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0xc9e9,0xd2));var _0x9c9e=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0xc9e9[_0x5959c9];return _0x4ffcbc;};'use strict';var Sequelize=require(_0x9c9e('0x0'));module['exports']={'type':{'type':Sequelize[_0x9c9e('0x1')](_0x9c9e('0x2'),_0x9c9e('0x3'),_0x9c9e('0x4'),_0x9c9e('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9c9e('0x6')]},'password':{'type':Sequelize[_0x9c9e('0x6')]}};
\ No newline at end of file
+var _0xa5cc=['exports','localnet','externip','turn','STRING'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xa5cc,0x177));var _0xca5c=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xa5cc[_0x411017];return _0x2adeea;};'use strict';var Sequelize=require('sequelize');module[_0xca5c('0x0')]={'type':{'type':Sequelize['ENUM'](_0xca5c('0x1'),_0xca5c('0x2'),'stun',_0xca5c('0x3'))},'value':{'type':Sequelize[_0xca5c('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xca5c('0x4')]}};
\ No newline at end of file
index 68bcb32..8293c9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2570=['error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','apply','save','update','destroy','name','send','Network','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','rawAttributes','filters','include','create','transaction','body','type','toUpperCase','readFileSync','join','server/files/templates/stun_multiple.ejs','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','root','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','sequelize','params','STUN','server/files/templates/turn_multiple.ejs','chan_sip.so','find','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x43e66e,_0x4fb439){var _0x212bde=function(_0x1110e2){while(--_0x1110e2){_0x43e66e['push'](_0x43e66e['shift']());}};_0x212bde(++_0x4fb439);}(_0x2570,0x1d7));var _0x0257=function(_0x260d55,_0x25239a){_0x260d55=_0x260d55-0x0;var _0x26c788=_0x2570[_0x260d55];return _0x26c788;};'use strict';var emlformat=require(_0x0257('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0257('0x1'));var jsonpatch=require(_0x0257('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0257('0x3'));var util=require(_0x0257('0x4'));var path=require(_0x0257('0x5'));var sox=require(_0x0257('0x6'));var csv=require(_0x0257('0x7'));var ejs=require(_0x0257('0x8'));var fs=require('fs');var fs_extra=require(_0x0257('0x9'));var _=require('lodash');var squel=require(_0x0257('0xa'));var crypto=require(_0x0257('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0257('0xc'));var toCsv=require(_0x0257('0x7'));var querystring=require(_0x0257('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0257('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0257('0xf'));var logger=require('../../config/logger')(_0x0257('0x10'));var utils=require(_0x0257('0x11'));var config=require(_0x0257('0x12'));var licenseUtil=require(_0x0257('0x13'));var db=require(_0x0257('0x14'))['db'];var jayson=require(_0x0257('0x15'));var client=jayson['client'][_0x0257('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x239f96,_0x56518b,_0x5bdb4d,_0x4ae0df){return new BPromise(function(_0x5dbb89,_0x2547dc){var _0x2f581d=_0x4ae0df||client;return _0x2f581d[_0x0257('0x17')](_0x239f96,_0x5bdb4d)[_0x0257('0x18')](function(_0x5d8dd8){logger['info'](_0x0257('0x19'),_0x56518b,_0x0257('0x1a'));logger['debug'](_0x0257('0x1b'),_0x56518b,'request\x20sent',JSON[_0x0257('0x1c')](_0x5d8dd8));if(_0x5d8dd8[_0x0257('0x1d')]){if(_0x5d8dd8['error'][_0x0257('0x1e')]===0x1f4){logger[_0x0257('0x1d')](_0x0257('0x19'),_0x56518b,_0x5d8dd8[_0x0257('0x1d')][_0x0257('0x1f')]);return _0x2547dc(_0x5d8dd8[_0x0257('0x1d')][_0x0257('0x1f')]);}logger[_0x0257('0x1d')](_0x0257('0x19'),_0x56518b,_0x5d8dd8['error'][_0x0257('0x1f')]);return _0x5dbb89(_0x5d8dd8['error'][_0x0257('0x1f')]);}else{logger['info'](_0x0257('0x19'),_0x56518b,_0x0257('0x1a'));_0x5dbb89(_0x5d8dd8[_0x0257('0x20')][_0x0257('0x1f')]);}})['catch'](function(_0x3f9fa5){logger['error'](_0x0257('0x19'),_0x56518b,_0x3f9fa5);_0x2547dc(_0x3f9fa5);});});}function respondWithStatusCode(_0xb85c52,_0x43b3cd){_0x43b3cd=_0x43b3cd||0xcc;return function(_0x3d1b6d){if(_0x3d1b6d){return _0xb85c52[_0x0257('0x21')](_0x43b3cd);}return _0xb85c52[_0x0257('0x22')](_0x43b3cd)[_0x0257('0x23')]();};}function respondWithResult(_0x5a80fe,_0x1cd513){_0x1cd513=_0x1cd513||0xc8;return function(_0x351a15){if(_0x351a15){return _0x5a80fe[_0x0257('0x22')](_0x1cd513)[_0x0257('0x24')](_0x351a15);}};}function respondWithFilteredResult(_0x59eaa1,_0x5be36d){return function(_0x23b7dc){if(_0x23b7dc){var _0x3cd633=typeof _0x5be36d[_0x0257('0x25')]===_0x0257('0x26')&&typeof _0x5be36d[_0x0257('0x27')]==='undefined';var _0x35dd76=_0x23b7dc['count'];var _0x5e55b6=_0x3cd633?0x0:_0x5be36d[_0x0257('0x25')];var _0x225426=_0x3cd633?_0x23b7dc['count']:_0x5be36d[_0x0257('0x25')]+_0x5be36d[_0x0257('0x27')];var _0x5dd0b1;if(_0x225426>=_0x35dd76){_0x225426=_0x35dd76;_0x5dd0b1=0xc8;}else{_0x5dd0b1=0xce;}_0x59eaa1[_0x0257('0x22')](_0x5dd0b1);return _0x59eaa1['set']('Content-Range',_0x5e55b6+'-'+_0x225426+'/'+_0x35dd76)['json'](_0x23b7dc);}return null;};}function patchUpdates(_0x479702){return function(_0x388148){try{jsonpatch[_0x0257('0x28')](_0x388148,_0x479702,!![]);}catch(_0x1e11f5){return BPromise['reject'](_0x1e11f5);}return _0x388148[_0x0257('0x29')]();};}function saveUpdates(_0x3864ee,_0x18a9d6){return function(_0xd58b63){if(_0xd58b63){return _0xd58b63[_0x0257('0x2a')](_0x3864ee)[_0x0257('0x18')](function(_0x1d0be8){return _0x1d0be8;});}return null;};}function removeEntity(_0x3f69b0,_0x56be60){return function(_0x516aa3){if(_0x516aa3){return _0x516aa3[_0x0257('0x2b')]()[_0x0257('0x18')](function(){_0x3f69b0[_0x0257('0x22')](0xcc)[_0x0257('0x23')]();});}};}function handleEntityNotFound(_0x2418d5,_0x264d1e){return function(_0x67e1af){if(!_0x67e1af){_0x2418d5[_0x0257('0x21')](0x194);}return _0x67e1af;};}function handleError(_0xd2ae5a,_0x474875){_0x474875=_0x474875||0x1f4;return function(_0x28afb6){logger[_0x0257('0x1d')](_0x28afb6['stack']);if(_0x28afb6['name']){delete _0x28afb6[_0x0257('0x2c')];}_0xd2ae5a[_0x0257('0x22')](_0x474875)[_0x0257('0x2d')](_0x28afb6);};}exports['index']=function(_0x54b45b,_0x32ef38){var _0x3a007f={},_0x3d82d6={},_0x2bba2c={'count':0x0,'rows':[]};var _0x54cbd8=_['map'](db[_0x0257('0x2e')]['rawAttributes'],function(_0x504e3d){return{'name':_0x504e3d['fieldName'],'type':_0x504e3d['type'][_0x0257('0x2f')]};});_0x3d82d6[_0x0257('0x30')]=_[_0x0257('0x31')](_0x54cbd8,_0x0257('0x2c'));_0x3d82d6['query']=_[_0x0257('0x32')](_0x54b45b[_0x0257('0x33')]);_0x3d82d6['filters']=_[_0x0257('0x34')](_0x3d82d6[_0x0257('0x30')],_0x3d82d6[_0x0257('0x33')]);_0x3a007f[_0x0257('0x35')]=_[_0x0257('0x34')](_0x3d82d6['model'],qs[_0x0257('0x36')](_0x54b45b[_0x0257('0x33')][_0x0257('0x36')]));_0x3a007f[_0x0257('0x35')]=_0x3a007f[_0x0257('0x35')][_0x0257('0x37')]?_0x3a007f['attributes']:_0x3d82d6[_0x0257('0x30')];if(!_0x54b45b[_0x0257('0x33')][_0x0257('0x38')](_0x0257('0x39'))){_0x3a007f[_0x0257('0x27')]=qs['limit'](_0x54b45b[_0x0257('0x33')][_0x0257('0x27')]);_0x3a007f[_0x0257('0x25')]=qs[_0x0257('0x25')](_0x54b45b['query'][_0x0257('0x25')]);}_0x3a007f[_0x0257('0x3a')]=qs[_0x0257('0x3b')](_0x54b45b[_0x0257('0x33')][_0x0257('0x3b')]);_0x3a007f[_0x0257('0x3c')]=qs['filters'](_['pick'](_0x54b45b[_0x0257('0x33')],_0x3d82d6['filters']),_0x54cbd8);if(_0x54b45b[_0x0257('0x33')][_0x0257('0x3d')]){_0x3a007f[_0x0257('0x3c')]=_[_0x0257('0x3e')](_0x3a007f['where'],{'$or':_[_0x0257('0x31')](_0x54cbd8,function(_0x5b67d8){if(_0x5b67d8['type']!==_0x0257('0x3f')){var _0x33576d={};_0x33576d[_0x5b67d8['name']]={'$like':'%'+_0x54b45b[_0x0257('0x33')][_0x0257('0x3d')]+'%'};return _0x33576d;}})});}_0x3a007f=_[_0x0257('0x3e')]({},_0x3a007f,_0x54b45b[_0x0257('0x40')]);var _0x2798ed={'where':_0x3a007f[_0x0257('0x3c')]};return db[_0x0257('0x2e')]['count'](_0x2798ed)['then'](function(_0x3e067c){_0x2bba2c[_0x0257('0x41')]=_0x3e067c;if(_0x54b45b[_0x0257('0x33')][_0x0257('0x42')]){_0x3a007f['include']=[{'all':!![]}];}return db[_0x0257('0x2e')][_0x0257('0x43')](_0x3a007f);})[_0x0257('0x18')](function(_0xb1de21){_0x2bba2c[_0x0257('0x44')]=_0xb1de21;return _0x2bba2c;})[_0x0257('0x18')](respondWithFilteredResult(_0x32ef38,_0x3a007f))[_0x0257('0x45')](handleError(_0x32ef38,null));};exports['show']=function(_0x97188d,_0x25fe68){var _0x4ae6cf={'raw':!![],'where':{'id':_0x97188d['params']['id']}},_0x27cdea={};_0x27cdea['model']=_[_0x0257('0x32')](db[_0x0257('0x2e')][_0x0257('0x46')]);_0x27cdea[_0x0257('0x33')]=_[_0x0257('0x32')](_0x97188d[_0x0257('0x33')]);_0x27cdea[_0x0257('0x47')]=_['intersection'](_0x27cdea[_0x0257('0x30')],_0x27cdea[_0x0257('0x33')]);_0x4ae6cf[_0x0257('0x35')]=_[_0x0257('0x34')](_0x27cdea[_0x0257('0x30')],qs[_0x0257('0x36')](_0x97188d['query'][_0x0257('0x36')]));_0x4ae6cf[_0x0257('0x35')]=_0x4ae6cf[_0x0257('0x35')][_0x0257('0x37')]?_0x4ae6cf[_0x0257('0x35')]:_0x27cdea[_0x0257('0x30')];if(_0x97188d['query'][_0x0257('0x42')]){_0x4ae6cf[_0x0257('0x48')]=[{'all':!![]}];}_0x4ae6cf=_[_0x0257('0x3e')]({},_0x4ae6cf,_0x97188d[_0x0257('0x40')]);return db[_0x0257('0x2e')]['find'](_0x4ae6cf)[_0x0257('0x18')](handleEntityNotFound(_0x25fe68,null))[_0x0257('0x18')](respondWithResult(_0x25fe68,null))[_0x0257('0x45')](handleError(_0x25fe68,null));};exports[_0x0257('0x49')]=function(_0x4f593c,_0x59f66d,_0x47ed77){var _0x2ec4f6;return db['sequelize'][_0x0257('0x4a')](function(_0x4841b6){return db[_0x0257('0x2e')]['create'](_0x4f593c[_0x0257('0x4b')],{'raw':!![]})[_0x0257('0x18')](function(_0x3975cd){_0x2ec4f6=_0x3975cd;return db['Network'][_0x0257('0x43')]({'where':{'type':_0x4f593c[_0x0257('0x4b')]['type']},'raw':!![]});})[_0x0257('0x18')](function(_0x23df9f){if(_0x2ec4f6[_0x0257('0x4c')][_0x0257('0x4d')]()=='STUN'){var _0x165552=fs[_0x0257('0x4e')](path[_0x0257('0x4f')](config['root'],_0x0257('0x50')),'utf8');var _0x1459bf=ejs[_0x0257('0x51')](_0x165552,{'networks':_0x23df9f||[]});fs['writeFileSync'](_0x0257('0x52'),_0x1459bf);return respondWithRpcPromise('Reload',_0x0257('0x49'),{'module':_0x0257('0x53')});}else if(_0x2ec4f6[_0x0257('0x4c')]['toUpperCase']()==_0x0257('0x54')){var _0x1e799d=fs[_0x0257('0x4e')](path['join'](config[_0x0257('0x55')],'server/files/templates/turn_multiple.ejs'),_0x0257('0x56'));var _0x43448e=ejs[_0x0257('0x51')](_0x1e799d,{'networks':_0x23df9f||[]});fs[_0x0257('0x57')](_0x0257('0x58'),_0x43448e);return respondWithRpcPromise(_0x0257('0x59'),_0x0257('0x49'),{'module':'res_stun_monitor.so'});}else{var _0x2228f5=fs[_0x0257('0x4e')](path[_0x0257('0x4f')](config[_0x0257('0x55')],_0x0257('0x5a')),_0x0257('0x56'));var _0x11a662=ejs[_0x0257('0x51')](_0x2228f5,{'networks':_0x23df9f||[]});fs['writeFileSync'](util[_0x0257('0x5b')](_0x0257('0x5c'),_0x4f593c[_0x0257('0x4b')][_0x0257('0x4c')][_0x0257('0x5d')]()),_0x11a662);return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});}return null;})['then'](function(){return _0x2ec4f6;});})[_0x0257('0x18')](respondWithResult(_0x59f66d,0xc9))[_0x0257('0x45')](handleError(_0x59f66d,null));};exports[_0x0257('0x2a')]=function(_0x39fc58,_0xc5d293,_0x244091){var _0x33e2c2;return db[_0x0257('0x5e')]['transaction'](function(_0x38951d){return db[_0x0257('0x2e')]['find']({'where':{'id':_0x39fc58[_0x0257('0x5f')]['id']}})[_0x0257('0x18')](handleEntityNotFound(_0xc5d293,null))[_0x0257('0x18')](saveUpdates(_0x39fc58[_0x0257('0x4b')],null))[_0x0257('0x18')](function(_0x549644){if(_0x549644){_0x33e2c2=_0x549644;return db[_0x0257('0x2e')]['findAll']({'where':{'type':_0x33e2c2[_0x0257('0x4c')]},'raw':!![]});}return null;})[_0x0257('0x18')](function(_0x1dfc8e){if(_0x33e2c2[_0x0257('0x4c')][_0x0257('0x4d')]()==_0x0257('0x60')){var _0x54b991=fs[_0x0257('0x4e')](path[_0x0257('0x4f')](config[_0x0257('0x55')],_0x0257('0x50')),_0x0257('0x56'));var _0x1361ed=ejs['render'](_0x54b991,{'networks':_0x1dfc8e||[]});fs[_0x0257('0x57')](_0x0257('0x52'),_0x1361ed);return respondWithRpcPromise(_0x0257('0x59'),_0x0257('0x2a'),{'module':_0x0257('0x53')});}else if(_0x33e2c2[_0x0257('0x4c')][_0x0257('0x4d')]()==_0x0257('0x54')){var _0x563bec=fs[_0x0257('0x4e')](path['join'](config[_0x0257('0x55')],_0x0257('0x61')),_0x0257('0x56'));var _0x2d9be6=ejs[_0x0257('0x51')](_0x563bec,{'networks':_0x1dfc8e||[]});fs['writeFileSync'](_0x0257('0x58'),_0x2d9be6);return respondWithRpcPromise('Reload',_0x0257('0x2a'),{'module':_0x0257('0x53')});}else{var _0x2acacf=fs['readFileSync'](path[_0x0257('0x4f')](config['root'],_0x0257('0x5a')),_0x0257('0x56'));var _0x495b91=ejs[_0x0257('0x51')](_0x2acacf,{'networks':_0x1dfc8e||[]});fs[_0x0257('0x57')](util[_0x0257('0x5b')](_0x0257('0x5c'),_0x39fc58[_0x0257('0x4b')][_0x0257('0x4c')][_0x0257('0x5d')]()),_0x495b91);return respondWithRpcPromise(_0x0257('0x59'),'update',{'module':_0x0257('0x62')});}return null;})['then'](function(_0x38e2e9){if(_0x38e2e9){return _0x33e2c2;}return null;});})[_0x0257('0x18')](respondWithResult(_0xc5d293,null))[_0x0257('0x45')](handleError(_0xc5d293,null));};exports[_0x0257('0x2b')]=function(_0x3b65c6,_0x3b488b,_0x1a5fdc){var _0x445990;return db['Network'][_0x0257('0x63')]({'where':{'id':_0x3b65c6[_0x0257('0x5f')]['id']}})[_0x0257('0x18')](function(_0x260302){_0x445990=_0x260302;return _0x260302;})[_0x0257('0x18')](handleEntityNotFound(_0x3b488b,null))['then'](removeEntity(_0x3b488b,null))[_0x0257('0x18')](function(){if(_0x445990){return db['Network'][_0x0257('0x43')]({'where':{'type':_0x445990[_0x0257('0x4c')]},'raw':!![]});}})[_0x0257('0x18')](function(_0x18b352){if(_0x445990[_0x0257('0x4c')][_0x0257('0x4d')]()==_0x0257('0x60')){var _0x511a9f=fs['readFileSync'](path[_0x0257('0x4f')](config[_0x0257('0x55')],_0x0257('0x50')),'utf8');var _0x54448c=ejs[_0x0257('0x51')](_0x511a9f,{'networks':_0x18b352||[]});fs['writeFileSync'](_0x0257('0x52'),_0x54448c);return respondWithRpcPromise('Reload',_0x0257('0x2b'),{'module':_0x0257('0x53')});}else if(_0x445990[_0x0257('0x4c')][_0x0257('0x4d')]()==_0x0257('0x54')){var _0x38a765=fs[_0x0257('0x4e')](path[_0x0257('0x4f')](config[_0x0257('0x55')],_0x0257('0x61')),_0x0257('0x56'));var _0x4c484d=ejs[_0x0257('0x51')](_0x38a765,{'networks':_0x18b352||[]});fs[_0x0257('0x57')](_0x0257('0x58'),_0x4c484d);return respondWithRpcPromise(_0x0257('0x59'),_0x0257('0x2b'),{'module':_0x0257('0x53')});}else{var _0x368e32=fs[_0x0257('0x4e')](path[_0x0257('0x4f')](config[_0x0257('0x55')],_0x0257('0x5a')),_0x0257('0x56'));var _0x49ccd2=ejs[_0x0257('0x51')](_0x368e32,{'networks':_0x18b352||[]});fs['writeFileSync'](util[_0x0257('0x5b')](_0x0257('0x5c'),_0x3b65c6['body'][_0x0257('0x4c')][_0x0257('0x5d')]()),_0x49ccd2);return respondWithRpcPromise(_0x0257('0x59'),_0x0257('0x2b'),{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x3b488b,null));};
\ No newline at end of file
+var _0xf461=['jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','destroy','sendStatus','stack','name','index','Network','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','create','transaction','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','sequelize','toUpperCase','chan_sip.so','find','eml-format','request-promise','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x1dfa59,_0x1ddd59){var _0x53d71a=function(_0x181038){while(--_0x181038){_0x1dfa59['push'](_0x1dfa59['shift']());}};_0x53d71a(++_0x1ddd59);}(_0xf461,0xba));var _0x1f46=function(_0x313e38,_0x1582b2){_0x313e38=_0x313e38-0x0;var _0xe0bbf6=_0xf461[_0x313e38];return _0xe0bbf6;};'use strict';var emlformat=require(_0x1f46('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1f46('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1f46('0x2'));var path=require(_0x1f46('0x3'));var sox=require(_0x1f46('0x4'));var csv=require(_0x1f46('0x5'));var ejs=require(_0x1f46('0x6'));var fs=require('fs');var fs_extra=require(_0x1f46('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1f46('0x8'));var jsforce=require(_0x1f46('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1f46('0xa'));var Redis=require(_0x1f46('0xb'));var authService=require(_0x1f46('0xc'));var qs=require(_0x1f46('0xd'));var as=require(_0x1f46('0xe'));var hardwareService=require(_0x1f46('0xf'));var logger=require(_0x1f46('0x10'))(_0x1f46('0x11'));var utils=require(_0x1f46('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1f46('0x13'))['db'];var jayson=require(_0x1f46('0x14'));var client=jayson[_0x1f46('0x15')][_0x1f46('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x311ed0,_0x5ae34f,_0x365e3c,_0x3af8b9){return new BPromise(function(_0x3c48f2,_0xbe6d3f){var _0x31d2da=_0x3af8b9||client;return _0x31d2da[_0x1f46('0x17')](_0x311ed0,_0x365e3c)[_0x1f46('0x18')](function(_0x33358f){logger['info']('Network,\x20%s,\x20%s',_0x5ae34f,_0x1f46('0x19'));logger[_0x1f46('0x1a')]('Network,\x20%s,\x20%s,\x20%s',_0x5ae34f,'request\x20sent',JSON[_0x1f46('0x1b')](_0x33358f));if(_0x33358f[_0x1f46('0x1c')]){if(_0x33358f[_0x1f46('0x1c')][_0x1f46('0x1d')]===0x1f4){logger['error'](_0x1f46('0x1e'),_0x5ae34f,_0x33358f[_0x1f46('0x1c')][_0x1f46('0x1f')]);return _0xbe6d3f(_0x33358f[_0x1f46('0x1c')][_0x1f46('0x1f')]);}logger['error']('Network,\x20%s,\x20%s',_0x5ae34f,_0x33358f[_0x1f46('0x1c')][_0x1f46('0x1f')]);return _0x3c48f2(_0x33358f[_0x1f46('0x1c')]['message']);}else{logger['info'](_0x1f46('0x1e'),_0x5ae34f,_0x1f46('0x19'));_0x3c48f2(_0x33358f[_0x1f46('0x20')][_0x1f46('0x1f')]);}})[_0x1f46('0x21')](function(_0x5ba267){logger[_0x1f46('0x1c')](_0x1f46('0x1e'),_0x5ae34f,_0x5ba267);_0xbe6d3f(_0x5ba267);});});}function respondWithStatusCode(_0x5bf82e,_0x13a63c){_0x13a63c=_0x13a63c||0xcc;return function(_0x47033c){if(_0x47033c){return _0x5bf82e['sendStatus'](_0x13a63c);}return _0x5bf82e[_0x1f46('0x22')](_0x13a63c)[_0x1f46('0x23')]();};}function respondWithResult(_0x44da83,_0x337e6d){_0x337e6d=_0x337e6d||0xc8;return function(_0x2ad83f){if(_0x2ad83f){return _0x44da83['status'](_0x337e6d)['json'](_0x2ad83f);}};}function respondWithFilteredResult(_0x23620d,_0x454266){return function(_0x595848){if(_0x595848){var _0x89b57c=typeof _0x454266[_0x1f46('0x24')]==='undefined'&&typeof _0x454266['limit']===_0x1f46('0x25');var _0x3b0479=_0x595848[_0x1f46('0x26')];var _0x4c68d5=_0x89b57c?0x0:_0x454266['offset'];var _0x2e2ec0=_0x89b57c?_0x595848[_0x1f46('0x26')]:_0x454266[_0x1f46('0x24')]+_0x454266[_0x1f46('0x27')];var _0x189851;if(_0x2e2ec0>=_0x3b0479){_0x2e2ec0=_0x3b0479;_0x189851=0xc8;}else{_0x189851=0xce;}_0x23620d[_0x1f46('0x22')](_0x189851);return _0x23620d[_0x1f46('0x28')](_0x1f46('0x29'),_0x4c68d5+'-'+_0x2e2ec0+'/'+_0x3b0479)[_0x1f46('0x2a')](_0x595848);}return null;};}function patchUpdates(_0x40024b){return function(_0x1caece){try{jsonpatch[_0x1f46('0x2b')](_0x1caece,_0x40024b,!![]);}catch(_0x3b0966){return BPromise['reject'](_0x3b0966);}return _0x1caece[_0x1f46('0x2c')]();};}function saveUpdates(_0x8b3a4d,_0x4c423a){return function(_0x4a0c1c){if(_0x4a0c1c){return _0x4a0c1c['update'](_0x8b3a4d)[_0x1f46('0x18')](function(_0x4ef959){return _0x4ef959;});}return null;};}function removeEntity(_0x3d5e9c,_0x13de22){return function(_0x1f6164){if(_0x1f6164){return _0x1f6164[_0x1f46('0x2d')]()[_0x1f46('0x18')](function(){_0x3d5e9c['status'](0xcc)[_0x1f46('0x23')]();});}};}function handleEntityNotFound(_0x5b0614,_0x4dfeec){return function(_0x2a835f){if(!_0x2a835f){_0x5b0614[_0x1f46('0x2e')](0x194);}return _0x2a835f;};}function handleError(_0x1e763,_0x3c394e){_0x3c394e=_0x3c394e||0x1f4;return function(_0x2c341e){logger[_0x1f46('0x1c')](_0x2c341e[_0x1f46('0x2f')]);if(_0x2c341e[_0x1f46('0x30')]){delete _0x2c341e[_0x1f46('0x30')];}_0x1e763[_0x1f46('0x22')](_0x3c394e)['send'](_0x2c341e);};}exports[_0x1f46('0x31')]=function(_0x22dcca,_0xa50e20){var _0x2c8257={},_0x4d4e03={},_0x36a735={'count':0x0,'rows':[]};var _0x43a91d=_['map'](db[_0x1f46('0x32')][_0x1f46('0x33')],function(_0x19e3f2){return{'name':_0x19e3f2[_0x1f46('0x34')],'type':_0x19e3f2[_0x1f46('0x35')][_0x1f46('0x36')]};});_0x4d4e03[_0x1f46('0x37')]=_[_0x1f46('0x38')](_0x43a91d,_0x1f46('0x30'));_0x4d4e03['query']=_[_0x1f46('0x39')](_0x22dcca[_0x1f46('0x3a')]);_0x4d4e03[_0x1f46('0x3b')]=_[_0x1f46('0x3c')](_0x4d4e03['model'],_0x4d4e03['query']);_0x2c8257['attributes']=_['intersection'](_0x4d4e03[_0x1f46('0x37')],qs[_0x1f46('0x3d')](_0x22dcca['query']['fields']));_0x2c8257[_0x1f46('0x3e')]=_0x2c8257[_0x1f46('0x3e')][_0x1f46('0x3f')]?_0x2c8257[_0x1f46('0x3e')]:_0x4d4e03[_0x1f46('0x37')];if(!_0x22dcca['query']['hasOwnProperty']('nolimit')){_0x2c8257['limit']=qs[_0x1f46('0x27')](_0x22dcca[_0x1f46('0x3a')]['limit']);_0x2c8257[_0x1f46('0x24')]=qs[_0x1f46('0x24')](_0x22dcca[_0x1f46('0x3a')][_0x1f46('0x24')]);}_0x2c8257[_0x1f46('0x40')]=qs[_0x1f46('0x41')](_0x22dcca['query']['sort']);_0x2c8257[_0x1f46('0x42')]=qs['filters'](_[_0x1f46('0x43')](_0x22dcca[_0x1f46('0x3a')],_0x4d4e03[_0x1f46('0x3b')]),_0x43a91d);if(_0x22dcca[_0x1f46('0x3a')]['filter']){_0x2c8257[_0x1f46('0x42')]=_[_0x1f46('0x44')](_0x2c8257[_0x1f46('0x42')],{'$or':_[_0x1f46('0x38')](_0x43a91d,function(_0x1cbece){if(_0x1cbece[_0x1f46('0x35')]!==_0x1f46('0x45')){var _0x1b615c={};_0x1b615c[_0x1cbece[_0x1f46('0x30')]]={'$like':'%'+_0x22dcca[_0x1f46('0x3a')][_0x1f46('0x46')]+'%'};return _0x1b615c;}})});}_0x2c8257=_[_0x1f46('0x44')]({},_0x2c8257,_0x22dcca[_0x1f46('0x47')]);var _0x21404c={'where':_0x2c8257[_0x1f46('0x42')]};return db[_0x1f46('0x32')]['count'](_0x21404c)[_0x1f46('0x18')](function(_0xedb607){_0x36a735[_0x1f46('0x26')]=_0xedb607;if(_0x22dcca[_0x1f46('0x3a')]['includeAll']){_0x2c8257[_0x1f46('0x48')]=[{'all':!![]}];}return db[_0x1f46('0x32')][_0x1f46('0x49')](_0x2c8257);})[_0x1f46('0x18')](function(_0x561c30){_0x36a735[_0x1f46('0x4a')]=_0x561c30;return _0x36a735;})['then'](respondWithFilteredResult(_0xa50e20,_0x2c8257))[_0x1f46('0x21')](handleError(_0xa50e20,null));};exports['show']=function(_0x236153,_0x1e0c86){var _0x46e466={'raw':!![],'where':{'id':_0x236153[_0x1f46('0x4b')]['id']}},_0x30ee3f={};_0x30ee3f[_0x1f46('0x37')]=_['keys'](db['Network'][_0x1f46('0x33')]);_0x30ee3f['query']=_[_0x1f46('0x39')](_0x236153[_0x1f46('0x3a')]);_0x30ee3f[_0x1f46('0x3b')]=_[_0x1f46('0x3c')](_0x30ee3f[_0x1f46('0x37')],_0x30ee3f['query']);_0x46e466[_0x1f46('0x3e')]=_[_0x1f46('0x3c')](_0x30ee3f[_0x1f46('0x37')],qs['fields'](_0x236153['query'][_0x1f46('0x3d')]));_0x46e466['attributes']=_0x46e466[_0x1f46('0x3e')][_0x1f46('0x3f')]?_0x46e466['attributes']:_0x30ee3f[_0x1f46('0x37')];if(_0x236153['query'][_0x1f46('0x4c')]){_0x46e466[_0x1f46('0x48')]=[{'all':!![]}];}_0x46e466=_[_0x1f46('0x44')]({},_0x46e466,_0x236153['options']);return db[_0x1f46('0x32')]['find'](_0x46e466)['then'](handleEntityNotFound(_0x1e0c86,null))[_0x1f46('0x18')](respondWithResult(_0x1e0c86,null))[_0x1f46('0x21')](handleError(_0x1e0c86,null));};exports[_0x1f46('0x4d')]=function(_0x201262,_0x4022a4,_0x43d2bf){var _0x266138;return db['sequelize'][_0x1f46('0x4e')](function(_0x4a6e26){return db[_0x1f46('0x32')][_0x1f46('0x4d')](_0x201262[_0x1f46('0x4f')],{'raw':!![]})[_0x1f46('0x18')](function(_0x5c7a26){_0x266138=_0x5c7a26;return db['Network'][_0x1f46('0x49')]({'where':{'type':_0x201262[_0x1f46('0x4f')]['type']},'raw':!![]});})['then'](function(_0xc6bc6e){if(_0x266138[_0x1f46('0x35')]['toUpperCase']()==_0x1f46('0x50')){var _0x54665e=fs[_0x1f46('0x51')](path[_0x1f46('0x52')](config[_0x1f46('0x53')],_0x1f46('0x54')),_0x1f46('0x55'));var _0x1c430f=ejs['render'](_0x54665e,{'networks':_0xc6bc6e||[]});fs[_0x1f46('0x56')](_0x1f46('0x57'),_0x1c430f);return respondWithRpcPromise(_0x1f46('0x58'),_0x1f46('0x4d'),{'module':_0x1f46('0x59')});}else if(_0x266138[_0x1f46('0x35')]['toUpperCase']()==_0x1f46('0x5a')){var _0x1fd490=fs[_0x1f46('0x51')](path[_0x1f46('0x52')](config[_0x1f46('0x53')],_0x1f46('0x5b')),_0x1f46('0x55'));var _0x5497ed=ejs[_0x1f46('0x5c')](_0x1fd490,{'networks':_0xc6bc6e||[]});fs[_0x1f46('0x56')](_0x1f46('0x5d'),_0x5497ed);return respondWithRpcPromise(_0x1f46('0x58'),_0x1f46('0x4d'),{'module':'res_stun_monitor.so'});}else{var _0x5292bd=fs[_0x1f46('0x51')](path[_0x1f46('0x52')](config[_0x1f46('0x53')],_0x1f46('0x5e')),_0x1f46('0x55'));var _0x2be646=ejs[_0x1f46('0x5c')](_0x5292bd,{'networks':_0xc6bc6e||[]});fs[_0x1f46('0x56')](util[_0x1f46('0x5f')](_0x1f46('0x60'),_0x201262[_0x1f46('0x4f')][_0x1f46('0x35')][_0x1f46('0x61')]()),_0x2be646);return respondWithRpcPromise('Reload',_0x1f46('0x4d'),{'module':'chan_sip.so'});}return null;})[_0x1f46('0x18')](function(){return _0x266138;});})[_0x1f46('0x18')](respondWithResult(_0x4022a4,0xc9))[_0x1f46('0x21')](handleError(_0x4022a4,null));};exports[_0x1f46('0x62')]=function(_0x29e22d,_0x1a75c8,_0x530523){var _0x560395;return db[_0x1f46('0x63')]['transaction'](function(_0x410878){return db['Network']['find']({'where':{'id':_0x29e22d[_0x1f46('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1a75c8,null))[_0x1f46('0x18')](saveUpdates(_0x29e22d[_0x1f46('0x4f')],null))[_0x1f46('0x18')](function(_0x3f30a7){if(_0x3f30a7){_0x560395=_0x3f30a7;return db[_0x1f46('0x32')][_0x1f46('0x49')]({'where':{'type':_0x560395[_0x1f46('0x35')]},'raw':!![]});}return null;})[_0x1f46('0x18')](function(_0xe032b9){if(_0x560395[_0x1f46('0x35')][_0x1f46('0x64')]()==_0x1f46('0x50')){var _0x3e7c3b=fs['readFileSync'](path[_0x1f46('0x52')](config['root'],_0x1f46('0x54')),_0x1f46('0x55'));var _0xb34dc9=ejs['render'](_0x3e7c3b,{'networks':_0xe032b9||[]});fs[_0x1f46('0x56')]('/etc/asterisk/stun_xcally.conf',_0xb34dc9);return respondWithRpcPromise('Reload',_0x1f46('0x62'),{'module':_0x1f46('0x59')});}else if(_0x560395[_0x1f46('0x35')][_0x1f46('0x64')]()==_0x1f46('0x5a')){var _0x3f227b=fs[_0x1f46('0x51')](path[_0x1f46('0x52')](config[_0x1f46('0x53')],_0x1f46('0x5b')),'utf8');var _0x326323=ejs[_0x1f46('0x5c')](_0x3f227b,{'networks':_0xe032b9||[]});fs[_0x1f46('0x56')](_0x1f46('0x5d'),_0x326323);return respondWithRpcPromise(_0x1f46('0x58'),'update',{'module':_0x1f46('0x59')});}else{var _0x24a14d=fs[_0x1f46('0x51')](path['join'](config['root'],_0x1f46('0x5e')),'utf8');var _0x3600b4=ejs['render'](_0x24a14d,{'networks':_0xe032b9||[]});fs[_0x1f46('0x56')](util[_0x1f46('0x5f')](_0x1f46('0x60'),_0x29e22d['body'][_0x1f46('0x35')][_0x1f46('0x61')]()),_0x3600b4);return respondWithRpcPromise('Reload',_0x1f46('0x62'),{'module':_0x1f46('0x65')});}return null;})[_0x1f46('0x18')](function(_0x511349){if(_0x511349){return _0x560395;}return null;});})[_0x1f46('0x18')](respondWithResult(_0x1a75c8,null))[_0x1f46('0x21')](handleError(_0x1a75c8,null));};exports[_0x1f46('0x2d')]=function(_0x147918,_0x5ab3e5,_0x3a4d48){var _0x507a41;return db[_0x1f46('0x32')][_0x1f46('0x66')]({'where':{'id':_0x147918[_0x1f46('0x4b')]['id']}})[_0x1f46('0x18')](function(_0x45d789){_0x507a41=_0x45d789;return _0x45d789;})[_0x1f46('0x18')](handleEntityNotFound(_0x5ab3e5,null))[_0x1f46('0x18')](removeEntity(_0x5ab3e5,null))['then'](function(){if(_0x507a41){return db['Network'][_0x1f46('0x49')]({'where':{'type':_0x507a41[_0x1f46('0x35')]},'raw':!![]});}})[_0x1f46('0x18')](function(_0x81b90c){if(_0x507a41[_0x1f46('0x35')]['toUpperCase']()==_0x1f46('0x50')){var _0x103144=fs[_0x1f46('0x51')](path[_0x1f46('0x52')](config[_0x1f46('0x53')],_0x1f46('0x54')),_0x1f46('0x55'));var _0x491aee=ejs[_0x1f46('0x5c')](_0x103144,{'networks':_0x81b90c||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x491aee);return respondWithRpcPromise(_0x1f46('0x58'),_0x1f46('0x2d'),{'module':_0x1f46('0x59')});}else if(_0x507a41['type'][_0x1f46('0x64')]()==_0x1f46('0x5a')){var _0x4126ff=fs['readFileSync'](path[_0x1f46('0x52')](config[_0x1f46('0x53')],_0x1f46('0x5b')),_0x1f46('0x55'));var _0x3f9c44=ejs[_0x1f46('0x5c')](_0x4126ff,{'networks':_0x81b90c||[]});fs[_0x1f46('0x56')](_0x1f46('0x5d'),_0x3f9c44);return respondWithRpcPromise('Reload',_0x1f46('0x2d'),{'module':_0x1f46('0x59')});}else{var _0x1fd175=fs['readFileSync'](path[_0x1f46('0x52')](config[_0x1f46('0x53')],_0x1f46('0x5e')),_0x1f46('0x55'));var _0x2dabc4=ejs[_0x1f46('0x5c')](_0x1fd175,{'networks':_0x81b90c||[]});fs['writeFileSync'](util[_0x1f46('0x5f')](_0x1f46('0x60'),_0x147918[_0x1f46('0x4f')][_0x1f46('0x35')][_0x1f46('0x61')]()),_0x2dabc4);return respondWithRpcPromise(_0x1f46('0x58'),_0x1f46('0x2d'),{'module':'chan_sip.so'});}return null;})[_0x1f46('0x21')](handleError(_0x5ab3e5,null));};
\ No newline at end of file
index 0fcf1f6..1ce8e17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1752=['bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','util','../../config/logger','api','moment'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x1752,0xa5));var _0x2175=function(_0x2320c8,_0x3d2cb3){_0x2320c8=_0x2320c8-0x0;var _0x5d81ce=_0x1752[_0x2320c8];return _0x5d81ce;};'use strict';var _=require('lodash');var util=require(_0x2175('0x0'));var logger=require(_0x2175('0x1'))(_0x2175('0x2'));var moment=require(_0x2175('0x3'));var BPromise=require(_0x2175('0x4'));var rp=require(_0x2175('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2175('0x6'));var config=require(_0x2175('0x7'));var attributes=require(_0x2175('0x8'));module[_0x2175('0x9')]=function(_0x222868,_0x27ff0b){return _0x222868[_0x2175('0xa')](_0x2175('0xb'),attributes,{'tableName':_0x2175('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5eb1=['./network.attributes','exports','define','network','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x585aaa,_0x2c4e54){var _0xbcd37e=function(_0x457a20){while(--_0x457a20){_0x585aaa['push'](_0x585aaa['shift']());}};_0xbcd37e(++_0x2c4e54);}(_0x5eb1,0x7c));var _0x15eb=function(_0x572944,_0xd5c0df){_0x572944=_0x572944-0x0;var _0x2f457a=_0x5eb1[_0x572944];return _0x2f457a;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var logger=require(_0x15eb('0x1'))(_0x15eb('0x2'));var moment=require(_0x15eb('0x3'));var BPromise=require(_0x15eb('0x4'));var rp=require(_0x15eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15eb('0x6'));var config=require(_0x15eb('0x7'));var attributes=require(_0x15eb('0x8'));module[_0x15eb('0x9')]=function(_0x47e341,_0x1be042){return _0x47e341[_0x15eb('0xa')]('Network',attributes,{'tableName':_0x15eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b1c7df9..126f529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x26613f,_0x534a0c){var _0x33e5ec=function(_0x105c69){while(--_0x105c69){_0x26613f['push'](_0x26613f['shift']());}};_0x33e5ec(++_0x534a0c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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
+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(_0x25b068,_0xaf61d8){var _0x4e4b0f=function(_0x31e934){while(--_0x31e934){_0x25b068['push'](_0x25b068['shift']());}};_0x4e4b0f(++_0xaf61d8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 5e301a7..212c5f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a3d=['/describe','describe','/:id','show','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','/:id/dispositions','addDisposition','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get'];(function(_0x41fec4,_0x23210d){var _0x38b0de=function(_0x225cf7){while(--_0x225cf7){_0x41fec4['push'](_0x41fec4['shift']());}};_0x38b0de(++_0x23210d);}(_0x2a3d,0x1c8));var _0xd2a3=function(_0xd4b927,_0x50086e){_0xd4b927=_0xd4b927-0x0;var _0x4d8d19=_0x2a3d[_0xd4b927];return _0x4d8d19;};'use strict';var multer=require(_0xd2a3('0x0'));var util=require(_0xd2a3('0x1'));var path=require(_0xd2a3('0x2'));var timeout=require(_0xd2a3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd2a3('0x4'));var auth=require(_0xd2a3('0x5'));var interaction=require(_0xd2a3('0x6'));var config=require(_0xd2a3('0x7'));var controller=require(_0xd2a3('0x8'));router['get']('/',auth[_0xd2a3('0x9')](),controller[_0xd2a3('0xa')]);router[_0xd2a3('0xb')](_0xd2a3('0xc'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0xd')]);router[_0xd2a3('0xb')](_0xd2a3('0xe'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0xf')]);router[_0xd2a3('0xb')]('/:id/dispositions',auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x10')]);router[_0xd2a3('0xb')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd2a3('0x11')]);router['get'](_0xd2a3('0x12'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x13')]);router['get'](_0xd2a3('0x14'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x15')]);router['get']('/:id/users',auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x16')]);router[_0xd2a3('0x17')]('/',auth['isAuthenticated'](),controller[_0xd2a3('0x18')]);router[_0xd2a3('0x17')](_0xd2a3('0x19'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x1a')]);router[_0xd2a3('0x17')]('/:id/canned_answers',auth[_0xd2a3('0x9')](),controller['addAnswer']);router[_0xd2a3('0x17')]('/:id/notify',controller[_0xd2a3('0x1b')]);router[_0xd2a3('0x17')](_0xd2a3('0x12'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x1c')]);router[_0xd2a3('0x17')](_0xd2a3('0x1d'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x1e')]);router[_0xd2a3('0x17')](_0xd2a3('0x1f'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x20')]);router[_0xd2a3('0x21')](_0xd2a3('0xe'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x22')]);router['delete'](_0xd2a3('0xe'),auth[_0xd2a3('0x9')](),controller['destroy']);router[_0xd2a3('0x23')](_0xd2a3('0x19'),auth['isAuthenticated'](),controller[_0xd2a3('0x24')]);router[_0xd2a3('0x23')]('/:id/canned_answers',auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x25')]);router[_0xd2a3('0x23')](_0xd2a3('0x1d'),auth[_0xd2a3('0x9')](),controller[_0xd2a3('0x26')]);module['exports']=router;
\ No newline at end of file
+var _0x6e32=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','/:id/canned_answers','notify','addApplications','addAgents','/:id/send','send','put','update','delete','removeDispositions'];(function(_0x371712,_0x1c6de0){var _0x2afe9f=function(_0xc6e75b){while(--_0xc6e75b){_0x371712['push'](_0x371712['shift']());}};_0x2afe9f(++_0x1c6de0);}(_0x6e32,0x96));var _0x26e3=function(_0x210e98,_0x3d8e34){_0x210e98=_0x210e98-0x0;var _0x5c7078=_0x6e32[_0x210e98];return _0x5c7078;};'use strict';var multer=require(_0x26e3('0x0'));var util=require(_0x26e3('0x1'));var path=require(_0x26e3('0x2'));var timeout=require(_0x26e3('0x3'));var express=require(_0x26e3('0x4'));var router=express[_0x26e3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26e3('0x6'));var interaction=require(_0x26e3('0x7'));var config=require(_0x26e3('0x8'));var controller=require(_0x26e3('0x9'));router[_0x26e3('0xa')]('/',auth[_0x26e3('0xb')](),controller[_0x26e3('0xc')]);router[_0x26e3('0xa')](_0x26e3('0xd'),auth[_0x26e3('0xb')](),controller[_0x26e3('0xe')]);router[_0x26e3('0xa')](_0x26e3('0xf'),auth['isAuthenticated'](),controller[_0x26e3('0x10')]);router[_0x26e3('0xa')]('/:id/dispositions',auth[_0x26e3('0xb')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x26e3('0xb')](),controller[_0x26e3('0x11')]);router[_0x26e3('0xa')](_0x26e3('0x12'),auth[_0x26e3('0xb')](),controller[_0x26e3('0x13')]);router[_0x26e3('0xa')](_0x26e3('0x14'),auth[_0x26e3('0xb')](),controller['getInteractions']);router[_0x26e3('0xa')](_0x26e3('0x15'),auth[_0x26e3('0xb')](),controller[_0x26e3('0x16')]);router[_0x26e3('0x17')]('/',auth['isAuthenticated'](),controller[_0x26e3('0x18')]);router['post']('/:id/dispositions',auth[_0x26e3('0xb')](),controller['addDisposition']);router['post'](_0x26e3('0x19'),auth[_0x26e3('0xb')](),controller['addAnswer']);router[_0x26e3('0x17')]('/:id/notify',controller[_0x26e3('0x1a')]);router[_0x26e3('0x17')](_0x26e3('0x12'),auth[_0x26e3('0xb')](),controller[_0x26e3('0x1b')]);router['post'](_0x26e3('0x15'),auth[_0x26e3('0xb')](),controller[_0x26e3('0x1c')]);router['post'](_0x26e3('0x1d'),auth[_0x26e3('0xb')](),controller[_0x26e3('0x1e')]);router[_0x26e3('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x26e3('0x20')]);router[_0x26e3('0x21')](_0x26e3('0xf'),auth[_0x26e3('0xb')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x26e3('0xb')](),controller[_0x26e3('0x22')]);router[_0x26e3('0x21')](_0x26e3('0x19'),auth[_0x26e3('0xb')](),controller['removeAnswers']);router['delete'](_0x26e3('0x15'),auth['isAuthenticated'](),controller[_0x26e3('0x23')]);module[_0x26e3('0x24')]=router;
\ No newline at end of file
index 49df591..e6ddd4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59b9=['STRING','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports'];(function(_0x4dc3ae,_0xe132af){var _0x3fbdc3=function(_0x4a9c05){while(--_0x4a9c05){_0x4dc3ae['push'](_0x4dc3ae['shift']());}};_0x3fbdc3(++_0xe132af);}(_0x59b9,0xc5));var _0x959b=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x59b9[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x959b('0x0')]={'name':{'type':Sequelize[_0x959b('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x959b('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x959b('0x2')]();}},'replyUri':{'type':Sequelize[_0x959b('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x959b('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x959b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x959b('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x959b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x959b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x959b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x959b('0x5')},'mandatoryDisposition':{'type':Sequelize[_0x959b('0x3')],'defaultValue':![],'comment':_0x959b('0x6'),'set':function(_0xa3cef){if(!_0xa3cef)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x959b('0x7')](_0x959b('0x8'),_0xa3cef);}}};
\ No newline at end of file
+var _0x73d4=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','name','BOOLEAN'];(function(_0x515cff,_0x4fb356){var _0x128bf4=function(_0x2805c1){while(--_0x2805c1){_0x515cff['push'](_0x515cff['shift']());}};_0x128bf4(++_0x4fb356);}(_0x73d4,0xc4));var _0x473d=function(_0x34951f,_0x277327){_0x34951f=_0x34951f-0x0;var _0x487db1=_0x73d4[_0x34951f];return _0x487db1;};'use strict';var Sequelize=require(_0x473d('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x473d('0x1')],'unique':_0x473d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x473d('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x473d('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x473d('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x473d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x473d('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x473d('0x1')]},'queueTransfer':{'type':Sequelize[_0x473d('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x473d('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x473d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x473d('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x473d('0x5')},'mandatoryDisposition':{'type':Sequelize[_0x473d('0x3')],'defaultValue':![],'comment':_0x473d('0x6'),'set':function(_0x5adb09){if(!_0x5adb09)this[_0x473d('0x7')]('mandatoryDispositionPauseId',null);this[_0x473d('0x7')]('mandatoryDisposition',_0x5adb09);}}};
\ No newline at end of file
index 03f3bef..e1cbcf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39cb=['from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','unshift','agent','Start','startRouting','EventManager','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','send','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','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','./openchannelAccount.socket','jayson/promise','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','name','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','Pause','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','OpenchannelAccountId','options','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','isNil'];(function(_0x4821ed,_0x1910fe){var _0x79689c=function(_0x456a10){while(--_0x456a10){_0x4821ed['push'](_0x4821ed['shift']());}};_0x79689c(++_0x1910fe);}(_0x39cb,0x10c));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xb39c('0x0'));var rimraf=require(_0xb39c('0x1'));var zipdir=require(_0xb39c('0x2'));var jsonpatch=require(_0xb39c('0x3'));var rp=require(_0xb39c('0x4'));var moment=require(_0xb39c('0x5'));var BPromise=require(_0xb39c('0x6'));var Mustache=require(_0xb39c('0x7'));var util=require(_0xb39c('0x8'));var path=require(_0xb39c('0x9'));var sox=require(_0xb39c('0xa'));var csv=require(_0xb39c('0xb'));var ejs=require(_0xb39c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb39c('0xd'));var squel=require(_0xb39c('0xe'));var crypto=require('crypto');var jsforce=require(_0xb39c('0xf'));var deskjs=require(_0xb39c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb39c('0x11'));var Papa=require(_0xb39c('0x12'));var Redis=require(_0xb39c('0x13'));var authService=require(_0xb39c('0x14'));var qs=require(_0xb39c('0x15'));var as=require(_0xb39c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb39c('0x17'))('api');var utils=require(_0xb39c('0x18'));var config=require(_0xb39c('0x19'));var licenseUtil=require(_0xb39c('0x1a'));var db=require(_0xb39c('0x1b'))['db'];config[_0xb39c('0x1c')]=_[_0xb39c('0x1d')](config[_0xb39c('0x1c')],{'host':_0xb39c('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb39c('0x1c')]));require(_0xb39c('0x1f'))['register'](socket);var jayson=require(_0xb39c('0x20'));var client=jayson['client'][_0xb39c('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xb39c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x59f198,_0x32c804,_0x3e83ff,_0x1284e4){return new BPromise(function(_0xeab334,_0xa164da){var _0x4fb15e=_0x1284e4||client;return _0x4fb15e[_0xb39c('0x22')](_0x59f198,_0x3e83ff)[_0xb39c('0x23')](function(_0x39f584){logger[_0xb39c('0x24')](_0xb39c('0x25'),_0x32c804,_0xb39c('0x26'));logger[_0xb39c('0x27')](_0xb39c('0x28'),_0x32c804,_0xb39c('0x26'),JSON[_0xb39c('0x29')](_0x39f584));if(_0x39f584['error']){if(_0x39f584[_0xb39c('0x2a')][_0xb39c('0x2b')]===0x1f4){logger[_0xb39c('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x32c804,_0x39f584['error']['message']);return _0xa164da(_0x39f584[_0xb39c('0x2a')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x32c804,_0x39f584[_0xb39c('0x2a')][_0xb39c('0x2c')]);return _0xeab334(_0x39f584[_0xb39c('0x2a')][_0xb39c('0x2c')]);}else{logger[_0xb39c('0x24')](_0xb39c('0x25'),_0x32c804,_0xb39c('0x26'));_0xeab334(_0x39f584[_0xb39c('0x2d')]['message']);}})['catch'](function(_0x2c9219){logger[_0xb39c('0x2a')](_0xb39c('0x25'),_0x32c804,_0x2c9219);_0xa164da(_0x2c9219);});});}function respondWithStatusCode(_0x22b6f7,_0x343b44){_0x343b44=_0x343b44||0xcc;return function(_0x597e5e){if(_0x597e5e){return _0x22b6f7[_0xb39c('0x2e')](_0x343b44);}return _0x22b6f7[_0xb39c('0x2f')](_0x343b44)[_0xb39c('0x30')]();};}function respondWithResult(_0x1008f6,_0x59ee6f){_0x59ee6f=_0x59ee6f||0xc8;return function(_0x34b63c){if(_0x34b63c){return _0x1008f6[_0xb39c('0x2f')](_0x59ee6f)[_0xb39c('0x31')](_0x34b63c);}};}function respondWithFilteredResult(_0x67bb80,_0xca35d2){return function(_0x999c43){if(_0x999c43){var _0x201e26=typeof _0xca35d2[_0xb39c('0x32')]===_0xb39c('0x33')&&typeof _0xca35d2['limit']===_0xb39c('0x33');var _0x409352=_0x999c43[_0xb39c('0x34')];var _0x22d2a5=_0x201e26?0x0:_0xca35d2[_0xb39c('0x32')];var _0x3ac94e=_0x201e26?_0x999c43[_0xb39c('0x34')]:_0xca35d2[_0xb39c('0x32')]+_0xca35d2['limit'];var _0x289fe7;if(_0x3ac94e>=_0x409352){_0x3ac94e=_0x409352;_0x289fe7=0xc8;}else{_0x289fe7=0xce;}_0x67bb80[_0xb39c('0x2f')](_0x289fe7);return _0x67bb80[_0xb39c('0x35')](_0xb39c('0x36'),_0x22d2a5+'-'+_0x3ac94e+'/'+_0x409352)[_0xb39c('0x31')](_0x999c43);}return null;};}function patchUpdates(_0x1545ae){return function(_0x23e9d7){try{jsonpatch[_0xb39c('0x37')](_0x23e9d7,_0x1545ae,!![]);}catch(_0x35dfb6){return BPromise[_0xb39c('0x38')](_0x35dfb6);}return _0x23e9d7[_0xb39c('0x39')]();};}function saveUpdates(_0x2a7616,_0x4d3ce5){return function(_0x22e26b){if(_0x22e26b){return _0x22e26b['update'](_0x2a7616)[_0xb39c('0x23')](function(_0x1b6c13){return _0x1b6c13;});}return null;};}function removeEntity(_0x2aa326,_0x5141f0){return function(_0x186517){if(_0x186517){return _0x186517['destroy']()['then'](function(){var _0x5a8665=_0x186517[_0xb39c('0x3a')]({'plain':!![]});var _0x5f470f='OpenchannelAccounts';return db[_0xb39c('0x3b')][_0xb39c('0x3c')]({'where':{'type':_0x5f470f,'resourceId':_0x5a8665['id']}})[_0xb39c('0x23')](function(){return _0x186517;});})[_0xb39c('0x23')](function(){_0x2aa326['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37a031,_0x44a1f8){return function(_0x45af2d){if(!_0x45af2d){_0x37a031[_0xb39c('0x2e')](0x194);}return _0x45af2d;};}function handleError(_0x1f9852,_0x4e5589){_0x4e5589=_0x4e5589||0x1f4;return function(_0x3dfe45){logger[_0xb39c('0x2a')](_0x3dfe45['stack']);if(_0x3dfe45['name']){delete _0x3dfe45[_0xb39c('0x3d')];}_0x1f9852['status'](_0x4e5589)['send'](_0x3dfe45);};}exports[_0xb39c('0x3e')]=function(_0x44fffb,_0x72c4f4){var _0x4c6c35={'include':[{'model':db['Pause'],'as':_0xb39c('0x3f')}]},_0x3eeaf7={},_0x4439c2={'count':0x0,'rows':[]};var _0x2c962d=_[_0xb39c('0x40')](db[_0xb39c('0x41')][_0xb39c('0x42')],function(_0x2fd1bd){return{'name':_0x2fd1bd[_0xb39c('0x43')],'type':_0x2fd1bd[_0xb39c('0x44')][_0xb39c('0x45')]};});_0x3eeaf7[_0xb39c('0x46')]=_[_0xb39c('0x40')](_0x2c962d,_0xb39c('0x3d'));_0x3eeaf7[_0xb39c('0x47')]=_[_0xb39c('0x48')](_0x44fffb[_0xb39c('0x47')]);_0x3eeaf7['filters']=_['intersection'](_0x3eeaf7[_0xb39c('0x46')],_0x3eeaf7[_0xb39c('0x47')]);_0x4c6c35[_0xb39c('0x49')]=_[_0xb39c('0x4a')](_0x3eeaf7[_0xb39c('0x46')],qs[_0xb39c('0x4b')](_0x44fffb['query'][_0xb39c('0x4b')]));_0x4c6c35[_0xb39c('0x49')]=_0x4c6c35[_0xb39c('0x49')][_0xb39c('0x4c')]?_0x4c6c35['attributes']:_0x3eeaf7['model'];if(!_0x44fffb[_0xb39c('0x47')][_0xb39c('0x4d')]('nolimit')){_0x4c6c35[_0xb39c('0x4e')]=qs['limit'](_0x44fffb[_0xb39c('0x47')][_0xb39c('0x4e')]);_0x4c6c35[_0xb39c('0x32')]=qs[_0xb39c('0x32')](_0x44fffb[_0xb39c('0x47')][_0xb39c('0x32')]);}_0x4c6c35[_0xb39c('0x4f')]=qs['sort'](_0x44fffb['query'][_0xb39c('0x50')]);_0x4c6c35[_0xb39c('0x51')]=qs[_0xb39c('0x52')](_[_0xb39c('0x53')](_0x44fffb[_0xb39c('0x47')],_0x3eeaf7['filters']),_0x2c962d);if(_0x44fffb[_0xb39c('0x47')]['filter']){_0x4c6c35[_0xb39c('0x51')]=_[_0xb39c('0x54')](_0x4c6c35[_0xb39c('0x51')],{'$or':_[_0xb39c('0x40')](_0x2c962d,function(_0x2fc86f){if(_0x2fc86f['type']!==_0xb39c('0x55')){var _0x55bab5={};_0x55bab5[_0x2fc86f['name']]={'$like':'%'+_0x44fffb['query'][_0xb39c('0x56')]+'%'};return _0x55bab5;}})});}_0x4c6c35=_[_0xb39c('0x54')]({},_0x4c6c35,_0x44fffb['options']);var _0x52e6c9={'where':_0x4c6c35[_0xb39c('0x51')]};return db[_0xb39c('0x41')][_0xb39c('0x34')](_0x52e6c9)[_0xb39c('0x23')](function(_0x152db6){_0x4439c2['count']=_0x152db6;if(_0x44fffb['query'][_0xb39c('0x57')]){_0x4c6c35['include']=[{'all':!![]}];}return db[_0xb39c('0x41')][_0xb39c('0x58')](_0x4c6c35);})['then'](function(_0x552154){_0x4439c2[_0xb39c('0x59')]=_0x552154;return _0x4439c2;})[_0xb39c('0x23')](respondWithFilteredResult(_0x72c4f4,_0x4c6c35))[_0xb39c('0x5a')](handleError(_0x72c4f4,null));};exports[_0xb39c('0x5b')]=function(_0x18ead4,_0x5b8618){var _0x59db0e={'raw':![],'where':{'id':_0x18ead4[_0xb39c('0x5c')]['id']},'include':[{'model':db[_0xb39c('0x5d')],'as':_0xb39c('0x3f')}]},_0x1f9a4d={};_0x1f9a4d[_0xb39c('0x46')]=_[_0xb39c('0x48')](db[_0xb39c('0x41')][_0xb39c('0x42')]);_0x1f9a4d[_0xb39c('0x47')]=_[_0xb39c('0x48')](_0x18ead4[_0xb39c('0x47')]);_0x1f9a4d['filters']=_[_0xb39c('0x4a')](_0x1f9a4d[_0xb39c('0x46')],_0x1f9a4d[_0xb39c('0x47')]);_0x59db0e[_0xb39c('0x49')]=_[_0xb39c('0x4a')](_0x1f9a4d[_0xb39c('0x46')],qs[_0xb39c('0x4b')](_0x18ead4[_0xb39c('0x47')][_0xb39c('0x4b')]));_0x59db0e['attributes']=_0x59db0e[_0xb39c('0x49')][_0xb39c('0x4c')]?_0x59db0e['attributes']:_0x1f9a4d['model'];if(_0x18ead4[_0xb39c('0x47')][_0xb39c('0x57')]){_0x59db0e['include']=[{'all':!![]}];}_0x59db0e=_['merge']({},_0x59db0e,_0x18ead4['options']);return db[_0xb39c('0x41')][_0xb39c('0x5e')](_0x59db0e)[_0xb39c('0x23')](handleEntityNotFound(_0x5b8618,null))[_0xb39c('0x23')](respondWithResult(_0x5b8618,null))['catch'](handleError(_0x5b8618,null));};exports[_0xb39c('0x5f')]=function(_0x458e69,_0xae75d4){return db[_0xb39c('0x41')][_0xb39c('0x5f')](_0x458e69['body'],{})[_0xb39c('0x23')](function(_0x1faff8){var _0x141abd=_0x458e69[_0xb39c('0x60')]['get']({'plain':!![]});if(!_0x141abd)throw new Error(_0xb39c('0x61'));if(_0x141abd[_0xb39c('0x62')]==='user'){var _0x3c6bb8=_0x1faff8['get']({'plain':!![]});var _0x294567=_0xb39c('0x63');return db[_0xb39c('0x64')]['find']({'where':{'name':_0x294567,'userProfileId':_0x141abd[_0xb39c('0x65')]},'raw':!![]})['then'](function(_0x14a918){if(_0x14a918&&_0x14a918['autoAssociation']===0x0){return db[_0xb39c('0x3b')]['create']({'name':_0x3c6bb8['name'],'resourceId':_0x3c6bb8['id'],'type':_0x14a918[_0xb39c('0x3d')],'sectionId':_0x14a918['id']},{})[_0xb39c('0x23')](function(){return _0x1faff8;});}else{return _0x1faff8;}})['catch'](function(_0xb02e85){logger['error'](_0xb39c('0x66'),_0xb02e85);throw _0xb02e85;});}return _0x1faff8;})[_0xb39c('0x23')](respondWithResult(_0xae75d4,0xc9))[_0xb39c('0x5a')](handleError(_0xae75d4,null));};exports[_0xb39c('0x67')]=function(_0x4b431,_0xe2e880){if(_0x4b431['body']['id']){delete _0x4b431[_0xb39c('0x68')]['id'];}return db['OpenchannelAccount'][_0xb39c('0x5e')]({'where':{'id':_0x4b431[_0xb39c('0x5c')]['id']},'include':[{'model':db[_0xb39c('0x5d')],'as':_0xb39c('0x3f')}]})[_0xb39c('0x23')](handleEntityNotFound(_0xe2e880,null))[_0xb39c('0x23')](saveUpdates(_0x4b431['body'],null))['then'](respondWithResult(_0xe2e880,null))['catch'](handleError(_0xe2e880,null));};exports[_0xb39c('0x3c')]=function(_0x3b5d41,_0x44b8d3){return db[_0xb39c('0x41')][_0xb39c('0x5e')]({'where':{'id':_0x3b5d41[_0xb39c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x44b8d3,null))[_0xb39c('0x23')](removeEntity(_0x44b8d3,null))[_0xb39c('0x5a')](handleError(_0x44b8d3,null));};exports[_0xb39c('0x69')]=function(_0x4375bd,_0x361eba){return db[_0xb39c('0x41')]['describe']()['then'](respondWithResult(_0x361eba,null))[_0xb39c('0x5a')](handleError(_0x361eba,null));};exports[_0xb39c('0x6a')]=function(_0x4a32a2,_0x4dac7f,_0x520db9){if(_0x4a32a2[_0xb39c('0x68')]['id']){delete _0x4a32a2[_0xb39c('0x68')]['id'];}return db[_0xb39c('0x41')]['find']({'where':{'id':_0x4a32a2[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x4dac7f,null))[_0xb39c('0x23')](function(_0x15947c){if(_0x15947c){_0x4a32a2['body']['OpenchannelAccountId']=_0x15947c['id'];return db[_0xb39c('0x6b')][_0xb39c('0x5f')](_0x4a32a2['body']);}})[_0xb39c('0x23')](respondWithResult(_0x4dac7f,null))[_0xb39c('0x5a')](handleError(_0x4dac7f,null));};exports[_0xb39c('0x6c')]=function(_0x2863f5,_0x122ab4,_0x26449b){var _0x523b7a={'raw':![],'where':{}};var _0x5fe8ef={};var _0x31ed32={'count':0x0,'rows':[]};return db[_0xb39c('0x41')][_0xb39c('0x6d')]({'where':{'id':_0x2863f5[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x122ab4,null))[_0xb39c('0x23')](function(_0x382ae6){if(_0x382ae6){_0x5fe8ef[_0xb39c('0x46')]=_[_0xb39c('0x48')](db[_0xb39c('0x6b')][_0xb39c('0x42')]);_0x5fe8ef[_0xb39c('0x47')]=_[_0xb39c('0x48')](_0x2863f5[_0xb39c('0x47')]);_0x5fe8ef[_0xb39c('0x52')]=_[_0xb39c('0x4a')](_0x5fe8ef['model'],_0x5fe8ef[_0xb39c('0x47')]);_0x523b7a['attributes']=_[_0xb39c('0x4a')](_0x5fe8ef['model'],qs['fields'](_0x2863f5[_0xb39c('0x47')][_0xb39c('0x4b')]));_0x523b7a[_0xb39c('0x49')]=_0x523b7a[_0xb39c('0x49')][_0xb39c('0x4c')]?_0x523b7a[_0xb39c('0x49')]:_0x5fe8ef[_0xb39c('0x46')];if(!_0x2863f5[_0xb39c('0x47')][_0xb39c('0x4d')](_0xb39c('0x6e'))){_0x523b7a[_0xb39c('0x4e')]=qs[_0xb39c('0x4e')](_0x2863f5['query'][_0xb39c('0x4e')]);_0x523b7a[_0xb39c('0x32')]=qs['offset'](_0x2863f5['query']['offset']);}_0x523b7a[_0xb39c('0x4f')]=qs[_0xb39c('0x50')](_0x2863f5[_0xb39c('0x47')][_0xb39c('0x50')]);_0x523b7a[_0xb39c('0x51')]=qs[_0xb39c('0x52')](_['pick'](_0x2863f5[_0xb39c('0x47')],_0x5fe8ef[_0xb39c('0x52')]));_0x523b7a[_0xb39c('0x51')][_0xb39c('0x6f')]=_0x382ae6['id'];if(_0x2863f5[_0xb39c('0x47')][_0xb39c('0x56')]){_0x523b7a[_0xb39c('0x51')]=_[_0xb39c('0x54')](_0x523b7a['where'],{'$or':_[_0xb39c('0x40')](_0x523b7a[_0xb39c('0x49')],function(_0x555fad){var _0x376c69={};_0x376c69[_0x555fad]={'$like':'%'+_0x2863f5[_0xb39c('0x47')][_0xb39c('0x56')]+'%'};return _0x376c69;})});}_0x523b7a=_[_0xb39c('0x54')]({},_0x523b7a,_0x2863f5[_0xb39c('0x70')]);return db[_0xb39c('0x6b')]['count']({'where':_0x523b7a['where']})['then'](function(_0x5f16f0){_0x31ed32['count']=_0x5f16f0;if(_0x2863f5[_0xb39c('0x47')]['includeAll']){_0x523b7a['include']=[{'all':!![]}];}return db[_0xb39c('0x6b')]['findAll'](_0x523b7a);})[_0xb39c('0x23')](function(_0x3b15a8){_0x31ed32[_0xb39c('0x59')]=_0x3b15a8;return _0x31ed32;});}})[_0xb39c('0x23')](respondWithFilteredResult(_0x122ab4,_0x523b7a))[_0xb39c('0x5a')](handleError(_0x122ab4,null));};exports['removeDispositions']=function(_0x1a7868,_0x321ed2,_0x2015a3){return db[_0xb39c('0x41')][_0xb39c('0x5e')]({'where':{'id':_0x1a7868[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x321ed2,null))[_0xb39c('0x23')](function(_0x483030){if(_0x483030){return _0x483030[_0xb39c('0x71')](_0x1a7868[_0xb39c('0x47')][_0xb39c('0x72')]);}})['then'](respondWithStatusCode(_0x321ed2,null))[_0xb39c('0x5a')](handleError(_0x321ed2,null));};exports['addAnswer']=function(_0x5dd383,_0x2f4a18,_0x526cd0){if(_0x5dd383[_0xb39c('0x68')]['id']){delete _0x5dd383[_0xb39c('0x68')]['id'];}return db[_0xb39c('0x41')][_0xb39c('0x5e')]({'where':{'id':_0x5dd383['params']['id']}})['then'](handleEntityNotFound(_0x2f4a18,null))[_0xb39c('0x23')](function(_0x36bd0d){if(_0x36bd0d){_0x5dd383[_0xb39c('0x68')][_0xb39c('0x6f')]=_0x36bd0d['id'];return db[_0xb39c('0x73')][_0xb39c('0x5f')](_0x5dd383[_0xb39c('0x68')]);}})[_0xb39c('0x23')](respondWithResult(_0x2f4a18,null))[_0xb39c('0x5a')](handleError(_0x2f4a18,null));};exports[_0xb39c('0x74')]=function(_0x395536,_0x67b799,_0x8fbc86){var _0x503366={'raw':![],'where':{}};var _0x433e97={};var _0x4ea315={'count':0x0,'rows':[]};return db[_0xb39c('0x41')][_0xb39c('0x6d')]({'where':{'id':_0x395536[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x67b799,null))['then'](function(_0x5aea72){if(_0x5aea72){_0x433e97[_0xb39c('0x46')]=_['keys'](db['CannedAnswer'][_0xb39c('0x42')]);_0x433e97[_0xb39c('0x47')]=_[_0xb39c('0x48')](_0x395536['query']);_0x433e97[_0xb39c('0x52')]=_['intersection'](_0x433e97['model'],_0x433e97['query']);_0x503366[_0xb39c('0x49')]=_['intersection'](_0x433e97['model'],qs[_0xb39c('0x4b')](_0x395536[_0xb39c('0x47')][_0xb39c('0x4b')]));_0x503366[_0xb39c('0x49')]=_0x503366[_0xb39c('0x49')][_0xb39c('0x4c')]?_0x503366[_0xb39c('0x49')]:_0x433e97[_0xb39c('0x46')];if(!_0x395536[_0xb39c('0x47')][_0xb39c('0x4d')](_0xb39c('0x6e'))){_0x503366[_0xb39c('0x4e')]=qs['limit'](_0x395536['query'][_0xb39c('0x4e')]);_0x503366[_0xb39c('0x32')]=qs[_0xb39c('0x32')](_0x395536[_0xb39c('0x47')][_0xb39c('0x32')]);}_0x503366[_0xb39c('0x4f')]=qs[_0xb39c('0x50')](_0x395536['query'][_0xb39c('0x50')]);_0x503366[_0xb39c('0x51')]=qs[_0xb39c('0x52')](_['pick'](_0x395536[_0xb39c('0x47')],_0x433e97[_0xb39c('0x52')]));_0x503366[_0xb39c('0x51')][_0xb39c('0x6f')]=_0x5aea72['id'];if(_0x395536[_0xb39c('0x47')][_0xb39c('0x56')]){_0x503366['where']=_[_0xb39c('0x54')](_0x503366['where'],{'$or':_[_0xb39c('0x40')](_0x503366[_0xb39c('0x49')],function(_0x906e73){var _0x58d73a={};_0x58d73a[_0x906e73]={'$like':'%'+_0x395536[_0xb39c('0x47')]['filter']+'%'};return _0x58d73a;})});}_0x503366=_['merge']({},_0x503366,_0x395536[_0xb39c('0x70')]);return db[_0xb39c('0x73')][_0xb39c('0x34')]({'where':_0x503366[_0xb39c('0x51')]})[_0xb39c('0x23')](function(_0x3b88b6){_0x4ea315[_0xb39c('0x34')]=_0x3b88b6;if(_0x395536['query'][_0xb39c('0x57')]){_0x503366['include']=[{'all':!![]}];}return db[_0xb39c('0x73')][_0xb39c('0x58')](_0x503366);})[_0xb39c('0x23')](function(_0x2af4a7){_0x4ea315[_0xb39c('0x59')]=_0x2af4a7;return _0x4ea315;});}})['then'](respondWithFilteredResult(_0x67b799,_0x503366))[_0xb39c('0x5a')](handleError(_0x67b799,null));};exports[_0xb39c('0x75')]=function(_0x2af54e,_0x4a61b9,_0x4cc0af){return db[_0xb39c('0x41')][_0xb39c('0x5e')]({'where':{'id':_0x2af54e[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x4a61b9,null))[_0xb39c('0x23')](function(_0x1ae491){if(_0x1ae491){return _0x1ae491['removeAnswers'](_0x2af54e[_0xb39c('0x47')][_0xb39c('0x72')]);}})['then'](respondWithStatusCode(_0x4a61b9,null))[_0xb39c('0x5a')](handleError(_0x4a61b9,null));};exports[_0xb39c('0x76')]=function(_0x44c911,_0x2a37a6,_0x1fb2ee){var _0x23f924={'body':_0x44c911[_0xb39c('0x68')],'channel':_0xb39c('0x77')};var _0x10d3f6=[];var _0x17f3b5=[];var _0x47a815={};var _0x2ec034=![];return db['CmContact'][_0xb39c('0x69')]()[_0xb39c('0x23')](function(_0xed648a){if(!_0xed648a){throw new db[(_0xb39c('0x78'))][(_0xb39c('0x79'))](_0xb39c('0x7a'));}_0x10d3f6=_[_0xb39c('0x7b')](_[_0xb39c('0x48')](_0xed648a),['createdAt','updatedAt']);_0x17f3b5=_[_0xb39c('0x7b')](_[_0xb39c('0x48')](_0xed648a),['createdAt',_0xb39c('0x7c'),_0xb39c('0x7d'),_0xb39c('0x7e')]);if(_0x44c911[_0xb39c('0x68')]['id']){delete _0x44c911[_0xb39c('0x68')]['id'];}if(_[_0xb39c('0x7f')](_0x44c911[_0xb39c('0x68')][_0xb39c('0x80')])){throw new db[(_0xb39c('0x78'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb39c('0x7f')](_0x44c911[_0xb39c('0x68')][_0xb39c('0x68')])||_0x44c911[_0xb39c('0x68')][_0xb39c('0x68')]===''){throw new db['Sequelize'][(_0xb39c('0x79'))](_0xb39c('0x81'));}if(_[_0xb39c('0x7f')](_0x44c911[_0xb39c('0x68')]['mapKey'])){throw new db['Sequelize'][(_0xb39c('0x79'))](_0xb39c('0x82')+_0x17f3b5);}if(!_[_0xb39c('0x83')](_0x17f3b5,_0x44c911[_0xb39c('0x68')][_0xb39c('0x84')])){throw new db['Sequelize']['ValidationError'](_0xb39c('0x85')+_0x17f3b5);}_0x47a815[_0x44c911[_0xb39c('0x68')][_0xb39c('0x84')]]=_0x44c911[_0xb39c('0x68')][_0xb39c('0x80')];})['then'](function(){return db[_0xb39c('0x41')][_0xb39c('0x5e')]({'where':{'id':_0x44c911['params']['id']},'include':[{'model':db[_0xb39c('0x86')],'as':_0xb39c('0x87'),'include':[{'model':db[_0xb39c('0x88')],'as':_0xb39c('0x89'),'where':_0x47a815,'limit':0x1,'order':[[_0xb39c('0x7c'),_0xb39c('0x8a')]]}]},{'model':db[_0xb39c('0x8b')],'as':_0xb39c('0x8c')}]});})[_0xb39c('0x23')](handleEntityNotFound(_0x2a37a6,null))['then'](function(_0x36416f){if(_0x36416f&&_0x36416f[_0xb39c('0x87')]){_0x23f924[_0xb39c('0x8d')]=_0x36416f;_0x23f924[_0xb39c('0x8e')]=_0x36416f['Applications'];_0x23f924[_0xb39c('0x8f')]=_0x36416f[_0xb39c('0x87')];_0x23f924[_0xb39c('0x8e')]=_[_0xb39c('0x90')](_0x23f924['applications'],[_0xb39c('0x91')],[_0xb39c('0x92')]);if(_0x23f924[_0xb39c('0x8d')][_0xb39c('0x8c')]){delete _0x23f924[_0xb39c('0x8d')][_0xb39c('0x8c')];}if(_0x23f924['account']['List']&&_0x23f924[_0xb39c('0x8d')]['List'][_0xb39c('0x89')][_0xb39c('0x4c')]){return _0x23f924['account'][_0xb39c('0x87')]['Contacts'][0x0];}var _0x5c8a88=_[_0xb39c('0x1d')](_0x44c911['body'],{'firstName':_0x44c911['body'][_0xb39c('0x80')],'ListId':_0x36416f['ListId']});_0x5c8a88[_0x44c911['body']['mapKey']]=_0x44c911['body']['from'];return db[_0xb39c('0x88')][_0xb39c('0x5f')](_0x5c8a88,{'fields':_0x10d3f6,'raw':!![]});}})['then'](handleEntityNotFound(_0x2a37a6,null))[_0xb39c('0x23')](function(_0x4e47bb){_0x23f924[_0xb39c('0x93')]=_0x4e47bb;if(_0x4e47bb){var _0xd0c306={'ContactId':_0x4e47bb['id'],'OpenchannelAccountId':_0x44c911['params']['id'],'from':(_0x4e47bb[_0xb39c('0x94')]||'')+'\x20'+(_0x4e47bb[_0xb39c('0x95')]||'')};var _0x46d80b={'OpenchannelAccountId':_0x44c911[_0xb39c('0x5c')]['id'],'closed':![]};if(_0x44c911[_0xb39c('0x68')]['threadId']){_0x46d80b['threadId']=_0x44c911[_0xb39c('0x68')][_0xb39c('0x96')];return db[_0xb39c('0x97')]['find']({'where':_0x46d80b})[_0xb39c('0x23')](function(_0x34e5c9){if(_0x34e5c9){return[_0x34e5c9,![]];}_0xd0c306[_0xb39c('0x96')]=_0x44c911[_0xb39c('0x68')]['threadId'];_0xd0c306[_0xb39c('0x98')]=_0x44c911['body'][_0xb39c('0x98')];return db[_0xb39c('0x97')][_0xb39c('0x5f')](_0xd0c306)[_0xb39c('0x23')](function(_0x391873){return[_0x391873,!![]];});});}else{_0x46d80b[_0xb39c('0x96')]=null;}_0x46d80b['ContactId']=_0x4e47bb['id'];return db['OpenchannelInteraction']['find']({'where':_0x46d80b})[_0xb39c('0x23')](function(_0x31e068){if(_0x31e068){return[_0x31e068,![]];}return db[_0xb39c('0x97')][_0xb39c('0x5f')](_0xd0c306)[_0xb39c('0x23')](function(_0x1d2954){return[_0x1d2954,!![]];});});}})[_0xb39c('0x99')](function(_0x4bb4ba,_0x57b555){if(_0x4bb4ba){_0x2ec034=_0x57b555;if(!_0x57b555){var _0x4aa68c={'from':(_0x23f924[_0xb39c('0x93')][_0xb39c('0x94')]||'')+'\x20'+(_0x23f924[_0xb39c('0x93')]['lastName']||'')};if(_0x44c911[_0xb39c('0x68')][_0xb39c('0x96')]&&_0x44c911[_0xb39c('0x68')][_0xb39c('0x9a')]&&_0x44c911[_0xb39c('0x68')][_0xb39c('0x96')]!=_0x44c911['body'][_0xb39c('0x9a')]){_0x4aa68c['threadId']=_0x44c911[_0xb39c('0x68')]['messageId'];}return _0x4bb4ba[_0xb39c('0x67')](_0x4aa68c);}else{return _0x4bb4ba;}}})[_0xb39c('0x23')](function(_0x36045a){_0x23f924[_0xb39c('0x9b')]=_0x36045a['get']({'plain':!![]});_0x23f924[_0xb39c('0x9b')]['created']=_0x2ec034;if(_0x23f924[_0xb39c('0x9b')][_0xb39c('0x9c')]){if(_0x23f924[_0xb39c('0x8d')][_0xb39c('0x9d')]){_0x23f924[_0xb39c('0x8e')][_0xb39c('0x9e')]({'id':0x0,'priority':_0x23f924[_0xb39c('0x8e')][_0xb39c('0x4c')]+0x1,'app':_0xb39c('0x9f'),'appdata':'unmanaged','interval':_0xb39c('0xa0')});}}return db['OpenchannelMessage'][_0xb39c('0x5f')]({'body':_0x44c911['body'][_0xb39c('0x68')],'OpenchannelAccountId':_0x44c911[_0xb39c('0x5c')]['id'],'OpenchannelInteractionId':_0x36045a['id'],'direction':'in','ContactId':_0x23f924[_0xb39c('0x93')]['id'],'AttachmentId':_0x44c911[_0xb39c('0x68')][_0xb39c('0xa1')]});})[_0xb39c('0x23')](function(_0x59788d){_0x23f924[_0xb39c('0x2c')]=_0x59788d;if(_0x23f924[_0xb39c('0x9b')]['UserId']){return db['User'][_0xb39c('0x5e')]({'attributes':['id',_0xb39c('0x3d')],'where':{'id':_0x23f924[_0xb39c('0x9b')][_0xb39c('0xa2')]}})[_0xb39c('0x23')](function(_0x14e7c5){if(_0x14e7c5){_0x23f924['applications'][_0xb39c('0xa3')]({'id':0x0,'priority':0x0,'app':_0xb39c('0xa4'),'appdata':_0x14e7c5[_0xb39c('0x3d')]+','+(_0x23f924[_0xb39c('0x8d')]['waitForTheAssignedAgent']||0xa),'interval':_0xb39c('0xa0')});_0x23f924['forcedOwnership']=![];}return respondWithRpcPromise(_0xb39c('0xa5'),_0xb39c('0xa6'),_0x23f924);});}return respondWithRpcPromise(_0xb39c('0xa5'),_0xb39c('0xa6'),_0x23f924);})[_0xb39c('0x23')](function(_0x5f26c6){respondWithRpcPromise('EventManager',_0xb39c('0xa7'),{'event':_0xb39c('0x76'),'message':_0x5f26c6},client9002);return _0x5f26c6;})[_0xb39c('0x23')](respondWithResult(_0x2a37a6,null))[_0xb39c('0x5a')](handleError(_0x2a37a6,null));};exports[_0xb39c('0xa8')]=function(_0x34a6ad,_0xc4a960){var _0x267f3f=_0x34a6ad[_0xb39c('0x5c')]['id'];var _0x21b0cf=_0x34a6ad[_0xb39c('0x68')];var _0x258970=0xc8;var _0x1140a0=null;return db[_0xb39c('0xa9')]['transaction']({'isolationLevel':db[_0xb39c('0xa9')]['Transaction'][_0xb39c('0xaa')][_0xb39c('0xab')]},function(_0x2fa293){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x267f3f},'transaction':_0x2fa293})[_0xb39c('0x23')](function(_0x321abe){if(_0x321abe){return db[_0xb39c('0x8b')][_0xb39c('0x3c')]({'where':{'OpenchannelAccountId':_0x267f3f},'transaction':_0x2fa293})[_0xb39c('0x23')](function(){var _0x5880c3=_['map'](_0x21b0cf,function(_0xc607b2){_0xc607b2['OpenchannelAccountId']=_0x267f3f;return _0xc607b2;});return db['OpenchannelApplication'][_0xb39c('0xac')](_0x5880c3,{'transaction':_0x2fa293});});}else{_0x258970=0x194;_0x1140a0=[];}});})['then'](function(){if(_0x258970!==0x194){return db[_0xb39c('0x8b')][_0xb39c('0xad')]({'where':{'OpenchannelAccountId':_0x267f3f},'order':_0xb39c('0x91')})[_0xb39c('0x23')](function(_0x17ca93){_0x1140a0=_0x17ca93;});}})[_0xb39c('0x5a')](function(_0x450730){_0x258970=0x1f4;logger['error'](_0x450730[_0xb39c('0xae')]);if(_0x450730[_0xb39c('0x3d')]){delete _0x450730['name'];}_0x1140a0=_0x450730;})[_0xb39c('0xaf')](function(){if(_0x1140a0===null){_0xc4a960['sendStatus'](_0x258970);}else{if(_0x258970===0x1f4){_0xc4a960[_0xb39c('0x2f')](_0x258970)[_0xb39c('0xb0')](_0x1140a0);}else{_0xc4a960[_0xb39c('0x2f')](_0x258970)[_0xb39c('0x31')](_0x1140a0);}}});};exports[_0xb39c('0xb1')]=function(_0x408636,_0x1cb72f,_0x269fc0){var _0x142843={};var _0x1cfd1a={};var _0x5616c4;var _0x578246;return db['OpenchannelAccount'][_0xb39c('0x6d')]({'where':{'id':_0x408636[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x1cb72f,null))[_0xb39c('0x23')](function(_0x1b4056){if(_0x1b4056){_0x5616c4=_0x1b4056;_0x1cfd1a[_0xb39c('0x46')]=_[_0xb39c('0x48')](db['OpenchannelApplication'][_0xb39c('0x42')]);_0x1cfd1a[_0xb39c('0x47')]=_[_0xb39c('0x48')](_0x408636[_0xb39c('0x47')]);_0x1cfd1a['filters']=_['intersection'](_0x1cfd1a[_0xb39c('0x46')],_0x1cfd1a['query']);_0x142843[_0xb39c('0x49')]=_[_0xb39c('0x4a')](_0x1cfd1a[_0xb39c('0x46')],qs[_0xb39c('0x4b')](_0x408636[_0xb39c('0x47')][_0xb39c('0x4b')]));_0x142843['attributes']=_0x142843[_0xb39c('0x49')][_0xb39c('0x4c')]?_0x142843[_0xb39c('0x49')]:_0x1cfd1a['model'];_0x142843['order']=qs[_0xb39c('0x50')](_0x408636['query'][_0xb39c('0x50')]);_0x142843[_0xb39c('0x51')]=qs['filters'](_[_0xb39c('0x53')](_0x408636[_0xb39c('0x47')],_0x1cfd1a[_0xb39c('0x52')]));if(_0x408636['query']['filter']){_0x142843['where']=_[_0xb39c('0x54')](_0x142843['where'],{'$or':_[_0xb39c('0x40')](_0x142843[_0xb39c('0x49')],function(_0x1e24b5){var _0x150a1a={};_0x150a1a[_0x1e24b5]={'$like':'%'+_0x408636['query'][_0xb39c('0x56')]+'%'};return _0x150a1a;})});}_0x142843=_[_0xb39c('0x54')]({},_0x142843,_0x408636[_0xb39c('0x70')]);return _0x5616c4[_0xb39c('0xb1')](_0x142843);}})[_0xb39c('0x23')](function(_0x3e4336){if(_0x3e4336){_0x578246=_0x3e4336['length'];if(!_0x408636[_0xb39c('0x47')][_0xb39c('0x4d')](_0xb39c('0x6e'))){_0x142843[_0xb39c('0x4e')]=qs[_0xb39c('0x4e')](_0x408636[_0xb39c('0x47')][_0xb39c('0x4e')]);_0x142843[_0xb39c('0x32')]=qs[_0xb39c('0x32')](_0x408636[_0xb39c('0x47')]['offset']);}return _0x5616c4[_0xb39c('0xb1')](_0x142843);}})['then'](function(_0x2d992f){if(_0x2d992f){return _0x2d992f?{'count':_0x578246,'rows':_0x2d992f}:null;}})[_0xb39c('0x23')](respondWithResult(_0x1cb72f,null))[_0xb39c('0x5a')](handleError(_0x1cb72f,null));};exports[_0xb39c('0xb2')]=function(_0x883422,_0x5dfc40,_0x4e5e7d){var _0x41312d={'raw':![],'where':{}};var _0x5ee2fe={};var _0x19219d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb39c('0x6d')]({'where':{'id':_0x883422['params']['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x5dfc40,null))[_0xb39c('0x23')](function(_0x3f4fe6){if(_0x3f4fe6){_0x5ee2fe['model']=_[_0xb39c('0x48')](db[_0xb39c('0x97')][_0xb39c('0x42')]);_0x5ee2fe['query']=_[_0xb39c('0x48')](_0x883422[_0xb39c('0x47')]);_0x5ee2fe['filters']=_[_0xb39c('0x4a')](_0x5ee2fe['model'],_0x5ee2fe['query']);_0x41312d[_0xb39c('0x49')]=_[_0xb39c('0x4a')](_0x5ee2fe[_0xb39c('0x46')],qs['fields'](_0x883422['query'][_0xb39c('0x4b')]));_0x41312d['attributes']=_0x41312d[_0xb39c('0x49')][_0xb39c('0x4c')]?_0x41312d[_0xb39c('0x49')]:_0x5ee2fe[_0xb39c('0x46')];if(!_0x883422['query'][_0xb39c('0x4d')](_0xb39c('0x6e'))){_0x41312d[_0xb39c('0x4e')]=qs['limit'](_0x883422['query']['limit']);_0x41312d[_0xb39c('0x32')]=qs['offset'](_0x883422[_0xb39c('0x47')][_0xb39c('0x32')]);}_0x41312d['order']=qs[_0xb39c('0x50')](_0x883422[_0xb39c('0x47')][_0xb39c('0x50')]);_0x41312d[_0xb39c('0x51')]=qs['filters'](_[_0xb39c('0x53')](_0x883422['query'],_0x5ee2fe[_0xb39c('0x52')]));_0x41312d[_0xb39c('0x51')][_0xb39c('0x6f')]=_0x3f4fe6['id'];if(_0x883422[_0xb39c('0x47')][_0xb39c('0x56')]){_0x41312d['where']=_[_0xb39c('0x54')](_0x41312d[_0xb39c('0x51')],{'$or':_[_0xb39c('0x40')](_0x41312d[_0xb39c('0x49')],function(_0x417a66){var _0x3aaac4={};_0x3aaac4[_0x417a66]={'$like':'%'+_0x883422[_0xb39c('0x47')][_0xb39c('0x56')]+'%'};return _0x3aaac4;})});}_0x41312d=_[_0xb39c('0x54')]({},_0x41312d,_0x883422[_0xb39c('0x70')]);return db[_0xb39c('0x97')][_0xb39c('0x34')]({'where':_0x41312d[_0xb39c('0x51')]})[_0xb39c('0x23')](function(_0x34d945){_0x19219d[_0xb39c('0x34')]=_0x34d945;if(_0x883422[_0xb39c('0x47')]['includeAll']){_0x41312d['include']=[{'model':db[_0xb39c('0x88')],'as':_0xb39c('0xb3'),'required':![]},{'model':db[_0xb39c('0xb4')],'as':_0xb39c('0xb5'),'attributes':['name',_0xb39c('0xb6'),'internal'],'required':![]},{'model':db[_0xb39c('0xb7')],'as':_0xb39c('0xb8'),'attributes':['id',_0xb39c('0x3d'),_0xb39c('0xb9')],'where':_0x883422[_0xb39c('0x47')]['tag']?{'id':_0x883422[_0xb39c('0x47')][_0xb39c('0xba')]}:undefined,'required':_0x883422['query'][_0xb39c('0xba')]?!![]:![]}];}return db[_0xb39c('0x97')][_0xb39c('0x58')](_0x41312d);})[_0xb39c('0x23')](function(_0x12ac89){_0x19219d['rows']=_0x12ac89;return _0x19219d;});}})['then'](respondWithFilteredResult(_0x5dfc40,_0x41312d))[_0xb39c('0x5a')](handleError(_0x5dfc40,null));};exports[_0xb39c('0xbb')]=function(_0x4060df,_0x4e55a5,_0x64c9e9){return db[_0xb39c('0x41')][_0xb39c('0x5e')]({'where':{'id':_0x4060df[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x4e55a5,null))[_0xb39c('0x23')](function(_0x4fb50a){if(_0x4fb50a){return _0x4fb50a[_0xb39c('0xbb')](_0x4060df[_0xb39c('0x68')][_0xb39c('0x72')],_[_0xb39c('0xbc')](_0x4060df[_0xb39c('0x68')],[_0xb39c('0x72'),'id'])||{})[_0xb39c('0x99')](function(_0x53fbd7){for(var _0x26f87b=0x0;_0x26f87b<_0x4060df[_0xb39c('0x68')]['ids']['length'];_0x26f87b+=0x1){socket[_0xb39c('0xbd')](_0xb39c('0xbe'),{'UserId':Number(_0x4060df[_0xb39c('0x68')][_0xb39c('0x72')][_0x26f87b]),'OpenchannelAccountId':Number(_0x4060df['params']['id'])});}return _0x53fbd7;});}})[_0xb39c('0x23')](respondWithResult(_0x4e55a5,null))['catch'](handleError(_0x4e55a5,null));};exports[_0xb39c('0xbf')]=function(_0x142c92,_0x1e6337,_0x1b9131){return db[_0xb39c('0x41')][_0xb39c('0x5e')]({'where':{'id':_0x142c92[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x1e6337,null))[_0xb39c('0x23')](function(_0x21da21){if(_0x21da21){return _0x21da21[_0xb39c('0xbf')](_0x142c92[_0xb39c('0x47')][_0xb39c('0x72')])[_0xb39c('0x23')](function(){if(_['isArray'](_0x142c92[_0xb39c('0x47')]['ids'])){for(var _0x28ac59=0x0;_0x28ac59<_0x142c92[_0xb39c('0x47')][_0xb39c('0x72')]['length'];_0x28ac59+=0x1){socket[_0xb39c('0xbd')](_0xb39c('0xc0'),{'UserId':Number(_0x142c92[_0xb39c('0x47')]['ids'][_0x28ac59]),'OpenchannelAccountId':Number(_0x142c92[_0xb39c('0x5c')]['id'])});}}else{socket['emit'](_0xb39c('0xc0'),{'UserId':Number(_0x142c92[_0xb39c('0x47')][_0xb39c('0x72')]),'OpenchannelAccountId':Number(_0x142c92[_0xb39c('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x1e6337,null))[_0xb39c('0x5a')](handleError(_0x1e6337,null));};exports[_0xb39c('0xc1')]=function(_0x3279e5,_0x353cda,_0x37d9dd){var _0x1f6ba2={};var _0x190665={};var _0x435ef7;var _0x3b938b;return db['OpenchannelAccount'][_0xb39c('0x6d')]({'where':{'id':_0x3279e5[_0xb39c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x353cda,null))['then'](function(_0x3c0fda){if(_0x3c0fda){_0x435ef7=_0x3c0fda;_0x190665[_0xb39c('0x46')]=_[_0xb39c('0x48')](db['User'][_0xb39c('0x42')]);_0x190665[_0xb39c('0x47')]=_['keys'](_0x3279e5[_0xb39c('0x47')]);_0x190665[_0xb39c('0x52')]=_['intersection'](_0x190665['model'],_0x190665[_0xb39c('0x47')]);_0x1f6ba2[_0xb39c('0x49')]=_[_0xb39c('0x4a')](_0x190665[_0xb39c('0x46')],qs[_0xb39c('0x4b')](_0x3279e5[_0xb39c('0x47')][_0xb39c('0x4b')]));_0x1f6ba2[_0xb39c('0x49')]=_0x1f6ba2[_0xb39c('0x49')]['length']?_0x1f6ba2[_0xb39c('0x49')]:_0x190665[_0xb39c('0x46')];_0x1f6ba2[_0xb39c('0x4f')]=qs[_0xb39c('0x50')](_0x3279e5[_0xb39c('0x47')][_0xb39c('0x50')]);_0x1f6ba2[_0xb39c('0x51')]=qs['filters'](_[_0xb39c('0x53')](_0x3279e5['query'],_0x190665[_0xb39c('0x52')]));if(_0x3279e5[_0xb39c('0x47')][_0xb39c('0x56')]){_0x1f6ba2[_0xb39c('0x51')]=_[_0xb39c('0x54')](_0x1f6ba2[_0xb39c('0x51')],{'$or':_[_0xb39c('0x40')](_0x1f6ba2[_0xb39c('0x49')],function(_0x43c715){var _0x2c26f6={};_0x2c26f6[_0x43c715]={'$like':'%'+_0x3279e5[_0xb39c('0x47')]['filter']+'%'};return _0x2c26f6;})});}_0x1f6ba2=_[_0xb39c('0x54')]({},_0x1f6ba2,_0x3279e5['options']);return _0x435ef7[_0xb39c('0xc1')](_0x1f6ba2);}})[_0xb39c('0x23')](function(_0x593fb9){if(_0x593fb9){_0x3b938b=_0x593fb9[_0xb39c('0x4c')];if(!_0x3279e5[_0xb39c('0x47')][_0xb39c('0x4d')](_0xb39c('0x6e'))){_0x1f6ba2[_0xb39c('0x4e')]=qs[_0xb39c('0x4e')](_0x3279e5['query'][_0xb39c('0x4e')]);_0x1f6ba2['offset']=qs[_0xb39c('0x32')](_0x3279e5[_0xb39c('0x47')][_0xb39c('0x32')]);}return _0x435ef7[_0xb39c('0xc1')](_0x1f6ba2);}})[_0xb39c('0x23')](function(_0x13deb1){if(_0x13deb1){return _0x13deb1?{'count':_0x3b938b,'rows':_0x13deb1}:null;}})[_0xb39c('0x23')](respondWithResult(_0x353cda,null))[_0xb39c('0x5a')](handleError(_0x353cda,null));};exports[_0xb39c('0xb0')]=function(_0x548e31,_0x5058dc,_0x3e6380){var _0x5651ed,_0x314167,_0x4872f5;if(_[_0xb39c('0x7f')](_0x548e31[_0xb39c('0x68')][_0xb39c('0x68')])||_0x548e31[_0xb39c('0x68')][_0xb39c('0x68')]===''){throw new db[(_0xb39c('0x78'))][(_0xb39c('0x79'))](_0xb39c('0x81'));}if(_[_0xb39c('0x7f')](_0x548e31['body']['to'])){}_0x5651ed=_0x548e31['body']['to'];return db['OpenchannelAccount'][_0xb39c('0x6d')]({'where':{'id':_0x548e31[_0xb39c('0x5c')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x5058dc,null))[_0xb39c('0x23')](function(_0x318700){if(_0x318700){return db[_0xb39c('0x41')]['find']({'where':{'id':_0x318700['id']},'include':[{'model':db[_0xb39c('0x86')],'as':_0xb39c('0x87'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x318700['mapKey']]:_0x5651ed},'limit':0x1,'order':[[_0xb39c('0x7c'),_0xb39c('0x8a')]]}]}]})['then'](handleEntityNotFound(_0x5058dc,null))[_0xb39c('0x23')](function(_0x5c69f6){if(_0x5c69f6&&_0x5c69f6[_0xb39c('0x87')]){_0x314167=_0x5c69f6[_0xb39c('0x3a')]({'plain':!![]});if(_0x314167['List']&&_0x314167[_0xb39c('0x87')][_0xb39c('0x89')][_0xb39c('0x4c')]){return _0x314167[_0xb39c('0x87')][_0xb39c('0x89')][0x0];}return db[_0xb39c('0x88')][_0xb39c('0x5f')](_[_0xb39c('0x1d')](_0x548e31[_0xb39c('0x68')],{'firstName':_0x5651ed,[_0x5c69f6['mapKey']]:_0x5651ed,'phone':_0x5651ed,'ListId':_0x314167[_0xb39c('0x7e')]}));}})['then'](handleEntityNotFound(_0x5058dc,null))['then'](function(_0x10d0ba){if(_0x10d0ba){_0x4872f5=_0x10d0ba;return db['OpenchannelInteraction'][_0xb39c('0x5e')]({'where':{'ContactId':_0x4872f5['id'],'closed':![],'OpenchannelAccountId':_0x314167['id']}})[_0xb39c('0x23')](function(_0x43d05f){if(_0x43d05f){return[_0x43d05f,![]];}return db[_0xb39c('0x97')][_0xb39c('0x5f')]({'UserId':_0x548e31['user']['id'],'ContactId':_0x4872f5['id'],'OpenchannelAccountId':_0x314167['id'],'lastMsgDirection':_0xb39c('0xc2'),'Messages':[_['merge'](_0x548e31[_0xb39c('0x68')],{'read':![],'body':_0x548e31[_0xb39c('0x68')][_0xb39c('0x68')],'OpenchannelAccountId':_0x314167['id'],'UserId':_0x548e31['user']['id'],'ContactId':_0x4872f5['id']})]},{'include':[{'model':db[_0xb39c('0xc3')],'as':_0xb39c('0xc4')}]})['then'](function(_0x1cd4e3){return[_0x1cd4e3,!![]];});});}})[_0xb39c('0x99')](function(_0x53511f,_0x3cb64d){if(_0x3cb64d){return _0x53511f;}return db[_0xb39c('0xc3')][_0xb39c('0x5f')](_[_0xb39c('0x54')](_0x548e31[_0xb39c('0x68')],{'read':![],'body':_0x548e31['body'][_0xb39c('0x68')],'OpenchannelAccountId':_0x314167['id'],'OpenchannelInteractionId':_0x53511f['id'],'UserId':_0x548e31['user']['id'],'ContactId':_0x4872f5['id']}))[_0xb39c('0x23')](function(_0x515098){_0x53511f[_0xb39c('0xc5')][_0xb39c('0xc4')]=[];_0x53511f[_0xb39c('0xc5')][_0xb39c('0xc4')][_0xb39c('0x9e')](_0x515098['dataValues']);return _0x53511f;});});}})[_0xb39c('0x23')](respondWithResult(_0x5058dc,null))[_0xb39c('0x5a')](handleError(_0x5058dc,null));};
\ No newline at end of file
+var _0x9a89=['READ_COMMITTED','bulkCreate','findAndCountAll','priority','send','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','ids','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelAccount.socket','jayson/promise','client','http','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelAccount','includeAll','include','findAll','show','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','params','OpenchannelAccountId','findOne','Disposition','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','asc','ListId','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','EventManager','addApplications','transaction','ISOLATION_LEVELS'];(function(_0x442301,_0x4fc402){var _0x4420e6=function(_0x1d0aa7){while(--_0x1d0aa7){_0x442301['push'](_0x442301['shift']());}};_0x4420e6(++_0x4fc402);}(_0x9a89,0x194));var _0x99a8=function(_0x28f135,_0x4979d9){_0x28f135=_0x28f135-0x0;var _0x59c46f=_0x9a89[_0x28f135];return _0x59c46f;};'use strict';var emlformat=require(_0x99a8('0x0'));var rimraf=require(_0x99a8('0x1'));var zipdir=require(_0x99a8('0x2'));var jsonpatch=require(_0x99a8('0x3'));var rp=require(_0x99a8('0x4'));var moment=require('moment');var BPromise=require(_0x99a8('0x5'));var Mustache=require(_0x99a8('0x6'));var util=require(_0x99a8('0x7'));var path=require(_0x99a8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x99a8('0x9'));var fs=require('fs');var fs_extra=require(_0x99a8('0xa'));var _=require(_0x99a8('0xb'));var squel=require(_0x99a8('0xc'));var crypto=require(_0x99a8('0xd'));var jsforce=require(_0x99a8('0xe'));var deskjs=require(_0x99a8('0xf'));var toCsv=require(_0x99a8('0x10'));var querystring=require(_0x99a8('0x11'));var Papa=require(_0x99a8('0x12'));var Redis=require('ioredis');var authService=require(_0x99a8('0x13'));var qs=require(_0x99a8('0x14'));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(_0x99a8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x99a8('0x16'))['db'];config['redis']=_[_0x99a8('0x17')](config[_0x99a8('0x18')],{'host':_0x99a8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x99a8('0x18')]));require(_0x99a8('0x1a'))['register'](socket);var jayson=require(_0x99a8('0x1b'));var client=jayson[_0x99a8('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x99a8('0x1c')][_0x99a8('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x181d18,_0x2c979e,_0x6e9d3e,_0x167687){return new BPromise(function(_0x23a7af,_0x30137d){var _0x5694e1=_0x167687||client;return _0x5694e1['request'](_0x181d18,_0x6e9d3e)['then'](function(_0x2118cd){logger['info'](_0x99a8('0x1e'),_0x2c979e,_0x99a8('0x1f'));logger[_0x99a8('0x20')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2c979e,_0x99a8('0x1f'),JSON[_0x99a8('0x21')](_0x2118cd));if(_0x2118cd[_0x99a8('0x22')]){if(_0x2118cd[_0x99a8('0x22')]['code']===0x1f4){logger['error'](_0x99a8('0x1e'),_0x2c979e,_0x2118cd[_0x99a8('0x22')][_0x99a8('0x23')]);return _0x30137d(_0x2118cd[_0x99a8('0x22')][_0x99a8('0x23')]);}logger[_0x99a8('0x22')](_0x99a8('0x1e'),_0x2c979e,_0x2118cd[_0x99a8('0x22')][_0x99a8('0x23')]);return _0x23a7af(_0x2118cd[_0x99a8('0x22')][_0x99a8('0x23')]);}else{logger[_0x99a8('0x24')](_0x99a8('0x1e'),_0x2c979e,_0x99a8('0x1f'));_0x23a7af(_0x2118cd['result'][_0x99a8('0x23')]);}})[_0x99a8('0x25')](function(_0x557b04){logger[_0x99a8('0x22')](_0x99a8('0x1e'),_0x2c979e,_0x557b04);_0x30137d(_0x557b04);});});}function respondWithStatusCode(_0x4a916a,_0x371f0a){_0x371f0a=_0x371f0a||0xcc;return function(_0x20fadf){if(_0x20fadf){return _0x4a916a[_0x99a8('0x26')](_0x371f0a);}return _0x4a916a[_0x99a8('0x27')](_0x371f0a)[_0x99a8('0x28')]();};}function respondWithResult(_0x2c2ca8,_0x85efa8){_0x85efa8=_0x85efa8||0xc8;return function(_0x2b4456){if(_0x2b4456){return _0x2c2ca8[_0x99a8('0x27')](_0x85efa8)[_0x99a8('0x29')](_0x2b4456);}};}function respondWithFilteredResult(_0x2be191,_0x3c72b1){return function(_0x1775f8){if(_0x1775f8){var _0x2eac4b=typeof _0x3c72b1[_0x99a8('0x2a')]===_0x99a8('0x2b')&&typeof _0x3c72b1[_0x99a8('0x2c')]===_0x99a8('0x2b');var _0x3fc85e=_0x1775f8['count'];var _0x55762e=_0x2eac4b?0x0:_0x3c72b1[_0x99a8('0x2a')];var _0x1aa614=_0x2eac4b?_0x1775f8[_0x99a8('0x2d')]:_0x3c72b1[_0x99a8('0x2a')]+_0x3c72b1[_0x99a8('0x2c')];var _0x350bc1;if(_0x1aa614>=_0x3fc85e){_0x1aa614=_0x3fc85e;_0x350bc1=0xc8;}else{_0x350bc1=0xce;}_0x2be191[_0x99a8('0x27')](_0x350bc1);return _0x2be191[_0x99a8('0x2e')](_0x99a8('0x2f'),_0x55762e+'-'+_0x1aa614+'/'+_0x3fc85e)[_0x99a8('0x29')](_0x1775f8);}return null;};}function patchUpdates(_0x5f1ecc){return function(_0x1f9ba5){try{jsonpatch['apply'](_0x1f9ba5,_0x5f1ecc,!![]);}catch(_0x5026aa){return BPromise[_0x99a8('0x30')](_0x5026aa);}return _0x1f9ba5[_0x99a8('0x31')]();};}function saveUpdates(_0x24b418,_0x1c4271){return function(_0x1b20a7){if(_0x1b20a7){return _0x1b20a7[_0x99a8('0x32')](_0x24b418)[_0x99a8('0x33')](function(_0x3d5520){return _0x3d5520;});}return null;};}function removeEntity(_0x52cf94,_0x396e28){return function(_0x296ba4){if(_0x296ba4){return _0x296ba4[_0x99a8('0x34')]()[_0x99a8('0x33')](function(){var _0x26bc0f=_0x296ba4[_0x99a8('0x35')]({'plain':!![]});var _0x2cc4c1=_0x99a8('0x36');return db[_0x99a8('0x37')][_0x99a8('0x34')]({'where':{'type':_0x2cc4c1,'resourceId':_0x26bc0f['id']}})['then'](function(){return _0x296ba4;});})[_0x99a8('0x33')](function(){_0x52cf94['status'](0xcc)[_0x99a8('0x28')]();});}};}function handleEntityNotFound(_0x24987a,_0x31f9c1){return function(_0x268491){if(!_0x268491){_0x24987a['sendStatus'](0x194);}return _0x268491;};}function handleError(_0x441581,_0x41336b){_0x41336b=_0x41336b||0x1f4;return function(_0x373e1a){logger[_0x99a8('0x22')](_0x373e1a[_0x99a8('0x38')]);if(_0x373e1a['name']){delete _0x373e1a[_0x99a8('0x39')];}_0x441581[_0x99a8('0x27')](_0x41336b)['send'](_0x373e1a);};}exports['index']=function(_0x58b44,_0x5735b7){var _0x2c051d={'include':[{'model':db[_0x99a8('0x3a')],'as':_0x99a8('0x3b')}]},_0x4fb918={},_0x355ab3={'count':0x0,'rows':[]};var _0x5b29e9=_['map'](db['OpenchannelAccount'][_0x99a8('0x3c')],function(_0x2aafad){return{'name':_0x2aafad[_0x99a8('0x3d')],'type':_0x2aafad[_0x99a8('0x3e')][_0x99a8('0x3f')]};});_0x4fb918[_0x99a8('0x40')]=_[_0x99a8('0x41')](_0x5b29e9,_0x99a8('0x39'));_0x4fb918['query']=_['keys'](_0x58b44[_0x99a8('0x42')]);_0x4fb918[_0x99a8('0x43')]=_[_0x99a8('0x44')](_0x4fb918[_0x99a8('0x40')],_0x4fb918['query']);_0x2c051d[_0x99a8('0x45')]=_[_0x99a8('0x44')](_0x4fb918[_0x99a8('0x40')],qs[_0x99a8('0x46')](_0x58b44['query'][_0x99a8('0x46')]));_0x2c051d['attributes']=_0x2c051d[_0x99a8('0x45')][_0x99a8('0x47')]?_0x2c051d[_0x99a8('0x45')]:_0x4fb918[_0x99a8('0x40')];if(!_0x58b44[_0x99a8('0x42')][_0x99a8('0x48')](_0x99a8('0x49'))){_0x2c051d[_0x99a8('0x2c')]=qs[_0x99a8('0x2c')](_0x58b44[_0x99a8('0x42')]['limit']);_0x2c051d[_0x99a8('0x2a')]=qs[_0x99a8('0x2a')](_0x58b44['query']['offset']);}_0x2c051d[_0x99a8('0x4a')]=qs[_0x99a8('0x4b')](_0x58b44[_0x99a8('0x42')][_0x99a8('0x4b')]);_0x2c051d[_0x99a8('0x4c')]=qs[_0x99a8('0x43')](_[_0x99a8('0x4d')](_0x58b44[_0x99a8('0x42')],_0x4fb918[_0x99a8('0x43')]),_0x5b29e9);if(_0x58b44[_0x99a8('0x42')][_0x99a8('0x4e')]){_0x2c051d['where']=_[_0x99a8('0x4f')](_0x2c051d[_0x99a8('0x4c')],{'$or':_[_0x99a8('0x41')](_0x5b29e9,function(_0x212495){if(_0x212495[_0x99a8('0x3e')]!=='VIRTUAL'){var _0x38298f={};_0x38298f[_0x212495[_0x99a8('0x39')]]={'$like':'%'+_0x58b44['query'][_0x99a8('0x4e')]+'%'};return _0x38298f;}})});}_0x2c051d=_[_0x99a8('0x4f')]({},_0x2c051d,_0x58b44[_0x99a8('0x50')]);var _0x10defd={'where':_0x2c051d[_0x99a8('0x4c')]};return db[_0x99a8('0x51')][_0x99a8('0x2d')](_0x10defd)[_0x99a8('0x33')](function(_0x4f440d){_0x355ab3[_0x99a8('0x2d')]=_0x4f440d;if(_0x58b44['query'][_0x99a8('0x52')]){_0x2c051d[_0x99a8('0x53')]=[{'all':!![]}];}return db[_0x99a8('0x51')][_0x99a8('0x54')](_0x2c051d);})[_0x99a8('0x33')](function(_0x644665){_0x355ab3['rows']=_0x644665;return _0x355ab3;})[_0x99a8('0x33')](respondWithFilteredResult(_0x5735b7,_0x2c051d))[_0x99a8('0x25')](handleError(_0x5735b7,null));};exports[_0x99a8('0x55')]=function(_0x8a5d94,_0x4fda40){var _0x136fb3={'raw':![],'where':{'id':_0x8a5d94['params']['id']},'include':[{'model':db[_0x99a8('0x3a')],'as':_0x99a8('0x3b')}]},_0x5b6af2={};_0x5b6af2[_0x99a8('0x40')]=_[_0x99a8('0x56')](db['OpenchannelAccount']['rawAttributes']);_0x5b6af2[_0x99a8('0x42')]=_[_0x99a8('0x56')](_0x8a5d94['query']);_0x5b6af2[_0x99a8('0x43')]=_[_0x99a8('0x44')](_0x5b6af2['model'],_0x5b6af2[_0x99a8('0x42')]);_0x136fb3[_0x99a8('0x45')]=_['intersection'](_0x5b6af2['model'],qs[_0x99a8('0x46')](_0x8a5d94[_0x99a8('0x42')][_0x99a8('0x46')]));_0x136fb3[_0x99a8('0x45')]=_0x136fb3[_0x99a8('0x45')][_0x99a8('0x47')]?_0x136fb3['attributes']:_0x5b6af2[_0x99a8('0x40')];if(_0x8a5d94['query'][_0x99a8('0x52')]){_0x136fb3[_0x99a8('0x53')]=[{'all':!![]}];}_0x136fb3=_[_0x99a8('0x4f')]({},_0x136fb3,_0x8a5d94[_0x99a8('0x50')]);return db[_0x99a8('0x51')]['find'](_0x136fb3)[_0x99a8('0x33')](handleEntityNotFound(_0x4fda40,null))[_0x99a8('0x33')](respondWithResult(_0x4fda40,null))[_0x99a8('0x25')](handleError(_0x4fda40,null));};exports[_0x99a8('0x57')]=function(_0x28aeb3,_0xde7be3){return db[_0x99a8('0x51')][_0x99a8('0x57')](_0x28aeb3['body'],{})[_0x99a8('0x33')](function(_0x327db2){var _0x3ecfe2=_0x28aeb3[_0x99a8('0x58')][_0x99a8('0x35')]({'plain':!![]});if(!_0x3ecfe2)throw new Error(_0x99a8('0x59'));if(_0x3ecfe2[_0x99a8('0x5a')]===_0x99a8('0x58')){var _0x52b555=_0x327db2[_0x99a8('0x35')]({'plain':!![]});var _0x3b6c01=_0x99a8('0x36');return db[_0x99a8('0x5b')][_0x99a8('0x5c')]({'where':{'name':_0x3b6c01,'userProfileId':_0x3ecfe2[_0x99a8('0x5d')]},'raw':!![]})[_0x99a8('0x33')](function(_0xaa8e95){if(_0xaa8e95&&_0xaa8e95['autoAssociation']===0x0){return db['UserProfileResource'][_0x99a8('0x57')]({'name':_0x52b555[_0x99a8('0x39')],'resourceId':_0x52b555['id'],'type':_0xaa8e95[_0x99a8('0x39')],'sectionId':_0xaa8e95['id']},{})['then'](function(){return _0x327db2;});}else{return _0x327db2;}})[_0x99a8('0x25')](function(_0x5e1888){logger[_0x99a8('0x22')](_0x99a8('0x5e'),_0x5e1888);throw _0x5e1888;});}return _0x327db2;})['then'](respondWithResult(_0xde7be3,0xc9))[_0x99a8('0x25')](handleError(_0xde7be3,null));};exports[_0x99a8('0x32')]=function(_0x599521,_0x424123){if(_0x599521[_0x99a8('0x5f')]['id']){delete _0x599521[_0x99a8('0x5f')]['id'];}return db['OpenchannelAccount'][_0x99a8('0x5c')]({'where':{'id':_0x599521['params']['id']},'include':[{'model':db[_0x99a8('0x3a')],'as':_0x99a8('0x3b')}]})[_0x99a8('0x33')](handleEntityNotFound(_0x424123,null))[_0x99a8('0x33')](saveUpdates(_0x599521[_0x99a8('0x5f')],null))[_0x99a8('0x33')](respondWithResult(_0x424123,null))[_0x99a8('0x25')](handleError(_0x424123,null));};exports['destroy']=function(_0x234f7d,_0x3b2289){return db[_0x99a8('0x51')][_0x99a8('0x5c')]({'where':{'id':_0x234f7d['params']['id']}})['then'](handleEntityNotFound(_0x3b2289,null))[_0x99a8('0x33')](removeEntity(_0x3b2289,null))[_0x99a8('0x25')](handleError(_0x3b2289,null));};exports['describe']=function(_0x353936,_0x9c243d){return db[_0x99a8('0x51')][_0x99a8('0x60')]()[_0x99a8('0x33')](respondWithResult(_0x9c243d,null))['catch'](handleError(_0x9c243d,null));};exports[_0x99a8('0x61')]=function(_0x1b25e4,_0x4cb6f5,_0x467d22){if(_0x1b25e4[_0x99a8('0x5f')]['id']){delete _0x1b25e4[_0x99a8('0x5f')]['id'];}return db[_0x99a8('0x51')][_0x99a8('0x5c')]({'where':{'id':_0x1b25e4[_0x99a8('0x62')]['id']}})['then'](handleEntityNotFound(_0x4cb6f5,null))[_0x99a8('0x33')](function(_0x46413c){if(_0x46413c){_0x1b25e4[_0x99a8('0x5f')][_0x99a8('0x63')]=_0x46413c['id'];return db['Disposition']['create'](_0x1b25e4[_0x99a8('0x5f')]);}})['then'](respondWithResult(_0x4cb6f5,null))[_0x99a8('0x25')](handleError(_0x4cb6f5,null));};exports['getDispositions']=function(_0x489da7,_0x3ca079,_0x21f86f){var _0x11e36b={'raw':![],'where':{}};var _0x19ba80={};var _0x41f6df={'count':0x0,'rows':[]};return db[_0x99a8('0x51')][_0x99a8('0x64')]({'where':{'id':_0x489da7['params']['id']}})['then'](handleEntityNotFound(_0x3ca079,null))[_0x99a8('0x33')](function(_0x506891){if(_0x506891){_0x19ba80[_0x99a8('0x40')]=_[_0x99a8('0x56')](db[_0x99a8('0x65')][_0x99a8('0x3c')]);_0x19ba80[_0x99a8('0x42')]=_[_0x99a8('0x56')](_0x489da7['query']);_0x19ba80['filters']=_['intersection'](_0x19ba80[_0x99a8('0x40')],_0x19ba80[_0x99a8('0x42')]);_0x11e36b[_0x99a8('0x45')]=_['intersection'](_0x19ba80[_0x99a8('0x40')],qs[_0x99a8('0x46')](_0x489da7[_0x99a8('0x42')][_0x99a8('0x46')]));_0x11e36b[_0x99a8('0x45')]=_0x11e36b[_0x99a8('0x45')][_0x99a8('0x47')]?_0x11e36b['attributes']:_0x19ba80['model'];if(!_0x489da7['query'][_0x99a8('0x48')](_0x99a8('0x49'))){_0x11e36b[_0x99a8('0x2c')]=qs[_0x99a8('0x2c')](_0x489da7[_0x99a8('0x42')][_0x99a8('0x2c')]);_0x11e36b[_0x99a8('0x2a')]=qs[_0x99a8('0x2a')](_0x489da7[_0x99a8('0x42')][_0x99a8('0x2a')]);}_0x11e36b[_0x99a8('0x4a')]=qs[_0x99a8('0x4b')](_0x489da7['query']['sort']);_0x11e36b[_0x99a8('0x4c')]=qs[_0x99a8('0x43')](_[_0x99a8('0x4d')](_0x489da7[_0x99a8('0x42')],_0x19ba80[_0x99a8('0x43')]));_0x11e36b[_0x99a8('0x4c')][_0x99a8('0x63')]=_0x506891['id'];if(_0x489da7['query'][_0x99a8('0x4e')]){_0x11e36b['where']=_[_0x99a8('0x4f')](_0x11e36b[_0x99a8('0x4c')],{'$or':_[_0x99a8('0x41')](_0x11e36b[_0x99a8('0x45')],function(_0x45b1f1){var _0x2abbf4={};_0x2abbf4[_0x45b1f1]={'$like':'%'+_0x489da7[_0x99a8('0x42')][_0x99a8('0x4e')]+'%'};return _0x2abbf4;})});}_0x11e36b=_[_0x99a8('0x4f')]({},_0x11e36b,_0x489da7[_0x99a8('0x50')]);return db[_0x99a8('0x65')][_0x99a8('0x2d')]({'where':_0x11e36b[_0x99a8('0x4c')]})[_0x99a8('0x33')](function(_0x4bc4cb){_0x41f6df['count']=_0x4bc4cb;if(_0x489da7[_0x99a8('0x42')][_0x99a8('0x52')]){_0x11e36b['include']=[{'all':!![]}];}return db['Disposition'][_0x99a8('0x54')](_0x11e36b);})['then'](function(_0x460409){_0x41f6df[_0x99a8('0x66')]=_0x460409;return _0x41f6df;});}})[_0x99a8('0x33')](respondWithFilteredResult(_0x3ca079,_0x11e36b))[_0x99a8('0x25')](handleError(_0x3ca079,null));};exports[_0x99a8('0x67')]=function(_0x3e65ca,_0x33657c,_0x145966){return db['OpenchannelAccount'][_0x99a8('0x5c')]({'where':{'id':_0x3e65ca[_0x99a8('0x62')]['id']}})['then'](handleEntityNotFound(_0x33657c,null))['then'](function(_0x53673e){if(_0x53673e){return _0x53673e[_0x99a8('0x67')](_0x3e65ca[_0x99a8('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x33657c,null))[_0x99a8('0x25')](handleError(_0x33657c,null));};exports['addAnswer']=function(_0x5a86d1,_0x53684d,_0x27ff77){if(_0x5a86d1[_0x99a8('0x5f')]['id']){delete _0x5a86d1[_0x99a8('0x5f')]['id'];}return db[_0x99a8('0x51')][_0x99a8('0x5c')]({'where':{'id':_0x5a86d1[_0x99a8('0x62')]['id']}})[_0x99a8('0x33')](handleEntityNotFound(_0x53684d,null))[_0x99a8('0x33')](function(_0x3d3076){if(_0x3d3076){_0x5a86d1[_0x99a8('0x5f')][_0x99a8('0x63')]=_0x3d3076['id'];return db[_0x99a8('0x68')]['create'](_0x5a86d1[_0x99a8('0x5f')]);}})[_0x99a8('0x33')](respondWithResult(_0x53684d,null))[_0x99a8('0x25')](handleError(_0x53684d,null));};exports[_0x99a8('0x69')]=function(_0x410912,_0xd4ee50,_0x26c844){var _0xe5ca58={'raw':![],'where':{}};var _0x562917={};var _0x4e84cd={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x99a8('0x64')]({'where':{'id':_0x410912['params']['id']}})['then'](handleEntityNotFound(_0xd4ee50,null))[_0x99a8('0x33')](function(_0x19dc66){if(_0x19dc66){_0x562917[_0x99a8('0x40')]=_['keys'](db[_0x99a8('0x68')]['rawAttributes']);_0x562917[_0x99a8('0x42')]=_['keys'](_0x410912[_0x99a8('0x42')]);_0x562917[_0x99a8('0x43')]=_['intersection'](_0x562917[_0x99a8('0x40')],_0x562917[_0x99a8('0x42')]);_0xe5ca58[_0x99a8('0x45')]=_[_0x99a8('0x44')](_0x562917[_0x99a8('0x40')],qs[_0x99a8('0x46')](_0x410912[_0x99a8('0x42')][_0x99a8('0x46')]));_0xe5ca58[_0x99a8('0x45')]=_0xe5ca58[_0x99a8('0x45')]['length']?_0xe5ca58[_0x99a8('0x45')]:_0x562917[_0x99a8('0x40')];if(!_0x410912[_0x99a8('0x42')][_0x99a8('0x48')]('nolimit')){_0xe5ca58[_0x99a8('0x2c')]=qs[_0x99a8('0x2c')](_0x410912[_0x99a8('0x42')][_0x99a8('0x2c')]);_0xe5ca58[_0x99a8('0x2a')]=qs[_0x99a8('0x2a')](_0x410912[_0x99a8('0x42')]['offset']);}_0xe5ca58[_0x99a8('0x4a')]=qs[_0x99a8('0x4b')](_0x410912[_0x99a8('0x42')][_0x99a8('0x4b')]);_0xe5ca58[_0x99a8('0x4c')]=qs['filters'](_['pick'](_0x410912[_0x99a8('0x42')],_0x562917[_0x99a8('0x43')]));_0xe5ca58[_0x99a8('0x4c')]['OpenchannelAccountId']=_0x19dc66['id'];if(_0x410912[_0x99a8('0x42')][_0x99a8('0x4e')]){_0xe5ca58[_0x99a8('0x4c')]=_[_0x99a8('0x4f')](_0xe5ca58['where'],{'$or':_[_0x99a8('0x41')](_0xe5ca58[_0x99a8('0x45')],function(_0x1ddd1d){var _0x48464b={};_0x48464b[_0x1ddd1d]={'$like':'%'+_0x410912[_0x99a8('0x42')]['filter']+'%'};return _0x48464b;})});}_0xe5ca58=_[_0x99a8('0x4f')]({},_0xe5ca58,_0x410912[_0x99a8('0x50')]);return db['CannedAnswer'][_0x99a8('0x2d')]({'where':_0xe5ca58['where']})[_0x99a8('0x33')](function(_0x518b1c){_0x4e84cd[_0x99a8('0x2d')]=_0x518b1c;if(_0x410912['query'][_0x99a8('0x52')]){_0xe5ca58[_0x99a8('0x53')]=[{'all':!![]}];}return db[_0x99a8('0x68')][_0x99a8('0x54')](_0xe5ca58);})[_0x99a8('0x33')](function(_0x5659d4){_0x4e84cd[_0x99a8('0x66')]=_0x5659d4;return _0x4e84cd;});}})[_0x99a8('0x33')](respondWithFilteredResult(_0xd4ee50,_0xe5ca58))[_0x99a8('0x25')](handleError(_0xd4ee50,null));};exports[_0x99a8('0x6a')]=function(_0x16009d,_0x9ce640,_0x46841c){return db[_0x99a8('0x51')][_0x99a8('0x5c')]({'where':{'id':_0x16009d['params']['id']}})[_0x99a8('0x33')](handleEntityNotFound(_0x9ce640,null))[_0x99a8('0x33')](function(_0x5e4c44){if(_0x5e4c44){return _0x5e4c44[_0x99a8('0x6a')](_0x16009d[_0x99a8('0x42')]['ids']);}})[_0x99a8('0x33')](respondWithStatusCode(_0x9ce640,null))[_0x99a8('0x25')](handleError(_0x9ce640,null));};exports[_0x99a8('0x6b')]=function(_0x5694c0,_0x55a529,_0x1da214){var _0x39be48={'body':_0x5694c0[_0x99a8('0x5f')],'channel':_0x99a8('0x6c')};var _0x55f5c3=[];var _0x4ff969=[];var _0x1dd767={};var _0x92763f=![];return db[_0x99a8('0x6d')][_0x99a8('0x60')]()[_0x99a8('0x33')](function(_0x6e4ed){if(!_0x6e4ed){throw new db[(_0x99a8('0x6e'))][(_0x99a8('0x6f'))](_0x99a8('0x70'));}_0x55f5c3=_[_0x99a8('0x71')](_[_0x99a8('0x56')](_0x6e4ed),[_0x99a8('0x72'),'updatedAt']);_0x4ff969=_[_0x99a8('0x71')](_[_0x99a8('0x56')](_0x6e4ed),[_0x99a8('0x72'),_0x99a8('0x73'),'CompanyId','ListId']);if(_0x5694c0['body']['id']){delete _0x5694c0[_0x99a8('0x5f')]['id'];}if(_[_0x99a8('0x74')](_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x75')])){throw new db['Sequelize']['ValidationError'](_0x99a8('0x76'));}if(_[_0x99a8('0x74')](_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x5f')])||_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x5f')]===''){throw new db[(_0x99a8('0x6e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x99a8('0x74')](_0x5694c0[_0x99a8('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0x99a8('0x6f'))](_0x99a8('0x77')+_0x4ff969);}if(!_[_0x99a8('0x78')](_0x4ff969,_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x79')])){throw new db[(_0x99a8('0x6e'))][(_0x99a8('0x6f'))](_0x99a8('0x7a')+_0x4ff969);}_0x1dd767[_0x5694c0['body'][_0x99a8('0x79')]]=_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x75')];})['then'](function(){return db[_0x99a8('0x51')]['find']({'where':{'id':_0x5694c0[_0x99a8('0x62')]['id']},'include':[{'model':db[_0x99a8('0x7b')],'as':_0x99a8('0x7c'),'include':[{'model':db[_0x99a8('0x6d')],'as':_0x99a8('0x7d'),'where':_0x1dd767,'limit':0x1,'order':[[_0x99a8('0x73'),_0x99a8('0x7e')]]}]},{'model':db[_0x99a8('0x7f')],'as':'Applications'}]});})[_0x99a8('0x33')](handleEntityNotFound(_0x55a529,null))['then'](function(_0x5e0268){if(_0x5e0268&&_0x5e0268[_0x99a8('0x7c')]){_0x39be48[_0x99a8('0x80')]=_0x5e0268;_0x39be48[_0x99a8('0x81')]=_0x5e0268[_0x99a8('0x82')];_0x39be48[_0x99a8('0x83')]=_0x5e0268[_0x99a8('0x7c')];_0x39be48['applications']=_['orderBy'](_0x39be48[_0x99a8('0x81')],['priority'],[_0x99a8('0x84')]);if(_0x39be48[_0x99a8('0x80')]['Applications']){delete _0x39be48[_0x99a8('0x80')]['Applications'];}if(_0x39be48[_0x99a8('0x80')][_0x99a8('0x7c')]&&_0x39be48[_0x99a8('0x80')][_0x99a8('0x7c')][_0x99a8('0x7d')][_0x99a8('0x47')]){return _0x39be48[_0x99a8('0x80')][_0x99a8('0x7c')]['Contacts'][0x0];}var _0x15114a=_['defaults'](_0x5694c0['body'],{'firstName':_0x5694c0[_0x99a8('0x5f')]['from'],'ListId':_0x5e0268[_0x99a8('0x85')]});_0x15114a[_0x5694c0['body']['mapKey']]=_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x75')];return db[_0x99a8('0x6d')][_0x99a8('0x57')](_0x15114a,{'fields':_0x55f5c3,'raw':!![]});}})[_0x99a8('0x33')](handleEntityNotFound(_0x55a529,null))['then'](function(_0x490923){_0x39be48['contact']=_0x490923;if(_0x490923){var _0x37703c={'ContactId':_0x490923['id'],'OpenchannelAccountId':_0x5694c0[_0x99a8('0x62')]['id'],'from':(_0x490923[_0x99a8('0x86')]||'')+'\x20'+(_0x490923[_0x99a8('0x87')]||'')};var _0x506ea2={'OpenchannelAccountId':_0x5694c0[_0x99a8('0x62')]['id'],'closed':![]};if(_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x88')]){_0x506ea2[_0x99a8('0x88')]=_0x5694c0['body'][_0x99a8('0x88')];return db[_0x99a8('0x89')][_0x99a8('0x5c')]({'where':_0x506ea2})[_0x99a8('0x33')](function(_0xb31f28){if(_0xb31f28){return[_0xb31f28,![]];}_0x37703c['threadId']=_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x88')];_0x37703c[_0x99a8('0x8a')]=_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x8a')];return db[_0x99a8('0x89')][_0x99a8('0x57')](_0x37703c)[_0x99a8('0x33')](function(_0x3c367e){return[_0x3c367e,!![]];});});}else{_0x506ea2['threadId']=null;}_0x506ea2[_0x99a8('0x8b')]=_0x490923['id'];return db[_0x99a8('0x89')]['find']({'where':_0x506ea2})['then'](function(_0x5c236c){if(_0x5c236c){return[_0x5c236c,![]];}return db['OpenchannelInteraction']['create'](_0x37703c)[_0x99a8('0x33')](function(_0x1238bf){return[_0x1238bf,!![]];});});}})[_0x99a8('0x8c')](function(_0x3e175a,_0x504ef4){if(_0x3e175a){_0x92763f=_0x504ef4;if(!_0x504ef4){var _0x2fd32c={'from':(_0x39be48['contact'][_0x99a8('0x86')]||'')+'\x20'+(_0x39be48[_0x99a8('0x8d')][_0x99a8('0x87')]||'')};if(_0x5694c0[_0x99a8('0x5f')]['threadId']&&_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x8e')]&&_0x5694c0['body'][_0x99a8('0x88')]!=_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x8e')]){_0x2fd32c[_0x99a8('0x88')]=_0x5694c0[_0x99a8('0x5f')]['messageId'];}return _0x3e175a[_0x99a8('0x32')](_0x2fd32c);}else{return _0x3e175a;}}})['then'](function(_0x418720){_0x39be48[_0x99a8('0x8f')]=_0x418720['get']({'plain':!![]});_0x39be48[_0x99a8('0x8f')][_0x99a8('0x90')]=_0x92763f;if(_0x39be48[_0x99a8('0x8f')][_0x99a8('0x90')]){if(_0x39be48[_0x99a8('0x80')][_0x99a8('0x91')]){_0x39be48[_0x99a8('0x81')][_0x99a8('0x92')]({'id':0x0,'priority':_0x39be48['applications']['length']+0x1,'app':_0x99a8('0x93'),'appdata':_0x99a8('0x94'),'interval':'*,*,*,*'});}}return db[_0x99a8('0x95')][_0x99a8('0x57')]({'body':_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x5f')],'OpenchannelAccountId':_0x5694c0[_0x99a8('0x62')]['id'],'OpenchannelInteractionId':_0x418720['id'],'direction':'in','ContactId':_0x39be48[_0x99a8('0x8d')]['id'],'AttachmentId':_0x5694c0[_0x99a8('0x5f')][_0x99a8('0x96')]});})[_0x99a8('0x33')](function(_0x42f633){_0x39be48[_0x99a8('0x23')]=_0x42f633;if(_0x39be48[_0x99a8('0x8f')][_0x99a8('0x97')]){return db[_0x99a8('0x98')][_0x99a8('0x5c')]({'attributes':['id',_0x99a8('0x39')],'where':{'id':_0x39be48[_0x99a8('0x8f')][_0x99a8('0x97')]}})[_0x99a8('0x33')](function(_0x4f699d){if(_0x4f699d){_0x39be48[_0x99a8('0x81')][_0x99a8('0x99')]({'id':0x0,'priority':0x0,'app':_0x99a8('0x9a'),'appdata':_0x4f699d[_0x99a8('0x39')]+','+(_0x39be48[_0x99a8('0x80')][_0x99a8('0x9b')]||0xa),'interval':_0x99a8('0x9c')});_0x39be48[_0x99a8('0x9d')]=![];}return respondWithRpcPromise('Start',_0x99a8('0x9e'),_0x39be48);});}return respondWithRpcPromise('Start',_0x99a8('0x9e'),_0x39be48);})[_0x99a8('0x33')](function(_0x5ead84){respondWithRpcPromise('EventManager',_0x99a8('0x9f'),{'event':_0x99a8('0x6b'),'message':_0x5ead84},client9002);return _0x5ead84;})[_0x99a8('0x33')](respondWithResult(_0x55a529,null))['catch'](handleError(_0x55a529,null));};exports[_0x99a8('0xa0')]=function(_0x4131de,_0x4835ab){var _0xf8d465=_0x4131de['params']['id'];var _0x378a0e=_0x4131de[_0x99a8('0x5f')];var _0x406ec3=0xc8;var _0x4ddffa=null;return db['sequelize'][_0x99a8('0xa1')]({'isolationLevel':db['sequelize']['Transaction'][_0x99a8('0xa2')][_0x99a8('0xa3')]},function(_0x141e6e){return db[_0x99a8('0x51')][_0x99a8('0x64')]({'where':{'id':_0xf8d465},'transaction':_0x141e6e})[_0x99a8('0x33')](function(_0x4729ef){if(_0x4729ef){return db['OpenchannelApplication'][_0x99a8('0x34')]({'where':{'OpenchannelAccountId':_0xf8d465},'transaction':_0x141e6e})[_0x99a8('0x33')](function(){var _0x11df75=_['map'](_0x378a0e,function(_0x9d1f0){_0x9d1f0[_0x99a8('0x63')]=_0xf8d465;return _0x9d1f0;});return db[_0x99a8('0x7f')][_0x99a8('0xa4')](_0x11df75,{'transaction':_0x141e6e});});}else{_0x406ec3=0x194;_0x4ddffa=[];}});})['then'](function(){if(_0x406ec3!==0x194){return db[_0x99a8('0x7f')][_0x99a8('0xa5')]({'where':{'OpenchannelAccountId':_0xf8d465},'order':_0x99a8('0xa6')})['then'](function(_0x2ee95f){_0x4ddffa=_0x2ee95f;});}})[_0x99a8('0x25')](function(_0x4ba738){_0x406ec3=0x1f4;logger[_0x99a8('0x22')](_0x4ba738['stack']);if(_0x4ba738[_0x99a8('0x39')]){delete _0x4ba738[_0x99a8('0x39')];}_0x4ddffa=_0x4ba738;})['finally'](function(){if(_0x4ddffa===null){_0x4835ab[_0x99a8('0x26')](_0x406ec3);}else{if(_0x406ec3===0x1f4){_0x4835ab[_0x99a8('0x27')](_0x406ec3)[_0x99a8('0xa7')](_0x4ddffa);}else{_0x4835ab[_0x99a8('0x27')](_0x406ec3)[_0x99a8('0x29')](_0x4ddffa);}}});};exports[_0x99a8('0xa8')]=function(_0x1adac9,_0x4a3b22,_0x14ec41){var _0x9f2dac={};var _0xacff39={};var _0x55b3b1;var _0x33d305;return db[_0x99a8('0x51')][_0x99a8('0x64')]({'where':{'id':_0x1adac9[_0x99a8('0x62')]['id']}})[_0x99a8('0x33')](handleEntityNotFound(_0x4a3b22,null))[_0x99a8('0x33')](function(_0x2e1c3a){if(_0x2e1c3a){_0x55b3b1=_0x2e1c3a;_0xacff39[_0x99a8('0x40')]=_['keys'](db[_0x99a8('0x7f')][_0x99a8('0x3c')]);_0xacff39[_0x99a8('0x42')]=_[_0x99a8('0x56')](_0x1adac9[_0x99a8('0x42')]);_0xacff39['filters']=_['intersection'](_0xacff39['model'],_0xacff39[_0x99a8('0x42')]);_0x9f2dac[_0x99a8('0x45')]=_['intersection'](_0xacff39[_0x99a8('0x40')],qs[_0x99a8('0x46')](_0x1adac9[_0x99a8('0x42')][_0x99a8('0x46')]));_0x9f2dac[_0x99a8('0x45')]=_0x9f2dac[_0x99a8('0x45')][_0x99a8('0x47')]?_0x9f2dac[_0x99a8('0x45')]:_0xacff39[_0x99a8('0x40')];_0x9f2dac[_0x99a8('0x4a')]=qs[_0x99a8('0x4b')](_0x1adac9[_0x99a8('0x42')]['sort']);_0x9f2dac[_0x99a8('0x4c')]=qs[_0x99a8('0x43')](_[_0x99a8('0x4d')](_0x1adac9[_0x99a8('0x42')],_0xacff39[_0x99a8('0x43')]));if(_0x1adac9['query'][_0x99a8('0x4e')]){_0x9f2dac[_0x99a8('0x4c')]=_[_0x99a8('0x4f')](_0x9f2dac[_0x99a8('0x4c')],{'$or':_[_0x99a8('0x41')](_0x9f2dac[_0x99a8('0x45')],function(_0x1e3968){var _0x5dae26={};_0x5dae26[_0x1e3968]={'$like':'%'+_0x1adac9[_0x99a8('0x42')][_0x99a8('0x4e')]+'%'};return _0x5dae26;})});}_0x9f2dac=_[_0x99a8('0x4f')]({},_0x9f2dac,_0x1adac9[_0x99a8('0x50')]);return _0x55b3b1['getApplications'](_0x9f2dac);}})['then'](function(_0xc2b747){if(_0xc2b747){_0x33d305=_0xc2b747[_0x99a8('0x47')];if(!_0x1adac9[_0x99a8('0x42')]['hasOwnProperty'](_0x99a8('0x49'))){_0x9f2dac['limit']=qs[_0x99a8('0x2c')](_0x1adac9[_0x99a8('0x42')]['limit']);_0x9f2dac[_0x99a8('0x2a')]=qs[_0x99a8('0x2a')](_0x1adac9[_0x99a8('0x42')][_0x99a8('0x2a')]);}return _0x55b3b1[_0x99a8('0xa8')](_0x9f2dac);}})[_0x99a8('0x33')](function(_0x372b2){if(_0x372b2){return _0x372b2?{'count':_0x33d305,'rows':_0x372b2}:null;}})[_0x99a8('0x33')](respondWithResult(_0x4a3b22,null))[_0x99a8('0x25')](handleError(_0x4a3b22,null));};exports['getInteractions']=function(_0x2e44e6,_0x233308,_0x76e6a8){var _0x482b1b={'raw':![],'where':{}};var _0x56f951={};var _0x17128f={'count':0x0,'rows':[]};return db[_0x99a8('0x51')][_0x99a8('0x64')]({'where':{'id':_0x2e44e6[_0x99a8('0x62')]['id']}})['then'](handleEntityNotFound(_0x233308,null))[_0x99a8('0x33')](function(_0x20ac89){if(_0x20ac89){_0x56f951[_0x99a8('0x40')]=_[_0x99a8('0x56')](db['OpenchannelInteraction'][_0x99a8('0x3c')]);_0x56f951[_0x99a8('0x42')]=_['keys'](_0x2e44e6[_0x99a8('0x42')]);_0x56f951[_0x99a8('0x43')]=_['intersection'](_0x56f951[_0x99a8('0x40')],_0x56f951[_0x99a8('0x42')]);_0x482b1b['attributes']=_[_0x99a8('0x44')](_0x56f951[_0x99a8('0x40')],qs['fields'](_0x2e44e6[_0x99a8('0x42')]['fields']));_0x482b1b['attributes']=_0x482b1b['attributes'][_0x99a8('0x47')]?_0x482b1b[_0x99a8('0x45')]:_0x56f951[_0x99a8('0x40')];if(!_0x2e44e6[_0x99a8('0x42')][_0x99a8('0x48')]('nolimit')){_0x482b1b[_0x99a8('0x2c')]=qs[_0x99a8('0x2c')](_0x2e44e6[_0x99a8('0x42')][_0x99a8('0x2c')]);_0x482b1b[_0x99a8('0x2a')]=qs[_0x99a8('0x2a')](_0x2e44e6[_0x99a8('0x42')]['offset']);}_0x482b1b[_0x99a8('0x4a')]=qs[_0x99a8('0x4b')](_0x2e44e6[_0x99a8('0x42')]['sort']);_0x482b1b[_0x99a8('0x4c')]=qs[_0x99a8('0x43')](_[_0x99a8('0x4d')](_0x2e44e6[_0x99a8('0x42')],_0x56f951[_0x99a8('0x43')]));_0x482b1b[_0x99a8('0x4c')][_0x99a8('0x63')]=_0x20ac89['id'];if(_0x2e44e6[_0x99a8('0x42')][_0x99a8('0x4e')]){_0x482b1b[_0x99a8('0x4c')]=_['merge'](_0x482b1b[_0x99a8('0x4c')],{'$or':_[_0x99a8('0x41')](_0x482b1b[_0x99a8('0x45')],function(_0x1e29d6){var _0x229d57={};_0x229d57[_0x1e29d6]={'$like':'%'+_0x2e44e6[_0x99a8('0x42')]['filter']+'%'};return _0x229d57;})});}_0x482b1b=_[_0x99a8('0x4f')]({},_0x482b1b,_0x2e44e6[_0x99a8('0x50')]);return db[_0x99a8('0x89')]['count']({'where':_0x482b1b[_0x99a8('0x4c')]})['then'](function(_0x54fee2){_0x17128f['count']=_0x54fee2;if(_0x2e44e6[_0x99a8('0x42')]['includeAll']){_0x482b1b[_0x99a8('0x53')]=[{'model':db[_0x99a8('0x6d')],'as':_0x99a8('0xa9'),'required':![]},{'model':db['User'],'as':_0x99a8('0xaa'),'attributes':[_0x99a8('0x39'),_0x99a8('0xab'),_0x99a8('0xac')],'required':![]},{'model':db[_0x99a8('0xad')],'as':_0x99a8('0xae'),'attributes':['id','name',_0x99a8('0xaf')],'where':_0x2e44e6['query'][_0x99a8('0xb0')]?{'id':_0x2e44e6['query'][_0x99a8('0xb0')]}:undefined,'required':_0x2e44e6[_0x99a8('0x42')][_0x99a8('0xb0')]?!![]:![]}];}return db[_0x99a8('0x89')]['findAll'](_0x482b1b);})[_0x99a8('0x33')](function(_0x3cbd2f){_0x17128f['rows']=_0x3cbd2f;return _0x17128f;});}})[_0x99a8('0x33')](respondWithFilteredResult(_0x233308,_0x482b1b))[_0x99a8('0x25')](handleError(_0x233308,null));};exports[_0x99a8('0xb1')]=function(_0x13e3f8,_0x250334,_0x3cac30){return db[_0x99a8('0x51')][_0x99a8('0x5c')]({'where':{'id':_0x13e3f8[_0x99a8('0x62')]['id']}})[_0x99a8('0x33')](handleEntityNotFound(_0x250334,null))[_0x99a8('0x33')](function(_0x296a8e){if(_0x296a8e){return _0x296a8e[_0x99a8('0xb1')](_0x13e3f8[_0x99a8('0x5f')]['ids'],_[_0x99a8('0xb2')](_0x13e3f8[_0x99a8('0x5f')],[_0x99a8('0xb3'),'id'])||{})[_0x99a8('0x8c')](function(_0xd4b0bb){for(var _0x3e5de9=0x0;_0x3e5de9<_0x13e3f8[_0x99a8('0x5f')]['ids'][_0x99a8('0x47')];_0x3e5de9+=0x1){socket[_0x99a8('0xb4')](_0x99a8('0xb5'),{'UserId':Number(_0x13e3f8[_0x99a8('0x5f')][_0x99a8('0xb3')][_0x3e5de9]),'OpenchannelAccountId':Number(_0x13e3f8[_0x99a8('0x62')]['id'])});}return _0xd4b0bb;});}})['then'](respondWithResult(_0x250334,null))['catch'](handleError(_0x250334,null));};exports[_0x99a8('0xb6')]=function(_0x1e45d4,_0x58550d,_0xf3d553){return db[_0x99a8('0x51')][_0x99a8('0x5c')]({'where':{'id':_0x1e45d4[_0x99a8('0x62')]['id']}})[_0x99a8('0x33')](handleEntityNotFound(_0x58550d,null))['then'](function(_0x4e8544){if(_0x4e8544){return _0x4e8544[_0x99a8('0xb6')](_0x1e45d4[_0x99a8('0x42')][_0x99a8('0xb3')])[_0x99a8('0x33')](function(){if(_['isArray'](_0x1e45d4[_0x99a8('0x42')][_0x99a8('0xb3')])){for(var _0xf71418=0x0;_0xf71418<_0x1e45d4[_0x99a8('0x42')]['ids'][_0x99a8('0x47')];_0xf71418+=0x1){socket['emit'](_0x99a8('0xb7'),{'UserId':Number(_0x1e45d4[_0x99a8('0x42')][_0x99a8('0xb3')][_0xf71418]),'OpenchannelAccountId':Number(_0x1e45d4[_0x99a8('0x62')]['id'])});}}else{socket['emit'](_0x99a8('0xb7'),{'UserId':Number(_0x1e45d4[_0x99a8('0x42')]['ids']),'OpenchannelAccountId':Number(_0x1e45d4[_0x99a8('0x62')]['id'])});}});}})[_0x99a8('0x33')](respondWithStatusCode(_0x58550d,null))['catch'](handleError(_0x58550d,null));};exports[_0x99a8('0xb8')]=function(_0x54ad10,_0x2ae8d7,_0x509746){var _0x1fc4a8={};var _0x21c6ab={};var _0x136a89;var _0x50d234;return db[_0x99a8('0x51')][_0x99a8('0x64')]({'where':{'id':_0x54ad10[_0x99a8('0x62')]['id']}})[_0x99a8('0x33')](handleEntityNotFound(_0x2ae8d7,null))[_0x99a8('0x33')](function(_0x4807d2){if(_0x4807d2){_0x136a89=_0x4807d2;_0x21c6ab[_0x99a8('0x40')]=_[_0x99a8('0x56')](db['User'][_0x99a8('0x3c')]);_0x21c6ab[_0x99a8('0x42')]=_['keys'](_0x54ad10['query']);_0x21c6ab[_0x99a8('0x43')]=_[_0x99a8('0x44')](_0x21c6ab['model'],_0x21c6ab[_0x99a8('0x42')]);_0x1fc4a8[_0x99a8('0x45')]=_[_0x99a8('0x44')](_0x21c6ab[_0x99a8('0x40')],qs[_0x99a8('0x46')](_0x54ad10['query'][_0x99a8('0x46')]));_0x1fc4a8['attributes']=_0x1fc4a8['attributes'][_0x99a8('0x47')]?_0x1fc4a8[_0x99a8('0x45')]:_0x21c6ab[_0x99a8('0x40')];_0x1fc4a8['order']=qs[_0x99a8('0x4b')](_0x54ad10['query']['sort']);_0x1fc4a8[_0x99a8('0x4c')]=qs[_0x99a8('0x43')](_['pick'](_0x54ad10[_0x99a8('0x42')],_0x21c6ab[_0x99a8('0x43')]));if(_0x54ad10['query'][_0x99a8('0x4e')]){_0x1fc4a8[_0x99a8('0x4c')]=_[_0x99a8('0x4f')](_0x1fc4a8[_0x99a8('0x4c')],{'$or':_[_0x99a8('0x41')](_0x1fc4a8[_0x99a8('0x45')],function(_0xfab60e){var _0x8d2504={};_0x8d2504[_0xfab60e]={'$like':'%'+_0x54ad10['query']['filter']+'%'};return _0x8d2504;})});}_0x1fc4a8=_[_0x99a8('0x4f')]({},_0x1fc4a8,_0x54ad10[_0x99a8('0x50')]);return _0x136a89['getAgents'](_0x1fc4a8);}})['then'](function(_0x300a99){if(_0x300a99){_0x50d234=_0x300a99[_0x99a8('0x47')];if(!_0x54ad10[_0x99a8('0x42')][_0x99a8('0x48')](_0x99a8('0x49'))){_0x1fc4a8[_0x99a8('0x2c')]=qs[_0x99a8('0x2c')](_0x54ad10[_0x99a8('0x42')][_0x99a8('0x2c')]);_0x1fc4a8['offset']=qs[_0x99a8('0x2a')](_0x54ad10[_0x99a8('0x42')][_0x99a8('0x2a')]);}return _0x136a89[_0x99a8('0xb8')](_0x1fc4a8);}})[_0x99a8('0x33')](function(_0x494ab6){if(_0x494ab6){return _0x494ab6?{'count':_0x50d234,'rows':_0x494ab6}:null;}})['then'](respondWithResult(_0x2ae8d7,null))[_0x99a8('0x25')](handleError(_0x2ae8d7,null));};exports[_0x99a8('0xa7')]=function(_0x1bc9b2,_0x1ae564,_0x4c7214){var _0xff1cb0,_0x1fd778,_0x455057;if(_[_0x99a8('0x74')](_0x1bc9b2[_0x99a8('0x5f')]['body'])||_0x1bc9b2[_0x99a8('0x5f')][_0x99a8('0x5f')]===''){throw new db[(_0x99a8('0x6e'))]['ValidationError'](_0x99a8('0xb9'));}if(_[_0x99a8('0x74')](_0x1bc9b2['body']['to'])){}_0xff1cb0=_0x1bc9b2[_0x99a8('0x5f')]['to'];return db[_0x99a8('0x51')]['findOne']({'where':{'id':_0x1bc9b2[_0x99a8('0x62')]['id']}})[_0x99a8('0x33')](handleEntityNotFound(_0x1ae564,null))['then'](function(_0x26e53e){if(_0x26e53e){return db[_0x99a8('0x51')][_0x99a8('0x5c')]({'where':{'id':_0x26e53e['id']},'include':[{'model':db[_0x99a8('0x7b')],'as':'List','include':[{'model':db[_0x99a8('0x6d')],'as':_0x99a8('0x7d'),'where':{[_0x26e53e[_0x99a8('0x79')]]:_0xff1cb0},'limit':0x1,'order':[['updatedAt',_0x99a8('0x7e')]]}]}]})[_0x99a8('0x33')](handleEntityNotFound(_0x1ae564,null))[_0x99a8('0x33')](function(_0x1f69ec){if(_0x1f69ec&&_0x1f69ec[_0x99a8('0x7c')]){_0x1fd778=_0x1f69ec[_0x99a8('0x35')]({'plain':!![]});if(_0x1fd778[_0x99a8('0x7c')]&&_0x1fd778[_0x99a8('0x7c')][_0x99a8('0x7d')][_0x99a8('0x47')]){return _0x1fd778[_0x99a8('0x7c')]['Contacts'][0x0];}return db[_0x99a8('0x6d')]['create'](_[_0x99a8('0x17')](_0x1bc9b2[_0x99a8('0x5f')],{'firstName':_0xff1cb0,[_0x1f69ec[_0x99a8('0x79')]]:_0xff1cb0,'phone':_0xff1cb0,'ListId':_0x1fd778[_0x99a8('0x85')]}));}})['then'](handleEntityNotFound(_0x1ae564,null))[_0x99a8('0x33')](function(_0x769c41){if(_0x769c41){_0x455057=_0x769c41;return db[_0x99a8('0x89')][_0x99a8('0x5c')]({'where':{'ContactId':_0x455057['id'],'closed':![],'OpenchannelAccountId':_0x1fd778['id']}})['then'](function(_0x2eab1b){if(_0x2eab1b){return[_0x2eab1b,![]];}return db[_0x99a8('0x89')]['create']({'UserId':_0x1bc9b2[_0x99a8('0x58')]['id'],'ContactId':_0x455057['id'],'OpenchannelAccountId':_0x1fd778['id'],'lastMsgDirection':_0x99a8('0xba'),'Messages':[_[_0x99a8('0x4f')](_0x1bc9b2['body'],{'read':![],'body':_0x1bc9b2[_0x99a8('0x5f')][_0x99a8('0x5f')],'OpenchannelAccountId':_0x1fd778['id'],'UserId':_0x1bc9b2[_0x99a8('0x58')]['id'],'ContactId':_0x455057['id']})]},{'include':[{'model':db[_0x99a8('0x95')],'as':'Messages'}]})['then'](function(_0x3d5e00){return[_0x3d5e00,!![]];});});}})['spread'](function(_0x2ab811,_0x3b7814){if(_0x3b7814){return _0x2ab811;}return db[_0x99a8('0x95')][_0x99a8('0x57')](_['merge'](_0x1bc9b2[_0x99a8('0x5f')],{'read':![],'body':_0x1bc9b2[_0x99a8('0x5f')][_0x99a8('0x5f')],'OpenchannelAccountId':_0x1fd778['id'],'OpenchannelInteractionId':_0x2ab811['id'],'UserId':_0x1bc9b2[_0x99a8('0x58')]['id'],'ContactId':_0x455057['id']}))['then'](function(_0x4995e5){_0x2ab811[_0x99a8('0xbb')][_0x99a8('0xbc')]=[];_0x2ab811['dataValues'][_0x99a8('0xbc')][_0x99a8('0x92')](_0x4995e5['dataValues']);return _0x2ab811;});});}})[_0x99a8('0x33')](respondWithResult(_0x1ae564,null))['catch'](handleError(_0x1ae564,null));};
\ No newline at end of file
index 4da89b0..70c925b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda55=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xda55,0x6d));var _0x5da5=function(_0x3c31f9,_0x5914f1){_0x3c31f9=_0x3c31f9-0x0;var _0x45b251=_0xda55[_0x3c31f9];return _0x45b251;};'use strict';var EventEmitter=require(_0x5da5('0x0'));var OpenchannelAccount=require(_0x5da5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5da5('0x2'),'afterUpdate':_0x5da5('0x3'),'afterDestroy':_0x5da5('0x4')};function emitEvent(_0x50cf9f){return function(_0x1c3afd,_0x5da254,_0x3400e9){OpenchannelAccountEvents['emit'](_0x50cf9f+':'+_0x1c3afd['id'],_0x1c3afd);OpenchannelAccountEvents[_0x5da5('0x5')](_0x50cf9f,_0x1c3afd);_0x3400e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x5da5('0x6')](e,emitEvent(event));}}module[_0x5da5('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xb4e6=['update','remove','emit','hook','events','OpenchannelAccount','setMaxListeners','save'];(function(_0x190b37,_0x386197){var _0x4e7eb7=function(_0x31468b){while(--_0x31468b){_0x190b37['push'](_0x190b37['shift']());}};_0x4e7eb7(++_0x386197);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0xb4e6[_0x289e64];return _0x30246c;};'use strict';var EventEmitter=require(_0x6b4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x6b4e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6b4e('0x2')](0x0);var events={'afterCreate':_0x6b4e('0x3'),'afterUpdate':_0x6b4e('0x4'),'afterDestroy':_0x6b4e('0x5')};function emitEvent(_0x31e8ad){return function(_0x1929b8,_0x52313b,_0x40da90){OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad+':'+_0x1929b8['id'],_0x1929b8);OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad,_0x1929b8);_0x40da90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x6b4e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index e718666..9ab933b 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(_0xe2cadc,_0x57d9cd){var _0x4a6e26=function(_0x23de63){while(--_0x23de63){_0xe2cadc['push'](_0xe2cadc['shift']());}};_0x4a6e26(++_0x57d9cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x54f95a,_0x145413){var _0x27d7cd=function(_0x234d5d){while(--_0x234d5d){_0x54f95a['push'](_0x54f95a['shift']());}};_0x27d7cd(++_0x145413);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 f90bde7..387a60b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b65=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2b65,0x131));var _0x52b6=function(_0x568d30,_0x50fceb){_0x568d30=_0x568d30-0x0;var _0xabb817=_0x2b65[_0x568d30];return _0xabb817;};'use strict';var _=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var moment=require(_0x52b6('0x2'));var BPromise=require(_0x52b6('0x3'));var rs=require(_0x52b6('0x4'));var fs=require('fs');var Redis=require(_0x52b6('0x5'));var db=require(_0x52b6('0x6'))['db'];var utils=require(_0x52b6('0x7'));var logger=require('../../config/logger')(_0x52b6('0x8'));var config=require(_0x52b6('0x9'));var jayson=require(_0x52b6('0xa'));var client=jayson[_0x52b6('0xb')][_0x52b6('0xc')]({'port':0x232a});config[_0x52b6('0xd')]=_[_0x52b6('0xe')](config[_0x52b6('0xd')],{'host':_0x52b6('0xf'),'port':0x18eb});var socket=require(_0x52b6('0x10'))(new Redis(config['redis']));require(_0x52b6('0x11'))[_0x52b6('0x12')](socket);function respondWithRpcPromise(_0x18b34d,_0x4d6d94,_0x19d1d9){return new BPromise(function(_0x2bb857,_0x19f475){return client[_0x52b6('0x13')](_0x18b34d,_0x19d1d9)['then'](function(_0xf91209){logger[_0x52b6('0x14')](_0x52b6('0x15'),_0x4d6d94,'request\x20sent');logger[_0x52b6('0x16')](_0x52b6('0x17'),_0x4d6d94,'request\x20sent',JSON[_0x52b6('0x18')](_0xf91209));if(_0xf91209['error']){if(_0xf91209['error'][_0x52b6('0x19')]===0x1f4){logger[_0x52b6('0x1a')](_0x52b6('0x15'),_0x4d6d94,_0xf91209[_0x52b6('0x1a')][_0x52b6('0x1b')]);return _0x19f475(_0xf91209[_0x52b6('0x1a')][_0x52b6('0x1b')]);}logger[_0x52b6('0x1a')](_0x52b6('0x15'),_0x4d6d94,_0xf91209[_0x52b6('0x1a')][_0x52b6('0x1b')]);return _0x2bb857(_0xf91209[_0x52b6('0x1a')][_0x52b6('0x1b')]);}else{logger['info'](_0x52b6('0x15'),_0x4d6d94,_0x52b6('0x1c'));_0x2bb857(_0xf91209[_0x52b6('0x1d')]['message']);}})[_0x52b6('0x1e')](function(_0x184ee8){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4d6d94,_0x184ee8);_0x19f475(_0x184ee8);});});}
\ No newline at end of file
+var _0xb62e=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xb62e,0x1de));var _0xeb62=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb62e[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});config[_0xeb62('0xc')]=_['defaults'](config[_0xeb62('0xc')],{'host':_0xeb62('0xd'),'port':0x18eb});var socket=require(_0xeb62('0xe'))(new Redis(config[_0xeb62('0xc')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4693c9,_0x40584b,_0x6d5e94){return new BPromise(function(_0xf93c21,_0x2fe923){return client[_0xeb62('0xf')](_0x4693c9,_0x6d5e94)[_0xeb62('0x10')](function(_0x3a826a){logger[_0xeb62('0x11')](_0xeb62('0x12'),_0x40584b,'request\x20sent');logger[_0xeb62('0x13')](_0xeb62('0x14'),_0x40584b,_0xeb62('0x15'),JSON[_0xeb62('0x16')](_0x3a826a));if(_0x3a826a['error']){if(_0x3a826a[_0xeb62('0x17')][_0xeb62('0x18')]===0x1f4){logger[_0xeb62('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x40584b,_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);return _0x2fe923(_0x3a826a[_0xeb62('0x17')]['message']);}logger[_0xeb62('0x17')](_0xeb62('0x12'),_0x40584b,_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);return _0xf93c21(_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);}else{logger[_0xeb62('0x11')](_0xeb62('0x12'),_0x40584b,_0xeb62('0x15'));_0xf93c21(_0x3a826a[_0xeb62('0x1a')][_0xeb62('0x19')]);}})[_0xeb62('0x1b')](function(_0x3cdf76){logger['error'](_0xeb62('0x12'),_0x40584b,_0x3cdf76);_0x2fe923(_0x3cdf76);});});}
\ No newline at end of file
index abf5670..341d669 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03bc=['./openchannelAccount.events','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x312c07,_0x45bb0f){var _0x4aab39=function(_0xf6e4d7){while(--_0xf6e4d7){_0x312c07['push'](_0x312c07['shift']());}};_0x4aab39(++_0x45bb0f);}(_0x03bc,0xb8));var _0xc03b=function(_0x4da568,_0x594839){_0x4da568=_0x4da568-0x0;var _0x25387a=_0x03bc[_0x4da568];return _0x25387a;};'use strict';var OpenchannelAccountEvents=require(_0xc03b('0x0'));var events=['save',_0xc03b('0x1'),_0xc03b('0x2')];function createListener(_0x4b43b4,_0x5f8f09){return function(_0x48e731){_0x5f8f09[_0xc03b('0x3')](_0x4b43b4,_0x48e731);};}function removeListener(_0x3b4181,_0x3b1720){return function(){OpenchannelAccountEvents[_0xc03b('0x4')](_0x3b4181,_0x3b1720);};}exports[_0xc03b('0x5')]=function(_0x48e3de){for(var _0x31eda8=0x0,_0x5982de=events[_0xc03b('0x6')];_0x31eda8<_0x5982de;_0x31eda8++){var _0xfccf77=events[_0x31eda8];var _0x64dd0a=createListener(_0xc03b('0x7')+_0xfccf77,_0x48e3de);OpenchannelAccountEvents['on'](_0xfccf77,_0x64dd0a);}};
\ No newline at end of file
+var _0x44f8=['remove','update','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x3f4683,_0x4062f9){var _0x1a80aa=function(_0x5dea92){while(--_0x5dea92){_0x3f4683['push'](_0x3f4683['shift']());}};_0x1a80aa(++_0x4062f9);}(_0x44f8,0x1de));var _0x844f=function(_0x25baf0,_0x44222b){_0x25baf0=_0x25baf0-0x0;var _0x2bb843=_0x44f8[_0x25baf0];return _0x2bb843;};'use strict';var OpenchannelAccountEvents=require(_0x844f('0x0'));var events=[_0x844f('0x1'),_0x844f('0x2'),_0x844f('0x3')];function createListener(_0x8193a3,_0x24561f){return function(_0x4aad74){_0x24561f['emit'](_0x8193a3,_0x4aad74);};}function removeListener(_0x26151e,_0x5cd939){return function(){OpenchannelAccountEvents['removeListener'](_0x26151e,_0x5cd939);};}exports['register']=function(_0xe654ca){for(var _0x2cd42=0x0,_0x46eb2c=events[_0x844f('0x4')];_0x2cd42<_0x46eb2c;_0x2cd42++){var _0x37b697=events[_0x2cd42];var _0x1987a9=createListener(_0x844f('0x5')+_0x37b697,_0xe654ca);OpenchannelAccountEvents['on'](_0x37b697,_0x1987a9);}};
\ No newline at end of file
index 2886f72..5419da6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x091a=['express','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','/:id','show','post','isAuthenticated','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x091a,0x1d7));var _0xa091=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x091a[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xa091('0x0'));var util=require(_0xa091('0x1'));var path=require(_0xa091('0x2'));var timeout=require(_0xa091('0x3'));var express=require(_0xa091('0x4'));var router=express['Router']();var fs_extra=require(_0xa091('0x5'));var auth=require(_0xa091('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa091('0x7'));var controller=require(_0xa091('0x8'));router[_0xa091('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa091('0x9')](_0xa091('0xa'),auth['isAuthenticated'](),controller[_0xa091('0xb')]);router[_0xa091('0xc')]('/',auth[_0xa091('0xd')](),controller[_0xa091('0xe')]);router[_0xa091('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa091('0x10')]);router['delete'](_0xa091('0xa'),auth['isAuthenticated'](),controller[_0xa091('0x11')]);module[_0xa091('0x12')]=router;
\ No newline at end of file
+var _0xd730=['index','get','/:id','isAuthenticated','show','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xd730,0x13a));var _0x0d73=function(_0x12cc09,_0x4cea59){_0x12cc09=_0x12cc09-0x0;var _0xe8d5f5=_0xd730[_0x12cc09];return _0xe8d5f5;};'use strict';var multer=require(_0x0d73('0x0'));var util=require(_0x0d73('0x1'));var path=require(_0x0d73('0x2'));var timeout=require(_0x0d73('0x3'));var express=require(_0x0d73('0x4'));var router=express['Router']();var fs_extra=require(_0x0d73('0x5'));var auth=require(_0x0d73('0x6'));var interaction=require(_0x0d73('0x7'));var config=require(_0x0d73('0x8'));var controller=require('./openchannelApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0d73('0x9')]);router[_0x0d73('0xa')](_0x0d73('0xb'),auth[_0x0d73('0xc')](),controller[_0x0d73('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x0d73('0xc')](),controller[_0x0d73('0xe')]);router['delete'](_0x0d73('0xb'),auth[_0x0d73('0xc')](),controller[_0x0d73('0xf')]);module[_0x0d73('0x10')]=router;
\ No newline at end of file
index f673b14..8315504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81dd=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x81dd,0x129));var _0xd81d=function(_0x217183,_0x52727f){_0x217183=_0x217183-0x0;var _0x5b4c32=_0x81dd[_0x217183];return _0x5b4c32;};'use strict';var Sequelize=require(_0xd81d('0x0'));module[_0xd81d('0x1')]={'priority':{'type':Sequelize[_0xd81d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd81d('0x3')]()},'description':{'type':Sequelize[_0xd81d('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd81d('0x5')}};
\ No newline at end of file
+var _0x88a0=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x88a0,0xf8));var _0x088a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x88a0[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x088a('0x0'));module[_0x088a('0x1')]={'priority':{'type':Sequelize[_0x088a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x088a('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x088a('0x4')],'defaultValue':_0x088a('0x5')}};
\ No newline at end of file
index 42b9281..5da344f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc09=['nolimit','order','where','filters','merge','VIRTUAL','options','includeAll','include','catch','params','fields','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','type','key','query','keys','model','attributes','intersection','length'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xfc09,0x9d));var _0x9fc0=function(_0x2ad925,_0x24f451){_0x2ad925=_0x2ad925-0x0;var _0x1d8732=_0xfc09[_0x2ad925];return _0x1d8732;};'use strict';var emlformat=require(_0x9fc0('0x0'));var rimraf=require(_0x9fc0('0x1'));var zipdir=require(_0x9fc0('0x2'));var jsonpatch=require(_0x9fc0('0x3'));var rp=require('request-promise');var moment=require(_0x9fc0('0x4'));var BPromise=require(_0x9fc0('0x5'));var Mustache=require(_0x9fc0('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9fc0('0x7'));var csv=require('to-csv');var ejs=require(_0x9fc0('0x8'));var fs=require('fs');var fs_extra=require(_0x9fc0('0x9'));var _=require('lodash');var squel=require(_0x9fc0('0xa'));var crypto=require(_0x9fc0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9fc0('0xc'));var toCsv=require(_0x9fc0('0xd'));var querystring=require('querystring');var Papa=require(_0x9fc0('0xe'));var Redis=require(_0x9fc0('0xf'));var authService=require(_0x9fc0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9fc0('0x11'));var hardwareService=require(_0x9fc0('0x12'));var logger=require(_0x9fc0('0x13'))(_0x9fc0('0x14'));var utils=require(_0x9fc0('0x15'));var config=require(_0x9fc0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9fc0('0x17'))['db'];function respondWithStatusCode(_0x3c6a73,_0x2b609c){_0x2b609c=_0x2b609c||0xcc;return function(_0x4eb66a){if(_0x4eb66a){return _0x3c6a73['sendStatus'](_0x2b609c);}return _0x3c6a73[_0x9fc0('0x18')](_0x2b609c)[_0x9fc0('0x19')]();};}function respondWithResult(_0x418093,_0xcc0f16){_0xcc0f16=_0xcc0f16||0xc8;return function(_0x433f0b){if(_0x433f0b){return _0x418093[_0x9fc0('0x18')](_0xcc0f16)[_0x9fc0('0x1a')](_0x433f0b);}};}function respondWithFilteredResult(_0x1dab5a,_0x1324fa){return function(_0x477430){if(_0x477430){var _0x10de11=typeof _0x1324fa[_0x9fc0('0x1b')]===_0x9fc0('0x1c')&&typeof _0x1324fa[_0x9fc0('0x1d')]===_0x9fc0('0x1c');var _0x5b1ddf=_0x477430[_0x9fc0('0x1e')];var _0x5a14cf=_0x10de11?0x0:_0x1324fa['offset'];var _0x2d7ccc=_0x10de11?_0x477430['count']:_0x1324fa[_0x9fc0('0x1b')]+_0x1324fa[_0x9fc0('0x1d')];var _0x1a6764;if(_0x2d7ccc>=_0x5b1ddf){_0x2d7ccc=_0x5b1ddf;_0x1a6764=0xc8;}else{_0x1a6764=0xce;}_0x1dab5a[_0x9fc0('0x18')](_0x1a6764);return _0x1dab5a[_0x9fc0('0x1f')](_0x9fc0('0x20'),_0x5a14cf+'-'+_0x2d7ccc+'/'+_0x5b1ddf)['json'](_0x477430);}return null;};}function patchUpdates(_0x3a631c){return function(_0x2f4fc9){try{jsonpatch[_0x9fc0('0x21')](_0x2f4fc9,_0x3a631c,!![]);}catch(_0x1eb07b){return BPromise[_0x9fc0('0x22')](_0x1eb07b);}return _0x2f4fc9[_0x9fc0('0x23')]();};}function saveUpdates(_0x58db09,_0x3cc225){return function(_0x511d61){if(_0x511d61){return _0x511d61['update'](_0x58db09)[_0x9fc0('0x24')](function(_0x578f28){return _0x578f28;});}return null;};}function removeEntity(_0x118f7e,_0x1a64eb){return function(_0x2af856){if(_0x2af856){return _0x2af856['destroy']()[_0x9fc0('0x24')](function(){_0x118f7e[_0x9fc0('0x18')](0xcc)[_0x9fc0('0x19')]();});}};}function handleEntityNotFound(_0x10b523,_0x3a0484){return function(_0x557896){if(!_0x557896){_0x10b523[_0x9fc0('0x25')](0x194);}return _0x557896;};}function handleError(_0x4031c2,_0x5c1ddc){_0x5c1ddc=_0x5c1ddc||0x1f4;return function(_0x4c9aa1){logger[_0x9fc0('0x26')](_0x4c9aa1[_0x9fc0('0x27')]);if(_0x4c9aa1[_0x9fc0('0x28')]){delete _0x4c9aa1[_0x9fc0('0x28')];}_0x4031c2['status'](_0x5c1ddc)['send'](_0x4c9aa1);};}exports[_0x9fc0('0x29')]=function(_0x2ebd70,_0x31ceb2){var _0x175155={},_0x10ccdc={},_0x4b4da9={'count':0x0,'rows':[]};var _0x3c831a=_[_0x9fc0('0x2a')](db[_0x9fc0('0x2b')][_0x9fc0('0x2c')],function(_0x2aed13){return{'name':_0x2aed13['fieldName'],'type':_0x2aed13[_0x9fc0('0x2d')][_0x9fc0('0x2e')]};});_0x10ccdc['model']=_[_0x9fc0('0x2a')](_0x3c831a,'name');_0x10ccdc[_0x9fc0('0x2f')]=_[_0x9fc0('0x30')](_0x2ebd70[_0x9fc0('0x2f')]);_0x10ccdc['filters']=_['intersection'](_0x10ccdc[_0x9fc0('0x31')],_0x10ccdc[_0x9fc0('0x2f')]);_0x175155[_0x9fc0('0x32')]=_[_0x9fc0('0x33')](_0x10ccdc['model'],qs['fields'](_0x2ebd70[_0x9fc0('0x2f')]['fields']));_0x175155[_0x9fc0('0x32')]=_0x175155['attributes'][_0x9fc0('0x34')]?_0x175155[_0x9fc0('0x32')]:_0x10ccdc[_0x9fc0('0x31')];if(!_0x2ebd70[_0x9fc0('0x2f')]['hasOwnProperty'](_0x9fc0('0x35'))){_0x175155[_0x9fc0('0x1d')]=qs[_0x9fc0('0x1d')](_0x2ebd70[_0x9fc0('0x2f')][_0x9fc0('0x1d')]);_0x175155[_0x9fc0('0x1b')]=qs['offset'](_0x2ebd70[_0x9fc0('0x2f')][_0x9fc0('0x1b')]);}_0x175155[_0x9fc0('0x36')]=qs['sort'](_0x2ebd70[_0x9fc0('0x2f')]['sort']);_0x175155[_0x9fc0('0x37')]=qs['filters'](_['pick'](_0x2ebd70['query'],_0x10ccdc[_0x9fc0('0x38')]),_0x3c831a);if(_0x2ebd70[_0x9fc0('0x2f')]['filter']){_0x175155[_0x9fc0('0x37')]=_[_0x9fc0('0x39')](_0x175155[_0x9fc0('0x37')],{'$or':_[_0x9fc0('0x2a')](_0x3c831a,function(_0x340a0d){if(_0x340a0d['type']!==_0x9fc0('0x3a')){var _0x510043={};_0x510043[_0x340a0d[_0x9fc0('0x28')]]={'$like':'%'+_0x2ebd70['query']['filter']+'%'};return _0x510043;}})});}_0x175155=_[_0x9fc0('0x39')]({},_0x175155,_0x2ebd70[_0x9fc0('0x3b')]);var _0x2e30a7={'where':_0x175155['where']};return db[_0x9fc0('0x2b')][_0x9fc0('0x1e')](_0x2e30a7)[_0x9fc0('0x24')](function(_0xbd6fa9){_0x4b4da9['count']=_0xbd6fa9;if(_0x2ebd70[_0x9fc0('0x2f')][_0x9fc0('0x3c')]){_0x175155[_0x9fc0('0x3d')]=[{'all':!![]}];}return db[_0x9fc0('0x2b')]['findAll'](_0x175155);})[_0x9fc0('0x24')](function(_0xae9952){_0x4b4da9['rows']=_0xae9952;return _0x4b4da9;})['then'](respondWithFilteredResult(_0x31ceb2,_0x175155))[_0x9fc0('0x3e')](handleError(_0x31ceb2,null));};exports['show']=function(_0x36f28a,_0x4ec8f7){var _0x3670a4={'raw':!![],'where':{'id':_0x36f28a[_0x9fc0('0x3f')]['id']}},_0x278bcb={};_0x278bcb[_0x9fc0('0x31')]=_['keys'](db[_0x9fc0('0x2b')][_0x9fc0('0x2c')]);_0x278bcb[_0x9fc0('0x2f')]=_[_0x9fc0('0x30')](_0x36f28a[_0x9fc0('0x2f')]);_0x278bcb['filters']=_[_0x9fc0('0x33')](_0x278bcb[_0x9fc0('0x31')],_0x278bcb[_0x9fc0('0x2f')]);_0x3670a4['attributes']=_['intersection'](_0x278bcb[_0x9fc0('0x31')],qs[_0x9fc0('0x40')](_0x36f28a['query'][_0x9fc0('0x40')]));_0x3670a4[_0x9fc0('0x32')]=_0x3670a4[_0x9fc0('0x32')]['length']?_0x3670a4[_0x9fc0('0x32')]:_0x278bcb['model'];if(_0x36f28a[_0x9fc0('0x2f')]['includeAll']){_0x3670a4[_0x9fc0('0x3d')]=[{'all':!![]}];}_0x3670a4=_[_0x9fc0('0x39')]({},_0x3670a4,_0x36f28a[_0x9fc0('0x3b')]);return db[_0x9fc0('0x2b')][_0x9fc0('0x41')](_0x3670a4)[_0x9fc0('0x24')](handleEntityNotFound(_0x4ec8f7,null))['then'](respondWithResult(_0x4ec8f7,null))[_0x9fc0('0x3e')](handleError(_0x4ec8f7,null));};exports['create']=function(_0x580636,_0x1f3c37){return db[_0x9fc0('0x2b')][_0x9fc0('0x42')](_0x580636[_0x9fc0('0x43')],{})['then'](respondWithResult(_0x1f3c37,0xc9))[_0x9fc0('0x3e')](handleError(_0x1f3c37,null));};exports[_0x9fc0('0x44')]=function(_0x5e0ad7,_0x1f2326){if(_0x5e0ad7[_0x9fc0('0x43')]['id']){delete _0x5e0ad7[_0x9fc0('0x43')]['id'];}return db[_0x9fc0('0x2b')]['find']({'where':{'id':_0x5e0ad7[_0x9fc0('0x3f')]['id']}})[_0x9fc0('0x24')](handleEntityNotFound(_0x1f2326,null))[_0x9fc0('0x24')](saveUpdates(_0x5e0ad7['body'],null))['then'](respondWithResult(_0x1f2326,null))['catch'](handleError(_0x1f2326,null));};exports[_0x9fc0('0x45')]=function(_0x48c7a4,_0x2dbe7b){return db['OpenchannelApplication'][_0x9fc0('0x41')]({'where':{'id':_0x48c7a4[_0x9fc0('0x3f')]['id']}})[_0x9fc0('0x24')](handleEntityNotFound(_0x2dbe7b,null))['then'](removeEntity(_0x2dbe7b,null))[_0x9fc0('0x3e')](handleError(_0x2dbe7b,null));};
\ No newline at end of file
+var _0x5c19=['query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','fieldName','key','model','keys'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x5c19,0x1e9));var _0x95c1=function(_0x46cd04,_0x32f2da){_0x46cd04=_0x46cd04-0x0;var _0x108808=_0x5c19[_0x46cd04];return _0x108808;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95c1('0x0'));var zipdir=require(_0x95c1('0x1'));var jsonpatch=require(_0x95c1('0x2'));var rp=require(_0x95c1('0x3'));var moment=require(_0x95c1('0x4'));var BPromise=require(_0x95c1('0x5'));var Mustache=require(_0x95c1('0x6'));var util=require(_0x95c1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x95c1('0x8'));var ejs=require(_0x95c1('0x9'));var fs=require('fs');var fs_extra=require(_0x95c1('0xa'));var _=require(_0x95c1('0xb'));var squel=require('squel');var crypto=require(_0x95c1('0xc'));var jsforce=require(_0x95c1('0xd'));var deskjs=require(_0x95c1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x95c1('0xf'));var Papa=require(_0x95c1('0x10'));var Redis=require('ioredis');var authService=require(_0x95c1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x95c1('0x12'));var hardwareService=require(_0x95c1('0x13'));var logger=require(_0x95c1('0x14'))('api');var utils=require(_0x95c1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x95c1('0x16'));var db=require(_0x95c1('0x17'))['db'];function respondWithStatusCode(_0x12ca2d,_0x5c7c01){_0x5c7c01=_0x5c7c01||0xcc;return function(_0x1c4a82){if(_0x1c4a82){return _0x12ca2d['sendStatus'](_0x5c7c01);}return _0x12ca2d[_0x95c1('0x18')](_0x5c7c01)['end']();};}function respondWithResult(_0x229897,_0x1caa52){_0x1caa52=_0x1caa52||0xc8;return function(_0x351373){if(_0x351373){return _0x229897[_0x95c1('0x18')](_0x1caa52)[_0x95c1('0x19')](_0x351373);}};}function respondWithFilteredResult(_0x5a8058,_0x400cdb){return function(_0x34ec96){if(_0x34ec96){var _0x582887=typeof _0x400cdb[_0x95c1('0x1a')]===_0x95c1('0x1b')&&typeof _0x400cdb['limit']===_0x95c1('0x1b');var _0x24d056=_0x34ec96[_0x95c1('0x1c')];var _0xb91df1=_0x582887?0x0:_0x400cdb[_0x95c1('0x1a')];var _0x5b4da6=_0x582887?_0x34ec96[_0x95c1('0x1c')]:_0x400cdb[_0x95c1('0x1a')]+_0x400cdb[_0x95c1('0x1d')];var _0x3fdcd1;if(_0x5b4da6>=_0x24d056){_0x5b4da6=_0x24d056;_0x3fdcd1=0xc8;}else{_0x3fdcd1=0xce;}_0x5a8058[_0x95c1('0x18')](_0x3fdcd1);return _0x5a8058[_0x95c1('0x1e')](_0x95c1('0x1f'),_0xb91df1+'-'+_0x5b4da6+'/'+_0x24d056)[_0x95c1('0x19')](_0x34ec96);}return null;};}function patchUpdates(_0x53c3e){return function(_0x389a6b){try{jsonpatch[_0x95c1('0x20')](_0x389a6b,_0x53c3e,!![]);}catch(_0x1807c1){return BPromise[_0x95c1('0x21')](_0x1807c1);}return _0x389a6b[_0x95c1('0x22')]();};}function saveUpdates(_0x3e4228,_0x1640d0){return function(_0x227bc9){if(_0x227bc9){return _0x227bc9['update'](_0x3e4228)[_0x95c1('0x23')](function(_0x1c6e6b){return _0x1c6e6b;});}return null;};}function removeEntity(_0x259873,_0x1136cb){return function(_0x9c278b){if(_0x9c278b){return _0x9c278b[_0x95c1('0x24')]()['then'](function(){_0x259873[_0x95c1('0x18')](0xcc)[_0x95c1('0x25')]();});}};}function handleEntityNotFound(_0x40c1f6,_0x204544){return function(_0x3085d7){if(!_0x3085d7){_0x40c1f6[_0x95c1('0x26')](0x194);}return _0x3085d7;};}function handleError(_0x16de65,_0x55e116){_0x55e116=_0x55e116||0x1f4;return function(_0x244ca6){logger[_0x95c1('0x27')](_0x244ca6[_0x95c1('0x28')]);if(_0x244ca6[_0x95c1('0x29')]){delete _0x244ca6[_0x95c1('0x29')];}_0x16de65[_0x95c1('0x18')](_0x55e116)[_0x95c1('0x2a')](_0x244ca6);};}exports[_0x95c1('0x2b')]=function(_0x2fcda8,_0x3237e2){var _0x44b44f={},_0x2d20d4={},_0x776c00={'count':0x0,'rows':[]};var _0x41caa2=_[_0x95c1('0x2c')](db[_0x95c1('0x2d')]['rawAttributes'],function(_0x3d6bcc){return{'name':_0x3d6bcc[_0x95c1('0x2e')],'type':_0x3d6bcc['type'][_0x95c1('0x2f')]};});_0x2d20d4[_0x95c1('0x30')]=_[_0x95c1('0x2c')](_0x41caa2,_0x95c1('0x29'));_0x2d20d4['query']=_[_0x95c1('0x31')](_0x2fcda8[_0x95c1('0x32')]);_0x2d20d4[_0x95c1('0x33')]=_['intersection'](_0x2d20d4['model'],_0x2d20d4['query']);_0x44b44f[_0x95c1('0x34')]=_[_0x95c1('0x35')](_0x2d20d4[_0x95c1('0x30')],qs[_0x95c1('0x36')](_0x2fcda8[_0x95c1('0x32')][_0x95c1('0x36')]));_0x44b44f['attributes']=_0x44b44f['attributes'][_0x95c1('0x37')]?_0x44b44f[_0x95c1('0x34')]:_0x2d20d4[_0x95c1('0x30')];if(!_0x2fcda8[_0x95c1('0x32')][_0x95c1('0x38')](_0x95c1('0x39'))){_0x44b44f[_0x95c1('0x1d')]=qs[_0x95c1('0x1d')](_0x2fcda8[_0x95c1('0x32')][_0x95c1('0x1d')]);_0x44b44f[_0x95c1('0x1a')]=qs[_0x95c1('0x1a')](_0x2fcda8[_0x95c1('0x32')][_0x95c1('0x1a')]);}_0x44b44f[_0x95c1('0x3a')]=qs[_0x95c1('0x3b')](_0x2fcda8[_0x95c1('0x32')][_0x95c1('0x3b')]);_0x44b44f[_0x95c1('0x3c')]=qs[_0x95c1('0x33')](_[_0x95c1('0x3d')](_0x2fcda8[_0x95c1('0x32')],_0x2d20d4[_0x95c1('0x33')]),_0x41caa2);if(_0x2fcda8[_0x95c1('0x32')][_0x95c1('0x3e')]){_0x44b44f[_0x95c1('0x3c')]=_['merge'](_0x44b44f[_0x95c1('0x3c')],{'$or':_[_0x95c1('0x2c')](_0x41caa2,function(_0x1d9ef8){if(_0x1d9ef8[_0x95c1('0x3f')]!=='VIRTUAL'){var _0x5a4a9a={};_0x5a4a9a[_0x1d9ef8[_0x95c1('0x29')]]={'$like':'%'+_0x2fcda8[_0x95c1('0x32')][_0x95c1('0x3e')]+'%'};return _0x5a4a9a;}})});}_0x44b44f=_[_0x95c1('0x40')]({},_0x44b44f,_0x2fcda8[_0x95c1('0x41')]);var _0x5cec30={'where':_0x44b44f['where']};return db[_0x95c1('0x2d')][_0x95c1('0x1c')](_0x5cec30)[_0x95c1('0x23')](function(_0x14c9cb){_0x776c00[_0x95c1('0x1c')]=_0x14c9cb;if(_0x2fcda8[_0x95c1('0x32')][_0x95c1('0x42')]){_0x44b44f[_0x95c1('0x43')]=[{'all':!![]}];}return db[_0x95c1('0x2d')]['findAll'](_0x44b44f);})['then'](function(_0x40a778){_0x776c00[_0x95c1('0x44')]=_0x40a778;return _0x776c00;})[_0x95c1('0x23')](respondWithFilteredResult(_0x3237e2,_0x44b44f))[_0x95c1('0x45')](handleError(_0x3237e2,null));};exports[_0x95c1('0x46')]=function(_0x30cece,_0x5d9fba){var _0x46a5a6={'raw':!![],'where':{'id':_0x30cece[_0x95c1('0x47')]['id']}},_0x4432ad={};_0x4432ad[_0x95c1('0x30')]=_[_0x95c1('0x31')](db[_0x95c1('0x2d')][_0x95c1('0x48')]);_0x4432ad['query']=_[_0x95c1('0x31')](_0x30cece[_0x95c1('0x32')]);_0x4432ad[_0x95c1('0x33')]=_[_0x95c1('0x35')](_0x4432ad[_0x95c1('0x30')],_0x4432ad[_0x95c1('0x32')]);_0x46a5a6[_0x95c1('0x34')]=_[_0x95c1('0x35')](_0x4432ad[_0x95c1('0x30')],qs['fields'](_0x30cece[_0x95c1('0x32')][_0x95c1('0x36')]));_0x46a5a6['attributes']=_0x46a5a6[_0x95c1('0x34')]['length']?_0x46a5a6[_0x95c1('0x34')]:_0x4432ad['model'];if(_0x30cece[_0x95c1('0x32')][_0x95c1('0x42')]){_0x46a5a6['include']=[{'all':!![]}];}_0x46a5a6=_[_0x95c1('0x40')]({},_0x46a5a6,_0x30cece['options']);return db[_0x95c1('0x2d')][_0x95c1('0x49')](_0x46a5a6)[_0x95c1('0x23')](handleEntityNotFound(_0x5d9fba,null))[_0x95c1('0x23')](respondWithResult(_0x5d9fba,null))['catch'](handleError(_0x5d9fba,null));};exports['create']=function(_0xad91a0,_0x3afea7){return db[_0x95c1('0x2d')][_0x95c1('0x4a')](_0xad91a0[_0x95c1('0x4b')],{})[_0x95c1('0x23')](respondWithResult(_0x3afea7,0xc9))[_0x95c1('0x45')](handleError(_0x3afea7,null));};exports[_0x95c1('0x4c')]=function(_0x548842,_0x2c81db){if(_0x548842[_0x95c1('0x4b')]['id']){delete _0x548842['body']['id'];}return db[_0x95c1('0x2d')]['find']({'where':{'id':_0x548842['params']['id']}})[_0x95c1('0x23')](handleEntityNotFound(_0x2c81db,null))[_0x95c1('0x23')](saveUpdates(_0x548842['body'],null))[_0x95c1('0x23')](respondWithResult(_0x2c81db,null))[_0x95c1('0x45')](handleError(_0x2c81db,null));};exports[_0x95c1('0x24')]=function(_0x5a00e1,_0x239e76){return db[_0x95c1('0x2d')]['find']({'where':{'id':_0x5a00e1['params']['id']}})[_0x95c1('0x23')](handleEntityNotFound(_0x239e76,null))['then'](removeEntity(_0x239e76,null))['catch'](handleError(_0x239e76,null));};
\ No newline at end of file
index 82a3666..aa55891 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14aa=['define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x14aa,0xe2));var _0xa14a=function(_0x380fca,_0x587cab){_0x380fca=_0x380fca-0x0;var _0x567337=_0x14aa[_0x380fca];return _0x567337;};'use strict';var _=require(_0xa14a('0x0'));var util=require(_0xa14a('0x1'));var logger=require(_0xa14a('0x2'))(_0xa14a('0x3'));var moment=require(_0xa14a('0x4'));var BPromise=require(_0xa14a('0x5'));var rp=require(_0xa14a('0x6'));var fs=require('fs');var path=require(_0xa14a('0x7'));var rimraf=require(_0xa14a('0x8'));var config=require(_0xa14a('0x9'));var attributes=require(_0xa14a('0xa'));module[_0xa14a('0xb')]=function(_0xf2e102,_0x14ed9d){return _0xf2e102[_0xa14a('0xc')](_0xa14a('0xd'),attributes,{'tableName':_0xa14a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa14a('0xf'),'collate':_0xa14a('0x10')});};
\ No newline at end of file
+var _0x5884=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash'];(function(_0x5d19bd,_0x484137){var _0x15d70c=function(_0x175948){while(--_0x175948){_0x5d19bd['push'](_0x5d19bd['shift']());}};_0x15d70c(++_0x484137);}(_0x5884,0x12b));var _0x4588=function(_0x2e1910,_0x9ecd5b){_0x2e1910=_0x2e1910-0x0;var _0x4dda00=_0x5884[_0x2e1910];return _0x4dda00;};'use strict';var _=require(_0x4588('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4588('0x1'));var moment=require(_0x4588('0x2'));var BPromise=require(_0x4588('0x3'));var rp=require(_0x4588('0x4'));var fs=require('fs');var path=require(_0x4588('0x5'));var rimraf=require('rimraf');var config=require(_0x4588('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0x4588('0x7')]=function(_0x6e12e3,_0x26735f){return _0x6e12e3[_0x4588('0x8')](_0x4588('0x9'),attributes,{'tableName':_0x4588('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4588('0xb')});};
\ No newline at end of file
index a12ae80..d3c49ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8d3=['result','body','options','where','attributes','limit','UpdateOpenchannelApplication','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x3e92b3,_0x33f968){var _0x14609f=function(_0x5b968e){while(--_0x5b968e){_0x3e92b3['push'](_0x3e92b3['shift']());}};_0x14609f(++_0x33f968);}(_0xc8d3,0x1bb));var _0x3c8d=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc8d3[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x3c8d('0x0'));var util=require(_0x3c8d('0x1'));var moment=require(_0x3c8d('0x2'));var BPromise=require(_0x3c8d('0x3'));var rs=require(_0x3c8d('0x4'));var fs=require('fs');var Redis=require(_0x3c8d('0x5'));var db=require(_0x3c8d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c8d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3c8d('0x8'));var client=jayson[_0x3c8d('0x9')][_0x3c8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25c223,_0x30bc5e,_0x14b4f6){return new BPromise(function(_0x7be16f,_0x88561f){return client[_0x3c8d('0xb')](_0x25c223,_0x14b4f6)[_0x3c8d('0xc')](function(_0x3621a8){logger[_0x3c8d('0xd')](_0x3c8d('0xe'),_0x30bc5e,_0x3c8d('0xf'));logger[_0x3c8d('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x30bc5e,_0x3c8d('0xf'),JSON[_0x3c8d('0x11')](_0x3621a8));if(_0x3621a8[_0x3c8d('0x12')]){if(_0x3621a8[_0x3c8d('0x12')][_0x3c8d('0x13')]===0x1f4){logger[_0x3c8d('0x12')](_0x3c8d('0xe'),_0x30bc5e,_0x3621a8[_0x3c8d('0x12')][_0x3c8d('0x14')]);return _0x88561f(_0x3621a8[_0x3c8d('0x12')][_0x3c8d('0x14')]);}logger[_0x3c8d('0x12')](_0x3c8d('0xe'),_0x30bc5e,_0x3621a8[_0x3c8d('0x12')][_0x3c8d('0x14')]);return _0x7be16f(_0x3621a8[_0x3c8d('0x12')][_0x3c8d('0x14')]);}else{logger[_0x3c8d('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x30bc5e,_0x3c8d('0xf'));_0x7be16f(_0x3621a8[_0x3c8d('0x15')][_0x3c8d('0x14')]);}})['catch'](function(_0x4d960e){logger['error'](_0x3c8d('0xe'),_0x30bc5e,_0x4d960e);_0x88561f(_0x4d960e);});});}exports['UpdateOpenchannelApplication']=function(_0x3a3d6f){var _0x217e41=this;return new Promise(function(_0x55adba,_0x4c5556){return db['OpenchannelApplication']['update'](_0x3a3d6f[_0x3c8d('0x16')],{'raw':_0x3a3d6f[_0x3c8d('0x17')]?_0x3a3d6f[_0x3c8d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a3d6f[_0x3c8d('0x17')]?_0x3a3d6f[_0x3c8d('0x17')][_0x3c8d('0x18')]||null:null,'attributes':_0x3a3d6f['options']?_0x3a3d6f[_0x3c8d('0x17')][_0x3c8d('0x19')]||null:null,'limit':_0x3a3d6f[_0x3c8d('0x17')]?_0x3a3d6f[_0x3c8d('0x17')][_0x3c8d('0x1a')]||null:null})[_0x3c8d('0xc')](function(_0x439e77){logger['info'](_0x3c8d('0x1b'),_0x3a3d6f);logger['debug']('UpdateOpenchannelApplication',_0x3a3d6f,JSON[_0x3c8d('0x11')](_0x439e77));_0x55adba(_0x439e77);})[_0x3c8d('0x1c')](function(_0x21a097){logger[_0x3c8d('0x12')](_0x3c8d('0x1b'),_0x21a097[_0x3c8d('0x14')],_0x3a3d6f);_0x4c5556(_0x217e41[_0x3c8d('0x12')](0x1f4,_0x21a097[_0x3c8d('0x14')]));});});};
\ No newline at end of file
+var _0xf385=['error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','update','body','options','where','attributes','limit','UpdateOpenchannelApplication','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbbcdca,_0x59de0d){var _0x56d9b0=function(_0x441e57){while(--_0x441e57){_0xbbcdca['push'](_0xbbcdca['shift']());}};_0x56d9b0(++_0x59de0d);}(_0xf385,0x1f3));var _0x5f38=function(_0x537bcd,_0x13bae1){_0x537bcd=_0x537bcd-0x0;var _0x6cc881=_0xf385[_0x537bcd];return _0x6cc881;};'use strict';var _=require('lodash');var util=require(_0x5f38('0x0'));var moment=require(_0x5f38('0x1'));var BPromise=require(_0x5f38('0x2'));var rs=require(_0x5f38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5f38('0x4'));var logger=require('../../config/logger')(_0x5f38('0x5'));var config=require(_0x5f38('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5f38('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x578e06,_0x24fc9d,_0x26fb74){return new BPromise(function(_0x5ee50c,_0x395908){return client['request'](_0x578e06,_0x26fb74)[_0x5f38('0x8')](function(_0x52e739){logger[_0x5f38('0x9')]('OpenchannelApplication,\x20%s,\x20%s',_0x24fc9d,_0x5f38('0xa'));logger[_0x5f38('0xb')](_0x5f38('0xc'),_0x24fc9d,_0x5f38('0xa'),JSON[_0x5f38('0xd')](_0x52e739));if(_0x52e739[_0x5f38('0xe')]){if(_0x52e739[_0x5f38('0xe')][_0x5f38('0xf')]===0x1f4){logger[_0x5f38('0xe')](_0x5f38('0x10'),_0x24fc9d,_0x52e739[_0x5f38('0xe')][_0x5f38('0x11')]);return _0x395908(_0x52e739[_0x5f38('0xe')][_0x5f38('0x11')]);}logger['error'](_0x5f38('0x10'),_0x24fc9d,_0x52e739['error'][_0x5f38('0x11')]);return _0x5ee50c(_0x52e739[_0x5f38('0xe')][_0x5f38('0x11')]);}else{logger[_0x5f38('0x9')](_0x5f38('0x10'),_0x24fc9d,_0x5f38('0xa'));_0x5ee50c(_0x52e739[_0x5f38('0x12')][_0x5f38('0x11')]);}})[_0x5f38('0x13')](function(_0x36e6c8){logger[_0x5f38('0xe')](_0x5f38('0x10'),_0x24fc9d,_0x36e6c8);_0x395908(_0x36e6c8);});});}exports['UpdateOpenchannelApplication']=function(_0x5e6604){var _0x21f849=this;return new Promise(function(_0x44d389,_0x3321e0){return db['OpenchannelApplication'][_0x5f38('0x14')](_0x5e6604[_0x5f38('0x15')],{'raw':_0x5e6604[_0x5f38('0x16')]?_0x5e6604['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e6604['options']?_0x5e6604[_0x5f38('0x16')][_0x5f38('0x17')]||null:null,'attributes':_0x5e6604[_0x5f38('0x16')]?_0x5e6604['options'][_0x5f38('0x18')]||null:null,'limit':_0x5e6604['options']?_0x5e6604['options'][_0x5f38('0x19')]||null:null})['then'](function(_0xcfc177){logger['info'](_0x5f38('0x1a'),_0x5e6604);logger[_0x5f38('0xb')](_0x5f38('0x1a'),_0x5e6604,JSON[_0x5f38('0xd')](_0xcfc177));_0x44d389(_0xcfc177);})[_0x5f38('0x13')](function(_0x3b4894){logger[_0x5f38('0xe')](_0x5f38('0x1a'),_0x3b4894[_0x5f38('0x11')],_0x5e6604);_0x3321e0(_0x21f849['error'](0x1f4,_0x3b4894[_0x5f38('0x11')]));});});};
\ No newline at end of file
index 8527368..cbe9722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0aa=['openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel'];(function(_0x423e15,_0x12b2b2){var _0x184279=function(_0x445a68){while(--_0x445a68){_0x423e15['push'](_0x423e15['shift']());}};_0x184279(++_0x12b2b2);}(_0xa0aa,0x133));var _0xaa0a=function(_0x431c62,_0x3e2d21){_0x431c62=_0x431c62-0x0;var _0x308c71=_0xa0aa[_0x431c62];return _0x308c71;};'use strict';var multer=require(_0xaa0a('0x0'));var util=require(_0xaa0a('0x1'));var path=require(_0xaa0a('0x2'));var timeout=require(_0xaa0a('0x3'));var express=require(_0xaa0a('0x4'));var router=express[_0xaa0a('0x5')]();var fs_extra=require(_0xaa0a('0x6'));var auth=require(_0xaa0a('0x7'));var interaction=require(_0xaa0a('0x8'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0xaa0a('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa0a('0xa')]);router[_0xaa0a('0x9')]('/describe',auth[_0xaa0a('0xb')](),controller['describe']);router[_0xaa0a('0x9')](_0xaa0a('0xc'),auth[_0xaa0a('0xb')](),controller[_0xaa0a('0xd')]);router[_0xaa0a('0x9')](_0xaa0a('0xe'),auth['isAuthenticated'](),controller[_0xaa0a('0xf')]);router[_0xaa0a('0x9')](_0xaa0a('0x10'),auth['isAuthenticated'](),controller['download']);router[_0xaa0a('0x11')]('/',auth[_0xaa0a('0xb')](),controller[_0xaa0a('0x12')]);router[_0xaa0a('0x11')](_0xaa0a('0xe'),auth[_0xaa0a('0xb')](),controller[_0xaa0a('0x13')]);router[_0xaa0a('0x11')](_0xaa0a('0x14'),auth['isAuthenticated'](),interaction[_0xaa0a('0x15')](_0xaa0a('0x16'),_0xaa0a('0x17')),controller[_0xaa0a('0x18')]);router[_0xaa0a('0x19')]('/:id',auth[_0xaa0a('0xb')](),interaction[_0xaa0a('0x15')](_0xaa0a('0x16'),_0xaa0a('0x1a')),controller[_0xaa0a('0x1b')]);router[_0xaa0a('0x1c')](_0xaa0a('0xc'),auth[_0xaa0a('0xb')](),interaction[_0xaa0a('0x15')](_0xaa0a('0x16'),_0xaa0a('0x1d')),controller[_0xaa0a('0x1e')]);router[_0xaa0a('0x1c')](_0xaa0a('0x14'),auth[_0xaa0a('0xb')](),controller[_0xaa0a('0x1f')]);module[_0xaa0a('0x20')]=router;
\ No newline at end of file
+var _0x3c0c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','/describe','isAuthenticated','/:id','/:id/messages','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','util','express','Router','fs-extra'];(function(_0x4f383a,_0x23e2db){var _0x2c30b1=function(_0x219098){while(--_0x219098){_0x4f383a['push'](_0x4f383a['shift']());}};_0x2c30b1(++_0x23e2db);}(_0x3c0c,0x6c));var _0xc3c0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3c0c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xc3c0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc3c0('0x1'));var router=express[_0xc3c0('0x2')]();var fs_extra=require(_0xc3c0('0x3'));var auth=require(_0xc3c0('0x4'));var interaction=require(_0xc3c0('0x5'));var config=require(_0xc3c0('0x6'));var controller=require(_0xc3c0('0x7'));router[_0xc3c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc3c0('0x8')](_0xc3c0('0x9'),auth[_0xc3c0('0xa')](),controller['describe']);router[_0xc3c0('0x8')](_0xc3c0('0xb'),auth[_0xc3c0('0xa')](),controller['show']);router['get'](_0xc3c0('0xc'),auth[_0xc3c0('0xa')](),controller['getMessages']);router['get']('/:id/download',auth[_0xc3c0('0xa')](),controller['download']);router[_0xc3c0('0xd')]('/',auth[_0xc3c0('0xa')](),controller['create']);router['post']('/:id/messages',auth[_0xc3c0('0xa')](),controller[_0xc3c0('0xe')]);router[_0xc3c0('0xd')](_0xc3c0('0xf'),auth[_0xc3c0('0xa')](),interaction['tracked'](_0xc3c0('0x10'),_0xc3c0('0x11')),controller[_0xc3c0('0x12')]);router[_0xc3c0('0x13')]('/:id',auth[_0xc3c0('0xa')](),interaction[_0xc3c0('0x14')](_0xc3c0('0x10'),_0xc3c0('0x15')),controller[_0xc3c0('0x16')]);router[_0xc3c0('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xc3c0('0x10'),_0xc3c0('0x18')),controller[_0xc3c0('0x19')]);router[_0xc3c0('0x17')](_0xc3c0('0xf'),auth[_0xc3c0('0xa')](),controller[_0xc3c0('0x1a')]);module[_0xc3c0('0x1b')]=router;
\ No newline at end of file
index 67da60b..2597146 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9658=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x55317b,_0x539fc0){var _0x2cfe0e=function(_0x237b07){while(--_0x237b07){_0x55317b['push'](_0x55317b['shift']());}};_0x2cfe0e(++_0x539fc0);}(_0x9658,0x6f));var _0x8965=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x9658[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require(_0x8965('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8965('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8965('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8965('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8965('0x3')]},'read1stAt':{'type':Sequelize[_0x8965('0x2')]},'threadId':{'type':Sequelize[_0x8965('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x8965('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8965('0x4')]('in',_0x8965('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8965('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x8965('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x89bf=['DATE','ENUM','out','sequelize','BOOLEAN','STRING'];(function(_0x1542bc,_0x32815a){var _0xba40ff=function(_0x360a3b){while(--_0x360a3b){_0x1542bc['push'](_0x1542bc['shift']());}};_0xba40ff(++_0x32815a);}(_0x89bf,0x11d));var _0xf89b=function(_0xf9b2a5,_0x4987f7){_0xf9b2a5=_0xf9b2a5-0x0;var _0x2ec89d=_0x89bf[_0xf9b2a5];return _0x2ec89d;};'use strict';var Sequelize=require(_0xf89b('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf89b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf89b('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf89b('0x2')]},'note':{'type':Sequelize[_0xf89b('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xf89b('0x2')]},'externalUrl':{'type':Sequelize[_0xf89b('0x2')]},'lastMsgAt':{'type':Sequelize[_0xf89b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf89b('0x4')]('in',_0xf89b('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf89b('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xf89b('0x1')],'defaultValue':![]}};
\ No newline at end of file
index b27f479..053fbf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x759e=['left_join','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','expr','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','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?','ContactId','buildExpression','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','where','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','a.key','Account.key','a.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','contactName','c.firstName','Contact.firstName','c.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','find','create','describe','addMessage','OpenchannelMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','emit','openchannelInteractionTags:save','removeTags','download','join','server','files','tmp','root','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','OpenchannelAccount','Owner','get','mkdirSync','Account','N.A.','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','createWriteStream','direction','out','secret','renderFile','views','transcript-','.pdf','Openchannel','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','json','undefined','limit','count','offset','apply','reject','save','destroy','then','sendStatus','error','stack','Users','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','OpenchannelInteraction','rawAttributes','fieldName','key','map','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x759e,0x18d));var _0xe759=function(_0x478a9e,_0xac3f2e){_0x478a9e=_0x478a9e-0x0;var _0x120c42=_0x759e[_0x478a9e];return _0x120c42;};'use strict';var emlformat=require(_0xe759('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe759('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe759('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe759('0x3'));var util=require(_0xe759('0x4'));var path=require(_0xe759('0x5'));var sox=require(_0xe759('0x6'));var csv=require(_0xe759('0x7'));var ejs=require(_0xe759('0x8'));var fs=require('fs');var fs_extra=require(_0xe759('0x9'));var _=require(_0xe759('0xa'));var squel=require(_0xe759('0xb'));var crypto=require(_0xe759('0xc'));var jsforce=require(_0xe759('0xd'));var deskjs=require(_0xe759('0xe'));var toCsv=require(_0xe759('0x7'));var querystring=require(_0xe759('0xf'));var Papa=require('papaparse');var Redis=require(_0xe759('0x10'));var authService=require(_0xe759('0x11'));var qs=require(_0xe759('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xe759('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe759('0x14'));var utils=require(_0xe759('0x15'));var config=require(_0xe759('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe759('0x17'))['db'];config[_0xe759('0x18')]=_[_0xe759('0x19')](config[_0xe759('0x18')],{'host':_0xe759('0x1a'),'port':0x18eb});var socket=require(_0xe759('0x1b'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xe759('0x1c')](socket);function respondWithStatusCode(_0x2af924,_0x14c77f){_0x14c77f=_0x14c77f||0xcc;return function(_0x3387b1){if(_0x3387b1){return _0x2af924['sendStatus'](_0x14c77f);}return _0x2af924['status'](_0x14c77f)[_0xe759('0x1d')]();};}function respondWithResult(_0x45671b,_0x563abe){_0x563abe=_0x563abe||0xc8;return function(_0xaefd28){if(_0xaefd28){return _0x45671b[_0xe759('0x1e')](_0x563abe)[_0xe759('0x1f')](_0xaefd28);}};}function respondWithFilteredResult(_0x413882,_0xd1e07a){return function(_0xa13a9a){if(_0xa13a9a){var _0x4aa9ab=typeof _0xd1e07a['offset']===_0xe759('0x20')&&typeof _0xd1e07a[_0xe759('0x21')]===_0xe759('0x20');var _0x26094e=_0xa13a9a[_0xe759('0x22')];var _0x13cb0a=_0x4aa9ab?0x0:_0xd1e07a[_0xe759('0x23')];var _0x23fcb5=_0x4aa9ab?_0xa13a9a['count']:_0xd1e07a['offset']+_0xd1e07a[_0xe759('0x21')];var _0x1c7dfa;if(_0x23fcb5>=_0x26094e){_0x23fcb5=_0x26094e;_0x1c7dfa=0xc8;}else{_0x1c7dfa=0xce;}_0x413882[_0xe759('0x1e')](_0x1c7dfa);return _0x413882['set']('Content-Range',_0x13cb0a+'-'+_0x23fcb5+'/'+_0x26094e)[_0xe759('0x1f')](_0xa13a9a);}return null;};}function patchUpdates(_0x1be55e){return function(_0x6702db){try{jsonpatch[_0xe759('0x24')](_0x6702db,_0x1be55e,!![]);}catch(_0xc6e7c1){return BPromise[_0xe759('0x25')](_0xc6e7c1);}return _0x6702db[_0xe759('0x26')]();};}function saveUpdates(_0x293080,_0xcf712f){return function(_0x145e0){if(_0x145e0){return _0x145e0['update'](_0x293080)['then'](function(_0xd5fabe){return _0xd5fabe;});}return null;};}function removeEntity(_0x579c15,_0x24be4e){return function(_0x3116f4){if(_0x3116f4){return _0x3116f4[_0xe759('0x27')]()[_0xe759('0x28')](function(){_0x579c15[_0xe759('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x192808,_0x1fbc20){return function(_0x55c953){if(!_0x55c953){_0x192808[_0xe759('0x29')](0x194);}return _0x55c953;};}function handleError(_0x554ab7,_0x2f4871){_0x2f4871=_0x2f4871||0x1f4;return function(_0xdfec6f){logger[_0xe759('0x2a')](_0xdfec6f[_0xe759('0x2b')]);if(_0xdfec6f['name']){delete _0xdfec6f['name'];}_0x554ab7[_0xe759('0x1e')](_0x2f4871)['send'](_0xdfec6f);};}function getInteractionUsers(_0x409a29,_0x263844){return new BPromise(function(_0x31c71f,_0x2997ff){try{if(_0x263844[_0x409a29['id']]){_0x409a29[_0xe759('0x2c')]=_['map'](_0x263844[_0x409a29['id']],function(_0x2a9e55){return{'id':_0x2a9e55['id'],'fullname':_0x2a9e55[_0xe759('0x2d')]};});}}catch(_0x44c5c1){_0x2997ff(_0x44c5c1);}_0x31c71f(_0x409a29);});}function getInteractionTags(_0x32900e,_0x1fc7a8){return new BPromise(function(_0x2d75e2,_0x392f25){try{if(_0x32900e[_0xe759('0x2e')]){_0x32900e[_0xe759('0x2f')]=[];_0x32900e[_0xe759('0x2e')][_0xe759('0x30')](',')[_0xe759('0x31')](function(_0x12a325){_0x32900e[_0xe759('0x2f')][_0xe759('0x32')](_0x1fc7a8[_0x12a325]);});}delete _0x32900e[_0xe759('0x2e')];}catch(_0x10bb8a){_0x392f25(_0x10bb8a);}_0x2d75e2(_0x32900e);});}function updateOpenchannelInteraction(_0x4a9ab8,_0x5eef57,_0x4e6e74){return new BPromise(function(_0x5ab51e,_0x16ffb1){return getInteractionUsers(_0x4a9ab8,_0x4e6e74)[_0xe759('0x28')](function(_0xc7fc94){return getInteractionTags(_0xc7fc94,_0x5eef57);})[_0xe759('0x28')](function(_0x497046){return getStateInteraction(_0x497046);})[_0xe759('0x28')](function(_0x450b21){_0x5ab51e(_0x450b21);})[_0xe759('0x33')](function(_0x4afde2){_0x16ffb1(_0x4afde2);});});}function getStateInteraction(_0x5d991d){return new BPromise(function(_0x4ac93b){_0x5d991d[_0xe759('0x34')]=0x0;_0x5d991d[_0xe759('0x35')]=0x0;_0x5d991d[_0xe759('0x36')]=0x0;_0x5d991d[_0xe759('0x37')]=0x0;_0x5d991d[_0xe759('0x38')]=0x0;if(!_0x5d991d[_0xe759('0x39')]&&!_0x5d991d[_0xe759('0x3a')]){_0x5d991d[_0xe759('0x34')]+=0x1;}if(!_0x5d991d['closed']&&_0x5d991d[_0xe759('0x3a')]){_0x5d991d[_0xe759('0x35')]+=0x1;if(_0x5d991d[_0xe759('0x34')]){_0x5d991d[_0xe759('0x34')]-=0x1;}}if(_0x5d991d['closed']&&_0x5d991d[_0xe759('0x3a')]){_0x5d991d[_0xe759('0x36')]+=0x1;if(_0x5d991d[_0xe759('0x35')]){_0x5d991d[_0xe759('0x35')]-=0x1;}}if(_0x5d991d['closed']&&!_0x5d991d['UserId']){_0x5d991d[_0xe759('0x37')]+=0x1;if(_0x5d991d['waiting']){_0x5d991d['waiting']-=0x1;}}_0x5d991d[_0xe759('0x38')]+=0x1;_0x4ac93b(_0x5d991d);});}exports[_0xe759('0x3b')]=function(_0x4a7392,_0x13e378){var _0x32b6b8={},_0x5b3961={},_0x2708f4={'count':0x0,'rows':[]};var _0x5b94a4=_['map'](db[_0xe759('0x3c')][_0xe759('0x3d')],function(_0x36a5af){return{'name':_0x36a5af[_0xe759('0x3e')],'type':_0x36a5af['type'][_0xe759('0x3f')]};});_0x5b3961['model']=_[_0xe759('0x40')](_0x5b94a4,_0xe759('0x41'));_0x5b3961['query']=_['keys'](_0x4a7392[_0xe759('0x42')]);_0x5b3961[_0xe759('0x43')]=_[_0xe759('0x44')](_0x5b3961[_0xe759('0x45')],_0x5b3961[_0xe759('0x42')]);_0x32b6b8[_0xe759('0x46')]=_['intersection'](_0x5b3961['model'],qs[_0xe759('0x47')](_0x4a7392[_0xe759('0x42')]['fields']));_0x32b6b8[_0xe759('0x46')]=_0x32b6b8[_0xe759('0x46')]['length']?_0x32b6b8[_0xe759('0x46')]:_0x5b3961['model'];if(!_0x4a7392['query'][_0xe759('0x48')](_0xe759('0x49'))){_0x32b6b8[_0xe759('0x21')]=qs[_0xe759('0x21')](_0x4a7392[_0xe759('0x42')]['limit']);_0x32b6b8[_0xe759('0x23')]=qs[_0xe759('0x23')](_0x4a7392[_0xe759('0x42')][_0xe759('0x23')]);}_0x32b6b8[_0xe759('0x4a')]=qs[_0xe759('0x4b')](_0x4a7392[_0xe759('0x42')][_0xe759('0x4b')]);_0x32b6b8['where']=qs[_0xe759('0x43')](_[_0xe759('0x4c')](_0x4a7392[_0xe759('0x42')],_0x5b3961[_0xe759('0x43')]),_0x5b94a4);var _0x49af77=[];var _0x2713cc=squel[_0xe759('0x4d')]()['field']('id')[_0xe759('0x4e')](_0xe759('0x41'))['field'](_0xe759('0x4f'))[_0xe759('0x50')](_0xe759('0x51'));var _0x2a6e9e=squel[_0xe759('0x4d')]()[_0xe759('0x4e')](_0xe759('0x52'))[_0xe759('0x4e')](_0xe759('0x53'))[_0xe759('0x4e')](_0xe759('0x54'))[_0xe759('0x50')](_0xe759('0x55'),'ui')['left_join'](_0xe759('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x200a2c=squel[_0xe759('0x4d')]()['from']('openchannel_interactions','i')[_0xe759('0x57')](_0xe759('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe759('0x57')](_0xe759('0x56'),'o',_0xe759('0x59'))['left_join'](_0xe759('0x5a'),'a',_0xe759('0x5b'))['left_join'](_0xe759('0x5c'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xe759('0x57')](_0xe759('0x5d'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5f35a9=squel[_0xe759('0x5e')]();var _0x404d83=[];var _0x408d72=squel[_0xe759('0x5e')]();var _0x45e045;if(_0x4a7392[_0xe759('0x42')]['search']){_0x45e045=as[_0xe759('0x5f')](_0x4a7392[_0xe759('0x42')][_0xe759('0x60')]);var _0x161d7b=_0x45e045['sqlOperator'];for(var _0x2b7e5d=0x0;_0x2b7e5d<_0x45e045[_0xe759('0x61')]['length'];_0x2b7e5d++){var _0xa7750e=_0x45e045['conditions'][_0x2b7e5d];var _0x2476b7='i';var _0x7c3f22=_['find'](_0x5b94a4,[_0xe759('0x41'),_0xa7750e[_0xe759('0x4e')]]);if(!_0x7c3f22){switch(_0xa7750e[_0xe759('0x4e')]){case _0xe759('0x62'):if(_0xa7750e[_0xe759('0x63')]==0x1){_0x200a2c[_0xe759('0x64')]('`'+_0xa7750e[_0xe759('0x4e')]+_0xe759('0x65'));}else{_0x200a2c[_0xe759('0x64')]('`'+_0xa7750e[_0xe759('0x4e')]+'`\x20>\x200');}break;case _0xe759('0x66'):if(_0xa7750e[_0xe759('0x67')]===_0xe759('0x68')){if(_0xa7750e[_0xe759('0x63')]['split']('\x20')[_0xe759('0x69')]>0x1){_0x5f35a9[_0x161d7b](_0xe759('0x6a'),qs[_0xe759('0x6b')](_0xa7750e[_0xe759('0x63')]),null);}else{var _0x1159cc='%'+_0xa7750e[_0xe759('0x63')]+'%';_0x5f35a9[_0x161d7b](_0xe759('0x6c'),_0x1159cc,_0x1159cc,_0x1159cc);}}else{_0x7c3f22=_['find'](_0x5b94a4,[_0xe759('0x41'),_0xe759('0x6d')]);_0xa7750e[_0xe759('0x4e')]=_0xe759('0x6d');_0x384e86=as[_0xe759('0x6e')](_0x2476b7,_0x7c3f22[_0xe759('0x6f')],_0xa7750e);_0x5f35a9[_0x161d7b](_0x384e86[_0xe759('0x70')],_0x384e86[_0xe759('0x63')][_0xe759('0x71')],_0x384e86[_0xe759('0x63')][_0xe759('0x1d')]);}break;case _0xe759('0x72'):var _0x8fba49=_0xa7750e['value']['split'](',')[_0xe759('0x40')](function(_0x511233){return Number(_0x511233);});_0x8fba49['forEach'](function(_0x2b98e1){_0x408d72['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b98e1+',%');});_0x404d83=_[_0xe759('0x73')](_0x404d83,_0x8fba49);break;case _0xe759('0x74'):if(_0xa7750e['operator']===_0xe759('0x68')){_0x5f35a9[_0x161d7b](_0xe759('0x75'),'%'+_0xa7750e['value']+'%',null);}else{_0x7c3f22=_['find'](_0x5b94a4,['name',_0xe759('0x3a')]);_0xa7750e[_0xe759('0x4e')]=_0xe759('0x3a');_0x384e86=as[_0xe759('0x6e')](_0x2476b7,_0x7c3f22[_0xe759('0x6f')],_0xa7750e);_0x5f35a9[_0x161d7b](_0x384e86[_0xe759('0x70')],_0x384e86['value'][_0xe759('0x71')],_0x384e86['value'][_0xe759('0x1d')]);}break;case _0xe759('0x76'):_0x384e86=as[_0xe759('0x6e')]('me',null,_0xa7750e);_0x5f35a9[_0x161d7b](_0x384e86[_0xe759('0x70')],_0x384e86[_0xe759('0x63')][_0xe759('0x71')],_0x384e86[_0xe759('0x63')][_0xe759('0x1d')]);break;}}else{var _0x384e86=as[_0xe759('0x6e')](_0x2476b7,_0x7c3f22[_0xe759('0x6f')],_0xa7750e);_0x5f35a9[_0x161d7b](_0x384e86[_0xe759('0x70')],_0x384e86[_0xe759('0x63')][_0xe759('0x71')],_0x384e86[_0xe759('0x63')][_0xe759('0x1d')]);}}}else{var _0x24c092=_(_0x4a7392[_0xe759('0x42')])[_0xe759('0x77')]()[_0xe759('0x40')](function(_0xc6578c){return _[_0xe759('0x78')](_0x5b94a4,[_0xe759('0x41'),_0xc6578c])?_0xc6578c:undefined;})[_0xe759('0x79')]()[_0xe759('0x63')]();if(!_[_0xe759('0x7a')](_0x24c092)){_0x24c092['forEach'](function(_0x5e4538){if(_0x5e4538==='OpenchannelAccountId'){_0x200a2c[_0xe759('0x7b')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xe759('0x7c')](_0x4a7392['query'][_0x5e4538]));}else if(_0x5e4538===_0xe759('0x7d')){var _0x316959=JSON[_0xe759('0x7e')](_0x4a7392[_0xe759('0x42')][_0x5e4538])[_0xe759('0x7f')];var _0xaef798=JSON[_0xe759('0x7e')](_0x4a7392[_0xe759('0x42')][_0x5e4538])[_0xe759('0x80')];_0x200a2c[_0xe759('0x7b')](_0xe759('0x81'),_0x316959,_0xaef798);}else{if(_0x4a7392['query'][_0x5e4538]===_0xe759('0x82')){_0x200a2c[_0xe759('0x7b')]('i.'+_0x5e4538+_0xe759('0x83'));}else{_0x200a2c['where']('i.'+_0x5e4538+_0xe759('0x84'),_0x4a7392[_0xe759('0x42')][_0x5e4538]);}}});}if(_0x4a7392[_0xe759('0x42')][_0xe759('0x85')]){if(_0x4a7392['query'][_0xe759('0x85')]==0x1){_0x200a2c[_0xe759('0x64')](_0xe759('0x86'));}else{_0x200a2c[_0xe759('0x64')](_0xe759('0x87'));}}if(_0x4a7392[_0xe759('0x42')][_0xe759('0x88')]){_0x404d83=_['isArray'](_0x4a7392[_0xe759('0x42')]['tag'])?_0x4a7392[_0xe759('0x42')]['tag']:new Array(_0x4a7392['query']['tag']);_0x404d83['forEach'](function(_0x39104a){_0x408d72['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x39104a+',%');});}if(_0x4a7392[_0xe759('0x42')][_0xe759('0x89')]){var _0x4d095e=_0x4a7392['query']['filter'][_0xe759('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe759('0x8b')](_0x4d095e)){_0x5f35a9['or']('i.id\x20LIKE\x20?',_0x4d095e+'%');}else{_0x5f35a9['or'](_0xe759('0x8c'),qs[_0xe759('0x6b')](_0x4d095e))['or']('i.from\x20LIKE\x20?',_0x4d095e+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4d095e+'%');}}}_0x200a2c['where'](_0x5f35a9);_0x200a2c[_0xe759('0x8d')]('i.id');var _0x1da040={'type':db[_0xe759('0x8e')][_0xe759('0x8f')][_0xe759('0x90')],'raw':!![]};var _0x5952b8=_0x200a2c[_0xe759('0x91')]();_0x5952b8[_0xe759('0x4e')](_0xe759('0x92'));_0x5952b8[_0xe759('0x4e')](_0xe759('0x93'),_0xe759('0x62'));if(_0x32b6b8[_0xe759('0x4a')]){_0x32b6b8[_0xe759('0x4a')][_0xe759('0x31')](function(_0x1243f0){var _0x5a3712=_0x1243f0[0x0]==='contactName'?_0x1243f0[0x0]:'i.'+_0x1243f0[0x0];_0x200a2c[_0xe759('0x4a')](_0x5a3712,_0x1243f0[0x1]===_0xe759('0x94')?![]:!![]);});}if(!_[_0xe759('0x7a')](_0x404d83)){_0x200a2c[_0xe759('0x64')](_0x408d72);_0x5952b8[_0xe759('0x7b')](_0xe759('0x95'),_0x404d83);}BPromise[_0xe759('0x96')]()[_0xe759('0x28')](function(){if(!_0x45e045){if(_0x4a7392[_0xe759('0x42')][_0xe759('0x97')])return;_0x5952b8[_0xe759('0x7b')](_0xe759('0x98'));_0x200a2c[_0xe759('0x7b')](_0xe759('0x98'));return;}if(_0x4a7392[_0xe759('0x99')][_0xe759('0x9a')]!==_0xe759('0x9b'))return;return _0x4a7392[_0xe759('0x99')][_0xe759('0x9c')]({'attributes':['id'],'raw':!![]})[_0xe759('0x28')](function(_0x9d4f7b){if(_[_0xe759('0x7a')](_0x9d4f7b)){_0x5952b8[_0xe759('0x7b')](_0xe759('0x9d'));_0x200a2c['where'](_0xe759('0x9d'));}else{_0x5952b8[_0xe759('0x7b')](_0xe759('0x9e'),_[_0xe759('0x40')](_0x9d4f7b,'id'));_0x200a2c[_0xe759('0x7b')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xe759('0x40')](_0x9d4f7b,'id'));}});})[_0xe759('0x28')](function(){if(_0x4a7392[_0xe759('0x99')][_0xe759('0x9a')]===_0xe759('0x9b')&&!_0x45e045&&!_0x4a7392['query']['OpenchannelAccountId'])return[];return db['sequelize'][_0xe759('0x42')](_0x5952b8[_0xe759('0x9f')](),_0x1da040);})[_0xe759('0x28')](function(_0x7c4cf7){_0x2708f4['count']=_0x7c4cf7[_0xe759('0x69')];if(_0x2708f4[_0xe759('0x22')]===0x0)return[];return db[_0xe759('0xa0')][_0xe759('0x42')](_0x2713cc[_0xe759('0x9f')](),_0x1da040)['then'](function(_0x271e0e){_0x49af77=_[_0xe759('0xa1')](_0x271e0e,'id');_0x1da040=_[_0xe759('0xa2')](_0x1da040,{'model':db[_0xe759('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a7392[_0xe759('0x42')]['fields']){_0x32b6b8[_0xe759('0x46')]['forEach'](function(_0x28f26d){_0x200a2c[_0xe759('0x4e')]('i.'+_0x28f26d);});}else{_0x200a2c['field'](_0xe759('0x93'),_0xe759('0x62'));_0x200a2c[_0xe759('0x4e')](_0xe759('0xa3'),_0xe759('0xa4'));_0x200a2c[_0xe759('0x4e')](_0xe759('0xa5'),'Account.mandatoryDisposition');_0x200a2c[_0xe759('0x4e')](_0xe759('0xa6'),_0xe759('0xa7'));_0x200a2c[_0xe759('0x4e')]('i.*');_0x200a2c[_0xe759('0x4e')](_0xe759('0xa8'),_0xe759('0xa9'));_0x200a2c[_0xe759('0x4e')](_0xe759('0xaa'),'Contact.lastName');_0x200a2c[_0xe759('0x4e')](_0xe759('0xab'),'Contact.email');_0x200a2c[_0xe759('0x4e')]('c.phone',_0xe759('0xac'));_0x200a2c['field'](_0xe759('0xad'),_0xe759('0xae'));_0x200a2c[_0xe759('0x4e')]('c.fax',_0xe759('0xaf'));_0x200a2c['field'](_0xe759('0xb0'),_0xe759('0xb1'));_0x200a2c[_0xe759('0x4e')]('o.internal',_0xe759('0xb2'));_0x200a2c[_0xe759('0x4e')](_0xe759('0xb3'),_0xe759('0x2e'));}if(_0x32b6b8[_0xe759('0x21')])_0x200a2c['limit'](_0x32b6b8[_0xe759('0x21')]);if(_0x32b6b8[_0xe759('0x23')])_0x200a2c[_0xe759('0x23')](_0x32b6b8[_0xe759('0x23')]);return db[_0xe759('0xa0')][_0xe759('0x42')](_0x200a2c[_0xe759('0x9f')](),_0x1da040);})[_0xe759('0x28')](function(_0x1a8a67){if(_0x1a8a67['length']>0x0)_0x2a6e9e[_0xe759('0x7b')](_0xe759('0xb4'),_[_0xe759('0x40')](_0x1a8a67,'id'));return db[_0xe759('0xa0')][_0xe759('0x42')](_0x2a6e9e['toString'](),_0x1da040)[_0xe759('0x28')](function(_0x25f116){var _0xb50e33=_[_0xe759('0xb5')](_0x25f116,_0xe759('0xb6'));var _0x20a67a=[];_0x1a8a67['forEach'](function(_0x63d9bd){_0x20a67a[_0xe759('0x32')](updateOpenchannelInteraction(_0x63d9bd,_0x49af77,_0xb50e33));});return BPromise[_0xe759('0xb7')](_0x20a67a);});});})[_0xe759('0x28')](function(_0x4ffd49){_0x2708f4[_0xe759('0xb8')]=_0x4ffd49;return _0x2708f4;})[_0xe759('0x28')](respondWithFilteredResult(_0x13e378,_0x32b6b8))['catch'](handleError(_0x13e378,null));};exports[_0xe759('0xb9')]=function(_0x245998,_0x1c7e3b){var _0x3102ca={};if(_0x245998[_0xe759('0x42')][_0xe759('0x6f')]&&_0x245998['query'][_0xe759('0x6f')]===_0xe759('0x50')){_0x3102ca[_0xe759('0x50')]=_0x245998[_0xe759('0xba')]['id'];}else{_0x3102ca['id']=_0x245998[_0xe759('0xba')]['id'];}var _0x1e042d={'raw':![],'where':_0x3102ca},_0x1d40af={};_0x1d40af['model']=_[_0xe759('0x77')](db[_0xe759('0x3c')][_0xe759('0x3d')]);_0x1d40af['query']=_[_0xe759('0x77')](_0x245998[_0xe759('0x42')]);_0x1d40af[_0xe759('0x43')]=_[_0xe759('0x44')](_0x1d40af[_0xe759('0x45')],_0x1d40af[_0xe759('0x42')]);_0x1e042d[_0xe759('0x46')]=_[_0xe759('0x44')](_0x1d40af[_0xe759('0x45')],qs[_0xe759('0x47')](_0x245998[_0xe759('0x42')][_0xe759('0x47')]));_0x1e042d[_0xe759('0x46')]=_0x1e042d['attributes'][_0xe759('0x69')]?_0x1e042d['attributes']:_0x1d40af[_0xe759('0x45')];if(_0x245998['query'][_0xe759('0xbb')]){_0x1e042d[_0xe759('0xbc')]=[{'all':!![]}];}_0x1e042d=_[_0xe759('0xa2')]({},_0x1e042d,_0x245998['options']);return db['OpenchannelInteraction'][_0xe759('0xbd')](_0x1e042d)['then'](handleEntityNotFound(_0x1c7e3b,null))['then'](respondWithResult(_0x1c7e3b,null))[_0xe759('0x33')](handleError(_0x1c7e3b,null));};exports['create']=function(_0x368b9d,_0x418dcc){return db[_0xe759('0x3c')][_0xe759('0xbe')](_0x368b9d['body'],{})[_0xe759('0x28')](respondWithResult(_0x418dcc,0xc9))['catch'](handleError(_0x418dcc,null));};exports['update']=function(_0x12cf4e,_0xa6e5b9){if(_0x12cf4e[_0xe759('0x76')]['id']){delete _0x12cf4e[_0xe759('0x76')]['id'];}return db[_0xe759('0x3c')][_0xe759('0xbd')]({'where':{'id':_0x12cf4e[_0xe759('0xba')]['id']}})['then'](handleEntityNotFound(_0xa6e5b9,null))[_0xe759('0x28')](saveUpdates(_0x12cf4e[_0xe759('0x76')],null))[_0xe759('0x28')](respondWithResult(_0xa6e5b9,null))['catch'](handleError(_0xa6e5b9,null));};exports[_0xe759('0x27')]=function(_0x21faba,_0x5d1a18){return db['OpenchannelInteraction']['find']({'where':{'id':_0x21faba['params']['id']}})[_0xe759('0x28')](handleEntityNotFound(_0x5d1a18,null))[_0xe759('0x28')](removeEntity(_0x5d1a18,null))[_0xe759('0x33')](handleError(_0x5d1a18,null));};exports[_0xe759('0xbf')]=function(_0xfa4440,_0x4f8cf4){return db[_0xe759('0x3c')][_0xe759('0xbf')]()[_0xe759('0x28')](respondWithResult(_0x4f8cf4,null))['catch'](handleError(_0x4f8cf4,null));};exports[_0xe759('0xc0')]=function(_0x33d374,_0x49f9f8,_0x26aeff){return db[_0xe759('0xc1')][_0xe759('0xbd')]({'where':{'id':_0x33d374[_0xe759('0xba')]['id']}})[_0xe759('0x28')](handleEntityNotFound(_0x49f9f8,null))[_0xe759('0x28')](function(_0x2c5d31){if(_0x2c5d31){return _0x2c5d31[_0xe759('0xc0')](_0x33d374[_0xe759('0x76')]['ids'],_['omit'](_0x33d374[_0xe759('0x76')],[_0xe759('0xc2'),'id'])||{});}})['then'](respondWithResult(_0x49f9f8,null))[_0xe759('0x33')](handleError(_0x49f9f8,null));};exports[_0xe759('0xc3')]=function(_0x328ea2,_0x129df4,_0xfa38bb){var _0x4d3cd0={'raw':![],'where':{}};var _0x2d715a={};var _0x936ec8={'count':0x0,'rows':[]};return db[_0xe759('0x3c')]['findOne']({'where':{'id':_0x328ea2[_0xe759('0xba')]['id']}})[_0xe759('0x28')](handleEntityNotFound(_0x129df4,null))[_0xe759('0x28')](function(_0x5efd0e){if(_0x5efd0e){_0x2d715a[_0xe759('0x45')]=_['keys'](db[_0xe759('0xc1')]['rawAttributes']);_0x2d715a[_0xe759('0x42')]=_[_0xe759('0x77')](_0x328ea2[_0xe759('0x42')]);_0x2d715a[_0xe759('0x43')]=_[_0xe759('0x44')](_0x2d715a['model'],_0x2d715a[_0xe759('0x42')]);_0x4d3cd0[_0xe759('0x46')]=_[_0xe759('0x44')](_0x2d715a['model'],qs[_0xe759('0x47')](_0x328ea2[_0xe759('0x42')][_0xe759('0x47')]));_0x4d3cd0[_0xe759('0x46')]=_0x4d3cd0[_0xe759('0x46')]['length']?_0x4d3cd0[_0xe759('0x46')]:_0x2d715a['model'];if(!_0x328ea2[_0xe759('0x42')][_0xe759('0x48')]('nolimit')){_0x4d3cd0['limit']=qs['limit'](_0x328ea2['query']['limit']);_0x4d3cd0[_0xe759('0x23')]=qs[_0xe759('0x23')](_0x328ea2['query'][_0xe759('0x23')]);}_0x4d3cd0[_0xe759('0x4a')]=qs['sort'](_0x328ea2['query'][_0xe759('0x4b')]);_0x4d3cd0[_0xe759('0x7b')]=qs[_0xe759('0x43')](_[_0xe759('0x4c')](_0x328ea2['query'],_0x2d715a[_0xe759('0x43')]));_0x4d3cd0[_0xe759('0x7b')][_0xe759('0xb6')]=_0x5efd0e['id'];if(_0x328ea2[_0xe759('0x42')][_0xe759('0x89')]){_0x4d3cd0[_0xe759('0x7b')]=_[_0xe759('0xa2')](_0x4d3cd0[_0xe759('0x7b')],{'$or':_[_0xe759('0x40')](_0x4d3cd0[_0xe759('0x46')],function(_0x30fcf4){var _0x4672dd={};_0x4672dd[_0x30fcf4]={'$like':'%'+_0x328ea2[_0xe759('0x42')]['filter']+'%'};return _0x4672dd;})});}if(_0x328ea2[_0xe759('0x42')][_0xe759('0x7f')]){var _0x51bd27=_0x328ea2['query']['$gte'][_0xe759('0x30')](',');var _0x40a368={};_0x40a368[_0x51bd27[0x0]]={'$gte':moment(_0x51bd27[0x1])[_0xe759('0xc4')](_0xe759('0xc5'))};_0x4d3cd0[_0xe759('0x7b')]=_[_0xe759('0xa2')](_0x4d3cd0[_0xe759('0x7b')],_0x40a368);}_0x4d3cd0=_['merge']({},_0x4d3cd0,_0x328ea2[_0xe759('0xc6')]);return db[_0xe759('0xc1')]['count']({'where':_0x4d3cd0[_0xe759('0x7b')]})['then'](function(_0x201566){_0x936ec8['count']=_0x201566;if(_0x328ea2[_0xe759('0x42')][_0xe759('0xbb')]){_0x4d3cd0[_0xe759('0xbc')]=[{'all':!![]}];}return db[_0xe759('0xc1')][_0xe759('0xc7')](_0x4d3cd0);})[_0xe759('0x28')](function(_0x364236){_0x936ec8['rows']=_0x364236;return _0x936ec8;});}})[_0xe759('0x28')](respondWithFilteredResult(_0x129df4,_0x4d3cd0))[_0xe759('0x33')](handleError(_0x129df4,null));};exports['addTags']=function(_0x4151ab,_0x12317d,_0x3cfde3){return db[_0xe759('0x3c')]['find']({'where':{'id':_0x4151ab[_0xe759('0xba')]['id']}})[_0xe759('0x28')](handleEntityNotFound(_0x12317d,null))[_0xe759('0x28')](function(_0x4c38cd){if(_0x4c38cd){return _0x4c38cd[_0xe759('0xc8')](_0x4151ab[_0xe759('0x76')][_0xe759('0xc2')],_['omit'](_0x4151ab[_0xe759('0x76')],[_0xe759('0xc2'),'id'])||{})['spread'](function(){return db[_0xe759('0x72')][_0xe759('0xc7')]({'attributes':['id',_0xe759('0x41'),'color'],'where':{'id':_0x4151ab[_0xe759('0x76')]['ids']}});})[_0xe759('0x28')](function(_0x1d4c7e){socket[_0xe759('0xc9')](_0xe759('0xca'),{'id':Number(_0x4151ab['params']['id']),'tags':_0x1d4c7e||[]});return{'id':Number(_0x4151ab[_0xe759('0xba')]['id']),'tags':_0x1d4c7e||[]};});}})[_0xe759('0x28')](respondWithResult(_0x12317d,null))['catch'](handleError(_0x12317d,null));};exports[_0xe759('0xcb')]=function(_0x3051f7,_0xf1732c,_0x19db0f){return db[_0xe759('0x3c')]['find']({'where':{'id':_0x3051f7[_0xe759('0xba')]['id']}})[_0xe759('0x28')](handleEntityNotFound(_0xf1732c,null))[_0xe759('0x28')](function(_0x12fb46){if(_0x12fb46){return _0x12fb46[_0xe759('0xcb')](_0x3051f7['query'][_0xe759('0xc2')]);}})[_0xe759('0x28')](respondWithStatusCode(_0xf1732c,null))['catch'](handleError(_0xf1732c,null));};exports[_0xe759('0xcc')]=function(_0x5379a7,_0x273049){var _0x12af6e=moment()['unix']()[_0xe759('0x9f')]();var _0x365d37=path[_0xe759('0xcd')](config['root'],_0xe759('0xce'),_0xe759('0xcf'),_0xe759('0xd0'));var _0x3dd927=path[_0xe759('0xcd')](config[_0xe759('0xd1')],_0xe759('0xce'),'files','attachments');var _0x1e0c5d=path[_0xe759('0xcd')](_0x365d37,_0x12af6e);var _0x5792f0=util[_0xe759('0xc4')](_0xe759('0xd2'),_0x5379a7[_0xe759('0xba')]['id'],_0x12af6e);var _0x575d3f=path['join'](_0x365d37,_0x5792f0);var _0x1d53ca=[];_0x1d53ca[_0xe759('0x32')]({'model':db['User'],'as':_0xe759('0x74'),'attributes':['id','fullname'],'raw':!![]});_0x1d53ca['push']({'model':db[_0xe759('0xd3')],'as':_0xe759('0x66'),'attributes':['id',_0xe759('0xd4'),_0xe759('0xd5')],'raw':!![]});if(_0x5379a7['query'][_0xe759('0xd6')]){_0x1d53ca[_0xe759('0x32')]({'model':db[_0xe759('0xd7')],'as':_0xe759('0xd7'),'raw':!![]});}var _0x3c8ba2=[{'model':db[_0xe759('0xc1')],'as':_0xe759('0xd8'),'attributes':['id',_0xe759('0x76'),'createdAt','direction','secret','read'],'include':_0x1d53ca}];_0x3c8ba2[_0xe759('0x32')]({'model':db[_0xe759('0xd9')],'as':'Account','attributes':['id',_0xe759('0x41')]});_0x3c8ba2[_0xe759('0x32')]({'model':db[_0xe759('0x74')],'as':_0xe759('0xda'),'attributes':['id',_0xe759('0x2d')]});return db['OpenchannelInteraction'][_0xe759('0xbd')]({'where':{'id':_0x5379a7[_0xe759('0xba')]['id']},'include':_0x3c8ba2})[_0xe759('0x28')](handleEntityNotFound(_0x273049,null))['then'](function(_0x33aa1d){if(_0x33aa1d){var _0x16e57f=_0x33aa1d[_0xe759('0xdb')]({'plain':!![]});fs[_0xe759('0xdc')](_0x1e0c5d);var _0xb18e7a={'channel':'Openchannel','account':_0x16e57f[_0xe759('0xdd')][_0xe759('0x41')],'agent':_0x16e57f[_0xe759('0xda')]?_0x16e57f[_0xe759('0xda')][_0xe759('0x2d')]:_0xe759('0xde'),'createdAt':moment(_0x16e57f[_0xe759('0x7d')])['format'](_0xe759('0xc5'))['toString'](),'closedAt':_0x16e57f[_0xe759('0x39')]?moment(_0x16e57f[_0xe759('0xdf')])['format'](_0xe759('0xc5'))[_0xe759('0x9f')]():'','disposition':_0x16e57f[_0xe759('0xe0')],'visibility':_0x16e57f[_0xe759('0xe1')]?'Public':_0xe759('0xe2'),'messages':_(_0x16e57f['Messages'])[_0xe759('0x89')]({'secret':![]})[_0xe759('0x40')](function(_0x263631){if(_0x263631[_0xe759('0xd7')]){var _0xd61327=path[_0xe759('0xcd')](_0x3dd927,_0x263631['Attachment'][_0xe759('0xe3')]);if(fs[_0xe759('0xe4')](_0xd61327)){fs[_0xe759('0xe5')](_0xd61327)['pipe'](fs[_0xe759('0xe6')](path[_0xe759('0xcd')](_0x1e0c5d,_0x263631[_0xe759('0xd7')][_0xe759('0xe3')])));}}return{'date':moment(_0x263631[_0xe759('0x7d')])[_0xe759('0xc4')](_0xe759('0xc5'))[_0xe759('0x9f')](),'sender':_0x263631[_0xe759('0xe7')]===_0xe759('0xe8')?_0x263631[_0xe759('0x74')]?_0x263631['User'][_0xe759('0x2d')]:'System':_0x263631[_0xe759('0x66')]['firstName']+(_0x263631[_0xe759('0x66')]['lastName']?'\x20'+_0x263631[_0xe759('0x66')][_0xe759('0xd5')]:''),'body':_0x263631[_0xe759('0xd7')]?_0x263631[_0xe759('0xd7')]['basename']:_0x263631['body'],'direction':_0x263631[_0xe759('0xe7')]===_0xe759('0xe8')?'A':'C','secret':_0x263631[_0xe759('0xe9')],'read':_0x263631[_0xe759('0x85')],'attachment':_0x263631[_0xe759('0xd7')]};})[_0xe759('0x63')]()};return ejs[_0xe759('0xea')](path[_0xe759('0xcd')](config[_0xe759('0xd1')],_0xe759('0xce'),_0xe759('0xeb'),'downloadInteraction.ejs'),{'interaction':_0xb18e7a})[_0xe759('0x28')](function(_0x5a4af9){var _0x218d5e=path[_0xe759('0xcd')](_0x1e0c5d,_0xe759('0xec')+_0x16e57f['id']+'-'+_0x12af6e+_0xe759('0xed'));var _0x38607d={'path':_0x218d5e,'channel':_0xe759('0xee'),'interactionId':_0x16e57f['id']};return pdf[_0xe759('0xef')](_0x5a4af9,_0x38607d);})[_0xe759('0x28')](function(){return new BPromise(function(_0x4b475e,_0x20d6a9){zipdir(_0x1e0c5d,{'saveTo':_0x575d3f},function(_0x928bc0,_0x48b3f7){if(_0x928bc0)return _0x20d6a9(_0x928bc0);return _0x4b475e(_0x48b3f7);});})['then'](function(){return new BPromise(function(_0x383674,_0x27d39b){rimraf(_0x1e0c5d,function(_0x47cb86){if(_0x47cb86)_0x27d39b(_0x47cb86);return _0x383674();});});})['then'](function(){return _0x273049[_0xe759('0xcc')](_0x575d3f,_0x5792f0,function(_0x365052){if(_0x365052){console['log'](_0xe759('0xf0'),_0x365052);}else{fs[_0xe759('0xf1')](_0x575d3f);}});});});}else{return _0x273049['sendStatus'](0xc8);}})['catch'](handleError(_0x273049,null));};
\ No newline at end of file
+var _0x2c40=['destroy','status','sendStatus','error','name','send','Users','map','split','push','TagIds','then','catch','unmanaged','total','closed','UserId','waiting','talking','index','OpenchannelInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','select','field','color','from','tools_tags','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','start','body','some','compact','forEach','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','all','show','params','includeAll','include','merge','options','create','describe','addMessage','OpenchannelMessage','ids','findOne','hasOwnProperty','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','join','root','server','files','fullname','firstName','Attachment','Messages','direction','Owner','get','mkdirSync','Openchannel','Account','disposition','threadId','Public','Private','existsSync','pipe','createWriteStream','basename','out','System','lastName','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','register','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x58282a,_0x1f41d4){var _0x95d072=function(_0x36d540){while(--_0x36d540){_0x58282a['push'](_0x58282a['shift']());}};_0x95d072(++_0x1f41d4);}(_0x2c40,0xc5));var _0x02c4=function(_0x26b2b8,_0x1ba7d3){_0x26b2b8=_0x26b2b8-0x0;var _0x20bf78=_0x2c40[_0x26b2b8];return _0x20bf78;};'use strict';var emlformat=require(_0x02c4('0x0'));var rimraf=require(_0x02c4('0x1'));var zipdir=require(_0x02c4('0x2'));var jsonpatch=require(_0x02c4('0x3'));var rp=require(_0x02c4('0x4'));var moment=require(_0x02c4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x02c4('0x6'));var sox=require(_0x02c4('0x7'));var csv=require(_0x02c4('0x8'));var ejs=require(_0x02c4('0x9'));var fs=require('fs');var fs_extra=require(_0x02c4('0xa'));var _=require(_0x02c4('0xb'));var squel=require(_0x02c4('0xc'));var crypto=require(_0x02c4('0xd'));var jsforce=require(_0x02c4('0xe'));var deskjs=require(_0x02c4('0xf'));var toCsv=require(_0x02c4('0x8'));var querystring=require('querystring');var Papa=require(_0x02c4('0x10'));var Redis=require(_0x02c4('0x11'));var authService=require(_0x02c4('0x12'));var qs=require(_0x02c4('0x13'));var as=require(_0x02c4('0x14'));var pdf=require(_0x02c4('0x15'));var hardwareService=require(_0x02c4('0x16'));var logger=require(_0x02c4('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x02c4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x02c4('0x19'))['db'];config[_0x02c4('0x1a')]=_['defaults'](config[_0x02c4('0x1a')],{'host':_0x02c4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02c4('0x1a')]));require('./openchannelInteraction.socket')[_0x02c4('0x1c')](socket);function respondWithStatusCode(_0x9ee1b2,_0x657a60){_0x657a60=_0x657a60||0xcc;return function(_0x251b4e){if(_0x251b4e){return _0x9ee1b2['sendStatus'](_0x657a60);}return _0x9ee1b2['status'](_0x657a60)[_0x02c4('0x1d')]();};}function respondWithResult(_0x2ca4e3,_0x4164ad){_0x4164ad=_0x4164ad||0xc8;return function(_0x563580){if(_0x563580){return _0x2ca4e3['status'](_0x4164ad)[_0x02c4('0x1e')](_0x563580);}};}function respondWithFilteredResult(_0x52f6af,_0x1aff16){return function(_0xa4436f){if(_0xa4436f){var _0x2345c9=typeof _0x1aff16[_0x02c4('0x1f')]===_0x02c4('0x20')&&typeof _0x1aff16[_0x02c4('0x21')]==='undefined';var _0x2df4e6=_0xa4436f[_0x02c4('0x22')];var _0x4e7b27=_0x2345c9?0x0:_0x1aff16['offset'];var _0x3bc715=_0x2345c9?_0xa4436f[_0x02c4('0x22')]:_0x1aff16[_0x02c4('0x1f')]+_0x1aff16[_0x02c4('0x21')];var _0x2b54d1;if(_0x3bc715>=_0x2df4e6){_0x3bc715=_0x2df4e6;_0x2b54d1=0xc8;}else{_0x2b54d1=0xce;}_0x52f6af['status'](_0x2b54d1);return _0x52f6af[_0x02c4('0x23')](_0x02c4('0x24'),_0x4e7b27+'-'+_0x3bc715+'/'+_0x2df4e6)['json'](_0xa4436f);}return null;};}function patchUpdates(_0x4768b8){return function(_0x517649){try{jsonpatch[_0x02c4('0x25')](_0x517649,_0x4768b8,!![]);}catch(_0x3c8953){return BPromise['reject'](_0x3c8953);}return _0x517649[_0x02c4('0x26')]();};}function saveUpdates(_0x48516e,_0x48f1a1){return function(_0xbfaae9){if(_0xbfaae9){return _0xbfaae9[_0x02c4('0x27')](_0x48516e)['then'](function(_0x31b211){return _0x31b211;});}return null;};}function removeEntity(_0x36fda1,_0x5cb169){return function(_0x480fad){if(_0x480fad){return _0x480fad[_0x02c4('0x28')]()['then'](function(){_0x36fda1[_0x02c4('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c4583,_0x25d0fe){return function(_0x19cfd0){if(!_0x19cfd0){_0x2c4583[_0x02c4('0x2a')](0x194);}return _0x19cfd0;};}function handleError(_0x4c9bee,_0x567690){_0x567690=_0x567690||0x1f4;return function(_0x146de7){logger[_0x02c4('0x2b')](_0x146de7['stack']);if(_0x146de7[_0x02c4('0x2c')]){delete _0x146de7[_0x02c4('0x2c')];}_0x4c9bee[_0x02c4('0x29')](_0x567690)[_0x02c4('0x2d')](_0x146de7);};}function getInteractionUsers(_0x3b3e4a,_0x14ee2a){return new BPromise(function(_0x433ed9,_0x437158){try{if(_0x14ee2a[_0x3b3e4a['id']]){_0x3b3e4a[_0x02c4('0x2e')]=_[_0x02c4('0x2f')](_0x14ee2a[_0x3b3e4a['id']],function(_0x3a38d3){return{'id':_0x3a38d3['id'],'fullname':_0x3a38d3['fullname']};});}}catch(_0x2ca1a9){_0x437158(_0x2ca1a9);}_0x433ed9(_0x3b3e4a);});}function getInteractionTags(_0x3f3558,_0x33dee1){return new BPromise(function(_0x39b721,_0x53931a){try{if(_0x3f3558['TagIds']){_0x3f3558['Tags']=[];_0x3f3558['TagIds'][_0x02c4('0x30')](',')['forEach'](function(_0x5e7cf2){_0x3f3558['Tags'][_0x02c4('0x31')](_0x33dee1[_0x5e7cf2]);});}delete _0x3f3558[_0x02c4('0x32')];}catch(_0x17d4c2){_0x53931a(_0x17d4c2);}_0x39b721(_0x3f3558);});}function updateOpenchannelInteraction(_0x35a2a3,_0x19e59e,_0x36fab1){return new BPromise(function(_0x575af2,_0x28c54a){return getInteractionUsers(_0x35a2a3,_0x36fab1)[_0x02c4('0x33')](function(_0x123664){return getInteractionTags(_0x123664,_0x19e59e);})[_0x02c4('0x33')](function(_0x10d89c){return getStateInteraction(_0x10d89c);})[_0x02c4('0x33')](function(_0x34b92a){_0x575af2(_0x34b92a);})[_0x02c4('0x34')](function(_0x435a51){_0x28c54a(_0x435a51);});});}function getStateInteraction(_0x42a6e1){return new BPromise(function(_0x2b0853){_0x42a6e1['waiting']=0x0;_0x42a6e1['talking']=0x0;_0x42a6e1['answered']=0x0;_0x42a6e1[_0x02c4('0x35')]=0x0;_0x42a6e1[_0x02c4('0x36')]=0x0;if(!_0x42a6e1[_0x02c4('0x37')]&&!_0x42a6e1[_0x02c4('0x38')]){_0x42a6e1[_0x02c4('0x39')]+=0x1;}if(!_0x42a6e1['closed']&&_0x42a6e1[_0x02c4('0x38')]){_0x42a6e1[_0x02c4('0x3a')]+=0x1;if(_0x42a6e1[_0x02c4('0x39')]){_0x42a6e1[_0x02c4('0x39')]-=0x1;}}if(_0x42a6e1['closed']&&_0x42a6e1['UserId']){_0x42a6e1['answered']+=0x1;if(_0x42a6e1[_0x02c4('0x3a')]){_0x42a6e1[_0x02c4('0x3a')]-=0x1;}}if(_0x42a6e1[_0x02c4('0x37')]&&!_0x42a6e1[_0x02c4('0x38')]){_0x42a6e1[_0x02c4('0x35')]+=0x1;if(_0x42a6e1['waiting']){_0x42a6e1[_0x02c4('0x39')]-=0x1;}}_0x42a6e1[_0x02c4('0x36')]+=0x1;_0x2b0853(_0x42a6e1);});}exports[_0x02c4('0x3b')]=function(_0x185246,_0x1a0084){var _0x2595de={},_0x2d2be6={},_0x1da627={'count':0x0,'rows':[]};var _0x35414f=_['map'](db[_0x02c4('0x3c')][_0x02c4('0x3d')],function(_0x30ccad){return{'name':_0x30ccad['fieldName'],'type':_0x30ccad[_0x02c4('0x3e')][_0x02c4('0x3f')]};});_0x2d2be6[_0x02c4('0x40')]=_['map'](_0x35414f,_0x02c4('0x2c'));_0x2d2be6[_0x02c4('0x41')]=_[_0x02c4('0x42')](_0x185246[_0x02c4('0x41')]);_0x2d2be6['filters']=_[_0x02c4('0x43')](_0x2d2be6[_0x02c4('0x40')],_0x2d2be6[_0x02c4('0x41')]);_0x2595de[_0x02c4('0x44')]=_[_0x02c4('0x43')](_0x2d2be6[_0x02c4('0x40')],qs[_0x02c4('0x45')](_0x185246[_0x02c4('0x41')][_0x02c4('0x45')]));_0x2595de[_0x02c4('0x44')]=_0x2595de['attributes'][_0x02c4('0x46')]?_0x2595de[_0x02c4('0x44')]:_0x2d2be6[_0x02c4('0x40')];if(!_0x185246['query']['hasOwnProperty']('nolimit')){_0x2595de[_0x02c4('0x21')]=qs['limit'](_0x185246[_0x02c4('0x41')][_0x02c4('0x21')]);_0x2595de['offset']=qs[_0x02c4('0x1f')](_0x185246['query'][_0x02c4('0x1f')]);}_0x2595de[_0x02c4('0x47')]=qs[_0x02c4('0x48')](_0x185246[_0x02c4('0x41')][_0x02c4('0x48')]);_0x2595de[_0x02c4('0x49')]=qs[_0x02c4('0x4a')](_[_0x02c4('0x4b')](_0x185246[_0x02c4('0x41')],_0x2d2be6[_0x02c4('0x4a')]),_0x35414f);var _0x593295=[];var _0x3bc953=squel[_0x02c4('0x4c')]()[_0x02c4('0x4d')]('id')[_0x02c4('0x4d')](_0x02c4('0x2c'))['field'](_0x02c4('0x4e'))[_0x02c4('0x4f')](_0x02c4('0x50'));var _0x3821cb=squel[_0x02c4('0x4c')]()['field']('u.id')[_0x02c4('0x4d')]('u.fullname')[_0x02c4('0x4d')]('ui.OpenchannelInteractionId')[_0x02c4('0x4f')](_0x02c4('0x51'),'ui')[_0x02c4('0x52')](_0x02c4('0x53'),'u',_0x02c4('0x54'));var _0x32158f=squel[_0x02c4('0x4c')]()[_0x02c4('0x4f')]('openchannel_interactions','i')[_0x02c4('0x52')](_0x02c4('0x55'),'c',_0x02c4('0x56'))[_0x02c4('0x52')](_0x02c4('0x53'),'o',_0x02c4('0x57'))['left_join'](_0x02c4('0x58'),'a',_0x02c4('0x59'))[_0x02c4('0x52')](_0x02c4('0x5a'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x02c4('0x52')](_0x02c4('0x5b'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x02c4('0x52')](_0x02c4('0x50'),'t',_0x02c4('0x5c'));var _0x513f0d=squel[_0x02c4('0x5d')]();var _0x213d7a=[];var _0x5cfc6c=squel[_0x02c4('0x5d')]();var _0x943b88;if(_0x185246['query']['search']){_0x943b88=as[_0x02c4('0x5e')](_0x185246[_0x02c4('0x41')][_0x02c4('0x5f')]);var _0x2cc92e=_0x943b88[_0x02c4('0x60')];for(var _0x147c5a=0x0;_0x147c5a<_0x943b88[_0x02c4('0x61')][_0x02c4('0x46')];_0x147c5a++){var _0x5ec53a=_0x943b88[_0x02c4('0x61')][_0x147c5a];var _0xe4d98='i';var _0x2c48df=_['find'](_0x35414f,['name',_0x5ec53a[_0x02c4('0x4d')]]);if(!_0x2c48df){switch(_0x5ec53a[_0x02c4('0x4d')]){case'unreadMessages':if(_0x5ec53a[_0x02c4('0x62')]==0x1){_0x32158f[_0x02c4('0x63')]('`'+_0x5ec53a['field']+_0x02c4('0x64'));}else{_0x32158f['having']('`'+_0x5ec53a[_0x02c4('0x4d')]+_0x02c4('0x65'));}break;case _0x02c4('0x66'):if(_0x5ec53a[_0x02c4('0x67')]==='$substring'){if(_0x5ec53a[_0x02c4('0x62')]['split']('\x20')[_0x02c4('0x46')]>0x1){_0x513f0d[_0x2cc92e](_0x02c4('0x68'),qs[_0x02c4('0x69')](_0x5ec53a[_0x02c4('0x62')]),null);}else{var _0x42caf9='%'+_0x5ec53a[_0x02c4('0x62')]+'%';_0x513f0d[_0x2cc92e](_0x02c4('0x6a'),_0x42caf9,_0x42caf9,_0x42caf9);}}else{_0x2c48df=_['find'](_0x35414f,[_0x02c4('0x2c'),'ContactId']);_0x5ec53a[_0x02c4('0x4d')]=_0x02c4('0x6b');_0x2e9162=as[_0x02c4('0x6c')](_0xe4d98,_0x2c48df[_0x02c4('0x3e')],_0x5ec53a);_0x513f0d[_0x2cc92e](_0x2e9162[_0x02c4('0x6d')],_0x2e9162[_0x02c4('0x62')]['start'],_0x2e9162['value'][_0x02c4('0x1d')]);}break;case _0x02c4('0x6e'):var _0x314f24=_0x5ec53a[_0x02c4('0x62')][_0x02c4('0x30')](',')[_0x02c4('0x2f')](function(_0x1907ae){return Number(_0x1907ae);});_0x314f24['forEach'](function(_0x5d4e90){_0x5cfc6c['or'](_0x02c4('0x6f'),'%,'+_0x5d4e90+',%');});_0x213d7a=_['union'](_0x213d7a,_0x314f24);break;case _0x02c4('0x70'):if(_0x5ec53a[_0x02c4('0x67')]===_0x02c4('0x71')){_0x513f0d[_0x2cc92e](_0x02c4('0x72'),'%'+_0x5ec53a['value']+'%',null);}else{_0x2c48df=_[_0x02c4('0x73')](_0x35414f,[_0x02c4('0x2c'),'UserId']);_0x5ec53a[_0x02c4('0x4d')]=_0x02c4('0x38');_0x2e9162=as[_0x02c4('0x6c')](_0xe4d98,_0x2c48df[_0x02c4('0x3e')],_0x5ec53a);_0x513f0d[_0x2cc92e](_0x2e9162[_0x02c4('0x6d')],_0x2e9162[_0x02c4('0x62')][_0x02c4('0x74')],_0x2e9162[_0x02c4('0x62')][_0x02c4('0x1d')]);}break;case _0x02c4('0x75'):_0x2e9162=as[_0x02c4('0x6c')]('me',null,_0x5ec53a);_0x513f0d[_0x2cc92e](_0x2e9162[_0x02c4('0x6d')],_0x2e9162[_0x02c4('0x62')][_0x02c4('0x74')],_0x2e9162['value'][_0x02c4('0x1d')]);break;}}else{var _0x2e9162=as[_0x02c4('0x6c')](_0xe4d98,_0x2c48df[_0x02c4('0x3e')],_0x5ec53a);_0x513f0d[_0x2cc92e](_0x2e9162[_0x02c4('0x6d')],_0x2e9162['value']['start'],_0x2e9162[_0x02c4('0x62')][_0x02c4('0x1d')]);}}}else{var _0x3e9aba=_(_0x185246['query'])[_0x02c4('0x42')]()[_0x02c4('0x2f')](function(_0x5a95f7){return _[_0x02c4('0x76')](_0x35414f,[_0x02c4('0x2c'),_0x5a95f7])?_0x5a95f7:undefined;})[_0x02c4('0x77')]()[_0x02c4('0x62')]();if(!_['isEmpty'](_0x3e9aba)){_0x3e9aba[_0x02c4('0x78')](function(_0x3b2681){if(_0x3b2681==='OpenchannelAccountId'){_0x32158f[_0x02c4('0x49')](_0x02c4('0x79'),[][_0x02c4('0x7a')](_0x185246[_0x02c4('0x41')][_0x3b2681]));}else if(_0x3b2681===_0x02c4('0x7b')){var _0x56829c=JSON['parse'](_0x185246['query'][_0x3b2681])[_0x02c4('0x7c')];var _0x4b0f5a=JSON[_0x02c4('0x7d')](_0x185246[_0x02c4('0x41')][_0x3b2681])[_0x02c4('0x7e')];_0x32158f[_0x02c4('0x49')](_0x02c4('0x7f'),_0x56829c,_0x4b0f5a);}else{if(_0x185246['query'][_0x3b2681]===_0x02c4('0x80')){_0x32158f[_0x02c4('0x49')]('i.'+_0x3b2681+_0x02c4('0x81'));}else{_0x32158f[_0x02c4('0x49')]('i.'+_0x3b2681+_0x02c4('0x82'),_0x185246[_0x02c4('0x41')][_0x3b2681]);}}});}if(_0x185246[_0x02c4('0x41')][_0x02c4('0x83')]){if(_0x185246[_0x02c4('0x41')][_0x02c4('0x83')]==0x1){_0x32158f[_0x02c4('0x63')](_0x02c4('0x84'));}else{_0x32158f[_0x02c4('0x63')](_0x02c4('0x85'));}}if(_0x185246['query'][_0x02c4('0x86')]){_0x213d7a=_[_0x02c4('0x87')](_0x185246[_0x02c4('0x41')][_0x02c4('0x86')])?_0x185246[_0x02c4('0x41')]['tag']:new Array(_0x185246[_0x02c4('0x41')][_0x02c4('0x86')]);_0x213d7a['forEach'](function(_0x55d390){_0x5cfc6c['or'](_0x02c4('0x6f'),'%,'+_0x55d390+',%');});}if(_0x185246[_0x02c4('0x41')][_0x02c4('0x88')]){var _0x5bf115=_0x185246['query'][_0x02c4('0x88')][_0x02c4('0x89')]('\x5c','\x5c\x5c')[_0x02c4('0x89')](/'/g,'\x27\x27');if(qs[_0x02c4('0x8a')](_0x5bf115)){_0x513f0d['or'](_0x02c4('0x8b'),_0x5bf115+'%');}else{_0x513f0d['or'](_0x02c4('0x8c'),qs[_0x02c4('0x69')](_0x5bf115))['or'](_0x02c4('0x8d'),_0x5bf115+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5bf115+'%');}}}_0x32158f[_0x02c4('0x49')](_0x513f0d);_0x32158f['group'](_0x02c4('0x8e'));var _0x42b0d0={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x48fcc4=_0x32158f['clone']();_0x48fcc4['field'](_0x02c4('0x8e'));_0x48fcc4[_0x02c4('0x4d')](_0x02c4('0x8f'),_0x02c4('0x90'));if(_0x2595de[_0x02c4('0x47')]){_0x2595de[_0x02c4('0x47')][_0x02c4('0x78')](function(_0x4938cb){var _0x3a378b=_0x4938cb[0x0]==='contactName'?_0x4938cb[0x0]:'i.'+_0x4938cb[0x0];_0x32158f[_0x02c4('0x47')](_0x3a378b,_0x4938cb[0x1]===_0x02c4('0x91')?![]:!![]);});}if(!_[_0x02c4('0x92')](_0x213d7a)){_0x32158f[_0x02c4('0x63')](_0x5cfc6c);_0x48fcc4[_0x02c4('0x49')]('t.id\x20IN\x20?',_0x213d7a);}BPromise[_0x02c4('0x93')]()[_0x02c4('0x33')](function(){if(!_0x943b88){if(_0x185246[_0x02c4('0x41')][_0x02c4('0x94')])return;_0x48fcc4[_0x02c4('0x49')](_0x02c4('0x95'));_0x32158f['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x185246[_0x02c4('0x96')][_0x02c4('0x97')]!==_0x02c4('0x98'))return;return _0x185246[_0x02c4('0x96')][_0x02c4('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x51db2c){if(_[_0x02c4('0x92')](_0x51db2c)){_0x48fcc4[_0x02c4('0x49')](_0x02c4('0x9a'));_0x32158f[_0x02c4('0x49')](_0x02c4('0x9a'));}else{_0x48fcc4[_0x02c4('0x49')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x51db2c,'id'));_0x32158f['where'](_0x02c4('0x79'),_[_0x02c4('0x2f')](_0x51db2c,'id'));}});})[_0x02c4('0x33')](function(){if(_0x185246[_0x02c4('0x96')][_0x02c4('0x97')]===_0x02c4('0x98')&&!_0x943b88&&!_0x185246[_0x02c4('0x41')][_0x02c4('0x94')])return[];return db[_0x02c4('0x9b')][_0x02c4('0x41')](_0x48fcc4[_0x02c4('0x9c')](),_0x42b0d0);})[_0x02c4('0x33')](function(_0x1c2d37){_0x1da627['count']=_0x1c2d37['length'];if(_0x1da627[_0x02c4('0x22')]===0x0)return[];return db[_0x02c4('0x9b')][_0x02c4('0x41')](_0x3bc953[_0x02c4('0x9c')](),_0x42b0d0)[_0x02c4('0x33')](function(_0x37c1e7){_0x593295=_[_0x02c4('0x9d')](_0x37c1e7,'id');_0x42b0d0=_['merge'](_0x42b0d0,{'model':db[_0x02c4('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x185246[_0x02c4('0x41')]['fields']){_0x2595de[_0x02c4('0x44')]['forEach'](function(_0x2bec97){_0x32158f[_0x02c4('0x4d')]('i.'+_0x2bec97);});}else{_0x32158f[_0x02c4('0x4d')](_0x02c4('0x8f'),'unreadMessages');_0x32158f[_0x02c4('0x4d')]('a.key',_0x02c4('0x9e'));_0x32158f[_0x02c4('0x4d')](_0x02c4('0x9f'),_0x02c4('0xa0'));_0x32158f[_0x02c4('0x4d')]('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',_0x02c4('0xa1'));_0x32158f[_0x02c4('0x4d')]('i.*');_0x32158f[_0x02c4('0x4d')]('c.firstName',_0x02c4('0xa2'));_0x32158f[_0x02c4('0x4d')](_0x02c4('0xa3'),_0x02c4('0xa4'));_0x32158f[_0x02c4('0x4d')](_0x02c4('0xa5'),_0x02c4('0xa6'));_0x32158f['field'](_0x02c4('0xa7'),_0x02c4('0xa8'));_0x32158f['field'](_0x02c4('0xa9'),_0x02c4('0xaa'));_0x32158f[_0x02c4('0x4d')](_0x02c4('0xab'),_0x02c4('0xac'));_0x32158f[_0x02c4('0x4d')]('o.fullname',_0x02c4('0xad'));_0x32158f[_0x02c4('0x4d')]('o.internal',_0x02c4('0xae'));_0x32158f['field'](_0x02c4('0xaf'),'TagIds');}if(_0x2595de[_0x02c4('0x21')])_0x32158f['limit'](_0x2595de['limit']);if(_0x2595de['offset'])_0x32158f[_0x02c4('0x1f')](_0x2595de[_0x02c4('0x1f')]);return db['sequelize']['query'](_0x32158f[_0x02c4('0x9c')](),_0x42b0d0);})[_0x02c4('0x33')](function(_0x453bec){if(_0x453bec[_0x02c4('0x46')]>0x0)_0x3821cb[_0x02c4('0x49')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x453bec,'id'));return db[_0x02c4('0x9b')][_0x02c4('0x41')](_0x3821cb['toString'](),_0x42b0d0)['then'](function(_0x42453a){var _0x1cdd62=_['groupBy'](_0x42453a,'OpenchannelInteractionId');var _0x294e9c=[];_0x453bec[_0x02c4('0x78')](function(_0x489dcc){_0x294e9c[_0x02c4('0x31')](updateOpenchannelInteraction(_0x489dcc,_0x593295,_0x1cdd62));});return BPromise[_0x02c4('0xb0')](_0x294e9c);});});})['then'](function(_0x4e748b){_0x1da627['rows']=_0x4e748b;return _0x1da627;})[_0x02c4('0x33')](respondWithFilteredResult(_0x1a0084,_0x2595de))[_0x02c4('0x34')](handleError(_0x1a0084,null));};exports[_0x02c4('0xb1')]=function(_0x526e28,_0x45cbbf){var _0x3b5835={};if(_0x526e28[_0x02c4('0x41')][_0x02c4('0x3e')]&&_0x526e28[_0x02c4('0x41')]['type']===_0x02c4('0x4f')){_0x3b5835[_0x02c4('0x4f')]=_0x526e28['params']['id'];}else{_0x3b5835['id']=_0x526e28[_0x02c4('0xb2')]['id'];}var _0x3eca50={'raw':![],'where':_0x3b5835},_0x29fb60={};_0x29fb60['model']=_[_0x02c4('0x42')](db['OpenchannelInteraction'][_0x02c4('0x3d')]);_0x29fb60['query']=_[_0x02c4('0x42')](_0x526e28[_0x02c4('0x41')]);_0x29fb60[_0x02c4('0x4a')]=_['intersection'](_0x29fb60[_0x02c4('0x40')],_0x29fb60[_0x02c4('0x41')]);_0x3eca50['attributes']=_[_0x02c4('0x43')](_0x29fb60[_0x02c4('0x40')],qs[_0x02c4('0x45')](_0x526e28[_0x02c4('0x41')]['fields']));_0x3eca50['attributes']=_0x3eca50['attributes']['length']?_0x3eca50[_0x02c4('0x44')]:_0x29fb60['model'];if(_0x526e28['query'][_0x02c4('0xb3')]){_0x3eca50[_0x02c4('0xb4')]=[{'all':!![]}];}_0x3eca50=_[_0x02c4('0xb5')]({},_0x3eca50,_0x526e28[_0x02c4('0xb6')]);return db[_0x02c4('0x3c')][_0x02c4('0x73')](_0x3eca50)['then'](handleEntityNotFound(_0x45cbbf,null))['then'](respondWithResult(_0x45cbbf,null))[_0x02c4('0x34')](handleError(_0x45cbbf,null));};exports[_0x02c4('0xb7')]=function(_0x84e96b,_0x2fa0a0){return db[_0x02c4('0x3c')][_0x02c4('0xb7')](_0x84e96b[_0x02c4('0x75')],{})[_0x02c4('0x33')](respondWithResult(_0x2fa0a0,0xc9))['catch'](handleError(_0x2fa0a0,null));};exports['update']=function(_0x1727d4,_0x262887){if(_0x1727d4[_0x02c4('0x75')]['id']){delete _0x1727d4[_0x02c4('0x75')]['id'];}return db[_0x02c4('0x3c')][_0x02c4('0x73')]({'where':{'id':_0x1727d4[_0x02c4('0xb2')]['id']}})[_0x02c4('0x33')](handleEntityNotFound(_0x262887,null))['then'](saveUpdates(_0x1727d4[_0x02c4('0x75')],null))[_0x02c4('0x33')](respondWithResult(_0x262887,null))[_0x02c4('0x34')](handleError(_0x262887,null));};exports[_0x02c4('0x28')]=function(_0x138e62,_0x360b16){return db[_0x02c4('0x3c')][_0x02c4('0x73')]({'where':{'id':_0x138e62[_0x02c4('0xb2')]['id']}})[_0x02c4('0x33')](handleEntityNotFound(_0x360b16,null))[_0x02c4('0x33')](removeEntity(_0x360b16,null))[_0x02c4('0x34')](handleError(_0x360b16,null));};exports[_0x02c4('0xb8')]=function(_0x9bcfd4,_0x293417){return db[_0x02c4('0x3c')][_0x02c4('0xb8')]()[_0x02c4('0x33')](respondWithResult(_0x293417,null))[_0x02c4('0x34')](handleError(_0x293417,null));};exports[_0x02c4('0xb9')]=function(_0x17f0e6,_0x3a842d,_0x2ba7c2){return db[_0x02c4('0xba')]['find']({'where':{'id':_0x17f0e6[_0x02c4('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3a842d,null))[_0x02c4('0x33')](function(_0x452500){if(_0x452500){return _0x452500[_0x02c4('0xb9')](_0x17f0e6[_0x02c4('0x75')]['ids'],_['omit'](_0x17f0e6[_0x02c4('0x75')],[_0x02c4('0xbb'),'id'])||{});}})[_0x02c4('0x33')](respondWithResult(_0x3a842d,null))[_0x02c4('0x34')](handleError(_0x3a842d,null));};exports['getMessages']=function(_0x1cb797,_0x595c68,_0x51ef0f){var _0x6e0fd={'raw':![],'where':{}};var _0x425c8f={};var _0x2160ec={'count':0x0,'rows':[]};return db[_0x02c4('0x3c')][_0x02c4('0xbc')]({'where':{'id':_0x1cb797[_0x02c4('0xb2')]['id']}})[_0x02c4('0x33')](handleEntityNotFound(_0x595c68,null))[_0x02c4('0x33')](function(_0x13c978){if(_0x13c978){_0x425c8f[_0x02c4('0x40')]=_[_0x02c4('0x42')](db['OpenchannelMessage'][_0x02c4('0x3d')]);_0x425c8f[_0x02c4('0x41')]=_['keys'](_0x1cb797[_0x02c4('0x41')]);_0x425c8f[_0x02c4('0x4a')]=_[_0x02c4('0x43')](_0x425c8f['model'],_0x425c8f[_0x02c4('0x41')]);_0x6e0fd[_0x02c4('0x44')]=_['intersection'](_0x425c8f[_0x02c4('0x40')],qs[_0x02c4('0x45')](_0x1cb797[_0x02c4('0x41')][_0x02c4('0x45')]));_0x6e0fd['attributes']=_0x6e0fd['attributes'][_0x02c4('0x46')]?_0x6e0fd[_0x02c4('0x44')]:_0x425c8f[_0x02c4('0x40')];if(!_0x1cb797[_0x02c4('0x41')][_0x02c4('0xbd')]('nolimit')){_0x6e0fd[_0x02c4('0x21')]=qs[_0x02c4('0x21')](_0x1cb797['query'][_0x02c4('0x21')]);_0x6e0fd[_0x02c4('0x1f')]=qs[_0x02c4('0x1f')](_0x1cb797[_0x02c4('0x41')]['offset']);}_0x6e0fd[_0x02c4('0x47')]=qs['sort'](_0x1cb797['query'][_0x02c4('0x48')]);_0x6e0fd[_0x02c4('0x49')]=qs[_0x02c4('0x4a')](_[_0x02c4('0x4b')](_0x1cb797[_0x02c4('0x41')],_0x425c8f['filters']));_0x6e0fd[_0x02c4('0x49')][_0x02c4('0xbe')]=_0x13c978['id'];if(_0x1cb797[_0x02c4('0x41')][_0x02c4('0x88')]){_0x6e0fd[_0x02c4('0x49')]=_['merge'](_0x6e0fd[_0x02c4('0x49')],{'$or':_[_0x02c4('0x2f')](_0x6e0fd[_0x02c4('0x44')],function(_0x518333){var _0x2c3f7a={};_0x2c3f7a[_0x518333]={'$like':'%'+_0x1cb797[_0x02c4('0x41')][_0x02c4('0x88')]+'%'};return _0x2c3f7a;})});}if(_0x1cb797[_0x02c4('0x41')]['$gte']){var _0x44042d=_0x1cb797[_0x02c4('0x41')][_0x02c4('0x7c')][_0x02c4('0x30')](',');var _0x4fb496={};_0x4fb496[_0x44042d[0x0]]={'$gte':moment(_0x44042d[0x1])[_0x02c4('0xbf')](_0x02c4('0xc0'))};_0x6e0fd['where']=_['merge'](_0x6e0fd[_0x02c4('0x49')],_0x4fb496);}_0x6e0fd=_[_0x02c4('0xb5')]({},_0x6e0fd,_0x1cb797[_0x02c4('0xb6')]);return db[_0x02c4('0xba')][_0x02c4('0x22')]({'where':_0x6e0fd[_0x02c4('0x49')]})[_0x02c4('0x33')](function(_0x410729){_0x2160ec['count']=_0x410729;if(_0x1cb797[_0x02c4('0x41')][_0x02c4('0xb3')]){_0x6e0fd[_0x02c4('0xb4')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x02c4('0xc1')](_0x6e0fd);})[_0x02c4('0x33')](function(_0x5f2d28){_0x2160ec[_0x02c4('0xc2')]=_0x5f2d28;return _0x2160ec;});}})[_0x02c4('0x33')](respondWithFilteredResult(_0x595c68,_0x6e0fd))[_0x02c4('0x34')](handleError(_0x595c68,null));};exports[_0x02c4('0xc3')]=function(_0x207b4f,_0x2ced07,_0x37a694){return db[_0x02c4('0x3c')]['find']({'where':{'id':_0x207b4f[_0x02c4('0xb2')]['id']}})[_0x02c4('0x33')](handleEntityNotFound(_0x2ced07,null))[_0x02c4('0x33')](function(_0xf30fd4){if(_0xf30fd4){return _0xf30fd4['setTags'](_0x207b4f[_0x02c4('0x75')]['ids'],_[_0x02c4('0xc4')](_0x207b4f['body'],[_0x02c4('0xbb'),'id'])||{})[_0x02c4('0xc5')](function(){return db[_0x02c4('0x6e')][_0x02c4('0xc1')]({'attributes':['id',_0x02c4('0x2c'),_0x02c4('0x4e')],'where':{'id':_0x207b4f[_0x02c4('0x75')][_0x02c4('0xbb')]}});})[_0x02c4('0x33')](function(_0x622e90){socket[_0x02c4('0xc6')](_0x02c4('0xc7'),{'id':Number(_0x207b4f[_0x02c4('0xb2')]['id']),'tags':_0x622e90||[]});return{'id':Number(_0x207b4f['params']['id']),'tags':_0x622e90||[]};});}})['then'](respondWithResult(_0x2ced07,null))[_0x02c4('0x34')](handleError(_0x2ced07,null));};exports[_0x02c4('0xc8')]=function(_0x54d49b,_0xc18bb5,_0x571578){return db[_0x02c4('0x3c')][_0x02c4('0x73')]({'where':{'id':_0x54d49b[_0x02c4('0xb2')]['id']}})[_0x02c4('0x33')](handleEntityNotFound(_0xc18bb5,null))[_0x02c4('0x33')](function(_0x2b1809){if(_0x2b1809){return _0x2b1809[_0x02c4('0xc8')](_0x54d49b[_0x02c4('0x41')]['ids']);}})['then'](respondWithStatusCode(_0xc18bb5,null))['catch'](handleError(_0xc18bb5,null));};exports[_0x02c4('0xc9')]=function(_0xde7f93,_0x36483b){var _0x5a8589=moment()['unix']()['toString']();var _0x3fb379=path[_0x02c4('0xca')](config[_0x02c4('0xcb')],_0x02c4('0xcc'),_0x02c4('0xcd'),'tmp');var _0x51cd38=path[_0x02c4('0xca')](config[_0x02c4('0xcb')],_0x02c4('0xcc'),'files','attachments');var _0x19d97f=path['join'](_0x3fb379,_0x5a8589);var _0x33c5d6=util[_0x02c4('0xbf')]('transcript-%d-%s.zip',_0xde7f93['params']['id'],_0x5a8589);var _0x257e31=path[_0x02c4('0xca')](_0x3fb379,_0x33c5d6);var _0x54f42d=[];_0x54f42d[_0x02c4('0x31')]({'model':db[_0x02c4('0x70')],'as':_0x02c4('0x70'),'attributes':['id',_0x02c4('0xce')],'raw':!![]});_0x54f42d['push']({'model':db['CmContact'],'as':_0x02c4('0x66'),'attributes':['id',_0x02c4('0xcf'),'lastName'],'raw':!![]});if(_0xde7f93[_0x02c4('0x41')]['attachments']){_0x54f42d[_0x02c4('0x31')]({'model':db[_0x02c4('0xd0')],'as':_0x02c4('0xd0'),'raw':!![]});}var _0x13115a=[{'model':db[_0x02c4('0xba')],'as':_0x02c4('0xd1'),'attributes':['id',_0x02c4('0x75'),_0x02c4('0x7b'),_0x02c4('0xd2'),'secret','read'],'include':_0x54f42d}];_0x13115a[_0x02c4('0x31')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0x13115a[_0x02c4('0x31')]({'model':db[_0x02c4('0x70')],'as':_0x02c4('0xd3'),'attributes':['id',_0x02c4('0xce')]});return db[_0x02c4('0x3c')]['find']({'where':{'id':_0xde7f93[_0x02c4('0xb2')]['id']},'include':_0x13115a})['then'](handleEntityNotFound(_0x36483b,null))[_0x02c4('0x33')](function(_0x4f6f9c){if(_0x4f6f9c){var _0x19d606=_0x4f6f9c[_0x02c4('0xd4')]({'plain':!![]});fs[_0x02c4('0xd5')](_0x19d97f);var _0x2b5f2c={'channel':_0x02c4('0xd6'),'account':_0x19d606[_0x02c4('0xd7')]['name'],'agent':_0x19d606[_0x02c4('0xd3')]?_0x19d606[_0x02c4('0xd3')][_0x02c4('0xce')]:'N.A.','createdAt':moment(_0x19d606[_0x02c4('0x7b')])['format'](_0x02c4('0xc0'))['toString'](),'closedAt':_0x19d606[_0x02c4('0x37')]?moment(_0x19d606['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x02c4('0x9c')]():'','disposition':_0x19d606[_0x02c4('0xd8')],'visibility':_0x19d606[_0x02c4('0xd9')]?_0x02c4('0xda'):_0x02c4('0xdb'),'messages':_(_0x19d606[_0x02c4('0xd1')])[_0x02c4('0x88')]({'secret':![]})[_0x02c4('0x2f')](function(_0xbaff21){if(_0xbaff21[_0x02c4('0xd0')]){var _0xd7559=path['join'](_0x51cd38,_0xbaff21[_0x02c4('0xd0')]['basename']);if(fs[_0x02c4('0xdc')](_0xd7559)){fs['createReadStream'](_0xd7559)[_0x02c4('0xdd')](fs[_0x02c4('0xde')](path[_0x02c4('0xca')](_0x19d97f,_0xbaff21[_0x02c4('0xd0')][_0x02c4('0xdf')])));}}return{'date':moment(_0xbaff21[_0x02c4('0x7b')])[_0x02c4('0xbf')](_0x02c4('0xc0'))[_0x02c4('0x9c')](),'sender':_0xbaff21[_0x02c4('0xd2')]===_0x02c4('0xe0')?_0xbaff21[_0x02c4('0x70')]?_0xbaff21[_0x02c4('0x70')][_0x02c4('0xce')]:_0x02c4('0xe1'):_0xbaff21[_0x02c4('0x66')][_0x02c4('0xcf')]+(_0xbaff21[_0x02c4('0x66')][_0x02c4('0xe2')]?'\x20'+_0xbaff21['Contact'][_0x02c4('0xe2')]:''),'body':_0xbaff21['Attachment']?_0xbaff21['Attachment']['basename']:_0xbaff21[_0x02c4('0x75')],'direction':_0xbaff21[_0x02c4('0xd2')]===_0x02c4('0xe0')?'A':'C','secret':_0xbaff21[_0x02c4('0xe3')],'read':_0xbaff21[_0x02c4('0x83')],'attachment':_0xbaff21['Attachment']};})[_0x02c4('0x62')]()};return ejs[_0x02c4('0xe4')](path['join'](config[_0x02c4('0xcb')],_0x02c4('0xcc'),_0x02c4('0xe5'),_0x02c4('0xe6')),{'interaction':_0x2b5f2c})[_0x02c4('0x33')](function(_0x4b4468){var _0x5a335a=path['join'](_0x19d97f,_0x02c4('0xe7')+_0x19d606['id']+'-'+_0x5a8589+_0x02c4('0xe8'));var _0xb250e4={'path':_0x5a335a,'channel':_0x02c4('0xd6'),'interactionId':_0x19d606['id']};return pdf[_0x02c4('0xe9')](_0x4b4468,_0xb250e4);})[_0x02c4('0x33')](function(){return new BPromise(function(_0x29b621,_0x4ce264){zipdir(_0x19d97f,{'saveTo':_0x257e31},function(_0x12ff41,_0x348d0d){if(_0x12ff41)return _0x4ce264(_0x12ff41);return _0x29b621(_0x348d0d);});})[_0x02c4('0x33')](function(){return new BPromise(function(_0x415a74,_0x2d3ddc){rimraf(_0x19d97f,function(_0xf5df89){if(_0xf5df89)_0x2d3ddc(_0xf5df89);return _0x415a74();});});})[_0x02c4('0x33')](function(){return _0x36483b[_0x02c4('0xc9')](_0x257e31,_0x33c5d6,function(_0x3b4566){if(_0x3b4566){console[_0x02c4('0xea')](_0x02c4('0xeb'),_0x3b4566);}else{fs[_0x02c4('0xec')](_0x257e31);}});});});}else{return _0x36483b[_0x02c4('0x2a')](0xc8);}})[_0x02c4('0x34')](handleError(_0x36483b,null));};
\ No newline at end of file
index cc8287b..af58f5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7ad=['unreadMessages','length','emit','catch','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe7ad,0xba));var _0xde7a=function(_0x4c6fae,_0x4bfd15){_0x4c6fae=_0x4c6fae-0x0;var _0x14fbf3=_0xe7ad[_0x4c6fae];return _0x14fbf3;};'use strict';var EventEmitter=require(_0xde7a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xde7a('0x1')];var OpenchannelMessage=require(_0xde7a('0x2'))['db'][_0xde7a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xde7a('0x4')](0x0);var events={'afterCreate':_0xde7a('0x5'),'afterUpdate':_0xde7a('0x6'),'afterDestroy':_0xde7a('0x7')};function emitEvent(_0x1a50f3){return function(_0x847be7,_0x5417af,_0x1816c7){_0x847be7['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x578c71){_0x847be7[_0xde7a('0x8')](_0xde7a('0x9'),_0x578c71[_0xde7a('0xa')](function(_0x22ac56){return{'id':_0x22ac56['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x847be7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xde7a('0xb')](function(_0x12a4b3){_0x847be7[_0xde7a('0x8')](_0xde7a('0xc'),_0x12a4b3[_0xde7a('0xd')]);OpenchannelInteractionEvents[_0xde7a('0xe')](_0x1a50f3+':'+_0x847be7['id'],_0x847be7);OpenchannelInteractionEvents['emit'](_0x1a50f3,_0x847be7);_0x1816c7(null);})[_0xde7a('0xf')](_0x1816c7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xde7a('0x10')](e,emitEvent(event));}}module[_0xde7a('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xdde9=['hook','../../mysqldb','OpenchannelInteraction','save','update','remove','getUsers','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty'];(function(_0x57108b,_0x4aa61b){var _0xe15f4=function(_0xa2a1bb){while(--_0xa2a1bb){_0x57108b['push'](_0x57108b['shift']());}};_0xe15f4(++_0x4aa61b);}(_0xdde9,0x1b3));var _0x9dde=function(_0xe27c45,_0x4d93c5){_0xe27c45=_0xe27c45-0x0;var _0x165fd3=_0xdde9[_0xe27c45];return _0x165fd3;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x9dde('0x0'))['db'][_0x9dde('0x1')];var OpenchannelMessage=require(_0x9dde('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9dde('0x2'),'afterUpdate':_0x9dde('0x3'),'afterDestroy':_0x9dde('0x4')};function emitEvent(_0x47f01a){return function(_0x1bd777,_0x3ee8b0,_0x13ad48){_0x1bd777[_0x9dde('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49170f){_0x1bd777[_0x9dde('0x6')](_0x9dde('0x7'),_0x49170f[_0x9dde('0x8')](function(_0x484fc4){return{'id':_0x484fc4['id']};}));return OpenchannelMessage[_0x9dde('0x9')]({'where':{'OpenchannelInteractionId':_0x1bd777['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x38d0d4){_0x1bd777['setDataValue']('unreadMessages',_0x38d0d4['length']);OpenchannelInteractionEvents[_0x9dde('0xa')](_0x47f01a+':'+_0x1bd777['id'],_0x1bd777);OpenchannelInteractionEvents[_0x9dde('0xa')](_0x47f01a,_0x1bd777);_0x13ad48(null);})[_0x9dde('0xb')](_0x13ad48(null));};}for(var e in events){if(events[_0x9dde('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x9dde('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index 73478a9..6a328c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2a3=['request-promise','../../config/environment','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd2a3,0x12d));var _0x3d2a=function(_0x19297d,_0x9c4d1b){_0x19297d=_0x19297d-0x0;var _0x1d26c3=_0xd2a3[_0x19297d];return _0x1d26c3;};'use strict';var _=require(_0x3d2a('0x0'));var util=require(_0x3d2a('0x1'));var logger=require('../../config/logger')(_0x3d2a('0x2'));var moment=require(_0x3d2a('0x3'));var BPromise=require(_0x3d2a('0x4'));var rp=require(_0x3d2a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3d2a('0x6'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x113bde,_0x2f9d78){return _0x113bde[_0x3d2a('0x7')](_0x3d2a('0x8'),attributes,{'tableName':_0x3d2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d2a('0xa'),'collate':_0x3d2a('0xb'),'hooks':{'beforeUpdate':function(_0x32cb2c,_0x243839,_0x5f0779){if(_0x32cb2c[_0x3d2a('0xc')](_0x3d2a('0xd'))){_0x32cb2c[_0x3d2a('0xe')]=moment()[_0x3d2a('0xf')](_0x3d2a('0x10'));}_0x5f0779(null,_0x32cb2c);}}});};
\ No newline at end of file
+var _0x8a87=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','bluebird','request-promise','path','../../config/environment','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt'];(function(_0x534370,_0x2499a0){var _0x1009ee=function(_0x255812){while(--_0x255812){_0x534370['push'](_0x534370['shift']());}};_0x1009ee(++_0x2499a0);}(_0x8a87,0x6b));var _0x78a8=function(_0xcc69c5,_0x5b35b2){_0xcc69c5=_0xcc69c5-0x0;var _0x14ec59=_0x8a87[_0xcc69c5];return _0x14ec59;};'use strict';var _=require(_0x78a8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x78a8('0x1'));var moment=require('moment');var BPromise=require(_0x78a8('0x2'));var rp=require(_0x78a8('0x3'));var fs=require('fs');var path=require(_0x78a8('0x4'));var rimraf=require('rimraf');var config=require(_0x78a8('0x5'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0xd9737c,_0x3c5bb6){return _0xd9737c[_0x78a8('0x6')](_0x78a8('0x7'),attributes,{'tableName':_0x78a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x78a8('0x9'),'hooks':{'beforeUpdate':function(_0x5d3b84,_0x1587a2,_0x48c013){if(_0x5d3b84[_0x78a8('0xa')](_0x78a8('0xb'))){_0x5d3b84[_0x78a8('0xc')]=moment()[_0x78a8('0xd')](_0x78a8('0xe'));}_0x48c013(null,_0x5d3b84);}}});};
\ No newline at end of file
index 5e9bc4b..337cebf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6b4=['socket.io-emitter','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','AddTagsToOpenchannelInteraction','find','where','addTags','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0xa1de4e,_0x298c3c){var _0x9be059=function(_0x10271e){while(--_0x10271e){_0xa1de4e['push'](_0xa1de4e['shift']());}};_0x9be059(++_0x298c3c);}(_0xc6b4,0x1b6));var _0x4c6b=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0xc6b4[_0x56608c];return _0x3c7fb0;};'use strict';var _=require(_0x4c6b('0x0'));var util=require('util');var moment=require(_0x4c6b('0x1'));var BPromise=require(_0x4c6b('0x2'));var rs=require(_0x4c6b('0x3'));var fs=require('fs');var Redis=require(_0x4c6b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c6b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c6b('0x6'));var jayson=require(_0x4c6b('0x7'));var client=jayson[_0x4c6b('0x8')][_0x4c6b('0x9')]({'port':0x232a});config['redis']=_[_0x4c6b('0xa')](config[_0x4c6b('0xb')],{'host':_0x4c6b('0xc'),'port':0x18eb});var socket=require(_0x4c6b('0xd'))(new Redis(config['redis']));require(_0x4c6b('0xe'))[_0x4c6b('0xf')](socket);function respondWithRpcPromise(_0x39f4fe,_0x8db4d,_0x27d245){return new BPromise(function(_0x37933b,_0x461c7a){return client['request'](_0x39f4fe,_0x27d245)[_0x4c6b('0x10')](function(_0x49d00d){logger['info'](_0x4c6b('0x11'),_0x8db4d,_0x4c6b('0x12'));logger[_0x4c6b('0x13')](_0x4c6b('0x14'),_0x8db4d,_0x4c6b('0x12'),JSON['stringify'](_0x49d00d));if(_0x49d00d[_0x4c6b('0x15')]){if(_0x49d00d[_0x4c6b('0x15')][_0x4c6b('0x16')]===0x1f4){logger[_0x4c6b('0x15')](_0x4c6b('0x11'),_0x8db4d,_0x49d00d[_0x4c6b('0x15')][_0x4c6b('0x17')]);return _0x461c7a(_0x49d00d[_0x4c6b('0x15')][_0x4c6b('0x17')]);}logger[_0x4c6b('0x15')](_0x4c6b('0x11'),_0x8db4d,_0x49d00d[_0x4c6b('0x15')][_0x4c6b('0x17')]);return _0x37933b(_0x49d00d[_0x4c6b('0x15')]['message']);}else{logger[_0x4c6b('0x18')](_0x4c6b('0x11'),_0x8db4d,_0x4c6b('0x12'));_0x37933b(_0x49d00d[_0x4c6b('0x19')]['message']);}})[_0x4c6b('0x1a')](function(_0x2ee05d){logger['error'](_0x4c6b('0x11'),_0x8db4d,_0x2ee05d);_0x461c7a(_0x2ee05d);});});}exports[_0x4c6b('0x1b')]=function(_0x77d4c5){var _0x49ee33=this;return new Promise(function(_0x125e59,_0x81d285){return db[_0x4c6b('0x1c')][_0x4c6b('0x1d')](_0x77d4c5[_0x4c6b('0x1e')],{'raw':_0x77d4c5[_0x4c6b('0x1f')]?_0x77d4c5['options'][_0x4c6b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x77d4c5[_0x4c6b('0x1f')]?_0x77d4c5[_0x4c6b('0x1f')]['where']||null:null,'attributes':_0x77d4c5[_0x4c6b('0x1f')]?_0x77d4c5[_0x4c6b('0x1f')][_0x4c6b('0x21')]||null:null,'limit':_0x77d4c5[_0x4c6b('0x1f')]?_0x77d4c5[_0x4c6b('0x1f')][_0x4c6b('0x22')]||null:null})[_0x4c6b('0x10')](function(_0x3ee92b){logger[_0x4c6b('0x18')](_0x4c6b('0x1b'),_0x77d4c5);logger['debug'](_0x4c6b('0x1b'),_0x77d4c5,JSON['stringify'](_0x3ee92b));_0x125e59(_0x3ee92b);})[_0x4c6b('0x1a')](function(_0x50a70d){logger[_0x4c6b('0x15')](_0x4c6b('0x1b'),_0x50a70d['message'],_0x77d4c5);_0x81d285(_0x49ee33[_0x4c6b('0x15')](0x1f4,_0x50a70d[_0x4c6b('0x17')]));});});};exports[_0x4c6b('0x23')]=function(_0x48986d){return new Promise(function(_0x2cc39a,_0x239109){return db[_0x4c6b('0x1c')][_0x4c6b('0x24')]({'where':_0x48986d[_0x4c6b('0x1f')]?_0x48986d['options'][_0x4c6b('0x25')]||null:null})[_0x4c6b('0x10')](function(_0x247f53){if(_0x247f53){return _0x247f53[_0x4c6b('0x26')](_0x48986d[_0x4c6b('0x1e')]['ids'],_['omit'](_0x48986d[_0x4c6b('0x1e')],['ids','id'])||{});}})[_0x4c6b('0x27')](function(_0x509b76){logger['info'](_0x4c6b('0x28'),_0x48986d);logger['debug'](_0x4c6b('0x28'),_0x48986d,JSON['stringify'](_0x509b76));_0x2cc39a(_0x509b76);})[_0x4c6b('0x1a')](function(_0x3b085a){logger[_0x4c6b('0x15')](_0x4c6b('0x28'),_0x3b085a[_0x4c6b('0x17')],_0x48986d);_0x239109(_this[_0x4c6b('0x15')](0x1f4,_0x3b085a['message']));});});};
\ No newline at end of file
+var _0x2d72=['where','limit','debug','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction','body','options','raw'];(function(_0x32fab5,_0x1c3ea6){var _0x1983ea=function(_0x2c2289){while(--_0x2c2289){_0x32fab5['push'](_0x32fab5['shift']());}};_0x1983ea(++_0x1c3ea6);}(_0x2d72,0xb8));var _0x22d7=function(_0x5088ed,_0xf8c307){_0x5088ed=_0x5088ed-0x0;var _0x1e4f79=_0x2d72[_0x5088ed];return _0x1e4f79;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var moment=require(_0x22d7('0x2'));var BPromise=require(_0x22d7('0x3'));var rs=require(_0x22d7('0x4'));var fs=require('fs');var Redis=require(_0x22d7('0x5'));var db=require(_0x22d7('0x6'))['db'];var utils=require(_0x22d7('0x7'));var logger=require(_0x22d7('0x8'))(_0x22d7('0x9'));var config=require(_0x22d7('0xa'));var jayson=require(_0x22d7('0xb'));var client=jayson[_0x22d7('0xc')][_0x22d7('0xd')]({'port':0x232a});config['redis']=_[_0x22d7('0xe')](config[_0x22d7('0xf')],{'host':_0x22d7('0x10'),'port':0x18eb});var socket=require(_0x22d7('0x11'))(new Redis(config[_0x22d7('0xf')]));require(_0x22d7('0x12'))[_0x22d7('0x13')](socket);function respondWithRpcPromise(_0x22d534,_0x35fc69,_0x30dd41){return new BPromise(function(_0x55aa44,_0x248e77){return client[_0x22d7('0x14')](_0x22d534,_0x30dd41)[_0x22d7('0x15')](function(_0x358057){logger[_0x22d7('0x16')](_0x22d7('0x17'),_0x35fc69,_0x22d7('0x18'));logger['debug'](_0x22d7('0x19'),_0x35fc69,_0x22d7('0x18'),JSON[_0x22d7('0x1a')](_0x358057));if(_0x358057[_0x22d7('0x1b')]){if(_0x358057['error'][_0x22d7('0x1c')]===0x1f4){logger[_0x22d7('0x1b')]('OpenchannelInteraction,\x20%s,\x20%s',_0x35fc69,_0x358057[_0x22d7('0x1b')][_0x22d7('0x1d')]);return _0x248e77(_0x358057['error'][_0x22d7('0x1d')]);}logger[_0x22d7('0x1b')](_0x22d7('0x17'),_0x35fc69,_0x358057[_0x22d7('0x1b')]['message']);return _0x55aa44(_0x358057['error'][_0x22d7('0x1d')]);}else{logger[_0x22d7('0x16')](_0x22d7('0x17'),_0x35fc69,_0x22d7('0x18'));_0x55aa44(_0x358057[_0x22d7('0x1e')]['message']);}})[_0x22d7('0x1f')](function(_0x50e6f1){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x35fc69,_0x50e6f1);_0x248e77(_0x50e6f1);});});}exports['UpdateOpenchannelInteraction']=function(_0x3d0a98){var _0x55606c=this;return new Promise(function(_0x5b2f2b,_0x2f5507){return db[_0x22d7('0x20')]['update'](_0x3d0a98[_0x22d7('0x21')],{'raw':_0x3d0a98[_0x22d7('0x22')]?_0x3d0a98[_0x22d7('0x22')][_0x22d7('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d0a98['options']?_0x3d0a98['options'][_0x22d7('0x24')]||null:null,'attributes':_0x3d0a98[_0x22d7('0x22')]?_0x3d0a98[_0x22d7('0x22')]['attributes']||null:null,'limit':_0x3d0a98['options']?_0x3d0a98[_0x22d7('0x22')][_0x22d7('0x25')]||null:null})[_0x22d7('0x15')](function(_0x479d0c){logger['info']('UpdateOpenchannelInteraction',_0x3d0a98);logger[_0x22d7('0x26')]('UpdateOpenchannelInteraction',_0x3d0a98,JSON[_0x22d7('0x1a')](_0x479d0c));_0x5b2f2b(_0x479d0c);})['catch'](function(_0x32a965){logger[_0x22d7('0x1b')]('UpdateOpenchannelInteraction',_0x32a965['message'],_0x3d0a98);_0x2f5507(_0x55606c[_0x22d7('0x1b')](0x1f4,_0x32a965[_0x22d7('0x1d')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x275d53){return new Promise(function(_0xe37d3,_0x51a196){return db['OpenchannelInteraction'][_0x22d7('0x27')]({'where':_0x275d53['options']?_0x275d53[_0x22d7('0x22')][_0x22d7('0x24')]||null:null})['then'](function(_0x4b3479){if(_0x4b3479){return _0x4b3479[_0x22d7('0x28')](_0x275d53[_0x22d7('0x21')][_0x22d7('0x29')],_[_0x22d7('0x2a')](_0x275d53[_0x22d7('0x21')],[_0x22d7('0x29'),'id'])||{});}})['spread'](function(_0x4a6df2){logger[_0x22d7('0x16')]('AddTags',_0x275d53);logger[_0x22d7('0x26')](_0x22d7('0x2b'),_0x275d53,JSON[_0x22d7('0x1a')](_0x4a6df2));_0xe37d3(_0x4a6df2);})[_0x22d7('0x1f')](function(_0x3fcc75){logger[_0x22d7('0x1b')]('AddTags',_0x3fcc75[_0x22d7('0x1d')],_0x275d53);_0x51a196(_this[_0x22d7('0x1b')](0x1f4,_0x3fcc75['message']));});});};
\ No newline at end of file
index a3fc36d..375645a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96d8=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x5d3761,_0xbeb552){var _0x9bd170=function(_0xfa5168){while(--_0xfa5168){_0x5d3761['push'](_0x5d3761['shift']());}};_0x9bd170(++_0xbeb552);}(_0x96d8,0x197));var _0x896d=function(_0x3142fb,_0x5369cb){_0x3142fb=_0x3142fb-0x0;var _0x402061=_0x96d8[_0x3142fb];return _0x402061;};'use strict';var OpenchannelInteractionEvents=require(_0x896d('0x0'));var events=[_0x896d('0x1'),_0x896d('0x2'),_0x896d('0x3')];function createListener(_0x403741,_0xf4f49){return function(_0x415bfa){_0xf4f49[_0x896d('0x4')](_0x403741,_0x415bfa);};}function removeListener(_0x139674,_0x5003f5){return function(){OpenchannelInteractionEvents[_0x896d('0x5')](_0x139674,_0x5003f5);};}exports[_0x896d('0x6')]=function(_0x51fb03){for(var _0x26f6bf=0x0,_0x1ae36e=events[_0x896d('0x7')];_0x26f6bf<_0x1ae36e;_0x26f6bf++){var _0x20a284=events[_0x26f6bf];var _0x507659=createListener(_0x896d('0x8')+_0x20a284,_0x51fb03);OpenchannelInteractionEvents['on'](_0x20a284,_0x507659);}};
\ No newline at end of file
+var _0x87b0=['openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x87b0,0x69));var _0x087b=function(_0x5aa6cb,_0x34bcae){_0x5aa6cb=_0x5aa6cb-0x0;var _0x680d3=_0x87b0[_0x5aa6cb];return _0x680d3;};'use strict';var OpenchannelInteractionEvents=require(_0x087b('0x0'));var events=['save',_0x087b('0x1'),_0x087b('0x2')];function createListener(_0x5c330d,_0x2d6b02){return function(_0x495cb0){_0x2d6b02[_0x087b('0x3')](_0x5c330d,_0x495cb0);};}function removeListener(_0x3ed1cc,_0x52992b){return function(){OpenchannelInteractionEvents[_0x087b('0x4')](_0x3ed1cc,_0x52992b);};}exports[_0x087b('0x5')]=function(_0x12badd){for(var _0x27f419=0x0,_0x4243d3=events[_0x087b('0x6')];_0x27f419<_0x4243d3;_0x27f419++){var _0x4576bd=events[_0x27f419];var _0x11dd9d=createListener(_0x087b('0x7')+_0x4576bd,_0x12badd);OpenchannelInteractionEvents['on'](_0x4576bd,_0x11dd9d);}};
\ No newline at end of file
index f742f65..3fd4d51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x2079fb,_0x445dfe){_0x2079fb=_0x2079fb-0x0;var _0x4c5160=_0x70e0[_0x2079fb];return _0x4c5160;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router;
\ No newline at end of file
+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(_0x2fda8d,_0x560126){var _0x11e20e=function(_0x2ae2ce){while(--_0x2ae2ce){_0x2fda8d['push'](_0x2fda8d['shift']());}};_0x11e20e(++_0x560126);}(_0xe706,0xa3));var _0x6e70=function(_0x4bfc12,_0x142724){_0x4bfc12=_0x4bfc12-0x0;var _0x33b8ee=_0xe706[_0x4bfc12];return _0x33b8ee;};'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
index a09be55..ffb6869 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8227=['BOOLEAN','ENUM','out','DATE','STRING','TEXT','exports','medium'];(function(_0x4b2693,_0x29f874){var _0x1957d7=function(_0x57a294){while(--_0x57a294){_0x4b2693['push'](_0x4b2693['shift']());}};_0x1957d7(++_0x29f874);}(_0x8227,0x146));var _0x7822=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8227[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7822('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7822('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7822('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7822('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7822('0x3')]('in','out'),'defaultValue':_0x7822('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7822('0x5')]},'providerName':{'type':Sequelize[_0x7822('0x6')]},'providerResponse':{'type':Sequelize[_0x7822('0x7')]}};
\ No newline at end of file
+var _0xb4f8=['medium','BOOLEAN','ENUM','out','STRING','exports','TEXT'];(function(_0x3f11d9,_0x11a221){var _0x47361a=function(_0x4c7643){while(--_0x4c7643){_0x3f11d9['push'](_0x3f11d9['shift']());}};_0x47361a(++_0x11a221);}(_0xb4f8,0x83));var _0x8b4f=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xb4f8[_0x1347f8];return _0x218368;};'use strict';var Sequelize=require('sequelize');module[_0x8b4f('0x0')]={'body':{'type':Sequelize[_0x8b4f('0x1')](_0x8b4f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8b4f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8b4f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b4f('0x4')]('in','out'),'defaultValue':_0x8b4f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x8b4f('0x6')]},'providerResponse':{'type':Sequelize[_0x8b4f('0x1')]}};
\ No newline at end of file
index aa8f578..dda84d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd409=['index','map','OpenchannelMessage','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','includeAll','find','create','body','describe','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','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','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','internal','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelMessage,\x20%s,\x20%s','result','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','stack','name','send'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xd409,0x15f));var _0x9d40=function(_0x39e2d7,_0x1b15f6){_0x39e2d7=_0x39e2d7-0x0;var _0x413d0d=_0xd409[_0x39e2d7];return _0x413d0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9d40('0x0'));var zipdir=require(_0x9d40('0x1'));var jsonpatch=require(_0x9d40('0x2'));var rp=require(_0x9d40('0x3'));var moment=require(_0x9d40('0x4'));var BPromise=require(_0x9d40('0x5'));var Mustache=require(_0x9d40('0x6'));var util=require('util');var path=require(_0x9d40('0x7'));var sox=require('sox');var csv=require(_0x9d40('0x8'));var ejs=require(_0x9d40('0x9'));var fs=require('fs');var fs_extra=require(_0x9d40('0xa'));var _=require(_0x9d40('0xb'));var squel=require(_0x9d40('0xc'));var crypto=require(_0x9d40('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9d40('0xe'));var toCsv=require(_0x9d40('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9d40('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d40('0x10'));var logger=require(_0x9d40('0x11'))(_0x9d40('0x12'));var utils=require(_0x9d40('0x13'));var config=require(_0x9d40('0x14'));var licenseUtil=require(_0x9d40('0x15'));var db=require(_0x9d40('0x16'))['db'];config[_0x9d40('0x17')]=_[_0x9d40('0x18')](config[_0x9d40('0x17')],{'host':_0x9d40('0x19'),'port':0x18eb});var socket=require(_0x9d40('0x1a'))(new Redis(config[_0x9d40('0x17')]));require(_0x9d40('0x1b'))[_0x9d40('0x1c')](socket);var jayson=require(_0x9d40('0x1d'));var client=jayson['client'][_0x9d40('0x1e')]({'port':0x232c});var client9002=jayson[_0x9d40('0x1f')][_0x9d40('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x31499b,_0x5e2aa2,_0x4e0356,_0x2dc8ca){return new BPromise(function(_0x34822f,_0x1c430f){var _0x25c737=_0x2dc8ca||client;return _0x25c737[_0x9d40('0x20')](_0x31499b,_0x4e0356)[_0x9d40('0x21')](function(_0x358607){logger[_0x9d40('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x5e2aa2,_0x9d40('0x23'));logger[_0x9d40('0x24')](_0x9d40('0x25'),_0x5e2aa2,'request\x20sent',JSON[_0x9d40('0x26')](_0x358607));if(_0x358607['error']){if(_0x358607[_0x9d40('0x27')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x5e2aa2,_0x358607[_0x9d40('0x27')][_0x9d40('0x28')]);return _0x1c430f(_0x358607[_0x9d40('0x27')][_0x9d40('0x28')]);}logger[_0x9d40('0x27')](_0x9d40('0x29'),_0x5e2aa2,_0x358607[_0x9d40('0x27')][_0x9d40('0x28')]);return _0x34822f(_0x358607[_0x9d40('0x27')][_0x9d40('0x28')]);}else{logger[_0x9d40('0x22')](_0x9d40('0x29'),_0x5e2aa2,_0x9d40('0x23'));_0x34822f(_0x358607[_0x9d40('0x2a')][_0x9d40('0x28')]);}})['catch'](function(_0x483a5f){logger[_0x9d40('0x27')](_0x9d40('0x29'),_0x5e2aa2,_0x483a5f);_0x1c430f(_0x483a5f);});});}function respondWithStatusCode(_0x454a7f,_0x16c33e){_0x16c33e=_0x16c33e||0xcc;return function(_0x5e41dc){if(_0x5e41dc){return _0x454a7f[_0x9d40('0x2b')](_0x16c33e);}return _0x454a7f[_0x9d40('0x2c')](_0x16c33e)[_0x9d40('0x2d')]();};}function respondWithResult(_0x42bcfa,_0x2ae193){_0x2ae193=_0x2ae193||0xc8;return function(_0x14ed8c){if(_0x14ed8c){return _0x42bcfa[_0x9d40('0x2c')](_0x2ae193)['json'](_0x14ed8c);}};}function respondWithFilteredResult(_0xfd9486,_0x5c24dc){return function(_0x250e4b){if(_0x250e4b){var _0x24d609=typeof _0x5c24dc[_0x9d40('0x2e')]===_0x9d40('0x2f')&&typeof _0x5c24dc['limit']===_0x9d40('0x2f');var _0x25fb4d=_0x250e4b[_0x9d40('0x30')];var _0x518a25=_0x24d609?0x0:_0x5c24dc[_0x9d40('0x2e')];var _0x56ebc4=_0x24d609?_0x250e4b[_0x9d40('0x30')]:_0x5c24dc['offset']+_0x5c24dc[_0x9d40('0x31')];var _0x310704;if(_0x56ebc4>=_0x25fb4d){_0x56ebc4=_0x25fb4d;_0x310704=0xc8;}else{_0x310704=0xce;}_0xfd9486[_0x9d40('0x2c')](_0x310704);return _0xfd9486[_0x9d40('0x32')]('Content-Range',_0x518a25+'-'+_0x56ebc4+'/'+_0x25fb4d)[_0x9d40('0x33')](_0x250e4b);}return null;};}function patchUpdates(_0x227683){return function(_0x281b4b){try{jsonpatch[_0x9d40('0x34')](_0x281b4b,_0x227683,!![]);}catch(_0xc354f1){return BPromise[_0x9d40('0x35')](_0xc354f1);}return _0x281b4b[_0x9d40('0x36')]();};}function saveUpdates(_0x22a742,_0x2d8c88){return function(_0x356cfd){if(_0x356cfd){return _0x356cfd[_0x9d40('0x37')](_0x22a742)['then'](function(_0x1525d3){return _0x1525d3;});}return null;};}function removeEntity(_0x2f9bfe,_0x435951){return function(_0x3a1aed){if(_0x3a1aed){return _0x3a1aed[_0x9d40('0x38')]()[_0x9d40('0x21')](function(){_0x2f9bfe[_0x9d40('0x2c')](0xcc)[_0x9d40('0x2d')]();});}};}function handleEntityNotFound(_0x4c4734,_0x1c4201){return function(_0x324312){if(!_0x324312){_0x4c4734[_0x9d40('0x2b')](0x194);}return _0x324312;};}function handleError(_0x5658d1,_0x3be84a){_0x3be84a=_0x3be84a||0x1f4;return function(_0x25255d){logger[_0x9d40('0x27')](_0x25255d[_0x9d40('0x39')]);if(_0x25255d[_0x9d40('0x3a')]){delete _0x25255d[_0x9d40('0x3a')];}_0x5658d1[_0x9d40('0x2c')](_0x3be84a)[_0x9d40('0x3b')](_0x25255d);};}exports[_0x9d40('0x3c')]=function(_0x47ce97,_0x51224b){var _0x521c7b={},_0x18bf45={},_0x3eaa5c={'count':0x0,'rows':[]};var _0x92103=_[_0x9d40('0x3d')](db[_0x9d40('0x3e')]['rawAttributes'],function(_0x3e33ed){return{'name':_0x3e33ed[_0x9d40('0x3f')],'type':_0x3e33ed['type'][_0x9d40('0x40')]};});_0x18bf45[_0x9d40('0x41')]=_[_0x9d40('0x3d')](_0x92103,_0x9d40('0x3a'));_0x18bf45[_0x9d40('0x42')]=_['keys'](_0x47ce97[_0x9d40('0x42')]);_0x18bf45[_0x9d40('0x43')]=_[_0x9d40('0x44')](_0x18bf45[_0x9d40('0x41')],_0x18bf45['query']);_0x521c7b[_0x9d40('0x45')]=_[_0x9d40('0x44')](_0x18bf45['model'],qs['fields'](_0x47ce97[_0x9d40('0x42')]['fields']));_0x521c7b[_0x9d40('0x45')]=_0x521c7b[_0x9d40('0x45')][_0x9d40('0x46')]?_0x521c7b[_0x9d40('0x45')]:_0x18bf45[_0x9d40('0x41')];if(!_0x47ce97[_0x9d40('0x42')][_0x9d40('0x47')](_0x9d40('0x48'))){_0x521c7b['limit']=qs[_0x9d40('0x31')](_0x47ce97[_0x9d40('0x42')][_0x9d40('0x31')]);_0x521c7b['offset']=qs[_0x9d40('0x2e')](_0x47ce97[_0x9d40('0x42')][_0x9d40('0x2e')]);}_0x521c7b[_0x9d40('0x49')]=qs['sort'](_0x47ce97[_0x9d40('0x42')][_0x9d40('0x4a')]);_0x521c7b[_0x9d40('0x4b')]=qs[_0x9d40('0x43')](_[_0x9d40('0x4c')](_0x47ce97[_0x9d40('0x42')],_0x18bf45[_0x9d40('0x43')]),_0x92103);if(_0x47ce97['query'][_0x9d40('0x4d')]){_0x521c7b['where']=_[_0x9d40('0x4e')](_0x521c7b[_0x9d40('0x4b')],{'$or':_['map'](_0x92103,function(_0x51de5b){if(_0x51de5b[_0x9d40('0x4f')]!==_0x9d40('0x50')){var _0x23528a={};_0x23528a[_0x51de5b[_0x9d40('0x3a')]]={'$like':'%'+_0x47ce97[_0x9d40('0x42')][_0x9d40('0x4d')]+'%'};return _0x23528a;}})});}_0x521c7b=_[_0x9d40('0x4e')]({},_0x521c7b,_0x47ce97[_0x9d40('0x51')]);var _0xcc32c4={'where':_0x521c7b[_0x9d40('0x4b')]};return db['OpenchannelMessage'][_0x9d40('0x30')](_0xcc32c4)['then'](function(_0x104753){_0x3eaa5c[_0x9d40('0x30')]=_0x104753;if(_0x47ce97[_0x9d40('0x42')]['includeAll']){_0x521c7b[_0x9d40('0x52')]=[{'all':!![]}];}return db[_0x9d40('0x3e')][_0x9d40('0x53')](_0x521c7b);})['then'](function(_0xaf13a5){_0x3eaa5c[_0x9d40('0x54')]=_0xaf13a5;return _0x3eaa5c;})[_0x9d40('0x21')](respondWithFilteredResult(_0x51224b,_0x521c7b))[_0x9d40('0x55')](handleError(_0x51224b,null));};exports[_0x9d40('0x56')]=function(_0x4405b0,_0xa8df3d){var _0x266c22={'raw':!![],'where':{'id':_0x4405b0[_0x9d40('0x57')]['id']}},_0x4331c7={};_0x4331c7[_0x9d40('0x41')]=_[_0x9d40('0x58')](db[_0x9d40('0x3e')][_0x9d40('0x59')]);_0x4331c7[_0x9d40('0x42')]=_[_0x9d40('0x58')](_0x4405b0[_0x9d40('0x42')]);_0x4331c7[_0x9d40('0x43')]=_[_0x9d40('0x44')](_0x4331c7['model'],_0x4331c7['query']);_0x266c22[_0x9d40('0x45')]=_[_0x9d40('0x44')](_0x4331c7[_0x9d40('0x41')],qs[_0x9d40('0x5a')](_0x4405b0['query'][_0x9d40('0x5a')]));_0x266c22['attributes']=_0x266c22[_0x9d40('0x45')]['length']?_0x266c22[_0x9d40('0x45')]:_0x4331c7['model'];if(_0x4405b0[_0x9d40('0x42')][_0x9d40('0x5b')]){_0x266c22[_0x9d40('0x52')]=[{'all':!![]}];}_0x266c22=_[_0x9d40('0x4e')]({},_0x266c22,_0x4405b0[_0x9d40('0x51')]);return db['OpenchannelMessage'][_0x9d40('0x5c')](_0x266c22)[_0x9d40('0x21')](handleEntityNotFound(_0xa8df3d,null))[_0x9d40('0x21')](respondWithResult(_0xa8df3d,null))[_0x9d40('0x55')](handleError(_0xa8df3d,null));};exports[_0x9d40('0x5d')]=function(_0x51c67e,_0x1fc5ef){return db[_0x9d40('0x3e')]['create'](_0x51c67e['body'],{})[_0x9d40('0x21')](respondWithResult(_0x1fc5ef,0xc9))[_0x9d40('0x55')](handleError(_0x1fc5ef,null));};exports[_0x9d40('0x37')]=function(_0x4169fa,_0x46bde7){if(_0x4169fa['body']['id']){delete _0x4169fa['body']['id'];}return db[_0x9d40('0x3e')][_0x9d40('0x5c')]({'where':{'id':_0x4169fa[_0x9d40('0x57')]['id']}})[_0x9d40('0x21')](handleEntityNotFound(_0x46bde7,null))[_0x9d40('0x21')](saveUpdates(_0x4169fa[_0x9d40('0x5e')],null))[_0x9d40('0x21')](respondWithResult(_0x46bde7,null))[_0x9d40('0x55')](handleError(_0x46bde7,null));};exports[_0x9d40('0x38')]=function(_0x286e79,_0x51484e){return db[_0x9d40('0x3e')][_0x9d40('0x5c')]({'where':{'id':_0x286e79[_0x9d40('0x57')]['id']}})['then'](handleEntityNotFound(_0x51484e,null))[_0x9d40('0x21')](removeEntity(_0x51484e,null))[_0x9d40('0x55')](handleError(_0x51484e,null));};exports[_0x9d40('0x5f')]=function(_0x5658d5,_0x577ef8){return db[_0x9d40('0x3e')][_0x9d40('0x5f')]()[_0x9d40('0x21')](respondWithResult(_0x577ef8,null))[_0x9d40('0x55')](handleError(_0x577ef8,null));};var interaction_log=require(_0x9d40('0x11'))('openchannel-interactions');exports[_0x9d40('0x60')]=function(_0x5c8f64,_0x49f44a,_0x291048){var _0x4e7bcb={'agent':{},'channel':_0x9d40('0x61')};if(_0x5c8f64['body']['id']){delete _0x5c8f64[_0x9d40('0x5e')]['id'];}_0x5c8f64[_0x9d40('0x5e')][_0x9d40('0x62')]=!![];_0x5c8f64[_0x9d40('0x5e')][_0x9d40('0x63')]=moment()[_0x9d40('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c8f64['body'][_0x9d40('0x65')]=_0x5c8f64['body'][_0x9d40('0x65')]||_0x5c8f64[_0x9d40('0x66')]['id'];_0x4e7bcb[_0x9d40('0x67')]['id']=_0x5c8f64[_0x9d40('0x5e')][_0x9d40('0x65')];return db[_0x9d40('0x3e')][_0x9d40('0x5c')]({'where':{'id':_0x5c8f64[_0x9d40('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49f44a,null))['then'](saveUpdates(_0x5c8f64[_0x9d40('0x5e')],null))[_0x9d40('0x21')](function(_0x51c748){if(_0x51c748){_0x4e7bcb[_0x9d40('0x28')]=_0x51c748[_0x9d40('0x68')]({'plain':!![]});return db[_0x9d40('0x69')][_0x9d40('0x5c')]({'where':{'id':_0x51c748['OpenchannelInteractionId']}});}return null;})[_0x9d40('0x21')](handleEntityNotFound(_0x49f44a,null))['then'](function(_0x3b044a){if(_0x3b044a){return _0x3b044a[_0x9d40('0x37')]({'UserId':_0x5c8f64['body'][_0x9d40('0x65')],'read1stAt':_[_0x9d40('0x6a')](_0x3b044a[_0x9d40('0x6b')])?moment()[_0x9d40('0x64')](_0x9d40('0x6c')):undefined});}return null;})[_0x9d40('0x21')](function(_0x1760df){if(_0x1760df){_0x4e7bcb[_0x9d40('0x6d')]=_0x1760df[_0x9d40('0x68')]({'plain':!![]});interaction_log[_0x9d40('0x22')](_0x9d40('0x6e'),_0x5c8f64['user']['id'],_0x5c8f64[_0x9d40('0x66')][_0x9d40('0x3a')],_0x5c8f64[_0x9d40('0x66')][_0x9d40('0x6f')],_0x4e7bcb[_0x9d40('0x6d')]['id'],_0x5c8f64[_0x9d40('0x5e')]?JSON[_0x9d40('0x26')](_0x5c8f64[_0x9d40('0x5e')]):_0x9d40('0x70'));return respondWithRpcPromise('AcceptMessage',_0x9d40('0x71'),_0x4e7bcb);}return null;})[_0x9d40('0x21')](function(_0xb88a99){var _0x14650d=_0x9d40('0x72')+_0xb88a99[_0x9d40('0x28')][_0x9d40('0x73')];return db[_0x9d40('0x74')]['query'](_0x14650d,{'type':db[_0x9d40('0x75')]['QueryTypes'][_0x9d40('0x76')],'raw':!![]})[_0x9d40('0x21')](function(_0x3f3881){return _0x3f3881;});})[_0x9d40('0x21')](function(_0x504fc0){if(_0x504fc0){_0x4e7bcb[_0x9d40('0x28')][_0x9d40('0x77')]=_0x504fc0[0x0];if(!_0x5c8f64['body'][_0x9d40('0x65')])return;return db[_0x9d40('0x78')][_0x9d40('0x5c')]({'where':{'id':_0x5c8f64['body'][_0x9d40('0x65')],'role':_0x9d40('0x67')},'attributes':['id',_0x9d40('0x3a'),_0x9d40('0x79'),_0x9d40('0x7a'),'internal'],'raw':!![]});}return null;})['then'](function(_0x507cdd){if(!_0x507cdd)return null;_0x4e7bcb[_0x9d40('0x28')][_0x9d40('0x67')]=_0x507cdd;return _0x4e7bcb;})['then'](function(_0x3a6aae){if(_0x3a6aae){if(_0x5c8f64[_0x9d40('0x5e')][_0x9d40('0x7b')]){_0x4e7bcb[_0x9d40('0x28')][_0x9d40('0x7c')]=util[_0x9d40('0x64')](_0x9d40('0x7d'),_0x5c8f64[_0x9d40('0x66')][_0x9d40('0x3a')]);_0x4e7bcb['message']['channel']=_0x4e7bcb[_0x9d40('0x7e')];_0x4e7bcb[_0x9d40('0x28')][_0x9d40('0x7f')]=_0x4e7bcb[_0x9d40('0x7e')];_0x4e7bcb['message'][_0x9d40('0x80')]=_0x9d40('0x60');return respondWithRpcPromise(_0x9d40('0x81'),'EventManager',{'event':_0x9d40('0x82'),'message':_0x4e7bcb[_0x9d40('0x28')]},client9002)['then'](function(){return _0x4e7bcb;});}return _0x4e7bcb;}return null;})[_0x9d40('0x21')](respondWithResult(_0x49f44a,null))[_0x9d40('0x55')](handleError(_0x49f44a,null));};var interaction_log=require(_0x9d40('0x11'))(_0x9d40('0x83'));exports[_0x9d40('0x35')]=function(_0x3c8986,_0x2815f7,_0x38991d){var _0x55a9ad={'agent':{},'channel':_0x9d40('0x61')};if(_0x3c8986[_0x9d40('0x5e')]['id']){delete _0x3c8986['body']['id'];}_0x3c8986['body']['UserId']=_0x3c8986[_0x9d40('0x5e')][_0x9d40('0x65')]||_0x3c8986[_0x9d40('0x66')]['id'];_0x55a9ad['agent']['id']=_0x3c8986[_0x9d40('0x5e')][_0x9d40('0x65')];return db[_0x9d40('0x3e')][_0x9d40('0x5c')]({'where':{'id':_0x3c8986[_0x9d40('0x57')]['id'],'UserId':null}})[_0x9d40('0x21')](handleEntityNotFound(_0x2815f7,null))['then'](function(_0x4e0c10){if(_0x4e0c10){_0x55a9ad[_0x9d40('0x28')]=_0x4e0c10[_0x9d40('0x68')]({'plain':!![]});return db[_0x9d40('0x69')][_0x9d40('0x5c')]({'where':{'id':_0x4e0c10[_0x9d40('0x84')]}});}return null;})[_0x9d40('0x21')](handleEntityNotFound(_0x2815f7,null))[_0x9d40('0x21')](function(_0x92166e){if(_0x92166e){_0x55a9ad[_0x9d40('0x6d')]=_0x92166e[_0x9d40('0x68')]({'plain':!![]});interaction_log[_0x9d40('0x22')](_0x9d40('0x85'),_0x3c8986[_0x9d40('0x66')]['id'],_0x3c8986[_0x9d40('0x66')][_0x9d40('0x3a')],_0x3c8986['user'][_0x9d40('0x6f')],_0x55a9ad[_0x9d40('0x6d')]['id'],_0x3c8986[_0x9d40('0x5e')]?JSON[_0x9d40('0x26')](_0x3c8986['body']):_0x9d40('0x70'));return respondWithRpcPromise(_0x9d40('0x86'),'rejectMessage',_0x55a9ad);}return null;})[_0x9d40('0x21')](function(_0x195fdf){var _0x2072d7=_0x9d40('0x72')+_0x195fdf[_0x9d40('0x28')][_0x9d40('0x73')];return db[_0x9d40('0x74')][_0x9d40('0x42')](_0x2072d7,{'type':db[_0x9d40('0x75')][_0x9d40('0x87')][_0x9d40('0x76')],'raw':!![]})[_0x9d40('0x21')](function(_0x654e8a){return _0x654e8a;});})[_0x9d40('0x21')](function(_0x91551){if(_0x91551){_0x55a9ad[_0x9d40('0x28')][_0x9d40('0x77')]=_0x91551[0x0];if(!_0x3c8986[_0x9d40('0x5e')][_0x9d40('0x65')])return;return db[_0x9d40('0x78')]['find']({'where':{'id':_0x3c8986[_0x9d40('0x5e')][_0x9d40('0x65')],'role':'agent'},'attributes':['id','name',_0x9d40('0x79'),_0x9d40('0x7a'),_0x9d40('0x88')],'raw':!![]});}return null;})[_0x9d40('0x21')](function(_0x503dbc){if(!_0x503dbc)return null;_0x55a9ad[_0x9d40('0x28')]['agent']=_0x503dbc;return _0x55a9ad;})[_0x9d40('0x21')](function(_0x65f9fd){if(_0x65f9fd){_0x65f9fd[_0x9d40('0x28')]['interface']=util[_0x9d40('0x64')](_0x9d40('0x7d'),_0x3c8986[_0x9d40('0x66')]['name']);_0x65f9fd['message'][_0x9d40('0x7e')]=_0x55a9ad[_0x9d40('0x7e')];_0x65f9fd[_0x9d40('0x28')][_0x9d40('0x7f')]=_0x55a9ad[_0x9d40('0x7e')];_0x65f9fd['message'][_0x9d40('0x80')]=_0x9d40('0x35');respondWithRpcPromise(_0x9d40('0x81'),_0x9d40('0x81'),{'event':'rejectmessage','message':_0x65f9fd[_0x9d40('0x28')]},client9002);return _0x55a9ad;}return null;})['then'](respondWithResult(_0x2815f7,null))[_0x9d40('0x55')](handleError(_0x2815f7,null));};
\ No newline at end of file
+var _0xce79=['order','sort','where','filter','type','merge','options','include','OpenchannelMessage','findAll','rows','show','params','filters','fields','find','catch','create','body','describe','../../config/logger','accept','openchannel','read','readAt','format','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','internal','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty'];(function(_0x204ff0,_0x497802){var _0x3bdeb9=function(_0x53e00d){while(--_0x53e00d){_0x204ff0['push'](_0x204ff0['shift']());}};_0x3bdeb9(++_0x497802);}(_0xce79,0xc2));var _0x9ce7=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xce79[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0x9ce7('0x0'));var rimraf=require(_0x9ce7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ce7('0x2'));var rp=require(_0x9ce7('0x3'));var moment=require(_0x9ce7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9ce7('0x5'));var sox=require(_0x9ce7('0x6'));var csv=require(_0x9ce7('0x7'));var ejs=require(_0x9ce7('0x8'));var fs=require('fs');var fs_extra=require(_0x9ce7('0x9'));var _=require('lodash');var squel=require(_0x9ce7('0xa'));var crypto=require(_0x9ce7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9ce7('0xc'));var Papa=require(_0x9ce7('0xd'));var Redis=require(_0x9ce7('0xe'));var authService=require(_0x9ce7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9ce7('0x10'));var hardwareService=require(_0x9ce7('0x11'));var logger=require('../../config/logger')(_0x9ce7('0x12'));var utils=require(_0x9ce7('0x13'));var config=require(_0x9ce7('0x14'));var licenseUtil=require(_0x9ce7('0x15'));var db=require(_0x9ce7('0x16'))['db'];config['redis']=_[_0x9ce7('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9ce7('0x18'))(new Redis(config[_0x9ce7('0x19')]));require(_0x9ce7('0x1a'))[_0x9ce7('0x1b')](socket);var jayson=require(_0x9ce7('0x1c'));var client=jayson[_0x9ce7('0x1d')][_0x9ce7('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x9ce7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ce35d,_0x103fa6,_0x5ea9bb,_0x2e8dd6){return new BPromise(function(_0x1e2c94,_0x21893c){var _0x21dc5c=_0x2e8dd6||client;return _0x21dc5c[_0x9ce7('0x1f')](_0x5ce35d,_0x5ea9bb)[_0x9ce7('0x20')](function(_0x14d562){logger[_0x9ce7('0x21')](_0x9ce7('0x22'),_0x103fa6,_0x9ce7('0x23'));logger[_0x9ce7('0x24')](_0x9ce7('0x25'),_0x103fa6,_0x9ce7('0x23'),JSON['stringify'](_0x14d562));if(_0x14d562[_0x9ce7('0x26')]){if(_0x14d562[_0x9ce7('0x26')]['code']===0x1f4){logger[_0x9ce7('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x103fa6,_0x14d562['error'][_0x9ce7('0x27')]);return _0x21893c(_0x14d562['error']['message']);}logger[_0x9ce7('0x26')](_0x9ce7('0x22'),_0x103fa6,_0x14d562[_0x9ce7('0x26')][_0x9ce7('0x27')]);return _0x1e2c94(_0x14d562['error'][_0x9ce7('0x27')]);}else{logger[_0x9ce7('0x21')](_0x9ce7('0x22'),_0x103fa6,'request\x20sent');_0x1e2c94(_0x14d562[_0x9ce7('0x28')][_0x9ce7('0x27')]);}})['catch'](function(_0x441915){logger['error'](_0x9ce7('0x22'),_0x103fa6,_0x441915);_0x21893c(_0x441915);});});}function respondWithStatusCode(_0x3bd05a,_0x4d5d0f){_0x4d5d0f=_0x4d5d0f||0xcc;return function(_0x1ea68d){if(_0x1ea68d){return _0x3bd05a[_0x9ce7('0x29')](_0x4d5d0f);}return _0x3bd05a[_0x9ce7('0x2a')](_0x4d5d0f)[_0x9ce7('0x2b')]();};}function respondWithResult(_0x331a57,_0x390599){_0x390599=_0x390599||0xc8;return function(_0xe40c7b){if(_0xe40c7b){return _0x331a57['status'](_0x390599)['json'](_0xe40c7b);}};}function respondWithFilteredResult(_0x39db70,_0x3d48c4){return function(_0x4bef73){if(_0x4bef73){var _0xd9dba3=typeof _0x3d48c4['offset']===_0x9ce7('0x2c')&&typeof _0x3d48c4[_0x9ce7('0x2d')]===_0x9ce7('0x2c');var _0x56afaf=_0x4bef73[_0x9ce7('0x2e')];var _0x269d0e=_0xd9dba3?0x0:_0x3d48c4[_0x9ce7('0x2f')];var _0x494658=_0xd9dba3?_0x4bef73[_0x9ce7('0x2e')]:_0x3d48c4[_0x9ce7('0x2f')]+_0x3d48c4[_0x9ce7('0x2d')];var _0x5ee56c;if(_0x494658>=_0x56afaf){_0x494658=_0x56afaf;_0x5ee56c=0xc8;}else{_0x5ee56c=0xce;}_0x39db70[_0x9ce7('0x2a')](_0x5ee56c);return _0x39db70[_0x9ce7('0x30')](_0x9ce7('0x31'),_0x269d0e+'-'+_0x494658+'/'+_0x56afaf)[_0x9ce7('0x32')](_0x4bef73);}return null;};}function patchUpdates(_0x46bb2a){return function(_0x54cfca){try{jsonpatch[_0x9ce7('0x33')](_0x54cfca,_0x46bb2a,!![]);}catch(_0x7883bd){return BPromise[_0x9ce7('0x34')](_0x7883bd);}return _0x54cfca['save']();};}function saveUpdates(_0x3512e0,_0x5b7c4d){return function(_0x4354c3){if(_0x4354c3){return _0x4354c3[_0x9ce7('0x35')](_0x3512e0)['then'](function(_0x2fa584){return _0x2fa584;});}return null;};}function removeEntity(_0x50ef66,_0x4b217c){return function(_0x34c172){if(_0x34c172){return _0x34c172[_0x9ce7('0x36')]()[_0x9ce7('0x20')](function(){_0x50ef66[_0x9ce7('0x2a')](0xcc)[_0x9ce7('0x2b')]();});}};}function handleEntityNotFound(_0x36e158,_0x4808f5){return function(_0x42fe4f){if(!_0x42fe4f){_0x36e158[_0x9ce7('0x29')](0x194);}return _0x42fe4f;};}function handleError(_0xc11695,_0x5be869){_0x5be869=_0x5be869||0x1f4;return function(_0x469bc1){logger[_0x9ce7('0x26')](_0x469bc1[_0x9ce7('0x37')]);if(_0x469bc1[_0x9ce7('0x38')]){delete _0x469bc1[_0x9ce7('0x38')];}_0xc11695['status'](_0x5be869)[_0x9ce7('0x39')](_0x469bc1);};}exports[_0x9ce7('0x3a')]=function(_0x48b69e,_0x33a8ed){var _0x1ae85c={},_0xa7ceeb={},_0xe33b9={'count':0x0,'rows':[]};var _0xc63884=_[_0x9ce7('0x3b')](db['OpenchannelMessage'][_0x9ce7('0x3c')],function(_0x2669d6){return{'name':_0x2669d6[_0x9ce7('0x3d')],'type':_0x2669d6['type'][_0x9ce7('0x3e')]};});_0xa7ceeb[_0x9ce7('0x3f')]=_[_0x9ce7('0x3b')](_0xc63884,'name');_0xa7ceeb[_0x9ce7('0x40')]=_[_0x9ce7('0x41')](_0x48b69e[_0x9ce7('0x40')]);_0xa7ceeb['filters']=_['intersection'](_0xa7ceeb[_0x9ce7('0x3f')],_0xa7ceeb['query']);_0x1ae85c['attributes']=_[_0x9ce7('0x42')](_0xa7ceeb[_0x9ce7('0x3f')],qs['fields'](_0x48b69e['query']['fields']));_0x1ae85c[_0x9ce7('0x43')]=_0x1ae85c[_0x9ce7('0x43')][_0x9ce7('0x44')]?_0x1ae85c[_0x9ce7('0x43')]:_0xa7ceeb[_0x9ce7('0x3f')];if(!_0x48b69e[_0x9ce7('0x40')][_0x9ce7('0x45')]('nolimit')){_0x1ae85c['limit']=qs[_0x9ce7('0x2d')](_0x48b69e['query'][_0x9ce7('0x2d')]);_0x1ae85c[_0x9ce7('0x2f')]=qs['offset'](_0x48b69e[_0x9ce7('0x40')][_0x9ce7('0x2f')]);}_0x1ae85c[_0x9ce7('0x46')]=qs['sort'](_0x48b69e[_0x9ce7('0x40')][_0x9ce7('0x47')]);_0x1ae85c[_0x9ce7('0x48')]=qs['filters'](_['pick'](_0x48b69e['query'],_0xa7ceeb['filters']),_0xc63884);if(_0x48b69e[_0x9ce7('0x40')][_0x9ce7('0x49')]){_0x1ae85c['where']=_['merge'](_0x1ae85c[_0x9ce7('0x48')],{'$or':_[_0x9ce7('0x3b')](_0xc63884,function(_0x2576a1){if(_0x2576a1[_0x9ce7('0x4a')]!=='VIRTUAL'){var _0x5cb5ba={};_0x5cb5ba[_0x2576a1['name']]={'$like':'%'+_0x48b69e[_0x9ce7('0x40')][_0x9ce7('0x49')]+'%'};return _0x5cb5ba;}})});}_0x1ae85c=_[_0x9ce7('0x4b')]({},_0x1ae85c,_0x48b69e[_0x9ce7('0x4c')]);var _0x56cd53={'where':_0x1ae85c[_0x9ce7('0x48')]};return db['OpenchannelMessage'][_0x9ce7('0x2e')](_0x56cd53)['then'](function(_0xaeed3c){_0xe33b9['count']=_0xaeed3c;if(_0x48b69e[_0x9ce7('0x40')]['includeAll']){_0x1ae85c[_0x9ce7('0x4d')]=[{'all':!![]}];}return db[_0x9ce7('0x4e')][_0x9ce7('0x4f')](_0x1ae85c);})[_0x9ce7('0x20')](function(_0x16f19b){_0xe33b9[_0x9ce7('0x50')]=_0x16f19b;return _0xe33b9;})[_0x9ce7('0x20')](respondWithFilteredResult(_0x33a8ed,_0x1ae85c))['catch'](handleError(_0x33a8ed,null));};exports[_0x9ce7('0x51')]=function(_0x468eda,_0x58dca9){var _0x1ddf57={'raw':!![],'where':{'id':_0x468eda[_0x9ce7('0x52')]['id']}},_0x27208f={};_0x27208f[_0x9ce7('0x3f')]=_[_0x9ce7('0x41')](db['OpenchannelMessage'][_0x9ce7('0x3c')]);_0x27208f[_0x9ce7('0x40')]=_[_0x9ce7('0x41')](_0x468eda[_0x9ce7('0x40')]);_0x27208f[_0x9ce7('0x53')]=_[_0x9ce7('0x42')](_0x27208f[_0x9ce7('0x3f')],_0x27208f['query']);_0x1ddf57[_0x9ce7('0x43')]=_[_0x9ce7('0x42')](_0x27208f[_0x9ce7('0x3f')],qs['fields'](_0x468eda['query'][_0x9ce7('0x54')]));_0x1ddf57[_0x9ce7('0x43')]=_0x1ddf57[_0x9ce7('0x43')][_0x9ce7('0x44')]?_0x1ddf57[_0x9ce7('0x43')]:_0x27208f['model'];if(_0x468eda[_0x9ce7('0x40')]['includeAll']){_0x1ddf57[_0x9ce7('0x4d')]=[{'all':!![]}];}_0x1ddf57=_[_0x9ce7('0x4b')]({},_0x1ddf57,_0x468eda[_0x9ce7('0x4c')]);return db['OpenchannelMessage'][_0x9ce7('0x55')](_0x1ddf57)[_0x9ce7('0x20')](handleEntityNotFound(_0x58dca9,null))[_0x9ce7('0x20')](respondWithResult(_0x58dca9,null))[_0x9ce7('0x56')](handleError(_0x58dca9,null));};exports[_0x9ce7('0x57')]=function(_0x4fa2b4,_0xf1700c){return db['OpenchannelMessage'][_0x9ce7('0x57')](_0x4fa2b4['body'],{})[_0x9ce7('0x20')](respondWithResult(_0xf1700c,0xc9))[_0x9ce7('0x56')](handleError(_0xf1700c,null));};exports['update']=function(_0x4e7df3,_0x3e82c6){if(_0x4e7df3[_0x9ce7('0x58')]['id']){delete _0x4e7df3['body']['id'];}return db[_0x9ce7('0x4e')][_0x9ce7('0x55')]({'where':{'id':_0x4e7df3[_0x9ce7('0x52')]['id']}})[_0x9ce7('0x20')](handleEntityNotFound(_0x3e82c6,null))['then'](saveUpdates(_0x4e7df3[_0x9ce7('0x58')],null))[_0x9ce7('0x20')](respondWithResult(_0x3e82c6,null))[_0x9ce7('0x56')](handleError(_0x3e82c6,null));};exports[_0x9ce7('0x36')]=function(_0x79d28,_0xc82d5d){return db['OpenchannelMessage'][_0x9ce7('0x55')]({'where':{'id':_0x79d28[_0x9ce7('0x52')]['id']}})[_0x9ce7('0x20')](handleEntityNotFound(_0xc82d5d,null))[_0x9ce7('0x20')](removeEntity(_0xc82d5d,null))[_0x9ce7('0x56')](handleError(_0xc82d5d,null));};exports[_0x9ce7('0x59')]=function(_0x109f16,_0x83755f){return db[_0x9ce7('0x4e')][_0x9ce7('0x59')]()[_0x9ce7('0x20')](respondWithResult(_0x83755f,null))[_0x9ce7('0x56')](handleError(_0x83755f,null));};var interaction_log=require(_0x9ce7('0x5a'))('openchannel-interactions');exports[_0x9ce7('0x5b')]=function(_0x30ec14,_0x246196,_0x14a595){var _0x8cf1da={'agent':{},'channel':_0x9ce7('0x5c')};if(_0x30ec14[_0x9ce7('0x58')]['id']){delete _0x30ec14[_0x9ce7('0x58')]['id'];}_0x30ec14[_0x9ce7('0x58')][_0x9ce7('0x5d')]=!![];_0x30ec14[_0x9ce7('0x58')][_0x9ce7('0x5e')]=moment()[_0x9ce7('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x30ec14[_0x9ce7('0x58')]['UserId']=_0x30ec14['body'][_0x9ce7('0x60')]||_0x30ec14['user']['id'];_0x8cf1da[_0x9ce7('0x61')]['id']=_0x30ec14['body'][_0x9ce7('0x60')];return db[_0x9ce7('0x4e')]['find']({'where':{'id':_0x30ec14[_0x9ce7('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x246196,null))[_0x9ce7('0x20')](saveUpdates(_0x30ec14[_0x9ce7('0x58')],null))['then'](function(_0x44afc0){if(_0x44afc0){_0x8cf1da[_0x9ce7('0x27')]=_0x44afc0[_0x9ce7('0x62')]({'plain':!![]});return db[_0x9ce7('0x63')][_0x9ce7('0x55')]({'where':{'id':_0x44afc0[_0x9ce7('0x64')]}});}return null;})[_0x9ce7('0x20')](handleEntityNotFound(_0x246196,null))[_0x9ce7('0x20')](function(_0x31e82e){if(_0x31e82e){return _0x31e82e[_0x9ce7('0x35')]({'UserId':_0x30ec14[_0x9ce7('0x58')][_0x9ce7('0x60')],'read1stAt':_[_0x9ce7('0x65')](_0x31e82e[_0x9ce7('0x66')])?moment()[_0x9ce7('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1da9ec){if(_0x1da9ec){_0x8cf1da[_0x9ce7('0x67')]=_0x1da9ec[_0x9ce7('0x62')]({'plain':!![]});interaction_log[_0x9ce7('0x21')](_0x9ce7('0x68'),_0x30ec14[_0x9ce7('0x69')]['id'],_0x30ec14[_0x9ce7('0x69')][_0x9ce7('0x38')],_0x30ec14[_0x9ce7('0x69')]['role'],_0x8cf1da[_0x9ce7('0x67')]['id'],_0x30ec14[_0x9ce7('0x58')]?JSON[_0x9ce7('0x6a')](_0x30ec14['body']):_0x9ce7('0x6b'));return respondWithRpcPromise(_0x9ce7('0x6c'),_0x9ce7('0x6d'),_0x8cf1da);}return null;})['then'](function(_0x5e45ad){var _0x124890='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e45ad[_0x9ce7('0x27')][_0x9ce7('0x6e')];return db['sequelize'][_0x9ce7('0x40')](_0x124890,{'type':db[_0x9ce7('0x6f')][_0x9ce7('0x70')][_0x9ce7('0x71')],'raw':!![]})[_0x9ce7('0x20')](function(_0x3eaa64){return _0x3eaa64;});})[_0x9ce7('0x20')](function(_0x58f2eb){if(_0x58f2eb){_0x8cf1da[_0x9ce7('0x27')][_0x9ce7('0x72')]=_0x58f2eb[0x0];if(!_0x30ec14[_0x9ce7('0x58')][_0x9ce7('0x60')])return;return db['User'][_0x9ce7('0x55')]({'where':{'id':_0x30ec14[_0x9ce7('0x58')][_0x9ce7('0x60')],'role':'agent'},'attributes':['id',_0x9ce7('0x38'),_0x9ce7('0x73'),_0x9ce7('0x74'),'internal'],'raw':!![]});}return null;})[_0x9ce7('0x20')](function(_0x1f9cb8){if(!_0x1f9cb8)return null;_0x8cf1da[_0x9ce7('0x27')][_0x9ce7('0x61')]=_0x1f9cb8;return _0x8cf1da;})[_0x9ce7('0x20')](function(_0x1d7748){if(_0x1d7748){if(_0x30ec14[_0x9ce7('0x58')][_0x9ce7('0x75')]){_0x8cf1da['message'][_0x9ce7('0x76')]=util[_0x9ce7('0x5f')](_0x9ce7('0x77'),_0x30ec14['user'][_0x9ce7('0x38')]);_0x8cf1da['message']['channel']=_0x8cf1da[_0x9ce7('0x78')];_0x8cf1da[_0x9ce7('0x27')][_0x9ce7('0x79')]=_0x8cf1da[_0x9ce7('0x78')];_0x8cf1da['message'][_0x9ce7('0x7a')]=_0x9ce7('0x5b');return respondWithRpcPromise('EventManager',_0x9ce7('0x7b'),{'event':_0x9ce7('0x7c'),'message':_0x8cf1da[_0x9ce7('0x27')]},client9002)[_0x9ce7('0x20')](function(){return _0x8cf1da;});}return _0x8cf1da;}return null;})[_0x9ce7('0x20')](respondWithResult(_0x246196,null))[_0x9ce7('0x56')](handleError(_0x246196,null));};var interaction_log=require(_0x9ce7('0x5a'))(_0x9ce7('0x7d'));exports[_0x9ce7('0x34')]=function(_0x5ba692,_0x109cbd,_0x383eb8){var _0x53a3fa={'agent':{},'channel':_0x9ce7('0x5c')};if(_0x5ba692[_0x9ce7('0x58')]['id']){delete _0x5ba692['body']['id'];}_0x5ba692[_0x9ce7('0x58')][_0x9ce7('0x60')]=_0x5ba692[_0x9ce7('0x58')][_0x9ce7('0x60')]||_0x5ba692['user']['id'];_0x53a3fa[_0x9ce7('0x61')]['id']=_0x5ba692[_0x9ce7('0x58')][_0x9ce7('0x60')];return db[_0x9ce7('0x4e')][_0x9ce7('0x55')]({'where':{'id':_0x5ba692['params']['id'],'UserId':null}})[_0x9ce7('0x20')](handleEntityNotFound(_0x109cbd,null))[_0x9ce7('0x20')](function(_0x356bc2){if(_0x356bc2){_0x53a3fa[_0x9ce7('0x27')]=_0x356bc2[_0x9ce7('0x62')]({'plain':!![]});return db[_0x9ce7('0x63')][_0x9ce7('0x55')]({'where':{'id':_0x356bc2[_0x9ce7('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x109cbd,null))[_0x9ce7('0x20')](function(_0x575b1a){if(_0x575b1a){_0x53a3fa[_0x9ce7('0x67')]=_0x575b1a['get']({'plain':!![]});interaction_log[_0x9ce7('0x21')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5ba692['user']['id'],_0x5ba692[_0x9ce7('0x69')][_0x9ce7('0x38')],_0x5ba692[_0x9ce7('0x69')]['role'],_0x53a3fa['interaction']['id'],_0x5ba692[_0x9ce7('0x58')]?JSON[_0x9ce7('0x6a')](_0x5ba692[_0x9ce7('0x58')]):_0x9ce7('0x6b'));return respondWithRpcPromise(_0x9ce7('0x7e'),_0x9ce7('0x7f'),_0x53a3fa);}return null;})[_0x9ce7('0x20')](function(_0xb98fe0){var _0x24313f=_0x9ce7('0x80')+_0xb98fe0[_0x9ce7('0x27')][_0x9ce7('0x6e')];return db[_0x9ce7('0x81')]['query'](_0x24313f,{'type':db[_0x9ce7('0x6f')][_0x9ce7('0x70')][_0x9ce7('0x71')],'raw':!![]})['then'](function(_0x360387){return _0x360387;});})['then'](function(_0x37b905){if(_0x37b905){_0x53a3fa['message'][_0x9ce7('0x72')]=_0x37b905[0x0];if(!_0x5ba692[_0x9ce7('0x58')]['UserId'])return;return db[_0x9ce7('0x82')]['find']({'where':{'id':_0x5ba692['body'][_0x9ce7('0x60')],'role':_0x9ce7('0x61')},'attributes':['id',_0x9ce7('0x38'),_0x9ce7('0x73'),_0x9ce7('0x74'),_0x9ce7('0x83')],'raw':!![]});}return null;})[_0x9ce7('0x20')](function(_0x22fc9b){if(!_0x22fc9b)return null;_0x53a3fa[_0x9ce7('0x27')]['agent']=_0x22fc9b;return _0x53a3fa;})[_0x9ce7('0x20')](function(_0x4a4cc2){if(_0x4a4cc2){_0x4a4cc2[_0x9ce7('0x27')][_0x9ce7('0x76')]=util[_0x9ce7('0x5f')](_0x9ce7('0x77'),_0x5ba692[_0x9ce7('0x69')][_0x9ce7('0x38')]);_0x4a4cc2[_0x9ce7('0x27')]['channel']=_0x53a3fa[_0x9ce7('0x78')];_0x4a4cc2['message'][_0x9ce7('0x79')]=_0x53a3fa['channel'];_0x4a4cc2[_0x9ce7('0x27')][_0x9ce7('0x7a')]=_0x9ce7('0x34');respondWithRpcPromise('EventManager',_0x9ce7('0x7b'),{'event':'rejectmessage','message':_0x4a4cc2[_0x9ce7('0x27')]},client9002);return _0x53a3fa;}return null;})[_0x9ce7('0x20')](respondWithResult(_0x109cbd,null))['catch'](handleError(_0x109cbd,null));};
\ No newline at end of file
index e363be4..d382209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2444=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0xcfb748,_0x12afdb){var _0x5dfd80=function(_0x4240af){while(--_0x4240af){_0xcfb748['push'](_0xcfb748['shift']());}};_0x5dfd80(++_0x12afdb);}(_0x2444,0x19b));var _0x4244=function(_0x19d561,_0x1dc2fe){_0x19d561=_0x19d561-0x0;var _0x4e486f=_0x2444[_0x19d561];return _0x4e486f;};'use strict';var EventEmitter=require(_0x4244('0x0'));var OpenchannelMessage=require(_0x4244('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4244('0x2')](0x0);var events={'afterCreate':_0x4244('0x3'),'afterUpdate':_0x4244('0x4'),'afterDestroy':'remove'};function emitEvent(_0x175f99){return function(_0x45d2ad,_0x1bb338,_0xf465fd){OpenchannelMessageEvents[_0x4244('0x5')](_0x175f99+':'+_0x45d2ad['id'],_0x45d2ad);OpenchannelMessageEvents[_0x4244('0x5')](_0x175f99,_0x45d2ad);_0xf465fd(null);};}for(var e in events){if(events[_0x4244('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x4244('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xa1d7=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3ac2ed,_0x60b800){var _0x56b758=function(_0x1a02fb){while(--_0x1a02fb){_0x3ac2ed['push'](_0x3ac2ed['shift']());}};_0x56b758(++_0x60b800);}(_0xa1d7,0x1b7));var _0x7a1d=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0xa1d7[_0x3fa7d3];return _0x4c51bd;};'use strict';var EventEmitter=require(_0x7a1d('0x0'));var OpenchannelMessage=require(_0x7a1d('0x1'))['db'][_0x7a1d('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7a1d('0x3')](0x0);var events={'afterCreate':_0x7a1d('0x4'),'afterUpdate':_0x7a1d('0x5'),'afterDestroy':_0x7a1d('0x6')};function emitEvent(_0x231844){return function(_0x41e41c,_0x4ecae0,_0x385a9f){OpenchannelMessageEvents[_0x7a1d('0x7')](_0x231844+':'+_0x41e41c['id'],_0x41e41c);OpenchannelMessageEvents['emit'](_0x231844,_0x41e41c);_0x385a9f(null);};}for(var e in events){if(events[_0x7a1d('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x7a1d('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
index 2b15026..9945832 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','omit','POST','method','GET','format','threadId','inspect','finally','utf8mb4','lodash','api','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xefda,0x96));var _0xaefd=function(_0x3e3a7e,_0xb0ecbd){_0x3e3a7e=_0x3e3a7e-0x0;var _0x4bd6b2=_0xefda[_0x3e3a7e];return _0x4bd6b2;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xaefd('0xc')],'type':_0xaefd('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x463ce7,_0x4d44ed,_0x48a255){var _0x54a3b1=_0x497258[_0xaefd('0xe')];var _0x16b36e=_0x463ce7[_0xaefd('0xf')]({'plain':!![]});if(_0x16b36e[_0xaefd('0x10')][_0xaefd('0x11')]()==='in'||_0x16b36e[_0xaefd('0x10')][_0xaefd('0x11')]()===_0xaefd('0x12')&&!_0x16b36e[_0xaefd('0x13')]&&!_[_0xaefd('0x14')](_0x16b36e[_0xaefd('0x15')])){_0x54a3b1['OpenchannelInteraction'][_0xaefd('0x16')]({'where':{'id':_0x16b36e['OpenchannelInteractionId']}})[_0xaefd('0x17')](function(_0x1725af){if(_0x1725af){_0x1725af[_0xaefd('0x18')]({'lastMsgAt':_0x16b36e[_0xaefd('0x19')],'lastMsgDirection':_0x16b36e['direction'][_0xaefd('0x11')]()});}})[_0xaefd('0x1a')](function(_0x41f345){console[_0xaefd('0x1b')](_0x41f345);});}if(_0x16b36e[_0xaefd('0x10')]===_0xaefd('0x12')&&!_0x16b36e[_0xaefd('0x13')]){var _0x23d736;_0x54a3b1['CmContact'][_0xaefd('0x1c')]()[_0xaefd('0x17')](function(_0x9748f4){return _0x54a3b1[_0xaefd('0x1d')][_0xaefd('0x1e')]({'where':{'id':_0x16b36e[_0xaefd('0x1f')]},'include':[{'model':_0x54a3b1['OpenchannelInteraction'],'as':_0xaefd('0x20'),'where':{'id':_0x16b36e[_0xaefd('0x21')]},'limit':0x1,'include':[{'model':_0x54a3b1[_0xaefd('0x22')],'as':_0xaefd('0x23'),'attributes':_[_0xaefd('0x24')](_0x9748f4)}]}]});})[_0xaefd('0x17')](function(_0x5282ed){_0x23d736=_0x5282ed[_0xaefd('0xf')]({'plain':!![]});if(_0x23d736&&_0x23d736[_0xaefd('0x25')]){logger[_0xaefd('0x26')](_0xaefd('0x27'),_0xaefd('0x28'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x16b36e['id'],_0x23d736['replyUri']));if(_0x23d736[_0xaefd('0x20')]&&_0x23d736[_0xaefd('0x20')][_0xaefd('0x29')]){_0x16b36e['Interaction']=_[_0xaefd('0x2a')](_0x23d736['Interactions'][0x0],_0xaefd('0x23'));_0x16b36e[_0xaefd('0x23')]=_0x23d736[_0xaefd('0x20')][0x0]['Contact'];}var _0x4d44ed={'method':_0xaefd('0x2b'),'uri':encodeURI(_0x23d736[_0xaefd('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4d44ed[_0xaefd('0x2c')]){case _0xaefd('0x2d'):_0x4d44ed['qs']=_0x16b36e;break;case'POST':_0x4d44ed[_0xaefd('0xc')]=_0x16b36e;break;}return rp(_0x4d44ed)['then'](function(_0x810bf){logger[_0xaefd('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0xaefd('0x28'),util[_0xaefd('0x2e')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x16b36e['id'],_0x23d736[_0xaefd('0x25')]));if(_0x810bf[_0xaefd('0xc')][_0xaefd('0x2f')]&&_0x810bf['body'][_0xaefd('0x2f')]!=_0x16b36e['Interaction'][_0xaefd('0x2f')]){return _0x54a3b1['OpenchannelInteraction']['update']({'threadId':_0x810bf[_0xaefd('0xc')][_0xaefd('0x2f')]},{'logging':!![],'where':{'id':_0x16b36e['Interaction']['id']}});}else{return;}})['then'](function(){return _0x463ce7['update']({'read':!![]});})[_0xaefd('0x1a')](function(_0x280eab){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xaefd('0x28'),util[_0xaefd('0x30')](_0x280eab,{'showHidden':![],'depth':null}));_0x48a255();});}else{_0x48a255();}})[_0xaefd('0x31')](function(){_0x48a255();});}else{_0x48a255();}}},'charset':_0xaefd('0x32'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5eb8=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','omit','POST','method','GET','info','body','Interaction','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','then','update','createdAt','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys'];(function(_0x2952fd,_0x4525ed){var _0x4792b3=function(_0x260416){while(--_0x260416){_0x2952fd['push'](_0x2952fd['shift']());}};_0x4792b3(++_0x4525ed);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1fd3e2,_0x1a6772){_0x1fd3e2=_0x1fd3e2-0x0;var _0x5a9210=_0x5eb8[_0x1fd3e2];return _0x5a9210;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[{'name':_0x85eb('0xc'),'fields':['body'],'type':_0x85eb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50ea77,_0x1f0036,_0x40d6b6){var _0x673228=_0x2bf83c[_0x85eb('0xe')];var _0x1dacf2=_0x50ea77[_0x85eb('0xf')]({'plain':!![]});if(_0x1dacf2[_0x85eb('0x10')]['toLowerCase']()==='in'||_0x1dacf2[_0x85eb('0x10')][_0x85eb('0x11')]()==='out'&&!_0x1dacf2[_0x85eb('0x12')]&&!_[_0x85eb('0x13')](_0x1dacf2[_0x85eb('0x14')])){_0x673228[_0x85eb('0x15')]['findOne']({'where':{'id':_0x1dacf2['OpenchannelInteractionId']}})[_0x85eb('0x16')](function(_0x5c760a){if(_0x5c760a){_0x5c760a[_0x85eb('0x17')]({'lastMsgAt':_0x1dacf2[_0x85eb('0x18')],'lastMsgDirection':_0x1dacf2[_0x85eb('0x10')][_0x85eb('0x11')]()});}})[_0x85eb('0x19')](function(_0x49efdf){console[_0x85eb('0x1a')](_0x49efdf);});}if(_0x1dacf2['direction']===_0x85eb('0x1b')&&!_0x1dacf2[_0x85eb('0x12')]){var _0x3e23e8;_0x673228[_0x85eb('0x1c')]['describe']()['then'](function(_0x50d2a8){return _0x673228[_0x85eb('0x1d')][_0x85eb('0x1e')]({'where':{'id':_0x1dacf2[_0x85eb('0x1f')]},'include':[{'model':_0x673228[_0x85eb('0x15')],'as':_0x85eb('0x20'),'where':{'id':_0x1dacf2[_0x85eb('0x21')]},'limit':0x1,'include':[{'model':_0x673228['CmContact'],'as':_0x85eb('0x22'),'attributes':_[_0x85eb('0x23')](_0x50d2a8)}]}]});})[_0x85eb('0x16')](function(_0x4e8041){_0x3e23e8=_0x4e8041['get']({'plain':!![]});if(_0x3e23e8&&_0x3e23e8['replyUri']){logger['info'](_0x85eb('0x24'),_0x85eb('0x25'),util[_0x85eb('0x26')](_0x85eb('0x27'),_0x1dacf2['id'],_0x3e23e8[_0x85eb('0x28')]));if(_0x3e23e8[_0x85eb('0x20')]&&_0x3e23e8['Interactions']['length']){_0x1dacf2['Interaction']=_[_0x85eb('0x29')](_0x3e23e8[_0x85eb('0x20')][0x0],_0x85eb('0x22'));_0x1dacf2[_0x85eb('0x22')]=_0x3e23e8[_0x85eb('0x20')][0x0][_0x85eb('0x22')];}var _0x1f0036={'method':_0x85eb('0x2a'),'uri':encodeURI(_0x3e23e8[_0x85eb('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1f0036[_0x85eb('0x2b')]){case _0x85eb('0x2c'):_0x1f0036['qs']=_0x1dacf2;break;case _0x85eb('0x2a'):_0x1f0036['body']=_0x1dacf2;break;}return rp(_0x1f0036)[_0x85eb('0x16')](function(_0x792d3a){logger[_0x85eb('0x2d')](_0x85eb('0x24'),_0x85eb('0x25'),util[_0x85eb('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1dacf2['id'],_0x3e23e8['replyUri']));if(_0x792d3a[_0x85eb('0x2e')]['threadId']&&_0x792d3a[_0x85eb('0x2e')]['threadId']!=_0x1dacf2[_0x85eb('0x2f')][_0x85eb('0x30')]){return _0x673228[_0x85eb('0x15')][_0x85eb('0x17')]({'threadId':_0x792d3a[_0x85eb('0x2e')][_0x85eb('0x30')]},{'logging':!![],'where':{'id':_0x1dacf2[_0x85eb('0x2f')]['id']}});}else{return;}})['then'](function(){return _0x50ea77[_0x85eb('0x17')]({'read':!![]});})[_0x85eb('0x19')](function(_0x515ee9){logger[_0x85eb('0x1a')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x85eb('0x31')](_0x515ee9,{'showHidden':![],'depth':null}));_0x40d6b6();});}else{_0x40d6b6();}})[_0x85eb('0x32')](function(){_0x40d6b6();});}else{_0x40d6b6();}}},'charset':_0x85eb('0x33'),'collate':_0x85eb('0x34')});};
\ No newline at end of file
index 37288d4..1d95ec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x4daf12,_0xd4ac99){var _0x1d9c23=function(_0x130bee){while(--_0x130bee){_0x4daf12['push'](_0x4daf12['shift']());}};_0x1d9c23(++_0xd4ac99);}(_0xadb5,0xad));var _0x5adb=function(_0x5ba0c7,_0x17336e){_0x5ba0c7=_0x5ba0c7-0x0;var _0x38eace=_0xadb5[_0x5ba0c7];return _0x38eace;};'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
+var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x559a98,_0x46765f){var _0x12d5a0=function(_0x38e1e2){while(--_0x38e1e2){_0x559a98['push'](_0x559a98['shift']());}};_0x12d5a0(++_0x46765f);}(_0x2ef3,0xba));var _0x32ef=function(_0xfd0be1,_0x10161d){_0xfd0be1=_0xfd0be1-0x0;var _0x4dfd72=_0x2ef3[_0xfd0be1];return _0x4dfd72;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});};
\ No newline at end of file
index 05b38e1..aa17ca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3989=['register','openchannelMessage:','./openchannelMessage.events','remove','update','emit','removeListener'];(function(_0x10cf5d,_0x396a02){var _0x5b9d4b=function(_0x5dd2e2){while(--_0x5dd2e2){_0x10cf5d['push'](_0x10cf5d['shift']());}};_0x5b9d4b(++_0x396a02);}(_0x3989,0x12f));var _0x9398=function(_0x1a4f93,_0x2b0ddf){_0x1a4f93=_0x1a4f93-0x0;var _0x55e857=_0x3989[_0x1a4f93];return _0x55e857;};'use strict';var OpenchannelMessageEvents=require(_0x9398('0x0'));var events=['save',_0x9398('0x1'),_0x9398('0x2')];function createListener(_0x207564,_0x12dfa2){return function(_0x124cda){_0x12dfa2[_0x9398('0x3')](_0x207564,_0x124cda);};}function removeListener(_0x4759ec,_0x2f9145){return function(){OpenchannelMessageEvents[_0x9398('0x4')](_0x4759ec,_0x2f9145);};}exports[_0x9398('0x5')]=function(_0x1456ab){for(var _0x39dbc7=0x0,_0x590683=events['length'];_0x39dbc7<_0x590683;_0x39dbc7++){var _0x13caf5=events[_0x39dbc7];var _0x203d1e=createListener(_0x9398('0x6')+_0x13caf5,_0x1456ab);OpenchannelMessageEvents['on'](_0x13caf5,_0x203d1e);}};
\ No newline at end of file
+var _0xec13=['save','remove','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x1452e7,_0x1c1b1c){var _0x44d459=function(_0x4adcc9){while(--_0x4adcc9){_0x1452e7['push'](_0x1452e7['shift']());}};_0x44d459(++_0x1c1b1c);}(_0xec13,0x8f));var _0x3ec1=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xec13[_0x110c3d];return _0x226d67;};'use strict';var OpenchannelMessageEvents=require(_0x3ec1('0x0'));var events=[_0x3ec1('0x1'),_0x3ec1('0x2'),'update'];function createListener(_0x261351,_0x28e1ac){return function(_0x381387){_0x28e1ac['emit'](_0x261351,_0x381387);};}function removeListener(_0x201bfb,_0x46e3c8){return function(){OpenchannelMessageEvents['removeListener'](_0x201bfb,_0x46e3c8);};}exports[_0x3ec1('0x3')]=function(_0x3e34f8){for(var _0x44c946=0x0,_0x5d5a4b=events[_0x3ec1('0x4')];_0x44c946<_0x5d5a4b;_0x44c946++){var _0x2a744c=events[_0x44c946];var _0x4e08b4=createListener(_0x3ec1('0x5')+_0x2a744c,_0x3e34f8);OpenchannelMessageEvents['on'](_0x2a744c,_0x4e08b4);}};
\ No newline at end of file
index ce904f4..d96e412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf961=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','exports','multer'];(function(_0x57cde5,_0x2e5f0c){var _0x3663fe=function(_0x975c78){while(--_0x975c78){_0x57cde5['push'](_0x57cde5['shift']());}};_0x3663fe(++_0x2e5f0c);}(_0xf961,0x86));var _0x1f96=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xf961[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require(_0x1f96('0x0'));var util=require('util');var path=require(_0x1f96('0x1'));var timeout=require(_0x1f96('0x2'));var express=require('express');var router=express[_0x1f96('0x3')]();var fs_extra=require(_0x1f96('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1f96('0x5'));var config=require(_0x1f96('0x6'));var controller=require(_0x1f96('0x7'));router['get']('/',auth[_0x1f96('0x8')](),controller[_0x1f96('0x9')]);router['get']('/describe',auth[_0x1f96('0x8')](),controller['describe']);router[_0x1f96('0xa')](_0x1f96('0xb'),auth[_0x1f96('0x8')](),controller[_0x1f96('0xc')]);router[_0x1f96('0xa')](_0x1f96('0xd'),auth[_0x1f96('0x8')](),controller[_0x1f96('0xe')]);router[_0x1f96('0xa')](_0x1f96('0xf'),auth[_0x1f96('0x8')](),controller[_0x1f96('0x10')]);router[_0x1f96('0xa')](_0x1f96('0x11'),auth[_0x1f96('0x8')](),controller[_0x1f96('0x12')]);router[_0x1f96('0x13')]('/',auth[_0x1f96('0x8')](),controller[_0x1f96('0x14')]);router[_0x1f96('0x13')](_0x1f96('0xf'),auth[_0x1f96('0x8')](),controller[_0x1f96('0x15')]);router['post'](_0x1f96('0x11'),auth[_0x1f96('0x8')](),controller[_0x1f96('0x16')]);router[_0x1f96('0x17')]('/:id',auth[_0x1f96('0x8')](),controller['update']);router[_0x1f96('0x18')](_0x1f96('0xb'),auth[_0x1f96('0x8')](),controller[_0x1f96('0x19')]);router[_0x1f96('0x18')](_0x1f96('0xf'),auth[_0x1f96('0x8')](),controller['removeTeams']);router[_0x1f96('0x18')](_0x1f96('0x11'),auth[_0x1f96('0x8')](),controller['removeAgents']);module[_0x1f96('0x1a')]=router;
\ No newline at end of file
+var _0x9acb=['index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get'];(function(_0x1ef2b9,_0x2c65e5){var _0x4f0cf2=function(_0x520ff0){while(--_0x520ff0){_0x1ef2b9['push'](_0x1ef2b9['shift']());}};_0x4f0cf2(++_0x2c65e5);}(_0x9acb,0xfd));var _0xb9ac=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x9acb[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0xb9ac('0x0'));var util=require(_0xb9ac('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb9ac('0x2')]();var fs_extra=require(_0xb9ac('0x3'));var auth=require(_0xb9ac('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb9ac('0x5'));var controller=require(_0xb9ac('0x6'));router[_0xb9ac('0x7')]('/',auth['isAuthenticated'](),controller[_0xb9ac('0x8')]);router['get'](_0xb9ac('0x9'),auth[_0xb9ac('0xa')](),controller['describe']);router[_0xb9ac('0x7')](_0xb9ac('0xb'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0xc')]);router[_0xb9ac('0x7')](_0xb9ac('0xd'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0xe')]);router['get'](_0xb9ac('0xf'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x10')]);router['get']('/:id/users',auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x11')]);router[_0xb9ac('0x12')]('/',auth['isAuthenticated'](),controller[_0xb9ac('0x13')]);router[_0xb9ac('0x12')](_0xb9ac('0xf'),auth['isAuthenticated'](),controller[_0xb9ac('0x14')]);router[_0xb9ac('0x12')](_0xb9ac('0x15'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x16')]);router['put'](_0xb9ac('0xb'),auth['isAuthenticated'](),controller[_0xb9ac('0x17')]);router[_0xb9ac('0x18')]('/:id',auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x19')]);router['delete'](_0xb9ac('0xf'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x1a')]);router[_0xb9ac('0x18')](_0xb9ac('0x15'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x1b')]);module[_0xb9ac('0x1c')]=router;
\ No newline at end of file
index 533e9a7..9b0c8fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c03=['sequelize','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x5f4334,_0x5557e2){var _0x106062=function(_0x57aadc){while(--_0x57aadc){_0x5f4334['push'](_0x5f4334['shift']());}};_0x106062(++_0x5557e2);}(_0x8c03,0xee));var _0x38c0=function(_0x4dc524,_0x5ac646){_0x4dc524=_0x4dc524-0x0;var _0x26aee4=_0x8c03[_0x4dc524];return _0x26aee4;};'use strict';var Sequelize=require(_0x38c0('0x0'));module['exports']={'name':{'type':Sequelize[_0x38c0('0x1')],'unique':_0x38c0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x38c0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x38c0('0x4')]('rrmemory',_0x38c0('0x5'),_0x38c0('0x6'))}};
\ No newline at end of file
+var _0x675c=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x993135,_0x7777fa){var _0x4f8c24=function(_0x291ed8){while(--_0x291ed8){_0x993135['push'](_0x993135['shift']());}};_0x4f8c24(++_0x7777fa);}(_0x675c,0x188));var _0xc675=function(_0xbd0f5e,_0x411656){_0xbd0f5e=_0xbd0f5e-0x0;var _0x530a3f=_0x675c[_0xbd0f5e];return _0x530a3f;};'use strict';var Sequelize=require(_0xc675('0x0'));module[_0xc675('0x1')]={'name':{'type':Sequelize[_0xc675('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc675('0x2')]},'timeout':{'type':Sequelize[_0xc675('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc675('0x4')](_0xc675('0x5'),_0xc675('0x6'),'roundrobin')}};
\ No newline at end of file
index bc3c94b..8306808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92e6=['SELECT','every','TeamId','includes','all','compact','isEmpty','removeAgents','userOpenchannelQueue:remove','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./openchannelQueue.socket','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','reject','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','name','send','index','OpenchannelQueue','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','options','rows','catch','params','rawAttributes','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','keys','UserOpenchannelQueue','hasOwnProperty','nolimit','order','OpenchannelQueueId','findAll','User','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes'];(function(_0xf60cd0,_0x34bf81){var _0x32ad56=function(_0x44cf0b){while(--_0x44cf0b){_0xf60cd0['push'](_0xf60cd0['shift']());}};_0x32ad56(++_0x34bf81);}(_0x92e6,0x127));var _0x692e=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x92e6[_0x1283d4];return _0x433643;};'use strict';var emlformat=require(_0x692e('0x0'));var rimraf=require(_0x692e('0x1'));var zipdir=require(_0x692e('0x2'));var jsonpatch=require(_0x692e('0x3'));var rp=require('request-promise');var moment=require(_0x692e('0x4'));var BPromise=require(_0x692e('0x5'));var Mustache=require(_0x692e('0x6'));var util=require(_0x692e('0x7'));var path=require(_0x692e('0x8'));var sox=require('sox');var csv=require(_0x692e('0x9'));var ejs=require(_0x692e('0xa'));var fs=require('fs');var fs_extra=require(_0x692e('0xb'));var _=require(_0x692e('0xc'));var squel=require(_0x692e('0xd'));var crypto=require(_0x692e('0xe'));var jsforce=require(_0x692e('0xf'));var deskjs=require(_0x692e('0x10'));var toCsv=require(_0x692e('0x9'));var querystring=require(_0x692e('0x11'));var Papa=require(_0x692e('0x12'));var Redis=require('ioredis');var authService=require(_0x692e('0x13'));var qs=require(_0x692e('0x14'));var as=require(_0x692e('0x15'));var hardwareService=require(_0x692e('0x16'));var logger=require(_0x692e('0x17'))(_0x692e('0x18'));var utils=require(_0x692e('0x19'));var config=require(_0x692e('0x1a'));var licenseUtil=require(_0x692e('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x692e('0x1c')](config[_0x692e('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x692e('0x1e'))(new Redis(config[_0x692e('0x1d')]));require(_0x692e('0x1f'))['register'](socket);function respondWithStatusCode(_0xf3efc5,_0x1019b8){_0x1019b8=_0x1019b8||0xcc;return function(_0x540308){if(_0x540308){return _0xf3efc5[_0x692e('0x20')](_0x1019b8);}return _0xf3efc5['status'](_0x1019b8)[_0x692e('0x21')]();};}function respondWithResult(_0x43a291,_0x9f3424){_0x9f3424=_0x9f3424||0xc8;return function(_0x53f347){if(_0x53f347){return _0x43a291['status'](_0x9f3424)[_0x692e('0x22')](_0x53f347);}};}function respondWithFilteredResult(_0x5e6ee6,_0x3ac87e){return function(_0x5bf2ea){if(_0x5bf2ea){var _0x14a0e3=typeof _0x3ac87e['offset']==='undefined'&&typeof _0x3ac87e['limit']===_0x692e('0x23');var _0x4761c2=_0x5bf2ea[_0x692e('0x24')];var _0x8cad30=_0x14a0e3?0x0:_0x3ac87e[_0x692e('0x25')];var _0x38e8b3=_0x14a0e3?_0x5bf2ea[_0x692e('0x24')]:_0x3ac87e[_0x692e('0x25')]+_0x3ac87e[_0x692e('0x26')];var _0x5ae65b;if(_0x38e8b3>=_0x4761c2){_0x38e8b3=_0x4761c2;_0x5ae65b=0xc8;}else{_0x5ae65b=0xce;}_0x5e6ee6[_0x692e('0x27')](_0x5ae65b);return _0x5e6ee6[_0x692e('0x28')](_0x692e('0x29'),_0x8cad30+'-'+_0x38e8b3+'/'+_0x4761c2)[_0x692e('0x22')](_0x5bf2ea);}return null;};}function patchUpdates(_0x518320){return function(_0x38a421){try{jsonpatch['apply'](_0x38a421,_0x518320,!![]);}catch(_0x48a5a6){return BPromise[_0x692e('0x2a')](_0x48a5a6);}return _0x38a421[_0x692e('0x2b')]();};}function saveUpdates(_0x37325e,_0x3f024f){return function(_0x56cf10){if(_0x56cf10){return _0x56cf10[_0x692e('0x2c')](_0x37325e)['then'](function(_0x44a520){return _0x44a520;});}return null;};}function removeEntity(_0x18c19b,_0x5ddba6){return function(_0x353c1e){if(_0x353c1e){return _0x353c1e[_0x692e('0x2d')]()[_0x692e('0x2e')](function(){var _0x14a8c9=_0x353c1e[_0x692e('0x2f')]({'plain':!![]});var _0x3fc164=_0x692e('0x30');return db[_0x692e('0x31')][_0x692e('0x2d')]({'where':{'type':_0x3fc164,'resourceId':_0x14a8c9['id']}})['then'](function(){return _0x353c1e;});})['then'](function(){_0x18c19b[_0x692e('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ec0f,_0x458298){return function(_0x4d91d3){if(!_0x4d91d3){_0x32ec0f['sendStatus'](0x194);}return _0x4d91d3;};}function handleError(_0x376e5a,_0x56f54c){_0x56f54c=_0x56f54c||0x1f4;return function(_0xe59bb5){logger['error'](_0xe59bb5['stack']);if(_0xe59bb5['name']){delete _0xe59bb5[_0x692e('0x32')];}_0x376e5a['status'](_0x56f54c)[_0x692e('0x33')](_0xe59bb5);};}exports[_0x692e('0x34')]=function(_0x273789,_0x97451e){var _0x43dfcf={},_0x261bf9={},_0x2ad777={'count':0x0,'rows':[]};var _0x260a8c=_['map'](db[_0x692e('0x35')]['rawAttributes'],function(_0xeb4101){return{'name':_0xeb4101[_0x692e('0x36')],'type':_0xeb4101[_0x692e('0x37')][_0x692e('0x38')]};});_0x261bf9[_0x692e('0x39')]=_[_0x692e('0x3a')](_0x260a8c,_0x692e('0x32'));_0x261bf9[_0x692e('0x3b')]=_['keys'](_0x273789[_0x692e('0x3b')]);_0x261bf9[_0x692e('0x3c')]=_['intersection'](_0x261bf9[_0x692e('0x39')],_0x261bf9[_0x692e('0x3b')]);_0x43dfcf[_0x692e('0x3d')]=_[_0x692e('0x3e')](_0x261bf9[_0x692e('0x39')],qs[_0x692e('0x3f')](_0x273789[_0x692e('0x3b')][_0x692e('0x3f')]));_0x43dfcf[_0x692e('0x3d')]=_0x43dfcf[_0x692e('0x3d')][_0x692e('0x40')]?_0x43dfcf[_0x692e('0x3d')]:_0x261bf9['model'];if(!_0x273789[_0x692e('0x3b')]['hasOwnProperty']('nolimit')){_0x43dfcf[_0x692e('0x26')]=qs[_0x692e('0x26')](_0x273789[_0x692e('0x3b')]['limit']);_0x43dfcf[_0x692e('0x25')]=qs['offset'](_0x273789[_0x692e('0x3b')][_0x692e('0x25')]);}_0x43dfcf['order']=qs[_0x692e('0x41')](_0x273789[_0x692e('0x3b')][_0x692e('0x41')]);_0x43dfcf[_0x692e('0x42')]=qs[_0x692e('0x3c')](_[_0x692e('0x43')](_0x273789[_0x692e('0x3b')],_0x261bf9[_0x692e('0x3c')]),_0x260a8c);if(_0x273789[_0x692e('0x3b')][_0x692e('0x44')]){_0x43dfcf[_0x692e('0x42')]=_[_0x692e('0x45')](_0x43dfcf[_0x692e('0x42')],{'$or':_[_0x692e('0x3a')](_0x260a8c,function(_0x49897b){if(_0x49897b['type']!=='VIRTUAL'){var _0x5ceea6={};_0x5ceea6[_0x49897b['name']]={'$like':'%'+_0x273789['query'][_0x692e('0x44')]+'%'};return _0x5ceea6;}})});}_0x43dfcf=_[_0x692e('0x45')]({},_0x43dfcf,_0x273789[_0x692e('0x46')]);var _0x3ea7c2={'where':_0x43dfcf[_0x692e('0x42')]};return db[_0x692e('0x35')]['count'](_0x3ea7c2)[_0x692e('0x2e')](function(_0x1f9bba){_0x2ad777[_0x692e('0x24')]=_0x1f9bba;if(_0x273789[_0x692e('0x3b')]['includeAll']){_0x43dfcf['include']=[{'all':!![]}];}return db[_0x692e('0x35')]['findAll'](_0x43dfcf);})['then'](function(_0x2803ee){_0x2ad777[_0x692e('0x47')]=_0x2803ee;return _0x2ad777;})[_0x692e('0x2e')](respondWithFilteredResult(_0x97451e,_0x43dfcf))[_0x692e('0x48')](handleError(_0x97451e,null));};exports['show']=function(_0x23528c,_0x44ae99){var _0x259fb8={'raw':!![],'where':{'id':_0x23528c[_0x692e('0x49')]['id']}},_0x17c506={};_0x17c506[_0x692e('0x39')]=_['keys'](db['OpenchannelQueue'][_0x692e('0x4a')]);_0x17c506[_0x692e('0x3b')]=_['keys'](_0x23528c[_0x692e('0x3b')]);_0x17c506['filters']=_[_0x692e('0x3e')](_0x17c506['model'],_0x17c506[_0x692e('0x3b')]);_0x259fb8[_0x692e('0x3d')]=_[_0x692e('0x3e')](_0x17c506[_0x692e('0x39')],qs[_0x692e('0x3f')](_0x23528c[_0x692e('0x3b')][_0x692e('0x3f')]));_0x259fb8[_0x692e('0x3d')]=_0x259fb8[_0x692e('0x3d')][_0x692e('0x40')]?_0x259fb8['attributes']:_0x17c506[_0x692e('0x39')];if(_0x23528c[_0x692e('0x3b')][_0x692e('0x4b')]){_0x259fb8[_0x692e('0x4c')]=[{'all':!![]}];}_0x259fb8=_['merge']({},_0x259fb8,_0x23528c[_0x692e('0x46')]);return db[_0x692e('0x35')][_0x692e('0x4d')](_0x259fb8)['then'](handleEntityNotFound(_0x44ae99,null))[_0x692e('0x2e')](respondWithResult(_0x44ae99,null))['catch'](handleError(_0x44ae99,null));};exports[_0x692e('0x4e')]=function(_0x15790f,_0x69ed10){return db[_0x692e('0x35')][_0x692e('0x4e')](_0x15790f['body'],{})[_0x692e('0x2e')](function(_0x387a2b){var _0xee2530=_0x15790f[_0x692e('0x4f')][_0x692e('0x2f')]({'plain':!![]});if(!_0xee2530)throw new Error(_0x692e('0x50'));if(_0xee2530[_0x692e('0x51')]===_0x692e('0x4f')){var _0x4bea5c=_0x387a2b[_0x692e('0x2f')]({'plain':!![]});var _0x1f6d4f='OpenchannelQueues';return db['UserProfileSection'][_0x692e('0x4d')]({'where':{'name':_0x1f6d4f,'userProfileId':_0xee2530['userProfileId']},'raw':!![]})[_0x692e('0x2e')](function(_0x900d89){if(_0x900d89&&_0x900d89[_0x692e('0x52')]===0x0){return db[_0x692e('0x31')][_0x692e('0x4e')]({'name':_0x4bea5c[_0x692e('0x32')],'resourceId':_0x4bea5c['id'],'type':_0x900d89[_0x692e('0x32')],'sectionId':_0x900d89['id']},{})[_0x692e('0x2e')](function(){return _0x387a2b;});}else{return _0x387a2b;}})[_0x692e('0x48')](function(_0x51bba4){logger['error'](_0x692e('0x53'),_0x51bba4);throw _0x51bba4;});}return _0x387a2b;})[_0x692e('0x2e')](respondWithResult(_0x69ed10,0xc9))[_0x692e('0x48')](handleError(_0x69ed10,null));};exports[_0x692e('0x2c')]=function(_0x42639e,_0x12d08a){if(_0x42639e[_0x692e('0x54')]['id']){delete _0x42639e['body']['id'];}return db[_0x692e('0x35')][_0x692e('0x4d')]({'where':{'id':_0x42639e[_0x692e('0x49')]['id']}})['then'](handleEntityNotFound(_0x12d08a,null))['then'](saveUpdates(_0x42639e['body'],null))['then'](respondWithResult(_0x12d08a,null))[_0x692e('0x48')](handleError(_0x12d08a,null));};exports['destroy']=function(_0x5369d5,_0x29c115){return db[_0x692e('0x35')][_0x692e('0x4d')]({'where':{'id':_0x5369d5[_0x692e('0x49')]['id']}})[_0x692e('0x2e')](handleEntityNotFound(_0x29c115,null))[_0x692e('0x2e')](removeEntity(_0x29c115,null))['catch'](handleError(_0x29c115,null));};exports[_0x692e('0x55')]=function(_0x5cecad,_0x576cb9){return db[_0x692e('0x35')][_0x692e('0x55')]()['then'](respondWithResult(_0x576cb9,null))['catch'](handleError(_0x576cb9,null));};exports[_0x692e('0x56')]=function(_0x785410,_0x6142bf,_0x45191e){var _0x1181bf={'raw':!![],'where':{}},_0x44d1b7={},_0xa86c79;return db[_0x692e('0x35')][_0x692e('0x57')]({'where':{'id':_0x785410['params']['id']}})[_0x692e('0x2e')](handleEntityNotFound(_0x6142bf,null))[_0x692e('0x2e')](function(_0x5f5da7){if(_0x5f5da7){_0xa86c79=_0x5f5da7[_0x692e('0x2f')]({'plain':!![]});_0x44d1b7[_0x692e('0x39')]=_[_0x692e('0x58')](db[_0x692e('0x59')][_0x692e('0x4a')]);_0x44d1b7[_0x692e('0x3b')]=_[_0x692e('0x58')](_0x785410['query']);_0x44d1b7[_0x692e('0x3c')]=_[_0x692e('0x3e')](_0x44d1b7['model'],_0x44d1b7[_0x692e('0x3b')]);_0x1181bf[_0x692e('0x3d')]=_[_0x692e('0x3e')](_0x44d1b7[_0x692e('0x39')],qs[_0x692e('0x3f')](_0x785410['query'][_0x692e('0x3f')]));_0x1181bf[_0x692e('0x3d')]=_0x1181bf[_0x692e('0x3d')][_0x692e('0x40')]?_0x1181bf[_0x692e('0x3d')]:_0x44d1b7['model'];if(!_0x785410['query'][_0x692e('0x5a')](_0x692e('0x5b'))){_0x1181bf[_0x692e('0x26')]=qs[_0x692e('0x26')](_0x785410[_0x692e('0x3b')][_0x692e('0x26')]);_0x1181bf[_0x692e('0x25')]=qs[_0x692e('0x25')](_0x785410[_0x692e('0x3b')]['offset']);}_0x1181bf[_0x692e('0x5c')]=qs[_0x692e('0x41')](_0x785410['query']['sort']);_0x1181bf[_0x692e('0x42')]=qs['filters'](_[_0x692e('0x43')](_0x785410[_0x692e('0x3b')],_0x44d1b7[_0x692e('0x3c')]));_0x1181bf[_0x692e('0x42')][_0x692e('0x5d')]=_0x5f5da7['id'];if(_0x785410['query'][_0x692e('0x44')]){_0x1181bf['where']=_[_0x692e('0x45')](_0x1181bf[_0x692e('0x42')],{'$or':_[_0x692e('0x3a')](_0x1181bf[_0x692e('0x3d')],function(_0x4a0b0e){var _0x3bad44={};_0x3bad44[_0x4a0b0e]={'$like':'%'+_0x785410[_0x692e('0x3b')][_0x692e('0x44')]+'%'};return _0x3bad44;})});}_0x1181bf=_[_0x692e('0x45')]({},_0x1181bf,_0x785410[_0x692e('0x46')]);return db[_0x692e('0x59')][_0x692e('0x5e')](_0x1181bf);}})[_0x692e('0x2e')](function(_0x2f0246){if(_0x2f0246){return db[_0x692e('0x5f')]['findAndCountAll']({'where':{'id':_['map'](_0x2f0246,_0x692e('0x60')),'role':_0x692e('0x61')},'attributes':['id',_0x692e('0x32'),_0x692e('0x62'),_0x692e('0x63'),_0x692e('0x64')]});}})[_0x692e('0x2e')](function(_0x6eff10){if(_0x6eff10){return{'count':_0x6eff10[_0x692e('0x24')],'rows':_[_0x692e('0x3a')](_0x6eff10['rows'],function(_0x369b2c){return{'membername':_0x369b2c[_0x692e('0x32')],'UserId':_0x369b2c['id'],'queue_name':_0xa86c79[_0x692e('0x32')],'OpenchannelQueueId':_0xa86c79['id'],'interface':util[_0x692e('0x65')](_0x692e('0x66'),'SIP',_0x369b2c[_0x692e('0x32')]),'penalty':0x0,'paused':_0x369b2c['openchannelPause'],'createdAt':_0x369b2c[_0x692e('0x64')],'updatedAt':_0x369b2c[_0x692e('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x6142bf,_0x1181bf))[_0x692e('0x48')](handleError(_0x6142bf,null));};exports[_0x692e('0x67')]=function(_0x42bd2e,_0x24d1a7,_0x196c0a){var _0x42be91={};var _0x561fd6={};var _0x12ba6f;var _0x3f0cb8;return db[_0x692e('0x35')][_0x692e('0x57')]({'where':{'id':_0x42bd2e[_0x692e('0x49')]['id']}})['then'](handleEntityNotFound(_0x24d1a7,null))[_0x692e('0x2e')](function(_0x30fe39){if(_0x30fe39){_0x12ba6f=_0x30fe39;_0x561fd6['model']=_[_0x692e('0x58')](db[_0x692e('0x68')][_0x692e('0x4a')]);_0x561fd6[_0x692e('0x3b')]=_[_0x692e('0x58')](_0x42bd2e[_0x692e('0x3b')]);_0x561fd6[_0x692e('0x3c')]=_[_0x692e('0x3e')](_0x561fd6[_0x692e('0x39')],_0x561fd6[_0x692e('0x3b')]);_0x42be91[_0x692e('0x3d')]=_[_0x692e('0x3e')](_0x561fd6[_0x692e('0x39')],qs[_0x692e('0x3f')](_0x42bd2e['query'][_0x692e('0x3f')]));_0x42be91[_0x692e('0x3d')]=_0x42be91[_0x692e('0x3d')][_0x692e('0x40')]?_0x42be91[_0x692e('0x3d')]:_0x561fd6[_0x692e('0x39')];_0x42be91[_0x692e('0x5c')]=qs[_0x692e('0x41')](_0x42bd2e['query'][_0x692e('0x41')]);_0x42be91['where']=qs['filters'](_[_0x692e('0x43')](_0x42bd2e[_0x692e('0x3b')],_0x561fd6[_0x692e('0x3c')]));if(_0x42bd2e[_0x692e('0x3b')]['filter']){_0x42be91[_0x692e('0x42')]=_[_0x692e('0x45')](_0x42be91[_0x692e('0x42')],{'$or':_[_0x692e('0x3a')](_0x42be91[_0x692e('0x3d')],function(_0x9b6404){var _0x34da25={};_0x34da25[_0x9b6404]={'$like':'%'+_0x42bd2e[_0x692e('0x3b')][_0x692e('0x44')]+'%'};return _0x34da25;})});}_0x42be91=_[_0x692e('0x45')]({},_0x42be91,_0x42bd2e['options']);return _0x12ba6f[_0x692e('0x67')](_0x42be91);}})[_0x692e('0x2e')](function(_0x13d68b){if(_0x13d68b){_0x3f0cb8=_0x13d68b[_0x692e('0x40')];if(!_0x42bd2e[_0x692e('0x3b')]['hasOwnProperty']('nolimit')){_0x42be91[_0x692e('0x26')]=qs[_0x692e('0x26')](_0x42bd2e['query'][_0x692e('0x26')]);_0x42be91['offset']=qs[_0x692e('0x25')](_0x42bd2e['query'][_0x692e('0x25')]);}return _0x12ba6f[_0x692e('0x67')](_0x42be91);}})[_0x692e('0x2e')](function(_0x47f49c){if(_0x47f49c){return _0x47f49c?{'count':_0x3f0cb8,'rows':_0x47f49c}:null;}})['then'](respondWithResult(_0x24d1a7,null))[_0x692e('0x48')](handleError(_0x24d1a7,null));};exports[_0x692e('0x69')]=function(_0x3f8e9f,_0x56297c,_0x1a971f){var _0x3404f5=_0x3f8e9f[_0x692e('0x54')][_0x692e('0x6a')];return db[_0x692e('0x68')][_0x692e('0x5e')]({'where':{'id':_0x3404f5},'attributes':['id'],'include':[{'model':db[_0x692e('0x5f')],'as':_0x692e('0x6b'),'attributes':['id',_0x692e('0x32'),_0x692e('0x6c'),_0x692e('0x6d'),'interface'],'raw':!![]}]})[_0x692e('0x2e')](function(_0x267e26){if(_0x267e26){var _0x50874f=_[_0x692e('0x6e')](_0x267e26,function(_0x209d4c){var _0x113387=_0x209d4c[_0x692e('0x2f')]({'plain':!![]});return _0x113387[_0x692e('0x6b')];});return db[_0x692e('0x35')]['find']({'where':{'id':_0x3f8e9f[_0x692e('0x49')]['id']}})[_0x692e('0x2e')](function(_0x322ad7){return db[_0x692e('0x6f')][_0x692e('0x70')](function(_0x113ca3){return _0x322ad7[_0x692e('0x69')](_0x3404f5,{'transaction':_0x113ca3})[_0x692e('0x2e')](function(){return BPromise[_0x692e('0x71')](_0x50874f,function(_0x272087){return db[_0x692e('0x59')][_0x692e('0x72')]({'where':{'UserId':_0x272087['id'],'OpenchannelQueueId':_0x3f8e9f[_0x692e('0x49')]['id']},'transaction':_0x113ca3});});})[_0x692e('0x2e')](function(){_0x50874f[_0x692e('0x73')](function(_0x37fb8b){socket[_0x692e('0x74')](_0x692e('0x75'),{'UserId':_0x37fb8b['id'],'OpenchannelQueueId':_0x322ad7['id']});});});});});}})[_0x692e('0x2e')](respondWithStatusCode(_0x56297c,null))[_0x692e('0x48')](handleError(_0x56297c,null));};exports[_0x692e('0x76')]=function(_0x5ec5ca,_0x5104f4,_0x3132a1){return db['Team'][_0x692e('0x5e')]({'where':{'id':_0x5ec5ca['query'][_0x692e('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5104f4,null))[_0x692e('0x2e')](function(_0x5632f3){var _0x43427b=_[_0x692e('0x3a')](_0x5632f3,'id');var _0x4d37a6=[];var _0x2876db=[];var _0x15fe23=squel[_0x692e('0x77')]();_0x15fe23[_0x692e('0x78')](_0x692e('0x79'))[_0x692e('0x7a')](_0x692e('0x7b'),'tq')['join'](_0x692e('0x7c'),'ut',_0x692e('0x7d'))['where'](_0x692e('0x7e'),_0x5ec5ca[_0x692e('0x49')]['id']);for(var _0xcddb1d=0x0;_0xcddb1d<_0x5632f3[_0x692e('0x40')];_0xcddb1d+=0x1){let _0x201d08=_0x5632f3[_0xcddb1d];for(var _0x4c3369=0x0;_0x4c3369<_0x201d08['Agents']['length'];_0x4c3369+=0x1){let _0x5015a5=_0x201d08['Agents'][_0x4c3369];var _0xae3bbb=_0x15fe23[_0x692e('0x7f')]();_0xae3bbb[_0x692e('0x42')](_0x692e('0x80'),_0x5015a5['id']);_0x2876db['push'](db[_0x692e('0x6f')][_0x692e('0x3b')](_0xae3bbb[_0x692e('0x81')](),{'type':db[_0x692e('0x6f')][_0x692e('0x82')][_0x692e('0x83')]})['then'](function(_0x338a1d){if(_0x338a1d[_0x692e('0x40')]===0x1){return _0x5015a5['id'];}else{var _0x175b85=_[_0x692e('0x84')](_[_0x692e('0x3a')](_0x338a1d,_0x692e('0x85')),function(_0x26ee4d){return _[_0x692e('0x86')](_0x43427b,_0x26ee4d);});if(_0x175b85){return _0x5015a5['id'];}}}));}}return BPromise[_0x692e('0x87')](_0x2876db)['then'](function(_0x26ae1d){_0x4d37a6=_(_0x4d37a6)['union'](_0x26ae1d)[_0x692e('0x88')]()['value']();return db[_0x692e('0x35')][_0x692e('0x4d')]({'where':{'id':_0x5ec5ca[_0x692e('0x49')]['id']}})[_0x692e('0x2e')](function(_0x411385){return db[_0x692e('0x6f')][_0x692e('0x70')](function(_0x76bd89){return _0x411385[_0x692e('0x76')](_0x5ec5ca[_0x692e('0x3b')][_0x692e('0x6a')],{'transaction':_0x76bd89})['then'](function(){if(!_[_0x692e('0x89')](_0x4d37a6)){return _0x411385[_0x692e('0x8a')](_0x4d37a6,{'transaction':_0x76bd89});}})[_0x692e('0x2e')](function(){_0x4d37a6[_0x692e('0x73')](function(_0x201553){socket[_0x692e('0x74')](_0x692e('0x8b'),{'UserId':_0x201553,'OpenchannelQueueId':_0x411385['id']});});});});});});})[_0x692e('0x2e')](respondWithStatusCode(_0x5104f4,null))[_0x692e('0x48')](handleError(_0x5104f4,null));};exports['addAgents']=function(_0x2e1385,_0x3d3194,_0x5d2bbf){return db[_0x692e('0x35')][_0x692e('0x4d')]({'where':{'id':_0x2e1385[_0x692e('0x49')]['id']}})[_0x692e('0x2e')](handleEntityNotFound(_0x3d3194,null))[_0x692e('0x2e')](function(_0x1bf6e2){if(_0x1bf6e2){return _0x1bf6e2['addAgents'](_0x2e1385['body'][_0x692e('0x6a')],_['omit'](_0x2e1385['body'],[_0x692e('0x6a'),'id'])||{})['spread'](function(_0x549818){for(var _0x281bac=0x0;_0x281bac<_0x2e1385[_0x692e('0x54')][_0x692e('0x6a')]['length'];_0x281bac+=0x1){socket[_0x692e('0x74')](_0x692e('0x75'),{'UserId':Number(_0x2e1385['body'][_0x692e('0x6a')][_0x281bac]),'OpenchannelQueueId':Number(_0x2e1385[_0x692e('0x49')]['id'])});}return _0x549818;});}})[_0x692e('0x2e')](respondWithResult(_0x3d3194,null))[_0x692e('0x48')](handleError(_0x3d3194,null));};exports[_0x692e('0x8a')]=function(_0x3fffe3,_0x5e5978,_0x519112){return db['OpenchannelQueue'][_0x692e('0x4d')]({'where':{'id':_0x3fffe3['params']['id']}})['then'](handleEntityNotFound(_0x5e5978,null))[_0x692e('0x2e')](function(_0x2e5745){if(_0x2e5745){return _0x2e5745['removeAgents'](_0x3fffe3[_0x692e('0x3b')]['ids'])['then'](function(){if(_[_0x692e('0x8c')](_0x3fffe3['query'][_0x692e('0x6a')])){for(var _0x1245ba=0x0;_0x1245ba<_0x3fffe3[_0x692e('0x3b')][_0x692e('0x6a')][_0x692e('0x40')];_0x1245ba+=0x1){socket['emit'](_0x692e('0x8b'),{'UserId':Number(_0x3fffe3[_0x692e('0x3b')][_0x692e('0x6a')][_0x1245ba]),'OpenchannelQueueId':Number(_0x3fffe3[_0x692e('0x49')]['id'])});}}else{socket[_0x692e('0x74')](_0x692e('0x8b'),{'UserId':Number(_0x3fffe3[_0x692e('0x3b')][_0x692e('0x6a')]),'OpenchannelQueueId':Number(_0x3fffe3[_0x692e('0x49')]['id'])});}});}})[_0x692e('0x2e')](respondWithStatusCode(_0x5e5978,null))[_0x692e('0x48')](handleError(_0x5e5978,null));};exports[_0x692e('0x8d')]=function(_0x52c22b,_0x53a049,_0x3051e2){var _0x4a34be={};var _0x50878d={};var _0x325a52;var _0x5691db;return db['OpenchannelQueue'][_0x692e('0x57')]({'where':{'id':_0x52c22b[_0x692e('0x49')]['id']}})[_0x692e('0x2e')](handleEntityNotFound(_0x53a049,null))['then'](function(_0x40483f){if(_0x40483f){_0x325a52=_0x40483f;_0x50878d[_0x692e('0x39')]=_[_0x692e('0x58')](db[_0x692e('0x5f')]['rawAttributes']);_0x50878d['query']=_[_0x692e('0x58')](_0x52c22b[_0x692e('0x3b')]);_0x50878d[_0x692e('0x3c')]=_[_0x692e('0x3e')](_0x50878d[_0x692e('0x39')],_0x50878d['query']);_0x4a34be['attributes']=_[_0x692e('0x3e')](_0x50878d[_0x692e('0x39')],qs['fields'](_0x52c22b['query'][_0x692e('0x3f')]));_0x4a34be['attributes']=_0x4a34be[_0x692e('0x3d')][_0x692e('0x40')]?_0x4a34be[_0x692e('0x3d')]:_0x50878d[_0x692e('0x39')];_0x4a34be[_0x692e('0x5c')]=qs[_0x692e('0x41')](_0x52c22b[_0x692e('0x3b')][_0x692e('0x41')]);_0x4a34be[_0x692e('0x42')]=qs[_0x692e('0x3c')](_[_0x692e('0x43')](_0x52c22b[_0x692e('0x3b')],_0x50878d[_0x692e('0x3c')]));if(_0x52c22b['query']['filter']){_0x4a34be[_0x692e('0x42')]=_['merge'](_0x4a34be[_0x692e('0x42')],{'$or':_[_0x692e('0x3a')](_0x4a34be[_0x692e('0x3d')],function(_0x431a99){var _0x6a0fb8={};_0x6a0fb8[_0x431a99]={'$like':'%'+_0x52c22b[_0x692e('0x3b')]['filter']+'%'};return _0x6a0fb8;})});}_0x4a34be=_[_0x692e('0x45')]({},_0x4a34be,_0x52c22b[_0x692e('0x46')]);return _0x325a52['getAgents'](_0x4a34be);}})[_0x692e('0x2e')](function(_0x2ed49d){if(_0x2ed49d){_0x5691db=_0x2ed49d[_0x692e('0x40')];if(!_0x52c22b[_0x692e('0x3b')][_0x692e('0x5a')](_0x692e('0x5b'))){_0x4a34be[_0x692e('0x26')]=qs[_0x692e('0x26')](_0x52c22b[_0x692e('0x3b')][_0x692e('0x26')]);_0x4a34be['offset']=qs['offset'](_0x52c22b[_0x692e('0x3b')][_0x692e('0x25')]);}return _0x325a52[_0x692e('0x8d')](_0x4a34be);}})['then'](function(_0x1a8cea){if(_0x1a8cea){return _0x1a8cea?{'count':_0x5691db,'rows':_0x1a8cea}:null;}})[_0x692e('0x2e')](respondWithResult(_0x53a049,null))['catch'](handleError(_0x53a049,null));};
\ No newline at end of file
+var _0x825e=['UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','openchannelPause','getTeams','Team','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','includes','all','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','get','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','options','OpenchannelQueue','rows','catch','show','params','includeAll','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues'];(function(_0x578bf6,_0x19a9ca){var _0x4ab5ea=function(_0x254948){while(--_0x254948){_0x578bf6['push'](_0x578bf6['shift']());}};_0x4ab5ea(++_0x19a9ca);}(_0x825e,0x1f3));var _0xe825=function(_0x4d06fd,_0x3ae6a2){_0x4d06fd=_0x4d06fd-0x0;var _0x1e37bb=_0x825e[_0x4d06fd];return _0x1e37bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe825('0x0'));var zipdir=require(_0xe825('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe825('0x2'));var moment=require(_0xe825('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe825('0x4'));var util=require(_0xe825('0x5'));var path=require('path');var sox=require(_0xe825('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe825('0x7'));var _=require(_0xe825('0x8'));var squel=require(_0xe825('0x9'));var crypto=require(_0xe825('0xa'));var jsforce=require(_0xe825('0xb'));var deskjs=require(_0xe825('0xc'));var toCsv=require(_0xe825('0xd'));var querystring=require(_0xe825('0xe'));var Papa=require(_0xe825('0xf'));var Redis=require(_0xe825('0x10'));var authService=require(_0xe825('0x11'));var qs=require(_0xe825('0x12'));var as=require(_0xe825('0x13'));var hardwareService=require(_0xe825('0x14'));var logger=require(_0xe825('0x15'))(_0xe825('0x16'));var utils=require(_0xe825('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe825('0x18'));var db=require('../../mysqldb')['db'];config[_0xe825('0x19')]=_[_0xe825('0x1a')](config[_0xe825('0x19')],{'host':_0xe825('0x1b'),'port':0x18eb});var socket=require(_0xe825('0x1c'))(new Redis(config[_0xe825('0x19')]));require(_0xe825('0x1d'))['register'](socket);function respondWithStatusCode(_0x2dc76b,_0x3bda75){_0x3bda75=_0x3bda75||0xcc;return function(_0x7a85aa){if(_0x7a85aa){return _0x2dc76b[_0xe825('0x1e')](_0x3bda75);}return _0x2dc76b[_0xe825('0x1f')](_0x3bda75)[_0xe825('0x20')]();};}function respondWithResult(_0x25bc92,_0x5046d3){_0x5046d3=_0x5046d3||0xc8;return function(_0x23ec12){if(_0x23ec12){return _0x25bc92[_0xe825('0x1f')](_0x5046d3)['json'](_0x23ec12);}};}function respondWithFilteredResult(_0x55d7d0,_0x3358d4){return function(_0x35b9f5){if(_0x35b9f5){var _0x521076=typeof _0x3358d4[_0xe825('0x21')]===_0xe825('0x22')&&typeof _0x3358d4[_0xe825('0x23')]===_0xe825('0x22');var _0x5ac620=_0x35b9f5[_0xe825('0x24')];var _0x1b9ae0=_0x521076?0x0:_0x3358d4[_0xe825('0x21')];var _0x4e5fd2=_0x521076?_0x35b9f5[_0xe825('0x24')]:_0x3358d4[_0xe825('0x21')]+_0x3358d4['limit'];var _0x180433;if(_0x4e5fd2>=_0x5ac620){_0x4e5fd2=_0x5ac620;_0x180433=0xc8;}else{_0x180433=0xce;}_0x55d7d0['status'](_0x180433);return _0x55d7d0[_0xe825('0x25')](_0xe825('0x26'),_0x1b9ae0+'-'+_0x4e5fd2+'/'+_0x5ac620)[_0xe825('0x27')](_0x35b9f5);}return null;};}function patchUpdates(_0x48898d){return function(_0x528438){try{jsonpatch[_0xe825('0x28')](_0x528438,_0x48898d,!![]);}catch(_0xa3e4ad){return BPromise['reject'](_0xa3e4ad);}return _0x528438['save']();};}function saveUpdates(_0x1a2315,_0x284828){return function(_0x5a8ad4){if(_0x5a8ad4){return _0x5a8ad4[_0xe825('0x29')](_0x1a2315)[_0xe825('0x2a')](function(_0x50440d){return _0x50440d;});}return null;};}function removeEntity(_0x1ac032,_0x579bc8){return function(_0x28d2ee){if(_0x28d2ee){return _0x28d2ee[_0xe825('0x2b')]()[_0xe825('0x2a')](function(){var _0x44f683=_0x28d2ee[_0xe825('0x2c')]({'plain':!![]});var _0x390e34='OpenchannelQueues';return db['UserProfileResource'][_0xe825('0x2b')]({'where':{'type':_0x390e34,'resourceId':_0x44f683['id']}})[_0xe825('0x2a')](function(){return _0x28d2ee;});})['then'](function(){_0x1ac032[_0xe825('0x1f')](0xcc)[_0xe825('0x20')]();});}};}function handleEntityNotFound(_0x25832d,_0x5a575d){return function(_0x72beae){if(!_0x72beae){_0x25832d['sendStatus'](0x194);}return _0x72beae;};}function handleError(_0x9f0dca,_0x1c6cd8){_0x1c6cd8=_0x1c6cd8||0x1f4;return function(_0x42b3ab){logger['error'](_0x42b3ab[_0xe825('0x2d')]);if(_0x42b3ab[_0xe825('0x2e')]){delete _0x42b3ab['name'];}_0x9f0dca[_0xe825('0x1f')](_0x1c6cd8)[_0xe825('0x2f')](_0x42b3ab);};}exports[_0xe825('0x30')]=function(_0x101ade,_0xed356c){var _0xf6c6f1={},_0x140df9={},_0x9e8588={'count':0x0,'rows':[]};var _0x2d5586=_[_0xe825('0x31')](db['OpenchannelQueue'][_0xe825('0x32')],function(_0x3a8122){return{'name':_0x3a8122[_0xe825('0x33')],'type':_0x3a8122[_0xe825('0x34')][_0xe825('0x35')]};});_0x140df9[_0xe825('0x36')]=_[_0xe825('0x31')](_0x2d5586,'name');_0x140df9[_0xe825('0x37')]=_[_0xe825('0x38')](_0x101ade['query']);_0x140df9[_0xe825('0x39')]=_[_0xe825('0x3a')](_0x140df9['model'],_0x140df9['query']);_0xf6c6f1['attributes']=_[_0xe825('0x3a')](_0x140df9[_0xe825('0x36')],qs['fields'](_0x101ade[_0xe825('0x37')][_0xe825('0x3b')]));_0xf6c6f1[_0xe825('0x3c')]=_0xf6c6f1['attributes'][_0xe825('0x3d')]?_0xf6c6f1[_0xe825('0x3c')]:_0x140df9[_0xe825('0x36')];if(!_0x101ade[_0xe825('0x37')][_0xe825('0x3e')]('nolimit')){_0xf6c6f1['limit']=qs['limit'](_0x101ade[_0xe825('0x37')][_0xe825('0x23')]);_0xf6c6f1['offset']=qs[_0xe825('0x21')](_0x101ade['query'][_0xe825('0x21')]);}_0xf6c6f1[_0xe825('0x3f')]=qs['sort'](_0x101ade[_0xe825('0x37')][_0xe825('0x40')]);_0xf6c6f1['where']=qs[_0xe825('0x39')](_[_0xe825('0x41')](_0x101ade[_0xe825('0x37')],_0x140df9[_0xe825('0x39')]),_0x2d5586);if(_0x101ade[_0xe825('0x37')]['filter']){_0xf6c6f1[_0xe825('0x42')]=_['merge'](_0xf6c6f1[_0xe825('0x42')],{'$or':_[_0xe825('0x31')](_0x2d5586,function(_0x50d572){if(_0x50d572['type']!==_0xe825('0x43')){var _0x92f031={};_0x92f031[_0x50d572[_0xe825('0x2e')]]={'$like':'%'+_0x101ade[_0xe825('0x37')][_0xe825('0x44')]+'%'};return _0x92f031;}})});}_0xf6c6f1=_['merge']({},_0xf6c6f1,_0x101ade[_0xe825('0x45')]);var _0x3eb726={'where':_0xf6c6f1[_0xe825('0x42')]};return db['OpenchannelQueue'][_0xe825('0x24')](_0x3eb726)['then'](function(_0x4f5d4f){_0x9e8588['count']=_0x4f5d4f;if(_0x101ade['query']['includeAll']){_0xf6c6f1['include']=[{'all':!![]}];}return db[_0xe825('0x46')]['findAll'](_0xf6c6f1);})[_0xe825('0x2a')](function(_0x5b9700){_0x9e8588[_0xe825('0x47')]=_0x5b9700;return _0x9e8588;})[_0xe825('0x2a')](respondWithFilteredResult(_0xed356c,_0xf6c6f1))[_0xe825('0x48')](handleError(_0xed356c,null));};exports[_0xe825('0x49')]=function(_0x515657,_0x14fca6){var _0x2d9be7={'raw':!![],'where':{'id':_0x515657[_0xe825('0x4a')]['id']}},_0x2f8439={};_0x2f8439[_0xe825('0x36')]=_[_0xe825('0x38')](db[_0xe825('0x46')]['rawAttributes']);_0x2f8439[_0xe825('0x37')]=_[_0xe825('0x38')](_0x515657[_0xe825('0x37')]);_0x2f8439['filters']=_[_0xe825('0x3a')](_0x2f8439[_0xe825('0x36')],_0x2f8439[_0xe825('0x37')]);_0x2d9be7[_0xe825('0x3c')]=_['intersection'](_0x2f8439[_0xe825('0x36')],qs[_0xe825('0x3b')](_0x515657[_0xe825('0x37')][_0xe825('0x3b')]));_0x2d9be7[_0xe825('0x3c')]=_0x2d9be7['attributes'][_0xe825('0x3d')]?_0x2d9be7[_0xe825('0x3c')]:_0x2f8439['model'];if(_0x515657[_0xe825('0x37')][_0xe825('0x4b')]){_0x2d9be7[_0xe825('0x4c')]=[{'all':!![]}];}_0x2d9be7=_[_0xe825('0x4d')]({},_0x2d9be7,_0x515657[_0xe825('0x45')]);return db[_0xe825('0x46')][_0xe825('0x4e')](_0x2d9be7)[_0xe825('0x2a')](handleEntityNotFound(_0x14fca6,null))[_0xe825('0x2a')](respondWithResult(_0x14fca6,null))[_0xe825('0x48')](handleError(_0x14fca6,null));};exports[_0xe825('0x4f')]=function(_0x3d9af1,_0x231bfe){return db[_0xe825('0x46')]['create'](_0x3d9af1[_0xe825('0x50')],{})[_0xe825('0x2a')](function(_0x1026ab){var _0xdfa1a5=_0x3d9af1[_0xe825('0x51')][_0xe825('0x2c')]({'plain':!![]});if(!_0xdfa1a5)throw new Error(_0xe825('0x52'));if(_0xdfa1a5[_0xe825('0x53')]==='user'){var _0x20755e=_0x1026ab[_0xe825('0x2c')]({'plain':!![]});var _0x261171=_0xe825('0x54');return db[_0xe825('0x55')][_0xe825('0x4e')]({'where':{'name':_0x261171,'userProfileId':_0xdfa1a5['userProfileId']},'raw':!![]})[_0xe825('0x2a')](function(_0x1f61b5){if(_0x1f61b5&&_0x1f61b5[_0xe825('0x56')]===0x0){return db[_0xe825('0x57')][_0xe825('0x4f')]({'name':_0x20755e[_0xe825('0x2e')],'resourceId':_0x20755e['id'],'type':_0x1f61b5[_0xe825('0x2e')],'sectionId':_0x1f61b5['id']},{})[_0xe825('0x2a')](function(){return _0x1026ab;});}else{return _0x1026ab;}})[_0xe825('0x48')](function(_0x4ee9c9){logger[_0xe825('0x58')](_0xe825('0x59'),_0x4ee9c9);throw _0x4ee9c9;});}return _0x1026ab;})[_0xe825('0x2a')](respondWithResult(_0x231bfe,0xc9))[_0xe825('0x48')](handleError(_0x231bfe,null));};exports[_0xe825('0x29')]=function(_0x2c3adb,_0x412f97){if(_0x2c3adb[_0xe825('0x50')]['id']){delete _0x2c3adb['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x2c3adb['params']['id']}})[_0xe825('0x2a')](handleEntityNotFound(_0x412f97,null))[_0xe825('0x2a')](saveUpdates(_0x2c3adb[_0xe825('0x50')],null))[_0xe825('0x2a')](respondWithResult(_0x412f97,null))['catch'](handleError(_0x412f97,null));};exports[_0xe825('0x2b')]=function(_0x2c779e,_0x1487b9){return db[_0xe825('0x46')]['find']({'where':{'id':_0x2c779e['params']['id']}})[_0xe825('0x2a')](handleEntityNotFound(_0x1487b9,null))[_0xe825('0x2a')](removeEntity(_0x1487b9,null))[_0xe825('0x48')](handleError(_0x1487b9,null));};exports[_0xe825('0x5a')]=function(_0x4ba1f6,_0x571398){return db['OpenchannelQueue'][_0xe825('0x5a')]()[_0xe825('0x2a')](respondWithResult(_0x571398,null))[_0xe825('0x48')](handleError(_0x571398,null));};exports[_0xe825('0x5b')]=function(_0x2254ea,_0x2fa065,_0x19a16a){var _0x18d962={'raw':!![],'where':{}},_0x48829d={},_0x1d8a2b;return db['OpenchannelQueue'][_0xe825('0x5c')]({'where':{'id':_0x2254ea['params']['id']}})[_0xe825('0x2a')](handleEntityNotFound(_0x2fa065,null))[_0xe825('0x2a')](function(_0x4eef5b){if(_0x4eef5b){_0x1d8a2b=_0x4eef5b['get']({'plain':!![]});_0x48829d[_0xe825('0x36')]=_[_0xe825('0x38')](db[_0xe825('0x5d')][_0xe825('0x32')]);_0x48829d['query']=_[_0xe825('0x38')](_0x2254ea[_0xe825('0x37')]);_0x48829d['filters']=_[_0xe825('0x3a')](_0x48829d['model'],_0x48829d[_0xe825('0x37')]);_0x18d962[_0xe825('0x3c')]=_['intersection'](_0x48829d[_0xe825('0x36')],qs[_0xe825('0x3b')](_0x2254ea['query'][_0xe825('0x3b')]));_0x18d962[_0xe825('0x3c')]=_0x18d962[_0xe825('0x3c')][_0xe825('0x3d')]?_0x18d962[_0xe825('0x3c')]:_0x48829d[_0xe825('0x36')];if(!_0x2254ea[_0xe825('0x37')][_0xe825('0x3e')](_0xe825('0x5e'))){_0x18d962[_0xe825('0x23')]=qs[_0xe825('0x23')](_0x2254ea[_0xe825('0x37')]['limit']);_0x18d962['offset']=qs[_0xe825('0x21')](_0x2254ea[_0xe825('0x37')][_0xe825('0x21')]);}_0x18d962[_0xe825('0x3f')]=qs[_0xe825('0x40')](_0x2254ea['query']['sort']);_0x18d962[_0xe825('0x42')]=qs[_0xe825('0x39')](_[_0xe825('0x41')](_0x2254ea[_0xe825('0x37')],_0x48829d[_0xe825('0x39')]));_0x18d962[_0xe825('0x42')][_0xe825('0x5f')]=_0x4eef5b['id'];if(_0x2254ea['query'][_0xe825('0x44')]){_0x18d962[_0xe825('0x42')]=_['merge'](_0x18d962[_0xe825('0x42')],{'$or':_[_0xe825('0x31')](_0x18d962[_0xe825('0x3c')],function(_0xbe50){var _0x5eeb78={};_0x5eeb78[_0xbe50]={'$like':'%'+_0x2254ea[_0xe825('0x37')][_0xe825('0x44')]+'%'};return _0x5eeb78;})});}_0x18d962=_[_0xe825('0x4d')]({},_0x18d962,_0x2254ea[_0xe825('0x45')]);return db[_0xe825('0x5d')]['findAll'](_0x18d962);}})[_0xe825('0x2a')](function(_0x577d13){if(_0x577d13){return db[_0xe825('0x60')][_0xe825('0x61')]({'where':{'id':_[_0xe825('0x31')](_0x577d13,_0xe825('0x62')),'role':_0xe825('0x63')},'attributes':['id',_0xe825('0x2e'),'openchannelPause',_0xe825('0x64'),_0xe825('0x65')]});}})[_0xe825('0x2a')](function(_0x2dd9a3){if(_0x2dd9a3){return{'count':_0x2dd9a3['count'],'rows':_[_0xe825('0x31')](_0x2dd9a3[_0xe825('0x47')],function(_0x280b7a){return{'membername':_0x280b7a[_0xe825('0x2e')],'UserId':_0x280b7a['id'],'queue_name':_0x1d8a2b['name'],'OpenchannelQueueId':_0x1d8a2b['id'],'interface':util[_0xe825('0x66')]('%s/%s','SIP',_0x280b7a[_0xe825('0x2e')]),'penalty':0x0,'paused':_0x280b7a[_0xe825('0x67')],'createdAt':_0x280b7a[_0xe825('0x65')],'updatedAt':_0x280b7a[_0xe825('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe825('0x2a')](respondWithFilteredResult(_0x2fa065,_0x18d962))[_0xe825('0x48')](handleError(_0x2fa065,null));};exports[_0xe825('0x68')]=function(_0x41adb5,_0x1539f4,_0x2eb2d3){var _0x393779={};var _0x4e8cad={};var _0x42b181;var _0x309868;return db['OpenchannelQueue'][_0xe825('0x5c')]({'where':{'id':_0x41adb5['params']['id']}})[_0xe825('0x2a')](handleEntityNotFound(_0x1539f4,null))[_0xe825('0x2a')](function(_0x52b5b1){if(_0x52b5b1){_0x42b181=_0x52b5b1;_0x4e8cad['model']=_[_0xe825('0x38')](db[_0xe825('0x69')][_0xe825('0x32')]);_0x4e8cad['query']=_[_0xe825('0x38')](_0x41adb5[_0xe825('0x37')]);_0x4e8cad[_0xe825('0x39')]=_[_0xe825('0x3a')](_0x4e8cad[_0xe825('0x36')],_0x4e8cad[_0xe825('0x37')]);_0x393779[_0xe825('0x3c')]=_[_0xe825('0x3a')](_0x4e8cad['model'],qs[_0xe825('0x3b')](_0x41adb5[_0xe825('0x37')][_0xe825('0x3b')]));_0x393779[_0xe825('0x3c')]=_0x393779['attributes'][_0xe825('0x3d')]?_0x393779[_0xe825('0x3c')]:_0x4e8cad[_0xe825('0x36')];_0x393779[_0xe825('0x3f')]=qs['sort'](_0x41adb5[_0xe825('0x37')][_0xe825('0x40')]);_0x393779[_0xe825('0x42')]=qs[_0xe825('0x39')](_['pick'](_0x41adb5[_0xe825('0x37')],_0x4e8cad['filters']));if(_0x41adb5['query'][_0xe825('0x44')]){_0x393779[_0xe825('0x42')]=_['merge'](_0x393779['where'],{'$or':_[_0xe825('0x31')](_0x393779['attributes'],function(_0x26f8bd){var _0x24846c={};_0x24846c[_0x26f8bd]={'$like':'%'+_0x41adb5[_0xe825('0x37')][_0xe825('0x44')]+'%'};return _0x24846c;})});}_0x393779=_[_0xe825('0x4d')]({},_0x393779,_0x41adb5[_0xe825('0x45')]);return _0x42b181[_0xe825('0x68')](_0x393779);}})[_0xe825('0x2a')](function(_0x3aa6ca){if(_0x3aa6ca){_0x309868=_0x3aa6ca[_0xe825('0x3d')];if(!_0x41adb5['query'][_0xe825('0x3e')](_0xe825('0x5e'))){_0x393779[_0xe825('0x23')]=qs[_0xe825('0x23')](_0x41adb5[_0xe825('0x37')]['limit']);_0x393779[_0xe825('0x21')]=qs[_0xe825('0x21')](_0x41adb5[_0xe825('0x37')][_0xe825('0x21')]);}return _0x42b181[_0xe825('0x68')](_0x393779);}})[_0xe825('0x2a')](function(_0x5f2d9c){if(_0x5f2d9c){return _0x5f2d9c?{'count':_0x309868,'rows':_0x5f2d9c}:null;}})[_0xe825('0x2a')](respondWithResult(_0x1539f4,null))[_0xe825('0x48')](handleError(_0x1539f4,null));};exports[_0xe825('0x6a')]=function(_0x3acf70,_0x377a82,_0x524e9b){var _0x376554=_0x3acf70[_0xe825('0x50')][_0xe825('0x6b')];return db['Team'][_0xe825('0x6c')]({'where':{'id':_0x376554},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe825('0x2e'),_0xe825('0x6d'),_0xe825('0x6e'),_0xe825('0x6f')],'raw':!![]}]})[_0xe825('0x2a')](function(_0x31d518){if(_0x31d518){var _0x450676=_[_0xe825('0x70')](_0x31d518,function(_0x4b5842){var _0x35a594=_0x4b5842[_0xe825('0x2c')]({'plain':!![]});return _0x35a594[_0xe825('0x71')];});return db[_0xe825('0x46')][_0xe825('0x4e')]({'where':{'id':_0x3acf70['params']['id']}})[_0xe825('0x2a')](function(_0x27d09c){return db[_0xe825('0x72')][_0xe825('0x73')](function(_0x950117){return _0x27d09c[_0xe825('0x6a')](_0x376554,{'transaction':_0x950117})[_0xe825('0x2a')](function(){return BPromise[_0xe825('0x74')](_0x450676,function(_0x5f08a8){return db['UserOpenchannelQueue'][_0xe825('0x75')]({'where':{'UserId':_0x5f08a8['id'],'OpenchannelQueueId':_0x3acf70[_0xe825('0x4a')]['id']},'transaction':_0x950117});});})[_0xe825('0x2a')](function(){_0x450676[_0xe825('0x76')](function(_0x12f4ca){socket['emit'](_0xe825('0x77'),{'UserId':_0x12f4ca['id'],'OpenchannelQueueId':_0x27d09c['id']});});});});});}})[_0xe825('0x2a')](respondWithStatusCode(_0x377a82,null))[_0xe825('0x48')](handleError(_0x377a82,null));};exports[_0xe825('0x78')]=function(_0x2cebd3,_0x44dbb3,_0x14ffe7){return db['Team']['findAll']({'where':{'id':_0x2cebd3[_0xe825('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe825('0x60')],'as':_0xe825('0x71'),'attributes':['id'],'raw':!![]}]})[_0xe825('0x2a')](handleEntityNotFound(_0x44dbb3,null))['then'](function(_0xd55b0b){var _0x50cf8b=_[_0xe825('0x31')](_0xd55b0b,'id');var _0xf1a8d5=[];var _0x287fa7=[];var _0x540da5=squel[_0xe825('0x79')]();_0x540da5[_0xe825('0x7a')]('tq.TeamId')[_0xe825('0x7b')](_0xe825('0x7c'),'tq')[_0xe825('0x7d')](_0xe825('0x7e'),'ut',_0xe825('0x7f'))['where'](_0xe825('0x80'),_0x2cebd3[_0xe825('0x4a')]['id']);for(var _0x52faf9=0x0;_0x52faf9<_0xd55b0b[_0xe825('0x3d')];_0x52faf9+=0x1){let _0x5ad3bd=_0xd55b0b[_0x52faf9];for(var _0x49915e=0x0;_0x49915e<_0x5ad3bd[_0xe825('0x71')][_0xe825('0x3d')];_0x49915e+=0x1){let _0x1083a4=_0x5ad3bd[_0xe825('0x71')][_0x49915e];var _0x5354eb=_0x540da5[_0xe825('0x81')]();_0x5354eb[_0xe825('0x42')](_0xe825('0x82'),_0x1083a4['id']);_0x287fa7['push'](db[_0xe825('0x72')][_0xe825('0x37')](_0x5354eb['toString'](),{'type':db[_0xe825('0x72')][_0xe825('0x83')][_0xe825('0x84')]})[_0xe825('0x2a')](function(_0x54a061){if(_0x54a061[_0xe825('0x3d')]===0x1){return _0x1083a4['id'];}else{var _0x381c1c=_[_0xe825('0x85')](_['map'](_0x54a061,'TeamId'),function(_0x18147a){return _[_0xe825('0x86')](_0x50cf8b,_0x18147a);});if(_0x381c1c){return _0x1083a4['id'];}}}));}}return BPromise[_0xe825('0x87')](_0x287fa7)[_0xe825('0x2a')](function(_0x2a5567){_0xf1a8d5=_(_0xf1a8d5)['union'](_0x2a5567)['compact']()[_0xe825('0x88')]();return db[_0xe825('0x46')][_0xe825('0x4e')]({'where':{'id':_0x2cebd3[_0xe825('0x4a')]['id']}})[_0xe825('0x2a')](function(_0x521ef7){return db['sequelize'][_0xe825('0x73')](function(_0x251e3c){return _0x521ef7['removeTeams'](_0x2cebd3[_0xe825('0x37')]['ids'],{'transaction':_0x251e3c})[_0xe825('0x2a')](function(){if(!_[_0xe825('0x89')](_0xf1a8d5)){return _0x521ef7[_0xe825('0x8a')](_0xf1a8d5,{'transaction':_0x251e3c});}})[_0xe825('0x2a')](function(){_0xf1a8d5[_0xe825('0x76')](function(_0x14eeb2){socket[_0xe825('0x8b')]('userOpenchannelQueue:remove',{'UserId':_0x14eeb2,'OpenchannelQueueId':_0x521ef7['id']});});});});});});})[_0xe825('0x2a')](respondWithStatusCode(_0x44dbb3,null))[_0xe825('0x48')](handleError(_0x44dbb3,null));};exports[_0xe825('0x8c')]=function(_0x26885f,_0x1406d6,_0x149d19){return db[_0xe825('0x46')][_0xe825('0x4e')]({'where':{'id':_0x26885f[_0xe825('0x4a')]['id']}})[_0xe825('0x2a')](handleEntityNotFound(_0x1406d6,null))[_0xe825('0x2a')](function(_0x231898){if(_0x231898){return _0x231898[_0xe825('0x8c')](_0x26885f['body'][_0xe825('0x6b')],_[_0xe825('0x8d')](_0x26885f['body'],['ids','id'])||{})[_0xe825('0x8e')](function(_0x2d3adb){for(var _0x24db4b=0x0;_0x24db4b<_0x26885f[_0xe825('0x50')][_0xe825('0x6b')][_0xe825('0x3d')];_0x24db4b+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x26885f[_0xe825('0x50')][_0xe825('0x6b')][_0x24db4b]),'OpenchannelQueueId':Number(_0x26885f[_0xe825('0x4a')]['id'])});}return _0x2d3adb;});}})[_0xe825('0x2a')](respondWithResult(_0x1406d6,null))[_0xe825('0x48')](handleError(_0x1406d6,null));};exports[_0xe825('0x8a')]=function(_0x48fc87,_0x1d643c,_0x3c42f5){return db[_0xe825('0x46')][_0xe825('0x4e')]({'where':{'id':_0x48fc87[_0xe825('0x4a')]['id']}})[_0xe825('0x2a')](handleEntityNotFound(_0x1d643c,null))[_0xe825('0x2a')](function(_0x3dcf31){if(_0x3dcf31){return _0x3dcf31[_0xe825('0x8a')](_0x48fc87['query'][_0xe825('0x6b')])['then'](function(){if(_[_0xe825('0x8f')](_0x48fc87[_0xe825('0x37')][_0xe825('0x6b')])){for(var _0x38c1c9=0x0;_0x38c1c9<_0x48fc87[_0xe825('0x37')][_0xe825('0x6b')][_0xe825('0x3d')];_0x38c1c9+=0x1){socket[_0xe825('0x8b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x48fc87[_0xe825('0x37')][_0xe825('0x6b')][_0x38c1c9]),'OpenchannelQueueId':Number(_0x48fc87[_0xe825('0x4a')]['id'])});}}else{socket[_0xe825('0x8b')](_0xe825('0x90'),{'UserId':Number(_0x48fc87[_0xe825('0x37')]['ids']),'OpenchannelQueueId':Number(_0x48fc87['params']['id'])});}});}})[_0xe825('0x2a')](respondWithStatusCode(_0x1d643c,null))[_0xe825('0x48')](handleError(_0x1d643c,null));};exports[_0xe825('0x91')]=function(_0x373d4b,_0x4de21a,_0x2f83f9){var _0x1b0d32={};var _0x1ec30f={};var _0x576946;var _0x4cd5a9;return db[_0xe825('0x46')][_0xe825('0x5c')]({'where':{'id':_0x373d4b[_0xe825('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4de21a,null))[_0xe825('0x2a')](function(_0x45c460){if(_0x45c460){_0x576946=_0x45c460;_0x1ec30f[_0xe825('0x36')]=_[_0xe825('0x38')](db['User'][_0xe825('0x32')]);_0x1ec30f[_0xe825('0x37')]=_[_0xe825('0x38')](_0x373d4b[_0xe825('0x37')]);_0x1ec30f[_0xe825('0x39')]=_[_0xe825('0x3a')](_0x1ec30f[_0xe825('0x36')],_0x1ec30f[_0xe825('0x37')]);_0x1b0d32['attributes']=_[_0xe825('0x3a')](_0x1ec30f[_0xe825('0x36')],qs['fields'](_0x373d4b[_0xe825('0x37')][_0xe825('0x3b')]));_0x1b0d32[_0xe825('0x3c')]=_0x1b0d32[_0xe825('0x3c')][_0xe825('0x3d')]?_0x1b0d32['attributes']:_0x1ec30f[_0xe825('0x36')];_0x1b0d32[_0xe825('0x3f')]=qs[_0xe825('0x40')](_0x373d4b[_0xe825('0x37')]['sort']);_0x1b0d32[_0xe825('0x42')]=qs[_0xe825('0x39')](_[_0xe825('0x41')](_0x373d4b[_0xe825('0x37')],_0x1ec30f[_0xe825('0x39')]));if(_0x373d4b['query'][_0xe825('0x44')]){_0x1b0d32[_0xe825('0x42')]=_[_0xe825('0x4d')](_0x1b0d32['where'],{'$or':_[_0xe825('0x31')](_0x1b0d32[_0xe825('0x3c')],function(_0x1bbe9a){var _0x4978ab={};_0x4978ab[_0x1bbe9a]={'$like':'%'+_0x373d4b[_0xe825('0x37')]['filter']+'%'};return _0x4978ab;})});}_0x1b0d32=_[_0xe825('0x4d')]({},_0x1b0d32,_0x373d4b[_0xe825('0x45')]);return _0x576946[_0xe825('0x91')](_0x1b0d32);}})[_0xe825('0x2a')](function(_0x29bb1e){if(_0x29bb1e){_0x4cd5a9=_0x29bb1e['length'];if(!_0x373d4b[_0xe825('0x37')][_0xe825('0x3e')](_0xe825('0x5e'))){_0x1b0d32[_0xe825('0x23')]=qs[_0xe825('0x23')](_0x373d4b[_0xe825('0x37')][_0xe825('0x23')]);_0x1b0d32[_0xe825('0x21')]=qs[_0xe825('0x21')](_0x373d4b[_0xe825('0x37')][_0xe825('0x21')]);}return _0x576946[_0xe825('0x91')](_0x1b0d32);}})[_0xe825('0x2a')](function(_0x4f8840){if(_0x4f8840){return _0x4f8840?{'count':_0x4cd5a9,'rows':_0x4f8840}:null;}})[_0xe825('0x2a')](respondWithResult(_0x4de21a,null))[_0xe825('0x48')](handleError(_0x4de21a,null));};
\ No newline at end of file
index f9a6bc8..415f3dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3a3=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3de7ba,_0x39a291){var _0x5c6ac7=function(_0x3262a8){while(--_0x3262a8){_0x3de7ba['push'](_0x3de7ba['shift']());}};_0x5c6ac7(++_0x39a291);}(_0xa3a3,0x115));var _0x3a3a=function(_0x325544,_0x4a18c6){_0x325544=_0x325544-0x0;var _0x36b971=_0xa3a3[_0x325544];return _0x36b971;};'use strict';var EventEmitter=require(_0x3a3a('0x0'));var OpenchannelQueue=require(_0x3a3a('0x1'))['db'][_0x3a3a('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3a3a('0x3')](0x0);var events={'afterCreate':_0x3a3a('0x4'),'afterUpdate':_0x3a3a('0x5'),'afterDestroy':_0x3a3a('0x6')};function emitEvent(_0xceebac){return function(_0x2cdd90,_0x44e7e0,_0x5397bb){OpenchannelQueueEvents[_0x3a3a('0x7')](_0xceebac+':'+_0x2cdd90['id'],_0x2cdd90);OpenchannelQueueEvents['emit'](_0xceebac,_0x2cdd90);_0x5397bb(null);};}for(var e in events){if(events[_0x3a3a('0x8')](e)){var event=events[e];OpenchannelQueue[_0x3a3a('0x9')](e,emitEvent(event));}}module[_0x3a3a('0xa')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x5e3d=['hook','events','../../mysqldb','OpenchannelQueue','save','update','remove','emit'];(function(_0x223795,_0x1d863c){var _0x320479=function(_0x56b631){while(--_0x56b631){_0x223795['push'](_0x223795['shift']());}};_0x320479(++_0x1d863c);}(_0x5e3d,0x1c9));var _0xd5e3=function(_0x59716e,_0x5b0a66){_0x59716e=_0x59716e-0x0;var _0x2194b8=_0x5e3d[_0x59716e];return _0x2194b8;};'use strict';var EventEmitter=require(_0xd5e3('0x0'));var OpenchannelQueue=require(_0xd5e3('0x1'))['db'][_0xd5e3('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd5e3('0x3'),'afterUpdate':_0xd5e3('0x4'),'afterDestroy':_0xd5e3('0x5')};function emitEvent(_0x5709c8){return function(_0x3d588d,_0x2dfc1c,_0x297c08){OpenchannelQueueEvents[_0xd5e3('0x6')](_0x5709c8+':'+_0x3d588d['id'],_0x3d588d);OpenchannelQueueEvents['emit'](_0x5709c8,_0x3d588d);_0x297c08(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xd5e3('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index d9c8c70..42c6352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7362=['openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x7362,0xd3));var _0x2736=function(_0x3eb7db,_0x278fca){_0x3eb7db=_0x3eb7db-0x0;var _0x23ed10=_0x7362[_0x3eb7db];return _0x23ed10;};'use strict';var _=require('lodash');var util=require(_0x2736('0x0'));var logger=require(_0x2736('0x1'))(_0x2736('0x2'));var moment=require(_0x2736('0x3'));var BPromise=require(_0x2736('0x4'));var rp=require(_0x2736('0x5'));var fs=require('fs');var path=require(_0x2736('0x6'));var rimraf=require(_0x2736('0x7'));var config=require(_0x2736('0x8'));var attributes=require(_0x2736('0x9'));module[_0x2736('0xa')]=function(_0x58f03f,_0x4de6c2){return _0x58f03f[_0x2736('0xb')](_0x2736('0xc'),attributes,{'tableName':_0x2736('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedcd=['request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','api','bluebird'];(function(_0x4845ff,_0x2455de){var _0x21d4e5=function(_0x4cec28){while(--_0x4cec28){_0x4845ff['push'](_0x4845ff['shift']());}};_0x21d4e5(++_0x2455de);}(_0xedcd,0xa4));var _0xdedc=function(_0x43e4d9,_0x591eae){_0x43e4d9=_0x43e4d9-0x0;var _0x269def=_0xedcd[_0x43e4d9];return _0x269def;};'use strict';var _=require(_0xdedc('0x0'));var util=require(_0xdedc('0x1'));var logger=require('../../config/logger')(_0xdedc('0x2'));var moment=require('moment');var BPromise=require(_0xdedc('0x3'));var rp=require(_0xdedc('0x4'));var fs=require('fs');var path=require(_0xdedc('0x5'));var rimraf=require(_0xdedc('0x6'));var config=require(_0xdedc('0x7'));var attributes=require(_0xdedc('0x8'));module[_0xdedc('0x9')]=function(_0x477638,_0x1acf0b){return _0x477638[_0xdedc('0xa')](_0xdedc('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4a079d3..bbc070b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee9d=['OpenchannelQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue'];(function(_0x43f0cd,_0x2cc305){var _0x1c2856=function(_0xecf8a7){while(--_0xecf8a7){_0x43f0cd['push'](_0x43f0cd['shift']());}};_0x1c2856(++_0x2cc305);}(_0xee9d,0x11a));var _0xdee9=function(_0x1f5612,_0x548148){_0x1f5612=_0x1f5612-0x0;var _0x51d3e2=_0xee9d[_0x1f5612];return _0x51d3e2;};'use strict';var _=require('lodash');var util=require(_0xdee9('0x0'));var moment=require(_0xdee9('0x1'));var BPromise=require('bluebird');var rs=require(_0xdee9('0x2'));var fs=require('fs');var Redis=require(_0xdee9('0x3'));var db=require(_0xdee9('0x4'))['db'];var utils=require(_0xdee9('0x5'));var logger=require(_0xdee9('0x6'))(_0xdee9('0x7'));var config=require(_0xdee9('0x8'));var jayson=require(_0xdee9('0x9'));var client=jayson[_0xdee9('0xa')][_0xdee9('0xb')]({'port':0x232a});config[_0xdee9('0xc')]=_[_0xdee9('0xd')](config[_0xdee9('0xc')],{'host':_0xdee9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdee9('0xc')]));require('./openchannelQueue.socket')[_0xdee9('0xf')](socket);function respondWithRpcPromise(_0x31eec6,_0x23c350,_0x556094){return new BPromise(function(_0x46e99c,_0x432cce){return client['request'](_0x31eec6,_0x556094)[_0xdee9('0x10')](function(_0x29d933){logger[_0xdee9('0x11')](_0xdee9('0x12'),_0x23c350,'request\x20sent');logger[_0xdee9('0x13')](_0xdee9('0x14'),_0x23c350,_0xdee9('0x15'),JSON[_0xdee9('0x16')](_0x29d933));if(_0x29d933['error']){if(_0x29d933[_0xdee9('0x17')][_0xdee9('0x18')]===0x1f4){logger[_0xdee9('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x23c350,_0x29d933[_0xdee9('0x17')]['message']);return _0x432cce(_0x29d933[_0xdee9('0x17')][_0xdee9('0x19')]);}logger[_0xdee9('0x17')](_0xdee9('0x12'),_0x23c350,_0x29d933[_0xdee9('0x17')][_0xdee9('0x19')]);return _0x46e99c(_0x29d933[_0xdee9('0x17')][_0xdee9('0x19')]);}else{logger[_0xdee9('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x23c350,'request\x20sent');_0x46e99c(_0x29d933[_0xdee9('0x1a')][_0xdee9('0x19')]);}})['catch'](function(_0x40c96d){logger[_0xdee9('0x17')](_0xdee9('0x12'),_0x23c350,_0x40c96d);_0x432cce(_0x40c96d);});});}exports[_0xdee9('0x1b')]=function(_0xb5f9a5){var _0x53427d=this;return new Promise(function(_0x17e151,_0x3ed07e){return db['OpenchannelQueue'][_0xdee9('0x1c')]({'raw':_0xb5f9a5[_0xdee9('0x1d')]?_0xb5f9a5[_0xdee9('0x1d')][_0xdee9('0x1e')]===undefined?!![]:![]:!![],'where':_0xb5f9a5[_0xdee9('0x1d')]?_0xb5f9a5[_0xdee9('0x1d')][_0xdee9('0x1f')]||null:null,'attributes':_0xb5f9a5[_0xdee9('0x1d')]?_0xb5f9a5[_0xdee9('0x1d')][_0xdee9('0x20')]||null:null,'limit':_0xb5f9a5['options']?_0xb5f9a5['options'][_0xdee9('0x21')]||null:null,'include':_0xb5f9a5['options']?_0xb5f9a5[_0xdee9('0x1d')][_0xdee9('0x22')]?_[_0xdee9('0x23')](_0xb5f9a5[_0xdee9('0x1d')][_0xdee9('0x22')],function(_0x2c163d){return{'model':db[_0x2c163d[_0xdee9('0x24')]],'as':_0x2c163d['as'],'attributes':_0x2c163d[_0xdee9('0x20')],'include':_0x2c163d[_0xdee9('0x22')]?_[_0xdee9('0x23')](_0x2c163d[_0xdee9('0x22')],function(_0x9e06ca){return{'model':db[_0x9e06ca['model']],'as':_0x9e06ca['as'],'attributes':_0x9e06ca['attributes'],'include':_0x9e06ca[_0xdee9('0x22')]?_[_0xdee9('0x23')](_0x9e06ca[_0xdee9('0x22')],function(_0x4d0ec0){return{'model':db[_0x4d0ec0['model']],'as':_0x4d0ec0['as'],'attributes':_0x4d0ec0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c75f1){logger[_0xdee9('0x11')](_0xdee9('0x1b'),_0xb5f9a5);logger[_0xdee9('0x13')]('GetOpenchannelQueue',_0xb5f9a5,JSON[_0xdee9('0x16')](_0x2c75f1));_0x17e151(_0x2c75f1);})['catch'](function(_0xa942d3){logger['error'](_0xdee9('0x1b'),_0xa942d3[_0xdee9('0x19')],_0xb5f9a5);_0x3ed07e(_0x53427d[_0xdee9('0x17')](0x1f4,_0xa942d3[_0xdee9('0x19')]));});});};exports[_0xdee9('0x25')]=function(_0x1ec5b6){var _0x3f6fff=this;return new Promise(function(_0x4c42b9,_0x5935e6){return db[_0xdee9('0x26')][_0xdee9('0x27')]({'raw':_0x1ec5b6[_0xdee9('0x1d')]?_0x1ec5b6[_0xdee9('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1ec5b6[_0xdee9('0x1d')]?_0x1ec5b6['options'][_0xdee9('0x1f')]||null:null,'attributes':_0x1ec5b6[_0xdee9('0x1d')]?_0x1ec5b6['options'][_0xdee9('0x20')]||null:null,'include':_0x1ec5b6['options']?_0x1ec5b6[_0xdee9('0x1d')][_0xdee9('0x22')]?_[_0xdee9('0x23')](_0x1ec5b6[_0xdee9('0x1d')][_0xdee9('0x22')],function(_0x302446){return{'model':db[_0x302446[_0xdee9('0x24')]],'as':_0x302446['as'],'attributes':_0x302446[_0xdee9('0x20')],'include':_0x302446[_0xdee9('0x22')]?_[_0xdee9('0x23')](_0x302446[_0xdee9('0x22')],function(_0x2c7948){return{'model':db[_0x2c7948[_0xdee9('0x24')]],'as':_0x2c7948['as'],'attributes':_0x2c7948[_0xdee9('0x20')],'include':_0x2c7948['include']?_['map'](_0x2c7948[_0xdee9('0x22')],function(_0xcf923){return{'model':db[_0xcf923[_0xdee9('0x24')]],'as':_0xcf923['as'],'attributes':_0xcf923[_0xdee9('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdee9('0x10')](function(_0x483276){logger[_0xdee9('0x11')](_0xdee9('0x25'),_0x1ec5b6);logger['debug'](_0xdee9('0x25'),_0x1ec5b6,JSON[_0xdee9('0x16')](_0x483276));_0x4c42b9(_0x483276);})['catch'](function(_0x3e21f0){logger[_0xdee9('0x17')](_0xdee9('0x25'),_0x3e21f0['message'],_0x1ec5b6);_0x5935e6(_0x3f6fff['error'](0x1f4,_0x3e21f0[_0xdee9('0x19')]));});});};
\ No newline at end of file
+var _0x4177=['../../config/logger','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','OpenchannelQueue','options','where','attributes','limit','include','model','map','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x16220a,_0x3f1097){var _0x213938=function(_0x444b23){while(--_0x444b23){_0x16220a['push'](_0x16220a['shift']());}};_0x213938(++_0x3f1097);}(_0x4177,0xca));var _0x7417=function(_0x4b8aa9,_0x5a371e){_0x4b8aa9=_0x4b8aa9-0x0;var _0x19a8ae=_0x4177[_0x4b8aa9];return _0x19a8ae;};'use strict';var _=require(_0x7417('0x0'));var util=require(_0x7417('0x1'));var moment=require(_0x7417('0x2'));var BPromise=require(_0x7417('0x3'));var rs=require(_0x7417('0x4'));var fs=require('fs');var Redis=require(_0x7417('0x5'));var db=require(_0x7417('0x6'))['db'];var utils=require(_0x7417('0x7'));var logger=require(_0x7417('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7417('0x9'));var client=jayson[_0x7417('0xa')]['http']({'port':0x232a});config[_0x7417('0xb')]=_['defaults'](config[_0x7417('0xb')],{'host':_0x7417('0xc'),'port':0x18eb});var socket=require(_0x7417('0xd'))(new Redis(config[_0x7417('0xb')]));require(_0x7417('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e1650,_0x455321,_0x3b0773){return new BPromise(function(_0x41c185,_0x495137){return client['request'](_0x2e1650,_0x3b0773)['then'](function(_0x146de2){logger[_0x7417('0xf')](_0x7417('0x10'),_0x455321,_0x7417('0x11'));logger[_0x7417('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x455321,_0x7417('0x11'),JSON['stringify'](_0x146de2));if(_0x146de2[_0x7417('0x13')]){if(_0x146de2['error'][_0x7417('0x14')]===0x1f4){logger['error'](_0x7417('0x10'),_0x455321,_0x146de2[_0x7417('0x13')][_0x7417('0x15')]);return _0x495137(_0x146de2[_0x7417('0x13')]['message']);}logger[_0x7417('0x13')](_0x7417('0x10'),_0x455321,_0x146de2[_0x7417('0x13')][_0x7417('0x15')]);return _0x41c185(_0x146de2[_0x7417('0x13')][_0x7417('0x15')]);}else{logger[_0x7417('0xf')](_0x7417('0x10'),_0x455321,_0x7417('0x11'));_0x41c185(_0x146de2['result']['message']);}})[_0x7417('0x16')](function(_0x44fedd){logger[_0x7417('0x13')](_0x7417('0x10'),_0x455321,_0x44fedd);_0x495137(_0x44fedd);});});}exports['GetOpenchannelQueue']=function(_0x547fb8){var _0x39d5f5=this;return new Promise(function(_0xf939cd,_0xb689e9){return db[_0x7417('0x17')]['findAll']({'raw':_0x547fb8[_0x7417('0x18')]?_0x547fb8[_0x7417('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x547fb8[_0x7417('0x18')]?_0x547fb8[_0x7417('0x18')][_0x7417('0x19')]||null:null,'attributes':_0x547fb8[_0x7417('0x18')]?_0x547fb8[_0x7417('0x18')][_0x7417('0x1a')]||null:null,'limit':_0x547fb8[_0x7417('0x18')]?_0x547fb8[_0x7417('0x18')][_0x7417('0x1b')]||null:null,'include':_0x547fb8[_0x7417('0x18')]?_0x547fb8[_0x7417('0x18')][_0x7417('0x1c')]?_['map'](_0x547fb8['options'][_0x7417('0x1c')],function(_0x9af0d9){return{'model':db[_0x9af0d9[_0x7417('0x1d')]],'as':_0x9af0d9['as'],'attributes':_0x9af0d9[_0x7417('0x1a')],'include':_0x9af0d9['include']?_[_0x7417('0x1e')](_0x9af0d9[_0x7417('0x1c')],function(_0x478184){return{'model':db[_0x478184[_0x7417('0x1d')]],'as':_0x478184['as'],'attributes':_0x478184['attributes'],'include':_0x478184[_0x7417('0x1c')]?_[_0x7417('0x1e')](_0x478184[_0x7417('0x1c')],function(_0x1e51d6){return{'model':db[_0x1e51d6[_0x7417('0x1d')]],'as':_0x1e51d6['as'],'attributes':_0x1e51d6[_0x7417('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f1e59){logger[_0x7417('0xf')](_0x7417('0x1f'),_0x547fb8);logger[_0x7417('0x12')](_0x7417('0x1f'),_0x547fb8,JSON[_0x7417('0x20')](_0x2f1e59));_0xf939cd(_0x2f1e59);})[_0x7417('0x16')](function(_0x463bbe){logger['error'](_0x7417('0x1f'),_0x463bbe[_0x7417('0x15')],_0x547fb8);_0xb689e9(_0x39d5f5['error'](0x1f4,_0x463bbe[_0x7417('0x15')]));});});};exports[_0x7417('0x21')]=function(_0x8ceaa8){var _0x1f20be=this;return new Promise(function(_0x1dab06,_0x593c75){return db['OpenchannelQueue']['find']({'raw':_0x8ceaa8['options']?_0x8ceaa8[_0x7417('0x18')][_0x7417('0x22')]===undefined?!![]:![]:!![],'where':_0x8ceaa8[_0x7417('0x18')]?_0x8ceaa8[_0x7417('0x18')][_0x7417('0x19')]||null:null,'attributes':_0x8ceaa8[_0x7417('0x18')]?_0x8ceaa8[_0x7417('0x18')][_0x7417('0x1a')]||null:null,'include':_0x8ceaa8[_0x7417('0x18')]?_0x8ceaa8[_0x7417('0x18')][_0x7417('0x1c')]?_[_0x7417('0x1e')](_0x8ceaa8[_0x7417('0x18')][_0x7417('0x1c')],function(_0x51b42d){return{'model':db[_0x51b42d[_0x7417('0x1d')]],'as':_0x51b42d['as'],'attributes':_0x51b42d['attributes'],'include':_0x51b42d[_0x7417('0x1c')]?_['map'](_0x51b42d[_0x7417('0x1c')],function(_0x3e9e8c){return{'model':db[_0x3e9e8c['model']],'as':_0x3e9e8c['as'],'attributes':_0x3e9e8c[_0x7417('0x1a')],'include':_0x3e9e8c[_0x7417('0x1c')]?_[_0x7417('0x1e')](_0x3e9e8c[_0x7417('0x1c')],function(_0x492356){return{'model':db[_0x492356[_0x7417('0x1d')]],'as':_0x492356['as'],'attributes':_0x492356['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x278737){logger['info']('ShowOpenchannelQueue',_0x8ceaa8);logger['debug'](_0x7417('0x21'),_0x8ceaa8,JSON[_0x7417('0x20')](_0x278737));_0x1dab06(_0x278737);})[_0x7417('0x16')](function(_0x34e01e){logger[_0x7417('0x13')](_0x7417('0x21'),_0x34e01e[_0x7417('0x15')],_0x8ceaa8);_0x593c75(_0x1f20be[_0x7417('0x13')](0x1f4,_0x34e01e[_0x7417('0x15')]));});});};
\ No newline at end of file
index 528f680..2146642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb72=['openchannelQueue:','save','remove','update','removeListener','register','length'];(function(_0x43e8e4,_0x560495){var _0x34ae93=function(_0x4315b1){while(--_0x4315b1){_0x43e8e4['push'](_0x43e8e4['shift']());}};_0x34ae93(++_0x560495);}(_0xcb72,0x120));var _0x2cb7=function(_0xaf829a,_0x532ca2){_0xaf829a=_0xaf829a-0x0;var _0x3f8d6d=_0xcb72[_0xaf829a];return _0x3f8d6d;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x2cb7('0x0'),_0x2cb7('0x1'),_0x2cb7('0x2')];function createListener(_0x393aa3,_0x141dc6){return function(_0x15fe6c){_0x141dc6['emit'](_0x393aa3,_0x15fe6c);};}function removeListener(_0x404d48,_0xacf389){return function(){OpenchannelQueueEvents[_0x2cb7('0x3')](_0x404d48,_0xacf389);};}exports[_0x2cb7('0x4')]=function(_0xdc0f8f){for(var _0x365396=0x0,_0x229d72=events[_0x2cb7('0x5')];_0x365396<_0x229d72;_0x365396++){var _0x354d42=events[_0x365396];var _0x5a053d=createListener(_0x2cb7('0x6')+_0x354d42,_0xdc0f8f);OpenchannelQueueEvents['on'](_0x354d42,_0x5a053d);}};
\ No newline at end of file
+var _0xda8b=['save','remove','update','removeListener','length','./openchannelQueue.events'];(function(_0x2b51a9,_0x5b9092){var _0x2de139=function(_0x5076b3){while(--_0x5076b3){_0x2b51a9['push'](_0x2b51a9['shift']());}};_0x2de139(++_0x5b9092);}(_0xda8b,0x173));var _0xbda8=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xda8b[_0x47b58b];return _0x46bebe;};'use strict';var OpenchannelQueueEvents=require(_0xbda8('0x0'));var events=[_0xbda8('0x1'),_0xbda8('0x2'),_0xbda8('0x3')];function createListener(_0x2d13bb,_0x5a791f){return function(_0x587529){_0x5a791f['emit'](_0x2d13bb,_0x587529);};}function removeListener(_0x37962c,_0x4b3376){return function(){OpenchannelQueueEvents[_0xbda8('0x4')](_0x37962c,_0x4b3376);};}exports['register']=function(_0x18cf97){for(var _0x277539=0x0,_0x433526=events[_0xbda8('0x5')];_0x277539<_0x433526;_0x277539++){var _0x1f0ba2=events[_0x277539];var _0x1f2204=createListener('openchannelQueue:'+_0x1f0ba2,_0x18cf97);OpenchannelQueueEvents['on'](_0x1f0ba2,_0x1f2204);}};
\ No newline at end of file
index 179f5d2..881e6a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0276=['/describe','/:id','isAuthenticated','create','put','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index'];(function(_0x3b4c77,_0x5606e9){var _0x26079c=function(_0x115e9b){while(--_0x115e9b){_0x3b4c77['push'](_0x3b4c77['shift']());}};_0x26079c(++_0x5606e9);}(_0x0276,0x1c9));var _0x6027=function(_0x3b5964,_0x2f21c4){_0x3b5964=_0x3b5964-0x0;var _0xbc8296=_0x0276[_0x3b5964];return _0xbc8296;};'use strict';var multer=require(_0x6027('0x0'));var util=require(_0x6027('0x1'));var path=require(_0x6027('0x2'));var timeout=require('connect-timeout');var express=require(_0x6027('0x3'));var router=express[_0x6027('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6027('0x5'));var interaction=require(_0x6027('0x6'));var config=require(_0x6027('0x7'));var controller=require(_0x6027('0x8'));router[_0x6027('0x9')]('/',auth['isAuthenticated'](),controller[_0x6027('0xa')]);router[_0x6027('0x9')](_0x6027('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6027('0xc'),auth[_0x6027('0xd')](),controller['show']);router['post']('/',auth[_0x6027('0xd')](),controller[_0x6027('0xe')]);router[_0x6027('0xf')](_0x6027('0xc'),auth[_0x6027('0xd')](),controller['update']);router['delete'](_0x6027('0xc'),auth[_0x6027('0xd')](),controller[_0x6027('0x10')]);module[_0x6027('0x11')]=router;
\ No newline at end of file
+var _0x0765=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','describe'];(function(_0xb68331,_0x35a503){var _0x42e822=function(_0x55b42e){while(--_0x55b42e){_0xb68331['push'](_0xb68331['shift']());}};_0x42e822(++_0x35a503);}(_0x0765,0x87));var _0x5076=function(_0x22ec3a,_0x3f65c9){_0x22ec3a=_0x22ec3a-0x0;var _0xc4838c=_0x0765[_0x22ec3a];return _0xc4838c;};'use strict';var multer=require('multer');var util=require(_0x5076('0x0'));var path=require(_0x5076('0x1'));var timeout=require('connect-timeout');var express=require(_0x5076('0x2'));var router=express[_0x5076('0x3')]();var fs_extra=require(_0x5076('0x4'));var auth=require(_0x5076('0x5'));var interaction=require(_0x5076('0x6'));var config=require('../../config/environment');var controller=require(_0x5076('0x7'));router[_0x5076('0x8')]('/',auth[_0x5076('0x9')](),controller[_0x5076('0xa')]);router[_0x5076('0x8')]('/describe',auth[_0x5076('0x9')](),controller[_0x5076('0xb')]);router[_0x5076('0x8')](_0x5076('0xc'),auth[_0x5076('0x9')](),controller[_0x5076('0xd')]);router[_0x5076('0xe')]('/',auth['isAuthenticated'](),controller[_0x5076('0xf')]);router[_0x5076('0x10')](_0x5076('0xc'),auth[_0x5076('0x9')](),controller[_0x5076('0x11')]);router[_0x5076('0x12')](_0x5076('0xc'),auth['isAuthenticated'](),controller[_0x5076('0x13')]);module[_0x5076('0x14')]=router;
\ No newline at end of file
index 1ae3647..d3d1b0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27db=['moment','sequelize','STRING','DATE'];(function(_0x53901d,_0x16c08c){var _0x272e3b=function(_0x521e89){while(--_0x521e89){_0x53901d['push'](_0x53901d['shift']());}};_0x272e3b(++_0x16c08c);}(_0x27db,0x1e4));var _0xb27d=function(_0x5a47de,_0x57a87c){_0x5a47de=_0x5a47de-0x0;var _0x400ee6=_0x27db[_0x5a47de];return _0x400ee6;};'use strict';var moment=require(_0xb27d('0x0'));var Sequelize=require(_0xb27d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb27d('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb27d('0x3')]},'leaveAt':{'type':Sequelize[_0xb27d('0x3')]},'acceptAt':{'type':Sequelize[_0xb27d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb27d('0x2')]}};
\ No newline at end of file
+var _0xa8ce=['sequelize','exports','STRING','DATE','moment'];(function(_0x4cd503,_0x4dd006){var _0x2de69e=function(_0x428725){while(--_0x428725){_0x4cd503['push'](_0x4cd503['shift']());}};_0x2de69e(++_0x4dd006);}(_0xa8ce,0xc7));var _0xea8c=function(_0x554371,_0x367e0a){_0x554371=_0x554371-0x0;var _0x32e27a=_0xa8ce[_0x554371];return _0x32e27a;};'use strict';var moment=require(_0xea8c('0x0'));var Sequelize=require(_0xea8c('0x1'));module[_0xea8c('0x2')]={'uniqueid':{'type':Sequelize[_0xea8c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xea8c('0x3')]},'joinAt':{'type':Sequelize[_0xea8c('0x4')]},'leaveAt':{'type':Sequelize[_0xea8c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xea8c('0x4')]},'reason':{'type':Sequelize[_0xea8c('0x3')]}};
\ No newline at end of file
index c757942..c6c227c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0072=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','then','error','name','send','index','OpenchannelQueueReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','include','findAll','rows','catch','show','length','includeAll','options','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir'];(function(_0x276dd0,_0x5df23c){var _0x10ea33=function(_0x43bdfb){while(--_0x43bdfb){_0x276dd0['push'](_0x276dd0['shift']());}};_0x10ea33(++_0x5df23c);}(_0x0072,0x179));var _0x2007=function(_0x55414d,_0x478837){_0x55414d=_0x55414d-0x0;var _0x4461b6=_0x0072[_0x55414d];return _0x4461b6;};'use strict';var emlformat=require(_0x2007('0x0'));var rimraf=require(_0x2007('0x1'));var zipdir=require(_0x2007('0x2'));var jsonpatch=require(_0x2007('0x3'));var rp=require(_0x2007('0x4'));var moment=require(_0x2007('0x5'));var BPromise=require(_0x2007('0x6'));var Mustache=require(_0x2007('0x7'));var util=require('util');var path=require(_0x2007('0x8'));var sox=require(_0x2007('0x9'));var csv=require(_0x2007('0xa'));var ejs=require(_0x2007('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2007('0xc'));var squel=require(_0x2007('0xd'));var crypto=require(_0x2007('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2007('0xf'));var toCsv=require(_0x2007('0xa'));var querystring=require(_0x2007('0x10'));var Papa=require('papaparse');var Redis=require(_0x2007('0x11'));var authService=require(_0x2007('0x12'));var qs=require(_0x2007('0x13'));var as=require(_0x2007('0x14'));var hardwareService=require(_0x2007('0x15'));var logger=require('../../config/logger')(_0x2007('0x16'));var utils=require(_0x2007('0x17'));var config=require(_0x2007('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2007('0x19'))['db'];function respondWithStatusCode(_0x3ec6ce,_0x53461e){_0x53461e=_0x53461e||0xcc;return function(_0x1f31a6){if(_0x1f31a6){return _0x3ec6ce[_0x2007('0x1a')](_0x53461e);}return _0x3ec6ce[_0x2007('0x1b')](_0x53461e)['end']();};}function respondWithResult(_0x4e0826,_0x2d01c5){_0x2d01c5=_0x2d01c5||0xc8;return function(_0x4a95a8){if(_0x4a95a8){return _0x4e0826[_0x2007('0x1b')](_0x2d01c5)['json'](_0x4a95a8);}};}function respondWithFilteredResult(_0x430757,_0x11e63a){return function(_0x464cb9){if(_0x464cb9){var _0x115b24=typeof _0x11e63a[_0x2007('0x1c')]===_0x2007('0x1d')&&typeof _0x11e63a[_0x2007('0x1e')]==='undefined';var _0x5663ed=_0x464cb9[_0x2007('0x1f')];var _0x1b2da8=_0x115b24?0x0:_0x11e63a[_0x2007('0x1c')];var _0x1edf71=_0x115b24?_0x464cb9[_0x2007('0x1f')]:_0x11e63a[_0x2007('0x1c')]+_0x11e63a['limit'];var _0x449774;if(_0x1edf71>=_0x5663ed){_0x1edf71=_0x5663ed;_0x449774=0xc8;}else{_0x449774=0xce;}_0x430757[_0x2007('0x1b')](_0x449774);return _0x430757['set'](_0x2007('0x20'),_0x1b2da8+'-'+_0x1edf71+'/'+_0x5663ed)[_0x2007('0x21')](_0x464cb9);}return null;};}function patchUpdates(_0x5c9eec){return function(_0x24721f){try{jsonpatch[_0x2007('0x22')](_0x24721f,_0x5c9eec,!![]);}catch(_0x17c978){return BPromise['reject'](_0x17c978);}return _0x24721f[_0x2007('0x23')]();};}function saveUpdates(_0x201e16,_0x20cbe9){return function(_0x329900){if(_0x329900){return _0x329900['update'](_0x201e16)[_0x2007('0x24')](function(_0x2399b9){return _0x2399b9;});}return null;};}function removeEntity(_0xce1695,_0xeffe7b){return function(_0x4cd83b){if(_0x4cd83b){return _0x4cd83b['destroy']()['then'](function(){_0xce1695[_0x2007('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ee11,_0x281748){return function(_0x6a43f0){if(!_0x6a43f0){_0x15ee11[_0x2007('0x1a')](0x194);}return _0x6a43f0;};}function handleError(_0x5d33fa,_0x23e783){_0x23e783=_0x23e783||0x1f4;return function(_0x3af39c){logger[_0x2007('0x25')](_0x3af39c['stack']);if(_0x3af39c[_0x2007('0x26')]){delete _0x3af39c[_0x2007('0x26')];}_0x5d33fa[_0x2007('0x1b')](_0x23e783)[_0x2007('0x27')](_0x3af39c);};}exports[_0x2007('0x28')]=function(_0x21f292,_0x176291){var _0x1cc4eb={},_0x1cd654={},_0x4e8002={'count':0x0,'rows':[]};var _0xc0dc38=_['map'](db[_0x2007('0x29')]['rawAttributes'],function(_0x3ec780){return{'name':_0x3ec780[_0x2007('0x2a')],'type':_0x3ec780['type'][_0x2007('0x2b')]};});_0x1cd654[_0x2007('0x2c')]=_[_0x2007('0x2d')](_0xc0dc38,_0x2007('0x26'));_0x1cd654[_0x2007('0x2e')]=_[_0x2007('0x2f')](_0x21f292[_0x2007('0x2e')]);_0x1cd654[_0x2007('0x30')]=_[_0x2007('0x31')](_0x1cd654[_0x2007('0x2c')],_0x1cd654[_0x2007('0x2e')]);_0x1cc4eb[_0x2007('0x32')]=_['intersection'](_0x1cd654[_0x2007('0x2c')],qs[_0x2007('0x33')](_0x21f292[_0x2007('0x2e')]['fields']));_0x1cc4eb[_0x2007('0x32')]=_0x1cc4eb[_0x2007('0x32')]['length']?_0x1cc4eb[_0x2007('0x32')]:_0x1cd654[_0x2007('0x2c')];if(!_0x21f292[_0x2007('0x2e')][_0x2007('0x34')](_0x2007('0x35'))){_0x1cc4eb[_0x2007('0x1e')]=qs[_0x2007('0x1e')](_0x21f292[_0x2007('0x2e')][_0x2007('0x1e')]);_0x1cc4eb[_0x2007('0x1c')]=qs[_0x2007('0x1c')](_0x21f292[_0x2007('0x2e')][_0x2007('0x1c')]);}_0x1cc4eb[_0x2007('0x36')]=qs[_0x2007('0x37')](_0x21f292[_0x2007('0x2e')][_0x2007('0x37')]);_0x1cc4eb[_0x2007('0x38')]=qs[_0x2007('0x30')](_[_0x2007('0x39')](_0x21f292[_0x2007('0x2e')],_0x1cd654[_0x2007('0x30')]),_0xc0dc38);if(_0x21f292[_0x2007('0x2e')][_0x2007('0x3a')]){_0x1cc4eb[_0x2007('0x38')]=_['merge'](_0x1cc4eb[_0x2007('0x38')],{'$or':_['map'](_0xc0dc38,function(_0x4b8b97){if(_0x4b8b97[_0x2007('0x3b')]!==_0x2007('0x3c')){var _0x39ea30={};_0x39ea30[_0x4b8b97[_0x2007('0x26')]]={'$like':'%'+_0x21f292[_0x2007('0x2e')][_0x2007('0x3a')]+'%'};return _0x39ea30;}})});}_0x1cc4eb=_[_0x2007('0x3d')]({},_0x1cc4eb,_0x21f292['options']);var _0x1596dc={'where':_0x1cc4eb['where']};return db[_0x2007('0x29')][_0x2007('0x1f')](_0x1596dc)[_0x2007('0x24')](function(_0x4b8fb5){_0x4e8002['count']=_0x4b8fb5;if(_0x21f292[_0x2007('0x2e')]['includeAll']){_0x1cc4eb[_0x2007('0x3e')]=[{'all':!![]}];}return db[_0x2007('0x29')][_0x2007('0x3f')](_0x1cc4eb);})[_0x2007('0x24')](function(_0x554c15){_0x4e8002[_0x2007('0x40')]=_0x554c15;return _0x4e8002;})[_0x2007('0x24')](respondWithFilteredResult(_0x176291,_0x1cc4eb))[_0x2007('0x41')](handleError(_0x176291,null));};exports[_0x2007('0x42')]=function(_0xbe5dc3,_0x1b6c75){var _0x2858a9={'raw':!![],'where':{'id':_0xbe5dc3['params']['id']}},_0x59ae22={};_0x59ae22[_0x2007('0x2c')]=_['keys'](db['OpenchannelQueueReport']['rawAttributes']);_0x59ae22[_0x2007('0x2e')]=_[_0x2007('0x2f')](_0xbe5dc3[_0x2007('0x2e')]);_0x59ae22[_0x2007('0x30')]=_[_0x2007('0x31')](_0x59ae22['model'],_0x59ae22[_0x2007('0x2e')]);_0x2858a9[_0x2007('0x32')]=_[_0x2007('0x31')](_0x59ae22[_0x2007('0x2c')],qs[_0x2007('0x33')](_0xbe5dc3[_0x2007('0x2e')][_0x2007('0x33')]));_0x2858a9[_0x2007('0x32')]=_0x2858a9[_0x2007('0x32')][_0x2007('0x43')]?_0x2858a9[_0x2007('0x32')]:_0x59ae22['model'];if(_0xbe5dc3[_0x2007('0x2e')][_0x2007('0x44')]){_0x2858a9[_0x2007('0x3e')]=[{'all':!![]}];}_0x2858a9=_[_0x2007('0x3d')]({},_0x2858a9,_0xbe5dc3[_0x2007('0x45')]);return db[_0x2007('0x29')][_0x2007('0x46')](_0x2858a9)[_0x2007('0x24')](handleEntityNotFound(_0x1b6c75,null))[_0x2007('0x24')](respondWithResult(_0x1b6c75,null))[_0x2007('0x41')](handleError(_0x1b6c75,null));};exports[_0x2007('0x47')]=function(_0x5b4e75,_0x10dd13){return db[_0x2007('0x29')][_0x2007('0x47')](_0x5b4e75['body'],{})[_0x2007('0x24')](respondWithResult(_0x10dd13,0xc9))[_0x2007('0x41')](handleError(_0x10dd13,null));};exports['update']=function(_0x1cc424,_0xcbce5d){if(_0x1cc424[_0x2007('0x48')]['id']){delete _0x1cc424[_0x2007('0x48')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x1cc424[_0x2007('0x49')]['id']}})[_0x2007('0x24')](handleEntityNotFound(_0xcbce5d,null))['then'](saveUpdates(_0x1cc424[_0x2007('0x48')],null))[_0x2007('0x24')](respondWithResult(_0xcbce5d,null))[_0x2007('0x41')](handleError(_0xcbce5d,null));};exports[_0x2007('0x4a')]=function(_0x26b105,_0x52a72e){return db[_0x2007('0x29')][_0x2007('0x46')]({'where':{'id':_0x26b105[_0x2007('0x49')]['id']}})[_0x2007('0x24')](handleEntityNotFound(_0x52a72e,null))[_0x2007('0x24')](removeEntity(_0x52a72e,null))[_0x2007('0x41')](handleError(_0x52a72e,null));};exports[_0x2007('0x4b')]=function(_0x19fafb,_0x5e71ec){return db['OpenchannelQueueReport']['describe']()[_0x2007('0x24')](respondWithResult(_0x5e71ec,null))[_0x2007('0x41')](handleError(_0x5e71ec,null));};
\ No newline at end of file
+var _0x89a9=['save','update','then','sendStatus','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x89a9,0x75));var _0x989a=function(_0x43f937,_0x42b4e8){_0x43f937=_0x43f937-0x0;var _0x1664af=_0x89a9[_0x43f937];return _0x1664af;};'use strict';var emlformat=require(_0x989a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x989a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x989a('0x2'));var moment=require(_0x989a('0x3'));var BPromise=require(_0x989a('0x4'));var Mustache=require(_0x989a('0x5'));var util=require(_0x989a('0x6'));var path=require(_0x989a('0x7'));var sox=require(_0x989a('0x8'));var csv=require(_0x989a('0x9'));var ejs=require(_0x989a('0xa'));var fs=require('fs');var fs_extra=require(_0x989a('0xb'));var _=require(_0x989a('0xc'));var squel=require(_0x989a('0xd'));var crypto=require(_0x989a('0xe'));var jsforce=require(_0x989a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x989a('0x9'));var querystring=require(_0x989a('0x10'));var Papa=require('papaparse');var Redis=require(_0x989a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x989a('0x12'));var as=require(_0x989a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x989a('0x14'));var utils=require(_0x989a('0x15'));var config=require(_0x989a('0x16'));var licenseUtil=require(_0x989a('0x17'));var db=require(_0x989a('0x18'))['db'];function respondWithStatusCode(_0x5524ea,_0x1519b0){_0x1519b0=_0x1519b0||0xcc;return function(_0x35f0a5){if(_0x35f0a5){return _0x5524ea['sendStatus'](_0x1519b0);}return _0x5524ea[_0x989a('0x19')](_0x1519b0)[_0x989a('0x1a')]();};}function respondWithResult(_0x4f8066,_0x5e1604){_0x5e1604=_0x5e1604||0xc8;return function(_0x31ce6c){if(_0x31ce6c){return _0x4f8066['status'](_0x5e1604)[_0x989a('0x1b')](_0x31ce6c);}};}function respondWithFilteredResult(_0x1a005c,_0x9e2a6b){return function(_0x5c229d){if(_0x5c229d){var _0x555b34=typeof _0x9e2a6b['offset']===_0x989a('0x1c')&&typeof _0x9e2a6b[_0x989a('0x1d')]===_0x989a('0x1c');var _0x40f110=_0x5c229d[_0x989a('0x1e')];var _0x2c0087=_0x555b34?0x0:_0x9e2a6b[_0x989a('0x1f')];var _0x196699=_0x555b34?_0x5c229d[_0x989a('0x1e')]:_0x9e2a6b[_0x989a('0x1f')]+_0x9e2a6b[_0x989a('0x1d')];var _0x102f0c;if(_0x196699>=_0x40f110){_0x196699=_0x40f110;_0x102f0c=0xc8;}else{_0x102f0c=0xce;}_0x1a005c['status'](_0x102f0c);return _0x1a005c[_0x989a('0x20')]('Content-Range',_0x2c0087+'-'+_0x196699+'/'+_0x40f110)['json'](_0x5c229d);}return null;};}function patchUpdates(_0x466997){return function(_0x13d855){try{jsonpatch[_0x989a('0x21')](_0x13d855,_0x466997,!![]);}catch(_0xbf7a77){return BPromise[_0x989a('0x22')](_0xbf7a77);}return _0x13d855[_0x989a('0x23')]();};}function saveUpdates(_0x4b7124,_0x15adba){return function(_0x5b8e3b){if(_0x5b8e3b){return _0x5b8e3b[_0x989a('0x24')](_0x4b7124)['then'](function(_0x5996ea){return _0x5996ea;});}return null;};}function removeEntity(_0x1a2251,_0x6259a){return function(_0x522bf8){if(_0x522bf8){return _0x522bf8['destroy']()[_0x989a('0x25')](function(){_0x1a2251[_0x989a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59ab08,_0xdb3f6){return function(_0x599d99){if(!_0x599d99){_0x59ab08[_0x989a('0x26')](0x194);}return _0x599d99;};}function handleError(_0x3a6abc,_0x2638d2){_0x2638d2=_0x2638d2||0x1f4;return function(_0x4a2233){logger[_0x989a('0x27')](_0x4a2233[_0x989a('0x28')]);if(_0x4a2233[_0x989a('0x29')]){delete _0x4a2233['name'];}_0x3a6abc['status'](_0x2638d2)[_0x989a('0x2a')](_0x4a2233);};}exports[_0x989a('0x2b')]=function(_0x40f3f3,_0x24ac97){var _0x9196cc={},_0x55ee94={},_0x56f942={'count':0x0,'rows':[]};var _0x2ac484=_['map'](db[_0x989a('0x2c')][_0x989a('0x2d')],function(_0x1e6604){return{'name':_0x1e6604['fieldName'],'type':_0x1e6604[_0x989a('0x2e')][_0x989a('0x2f')]};});_0x55ee94[_0x989a('0x30')]=_[_0x989a('0x31')](_0x2ac484,_0x989a('0x29'));_0x55ee94[_0x989a('0x32')]=_[_0x989a('0x33')](_0x40f3f3[_0x989a('0x32')]);_0x55ee94[_0x989a('0x34')]=_['intersection'](_0x55ee94['model'],_0x55ee94['query']);_0x9196cc['attributes']=_[_0x989a('0x35')](_0x55ee94['model'],qs['fields'](_0x40f3f3[_0x989a('0x32')][_0x989a('0x36')]));_0x9196cc['attributes']=_0x9196cc[_0x989a('0x37')][_0x989a('0x38')]?_0x9196cc['attributes']:_0x55ee94[_0x989a('0x30')];if(!_0x40f3f3[_0x989a('0x32')][_0x989a('0x39')](_0x989a('0x3a'))){_0x9196cc[_0x989a('0x1d')]=qs[_0x989a('0x1d')](_0x40f3f3['query'][_0x989a('0x1d')]);_0x9196cc['offset']=qs[_0x989a('0x1f')](_0x40f3f3[_0x989a('0x32')]['offset']);}_0x9196cc['order']=qs[_0x989a('0x3b')](_0x40f3f3[_0x989a('0x32')][_0x989a('0x3b')]);_0x9196cc[_0x989a('0x3c')]=qs['filters'](_[_0x989a('0x3d')](_0x40f3f3[_0x989a('0x32')],_0x55ee94[_0x989a('0x34')]),_0x2ac484);if(_0x40f3f3['query'][_0x989a('0x3e')]){_0x9196cc[_0x989a('0x3c')]=_['merge'](_0x9196cc['where'],{'$or':_[_0x989a('0x31')](_0x2ac484,function(_0x46851a){if(_0x46851a['type']!==_0x989a('0x3f')){var _0x27b7d5={};_0x27b7d5[_0x46851a[_0x989a('0x29')]]={'$like':'%'+_0x40f3f3[_0x989a('0x32')][_0x989a('0x3e')]+'%'};return _0x27b7d5;}})});}_0x9196cc=_['merge']({},_0x9196cc,_0x40f3f3[_0x989a('0x40')]);var _0x3bd60a={'where':_0x9196cc[_0x989a('0x3c')]};return db[_0x989a('0x2c')][_0x989a('0x1e')](_0x3bd60a)[_0x989a('0x25')](function(_0x59424f){_0x56f942[_0x989a('0x1e')]=_0x59424f;if(_0x40f3f3['query'][_0x989a('0x41')]){_0x9196cc[_0x989a('0x42')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x989a('0x43')](_0x9196cc);})[_0x989a('0x25')](function(_0x15b1e0){_0x56f942['rows']=_0x15b1e0;return _0x56f942;})['then'](respondWithFilteredResult(_0x24ac97,_0x9196cc))[_0x989a('0x44')](handleError(_0x24ac97,null));};exports[_0x989a('0x45')]=function(_0x2ba630,_0x5d464e){var _0xf3328a={'raw':!![],'where':{'id':_0x2ba630['params']['id']}},_0x480d26={};_0x480d26[_0x989a('0x30')]=_[_0x989a('0x33')](db[_0x989a('0x2c')]['rawAttributes']);_0x480d26['query']=_[_0x989a('0x33')](_0x2ba630[_0x989a('0x32')]);_0x480d26[_0x989a('0x34')]=_[_0x989a('0x35')](_0x480d26[_0x989a('0x30')],_0x480d26[_0x989a('0x32')]);_0xf3328a[_0x989a('0x37')]=_[_0x989a('0x35')](_0x480d26['model'],qs[_0x989a('0x36')](_0x2ba630[_0x989a('0x32')][_0x989a('0x36')]));_0xf3328a[_0x989a('0x37')]=_0xf3328a[_0x989a('0x37')]['length']?_0xf3328a['attributes']:_0x480d26[_0x989a('0x30')];if(_0x2ba630[_0x989a('0x32')][_0x989a('0x41')]){_0xf3328a[_0x989a('0x42')]=[{'all':!![]}];}_0xf3328a=_['merge']({},_0xf3328a,_0x2ba630[_0x989a('0x40')]);return db[_0x989a('0x2c')][_0x989a('0x46')](_0xf3328a)[_0x989a('0x25')](handleEntityNotFound(_0x5d464e,null))[_0x989a('0x25')](respondWithResult(_0x5d464e,null))[_0x989a('0x44')](handleError(_0x5d464e,null));};exports[_0x989a('0x47')]=function(_0x371a3e,_0x1f1aee){return db[_0x989a('0x2c')]['create'](_0x371a3e['body'],{})[_0x989a('0x25')](respondWithResult(_0x1f1aee,0xc9))[_0x989a('0x44')](handleError(_0x1f1aee,null));};exports[_0x989a('0x24')]=function(_0x2b858f,_0x2cfc04){if(_0x2b858f[_0x989a('0x48')]['id']){delete _0x2b858f[_0x989a('0x48')]['id'];}return db[_0x989a('0x2c')]['find']({'where':{'id':_0x2b858f[_0x989a('0x49')]['id']}})[_0x989a('0x25')](handleEntityNotFound(_0x2cfc04,null))[_0x989a('0x25')](saveUpdates(_0x2b858f[_0x989a('0x48')],null))['then'](respondWithResult(_0x2cfc04,null))['catch'](handleError(_0x2cfc04,null));};exports[_0x989a('0x4a')]=function(_0x59f337,_0x42a462){return db[_0x989a('0x2c')][_0x989a('0x46')]({'where':{'id':_0x59f337[_0x989a('0x49')]['id']}})['then'](handleEntityNotFound(_0x42a462,null))['then'](removeEntity(_0x42a462,null))[_0x989a('0x44')](handleError(_0x42a462,null));};exports['describe']=function(_0x5e1768,_0x15c43f){return db[_0x989a('0x2c')][_0x989a('0x4b')]()[_0x989a('0x25')](respondWithResult(_0x15c43f,null))[_0x989a('0x44')](handleError(_0x15c43f,null));};
\ No newline at end of file
index ad085c4..fa7f961 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x86fb96,_0x3e5a88){var _0x898130=function(_0x5033da){while(--_0x5033da){_0x86fb96['push'](_0x86fb96['shift']());}};_0x898130(++_0x3e5a88);}(_0x7a54,0x106));var _0x47a5=function(_0x1c85af,_0x864e14){_0x1c85af=_0x1c85af-0x0;var _0x472586=_0x7a54[_0x1c85af];return _0x472586;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x814b,0x1a2));var _0xb814=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0x814b[_0x5a6de2];return _0x2c0525;};'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
index bb20858..6ede96e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e2e=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','debug','catch','update','attributes','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x56ed26,_0x245dfa){_0x56ed26=_0x56ed26-0x0;var _0x104025=_0x4e2e[_0x56ed26];return _0x104025;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}exports['CreateOpenchannelQueueReport']=function(_0x196f16){var _0x54c80b=this;return new Promise(function(_0x1d5e9d,_0x3f313b){return db[_0xe4e2('0x15')][_0xe4e2('0x16')](_0x196f16[_0xe4e2('0x17')],{'raw':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x19')]===undefined?!![]:![]:!![]})[_0xe4e2('0xc')](function(_0x362741){logger['info'](_0xe4e2('0x1a'),_0x196f16);logger[_0xe4e2('0x1b')](_0xe4e2('0x1a'),_0x196f16,JSON[_0xe4e2('0x11')](_0x362741));_0x1d5e9d(_0x362741);})[_0xe4e2('0x1c')](function(_0x23b466){logger[_0xe4e2('0x12')]('CreateOpenchannelQueueReport',_0x23b466[_0xe4e2('0x13')],_0x196f16);_0x3f313b(_0x54c80b[_0xe4e2('0x12')](0x1f4,_0x23b466[_0xe4e2('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x353030){var _0x12ad33=this;return new Promise(function(_0x598fa3,_0xcba85a){return db[_0xe4e2('0x15')][_0xe4e2('0x1d')](_0x353030[_0xe4e2('0x17')],{'raw':_0x353030[_0xe4e2('0x18')]?_0x353030['options'][_0xe4e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x353030[_0xe4e2('0x18')]?_0x353030[_0xe4e2('0x18')]['where']||null:null,'attributes':_0x353030[_0xe4e2('0x18')]?_0x353030[_0xe4e2('0x18')][_0xe4e2('0x1e')]||null:null,'limit':_0x353030['options']?_0x353030[_0xe4e2('0x18')]['limit']||null:null})[_0xe4e2('0xc')](function(_0x1e21c0){logger['info'](_0xe4e2('0x1f'),_0x353030);logger[_0xe4e2('0x1b')](_0xe4e2('0x1f'),_0x353030,JSON[_0xe4e2('0x11')](_0x1e21c0));_0x598fa3(_0x1e21c0);})[_0xe4e2('0x1c')](function(_0x4d33de){logger['error'](_0xe4e2('0x1f'),_0x4d33de[_0xe4e2('0x13')],_0x353030);_0xcba85a(_0x12ad33[_0xe4e2('0x12')](0x1f4,_0x4d33de[_0xe4e2('0x13')]));});});};
\ No newline at end of file
+var _0x01d3=['attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','catch','CreateOpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where'];(function(_0x1774ad,_0xd6e71a){var _0x41e58c=function(_0x2b758e){while(--_0x2b758e){_0x1774ad['push'](_0x1774ad['shift']());}};_0x41e58c(++_0xd6e71a);}(_0x01d3,0xa2));var _0x301d=function(_0x49a78d,_0x583818){_0x49a78d=_0x49a78d-0x0;var _0x3cccc7=_0x01d3[_0x49a78d];return _0x3cccc7;};'use strict';var _=require(_0x301d('0x0'));var util=require(_0x301d('0x1'));var moment=require(_0x301d('0x2'));var BPromise=require(_0x301d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x301d('0x4'));var db=require(_0x301d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x301d('0x6'))(_0x301d('0x7'));var config=require(_0x301d('0x8'));var jayson=require(_0x301d('0x9'));var client=jayson['client'][_0x301d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d8fc2,_0xe2b2d8,_0x3bbbde){return new BPromise(function(_0x35e760,_0x3ba019){return client[_0x301d('0xb')](_0x2d8fc2,_0x3bbbde)[_0x301d('0xc')](function(_0x35ae14){logger[_0x301d('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe2b2d8,_0x301d('0xe'));logger[_0x301d('0xf')](_0x301d('0x10'),_0xe2b2d8,'request\x20sent',JSON[_0x301d('0x11')](_0x35ae14));if(_0x35ae14[_0x301d('0x12')]){if(_0x35ae14['error']['code']===0x1f4){logger['error'](_0x301d('0x13'),_0xe2b2d8,_0x35ae14[_0x301d('0x12')][_0x301d('0x14')]);return _0x3ba019(_0x35ae14[_0x301d('0x12')][_0x301d('0x14')]);}logger[_0x301d('0x12')](_0x301d('0x13'),_0xe2b2d8,_0x35ae14['error']['message']);return _0x35e760(_0x35ae14[_0x301d('0x12')][_0x301d('0x14')]);}else{logger[_0x301d('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe2b2d8,'request\x20sent');_0x35e760(_0x35ae14['result']['message']);}})[_0x301d('0x15')](function(_0x3deffb){logger[_0x301d('0x12')](_0x301d('0x13'),_0xe2b2d8,_0x3deffb);_0x3ba019(_0x3deffb);});});}exports[_0x301d('0x16')]=function(_0x39e505){var _0x4c36a6=this;return new Promise(function(_0x40a9ed,_0x4ed038){return db['OpenchannelQueueReport'][_0x301d('0x17')](_0x39e505[_0x301d('0x18')],{'raw':_0x39e505['options']?_0x39e505[_0x301d('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x301d('0xc')](function(_0x3f300c){logger[_0x301d('0xd')]('CreateOpenchannelQueueReport',_0x39e505);logger[_0x301d('0xf')]('CreateOpenchannelQueueReport',_0x39e505,JSON[_0x301d('0x11')](_0x3f300c));_0x40a9ed(_0x3f300c);})[_0x301d('0x15')](function(_0x24b6fc){logger['error'](_0x301d('0x16'),_0x24b6fc[_0x301d('0x14')],_0x39e505);_0x4ed038(_0x4c36a6[_0x301d('0x12')](0x1f4,_0x24b6fc[_0x301d('0x14')]));});});};exports[_0x301d('0x1a')]=function(_0x1d8d00){var _0x36f26a=this;return new Promise(function(_0x52e758,_0x2f3b71){return db[_0x301d('0x1b')][_0x301d('0x1c')](_0x1d8d00['body'],{'raw':_0x1d8d00[_0x301d('0x19')]?_0x1d8d00[_0x301d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d8d00[_0x301d('0x19')]?_0x1d8d00['options'][_0x301d('0x1d')]||null:null,'attributes':_0x1d8d00[_0x301d('0x19')]?_0x1d8d00['options'][_0x301d('0x1e')]||null:null,'limit':_0x1d8d00['options']?_0x1d8d00['options'][_0x301d('0x1f')]||null:null})[_0x301d('0xc')](function(_0x2a6652){logger['info'](_0x301d('0x1a'),_0x1d8d00);logger['debug']('UpdateOpenchannelQueueReport',_0x1d8d00,JSON['stringify'](_0x2a6652));_0x52e758(_0x2a6652);})[_0x301d('0x15')](function(_0x54e9a1){logger[_0x301d('0x12')](_0x301d('0x1a'),_0x54e9a1[_0x301d('0x14')],_0x1d8d00);_0x2f3b71(_0x36f26a[_0x301d('0x12')](0x1f4,_0x54e9a1[_0x301d('0x14')]));});});};
\ No newline at end of file
index f422c31..6c9c8f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69ef=['./openchannelTransferReport.controller','isAuthenticated','index','describe','get','/:id','post','put','update','delete','exports','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x196d94,_0x388cfa){var _0x201d10=function(_0x41143f){while(--_0x41143f){_0x196d94['push'](_0x196d94['shift']());}};_0x201d10(++_0x388cfa);}(_0x69ef,0x1bd));var _0xf69e=function(_0xa8b235,_0x55e03a){_0xa8b235=_0xa8b235-0x0;var _0x434147=_0x69ef[_0xa8b235];return _0x434147;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf69e('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf69e('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0xf69e('0x2'));var controller=require(_0xf69e('0x3'));router['get']('/',auth[_0xf69e('0x4')](),controller[_0xf69e('0x5')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf69e('0x6')]);router[_0xf69e('0x7')](_0xf69e('0x8'),auth[_0xf69e('0x4')](),controller['show']);router[_0xf69e('0x9')]('/',auth[_0xf69e('0x4')](),controller['create']);router[_0xf69e('0xa')](_0xf69e('0x8'),auth[_0xf69e('0x4')](),controller[_0xf69e('0xb')]);router[_0xf69e('0xc')](_0xf69e('0x8'),auth[_0xf69e('0x4')](),controller['destroy']);module[_0xf69e('0xd')]=router;
\ No newline at end of file
+var _0xdb55=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path'];(function(_0x59add5,_0x189136){var _0x348e6e=function(_0x3e244d){while(--_0x3e244d){_0x59add5['push'](_0x59add5['shift']());}};_0x348e6e(++_0x189136);}(_0xdb55,0xda));var _0x5db5=function(_0x49a95c,_0x47a1d1){_0x49a95c=_0x49a95c-0x0;var _0x5cdda4=_0xdb55[_0x49a95c];return _0x5cdda4;};'use strict';var multer=require('multer');var util=require(_0x5db5('0x0'));var path=require(_0x5db5('0x1'));var timeout=require(_0x5db5('0x2'));var express=require(_0x5db5('0x3'));var router=express[_0x5db5('0x4')]();var fs_extra=require(_0x5db5('0x5'));var auth=require(_0x5db5('0x6'));var interaction=require(_0x5db5('0x7'));var config=require(_0x5db5('0x8'));var controller=require(_0x5db5('0x9'));router[_0x5db5('0xa')]('/',auth[_0x5db5('0xb')](),controller['index']);router['get'](_0x5db5('0xc'),auth[_0x5db5('0xb')](),controller[_0x5db5('0xd')]);router[_0x5db5('0xa')](_0x5db5('0xe'),auth[_0x5db5('0xb')](),controller[_0x5db5('0xf')]);router[_0x5db5('0x10')]('/',auth[_0x5db5('0xb')](),controller['create']);router[_0x5db5('0x11')](_0x5db5('0xe'),auth['isAuthenticated'](),controller[_0x5db5('0x12')]);router[_0x5db5('0x13')](_0x5db5('0xe'),auth[_0x5db5('0xb')](),controller[_0x5db5('0x14')]);module[_0x5db5('0x15')]=router;
\ No newline at end of file
index 4d0cb8e..8df9de7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x3d2555,_0x6e443e){var _0x597430=function(_0x554ed4){while(--_0x554ed4){_0x3d2555['push'](_0x3d2555['shift']());}};_0x597430(++_0x6e443e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0x4b84[_0x3f59b1];return _0x11d2e8;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x95eba8,_0x128c50){var _0x54f606=function(_0x75bbce){while(--_0x75bbce){_0x95eba8['push'](_0x95eba8['shift']());}};_0x54f606(++_0x128c50);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'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
index c1a89a5..402f160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d56=['lodash','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x2a0733,_0x290d2b){var _0x15dc3b=function(_0x5265){while(--_0x5265){_0x2a0733['push'](_0x2a0733['shift']());}};_0x15dc3b(++_0x290d2b);}(_0x1d56,0x15d));var _0x61d5=function(_0x18cf25,_0x16f4a4){_0x18cf25=_0x18cf25-0x0;var _0x2525ee=_0x1d56[_0x18cf25];return _0x2525ee;};'use strict';var emlformat=require(_0x61d5('0x0'));var rimraf=require(_0x61d5('0x1'));var zipdir=require(_0x61d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x61d5('0x3'));var BPromise=require(_0x61d5('0x4'));var Mustache=require(_0x61d5('0x5'));var util=require(_0x61d5('0x6'));var path=require(_0x61d5('0x7'));var sox=require(_0x61d5('0x8'));var csv=require(_0x61d5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61d5('0xa'));var _=require(_0x61d5('0xb'));var squel=require(_0x61d5('0xc'));var crypto=require(_0x61d5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x61d5('0x9'));var querystring=require(_0x61d5('0xe'));var Papa=require(_0x61d5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x61d5('0x10'));var hardwareService=require(_0x61d5('0x11'));var logger=require(_0x61d5('0x12'))(_0x61d5('0x13'));var utils=require(_0x61d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x61d5('0x15'));var db=require(_0x61d5('0x16'))['db'];function respondWithStatusCode(_0x93c649,_0x2d7678){_0x2d7678=_0x2d7678||0xcc;return function(_0x59e77f){if(_0x59e77f){return _0x93c649[_0x61d5('0x17')](_0x2d7678);}return _0x93c649[_0x61d5('0x18')](_0x2d7678)[_0x61d5('0x19')]();};}function respondWithResult(_0x2d2bce,_0x557d8a){_0x557d8a=_0x557d8a||0xc8;return function(_0x2eca1f){if(_0x2eca1f){return _0x2d2bce[_0x61d5('0x18')](_0x557d8a)[_0x61d5('0x1a')](_0x2eca1f);}};}function respondWithFilteredResult(_0x1c71cb,_0x4f4277){return function(_0x2c3b6e){if(_0x2c3b6e){var _0x349715=typeof _0x4f4277[_0x61d5('0x1b')]===_0x61d5('0x1c')&&typeof _0x4f4277[_0x61d5('0x1d')]===_0x61d5('0x1c');var _0x294be6=_0x2c3b6e[_0x61d5('0x1e')];var _0x3339ea=_0x349715?0x0:_0x4f4277['offset'];var _0x1ba4ac=_0x349715?_0x2c3b6e[_0x61d5('0x1e')]:_0x4f4277[_0x61d5('0x1b')]+_0x4f4277['limit'];var _0x1e1279;if(_0x1ba4ac>=_0x294be6){_0x1ba4ac=_0x294be6;_0x1e1279=0xc8;}else{_0x1e1279=0xce;}_0x1c71cb['status'](_0x1e1279);return _0x1c71cb[_0x61d5('0x1f')]('Content-Range',_0x3339ea+'-'+_0x1ba4ac+'/'+_0x294be6)[_0x61d5('0x1a')](_0x2c3b6e);}return null;};}function patchUpdates(_0x13a9d3){return function(_0x409381){try{jsonpatch['apply'](_0x409381,_0x13a9d3,!![]);}catch(_0x482dbf){return BPromise[_0x61d5('0x20')](_0x482dbf);}return _0x409381[_0x61d5('0x21')]();};}function saveUpdates(_0x1f0be1,_0x57872d){return function(_0x39536a){if(_0x39536a){return _0x39536a[_0x61d5('0x22')](_0x1f0be1)[_0x61d5('0x23')](function(_0x4f126f){return _0x4f126f;});}return null;};}function removeEntity(_0x1e2dd1,_0x17bd0a){return function(_0x38afc6){if(_0x38afc6){return _0x38afc6[_0x61d5('0x24')]()[_0x61d5('0x23')](function(){_0x1e2dd1[_0x61d5('0x18')](0xcc)[_0x61d5('0x19')]();});}};}function handleEntityNotFound(_0x509ea5,_0x2581a1){return function(_0x2c8ac2){if(!_0x2c8ac2){_0x509ea5['sendStatus'](0x194);}return _0x2c8ac2;};}function handleError(_0x301c7f,_0x192643){_0x192643=_0x192643||0x1f4;return function(_0x20a8ac){logger[_0x61d5('0x25')](_0x20a8ac[_0x61d5('0x26')]);if(_0x20a8ac[_0x61d5('0x27')]){delete _0x20a8ac[_0x61d5('0x27')];}_0x301c7f[_0x61d5('0x18')](_0x192643)[_0x61d5('0x28')](_0x20a8ac);};}exports[_0x61d5('0x29')]=function(_0x36b464,_0x21dc9b){var _0x315716={},_0xd310d3={},_0x34db51={'count':0x0,'rows':[]};var _0x175405=_['map'](db[_0x61d5('0x2a')][_0x61d5('0x2b')],function(_0x174147){return{'name':_0x174147['fieldName'],'type':_0x174147[_0x61d5('0x2c')][_0x61d5('0x2d')]};});_0xd310d3['model']=_[_0x61d5('0x2e')](_0x175405,_0x61d5('0x27'));_0xd310d3[_0x61d5('0x2f')]=_[_0x61d5('0x30')](_0x36b464[_0x61d5('0x2f')]);_0xd310d3[_0x61d5('0x31')]=_[_0x61d5('0x32')](_0xd310d3[_0x61d5('0x33')],_0xd310d3['query']);_0x315716[_0x61d5('0x34')]=_[_0x61d5('0x32')](_0xd310d3[_0x61d5('0x33')],qs['fields'](_0x36b464[_0x61d5('0x2f')][_0x61d5('0x35')]));_0x315716['attributes']=_0x315716['attributes'][_0x61d5('0x36')]?_0x315716[_0x61d5('0x34')]:_0xd310d3[_0x61d5('0x33')];if(!_0x36b464[_0x61d5('0x2f')][_0x61d5('0x37')](_0x61d5('0x38'))){_0x315716[_0x61d5('0x1d')]=qs[_0x61d5('0x1d')](_0x36b464[_0x61d5('0x2f')]['limit']);_0x315716[_0x61d5('0x1b')]=qs[_0x61d5('0x1b')](_0x36b464['query'][_0x61d5('0x1b')]);}_0x315716['order']=qs['sort'](_0x36b464[_0x61d5('0x2f')][_0x61d5('0x39')]);_0x315716[_0x61d5('0x3a')]=qs[_0x61d5('0x31')](_[_0x61d5('0x3b')](_0x36b464[_0x61d5('0x2f')],_0xd310d3[_0x61d5('0x31')]),_0x175405);if(_0x36b464['query'][_0x61d5('0x3c')]){_0x315716[_0x61d5('0x3a')]=_['merge'](_0x315716[_0x61d5('0x3a')],{'$or':_[_0x61d5('0x2e')](_0x175405,function(_0x34141f){if(_0x34141f['type']!=='VIRTUAL'){var _0x3be985={};_0x3be985[_0x34141f['name']]={'$like':'%'+_0x36b464['query'][_0x61d5('0x3c')]+'%'};return _0x3be985;}})});}_0x315716=_['merge']({},_0x315716,_0x36b464['options']);var _0x403160={'where':_0x315716[_0x61d5('0x3a')]};return db['OpenchannelTransferReport'][_0x61d5('0x1e')](_0x403160)[_0x61d5('0x23')](function(_0x5a597e){_0x34db51[_0x61d5('0x1e')]=_0x5a597e;if(_0x36b464['query'][_0x61d5('0x3d')]){_0x315716[_0x61d5('0x3e')]=[{'all':!![]}];}return db[_0x61d5('0x2a')][_0x61d5('0x3f')](_0x315716);})[_0x61d5('0x23')](function(_0x2d34c4){_0x34db51[_0x61d5('0x40')]=_0x2d34c4;return _0x34db51;})[_0x61d5('0x23')](respondWithFilteredResult(_0x21dc9b,_0x315716))[_0x61d5('0x41')](handleError(_0x21dc9b,null));};exports[_0x61d5('0x42')]=function(_0x1c34d6,_0x496706){var _0x1d0785={'raw':!![],'where':{'id':_0x1c34d6['params']['id']}},_0x334423={};_0x334423[_0x61d5('0x33')]=_[_0x61d5('0x30')](db[_0x61d5('0x2a')]['rawAttributes']);_0x334423['query']=_[_0x61d5('0x30')](_0x1c34d6[_0x61d5('0x2f')]);_0x334423['filters']=_[_0x61d5('0x32')](_0x334423[_0x61d5('0x33')],_0x334423[_0x61d5('0x2f')]);_0x1d0785[_0x61d5('0x34')]=_[_0x61d5('0x32')](_0x334423[_0x61d5('0x33')],qs[_0x61d5('0x35')](_0x1c34d6[_0x61d5('0x2f')][_0x61d5('0x35')]));_0x1d0785[_0x61d5('0x34')]=_0x1d0785[_0x61d5('0x34')][_0x61d5('0x36')]?_0x1d0785[_0x61d5('0x34')]:_0x334423[_0x61d5('0x33')];if(_0x1c34d6[_0x61d5('0x2f')]['includeAll']){_0x1d0785[_0x61d5('0x3e')]=[{'all':!![]}];}_0x1d0785=_['merge']({},_0x1d0785,_0x1c34d6[_0x61d5('0x43')]);return db[_0x61d5('0x2a')][_0x61d5('0x44')](_0x1d0785)[_0x61d5('0x23')](handleEntityNotFound(_0x496706,null))[_0x61d5('0x23')](respondWithResult(_0x496706,null))[_0x61d5('0x41')](handleError(_0x496706,null));};exports[_0x61d5('0x45')]=function(_0x411710,_0xf7f0bf){return db['OpenchannelTransferReport']['create'](_0x411710[_0x61d5('0x46')],{})[_0x61d5('0x23')](respondWithResult(_0xf7f0bf,0xc9))[_0x61d5('0x41')](handleError(_0xf7f0bf,null));};exports[_0x61d5('0x22')]=function(_0x1774ba,_0x22c6cf){if(_0x1774ba[_0x61d5('0x46')]['id']){delete _0x1774ba['body']['id'];}return db[_0x61d5('0x2a')][_0x61d5('0x44')]({'where':{'id':_0x1774ba['params']['id']}})['then'](handleEntityNotFound(_0x22c6cf,null))[_0x61d5('0x23')](saveUpdates(_0x1774ba[_0x61d5('0x46')],null))[_0x61d5('0x23')](respondWithResult(_0x22c6cf,null))[_0x61d5('0x41')](handleError(_0x22c6cf,null));};exports[_0x61d5('0x24')]=function(_0x4507dc,_0xe365ab){return db[_0x61d5('0x2a')]['find']({'where':{'id':_0x4507dc['params']['id']}})[_0x61d5('0x23')](handleEntityNotFound(_0xe365ab,null))[_0x61d5('0x23')](removeEntity(_0xe365ab,null))['catch'](handleError(_0xe365ab,null));};exports[_0x61d5('0x47')]=function(_0xcc6037,_0x27930a){return db[_0x61d5('0x2a')][_0x61d5('0x47')]()[_0x61d5('0x23')](respondWithResult(_0x27930a,null))[_0x61d5('0x41')](handleError(_0x27930a,null));};
\ No newline at end of file
+var _0x183a=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x21a596,_0x3ddc96){var _0x23a9fd=function(_0x41e3ae){while(--_0x41e3ae){_0x21a596['push'](_0x21a596['shift']());}};_0x23a9fd(++_0x3ddc96);}(_0x183a,0x1c0));var _0xa183=function(_0x5b01dd,_0x557821){_0x5b01dd=_0x5b01dd-0x0;var _0x2c2f4f=_0x183a[_0x5b01dd];return _0x2c2f4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa183('0x0'));var zipdir=require(_0xa183('0x1'));var jsonpatch=require(_0xa183('0x2'));var rp=require(_0xa183('0x3'));var moment=require(_0xa183('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa183('0x5'));var util=require(_0xa183('0x6'));var path=require(_0xa183('0x7'));var sox=require(_0xa183('0x8'));var csv=require(_0xa183('0x9'));var ejs=require(_0xa183('0xa'));var fs=require('fs');var fs_extra=require(_0xa183('0xb'));var _=require(_0xa183('0xc'));var squel=require(_0xa183('0xd'));var crypto=require(_0xa183('0xe'));var jsforce=require(_0xa183('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa183('0x9'));var querystring=require('querystring');var Papa=require(_0xa183('0x10'));var Redis=require('ioredis');var authService=require(_0xa183('0x11'));var qs=require(_0xa183('0x12'));var as=require(_0xa183('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa183('0x14'))(_0xa183('0x15'));var utils=require('../../config/utils');var config=require(_0xa183('0x16'));var licenseUtil=require(_0xa183('0x17'));var db=require(_0xa183('0x18'))['db'];function respondWithStatusCode(_0x5c50cd,_0x2fe770){_0x2fe770=_0x2fe770||0xcc;return function(_0x3ec322){if(_0x3ec322){return _0x5c50cd[_0xa183('0x19')](_0x2fe770);}return _0x5c50cd[_0xa183('0x1a')](_0x2fe770)[_0xa183('0x1b')]();};}function respondWithResult(_0xb3cc29,_0x5a6c7b){_0x5a6c7b=_0x5a6c7b||0xc8;return function(_0x11c8db){if(_0x11c8db){return _0xb3cc29[_0xa183('0x1a')](_0x5a6c7b)[_0xa183('0x1c')](_0x11c8db);}};}function respondWithFilteredResult(_0x11e785,_0xa715f1){return function(_0x7d784d){if(_0x7d784d){var _0x119355=typeof _0xa715f1[_0xa183('0x1d')]===_0xa183('0x1e')&&typeof _0xa715f1[_0xa183('0x1f')]===_0xa183('0x1e');var _0xfe6db6=_0x7d784d[_0xa183('0x20')];var _0x25a7bc=_0x119355?0x0:_0xa715f1['offset'];var _0x184c12=_0x119355?_0x7d784d[_0xa183('0x20')]:_0xa715f1[_0xa183('0x1d')]+_0xa715f1[_0xa183('0x1f')];var _0x19ec9a;if(_0x184c12>=_0xfe6db6){_0x184c12=_0xfe6db6;_0x19ec9a=0xc8;}else{_0x19ec9a=0xce;}_0x11e785[_0xa183('0x1a')](_0x19ec9a);return _0x11e785['set'](_0xa183('0x21'),_0x25a7bc+'-'+_0x184c12+'/'+_0xfe6db6)['json'](_0x7d784d);}return null;};}function patchUpdates(_0x59ba5c){return function(_0x351436){try{jsonpatch[_0xa183('0x22')](_0x351436,_0x59ba5c,!![]);}catch(_0x3a313b){return BPromise[_0xa183('0x23')](_0x3a313b);}return _0x351436[_0xa183('0x24')]();};}function saveUpdates(_0xfb1ce1,_0xc5f94e){return function(_0x1bf0f3){if(_0x1bf0f3){return _0x1bf0f3[_0xa183('0x25')](_0xfb1ce1)[_0xa183('0x26')](function(_0x31fc42){return _0x31fc42;});}return null;};}function removeEntity(_0x37c215,_0x4be39c){return function(_0x25cede){if(_0x25cede){return _0x25cede[_0xa183('0x27')]()[_0xa183('0x26')](function(){_0x37c215[_0xa183('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56f357,_0x303bf0){return function(_0x3b7b4d){if(!_0x3b7b4d){_0x56f357['sendStatus'](0x194);}return _0x3b7b4d;};}function handleError(_0x235a46,_0xbef433){_0xbef433=_0xbef433||0x1f4;return function(_0x3d8198){logger[_0xa183('0x28')](_0x3d8198[_0xa183('0x29')]);if(_0x3d8198['name']){delete _0x3d8198[_0xa183('0x2a')];}_0x235a46[_0xa183('0x1a')](_0xbef433)[_0xa183('0x2b')](_0x3d8198);};}exports[_0xa183('0x2c')]=function(_0x436434,_0x48398d){var _0x3a9548={},_0x51a0d8={},_0x1c0838={'count':0x0,'rows':[]};var _0x21a684=_[_0xa183('0x2d')](db['OpenchannelTransferReport'][_0xa183('0x2e')],function(_0x36cd32){return{'name':_0x36cd32['fieldName'],'type':_0x36cd32[_0xa183('0x2f')][_0xa183('0x30')]};});_0x51a0d8[_0xa183('0x31')]=_['map'](_0x21a684,_0xa183('0x2a'));_0x51a0d8[_0xa183('0x32')]=_[_0xa183('0x33')](_0x436434[_0xa183('0x32')]);_0x51a0d8[_0xa183('0x34')]=_[_0xa183('0x35')](_0x51a0d8['model'],_0x51a0d8[_0xa183('0x32')]);_0x3a9548[_0xa183('0x36')]=_[_0xa183('0x35')](_0x51a0d8['model'],qs['fields'](_0x436434['query'][_0xa183('0x37')]));_0x3a9548['attributes']=_0x3a9548[_0xa183('0x36')][_0xa183('0x38')]?_0x3a9548[_0xa183('0x36')]:_0x51a0d8[_0xa183('0x31')];if(!_0x436434[_0xa183('0x32')][_0xa183('0x39')]('nolimit')){_0x3a9548[_0xa183('0x1f')]=qs[_0xa183('0x1f')](_0x436434['query'][_0xa183('0x1f')]);_0x3a9548[_0xa183('0x1d')]=qs[_0xa183('0x1d')](_0x436434[_0xa183('0x32')][_0xa183('0x1d')]);}_0x3a9548['order']=qs['sort'](_0x436434[_0xa183('0x32')][_0xa183('0x3a')]);_0x3a9548['where']=qs['filters'](_[_0xa183('0x3b')](_0x436434[_0xa183('0x32')],_0x51a0d8[_0xa183('0x34')]),_0x21a684);if(_0x436434['query'][_0xa183('0x3c')]){_0x3a9548[_0xa183('0x3d')]=_['merge'](_0x3a9548[_0xa183('0x3d')],{'$or':_[_0xa183('0x2d')](_0x21a684,function(_0x514f7c){if(_0x514f7c[_0xa183('0x2f')]!=='VIRTUAL'){var _0x4c8e58={};_0x4c8e58[_0x514f7c['name']]={'$like':'%'+_0x436434['query'][_0xa183('0x3c')]+'%'};return _0x4c8e58;}})});}_0x3a9548=_[_0xa183('0x3e')]({},_0x3a9548,_0x436434['options']);var _0x3e73b5={'where':_0x3a9548['where']};return db[_0xa183('0x3f')][_0xa183('0x20')](_0x3e73b5)[_0xa183('0x26')](function(_0x454f26){_0x1c0838[_0xa183('0x20')]=_0x454f26;if(_0x436434[_0xa183('0x32')][_0xa183('0x40')]){_0x3a9548[_0xa183('0x41')]=[{'all':!![]}];}return db[_0xa183('0x3f')][_0xa183('0x42')](_0x3a9548);})['then'](function(_0x5a8892){_0x1c0838[_0xa183('0x43')]=_0x5a8892;return _0x1c0838;})[_0xa183('0x26')](respondWithFilteredResult(_0x48398d,_0x3a9548))[_0xa183('0x44')](handleError(_0x48398d,null));};exports[_0xa183('0x45')]=function(_0x213e7a,_0x16c41b){var _0x14f24e={'raw':!![],'where':{'id':_0x213e7a['params']['id']}},_0x18a26d={};_0x18a26d['model']=_[_0xa183('0x33')](db[_0xa183('0x3f')]['rawAttributes']);_0x18a26d['query']=_[_0xa183('0x33')](_0x213e7a['query']);_0x18a26d['filters']=_[_0xa183('0x35')](_0x18a26d[_0xa183('0x31')],_0x18a26d[_0xa183('0x32')]);_0x14f24e[_0xa183('0x36')]=_[_0xa183('0x35')](_0x18a26d[_0xa183('0x31')],qs[_0xa183('0x37')](_0x213e7a['query'][_0xa183('0x37')]));_0x14f24e[_0xa183('0x36')]=_0x14f24e[_0xa183('0x36')]['length']?_0x14f24e[_0xa183('0x36')]:_0x18a26d[_0xa183('0x31')];if(_0x213e7a[_0xa183('0x32')][_0xa183('0x40')]){_0x14f24e['include']=[{'all':!![]}];}_0x14f24e=_[_0xa183('0x3e')]({},_0x14f24e,_0x213e7a[_0xa183('0x46')]);return db[_0xa183('0x3f')][_0xa183('0x47')](_0x14f24e)[_0xa183('0x26')](handleEntityNotFound(_0x16c41b,null))['then'](respondWithResult(_0x16c41b,null))[_0xa183('0x44')](handleError(_0x16c41b,null));};exports[_0xa183('0x48')]=function(_0x24709b,_0x193725){return db[_0xa183('0x3f')][_0xa183('0x48')](_0x24709b[_0xa183('0x49')],{})[_0xa183('0x26')](respondWithResult(_0x193725,0xc9))[_0xa183('0x44')](handleError(_0x193725,null));};exports[_0xa183('0x25')]=function(_0x12dde0,_0x4efcad){if(_0x12dde0[_0xa183('0x49')]['id']){delete _0x12dde0[_0xa183('0x49')]['id'];}return db[_0xa183('0x3f')][_0xa183('0x47')]({'where':{'id':_0x12dde0[_0xa183('0x4a')]['id']}})[_0xa183('0x26')](handleEntityNotFound(_0x4efcad,null))[_0xa183('0x26')](saveUpdates(_0x12dde0[_0xa183('0x49')],null))[_0xa183('0x26')](respondWithResult(_0x4efcad,null))[_0xa183('0x44')](handleError(_0x4efcad,null));};exports[_0xa183('0x27')]=function(_0x4eccb8,_0x114712){return db['OpenchannelTransferReport'][_0xa183('0x47')]({'where':{'id':_0x4eccb8[_0xa183('0x4a')]['id']}})[_0xa183('0x26')](handleEntityNotFound(_0x114712,null))[_0xa183('0x26')](removeEntity(_0x114712,null))['catch'](handleError(_0x114712,null));};exports[_0xa183('0x4b')]=function(_0x2e2eb0,_0x3fe5f7){return db[_0xa183('0x3f')][_0xa183('0x4b')]()['then'](respondWithResult(_0x3fe5f7,null))[_0xa183('0x44')](handleError(_0x3fe5f7,null));};
\ No newline at end of file
index bcd2dbe..7da7738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16af=['report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport'];(function(_0x5d58ee,_0x494ab6){var _0x1cfe22=function(_0x3e7746){while(--_0x3e7746){_0x5d58ee['push'](_0x5d58ee['shift']());}};_0x1cfe22(++_0x494ab6);}(_0x16af,0x65));var _0xf16a=function(_0x300cf5,_0x4db355){_0x300cf5=_0x300cf5-0x0;var _0x48a271=_0x16af[_0x300cf5];return _0x48a271;};'use strict';var _=require(_0xf16a('0x0'));var util=require('util');var logger=require(_0xf16a('0x1'))(_0xf16a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf16a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf16a('0x4'));var config=require(_0xf16a('0x5'));var attributes=require(_0xf16a('0x6'));module['exports']=function(_0x4a5ef6,_0x1a754f){return _0x4a5ef6[_0xf16a('0x7')](_0xf16a('0x8'),attributes,{'tableName':_0xf16a('0x9'),'paranoid':![],'indexes':[{'name':_0xf16a('0xa'),'fields':[_0xf16a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1326=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid'];(function(_0x7c5d6a,_0x3c9f62){var _0x3e6de7=function(_0x25cfd9){while(--_0x25cfd9){_0x7c5d6a['push'](_0x7c5d6a['shift']());}};_0x3e6de7(++_0x3c9f62);}(_0x1326,0x168));var _0x6132=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0x1326[_0x12e073];return _0x267748;};'use strict';var _=require('lodash');var util=require(_0x6132('0x0'));var logger=require(_0x6132('0x1'))(_0x6132('0x2'));var moment=require(_0x6132('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6132('0x4'));var rimraf=require(_0x6132('0x5'));var config=require(_0x6132('0x6'));var attributes=require(_0x6132('0x7'));module[_0x6132('0x8')]=function(_0x223dc0,_0x4e31b8){return _0x223dc0[_0x6132('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x6132('0xa'),'paranoid':![],'indexes':[{'name':_0x6132('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index e768dce..e11ec8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4053f0,_0x25d6b2){var _0x8f1b4f=function(_0x4a4b06){while(--_0x4a4b06){_0x4053f0['push'](_0x4053f0['shift']());}};_0x8f1b4f(++_0x25d6b2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0x5fc3[_0x1e175d];return _0x3a3ce5;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x23f4=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x22ae98,_0x7c18c){var _0x165537=function(_0xd9e974){while(--_0xd9e974){_0x22ae98['push'](_0x22ae98['shift']());}};_0x165537(++_0x7c18c);}(_0x23f4,0x1ee));var _0x423f=function(_0x334df6,_0x4be3b0){_0x334df6=_0x334df6-0x0;var _0x39b9f0=_0x23f4[_0x334df6];return _0x39b9f0;};'use strict';var _=require('lodash');var util=require(_0x423f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x423f('0x1'));var fs=require('fs');var Redis=require(_0x423f('0x2'));var db=require(_0x423f('0x3'))['db'];var utils=require(_0x423f('0x4'));var logger=require(_0x423f('0x5'))(_0x423f('0x6'));var config=require(_0x423f('0x7'));var jayson=require(_0x423f('0x8'));var client=jayson[_0x423f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x260eae,_0x47716d,_0x55258d){return new BPromise(function(_0x727b4e,_0x416fb1){return client[_0x423f('0xa')](_0x260eae,_0x55258d)['then'](function(_0x5b5ee6){logger['info'](_0x423f('0xb'),_0x47716d,'request\x20sent');logger[_0x423f('0xc')](_0x423f('0xd'),_0x47716d,_0x423f('0xe'),JSON[_0x423f('0xf')](_0x5b5ee6));if(_0x5b5ee6['error']){if(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x11')]===0x1f4){logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x5b5ee6[_0x423f('0x10')]['message']);return _0x416fb1(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);}logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);return _0x727b4e(_0x5b5ee6[_0x423f('0x10')][_0x423f('0x12')]);}else{logger[_0x423f('0x13')](_0x423f('0xb'),_0x47716d,_0x423f('0xe'));_0x727b4e(_0x5b5ee6[_0x423f('0x14')][_0x423f('0x12')]);}})[_0x423f('0x15')](function(_0x9d1487){logger[_0x423f('0x10')](_0x423f('0xb'),_0x47716d,_0x9d1487);_0x416fb1(_0x9d1487);});});}
\ No newline at end of file
index 7a01a43..0398a38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x636b=['/:id','create','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./pause.controller','get','isAuthenticated','index'];(function(_0x3a3ea6,_0x84d32){var _0x13a16b=function(_0x21b739){while(--_0x21b739){_0x3a3ea6['push'](_0x3a3ea6['shift']());}};_0x13a16b(++_0x84d32);}(_0x636b,0x16c));var _0xb636=function(_0xb20ec1,_0x49dc85){_0xb20ec1=_0xb20ec1-0x0;var _0x53cd29=_0x636b[_0xb20ec1];return _0x53cd29;};'use strict';var multer=require(_0xb636('0x0'));var util=require(_0xb636('0x1'));var path=require(_0xb636('0x2'));var timeout=require('connect-timeout');var express=require(_0xb636('0x3'));var router=express[_0xb636('0x4')]();var fs_extra=require(_0xb636('0x5'));var auth=require(_0xb636('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb636('0x7'));router[_0xb636('0x8')]('/',auth[_0xb636('0x9')](),controller[_0xb636('0xa')]);router[_0xb636('0x8')](_0xb636('0xb'),auth[_0xb636('0x9')](),controller['show']);router['post']('/',auth[_0xb636('0x9')](),controller[_0xb636('0xc')]);router['put'](_0xb636('0xb'),auth[_0xb636('0x9')](),controller[_0xb636('0xd')]);router['delete'](_0xb636('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xb636('0xe')]=router;
\ No newline at end of file
+var _0x5bab=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show'];(function(_0x1325cd,_0x48d05f){var _0x5703ed=function(_0x62a791){while(--_0x62a791){_0x1325cd['push'](_0x1325cd['shift']());}};_0x5703ed(++_0x48d05f);}(_0x5bab,0x15a));var _0xb5ba=function(_0x1667a6,_0x2d0405){_0x1667a6=_0x1667a6-0x0;var _0x382102=_0x5bab[_0x1667a6];return _0x382102;};'use strict';var multer=require(_0xb5ba('0x0'));var util=require('util');var path=require(_0xb5ba('0x1'));var timeout=require(_0xb5ba('0x2'));var express=require(_0xb5ba('0x3'));var router=express[_0xb5ba('0x4')]();var fs_extra=require(_0xb5ba('0x5'));var auth=require(_0xb5ba('0x6'));var interaction=require(_0xb5ba('0x7'));var config=require(_0xb5ba('0x8'));var controller=require(_0xb5ba('0x9'));router[_0xb5ba('0xa')]('/',auth[_0xb5ba('0xb')](),controller['index']);router['get'](_0xb5ba('0xc'),auth[_0xb5ba('0xb')](),controller[_0xb5ba('0xd')]);router['post']('/',auth[_0xb5ba('0xb')](),controller[_0xb5ba('0xe')]);router[_0xb5ba('0xf')]('/:id',auth[_0xb5ba('0xb')](),controller[_0xb5ba('0x10')]);router[_0xb5ba('0x11')](_0xb5ba('0xc'),auth[_0xb5ba('0xb')](),controller[_0xb5ba('0x12')]);module[_0xb5ba('0x13')]=router;
\ No newline at end of file
index 17c2aa4..a87a86e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb92a=['sequelize','exports','name','STRING'];(function(_0x289911,_0xffccca){var _0x2e69ec=function(_0x1547b1){while(--_0x1547b1){_0x289911['push'](_0x289911['shift']());}};_0x2e69ec(++_0xffccca);}(_0xb92a,0x170));var _0xab92=function(_0xce2ebd,_0x3b34ce){_0xce2ebd=_0xce2ebd-0x0;var _0x45a198=_0xb92a[_0xce2ebd];return _0x45a198;};'use strict';var Sequelize=require(_0xab92('0x0'));module[_0xab92('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xab92('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xab92('0x3')]}};
\ No newline at end of file
+var _0xfcb1=['sequelize','STRING'];(function(_0x1286f0,_0x544752){var _0x5ac156=function(_0x2c3fc8){while(--_0x2c3fc8){_0x1286f0['push'](_0x1286f0['shift']());}};_0x5ac156(++_0x544752);}(_0xfcb1,0x1c8));var _0x1fcb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfcb1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1fcb('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fcb('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5fb685e..dfc1f5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e42=['show','params','model','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','update','eml-format','zip-dir','moment','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','destroy','then','get','stack','name','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x2f307c,_0xe61f37){var _0x42e9ea=function(_0x4fa013){while(--_0x4fa013){_0x2f307c['push'](_0x2f307c['shift']());}};_0x42e9ea(++_0xe61f37);}(_0x2e42,0x9f));var _0x22e4=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x2e42[_0x3c2166];return _0x30ccc3;};'use strict';var emlformat=require(_0x22e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x22e4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x22e4('0x3'));var util=require('util');var path=require(_0x22e4('0x4'));var sox=require(_0x22e4('0x5'));var csv=require(_0x22e4('0x6'));var ejs=require(_0x22e4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x22e4('0x8'));var crypto=require('crypto');var jsforce=require(_0x22e4('0x9'));var deskjs=require(_0x22e4('0xa'));var toCsv=require(_0x22e4('0x6'));var querystring=require('querystring');var Papa=require(_0x22e4('0xb'));var Redis=require(_0x22e4('0xc'));var authService=require(_0x22e4('0xd'));var qs=require(_0x22e4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22e4('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x22e4('0x10'));var licenseUtil=require(_0x22e4('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13061f,_0x4b633e){_0x4b633e=_0x4b633e||0xcc;return function(_0x1d5fc7){if(_0x1d5fc7){return _0x13061f[_0x22e4('0x12')](_0x4b633e);}return _0x13061f[_0x22e4('0x13')](_0x4b633e)[_0x22e4('0x14')]();};}function respondWithResult(_0x3af583,_0xcb52b4){_0xcb52b4=_0xcb52b4||0xc8;return function(_0x407a73){if(_0x407a73){return _0x3af583[_0x22e4('0x13')](_0xcb52b4)[_0x22e4('0x15')](_0x407a73);}};}function respondWithFilteredResult(_0x5b75e7,_0x3a3ee7){return function(_0x342b18){if(_0x342b18){var _0x3b288e=typeof _0x3a3ee7[_0x22e4('0x16')]===_0x22e4('0x17')&&typeof _0x3a3ee7['limit']===_0x22e4('0x17');var _0x55f074=_0x342b18[_0x22e4('0x18')];var _0x4b923e=_0x3b288e?0x0:_0x3a3ee7[_0x22e4('0x16')];var _0x114dbb=_0x3b288e?_0x342b18['count']:_0x3a3ee7[_0x22e4('0x16')]+_0x3a3ee7['limit'];var _0x33826e;if(_0x114dbb>=_0x55f074){_0x114dbb=_0x55f074;_0x33826e=0xc8;}else{_0x33826e=0xce;}_0x5b75e7[_0x22e4('0x13')](_0x33826e);return _0x5b75e7[_0x22e4('0x19')](_0x22e4('0x1a'),_0x4b923e+'-'+_0x114dbb+'/'+_0x55f074)[_0x22e4('0x15')](_0x342b18);}return null;};}function patchUpdates(_0x1f2c68){return function(_0xb43d39){try{jsonpatch['apply'](_0xb43d39,_0x1f2c68,!![]);}catch(_0x53f483){return BPromise['reject'](_0x53f483);}return _0xb43d39[_0x22e4('0x1b')]();};}function saveUpdates(_0x26f107,_0x16a453){return function(_0x6dcd7f){if(_0x6dcd7f){return _0x6dcd7f['update'](_0x26f107)['then'](function(_0x61f53d){return _0x61f53d;});}return null;};}function removeEntity(_0x4b612a,_0x4166a2){return function(_0x123be1){if(_0x123be1){return _0x123be1[_0x22e4('0x1c')]()[_0x22e4('0x1d')](function(){var _0x468742=_0x123be1[_0x22e4('0x1e')]({'plain':!![]});var _0x4be85b='Pauses';return db['UserProfileResource'][_0x22e4('0x1c')]({'where':{'type':_0x4be85b,'resourceId':_0x468742['id']}})['then'](function(){return _0x123be1;});})[_0x22e4('0x1d')](function(){_0x4b612a[_0x22e4('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f58c8,_0x5c8af6){return function(_0x224d0d){if(!_0x224d0d){_0x6f58c8['sendStatus'](0x194);}return _0x224d0d;};}function handleError(_0x48efd2,_0x280a38){_0x280a38=_0x280a38||0x1f4;return function(_0xa45216){logger['error'](_0xa45216[_0x22e4('0x1f')]);if(_0xa45216[_0x22e4('0x20')]){delete _0xa45216[_0x22e4('0x20')];}_0x48efd2['status'](_0x280a38)['send'](_0xa45216);};}exports['index']=function(_0x4b315e,_0x3fd443){var _0x24c606={},_0x9f4946={},_0x2fd476={'count':0x0,'rows':[]};var _0x28b754=_[_0x22e4('0x21')](db[_0x22e4('0x22')][_0x22e4('0x23')],function(_0x18be9a){return{'name':_0x18be9a[_0x22e4('0x24')],'type':_0x18be9a[_0x22e4('0x25')][_0x22e4('0x26')]};});_0x9f4946['model']=_[_0x22e4('0x21')](_0x28b754,_0x22e4('0x20'));_0x9f4946[_0x22e4('0x27')]=_[_0x22e4('0x28')](_0x4b315e['query']);_0x9f4946[_0x22e4('0x29')]=_[_0x22e4('0x2a')](_0x9f4946['model'],_0x9f4946[_0x22e4('0x27')]);_0x24c606[_0x22e4('0x2b')]=_[_0x22e4('0x2a')](_0x9f4946['model'],qs[_0x22e4('0x2c')](_0x4b315e[_0x22e4('0x27')][_0x22e4('0x2c')]));_0x24c606[_0x22e4('0x2b')]=_0x24c606[_0x22e4('0x2b')][_0x22e4('0x2d')]?_0x24c606[_0x22e4('0x2b')]:_0x9f4946['model'];if(!_0x4b315e[_0x22e4('0x27')][_0x22e4('0x2e')](_0x22e4('0x2f'))){_0x24c606['limit']=qs['limit'](_0x4b315e[_0x22e4('0x27')][_0x22e4('0x30')]);_0x24c606[_0x22e4('0x16')]=qs[_0x22e4('0x16')](_0x4b315e['query']['offset']);}_0x24c606[_0x22e4('0x31')]=qs[_0x22e4('0x32')](_0x4b315e[_0x22e4('0x27')]['sort']);_0x24c606[_0x22e4('0x33')]=qs['filters'](_['pick'](_0x4b315e[_0x22e4('0x27')],_0x9f4946[_0x22e4('0x29')]),_0x28b754);if(_0x4b315e[_0x22e4('0x27')][_0x22e4('0x34')]){_0x24c606[_0x22e4('0x33')]=_[_0x22e4('0x35')](_0x24c606[_0x22e4('0x33')],{'$or':_[_0x22e4('0x21')](_0x28b754,function(_0x92440a){if(_0x92440a[_0x22e4('0x25')]!==_0x22e4('0x36')){var _0x2b71ce={};_0x2b71ce[_0x92440a[_0x22e4('0x20')]]={'$like':'%'+_0x4b315e[_0x22e4('0x27')][_0x22e4('0x34')]+'%'};return _0x2b71ce;}})});}_0x24c606=_[_0x22e4('0x35')]({},_0x24c606,_0x4b315e[_0x22e4('0x37')]);var _0x10848b={'where':_0x24c606['where']};return db[_0x22e4('0x22')][_0x22e4('0x18')](_0x10848b)[_0x22e4('0x1d')](function(_0x311f1d){_0x2fd476['count']=_0x311f1d;if(_0x4b315e[_0x22e4('0x27')][_0x22e4('0x38')]){_0x24c606[_0x22e4('0x39')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x24c606);})[_0x22e4('0x1d')](function(_0x59dba7){_0x2fd476[_0x22e4('0x3a')]=_0x59dba7;return _0x2fd476;})[_0x22e4('0x1d')](respondWithFilteredResult(_0x3fd443,_0x24c606))[_0x22e4('0x3b')](handleError(_0x3fd443,null));};exports[_0x22e4('0x3c')]=function(_0x4f63e4,_0x338430){var _0x14a101={'raw':!![],'where':{'id':_0x4f63e4[_0x22e4('0x3d')]['id']}},_0x571232={};_0x571232['model']=_[_0x22e4('0x28')](db[_0x22e4('0x22')][_0x22e4('0x23')]);_0x571232[_0x22e4('0x27')]=_[_0x22e4('0x28')](_0x4f63e4[_0x22e4('0x27')]);_0x571232[_0x22e4('0x29')]=_[_0x22e4('0x2a')](_0x571232[_0x22e4('0x3e')],_0x571232[_0x22e4('0x27')]);_0x14a101[_0x22e4('0x2b')]=_[_0x22e4('0x2a')](_0x571232[_0x22e4('0x3e')],qs['fields'](_0x4f63e4['query'][_0x22e4('0x2c')]));_0x14a101[_0x22e4('0x2b')]=_0x14a101[_0x22e4('0x2b')][_0x22e4('0x2d')]?_0x14a101[_0x22e4('0x2b')]:_0x571232['model'];if(_0x4f63e4[_0x22e4('0x27')][_0x22e4('0x38')]){_0x14a101[_0x22e4('0x39')]=[{'all':!![]}];}_0x14a101=_[_0x22e4('0x35')]({},_0x14a101,_0x4f63e4['options']);return db[_0x22e4('0x22')][_0x22e4('0x3f')](_0x14a101)[_0x22e4('0x1d')](handleEntityNotFound(_0x338430,null))['then'](respondWithResult(_0x338430,null))[_0x22e4('0x3b')](handleError(_0x338430,null));};exports[_0x22e4('0x40')]=function(_0x874b81,_0x20b7a){return db[_0x22e4('0x22')]['create'](_0x874b81[_0x22e4('0x41')],{})[_0x22e4('0x1d')](function(_0x3d67dc){var _0x663935=_0x874b81[_0x22e4('0x42')][_0x22e4('0x1e')]({'plain':!![]});if(!_0x663935)throw new Error(_0x22e4('0x43'));if(_0x663935[_0x22e4('0x44')]==='user'){var _0x49a82b=_0x3d67dc[_0x22e4('0x1e')]({'plain':!![]});var _0x586aba='Pauses';return db[_0x22e4('0x45')][_0x22e4('0x3f')]({'where':{'name':_0x586aba,'userProfileId':_0x663935['userProfileId']},'raw':!![]})[_0x22e4('0x1d')](function(_0x3393a0){if(_0x3393a0&&_0x3393a0[_0x22e4('0x46')]===0x0){return db['UserProfileResource'][_0x22e4('0x40')]({'name':_0x49a82b[_0x22e4('0x20')],'resourceId':_0x49a82b['id'],'type':_0x3393a0[_0x22e4('0x20')],'sectionId':_0x3393a0['id']},{})[_0x22e4('0x1d')](function(){return _0x3d67dc;});}else{return _0x3d67dc;}})[_0x22e4('0x3b')](function(_0x54056e){logger[_0x22e4('0x47')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54056e);throw _0x54056e;});}return _0x3d67dc;})[_0x22e4('0x1d')](respondWithResult(_0x20b7a,0xc9))['catch'](handleError(_0x20b7a,null));};exports[_0x22e4('0x48')]=function(_0x1d6b8b,_0x1b8e01){if(_0x1d6b8b[_0x22e4('0x41')]['id']){delete _0x1d6b8b['body']['id'];}return db['Pause'][_0x22e4('0x3f')]({'where':{'id':_0x1d6b8b['params']['id']}})['then'](handleEntityNotFound(_0x1b8e01,null))[_0x22e4('0x1d')](saveUpdates(_0x1d6b8b[_0x22e4('0x41')],null))[_0x22e4('0x1d')](respondWithResult(_0x1b8e01,null))['catch'](handleError(_0x1b8e01,null));};exports['destroy']=function(_0x50a8db,_0xcf9227){return db[_0x22e4('0x22')][_0x22e4('0x3f')]({'where':{'id':_0x50a8db['params']['id']}})[_0x22e4('0x1d')](handleEntityNotFound(_0xcf9227,null))[_0x22e4('0x1d')](removeEntity(_0xcf9227,null))['catch'](handleError(_0xcf9227,null));};
\ No newline at end of file
+var _0x49d7=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','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','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','Pauses','UserProfileResource','sendStatus','error','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x47b7ad,_0x3517b7){var _0x12b74b=function(_0x2377d5){while(--_0x2377d5){_0x47b7ad['push'](_0x47b7ad['shift']());}};_0x12b74b(++_0x3517b7);}(_0x49d7,0x101));var _0x749d=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x49d7[_0x1602ef];return _0x5870ee;};'use strict';var emlformat=require(_0x749d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x749d('0x1'));var jsonpatch=require(_0x749d('0x2'));var rp=require(_0x749d('0x3'));var moment=require(_0x749d('0x4'));var BPromise=require(_0x749d('0x5'));var Mustache=require(_0x749d('0x6'));var util=require(_0x749d('0x7'));var path=require('path');var sox=require(_0x749d('0x8'));var csv=require(_0x749d('0x9'));var ejs=require(_0x749d('0xa'));var fs=require('fs');var fs_extra=require(_0x749d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x749d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x749d('0xd'));var toCsv=require(_0x749d('0x9'));var querystring=require('querystring');var Papa=require(_0x749d('0xe'));var Redis=require('ioredis');var authService=require(_0x749d('0xf'));var qs=require(_0x749d('0x10'));var as=require(_0x749d('0x11'));var hardwareService=require(_0x749d('0x12'));var logger=require(_0x749d('0x13'))(_0x749d('0x14'));var utils=require(_0x749d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x749d('0x16'));var db=require(_0x749d('0x17'))['db'];function respondWithStatusCode(_0x5a3e7a,_0x25d1c5){_0x25d1c5=_0x25d1c5||0xcc;return function(_0x58c270){if(_0x58c270){return _0x5a3e7a['sendStatus'](_0x25d1c5);}return _0x5a3e7a[_0x749d('0x18')](_0x25d1c5)[_0x749d('0x19')]();};}function respondWithResult(_0x1d86b6,_0x3357e6){_0x3357e6=_0x3357e6||0xc8;return function(_0x18d986){if(_0x18d986){return _0x1d86b6['status'](_0x3357e6)[_0x749d('0x1a')](_0x18d986);}};}function respondWithFilteredResult(_0x51d403,_0x243507){return function(_0x3b2a88){if(_0x3b2a88){var _0x2a5c49=typeof _0x243507['offset']===_0x749d('0x1b')&&typeof _0x243507[_0x749d('0x1c')]==='undefined';var _0x464a7c=_0x3b2a88['count'];var _0x22d14e=_0x2a5c49?0x0:_0x243507[_0x749d('0x1d')];var _0x42d1a4=_0x2a5c49?_0x3b2a88['count']:_0x243507[_0x749d('0x1d')]+_0x243507['limit'];var _0x1a8188;if(_0x42d1a4>=_0x464a7c){_0x42d1a4=_0x464a7c;_0x1a8188=0xc8;}else{_0x1a8188=0xce;}_0x51d403['status'](_0x1a8188);return _0x51d403['set'](_0x749d('0x1e'),_0x22d14e+'-'+_0x42d1a4+'/'+_0x464a7c)['json'](_0x3b2a88);}return null;};}function patchUpdates(_0x192a88){return function(_0x5a5861){try{jsonpatch[_0x749d('0x1f')](_0x5a5861,_0x192a88,!![]);}catch(_0x32e9b7){return BPromise[_0x749d('0x20')](_0x32e9b7);}return _0x5a5861[_0x749d('0x21')]();};}function saveUpdates(_0x49f4ac,_0x4cdf8f){return function(_0x56f94b){if(_0x56f94b){return _0x56f94b[_0x749d('0x22')](_0x49f4ac)['then'](function(_0x16a38e){return _0x16a38e;});}return null;};}function removeEntity(_0x399a4,_0x5b80b1){return function(_0x1d4f34){if(_0x1d4f34){return _0x1d4f34['destroy']()[_0x749d('0x23')](function(){var _0x1d8ba6=_0x1d4f34['get']({'plain':!![]});var _0x3461f1=_0x749d('0x24');return db[_0x749d('0x25')]['destroy']({'where':{'type':_0x3461f1,'resourceId':_0x1d8ba6['id']}})['then'](function(){return _0x1d4f34;});})[_0x749d('0x23')](function(){_0x399a4[_0x749d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aff3c,_0x36614b){return function(_0x5d3909){if(!_0x5d3909){_0x2aff3c[_0x749d('0x26')](0x194);}return _0x5d3909;};}function handleError(_0x7cd9d8,_0xc70d1a){_0xc70d1a=_0xc70d1a||0x1f4;return function(_0x1119a7){logger[_0x749d('0x27')](_0x1119a7[_0x749d('0x28')]);if(_0x1119a7[_0x749d('0x29')]){delete _0x1119a7[_0x749d('0x29')];}_0x7cd9d8['status'](_0xc70d1a)[_0x749d('0x2a')](_0x1119a7);};}exports['index']=function(_0x1fbadf,_0x1aeeb2){var _0x36bb08={},_0x3a17b6={},_0x5902f5={'count':0x0,'rows':[]};var _0x11b921=_[_0x749d('0x2b')](db[_0x749d('0x2c')][_0x749d('0x2d')],function(_0x2856e6){return{'name':_0x2856e6[_0x749d('0x2e')],'type':_0x2856e6[_0x749d('0x2f')][_0x749d('0x30')]};});_0x3a17b6['model']=_['map'](_0x11b921,_0x749d('0x29'));_0x3a17b6[_0x749d('0x31')]=_[_0x749d('0x32')](_0x1fbadf['query']);_0x3a17b6[_0x749d('0x33')]=_[_0x749d('0x34')](_0x3a17b6[_0x749d('0x35')],_0x3a17b6['query']);_0x36bb08[_0x749d('0x36')]=_[_0x749d('0x34')](_0x3a17b6[_0x749d('0x35')],qs['fields'](_0x1fbadf[_0x749d('0x31')][_0x749d('0x37')]));_0x36bb08[_0x749d('0x36')]=_0x36bb08[_0x749d('0x36')][_0x749d('0x38')]?_0x36bb08[_0x749d('0x36')]:_0x3a17b6[_0x749d('0x35')];if(!_0x1fbadf['query'][_0x749d('0x39')]('nolimit')){_0x36bb08[_0x749d('0x1c')]=qs[_0x749d('0x1c')](_0x1fbadf[_0x749d('0x31')][_0x749d('0x1c')]);_0x36bb08[_0x749d('0x1d')]=qs[_0x749d('0x1d')](_0x1fbadf[_0x749d('0x31')][_0x749d('0x1d')]);}_0x36bb08['order']=qs[_0x749d('0x3a')](_0x1fbadf[_0x749d('0x31')][_0x749d('0x3a')]);_0x36bb08[_0x749d('0x3b')]=qs[_0x749d('0x33')](_['pick'](_0x1fbadf[_0x749d('0x31')],_0x3a17b6[_0x749d('0x33')]),_0x11b921);if(_0x1fbadf[_0x749d('0x31')][_0x749d('0x3c')]){_0x36bb08[_0x749d('0x3b')]=_[_0x749d('0x3d')](_0x36bb08[_0x749d('0x3b')],{'$or':_[_0x749d('0x2b')](_0x11b921,function(_0x6b7e92){if(_0x6b7e92['type']!=='VIRTUAL'){var _0x52a74e={};_0x52a74e[_0x6b7e92[_0x749d('0x29')]]={'$like':'%'+_0x1fbadf[_0x749d('0x31')][_0x749d('0x3c')]+'%'};return _0x52a74e;}})});}_0x36bb08=_['merge']({},_0x36bb08,_0x1fbadf[_0x749d('0x3e')]);var _0x41d652={'where':_0x36bb08[_0x749d('0x3b')]};return db['Pause'][_0x749d('0x3f')](_0x41d652)[_0x749d('0x23')](function(_0x3db927){_0x5902f5[_0x749d('0x3f')]=_0x3db927;if(_0x1fbadf['query'][_0x749d('0x40')]){_0x36bb08[_0x749d('0x41')]=[{'all':!![]}];}return db[_0x749d('0x2c')][_0x749d('0x42')](_0x36bb08);})[_0x749d('0x23')](function(_0x5a7d18){_0x5902f5[_0x749d('0x43')]=_0x5a7d18;return _0x5902f5;})[_0x749d('0x23')](respondWithFilteredResult(_0x1aeeb2,_0x36bb08))[_0x749d('0x44')](handleError(_0x1aeeb2,null));};exports[_0x749d('0x45')]=function(_0x6547b2,_0x3d56c0){var _0x5d7719={'raw':!![],'where':{'id':_0x6547b2[_0x749d('0x46')]['id']}},_0x2dee2c={};_0x2dee2c['model']=_['keys'](db[_0x749d('0x2c')][_0x749d('0x2d')]);_0x2dee2c['query']=_[_0x749d('0x32')](_0x6547b2['query']);_0x2dee2c['filters']=_[_0x749d('0x34')](_0x2dee2c[_0x749d('0x35')],_0x2dee2c[_0x749d('0x31')]);_0x5d7719['attributes']=_[_0x749d('0x34')](_0x2dee2c[_0x749d('0x35')],qs[_0x749d('0x37')](_0x6547b2[_0x749d('0x31')][_0x749d('0x37')]));_0x5d7719['attributes']=_0x5d7719[_0x749d('0x36')][_0x749d('0x38')]?_0x5d7719[_0x749d('0x36')]:_0x2dee2c[_0x749d('0x35')];if(_0x6547b2['query'][_0x749d('0x40')]){_0x5d7719[_0x749d('0x41')]=[{'all':!![]}];}_0x5d7719=_['merge']({},_0x5d7719,_0x6547b2[_0x749d('0x3e')]);return db['Pause']['find'](_0x5d7719)['then'](handleEntityNotFound(_0x3d56c0,null))['then'](respondWithResult(_0x3d56c0,null))[_0x749d('0x44')](handleError(_0x3d56c0,null));};exports['create']=function(_0x3dabe8,_0x55f175){return db[_0x749d('0x2c')]['create'](_0x3dabe8['body'],{})['then'](function(_0x10717d){var _0x1ad38d=_0x3dabe8[_0x749d('0x47')][_0x749d('0x48')]({'plain':!![]});if(!_0x1ad38d)throw new Error(_0x749d('0x49'));if(_0x1ad38d[_0x749d('0x4a')]===_0x749d('0x47')){var _0x1b7ee0=_0x10717d[_0x749d('0x48')]({'plain':!![]});var _0x191de3=_0x749d('0x24');return db[_0x749d('0x4b')][_0x749d('0x4c')]({'where':{'name':_0x191de3,'userProfileId':_0x1ad38d[_0x749d('0x4d')]},'raw':!![]})[_0x749d('0x23')](function(_0x2120bb){if(_0x2120bb&&_0x2120bb[_0x749d('0x4e')]===0x0){return db['UserProfileResource'][_0x749d('0x4f')]({'name':_0x1b7ee0[_0x749d('0x29')],'resourceId':_0x1b7ee0['id'],'type':_0x2120bb[_0x749d('0x29')],'sectionId':_0x2120bb['id']},{})[_0x749d('0x23')](function(){return _0x10717d;});}else{return _0x10717d;}})[_0x749d('0x44')](function(_0x5d8c35){logger[_0x749d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d8c35);throw _0x5d8c35;});}return _0x10717d;})[_0x749d('0x23')](respondWithResult(_0x55f175,0xc9))[_0x749d('0x44')](handleError(_0x55f175,null));};exports[_0x749d('0x22')]=function(_0x5047d6,_0x1e0d1f){if(_0x5047d6[_0x749d('0x50')]['id']){delete _0x5047d6[_0x749d('0x50')]['id'];}return db['Pause'][_0x749d('0x4c')]({'where':{'id':_0x5047d6['params']['id']}})[_0x749d('0x23')](handleEntityNotFound(_0x1e0d1f,null))['then'](saveUpdates(_0x5047d6['body'],null))[_0x749d('0x23')](respondWithResult(_0x1e0d1f,null))[_0x749d('0x44')](handleError(_0x1e0d1f,null));};exports[_0x749d('0x51')]=function(_0x418875,_0x1b25de){return db['Pause']['find']({'where':{'id':_0x418875[_0x749d('0x46')]['id']}})[_0x749d('0x23')](handleEntityNotFound(_0x1b25de,null))[_0x749d('0x23')](removeEntity(_0x1b25de,null))[_0x749d('0x44')](handleError(_0x1b25de,null));};
\ No newline at end of file
index b4dc8ff..a25607e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'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':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x28c923,_0x1d10ce){var _0x49b4cf=function(_0x2737a4){while(--_0x2737a4){_0x28c923['push'](_0x28c923['shift']());}};_0x49b4cf(++_0x1d10ce);}(_0x5fc3,0xa8));var _0x35fc=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0x5fc3[_0x30f5bb];return _0x1cfc00;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cdad42f..4a11887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x385c61,_0xdbda1c){var _0x514308=function(_0x580355){while(--_0x580355){_0x385c61['push'](_0x385c61['shift']());}};_0x514308(++_0xdbda1c);}(_0xb10b,0x12a));var _0xbb10=function(_0x5404e9,_0x132866){_0x5404e9=_0x5404e9-0x0;var _0x2d7c75=_0xb10b[_0x5404e9];return _0x2d7c75;};'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')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x504ad3,_0x28ff9b){var _0x198ca6=function(_0x7db673){while(--_0x7db673){_0x504ad3['push'](_0x504ad3['shift']());}};_0x198ca6(++_0x28ff9b);}(_0xb10b,0x12a));var _0xbb10=function(_0x7d261d,_0x4e1d2f){_0x7d261d=_0x7d261d-0x0;var _0x1a992a=_0xb10b[_0x7d261d];return _0x1a992a;};'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')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
index ab1cae3..9201cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x222f=['index','webhookGet','isAuthenticated','show','/:id/download','download','join','server/files/plugins','originalname','replace','format','extname','now','post','single','file','upload','/webhook','webhookPost','put','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0x222f,0x1a4));var _0xf222=function(_0x2ae8b5,_0x2a2cb6){_0x2ae8b5=_0x2ae8b5-0x0;var _0x29def1=_0x222f[_0x2ae8b5];return _0x29def1;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf222('0x4'));var auth=require(_0xf222('0x5'));var interaction=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var controller=require('./plugin.controller');router[_0xf222('0x8')]('/',auth['isAuthenticated'](),controller[_0xf222('0x9')]);router[_0xf222('0x8')]('/webhook',controller[_0xf222('0xa')]);router[_0xf222('0x8')]('/:id',auth[_0xf222('0xb')](),controller[_0xf222('0xc')]);router[_0xf222('0x8')](_0xf222('0xd'),auth[_0xf222('0xb')](),controller[_0xf222('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e29ad,_0x405080,_0x226dbd){_0x226dbd(null,path[_0xf222('0xf')](config['root'],_0xf222('0x10')));},'filename':function(_0x2850c7,_0x2a6965,_0x3d3d29){_0x2a6965[_0xf222('0x11')]=_0x2a6965[_0xf222('0x11')][_0xf222('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d3d29(null,util[_0xf222('0x13')]('%s-%s%s',path['basename'](_0x2a6965[_0xf222('0x11')],path[_0xf222('0x14')](_0x2a6965['originalname'])),Date[_0xf222('0x15')](),path[_0xf222('0x14')](_0x2a6965[_0xf222('0x11')])));}})});router[_0xf222('0x16')]('/',upload[_0xf222('0x17')](_0xf222('0x18')),controller[_0xf222('0x19')]);router['post'](_0xf222('0x1a'),controller[_0xf222('0x1b')]);router[_0xf222('0x1c')](_0xf222('0x1d'),auth[_0xf222('0xb')](),controller[_0xf222('0x1e')]);router[_0xf222('0x1f')]('/:id',auth[_0xf222('0xb')](),controller[_0xf222('0x1f')]);module[_0xf222('0x20')]=router;
\ No newline at end of file
+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(_0x1c1484,_0x172c1b){var _0x1c1f9a=function(_0x3903fd){while(--_0x3903fd){_0x1c1484['push'](_0x1c1484['shift']());}};_0x1c1f9a(++_0x172c1b);}(_0xec56,0x1bd));var _0x6ec5=function(_0x82536f,_0x34d356){_0x82536f=_0x82536f-0x0;var _0x246861=_0xec56[_0x82536f];return _0x246861;};'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
index 84dfd29..ed85d4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7535=['BOOLEAN','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x240a04,_0x674f70){var _0x3bc6a5=function(_0x21d5bf){while(--_0x21d5bf){_0x240a04['push'](_0x240a04['shift']());}};_0x3bc6a5(++_0x674f70);}(_0x7535,0xe9));var _0x5753=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0x7535[_0x5f49c0];return _0x5ab653;};'use strict';var Sequelize=require(_0x5753('0x0'));module[_0x5753('0x1')]={'name':{'type':Sequelize[_0x5753('0x2')]},'type':{'type':Sequelize['ENUM'](_0x5753('0x3'),_0x5753('0x4'))},'description':{'type':Sequelize[_0x5753('0x5')]},'version':{'type':Sequelize[_0x5753('0x5')]},'path':{'type':Sequelize[_0x5753('0x2')],'comment':_0x5753('0x6')},'active':{'type':Sequelize[_0x5753('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0x5753('0x8'),'agentOnly',_0x5753('0x9'),_0x5753('0xa')),'defaultValue':'always','comment':_0x5753('0xb')},'icon':{'type':Sequelize[_0x5753('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x5753('0x2')]},'scriptName':{'type':Sequelize[_0x5753('0x2')]},'scriptPath':{'type':Sequelize[_0x5753('0x2')]}};
\ No newline at end of file
+var _0x7ff3=['ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','html','script','TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x42e273,_0x4f3d9c){var _0x1e98d6=function(_0x15b303){while(--_0x15b303){_0x42e273['push'](_0x42e273['shift']());}};_0x1e98d6(++_0x4f3d9c);}(_0x7ff3,0xbc));var _0x37ff=function(_0x77d286,_0x1ddc6d){_0x77d286=_0x77d286-0x0;var _0x5446a5=_0x7ff3[_0x77d286];return _0x5446a5;};'use strict';var Sequelize=require('sequelize');module[_0x37ff('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x37ff('0x1'),_0x37ff('0x2'))},'description':{'type':Sequelize[_0x37ff('0x3')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x37ff('0x4')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x37ff('0x5')],'defaultValue':0x0,'comment':_0x37ff('0x6')},'sidebar':{'type':Sequelize[_0x37ff('0x7')](_0x37ff('0x8'),_0x37ff('0x9'),_0x37ff('0xa'),_0x37ff('0xb')),'defaultValue':_0x37ff('0xa'),'comment':_0x37ff('0xc')},'icon':{'type':Sequelize[_0x37ff('0x4')]},'adminUrl':{'type':Sequelize[_0x37ff('0x4')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x37ff('0x4')]},'scriptPath':{'type':Sequelize[_0x37ff('0x4')]}};
\ No newline at end of file
index 320b3b9..4c1a7b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa993=['Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','get','Plugins','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','end','stack','send','index','Plugin','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','merge','map','VIRTUAL','name','filter','options','includeAll','include','findAll','catch','show','params','download','find','path','join','root','format','%s.zip','basename','warning','code','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','admin','test','plugins'];(function(_0x3c7e26,_0x3cc265){var _0x530070=function(_0x5e8036){while(--_0x5e8036){_0x3c7e26['push'](_0x3c7e26['shift']());}};_0x530070(++_0x3cc265);}(_0xa993,0x169));var _0x3a99=function(_0x30f5a6,_0x2ea238){_0x30f5a6=_0x30f5a6-0x0;var _0x2f4674=_0xa993[_0x30f5a6];return _0x2f4674;};'use strict';var emlformat=require(_0x3a99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a99('0x1'));var jsonpatch=require(_0x3a99('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3a99('0x3'));var Mustache=require(_0x3a99('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3a99('0x5'));var csv=require('to-csv');var ejs=require(_0x3a99('0x6'));var fs=require('fs');var fs_extra=require(_0x3a99('0x7'));var _=require('lodash');var squel=require(_0x3a99('0x8'));var crypto=require('crypto');var jsforce=require(_0x3a99('0x9'));var deskjs=require(_0x3a99('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3a99('0xb'));var Papa=require(_0x3a99('0xc'));var extract=require(_0x3a99('0xd'));var rimraf=require(_0x3a99('0xe'));var archiver=require('archiver');var Redis=require(_0x3a99('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3a99('0x10'));var as=require(_0x3a99('0x11'));var hardwareService=require(_0x3a99('0x12'));var logger=require(_0x3a99('0x13'))(_0x3a99('0x14'));var utils=require(_0x3a99('0x15'));var config=require(_0x3a99('0x16'));var licenseUtil=require(_0x3a99('0x17'));var db=require('../../mysqldb')['db'];config[_0x3a99('0x18')]=_[_0x3a99('0x19')](config[_0x3a99('0x18')],{'host':_0x3a99('0x1a'),'port':0x18eb});var socket=require(_0x3a99('0x1b'))(new Redis(config[_0x3a99('0x18')]));require(_0x3a99('0x1c'))[_0x3a99('0x1d')](socket);function respondWithStatusCode(_0xdef406,_0x33e3d1){_0x33e3d1=_0x33e3d1||0xcc;return function(_0x1b5be6){if(_0x1b5be6){return _0xdef406[_0x3a99('0x1e')](_0x33e3d1);}return _0xdef406[_0x3a99('0x1f')](_0x33e3d1)['end']();};}function respondWithResult(_0x24b6e9,_0x585632){_0x585632=_0x585632||0xc8;return function(_0x183c0d){if(_0x183c0d){return _0x24b6e9['status'](_0x585632)[_0x3a99('0x20')](_0x183c0d);}};}function respondWithFilteredResult(_0x3ab270,_0x4205ed){return function(_0x429571){if(_0x429571){var _0x44f7ca=typeof _0x4205ed[_0x3a99('0x21')]===_0x3a99('0x22')&&typeof _0x4205ed[_0x3a99('0x23')]===_0x3a99('0x22');var _0x2f247f=_0x429571[_0x3a99('0x24')];var _0x4a625b=_0x44f7ca?0x0:_0x4205ed[_0x3a99('0x21')];var _0x5320c3=_0x44f7ca?_0x429571['count']:_0x4205ed[_0x3a99('0x21')]+_0x4205ed['limit'];var _0x389cce;if(_0x5320c3>=_0x2f247f){_0x5320c3=_0x2f247f;_0x389cce=0xc8;}else{_0x389cce=0xce;}_0x3ab270[_0x3a99('0x1f')](_0x389cce);return _0x3ab270['set'](_0x3a99('0x25'),_0x4a625b+'-'+_0x5320c3+'/'+_0x2f247f)[_0x3a99('0x20')](_0x429571);}return null;};}function patchUpdates(_0x4c5fec){return function(_0xe7c09d){try{jsonpatch['apply'](_0xe7c09d,_0x4c5fec,!![]);}catch(_0x5369f2){return BPromise[_0x3a99('0x26')](_0x5369f2);}return _0xe7c09d['save']();};}function saveUpdates(_0xd0cfd9,_0x38025d){return function(_0x41869c){if(_0x41869c){return _0x41869c[_0x3a99('0x27')](_0xd0cfd9)[_0x3a99('0x28')](function(_0x55f55b){return _0x55f55b;});}return null;};}function removeEntity(_0x27da8f,_0x896575){return function(_0x57dd93){if(_0x57dd93){return _0x57dd93['destroy']()[_0x3a99('0x28')](function(){var _0x5e532b=_0x57dd93['get']({'plain':!![]});var _0x4aa7bf='Plugins';return db['UserProfileResource'][_0x3a99('0x29')]({'where':{'type':_0x4aa7bf,'resourceId':_0x5e532b['id']}})[_0x3a99('0x28')](function(){return _0x57dd93;});})[_0x3a99('0x28')](function(){_0x27da8f[_0x3a99('0x1f')](0xcc)[_0x3a99('0x2a')]();});}};}function handleEntityNotFound(_0x202e25,_0x201037){return function(_0x4923b3){if(!_0x4923b3){_0x202e25['sendStatus'](0x194);}return _0x4923b3;};}function handleError(_0x245a45,_0x26f7a2){_0x26f7a2=_0x26f7a2||0x1f4;return function(_0x12d84a){logger['error'](_0x12d84a[_0x3a99('0x2b')]);if(_0x12d84a['name']){delete _0x12d84a['name'];}_0x245a45[_0x3a99('0x1f')](_0x26f7a2)[_0x3a99('0x2c')](_0x12d84a);};}exports[_0x3a99('0x2d')]=function(_0x46c7bd,_0x3f95b6){var _0x5d3fa4={},_0x255148={},_0x1d2730={'count':0x0,'rows':[]};var _0x81c919=_['map'](db[_0x3a99('0x2e')][_0x3a99('0x2f')],function(_0x405704){return{'name':_0x405704[_0x3a99('0x30')],'type':_0x405704[_0x3a99('0x31')][_0x3a99('0x32')]};});_0x255148['model']=_['map'](_0x81c919,'name');_0x255148[_0x3a99('0x33')]=_[_0x3a99('0x34')](_0x46c7bd[_0x3a99('0x33')]);_0x255148[_0x3a99('0x35')]=_[_0x3a99('0x36')](_0x255148[_0x3a99('0x37')],_0x255148[_0x3a99('0x33')]);_0x5d3fa4[_0x3a99('0x38')]=_['intersection'](_0x255148[_0x3a99('0x37')],qs[_0x3a99('0x39')](_0x46c7bd[_0x3a99('0x33')][_0x3a99('0x39')]));_0x5d3fa4['attributes']=_0x5d3fa4['attributes'][_0x3a99('0x3a')]?_0x5d3fa4[_0x3a99('0x38')]:_0x255148['model'];if(!_0x46c7bd[_0x3a99('0x33')]['hasOwnProperty']('nolimit')){_0x5d3fa4[_0x3a99('0x23')]=qs[_0x3a99('0x23')](_0x46c7bd[_0x3a99('0x33')][_0x3a99('0x23')]);_0x5d3fa4[_0x3a99('0x21')]=qs['offset'](_0x46c7bd[_0x3a99('0x33')][_0x3a99('0x21')]);}_0x5d3fa4['order']=qs[_0x3a99('0x3b')](_0x46c7bd[_0x3a99('0x33')][_0x3a99('0x3b')]);_0x5d3fa4[_0x3a99('0x3c')]=qs[_0x3a99('0x35')](_[_0x3a99('0x3d')](_0x46c7bd[_0x3a99('0x33')],_0x255148[_0x3a99('0x35')]),_0x81c919);if(_0x46c7bd['query']['filter']){_0x5d3fa4[_0x3a99('0x3c')]=_[_0x3a99('0x3e')](_0x5d3fa4['where'],{'$or':_[_0x3a99('0x3f')](_0x81c919,function(_0x1eea49){if(_0x1eea49[_0x3a99('0x31')]!==_0x3a99('0x40')){var _0x317094={};_0x317094[_0x1eea49[_0x3a99('0x41')]]={'$like':'%'+_0x46c7bd[_0x3a99('0x33')][_0x3a99('0x42')]+'%'};return _0x317094;}})});}_0x5d3fa4=_[_0x3a99('0x3e')]({},_0x5d3fa4,_0x46c7bd[_0x3a99('0x43')]);var _0x3c0cf5={'where':_0x5d3fa4[_0x3a99('0x3c')]};return db[_0x3a99('0x2e')][_0x3a99('0x24')](_0x3c0cf5)[_0x3a99('0x28')](function(_0x5f23e4){_0x1d2730[_0x3a99('0x24')]=_0x5f23e4;if(_0x46c7bd['query'][_0x3a99('0x44')]){_0x5d3fa4[_0x3a99('0x45')]=[{'all':!![]}];}return db[_0x3a99('0x2e')][_0x3a99('0x46')](_0x5d3fa4);})[_0x3a99('0x28')](function(_0x34423a){_0x1d2730['rows']=_0x34423a;return _0x1d2730;})[_0x3a99('0x28')](respondWithFilteredResult(_0x3f95b6,_0x5d3fa4))[_0x3a99('0x47')](handleError(_0x3f95b6,null));};exports[_0x3a99('0x48')]=function(_0xc1cc98,_0x2fd7d2){var _0x2ec1cb={'raw':!![],'where':{'id':_0xc1cc98[_0x3a99('0x49')]['id']}},_0x4d155c={};_0x4d155c[_0x3a99('0x37')]=_['keys'](db[_0x3a99('0x2e')][_0x3a99('0x2f')]);_0x4d155c['query']=_['keys'](_0xc1cc98[_0x3a99('0x33')]);_0x4d155c[_0x3a99('0x35')]=_[_0x3a99('0x36')](_0x4d155c[_0x3a99('0x37')],_0x4d155c[_0x3a99('0x33')]);_0x2ec1cb[_0x3a99('0x38')]=_[_0x3a99('0x36')](_0x4d155c[_0x3a99('0x37')],qs[_0x3a99('0x39')](_0xc1cc98[_0x3a99('0x33')][_0x3a99('0x39')]));_0x2ec1cb[_0x3a99('0x38')]=_0x2ec1cb[_0x3a99('0x38')][_0x3a99('0x3a')]?_0x2ec1cb['attributes']:_0x4d155c['model'];if(_0xc1cc98[_0x3a99('0x33')][_0x3a99('0x44')]){_0x2ec1cb[_0x3a99('0x45')]=[{'all':!![]}];}_0x2ec1cb=_['merge']({},_0x2ec1cb,_0xc1cc98['options']);return db[_0x3a99('0x2e')]['find'](_0x2ec1cb)['then'](handleEntityNotFound(_0x2fd7d2,null))[_0x3a99('0x28')](respondWithResult(_0x2fd7d2,null))[_0x3a99('0x47')](handleError(_0x2fd7d2,null));};exports[_0x3a99('0x4a')]=function(_0x487081,_0x2363bf,_0xcdfff){return db[_0x3a99('0x2e')][_0x3a99('0x4b')]({'where':{'id':_0x487081[_0x3a99('0x49')]['id']},'attributes':[_0x3a99('0x41'),_0x3a99('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x2363bf,null))[_0x3a99('0x28')](function(_0x2069b7){if(_0x2069b7){var _0x5a49ed=path[_0x3a99('0x4d')](config[_0x3a99('0x4e')],'server/files/plugins',util[_0x3a99('0x4f')](_0x3a99('0x50'),path[_0x3a99('0x51')](_0x2069b7[_0x3a99('0x4c')])));var _0x5aa1c2=fs['createWriteStream'](_0x5a49ed);var _0x37ebb5=archiver('zip',{'zlib':{'level':0x9}});_0x37ebb5['on'](_0x3a99('0x52'),function(_0x115d2a){if(_0x115d2a[_0x3a99('0x53')]==='ENOENT'){logger[_0x3a99('0x54')](_0x115d2a);}else{throw new db[(_0x3a99('0x55'))][(_0x3a99('0x56'))](_0x3a99('0x57'));}});_0x37ebb5['on']('error',function(_0x87926f){throw new db[(_0x3a99('0x55'))][(_0x3a99('0x56'))](_0x3a99('0x57'));});_0x37ebb5[_0x3a99('0x58')](_0x5aa1c2);_0x37ebb5[_0x3a99('0x59')](_0x3a99('0x5a'),{'cwd':path[_0x3a99('0x4d')](config['root'],'server/files/plugins',path[_0x3a99('0x5b')](_0x2069b7['path'])),'ignore':[path['join'](path[_0x3a99('0x51')](_0x2069b7[_0x3a99('0x4c')]),_0x3a99('0x5c')),path[_0x3a99('0x4d')](path[_0x3a99('0x51')](_0x2069b7[_0x3a99('0x4c')]),_0x3a99('0x5d'))],'nodir':!![]})[_0x3a99('0x5e')]();_0x5aa1c2['on'](_0x3a99('0x5f'),function(){if(!fs[_0x3a99('0x60')](_0x5a49ed)){throw new db[(_0x3a99('0x55'))][(_0x3a99('0x56'))]('Plugin\x20not\x20found');}return _0x2363bf[_0x3a99('0x4a')](_0x5a49ed,util[_0x3a99('0x4f')](_0x3a99('0x50'),path[_0x3a99('0x51')](_0x2069b7[_0x3a99('0x4c')])),function(_0x139dbe){if(_0x139dbe){throw new db['Sequelize'][(_0x3a99('0x56'))](_0x3a99('0x61'));}fs[_0x3a99('0x62')](_0x5a49ed);logger[_0x3a99('0x63')]('Download\x20completed');logger[_0x3a99('0x63')](_0x3a99('0x64'));});});}return null;})['catch'](handleError(_0x2363bf,null));};exports[_0x3a99('0x65')]=function(_0x339d59,_0x1ac746,_0x12a176){var _0x11c15c=path[_0x3a99('0x51')](_0x339d59[_0x3a99('0x66')][_0x3a99('0x67')],path['extname'](_0x339d59[_0x3a99('0x66')]['filename']));var _0x4c9f59=path['join'](config['root'],_0x3a99('0x68'),_0x339d59[_0x3a99('0x66')][_0x3a99('0x67')]);var _0x2b9b38=path[_0x3a99('0x4d')](config[_0x3a99('0x4e')],_0x3a99('0x68'),_0x11c15c);logger[_0x3a99('0x63')](_0x3a99('0x69'),_0x4c9f59);logger['info'](_0x3a99('0x6a'),_0x2b9b38);try{fs[_0x3a99('0x6b')](_0x4c9f59,parseInt(_0x3a99('0x6c'),0x8));extract(_0x4c9f59,{'dir':_0x2b9b38},function(_0x1e94a3){if(_0x1e94a3){logger[_0x3a99('0x54')](_0x1e94a3);handleError(_0x1e94a3,!![]);};var _0x5b68f8=fs[_0x3a99('0x6d')](_0x2b9b38);if(_0x5b68f8[_0x3a99('0x3a')]>0x1){removeReferences(_0x4c9f59,_0x2b9b38);logger['error'](_0x3a99('0x6e'));return _0x12a176(new Error(_0x3a99('0x6e')));}var _0x463fa5=fs[_0x3a99('0x6f')](path['join'](_0x2b9b38,_0x5b68f8[0x0]));if(_0x463fa5[_0x3a99('0x70')]()){removeReferences(_0x4c9f59,_0x2b9b38);logger[_0x3a99('0x54')]('Invalid\x20plugin\x20structure');return _0x12a176(new Error(_0x3a99('0x6e')));}if(_0x463fa5[_0x3a99('0x71')]()){var _0x54f1d5=fs[_0x3a99('0x6d')](path[_0x3a99('0x4d')](_0x2b9b38,_0x5b68f8[0x0]));if(_0x54f1d5[_0x3a99('0x3a')]===0x0){removeReferences(_0x4c9f59,_0x2b9b38);logger[_0x3a99('0x54')](_0x3a99('0x6e'));return _0x12a176(new Error(_0x3a99('0x6e')));}var _0x61498f=_0x54f1d5['some'](function(_0x4a85e1){return _0x4a85e1===_0x3a99('0x72');});if(!_0x61498f){return _0x12a176(new Error('Plugin\x20manifest\x20missing'));}var _0x4233f3=fs[_0x3a99('0x73')](path[_0x3a99('0x4d')](_0x2b9b38,_0x5b68f8[0x0],_0x3a99('0x72')));var _0x232a65=JSON[_0x3a99('0x74')](_0x4233f3);if(_0x3a99('0x22')==typeof _0x232a65['name']){return _0x12a176(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x3a99('0x22')==typeof _0x232a65[_0x3a99('0x31')]){return _0x12a176(new Error(_0x3a99('0x75')));}if(_0x3a99('0x22')==typeof _0x232a65['version']){return _0x12a176(new Error(_0x3a99('0x76')));}if(_0x3a99('0x22')==typeof _0x232a65['parameters']){return _0x12a176(new Error(_0x3a99('0x77')));}if(_0x232a65[_0x3a99('0x31')]===_0x3a99('0x78')){if(_0x3a99('0x22')==typeof _0x232a65['parameters'][_0x3a99('0x79')]){return _0x12a176(new Error(_0x3a99('0x7a')));}if(_0x3a99('0x22')==typeof _0x232a65[_0x3a99('0x7b')]['views']['admin']&&_0x3a99('0x22')==typeof _0x232a65[_0x3a99('0x7b')][_0x3a99('0x79')][_0x3a99('0x7c')]){return _0x12a176(new Error(_0x3a99('0x7d')));}}else if(_0x232a65[_0x3a99('0x31')]===_0x3a99('0x7e')){if(_0x3a99('0x22')==typeof _0x232a65[_0x3a99('0x7b')][_0x3a99('0x7f')]){return _0x12a176(new Error(_0x3a99('0x80')));}if(_0x3a99('0x22')==typeof _0x232a65[_0x3a99('0x7b')][_0x3a99('0x81')]){return _0x12a176(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x12a176(new Error(_0x3a99('0x82')));}var _0x413102=_0x232a65[_0x3a99('0x41')];var _0x5ee0b9=_0x232a65[_0x3a99('0x83')];var _0x4101c0=_0x232a65[_0x3a99('0x31')];var _0x39133b=_0x232a65[_0x3a99('0x84')]?_0x232a65[_0x3a99('0x84')]:_0x3a99('0x85');var _0x46884c=_0x232a65[_0x3a99('0x86')]?_0x232a65[_0x3a99('0x86')]:_0x3a99('0x87');var _0x5ed9ed='';var _0x1ba33b='';var _0x4617d7='';var _0x142b78='';var _0x3c3ff2=_0x232a65[_0x3a99('0x88')];if(_0x4101c0==='html'){if(_0x3a99('0x22')!=typeof _0x232a65[_0x3a99('0x7b')][_0x3a99('0x79')][_0x3a99('0x89')]){var _0x48f4df=_0x232a65['parameters'][_0x3a99('0x79')][_0x3a99('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x3a99('0x8a')](_0x48f4df)){_0x5ed9ed=path[_0x3a99('0x4d')](_0x3a99('0x8b'),_0x11c15c,_0x5b68f8[0x0],_0x48f4df);}else{_0x5ed9ed=_0x48f4df;}}else{logger[_0x3a99('0x63')](_0x3a99('0x8c'));}if('undefined'!=typeof _0x232a65[_0x3a99('0x7b')][_0x3a99('0x79')][_0x3a99('0x7c')]){var _0xfa2019=_0x232a65[_0x3a99('0x7b')][_0x3a99('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x3a99('0x8a')](_0xfa2019)){_0x1ba33b=path['join'](_0x3a99('0x8b'),_0x11c15c,_0x5b68f8[0x0],_0xfa2019);}else{_0x1ba33b=_0xfa2019;}}else{logger[_0x3a99('0x63')](_0x3a99('0x8d'));}}else if(_0x4101c0===_0x3a99('0x7e')){_0x4617d7=_0x232a65[_0x3a99('0x7b')]['scriptName'];_0x142b78=_0x232a65['parameters'][_0x3a99('0x81')];if(_0x3a99('0x22')!=typeof _0x232a65[_0x3a99('0x7b')]['views']){if(_0x3a99('0x22')!=typeof _0x232a65[_0x3a99('0x7b')][_0x3a99('0x79')][_0x3a99('0x89')]){var _0x48f4df=_0x232a65[_0x3a99('0x7b')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x3a99('0x8a')](_0x48f4df)){_0x5ed9ed=path[_0x3a99('0x4d')]('plugins',_0x11c15c,_0x5b68f8[0x0],_0x48f4df);}else{_0x5ed9ed=_0x48f4df;}}if(_0x3a99('0x22')!=typeof _0x232a65['parameters'][_0x3a99('0x79')][_0x3a99('0x7c')]){var _0xfa2019=_0x232a65['parameters'][_0x3a99('0x79')][_0x3a99('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0xfa2019)){_0x1ba33b=path[_0x3a99('0x4d')](_0x3a99('0x8b'),_0x11c15c,_0x5b68f8[0x0],_0xfa2019);}else{_0x1ba33b=_0xfa2019;}}}}var _0x3fb403={'name':_0x413102,'description':_0x5ee0b9,'path':path[_0x3a99('0x4d')](_0x11c15c,_0x5b68f8[0x0]),'type':_0x4101c0,'sidebar':_0x39133b,'icon':_0x46884c,'adminUrl':_0x5ed9ed,'agentUrl':_0x1ba33b,'scriptName':_0x4617d7,'scriptPath':_0x142b78,'version':_0x3c3ff2};removeReferences(_0x4c9f59,null);return db[_0x3a99('0x2e')][_0x3a99('0x8e')](_0x3fb403)[_0x3a99('0x28')](function(_0x2cd35d){var _0x4f1348={'role':_0x339d59[_0x3a99('0x8f')][_0x3a99('0x90')],'userProfileId':_0x339d59[_0x3a99('0x8f')][_0x3a99('0x91')]};if(!_0x4f1348)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f1348[_0x3a99('0x90')]==='user'){var _0x459fb4=_0x2cd35d[_0x3a99('0x92')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x3a99('0x93'),'userProfileId':_0x4f1348['userProfileId']},'raw':!![]})[_0x3a99('0x28')](function(_0x31ce3e){if(_0x31ce3e&&_0x31ce3e[_0x3a99('0x94')]===0x0){return db[_0x3a99('0x95')][_0x3a99('0x8e')]({'name':_0x459fb4['name'],'resourceId':_0x459fb4['id'],'type':_0x31ce3e[_0x3a99('0x41')],'sectionId':_0x31ce3e['id']},{})[_0x3a99('0x28')](function(){return _0x2cd35d;});}else{return _0x2cd35d;}})[_0x3a99('0x47')](function(_0x29bc22){logger['error'](_0x3a99('0x96'),_0x29bc22);throw _0x29bc22;});}return _0x2cd35d;})[_0x3a99('0x28')](respondWithResult(_0x1ac746,null))[_0x3a99('0x47')](handleError(_0x1ac746,null));}});}catch(_0x487676){_0x1ac746['status'](0x1f4)[_0x3a99('0x2c')](_0x487676);}};function removeReferences(_0x1c380f,_0x4d3db3){try{if(_0x1c380f){fs[_0x3a99('0x62')](_0x1c380f);logger['info'](_0x3a99('0x97'));}if(_0x4d3db3){rimraf(_0x4d3db3,function(){});logger[_0x3a99('0x63')](_0x3a99('0x98'));}}catch(_0x57c687){logger[_0x3a99('0x54')](_0x57c687);}}exports['update']=function(_0x51b26f,_0x13852b,_0x5e08f2){return db[_0x3a99('0x2e')]['find']({'where':{'id':_0x51b26f[_0x3a99('0x49')]['id']}})['then'](handleEntityNotFound(_0x13852b,null))[_0x3a99('0x28')](saveUpdates(_0x51b26f[_0x3a99('0x8f')],null))['then'](respondWithResult(_0x13852b,null))[_0x3a99('0x47')](handleError(_0x13852b,null));};exports[_0x3a99('0x99')]=function(_0x354201,_0x5ada75,_0x2e2c7f){return db[_0x3a99('0x2e')][_0x3a99('0x4b')]({'where':{'id':_0x354201[_0x3a99('0x49')]['id']}})[_0x3a99('0x28')](function(_0x117ce8){if(_0x117ce8){return _0x117ce8['destroy']();}})[_0x3a99('0x28')](function(_0x242059){rimraf(path['join'](config[_0x3a99('0x4e')],_0x3a99('0x68'),path[_0x3a99('0x5b')](_0x242059[_0x3a99('0x4c')])),function(){});return _0x242059;})['then'](handleEntityNotFound(_0x5ada75,null))[_0x3a99('0x28')](respondWithStatusCode(_0x5ada75,null))[_0x3a99('0x47')](handleError(_0x5ada75,null));};exports['webhookGet']=function(_0x297745,_0x14f8ec,_0x4a2d3b){return BPromise[_0x3a99('0x9a')]()['then'](function(){if(!_0x297745[_0x3a99('0x33')][_0x3a99('0x4c')]){throw new Error(_0x3a99('0x9b'));}if(!_0x297745[_0x3a99('0x33')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x22dfa6=_0x297745[_0x3a99('0x33')][_0x3a99('0x9c')]?_0x297745['query'][_0x3a99('0x9c')]+':'+_0x297745[_0x3a99('0x33')]['port']:'http://localhost:'+_0x297745[_0x3a99('0x33')][_0x3a99('0x9d')];var _0x10c068=_0x297745[_0x3a99('0x33')]['json']?_0x297745['query'][_0x3a99('0x20')]:!![];var _0x7a49b2=_0x297745['query'][_0x3a99('0x9e')]?_0x297745[_0x3a99('0x33')]['encoding']:null;var _0x2c5b8a={'method':_0x297745[_0x3a99('0x9f')],'uri':util[_0x3a99('0x4f')](_0x3a99('0xa0'),_0x22dfa6,_0x297745[_0x3a99('0x33')][_0x3a99('0x4c')]),'json':_0x10c068,'resolveWithFullResponse':!![],'encoding':_0x7a49b2,'qs':_0x297745[_0x3a99('0x33')]};if(_0x297745[_0x3a99('0xa1')]){_0x2c5b8a['headers']=_0x297745[_0x3a99('0xa1')];if(_0x2c5b8a['headers'][_0x3a99('0xa2')]){delete _0x2c5b8a[_0x3a99('0xa1')][_0x3a99('0xa2')];}}if(_0x2c5b8a[_0x3a99('0xa1')]['content-type']){delete _0x2c5b8a[_0x3a99('0xa1')][_0x3a99('0xa3')];}return rp(_0x2c5b8a);})[_0x3a99('0x28')](function(_0x48b83a){if(_0x48b83a){_0x14f8ec['set'](_0x48b83a[_0x3a99('0xa1')]);logger[_0x3a99('0x63')](_0x48b83a[_0x3a99('0x8f')]);if(_['endsWith'](_0x297745['query'][_0x3a99('0x4c')],_0x3a99('0x4a'))&&_0x48b83a['statusCode']==0x1f4){return _0x14f8ec[_0x3a99('0x1e')](_0x48b83a[_0x3a99('0xa4')]);}else{return _0x14f8ec['status'](_0x48b83a[_0x3a99('0xa4')])['send'](_0x48b83a[_0x3a99('0x8f')]);}}else{return _0x14f8ec[_0x3a99('0x1e')](0xc8);}})['catch'](handleError(_0x14f8ec,null));};exports[_0x3a99('0xa5')]=function(_0x4d374f,_0x4d10c5,_0x48f929){return BPromise[_0x3a99('0x9a')]()[_0x3a99('0x28')](function(){if(!_0x4d374f[_0x3a99('0x33')]['path']){throw new Error(_0x3a99('0x9b'));}if(!_0x4d374f[_0x3a99('0x33')][_0x3a99('0x9d')]){throw new Error(_0x3a99('0xa6'));}var _0xc26514=_0x4d374f[_0x3a99('0x33')]['hostname']?_0x4d374f['query'][_0x3a99('0x9c')]+':'+_0x4d374f[_0x3a99('0x33')][_0x3a99('0x9d')]:'http://localhost:'+_0x4d374f[_0x3a99('0x33')][_0x3a99('0x9d')];var _0x2672d4=_0x4d374f[_0x3a99('0x33')][_0x3a99('0x20')]?_0x4d374f[_0x3a99('0x33')][_0x3a99('0x20')]:!![];var _0x1fd057=_0x4d374f[_0x3a99('0x33')][_0x3a99('0x9e')]?_0x4d374f[_0x3a99('0x33')][_0x3a99('0x9e')]:null;var _0x4e306a={'method':_0x4d374f[_0x3a99('0x9f')],'uri':util['format'](_0x3a99('0xa0'),_0xc26514,_0x4d374f['query']['path']),'json':_0x2672d4,'resolveWithFullResponse':!![],'encoding':_0x1fd057,'body':_0x4d374f[_0x3a99('0x8f')]};if(_0x4d374f[_0x3a99('0xa1')]){_0x4e306a[_0x3a99('0xa1')]=_0x4d374f['headers'];if(_0x4e306a[_0x3a99('0xa1')]['content-length']){delete _0x4e306a[_0x3a99('0xa1')][_0x3a99('0xa2')];}}if(_0x4e306a['headers'][_0x3a99('0xa3')]){delete _0x4e306a['headers'][_0x3a99('0xa3')];}return rp(_0x4e306a);})[_0x3a99('0x28')](function(_0x567695){if(_0x567695){_0x4d10c5['set'](_0x567695['headers']);logger[_0x3a99('0x63')](_0x567695[_0x3a99('0x8f')]);return _0x4d10c5[_0x3a99('0x1f')](_0x567695['statusCode'])[_0x3a99('0x2c')](_0x567695[_0x3a99('0x8f')]);}else{return _0x4d10c5[_0x3a99('0x1e')](0xc8);}})['catch'](handleError(_0x4d10c5,null));};
\ No newline at end of file
+var _0xa887=['content-type','endsWith','statusCode','webhookPost','port','http://localhost:','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','archiver','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','Plugin','includeAll','findAll','show','params','include','catch','download','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','Sequelize','Error','pipe','node_modules/**/*','attachments/**/*','finalize','existsSync','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length'];(function(_0x2eb436,_0x1a5258){var _0x274e77=function(_0x24d5fb){while(--_0x24d5fb){_0x2eb436['push'](_0x2eb436['shift']());}};_0x274e77(++_0x1a5258);}(_0xa887,0x150));var _0x7a88=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa887[_0x47b58b];return _0x46bebe;};'use strict';var emlformat=require(_0x7a88('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a88('0x1'));var BPromise=require(_0x7a88('0x2'));var Mustache=require(_0x7a88('0x3'));var util=require(_0x7a88('0x4'));var path=require(_0x7a88('0x5'));var sox=require(_0x7a88('0x6'));var csv=require(_0x7a88('0x7'));var ejs=require(_0x7a88('0x8'));var fs=require('fs');var fs_extra=require(_0x7a88('0x9'));var _=require(_0x7a88('0xa'));var squel=require(_0x7a88('0xb'));var crypto=require(_0x7a88('0xc'));var jsforce=require(_0x7a88('0xd'));var deskjs=require(_0x7a88('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7a88('0xf'));var Papa=require('papaparse');var extract=require(_0x7a88('0x10'));var rimraf=require(_0x7a88('0x11'));var archiver=require(_0x7a88('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a88('0x13'))(_0x7a88('0x14'));var utils=require(_0x7a88('0x15'));var config=require(_0x7a88('0x16'));var licenseUtil=require(_0x7a88('0x17'));var db=require('../../mysqldb')['db'];config[_0x7a88('0x18')]=_[_0x7a88('0x19')](config['redis'],{'host':_0x7a88('0x1a'),'port':0x18eb});var socket=require(_0x7a88('0x1b'))(new Redis(config[_0x7a88('0x18')]));require(_0x7a88('0x1c'))[_0x7a88('0x1d')](socket);function respondWithStatusCode(_0x27cac6,_0x3e0d50){_0x3e0d50=_0x3e0d50||0xcc;return function(_0x560615){if(_0x560615){return _0x27cac6[_0x7a88('0x1e')](_0x3e0d50);}return _0x27cac6[_0x7a88('0x1f')](_0x3e0d50)[_0x7a88('0x20')]();};}function respondWithResult(_0x55d546,_0x3c48bb){_0x3c48bb=_0x3c48bb||0xc8;return function(_0x3e073d){if(_0x3e073d){return _0x55d546[_0x7a88('0x1f')](_0x3c48bb)[_0x7a88('0x21')](_0x3e073d);}};}function respondWithFilteredResult(_0x455060,_0x38fa7e){return function(_0x21bd35){if(_0x21bd35){var _0x510e52=typeof _0x38fa7e['offset']===_0x7a88('0x22')&&typeof _0x38fa7e[_0x7a88('0x23')]===_0x7a88('0x22');var _0x325c1f=_0x21bd35[_0x7a88('0x24')];var _0x3b2cb1=_0x510e52?0x0:_0x38fa7e[_0x7a88('0x25')];var _0x1e32ec=_0x510e52?_0x21bd35[_0x7a88('0x24')]:_0x38fa7e[_0x7a88('0x25')]+_0x38fa7e[_0x7a88('0x23')];var _0x5a8490;if(_0x1e32ec>=_0x325c1f){_0x1e32ec=_0x325c1f;_0x5a8490=0xc8;}else{_0x5a8490=0xce;}_0x455060[_0x7a88('0x1f')](_0x5a8490);return _0x455060[_0x7a88('0x26')](_0x7a88('0x27'),_0x3b2cb1+'-'+_0x1e32ec+'/'+_0x325c1f)[_0x7a88('0x21')](_0x21bd35);}return null;};}function patchUpdates(_0x1f310b){return function(_0x331fec){try{jsonpatch[_0x7a88('0x28')](_0x331fec,_0x1f310b,!![]);}catch(_0x33e41d){return BPromise[_0x7a88('0x29')](_0x33e41d);}return _0x331fec['save']();};}function saveUpdates(_0x2efdd7,_0x21a89a){return function(_0x488017){if(_0x488017){return _0x488017[_0x7a88('0x2a')](_0x2efdd7)[_0x7a88('0x2b')](function(_0x4be364){return _0x4be364;});}return null;};}function removeEntity(_0x322b0d,_0x3e6df3){return function(_0x4ccae2){if(_0x4ccae2){return _0x4ccae2[_0x7a88('0x2c')]()[_0x7a88('0x2b')](function(){var _0xa6e010=_0x4ccae2[_0x7a88('0x2d')]({'plain':!![]});var _0x23f360='Plugins';return db[_0x7a88('0x2e')]['destroy']({'where':{'type':_0x23f360,'resourceId':_0xa6e010['id']}})[_0x7a88('0x2b')](function(){return _0x4ccae2;});})[_0x7a88('0x2b')](function(){_0x322b0d[_0x7a88('0x1f')](0xcc)[_0x7a88('0x20')]();});}};}function handleEntityNotFound(_0x135fed,_0x1d423c){return function(_0x4180a8){if(!_0x4180a8){_0x135fed[_0x7a88('0x1e')](0x194);}return _0x4180a8;};}function handleError(_0x12eb28,_0x4439ea){_0x4439ea=_0x4439ea||0x1f4;return function(_0x200850){logger[_0x7a88('0x2f')](_0x200850['stack']);if(_0x200850[_0x7a88('0x30')]){delete _0x200850[_0x7a88('0x30')];}_0x12eb28[_0x7a88('0x1f')](_0x4439ea)[_0x7a88('0x31')](_0x200850);};}exports[_0x7a88('0x32')]=function(_0x1d2761,_0x30cf16){var _0x3fb332={},_0x53031={},_0x32b026={'count':0x0,'rows':[]};var _0x5e7652=_[_0x7a88('0x33')](db['Plugin'][_0x7a88('0x34')],function(_0x2f39fa){return{'name':_0x2f39fa[_0x7a88('0x35')],'type':_0x2f39fa['type'][_0x7a88('0x36')]};});_0x53031[_0x7a88('0x37')]=_[_0x7a88('0x33')](_0x5e7652,_0x7a88('0x30'));_0x53031['query']=_[_0x7a88('0x38')](_0x1d2761[_0x7a88('0x39')]);_0x53031[_0x7a88('0x3a')]=_[_0x7a88('0x3b')](_0x53031[_0x7a88('0x37')],_0x53031[_0x7a88('0x39')]);_0x3fb332['attributes']=_[_0x7a88('0x3b')](_0x53031['model'],qs[_0x7a88('0x3c')](_0x1d2761[_0x7a88('0x39')]['fields']));_0x3fb332[_0x7a88('0x3d')]=_0x3fb332['attributes'][_0x7a88('0x3e')]?_0x3fb332['attributes']:_0x53031['model'];if(!_0x1d2761[_0x7a88('0x39')][_0x7a88('0x3f')](_0x7a88('0x40'))){_0x3fb332[_0x7a88('0x23')]=qs[_0x7a88('0x23')](_0x1d2761['query'][_0x7a88('0x23')]);_0x3fb332['offset']=qs['offset'](_0x1d2761[_0x7a88('0x39')][_0x7a88('0x25')]);}_0x3fb332['order']=qs[_0x7a88('0x41')](_0x1d2761[_0x7a88('0x39')][_0x7a88('0x41')]);_0x3fb332[_0x7a88('0x42')]=qs[_0x7a88('0x3a')](_[_0x7a88('0x43')](_0x1d2761[_0x7a88('0x39')],_0x53031[_0x7a88('0x3a')]),_0x5e7652);if(_0x1d2761[_0x7a88('0x39')][_0x7a88('0x44')]){_0x3fb332[_0x7a88('0x42')]=_[_0x7a88('0x45')](_0x3fb332[_0x7a88('0x42')],{'$or':_['map'](_0x5e7652,function(_0x328e56){if(_0x328e56[_0x7a88('0x46')]!=='VIRTUAL'){var _0x5277fa={};_0x5277fa[_0x328e56[_0x7a88('0x30')]]={'$like':'%'+_0x1d2761[_0x7a88('0x39')]['filter']+'%'};return _0x5277fa;}})});}_0x3fb332=_[_0x7a88('0x45')]({},_0x3fb332,_0x1d2761[_0x7a88('0x47')]);var _0x279007={'where':_0x3fb332[_0x7a88('0x42')]};return db[_0x7a88('0x48')]['count'](_0x279007)[_0x7a88('0x2b')](function(_0x4d1b81){_0x32b026['count']=_0x4d1b81;if(_0x1d2761[_0x7a88('0x39')][_0x7a88('0x49')]){_0x3fb332['include']=[{'all':!![]}];}return db[_0x7a88('0x48')][_0x7a88('0x4a')](_0x3fb332);})[_0x7a88('0x2b')](function(_0x1ac884){_0x32b026['rows']=_0x1ac884;return _0x32b026;})['then'](respondWithFilteredResult(_0x30cf16,_0x3fb332))['catch'](handleError(_0x30cf16,null));};exports[_0x7a88('0x4b')]=function(_0x3d8a05,_0x165a4a){var _0xe305a5={'raw':!![],'where':{'id':_0x3d8a05[_0x7a88('0x4c')]['id']}},_0x1f8a7a={};_0x1f8a7a[_0x7a88('0x37')]=_['keys'](db[_0x7a88('0x48')][_0x7a88('0x34')]);_0x1f8a7a['query']=_[_0x7a88('0x38')](_0x3d8a05['query']);_0x1f8a7a[_0x7a88('0x3a')]=_[_0x7a88('0x3b')](_0x1f8a7a[_0x7a88('0x37')],_0x1f8a7a[_0x7a88('0x39')]);_0xe305a5[_0x7a88('0x3d')]=_[_0x7a88('0x3b')](_0x1f8a7a[_0x7a88('0x37')],qs[_0x7a88('0x3c')](_0x3d8a05[_0x7a88('0x39')][_0x7a88('0x3c')]));_0xe305a5['attributes']=_0xe305a5[_0x7a88('0x3d')][_0x7a88('0x3e')]?_0xe305a5[_0x7a88('0x3d')]:_0x1f8a7a[_0x7a88('0x37')];if(_0x3d8a05[_0x7a88('0x39')][_0x7a88('0x49')]){_0xe305a5[_0x7a88('0x4d')]=[{'all':!![]}];}_0xe305a5=_['merge']({},_0xe305a5,_0x3d8a05['options']);return db['Plugin']['find'](_0xe305a5)[_0x7a88('0x2b')](handleEntityNotFound(_0x165a4a,null))[_0x7a88('0x2b')](respondWithResult(_0x165a4a,null))[_0x7a88('0x4e')](handleError(_0x165a4a,null));};exports[_0x7a88('0x4f')]=function(_0x86b41b,_0x4266f6,_0x20045c){return db['Plugin'][_0x7a88('0x50')]({'where':{'id':_0x86b41b[_0x7a88('0x4c')]['id']},'attributes':[_0x7a88('0x30'),_0x7a88('0x5')],'raw':!![]})[_0x7a88('0x2b')](handleEntityNotFound(_0x4266f6,null))['then'](function(_0x35afa5){if(_0x35afa5){var _0x3c7513=path[_0x7a88('0x51')](config[_0x7a88('0x52')],_0x7a88('0x53'),util[_0x7a88('0x54')](_0x7a88('0x55'),path[_0x7a88('0x56')](_0x35afa5[_0x7a88('0x5')])));var _0x23cce0=fs[_0x7a88('0x57')](_0x3c7513);var _0x56afc2=archiver('zip',{'zlib':{'level':0x9}});_0x56afc2['on'](_0x7a88('0x58'),function(_0x14bf47){if(_0x14bf47[_0x7a88('0x59')]==='ENOENT'){logger['error'](_0x14bf47);}else{throw new db[(_0x7a88('0x5a'))][(_0x7a88('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x56afc2['on']('error',function(_0x3b7d23){throw new db[(_0x7a88('0x5a'))][(_0x7a88('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x56afc2[_0x7a88('0x5c')](_0x23cce0);_0x56afc2['glob']('**/*',{'cwd':path['join'](config['root'],_0x7a88('0x53'),path['dirname'](_0x35afa5[_0x7a88('0x5')])),'ignore':[path['join'](path['basename'](_0x35afa5[_0x7a88('0x5')]),_0x7a88('0x5d')),path[_0x7a88('0x51')](path[_0x7a88('0x56')](_0x35afa5[_0x7a88('0x5')]),_0x7a88('0x5e'))],'nodir':!![]})[_0x7a88('0x5f')]();_0x23cce0['on']('close',function(){if(!fs[_0x7a88('0x60')](_0x3c7513)){throw new db[(_0x7a88('0x5a'))][(_0x7a88('0x5b'))]('Plugin\x20not\x20found');}return _0x4266f6[_0x7a88('0x4f')](_0x3c7513,util['format'](_0x7a88('0x55'),path[_0x7a88('0x56')](_0x35afa5[_0x7a88('0x5')])),function(_0x1ccff6){if(_0x1ccff6){throw new db[(_0x7a88('0x5a'))][(_0x7a88('0x5b'))](_0x7a88('0x61'));}fs['unlinkSync'](_0x3c7513);logger[_0x7a88('0x62')](_0x7a88('0x63'));logger[_0x7a88('0x62')](_0x7a88('0x64'));});});}return null;})[_0x7a88('0x4e')](handleError(_0x4266f6,null));};exports['upload']=function(_0x3522b6,_0x39afef,_0x45bf7f){var _0x31ff56=path['basename'](_0x3522b6[_0x7a88('0x65')][_0x7a88('0x66')],path[_0x7a88('0x67')](_0x3522b6[_0x7a88('0x65')][_0x7a88('0x66')]));var _0x486678=path['join'](config[_0x7a88('0x52')],_0x7a88('0x53'),_0x3522b6[_0x7a88('0x65')][_0x7a88('0x66')]);var _0x2b302b=path[_0x7a88('0x51')](config[_0x7a88('0x52')],_0x7a88('0x53'),_0x31ff56);logger[_0x7a88('0x62')]('Plugin\x20upload\x20filepath:\x20%s',_0x486678);logger['info'](_0x7a88('0x68'),_0x2b302b);try{fs['chmodSync'](_0x486678,parseInt(_0x7a88('0x69'),0x8));extract(_0x486678,{'dir':_0x2b302b},function(_0x497d30){if(_0x497d30){logger[_0x7a88('0x2f')](_0x497d30);handleError(_0x497d30,!![]);};var _0x27a5bd=fs[_0x7a88('0x6a')](_0x2b302b);if(_0x27a5bd[_0x7a88('0x3e')]>0x1){removeReferences(_0x486678,_0x2b302b);logger['error'](_0x7a88('0x6b'));return _0x45bf7f(new Error(_0x7a88('0x6b')));}var _0xeb17c8=fs[_0x7a88('0x6c')](path[_0x7a88('0x51')](_0x2b302b,_0x27a5bd[0x0]));if(_0xeb17c8[_0x7a88('0x6d')]()){removeReferences(_0x486678,_0x2b302b);logger['error'](_0x7a88('0x6b'));return _0x45bf7f(new Error(_0x7a88('0x6b')));}if(_0xeb17c8[_0x7a88('0x6e')]()){var _0x51d42f=fs[_0x7a88('0x6a')](path[_0x7a88('0x51')](_0x2b302b,_0x27a5bd[0x0]));if(_0x51d42f[_0x7a88('0x3e')]===0x0){removeReferences(_0x486678,_0x2b302b);logger[_0x7a88('0x2f')](_0x7a88('0x6b'));return _0x45bf7f(new Error(_0x7a88('0x6b')));}var _0x502403=_0x51d42f['some'](function(_0x36f183){return _0x36f183==='manifest.json';});if(!_0x502403){return _0x45bf7f(new Error(_0x7a88('0x6f')));}var _0x5af41b=fs[_0x7a88('0x70')](path[_0x7a88('0x51')](_0x2b302b,_0x27a5bd[0x0],_0x7a88('0x71')));var _0x338055=JSON['parse'](_0x5af41b);if(_0x7a88('0x22')==typeof _0x338055[_0x7a88('0x30')]){return _0x45bf7f(new Error(_0x7a88('0x72')));}if(_0x7a88('0x22')==typeof _0x338055[_0x7a88('0x46')]){return _0x45bf7f(new Error(_0x7a88('0x73')));}if('undefined'==typeof _0x338055[_0x7a88('0x74')]){return _0x45bf7f(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x7a88('0x22')==typeof _0x338055[_0x7a88('0x75')]){return _0x45bf7f(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x338055[_0x7a88('0x46')]===_0x7a88('0x76')){if('undefined'==typeof _0x338055[_0x7a88('0x75')][_0x7a88('0x77')]){return _0x45bf7f(new Error(_0x7a88('0x78')));}if(_0x7a88('0x22')==typeof _0x338055[_0x7a88('0x75')][_0x7a88('0x77')]['admin']&&_0x7a88('0x22')==typeof _0x338055[_0x7a88('0x75')][_0x7a88('0x77')][_0x7a88('0x79')]){return _0x45bf7f(new Error(_0x7a88('0x7a')));}}else if(_0x338055[_0x7a88('0x46')]===_0x7a88('0x7b')){if(_0x7a88('0x22')==typeof _0x338055[_0x7a88('0x75')][_0x7a88('0x7c')]){return _0x45bf7f(new Error(_0x7a88('0x7d')));}if(_0x7a88('0x22')==typeof _0x338055[_0x7a88('0x75')][_0x7a88('0x7e')]){return _0x45bf7f(new Error(_0x7a88('0x7f')));}}else{return _0x45bf7f(new Error(_0x7a88('0x80')));}var _0x5b6a6b=_0x338055[_0x7a88('0x30')];var _0x5c4cd6=_0x338055[_0x7a88('0x81')];var _0x428cbc=_0x338055[_0x7a88('0x46')];var _0x2cd55f=_0x338055[_0x7a88('0x82')]?_0x338055['sidebar']:_0x7a88('0x83');var _0x100952=_0x338055[_0x7a88('0x84')]?_0x338055[_0x7a88('0x84')]:_0x7a88('0x85');var _0x795dbf='';var _0x581eba='';var _0x4ef4ba='';var _0x3bffd4='';var _0x242f8f=_0x338055['version'];if(_0x428cbc===_0x7a88('0x76')){if(_0x7a88('0x22')!=typeof _0x338055[_0x7a88('0x75')][_0x7a88('0x77')]['admin']){var _0x621cc0=_0x338055[_0x7a88('0x75')]['views'][_0x7a88('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x7a88('0x87')](_0x621cc0)){_0x795dbf=path[_0x7a88('0x51')](_0x7a88('0x88'),_0x31ff56,_0x27a5bd[0x0],_0x621cc0);}else{_0x795dbf=_0x621cc0;}}else{logger[_0x7a88('0x62')](_0x7a88('0x89'));}if(_0x7a88('0x22')!=typeof _0x338055['parameters'][_0x7a88('0x77')][_0x7a88('0x79')]){var _0x3fe90d=_0x338055[_0x7a88('0x75')][_0x7a88('0x77')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x7a88('0x87')](_0x3fe90d)){_0x581eba=path[_0x7a88('0x51')](_0x7a88('0x88'),_0x31ff56,_0x27a5bd[0x0],_0x3fe90d);}else{_0x581eba=_0x3fe90d;}}else{logger['info'](_0x7a88('0x8a'));}}else if(_0x428cbc===_0x7a88('0x7b')){_0x4ef4ba=_0x338055['parameters'][_0x7a88('0x7c')];_0x3bffd4=_0x338055[_0x7a88('0x75')][_0x7a88('0x7e')];if(_0x7a88('0x22')!=typeof _0x338055[_0x7a88('0x75')]['views']){if('undefined'!=typeof _0x338055[_0x7a88('0x75')]['views'][_0x7a88('0x86')]){var _0x621cc0=_0x338055[_0x7a88('0x75')][_0x7a88('0x77')][_0x7a88('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x7a88('0x87')](_0x621cc0)){_0x795dbf=path[_0x7a88('0x51')](_0x7a88('0x88'),_0x31ff56,_0x27a5bd[0x0],_0x621cc0);}else{_0x795dbf=_0x621cc0;}}if(_0x7a88('0x22')!=typeof _0x338055[_0x7a88('0x75')]['views'][_0x7a88('0x79')]){var _0x3fe90d=_0x338055[_0x7a88('0x75')][_0x7a88('0x77')][_0x7a88('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x7a88('0x87')](_0x3fe90d)){_0x581eba=path[_0x7a88('0x51')](_0x7a88('0x88'),_0x31ff56,_0x27a5bd[0x0],_0x3fe90d);}else{_0x581eba=_0x3fe90d;}}}}var _0x57b3cc={'name':_0x5b6a6b,'description':_0x5c4cd6,'path':path[_0x7a88('0x51')](_0x31ff56,_0x27a5bd[0x0]),'type':_0x428cbc,'sidebar':_0x2cd55f,'icon':_0x100952,'adminUrl':_0x795dbf,'agentUrl':_0x581eba,'scriptName':_0x4ef4ba,'scriptPath':_0x3bffd4,'version':_0x242f8f};removeReferences(_0x486678,null);return db[_0x7a88('0x48')][_0x7a88('0x8b')](_0x57b3cc)['then'](function(_0x435fde){var _0x17ba54={'role':_0x3522b6[_0x7a88('0x8c')][_0x7a88('0x8d')],'userProfileId':_0x3522b6[_0x7a88('0x8c')][_0x7a88('0x8e')]};if(!_0x17ba54)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17ba54[_0x7a88('0x8d')]===_0x7a88('0x8f')){var _0x116474=_0x435fde['get']({'plain':!![]});return db[_0x7a88('0x90')][_0x7a88('0x50')]({'where':{'name':_0x7a88('0x91'),'userProfileId':_0x17ba54[_0x7a88('0x8e')]},'raw':!![]})[_0x7a88('0x2b')](function(_0x4ac87d){if(_0x4ac87d&&_0x4ac87d[_0x7a88('0x92')]===0x0){return db[_0x7a88('0x2e')][_0x7a88('0x8b')]({'name':_0x116474[_0x7a88('0x30')],'resourceId':_0x116474['id'],'type':_0x4ac87d[_0x7a88('0x30')],'sectionId':_0x4ac87d['id']},{})[_0x7a88('0x2b')](function(){return _0x435fde;});}else{return _0x435fde;}})[_0x7a88('0x4e')](function(_0x2b7c3b){logger[_0x7a88('0x2f')](_0x7a88('0x93'),_0x2b7c3b);throw _0x2b7c3b;});}return _0x435fde;})[_0x7a88('0x2b')](respondWithResult(_0x39afef,null))['catch'](handleError(_0x39afef,null));}});}catch(_0x3e1ecc){_0x39afef[_0x7a88('0x1f')](0x1f4)[_0x7a88('0x31')](_0x3e1ecc);}};function removeReferences(_0xabe02f,_0xd9829e){try{if(_0xabe02f){fs['unlinkSync'](_0xabe02f);logger['info']('Zip\x20archive\x20removed');}if(_0xd9829e){rimraf(_0xd9829e,function(){});logger[_0x7a88('0x62')](_0x7a88('0x94'));}}catch(_0x4ad81e){logger[_0x7a88('0x2f')](_0x4ad81e);}}exports[_0x7a88('0x2a')]=function(_0x55f289,_0x3413e2,_0x496865){return db['Plugin'][_0x7a88('0x50')]({'where':{'id':_0x55f289[_0x7a88('0x4c')]['id']}})[_0x7a88('0x2b')](handleEntityNotFound(_0x3413e2,null))[_0x7a88('0x2b')](saveUpdates(_0x55f289['body'],null))['then'](respondWithResult(_0x3413e2,null))[_0x7a88('0x4e')](handleError(_0x3413e2,null));};exports['delete']=function(_0x5876cb,_0x419475,_0x29800e){return db[_0x7a88('0x48')][_0x7a88('0x50')]({'where':{'id':_0x5876cb[_0x7a88('0x4c')]['id']}})['then'](function(_0x251b40){if(_0x251b40){return _0x251b40[_0x7a88('0x2c')]();}})[_0x7a88('0x2b')](function(_0x56b86d){rimraf(path['join'](config[_0x7a88('0x52')],_0x7a88('0x53'),path[_0x7a88('0x95')](_0x56b86d[_0x7a88('0x5')])),function(){});return _0x56b86d;})['then'](handleEntityNotFound(_0x419475,null))[_0x7a88('0x2b')](respondWithStatusCode(_0x419475,null))[_0x7a88('0x4e')](handleError(_0x419475,null));};exports[_0x7a88('0x96')]=function(_0x17f6c0,_0x2797b1,_0x12b04a){return BPromise['resolve']()[_0x7a88('0x2b')](function(){if(!_0x17f6c0[_0x7a88('0x39')][_0x7a88('0x5')]){throw new Error(_0x7a88('0x97'));}if(!_0x17f6c0[_0x7a88('0x39')]['port']){throw new Error(_0x7a88('0x98'));}var _0x2a8ec0=_0x17f6c0[_0x7a88('0x39')][_0x7a88('0x99')]?_0x17f6c0[_0x7a88('0x39')][_0x7a88('0x99')]+':'+_0x17f6c0['query']['port']:'http://localhost:'+_0x17f6c0['query']['port'];var _0x9bdbe1=_0x17f6c0[_0x7a88('0x39')][_0x7a88('0x21')]?_0x17f6c0[_0x7a88('0x39')][_0x7a88('0x21')]:!![];var _0x353f93=_0x17f6c0['query'][_0x7a88('0x9a')]?_0x17f6c0['query'][_0x7a88('0x9a')]:null;var _0x6c8b5a={'method':_0x17f6c0[_0x7a88('0x9b')],'uri':util['format'](_0x7a88('0x9c'),_0x2a8ec0,_0x17f6c0[_0x7a88('0x39')][_0x7a88('0x5')]),'json':_0x9bdbe1,'resolveWithFullResponse':!![],'encoding':_0x353f93,'qs':_0x17f6c0[_0x7a88('0x39')]};if(_0x17f6c0['headers']){_0x6c8b5a[_0x7a88('0x9d')]=_0x17f6c0[_0x7a88('0x9d')];if(_0x6c8b5a[_0x7a88('0x9d')][_0x7a88('0x9e')]){delete _0x6c8b5a[_0x7a88('0x9d')][_0x7a88('0x9e')];}}if(_0x6c8b5a[_0x7a88('0x9d')][_0x7a88('0x9f')]){delete _0x6c8b5a[_0x7a88('0x9d')]['content-type'];}return rp(_0x6c8b5a);})[_0x7a88('0x2b')](function(_0x543a8f){if(_0x543a8f){_0x2797b1['set'](_0x543a8f[_0x7a88('0x9d')]);logger['info'](_0x543a8f[_0x7a88('0x8c')]);if(_[_0x7a88('0xa0')](_0x17f6c0['query']['path'],_0x7a88('0x4f'))&&_0x543a8f['statusCode']==0x1f4){return _0x2797b1[_0x7a88('0x1e')](_0x543a8f[_0x7a88('0xa1')]);}else{return _0x2797b1[_0x7a88('0x1f')](_0x543a8f[_0x7a88('0xa1')])[_0x7a88('0x31')](_0x543a8f[_0x7a88('0x8c')]);}}else{return _0x2797b1[_0x7a88('0x1e')](0xc8);}})[_0x7a88('0x4e')](handleError(_0x2797b1,null));};exports[_0x7a88('0xa2')]=function(_0x20d8a3,_0x568cb6,_0x4d281d){return BPromise['resolve']()['then'](function(){if(!_0x20d8a3['query'][_0x7a88('0x5')]){throw new Error(_0x7a88('0x97'));}if(!_0x20d8a3[_0x7a88('0x39')][_0x7a88('0xa3')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x503d83=_0x20d8a3[_0x7a88('0x39')][_0x7a88('0x99')]?_0x20d8a3[_0x7a88('0x39')]['hostname']+':'+_0x20d8a3['query']['port']:_0x7a88('0xa4')+_0x20d8a3[_0x7a88('0x39')]['port'];var _0x5c3ed1=_0x20d8a3['query'][_0x7a88('0x21')]?_0x20d8a3['query'][_0x7a88('0x21')]:!![];var _0x1e5f7a=_0x20d8a3[_0x7a88('0x39')][_0x7a88('0x9a')]?_0x20d8a3[_0x7a88('0x39')][_0x7a88('0x9a')]:null;var _0x19cd4d={'method':_0x20d8a3[_0x7a88('0x9b')],'uri':util[_0x7a88('0x54')](_0x7a88('0x9c'),_0x503d83,_0x20d8a3[_0x7a88('0x39')][_0x7a88('0x5')]),'json':_0x5c3ed1,'resolveWithFullResponse':!![],'encoding':_0x1e5f7a,'body':_0x20d8a3[_0x7a88('0x8c')]};if(_0x20d8a3[_0x7a88('0x9d')]){_0x19cd4d[_0x7a88('0x9d')]=_0x20d8a3[_0x7a88('0x9d')];if(_0x19cd4d[_0x7a88('0x9d')][_0x7a88('0x9e')]){delete _0x19cd4d['headers']['content-length'];}}if(_0x19cd4d['headers'][_0x7a88('0x9f')]){delete _0x19cd4d['headers'][_0x7a88('0x9f')];}return rp(_0x19cd4d);})['then'](function(_0x9f8627){if(_0x9f8627){_0x568cb6[_0x7a88('0x26')](_0x9f8627[_0x7a88('0x9d')]);logger[_0x7a88('0x62')](_0x9f8627[_0x7a88('0x8c')]);return _0x568cb6['status'](_0x9f8627[_0x7a88('0xa1')])[_0x7a88('0x31')](_0x9f8627[_0x7a88('0x8c')]);}else{return _0x568cb6[_0x7a88('0x1e')](0xc8);}})[_0x7a88('0x4e')](handleError(_0x568cb6,null));};
\ No newline at end of file
index e65bf8d..121e8b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe714=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','update','emit'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xe714,0xe2));var _0x4e71=function(_0x1c50fd,_0x5c417f){_0x1c50fd=_0x1c50fd-0x0;var _0x260e52=_0xe714[_0x1c50fd];return _0x260e52;};'use strict';var EventEmitter=require(_0x4e71('0x0'));var Plugin=require('../../mysqldb')['db'][_0x4e71('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x4e71('0x2')](0x0);var events={'afterCreate':_0x4e71('0x3'),'afterUpdate':_0x4e71('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2ae210){return function(_0x59a685,_0xad5224,_0x19e056){PluginEvents[_0x4e71('0x5')](_0x2ae210+':'+_0x59a685['id'],_0x59a685);PluginEvents[_0x4e71('0x5')](_0x2ae210,_0x59a685);_0x19e056(null);};}for(var e in events){if(events[_0x4e71('0x6')](e)){var event=events[e];Plugin[_0x4e71('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0x9300=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x9300,0x153));var _0x0930=function(_0xfa2e1e,_0x4002ed){_0xfa2e1e=_0xfa2e1e-0x0;var _0x2f1d12=_0x9300[_0xfa2e1e];return _0x2f1d12;};'use strict';var EventEmitter=require(_0x0930('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x0930('0x1')](0x0);var events={'afterCreate':_0x0930('0x2'),'afterUpdate':_0x0930('0x3'),'afterDestroy':_0x0930('0x4')};function emitEvent(_0x4130f8){return function(_0x49d993,_0x298c01,_0x1a61a6){PluginEvents['emit'](_0x4130f8+':'+_0x49d993['id'],_0x49d993);PluginEvents[_0x0930('0x5')](_0x4130f8,_0x49d993);_0x1a61a6(null);};}for(var e in events){if(events[_0x0930('0x6')](e)){var event=events[e];Plugin[_0x0930('0x7')](e,emitEvent(event));}}module[_0x0930('0x8')]=PluginEvents;
\ No newline at end of file
index 4afd583..c6f0fe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f8=['./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x650e11,_0x284f86){var _0x1a9b47=function(_0x6e15e3){while(--_0x6e15e3){_0x650e11['push'](_0x650e11['shift']());}};_0x1a9b47(++_0x284f86);}(_0x68f8,0x10c));var _0x868f=function(_0x426c96,_0x1dbc33){_0x426c96=_0x426c96-0x0;var _0x162202=_0x68f8[_0x426c96];return _0x162202;};'use strict';var _=require(_0x868f('0x0'));var util=require(_0x868f('0x1'));var logger=require(_0x868f('0x2'))(_0x868f('0x3'));var moment=require(_0x868f('0x4'));var BPromise=require(_0x868f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x868f('0x6'));var rimraf=require('rimraf');var config=require(_0x868f('0x7'));var attributes=require(_0x868f('0x8'));module[_0x868f('0x9')]=function(_0x37d706,_0x3f7e54){return _0x37d706['define'](_0x868f('0xa'),attributes,{'tableName':_0x868f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b27=['moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','define','Plugin','lodash','../../config/logger','api'];(function(_0xf858e,_0x51b0f1){var _0x5344d8=function(_0x5219d6){while(--_0x5219d6){_0xf858e['push'](_0xf858e['shift']());}};_0x5344d8(++_0x51b0f1);}(_0x6b27,0xc3));var _0x76b2=function(_0x9438cf,_0x19c958){_0x9438cf=_0x9438cf-0x0;var _0x3d8373=_0x6b27[_0x9438cf];return _0x3d8373;};'use strict';var _=require(_0x76b2('0x0'));var util=require('util');var logger=require(_0x76b2('0x1'))(_0x76b2('0x2'));var moment=require(_0x76b2('0x3'));var BPromise=require(_0x76b2('0x4'));var rp=require(_0x76b2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76b2('0x6'));var config=require(_0x76b2('0x7'));var attributes=require(_0x76b2('0x8'));module['exports']=function(_0x4e50cc,_0x19443f){return _0x4e50cc[_0x76b2('0x9')](_0x76b2('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 23fcd4c..70991bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x776d=['info','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','create','options','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./plugin.socket'];(function(_0xbe2dc8,_0x436bb7){var _0x1932c6=function(_0x4ed9d0){while(--_0x4ed9d0){_0xbe2dc8['push'](_0xbe2dc8['shift']());}};_0x1932c6(++_0x436bb7);}(_0x776d,0x110));var _0xd776=function(_0x803e98,_0x2a6851){_0x803e98=_0x803e98-0x0;var _0xa80888=_0x776d[_0x803e98];return _0xa80888;};'use strict';var _=require(_0xd776('0x0'));var util=require(_0xd776('0x1'));var moment=require(_0xd776('0x2'));var BPromise=require(_0xd776('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd776('0x4'));var db=require(_0xd776('0x5'))['db'];var utils=require(_0xd776('0x6'));var logger=require(_0xd776('0x7'))(_0xd776('0x8'));var config=require(_0xd776('0x9'));var jayson=require(_0xd776('0xa'));var client=jayson[_0xd776('0xb')][_0xd776('0xc')]({'port':0x232a});config[_0xd776('0xd')]=_['defaults'](config[_0xd776('0xd')],{'host':_0xd776('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd776('0xd')]));require(_0xd776('0xf'))['register'](socket);function respondWithRpcPromise(_0x1883f8,_0x3a8421,_0x1c8065){return new BPromise(function(_0x3e89de,_0x5d9dd0){return client['request'](_0x1883f8,_0x1c8065)['then'](function(_0x38446e){logger[_0xd776('0x10')]('Plugin,\x20%s,\x20%s',_0x3a8421,'request\x20sent');logger[_0xd776('0x11')](_0xd776('0x12'),_0x3a8421,_0xd776('0x13'),JSON[_0xd776('0x14')](_0x38446e));if(_0x38446e[_0xd776('0x15')]){if(_0x38446e['error'][_0xd776('0x16')]===0x1f4){logger[_0xd776('0x15')](_0xd776('0x17'),_0x3a8421,_0x38446e[_0xd776('0x15')][_0xd776('0x18')]);return _0x5d9dd0(_0x38446e[_0xd776('0x15')]['message']);}logger[_0xd776('0x15')]('Plugin,\x20%s,\x20%s',_0x3a8421,_0x38446e[_0xd776('0x15')][_0xd776('0x18')]);return _0x3e89de(_0x38446e[_0xd776('0x15')][_0xd776('0x18')]);}else{logger[_0xd776('0x10')](_0xd776('0x17'),_0x3a8421,'request\x20sent');_0x3e89de(_0x38446e[_0xd776('0x19')]['message']);}})[_0xd776('0x1a')](function(_0x8b264d){logger[_0xd776('0x15')](_0xd776('0x17'),_0x3a8421,_0x8b264d);_0x5d9dd0(_0x8b264d);});});}exports[_0xd776('0x1b')]=function(_0xf5cc0f){var _0x5d5ba3=this;return new Promise(function(_0x1f6360,_0x5dafd7){return db['Plugin'][_0xd776('0x1c')](_0xf5cc0f['body'],{'raw':_0xf5cc0f[_0xd776('0x1d')]?_0xf5cc0f[_0xd776('0x1d')][_0xd776('0x1e')]===undefined?!![]:![]:!![]})[_0xd776('0x1f')](function(_0x525d86){logger[_0xd776('0x10')](_0xd776('0x1b'),_0xf5cc0f);logger['debug'](_0xd776('0x1b'),_0xf5cc0f,JSON[_0xd776('0x14')](_0x525d86));_0x1f6360(_0x525d86);})[_0xd776('0x1a')](function(_0x355503){logger[_0xd776('0x15')](_0xd776('0x1b'),_0x355503['message'],_0xf5cc0f);_0x5dafd7(_0x5d5ba3['error'](0x1f4,_0x355503[_0xd776('0x18')]));});});};
\ No newline at end of file
+var _0x817f=['message','catch','CreatePlugin','Plugin','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0x817f,0x147));var _0xf817=function(_0x18ea8a,_0x32f09f){_0x18ea8a=_0x18ea8a-0x0;var _0x19c99a=_0x817f[_0x18ea8a];return _0x19c99a;};'use strict';var _=require(_0xf817('0x0'));var util=require(_0xf817('0x1'));var moment=require(_0xf817('0x2'));var BPromise=require(_0xf817('0x3'));var rs=require(_0xf817('0x4'));var fs=require('fs');var Redis=require(_0xf817('0x5'));var db=require(_0xf817('0x6'))['db'];var utils=require(_0xf817('0x7'));var logger=require(_0xf817('0x8'))(_0xf817('0x9'));var config=require(_0xf817('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf817('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xf817('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf817('0xc')]));require(_0xf817('0xd'))[_0xf817('0xe')](socket);function respondWithRpcPromise(_0xdc1d1b,_0x2b4369,_0xc7eb67){return new BPromise(function(_0x33ca1f,_0x173fa8){return client[_0xf817('0xf')](_0xdc1d1b,_0xc7eb67)[_0xf817('0x10')](function(_0xbd48a4){logger[_0xf817('0x11')](_0xf817('0x12'),_0x2b4369,_0xf817('0x13'));logger[_0xf817('0x14')](_0xf817('0x15'),_0x2b4369,_0xf817('0x13'),JSON[_0xf817('0x16')](_0xbd48a4));if(_0xbd48a4[_0xf817('0x17')]){if(_0xbd48a4[_0xf817('0x17')][_0xf817('0x18')]===0x1f4){logger[_0xf817('0x17')](_0xf817('0x12'),_0x2b4369,_0xbd48a4[_0xf817('0x17')][_0xf817('0x19')]);return _0x173fa8(_0xbd48a4[_0xf817('0x17')]['message']);}logger[_0xf817('0x17')](_0xf817('0x12'),_0x2b4369,_0xbd48a4['error'][_0xf817('0x19')]);return _0x33ca1f(_0xbd48a4[_0xf817('0x17')][_0xf817('0x19')]);}else{logger[_0xf817('0x11')](_0xf817('0x12'),_0x2b4369,'request\x20sent');_0x33ca1f(_0xbd48a4['result'][_0xf817('0x19')]);}})[_0xf817('0x1a')](function(_0x3046aa){logger[_0xf817('0x17')](_0xf817('0x12'),_0x2b4369,_0x3046aa);_0x173fa8(_0x3046aa);});});}exports[_0xf817('0x1b')]=function(_0x5e89b8){var _0xee1152=this;return new Promise(function(_0xcf60cd,_0xd6e03f){return db[_0xf817('0x1c')][_0xf817('0x1d')](_0x5e89b8[_0xf817('0x1e')],{'raw':_0x5e89b8[_0xf817('0x1f')]?_0x5e89b8[_0xf817('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xf817('0x10')](function(_0x2ab285){logger[_0xf817('0x11')](_0xf817('0x1b'),_0x5e89b8);logger[_0xf817('0x14')](_0xf817('0x1b'),_0x5e89b8,JSON[_0xf817('0x16')](_0x2ab285));_0xcf60cd(_0x2ab285);})[_0xf817('0x1a')](function(_0x330575){logger['error'](_0xf817('0x1b'),_0x330575[_0xf817('0x19')],_0x5e89b8);_0xd6e03f(_0xee1152[_0xf817('0x17')](0x1f4,_0x330575['message']));});});};
\ No newline at end of file
index 3411a1f..62c3bc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x195c=['update','emit','register','length','plugin:','./plugin.events','save','remove'];(function(_0x400b69,_0x4a003e){var _0x4d9643=function(_0x2b7ae9){while(--_0x2b7ae9){_0x400b69['push'](_0x400b69['shift']());}};_0x4d9643(++_0x4a003e);}(_0x195c,0x1d5));var _0xc195=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x195c[_0xd39959];return _0x1ff69c;};'use strict';var PluginEvents=require(_0xc195('0x0'));var events=[_0xc195('0x1'),_0xc195('0x2'),_0xc195('0x3')];function createListener(_0x12b7a0,_0x399f61){return function(_0x4f8172){_0x399f61[_0xc195('0x4')](_0x12b7a0,_0x4f8172);};}function removeListener(_0x1198a3,_0x366508){return function(){PluginEvents['removeListener'](_0x1198a3,_0x366508);};}exports[_0xc195('0x5')]=function(_0x55e6ff){for(var _0x2c9797=0x0,_0xbe2ebb=events[_0xc195('0x6')];_0x2c9797<_0xbe2ebb;_0x2c9797++){var _0x2c7549=events[_0x2c9797];var _0x2c71b0=createListener(_0xc195('0x7')+_0x2c7549,_0x55e6ff);PluginEvents['on'](_0x2c7549,_0x2c71b0);}};
\ No newline at end of file
+var _0xcf20=['register','length','plugin:','save','remove','removeListener'];(function(_0x4fd600,_0x1fdf8a){var _0x2e87e9=function(_0x419920){while(--_0x419920){_0x4fd600['push'](_0x4fd600['shift']());}};_0x2e87e9(++_0x1fdf8a);}(_0xcf20,0x111));var _0x0cf2=function(_0x5335d7,_0x2458f3){_0x5335d7=_0x5335d7-0x0;var _0x527bbb=_0xcf20[_0x5335d7];return _0x527bbb;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x0cf2('0x0'),_0x0cf2('0x1'),'update'];function createListener(_0xa4c46e,_0x58ee8e){return function(_0x2e0b60){_0x58ee8e['emit'](_0xa4c46e,_0x2e0b60);};}function removeListener(_0x723eb4,_0x2ff7f8){return function(){PluginEvents[_0x0cf2('0x2')](_0x723eb4,_0x2ff7f8);};}exports[_0x0cf2('0x3')]=function(_0x4dcef9){for(var _0x3da504=0x0,_0xfde973=events[_0x0cf2('0x4')];_0x3da504<_0xfde973;_0x3da504++){var _0x13a26d=events[_0x3da504];var _0x3559f2=createListener(_0x0cf2('0x5')+_0x13a26d,_0x4dcef9);PluginEvents['on'](_0x13a26d,_0x3559f2);}};
\ No newline at end of file
index 6f8bb67..6e3122a 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(_0x3a5ba5,_0x46f84a){var _0x58f177=function(_0x195243){while(--_0x195243){_0x3a5ba5['push'](_0x3a5ba5['shift']());}};_0x58f177(++_0x46f84a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x232235,_0x11d693){var _0x393cd9=function(_0x22194f){while(--_0x22194f){_0x232235['push'](_0x232235['shift']());}};_0x393cd9(++_0x11d693);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 82dd103..0b891c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b02=['../../files/plugins','cwd','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','catch','show','describe','params','create','body','script','join'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x5b02,0xe9));var _0x25b0=function(_0x4c99e4,_0x22cb1b){_0x4c99e4=_0x4c99e4-0x0;var _0x9522cb=_0x5b02[_0x4c99e4];return _0x9522cb;};'use strict';var _=require(_0x25b0('0x0'));var pm2=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var path=require('path');var exec=require('child_process')[_0x25b0('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3e1d20,_0x31c9c2){return function(_0x38dc14){if(!_0x38dc14){_0x3e1d20[_0x25b0('0x5')](0x194);;}return _0x38dc14;};}function respondWithResult(_0x2d84a9,_0x4eea55){_0x4eea55=_0x4eea55||0xc8;return function(_0x1d82c6){if(_0x1d82c6){return _0x2d84a9[_0x25b0('0x6')](_0x4eea55)['json'](_0x1d82c6);}return null;};}function handleError(_0x412954,_0x4d3e71){_0x4d3e71=_0x4d3e71||0x1f4;return function(_0x56feca){logger[_0x25b0('0x7')](_0x56feca[_0x25b0('0x8')]);if(_0x56feca[_0x25b0('0x9')]){delete _0x56feca['name'];}_0x412954[_0x25b0('0x6')](_0x4d3e71)[_0x25b0('0xa')](_0x56feca);};}function execChildProcess(){return new BPromise(function(_0x135afb,_0x250d31){exec(_0x25b0('0xb'),function(_0x2f57af,_0x44afbc,_0x10c3fb){logger[_0x25b0('0xc')](_0x44afbc);logger[_0x25b0('0xc')](_0x10c3fb);if(_0x2f57af){logger[_0x25b0('0x7')](_0x2f57af);return _0x250d31(_0x2f57af);}return _0x135afb(_0x44afbc);});});}exports[_0x25b0('0xd')]=function(_0x2048dc,_0x3655c2){return pm2[_0x25b0('0xe')]()[_0x25b0('0xf')](function(_0x293203){if(_0x293203){var _0x211658=_[_0x25b0('0x10')](_0x293203,function(_0x3b89e7){return _0x3b89e7[_0x25b0('0x9')]==='express'||_0x3b89e7['name']===_0x25b0('0x11');});return{'rows':_0x211658,'count':_0x211658['length']};}return null;})[_0x25b0('0xf')](respondWithResult(_0x3655c2,null))[_0x25b0('0x12')](handleError(_0x3655c2,null));};exports[_0x25b0('0x13')]=function(_0x3267b9,_0x5e3a3a){return pm2[_0x25b0('0x14')](_0x3267b9[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x5e3a3a,null))[_0x25b0('0xf')](handleEntityNotFound(_0x5e3a3a,null))[_0x25b0('0x12')](handleError(_0x5e3a3a,null));};exports[_0x25b0('0x16')]=function(_0x54f458,_0x348d36){if(_0x54f458[_0x25b0('0x17')][_0x25b0('0x9')]&&_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]){var _0xea4162=path[_0x25b0('0x19')](__dirname,_0x25b0('0x1a'),_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]);var _0x2b2eda=process[_0x25b0('0x1b')]();process['chdir'](path[_0x25b0('0x1c')](_0xea4162));return execChildProcess()[_0x25b0('0xf')](function(_0x517ec5){process[_0x25b0('0x1d')](_0x2b2eda);return pm2[_0x25b0('0x1e')]({'name':_0x54f458[_0x25b0('0x17')]['name'],'script':_0xea4162});})['then'](function(_0x50089e){pm2[_0x25b0('0x1f')]();return _0x50089e[0x0];})[_0x25b0('0xf')](respondWithResult(_0x348d36,0xc9))[_0x25b0('0x12')](handleError(_0x348d36,null));}else{return _0x348d36[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x20')});}};exports[_0x25b0('0x21')]=function(_0x75ce7a,_0x22e024){if(_0x75ce7a['body']['id']){delete _0x75ce7a[_0x25b0('0x17')]['id'];}var _0xbfba84={'online':'restart','stopped':'stop'};if(_0xbfba84['hasOwnProperty'](_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')])){return pm2[_0xbfba84[_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')]]](_0x75ce7a[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x22e024,0xc8))[_0x25b0('0x12')](handleError(_0x22e024,null));}else{return _0x22e024[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x22')});}};exports[_0x25b0('0x23')]=function(_0x3161c1,_0x1ea374){if(_0x3161c1['body']['id']){delete _0x3161c1['body']['id'];}if(_0x3161c1[_0x25b0('0x15')]['id']){return pm2['delete'](_0x3161c1['params']['id'])[_0x25b0('0xf')](function(_0x419975){pm2[_0x25b0('0x1f')]();return _0x419975[0x0];})[_0x25b0('0xf')](respondWithResult(_0x1ea374,null))[_0x25b0('0x12')](handleError(_0x1ea374,null));}else{return _0x1ea374['status'](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x24')});}};
\ No newline at end of file
+var _0x16d2=['cwd','chdir','start','dump','update','stop','send','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','express','motion2','length','then','catch','show','params','create','body','script','join'];(function(_0x627948,_0x37bad0){var _0x21d259=function(_0x936bac){while(--_0x936bac){_0x627948['push'](_0x627948['shift']());}};_0x21d259(++_0x37bad0);}(_0x16d2,0x123));var _0x216d=function(_0x2c1592,_0x32b4f4){_0x2c1592=_0x2c1592-0x0;var _0xe9702d=_0x16d2[_0x2c1592];return _0xe9702d;};'use strict';var _=require(_0x216d('0x0'));var pm2=require(_0x216d('0x1'));var logger=require(_0x216d('0x2'))(_0x216d('0x3'));var path=require(_0x216d('0x4'));var exec=require(_0x216d('0x5'))[_0x216d('0x6')];var BPromise=require(_0x216d('0x7'));function handleEntityNotFound(_0xfd7306,_0x593bb0){return function(_0x2c662d){if(!_0x2c662d){_0xfd7306[_0x216d('0x8')](0x194);;}return _0x2c662d;};}function respondWithResult(_0xef687c,_0x205101){_0x205101=_0x205101||0xc8;return function(_0x1dd8e2){if(_0x1dd8e2){return _0xef687c[_0x216d('0x9')](_0x205101)[_0x216d('0xa')](_0x1dd8e2);}return null;};}function handleError(_0x28da14,_0x57accc){_0x57accc=_0x57accc||0x1f4;return function(_0x22c7b3){logger[_0x216d('0xb')](_0x22c7b3[_0x216d('0xc')]);if(_0x22c7b3[_0x216d('0xd')]){delete _0x22c7b3[_0x216d('0xd')];}_0x28da14[_0x216d('0x9')](_0x57accc)['send'](_0x22c7b3);};}function execChildProcess(){return new BPromise(function(_0x7ca9c9,_0x50db30){exec(_0x216d('0xe'),function(_0x2e02ce,_0x332e30,_0x398970){logger[_0x216d('0xf')](_0x332e30);logger[_0x216d('0xf')](_0x398970);if(_0x2e02ce){logger['error'](_0x2e02ce);return _0x50db30(_0x2e02ce);}return _0x7ca9c9(_0x332e30);});});}exports[_0x216d('0x10')]=function(_0x4c07d0,_0x271bb1){return pm2[_0x216d('0x11')]()['then'](function(_0x165c19){if(_0x165c19){var _0x322e4b=_['reject'](_0x165c19,function(_0x1b3215){return _0x1b3215['name']===_0x216d('0x12')||_0x1b3215[_0x216d('0xd')]===_0x216d('0x13');});return{'rows':_0x322e4b,'count':_0x322e4b[_0x216d('0x14')]};}return null;})[_0x216d('0x15')](respondWithResult(_0x271bb1,null))[_0x216d('0x16')](handleError(_0x271bb1,null));};exports[_0x216d('0x17')]=function(_0x1496fe,_0x19fdac){return pm2['describe'](_0x1496fe[_0x216d('0x18')]['id'])['then'](respondWithResult(_0x19fdac,null))['then'](handleEntityNotFound(_0x19fdac,null))[_0x216d('0x16')](handleError(_0x19fdac,null));};exports[_0x216d('0x19')]=function(_0x574758,_0x3f32e0){if(_0x574758[_0x216d('0x1a')]['name']&&_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]){var _0x430e81=path[_0x216d('0x1c')](__dirname,'../../files/plugins',_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]);var _0x10f299=process[_0x216d('0x1d')]();process[_0x216d('0x1e')](path['dirname'](_0x430e81));return execChildProcess()[_0x216d('0x15')](function(_0x1bd4db){process[_0x216d('0x1e')](_0x10f299);return pm2[_0x216d('0x1f')]({'name':_0x574758[_0x216d('0x1a')]['name'],'script':_0x430e81});})[_0x216d('0x15')](function(_0xab672){pm2[_0x216d('0x20')]();return _0xab672[0x0];})['then'](respondWithResult(_0x3f32e0,0xc9))['catch'](handleError(_0x3f32e0,null));}else{return _0x3f32e0['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x216d('0x21')]=function(_0x470d8a,_0x189413){if(_0x470d8a[_0x216d('0x1a')]['id']){delete _0x470d8a[_0x216d('0x1a')]['id'];}var _0x47fa6d={'online':'restart','stopped':_0x216d('0x22')};if(_0x47fa6d['hasOwnProperty'](_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')])){return pm2[_0x47fa6d[_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')]]](_0x470d8a[_0x216d('0x18')]['id'])[_0x216d('0x15')](respondWithResult(_0x189413,0xc8))[_0x216d('0x16')](handleError(_0x189413,null));}else{return _0x189413[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x24')});}};exports[_0x216d('0x25')]=function(_0x260134,_0x4537fd){if(_0x260134['body']['id']){delete _0x260134[_0x216d('0x1a')]['id'];}if(_0x260134[_0x216d('0x18')]['id']){return pm2[_0x216d('0x26')](_0x260134['params']['id'])[_0x216d('0x15')](function(_0x1743ee){pm2[_0x216d('0x20')]();return _0x1743ee[0x0];})[_0x216d('0x15')](respondWithResult(_0x4537fd,null))['catch'](handleError(_0x4537fd,null));}else{return _0x4537fd[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x27')});}};
\ No newline at end of file
index 271ff13..558c505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf0c=['getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues'];(function(_0x3ee91d,_0x1867c7){var _0x281b02=function(_0x177180){while(--_0x177180){_0x3ee91d['push'](_0x3ee91d['shift']());}};_0x281b02(++_0x1867c7);}(_0xaf0c,0x1f1));var _0xcaf0=function(_0x5b26be,_0x24893b){_0x5b26be=_0x5b26be-0x0;var _0x4c02c9=_0xaf0c[_0x5b26be];return _0x4c02c9;};'use strict';var express=require(_0xcaf0('0x0'));var router=express[_0xcaf0('0x1')]();var auth=require(_0xcaf0('0x2'));var controller=require(_0xcaf0('0x3'));router[_0xcaf0('0x4')](_0xcaf0('0x5'),auth[_0xcaf0('0x6')](),controller[_0xcaf0('0x7')]);router['get'](_0xcaf0('0x8'),auth[_0xcaf0('0x6')](),controller[_0xcaf0('0x9')]);module[_0xcaf0('0xa')]=router;
\ No newline at end of file
+var _0xfda8=['../../components/auth/service','./realtime.controller','/agents','isAuthenticated','getAgents','get','getQueues','exports','express','Router'];(function(_0x2da515,_0x1724ae){var _0x4c9839=function(_0x7a17df){while(--_0x7a17df){_0x2da515['push'](_0x2da515['shift']());}};_0x4c9839(++_0x1724ae);}(_0xfda8,0x76));var _0x8fda=function(_0x1442aa,_0x43f8c4){_0x1442aa=_0x1442aa-0x0;var _0x4f2d0d=_0xfda8[_0x1442aa];return _0x4f2d0d;};'use strict';var express=require(_0x8fda('0x0'));var router=express[_0x8fda('0x1')]();var auth=require(_0x8fda('0x2'));var controller=require(_0x8fda('0x3'));router['get'](_0x8fda('0x4'),auth[_0x8fda('0x5')](),controller[_0x8fda('0x6')]);router[_0x8fda('0x7')]('/queues',auth[_0x8fda('0x5')](),controller[_0x8fda('0x8')]);module[_0x8fda('0x9')]=router;
\ No newline at end of file
index 833e277..0688c6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d9b=['getMembers','find','UserId','online','voiceStatus','loggedInDb','startCase','Queue','Pause','findAll','idle','unknown','ringing','isNil','chatPause','voicePause','every','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','pause','mail','chat','fax','Invalid\x20channel','toLowerCase','isArray','findOne','getAgents','all','flatten','uniq','includes','globalStatus','order','startsWith','DESC','ASC','pauseType','userpic','lastLoginAt','lastPauseAt','address','openchannelPause','smsPause','whatsappPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','mailPause','faxPause','resolve','query','channel','sort','fields','globalQueueFilter','User','fieldName','key','getOptions','raw','where','isEmpty','user','role','userProfileId','agent','nolimit','UserProfile','getResources','findAndCountAll','rows','pick','omit','globalStatusFilter','pauseTypeFilter','getQueues','type','QueueCampaigns','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','limit','undefined','count','status','set','Content-Range','json','error','stack','name','send','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','waiting','talking','paused','push','pTalking','originated','message','dialActive','dialMethod','Trunk','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','agents','available','busy','outbound','filter','length','some','connectedlinenum','internal'];(function(_0x203b8d,_0x4d0cab){var _0x219304=function(_0x1e1f4c){while(--_0x1e1f4c){_0x203b8d['push'](_0x203b8d['shift']());}};_0x219304(++_0x4d0cab);}(_0x1d9b,0x1b1));var _0xb1d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d9b[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xb1d9('0x0'));var _=require(_0xb1d9('0x1'));var jayson=require('jayson/promise');var qs=require(_0xb1d9('0x2'));var logger=require(_0xb1d9('0x3'))(_0xb1d9('0x4'));var db=require(_0xb1d9('0x5'))['db'];var amiClient=jayson[_0xb1d9('0x6')][_0xb1d9('0x7')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x222110,_0x29393d){return function(_0x598762){if(_0x598762){var _0x133be2=typeof _0x29393d[_0xb1d9('0x8')]==='undefined'&&typeof _0x29393d[_0xb1d9('0x9')]===_0xb1d9('0xa');var _0x8b1d89=_0x598762[_0xb1d9('0xb')];var _0x456822=_0x133be2?0x0:_0x29393d[_0xb1d9('0x8')];var _0x2fadf6=_0x133be2?_0x598762[_0xb1d9('0xb')]:_0x29393d[_0xb1d9('0x8')]+_0x29393d[_0xb1d9('0x9')];var _0x366f9b;if(_0x2fadf6>=_0x8b1d89){_0x2fadf6=_0x8b1d89;_0x366f9b=0xc8;}else{_0x366f9b=0xce;}_0x222110[_0xb1d9('0xc')](_0x366f9b);return _0x222110[_0xb1d9('0xd')](_0xb1d9('0xe'),_0x456822+'-'+_0x2fadf6+'/'+_0x8b1d89)[_0xb1d9('0xf')](_0x598762);}return null;};}function handleError(_0x54a05c,_0x11563f){_0x11563f=_0x11563f||0x1f4;return function(_0x550579){logger[_0xb1d9('0x10')](_0x550579[_0xb1d9('0x11')]);if(_0x550579[_0xb1d9('0x12')]){delete _0x550579[_0xb1d9('0x12')];}_0x54a05c[_0xb1d9('0xc')](_0x11563f)[_0xb1d9('0x13')](_0x550579);};}function getRealtimeAgents(){return new Promise(function(_0x284d2f,_0x4acdfb){return amiClient[_0xb1d9('0x14')]('Agents',{})[_0xb1d9('0x15')](function(_0x36c472){if(_0x36c472[_0xb1d9('0x10')])throw new Error(_0xb1d9('0x16'));var _0x3128d7=_0x36c472[_0xb1d9('0x17')];return routingClient[_0xb1d9('0x14')](_0xb1d9('0x18'),{})[_0xb1d9('0x15')](function(_0x1ae965){if(_0x1ae965[_0xb1d9('0x10')])throw new Error(_0xb1d9('0x19'));var _0x342a57=_0x1ae965[_0xb1d9('0x17')];return _0x284d2f(_[_0xb1d9('0x1a')]({},_0x3128d7,_0x342a57));});})[_0xb1d9('0x1b')](function(_0x5408b7){_0x4acdfb(_0x5408b7);});});}function getRealtimeQueues(_0x10bfd6,_0x1be62b){return new Promise(function(_0x21345a,_0x46e812){var _0x1576ba=_0x1be62b===_0xb1d9('0x1c')?amiClient:routingClient;return _0x1576ba[_0xb1d9('0x14')](_['startCase'](_0x1be62b)+_0xb1d9('0x1d'),_0x10bfd6)[_0xb1d9('0x15')](function(_0x1d11e1){if(_0x1d11e1[_0xb1d9('0x10')])throw new Error(util[_0xb1d9('0x1e')](_0xb1d9('0x1f'),_0x1be62b));return _0x21345a(_0x1d11e1['result']);})[_0xb1d9('0x1b')](function(_0x4e76ba){_0x46e812(_0x4e76ba);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x56fba9,_0x298ac5){return amiClient[_0xb1d9('0x14')](_0xb1d9('0x20'),{})[_0xb1d9('0x15')](function(_0x4239b9){if(_0x4239b9['error'])throw new Error(_0xb1d9('0x21'));return _0x56fba9(_0x4239b9[_0xb1d9('0x17')]);})[_0xb1d9('0x1b')](function(_0x56f17c){_0x298ac5(_0x56f17c);});});}function initializeQueues(_0x3bc323,_0x74a3ae,_0x1a5e8d,_0x341e89){var _0x3eba9b=['loggedIn','available',_0xb1d9('0x22'),_0xb1d9('0x23'),_0xb1d9('0x24')];if(_0x1a5e8d===_0xb1d9('0x1c')&&_0x341e89==='outbound'){_0x3eba9b[_0xb1d9('0x25')](_0xb1d9('0x26'),_0xb1d9('0x27'),_0xb1d9('0x28'),_0xb1d9('0x29'),_0xb1d9('0x2a'),_0xb1d9('0x2b'),'startPredictive','startProgressive',_0xb1d9('0x2c'),_0xb1d9('0x2d'),'erlangAbandonmentRate',_0xb1d9('0x2e'),_0xb1d9('0x2f'),_0xb1d9('0x30'),_0xb1d9('0x31'),'predictiveIntervalAvailable',_0xb1d9('0x32'),_0xb1d9('0x33'),'predictiveIntervalDroppedCallsTimeout',_0xb1d9('0x34'),_0xb1d9('0x35'),'predictiveIntervalAvgTalktime');}return _0x3bc323[_0xb1d9('0x36')](function(_0x2a96ef){var _0x56accc=_0x2a96ef[_0xb1d9('0x37')]({'plain':!![]});_0x56accc[_0xb1d9('0x38')]=[];_0x56accc['paused']=0x0;_0x56accc['loggedInDb']=0x0;_0x56accc['loggedIn']=0x0;_0x56accc[_0xb1d9('0x39')]=0x0;_0x56accc['waiting']=0x0;if(_0x1a5e8d===_0xb1d9('0x1c')){_0x56accc[_0xb1d9('0x23')]=0x0;_0x56accc[_0xb1d9('0x3a')]=0x0;if(_0x341e89===_0xb1d9('0x3b')){_0x56accc[_0xb1d9('0x26')]=0x0;_0x56accc[_0xb1d9('0x27')]=0x0;}}var _0x5d99f6=_['find'](_0x74a3ae,['id',_0x56accc['id']]);if(_0x5d99f6)_['merge'](_0x56accc,_['pick'](_0x5d99f6,_0x3eba9b));return _0x56accc;});}function updateAgentVoiceStatus(_0x565153,_0x16c1e6,_0x1c2a08){var _0x3599eb=_[_0xb1d9('0x3c')](_0x1c2a08,['queue',_0x16c1e6[_0xb1d9('0x12')]]);if(_0x3599eb[_0xb1d9('0x3d')]===0x0)return _0x565153[_0xb1d9('0x3a')]=!![];if(_[_0xb1d9('0x3e')](_0x3599eb,[_0xb1d9('0x3f'),_0x565153[_0xb1d9('0x40')]['toString']()]))return _0x565153[_0xb1d9('0x23')]=!![];if(!_0x565153[_0xb1d9('0x23')])return _0x565153[_0xb1d9('0x3a')]=!![];}function getVoiceQueueAgents(_0x472ff0,_0x2eacf6,_0xc30467,_0x4b8dbd){var _0x4de910=_['find'](_0x2eacf6,['id',_0x472ff0['id']]);if(!_0x4de910)return _0x472ff0;return _0x4de910[_0xb1d9('0x41')]({'raw':!![]})[_0xb1d9('0x15')](function(_0x11045f){for(var _0x436d70=0x0;_0x436d70<_0x11045f[_0xb1d9('0x3d')];_0x436d70++){var _0xd5cec9=_[_0xb1d9('0x42')](_0xc30467,['id',_0x11045f[_0x436d70][_0xb1d9('0x43')]]);if(!_0xd5cec9){_0xd5cec9={'id':_0x11045f[_0x436d70][_0xb1d9('0x43')],'name':_0x11045f[_0x436d70][_0xb1d9('0x43')],'accountcode':'','online':![]};}var _0xc8aaeb={'id':_0xd5cec9['id'],'name':_0xd5cec9[_0xb1d9('0x12')],'internal':_0xd5cec9['accountcode'],'online':Boolean(_0xd5cec9[_0xb1d9('0x44')]),'paused':Boolean(_0x11045f[_0x436d70][_0xb1d9('0x24')])};if(_0xd5cec9[_0xb1d9('0x45')]==='talking')updateAgentVoiceStatus(_0xc8aaeb,_0x472ff0,_0x4b8dbd);if(_0xc8aaeb['online'])_0x472ff0[_0xb1d9('0x46')]++;if(_0xc8aaeb[_0xb1d9('0x3a')])_0x472ff0[_0xb1d9('0x3a')]++;if(_0xc8aaeb[_0xb1d9('0x24')]&&!_0xc8aaeb[_0xb1d9('0x3a')]&&!_0xc8aaeb[_0xb1d9('0x23')])_0x472ff0[_0xb1d9('0x24')]++;_0x472ff0[_0xb1d9('0x38')][_0xb1d9('0x25')](_0xc8aaeb);}return _0x472ff0;});}function getQueueAgents(_0x4f2a88,_0x31ab77,_0x49f26f){var _0x4f44ae='User'+_[_0xb1d9('0x47')](_0x49f26f)+_0xb1d9('0x48');var _0x1b8d58=_0x49f26f+_0xb1d9('0x49');return db[_0x4f44ae][_0xb1d9('0x4a')]({'where':{[_['startCase'](_0x49f26f)+'QueueId']:_0x4f2a88['id']},'raw':!![]})['then'](function(_0x47ea7f){for(var _0x30c5f0=0x0;_0x30c5f0<_0x47ea7f['length'];_0x30c5f0++){var _0x31b921=_['find'](_0x31ab77,['id',_0x47ea7f[_0x30c5f0][_0xb1d9('0x43')]]);if(!_0x31b921){_0x31b921={'id':_0x47ea7f[_0x30c5f0]['UserId'],'name':_0x47ea7f[_0x30c5f0][_0xb1d9('0x43')],'online':![],['pauseField']:![]};}var _0x376751={'id':_0x31b921['id'],'name':_0x31b921[_0xb1d9('0x12')],'online':Boolean(_0x31b921[_0xb1d9('0x44')]),'paused':Boolean(_0x31b921[_0x1b8d58])};if(_0x376751[_0xb1d9('0x44')])_0x4f2a88[_0xb1d9('0x46')]++;_0x4f2a88[_0xb1d9('0x38')][_0xb1d9('0x25')](_0x376751);}return _0x4f2a88;});}function isIdle(_0x590e4c){return _0x590e4c===_0xb1d9('0x4b')||_0x590e4c===_0xb1d9('0x4c')||_0x590e4c==='unavailable'||_0x590e4c===_0xb1d9('0x4d')||_[_0xb1d9('0x4e')](_0x590e4c);}function isAgentPaused(_0x5b6f76,_0x1e0bdc){var _0x26ab9b=[_0x5b6f76[_0xb1d9('0x4f')],_0x5b6f76['faxPause'],_0x5b6f76['mailPause'],_0x5b6f76['openchannelPause'],_0x5b6f76['smsPause'],_0x5b6f76[_0xb1d9('0x50')],_0x5b6f76['whatsappPause']];if(!_0x1e0bdc)return _[_0xb1d9('0x51')](_0x26ab9b);var _0x4997cb=_[_0xb1d9('0x3c')](_0x26ab9b);return _0x4997cb['length']>0x0&&_0x4997cb['length']<_0x26ab9b['length']?!![]:![];}function isAgentIdle(_0x886ecc){if(_0x886ecc[_0xb1d9('0x45')]!=='idle'&&_0x886ecc['voicePause']){_0x886ecc[_0xb1d9('0x45')]='pause';return![];}return _[_0xb1d9('0x51')]([_0x886ecc[_0xb1d9('0x52')],_0x886ecc[_0xb1d9('0x53')],_0x886ecc[_0xb1d9('0x54')],_0x886ecc['openchannelStatus'],_0x886ecc[_0xb1d9('0x55')],_0x886ecc[_0xb1d9('0x45')],_0x886ecc[_0xb1d9('0x56')]],isIdle);}function getAgentStatus(_0x1fa015){var _0x155949=_0xb1d9('0x4c');if(isAgentPaused(_0x1fa015))_0x155949=_0xb1d9('0x57');else if(isAgentPaused(_0x1fa015,!![]))_0x155949='*pause';else if(isAgentIdle(_0x1fa015))_0x155949=_0xb1d9('0x4b');else _0x155949=_0xb1d9('0x3a');return _0x155949;}function validateChannel(_0xbfae1c){var _0x43cfe0=[_0xb1d9('0x58'),_0xb1d9('0x59'),'sms','openchannel',_0xb1d9('0x5a'),'whatsapp',_0xb1d9('0x1c')];if(!_['includes'](_0x43cfe0,_0xbfae1c['toLowerCase']()))throw new Error(_0xb1d9('0x5b'));return _0xbfae1c[_0xb1d9('0x5c')]();}function getFilteredAgentIds(_0x53485f,_0x19e954){var _0x5d4065=_[_0xb1d9('0x5d')](_0x53485f)?_0x53485f:[_0x53485f];var _0x1085d1=_[_0xb1d9('0x36')](_0x5d4065,function(_0x58cc96){return db[_0x19e954][_0xb1d9('0x5e')]({'where':{'name':_0x58cc96}})['then'](function(_0x49c7d1){if(!_0x49c7d1)return[];return _0x49c7d1[_0xb1d9('0x5f')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb1d9('0x60')](_0x1085d1)['then'](function(_0x2ab9c7){var _0x29f1f6=_(_0x2ab9c7)[_0xb1d9('0x61')]()[_0xb1d9('0x36')]('id')[_0xb1d9('0x62')]()['value']();return _0x29f1f6;});}function getUpdatedSortOptions(_0x379334){var _0x3e4476={'fields':[],'order':null};var _0x2fcd9d=_0x379334['split'](',');_0x3e4476['fields']=_[_0xb1d9('0x3c')](_0x2fcd9d,function(_0x3ad65e){if(!_0x3ad65e[_0xb1d9('0x63')](_0xb1d9('0x64')))return!![];_0x3e4476[_0xb1d9('0x65')]=_[_0xb1d9('0x66')](_0x3ad65e,'-')?_0xb1d9('0x67'):_0xb1d9('0x68');return![];});return _0x3e4476;}function orderAgentsByStatus(_0x38c021,_0xb6b564){return _0x38c021['sort'](function(_0x2ab9d8,_0x11706a){if(_0x2ab9d8[_0xb1d9('0x64')]===_0x11706a[_0xb1d9('0x64')]&&_0x2ab9d8[_0xb1d9('0x64')]===_0xb1d9('0x57')){if(_0xb6b564===_0xb1d9('0x67'))return(_0x2ab9d8[_0xb1d9('0x69')]||'')<(_0x11706a[_0xb1d9('0x69')]||'')?0x1:-0x1;return _0x2ab9d8['pauseType']<_0x11706a[_0xb1d9('0x69')]?-0x1:0x1;}else{if(_0xb6b564===_0xb1d9('0x67'))return _0x2ab9d8['globalStatus']<_0x11706a[_0xb1d9('0x64')]?0x1:-0x1;return _0x2ab9d8[_0xb1d9('0x64')]<_0x11706a[_0xb1d9('0x64')]?-0x1:0x1;}});}exports[_0xb1d9('0x5f')]=function(_0x4bd0e9,_0x197fc5){var _0x48d4f8={'count':0x0,'rows':[]},_0x1ac810={},_0x3b1071,_0x4d13d1,_0x2f6041,_0x1bf419,_0xdf1e87=[_0xb1d9('0x6a'),_0xb1d9('0x44'),_0xb1d9('0x6b'),_0xb1d9('0x6c'),'pauseType',_0xb1d9('0x6c'),_0xb1d9('0x40'),_0xb1d9('0x6d'),_0xb1d9('0x4f'),_0xb1d9('0x6e'),'mailPause',_0xb1d9('0x6f'),_0xb1d9('0x70'),'faxPause',_0xb1d9('0x50'),_0xb1d9('0x71'),_0xb1d9('0x72'),_0xb1d9('0x73'),_0xb1d9('0x74'),'whatsappCapacity','faxCapacity',_0xb1d9('0x75'),_0xb1d9('0x76'),_0xb1d9('0x77'),_0xb1d9('0x78'),_0xb1d9('0x79'),_0xb1d9('0x7a'),_0xb1d9('0x52'),'openchannelStatus',_0xb1d9('0x54'),_0xb1d9('0x55'),_0xb1d9('0x56'),_0xb1d9('0x53'),_0xb1d9('0x45'),_0xb1d9('0x7b'),_0xb1d9('0x7c'),_0xb1d9('0x7d'),_0xb1d9('0x7e'),_0xb1d9('0x7f'),_0xb1d9('0x80'),_0xb1d9('0x81'),_0xb1d9('0x82'),_0xb1d9('0x83'),'screenrecording',_0xb1d9('0x84'),_0xb1d9('0x85'),_0xb1d9('0x86')],_0x4135c3=['chatPause',_0xb1d9('0x6e'),_0xb1d9('0x87'),_0xb1d9('0x6f'),_0xb1d9('0x70'),_0xb1d9('0x88'),_0xb1d9('0x50'),_0xb1d9('0x44')];Promise[_0xb1d9('0x89')]()[_0xb1d9('0x15')](function(){if(_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x8b')])_0x3b1071=validateChannel(_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x8b')]);if(!_0x4bd0e9['query'][_0xb1d9('0x8c')]||!_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x8c')][_0xb1d9('0x63')](_0xb1d9('0x64')))return;var _0x58e1a3=getUpdatedSortOptions(_0x4bd0e9[_0xb1d9('0x8a')]['sort']);_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x8c')]=_0x58e1a3[_0xb1d9('0x8d')]['join'](',');_0x4d13d1=_0x58e1a3[_0xb1d9('0x65')];})['then'](function(){if(!_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x8e')])return[];var _0x5c497c=_[_0xb1d9('0x47')](_0x3b1071)+_0xb1d9('0x48');return getFilteredAgentIds(_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x8e')],_0x5c497c);})[_0xb1d9('0x15')](function(_0x4aa652){var _0x549c6c=_[_0xb1d9('0x36')](db[_0xb1d9('0x8f')]['rawAttributes'],function(_0x194e60){return{'name':_0x194e60[_0xb1d9('0x90')],'type':_0x194e60['type'][_0xb1d9('0x91')]};});_0x4bd0e9[_0xb1d9('0x8a')]['role']='agent';_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x44')]=!![];_0x1ac810=qs[_0xb1d9('0x92')](_0x549c6c,_0x4bd0e9);_0x1ac810[_0xb1d9('0x93')]=!![];if(!_['isEmpty'](_0x4aa652)){_0x1ac810[_0xb1d9('0x94')]=_[_0xb1d9('0x1a')](_0x1ac810[_0xb1d9('0x94')],{'$and':[{'id':{'$in':_0x4aa652}}]});}else if(!_[_0xb1d9('0x95')](_0x4bd0e9[_0xb1d9('0x8a')]['globalQueueFilter'])){return _0x48d4f8;}if(_0x4bd0e9[_0xb1d9('0x96')][_0xb1d9('0x97')]===_0xb1d9('0x96')){var _0x47f3d0={'params':{'id':_0x4bd0e9[_0xb1d9('0x96')][_0xb1d9('0x98')]},'query':{'section':'Agents','role':_0xb1d9('0x99'),'online':!![],'nolimit':_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x9a')],'sort':_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0x8c')],'filter':_0x4bd0e9['query']['filter'],'raw':!![],'ids':_0x4aa652}};return db[_0xb1d9('0x9b')][_0xb1d9('0x9c')](_0x47f3d0);}return db[_0xb1d9('0x8f')][_0xb1d9('0x9d')](_0x1ac810);})[_0xb1d9('0x15')](function(_0x357ddf){_0x48d4f8[_0xb1d9('0xb')]=_0x357ddf[_0xb1d9('0xb')];_0x2f6041=_0x357ddf[_0xb1d9('0x9e')];return getRealtimeAgents();})['then'](function(_0xa5675b){_0x1bf419=_0xa5675b[_0xb1d9('0x9e')];return _0x2f6041[_0xb1d9('0x36')](function(_0x4cf5b9){var _0x35404a=_[_0xb1d9('0x42')](_0x1bf419,['id',_0x4cf5b9['id']]);if(_0x35404a)_[_0xb1d9('0x1a')](_0x4cf5b9,_[_0xb1d9('0x9f')](_[_0xb1d9('0xa0')](_0x35404a,_0x4135c3),_0xdf1e87));_0x4cf5b9[_0xb1d9('0x64')]=getAgentStatus(_0x4cf5b9);return _0x4cf5b9;});})[_0xb1d9('0x15')](function(_0x3a2cb2){var _0xb94198;if(_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0xa1')]){_0xb94198=_['filter'](_0x3a2cb2,['globalStatus',_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0xa1')]]);if(_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0xa2')]){_0xb94198=_[_0xb1d9('0x3c')](_0xb94198,['pauseType',_0x4bd0e9[_0xb1d9('0x8a')][_0xb1d9('0xa2')]]);}}if(_0xb94198)_0x3a2cb2=_0xb94198;if(!_0x4d13d1)return _0x3a2cb2;return orderAgentsByStatus(_0x3a2cb2,_0x4d13d1);})[_0xb1d9('0x15')](function(_0x1b0d93){_0x48d4f8[_0xb1d9('0x9e')]=_0x1b0d93;return _0x48d4f8;})[_0xb1d9('0x15')](respondWithFilteredResult(_0x197fc5,_0x1ac810))[_0xb1d9('0x1b')](handleError(_0x197fc5,null));};exports[_0xb1d9('0xa3')]=function(_0x4af327,_0x1493d9){var _0x3b2ddc={'count':0x0,'rows':[]},_0x522d11={},_0x5982a5,_0xf3450,_0x5448c8,_0x413010,_0x4b8dff;Promise[_0xb1d9('0x89')]()[_0xb1d9('0x15')](function(){if(_0x4af327[_0xb1d9('0x8a')]['channel'])_0x5982a5=validateChannel(_0x4af327[_0xb1d9('0x8a')][_0xb1d9('0x8b')]);var _0x4a9616=_[_0xb1d9('0x47')](_0x5982a5)+_0xb1d9('0x48');var _0x479e41=_[_0xb1d9('0x36')](db[_0x4a9616]['rawAttributes'],function(_0x344c33){return{'name':_0x344c33['fieldName'],'type':_0x344c33[_0xb1d9('0xa4')][_0xb1d9('0x91')]};});_0x522d11=qs[_0xb1d9('0x92')](_0x479e41,_0x4af327);if(_0x4af327[_0xb1d9('0x96')][_0xb1d9('0x97')]===_0xb1d9('0x96')){var _0xf44cf4={'params':{'id':_0x4af327[_0xb1d9('0x96')][_0xb1d9('0x98')]},'query':{'section':_0x5982a5===_0xb1d9('0x1c')&&_0x4af327[_0xb1d9('0x8a')][_0xb1d9('0xa4')]===_0xb1d9('0x3b')?_0xb1d9('0xa5'):_[_0xb1d9('0x47')](_0x5982a5)+_0xb1d9('0x1d'),'type':_0x4af327['query'][_0xb1d9('0xa4')],'nolimit':!![],'sort':'name','filter':_0x4af327[_0xb1d9('0x8a')][_0xb1d9('0x3c')]}};return db[_0xb1d9('0x9b')][_0xb1d9('0x9c')](_0xf44cf4);}return db[_0x4a9616][_0xb1d9('0x9d')](_0x522d11);})['then'](function(_0x50bd54){_0x3b2ddc[_0xb1d9('0xb')]=_0x50bd54['count'];_0xf3450=_0x50bd54[_0xb1d9('0x9e')];return getRealtimeQueues(_0x4af327,_0x5982a5);})[_0xb1d9('0x15')](function(_0x422d16){_0x413010=_0x422d16[_0xb1d9('0x9e')];return getRealtimeAgents();})[_0xb1d9('0x15')](function(_0x5f1d67){_0x5448c8=_0x5f1d67[_0xb1d9('0x9e')];if(_0x5982a5!=_0xb1d9('0x1c'))return;return getRealtimeVoiceQueueChannels();})[_0xb1d9('0x15')](function(_0x1c333a){_0x4b8dff=_0x1c333a?_0x1c333a[_0xb1d9('0x9e')]:[];return initializeQueues(_0xf3450,_0x413010,_0x5982a5,_0x4af327[_0xb1d9('0x8a')]['type']);})[_0xb1d9('0x15')](function(_0xe42c82){var _0x3f9451=_0xe42c82[_0xb1d9('0x36')](function(_0x4114d2){if(_0x5982a5==='voice')return getVoiceQueueAgents(_0x4114d2,_0xf3450,_0x5448c8,_0x4b8dff);else return getQueueAgents(_0x4114d2,_0x5448c8,_0x5982a5);});return Promise['all'](_0x3f9451);})[_0xb1d9('0x15')](function(_0x1e10b7){_0x3b2ddc['rows']=_0x1e10b7;return _0x3b2ddc;})['then'](respondWithFilteredResult(_0x1493d9,_0x522d11))[_0xb1d9('0x1b')](handleError(_0x1493d9,null));};
\ No newline at end of file
+var _0x811d=['rawAttributes','fieldName','type','key','role','agent','raw','isEmpty','where','user','userProfileId','Agents','getResources','findAndCountAll','rows','omit','getQueues','getOptions','UserProfile','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','send','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','voice','startCase','Queues','available','waiting','talking','paused','pTalking','originated','message','dialActive','dialMethod','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','loggedIn','busy','outbound','find','pick','filter','queue','length','some','connectedlinenum','internal','UserId','accountcode','online','voiceStatus','push','User','Queue','Pause','findAll','QueueId','idle','unknown','unavailable','ringing','isNil','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','mail','chat','sms','openchannel','fax','whatsapp','toLowerCase','Invalid\x20channel','isArray','map','findOne','getAgents','all','flatten','uniq','split','fields','globalStatus','startsWith','ASC','sort','DESC','pauseType','userpic','lastLoginAt','lastPauseAt','address','chatPause','mailCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','smsStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','resolve','query','channel','includes','join','order','globalQueueFilter'];(function(_0x4013da,_0xeaf6dc){var _0x434e19=function(_0x491376){while(--_0x491376){_0x4013da['push'](_0x4013da['shift']());}};_0x434e19(++_0xeaf6dc);}(_0x811d,0xb6));var _0xd811=function(_0x1e441e,_0x219dd8){_0x1e441e=_0x1e441e-0x0;var _0x3f533c=_0x811d[_0x1e441e];return _0x3f533c;};'use strict';var util=require(_0xd811('0x0'));var _=require(_0xd811('0x1'));var jayson=require(_0xd811('0x2'));var qs=require(_0xd811('0x3'));var logger=require(_0xd811('0x4'))(_0xd811('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xd811('0x6')][_0xd811('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x30e2e3,_0x580768){return function(_0x3ff556){if(_0x3ff556){var _0x5ec8ea=typeof _0x580768[_0xd811('0x8')]===_0xd811('0x9')&&typeof _0x580768[_0xd811('0xa')]===_0xd811('0x9');var _0x3f4848=_0x3ff556[_0xd811('0xb')];var _0x224014=_0x5ec8ea?0x0:_0x580768[_0xd811('0x8')];var _0xc2a0ba=_0x5ec8ea?_0x3ff556[_0xd811('0xb')]:_0x580768[_0xd811('0x8')]+_0x580768[_0xd811('0xa')];var _0x1ceed2;if(_0xc2a0ba>=_0x3f4848){_0xc2a0ba=_0x3f4848;_0x1ceed2=0xc8;}else{_0x1ceed2=0xce;}_0x30e2e3[_0xd811('0xc')](_0x1ceed2);return _0x30e2e3[_0xd811('0xd')](_0xd811('0xe'),_0x224014+'-'+_0xc2a0ba+'/'+_0x3f4848)[_0xd811('0xf')](_0x3ff556);}return null;};}function handleError(_0x267176,_0x5f241c){_0x5f241c=_0x5f241c||0x1f4;return function(_0x40f819){logger[_0xd811('0x10')](_0x40f819[_0xd811('0x11')]);if(_0x40f819[_0xd811('0x12')]){delete _0x40f819[_0xd811('0x12')];}_0x267176[_0xd811('0xc')](_0x5f241c)[_0xd811('0x13')](_0x40f819);};}function getRealtimeAgents(){return new Promise(function(_0x2da423,_0x10f8db){return amiClient[_0xd811('0x14')]('Agents',{})[_0xd811('0x15')](function(_0x54054f){if(_0x54054f[_0xd811('0x10')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x1f2319=_0x54054f['result'];return routingClient[_0xd811('0x14')]('Agents',{})['then'](function(_0x4ddcda){if(_0x4ddcda[_0xd811('0x10')])throw new Error(_0xd811('0x16'));var _0x55c2ab=_0x4ddcda[_0xd811('0x17')];return _0x2da423(_[_0xd811('0x18')]({},_0x1f2319,_0x55c2ab));});})[_0xd811('0x19')](function(_0x1254b4){_0x10f8db(_0x1254b4);});});}function getRealtimeQueues(_0x45ef24,_0x488f37){return new Promise(function(_0x312d1d,_0x5619f2){var _0x3aa0ad=_0x488f37===_0xd811('0x1a')?amiClient:routingClient;return _0x3aa0ad[_0xd811('0x14')](_[_0xd811('0x1b')](_0x488f37)+_0xd811('0x1c'),_0x45ef24)[_0xd811('0x15')](function(_0x46b9a0){if(_0x46b9a0[_0xd811('0x10')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x488f37));return _0x312d1d(_0x46b9a0[_0xd811('0x17')]);})[_0xd811('0x19')](function(_0x430712){_0x5619f2(_0x430712);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x47086d,_0xb29646){return amiClient[_0xd811('0x14')]('VoiceQueuesChannels',{})[_0xd811('0x15')](function(_0x1588ae){if(_0x1588ae[_0xd811('0x10')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x47086d(_0x1588ae['result']);})[_0xd811('0x19')](function(_0x1c0631){_0xb29646(_0x1c0631);});});}function initializeQueues(_0x5de18b,_0x2e2408,_0x1dda4a,_0x7196ba){var _0x187f90=['loggedIn',_0xd811('0x1d'),_0xd811('0x1e'),_0xd811('0x1f'),_0xd811('0x20')];if(_0x1dda4a===_0xd811('0x1a')&&_0x7196ba==='outbound'){_0x187f90['push'](_0xd811('0x21'),_0xd811('0x22'),_0xd811('0x23'),_0xd811('0x24'),_0xd811('0x25'),'Trunk',_0xd811('0x26'),'startProgressive',_0xd811('0x27'),_0xd811('0x28'),_0xd811('0x29'),_0xd811('0x2a'),_0xd811('0x2b'),'dialPredictiveIntervalMaxThreshold',_0xd811('0x2c'),_0xd811('0x2d'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xd811('0x2e'),_0xd811('0x2f'),_0xd811('0x30'),_0xd811('0x31'));}return _0x5de18b['map'](function(_0x1c4d27){var _0x5d6e01=_0x1c4d27[_0xd811('0x32')]({'plain':!![]});_0x5d6e01[_0xd811('0x33')]=[];_0x5d6e01[_0xd811('0x20')]=0x0;_0x5d6e01[_0xd811('0x34')]=0x0;_0x5d6e01[_0xd811('0x35')]=0x0;_0x5d6e01['available']=0x0;_0x5d6e01['waiting']=0x0;if(_0x1dda4a===_0xd811('0x1a')){_0x5d6e01[_0xd811('0x1f')]=0x0;_0x5d6e01[_0xd811('0x36')]=0x0;if(_0x7196ba===_0xd811('0x37')){_0x5d6e01[_0xd811('0x21')]=0x0;_0x5d6e01['originated']=0x0;}}var _0x4d9894=_[_0xd811('0x38')](_0x2e2408,['id',_0x5d6e01['id']]);if(_0x4d9894)_[_0xd811('0x18')](_0x5d6e01,_[_0xd811('0x39')](_0x4d9894,_0x187f90));return _0x5d6e01;});}function updateAgentVoiceStatus(_0x15b378,_0x58c404,_0x194ec2){var _0x555c5e=_[_0xd811('0x3a')](_0x194ec2,[_0xd811('0x3b'),_0x58c404['name']]);if(_0x555c5e[_0xd811('0x3c')]===0x0)return _0x15b378['busy']=!![];if(_[_0xd811('0x3d')](_0x555c5e,[_0xd811('0x3e'),_0x15b378[_0xd811('0x3f')]['toString']()]))return _0x15b378[_0xd811('0x1f')]=!![];if(!_0x15b378[_0xd811('0x1f')])return _0x15b378[_0xd811('0x36')]=!![];}function getVoiceQueueAgents(_0x258820,_0x5e166f,_0x26e907,_0x6616b3){var _0x598faf=_[_0xd811('0x38')](_0x5e166f,['id',_0x258820['id']]);if(!_0x598faf)return _0x258820;return _0x598faf['getMembers']({'raw':!![]})[_0xd811('0x15')](function(_0x297ff0){for(var _0x15c43b=0x0;_0x15c43b<_0x297ff0[_0xd811('0x3c')];_0x15c43b++){var _0x489229=_['find'](_0x26e907,['id',_0x297ff0[_0x15c43b][_0xd811('0x40')]]);if(!_0x489229){_0x489229={'id':_0x297ff0[_0x15c43b]['UserId'],'name':_0x297ff0[_0x15c43b][_0xd811('0x40')],'accountcode':'','online':![]};}var _0x466b14={'id':_0x489229['id'],'name':_0x489229[_0xd811('0x12')],'internal':_0x489229[_0xd811('0x41')],'online':Boolean(_0x489229[_0xd811('0x42')]),'paused':Boolean(_0x297ff0[_0x15c43b][_0xd811('0x20')])};if(_0x489229[_0xd811('0x43')]===_0xd811('0x1f'))updateAgentVoiceStatus(_0x466b14,_0x258820,_0x6616b3);if(_0x466b14[_0xd811('0x42')])_0x258820[_0xd811('0x34')]++;if(_0x466b14[_0xd811('0x36')])_0x258820['busy']++;if(_0x466b14[_0xd811('0x20')]&&!_0x466b14['busy']&&!_0x466b14[_0xd811('0x1f')])_0x258820['paused']++;_0x258820[_0xd811('0x33')][_0xd811('0x44')](_0x466b14);}return _0x258820;});}function getQueueAgents(_0xb2019a,_0x3f5c6d,_0x2b48e4){var _0x4ddf45=_0xd811('0x45')+_['startCase'](_0x2b48e4)+_0xd811('0x46');var _0x198b69=_0x2b48e4+_0xd811('0x47');return db[_0x4ddf45][_0xd811('0x48')]({'where':{[_[_0xd811('0x1b')](_0x2b48e4)+_0xd811('0x49')]:_0xb2019a['id']},'raw':!![]})[_0xd811('0x15')](function(_0x2c9600){for(var _0x291c0a=0x0;_0x291c0a<_0x2c9600[_0xd811('0x3c')];_0x291c0a++){var _0x2a9b1f=_[_0xd811('0x38')](_0x3f5c6d,['id',_0x2c9600[_0x291c0a][_0xd811('0x40')]]);if(!_0x2a9b1f){_0x2a9b1f={'id':_0x2c9600[_0x291c0a][_0xd811('0x40')],'name':_0x2c9600[_0x291c0a][_0xd811('0x40')],'online':![],['pauseField']:![]};}var _0x764745={'id':_0x2a9b1f['id'],'name':_0x2a9b1f['name'],'online':Boolean(_0x2a9b1f[_0xd811('0x42')]),'paused':Boolean(_0x2a9b1f[_0x198b69])};if(_0x764745['online'])_0xb2019a[_0xd811('0x34')]++;_0xb2019a['agents'][_0xd811('0x44')](_0x764745);}return _0xb2019a;});}function isIdle(_0x417396){return _0x417396===_0xd811('0x4a')||_0x417396===_0xd811('0x4b')||_0x417396===_0xd811('0x4c')||_0x417396===_0xd811('0x4d')||_[_0xd811('0x4e')](_0x417396);}function isAgentPaused(_0x24658f,_0x164dc1){var _0x204ffc=[_0x24658f['chatPause'],_0x24658f[_0xd811('0x4f')],_0x24658f[_0xd811('0x50')],_0x24658f[_0xd811('0x51')],_0x24658f[_0xd811('0x52')],_0x24658f[_0xd811('0x53')],_0x24658f[_0xd811('0x54')]];if(!_0x164dc1)return _['every'](_0x204ffc);var _0x2899de=_['filter'](_0x204ffc);return _0x2899de[_0xd811('0x3c')]>0x0&&_0x2899de[_0xd811('0x3c')]<_0x204ffc[_0xd811('0x3c')]?!![]:![];}function isAgentIdle(_0x5c07b8){if(_0x5c07b8[_0xd811('0x43')]!==_0xd811('0x4a')&&_0x5c07b8['voicePause']){_0x5c07b8[_0xd811('0x43')]=_0xd811('0x55');return![];}return _['every']([_0x5c07b8[_0xd811('0x56')],_0x5c07b8[_0xd811('0x57')],_0x5c07b8[_0xd811('0x58')],_0x5c07b8[_0xd811('0x59')],_0x5c07b8['smsStatus'],_0x5c07b8[_0xd811('0x43')],_0x5c07b8[_0xd811('0x5a')]],isIdle);}function getAgentStatus(_0x29adfc){var _0x2bb67c=_0xd811('0x4b');if(isAgentPaused(_0x29adfc))_0x2bb67c='pause';else if(isAgentPaused(_0x29adfc,!![]))_0x2bb67c='*pause';else if(isAgentIdle(_0x29adfc))_0x2bb67c='idle';else _0x2bb67c='busy';return _0x2bb67c;}function validateChannel(_0x5ac0c9){var _0x5a9059=[_0xd811('0x5b'),_0xd811('0x5c'),_0xd811('0x5d'),_0xd811('0x5e'),_0xd811('0x5f'),_0xd811('0x60'),_0xd811('0x1a')];if(!_['includes'](_0x5a9059,_0x5ac0c9[_0xd811('0x61')]()))throw new Error(_0xd811('0x62'));return _0x5ac0c9[_0xd811('0x61')]();}function getFilteredAgentIds(_0x17f730,_0x48fc3d){var _0x2bc742=_[_0xd811('0x63')](_0x17f730)?_0x17f730:[_0x17f730];var _0x13f064=_[_0xd811('0x64')](_0x2bc742,function(_0x5bd25d){return db[_0x48fc3d][_0xd811('0x65')]({'where':{'name':_0x5bd25d}})[_0xd811('0x15')](function(_0x3a572e){if(!_0x3a572e)return[];return _0x3a572e[_0xd811('0x66')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xd811('0x67')](_0x13f064)['then'](function(_0x18dd53){var _0x12895b=_(_0x18dd53)[_0xd811('0x68')]()[_0xd811('0x64')]('id')[_0xd811('0x69')]()['value']();return _0x12895b;});}function getUpdatedSortOptions(_0x8a68d2){var _0x37dcdc={'fields':[],'order':null};var _0x364de4=_0x8a68d2[_0xd811('0x6a')](',');_0x37dcdc[_0xd811('0x6b')]=_[_0xd811('0x3a')](_0x364de4,function(_0x547d6f){if(!_0x547d6f['includes'](_0xd811('0x6c')))return!![];_0x37dcdc['order']=_[_0xd811('0x6d')](_0x547d6f,'-')?'DESC':_0xd811('0x6e');return![];});return _0x37dcdc;}function orderAgentsByStatus(_0x45c45a,_0x15e75d){return _0x45c45a[_0xd811('0x6f')](function(_0x4c950a,_0x7c402d){if(_0x4c950a[_0xd811('0x6c')]===_0x7c402d['globalStatus']&&_0x4c950a[_0xd811('0x6c')]==='pause'){if(_0x15e75d===_0xd811('0x70'))return(_0x4c950a[_0xd811('0x71')]||'')<(_0x7c402d[_0xd811('0x71')]||'')?0x1:-0x1;return _0x4c950a[_0xd811('0x71')]<_0x7c402d[_0xd811('0x71')]?-0x1:0x1;}else{if(_0x15e75d==='DESC')return _0x4c950a[_0xd811('0x6c')]<_0x7c402d[_0xd811('0x6c')]?0x1:-0x1;return _0x4c950a['globalStatus']<_0x7c402d['globalStatus']?-0x1:0x1;}});}exports[_0xd811('0x66')]=function(_0x36adff,_0x463677){var _0xf1735={'count':0x0,'rows':[]},_0x506ff7={},_0xc6cdc1,_0x546368,_0x178b58,_0x5d9b2e,_0x118389=[_0xd811('0x72'),_0xd811('0x42'),_0xd811('0x73'),_0xd811('0x74'),_0xd811('0x71'),'lastPauseAt',_0xd811('0x3f'),_0xd811('0x75'),_0xd811('0x76'),_0xd811('0x51'),'mailPause',_0xd811('0x52'),_0xd811('0x54'),'faxPause',_0xd811('0x53'),'chatCapacity','openchannelCapacity',_0xd811('0x77'),'smsCapacity',_0xd811('0x78'),'faxCapacity',_0xd811('0x79'),_0xd811('0x7a'),_0xd811('0x7b'),_0xd811('0x7c'),_0xd811('0x7d'),'faxCurrentCapacity','chatStatus',_0xd811('0x59'),_0xd811('0x58'),_0xd811('0x7e'),'whatsappStatus','faxStatus','voiceStatus',_0xd811('0x7f'),_0xd811('0x80'),_0xd811('0x81'),_0xd811('0x82'),_0xd811('0x83'),_0xd811('0x84'),_0xd811('0x85'),_0xd811('0x3b'),_0xd811('0x86'),_0xd811('0x87'),_0xd811('0x88'),'phoneBarEnableAutomaticScreenRecording','routealias'],_0x15fd2b=[_0xd811('0x76'),'openchannelPause',_0xd811('0x50'),_0xd811('0x52'),_0xd811('0x54'),'faxPause',_0xd811('0x53'),'online'];Promise[_0xd811('0x89')]()['then'](function(){if(_0x36adff[_0xd811('0x8a')][_0xd811('0x8b')])_0xc6cdc1=validateChannel(_0x36adff[_0xd811('0x8a')][_0xd811('0x8b')]);if(!_0x36adff['query']['sort']||!_0x36adff[_0xd811('0x8a')][_0xd811('0x6f')][_0xd811('0x8c')](_0xd811('0x6c')))return;var _0x191228=getUpdatedSortOptions(_0x36adff['query']['sort']);_0x36adff['query'][_0xd811('0x6f')]=_0x191228['fields'][_0xd811('0x8d')](',');_0x546368=_0x191228[_0xd811('0x8e')];})[_0xd811('0x15')](function(){if(!_0x36adff[_0xd811('0x8a')][_0xd811('0x8f')])return[];var _0xc3f023=_[_0xd811('0x1b')](_0xc6cdc1)+_0xd811('0x46');return getFilteredAgentIds(_0x36adff[_0xd811('0x8a')][_0xd811('0x8f')],_0xc3f023);})[_0xd811('0x15')](function(_0x180abf){var _0x484ad9=_[_0xd811('0x64')](db[_0xd811('0x45')][_0xd811('0x90')],function(_0x41738e){return{'name':_0x41738e[_0xd811('0x91')],'type':_0x41738e[_0xd811('0x92')][_0xd811('0x93')]};});_0x36adff[_0xd811('0x8a')][_0xd811('0x94')]=_0xd811('0x95');_0x36adff[_0xd811('0x8a')][_0xd811('0x42')]=!![];_0x506ff7=qs['getOptions'](_0x484ad9,_0x36adff);_0x506ff7[_0xd811('0x96')]=!![];if(!_[_0xd811('0x97')](_0x180abf)){_0x506ff7[_0xd811('0x98')]=_[_0xd811('0x18')](_0x506ff7[_0xd811('0x98')],{'$and':[{'id':{'$in':_0x180abf}}]});}else if(!_['isEmpty'](_0x36adff[_0xd811('0x8a')][_0xd811('0x8f')])){return _0xf1735;}if(_0x36adff['user'][_0xd811('0x94')]===_0xd811('0x99')){var _0x242a28={'params':{'id':_0x36adff[_0xd811('0x99')][_0xd811('0x9a')]},'query':{'section':_0xd811('0x9b'),'role':'agent','online':!![],'nolimit':_0x36adff[_0xd811('0x8a')]['nolimit'],'sort':_0x36adff['query']['sort'],'filter':_0x36adff[_0xd811('0x8a')][_0xd811('0x3a')],'raw':!![],'ids':_0x180abf}};return db['UserProfile'][_0xd811('0x9c')](_0x242a28);}return db[_0xd811('0x45')][_0xd811('0x9d')](_0x506ff7);})[_0xd811('0x15')](function(_0x10928a){_0xf1735[_0xd811('0xb')]=_0x10928a[_0xd811('0xb')];_0x178b58=_0x10928a[_0xd811('0x9e')];return getRealtimeAgents();})[_0xd811('0x15')](function(_0x2c6263){_0x5d9b2e=_0x2c6263['rows'];return _0x178b58['map'](function(_0x57145b){var _0x1ababa=_['find'](_0x5d9b2e,['id',_0x57145b['id']]);if(_0x1ababa)_[_0xd811('0x18')](_0x57145b,_[_0xd811('0x39')](_[_0xd811('0x9f')](_0x1ababa,_0x15fd2b),_0x118389));_0x57145b[_0xd811('0x6c')]=getAgentStatus(_0x57145b);return _0x57145b;});})[_0xd811('0x15')](function(_0x45d481){var _0x2a7abf;if(_0x36adff['query']['globalStatusFilter']){_0x2a7abf=_[_0xd811('0x3a')](_0x45d481,[_0xd811('0x6c'),_0x36adff[_0xd811('0x8a')]['globalStatusFilter']]);if(_0x36adff[_0xd811('0x8a')]['pauseTypeFilter']){_0x2a7abf=_[_0xd811('0x3a')](_0x2a7abf,[_0xd811('0x71'),_0x36adff[_0xd811('0x8a')]['pauseTypeFilter']]);}}if(_0x2a7abf)_0x45d481=_0x2a7abf;if(!_0x546368)return _0x45d481;return orderAgentsByStatus(_0x45d481,_0x546368);})[_0xd811('0x15')](function(_0x5062e9){_0xf1735['rows']=_0x5062e9;return _0xf1735;})[_0xd811('0x15')](respondWithFilteredResult(_0x463677,_0x506ff7))[_0xd811('0x19')](handleError(_0x463677,null));};exports[_0xd811('0xa0')]=function(_0x3c64d8,_0xa37845){var _0x4d5f03={'count':0x0,'rows':[]},_0x2b3768={},_0x269eee,_0x26726d,_0x3a1427,_0x1172bf,_0x2f8166;Promise[_0xd811('0x89')]()['then'](function(){if(_0x3c64d8[_0xd811('0x8a')][_0xd811('0x8b')])_0x269eee=validateChannel(_0x3c64d8[_0xd811('0x8a')][_0xd811('0x8b')]);var _0x121870=_['startCase'](_0x269eee)+_0xd811('0x46');var _0x3924d6=_[_0xd811('0x64')](db[_0x121870][_0xd811('0x90')],function(_0x490058){return{'name':_0x490058[_0xd811('0x91')],'type':_0x490058['type'][_0xd811('0x93')]};});_0x2b3768=qs[_0xd811('0xa1')](_0x3924d6,_0x3c64d8);if(_0x3c64d8[_0xd811('0x99')]['role']==='user'){var _0x18bc43={'params':{'id':_0x3c64d8[_0xd811('0x99')]['userProfileId']},'query':{'section':_0x269eee===_0xd811('0x1a')&&_0x3c64d8[_0xd811('0x8a')][_0xd811('0x92')]===_0xd811('0x37')?'QueueCampaigns':_[_0xd811('0x1b')](_0x269eee)+_0xd811('0x1c'),'type':_0x3c64d8['query'][_0xd811('0x92')],'nolimit':!![],'sort':_0xd811('0x12'),'filter':_0x3c64d8[_0xd811('0x8a')]['filter']}};return db[_0xd811('0xa2')][_0xd811('0x9c')](_0x18bc43);}return db[_0x121870][_0xd811('0x9d')](_0x2b3768);})[_0xd811('0x15')](function(_0x25832d){_0x4d5f03[_0xd811('0xb')]=_0x25832d[_0xd811('0xb')];_0x26726d=_0x25832d[_0xd811('0x9e')];return getRealtimeQueues(_0x3c64d8,_0x269eee);})[_0xd811('0x15')](function(_0x5a5433){_0x1172bf=_0x5a5433[_0xd811('0x9e')];return getRealtimeAgents();})['then'](function(_0x1bca32){_0x3a1427=_0x1bca32[_0xd811('0x9e')];if(_0x269eee!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xd811('0x15')](function(_0x341118){_0x2f8166=_0x341118?_0x341118['rows']:[];return initializeQueues(_0x26726d,_0x1172bf,_0x269eee,_0x3c64d8['query'][_0xd811('0x92')]);})[_0xd811('0x15')](function(_0x25af85){var _0x20a2c9=_0x25af85['map'](function(_0x55453b){if(_0x269eee===_0xd811('0x1a'))return getVoiceQueueAgents(_0x55453b,_0x26726d,_0x3a1427,_0x2f8166);else return getQueueAgents(_0x55453b,_0x3a1427,_0x269eee);});return Promise[_0xd811('0x67')](_0x20a2c9);})['then'](function(_0x2b6e9c){_0x4d5f03[_0xd811('0x9e')]=_0x2b6e9c;return _0x4d5f03;})[_0xd811('0x15')](respondWithFilteredResult(_0xa37845,_0x2b3768))['catch'](handleError(_0xa37845,null));};
\ No newline at end of file
index bf6c650..332e6a1 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(_0x240b84,_0x1990e6){var _0x502ab7=function(_0x4e2df6){while(--_0x4e2df6){_0x240b84['push'](_0x240b84['shift']());}};_0x502ab7(++_0x1990e6);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x156a77,_0x522c13){var _0x32398a=function(_0x55a47a){while(--_0x55a47a){_0x156a77['push'](_0x156a77['shift']());}};_0x32398a(++_0x522c13);}(_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
index 42d3183..514e186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26d1=['STRING','DATE','sequelize','INTEGER'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x26d1,0x8e));var _0x126d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x26d1[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x126d('0x0'));module['exports']={'state':{'type':Sequelize[_0x126d('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x126d('0x2')]},'scheduledat':{'type':Sequelize[_0x126d('0x3')]},'uniqueid':{'type':Sequelize[_0x126d('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x126d('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x126d('0x2')]},'membername':{'type':Sequelize[_0x126d('0x2')]}};
\ No newline at end of file
+var _0xec46=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x5277b7,_0x164465){var _0x1e9da2=function(_0x1cc79d){while(--_0x1cc79d){_0x5277b7['push'](_0x5277b7['shift']());}};_0x1e9da2(++_0x164465);}(_0xec46,0x19c));var _0x6ec4=function(_0x14806a,_0x14d122){_0x14806a=_0x14806a-0x0;var _0x12e125=_0xec46[_0x14806a];return _0x12e125;};'use strict';var Sequelize=require(_0x6ec4('0x0'));module[_0x6ec4('0x1')]={'state':{'type':Sequelize[_0x6ec4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6ec4('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6ec4('0x4')]},'responsetime':{'type':Sequelize[_0x6ec4('0x4')]},'ringtime':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6ec4('0x3')]},'membername':{'type':Sequelize[_0x6ec4('0x3')]}};
\ No newline at end of file
index f34dd54..9190c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e2a=['path','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','moment','bluebird','request-promise'];(function(_0x5c5e95,_0x740a18){var _0x55c9aa=function(_0x52c94e){while(--_0x52c94e){_0x5c5e95['push'](_0x5c5e95['shift']());}};_0x55c9aa(++_0x740a18);}(_0x5e2a,0xcb));var _0xa5e2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa5e2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa5e2('0x1'));var BPromise=require(_0xa5e2('0x2'));var rp=require(_0xa5e2('0x3'));var fs=require('fs');var path=require(_0xa5e2('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa5e2('0x5'));module['exports']=function(_0x2bfa08,_0x147ad0){return _0x2bfa08[_0xa5e2('0x6')](_0xa5e2('0x7'),attributes,{'tableName':_0xa5e2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fb2=['moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api'];(function(_0x344fc4,_0x3d6c88){var _0x73afb0=function(_0x211ab6){while(--_0x211ab6){_0x344fc4['push'](_0x344fc4['shift']());}};_0x73afb0(++_0x3d6c88);}(_0x3fb2,0x65));var _0x23fb=function(_0x23b577,_0x4fc2ef){_0x23b577=_0x23b577-0x0;var _0x15862e=_0x3fb2[_0x23b577];return _0x15862e;};'use strict';var _=require(_0x23fb('0x0'));var util=require('util');var logger=require(_0x23fb('0x1'))(_0x23fb('0x2'));var moment=require(_0x23fb('0x3'));var BPromise=require('bluebird');var rp=require(_0x23fb('0x4'));var fs=require('fs');var path=require(_0x23fb('0x5'));var rimraf=require(_0x23fb('0x6'));var config=require(_0x23fb('0x7'));var attributes=require(_0x23fb('0x8'));module[_0x23fb('0x9')]=function(_0x4dca60,_0x2ff640){return _0x4dca60[_0x23fb('0xa')](_0x23fb('0xb'),attributes,{'tableName':_0x23fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ec39240..b777e0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc28=['result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5e93e6,_0x55e077){var _0x371dc2=function(_0xf56f2b){while(--_0xf56f2b){_0x5e93e6['push'](_0x5e93e6['shift']());}};_0x371dc2(++_0x55e077);}(_0xbc28,0xf9));var _0x8bc2=function(_0x10443d,_0x3cb00e){_0x10443d=_0x10443d-0x0;var _0x575af7=_0xbc28[_0x10443d];return _0x575af7;};'use strict';var _=require(_0x8bc2('0x0'));var util=require(_0x8bc2('0x1'));var moment=require(_0x8bc2('0x2'));var BPromise=require(_0x8bc2('0x3'));var rs=require(_0x8bc2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bc2('0x5'))['db'];var utils=require(_0x8bc2('0x6'));var logger=require(_0x8bc2('0x7'))('rpc');var config=require(_0x8bc2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8bc2('0x9')][_0x8bc2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x598f57,_0x232bc3,_0x58a558){return new BPromise(function(_0x58ed83,_0x36e760){return client[_0x8bc2('0xb')](_0x598f57,_0x58a558)['then'](function(_0x185c0d){logger[_0x8bc2('0xc')](_0x8bc2('0xd'),_0x232bc3,_0x8bc2('0xe'));logger[_0x8bc2('0xf')](_0x8bc2('0x10'),_0x232bc3,'request\x20sent',JSON[_0x8bc2('0x11')](_0x185c0d));if(_0x185c0d['error']){if(_0x185c0d[_0x8bc2('0x12')][_0x8bc2('0x13')]===0x1f4){logger['error'](_0x8bc2('0xd'),_0x232bc3,_0x185c0d['error'][_0x8bc2('0x14')]);return _0x36e760(_0x185c0d[_0x8bc2('0x12')][_0x8bc2('0x14')]);}logger[_0x8bc2('0x12')](_0x8bc2('0xd'),_0x232bc3,_0x185c0d[_0x8bc2('0x12')][_0x8bc2('0x14')]);return _0x58ed83(_0x185c0d[_0x8bc2('0x12')]['message']);}else{logger[_0x8bc2('0xc')](_0x8bc2('0xd'),_0x232bc3,_0x8bc2('0xe'));_0x58ed83(_0x185c0d[_0x8bc2('0x15')][_0x8bc2('0x14')]);}})[_0x8bc2('0x16')](function(_0x5818fa){logger[_0x8bc2('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x232bc3,_0x5818fa);_0x36e760(_0x5818fa);});});}exports[_0x8bc2('0x17')]=function(_0x474ea4){var _0x1aef61=this;return new Promise(function(_0x5a88f9,_0x55fb80){return db[_0x8bc2('0x18')][_0x8bc2('0x19')](_0x474ea4[_0x8bc2('0x1a')],{'raw':_0x474ea4[_0x8bc2('0x1b')]?_0x474ea4['options'][_0x8bc2('0x1c')]===undefined?!![]:![]:!![]})[_0x8bc2('0x1d')](function(_0xdf75b9){logger[_0x8bc2('0xc')](_0x8bc2('0x17'),_0x474ea4);logger[_0x8bc2('0xf')]('CreateReportAgentPreview',_0x474ea4,JSON[_0x8bc2('0x11')](_0xdf75b9));_0x5a88f9(_0xdf75b9);})[_0x8bc2('0x16')](function(_0x23e437){logger[_0x8bc2('0x12')](_0x8bc2('0x17'),_0x23e437[_0x8bc2('0x14')],_0x474ea4);_0x55fb80(_0x1aef61[_0x8bc2('0x12')](0x1f4,_0x23e437[_0x8bc2('0x14')]));});});};
\ No newline at end of file
+var _0xaa00=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0xaa00,0xe8));var _0x0aa0=function(_0x17d0f5,_0x3c6c91){_0x17d0f5=_0x17d0f5-0x0;var _0x56035b=_0xaa00[_0x17d0f5];return _0x56035b;};'use strict';var _=require(_0x0aa0('0x0'));var util=require('util');var moment=require(_0x0aa0('0x1'));var BPromise=require(_0x0aa0('0x2'));var rs=require(_0x0aa0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0aa0('0x4'))['db'];var utils=require(_0x0aa0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0aa0('0x6'));var jayson=require(_0x0aa0('0x7'));var client=jayson[_0x0aa0('0x8')][_0x0aa0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56fe59,_0x4b1ef4,_0x46be3c){return new BPromise(function(_0x24d41c,_0x2d5c34){return client[_0x0aa0('0xa')](_0x56fe59,_0x46be3c)[_0x0aa0('0xb')](function(_0x5dc7e2){logger['info'](_0x0aa0('0xc'),_0x4b1ef4,'request\x20sent');logger[_0x0aa0('0xd')](_0x0aa0('0xe'),_0x4b1ef4,_0x0aa0('0xf'),JSON[_0x0aa0('0x10')](_0x5dc7e2));if(_0x5dc7e2[_0x0aa0('0x11')]){if(_0x5dc7e2['error'][_0x0aa0('0x12')]===0x1f4){logger[_0x0aa0('0x11')](_0x0aa0('0xc'),_0x4b1ef4,_0x5dc7e2[_0x0aa0('0x11')]['message']);return _0x2d5c34(_0x5dc7e2['error']['message']);}logger[_0x0aa0('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x4b1ef4,_0x5dc7e2[_0x0aa0('0x11')][_0x0aa0('0x13')]);return _0x24d41c(_0x5dc7e2[_0x0aa0('0x11')][_0x0aa0('0x13')]);}else{logger[_0x0aa0('0x14')](_0x0aa0('0xc'),_0x4b1ef4,'request\x20sent');_0x24d41c(_0x5dc7e2[_0x0aa0('0x15')][_0x0aa0('0x13')]);}})[_0x0aa0('0x16')](function(_0x5d2325){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x4b1ef4,_0x5d2325);_0x2d5c34(_0x5d2325);});});}exports[_0x0aa0('0x17')]=function(_0x3222dc){var _0xaaa800=this;return new Promise(function(_0x31e2df,_0x2e010f){return db[_0x0aa0('0x18')][_0x0aa0('0x19')](_0x3222dc[_0x0aa0('0x1a')],{'raw':_0x3222dc[_0x0aa0('0x1b')]?_0x3222dc[_0x0aa0('0x1b')][_0x0aa0('0x1c')]===undefined?!![]:![]:!![]})[_0x0aa0('0xb')](function(_0x255231){logger[_0x0aa0('0x14')](_0x0aa0('0x17'),_0x3222dc);logger[_0x0aa0('0xd')](_0x0aa0('0x17'),_0x3222dc,JSON[_0x0aa0('0x10')](_0x255231));_0x31e2df(_0x255231);})[_0x0aa0('0x16')](function(_0x112588){logger[_0x0aa0('0x11')](_0x0aa0('0x17'),_0x112588[_0x0aa0('0x13')],_0x3222dc);_0x2e010f(_0xaaa800[_0x0aa0('0x11')](0x1f4,_0x112588[_0x0aa0('0x13')]));});});};
\ No newline at end of file
index b8c6063..89aa641 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8e8=['chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues'];(function(_0x3cba1d,_0x2825ae){var _0x5f192b=function(_0x32ff5d){while(--_0x32ff5d){_0x3cba1d['push'](_0x3cba1d['shift']());}};_0x5f192b(++_0x2825ae);}(_0xf8e8,0x100));var _0x8f8e=function(_0x5ea651,_0x1628df){_0x5ea651=_0x5ea651-0x0;var _0x14fe9a=_0xf8e8[_0x5ea651];return _0x14fe9a;};'use strict';var multer=require('multer');var util=require(_0x8f8e('0x0'));var path=require('path');var express=require(_0x8f8e('0x1'));var router=express[_0x8f8e('0x2')]();var auth=require(_0x8f8e('0x3'));var controller=require(_0x8f8e('0x4'));router['get'](_0x8f8e('0x5'),auth['isAuthenticated'](),controller[_0x8f8e('0x6')]);router['get'](_0x8f8e('0x7'),auth[_0x8f8e('0x8')](),controller['voiceChannelMixMonitor']);router[_0x8f8e('0x9')](_0x8f8e('0xa'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0xb')]);router['get'](_0x8f8e('0xc'),auth['isAuthenticated'](),controller[_0x8f8e('0xd')]);router[_0x8f8e('0x9')](_0x8f8e('0xe'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0xf')]);router[_0x8f8e('0x9')](_0x8f8e('0x10'),auth[_0x8f8e('0x8')](),controller['mailQueues']);router[_0x8f8e('0x9')](_0x8f8e('0x11'),auth[_0x8f8e('0x8')](),controller['mailAccounts']);router['get'](_0x8f8e('0x12'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x13')]);router[_0x8f8e('0x9')](_0x8f8e('0x14'),auth['isAuthenticated'](),controller[_0x8f8e('0x15')]);router['get']('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x8f8e('0x16')]);router[_0x8f8e('0x9')]('/fax/queues',auth[_0x8f8e('0x8')](),controller['faxQueues']);router[_0x8f8e('0x9')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x8f8e('0x9')](_0x8f8e('0x17'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x18')]);router[_0x8f8e('0x9')](_0x8f8e('0x19'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x1a')]);router[_0x8f8e('0x9')](_0x8f8e('0x1b'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x1c')]);router[_0x8f8e('0x9')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x1d')]);router['get'](_0x8f8e('0x1e'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x1f')]);router[_0x8f8e('0x20')](_0x8f8e('0x1e'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x21')]);router[_0x8f8e('0x9')](_0x8f8e('0x22'),auth[_0x8f8e('0x8')](),controller['outbound']);router[_0x8f8e('0x9')](_0x8f8e('0x23'),auth[_0x8f8e('0x8')](),controller['outboundChannels']);router[_0x8f8e('0x9')](_0x8f8e('0x24'),auth['isAuthenticated'](),controller[_0x8f8e('0x25')]);router[_0x8f8e('0x20')](_0x8f8e('0x26'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x27')]);router['get'](_0x8f8e('0x28'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x29')]);router[_0x8f8e('0x9')](_0x8f8e('0x2a'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x2b')]);router[_0x8f8e('0x9')](_0x8f8e('0x2c'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x2d')]);router[_0x8f8e('0x9')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router['get'](_0x8f8e('0x2e'),auth[_0x8f8e('0x8')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x2f')]);router[_0x8f8e('0x9')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0x8f8e('0x9')](_0x8f8e('0x30'),auth['isAuthenticated'](),controller[_0x8f8e('0x31')]);router[_0x8f8e('0x9')](_0x8f8e('0x32'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x33')]);router['get'](_0x8f8e('0x34'),auth['isAuthenticated'](),controller[_0x8f8e('0x35')]);router[_0x8f8e('0x9')]('/fax/queues/waitinginteractions',auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x36')]);router[_0x8f8e('0x37')](_0x8f8e('0x38'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x39')]('mail'));router[_0x8f8e('0x9')](_0x8f8e('0x3a'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x3b')]);router[_0x8f8e('0x37')]('/chat/queues/:id/notify',auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x39')](_0x8f8e('0x3c')));router[_0x8f8e('0x9')](_0x8f8e('0x3d'),auth['isAuthenticated'](),controller[_0x8f8e('0x3e')]);router['post'](_0x8f8e('0x3f'),auth[_0x8f8e('0x8')](),controller['queueNotify'](_0x8f8e('0x40')));router[_0x8f8e('0x9')]('/fax/queues/:id',auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x41')]);router[_0x8f8e('0x37')]('/openchannel/queues/:id/notify',auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x39')](_0x8f8e('0x42')));router['get'](_0x8f8e('0x43'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x44')]);router['post'](_0x8f8e('0x45'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x39')](_0x8f8e('0x46')));router[_0x8f8e('0x37')]('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x8f8e('0x39')](_0x8f8e('0x47')));router['get'](_0x8f8e('0x48'),auth['isAuthenticated'](),controller[_0x8f8e('0x49')]);router[_0x8f8e('0x9')](_0x8f8e('0x4a'),auth[_0x8f8e('0x8')](),controller[_0x8f8e('0x4b')]);router[_0x8f8e('0x37')](_0x8f8e('0x4c'),auth['isAuthenticated'](),controller[_0x8f8e('0x4d')]);module[_0x8f8e('0x4e')]=router;
\ No newline at end of file
+var _0x2f46=['voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2f46,0x129));var _0x62f4=function(_0x2cccab,_0x436228){_0x2cccab=_0x2cccab-0x0;var _0x39bff4=_0x2f46[_0x2cccab];return _0x39bff4;};'use strict';var multer=require(_0x62f4('0x0'));var util=require(_0x62f4('0x1'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0x62f4('0x2'));var controller=require(_0x62f4('0x3'));router[_0x62f4('0x4')](_0x62f4('0x5'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x7')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router['get'](_0x62f4('0x8'),auth['isAuthenticated'](),controller[_0x62f4('0x9')]);router['get'](_0x62f4('0xa'),auth['isAuthenticated'](),controller[_0x62f4('0xb')]);router[_0x62f4('0x4')]('/chat/queues',auth[_0x62f4('0x6')](),controller[_0x62f4('0xc')]);router[_0x62f4('0x4')](_0x62f4('0xd'),auth[_0x62f4('0x6')](),controller[_0x62f4('0xe')]);router[_0x62f4('0x4')](_0x62f4('0xf'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x10')]);router[_0x62f4('0x4')](_0x62f4('0x11'),auth[_0x62f4('0x6')](),controller['openchannelQueues']);router['get'](_0x62f4('0x12'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x13')]);router['get'](_0x62f4('0x14'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x15')]);router[_0x62f4('0x4')]('/fax/queues',auth[_0x62f4('0x6')](),controller[_0x62f4('0x16')]);router[_0x62f4('0x4')]('/voice/queues/preview/:id',auth[_0x62f4('0x6')](),controller[_0x62f4('0x17')]);router['get'](_0x62f4('0x18'),auth[_0x62f4('0x6')](),controller['voiceQueuesChannels']);router[_0x62f4('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x62f4('0x19')]);router['get'](_0x62f4('0x1a'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x1b')]);router[_0x62f4('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x62f4('0x6')](),controller[_0x62f4('0x1c')]);router['get'](_0x62f4('0x1d'),auth['isAuthenticated'](),controller[_0x62f4('0x1e')]);router['put'](_0x62f4('0x1d'),auth['isAuthenticated'](),controller[_0x62f4('0x1f')]);router['get'](_0x62f4('0x20'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x21')]);router[_0x62f4('0x4')](_0x62f4('0x22'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x23')]);router[_0x62f4('0x4')](_0x62f4('0x24'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x25')]);router[_0x62f4('0x26')]('/agents/:id/capacity',auth[_0x62f4('0x6')](),controller[_0x62f4('0x27')]);router[_0x62f4('0x4')](_0x62f4('0x28'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x29')]);router['get'](_0x62f4('0x2a'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x2b')]);router[_0x62f4('0x4')](_0x62f4('0x2c'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x2d')]);router[_0x62f4('0x4')](_0x62f4('0x2e'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x2f')]);router[_0x62f4('0x4')](_0x62f4('0x30'),auth['isAuthenticated'](),controller[_0x62f4('0x31')]);router['get'](_0x62f4('0x32'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x33')]);router[_0x62f4('0x4')]('/openchannel/queues/waitinginteractions',auth[_0x62f4('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x62f4('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x62f4('0x6')](),controller[_0x62f4('0x34')]);router[_0x62f4('0x4')](_0x62f4('0x35'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x36')]);router[_0x62f4('0x4')](_0x62f4('0x37'),auth['isAuthenticated'](),controller[_0x62f4('0x38')]);router[_0x62f4('0x4')]('/fax/queues/waitinginteractions',auth[_0x62f4('0x6')](),controller['faxQueuesWaitingInteractions']);router[_0x62f4('0x39')]('/mail/queues/:id/notify',auth[_0x62f4('0x6')](),controller[_0x62f4('0x3a')](_0x62f4('0x3b')));router[_0x62f4('0x4')](_0x62f4('0x3c'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x3d')]);router[_0x62f4('0x39')](_0x62f4('0x3e'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x3a')](_0x62f4('0x3f')));router[_0x62f4('0x4')](_0x62f4('0x40'),auth[_0x62f4('0x6')](),controller['showChatQueues']);router[_0x62f4('0x39')](_0x62f4('0x41'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x3a')](_0x62f4('0x42')));router[_0x62f4('0x4')](_0x62f4('0x43'),auth['isAuthenticated'](),controller[_0x62f4('0x44')]);router[_0x62f4('0x39')](_0x62f4('0x45'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x3a')]('openchannel'));router[_0x62f4('0x4')](_0x62f4('0x46'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x47')]);router[_0x62f4('0x39')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x62f4('0x48')));router['post']('/whatsapp/queues/:id/notify',auth[_0x62f4('0x6')](),controller['queueNotify'](_0x62f4('0x49')));router[_0x62f4('0x4')](_0x62f4('0x4a'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x4b')]);router[_0x62f4('0x4')](_0x62f4('0x4c'),auth[_0x62f4('0x6')](),controller[_0x62f4('0x4d')]);router['post']('/agents/:id/notify',auth[_0x62f4('0x6')](),controller[_0x62f4('0x4e')]);module[_0x62f4('0x4f')]=router;
\ No newline at end of file
index bec19af..71dfe08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac9d=['SIP/%s','INTERACTION','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','find','rows','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','findOrCreate','interface','format'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0xac9d,0x14d));var _0xdac9=function(_0x146214,_0x13482f){_0x146214=_0x146214-0x0;var _0x2c2acb=_0xac9d[_0x146214];return _0x2c2acb;};'use strict';var BPromise=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var _=require(_0xdac9('0x2'));var util=require(_0xdac9('0x3'));var db=require(_0xdac9('0x4'))['db'];var logger=require(_0xdac9('0x5'))(_0xdac9('0x6'));var jayson=require(_0xdac9('0x7'));var amiClient=jayson['client'][_0xdac9('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xdac9('0x8')]({'port':0x232b});var routingClient=jayson[_0xdac9('0x9')][_0xdac9('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){var _0x47d9fd=_0x39f560?_0x39f560:amiClient;return _0x47d9fd[_0xdac9('0xa')](_0x776b6c,_0x1c78c5)[_0xdac9('0xb')](function(_0x39c92c){if(_0x39c92c[_0xdac9('0xc')]){if(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xd')]===0x1f4){return _0x2b1d6f(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xe')]);}return _0x5531af(_0x39c92c[_0xdac9('0xc')]['message']);}else{_0x5531af(_0x39c92c[_0xdac9('0xf')]);}})[_0xdac9('0x10')](function(_0x5a9bde){_0x2b1d6f(_0x5a9bde);});});}function respondWithResult(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xc8;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['status'](_0xeddbc1)[_0xdac9('0x11')](_0xbfe6d8);}return _0x3d8e97[_0xdac9('0x12')](0x194);};}function handleError(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0x1f4;return function(_0x5dd536){logger[_0xdac9('0xc')](_0x5dd536[_0xdac9('0x13')]);if(_0x5dd536['name']){delete _0x5dd536[_0xdac9('0x14')];}_0x9e1bf6[_0xdac9('0x15')](_0x5f0bbd)[_0xdac9('0x16')](_0x5dd536);};}function findById(_0x5b2f1b){return function(_0x2221f8){if(!_[_0xdac9('0x17')](_0x5b2f1b)&&!_[_0xdac9('0x17')](_0x2221f8)&&!_[_0xdac9('0x17')](_0x2221f8['rows'])){return _[_0xdac9('0x18')](_0x2221f8[_0xdac9('0x19')],function(_0x571e07){return _0x571e07['id']==_0x5b2f1b;});}return null;};}exports[_0xdac9('0x1a')]=function(_0xa57f2d,_0x171df1){return respondWithRpcPromise(_0xdac9('0x1b'),_0xa57f2d['query'])['then'](respondWithResult(_0x171df1,null))[_0xdac9('0x10')](handleError(_0x171df1,null));};exports[_0xdac9('0x1c')]=function(_0x2b9d91,_0x395ec7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xdac9('0x1d')](_0x2b9d91[_0xdac9('0x1e')],_0x2b9d91[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x395ec7,null))[_0xdac9('0x10')](handleError(_0x395ec7,null));};exports[_0xdac9('0x20')]=function(_0x41335a,_0xa1f726){return respondWithRpcPromise(_0xdac9('0x21'),_[_0xdac9('0x1d')](_0x41335a['query'],_0x41335a[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0xa1f726,null))[_0xdac9('0x10')](handleError(_0xa1f726,null));};exports[_0xdac9('0x22')]=function(_0x5ca076,_0x1e631a){return respondWithRpcPromise('VoiceQueues',_0x5ca076[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x1e631a,null))['catch'](handleError(_0x1e631a,null));};exports[_0xdac9('0x23')]=function(_0x5105f1,_0x450f91){return respondWithRpcPromise(_0xdac9('0x24'),_0x5105f1[_0xdac9('0x1e')])[_0xdac9('0xb')](findById(_0x5105f1['params']['id']))['then'](respondWithResult(_0x450f91,null))[_0xdac9('0x10')](handleError(_0x450f91,null));};exports[_0xdac9('0x25')]=function(_0x4fe3bd,_0x4c4e21){return respondWithRpcPromise(_0xdac9('0x26'),_[_0xdac9('0x1d')](_0x4fe3bd[_0xdac9('0x27')],_0x4fe3bd[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x4c4e21,null))[_0xdac9('0x10')](handleError(_0x4c4e21,null));};exports[_0xdac9('0x28')]=function(_0x2cda4d,_0x406ed0){return respondWithRpcPromise(_0xdac9('0x29'),_[_0xdac9('0x1d')](_0x2cda4d[_0xdac9('0x1e')],_0x2cda4d[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x406ed0,null))[_0xdac9('0x10')](handleError(_0x406ed0,null));};exports[_0xdac9('0x2a')]=function(_0x372f02,_0x44eff2){return respondWithRpcPromise(_0xdac9('0x2b'),_0x372f02[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x44eff2,null))['catch'](handleError(_0x44eff2,null));};exports['voiceQueuesChannel']=function(_0x1e6832,_0x416501){return respondWithRpcPromise(_0xdac9('0x2c'),_[_0xdac9('0x1d')](_0x1e6832[_0xdac9('0x1e')],_0x1e6832['params']))[_0xdac9('0xb')](respondWithResult(_0x416501,null))['catch'](handleError(_0x416501,null));};exports[_0xdac9('0x2d')]=function(_0x2a611e,_0x5cfebf){return respondWithRpcPromise(_0xdac9('0x2e'),_['merge'](_0x2a611e['query'],_0x2a611e[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x5cfebf,null))[_0xdac9('0x10')](handleError(_0x5cfebf,null));};exports[_0xdac9('0x2f')]=function(_0x3bab10,_0x363d93){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xdac9('0x1d')](_0x3bab10[_0xdac9('0x1e')],_0x3bab10['params']))[_0xdac9('0xb')](respondWithResult(_0x363d93,null))[_0xdac9('0x10')](handleError(_0x363d93,null));};exports[_0xdac9('0x30')]=function(_0x27bdfb,_0x35aa58){return respondWithRpcPromise(_0xdac9('0x31'),_0x27bdfb[_0xdac9('0x1e')])['then'](respondWithResult(_0x35aa58,null))[_0xdac9('0x10')](handleError(_0x35aa58,null));};exports[_0xdac9('0x32')]=function(_0x238769,_0x4b6b09){return respondWithRpcPromise(_0xdac9('0x33'),_0x238769[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4b6b09,null))[_0xdac9('0x10')](handleError(_0x4b6b09,null));};exports['agents']=function(_0x58fd14,_0x1d0243){var _0xe47a3c;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14[_0xdac9('0x1e')])[_0xdac9('0xb')](function(_0x579581){_0xe47a3c=_0x579581;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14['query'],routingClient);})[_0xdac9('0xb')](function(_0xaca43c){return _[_0xdac9('0x1d')]({},_0xaca43c,_0xe47a3c);})[_0xdac9('0xb')](respondWithResult(_0x1d0243,null))[_0xdac9('0x10')](handleError(_0x1d0243,null));};exports[_0xdac9('0x35')]=function(_0x413fb1,_0xb176e0){if(_0x413fb1[_0xdac9('0x27')]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]&&_0x413fb1[_0xdac9('0x37')]&&_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]){for(var _0x5335ae in _0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]){if(_0x413fb1['body'][_0xdac9('0x36')][_0xdac9('0x38')](_0x5335ae)){db[_0xdac9('0x39')][_0xdac9('0x3a')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')]?{'$notIn':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]}:{'$ne':null}}})['then'](function(_0x585f08){var _0xcb7b82=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4159fd=0x0,_0x15c332=_0x585f08['length'];_0x4159fd<_0x15c332;_0x4159fd+=0x1){_0x585f08[_0x4159fd]['updateAttributes']({'exitAt':_0xcb7b82});}});for(var _0x1666c5=0x0;_0x1666c5<_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')];_0x1666c5+=0x1){db[_0xdac9('0x39')][_0xdac9('0x3c')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','uniqueid':_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0x1666c5],'exitAt':null},'defaults':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'interface':_[_0xdac9('0x17')](_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')])?util[_0xdac9('0x3e')](_0xdac9('0x3f'),_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]):_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')],'type':_0xdac9('0x40'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x41')],'uniqueid':_0x413fb1['body'][_0xdac9('0x36')][_0x5335ae][_0x1666c5]}});}}}}return respondWithRpcPromise(_0xdac9('0x42'),{'id':_0x413fb1[_0xdac9('0x1f')]['id'],'capacity':_0x413fb1['body'][_0xdac9('0x43')]},routingClient)[_0xdac9('0xb')](respondWithResult(_0xb176e0,null))['catch'](handleError(_0xb176e0,null));};exports['telephones']=function(_0x46f1c0,_0x4469d8){return respondWithRpcPromise(_0xdac9('0x44'),_0x46f1c0[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4469d8,null))[_0xdac9('0x10')](handleError(_0x4469d8,null));};exports[_0xdac9('0x45')]=function(_0x3a77e3,_0x298c72){return respondWithRpcPromise(_0xdac9('0x46'),_0x3a77e3[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x298c72,null))[_0xdac9('0x10')](handleError(_0x298c72,null));};exports[_0xdac9('0x47')]=function(_0x35a378,_0x5d0b43){return respondWithRpcPromise(_0xdac9('0x48'),_0x35a378[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x5d0b43,null))[_0xdac9('0x10')](handleError(_0x5d0b43,null));};exports[_0xdac9('0x49')]=function(_0x3a391a,_0x4b118e){return respondWithRpcPromise(_0xdac9('0x4a'),_0x3a391a[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x4b118e,null))[_0xdac9('0x10')](handleError(_0x4b118e,null));};exports[_0xdac9('0x4b')]=function(_0x2a5bf9,_0x1eec39){return respondWithRpcPromise(_0xdac9('0x4a'),_0x2a5bf9[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2a5bf9[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x1eec39,null))[_0xdac9('0x10')](handleError(_0x1eec39,null));};exports[_0xdac9('0x4c')]=function(_0x2ca15d,_0x21ab3d){return respondWithRpcPromise('MailQueues',_0x2ca15d['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x21ab3d,null))[_0xdac9('0x10')](handleError(_0x21ab3d,null));};exports[_0xdac9('0x4d')]=function(_0x46017d,_0x1c1f5f){return respondWithRpcPromise(_0xdac9('0x4e'),_0x46017d['query'],routingClient)['then'](findById(_0x46017d['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x1c1f5f,null))[_0xdac9('0x10')](handleError(_0x1c1f5f,null));};exports[_0xdac9('0x4f')]=function(_0x2f581b,_0x52ad7b){return respondWithRpcPromise(_0xdac9('0x50'),_0x2f581b[_0xdac9('0x1e')],mailClient)[_0xdac9('0xb')](respondWithResult(_0x52ad7b,null))[_0xdac9('0x10')](handleError(_0x52ad7b,null));};exports[_0xdac9('0x51')]=function(_0x496d9c,_0x19a46e){return respondWithRpcPromise('OpenchannelQueues',_0x496d9c[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x19a46e,null))[_0xdac9('0x10')](handleError(_0x19a46e,null));};exports[_0xdac9('0x52')]=function(_0x2fd7c8,_0x360499){return respondWithRpcPromise(_0xdac9('0x53'),_0x2fd7c8[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x2fd7c8['params']['id']))['then'](respondWithResult(_0x360499,null))['catch'](handleError(_0x360499,null));};exports[_0xdac9('0x54')]=function(_0x42ba53,_0x830d54){return respondWithRpcPromise(_0xdac9('0x55'),_0x42ba53[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x830d54,null))[_0xdac9('0x10')](handleError(_0x830d54,null));};exports['showSmsQueues']=function(_0x2d81fc,_0x5b63d8){return respondWithRpcPromise('SmsQueues',_0x2d81fc[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2d81fc['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x5b63d8,null))[_0xdac9('0x10')](handleError(_0x5b63d8,null));};exports[_0xdac9('0x56')]=function(_0x55ce14,_0x552cac){return respondWithRpcPromise(_0xdac9('0x57'),_0x55ce14[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x552cac,null))[_0xdac9('0x10')](handleError(_0x552cac,null));};exports[_0xdac9('0x58')]=function(_0x26b9b5,_0x272f14){return respondWithRpcPromise(_0xdac9('0x57'),_0x26b9b5[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x26b9b5[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x272f14,null))[_0xdac9('0x10')](handleError(_0x272f14,null));};exports[_0xdac9('0x59')]=function(_0x1e2e7b,_0x5401e6){return respondWithRpcPromise(_0xdac9('0x5a'),_0x1e2e7b['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x5401e6,null))[_0xdac9('0x10')](handleError(_0x5401e6,null));};exports['showFaxQueues']=function(_0x3a6c78,_0x3bee81){return respondWithRpcPromise(_0xdac9('0x5a'),_0x3a6c78[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x3a6c78[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x3bee81,null))[_0xdac9('0x10')](handleError(_0x3bee81,null));};exports[_0xdac9('0x5b')]=function(_0x45f183,_0x263b84){return respondWithRpcPromise(_0xdac9('0x5c'),_0x45f183[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x263b84,null))[_0xdac9('0x10')](handleError(_0x263b84,null));};exports[_0xdac9('0x5d')]=function(_0x4c4a7b,_0x3a457b){return respondWithRpcPromise(_0xdac9('0x5e'),_0x4c4a7b[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x3a457b,null))['catch'](handleError(_0x3a457b,null));};exports[_0xdac9('0x5f')]=function(_0x31f56e,_0x1b6a68){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x31f56e[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x1b6a68,null))['catch'](handleError(_0x1b6a68,null));};exports[_0xdac9('0x60')]=function(_0x1b8ad9,_0x2a4d12){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1b8ad9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x2a4d12,null))[_0xdac9('0x10')](handleError(_0x2a4d12,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5c39e9,_0x108e03){return respondWithRpcPromise(_0xdac9('0x61'),_0x5c39e9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](function(_0x4110da){if(_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')]!==undefined){var _0x2de535=_(_0x4110da[_0xdac9('0x19')])[_0xdac9('0x63')]([_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')],_0x5c39e9[_0xdac9('0x1f')]['id']])['map']('queue_id')[_0xdac9('0x64')]()['value']();return _0x4110da['rows'][_0xdac9('0x63')](function(_0x199518){return _0x2de535[_0xdac9('0x65')](_0x199518[_0xdac9('0x66')])>-0x1;});}else{return _0x4110da['rows'][_0xdac9('0x63')](function(_0xff5be){return _0xff5be[_0xdac9('0x66')]===parseInt(_0x5c39e9['params']['id']);});}})[_0xdac9('0xb')](respondWithResult(_0x108e03,null))[_0xdac9('0x10')](handleError(_0x108e03,null));};exports['smsQueuesWaitingInteractions']=function(_0x3cc0f9,_0x59b5b2){return respondWithRpcPromise(_0xdac9('0x67'),_0x3cc0f9['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x59b5b2,null))[_0xdac9('0x10')](handleError(_0x59b5b2,null));};exports[_0xdac9('0x68')]=function(_0x251011,_0x9981f){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x251011[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x9981f,null))[_0xdac9('0x10')](handleError(_0x9981f,null));};exports[_0xdac9('0x69')]=function(_0x13be64,_0x227857){return respondWithRpcPromise(_0xdac9('0x6a'),_0x13be64[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x227857,null))['catch'](handleError(_0x227857,null));};exports[_0xdac9('0x6b')]=function(_0x300738){return function(_0x12c15b,_0x4f7f63){var _0x571130,_0x5650d1;var _0x5adc83=_['capitalize'](_0x300738);var _0x325407=_0x300738===_0xdac9('0x6c')?_0xdac9('0x6d'):_0xdac9('0x6e');return db[_0x5adc83+'Queue'][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x12c15b['params']['id']}})[_0xdac9('0xb')](function(_0x750de7){if(_[_0xdac9('0x17')](_0x750de7)){throw new Error(_0x5adc83+_0xdac9('0x70'));}_0x571130=_0x750de7;return db[_0x5adc83+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x12c15b[_0xdac9('0x27')][_0xdac9('0x71')]},'include':[{'model':db[_0x5adc83+_0xdac9('0x72')],'as':'Interaction'},{'model':db[_0x5adc83+_0x325407],'as':'Account'}]});})[_0xdac9('0xb')](function(_0x414f8a){if(_[_0xdac9('0x17')](_0x414f8a)){throw new Error(_0x5adc83+'\x20Message\x20not\x20found');}_0x5650d1=_0x414f8a;return _0x414f8a['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x111bff={'uniqueid':_0x300738+'.'+_0x5650d1['id']+'.'+_0x5650d1[_0xdac9('0x72')]['id'],'FromUserId':_0x12c15b[_0xdac9('0x37')]['id'],'type':_0xdac9('0x73')};_0x111bff[_0x5adc83+_0xdac9('0x74')]=_0x5650d1['id'];_0x111bff[_0x5adc83+_0xdac9('0x75')]=_0x5650d1[_0xdac9('0x72')]['id'];_0x111bff[_0xdac9('0x76')+_0x5adc83+_0x325407+'Id']=_0x5650d1[_0xdac9('0x6e')]['id'];_0x111bff['To'+_0x5adc83+_0xdac9('0x77')]=_0x571130['id'];return db[_0x5adc83+_0xdac9('0x78')][_0xdac9('0x79')](_0x111bff);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x300738,'interaction':_0x5650d1[_0xdac9('0x72')],'message':_0x5650d1,'account':_0x5650d1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xdac9('0x73'),'appdata':_0x571130['name']+','+(_0x5650d1[_0xdac9('0x6e')][_0xdac9('0x7b')]||0x12c),'interval':_0xdac9('0x7c')}]},routingClient);})[_0xdac9('0xb')](respondWithResult(_0x4f7f63,null))[_0xdac9('0x10')](handleError(_0x4f7f63,null));};};exports[_0xdac9('0x7d')]=function(_0x232876,_0x4463ca){var _0x171d38,_0x328fa2;if(_[_0xdac9('0x17')](_0x232876['body'][_0xdac9('0x7e')])){throw new Error(_0xdac9('0x7f'));}var _0x284247=_0x232876[_0xdac9('0x27')][_0xdac9('0x7e')];var _0x4d7208=_['capitalize'](_0x284247);var _0x363541=_0x284247==='chat'?'Website':_0xdac9('0x6e');return db[_0xdac9('0x80')][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x232876[_0xdac9('0x1f')]['id'],'role':'agent'}})[_0xdac9('0xb')](function(_0x8f37df){if(_[_0xdac9('0x17')](_0x8f37df)){throw new Error('Agent\x20not\x20found');}_0x171d38=_0x8f37df;return db[_0x4d7208+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x232876[_0xdac9('0x27')]['messageId']},'include':[{'model':db[_0x4d7208+'Interaction'],'as':'Interaction'},{'model':db[_0x4d7208+_0x363541],'as':_0xdac9('0x6e')}]});})[_0xdac9('0xb')](function(_0x131c78){if(_['isNil'](_0x131c78)){throw new Error(_0x4d7208+_0xdac9('0x81'));}_0x328fa2=_0x131c78;return _0x131c78[_0xdac9('0x82')]({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x2ab89f={'uniqueid':_0x284247+'.'+_0x328fa2['id']+'.'+_0x328fa2[_0xdac9('0x72')]['id'],'FromUserId':_0x232876['user']['id'],'type':_0xdac9('0x73'),'ToUserId':_0x171d38['id']};_0x2ab89f[_0x4d7208+_0xdac9('0x74')]=_0x328fa2['id'];_0x2ab89f[_0x4d7208+'InteractionId']=_0x328fa2[_0xdac9('0x72')]['id'];_0x2ab89f[_0xdac9('0x76')+_0x4d7208+_0x363541+'Id']=_0x328fa2[_0xdac9('0x6e')]['id'];return db[_0x4d7208+_0xdac9('0x78')]['create'](_0x2ab89f);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x284247,'interaction':_0x328fa2[_0xdac9('0x72')],'message':_0x328fa2,'account':_0x328fa2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x171d38[_0xdac9('0x14')]+','+(_0x328fa2['Account'][_0xdac9('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x4463ca,null))[_0xdac9('0x10')](handleError(_0x4463ca,null));};
\ No newline at end of file
+var _0xac31=['MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','value','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','TransferReport','create','Start','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','catch','status','json','sendStatus','name','isNil','find','rows','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user'];(function(_0x4710a5,_0x59128d){var _0x3a0d10=function(_0x73ee2a){while(--_0x73ee2a){_0x4710a5['push'](_0x4710a5['shift']());}};_0x3a0d10(++_0x59128d);}(_0xac31,0xca));var _0x1ac3=function(_0x5a06db,_0x179165){_0x5a06db=_0x5a06db-0x0;var _0x8f986b=_0xac31[_0x5a06db];return _0x8f986b;};'use strict';var BPromise=require(_0x1ac3('0x0'));var moment=require(_0x1ac3('0x1'));var _=require(_0x1ac3('0x2'));var util=require(_0x1ac3('0x3'));var db=require(_0x1ac3('0x4'))['db'];var logger=require(_0x1ac3('0x5'))(_0x1ac3('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x1ac3('0x7')][_0x1ac3('0x8')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x1ac3('0x7')][_0x1ac3('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){var _0x4d7695=_0x157604?_0x157604:amiClient;return _0x4d7695[_0x1ac3('0x9')](_0x2bf9b1,_0x1be223)[_0x1ac3('0xa')](function(_0x344674){if(_0x344674['error']){if(_0x344674[_0x1ac3('0xb')][_0x1ac3('0xc')]===0x1f4){return _0x2d17de(_0x344674[_0x1ac3('0xb')][_0x1ac3('0xd')]);}return _0x57893c(_0x344674[_0x1ac3('0xb')][_0x1ac3('0xd')]);}else{_0x57893c(_0x344674['result']);}})[_0x1ac3('0xe')](function(_0x376814){_0x2d17de(_0x376814);});});}function respondWithResult(_0x2eeabf,_0x2338b9){_0x2338b9=_0x2338b9||0xc8;return function(_0x50d3b6){if(_0x50d3b6){return _0x2eeabf[_0x1ac3('0xf')](_0x2338b9)[_0x1ac3('0x10')](_0x50d3b6);}return _0x2eeabf[_0x1ac3('0x11')](0x194);};}function handleError(_0x2def9f,_0x53cc35){_0x53cc35=_0x53cc35||0x1f4;return function(_0x24bb5e){logger[_0x1ac3('0xb')](_0x24bb5e['stack']);if(_0x24bb5e[_0x1ac3('0x12')]){delete _0x24bb5e[_0x1ac3('0x12')];}_0x2def9f[_0x1ac3('0xf')](_0x53cc35)['send'](_0x24bb5e);};}function findById(_0x2f14ca){return function(_0x8590ce){if(!_[_0x1ac3('0x13')](_0x2f14ca)&&!_['isNil'](_0x8590ce)&&!_[_0x1ac3('0x13')](_0x8590ce['rows'])){return _[_0x1ac3('0x14')](_0x8590ce[_0x1ac3('0x15')],function(_0x20091d){return _0x20091d['id']==_0x2f14ca;});}return null;};}exports[_0x1ac3('0x16')]=function(_0x18b985,_0x557076){return respondWithRpcPromise(_0x1ac3('0x17'),_0x18b985[_0x1ac3('0x18')])[_0x1ac3('0xa')](respondWithResult(_0x557076,null))[_0x1ac3('0xe')](handleError(_0x557076,null));};exports['voiceChannelMixMonitor']=function(_0x48d18a,_0x2879d8){return respondWithRpcPromise(_0x1ac3('0x19'),_[_0x1ac3('0x1a')](_0x48d18a[_0x1ac3('0x18')],_0x48d18a[_0x1ac3('0x1b')]))[_0x1ac3('0xa')](respondWithResult(_0x2879d8,null))[_0x1ac3('0xe')](handleError(_0x2879d8,null));};exports[_0x1ac3('0x1c')]=function(_0x3d30b8,_0x565141){return respondWithRpcPromise(_0x1ac3('0x1d'),_[_0x1ac3('0x1a')](_0x3d30b8['query'],_0x3d30b8[_0x1ac3('0x1b')]))[_0x1ac3('0xa')](respondWithResult(_0x565141,null))['catch'](handleError(_0x565141,null));};exports[_0x1ac3('0x1e')]=function(_0x2f65e8,_0x145486){return respondWithRpcPromise(_0x1ac3('0x1f'),_0x2f65e8[_0x1ac3('0x18')])['then'](respondWithResult(_0x145486,null))['catch'](handleError(_0x145486,null));};exports['showVoiceQueues']=function(_0x528807,_0x52a1a5){return respondWithRpcPromise(_0x1ac3('0x1f'),_0x528807['query'])[_0x1ac3('0xa')](findById(_0x528807[_0x1ac3('0x1b')]['id']))[_0x1ac3('0xa')](respondWithResult(_0x52a1a5,null))[_0x1ac3('0xe')](handleError(_0x52a1a5,null));};exports['updateVoiceQueue']=function(_0x61441d,_0x541da0){return respondWithRpcPromise(_0x1ac3('0x20'),_[_0x1ac3('0x1a')](_0x61441d[_0x1ac3('0x21')],_0x61441d[_0x1ac3('0x1b')]))[_0x1ac3('0xa')](respondWithResult(_0x541da0,null))[_0x1ac3('0xe')](handleError(_0x541da0,null));};exports[_0x1ac3('0x22')]=function(_0x5351b2,_0x2248b6){return respondWithRpcPromise(_0x1ac3('0x23'),_[_0x1ac3('0x1a')](_0x5351b2[_0x1ac3('0x18')],_0x5351b2['params']))[_0x1ac3('0xa')](respondWithResult(_0x2248b6,null))[_0x1ac3('0xe')](handleError(_0x2248b6,null));};exports[_0x1ac3('0x24')]=function(_0x294513,_0x204d78){return respondWithRpcPromise('VoiceQueuesChannels',_0x294513[_0x1ac3('0x18')])[_0x1ac3('0xa')](respondWithResult(_0x204d78,null))[_0x1ac3('0xe')](handleError(_0x204d78,null));};exports[_0x1ac3('0x25')]=function(_0x1a47d4,_0x43362a){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x1ac3('0x1a')](_0x1a47d4[_0x1ac3('0x18')],_0x1a47d4[_0x1ac3('0x1b')]))[_0x1ac3('0xa')](respondWithResult(_0x43362a,null))['catch'](handleError(_0x43362a,null));};exports[_0x1ac3('0x26')]=function(_0x22404f,_0x2259f5){return respondWithRpcPromise(_0x1ac3('0x27'),_[_0x1ac3('0x1a')](_0x22404f[_0x1ac3('0x18')],_0x22404f[_0x1ac3('0x1b')]))[_0x1ac3('0xa')](respondWithResult(_0x2259f5,null))[_0x1ac3('0xe')](handleError(_0x2259f5,null));};exports['voiceQueuesChannelRedirect']=function(_0xe6f9c0,_0x27b017){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x1ac3('0x1a')](_0xe6f9c0[_0x1ac3('0x18')],_0xe6f9c0[_0x1ac3('0x1b')]))[_0x1ac3('0xa')](respondWithResult(_0x27b017,null))[_0x1ac3('0xe')](handleError(_0x27b017,null));};exports[_0x1ac3('0x28')]=function(_0x1c8bf5,_0xa15199){return respondWithRpcPromise('Outbound',_0x1c8bf5[_0x1ac3('0x18')])['then'](respondWithResult(_0xa15199,null))[_0x1ac3('0xe')](handleError(_0xa15199,null));};exports[_0x1ac3('0x29')]=function(_0x2d449e,_0x1e2f5e){return respondWithRpcPromise(_0x1ac3('0x2a'),_0x2d449e[_0x1ac3('0x18')])['then'](respondWithResult(_0x1e2f5e,null))[_0x1ac3('0xe')](handleError(_0x1e2f5e,null));};exports[_0x1ac3('0x2b')]=function(_0x43d15,_0x4e2442){var _0x34380d;return respondWithRpcPromise(_0x1ac3('0x2c'),_0x43d15['query'])[_0x1ac3('0xa')](function(_0x43a2ee){_0x34380d=_0x43a2ee;return respondWithRpcPromise(_0x1ac3('0x2c'),_0x43d15[_0x1ac3('0x18')],routingClient);})[_0x1ac3('0xa')](function(_0x21d8d6){return _[_0x1ac3('0x1a')]({},_0x21d8d6,_0x34380d);})[_0x1ac3('0xa')](respondWithResult(_0x4e2442,null))['catch'](handleError(_0x4e2442,null));};exports[_0x1ac3('0x2d')]=function(_0x3e606f,_0x40ea2c){if(_0x3e606f[_0x1ac3('0x21')]&&_0x3e606f[_0x1ac3('0x21')][_0x1ac3('0x2e')]&&_0x3e606f[_0x1ac3('0x2f')]&&_0x3e606f['user']['name']){for(var _0x2c2099 in _0x3e606f[_0x1ac3('0x21')]['interaction']){if(_0x3e606f[_0x1ac3('0x21')][_0x1ac3('0x2e')]['hasOwnProperty'](_0x2c2099)){db[_0x1ac3('0x30')]['findAll']({'where':{'channel':_0x2c2099,'membername':_0x3e606f[_0x1ac3('0x2f')][_0x1ac3('0x12')],'type':_0x1ac3('0x31'),'exitAt':null,'uniqueid':_0x3e606f[_0x1ac3('0x21')]['interaction'][_0x2c2099]&&_0x3e606f[_0x1ac3('0x21')][_0x1ac3('0x2e')][_0x2c2099][_0x1ac3('0x32')]?{'$notIn':_0x3e606f[_0x1ac3('0x21')][_0x1ac3('0x2e')][_0x2c2099]}:{'$ne':null}}})['then'](function(_0x26b5b1){var _0x842f83=moment()[_0x1ac3('0x33')](_0x1ac3('0x34'));for(var _0x589434=0x0,_0x16d56a=_0x26b5b1[_0x1ac3('0x32')];_0x589434<_0x16d56a;_0x589434+=0x1){_0x26b5b1[_0x589434][_0x1ac3('0x35')]({'exitAt':_0x842f83});}});for(var _0x4019c6=0x0;_0x4019c6<_0x3e606f['body'][_0x1ac3('0x2e')][_0x2c2099][_0x1ac3('0x32')];_0x4019c6+=0x1){db[_0x1ac3('0x30')][_0x1ac3('0x36')]({'where':{'channel':_0x2c2099,'membername':_0x3e606f['user'][_0x1ac3('0x12')],'type':'INTERACTION','uniqueid':_0x3e606f[_0x1ac3('0x21')][_0x1ac3('0x2e')][_0x2c2099][_0x4019c6],'exitAt':null},'defaults':{'channel':_0x2c2099,'membername':_0x3e606f[_0x1ac3('0x2f')][_0x1ac3('0x12')],'interface':_[_0x1ac3('0x13')](_0x3e606f[_0x1ac3('0x2f')][_0x1ac3('0x37')])?util['format']('SIP/%s',_0x3e606f[_0x1ac3('0x2f')][_0x1ac3('0x12')]):_0x3e606f[_0x1ac3('0x2f')]['interface'],'type':'INTERACTION','enterAt':moment()['format'](_0x1ac3('0x34')),'role':_0x1ac3('0x38'),'internal':_0x3e606f['user'][_0x1ac3('0x39')],'uniqueid':_0x3e606f[_0x1ac3('0x21')][_0x1ac3('0x2e')][_0x2c2099][_0x4019c6]}});}}}}return respondWithRpcPromise(_0x1ac3('0x3a'),{'id':_0x3e606f['params']['id'],'capacity':_0x3e606f['body'][_0x1ac3('0x3b')]},routingClient)[_0x1ac3('0xa')](respondWithResult(_0x40ea2c,null))['catch'](handleError(_0x40ea2c,null));};exports[_0x1ac3('0x3c')]=function(_0x5231f7,_0x4e4945){return respondWithRpcPromise(_0x1ac3('0x3d'),_0x5231f7[_0x1ac3('0x18')])['then'](respondWithResult(_0x4e4945,null))[_0x1ac3('0xe')](handleError(_0x4e4945,null));};exports['trunks']=function(_0x267541,_0x4762d3){return respondWithRpcPromise(_0x1ac3('0x3e'),_0x267541[_0x1ac3('0x18')])[_0x1ac3('0xa')](respondWithResult(_0x4762d3,null))[_0x1ac3('0xe')](handleError(_0x4762d3,null));};exports[_0x1ac3('0x3f')]=function(_0x331374,_0xeb7e49){return respondWithRpcPromise(_0x1ac3('0x40'),_0x331374[_0x1ac3('0x18')])['then'](respondWithResult(_0xeb7e49,null))['catch'](handleError(_0xeb7e49,null));};exports[_0x1ac3('0x41')]=function(_0x310eb7,_0x3bf701){return respondWithRpcPromise(_0x1ac3('0x42'),_0x310eb7[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](respondWithResult(_0x3bf701,null))[_0x1ac3('0xe')](handleError(_0x3bf701,null));};exports[_0x1ac3('0x43')]=function(_0xcf3bba,_0x3149f6){return respondWithRpcPromise('ChatQueues',_0xcf3bba[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](findById(_0xcf3bba[_0x1ac3('0x1b')]['id']))[_0x1ac3('0xa')](respondWithResult(_0x3149f6,null))[_0x1ac3('0xe')](handleError(_0x3149f6,null));};exports['mailQueues']=function(_0xb74cdf,_0x35895d){return respondWithRpcPromise('MailQueues',_0xb74cdf['query'],routingClient)['then'](respondWithResult(_0x35895d,null))[_0x1ac3('0xe')](handleError(_0x35895d,null));};exports[_0x1ac3('0x44')]=function(_0x2a1f66,_0x5ad546){return respondWithRpcPromise(_0x1ac3('0x45'),_0x2a1f66['query'],routingClient)['then'](findById(_0x2a1f66['params']['id']))['then'](respondWithResult(_0x5ad546,null))[_0x1ac3('0xe')](handleError(_0x5ad546,null));};exports[_0x1ac3('0x46')]=function(_0x42218b,_0x13294a){return respondWithRpcPromise(_0x1ac3('0x47'),_0x42218b['query'],mailClient)[_0x1ac3('0xa')](respondWithResult(_0x13294a,null))[_0x1ac3('0xe')](handleError(_0x13294a,null));};exports['openchannelQueues']=function(_0x2bcb4b,_0x1ffbb1){return respondWithRpcPromise(_0x1ac3('0x48'),_0x2bcb4b[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](respondWithResult(_0x1ffbb1,null))['catch'](handleError(_0x1ffbb1,null));};exports[_0x1ac3('0x49')]=function(_0x40907d,_0x1f4294){return respondWithRpcPromise(_0x1ac3('0x48'),_0x40907d['query'],routingClient)[_0x1ac3('0xa')](findById(_0x40907d[_0x1ac3('0x1b')]['id']))[_0x1ac3('0xa')](respondWithResult(_0x1f4294,null))[_0x1ac3('0xe')](handleError(_0x1f4294,null));};exports[_0x1ac3('0x4a')]=function(_0x1ac283,_0x5541c3){return respondWithRpcPromise('SmsQueues',_0x1ac283['query'],routingClient)['then'](respondWithResult(_0x5541c3,null))[_0x1ac3('0xe')](handleError(_0x5541c3,null));};exports['showSmsQueues']=function(_0x2a5413,_0x19359f){return respondWithRpcPromise(_0x1ac3('0x4b'),_0x2a5413[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](findById(_0x2a5413[_0x1ac3('0x1b')]['id']))['then'](respondWithResult(_0x19359f,null))[_0x1ac3('0xe')](handleError(_0x19359f,null));};exports[_0x1ac3('0x4c')]=function(_0x3597cb,_0x422b15){return respondWithRpcPromise('WhatsappQueues',_0x3597cb[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](respondWithResult(_0x422b15,null))[_0x1ac3('0xe')](handleError(_0x422b15,null));};exports[_0x1ac3('0x4d')]=function(_0x380ed8,_0x49ced4){return respondWithRpcPromise(_0x1ac3('0x4e'),_0x380ed8['query'],routingClient)['then'](findById(_0x380ed8[_0x1ac3('0x1b')]['id']))[_0x1ac3('0xa')](respondWithResult(_0x49ced4,null))[_0x1ac3('0xe')](handleError(_0x49ced4,null));};exports[_0x1ac3('0x4f')]=function(_0x355429,_0x3959bb){return respondWithRpcPromise(_0x1ac3('0x50'),_0x355429[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](respondWithResult(_0x3959bb,null))['catch'](handleError(_0x3959bb,null));};exports[_0x1ac3('0x51')]=function(_0xd36c71,_0x303d58){return respondWithRpcPromise('FaxQueues',_0xd36c71[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](findById(_0xd36c71[_0x1ac3('0x1b')]['id']))[_0x1ac3('0xa')](respondWithResult(_0x303d58,null))[_0x1ac3('0xe')](handleError(_0x303d58,null));};exports[_0x1ac3('0x52')]=function(_0x8740b4,_0x215966){return respondWithRpcPromise(_0x1ac3('0x53'),_0x8740b4[_0x1ac3('0x18')])['then'](respondWithResult(_0x215966,null))[_0x1ac3('0xe')](handleError(_0x215966,null));};exports[_0x1ac3('0x54')]=function(_0x41ffd0,_0x566ddc){return respondWithRpcPromise(_0x1ac3('0x55'),_0x41ffd0[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](respondWithResult(_0x566ddc,null))[_0x1ac3('0xe')](handleError(_0x566ddc,null));};exports[_0x1ac3('0x56')]=function(_0x519b80,_0x4d9d77){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x519b80[_0x1ac3('0x18')],routingClient)['then'](respondWithResult(_0x4d9d77,null))[_0x1ac3('0xe')](handleError(_0x4d9d77,null));};exports[_0x1ac3('0x57')]=function(_0x433dd0,_0x5cf974){return respondWithRpcPromise(_0x1ac3('0x58'),_0x433dd0[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](respondWithResult(_0x5cf974,null))[_0x1ac3('0xe')](handleError(_0x5cf974,null));};exports[_0x1ac3('0x59')]=function(_0x59def5,_0x5ec89d){return respondWithRpcPromise(_0x1ac3('0x58'),_0x59def5[_0x1ac3('0x18')],routingClient)['then'](function(_0x29b026){if(_0x59def5[_0x1ac3('0x18')][_0x1ac3('0x5a')]!==undefined){var _0x5cc2e0=_(_0x29b026[_0x1ac3('0x15')])[_0x1ac3('0x5b')]([_0x59def5['query'][_0x1ac3('0x5a')],_0x59def5['params']['id']])[_0x1ac3('0x5c')]('queue_id')['uniq']()[_0x1ac3('0x5d')]();return _0x29b026[_0x1ac3('0x15')][_0x1ac3('0x5b')](function(_0x3f5c44){return _0x5cc2e0[_0x1ac3('0x5e')](_0x3f5c44[_0x1ac3('0x5f')])>-0x1;});}else{return _0x29b026[_0x1ac3('0x15')][_0x1ac3('0x5b')](function(_0x408e3c){return _0x408e3c[_0x1ac3('0x5f')]===parseInt(_0x59def5[_0x1ac3('0x1b')]['id']);});}})[_0x1ac3('0xa')](respondWithResult(_0x5ec89d,null))['catch'](handleError(_0x5ec89d,null));};exports['smsQueuesWaitingInteractions']=function(_0x588726,_0x2ef69a){return respondWithRpcPromise(_0x1ac3('0x60'),_0x588726['query'],routingClient)[_0x1ac3('0xa')](respondWithResult(_0x2ef69a,null))[_0x1ac3('0xe')](handleError(_0x2ef69a,null));};exports[_0x1ac3('0x61')]=function(_0x364748,_0xbadca5){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x364748[_0x1ac3('0x18')],routingClient)['then'](respondWithResult(_0xbadca5,null))[_0x1ac3('0xe')](handleError(_0xbadca5,null));};exports['faxQueuesWaitingInteractions']=function(_0x218712,_0x50278a){return respondWithRpcPromise(_0x1ac3('0x62'),_0x218712[_0x1ac3('0x18')],routingClient)[_0x1ac3('0xa')](respondWithResult(_0x50278a,null))[_0x1ac3('0xe')](handleError(_0x50278a,null));};exports[_0x1ac3('0x63')]=function(_0x5bf7f1){return function(_0x4f9822,_0x4887a5){var _0x369ed0,_0x22e88d;var _0xbadd54=_[_0x1ac3('0x64')](_0x5bf7f1);var _0x5b4e54=_0x5bf7f1===_0x1ac3('0x65')?_0x1ac3('0x66'):'Account';return db[_0xbadd54+_0x1ac3('0x67')]['findOne']({'raw':!![],'where':{'id':_0x4f9822[_0x1ac3('0x1b')]['id']}})['then'](function(_0x5524a4){if(_['isNil'](_0x5524a4)){throw new Error(_0xbadd54+_0x1ac3('0x68'));}_0x369ed0=_0x5524a4;return db[_0xbadd54+_0x1ac3('0x69')][_0x1ac3('0x6a')]({'where':{'id':_0x4f9822[_0x1ac3('0x21')][_0x1ac3('0x6b')]},'include':[{'model':db[_0xbadd54+'Interaction'],'as':_0x1ac3('0x6c')},{'model':db[_0xbadd54+_0x5b4e54],'as':_0x1ac3('0x6d')}]});})[_0x1ac3('0xa')](function(_0x34377b){if(_['isNil'](_0x34377b)){throw new Error(_0xbadd54+_0x1ac3('0x6e'));}_0x22e88d=_0x34377b;return _0x34377b[_0x1ac3('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x55d53c={'uniqueid':_0x5bf7f1+'.'+_0x22e88d['id']+'.'+_0x22e88d['Interaction']['id'],'FromUserId':_0x4f9822[_0x1ac3('0x2f')]['id'],'type':_0x1ac3('0x70')};_0x55d53c[_0xbadd54+_0x1ac3('0x71')]=_0x22e88d['id'];_0x55d53c[_0xbadd54+_0x1ac3('0x72')]=_0x22e88d['Interaction']['id'];_0x55d53c[_0x1ac3('0x73')+_0xbadd54+_0x5b4e54+'Id']=_0x22e88d[_0x1ac3('0x6d')]['id'];_0x55d53c['To'+_0xbadd54+'QueueId']=_0x369ed0['id'];return db[_0xbadd54+_0x1ac3('0x74')][_0x1ac3('0x75')](_0x55d53c);})[_0x1ac3('0xa')](function(){return respondWithRpcPromise(_0x1ac3('0x76'),{'channel':_0x5bf7f1,'interaction':_0x22e88d['Interaction'],'message':_0x22e88d,'account':_0x22e88d[_0x1ac3('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x1ac3('0x70'),'appdata':_0x369ed0[_0x1ac3('0x12')]+','+(_0x22e88d[_0x1ac3('0x6d')][_0x1ac3('0x77')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x1ac3('0xa')](respondWithResult(_0x4887a5,null))[_0x1ac3('0xe')](handleError(_0x4887a5,null));};};exports['agentNotify']=function(_0x48335c,_0xfc252a){var _0x1c5f68,_0x554c7b;if(_['isNil'](_0x48335c[_0x1ac3('0x21')]['channel'])){throw new Error(_0x1ac3('0x78'));}var _0x20928f=_0x48335c['body']['channel'];var _0x3389be=_['capitalize'](_0x20928f);var _0x45faf6=_0x20928f===_0x1ac3('0x65')?_0x1ac3('0x66'):_0x1ac3('0x6d');return db[_0x1ac3('0x79')][_0x1ac3('0x6a')]({'raw':!![],'where':{'id':_0x48335c[_0x1ac3('0x1b')]['id'],'role':_0x1ac3('0x38')}})[_0x1ac3('0xa')](function(_0x588b98){if(_[_0x1ac3('0x13')](_0x588b98)){throw new Error(_0x1ac3('0x7a'));}_0x1c5f68=_0x588b98;return db[_0x3389be+'Message'][_0x1ac3('0x6a')]({'where':{'id':_0x48335c[_0x1ac3('0x21')]['messageId']},'include':[{'model':db[_0x3389be+_0x1ac3('0x6c')],'as':'Interaction'},{'model':db[_0x3389be+_0x45faf6],'as':'Account'}]});})[_0x1ac3('0xa')](function(_0x19a898){if(_[_0x1ac3('0x13')](_0x19a898)){throw new Error(_0x3389be+'\x20Message\x20not\x20found');}_0x554c7b=_0x19a898;return _0x19a898['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x1ac3('0xa')](function(){var _0x12b987={'uniqueid':_0x20928f+'.'+_0x554c7b['id']+'.'+_0x554c7b[_0x1ac3('0x6c')]['id'],'FromUserId':_0x48335c[_0x1ac3('0x2f')]['id'],'type':_0x1ac3('0x70'),'ToUserId':_0x1c5f68['id']};_0x12b987[_0x3389be+_0x1ac3('0x71')]=_0x554c7b['id'];_0x12b987[_0x3389be+_0x1ac3('0x72')]=_0x554c7b[_0x1ac3('0x6c')]['id'];_0x12b987[_0x1ac3('0x73')+_0x3389be+_0x45faf6+'Id']=_0x554c7b[_0x1ac3('0x6d')]['id'];return db[_0x3389be+_0x1ac3('0x74')][_0x1ac3('0x75')](_0x12b987);})[_0x1ac3('0xa')](function(){return respondWithRpcPromise(_0x1ac3('0x76'),{'channel':_0x20928f,'interaction':_0x554c7b[_0x1ac3('0x6c')],'message':_0x554c7b,'account':_0x554c7b[_0x1ac3('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x1ac3('0x38'),'appdata':_0x1c5f68[_0x1ac3('0x12')]+','+(_0x554c7b[_0x1ac3('0x6d')][_0x1ac3('0x7b')]||0x12c),'interval':_0x1ac3('0x7c')}]},routingClient);})[_0x1ac3('0xa')](respondWithResult(_0xfc252a,null))['catch'](handleError(_0xfc252a,null));};
\ No newline at end of file
index 692069d..88a1bc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd721=['fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','/:id/run','isAuthenticated','run','create','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x54ab1f,_0x1585d6){var _0x24c869=function(_0x5e8ce0){while(--_0x5e8ce0){_0x54ab1f['push'](_0x54ab1f['shift']());}};_0x24c869(++_0x1585d6);}(_0xd721,0x152));var _0x1d72=function(_0x350bdc,_0x1462d4){_0x350bdc=_0x350bdc-0x0;var _0xe5560a=_0xd721[_0x350bdc];return _0xe5560a;};'use strict';var multer=require(_0x1d72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1d72('0x1'));var express=require(_0x1d72('0x2'));var router=express[_0x1d72('0x3')]();var fs_extra=require(_0x1d72('0x4'));var auth=require(_0x1d72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1d72('0x6'));var controller=require('./schedule.controller');router[_0x1d72('0x7')]('/',auth['isAuthenticated'](),controller[_0x1d72('0x8')]);router[_0x1d72('0x7')](_0x1d72('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1d72('0x7')](_0x1d72('0xa'),auth[_0x1d72('0xb')](),controller[_0x1d72('0xc')]);router['post']('/',auth[_0x1d72('0xb')](),controller[_0x1d72('0xd')]);router['put'](_0x1d72('0x9'),auth[_0x1d72('0xb')](),controller[_0x1d72('0xe')]);router[_0x1d72('0xf')](_0x1d72('0x9'),auth[_0x1d72('0xb')](),controller[_0x1d72('0x10')]);module[_0x1d72('0x11')]=router;
\ No newline at end of file
+var _0x9dee=['../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x27ef05,_0x2cfe62){var _0x812f1a=function(_0x3fc21e){while(--_0x3fc21e){_0x27ef05['push'](_0x27ef05['shift']());}};_0x812f1a(++_0x2cfe62);}(_0x9dee,0xe0));var _0xe9de=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x9dee[_0x290fa6];return _0x47f1f3;};'use strict';var multer=require('multer');var util=require(_0xe9de('0x0'));var path=require(_0xe9de('0x1'));var timeout=require(_0xe9de('0x2'));var express=require(_0xe9de('0x3'));var router=express[_0xe9de('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe9de('0x5'));var interaction=require(_0xe9de('0x6'));var config=require(_0xe9de('0x7'));var controller=require(_0xe9de('0x8'));router['get']('/',auth[_0xe9de('0x9')](),controller[_0xe9de('0xa')]);router[_0xe9de('0xb')](_0xe9de('0xc'),auth[_0xe9de('0x9')](),controller[_0xe9de('0xd')]);router[_0xe9de('0xb')](_0xe9de('0xe'),auth['isAuthenticated'](),controller['run']);router[_0xe9de('0xf')]('/',auth[_0xe9de('0x9')](),controller[_0xe9de('0x10')]);router['put'](_0xe9de('0xc'),auth[_0xe9de('0x9')](),controller[_0xe9de('0x11')]);router[_0xe9de('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe9de('0x13')]);module[_0xe9de('0x14')]=router;
\ No newline at end of file
index 1797cff..0666363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x062e=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x062e,0x1cf));var _0xe062=function(_0x1025ab,_0x5f0e93){_0x1025ab=_0x1025ab-0x0;var _0x381c05=_0x062e[_0x1025ab];return _0x381c05;};'use strict';var Sequelize=require(_0xe062('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xe062('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe062('0x2')},'startAt':{'type':Sequelize[_0xe062('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe062('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe062('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe062('0x5')](_0xe062('0x6'),_0xe062('0x7'),'months',_0xe062('0x8'),'days','hours',_0xe062('0x9')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0xe062('0xa'),_0xe062('0xb'),_0xe062('0xc')),'allowNull':![],'defaultValue':_0xe062('0xa')},'type':{'type':Sequelize[_0xe062('0x5')](_0xe062('0xd'),_0xe062('0xe')),'allowNull':![],'defaultValue':_0xe062('0xd')},'sendMail':{'type':Sequelize[_0xe062('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe062('0xf')]},'bcc':{'type':Sequelize[_0xe062('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xe062('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb997=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','weeks','hours','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING'];(function(_0x41943c,_0x394db9){var _0x57703a=function(_0x4050e0){while(--_0x4050e0){_0x41943c['push'](_0x41943c['shift']());}};_0x57703a(++_0x394db9);}(_0xb997,0x11a));var _0x7b99=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0xb997[_0x165c96];return _0x5c2420;};'use strict';var Sequelize=require(_0x7b99('0x0'));module[_0x7b99('0x1')]={'name':{'type':Sequelize[_0x7b99('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b99('0x2')]},'active':{'type':Sequelize[_0x7b99('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7b99('0x2')],'allowNull':![],'defaultValue':_0x7b99('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x7b99('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x7b99('0x6')](_0x7b99('0x7'),_0x7b99('0x8'),_0x7b99('0x9'),_0x7b99('0xa'),'days',_0x7b99('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x7b99('0xc')},'output':{'type':Sequelize['ENUM'](_0x7b99('0xd'),_0x7b99('0xe'),_0x7b99('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x7b99('0x6')](_0x7b99('0x10'),_0x7b99('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x7b99('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x7b99('0x2')]},'cc':{'type':Sequelize[_0x7b99('0x12')]},'bcc':{'type':Sequelize[_0x7b99('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x7b99('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 37a2f53..706807d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x115a=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','run','../../config/schedule','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','stack','name','index','map','Schedule','rawAttributes','type','key','model'];(function(_0x2b1eaa,_0x44fd05){var _0x3c2433=function(_0x1a948d){while(--_0x1a948d){_0x2b1eaa['push'](_0x2b1eaa['shift']());}};_0x3c2433(++_0x44fd05);}(_0x115a,0xce));var _0xa115=function(_0x43289e,_0x5443b6){_0x43289e=_0x43289e-0x0;var _0x4d4174=_0x115a[_0x43289e];return _0x4d4174;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa115('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa115('0x1'));var rp=require(_0xa115('0x2'));var moment=require(_0xa115('0x3'));var BPromise=require(_0xa115('0x4'));var Mustache=require(_0xa115('0x5'));var util=require(_0xa115('0x6'));var path=require(_0xa115('0x7'));var sox=require(_0xa115('0x8'));var csv=require(_0xa115('0x9'));var ejs=require(_0xa115('0xa'));var fs=require('fs');var fs_extra=require(_0xa115('0xb'));var _=require(_0xa115('0xc'));var squel=require(_0xa115('0xd'));var crypto=require(_0xa115('0xe'));var jsforce=require(_0xa115('0xf'));var deskjs=require(_0xa115('0x10'));var toCsv=require(_0xa115('0x9'));var querystring=require(_0xa115('0x11'));var Papa=require(_0xa115('0x12'));var Redis=require('ioredis');var authService=require(_0xa115('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa115('0x14'));var hardwareService=require(_0xa115('0x15'));var logger=require(_0xa115('0x16'))(_0xa115('0x17'));var utils=require(_0xa115('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa115('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20996a,_0x3c33f2){_0x3c33f2=_0x3c33f2||0xcc;return function(_0x3f9d37){if(_0x3f9d37){return _0x20996a[_0xa115('0x1a')](_0x3c33f2);}return _0x20996a[_0xa115('0x1b')](_0x3c33f2)[_0xa115('0x1c')]();};}function respondWithResult(_0x39b76f,_0x5c5646){_0x5c5646=_0x5c5646||0xc8;return function(_0x4fb5ad){if(_0x4fb5ad){return _0x39b76f[_0xa115('0x1b')](_0x5c5646)[_0xa115('0x1d')](_0x4fb5ad);}};}function respondWithFilteredResult(_0x56f6c2,_0x44bf07){return function(_0x1a468f){if(_0x1a468f){var _0x57eb88=typeof _0x44bf07[_0xa115('0x1e')]===_0xa115('0x1f')&&typeof _0x44bf07[_0xa115('0x20')]===_0xa115('0x1f');var _0x1ec9f2=_0x1a468f[_0xa115('0x21')];var _0x2e3b91=_0x57eb88?0x0:_0x44bf07[_0xa115('0x1e')];var _0x3b2285=_0x57eb88?_0x1a468f[_0xa115('0x21')]:_0x44bf07[_0xa115('0x1e')]+_0x44bf07[_0xa115('0x20')];var _0x3f7f43;if(_0x3b2285>=_0x1ec9f2){_0x3b2285=_0x1ec9f2;_0x3f7f43=0xc8;}else{_0x3f7f43=0xce;}_0x56f6c2[_0xa115('0x1b')](_0x3f7f43);return _0x56f6c2['set'](_0xa115('0x22'),_0x2e3b91+'-'+_0x3b2285+'/'+_0x1ec9f2)[_0xa115('0x1d')](_0x1a468f);}return null;};}function patchUpdates(_0x4f574a){return function(_0x239c92){try{jsonpatch[_0xa115('0x23')](_0x239c92,_0x4f574a,!![]);}catch(_0x1a35b1){return BPromise[_0xa115('0x24')](_0x1a35b1);}return _0x239c92[_0xa115('0x25')]();};}function saveUpdates(_0x19b651,_0x5dd8b8){return function(_0x4144f0){if(_0x4144f0){return _0x4144f0['update'](_0x19b651)['then'](function(_0xbd9b11){return _0xbd9b11;});}return null;};}function removeEntity(_0x31372d,_0x5ead95){return function(_0x2c63e4){if(_0x2c63e4){return _0x2c63e4[_0xa115('0x26')]()[_0xa115('0x27')](function(){var _0x3e28ae=_0x2c63e4[_0xa115('0x28')]({'plain':!![]});var _0x2c2e4a='Scheduler';return db[_0xa115('0x29')]['destroy']({'where':{'type':_0x2c2e4a,'resourceId':_0x3e28ae['id']}})[_0xa115('0x27')](function(){return _0x2c63e4;});})[_0xa115('0x27')](function(){_0x31372d['status'](0xcc)[_0xa115('0x1c')]();});}};}function handleEntityNotFound(_0x5b5823,_0x1e9879){return function(_0x1a0aea){if(!_0x1a0aea){_0x5b5823[_0xa115('0x1a')](0x194);}return _0x1a0aea;};}function handleError(_0x3208cb,_0x5960fa){_0x5960fa=_0x5960fa||0x1f4;return function(_0x35e3df){logger[_0xa115('0x2a')](_0x35e3df[_0xa115('0x2b')]);if(_0x35e3df['name']){delete _0x35e3df[_0xa115('0x2c')];}_0x3208cb[_0xa115('0x1b')](_0x5960fa)['send'](_0x35e3df);};}exports[_0xa115('0x2d')]=function(_0x28b2c1,_0x1431c8){var _0x4b3eaa={},_0x4e9241={},_0x5c14b3={'count':0x0,'rows':[]};var _0x2decbc=_[_0xa115('0x2e')](db[_0xa115('0x2f')][_0xa115('0x30')],function(_0x474f8f){return{'name':_0x474f8f['fieldName'],'type':_0x474f8f[_0xa115('0x31')][_0xa115('0x32')]};});_0x4e9241[_0xa115('0x33')]=_[_0xa115('0x2e')](_0x2decbc,'name');_0x4e9241[_0xa115('0x34')]=_[_0xa115('0x35')](_0x28b2c1[_0xa115('0x34')]);_0x4e9241[_0xa115('0x36')]=_[_0xa115('0x37')](_0x4e9241['model'],_0x4e9241[_0xa115('0x34')]);_0x4b3eaa['attributes']=_[_0xa115('0x37')](_0x4e9241[_0xa115('0x33')],qs[_0xa115('0x38')](_0x28b2c1[_0xa115('0x34')][_0xa115('0x38')]));_0x4b3eaa[_0xa115('0x39')]=_0x4b3eaa[_0xa115('0x39')][_0xa115('0x3a')]?_0x4b3eaa[_0xa115('0x39')]:_0x4e9241[_0xa115('0x33')];if(!_0x28b2c1[_0xa115('0x34')][_0xa115('0x3b')](_0xa115('0x3c'))){_0x4b3eaa['limit']=qs['limit'](_0x28b2c1[_0xa115('0x34')][_0xa115('0x20')]);_0x4b3eaa[_0xa115('0x1e')]=qs[_0xa115('0x1e')](_0x28b2c1[_0xa115('0x34')][_0xa115('0x1e')]);}_0x4b3eaa['order']=qs[_0xa115('0x3d')](_0x28b2c1[_0xa115('0x34')][_0xa115('0x3d')]);_0x4b3eaa[_0xa115('0x3e')]=qs[_0xa115('0x36')](_['pick'](_0x28b2c1[_0xa115('0x34')],_0x4e9241[_0xa115('0x36')]),_0x2decbc);if(_0x28b2c1[_0xa115('0x34')]['filter']){_0x4b3eaa[_0xa115('0x3e')]=_[_0xa115('0x3f')](_0x4b3eaa[_0xa115('0x3e')],{'$or':_[_0xa115('0x2e')](_0x2decbc,function(_0x1cbc3f){if(_0x1cbc3f[_0xa115('0x31')]!==_0xa115('0x40')){var _0x24fdb8={};_0x24fdb8[_0x1cbc3f[_0xa115('0x2c')]]={'$like':'%'+_0x28b2c1[_0xa115('0x34')][_0xa115('0x41')]+'%'};return _0x24fdb8;}})});}_0x4b3eaa=_['merge']({},_0x4b3eaa,_0x28b2c1[_0xa115('0x42')]);var _0x38cf82={'where':_0x4b3eaa[_0xa115('0x3e')]};return db[_0xa115('0x2f')][_0xa115('0x21')](_0x38cf82)[_0xa115('0x27')](function(_0x1b7aab){_0x5c14b3['count']=_0x1b7aab;if(_0x28b2c1['query'][_0xa115('0x43')]){_0x4b3eaa[_0xa115('0x44')]=[{'all':!![]}];}return db['Schedule'][_0xa115('0x45')](_0x4b3eaa);})['then'](function(_0x3d1981){_0x5c14b3[_0xa115('0x46')]=_0x3d1981;return _0x5c14b3;})[_0xa115('0x27')](respondWithFilteredResult(_0x1431c8,_0x4b3eaa))['catch'](handleError(_0x1431c8,null));};exports['show']=function(_0x46c8e1,_0x473863){var _0x3a2f2c={'raw':![],'where':{'id':_0x46c8e1['params']['id']}},_0x17fc96={};_0x17fc96[_0xa115('0x33')]=_[_0xa115('0x35')](db[_0xa115('0x2f')][_0xa115('0x30')]);_0x17fc96[_0xa115('0x34')]=_[_0xa115('0x35')](_0x46c8e1[_0xa115('0x34')]);_0x17fc96[_0xa115('0x36')]=_[_0xa115('0x37')](_0x17fc96[_0xa115('0x33')],_0x17fc96['query']);_0x3a2f2c['attributes']=_[_0xa115('0x37')](_0x17fc96['model'],qs[_0xa115('0x38')](_0x46c8e1[_0xa115('0x34')][_0xa115('0x38')]));_0x3a2f2c['attributes']=_0x3a2f2c[_0xa115('0x39')][_0xa115('0x3a')]?_0x3a2f2c['attributes']:_0x17fc96[_0xa115('0x33')];if(_0x46c8e1[_0xa115('0x34')][_0xa115('0x43')]){_0x3a2f2c[_0xa115('0x44')]=[{'all':!![]}];}_0x3a2f2c=_[_0xa115('0x3f')]({},_0x3a2f2c,_0x46c8e1['options']);return db[_0xa115('0x2f')][_0xa115('0x47')](_0x3a2f2c)[_0xa115('0x27')](handleEntityNotFound(_0x473863,null))['then'](respondWithResult(_0x473863,null))[_0xa115('0x48')](handleError(_0x473863,null));};exports['create']=function(_0x322e2f,_0x2a2e62){return db[_0xa115('0x2f')]['create'](_0x322e2f[_0xa115('0x49')],{})[_0xa115('0x27')](function(_0x5299d8){var _0x2ff514=_0x322e2f['user']['get']({'plain':!![]});if(!_0x2ff514)throw new Error(_0xa115('0x4a'));if(_0x2ff514[_0xa115('0x4b')]===_0xa115('0x4c')){var _0x33ec7c=_0x5299d8[_0xa115('0x28')]({'plain':!![]});var _0x1464ff=_0xa115('0x4d');return db[_0xa115('0x4e')][_0xa115('0x47')]({'where':{'name':_0x1464ff,'userProfileId':_0x2ff514[_0xa115('0x4f')]},'raw':!![]})[_0xa115('0x27')](function(_0x1a7954){if(_0x1a7954&&_0x1a7954['autoAssociation']===0x0){return db['UserProfileResource'][_0xa115('0x50')]({'name':_0x33ec7c[_0xa115('0x2c')],'resourceId':_0x33ec7c['id'],'type':_0x1a7954[_0xa115('0x2c')],'sectionId':_0x1a7954['id']},{})[_0xa115('0x27')](function(){return _0x5299d8;});}else{return _0x5299d8;}})[_0xa115('0x48')](function(_0x325631){logger[_0xa115('0x2a')](_0xa115('0x51'),_0x325631);throw _0x325631;});}return _0x5299d8;})[_0xa115('0x27')](respondWithResult(_0x2a2e62,0xc9))[_0xa115('0x48')](handleError(_0x2a2e62,null));};exports[_0xa115('0x52')]=function(_0x5b3695,_0xd63298){if(_0x5b3695[_0xa115('0x49')]['id']){delete _0x5b3695[_0xa115('0x49')]['id'];}return db[_0xa115('0x2f')][_0xa115('0x47')]({'where':{'id':_0x5b3695[_0xa115('0x53')]['id']}})[_0xa115('0x27')](handleEntityNotFound(_0xd63298,null))[_0xa115('0x27')](saveUpdates(_0x5b3695[_0xa115('0x49')],null))[_0xa115('0x27')](respondWithResult(_0xd63298,null))[_0xa115('0x48')](handleError(_0xd63298,null));};exports[_0xa115('0x26')]=function(_0x2929a0,_0x6dfc89){return db[_0xa115('0x2f')]['find']({'where':{'id':_0x2929a0[_0xa115('0x53')]['id']}})[_0xa115('0x27')](handleEntityNotFound(_0x6dfc89,null))[_0xa115('0x27')](removeEntity(_0x6dfc89,null))[_0xa115('0x48')](handleError(_0x6dfc89,null));};exports[_0xa115('0x54')]=function(_0x3bd9e4,_0x195bd4,_0x4c02a8){var _0x21299f=require(_0xa115('0x55'));return db[_0xa115('0x2f')][_0xa115('0x47')]({'where':{'id':_0x3bd9e4['params']['id']},'raw':!![]})[_0xa115('0x27')](handleEntityNotFound(_0x195bd4,null))[_0xa115('0x27')](function(){_0x21299f[_0xa115('0x54')](_0x3bd9e4[_0xa115('0x53')]['id']);})[_0xa115('0x27')](respondWithStatusCode(_0x195bd4,null))[_0xa115('0x48')](handleError(_0x195bd4,null));};
\ No newline at end of file
+var _0x9df9=['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','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','send','index','map','Schedule','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel'];(function(_0x44e965,_0x5528d3){var _0x3a508e=function(_0x302d31){while(--_0x302d31){_0x44e965['push'](_0x44e965['shift']());}};_0x3a508e(++_0x5528d3);}(_0x9df9,0x1a3));var _0x99df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9df9[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x99df('0x0'));var rimraf=require(_0x99df('0x1'));var zipdir=require(_0x99df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99df('0x3'));var moment=require(_0x99df('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x99df('0x5'));var path=require('path');var sox=require(_0x99df('0x6'));var csv=require(_0x99df('0x7'));var ejs=require(_0x99df('0x8'));var fs=require('fs');var fs_extra=require(_0x99df('0x9'));var _=require('lodash');var squel=require(_0x99df('0xa'));var crypto=require(_0x99df('0xb'));var jsforce=require(_0x99df('0xc'));var deskjs=require(_0x99df('0xd'));var toCsv=require('to-csv');var querystring=require(_0x99df('0xe'));var Papa=require(_0x99df('0xf'));var Redis=require(_0x99df('0x10'));var authService=require(_0x99df('0x11'));var qs=require(_0x99df('0x12'));var as=require(_0x99df('0x13'));var hardwareService=require(_0x99df('0x14'));var logger=require(_0x99df('0x15'))(_0x99df('0x16'));var utils=require(_0x99df('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x99df('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c5665,_0x254baa){_0x254baa=_0x254baa||0xcc;return function(_0x218a58){if(_0x218a58){return _0x1c5665[_0x99df('0x19')](_0x254baa);}return _0x1c5665[_0x99df('0x1a')](_0x254baa)['end']();};}function respondWithResult(_0x375dd0,_0x30629d){_0x30629d=_0x30629d||0xc8;return function(_0x215607){if(_0x215607){return _0x375dd0[_0x99df('0x1a')](_0x30629d)[_0x99df('0x1b')](_0x215607);}};}function respondWithFilteredResult(_0x65e2b5,_0x2f23ee){return function(_0xb49bc){if(_0xb49bc){var _0x1ccef9=typeof _0x2f23ee[_0x99df('0x1c')]===_0x99df('0x1d')&&typeof _0x2f23ee[_0x99df('0x1e')]===_0x99df('0x1d');var _0x28c86f=_0xb49bc['count'];var _0x57a57f=_0x1ccef9?0x0:_0x2f23ee['offset'];var _0x239f58=_0x1ccef9?_0xb49bc['count']:_0x2f23ee[_0x99df('0x1c')]+_0x2f23ee[_0x99df('0x1e')];var _0x13b5e4;if(_0x239f58>=_0x28c86f){_0x239f58=_0x28c86f;_0x13b5e4=0xc8;}else{_0x13b5e4=0xce;}_0x65e2b5[_0x99df('0x1a')](_0x13b5e4);return _0x65e2b5[_0x99df('0x1f')](_0x99df('0x20'),_0x57a57f+'-'+_0x239f58+'/'+_0x28c86f)[_0x99df('0x1b')](_0xb49bc);}return null;};}function patchUpdates(_0xa9d0b1){return function(_0x39e9b2){try{jsonpatch[_0x99df('0x21')](_0x39e9b2,_0xa9d0b1,!![]);}catch(_0x8ef698){return BPromise['reject'](_0x8ef698);}return _0x39e9b2[_0x99df('0x22')]();};}function saveUpdates(_0x5c5f30,_0x3532a4){return function(_0x4eee61){if(_0x4eee61){return _0x4eee61[_0x99df('0x23')](_0x5c5f30)[_0x99df('0x24')](function(_0x244a04){return _0x244a04;});}return null;};}function removeEntity(_0x115e42,_0x39ee9c){return function(_0x5588a1){if(_0x5588a1){return _0x5588a1[_0x99df('0x25')]()['then'](function(){var _0x1854df=_0x5588a1[_0x99df('0x26')]({'plain':!![]});var _0x2e43e4=_0x99df('0x27');return db[_0x99df('0x28')][_0x99df('0x25')]({'where':{'type':_0x2e43e4,'resourceId':_0x1854df['id']}})[_0x99df('0x24')](function(){return _0x5588a1;});})['then'](function(){_0x115e42[_0x99df('0x1a')](0xcc)[_0x99df('0x29')]();});}};}function handleEntityNotFound(_0x3bde91,_0x2ad5da){return function(_0x256f95){if(!_0x256f95){_0x3bde91[_0x99df('0x19')](0x194);}return _0x256f95;};}function handleError(_0x5c558d,_0x5a524f){_0x5a524f=_0x5a524f||0x1f4;return function(_0x4dd265){logger[_0x99df('0x2a')](_0x4dd265[_0x99df('0x2b')]);if(_0x4dd265[_0x99df('0x2c')]){delete _0x4dd265[_0x99df('0x2c')];}_0x5c558d[_0x99df('0x1a')](_0x5a524f)[_0x99df('0x2d')](_0x4dd265);};}exports[_0x99df('0x2e')]=function(_0x1205da,_0x2d222d){var _0xcd1900={},_0x1de37e={},_0x2a6640={'count':0x0,'rows':[]};var _0xc0ea8b=_[_0x99df('0x2f')](db[_0x99df('0x30')]['rawAttributes'],function(_0x1348aa){return{'name':_0x1348aa['fieldName'],'type':_0x1348aa[_0x99df('0x31')][_0x99df('0x32')]};});_0x1de37e[_0x99df('0x33')]=_[_0x99df('0x2f')](_0xc0ea8b,_0x99df('0x2c'));_0x1de37e[_0x99df('0x34')]=_[_0x99df('0x35')](_0x1205da[_0x99df('0x34')]);_0x1de37e[_0x99df('0x36')]=_[_0x99df('0x37')](_0x1de37e[_0x99df('0x33')],_0x1de37e[_0x99df('0x34')]);_0xcd1900['attributes']=_['intersection'](_0x1de37e[_0x99df('0x33')],qs[_0x99df('0x38')](_0x1205da[_0x99df('0x34')][_0x99df('0x38')]));_0xcd1900[_0x99df('0x39')]=_0xcd1900['attributes'][_0x99df('0x3a')]?_0xcd1900[_0x99df('0x39')]:_0x1de37e[_0x99df('0x33')];if(!_0x1205da[_0x99df('0x34')][_0x99df('0x3b')](_0x99df('0x3c'))){_0xcd1900[_0x99df('0x1e')]=qs[_0x99df('0x1e')](_0x1205da['query']['limit']);_0xcd1900[_0x99df('0x1c')]=qs[_0x99df('0x1c')](_0x1205da['query'][_0x99df('0x1c')]);}_0xcd1900['order']=qs[_0x99df('0x3d')](_0x1205da[_0x99df('0x34')][_0x99df('0x3d')]);_0xcd1900[_0x99df('0x3e')]=qs[_0x99df('0x36')](_[_0x99df('0x3f')](_0x1205da[_0x99df('0x34')],_0x1de37e[_0x99df('0x36')]),_0xc0ea8b);if(_0x1205da[_0x99df('0x34')][_0x99df('0x40')]){_0xcd1900['where']=_[_0x99df('0x41')](_0xcd1900[_0x99df('0x3e')],{'$or':_['map'](_0xc0ea8b,function(_0x3e475e){if(_0x3e475e[_0x99df('0x31')]!==_0x99df('0x42')){var _0x419b85={};_0x419b85[_0x3e475e[_0x99df('0x2c')]]={'$like':'%'+_0x1205da[_0x99df('0x34')][_0x99df('0x40')]+'%'};return _0x419b85;}})});}_0xcd1900=_[_0x99df('0x41')]({},_0xcd1900,_0x1205da[_0x99df('0x43')]);var _0xa6f05d={'where':_0xcd1900[_0x99df('0x3e')]};return db[_0x99df('0x30')][_0x99df('0x44')](_0xa6f05d)['then'](function(_0x20bf3c){_0x2a6640[_0x99df('0x44')]=_0x20bf3c;if(_0x1205da[_0x99df('0x34')][_0x99df('0x45')]){_0xcd1900[_0x99df('0x46')]=[{'all':!![]}];}return db[_0x99df('0x30')]['findAll'](_0xcd1900);})['then'](function(_0x155cba){_0x2a6640[_0x99df('0x47')]=_0x155cba;return _0x2a6640;})['then'](respondWithFilteredResult(_0x2d222d,_0xcd1900))[_0x99df('0x48')](handleError(_0x2d222d,null));};exports[_0x99df('0x49')]=function(_0x42f742,_0x531cd3){var _0x5abba0={'raw':![],'where':{'id':_0x42f742['params']['id']}},_0x15d705={};_0x15d705[_0x99df('0x33')]=_[_0x99df('0x35')](db[_0x99df('0x30')][_0x99df('0x4a')]);_0x15d705[_0x99df('0x34')]=_[_0x99df('0x35')](_0x42f742['query']);_0x15d705[_0x99df('0x36')]=_[_0x99df('0x37')](_0x15d705[_0x99df('0x33')],_0x15d705[_0x99df('0x34')]);_0x5abba0[_0x99df('0x39')]=_['intersection'](_0x15d705['model'],qs[_0x99df('0x38')](_0x42f742[_0x99df('0x34')][_0x99df('0x38')]));_0x5abba0['attributes']=_0x5abba0[_0x99df('0x39')]['length']?_0x5abba0[_0x99df('0x39')]:_0x15d705['model'];if(_0x42f742[_0x99df('0x34')][_0x99df('0x45')]){_0x5abba0[_0x99df('0x46')]=[{'all':!![]}];}_0x5abba0=_[_0x99df('0x41')]({},_0x5abba0,_0x42f742['options']);return db[_0x99df('0x30')][_0x99df('0x4b')](_0x5abba0)[_0x99df('0x24')](handleEntityNotFound(_0x531cd3,null))[_0x99df('0x24')](respondWithResult(_0x531cd3,null))[_0x99df('0x48')](handleError(_0x531cd3,null));};exports['create']=function(_0x310e8c,_0x43be0c){return db[_0x99df('0x30')][_0x99df('0x4c')](_0x310e8c[_0x99df('0x4d')],{})[_0x99df('0x24')](function(_0x10cbe1){var _0x5d0520=_0x310e8c[_0x99df('0x4e')][_0x99df('0x26')]({'plain':!![]});if(!_0x5d0520)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d0520[_0x99df('0x4f')]===_0x99df('0x4e')){var _0x38f61d=_0x10cbe1[_0x99df('0x26')]({'plain':!![]});var _0x3b850f='Scheduler';return db[_0x99df('0x50')][_0x99df('0x4b')]({'where':{'name':_0x3b850f,'userProfileId':_0x5d0520['userProfileId']},'raw':!![]})[_0x99df('0x24')](function(_0x1321cf){if(_0x1321cf&&_0x1321cf[_0x99df('0x51')]===0x0){return db[_0x99df('0x28')]['create']({'name':_0x38f61d[_0x99df('0x2c')],'resourceId':_0x38f61d['id'],'type':_0x1321cf[_0x99df('0x2c')],'sectionId':_0x1321cf['id']},{})['then'](function(){return _0x10cbe1;});}else{return _0x10cbe1;}})[_0x99df('0x48')](function(_0x16b11f){logger[_0x99df('0x2a')](_0x99df('0x52'),_0x16b11f);throw _0x16b11f;});}return _0x10cbe1;})[_0x99df('0x24')](respondWithResult(_0x43be0c,0xc9))[_0x99df('0x48')](handleError(_0x43be0c,null));};exports[_0x99df('0x23')]=function(_0x41fa4a,_0x105f5f){if(_0x41fa4a[_0x99df('0x4d')]['id']){delete _0x41fa4a[_0x99df('0x4d')]['id'];}return db[_0x99df('0x30')]['find']({'where':{'id':_0x41fa4a[_0x99df('0x53')]['id']}})[_0x99df('0x24')](handleEntityNotFound(_0x105f5f,null))[_0x99df('0x24')](saveUpdates(_0x41fa4a[_0x99df('0x4d')],null))[_0x99df('0x24')](respondWithResult(_0x105f5f,null))[_0x99df('0x48')](handleError(_0x105f5f,null));};exports['destroy']=function(_0x4ce531,_0x21937d){return db[_0x99df('0x30')]['find']({'where':{'id':_0x4ce531[_0x99df('0x53')]['id']}})[_0x99df('0x24')](handleEntityNotFound(_0x21937d,null))[_0x99df('0x24')](removeEntity(_0x21937d,null))['catch'](handleError(_0x21937d,null));};exports[_0x99df('0x54')]=function(_0x143c44,_0x3a4bcf,_0x36ad80){var _0x4714c5=require(_0x99df('0x55'));return db[_0x99df('0x30')]['find']({'where':{'id':_0x143c44[_0x99df('0x53')]['id']},'raw':!![]})[_0x99df('0x24')](handleEntityNotFound(_0x3a4bcf,null))[_0x99df('0x24')](function(){_0x4714c5[_0x99df('0x54')](_0x143c44[_0x99df('0x53')]['id']);})[_0x99df('0x24')](respondWithStatusCode(_0x3a4bcf,null))[_0x99df('0x48')](handleError(_0x3a4bcf,null));};
\ No newline at end of file
index d072a21..b9dc48d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43c0=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','tools_schedules','lodash'];(function(_0x3ad451,_0x204dc2){var _0x178759=function(_0x173a20){while(--_0x173a20){_0x3ad451['push'](_0x3ad451['shift']());}};_0x178759(++_0x204dc2);}(_0x43c0,0x15d));var _0x043c=function(_0x501171,_0x342d07){_0x501171=_0x501171-0x0;var _0x490d17=_0x43c0[_0x501171];return _0x490d17;};'use strict';var _=require(_0x043c('0x0'));var util=require(_0x043c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x043c('0x2'));var BPromise=require(_0x043c('0x3'));var rp=require(_0x043c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x043c('0x5'));var config=require(_0x043c('0x6'));var attributes=require(_0x043c('0x7'));module[_0x043c('0x8')]=function(_0x12efdb,_0x45e5f5){return _0x12efdb['define']('Schedule',attributes,{'tableName':_0x043c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd326=['tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x32153d,_0x52a3c2){var _0x2204e=function(_0x5a1350){while(--_0x5a1350){_0x32153d['push'](_0x32153d['shift']());}};_0x2204e(++_0x52a3c2);}(_0xd326,0x155));var _0x6d32=function(_0xb194e4,_0x34e9ed){_0xb194e4=_0xb194e4-0x0;var _0x2761d7=_0xd326[_0xb194e4];return _0x2761d7;};'use strict';var _=require(_0x6d32('0x0'));var util=require(_0x6d32('0x1'));var logger=require(_0x6d32('0x2'))(_0x6d32('0x3'));var moment=require(_0x6d32('0x4'));var BPromise=require(_0x6d32('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d32('0x6'));var rimraf=require(_0x6d32('0x7'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x6d32('0x8')]=function(_0x5a70fb,_0x2c1b7d){return _0x5a70fb['define']('Schedule',attributes,{'tableName':_0x6d32('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 40bfc89..3553fad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b2e=['debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x3b2e,0x1eb));var _0xe3b2=function(_0x154f21,_0x3c7f37){_0x154f21=_0x154f21-0x0;var _0x5ae16f=_0x3b2e[_0x154f21];return _0x5ae16f;};'use strict';var _=require('lodash');var util=require(_0xe3b2('0x0'));var moment=require('moment');var BPromise=require(_0xe3b2('0x1'));var rs=require(_0xe3b2('0x2'));var fs=require('fs');var Redis=require(_0xe3b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3b2('0x4'));var logger=require(_0xe3b2('0x5'))(_0xe3b2('0x6'));var config=require(_0xe3b2('0x7'));var jayson=require(_0xe3b2('0x8'));var client=jayson[_0xe3b2('0x9')][_0xe3b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50a419,_0x36d353,_0x40e5a5){return new BPromise(function(_0x55d4dc,_0x26a3bd){return client[_0xe3b2('0xb')](_0x50a419,_0x40e5a5)[_0xe3b2('0xc')](function(_0x3d2643){logger[_0xe3b2('0xd')](_0xe3b2('0xe'),_0x36d353,'request\x20sent');logger[_0xe3b2('0xf')](_0xe3b2('0x10'),_0x36d353,_0xe3b2('0x11'),JSON['stringify'](_0x3d2643));if(_0x3d2643[_0xe3b2('0x12')]){if(_0x3d2643[_0xe3b2('0x12')][_0xe3b2('0x13')]===0x1f4){logger[_0xe3b2('0x12')]('Schedule,\x20%s,\x20%s',_0x36d353,_0x3d2643[_0xe3b2('0x12')][_0xe3b2('0x14')]);return _0x26a3bd(_0x3d2643[_0xe3b2('0x12')][_0xe3b2('0x14')]);}logger['error'](_0xe3b2('0xe'),_0x36d353,_0x3d2643[_0xe3b2('0x12')]['message']);return _0x55d4dc(_0x3d2643['error'][_0xe3b2('0x14')]);}else{logger[_0xe3b2('0xd')](_0xe3b2('0xe'),_0x36d353,_0xe3b2('0x11'));_0x55d4dc(_0x3d2643[_0xe3b2('0x15')][_0xe3b2('0x14')]);}})['catch'](function(_0x96aa7f){logger[_0xe3b2('0x12')]('Schedule,\x20%s,\x20%s',_0x36d353,_0x96aa7f);_0x26a3bd(_0x96aa7f);});});}
\ No newline at end of file
+var _0xf4c7=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x29e75b,_0x4f4674){var _0x4f62a3=function(_0xa82ee3){while(--_0xa82ee3){_0x29e75b['push'](_0x29e75b['shift']());}};_0x4f62a3(++_0x4f4674);}(_0xf4c7,0x1bd));var _0x7f4c=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0xf4c7[_0xcfeff4];return _0xb2fadc;};'use strict';var _=require(_0x7f4c('0x0'));var util=require(_0x7f4c('0x1'));var moment=require('moment');var BPromise=require(_0x7f4c('0x2'));var rs=require(_0x7f4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f4c('0x4'))['db'];var utils=require(_0x7f4c('0x5'));var logger=require('../../config/logger')(_0x7f4c('0x6'));var config=require(_0x7f4c('0x7'));var jayson=require(_0x7f4c('0x8'));var client=jayson[_0x7f4c('0x9')][_0x7f4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56b86e,_0xd452c4,_0x1fda91){return new BPromise(function(_0xf0ef08,_0x2bac43){return client['request'](_0x56b86e,_0x1fda91)[_0x7f4c('0xb')](function(_0x15294d){logger['info'](_0x7f4c('0xc'),_0xd452c4,_0x7f4c('0xd'));logger[_0x7f4c('0xe')](_0x7f4c('0xf'),_0xd452c4,'request\x20sent',JSON[_0x7f4c('0x10')](_0x15294d));if(_0x15294d[_0x7f4c('0x11')]){if(_0x15294d[_0x7f4c('0x11')][_0x7f4c('0x12')]===0x1f4){logger['error'](_0x7f4c('0xc'),_0xd452c4,_0x15294d[_0x7f4c('0x11')][_0x7f4c('0x13')]);return _0x2bac43(_0x15294d[_0x7f4c('0x11')][_0x7f4c('0x13')]);}logger[_0x7f4c('0x11')](_0x7f4c('0xc'),_0xd452c4,_0x15294d['error']['message']);return _0xf0ef08(_0x15294d['error'][_0x7f4c('0x13')]);}else{logger[_0x7f4c('0x14')](_0x7f4c('0xc'),_0xd452c4,_0x7f4c('0xd'));_0xf0ef08(_0x15294d[_0x7f4c('0x15')][_0x7f4c('0x13')]);}})[_0x7f4c('0x16')](function(_0x48c080){logger[_0x7f4c('0x11')](_0x7f4c('0xc'),_0xd452c4,_0x48c080);_0x2bac43(_0x48c080);});});}
\ No newline at end of file
index 070d3c0..39b1b33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cd4=['create','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x9cd4,0x1d1));var _0x49cd=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0x9cd4[_0x4d521e];return _0x3beb42;};'use strict';var multer=require(_0x49cd('0x0'));var util=require(_0x49cd('0x1'));var path=require(_0x49cd('0x2'));var timeout=require(_0x49cd('0x3'));var express=require(_0x49cd('0x4'));var router=express[_0x49cd('0x5')]();var fs_extra=require(_0x49cd('0x6'));var auth=require(_0x49cd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x49cd('0x8'));var controller=require('./screenRecording.controller');router[_0x49cd('0x9')]('/',auth['isAuthenticated'](),controller[_0x49cd('0xa')]);router[_0x49cd('0x9')](_0x49cd('0xb'),auth[_0x49cd('0xc')](),controller[_0x49cd('0xd')]);router[_0x49cd('0x9')](_0x49cd('0xe'),auth[_0x49cd('0xc')](),controller[_0x49cd('0xf')]);router[_0x49cd('0x9')](_0x49cd('0x10'),auth[_0x49cd('0xc')](),controller[_0x49cd('0x11')]);router['post']('/',auth[_0x49cd('0xc')](),controller[_0x49cd('0x12')]);router[_0x49cd('0x13')](_0x49cd('0xe'),auth[_0x49cd('0xc')](),controller['update']);router['delete'](_0x49cd('0xe'),auth[_0x49cd('0xc')](),controller['destroy']);module[_0x49cd('0x14')]=router;
\ No newline at end of file
+var _0x763e=['delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','post','create','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x763e,0x1a3));var _0xe763=function(_0x279438,_0x2116c4){_0x279438=_0x279438-0x0;var _0x331965=_0x763e[_0x279438];return _0x331965;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe763('0x0'));var timeout=require(_0xe763('0x1'));var express=require(_0xe763('0x2'));var router=express[_0xe763('0x3')]();var fs_extra=require(_0xe763('0x4'));var auth=require(_0xe763('0x5'));var interaction=require(_0xe763('0x6'));var config=require(_0xe763('0x7'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0xe763('0x8')](),controller[_0xe763('0x9')]);router[_0xe763('0xa')](_0xe763('0xb'),auth[_0xe763('0x8')](),controller[_0xe763('0xc')]);router[_0xe763('0xa')](_0xe763('0xd'),auth['isAuthenticated'](),controller[_0xe763('0xe')]);router[_0xe763('0xa')](_0xe763('0xf'),auth['isAuthenticated'](),controller[_0xe763('0x10')]);router[_0xe763('0x11')]('/',auth[_0xe763('0x8')](),controller[_0xe763('0x12')]);router[_0xe763('0x13')](_0xe763('0xd'),auth[_0xe763('0x8')](),controller[_0xe763('0x14')]);router[_0xe763('0x15')](_0xe763('0xd'),auth[_0xe763('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4096ef2..c638b3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1241=['sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','format','DATE','MM-DD-YYYY\x20HH:mm','toString','updatedAt'];(function(_0x5e0233,_0x164399){var _0x319469=function(_0x3c1957){while(--_0x3c1957){_0x5e0233['push'](_0x5e0233['shift']());}};_0x319469(++_0x164399);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1124('0x0'));var moment=require('moment');var path=require(_0x1124('0x1'));var config=require(_0x1124('0x2'));module[_0x1124('0x3')]={'format':{'type':Sequelize[_0x1124('0x4')],'get':function(){return this[_0x1124('0x5')]('value')?path[_0x1124('0x6')](this[_0x1124('0x5')](_0x1124('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1124('0x8')]},'value':{'type':Sequelize[_0x1124('0x8')],'set':function(_0x45200c){var _0x3fe52a=_0x45200c['replace'](/\\/g,'/');this['setDataValue']('value',_0x3fe52a);}},'rating':{'type':Sequelize[_0x1124('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x159c1c){this[_0x1124('0xa')](_0x1124('0xb'),moment()[_0x1124('0xc')](_0x159c1c,'ms'));this[_0x1124('0xa')](_0x1124('0xd'),moment());this['setDataValue'](_0x1124('0xe'),_0x159c1c);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x1124('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x1124('0x10')],'get':function(){return moment(this[_0x1124('0x5')](_0x1124('0xd')))['format'](_0x1124('0x11'))[_0x1124('0x12')]();}},'createdAt':{'type':Sequelize[_0x1124('0x10')],'get':function(){return moment(this[_0x1124('0x5')]('createdAt'))[_0x1124('0xf')](_0x1124('0x11'))[_0x1124('0x12')]();}},'updatedAt':{'type':Sequelize[_0x1124('0x10')],'get':function(){return moment(this[_0x1124('0x5')](_0x1124('0x13')))[_0x1124('0xf')](_0x1124('0x11'))[_0x1124('0x12')]();}}};
\ No newline at end of file
+var _0x202a=['createdAt','updatedAt','moment','path','../../config/environment','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','toString','DATE','MM-DD-YYYY\x20HH:mm'];(function(_0xb22dbd,_0x46259d){var _0x5d7016=function(_0x2a550e){while(--_0x2a550e){_0xb22dbd['push'](_0xb22dbd['shift']());}};_0x5d7016(++_0x46259d);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa202('0x0'));var path=require(_0xa202('0x1'));var config=require(_0xa202('0x2'));module['exports']={'format':{'type':Sequelize[_0xa202('0x3')],'get':function(){return this['getDataValue']('value')?path['extname'](this[_0xa202('0x4')](_0xa202('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xa202('0x6')],'set':function(_0x4cb469){var _0x4f0a59=_0x4cb469['replace'](/\\/g,'/');this[_0xa202('0x7')](_0xa202('0x5'),_0x4f0a59);}},'rating':{'type':Sequelize[_0xa202('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa202('0x8')],'set':function(_0x572036){this['setDataValue'](_0xa202('0x9'),moment()[_0xa202('0xa')](_0x572036,'ms'));this[_0xa202('0x7')](_0xa202('0xb'),moment());this['setDataValue'](_0xa202('0xc'),_0x572036);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa202('0x4')](_0xa202('0x9')))[_0xa202('0xd')]('MM-DD-YYYY\x20HH:mm')[_0xa202('0xe')]();}},'closedAt':{'type':Sequelize[_0xa202('0xf')],'get':function(){return moment(this[_0xa202('0x4')](_0xa202('0xb')))[_0xa202('0xd')](_0xa202('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0xa202('0xf')],'get':function(){return moment(this[_0xa202('0x4')](_0xa202('0x11')))[_0xa202('0xd')](_0xa202('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xa202('0xf')],'get':function(){return moment(this[_0xa202('0x4')](_0xa202('0x12')))[_0xa202('0xd')](_0xa202('0x10'))[_0xa202('0xe')]();}}};
\ No newline at end of file
index cecc6c9..b9b1469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0bb=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x302ab3,_0x21ab7b){_0x302ab3=_0x302ab3-0x0;var _0x12c0ca=_0xd0bb[_0x302ab3];return _0x12c0ca;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require(_0xbd0b('0x1'));var zipdir=require(_0xbd0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0b('0x3'));var moment=require('moment');var BPromise=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var util=require('util');var path=require(_0xbd0b('0x6'));var sox=require('sox');var csv=require(_0xbd0b('0x7'));var ejs=require(_0xbd0b('0x8'));var fs=require('fs');var fs_extra=require(_0xbd0b('0x9'));var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x7'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var licenseUtil=require(_0xbd0b('0x15'));var db=require(_0xbd0b('0x16'))['db'];function respondWithStatusCode(_0x315ed9,_0x2621bf){_0x2621bf=_0x2621bf||0xcc;return function(_0x42a96b){if(_0x42a96b){return _0x315ed9[_0xbd0b('0x17')](_0x2621bf);}return _0x315ed9[_0xbd0b('0x18')](_0x2621bf)[_0xbd0b('0x19')]();};}function respondWithResult(_0x1c10c1,_0x2d4664){_0x2d4664=_0x2d4664||0xc8;return function(_0x57077a){if(_0x57077a){return _0x1c10c1[_0xbd0b('0x18')](_0x2d4664)['json'](_0x57077a);}};}function respondWithFilteredResult(_0x4a8014,_0x36d1ca){return function(_0x4c0e52){if(_0x4c0e52){var _0x3183cf=typeof _0x36d1ca[_0xbd0b('0x1a')]===_0xbd0b('0x1b')&&typeof _0x36d1ca['limit']==='undefined';var _0x2136ef=_0x4c0e52[_0xbd0b('0x1c')];var _0x1f2a6e=_0x3183cf?0x0:_0x36d1ca[_0xbd0b('0x1a')];var _0x1c0a7c=_0x3183cf?_0x4c0e52[_0xbd0b('0x1c')]:_0x36d1ca['offset']+_0x36d1ca[_0xbd0b('0x1d')];var _0x49499f;if(_0x1c0a7c>=_0x2136ef){_0x1c0a7c=_0x2136ef;_0x49499f=0xc8;}else{_0x49499f=0xce;}_0x4a8014[_0xbd0b('0x18')](_0x49499f);return _0x4a8014[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x1f2a6e+'-'+_0x1c0a7c+'/'+_0x2136ef)[_0xbd0b('0x20')](_0x4c0e52);}return null;};}function patchUpdates(_0x4b312d){return function(_0x403c91){try{jsonpatch[_0xbd0b('0x21')](_0x403c91,_0x4b312d,!![]);}catch(_0x40b021){return BPromise['reject'](_0x40b021);}return _0x403c91[_0xbd0b('0x22')]();};}function saveUpdates(_0x560db4,_0xc66b8){return function(_0x3c4938){if(_0x3c4938){return _0x3c4938[_0xbd0b('0x23')](_0x560db4)[_0xbd0b('0x24')](function(_0x297c85){return _0x297c85;});}return null;};}function removeEntity(_0x539359,_0x75909f){return function(_0x58a721){if(_0x58a721){return _0x58a721[_0xbd0b('0x25')]()[_0xbd0b('0x24')](function(){_0x539359[_0xbd0b('0x18')](0xcc)[_0xbd0b('0x19')]();});}};}function handleEntityNotFound(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(!_0x4fe9ed){_0xfd9f82[_0xbd0b('0x17')](0x194);}return _0x4fe9ed;};}function handleError(_0x1b46a3,_0x33b752){_0x33b752=_0x33b752||0x1f4;return function(_0x1b5a00){logger[_0xbd0b('0x26')](_0x1b5a00[_0xbd0b('0x27')]);if(_0x1b5a00['name']){delete _0x1b5a00[_0xbd0b('0x28')];}_0x1b46a3[_0xbd0b('0x18')](_0x33b752)[_0xbd0b('0x29')](_0x1b5a00);};}exports['index']=function(_0x4dfe76,_0x2187a5){var _0x684b09={},_0x14e5a3={},_0xf4ba04={'count':0x0,'rows':[]};var _0x4e2149=_[_0xbd0b('0x2a')](db[_0xbd0b('0x2b')]['rawAttributes'],function(_0x45f7d6){return{'name':_0x45f7d6[_0xbd0b('0x2c')],'type':_0x45f7d6['type']['key']};});_0x14e5a3[_0xbd0b('0x2d')]=_[_0xbd0b('0x2e')](_['map'](_0x4e2149,_0xbd0b('0x28')),[_0xbd0b('0x2f')]);_0x14e5a3[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x4dfe76[_0xbd0b('0x30')]);_0x14e5a3[_0xbd0b('0x32')]=_['intersection'](_0x14e5a3[_0xbd0b('0x2d')],_0x14e5a3[_0xbd0b('0x30')]);_0x684b09[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x14e5a3[_0xbd0b('0x2d')],qs[_0xbd0b('0x35')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x684b09[_0xbd0b('0x33')]=_0x684b09[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x684b09[_0xbd0b('0x33')]:_0x14e5a3[_0xbd0b('0x2d')];if(!_0x4dfe76[_0xbd0b('0x30')]['hasOwnProperty'](_0xbd0b('0x37'))){_0x684b09[_0xbd0b('0x1d')]=qs['limit'](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1d')]);_0x684b09[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1a')]);}_0x684b09['order']=qs[_0xbd0b('0x38')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x38')]);_0x684b09[_0xbd0b('0x39')]=qs[_0xbd0b('0x32')](_['pick'](_0x4dfe76['query'],_0x14e5a3[_0xbd0b('0x32')]),_0x4e2149);if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]){_0x684b09[_0xbd0b('0x39')]=_['merge'](_0x684b09['where'],{'$or':_[_0xbd0b('0x2a')](_0x4e2149,function(_0x4d8237){if(_0x4d8237[_0xbd0b('0x3b')]!==_0xbd0b('0x3c')){var _0x3f34dc={};_0x3f34dc[_0x4d8237[_0xbd0b('0x28')]]={'$like':'%'+_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]+'%'};return _0x3f34dc;}})});}_0x684b09=_[_0xbd0b('0x3d')]({},_0x684b09,_0x4dfe76[_0xbd0b('0x3e')]);var _0x2acc9f={'where':_0x684b09[_0xbd0b('0x39')]};return db[_0xbd0b('0x2b')][_0xbd0b('0x1c')](_0x2acc9f)[_0xbd0b('0x24')](function(_0x425c8a){_0xf4ba04[_0xbd0b('0x1c')]=_0x425c8a;if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x684b09[_0xbd0b('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0xbd0b('0x41')](_0x684b09);})[_0xbd0b('0x24')](function(_0x89b5ea){_0xf4ba04[_0xbd0b('0x42')]=_0x89b5ea;return _0xf4ba04;})[_0xbd0b('0x24')](respondWithFilteredResult(_0x2187a5,_0x684b09))[_0xbd0b('0x43')](handleError(_0x2187a5,null));};exports[_0xbd0b('0x44')]=function(_0x1b4497,_0x2a1a1d){var _0x4d72f={'raw':![],'where':{'id':_0x1b4497[_0xbd0b('0x45')]['id']}},_0xa252a2={};_0xa252a2['model']=_[_0xbd0b('0x31')](db['ScreenRecording']['rawAttributes']);_0xa252a2[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x1b4497[_0xbd0b('0x30')]);_0xa252a2['filters']=_[_0xbd0b('0x34')](_0xa252a2[_0xbd0b('0x2d')],_0xa252a2[_0xbd0b('0x30')]);_0x4d72f[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0xa252a2['model'],qs[_0xbd0b('0x35')](_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x4d72f[_0xbd0b('0x33')]=_0x4d72f[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x4d72f['attributes']:_0xa252a2[_0xbd0b('0x2d')];if(_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x4d72f[_0xbd0b('0x40')]=[{'all':!![]}];}_0x4d72f=_[_0xbd0b('0x3d')]({},_0x4d72f,_0x1b4497[_0xbd0b('0x3e')]);return db[_0xbd0b('0x2b')][_0xbd0b('0x46')](_0x4d72f)[_0xbd0b('0x24')](handleEntityNotFound(_0x2a1a1d,null))[_0xbd0b('0x24')](respondWithResult(_0x2a1a1d,null))[_0xbd0b('0x43')](handleError(_0x2a1a1d,null));};exports[_0xbd0b('0x47')]=function(_0x222ee1,_0x30f77e){return db[_0xbd0b('0x2b')][_0xbd0b('0x47')](_0x222ee1[_0xbd0b('0x48')],{})[_0xbd0b('0x24')](respondWithResult(_0x30f77e,0xc9))[_0xbd0b('0x43')](handleError(_0x30f77e,null));};exports[_0xbd0b('0x23')]=function(_0x3cfb52,_0xbd64e2){if(_0x3cfb52[_0xbd0b('0x48')]['id']){delete _0x3cfb52['body']['id'];}delete _0x3cfb52[_0xbd0b('0x48')][_0xbd0b('0x49')];delete _0x3cfb52['body']['createdAt'];delete _0x3cfb52['body'][_0xbd0b('0x4a')];delete _0x3cfb52['body'][_0xbd0b('0x4b')];return db[_0xbd0b('0x2b')][_0xbd0b('0x46')]({'where':{'id':_0x3cfb52[_0xbd0b('0x45')]['id']}})['then'](handleEntityNotFound(_0xbd64e2,null))[_0xbd0b('0x24')](saveUpdates(_0x3cfb52['body'],null))[_0xbd0b('0x24')](respondWithResult(_0xbd64e2,null))['catch'](handleError(_0xbd64e2,null));};exports['describe']=function(_0x80d89a,_0x22f741){return db[_0xbd0b('0x2b')][_0xbd0b('0x4c')]()[_0xbd0b('0x24')](respondWithResult(_0x22f741,null))[_0xbd0b('0x43')](handleError(_0x22f741,null));};exports[_0xbd0b('0x4d')]=function(_0x2a7252,_0x4cc013,_0x48a78c){var _0x2d13fd=require(_0xbd0b('0x4e'));var _0x5094bd=![];var _0x514985={};if(_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]&&_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]==='uniqueid'){_0x514985[_0xbd0b('0x4f')]=_0x2a7252[_0xbd0b('0x45')]['id'];}else{_0x514985['id']=_0x2a7252[_0xbd0b('0x45')]['id'];}return db[_0xbd0b('0x2b')]['find']({'where':_0x514985,'attributes':['id',_0xbd0b('0x4b')],'raw':!![]})[_0xbd0b('0x24')](handleEntityNotFound(_0x4cc013,null))['then'](function(_0x122a19){if(_0x122a19){var _0x1ea443=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],_0xbd0b('0x52'),_0x122a19[_0xbd0b('0x4b')]);var _0x3a526a=util[_0xbd0b('0x2f')]('%s.cypher',_0x1ea443);if(fs[_0xbd0b('0x53')](_0x3a526a)){_0x5094bd=!![];return _0x2d13fd[_0xbd0b('0x54')](_0x3a526a,_0x1ea443,config[_0xbd0b('0x55')][_0xbd0b('0x56')])[_0xbd0b('0x24')](function(){return _0x122a19;});}return _0x122a19;}})[_0xbd0b('0x24')](function(_0x49b7a6){if(_0x49b7a6){var _0x570648=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x49b7a6[_0xbd0b('0x4b')]);if(!fs[_0xbd0b('0x53')](_0x570648)){throw new db[(_0xbd0b('0x57'))][(_0xbd0b('0x58'))](_0xbd0b('0x59'));}if(_0x49b7a6['filename']){return _0x4cc013[_0xbd0b('0x4d')](_0x570648,_0x49b7a6[_0xbd0b('0x5a')]+path[_0xbd0b('0x5b')](_0x570648),function(){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}else{return _0x4cc013[_0xbd0b('0x4d')](_0x570648,function(_0xa08f72){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}}})[_0xbd0b('0x43')](function(_0x429534){if(_0x429534[_0xbd0b('0x5d')]===_0xbd0b('0x59')){_0x4cc013[_0xbd0b('0x18')](0x194)[_0xbd0b('0x29')](_0xbd0b('0x5e'));}else{return handleError(_0x4cc013,null);}});};exports[_0xbd0b('0x25')]=function(_0x1fefd5,_0x1e0beb){return db['ScreenRecording'][_0xbd0b('0x46')]({'where':{'id':_0x1fefd5[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x24')](function(_0x2c935c){if(_['isNil'](_0x2c935c)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2c935c;})[_0xbd0b('0x24')](function(_0x45c6b5){var _0x4317f0=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x45c6b5[_0xbd0b('0x4b')]);logger['info'](_0xbd0b('0x5f'),_0x4317f0);if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs[_0xbd0b('0x53')](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbd0b('0x63')](_0x4317f0);}_0x4317f0=_0x4317f0+_0xbd0b('0x64');if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs['existsSync'](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+_0xbd0b('0x65'));fs[_0xbd0b('0x63')](_0x4317f0);}return _0x45c6b5;})[_0xbd0b('0x24')](function(_0x4df3df){if(!_0x4df3df)throw new InternalError();return _0x4df3df['destroy']();})[_0xbd0b('0x24')](function(){_0x1e0beb['status'](0xcc)[_0xbd0b('0x19')]();})[_0xbd0b('0x43')](handleError(_0x1e0beb,null));};
\ No newline at end of file
+var _0x5fc3=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','existsSync','decryptFile','secrets','join','Sequelize','ValidationError','filename','unlink','message','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x229663,_0x949652){var _0x4e0313=function(_0x31423f){while(--_0x31423f){_0x229663['push'](_0x229663['shift']());}};_0x4e0313(++_0x949652);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0x5fc3[_0x2e50a2];return _0x47e5de;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}exports['index']=function(_0x26b7cb,_0x645eac){var _0x383837={},_0x9f3c8a={},_0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x28')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x2b')]['key']};});_0x9f3c8a[_0x35fc('0x2c')]=_[_0x35fc('0x2d')](_[_0x35fc('0x28')](_0x134dfa,_0x35fc('0x26')),[_0x35fc('0x2e')]);_0x9f3c8a[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x26b7cb[_0x35fc('0x2f')]);_0x9f3c8a[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x9f3c8a['model'],_0x9f3c8a['query']);_0x383837[_0x35fc('0x33')]=_['intersection'](_0x9f3c8a[_0x35fc('0x2c')],qs[_0x35fc('0x34')](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x34')]));_0x383837[_0x35fc('0x33')]=_0x383837[_0x35fc('0x33')]['length']?_0x383837[_0x35fc('0x33')]:_0x9f3c8a[_0x35fc('0x2c')];if(!_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x35')](_0x35fc('0x36'))){_0x383837[_0x35fc('0x1c')]=qs['limit'](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x1c')]);_0x383837[_0x35fc('0x1a')]=qs['offset'](_0x26b7cb[_0x35fc('0x2f')]['offset']);}_0x383837[_0x35fc('0x37')]=qs[_0x35fc('0x38')](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x38')]);_0x383837['where']=qs['filters'](_['pick'](_0x26b7cb[_0x35fc('0x2f')],_0x9f3c8a['filters']),_0x134dfa);if(_0x26b7cb[_0x35fc('0x2f')]['filter']){_0x383837[_0x35fc('0x39')]=_[_0x35fc('0x3a')](_0x383837[_0x35fc('0x39')],{'$or':_[_0x35fc('0x28')](_0x134dfa,function(_0x1c10e0){if(_0x1c10e0[_0x35fc('0x2b')]!==_0x35fc('0x3b')){var _0x4ec0dc={};_0x4ec0dc[_0x1c10e0[_0x35fc('0x26')]]={'$like':'%'+_0x26b7cb[_0x35fc('0x2f')]['filter']+'%'};return _0x4ec0dc;}})});}_0x383837=_[_0x35fc('0x3a')]({},_0x383837,_0x26b7cb[_0x35fc('0x3c')]);var _0x1aac67={'where':_0x383837[_0x35fc('0x39')]};return db[_0x35fc('0x29')][_0x35fc('0x1d')](_0x1aac67)['then'](function(_0x3f6480){_0x3735da[_0x35fc('0x1d')]=_0x3f6480;if(_0x26b7cb[_0x35fc('0x2f')]['includeAll']){_0x383837[_0x35fc('0x3d')]=[{'all':!![]}];}return db[_0x35fc('0x29')]['findAll'](_0x383837);})[_0x35fc('0x24')](function(_0x280af1){_0x3735da[_0x35fc('0x3e')]=_0x280af1;return _0x3735da;})[_0x35fc('0x24')](respondWithFilteredResult(_0x645eac,_0x383837))[_0x35fc('0x3f')](handleError(_0x645eac,null));};exports[_0x35fc('0x40')]=function(_0x211b70,_0x3ec51f){var _0x5a7e9e={'raw':![],'where':{'id':_0x211b70[_0x35fc('0x41')]['id']}},_0x596e83={};_0x596e83[_0x35fc('0x2c')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x596e83[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x211b70['query']);_0x596e83[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x596e83[_0x35fc('0x2c')],_0x596e83[_0x35fc('0x2f')]);_0x5a7e9e['attributes']=_['intersection'](_0x596e83['model'],qs['fields'](_0x211b70['query'][_0x35fc('0x34')]));_0x5a7e9e[_0x35fc('0x33')]=_0x5a7e9e['attributes'][_0x35fc('0x42')]?_0x5a7e9e['attributes']:_0x596e83[_0x35fc('0x2c')];if(_0x211b70[_0x35fc('0x2f')][_0x35fc('0x43')]){_0x5a7e9e[_0x35fc('0x3d')]=[{'all':!![]}];}_0x5a7e9e=_[_0x35fc('0x3a')]({},_0x5a7e9e,_0x211b70['options']);return db[_0x35fc('0x29')][_0x35fc('0x44')](_0x5a7e9e)['then'](handleEntityNotFound(_0x3ec51f,null))[_0x35fc('0x24')](respondWithResult(_0x3ec51f,null))[_0x35fc('0x3f')](handleError(_0x3ec51f,null));};exports[_0x35fc('0x45')]=function(_0x211746,_0x5bc8c3){return db[_0x35fc('0x29')]['create'](_0x211746['body'],{})[_0x35fc('0x24')](respondWithResult(_0x5bc8c3,0xc9))[_0x35fc('0x3f')](handleError(_0x5bc8c3,null));};exports[_0x35fc('0x23')]=function(_0xca8aef,_0xf2ca20){if(_0xca8aef[_0x35fc('0x46')]['id']){delete _0xca8aef[_0x35fc('0x46')]['id'];}delete _0xca8aef[_0x35fc('0x46')]['duration'];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x47')];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x48')];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x49')];return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':{'id':_0xca8aef[_0x35fc('0x41')]['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0xf2ca20,null))[_0x35fc('0x24')](saveUpdates(_0xca8aef[_0x35fc('0x46')],null))[_0x35fc('0x24')](respondWithResult(_0xf2ca20,null))[_0x35fc('0x3f')](handleError(_0xf2ca20,null));};exports['describe']=function(_0x553ed6,_0x144f77){return db[_0x35fc('0x29')][_0x35fc('0x4a')]()[_0x35fc('0x24')](respondWithResult(_0x144f77,null))[_0x35fc('0x3f')](handleError(_0x144f77,null));};exports[_0x35fc('0x4b')]=function(_0x4a4798,_0x4f024c,_0x388521){var _0x19b2ce=require(_0x35fc('0x4c'));var _0x38bc78=![];var _0x5b2595={};if(_0x4a4798[_0x35fc('0x2f')][_0x35fc('0x2b')]&&_0x4a4798['query'][_0x35fc('0x2b')]===_0x35fc('0x4d')){_0x5b2595['uniqueid']=_0x4a4798[_0x35fc('0x41')]['id'];}else{_0x5b2595['id']=_0x4a4798[_0x35fc('0x41')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':_0x5b2595,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x4f024c,null))['then'](function(_0x240338){if(_0x240338){var _0x2ea8d6=path['join'](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x240338[_0x35fc('0x49')]);var _0x145854=util[_0x35fc('0x2e')]('%s.cypher',_0x2ea8d6);if(fs[_0x35fc('0x50')](_0x145854)){_0x38bc78=!![];return _0x19b2ce[_0x35fc('0x51')](_0x145854,_0x2ea8d6,config[_0x35fc('0x52')]['recording'])[_0x35fc('0x24')](function(){return _0x240338;});}return _0x240338;}})[_0x35fc('0x24')](function(_0x47fb1a){if(_0x47fb1a){var _0x35a676=path[_0x35fc('0x53')](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x47fb1a[_0x35fc('0x49')]);if(!fs[_0x35fc('0x50')](_0x35a676)){throw new db[(_0x35fc('0x54'))][(_0x35fc('0x55'))]('ScreenRecording\x20not\x20found');}if(_0x47fb1a[_0x35fc('0x56')]){return _0x4f024c[_0x35fc('0x4b')](_0x35a676,_0x47fb1a[_0x35fc('0x56')]+path['extname'](_0x35a676),function(){if(_0x38bc78){fs[_0x35fc('0x57')](_0x35a676);}});}else{return _0x4f024c['download'](_0x35a676,function(_0x4ceacc){if(_0x38bc78){fs['unlink'](_0x35a676);}});}}})[_0x35fc('0x3f')](function(_0xb1c68a){if(_0xb1c68a[_0x35fc('0x58')]===_0x35fc('0x59')){_0x4f024c[_0x35fc('0x18')](0x194)['send']('Not\x20found');}else{return handleError(_0x4f024c,null);}});};exports['destroy']=function(_0x4faef4,_0x51d231){return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':{'id':_0x4faef4[_0x35fc('0x41')]['id']}})[_0x35fc('0x24')](function(_0x511e8b){if(_[_0x35fc('0x5a')](_0x511e8b)){throw new ReferenceError(_0x35fc('0x5b'));}return _0x511e8b;})[_0x35fc('0x24')](function(_0x1b0063){var _0x37bea1=path[_0x35fc('0x53')](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x1b0063[_0x35fc('0x49')]);logger['info'](_0x35fc('0x5c'),_0x37bea1);if(!_['isNil'](_0x1b0063[_0x35fc('0x49')])&&fs[_0x35fc('0x50')](_0x37bea1)){logger[_0x35fc('0x5d')](_0x35fc('0x5e')+_0x37bea1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x35fc('0x5f')](_0x37bea1);}_0x37bea1=_0x37bea1+'.cypher';if(!_['isNil'](_0x1b0063['value'])&&fs[_0x35fc('0x50')](_0x37bea1)){logger['info'](_0x35fc('0x5e')+_0x37bea1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x35fc('0x5f')](_0x37bea1);}return _0x1b0063;})['then'](function(_0x42a53a){if(!_0x42a53a)throw new InternalError();return _0x42a53a[_0x35fc('0x25')]();})[_0x35fc('0x24')](function(){_0x51d231[_0x35fc('0x18')](0xcc)['end']();})[_0x35fc('0x3f')](handleError(_0x51d231,null));};
\ No newline at end of file
index 1fd4382..4735743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4d7=['bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','interactionid','lodash','util','../../config/logger','api','moment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf4d7,0xcb));var _0x7f4d=function(_0x3beb21,_0x4c3c48){_0x3beb21=_0x3beb21-0x0;var _0x2c6633=_0xf4d7[_0x3beb21];return _0x2c6633;};'use strict';var _=require(_0x7f4d('0x0'));var util=require(_0x7f4d('0x1'));var logger=require(_0x7f4d('0x2'))(_0x7f4d('0x3'));var moment=require(_0x7f4d('0x4'));var BPromise=require(_0x7f4d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f4d('0x6'));var rimraf=require(_0x7f4d('0x7'));var config=require(_0x7f4d('0x8'));var attributes=require(_0x7f4d('0x9'));module[_0x7f4d('0xa')]=function(_0x943ad9,_0x2f137c){return _0x943ad9[_0x7f4d('0xb')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x7f4d('0xc'),'fields':[_0x7f4d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x705b=['bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','util','api'];(function(_0x5269ac,_0x5586e1){var _0x43da1f=function(_0x42b145){while(--_0x42b145){_0x5269ac['push'](_0x5269ac['shift']());}};_0x43da1f(++_0x5586e1);}(_0x705b,0xd6));var _0xb705=function(_0x7c3bf0,_0x1f0a94){_0x7c3bf0=_0x7c3bf0-0x0;var _0x37ddaa=_0x705b[_0x7c3bf0];return _0x37ddaa;};'use strict';var _=require('lodash');var util=require(_0xb705('0x0'));var logger=require('../../config/logger')(_0xb705('0x1'));var moment=require('moment');var BPromise=require(_0xb705('0x2'));var rp=require(_0xb705('0x3'));var fs=require('fs');var path=require(_0xb705('0x4'));var rimraf=require(_0xb705('0x5'));var config=require(_0xb705('0x6'));var attributes=require(_0xb705('0x7'));module[_0xb705('0x8')]=function(_0x201ef4,_0x3c2deb){return _0x201ef4['define'](_0xb705('0x9'),attributes,{'tableName':_0xb705('0xa'),'paranoid':![],'indexes':[{'name':_0xb705('0xb'),'fields':[_0xb705('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index c5df440..1aaf316 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e2a=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis'];(function(_0x91204d,_0x33ed54){var _0x186029=function(_0x36a909){while(--_0x36a909){_0x91204d['push'](_0x91204d['shift']());}};_0x186029(++_0x33ed54);}(_0x4e2a,0x115));var _0xa4e2=function(_0x510c1b,_0x4d3281){_0x510c1b=_0x510c1b-0x0;var _0x326d22=_0x4e2a[_0x510c1b];return _0x326d22;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa4e2('0x0'));var rs=require(_0xa4e2('0x1'));var fs=require('fs');var Redis=require(_0xa4e2('0x2'));var db=require(_0xa4e2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4e2('0x4'))(_0xa4e2('0x5'));var config=require(_0xa4e2('0x6'));var jayson=require(_0xa4e2('0x7'));var client=jayson['client'][_0xa4e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34602f,_0x1e37fb,_0x14bd5d){return new BPromise(function(_0x1998da,_0x313314){return client[_0xa4e2('0x9')](_0x34602f,_0x14bd5d)[_0xa4e2('0xa')](function(_0x150ad6){logger[_0xa4e2('0xb')](_0xa4e2('0xc'),_0x1e37fb,_0xa4e2('0xd'));logger['debug'](_0xa4e2('0xe'),_0x1e37fb,'request\x20sent',JSON[_0xa4e2('0xf')](_0x150ad6));if(_0x150ad6[_0xa4e2('0x10')]){if(_0x150ad6[_0xa4e2('0x10')][_0xa4e2('0x11')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1e37fb,_0x150ad6[_0xa4e2('0x10')]['message']);return _0x313314(_0x150ad6[_0xa4e2('0x10')][_0xa4e2('0x12')]);}logger[_0xa4e2('0x10')](_0xa4e2('0xc'),_0x1e37fb,_0x150ad6[_0xa4e2('0x10')][_0xa4e2('0x12')]);return _0x1998da(_0x150ad6[_0xa4e2('0x10')][_0xa4e2('0x12')]);}else{logger[_0xa4e2('0xb')](_0xa4e2('0xc'),_0x1e37fb,_0xa4e2('0xd'));_0x1998da(_0x150ad6[_0xa4e2('0x13')][_0xa4e2('0x12')]);}})['catch'](function(_0x3d6aad){logger[_0xa4e2('0x10')](_0xa4e2('0xc'),_0x1e37fb,_0x3d6aad);_0x313314(_0x3d6aad);});});}
\ No newline at end of file
+var _0xc447=['ioredis','../../mysqldb','../../config/environment','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring'];(function(_0x489d01,_0x1adf59){var _0x21a3b0=function(_0x4f4067){while(--_0x4f4067){_0x489d01['push'](_0x489d01['shift']());}};_0x21a3b0(++_0x1adf59);}(_0xc447,0x153));var _0x7c44=function(_0x1f33c1,_0x5f8298){_0x1f33c1=_0x1f33c1-0x0;var _0x35fc48=_0xc447[_0x1f33c1];return _0x35fc48;};'use strict';var _=require('lodash');var util=require(_0x7c44('0x0'));var moment=require(_0x7c44('0x1'));var BPromise=require('bluebird');var rs=require(_0x7c44('0x2'));var fs=require('fs');var Redis=require(_0x7c44('0x3'));var db=require(_0x7c44('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7c44('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7c44('0x6')][_0x7c44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ad323,_0x1b807c,_0x70b9c2){return new BPromise(function(_0x274604,_0x3d1f8e){return client[_0x7c44('0x8')](_0x2ad323,_0x70b9c2)[_0x7c44('0x9')](function(_0x14d1c2){logger['info'](_0x7c44('0xa'),_0x1b807c,_0x7c44('0xb'));logger[_0x7c44('0xc')](_0x7c44('0xd'),_0x1b807c,'request\x20sent',JSON[_0x7c44('0xe')](_0x14d1c2));if(_0x14d1c2[_0x7c44('0xf')]){if(_0x14d1c2[_0x7c44('0xf')][_0x7c44('0x10')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1b807c,_0x14d1c2[_0x7c44('0xf')]['message']);return _0x3d1f8e(_0x14d1c2[_0x7c44('0xf')][_0x7c44('0x11')]);}logger[_0x7c44('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x1b807c,_0x14d1c2[_0x7c44('0xf')][_0x7c44('0x11')]);return _0x274604(_0x14d1c2[_0x7c44('0xf')]['message']);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x1b807c,_0x7c44('0xb'));_0x274604(_0x14d1c2['result'][_0x7c44('0x11')]);}})[_0x7c44('0x12')](function(_0x37e4c0){logger[_0x7c44('0xf')](_0x7c44('0xa'),_0x1b807c,_0x37e4c0);_0x3d1f8e(_0x37e4c0);});});}
\ No newline at end of file
index 9305b4b..d95f034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x770b=['single','addLogoLogin','preferred','favicon','/:id/favicon','addFavicon','put','isAuthenticated','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','index','get','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getFavicon','diskStorage','root','format','%s%s','extname','originalname','post','file','addLogo','join','server/files/images/logos/','logologin'];(function(_0x1f454d,_0x1dc9e9){var _0x4d2b99=function(_0x17c684){while(--_0x17c684){_0x1f454d['push'](_0x1f454d['shift']());}};_0x4d2b99(++_0x1dc9e9);}(_0x770b,0x12f));var _0xb770=function(_0x4e6e98,_0x179c06){_0x4e6e98=_0x4e6e98-0x0;var _0x2ef31a=_0x770b[_0x4e6e98];return _0x2ef31a;};'use strict';var multer=require(_0xb770('0x0'));var util=require(_0xb770('0x1'));var path=require('path');var timeout=require(_0xb770('0x2'));var express=require('express');var router=express[_0xb770('0x3')]();var fs_extra=require(_0xb770('0x4'));var auth=require(_0xb770('0x5'));var interaction=require(_0xb770('0x6'));var config=require('../../config/environment');var controller=require(_0xb770('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb770('0x8')]);router[_0xb770('0x9')](_0xb770('0xa'),controller[_0xb770('0xb')]);router[_0xb770('0x9')](_0xb770('0xc'),controller[_0xb770('0xd')]);router[_0xb770('0x9')](_0xb770('0xe'),controller['getLogo']);router[_0xb770('0x9')](_0xb770('0xf'),controller[_0xb770('0x10')]);router[_0xb770('0x9')](_0xb770('0x11'),controller[_0xb770('0x12')]);router['get'](_0xb770('0x13'),controller['getPreferred']);router['get']('/:id/favicon',controller[_0xb770('0x14')]);var upload=multer({'storage':multer[_0xb770('0x15')]({'destination':function(_0x103cb4,_0x2dd342,_0x533327){_0x533327(null,path['join'](config[_0xb770('0x16')],'server/files/images/logos/'));},'filename':function(_0x2627e9,_0x39752f,_0x4851d6){_0x4851d6(null,util[_0xb770('0x17')](_0xb770('0x18'),'logo',path[_0xb770('0x19')](_0x39752f[_0xb770('0x1a')])));}})});router[_0xb770('0x1b')](_0xb770('0xe'),upload['single'](_0xb770('0x1c')),controller[_0xb770('0x1d')]);var upload=multer({'storage':multer[_0xb770('0x15')]({'destination':function(_0x5839ed,_0x25e78c,_0x214b0e){_0x214b0e(null,path[_0xb770('0x1e')](config[_0xb770('0x16')],_0xb770('0x1f')));},'filename':function(_0x57016b,_0xd6e7d9,_0x6a0cba){_0x6a0cba(null,util[_0xb770('0x17')](_0xb770('0x18'),_0xb770('0x20'),path[_0xb770('0x19')](_0xd6e7d9[_0xb770('0x1a')])));}})});router[_0xb770('0x1b')]('/:id/logo_login',upload[_0xb770('0x21')](_0xb770('0x1c')),controller[_0xb770('0x22')]);var upload=multer({'storage':multer[_0xb770('0x15')]({'destination':function(_0x3124d2,_0x597f3a,_0x16de77){_0x16de77(null,path[_0xb770('0x1e')](config[_0xb770('0x16')],_0xb770('0x1f')));},'filename':function(_0x55e075,_0x10f65b,_0xa6df1b){_0xa6df1b(null,util[_0xb770('0x17')](_0xb770('0x18'),_0xb770('0x23'),path[_0xb770('0x19')](_0x10f65b['originalname'])));}})});router[_0xb770('0x1b')]('/:id/preferred',upload[_0xb770('0x21')](_0xb770('0x1c')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb10e19,_0x4192db,_0x499227){_0x499227(null,path['join'](config[_0xb770('0x16')],_0xb770('0x1f')));},'filename':function(_0x4b8af8,_0x13d39d,_0x52e2d1){_0x52e2d1(null,util['format'](_0xb770('0x18'),_0xb770('0x24'),path[_0xb770('0x19')](_0x13d39d['originalname'])));}})});router['post'](_0xb770('0x25'),upload['single'](_0xb770('0x1c')),controller[_0xb770('0x26')]);router[_0xb770('0x27')](_0xb770('0xc'),auth[_0xb770('0x28')](),controller['update']);module[_0xb770('0x29')]=router;
\ No newline at end of file
+var _0x9f48=['getLogo','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','originalname','post','/:id/logo','single','file','format','logologin','extname','/:id/logo_login','preferred','put','isAuthenticated','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./setting.controller','get','/now','getDate','/:id','show'];(function(_0x42d525,_0x3326f3){var _0x2a2c53=function(_0x1b1880){while(--_0x1b1880){_0x42d525['push'](_0x42d525['shift']());}};_0x2a2c53(++_0x3326f3);}(_0x9f48,0xcc));var _0x89f4=function(_0x148aed,_0x2b6d80){_0x148aed=_0x148aed-0x0;var _0x131799=_0x9f48[_0x148aed];return _0x131799;};'use strict';var multer=require(_0x89f4('0x0'));var util=require('util');var path=require(_0x89f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x89f4('0x2'));var router=express[_0x89f4('0x3')]();var fs_extra=require(_0x89f4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x89f4('0x5'));var config=require('../../config/environment');var controller=require(_0x89f4('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x89f4('0x7')](_0x89f4('0x8'),controller[_0x89f4('0x9')]);router['get'](_0x89f4('0xa'),controller[_0x89f4('0xb')]);router[_0x89f4('0x7')]('/:id/logo',controller[_0x89f4('0xc')]);router['get']('/:id/logo_login',controller[_0x89f4('0xd')]);router[_0x89f4('0x7')](_0x89f4('0xe'),controller['gdpr']);router['get'](_0x89f4('0xf'),controller['getPreferred']);router[_0x89f4('0x7')](_0x89f4('0x10'),controller['getFavicon']);var upload=multer({'storage':multer[_0x89f4('0x11')]({'destination':function(_0x386967,_0x425ebe,_0x7c5429){_0x7c5429(null,path[_0x89f4('0x12')](config[_0x89f4('0x13')],_0x89f4('0x14')));},'filename':function(_0x1c218d,_0x59bad3,_0xf3dbee){_0xf3dbee(null,util['format'](_0x89f4('0x15'),_0x89f4('0x16'),path['extname'](_0x59bad3[_0x89f4('0x17')])));}})});router[_0x89f4('0x18')](_0x89f4('0x19'),upload[_0x89f4('0x1a')](_0x89f4('0x1b')),controller['addLogo']);var upload=multer({'storage':multer[_0x89f4('0x11')]({'destination':function(_0x4a4157,_0x36d3ff,_0x3a8f60){_0x3a8f60(null,path['join'](config[_0x89f4('0x13')],'server/files/images/logos/'));},'filename':function(_0x194289,_0x5e5adc,_0x1fcc7e){_0x1fcc7e(null,util[_0x89f4('0x1c')](_0x89f4('0x15'),_0x89f4('0x1d'),path[_0x89f4('0x1e')](_0x5e5adc['originalname'])));}})});router[_0x89f4('0x18')](_0x89f4('0x1f'),upload[_0x89f4('0x1a')](_0x89f4('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x89f4('0x11')]({'destination':function(_0x3aef3a,_0x5c8ce1,_0x53275c){_0x53275c(null,path['join'](config['root'],_0x89f4('0x14')));},'filename':function(_0xfc4672,_0x4b39f5,_0x3808ca){_0x3808ca(null,util['format'](_0x89f4('0x15'),_0x89f4('0x20'),path['extname'](_0x4b39f5[_0x89f4('0x17')])));}})});router[_0x89f4('0x18')](_0x89f4('0xf'),upload[_0x89f4('0x1a')](_0x89f4('0x1b')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1774f9,_0x22b318,_0x30e575){_0x30e575(null,path[_0x89f4('0x12')](config[_0x89f4('0x13')],'server/files/images/logos/'));},'filename':function(_0x4c05df,_0x14efa9,_0x712734){_0x712734(null,util[_0x89f4('0x1c')](_0x89f4('0x15'),'favicon',path['extname'](_0x14efa9[_0x89f4('0x17')])));}})});router[_0x89f4('0x18')](_0x89f4('0x10'),upload[_0x89f4('0x1a')](_0x89f4('0x1b')),controller['addFavicon']);router[_0x89f4('0x21')]('/:id',auth[_0x89f4('0x22')](),controller['update']);module[_0x89f4('0x23')]=router;
\ No newline at end of file
index 692a093..cde8442 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59b9=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','min_internal'];(function(_0x96b9f1,_0x100578){var _0x1943fe=function(_0x463026){while(--_0x463026){_0x96b9f1['push'](_0x96b9f1['shift']());}};_0x1943fe(++_0x100578);}(_0x59b9,0x15b));var _0x959b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x59b9[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x959b('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x959b('0x1')](0xb),'unique':_0x959b('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x959b('0x1')](0xb),'unique':_0x959b('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x959b('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x959b('0x4')],'defaultValue':_0x959b('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x959b('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x959b('0x4')]},'turnusername':{'type':Sequelize[_0x959b('0x4')]},'turnpassword':{'type':Sequelize[_0x959b('0x4')]},'pageTitle':{'type':Sequelize[_0x959b('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x959b('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x959b('0x7')},'enableEmailPreview':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x959b('0x4')],'defaultValue':_0x959b('0x8')},'chatTimeout':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x959b('0x4')]},'defaultPreferred':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x959b('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x959b('0x1')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x959b('0x4')]},'language':{'type':Sequelize[_0x959b('0x4')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x959b('0x1')](0x2)[_0x959b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x959b('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x959b('0x1')](0x2)[_0x959b('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x959b('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x959b('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x959b('0x1')],'defaultValue':0x14}};
\ No newline at end of file
+var _0x7bf2=['sequelize','exports','min_internal','INTEGER','min_mailbox','STRING','BOOLEAN','UNSIGNED'];(function(_0x2c3458,_0x1f7efd){var _0x3f7e02=function(_0x261040){while(--_0x261040){_0x2c3458['push'](_0x2c3458['shift']());}};_0x3f7e02(++_0x1f7efd);}(_0x7bf2,0xc8));var _0x27bf=function(_0x1119dd,_0x5d0ee4){_0x1119dd=_0x1119dd-0x0;var _0x3ff057=_0x7bf2[_0x1119dd];return _0x3ff057;};'use strict';var Sequelize=require(_0x27bf('0x0'));module[_0x27bf('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x27bf('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x27bf('0x3')](0xb),'unique':_0x27bf('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x27bf('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x27bf('0x5')]},'defaultLogo':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x27bf('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x27bf('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x27bf('0x5')]},'turnaddr':{'type':Sequelize[_0x27bf('0x5')]},'turnusername':{'type':Sequelize[_0x27bf('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x27bf('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x27bf('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x27bf('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x27bf('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x27bf('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x27bf('0x5')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x27bf('0x3')]},'transcribeRegion':{'type':Sequelize[_0x27bf('0x5')]},'sentiment':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x27bf('0x3')]},'sentimentRegion':{'type':Sequelize[_0x27bf('0x5')]},'language':{'type':Sequelize[_0x27bf('0x5')]},'bucket':{'type':Sequelize[_0x27bf('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x27bf('0x3')](0x2)[_0x27bf('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x27bf('0x3')](0x2)[_0x27bf('0x7')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x27bf('0x3')](0x2)[_0x27bf('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x27bf('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x27bf('0x3')],'defaultValue':0x14}};
\ No newline at end of file
index 1e92323..7ee2c83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f5d=['request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','stack','name','send','index','map','Setting','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','length','body','find','params','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','custom','download','getLogoLogin','upperFirst','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','preferred','getPreferred','default_preferred.png','default','addFavicon','getFavicon','default_favicon.ico','Sequelize','getDate','utcOffset','now','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4f5d[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0xd4f5('0x0'));var rimraf=require(_0xd4f5('0x1'));var zipdir=require(_0xd4f5('0x2'));var jsonpatch=require(_0xd4f5('0x3'));var rp=require(_0xd4f5('0x4'));var moment=require(_0xd4f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd4f5('0x6'));var util=require(_0xd4f5('0x7'));var path=require(_0xd4f5('0x8'));var sox=require(_0xd4f5('0x9'));var csv=require(_0xd4f5('0xa'));var ejs=require(_0xd4f5('0xb'));var fs=require('fs');var fs_extra=require(_0xd4f5('0xc'));var _=require(_0xd4f5('0xd'));var squel=require(_0xd4f5('0xe'));var crypto=require(_0xd4f5('0xf'));var jsforce=require(_0xd4f5('0x10'));var deskjs=require(_0xd4f5('0x11'));var toCsv=require(_0xd4f5('0xa'));var querystring=require('querystring');var Papa=require(_0xd4f5('0x12'));var Redis=require(_0xd4f5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd4f5('0x14'));var as=require(_0xd4f5('0x15'));var hardwareService=require(_0xd4f5('0x16'));var logger=require(_0xd4f5('0x17'))(_0xd4f5('0x18'));var utils=require(_0xd4f5('0x19'));var config=require(_0xd4f5('0x1a'));var licenseUtil=require(_0xd4f5('0x1b'));var db=require(_0xd4f5('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xd4f5('0x1d')][_0xd4f5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4e046f,_0x1553ec,_0x46da3d,_0x28e1cf){return new BPromise(function(_0x511fcf,_0x166d4d){var _0x18dd1c=_0x28e1cf||client;return _0x18dd1c[_0xd4f5('0x1f')](_0x4e046f,_0x46da3d)[_0xd4f5('0x20')](function(_0x33f6dc){logger[_0xd4f5('0x21')](_0xd4f5('0x22'),_0x1553ec,_0xd4f5('0x23'));logger['debug'](_0xd4f5('0x24'),_0x1553ec,'request\x20sent',JSON[_0xd4f5('0x25')](_0x33f6dc));if(_0x33f6dc['error']){if(_0x33f6dc[_0xd4f5('0x26')][_0xd4f5('0x27')]===0x1f4){logger[_0xd4f5('0x26')](_0xd4f5('0x22'),_0x1553ec,_0x33f6dc[_0xd4f5('0x26')][_0xd4f5('0x28')]);return _0x166d4d(_0x33f6dc[_0xd4f5('0x26')][_0xd4f5('0x28')]);}logger['error'](_0xd4f5('0x22'),_0x1553ec,_0x33f6dc[_0xd4f5('0x26')]['message']);return _0x511fcf(_0x33f6dc[_0xd4f5('0x26')][_0xd4f5('0x28')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x1553ec,_0xd4f5('0x23'));_0x511fcf(_0x33f6dc[_0xd4f5('0x29')][_0xd4f5('0x28')]);}})[_0xd4f5('0x2a')](function(_0x246f7c){logger[_0xd4f5('0x26')](_0xd4f5('0x22'),_0x1553ec,_0x246f7c);_0x166d4d(_0x246f7c);});});}function respondWithStatusCode(_0x527dd4,_0x578071){_0x578071=_0x578071||0xcc;return function(_0x5ccc63){if(_0x5ccc63){return _0x527dd4[_0xd4f5('0x2b')](_0x578071);}return _0x527dd4[_0xd4f5('0x2c')](_0x578071)[_0xd4f5('0x2d')]();};}function respondWithResult(_0xbdb81b,_0x5f3a5d){_0x5f3a5d=_0x5f3a5d||0xc8;return function(_0xb7ea1){if(_0xb7ea1){return _0xbdb81b['status'](_0x5f3a5d)[_0xd4f5('0x2e')](_0xb7ea1);}};}function respondWithFilteredResult(_0x2fbee8,_0x5b519e){return function(_0x5ba979){if(_0x5ba979){var _0x54c6d2=typeof _0x5b519e[_0xd4f5('0x2f')]===_0xd4f5('0x30')&&typeof _0x5b519e['limit']===_0xd4f5('0x30');var _0x5828ac=_0x5ba979[_0xd4f5('0x31')];var _0xb5dd60=_0x54c6d2?0x0:_0x5b519e[_0xd4f5('0x2f')];var _0x2130e4=_0x54c6d2?_0x5ba979[_0xd4f5('0x31')]:_0x5b519e[_0xd4f5('0x2f')]+_0x5b519e[_0xd4f5('0x32')];var _0x3c012b;if(_0x2130e4>=_0x5828ac){_0x2130e4=_0x5828ac;_0x3c012b=0xc8;}else{_0x3c012b=0xce;}_0x2fbee8[_0xd4f5('0x2c')](_0x3c012b);return _0x2fbee8['set']('Content-Range',_0xb5dd60+'-'+_0x2130e4+'/'+_0x5828ac)['json'](_0x5ba979);}return null;};}function patchUpdates(_0x526f29){return function(_0x28d27d){try{jsonpatch[_0xd4f5('0x33')](_0x28d27d,_0x526f29,!![]);}catch(_0x20b4f0){return BPromise[_0xd4f5('0x34')](_0x20b4f0);}return _0x28d27d['save']();};}function saveUpdates(_0x674d46,_0x18e236){return function(_0x1b6f28){if(_0x1b6f28){return _0x1b6f28[_0xd4f5('0x35')](_0x674d46)[_0xd4f5('0x20')](function(_0x43f6ad){return _0x43f6ad;});}return null;};}function removeEntity(_0x45f741,_0x38149e){return function(_0x2bf29a){if(_0x2bf29a){return _0x2bf29a['destroy']()['then'](function(){_0x45f741[_0xd4f5('0x2c')](0xcc)[_0xd4f5('0x2d')]();});}};}function handleEntityNotFound(_0x16dfb7,_0x177903){return function(_0x28229f){if(!_0x28229f){_0x16dfb7['sendStatus'](0x194);}return _0x28229f;};}function handleError(_0x4110e6,_0x31a58d){_0x31a58d=_0x31a58d||0x1f4;return function(_0x14cd8c){logger['error'](_0x14cd8c[_0xd4f5('0x36')]);if(_0x14cd8c[_0xd4f5('0x37')]){delete _0x14cd8c[_0xd4f5('0x37')];}_0x4110e6[_0xd4f5('0x2c')](_0x31a58d)[_0xd4f5('0x38')](_0x14cd8c);};}exports[_0xd4f5('0x39')]=function(_0x50da39,_0x597a0c){var _0x5555b8={},_0x29f348={},_0x369424={'count':0x0,'rows':[]};var _0x542b43=_[_0xd4f5('0x3a')](db[_0xd4f5('0x3b')]['rawAttributes'],function(_0x2220a3){return{'name':_0x2220a3[_0xd4f5('0x3c')],'type':_0x2220a3['type']['key']};});_0x29f348[_0xd4f5('0x3d')]=_['map'](_0x542b43,_0xd4f5('0x37'));_0x29f348[_0xd4f5('0x3e')]=_[_0xd4f5('0x3f')](_0x50da39[_0xd4f5('0x3e')]);_0x29f348[_0xd4f5('0x40')]=_[_0xd4f5('0x41')](_0x29f348[_0xd4f5('0x3d')],_0x29f348[_0xd4f5('0x3e')]);_0x5555b8['attributes']=_[_0xd4f5('0x41')](_0x29f348[_0xd4f5('0x3d')],qs[_0xd4f5('0x42')](_0x50da39[_0xd4f5('0x3e')][_0xd4f5('0x42')]));_0x5555b8[_0xd4f5('0x43')]=_0x5555b8[_0xd4f5('0x43')]['length']?_0x5555b8['attributes']:_0x29f348[_0xd4f5('0x3d')];if(!_0x50da39[_0xd4f5('0x3e')][_0xd4f5('0x44')]('nolimit')){_0x5555b8['limit']=qs[_0xd4f5('0x32')](_0x50da39[_0xd4f5('0x3e')][_0xd4f5('0x32')]);_0x5555b8[_0xd4f5('0x2f')]=qs[_0xd4f5('0x2f')](_0x50da39['query'][_0xd4f5('0x2f')]);}_0x5555b8[_0xd4f5('0x45')]=qs[_0xd4f5('0x46')](_0x50da39[_0xd4f5('0x3e')][_0xd4f5('0x46')]);_0x5555b8[_0xd4f5('0x47')]=qs[_0xd4f5('0x40')](_[_0xd4f5('0x48')](_0x50da39['query'],_0x29f348[_0xd4f5('0x40')]),_0x542b43);if(_0x50da39['query']['filter']){_0x5555b8['where']=_[_0xd4f5('0x49')](_0x5555b8[_0xd4f5('0x47')],{'$or':_['map'](_0x542b43,function(_0x56a3bd){if(_0x56a3bd[_0xd4f5('0x4a')]!==_0xd4f5('0x4b')){var _0x519b05={};_0x519b05[_0x56a3bd['name']]={'$like':'%'+_0x50da39[_0xd4f5('0x3e')][_0xd4f5('0x4c')]+'%'};return _0x519b05;}})});}_0x5555b8=_[_0xd4f5('0x49')]({},_0x5555b8,_0x50da39[_0xd4f5('0x4d')]);var _0x510901={'where':_0x5555b8[_0xd4f5('0x47')]};return db['Setting'][_0xd4f5('0x31')](_0x510901)[_0xd4f5('0x20')](function(_0x1ffdd8){_0x369424['count']=_0x1ffdd8;if(_0x50da39['query'][_0xd4f5('0x4e')]){_0x5555b8[_0xd4f5('0x4f')]=[{'all':!![]}];}return db[_0xd4f5('0x3b')][_0xd4f5('0x50')](_0x5555b8);})['then'](function(_0x1687b2){_0x369424['rows']=_0x1687b2;return _0x369424;})[_0xd4f5('0x20')](respondWithFilteredResult(_0x597a0c,_0x5555b8))[_0xd4f5('0x2a')](handleError(_0x597a0c,null));};exports[_0xd4f5('0x51')]=function(_0x42b0b8,_0xef2f22){var _0xfeef22={'raw':![],'where':{'id':_0x42b0b8['params']['id']}},_0x4fb122={};_0x4fb122['model']=_[_0xd4f5('0x3f')](db['Setting']['rawAttributes']);_0x4fb122[_0xd4f5('0x3e')]=_[_0xd4f5('0x3f')](_0x42b0b8[_0xd4f5('0x3e')]);_0x4fb122['filters']=_[_0xd4f5('0x41')](_0x4fb122['model'],_0x4fb122['query']);_0xfeef22['attributes']=_[_0xd4f5('0x41')](_0x4fb122[_0xd4f5('0x3d')],qs['fields'](_0x42b0b8[_0xd4f5('0x3e')][_0xd4f5('0x42')]));_0xfeef22[_0xd4f5('0x43')]=_0xfeef22[_0xd4f5('0x43')][_0xd4f5('0x52')]?_0xfeef22['attributes']:_0x4fb122[_0xd4f5('0x3d')];if(_0x42b0b8['query'][_0xd4f5('0x4e')]){_0xfeef22['include']=[{'all':!![]}];}_0xfeef22=_[_0xd4f5('0x49')]({},_0xfeef22,_0x42b0b8[_0xd4f5('0x4d')]);return db[_0xd4f5('0x3b')]['find'](_0xfeef22)[_0xd4f5('0x20')](handleEntityNotFound(_0xef2f22,null))[_0xd4f5('0x20')](respondWithResult(_0xef2f22,null))[_0xd4f5('0x2a')](handleError(_0xef2f22,null));};exports[_0xd4f5('0x35')]=function(_0x14d23f,_0x2eb771){if(_0x14d23f[_0xd4f5('0x53')]['id']){delete _0x14d23f['body']['id'];}return db['Setting'][_0xd4f5('0x54')]({'where':{'id':_0x14d23f[_0xd4f5('0x55')]['id']}})[_0xd4f5('0x20')](handleEntityNotFound(_0x2eb771,null))[_0xd4f5('0x20')](saveUpdates(_0x14d23f['body'],null))[_0xd4f5('0x20')](respondWithResult(_0x2eb771,null))[_0xd4f5('0x2a')](handleError(_0x2eb771,null));};exports[_0xd4f5('0x56')]=function(_0x51069c,_0x759208,_0x578eef){if(_0x51069c[_0xd4f5('0x57')]&&_0x51069c[_0xd4f5('0x57')][_0xd4f5('0x58')]){_0x51069c['body'][_0xd4f5('0x59')]=_0x51069c[_0xd4f5('0x57')][_0xd4f5('0x58')];}return db[_0xd4f5('0x3b')][_0xd4f5('0x54')]({'where':{'id':_0x51069c[_0xd4f5('0x55')]['id']}})['then'](handleEntityNotFound(_0x759208,null))[_0xd4f5('0x20')](saveUpdates(_0x51069c[_0xd4f5('0x53')],null))[_0xd4f5('0x20')](respondWithResult(_0x759208,null))[_0xd4f5('0x2a')](handleError(_0x759208,null));};exports[_0xd4f5('0x5a')]=function(_0x176168,_0x5b7c40,_0x4f10db){if(_0x176168['file']&&_0x176168[_0xd4f5('0x57')][_0xd4f5('0x58')]){_0x176168[_0xd4f5('0x53')]['loginLogo']=_0x176168[_0xd4f5('0x57')]['filename'];}return db[_0xd4f5('0x3b')][_0xd4f5('0x54')]({'where':{'id':_0x176168['params']['id']}})[_0xd4f5('0x20')](handleEntityNotFound(_0x5b7c40,null))[_0xd4f5('0x20')](saveUpdates(_0x176168['body'],null))[_0xd4f5('0x20')](respondWithResult(_0x5b7c40,null))[_0xd4f5('0x2a')](handleError(_0x5b7c40,null));};var utilLicense=require('../../config/license/util');exports[_0xd4f5('0x5b')]=function(_0x4a02bd,_0x9b4ea6,_0x4f888a){var _0xbc9cd2=_0xd4f5('0x5c');var _0x3c1fe4={'custom':![]};return utilLicense[_0xd4f5('0x5d')]()[_0xd4f5('0x20')](function(_0x2e4de9){if(_0x2e4de9){_0x3c1fe4=_0x2e4de9;}return db[_0xd4f5('0x3b')][_0xd4f5('0x54')]({'where':{'id':_0x4a02bd[_0xd4f5('0x55')]['id']},'attributes':[_0xd4f5('0x59'),_0xd4f5('0x5e'),'preferred',_0xd4f5('0x5f'),_0xd4f5('0x60'),_0xd4f5('0x61'),_0xd4f5('0x62'),_0xd4f5('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x9b4ea6,null))[_0xd4f5('0x20')](function(_0x308e19){if(_0x308e19){var _0x3d0c52=_0x308e19[_0xd4f5('0x59')]&&fs[_0xd4f5('0x64')](path[_0xd4f5('0x65')](config['root'],_0xbc9cd2,_[_0xd4f5('0x66')](_0x308e19[_0xd4f5('0x59')])))?path[_0xd4f5('0x65')](config[_0xd4f5('0x67')],_0xbc9cd2,_['toLower'](_0x308e19[_0xd4f5('0x59')])):path['join'](config[_0xd4f5('0x67')],_0xbc9cd2,_[_0xd4f5('0x66')](_0xd4f5('0x68')));var _0x41f39d='default'+_['upperFirst'](_0xd4f5('0x59'));if(_0x308e19[_0x41f39d]||!_0x3c1fe4[_0xd4f5('0x69')]){_0x3d0c52=path[_0xd4f5('0x65')](config[_0xd4f5('0x67')],_0xbc9cd2,_[_0xd4f5('0x66')]('default_logo.svg'));}if(!fs[_0xd4f5('0x64')](_0x3d0c52)){throw new db['Sequelize']['ValidationError'](_['upperFirst']('logo')+'\x20not\x20found');}return _0x9b4ea6[_0xd4f5('0x6a')](_0x3d0c52);}})[_0xd4f5('0x2a')](handleError(_0x9b4ea6,null));};var utilLicense=require(_0xd4f5('0x1b'));exports[_0xd4f5('0x6b')]=function(_0xc61cf1,_0x5808c1,_0x217d60){var _0x5bdff6=_0xd4f5('0x5c');var _0x57572a={'custom':![]};return utilLicense[_0xd4f5('0x5d')]()['then'](function(_0x53ea83){if(_0x53ea83){_0x57572a=_0x53ea83;}return db[_0xd4f5('0x3b')][_0xd4f5('0x54')]({'where':{'id':_0xc61cf1['params']['id']},'attributes':[_0xd4f5('0x59'),_0xd4f5('0x5e'),'preferred',_0xd4f5('0x5f'),_0xd4f5('0x60'),_0xd4f5('0x61'),_0xd4f5('0x62'),_0xd4f5('0x63')],'raw':!![]});})[_0xd4f5('0x20')](handleEntityNotFound(_0x5808c1,null))[_0xd4f5('0x20')](function(_0x354bc4){if(_0x354bc4){var _0x177b48=_0x354bc4['loginLogo']&&fs[_0xd4f5('0x64')](path['join'](config[_0xd4f5('0x67')],_0x5bdff6,_[_0xd4f5('0x66')](_0x354bc4[_0xd4f5('0x5e')])))?path[_0xd4f5('0x65')](config[_0xd4f5('0x67')],_0x5bdff6,_['toLower'](_0x354bc4[_0xd4f5('0x5e')])):path['join'](config[_0xd4f5('0x67')],_0x5bdff6,_[_0xd4f5('0x66')]('default_loginLogo.svg'));var _0x599844='default'+_[_0xd4f5('0x6c')]('loginLogo');if(_0x354bc4[_0x599844]||!_0x57572a['custom']){_0x177b48=path[_0xd4f5('0x65')](config['root'],_0x5bdff6,_[_0xd4f5('0x66')]('default_loginLogo.svg'));}if(!fs[_0xd4f5('0x64')](_0x177b48)){throw new db['Sequelize'][(_0xd4f5('0x6d'))](_[_0xd4f5('0x6c')](_0xd4f5('0x5e'))+_0xd4f5('0x6e'));}return _0x5808c1[_0xd4f5('0x6a')](_0x177b48);}})[_0xd4f5('0x2a')](handleError(_0x5808c1,null));};exports[_0xd4f5('0x6f')]=function(_0x24e42e,_0x1a2c3e){return db[_0xd4f5('0x3b')]['find']({'where':{'id':_0x24e42e['params']['id']},'attributes':[_0xd4f5('0x70')]})[_0xd4f5('0x20')](respondWithResult(_0x1a2c3e,null))[_0xd4f5('0x2a')](handleError(_0x1a2c3e,null));};exports[_0xd4f5('0x71')]=function(_0x338266,_0x1348eb,_0x56bff1){if(_0x338266['file']&&_0x338266[_0xd4f5('0x57')][_0xd4f5('0x58')]){_0x338266['body'][_0xd4f5('0x72')]=_0x338266['file'][_0xd4f5('0x58')];}return db[_0xd4f5('0x3b')][_0xd4f5('0x54')]({'where':{'id':_0x338266[_0xd4f5('0x55')]['id']}})[_0xd4f5('0x20')](handleEntityNotFound(_0x1348eb,null))['then'](saveUpdates(_0x338266[_0xd4f5('0x53')],null))['then'](respondWithResult(_0x1348eb,null))[_0xd4f5('0x2a')](handleError(_0x1348eb,null));};var utilLicense=require(_0xd4f5('0x1b'));exports[_0xd4f5('0x73')]=function(_0xcbe1c,_0x51bae1,_0x8105f6){var _0x307221=_0xd4f5('0x5c');var _0x172636={'custom':![]};return utilLicense[_0xd4f5('0x5d')]()[_0xd4f5('0x20')](function(_0x109275){if(_0x109275){_0x172636=_0x109275;}return db['Setting'][_0xd4f5('0x54')]({'where':{'id':_0xcbe1c['params']['id']},'attributes':[_0xd4f5('0x59'),_0xd4f5('0x5e'),_0xd4f5('0x72'),_0xd4f5('0x5f'),_0xd4f5('0x60'),_0xd4f5('0x61'),_0xd4f5('0x62'),'defaultFavicon'],'raw':!![]});})[_0xd4f5('0x20')](handleEntityNotFound(_0x51bae1,null))['then'](function(_0x26bbd5){if(_0x26bbd5){var _0x2aaac3=_0x26bbd5[_0xd4f5('0x72')]&&fs['existsSync'](path[_0xd4f5('0x65')](config['root'],_0x307221,_[_0xd4f5('0x66')](_0x26bbd5[_0xd4f5('0x72')])))?path['join'](config[_0xd4f5('0x67')],_0x307221,_[_0xd4f5('0x66')](_0x26bbd5[_0xd4f5('0x72')])):path[_0xd4f5('0x65')](config[_0xd4f5('0x67')],_0x307221,_['toLower'](_0xd4f5('0x74')));var _0x5b4502=_0xd4f5('0x75')+_[_0xd4f5('0x6c')]('preferred');if(_0x26bbd5[_0x5b4502]||!_0x172636[_0xd4f5('0x69')]||!_0x172636[_0xd4f5('0x72')]){_0x2aaac3=path[_0xd4f5('0x65')](config['root'],_0x307221,_[_0xd4f5('0x66')](_0xd4f5('0x74')));}if(!fs[_0xd4f5('0x64')](_0x2aaac3)){throw new db['Sequelize']['ValidationError'](_[_0xd4f5('0x6c')](_0xd4f5('0x72'))+_0xd4f5('0x6e'));}return _0x51bae1[_0xd4f5('0x6a')](_0x2aaac3);}})[_0xd4f5('0x2a')](handleError(_0x51bae1,null));};exports[_0xd4f5('0x76')]=function(_0xdf2340,_0x38f479,_0x46c98c){if(_0xdf2340[_0xd4f5('0x57')]&&_0xdf2340[_0xd4f5('0x57')]['filename']){_0xdf2340[_0xd4f5('0x53')][_0xd4f5('0x5f')]=_0xdf2340[_0xd4f5('0x57')][_0xd4f5('0x58')];}return db[_0xd4f5('0x3b')][_0xd4f5('0x54')]({'where':{'id':_0xdf2340[_0xd4f5('0x55')]['id']}})[_0xd4f5('0x20')](handleEntityNotFound(_0x38f479,null))[_0xd4f5('0x20')](saveUpdates(_0xdf2340[_0xd4f5('0x53')],null))[_0xd4f5('0x20')](respondWithResult(_0x38f479,null))['catch'](handleError(_0x38f479,null));};var utilLicense=require(_0xd4f5('0x1b'));exports[_0xd4f5('0x77')]=function(_0x91a0ef,_0x1a12bf,_0x188a7b){var _0x3abda7=_0xd4f5('0x5c');var _0x49b97f={'custom':![]};return utilLicense[_0xd4f5('0x5d')]()[_0xd4f5('0x20')](function(_0x4f3440){if(_0x4f3440){_0x49b97f=_0x4f3440;}return db[_0xd4f5('0x3b')][_0xd4f5('0x54')]({'where':{'id':_0x91a0ef[_0xd4f5('0x55')]['id']},'attributes':[_0xd4f5('0x59'),_0xd4f5('0x5e'),_0xd4f5('0x72'),_0xd4f5('0x5f'),_0xd4f5('0x60'),_0xd4f5('0x61'),_0xd4f5('0x62'),_0xd4f5('0x63')],'raw':!![]});})[_0xd4f5('0x20')](handleEntityNotFound(_0x1a12bf,null))[_0xd4f5('0x20')](function(_0x529748){if(_0x529748){var _0x5f3c18=_0x529748[_0xd4f5('0x5f')]&&fs[_0xd4f5('0x64')](path[_0xd4f5('0x65')](config[_0xd4f5('0x67')],_0x3abda7,_[_0xd4f5('0x66')](_0x529748[_0xd4f5('0x5f')])))?path[_0xd4f5('0x65')](config['root'],_0x3abda7,_[_0xd4f5('0x66')](_0x529748['favicon'])):path[_0xd4f5('0x65')](config[_0xd4f5('0x67')],_0x3abda7,_['toLower']('default_favicon.ico'));var _0x2663c3=_0xd4f5('0x75')+_['upperFirst'](_0xd4f5('0x5f'));if(_0x529748[_0x2663c3]||!_0x49b97f[_0xd4f5('0x69')]){_0x5f3c18=path[_0xd4f5('0x65')](config[_0xd4f5('0x67')],_0x3abda7,_['toLower'](_0xd4f5('0x78')));}if(!fs[_0xd4f5('0x64')](_0x5f3c18)){throw new db[(_0xd4f5('0x79'))][(_0xd4f5('0x6d'))](_[_0xd4f5('0x6c')](_0xd4f5('0x5f'))+'\x20not\x20found');}return _0x1a12bf[_0xd4f5('0x6a')](_0x5f3c18);}})[_0xd4f5('0x2a')](handleError(_0x1a12bf,null));};exports[_0xd4f5('0x7a')]=function(_0x167350,_0x514472){var _0x1ca68c={'offset':moment()[_0xd4f5('0x7b')]()};_0x1ca68c[_0xd4f5('0x7c')]=moment()[_0xd4f5('0x7b')](_0x1ca68c[_0xd4f5('0x2f')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x514472[_0xd4f5('0x2c')](0xc8)[_0xd4f5('0x38')](_0x1ca68c);};
\ No newline at end of file
+var _0xccef=['getPreferred','default_preferred.png','favicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','stack','name','index','Setting','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','includeAll','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLoginLogo','defaultPreferred','join','root','toLower','default','upperFirst','custom','default_logo.svg','existsSync','Sequelize','ValidationError','\x20not\x20found','../../config/license/util','getLogoLogin','defaultLogo','defaultFavicon','default_loginLogo.svg','download','gdpr','securePassword'];(function(_0x353622,_0x2253b3){var _0xe9f64d=function(_0x438730){while(--_0x438730){_0x353622['push'](_0x353622['shift']());}};_0xe9f64d(++_0x2253b3);}(_0xccef,0x1ee));var _0xfcce=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xccef[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcce('0x1'));var rp=require(_0xfcce('0x2'));var moment=require('moment');var BPromise=require(_0xfcce('0x3'));var Mustache=require(_0xfcce('0x4'));var util=require(_0xfcce('0x5'));var path=require('path');var sox=require(_0xfcce('0x6'));var csv=require(_0xfcce('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcce('0x8'));var _=require(_0xfcce('0x9'));var squel=require('squel');var crypto=require(_0xfcce('0xa'));var jsforce=require(_0xfcce('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfcce('0xc'));var Papa=require(_0xfcce('0xd'));var Redis=require(_0xfcce('0xe'));var authService=require(_0xfcce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfcce('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcce('0x11'))(_0xfcce('0x12'));var utils=require('../../config/utils');var config=require(_0xfcce('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcce('0x14'))['db'];var jayson=require(_0xfcce('0x15'));var client=jayson[_0xfcce('0x16')][_0xfcce('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x526238,_0x30529c,_0x2281ad,_0x16aa15){return new BPromise(function(_0x408b95,_0x5dfb69){var _0x5ba45b=_0x16aa15||client;return _0x5ba45b[_0xfcce('0x18')](_0x526238,_0x2281ad)[_0xfcce('0x19')](function(_0x4c5f3d){logger[_0xfcce('0x1a')](_0xfcce('0x1b'),_0x30529c,'request\x20sent');logger[_0xfcce('0x1c')]('Setting,\x20%s,\x20%s,\x20%s',_0x30529c,_0xfcce('0x1d'),JSON[_0xfcce('0x1e')](_0x4c5f3d));if(_0x4c5f3d['error']){if(_0x4c5f3d[_0xfcce('0x1f')][_0xfcce('0x20')]===0x1f4){logger[_0xfcce('0x1f')](_0xfcce('0x1b'),_0x30529c,_0x4c5f3d[_0xfcce('0x1f')]['message']);return _0x5dfb69(_0x4c5f3d[_0xfcce('0x1f')][_0xfcce('0x21')]);}logger[_0xfcce('0x1f')](_0xfcce('0x1b'),_0x30529c,_0x4c5f3d[_0xfcce('0x1f')][_0xfcce('0x21')]);return _0x408b95(_0x4c5f3d[_0xfcce('0x1f')][_0xfcce('0x21')]);}else{logger['info'](_0xfcce('0x1b'),_0x30529c,_0xfcce('0x1d'));_0x408b95(_0x4c5f3d[_0xfcce('0x22')][_0xfcce('0x21')]);}})[_0xfcce('0x23')](function(_0xde5a7f){logger[_0xfcce('0x1f')](_0xfcce('0x1b'),_0x30529c,_0xde5a7f);_0x5dfb69(_0xde5a7f);});});}function respondWithStatusCode(_0x3ebc8f,_0x487fcc){_0x487fcc=_0x487fcc||0xcc;return function(_0x517fa0){if(_0x517fa0){return _0x3ebc8f[_0xfcce('0x24')](_0x487fcc);}return _0x3ebc8f[_0xfcce('0x25')](_0x487fcc)[_0xfcce('0x26')]();};}function respondWithResult(_0x4b2b93,_0x34c8c9){_0x34c8c9=_0x34c8c9||0xc8;return function(_0x5ad980){if(_0x5ad980){return _0x4b2b93[_0xfcce('0x25')](_0x34c8c9)[_0xfcce('0x27')](_0x5ad980);}};}function respondWithFilteredResult(_0x36797e,_0x23c93c){return function(_0x5af1c8){if(_0x5af1c8){var _0x27dcc4=typeof _0x23c93c[_0xfcce('0x28')]===_0xfcce('0x29')&&typeof _0x23c93c[_0xfcce('0x2a')]==='undefined';var _0x14d074=_0x5af1c8['count'];var _0x44f82a=_0x27dcc4?0x0:_0x23c93c[_0xfcce('0x28')];var _0x40716c=_0x27dcc4?_0x5af1c8[_0xfcce('0x2b')]:_0x23c93c[_0xfcce('0x28')]+_0x23c93c['limit'];var _0x3b4b2c;if(_0x40716c>=_0x14d074){_0x40716c=_0x14d074;_0x3b4b2c=0xc8;}else{_0x3b4b2c=0xce;}_0x36797e[_0xfcce('0x25')](_0x3b4b2c);return _0x36797e[_0xfcce('0x2c')]('Content-Range',_0x44f82a+'-'+_0x40716c+'/'+_0x14d074)[_0xfcce('0x27')](_0x5af1c8);}return null;};}function patchUpdates(_0x12933f){return function(_0x296836){try{jsonpatch['apply'](_0x296836,_0x12933f,!![]);}catch(_0x590ffa){return BPromise[_0xfcce('0x2d')](_0x590ffa);}return _0x296836[_0xfcce('0x2e')]();};}function saveUpdates(_0xc76958,_0x1c79e1){return function(_0x5bec9d){if(_0x5bec9d){return _0x5bec9d[_0xfcce('0x2f')](_0xc76958)[_0xfcce('0x19')](function(_0x4974ab){return _0x4974ab;});}return null;};}function removeEntity(_0x2ac161,_0x431e4a){return function(_0x48b46f){if(_0x48b46f){return _0x48b46f[_0xfcce('0x30')]()[_0xfcce('0x19')](function(){_0x2ac161[_0xfcce('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x162432,_0x304d60){return function(_0x49ed79){if(!_0x49ed79){_0x162432[_0xfcce('0x24')](0x194);}return _0x49ed79;};}function handleError(_0xd981e2,_0x515417){_0x515417=_0x515417||0x1f4;return function(_0x329cf0){logger[_0xfcce('0x1f')](_0x329cf0[_0xfcce('0x31')]);if(_0x329cf0[_0xfcce('0x32')]){delete _0x329cf0[_0xfcce('0x32')];}_0xd981e2[_0xfcce('0x25')](_0x515417)['send'](_0x329cf0);};}exports[_0xfcce('0x33')]=function(_0xe9fe35,_0x53d468){var _0x40e2da={},_0x2f1dff={},_0x3f2427={'count':0x0,'rows':[]};var _0x2652da=_['map'](db[_0xfcce('0x34')]['rawAttributes'],function(_0x2539af){return{'name':_0x2539af[_0xfcce('0x35')],'type':_0x2539af[_0xfcce('0x36')][_0xfcce('0x37')]};});_0x2f1dff[_0xfcce('0x38')]=_[_0xfcce('0x39')](_0x2652da,'name');_0x2f1dff['query']=_[_0xfcce('0x3a')](_0xe9fe35['query']);_0x2f1dff[_0xfcce('0x3b')]=_[_0xfcce('0x3c')](_0x2f1dff['model'],_0x2f1dff['query']);_0x40e2da[_0xfcce('0x3d')]=_['intersection'](_0x2f1dff['model'],qs[_0xfcce('0x3e')](_0xe9fe35[_0xfcce('0x3f')][_0xfcce('0x3e')]));_0x40e2da[_0xfcce('0x3d')]=_0x40e2da['attributes'][_0xfcce('0x40')]?_0x40e2da[_0xfcce('0x3d')]:_0x2f1dff['model'];if(!_0xe9fe35['query'][_0xfcce('0x41')]('nolimit')){_0x40e2da[_0xfcce('0x2a')]=qs['limit'](_0xe9fe35['query']['limit']);_0x40e2da[_0xfcce('0x28')]=qs[_0xfcce('0x28')](_0xe9fe35[_0xfcce('0x3f')][_0xfcce('0x28')]);}_0x40e2da[_0xfcce('0x42')]=qs['sort'](_0xe9fe35[_0xfcce('0x3f')]['sort']);_0x40e2da[_0xfcce('0x43')]=qs['filters'](_['pick'](_0xe9fe35[_0xfcce('0x3f')],_0x2f1dff[_0xfcce('0x3b')]),_0x2652da);if(_0xe9fe35[_0xfcce('0x3f')][_0xfcce('0x44')]){_0x40e2da['where']=_[_0xfcce('0x45')](_0x40e2da[_0xfcce('0x43')],{'$or':_[_0xfcce('0x39')](_0x2652da,function(_0x168e83){if(_0x168e83[_0xfcce('0x36')]!==_0xfcce('0x46')){var _0xec6778={};_0xec6778[_0x168e83[_0xfcce('0x32')]]={'$like':'%'+_0xe9fe35[_0xfcce('0x3f')][_0xfcce('0x44')]+'%'};return _0xec6778;}})});}_0x40e2da=_[_0xfcce('0x45')]({},_0x40e2da,_0xe9fe35['options']);var _0xb22152={'where':_0x40e2da[_0xfcce('0x43')]};return db[_0xfcce('0x34')][_0xfcce('0x2b')](_0xb22152)['then'](function(_0x4c57ee){_0x3f2427[_0xfcce('0x2b')]=_0x4c57ee;if(_0xe9fe35[_0xfcce('0x3f')]['includeAll']){_0x40e2da[_0xfcce('0x47')]=[{'all':!![]}];}return db[_0xfcce('0x34')][_0xfcce('0x48')](_0x40e2da);})[_0xfcce('0x19')](function(_0x7361d9){_0x3f2427[_0xfcce('0x49')]=_0x7361d9;return _0x3f2427;})['then'](respondWithFilteredResult(_0x53d468,_0x40e2da))[_0xfcce('0x23')](handleError(_0x53d468,null));};exports[_0xfcce('0x4a')]=function(_0x46983a,_0x1feedf){var _0x5e18f9={'raw':![],'where':{'id':_0x46983a[_0xfcce('0x4b')]['id']}},_0x5bbe8f={};_0x5bbe8f[_0xfcce('0x38')]=_[_0xfcce('0x3a')](db['Setting'][_0xfcce('0x4c')]);_0x5bbe8f[_0xfcce('0x3f')]=_[_0xfcce('0x3a')](_0x46983a['query']);_0x5bbe8f[_0xfcce('0x3b')]=_[_0xfcce('0x3c')](_0x5bbe8f[_0xfcce('0x38')],_0x5bbe8f[_0xfcce('0x3f')]);_0x5e18f9['attributes']=_['intersection'](_0x5bbe8f[_0xfcce('0x38')],qs[_0xfcce('0x3e')](_0x46983a[_0xfcce('0x3f')][_0xfcce('0x3e')]));_0x5e18f9[_0xfcce('0x3d')]=_0x5e18f9['attributes'][_0xfcce('0x40')]?_0x5e18f9[_0xfcce('0x3d')]:_0x5bbe8f['model'];if(_0x46983a[_0xfcce('0x3f')][_0xfcce('0x4d')]){_0x5e18f9['include']=[{'all':!![]}];}_0x5e18f9=_[_0xfcce('0x45')]({},_0x5e18f9,_0x46983a['options']);return db[_0xfcce('0x34')][_0xfcce('0x4e')](_0x5e18f9)['then'](handleEntityNotFound(_0x1feedf,null))[_0xfcce('0x19')](respondWithResult(_0x1feedf,null))[_0xfcce('0x23')](handleError(_0x1feedf,null));};exports[_0xfcce('0x2f')]=function(_0x16aba7,_0x5a8c3e){if(_0x16aba7[_0xfcce('0x4f')]['id']){delete _0x16aba7[_0xfcce('0x4f')]['id'];}return db[_0xfcce('0x34')][_0xfcce('0x4e')]({'where':{'id':_0x16aba7['params']['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x5a8c3e,null))[_0xfcce('0x19')](saveUpdates(_0x16aba7[_0xfcce('0x4f')],null))[_0xfcce('0x19')](respondWithResult(_0x5a8c3e,null))['catch'](handleError(_0x5a8c3e,null));};exports[_0xfcce('0x50')]=function(_0x57975d,_0x30200e,_0x381ee5){if(_0x57975d[_0xfcce('0x51')]&&_0x57975d[_0xfcce('0x51')][_0xfcce('0x52')]){_0x57975d[_0xfcce('0x4f')][_0xfcce('0x53')]=_0x57975d['file']['filename'];}return db[_0xfcce('0x34')][_0xfcce('0x4e')]({'where':{'id':_0x57975d[_0xfcce('0x4b')]['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x30200e,null))['then'](saveUpdates(_0x57975d[_0xfcce('0x4f')],null))[_0xfcce('0x19')](respondWithResult(_0x30200e,null))['catch'](handleError(_0x30200e,null));};exports[_0xfcce('0x54')]=function(_0x216c1d,_0x4d06f1,_0x5ab2f0){if(_0x216c1d['file']&&_0x216c1d['file'][_0xfcce('0x52')]){_0x216c1d[_0xfcce('0x4f')][_0xfcce('0x55')]=_0x216c1d[_0xfcce('0x51')]['filename'];}return db['Setting'][_0xfcce('0x4e')]({'where':{'id':_0x216c1d[_0xfcce('0x4b')]['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x4d06f1,null))[_0xfcce('0x19')](saveUpdates(_0x216c1d[_0xfcce('0x4f')],null))[_0xfcce('0x19')](respondWithResult(_0x4d06f1,null))[_0xfcce('0x23')](handleError(_0x4d06f1,null));};var utilLicense=require('../../config/license/util');exports[_0xfcce('0x56')]=function(_0x5ccdd3,_0x3ad143,_0x284252){var _0x3cc8ee=_0xfcce('0x57');var _0x53349b={'custom':![]};return utilLicense[_0xfcce('0x58')]()[_0xfcce('0x19')](function(_0x4a5ce0){if(_0x4a5ce0){_0x53349b=_0x4a5ce0;}return db[_0xfcce('0x34')]['find']({'where':{'id':_0x5ccdd3[_0xfcce('0x4b')]['id']},'attributes':[_0xfcce('0x53'),_0xfcce('0x55'),_0xfcce('0x59'),'favicon','defaultLogo',_0xfcce('0x5a'),_0xfcce('0x5b'),'defaultFavicon'],'raw':!![]});})[_0xfcce('0x19')](handleEntityNotFound(_0x3ad143,null))[_0xfcce('0x19')](function(_0x1f8770){if(_0x1f8770){var _0x1383ec=_0x1f8770[_0xfcce('0x53')]&&fs['existsSync'](path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x3cc8ee,_['toLower'](_0x1f8770[_0xfcce('0x53')])))?path['join'](config[_0xfcce('0x5d')],_0x3cc8ee,_[_0xfcce('0x5e')](_0x1f8770[_0xfcce('0x53')])):path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x3cc8ee,_[_0xfcce('0x5e')]('default_logo.svg'));var _0x42597a=_0xfcce('0x5f')+_[_0xfcce('0x60')](_0xfcce('0x53'));if(_0x1f8770[_0x42597a]||!_0x53349b[_0xfcce('0x61')]){_0x1383ec=path['join'](config[_0xfcce('0x5d')],_0x3cc8ee,_['toLower'](_0xfcce('0x62')));}if(!fs[_0xfcce('0x63')](_0x1383ec)){throw new db[(_0xfcce('0x64'))][(_0xfcce('0x65'))](_[_0xfcce('0x60')](_0xfcce('0x53'))+_0xfcce('0x66'));}return _0x3ad143['download'](_0x1383ec);}})['catch'](handleError(_0x3ad143,null));};var utilLicense=require(_0xfcce('0x67'));exports[_0xfcce('0x68')]=function(_0x2bd79b,_0x4e1b40,_0xbf3d96){var _0x69308d=_0xfcce('0x57');var _0x537590={'custom':![]};return utilLicense[_0xfcce('0x58')]()['then'](function(_0x229dbd){if(_0x229dbd){_0x537590=_0x229dbd;}return db['Setting']['find']({'where':{'id':_0x2bd79b[_0xfcce('0x4b')]['id']},'attributes':[_0xfcce('0x53'),_0xfcce('0x55'),_0xfcce('0x59'),'favicon',_0xfcce('0x69'),_0xfcce('0x5a'),_0xfcce('0x5b'),_0xfcce('0x6a')],'raw':!![]});})[_0xfcce('0x19')](handleEntityNotFound(_0x4e1b40,null))[_0xfcce('0x19')](function(_0x8ba5bd){if(_0x8ba5bd){var _0x465ed1=_0x8ba5bd['loginLogo']&&fs[_0xfcce('0x63')](path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x69308d,_[_0xfcce('0x5e')](_0x8ba5bd[_0xfcce('0x55')])))?path[_0xfcce('0x5c')](config['root'],_0x69308d,_[_0xfcce('0x5e')](_0x8ba5bd[_0xfcce('0x55')])):path[_0xfcce('0x5c')](config['root'],_0x69308d,_[_0xfcce('0x5e')]('default_loginLogo.svg'));var _0x217bb9=_0xfcce('0x5f')+_[_0xfcce('0x60')](_0xfcce('0x55'));if(_0x8ba5bd[_0x217bb9]||!_0x537590[_0xfcce('0x61')]){_0x465ed1=path['join'](config[_0xfcce('0x5d')],_0x69308d,_[_0xfcce('0x5e')](_0xfcce('0x6b')));}if(!fs[_0xfcce('0x63')](_0x465ed1)){throw new db[(_0xfcce('0x64'))][(_0xfcce('0x65'))](_[_0xfcce('0x60')]('loginLogo')+_0xfcce('0x66'));}return _0x4e1b40[_0xfcce('0x6c')](_0x465ed1);}})[_0xfcce('0x23')](handleError(_0x4e1b40,null));};exports[_0xfcce('0x6d')]=function(_0x5f4d97,_0xa7ff35){return db[_0xfcce('0x34')]['find']({'where':{'id':_0x5f4d97[_0xfcce('0x4b')]['id']},'attributes':[_0xfcce('0x6e')]})[_0xfcce('0x19')](respondWithResult(_0xa7ff35,null))[_0xfcce('0x23')](handleError(_0xa7ff35,null));};exports['addPreferred']=function(_0x56d9bf,_0x498329,_0x12af85){if(_0x56d9bf[_0xfcce('0x51')]&&_0x56d9bf[_0xfcce('0x51')][_0xfcce('0x52')]){_0x56d9bf['body'][_0xfcce('0x59')]=_0x56d9bf[_0xfcce('0x51')][_0xfcce('0x52')];}return db[_0xfcce('0x34')][_0xfcce('0x4e')]({'where':{'id':_0x56d9bf[_0xfcce('0x4b')]['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x498329,null))[_0xfcce('0x19')](saveUpdates(_0x56d9bf['body'],null))['then'](respondWithResult(_0x498329,null))[_0xfcce('0x23')](handleError(_0x498329,null));};var utilLicense=require(_0xfcce('0x67'));exports[_0xfcce('0x6f')]=function(_0x50470c,_0xd8d8ad,_0x15b727){var _0x5eca0d=_0xfcce('0x57');var _0x38f155={'custom':![]};return utilLicense[_0xfcce('0x58')]()[_0xfcce('0x19')](function(_0x59ed80){if(_0x59ed80){_0x38f155=_0x59ed80;}return db[_0xfcce('0x34')]['find']({'where':{'id':_0x50470c['params']['id']},'attributes':['logo',_0xfcce('0x55'),_0xfcce('0x59'),'favicon','defaultLogo',_0xfcce('0x5a'),_0xfcce('0x5b'),_0xfcce('0x6a')],'raw':!![]});})[_0xfcce('0x19')](handleEntityNotFound(_0xd8d8ad,null))[_0xfcce('0x19')](function(_0x2d6d73){if(_0x2d6d73){var _0x1e8912=_0x2d6d73[_0xfcce('0x59')]&&fs[_0xfcce('0x63')](path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x5eca0d,_[_0xfcce('0x5e')](_0x2d6d73[_0xfcce('0x59')])))?path[_0xfcce('0x5c')](config['root'],_0x5eca0d,_[_0xfcce('0x5e')](_0x2d6d73[_0xfcce('0x59')])):path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x5eca0d,_[_0xfcce('0x5e')](_0xfcce('0x70')));var _0x217976='default'+_[_0xfcce('0x60')](_0xfcce('0x59'));if(_0x2d6d73[_0x217976]||!_0x38f155[_0xfcce('0x61')]||!_0x38f155[_0xfcce('0x59')]){_0x1e8912=path['join'](config[_0xfcce('0x5d')],_0x5eca0d,_[_0xfcce('0x5e')](_0xfcce('0x70')));}if(!fs[_0xfcce('0x63')](_0x1e8912)){throw new db[(_0xfcce('0x64'))][(_0xfcce('0x65'))](_[_0xfcce('0x60')](_0xfcce('0x59'))+_0xfcce('0x66'));}return _0xd8d8ad['download'](_0x1e8912);}})['catch'](handleError(_0xd8d8ad,null));};exports['addFavicon']=function(_0x21b4c9,_0x4b7b4b,_0x5c05f8){if(_0x21b4c9[_0xfcce('0x51')]&&_0x21b4c9['file'][_0xfcce('0x52')]){_0x21b4c9[_0xfcce('0x4f')][_0xfcce('0x71')]=_0x21b4c9[_0xfcce('0x51')][_0xfcce('0x52')];}return db['Setting'][_0xfcce('0x4e')]({'where':{'id':_0x21b4c9['params']['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x4b7b4b,null))[_0xfcce('0x19')](saveUpdates(_0x21b4c9['body'],null))['then'](respondWithResult(_0x4b7b4b,null))[_0xfcce('0x23')](handleError(_0x4b7b4b,null));};var utilLicense=require('../../config/license/util');exports[_0xfcce('0x72')]=function(_0x3e11fd,_0x574a8b,_0x38fb98){var _0x44e326=_0xfcce('0x57');var _0x6e13c9={'custom':![]};return utilLicense['getLicense']()[_0xfcce('0x19')](function(_0x9bfc50){if(_0x9bfc50){_0x6e13c9=_0x9bfc50;}return db['Setting'][_0xfcce('0x4e')]({'where':{'id':_0x3e11fd['params']['id']},'attributes':['logo','loginLogo',_0xfcce('0x59'),_0xfcce('0x71'),_0xfcce('0x69'),_0xfcce('0x5a'),_0xfcce('0x5b'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x574a8b,null))['then'](function(_0x484971){if(_0x484971){var _0x5c5751=_0x484971[_0xfcce('0x71')]&&fs[_0xfcce('0x63')](path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x44e326,_[_0xfcce('0x5e')](_0x484971['favicon'])))?path['join'](config[_0xfcce('0x5d')],_0x44e326,_[_0xfcce('0x5e')](_0x484971[_0xfcce('0x71')])):path['join'](config['root'],_0x44e326,_['toLower'](_0xfcce('0x73')));var _0x57372c=_0xfcce('0x5f')+_[_0xfcce('0x60')]('favicon');if(_0x484971[_0x57372c]||!_0x6e13c9['custom']){_0x5c5751=path['join'](config[_0xfcce('0x5d')],_0x44e326,_[_0xfcce('0x5e')](_0xfcce('0x73')));}if(!fs['existsSync'](_0x5c5751)){throw new db[(_0xfcce('0x64'))][(_0xfcce('0x65'))](_[_0xfcce('0x60')]('favicon')+_0xfcce('0x66'));}return _0x574a8b[_0xfcce('0x6c')](_0x5c5751);}})['catch'](handleError(_0x574a8b,null));};exports['getDate']=function(_0x81e549,_0xc0323){var _0x17efbd={'offset':moment()[_0xfcce('0x74')]()};_0x17efbd[_0xfcce('0x75')]=moment()[_0xfcce('0x74')](_0x17efbd[_0xfcce('0x28')])[_0xfcce('0x76')](_0xfcce('0x77'));return _0xc0323[_0xfcce('0x25')](0xc8)[_0xfcce('0x78')](_0x17efbd);};
\ No newline at end of file
index f83cac2..e0f15b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0x55ca,0x126));var _0xa55c=function(_0x9adcd6,_0x36278b){_0x9adcd6=_0x9adcd6-0x0;var _0xdf8ff2=_0x55ca[_0x9adcd6];return _0xdf8ff2;};'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')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x4debdd,_0x114aab){var _0x4a83e6=function(_0x4e8ed8){while(--_0x4e8ed8){_0x4debdd['push'](_0x4debdd['shift']());}};_0x4a83e6(++_0x114aab);}(_0x008c,0x188));var _0xc008=function(_0x5c2829,_0x2e1482){_0x5c2829=_0x5c2829-0x0;var _0x4d6544=_0x008c[_0x5c2829];return _0x4d6544;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 91417ef..82087f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5bb=['then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','find','options','where','attributes','include','model','map','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd5bb,0xed));var _0xbd5b=function(_0x4913c1,_0x1add43){_0x4913c1=_0x4913c1-0x0;var _0x28a2bc=_0xd5bb[_0x4913c1];return _0x28a2bc;};'use strict';var _=require(_0xbd5b('0x0'));var util=require(_0xbd5b('0x1'));var moment=require('moment');var BPromise=require(_0xbd5b('0x2'));var rs=require(_0xbd5b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd5b('0x4'))['db'];var utils=require(_0xbd5b('0x5'));var logger=require(_0xbd5b('0x6'))(_0xbd5b('0x7'));var config=require(_0xbd5b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x387157,_0x413958,_0x3e9947){return new BPromise(function(_0x1995d0,_0x3e739b){return client[_0xbd5b('0xa')](_0x387157,_0x3e9947)[_0xbd5b('0xb')](function(_0x3e1569){logger[_0xbd5b('0xc')](_0xbd5b('0xd'),_0x413958,_0xbd5b('0xe'));logger[_0xbd5b('0xf')](_0xbd5b('0x10'),_0x413958,_0xbd5b('0xe'),JSON[_0xbd5b('0x11')](_0x3e1569));if(_0x3e1569[_0xbd5b('0x12')]){if(_0x3e1569[_0xbd5b('0x12')]['code']===0x1f4){logger[_0xbd5b('0x12')](_0xbd5b('0xd'),_0x413958,_0x3e1569[_0xbd5b('0x12')][_0xbd5b('0x13')]);return _0x3e739b(_0x3e1569[_0xbd5b('0x12')]['message']);}logger[_0xbd5b('0x12')](_0xbd5b('0xd'),_0x413958,_0x3e1569[_0xbd5b('0x12')][_0xbd5b('0x13')]);return _0x1995d0(_0x3e1569[_0xbd5b('0x12')][_0xbd5b('0x13')]);}else{logger['info'](_0xbd5b('0xd'),_0x413958,_0xbd5b('0xe'));_0x1995d0(_0x3e1569[_0xbd5b('0x14')]['message']);}})[_0xbd5b('0x15')](function(_0x5a4373){logger['error'](_0xbd5b('0xd'),_0x413958,_0x5a4373);_0x3e739b(_0x5a4373);});});}exports[_0xbd5b('0x16')]=function(_0x3c4077){var _0x5e3244=this;return new Promise(function(_0x193301,_0x4a5c66){return db[_0xbd5b('0x17')][_0xbd5b('0x18')]({'raw':_0x3c4077[_0xbd5b('0x19')]?_0x3c4077[_0xbd5b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3c4077[_0xbd5b('0x19')]?_0x3c4077[_0xbd5b('0x19')][_0xbd5b('0x1a')]||null:null,'attributes':_0x3c4077[_0xbd5b('0x19')]?_0x3c4077[_0xbd5b('0x19')][_0xbd5b('0x1b')]||null:null,'include':_0x3c4077['options']?_0x3c4077[_0xbd5b('0x19')]['include']?_['map'](_0x3c4077[_0xbd5b('0x19')][_0xbd5b('0x1c')],function(_0x2b4417){return{'model':db[_0x2b4417[_0xbd5b('0x1d')]],'as':_0x2b4417['as'],'attributes':_0x2b4417[_0xbd5b('0x1b')],'include':_0x2b4417[_0xbd5b('0x1c')]?_[_0xbd5b('0x1e')](_0x2b4417['include'],function(_0x19334e){return{'model':db[_0x19334e[_0xbd5b('0x1d')]],'as':_0x19334e['as'],'attributes':_0x19334e[_0xbd5b('0x1b')],'include':_0x19334e['include']?_[_0xbd5b('0x1e')](_0x19334e[_0xbd5b('0x1c')],function(_0x3a62ac){return{'model':db[_0x3a62ac[_0xbd5b('0x1d')]],'as':_0x3a62ac['as'],'attributes':_0x3a62ac[_0xbd5b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbd5b('0xb')](function(_0x37b167){logger['info'](_0xbd5b('0x16'),_0x3c4077);logger[_0xbd5b('0xf')](_0xbd5b('0x16'),_0x3c4077,JSON['stringify'](_0x37b167));_0x193301(_0x37b167);})['catch'](function(_0x52958b){logger[_0xbd5b('0x12')](_0xbd5b('0x16'),_0x52958b[_0xbd5b('0x13')],_0x3c4077);_0x4a5c66(_0x5e3244[_0xbd5b('0x12')](0x1f4,_0x52958b[_0xbd5b('0x13')]));});});};
\ No newline at end of file
+var _0xc108=['client','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5972e3,_0x32f5b9){var _0x265a48=function(_0x5d88f0){while(--_0x5d88f0){_0x5972e3['push'](_0x5972e3['shift']());}};_0x265a48(++_0x32f5b9);}(_0xc108,0x1d0));var _0x8c10=function(_0x52daa0,_0x267197){_0x52daa0=_0x52daa0-0x0;var _0x337f57=_0xc108[_0x52daa0];return _0x337f57;};'use strict';var _=require(_0x8c10('0x0'));var util=require(_0x8c10('0x1'));var moment=require(_0x8c10('0x2'));var BPromise=require(_0x8c10('0x3'));var rs=require(_0x8c10('0x4'));var fs=require('fs');var Redis=require(_0x8c10('0x5'));var db=require(_0x8c10('0x6'))['db'];var utils=require(_0x8c10('0x7'));var logger=require(_0x8c10('0x8'))(_0x8c10('0x9'));var config=require(_0x8c10('0xa'));var jayson=require(_0x8c10('0xb'));var client=jayson[_0x8c10('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x205a9d,_0x55e737,_0xda925a){return new BPromise(function(_0x1e50ae,_0x27f80d){return client[_0x8c10('0xd')](_0x205a9d,_0xda925a)[_0x8c10('0xe')](function(_0x4fd2ea){logger[_0x8c10('0xf')](_0x8c10('0x10'),_0x55e737,'request\x20sent');logger[_0x8c10('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x55e737,_0x8c10('0x12'),JSON[_0x8c10('0x13')](_0x4fd2ea));if(_0x4fd2ea[_0x8c10('0x14')]){if(_0x4fd2ea[_0x8c10('0x14')][_0x8c10('0x15')]===0x1f4){logger[_0x8c10('0x14')](_0x8c10('0x10'),_0x55e737,_0x4fd2ea[_0x8c10('0x14')]['message']);return _0x27f80d(_0x4fd2ea[_0x8c10('0x14')][_0x8c10('0x16')]);}logger[_0x8c10('0x14')](_0x8c10('0x10'),_0x55e737,_0x4fd2ea['error'][_0x8c10('0x16')]);return _0x1e50ae(_0x4fd2ea[_0x8c10('0x14')][_0x8c10('0x16')]);}else{logger[_0x8c10('0xf')]('Setting,\x20%s,\x20%s',_0x55e737,_0x8c10('0x12'));_0x1e50ae(_0x4fd2ea['result'][_0x8c10('0x16')]);}})[_0x8c10('0x17')](function(_0x7dcb9e){logger[_0x8c10('0x14')](_0x8c10('0x10'),_0x55e737,_0x7dcb9e);_0x27f80d(_0x7dcb9e);});});}exports[_0x8c10('0x18')]=function(_0x27f97e){var _0xa50bc3=this;return new Promise(function(_0x2feb51,_0x1cc253){return db[_0x8c10('0x19')][_0x8c10('0x1a')]({'raw':_0x27f97e[_0x8c10('0x1b')]?_0x27f97e[_0x8c10('0x1b')][_0x8c10('0x1c')]===undefined?!![]:![]:!![],'where':_0x27f97e[_0x8c10('0x1b')]?_0x27f97e['options'][_0x8c10('0x1d')]||null:null,'attributes':_0x27f97e['options']?_0x27f97e[_0x8c10('0x1b')]['attributes']||null:null,'include':_0x27f97e[_0x8c10('0x1b')]?_0x27f97e[_0x8c10('0x1b')][_0x8c10('0x1e')]?_[_0x8c10('0x1f')](_0x27f97e['options'][_0x8c10('0x1e')],function(_0x5e3083){return{'model':db[_0x5e3083[_0x8c10('0x20')]],'as':_0x5e3083['as'],'attributes':_0x5e3083[_0x8c10('0x21')],'include':_0x5e3083[_0x8c10('0x1e')]?_['map'](_0x5e3083['include'],function(_0x503e9a){return{'model':db[_0x503e9a['model']],'as':_0x503e9a['as'],'attributes':_0x503e9a[_0x8c10('0x21')],'include':_0x503e9a[_0x8c10('0x1e')]?_[_0x8c10('0x1f')](_0x503e9a['include'],function(_0x3a6c6c){return{'model':db[_0x3a6c6c[_0x8c10('0x20')]],'as':_0x3a6c6c['as'],'attributes':_0x3a6c6c[_0x8c10('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8c10('0xe')](function(_0x5f38ee){logger[_0x8c10('0xf')](_0x8c10('0x18'),_0x27f97e);logger[_0x8c10('0x11')](_0x8c10('0x18'),_0x27f97e,JSON['stringify'](_0x5f38ee));_0x2feb51(_0x5f38ee);})[_0x8c10('0x17')](function(_0x146a91){logger[_0x8c10('0x14')](_0x8c10('0x18'),_0x146a91[_0x8c10('0x16')],_0x27f97e);_0x1cc253(_0xa50bc3[_0x8c10('0x14')](0x1f4,_0x146a91[_0x8c10('0x16')]));});});};
\ No newline at end of file
index db38d41..e85bdf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x1ba865,_0x110d26){var _0x35a964=function(_0x221267){while(--_0x221267){_0x1ba865['push'](_0x1ba865['shift']());}};_0x35a964(++_0x110d26);}(_0xe14b,0x93));var _0xbe14=function(_0x4afbc0,_0x6e7ffe){_0x4afbc0=_0x4afbc0-0x0;var _0x2c8a0c=_0xe14b[_0x4afbc0];return _0x2c8a0c;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x464838,_0x28c910){var _0x2ca654=function(_0x380da8){while(--_0x380da8){_0x464838['push'](_0x464838['shift']());}};_0x2ca654(++_0x28c910);}(_0x326f,0xd1));var _0xf326=function(_0x23f0fb,_0x4a9388){_0x23f0fb=_0x23f0fb-0x0;var _0x4f15cc=_0x326f[_0x23f0fb];return _0x4f15cc;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router;
\ No newline at end of file
index 197a27d..b3fb154 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10d0=['plivo','bandwidth','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend'];(function(_0x335b29,_0x4fb173){var _0x316e9a=function(_0x1cc96b){while(--_0x1cc96b){_0x335b29['push'](_0x335b29['shift']());}};_0x316e9a(++_0x4fb173);}(_0x10d0,0xdd));var _0x010d=function(_0x5b7120,_0x1db3d1){_0x5b7120=_0x5b7120-0x0;var _0x261dff=_0x10d0[_0x5b7120];return _0x261dff;};'use strict';var Sequelize=require(_0x010d('0x0'));var rs=require('randomstring');module[_0x010d('0x1')]={'name':{'type':Sequelize[_0x010d('0x2')],'unique':_0x010d('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x010d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x010d('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x010d('0x2')],'defaultValue':function(){return rs[_0x010d('0x4')]();}},'phone':{'type':Sequelize[_0x010d('0x2')]},'type':{'type':Sequelize[_0x010d('0x5')](_0x010d('0x6'),_0x010d('0x7'),_0x010d('0x8'),_0x010d('0x9'),_0x010d('0xa'),'clickatell',_0x010d('0xb'),'csc','infobip',_0x010d('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x010d('0x2')]},'authToken':{'type':Sequelize[_0x010d('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x010d('0x2')]},'password':{'type':Sequelize[_0x010d('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x010d('0x2')]},'senderString':{'type':Sequelize[_0x010d('0x2')]},'deliveryReport':{'type':Sequelize[_0x010d('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x010d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x010d('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x010d('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x010d('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x010d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x010d('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x010d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x010d('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x010d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x010d('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x010d('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x010d('0xd')],'defaultValue':![],'comment':_0x010d('0x11'),'set':function(_0x2d9f49){if(!_0x2d9f49)this[_0x010d('0x12')](_0x010d('0x13'),null);this[_0x010d('0x12')](_0x010d('0x14'),_0x2d9f49);}}};
\ No newline at end of file
+var _0xef37=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','generate','twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x57d392,_0x12b76b){var _0x3f4397=function(_0x5e1ceb){while(--_0x5e1ceb){_0x57d392['push'](_0x57d392['shift']());}};_0x3f4397(++_0x12b76b);}(_0xef37,0x143));var _0x7ef3=function(_0xf9c730,_0x5a0268){_0xf9c730=_0xf9c730-0x0;var _0x19f986=_0xef37[_0xf9c730];return _0x19f986;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x7ef3('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ef3('0x1')],'unique':_0x7ef3('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x7ef3('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7ef3('0x3')]();}},'phone':{'type':Sequelize[_0x7ef3('0x1')]},'type':{'type':Sequelize['ENUM'](_0x7ef3('0x4'),_0x7ef3('0x5'),_0x7ef3('0x6'),_0x7ef3('0x7'),_0x7ef3('0x8'),'clickatell',_0x7ef3('0x9'),_0x7ef3('0xa'),'infobip',_0x7ef3('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x7ef3('0x1')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x7ef3('0x1')]},'password':{'type':Sequelize[_0x7ef3('0x1')]},'apiKey':{'type':Sequelize[_0x7ef3('0x1')]},'applicationId':{'type':Sequelize[_0x7ef3('0x1')]},'accountId':{'type':Sequelize[_0x7ef3('0x1')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x7ef3('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x7ef3('0x1')]},'notificationTemplate':{'type':Sequelize[_0x7ef3('0xd')],'defaultValue':function(){return _0x7ef3('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7ef3('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7ef3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7ef3('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7ef3('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7ef3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x7ef3('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7ef3('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7ef3('0xc')],'defaultValue':![],'comment':_0x7ef3('0x10'),'set':function(_0x11c9ce){if(!_0x11c9ce)this[_0x7ef3('0x11')](_0x7ef3('0x12'),null);this[_0x7ef3('0x11')](_0x7ef3('0x13'),_0x11c9ce);}}};
\ No newline at end of file
index ffced08..21395bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf71=['<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','transaction','sequelize','SmsApplication','findAndCountAll','getApplications','getInteractions','Contact','User','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','SmsMessage','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','DELIVERED','groupName','intelepeer','redif','error_code','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','end','stack','name','send','Pause','SmsAccount','fieldName','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','includeAll','include','findAll','rows','params','mandatoryDispositionPause','rawAttributes','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','options','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','sms','Applications','account','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','twilio','from','From','Body','messageId','MessageSid','skebby','sender','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','csc','segmentedMessage','fromNumber','text','replyMessageId','bandwidth','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','CmList','ListId','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','applications','close','*,*,*,*','created','UserId','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml'];(function(_0x4458ef,_0x57d5f5){var _0x1d62a1=function(_0x32ba2b){while(--_0x32ba2b){_0x4458ef['push'](_0x4458ef['shift']());}};_0x1d62a1(++_0x57d5f5);}(_0xbf71,0x10c));var _0x1bf7=function(_0x5e1cae,_0x44c44a){_0x5e1cae=_0x5e1cae-0x0;var _0x270d1f=_0xbf71[_0x5e1cae];return _0x270d1f;};'use strict';var emlformat=require(_0x1bf7('0x0'));var rimraf=require(_0x1bf7('0x1'));var zipdir=require(_0x1bf7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1bf7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1bf7('0x4'));var util=require(_0x1bf7('0x5'));var path=require(_0x1bf7('0x6'));var sox=require('sox');var csv=require(_0x1bf7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bf7('0x8'));var _=require(_0x1bf7('0x9'));var squel=require('squel');var crypto=require(_0x1bf7('0xa'));var jsforce=require(_0x1bf7('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1bf7('0xc'));var Papa=require(_0x1bf7('0xd'));var Redis=require(_0x1bf7('0xe'));var authService=require(_0x1bf7('0xf'));var qs=require(_0x1bf7('0x10'));var as=require(_0x1bf7('0x11'));var hardwareService=require(_0x1bf7('0x12'));var logger=require(_0x1bf7('0x13'))(_0x1bf7('0x14'));var utils=require('../../config/utils');var config=require(_0x1bf7('0x15'));var licenseUtil=require(_0x1bf7('0x16'));var db=require('../../mysqldb')['db'];config[_0x1bf7('0x17')]=_[_0x1bf7('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1bf7('0x17')]));require(_0x1bf7('0x19'))[_0x1bf7('0x1a')](socket);var jayson=require(_0x1bf7('0x1b'));var client=jayson['client'][_0x1bf7('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x13245c,_0x32d307,_0x1f3489,_0x953281){return new BPromise(function(_0x403b26,_0x3853ff){var _0x239c76=_0x953281||client;return _0x239c76[_0x1bf7('0x1d')](_0x13245c,_0x1f3489)[_0x1bf7('0x1e')](function(_0x3842ca){logger[_0x1bf7('0x1f')](_0x1bf7('0x20'),_0x32d307,_0x1bf7('0x21'));logger[_0x1bf7('0x22')](_0x1bf7('0x23'),_0x32d307,_0x1bf7('0x21'),JSON[_0x1bf7('0x24')](_0x3842ca));if(_0x3842ca[_0x1bf7('0x25')]){if(_0x3842ca['error'][_0x1bf7('0x26')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x32d307,_0x3842ca['error'][_0x1bf7('0x27')]);return _0x3853ff(_0x3842ca[_0x1bf7('0x25')][_0x1bf7('0x27')]);}logger[_0x1bf7('0x25')](_0x1bf7('0x20'),_0x32d307,_0x3842ca[_0x1bf7('0x25')][_0x1bf7('0x27')]);return _0x403b26(_0x3842ca[_0x1bf7('0x25')][_0x1bf7('0x27')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x32d307,_0x1bf7('0x21'));_0x403b26(_0x3842ca[_0x1bf7('0x28')][_0x1bf7('0x27')]);}})[_0x1bf7('0x29')](function(_0x2a28ea){logger[_0x1bf7('0x25')]('SmsAccount,\x20%s,\x20%s',_0x32d307,_0x2a28ea);_0x3853ff(_0x2a28ea);});});}function respondWithStatusCode(_0x4601dc,_0x3ba510){_0x3ba510=_0x3ba510||0xcc;return function(_0x4f7e55){if(_0x4f7e55){return _0x4601dc[_0x1bf7('0x2a')](_0x3ba510);}return _0x4601dc[_0x1bf7('0x2b')](_0x3ba510)['end']();};}function respondWithResult(_0x512ca5,_0x39842e){_0x39842e=_0x39842e||0xc8;return function(_0x60f569){if(_0x60f569){return _0x512ca5[_0x1bf7('0x2b')](_0x39842e)[_0x1bf7('0x2c')](_0x60f569);}};}function respondWithFilteredResult(_0x30058a,_0x2aa551){return function(_0x297ad2){if(_0x297ad2){var _0x32173b=typeof _0x2aa551[_0x1bf7('0x2d')]===_0x1bf7('0x2e')&&typeof _0x2aa551['limit']===_0x1bf7('0x2e');var _0x4704ae=_0x297ad2[_0x1bf7('0x2f')];var _0x5796c0=_0x32173b?0x0:_0x2aa551[_0x1bf7('0x2d')];var _0xc1deda=_0x32173b?_0x297ad2['count']:_0x2aa551[_0x1bf7('0x2d')]+_0x2aa551[_0x1bf7('0x30')];var _0x8e7e20;if(_0xc1deda>=_0x4704ae){_0xc1deda=_0x4704ae;_0x8e7e20=0xc8;}else{_0x8e7e20=0xce;}_0x30058a[_0x1bf7('0x2b')](_0x8e7e20);return _0x30058a['set'](_0x1bf7('0x31'),_0x5796c0+'-'+_0xc1deda+'/'+_0x4704ae)[_0x1bf7('0x2c')](_0x297ad2);}return null;};}function patchUpdates(_0x932f2d){return function(_0x2776db){try{jsonpatch[_0x1bf7('0x32')](_0x2776db,_0x932f2d,!![]);}catch(_0x5d9a80){return BPromise[_0x1bf7('0x33')](_0x5d9a80);}return _0x2776db[_0x1bf7('0x34')]();};}function saveUpdates(_0xfe5eb6,_0x140ab0){return function(_0x2bd065){if(_0x2bd065){return _0x2bd065[_0x1bf7('0x35')](_0xfe5eb6)[_0x1bf7('0x1e')](function(_0x29bca5){return _0x29bca5;});}return null;};}function removeEntity(_0x15db80,_0x5f1262){return function(_0xfef2c3){if(_0xfef2c3){return _0xfef2c3[_0x1bf7('0x36')]()['then'](function(){var _0x4bef35=_0xfef2c3[_0x1bf7('0x37')]({'plain':!![]});var _0x26286f=_0x1bf7('0x38');return db['UserProfileResource'][_0x1bf7('0x36')]({'where':{'type':_0x26286f,'resourceId':_0x4bef35['id']}})[_0x1bf7('0x1e')](function(){return _0xfef2c3;});})['then'](function(){_0x15db80[_0x1bf7('0x2b')](0xcc)[_0x1bf7('0x39')]();});}};}function handleEntityNotFound(_0x577e9b,_0x1996da){return function(_0x41ae82){if(!_0x41ae82){_0x577e9b['sendStatus'](0x194);}return _0x41ae82;};}function handleError(_0x41de02,_0x108fb8){_0x108fb8=_0x108fb8||0x1f4;return function(_0xe011f7){logger[_0x1bf7('0x25')](_0xe011f7[_0x1bf7('0x3a')]);if(_0xe011f7['name']){delete _0xe011f7[_0x1bf7('0x3b')];}_0x41de02['status'](_0x108fb8)[_0x1bf7('0x3c')](_0xe011f7);};}exports['index']=function(_0x2cc44f,_0x315038){var _0x1a9ae4={'include':[{'model':db[_0x1bf7('0x3d')],'as':'mandatoryDispositionPause'}]},_0x343de7={},_0x1e43df={'count':0x0,'rows':[]};var _0x59d687=_['map'](db[_0x1bf7('0x3e')]['rawAttributes'],function(_0x2fb0d4){return{'name':_0x2fb0d4[_0x1bf7('0x3f')],'type':_0x2fb0d4['type'][_0x1bf7('0x40')]};});_0x343de7['model']=_['map'](_0x59d687,_0x1bf7('0x3b'));_0x343de7[_0x1bf7('0x41')]=_[_0x1bf7('0x42')](_0x2cc44f[_0x1bf7('0x41')]);_0x343de7[_0x1bf7('0x43')]=_['intersection'](_0x343de7[_0x1bf7('0x44')],_0x343de7[_0x1bf7('0x41')]);_0x1a9ae4['attributes']=_[_0x1bf7('0x45')](_0x343de7['model'],qs['fields'](_0x2cc44f['query'][_0x1bf7('0x46')]));_0x1a9ae4[_0x1bf7('0x47')]=_0x1a9ae4[_0x1bf7('0x47')][_0x1bf7('0x48')]?_0x1a9ae4[_0x1bf7('0x47')]:_0x343de7['model'];if(!_0x2cc44f['query'][_0x1bf7('0x49')](_0x1bf7('0x4a'))){_0x1a9ae4[_0x1bf7('0x30')]=qs['limit'](_0x2cc44f['query'][_0x1bf7('0x30')]);_0x1a9ae4[_0x1bf7('0x2d')]=qs[_0x1bf7('0x2d')](_0x2cc44f[_0x1bf7('0x41')][_0x1bf7('0x2d')]);}_0x1a9ae4[_0x1bf7('0x4b')]=qs[_0x1bf7('0x4c')](_0x2cc44f[_0x1bf7('0x41')][_0x1bf7('0x4c')]);_0x1a9ae4[_0x1bf7('0x4d')]=qs[_0x1bf7('0x43')](_[_0x1bf7('0x4e')](_0x2cc44f[_0x1bf7('0x41')],_0x343de7[_0x1bf7('0x43')]),_0x59d687);if(_0x2cc44f['query'][_0x1bf7('0x4f')]){_0x1a9ae4[_0x1bf7('0x4d')]=_['merge'](_0x1a9ae4[_0x1bf7('0x4d')],{'$or':_[_0x1bf7('0x50')](_0x59d687,function(_0x1d16d8){if(_0x1d16d8[_0x1bf7('0x51')]!==_0x1bf7('0x52')){var _0x52a158={};_0x52a158[_0x1d16d8[_0x1bf7('0x3b')]]={'$like':'%'+_0x2cc44f[_0x1bf7('0x41')][_0x1bf7('0x4f')]+'%'};return _0x52a158;}})});}_0x1a9ae4=_['merge']({},_0x1a9ae4,_0x2cc44f['options']);var _0x125fca={'where':_0x1a9ae4[_0x1bf7('0x4d')]};return db['SmsAccount'][_0x1bf7('0x2f')](_0x125fca)[_0x1bf7('0x1e')](function(_0x54659a){_0x1e43df[_0x1bf7('0x2f')]=_0x54659a;if(_0x2cc44f[_0x1bf7('0x41')][_0x1bf7('0x53')]){_0x1a9ae4[_0x1bf7('0x54')]=[{'all':!![]}];}return db[_0x1bf7('0x3e')][_0x1bf7('0x55')](_0x1a9ae4);})[_0x1bf7('0x1e')](function(_0x55185f){_0x1e43df[_0x1bf7('0x56')]=_0x55185f;return _0x1e43df;})[_0x1bf7('0x1e')](respondWithFilteredResult(_0x315038,_0x1a9ae4))[_0x1bf7('0x29')](handleError(_0x315038,null));};exports['show']=function(_0x116167,_0x1327ce){var _0x1d215d={'raw':![],'where':{'id':_0x116167[_0x1bf7('0x57')]['id']},'include':[{'model':db[_0x1bf7('0x3d')],'as':_0x1bf7('0x58')}]},_0x33cc6b={};_0x33cc6b[_0x1bf7('0x44')]=_[_0x1bf7('0x42')](db[_0x1bf7('0x3e')][_0x1bf7('0x59')]);_0x33cc6b[_0x1bf7('0x41')]=_['keys'](_0x116167[_0x1bf7('0x41')]);_0x33cc6b[_0x1bf7('0x43')]=_[_0x1bf7('0x45')](_0x33cc6b[_0x1bf7('0x44')],_0x33cc6b[_0x1bf7('0x41')]);_0x1d215d[_0x1bf7('0x47')]=_['intersection'](_0x33cc6b['model'],qs[_0x1bf7('0x46')](_0x116167[_0x1bf7('0x41')][_0x1bf7('0x46')]));_0x1d215d['attributes']=_0x1d215d[_0x1bf7('0x47')][_0x1bf7('0x48')]?_0x1d215d[_0x1bf7('0x47')]:_0x33cc6b[_0x1bf7('0x44')];if(_0x116167[_0x1bf7('0x41')][_0x1bf7('0x53')]){_0x1d215d[_0x1bf7('0x54')]=[{'all':!![]}];}_0x1d215d=_[_0x1bf7('0x5a')]({},_0x1d215d,_0x116167['options']);return db['SmsAccount'][_0x1bf7('0x5b')](_0x1d215d)[_0x1bf7('0x1e')](handleEntityNotFound(_0x1327ce,null))[_0x1bf7('0x1e')](respondWithResult(_0x1327ce,null))[_0x1bf7('0x29')](handleError(_0x1327ce,null));};exports[_0x1bf7('0x5c')]=function(_0x2d1238,_0x81a10e){return db[_0x1bf7('0x3e')]['create'](_0x2d1238[_0x1bf7('0x5d')],{})[_0x1bf7('0x1e')](function(_0x3e9f85){var _0x934430=_0x2d1238['user']['get']({'plain':!![]});if(!_0x934430)throw new Error(_0x1bf7('0x5e'));if(_0x934430[_0x1bf7('0x5f')]===_0x1bf7('0x60')){var _0x36543e=_0x3e9f85[_0x1bf7('0x37')]({'plain':!![]});var _0xcf383b=_0x1bf7('0x38');return db[_0x1bf7('0x61')][_0x1bf7('0x5b')]({'where':{'name':_0xcf383b,'userProfileId':_0x934430[_0x1bf7('0x62')]},'raw':!![]})[_0x1bf7('0x1e')](function(_0xab5ede){if(_0xab5ede&&_0xab5ede[_0x1bf7('0x63')]===0x0){return db[_0x1bf7('0x64')][_0x1bf7('0x5c')]({'name':_0x36543e[_0x1bf7('0x3b')],'resourceId':_0x36543e['id'],'type':_0xab5ede[_0x1bf7('0x3b')],'sectionId':_0xab5ede['id']},{})[_0x1bf7('0x1e')](function(){return _0x3e9f85;});}else{return _0x3e9f85;}})[_0x1bf7('0x29')](function(_0x2b6961){logger[_0x1bf7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b6961);throw _0x2b6961;});}return _0x3e9f85;})[_0x1bf7('0x1e')](respondWithResult(_0x81a10e,0xc9))[_0x1bf7('0x29')](handleError(_0x81a10e,null));};exports['update']=function(_0x1e708d,_0xc10285){if(_0x1e708d[_0x1bf7('0x5d')]['id']){delete _0x1e708d[_0x1bf7('0x5d')]['id'];}return db['SmsAccount'][_0x1bf7('0x5b')]({'where':{'id':_0x1e708d['params']['id']},'include':[{'model':db['Pause'],'as':_0x1bf7('0x58')}]})['then'](handleEntityNotFound(_0xc10285,null))['then'](saveUpdates(_0x1e708d[_0x1bf7('0x5d')],null))[_0x1bf7('0x1e')](respondWithResult(_0xc10285,null))[_0x1bf7('0x29')](handleError(_0xc10285,null));};exports['destroy']=function(_0x1aca63,_0x32a17d){return db[_0x1bf7('0x3e')][_0x1bf7('0x5b')]({'where':{'id':_0x1aca63[_0x1bf7('0x57')]['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x32a17d,null))[_0x1bf7('0x1e')](removeEntity(_0x32a17d,null))['catch'](handleError(_0x32a17d,null));};exports[_0x1bf7('0x65')]=function(_0x441f1b,_0x3aa5e1){return db[_0x1bf7('0x3e')][_0x1bf7('0x65')]()[_0x1bf7('0x1e')](respondWithResult(_0x3aa5e1,null))[_0x1bf7('0x29')](handleError(_0x3aa5e1,null));};exports[_0x1bf7('0x66')]=function(_0x288538,_0x2100f4,_0x2604f){if(_0x288538['body']['id']){delete _0x288538[_0x1bf7('0x5d')]['id'];}return db[_0x1bf7('0x3e')][_0x1bf7('0x5b')]({'where':{'id':_0x288538['params']['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x2100f4,null))[_0x1bf7('0x1e')](function(_0x22ce86){if(_0x22ce86){_0x288538['body'][_0x1bf7('0x67')]=_0x22ce86['id'];return db['Disposition'][_0x1bf7('0x5c')](_0x288538['body']);}})['then'](respondWithResult(_0x2100f4,null))[_0x1bf7('0x29')](handleError(_0x2100f4,null));};exports[_0x1bf7('0x68')]=function(_0x1a9900,_0x4c909c,_0x55ffeb){var _0x40a12d={'raw':![],'where':{}};var _0xee59b1={};var _0x470b54={'count':0x0,'rows':[]};return db[_0x1bf7('0x3e')][_0x1bf7('0x69')]({'where':{'id':_0x1a9900['params']['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x4c909c,null))[_0x1bf7('0x1e')](function(_0x166847){if(_0x166847){_0xee59b1[_0x1bf7('0x44')]=_[_0x1bf7('0x42')](db[_0x1bf7('0x6a')][_0x1bf7('0x59')]);_0xee59b1['query']=_[_0x1bf7('0x42')](_0x1a9900[_0x1bf7('0x41')]);_0xee59b1['filters']=_[_0x1bf7('0x45')](_0xee59b1[_0x1bf7('0x44')],_0xee59b1[_0x1bf7('0x41')]);_0x40a12d[_0x1bf7('0x47')]=_[_0x1bf7('0x45')](_0xee59b1[_0x1bf7('0x44')],qs['fields'](_0x1a9900[_0x1bf7('0x41')][_0x1bf7('0x46')]));_0x40a12d[_0x1bf7('0x47')]=_0x40a12d['attributes']['length']?_0x40a12d[_0x1bf7('0x47')]:_0xee59b1['model'];if(!_0x1a9900[_0x1bf7('0x41')][_0x1bf7('0x49')](_0x1bf7('0x4a'))){_0x40a12d[_0x1bf7('0x30')]=qs[_0x1bf7('0x30')](_0x1a9900[_0x1bf7('0x41')][_0x1bf7('0x30')]);_0x40a12d[_0x1bf7('0x2d')]=qs[_0x1bf7('0x2d')](_0x1a9900[_0x1bf7('0x41')][_0x1bf7('0x2d')]);}_0x40a12d[_0x1bf7('0x4b')]=qs['sort'](_0x1a9900['query'][_0x1bf7('0x4c')]);_0x40a12d[_0x1bf7('0x4d')]=qs[_0x1bf7('0x43')](_[_0x1bf7('0x4e')](_0x1a9900[_0x1bf7('0x41')],_0xee59b1[_0x1bf7('0x43')]));_0x40a12d[_0x1bf7('0x4d')][_0x1bf7('0x67')]=_0x166847['id'];if(_0x1a9900[_0x1bf7('0x41')]['filter']){_0x40a12d[_0x1bf7('0x4d')]=_[_0x1bf7('0x5a')](_0x40a12d[_0x1bf7('0x4d')],{'$or':_[_0x1bf7('0x50')](_0x40a12d[_0x1bf7('0x47')],function(_0x4ce85c){var _0x2b375b={};_0x2b375b[_0x4ce85c]={'$like':'%'+_0x1a9900[_0x1bf7('0x41')][_0x1bf7('0x4f')]+'%'};return _0x2b375b;})});}_0x40a12d=_['merge']({},_0x40a12d,_0x1a9900[_0x1bf7('0x6b')]);return db[_0x1bf7('0x6a')][_0x1bf7('0x2f')]({'where':_0x40a12d[_0x1bf7('0x4d')]})['then'](function(_0x2c2f52){_0x470b54[_0x1bf7('0x2f')]=_0x2c2f52;if(_0x1a9900[_0x1bf7('0x41')][_0x1bf7('0x53')]){_0x40a12d[_0x1bf7('0x54')]=[{'all':!![]}];}return db[_0x1bf7('0x6a')][_0x1bf7('0x55')](_0x40a12d);})[_0x1bf7('0x1e')](function(_0x4487b8){_0x470b54[_0x1bf7('0x56')]=_0x4487b8;return _0x470b54;});}})['then'](respondWithFilteredResult(_0x4c909c,_0x40a12d))['catch'](handleError(_0x4c909c,null));};exports[_0x1bf7('0x6c')]=function(_0x3013e2,_0x516b76,_0x257370){return db['SmsAccount'][_0x1bf7('0x5b')]({'where':{'id':_0x3013e2[_0x1bf7('0x57')]['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x516b76,null))['then'](function(_0x341a84){if(_0x341a84){return _0x341a84[_0x1bf7('0x6c')](_0x3013e2[_0x1bf7('0x41')][_0x1bf7('0x6d')]);}})[_0x1bf7('0x1e')](respondWithStatusCode(_0x516b76,null))[_0x1bf7('0x29')](handleError(_0x516b76,null));};exports['addAnswer']=function(_0x290766,_0x18a47b,_0x5893ff){if(_0x290766[_0x1bf7('0x5d')]['id']){delete _0x290766[_0x1bf7('0x5d')]['id'];}return db[_0x1bf7('0x3e')][_0x1bf7('0x5b')]({'where':{'id':_0x290766[_0x1bf7('0x57')]['id']}})['then'](handleEntityNotFound(_0x18a47b,null))[_0x1bf7('0x1e')](function(_0x91298a){if(_0x91298a){_0x290766[_0x1bf7('0x5d')][_0x1bf7('0x67')]=_0x91298a['id'];return db['CannedAnswer'][_0x1bf7('0x5c')](_0x290766[_0x1bf7('0x5d')]);}})['then'](respondWithResult(_0x18a47b,null))[_0x1bf7('0x29')](handleError(_0x18a47b,null));};exports[_0x1bf7('0x6e')]=function(_0x45d79f,_0x373b37,_0x4fa6a0){var _0x57cb0a={'raw':![],'where':{}};var _0x2345f7={};var _0xc34ad0={'count':0x0,'rows':[]};return db[_0x1bf7('0x3e')][_0x1bf7('0x69')]({'where':{'id':_0x45d79f[_0x1bf7('0x57')]['id']}})['then'](handleEntityNotFound(_0x373b37,null))[_0x1bf7('0x1e')](function(_0x3b1955){if(_0x3b1955){_0x2345f7['model']=_['keys'](db['CannedAnswer'][_0x1bf7('0x59')]);_0x2345f7[_0x1bf7('0x41')]=_[_0x1bf7('0x42')](_0x45d79f[_0x1bf7('0x41')]);_0x2345f7[_0x1bf7('0x43')]=_['intersection'](_0x2345f7[_0x1bf7('0x44')],_0x2345f7[_0x1bf7('0x41')]);_0x57cb0a[_0x1bf7('0x47')]=_[_0x1bf7('0x45')](_0x2345f7[_0x1bf7('0x44')],qs[_0x1bf7('0x46')](_0x45d79f[_0x1bf7('0x41')]['fields']));_0x57cb0a[_0x1bf7('0x47')]=_0x57cb0a[_0x1bf7('0x47')][_0x1bf7('0x48')]?_0x57cb0a['attributes']:_0x2345f7['model'];if(!_0x45d79f[_0x1bf7('0x41')][_0x1bf7('0x49')](_0x1bf7('0x4a'))){_0x57cb0a[_0x1bf7('0x30')]=qs[_0x1bf7('0x30')](_0x45d79f[_0x1bf7('0x41')][_0x1bf7('0x30')]);_0x57cb0a[_0x1bf7('0x2d')]=qs[_0x1bf7('0x2d')](_0x45d79f[_0x1bf7('0x41')][_0x1bf7('0x2d')]);}_0x57cb0a[_0x1bf7('0x4b')]=qs['sort'](_0x45d79f['query']['sort']);_0x57cb0a[_0x1bf7('0x4d')]=qs[_0x1bf7('0x43')](_[_0x1bf7('0x4e')](_0x45d79f['query'],_0x2345f7[_0x1bf7('0x43')]));_0x57cb0a['where'][_0x1bf7('0x67')]=_0x3b1955['id'];if(_0x45d79f['query'][_0x1bf7('0x4f')]){_0x57cb0a[_0x1bf7('0x4d')]=_[_0x1bf7('0x5a')](_0x57cb0a[_0x1bf7('0x4d')],{'$or':_[_0x1bf7('0x50')](_0x57cb0a['attributes'],function(_0x5972c5){var _0x26b209={};_0x26b209[_0x5972c5]={'$like':'%'+_0x45d79f[_0x1bf7('0x41')][_0x1bf7('0x4f')]+'%'};return _0x26b209;})});}_0x57cb0a=_[_0x1bf7('0x5a')]({},_0x57cb0a,_0x45d79f[_0x1bf7('0x6b')]);return db[_0x1bf7('0x6f')][_0x1bf7('0x2f')]({'where':_0x57cb0a[_0x1bf7('0x4d')]})[_0x1bf7('0x1e')](function(_0x1973d8){_0xc34ad0[_0x1bf7('0x2f')]=_0x1973d8;if(_0x45d79f[_0x1bf7('0x41')][_0x1bf7('0x53')]){_0x57cb0a[_0x1bf7('0x54')]=[{'all':!![]}];}return db[_0x1bf7('0x6f')][_0x1bf7('0x55')](_0x57cb0a);})[_0x1bf7('0x1e')](function(_0x575c58){_0xc34ad0['rows']=_0x575c58;return _0xc34ad0;});}})[_0x1bf7('0x1e')](respondWithFilteredResult(_0x373b37,_0x57cb0a))[_0x1bf7('0x29')](handleError(_0x373b37,null));};exports[_0x1bf7('0x70')]=function(_0xa371bc,_0x3f2226,_0x2a6091){return db[_0x1bf7('0x3e')][_0x1bf7('0x5b')]({'where':{'id':_0xa371bc[_0x1bf7('0x57')]['id']}})['then'](handleEntityNotFound(_0x3f2226,null))[_0x1bf7('0x1e')](function(_0x495736){if(_0x495736){return _0x495736['removeAnswers'](_0xa371bc['query'][_0x1bf7('0x6d')]);}})[_0x1bf7('0x1e')](respondWithStatusCode(_0x3f2226,null))['catch'](handleError(_0x3f2226,null));};exports[_0x1bf7('0x71')]=function(_0x246e66,_0x3c3b60,_0x2f31bf){var _0x5f0efa={'channel':_0x1bf7('0x72')};var _0x25c8eb=[];var _0x33aab9=[];var _0x5e540d={};return db[_0x1bf7('0x3e')]['find']({'where':{'id':_0x246e66[_0x1bf7('0x57')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x1bf7('0x73')}]})[_0x1bf7('0x1e')](handleEntityNotFound(_0x3c3b60,null))['then'](function(_0x496670){_0x5f0efa[_0x1bf7('0x74')]=_0x496670;_0x5f0efa['applications']=_[_0x1bf7('0x75')](_0x496670['Applications'],[_0x1bf7('0x76')],[_0x1bf7('0x77')]);if(_0x5f0efa['account'][_0x1bf7('0x73')]){delete _0x5f0efa['account'][_0x1bf7('0x73')];}return db[_0x1bf7('0x78')]['describe']();})[_0x1bf7('0x1e')](function(_0xc88b77){if(!_0xc88b77){throw new db[(_0x1bf7('0x79'))][(_0x1bf7('0x7a'))]('no\x20available\x20attributes');}_0x25c8eb=_[_0x1bf7('0x7b')](_[_0x1bf7('0x42')](_0xc88b77),['createdAt',_0x1bf7('0x7c')]);_0x33aab9=_[_0x1bf7('0x7b')](_[_0x1bf7('0x42')](_0xc88b77),[_0x1bf7('0x7d'),_0x1bf7('0x7c'),_0x1bf7('0x7e'),'ListId']);_0x5f0efa[_0x1bf7('0x5d')]={'mapKey':'mobile'};if(_0x5f0efa[_0x1bf7('0x74')][_0x1bf7('0x51')]){switch(_0x5f0efa[_0x1bf7('0x74')][_0x1bf7('0x51')]){case _0x1bf7('0x7f'):_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x80')]=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x81')];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')]=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x82')];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x83')]=_0x246e66['body'][_0x1bf7('0x84')];break;case _0x1bf7('0x85'):_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x80')]='+'+_0x246e66['body'][_0x1bf7('0x86')];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')]=_0x246e66['body']['text'];break;case _0x1bf7('0x87'):_0x5f0efa['body']['from']=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x80')];_0x5f0efa[_0x1bf7('0x5d')]['body']=_0x246e66[_0x1bf7('0x5d')]['message'];break;case _0x1bf7('0x88'):_0x5f0efa[_0x1bf7('0x5d')]['from']=_0x246e66[_0x1bf7('0x5d')]['from'];_0x5f0efa['body'][_0x1bf7('0x5d')]=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x5d')];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x83')]=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x89')];break;case _0x1bf7('0x8a'):_0x5f0efa[_0x1bf7('0x5d')]['from']=_0x246e66['body'][_0x1bf7('0x81')];_0x5f0efa[_0x1bf7('0x5d')]['body']=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x8b')];_0x5f0efa['body'][_0x1bf7('0x83')]=_0x246e66['body'][_0x1bf7('0x8c')];break;case'infobip':_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x80')]='+'+_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x8d')][0x0][_0x1bf7('0x80')];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')]=_0x246e66['body'][_0x1bf7('0x8d')][0x0]['text'];_0x5f0efa[_0x1bf7('0x5d')]['messageId']=_0x246e66[_0x1bf7('0x5d')]['results'][0x0][_0x1bf7('0x83')];break;case _0x1bf7('0x8e'):_0x5f0efa[_0x1bf7('0x5d')]['from']=_0x246e66[_0x1bf7('0x5d')]['originatingAddress'];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')]=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x8f')][_0x1bf7('0x27')];break;case'clickatell':_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x80')]=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x90')];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')]=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x91')];_0x5f0efa[_0x1bf7('0x5d')]['messageId']=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x92')];break;case _0x1bf7('0x93'):_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x83')]=_0x246e66[_0x1bf7('0x5d')][0x0][_0x1bf7('0x27')]['id'];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x80')]=_0x246e66[_0x1bf7('0x5d')][0x0][_0x1bf7('0x27')][_0x1bf7('0x80')];_0x5f0efa[_0x1bf7('0x5d')]['body']=_0x246e66[_0x1bf7('0x5d')][0x0]['message']['text'];break;case'intelepeer':_0x5f0efa[_0x1bf7('0x5d')]['from']=_0x246e66['body'][_0x1bf7('0x80')];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')]=_0x246e66[_0x1bf7('0x5d')][_0x1bf7('0x27')];_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x83')]=_0x246e66[_0x1bf7('0x5d')]['refid'];break;}}if(_0x5f0efa[_0x1bf7('0x5d')]['id']){delete _0x5f0efa[_0x1bf7('0x5d')]['id'];}if(_[_0x1bf7('0x94')](_0x5f0efa['body'][_0x1bf7('0x80')])){throw new db[(_0x1bf7('0x79'))][(_0x1bf7('0x7a'))]('from\x20is\x20mandatory');}if(_[_0x1bf7('0x94')](_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')])||_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')]===''){throw new db[(_0x1bf7('0x79'))][(_0x1bf7('0x7a'))](_0x1bf7('0x95'));}if(_[_0x1bf7('0x94')](_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x96')])){throw new db[(_0x1bf7('0x79'))][(_0x1bf7('0x7a'))](_0x1bf7('0x97')+_0x33aab9);}if(!_[_0x1bf7('0x98')](_0x33aab9,_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x96')])){throw new db[(_0x1bf7('0x79'))][(_0x1bf7('0x7a'))](_0x1bf7('0x99')+_0x33aab9);}_0x5e540d[_0x5f0efa['body'][_0x1bf7('0x96')]]=_0x5f0efa[_0x1bf7('0x5d')]['from'];return db[_0x1bf7('0x9a')][_0x1bf7('0x5b')]({'where':{'id':_0x5f0efa[_0x1bf7('0x74')][_0x1bf7('0x9b')]},'include':[{'model':db[_0x1bf7('0x78')],'as':_0x1bf7('0x9c'),'where':_0x5e540d,'limit':0x1,'order':[[_0x1bf7('0x7c'),_0x1bf7('0x9d')]]}]});})[_0x1bf7('0x1e')](handleEntityNotFound(_0x3c3b60,null))[_0x1bf7('0x1e')](function(_0x4666f3){if(_0x4666f3){_0x5f0efa[_0x1bf7('0x9e')]=_['omit'](_0x4666f3,[_0x1bf7('0x9c')]);if(_0x4666f3['Contacts']['length']){return _0x4666f3[_0x1bf7('0x9c')][0x0];}var _0x422bf0=_[_0x1bf7('0x18')](_0x5f0efa['body'],{'firstName':_0x5f0efa[_0x1bf7('0x5d')]['from'],'ListId':_0x4666f3['id']});_0x422bf0[_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x96')]]=_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x80')];return db[_0x1bf7('0x78')][_0x1bf7('0x5c')](_0x422bf0,{'fields':_0x25c8eb,'raw':!![]});}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x3c3b60,null))[_0x1bf7('0x1e')](function(_0x57fb24){if(_0x57fb24){_0x5f0efa[_0x1bf7('0x9f')]=_0x57fb24;var _0x13107b={'ContactId':_0x57fb24['id'],'phone':_0x5f0efa[_0x1bf7('0x5d')]['from'],'SmsAccountId':_0x246e66[_0x1bf7('0x57')]['id']};var _0x4b727b={'ContactId':_0x57fb24['id'],'SmsAccountId':_0x246e66['params']['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x4b727b})['then'](function(_0x3ad8d3){if(_0x3ad8d3){return[_0x3ad8d3,![]];}return db[_0x1bf7('0xa0')][_0x1bf7('0x5c')](_0x13107b)[_0x1bf7('0x1e')](function(_0x51f1cc){return[_0x51f1cc,!![]];});});}})[_0x1bf7('0xa1')](function(_0x2ec90a,_0x350c3a){_0x5f0efa[_0x1bf7('0xa2')]=_0x2ec90a['get']({'plain':!![]});_0x5f0efa['interaction']['created']=![];if(_0x350c3a){if(_0x5f0efa[_0x1bf7('0x74')]['autoclose']){_0x5f0efa['applications']['push']({'id':0x0,'priority':_0x5f0efa[_0x1bf7('0xa3')]['length']+0x1,'app':_0x1bf7('0xa4'),'appdata':'unmanaged','interval':_0x1bf7('0xa5')});}_0x5f0efa['interaction'][_0x1bf7('0xa6')]=!![];}return db['SmsMessage'][_0x1bf7('0x5c')]({'phone':_0x5f0efa[_0x1bf7('0x5d')]['from'],'messageId':_0x5f0efa['body'][_0x1bf7('0x83')],'body':_0x5f0efa[_0x1bf7('0x5d')][_0x1bf7('0x5d')],'SmsAccountId':_0x246e66[_0x1bf7('0x57')]['id'],'SmsInteractionId':_0x2ec90a['id'],'direction':'in','ContactId':_0x2ec90a['ContactId'],'AttachmentId':_0x5f0efa['body']['AttachmentId']});})[_0x1bf7('0x1e')](function(_0x4439c4){_0x5f0efa[_0x1bf7('0x27')]=_0x4439c4;if(_0x5f0efa['interaction'][_0x1bf7('0xa7')]){return db['User']['find']({'attributes':['id',_0x1bf7('0x3b')],'where':{'id':_0x5f0efa[_0x1bf7('0xa2')]['UserId']}})['then'](function(_0xb5fa7f){if(_0xb5fa7f){_0x5f0efa[_0x1bf7('0xa3')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xb5fa7f['name']+','+(_0x5f0efa[_0x1bf7('0x74')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1bf7('0xa8'),_0x1bf7('0xa9'),_0x5f0efa);});}return respondWithRpcPromise(_0x1bf7('0xa8'),_0x1bf7('0xa9'),_0x5f0efa);})[_0x1bf7('0x1e')](function(_0xc090a0){if(_0xc090a0){var _0x28542f=0xc8;var _0x303859=_0x1bf7('0xaa');logger['info'](_0x1bf7('0x23'),_0x303859,_0x28542f,'entity\x20found');logger[_0x1bf7('0x22')](_0x1bf7('0xab'),_0x303859,_0x28542f,_0x1bf7('0xac'),JSON[_0x1bf7('0x24')](_0xc090a0));if(_0x5f0efa[_0x1bf7('0x74')][_0x1bf7('0x51')]==='twilio'){return _0x3c3b60[_0x1bf7('0x2b')](_0x28542f)[_0x1bf7('0xad')](_0x1bf7('0xae'),_0x1bf7('0xaf'))[_0x1bf7('0x3c')](_0x1bf7('0xb0'));}else{return _0x3c3b60['status'](_0x28542f)[_0x1bf7('0x2c')](_0xc090a0);}}})[_0x1bf7('0x29')](handleError(_0x3c3b60,null));};exports['addApplications']=function(_0x3ff859,_0x274d55){var _0x2e402b=_0x3ff859[_0x1bf7('0x57')]['id'];var _0xed1416=_0x3ff859[_0x1bf7('0x5d')];var _0x4b62a3=0xc8;var _0x5ed99b=null;return db['sequelize'][_0x1bf7('0xb1')]({'isolationLevel':db[_0x1bf7('0xb2')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x37958c){return db[_0x1bf7('0x3e')][_0x1bf7('0x69')]({'where':{'id':_0x2e402b},'transaction':_0x37958c})['then'](function(_0x144b21){if(_0x144b21){return db['SmsApplication'][_0x1bf7('0x36')]({'where':{'SmsAccountId':_0x2e402b},'transaction':_0x37958c})[_0x1bf7('0x1e')](function(){var _0x117b4b=_[_0x1bf7('0x50')](_0xed1416,function(_0x15110c){_0x15110c[_0x1bf7('0x67')]=_0x2e402b;return _0x15110c;});return db[_0x1bf7('0xb3')]['bulkCreate'](_0x117b4b,{'transaction':_0x37958c});});}else{_0x4b62a3=0x194;_0x5ed99b=[];}});})[_0x1bf7('0x1e')](function(){if(_0x4b62a3!==0x194){return db['SmsApplication'][_0x1bf7('0xb4')]({'where':{'SmsAccountId':_0x2e402b},'order':_0x1bf7('0x76')})[_0x1bf7('0x1e')](function(_0x2b4169){_0x5ed99b=_0x2b4169;});}})[_0x1bf7('0x29')](function(_0x9cfb2c){_0x4b62a3=0x1f4;logger[_0x1bf7('0x25')](_0x9cfb2c['stack']);if(_0x9cfb2c['name']){delete _0x9cfb2c[_0x1bf7('0x3b')];}_0x5ed99b=_0x9cfb2c;})['finally'](function(){if(_0x5ed99b===null){_0x274d55[_0x1bf7('0x2a')](_0x4b62a3);}else{if(_0x4b62a3===0x1f4){_0x274d55[_0x1bf7('0x2b')](_0x4b62a3)[_0x1bf7('0x3c')](_0x5ed99b);}else{_0x274d55['status'](_0x4b62a3)[_0x1bf7('0x2c')](_0x5ed99b);}}});};exports[_0x1bf7('0xb5')]=function(_0xd004d0,_0x47b75b,_0x1ea3eb){var _0x234f7c={};var _0x5d9f39={};var _0x1bbf92;var _0x389ae8;return db[_0x1bf7('0x3e')]['findOne']({'where':{'id':_0xd004d0[_0x1bf7('0x57')]['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x47b75b,null))['then'](function(_0x469cbf){if(_0x469cbf){_0x1bbf92=_0x469cbf;_0x5d9f39[_0x1bf7('0x44')]=_[_0x1bf7('0x42')](db[_0x1bf7('0xb3')][_0x1bf7('0x59')]);_0x5d9f39[_0x1bf7('0x41')]=_[_0x1bf7('0x42')](_0xd004d0[_0x1bf7('0x41')]);_0x5d9f39[_0x1bf7('0x43')]=_['intersection'](_0x5d9f39[_0x1bf7('0x44')],_0x5d9f39['query']);_0x234f7c['attributes']=_[_0x1bf7('0x45')](_0x5d9f39[_0x1bf7('0x44')],qs[_0x1bf7('0x46')](_0xd004d0[_0x1bf7('0x41')][_0x1bf7('0x46')]));_0x234f7c[_0x1bf7('0x47')]=_0x234f7c['attributes']['length']?_0x234f7c[_0x1bf7('0x47')]:_0x5d9f39['model'];_0x234f7c[_0x1bf7('0x4b')]=qs['sort'](_0xd004d0[_0x1bf7('0x41')][_0x1bf7('0x4c')]);_0x234f7c[_0x1bf7('0x4d')]=qs[_0x1bf7('0x43')](_[_0x1bf7('0x4e')](_0xd004d0[_0x1bf7('0x41')],_0x5d9f39[_0x1bf7('0x43')]));if(_0xd004d0[_0x1bf7('0x41')]['filter']){_0x234f7c[_0x1bf7('0x4d')]=_[_0x1bf7('0x5a')](_0x234f7c[_0x1bf7('0x4d')],{'$or':_['map'](_0x234f7c[_0x1bf7('0x47')],function(_0x152102){var _0x59c94b={};_0x59c94b[_0x152102]={'$like':'%'+_0xd004d0['query'][_0x1bf7('0x4f')]+'%'};return _0x59c94b;})});}_0x234f7c=_['merge']({},_0x234f7c,_0xd004d0[_0x1bf7('0x6b')]);return _0x1bbf92[_0x1bf7('0xb5')](_0x234f7c);}})[_0x1bf7('0x1e')](function(_0xb1ac88){if(_0xb1ac88){_0x389ae8=_0xb1ac88[_0x1bf7('0x48')];if(!_0xd004d0[_0x1bf7('0x41')][_0x1bf7('0x49')](_0x1bf7('0x4a'))){_0x234f7c[_0x1bf7('0x30')]=qs[_0x1bf7('0x30')](_0xd004d0['query']['limit']);_0x234f7c[_0x1bf7('0x2d')]=qs[_0x1bf7('0x2d')](_0xd004d0[_0x1bf7('0x41')]['offset']);}return _0x1bbf92[_0x1bf7('0xb5')](_0x234f7c);}})[_0x1bf7('0x1e')](function(_0x303749){if(_0x303749){return _0x303749?{'count':_0x389ae8,'rows':_0x303749}:null;}})['then'](respondWithResult(_0x47b75b,null))['catch'](handleError(_0x47b75b,null));};exports[_0x1bf7('0xb6')]=function(_0x1cd0f3,_0x4aa912,_0x4acc68){var _0x36472c={'raw':![],'where':{}};var _0x378e6b={};var _0x4f9e4e={'count':0x0,'rows':[]};return db[_0x1bf7('0x3e')][_0x1bf7('0x69')]({'where':{'id':_0x1cd0f3[_0x1bf7('0x57')]['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x4aa912,null))[_0x1bf7('0x1e')](function(_0x4baa2f){if(_0x4baa2f){_0x378e6b[_0x1bf7('0x44')]=_[_0x1bf7('0x42')](db[_0x1bf7('0xa0')][_0x1bf7('0x59')]);_0x378e6b[_0x1bf7('0x41')]=_['keys'](_0x1cd0f3[_0x1bf7('0x41')]);_0x378e6b['filters']=_[_0x1bf7('0x45')](_0x378e6b[_0x1bf7('0x44')],_0x378e6b[_0x1bf7('0x41')]);_0x36472c['attributes']=_[_0x1bf7('0x45')](_0x378e6b['model'],qs[_0x1bf7('0x46')](_0x1cd0f3[_0x1bf7('0x41')]['fields']));_0x36472c[_0x1bf7('0x47')]=_0x36472c[_0x1bf7('0x47')][_0x1bf7('0x48')]?_0x36472c[_0x1bf7('0x47')]:_0x378e6b[_0x1bf7('0x44')];if(!_0x1cd0f3[_0x1bf7('0x41')][_0x1bf7('0x49')](_0x1bf7('0x4a'))){_0x36472c['limit']=qs[_0x1bf7('0x30')](_0x1cd0f3['query']['limit']);_0x36472c[_0x1bf7('0x2d')]=qs[_0x1bf7('0x2d')](_0x1cd0f3['query'][_0x1bf7('0x2d')]);}_0x36472c[_0x1bf7('0x4b')]=qs['sort'](_0x1cd0f3[_0x1bf7('0x41')][_0x1bf7('0x4c')]);_0x36472c[_0x1bf7('0x4d')]=qs[_0x1bf7('0x43')](_['pick'](_0x1cd0f3[_0x1bf7('0x41')],_0x378e6b[_0x1bf7('0x43')]));_0x36472c['where'][_0x1bf7('0x67')]=_0x4baa2f['id'];if(_0x1cd0f3['query'][_0x1bf7('0x4f')]){_0x36472c[_0x1bf7('0x4d')]=_[_0x1bf7('0x5a')](_0x36472c[_0x1bf7('0x4d')],{'$or':_[_0x1bf7('0x50')](_0x36472c[_0x1bf7('0x47')],function(_0x5508bd){var _0x6a0b6b={};_0x6a0b6b[_0x5508bd]={'$like':'%'+_0x1cd0f3[_0x1bf7('0x41')]['filter']+'%'};return _0x6a0b6b;})});}_0x36472c=_['merge']({},_0x36472c,_0x1cd0f3[_0x1bf7('0x6b')]);return db[_0x1bf7('0xa0')][_0x1bf7('0x2f')]({'where':_0x36472c[_0x1bf7('0x4d')]})[_0x1bf7('0x1e')](function(_0x59bd67){_0x4f9e4e[_0x1bf7('0x2f')]=_0x59bd67;if(_0x1cd0f3[_0x1bf7('0x41')][_0x1bf7('0x53')]){_0x36472c[_0x1bf7('0x54')]=[{'model':db['CmContact'],'as':_0x1bf7('0xb7'),'required':![]},{'model':db[_0x1bf7('0xb8')],'as':'Owner','attributes':[_0x1bf7('0x3b'),'fullname',_0x1bf7('0xb9')],'required':![]},{'model':db[_0x1bf7('0xba')],'as':_0x1bf7('0xbb'),'attributes':['id',_0x1bf7('0x3b'),'color'],'where':_0x1cd0f3[_0x1bf7('0x41')][_0x1bf7('0xbc')]?{'id':_0x1cd0f3[_0x1bf7('0x41')][_0x1bf7('0xbc')]}:undefined,'required':_0x1cd0f3[_0x1bf7('0x41')][_0x1bf7('0xbc')]?!![]:![]}];}return db[_0x1bf7('0xa0')][_0x1bf7('0x55')](_0x36472c);})[_0x1bf7('0x1e')](function(_0x4e84e4){_0x4f9e4e[_0x1bf7('0x56')]=_0x4e84e4;return _0x4f9e4e;});}})[_0x1bf7('0x1e')](respondWithFilteredResult(_0x4aa912,_0x36472c))[_0x1bf7('0x29')](handleError(_0x4aa912,null));};exports[_0x1bf7('0x3c')]=function(_0x3ae72f,_0x43d000,_0x520840){var _0x211e0a,_0x53f319,_0x485e78;if(_['isNil'](_0x3ae72f[_0x1bf7('0x5d')][_0x1bf7('0x5d')])||_0x3ae72f[_0x1bf7('0x5d')][_0x1bf7('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1bf7('0x94')](_0x3ae72f[_0x1bf7('0x5d')]['to'])){throw new db[(_0x1bf7('0x79'))][(_0x1bf7('0x7a'))](_0x1bf7('0xbd'));}_0x211e0a=_0x3ae72f['body']['to'];return db[_0x1bf7('0x3e')][_0x1bf7('0x5b')]({'where':{'id':_0x3ae72f['params']['id']},'include':[{'model':db[_0x1bf7('0x9a')],'as':'List','include':[{'model':db[_0x1bf7('0x78')],'as':'Contacts','where':{'mobile':_0x211e0a},'limit':0x1,'order':[[_0x1bf7('0x7c'),_0x1bf7('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x43d000,null))[_0x1bf7('0x1e')](function(_0xb73d90){if(_0xb73d90&&_0xb73d90['List']){_0x53f319=_0xb73d90[_0x1bf7('0x37')]({'plain':!![]});if(_0x53f319[_0x1bf7('0xbe')]&&_0x53f319['List']['Contacts'][_0x1bf7('0x48')]){return _0x53f319[_0x1bf7('0xbe')][_0x1bf7('0x9c')][0x0];}return db[_0x1bf7('0x78')][_0x1bf7('0x5c')](_[_0x1bf7('0x18')](_0x3ae72f[_0x1bf7('0x5d')],{'firstName':_0x211e0a,'mobile':_0x211e0a,'phone':_0x211e0a,'ListId':_0x53f319[_0x1bf7('0x9b')]}));}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x43d000,null))['then'](function(_0xa99720){if(_0xa99720){_0x485e78=_0xa99720;return db[_0x1bf7('0xa0')][_0x1bf7('0x5b')]({'where':{'ContactId':_0x485e78['id'],'closed':![],'SmsAccountId':_0x53f319['id']}})[_0x1bf7('0x1e')](function(_0x213112){if(_0x213112){return[_0x213112,![]];}return db[_0x1bf7('0xa0')][_0x1bf7('0x5c')]({'UserId':_0x3ae72f[_0x1bf7('0x60')]['id'],'ContactId':_0x485e78['id'],'SmsAccountId':_0x53f319['id'],'phone':_0x211e0a,'firstMsgDirection':_0x1bf7('0xbf'),'Messages':[_[_0x1bf7('0x5a')](_0x3ae72f[_0x1bf7('0x5d')],{'read':![],'body':_0x3ae72f[_0x1bf7('0x5d')][_0x1bf7('0x5d')],'phone':_0x211e0a,'SmsAccountId':_0x53f319['id'],'UserId':_0x3ae72f['user']['id'],'ContactId':_0x485e78['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x1bf7('0xc0')}]})[_0x1bf7('0x1e')](function(_0x3697d7){return[_0x3697d7,!![]];});});}})[_0x1bf7('0xa1')](function(_0x5671a3,_0x55403f){if(_0x55403f){return _0x5671a3;}return db[_0x1bf7('0xc1')]['create'](_[_0x1bf7('0x5a')](_0x3ae72f['body'],{'read':![],'body':_0x3ae72f[_0x1bf7('0x5d')][_0x1bf7('0x5d')],'phone':_0x211e0a,'SmsAccountId':_0x53f319['id'],'SmsInteractionId':_0x5671a3['id'],'UserId':_0x3ae72f[_0x1bf7('0x60')]['id'],'ContactId':_0x485e78['id']}))[_0x1bf7('0x1e')](function(_0x39e253){_0x5671a3[_0x1bf7('0xc2')][_0x1bf7('0xc0')]=[];_0x5671a3[_0x1bf7('0xc2')][_0x1bf7('0xc0')][_0x1bf7('0xc3')](_0x39e253[_0x1bf7('0xc2')]);return _0x5671a3;});})['then'](respondWithResult(_0x43d000,null))['catch'](handleError(_0x43d000,null));};exports[_0x1bf7('0x2b')]=function(_0x63f5fd,_0x5cd7ac,_0x3b74b7){if(_0x63f5fd[_0x1bf7('0x5d')]['id']){delete _0x63f5fd[_0x1bf7('0x5d')]['id'];}var _0x26797a,_0x1cd779,_0x124cbc;return db[_0x1bf7('0x3e')][_0x1bf7('0x5b')]({'where':{'id':_0x63f5fd['params']['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x5cd7ac,null))[_0x1bf7('0x1e')](function(_0x402482){if(_0x402482){_0x124cbc=_0x402482;logger[_0x1bf7('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1bf7('0x2b'),_0x1bf7('0xc4'),_0x402482[_0x1bf7('0x51')],util[_0x1bf7('0xc5')](_0x63f5fd[_0x1bf7('0x5d')],{'showHidden':![],'depth':null}));switch(_0x402482[_0x1bf7('0x51')]){case _0x1bf7('0x85'):if(_0x63f5fd['body'][_0x1bf7('0xc6')]&&_0x63f5fd['body'][_0x1bf7('0x2b')]){_0x1cd779=_0x63f5fd['body'][_0x1bf7('0x2b')];return db[_0x1bf7('0xc1')][_0x1bf7('0x5b')]({'where':{'messageId':_0x63f5fd[_0x1bf7('0x5d')]['skebby_dispatch_id']}});}break;case _0x1bf7('0x87'):if(_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0xc7')]&&_0x63f5fd['body'][_0x1bf7('0xc8')]){_0x1cd779=_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0xc8')];return db[_0x1bf7('0xc1')][_0x1bf7('0x5b')]({'where':{'messageId':_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0xc7')]}});}break;case _0x1bf7('0x88'):if(_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0x89')]&&_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0xc9')]){_0x1cd779=_0x63f5fd['body'][_0x1bf7('0xc9')];return db['SmsMessage'][_0x1bf7('0x5b')]({'where':{'messageId':_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0x89')]}});}break;case _0x1bf7('0xca'):var _0x273054=_0x63f5fd['body'][_0x1bf7('0x8d')][0x0];if(_0x273054[_0x1bf7('0x83')]&&_0x273054['status']['groupName']===_0x1bf7('0xcb')){_0x1cd779=_0x273054['status'][_0x1bf7('0xcc')];return db[_0x1bf7('0xc1')][_0x1bf7('0x5b')]({'where':{'messageId':_0x273054[_0x1bf7('0x83')]}});}break;case'clickatell':if(_0x63f5fd['body'][_0x1bf7('0x83')]&&_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0x2b')]){_0x1cd779=_0x63f5fd['body']['status'];return db[_0x1bf7('0xc1')][_0x1bf7('0x5b')]({'where':{'messageId':_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0x83')]}});}break;case _0x1bf7('0x93'):if(_0x63f5fd[_0x1bf7('0x5d')][0x0][_0x1bf7('0x27')]['id']){_0x1cd779=_0x63f5fd['body'][0x0][_0x1bf7('0x51')];return db[_0x1bf7('0xc1')][_0x1bf7('0x5b')]({'where':{'messageId':_0x63f5fd[_0x1bf7('0x5d')][0x0][_0x1bf7('0x27')]['id']}});}break;case _0x1bf7('0xcd'):if(_0x63f5fd[_0x1bf7('0x5d')]['redif']&&_0x63f5fd['body'][_0x1bf7('0x2b')]){_0x1cd779=_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0x2b')];return db[_0x1bf7('0xc1')][_0x1bf7('0x5b')]({'where':{'messageId':_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0xce')]}});}break;}}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x5cd7ac,null))['then'](function(_0x33fe10){if(_0x33fe10){_0x26797a=_0x33fe10;switch(_0x124cbc[_0x1bf7('0x51')]){case _0x1bf7('0x85'):if(_0x1cd779==='DELIVERED'){return _0x26797a[_0x1bf7('0x35')]({'read':!![]});}else{logger[_0x1bf7('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1bf7('0x2b'),_0x1bf7('0x85'),util[_0x1bf7('0xc5')](_0x63f5fd['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x1cd779==='1'){return _0x26797a[_0x1bf7('0x35')]({'read':!![]});}else{logger[_0x1bf7('0x25')](_0x1bf7('0x23'),_0x1bf7('0x2b'),_0x1bf7('0x85'),util[_0x1bf7('0xc5')](_0x63f5fd['body'],{'showHidden':![],'depth':null}));}break;case _0x1bf7('0x88'):if(!_0x63f5fd['body'][_0x1bf7('0xcf')]&&_0x1cd779>=0xc8&&_0x1cd779<=0xce){return _0x26797a[_0x1bf7('0x35')]({'read':!![]});}else{logger['error'](_0x1bf7('0x23'),_0x1bf7('0x2b'),_0x1bf7('0x88'),util['inspect'](_0x63f5fd[_0x1bf7('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1bf7('0xca'):var _0x273e83=_0x63f5fd[_0x1bf7('0x5d')][_0x1bf7('0x8d')][0x0];if(_0x273e83['status'][_0x1bf7('0xcc')]===_0x1bf7('0xcb')){return _0x26797a[_0x1bf7('0x35')]({'read':!![]});}else{logger[_0x1bf7('0x25')](_0x1bf7('0x23'),_0x1bf7('0x2b'),_0x1bf7('0xca'),util[_0x1bf7('0xc5')](_0x63f5fd[_0x1bf7('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1bf7('0xd0'):if(_0x1cd779==_0x1bf7('0xd1')||_0x1cd779==_0x1bf7('0xd2')){return _0x26797a['update']({'read':!![]});}else{logger[_0x1bf7('0x25')](_0x1bf7('0x23'),'status',_0x1bf7('0xd0'),util[_0x1bf7('0xc5')](_0x63f5fd[_0x1bf7('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1bf7('0x93'):if(_0x1cd779==_0x1bf7('0xd3')){return _0x26797a['update']({'read':!![]});}else{logger[_0x1bf7('0x25')](_0x1bf7('0x23'),'status','bandwidth',util[_0x1bf7('0xc5')](_0x63f5fd[_0x1bf7('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1bf7('0xcd'):if(_0x1cd779===_0x1bf7('0xd4')||_0x1cd779===_0x1bf7('0xd5')){return _0x26797a[_0x1bf7('0x35')]({'read':!![]});}else{logger[_0x1bf7('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1bf7('0x2b'),_0x1bf7('0xcd'),util[_0x1bf7('0xc5')](_0x63f5fd[_0x1bf7('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x26797a;}})[_0x1bf7('0x1e')](respondWithResult(_0x5cd7ac,null))[_0x1bf7('0x29')](handleError(_0x5cd7ac,null));};exports['statusGet']=function(_0x306e9f,_0x3ea002,_0x2dd623){var _0x2562af,_0x57c06b,_0x1e9d5e;return db[_0x1bf7('0x3e')][_0x1bf7('0x5b')]({'where':{'id':_0x306e9f[_0x1bf7('0x57')]['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x3ea002,null))[_0x1bf7('0x1e')](function(_0x525488){if(_0x525488){_0x1e9d5e=_0x525488;logger['debug'](_0x1bf7('0x23'),_0x1bf7('0x2b'),_0x1bf7('0xc4'),_0x525488[_0x1bf7('0x51')],util[_0x1bf7('0xc5')](_0x306e9f[_0x1bf7('0x41')],{'showHidden':![],'depth':null}));switch(_0x525488[_0x1bf7('0x51')]){case _0x1bf7('0x8e'):if(_0x306e9f[_0x1bf7('0x41')][_0x1bf7('0xd6')]&&_0x306e9f[_0x1bf7('0x41')][_0x1bf7('0xd7')]){_0x57c06b=_0x306e9f['query'][_0x1bf7('0xd7')];return db[_0x1bf7('0xc1')]['find']({'where':{'messageId':_0x306e9f[_0x1bf7('0x41')][_0x1bf7('0xd6')]}});}break;}}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x3ea002,null))[_0x1bf7('0x1e')](function(_0x4c29d8){if(_0x4c29d8){_0x2562af=_0x4c29d8;switch(_0x1e9d5e['type']){case _0x1bf7('0x8e'):if(_0x57c06b==='2'||_0x57c06b==='6'){return _0x2562af[_0x1bf7('0x35')]({'read':!![]});}else{logger['error'](_0x1bf7('0x23'),_0x1bf7('0x2b'),_0x1bf7('0x8e'),util[_0x1bf7('0xc5')](_0x306e9f[_0x1bf7('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x2562af;}})[_0x1bf7('0x1e')](respondWithResult(_0x3ea002,null))[_0x1bf7('0x29')](handleError(_0x3ea002,null));};exports[_0x1bf7('0xd8')]=function(_0x501bb7,_0x445ac5,_0x598c0a){return db[_0x1bf7('0x3e')][_0x1bf7('0x5b')]({'where':{'id':_0x501bb7[_0x1bf7('0x57')]['id']}})[_0x1bf7('0x1e')](handleEntityNotFound(_0x445ac5,null))['then'](function(_0x135aa0){if(_0x135aa0){return _0x135aa0['addAgents'](_0x501bb7[_0x1bf7('0x5d')]['ids'],_['omit'](_0x501bb7[_0x1bf7('0x5d')],[_0x1bf7('0x6d'),'id'])||{})[_0x1bf7('0xa1')](function(_0x1ff006){for(var _0x4b69b7=0x0;_0x4b69b7<_0x501bb7['body']['ids'][_0x1bf7('0x48')];_0x4b69b7+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x501bb7['body'][_0x1bf7('0x6d')][_0x4b69b7]),'SmsAccountId':Number(_0x501bb7[_0x1bf7('0x57')]['id'])});}return _0x1ff006;});}})[_0x1bf7('0x1e')](respondWithResult(_0x445ac5,null))[_0x1bf7('0x29')](handleError(_0x445ac5,null));};exports[_0x1bf7('0xd9')]=function(_0x24a2d2,_0x2de742,_0x1c2d62){return db[_0x1bf7('0x3e')]['find']({'where':{'id':_0x24a2d2[_0x1bf7('0x57')]['id']}})['then'](handleEntityNotFound(_0x2de742,null))[_0x1bf7('0x1e')](function(_0x279339){if(_0x279339){return _0x279339[_0x1bf7('0xd9')](_0x24a2d2[_0x1bf7('0x41')]['ids'])[_0x1bf7('0x1e')](function(){if(_[_0x1bf7('0xda')](_0x24a2d2[_0x1bf7('0x41')][_0x1bf7('0x6d')])){for(var _0x3aaeb7=0x0;_0x3aaeb7<_0x24a2d2['query'][_0x1bf7('0x6d')][_0x1bf7('0x48')];_0x3aaeb7+=0x1){socket[_0x1bf7('0xdb')](_0x1bf7('0xdc'),{'UserId':Number(_0x24a2d2[_0x1bf7('0x41')]['ids'][_0x3aaeb7]),'SmsAccountId':Number(_0x24a2d2['params']['id'])});}}else{socket['emit'](_0x1bf7('0xdc'),{'UserId':Number(_0x24a2d2[_0x1bf7('0x41')][_0x1bf7('0x6d')]),'SmsAccountId':Number(_0x24a2d2[_0x1bf7('0x57')]['id'])});}});}})[_0x1bf7('0x1e')](respondWithStatusCode(_0x2de742,null))[_0x1bf7('0x29')](handleError(_0x2de742,null));};exports[_0x1bf7('0xdd')]=function(_0x526cd0,_0x325f66,_0x309378){var _0x23705d={};var _0x177f03={};var _0x445788;var _0x97012e;return db[_0x1bf7('0x3e')][_0x1bf7('0x69')]({'where':{'id':_0x526cd0[_0x1bf7('0x57')]['id']}})['then'](handleEntityNotFound(_0x325f66,null))[_0x1bf7('0x1e')](function(_0xfe3a45){if(_0xfe3a45){_0x445788=_0xfe3a45;_0x177f03[_0x1bf7('0x44')]=_[_0x1bf7('0x42')](db[_0x1bf7('0xb8')][_0x1bf7('0x59')]);_0x177f03['query']=_[_0x1bf7('0x42')](_0x526cd0[_0x1bf7('0x41')]);_0x177f03[_0x1bf7('0x43')]=_[_0x1bf7('0x45')](_0x177f03['model'],_0x177f03['query']);_0x23705d[_0x1bf7('0x47')]=_[_0x1bf7('0x45')](_0x177f03['model'],qs['fields'](_0x526cd0[_0x1bf7('0x41')][_0x1bf7('0x46')]));_0x23705d['attributes']=_0x23705d[_0x1bf7('0x47')]['length']?_0x23705d[_0x1bf7('0x47')]:_0x177f03[_0x1bf7('0x44')];_0x23705d[_0x1bf7('0x4b')]=qs[_0x1bf7('0x4c')](_0x526cd0[_0x1bf7('0x41')][_0x1bf7('0x4c')]);_0x23705d[_0x1bf7('0x4d')]=qs['filters'](_['pick'](_0x526cd0['query'],_0x177f03[_0x1bf7('0x43')]));if(_0x526cd0[_0x1bf7('0x41')][_0x1bf7('0x4f')]){_0x23705d[_0x1bf7('0x4d')]=_['merge'](_0x23705d['where'],{'$or':_[_0x1bf7('0x50')](_0x23705d[_0x1bf7('0x47')],function(_0x467b18){var _0x331012={};_0x331012[_0x467b18]={'$like':'%'+_0x526cd0[_0x1bf7('0x41')][_0x1bf7('0x4f')]+'%'};return _0x331012;})});}_0x23705d=_[_0x1bf7('0x5a')]({},_0x23705d,_0x526cd0['options']);return _0x445788[_0x1bf7('0xdd')](_0x23705d);}})['then'](function(_0x5f24cf){if(_0x5f24cf){_0x97012e=_0x5f24cf[_0x1bf7('0x48')];if(!_0x526cd0[_0x1bf7('0x41')][_0x1bf7('0x49')](_0x1bf7('0x4a'))){_0x23705d[_0x1bf7('0x30')]=qs[_0x1bf7('0x30')](_0x526cd0[_0x1bf7('0x41')][_0x1bf7('0x30')]);_0x23705d['offset']=qs[_0x1bf7('0x2d')](_0x526cd0[_0x1bf7('0x41')][_0x1bf7('0x2d')]);}return _0x445788[_0x1bf7('0xdd')](_0x23705d);}})['then'](function(_0x388eae){if(_0x388eae){return _0x388eae?{'count':_0x97012e,'rows':_0x388eae}:null;}})[_0x1bf7('0x1e')](respondWithResult(_0x325f66,null))[_0x1bf7('0x29')](handleError(_0x325f66,null));};
\ No newline at end of file
+var _0x9fb6=['tag','to\x20is\x20mandatory','List','DESC','out','Messages','SmsMessage','dataValues','debug','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','inspect','error_code','infobip','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','SmsAccount,\x20%s,\x20%s','message','error','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','keys','fields','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','orderBy','asc','Sequelize','ValidationError','createdAt','difference','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','list','omit','Contacts','defaults','contact','SmsInteraction','spread','interaction','autoclose','push','applications','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','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','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x9fb6,0x10f));var _0x69fb=function(_0x38c6eb,_0x5c6c82){_0x38c6eb=_0x38c6eb-0x0;var _0x292317=_0x9fb6[_0x38c6eb];return _0x292317;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69fb('0x0'));var zipdir=require(_0x69fb('0x1'));var jsonpatch=require(_0x69fb('0x2'));var rp=require('request-promise');var moment=require(_0x69fb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x69fb('0x4'));var util=require(_0x69fb('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x69fb('0x6'));var ejs=require(_0x69fb('0x7'));var fs=require('fs');var fs_extra=require(_0x69fb('0x8'));var _=require(_0x69fb('0x9'));var squel=require(_0x69fb('0xa'));var crypto=require(_0x69fb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x69fb('0xc'));var toCsv=require(_0x69fb('0x6'));var querystring=require(_0x69fb('0xd'));var Papa=require(_0x69fb('0xe'));var Redis=require(_0x69fb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x69fb('0x10'));var as=require(_0x69fb('0x11'));var hardwareService=require(_0x69fb('0x12'));var logger=require('../../config/logger')(_0x69fb('0x13'));var utils=require(_0x69fb('0x14'));var config=require(_0x69fb('0x15'));var licenseUtil=require(_0x69fb('0x16'));var db=require('../../mysqldb')['db'];config[_0x69fb('0x17')]=_['defaults'](config[_0x69fb('0x17')],{'host':_0x69fb('0x18'),'port':0x18eb});var socket=require(_0x69fb('0x19'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x69fb('0x1a'));var client=jayson[_0x69fb('0x1b')][_0x69fb('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x276d93,_0x7bbdfd,_0x4dd32c,_0x130b95){return new BPromise(function(_0x1b96c2,_0x2a3d70){var _0x3fc6b7=_0x130b95||client;return _0x3fc6b7[_0x69fb('0x1d')](_0x276d93,_0x4dd32c)[_0x69fb('0x1e')](function(_0x552648){logger[_0x69fb('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x7bbdfd,_0x69fb('0x20'));logger['debug'](_0x69fb('0x21'),_0x7bbdfd,'request\x20sent',JSON[_0x69fb('0x22')](_0x552648));if(_0x552648['error']){if(_0x552648['error']['code']===0x1f4){logger['error'](_0x69fb('0x23'),_0x7bbdfd,_0x552648['error'][_0x69fb('0x24')]);return _0x2a3d70(_0x552648[_0x69fb('0x25')][_0x69fb('0x24')]);}logger[_0x69fb('0x25')](_0x69fb('0x23'),_0x7bbdfd,_0x552648[_0x69fb('0x25')]['message']);return _0x1b96c2(_0x552648[_0x69fb('0x25')][_0x69fb('0x24')]);}else{logger[_0x69fb('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x7bbdfd,'request\x20sent');_0x1b96c2(_0x552648[_0x69fb('0x26')][_0x69fb('0x24')]);}})['catch'](function(_0x522703){logger[_0x69fb('0x25')](_0x69fb('0x23'),_0x7bbdfd,_0x522703);_0x2a3d70(_0x522703);});});}function respondWithStatusCode(_0x27c9de,_0x25a407){_0x25a407=_0x25a407||0xcc;return function(_0x46f282){if(_0x46f282){return _0x27c9de[_0x69fb('0x27')](_0x25a407);}return _0x27c9de['status'](_0x25a407)[_0x69fb('0x28')]();};}function respondWithResult(_0x57eb83,_0x508bb9){_0x508bb9=_0x508bb9||0xc8;return function(_0x39f9fb){if(_0x39f9fb){return _0x57eb83[_0x69fb('0x29')](_0x508bb9)[_0x69fb('0x2a')](_0x39f9fb);}};}function respondWithFilteredResult(_0x553c72,_0x344d79){return function(_0x1c83bf){if(_0x1c83bf){var _0x458f39=typeof _0x344d79[_0x69fb('0x2b')]===_0x69fb('0x2c')&&typeof _0x344d79[_0x69fb('0x2d')]===_0x69fb('0x2c');var _0x5eea04=_0x1c83bf['count'];var _0x473763=_0x458f39?0x0:_0x344d79[_0x69fb('0x2b')];var _0x3ac3f5=_0x458f39?_0x1c83bf[_0x69fb('0x2e')]:_0x344d79[_0x69fb('0x2b')]+_0x344d79[_0x69fb('0x2d')];var _0x5a3374;if(_0x3ac3f5>=_0x5eea04){_0x3ac3f5=_0x5eea04;_0x5a3374=0xc8;}else{_0x5a3374=0xce;}_0x553c72[_0x69fb('0x29')](_0x5a3374);return _0x553c72[_0x69fb('0x2f')](_0x69fb('0x30'),_0x473763+'-'+_0x3ac3f5+'/'+_0x5eea04)[_0x69fb('0x2a')](_0x1c83bf);}return null;};}function patchUpdates(_0x289d4d){return function(_0x1ef04){try{jsonpatch[_0x69fb('0x31')](_0x1ef04,_0x289d4d,!![]);}catch(_0x17971f){return BPromise[_0x69fb('0x32')](_0x17971f);}return _0x1ef04[_0x69fb('0x33')]();};}function saveUpdates(_0x3bf869,_0x394cd1){return function(_0x520d55){if(_0x520d55){return _0x520d55['update'](_0x3bf869)[_0x69fb('0x1e')](function(_0x18eb56){return _0x18eb56;});}return null;};}function removeEntity(_0x338b0c,_0x1e138f){return function(_0x16fc30){if(_0x16fc30){return _0x16fc30[_0x69fb('0x34')]()['then'](function(){var _0x3e2835=_0x16fc30[_0x69fb('0x35')]({'plain':!![]});var _0x4d5b31='SmsAccounts';return db[_0x69fb('0x36')]['destroy']({'where':{'type':_0x4d5b31,'resourceId':_0x3e2835['id']}})[_0x69fb('0x1e')](function(){return _0x16fc30;});})[_0x69fb('0x1e')](function(){_0x338b0c[_0x69fb('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3424,_0xa72440){return function(_0x360a34){if(!_0x360a34){_0x2a3424[_0x69fb('0x27')](0x194);}return _0x360a34;};}function handleError(_0x557660,_0x24f46c){_0x24f46c=_0x24f46c||0x1f4;return function(_0x599a09){logger[_0x69fb('0x25')](_0x599a09[_0x69fb('0x37')]);if(_0x599a09['name']){delete _0x599a09[_0x69fb('0x38')];}_0x557660['status'](_0x24f46c)[_0x69fb('0x39')](_0x599a09);};}exports[_0x69fb('0x3a')]=function(_0x567e2e,_0x4adbfc){var _0x29b5b5={'include':[{'model':db[_0x69fb('0x3b')],'as':_0x69fb('0x3c')}]},_0x279bd2={},_0x507ee6={'count':0x0,'rows':[]};var _0x539cd5=_[_0x69fb('0x3d')](db[_0x69fb('0x3e')][_0x69fb('0x3f')],function(_0x9b266a){return{'name':_0x9b266a['fieldName'],'type':_0x9b266a[_0x69fb('0x40')][_0x69fb('0x41')]};});_0x279bd2[_0x69fb('0x42')]=_['map'](_0x539cd5,_0x69fb('0x38'));_0x279bd2[_0x69fb('0x43')]=_['keys'](_0x567e2e[_0x69fb('0x43')]);_0x279bd2[_0x69fb('0x44')]=_[_0x69fb('0x45')](_0x279bd2[_0x69fb('0x42')],_0x279bd2['query']);_0x29b5b5[_0x69fb('0x46')]=_[_0x69fb('0x45')](_0x279bd2[_0x69fb('0x42')],qs['fields'](_0x567e2e[_0x69fb('0x43')]['fields']));_0x29b5b5[_0x69fb('0x46')]=_0x29b5b5[_0x69fb('0x46')][_0x69fb('0x47')]?_0x29b5b5['attributes']:_0x279bd2[_0x69fb('0x42')];if(!_0x567e2e['query'][_0x69fb('0x48')]('nolimit')){_0x29b5b5[_0x69fb('0x2d')]=qs['limit'](_0x567e2e[_0x69fb('0x43')]['limit']);_0x29b5b5[_0x69fb('0x2b')]=qs['offset'](_0x567e2e['query'][_0x69fb('0x2b')]);}_0x29b5b5[_0x69fb('0x49')]=qs[_0x69fb('0x4a')](_0x567e2e[_0x69fb('0x43')][_0x69fb('0x4a')]);_0x29b5b5['where']=qs[_0x69fb('0x44')](_[_0x69fb('0x4b')](_0x567e2e[_0x69fb('0x43')],_0x279bd2[_0x69fb('0x44')]),_0x539cd5);if(_0x567e2e['query']['filter']){_0x29b5b5[_0x69fb('0x4c')]=_[_0x69fb('0x4d')](_0x29b5b5[_0x69fb('0x4c')],{'$or':_[_0x69fb('0x3d')](_0x539cd5,function(_0x850d53){if(_0x850d53[_0x69fb('0x40')]!==_0x69fb('0x4e')){var _0x13d3fe={};_0x13d3fe[_0x850d53[_0x69fb('0x38')]]={'$like':'%'+_0x567e2e['query'][_0x69fb('0x4f')]+'%'};return _0x13d3fe;}})});}_0x29b5b5=_['merge']({},_0x29b5b5,_0x567e2e[_0x69fb('0x50')]);var _0x20c501={'where':_0x29b5b5[_0x69fb('0x4c')]};return db[_0x69fb('0x3e')][_0x69fb('0x2e')](_0x20c501)[_0x69fb('0x1e')](function(_0x4bf5ab){_0x507ee6['count']=_0x4bf5ab;if(_0x567e2e['query']['includeAll']){_0x29b5b5[_0x69fb('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0x69fb('0x52')](_0x29b5b5);})[_0x69fb('0x1e')](function(_0x194609){_0x507ee6[_0x69fb('0x53')]=_0x194609;return _0x507ee6;})[_0x69fb('0x1e')](respondWithFilteredResult(_0x4adbfc,_0x29b5b5))['catch'](handleError(_0x4adbfc,null));};exports[_0x69fb('0x54')]=function(_0x25f278,_0x4bb7b1){var _0xa69b36={'raw':![],'where':{'id':_0x25f278['params']['id']},'include':[{'model':db['Pause'],'as':_0x69fb('0x3c')}]},_0x26ae0f={};_0x26ae0f[_0x69fb('0x42')]=_[_0x69fb('0x55')](db['SmsAccount'][_0x69fb('0x3f')]);_0x26ae0f['query']=_[_0x69fb('0x55')](_0x25f278[_0x69fb('0x43')]);_0x26ae0f[_0x69fb('0x44')]=_[_0x69fb('0x45')](_0x26ae0f[_0x69fb('0x42')],_0x26ae0f[_0x69fb('0x43')]);_0xa69b36[_0x69fb('0x46')]=_[_0x69fb('0x45')](_0x26ae0f['model'],qs['fields'](_0x25f278['query'][_0x69fb('0x56')]));_0xa69b36[_0x69fb('0x46')]=_0xa69b36['attributes'][_0x69fb('0x47')]?_0xa69b36[_0x69fb('0x46')]:_0x26ae0f[_0x69fb('0x42')];if(_0x25f278[_0x69fb('0x43')][_0x69fb('0x57')]){_0xa69b36[_0x69fb('0x51')]=[{'all':!![]}];}_0xa69b36=_[_0x69fb('0x4d')]({},_0xa69b36,_0x25f278[_0x69fb('0x50')]);return db[_0x69fb('0x3e')][_0x69fb('0x58')](_0xa69b36)[_0x69fb('0x1e')](handleEntityNotFound(_0x4bb7b1,null))[_0x69fb('0x1e')](respondWithResult(_0x4bb7b1,null))[_0x69fb('0x59')](handleError(_0x4bb7b1,null));};exports[_0x69fb('0x5a')]=function(_0x1f098a,_0x4d1ad2){return db['SmsAccount'][_0x69fb('0x5a')](_0x1f098a[_0x69fb('0x5b')],{})[_0x69fb('0x1e')](function(_0x57e59a){var _0x1e5a9a=_0x1f098a[_0x69fb('0x5c')][_0x69fb('0x35')]({'plain':!![]});if(!_0x1e5a9a)throw new Error(_0x69fb('0x5d'));if(_0x1e5a9a['role']==='user'){var _0x5a154f=_0x57e59a[_0x69fb('0x35')]({'plain':!![]});var _0x2d5038=_0x69fb('0x5e');return db[_0x69fb('0x5f')][_0x69fb('0x58')]({'where':{'name':_0x2d5038,'userProfileId':_0x1e5a9a[_0x69fb('0x60')]},'raw':!![]})[_0x69fb('0x1e')](function(_0x3cedc1){if(_0x3cedc1&&_0x3cedc1[_0x69fb('0x61')]===0x0){return db[_0x69fb('0x36')][_0x69fb('0x5a')]({'name':_0x5a154f[_0x69fb('0x38')],'resourceId':_0x5a154f['id'],'type':_0x3cedc1[_0x69fb('0x38')],'sectionId':_0x3cedc1['id']},{})['then'](function(){return _0x57e59a;});}else{return _0x57e59a;}})[_0x69fb('0x59')](function(_0x531dd6){logger['error'](_0x69fb('0x62'),_0x531dd6);throw _0x531dd6;});}return _0x57e59a;})[_0x69fb('0x1e')](respondWithResult(_0x4d1ad2,0xc9))[_0x69fb('0x59')](handleError(_0x4d1ad2,null));};exports[_0x69fb('0x63')]=function(_0x240c51,_0x2ec3bc){if(_0x240c51[_0x69fb('0x5b')]['id']){delete _0x240c51[_0x69fb('0x5b')]['id'];}return db['SmsAccount'][_0x69fb('0x58')]({'where':{'id':_0x240c51[_0x69fb('0x64')]['id']},'include':[{'model':db[_0x69fb('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x69fb('0x1e')](handleEntityNotFound(_0x2ec3bc,null))[_0x69fb('0x1e')](saveUpdates(_0x240c51['body'],null))[_0x69fb('0x1e')](respondWithResult(_0x2ec3bc,null))[_0x69fb('0x59')](handleError(_0x2ec3bc,null));};exports[_0x69fb('0x34')]=function(_0x286966,_0x131726){return db[_0x69fb('0x3e')]['find']({'where':{'id':_0x286966[_0x69fb('0x64')]['id']}})['then'](handleEntityNotFound(_0x131726,null))[_0x69fb('0x1e')](removeEntity(_0x131726,null))['catch'](handleError(_0x131726,null));};exports[_0x69fb('0x65')]=function(_0x3ac938,_0x175d9f){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x175d9f,null))[_0x69fb('0x59')](handleError(_0x175d9f,null));};exports[_0x69fb('0x66')]=function(_0x28e978,_0x268b9a,_0xc3a611){if(_0x28e978['body']['id']){delete _0x28e978['body']['id'];}return db[_0x69fb('0x3e')][_0x69fb('0x58')]({'where':{'id':_0x28e978[_0x69fb('0x64')]['id']}})[_0x69fb('0x1e')](handleEntityNotFound(_0x268b9a,null))[_0x69fb('0x1e')](function(_0x14cb44){if(_0x14cb44){_0x28e978[_0x69fb('0x5b')][_0x69fb('0x67')]=_0x14cb44['id'];return db[_0x69fb('0x68')][_0x69fb('0x5a')](_0x28e978['body']);}})[_0x69fb('0x1e')](respondWithResult(_0x268b9a,null))[_0x69fb('0x59')](handleError(_0x268b9a,null));};exports[_0x69fb('0x69')]=function(_0x30ad67,_0x4ee664,_0x336b6f){var _0x19cd9c={'raw':![],'where':{}};var _0x5f3cf6={};var _0xe79a1c={'count':0x0,'rows':[]};return db['SmsAccount'][_0x69fb('0x6a')]({'where':{'id':_0x30ad67[_0x69fb('0x64')]['id']}})[_0x69fb('0x1e')](handleEntityNotFound(_0x4ee664,null))[_0x69fb('0x1e')](function(_0x11beea){if(_0x11beea){_0x5f3cf6[_0x69fb('0x42')]=_[_0x69fb('0x55')](db[_0x69fb('0x68')][_0x69fb('0x3f')]);_0x5f3cf6[_0x69fb('0x43')]=_[_0x69fb('0x55')](_0x30ad67[_0x69fb('0x43')]);_0x5f3cf6[_0x69fb('0x44')]=_[_0x69fb('0x45')](_0x5f3cf6['model'],_0x5f3cf6[_0x69fb('0x43')]);_0x19cd9c[_0x69fb('0x46')]=_[_0x69fb('0x45')](_0x5f3cf6[_0x69fb('0x42')],qs[_0x69fb('0x56')](_0x30ad67[_0x69fb('0x43')][_0x69fb('0x56')]));_0x19cd9c[_0x69fb('0x46')]=_0x19cd9c[_0x69fb('0x46')][_0x69fb('0x47')]?_0x19cd9c['attributes']:_0x5f3cf6[_0x69fb('0x42')];if(!_0x30ad67[_0x69fb('0x43')]['hasOwnProperty'](_0x69fb('0x6b'))){_0x19cd9c[_0x69fb('0x2d')]=qs[_0x69fb('0x2d')](_0x30ad67[_0x69fb('0x43')]['limit']);_0x19cd9c[_0x69fb('0x2b')]=qs[_0x69fb('0x2b')](_0x30ad67[_0x69fb('0x43')][_0x69fb('0x2b')]);}_0x19cd9c[_0x69fb('0x49')]=qs['sort'](_0x30ad67['query']['sort']);_0x19cd9c[_0x69fb('0x4c')]=qs[_0x69fb('0x44')](_['pick'](_0x30ad67[_0x69fb('0x43')],_0x5f3cf6[_0x69fb('0x44')]));_0x19cd9c[_0x69fb('0x4c')][_0x69fb('0x67')]=_0x11beea['id'];if(_0x30ad67[_0x69fb('0x43')][_0x69fb('0x4f')]){_0x19cd9c[_0x69fb('0x4c')]=_[_0x69fb('0x4d')](_0x19cd9c[_0x69fb('0x4c')],{'$or':_[_0x69fb('0x3d')](_0x19cd9c[_0x69fb('0x46')],function(_0x14af62){var _0xe42cda={};_0xe42cda[_0x14af62]={'$like':'%'+_0x30ad67[_0x69fb('0x43')][_0x69fb('0x4f')]+'%'};return _0xe42cda;})});}_0x19cd9c=_[_0x69fb('0x4d')]({},_0x19cd9c,_0x30ad67['options']);return db[_0x69fb('0x68')][_0x69fb('0x2e')]({'where':_0x19cd9c[_0x69fb('0x4c')]})['then'](function(_0x1b4240){_0xe79a1c[_0x69fb('0x2e')]=_0x1b4240;if(_0x30ad67['query'][_0x69fb('0x57')]){_0x19cd9c[_0x69fb('0x51')]=[{'all':!![]}];}return db[_0x69fb('0x68')][_0x69fb('0x52')](_0x19cd9c);})[_0x69fb('0x1e')](function(_0x25c6b5){_0xe79a1c[_0x69fb('0x53')]=_0x25c6b5;return _0xe79a1c;});}})[_0x69fb('0x1e')](respondWithFilteredResult(_0x4ee664,_0x19cd9c))['catch'](handleError(_0x4ee664,null));};exports[_0x69fb('0x6c')]=function(_0x423d71,_0x2cbaf1,_0x5d513d){return db[_0x69fb('0x3e')][_0x69fb('0x58')]({'where':{'id':_0x423d71[_0x69fb('0x64')]['id']}})[_0x69fb('0x1e')](handleEntityNotFound(_0x2cbaf1,null))[_0x69fb('0x1e')](function(_0x35a240){if(_0x35a240){return _0x35a240[_0x69fb('0x6c')](_0x423d71[_0x69fb('0x43')]['ids']);}})[_0x69fb('0x1e')](respondWithStatusCode(_0x2cbaf1,null))[_0x69fb('0x59')](handleError(_0x2cbaf1,null));};exports[_0x69fb('0x6d')]=function(_0x29c26d,_0x332cd3,_0x13ecce){if(_0x29c26d[_0x69fb('0x5b')]['id']){delete _0x29c26d[_0x69fb('0x5b')]['id'];}return db[_0x69fb('0x3e')][_0x69fb('0x58')]({'where':{'id':_0x29c26d[_0x69fb('0x64')]['id']}})['then'](handleEntityNotFound(_0x332cd3,null))[_0x69fb('0x1e')](function(_0x23fe16){if(_0x23fe16){_0x29c26d[_0x69fb('0x5b')]['SmsAccountId']=_0x23fe16['id'];return db['CannedAnswer'][_0x69fb('0x5a')](_0x29c26d[_0x69fb('0x5b')]);}})[_0x69fb('0x1e')](respondWithResult(_0x332cd3,null))[_0x69fb('0x59')](handleError(_0x332cd3,null));};exports[_0x69fb('0x6e')]=function(_0x4083a3,_0x379d53,_0x9d125d){var _0x321c8a={'raw':![],'where':{}};var _0x2e968b={};var _0x3ad2e9={'count':0x0,'rows':[]};return db['SmsAccount'][_0x69fb('0x6a')]({'where':{'id':_0x4083a3[_0x69fb('0x64')]['id']}})[_0x69fb('0x1e')](handleEntityNotFound(_0x379d53,null))['then'](function(_0x5718e5){if(_0x5718e5){_0x2e968b['model']=_[_0x69fb('0x55')](db[_0x69fb('0x6f')]['rawAttributes']);_0x2e968b[_0x69fb('0x43')]=_['keys'](_0x4083a3[_0x69fb('0x43')]);_0x2e968b['filters']=_['intersection'](_0x2e968b['model'],_0x2e968b[_0x69fb('0x43')]);_0x321c8a[_0x69fb('0x46')]=_['intersection'](_0x2e968b['model'],qs['fields'](_0x4083a3[_0x69fb('0x43')][_0x69fb('0x56')]));_0x321c8a[_0x69fb('0x46')]=_0x321c8a[_0x69fb('0x46')][_0x69fb('0x47')]?_0x321c8a[_0x69fb('0x46')]:_0x2e968b[_0x69fb('0x42')];if(!_0x4083a3['query'][_0x69fb('0x48')](_0x69fb('0x6b'))){_0x321c8a[_0x69fb('0x2d')]=qs['limit'](_0x4083a3['query'][_0x69fb('0x2d')]);_0x321c8a[_0x69fb('0x2b')]=qs['offset'](_0x4083a3['query'][_0x69fb('0x2b')]);}_0x321c8a[_0x69fb('0x49')]=qs[_0x69fb('0x4a')](_0x4083a3[_0x69fb('0x43')][_0x69fb('0x4a')]);_0x321c8a[_0x69fb('0x4c')]=qs['filters'](_[_0x69fb('0x4b')](_0x4083a3[_0x69fb('0x43')],_0x2e968b[_0x69fb('0x44')]));_0x321c8a[_0x69fb('0x4c')][_0x69fb('0x67')]=_0x5718e5['id'];if(_0x4083a3['query'][_0x69fb('0x4f')]){_0x321c8a[_0x69fb('0x4c')]=_[_0x69fb('0x4d')](_0x321c8a[_0x69fb('0x4c')],{'$or':_[_0x69fb('0x3d')](_0x321c8a[_0x69fb('0x46')],function(_0xac73a0){var _0x41acaa={};_0x41acaa[_0xac73a0]={'$like':'%'+_0x4083a3[_0x69fb('0x43')]['filter']+'%'};return _0x41acaa;})});}_0x321c8a=_[_0x69fb('0x4d')]({},_0x321c8a,_0x4083a3[_0x69fb('0x50')]);return db[_0x69fb('0x6f')]['count']({'where':_0x321c8a[_0x69fb('0x4c')]})[_0x69fb('0x1e')](function(_0x2d986e){_0x3ad2e9[_0x69fb('0x2e')]=_0x2d986e;if(_0x4083a3['query']['includeAll']){_0x321c8a[_0x69fb('0x51')]=[{'all':!![]}];}return db[_0x69fb('0x6f')][_0x69fb('0x52')](_0x321c8a);})[_0x69fb('0x1e')](function(_0x539c82){_0x3ad2e9[_0x69fb('0x53')]=_0x539c82;return _0x3ad2e9;});}})['then'](respondWithFilteredResult(_0x379d53,_0x321c8a))[_0x69fb('0x59')](handleError(_0x379d53,null));};exports[_0x69fb('0x70')]=function(_0x5d25e7,_0x38d387,_0x4ad6c9){return db[_0x69fb('0x3e')][_0x69fb('0x58')]({'where':{'id':_0x5d25e7[_0x69fb('0x64')]['id']}})['then'](handleEntityNotFound(_0x38d387,null))[_0x69fb('0x1e')](function(_0x207d41){if(_0x207d41){return _0x207d41[_0x69fb('0x70')](_0x5d25e7['query'][_0x69fb('0x71')]);}})[_0x69fb('0x1e')](respondWithStatusCode(_0x38d387,null))['catch'](handleError(_0x38d387,null));};exports[_0x69fb('0x72')]=function(_0x4dd260,_0x1ca55f,_0x1947f0){var _0x13b9d7={'channel':_0x69fb('0x73')};var _0x195be6=[];var _0x17c89d=[];var _0x3c06f1={};return db[_0x69fb('0x3e')][_0x69fb('0x58')]({'where':{'id':_0x4dd260[_0x69fb('0x64')]['id']},'include':[{'model':db[_0x69fb('0x74')],'as':_0x69fb('0x75')}]})['then'](handleEntityNotFound(_0x1ca55f,null))[_0x69fb('0x1e')](function(_0xeeb2d9){_0x13b9d7[_0x69fb('0x76')]=_0xeeb2d9;_0x13b9d7['applications']=_[_0x69fb('0x77')](_0xeeb2d9['Applications'],['priority'],[_0x69fb('0x78')]);if(_0x13b9d7['account']['Applications']){delete _0x13b9d7[_0x69fb('0x76')][_0x69fb('0x75')];}return db['CmContact']['describe']();})[_0x69fb('0x1e')](function(_0x5510d9){if(!_0x5510d9){throw new db[(_0x69fb('0x79'))][(_0x69fb('0x7a'))]('no\x20available\x20attributes');}_0x195be6=_['difference'](_[_0x69fb('0x55')](_0x5510d9),[_0x69fb('0x7b'),'updatedAt']);_0x17c89d=_[_0x69fb('0x7c')](_[_0x69fb('0x55')](_0x5510d9),['createdAt',_0x69fb('0x7d'),_0x69fb('0x7e'),_0x69fb('0x7f')]);_0x13b9d7[_0x69fb('0x5b')]={'mapKey':_0x69fb('0x80')};if(_0x13b9d7[_0x69fb('0x76')][_0x69fb('0x40')]){switch(_0x13b9d7[_0x69fb('0x76')]['type']){case _0x69fb('0x81'):_0x13b9d7['body']['from']=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x82')];_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x5b')]=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x83')];_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x84')]=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x85')];break;case _0x69fb('0x86'):_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')]='+'+_0x4dd260[_0x69fb('0x5b')]['sender'];_0x13b9d7['body']['body']=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x88')];break;case _0x69fb('0x89'):_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')]=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x87')];_0x13b9d7[_0x69fb('0x5b')]['body']=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x24')];break;case _0x69fb('0x8a'):_0x13b9d7['body']['from']=_0x4dd260[_0x69fb('0x5b')]['from'];_0x13b9d7[_0x69fb('0x5b')]['body']=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x5b')];_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x84')]=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x8b')];break;case _0x69fb('0x8c'):_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')]=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x82')];_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x5b')]=_0x4dd260['body'][_0x69fb('0x8d')];_0x13b9d7[_0x69fb('0x5b')]['messageId']=_0x4dd260['body'][_0x69fb('0x8e')];break;case'infobip':_0x13b9d7['body'][_0x69fb('0x87')]='+'+_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x8f')][0x0][_0x69fb('0x87')];_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x5b')]=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x8f')][0x0][_0x69fb('0x88')];_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x84')]=_0x4dd260['body'][_0x69fb('0x8f')][0x0][_0x69fb('0x84')];break;case _0x69fb('0x90'):_0x13b9d7[_0x69fb('0x5b')]['from']=_0x4dd260[_0x69fb('0x5b')]['originatingAddress'];_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x5b')]=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x91')][_0x69fb('0x24')];break;case _0x69fb('0x92'):_0x13b9d7[_0x69fb('0x5b')]['from']=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x93')];_0x13b9d7['body']['body']=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x88')];_0x13b9d7[_0x69fb('0x5b')]['messageId']=_0x4dd260['body'][_0x69fb('0x94')];break;case _0x69fb('0x95'):_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x84')]=_0x4dd260[_0x69fb('0x5b')][0x0]['message']['id'];_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')]=_0x4dd260[_0x69fb('0x5b')][0x0]['message'][_0x69fb('0x87')];_0x13b9d7[_0x69fb('0x5b')]['body']=_0x4dd260[_0x69fb('0x5b')][0x0]['message'][_0x69fb('0x88')];break;case _0x69fb('0x96'):_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')]=_0x4dd260['body']['from'];_0x13b9d7[_0x69fb('0x5b')]['body']=_0x4dd260['body']['message'];_0x13b9d7['body'][_0x69fb('0x84')]=_0x4dd260[_0x69fb('0x5b')][_0x69fb('0x97')];break;}}if(_0x13b9d7[_0x69fb('0x5b')]['id']){delete _0x13b9d7[_0x69fb('0x5b')]['id'];}if(_[_0x69fb('0x98')](_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')])){throw new db['Sequelize'][(_0x69fb('0x7a'))]('from\x20is\x20mandatory');}if(_[_0x69fb('0x98')](_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x5b')])||_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x5b')]===''){throw new db[(_0x69fb('0x79'))][(_0x69fb('0x7a'))](_0x69fb('0x99'));}if(_[_0x69fb('0x98')](_0x13b9d7['body']['mapKey'])){throw new db[(_0x69fb('0x79'))]['ValidationError'](_0x69fb('0x9a')+_0x17c89d);}if(!_[_0x69fb('0x9b')](_0x17c89d,_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x9c')])){throw new db[(_0x69fb('0x79'))][(_0x69fb('0x7a'))](_0x69fb('0x9d')+_0x17c89d);}_0x3c06f1[_0x13b9d7['body']['mapKey']]=_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')];return db[_0x69fb('0x9e')][_0x69fb('0x58')]({'where':{'id':_0x13b9d7[_0x69fb('0x76')][_0x69fb('0x7f')]},'include':[{'model':db[_0x69fb('0x9f')],'as':'Contacts','where':_0x3c06f1,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x69fb('0x1e')](handleEntityNotFound(_0x1ca55f,null))['then'](function(_0x4404da){if(_0x4404da){_0x13b9d7[_0x69fb('0xa0')]=_[_0x69fb('0xa1')](_0x4404da,[_0x69fb('0xa2')]);if(_0x4404da[_0x69fb('0xa2')]['length']){return _0x4404da[_0x69fb('0xa2')][0x0];}var _0x2875d7=_[_0x69fb('0xa3')](_0x13b9d7['body'],{'firstName':_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')],'ListId':_0x4404da['id']});_0x2875d7[_0x13b9d7[_0x69fb('0x5b')]['mapKey']]=_0x13b9d7['body'][_0x69fb('0x87')];return db[_0x69fb('0x9f')][_0x69fb('0x5a')](_0x2875d7,{'fields':_0x195be6,'raw':!![]});}})[_0x69fb('0x1e')](handleEntityNotFound(_0x1ca55f,null))[_0x69fb('0x1e')](function(_0x5f2d5a){if(_0x5f2d5a){_0x13b9d7[_0x69fb('0xa4')]=_0x5f2d5a;var _0x2c8afc={'ContactId':_0x5f2d5a['id'],'phone':_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x87')],'SmsAccountId':_0x4dd260[_0x69fb('0x64')]['id']};var _0x3ad681={'ContactId':_0x5f2d5a['id'],'SmsAccountId':_0x4dd260[_0x69fb('0x64')]['id'],'closed':![]};return db[_0x69fb('0xa5')][_0x69fb('0x58')]({'where':_0x3ad681})[_0x69fb('0x1e')](function(_0x42725b){if(_0x42725b){return[_0x42725b,![]];}return db[_0x69fb('0xa5')][_0x69fb('0x5a')](_0x2c8afc)['then'](function(_0x338e7c){return[_0x338e7c,!![]];});});}})[_0x69fb('0xa6')](function(_0x1461ac,_0x14fafb){_0x13b9d7[_0x69fb('0xa7')]=_0x1461ac['get']({'plain':!![]});_0x13b9d7[_0x69fb('0xa7')]['created']=![];if(_0x14fafb){if(_0x13b9d7['account'][_0x69fb('0xa8')]){_0x13b9d7['applications'][_0x69fb('0xa9')]({'id':0x0,'priority':_0x13b9d7[_0x69fb('0xaa')]['length']+0x1,'app':_0x69fb('0xab'),'appdata':_0x69fb('0xac'),'interval':_0x69fb('0xad')});}_0x13b9d7[_0x69fb('0xa7')][_0x69fb('0xae')]=!![];}return db['SmsMessage']['create']({'phone':_0x13b9d7[_0x69fb('0x5b')]['from'],'messageId':_0x13b9d7[_0x69fb('0x5b')]['messageId'],'body':_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0x5b')],'SmsAccountId':_0x4dd260['params']['id'],'SmsInteractionId':_0x1461ac['id'],'direction':'in','ContactId':_0x1461ac[_0x69fb('0xaf')],'AttachmentId':_0x13b9d7[_0x69fb('0x5b')][_0x69fb('0xb0')]});})[_0x69fb('0x1e')](function(_0x1a045e){_0x13b9d7['message']=_0x1a045e;if(_0x13b9d7[_0x69fb('0xa7')][_0x69fb('0xb1')]){return db[_0x69fb('0xb2')][_0x69fb('0x58')]({'attributes':['id',_0x69fb('0x38')],'where':{'id':_0x13b9d7[_0x69fb('0xa7')][_0x69fb('0xb1')]}})['then'](function(_0x26a201){if(_0x26a201){_0x13b9d7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x69fb('0xb3'),'appdata':_0x26a201[_0x69fb('0x38')]+','+(_0x13b9d7[_0x69fb('0x76')][_0x69fb('0xb4')]||0xa),'interval':_0x69fb('0xad')});}return respondWithRpcPromise(_0x69fb('0xb5'),_0x69fb('0xb6'),_0x13b9d7);});}return respondWithRpcPromise(_0x69fb('0xb5'),_0x69fb('0xb6'),_0x13b9d7);})[_0x69fb('0x1e')](function(_0x5b19fb){if(_0x5b19fb){var _0xff17b2=0xc8;var _0x43b6a8='receiveMessage';logger['info'](_0x69fb('0x21'),_0x43b6a8,_0xff17b2,_0x69fb('0xb7'));logger['debug'](_0x69fb('0xb8'),_0x43b6a8,_0xff17b2,_0x69fb('0xb7'),JSON[_0x69fb('0x22')](_0x5b19fb));if(_0x13b9d7['account'][_0x69fb('0x40')]===_0x69fb('0x81')){return _0x1ca55f[_0x69fb('0x29')](_0xff17b2)['set'](_0x69fb('0xb9'),_0x69fb('0xba'))[_0x69fb('0x39')](_0x69fb('0xbb'));}else{return _0x1ca55f[_0x69fb('0x29')](_0xff17b2)[_0x69fb('0x2a')](_0x5b19fb);}}})[_0x69fb('0x59')](handleError(_0x1ca55f,null));};exports[_0x69fb('0xbc')]=function(_0x3e2036,_0x1432a){var _0xd56911=_0x3e2036[_0x69fb('0x64')]['id'];var _0x1feb00=_0x3e2036[_0x69fb('0x5b')];var _0x3a97d4=0xc8;var _0x44ba4b=null;return db[_0x69fb('0xbd')][_0x69fb('0xbe')]({'isolationLevel':db[_0x69fb('0xbd')][_0x69fb('0xbf')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x30ab79){return db[_0x69fb('0x3e')][_0x69fb('0x6a')]({'where':{'id':_0xd56911},'transaction':_0x30ab79})[_0x69fb('0x1e')](function(_0x35d9f4){if(_0x35d9f4){return db[_0x69fb('0x74')]['destroy']({'where':{'SmsAccountId':_0xd56911},'transaction':_0x30ab79})[_0x69fb('0x1e')](function(){var _0x1a6afb=_[_0x69fb('0x3d')](_0x1feb00,function(_0x5556eb){_0x5556eb[_0x69fb('0x67')]=_0xd56911;return _0x5556eb;});return db['SmsApplication'][_0x69fb('0xc0')](_0x1a6afb,{'transaction':_0x30ab79});});}else{_0x3a97d4=0x194;_0x44ba4b=[];}});})[_0x69fb('0x1e')](function(){if(_0x3a97d4!==0x194){return db['SmsApplication'][_0x69fb('0xc1')]({'where':{'SmsAccountId':_0xd56911},'order':_0x69fb('0xc2')})[_0x69fb('0x1e')](function(_0x4e1635){_0x44ba4b=_0x4e1635;});}})[_0x69fb('0x59')](function(_0x1e4a8d){_0x3a97d4=0x1f4;logger[_0x69fb('0x25')](_0x1e4a8d[_0x69fb('0x37')]);if(_0x1e4a8d[_0x69fb('0x38')]){delete _0x1e4a8d[_0x69fb('0x38')];}_0x44ba4b=_0x1e4a8d;})[_0x69fb('0xc3')](function(){if(_0x44ba4b===null){_0x1432a['sendStatus'](_0x3a97d4);}else{if(_0x3a97d4===0x1f4){_0x1432a[_0x69fb('0x29')](_0x3a97d4)[_0x69fb('0x39')](_0x44ba4b);}else{_0x1432a['status'](_0x3a97d4)[_0x69fb('0x2a')](_0x44ba4b);}}});};exports[_0x69fb('0xc4')]=function(_0x1335e3,_0x13b569,_0x1cffc7){var _0x2c7b1e={};var _0x385c7f={};var _0x39d883;var _0x41fc00;return db[_0x69fb('0x3e')]['findOne']({'where':{'id':_0x1335e3[_0x69fb('0x64')]['id']}})['then'](handleEntityNotFound(_0x13b569,null))['then'](function(_0x35df18){if(_0x35df18){_0x39d883=_0x35df18;_0x385c7f[_0x69fb('0x42')]=_[_0x69fb('0x55')](db[_0x69fb('0x74')]['rawAttributes']);_0x385c7f[_0x69fb('0x43')]=_['keys'](_0x1335e3[_0x69fb('0x43')]);_0x385c7f[_0x69fb('0x44')]=_[_0x69fb('0x45')](_0x385c7f[_0x69fb('0x42')],_0x385c7f[_0x69fb('0x43')]);_0x2c7b1e[_0x69fb('0x46')]=_[_0x69fb('0x45')](_0x385c7f[_0x69fb('0x42')],qs[_0x69fb('0x56')](_0x1335e3['query'][_0x69fb('0x56')]));_0x2c7b1e['attributes']=_0x2c7b1e['attributes'][_0x69fb('0x47')]?_0x2c7b1e[_0x69fb('0x46')]:_0x385c7f[_0x69fb('0x42')];_0x2c7b1e['order']=qs[_0x69fb('0x4a')](_0x1335e3[_0x69fb('0x43')][_0x69fb('0x4a')]);_0x2c7b1e[_0x69fb('0x4c')]=qs['filters'](_[_0x69fb('0x4b')](_0x1335e3[_0x69fb('0x43')],_0x385c7f[_0x69fb('0x44')]));if(_0x1335e3[_0x69fb('0x43')][_0x69fb('0x4f')]){_0x2c7b1e[_0x69fb('0x4c')]=_['merge'](_0x2c7b1e[_0x69fb('0x4c')],{'$or':_[_0x69fb('0x3d')](_0x2c7b1e['attributes'],function(_0xf6d388){var _0x13113d={};_0x13113d[_0xf6d388]={'$like':'%'+_0x1335e3['query']['filter']+'%'};return _0x13113d;})});}_0x2c7b1e=_[_0x69fb('0x4d')]({},_0x2c7b1e,_0x1335e3['options']);return _0x39d883[_0x69fb('0xc4')](_0x2c7b1e);}})[_0x69fb('0x1e')](function(_0x3becff){if(_0x3becff){_0x41fc00=_0x3becff[_0x69fb('0x47')];if(!_0x1335e3[_0x69fb('0x43')][_0x69fb('0x48')](_0x69fb('0x6b'))){_0x2c7b1e[_0x69fb('0x2d')]=qs[_0x69fb('0x2d')](_0x1335e3[_0x69fb('0x43')][_0x69fb('0x2d')]);_0x2c7b1e[_0x69fb('0x2b')]=qs[_0x69fb('0x2b')](_0x1335e3[_0x69fb('0x43')]['offset']);}return _0x39d883['getApplications'](_0x2c7b1e);}})[_0x69fb('0x1e')](function(_0x33e55c){if(_0x33e55c){return _0x33e55c?{'count':_0x41fc00,'rows':_0x33e55c}:null;}})[_0x69fb('0x1e')](respondWithResult(_0x13b569,null))[_0x69fb('0x59')](handleError(_0x13b569,null));};exports[_0x69fb('0xc5')]=function(_0x5c7145,_0x57bce5,_0x405d0f){var _0x33106d={'raw':![],'where':{}};var _0x71f881={};var _0xe9b2be={'count':0x0,'rows':[]};return db[_0x69fb('0x3e')][_0x69fb('0x6a')]({'where':{'id':_0x5c7145[_0x69fb('0x64')]['id']}})[_0x69fb('0x1e')](handleEntityNotFound(_0x57bce5,null))[_0x69fb('0x1e')](function(_0x3b1594){if(_0x3b1594){_0x71f881[_0x69fb('0x42')]=_[_0x69fb('0x55')](db[_0x69fb('0xa5')]['rawAttributes']);_0x71f881[_0x69fb('0x43')]=_['keys'](_0x5c7145[_0x69fb('0x43')]);_0x71f881[_0x69fb('0x44')]=_[_0x69fb('0x45')](_0x71f881[_0x69fb('0x42')],_0x71f881[_0x69fb('0x43')]);_0x33106d[_0x69fb('0x46')]=_['intersection'](_0x71f881[_0x69fb('0x42')],qs['fields'](_0x5c7145[_0x69fb('0x43')][_0x69fb('0x56')]));_0x33106d[_0x69fb('0x46')]=_0x33106d[_0x69fb('0x46')][_0x69fb('0x47')]?_0x33106d[_0x69fb('0x46')]:_0x71f881[_0x69fb('0x42')];if(!_0x5c7145[_0x69fb('0x43')][_0x69fb('0x48')](_0x69fb('0x6b'))){_0x33106d[_0x69fb('0x2d')]=qs[_0x69fb('0x2d')](_0x5c7145[_0x69fb('0x43')]['limit']);_0x33106d[_0x69fb('0x2b')]=qs[_0x69fb('0x2b')](_0x5c7145[_0x69fb('0x43')][_0x69fb('0x2b')]);}_0x33106d[_0x69fb('0x49')]=qs[_0x69fb('0x4a')](_0x5c7145[_0x69fb('0x43')][_0x69fb('0x4a')]);_0x33106d[_0x69fb('0x4c')]=qs[_0x69fb('0x44')](_[_0x69fb('0x4b')](_0x5c7145['query'],_0x71f881[_0x69fb('0x44')]));_0x33106d[_0x69fb('0x4c')][_0x69fb('0x67')]=_0x3b1594['id'];if(_0x5c7145[_0x69fb('0x43')][_0x69fb('0x4f')]){_0x33106d[_0x69fb('0x4c')]=_[_0x69fb('0x4d')](_0x33106d[_0x69fb('0x4c')],{'$or':_[_0x69fb('0x3d')](_0x33106d[_0x69fb('0x46')],function(_0x48c659){var _0x46df28={};_0x46df28[_0x48c659]={'$like':'%'+_0x5c7145[_0x69fb('0x43')][_0x69fb('0x4f')]+'%'};return _0x46df28;})});}_0x33106d=_[_0x69fb('0x4d')]({},_0x33106d,_0x5c7145[_0x69fb('0x50')]);return db[_0x69fb('0xa5')][_0x69fb('0x2e')]({'where':_0x33106d[_0x69fb('0x4c')]})[_0x69fb('0x1e')](function(_0x939d5a){_0xe9b2be[_0x69fb('0x2e')]=_0x939d5a;if(_0x5c7145[_0x69fb('0x43')][_0x69fb('0x57')]){_0x33106d[_0x69fb('0x51')]=[{'model':db[_0x69fb('0x9f')],'as':_0x69fb('0xc6'),'required':![]},{'model':db['User'],'as':_0x69fb('0xc7'),'attributes':[_0x69fb('0x38'),_0x69fb('0xc8'),_0x69fb('0xc9')],'required':![]},{'model':db[_0x69fb('0xca')],'as':_0x69fb('0xcb'),'attributes':['id',_0x69fb('0x38'),_0x69fb('0xcc')],'where':_0x5c7145[_0x69fb('0x43')][_0x69fb('0xcd')]?{'id':_0x5c7145[_0x69fb('0x43')][_0x69fb('0xcd')]}:undefined,'required':_0x5c7145['query'][_0x69fb('0xcd')]?!![]:![]}];}return db[_0x69fb('0xa5')]['findAll'](_0x33106d);})[_0x69fb('0x1e')](function(_0x161253){_0xe9b2be[_0x69fb('0x53')]=_0x161253;return _0xe9b2be;});}})[_0x69fb('0x1e')](respondWithFilteredResult(_0x57bce5,_0x33106d))[_0x69fb('0x59')](handleError(_0x57bce5,null));};exports['send']=function(_0x1ba213,_0x200e06,_0x258b70){var _0x35371b,_0x5b0005,_0x28e448;if(_[_0x69fb('0x98')](_0x1ba213['body'][_0x69fb('0x5b')])||_0x1ba213['body']['body']===''){throw new db[(_0x69fb('0x79'))][(_0x69fb('0x7a'))](_0x69fb('0x99'));}if(_[_0x69fb('0x98')](_0x1ba213[_0x69fb('0x5b')]['to'])){throw new db['Sequelize'][(_0x69fb('0x7a'))](_0x69fb('0xce'));}_0x35371b=_0x1ba213['body']['to'];return db[_0x69fb('0x3e')][_0x69fb('0x58')]({'where':{'id':_0x1ba213['params']['id']},'include':[{'model':db[_0x69fb('0x9e')],'as':_0x69fb('0xcf'),'include':[{'model':db[_0x69fb('0x9f')],'as':'Contacts','where':{'mobile':_0x35371b},'limit':0x1,'order':[[_0x69fb('0x7d'),_0x69fb('0xd0')]]}]}]})['then'](handleEntityNotFound(_0x200e06,null))[_0x69fb('0x1e')](function(_0x59b3f3){if(_0x59b3f3&&_0x59b3f3['List']){_0x5b0005=_0x59b3f3[_0x69fb('0x35')]({'plain':!![]});if(_0x5b0005['List']&&_0x5b0005[_0x69fb('0xcf')]['Contacts'][_0x69fb('0x47')]){return _0x5b0005[_0x69fb('0xcf')]['Contacts'][0x0];}return db['CmContact']['create'](_['defaults'](_0x1ba213[_0x69fb('0x5b')],{'firstName':_0x35371b,'mobile':_0x35371b,'phone':_0x35371b,'ListId':_0x5b0005[_0x69fb('0x7f')]}));}})[_0x69fb('0x1e')](handleEntityNotFound(_0x200e06,null))['then'](function(_0x1a373a){if(_0x1a373a){_0x28e448=_0x1a373a;return db['SmsInteraction'][_0x69fb('0x58')]({'where':{'ContactId':_0x28e448['id'],'closed':![],'SmsAccountId':_0x5b0005['id']}})[_0x69fb('0x1e')](function(_0xcb42fb){if(_0xcb42fb){return[_0xcb42fb,![]];}return db[_0x69fb('0xa5')][_0x69fb('0x5a')]({'UserId':_0x1ba213[_0x69fb('0x5c')]['id'],'ContactId':_0x28e448['id'],'SmsAccountId':_0x5b0005['id'],'phone':_0x35371b,'firstMsgDirection':_0x69fb('0xd1'),'Messages':[_[_0x69fb('0x4d')](_0x1ba213[_0x69fb('0x5b')],{'read':![],'body':_0x1ba213[_0x69fb('0x5b')]['body'],'phone':_0x35371b,'SmsAccountId':_0x5b0005['id'],'UserId':_0x1ba213['user']['id'],'ContactId':_0x28e448['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x69fb('0xd2')}]})[_0x69fb('0x1e')](function(_0x180eb5){return[_0x180eb5,!![]];});});}})['spread'](function(_0x34d368,_0x59435b){if(_0x59435b){return _0x34d368;}return db[_0x69fb('0xd3')][_0x69fb('0x5a')](_['merge'](_0x1ba213[_0x69fb('0x5b')],{'read':![],'body':_0x1ba213['body'][_0x69fb('0x5b')],'phone':_0x35371b,'SmsAccountId':_0x5b0005['id'],'SmsInteractionId':_0x34d368['id'],'UserId':_0x1ba213[_0x69fb('0x5c')]['id'],'ContactId':_0x28e448['id']}))[_0x69fb('0x1e')](function(_0x1e5828){_0x34d368['dataValues'][_0x69fb('0xd2')]=[];_0x34d368[_0x69fb('0xd4')]['Messages'][_0x69fb('0xa9')](_0x1e5828[_0x69fb('0xd4')]);return _0x34d368;});})[_0x69fb('0x1e')](respondWithResult(_0x200e06,null))[_0x69fb('0x59')](handleError(_0x200e06,null));};exports[_0x69fb('0x29')]=function(_0x5ec2d7,_0x169935,_0x3ede17){if(_0x5ec2d7[_0x69fb('0x5b')]['id']){delete _0x5ec2d7[_0x69fb('0x5b')]['id'];}var _0x58dbe5,_0x1c392e,_0x552d95;return db['SmsAccount'][_0x69fb('0x58')]({'where':{'id':_0x5ec2d7[_0x69fb('0x64')]['id']}})['then'](handleEntityNotFound(_0x169935,null))[_0x69fb('0x1e')](function(_0x2dd644){if(_0x2dd644){_0x552d95=_0x2dd644;logger[_0x69fb('0xd5')](_0x69fb('0x21'),'status',_0x69fb('0xd6'),_0x2dd644['type'],util['inspect'](_0x5ec2d7[_0x69fb('0x5b')],{'showHidden':![],'depth':null}));switch(_0x2dd644[_0x69fb('0x40')]){case _0x69fb('0x86'):if(_0x5ec2d7[_0x69fb('0x5b')]['skebby_dispatch_id']&&_0x5ec2d7['body'][_0x69fb('0x29')]){_0x1c392e=_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x29')];return db[_0x69fb('0xd3')][_0x69fb('0x58')]({'where':{'messageId':_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0xd7')]}});}break;case _0x69fb('0x89'):if(_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0xd8')]&&_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0xd9')]){_0x1c392e=_0x5ec2d7[_0x69fb('0x5b')]['statusInt'];return db[_0x69fb('0xd3')][_0x69fb('0x58')]({'where':{'messageId':_0x5ec2d7['body'][_0x69fb('0xd8')]}});}break;case _0x69fb('0x8a'):if(_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x8b')]&&_0x5ec2d7['body'][_0x69fb('0xda')]){_0x1c392e=_0x5ec2d7['body']['status_code'];return db[_0x69fb('0xd3')]['find']({'where':{'messageId':_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x8b')]}});}break;case'infobip':var _0x4cadd0=_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x8f')][0x0];if(_0x4cadd0[_0x69fb('0x84')]&&_0x4cadd0[_0x69fb('0x29')][_0x69fb('0xdb')]===_0x69fb('0xdc')){_0x1c392e=_0x4cadd0[_0x69fb('0x29')][_0x69fb('0xdb')];return db[_0x69fb('0xd3')][_0x69fb('0x58')]({'where':{'messageId':_0x4cadd0[_0x69fb('0x84')]}});}break;case _0x69fb('0x92'):if(_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x84')]&&_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x29')]){_0x1c392e=_0x5ec2d7['body'][_0x69fb('0x29')];return db[_0x69fb('0xd3')][_0x69fb('0x58')]({'where':{'messageId':_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x84')]}});}break;case'bandwidth':if(_0x5ec2d7[_0x69fb('0x5b')][0x0][_0x69fb('0x24')]['id']){_0x1c392e=_0x5ec2d7[_0x69fb('0x5b')][0x0]['type'];return db[_0x69fb('0xd3')]['find']({'where':{'messageId':_0x5ec2d7['body'][0x0]['message']['id']}});}break;case _0x69fb('0x96'):if(_0x5ec2d7[_0x69fb('0x5b')]['redif']&&_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x29')]){_0x1c392e=_0x5ec2d7['body'][_0x69fb('0x29')];return db[_0x69fb('0xd3')][_0x69fb('0x58')]({'where':{'messageId':_0x5ec2d7[_0x69fb('0x5b')]['redif']}});}break;}}})[_0x69fb('0x1e')](handleEntityNotFound(_0x169935,null))['then'](function(_0x13465e){if(_0x13465e){_0x58dbe5=_0x13465e;switch(_0x552d95[_0x69fb('0x40')]){case _0x69fb('0x86'):if(_0x1c392e===_0x69fb('0xdc')){return _0x58dbe5[_0x69fb('0x63')]({'read':!![]});}else{logger[_0x69fb('0x25')](_0x69fb('0x21'),'status',_0x69fb('0x86'),util[_0x69fb('0xdd')](_0x5ec2d7[_0x69fb('0x5b')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x1c392e==='1'){return _0x58dbe5[_0x69fb('0x63')]({'read':!![]});}else{logger[_0x69fb('0x25')](_0x69fb('0x21'),_0x69fb('0x29'),_0x69fb('0x86'),util['inspect'](_0x5ec2d7[_0x69fb('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x69fb('0x8a'):if(!_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0xde')]&&_0x1c392e>=0xc8&&_0x1c392e<=0xce){return _0x58dbe5[_0x69fb('0x63')]({'read':!![]});}else{logger['error'](_0x69fb('0x21'),'status',_0x69fb('0x8a'),util[_0x69fb('0xdd')](_0x5ec2d7[_0x69fb('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x69fb('0xdf'):var _0x2726f8=_0x5ec2d7[_0x69fb('0x5b')][_0x69fb('0x8f')][0x0];if(_0x2726f8[_0x69fb('0x29')][_0x69fb('0xdb')]===_0x69fb('0xdc')){return _0x58dbe5[_0x69fb('0x63')]({'read':!![]});}else{logger[_0x69fb('0x25')](_0x69fb('0x21'),_0x69fb('0x29'),_0x69fb('0xdf'),util[_0x69fb('0xdd')](_0x5ec2d7[_0x69fb('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x69fb('0x92'):if(_0x1c392e==_0x69fb('0xe0')||_0x1c392e=='RECEIVED_BY_RECIPIENT'){return _0x58dbe5[_0x69fb('0x63')]({'read':!![]});}else{logger['error'](_0x69fb('0x21'),_0x69fb('0x29'),_0x69fb('0x92'),util[_0x69fb('0xdd')](_0x5ec2d7[_0x69fb('0x5b')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x1c392e==_0x69fb('0xe1')){return _0x58dbe5[_0x69fb('0x63')]({'read':!![]});}else{logger[_0x69fb('0x25')](_0x69fb('0x21'),_0x69fb('0x29'),'bandwidth',util[_0x69fb('0xdd')](_0x5ec2d7['body'],{'showHidden':![],'depth':null}));}break;case _0x69fb('0x96'):if(_0x1c392e===_0x69fb('0xe2')||_0x1c392e===_0x69fb('0xe3')){return _0x58dbe5[_0x69fb('0x63')]({'read':!![]});}else{logger['error'](_0x69fb('0x21'),_0x69fb('0x29'),'intelepeer',util[_0x69fb('0xdd')](_0x5ec2d7['body'],{'showHidden':![],'depth':null}));}break;}return _0x58dbe5;}})[_0x69fb('0x1e')](respondWithResult(_0x169935,null))[_0x69fb('0x59')](handleError(_0x169935,null));};exports[_0x69fb('0xe4')]=function(_0x472c03,_0x56836f,_0x2a906c){var _0x336702,_0x379148,_0x1beb83;return db['SmsAccount'][_0x69fb('0x58')]({'where':{'id':_0x472c03[_0x69fb('0x64')]['id']}})['then'](handleEntityNotFound(_0x56836f,null))[_0x69fb('0x1e')](function(_0x493c81){if(_0x493c81){_0x1beb83=_0x493c81;logger[_0x69fb('0xd5')](_0x69fb('0x21'),_0x69fb('0x29'),'received\x20delivery\x20report\x20from',_0x493c81[_0x69fb('0x40')],util[_0x69fb('0xdd')](_0x472c03[_0x69fb('0x43')],{'showHidden':![],'depth':null}));switch(_0x493c81[_0x69fb('0x40')]){case'csc':if(_0x472c03[_0x69fb('0x43')][_0x69fb('0xe5')]&&_0x472c03[_0x69fb('0x43')][_0x69fb('0xe6')]){_0x379148=_0x472c03['query'][_0x69fb('0xe6')];return db[_0x69fb('0xd3')]['find']({'where':{'messageId':_0x472c03[_0x69fb('0x43')][_0x69fb('0xe5')]}});}break;}}})['then'](handleEntityNotFound(_0x56836f,null))[_0x69fb('0x1e')](function(_0x910ab1){if(_0x910ab1){_0x336702=_0x910ab1;switch(_0x1beb83[_0x69fb('0x40')]){case _0x69fb('0x90'):if(_0x379148==='2'||_0x379148==='6'){return _0x336702[_0x69fb('0x63')]({'read':!![]});}else{logger['error'](_0x69fb('0x21'),_0x69fb('0x29'),_0x69fb('0x90'),util['inspect'](_0x472c03[_0x69fb('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x336702;}})[_0x69fb('0x1e')](respondWithResult(_0x56836f,null))['catch'](handleError(_0x56836f,null));};exports[_0x69fb('0xe7')]=function(_0x5357bb,_0x2c7079,_0x1e2759){return db[_0x69fb('0x3e')][_0x69fb('0x58')]({'where':{'id':_0x5357bb[_0x69fb('0x64')]['id']}})['then'](handleEntityNotFound(_0x2c7079,null))[_0x69fb('0x1e')](function(_0x2d8ffe){if(_0x2d8ffe){return _0x2d8ffe['addAgents'](_0x5357bb[_0x69fb('0x5b')][_0x69fb('0x71')],_[_0x69fb('0xa1')](_0x5357bb['body'],[_0x69fb('0x71'),'id'])||{})[_0x69fb('0xa6')](function(_0x57eba1){for(var _0x940c68=0x0;_0x940c68<_0x5357bb[_0x69fb('0x5b')][_0x69fb('0x71')][_0x69fb('0x47')];_0x940c68+=0x1){socket['emit'](_0x69fb('0xe8'),{'UserId':Number(_0x5357bb[_0x69fb('0x5b')][_0x69fb('0x71')][_0x940c68]),'SmsAccountId':Number(_0x5357bb['params']['id'])});}return _0x57eba1;});}})['then'](respondWithResult(_0x2c7079,null))[_0x69fb('0x59')](handleError(_0x2c7079,null));};exports[_0x69fb('0xe9')]=function(_0xcdd9c6,_0x48f992,_0x22527a){return db[_0x69fb('0x3e')][_0x69fb('0x58')]({'where':{'id':_0xcdd9c6['params']['id']}})[_0x69fb('0x1e')](handleEntityNotFound(_0x48f992,null))[_0x69fb('0x1e')](function(_0x4878bb){if(_0x4878bb){return _0x4878bb['removeAgents'](_0xcdd9c6[_0x69fb('0x43')][_0x69fb('0x71')])['then'](function(){if(_[_0x69fb('0xea')](_0xcdd9c6[_0x69fb('0x43')][_0x69fb('0x71')])){for(var _0x46b0c5=0x0;_0x46b0c5<_0xcdd9c6['query'][_0x69fb('0x71')][_0x69fb('0x47')];_0x46b0c5+=0x1){socket[_0x69fb('0xeb')](_0x69fb('0xec'),{'UserId':Number(_0xcdd9c6['query']['ids'][_0x46b0c5]),'SmsAccountId':Number(_0xcdd9c6['params']['id'])});}}else{socket['emit'](_0x69fb('0xec'),{'UserId':Number(_0xcdd9c6[_0x69fb('0x43')][_0x69fb('0x71')]),'SmsAccountId':Number(_0xcdd9c6[_0x69fb('0x64')]['id'])});}});}})[_0x69fb('0x1e')](respondWithStatusCode(_0x48f992,null))[_0x69fb('0x59')](handleError(_0x48f992,null));};exports['getAgents']=function(_0x10a3e8,_0x220ced,_0x69d0a1){var _0x1de50c={};var _0x17e581={};var _0x5840eb;var _0xb06cd1;return db[_0x69fb('0x3e')][_0x69fb('0x6a')]({'where':{'id':_0x10a3e8[_0x69fb('0x64')]['id']}})[_0x69fb('0x1e')](handleEntityNotFound(_0x220ced,null))[_0x69fb('0x1e')](function(_0x54efbc){if(_0x54efbc){_0x5840eb=_0x54efbc;_0x17e581[_0x69fb('0x42')]=_[_0x69fb('0x55')](db[_0x69fb('0xb2')][_0x69fb('0x3f')]);_0x17e581[_0x69fb('0x43')]=_[_0x69fb('0x55')](_0x10a3e8[_0x69fb('0x43')]);_0x17e581[_0x69fb('0x44')]=_['intersection'](_0x17e581[_0x69fb('0x42')],_0x17e581[_0x69fb('0x43')]);_0x1de50c['attributes']=_[_0x69fb('0x45')](_0x17e581[_0x69fb('0x42')],qs[_0x69fb('0x56')](_0x10a3e8[_0x69fb('0x43')][_0x69fb('0x56')]));_0x1de50c['attributes']=_0x1de50c['attributes']['length']?_0x1de50c[_0x69fb('0x46')]:_0x17e581[_0x69fb('0x42')];_0x1de50c[_0x69fb('0x49')]=qs[_0x69fb('0x4a')](_0x10a3e8[_0x69fb('0x43')][_0x69fb('0x4a')]);_0x1de50c['where']=qs[_0x69fb('0x44')](_[_0x69fb('0x4b')](_0x10a3e8['query'],_0x17e581[_0x69fb('0x44')]));if(_0x10a3e8['query'][_0x69fb('0x4f')]){_0x1de50c[_0x69fb('0x4c')]=_['merge'](_0x1de50c[_0x69fb('0x4c')],{'$or':_[_0x69fb('0x3d')](_0x1de50c[_0x69fb('0x46')],function(_0x239fef){var _0x3b94bd={};_0x3b94bd[_0x239fef]={'$like':'%'+_0x10a3e8['query'][_0x69fb('0x4f')]+'%'};return _0x3b94bd;})});}_0x1de50c=_[_0x69fb('0x4d')]({},_0x1de50c,_0x10a3e8['options']);return _0x5840eb[_0x69fb('0xed')](_0x1de50c);}})['then'](function(_0x1e1298){if(_0x1e1298){_0xb06cd1=_0x1e1298[_0x69fb('0x47')];if(!_0x10a3e8[_0x69fb('0x43')][_0x69fb('0x48')]('nolimit')){_0x1de50c[_0x69fb('0x2d')]=qs[_0x69fb('0x2d')](_0x10a3e8[_0x69fb('0x43')][_0x69fb('0x2d')]);_0x1de50c[_0x69fb('0x2b')]=qs['offset'](_0x10a3e8[_0x69fb('0x43')][_0x69fb('0x2b')]);}return _0x5840eb['getAgents'](_0x1de50c);}})[_0x69fb('0x1e')](function(_0x28e57e){if(_0x28e57e){return _0x28e57e?{'count':_0xb06cd1,'rows':_0x28e57e}:null;}})[_0x69fb('0x1e')](respondWithResult(_0x220ced,null))[_0x69fb('0x59')](handleError(_0x220ced,null));};
\ No newline at end of file
index cbe36ab..872502f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecd9=['emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','remove'];(function(_0x3ee57a,_0x2c8c6){var _0x10515d=function(_0x40ed28){while(--_0x40ed28){_0x3ee57a['push'](_0x3ee57a['shift']());}};_0x10515d(++_0x2c8c6);}(_0xecd9,0x173));var _0x9ecd=function(_0x57495b,_0x4c1b97){_0x57495b=_0x57495b-0x0;var _0x5a1331=_0xecd9[_0x57495b];return _0x5a1331;};'use strict';var EventEmitter=require(_0x9ecd('0x0'));var SmsAccount=require(_0x9ecd('0x1'))['db'][_0x9ecd('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9ecd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9ecd('0x4')};function emitEvent(_0x143790){return function(_0x59b1af,_0x5536a5,_0x4bb4f7){SmsAccountEvents[_0x9ecd('0x5')](_0x143790+':'+_0x59b1af['id'],_0x59b1af);SmsAccountEvents[_0x9ecd('0x5')](_0x143790,_0x59b1af);_0x4bb4f7(null);};}for(var e in events){if(events[_0x9ecd('0x6')](e)){var event=events[e];SmsAccount[_0x9ecd('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0xd8e3=['../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x5a9d2b,_0x64b8b8){var _0x55a4a5=function(_0x589406){while(--_0x589406){_0x5a9d2b['push'](_0x5a9d2b['shift']());}};_0x55a4a5(++_0x64b8b8);}(_0xd8e3,0x15e));var _0x3d8e=function(_0x1c96e4,_0x5d477b){_0x1c96e4=_0x1c96e4-0x0;var _0x1108ec=_0xd8e3[_0x1c96e4];return _0x1108ec;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x3d8e('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3d8e('0x1'),'afterUpdate':_0x3d8e('0x2'),'afterDestroy':_0x3d8e('0x3')};function emitEvent(_0x8944c2){return function(_0x32ea8c,_0x3a2b2c,_0xfb04fc){SmsAccountEvents[_0x3d8e('0x4')](_0x8944c2+':'+_0x32ea8c['id'],_0x32ea8c);SmsAccountEvents[_0x3d8e('0x4')](_0x8944c2,_0x32ea8c);_0xfb04fc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x3d8e('0x5')](e,emitEvent(event));}}module[_0x3d8e('0x6')]=SmsAccountEvents;
\ No newline at end of file
index ad4abbd..03899e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ef=['exports','define','sms_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes'];(function(_0x1ba22d,_0x5b002a){var _0x346b35=function(_0x30db42){while(--_0x30db42){_0x1ba22d['push'](_0x1ba22d['shift']());}};_0x346b35(++_0x5b002a);}(_0xc4ef,0x147));var _0xfc4e=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4ef[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xfc4e('0x0'));var util=require(_0xfc4e('0x1'));var logger=require('../../config/logger')(_0xfc4e('0x2'));var moment=require('moment');var BPromise=require(_0xfc4e('0x3'));var rp=require(_0xfc4e('0x4'));var fs=require('fs');var path=require(_0xfc4e('0x5'));var rimraf=require(_0xfc4e('0x6'));var config=require(_0xfc4e('0x7'));var attributes=require(_0xfc4e('0x8'));module[_0xfc4e('0x9')]=function(_0x4ec635,_0x5b4f45){return _0x4ec635[_0xfc4e('0xa')]('SmsAccount',attributes,{'tableName':_0xfc4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x32c2=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x2d5a8e,_0x333734){var _0x3d97f8=function(_0x41b763){while(--_0x41b763){_0x2d5a8e['push'](_0x2d5a8e['shift']());}};_0x3d97f8(++_0x333734);}(_0x32c2,0x99));var _0x232c=function(_0x4acb50,_0x5bfe03){_0x4acb50=_0x4acb50-0x0;var _0x39f111=_0x32c2[_0x4acb50];return _0x39f111;};'use strict';var _=require(_0x232c('0x0'));var util=require(_0x232c('0x1'));var logger=require(_0x232c('0x2'))(_0x232c('0x3'));var moment=require(_0x232c('0x4'));var BPromise=require(_0x232c('0x5'));var rp=require(_0x232c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x232c('0x7'));var config=require(_0x232c('0x8'));var attributes=require('./smsAccount.attributes');module[_0x232c('0x9')]=function(_0x706bcf,_0x4666a7){return _0x706bcf['define'](_0x232c('0xa'),attributes,{'tableName':_0x232c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 11998e4..f98b1a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ff=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','register','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','lodash','util','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22ff,0x151));var _0xf22f=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0x22ff[_0x5d61b4];return _0x183fc5;};'use strict';var _=require(_0xf22f('0x0'));var util=require(_0xf22f('0x1'));var moment=require('moment');var BPromise=require(_0xf22f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf22f('0x3'));var db=require(_0xf22f('0x4'))['db'];var utils=require(_0xf22f('0x5'));var logger=require(_0xf22f('0x6'))(_0xf22f('0x7'));var config=require('../../config/environment');var jayson=require(_0xf22f('0x8'));var client=jayson[_0xf22f('0x9')][_0xf22f('0xa')]({'port':0x232a});config[_0xf22f('0xb')]=_[_0xf22f('0xc')](config[_0xf22f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf22f('0xb')]));require('./smsAccount.socket')[_0xf22f('0xd')](socket);function respondWithRpcPromise(_0x3b6463,_0x27a077,_0x28a666){return new BPromise(function(_0x3f35fd,_0x79e971){return client['request'](_0x3b6463,_0x28a666)[_0xf22f('0xe')](function(_0x1f911a){logger[_0xf22f('0xf')]('SmsAccount,\x20%s,\x20%s',_0x27a077,_0xf22f('0x10'));logger[_0xf22f('0x11')](_0xf22f('0x12'),_0x27a077,_0xf22f('0x10'),JSON[_0xf22f('0x13')](_0x1f911a));if(_0x1f911a[_0xf22f('0x14')]){if(_0x1f911a['error']['code']===0x1f4){logger['error'](_0xf22f('0x15'),_0x27a077,_0x1f911a['error'][_0xf22f('0x16')]);return _0x79e971(_0x1f911a['error'][_0xf22f('0x16')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x27a077,_0x1f911a['error']['message']);return _0x3f35fd(_0x1f911a[_0xf22f('0x14')][_0xf22f('0x16')]);}else{logger['info'](_0xf22f('0x15'),_0x27a077,'request\x20sent');_0x3f35fd(_0x1f911a['result'][_0xf22f('0x16')]);}})[_0xf22f('0x17')](function(_0x5c5e23){logger[_0xf22f('0x14')]('SmsAccount,\x20%s,\x20%s',_0x27a077,_0x5c5e23);_0x79e971(_0x5c5e23);});});}exports[_0xf22f('0x18')]=function(_0x42b0e){var _0x29ba83=this;return new Promise(function(_0xbfe9fe,_0x710997){return db[_0xf22f('0x19')][_0xf22f('0x1a')]({'raw':_0x42b0e[_0xf22f('0x1b')]?_0x42b0e[_0xf22f('0x1b')][_0xf22f('0x1c')]===undefined?!![]:![]:!![],'where':_0x42b0e[_0xf22f('0x1b')]?_0x42b0e['options'][_0xf22f('0x1d')]||null:null,'attributes':_0x42b0e['options']?_0x42b0e[_0xf22f('0x1b')][_0xf22f('0x1e')]||null:null,'include':_0x42b0e[_0xf22f('0x1b')]?_0x42b0e[_0xf22f('0x1b')][_0xf22f('0x1f')]?_[_0xf22f('0x20')](_0x42b0e['options'][_0xf22f('0x1f')],function(_0x4bc198){return{'model':db[_0x4bc198['model']],'as':_0x4bc198['as'],'attributes':_0x4bc198[_0xf22f('0x1e')],'include':_0x4bc198[_0xf22f('0x1f')]?_[_0xf22f('0x20')](_0x4bc198['include'],function(_0x42b297){return{'model':db[_0x42b297[_0xf22f('0x21')]],'as':_0x42b297['as'],'attributes':_0x42b297[_0xf22f('0x1e')],'include':_0x42b297[_0xf22f('0x1f')]?_[_0xf22f('0x20')](_0x42b297['include'],function(_0x1dc680){return{'model':db[_0x1dc680[_0xf22f('0x21')]],'as':_0x1dc680['as'],'attributes':_0x1dc680[_0xf22f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf22f('0xe')](function(_0x467035){logger['info']('ShowSmsAccount',_0x42b0e);logger[_0xf22f('0x11')](_0xf22f('0x18'),_0x42b0e,JSON['stringify'](_0x467035));_0xbfe9fe(_0x467035);})[_0xf22f('0x17')](function(_0x475596){logger[_0xf22f('0x14')](_0xf22f('0x18'),_0x475596[_0xf22f('0x16')],_0x42b0e);_0x710997(_0x29ba83[_0xf22f('0x14')](0x1f4,_0x475596['message']));});});};
\ No newline at end of file
+var _0xb4b1=['localhost','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5d0eb8,_0x40c598){var _0x32d89b=function(_0x31fdf8){while(--_0x31fdf8){_0x5d0eb8['push'](_0x5d0eb8['shift']());}};_0x32d89b(++_0x40c598);}(_0xb4b1,0x1d3));var _0x1b4b=function(_0x4d6d82,_0x29ee30){_0x4d6d82=_0x4d6d82-0x0;var _0x11212c=_0xb4b1[_0x4d6d82];return _0x11212c;};'use strict';var _=require(_0x1b4b('0x0'));var util=require(_0x1b4b('0x1'));var moment=require(_0x1b4b('0x2'));var BPromise=require(_0x1b4b('0x3'));var rs=require(_0x1b4b('0x4'));var fs=require('fs');var Redis=require(_0x1b4b('0x5'));var db=require(_0x1b4b('0x6'))['db'];var utils=require(_0x1b4b('0x7'));var logger=require('../../config/logger')(_0x1b4b('0x8'));var config=require(_0x1b4b('0x9'));var jayson=require(_0x1b4b('0xa'));var client=jayson[_0x1b4b('0xb')][_0x1b4b('0xc')]({'port':0x232a});config[_0x1b4b('0xd')]=_['defaults'](config[_0x1b4b('0xd')],{'host':_0x1b4b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b4b('0xd')]));require(_0x1b4b('0xf'))['register'](socket);function respondWithRpcPromise(_0x42b815,_0xccaa6e,_0x3dc20c){return new BPromise(function(_0x150004,_0x568559){return client[_0x1b4b('0x10')](_0x42b815,_0x3dc20c)[_0x1b4b('0x11')](function(_0x50dc9f){logger[_0x1b4b('0x12')](_0x1b4b('0x13'),_0xccaa6e,'request\x20sent');logger[_0x1b4b('0x14')](_0x1b4b('0x15'),_0xccaa6e,_0x1b4b('0x16'),JSON[_0x1b4b('0x17')](_0x50dc9f));if(_0x50dc9f[_0x1b4b('0x18')]){if(_0x50dc9f['error'][_0x1b4b('0x19')]===0x1f4){logger[_0x1b4b('0x18')](_0x1b4b('0x13'),_0xccaa6e,_0x50dc9f[_0x1b4b('0x18')][_0x1b4b('0x1a')]);return _0x568559(_0x50dc9f[_0x1b4b('0x18')][_0x1b4b('0x1a')]);}logger[_0x1b4b('0x18')](_0x1b4b('0x13'),_0xccaa6e,_0x50dc9f[_0x1b4b('0x18')][_0x1b4b('0x1a')]);return _0x150004(_0x50dc9f['error']['message']);}else{logger['info'](_0x1b4b('0x13'),_0xccaa6e,_0x1b4b('0x16'));_0x150004(_0x50dc9f[_0x1b4b('0x1b')]['message']);}})[_0x1b4b('0x1c')](function(_0x2db9a8){logger['error'](_0x1b4b('0x13'),_0xccaa6e,_0x2db9a8);_0x568559(_0x2db9a8);});});}exports[_0x1b4b('0x1d')]=function(_0x303ad8){var _0x36190d=this;return new Promise(function(_0x363d31,_0x22cd56){return db['SmsAccount'][_0x1b4b('0x1e')]({'raw':_0x303ad8[_0x1b4b('0x1f')]?_0x303ad8[_0x1b4b('0x1f')][_0x1b4b('0x20')]===undefined?!![]:![]:!![],'where':_0x303ad8[_0x1b4b('0x1f')]?_0x303ad8[_0x1b4b('0x1f')]['where']||null:null,'attributes':_0x303ad8[_0x1b4b('0x1f')]?_0x303ad8[_0x1b4b('0x1f')][_0x1b4b('0x21')]||null:null,'include':_0x303ad8[_0x1b4b('0x1f')]?_0x303ad8[_0x1b4b('0x1f')][_0x1b4b('0x22')]?_['map'](_0x303ad8[_0x1b4b('0x1f')][_0x1b4b('0x22')],function(_0x2c3bb6){return{'model':db[_0x2c3bb6['model']],'as':_0x2c3bb6['as'],'attributes':_0x2c3bb6[_0x1b4b('0x21')],'include':_0x2c3bb6[_0x1b4b('0x22')]?_[_0x1b4b('0x23')](_0x2c3bb6['include'],function(_0x46c168){return{'model':db[_0x46c168[_0x1b4b('0x24')]],'as':_0x46c168['as'],'attributes':_0x46c168[_0x1b4b('0x21')],'include':_0x46c168[_0x1b4b('0x22')]?_['map'](_0x46c168[_0x1b4b('0x22')],function(_0x8630e8){return{'model':db[_0x8630e8['model']],'as':_0x8630e8['as'],'attributes':_0x8630e8['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b4b('0x11')](function(_0x47e47c){logger[_0x1b4b('0x12')](_0x1b4b('0x1d'),_0x303ad8);logger['debug'](_0x1b4b('0x1d'),_0x303ad8,JSON[_0x1b4b('0x17')](_0x47e47c));_0x363d31(_0x47e47c);})[_0x1b4b('0x1c')](function(_0x5ea037){logger['error'](_0x1b4b('0x1d'),_0x5ea037[_0x1b4b('0x1a')],_0x303ad8);_0x22cd56(_0x36190d[_0x1b4b('0x18')](0x1f4,_0x5ea037[_0x1b4b('0x1a')]));});});};
\ No newline at end of file
index e525f69..6203b98 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 1afa363..95c6075 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(_0x536840,_0x52610a){var _0xc5ee90=function(_0x260826){while(--_0x260826){_0x536840['push'](_0x536840['shift']());}};_0xc5ee90(++_0x52610a);}(_0xedd9,0xfc));var _0x9edd=function(_0x37b50b,_0x3c9e99){_0x37b50b=_0x37b50b-0x0;var _0x557b5e=_0xedd9[_0x37b50b];return _0x557b5e;};'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 _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x578bf0,_0xd1aceb){var _0x529651=function(_0x358d90){while(--_0x358d90){_0x578bf0['push'](_0x578bf0['shift']());}};_0x529651(++_0xd1aceb);}(_0x7217,0x19e));var _0x7721=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x7217[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
index 3c7046c..b992302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x014d=['sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x014d,0x8a));var _0xd014=function(_0x3b456e,_0x471171){_0x3b456e=_0x3b456e-0x0;var _0x15f975=_0x014d[_0x3b456e];return _0x15f975;};'use strict';var Sequelize=require(_0xd014('0x0'));module[_0xd014('0x1')]={'priority':{'type':Sequelize[_0xd014('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd014('0x3')},'appdata':{'type':Sequelize[_0xd014('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd014('0x5')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x338d=['exports','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x338d,0x6b));var _0xd338=function(_0x450479,_0x57895f){_0x450479=_0x450479-0x0;var _0x3e68ef=_0x338d[_0x450479];return _0x3e68ef;};'use strict';var Sequelize=require(_0xd338('0x0'));module[_0xd338('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd338('0x2')},'appdata':{'type':Sequelize[_0xd338('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd338('0x4')],'defaultValue':_0xd338('0x5')}};
\ No newline at end of file
index 03dea9a..ee3ab5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cc2=['reject','save','update','then','end','error','stack','name','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','nolimit','sort','where','filters','pick','type','filter','merge','options','include','findAll','rows','show','params','length','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','Content-Range','json','apply'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x3cc2,0xb9));var _0x23cc=function(_0x36f1fc,_0x20f30a){_0x36f1fc=_0x36f1fc-0x0;var _0x4f586e=_0x3cc2[_0x36f1fc];return _0x4f586e;};'use strict';var emlformat=require(_0x23cc('0x0'));var rimraf=require(_0x23cc('0x1'));var zipdir=require(_0x23cc('0x2'));var jsonpatch=require(_0x23cc('0x3'));var rp=require(_0x23cc('0x4'));var moment=require(_0x23cc('0x5'));var BPromise=require(_0x23cc('0x6'));var Mustache=require(_0x23cc('0x7'));var util=require(_0x23cc('0x8'));var path=require(_0x23cc('0x9'));var sox=require(_0x23cc('0xa'));var csv=require(_0x23cc('0xb'));var ejs=require(_0x23cc('0xc'));var fs=require('fs');var fs_extra=require(_0x23cc('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x23cc('0xe'));var jsforce=require(_0x23cc('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x23cc('0x10'));var Redis=require(_0x23cc('0x11'));var authService=require(_0x23cc('0x12'));var qs=require(_0x23cc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23cc('0x14'));var logger=require(_0x23cc('0x15'))('api');var utils=require(_0x23cc('0x16'));var config=require(_0x23cc('0x17'));var licenseUtil=require(_0x23cc('0x18'));var db=require(_0x23cc('0x19'))['db'];function respondWithStatusCode(_0x37f326,_0x3f96b8){_0x3f96b8=_0x3f96b8||0xcc;return function(_0x4d6086){if(_0x4d6086){return _0x37f326[_0x23cc('0x1a')](_0x3f96b8);}return _0x37f326[_0x23cc('0x1b')](_0x3f96b8)['end']();};}function respondWithResult(_0x648b2c,_0x5759e6){_0x5759e6=_0x5759e6||0xc8;return function(_0xeaeb8d){if(_0xeaeb8d){return _0x648b2c[_0x23cc('0x1b')](_0x5759e6)['json'](_0xeaeb8d);}};}function respondWithFilteredResult(_0x337ecd,_0x1572e4){return function(_0x474edd){if(_0x474edd){var _0x251d11=typeof _0x1572e4[_0x23cc('0x1c')]==='undefined'&&typeof _0x1572e4['limit']==='undefined';var _0x4afc45=_0x474edd[_0x23cc('0x1d')];var _0x263b91=_0x251d11?0x0:_0x1572e4[_0x23cc('0x1c')];var _0x478756=_0x251d11?_0x474edd[_0x23cc('0x1d')]:_0x1572e4[_0x23cc('0x1c')]+_0x1572e4[_0x23cc('0x1e')];var _0x49296a;if(_0x478756>=_0x4afc45){_0x478756=_0x4afc45;_0x49296a=0xc8;}else{_0x49296a=0xce;}_0x337ecd[_0x23cc('0x1b')](_0x49296a);return _0x337ecd['set'](_0x23cc('0x1f'),_0x263b91+'-'+_0x478756+'/'+_0x4afc45)[_0x23cc('0x20')](_0x474edd);}return null;};}function patchUpdates(_0x5e5781){return function(_0x59c340){try{jsonpatch[_0x23cc('0x21')](_0x59c340,_0x5e5781,!![]);}catch(_0x290dcc){return BPromise[_0x23cc('0x22')](_0x290dcc);}return _0x59c340[_0x23cc('0x23')]();};}function saveUpdates(_0xd4f68d,_0x183a8b){return function(_0x54c653){if(_0x54c653){return _0x54c653[_0x23cc('0x24')](_0xd4f68d)[_0x23cc('0x25')](function(_0x5dbe63){return _0x5dbe63;});}return null;};}function removeEntity(_0x27cd81,_0x306f18){return function(_0x292483){if(_0x292483){return _0x292483['destroy']()[_0x23cc('0x25')](function(){_0x27cd81['status'](0xcc)[_0x23cc('0x26')]();});}};}function handleEntityNotFound(_0xd052c3,_0x1d8a47){return function(_0x5ca40e){if(!_0x5ca40e){_0xd052c3[_0x23cc('0x1a')](0x194);}return _0x5ca40e;};}function handleError(_0x34d094,_0x4216c1){_0x4216c1=_0x4216c1||0x1f4;return function(_0x4516af){logger[_0x23cc('0x27')](_0x4516af[_0x23cc('0x28')]);if(_0x4516af[_0x23cc('0x29')]){delete _0x4516af[_0x23cc('0x29')];}_0x34d094[_0x23cc('0x1b')](_0x4216c1)['send'](_0x4516af);};}exports['index']=function(_0x2e7210,_0x144154){var _0x342d5d={},_0x22d753={},_0x13ef14={'count':0x0,'rows':[]};var _0x42227a=_[_0x23cc('0x2a')](db[_0x23cc('0x2b')][_0x23cc('0x2c')],function(_0x1c2cba){return{'name':_0x1c2cba[_0x23cc('0x2d')],'type':_0x1c2cba['type'][_0x23cc('0x2e')]};});_0x22d753[_0x23cc('0x2f')]=_[_0x23cc('0x2a')](_0x42227a,'name');_0x22d753[_0x23cc('0x30')]=_[_0x23cc('0x31')](_0x2e7210[_0x23cc('0x30')]);_0x22d753['filters']=_[_0x23cc('0x32')](_0x22d753[_0x23cc('0x2f')],_0x22d753[_0x23cc('0x30')]);_0x342d5d['attributes']=_['intersection'](_0x22d753[_0x23cc('0x2f')],qs[_0x23cc('0x33')](_0x2e7210[_0x23cc('0x30')]['fields']));_0x342d5d['attributes']=_0x342d5d[_0x23cc('0x34')]['length']?_0x342d5d['attributes']:_0x22d753['model'];if(!_0x2e7210[_0x23cc('0x30')]['hasOwnProperty'](_0x23cc('0x35'))){_0x342d5d[_0x23cc('0x1e')]=qs[_0x23cc('0x1e')](_0x2e7210['query'][_0x23cc('0x1e')]);_0x342d5d[_0x23cc('0x1c')]=qs[_0x23cc('0x1c')](_0x2e7210[_0x23cc('0x30')][_0x23cc('0x1c')]);}_0x342d5d['order']=qs[_0x23cc('0x36')](_0x2e7210[_0x23cc('0x30')][_0x23cc('0x36')]);_0x342d5d[_0x23cc('0x37')]=qs[_0x23cc('0x38')](_[_0x23cc('0x39')](_0x2e7210[_0x23cc('0x30')],_0x22d753[_0x23cc('0x38')]),_0x42227a);if(_0x2e7210['query']['filter']){_0x342d5d[_0x23cc('0x37')]=_['merge'](_0x342d5d[_0x23cc('0x37')],{'$or':_['map'](_0x42227a,function(_0x4fdc14){if(_0x4fdc14[_0x23cc('0x3a')]!=='VIRTUAL'){var _0x137fc9={};_0x137fc9[_0x4fdc14['name']]={'$like':'%'+_0x2e7210[_0x23cc('0x30')][_0x23cc('0x3b')]+'%'};return _0x137fc9;}})});}_0x342d5d=_[_0x23cc('0x3c')]({},_0x342d5d,_0x2e7210[_0x23cc('0x3d')]);var _0x5881f7={'where':_0x342d5d[_0x23cc('0x37')]};return db['SmsApplication'][_0x23cc('0x1d')](_0x5881f7)[_0x23cc('0x25')](function(_0x7ce84a){_0x13ef14[_0x23cc('0x1d')]=_0x7ce84a;if(_0x2e7210['query']['includeAll']){_0x342d5d[_0x23cc('0x3e')]=[{'all':!![]}];}return db['SmsApplication'][_0x23cc('0x3f')](_0x342d5d);})[_0x23cc('0x25')](function(_0x18deed){_0x13ef14[_0x23cc('0x40')]=_0x18deed;return _0x13ef14;})[_0x23cc('0x25')](respondWithFilteredResult(_0x144154,_0x342d5d))['catch'](handleError(_0x144154,null));};exports[_0x23cc('0x41')]=function(_0x56d3ee,_0xbc5e97){var _0x2e5896={'raw':!![],'where':{'id':_0x56d3ee[_0x23cc('0x42')]['id']}},_0x52a481={};_0x52a481['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x52a481['query']=_[_0x23cc('0x31')](_0x56d3ee[_0x23cc('0x30')]);_0x52a481['filters']=_[_0x23cc('0x32')](_0x52a481[_0x23cc('0x2f')],_0x52a481[_0x23cc('0x30')]);_0x2e5896['attributes']=_[_0x23cc('0x32')](_0x52a481[_0x23cc('0x2f')],qs[_0x23cc('0x33')](_0x56d3ee[_0x23cc('0x30')][_0x23cc('0x33')]));_0x2e5896[_0x23cc('0x34')]=_0x2e5896['attributes'][_0x23cc('0x43')]?_0x2e5896[_0x23cc('0x34')]:_0x52a481['model'];if(_0x56d3ee[_0x23cc('0x30')]['includeAll']){_0x2e5896[_0x23cc('0x3e')]=[{'all':!![]}];}_0x2e5896=_[_0x23cc('0x3c')]({},_0x2e5896,_0x56d3ee[_0x23cc('0x3d')]);return db[_0x23cc('0x2b')][_0x23cc('0x44')](_0x2e5896)['then'](handleEntityNotFound(_0xbc5e97,null))[_0x23cc('0x25')](respondWithResult(_0xbc5e97,null))[_0x23cc('0x45')](handleError(_0xbc5e97,null));};exports[_0x23cc('0x46')]=function(_0x520e6c,_0x4515b4){return db[_0x23cc('0x2b')][_0x23cc('0x46')](_0x520e6c[_0x23cc('0x47')],{})[_0x23cc('0x25')](respondWithResult(_0x4515b4,0xc9))['catch'](handleError(_0x4515b4,null));};exports[_0x23cc('0x24')]=function(_0x5e3b65,_0x768b10){if(_0x5e3b65[_0x23cc('0x47')]['id']){delete _0x5e3b65[_0x23cc('0x47')]['id'];}return db[_0x23cc('0x2b')][_0x23cc('0x44')]({'where':{'id':_0x5e3b65[_0x23cc('0x42')]['id']}})[_0x23cc('0x25')](handleEntityNotFound(_0x768b10,null))[_0x23cc('0x25')](saveUpdates(_0x5e3b65['body'],null))[_0x23cc('0x25')](respondWithResult(_0x768b10,null))[_0x23cc('0x45')](handleError(_0x768b10,null));};exports[_0x23cc('0x48')]=function(_0x5c5c61,_0xf3489e){return db[_0x23cc('0x2b')]['find']({'where':{'id':_0x5c5c61[_0x23cc('0x42')]['id']}})['then'](handleEntityNotFound(_0xf3489e,null))['then'](removeEntity(_0xf3489e,null))['catch'](handleError(_0xf3489e,null));};
\ No newline at end of file
+var _0x1ad8=['undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsApplication','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1ad8,0x1bf));var _0x81ad=function(_0x3e1bf2,_0x11c1b0){_0x3e1bf2=_0x3e1bf2-0x0;var _0x4e2915=_0x1ad8[_0x3e1bf2];return _0x4e2915;};'use strict';var emlformat=require(_0x81ad('0x0'));var rimraf=require(_0x81ad('0x1'));var zipdir=require(_0x81ad('0x2'));var jsonpatch=require(_0x81ad('0x3'));var rp=require('request-promise');var moment=require(_0x81ad('0x4'));var BPromise=require(_0x81ad('0x5'));var Mustache=require(_0x81ad('0x6'));var util=require(_0x81ad('0x7'));var path=require(_0x81ad('0x8'));var sox=require(_0x81ad('0x9'));var csv=require(_0x81ad('0xa'));var ejs=require(_0x81ad('0xb'));var fs=require('fs');var fs_extra=require(_0x81ad('0xc'));var _=require(_0x81ad('0xd'));var squel=require(_0x81ad('0xe'));var crypto=require('crypto');var jsforce=require(_0x81ad('0xf'));var deskjs=require(_0x81ad('0x10'));var toCsv=require(_0x81ad('0xa'));var querystring=require(_0x81ad('0x11'));var Papa=require(_0x81ad('0x12'));var Redis=require(_0x81ad('0x13'));var authService=require(_0x81ad('0x14'));var qs=require(_0x81ad('0x15'));var as=require(_0x81ad('0x16'));var hardwareService=require(_0x81ad('0x17'));var logger=require(_0x81ad('0x18'))(_0x81ad('0x19'));var utils=require(_0x81ad('0x1a'));var config=require(_0x81ad('0x1b'));var licenseUtil=require(_0x81ad('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaeb04c,_0x4ce347){_0x4ce347=_0x4ce347||0xcc;return function(_0x5c15e2){if(_0x5c15e2){return _0xaeb04c[_0x81ad('0x1d')](_0x4ce347);}return _0xaeb04c[_0x81ad('0x1e')](_0x4ce347)['end']();};}function respondWithResult(_0x1dbb9d,_0x108024){_0x108024=_0x108024||0xc8;return function(_0x12bb38){if(_0x12bb38){return _0x1dbb9d[_0x81ad('0x1e')](_0x108024)[_0x81ad('0x1f')](_0x12bb38);}};}function respondWithFilteredResult(_0x343af4,_0x10e9b6){return function(_0x524fd5){if(_0x524fd5){var _0x4433ed=typeof _0x10e9b6[_0x81ad('0x20')]===_0x81ad('0x21')&&typeof _0x10e9b6[_0x81ad('0x22')]===_0x81ad('0x21');var _0x4e0d54=_0x524fd5[_0x81ad('0x23')];var _0x3312af=_0x4433ed?0x0:_0x10e9b6['offset'];var _0x161bef=_0x4433ed?_0x524fd5['count']:_0x10e9b6[_0x81ad('0x20')]+_0x10e9b6[_0x81ad('0x22')];var _0x4266a5;if(_0x161bef>=_0x4e0d54){_0x161bef=_0x4e0d54;_0x4266a5=0xc8;}else{_0x4266a5=0xce;}_0x343af4[_0x81ad('0x1e')](_0x4266a5);return _0x343af4[_0x81ad('0x24')](_0x81ad('0x25'),_0x3312af+'-'+_0x161bef+'/'+_0x4e0d54)[_0x81ad('0x1f')](_0x524fd5);}return null;};}function patchUpdates(_0x5230e7){return function(_0xa17912){try{jsonpatch['apply'](_0xa17912,_0x5230e7,!![]);}catch(_0x3f0368){return BPromise[_0x81ad('0x26')](_0x3f0368);}return _0xa17912['save']();};}function saveUpdates(_0x40c797,_0x54ca2c){return function(_0x1c9fa7){if(_0x1c9fa7){return _0x1c9fa7[_0x81ad('0x27')](_0x40c797)[_0x81ad('0x28')](function(_0xfd9377){return _0xfd9377;});}return null;};}function removeEntity(_0x50606b,_0x518ff3){return function(_0x133edb){if(_0x133edb){return _0x133edb[_0x81ad('0x29')]()[_0x81ad('0x28')](function(){_0x50606b['status'](0xcc)[_0x81ad('0x2a')]();});}};}function handleEntityNotFound(_0x45c292,_0x2f2df6){return function(_0x3797e6){if(!_0x3797e6){_0x45c292['sendStatus'](0x194);}return _0x3797e6;};}function handleError(_0x39563d,_0x4bd51f){_0x4bd51f=_0x4bd51f||0x1f4;return function(_0x5da67b){logger[_0x81ad('0x2b')](_0x5da67b['stack']);if(_0x5da67b['name']){delete _0x5da67b[_0x81ad('0x2c')];}_0x39563d[_0x81ad('0x1e')](_0x4bd51f)[_0x81ad('0x2d')](_0x5da67b);};}exports[_0x81ad('0x2e')]=function(_0x20df5d,_0x20b63a){var _0x42f6b4={},_0x507437={},_0x532988={'count':0x0,'rows':[]};var _0x4c0749=_[_0x81ad('0x2f')](db['SmsApplication'][_0x81ad('0x30')],function(_0x31a3a7){return{'name':_0x31a3a7['fieldName'],'type':_0x31a3a7[_0x81ad('0x31')][_0x81ad('0x32')]};});_0x507437[_0x81ad('0x33')]=_[_0x81ad('0x2f')](_0x4c0749,_0x81ad('0x2c'));_0x507437[_0x81ad('0x34')]=_[_0x81ad('0x35')](_0x20df5d[_0x81ad('0x34')]);_0x507437[_0x81ad('0x36')]=_[_0x81ad('0x37')](_0x507437[_0x81ad('0x33')],_0x507437[_0x81ad('0x34')]);_0x42f6b4[_0x81ad('0x38')]=_[_0x81ad('0x37')](_0x507437[_0x81ad('0x33')],qs[_0x81ad('0x39')](_0x20df5d[_0x81ad('0x34')]['fields']));_0x42f6b4['attributes']=_0x42f6b4['attributes']['length']?_0x42f6b4[_0x81ad('0x38')]:_0x507437[_0x81ad('0x33')];if(!_0x20df5d[_0x81ad('0x34')][_0x81ad('0x3a')](_0x81ad('0x3b'))){_0x42f6b4['limit']=qs[_0x81ad('0x22')](_0x20df5d[_0x81ad('0x34')][_0x81ad('0x22')]);_0x42f6b4[_0x81ad('0x20')]=qs['offset'](_0x20df5d[_0x81ad('0x34')][_0x81ad('0x20')]);}_0x42f6b4[_0x81ad('0x3c')]=qs[_0x81ad('0x3d')](_0x20df5d['query']['sort']);_0x42f6b4[_0x81ad('0x3e')]=qs[_0x81ad('0x36')](_[_0x81ad('0x3f')](_0x20df5d['query'],_0x507437[_0x81ad('0x36')]),_0x4c0749);if(_0x20df5d[_0x81ad('0x34')][_0x81ad('0x40')]){_0x42f6b4[_0x81ad('0x3e')]=_[_0x81ad('0x41')](_0x42f6b4[_0x81ad('0x3e')],{'$or':_[_0x81ad('0x2f')](_0x4c0749,function(_0x2049b1){if(_0x2049b1[_0x81ad('0x31')]!==_0x81ad('0x42')){var _0x5b9b17={};_0x5b9b17[_0x2049b1['name']]={'$like':'%'+_0x20df5d['query'][_0x81ad('0x40')]+'%'};return _0x5b9b17;}})});}_0x42f6b4=_[_0x81ad('0x41')]({},_0x42f6b4,_0x20df5d[_0x81ad('0x43')]);var _0x5053e0={'where':_0x42f6b4['where']};return db[_0x81ad('0x44')][_0x81ad('0x23')](_0x5053e0)['then'](function(_0x349664){_0x532988['count']=_0x349664;if(_0x20df5d[_0x81ad('0x34')]['includeAll']){_0x42f6b4[_0x81ad('0x45')]=[{'all':!![]}];}return db[_0x81ad('0x44')][_0x81ad('0x46')](_0x42f6b4);})[_0x81ad('0x28')](function(_0x36743e){_0x532988[_0x81ad('0x47')]=_0x36743e;return _0x532988;})[_0x81ad('0x28')](respondWithFilteredResult(_0x20b63a,_0x42f6b4))[_0x81ad('0x48')](handleError(_0x20b63a,null));};exports[_0x81ad('0x49')]=function(_0x5643c8,_0x4d56c3){var _0x3c42ab={'raw':!![],'where':{'id':_0x5643c8[_0x81ad('0x4a')]['id']}},_0x5da000={};_0x5da000[_0x81ad('0x33')]=_[_0x81ad('0x35')](db[_0x81ad('0x44')][_0x81ad('0x30')]);_0x5da000['query']=_[_0x81ad('0x35')](_0x5643c8['query']);_0x5da000['filters']=_['intersection'](_0x5da000[_0x81ad('0x33')],_0x5da000[_0x81ad('0x34')]);_0x3c42ab[_0x81ad('0x38')]=_[_0x81ad('0x37')](_0x5da000[_0x81ad('0x33')],qs[_0x81ad('0x39')](_0x5643c8['query'][_0x81ad('0x39')]));_0x3c42ab['attributes']=_0x3c42ab[_0x81ad('0x38')][_0x81ad('0x4b')]?_0x3c42ab['attributes']:_0x5da000[_0x81ad('0x33')];if(_0x5643c8[_0x81ad('0x34')][_0x81ad('0x4c')]){_0x3c42ab[_0x81ad('0x45')]=[{'all':!![]}];}_0x3c42ab=_[_0x81ad('0x41')]({},_0x3c42ab,_0x5643c8[_0x81ad('0x43')]);return db[_0x81ad('0x44')]['find'](_0x3c42ab)[_0x81ad('0x28')](handleEntityNotFound(_0x4d56c3,null))['then'](respondWithResult(_0x4d56c3,null))[_0x81ad('0x48')](handleError(_0x4d56c3,null));};exports[_0x81ad('0x4d')]=function(_0x2ac025,_0x5e3c3a){return db[_0x81ad('0x44')][_0x81ad('0x4d')](_0x2ac025[_0x81ad('0x4e')],{})[_0x81ad('0x28')](respondWithResult(_0x5e3c3a,0xc9))[_0x81ad('0x48')](handleError(_0x5e3c3a,null));};exports[_0x81ad('0x27')]=function(_0x52aa5e,_0x17a722){if(_0x52aa5e[_0x81ad('0x4e')]['id']){delete _0x52aa5e[_0x81ad('0x4e')]['id'];}return db[_0x81ad('0x44')]['find']({'where':{'id':_0x52aa5e[_0x81ad('0x4a')]['id']}})[_0x81ad('0x28')](handleEntityNotFound(_0x17a722,null))[_0x81ad('0x28')](saveUpdates(_0x52aa5e[_0x81ad('0x4e')],null))[_0x81ad('0x28')](respondWithResult(_0x17a722,null))[_0x81ad('0x48')](handleError(_0x17a722,null));};exports[_0x81ad('0x29')]=function(_0x1b48e7,_0x2ffa25){return db[_0x81ad('0x44')][_0x81ad('0x4f')]({'where':{'id':_0x1b48e7[_0x81ad('0x4a')]['id']}})[_0x81ad('0x28')](handleEntityNotFound(_0x2ffa25,null))['then'](removeEntity(_0x2ffa25,null))['catch'](handleError(_0x2ffa25,null));};
\ No newline at end of file
index d1229ab..7d6adab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b40=['api','moment','bluebird','request-promise','path','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x463a78,_0x474e8f){var _0x33d958=function(_0x39cfe7){while(--_0x39cfe7){_0x463a78['push'](_0x463a78['shift']());}};_0x33d958(++_0x474e8f);}(_0x3b40,0x1e7));var _0x03b4=function(_0x562706,_0x5e10a1){_0x562706=_0x562706-0x0;var _0x26a972=_0x3b40[_0x562706];return _0x26a972;};'use strict';var _=require(_0x03b4('0x0'));var util=require(_0x03b4('0x1'));var logger=require(_0x03b4('0x2'))(_0x03b4('0x3'));var moment=require(_0x03b4('0x4'));var BPromise=require(_0x03b4('0x5'));var rp=require(_0x03b4('0x6'));var fs=require('fs');var path=require(_0x03b4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x03b4('0x8'));module[_0x03b4('0x9')]=function(_0x1cad24,_0x1ce930){return _0x1cad24[_0x03b4('0xa')](_0x03b4('0xb'),attributes,{'tableName':_0x03b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03b4('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa644=['moment','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util','../../config/logger','api'];(function(_0x4a3899,_0x2f7014){var _0x1f786b=function(_0x36302f){while(--_0x36302f){_0x4a3899['push'](_0x4a3899['shift']());}};_0x1f786b(++_0x2f7014);}(_0xa644,0x15b));var _0x4a64=function(_0x5a7500,_0x53236b){_0x5a7500=_0x5a7500-0x0;var _0x20993d=_0xa644[_0x5a7500];return _0x20993d;};'use strict';var _=require(_0x4a64('0x0'));var util=require(_0x4a64('0x1'));var logger=require(_0x4a64('0x2'))(_0x4a64('0x3'));var moment=require(_0x4a64('0x4'));var BPromise=require('bluebird');var rp=require(_0x4a64('0x5'));var fs=require('fs');var path=require(_0x4a64('0x6'));var rimraf=require(_0x4a64('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a64('0x8'));module[_0x4a64('0x9')]=function(_0x5985c5,_0x126a97){return _0x5985c5[_0x4a64('0xa')](_0x4a64('0xb'),attributes,{'tableName':_0x4a64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 693a161..19d7e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf108=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf108,0x1d9));var _0x8f10=function(_0x14788d,_0x256f14){_0x14788d=_0x14788d-0x0;var _0x2d5019=_0xf108[_0x14788d];return _0x2d5019;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var moment=require(_0x8f10('0x1'));var BPromise=require(_0x8f10('0x2'));var rs=require(_0x8f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f10('0x4'))(_0x8f10('0x5'));var config=require(_0x8f10('0x6'));var jayson=require(_0x8f10('0x7'));var client=jayson[_0x8f10('0x8')][_0x8f10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212efc,_0x38b45f,_0x9cf8af){return new BPromise(function(_0x22e5df,_0x3a5d06){return client['request'](_0x212efc,_0x9cf8af)[_0x8f10('0xa')](function(_0x1787d2){logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,_0x8f10('0xd'));logger[_0x8f10('0xe')](_0x8f10('0xf'),_0x38b45f,_0x8f10('0xd'),JSON[_0x8f10('0x10')](_0x1787d2));if(_0x1787d2[_0x8f10('0x11')]){if(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x12')]===0x1f4){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')]['message']);return _0x3a5d06(_0x1787d2['error'][_0x8f10('0x13')]);}logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);return _0x22e5df(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);}else{logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,'request\x20sent');_0x22e5df(_0x1787d2[_0x8f10('0x14')][_0x8f10('0x13')]);}})[_0x8f10('0x15')](function(_0x52aafc){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x52aafc);_0x3a5d06(_0x52aafc);});});}
\ No newline at end of file
+var _0x2cc4=['client','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x558472,_0x27ffcf){var _0x37e917=function(_0x5759cd){while(--_0x5759cd){_0x558472['push'](_0x558472['shift']());}};_0x37e917(++_0x27ffcf);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0x2cc4[_0x8af54b];return _0x27d8f0;};'use strict';var _=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var moment=require(_0x42cc('0x2'));var BPromise=require(_0x42cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42cc('0x4'));var db=require(_0x42cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x42cc('0x6'));var jayson=require(_0x42cc('0x7'));var client=jayson[_0x42cc('0x8')][_0x42cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2348b1,_0x5f2d27,_0x1fac7b){return new BPromise(function(_0x3b686b,_0x3a64ba){return client['request'](_0x2348b1,_0x1fac7b)['then'](function(_0xef766b){logger[_0x42cc('0xa')](_0x42cc('0xb'),_0x5f2d27,_0x42cc('0xc'));logger[_0x42cc('0xd')](_0x42cc('0xe'),_0x5f2d27,_0x42cc('0xc'),JSON[_0x42cc('0xf')](_0xef766b));if(_0xef766b[_0x42cc('0x10')]){if(_0xef766b[_0x42cc('0x10')][_0x42cc('0x11')]===0x1f4){logger[_0x42cc('0x10')]('SmsApplication,\x20%s,\x20%s',_0x5f2d27,_0xef766b['error']['message']);return _0x3a64ba(_0xef766b[_0x42cc('0x10')][_0x42cc('0x12')]);}logger[_0x42cc('0x10')]('SmsApplication,\x20%s,\x20%s',_0x5f2d27,_0xef766b[_0x42cc('0x10')]['message']);return _0x3b686b(_0xef766b[_0x42cc('0x10')]['message']);}else{logger[_0x42cc('0xa')](_0x42cc('0xb'),_0x5f2d27,_0x42cc('0xc'));_0x3b686b(_0xef766b[_0x42cc('0x13')][_0x42cc('0x12')]);}})[_0x42cc('0x14')](function(_0x4245de){logger[_0x42cc('0x10')](_0x42cc('0xb'),_0x5f2d27,_0x4245de);_0x3a64ba(_0x4245de);});});}
\ No newline at end of file
index 0c272b0..44490be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c00=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags'];(function(_0x50d623,_0x438635){var _0x4904e0=function(_0xa21bd5){while(--_0xa21bd5){_0x50d623['push'](_0x50d623['shift']());}};_0x4904e0(++_0x438635);}(_0x9c00,0x1a0));var _0x09c0=function(_0x299089,_0x3cff81){_0x299089=_0x299089-0x0;var _0x11c91f=_0x9c00[_0x299089];return _0x11c91f;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0x8')](_0x09c0('0xf'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0x11')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x11')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x11')](_0x09c0('0x14'),auth[_0x09c0('0xa')](),interaction[_0x09c0('0x15')](_0x09c0('0x16'),_0x09c0('0x17')),controller[_0x09c0('0x18')]);router[_0x09c0('0x19')](_0x09c0('0x1a'),auth['isAuthenticated'](),interaction['tracked']('sms',_0x09c0('0x1b')),controller[_0x09c0('0x1c')]);router[_0x09c0('0x1d')](_0x09c0('0x1a'),auth['isAuthenticated'](),interaction[_0x09c0('0x15')]('sms','smsinteraction:destroy'),controller[_0x09c0('0x1e')]);router['delete'](_0x09c0('0x14'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0xbaf0=['sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked'];(function(_0x124cef,_0x5bae92){var _0x26372f=function(_0x4af3e0){while(--_0x4af3e0){_0x124cef['push'](_0x124cef['shift']());}};_0x26372f(++_0x5bae92);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0baf('0x12')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x13')]);router['post'](_0x0baf('0x14'),auth['isAuthenticated'](),interaction[_0x0baf('0x15')](_0x0baf('0x16'),_0x0baf('0x17')),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')](_0x0baf('0x1a'),auth['isAuthenticated'](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1b')),controller[_0x0baf('0x1c')]);router[_0x0baf('0x1d')](_0x0baf('0x1a'),auth[_0x0baf('0xa')](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1e')),controller[_0x0baf('0x1f')]);router[_0x0baf('0x1d')](_0x0baf('0x14'),auth[_0x0baf('0xa')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index 61b0c7e..0883407 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c42=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x5231ea,_0x621cf0){var _0x191d52=function(_0x586c7c){while(--_0x586c7c){_0x5231ea['push'](_0x5231ea['shift']());}};_0x191d52(++_0x621cf0);}(_0x0c42,0x191));var _0x20c4=function(_0x385c5b,_0xc99168){_0x385c5b=_0x385c5b-0x0;var _0x4ee332=_0x0c42[_0x385c5b];return _0x4ee332;};'use strict';var Sequelize=require(_0x20c4('0x0'));var moment=require(_0x20c4('0x1'));module[_0x20c4('0x2')]={'closed':{'type':Sequelize[_0x20c4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x20c4('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x20c4('0x5')]},'note':{'type':Sequelize[_0x20c4('0x5')]},'phone':{'type':Sequelize[_0x20c4('0x5')]},'read1stAt':{'type':Sequelize[_0x20c4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x20c4('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x20c4('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x20c4('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x5bd7=['STRING','DATE','ENUM','out','moment','exports','BOOLEAN'];(function(_0x1ebc4a,_0x1b148e){var _0x134d9e=function(_0x31145c){while(--_0x31145c){_0x1ebc4a['push'](_0x1ebc4a['shift']());}};_0x134d9e(++_0x1b148e);}(_0x5bd7,0x12a));var _0x75bd=function(_0xdcbb4a,_0x1df11c){_0xdcbb4a=_0xdcbb4a-0x0;var _0x40f4db=_0x5bd7[_0xdcbb4a];return _0x40f4db;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x75bd('0x0'));module[_0x75bd('0x1')]={'closed':{'type':Sequelize[_0x75bd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x75bd('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x75bd('0x3')]},'note':{'type':Sequelize[_0x75bd('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x75bd('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x75bd('0x5')]('in',_0x75bd('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x75bd('0x5')]('in',_0x75bd('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x75bd('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 3b3f2fb..dd623b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a08=['fields','length','nolimit','order','sort','where','pick','select','field','color','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','i.id','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','direction','secret','SmsAccount','Account','get','Sms','Owner','N.A.','createdAt','closedAt','disposition','System','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','unlinkSync','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','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','offset','limit','undefined','count','status','Content-Range','json','apply','save','update','destroy','then','end','error','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','UserId','closed','total','index','SmsInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x40597a,_0x30410d){var _0x423296=function(_0x116441){while(--_0x116441){_0x40597a['push'](_0x40597a['shift']());}};_0x423296(++_0x30410d);}(_0x5a08,0x189));var _0x85a0=function(_0x526939,_0x3ad68b){_0x526939=_0x526939-0x0;var _0x34b3ff=_0x5a08[_0x526939];return _0x34b3ff;};'use strict';var emlformat=require(_0x85a0('0x0'));var rimraf=require(_0x85a0('0x1'));var zipdir=require(_0x85a0('0x2'));var jsonpatch=require(_0x85a0('0x3'));var rp=require(_0x85a0('0x4'));var moment=require(_0x85a0('0x5'));var BPromise=require(_0x85a0('0x6'));var Mustache=require(_0x85a0('0x7'));var util=require(_0x85a0('0x8'));var path=require(_0x85a0('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x85a0('0xa'));var fs=require('fs');var fs_extra=require(_0x85a0('0xb'));var _=require(_0x85a0('0xc'));var squel=require(_0x85a0('0xd'));var crypto=require(_0x85a0('0xe'));var jsforce=require(_0x85a0('0xf'));var deskjs=require(_0x85a0('0x10'));var toCsv=require(_0x85a0('0x11'));var querystring=require(_0x85a0('0x12'));var Papa=require(_0x85a0('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x85a0('0x14'));var as=require(_0x85a0('0x15'));var pdf=require(_0x85a0('0x16'));var hardwareService=require(_0x85a0('0x17'));var logger=require(_0x85a0('0x18'))(_0x85a0('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x85a0('0x1a'));var db=require('../../mysqldb')['db'];config[_0x85a0('0x1b')]=_[_0x85a0('0x1c')](config[_0x85a0('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x85a0('0x1d'))(new Redis(config[_0x85a0('0x1b')]));require(_0x85a0('0x1e'))[_0x85a0('0x1f')](socket);function respondWithStatusCode(_0x4bc456,_0x541de8){_0x541de8=_0x541de8||0xcc;return function(_0x4aabda){if(_0x4aabda){return _0x4bc456[_0x85a0('0x20')](_0x541de8);}return _0x4bc456['status'](_0x541de8)['end']();};}function respondWithResult(_0x5b1781,_0x364cd2){_0x364cd2=_0x364cd2||0xc8;return function(_0x19fe08){if(_0x19fe08){return _0x5b1781['status'](_0x364cd2)['json'](_0x19fe08);}};}function respondWithFilteredResult(_0x141585,_0x56b842){return function(_0x3510b3){if(_0x3510b3){var _0xf7a958=typeof _0x56b842[_0x85a0('0x21')]==='undefined'&&typeof _0x56b842[_0x85a0('0x22')]===_0x85a0('0x23');var _0x18e8ab=_0x3510b3['count'];var _0x28741b=_0xf7a958?0x0:_0x56b842[_0x85a0('0x21')];var _0x349e51=_0xf7a958?_0x3510b3[_0x85a0('0x24')]:_0x56b842['offset']+_0x56b842[_0x85a0('0x22')];var _0x1f92ca;if(_0x349e51>=_0x18e8ab){_0x349e51=_0x18e8ab;_0x1f92ca=0xc8;}else{_0x1f92ca=0xce;}_0x141585[_0x85a0('0x25')](_0x1f92ca);return _0x141585['set'](_0x85a0('0x26'),_0x28741b+'-'+_0x349e51+'/'+_0x18e8ab)[_0x85a0('0x27')](_0x3510b3);}return null;};}function patchUpdates(_0x23f359){return function(_0x4b67b7){try{jsonpatch[_0x85a0('0x28')](_0x4b67b7,_0x23f359,!![]);}catch(_0x3521fb){return BPromise['reject'](_0x3521fb);}return _0x4b67b7[_0x85a0('0x29')]();};}function saveUpdates(_0x477732,_0x53947f){return function(_0x4990a7){if(_0x4990a7){return _0x4990a7[_0x85a0('0x2a')](_0x477732)['then'](function(_0x33a452){return _0x33a452;});}return null;};}function removeEntity(_0x20fecf,_0xcbbcad){return function(_0x509d7e){if(_0x509d7e){return _0x509d7e[_0x85a0('0x2b')]()[_0x85a0('0x2c')](function(){_0x20fecf[_0x85a0('0x25')](0xcc)[_0x85a0('0x2d')]();});}};}function handleEntityNotFound(_0x28f5ac,_0x1f7436){return function(_0x42649d){if(!_0x42649d){_0x28f5ac[_0x85a0('0x20')](0x194);}return _0x42649d;};}function handleError(_0x380fb4,_0x382e32){_0x382e32=_0x382e32||0x1f4;return function(_0x2b6bba){logger[_0x85a0('0x2e')](_0x2b6bba['stack']);if(_0x2b6bba[_0x85a0('0x2f')]){delete _0x2b6bba[_0x85a0('0x2f')];}_0x380fb4[_0x85a0('0x25')](_0x382e32)[_0x85a0('0x30')](_0x2b6bba);};}function getInteractionUsers(_0x46ce45,_0x467274){return new BPromise(function(_0x18110e,_0x4a2f49){try{if(_0x467274[_0x46ce45['id']]){_0x46ce45[_0x85a0('0x31')]=_[_0x85a0('0x32')](_0x467274[_0x46ce45['id']],function(_0x39546c){return{'id':_0x39546c['id'],'fullname':_0x39546c['fullname']};});}}catch(_0x5c4275){_0x4a2f49(_0x5c4275);}_0x18110e(_0x46ce45);});}function getInteractionTags(_0x326337,_0x5d6976){return new BPromise(function(_0x50e124,_0x234bab){try{if(_0x326337[_0x85a0('0x33')]){_0x326337[_0x85a0('0x34')]=[];_0x326337[_0x85a0('0x33')][_0x85a0('0x35')](',')[_0x85a0('0x36')](function(_0x1603d8){_0x326337[_0x85a0('0x34')][_0x85a0('0x37')](_0x5d6976[_0x1603d8]);});}delete _0x326337[_0x85a0('0x33')];}catch(_0xbcd19c){_0x234bab(_0xbcd19c);}_0x50e124(_0x326337);});}function updateSmsInteraction(_0x16d76c,_0x2c4462,_0x32635d){return new BPromise(function(_0x599760,_0x3a4174){return getInteractionUsers(_0x16d76c,_0x32635d)[_0x85a0('0x2c')](function(_0x3f22f3){return getInteractionTags(_0x3f22f3,_0x2c4462);})[_0x85a0('0x2c')](function(_0x14dff7){return getStateInteraction(_0x14dff7);})['then'](function(_0x2ea73e){_0x599760(_0x2ea73e);})[_0x85a0('0x38')](function(_0x33460d){_0x3a4174(_0x33460d);});});}function getStateInteraction(_0x47fa0){return new BPromise(function(_0x1e1c87){_0x47fa0[_0x85a0('0x39')]=0x0;_0x47fa0[_0x85a0('0x3a')]=0x0;_0x47fa0[_0x85a0('0x3b')]=0x0;_0x47fa0[_0x85a0('0x3c')]=0x0;_0x47fa0['total']=0x0;if(!_0x47fa0['closed']&&!_0x47fa0[_0x85a0('0x3d')]){_0x47fa0['waiting']+=0x1;}if(!_0x47fa0[_0x85a0('0x3e')]&&_0x47fa0['UserId']){_0x47fa0[_0x85a0('0x3a')]+=0x1;if(_0x47fa0[_0x85a0('0x39')]){_0x47fa0[_0x85a0('0x39')]-=0x1;}}if(_0x47fa0['closed']&&_0x47fa0[_0x85a0('0x3d')]){_0x47fa0[_0x85a0('0x3b')]+=0x1;if(_0x47fa0[_0x85a0('0x3a')]){_0x47fa0[_0x85a0('0x3a')]-=0x1;}}if(_0x47fa0[_0x85a0('0x3e')]&&!_0x47fa0[_0x85a0('0x3d')]){_0x47fa0[_0x85a0('0x3c')]+=0x1;if(_0x47fa0['waiting']){_0x47fa0[_0x85a0('0x39')]-=0x1;}}_0x47fa0[_0x85a0('0x3f')]+=0x1;_0x1e1c87(_0x47fa0);});}exports[_0x85a0('0x40')]=function(_0x131d97,_0x3aba81){var _0x288100={},_0x42414b={},_0x26437a={'count':0x0,'rows':[]};var _0xf432b4=_[_0x85a0('0x32')](db[_0x85a0('0x41')][_0x85a0('0x42')],function(_0x304b48){return{'name':_0x304b48['fieldName'],'type':_0x304b48[_0x85a0('0x43')][_0x85a0('0x44')]};});_0x42414b[_0x85a0('0x45')]=_['map'](_0xf432b4,_0x85a0('0x2f'));_0x42414b[_0x85a0('0x46')]=_[_0x85a0('0x47')](_0x131d97['query']);_0x42414b[_0x85a0('0x48')]=_[_0x85a0('0x49')](_0x42414b[_0x85a0('0x45')],_0x42414b[_0x85a0('0x46')]);_0x288100[_0x85a0('0x4a')]=_[_0x85a0('0x49')](_0x42414b[_0x85a0('0x45')],qs['fields'](_0x131d97[_0x85a0('0x46')][_0x85a0('0x4b')]));_0x288100[_0x85a0('0x4a')]=_0x288100[_0x85a0('0x4a')][_0x85a0('0x4c')]?_0x288100[_0x85a0('0x4a')]:_0x42414b['model'];if(!_0x131d97[_0x85a0('0x46')]['hasOwnProperty'](_0x85a0('0x4d'))){_0x288100['limit']=qs[_0x85a0('0x22')](_0x131d97[_0x85a0('0x46')]['limit']);_0x288100[_0x85a0('0x21')]=qs[_0x85a0('0x21')](_0x131d97[_0x85a0('0x46')][_0x85a0('0x21')]);}_0x288100[_0x85a0('0x4e')]=qs[_0x85a0('0x4f')](_0x131d97[_0x85a0('0x46')]['sort']);_0x288100[_0x85a0('0x50')]=qs['filters'](_[_0x85a0('0x51')](_0x131d97[_0x85a0('0x46')],_0x42414b[_0x85a0('0x48')]),_0xf432b4);var _0x36daf6=[];var _0x5dc8ed=squel[_0x85a0('0x52')]()[_0x85a0('0x53')]('id')[_0x85a0('0x53')](_0x85a0('0x2f'))['field'](_0x85a0('0x54'))['from']('tools_tags');var _0x5770b7=squel['select']()[_0x85a0('0x53')](_0x85a0('0x55'))[_0x85a0('0x53')](_0x85a0('0x56'))[_0x85a0('0x53')](_0x85a0('0x57'))[_0x85a0('0x58')](_0x85a0('0x59'),'ui')[_0x85a0('0x5a')](_0x85a0('0x5b'),'u',_0x85a0('0x5c'));var _0x1aac44=squel[_0x85a0('0x52')]()[_0x85a0('0x58')]('sms_interactions','i')[_0x85a0('0x5a')](_0x85a0('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x85a0('0x5a')](_0x85a0('0x5b'),'o',_0x85a0('0x5e'))['left_join']('sms_accounts','a',_0x85a0('0x5f'))['left_join']('sms_messages','me',_0x85a0('0x60'))[_0x85a0('0x5a')](_0x85a0('0x61'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x85a0('0x5a')](_0x85a0('0x62'),'t',_0x85a0('0x63'));var _0x42f8d7=squel[_0x85a0('0x64')]();var _0x53aa33=[];var _0x20a977=squel[_0x85a0('0x64')]();var _0x595928;if(_0x131d97[_0x85a0('0x46')][_0x85a0('0x65')]){_0x595928=as[_0x85a0('0x66')](_0x131d97[_0x85a0('0x46')][_0x85a0('0x65')]);var _0x2f5535=_0x595928[_0x85a0('0x67')];for(var _0x1aefab=0x0;_0x1aefab<_0x595928[_0x85a0('0x68')][_0x85a0('0x4c')];_0x1aefab++){var _0x39adc1=_0x595928[_0x85a0('0x68')][_0x1aefab];var _0x24462d='i';var _0xe0b4ca=_[_0x85a0('0x69')](_0xf432b4,['name',_0x39adc1[_0x85a0('0x53')]]);if(!_0xe0b4ca){switch(_0x39adc1['field']){case _0x85a0('0x6a'):if(_0x39adc1[_0x85a0('0x6b')]==0x1){_0x1aac44['having']('`'+_0x39adc1['field']+_0x85a0('0x6c'));}else{_0x1aac44[_0x85a0('0x6d')]('`'+_0x39adc1[_0x85a0('0x53')]+_0x85a0('0x6e'));}break;case _0x85a0('0x6f'):if(_0x39adc1[_0x85a0('0x70')]===_0x85a0('0x71')){if(_0x39adc1[_0x85a0('0x6b')][_0x85a0('0x35')]('\x20')['length']>0x1){_0x42f8d7[_0x2f5535](_0x85a0('0x72'),qs['getFullTextValue'](_0x39adc1['value']),null);}else{var _0x3f0a61='%'+_0x39adc1['value']+'%';_0x42f8d7[_0x2f5535](_0x85a0('0x73'),_0x3f0a61,_0x3f0a61,_0x3f0a61);}}else{_0xe0b4ca=_['find'](_0xf432b4,[_0x85a0('0x2f'),_0x85a0('0x74')]);_0x39adc1[_0x85a0('0x53')]=_0x85a0('0x74');_0x15f41e=as[_0x85a0('0x75')](_0x24462d,_0xe0b4ca[_0x85a0('0x43')],_0x39adc1);_0x42f8d7[_0x2f5535](_0x15f41e[_0x85a0('0x76')],_0x15f41e['value'][_0x85a0('0x77')],_0x15f41e[_0x85a0('0x6b')][_0x85a0('0x2d')]);}break;case'Tag':var _0x20a08f=_0x39adc1[_0x85a0('0x6b')][_0x85a0('0x35')](',')[_0x85a0('0x32')](function(_0x4f30d9){return Number(_0x4f30d9);});_0x20a08f[_0x85a0('0x36')](function(_0x370e2d){_0x20a977['or'](_0x85a0('0x78'),'%,'+_0x370e2d+',%');});_0x53aa33=_[_0x85a0('0x79')](_0x53aa33,_0x20a08f);break;case _0x85a0('0x7a'):if(_0x39adc1[_0x85a0('0x70')]===_0x85a0('0x71')){_0x42f8d7[_0x2f5535](_0x85a0('0x7b'),'%'+_0x39adc1['value']+'%',null);}else{_0xe0b4ca=_['find'](_0xf432b4,[_0x85a0('0x2f'),'UserId']);_0x39adc1[_0x85a0('0x53')]='UserId';_0x15f41e=as[_0x85a0('0x75')](_0x24462d,_0xe0b4ca[_0x85a0('0x43')],_0x39adc1);_0x42f8d7[_0x2f5535](_0x15f41e[_0x85a0('0x76')],_0x15f41e[_0x85a0('0x6b')][_0x85a0('0x77')],_0x15f41e[_0x85a0('0x6b')][_0x85a0('0x2d')]);}break;case _0x85a0('0x7c'):_0x15f41e=as[_0x85a0('0x75')]('me',null,_0x39adc1);_0x42f8d7[_0x2f5535](_0x15f41e['text'],_0x15f41e[_0x85a0('0x6b')][_0x85a0('0x77')],_0x15f41e[_0x85a0('0x6b')]['end']);break;}}else{var _0x15f41e=as[_0x85a0('0x75')](_0x24462d,_0xe0b4ca[_0x85a0('0x43')],_0x39adc1);_0x42f8d7[_0x2f5535](_0x15f41e[_0x85a0('0x76')],_0x15f41e[_0x85a0('0x6b')][_0x85a0('0x77')],_0x15f41e[_0x85a0('0x6b')]['end']);}}}else{var _0x3a5c91=_(_0x131d97['query'])[_0x85a0('0x47')]()[_0x85a0('0x32')](function(_0x4b17fc){return _['some'](_0xf432b4,[_0x85a0('0x2f'),_0x4b17fc])?_0x4b17fc:undefined;})['compact']()[_0x85a0('0x6b')]();if(!_[_0x85a0('0x7d')](_0x3a5c91)){_0x3a5c91[_0x85a0('0x36')](function(_0xc35f54){if(_0xc35f54===_0x85a0('0x7e')){_0x1aac44[_0x85a0('0x50')](_0x85a0('0x7f'),[][_0x85a0('0x80')](_0x131d97['query'][_0xc35f54]));}else if(_0xc35f54==='createdAt'){var _0x346b06=JSON[_0x85a0('0x81')](_0x131d97[_0x85a0('0x46')][_0xc35f54])[_0x85a0('0x82')];var _0x9d7690=JSON[_0x85a0('0x81')](_0x131d97[_0x85a0('0x46')][_0xc35f54])[_0x85a0('0x83')];_0x1aac44['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x346b06,_0x9d7690);}else{if(_0x131d97['query'][_0xc35f54]===_0x85a0('0x84')){_0x1aac44[_0x85a0('0x50')]('i.'+_0xc35f54+'\x20IS\x20NULL');}else{_0x1aac44[_0x85a0('0x50')]('i.'+_0xc35f54+_0x85a0('0x85'),_0x131d97[_0x85a0('0x46')][_0xc35f54]);}}});}if(_0x131d97['query'][_0x85a0('0x86')]){if(_0x131d97[_0x85a0('0x46')][_0x85a0('0x86')]==0x1){_0x1aac44['having']('`unreadMessages`\x20=\x200');}else{_0x1aac44['having'](_0x85a0('0x87'));}}if(_0x131d97[_0x85a0('0x46')][_0x85a0('0x88')]){_0x53aa33=_[_0x85a0('0x89')](_0x131d97[_0x85a0('0x46')][_0x85a0('0x88')])?_0x131d97[_0x85a0('0x46')][_0x85a0('0x88')]:new Array(_0x131d97[_0x85a0('0x46')][_0x85a0('0x88')]);_0x53aa33[_0x85a0('0x36')](function(_0xad815e){_0x20a977['or'](_0x85a0('0x78'),'%,'+_0xad815e+',%');});}if(_0x131d97[_0x85a0('0x46')][_0x85a0('0x8a')]){var _0x3a52a4=_0x131d97['query'][_0x85a0('0x8a')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x85a0('0x8b')](_0x3a52a4)){_0x42f8d7['or'](_0x85a0('0x8c'),_0x3a52a4+'%')['or'](_0x85a0('0x8d'),_0x3a52a4+'%');}else{_0x42f8d7['or'](_0x85a0('0x8e'),qs[_0x85a0('0x8f')](_0x3a52a4))['or'](_0x85a0('0x90'),_0x3a52a4+'%');}}}_0x1aac44[_0x85a0('0x50')](_0x42f8d7);_0x1aac44[_0x85a0('0x91')]('i.id');var _0x378ff0={'type':db['Sequelize'][_0x85a0('0x92')][_0x85a0('0x93')],'raw':!![]};var _0xd3d19a=_0x1aac44['clone']();_0xd3d19a[_0x85a0('0x53')](_0x85a0('0x94'));_0xd3d19a[_0x85a0('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x85a0('0x6a'));if(_0x288100['order']){_0x288100[_0x85a0('0x4e')][_0x85a0('0x36')](function(_0xc57da7){var _0x2721ec=_0xc57da7[0x0]==='contactName'?_0xc57da7[0x0]:'i.'+_0xc57da7[0x0];_0x1aac44[_0x85a0('0x4e')](_0x2721ec,_0xc57da7[0x1]===_0x85a0('0x95')?![]:!![]);});}if(!_[_0x85a0('0x7d')](_0x53aa33)){_0x1aac44[_0x85a0('0x6d')](_0x20a977);_0xd3d19a[_0x85a0('0x50')](_0x85a0('0x96'),_0x53aa33);}BPromise[_0x85a0('0x97')]()['then'](function(){if(!_0x595928){if(_0x131d97['query'][_0x85a0('0x7e')])return;_0xd3d19a['where'](_0x85a0('0x98'));_0x1aac44[_0x85a0('0x50')](_0x85a0('0x98'));return;}if(_0x131d97[_0x85a0('0x99')][_0x85a0('0x9a')]!==_0x85a0('0x9b'))return;return _0x131d97[_0x85a0('0x99')][_0x85a0('0x9c')]({'attributes':['id'],'raw':!![]})[_0x85a0('0x2c')](function(_0xd75dd){if(_[_0x85a0('0x7d')](_0xd75dd)){_0xd3d19a[_0x85a0('0x50')](_0x85a0('0x9d'));_0x1aac44[_0x85a0('0x50')](_0x85a0('0x9d'));}else{_0xd3d19a[_0x85a0('0x50')](_0x85a0('0x7f'),_['map'](_0xd75dd,'id'));_0x1aac44[_0x85a0('0x50')](_0x85a0('0x7f'),_[_0x85a0('0x32')](_0xd75dd,'id'));}});})['then'](function(){if(_0x131d97[_0x85a0('0x99')][_0x85a0('0x9a')]===_0x85a0('0x9b')&&!_0x595928&&!_0x131d97[_0x85a0('0x46')]['SmsAccountId'])return[];return db[_0x85a0('0x9e')][_0x85a0('0x46')](_0xd3d19a[_0x85a0('0x9f')](),_0x378ff0);})[_0x85a0('0x2c')](function(_0x5006f0){_0x26437a[_0x85a0('0x24')]=_0x5006f0[_0x85a0('0x4c')];if(_0x26437a[_0x85a0('0x24')]===0x0)return[];return db[_0x85a0('0x9e')][_0x85a0('0x46')](_0x5dc8ed[_0x85a0('0x9f')](),_0x378ff0)[_0x85a0('0x2c')](function(_0x27800d){_0x36daf6=_['keyBy'](_0x27800d,'id');_0x378ff0=_[_0x85a0('0xa0')](_0x378ff0,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x131d97[_0x85a0('0x46')]['fields']){_0x288100[_0x85a0('0x4a')][_0x85a0('0x36')](function(_0x152096){_0x1aac44['field']('i.'+_0x152096);});}else{_0x1aac44[_0x85a0('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x85a0('0x6a'));_0x1aac44[_0x85a0('0x53')]('a.key','Account.key');_0x1aac44[_0x85a0('0x53')](_0x85a0('0xa1'),_0x85a0('0xa2'));_0x1aac44['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','contactName');_0x1aac44[_0x85a0('0x53')]('i.*');_0x1aac44[_0x85a0('0x53')](_0x85a0('0xa3'),_0x85a0('0xa4'));_0x1aac44[_0x85a0('0x53')](_0x85a0('0xa5'),'Contact.lastName');_0x1aac44[_0x85a0('0x53')](_0x85a0('0xa6'),_0x85a0('0xa7'));_0x1aac44[_0x85a0('0x53')](_0x85a0('0xa8'),_0x85a0('0xa9'));_0x1aac44[_0x85a0('0x53')]('c.mobile','Contact.mobile');_0x1aac44[_0x85a0('0x53')](_0x85a0('0xaa'),_0x85a0('0xab'));_0x1aac44[_0x85a0('0x53')]('o.fullname',_0x85a0('0xac'));_0x1aac44['field'](_0x85a0('0xad'),_0x85a0('0xae'));_0x1aac44[_0x85a0('0x53')](_0x85a0('0xaf'),_0x85a0('0x33'));}if(_0x288100[_0x85a0('0x22')])_0x1aac44[_0x85a0('0x22')](_0x288100[_0x85a0('0x22')]);if(_0x288100['offset'])_0x1aac44[_0x85a0('0x21')](_0x288100['offset']);return db[_0x85a0('0x9e')][_0x85a0('0x46')](_0x1aac44['toString'](),_0x378ff0);})['then'](function(_0x1c733c){if(_0x1c733c['length']>0x0)_0x5770b7[_0x85a0('0x50')](_0x85a0('0xb0'),_[_0x85a0('0x32')](_0x1c733c,'id'));return db[_0x85a0('0x9e')]['query'](_0x5770b7[_0x85a0('0x9f')](),_0x378ff0)[_0x85a0('0x2c')](function(_0x58000d){var _0x47993a=_[_0x85a0('0xb1')](_0x58000d,_0x85a0('0xb2'));var _0x509dea=[];_0x1c733c[_0x85a0('0x36')](function(_0x291ae0){_0x509dea[_0x85a0('0x37')](updateSmsInteraction(_0x291ae0,_0x36daf6,_0x47993a));});return BPromise[_0x85a0('0xb3')](_0x509dea);});});})[_0x85a0('0x2c')](function(_0x3fefb7){_0x26437a[_0x85a0('0xb4')]=_0x3fefb7;return _0x26437a;})[_0x85a0('0x2c')](respondWithFilteredResult(_0x3aba81,_0x288100))['catch'](handleError(_0x3aba81,null));};exports['show']=function(_0x5a1be2,_0x5fa19c){var _0x4be019={'raw':![],'where':{'id':_0x5a1be2[_0x85a0('0xb5')]['id']}},_0x4d730d={};_0x4d730d[_0x85a0('0x45')]=_['keys'](db[_0x85a0('0x41')][_0x85a0('0x42')]);_0x4d730d[_0x85a0('0x46')]=_[_0x85a0('0x47')](_0x5a1be2[_0x85a0('0x46')]);_0x4d730d[_0x85a0('0x48')]=_[_0x85a0('0x49')](_0x4d730d[_0x85a0('0x45')],_0x4d730d[_0x85a0('0x46')]);_0x4be019['attributes']=_['intersection'](_0x4d730d[_0x85a0('0x45')],qs[_0x85a0('0x4b')](_0x5a1be2[_0x85a0('0x46')]['fields']));_0x4be019[_0x85a0('0x4a')]=_0x4be019[_0x85a0('0x4a')][_0x85a0('0x4c')]?_0x4be019[_0x85a0('0x4a')]:_0x4d730d[_0x85a0('0x45')];if(_0x5a1be2[_0x85a0('0x46')][_0x85a0('0xb6')]){_0x4be019[_0x85a0('0xb7')]=[{'all':!![]}];}_0x4be019=_['merge']({},_0x4be019,_0x5a1be2[_0x85a0('0xb8')]);return db['SmsInteraction'][_0x85a0('0x69')](_0x4be019)['then'](handleEntityNotFound(_0x5fa19c,null))['then'](respondWithResult(_0x5fa19c,null))[_0x85a0('0x38')](handleError(_0x5fa19c,null));};exports[_0x85a0('0xb9')]=function(_0x58775f,_0x1fa606){return db[_0x85a0('0x41')][_0x85a0('0xb9')](_0x58775f[_0x85a0('0x7c')],{})[_0x85a0('0x2c')](respondWithResult(_0x1fa606,0xc9))['catch'](handleError(_0x1fa606,null));};exports['update']=function(_0x573017,_0xa4baa9){if(_0x573017[_0x85a0('0x7c')]['id']){delete _0x573017[_0x85a0('0x7c')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x573017[_0x85a0('0xb5')]['id']}})[_0x85a0('0x2c')](handleEntityNotFound(_0xa4baa9,null))['then'](saveUpdates(_0x573017[_0x85a0('0x7c')],null))[_0x85a0('0x2c')](respondWithResult(_0xa4baa9,null))[_0x85a0('0x38')](handleError(_0xa4baa9,null));};exports[_0x85a0('0x2b')]=function(_0x336e65,_0x558848){return db[_0x85a0('0x41')][_0x85a0('0x69')]({'where':{'id':_0x336e65[_0x85a0('0xb5')]['id']}})['then'](handleEntityNotFound(_0x558848,null))[_0x85a0('0x2c')](removeEntity(_0x558848,null))[_0x85a0('0x38')](handleError(_0x558848,null));};exports[_0x85a0('0xba')]=function(_0x5446c7,_0xc7cce9){return db[_0x85a0('0x41')]['describe']()[_0x85a0('0x2c')](respondWithResult(_0xc7cce9,null))[_0x85a0('0x38')](handleError(_0xc7cce9,null));};exports[_0x85a0('0xbb')]=function(_0x194dfd,_0x2bfec3,_0x1ef3d5){return db[_0x85a0('0xbc')][_0x85a0('0x69')]({'where':{'id':_0x194dfd[_0x85a0('0xb5')]['id']}})[_0x85a0('0x2c')](handleEntityNotFound(_0x2bfec3,null))[_0x85a0('0x2c')](function(_0x3bc5d2){if(_0x3bc5d2){return _0x3bc5d2[_0x85a0('0xbb')](_0x194dfd[_0x85a0('0x7c')][_0x85a0('0xbd')],_[_0x85a0('0xbe')](_0x194dfd['body'],[_0x85a0('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x2bfec3,null))[_0x85a0('0x38')](handleError(_0x2bfec3,null));};exports[_0x85a0('0xbf')]=function(_0x4f9463,_0x44e6e5,_0x47432c){var _0x54a7df={'raw':![],'where':{}};var _0x5ad291={};var _0x5cfdaa={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x85a0('0xc0')]({'where':{'id':_0x4f9463[_0x85a0('0xb5')]['id']}})[_0x85a0('0x2c')](handleEntityNotFound(_0x44e6e5,null))[_0x85a0('0x2c')](function(_0x3fba51){if(_0x3fba51){_0x5ad291[_0x85a0('0x45')]=_['keys'](db[_0x85a0('0xbc')][_0x85a0('0x42')]);_0x5ad291['query']=_[_0x85a0('0x47')](_0x4f9463[_0x85a0('0x46')]);_0x5ad291[_0x85a0('0x48')]=_[_0x85a0('0x49')](_0x5ad291[_0x85a0('0x45')],_0x5ad291[_0x85a0('0x46')]);_0x54a7df[_0x85a0('0x4a')]=_[_0x85a0('0x49')](_0x5ad291['model'],qs[_0x85a0('0x4b')](_0x4f9463[_0x85a0('0x46')][_0x85a0('0x4b')]));_0x54a7df[_0x85a0('0x4a')]=_0x54a7df['attributes']['length']?_0x54a7df[_0x85a0('0x4a')]:_0x5ad291[_0x85a0('0x45')];if(!_0x4f9463[_0x85a0('0x46')][_0x85a0('0xc1')](_0x85a0('0x4d'))){_0x54a7df[_0x85a0('0x22')]=qs[_0x85a0('0x22')](_0x4f9463[_0x85a0('0x46')][_0x85a0('0x22')]);_0x54a7df[_0x85a0('0x21')]=qs[_0x85a0('0x21')](_0x4f9463[_0x85a0('0x46')][_0x85a0('0x21')]);}_0x54a7df[_0x85a0('0x4e')]=qs[_0x85a0('0x4f')](_0x4f9463[_0x85a0('0x46')][_0x85a0('0x4f')]);_0x54a7df['where']=qs[_0x85a0('0x48')](_['pick'](_0x4f9463['query'],_0x5ad291[_0x85a0('0x48')]));_0x54a7df[_0x85a0('0x50')][_0x85a0('0xb2')]=_0x3fba51['id'];if(_0x4f9463[_0x85a0('0x46')][_0x85a0('0x8a')]){_0x54a7df[_0x85a0('0x50')]=_[_0x85a0('0xa0')](_0x54a7df[_0x85a0('0x50')],{'$or':_[_0x85a0('0x32')](_0x54a7df[_0x85a0('0x4a')],function(_0x55e0ca){var _0x583559={};_0x583559[_0x55e0ca]={'$like':'%'+_0x4f9463[_0x85a0('0x46')][_0x85a0('0x8a')]+'%'};return _0x583559;})});}if(_0x4f9463[_0x85a0('0x46')][_0x85a0('0x82')]){var _0x1fece5=_0x4f9463[_0x85a0('0x46')][_0x85a0('0x82')]['split'](',');var _0x23f5fb={};_0x23f5fb[_0x1fece5[0x0]]={'$gte':moment(_0x1fece5[0x1])['format'](_0x85a0('0xc2'))};_0x54a7df[_0x85a0('0x50')]=_[_0x85a0('0xa0')](_0x54a7df[_0x85a0('0x50')],_0x23f5fb);}_0x54a7df=_[_0x85a0('0xa0')]({},_0x54a7df,_0x4f9463[_0x85a0('0xb8')]);return db[_0x85a0('0xbc')][_0x85a0('0x24')]({'where':_0x54a7df[_0x85a0('0x50')]})[_0x85a0('0x2c')](function(_0x30eac9){_0x5cfdaa[_0x85a0('0x24')]=_0x30eac9;if(_0x4f9463['query'][_0x85a0('0xb6')]){_0x54a7df[_0x85a0('0xb7')]=[{'all':!![]}];}return db[_0x85a0('0xbc')][_0x85a0('0xc3')](_0x54a7df);})[_0x85a0('0x2c')](function(_0x3ab640){_0x5cfdaa[_0x85a0('0xb4')]=_0x3ab640;return _0x5cfdaa;});}})[_0x85a0('0x2c')](respondWithFilteredResult(_0x44e6e5,_0x54a7df))[_0x85a0('0x38')](handleError(_0x44e6e5,null));};exports[_0x85a0('0xc4')]=function(_0x51d0dd,_0x622ad,_0x5ae613){return db[_0x85a0('0x41')][_0x85a0('0x69')]({'where':{'id':_0x51d0dd[_0x85a0('0xb5')]['id']}})['then'](handleEntityNotFound(_0x622ad,null))[_0x85a0('0x2c')](function(_0x16ce83){if(_0x16ce83){return _0x16ce83['setTags'](_0x51d0dd['body'][_0x85a0('0xbd')],_['omit'](_0x51d0dd['body'],[_0x85a0('0xbd'),'id'])||{})[_0x85a0('0xc5')](function(){return db['Tag'][_0x85a0('0xc3')]({'attributes':['id',_0x85a0('0x2f'),'color'],'where':{'id':_0x51d0dd['body']['ids']}});})['then'](function(_0x22c23f){socket[_0x85a0('0xc6')](_0x85a0('0xc7'),{'id':Number(_0x51d0dd[_0x85a0('0xb5')]['id']),'tags':_0x22c23f||[]});return{'id':Number(_0x51d0dd[_0x85a0('0xb5')]['id']),'tags':_0x22c23f||[]};});}})['then'](respondWithResult(_0x622ad,null))[_0x85a0('0x38')](handleError(_0x622ad,null));};exports['removeTags']=function(_0x5b4410,_0x352941,_0x5d6b60){return db['SmsInteraction'][_0x85a0('0x69')]({'where':{'id':_0x5b4410[_0x85a0('0xb5')]['id']}})[_0x85a0('0x2c')](handleEntityNotFound(_0x352941,null))[_0x85a0('0x2c')](function(_0x280328){if(_0x280328){return _0x280328[_0x85a0('0xc8')](_0x5b4410[_0x85a0('0x46')][_0x85a0('0xbd')]);}})['then'](respondWithStatusCode(_0x352941,null))[_0x85a0('0x38')](handleError(_0x352941,null));};exports[_0x85a0('0xc9')]=function(_0x1cbca1,_0x3b5a98){var _0x1d7158=moment()[_0x85a0('0xca')]()['toString']();var _0xfa41ae=path[_0x85a0('0xcb')](config[_0x85a0('0xcc')],_0x85a0('0xcd'),'files',_0x85a0('0xce'));var _0x5ca1d6=path['join'](config[_0x85a0('0xcc')],_0x85a0('0xcd'),_0x85a0('0xcf'),_0x85a0('0xd0'));var _0x5e2246=path[_0x85a0('0xcb')](_0xfa41ae,_0x1d7158);var _0x461a41=util[_0x85a0('0xd1')](_0x85a0('0xd2'),_0x1cbca1['params']['id'],_0x1d7158);var _0x2deed8=path[_0x85a0('0xcb')](_0xfa41ae,_0x461a41);var _0x4516e8=[];_0x4516e8[_0x85a0('0x37')]({'model':db[_0x85a0('0x7a')],'as':_0x85a0('0x7a'),'attributes':['id',_0x85a0('0xd3')],'raw':!![]});_0x4516e8[_0x85a0('0x37')]({'model':db[_0x85a0('0xd4')],'as':'Contact','attributes':['id',_0x85a0('0xd5'),_0x85a0('0xd6')],'raw':!![]});var _0x2bb7a1=[{'model':db[_0x85a0('0xbc')],'as':'Messages','attributes':['id',_0x85a0('0x7c'),'createdAt',_0x85a0('0xd7'),_0x85a0('0xd8'),_0x85a0('0x86')],'include':_0x4516e8}];_0x2bb7a1['push']({'model':db[_0x85a0('0xd9')],'as':_0x85a0('0xda'),'attributes':['id',_0x85a0('0x2f')]});_0x2bb7a1['push']({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0x85a0('0x69')]({'where':{'id':_0x1cbca1['params']['id']},'include':_0x2bb7a1})[_0x85a0('0x2c')](handleEntityNotFound(_0x3b5a98,null))['then'](function(_0x387247){if(_0x387247){var _0x8fa260=_0x387247[_0x85a0('0xdb')]({'plain':!![]});fs['mkdirSync'](_0x5e2246);var _0x1d1457={'channel':_0x85a0('0xdc'),'account':_0x8fa260[_0x85a0('0xda')][_0x85a0('0x2f')],'agent':_0x8fa260[_0x85a0('0xdd')]?_0x8fa260[_0x85a0('0xdd')][_0x85a0('0xd3')]:_0x85a0('0xde'),'createdAt':moment(_0x8fa260[_0x85a0('0xdf')])[_0x85a0('0xd1')](_0x85a0('0xc2'))[_0x85a0('0x9f')](),'closedAt':_0x8fa260[_0x85a0('0x3e')]?moment(_0x8fa260[_0x85a0('0xe0')])[_0x85a0('0xd1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x85a0('0x9f')]():'','disposition':_0x8fa260[_0x85a0('0xe1')],'messages':_(_0x8fa260['Messages'])[_0x85a0('0x8a')]({'secret':![]})[_0x85a0('0x32')](function(_0x10506c){return{'date':moment(_0x10506c[_0x85a0('0xdf')])[_0x85a0('0xd1')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x10506c[_0x85a0('0xd7')]==='out'?_0x10506c[_0x85a0('0x7a')]?_0x10506c[_0x85a0('0x7a')][_0x85a0('0xd3')]:_0x85a0('0xe2'):_0x10506c[_0x85a0('0x6f')][_0x85a0('0xd5')]+(_0x10506c[_0x85a0('0x6f')][_0x85a0('0xd6')]?'\x20'+_0x10506c[_0x85a0('0x6f')][_0x85a0('0xd6')]:''),'body':_0x10506c['body'],'direction':_0x10506c['direction']===_0x85a0('0xe3')?'A':'C','secret':_0x10506c[_0x85a0('0xd8')],'read':_0x10506c['read']};})[_0x85a0('0x6b')]()};return ejs[_0x85a0('0xe4')](path[_0x85a0('0xcb')](config[_0x85a0('0xcc')],_0x85a0('0xcd'),_0x85a0('0xe5'),_0x85a0('0xe6')),{'interaction':_0x1d1457})[_0x85a0('0x2c')](function(_0x226660){var _0x26f568=path[_0x85a0('0xcb')](_0x5e2246,_0x85a0('0xe7')+_0x8fa260['id']+'-'+_0x1d7158+_0x85a0('0xe8'));var _0x252bfc={'path':_0x26f568,'channel':_0x85a0('0xdc'),'interactionId':_0x8fa260['id']};return pdf['createPdfFromHTML'](_0x226660,_0x252bfc);})[_0x85a0('0x2c')](function(){return new BPromise(function(_0x3c83cb,_0x3d348b){zipdir(_0x5e2246,{'saveTo':_0x2deed8},function(_0x341af9,_0x55ad0d){if(_0x341af9)return _0x3d348b(_0x341af9);return _0x3c83cb(_0x55ad0d);});})['then'](function(){return new BPromise(function(_0x5e377e,_0x20b9e2){rimraf(_0x5e2246,function(_0x48d7d3){if(_0x48d7d3)_0x20b9e2(_0x48d7d3);return _0x5e377e();});});})['then'](function(){return _0x3b5a98[_0x85a0('0xc9')](_0x2deed8,_0x461a41,function(_0x4ecaf1){if(_0x4ecaf1){console['log']('err',_0x4ecaf1);}else{fs[_0x85a0('0xe9')](_0x2deed8);}});});});}else{return _0x3b5a98[_0x85a0('0x20')](0xc8);}})[_0x85a0('0x38')](handleError(_0x3b5a98,null));};
\ No newline at end of file
+var _0x1722=['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?','Sequelize','QueryTypes','SELECT','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','agent','SmsAccountId','sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','include','merge','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','sort','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','findAll','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','fullname','firstName','lastName','Messages','direction','secret','Account','Owner','mkdirSync','N.A.','closedAt','disposition','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','TagIds','Tags','split','push','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','map','SmsInteraction','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','body','some','compact','isEmpty','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','forEach','filter','isNumeric'];(function(_0x2d53a6,_0x365e78){var _0x580bef=function(_0x47d00c){while(--_0x47d00c){_0x2d53a6['push'](_0x2d53a6['shift']());}};_0x580bef(++_0x365e78);}(_0x1722,0x152));var _0x2172=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1722[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x2172('0x0'));var rimraf=require(_0x2172('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2172('0x2'));var rp=require(_0x2172('0x3'));var moment=require(_0x2172('0x4'));var BPromise=require(_0x2172('0x5'));var Mustache=require(_0x2172('0x6'));var util=require(_0x2172('0x7'));var path=require(_0x2172('0x8'));var sox=require(_0x2172('0x9'));var csv=require(_0x2172('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2172('0xb'));var squel=require(_0x2172('0xc'));var crypto=require('crypto');var jsforce=require(_0x2172('0xd'));var deskjs=require(_0x2172('0xe'));var toCsv=require(_0x2172('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2172('0xf'));var authService=require(_0x2172('0x10'));var qs=require(_0x2172('0x11'));var as=require(_0x2172('0x12'));var pdf=require(_0x2172('0x13'));var hardwareService=require(_0x2172('0x14'));var logger=require(_0x2172('0x15'))(_0x2172('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2172('0x17'));var db=require(_0x2172('0x18'))['db'];config[_0x2172('0x19')]=_['defaults'](config['redis'],{'host':_0x2172('0x1a'),'port':0x18eb});var socket=require(_0x2172('0x1b'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x2172('0x1c')](socket);function respondWithStatusCode(_0x2b1e02,_0x309532){_0x309532=_0x309532||0xcc;return function(_0x6bbecf){if(_0x6bbecf){return _0x2b1e02[_0x2172('0x1d')](_0x309532);}return _0x2b1e02['status'](_0x309532)[_0x2172('0x1e')]();};}function respondWithResult(_0xa897fc,_0x13bce3){_0x13bce3=_0x13bce3||0xc8;return function(_0x2c1f07){if(_0x2c1f07){return _0xa897fc['status'](_0x13bce3)[_0x2172('0x1f')](_0x2c1f07);}};}function respondWithFilteredResult(_0x583125,_0x2c4d02){return function(_0x151417){if(_0x151417){var _0x408c96=typeof _0x2c4d02['offset']===_0x2172('0x20')&&typeof _0x2c4d02['limit']===_0x2172('0x20');var _0x35e492=_0x151417[_0x2172('0x21')];var _0x1ff79b=_0x408c96?0x0:_0x2c4d02[_0x2172('0x22')];var _0x5683bc=_0x408c96?_0x151417[_0x2172('0x21')]:_0x2c4d02[_0x2172('0x22')]+_0x2c4d02[_0x2172('0x23')];var _0x4eac95;if(_0x5683bc>=_0x35e492){_0x5683bc=_0x35e492;_0x4eac95=0xc8;}else{_0x4eac95=0xce;}_0x583125[_0x2172('0x24')](_0x4eac95);return _0x583125[_0x2172('0x25')](_0x2172('0x26'),_0x1ff79b+'-'+_0x5683bc+'/'+_0x35e492)[_0x2172('0x1f')](_0x151417);}return null;};}function patchUpdates(_0x1e1615){return function(_0x3ac581){try{jsonpatch[_0x2172('0x27')](_0x3ac581,_0x1e1615,!![]);}catch(_0x339cef){return BPromise[_0x2172('0x28')](_0x339cef);}return _0x3ac581[_0x2172('0x29')]();};}function saveUpdates(_0x2979b7,_0x6e27c){return function(_0x36a535){if(_0x36a535){return _0x36a535[_0x2172('0x2a')](_0x2979b7)[_0x2172('0x2b')](function(_0x57364d){return _0x57364d;});}return null;};}function removeEntity(_0x3bd840,_0x513149){return function(_0x2c8463){if(_0x2c8463){return _0x2c8463[_0x2172('0x2c')]()[_0x2172('0x2b')](function(){_0x3bd840[_0x2172('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b96b2,_0x56677a){return function(_0xc96b0){if(!_0xc96b0){_0x5b96b2['sendStatus'](0x194);}return _0xc96b0;};}function handleError(_0x5085f6,_0x44bcdd){_0x44bcdd=_0x44bcdd||0x1f4;return function(_0x5ee213){logger['error'](_0x5ee213[_0x2172('0x2d')]);if(_0x5ee213[_0x2172('0x2e')]){delete _0x5ee213[_0x2172('0x2e')];}_0x5085f6[_0x2172('0x24')](_0x44bcdd)[_0x2172('0x2f')](_0x5ee213);};}function getInteractionUsers(_0xdd2bed,_0x545ce2){return new BPromise(function(_0x2d3238,_0x2e58b6){try{if(_0x545ce2[_0xdd2bed['id']]){_0xdd2bed['Users']=_['map'](_0x545ce2[_0xdd2bed['id']],function(_0xc8c1ea){return{'id':_0xc8c1ea['id'],'fullname':_0xc8c1ea['fullname']};});}}catch(_0x1a96a2){_0x2e58b6(_0x1a96a2);}_0x2d3238(_0xdd2bed);});}function getInteractionTags(_0x25e8a7,_0x53ade5){return new BPromise(function(_0x5d1437,_0x4e4334){try{if(_0x25e8a7[_0x2172('0x30')]){_0x25e8a7[_0x2172('0x31')]=[];_0x25e8a7[_0x2172('0x30')][_0x2172('0x32')](',')['forEach'](function(_0x4598f6){_0x25e8a7[_0x2172('0x31')][_0x2172('0x33')](_0x53ade5[_0x4598f6]);});}delete _0x25e8a7[_0x2172('0x30')];}catch(_0x163e65){_0x4e4334(_0x163e65);}_0x5d1437(_0x25e8a7);});}function updateSmsInteraction(_0x4e258e,_0x412a8e,_0x2ddb02){return new BPromise(function(_0xfcf46d,_0x262d5f){return getInteractionUsers(_0x4e258e,_0x2ddb02)['then'](function(_0x36e133){return getInteractionTags(_0x36e133,_0x412a8e);})[_0x2172('0x2b')](function(_0x4700b4){return getStateInteraction(_0x4700b4);})['then'](function(_0x9a58de){_0xfcf46d(_0x9a58de);})[_0x2172('0x34')](function(_0x300216){_0x262d5f(_0x300216);});});}function getStateInteraction(_0x5e0c47){return new BPromise(function(_0x196886){_0x5e0c47[_0x2172('0x35')]=0x0;_0x5e0c47['talking']=0x0;_0x5e0c47[_0x2172('0x36')]=0x0;_0x5e0c47[_0x2172('0x37')]=0x0;_0x5e0c47[_0x2172('0x38')]=0x0;if(!_0x5e0c47[_0x2172('0x39')]&&!_0x5e0c47[_0x2172('0x3a')]){_0x5e0c47['waiting']+=0x1;}if(!_0x5e0c47[_0x2172('0x39')]&&_0x5e0c47[_0x2172('0x3a')]){_0x5e0c47[_0x2172('0x3b')]+=0x1;if(_0x5e0c47[_0x2172('0x35')]){_0x5e0c47['waiting']-=0x1;}}if(_0x5e0c47[_0x2172('0x39')]&&_0x5e0c47[_0x2172('0x3a')]){_0x5e0c47[_0x2172('0x36')]+=0x1;if(_0x5e0c47[_0x2172('0x3b')]){_0x5e0c47['talking']-=0x1;}}if(_0x5e0c47[_0x2172('0x39')]&&!_0x5e0c47[_0x2172('0x3a')]){_0x5e0c47[_0x2172('0x37')]+=0x1;if(_0x5e0c47['waiting']){_0x5e0c47[_0x2172('0x35')]-=0x1;}}_0x5e0c47['total']+=0x1;_0x196886(_0x5e0c47);});}exports[_0x2172('0x3c')]=function(_0x29ffa5,_0x1f053d){var _0x9d80fe={},_0x1c35f0={},_0x39d233={'count':0x0,'rows':[]};var _0x5c1e93=_[_0x2172('0x3d')](db[_0x2172('0x3e')][_0x2172('0x3f')],function(_0x4368e4){return{'name':_0x4368e4['fieldName'],'type':_0x4368e4[_0x2172('0x40')]['key']};});_0x1c35f0[_0x2172('0x41')]=_['map'](_0x5c1e93,_0x2172('0x2e'));_0x1c35f0[_0x2172('0x42')]=_[_0x2172('0x43')](_0x29ffa5[_0x2172('0x42')]);_0x1c35f0[_0x2172('0x44')]=_['intersection'](_0x1c35f0[_0x2172('0x41')],_0x1c35f0[_0x2172('0x42')]);_0x9d80fe[_0x2172('0x45')]=_[_0x2172('0x46')](_0x1c35f0[_0x2172('0x41')],qs[_0x2172('0x47')](_0x29ffa5[_0x2172('0x42')]['fields']));_0x9d80fe[_0x2172('0x45')]=_0x9d80fe['attributes'][_0x2172('0x48')]?_0x9d80fe[_0x2172('0x45')]:_0x1c35f0['model'];if(!_0x29ffa5[_0x2172('0x42')][_0x2172('0x49')](_0x2172('0x4a'))){_0x9d80fe[_0x2172('0x23')]=qs['limit'](_0x29ffa5[_0x2172('0x42')][_0x2172('0x23')]);_0x9d80fe[_0x2172('0x22')]=qs[_0x2172('0x22')](_0x29ffa5[_0x2172('0x42')]['offset']);}_0x9d80fe['order']=qs['sort'](_0x29ffa5['query']['sort']);_0x9d80fe[_0x2172('0x4b')]=qs[_0x2172('0x44')](_[_0x2172('0x4c')](_0x29ffa5['query'],_0x1c35f0['filters']),_0x5c1e93);var _0x243102=[];var _0x4b69e9=squel['select']()['field']('id')[_0x2172('0x4d')]('name')['field'](_0x2172('0x4e'))[_0x2172('0x4f')](_0x2172('0x50'));var _0x1a84a1=squel[_0x2172('0x51')]()[_0x2172('0x4d')](_0x2172('0x52'))[_0x2172('0x4d')](_0x2172('0x53'))[_0x2172('0x4d')](_0x2172('0x54'))[_0x2172('0x4f')](_0x2172('0x55'),'ui')[_0x2172('0x56')](_0x2172('0x57'),'u',_0x2172('0x58'));var _0x2e2633=squel[_0x2172('0x51')]()['from'](_0x2172('0x59'),'i')[_0x2172('0x56')](_0x2172('0x5a'),'c',_0x2172('0x5b'))['left_join'](_0x2172('0x57'),'o',_0x2172('0x5c'))[_0x2172('0x56')]('sms_accounts','a',_0x2172('0x5d'))[_0x2172('0x56')](_0x2172('0x5e'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0x2172('0x5f'),'it',_0x2172('0x60'))[_0x2172('0x56')](_0x2172('0x50'),'t',_0x2172('0x61'));var _0x2614ae=squel[_0x2172('0x62')]();var _0x2d2fd5=[];var _0x29b07d=squel[_0x2172('0x62')]();var _0x209cb6;if(_0x29ffa5[_0x2172('0x42')]['search']){_0x209cb6=as[_0x2172('0x63')](_0x29ffa5[_0x2172('0x42')][_0x2172('0x64')]);var _0x5ce432=_0x209cb6[_0x2172('0x65')];for(var _0x12ccf7=0x0;_0x12ccf7<_0x209cb6['conditions'][_0x2172('0x48')];_0x12ccf7++){var _0x1e6cc4=_0x209cb6[_0x2172('0x66')][_0x12ccf7];var _0x5f111a='i';var _0x40e6b4=_[_0x2172('0x67')](_0x5c1e93,[_0x2172('0x2e'),_0x1e6cc4[_0x2172('0x4d')]]);if(!_0x40e6b4){switch(_0x1e6cc4[_0x2172('0x4d')]){case'unreadMessages':if(_0x1e6cc4[_0x2172('0x68')]==0x1){_0x2e2633[_0x2172('0x69')]('`'+_0x1e6cc4[_0x2172('0x4d')]+_0x2172('0x6a'));}else{_0x2e2633[_0x2172('0x69')]('`'+_0x1e6cc4[_0x2172('0x4d')]+_0x2172('0x6b'));}break;case _0x2172('0x6c'):if(_0x1e6cc4['operator']===_0x2172('0x6d')){if(_0x1e6cc4['value'][_0x2172('0x32')]('\x20')['length']>0x1){_0x2614ae[_0x5ce432](_0x2172('0x6e'),qs[_0x2172('0x6f')](_0x1e6cc4[_0x2172('0x68')]),null);}else{var _0x2c1903='%'+_0x1e6cc4[_0x2172('0x68')]+'%';_0x2614ae[_0x5ce432](_0x2172('0x70'),_0x2c1903,_0x2c1903,_0x2c1903);}}else{_0x40e6b4=_[_0x2172('0x67')](_0x5c1e93,[_0x2172('0x2e'),_0x2172('0x71')]);_0x1e6cc4[_0x2172('0x4d')]=_0x2172('0x71');_0x11b47d=as['buildExpression'](_0x5f111a,_0x40e6b4[_0x2172('0x40')],_0x1e6cc4);_0x2614ae[_0x5ce432](_0x11b47d[_0x2172('0x72')],_0x11b47d[_0x2172('0x68')]['start'],_0x11b47d[_0x2172('0x68')][_0x2172('0x1e')]);}break;case _0x2172('0x73'):var _0x59c70b=_0x1e6cc4[_0x2172('0x68')][_0x2172('0x32')](',')[_0x2172('0x3d')](function(_0x5de4be){return Number(_0x5de4be);});_0x59c70b['forEach'](function(_0x44d81b){_0x29b07d['or'](_0x2172('0x74'),'%,'+_0x44d81b+',%');});_0x2d2fd5=_[_0x2172('0x75')](_0x2d2fd5,_0x59c70b);break;case _0x2172('0x76'):if(_0x1e6cc4['operator']===_0x2172('0x6d')){_0x2614ae[_0x5ce432](_0x2172('0x77'),'%'+_0x1e6cc4[_0x2172('0x68')]+'%',null);}else{_0x40e6b4=_[_0x2172('0x67')](_0x5c1e93,[_0x2172('0x2e'),_0x2172('0x3a')]);_0x1e6cc4[_0x2172('0x4d')]='UserId';_0x11b47d=as[_0x2172('0x78')](_0x5f111a,_0x40e6b4[_0x2172('0x40')],_0x1e6cc4);_0x2614ae[_0x5ce432](_0x11b47d[_0x2172('0x72')],_0x11b47d[_0x2172('0x68')][_0x2172('0x79')],_0x11b47d[_0x2172('0x68')][_0x2172('0x1e')]);}break;case _0x2172('0x7a'):_0x11b47d=as[_0x2172('0x78')]('me',null,_0x1e6cc4);_0x2614ae[_0x5ce432](_0x11b47d['text'],_0x11b47d['value']['start'],_0x11b47d[_0x2172('0x68')]['end']);break;}}else{var _0x11b47d=as[_0x2172('0x78')](_0x5f111a,_0x40e6b4[_0x2172('0x40')],_0x1e6cc4);_0x2614ae[_0x5ce432](_0x11b47d[_0x2172('0x72')],_0x11b47d[_0x2172('0x68')][_0x2172('0x79')],_0x11b47d[_0x2172('0x68')][_0x2172('0x1e')]);}}}else{var _0x24e651=_(_0x29ffa5[_0x2172('0x42')])['keys']()[_0x2172('0x3d')](function(_0x2d7fa6){return _[_0x2172('0x7b')](_0x5c1e93,[_0x2172('0x2e'),_0x2d7fa6])?_0x2d7fa6:undefined;})[_0x2172('0x7c')]()[_0x2172('0x68')]();if(!_[_0x2172('0x7d')](_0x24e651)){_0x24e651['forEach'](function(_0x8ffb1f){if(_0x8ffb1f==='SmsAccountId'){_0x2e2633['where']('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x29ffa5[_0x2172('0x42')][_0x8ffb1f]));}else if(_0x8ffb1f===_0x2172('0x7e')){var _0x548a54=JSON[_0x2172('0x7f')](_0x29ffa5[_0x2172('0x42')][_0x8ffb1f])[_0x2172('0x80')];var _0x2d3079=JSON[_0x2172('0x7f')](_0x29ffa5[_0x2172('0x42')][_0x8ffb1f])[_0x2172('0x81')];_0x2e2633[_0x2172('0x4b')](_0x2172('0x82'),_0x548a54,_0x2d3079);}else{if(_0x29ffa5[_0x2172('0x42')][_0x8ffb1f]===_0x2172('0x83')){_0x2e2633[_0x2172('0x4b')]('i.'+_0x8ffb1f+_0x2172('0x84'));}else{_0x2e2633[_0x2172('0x4b')]('i.'+_0x8ffb1f+'\x20=\x20?',_0x29ffa5[_0x2172('0x42')][_0x8ffb1f]);}}});}if(_0x29ffa5[_0x2172('0x42')]['read']){if(_0x29ffa5['query'][_0x2172('0x85')]==0x1){_0x2e2633[_0x2172('0x69')]('`unreadMessages`\x20=\x200');}else{_0x2e2633[_0x2172('0x69')](_0x2172('0x86'));}}if(_0x29ffa5[_0x2172('0x42')]['tag']){_0x2d2fd5=_[_0x2172('0x87')](_0x29ffa5['query'][_0x2172('0x88')])?_0x29ffa5[_0x2172('0x42')][_0x2172('0x88')]:new Array(_0x29ffa5[_0x2172('0x42')][_0x2172('0x88')]);_0x2d2fd5[_0x2172('0x89')](function(_0x415c3c){_0x29b07d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x415c3c+',%');});}if(_0x29ffa5[_0x2172('0x42')][_0x2172('0x8a')]){var _0x54beaa=_0x29ffa5[_0x2172('0x42')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2172('0x8b')](_0x54beaa)){_0x2614ae['or'](_0x2172('0x8c'),_0x54beaa+'%')['or'](_0x2172('0x8d'),_0x54beaa+'%');}else{_0x2614ae['or'](_0x2172('0x8e'),qs[_0x2172('0x6f')](_0x54beaa))['or'](_0x2172('0x8f'),_0x54beaa+'%');}}}_0x2e2633[_0x2172('0x4b')](_0x2614ae);_0x2e2633['group']('i.id');var _0x3c8952={'type':db[_0x2172('0x90')][_0x2172('0x91')][_0x2172('0x92')],'raw':!![]};var _0x5eea70=_0x2e2633['clone']();_0x5eea70[_0x2172('0x4d')]('i.id');_0x5eea70[_0x2172('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2172('0x93'));if(_0x9d80fe[_0x2172('0x94')]){_0x9d80fe[_0x2172('0x94')][_0x2172('0x89')](function(_0x2b7716){var _0x352ba7=_0x2b7716[0x0]===_0x2172('0x95')?_0x2b7716[0x0]:'i.'+_0x2b7716[0x0];_0x2e2633['order'](_0x352ba7,_0x2b7716[0x1]===_0x2172('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x2d2fd5)){_0x2e2633[_0x2172('0x69')](_0x29b07d);_0x5eea70[_0x2172('0x4b')](_0x2172('0x97'),_0x2d2fd5);}BPromise[_0x2172('0x98')]()[_0x2172('0x2b')](function(){if(!_0x209cb6){if(_0x29ffa5[_0x2172('0x42')]['SmsAccountId'])return;_0x5eea70[_0x2172('0x4b')](_0x2172('0x99'));_0x2e2633[_0x2172('0x4b')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x29ffa5[_0x2172('0x9a')][_0x2172('0x9b')]!=='agent')return;return _0x29ffa5[_0x2172('0x9a')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x52bbab){if(_['isEmpty'](_0x52bbab)){_0x5eea70[_0x2172('0x4b')](_0x2172('0x9c'));_0x2e2633[_0x2172('0x4b')](_0x2172('0x9c'));}else{_0x5eea70[_0x2172('0x4b')](_0x2172('0x9d'),_['map'](_0x52bbab,'id'));_0x2e2633[_0x2172('0x4b')]('i.SmsAccountId\x20IN\x20?',_[_0x2172('0x3d')](_0x52bbab,'id'));}});})[_0x2172('0x2b')](function(){if(_0x29ffa5[_0x2172('0x9a')][_0x2172('0x9b')]===_0x2172('0x9e')&&!_0x209cb6&&!_0x29ffa5['query'][_0x2172('0x9f')])return[];return db[_0x2172('0xa0')][_0x2172('0x42')](_0x5eea70['toString'](),_0x3c8952);})['then'](function(_0x17eec6){_0x39d233[_0x2172('0x21')]=_0x17eec6[_0x2172('0x48')];if(_0x39d233[_0x2172('0x21')]===0x0)return[];return db[_0x2172('0xa0')][_0x2172('0x42')](_0x4b69e9['toString'](),_0x3c8952)[_0x2172('0x2b')](function(_0x2ab7bc){_0x243102=_['keyBy'](_0x2ab7bc,'id');_0x3c8952=_['merge'](_0x3c8952,{'model':db[_0x2172('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x29ffa5[_0x2172('0x42')][_0x2172('0x47')]){_0x9d80fe[_0x2172('0x45')][_0x2172('0x89')](function(_0xdbbb5){_0x2e2633[_0x2172('0x4d')]('i.'+_0xdbbb5);});}else{_0x2e2633[_0x2172('0x4d')](_0x2172('0xa1'),'unreadMessages');_0x2e2633['field']('a.key',_0x2172('0xa2'));_0x2e2633['field'](_0x2172('0xa3'),_0x2172('0xa4'));_0x2e2633[_0x2172('0x4d')](_0x2172('0xa5'),'contactName');_0x2e2633['field'](_0x2172('0xa6'));_0x2e2633['field'](_0x2172('0xa7'),'Contact.firstName');_0x2e2633[_0x2172('0x4d')]('c.lastName',_0x2172('0xa8'));_0x2e2633['field'](_0x2172('0xa9'),_0x2172('0xaa'));_0x2e2633['field'](_0x2172('0xab'),'Contact.phone');_0x2e2633['field'](_0x2172('0xac'),_0x2172('0xad'));_0x2e2633[_0x2172('0x4d')](_0x2172('0xae'),_0x2172('0xaf'));_0x2e2633[_0x2172('0x4d')](_0x2172('0xb0'),_0x2172('0xb1'));_0x2e2633[_0x2172('0x4d')](_0x2172('0xb2'),_0x2172('0xb3'));_0x2e2633[_0x2172('0x4d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2172('0x30'));}if(_0x9d80fe[_0x2172('0x23')])_0x2e2633[_0x2172('0x23')](_0x9d80fe[_0x2172('0x23')]);if(_0x9d80fe[_0x2172('0x22')])_0x2e2633[_0x2172('0x22')](_0x9d80fe['offset']);return db[_0x2172('0xa0')][_0x2172('0x42')](_0x2e2633[_0x2172('0xb4')](),_0x3c8952);})[_0x2172('0x2b')](function(_0x176463){if(_0x176463[_0x2172('0x48')]>0x0)_0x1a84a1[_0x2172('0x4b')](_0x2172('0xb5'),_[_0x2172('0x3d')](_0x176463,'id'));return db[_0x2172('0xa0')][_0x2172('0x42')](_0x1a84a1['toString'](),_0x3c8952)[_0x2172('0x2b')](function(_0x1dec0d){var _0x11f2a1=_[_0x2172('0xb6')](_0x1dec0d,_0x2172('0xb7'));var _0x2b3f29=[];_0x176463[_0x2172('0x89')](function(_0x181b5d){_0x2b3f29['push'](updateSmsInteraction(_0x181b5d,_0x243102,_0x11f2a1));});return BPromise[_0x2172('0xb8')](_0x2b3f29);});});})[_0x2172('0x2b')](function(_0x122ee8){_0x39d233[_0x2172('0xb9')]=_0x122ee8;return _0x39d233;})[_0x2172('0x2b')](respondWithFilteredResult(_0x1f053d,_0x9d80fe))[_0x2172('0x34')](handleError(_0x1f053d,null));};exports[_0x2172('0xba')]=function(_0x28e46e,_0x10669c){var _0x23d3e4={'raw':![],'where':{'id':_0x28e46e[_0x2172('0xbb')]['id']}},_0x13294f={};_0x13294f[_0x2172('0x41')]=_[_0x2172('0x43')](db[_0x2172('0x3e')]['rawAttributes']);_0x13294f['query']=_[_0x2172('0x43')](_0x28e46e[_0x2172('0x42')]);_0x13294f['filters']=_[_0x2172('0x46')](_0x13294f[_0x2172('0x41')],_0x13294f[_0x2172('0x42')]);_0x23d3e4[_0x2172('0x45')]=_[_0x2172('0x46')](_0x13294f[_0x2172('0x41')],qs[_0x2172('0x47')](_0x28e46e[_0x2172('0x42')][_0x2172('0x47')]));_0x23d3e4[_0x2172('0x45')]=_0x23d3e4['attributes'][_0x2172('0x48')]?_0x23d3e4[_0x2172('0x45')]:_0x13294f[_0x2172('0x41')];if(_0x28e46e[_0x2172('0x42')]['includeAll']){_0x23d3e4[_0x2172('0xbc')]=[{'all':!![]}];}_0x23d3e4=_[_0x2172('0xbd')]({},_0x23d3e4,_0x28e46e[_0x2172('0xbe')]);return db['SmsInteraction'][_0x2172('0x67')](_0x23d3e4)[_0x2172('0x2b')](handleEntityNotFound(_0x10669c,null))[_0x2172('0x2b')](respondWithResult(_0x10669c,null))['catch'](handleError(_0x10669c,null));};exports[_0x2172('0xbf')]=function(_0x30e990,_0x5ad36f){return db[_0x2172('0x3e')][_0x2172('0xbf')](_0x30e990[_0x2172('0x7a')],{})[_0x2172('0x2b')](respondWithResult(_0x5ad36f,0xc9))[_0x2172('0x34')](handleError(_0x5ad36f,null));};exports['update']=function(_0x196bb2,_0x21e0ff){if(_0x196bb2['body']['id']){delete _0x196bb2['body']['id'];}return db[_0x2172('0x3e')][_0x2172('0x67')]({'where':{'id':_0x196bb2['params']['id']}})[_0x2172('0x2b')](handleEntityNotFound(_0x21e0ff,null))[_0x2172('0x2b')](saveUpdates(_0x196bb2[_0x2172('0x7a')],null))[_0x2172('0x2b')](respondWithResult(_0x21e0ff,null))[_0x2172('0x34')](handleError(_0x21e0ff,null));};exports[_0x2172('0x2c')]=function(_0x265611,_0x4ed468){return db[_0x2172('0x3e')][_0x2172('0x67')]({'where':{'id':_0x265611[_0x2172('0xbb')]['id']}})[_0x2172('0x2b')](handleEntityNotFound(_0x4ed468,null))[_0x2172('0x2b')](removeEntity(_0x4ed468,null))[_0x2172('0x34')](handleError(_0x4ed468,null));};exports[_0x2172('0xc0')]=function(_0x1a073f,_0x216ab0){return db['SmsInteraction'][_0x2172('0xc0')]()[_0x2172('0x2b')](respondWithResult(_0x216ab0,null))['catch'](handleError(_0x216ab0,null));};exports[_0x2172('0xc1')]=function(_0x1ccbc2,_0x116160,_0x15284b){return db[_0x2172('0xc2')][_0x2172('0x67')]({'where':{'id':_0x1ccbc2[_0x2172('0xbb')]['id']}})[_0x2172('0x2b')](handleEntityNotFound(_0x116160,null))[_0x2172('0x2b')](function(_0x47195b){if(_0x47195b){return _0x47195b[_0x2172('0xc1')](_0x1ccbc2[_0x2172('0x7a')][_0x2172('0xc3')],_[_0x2172('0xc4')](_0x1ccbc2['body'],[_0x2172('0xc3'),'id'])||{});}})['then'](respondWithResult(_0x116160,null))[_0x2172('0x34')](handleError(_0x116160,null));};exports[_0x2172('0xc5')]=function(_0xb3cb3d,_0x419a50,_0x1a3361){var _0x23134e={'raw':![],'where':{}};var _0x21d053={};var _0x5b35e4={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x2172('0xc6')]({'where':{'id':_0xb3cb3d['params']['id']}})[_0x2172('0x2b')](handleEntityNotFound(_0x419a50,null))[_0x2172('0x2b')](function(_0x39abbf){if(_0x39abbf){_0x21d053[_0x2172('0x41')]=_[_0x2172('0x43')](db[_0x2172('0xc2')][_0x2172('0x3f')]);_0x21d053[_0x2172('0x42')]=_[_0x2172('0x43')](_0xb3cb3d[_0x2172('0x42')]);_0x21d053[_0x2172('0x44')]=_[_0x2172('0x46')](_0x21d053[_0x2172('0x41')],_0x21d053[_0x2172('0x42')]);_0x23134e[_0x2172('0x45')]=_[_0x2172('0x46')](_0x21d053['model'],qs[_0x2172('0x47')](_0xb3cb3d[_0x2172('0x42')][_0x2172('0x47')]));_0x23134e[_0x2172('0x45')]=_0x23134e[_0x2172('0x45')][_0x2172('0x48')]?_0x23134e['attributes']:_0x21d053[_0x2172('0x41')];if(!_0xb3cb3d[_0x2172('0x42')][_0x2172('0x49')](_0x2172('0x4a'))){_0x23134e[_0x2172('0x23')]=qs['limit'](_0xb3cb3d[_0x2172('0x42')][_0x2172('0x23')]);_0x23134e[_0x2172('0x22')]=qs[_0x2172('0x22')](_0xb3cb3d['query']['offset']);}_0x23134e[_0x2172('0x94')]=qs[_0x2172('0xc7')](_0xb3cb3d[_0x2172('0x42')][_0x2172('0xc7')]);_0x23134e[_0x2172('0x4b')]=qs[_0x2172('0x44')](_['pick'](_0xb3cb3d[_0x2172('0x42')],_0x21d053[_0x2172('0x44')]));_0x23134e[_0x2172('0x4b')]['SmsInteractionId']=_0x39abbf['id'];if(_0xb3cb3d[_0x2172('0x42')][_0x2172('0x8a')]){_0x23134e[_0x2172('0x4b')]=_[_0x2172('0xbd')](_0x23134e[_0x2172('0x4b')],{'$or':_['map'](_0x23134e[_0x2172('0x45')],function(_0x528173){var _0x2036b8={};_0x2036b8[_0x528173]={'$like':'%'+_0xb3cb3d[_0x2172('0x42')][_0x2172('0x8a')]+'%'};return _0x2036b8;})});}if(_0xb3cb3d[_0x2172('0x42')][_0x2172('0x80')]){var _0x4772df=_0xb3cb3d[_0x2172('0x42')][_0x2172('0x80')][_0x2172('0x32')](',');var _0x599cee={};_0x599cee[_0x4772df[0x0]]={'$gte':moment(_0x4772df[0x1])[_0x2172('0xc8')](_0x2172('0xc9'))};_0x23134e[_0x2172('0x4b')]=_['merge'](_0x23134e[_0x2172('0x4b')],_0x599cee);}_0x23134e=_[_0x2172('0xbd')]({},_0x23134e,_0xb3cb3d[_0x2172('0xbe')]);return db[_0x2172('0xc2')][_0x2172('0x21')]({'where':_0x23134e['where']})[_0x2172('0x2b')](function(_0x28d541){_0x5b35e4[_0x2172('0x21')]=_0x28d541;if(_0xb3cb3d[_0x2172('0x42')][_0x2172('0xca')]){_0x23134e[_0x2172('0xbc')]=[{'all':!![]}];}return db[_0x2172('0xc2')]['findAll'](_0x23134e);})[_0x2172('0x2b')](function(_0x33ab71){_0x5b35e4[_0x2172('0xb9')]=_0x33ab71;return _0x5b35e4;});}})[_0x2172('0x2b')](respondWithFilteredResult(_0x419a50,_0x23134e))['catch'](handleError(_0x419a50,null));};exports[_0x2172('0xcb')]=function(_0x2f098c,_0x3c0d2f,_0x56cbb8){return db[_0x2172('0x3e')]['find']({'where':{'id':_0x2f098c[_0x2172('0xbb')]['id']}})[_0x2172('0x2b')](handleEntityNotFound(_0x3c0d2f,null))[_0x2172('0x2b')](function(_0x504a71){if(_0x504a71){return _0x504a71[_0x2172('0xcc')](_0x2f098c[_0x2172('0x7a')]['ids'],_['omit'](_0x2f098c[_0x2172('0x7a')],['ids','id'])||{})['spread'](function(){return db[_0x2172('0x73')][_0x2172('0xcd')]({'attributes':['id',_0x2172('0x2e'),_0x2172('0x4e')],'where':{'id':_0x2f098c[_0x2172('0x7a')][_0x2172('0xc3')]}});})[_0x2172('0x2b')](function(_0x4c7840){socket[_0x2172('0xce')](_0x2172('0xcf'),{'id':Number(_0x2f098c['params']['id']),'tags':_0x4c7840||[]});return{'id':Number(_0x2f098c[_0x2172('0xbb')]['id']),'tags':_0x4c7840||[]};});}})['then'](respondWithResult(_0x3c0d2f,null))[_0x2172('0x34')](handleError(_0x3c0d2f,null));};exports[_0x2172('0xd0')]=function(_0x32a4b7,_0x2267d4,_0x2c7756){return db[_0x2172('0x3e')][_0x2172('0x67')]({'where':{'id':_0x32a4b7[_0x2172('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2267d4,null))['then'](function(_0x221f49){if(_0x221f49){return _0x221f49[_0x2172('0xd0')](_0x32a4b7[_0x2172('0x42')][_0x2172('0xc3')]);}})[_0x2172('0x2b')](respondWithStatusCode(_0x2267d4,null))[_0x2172('0x34')](handleError(_0x2267d4,null));};exports[_0x2172('0xd1')]=function(_0x303aa8,_0x196ee0){var _0xbbaa8=moment()[_0x2172('0xd2')]()[_0x2172('0xb4')]();var _0x38aaca=path['join'](config[_0x2172('0xd3')],_0x2172('0xd4'),_0x2172('0xd5'),_0x2172('0xd6'));var _0x3685aa=path['join'](config[_0x2172('0xd3')],_0x2172('0xd4'),'files','attachments');var _0x4ea601=path[_0x2172('0xd7')](_0x38aaca,_0xbbaa8);var _0x64642b=util['format'](_0x2172('0xd8'),_0x303aa8[_0x2172('0xbb')]['id'],_0xbbaa8);var _0x56332c=path[_0x2172('0xd7')](_0x38aaca,_0x64642b);var _0x2fb526=[];_0x2fb526[_0x2172('0x33')]({'model':db['User'],'as':_0x2172('0x76'),'attributes':['id',_0x2172('0xd9')],'raw':!![]});_0x2fb526[_0x2172('0x33')]({'model':db['CmContact'],'as':_0x2172('0x6c'),'attributes':['id',_0x2172('0xda'),_0x2172('0xdb')],'raw':!![]});var _0x331021=[{'model':db[_0x2172('0xc2')],'as':_0x2172('0xdc'),'attributes':['id',_0x2172('0x7a'),'createdAt',_0x2172('0xdd'),_0x2172('0xde'),'read'],'include':_0x2fb526}];_0x331021['push']({'model':db['SmsAccount'],'as':_0x2172('0xdf'),'attributes':['id','name']});_0x331021[_0x2172('0x33')]({'model':db[_0x2172('0x76')],'as':_0x2172('0xe0'),'attributes':['id',_0x2172('0xd9')]});return db['SmsInteraction'][_0x2172('0x67')]({'where':{'id':_0x303aa8[_0x2172('0xbb')]['id']},'include':_0x331021})[_0x2172('0x2b')](handleEntityNotFound(_0x196ee0,null))[_0x2172('0x2b')](function(_0xd2e233){if(_0xd2e233){var _0x50be0b=_0xd2e233['get']({'plain':!![]});fs[_0x2172('0xe1')](_0x4ea601);var _0x259ad9={'channel':'Sms','account':_0x50be0b['Account'][_0x2172('0x2e')],'agent':_0x50be0b[_0x2172('0xe0')]?_0x50be0b[_0x2172('0xe0')][_0x2172('0xd9')]:_0x2172('0xe2'),'createdAt':moment(_0x50be0b[_0x2172('0x7e')])[_0x2172('0xc8')](_0x2172('0xc9'))['toString'](),'closedAt':_0x50be0b[_0x2172('0x39')]?moment(_0x50be0b[_0x2172('0xe3')])[_0x2172('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2172('0xb4')]():'','disposition':_0x50be0b[_0x2172('0xe4')],'messages':_(_0x50be0b[_0x2172('0xdc')])[_0x2172('0x8a')]({'secret':![]})[_0x2172('0x3d')](function(_0x5356f8){return{'date':moment(_0x5356f8['createdAt'])['format'](_0x2172('0xc9'))[_0x2172('0xb4')](),'sender':_0x5356f8['direction']===_0x2172('0xe5')?_0x5356f8[_0x2172('0x76')]?_0x5356f8[_0x2172('0x76')][_0x2172('0xd9')]:'System':_0x5356f8[_0x2172('0x6c')]['firstName']+(_0x5356f8[_0x2172('0x6c')][_0x2172('0xdb')]?'\x20'+_0x5356f8['Contact'][_0x2172('0xdb')]:''),'body':_0x5356f8[_0x2172('0x7a')],'direction':_0x5356f8[_0x2172('0xdd')]===_0x2172('0xe5')?'A':'C','secret':_0x5356f8[_0x2172('0xde')],'read':_0x5356f8[_0x2172('0x85')]};})[_0x2172('0x68')]()};return ejs[_0x2172('0xe6')](path[_0x2172('0xd7')](config[_0x2172('0xd3')],'server',_0x2172('0xe7'),_0x2172('0xe8')),{'interaction':_0x259ad9})[_0x2172('0x2b')](function(_0x42b89f){var _0x4eea30=path['join'](_0x4ea601,_0x2172('0xe9')+_0x50be0b['id']+'-'+_0xbbaa8+_0x2172('0xea'));var _0x226aaa={'path':_0x4eea30,'channel':_0x2172('0xeb'),'interactionId':_0x50be0b['id']};return pdf[_0x2172('0xec')](_0x42b89f,_0x226aaa);})[_0x2172('0x2b')](function(){return new BPromise(function(_0xcffa54,_0x1432f1){zipdir(_0x4ea601,{'saveTo':_0x56332c},function(_0x165aaa,_0x3e967e){if(_0x165aaa)return _0x1432f1(_0x165aaa);return _0xcffa54(_0x3e967e);});})[_0x2172('0x2b')](function(){return new BPromise(function(_0x5a507a,_0x4b7c82){rimraf(_0x4ea601,function(_0x2c15e3){if(_0x2c15e3)_0x4b7c82(_0x2c15e3);return _0x5a507a();});});})['then'](function(){return _0x196ee0[_0x2172('0xd1')](_0x56332c,_0x64642b,function(_0x26568f){if(_0x26568f){console[_0x2172('0xed')](_0x2172('0xee'),_0x26568f);}else{fs['unlinkSync'](_0x56332c);}});});});}else{return _0x196ee0[_0x2172('0x1d')](0xc8);}})[_0x2172('0x34')](handleError(_0x196ee0,null));};
\ No newline at end of file
index 01e3846..ebd562c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['map','findAll','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users'];(function(_0x2959a6,_0x3640c4){var _0x583140=function(_0x51c02e){while(--_0x51c02e){_0x2959a6['push'](_0x2959a6['shift']());}};_0x583140(++_0x3640c4);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xd781('0x0'));var SmsInteraction=require(_0xd781('0x1'))['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0xd781('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xd781('0x3')](0x0);var events={'afterCreate':_0xd781('0x4'),'afterUpdate':_0xd781('0x5'),'afterDestroy':_0xd781('0x6')};function emitEvent(_0x42258e){return function(_0x446534,_0x1d4f4e,_0x830b){_0x446534[_0xd781('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x133509){_0x446534[_0xd781('0x8')](_0xd781('0x9'),_0x133509[_0xd781('0xa')](function(_0x4b1a57){return{'id':_0x4b1a57['id']};}));return SmsMessage[_0xd781('0xb')]({'where':{'SmsInteractionId':_0x446534['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43d863){_0x446534[_0xd781('0x8')]('unreadMessages',_0x43d863[_0xd781('0xc')]);SmsInteractionEvents[_0xd781('0xd')](_0x42258e+':'+_0x446534['id'],_0x446534);SmsInteractionEvents['emit'](_0x42258e,_0x446534);_0x830b(null);})['catch'](_0x830b(null));};}for(var e in events){if(events[_0xd781('0xe')](e)){var event=events[e];SmsInteraction[_0xd781('0xf')](e,emitEvent(event));}}module[_0xd781('0x10')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xe2cf=['update','remove','then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0xd6f6f5,_0x1b2345){_0xd6f6f5=_0xd6f6f5-0x0;var _0xe61908=_0xe2cf[_0xd6f6f5];return _0xe61908;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xfe2c('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0xfe2c('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xfe2c('0x1')](0x0);var events={'afterCreate':_0xfe2c('0x2'),'afterUpdate':_0xfe2c('0x3'),'afterDestroy':_0xfe2c('0x4')};function emitEvent(_0x494978){return function(_0xd40c31,_0x14674d,_0x55bb12){_0xd40c31['getUsers']({'attributes':['id'],'raw':!![]})[_0xfe2c('0x5')](function(_0x417bc4){_0xd40c31['setDataValue']('Users',_0x417bc4[_0xfe2c('0x6')](function(_0x2e2933){return{'id':_0x2e2933['id']};}));return SmsMessage[_0xfe2c('0x7')]({'where':{'SmsInteractionId':_0xd40c31['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5b616c){_0xd40c31[_0xfe2c('0x8')](_0xfe2c('0x9'),_0x5b616c['length']);SmsInteractionEvents[_0xfe2c('0xa')](_0x494978+':'+_0xd40c31['id'],_0xd40c31);SmsInteractionEvents[_0xfe2c('0xa')](_0x494978,_0xd40c31);_0x55bb12(null);})[_0xfe2c('0xb')](_0x55bb12(null));};}for(var e in events){if(events[_0xfe2c('0xc')](e)){var event=events[e];SmsInteraction[_0xfe2c('0xd')](e,emitEvent(event));}}module[_0xfe2c('0xe')]=SmsInteractionEvents;
\ No newline at end of file
index fdf82be..649eeef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x332b=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports'];(function(_0x1b6621,_0x105c12){var _0x12cad9=function(_0x523cf2){while(--_0x523cf2){_0x1b6621['push'](_0x1b6621['shift']());}};_0x12cad9(++_0x105c12);}(_0x332b,0x93));var _0xb332=function(_0x28149b,_0x492050){_0x28149b=_0x28149b-0x0;var _0x1dc7ec=_0x332b[_0x28149b];return _0x1dc7ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb332('0x0'))('api');var moment=require('moment');var BPromise=require(_0xb332('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb332('0x2'));var rimraf=require(_0xb332('0x3'));var config=require(_0xb332('0x4'));var attributes=require(_0xb332('0x5'));module[_0xb332('0x6')]=function(_0x442464,_0x34fbc4){return _0x442464['define']('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a7737,_0x448138,_0x2b0824){if(_0x5a7737[_0xb332('0x7')](_0xb332('0x8'))){_0x5a7737[_0xb332('0x9')]=moment()['format'](_0xb332('0xa'));}_0x2b0824(null,_0x5a7737);}}});};
\ No newline at end of file
+var _0xc775=['../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird'];(function(_0x11c705,_0x1fd903){var _0xf83814=function(_0x4b3462){while(--_0x4b3462){_0x11c705['push'](_0x11c705['shift']());}};_0xf83814(++_0x1fd903);}(_0xc775,0x1bb));var _0x5c77=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc775[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x5c77('0x0'));var util=require(_0x5c77('0x1'));var logger=require('../../config/logger')(_0x5c77('0x2'));var moment=require(_0x5c77('0x3'));var BPromise=require(_0x5c77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5c77('0x5'));var attributes=require(_0x5c77('0x6'));module['exports']=function(_0x5331a9,_0x3e4119){return _0x5331a9[_0x5c77('0x7')](_0x5c77('0x8'),attributes,{'tableName':_0x5c77('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc35ae7,_0x165f57,_0x1cbd00){if(_0xc35ae7[_0x5c77('0xa')](_0x5c77('0xb'))){_0xc35ae7[_0x5c77('0xc')]=moment()['format'](_0x5c77('0xd'));}_0x1cbd00(null,_0xc35ae7);}}});};
\ No newline at end of file
index 79b5e0f..27db8de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72ed=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','then','stringify','AddTagsToSmsInteraction','find','body','omit','ids','spread','AddTags'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x72ed,0x1e4));var _0xd72e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x72ed[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd72e('0x0'));var util=require(_0xd72e('0x1'));var moment=require(_0xd72e('0x2'));var BPromise=require(_0xd72e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd72e('0x4'));var db=require(_0xd72e('0x5'))['db'];var utils=require(_0xd72e('0x6'));var logger=require(_0xd72e('0x7'))(_0xd72e('0x8'));var config=require(_0xd72e('0x9'));var jayson=require(_0xd72e('0xa'));var client=jayson[_0xd72e('0xb')][_0xd72e('0xc')]({'port':0x232a});config['redis']=_[_0xd72e('0xd')](config[_0xd72e('0xe')],{'host':_0xd72e('0xf'),'port':0x18eb});var socket=require(_0xd72e('0x10'))(new Redis(config[_0xd72e('0xe')]));require(_0xd72e('0x11'))['register'](socket);function respondWithRpcPromise(_0x34d69d,_0x121a24,_0x253c4e){return new BPromise(function(_0x3076ce,_0x52e894){return client['request'](_0x34d69d,_0x253c4e)['then'](function(_0x58e358){logger[_0xd72e('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x121a24,_0xd72e('0x13'));logger[_0xd72e('0x14')](_0xd72e('0x15'),_0x121a24,_0xd72e('0x13'),JSON['stringify'](_0x58e358));if(_0x58e358[_0xd72e('0x16')]){if(_0x58e358[_0xd72e('0x16')][_0xd72e('0x17')]===0x1f4){logger[_0xd72e('0x16')](_0xd72e('0x18'),_0x121a24,_0x58e358[_0xd72e('0x16')][_0xd72e('0x19')]);return _0x52e894(_0x58e358[_0xd72e('0x16')][_0xd72e('0x19')]);}logger[_0xd72e('0x16')](_0xd72e('0x18'),_0x121a24,_0x58e358['error']['message']);return _0x3076ce(_0x58e358[_0xd72e('0x16')]['message']);}else{logger[_0xd72e('0x12')](_0xd72e('0x18'),_0x121a24,_0xd72e('0x13'));_0x3076ce(_0x58e358[_0xd72e('0x1a')]['message']);}})[_0xd72e('0x1b')](function(_0x24eccf){logger[_0xd72e('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x121a24,_0x24eccf);_0x52e894(_0x24eccf);});});}exports[_0xd72e('0x1c')]=function(_0x2384f2){var _0x1d39fe=this;return new Promise(function(_0x174012,_0x32a79a){return db[_0xd72e('0x1d')][_0xd72e('0x1e')](_0x2384f2['body'],{'raw':_0x2384f2[_0xd72e('0x1f')]?_0x2384f2[_0xd72e('0x1f')][_0xd72e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2384f2[_0xd72e('0x1f')]?_0x2384f2[_0xd72e('0x1f')][_0xd72e('0x21')]||null:null,'attributes':_0x2384f2['options']?_0x2384f2[_0xd72e('0x1f')][_0xd72e('0x22')]||null:null,'limit':_0x2384f2[_0xd72e('0x1f')]?_0x2384f2[_0xd72e('0x1f')]['limit']||null:null})[_0xd72e('0x23')](function(_0x7f52c8){logger[_0xd72e('0x12')](_0xd72e('0x1c'),_0x2384f2);logger[_0xd72e('0x14')](_0xd72e('0x1c'),_0x2384f2,JSON[_0xd72e('0x24')](_0x7f52c8));_0x174012(_0x7f52c8);})[_0xd72e('0x1b')](function(_0x112978){logger[_0xd72e('0x16')](_0xd72e('0x1c'),_0x112978[_0xd72e('0x19')],_0x2384f2);_0x32a79a(_0x1d39fe['error'](0x1f4,_0x112978[_0xd72e('0x19')]));});});};exports[_0xd72e('0x25')]=function(_0x246859){return new Promise(function(_0x49504a,_0x766f68){return db['SmsInteraction'][_0xd72e('0x26')]({'where':_0x246859[_0xd72e('0x1f')]?_0x246859[_0xd72e('0x1f')]['where']||null:null})[_0xd72e('0x23')](function(_0x21ee7a){if(_0x21ee7a){return _0x21ee7a['addTags'](_0x246859[_0xd72e('0x27')]['ids'],_[_0xd72e('0x28')](_0x246859['body'],[_0xd72e('0x29'),'id'])||{});}})[_0xd72e('0x2a')](function(_0x3e14d0){logger[_0xd72e('0x12')](_0xd72e('0x2b'),_0x246859);logger['debug'](_0xd72e('0x2b'),_0x246859,JSON[_0xd72e('0x24')](_0x3e14d0));_0x49504a(_0x3e14d0);})[_0xd72e('0x1b')](function(_0x4e3907){logger['error'](_0xd72e('0x2b'),_0x4e3907[_0xd72e('0x19')],_0x246859);_0x766f68(_this[_0xd72e('0x16')](0x1f4,_0x4e3907['message']));});});};
\ No newline at end of file
+var _0x7cab=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','SmsInteraction,\x20%s,\x20%s','message','info','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','catch','find','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent'];(function(_0x4e4e2e,_0x383975){var _0x5eb19e=function(_0xa5839d){while(--_0xa5839d){_0x4e4e2e['push'](_0x4e4e2e['shift']());}};_0x5eb19e(++_0x383975);}(_0x7cab,0x1cf));var _0xb7ca=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x7cab[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xb7ca('0x0'));var util=require(_0xb7ca('0x1'));var moment=require('moment');var BPromise=require(_0xb7ca('0x2'));var rs=require(_0xb7ca('0x3'));var fs=require('fs');var Redis=require(_0xb7ca('0x4'));var db=require(_0xb7ca('0x5'))['db'];var utils=require(_0xb7ca('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb7ca('0x7')][_0xb7ca('0x8')]({'port':0x232a});config[_0xb7ca('0x9')]=_[_0xb7ca('0xa')](config[_0xb7ca('0x9')],{'host':_0xb7ca('0xb'),'port':0x18eb});var socket=require(_0xb7ca('0xc'))(new Redis(config[_0xb7ca('0x9')]));require('./smsInteraction.socket')[_0xb7ca('0xd')](socket);function respondWithRpcPromise(_0x1aeb9c,_0x521ee9,_0xf743c8){return new BPromise(function(_0x392202,_0x55b244){return client[_0xb7ca('0xe')](_0x1aeb9c,_0xf743c8)[_0xb7ca('0xf')](function(_0x1ab9be){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x521ee9,_0xb7ca('0x10'));logger[_0xb7ca('0x11')](_0xb7ca('0x12'),_0x521ee9,_0xb7ca('0x10'),JSON[_0xb7ca('0x13')](_0x1ab9be));if(_0x1ab9be[_0xb7ca('0x14')]){if(_0x1ab9be[_0xb7ca('0x14')]['code']===0x1f4){logger['error'](_0xb7ca('0x15'),_0x521ee9,_0x1ab9be[_0xb7ca('0x14')][_0xb7ca('0x16')]);return _0x55b244(_0x1ab9be[_0xb7ca('0x14')][_0xb7ca('0x16')]);}logger[_0xb7ca('0x14')](_0xb7ca('0x15'),_0x521ee9,_0x1ab9be[_0xb7ca('0x14')][_0xb7ca('0x16')]);return _0x392202(_0x1ab9be[_0xb7ca('0x14')][_0xb7ca('0x16')]);}else{logger[_0xb7ca('0x17')](_0xb7ca('0x15'),_0x521ee9,_0xb7ca('0x10'));_0x392202(_0x1ab9be[_0xb7ca('0x18')][_0xb7ca('0x16')]);}})['catch'](function(_0x37a353){logger[_0xb7ca('0x14')](_0xb7ca('0x15'),_0x521ee9,_0x37a353);_0x55b244(_0x37a353);});});}exports[_0xb7ca('0x19')]=function(_0x3fe6b3){var _0x35affe=this;return new Promise(function(_0x1d39fa,_0x2e3b0d){return db[_0xb7ca('0x1a')][_0xb7ca('0x1b')](_0x3fe6b3[_0xb7ca('0x1c')],{'raw':_0x3fe6b3[_0xb7ca('0x1d')]?_0x3fe6b3[_0xb7ca('0x1d')][_0xb7ca('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fe6b3[_0xb7ca('0x1d')]?_0x3fe6b3['options']['where']||null:null,'attributes':_0x3fe6b3['options']?_0x3fe6b3[_0xb7ca('0x1d')][_0xb7ca('0x1f')]||null:null,'limit':_0x3fe6b3[_0xb7ca('0x1d')]?_0x3fe6b3[_0xb7ca('0x1d')]['limit']||null:null})[_0xb7ca('0xf')](function(_0x401bee){logger['info']('UpdateSmsInteraction',_0x3fe6b3);logger[_0xb7ca('0x11')]('UpdateSmsInteraction',_0x3fe6b3,JSON[_0xb7ca('0x13')](_0x401bee));_0x1d39fa(_0x401bee);})[_0xb7ca('0x20')](function(_0x376dfd){logger['error'](_0xb7ca('0x19'),_0x376dfd[_0xb7ca('0x16')],_0x3fe6b3);_0x2e3b0d(_0x35affe[_0xb7ca('0x14')](0x1f4,_0x376dfd[_0xb7ca('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x2b3eeb){return new Promise(function(_0x3b080d,_0x31e0fd){return db[_0xb7ca('0x1a')][_0xb7ca('0x21')]({'where':_0x2b3eeb[_0xb7ca('0x1d')]?_0x2b3eeb[_0xb7ca('0x1d')][_0xb7ca('0x22')]||null:null})[_0xb7ca('0xf')](function(_0x187f23){if(_0x187f23){return _0x187f23[_0xb7ca('0x23')](_0x2b3eeb['body'][_0xb7ca('0x24')],_[_0xb7ca('0x25')](_0x2b3eeb[_0xb7ca('0x1c')],[_0xb7ca('0x24'),'id'])||{});}})[_0xb7ca('0x26')](function(_0x2730ce){logger[_0xb7ca('0x17')](_0xb7ca('0x27'),_0x2b3eeb);logger[_0xb7ca('0x11')]('AddTags',_0x2b3eeb,JSON[_0xb7ca('0x13')](_0x2730ce));_0x3b080d(_0x2730ce);})[_0xb7ca('0x20')](function(_0x3d5af5){logger[_0xb7ca('0x14')](_0xb7ca('0x27'),_0x3d5af5[_0xb7ca('0x16')],_0x2b3eeb);_0x31e0fd(_this[_0xb7ca('0x14')](0x1f4,_0x3d5af5['message']));});});};
\ No newline at end of file
index 3ddfc03..6f5f60f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94a5=['length','smsInteraction:','./smsInteraction.events','save','update','emit','removeListener','register'];(function(_0x4db874,_0xc2c1b3){var _0x51dd41=function(_0x3a67ec){while(--_0x3a67ec){_0x4db874['push'](_0x4db874['shift']());}};_0x51dd41(++_0xc2c1b3);}(_0x94a5,0x1ba));var _0x594a=function(_0x209d53,_0x527026){_0x209d53=_0x209d53-0x0;var _0x3bd45a=_0x94a5[_0x209d53];return _0x3bd45a;};'use strict';var SmsInteractionEvents=require(_0x594a('0x0'));var events=[_0x594a('0x1'),'remove',_0x594a('0x2')];function createListener(_0xf4c6dc,_0x5220b0){return function(_0x203775){_0x5220b0[_0x594a('0x3')](_0xf4c6dc,_0x203775);};}function removeListener(_0x416b03,_0x423e8b){return function(){SmsInteractionEvents[_0x594a('0x4')](_0x416b03,_0x423e8b);};}exports[_0x594a('0x5')]=function(_0x914bee){for(var _0x4e2a30=0x0,_0x338069=events[_0x594a('0x6')];_0x4e2a30<_0x338069;_0x4e2a30++){var _0x1467af=events[_0x4e2a30];var _0xc69d57=createListener(_0x594a('0x7')+_0x1467af,_0x914bee);SmsInteractionEvents['on'](_0x1467af,_0xc69d57);}};
\ No newline at end of file
+var _0x0edb=['update','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x3fe4d2,_0x186bbb){var _0x407a23=function(_0xa7d35d){while(--_0xa7d35d){_0x3fe4d2['push'](_0x3fe4d2['shift']());}};_0x407a23(++_0x186bbb);}(_0x0edb,0x1e1));var _0xb0ed=function(_0x1e201f,_0x2d695f){_0x1e201f=_0x1e201f-0x0;var _0x5c0a12=_0x0edb[_0x1e201f];return _0x5c0a12;};'use strict';var SmsInteractionEvents=require(_0xb0ed('0x0'));var events=[_0xb0ed('0x1'),'remove',_0xb0ed('0x2')];function createListener(_0x3dcedc,_0x21ad51){return function(_0x11718e){_0x21ad51['emit'](_0x3dcedc,_0x11718e);};}function removeListener(_0xeaf539,_0x3cc01a){return function(){SmsInteractionEvents[_0xb0ed('0x3')](_0xeaf539,_0x3cc01a);};}exports[_0xb0ed('0x4')]=function(_0x45b4b8){for(var _0x4e3d6e=0x0,_0x46a38e=events[_0xb0ed('0x5')];_0x4e3d6e<_0x46a38e;_0x4e3d6e++){var _0x318638=events[_0x4e3d6e];var _0x39b400=createListener(_0xb0ed('0x6')+_0x318638,_0x45b4b8);SmsInteractionEvents['on'](_0x318638,_0x39b400);}};
\ No newline at end of file
index 05e0331..df64905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0e4=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','describe','show','isAuthenticated','tracked','sms','create','post','put','/:id','update','/:id/accept','accept','reject','delete','exports','multer'];(function(_0x370243,_0x9f6572){var _0x46d6cc=function(_0x2c0a69){while(--_0x2c0a69){_0x370243['push'](_0x370243['shift']());}};_0x46d6cc(++_0x9f6572);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x2b5ee5,_0x3741bf){_0x2b5ee5=_0x2b5ee5-0x0;var _0x1c480b=_0xd0e4[_0x2b5ee5];return _0x1c480b;};'use strict';var multer=require(_0x4d0e('0x0'));var util=require(_0x4d0e('0x1'));var path=require(_0x4d0e('0x2'));var timeout=require(_0x4d0e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d0e('0x4'));var auth=require(_0x4d0e('0x5'));var interaction=require(_0x4d0e('0x6'));var config=require(_0x4d0e('0x7'));var controller=require(_0x4d0e('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4d0e('0x9')](_0x4d0e('0xa'),auth['isAuthenticated'](),controller[_0x4d0e('0xb')]);router[_0x4d0e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4d0e('0xc')]);router['post']('/',auth[_0x4d0e('0xd')](),interaction[_0x4d0e('0xe')](_0x4d0e('0xf'),'smsmessage:create'),controller[_0x4d0e('0x10')]);router[_0x4d0e('0x11')]('/:id/status',controller['status']);router[_0x4d0e('0x12')](_0x4d0e('0x13'),auth[_0x4d0e('0xd')](),controller[_0x4d0e('0x14')]);router[_0x4d0e('0x12')](_0x4d0e('0x15'),auth[_0x4d0e('0xd')](),controller[_0x4d0e('0x16')]);router[_0x4d0e('0x12')]('/:id/reject',auth[_0x4d0e('0xd')](),controller[_0x4d0e('0x17')]);router[_0x4d0e('0x18')]('/:id',auth[_0x4d0e('0xd')](),controller['destroy']);module[_0x4d0e('0x19')]=router;
\ No newline at end of file
+var _0x6e87=['isAuthenticated','index','/describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsMessage.controller','get'];(function(_0x3c9e97,_0x29a68d){var _0x179715=function(_0x3e40f8){while(--_0x3e40f8){_0x3c9e97['push'](_0x3c9e97['shift']());}};_0x179715(++_0x29a68d);}(_0x6e87,0x7e));var _0x76e8=function(_0x473b1c,_0x228285){_0x473b1c=_0x473b1c-0x0;var _0xd9c362=_0x6e87[_0x473b1c];return _0xd9c362;};'use strict';var multer=require('multer');var util=require(_0x76e8('0x0'));var path=require(_0x76e8('0x1'));var timeout=require(_0x76e8('0x2'));var express=require(_0x76e8('0x3'));var router=express[_0x76e8('0x4')]();var fs_extra=require(_0x76e8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x76e8('0x6'));var controller=require(_0x76e8('0x7'));router[_0x76e8('0x8')]('/',auth[_0x76e8('0x9')](),controller[_0x76e8('0xa')]);router[_0x76e8('0x8')](_0x76e8('0xb'),auth[_0x76e8('0x9')](),controller['describe']);router['get'](_0x76e8('0xc'),auth['isAuthenticated'](),controller[_0x76e8('0xd')]);router[_0x76e8('0xe')]('/',auth[_0x76e8('0x9')](),interaction[_0x76e8('0xf')](_0x76e8('0x10'),_0x76e8('0x11')),controller[_0x76e8('0x12')]);router[_0x76e8('0xe')](_0x76e8('0x13'),controller[_0x76e8('0x14')]);router[_0x76e8('0x15')](_0x76e8('0xc'),auth[_0x76e8('0x9')](),controller['update']);router[_0x76e8('0x15')]('/:id/accept',auth[_0x76e8('0x9')](),controller[_0x76e8('0x16')]);router[_0x76e8('0x15')](_0x76e8('0x17'),auth[_0x76e8('0x9')](),controller[_0x76e8('0x18')]);router[_0x76e8('0x19')](_0x76e8('0xc'),auth[_0x76e8('0x9')](),controller['destroy']);module[_0x76e8('0x1a')]=router;
\ No newline at end of file
index da7385c..90df808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x676a=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','exports'];(function(_0xcae7aa,_0x213078){var _0x34bc74=function(_0x42c101){while(--_0x42c101){_0xcae7aa['push'](_0xcae7aa['shift']());}};_0x34bc74(++_0x213078);}(_0x676a,0x14f));var _0xa676=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x676a[_0x218994];return _0x3f350b;};'use strict';var Sequelize=require('sequelize');module[_0xa676('0x0')]={'body':{'type':Sequelize[_0xa676('0x1')](_0xa676('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa676('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa676('0x4')]('in',_0xa676('0x5')),'defaultValue':_0xa676('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa676('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xa676('0x7')]},'secret':{'type':Sequelize[_0xa676('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa676('0x6')]},'providerResponse':{'type':Sequelize[_0xa676('0x1')]}};
\ No newline at end of file
+var _0x3e06=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x5f47b5,_0x119ad8){var _0x50f763=function(_0x115192){while(--_0x115192){_0x5f47b5['push'](_0x5f47b5['shift']());}};_0x50f763(++_0x119ad8);}(_0x3e06,0x153));var _0x63e0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3e06[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x63e0('0x0'));module[_0x63e0('0x1')]={'body':{'type':Sequelize[_0x63e0('0x2')](_0x63e0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x63e0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x63e0('0x5')]('in','out'),'defaultValue':_0x63e0('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x63e0('0x7')](0xbe)},'phone':{'type':Sequelize[_0x63e0('0x7')]},'readAt':{'type':Sequelize[_0x63e0('0x8')]},'secret':{'type':Sequelize[_0x63e0('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x63e0('0x2')]}};
\ No newline at end of file
index 1092906..5af1368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a18=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','name','send','index','map','SmsMessage','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','filters','catch','body','find','describe','sms-interactions','sms','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','internal','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x20463f,_0x4cc37a){var _0x143ee4=function(_0x30bc31){while(--_0x30bc31){_0x20463f['push'](_0x20463f['shift']());}};_0x143ee4(++_0x4cc37a);}(_0x6a18,0x114));var _0x86a1=function(_0x1e655b,_0xbaecbc){_0x1e655b=_0x1e655b-0x0;var _0x2ae698=_0x6a18[_0x1e655b];return _0x2ae698;};'use strict';var emlformat=require(_0x86a1('0x0'));var rimraf=require(_0x86a1('0x1'));var zipdir=require(_0x86a1('0x2'));var jsonpatch=require(_0x86a1('0x3'));var rp=require(_0x86a1('0x4'));var moment=require(_0x86a1('0x5'));var BPromise=require(_0x86a1('0x6'));var Mustache=require(_0x86a1('0x7'));var util=require('util');var path=require('path');var sox=require(_0x86a1('0x8'));var csv=require(_0x86a1('0x9'));var ejs=require(_0x86a1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86a1('0xb'));var squel=require(_0x86a1('0xc'));var crypto=require(_0x86a1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x86a1('0xe'));var toCsv=require(_0x86a1('0x9'));var querystring=require(_0x86a1('0xf'));var Papa=require(_0x86a1('0x10'));var Redis=require(_0x86a1('0x11'));var authService=require(_0x86a1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x86a1('0x13'));var hardwareService=require(_0x86a1('0x14'));var logger=require(_0x86a1('0x15'))(_0x86a1('0x16'));var utils=require(_0x86a1('0x17'));var config=require(_0x86a1('0x18'));var licenseUtil=require(_0x86a1('0x19'));var db=require(_0x86a1('0x1a'))['db'];config['redis']=_[_0x86a1('0x1b')](config[_0x86a1('0x1c')],{'host':_0x86a1('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86a1('0x1c')]));require(_0x86a1('0x1e'))[_0x86a1('0x1f')](socket);var jayson=require(_0x86a1('0x20'));var client=jayson[_0x86a1('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x86a1('0x21')][_0x86a1('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x510ab8,_0x3d2ef3,_0x19b6f8,_0x33d0b8){return new BPromise(function(_0x10a995,_0x15d04e){var _0x44b912=_0x33d0b8||client;return _0x44b912[_0x86a1('0x23')](_0x510ab8,_0x19b6f8)['then'](function(_0x4f730d){logger['info'](_0x86a1('0x24'),_0x3d2ef3,_0x86a1('0x25'));logger['debug'](_0x86a1('0x26'),_0x3d2ef3,_0x86a1('0x25'),JSON[_0x86a1('0x27')](_0x4f730d));if(_0x4f730d[_0x86a1('0x28')]){if(_0x4f730d[_0x86a1('0x28')]['code']===0x1f4){logger['error'](_0x86a1('0x24'),_0x3d2ef3,_0x4f730d[_0x86a1('0x28')][_0x86a1('0x29')]);return _0x15d04e(_0x4f730d[_0x86a1('0x28')]['message']);}logger[_0x86a1('0x28')](_0x86a1('0x24'),_0x3d2ef3,_0x4f730d['error'][_0x86a1('0x29')]);return _0x10a995(_0x4f730d[_0x86a1('0x28')][_0x86a1('0x29')]);}else{logger[_0x86a1('0x2a')](_0x86a1('0x24'),_0x3d2ef3,'request\x20sent');_0x10a995(_0x4f730d[_0x86a1('0x2b')][_0x86a1('0x29')]);}})['catch'](function(_0x527d6f){logger[_0x86a1('0x28')](_0x86a1('0x24'),_0x3d2ef3,_0x527d6f);_0x15d04e(_0x527d6f);});});}function respondWithStatusCode(_0x5c929f,_0x11ab67){_0x11ab67=_0x11ab67||0xcc;return function(_0x3b218f){if(_0x3b218f){return _0x5c929f[_0x86a1('0x2c')](_0x11ab67);}return _0x5c929f[_0x86a1('0x2d')](_0x11ab67)[_0x86a1('0x2e')]();};}function respondWithResult(_0x3b581f,_0x5ab730){_0x5ab730=_0x5ab730||0xc8;return function(_0x3c9914){if(_0x3c9914){return _0x3b581f[_0x86a1('0x2d')](_0x5ab730)[_0x86a1('0x2f')](_0x3c9914);}};}function respondWithFilteredResult(_0x2676f5,_0x2d1916){return function(_0x2fc88e){if(_0x2fc88e){var _0x2976e4=typeof _0x2d1916[_0x86a1('0x30')]===_0x86a1('0x31')&&typeof _0x2d1916[_0x86a1('0x32')]==='undefined';var _0x40101d=_0x2fc88e[_0x86a1('0x33')];var _0x203b0c=_0x2976e4?0x0:_0x2d1916['offset'];var _0x1dbcc1=_0x2976e4?_0x2fc88e[_0x86a1('0x33')]:_0x2d1916[_0x86a1('0x30')]+_0x2d1916[_0x86a1('0x32')];var _0x5a4858;if(_0x1dbcc1>=_0x40101d){_0x1dbcc1=_0x40101d;_0x5a4858=0xc8;}else{_0x5a4858=0xce;}_0x2676f5[_0x86a1('0x2d')](_0x5a4858);return _0x2676f5[_0x86a1('0x34')]('Content-Range',_0x203b0c+'-'+_0x1dbcc1+'/'+_0x40101d)[_0x86a1('0x2f')](_0x2fc88e);}return null;};}function patchUpdates(_0x25e119){return function(_0x380044){try{jsonpatch[_0x86a1('0x35')](_0x380044,_0x25e119,!![]);}catch(_0x2fea17){return BPromise['reject'](_0x2fea17);}return _0x380044[_0x86a1('0x36')]();};}function saveUpdates(_0x4fff0d,_0x1b69e3){return function(_0x48aa5f){if(_0x48aa5f){return _0x48aa5f[_0x86a1('0x37')](_0x4fff0d)[_0x86a1('0x38')](function(_0x40bbdd){return _0x40bbdd;});}return null;};}function removeEntity(_0x40e263,_0x59d73d){return function(_0x56c95b){if(_0x56c95b){return _0x56c95b[_0x86a1('0x39')]()[_0x86a1('0x38')](function(){_0x40e263[_0x86a1('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18fc00,_0x5a67a8){return function(_0x1be29d){if(!_0x1be29d){_0x18fc00[_0x86a1('0x2c')](0x194);}return _0x1be29d;};}function handleError(_0x45f6fb,_0x2849f9){_0x2849f9=_0x2849f9||0x1f4;return function(_0x5d1ded){logger[_0x86a1('0x28')](_0x5d1ded['stack']);if(_0x5d1ded[_0x86a1('0x3a')]){delete _0x5d1ded[_0x86a1('0x3a')];}_0x45f6fb[_0x86a1('0x2d')](_0x2849f9)[_0x86a1('0x3b')](_0x5d1ded);};}exports[_0x86a1('0x3c')]=function(_0x24e743,_0x3194ff){var _0x4b6f20={},_0x544326={},_0x9dac60={'count':0x0,'rows':[]};var _0x3010e7=_[_0x86a1('0x3d')](db[_0x86a1('0x3e')]['rawAttributes'],function(_0x57b2a0){return{'name':_0x57b2a0['fieldName'],'type':_0x57b2a0[_0x86a1('0x3f')][_0x86a1('0x40')]};});_0x544326[_0x86a1('0x41')]=_[_0x86a1('0x3d')](_0x3010e7,_0x86a1('0x3a'));_0x544326[_0x86a1('0x42')]=_[_0x86a1('0x43')](_0x24e743[_0x86a1('0x42')]);_0x544326['filters']=_[_0x86a1('0x44')](_0x544326[_0x86a1('0x41')],_0x544326['query']);_0x4b6f20['attributes']=_[_0x86a1('0x44')](_0x544326[_0x86a1('0x41')],qs[_0x86a1('0x45')](_0x24e743[_0x86a1('0x42')][_0x86a1('0x45')]));_0x4b6f20[_0x86a1('0x46')]=_0x4b6f20['attributes'][_0x86a1('0x47')]?_0x4b6f20['attributes']:_0x544326[_0x86a1('0x41')];if(!_0x24e743[_0x86a1('0x42')][_0x86a1('0x48')](_0x86a1('0x49'))){_0x4b6f20[_0x86a1('0x32')]=qs[_0x86a1('0x32')](_0x24e743[_0x86a1('0x42')][_0x86a1('0x32')]);_0x4b6f20[_0x86a1('0x30')]=qs[_0x86a1('0x30')](_0x24e743[_0x86a1('0x42')][_0x86a1('0x30')]);}_0x4b6f20[_0x86a1('0x4a')]=qs[_0x86a1('0x4b')](_0x24e743['query'][_0x86a1('0x4b')]);_0x4b6f20[_0x86a1('0x4c')]=qs['filters'](_[_0x86a1('0x4d')](_0x24e743['query'],_0x544326['filters']),_0x3010e7);if(_0x24e743[_0x86a1('0x42')]['filter']){_0x4b6f20[_0x86a1('0x4c')]=_[_0x86a1('0x4e')](_0x4b6f20[_0x86a1('0x4c')],{'$or':_['map'](_0x3010e7,function(_0x3b822a){if(_0x3b822a[_0x86a1('0x3f')]!==_0x86a1('0x4f')){var _0x551aac={};_0x551aac[_0x3b822a[_0x86a1('0x3a')]]={'$like':'%'+_0x24e743['query']['filter']+'%'};return _0x551aac;}})});}_0x4b6f20=_[_0x86a1('0x4e')]({},_0x4b6f20,_0x24e743[_0x86a1('0x50')]);var _0x311a2c={'where':_0x4b6f20[_0x86a1('0x4c')]};return db[_0x86a1('0x3e')][_0x86a1('0x33')](_0x311a2c)[_0x86a1('0x38')](function(_0x161d91){_0x9dac60[_0x86a1('0x33')]=_0x161d91;if(_0x24e743['query'][_0x86a1('0x51')]){_0x4b6f20[_0x86a1('0x52')]=[{'all':!![]}];}return db[_0x86a1('0x3e')][_0x86a1('0x53')](_0x4b6f20);})[_0x86a1('0x38')](function(_0x24da87){_0x9dac60[_0x86a1('0x54')]=_0x24da87;return _0x9dac60;})[_0x86a1('0x38')](respondWithFilteredResult(_0x3194ff,_0x4b6f20))['catch'](handleError(_0x3194ff,null));};exports['show']=function(_0x5f0202,_0x38cd24){var _0xbe572f={'raw':!![],'where':{'id':_0x5f0202[_0x86a1('0x55')]['id']}},_0x537c20={};_0x537c20[_0x86a1('0x41')]=_[_0x86a1('0x43')](db[_0x86a1('0x3e')][_0x86a1('0x56')]);_0x537c20[_0x86a1('0x42')]=_[_0x86a1('0x43')](_0x5f0202[_0x86a1('0x42')]);_0x537c20[_0x86a1('0x57')]=_[_0x86a1('0x44')](_0x537c20[_0x86a1('0x41')],_0x537c20[_0x86a1('0x42')]);_0xbe572f[_0x86a1('0x46')]=_[_0x86a1('0x44')](_0x537c20[_0x86a1('0x41')],qs[_0x86a1('0x45')](_0x5f0202[_0x86a1('0x42')][_0x86a1('0x45')]));_0xbe572f[_0x86a1('0x46')]=_0xbe572f['attributes'][_0x86a1('0x47')]?_0xbe572f[_0x86a1('0x46')]:_0x537c20[_0x86a1('0x41')];if(_0x5f0202[_0x86a1('0x42')][_0x86a1('0x51')]){_0xbe572f['include']=[{'all':!![]}];}_0xbe572f=_[_0x86a1('0x4e')]({},_0xbe572f,_0x5f0202['options']);return db['SmsMessage']['find'](_0xbe572f)[_0x86a1('0x38')](handleEntityNotFound(_0x38cd24,null))[_0x86a1('0x38')](respondWithResult(_0x38cd24,null))[_0x86a1('0x58')](handleError(_0x38cd24,null));};exports['create']=function(_0x2ba308,_0x156bac){return db[_0x86a1('0x3e')]['create'](_0x2ba308[_0x86a1('0x59')],{})[_0x86a1('0x38')](respondWithResult(_0x156bac,0xc9))[_0x86a1('0x58')](handleError(_0x156bac,null));};exports[_0x86a1('0x37')]=function(_0x156c94,_0x313b2f){if(_0x156c94[_0x86a1('0x59')]['id']){delete _0x156c94['body']['id'];}return db[_0x86a1('0x3e')][_0x86a1('0x5a')]({'where':{'id':_0x156c94['params']['id']}})[_0x86a1('0x38')](handleEntityNotFound(_0x313b2f,null))[_0x86a1('0x38')](saveUpdates(_0x156c94[_0x86a1('0x59')],null))[_0x86a1('0x38')](respondWithResult(_0x313b2f,null))[_0x86a1('0x58')](handleError(_0x313b2f,null));};exports[_0x86a1('0x39')]=function(_0x2c48cc,_0x2e5396){return db[_0x86a1('0x3e')]['find']({'where':{'id':_0x2c48cc[_0x86a1('0x55')]['id']}})[_0x86a1('0x38')](handleEntityNotFound(_0x2e5396,null))[_0x86a1('0x38')](removeEntity(_0x2e5396,null))[_0x86a1('0x58')](handleError(_0x2e5396,null));};exports[_0x86a1('0x5b')]=function(_0x51c8aa,_0x25e3a7){return db[_0x86a1('0x3e')][_0x86a1('0x5b')]()[_0x86a1('0x38')](respondWithResult(_0x25e3a7,null))[_0x86a1('0x58')](handleError(_0x25e3a7,null));};var interaction_log=require(_0x86a1('0x15'))(_0x86a1('0x5c'));exports['accept']=function(_0x81deab,_0x24734c,_0xc7a726){var _0x457cde={'agent':{},'channel':_0x86a1('0x5d')};if(_0x81deab['body']['id']){delete _0x81deab[_0x86a1('0x59')]['id'];}_0x81deab['body']['read']=!![];_0x81deab[_0x86a1('0x59')][_0x86a1('0x5e')]=moment()[_0x86a1('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x81deab[_0x86a1('0x59')][_0x86a1('0x60')]=_0x81deab[_0x86a1('0x59')][_0x86a1('0x60')]||_0x81deab[_0x86a1('0x61')]['id'];_0x457cde[_0x86a1('0x62')]['id']=_0x81deab['body'][_0x86a1('0x60')];return db[_0x86a1('0x3e')][_0x86a1('0x5a')]({'where':{'id':_0x81deab['params']['id'],'UserId':null}})[_0x86a1('0x38')](handleEntityNotFound(_0x24734c,null))['then'](saveUpdates(_0x81deab[_0x86a1('0x59')],null))[_0x86a1('0x38')](function(_0x569206){if(_0x569206){_0x457cde['message']=_0x569206[_0x86a1('0x63')]({'plain':!![]});return db[_0x86a1('0x64')][_0x86a1('0x5a')]({'where':{'id':_0x569206[_0x86a1('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x24734c,null))['then'](function(_0xf0bb9b){if(_0xf0bb9b){return _0xf0bb9b[_0x86a1('0x37')]({'UserId':_0x81deab[_0x86a1('0x59')]['UserId'],'read1stAt':_[_0x86a1('0x66')](_0xf0bb9b[_0x86a1('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x86a1('0x38')](function(_0x47fa5c){if(_0x47fa5c){_0x457cde[_0x86a1('0x68')]=_0x47fa5c[_0x86a1('0x63')]({'plain':!![]});interaction_log[_0x86a1('0x2a')](_0x86a1('0x69'),_0x81deab[_0x86a1('0x61')]['id'],_0x81deab[_0x86a1('0x61')][_0x86a1('0x3a')],_0x81deab[_0x86a1('0x61')]['role'],_0x457cde[_0x86a1('0x68')]['id'],_0x81deab['body']?JSON[_0x86a1('0x27')](_0x81deab[_0x86a1('0x59')]):_0x86a1('0x6a'));return respondWithRpcPromise(_0x86a1('0x6b'),'acceptMessage',_0x457cde);}return null;})['then'](function(_0x36b248){var _0x59a921=_0x86a1('0x6c')+_0x36b248[_0x86a1('0x29')][_0x86a1('0x6d')];return db[_0x86a1('0x6e')][_0x86a1('0x42')](_0x59a921,{'type':db[_0x86a1('0x6f')][_0x86a1('0x70')][_0x86a1('0x71')],'raw':!![]})['then'](function(_0x82389e){return _0x82389e;});})['then'](function(_0x38ad12){if(_0x38ad12){_0x457cde[_0x86a1('0x29')][_0x86a1('0x72')]=_0x38ad12[0x0];if(!_0x81deab[_0x86a1('0x59')][_0x86a1('0x60')])return;return db[_0x86a1('0x73')]['find']({'where':{'id':_0x81deab['body'][_0x86a1('0x60')],'role':_0x86a1('0x62')},'attributes':['id',_0x86a1('0x3a'),_0x86a1('0x74'),_0x86a1('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x324f4f){if(!_0x324f4f)return null;_0x457cde[_0x86a1('0x29')][_0x86a1('0x62')]=_0x324f4f;return _0x457cde;})[_0x86a1('0x38')](function(_0x22f37c){if(_0x22f37c){if(_0x81deab[_0x86a1('0x59')][_0x86a1('0x76')]){_0x457cde['message'][_0x86a1('0x77')]=util[_0x86a1('0x5f')](_0x86a1('0x78'),_0x81deab[_0x86a1('0x61')]['name']);_0x457cde[_0x86a1('0x29')][_0x86a1('0x79')]=_0x457cde[_0x86a1('0x79')];_0x457cde[_0x86a1('0x29')]['motionChannel']=_0x457cde[_0x86a1('0x79')];_0x457cde['message'][_0x86a1('0x7a')]='accept';return respondWithRpcPromise('EventManager',_0x86a1('0x7b'),{'event':_0x86a1('0x7c'),'message':_0x457cde[_0x86a1('0x29')]},client9002)[_0x86a1('0x38')](function(){return _0x457cde;});}return _0x457cde;}return null;})['then'](respondWithResult(_0x24734c,null))[_0x86a1('0x58')](handleError(_0x24734c,null));};var interaction_log=require(_0x86a1('0x15'))(_0x86a1('0x5c'));exports[_0x86a1('0x7d')]=function(_0x296f6a,_0x5eea77,_0x4869f9){var _0x27803b={'agent':{},'channel':_0x86a1('0x5d')};if(_0x296f6a[_0x86a1('0x59')]['id']){delete _0x296f6a[_0x86a1('0x59')]['id'];}_0x296f6a[_0x86a1('0x59')][_0x86a1('0x60')]=_0x296f6a[_0x86a1('0x59')][_0x86a1('0x60')]||_0x296f6a[_0x86a1('0x61')]['id'];_0x27803b['agent']['id']=_0x296f6a[_0x86a1('0x59')][_0x86a1('0x60')];return db[_0x86a1('0x3e')][_0x86a1('0x5a')]({'where':{'id':_0x296f6a[_0x86a1('0x55')]['id'],'UserId':null}})[_0x86a1('0x38')](handleEntityNotFound(_0x5eea77,null))[_0x86a1('0x38')](function(_0x56c1f1){if(_0x56c1f1){_0x27803b['message']=_0x56c1f1[_0x86a1('0x63')]({'plain':!![]});return db['SmsInteraction'][_0x86a1('0x5a')]({'where':{'id':_0x56c1f1['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5eea77,null))[_0x86a1('0x38')](function(_0x7245be){if(_0x7245be){_0x27803b[_0x86a1('0x68')]=_0x7245be[_0x86a1('0x63')]({'plain':!![]});interaction_log[_0x86a1('0x2a')](_0x86a1('0x7e'),_0x296f6a['user']['id'],_0x296f6a[_0x86a1('0x61')][_0x86a1('0x3a')],_0x296f6a['user'][_0x86a1('0x7f')],_0x27803b['interaction']['id'],_0x296f6a[_0x86a1('0x59')]?JSON['stringify'](_0x296f6a[_0x86a1('0x59')]):_0x86a1('0x6a'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x27803b);}return null;})['then'](function(_0x5ddbed){var _0x1c1d86=_0x86a1('0x6c')+_0x5ddbed[_0x86a1('0x29')][_0x86a1('0x6d')];return db[_0x86a1('0x6e')]['query'](_0x1c1d86,{'type':db[_0x86a1('0x6f')]['QueryTypes'][_0x86a1('0x71')],'raw':!![]})['then'](function(_0x24c6f7){return _0x24c6f7;});})['then'](function(_0x4ae159){if(_0x4ae159){_0x27803b[_0x86a1('0x29')][_0x86a1('0x72')]=_0x4ae159[0x0];if(!_0x296f6a[_0x86a1('0x59')][_0x86a1('0x60')])return;return db[_0x86a1('0x73')][_0x86a1('0x5a')]({'where':{'id':_0x296f6a[_0x86a1('0x59')][_0x86a1('0x60')],'role':_0x86a1('0x62')},'attributes':['id',_0x86a1('0x3a'),_0x86a1('0x74'),_0x86a1('0x75'),_0x86a1('0x80')],'raw':!![]});}return null;})[_0x86a1('0x38')](function(_0x409153){if(!_0x409153)return null;_0x27803b['message'][_0x86a1('0x62')]=_0x409153;return _0x27803b;})[_0x86a1('0x38')](function(_0x389e41){if(_0x389e41){_0x389e41[_0x86a1('0x29')][_0x86a1('0x77')]=util[_0x86a1('0x5f')](_0x86a1('0x78'),_0x296f6a['user']['name']);_0x389e41[_0x86a1('0x29')][_0x86a1('0x79')]=_0x27803b[_0x86a1('0x79')];_0x389e41[_0x86a1('0x29')]['motionChannel']=_0x27803b[_0x86a1('0x79')];_0x389e41[_0x86a1('0x29')][_0x86a1('0x7a')]='reject';respondWithRpcPromise(_0x86a1('0x7b'),'EventManager',{'event':_0x86a1('0x81'),'message':_0x389e41[_0x86a1('0x29')]},client9002);return _0x27803b;}return null;})['then'](respondWithResult(_0x5eea77,null))[_0x86a1('0x58')](handleError(_0x5eea77,null));};exports[_0x86a1('0x2d')]=function(_0x3b5fd9,_0x2de936,_0x3a7fe0){if(_0x3b5fd9[_0x86a1('0x59')]['id']){delete _0x3b5fd9[_0x86a1('0x59')]['id'];}var _0xd66fd3;return db[_0x86a1('0x3e')][_0x86a1('0x5a')]({'where':{'id':_0x3b5fd9['params']['id']}})['then'](handleEntityNotFound(_0x2de936,null))['then'](function(_0x4ffd1c){if(_0x4ffd1c){_0xd66fd3=_0x4ffd1c;return db[_0x86a1('0x82')][_0x86a1('0x5a')]({'where':{'id':_0x4ffd1c[_0x86a1('0x83')]}});}})[_0x86a1('0x38')](handleEntityNotFound(_0x2de936,null))[_0x86a1('0x38')](function(_0x20c0a1){if(_0x20c0a1){logger['debug'](_0x86a1('0x26'),'status',_0x86a1('0x84'),_0x20c0a1[_0x86a1('0x3f')],util[_0x86a1('0x85')](_0x3b5fd9['body'],{'showHidden':![],'depth':null}));switch(_0x20c0a1[_0x86a1('0x3f')]){case _0x86a1('0x86'):if(_0x3b5fd9[_0x86a1('0x59')]['MessageSid']&&_0x3b5fd9[_0x86a1('0x59')][_0x86a1('0x87')]===_0xd66fd3[_0x86a1('0x88')]){return _0xd66fd3[_0x86a1('0x37')]({'read':!![]});}else{logger[_0x86a1('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x86a1('0x2d'),_0x86a1('0x86'),util[_0x86a1('0x85')](_0x3b5fd9['body'],{'showHidden':![],'depth':null}));}break;case _0x86a1('0x89'):if(_0x3b5fd9[_0x86a1('0x59')][_0x86a1('0x8a')]&&_0x3b5fd9[_0x86a1('0x59')][_0x86a1('0x8a')]===_0xd66fd3['messageId']&&_[_0x86a1('0x8b')]([_0x86a1('0x8c'),_0x86a1('0x8d')],_0x3b5fd9['body']['Status'])>=0x0){return _0xd66fd3[_0x86a1('0x37')]({'read':!![]});}else{logger[_0x86a1('0x28')](_0x86a1('0x8e'),_0x86a1('0x2d'),_0x86a1('0x8f'),util[_0x86a1('0x85')](_0x3b5fd9[_0x86a1('0x59')],{'showHidden':![],'depth':null}));}break;case _0x86a1('0x90'):var _0x13b36f=_0x3b5fd9[_0x86a1('0x59')][_0x86a1('0x91')][0x0];if(_0x13b36f['status'][_0x86a1('0x92')]===_0x86a1('0x93')){return _0xd66fd3[_0x86a1('0x37')]({'read':!![]});}else{logger['error'](_0x86a1('0x8e'),_0x86a1('0x2d'),_0x86a1('0x90'),util[_0x86a1('0x85')](_0x3b5fd9[_0x86a1('0x59')],{'showHidden':![],'depth':null}));}break;}return _0xd66fd3;}})['then'](respondWithResult(_0x2de936,null))['catch'](handleError(_0x2de936,null));};
\ No newline at end of file
+var _0x8b5c=['error','code','message','catch','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','stack','name','index','map','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SmsMessage','findAll','rows','show','keys','includeAll','include','create','body','find','params','destroy','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','sms-interactions','sms','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','email','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','sent','delivered','Status','infobip','results','groupName','DELIVERED','rimraf','fast-json-patch','request-promise','bluebird','mustache','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2cc656,_0x4f500e){var _0x297ef9=function(_0x5e2d39){while(--_0x5e2d39){_0x2cc656['push'](_0x2cc656['shift']());}};_0x297ef9(++_0x4f500e);}(_0x8b5c,0x10d));var _0xc8b5=function(_0x57c3ca,_0x2a6956){_0x57c3ca=_0x57c3ca-0x0;var _0x12a15b=_0x8b5c[_0x57c3ca];return _0x12a15b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8b5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8b5('0x1'));var rp=require(_0xc8b5('0x2'));var moment=require('moment');var BPromise=require(_0xc8b5('0x3'));var Mustache=require(_0xc8b5('0x4'));var util=require('util');var path=require(_0xc8b5('0x5'));var sox=require('sox');var csv=require(_0xc8b5('0x6'));var ejs=require(_0xc8b5('0x7'));var fs=require('fs');var fs_extra=require(_0xc8b5('0x8'));var _=require(_0xc8b5('0x9'));var squel=require(_0xc8b5('0xa'));var crypto=require(_0xc8b5('0xb'));var jsforce=require(_0xc8b5('0xc'));var deskjs=require(_0xc8b5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc8b5('0xe'));var Papa=require(_0xc8b5('0xf'));var Redis=require(_0xc8b5('0x10'));var authService=require(_0xc8b5('0x11'));var qs=require(_0xc8b5('0x12'));var as=require(_0xc8b5('0x13'));var hardwareService=require(_0xc8b5('0x14'));var logger=require(_0xc8b5('0x15'))(_0xc8b5('0x16'));var utils=require(_0xc8b5('0x17'));var config=require(_0xc8b5('0x18'));var licenseUtil=require(_0xc8b5('0x19'));var db=require(_0xc8b5('0x1a'))['db'];config[_0xc8b5('0x1b')]=_[_0xc8b5('0x1c')](config[_0xc8b5('0x1b')],{'host':_0xc8b5('0x1d'),'port':0x18eb});var socket=require(_0xc8b5('0x1e'))(new Redis(config[_0xc8b5('0x1b')]));require(_0xc8b5('0x1f'))[_0xc8b5('0x20')](socket);var jayson=require(_0xc8b5('0x21'));var client=jayson[_0xc8b5('0x22')][_0xc8b5('0x23')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c9bc7,_0x557f1a,_0x1b461c,_0x4b128b){return new BPromise(function(_0x57eeb0,_0xea371){var _0x546e4d=_0x4b128b||client;return _0x546e4d[_0xc8b5('0x24')](_0x5c9bc7,_0x1b461c)['then'](function(_0x42bcd9){logger[_0xc8b5('0x25')](_0xc8b5('0x26'),_0x557f1a,_0xc8b5('0x27'));logger[_0xc8b5('0x28')](_0xc8b5('0x29'),_0x557f1a,_0xc8b5('0x27'),JSON[_0xc8b5('0x2a')](_0x42bcd9));if(_0x42bcd9[_0xc8b5('0x2b')]){if(_0x42bcd9['error'][_0xc8b5('0x2c')]===0x1f4){logger[_0xc8b5('0x2b')](_0xc8b5('0x26'),_0x557f1a,_0x42bcd9[_0xc8b5('0x2b')]['message']);return _0xea371(_0x42bcd9['error'][_0xc8b5('0x2d')]);}logger[_0xc8b5('0x2b')](_0xc8b5('0x26'),_0x557f1a,_0x42bcd9[_0xc8b5('0x2b')][_0xc8b5('0x2d')]);return _0x57eeb0(_0x42bcd9[_0xc8b5('0x2b')][_0xc8b5('0x2d')]);}else{logger[_0xc8b5('0x25')](_0xc8b5('0x26'),_0x557f1a,_0xc8b5('0x27'));_0x57eeb0(_0x42bcd9['result'][_0xc8b5('0x2d')]);}})[_0xc8b5('0x2e')](function(_0x51b64f){logger[_0xc8b5('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x557f1a,_0x51b64f);_0xea371(_0x51b64f);});});}function respondWithStatusCode(_0x2a8b15,_0x227931){_0x227931=_0x227931||0xcc;return function(_0x3af8ad){if(_0x3af8ad){return _0x2a8b15['sendStatus'](_0x227931);}return _0x2a8b15['status'](_0x227931)[_0xc8b5('0x2f')]();};}function respondWithResult(_0x3008b6,_0x3bc71e){_0x3bc71e=_0x3bc71e||0xc8;return function(_0x54275d){if(_0x54275d){return _0x3008b6[_0xc8b5('0x30')](_0x3bc71e)[_0xc8b5('0x31')](_0x54275d);}};}function respondWithFilteredResult(_0x5317d2,_0x37bd73){return function(_0x958c68){if(_0x958c68){var _0x57f64a=typeof _0x37bd73[_0xc8b5('0x32')]===_0xc8b5('0x33')&&typeof _0x37bd73[_0xc8b5('0x34')]==='undefined';var _0x5e89d6=_0x958c68[_0xc8b5('0x35')];var _0x2067ff=_0x57f64a?0x0:_0x37bd73[_0xc8b5('0x32')];var _0x151ad5=_0x57f64a?_0x958c68[_0xc8b5('0x35')]:_0x37bd73[_0xc8b5('0x32')]+_0x37bd73['limit'];var _0x13a1a4;if(_0x151ad5>=_0x5e89d6){_0x151ad5=_0x5e89d6;_0x13a1a4=0xc8;}else{_0x13a1a4=0xce;}_0x5317d2[_0xc8b5('0x30')](_0x13a1a4);return _0x5317d2[_0xc8b5('0x36')]('Content-Range',_0x2067ff+'-'+_0x151ad5+'/'+_0x5e89d6)[_0xc8b5('0x31')](_0x958c68);}return null;};}function patchUpdates(_0x163232){return function(_0x327293){try{jsonpatch[_0xc8b5('0x37')](_0x327293,_0x163232,!![]);}catch(_0x4b7e3a){return BPromise[_0xc8b5('0x38')](_0x4b7e3a);}return _0x327293[_0xc8b5('0x39')]();};}function saveUpdates(_0x48b887,_0x74a26d){return function(_0x47d791){if(_0x47d791){return _0x47d791[_0xc8b5('0x3a')](_0x48b887)[_0xc8b5('0x3b')](function(_0x5271c2){return _0x5271c2;});}return null;};}function removeEntity(_0x4c8b79,_0x5e78d4){return function(_0x5383b5){if(_0x5383b5){return _0x5383b5['destroy']()[_0xc8b5('0x3b')](function(){_0x4c8b79[_0xc8b5('0x30')](0xcc)[_0xc8b5('0x2f')]();});}};}function handleEntityNotFound(_0x414a4b,_0x9f70e8){return function(_0x312d3e){if(!_0x312d3e){_0x414a4b[_0xc8b5('0x3c')](0x194);}return _0x312d3e;};}function handleError(_0x58be7a,_0x2ce2d4){_0x2ce2d4=_0x2ce2d4||0x1f4;return function(_0x33afad){logger[_0xc8b5('0x2b')](_0x33afad[_0xc8b5('0x3d')]);if(_0x33afad[_0xc8b5('0x3e')]){delete _0x33afad[_0xc8b5('0x3e')];}_0x58be7a['status'](_0x2ce2d4)['send'](_0x33afad);};}exports[_0xc8b5('0x3f')]=function(_0xe415a1,_0x2c23ac){var _0x36cfc9={},_0x551a0={},_0x10f143={'count':0x0,'rows':[]};var _0x4b70f2=_[_0xc8b5('0x40')](db['SmsMessage'][_0xc8b5('0x41')],function(_0xd1498d){return{'name':_0xd1498d['fieldName'],'type':_0xd1498d[_0xc8b5('0x42')][_0xc8b5('0x43')]};});_0x551a0[_0xc8b5('0x44')]=_[_0xc8b5('0x40')](_0x4b70f2,_0xc8b5('0x3e'));_0x551a0[_0xc8b5('0x45')]=_['keys'](_0xe415a1[_0xc8b5('0x45')]);_0x551a0['filters']=_['intersection'](_0x551a0[_0xc8b5('0x44')],_0x551a0['query']);_0x36cfc9[_0xc8b5('0x46')]=_[_0xc8b5('0x47')](_0x551a0[_0xc8b5('0x44')],qs[_0xc8b5('0x48')](_0xe415a1[_0xc8b5('0x45')][_0xc8b5('0x48')]));_0x36cfc9[_0xc8b5('0x46')]=_0x36cfc9['attributes'][_0xc8b5('0x49')]?_0x36cfc9[_0xc8b5('0x46')]:_0x551a0['model'];if(!_0xe415a1[_0xc8b5('0x45')][_0xc8b5('0x4a')](_0xc8b5('0x4b'))){_0x36cfc9[_0xc8b5('0x34')]=qs['limit'](_0xe415a1[_0xc8b5('0x45')][_0xc8b5('0x34')]);_0x36cfc9[_0xc8b5('0x32')]=qs[_0xc8b5('0x32')](_0xe415a1['query'][_0xc8b5('0x32')]);}_0x36cfc9[_0xc8b5('0x4c')]=qs[_0xc8b5('0x4d')](_0xe415a1[_0xc8b5('0x45')][_0xc8b5('0x4d')]);_0x36cfc9[_0xc8b5('0x4e')]=qs[_0xc8b5('0x4f')](_[_0xc8b5('0x50')](_0xe415a1[_0xc8b5('0x45')],_0x551a0[_0xc8b5('0x4f')]),_0x4b70f2);if(_0xe415a1[_0xc8b5('0x45')][_0xc8b5('0x51')]){_0x36cfc9[_0xc8b5('0x4e')]=_[_0xc8b5('0x52')](_0x36cfc9[_0xc8b5('0x4e')],{'$or':_[_0xc8b5('0x40')](_0x4b70f2,function(_0x59c6ac){if(_0x59c6ac[_0xc8b5('0x42')]!==_0xc8b5('0x53')){var _0x2c7d42={};_0x2c7d42[_0x59c6ac[_0xc8b5('0x3e')]]={'$like':'%'+_0xe415a1[_0xc8b5('0x45')][_0xc8b5('0x51')]+'%'};return _0x2c7d42;}})});}_0x36cfc9=_[_0xc8b5('0x52')]({},_0x36cfc9,_0xe415a1['options']);var _0x487528={'where':_0x36cfc9[_0xc8b5('0x4e')]};return db['SmsMessage'][_0xc8b5('0x35')](_0x487528)[_0xc8b5('0x3b')](function(_0x3181b1){_0x10f143['count']=_0x3181b1;if(_0xe415a1['query']['includeAll']){_0x36cfc9['include']=[{'all':!![]}];}return db[_0xc8b5('0x54')][_0xc8b5('0x55')](_0x36cfc9);})[_0xc8b5('0x3b')](function(_0x326fa6){_0x10f143[_0xc8b5('0x56')]=_0x326fa6;return _0x10f143;})[_0xc8b5('0x3b')](respondWithFilteredResult(_0x2c23ac,_0x36cfc9))[_0xc8b5('0x2e')](handleError(_0x2c23ac,null));};exports[_0xc8b5('0x57')]=function(_0x130398,_0x35c6e3){var _0x360468={'raw':!![],'where':{'id':_0x130398['params']['id']}},_0x118a52={};_0x118a52[_0xc8b5('0x44')]=_[_0xc8b5('0x58')](db[_0xc8b5('0x54')][_0xc8b5('0x41')]);_0x118a52[_0xc8b5('0x45')]=_[_0xc8b5('0x58')](_0x130398[_0xc8b5('0x45')]);_0x118a52[_0xc8b5('0x4f')]=_[_0xc8b5('0x47')](_0x118a52[_0xc8b5('0x44')],_0x118a52[_0xc8b5('0x45')]);_0x360468[_0xc8b5('0x46')]=_['intersection'](_0x118a52['model'],qs[_0xc8b5('0x48')](_0x130398['query'][_0xc8b5('0x48')]));_0x360468[_0xc8b5('0x46')]=_0x360468['attributes']['length']?_0x360468[_0xc8b5('0x46')]:_0x118a52[_0xc8b5('0x44')];if(_0x130398['query'][_0xc8b5('0x59')]){_0x360468[_0xc8b5('0x5a')]=[{'all':!![]}];}_0x360468=_['merge']({},_0x360468,_0x130398['options']);return db[_0xc8b5('0x54')]['find'](_0x360468)['then'](handleEntityNotFound(_0x35c6e3,null))['then'](respondWithResult(_0x35c6e3,null))[_0xc8b5('0x2e')](handleError(_0x35c6e3,null));};exports[_0xc8b5('0x5b')]=function(_0x163dd6,_0x496697){return db[_0xc8b5('0x54')]['create'](_0x163dd6[_0xc8b5('0x5c')],{})[_0xc8b5('0x3b')](respondWithResult(_0x496697,0xc9))[_0xc8b5('0x2e')](handleError(_0x496697,null));};exports[_0xc8b5('0x3a')]=function(_0x186d64,_0x560753){if(_0x186d64[_0xc8b5('0x5c')]['id']){delete _0x186d64[_0xc8b5('0x5c')]['id'];}return db['SmsMessage'][_0xc8b5('0x5d')]({'where':{'id':_0x186d64[_0xc8b5('0x5e')]['id']}})[_0xc8b5('0x3b')](handleEntityNotFound(_0x560753,null))[_0xc8b5('0x3b')](saveUpdates(_0x186d64[_0xc8b5('0x5c')],null))[_0xc8b5('0x3b')](respondWithResult(_0x560753,null))[_0xc8b5('0x2e')](handleError(_0x560753,null));};exports[_0xc8b5('0x5f')]=function(_0x15d05d,_0x53ae24){return db[_0xc8b5('0x54')][_0xc8b5('0x5d')]({'where':{'id':_0x15d05d[_0xc8b5('0x5e')]['id']}})[_0xc8b5('0x3b')](handleEntityNotFound(_0x53ae24,null))[_0xc8b5('0x3b')](removeEntity(_0x53ae24,null))['catch'](handleError(_0x53ae24,null));};exports[_0xc8b5('0x60')]=function(_0x4cc47d,_0x3f0937){return db['SmsMessage']['describe']()[_0xc8b5('0x3b')](respondWithResult(_0x3f0937,null))[_0xc8b5('0x2e')](handleError(_0x3f0937,null));};var interaction_log=require(_0xc8b5('0x15'))('sms-interactions');exports[_0xc8b5('0x61')]=function(_0x22e42f,_0x581bbb,_0x2b4485){var _0xadb488={'agent':{},'channel':'sms'};if(_0x22e42f['body']['id']){delete _0x22e42f['body']['id'];}_0x22e42f[_0xc8b5('0x5c')][_0xc8b5('0x62')]=!![];_0x22e42f[_0xc8b5('0x5c')]['readAt']=moment()[_0xc8b5('0x63')](_0xc8b5('0x64'));_0x22e42f[_0xc8b5('0x5c')][_0xc8b5('0x65')]=_0x22e42f[_0xc8b5('0x5c')][_0xc8b5('0x65')]||_0x22e42f[_0xc8b5('0x66')]['id'];_0xadb488[_0xc8b5('0x67')]['id']=_0x22e42f[_0xc8b5('0x5c')][_0xc8b5('0x65')];return db[_0xc8b5('0x54')][_0xc8b5('0x5d')]({'where':{'id':_0x22e42f[_0xc8b5('0x5e')]['id'],'UserId':null}})[_0xc8b5('0x3b')](handleEntityNotFound(_0x581bbb,null))[_0xc8b5('0x3b')](saveUpdates(_0x22e42f['body'],null))[_0xc8b5('0x3b')](function(_0x203e77){if(_0x203e77){_0xadb488['message']=_0x203e77[_0xc8b5('0x68')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x203e77[_0xc8b5('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x581bbb,null))[_0xc8b5('0x3b')](function(_0x24ee20){if(_0x24ee20){return _0x24ee20[_0xc8b5('0x3a')]({'UserId':_0x22e42f['body'][_0xc8b5('0x65')],'read1stAt':_[_0xc8b5('0x6a')](_0x24ee20[_0xc8b5('0x6b')])?moment()['format'](_0xc8b5('0x64')):undefined});}return null;})[_0xc8b5('0x3b')](function(_0x5b25c3){if(_0x5b25c3){_0xadb488[_0xc8b5('0x6c')]=_0x5b25c3[_0xc8b5('0x68')]({'plain':!![]});interaction_log[_0xc8b5('0x25')](_0xc8b5('0x6d'),_0x22e42f[_0xc8b5('0x66')]['id'],_0x22e42f[_0xc8b5('0x66')][_0xc8b5('0x3e')],_0x22e42f[_0xc8b5('0x66')][_0xc8b5('0x6e')],_0xadb488[_0xc8b5('0x6c')]['id'],_0x22e42f['body']?JSON[_0xc8b5('0x2a')](_0x22e42f[_0xc8b5('0x5c')]):_0xc8b5('0x6f'));return respondWithRpcPromise(_0xc8b5('0x70'),_0xc8b5('0x71'),_0xadb488);}return null;})[_0xc8b5('0x3b')](function(_0x3aa2ca){var _0x14a6f8=_0xc8b5('0x72')+_0x3aa2ca[_0xc8b5('0x2d')][_0xc8b5('0x73')];return db[_0xc8b5('0x74')][_0xc8b5('0x45')](_0x14a6f8,{'type':db[_0xc8b5('0x75')][_0xc8b5('0x76')][_0xc8b5('0x77')],'raw':!![]})[_0xc8b5('0x3b')](function(_0x3ca21d){return _0x3ca21d;});})['then'](function(_0x138ca8){if(_0x138ca8){_0xadb488[_0xc8b5('0x2d')][_0xc8b5('0x78')]=_0x138ca8[0x0];if(!_0x22e42f[_0xc8b5('0x5c')][_0xc8b5('0x65')])return;return db[_0xc8b5('0x79')][_0xc8b5('0x5d')]({'where':{'id':_0x22e42f['body'][_0xc8b5('0x65')],'role':'agent'},'attributes':['id',_0xc8b5('0x3e'),_0xc8b5('0x7a'),'email',_0xc8b5('0x7b')],'raw':!![]});}return null;})['then'](function(_0x9070eb){if(!_0x9070eb)return null;_0xadb488[_0xc8b5('0x2d')][_0xc8b5('0x67')]=_0x9070eb;return _0xadb488;})['then'](function(_0x92e3f0){if(_0x92e3f0){if(_0x22e42f[_0xc8b5('0x5c')][_0xc8b5('0x7c')]){_0xadb488[_0xc8b5('0x2d')][_0xc8b5('0x7d')]=util[_0xc8b5('0x63')](_0xc8b5('0x7e'),_0x22e42f[_0xc8b5('0x66')]['name']);_0xadb488[_0xc8b5('0x2d')][_0xc8b5('0x7f')]=_0xadb488['channel'];_0xadb488['message'][_0xc8b5('0x80')]=_0xadb488['channel'];_0xadb488[_0xc8b5('0x2d')]['event']=_0xc8b5('0x61');return respondWithRpcPromise(_0xc8b5('0x81'),'EventManager',{'event':_0xc8b5('0x82'),'message':_0xadb488['message']},client9002)[_0xc8b5('0x3b')](function(){return _0xadb488;});}return _0xadb488;}return null;})['then'](respondWithResult(_0x581bbb,null))[_0xc8b5('0x2e')](handleError(_0x581bbb,null));};var interaction_log=require('../../config/logger')(_0xc8b5('0x83'));exports[_0xc8b5('0x38')]=function(_0x27d3ea,_0x357d67,_0x5aafda){var _0x382386={'agent':{},'channel':_0xc8b5('0x84')};if(_0x27d3ea[_0xc8b5('0x5c')]['id']){delete _0x27d3ea[_0xc8b5('0x5c')]['id'];}_0x27d3ea[_0xc8b5('0x5c')][_0xc8b5('0x65')]=_0x27d3ea[_0xc8b5('0x5c')][_0xc8b5('0x65')]||_0x27d3ea[_0xc8b5('0x66')]['id'];_0x382386[_0xc8b5('0x67')]['id']=_0x27d3ea['body']['UserId'];return db['SmsMessage'][_0xc8b5('0x5d')]({'where':{'id':_0x27d3ea['params']['id'],'UserId':null}})[_0xc8b5('0x3b')](handleEntityNotFound(_0x357d67,null))[_0xc8b5('0x3b')](function(_0x1db56f){if(_0x1db56f){_0x382386[_0xc8b5('0x2d')]=_0x1db56f[_0xc8b5('0x68')]({'plain':!![]});return db[_0xc8b5('0x85')][_0xc8b5('0x5d')]({'where':{'id':_0x1db56f[_0xc8b5('0x69')]}});}return null;})[_0xc8b5('0x3b')](handleEntityNotFound(_0x357d67,null))[_0xc8b5('0x3b')](function(_0x334d8f){if(_0x334d8f){_0x382386[_0xc8b5('0x6c')]=_0x334d8f[_0xc8b5('0x68')]({'plain':!![]});interaction_log['info'](_0xc8b5('0x86'),_0x27d3ea[_0xc8b5('0x66')]['id'],_0x27d3ea[_0xc8b5('0x66')][_0xc8b5('0x3e')],_0x27d3ea[_0xc8b5('0x66')][_0xc8b5('0x6e')],_0x382386['interaction']['id'],_0x27d3ea[_0xc8b5('0x5c')]?JSON[_0xc8b5('0x2a')](_0x27d3ea[_0xc8b5('0x5c')]):'null');return respondWithRpcPromise(_0xc8b5('0x87'),_0xc8b5('0x88'),_0x382386);}return null;})['then'](function(_0x5bfe80){var _0x589598=_0xc8b5('0x72')+_0x5bfe80[_0xc8b5('0x2d')][_0xc8b5('0x73')];return db['sequelize'][_0xc8b5('0x45')](_0x589598,{'type':db[_0xc8b5('0x75')][_0xc8b5('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x5f2637){return _0x5f2637;});})[_0xc8b5('0x3b')](function(_0x1a6550){if(_0x1a6550){_0x382386[_0xc8b5('0x2d')][_0xc8b5('0x78')]=_0x1a6550[0x0];if(!_0x27d3ea[_0xc8b5('0x5c')]['UserId'])return;return db[_0xc8b5('0x79')]['find']({'where':{'id':_0x27d3ea[_0xc8b5('0x5c')]['UserId'],'role':_0xc8b5('0x67')},'attributes':['id','name','fullname',_0xc8b5('0x89'),_0xc8b5('0x7b')],'raw':!![]});}return null;})[_0xc8b5('0x3b')](function(_0x3c004e){if(!_0x3c004e)return null;_0x382386[_0xc8b5('0x2d')][_0xc8b5('0x67')]=_0x3c004e;return _0x382386;})[_0xc8b5('0x3b')](function(_0x3e436e){if(_0x3e436e){_0x3e436e[_0xc8b5('0x2d')][_0xc8b5('0x7d')]=util[_0xc8b5('0x63')](_0xc8b5('0x7e'),_0x27d3ea[_0xc8b5('0x66')][_0xc8b5('0x3e')]);_0x3e436e[_0xc8b5('0x2d')][_0xc8b5('0x7f')]=_0x382386[_0xc8b5('0x7f')];_0x3e436e[_0xc8b5('0x2d')]['motionChannel']=_0x382386[_0xc8b5('0x7f')];_0x3e436e[_0xc8b5('0x2d')][_0xc8b5('0x8a')]=_0xc8b5('0x38');respondWithRpcPromise('EventManager','EventManager',{'event':_0xc8b5('0x8b'),'message':_0x3e436e[_0xc8b5('0x2d')]},client9002);return _0x382386;}return null;})['then'](respondWithResult(_0x357d67,null))[_0xc8b5('0x2e')](handleError(_0x357d67,null));};exports[_0xc8b5('0x30')]=function(_0xff67b2,_0x107140,_0x5db209){if(_0xff67b2[_0xc8b5('0x5c')]['id']){delete _0xff67b2['body']['id'];}var _0x5165a4;return db['SmsMessage']['find']({'where':{'id':_0xff67b2[_0xc8b5('0x5e')]['id']}})['then'](handleEntityNotFound(_0x107140,null))[_0xc8b5('0x3b')](function(_0xc2713c){if(_0xc2713c){_0x5165a4=_0xc2713c;return db[_0xc8b5('0x8c')][_0xc8b5('0x5d')]({'where':{'id':_0xc2713c[_0xc8b5('0x8d')]}});}})[_0xc8b5('0x3b')](handleEntityNotFound(_0x107140,null))[_0xc8b5('0x3b')](function(_0x367d65){if(_0x367d65){logger[_0xc8b5('0x28')](_0xc8b5('0x29'),_0xc8b5('0x30'),_0xc8b5('0x8e'),_0x367d65[_0xc8b5('0x42')],util[_0xc8b5('0x8f')](_0xff67b2[_0xc8b5('0x5c')],{'showHidden':![],'depth':null}));switch(_0x367d65[_0xc8b5('0x42')]){case _0xc8b5('0x90'):if(_0xff67b2['body']['MessageSid']&&_0xff67b2['body'][_0xc8b5('0x91')]===_0x5165a4[_0xc8b5('0x92')]){return _0x5165a4['update']({'read':!![]});}else{logger[_0xc8b5('0x2b')](_0xc8b5('0x93'),'status',_0xc8b5('0x90'),util[_0xc8b5('0x8f')](_0xff67b2[_0xc8b5('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xc8b5('0x94'):if(_0xff67b2[_0xc8b5('0x5c')]['MessageUUID']&&_0xff67b2[_0xc8b5('0x5c')]['MessageUUID']===_0x5165a4[_0xc8b5('0x92')]&&_['indexOf']([_0xc8b5('0x95'),_0xc8b5('0x96')],_0xff67b2[_0xc8b5('0x5c')][_0xc8b5('0x97')])>=0x0){return _0x5165a4[_0xc8b5('0x3a')]({'read':!![]});}else{logger['error'](_0xc8b5('0x93'),_0xc8b5('0x30'),'plivio',util[_0xc8b5('0x8f')](_0xff67b2['body'],{'showHidden':![],'depth':null}));}break;case _0xc8b5('0x98'):var _0x39dd24=_0xff67b2[_0xc8b5('0x5c')][_0xc8b5('0x99')][0x0];if(_0x39dd24[_0xc8b5('0x30')][_0xc8b5('0x9a')]===_0xc8b5('0x9b')){return _0x5165a4[_0xc8b5('0x3a')]({'read':!![]});}else{logger[_0xc8b5('0x2b')](_0xc8b5('0x93'),_0xc8b5('0x30'),_0xc8b5('0x98'),util['inspect'](_0xff67b2['body'],{'showHidden':![],'depth':null}));}break;}return _0x5165a4;}})[_0xc8b5('0x3b')](respondWithResult(_0x107140,null))[_0xc8b5('0x2e')](handleError(_0x107140,null));};
\ No newline at end of file
index 63ed70c..19f2bd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfef2=['hook','events','SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfef2,0x1d9));var _0x2fef=function(_0x29e398,_0x890225){_0x29e398=_0x29e398-0x0;var _0xd799e2=_0xfef2[_0x29e398];return _0xd799e2;};'use strict';var EventEmitter=require(_0x2fef('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x2fef('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2fef('0x2')](0x0);var events={'afterCreate':_0x2fef('0x3'),'afterUpdate':_0x2fef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46e66f){return function(_0x55232a,_0xea36f8,_0x29d329){SmsMessageEvents[_0x2fef('0x5')](_0x46e66f+':'+_0x55232a['id'],_0x55232a);SmsMessageEvents[_0x2fef('0x5')](_0x46e66f,_0x55232a);_0x29d329(null);};}for(var e in events){if(events[_0x2fef('0x6')](e)){var event=events[e];SmsMessage[_0x2fef('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
+var _0xfbbd=['save','update','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5e8db9,_0x20c056){var _0x28c622=function(_0x5d48a3){while(--_0x5d48a3){_0x5e8db9['push'](_0x5e8db9['shift']());}};_0x28c622(++_0x20c056);}(_0xfbbd,0x16d));var _0xdfbb=function(_0x3f4f4f,_0x4c0c41){_0x3f4f4f=_0x3f4f4f-0x0;var _0x3f24c9=_0xfbbd[_0x3f4f4f];return _0x3f24c9;};'use strict';var EventEmitter=require(_0xdfbb('0x0'));var SmsMessage=require(_0xdfbb('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdfbb('0x2')](0x0);var events={'afterCreate':_0xdfbb('0x3'),'afterUpdate':_0xdfbb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c1943){return function(_0xe423ad,_0x1eed99,_0x225d98){SmsMessageEvents['emit'](_0x5c1943+':'+_0xe423ad['id'],_0xe423ad);SmsMessageEvents['emit'](_0x5c1943,_0xe423ad);_0x225d98(null);};}for(var e in events){if(events[_0xdfbb('0x5')](e)){var event=events[e];SmsMessage[_0xdfbb('0x6')](e,emitEvent(event));}}module[_0xdfbb('0x7')]=SmsMessageEvents;
\ No newline at end of file
index 2e07dcf..8c56848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x720b=['https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','message','refid','status','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/status?token=','token','sid','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','split','sms','POST','session_key','total_sent','deliveryReport','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','read','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','length','createHash','md5','signature=','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','code'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x720b,0x17a));var _0xb720=function(_0x5b80f4,_0x1552d2){_0x5b80f4=_0x5b80f4-0x0;var _0x363c0b=_0x720b[_0x5b80f4];return _0x363c0b;};'use strict';var _=require(_0xb720('0x0'));var util=require(_0xb720('0x1'));var logger=require(_0xb720('0x2'))('api');var moment=require(_0xb720('0x3'));var BPromise=require(_0xb720('0x4'));var rp=require(_0xb720('0x5'));var fs=require('fs');var path=require(_0xb720('0x6'));var rimraf=require('rimraf');var config=require(_0xb720('0x7'));var attributes=require('./smsMessage.attributes');module[_0xb720('0x8')]=function(_0x1a7a54,_0x231c6b){return _0x1a7a54[_0xb720('0x9')](_0xb720('0xa'),attributes,{'tableName':_0xb720('0xb'),'paranoid':![],'indexes':[{'name':_0xb720('0xc'),'fields':[_0xb720('0xc')]},{'name':_0xb720('0xd'),'fields':['body'],'type':_0xb720('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ccfd4,_0xf4a21c,_0x16bb47){var _0x5389a5=_0x1a7a54[_0xb720('0xf')];var _0x27782d=_0x5ccfd4['get']({'plain':!![]});if(_0x27782d[_0xb720('0x10')][_0xb720('0x11')]()==='in'||_0x27782d['direction']['toLowerCase']()===_0xb720('0x12')&&!_0x27782d[_0xb720('0x13')]&&!_[_0xb720('0x14')](_0x27782d[_0xb720('0x15')])&&!_[_0xb720('0x14')](_0x27782d[_0xb720('0x16')])){_0x5389a5['SmsInteraction']['findOne']({'where':{'id':_0x27782d[_0xb720('0x16')]}})[_0xb720('0x17')](function(_0x3e6189){if(_0x3e6189){_0x3e6189[_0xb720('0x18')]({'lastMsgAt':_0x27782d[_0xb720('0x19')],'lastMsgDirection':_0x27782d['direction'][_0xb720('0x11')]()});}})[_0xb720('0x1a')](function(_0x3aee58){console[_0xb720('0x1b')](_0x3aee58);});}if(_0x27782d['direction']==='out'&&!_0x27782d[_0xb720('0x13')]){var _0x193a83;_0x5389a5[_0xb720('0x1c')]['find']({'where':{'id':_0x27782d[_0xb720('0x1d')]},'raw':!![]})[_0xb720('0x17')](function(_0x3d2b78){_0x193a83=_0x3d2b78;if(_0x193a83&&_0x193a83[_0xb720('0x1e')]){switch(_0x193a83['type']){case _0xb720('0x1f'):var _0x4f8dd6=require(_0xb720('0x1f'));if(_0x193a83[_0xb720('0x20')]&&_0x193a83[_0xb720('0x21')]&&_0x193a83[_0xb720('0x22')]){var _0x30b86b=new _0x4f8dd6(_0x193a83['accountSid'],_0x193a83[_0xb720('0x21')]);_0x30b86b[_0xb720('0x23')][_0xb720('0x24')]({'body':_0x27782d[_0xb720('0x25')],'to':_0x27782d[_0xb720('0x22')],'from':_0x193a83[_0xb720('0x22')],'statusCallback':_0x193a83[_0xb720('0x26')]+'/api/sms/messages/'+_0x27782d['id']+_0xb720('0x27')+_0x193a83[_0xb720('0x28')]})[_0xb720('0x17')](function(_0x2099ab){if(_0x2099ab[_0xb720('0x29')]){return _0x5ccfd4['update']({'messageId':_0x2099ab[_0xb720('0x29')]});}})[_0xb720('0x1a')](function(_0x83b526){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb720('0x2a'),_0xb720('0x1f'),util[_0xb720('0x2b')](_0x83b526,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb720('0x2a'),_0xb720('0x1f'),_0xb720('0x2c'));}break;case _0xb720('0x2d'):var _0x5b82ff=_0xb720('0x2e');if(_0x193a83[_0xb720('0x2f')]&&_0x193a83[_0xb720('0x30')]){var _0x1f50da={'recipient':[_0x27782d['phone']],'message':_0x27782d['body'],'message_type':_0x193a83[_0xb720('0x31')]};if(_0x193a83[_0xb720('0x31')]&&_0x193a83[_0xb720('0x31')]!=='SI'){_0x1f50da['sender']=_0x193a83[_0xb720('0x22')];}var _0x34b123={'url':_0x5b82ff+_0xb720('0x32')+_0x193a83[_0xb720('0x2f')]+'&password='+_0x193a83[_0xb720('0x30')],'method':'GET'};rp(_0x34b123)['then'](function(_0x74fcc5){var _0x162d98=_0x74fcc5[_0xb720('0x33')](';');var _0x29cb08={'user_key':_0x162d98[0x0],'session_key':_0x162d98[0x1]};_0x34b123={'url':_0x5b82ff+_0xb720('0x34'),'method':_0xb720('0x35'),'headers':{'user_key':_0x29cb08['user_key'],'Session_key':_0x29cb08[_0xb720('0x36')]},'json':!![],'body':_0x1f50da};return rp(_0x34b123);})[_0xb720('0x17')](function(_0x345f6c){if(_0x345f6c[_0xb720('0x37')]>=0x1){var _0x1354e9={'messageId':_0x345f6c['internal_order_id']};if(_0x193a83[_0xb720('0x31')]!=='GP'||!_0x193a83[_0xb720('0x38')]){_0x1354e9['read']=!![];}return _0x5ccfd4[_0xb720('0x18')](_0x1354e9);}else{return logger['error'](_0xb720('0x39'),'afterCreate',_0xb720('0x2d'),util['inspect'](_0x345f6c,{'showHidden':![],'depth':null}));}})[_0xb720('0x1a')](function(_0x14abe9){return logger[_0xb720('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb720('0x2a'),'skebby',util[_0xb720('0x2b')](_0x14abe9,{'showHidden':![],'depth':null}));});}else{logger[_0xb720('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb720('0x2a'),_0xb720('0x2d'),_0xb720('0x3a'));}break;case'connectel':if(_0x193a83['authToken']){var _0x48ced1={'recipient':_0x27782d[_0xb720('0x22')],'message':_0x27782d[_0xb720('0x25')],'sender':_0x193a83['senderString']||_0x193a83['phone'],'authorization':_0x193a83[_0xb720('0x21')]};var _0xf4a21c={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x48ced1,'json':!![]};rp(_0xf4a21c)['then'](function(_0x416e66){var _0x5befd2={'messageId':_0x416e66[_0xb720('0x3b')]};if(!_0x193a83['deliveryReport']){_0x5befd2['read']=!![];}return _0x5ccfd4[_0xb720('0x18')](_0x5befd2);})[_0xb720('0x1a')](function(_0x740211){logger['error'](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x3c'),util[_0xb720('0x2b')](_0x740211,{'showHidden':![],'depth':null}));});}else{logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x3c'),_0xb720('0x3d'));}break;case _0xb720('0x3e'):if(_0x193a83['username']&&_0x193a83[_0xb720('0x30')]){var _0x48ced1={'messages':[{'source':'xCALLY\x20Motion','to':_0x27782d['phone'],'body':_0x27782d['body'],'from':_0x193a83[_0xb720('0x3f')]||_0x193a83[_0xb720('0x22')]}]};var _0x43ea9a=util[_0xb720('0x40')](_0xb720('0x41'),_0x193a83[_0xb720('0x2f')],_0x193a83[_0xb720('0x30')]);var _0xf4a21c={'method':'POST','uri':_0xb720('0x42'),'body':_0x48ced1,'headers':{'Authorization':util[_0xb720('0x40')](_0xb720('0x43'),new Buffer(_0x43ea9a)[_0xb720('0x44')](_0xb720('0x45')))},'json':!![]};rp(_0xf4a21c)[_0xb720('0x17')](function(_0x58b320){if(_0x58b320[_0xb720('0x46')]>=0xc8&&_0x58b320['http_code']<=0xce){if(_0x58b320[_0xb720('0x47')]&&_0x58b320[_0xb720('0x47')][_0xb720('0x48')]>0x0){var _0xfb9a95=_[_0xb720('0x49')](_0x58b320['data'][_0xb720('0x23')]);var _0x5a5bac={'messageId':_0xfb9a95[_0xb720('0x4a')]};if(!_0x193a83[_0xb720('0x38')]){_0x5a5bac[_0xb720('0x4b')]=!![];}return _0x5ccfd4['update'](_0x5a5bac);}else{logger['error'](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x4c'),util[_0xb720('0x2b')](_0x58b320,{'showHidden':![],'depth':null}));}}else{logger[_0xb720('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb720('0x2a'),_0xb720('0x4c'),util[_0xb720('0x2b')](_0x58b320,{'showHidden':![],'depth':null}));}})[_0xb720('0x1a')](function(_0x3068e1){logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x4c'),util[_0xb720('0x2b')](_0x3068e1,{'showHidden':![],'depth':null}));});}else{logger[_0xb720('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb720('0x4c'),_0xb720('0x3a'));}break;case _0xb720('0x4d'):if(_0x193a83[_0xb720('0x4e')]&&_0x193a83[_0xb720('0x21')]){var _0x48ced1={'dst':_0x27782d['phone'],'text':_0x27782d[_0xb720('0x25')],'src':_0x193a83[_0xb720('0x3f')]||_0x193a83[_0xb720('0x22')],'url':_0x193a83[_0xb720('0x26')]+_0xb720('0x4f')+_0x27782d['id']+_0xb720('0x27')+_0x193a83[_0xb720('0x28')]};var _0x43ea9a=util[_0xb720('0x40')](_0xb720('0x41'),_0x193a83[_0xb720('0x4e')],_0x193a83[_0xb720('0x21')]);var _0xf4a21c={'method':_0xb720('0x35'),'uri':util['format'](_0xb720('0x50'),_0x193a83[_0xb720('0x4e')]),'body':_0x48ced1,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x43ea9a)[_0xb720('0x44')](_0xb720('0x45')))},'json':!![]};rp(_0xf4a21c)[_0xb720('0x17')](function(_0x12bb4a){var _0x439ab7={'messageId':_0x12bb4a['message_uuid'][0x0]};return _0x5ccfd4[_0xb720('0x18')](_0x439ab7);})['catch'](function(_0x19fe9c){logger[_0xb720('0x1b')](_0xb720('0x39'),'afterCreate',_0xb720('0x4d'),util[_0xb720('0x2b')](_0x19fe9c,{'showHidden':![],'depth':null}));});}else{logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),'plivo',_0xb720('0x51'));}break;case'infobip':if(_0x193a83[_0xb720('0x2f')]&&_0x193a83['password']){if(_0x193a83[_0xb720('0x52')]){var _0x30fb08={'method':_0xb720('0x35'),'uri':_0x193a83[_0xb720('0x52')]+'/auth/1/session','body':{'username':_0x193a83[_0xb720('0x2f')],'password':_0x193a83[_0xb720('0x30')]},'json':!![]};return rp(_0x30fb08)[_0xb720('0x17')](function(_0x342a7e){var _0xf108d7={'method':_0xb720('0x35'),'uri':_0x193a83[_0xb720('0x52')]+_0xb720('0x53'),'body':{'messages':[{'from':_0x193a83['phone'],'destinations':[{'to':_0x27782d[_0xb720('0x22')]}],'text':_0x27782d['body'],'notifyUrl':_0x193a83[_0xb720('0x26')]+'/api/sms/messages/'+_0x27782d['id']+_0xb720('0x27')+_0x193a83[_0xb720('0x28')],'notifyContentType':_0xb720('0x54'),'callbackData':_0x193a83['phone']+';'+_0x27782d[_0xb720('0x25')]}]},'headers':{'Authorization':_0xb720('0x55')+_0x342a7e[_0xb720('0x28')]},'json':!![]};return rp(_0xf108d7)[_0xb720('0x17')](function(_0x457adb){if(_0x457adb[_0xb720('0x23')]){var _0xaa91d9={'messageId':_0x457adb[_0xb720('0x23')][0x0][_0xb720('0xc')]};if(!_0x193a83[_0xb720('0x38')]){_0xaa91d9['read']=!![];}return _0x5ccfd4[_0xb720('0x18')](_0xaa91d9);}else{return logger[_0xb720('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb720('0x2a'),_0xb720('0x56'),util[_0xb720('0x2b')](_0x457adb,{'showHidden':![],'depth':null}));}});})[_0xb720('0x1a')](function(_0x5af6eb){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb720('0x2a'),_0xb720('0x56'),util['inspect'](_0x5af6eb,{'showHidden':![],'depth':null}));});}else{logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x56'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xb720('0x1b')](_0xb720('0x39'),'afterCreate','infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0xb720('0x57'):var _0xe2caf=require(_0xb720('0x58'));if(_0x193a83[_0xb720('0x59')]){var _0x404412={};_0x404412[_0xb720('0x5a')]=_0x193a83[_0xb720('0x2f')];_0x404412[_0xb720('0x22')]=_0x27782d[_0xb720('0x22')];_0x404412[_0xb720('0x5b')]=_0x193a83['phone'];_0x404412[_0xb720('0x5c')]=_0x27782d[_0xb720('0x25')];_0x404412[_0xb720('0x5d')]=+new Date();var _0x5904a2='';var _0x30c666='';var _0x447c66=Object[_0xb720('0x5e')](_0x404412);_0x447c66[_0xb720('0x5f')]();for(var _0x40da66=0x0;_0x40da66<_0x447c66[_0xb720('0x60')];_0x40da66++){if(_0x5904a2!=''){_0x5904a2+='&';}_0x5904a2+=_0x447c66[_0x40da66]+'='+encodeURIComponent(_0x404412[_0x447c66[_0x40da66]]);_0x30c666+=_0x404412[_0x447c66[_0x40da66]];}_0x30c666+=_0x193a83[_0xb720('0x59')];_0x30c666=_0xe2caf[_0xb720('0x61')](_0xb720('0x62'))[_0xb720('0x18')](_0x30c666)['digest']('hex');if(_0x5904a2!==''){_0x5904a2+='&';}_0x5904a2+=_0xb720('0x63')+_0x30c666;var _0x34b123={'method':'GET','uri':_0x193a83[_0xb720('0x52')]+_0xb720('0x64')+_0x5904a2,'json':!![]};return rp(_0x34b123)['then'](function(_0x2dcfc2){var _0x3ba1d3=Object[_0xb720('0x5e')](_0x2dcfc2);if(_0x2dcfc2[_0x3ba1d3[0x0]][_0xb720('0x1b')]&&parseInt(_0x2dcfc2[_0x3ba1d3[0x0]][_0xb720('0x1b')])===0x0){var _0x173e59={'messageId':_0x2dcfc2[_0x3ba1d3[0x0]]['id_sms']};if(!_0x193a83[_0xb720('0x38')]){_0x173e59[_0xb720('0x4b')]=!![];}return _0x5ccfd4[_0xb720('0x18')](_0x173e59);}else{return logger['error'](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x57'),util[_0xb720('0x2b')](_0x2dcfc2[_0xb720('0x1b')],{'showHidden':![],'depth':null}));}})[_0xb720('0x1a')](function(_0x28fdf8){return logger[_0xb720('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb720('0x57'),util['inspect'](_0x28fdf8,{'showHidden':![],'depth':null}));});}else{logger[_0xb720('0x1b')](_0xb720('0x39'),'afterCreate',_0xb720('0x57'),'Missing\x20parameters:\x20apiKey');}break;case _0xb720('0x65'):if(_0x193a83[_0xb720('0x59')]){var _0x41fae2={'method':_0xb720('0x35'),'uri':_0xb720('0x66'),'headers':{'Authorization':_0x193a83[_0xb720('0x59')]},'body':{'content':_0x27782d[_0xb720('0x25')],'to':[_0x27782d[_0xb720('0x22')]],'from':_0x193a83[_0xb720('0x22')],'binary':![],'clientMessageId':_0xb720('0x67'),'charset':_0xb720('0x68')},'json':!![]};rp(_0x41fae2)[_0xb720('0x17')](function(_0x3328b0){if(!_0x3328b0['error']){var _0x24392d={'messageId':_0x3328b0[_0xb720('0x23')][0x0][_0xb720('0x69')]};if(!_0x193a83[_0xb720('0x38')]){_0x24392d[_0xb720('0x4b')]=!![];}return _0x5ccfd4['update'](_0x24392d);}else{return logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x65'),util[_0xb720('0x2b')](_0x3328b0['error'],{'showHidden':![],'depth':null}));}})[_0xb720('0x1a')](function(_0x16a2db){return logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x65'),util[_0xb720('0x2b')](_0x16a2db,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x65'),_0xb720('0x6a'));}break;case _0xb720('0x6b'):if(_0x193a83['username']&&_0x193a83[_0xb720('0x30')]){var _0x43ea9a=util['format'](_0xb720('0x41'),_0x193a83['username'],_0x193a83[_0xb720('0x30')]);var _0xf4a21c={'method':_0xb720('0x35'),'uri':_0xb720('0x6c')+_0x193a83[_0xb720('0x6d')]+_0xb720('0x6e'),'body':{'to':[_0x27782d[_0xb720('0x22')]],'text':_0x27782d[_0xb720('0x25')],'from':_0x193a83['phone'],'applicationId':_0x193a83[_0xb720('0x6f')]},'headers':{'Authorization':util[_0xb720('0x40')](_0xb720('0x43'),new Buffer(_0x43ea9a)[_0xb720('0x44')](_0xb720('0x45')))},'json':!![]};rp(_0xf4a21c)[_0xb720('0x17')](function(_0x39c6d8){if(_0x39c6d8['id']){var _0x394802={'messageId':_0x39c6d8['id']};return _0x5ccfd4['update'](_0x394802);}else{logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),'bandwidth',util[_0xb720('0x2b')](_0x39c6d8,{'showHidden':![],'depth':null}));}})[_0xb720('0x1a')](function(_0x3c733f){logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),'bandwidth',util[_0xb720('0x2b')](_0x3c733f,{'showHidden':![],'depth':null}));});}else{logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x6b'),_0xb720('0x3a'));}break;case'intelepeer':if(_0x193a83[_0xb720('0x59')]){var _0x40c93c={};var _0x34b123={'method':'POST','uri':_0xb720('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x193a83[_0xb720('0x59')],'Content-Type':'application/json'},'body':{'from':_0x193a83[_0xb720('0x22')],'to':_0x27782d[_0xb720('0x22')],'text':_0x27782d[_0xb720('0x25')]},'json':!![]};return rp(_0x34b123)[_0xb720('0x17')](function(_0x1e283e){if(_0x1e283e[_0xb720('0x71')]==0xca){_0x40c93c['message']=_0x1e283e;var _0x19ab32={'method':_0xb720('0x35'),'uri':_0xb720('0x72'),'headers':{'Authorization':_0xb720('0x73')+_0x193a83[_0xb720('0x59')],'Content-Type':'application/json'},'body':{'refid':_0x40c93c[_0xb720('0x74')][_0xb720('0x75')]},'json':!![]};return rp(_0x19ab32)[_0xb720('0x17')](function(_0xa1956){_0x40c93c[_0xb720('0x76')]=_0xa1956;var _0x87e9c={'messageId':_0x40c93c['message'][_0xb720('0x75')],'read':!![]};return _0x5ccfd4[_0xb720('0x18')](_0x87e9c);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb720('0x2a'),_0xb720('0x77'),util['inspect'](_0x1e283e,{'showHidden':![],'depth':null}));}})[_0xb720('0x1a')](function(_0x54d41e){return logger[_0xb720('0x1b')](_0xb720('0x39'),'afterCreate',_0xb720('0x77'),util['inspect'](_0x54d41e,{'showHidden':![],'depth':null}));});}else{return logger[_0xb720('0x1b')](_0xb720('0x39'),_0xb720('0x2a'),_0xb720('0x77'),'Token\x20not\x20received');}break;}}})[_0xb720('0x78')](function(){_0x16bb47();});}else{_0x16bb47();}}},'charset':_0xb720('0x79'),'collate':_0xb720('0x7a')});};
\ No newline at end of file
+var _0x22d3=['SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','/api/sms/messages/','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','head','message_id','clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','Missing\x20parameters:\x20base_url','csc','text','keys','sort','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','apiKey','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','out','secret','SmsAccount','find'];(function(_0x339ff0,_0x27d2df){var _0x454c5e=function(_0x1db213){while(--_0x1db213){_0x339ff0['push'](_0x339ff0['shift']());}};_0x454c5e(++_0x27d2df);}(_0x22d3,0xcc));var _0x322d=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0x22d3[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0x322d('0x0'));var util=require(_0x322d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x322d('0x2'));var BPromise=require(_0x322d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x322d('0x4'));var rimraf=require(_0x322d('0x5'));var config=require(_0x322d('0x6'));var attributes=require(_0x322d('0x7'));module[_0x322d('0x8')]=function(_0x49fc68,_0x48378c){return _0x49fc68[_0x322d('0x9')](_0x322d('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x322d('0xb')],'type':_0x322d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x273ce1,_0x5714b6,_0x1051cf){var _0x2c8704=_0x49fc68[_0x322d('0xd')];var _0x36ae3d=_0x273ce1[_0x322d('0xe')]({'plain':!![]});if(_0x36ae3d[_0x322d('0xf')][_0x322d('0x10')]()==='in'||_0x36ae3d[_0x322d('0xf')][_0x322d('0x10')]()==='out'&&!_0x36ae3d['secret']&&!_[_0x322d('0x11')](_0x36ae3d[_0x322d('0x12')])&&!_[_0x322d('0x11')](_0x36ae3d[_0x322d('0x13')])){_0x2c8704[_0x322d('0x14')][_0x322d('0x15')]({'where':{'id':_0x36ae3d[_0x322d('0x13')]}})[_0x322d('0x16')](function(_0x173116){if(_0x173116){_0x173116[_0x322d('0x17')]({'lastMsgAt':_0x36ae3d[_0x322d('0x18')],'lastMsgDirection':_0x36ae3d[_0x322d('0xf')][_0x322d('0x10')]()});}})[_0x322d('0x19')](function(_0x1b34d9){console['error'](_0x1b34d9);});}if(_0x36ae3d[_0x322d('0xf')]===_0x322d('0x1a')&&!_0x36ae3d[_0x322d('0x1b')]){var _0xe3b41d;_0x2c8704[_0x322d('0x1c')][_0x322d('0x1d')]({'where':{'id':_0x36ae3d[_0x322d('0x1e')]},'raw':!![]})['then'](function(_0x42a640){_0xe3b41d=_0x42a640;if(_0xe3b41d&&_0xe3b41d[_0x322d('0x1f')]){switch(_0xe3b41d[_0x322d('0x1f')]){case _0x322d('0x20'):var _0x382f9e=require(_0x322d('0x20'));if(_0xe3b41d[_0x322d('0x21')]&&_0xe3b41d['authToken']&&_0xe3b41d[_0x322d('0x22')]){var _0x12e10e=new _0x382f9e(_0xe3b41d[_0x322d('0x21')],_0xe3b41d[_0x322d('0x23')]);_0x12e10e[_0x322d('0x24')][_0x322d('0x25')]({'body':_0x36ae3d[_0x322d('0xb')],'to':_0x36ae3d['phone'],'from':_0xe3b41d[_0x322d('0x22')],'statusCallback':_0xe3b41d['remote']+_0x322d('0x26')+_0x36ae3d['id']+_0x322d('0x27')+_0xe3b41d['token']})[_0x322d('0x16')](function(_0x2fb7b7){if(_0x2fb7b7[_0x322d('0x28')]){return _0x273ce1['update']({'messageId':_0x2fb7b7[_0x322d('0x28')]});}})[_0x322d('0x19')](function(_0x3d15e0){logger[_0x322d('0x29')](_0x322d('0x2a'),'afterCreate','twilio',util[_0x322d('0x2b')](_0x3d15e0,{'showHidden':![],'depth':null}));});}else{logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x322d('0x2d'):var _0x354381=_0x322d('0x2e');if(_0xe3b41d[_0x322d('0x2f')]&&_0xe3b41d[_0x322d('0x30')]){var _0x3472d6={'recipient':[_0x36ae3d[_0x322d('0x22')]],'message':_0x36ae3d[_0x322d('0xb')],'message_type':_0xe3b41d['smsMethod']};if(_0xe3b41d[_0x322d('0x31')]&&_0xe3b41d[_0x322d('0x31')]!=='SI'){_0x3472d6[_0x322d('0x32')]=_0xe3b41d[_0x322d('0x22')];}var _0x423c7e={'url':_0x354381+_0x322d('0x33')+_0xe3b41d['username']+_0x322d('0x34')+_0xe3b41d[_0x322d('0x30')],'method':_0x322d('0x35')};rp(_0x423c7e)[_0x322d('0x16')](function(_0x5c16ba){var _0x3db216=_0x5c16ba[_0x322d('0x36')](';');var _0x32cd3c={'user_key':_0x3db216[0x0],'session_key':_0x3db216[0x1]};_0x423c7e={'url':_0x354381+_0x322d('0x37'),'method':_0x322d('0x38'),'headers':{'user_key':_0x32cd3c[_0x322d('0x39')],'Session_key':_0x32cd3c[_0x322d('0x3a')]},'json':!![],'body':_0x3472d6};return rp(_0x423c7e);})[_0x322d('0x16')](function(_0x11bf86){if(_0x11bf86[_0x322d('0x3b')]>=0x1){var _0x243403={'messageId':_0x11bf86[_0x322d('0x3c')]};if(_0xe3b41d[_0x322d('0x31')]!=='GP'||!_0xe3b41d[_0x322d('0x3d')]){_0x243403[_0x322d('0x3e')]=!![];}return _0x273ce1[_0x322d('0x17')](_0x243403);}else{return logger[_0x322d('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x322d('0x2c'),'skebby',util['inspect'](_0x11bf86,{'showHidden':![],'depth':null}));}})[_0x322d('0x19')](function(_0x31ac32){return logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x2d'),util[_0x322d('0x2b')](_0x31ac32,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x2d'),_0x322d('0x3f'));}break;case'connectel':if(_0xe3b41d[_0x322d('0x23')]){var _0x2acdae={'recipient':_0x36ae3d['phone'],'message':_0x36ae3d[_0x322d('0xb')],'sender':_0xe3b41d[_0x322d('0x40')]||_0xe3b41d['phone'],'authorization':_0xe3b41d[_0x322d('0x23')]};var _0x5714b6={'method':'POST','uri':_0x322d('0x41'),'body':_0x2acdae,'json':!![]};rp(_0x5714b6)[_0x322d('0x16')](function(_0x33fef2){var _0x37771f={'messageId':_0x33fef2[_0x322d('0x42')]};if(!_0xe3b41d['deliveryReport']){_0x37771f[_0x322d('0x3e')]=!![];}return _0x273ce1[_0x322d('0x17')](_0x37771f);})[_0x322d('0x19')](function(_0x42022f){logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x43'),util[_0x322d('0x2b')](_0x42022f,{'showHidden':![],'depth':null}));});}else{logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x322d('0x44'):if(_0xe3b41d[_0x322d('0x2f')]&&_0xe3b41d[_0x322d('0x30')]){var _0x2acdae={'messages':[{'source':_0x322d('0x45'),'to':_0x36ae3d[_0x322d('0x22')],'body':_0x36ae3d[_0x322d('0xb')],'from':_0xe3b41d[_0x322d('0x40')]||_0xe3b41d[_0x322d('0x22')]}]};var _0x30df19=util[_0x322d('0x46')](_0x322d('0x47'),_0xe3b41d[_0x322d('0x2f')],_0xe3b41d[_0x322d('0x30')]);var _0x5714b6={'method':_0x322d('0x38'),'uri':_0x322d('0x48'),'body':_0x2acdae,'headers':{'Authorization':util[_0x322d('0x46')]('Basic\x20%s',new Buffer(_0x30df19)[_0x322d('0x49')](_0x322d('0x4a')))},'json':!![]};rp(_0x5714b6)['then'](function(_0x600ec8){if(_0x600ec8[_0x322d('0x4b')]>=0xc8&&_0x600ec8[_0x322d('0x4b')]<=0xce){if(_0x600ec8[_0x322d('0x4c')]&&_0x600ec8[_0x322d('0x4c')]['queued_count']>0x0){var _0x227a58=_[_0x322d('0x4d')](_0x600ec8[_0x322d('0x4c')][_0x322d('0x24')]);var _0x5be6af={'messageId':_0x227a58[_0x322d('0x4e')]};if(!_0xe3b41d[_0x322d('0x3d')]){_0x5be6af[_0x322d('0x3e')]=!![];}return _0x273ce1[_0x322d('0x17')](_0x5be6af);}else{logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x4f'),util[_0x322d('0x2b')](_0x600ec8,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x4f'),util[_0x322d('0x2b')](_0x600ec8,{'showHidden':![],'depth':null}));}})[_0x322d('0x19')](function(_0x1cc0b5){logger[_0x322d('0x29')](_0x322d('0x2a'),'afterCreate',_0x322d('0x4f'),util[_0x322d('0x2b')](_0x1cc0b5,{'showHidden':![],'depth':null}));});}else{logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x4f'),_0x322d('0x3f'));}break;case _0x322d('0x50'):if(_0xe3b41d[_0x322d('0x51')]&&_0xe3b41d[_0x322d('0x23')]){var _0x2acdae={'dst':_0x36ae3d[_0x322d('0x22')],'text':_0x36ae3d[_0x322d('0xb')],'src':_0xe3b41d[_0x322d('0x40')]||_0xe3b41d[_0x322d('0x22')],'url':_0xe3b41d['remote']+_0x322d('0x26')+_0x36ae3d['id']+'/status?token='+_0xe3b41d[_0x322d('0x52')]};var _0x30df19=util[_0x322d('0x46')](_0x322d('0x47'),_0xe3b41d[_0x322d('0x51')],_0xe3b41d[_0x322d('0x23')]);var _0x5714b6={'method':_0x322d('0x38'),'uri':util['format'](_0x322d('0x53'),_0xe3b41d[_0x322d('0x51')]),'body':_0x2acdae,'headers':{'Authorization':util['format'](_0x322d('0x54'),new Buffer(_0x30df19)['toString'](_0x322d('0x4a')))},'json':!![]};rp(_0x5714b6)[_0x322d('0x16')](function(_0x165fa8){var _0x124c10={'messageId':_0x165fa8[_0x322d('0x55')][0x0]};return _0x273ce1[_0x322d('0x17')](_0x124c10);})[_0x322d('0x19')](function(_0x379209){logger['error'](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x50'),util[_0x322d('0x2b')](_0x379209,{'showHidden':![],'depth':null}));});}else{logger[_0x322d('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x322d('0x50'),_0x322d('0x56'));}break;case _0x322d('0x57'):if(_0xe3b41d[_0x322d('0x2f')]&&_0xe3b41d[_0x322d('0x30')]){if(_0xe3b41d['baseUrl']){var _0x14e1a0={'method':_0x322d('0x38'),'uri':_0xe3b41d[_0x322d('0x58')]+_0x322d('0x59'),'body':{'username':_0xe3b41d[_0x322d('0x2f')],'password':_0xe3b41d[_0x322d('0x30')]},'json':!![]};return rp(_0x14e1a0)[_0x322d('0x16')](function(_0x2fc822){var _0x3fb4fe={'method':_0x322d('0x38'),'uri':_0xe3b41d[_0x322d('0x58')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0xe3b41d[_0x322d('0x22')],'destinations':[{'to':_0x36ae3d[_0x322d('0x22')]}],'text':_0x36ae3d['body'],'notifyUrl':_0xe3b41d['remote']+_0x322d('0x26')+_0x36ae3d['id']+_0x322d('0x27')+_0xe3b41d[_0x322d('0x52')],'notifyContentType':'application/json','callbackData':_0xe3b41d['phone']+';'+_0x36ae3d[_0x322d('0xb')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x2fc822['token']},'json':!![]};return rp(_0x3fb4fe)[_0x322d('0x16')](function(_0x30c2b2){if(_0x30c2b2[_0x322d('0x24')]){var _0x122a3f={'messageId':_0x30c2b2[_0x322d('0x24')][0x0]['messageId']};if(!_0xe3b41d[_0x322d('0x3d')]){_0x122a3f[_0x322d('0x3e')]=!![];}return _0x273ce1[_0x322d('0x17')](_0x122a3f);}else{return logger[_0x322d('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x322d('0x2c'),_0x322d('0x57'),util[_0x322d('0x2b')](_0x30c2b2,{'showHidden':![],'depth':null}));}});})[_0x322d('0x19')](function(_0x58552e){return logger[_0x322d('0x29')](_0x322d('0x2a'),'afterCreate',_0x322d('0x57'),util[_0x322d('0x2b')](_0x58552e,{'showHidden':![],'depth':null}));});}else{logger[_0x322d('0x29')](_0x322d('0x2a'),'afterCreate',_0x322d('0x57'),_0x322d('0x5a'));}}else{logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x57'),_0x322d('0x3f'));}break;case _0x322d('0x5b'):var _0x1f021b=require('crypto');if(_0xe3b41d['apiKey']){var _0x1f5bbf={};_0x1f5bbf['login']=_0xe3b41d[_0x322d('0x2f')];_0x1f5bbf[_0x322d('0x22')]=_0x36ae3d[_0x322d('0x22')];_0x1f5bbf[_0x322d('0x32')]=_0xe3b41d[_0x322d('0x22')];_0x1f5bbf[_0x322d('0x5c')]=_0x36ae3d[_0x322d('0xb')];_0x1f5bbf['timestamp']=+new Date();var _0x415c6c='';var _0x544eaa='';var _0x34ce0d=Object[_0x322d('0x5d')](_0x1f5bbf);_0x34ce0d[_0x322d('0x5e')]();for(var _0x4238d7=0x0;_0x4238d7<_0x34ce0d['length'];_0x4238d7++){if(_0x415c6c!=''){_0x415c6c+='&';}_0x415c6c+=_0x34ce0d[_0x4238d7]+'='+encodeURIComponent(_0x1f5bbf[_0x34ce0d[_0x4238d7]]);_0x544eaa+=_0x1f5bbf[_0x34ce0d[_0x4238d7]];}_0x544eaa+=_0xe3b41d['apiKey'];_0x544eaa=_0x1f021b['createHash']('md5')['update'](_0x544eaa)[_0x322d('0x5f')](_0x322d('0x60'));if(_0x415c6c!==''){_0x415c6c+='&';}_0x415c6c+=_0x322d('0x61')+_0x544eaa;var _0x423c7e={'method':_0x322d('0x35'),'uri':_0xe3b41d[_0x322d('0x58')]+'/external/get/send.php?'+_0x415c6c,'json':!![]};return rp(_0x423c7e)['then'](function(_0x182080){var _0x12e411=Object[_0x322d('0x5d')](_0x182080);if(_0x182080[_0x12e411[0x0]][_0x322d('0x29')]&&parseInt(_0x182080[_0x12e411[0x0]][_0x322d('0x29')])===0x0){var _0x1eb800={'messageId':_0x182080[_0x12e411[0x0]][_0x322d('0x62')]};if(!_0xe3b41d['deliveryReport']){_0x1eb800['read']=!![];}return _0x273ce1[_0x322d('0x17')](_0x1eb800);}else{return logger['error'](_0x322d('0x2a'),_0x322d('0x2c'),'csc',util[_0x322d('0x2b')](_0x182080[_0x322d('0x29')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x43030b){return logger['error'](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x5b'),util[_0x322d('0x2b')](_0x43030b,{'showHidden':![],'depth':null}));});}else{logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x5b'),_0x322d('0x63'));}break;case _0x322d('0x64'):if(_0xe3b41d['apiKey']){var _0x520fee={'method':_0x322d('0x38'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xe3b41d['apiKey']},'body':{'content':_0x36ae3d[_0x322d('0xb')],'to':[_0x36ae3d[_0x322d('0x22')]],'from':_0xe3b41d[_0x322d('0x22')],'binary':![],'clientMessageId':_0x322d('0x65'),'charset':'UTF-8'},'json':!![]};rp(_0x520fee)[_0x322d('0x16')](function(_0x23d603){if(!_0x23d603[_0x322d('0x29')]){var _0x4d2a9a={'messageId':_0x23d603[_0x322d('0x24')][0x0][_0x322d('0x66')]};if(!_0xe3b41d[_0x322d('0x3d')]){_0x4d2a9a[_0x322d('0x3e')]=!![];}return _0x273ce1[_0x322d('0x17')](_0x4d2a9a);}else{return logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x64'),util[_0x322d('0x2b')](_0x23d603['error'],{'showHidden':![],'depth':null}));}})[_0x322d('0x19')](function(_0x4d5a79){return logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x64'),util[_0x322d('0x2b')](_0x4d5a79,{'showHidden':![],'depth':null}));});}else{logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x64'),_0x322d('0x63'));}break;case _0x322d('0x67'):if(_0xe3b41d[_0x322d('0x2f')]&&_0xe3b41d[_0x322d('0x30')]){var _0x30df19=util[_0x322d('0x46')](_0x322d('0x47'),_0xe3b41d['username'],_0xe3b41d[_0x322d('0x30')]);var _0x5714b6={'method':_0x322d('0x38'),'uri':_0x322d('0x68')+_0xe3b41d[_0x322d('0x69')]+'/messages','body':{'to':[_0x36ae3d[_0x322d('0x22')]],'text':_0x36ae3d[_0x322d('0xb')],'from':_0xe3b41d[_0x322d('0x22')],'applicationId':_0xe3b41d['applicationId']},'headers':{'Authorization':util[_0x322d('0x46')](_0x322d('0x54'),new Buffer(_0x30df19)[_0x322d('0x49')](_0x322d('0x4a')))},'json':!![]};rp(_0x5714b6)[_0x322d('0x16')](function(_0x597191){if(_0x597191['id']){var _0x5e7139={'messageId':_0x597191['id']};return _0x273ce1[_0x322d('0x17')](_0x5e7139);}else{logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),'bandwidth',util['inspect'](_0x597191,{'showHidden':![],'depth':null}));}})[_0x322d('0x19')](function(_0x3c5586){logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x67'),util['inspect'](_0x3c5586,{'showHidden':![],'depth':null}));});}else{logger[_0x322d('0x29')](_0x322d('0x2a'),'afterCreate',_0x322d('0x67'),_0x322d('0x3f'));}break;case'intelepeer':if(_0xe3b41d[_0x322d('0x6a')]){var _0x7210c4={};var _0x423c7e={'method':_0x322d('0x38'),'uri':_0x322d('0x6b'),'headers':{'Authorization':_0x322d('0x6c')+_0xe3b41d[_0x322d('0x6a')],'Content-Type':_0x322d('0x6d')},'body':{'from':_0xe3b41d[_0x322d('0x22')],'to':_0x36ae3d[_0x322d('0x22')],'text':_0x36ae3d[_0x322d('0xb')]},'json':!![]};return rp(_0x423c7e)['then'](function(_0x401a9e){if(_0x401a9e['code']==0xca){_0x7210c4[_0x322d('0x6e')]=_0x401a9e;var _0x5a8d13={'method':_0x322d('0x38'),'uri':_0x322d('0x6f'),'headers':{'Authorization':_0x322d('0x6c')+_0xe3b41d['apiKey'],'Content-Type':_0x322d('0x6d')},'body':{'refid':_0x7210c4[_0x322d('0x6e')]['refid']},'json':!![]};return rp(_0x5a8d13)[_0x322d('0x16')](function(_0xa03847){_0x7210c4[_0x322d('0x70')]=_0xa03847;var _0x8b8092={'messageId':_0x7210c4['message']['refid'],'read':!![]};return _0x273ce1[_0x322d('0x17')](_0x8b8092);});}else{return logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x71'),util[_0x322d('0x2b')](_0x401a9e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3f0dc6){return logger['error'](_0x322d('0x2a'),'afterCreate',_0x322d('0x71'),util[_0x322d('0x2b')](_0x3f0dc6,{'showHidden':![],'depth':null}));});}else{return logger[_0x322d('0x29')](_0x322d('0x2a'),_0x322d('0x2c'),_0x322d('0x71'),_0x322d('0x72'));}break;}}})[_0x322d('0x73')](function(){_0x1051cf();});}else{_0x1051cf();}}},'charset':'utf8mb4','collate':_0x322d('0x74')});};
\ No newline at end of file
index 35609c6..665b529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14f1=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x37a998,_0x33252b){var _0x1561ac=function(_0x5f2623){while(--_0x5f2623){_0x37a998['push'](_0x37a998['shift']());}};_0x1561ac(++_0x33252b);}(_0x14f1,0x1b8));var _0x114f=function(_0x5ae3e4,_0x55ab31){_0x5ae3e4=_0x5ae3e4-0x0;var _0x354e8a=_0x14f1[_0x5ae3e4];return _0x354e8a;};'use strict';var _=require(_0x114f('0x0'));var util=require(_0x114f('0x1'));var moment=require(_0x114f('0x2'));var BPromise=require(_0x114f('0x3'));var rs=require(_0x114f('0x4'));var fs=require('fs');var Redis=require(_0x114f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x114f('0x6'));var logger=require(_0x114f('0x7'))(_0x114f('0x8'));var config=require('../../config/environment');var jayson=require(_0x114f('0x9'));var client=jayson['client'][_0x114f('0xa')]({'port':0x232a});config[_0x114f('0xb')]=_[_0x114f('0xc')](config['redis'],{'host':_0x114f('0xd'),'port':0x18eb});var socket=require(_0x114f('0xe'))(new Redis(config[_0x114f('0xb')]));require(_0x114f('0xf'))[_0x114f('0x10')](socket);function respondWithRpcPromise(_0x2f1832,_0x433ea9,_0xa9d1db){return new BPromise(function(_0x7bfe72,_0x48500d){return client[_0x114f('0x11')](_0x2f1832,_0xa9d1db)[_0x114f('0x12')](function(_0x5a754f){logger[_0x114f('0x13')](_0x114f('0x14'),_0x433ea9,_0x114f('0x15'));logger['debug'](_0x114f('0x16'),_0x433ea9,_0x114f('0x15'),JSON[_0x114f('0x17')](_0x5a754f));if(_0x5a754f['error']){if(_0x5a754f[_0x114f('0x18')][_0x114f('0x19')]===0x1f4){logger[_0x114f('0x18')]('SmsMessage,\x20%s,\x20%s',_0x433ea9,_0x5a754f[_0x114f('0x18')][_0x114f('0x1a')]);return _0x48500d(_0x5a754f[_0x114f('0x18')][_0x114f('0x1a')]);}logger[_0x114f('0x18')](_0x114f('0x14'),_0x433ea9,_0x5a754f[_0x114f('0x18')]['message']);return _0x7bfe72(_0x5a754f['error'][_0x114f('0x1a')]);}else{logger[_0x114f('0x13')](_0x114f('0x14'),_0x433ea9,'request\x20sent');_0x7bfe72(_0x5a754f[_0x114f('0x1b')]['message']);}})[_0x114f('0x1c')](function(_0x55cb2d){logger[_0x114f('0x18')]('SmsMessage,\x20%s,\x20%s',_0x433ea9,_0x55cb2d);_0x48500d(_0x55cb2d);});});}exports[_0x114f('0x1d')]=function(_0x54818d){var _0x4683c5=this;return new Promise(function(_0x182362,_0x511879){return db['SmsMessage']['create'](_0x54818d['body'],{'raw':_0x54818d[_0x114f('0x1e')]?_0x54818d[_0x114f('0x1e')][_0x114f('0x1f')]===undefined?!![]:![]:!![]})[_0x114f('0x12')](function(_0x19680b){logger[_0x114f('0x13')](_0x114f('0x1d'),_0x54818d);logger[_0x114f('0x20')](_0x114f('0x1d'),_0x54818d,JSON['stringify'](_0x19680b));_0x182362(_0x19680b);})['catch'](function(_0x552634){logger['error'](_0x114f('0x1d'),_0x552634['message'],_0x54818d);_0x511879(_0x4683c5['error'](0x1f4,_0x552634[_0x114f('0x1a')]));});});};
\ No newline at end of file
+var _0xb982=['result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xb982,0x174));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2b98('0x0'));var util=require('util');var moment=require(_0x2b98('0x1'));var BPromise=require(_0x2b98('0x2'));var rs=require(_0x2b98('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b98('0x4'))['db'];var utils=require(_0x2b98('0x5'));var logger=require(_0x2b98('0x6'))('rpc');var config=require(_0x2b98('0x7'));var jayson=require(_0x2b98('0x8'));var client=jayson[_0x2b98('0x9')]['http']({'port':0x232a});config[_0x2b98('0xa')]=_[_0x2b98('0xb')](config['redis'],{'host':_0x2b98('0xc'),'port':0x18eb});var socket=require(_0x2b98('0xd'))(new Redis(config[_0x2b98('0xa')]));require(_0x2b98('0xe'))[_0x2b98('0xf')](socket);function respondWithRpcPromise(_0x278ee0,_0x4f5095,_0x432297){return new BPromise(function(_0x15564c,_0x386f24){return client['request'](_0x278ee0,_0x432297)[_0x2b98('0x10')](function(_0x5a02f4){logger[_0x2b98('0x11')](_0x2b98('0x12'),_0x4f5095,'request\x20sent');logger[_0x2b98('0x13')](_0x2b98('0x14'),_0x4f5095,'request\x20sent',JSON['stringify'](_0x5a02f4));if(_0x5a02f4[_0x2b98('0x15')]){if(_0x5a02f4[_0x2b98('0x15')][_0x2b98('0x16')]===0x1f4){logger['error'](_0x2b98('0x12'),_0x4f5095,_0x5a02f4[_0x2b98('0x15')][_0x2b98('0x17')]);return _0x386f24(_0x5a02f4['error'][_0x2b98('0x17')]);}logger[_0x2b98('0x15')](_0x2b98('0x12'),_0x4f5095,_0x5a02f4[_0x2b98('0x15')][_0x2b98('0x17')]);return _0x15564c(_0x5a02f4[_0x2b98('0x15')][_0x2b98('0x17')]);}else{logger['info'](_0x2b98('0x12'),_0x4f5095,'request\x20sent');_0x15564c(_0x5a02f4[_0x2b98('0x18')][_0x2b98('0x17')]);}})[_0x2b98('0x19')](function(_0x16aa73){logger[_0x2b98('0x15')](_0x2b98('0x12'),_0x4f5095,_0x16aa73);_0x386f24(_0x16aa73);});});}exports[_0x2b98('0x1a')]=function(_0x38c675){var _0xca045a=this;return new Promise(function(_0xdb1735,_0x120634){return db[_0x2b98('0x1b')][_0x2b98('0x1c')](_0x38c675[_0x2b98('0x1d')],{'raw':_0x38c675[_0x2b98('0x1e')]?_0x38c675[_0x2b98('0x1e')][_0x2b98('0x1f')]===undefined?!![]:![]:!![]})[_0x2b98('0x10')](function(_0x1afa32){logger[_0x2b98('0x11')](_0x2b98('0x1a'),_0x38c675);logger[_0x2b98('0x13')](_0x2b98('0x1a'),_0x38c675,JSON[_0x2b98('0x20')](_0x1afa32));_0xdb1735(_0x1afa32);})[_0x2b98('0x19')](function(_0x21497e){logger[_0x2b98('0x15')]('CreateSmsMessage',_0x21497e[_0x2b98('0x17')],_0x38c675);_0x120634(_0xca045a[_0x2b98('0x15')](0x1f4,_0x21497e[_0x2b98('0x17')]));});});};
\ No newline at end of file
index 403db2b..33ee343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0bf=['emit','removeListener','register','length','./smsMessage.events','save','remove','update'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0xa0bf,0x15c));var _0xfa0b=function(_0x46c8c5,_0x3556eb){_0x46c8c5=_0x46c8c5-0x0;var _0x5da91c=_0xa0bf[_0x46c8c5];return _0x5da91c;};'use strict';var SmsMessageEvents=require(_0xfa0b('0x0'));var events=[_0xfa0b('0x1'),_0xfa0b('0x2'),_0xfa0b('0x3')];function createListener(_0x4aa6aa,_0x4d7e14){return function(_0x379683){_0x4d7e14[_0xfa0b('0x4')](_0x4aa6aa,_0x379683);};}function removeListener(_0x3e5df5,_0x4afee2){return function(){SmsMessageEvents[_0xfa0b('0x5')](_0x3e5df5,_0x4afee2);};}exports[_0xfa0b('0x6')]=function(_0x14207e){for(var _0x2edac3=0x0,_0x5615d2=events[_0xfa0b('0x7')];_0x2edac3<_0x5615d2;_0x2edac3++){var _0xf28ad7=events[_0x2edac3];var _0x349684=createListener('smsMessage:'+_0xf28ad7,_0x14207e);SmsMessageEvents['on'](_0xf28ad7,_0x349684);}};
\ No newline at end of file
+var _0x5b9d=['length','smsMessage:','./smsMessage.events','remove','emit','removeListener','register'];(function(_0x4503f6,_0x3babaf){var _0x2277d1=function(_0x1c005a){while(--_0x1c005a){_0x4503f6['push'](_0x4503f6['shift']());}};_0x2277d1(++_0x3babaf);}(_0x5b9d,0x79));var _0xd5b9=function(_0x4dcb47,_0x50ef92){_0x4dcb47=_0x4dcb47-0x0;var _0x352b40=_0x5b9d[_0x4dcb47];return _0x352b40;};'use strict';var SmsMessageEvents=require(_0xd5b9('0x0'));var events=['save',_0xd5b9('0x1'),'update'];function createListener(_0x34358b,_0x1e260a){return function(_0xda8432){_0x1e260a[_0xd5b9('0x2')](_0x34358b,_0xda8432);};}function removeListener(_0x49c4af,_0x158c37){return function(){SmsMessageEvents[_0xd5b9('0x3')](_0x49c4af,_0x158c37);};}exports[_0xd5b9('0x4')]=function(_0x454899){for(var _0x3958eb=0x0,_0x50fa48=events[_0xd5b9('0x5')];_0x3958eb<_0x50fa48;_0x3958eb++){var _0x26b505=events[_0x3958eb];var _0x121f2d=createListener(_0xd5b9('0x6')+_0x26b505,_0x454899);SmsMessageEvents['on'](_0x26b505,_0x121f2d);}};
\ No newline at end of file
index e0dcf09..14ed99c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb78=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','exports','multer'];(function(_0x291746,_0x5d9c40){var _0x52db10=function(_0x3a107c){while(--_0x3a107c){_0x291746['push'](_0x291746['shift']());}};_0x52db10(++_0x5d9c40);}(_0xfb78,0x1b2));var _0x8fb7=function(_0x35c12c,_0x378ba0){_0x35c12c=_0x35c12c-0x0;var _0x2bab3a=_0xfb78[_0x35c12c];return _0x2bab3a;};'use strict';var multer=require(_0x8fb7('0x0'));var util=require(_0x8fb7('0x1'));var path=require(_0x8fb7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8fb7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8fb7('0x4'));var interaction=require(_0x8fb7('0x5'));var config=require(_0x8fb7('0x6'));var controller=require('./smsQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8fb7('0x7')]);router[_0x8fb7('0x8')](_0x8fb7('0x9'),auth[_0x8fb7('0xa')](),controller[_0x8fb7('0xb')]);router['get'](_0x8fb7('0xc'),auth[_0x8fb7('0xa')](),controller[_0x8fb7('0xd')]);router['get'](_0x8fb7('0xe'),auth[_0x8fb7('0xa')](),controller[_0x8fb7('0xf')]);router[_0x8fb7('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8fb7('0x10')]);router[_0x8fb7('0x8')](_0x8fb7('0x11'),auth[_0x8fb7('0xa')](),controller[_0x8fb7('0x12')]);router[_0x8fb7('0x13')]('/',auth[_0x8fb7('0xa')](),controller[_0x8fb7('0x14')]);router[_0x8fb7('0x13')]('/:id/teams',auth[_0x8fb7('0xa')](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x8fb7('0x15')]);router[_0x8fb7('0x16')]('/:id',auth[_0x8fb7('0xa')](),controller[_0x8fb7('0x17')]);router[_0x8fb7('0x18')](_0x8fb7('0xc'),auth['isAuthenticated'](),controller[_0x8fb7('0x19')]);router[_0x8fb7('0x18')](_0x8fb7('0x1a'),auth[_0x8fb7('0xa')](),controller[_0x8fb7('0x1b')]);router[_0x8fb7('0x18')](_0x8fb7('0x11'),auth[_0x8fb7('0xa')](),controller['removeAgents']);module[_0x8fb7('0x1c')]=router;
\ No newline at end of file
+var _0x6556=['create','post','addTeams','/:id/users','addAgents','put','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents'];(function(_0x9ff4c8,_0x1f4c30){var _0x49d2af=function(_0x10bbae){while(--_0x10bbae){_0x9ff4c8['push'](_0x9ff4c8['shift']());}};_0x49d2af(++_0x1f4c30);}(_0x6556,0x9b));var _0x6655=function(_0x57b662,_0x19b358){_0x57b662=_0x57b662-0x0;var _0x4a7734=_0x6556[_0x57b662];return _0x4a7734;};'use strict';var multer=require(_0x6655('0x0'));var util=require('util');var path=require(_0x6655('0x1'));var timeout=require(_0x6655('0x2'));var express=require(_0x6655('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6655('0x4'));var interaction=require(_0x6655('0x5'));var config=require('../../config/environment');var controller=require(_0x6655('0x6'));router['get']('/',auth[_0x6655('0x7')](),controller[_0x6655('0x8')]);router[_0x6655('0x9')](_0x6655('0xa'),auth[_0x6655('0x7')](),controller[_0x6655('0xb')]);router['get'](_0x6655('0xc'),auth[_0x6655('0x7')](),controller[_0x6655('0xd')]);router['get'](_0x6655('0xe'),auth[_0x6655('0x7')](),controller[_0x6655('0xf')]);router[_0x6655('0x9')](_0x6655('0x10'),auth[_0x6655('0x7')](),controller[_0x6655('0x11')]);router[_0x6655('0x9')]('/:id/users',auth[_0x6655('0x7')](),controller[_0x6655('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6655('0x13')]);router[_0x6655('0x14')](_0x6655('0x10'),auth['isAuthenticated'](),controller[_0x6655('0x15')]);router['post'](_0x6655('0x16'),auth[_0x6655('0x7')](),controller[_0x6655('0x17')]);router[_0x6655('0x18')](_0x6655('0xc'),auth[_0x6655('0x7')](),controller['update']);router[_0x6655('0x19')](_0x6655('0xc'),auth['isAuthenticated'](),controller[_0x6655('0x1a')]);router['delete'](_0x6655('0x10'),auth[_0x6655('0x7')](),controller[_0x6655('0x1b')]);router['delete'](_0x6655('0x16'),auth[_0x6655('0x7')](),controller['removeAgents']);module[_0x6655('0x1c')]=router;
\ No newline at end of file
index cc78844..9a867ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95a0=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x5ae204,_0x472e2f){var _0xfff4d9=function(_0x460e35){while(--_0x460e35){_0x5ae204['push'](_0x5ae204['shift']());}};_0xfff4d9(++_0x472e2f);}(_0x95a0,0x1b6));var _0x095a=function(_0x38803f,_0x418579){_0x38803f=_0x38803f-0x0;var _0x4004f1=_0x95a0[_0x38803f];return _0x4004f1;};'use strict';var Sequelize=require('sequelize');module[_0x095a('0x0')]={'name':{'type':Sequelize[_0x095a('0x1')],'unique':_0x095a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x095a('0x3')](_0x095a('0x4'),_0x095a('0x5'),_0x095a('0x6'))}};
\ No newline at end of file
+var _0xfd1b=['name','ENUM','rrmemory','beepall','exports','STRING'];(function(_0x44c434,_0xad4c14){var _0x57b68c=function(_0x53621e){while(--_0x53621e){_0x44c434['push'](_0x44c434['shift']());}};_0x57b68c(++_0xad4c14);}(_0xfd1b,0x172));var _0xbfd1=function(_0x5d6b07,_0x49575c){_0x5d6b07=_0x5d6b07-0x0;var _0x2bb34e=_0xfd1b[_0x5d6b07];return _0x2bb34e;};'use strict';var Sequelize=require('sequelize');module[_0xbfd1('0x0')]={'name':{'type':Sequelize[_0xbfd1('0x1')],'unique':_0xbfd1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbfd1('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbfd1('0x3')](_0xbfd1('0x4'),_0xbfd1('0x5'),'roundrobin')}};
\ No newline at end of file
index 40c8200..0ad1967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb28d=['UserId','agent','updatedAt','format','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsQueue','findAll','rows','catch','show','params','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb28d,0xbf));var _0xdb28=function(_0x3d61c6,_0x4571e6){_0x3d61c6=_0x3d61c6-0x0;var _0x47e0df=_0xb28d[_0x3d61c6];return _0x47e0df;};'use strict';var emlformat=require(_0xdb28('0x0'));var rimraf=require(_0xdb28('0x1'));var zipdir=require(_0xdb28('0x2'));var jsonpatch=require(_0xdb28('0x3'));var rp=require(_0xdb28('0x4'));var moment=require('moment');var BPromise=require(_0xdb28('0x5'));var Mustache=require(_0xdb28('0x6'));var util=require(_0xdb28('0x7'));var path=require(_0xdb28('0x8'));var sox=require(_0xdb28('0x9'));var csv=require(_0xdb28('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb28('0xb'));var _=require('lodash');var squel=require(_0xdb28('0xc'));var crypto=require('crypto');var jsforce=require(_0xdb28('0xd'));var deskjs=require(_0xdb28('0xe'));var toCsv=require(_0xdb28('0xa'));var querystring=require('querystring');var Papa=require(_0xdb28('0xf'));var Redis=require(_0xdb28('0x10'));var authService=require(_0xdb28('0x11'));var qs=require(_0xdb28('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb28('0x13'));var logger=require(_0xdb28('0x14'))(_0xdb28('0x15'));var utils=require(_0xdb28('0x16'));var config=require(_0xdb28('0x17'));var licenseUtil=require(_0xdb28('0x18'));var db=require('../../mysqldb')['db'];config[_0xdb28('0x19')]=_[_0xdb28('0x1a')](config['redis'],{'host':_0xdb28('0x1b'),'port':0x18eb});var socket=require(_0xdb28('0x1c'))(new Redis(config[_0xdb28('0x19')]));require(_0xdb28('0x1d'))['register'](socket);function respondWithStatusCode(_0x1e8360,_0x373a7a){_0x373a7a=_0x373a7a||0xcc;return function(_0x485bcf){if(_0x485bcf){return _0x1e8360[_0xdb28('0x1e')](_0x373a7a);}return _0x1e8360[_0xdb28('0x1f')](_0x373a7a)[_0xdb28('0x20')]();};}function respondWithResult(_0x16c865,_0x5bd90a){_0x5bd90a=_0x5bd90a||0xc8;return function(_0x3f947d){if(_0x3f947d){return _0x16c865[_0xdb28('0x1f')](_0x5bd90a)['json'](_0x3f947d);}};}function respondWithFilteredResult(_0x2c7b22,_0x1d1a53){return function(_0x3b87b4){if(_0x3b87b4){var _0x682f44=typeof _0x1d1a53[_0xdb28('0x21')]===_0xdb28('0x22')&&typeof _0x1d1a53[_0xdb28('0x23')]===_0xdb28('0x22');var _0x1a35b8=_0x3b87b4[_0xdb28('0x24')];var _0xa4d19e=_0x682f44?0x0:_0x1d1a53['offset'];var _0x2bd1e1=_0x682f44?_0x3b87b4[_0xdb28('0x24')]:_0x1d1a53[_0xdb28('0x21')]+_0x1d1a53['limit'];var _0x3d4652;if(_0x2bd1e1>=_0x1a35b8){_0x2bd1e1=_0x1a35b8;_0x3d4652=0xc8;}else{_0x3d4652=0xce;}_0x2c7b22[_0xdb28('0x1f')](_0x3d4652);return _0x2c7b22[_0xdb28('0x25')]('Content-Range',_0xa4d19e+'-'+_0x2bd1e1+'/'+_0x1a35b8)[_0xdb28('0x26')](_0x3b87b4);}return null;};}function patchUpdates(_0x3f3c00){return function(_0x27c9dd){try{jsonpatch[_0xdb28('0x27')](_0x27c9dd,_0x3f3c00,!![]);}catch(_0x305756){return BPromise[_0xdb28('0x28')](_0x305756);}return _0x27c9dd[_0xdb28('0x29')]();};}function saveUpdates(_0x194c68,_0x22f980){return function(_0xdf0f5){if(_0xdf0f5){return _0xdf0f5['update'](_0x194c68)[_0xdb28('0x2a')](function(_0x10edae){return _0x10edae;});}return null;};}function removeEntity(_0x2d0569,_0x95e45f){return function(_0x3fdf6e){if(_0x3fdf6e){return _0x3fdf6e[_0xdb28('0x2b')]()[_0xdb28('0x2a')](function(){var _0x216f03=_0x3fdf6e[_0xdb28('0x2c')]({'plain':!![]});var _0x260897='SmsQueues';return db[_0xdb28('0x2d')][_0xdb28('0x2b')]({'where':{'type':_0x260897,'resourceId':_0x216f03['id']}})[_0xdb28('0x2a')](function(){return _0x3fdf6e;});})[_0xdb28('0x2a')](function(){_0x2d0569['status'](0xcc)[_0xdb28('0x20')]();});}};}function handleEntityNotFound(_0x28653c,_0x901ade){return function(_0x598139){if(!_0x598139){_0x28653c[_0xdb28('0x1e')](0x194);}return _0x598139;};}function handleError(_0x22d23f,_0x45ee42){_0x45ee42=_0x45ee42||0x1f4;return function(_0x3dd2c4){logger[_0xdb28('0x2e')](_0x3dd2c4[_0xdb28('0x2f')]);if(_0x3dd2c4[_0xdb28('0x30')]){delete _0x3dd2c4['name'];}_0x22d23f[_0xdb28('0x1f')](_0x45ee42)[_0xdb28('0x31')](_0x3dd2c4);};}exports[_0xdb28('0x32')]=function(_0x100827,_0x2aff83){var _0x3e9746={},_0xf97aca={},_0x4ac2eb={'count':0x0,'rows':[]};var _0x15406a=_[_0xdb28('0x33')](db['SmsQueue'][_0xdb28('0x34')],function(_0x5615be){return{'name':_0x5615be[_0xdb28('0x35')],'type':_0x5615be[_0xdb28('0x36')][_0xdb28('0x37')]};});_0xf97aca['model']=_[_0xdb28('0x33')](_0x15406a,_0xdb28('0x30'));_0xf97aca['query']=_[_0xdb28('0x38')](_0x100827[_0xdb28('0x39')]);_0xf97aca['filters']=_['intersection'](_0xf97aca[_0xdb28('0x3a')],_0xf97aca[_0xdb28('0x39')]);_0x3e9746[_0xdb28('0x3b')]=_['intersection'](_0xf97aca[_0xdb28('0x3a')],qs[_0xdb28('0x3c')](_0x100827[_0xdb28('0x39')][_0xdb28('0x3c')]));_0x3e9746[_0xdb28('0x3b')]=_0x3e9746[_0xdb28('0x3b')][_0xdb28('0x3d')]?_0x3e9746[_0xdb28('0x3b')]:_0xf97aca[_0xdb28('0x3a')];if(!_0x100827['query'][_0xdb28('0x3e')](_0xdb28('0x3f'))){_0x3e9746[_0xdb28('0x23')]=qs['limit'](_0x100827[_0xdb28('0x39')]['limit']);_0x3e9746[_0xdb28('0x21')]=qs['offset'](_0x100827['query'][_0xdb28('0x21')]);}_0x3e9746[_0xdb28('0x40')]=qs['sort'](_0x100827[_0xdb28('0x39')][_0xdb28('0x41')]);_0x3e9746[_0xdb28('0x42')]=qs[_0xdb28('0x43')](_[_0xdb28('0x44')](_0x100827['query'],_0xf97aca[_0xdb28('0x43')]),_0x15406a);if(_0x100827[_0xdb28('0x39')][_0xdb28('0x45')]){_0x3e9746[_0xdb28('0x42')]=_[_0xdb28('0x46')](_0x3e9746[_0xdb28('0x42')],{'$or':_[_0xdb28('0x33')](_0x15406a,function(_0x2d902c){if(_0x2d902c[_0xdb28('0x36')]!==_0xdb28('0x47')){var _0x5f5992={};_0x5f5992[_0x2d902c[_0xdb28('0x30')]]={'$like':'%'+_0x100827[_0xdb28('0x39')][_0xdb28('0x45')]+'%'};return _0x5f5992;}})});}_0x3e9746=_['merge']({},_0x3e9746,_0x100827[_0xdb28('0x48')]);var _0x180d79={'where':_0x3e9746[_0xdb28('0x42')]};return db['SmsQueue'][_0xdb28('0x24')](_0x180d79)[_0xdb28('0x2a')](function(_0x40357e){_0x4ac2eb[_0xdb28('0x24')]=_0x40357e;if(_0x100827[_0xdb28('0x39')][_0xdb28('0x49')]){_0x3e9746[_0xdb28('0x4a')]=[{'all':!![]}];}return db[_0xdb28('0x4b')][_0xdb28('0x4c')](_0x3e9746);})[_0xdb28('0x2a')](function(_0x4005b2){_0x4ac2eb[_0xdb28('0x4d')]=_0x4005b2;return _0x4ac2eb;})[_0xdb28('0x2a')](respondWithFilteredResult(_0x2aff83,_0x3e9746))[_0xdb28('0x4e')](handleError(_0x2aff83,null));};exports[_0xdb28('0x4f')]=function(_0x1b75cd,_0x5ca9f8){var _0x3a1509={'raw':!![],'where':{'id':_0x1b75cd[_0xdb28('0x50')]['id']}},_0x33f68c={};_0x33f68c[_0xdb28('0x3a')]=_['keys'](db[_0xdb28('0x4b')][_0xdb28('0x34')]);_0x33f68c[_0xdb28('0x39')]=_[_0xdb28('0x38')](_0x1b75cd['query']);_0x33f68c[_0xdb28('0x43')]=_[_0xdb28('0x51')](_0x33f68c['model'],_0x33f68c[_0xdb28('0x39')]);_0x3a1509[_0xdb28('0x3b')]=_[_0xdb28('0x51')](_0x33f68c['model'],qs[_0xdb28('0x3c')](_0x1b75cd[_0xdb28('0x39')][_0xdb28('0x3c')]));_0x3a1509[_0xdb28('0x3b')]=_0x3a1509[_0xdb28('0x3b')][_0xdb28('0x3d')]?_0x3a1509[_0xdb28('0x3b')]:_0x33f68c[_0xdb28('0x3a')];if(_0x1b75cd[_0xdb28('0x39')][_0xdb28('0x49')]){_0x3a1509[_0xdb28('0x4a')]=[{'all':!![]}];}_0x3a1509=_[_0xdb28('0x46')]({},_0x3a1509,_0x1b75cd[_0xdb28('0x48')]);return db[_0xdb28('0x4b')][_0xdb28('0x52')](_0x3a1509)['then'](handleEntityNotFound(_0x5ca9f8,null))[_0xdb28('0x2a')](respondWithResult(_0x5ca9f8,null))[_0xdb28('0x4e')](handleError(_0x5ca9f8,null));};exports[_0xdb28('0x53')]=function(_0x1c00f3,_0x129e5f){return db[_0xdb28('0x4b')][_0xdb28('0x53')](_0x1c00f3['body'],{})[_0xdb28('0x2a')](function(_0x395937){var _0x28ac49=_0x1c00f3[_0xdb28('0x54')]['get']({'plain':!![]});if(!_0x28ac49)throw new Error(_0xdb28('0x55'));if(_0x28ac49['role']===_0xdb28('0x54')){var _0x6f3f07=_0x395937[_0xdb28('0x2c')]({'plain':!![]});var _0x4eeb05=_0xdb28('0x56');return db['UserProfileSection'][_0xdb28('0x52')]({'where':{'name':_0x4eeb05,'userProfileId':_0x28ac49[_0xdb28('0x57')]},'raw':!![]})[_0xdb28('0x2a')](function(_0x455afe){if(_0x455afe&&_0x455afe[_0xdb28('0x58')]===0x0){return db['UserProfileResource'][_0xdb28('0x53')]({'name':_0x6f3f07[_0xdb28('0x30')],'resourceId':_0x6f3f07['id'],'type':_0x455afe[_0xdb28('0x30')],'sectionId':_0x455afe['id']},{})[_0xdb28('0x2a')](function(){return _0x395937;});}else{return _0x395937;}})[_0xdb28('0x4e')](function(_0x5a26b1){logger[_0xdb28('0x2e')](_0xdb28('0x59'),_0x5a26b1);throw _0x5a26b1;});}return _0x395937;})['then'](respondWithResult(_0x129e5f,0xc9))['catch'](handleError(_0x129e5f,null));};exports[_0xdb28('0x5a')]=function(_0x1a0ab5,_0x3f8183){if(_0x1a0ab5[_0xdb28('0x5b')]['id']){delete _0x1a0ab5['body']['id'];}return db['SmsQueue'][_0xdb28('0x52')]({'where':{'id':_0x1a0ab5[_0xdb28('0x50')]['id']}})[_0xdb28('0x2a')](handleEntityNotFound(_0x3f8183,null))[_0xdb28('0x2a')](saveUpdates(_0x1a0ab5[_0xdb28('0x5b')],null))['then'](respondWithResult(_0x3f8183,null))['catch'](handleError(_0x3f8183,null));};exports['destroy']=function(_0x20bf24,_0x3b5422){return db[_0xdb28('0x4b')][_0xdb28('0x52')]({'where':{'id':_0x20bf24['params']['id']}})['then'](handleEntityNotFound(_0x3b5422,null))[_0xdb28('0x2a')](removeEntity(_0x3b5422,null))[_0xdb28('0x4e')](handleError(_0x3b5422,null));};exports[_0xdb28('0x5c')]=function(_0x3208ec,_0x4a099a){return db['SmsQueue']['describe']()[_0xdb28('0x2a')](respondWithResult(_0x4a099a,null))[_0xdb28('0x4e')](handleError(_0x4a099a,null));};exports[_0xdb28('0x5d')]=function(_0x140817,_0x19d175,_0x2b88c0){var _0x40fe8f={'raw':!![],'where':{}},_0x36de9d={},_0x36e477;return db[_0xdb28('0x4b')][_0xdb28('0x5e')]({'where':{'id':_0x140817[_0xdb28('0x50')]['id']}})[_0xdb28('0x2a')](handleEntityNotFound(_0x19d175,null))[_0xdb28('0x2a')](function(_0x397399){if(_0x397399){_0x36e477=_0x397399[_0xdb28('0x2c')]({'plain':!![]});_0x36de9d[_0xdb28('0x3a')]=_[_0xdb28('0x38')](db[_0xdb28('0x5f')]['rawAttributes']);_0x36de9d[_0xdb28('0x39')]=_[_0xdb28('0x38')](_0x140817[_0xdb28('0x39')]);_0x36de9d[_0xdb28('0x43')]=_[_0xdb28('0x51')](_0x36de9d[_0xdb28('0x3a')],_0x36de9d['query']);_0x40fe8f[_0xdb28('0x3b')]=_[_0xdb28('0x51')](_0x36de9d[_0xdb28('0x3a')],qs[_0xdb28('0x3c')](_0x140817[_0xdb28('0x39')]['fields']));_0x40fe8f['attributes']=_0x40fe8f['attributes'][_0xdb28('0x3d')]?_0x40fe8f['attributes']:_0x36de9d[_0xdb28('0x3a')];if(!_0x140817[_0xdb28('0x39')]['hasOwnProperty'](_0xdb28('0x3f'))){_0x40fe8f[_0xdb28('0x23')]=qs[_0xdb28('0x23')](_0x140817[_0xdb28('0x39')]['limit']);_0x40fe8f[_0xdb28('0x21')]=qs[_0xdb28('0x21')](_0x140817[_0xdb28('0x39')][_0xdb28('0x21')]);}_0x40fe8f[_0xdb28('0x40')]=qs['sort'](_0x140817[_0xdb28('0x39')][_0xdb28('0x41')]);_0x40fe8f[_0xdb28('0x42')]=qs['filters'](_[_0xdb28('0x44')](_0x140817['query'],_0x36de9d[_0xdb28('0x43')]));_0x40fe8f[_0xdb28('0x42')][_0xdb28('0x60')]=_0x397399['id'];if(_0x140817['query'][_0xdb28('0x45')]){_0x40fe8f[_0xdb28('0x42')]=_['merge'](_0x40fe8f[_0xdb28('0x42')],{'$or':_[_0xdb28('0x33')](_0x40fe8f['attributes'],function(_0x54a820){var _0x4e979c={};_0x4e979c[_0x54a820]={'$like':'%'+_0x140817[_0xdb28('0x39')][_0xdb28('0x45')]+'%'};return _0x4e979c;})});}_0x40fe8f=_[_0xdb28('0x46')]({},_0x40fe8f,_0x140817[_0xdb28('0x48')]);return db[_0xdb28('0x5f')]['findAll'](_0x40fe8f);}})[_0xdb28('0x2a')](function(_0x466ee5){if(_0x466ee5){return db[_0xdb28('0x61')][_0xdb28('0x62')]({'where':{'id':_['map'](_0x466ee5,_0xdb28('0x63')),'role':_0xdb28('0x64')},'attributes':['id',_0xdb28('0x30'),'smsPause',_0xdb28('0x65'),'createdAt']});}})[_0xdb28('0x2a')](function(_0x359839){if(_0x359839){return{'count':_0x359839[_0xdb28('0x24')],'rows':_[_0xdb28('0x33')](_0x359839[_0xdb28('0x4d')],function(_0x378a4b){return{'membername':_0x378a4b['name'],'UserId':_0x378a4b['id'],'queue_name':_0x36e477['name'],'SmsQueueId':_0x36e477['id'],'interface':util[_0xdb28('0x66')]('%s/%s',_0xdb28('0x67'),_0x378a4b[_0xdb28('0x30')]),'penalty':0x0,'paused':_0x378a4b['smsPause'],'createdAt':_0x378a4b['createdAt'],'updatedAt':_0x378a4b[_0xdb28('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdb28('0x2a')](respondWithFilteredResult(_0x19d175,_0x40fe8f))[_0xdb28('0x4e')](handleError(_0x19d175,null));};exports[_0xdb28('0x68')]=function(_0x3c8980,_0x11a8b5,_0x2c7e79){var _0x505b1d={};var _0x3461dc={};var _0x3f352e;var _0x2fb595;return db[_0xdb28('0x4b')][_0xdb28('0x5e')]({'where':{'id':_0x3c8980[_0xdb28('0x50')]['id']}})[_0xdb28('0x2a')](handleEntityNotFound(_0x11a8b5,null))[_0xdb28('0x2a')](function(_0x79c6){if(_0x79c6){_0x3f352e=_0x79c6;_0x3461dc[_0xdb28('0x3a')]=_[_0xdb28('0x38')](db[_0xdb28('0x69')]['rawAttributes']);_0x3461dc[_0xdb28('0x39')]=_['keys'](_0x3c8980[_0xdb28('0x39')]);_0x3461dc[_0xdb28('0x43')]=_[_0xdb28('0x51')](_0x3461dc[_0xdb28('0x3a')],_0x3461dc['query']);_0x505b1d['attributes']=_[_0xdb28('0x51')](_0x3461dc[_0xdb28('0x3a')],qs['fields'](_0x3c8980[_0xdb28('0x39')][_0xdb28('0x3c')]));_0x505b1d[_0xdb28('0x3b')]=_0x505b1d[_0xdb28('0x3b')]['length']?_0x505b1d[_0xdb28('0x3b')]:_0x3461dc['model'];_0x505b1d[_0xdb28('0x40')]=qs['sort'](_0x3c8980['query'][_0xdb28('0x41')]);_0x505b1d[_0xdb28('0x42')]=qs[_0xdb28('0x43')](_[_0xdb28('0x44')](_0x3c8980['query'],_0x3461dc[_0xdb28('0x43')]));if(_0x3c8980['query']['filter']){_0x505b1d[_0xdb28('0x42')]=_[_0xdb28('0x46')](_0x505b1d[_0xdb28('0x42')],{'$or':_[_0xdb28('0x33')](_0x505b1d[_0xdb28('0x3b')],function(_0x5df013){var _0x3889c9={};_0x3889c9[_0x5df013]={'$like':'%'+_0x3c8980[_0xdb28('0x39')]['filter']+'%'};return _0x3889c9;})});}_0x505b1d=_[_0xdb28('0x46')]({},_0x505b1d,_0x3c8980['options']);return _0x3f352e[_0xdb28('0x68')](_0x505b1d);}})[_0xdb28('0x2a')](function(_0x1ae4d2){if(_0x1ae4d2){_0x2fb595=_0x1ae4d2[_0xdb28('0x3d')];if(!_0x3c8980[_0xdb28('0x39')][_0xdb28('0x3e')]('nolimit')){_0x505b1d[_0xdb28('0x23')]=qs[_0xdb28('0x23')](_0x3c8980[_0xdb28('0x39')][_0xdb28('0x23')]);_0x505b1d[_0xdb28('0x21')]=qs[_0xdb28('0x21')](_0x3c8980[_0xdb28('0x39')][_0xdb28('0x21')]);}return _0x3f352e['getTeams'](_0x505b1d);}})['then'](function(_0x180f0e){if(_0x180f0e){return _0x180f0e?{'count':_0x2fb595,'rows':_0x180f0e}:null;}})[_0xdb28('0x2a')](respondWithResult(_0x11a8b5,null))['catch'](handleError(_0x11a8b5,null));};exports[_0xdb28('0x6a')]=function(_0x6b1001,_0x336b8b,_0x9844a8){var _0x3bd0f3=_0x6b1001[_0xdb28('0x5b')]['ids'];return db['Team'][_0xdb28('0x4c')]({'where':{'id':_0x3bd0f3},'attributes':['id'],'include':[{'model':db[_0xdb28('0x61')],'as':_0xdb28('0x6b'),'attributes':['id','name',_0xdb28('0x6c'),_0xdb28('0x6d'),_0xdb28('0x6e')],'raw':!![]}]})[_0xdb28('0x2a')](function(_0x55f6ce){if(_0x55f6ce){var _0x162f33=_[_0xdb28('0x6f')](_0x55f6ce,function(_0x325ef7){var _0x39e562=_0x325ef7[_0xdb28('0x2c')]({'plain':!![]});return _0x39e562[_0xdb28('0x6b')];});return db[_0xdb28('0x4b')][_0xdb28('0x52')]({'where':{'id':_0x6b1001[_0xdb28('0x50')]['id']}})[_0xdb28('0x2a')](function(_0x33813b){return db['sequelize'][_0xdb28('0x70')](function(_0x162518){return _0x33813b[_0xdb28('0x6a')](_0x3bd0f3,{'transaction':_0x162518})['then'](function(){return BPromise[_0xdb28('0x71')](_0x162f33,function(_0x516c45){return db[_0xdb28('0x5f')]['findOrCreate']({'where':{'UserId':_0x516c45['id'],'SmsQueueId':_0x6b1001[_0xdb28('0x50')]['id']},'transaction':_0x162518});});})[_0xdb28('0x2a')](function(){_0x162f33[_0xdb28('0x72')](function(_0x516976){socket[_0xdb28('0x73')](_0xdb28('0x74'),{'UserId':_0x516976['id'],'SmsQueueId':_0x33813b['id']});});});});});}})[_0xdb28('0x2a')](respondWithStatusCode(_0x336b8b,null))[_0xdb28('0x4e')](handleError(_0x336b8b,null));};exports[_0xdb28('0x75')]=function(_0x4ced8b,_0x50706b,_0xfbefb5){return db[_0xdb28('0x69')][_0xdb28('0x4c')]({'where':{'id':_0x4ced8b[_0xdb28('0x39')][_0xdb28('0x76')]},'attributes':['id'],'include':[{'model':db[_0xdb28('0x61')],'as':_0xdb28('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xdb28('0x2a')](handleEntityNotFound(_0x50706b,null))[_0xdb28('0x2a')](function(_0x360434){var _0x13749b=_['map'](_0x360434,'id');var _0x2efaf8=[];var _0x1d553c=[];var _0x17d08a=squel[_0xdb28('0x77')]();_0x17d08a[_0xdb28('0x78')](_0xdb28('0x79'))[_0xdb28('0x7a')]('team_has_sms_queues','tq')[_0xdb28('0x7b')](_0xdb28('0x7c'),'ut',_0xdb28('0x7d'))[_0xdb28('0x42')](_0xdb28('0x7e'),_0x4ced8b[_0xdb28('0x50')]['id']);for(var _0x4d3519=0x0;_0x4d3519<_0x360434['length'];_0x4d3519+=0x1){let _0x21d07d=_0x360434[_0x4d3519];for(var _0xa6298b=0x0;_0xa6298b<_0x21d07d[_0xdb28('0x6b')][_0xdb28('0x3d')];_0xa6298b+=0x1){let _0x505905=_0x21d07d[_0xdb28('0x6b')][_0xa6298b];var _0x242a67=_0x17d08a[_0xdb28('0x7f')]();_0x242a67[_0xdb28('0x42')](_0xdb28('0x80'),_0x505905['id']);_0x1d553c['push'](db['sequelize']['query'](_0x242a67['toString'](),{'type':db[_0xdb28('0x81')][_0xdb28('0x82')][_0xdb28('0x83')]})[_0xdb28('0x2a')](function(_0x11e348){if(_0x11e348[_0xdb28('0x3d')]===0x1){return _0x505905['id'];}else{var _0x5101f5=_[_0xdb28('0x84')](_['map'](_0x11e348,_0xdb28('0x85')),function(_0x1ca68f){return _[_0xdb28('0x86')](_0x13749b,_0x1ca68f);});if(_0x5101f5){return _0x505905['id'];}}}));}}return BPromise[_0xdb28('0x87')](_0x1d553c)[_0xdb28('0x2a')](function(_0x2a6d00){_0x2efaf8=_(_0x2efaf8)['union'](_0x2a6d00)[_0xdb28('0x88')]()[_0xdb28('0x89')]();return db[_0xdb28('0x4b')][_0xdb28('0x52')]({'where':{'id':_0x4ced8b['params']['id']}})[_0xdb28('0x2a')](function(_0x167321){return db[_0xdb28('0x81')]['transaction'](function(_0x1c0628){return _0x167321[_0xdb28('0x75')](_0x4ced8b['query'][_0xdb28('0x76')],{'transaction':_0x1c0628})[_0xdb28('0x2a')](function(){if(!_[_0xdb28('0x8a')](_0x2efaf8)){return _0x167321[_0xdb28('0x8b')](_0x2efaf8,{'transaction':_0x1c0628});}})[_0xdb28('0x2a')](function(){_0x2efaf8[_0xdb28('0x72')](function(_0x2917ce){socket['emit'](_0xdb28('0x8c'),{'UserId':_0x2917ce,'SmsQueueId':_0x167321['id']});});});});});});})[_0xdb28('0x2a')](respondWithStatusCode(_0x50706b,null))['catch'](handleError(_0x50706b,null));};exports['addAgents']=function(_0xc95f8a,_0x59305a,_0x283ee2){return db[_0xdb28('0x4b')][_0xdb28('0x52')]({'where':{'id':_0xc95f8a[_0xdb28('0x50')]['id']}})[_0xdb28('0x2a')](handleEntityNotFound(_0x59305a,null))[_0xdb28('0x2a')](function(_0x4b013b){if(_0x4b013b){return _0x4b013b[_0xdb28('0x8d')](_0xc95f8a[_0xdb28('0x5b')][_0xdb28('0x76')],_['omit'](_0xc95f8a[_0xdb28('0x5b')],[_0xdb28('0x76'),'id'])||{})[_0xdb28('0x8e')](function(_0x2030c3){for(var _0x2436ca=0x0;_0x2436ca<_0xc95f8a[_0xdb28('0x5b')][_0xdb28('0x76')][_0xdb28('0x3d')];_0x2436ca+=0x1){socket[_0xdb28('0x73')](_0xdb28('0x74'),{'UserId':Number(_0xc95f8a[_0xdb28('0x5b')][_0xdb28('0x76')][_0x2436ca]),'SmsQueueId':Number(_0xc95f8a[_0xdb28('0x50')]['id'])});}return _0x2030c3;});}})[_0xdb28('0x2a')](respondWithResult(_0x59305a,null))[_0xdb28('0x4e')](handleError(_0x59305a,null));};exports[_0xdb28('0x8b')]=function(_0x3128ec,_0x21415b,_0x902b89){return db[_0xdb28('0x4b')]['find']({'where':{'id':_0x3128ec['params']['id']}})['then'](handleEntityNotFound(_0x21415b,null))[_0xdb28('0x2a')](function(_0x9892bc){if(_0x9892bc){return _0x9892bc['removeAgents'](_0x3128ec[_0xdb28('0x39')][_0xdb28('0x76')])[_0xdb28('0x2a')](function(){if(_[_0xdb28('0x8f')](_0x3128ec[_0xdb28('0x39')][_0xdb28('0x76')])){for(var _0x2f971d=0x0;_0x2f971d<_0x3128ec['query'][_0xdb28('0x76')][_0xdb28('0x3d')];_0x2f971d+=0x1){socket[_0xdb28('0x73')](_0xdb28('0x8c'),{'UserId':Number(_0x3128ec[_0xdb28('0x39')][_0xdb28('0x76')][_0x2f971d]),'SmsQueueId':Number(_0x3128ec[_0xdb28('0x50')]['id'])});}}else{socket[_0xdb28('0x73')](_0xdb28('0x8c'),{'UserId':Number(_0x3128ec['query'][_0xdb28('0x76')]),'SmsQueueId':Number(_0x3128ec[_0xdb28('0x50')]['id'])});}});}})[_0xdb28('0x2a')](respondWithStatusCode(_0x21415b,null))[_0xdb28('0x4e')](handleError(_0x21415b,null));};exports[_0xdb28('0x90')]=function(_0xe30a4c,_0x1cff0b,_0x3aaa8e){var _0x51f763={};var _0x475b76={};var _0x272806;var _0x58ad55;return db[_0xdb28('0x4b')][_0xdb28('0x5e')]({'where':{'id':_0xe30a4c[_0xdb28('0x50')]['id']}})[_0xdb28('0x2a')](handleEntityNotFound(_0x1cff0b,null))[_0xdb28('0x2a')](function(_0x337b7b){if(_0x337b7b){_0x272806=_0x337b7b;_0x475b76[_0xdb28('0x3a')]=_['keys'](db[_0xdb28('0x61')]['rawAttributes']);_0x475b76[_0xdb28('0x39')]=_[_0xdb28('0x38')](_0xe30a4c[_0xdb28('0x39')]);_0x475b76['filters']=_[_0xdb28('0x51')](_0x475b76[_0xdb28('0x3a')],_0x475b76[_0xdb28('0x39')]);_0x51f763[_0xdb28('0x3b')]=_['intersection'](_0x475b76[_0xdb28('0x3a')],qs[_0xdb28('0x3c')](_0xe30a4c['query'][_0xdb28('0x3c')]));_0x51f763[_0xdb28('0x3b')]=_0x51f763[_0xdb28('0x3b')][_0xdb28('0x3d')]?_0x51f763[_0xdb28('0x3b')]:_0x475b76['model'];_0x51f763[_0xdb28('0x40')]=qs[_0xdb28('0x41')](_0xe30a4c[_0xdb28('0x39')]['sort']);_0x51f763[_0xdb28('0x42')]=qs['filters'](_[_0xdb28('0x44')](_0xe30a4c[_0xdb28('0x39')],_0x475b76['filters']));if(_0xe30a4c[_0xdb28('0x39')][_0xdb28('0x45')]){_0x51f763[_0xdb28('0x42')]=_[_0xdb28('0x46')](_0x51f763[_0xdb28('0x42')],{'$or':_[_0xdb28('0x33')](_0x51f763['attributes'],function(_0x4eb6bb){var _0x3b5cf9={};_0x3b5cf9[_0x4eb6bb]={'$like':'%'+_0xe30a4c[_0xdb28('0x39')][_0xdb28('0x45')]+'%'};return _0x3b5cf9;})});}_0x51f763=_[_0xdb28('0x46')]({},_0x51f763,_0xe30a4c[_0xdb28('0x48')]);return _0x272806['getAgents'](_0x51f763);}})['then'](function(_0x21c301){if(_0x21c301){_0x58ad55=_0x21c301[_0xdb28('0x3d')];if(!_0xe30a4c[_0xdb28('0x39')][_0xdb28('0x3e')](_0xdb28('0x3f'))){_0x51f763['limit']=qs['limit'](_0xe30a4c[_0xdb28('0x39')][_0xdb28('0x23')]);_0x51f763[_0xdb28('0x21')]=qs[_0xdb28('0x21')](_0xe30a4c['query'][_0xdb28('0x21')]);}return _0x272806[_0xdb28('0x90')](_0x51f763);}})[_0xdb28('0x2a')](function(_0x428f91){if(_0x428f91){return _0x428f91?{'count':_0x58ad55,'rows':_0x428f91}:null;}})[_0xdb28('0x2a')](respondWithResult(_0x1cff0b,null))[_0xdb28('0x4e')](handleError(_0x1cff0b,null));};
\ No newline at end of file
+var _0x1c3d=['from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','SmsQueue','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','show','fields','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMembers','findOne','UserSmsQueue','SmsQueueId','User','UserId','updatedAt','createdAt','SIP','smsPause','Team','getTeams','addTeams','ids','Agents','sequelize','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x46aebd,_0x488973){_0x46aebd=_0x46aebd-0x0;var _0x549577=_0x1c3d[_0x46aebd];return _0x549577;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd1c3('0x0'));var zipdir=require(_0xd1c3('0x1'));var jsonpatch=require(_0xd1c3('0x2'));var rp=require(_0xd1c3('0x3'));var moment=require(_0xd1c3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd1c3('0x5'));var path=require(_0xd1c3('0x6'));var sox=require(_0xd1c3('0x7'));var csv=require(_0xd1c3('0x8'));var ejs=require(_0xd1c3('0x9'));var fs=require('fs');var fs_extra=require(_0xd1c3('0xa'));var _=require('lodash');var squel=require(_0xd1c3('0xb'));var crypto=require(_0xd1c3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd1c3('0xd'));var toCsv=require(_0xd1c3('0x8'));var querystring=require(_0xd1c3('0xe'));var Papa=require(_0xd1c3('0xf'));var Redis=require(_0xd1c3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd1c3('0x11'));var hardwareService=require(_0xd1c3('0x12'));var logger=require(_0xd1c3('0x13'))(_0xd1c3('0x14'));var utils=require(_0xd1c3('0x15'));var config=require(_0xd1c3('0x16'));var licenseUtil=require(_0xd1c3('0x17'));var db=require(_0xd1c3('0x18'))['db'];config[_0xd1c3('0x19')]=_['defaults'](config[_0xd1c3('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd1c3('0x19')]));require('./smsQueue.socket')[_0xd1c3('0x1a')](socket);function respondWithStatusCode(_0x1f30ff,_0x37d175){_0x37d175=_0x37d175||0xcc;return function(_0x52e7bc){if(_0x52e7bc){return _0x1f30ff[_0xd1c3('0x1b')](_0x37d175);}return _0x1f30ff[_0xd1c3('0x1c')](_0x37d175)[_0xd1c3('0x1d')]();};}function respondWithResult(_0x3bc2b,_0x42ba11){_0x42ba11=_0x42ba11||0xc8;return function(_0xb5af75){if(_0xb5af75){return _0x3bc2b[_0xd1c3('0x1c')](_0x42ba11)[_0xd1c3('0x1e')](_0xb5af75);}};}function respondWithFilteredResult(_0x3439dc,_0x31821f){return function(_0x5d26c2){if(_0x5d26c2){var _0x53a5e1=typeof _0x31821f[_0xd1c3('0x1f')]===_0xd1c3('0x20')&&typeof _0x31821f[_0xd1c3('0x21')]===_0xd1c3('0x20');var _0x5b2571=_0x5d26c2['count'];var _0x9c9d4d=_0x53a5e1?0x0:_0x31821f[_0xd1c3('0x1f')];var _0x1dcb29=_0x53a5e1?_0x5d26c2['count']:_0x31821f['offset']+_0x31821f[_0xd1c3('0x21')];var _0x1b5fae;if(_0x1dcb29>=_0x5b2571){_0x1dcb29=_0x5b2571;_0x1b5fae=0xc8;}else{_0x1b5fae=0xce;}_0x3439dc['status'](_0x1b5fae);return _0x3439dc['set'](_0xd1c3('0x22'),_0x9c9d4d+'-'+_0x1dcb29+'/'+_0x5b2571)[_0xd1c3('0x1e')](_0x5d26c2);}return null;};}function patchUpdates(_0x201ff0){return function(_0x16e5d6){try{jsonpatch[_0xd1c3('0x23')](_0x16e5d6,_0x201ff0,!![]);}catch(_0x46ed40){return BPromise[_0xd1c3('0x24')](_0x46ed40);}return _0x16e5d6[_0xd1c3('0x25')]();};}function saveUpdates(_0x33c380,_0x218ef1){return function(_0x5a9d5d){if(_0x5a9d5d){return _0x5a9d5d['update'](_0x33c380)[_0xd1c3('0x26')](function(_0x261323){return _0x261323;});}return null;};}function removeEntity(_0x6aad1c,_0x227f24){return function(_0x5d1988){if(_0x5d1988){return _0x5d1988[_0xd1c3('0x27')]()[_0xd1c3('0x26')](function(){var _0x54fd33=_0x5d1988[_0xd1c3('0x28')]({'plain':!![]});var _0x3f5206=_0xd1c3('0x29');return db[_0xd1c3('0x2a')][_0xd1c3('0x27')]({'where':{'type':_0x3f5206,'resourceId':_0x54fd33['id']}})[_0xd1c3('0x26')](function(){return _0x5d1988;});})[_0xd1c3('0x26')](function(){_0x6aad1c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x564ca2,_0x3eabca){return function(_0x1a4448){if(!_0x1a4448){_0x564ca2[_0xd1c3('0x1b')](0x194);}return _0x1a4448;};}function handleError(_0x287952,_0x584b1d){_0x584b1d=_0x584b1d||0x1f4;return function(_0x331bad){logger[_0xd1c3('0x2b')](_0x331bad['stack']);if(_0x331bad[_0xd1c3('0x2c')]){delete _0x331bad['name'];}_0x287952[_0xd1c3('0x1c')](_0x584b1d)[_0xd1c3('0x2d')](_0x331bad);};}exports[_0xd1c3('0x2e')]=function(_0xdf49e1,_0x2c4449){var _0x1cd292={},_0xa52671={},_0x7613a9={'count':0x0,'rows':[]};var _0x525150=_['map'](db[_0xd1c3('0x2f')][_0xd1c3('0x30')],function(_0x55d395){return{'name':_0x55d395[_0xd1c3('0x31')],'type':_0x55d395['type'][_0xd1c3('0x32')]};});_0xa52671[_0xd1c3('0x33')]=_[_0xd1c3('0x34')](_0x525150,'name');_0xa52671[_0xd1c3('0x35')]=_[_0xd1c3('0x36')](_0xdf49e1[_0xd1c3('0x35')]);_0xa52671[_0xd1c3('0x37')]=_[_0xd1c3('0x38')](_0xa52671[_0xd1c3('0x33')],_0xa52671[_0xd1c3('0x35')]);_0x1cd292[_0xd1c3('0x39')]=_[_0xd1c3('0x38')](_0xa52671['model'],qs['fields'](_0xdf49e1[_0xd1c3('0x35')]['fields']));_0x1cd292[_0xd1c3('0x39')]=_0x1cd292[_0xd1c3('0x39')][_0xd1c3('0x3a')]?_0x1cd292[_0xd1c3('0x39')]:_0xa52671[_0xd1c3('0x33')];if(!_0xdf49e1[_0xd1c3('0x35')]['hasOwnProperty'](_0xd1c3('0x3b'))){_0x1cd292['limit']=qs[_0xd1c3('0x21')](_0xdf49e1['query'][_0xd1c3('0x21')]);_0x1cd292['offset']=qs['offset'](_0xdf49e1[_0xd1c3('0x35')][_0xd1c3('0x1f')]);}_0x1cd292[_0xd1c3('0x3c')]=qs['sort'](_0xdf49e1[_0xd1c3('0x35')][_0xd1c3('0x3d')]);_0x1cd292[_0xd1c3('0x3e')]=qs['filters'](_[_0xd1c3('0x3f')](_0xdf49e1[_0xd1c3('0x35')],_0xa52671[_0xd1c3('0x37')]),_0x525150);if(_0xdf49e1[_0xd1c3('0x35')][_0xd1c3('0x40')]){_0x1cd292[_0xd1c3('0x3e')]=_[_0xd1c3('0x41')](_0x1cd292['where'],{'$or':_[_0xd1c3('0x34')](_0x525150,function(_0x357855){if(_0x357855['type']!=='VIRTUAL'){var _0x413e25={};_0x413e25[_0x357855[_0xd1c3('0x2c')]]={'$like':'%'+_0xdf49e1[_0xd1c3('0x35')][_0xd1c3('0x40')]+'%'};return _0x413e25;}})});}_0x1cd292=_[_0xd1c3('0x41')]({},_0x1cd292,_0xdf49e1['options']);var _0x142c15={'where':_0x1cd292[_0xd1c3('0x3e')]};return db[_0xd1c3('0x2f')][_0xd1c3('0x42')](_0x142c15)[_0xd1c3('0x26')](function(_0x439f3){_0x7613a9[_0xd1c3('0x42')]=_0x439f3;if(_0xdf49e1[_0xd1c3('0x35')][_0xd1c3('0x43')]){_0x1cd292[_0xd1c3('0x44')]=[{'all':!![]}];}return db['SmsQueue'][_0xd1c3('0x45')](_0x1cd292);})['then'](function(_0x4cab3f){_0x7613a9[_0xd1c3('0x46')]=_0x4cab3f;return _0x7613a9;})[_0xd1c3('0x26')](respondWithFilteredResult(_0x2c4449,_0x1cd292))['catch'](handleError(_0x2c4449,null));};exports[_0xd1c3('0x47')]=function(_0x767ff7,_0x261a89){var _0x1bbdcd={'raw':!![],'where':{'id':_0x767ff7['params']['id']}},_0x10bf53={};_0x10bf53['model']=_[_0xd1c3('0x36')](db['SmsQueue'][_0xd1c3('0x30')]);_0x10bf53[_0xd1c3('0x35')]=_[_0xd1c3('0x36')](_0x767ff7[_0xd1c3('0x35')]);_0x10bf53['filters']=_['intersection'](_0x10bf53[_0xd1c3('0x33')],_0x10bf53[_0xd1c3('0x35')]);_0x1bbdcd[_0xd1c3('0x39')]=_['intersection'](_0x10bf53[_0xd1c3('0x33')],qs['fields'](_0x767ff7[_0xd1c3('0x35')][_0xd1c3('0x48')]));_0x1bbdcd[_0xd1c3('0x39')]=_0x1bbdcd[_0xd1c3('0x39')]['length']?_0x1bbdcd['attributes']:_0x10bf53[_0xd1c3('0x33')];if(_0x767ff7[_0xd1c3('0x35')][_0xd1c3('0x43')]){_0x1bbdcd[_0xd1c3('0x44')]=[{'all':!![]}];}_0x1bbdcd=_[_0xd1c3('0x41')]({},_0x1bbdcd,_0x767ff7[_0xd1c3('0x49')]);return db[_0xd1c3('0x2f')][_0xd1c3('0x4a')](_0x1bbdcd)['then'](handleEntityNotFound(_0x261a89,null))[_0xd1c3('0x26')](respondWithResult(_0x261a89,null))[_0xd1c3('0x4b')](handleError(_0x261a89,null));};exports[_0xd1c3('0x4c')]=function(_0x4220ae,_0x2eb58e){return db['SmsQueue']['create'](_0x4220ae[_0xd1c3('0x4d')],{})['then'](function(_0x218f9d){var _0x29691e=_0x4220ae[_0xd1c3('0x4e')]['get']({'plain':!![]});if(!_0x29691e)throw new Error(_0xd1c3('0x4f'));if(_0x29691e[_0xd1c3('0x50')]===_0xd1c3('0x4e')){var _0x14fcd9=_0x218f9d[_0xd1c3('0x28')]({'plain':!![]});var _0x208fc8=_0xd1c3('0x29');return db[_0xd1c3('0x51')][_0xd1c3('0x4a')]({'where':{'name':_0x208fc8,'userProfileId':_0x29691e[_0xd1c3('0x52')]},'raw':!![]})[_0xd1c3('0x26')](function(_0x438b96){if(_0x438b96&&_0x438b96[_0xd1c3('0x53')]===0x0){return db[_0xd1c3('0x2a')]['create']({'name':_0x14fcd9['name'],'resourceId':_0x14fcd9['id'],'type':_0x438b96[_0xd1c3('0x2c')],'sectionId':_0x438b96['id']},{})['then'](function(){return _0x218f9d;});}else{return _0x218f9d;}})[_0xd1c3('0x4b')](function(_0x4579c0){logger[_0xd1c3('0x2b')](_0xd1c3('0x54'),_0x4579c0);throw _0x4579c0;});}return _0x218f9d;})[_0xd1c3('0x26')](respondWithResult(_0x2eb58e,0xc9))[_0xd1c3('0x4b')](handleError(_0x2eb58e,null));};exports[_0xd1c3('0x55')]=function(_0x18aea7,_0x2052e4){if(_0x18aea7[_0xd1c3('0x4d')]['id']){delete _0x18aea7[_0xd1c3('0x4d')]['id'];}return db['SmsQueue'][_0xd1c3('0x4a')]({'where':{'id':_0x18aea7[_0xd1c3('0x56')]['id']}})[_0xd1c3('0x26')](handleEntityNotFound(_0x2052e4,null))['then'](saveUpdates(_0x18aea7[_0xd1c3('0x4d')],null))[_0xd1c3('0x26')](respondWithResult(_0x2052e4,null))[_0xd1c3('0x4b')](handleError(_0x2052e4,null));};exports[_0xd1c3('0x27')]=function(_0x3ed92f,_0x48aae1){return db[_0xd1c3('0x2f')][_0xd1c3('0x4a')]({'where':{'id':_0x3ed92f[_0xd1c3('0x56')]['id']}})[_0xd1c3('0x26')](handleEntityNotFound(_0x48aae1,null))[_0xd1c3('0x26')](removeEntity(_0x48aae1,null))['catch'](handleError(_0x48aae1,null));};exports['describe']=function(_0x2d3731,_0x50a8a2){return db['SmsQueue']['describe']()[_0xd1c3('0x26')](respondWithResult(_0x50a8a2,null))['catch'](handleError(_0x50a8a2,null));};exports[_0xd1c3('0x57')]=function(_0x41d35b,_0x31dda2,_0x590f18){var _0x51ebf2={'raw':!![],'where':{}},_0x53f0fb={},_0x34a0dc;return db[_0xd1c3('0x2f')][_0xd1c3('0x58')]({'where':{'id':_0x41d35b[_0xd1c3('0x56')]['id']}})[_0xd1c3('0x26')](handleEntityNotFound(_0x31dda2,null))[_0xd1c3('0x26')](function(_0x246776){if(_0x246776){_0x34a0dc=_0x246776[_0xd1c3('0x28')]({'plain':!![]});_0x53f0fb['model']=_['keys'](db[_0xd1c3('0x59')][_0xd1c3('0x30')]);_0x53f0fb[_0xd1c3('0x35')]=_['keys'](_0x41d35b[_0xd1c3('0x35')]);_0x53f0fb[_0xd1c3('0x37')]=_[_0xd1c3('0x38')](_0x53f0fb[_0xd1c3('0x33')],_0x53f0fb[_0xd1c3('0x35')]);_0x51ebf2[_0xd1c3('0x39')]=_['intersection'](_0x53f0fb[_0xd1c3('0x33')],qs[_0xd1c3('0x48')](_0x41d35b[_0xd1c3('0x35')][_0xd1c3('0x48')]));_0x51ebf2[_0xd1c3('0x39')]=_0x51ebf2[_0xd1c3('0x39')][_0xd1c3('0x3a')]?_0x51ebf2[_0xd1c3('0x39')]:_0x53f0fb[_0xd1c3('0x33')];if(!_0x41d35b[_0xd1c3('0x35')]['hasOwnProperty']('nolimit')){_0x51ebf2[_0xd1c3('0x21')]=qs[_0xd1c3('0x21')](_0x41d35b[_0xd1c3('0x35')]['limit']);_0x51ebf2[_0xd1c3('0x1f')]=qs[_0xd1c3('0x1f')](_0x41d35b[_0xd1c3('0x35')][_0xd1c3('0x1f')]);}_0x51ebf2[_0xd1c3('0x3c')]=qs[_0xd1c3('0x3d')](_0x41d35b[_0xd1c3('0x35')][_0xd1c3('0x3d')]);_0x51ebf2['where']=qs['filters'](_[_0xd1c3('0x3f')](_0x41d35b[_0xd1c3('0x35')],_0x53f0fb[_0xd1c3('0x37')]));_0x51ebf2[_0xd1c3('0x3e')][_0xd1c3('0x5a')]=_0x246776['id'];if(_0x41d35b['query'][_0xd1c3('0x40')]){_0x51ebf2['where']=_[_0xd1c3('0x41')](_0x51ebf2[_0xd1c3('0x3e')],{'$or':_[_0xd1c3('0x34')](_0x51ebf2['attributes'],function(_0x16b9fd){var _0xcc7d9f={};_0xcc7d9f[_0x16b9fd]={'$like':'%'+_0x41d35b[_0xd1c3('0x35')]['filter']+'%'};return _0xcc7d9f;})});}_0x51ebf2=_[_0xd1c3('0x41')]({},_0x51ebf2,_0x41d35b[_0xd1c3('0x49')]);return db[_0xd1c3('0x59')]['findAll'](_0x51ebf2);}})[_0xd1c3('0x26')](function(_0x11f751){if(_0x11f751){return db[_0xd1c3('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x11f751,_0xd1c3('0x5c')),'role':'agent'},'attributes':['id',_0xd1c3('0x2c'),'smsPause',_0xd1c3('0x5d'),_0xd1c3('0x5e')]});}})[_0xd1c3('0x26')](function(_0x9cd201){if(_0x9cd201){return{'count':_0x9cd201[_0xd1c3('0x42')],'rows':_[_0xd1c3('0x34')](_0x9cd201[_0xd1c3('0x46')],function(_0x20529f){return{'membername':_0x20529f[_0xd1c3('0x2c')],'UserId':_0x20529f['id'],'queue_name':_0x34a0dc[_0xd1c3('0x2c')],'SmsQueueId':_0x34a0dc['id'],'interface':util['format']('%s/%s',_0xd1c3('0x5f'),_0x20529f[_0xd1c3('0x2c')]),'penalty':0x0,'paused':_0x20529f[_0xd1c3('0x60')],'createdAt':_0x20529f[_0xd1c3('0x5e')],'updatedAt':_0x20529f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x31dda2,_0x51ebf2))[_0xd1c3('0x4b')](handleError(_0x31dda2,null));};exports['getTeams']=function(_0x1e3d7e,_0x29b300,_0x572880){var _0x212416={};var _0x3a88e8={};var _0x3027cb;var _0x5daaa8;return db[_0xd1c3('0x2f')][_0xd1c3('0x58')]({'where':{'id':_0x1e3d7e[_0xd1c3('0x56')]['id']}})[_0xd1c3('0x26')](handleEntityNotFound(_0x29b300,null))[_0xd1c3('0x26')](function(_0x51f3da){if(_0x51f3da){_0x3027cb=_0x51f3da;_0x3a88e8['model']=_[_0xd1c3('0x36')](db[_0xd1c3('0x61')]['rawAttributes']);_0x3a88e8[_0xd1c3('0x35')]=_['keys'](_0x1e3d7e[_0xd1c3('0x35')]);_0x3a88e8[_0xd1c3('0x37')]=_[_0xd1c3('0x38')](_0x3a88e8[_0xd1c3('0x33')],_0x3a88e8['query']);_0x212416[_0xd1c3('0x39')]=_[_0xd1c3('0x38')](_0x3a88e8['model'],qs[_0xd1c3('0x48')](_0x1e3d7e[_0xd1c3('0x35')]['fields']));_0x212416[_0xd1c3('0x39')]=_0x212416[_0xd1c3('0x39')][_0xd1c3('0x3a')]?_0x212416[_0xd1c3('0x39')]:_0x3a88e8[_0xd1c3('0x33')];_0x212416[_0xd1c3('0x3c')]=qs[_0xd1c3('0x3d')](_0x1e3d7e['query'][_0xd1c3('0x3d')]);_0x212416[_0xd1c3('0x3e')]=qs[_0xd1c3('0x37')](_[_0xd1c3('0x3f')](_0x1e3d7e[_0xd1c3('0x35')],_0x3a88e8[_0xd1c3('0x37')]));if(_0x1e3d7e['query'][_0xd1c3('0x40')]){_0x212416['where']=_[_0xd1c3('0x41')](_0x212416['where'],{'$or':_[_0xd1c3('0x34')](_0x212416[_0xd1c3('0x39')],function(_0x4fe8ac){var _0xf39d20={};_0xf39d20[_0x4fe8ac]={'$like':'%'+_0x1e3d7e[_0xd1c3('0x35')][_0xd1c3('0x40')]+'%'};return _0xf39d20;})});}_0x212416=_[_0xd1c3('0x41')]({},_0x212416,_0x1e3d7e[_0xd1c3('0x49')]);return _0x3027cb[_0xd1c3('0x62')](_0x212416);}})[_0xd1c3('0x26')](function(_0x2ed2f0){if(_0x2ed2f0){_0x5daaa8=_0x2ed2f0[_0xd1c3('0x3a')];if(!_0x1e3d7e[_0xd1c3('0x35')]['hasOwnProperty']('nolimit')){_0x212416[_0xd1c3('0x21')]=qs[_0xd1c3('0x21')](_0x1e3d7e[_0xd1c3('0x35')][_0xd1c3('0x21')]);_0x212416['offset']=qs[_0xd1c3('0x1f')](_0x1e3d7e[_0xd1c3('0x35')]['offset']);}return _0x3027cb[_0xd1c3('0x62')](_0x212416);}})[_0xd1c3('0x26')](function(_0x5e54f0){if(_0x5e54f0){return _0x5e54f0?{'count':_0x5daaa8,'rows':_0x5e54f0}:null;}})[_0xd1c3('0x26')](respondWithResult(_0x29b300,null))['catch'](handleError(_0x29b300,null));};exports[_0xd1c3('0x63')]=function(_0x114147,_0x6f209c,_0x4677e5){var _0x581d5a=_0x114147[_0xd1c3('0x4d')][_0xd1c3('0x64')];return db[_0xd1c3('0x61')][_0xd1c3('0x45')]({'where':{'id':_0x581d5a},'attributes':['id'],'include':[{'model':db[_0xd1c3('0x5b')],'as':'Agents','attributes':['id','name','online','voicePause','interface'],'raw':!![]}]})[_0xd1c3('0x26')](function(_0x2fbae3){if(_0x2fbae3){var _0x41cef1=_['flatMap'](_0x2fbae3,function(_0xc67524){var _0x32d8b0=_0xc67524[_0xd1c3('0x28')]({'plain':!![]});return _0x32d8b0[_0xd1c3('0x65')];});return db[_0xd1c3('0x2f')][_0xd1c3('0x4a')]({'where':{'id':_0x114147[_0xd1c3('0x56')]['id']}})[_0xd1c3('0x26')](function(_0x34e116){return db[_0xd1c3('0x66')][_0xd1c3('0x67')](function(_0x51be2c){return _0x34e116[_0xd1c3('0x63')](_0x581d5a,{'transaction':_0x51be2c})[_0xd1c3('0x26')](function(){return BPromise[_0xd1c3('0x68')](_0x41cef1,function(_0x3ab1b3){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x3ab1b3['id'],'SmsQueueId':_0x114147[_0xd1c3('0x56')]['id']},'transaction':_0x51be2c});});})[_0xd1c3('0x26')](function(){_0x41cef1[_0xd1c3('0x69')](function(_0x4df457){socket[_0xd1c3('0x6a')](_0xd1c3('0x6b'),{'UserId':_0x4df457['id'],'SmsQueueId':_0x34e116['id']});});});});});}})['then'](respondWithStatusCode(_0x6f209c,null))['catch'](handleError(_0x6f209c,null));};exports[_0xd1c3('0x6c')]=function(_0x59bb51,_0x2539d4,_0x27ae56){return db['Team']['findAll']({'where':{'id':_0x59bb51[_0xd1c3('0x35')][_0xd1c3('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd1c3('0x26')](handleEntityNotFound(_0x2539d4,null))[_0xd1c3('0x26')](function(_0x5de79b){var _0xefbda8=_[_0xd1c3('0x34')](_0x5de79b,'id');var _0x259297=[];var _0x5021a4=[];var _0x5140c2=squel[_0xd1c3('0x6d')]();_0x5140c2[_0xd1c3('0x6e')](_0xd1c3('0x6f'))[_0xd1c3('0x70')](_0xd1c3('0x71'),'tq')['join'](_0xd1c3('0x72'),'ut',_0xd1c3('0x73'))[_0xd1c3('0x3e')](_0xd1c3('0x74'),_0x59bb51[_0xd1c3('0x56')]['id']);for(var _0x310b3b=0x0;_0x310b3b<_0x5de79b['length'];_0x310b3b+=0x1){let _0x54f6cb=_0x5de79b[_0x310b3b];for(var _0x31f103=0x0;_0x31f103<_0x54f6cb[_0xd1c3('0x65')][_0xd1c3('0x3a')];_0x31f103+=0x1){let _0x12ae48=_0x54f6cb['Agents'][_0x31f103];var _0x4b2f81=_0x5140c2[_0xd1c3('0x75')]();_0x4b2f81[_0xd1c3('0x3e')](_0xd1c3('0x76'),_0x12ae48['id']);_0x5021a4[_0xd1c3('0x77')](db[_0xd1c3('0x66')][_0xd1c3('0x35')](_0x4b2f81[_0xd1c3('0x78')](),{'type':db[_0xd1c3('0x66')][_0xd1c3('0x79')][_0xd1c3('0x7a')]})[_0xd1c3('0x26')](function(_0x3431a0){if(_0x3431a0[_0xd1c3('0x3a')]===0x1){return _0x12ae48['id'];}else{var _0x3b258b=_[_0xd1c3('0x7b')](_[_0xd1c3('0x34')](_0x3431a0,_0xd1c3('0x7c')),function(_0x16b23c){return _[_0xd1c3('0x7d')](_0xefbda8,_0x16b23c);});if(_0x3b258b){return _0x12ae48['id'];}}}));}}return BPromise[_0xd1c3('0x7e')](_0x5021a4)[_0xd1c3('0x26')](function(_0x19a8fc){_0x259297=_(_0x259297)[_0xd1c3('0x7f')](_0x19a8fc)['compact']()[_0xd1c3('0x80')]();return db[_0xd1c3('0x2f')][_0xd1c3('0x4a')]({'where':{'id':_0x59bb51[_0xd1c3('0x56')]['id']}})[_0xd1c3('0x26')](function(_0xaebb5c){return db[_0xd1c3('0x66')][_0xd1c3('0x67')](function(_0x336cc5){return _0xaebb5c[_0xd1c3('0x6c')](_0x59bb51['query'][_0xd1c3('0x64')],{'transaction':_0x336cc5})[_0xd1c3('0x26')](function(){if(!_[_0xd1c3('0x81')](_0x259297)){return _0xaebb5c[_0xd1c3('0x82')](_0x259297,{'transaction':_0x336cc5});}})['then'](function(){_0x259297[_0xd1c3('0x69')](function(_0x34dc95){socket['emit'](_0xd1c3('0x83'),{'UserId':_0x34dc95,'SmsQueueId':_0xaebb5c['id']});});});});});});})['then'](respondWithStatusCode(_0x2539d4,null))[_0xd1c3('0x4b')](handleError(_0x2539d4,null));};exports[_0xd1c3('0x84')]=function(_0x207d6a,_0x26d5a4,_0x347d7b){return db[_0xd1c3('0x2f')][_0xd1c3('0x4a')]({'where':{'id':_0x207d6a[_0xd1c3('0x56')]['id']}})['then'](handleEntityNotFound(_0x26d5a4,null))[_0xd1c3('0x26')](function(_0x43de9d){if(_0x43de9d){return _0x43de9d[_0xd1c3('0x84')](_0x207d6a[_0xd1c3('0x4d')][_0xd1c3('0x64')],_[_0xd1c3('0x85')](_0x207d6a[_0xd1c3('0x4d')],[_0xd1c3('0x64'),'id'])||{})[_0xd1c3('0x86')](function(_0x2c4274){for(var _0x475c20=0x0;_0x475c20<_0x207d6a[_0xd1c3('0x4d')][_0xd1c3('0x64')][_0xd1c3('0x3a')];_0x475c20+=0x1){socket[_0xd1c3('0x6a')](_0xd1c3('0x6b'),{'UserId':Number(_0x207d6a[_0xd1c3('0x4d')]['ids'][_0x475c20]),'SmsQueueId':Number(_0x207d6a[_0xd1c3('0x56')]['id'])});}return _0x2c4274;});}})[_0xd1c3('0x26')](respondWithResult(_0x26d5a4,null))['catch'](handleError(_0x26d5a4,null));};exports[_0xd1c3('0x82')]=function(_0x193c9f,_0x55ad21,_0x57eb8b){return db[_0xd1c3('0x2f')][_0xd1c3('0x4a')]({'where':{'id':_0x193c9f['params']['id']}})[_0xd1c3('0x26')](handleEntityNotFound(_0x55ad21,null))[_0xd1c3('0x26')](function(_0x3b80fc){if(_0x3b80fc){return _0x3b80fc[_0xd1c3('0x82')](_0x193c9f[_0xd1c3('0x35')][_0xd1c3('0x64')])['then'](function(){if(_[_0xd1c3('0x87')](_0x193c9f[_0xd1c3('0x35')][_0xd1c3('0x64')])){for(var _0x3e7009=0x0;_0x3e7009<_0x193c9f[_0xd1c3('0x35')][_0xd1c3('0x64')][_0xd1c3('0x3a')];_0x3e7009+=0x1){socket[_0xd1c3('0x6a')](_0xd1c3('0x83'),{'UserId':Number(_0x193c9f[_0xd1c3('0x35')][_0xd1c3('0x64')][_0x3e7009]),'SmsQueueId':Number(_0x193c9f['params']['id'])});}}else{socket['emit'](_0xd1c3('0x83'),{'UserId':Number(_0x193c9f['query'][_0xd1c3('0x64')]),'SmsQueueId':Number(_0x193c9f[_0xd1c3('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x55ad21,null))[_0xd1c3('0x4b')](handleError(_0x55ad21,null));};exports[_0xd1c3('0x88')]=function(_0x120013,_0x379b6f,_0x552de5){var _0x39c67c={};var _0x3f2437={};var _0x37813b;var _0x46f70f;return db[_0xd1c3('0x2f')][_0xd1c3('0x58')]({'where':{'id':_0x120013[_0xd1c3('0x56')]['id']}})[_0xd1c3('0x26')](handleEntityNotFound(_0x379b6f,null))[_0xd1c3('0x26')](function(_0x205862){if(_0x205862){_0x37813b=_0x205862;_0x3f2437[_0xd1c3('0x33')]=_['keys'](db[_0xd1c3('0x5b')][_0xd1c3('0x30')]);_0x3f2437[_0xd1c3('0x35')]=_[_0xd1c3('0x36')](_0x120013['query']);_0x3f2437[_0xd1c3('0x37')]=_['intersection'](_0x3f2437[_0xd1c3('0x33')],_0x3f2437['query']);_0x39c67c[_0xd1c3('0x39')]=_['intersection'](_0x3f2437['model'],qs['fields'](_0x120013[_0xd1c3('0x35')][_0xd1c3('0x48')]));_0x39c67c[_0xd1c3('0x39')]=_0x39c67c['attributes'][_0xd1c3('0x3a')]?_0x39c67c['attributes']:_0x3f2437[_0xd1c3('0x33')];_0x39c67c[_0xd1c3('0x3c')]=qs['sort'](_0x120013[_0xd1c3('0x35')][_0xd1c3('0x3d')]);_0x39c67c[_0xd1c3('0x3e')]=qs['filters'](_['pick'](_0x120013['query'],_0x3f2437[_0xd1c3('0x37')]));if(_0x120013['query'][_0xd1c3('0x40')]){_0x39c67c[_0xd1c3('0x3e')]=_[_0xd1c3('0x41')](_0x39c67c[_0xd1c3('0x3e')],{'$or':_[_0xd1c3('0x34')](_0x39c67c[_0xd1c3('0x39')],function(_0x45a829){var _0x4d78c2={};_0x4d78c2[_0x45a829]={'$like':'%'+_0x120013[_0xd1c3('0x35')][_0xd1c3('0x40')]+'%'};return _0x4d78c2;})});}_0x39c67c=_[_0xd1c3('0x41')]({},_0x39c67c,_0x120013[_0xd1c3('0x49')]);return _0x37813b[_0xd1c3('0x88')](_0x39c67c);}})[_0xd1c3('0x26')](function(_0x31a934){if(_0x31a934){_0x46f70f=_0x31a934[_0xd1c3('0x3a')];if(!_0x120013[_0xd1c3('0x35')][_0xd1c3('0x89')](_0xd1c3('0x3b'))){_0x39c67c[_0xd1c3('0x21')]=qs[_0xd1c3('0x21')](_0x120013[_0xd1c3('0x35')][_0xd1c3('0x21')]);_0x39c67c[_0xd1c3('0x1f')]=qs[_0xd1c3('0x1f')](_0x120013[_0xd1c3('0x35')][_0xd1c3('0x1f')]);}return _0x37813b['getAgents'](_0x39c67c);}})['then'](function(_0x5b7e62){if(_0x5b7e62){return _0x5b7e62?{'count':_0x46f70f,'rows':_0x5b7e62}:null;}})['then'](respondWithResult(_0x379b6f,null))[_0xd1c3('0x4b')](handleError(_0x379b6f,null));};
\ No newline at end of file
index 2ab495b..6856190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a35=['events','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x36e9d5,_0xb4944b){var _0x3b49a5=function(_0x4c8f8d){while(--_0x4c8f8d){_0x36e9d5['push'](_0x36e9d5['shift']());}};_0x3b49a5(++_0xb4944b);}(_0x4a35,0x118));var _0x54a3=function(_0x44c17f,_0x412b83){_0x44c17f=_0x44c17f-0x0;var _0x2aaf75=_0x4a35[_0x44c17f];return _0x2aaf75;};'use strict';var EventEmitter=require(_0x54a3('0x0'));var SmsQueue=require(_0x54a3('0x1'))['db'][_0x54a3('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x54a3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x54a3('0x4'),'afterDestroy':_0x54a3('0x5')};function emitEvent(_0x2a9c41){return function(_0x31b458,_0x1f0c12,_0x42bd01){SmsQueueEvents[_0x54a3('0x6')](_0x2a9c41+':'+_0x31b458['id'],_0x31b458);SmsQueueEvents['emit'](_0x2a9c41,_0x31b458);_0x42bd01(null);};}for(var e in events){if(events[_0x54a3('0x7')](e)){var event=events[e];SmsQueue[_0x54a3('0x8')](e,emitEvent(event));}}module[_0x54a3('0x9')]=SmsQueueEvents;
\ No newline at end of file
+var _0xb90e=['update','emit','hasOwnProperty','exports','SmsQueue','setMaxListeners','save'];(function(_0x26f96a,_0x13636a){var _0x2b3b20=function(_0x170d5f){while(--_0x170d5f){_0x26f96a['push'](_0x26f96a['shift']());}};_0x2b3b20(++_0x13636a);}(_0xb90e,0x170));var _0xeb90=function(_0x12665e,_0x504c11){_0x12665e=_0x12665e-0x0;var _0x24b208=_0xb90e[_0x12665e];return _0x24b208;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0xeb90('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xeb90('0x1')](0x0);var events={'afterCreate':_0xeb90('0x2'),'afterUpdate':_0xeb90('0x3'),'afterDestroy':'remove'};function emitEvent(_0xec09a4){return function(_0x31ca84,_0x4c71f6,_0x327765){SmsQueueEvents[_0xeb90('0x4')](_0xec09a4+':'+_0x31ca84['id'],_0x31ca84);SmsQueueEvents['emit'](_0xec09a4,_0x31ca84);_0x327765(null);};}for(var e in events){if(events[_0xeb90('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xeb90('0x6')]=SmsQueueEvents;
\ No newline at end of file
index a381a6b..2d4fb05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5a4=['api','moment','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports','define','sms_queues','lodash','../../config/logger'];(function(_0x2cad24,_0x29126e){var _0x4ed5dc=function(_0x56f1c0){while(--_0x56f1c0){_0x2cad24['push'](_0x2cad24['shift']());}};_0x4ed5dc(++_0x29126e);}(_0xa5a4,0x14e));var _0x4a5a=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xa5a4[_0x5b27da];return _0x3254f4;};'use strict';var _=require(_0x4a5a('0x0'));var util=require('util');var logger=require(_0x4a5a('0x1'))(_0x4a5a('0x2'));var moment=require(_0x4a5a('0x3'));var BPromise=require(_0x4a5a('0x4'));var rp=require(_0x4a5a('0x5'));var fs=require('fs');var path=require(_0x4a5a('0x6'));var rimraf=require(_0x4a5a('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a5a('0x8'));module[_0x4a5a('0x9')]=function(_0x3b9961,_0x52f505){return _0x3b9961[_0x4a5a('0xa')]('SmsQueue',attributes,{'tableName':_0x4a5a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfa7=['path','../../config/environment','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x519071,_0x4e1795){var _0x14aea4=function(_0x711448){while(--_0x711448){_0x519071['push'](_0x519071['shift']());}};_0x14aea4(++_0x4e1795);}(_0xdfa7,0x1a8));var _0x7dfa=function(_0x172dc4,_0x397fbf){_0x172dc4=_0x172dc4-0x0;var _0x2b9dc8=_0xdfa7[_0x172dc4];return _0x2b9dc8;};'use strict';var _=require(_0x7dfa('0x0'));var util=require(_0x7dfa('0x1'));var logger=require(_0x7dfa('0x2'))('api');var moment=require(_0x7dfa('0x3'));var BPromise=require(_0x7dfa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7dfa('0x5'));var rimraf=require('rimraf');var config=require(_0x7dfa('0x6'));var attributes=require('./smsQueue.attributes');module[_0x7dfa('0x7')]=function(_0x1c6db5,_0x1cd43c){return _0x1c6db5[_0x7dfa('0x8')](_0x7dfa('0x9'),attributes,{'tableName':_0x7dfa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d5b9205..247b1f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe084=['ShowSmsQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','raw','options','where','attributes','limit','include','map','model'];(function(_0x434ab8,_0x164e29){var _0x4173a2=function(_0xb62744){while(--_0xb62744){_0x434ab8['push'](_0x434ab8['shift']());}};_0x4173a2(++_0x164e29);}(_0xe084,0x80));var _0x4e08=function(_0x59d8cf,_0x697b8b){_0x59d8cf=_0x59d8cf-0x0;var _0x417855=_0xe084[_0x59d8cf];return _0x417855;};'use strict';var _=require(_0x4e08('0x0'));var util=require(_0x4e08('0x1'));var moment=require(_0x4e08('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e08('0x3'));var fs=require('fs');var Redis=require(_0x4e08('0x4'));var db=require(_0x4e08('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e08('0x6'))(_0x4e08('0x7'));var config=require(_0x4e08('0x8'));var jayson=require(_0x4e08('0x9'));var client=jayson[_0x4e08('0xa')][_0x4e08('0xb')]({'port':0x232a});config[_0x4e08('0xc')]=_[_0x4e08('0xd')](config[_0x4e08('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4e08('0xe'))(new Redis(config[_0x4e08('0xc')]));require(_0x4e08('0xf'))[_0x4e08('0x10')](socket);function respondWithRpcPromise(_0x20e82a,_0x262b27,_0x486a29){return new BPromise(function(_0x2ae782,_0x2d2d02){return client[_0x4e08('0x11')](_0x20e82a,_0x486a29)[_0x4e08('0x12')](function(_0x484de0){logger[_0x4e08('0x13')](_0x4e08('0x14'),_0x262b27,'request\x20sent');logger[_0x4e08('0x15')](_0x4e08('0x16'),_0x262b27,_0x4e08('0x17'),JSON[_0x4e08('0x18')](_0x484de0));if(_0x484de0[_0x4e08('0x19')]){if(_0x484de0['error']['code']===0x1f4){logger[_0x4e08('0x19')]('SmsQueue,\x20%s,\x20%s',_0x262b27,_0x484de0[_0x4e08('0x19')][_0x4e08('0x1a')]);return _0x2d2d02(_0x484de0[_0x4e08('0x19')]['message']);}logger[_0x4e08('0x19')](_0x4e08('0x14'),_0x262b27,_0x484de0['error'][_0x4e08('0x1a')]);return _0x2ae782(_0x484de0['error'][_0x4e08('0x1a')]);}else{logger[_0x4e08('0x13')](_0x4e08('0x14'),_0x262b27,_0x4e08('0x17'));_0x2ae782(_0x484de0[_0x4e08('0x1b')][_0x4e08('0x1a')]);}})[_0x4e08('0x1c')](function(_0x178822){logger[_0x4e08('0x19')](_0x4e08('0x14'),_0x262b27,_0x178822);_0x2d2d02(_0x178822);});});}exports[_0x4e08('0x1d')]=function(_0x2a439f){var _0xe4dcae=this;return new Promise(function(_0x3e7bbe,_0x10d6c8){return db[_0x4e08('0x1e')][_0x4e08('0x1f')]({'raw':_0x2a439f['options']?_0x2a439f['options'][_0x4e08('0x20')]===undefined?!![]:![]:!![],'where':_0x2a439f[_0x4e08('0x21')]?_0x2a439f[_0x4e08('0x21')][_0x4e08('0x22')]||null:null,'attributes':_0x2a439f[_0x4e08('0x21')]?_0x2a439f[_0x4e08('0x21')][_0x4e08('0x23')]||null:null,'limit':_0x2a439f[_0x4e08('0x21')]?_0x2a439f[_0x4e08('0x21')][_0x4e08('0x24')]||null:null,'include':_0x2a439f[_0x4e08('0x21')]?_0x2a439f[_0x4e08('0x21')][_0x4e08('0x25')]?_['map'](_0x2a439f['options'][_0x4e08('0x25')],function(_0x3ca0ba){return{'model':db[_0x3ca0ba['model']],'as':_0x3ca0ba['as'],'attributes':_0x3ca0ba[_0x4e08('0x23')],'include':_0x3ca0ba[_0x4e08('0x25')]?_[_0x4e08('0x26')](_0x3ca0ba[_0x4e08('0x25')],function(_0x107b94){return{'model':db[_0x107b94[_0x4e08('0x27')]],'as':_0x107b94['as'],'attributes':_0x107b94['attributes'],'include':_0x107b94[_0x4e08('0x25')]?_['map'](_0x107b94[_0x4e08('0x25')],function(_0x445952){return{'model':db[_0x445952['model']],'as':_0x445952['as'],'attributes':_0x445952[_0x4e08('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6f9c4a){logger[_0x4e08('0x13')](_0x4e08('0x1d'),_0x2a439f);logger[_0x4e08('0x15')](_0x4e08('0x1d'),_0x2a439f,JSON[_0x4e08('0x18')](_0x6f9c4a));_0x3e7bbe(_0x6f9c4a);})[_0x4e08('0x1c')](function(_0x4ff0cb){logger[_0x4e08('0x19')](_0x4e08('0x1d'),_0x4ff0cb[_0x4e08('0x1a')],_0x2a439f);_0x10d6c8(_0xe4dcae[_0x4e08('0x19')](0x1f4,_0x4ff0cb[_0x4e08('0x1a')]));});});};exports[_0x4e08('0x28')]=function(_0x1d8c20){var _0x1bd33c=this;return new Promise(function(_0x17f80d,_0x930925){return db[_0x4e08('0x1e')][_0x4e08('0x29')]({'raw':_0x1d8c20['options']?_0x1d8c20[_0x4e08('0x21')][_0x4e08('0x20')]===undefined?!![]:![]:!![],'where':_0x1d8c20['options']?_0x1d8c20[_0x4e08('0x21')]['where']||null:null,'attributes':_0x1d8c20['options']?_0x1d8c20[_0x4e08('0x21')]['attributes']||null:null,'include':_0x1d8c20['options']?_0x1d8c20[_0x4e08('0x21')][_0x4e08('0x25')]?_[_0x4e08('0x26')](_0x1d8c20[_0x4e08('0x21')][_0x4e08('0x25')],function(_0x36b0ca){return{'model':db[_0x36b0ca[_0x4e08('0x27')]],'as':_0x36b0ca['as'],'attributes':_0x36b0ca[_0x4e08('0x23')],'include':_0x36b0ca[_0x4e08('0x25')]?_[_0x4e08('0x26')](_0x36b0ca[_0x4e08('0x25')],function(_0x17a938){return{'model':db[_0x17a938[_0x4e08('0x27')]],'as':_0x17a938['as'],'attributes':_0x17a938['attributes'],'include':_0x17a938[_0x4e08('0x25')]?_[_0x4e08('0x26')](_0x17a938['include'],function(_0x4b62f1){return{'model':db[_0x4b62f1[_0x4e08('0x27')]],'as':_0x4b62f1['as'],'attributes':_0x4b62f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e08('0x12')](function(_0x701fe1){logger[_0x4e08('0x13')](_0x4e08('0x28'),_0x1d8c20);logger[_0x4e08('0x15')](_0x4e08('0x28'),_0x1d8c20,JSON[_0x4e08('0x18')](_0x701fe1));_0x17f80d(_0x701fe1);})[_0x4e08('0x1c')](function(_0x11c437){logger['error']('ShowSmsQueue',_0x11c437[_0x4e08('0x1a')],_0x1d8c20);_0x930925(_0x1bd33c[_0x4e08('0x19')](0x1f4,_0x11c437['message']));});});};
\ No newline at end of file
+var _0xb50c=['code','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','attributes','model','ShowSmsQueue','find','lodash','moment','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x736b90,_0x2888ab){var _0x103027=function(_0x91cbde){while(--_0x91cbde){_0x736b90['push'](_0x736b90['shift']());}};_0x103027(++_0x2888ab);}(_0xb50c,0x1f1));var _0xcb50=function(_0x4e9e90,_0x45873a){_0x4e9e90=_0x4e9e90-0x0;var _0x7980e0=_0xb50c[_0x4e9e90];return _0x7980e0;};'use strict';var _=require(_0xcb50('0x0'));var util=require('util');var moment=require(_0xcb50('0x1'));var BPromise=require(_0xcb50('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcb50('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xcb50('0x4'));var jayson=require(_0xcb50('0x5'));var client=jayson[_0xcb50('0x6')][_0xcb50('0x7')]({'port':0x232a});config[_0xcb50('0x8')]=_[_0xcb50('0x9')](config[_0xcb50('0x8')],{'host':_0xcb50('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb50('0x8')]));require(_0xcb50('0xb'))['register'](socket);function respondWithRpcPromise(_0x1676a6,_0x295570,_0x591ebb){return new BPromise(function(_0x31ee67,_0x7d5026){return client[_0xcb50('0xc')](_0x1676a6,_0x591ebb)[_0xcb50('0xd')](function(_0x177f3b){logger[_0xcb50('0xe')](_0xcb50('0xf'),_0x295570,_0xcb50('0x10'));logger[_0xcb50('0x11')](_0xcb50('0x12'),_0x295570,_0xcb50('0x10'),JSON[_0xcb50('0x13')](_0x177f3b));if(_0x177f3b[_0xcb50('0x14')]){if(_0x177f3b[_0xcb50('0x14')][_0xcb50('0x15')]===0x1f4){logger[_0xcb50('0x14')](_0xcb50('0xf'),_0x295570,_0x177f3b[_0xcb50('0x14')][_0xcb50('0x16')]);return _0x7d5026(_0x177f3b['error'][_0xcb50('0x16')]);}logger[_0xcb50('0x14')](_0xcb50('0xf'),_0x295570,_0x177f3b[_0xcb50('0x14')][_0xcb50('0x16')]);return _0x31ee67(_0x177f3b[_0xcb50('0x14')][_0xcb50('0x16')]);}else{logger[_0xcb50('0xe')](_0xcb50('0xf'),_0x295570,_0xcb50('0x10'));_0x31ee67(_0x177f3b['result'][_0xcb50('0x16')]);}})[_0xcb50('0x17')](function(_0x291048){logger[_0xcb50('0x14')]('SmsQueue,\x20%s,\x20%s',_0x295570,_0x291048);_0x7d5026(_0x291048);});});}exports[_0xcb50('0x18')]=function(_0x2c9981){var _0x534d66=this;return new Promise(function(_0x5dafe0,_0x40cf76){return db[_0xcb50('0x19')][_0xcb50('0x1a')]({'raw':_0x2c9981[_0xcb50('0x1b')]?_0x2c9981[_0xcb50('0x1b')][_0xcb50('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c9981[_0xcb50('0x1b')]?_0x2c9981['options'][_0xcb50('0x1d')]||null:null,'attributes':_0x2c9981[_0xcb50('0x1b')]?_0x2c9981[_0xcb50('0x1b')]['attributes']||null:null,'limit':_0x2c9981['options']?_0x2c9981[_0xcb50('0x1b')][_0xcb50('0x1e')]||null:null,'include':_0x2c9981[_0xcb50('0x1b')]?_0x2c9981['options'][_0xcb50('0x1f')]?_[_0xcb50('0x20')](_0x2c9981[_0xcb50('0x1b')][_0xcb50('0x1f')],function(_0x151cee){return{'model':db[_0x151cee['model']],'as':_0x151cee['as'],'attributes':_0x151cee[_0xcb50('0x21')],'include':_0x151cee[_0xcb50('0x1f')]?_['map'](_0x151cee[_0xcb50('0x1f')],function(_0x545fee){return{'model':db[_0x545fee[_0xcb50('0x22')]],'as':_0x545fee['as'],'attributes':_0x545fee[_0xcb50('0x21')],'include':_0x545fee[_0xcb50('0x1f')]?_[_0xcb50('0x20')](_0x545fee['include'],function(_0x333874){return{'model':db[_0x333874[_0xcb50('0x22')]],'as':_0x333874['as'],'attributes':_0x333874['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb50('0xd')](function(_0x366f6e){logger[_0xcb50('0xe')](_0xcb50('0x18'),_0x2c9981);logger[_0xcb50('0x11')](_0xcb50('0x18'),_0x2c9981,JSON[_0xcb50('0x13')](_0x366f6e));_0x5dafe0(_0x366f6e);})[_0xcb50('0x17')](function(_0x4af59c){logger[_0xcb50('0x14')](_0xcb50('0x18'),_0x4af59c[_0xcb50('0x16')],_0x2c9981);_0x40cf76(_0x534d66['error'](0x1f4,_0x4af59c['message']));});});};exports[_0xcb50('0x23')]=function(_0x9ff5cc){var _0x1a4c15=this;return new Promise(function(_0x36bc95,_0x4e6022){return db[_0xcb50('0x19')][_0xcb50('0x24')]({'raw':_0x9ff5cc[_0xcb50('0x1b')]?_0x9ff5cc[_0xcb50('0x1b')][_0xcb50('0x1c')]===undefined?!![]:![]:!![],'where':_0x9ff5cc[_0xcb50('0x1b')]?_0x9ff5cc[_0xcb50('0x1b')][_0xcb50('0x1d')]||null:null,'attributes':_0x9ff5cc['options']?_0x9ff5cc[_0xcb50('0x1b')][_0xcb50('0x21')]||null:null,'include':_0x9ff5cc[_0xcb50('0x1b')]?_0x9ff5cc[_0xcb50('0x1b')][_0xcb50('0x1f')]?_[_0xcb50('0x20')](_0x9ff5cc['options'][_0xcb50('0x1f')],function(_0x5e7a9c){return{'model':db[_0x5e7a9c[_0xcb50('0x22')]],'as':_0x5e7a9c['as'],'attributes':_0x5e7a9c['attributes'],'include':_0x5e7a9c['include']?_[_0xcb50('0x20')](_0x5e7a9c['include'],function(_0x40a391){return{'model':db[_0x40a391[_0xcb50('0x22')]],'as':_0x40a391['as'],'attributes':_0x40a391['attributes'],'include':_0x40a391[_0xcb50('0x1f')]?_[_0xcb50('0x20')](_0x40a391[_0xcb50('0x1f')],function(_0x809a07){return{'model':db[_0x809a07[_0xcb50('0x22')]],'as':_0x809a07['as'],'attributes':_0x809a07[_0xcb50('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcb50('0xd')](function(_0x3887b6){logger[_0xcb50('0xe')](_0xcb50('0x23'),_0x9ff5cc);logger[_0xcb50('0x11')](_0xcb50('0x23'),_0x9ff5cc,JSON[_0xcb50('0x13')](_0x3887b6));_0x36bc95(_0x3887b6);})[_0xcb50('0x17')](function(_0x250b25){logger[_0xcb50('0x14')](_0xcb50('0x23'),_0x250b25[_0xcb50('0x16')],_0x9ff5cc);_0x4e6022(_0x1a4c15[_0xcb50('0x14')](0x1f4,_0x250b25['message']));});});};
\ No newline at end of file
index 3deb844..8d796b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x410c=['remove','update','emit','removeListener','register','length','./smsQueue.events','save'];(function(_0x46c031,_0x24e83b){var _0x361950=function(_0x4a4860){while(--_0x4a4860){_0x46c031['push'](_0x46c031['shift']());}};_0x361950(++_0x24e83b);}(_0x410c,0x15e));var _0xc410=function(_0x14550d,_0x4b6af2){_0x14550d=_0x14550d-0x0;var _0x5d7471=_0x410c[_0x14550d];return _0x5d7471;};'use strict';var SmsQueueEvents=require(_0xc410('0x0'));var events=[_0xc410('0x1'),_0xc410('0x2'),_0xc410('0x3')];function createListener(_0x428d34,_0x56933c){return function(_0x3d94e9){_0x56933c[_0xc410('0x4')](_0x428d34,_0x3d94e9);};}function removeListener(_0x5c9b5a,_0x13929f){return function(){SmsQueueEvents[_0xc410('0x5')](_0x5c9b5a,_0x13929f);};}exports[_0xc410('0x6')]=function(_0x311d10){for(var _0x2a9f03=0x0,_0x1a339e=events[_0xc410('0x7')];_0x2a9f03<_0x1a339e;_0x2a9f03++){var _0x25eba9=events[_0x2a9f03];var _0x37da39=createListener('smsQueue:'+_0x25eba9,_0x311d10);SmsQueueEvents['on'](_0x25eba9,_0x37da39);}};
\ No newline at end of file
+var _0xdd73=['register','length','./smsQueue.events','remove','update','emit','removeListener'];(function(_0x3881ac,_0x2168d6){var _0x1d0e2f=function(_0x490b11){while(--_0x490b11){_0x3881ac['push'](_0x3881ac['shift']());}};_0x1d0e2f(++_0x2168d6);}(_0xdd73,0x18a));var _0x3dd7=function(_0x525245,_0x72bcfb){_0x525245=_0x525245-0x0;var _0x2ea70a=_0xdd73[_0x525245];return _0x2ea70a;};'use strict';var SmsQueueEvents=require(_0x3dd7('0x0'));var events=['save',_0x3dd7('0x1'),_0x3dd7('0x2')];function createListener(_0x2caef5,_0x692000){return function(_0x5db726){_0x692000[_0x3dd7('0x3')](_0x2caef5,_0x5db726);};}function removeListener(_0x3e352b,_0xe6d595){return function(){SmsQueueEvents[_0x3dd7('0x4')](_0x3e352b,_0xe6d595);};}exports[_0x3dd7('0x5')]=function(_0x335fec){for(var _0x370bba=0x0,_0x7fe53b=events[_0x3dd7('0x6')];_0x370bba<_0x7fe53b;_0x370bba++){var _0x1ac76e=events[_0x370bba];var _0x34ff47=createListener('smsQueue:'+_0x1ac76e,_0x335fec);SmsQueueEvents['on'](_0x1ac76e,_0x34ff47);}};
\ No newline at end of file
index fe68847..d338cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd76=['connect-timeout','express','fs-extra','../../components/interaction/service','./smsQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x20b9e2,_0x39cade){var _0x305fe2=function(_0x4b299d){while(--_0x4b299d){_0x20b9e2['push'](_0x20b9e2['shift']());}};_0x305fe2(++_0x39cade);}(_0xfd76,0x101));var _0x6fd7=function(_0x3280ab,_0x10c6a0){_0x3280ab=_0x3280ab-0x0;var _0x452713=_0xfd76[_0x3280ab];return _0x452713;};'use strict';var multer=require(_0x6fd7('0x0'));var util=require(_0x6fd7('0x1'));var path=require(_0x6fd7('0x2'));var timeout=require(_0x6fd7('0x3'));var express=require(_0x6fd7('0x4'));var router=express['Router']();var fs_extra=require(_0x6fd7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6fd7('0x6'));var config=require('../../config/environment');var controller=require(_0x6fd7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6fd7('0x8')]);router[_0x6fd7('0x9')](_0x6fd7('0xa'),auth[_0x6fd7('0xb')](),controller[_0x6fd7('0xc')]);router[_0x6fd7('0x9')](_0x6fd7('0xd'),auth[_0x6fd7('0xb')](),controller['show']);router['post']('/',auth[_0x6fd7('0xb')](),controller[_0x6fd7('0xe')]);router[_0x6fd7('0xf')](_0x6fd7('0xd'),auth[_0x6fd7('0xb')](),controller[_0x6fd7('0x10')]);router[_0x6fd7('0x11')](_0x6fd7('0xd'),auth['isAuthenticated'](),controller[_0x6fd7('0x12')]);module[_0x6fd7('0x13')]=router;
\ No newline at end of file
+var _0x6cae=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x2cd9a5,_0x5e0ab1){var _0x4d3663=function(_0x4e48ef){while(--_0x4e48ef){_0x2cd9a5['push'](_0x2cd9a5['shift']());}};_0x4d3663(++_0x5e0ab1);}(_0x6cae,0xf0));var _0xe6ca=function(_0x414ea0,_0x1addcf){_0x414ea0=_0x414ea0-0x0;var _0x31321b=_0x6cae[_0x414ea0];return _0x31321b;};'use strict';var multer=require(_0xe6ca('0x0'));var util=require(_0xe6ca('0x1'));var path=require('path');var timeout=require(_0xe6ca('0x2'));var express=require(_0xe6ca('0x3'));var router=express[_0xe6ca('0x4')]();var fs_extra=require(_0xe6ca('0x5'));var auth=require(_0xe6ca('0x6'));var interaction=require(_0xe6ca('0x7'));var config=require(_0xe6ca('0x8'));var controller=require('./smsQueueReport.controller');router[_0xe6ca('0x9')]('/',auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xb')]);router[_0xe6ca('0x9')](_0xe6ca('0xc'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xd')]);router[_0xe6ca('0x9')](_0xe6ca('0xe'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xf')]);router[_0xe6ca('0x10')]('/',auth['isAuthenticated'](),controller[_0xe6ca('0x11')]);router['put'](_0xe6ca('0xe'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x12')]);router[_0xe6ca('0x13')](_0xe6ca('0xe'),auth['isAuthenticated'](),controller[_0xe6ca('0x14')]);module[_0xe6ca('0x15')]=router;
\ No newline at end of file
index 93edc71..819c285 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x457e=['exports','STRING','DATE'];(function(_0x5aed6e,_0x3a602e){var _0x1837bc=function(_0x69d03e){while(--_0x69d03e){_0x5aed6e['push'](_0x5aed6e['shift']());}};_0x1837bc(++_0x3a602e);}(_0x457e,0x15f));var _0xe457=function(_0x7d06f8,_0x397d43){_0x7d06f8=_0x7d06f8-0x0;var _0x3f26e9=_0x457e[_0x7d06f8];return _0x3f26e9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe457('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe457('0x1')]},'joinAt':{'type':Sequelize[_0xe457('0x2')]},'leaveAt':{'type':Sequelize[_0xe457('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe457('0x2')]},'reason':{'type':Sequelize[_0xe457('0x1')]}};
\ No newline at end of file
+var _0xb905=['exports','STRING','DATE','moment'];(function(_0x59304d,_0x4e6935){var _0x4c0fd8=function(_0x56aa52){while(--_0x56aa52){_0x59304d['push'](_0x59304d['shift']());}};_0x4c0fd8(++_0x4e6935);}(_0xb905,0xa7));var _0x5b90=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xb905[_0x50a0c2];return _0x5ebadd;};'use strict';var moment=require(_0x5b90('0x0'));var Sequelize=require('sequelize');module[_0x5b90('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5b90('0x2')]},'joinAt':{'type':Sequelize[_0x5b90('0x3')]},'leaveAt':{'type':Sequelize[_0x5b90('0x3')]},'acceptAt':{'type':Sequelize[_0x5b90('0x3')]},'exitAt':{'type':Sequelize[_0x5b90('0x3')]},'reason':{'type':Sequelize[_0x5b90('0x2')]}};
\ No newline at end of file
index 4e1d7a2..7f73d34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f8=['nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','rows','show','params','merge','create','body','catch','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','destroy','then','error','name','index','map','SmsQueueReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x1f3e3f,_0x19cafc){var _0x4b72de=function(_0x3a74c6){while(--_0x3a74c6){_0x1f3e3f['push'](_0x1f3e3f['shift']());}};_0x4b72de(++_0x19cafc);}(_0x04f8,0x190));var _0x804f=function(_0x1dc62f,_0x57b1ff){_0x1dc62f=_0x1dc62f-0x0;var _0xddab41=_0x04f8[_0x1dc62f];return _0xddab41;};'use strict';var emlformat=require(_0x804f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x804f('0x1'));var jsonpatch=require(_0x804f('0x2'));var rp=require(_0x804f('0x3'));var moment=require(_0x804f('0x4'));var BPromise=require(_0x804f('0x5'));var Mustache=require(_0x804f('0x6'));var util=require(_0x804f('0x7'));var path=require(_0x804f('0x8'));var sox=require(_0x804f('0x9'));var csv=require('to-csv');var ejs=require(_0x804f('0xa'));var fs=require('fs');var fs_extra=require(_0x804f('0xb'));var _=require(_0x804f('0xc'));var squel=require(_0x804f('0xd'));var crypto=require(_0x804f('0xe'));var jsforce=require(_0x804f('0xf'));var deskjs=require(_0x804f('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x804f('0x11'));var authService=require(_0x804f('0x12'));var qs=require(_0x804f('0x13'));var as=require(_0x804f('0x14'));var hardwareService=require(_0x804f('0x15'));var logger=require(_0x804f('0x16'))(_0x804f('0x17'));var utils=require(_0x804f('0x18'));var config=require(_0x804f('0x19'));var licenseUtil=require(_0x804f('0x1a'));var db=require(_0x804f('0x1b'))['db'];function respondWithStatusCode(_0x3d45b7,_0x522b6b){_0x522b6b=_0x522b6b||0xcc;return function(_0x524783){if(_0x524783){return _0x3d45b7[_0x804f('0x1c')](_0x522b6b);}return _0x3d45b7[_0x804f('0x1d')](_0x522b6b)[_0x804f('0x1e')]();};}function respondWithResult(_0x38e632,_0x18a108){_0x18a108=_0x18a108||0xc8;return function(_0x3c29d9){if(_0x3c29d9){return _0x38e632[_0x804f('0x1d')](_0x18a108)[_0x804f('0x1f')](_0x3c29d9);}};}function respondWithFilteredResult(_0x1fa058,_0x19ae79){return function(_0x39e52e){if(_0x39e52e){var _0x3389cf=typeof _0x19ae79[_0x804f('0x20')]===_0x804f('0x21')&&typeof _0x19ae79[_0x804f('0x22')]===_0x804f('0x21');var _0x6dd6d=_0x39e52e[_0x804f('0x23')];var _0x2e2db8=_0x3389cf?0x0:_0x19ae79[_0x804f('0x20')];var _0x576795=_0x3389cf?_0x39e52e[_0x804f('0x23')]:_0x19ae79['offset']+_0x19ae79['limit'];var _0x1df8d2;if(_0x576795>=_0x6dd6d){_0x576795=_0x6dd6d;_0x1df8d2=0xc8;}else{_0x1df8d2=0xce;}_0x1fa058[_0x804f('0x1d')](_0x1df8d2);return _0x1fa058['set']('Content-Range',_0x2e2db8+'-'+_0x576795+'/'+_0x6dd6d)[_0x804f('0x1f')](_0x39e52e);}return null;};}function patchUpdates(_0x793e){return function(_0x96e3d){try{jsonpatch['apply'](_0x96e3d,_0x793e,!![]);}catch(_0x4c81c8){return BPromise[_0x804f('0x24')](_0x4c81c8);}return _0x96e3d['save']();};}function saveUpdates(_0x39eeae,_0x270069){return function(_0x3dbfd1){if(_0x3dbfd1){return _0x3dbfd1[_0x804f('0x25')](_0x39eeae)['then'](function(_0x271e89){return _0x271e89;});}return null;};}function removeEntity(_0x2ed7d0,_0x831db){return function(_0x1e7517){if(_0x1e7517){return _0x1e7517[_0x804f('0x26')]()[_0x804f('0x27')](function(){_0x2ed7d0[_0x804f('0x1d')](0xcc)[_0x804f('0x1e')]();});}};}function handleEntityNotFound(_0x54e6f5,_0x41cbcb){return function(_0x3a564d){if(!_0x3a564d){_0x54e6f5[_0x804f('0x1c')](0x194);}return _0x3a564d;};}function handleError(_0x1f7038,_0x3ab974){_0x3ab974=_0x3ab974||0x1f4;return function(_0x108d0c){logger[_0x804f('0x28')](_0x108d0c['stack']);if(_0x108d0c[_0x804f('0x29')]){delete _0x108d0c['name'];}_0x1f7038['status'](_0x3ab974)['send'](_0x108d0c);};}exports[_0x804f('0x2a')]=function(_0x3ce29c,_0x53c8e4){var _0x20d255={},_0x25e9a8={},_0x476050={'count':0x0,'rows':[]};var _0x45ca0a=_[_0x804f('0x2b')](db[_0x804f('0x2c')]['rawAttributes'],function(_0x38eac3){return{'name':_0x38eac3[_0x804f('0x2d')],'type':_0x38eac3[_0x804f('0x2e')][_0x804f('0x2f')]};});_0x25e9a8[_0x804f('0x30')]=_[_0x804f('0x2b')](_0x45ca0a,'name');_0x25e9a8[_0x804f('0x31')]=_[_0x804f('0x32')](_0x3ce29c[_0x804f('0x31')]);_0x25e9a8['filters']=_[_0x804f('0x33')](_0x25e9a8['model'],_0x25e9a8[_0x804f('0x31')]);_0x20d255['attributes']=_['intersection'](_0x25e9a8[_0x804f('0x30')],qs[_0x804f('0x34')](_0x3ce29c[_0x804f('0x31')]['fields']));_0x20d255[_0x804f('0x35')]=_0x20d255['attributes'][_0x804f('0x36')]?_0x20d255[_0x804f('0x35')]:_0x25e9a8[_0x804f('0x30')];if(!_0x3ce29c[_0x804f('0x31')][_0x804f('0x37')](_0x804f('0x38'))){_0x20d255['limit']=qs[_0x804f('0x22')](_0x3ce29c[_0x804f('0x31')][_0x804f('0x22')]);_0x20d255[_0x804f('0x20')]=qs[_0x804f('0x20')](_0x3ce29c[_0x804f('0x31')]['offset']);}_0x20d255[_0x804f('0x39')]=qs['sort'](_0x3ce29c['query'][_0x804f('0x3a')]);_0x20d255[_0x804f('0x3b')]=qs['filters'](_[_0x804f('0x3c')](_0x3ce29c[_0x804f('0x31')],_0x25e9a8[_0x804f('0x3d')]),_0x45ca0a);if(_0x3ce29c[_0x804f('0x31')][_0x804f('0x3e')]){_0x20d255[_0x804f('0x3b')]=_['merge'](_0x20d255['where'],{'$or':_[_0x804f('0x2b')](_0x45ca0a,function(_0x56e693){if(_0x56e693[_0x804f('0x2e')]!==_0x804f('0x3f')){var _0x1a88c8={};_0x1a88c8[_0x56e693[_0x804f('0x29')]]={'$like':'%'+_0x3ce29c[_0x804f('0x31')][_0x804f('0x3e')]+'%'};return _0x1a88c8;}})});}_0x20d255=_['merge']({},_0x20d255,_0x3ce29c[_0x804f('0x40')]);var _0x224f93={'where':_0x20d255['where']};return db[_0x804f('0x2c')]['count'](_0x224f93)[_0x804f('0x27')](function(_0x5712f4){_0x476050[_0x804f('0x23')]=_0x5712f4;if(_0x3ce29c[_0x804f('0x31')][_0x804f('0x41')]){_0x20d255[_0x804f('0x42')]=[{'all':!![]}];}return db[_0x804f('0x2c')]['findAll'](_0x20d255);})[_0x804f('0x27')](function(_0x4f17ca){_0x476050[_0x804f('0x43')]=_0x4f17ca;return _0x476050;})[_0x804f('0x27')](respondWithFilteredResult(_0x53c8e4,_0x20d255))['catch'](handleError(_0x53c8e4,null));};exports[_0x804f('0x44')]=function(_0x155e8d,_0x447467){var _0x297131={'raw':!![],'where':{'id':_0x155e8d[_0x804f('0x45')]['id']}},_0x15f678={};_0x15f678[_0x804f('0x30')]=_[_0x804f('0x32')](db[_0x804f('0x2c')]['rawAttributes']);_0x15f678[_0x804f('0x31')]=_[_0x804f('0x32')](_0x155e8d[_0x804f('0x31')]);_0x15f678[_0x804f('0x3d')]=_[_0x804f('0x33')](_0x15f678[_0x804f('0x30')],_0x15f678[_0x804f('0x31')]);_0x297131[_0x804f('0x35')]=_[_0x804f('0x33')](_0x15f678[_0x804f('0x30')],qs[_0x804f('0x34')](_0x155e8d['query'][_0x804f('0x34')]));_0x297131[_0x804f('0x35')]=_0x297131[_0x804f('0x35')][_0x804f('0x36')]?_0x297131['attributes']:_0x15f678[_0x804f('0x30')];if(_0x155e8d[_0x804f('0x31')][_0x804f('0x41')]){_0x297131[_0x804f('0x42')]=[{'all':!![]}];}_0x297131=_[_0x804f('0x46')]({},_0x297131,_0x155e8d[_0x804f('0x40')]);return db[_0x804f('0x2c')]['find'](_0x297131)['then'](handleEntityNotFound(_0x447467,null))['then'](respondWithResult(_0x447467,null))['catch'](handleError(_0x447467,null));};exports[_0x804f('0x47')]=function(_0xd4cb3f,_0x5362ce){return db[_0x804f('0x2c')][_0x804f('0x47')](_0xd4cb3f[_0x804f('0x48')],{})['then'](respondWithResult(_0x5362ce,0xc9))[_0x804f('0x49')](handleError(_0x5362ce,null));};exports[_0x804f('0x25')]=function(_0x38019f,_0x866624){if(_0x38019f[_0x804f('0x48')]['id']){delete _0x38019f[_0x804f('0x48')]['id'];}return db[_0x804f('0x2c')][_0x804f('0x4a')]({'where':{'id':_0x38019f[_0x804f('0x45')]['id']}})[_0x804f('0x27')](handleEntityNotFound(_0x866624,null))[_0x804f('0x27')](saveUpdates(_0x38019f['body'],null))[_0x804f('0x27')](respondWithResult(_0x866624,null))[_0x804f('0x49')](handleError(_0x866624,null));};exports[_0x804f('0x26')]=function(_0x2041af,_0x4b18aa){return db[_0x804f('0x2c')][_0x804f('0x4a')]({'where':{'id':_0x2041af[_0x804f('0x45')]['id']}})[_0x804f('0x27')](handleEntityNotFound(_0x4b18aa,null))[_0x804f('0x27')](removeEntity(_0x4b18aa,null))[_0x804f('0x49')](handleError(_0x4b18aa,null));};exports[_0x804f('0x4b')]=function(_0xa29700,_0x15e1ed){return db[_0x804f('0x2c')][_0x804f('0x4b')]()['then'](respondWithResult(_0x15e1ed,null))[_0x804f('0x49')](handleError(_0x15e1ed,null));};
\ No newline at end of file
+var _0x2558=['to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','where','filter','merge','options','SmsQueueReport','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x21bacc,_0x5b751d){var _0x30b007=function(_0x202abe){while(--_0x202abe){_0x21bacc['push'](_0x21bacc['shift']());}};_0x30b007(++_0x5b751d);}(_0x2558,0x11c));var _0x8255=function(_0x79975,_0x241aa1){_0x79975=_0x79975-0x0;var _0x2e4481=_0x2558[_0x79975];return _0x2e4481;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8255('0x0'));var zipdir=require(_0x8255('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8255('0x2'));var moment=require(_0x8255('0x3'));var BPromise=require(_0x8255('0x4'));var Mustache=require(_0x8255('0x5'));var util=require(_0x8255('0x6'));var path=require(_0x8255('0x7'));var sox=require('sox');var csv=require(_0x8255('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8255('0x9'));var squel=require(_0x8255('0xa'));var crypto=require('crypto');var jsforce=require(_0x8255('0xb'));var deskjs=require(_0x8255('0xc'));var toCsv=require(_0x8255('0x8'));var querystring=require(_0x8255('0xd'));var Papa=require('papaparse');var Redis=require(_0x8255('0xe'));var authService=require(_0x8255('0xf'));var qs=require(_0x8255('0x10'));var as=require(_0x8255('0x11'));var hardwareService=require(_0x8255('0x12'));var logger=require('../../config/logger')(_0x8255('0x13'));var utils=require('../../config/utils');var config=require(_0x8255('0x14'));var licenseUtil=require(_0x8255('0x15'));var db=require(_0x8255('0x16'))['db'];function respondWithStatusCode(_0x5bb496,_0x4eb826){_0x4eb826=_0x4eb826||0xcc;return function(_0x1cc265){if(_0x1cc265){return _0x5bb496[_0x8255('0x17')](_0x4eb826);}return _0x5bb496[_0x8255('0x18')](_0x4eb826)['end']();};}function respondWithResult(_0x538aaf,_0x3e92ab){_0x3e92ab=_0x3e92ab||0xc8;return function(_0xc34cc4){if(_0xc34cc4){return _0x538aaf[_0x8255('0x18')](_0x3e92ab)[_0x8255('0x19')](_0xc34cc4);}};}function respondWithFilteredResult(_0x3e2fbd,_0x2f71d7){return function(_0x3dcd42){if(_0x3dcd42){var _0x22369a=typeof _0x2f71d7[_0x8255('0x1a')]===_0x8255('0x1b')&&typeof _0x2f71d7['limit']===_0x8255('0x1b');var _0x58c79a=_0x3dcd42['count'];var _0x1ff3c6=_0x22369a?0x0:_0x2f71d7[_0x8255('0x1a')];var _0x41d566=_0x22369a?_0x3dcd42['count']:_0x2f71d7[_0x8255('0x1a')]+_0x2f71d7[_0x8255('0x1c')];var _0x317767;if(_0x41d566>=_0x58c79a){_0x41d566=_0x58c79a;_0x317767=0xc8;}else{_0x317767=0xce;}_0x3e2fbd[_0x8255('0x18')](_0x317767);return _0x3e2fbd[_0x8255('0x1d')]('Content-Range',_0x1ff3c6+'-'+_0x41d566+'/'+_0x58c79a)[_0x8255('0x19')](_0x3dcd42);}return null;};}function patchUpdates(_0x18e39e){return function(_0x3019ca){try{jsonpatch['apply'](_0x3019ca,_0x18e39e,!![]);}catch(_0x475aa5){return BPromise['reject'](_0x475aa5);}return _0x3019ca[_0x8255('0x1e')]();};}function saveUpdates(_0x6c583e,_0xceb560){return function(_0x4680e8){if(_0x4680e8){return _0x4680e8[_0x8255('0x1f')](_0x6c583e)[_0x8255('0x20')](function(_0x54c12a){return _0x54c12a;});}return null;};}function removeEntity(_0x170275,_0x466035){return function(_0x4b44a0){if(_0x4b44a0){return _0x4b44a0[_0x8255('0x21')]()[_0x8255('0x20')](function(){_0x170275['status'](0xcc)[_0x8255('0x22')]();});}};}function handleEntityNotFound(_0x1772dd,_0x5e2bfa){return function(_0x36a51a){if(!_0x36a51a){_0x1772dd[_0x8255('0x17')](0x194);}return _0x36a51a;};}function handleError(_0x28cadf,_0x4f2b94){_0x4f2b94=_0x4f2b94||0x1f4;return function(_0x327833){logger[_0x8255('0x23')](_0x327833[_0x8255('0x24')]);if(_0x327833[_0x8255('0x25')]){delete _0x327833['name'];}_0x28cadf[_0x8255('0x18')](_0x4f2b94)[_0x8255('0x26')](_0x327833);};}exports[_0x8255('0x27')]=function(_0x349370,_0x3fea3e){var _0x10f786={},_0x148bcc={},_0x4fb280={'count':0x0,'rows':[]};var _0x5f269f=_[_0x8255('0x28')](db['SmsQueueReport'][_0x8255('0x29')],function(_0x2201d5){return{'name':_0x2201d5['fieldName'],'type':_0x2201d5[_0x8255('0x2a')][_0x8255('0x2b')]};});_0x148bcc[_0x8255('0x2c')]=_[_0x8255('0x28')](_0x5f269f,_0x8255('0x25'));_0x148bcc['query']=_[_0x8255('0x2d')](_0x349370[_0x8255('0x2e')]);_0x148bcc[_0x8255('0x2f')]=_['intersection'](_0x148bcc[_0x8255('0x2c')],_0x148bcc[_0x8255('0x2e')]);_0x10f786['attributes']=_[_0x8255('0x30')](_0x148bcc[_0x8255('0x2c')],qs[_0x8255('0x31')](_0x349370[_0x8255('0x2e')][_0x8255('0x31')]));_0x10f786[_0x8255('0x32')]=_0x10f786['attributes']['length']?_0x10f786[_0x8255('0x32')]:_0x148bcc[_0x8255('0x2c')];if(!_0x349370[_0x8255('0x2e')]['hasOwnProperty'](_0x8255('0x33'))){_0x10f786[_0x8255('0x1c')]=qs[_0x8255('0x1c')](_0x349370[_0x8255('0x2e')]['limit']);_0x10f786['offset']=qs[_0x8255('0x1a')](_0x349370[_0x8255('0x2e')][_0x8255('0x1a')]);}_0x10f786[_0x8255('0x34')]=qs['sort'](_0x349370[_0x8255('0x2e')][_0x8255('0x35')]);_0x10f786['where']=qs['filters'](_[_0x8255('0x36')](_0x349370['query'],_0x148bcc[_0x8255('0x2f')]),_0x5f269f);if(_0x349370[_0x8255('0x2e')]['filter']){_0x10f786[_0x8255('0x37')]=_['merge'](_0x10f786[_0x8255('0x37')],{'$or':_['map'](_0x5f269f,function(_0x376769){if(_0x376769[_0x8255('0x2a')]!=='VIRTUAL'){var _0x153206={};_0x153206[_0x376769[_0x8255('0x25')]]={'$like':'%'+_0x349370[_0x8255('0x2e')][_0x8255('0x38')]+'%'};return _0x153206;}})});}_0x10f786=_[_0x8255('0x39')]({},_0x10f786,_0x349370[_0x8255('0x3a')]);var _0x54ccab={'where':_0x10f786[_0x8255('0x37')]};return db[_0x8255('0x3b')][_0x8255('0x3c')](_0x54ccab)[_0x8255('0x20')](function(_0x3c4e71){_0x4fb280[_0x8255('0x3c')]=_0x3c4e71;if(_0x349370[_0x8255('0x2e')][_0x8255('0x3d')]){_0x10f786[_0x8255('0x3e')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x8255('0x3f')](_0x10f786);})['then'](function(_0x122846){_0x4fb280[_0x8255('0x40')]=_0x122846;return _0x4fb280;})[_0x8255('0x20')](respondWithFilteredResult(_0x3fea3e,_0x10f786))[_0x8255('0x41')](handleError(_0x3fea3e,null));};exports[_0x8255('0x42')]=function(_0x4e7820,_0x1fbea3){var _0x16ed71={'raw':!![],'where':{'id':_0x4e7820[_0x8255('0x43')]['id']}},_0x34c480={};_0x34c480[_0x8255('0x2c')]=_[_0x8255('0x2d')](db[_0x8255('0x3b')]['rawAttributes']);_0x34c480['query']=_[_0x8255('0x2d')](_0x4e7820[_0x8255('0x2e')]);_0x34c480[_0x8255('0x2f')]=_[_0x8255('0x30')](_0x34c480['model'],_0x34c480['query']);_0x16ed71[_0x8255('0x32')]=_[_0x8255('0x30')](_0x34c480[_0x8255('0x2c')],qs['fields'](_0x4e7820['query'][_0x8255('0x31')]));_0x16ed71[_0x8255('0x32')]=_0x16ed71[_0x8255('0x32')][_0x8255('0x44')]?_0x16ed71['attributes']:_0x34c480[_0x8255('0x2c')];if(_0x4e7820['query'][_0x8255('0x3d')]){_0x16ed71[_0x8255('0x3e')]=[{'all':!![]}];}_0x16ed71=_[_0x8255('0x39')]({},_0x16ed71,_0x4e7820[_0x8255('0x3a')]);return db['SmsQueueReport'][_0x8255('0x45')](_0x16ed71)['then'](handleEntityNotFound(_0x1fbea3,null))[_0x8255('0x20')](respondWithResult(_0x1fbea3,null))[_0x8255('0x41')](handleError(_0x1fbea3,null));};exports[_0x8255('0x46')]=function(_0x489bd8,_0x199d95){return db[_0x8255('0x3b')][_0x8255('0x46')](_0x489bd8[_0x8255('0x47')],{})[_0x8255('0x20')](respondWithResult(_0x199d95,0xc9))[_0x8255('0x41')](handleError(_0x199d95,null));};exports[_0x8255('0x1f')]=function(_0x4713f6,_0x3174ec){if(_0x4713f6[_0x8255('0x47')]['id']){delete _0x4713f6['body']['id'];}return db['SmsQueueReport'][_0x8255('0x45')]({'where':{'id':_0x4713f6[_0x8255('0x43')]['id']}})[_0x8255('0x20')](handleEntityNotFound(_0x3174ec,null))[_0x8255('0x20')](saveUpdates(_0x4713f6[_0x8255('0x47')],null))[_0x8255('0x20')](respondWithResult(_0x3174ec,null))[_0x8255('0x41')](handleError(_0x3174ec,null));};exports[_0x8255('0x21')]=function(_0x56eed7,_0x54f4f1){return db['SmsQueueReport']['find']({'where':{'id':_0x56eed7[_0x8255('0x43')]['id']}})['then'](handleEntityNotFound(_0x54f4f1,null))[_0x8255('0x20')](removeEntity(_0x54f4f1,null))[_0x8255('0x41')](handleError(_0x54f4f1,null));};exports[_0x8255('0x48')]=function(_0x2b6a94,_0x138266){return db[_0x8255('0x3b')][_0x8255('0x48')]()[_0x8255('0x20')](respondWithResult(_0x138266,null))[_0x8255('0x41')](handleError(_0x138266,null));};
\ No newline at end of file
index 66b6d46..01380b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x2ec8b7,_0x53d34f){var _0x1c4951=function(_0x3bfdf6){while(--_0x3bfdf6){_0x2ec8b7['push'](_0x2ec8b7['shift']());}};_0x1c4951(++_0x53d34f);}(_0x70e0,0x17b));var _0x070e=function(_0x1280f7,_0x5b086f){_0x1280f7=_0x1280f7-0x0;var _0xdf5299=_0x70e0[_0x1280f7];return _0xdf5299;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_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 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
index 90b87dc..d6afb05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x285f=['catch','UpdateSmsQueueReport','update','body','where','attributes','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','debug'];(function(_0x1761f8,_0x507375){var _0x110b60=function(_0x1a687f){while(--_0x1a687f){_0x1761f8['push'](_0x1761f8['shift']());}};_0x110b60(++_0x507375);}(_0x285f,0x1b8));var _0xf285=function(_0xbad6eb,_0x3dbd6f){_0xbad6eb=_0xbad6eb-0x0;var _0x1e3e8f=_0x285f[_0xbad6eb];return _0x1e3e8f;};'use strict';var _=require(_0xf285('0x0'));var util=require(_0xf285('0x1'));var moment=require('moment');var BPromise=require(_0xf285('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf285('0x3'))['db'];var utils=require(_0xf285('0x4'));var logger=require('../../config/logger')(_0xf285('0x5'));var config=require(_0xf285('0x6'));var jayson=require(_0xf285('0x7'));var client=jayson[_0xf285('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x110c3a,_0x5934cf,_0x2d1a5d){return new BPromise(function(_0xd884be,_0x434cf9){return client[_0xf285('0x9')](_0x110c3a,_0x2d1a5d)['then'](function(_0x1e155c){logger[_0xf285('0xa')](_0xf285('0xb'),_0x5934cf,_0xf285('0xc'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5934cf,_0xf285('0xc'),JSON[_0xf285('0xd')](_0x1e155c));if(_0x1e155c[_0xf285('0xe')]){if(_0x1e155c[_0xf285('0xe')][_0xf285('0xf')]===0x1f4){logger[_0xf285('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x5934cf,_0x1e155c['error'][_0xf285('0x10')]);return _0x434cf9(_0x1e155c[_0xf285('0xe')][_0xf285('0x10')]);}logger['error'](_0xf285('0xb'),_0x5934cf,_0x1e155c['error'][_0xf285('0x10')]);return _0xd884be(_0x1e155c['error']['message']);}else{logger[_0xf285('0xa')](_0xf285('0xb'),_0x5934cf,'request\x20sent');_0xd884be(_0x1e155c[_0xf285('0x11')][_0xf285('0x10')]);}})['catch'](function(_0x58eeaf){logger[_0xf285('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x5934cf,_0x58eeaf);_0x434cf9(_0x58eeaf);});});}exports[_0xf285('0x12')]=function(_0x3fdd89){var _0x19edaa=this;return new Promise(function(_0x2658a7,_0x16402b){return db[_0xf285('0x13')][_0xf285('0x14')](_0x3fdd89['body'],{'raw':_0x3fdd89[_0xf285('0x15')]?_0x3fdd89[_0xf285('0x15')][_0xf285('0x16')]===undefined?!![]:![]:!![]})[_0xf285('0x17')](function(_0x2769e7){logger[_0xf285('0xa')](_0xf285('0x12'),_0x3fdd89);logger[_0xf285('0x18')](_0xf285('0x12'),_0x3fdd89,JSON['stringify'](_0x2769e7));_0x2658a7(_0x2769e7);})[_0xf285('0x19')](function(_0x37db3b){logger[_0xf285('0xe')](_0xf285('0x12'),_0x37db3b[_0xf285('0x10')],_0x3fdd89);_0x16402b(_0x19edaa[_0xf285('0xe')](0x1f4,_0x37db3b['message']));});});};exports[_0xf285('0x1a')]=function(_0x13ee8f){var _0x254025=this;return new Promise(function(_0x2446d5,_0x2bf5c5){return db[_0xf285('0x13')][_0xf285('0x1b')](_0x13ee8f[_0xf285('0x1c')],{'raw':_0x13ee8f[_0xf285('0x15')]?_0x13ee8f[_0xf285('0x15')][_0xf285('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13ee8f[_0xf285('0x15')]?_0x13ee8f['options'][_0xf285('0x1d')]||null:null,'attributes':_0x13ee8f['options']?_0x13ee8f[_0xf285('0x15')][_0xf285('0x1e')]||null:null,'limit':_0x13ee8f[_0xf285('0x15')]?_0x13ee8f[_0xf285('0x15')]['limit']||null:null})['then'](function(_0x4df148){logger[_0xf285('0xa')](_0xf285('0x1a'),_0x13ee8f);logger[_0xf285('0x18')]('UpdateSmsQueueReport',_0x13ee8f,JSON[_0xf285('0xd')](_0x4df148));_0x2446d5(_0x4df148);})[_0xf285('0x19')](function(_0x1b5964){logger[_0xf285('0xe')](_0xf285('0x1a'),_0x1b5964['message'],_0x13ee8f);_0x2bf5c5(_0x254025[_0xf285('0xe')](0x1f4,_0x1b5964[_0xf285('0x10')]));});});};
\ No newline at end of file
+var _0xa2e2=['message','result','catch','SmsQueueReport','create','body','options','raw','then','CreateSmsQueueReport','UpdateSmsQueueReport','where','attributes','limit','stringify','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','info','debug','request\x20sent','error','code','SmsQueueReport,\x20%s,\x20%s'];(function(_0x45d607,_0x3a43eb){var _0x570d90=function(_0x15c33b){while(--_0x15c33b){_0x45d607['push'](_0x45d607['shift']());}};_0x570d90(++_0x3a43eb);}(_0xa2e2,0x177));var _0x2a2e=function(_0x3482d4,_0x296dae){_0x3482d4=_0x3482d4-0x0;var _0x50d9ba=_0xa2e2[_0x3482d4];return _0x50d9ba;};'use strict';var _=require('lodash');var util=require(_0x2a2e('0x0'));var moment=require('moment');var BPromise=require(_0x2a2e('0x1'));var rs=require(_0x2a2e('0x2'));var fs=require('fs');var Redis=require(_0x2a2e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a2e('0x4'));var config=require(_0x2a2e('0x5'));var jayson=require(_0x2a2e('0x6'));var client=jayson['client'][_0x2a2e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x240a1f,_0x468a19,_0x2c0f48){return new BPromise(function(_0x4c0aef,_0x3b3e6c){return client[_0x2a2e('0x8')](_0x240a1f,_0x2c0f48)['then'](function(_0x1c9275){logger[_0x2a2e('0x9')]('SmsQueueReport,\x20%s,\x20%s',_0x468a19,'request\x20sent');logger[_0x2a2e('0xa')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x468a19,_0x2a2e('0xb'),JSON['stringify'](_0x1c9275));if(_0x1c9275['error']){if(_0x1c9275[_0x2a2e('0xc')][_0x2a2e('0xd')]===0x1f4){logger[_0x2a2e('0xc')](_0x2a2e('0xe'),_0x468a19,_0x1c9275[_0x2a2e('0xc')][_0x2a2e('0xf')]);return _0x3b3e6c(_0x1c9275['error']['message']);}logger[_0x2a2e('0xc')](_0x2a2e('0xe'),_0x468a19,_0x1c9275[_0x2a2e('0xc')][_0x2a2e('0xf')]);return _0x4c0aef(_0x1c9275[_0x2a2e('0xc')][_0x2a2e('0xf')]);}else{logger[_0x2a2e('0x9')](_0x2a2e('0xe'),_0x468a19,_0x2a2e('0xb'));_0x4c0aef(_0x1c9275[_0x2a2e('0x10')][_0x2a2e('0xf')]);}})[_0x2a2e('0x11')](function(_0x2a6365){logger[_0x2a2e('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x468a19,_0x2a6365);_0x3b3e6c(_0x2a6365);});});}exports['CreateSmsQueueReport']=function(_0x51c261){var _0x4bfb02=this;return new Promise(function(_0xca4676,_0x404803){return db[_0x2a2e('0x12')][_0x2a2e('0x13')](_0x51c261[_0x2a2e('0x14')],{'raw':_0x51c261['options']?_0x51c261[_0x2a2e('0x15')][_0x2a2e('0x16')]===undefined?!![]:![]:!![]})[_0x2a2e('0x17')](function(_0x42183c){logger['info'](_0x2a2e('0x18'),_0x51c261);logger[_0x2a2e('0xa')](_0x2a2e('0x18'),_0x51c261,JSON['stringify'](_0x42183c));_0xca4676(_0x42183c);})[_0x2a2e('0x11')](function(_0x27a0f8){logger['error']('CreateSmsQueueReport',_0x27a0f8['message'],_0x51c261);_0x404803(_0x4bfb02[_0x2a2e('0xc')](0x1f4,_0x27a0f8[_0x2a2e('0xf')]));});});};exports[_0x2a2e('0x19')]=function(_0x4cadba){var _0x346604=this;return new Promise(function(_0x247320,_0xf8e814){return db[_0x2a2e('0x12')]['update'](_0x4cadba[_0x2a2e('0x14')],{'raw':_0x4cadba['options']?_0x4cadba['options'][_0x2a2e('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cadba[_0x2a2e('0x15')]?_0x4cadba[_0x2a2e('0x15')][_0x2a2e('0x1a')]||null:null,'attributes':_0x4cadba[_0x2a2e('0x15')]?_0x4cadba[_0x2a2e('0x15')][_0x2a2e('0x1b')]||null:null,'limit':_0x4cadba[_0x2a2e('0x15')]?_0x4cadba[_0x2a2e('0x15')][_0x2a2e('0x1c')]||null:null})[_0x2a2e('0x17')](function(_0x230b44){logger[_0x2a2e('0x9')](_0x2a2e('0x19'),_0x4cadba);logger[_0x2a2e('0xa')](_0x2a2e('0x19'),_0x4cadba,JSON[_0x2a2e('0x1d')](_0x230b44));_0x247320(_0x230b44);})['catch'](function(_0x245f51){logger[_0x2a2e('0xc')]('UpdateSmsQueueReport',_0x245f51[_0x2a2e('0xf')],_0x4cadba);_0xf8e814(_0x346604[_0x2a2e('0xc')](0x1f4,_0x245f51[_0x2a2e('0xf')]));});});};
\ No newline at end of file
index 863e05e..8df4c08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x938d=['Router','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4ecd9a,_0x5b6a13){var _0x5926ec=function(_0xf24b0c){while(--_0xf24b0c){_0x4ecd9a['push'](_0x4ecd9a['shift']());}};_0x5926ec(++_0x5b6a13);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd938('0x0'));var util=require(_0xd938('0x1'));var path=require('path');var timeout=require(_0xd938('0x2'));var express=require(_0xd938('0x3'));var router=express[_0xd938('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd938('0x5'));var config=require(_0xd938('0x6'));var controller=require(_0xd938('0x7'));router['get']('/',auth[_0xd938('0x8')](),controller[_0xd938('0x9')]);router[_0xd938('0xa')](_0xd938('0xb'),auth[_0xd938('0x8')](),controller[_0xd938('0xc')]);router['get'](_0xd938('0xd'),auth[_0xd938('0x8')](),controller[_0xd938('0xe')]);router[_0xd938('0xf')]('/',auth[_0xd938('0x8')](),controller[_0xd938('0x10')]);router['put'](_0xd938('0xd'),auth[_0xd938('0x8')](),controller[_0xd938('0x11')]);router[_0xd938('0x12')](_0xd938('0xd'),auth[_0xd938('0x8')](),controller[_0xd938('0x13')]);module[_0xd938('0x14')]=router;
\ No newline at end of file
+var _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x4b33d1,_0x2414e1){var _0x9e7221=function(_0x476ecc){while(--_0x476ecc){_0x4b33d1['push'](_0x4b33d1['shift']());}};_0x9e7221(++_0x2414e1);}(_0xf006,0x146));var _0x6f00=function(_0x1112bc,_0x2841cc){_0x1112bc=_0x1112bc-0x0;var _0xdb16b5=_0xf006[_0x1112bc];return _0xdb16b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=router;
\ No newline at end of file
index 71ff2d9..47410e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3437a2,_0x4aa5ec){var _0x38ec72=function(_0x39009b){while(--_0x39009b){_0x3437a2['push'](_0x3437a2['shift']());}};_0x38ec72(++_0x4aa5ec);}(_0x54ef,0x112));var _0xf54e=function(_0x11ac3c,_0x32e209){_0x11ac3c=_0x11ac3c-0x0;var _0x483cf0=_0x54ef[_0x11ac3c];return _0x483cf0;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x213150,_0x19a5d4){var _0x3fe429=function(_0x4c2b62){while(--_0x4c2b62){_0x213150['push'](_0x213150['shift']());}};_0x3fe429(++_0x19a5d4);}(_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 ca4352e..bcbf679 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac9=['where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','merge','find','create','body','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3ee689,_0x44179c){var _0x494300=function(_0x3fe707){while(--_0x3fe707){_0x3ee689['push'](_0x3ee689['shift']());}};_0x494300(++_0x44179c);}(_0xdac9,0x18b));var _0x9dac=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xdac9[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0x9dac('0x0'));var rimraf=require(_0x9dac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dac('0x2'));var rp=require(_0x9dac('0x3'));var moment=require(_0x9dac('0x4'));var BPromise=require(_0x9dac('0x5'));var Mustache=require(_0x9dac('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9dac('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9dac('0x8'));var squel=require(_0x9dac('0x9'));var crypto=require(_0x9dac('0xa'));var jsforce=require(_0x9dac('0xb'));var deskjs=require(_0x9dac('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9dac('0xd'));var Papa=require('papaparse');var Redis=require(_0x9dac('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9dac('0xf'));var hardwareService=require(_0x9dac('0x10'));var logger=require(_0x9dac('0x11'))('api');var utils=require(_0x9dac('0x12'));var config=require(_0x9dac('0x13'));var licenseUtil=require(_0x9dac('0x14'));var db=require(_0x9dac('0x15'))['db'];function respondWithStatusCode(_0x3be478,_0x2d5be1){_0x2d5be1=_0x2d5be1||0xcc;return function(_0x21e8fc){if(_0x21e8fc){return _0x3be478[_0x9dac('0x16')](_0x2d5be1);}return _0x3be478[_0x9dac('0x17')](_0x2d5be1)[_0x9dac('0x18')]();};}function respondWithResult(_0x19b3e4,_0x30ccf1){_0x30ccf1=_0x30ccf1||0xc8;return function(_0x310eb4){if(_0x310eb4){return _0x19b3e4[_0x9dac('0x17')](_0x30ccf1)[_0x9dac('0x19')](_0x310eb4);}};}function respondWithFilteredResult(_0x4ac516,_0x3e1c46){return function(_0x4327f7){if(_0x4327f7){var _0x1b8714=typeof _0x3e1c46[_0x9dac('0x1a')]===_0x9dac('0x1b')&&typeof _0x3e1c46['limit']===_0x9dac('0x1b');var _0x1d2836=_0x4327f7[_0x9dac('0x1c')];var _0x2a8906=_0x1b8714?0x0:_0x3e1c46[_0x9dac('0x1a')];var _0x57ff0a=_0x1b8714?_0x4327f7[_0x9dac('0x1c')]:_0x3e1c46[_0x9dac('0x1a')]+_0x3e1c46[_0x9dac('0x1d')];var _0x1931a0;if(_0x57ff0a>=_0x1d2836){_0x57ff0a=_0x1d2836;_0x1931a0=0xc8;}else{_0x1931a0=0xce;}_0x4ac516[_0x9dac('0x17')](_0x1931a0);return _0x4ac516['set'](_0x9dac('0x1e'),_0x2a8906+'-'+_0x57ff0a+'/'+_0x1d2836)[_0x9dac('0x19')](_0x4327f7);}return null;};}function patchUpdates(_0x42a086){return function(_0x4d8a58){try{jsonpatch[_0x9dac('0x1f')](_0x4d8a58,_0x42a086,!![]);}catch(_0x1c0b4a){return BPromise['reject'](_0x1c0b4a);}return _0x4d8a58[_0x9dac('0x20')]();};}function saveUpdates(_0xa88826,_0x37fde9){return function(_0x480839){if(_0x480839){return _0x480839[_0x9dac('0x21')](_0xa88826)[_0x9dac('0x22')](function(_0x111a2e){return _0x111a2e;});}return null;};}function removeEntity(_0x4c16b6,_0x53d8f1){return function(_0x190e33){if(_0x190e33){return _0x190e33[_0x9dac('0x23')]()[_0x9dac('0x22')](function(){_0x4c16b6[_0x9dac('0x17')](0xcc)[_0x9dac('0x18')]();});}};}function handleEntityNotFound(_0x420329,_0x24b10f){return function(_0x407006){if(!_0x407006){_0x420329[_0x9dac('0x16')](0x194);}return _0x407006;};}function handleError(_0x3d098a,_0x308cba){_0x308cba=_0x308cba||0x1f4;return function(_0x16b9b8){logger[_0x9dac('0x24')](_0x16b9b8['stack']);if(_0x16b9b8[_0x9dac('0x25')]){delete _0x16b9b8[_0x9dac('0x25')];}_0x3d098a['status'](_0x308cba)[_0x9dac('0x26')](_0x16b9b8);};}exports[_0x9dac('0x27')]=function(_0x3d3bcc,_0x50fdb8){var _0x1b1b54={},_0xba7b25={},_0x37750a={'count':0x0,'rows':[]};var _0x2f7b14=_[_0x9dac('0x28')](db[_0x9dac('0x29')]['rawAttributes'],function(_0x59ad07){return{'name':_0x59ad07[_0x9dac('0x2a')],'type':_0x59ad07[_0x9dac('0x2b')][_0x9dac('0x2c')]};});_0xba7b25[_0x9dac('0x2d')]=_[_0x9dac('0x28')](_0x2f7b14,'name');_0xba7b25[_0x9dac('0x2e')]=_['keys'](_0x3d3bcc['query']);_0xba7b25['filters']=_[_0x9dac('0x2f')](_0xba7b25[_0x9dac('0x2d')],_0xba7b25['query']);_0x1b1b54[_0x9dac('0x30')]=_['intersection'](_0xba7b25['model'],qs[_0x9dac('0x31')](_0x3d3bcc[_0x9dac('0x2e')][_0x9dac('0x31')]));_0x1b1b54[_0x9dac('0x30')]=_0x1b1b54[_0x9dac('0x30')][_0x9dac('0x32')]?_0x1b1b54[_0x9dac('0x30')]:_0xba7b25['model'];if(!_0x3d3bcc[_0x9dac('0x2e')][_0x9dac('0x33')](_0x9dac('0x34'))){_0x1b1b54[_0x9dac('0x1d')]=qs['limit'](_0x3d3bcc['query'][_0x9dac('0x1d')]);_0x1b1b54[_0x9dac('0x1a')]=qs[_0x9dac('0x1a')](_0x3d3bcc[_0x9dac('0x2e')]['offset']);}_0x1b1b54[_0x9dac('0x35')]=qs[_0x9dac('0x36')](_0x3d3bcc['query']['sort']);_0x1b1b54[_0x9dac('0x37')]=qs[_0x9dac('0x38')](_[_0x9dac('0x39')](_0x3d3bcc[_0x9dac('0x2e')],_0xba7b25[_0x9dac('0x38')]),_0x2f7b14);if(_0x3d3bcc[_0x9dac('0x2e')][_0x9dac('0x3a')]){_0x1b1b54['where']=_['merge'](_0x1b1b54[_0x9dac('0x37')],{'$or':_['map'](_0x2f7b14,function(_0x2fab24){if(_0x2fab24[_0x9dac('0x2b')]!==_0x9dac('0x3b')){var _0x5d17e0={};_0x5d17e0[_0x2fab24[_0x9dac('0x25')]]={'$like':'%'+_0x3d3bcc[_0x9dac('0x2e')][_0x9dac('0x3a')]+'%'};return _0x5d17e0;}})});}_0x1b1b54=_['merge']({},_0x1b1b54,_0x3d3bcc[_0x9dac('0x3c')]);var _0x529cdb={'where':_0x1b1b54[_0x9dac('0x37')]};return db['SmsTransferReport'][_0x9dac('0x1c')](_0x529cdb)[_0x9dac('0x22')](function(_0x701539){_0x37750a[_0x9dac('0x1c')]=_0x701539;if(_0x3d3bcc[_0x9dac('0x2e')][_0x9dac('0x3d')]){_0x1b1b54[_0x9dac('0x3e')]=[{'all':!![]}];}return db[_0x9dac('0x29')][_0x9dac('0x3f')](_0x1b1b54);})['then'](function(_0x43c94b){_0x37750a[_0x9dac('0x40')]=_0x43c94b;return _0x37750a;})[_0x9dac('0x22')](respondWithFilteredResult(_0x50fdb8,_0x1b1b54))['catch'](handleError(_0x50fdb8,null));};exports[_0x9dac('0x41')]=function(_0x2cddff,_0x4ad385){var _0x2f8d38={'raw':!![],'where':{'id':_0x2cddff[_0x9dac('0x42')]['id']}},_0x23eb6f={};_0x23eb6f[_0x9dac('0x2d')]=_[_0x9dac('0x43')](db['SmsTransferReport'][_0x9dac('0x44')]);_0x23eb6f['query']=_[_0x9dac('0x43')](_0x2cddff[_0x9dac('0x2e')]);_0x23eb6f[_0x9dac('0x38')]=_[_0x9dac('0x2f')](_0x23eb6f[_0x9dac('0x2d')],_0x23eb6f['query']);_0x2f8d38[_0x9dac('0x30')]=_[_0x9dac('0x2f')](_0x23eb6f[_0x9dac('0x2d')],qs['fields'](_0x2cddff[_0x9dac('0x2e')][_0x9dac('0x31')]));_0x2f8d38[_0x9dac('0x30')]=_0x2f8d38[_0x9dac('0x30')][_0x9dac('0x32')]?_0x2f8d38[_0x9dac('0x30')]:_0x23eb6f[_0x9dac('0x2d')];if(_0x2cddff[_0x9dac('0x2e')][_0x9dac('0x3d')]){_0x2f8d38[_0x9dac('0x3e')]=[{'all':!![]}];}_0x2f8d38=_[_0x9dac('0x45')]({},_0x2f8d38,_0x2cddff['options']);return db[_0x9dac('0x29')][_0x9dac('0x46')](_0x2f8d38)[_0x9dac('0x22')](handleEntityNotFound(_0x4ad385,null))['then'](respondWithResult(_0x4ad385,null))['catch'](handleError(_0x4ad385,null));};exports[_0x9dac('0x47')]=function(_0x1343fa,_0x36dd75){return db[_0x9dac('0x29')][_0x9dac('0x47')](_0x1343fa[_0x9dac('0x48')],{})['then'](respondWithResult(_0x36dd75,0xc9))['catch'](handleError(_0x36dd75,null));};exports[_0x9dac('0x21')]=function(_0x4b4703,_0x4cb896){if(_0x4b4703['body']['id']){delete _0x4b4703[_0x9dac('0x48')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x4b4703['params']['id']}})[_0x9dac('0x22')](handleEntityNotFound(_0x4cb896,null))[_0x9dac('0x22')](saveUpdates(_0x4b4703[_0x9dac('0x48')],null))[_0x9dac('0x22')](respondWithResult(_0x4cb896,null))[_0x9dac('0x49')](handleError(_0x4cb896,null));};exports[_0x9dac('0x23')]=function(_0x315771,_0xdb41de){return db['SmsTransferReport'][_0x9dac('0x46')]({'where':{'id':_0x315771[_0x9dac('0x42')]['id']}})[_0x9dac('0x22')](handleEntityNotFound(_0xdb41de,null))[_0x9dac('0x22')](removeEntity(_0xdb41de,null))[_0x9dac('0x49')](handleError(_0xdb41de,null));};exports[_0x9dac('0x4a')]=function(_0x2e13cd,_0x65ab5d){return db['SmsTransferReport'][_0x9dac('0x4a')]()[_0x9dac('0x22')](respondWithResult(_0x65ab5d,null))[_0x9dac('0x49')](handleError(_0x65ab5d,null));};
\ No newline at end of file
+var _0x1afd=['sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','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','set','Content-Range','reject','update','destroy','then','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','SmsTransferReport','count','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','catch','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0xd73531,_0x5599bc){var _0x27286b=function(_0x3b524e){while(--_0x3b524e){_0xd73531['push'](_0xd73531['shift']());}};_0x27286b(++_0x5599bc);}(_0x1afd,0xd6));var _0xd1af=function(_0x512aa7,_0x2be0d9){_0x512aa7=_0x512aa7-0x0;var _0x952539=_0x1afd[_0x512aa7];return _0x952539;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd1af('0x0'));var zipdir=require(_0xd1af('0x1'));var jsonpatch=require(_0xd1af('0x2'));var rp=require(_0xd1af('0x3'));var moment=require('moment');var BPromise=require(_0xd1af('0x4'));var Mustache=require(_0xd1af('0x5'));var util=require(_0xd1af('0x6'));var path=require(_0xd1af('0x7'));var sox=require(_0xd1af('0x8'));var csv=require(_0xd1af('0x9'));var ejs=require(_0xd1af('0xa'));var fs=require('fs');var fs_extra=require(_0xd1af('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd1af('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd1af('0xd'));var toCsv=require(_0xd1af('0x9'));var querystring=require(_0xd1af('0xe'));var Papa=require('papaparse');var Redis=require(_0xd1af('0xf'));var authService=require(_0xd1af('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd1af('0x11'));var logger=require(_0xd1af('0x12'))(_0xd1af('0x13'));var utils=require(_0xd1af('0x14'));var config=require(_0xd1af('0x15'));var licenseUtil=require(_0xd1af('0x16'));var db=require(_0xd1af('0x17'))['db'];function respondWithStatusCode(_0x114c81,_0x509f1c){_0x509f1c=_0x509f1c||0xcc;return function(_0x5a2e68){if(_0x5a2e68){return _0x114c81[_0xd1af('0x18')](_0x509f1c);}return _0x114c81['status'](_0x509f1c)[_0xd1af('0x19')]();};}function respondWithResult(_0x1cd0d1,_0x4f4084){_0x4f4084=_0x4f4084||0xc8;return function(_0x39ca6b){if(_0x39ca6b){return _0x1cd0d1[_0xd1af('0x1a')](_0x4f4084)[_0xd1af('0x1b')](_0x39ca6b);}};}function respondWithFilteredResult(_0x1cd514,_0x3cc32d){return function(_0x8cc2b){if(_0x8cc2b){var _0x280601=typeof _0x3cc32d[_0xd1af('0x1c')]===_0xd1af('0x1d')&&typeof _0x3cc32d[_0xd1af('0x1e')]===_0xd1af('0x1d');var _0x1634b5=_0x8cc2b['count'];var _0x47f54e=_0x280601?0x0:_0x3cc32d['offset'];var _0x1b8887=_0x280601?_0x8cc2b['count']:_0x3cc32d['offset']+_0x3cc32d['limit'];var _0x1aa543;if(_0x1b8887>=_0x1634b5){_0x1b8887=_0x1634b5;_0x1aa543=0xc8;}else{_0x1aa543=0xce;}_0x1cd514[_0xd1af('0x1a')](_0x1aa543);return _0x1cd514[_0xd1af('0x1f')](_0xd1af('0x20'),_0x47f54e+'-'+_0x1b8887+'/'+_0x1634b5)[_0xd1af('0x1b')](_0x8cc2b);}return null;};}function patchUpdates(_0x12bd5a){return function(_0x464b89){try{jsonpatch['apply'](_0x464b89,_0x12bd5a,!![]);}catch(_0x4a9653){return BPromise[_0xd1af('0x21')](_0x4a9653);}return _0x464b89['save']();};}function saveUpdates(_0x153382,_0x599e59){return function(_0x48cbc8){if(_0x48cbc8){return _0x48cbc8[_0xd1af('0x22')](_0x153382)['then'](function(_0x1d11c7){return _0x1d11c7;});}return null;};}function removeEntity(_0x8b8c79,_0x3ab932){return function(_0x18d7cc){if(_0x18d7cc){return _0x18d7cc[_0xd1af('0x23')]()[_0xd1af('0x24')](function(){_0x8b8c79['status'](0xcc)[_0xd1af('0x19')]();});}};}function handleEntityNotFound(_0x53e296,_0x362980){return function(_0x4c5184){if(!_0x4c5184){_0x53e296['sendStatus'](0x194);}return _0x4c5184;};}function handleError(_0x4182aa,_0x1ef775){_0x1ef775=_0x1ef775||0x1f4;return function(_0x415261){logger[_0xd1af('0x25')](_0x415261['stack']);if(_0x415261[_0xd1af('0x26')]){delete _0x415261['name'];}_0x4182aa['status'](_0x1ef775)[_0xd1af('0x27')](_0x415261);};}exports[_0xd1af('0x28')]=function(_0x5c65dd,_0x2c546f){var _0xf8344a={},_0x5e6b03={},_0x1d461b={'count':0x0,'rows':[]};var _0x75fcca=_[_0xd1af('0x29')](db['SmsTransferReport']['rawAttributes'],function(_0x272074){return{'name':_0x272074[_0xd1af('0x2a')],'type':_0x272074[_0xd1af('0x2b')][_0xd1af('0x2c')]};});_0x5e6b03[_0xd1af('0x2d')]=_[_0xd1af('0x29')](_0x75fcca,_0xd1af('0x26'));_0x5e6b03[_0xd1af('0x2e')]=_[_0xd1af('0x2f')](_0x5c65dd[_0xd1af('0x2e')]);_0x5e6b03[_0xd1af('0x30')]=_[_0xd1af('0x31')](_0x5e6b03[_0xd1af('0x2d')],_0x5e6b03[_0xd1af('0x2e')]);_0xf8344a[_0xd1af('0x32')]=_[_0xd1af('0x31')](_0x5e6b03[_0xd1af('0x2d')],qs[_0xd1af('0x33')](_0x5c65dd[_0xd1af('0x2e')][_0xd1af('0x33')]));_0xf8344a['attributes']=_0xf8344a['attributes'][_0xd1af('0x34')]?_0xf8344a[_0xd1af('0x32')]:_0x5e6b03[_0xd1af('0x2d')];if(!_0x5c65dd['query'][_0xd1af('0x35')](_0xd1af('0x36'))){_0xf8344a['limit']=qs[_0xd1af('0x1e')](_0x5c65dd[_0xd1af('0x2e')][_0xd1af('0x1e')]);_0xf8344a['offset']=qs[_0xd1af('0x1c')](_0x5c65dd[_0xd1af('0x2e')][_0xd1af('0x1c')]);}_0xf8344a['order']=qs['sort'](_0x5c65dd[_0xd1af('0x2e')][_0xd1af('0x37')]);_0xf8344a['where']=qs['filters'](_[_0xd1af('0x38')](_0x5c65dd[_0xd1af('0x2e')],_0x5e6b03[_0xd1af('0x30')]),_0x75fcca);if(_0x5c65dd['query']['filter']){_0xf8344a[_0xd1af('0x39')]=_['merge'](_0xf8344a[_0xd1af('0x39')],{'$or':_[_0xd1af('0x29')](_0x75fcca,function(_0x48ee02){if(_0x48ee02[_0xd1af('0x2b')]!==_0xd1af('0x3a')){var _0x566a29={};_0x566a29[_0x48ee02[_0xd1af('0x26')]]={'$like':'%'+_0x5c65dd[_0xd1af('0x2e')][_0xd1af('0x3b')]+'%'};return _0x566a29;}})});}_0xf8344a=_['merge']({},_0xf8344a,_0x5c65dd['options']);var _0x4a7a1d={'where':_0xf8344a[_0xd1af('0x39')]};return db[_0xd1af('0x3c')][_0xd1af('0x3d')](_0x4a7a1d)[_0xd1af('0x24')](function(_0x2cafc2){_0x1d461b[_0xd1af('0x3d')]=_0x2cafc2;if(_0x5c65dd[_0xd1af('0x2e')][_0xd1af('0x3e')]){_0xf8344a[_0xd1af('0x3f')]=[{'all':!![]}];}return db[_0xd1af('0x3c')][_0xd1af('0x40')](_0xf8344a);})[_0xd1af('0x24')](function(_0x5eacd9){_0x1d461b[_0xd1af('0x41')]=_0x5eacd9;return _0x1d461b;})[_0xd1af('0x24')](respondWithFilteredResult(_0x2c546f,_0xf8344a))['catch'](handleError(_0x2c546f,null));};exports[_0xd1af('0x42')]=function(_0x5eb14f,_0x413431){var _0x3a32bc={'raw':!![],'where':{'id':_0x5eb14f[_0xd1af('0x43')]['id']}},_0x5e0491={};_0x5e0491[_0xd1af('0x2d')]=_[_0xd1af('0x2f')](db[_0xd1af('0x3c')][_0xd1af('0x44')]);_0x5e0491['query']=_[_0xd1af('0x2f')](_0x5eb14f[_0xd1af('0x2e')]);_0x5e0491[_0xd1af('0x30')]=_[_0xd1af('0x31')](_0x5e0491[_0xd1af('0x2d')],_0x5e0491[_0xd1af('0x2e')]);_0x3a32bc[_0xd1af('0x32')]=_['intersection'](_0x5e0491[_0xd1af('0x2d')],qs[_0xd1af('0x33')](_0x5eb14f[_0xd1af('0x2e')][_0xd1af('0x33')]));_0x3a32bc[_0xd1af('0x32')]=_0x3a32bc[_0xd1af('0x32')][_0xd1af('0x34')]?_0x3a32bc[_0xd1af('0x32')]:_0x5e0491[_0xd1af('0x2d')];if(_0x5eb14f['query'][_0xd1af('0x3e')]){_0x3a32bc[_0xd1af('0x3f')]=[{'all':!![]}];}_0x3a32bc=_['merge']({},_0x3a32bc,_0x5eb14f['options']);return db[_0xd1af('0x3c')]['find'](_0x3a32bc)[_0xd1af('0x24')](handleEntityNotFound(_0x413431,null))['then'](respondWithResult(_0x413431,null))['catch'](handleError(_0x413431,null));};exports['create']=function(_0x448f03,_0x690093){return db[_0xd1af('0x3c')][_0xd1af('0x45')](_0x448f03[_0xd1af('0x46')],{})[_0xd1af('0x24')](respondWithResult(_0x690093,0xc9))['catch'](handleError(_0x690093,null));};exports['update']=function(_0x3d7368,_0x413c8e){if(_0x3d7368[_0xd1af('0x46')]['id']){delete _0x3d7368[_0xd1af('0x46')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x3d7368[_0xd1af('0x43')]['id']}})[_0xd1af('0x24')](handleEntityNotFound(_0x413c8e,null))[_0xd1af('0x24')](saveUpdates(_0x3d7368[_0xd1af('0x46')],null))[_0xd1af('0x24')](respondWithResult(_0x413c8e,null))[_0xd1af('0x47')](handleError(_0x413c8e,null));};exports['destroy']=function(_0x48dfe4,_0x20f3f5){return db[_0xd1af('0x3c')][_0xd1af('0x48')]({'where':{'id':_0x48dfe4['params']['id']}})[_0xd1af('0x24')](handleEntityNotFound(_0x20f3f5,null))[_0xd1af('0x24')](removeEntity(_0x20f3f5,null))[_0xd1af('0x47')](handleError(_0x20f3f5,null));};exports[_0xd1af('0x49')]=function(_0x89af75,_0x215f33){return db['SmsTransferReport'][_0xd1af('0x49')]()[_0xd1af('0x24')](respondWithResult(_0x215f33,null))[_0xd1af('0x47')](handleError(_0x215f33,null));};
\ No newline at end of file
index bbc59a4..0fd6593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e5=['moment','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','util','api'];(function(_0x1fa0cb,_0x1bacf5){var _0x1330b1=function(_0x18988a){while(--_0x18988a){_0x1fa0cb['push'](_0x1fa0cb['shift']());}};_0x1330b1(++_0x1bacf5);}(_0x34e5,0x172));var _0x534e=function(_0x285d54,_0x4d4ff6){_0x285d54=_0x285d54-0x0;var _0x2f9a80=_0x34e5[_0x285d54];return _0x2f9a80;};'use strict';var _=require('lodash');var util=require(_0x534e('0x0'));var logger=require('../../config/logger')(_0x534e('0x1'));var moment=require(_0x534e('0x2'));var BPromise=require(_0x534e('0x3'));var rp=require(_0x534e('0x4'));var fs=require('fs');var path=require(_0x534e('0x5'));var rimraf=require('rimraf');var config=require(_0x534e('0x6'));var attributes=require(_0x534e('0x7'));module[_0x534e('0x8')]=function(_0x117f0c,_0x436a92){return _0x117f0c[_0x534e('0x9')](_0x534e('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x534e('0xb'),'fields':[_0x534e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','../../config/logger','api'];(function(_0x528241,_0xe1f089){var _0x261662=function(_0x56715c){while(--_0x56715c){_0x528241['push'](_0x528241['shift']());}};_0x261662(++_0xe1f089);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x27ccb6,_0x103913){_0x27ccb6=_0x27ccb6-0x0;var _0x412043=_0x7fbe[_0x27ccb6];return _0x412043;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 499916e..93fb33e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08d9=['../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x19cb38,_0x104d6d){var _0x57f16f=function(_0x3fe246){while(--_0x3fe246){_0x19cb38['push'](_0x19cb38['shift']());}};_0x57f16f(++_0x104d6d);}(_0x08d9,0xc2));var _0x908d=function(_0x5d5905,_0x410219){_0x5d5905=_0x5d5905-0x0;var _0x5657c0=_0x08d9[_0x5d5905];return _0x5657c0;};'use strict';var _=require(_0x908d('0x0'));var util=require('util');var moment=require(_0x908d('0x1'));var BPromise=require('bluebird');var rs=require(_0x908d('0x2'));var fs=require('fs');var Redis=require(_0x908d('0x3'));var db=require(_0x908d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x908d('0x5'));var config=require(_0x908d('0x6'));var jayson=require(_0x908d('0x7'));var client=jayson[_0x908d('0x8')][_0x908d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d67d6,_0x52cd93,_0x12ce59){return new BPromise(function(_0x388e9c,_0x2b5bad){return client[_0x908d('0xa')](_0x5d67d6,_0x12ce59)[_0x908d('0xb')](function(_0x86662e){logger[_0x908d('0xc')](_0x908d('0xd'),_0x52cd93,_0x908d('0xe'));logger['debug'](_0x908d('0xf'),_0x52cd93,_0x908d('0xe'),JSON[_0x908d('0x10')](_0x86662e));if(_0x86662e[_0x908d('0x11')]){if(_0x86662e[_0x908d('0x11')]['code']===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x52cd93,_0x86662e[_0x908d('0x11')][_0x908d('0x12')]);return _0x2b5bad(_0x86662e[_0x908d('0x11')][_0x908d('0x12')]);}logger[_0x908d('0x11')](_0x908d('0xd'),_0x52cd93,_0x86662e[_0x908d('0x11')]['message']);return _0x388e9c(_0x86662e['error'][_0x908d('0x12')]);}else{logger[_0x908d('0xc')](_0x908d('0xd'),_0x52cd93,_0x908d('0xe'));_0x388e9c(_0x86662e['result']['message']);}})[_0x908d('0x13')](function(_0xe377a6){logger[_0x908d('0x11')](_0x908d('0xd'),_0x52cd93,_0xe377a6);_0x2b5bad(_0xe377a6);});});}
\ No newline at end of file
+var _0xf6c1=['jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x325ba8,_0x3f0ec0){var _0x4fefee=function(_0x3335bb){while(--_0x3335bb){_0x325ba8['push'](_0x325ba8['shift']());}};_0x4fefee(++_0x3f0ec0);}(_0xf6c1,0x99));var _0x1f6c=function(_0x4d9f3f,_0x21a90a){_0x4d9f3f=_0x4d9f3f-0x0;var _0x142949=_0xf6c1[_0x4d9f3f];return _0x142949;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f6c('0x0'));var BPromise=require(_0x1f6c('0x1'));var rs=require(_0x1f6c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f6c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f6c('0x4'))(_0x1f6c('0x5'));var config=require(_0x1f6c('0x6'));var jayson=require(_0x1f6c('0x7'));var client=jayson[_0x1f6c('0x8')][_0x1f6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x530b25,_0x3c7569,_0x1385de){return new BPromise(function(_0xade159,_0xcf5c23){return client[_0x1f6c('0xa')](_0x530b25,_0x1385de)[_0x1f6c('0xb')](function(_0x1e7287){logger[_0x1f6c('0xc')](_0x1f6c('0xd'),_0x3c7569,'request\x20sent');logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3c7569,_0x1f6c('0xe'),JSON[_0x1f6c('0xf')](_0x1e7287));if(_0x1e7287[_0x1f6c('0x10')]){if(_0x1e7287[_0x1f6c('0x10')][_0x1f6c('0x11')]===0x1f4){logger[_0x1f6c('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3c7569,_0x1e7287[_0x1f6c('0x10')][_0x1f6c('0x12')]);return _0xcf5c23(_0x1e7287[_0x1f6c('0x10')][_0x1f6c('0x12')]);}logger[_0x1f6c('0x10')](_0x1f6c('0xd'),_0x3c7569,_0x1e7287[_0x1f6c('0x10')][_0x1f6c('0x12')]);return _0xade159(_0x1e7287['error'][_0x1f6c('0x12')]);}else{logger[_0x1f6c('0xc')](_0x1f6c('0xd'),_0x3c7569,_0x1f6c('0xe'));_0xade159(_0x1e7287[_0x1f6c('0x13')][_0x1f6c('0x12')]);}})['catch'](function(_0x521c4c){logger[_0x1f6c('0x10')](_0x1f6c('0xd'),_0x3c7569,_0x521c4c);_0xcf5c23(_0x521c4c);});});}
\ No newline at end of file
index acc5ad1..04f8c1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x077e=['../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','download','diskStorage','join','originalname','format','%s-%s%s','extname','now','single','file','create','/:id','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x1e241f,_0x435afa){var _0x1f2ff1=function(_0x579802){while(--_0x579802){_0x1e241f['push'](_0x1e241f['shift']());}};_0x1f2ff1(++_0x435afa);}(_0x077e,0x167));var _0xe077=function(_0x1c7594,_0x3fd3d2){_0x1c7594=_0x1c7594-0x0;var _0x60e6c2=_0x077e[_0x1c7594];return _0x60e6c2;};'use strict';var multer=require(_0xe077('0x0'));var util=require('util');var path=require(_0xe077('0x1'));var timeout=require(_0xe077('0x2'));var express=require(_0xe077('0x3'));var router=express[_0xe077('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe077('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe077('0x6'));var controller=require(_0xe077('0x7'));router[_0xe077('0x8')]('/',auth[_0xe077('0x9')](),controller[_0xe077('0xa')]);router[_0xe077('0x8')]('/:id',auth[_0xe077('0x9')](),controller[_0xe077('0xb')]);router[_0xe077('0x8')]('/:id/download',auth[_0xe077('0x9')](),controller[_0xe077('0xc')]);var upload=multer({'storage':multer[_0xe077('0xd')]({'destination':function(_0x360910,_0x5b7176,_0x465714){_0x465714(null,path[_0xe077('0xe')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x2e3b4a,_0xadd7e,_0x2c61f3){_0xadd7e['originalname']=_0xadd7e[_0xe077('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2c61f3(null,util[_0xe077('0x10')](_0xe077('0x11'),path['basename'](_0xadd7e['originalname'],path[_0xe077('0x12')](_0xadd7e[_0xe077('0xf')])),Date[_0xe077('0x13')](),path[_0xe077('0x12')](_0xadd7e[_0xe077('0xf')])));}})});router['post']('/',upload[_0xe077('0x14')](_0xe077('0x15')),controller[_0xe077('0x16')]);router['put'](_0xe077('0x17'),auth[_0xe077('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe077('0x18')]);module[_0xe077('0x19')]=router;
\ No newline at end of file
+var _0xe6b5=['isAuthenticated','/:id','download','diskStorage','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get'];(function(_0x1b9708,_0x282b0c){var _0x443b5b=function(_0x2c8a3a){while(--_0x2c8a3a){_0x1b9708['push'](_0x1b9708['shift']());}};_0x443b5b(++_0x282b0c);}(_0xe6b5,0xbc));var _0x5e6b=function(_0x2cdf66,_0x530f7f){_0x2cdf66=_0x2cdf66-0x0;var _0x5af684=_0xe6b5[_0x2cdf66];return _0x5af684;};'use strict';var multer=require(_0x5e6b('0x0'));var util=require('util');var path=require(_0x5e6b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5e6b('0x2'));var auth=require(_0x5e6b('0x3'));var interaction=require(_0x5e6b('0x4'));var config=require(_0x5e6b('0x5'));var controller=require(_0x5e6b('0x6'));router[_0x5e6b('0x7')]('/',auth[_0x5e6b('0x8')](),controller['index']);router[_0x5e6b('0x7')](_0x5e6b('0x9'),auth[_0x5e6b('0x8')](),controller['show']);router[_0x5e6b('0x7')]('/:id/download',auth[_0x5e6b('0x8')](),controller[_0x5e6b('0xa')]);var upload=multer({'storage':multer[_0x5e6b('0xb')]({'destination':function(_0x100e3d,_0x735ee9,_0x5b5974){_0x5b5974(null,path[_0x5e6b('0xc')](config['root'],_0x5e6b('0xd')));},'filename':function(_0x1fd224,_0x3a5195,_0x1ad1d6){_0x3a5195[_0x5e6b('0xe')]=_0x3a5195[_0x5e6b('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1ad1d6(null,util[_0x5e6b('0xf')](_0x5e6b('0x10'),path[_0x5e6b('0x11')](_0x3a5195[_0x5e6b('0xe')],path[_0x5e6b('0x12')](_0x3a5195['originalname'])),Date[_0x5e6b('0x13')](),path['extname'](_0x3a5195[_0x5e6b('0xe')])));}})});router[_0x5e6b('0x14')]('/',upload[_0x5e6b('0x15')](_0x5e6b('0x16')),controller[_0x5e6b('0x17')]);router[_0x5e6b('0x18')]('/:id',auth[_0x5e6b('0x8')](),controller[_0x5e6b('0x19')]);router[_0x5e6b('0x1a')](_0x5e6b('0x9'),auth[_0x5e6b('0x8')](),controller[_0x5e6b('0x1a')]);module[_0x5e6b('0x1b')]=router;
\ No newline at end of file
index 83236d6..64d1d11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf99=['BIGINT','INTEGER','sequelize','STRING','FLOAT'];(function(_0x7c9c9e,_0x1ae516){var _0x10ec6a=function(_0x418fa1){while(--_0x418fa1){_0x7c9c9e['push'](_0x7c9c9e['shift']());}};_0x10ec6a(++_0x1ae516);}(_0xbf99,0x8e));var _0x9bf9=function(_0x5f4ef0,_0x3834){_0x5f4ef0=_0x5f4ef0-0x0;var _0x3c38be=_0xbf99[_0x5f4ef0];return _0x3c38be;};'use strict';var Sequelize=require(_0x9bf9('0x0'));module['exports']={'name':{'type':Sequelize[_0x9bf9('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x9bf9('0x1')]},'display_name':{'type':Sequelize[_0x9bf9('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x9bf9('0x1')]},'original_duration':{'type':Sequelize[_0x9bf9('0x2')]},'original_sampleCount':{'type':Sequelize[_0x9bf9('0x3')]},'original_channelCount':{'type':Sequelize[_0x9bf9('0x4')]},'original_bitRate':{'type':Sequelize[_0x9bf9('0x3')]},'original_sampleRate':{'type':Sequelize[_0x9bf9('0x4')]},'converted_format':{'type':Sequelize[_0x9bf9('0x1')]},'converted_duration':{'type':Sequelize[_0x9bf9('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x9bf9('0x3')]},'converted_channelCount':{'type':Sequelize[_0x9bf9('0x4')]},'converted_bitRate':{'type':Sequelize[_0x9bf9('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1d5e=['STRING','name','FLOAT','INTEGER','BIGINT','exports'];(function(_0x561b35,_0x356d57){var _0x144497=function(_0x5a5f9b){while(--_0x5a5f9b){_0x561b35['push'](_0x561b35['shift']());}};_0x144497(++_0x356d57);}(_0x1d5e,0x1b5));var _0xe1d5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1d5e[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xe1d5('0x0')]={'name':{'type':Sequelize[_0xe1d5('0x1')],'unique':_0xe1d5('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe1d5('0x1')]},'display_name':{'type':Sequelize[_0xe1d5('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xe1d5('0x1')]},'original_format':{'type':Sequelize[_0xe1d5('0x1')]},'original_duration':{'type':Sequelize[_0xe1d5('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xe1d5('0x4')]},'original_bitRate':{'type':Sequelize[_0xe1d5('0x5')]},'original_sampleRate':{'type':Sequelize[_0xe1d5('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xe1d5('0x5')]},'converted_channelCount':{'type':Sequelize[_0xe1d5('0x4')]},'converted_bitRate':{'type':Sequelize[_0xe1d5('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xe1d5('0x4')]}};
\ No newline at end of file
index 56c0c0e..bf50b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e7b=['json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','Sounds','UserProfileResource','end','sendStatus','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','includeAll','include','findAll','catch','show','params','options','find','download','save_name','converted_format','existsSync','join','root','Sequelize','Sound\x20not\x20found','server/files/sounds/converted','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','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','status'];(function(_0x32c8ed,_0x45fef2){var _0x580764=function(_0xeb440e){while(--_0xeb440e){_0x32c8ed['push'](_0x32c8ed['shift']());}};_0x580764(++_0x45fef2);}(_0x5e7b,0x15e));var _0xb5e7=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x5e7b[_0x44bcb0];return _0xfaf881;};'use strict';var emlformat=require(_0xb5e7('0x0'));var rimraf=require(_0xb5e7('0x1'));var zipdir=require(_0xb5e7('0x2'));var jsonpatch=require(_0xb5e7('0x3'));var rp=require(_0xb5e7('0x4'));var moment=require(_0xb5e7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb5e7('0x6'));var util=require(_0xb5e7('0x7'));var path=require(_0xb5e7('0x8'));var sox=require(_0xb5e7('0x9'));var csv=require(_0xb5e7('0xa'));var ejs=require(_0xb5e7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5e7('0xc'));var squel=require(_0xb5e7('0xd'));var crypto=require(_0xb5e7('0xe'));var jsforce=require(_0xb5e7('0xf'));var deskjs=require(_0xb5e7('0x10'));var toCsv=require(_0xb5e7('0xa'));var querystring=require(_0xb5e7('0x11'));var Papa=require(_0xb5e7('0x12'));var Redis=require(_0xb5e7('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb5e7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5e7('0x15'));var logger=require(_0xb5e7('0x16'))('api');var utils=require(_0xb5e7('0x17'));var config=require(_0xb5e7('0x18'));var licenseUtil=require(_0xb5e7('0x19'));var db=require(_0xb5e7('0x1a'))['db'];function respondWithStatusCode(_0x42b786,_0x126837){_0x126837=_0x126837||0xcc;return function(_0x2d4d0b){if(_0x2d4d0b){return _0x42b786['sendStatus'](_0x126837);}return _0x42b786[_0xb5e7('0x1b')](_0x126837)['end']();};}function respondWithResult(_0x1b3881,_0x2c7086){_0x2c7086=_0x2c7086||0xc8;return function(_0x584a18){if(_0x584a18){return _0x1b3881[_0xb5e7('0x1b')](_0x2c7086)[_0xb5e7('0x1c')](_0x584a18);}};}function respondWithFilteredResult(_0x50febd,_0x407a60){return function(_0x497e29){if(_0x497e29){var _0x5e2414=typeof _0x407a60['offset']==='undefined'&&typeof _0x407a60[_0xb5e7('0x1d')]===_0xb5e7('0x1e');var _0x149b2f=_0x497e29[_0xb5e7('0x1f')];var _0x120b0c=_0x5e2414?0x0:_0x407a60[_0xb5e7('0x20')];var _0x10cb7f=_0x5e2414?_0x497e29[_0xb5e7('0x1f')]:_0x407a60[_0xb5e7('0x20')]+_0x407a60['limit'];var _0xc28fa1;if(_0x10cb7f>=_0x149b2f){_0x10cb7f=_0x149b2f;_0xc28fa1=0xc8;}else{_0xc28fa1=0xce;}_0x50febd[_0xb5e7('0x1b')](_0xc28fa1);return _0x50febd['set'](_0xb5e7('0x21'),_0x120b0c+'-'+_0x10cb7f+'/'+_0x149b2f)[_0xb5e7('0x1c')](_0x497e29);}return null;};}function patchUpdates(_0x5c4d5d){return function(_0x1b5011){try{jsonpatch[_0xb5e7('0x22')](_0x1b5011,_0x5c4d5d,!![]);}catch(_0x5d9e0b){return BPromise['reject'](_0x5d9e0b);}return _0x1b5011[_0xb5e7('0x23')]();};}function saveUpdates(_0x80a06d,_0x460478){return function(_0x58fcb9){if(_0x58fcb9){return _0x58fcb9[_0xb5e7('0x24')](_0x80a06d)[_0xb5e7('0x25')](function(_0x1e7057){return _0x1e7057;});}return null;};}function removeEntity(_0x3ad7ac,_0x400d3c){return function(_0x574e20){if(_0x574e20){return _0x574e20[_0xb5e7('0x26')]()[_0xb5e7('0x25')](function(){var _0x28d98a=_0x574e20['get']({'plain':!![]});var _0x8e7a47=_0xb5e7('0x27');return db[_0xb5e7('0x28')][_0xb5e7('0x26')]({'where':{'type':_0x8e7a47,'resourceId':_0x28d98a['id']}})[_0xb5e7('0x25')](function(){return _0x574e20;});})['then'](function(){_0x3ad7ac[_0xb5e7('0x1b')](0xcc)[_0xb5e7('0x29')]();});}};}function handleEntityNotFound(_0x56647e,_0x1a0e72){return function(_0x8f41be){if(!_0x8f41be){_0x56647e[_0xb5e7('0x2a')](0x194);}return _0x8f41be;};}function handleError(_0x4e76ec,_0x43839c){_0x43839c=_0x43839c||0x1f4;return function(_0x3ce0bd){logger[_0xb5e7('0x2b')](_0x3ce0bd['stack']);if(_0x3ce0bd[_0xb5e7('0x2c')]){delete _0x3ce0bd['name'];}_0x4e76ec[_0xb5e7('0x1b')](_0x43839c)[_0xb5e7('0x2d')](_0x3ce0bd);};}exports[_0xb5e7('0x2e')]=function(_0x3eff25,_0x55786e){var _0x2732f9={},_0x2ac36d={},_0x57a387={'count':0x0,'rows':[]};var _0x3b492f=_[_0xb5e7('0x2f')](db[_0xb5e7('0x30')][_0xb5e7('0x31')],function(_0x2b5db5){return{'name':_0x2b5db5[_0xb5e7('0x32')],'type':_0x2b5db5[_0xb5e7('0x33')][_0xb5e7('0x34')]};});_0x2ac36d[_0xb5e7('0x35')]=_['map'](_0x3b492f,_0xb5e7('0x2c'));_0x2ac36d[_0xb5e7('0x36')]=_[_0xb5e7('0x37')](_0x3eff25[_0xb5e7('0x36')]);_0x2ac36d['filters']=_[_0xb5e7('0x38')](_0x2ac36d[_0xb5e7('0x35')],_0x2ac36d[_0xb5e7('0x36')]);_0x2732f9[_0xb5e7('0x39')]=_[_0xb5e7('0x38')](_0x2ac36d[_0xb5e7('0x35')],qs['fields'](_0x3eff25[_0xb5e7('0x36')]['fields']));_0x2732f9[_0xb5e7('0x39')]=_0x2732f9['attributes'][_0xb5e7('0x3a')]?_0x2732f9[_0xb5e7('0x39')]:_0x2ac36d[_0xb5e7('0x35')];if(!_0x3eff25[_0xb5e7('0x36')][_0xb5e7('0x3b')]('nolimit')){_0x2732f9['limit']=qs[_0xb5e7('0x1d')](_0x3eff25[_0xb5e7('0x36')]['limit']);_0x2732f9['offset']=qs[_0xb5e7('0x20')](_0x3eff25[_0xb5e7('0x36')]['offset']);}_0x2732f9[_0xb5e7('0x3c')]=qs[_0xb5e7('0x3d')](_0x3eff25[_0xb5e7('0x36')][_0xb5e7('0x3d')]);_0x2732f9[_0xb5e7('0x3e')]=qs[_0xb5e7('0x3f')](_[_0xb5e7('0x40')](_0x3eff25['query'],_0x2ac36d['filters']),_0x3b492f);if(_0x3eff25[_0xb5e7('0x36')]['filter']){_0x2732f9[_0xb5e7('0x3e')]=_[_0xb5e7('0x41')](_0x2732f9['where'],{'$or':_['map'](_0x3b492f,function(_0x40fd6){if(_0x40fd6[_0xb5e7('0x33')]!=='VIRTUAL'){var _0x5881b3={};_0x5881b3[_0x40fd6['name']]={'$like':'%'+_0x3eff25['query'][_0xb5e7('0x42')]+'%'};return _0x5881b3;}})});}_0x2732f9=_['merge']({},_0x2732f9,_0x3eff25['options']);var _0x46f299={'where':_0x2732f9['where']};return db['Sound'][_0xb5e7('0x1f')](_0x46f299)['then'](function(_0xecd57e){_0x57a387[_0xb5e7('0x1f')]=_0xecd57e;if(_0x3eff25['query'][_0xb5e7('0x43')]){_0x2732f9[_0xb5e7('0x44')]=[{'all':!![]}];}return db[_0xb5e7('0x30')][_0xb5e7('0x45')](_0x2732f9);})[_0xb5e7('0x25')](function(_0x4590cd){_0x57a387['rows']=_0x4590cd;return _0x57a387;})[_0xb5e7('0x25')](respondWithFilteredResult(_0x55786e,_0x2732f9))[_0xb5e7('0x46')](handleError(_0x55786e,null));};exports[_0xb5e7('0x47')]=function(_0x270ba3,_0x27d39a){var _0x2f4e8a={'raw':!![],'where':{'id':_0x270ba3[_0xb5e7('0x48')]['id']}},_0x2018dd={};_0x2018dd['model']=_[_0xb5e7('0x37')](db[_0xb5e7('0x30')][_0xb5e7('0x31')]);_0x2018dd[_0xb5e7('0x36')]=_[_0xb5e7('0x37')](_0x270ba3[_0xb5e7('0x36')]);_0x2018dd['filters']=_[_0xb5e7('0x38')](_0x2018dd[_0xb5e7('0x35')],_0x2018dd['query']);_0x2f4e8a[_0xb5e7('0x39')]=_[_0xb5e7('0x38')](_0x2018dd[_0xb5e7('0x35')],qs['fields'](_0x270ba3[_0xb5e7('0x36')]['fields']));_0x2f4e8a[_0xb5e7('0x39')]=_0x2f4e8a['attributes'][_0xb5e7('0x3a')]?_0x2f4e8a[_0xb5e7('0x39')]:_0x2018dd['model'];if(_0x270ba3[_0xb5e7('0x36')][_0xb5e7('0x43')]){_0x2f4e8a[_0xb5e7('0x44')]=[{'all':!![]}];}_0x2f4e8a=_[_0xb5e7('0x41')]({},_0x2f4e8a,_0x270ba3[_0xb5e7('0x49')]);return db['Sound'][_0xb5e7('0x4a')](_0x2f4e8a)['then'](handleEntityNotFound(_0x27d39a,null))[_0xb5e7('0x25')](respondWithResult(_0x27d39a,null))[_0xb5e7('0x46')](handleError(_0x27d39a,null));};exports[_0xb5e7('0x4b')]=function(_0x4f5377,_0x8b6242,_0xe74b4){return db[_0xb5e7('0x30')][_0xb5e7('0x4a')]({'where':{'id':_0x4f5377[_0xb5e7('0x48')]['id']},'attributes':[_0xb5e7('0x2c'),_0xb5e7('0x4c'),_0xb5e7('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x8b6242,null))[_0xb5e7('0x25')](function(_0x56fa6f){if(_0x56fa6f){if(!fs[_0xb5e7('0x4e')](path[_0xb5e7('0x4f')](config[_0xb5e7('0x50')],'server/files/sounds/converted',_0x56fa6f[_0xb5e7('0x4c')]+'.'+_0x56fa6f[_0xb5e7('0x4d')]))){throw new db[(_0xb5e7('0x51'))]['ValidationError'](_0xb5e7('0x52'));}return _0x8b6242[_0xb5e7('0x4b')](path['join'](config[_0xb5e7('0x50')],_0xb5e7('0x53'),util['format'](_0xb5e7('0x54'),_0x56fa6f[_0xb5e7('0x4c')],_0x56fa6f[_0xb5e7('0x4d')])),util[_0xb5e7('0x55')](_0xb5e7('0x54'),_0x56fa6f[_0xb5e7('0x2c')],_0x56fa6f[_0xb5e7('0x4d')]));}return null;})[_0xb5e7('0x46')](handleError(_0x8b6242,null));};exports[_0xb5e7('0x56')]=function(_0x22561d,_0x26cd19,_0x4082cc){var _0x3c1745={'name':path[_0xb5e7('0x57')](_0x22561d[_0xb5e7('0x58')][_0xb5e7('0x59')],path[_0xb5e7('0x5a')](_0x22561d[_0xb5e7('0x58')]['originalname'])),'save_name':path[_0xb5e7('0x57')](_0x22561d[_0xb5e7('0x58')][_0xb5e7('0x5b')],path[_0xb5e7('0x5a')](_0x22561d[_0xb5e7('0x58')][_0xb5e7('0x5b')])),'original_format':path[_0xb5e7('0x5a')](_0x22561d[_0xb5e7('0x58')]['originalname'])[_0xb5e7('0x5c')](0x1),'converted_format':_0xb5e7('0x5d')};var _0x386fd8=path[_0xb5e7('0x4f')](config[_0xb5e7('0x50')],'server/files/sounds/original',_0x22561d[_0xb5e7('0x58')][_0xb5e7('0x5b')]);var _0x2d33e0=path[_0xb5e7('0x4f')](config[_0xb5e7('0x50')],'server/files/sounds/converted',util[_0xb5e7('0x55')]('%s.%s',path[_0xb5e7('0x57')](_0x22561d[_0xb5e7('0x58')]['filename'],path['extname'](_0x22561d[_0xb5e7('0x58')][_0xb5e7('0x5b')])),_0x3c1745['converted_format']));logger[_0xb5e7('0x5e')]('Sound\x20upload\x20filepath:\x20%s',_0x386fd8);logger[_0xb5e7('0x5e')](_0xb5e7('0x5f'),_0x2d33e0);try{fs[_0xb5e7('0x60')](_0x386fd8,parseInt('0777',0x8));var _0x97abcf=sox[_0xb5e7('0x61')](_0x386fd8,_0x2d33e0,{'sampleRate':0x1f40,'format':_0xb5e7('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x97abcf['on'](_0xb5e7('0x2b'),function(_0x30e283){fs[_0xb5e7('0x62')](_0x386fd8);_0x26cd19['status'](0x1f4)[_0xb5e7('0x2d')](_0x30e283);});_0x97abcf['on']('src',function(_0x544d9f){_0x3c1745[_0xb5e7('0x63')]=isNaN(_0x544d9f[_0xb5e7('0x64')])?null:_0x544d9f[_0xb5e7('0x64')]*0x3e8;_0x3c1745[_0xb5e7('0x65')]=isNaN(_0x544d9f['sampleCount'])?null:_0x544d9f[_0xb5e7('0x66')];_0x3c1745[_0xb5e7('0x67')]=isNaN(_0x544d9f['channelCount'])?null:_0x544d9f[_0xb5e7('0x68')];_0x3c1745['original_bitRate']=isNaN(_0x544d9f['bitRate'])?null:_0x544d9f['bitRate'];_0x3c1745[_0xb5e7('0x69')]=isNaN(_0x544d9f[_0xb5e7('0x6a')])?null:_0x544d9f['sampleRate'];});_0x97abcf['on'](_0xb5e7('0x6b'),function(_0x21a932){_0x3c1745[_0xb5e7('0x6c')]=isNaN(_0x21a932[_0xb5e7('0x64')])?null:_0x21a932['duration']*0x3e8;_0x3c1745[_0xb5e7('0x6d')]=isNaN(_0x21a932[_0xb5e7('0x66')])?null:_0x21a932[_0xb5e7('0x66')];_0x3c1745[_0xb5e7('0x6e')]=isNaN(_0x21a932[_0xb5e7('0x68')])?null:_0x21a932[_0xb5e7('0x68')];_0x3c1745[_0xb5e7('0x6f')]=isNaN(_0x21a932[_0xb5e7('0x70')])?null:_0x21a932['bitRate'];_0x3c1745[_0xb5e7('0x71')]=isNaN(_0x21a932['sampleRate'])?null:_0x21a932['sampleRate'];});_0x97abcf['on']('end',function(){fs[_0xb5e7('0x60')](_0x2d33e0,parseInt(_0xb5e7('0x72'),0x8));return db[_0xb5e7('0x30')]['create'](_0x3c1745)[_0xb5e7('0x25')](function(_0x502e91){var _0x40abc3={'role':_0x22561d[_0xb5e7('0x73')][_0xb5e7('0x74')],'userProfileId':_0x22561d[_0xb5e7('0x73')][_0xb5e7('0x75')]};if(!_0x40abc3)throw new Error(_0xb5e7('0x76'));if(_0x40abc3[_0xb5e7('0x74')]===_0xb5e7('0x77')){var _0x179995=_0x502e91[_0xb5e7('0x78')]({'plain':!![]});return db[_0xb5e7('0x79')][_0xb5e7('0x4a')]({'where':{'name':_0xb5e7('0x27'),'userProfileId':_0x40abc3[_0xb5e7('0x75')]},'raw':!![]})['then'](function(_0x4bac59){if(_0x4bac59&&_0x4bac59[_0xb5e7('0x7a')]===0x0){return db[_0xb5e7('0x28')][_0xb5e7('0x56')]({'name':_0x179995[_0xb5e7('0x2c')],'resourceId':_0x179995['id'],'type':_0x4bac59[_0xb5e7('0x2c')],'sectionId':_0x4bac59['id']},{})[_0xb5e7('0x25')](function(){return _0x502e91;});}else{return _0x502e91;}})[_0xb5e7('0x46')](function(_0x19b724){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19b724);throw _0x19b724;});}return _0x502e91;})[_0xb5e7('0x25')](respondWithResult(_0x26cd19,null))[_0xb5e7('0x46')](handleError(_0x26cd19,null));});_0x97abcf['start']();}catch(_0x2fe68c){_0x26cd19['status'](0x1f4)['send'](_0x2fe68c);}};exports[_0xb5e7('0x24')]=function(_0x83e877,_0x655156,_0xfc7d45){return db['Sound'][_0xb5e7('0x4a')]({'where':{'id':_0x83e877[_0xb5e7('0x48')]['id']}})['then'](handleEntityNotFound(_0x655156,null))[_0xb5e7('0x25')](saveUpdates(_['pick'](_0x83e877[_0xb5e7('0x73')],['name',_0xb5e7('0x7b')]),null))['then'](respondWithResult(_0x655156,null))[_0xb5e7('0x46')](handleError(_0x655156,null));};exports[_0xb5e7('0x7c')]=function(_0x5e4aff,_0x3e4adb,_0x5bb3dc){return db[_0xb5e7('0x30')]['find']({'where':{'id':_0x5e4aff[_0xb5e7('0x48')]['id']}})[_0xb5e7('0x25')](function(_0x121f67){if(_0x121f67){return _0x121f67[_0xb5e7('0x26')]();}})['then'](function(_0x30e096){var _0x5ada29=path[_0xb5e7('0x4f')](config[_0xb5e7('0x50')],'server/files/sounds/original',util[_0xb5e7('0x55')](_0xb5e7('0x54'),_0x30e096[_0xb5e7('0x4c')],_0x30e096[_0xb5e7('0x7d')]));var _0x2ad7b0=path[_0xb5e7('0x4f')](config[_0xb5e7('0x50')],'server/files/sounds/converted',util[_0xb5e7('0x55')](_0xb5e7('0x54'),_0x30e096[_0xb5e7('0x4c')],_0x30e096[_0xb5e7('0x4d')]));fs[_0xb5e7('0x62')](_0x5ada29);fs[_0xb5e7('0x62')](_0x2ad7b0);return _0x30e096;})[_0xb5e7('0x25')](function(_0x155ebd){if(_0x155ebd){return _0x3e4adb[_0xb5e7('0x1b')](0xcc)['end']();}})[_0xb5e7('0x25')](handleEntityNotFound(_0x3e4adb,null))['catch'](handleError(_0x3e4adb,null));};
\ No newline at end of file
+var _0x84bc=['description','delete','unlinkSync','eml-format','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/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Sound','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','params','rawAttributes','length','download','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','extname','originalname','filename','substring','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','body'];(function(_0x567989,_0x5aa3f6){var _0x8f5ba6=function(_0x4c1784){while(--_0x4c1784){_0x567989['push'](_0x567989['shift']());}};_0x8f5ba6(++_0x5aa3f6);}(_0x84bc,0x81));var _0xc84b=function(_0x15734d,_0x39f330){_0x15734d=_0x15734d-0x0;var _0x5b48db=_0x84bc[_0x15734d];return _0x5b48db;};'use strict';var emlformat=require(_0xc84b('0x0'));var rimraf=require(_0xc84b('0x1'));var zipdir=require(_0xc84b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc84b('0x3'));var moment=require(_0xc84b('0x4'));var BPromise=require(_0xc84b('0x5'));var Mustache=require(_0xc84b('0x6'));var util=require(_0xc84b('0x7'));var path=require('path');var sox=require(_0xc84b('0x8'));var csv=require(_0xc84b('0x9'));var ejs=require(_0xc84b('0xa'));var fs=require('fs');var fs_extra=require(_0xc84b('0xb'));var _=require(_0xc84b('0xc'));var squel=require(_0xc84b('0xd'));var crypto=require(_0xc84b('0xe'));var jsforce=require(_0xc84b('0xf'));var deskjs=require(_0xc84b('0x10'));var toCsv=require(_0xc84b('0x9'));var querystring=require(_0xc84b('0x11'));var Papa=require(_0xc84b('0x12'));var Redis=require(_0xc84b('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc84b('0x14'));var hardwareService=require(_0xc84b('0x15'));var logger=require(_0xc84b('0x16'))(_0xc84b('0x17'));var utils=require(_0xc84b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc84b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fef8,_0x1a5e90){_0x1a5e90=_0x1a5e90||0xcc;return function(_0x67b256){if(_0x67b256){return _0x44fef8['sendStatus'](_0x1a5e90);}return _0x44fef8[_0xc84b('0x1a')](_0x1a5e90)[_0xc84b('0x1b')]();};}function respondWithResult(_0xc5421f,_0x314710){_0x314710=_0x314710||0xc8;return function(_0x9a68f9){if(_0x9a68f9){return _0xc5421f['status'](_0x314710)[_0xc84b('0x1c')](_0x9a68f9);}};}function respondWithFilteredResult(_0x11cde3,_0x5adb5a){return function(_0x1ea658){if(_0x1ea658){var _0x338577=typeof _0x5adb5a[_0xc84b('0x1d')]===_0xc84b('0x1e')&&typeof _0x5adb5a['limit']===_0xc84b('0x1e');var _0x4dd087=_0x1ea658[_0xc84b('0x1f')];var _0xc42bde=_0x338577?0x0:_0x5adb5a[_0xc84b('0x1d')];var _0x5909dc=_0x338577?_0x1ea658[_0xc84b('0x1f')]:_0x5adb5a['offset']+_0x5adb5a[_0xc84b('0x20')];var _0x4a0321;if(_0x5909dc>=_0x4dd087){_0x5909dc=_0x4dd087;_0x4a0321=0xc8;}else{_0x4a0321=0xce;}_0x11cde3[_0xc84b('0x1a')](_0x4a0321);return _0x11cde3[_0xc84b('0x21')](_0xc84b('0x22'),_0xc42bde+'-'+_0x5909dc+'/'+_0x4dd087)[_0xc84b('0x1c')](_0x1ea658);}return null;};}function patchUpdates(_0x474c03){return function(_0x4ba864){try{jsonpatch['apply'](_0x4ba864,_0x474c03,!![]);}catch(_0x4cf2fb){return BPromise[_0xc84b('0x23')](_0x4cf2fb);}return _0x4ba864[_0xc84b('0x24')]();};}function saveUpdates(_0x589239,_0x40feae){return function(_0x19c60c){if(_0x19c60c){return _0x19c60c['update'](_0x589239)['then'](function(_0x5f484d){return _0x5f484d;});}return null;};}function removeEntity(_0x3e0a2b,_0x1b0460){return function(_0x370b4b){if(_0x370b4b){return _0x370b4b[_0xc84b('0x25')]()[_0xc84b('0x26')](function(){var _0x205bfe=_0x370b4b[_0xc84b('0x27')]({'plain':!![]});var _0xceed01='Sounds';return db[_0xc84b('0x28')]['destroy']({'where':{'type':_0xceed01,'resourceId':_0x205bfe['id']}})[_0xc84b('0x26')](function(){return _0x370b4b;});})['then'](function(){_0x3e0a2b[_0xc84b('0x1a')](0xcc)[_0xc84b('0x1b')]();});}};}function handleEntityNotFound(_0x5273ca,_0x3acd8e){return function(_0x285438){if(!_0x285438){_0x5273ca[_0xc84b('0x29')](0x194);}return _0x285438;};}function handleError(_0x51bd09,_0x416b14){_0x416b14=_0x416b14||0x1f4;return function(_0xcdbfe0){logger[_0xc84b('0x2a')](_0xcdbfe0[_0xc84b('0x2b')]);if(_0xcdbfe0[_0xc84b('0x2c')]){delete _0xcdbfe0[_0xc84b('0x2c')];}_0x51bd09['status'](_0x416b14)[_0xc84b('0x2d')](_0xcdbfe0);};}exports[_0xc84b('0x2e')]=function(_0x1dc0ed,_0x2f0226){var _0x23c600={},_0x7390b4={},_0x34c409={'count':0x0,'rows':[]};var _0x5533de=_[_0xc84b('0x2f')](db[_0xc84b('0x30')]['rawAttributes'],function(_0x518a42){return{'name':_0x518a42[_0xc84b('0x31')],'type':_0x518a42[_0xc84b('0x32')]['key']};});_0x7390b4[_0xc84b('0x33')]=_['map'](_0x5533de,'name');_0x7390b4[_0xc84b('0x34')]=_[_0xc84b('0x35')](_0x1dc0ed['query']);_0x7390b4[_0xc84b('0x36')]=_[_0xc84b('0x37')](_0x7390b4['model'],_0x7390b4[_0xc84b('0x34')]);_0x23c600[_0xc84b('0x38')]=_['intersection'](_0x7390b4[_0xc84b('0x33')],qs[_0xc84b('0x39')](_0x1dc0ed[_0xc84b('0x34')]['fields']));_0x23c600['attributes']=_0x23c600[_0xc84b('0x38')]['length']?_0x23c600[_0xc84b('0x38')]:_0x7390b4[_0xc84b('0x33')];if(!_0x1dc0ed[_0xc84b('0x34')][_0xc84b('0x3a')](_0xc84b('0x3b'))){_0x23c600['limit']=qs[_0xc84b('0x20')](_0x1dc0ed[_0xc84b('0x34')][_0xc84b('0x20')]);_0x23c600['offset']=qs[_0xc84b('0x1d')](_0x1dc0ed[_0xc84b('0x34')][_0xc84b('0x1d')]);}_0x23c600['order']=qs['sort'](_0x1dc0ed['query'][_0xc84b('0x3c')]);_0x23c600['where']=qs['filters'](_[_0xc84b('0x3d')](_0x1dc0ed[_0xc84b('0x34')],_0x7390b4[_0xc84b('0x36')]),_0x5533de);if(_0x1dc0ed[_0xc84b('0x34')][_0xc84b('0x3e')]){_0x23c600[_0xc84b('0x3f')]=_['merge'](_0x23c600[_0xc84b('0x3f')],{'$or':_[_0xc84b('0x2f')](_0x5533de,function(_0x153859){if(_0x153859[_0xc84b('0x32')]!==_0xc84b('0x40')){var _0x335069={};_0x335069[_0x153859[_0xc84b('0x2c')]]={'$like':'%'+_0x1dc0ed[_0xc84b('0x34')][_0xc84b('0x3e')]+'%'};return _0x335069;}})});}_0x23c600=_[_0xc84b('0x41')]({},_0x23c600,_0x1dc0ed[_0xc84b('0x42')]);var _0x51ef1d={'where':_0x23c600[_0xc84b('0x3f')]};return db[_0xc84b('0x30')]['count'](_0x51ef1d)[_0xc84b('0x26')](function(_0x45cde5){_0x34c409[_0xc84b('0x1f')]=_0x45cde5;if(_0x1dc0ed[_0xc84b('0x34')]['includeAll']){_0x23c600[_0xc84b('0x43')]=[{'all':!![]}];}return db[_0xc84b('0x30')][_0xc84b('0x44')](_0x23c600);})[_0xc84b('0x26')](function(_0x2d7dce){_0x34c409['rows']=_0x2d7dce;return _0x34c409;})[_0xc84b('0x26')](respondWithFilteredResult(_0x2f0226,_0x23c600))[_0xc84b('0x45')](handleError(_0x2f0226,null));};exports['show']=function(_0x202912,_0x1e585e){var _0x13f19e={'raw':!![],'where':{'id':_0x202912[_0xc84b('0x46')]['id']}},_0x3e3f89={};_0x3e3f89[_0xc84b('0x33')]=_[_0xc84b('0x35')](db[_0xc84b('0x30')][_0xc84b('0x47')]);_0x3e3f89[_0xc84b('0x34')]=_[_0xc84b('0x35')](_0x202912[_0xc84b('0x34')]);_0x3e3f89[_0xc84b('0x36')]=_[_0xc84b('0x37')](_0x3e3f89[_0xc84b('0x33')],_0x3e3f89[_0xc84b('0x34')]);_0x13f19e[_0xc84b('0x38')]=_['intersection'](_0x3e3f89[_0xc84b('0x33')],qs[_0xc84b('0x39')](_0x202912[_0xc84b('0x34')][_0xc84b('0x39')]));_0x13f19e[_0xc84b('0x38')]=_0x13f19e[_0xc84b('0x38')][_0xc84b('0x48')]?_0x13f19e[_0xc84b('0x38')]:_0x3e3f89[_0xc84b('0x33')];if(_0x202912[_0xc84b('0x34')]['includeAll']){_0x13f19e[_0xc84b('0x43')]=[{'all':!![]}];}_0x13f19e=_[_0xc84b('0x41')]({},_0x13f19e,_0x202912['options']);return db[_0xc84b('0x30')]['find'](_0x13f19e)['then'](handleEntityNotFound(_0x1e585e,null))[_0xc84b('0x26')](respondWithResult(_0x1e585e,null))['catch'](handleError(_0x1e585e,null));};exports[_0xc84b('0x49')]=function(_0x5485ef,_0x10a8b7,_0x5564f3){return db['Sound'][_0xc84b('0x4a')]({'where':{'id':_0x5485ef[_0xc84b('0x46')]['id']},'attributes':[_0xc84b('0x2c'),_0xc84b('0x4b'),_0xc84b('0x4c')],'raw':!![]})[_0xc84b('0x26')](handleEntityNotFound(_0x10a8b7,null))[_0xc84b('0x26')](function(_0x388dcf){if(_0x388dcf){if(!fs[_0xc84b('0x4d')](path[_0xc84b('0x4e')](config[_0xc84b('0x4f')],_0xc84b('0x50'),_0x388dcf[_0xc84b('0x4b')]+'.'+_0x388dcf[_0xc84b('0x4c')]))){throw new db[(_0xc84b('0x51'))][(_0xc84b('0x52'))](_0xc84b('0x53'));}return _0x10a8b7[_0xc84b('0x49')](path['join'](config[_0xc84b('0x4f')],'server/files/sounds/converted',util[_0xc84b('0x54')](_0xc84b('0x55'),_0x388dcf[_0xc84b('0x4b')],_0x388dcf['converted_format'])),util[_0xc84b('0x54')](_0xc84b('0x55'),_0x388dcf['name'],_0x388dcf[_0xc84b('0x4c')]));}return null;})['catch'](handleError(_0x10a8b7,null));};exports[_0xc84b('0x56')]=function(_0x18c80c,_0x127536,_0xe9397b){var _0x331285={'name':path[_0xc84b('0x57')](_0x18c80c[_0xc84b('0x58')]['originalname'],path[_0xc84b('0x59')](_0x18c80c[_0xc84b('0x58')][_0xc84b('0x5a')])),'save_name':path['basename'](_0x18c80c['file'][_0xc84b('0x5b')],path['extname'](_0x18c80c[_0xc84b('0x58')][_0xc84b('0x5b')])),'original_format':path[_0xc84b('0x59')](_0x18c80c['file']['originalname'])[_0xc84b('0x5c')](0x1),'converted_format':'wav'};var _0x165799=path['join'](config['root'],_0xc84b('0x5d'),_0x18c80c[_0xc84b('0x58')]['filename']);var _0x3c48ed=path['join'](config[_0xc84b('0x4f')],_0xc84b('0x50'),util['format'](_0xc84b('0x55'),path[_0xc84b('0x57')](_0x18c80c['file'][_0xc84b('0x5b')],path[_0xc84b('0x59')](_0x18c80c['file']['filename'])),_0x331285['converted_format']));logger['info'](_0xc84b('0x5e'),_0x165799);logger[_0xc84b('0x5f')](_0xc84b('0x60'),_0x3c48ed);try{fs[_0xc84b('0x61')](_0x165799,parseInt(_0xc84b('0x62'),0x8));var _0x498a67=sox[_0xc84b('0x63')](_0x165799,_0x3c48ed,{'sampleRate':0x1f40,'format':_0xc84b('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x498a67['on']('error',function(_0x2de025){fs['unlinkSync'](_0x165799);_0x127536[_0xc84b('0x1a')](0x1f4)['send'](_0x2de025);});_0x498a67['on'](_0xc84b('0x65'),function(_0x26ade2){_0x331285['original_duration']=isNaN(_0x26ade2[_0xc84b('0x66')])?null:_0x26ade2[_0xc84b('0x66')]*0x3e8;_0x331285[_0xc84b('0x67')]=isNaN(_0x26ade2[_0xc84b('0x68')])?null:_0x26ade2['sampleCount'];_0x331285[_0xc84b('0x69')]=isNaN(_0x26ade2['channelCount'])?null:_0x26ade2[_0xc84b('0x6a')];_0x331285[_0xc84b('0x6b')]=isNaN(_0x26ade2[_0xc84b('0x6c')])?null:_0x26ade2['bitRate'];_0x331285['original_sampleRate']=isNaN(_0x26ade2[_0xc84b('0x6d')])?null:_0x26ade2[_0xc84b('0x6d')];});_0x498a67['on'](_0xc84b('0x6e'),function(_0x12df5e){_0x331285['converted_duration']=isNaN(_0x12df5e[_0xc84b('0x66')])?null:_0x12df5e['duration']*0x3e8;_0x331285[_0xc84b('0x6f')]=isNaN(_0x12df5e[_0xc84b('0x68')])?null:_0x12df5e[_0xc84b('0x68')];_0x331285[_0xc84b('0x70')]=isNaN(_0x12df5e[_0xc84b('0x6a')])?null:_0x12df5e[_0xc84b('0x6a')];_0x331285[_0xc84b('0x71')]=isNaN(_0x12df5e[_0xc84b('0x6c')])?null:_0x12df5e[_0xc84b('0x6c')];_0x331285['converted_sampleRate']=isNaN(_0x12df5e['sampleRate'])?null:_0x12df5e['sampleRate'];});_0x498a67['on']('end',function(){fs['chmodSync'](_0x3c48ed,parseInt(_0xc84b('0x62'),0x8));return db[_0xc84b('0x30')][_0xc84b('0x56')](_0x331285)['then'](function(_0xcfc9ce){var _0x201681={'role':_0x18c80c['body']['role'],'userProfileId':_0x18c80c['body']['userProfileId']};if(!_0x201681)throw new Error(_0xc84b('0x72'));if(_0x201681['role']===_0xc84b('0x73')){var _0x224f7e=_0xcfc9ce[_0xc84b('0x27')]({'plain':!![]});return db[_0xc84b('0x74')][_0xc84b('0x4a')]({'where':{'name':_0xc84b('0x75'),'userProfileId':_0x201681[_0xc84b('0x76')]},'raw':!![]})[_0xc84b('0x26')](function(_0x3af0a2){if(_0x3af0a2&&_0x3af0a2[_0xc84b('0x77')]===0x0){return db[_0xc84b('0x28')][_0xc84b('0x56')]({'name':_0x224f7e[_0xc84b('0x2c')],'resourceId':_0x224f7e['id'],'type':_0x3af0a2[_0xc84b('0x2c')],'sectionId':_0x3af0a2['id']},{})[_0xc84b('0x26')](function(){return _0xcfc9ce;});}else{return _0xcfc9ce;}})['catch'](function(_0x19acac){logger[_0xc84b('0x2a')](_0xc84b('0x78'),_0x19acac);throw _0x19acac;});}return _0xcfc9ce;})[_0xc84b('0x26')](respondWithResult(_0x127536,null))[_0xc84b('0x45')](handleError(_0x127536,null));});_0x498a67[_0xc84b('0x79')]();}catch(_0x2047c2){_0x127536[_0xc84b('0x1a')](0x1f4)[_0xc84b('0x2d')](_0x2047c2);}};exports['update']=function(_0xdc235f,_0x2132a4,_0x774529){return db[_0xc84b('0x30')][_0xc84b('0x4a')]({'where':{'id':_0xdc235f[_0xc84b('0x46')]['id']}})['then'](handleEntityNotFound(_0x2132a4,null))[_0xc84b('0x26')](saveUpdates(_[_0xc84b('0x3d')](_0xdc235f[_0xc84b('0x7a')],[_0xc84b('0x2c'),_0xc84b('0x7b')]),null))[_0xc84b('0x26')](respondWithResult(_0x2132a4,null))[_0xc84b('0x45')](handleError(_0x2132a4,null));};exports[_0xc84b('0x7c')]=function(_0x5429ba,_0x48997a,_0x2e067e){return db[_0xc84b('0x30')][_0xc84b('0x4a')]({'where':{'id':_0x5429ba[_0xc84b('0x46')]['id']}})[_0xc84b('0x26')](function(_0x3440e1){if(_0x3440e1){return _0x3440e1[_0xc84b('0x25')]();}})[_0xc84b('0x26')](function(_0x1ea857){var _0xfd76c5=path[_0xc84b('0x4e')](config[_0xc84b('0x4f')],_0xc84b('0x5d'),util[_0xc84b('0x54')](_0xc84b('0x55'),_0x1ea857[_0xc84b('0x4b')],_0x1ea857['original_format']));var _0x41c670=path[_0xc84b('0x4e')](config['root'],_0xc84b('0x50'),util[_0xc84b('0x54')]('%s.%s',_0x1ea857[_0xc84b('0x4b')],_0x1ea857['converted_format']));fs['unlinkSync'](_0xfd76c5);fs[_0xc84b('0x7d')](_0x41c670);return _0x1ea857;})[_0xc84b('0x26')](function(_0x187873){if(_0x187873){return _0x48997a[_0xc84b('0x1a')](0xcc)[_0xc84b('0x1b')]();}})[_0xc84b('0x26')](handleEntityNotFound(_0x48997a,null))[_0xc84b('0x45')](handleError(_0x48997a,null));};
\ No newline at end of file
index a97fe21..1569aa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5450=['request-promise','path','rimraf','../../config/environment','exports','define','Sound','tools_sounds','lodash','util','api','moment','bluebird'];(function(_0x50f157,_0x280833){var _0x7e0178=function(_0x14eaf1){while(--_0x14eaf1){_0x50f157['push'](_0x50f157['shift']());}};_0x7e0178(++_0x280833);}(_0x5450,0x1e9));var _0x0545=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5450[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x0545('0x0'));var util=require(_0x0545('0x1'));var logger=require('../../config/logger')(_0x0545('0x2'));var moment=require(_0x0545('0x3'));var BPromise=require(_0x0545('0x4'));var rp=require(_0x0545('0x5'));var fs=require('fs');var path=require(_0x0545('0x6'));var rimraf=require(_0x0545('0x7'));var config=require(_0x0545('0x8'));var attributes=require('./sound.attributes');module[_0x0545('0x9')]=function(_0x24b734,_0x306130){return _0x24b734[_0x0545('0xa')](_0x0545('0xb'),attributes,{'tableName':_0x0545('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb3ba=['exports','Sound','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./sound.attributes'];(function(_0x589f2c,_0x145b0c){var _0x585218=function(_0x3bb2bf){while(--_0x3bb2bf){_0x589f2c['push'](_0x589f2c['shift']());}};_0x585218(++_0x145b0c);}(_0xb3ba,0xb6));var _0xab3b=function(_0x556e78,_0x3912c7){_0x556e78=_0x556e78-0x0;var _0x113340=_0xb3ba[_0x556e78];return _0x113340;};'use strict';var _=require(_0xab3b('0x0'));var util=require(_0xab3b('0x1'));var logger=require(_0xab3b('0x2'))(_0xab3b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab3b('0x4'));var fs=require('fs');var path=require(_0xab3b('0x5'));var rimraf=require('rimraf');var config=require(_0xab3b('0x6'));var attributes=require(_0xab3b('0x7'));module[_0xab3b('0x8')]=function(_0x488550,_0x1775ea){return _0x488550['define'](_0xab3b('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f45d8e7..36f78e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6177=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','where','attributes','include','map','model','lodash'];(function(_0x296ed0,_0x12f91c){var _0x5dcacb=function(_0x193624){while(--_0x193624){_0x296ed0['push'](_0x296ed0['shift']());}};_0x5dcacb(++_0x12f91c);}(_0x6177,0x1ee));var _0x7617=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6177[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x7617('0x0'));var util=require(_0x7617('0x1'));var moment=require(_0x7617('0x2'));var BPromise=require(_0x7617('0x3'));var rs=require(_0x7617('0x4'));var fs=require('fs');var Redis=require(_0x7617('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7617('0x6'))(_0x7617('0x7'));var config=require(_0x7617('0x8'));var jayson=require(_0x7617('0x9'));var client=jayson[_0x7617('0xa')][_0x7617('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb4539f,_0x2e5548,_0x5a737a){return new BPromise(function(_0x1ad1fd,_0x59d217){return client['request'](_0xb4539f,_0x5a737a)[_0x7617('0xc')](function(_0x4eca0c){logger[_0x7617('0xd')]('Sound,\x20%s,\x20%s',_0x2e5548,_0x7617('0xe'));logger[_0x7617('0xf')](_0x7617('0x10'),_0x2e5548,_0x7617('0xe'),JSON[_0x7617('0x11')](_0x4eca0c));if(_0x4eca0c['error']){if(_0x4eca0c[_0x7617('0x12')][_0x7617('0x13')]===0x1f4){logger[_0x7617('0x12')](_0x7617('0x14'),_0x2e5548,_0x4eca0c[_0x7617('0x12')][_0x7617('0x15')]);return _0x59d217(_0x4eca0c[_0x7617('0x12')][_0x7617('0x15')]);}logger['error'](_0x7617('0x14'),_0x2e5548,_0x4eca0c['error']['message']);return _0x1ad1fd(_0x4eca0c['error'][_0x7617('0x15')]);}else{logger[_0x7617('0xd')](_0x7617('0x14'),_0x2e5548,_0x7617('0xe'));_0x1ad1fd(_0x4eca0c[_0x7617('0x16')][_0x7617('0x15')]);}})[_0x7617('0x17')](function(_0x111099){logger[_0x7617('0x12')]('Sound,\x20%s,\x20%s',_0x2e5548,_0x111099);_0x59d217(_0x111099);});});}exports[_0x7617('0x18')]=function(_0x161273){var _0x4c59d0=this;return new Promise(function(_0x30f9dd,_0x513ac4){return db[_0x7617('0x19')][_0x7617('0x1a')]({'raw':_0x161273[_0x7617('0x1b')]?_0x161273['options']['raw']===undefined?!![]:![]:!![],'where':_0x161273['options']?_0x161273['options'][_0x7617('0x1c')]||null:null,'attributes':_0x161273[_0x7617('0x1b')]?_0x161273['options'][_0x7617('0x1d')]||null:null,'include':_0x161273['options']?_0x161273[_0x7617('0x1b')][_0x7617('0x1e')]?_[_0x7617('0x1f')](_0x161273['options']['include'],function(_0x4408eb){return{'model':db[_0x4408eb[_0x7617('0x20')]],'as':_0x4408eb['as'],'attributes':_0x4408eb['attributes'],'include':_0x4408eb[_0x7617('0x1e')]?_['map'](_0x4408eb[_0x7617('0x1e')],function(_0x112128){return{'model':db[_0x112128['model']],'as':_0x112128['as'],'attributes':_0x112128['attributes'],'include':_0x112128['include']?_['map'](_0x112128['include'],function(_0x4bc957){return{'model':db[_0x4bc957[_0x7617('0x20')]],'as':_0x4bc957['as'],'attributes':_0x4bc957[_0x7617('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1018ea){logger['info'](_0x7617('0x18'),_0x161273);logger['debug']('ShowSound',_0x161273,JSON[_0x7617('0x11')](_0x1018ea));_0x30f9dd(_0x1018ea);})['catch'](function(_0x45b484){logger[_0x7617('0x12')](_0x7617('0x18'),_0x45b484[_0x7617('0x15')],_0x161273);_0x513ac4(_0x4c59d0[_0x7617('0x12')](0x1f4,_0x45b484[_0x7617('0x15')]));});});};
\ No newline at end of file
+var _0x0c75=['http','request','then','info','request\x20sent','debug','stringify','code','error','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x1c620a,_0x13eff2){var _0x328a7b=function(_0x4dabde){while(--_0x4dabde){_0x1c620a['push'](_0x1c620a['shift']());}};_0x328a7b(++_0x13eff2);}(_0x0c75,0x156));var _0x50c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c75[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x50c7('0x0'));var moment=require(_0x50c7('0x1'));var BPromise=require(_0x50c7('0x2'));var rs=require(_0x50c7('0x3'));var fs=require('fs');var Redis=require(_0x50c7('0x4'));var db=require(_0x50c7('0x5'))['db'];var utils=require(_0x50c7('0x6'));var logger=require(_0x50c7('0x7'))('rpc');var config=require(_0x50c7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x50c7('0x9')][_0x50c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c70da,_0x2735cc,_0x4ab1bb){return new BPromise(function(_0x2f7cc5,_0x1bc2ea){return client[_0x50c7('0xb')](_0x4c70da,_0x4ab1bb)[_0x50c7('0xc')](function(_0x2e21c9){logger[_0x50c7('0xd')]('Sound,\x20%s,\x20%s',_0x2735cc,_0x50c7('0xe'));logger[_0x50c7('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x2735cc,_0x50c7('0xe'),JSON[_0x50c7('0x10')](_0x2e21c9));if(_0x2e21c9['error']){if(_0x2e21c9['error'][_0x50c7('0x11')]===0x1f4){logger[_0x50c7('0x12')](_0x50c7('0x13'),_0x2735cc,_0x2e21c9[_0x50c7('0x12')][_0x50c7('0x14')]);return _0x1bc2ea(_0x2e21c9[_0x50c7('0x12')][_0x50c7('0x14')]);}logger[_0x50c7('0x12')](_0x50c7('0x13'),_0x2735cc,_0x2e21c9['error'][_0x50c7('0x14')]);return _0x2f7cc5(_0x2e21c9[_0x50c7('0x12')][_0x50c7('0x14')]);}else{logger[_0x50c7('0xd')]('Sound,\x20%s,\x20%s',_0x2735cc,_0x50c7('0xe'));_0x2f7cc5(_0x2e21c9[_0x50c7('0x15')]['message']);}})[_0x50c7('0x16')](function(_0x2f1460){logger[_0x50c7('0x12')](_0x50c7('0x13'),_0x2735cc,_0x2f1460);_0x1bc2ea(_0x2f1460);});});}exports[_0x50c7('0x17')]=function(_0x2ac57e){var _0x5e0217=this;return new Promise(function(_0x3632d8,_0x5781c8){return db['Sound'][_0x50c7('0x18')]({'raw':_0x2ac57e[_0x50c7('0x19')]?_0x2ac57e[_0x50c7('0x19')][_0x50c7('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ac57e['options']?_0x2ac57e['options'][_0x50c7('0x1b')]||null:null,'attributes':_0x2ac57e[_0x50c7('0x19')]?_0x2ac57e[_0x50c7('0x19')][_0x50c7('0x1c')]||null:null,'include':_0x2ac57e[_0x50c7('0x19')]?_0x2ac57e[_0x50c7('0x19')][_0x50c7('0x1d')]?_[_0x50c7('0x1e')](_0x2ac57e[_0x50c7('0x19')][_0x50c7('0x1d')],function(_0x43774e){return{'model':db[_0x43774e[_0x50c7('0x1f')]],'as':_0x43774e['as'],'attributes':_0x43774e[_0x50c7('0x1c')],'include':_0x43774e[_0x50c7('0x1d')]?_[_0x50c7('0x1e')](_0x43774e[_0x50c7('0x1d')],function(_0x3e6d1d){return{'model':db[_0x3e6d1d[_0x50c7('0x1f')]],'as':_0x3e6d1d['as'],'attributes':_0x3e6d1d['attributes'],'include':_0x3e6d1d[_0x50c7('0x1d')]?_['map'](_0x3e6d1d[_0x50c7('0x1d')],function(_0x473b1f){return{'model':db[_0x473b1f[_0x50c7('0x1f')]],'as':_0x473b1f['as'],'attributes':_0x473b1f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x333c87){logger[_0x50c7('0xd')](_0x50c7('0x17'),_0x2ac57e);logger[_0x50c7('0xf')]('ShowSound',_0x2ac57e,JSON[_0x50c7('0x10')](_0x333c87));_0x3632d8(_0x333c87);})[_0x50c7('0x16')](function(_0x2764fe){logger[_0x50c7('0x12')](_0x50c7('0x17'),_0x2764fe['message'],_0x2ac57e);_0x5781c8(_0x5e0217[_0x50c7('0x12')](0x1f4,_0x2764fe[_0x50c7('0x14')]));});});};
\ No newline at end of file
index a9550d4..dc54b28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0xb4ec3a,_0x2bace0){var _0x1b83db=function(_0x5278f3){while(--_0x5278f3){_0xb4ec3a['push'](_0xb4ec3a['shift']());}};_0x1b83db(++_0x2bace0);}(_0x4fc2,0x111));var _0x24fc=function(_0x35a76f,_0x158af7){_0x35a76f=_0x35a76f-0x0;var _0x184f62=_0x4fc2[_0x35a76f];return _0x184f62;};'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')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router;
\ No newline at end of file
+var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x3c3195,_0x595377){var _0x2ee24e=function(_0x1e9457){while(--_0x1e9457){_0x3c3195['push'](_0x3c3195['shift']());}};_0x2ee24e(++_0x595377);}(_0xda2d,0x102));var _0xdda2=function(_0x121cac,_0x26e1c0){_0x121cac=_0x121cac-0x0;var _0x3c87a2=_0xda2d[_0x121cac];return _0x3c87a2;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router;
\ No newline at end of file
index 9dab148..8011d2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d63=['exports','STRING','TEXT','ENUM','out'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d63,0x186));var _0x33d6=function(_0x35cad6,_0x7ac9bb){_0x35cad6=_0x35cad6-0x0;var _0x3a39bf=_0x3d63[_0x35cad6];return _0x3a39bf;};'use strict';var Sequelize=require('sequelize');module[_0x33d6('0x0')]={'uniqueid':{'type':Sequelize[_0x33d6('0x1')]},'body':{'type':Sequelize[_0x33d6('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x33d6('0x3')]('in',_0x33d6('0x4')),'defaultValue':_0x33d6('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x33d6('0x1')]},'providerResponse':{'type':Sequelize[_0x33d6('0x2')]}};
\ No newline at end of file
+var _0x761e=['STRING','exports','TEXT','ENUM','out'];(function(_0x168ab2,_0x15e8b2){var _0x5750cf=function(_0x1a3767){while(--_0x1a3767){_0x168ab2['push'](_0x168ab2['shift']());}};_0x5750cf(++_0x15e8b2);}(_0x761e,0x6a));var _0xe761=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x761e[_0x336376];return _0x1d2a8e;};'use strict';var Sequelize=require('sequelize');module[_0xe761('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xe761('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xe761('0x2')]('in',_0xe761('0x3')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xe761('0x4')]},'providerResponse':{'type':Sequelize[_0xe761('0x1')]}};
\ No newline at end of file
index 4b12816..32240d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1573=['then','error','stack','name','index','SquareMessage','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','update','body','find','params','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save'];(function(_0x7e39f7,_0x1d3097){var _0x344a50=function(_0x512ae2){while(--_0x512ae2){_0x7e39f7['push'](_0x7e39f7['shift']());}};_0x344a50(++_0x1d3097);}(_0x1573,0x193));var _0x3157=function(_0x374954,_0x18dc36){_0x374954=_0x374954-0x0;var _0x42073e=_0x1573[_0x374954];return _0x42073e;};'use strict';var emlformat=require(_0x3157('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3157('0x1'));var rp=require(_0x3157('0x2'));var moment=require(_0x3157('0x3'));var BPromise=require(_0x3157('0x4'));var Mustache=require(_0x3157('0x5'));var util=require(_0x3157('0x6'));var path=require(_0x3157('0x7'));var sox=require(_0x3157('0x8'));var csv=require(_0x3157('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3157('0xa'));var squel=require('squel');var crypto=require(_0x3157('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3157('0xc'));var toCsv=require(_0x3157('0x9'));var querystring=require(_0x3157('0xd'));var Papa=require(_0x3157('0xe'));var Redis=require(_0x3157('0xf'));var authService=require(_0x3157('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3157('0x11'));var hardwareService=require(_0x3157('0x12'));var logger=require(_0x3157('0x13'))(_0x3157('0x14'));var utils=require(_0x3157('0x15'));var config=require(_0x3157('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3157('0x17'))['db'];function respondWithStatusCode(_0x112b9a,_0xd4925c){_0xd4925c=_0xd4925c||0xcc;return function(_0x3ec9d8){if(_0x3ec9d8){return _0x112b9a[_0x3157('0x18')](_0xd4925c);}return _0x112b9a['status'](_0xd4925c)[_0x3157('0x19')]();};}function respondWithResult(_0x448132,_0x436777){_0x436777=_0x436777||0xc8;return function(_0x2441be){if(_0x2441be){return _0x448132[_0x3157('0x1a')](_0x436777)[_0x3157('0x1b')](_0x2441be);}};}function respondWithFilteredResult(_0x170f1c,_0x2bfcd6){return function(_0x1e81a9){if(_0x1e81a9){var _0xda6641=typeof _0x2bfcd6[_0x3157('0x1c')]===_0x3157('0x1d')&&typeof _0x2bfcd6[_0x3157('0x1e')]===_0x3157('0x1d');var _0x1eb7b9=_0x1e81a9['count'];var _0x340a31=_0xda6641?0x0:_0x2bfcd6[_0x3157('0x1c')];var _0x3d6da8=_0xda6641?_0x1e81a9[_0x3157('0x1f')]:_0x2bfcd6[_0x3157('0x1c')]+_0x2bfcd6[_0x3157('0x1e')];var _0x1eab91;if(_0x3d6da8>=_0x1eb7b9){_0x3d6da8=_0x1eb7b9;_0x1eab91=0xc8;}else{_0x1eab91=0xce;}_0x170f1c[_0x3157('0x1a')](_0x1eab91);return _0x170f1c['set'](_0x3157('0x20'),_0x340a31+'-'+_0x3d6da8+'/'+_0x1eb7b9)[_0x3157('0x1b')](_0x1e81a9);}return null;};}function patchUpdates(_0x21694f){return function(_0xf56a29){try{jsonpatch[_0x3157('0x21')](_0xf56a29,_0x21694f,!![]);}catch(_0x4c3fdb){return BPromise['reject'](_0x4c3fdb);}return _0xf56a29[_0x3157('0x22')]();};}function saveUpdates(_0x6ad8d1,_0xd993e4){return function(_0x169ea9){if(_0x169ea9){return _0x169ea9['update'](_0x6ad8d1)[_0x3157('0x23')](function(_0x2b7a25){return _0x2b7a25;});}return null;};}function removeEntity(_0x2022a3,_0x209aab){return function(_0x1ec3a5){if(_0x1ec3a5){return _0x1ec3a5['destroy']()['then'](function(){_0x2022a3[_0x3157('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d602d,_0x5cb853){return function(_0x30dc64){if(!_0x30dc64){_0x2d602d[_0x3157('0x18')](0x194);}return _0x30dc64;};}function handleError(_0x5cfbe6,_0x23fbda){_0x23fbda=_0x23fbda||0x1f4;return function(_0x4c8724){logger[_0x3157('0x24')](_0x4c8724[_0x3157('0x25')]);if(_0x4c8724[_0x3157('0x26')]){delete _0x4c8724[_0x3157('0x26')];}_0x5cfbe6[_0x3157('0x1a')](_0x23fbda)['send'](_0x4c8724);};}exports[_0x3157('0x27')]=function(_0x3c98e5,_0x1edbd3){var _0x8f78f0={},_0x388d8c={},_0x1542ef={'count':0x0,'rows':[]};var _0x234bf3=_['map'](db[_0x3157('0x28')]['rawAttributes'],function(_0x413798){return{'name':_0x413798['fieldName'],'type':_0x413798['type'][_0x3157('0x29')]};});_0x388d8c[_0x3157('0x2a')]=_['map'](_0x234bf3,'name');_0x388d8c[_0x3157('0x2b')]=_[_0x3157('0x2c')](_0x3c98e5[_0x3157('0x2b')]);_0x388d8c[_0x3157('0x2d')]=_['intersection'](_0x388d8c['model'],_0x388d8c[_0x3157('0x2b')]);_0x8f78f0[_0x3157('0x2e')]=_[_0x3157('0x2f')](_0x388d8c[_0x3157('0x2a')],qs[_0x3157('0x30')](_0x3c98e5[_0x3157('0x2b')][_0x3157('0x30')]));_0x8f78f0['attributes']=_0x8f78f0[_0x3157('0x2e')]['length']?_0x8f78f0[_0x3157('0x2e')]:_0x388d8c[_0x3157('0x2a')];if(!_0x3c98e5[_0x3157('0x2b')][_0x3157('0x31')](_0x3157('0x32'))){_0x8f78f0['limit']=qs[_0x3157('0x1e')](_0x3c98e5[_0x3157('0x2b')][_0x3157('0x1e')]);_0x8f78f0['offset']=qs[_0x3157('0x1c')](_0x3c98e5[_0x3157('0x2b')][_0x3157('0x1c')]);}_0x8f78f0[_0x3157('0x33')]=qs[_0x3157('0x34')](_0x3c98e5[_0x3157('0x2b')]['sort']);_0x8f78f0[_0x3157('0x35')]=qs[_0x3157('0x2d')](_[_0x3157('0x36')](_0x3c98e5[_0x3157('0x2b')],_0x388d8c[_0x3157('0x2d')]),_0x234bf3);if(_0x3c98e5[_0x3157('0x2b')][_0x3157('0x37')]){_0x8f78f0[_0x3157('0x35')]=_['merge'](_0x8f78f0[_0x3157('0x35')],{'$or':_[_0x3157('0x38')](_0x234bf3,function(_0x49b778){if(_0x49b778[_0x3157('0x39')]!=='VIRTUAL'){var _0x3c7588={};_0x3c7588[_0x49b778[_0x3157('0x26')]]={'$like':'%'+_0x3c98e5['query']['filter']+'%'};return _0x3c7588;}})});}_0x8f78f0=_[_0x3157('0x3a')]({},_0x8f78f0,_0x3c98e5[_0x3157('0x3b')]);var _0x544d06={'where':_0x8f78f0[_0x3157('0x35')]};return db[_0x3157('0x28')]['count'](_0x544d06)[_0x3157('0x23')](function(_0x33098c){_0x1542ef[_0x3157('0x1f')]=_0x33098c;if(_0x3c98e5[_0x3157('0x2b')][_0x3157('0x3c')]){_0x8f78f0['include']=[{'all':!![]}];}return db[_0x3157('0x28')][_0x3157('0x3d')](_0x8f78f0);})['then'](function(_0x2eb088){_0x1542ef[_0x3157('0x3e')]=_0x2eb088;return _0x1542ef;})[_0x3157('0x23')](respondWithFilteredResult(_0x1edbd3,_0x8f78f0))[_0x3157('0x3f')](handleError(_0x1edbd3,null));};exports[_0x3157('0x40')]=function(_0x513697,_0x15aa1a){var _0x178cea={'raw':!![],'where':{'id':_0x513697['params']['id']}},_0xf699ff={};_0xf699ff['model']=_[_0x3157('0x2c')](db[_0x3157('0x28')][_0x3157('0x41')]);_0xf699ff[_0x3157('0x2b')]=_[_0x3157('0x2c')](_0x513697[_0x3157('0x2b')]);_0xf699ff[_0x3157('0x2d')]=_[_0x3157('0x2f')](_0xf699ff['model'],_0xf699ff[_0x3157('0x2b')]);_0x178cea[_0x3157('0x2e')]=_[_0x3157('0x2f')](_0xf699ff[_0x3157('0x2a')],qs[_0x3157('0x30')](_0x513697[_0x3157('0x2b')][_0x3157('0x30')]));_0x178cea[_0x3157('0x2e')]=_0x178cea[_0x3157('0x2e')]['length']?_0x178cea[_0x3157('0x2e')]:_0xf699ff['model'];if(_0x513697[_0x3157('0x2b')][_0x3157('0x3c')]){_0x178cea[_0x3157('0x42')]=[{'all':!![]}];}_0x178cea=_['merge']({},_0x178cea,_0x513697['options']);return db[_0x3157('0x28')]['find'](_0x178cea)['then'](handleEntityNotFound(_0x15aa1a,null))['then'](respondWithResult(_0x15aa1a,null))[_0x3157('0x3f')](handleError(_0x15aa1a,null));};exports[_0x3157('0x43')]=function(_0xd5ab2b,_0x5b08fb){return db[_0x3157('0x28')]['create'](_0xd5ab2b['body'],{})['then'](respondWithResult(_0x5b08fb,0xc9))[_0x3157('0x3f')](handleError(_0x5b08fb,null));};exports[_0x3157('0x44')]=function(_0x3e81fd,_0x486031){if(_0x3e81fd[_0x3157('0x45')]['id']){delete _0x3e81fd[_0x3157('0x45')]['id'];}return db[_0x3157('0x28')][_0x3157('0x46')]({'where':{'id':_0x3e81fd[_0x3157('0x47')]['id']}})[_0x3157('0x23')](handleEntityNotFound(_0x486031,null))[_0x3157('0x23')](saveUpdates(_0x3e81fd['body'],null))[_0x3157('0x23')](respondWithResult(_0x486031,null))[_0x3157('0x3f')](handleError(_0x486031,null));};exports[_0x3157('0x48')]=function(_0x4bb5fc,_0x3bfcfa){return db[_0x3157('0x28')][_0x3157('0x46')]({'where':{'id':_0x4bb5fc['params']['id']}})[_0x3157('0x23')](handleEntityNotFound(_0x3bfcfa,null))['then'](removeEntity(_0x3bfcfa,null))[_0x3157('0x3f')](handleError(_0x3bfcfa,null));};
\ No newline at end of file
+var _0x3eae=['jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','params','keys','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x58bec1,_0x42c53f){var _0x16439f=function(_0x19b7ec){while(--_0x19b7ec){_0x58bec1['push'](_0x58bec1['shift']());}};_0x16439f(++_0x42c53f);}(_0x3eae,0x126));var _0xe3ea=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x3eae[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0xe3ea('0x0'));var rimraf=require(_0xe3ea('0x1'));var zipdir=require(_0xe3ea('0x2'));var jsonpatch=require(_0xe3ea('0x3'));var rp=require('request-promise');var moment=require(_0xe3ea('0x4'));var BPromise=require(_0xe3ea('0x5'));var Mustache=require('mustache');var util=require(_0xe3ea('0x6'));var path=require(_0xe3ea('0x7'));var sox=require(_0xe3ea('0x8'));var csv=require('to-csv');var ejs=require(_0xe3ea('0x9'));var fs=require('fs');var fs_extra=require(_0xe3ea('0xa'));var _=require(_0xe3ea('0xb'));var squel=require(_0xe3ea('0xc'));var crypto=require(_0xe3ea('0xd'));var jsforce=require(_0xe3ea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe3ea('0xf'));var querystring=require(_0xe3ea('0x10'));var Papa=require('papaparse');var Redis=require(_0xe3ea('0x11'));var authService=require(_0xe3ea('0x12'));var qs=require(_0xe3ea('0x13'));var as=require(_0xe3ea('0x14'));var hardwareService=require(_0xe3ea('0x15'));var logger=require('../../config/logger')(_0xe3ea('0x16'));var utils=require(_0xe3ea('0x17'));var config=require(_0xe3ea('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3ea('0x19'))['db'];function respondWithStatusCode(_0x3fa991,_0x470912){_0x470912=_0x470912||0xcc;return function(_0x1312e0){if(_0x1312e0){return _0x3fa991[_0xe3ea('0x1a')](_0x470912);}return _0x3fa991[_0xe3ea('0x1b')](_0x470912)['end']();};}function respondWithResult(_0x544dfe,_0x1701d3){_0x1701d3=_0x1701d3||0xc8;return function(_0x335689){if(_0x335689){return _0x544dfe[_0xe3ea('0x1b')](_0x1701d3)[_0xe3ea('0x1c')](_0x335689);}};}function respondWithFilteredResult(_0x45ba02,_0x4ac0ea){return function(_0x4c92b2){if(_0x4c92b2){var _0x27885e=typeof _0x4ac0ea[_0xe3ea('0x1d')]==='undefined'&&typeof _0x4ac0ea[_0xe3ea('0x1e')]===_0xe3ea('0x1f');var _0x4af35e=_0x4c92b2['count'];var _0x2af916=_0x27885e?0x0:_0x4ac0ea[_0xe3ea('0x1d')];var _0x417b88=_0x27885e?_0x4c92b2[_0xe3ea('0x20')]:_0x4ac0ea[_0xe3ea('0x1d')]+_0x4ac0ea[_0xe3ea('0x1e')];var _0x4d611a;if(_0x417b88>=_0x4af35e){_0x417b88=_0x4af35e;_0x4d611a=0xc8;}else{_0x4d611a=0xce;}_0x45ba02['status'](_0x4d611a);return _0x45ba02[_0xe3ea('0x21')]('Content-Range',_0x2af916+'-'+_0x417b88+'/'+_0x4af35e)['json'](_0x4c92b2);}return null;};}function patchUpdates(_0xcbb4db){return function(_0xe8e88){try{jsonpatch[_0xe3ea('0x22')](_0xe8e88,_0xcbb4db,!![]);}catch(_0x181720){return BPromise[_0xe3ea('0x23')](_0x181720);}return _0xe8e88[_0xe3ea('0x24')]();};}function saveUpdates(_0x161c0e,_0x2f763b){return function(_0x342192){if(_0x342192){return _0x342192[_0xe3ea('0x25')](_0x161c0e)[_0xe3ea('0x26')](function(_0x37be78){return _0x37be78;});}return null;};}function removeEntity(_0x196fac,_0x580da3){return function(_0x3f728c){if(_0x3f728c){return _0x3f728c[_0xe3ea('0x27')]()[_0xe3ea('0x26')](function(){_0x196fac[_0xe3ea('0x1b')](0xcc)[_0xe3ea('0x28')]();});}};}function handleEntityNotFound(_0x3c7131,_0x145cf4){return function(_0x5305e1){if(!_0x5305e1){_0x3c7131[_0xe3ea('0x1a')](0x194);}return _0x5305e1;};}function handleError(_0x1b143a,_0x5d0108){_0x5d0108=_0x5d0108||0x1f4;return function(_0x2e09f7){logger[_0xe3ea('0x29')](_0x2e09f7[_0xe3ea('0x2a')]);if(_0x2e09f7[_0xe3ea('0x2b')]){delete _0x2e09f7['name'];}_0x1b143a['status'](_0x5d0108)[_0xe3ea('0x2c')](_0x2e09f7);};}exports['index']=function(_0x3032b1,_0x372b7c){var _0x168c9b={},_0x5292b4={},_0x115a78={'count':0x0,'rows':[]};var _0x505550=_[_0xe3ea('0x2d')](db[_0xe3ea('0x2e')][_0xe3ea('0x2f')],function(_0x530948){return{'name':_0x530948[_0xe3ea('0x30')],'type':_0x530948['type'][_0xe3ea('0x31')]};});_0x5292b4[_0xe3ea('0x32')]=_[_0xe3ea('0x2d')](_0x505550,_0xe3ea('0x2b'));_0x5292b4['query']=_['keys'](_0x3032b1[_0xe3ea('0x33')]);_0x5292b4[_0xe3ea('0x34')]=_[_0xe3ea('0x35')](_0x5292b4[_0xe3ea('0x32')],_0x5292b4[_0xe3ea('0x33')]);_0x168c9b['attributes']=_[_0xe3ea('0x35')](_0x5292b4['model'],qs['fields'](_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x36')]));_0x168c9b['attributes']=_0x168c9b['attributes'][_0xe3ea('0x37')]?_0x168c9b[_0xe3ea('0x38')]:_0x5292b4[_0xe3ea('0x32')];if(!_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x39')](_0xe3ea('0x3a'))){_0x168c9b['limit']=qs[_0xe3ea('0x1e')](_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x1e')]);_0x168c9b[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x1d')]);}_0x168c9b[_0xe3ea('0x3b')]=qs[_0xe3ea('0x3c')](_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x3c')]);_0x168c9b[_0xe3ea('0x3d')]=qs[_0xe3ea('0x34')](_[_0xe3ea('0x3e')](_0x3032b1['query'],_0x5292b4['filters']),_0x505550);if(_0x3032b1[_0xe3ea('0x33')][_0xe3ea('0x3f')]){_0x168c9b[_0xe3ea('0x3d')]=_['merge'](_0x168c9b[_0xe3ea('0x3d')],{'$or':_[_0xe3ea('0x2d')](_0x505550,function(_0x16fbb9){if(_0x16fbb9[_0xe3ea('0x40')]!==_0xe3ea('0x41')){var _0x4a28a4={};_0x4a28a4[_0x16fbb9[_0xe3ea('0x2b')]]={'$like':'%'+_0x3032b1['query']['filter']+'%'};return _0x4a28a4;}})});}_0x168c9b=_[_0xe3ea('0x42')]({},_0x168c9b,_0x3032b1[_0xe3ea('0x43')]);var _0x24202b={'where':_0x168c9b[_0xe3ea('0x3d')]};return db[_0xe3ea('0x2e')][_0xe3ea('0x20')](_0x24202b)[_0xe3ea('0x26')](function(_0x105726){_0x115a78['count']=_0x105726;if(_0x3032b1['query'][_0xe3ea('0x44')]){_0x168c9b[_0xe3ea('0x45')]=[{'all':!![]}];}return db[_0xe3ea('0x2e')]['findAll'](_0x168c9b);})[_0xe3ea('0x26')](function(_0x58df4e){_0x115a78[_0xe3ea('0x46')]=_0x58df4e;return _0x115a78;})[_0xe3ea('0x26')](respondWithFilteredResult(_0x372b7c,_0x168c9b))['catch'](handleError(_0x372b7c,null));};exports['show']=function(_0x28e714,_0x387f1c){var _0x3a248a={'raw':!![],'where':{'id':_0x28e714[_0xe3ea('0x47')]['id']}},_0x5d18ec={};_0x5d18ec['model']=_[_0xe3ea('0x48')](db[_0xe3ea('0x2e')]['rawAttributes']);_0x5d18ec[_0xe3ea('0x33')]=_['keys'](_0x28e714['query']);_0x5d18ec[_0xe3ea('0x34')]=_[_0xe3ea('0x35')](_0x5d18ec[_0xe3ea('0x32')],_0x5d18ec[_0xe3ea('0x33')]);_0x3a248a[_0xe3ea('0x38')]=_[_0xe3ea('0x35')](_0x5d18ec[_0xe3ea('0x32')],qs['fields'](_0x28e714[_0xe3ea('0x33')][_0xe3ea('0x36')]));_0x3a248a['attributes']=_0x3a248a[_0xe3ea('0x38')][_0xe3ea('0x37')]?_0x3a248a[_0xe3ea('0x38')]:_0x5d18ec[_0xe3ea('0x32')];if(_0x28e714[_0xe3ea('0x33')]['includeAll']){_0x3a248a[_0xe3ea('0x45')]=[{'all':!![]}];}_0x3a248a=_[_0xe3ea('0x42')]({},_0x3a248a,_0x28e714[_0xe3ea('0x43')]);return db['SquareMessage']['find'](_0x3a248a)['then'](handleEntityNotFound(_0x387f1c,null))[_0xe3ea('0x26')](respondWithResult(_0x387f1c,null))[_0xe3ea('0x49')](handleError(_0x387f1c,null));};exports['create']=function(_0x2a57b4,_0x219819){return db[_0xe3ea('0x2e')][_0xe3ea('0x4a')](_0x2a57b4[_0xe3ea('0x4b')],{})[_0xe3ea('0x26')](respondWithResult(_0x219819,0xc9))['catch'](handleError(_0x219819,null));};exports[_0xe3ea('0x25')]=function(_0x4d71a9,_0x3b9e62){if(_0x4d71a9['body']['id']){delete _0x4d71a9[_0xe3ea('0x4b')]['id'];}return db[_0xe3ea('0x2e')]['find']({'where':{'id':_0x4d71a9[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x3b9e62,null))[_0xe3ea('0x26')](saveUpdates(_0x4d71a9[_0xe3ea('0x4b')],null))[_0xe3ea('0x26')](respondWithResult(_0x3b9e62,null))[_0xe3ea('0x49')](handleError(_0x3b9e62,null));};exports[_0xe3ea('0x27')]=function(_0x41c1a7,_0x46d079){return db[_0xe3ea('0x2e')][_0xe3ea('0x4c')]({'where':{'id':_0x41c1a7[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x46d079,null))['then'](removeEntity(_0x46d079,null))[_0xe3ea('0x49')](handleError(_0x46d079,null));};
\ No newline at end of file
index 4e3218e..bfde5f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21f2=['square_messages','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x21f2,0xe5));var _0x221f=function(_0x42985b,_0x5a3f78){_0x42985b=_0x42985b-0x0;var _0x1edd15=_0x21f2[_0x42985b];return _0x1edd15;};'use strict';var _=require(_0x221f('0x0'));var util=require('util');var logger=require(_0x221f('0x1'))('api');var moment=require(_0x221f('0x2'));var BPromise=require(_0x221f('0x3'));var rp=require(_0x221f('0x4'));var fs=require('fs');var path=require(_0x221f('0x5'));var rimraf=require(_0x221f('0x6'));var config=require(_0x221f('0x7'));var attributes=require(_0x221f('0x8'));module['exports']=function(_0x3ea93d,_0x4a9fca){return _0x3ea93d[_0x221f('0x9')](_0x221f('0xa'),attributes,{'tableName':_0x221f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4721=['api','moment','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger'];(function(_0x509ef1,_0x52002e){var _0x3fd08d=function(_0x3a0257){while(--_0x3a0257){_0x509ef1['push'](_0x509ef1['shift']());}};_0x3fd08d(++_0x52002e);}(_0x4721,0xeb));var _0x1472=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4721[_0x279d37];return _0x530173;};'use strict';var _=require(_0x1472('0x0'));var util=require(_0x1472('0x1'));var logger=require(_0x1472('0x2'))(_0x1472('0x3'));var moment=require(_0x1472('0x4'));var BPromise=require('bluebird');var rp=require(_0x1472('0x5'));var fs=require('fs');var path=require(_0x1472('0x6'));var rimraf=require(_0x1472('0x7'));var config=require(_0x1472('0x8'));var attributes=require(_0x1472('0x9'));module[_0x1472('0xa')]=function(_0xee60d9,_0x48a4c4){return _0xee60d9[_0x1472('0xb')](_0x1472('0xc'),attributes,{'tableName':_0x1472('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 23b9ddc..ae08f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x566a=['code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','error'];(function(_0x42b0c5,_0x45f1a3){var _0x51f923=function(_0x28d321){while(--_0x28d321){_0x42b0c5['push'](_0x42b0c5['shift']());}};_0x51f923(++_0x45f1a3);}(_0x566a,0x67));var _0xa566=function(_0x5bda5f,_0x58e59b){_0x5bda5f=_0x5bda5f-0x0;var _0x5e05da=_0x566a[_0x5bda5f];return _0x5e05da;};'use strict';var _=require(_0xa566('0x0'));var util=require(_0xa566('0x1'));var moment=require(_0xa566('0x2'));var BPromise=require(_0xa566('0x3'));var rs=require(_0xa566('0x4'));var fs=require('fs');var Redis=require(_0xa566('0x5'));var db=require(_0xa566('0x6'))['db'];var utils=require(_0xa566('0x7'));var logger=require(_0xa566('0x8'))(_0xa566('0x9'));var config=require(_0xa566('0xa'));var jayson=require(_0xa566('0xb'));var client=jayson['client'][_0xa566('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x561c4a,_0x3d453d,_0x48f9c0){return new BPromise(function(_0x1e074b,_0x326d12){return client['request'](_0x561c4a,_0x48f9c0)[_0xa566('0xd')](function(_0x2233e0){logger[_0xa566('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3d453d,_0xa566('0xf'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3d453d,_0xa566('0xf'),JSON['stringify'](_0x2233e0));if(_0x2233e0['error']){if(_0x2233e0[_0xa566('0x10')][_0xa566('0x11')]===0x1f4){logger[_0xa566('0x10')](_0xa566('0x12'),_0x3d453d,_0x2233e0[_0xa566('0x10')]['message']);return _0x326d12(_0x2233e0[_0xa566('0x10')]['message']);}logger[_0xa566('0x10')](_0xa566('0x12'),_0x3d453d,_0x2233e0[_0xa566('0x10')][_0xa566('0x13')]);return _0x1e074b(_0x2233e0[_0xa566('0x10')][_0xa566('0x13')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x3d453d,_0xa566('0xf'));_0x1e074b(_0x2233e0[_0xa566('0x14')][_0xa566('0x13')]);}})[_0xa566('0x15')](function(_0x32d1f1){logger[_0xa566('0x10')](_0xa566('0x12'),_0x3d453d,_0x32d1f1);_0x326d12(_0x32d1f1);});});}exports[_0xa566('0x16')]=function(_0x2cd5e5){var _0x34a120=this;return new Promise(function(_0x4fc450,_0x5e2e1f){return db[_0xa566('0x17')][_0xa566('0x18')](_0x2cd5e5[_0xa566('0x19')],{'raw':_0x2cd5e5[_0xa566('0x1a')]?_0x2cd5e5['options'][_0xa566('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x469e2d){logger[_0xa566('0xe')]('CreateSquareMessage',_0x2cd5e5);logger[_0xa566('0x1c')](_0xa566('0x16'),_0x2cd5e5,JSON[_0xa566('0x1d')](_0x469e2d));_0x4fc450(_0x469e2d);})[_0xa566('0x15')](function(_0x1d22a6){logger[_0xa566('0x10')]('CreateSquareMessage',_0x1d22a6[_0xa566('0x13')],_0x2cd5e5);_0x5e2e1f(_0x34a120[_0xa566('0x10')](0x1f4,_0x1d22a6[_0xa566('0x13')]));});});};
\ No newline at end of file
+var _0xb50b=['debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateSquareMessage','SquareMessage','create','body','options'];(function(_0x38f4ec,_0x1c1947){var _0x2d56df=function(_0x59f5e8){while(--_0x59f5e8){_0x38f4ec['push'](_0x38f4ec['shift']());}};_0x2d56df(++_0x1c1947);}(_0xb50b,0x7e));var _0xbb50=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0xb50b[_0x256e32];return _0x464070;};'use strict';var _=require(_0xbb50('0x0'));var util=require('util');var moment=require(_0xbb50('0x1'));var BPromise=require(_0xbb50('0x2'));var rs=require(_0xbb50('0x3'));var fs=require('fs');var Redis=require(_0xbb50('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb50('0x5'));var logger=require(_0xbb50('0x6'))(_0xbb50('0x7'));var config=require('../../config/environment');var jayson=require(_0xbb50('0x8'));var client=jayson[_0xbb50('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e20eb,_0x56e15e,_0x141f14){return new BPromise(function(_0x533c44,_0x18b9ff){return client[_0xbb50('0xa')](_0x2e20eb,_0x141f14)[_0xbb50('0xb')](function(_0x1c25cc){logger[_0xbb50('0xc')](_0xbb50('0xd'),_0x56e15e,_0xbb50('0xe'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x56e15e,'request\x20sent',JSON[_0xbb50('0xf')](_0x1c25cc));if(_0x1c25cc[_0xbb50('0x10')]){if(_0x1c25cc[_0xbb50('0x10')]['code']===0x1f4){logger[_0xbb50('0x10')](_0xbb50('0xd'),_0x56e15e,_0x1c25cc[_0xbb50('0x10')]['message']);return _0x18b9ff(_0x1c25cc[_0xbb50('0x10')][_0xbb50('0x11')]);}logger['error'](_0xbb50('0xd'),_0x56e15e,_0x1c25cc['error'][_0xbb50('0x11')]);return _0x533c44(_0x1c25cc[_0xbb50('0x10')][_0xbb50('0x11')]);}else{logger['info'](_0xbb50('0xd'),_0x56e15e,'request\x20sent');_0x533c44(_0x1c25cc['result'][_0xbb50('0x11')]);}})[_0xbb50('0x12')](function(_0x4d334b){logger[_0xbb50('0x10')](_0xbb50('0xd'),_0x56e15e,_0x4d334b);_0x18b9ff(_0x4d334b);});});}exports[_0xbb50('0x13')]=function(_0x12012b){var _0x1aff69=this;return new Promise(function(_0x4edbc4,_0x49e858){return db[_0xbb50('0x14')][_0xbb50('0x15')](_0x12012b[_0xbb50('0x16')],{'raw':_0x12012b[_0xbb50('0x17')]?_0x12012b[_0xbb50('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbb50('0xb')](function(_0x4bbe7c){logger[_0xbb50('0xc')](_0xbb50('0x13'),_0x12012b);logger[_0xbb50('0x18')](_0xbb50('0x13'),_0x12012b,JSON[_0xbb50('0xf')](_0x4bbe7c));_0x4edbc4(_0x4bbe7c);})[_0xbb50('0x12')](function(_0x186d19){logger[_0xbb50('0x10')](_0xbb50('0x13'),_0x186d19['message'],_0x12012b);_0x49e858(_0x1aff69[_0xbb50('0x10')](0x1f4,_0x186d19[_0xbb50('0x11')]));});});};
\ No newline at end of file
index 2eb5d61..71dadf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab55=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','/:id','show','get','/:id/test','15s','test','post','create','put','update','delete'];(function(_0x5f1687,_0x4879df){var _0x1d134f=function(_0x330f43){while(--_0x330f43){_0x5f1687['push'](_0x5f1687['shift']());}};_0x1d134f(++_0x4879df);}(_0xab55,0x181));var _0x5ab5=function(_0x58cedd,_0x418206){_0x58cedd=_0x58cedd-0x0;var _0x5569f2=_0xab55[_0x58cedd];return _0x5569f2;};'use strict';var multer=require(_0x5ab5('0x0'));var util=require(_0x5ab5('0x1'));var path=require(_0x5ab5('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ab5('0x3'));var router=express[_0x5ab5('0x4')]();var fs_extra=require(_0x5ab5('0x5'));var auth=require(_0x5ab5('0x6'));var interaction=require(_0x5ab5('0x7'));var config=require(_0x5ab5('0x8'));var controller=require(_0x5ab5('0x9'));router['get']('/',auth[_0x5ab5('0xa')](),controller[_0x5ab5('0xb')]);router['get'](_0x5ab5('0xc'),auth[_0x5ab5('0xa')](),controller[_0x5ab5('0xd')]);router[_0x5ab5('0xe')](_0x5ab5('0xf'),auth[_0x5ab5('0xa')](),timeout(_0x5ab5('0x10')),controller[_0x5ab5('0x11')]);router[_0x5ab5('0x12')]('/',auth[_0x5ab5('0xa')](),controller[_0x5ab5('0x13')]);router[_0x5ab5('0x14')]('/:id',auth[_0x5ab5('0xa')](),controller[_0x5ab5('0x15')]);router[_0x5ab5('0x16')](_0x5ab5('0xc'),auth[_0x5ab5('0xa')](),controller['destroy']);module[_0x5ab5('0x17')]=router;
\ No newline at end of file
+var _0xd732=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/test','15s','test','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c7a4f,_0x5ec5f1){var _0x2b1cae=function(_0xe1fd3e){while(--_0xe1fd3e){_0x2c7a4f['push'](_0x2c7a4f['shift']());}};_0x2b1cae(++_0x5ec5f1);}(_0xd732,0x84));var _0x2d73=function(_0x1764c0,_0xbd2e91){_0x1764c0=_0x1764c0-0x0;var _0x3ec691=_0xd732[_0x1764c0];return _0x3ec691;};'use strict';var multer=require('multer');var util=require(_0x2d73('0x0'));var path=require('path');var timeout=require(_0x2d73('0x1'));var express=require(_0x2d73('0x2'));var router=express[_0x2d73('0x3')]();var fs_extra=require(_0x2d73('0x4'));var auth=require(_0x2d73('0x5'));var interaction=require(_0x2d73('0x6'));var config=require(_0x2d73('0x7'));var controller=require('./squareOdbc.controller');router[_0x2d73('0x8')]('/',auth[_0x2d73('0x9')](),controller[_0x2d73('0xa')]);router[_0x2d73('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2d73('0xb')]);router[_0x2d73('0x8')](_0x2d73('0xc'),auth[_0x2d73('0x9')](),timeout(_0x2d73('0xd')),controller[_0x2d73('0xe')]);router[_0x2d73('0xf')]('/',auth[_0x2d73('0x9')](),controller[_0x2d73('0x10')]);router[_0x2d73('0x11')](_0x2d73('0x12'),auth['isAuthenticated'](),controller[_0x2d73('0x13')]);router[_0x2d73('0x14')]('/:id',auth[_0x2d73('0x9')](),controller[_0x2d73('0x15')]);module[_0x2d73('0x16')]=router;
\ No newline at end of file
index fc19e75..7f96014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42c4=['name','STRING'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x42c4,0xb5));var _0x442c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x442c('0x0')],'unique':_0x442c('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x442c('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb368=['STRING','sequelize','exports','name'];(function(_0x3c4a7d,_0x5c7ed4){var _0x42d58c=function(_0x410d04){while(--_0x410d04){_0x3c4a7d['push'](_0x3c4a7d['shift']());}};_0x42d58c(++_0x5c7ed4);}(_0xb368,0x1e1));var _0x8b36=function(_0x3170c2,_0x4facd6){_0x3170c2=_0x3170c2-0x0;var _0x1dc90f=_0xb368[_0x3170c2];return _0x1dc90f;};'use strict';var Sequelize=require(_0x8b36('0x0'));module[_0x8b36('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8b36('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8b36('0x3')]},'description':{'type':Sequelize[_0x8b36('0x3')]}};
\ No newline at end of file
index 8f91cb1..cac1abd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12ec=['userProfileId','body','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection'];(function(_0x7ee5aa,_0x556929){var _0x51c30f=function(_0xba9aed){while(--_0xba9aed){_0x7ee5aa['push'](_0x7ee5aa['shift']());}};_0x51c30f(++_0x556929);}(_0x12ec,0x16a));var _0xc12e=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x12ec[_0x25248b];return _0x509939;};'use strict';var emlformat=require(_0xc12e('0x0'));var rimraf=require(_0xc12e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc12e('0x2'));var rp=require('request-promise');var moment=require(_0xc12e('0x3'));var BPromise=require(_0xc12e('0x4'));var Mustache=require(_0xc12e('0x5'));var util=require(_0xc12e('0x6'));var path=require(_0xc12e('0x7'));var sox=require(_0xc12e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc12e('0x9'));var _=require(_0xc12e('0xa'));var squel=require('squel');var crypto=require(_0xc12e('0xb'));var jsforce=require(_0xc12e('0xc'));var deskjs=require(_0xc12e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc12e('0xe'));var Papa=require(_0xc12e('0xf'));var Redis=require(_0xc12e('0x10'));var authService=require(_0xc12e('0x11'));var qs=require(_0xc12e('0x12'));var as=require(_0xc12e('0x13'));var hardwareService=require(_0xc12e('0x14'));var logger=require(_0xc12e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc12e('0x16'));var licenseUtil=require(_0xc12e('0x17'));var db=require(_0xc12e('0x18'))['db'];function respondWithStatusCode(_0x3864c5,_0x3ce152){_0x3ce152=_0x3ce152||0xcc;return function(_0x3005b4){if(_0x3005b4){return _0x3864c5['sendStatus'](_0x3ce152);}return _0x3864c5[_0xc12e('0x19')](_0x3ce152)[_0xc12e('0x1a')]();};}function respondWithResult(_0x1debc0,_0x17432d){_0x17432d=_0x17432d||0xc8;return function(_0x3720b9){if(_0x3720b9){return _0x1debc0[_0xc12e('0x19')](_0x17432d)['json'](_0x3720b9);}};}function respondWithFilteredResult(_0x25f009,_0x39ce2b){return function(_0x852902){if(_0x852902){var _0x565045=typeof _0x39ce2b[_0xc12e('0x1b')]===_0xc12e('0x1c')&&typeof _0x39ce2b[_0xc12e('0x1d')]===_0xc12e('0x1c');var _0x5beba1=_0x852902['count'];var _0x53327f=_0x565045?0x0:_0x39ce2b[_0xc12e('0x1b')];var _0x2b2d28=_0x565045?_0x852902[_0xc12e('0x1e')]:_0x39ce2b[_0xc12e('0x1b')]+_0x39ce2b['limit'];var _0x40f105;if(_0x2b2d28>=_0x5beba1){_0x2b2d28=_0x5beba1;_0x40f105=0xc8;}else{_0x40f105=0xce;}_0x25f009[_0xc12e('0x19')](_0x40f105);return _0x25f009[_0xc12e('0x1f')](_0xc12e('0x20'),_0x53327f+'-'+_0x2b2d28+'/'+_0x5beba1)[_0xc12e('0x21')](_0x852902);}return null;};}function patchUpdates(_0x48ba42){return function(_0x1c3aa3){try{jsonpatch['apply'](_0x1c3aa3,_0x48ba42,!![]);}catch(_0xdf3e0d){return BPromise[_0xc12e('0x22')](_0xdf3e0d);}return _0x1c3aa3[_0xc12e('0x23')]();};}function saveUpdates(_0x5e845f,_0x1506ad){return function(_0x1583ad){if(_0x1583ad){return _0x1583ad[_0xc12e('0x24')](_0x5e845f)[_0xc12e('0x25')](function(_0x11051e){return _0x11051e;});}return null;};}function removeEntity(_0x1bfbdc,_0x183b83){return function(_0x39a489){if(_0x39a489){return _0x39a489[_0xc12e('0x26')]()[_0xc12e('0x25')](function(){var _0x10cdcb=_0x39a489['get']({'plain':!![]});var _0xd0542e=_0xc12e('0x27');return db[_0xc12e('0x28')][_0xc12e('0x26')]({'where':{'type':_0xd0542e,'resourceId':_0x10cdcb['id']}})[_0xc12e('0x25')](function(){return _0x39a489;});})[_0xc12e('0x25')](function(){_0x1bfbdc[_0xc12e('0x19')](0xcc)[_0xc12e('0x1a')]();});}};}function handleEntityNotFound(_0x2dc5b5,_0x2ae73d){return function(_0x500673){if(!_0x500673){_0x2dc5b5[_0xc12e('0x29')](0x194);}return _0x500673;};}function handleError(_0x758605,_0x17fdd8){_0x17fdd8=_0x17fdd8||0x1f4;return function(_0x72c35a){logger[_0xc12e('0x2a')](_0x72c35a[_0xc12e('0x2b')]);if(_0x72c35a[_0xc12e('0x2c')]){delete _0x72c35a[_0xc12e('0x2c')];}_0x758605[_0xc12e('0x19')](_0x17fdd8)[_0xc12e('0x2d')](_0x72c35a);};}exports[_0xc12e('0x2e')]=function(_0x1d3f79,_0x2a16f5){var _0x5078f4={},_0x12dc22={},_0x34b22b={'count':0x0,'rows':[]};var _0x2fd9cd=_[_0xc12e('0x2f')](db[_0xc12e('0x30')][_0xc12e('0x31')],function(_0x58a3fe){return{'name':_0x58a3fe[_0xc12e('0x32')],'type':_0x58a3fe['type']['key']};});_0x12dc22[_0xc12e('0x33')]=_[_0xc12e('0x2f')](_0x2fd9cd,_0xc12e('0x2c'));_0x12dc22['query']=_[_0xc12e('0x34')](_0x1d3f79[_0xc12e('0x35')]);_0x12dc22[_0xc12e('0x36')]=_['intersection'](_0x12dc22['model'],_0x12dc22['query']);_0x5078f4['attributes']=_[_0xc12e('0x37')](_0x12dc22[_0xc12e('0x33')],qs[_0xc12e('0x38')](_0x1d3f79['query'][_0xc12e('0x38')]));_0x5078f4[_0xc12e('0x39')]=_0x5078f4[_0xc12e('0x39')][_0xc12e('0x3a')]?_0x5078f4[_0xc12e('0x39')]:_0x12dc22['model'];if(!_0x1d3f79[_0xc12e('0x35')][_0xc12e('0x3b')](_0xc12e('0x3c'))){_0x5078f4['limit']=qs[_0xc12e('0x1d')](_0x1d3f79[_0xc12e('0x35')][_0xc12e('0x1d')]);_0x5078f4[_0xc12e('0x1b')]=qs[_0xc12e('0x1b')](_0x1d3f79[_0xc12e('0x35')][_0xc12e('0x1b')]);}_0x5078f4[_0xc12e('0x3d')]=qs[_0xc12e('0x3e')](_0x1d3f79['query'][_0xc12e('0x3e')]);_0x5078f4[_0xc12e('0x3f')]=qs[_0xc12e('0x36')](_[_0xc12e('0x40')](_0x1d3f79[_0xc12e('0x35')],_0x12dc22[_0xc12e('0x36')]),_0x2fd9cd);if(_0x1d3f79[_0xc12e('0x35')]['filter']){_0x5078f4[_0xc12e('0x3f')]=_[_0xc12e('0x41')](_0x5078f4[_0xc12e('0x3f')],{'$or':_[_0xc12e('0x2f')](_0x2fd9cd,function(_0x2ff676){if(_0x2ff676[_0xc12e('0x42')]!==_0xc12e('0x43')){var _0x2dcc54={};_0x2dcc54[_0x2ff676[_0xc12e('0x2c')]]={'$like':'%'+_0x1d3f79[_0xc12e('0x35')][_0xc12e('0x44')]+'%'};return _0x2dcc54;}})});}_0x5078f4=_['merge']({},_0x5078f4,_0x1d3f79[_0xc12e('0x45')]);var _0x2acc18={'where':_0x5078f4[_0xc12e('0x3f')]};return db[_0xc12e('0x30')][_0xc12e('0x1e')](_0x2acc18)[_0xc12e('0x25')](function(_0x33daa6){_0x34b22b[_0xc12e('0x1e')]=_0x33daa6;if(_0x1d3f79['query']['includeAll']){_0x5078f4[_0xc12e('0x46')]=[{'all':!![]}];}return db[_0xc12e('0x30')][_0xc12e('0x47')](_0x5078f4);})['then'](function(_0x5e2e0a){_0x34b22b[_0xc12e('0x48')]=_0x5e2e0a;return _0x34b22b;})[_0xc12e('0x25')](respondWithFilteredResult(_0x2a16f5,_0x5078f4))[_0xc12e('0x49')](handleError(_0x2a16f5,null));};exports[_0xc12e('0x4a')]=function(_0x2ba915,_0x56476f){var _0x2f0c66={'raw':!![],'where':{'id':_0x2ba915[_0xc12e('0x4b')]['id']}},_0x40d8b5={};_0x40d8b5['model']=_[_0xc12e('0x34')](db[_0xc12e('0x30')][_0xc12e('0x31')]);_0x40d8b5[_0xc12e('0x35')]=_[_0xc12e('0x34')](_0x2ba915[_0xc12e('0x35')]);_0x40d8b5['filters']=_['intersection'](_0x40d8b5[_0xc12e('0x33')],_0x40d8b5[_0xc12e('0x35')]);_0x2f0c66['attributes']=_[_0xc12e('0x37')](_0x40d8b5[_0xc12e('0x33')],qs[_0xc12e('0x38')](_0x2ba915[_0xc12e('0x35')]['fields']));_0x2f0c66[_0xc12e('0x39')]=_0x2f0c66['attributes'][_0xc12e('0x3a')]?_0x2f0c66[_0xc12e('0x39')]:_0x40d8b5[_0xc12e('0x33')];if(_0x2ba915[_0xc12e('0x35')]['includeAll']){_0x2f0c66[_0xc12e('0x46')]=[{'all':!![]}];}_0x2f0c66=_['merge']({},_0x2f0c66,_0x2ba915[_0xc12e('0x45')]);return db[_0xc12e('0x30')][_0xc12e('0x4c')](_0x2f0c66)[_0xc12e('0x25')](handleEntityNotFound(_0x56476f,null))['then'](respondWithResult(_0x56476f,null))['catch'](handleError(_0x56476f,null));};exports['create']=function(_0x8a9bf2,_0x9a4b77){return db[_0xc12e('0x30')][_0xc12e('0x4d')](_0x8a9bf2['body'],{})[_0xc12e('0x25')](function(_0x5616a5){var _0x9c01e=_0x8a9bf2[_0xc12e('0x4e')]['get']({'plain':!![]});if(!_0x9c01e)throw new Error(_0xc12e('0x4f'));if(_0x9c01e[_0xc12e('0x50')]===_0xc12e('0x4e')){var _0x5130e1=_0x5616a5[_0xc12e('0x51')]({'plain':!![]});var _0x4aa015=_0xc12e('0x27');return db[_0xc12e('0x52')][_0xc12e('0x4c')]({'where':{'name':_0x4aa015,'userProfileId':_0x9c01e[_0xc12e('0x53')]},'raw':!![]})[_0xc12e('0x25')](function(_0x3ad352){if(_0x3ad352&&_0x3ad352['autoAssociation']===0x0){return db['UserProfileResource'][_0xc12e('0x4d')]({'name':_0x5130e1['name'],'resourceId':_0x5130e1['id'],'type':_0x3ad352[_0xc12e('0x2c')],'sectionId':_0x3ad352['id']},{})[_0xc12e('0x25')](function(){return _0x5616a5;});}else{return _0x5616a5;}})['catch'](function(_0x2a9a22){logger[_0xc12e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a9a22);throw _0x2a9a22;});}return _0x5616a5;})[_0xc12e('0x25')](respondWithResult(_0x9a4b77,0xc9))[_0xc12e('0x49')](handleError(_0x9a4b77,null));};exports[_0xc12e('0x24')]=function(_0x74cac4,_0x3c3a7d){if(_0x74cac4[_0xc12e('0x54')]['id']){delete _0x74cac4[_0xc12e('0x54')]['id'];}return db[_0xc12e('0x30')][_0xc12e('0x4c')]({'where':{'id':_0x74cac4[_0xc12e('0x4b')]['id']}})[_0xc12e('0x25')](handleEntityNotFound(_0x3c3a7d,null))[_0xc12e('0x25')](saveUpdates(_0x74cac4[_0xc12e('0x54')],null))['then'](respondWithResult(_0x3c3a7d,null))[_0xc12e('0x49')](handleError(_0x3c3a7d,null));};exports[_0xc12e('0x26')]=function(_0x44da1e,_0x3717d1){return db[_0xc12e('0x30')]['find']({'where':{'id':_0x44da1e[_0xc12e('0x4b')]['id']}})[_0xc12e('0x25')](handleEntityNotFound(_0x3717d1,null))[_0xc12e('0x25')](removeEntity(_0x3717d1,null))[_0xc12e('0x49')](handleError(_0x3717d1,null));};exports['test']=function(_0x2a56f2,_0x20b230,_0x2d70d3){var _0x48933d;return db[_0xc12e('0x30')]['find']({'where':{'id':_0x2a56f2[_0xc12e('0x4b')]['id']},'attributes':['id',_0xc12e('0x55')]})[_0xc12e('0x25')](handleEntityNotFound(_0x20b230,null))['then'](function(_0x532052){if(_0x532052){var _0x5ae587=require(_0xc12e('0x56'))();_0x5ae587[_0xc12e('0x57')](_0x532052[_0xc12e('0x55')]);_0x5ae587[_0xc12e('0x58')]();return _0x532052;}})[_0xc12e('0x25')](respondWithResult(_0x20b230,null))['catch'](handleError(_0x20b230,null));};
\ No newline at end of file
+var _0xa5da=['get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','options','includeAll','include','SquareOdbc','findAll','rows','params','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','openSync','dsn','closeSync','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x3f3aa7,_0x1ca856){var _0x40b63e=function(_0x3b5a4d){while(--_0x3b5a4d){_0x3f3aa7['push'](_0x3f3aa7['shift']());}};_0x40b63e(++_0x1ca856);}(_0xa5da,0xdf));var _0xaa5d=function(_0x31b0bd,_0x1adb4c){_0x31b0bd=_0x31b0bd-0x0;var _0x4e1e7a=_0xa5da[_0x31b0bd];return _0x4e1e7a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa5d('0x0'));var jsonpatch=require(_0xaa5d('0x1'));var rp=require('request-promise');var moment=require(_0xaa5d('0x2'));var BPromise=require(_0xaa5d('0x3'));var Mustache=require('mustache');var util=require(_0xaa5d('0x4'));var path=require('path');var sox=require(_0xaa5d('0x5'));var csv=require('to-csv');var ejs=require(_0xaa5d('0x6'));var fs=require('fs');var fs_extra=require(_0xaa5d('0x7'));var _=require(_0xaa5d('0x8'));var squel=require('squel');var crypto=require(_0xaa5d('0x9'));var jsforce=require(_0xaa5d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa5d('0xb'));var Papa=require(_0xaa5d('0xc'));var Redis=require(_0xaa5d('0xd'));var authService=require(_0xaa5d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xaa5d('0xf'));var hardwareService=require(_0xaa5d('0x10'));var logger=require(_0xaa5d('0x11'))('api');var utils=require(_0xaa5d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xaa5d('0x13'));var db=require(_0xaa5d('0x14'))['db'];function respondWithStatusCode(_0x1aadf,_0x802c8b){_0x802c8b=_0x802c8b||0xcc;return function(_0x3dbca2){if(_0x3dbca2){return _0x1aadf['sendStatus'](_0x802c8b);}return _0x1aadf[_0xaa5d('0x15')](_0x802c8b)[_0xaa5d('0x16')]();};}function respondWithResult(_0x13e045,_0x1dcf1d){_0x1dcf1d=_0x1dcf1d||0xc8;return function(_0x420bd0){if(_0x420bd0){return _0x13e045[_0xaa5d('0x15')](_0x1dcf1d)[_0xaa5d('0x17')](_0x420bd0);}};}function respondWithFilteredResult(_0x2e5723,_0x4d6762){return function(_0x20d48c){if(_0x20d48c){var _0x31c483=typeof _0x4d6762['offset']===_0xaa5d('0x18')&&typeof _0x4d6762[_0xaa5d('0x19')]===_0xaa5d('0x18');var _0xaa4a62=_0x20d48c[_0xaa5d('0x1a')];var _0x366612=_0x31c483?0x0:_0x4d6762[_0xaa5d('0x1b')];var _0x2b2592=_0x31c483?_0x20d48c[_0xaa5d('0x1a')]:_0x4d6762['offset']+_0x4d6762[_0xaa5d('0x19')];var _0x40bf16;if(_0x2b2592>=_0xaa4a62){_0x2b2592=_0xaa4a62;_0x40bf16=0xc8;}else{_0x40bf16=0xce;}_0x2e5723['status'](_0x40bf16);return _0x2e5723[_0xaa5d('0x1c')](_0xaa5d('0x1d'),_0x366612+'-'+_0x2b2592+'/'+_0xaa4a62)['json'](_0x20d48c);}return null;};}function patchUpdates(_0x1895a7){return function(_0xb059cf){try{jsonpatch[_0xaa5d('0x1e')](_0xb059cf,_0x1895a7,!![]);}catch(_0x300462){return BPromise[_0xaa5d('0x1f')](_0x300462);}return _0xb059cf['save']();};}function saveUpdates(_0x18ec64,_0x2b6d1c){return function(_0x15e9ee){if(_0x15e9ee){return _0x15e9ee[_0xaa5d('0x20')](_0x18ec64)[_0xaa5d('0x21')](function(_0x5726c8){return _0x5726c8;});}return null;};}function removeEntity(_0x888b0a,_0x16689f){return function(_0x421354){if(_0x421354){return _0x421354[_0xaa5d('0x22')]()[_0xaa5d('0x21')](function(){var _0x4e8273=_0x421354[_0xaa5d('0x23')]({'plain':!![]});var _0xf8054b=_0xaa5d('0x24');return db[_0xaa5d('0x25')][_0xaa5d('0x22')]({'where':{'type':_0xf8054b,'resourceId':_0x4e8273['id']}})['then'](function(){return _0x421354;});})[_0xaa5d('0x21')](function(){_0x888b0a[_0xaa5d('0x15')](0xcc)[_0xaa5d('0x16')]();});}};}function handleEntityNotFound(_0x17a042,_0xd6a548){return function(_0x44d1ef){if(!_0x44d1ef){_0x17a042[_0xaa5d('0x26')](0x194);}return _0x44d1ef;};}function handleError(_0x260784,_0xe546a2){_0xe546a2=_0xe546a2||0x1f4;return function(_0x938c23){logger[_0xaa5d('0x27')](_0x938c23[_0xaa5d('0x28')]);if(_0x938c23[_0xaa5d('0x29')]){delete _0x938c23[_0xaa5d('0x29')];}_0x260784[_0xaa5d('0x15')](_0xe546a2)[_0xaa5d('0x2a')](_0x938c23);};}exports['index']=function(_0x5c3ea9,_0x175399){var _0x2bd327={},_0x2ad063={},_0x4c3ded={'count':0x0,'rows':[]};var _0x1be142=_['map'](db['SquareOdbc'][_0xaa5d('0x2b')],function(_0x45b32c){return{'name':_0x45b32c[_0xaa5d('0x2c')],'type':_0x45b32c[_0xaa5d('0x2d')][_0xaa5d('0x2e')]};});_0x2ad063['model']=_['map'](_0x1be142,_0xaa5d('0x29'));_0x2ad063[_0xaa5d('0x2f')]=_[_0xaa5d('0x30')](_0x5c3ea9[_0xaa5d('0x2f')]);_0x2ad063[_0xaa5d('0x31')]=_[_0xaa5d('0x32')](_0x2ad063[_0xaa5d('0x33')],_0x2ad063[_0xaa5d('0x2f')]);_0x2bd327[_0xaa5d('0x34')]=_[_0xaa5d('0x32')](_0x2ad063[_0xaa5d('0x33')],qs[_0xaa5d('0x35')](_0x5c3ea9[_0xaa5d('0x2f')][_0xaa5d('0x35')]));_0x2bd327[_0xaa5d('0x34')]=_0x2bd327[_0xaa5d('0x34')][_0xaa5d('0x36')]?_0x2bd327[_0xaa5d('0x34')]:_0x2ad063[_0xaa5d('0x33')];if(!_0x5c3ea9[_0xaa5d('0x2f')][_0xaa5d('0x37')](_0xaa5d('0x38'))){_0x2bd327[_0xaa5d('0x19')]=qs[_0xaa5d('0x19')](_0x5c3ea9['query']['limit']);_0x2bd327[_0xaa5d('0x1b')]=qs[_0xaa5d('0x1b')](_0x5c3ea9[_0xaa5d('0x2f')]['offset']);}_0x2bd327[_0xaa5d('0x39')]=qs['sort'](_0x5c3ea9['query'][_0xaa5d('0x3a')]);_0x2bd327['where']=qs['filters'](_[_0xaa5d('0x3b')](_0x5c3ea9[_0xaa5d('0x2f')],_0x2ad063['filters']),_0x1be142);if(_0x5c3ea9[_0xaa5d('0x2f')][_0xaa5d('0x3c')]){_0x2bd327[_0xaa5d('0x3d')]=_['merge'](_0x2bd327[_0xaa5d('0x3d')],{'$or':_[_0xaa5d('0x3e')](_0x1be142,function(_0x47a5fc){if(_0x47a5fc[_0xaa5d('0x2d')]!=='VIRTUAL'){var _0x3ea9e6={};_0x3ea9e6[_0x47a5fc[_0xaa5d('0x29')]]={'$like':'%'+_0x5c3ea9[_0xaa5d('0x2f')]['filter']+'%'};return _0x3ea9e6;}})});}_0x2bd327=_['merge']({},_0x2bd327,_0x5c3ea9[_0xaa5d('0x3f')]);var _0x54e527={'where':_0x2bd327[_0xaa5d('0x3d')]};return db['SquareOdbc'][_0xaa5d('0x1a')](_0x54e527)[_0xaa5d('0x21')](function(_0x16d5f5){_0x4c3ded[_0xaa5d('0x1a')]=_0x16d5f5;if(_0x5c3ea9[_0xaa5d('0x2f')][_0xaa5d('0x40')]){_0x2bd327[_0xaa5d('0x41')]=[{'all':!![]}];}return db[_0xaa5d('0x42')][_0xaa5d('0x43')](_0x2bd327);})[_0xaa5d('0x21')](function(_0x113b51){_0x4c3ded[_0xaa5d('0x44')]=_0x113b51;return _0x4c3ded;})[_0xaa5d('0x21')](respondWithFilteredResult(_0x175399,_0x2bd327))['catch'](handleError(_0x175399,null));};exports['show']=function(_0x3ea845,_0xbf424e){var _0x3f1c7c={'raw':!![],'where':{'id':_0x3ea845[_0xaa5d('0x45')]['id']}},_0x3746d3={};_0x3746d3[_0xaa5d('0x33')]=_[_0xaa5d('0x30')](db['SquareOdbc'][_0xaa5d('0x2b')]);_0x3746d3[_0xaa5d('0x2f')]=_[_0xaa5d('0x30')](_0x3ea845[_0xaa5d('0x2f')]);_0x3746d3[_0xaa5d('0x31')]=_[_0xaa5d('0x32')](_0x3746d3['model'],_0x3746d3[_0xaa5d('0x2f')]);_0x3f1c7c[_0xaa5d('0x34')]=_[_0xaa5d('0x32')](_0x3746d3[_0xaa5d('0x33')],qs['fields'](_0x3ea845['query'][_0xaa5d('0x35')]));_0x3f1c7c[_0xaa5d('0x34')]=_0x3f1c7c[_0xaa5d('0x34')][_0xaa5d('0x36')]?_0x3f1c7c[_0xaa5d('0x34')]:_0x3746d3['model'];if(_0x3ea845[_0xaa5d('0x2f')][_0xaa5d('0x40')]){_0x3f1c7c[_0xaa5d('0x41')]=[{'all':!![]}];}_0x3f1c7c=_[_0xaa5d('0x46')]({},_0x3f1c7c,_0x3ea845[_0xaa5d('0x3f')]);return db[_0xaa5d('0x42')][_0xaa5d('0x47')](_0x3f1c7c)[_0xaa5d('0x21')](handleEntityNotFound(_0xbf424e,null))['then'](respondWithResult(_0xbf424e,null))[_0xaa5d('0x48')](handleError(_0xbf424e,null));};exports['create']=function(_0x31cf93,_0x31518d){return db[_0xaa5d('0x42')][_0xaa5d('0x49')](_0x31cf93[_0xaa5d('0x4a')],{})[_0xaa5d('0x21')](function(_0x2183b2){var _0x5afab3=_0x31cf93[_0xaa5d('0x4b')][_0xaa5d('0x23')]({'plain':!![]});if(!_0x5afab3)throw new Error(_0xaa5d('0x4c'));if(_0x5afab3[_0xaa5d('0x4d')]===_0xaa5d('0x4b')){var _0x4af392=_0x2183b2['get']({'plain':!![]});var _0x2ed607=_0xaa5d('0x24');return db['UserProfileSection'][_0xaa5d('0x47')]({'where':{'name':_0x2ed607,'userProfileId':_0x5afab3[_0xaa5d('0x4e')]},'raw':!![]})['then'](function(_0x3b614a){if(_0x3b614a&&_0x3b614a[_0xaa5d('0x4f')]===0x0){return db[_0xaa5d('0x25')][_0xaa5d('0x49')]({'name':_0x4af392[_0xaa5d('0x29')],'resourceId':_0x4af392['id'],'type':_0x3b614a[_0xaa5d('0x29')],'sectionId':_0x3b614a['id']},{})['then'](function(){return _0x2183b2;});}else{return _0x2183b2;}})[_0xaa5d('0x48')](function(_0x5a01b6){logger[_0xaa5d('0x27')](_0xaa5d('0x50'),_0x5a01b6);throw _0x5a01b6;});}return _0x2183b2;})['then'](respondWithResult(_0x31518d,0xc9))[_0xaa5d('0x48')](handleError(_0x31518d,null));};exports[_0xaa5d('0x20')]=function(_0x2372f2,_0x106ace){if(_0x2372f2[_0xaa5d('0x4a')]['id']){delete _0x2372f2[_0xaa5d('0x4a')]['id'];}return db[_0xaa5d('0x42')][_0xaa5d('0x47')]({'where':{'id':_0x2372f2[_0xaa5d('0x45')]['id']}})['then'](handleEntityNotFound(_0x106ace,null))[_0xaa5d('0x21')](saveUpdates(_0x2372f2['body'],null))[_0xaa5d('0x21')](respondWithResult(_0x106ace,null))['catch'](handleError(_0x106ace,null));};exports[_0xaa5d('0x22')]=function(_0x142eff,_0x2a4a43){return db[_0xaa5d('0x42')][_0xaa5d('0x47')]({'where':{'id':_0x142eff[_0xaa5d('0x45')]['id']}})[_0xaa5d('0x21')](handleEntityNotFound(_0x2a4a43,null))['then'](removeEntity(_0x2a4a43,null))[_0xaa5d('0x48')](handleError(_0x2a4a43,null));};exports[_0xaa5d('0x51')]=function(_0x2e0feb,_0x2245b6,_0x505753){var _0x1cf301;return db['SquareOdbc'][_0xaa5d('0x47')]({'where':{'id':_0x2e0feb[_0xaa5d('0x45')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x2245b6,null))[_0xaa5d('0x21')](function(_0x73261e){if(_0x73261e){var _0xd41425=require(_0xaa5d('0x52'))();_0xd41425[_0xaa5d('0x53')](_0x73261e[_0xaa5d('0x54')]);_0xd41425[_0xaa5d('0x55')]();return _0x73261e;}})[_0xaa5d('0x21')](respondWithResult(_0x2245b6,null))[_0xaa5d('0x48')](handleError(_0x2245b6,null));};
\ No newline at end of file
index d687184..3efcd1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbea2=['lodash','api','moment','bluebird','request-promise','path','./squareOdbc.attributes','define','SquareOdbc','square_odbc'];(function(_0x10eb43,_0x64691){var _0x14e73d=function(_0x1681d5){while(--_0x1681d5){_0x10eb43['push'](_0x10eb43['shift']());}};_0x14e73d(++_0x64691);}(_0xbea2,0x122));var _0x2bea=function(_0x174187,_0x17f4a7){_0x174187=_0x174187-0x0;var _0x364371=_0xbea2[_0x174187];return _0x364371;};'use strict';var _=require(_0x2bea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2bea('0x1'));var moment=require(_0x2bea('0x2'));var BPromise=require(_0x2bea('0x3'));var rp=require(_0x2bea('0x4'));var fs=require('fs');var path=require(_0x2bea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2bea('0x6'));module['exports']=function(_0x2fcf4f,_0x275949){return _0x2fcf4f[_0x2bea('0x7')](_0x2bea('0x8'),attributes,{'tableName':_0x2bea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f57=['path','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api','request-promise'];(function(_0x3802cb,_0x1502ac){var _0x62d009=function(_0x21a202){while(--_0x21a202){_0x3802cb['push'](_0x3802cb['shift']());}};_0x62d009(++_0x1502ac);}(_0x7f57,0x146));var _0x77f5=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x7f57[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x77f5('0x0'));var util=require(_0x77f5('0x1'));var logger=require('../../config/logger')(_0x77f5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x77f5('0x3'));var fs=require('fs');var path=require(_0x77f5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x77f5('0x5'));module[_0x77f5('0x6')]=function(_0x47a915,_0x1e3b53){return _0x47a915[_0x77f5('0x7')](_0x77f5('0x8'),attributes,{'tableName':_0x77f5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 830aee2..4cd570b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf79=['SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','debug','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x2f4b68,_0x4a0353){var _0x901064=function(_0x12f891){while(--_0x12f891){_0x2f4b68['push'](_0x2f4b68['shift']());}};_0x901064(++_0x4a0353);}(_0xdf79,0xf3));var _0x9df7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdf79[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9df7('0x0'));var util=require(_0x9df7('0x1'));var moment=require('moment');var BPromise=require(_0x9df7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9df7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9df7('0x4'))('rpc');var config=require(_0x9df7('0x5'));var jayson=require(_0x9df7('0x6'));var client=jayson[_0x9df7('0x7')][_0x9df7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x360f1f,_0x1a3e03,_0x2ff623){return new BPromise(function(_0x5022fb,_0x3d6257){return client[_0x9df7('0x9')](_0x360f1f,_0x2ff623)['then'](function(_0x57d36f){logger[_0x9df7('0xa')](_0x9df7('0xb'),_0x1a3e03,_0x9df7('0xc'));logger['debug'](_0x9df7('0xd'),_0x1a3e03,_0x9df7('0xc'),JSON[_0x9df7('0xe')](_0x57d36f));if(_0x57d36f['error']){if(_0x57d36f[_0x9df7('0xf')][_0x9df7('0x10')]===0x1f4){logger[_0x9df7('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x1a3e03,_0x57d36f[_0x9df7('0xf')]['message']);return _0x3d6257(_0x57d36f[_0x9df7('0xf')]['message']);}logger[_0x9df7('0xf')](_0x9df7('0xb'),_0x1a3e03,_0x57d36f['error'][_0x9df7('0x11')]);return _0x5022fb(_0x57d36f[_0x9df7('0xf')][_0x9df7('0x11')]);}else{logger['info'](_0x9df7('0xb'),_0x1a3e03,_0x9df7('0xc'));_0x5022fb(_0x57d36f[_0x9df7('0x12')]['message']);}})[_0x9df7('0x13')](function(_0x3bfd8e){logger['error'](_0x9df7('0xb'),_0x1a3e03,_0x3bfd8e);_0x3d6257(_0x3bfd8e);});});}exports[_0x9df7('0x14')]=function(_0x329fd3){var _0x3f67ba=this;return new Promise(function(_0x261b66,_0x4a4b45){return db[_0x9df7('0x15')][_0x9df7('0x16')]({'raw':_0x329fd3[_0x9df7('0x17')]?_0x329fd3[_0x9df7('0x17')][_0x9df7('0x18')]===undefined?!![]:![]:!![],'where':_0x329fd3[_0x9df7('0x17')]?_0x329fd3[_0x9df7('0x17')][_0x9df7('0x19')]||null:null,'attributes':_0x329fd3[_0x9df7('0x17')]?_0x329fd3[_0x9df7('0x17')][_0x9df7('0x1a')]||null:null,'include':_0x329fd3['options']?_0x329fd3[_0x9df7('0x17')][_0x9df7('0x1b')]?_[_0x9df7('0x1c')](_0x329fd3[_0x9df7('0x17')][_0x9df7('0x1b')],function(_0x472822){return{'model':db[_0x472822[_0x9df7('0x1d')]],'as':_0x472822['as'],'attributes':_0x472822[_0x9df7('0x1a')],'include':_0x472822[_0x9df7('0x1b')]?_['map'](_0x472822[_0x9df7('0x1b')],function(_0x5d5a48){return{'model':db[_0x5d5a48[_0x9df7('0x1d')]],'as':_0x5d5a48['as'],'attributes':_0x5d5a48[_0x9df7('0x1a')],'include':_0x5d5a48[_0x9df7('0x1b')]?_[_0x9df7('0x1c')](_0x5d5a48[_0x9df7('0x1b')],function(_0x295f74){return{'model':db[_0x295f74['model']],'as':_0x295f74['as'],'attributes':_0x295f74['attributes']};}):[]};}):[]};}):[]:[]})[_0x9df7('0x1e')](function(_0x1df294){logger[_0x9df7('0xa')](_0x9df7('0x14'),_0x329fd3);logger[_0x9df7('0x1f')](_0x9df7('0x14'),_0x329fd3,JSON[_0x9df7('0xe')](_0x1df294));_0x261b66(_0x1df294);})['catch'](function(_0x2b7a4e){logger[_0x9df7('0xf')](_0x9df7('0x14'),_0x2b7a4e[_0x9df7('0x11')],_0x329fd3);_0x4a4b45(_0x3f67ba[_0x9df7('0xf')](0x1f4,_0x2b7a4e['message']));});});};
\ No newline at end of file
+var _0x2209=['stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','find','options','raw','where','attributes','map','include','model','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x1f8ecf,_0x2e686e){var _0x1b60d4=function(_0xb4050f){while(--_0xb4050f){_0x1f8ecf['push'](_0x1f8ecf['shift']());}};_0x1b60d4(++_0x2e686e);}(_0x2209,0x1e1));var _0x9220=function(_0x1d6e08,_0x2d7096){_0x1d6e08=_0x1d6e08-0x0;var _0x12ab7d=_0x2209[_0x1d6e08];return _0x12ab7d;};'use strict';var _=require('lodash');var util=require(_0x9220('0x0'));var moment=require(_0x9220('0x1'));var BPromise=require(_0x9220('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9220('0x3'));var db=require(_0x9220('0x4'))['db'];var utils=require(_0x9220('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9220('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9220('0x7')][_0x9220('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5214f0,_0x455144,_0x3adc3f){return new BPromise(function(_0x3ab936,_0x2cda06){return client[_0x9220('0x9')](_0x5214f0,_0x3adc3f)[_0x9220('0xa')](function(_0x514449){logger[_0x9220('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x455144,_0x9220('0xc'));logger[_0x9220('0xd')](_0x9220('0xe'),_0x455144,_0x9220('0xc'),JSON[_0x9220('0xf')](_0x514449));if(_0x514449[_0x9220('0x10')]){if(_0x514449[_0x9220('0x10')][_0x9220('0x11')]===0x1f4){logger[_0x9220('0x10')](_0x9220('0x12'),_0x455144,_0x514449[_0x9220('0x10')][_0x9220('0x13')]);return _0x2cda06(_0x514449['error'][_0x9220('0x13')]);}logger['error'](_0x9220('0x12'),_0x455144,_0x514449[_0x9220('0x10')][_0x9220('0x13')]);return _0x3ab936(_0x514449['error'][_0x9220('0x13')]);}else{logger[_0x9220('0xb')](_0x9220('0x12'),_0x455144,_0x9220('0xc'));_0x3ab936(_0x514449[_0x9220('0x14')][_0x9220('0x13')]);}})['catch'](function(_0x54f65a){logger[_0x9220('0x10')](_0x9220('0x12'),_0x455144,_0x54f65a);_0x2cda06(_0x54f65a);});});}exports[_0x9220('0x15')]=function(_0x361648){var _0x358203=this;return new Promise(function(_0x27b6ef,_0xd87db8){return db['SquareOdbc'][_0x9220('0x16')]({'raw':_0x361648[_0x9220('0x17')]?_0x361648[_0x9220('0x17')][_0x9220('0x18')]===undefined?!![]:![]:!![],'where':_0x361648['options']?_0x361648['options'][_0x9220('0x19')]||null:null,'attributes':_0x361648['options']?_0x361648['options'][_0x9220('0x1a')]||null:null,'include':_0x361648[_0x9220('0x17')]?_0x361648[_0x9220('0x17')]['include']?_[_0x9220('0x1b')](_0x361648[_0x9220('0x17')][_0x9220('0x1c')],function(_0x28c0c1){return{'model':db[_0x28c0c1[_0x9220('0x1d')]],'as':_0x28c0c1['as'],'attributes':_0x28c0c1['attributes'],'include':_0x28c0c1['include']?_[_0x9220('0x1b')](_0x28c0c1['include'],function(_0x21ec8a){return{'model':db[_0x21ec8a['model']],'as':_0x21ec8a['as'],'attributes':_0x21ec8a['attributes'],'include':_0x21ec8a[_0x9220('0x1c')]?_[_0x9220('0x1b')](_0x21ec8a[_0x9220('0x1c')],function(_0x41408d){return{'model':db[_0x41408d[_0x9220('0x1d')]],'as':_0x41408d['as'],'attributes':_0x41408d[_0x9220('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44d45c){logger[_0x9220('0xb')](_0x9220('0x15'),_0x361648);logger[_0x9220('0xd')](_0x9220('0x15'),_0x361648,JSON[_0x9220('0xf')](_0x44d45c));_0x27b6ef(_0x44d45c);})[_0x9220('0x1e')](function(_0x43d4d5){logger[_0x9220('0x10')](_0x9220('0x15'),_0x43d4d5[_0x9220('0x13')],_0x361648);_0xd87db8(_0x358203[_0x9220('0x10')](0x1f4,_0x43d4d5['message']));});});};
\ No newline at end of file
index 5ef18cd..eba8e4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafcb=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users','getUsers','create','post','addUsers','put','update','delete','multer','util'];(function(_0x237bfb,_0x211760){var _0x526ac4=function(_0x10ba52){while(--_0x10ba52){_0x237bfb['push'](_0x237bfb['shift']());}};_0x526ac4(++_0x211760);}(_0xafcb,0xb6));var _0xbafc=function(_0x4a842a,_0x9a669d){_0x4a842a=_0x4a842a-0x0;var _0x253da4=_0xafcb[_0x4a842a];return _0x253da4;};'use strict';var multer=require(_0xbafc('0x0'));var util=require(_0xbafc('0x1'));var path=require(_0xbafc('0x2'));var timeout=require(_0xbafc('0x3'));var express=require(_0xbafc('0x4'));var router=express[_0xbafc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbafc('0x6'));var interaction=require(_0xbafc('0x7'));var config=require(_0xbafc('0x8'));var controller=require(_0xbafc('0x9'));router['get']('/',auth[_0xbafc('0xa')](),controller[_0xbafc('0xb')]);router[_0xbafc('0xc')](_0xbafc('0xd'),auth['isAuthenticated'](),controller[_0xbafc('0xe')]);router[_0xbafc('0xc')](_0xbafc('0xf'),auth['isAuthenticated'](),controller[_0xbafc('0x10')]);router['post']('/',auth[_0xbafc('0xa')](),controller[_0xbafc('0x11')]);router[_0xbafc('0x12')](_0xbafc('0xf'),auth[_0xbafc('0xa')](),controller[_0xbafc('0x13')]);router[_0xbafc('0x14')]('/:id',auth[_0xbafc('0xa')](),controller[_0xbafc('0x15')]);router[_0xbafc('0x16')](_0xbafc('0xd'),auth[_0xbafc('0xa')](),controller['destroy']);router[_0xbafc('0x16')]('/:id/users',auth[_0xbafc('0xa')](),controller['removeUsers']);module['exports']=router;
\ No newline at end of file
+var _0x47cb=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','put','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout'];(function(_0x2a431b,_0x140cb2){var _0x1d57f9=function(_0x44c314){while(--_0x44c314){_0x2a431b['push'](_0x2a431b['shift']());}};_0x1d57f9(++_0x140cb2);}(_0x47cb,0x74));var _0xb47c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x47cb[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xb47c('0x0'));var util=require(_0xb47c('0x1'));var path=require(_0xb47c('0x2'));var timeout=require(_0xb47c('0x3'));var express=require(_0xb47c('0x4'));var router=express[_0xb47c('0x5')]();var fs_extra=require(_0xb47c('0x6'));var auth=require(_0xb47c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb47c('0x8'));var controller=require(_0xb47c('0x9'));router[_0xb47c('0xa')]('/',auth[_0xb47c('0xb')](),controller[_0xb47c('0xc')]);router[_0xb47c('0xa')](_0xb47c('0xd'),auth[_0xb47c('0xb')](),controller[_0xb47c('0xe')]);router[_0xb47c('0xa')](_0xb47c('0xf'),auth[_0xb47c('0xb')](),controller[_0xb47c('0x10')]);router[_0xb47c('0x11')]('/',auth[_0xb47c('0xb')](),controller['create']);router[_0xb47c('0x11')](_0xb47c('0xf'),auth[_0xb47c('0xb')](),controller['addUsers']);router[_0xb47c('0x12')](_0xb47c('0xd'),auth['isAuthenticated'](),controller[_0xb47c('0x13')]);router[_0xb47c('0x14')](_0xb47c('0xd'),auth['isAuthenticated'](),controller[_0xb47c('0x15')]);router[_0xb47c('0x14')](_0xb47c('0xf'),auth[_0xb47c('0xb')](),controller[_0xb47c('0x16')]);module[_0xb47c('0x17')]=router;
\ No newline at end of file
index 55160f1..85b8a43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f83=['STRING','name','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x5afdc9,_0x27c000){var _0x37fcc4=function(_0x8d687){while(--_0x8d687){_0x5afdc9['push'](_0x5afdc9['shift']());}};_0x37fcc4(++_0x27c000);}(_0x9f83,0x1ac));var _0x39f8=function(_0x1037a4,_0x2b9a0d){_0x1037a4=_0x1037a4-0x0;var _0x82f9fb=_0x9f83[_0x1037a4];return _0x82f9fb;};'use strict';var Sequelize=require(_0x39f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x39f8('0x1')],'unique':_0x39f8('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x39f8('0x3')](_0x39f8('0x4')),'get':function(){if(this[_0x39f8('0x5')](_0x39f8('0x6'))){return this[_0x39f8('0x5')]('preproduction')[_0x39f8('0x7')](_0x39f8('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x39f8('0x4')),'get':function(){if(this[_0x39f8('0x5')](_0x39f8('0x9'))){return this[_0x39f8('0x5')](_0x39f8('0x9'))[_0x39f8('0x7')](_0x39f8('0x8'));}}},'savedAt':{'type':Sequelize[_0x39f8('0xa')]},'publishedAt':{'type':Sequelize[_0x39f8('0xa')]}};
\ No newline at end of file
+var _0x648b=['preproduction','toString','utf8','production','DATE','sequelize','exports','TEXT','BLOB','long','getDataValue'];(function(_0x54bc96,_0x28eefd){var _0x3577df=function(_0x26c3f0){while(--_0x26c3f0){_0x54bc96['push'](_0x54bc96['shift']());}};_0x3577df(++_0x28eefd);}(_0x648b,0x73));var _0xb648=function(_0x45ff26,_0x8e3b44){_0x45ff26=_0x45ff26-0x0;var _0x4d23f2=_0x648b[_0x45ff26];return _0x4d23f2;};'use strict';var Sequelize=require(_0xb648('0x0'));module[_0xb648('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xb648('0x2')]},'preproduction':{'type':Sequelize[_0xb648('0x3')](_0xb648('0x4')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0xb648('0x5')](_0xb648('0x6'))[_0xb648('0x7')](_0xb648('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xb648('0x4')),'get':function(){if(this[_0xb648('0x5')](_0xb648('0x9'))){return this[_0xb648('0x5')](_0xb648('0x9'))[_0xb648('0x7')](_0xb648('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xb648('0xa')]}};
\ No newline at end of file
index d46872e..c6c21d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c55=['userSquareProject:remove','getUsers','findOne','keys','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','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','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','isArray','emit'];(function(_0x434104,_0x3c51c6){var _0x1c6189=function(_0x10b31b){while(--_0x10b31b){_0x434104['push'](_0x434104['shift']());}};_0x1c6189(++_0x3c51c6);}(_0x4c55,0x1a5));var _0x54c5=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0x4c55[_0x3bf925];return _0x2128a1;};'use strict';var emlformat=require(_0x54c5('0x0'));var rimraf=require(_0x54c5('0x1'));var zipdir=require(_0x54c5('0x2'));var jsonpatch=require(_0x54c5('0x3'));var rp=require(_0x54c5('0x4'));var moment=require(_0x54c5('0x5'));var BPromise=require(_0x54c5('0x6'));var Mustache=require('mustache');var util=require(_0x54c5('0x7'));var path=require(_0x54c5('0x8'));var sox=require(_0x54c5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54c5('0xa'));var _=require('lodash');var squel=require(_0x54c5('0xb'));var crypto=require(_0x54c5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x54c5('0xd'));var toCsv=require(_0x54c5('0xe'));var querystring=require(_0x54c5('0xf'));var Papa=require(_0x54c5('0x10'));var Redis=require(_0x54c5('0x11'));var authService=require(_0x54c5('0x12'));var qs=require(_0x54c5('0x13'));var as=require(_0x54c5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54c5('0x15'))('api');var utils=require(_0x54c5('0x16'));var config=require(_0x54c5('0x17'));var licenseUtil=require(_0x54c5('0x18'));var db=require('../../mysqldb')['db'];config[_0x54c5('0x19')]=_[_0x54c5('0x1a')](config[_0x54c5('0x19')],{'host':_0x54c5('0x1b'),'port':0x18eb});var socket=require(_0x54c5('0x1c'))(new Redis(config['redis']));require(_0x54c5('0x1d'))[_0x54c5('0x1e')](socket);function respondWithStatusCode(_0x62cad4,_0x467387){_0x467387=_0x467387||0xcc;return function(_0x4520f5){if(_0x4520f5){return _0x62cad4[_0x54c5('0x1f')](_0x467387);}return _0x62cad4['status'](_0x467387)[_0x54c5('0x20')]();};}function respondWithResult(_0x149c7b,_0xfd7a26){_0xfd7a26=_0xfd7a26||0xc8;return function(_0x341e62){if(_0x341e62){return _0x149c7b[_0x54c5('0x21')](_0xfd7a26)[_0x54c5('0x22')](_0x341e62);}};}function respondWithFilteredResult(_0xfc8b21,_0x4a621c){return function(_0x1c0937){if(_0x1c0937){var _0x17a5c1=typeof _0x4a621c[_0x54c5('0x23')]===_0x54c5('0x24')&&typeof _0x4a621c['limit']===_0x54c5('0x24');var _0x15155b=_0x1c0937['count'];var _0x15a4f9=_0x17a5c1?0x0:_0x4a621c['offset'];var _0xb56af8=_0x17a5c1?_0x1c0937[_0x54c5('0x25')]:_0x4a621c[_0x54c5('0x23')]+_0x4a621c[_0x54c5('0x26')];var _0x281f38;if(_0xb56af8>=_0x15155b){_0xb56af8=_0x15155b;_0x281f38=0xc8;}else{_0x281f38=0xce;}_0xfc8b21[_0x54c5('0x21')](_0x281f38);return _0xfc8b21[_0x54c5('0x27')](_0x54c5('0x28'),_0x15a4f9+'-'+_0xb56af8+'/'+_0x15155b)[_0x54c5('0x22')](_0x1c0937);}return null;};}function patchUpdates(_0x1a6c66){return function(_0x2599d1){try{jsonpatch[_0x54c5('0x29')](_0x2599d1,_0x1a6c66,!![]);}catch(_0x30c066){return BPromise[_0x54c5('0x2a')](_0x30c066);}return _0x2599d1[_0x54c5('0x2b')]();};}function saveUpdates(_0xf46454,_0x15adda){return function(_0x5acc3c){if(_0x5acc3c){return _0x5acc3c[_0x54c5('0x2c')](_0xf46454)[_0x54c5('0x2d')](function(_0x74a95d){return _0x74a95d;});}return null;};}function removeEntity(_0x219ada,_0x1fc1ac){return function(_0x2e5f96){if(_0x2e5f96){return _0x2e5f96[_0x54c5('0x2e')]()[_0x54c5('0x2d')](function(){var _0x3fcff3=_0x2e5f96[_0x54c5('0x2f')]({'plain':!![]});var _0x28d85c=_0x54c5('0x30');return db[_0x54c5('0x31')][_0x54c5('0x2e')]({'where':{'type':_0x28d85c,'resourceId':_0x3fcff3['id']}})[_0x54c5('0x2d')](function(){return _0x2e5f96;});})[_0x54c5('0x2d')](function(){_0x219ada[_0x54c5('0x21')](0xcc)[_0x54c5('0x20')]();});}};}function handleEntityNotFound(_0x46dc98,_0x1ff537){return function(_0x33e8bc){if(!_0x33e8bc){_0x46dc98['sendStatus'](0x194);}return _0x33e8bc;};}function handleError(_0x37d1ce,_0x20fab6){_0x20fab6=_0x20fab6||0x1f4;return function(_0x181a1f){logger[_0x54c5('0x32')](_0x181a1f[_0x54c5('0x33')]);if(_0x181a1f[_0x54c5('0x34')]){delete _0x181a1f[_0x54c5('0x34')];}_0x37d1ce[_0x54c5('0x21')](_0x20fab6)[_0x54c5('0x35')](_0x181a1f);};}exports[_0x54c5('0x36')]=function(_0x373107,_0x58c3a1){var _0x3ea3a9={},_0x441e02={},_0x5c68b1={'count':0x0,'rows':[]};var _0x41eb27=_[_0x54c5('0x37')](db[_0x54c5('0x38')][_0x54c5('0x39')],function(_0x173b40){return{'name':_0x173b40[_0x54c5('0x3a')],'type':_0x173b40[_0x54c5('0x3b')][_0x54c5('0x3c')]};});_0x441e02['model']=_[_0x54c5('0x37')](_0x41eb27,_0x54c5('0x34'));_0x441e02[_0x54c5('0x3d')]=_['keys'](_0x373107[_0x54c5('0x3d')]);_0x441e02[_0x54c5('0x3e')]=_['intersection'](_0x441e02['model'],_0x441e02[_0x54c5('0x3d')]);_0x3ea3a9[_0x54c5('0x3f')]=_[_0x54c5('0x40')](_0x441e02[_0x54c5('0x41')],qs[_0x54c5('0x42')](_0x373107[_0x54c5('0x3d')][_0x54c5('0x42')]));_0x3ea3a9[_0x54c5('0x3f')]=_0x3ea3a9[_0x54c5('0x3f')][_0x54c5('0x43')]?_0x3ea3a9[_0x54c5('0x3f')]:_0x441e02['model'];if(!_0x373107['query'][_0x54c5('0x44')](_0x54c5('0x45'))){_0x3ea3a9[_0x54c5('0x26')]=qs[_0x54c5('0x26')](_0x373107[_0x54c5('0x3d')][_0x54c5('0x26')]);_0x3ea3a9[_0x54c5('0x23')]=qs[_0x54c5('0x23')](_0x373107[_0x54c5('0x3d')][_0x54c5('0x23')]);}_0x3ea3a9[_0x54c5('0x46')]=qs['sort'](_0x373107[_0x54c5('0x3d')][_0x54c5('0x47')]);_0x3ea3a9['where']=qs['filters'](_[_0x54c5('0x48')](_0x373107[_0x54c5('0x3d')],_0x441e02[_0x54c5('0x3e')]),_0x41eb27);if(_0x373107['query'][_0x54c5('0x49')]){_0x3ea3a9[_0x54c5('0x4a')]=_[_0x54c5('0x4b')](_0x3ea3a9[_0x54c5('0x4a')],{'$or':_[_0x54c5('0x37')](_0x41eb27,function(_0xdc8ac8){if(_0xdc8ac8[_0x54c5('0x3b')]!==_0x54c5('0x4c')){var _0x121780={};_0x121780[_0xdc8ac8['name']]={'$like':'%'+_0x373107[_0x54c5('0x3d')]['filter']+'%'};return _0x121780;}})});}_0x3ea3a9=_[_0x54c5('0x4b')]({},_0x3ea3a9,_0x373107[_0x54c5('0x4d')]);var _0x102160={'where':_0x3ea3a9['where']};return db[_0x54c5('0x38')][_0x54c5('0x25')](_0x102160)['then'](function(_0x4e1839){_0x5c68b1['count']=_0x4e1839;if(_0x373107['query'][_0x54c5('0x4e')]){_0x3ea3a9[_0x54c5('0x4f')]=[{'all':!![]}];}return db[_0x54c5('0x38')][_0x54c5('0x50')](_0x3ea3a9);})[_0x54c5('0x2d')](function(_0x5b72ba){_0x5c68b1[_0x54c5('0x51')]=_0x5b72ba;return _0x5c68b1;})[_0x54c5('0x2d')](respondWithFilteredResult(_0x58c3a1,_0x3ea3a9))[_0x54c5('0x52')](handleError(_0x58c3a1,null));};exports[_0x54c5('0x53')]=function(_0x46f9e7,_0x3853c3){var _0x2665df={'raw':![],'where':{'id':_0x46f9e7[_0x54c5('0x54')]['id']}},_0x3138e6={};_0x3138e6[_0x54c5('0x41')]=_['keys'](db['SquareProject'][_0x54c5('0x39')]);_0x3138e6[_0x54c5('0x3d')]=_['keys'](_0x46f9e7[_0x54c5('0x3d')]);_0x3138e6[_0x54c5('0x3e')]=_[_0x54c5('0x40')](_0x3138e6[_0x54c5('0x41')],_0x3138e6[_0x54c5('0x3d')]);_0x2665df['attributes']=_['intersection'](_0x3138e6[_0x54c5('0x41')],qs['fields'](_0x46f9e7[_0x54c5('0x3d')][_0x54c5('0x42')]));_0x2665df[_0x54c5('0x3f')]=_0x2665df[_0x54c5('0x3f')]['length']?_0x2665df[_0x54c5('0x3f')]:_0x3138e6['model'];if(_0x46f9e7[_0x54c5('0x3d')][_0x54c5('0x4e')]){_0x2665df[_0x54c5('0x4f')]=[{'all':!![]}];}_0x2665df=_['merge']({},_0x2665df,_0x46f9e7['options']);return db[_0x54c5('0x38')][_0x54c5('0x55')](_0x2665df)[_0x54c5('0x2d')](handleEntityNotFound(_0x3853c3,null))[_0x54c5('0x2d')](respondWithResult(_0x3853c3,null))['catch'](handleError(_0x3853c3,null));};exports[_0x54c5('0x56')]=function(_0x4cbad6,_0x21926d){return db[_0x54c5('0x38')]['create'](_0x4cbad6['body'],{})[_0x54c5('0x2d')](function(_0x2f9631){var _0x43974a=_0x4cbad6[_0x54c5('0x57')][_0x54c5('0x2f')]({'plain':!![]});if(!_0x43974a)throw new Error(_0x54c5('0x58'));if(_0x43974a[_0x54c5('0x59')]===_0x54c5('0x57')){var _0x4ad8c8=_0x2f9631[_0x54c5('0x2f')]({'plain':!![]});var _0x9315fb=_0x54c5('0x30');return db['UserProfileSection'][_0x54c5('0x55')]({'where':{'name':_0x9315fb,'userProfileId':_0x43974a['userProfileId']},'raw':!![]})[_0x54c5('0x2d')](function(_0x3ea6fa){if(_0x3ea6fa&&_0x3ea6fa[_0x54c5('0x5a')]===0x0){return db[_0x54c5('0x31')][_0x54c5('0x56')]({'name':_0x4ad8c8[_0x54c5('0x34')],'resourceId':_0x4ad8c8['id'],'type':_0x3ea6fa[_0x54c5('0x34')],'sectionId':_0x3ea6fa['id']},{})[_0x54c5('0x2d')](function(){return _0x2f9631;});}else{return _0x2f9631;}})[_0x54c5('0x52')](function(_0x420c7e){logger['error'](_0x54c5('0x5b'),_0x420c7e);throw _0x420c7e;});}return _0x2f9631;})['then'](respondWithResult(_0x21926d,0xc9))['catch'](handleError(_0x21926d,null));};exports[_0x54c5('0x2c')]=function(_0x2d00c6,_0x2563ed){if(_0x2d00c6[_0x54c5('0x5c')]['id']){delete _0x2d00c6['body']['id'];}return db[_0x54c5('0x38')][_0x54c5('0x55')]({'where':{'id':_0x2d00c6[_0x54c5('0x54')]['id']}})['then'](handleEntityNotFound(_0x2563ed,null))[_0x54c5('0x2d')](saveUpdates(_0x2d00c6[_0x54c5('0x5c')],null))[_0x54c5('0x2d')](respondWithResult(_0x2563ed,null))[_0x54c5('0x52')](handleError(_0x2563ed,null));};exports[_0x54c5('0x2e')]=function(_0x48de9a,_0x5c485e){return db[_0x54c5('0x38')][_0x54c5('0x55')]({'where':{'id':_0x48de9a[_0x54c5('0x54')]['id']}})[_0x54c5('0x2d')](handleEntityNotFound(_0x5c485e,null))['then'](removeEntity(_0x5c485e,null))[_0x54c5('0x52')](handleError(_0x5c485e,null));};exports['addUsers']=function(_0x33cb02,_0x90bdda,_0x2c1f50){return db[_0x54c5('0x38')]['find']({'where':{'id':_0x33cb02[_0x54c5('0x54')]['id']}})[_0x54c5('0x2d')](handleEntityNotFound(_0x90bdda,null))['then'](function(_0x3f421b){if(_0x3f421b){return _0x3f421b[_0x54c5('0x5d')](_0x33cb02['body'][_0x54c5('0x5e')],_[_0x54c5('0x5f')](_0x33cb02['body'],[_0x54c5('0x5e'),'id'])||{});}})[_0x54c5('0x2d')](respondWithResult(_0x90bdda,null))[_0x54c5('0x52')](handleError(_0x90bdda,null));};exports[_0x54c5('0x60')]=function(_0x33c948,_0x5040a,_0x55bb2f){return db[_0x54c5('0x38')][_0x54c5('0x55')]({'where':{'id':_0x33c948[_0x54c5('0x54')]['id']}})[_0x54c5('0x2d')](handleEntityNotFound(_0x5040a,null))[_0x54c5('0x2d')](function(_0x2bc3d8){if(_0x2bc3d8){return _0x2bc3d8['removeUsers'](_0x33c948[_0x54c5('0x3d')][_0x54c5('0x5e')])[_0x54c5('0x2d')](function(){if(_[_0x54c5('0x61')](_0x33c948['query'][_0x54c5('0x5e')])){for(var _0x43bb8b=0x0;_0x43bb8b<_0x33c948[_0x54c5('0x3d')][_0x54c5('0x5e')][_0x54c5('0x43')];_0x43bb8b+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x33c948['query'][_0x54c5('0x5e')][_0x43bb8b]),'SquareProjectId':Number(_0x33c948[_0x54c5('0x54')]['id'])});}}else{socket[_0x54c5('0x62')](_0x54c5('0x63'),{'UserId':Number(_0x33c948[_0x54c5('0x3d')][_0x54c5('0x5e')]),'SquareProjectId':Number(_0x33c948[_0x54c5('0x54')]['id'])});}});}})[_0x54c5('0x2d')](respondWithStatusCode(_0x5040a,null))['catch'](handleError(_0x5040a,null));};exports[_0x54c5('0x64')]=function(_0x4b8661,_0x1e35ae,_0x46cfe2){var _0x480f3f={};var _0x4ee4c1={};var _0x5b6a46;var _0xa6dc08;return db['SquareProject'][_0x54c5('0x65')]({'where':{'id':_0x4b8661['params']['id']}})[_0x54c5('0x2d')](handleEntityNotFound(_0x1e35ae,null))[_0x54c5('0x2d')](function(_0x2a12f8){if(_0x2a12f8){_0x5b6a46=_0x2a12f8;_0x4ee4c1['model']=_[_0x54c5('0x66')](db[_0x54c5('0x67')][_0x54c5('0x39')]);_0x4ee4c1[_0x54c5('0x3d')]=_[_0x54c5('0x66')](_0x4b8661[_0x54c5('0x3d')]);_0x4ee4c1[_0x54c5('0x3e')]=_['intersection'](_0x4ee4c1[_0x54c5('0x41')],_0x4ee4c1[_0x54c5('0x3d')]);_0x480f3f[_0x54c5('0x3f')]=_['intersection'](_0x4ee4c1[_0x54c5('0x41')],qs[_0x54c5('0x42')](_0x4b8661[_0x54c5('0x3d')]['fields']));_0x480f3f[_0x54c5('0x3f')]=_0x480f3f[_0x54c5('0x3f')][_0x54c5('0x43')]?_0x480f3f['attributes']:_0x4ee4c1[_0x54c5('0x41')];_0x480f3f[_0x54c5('0x46')]=qs[_0x54c5('0x47')](_0x4b8661[_0x54c5('0x3d')][_0x54c5('0x47')]);_0x480f3f['where']=qs[_0x54c5('0x3e')](_['pick'](_0x4b8661[_0x54c5('0x3d')],_0x4ee4c1[_0x54c5('0x3e')]));if(_0x4b8661[_0x54c5('0x3d')][_0x54c5('0x49')]){_0x480f3f[_0x54c5('0x4a')]=_[_0x54c5('0x4b')](_0x480f3f[_0x54c5('0x4a')],{'$or':_[_0x54c5('0x37')](_0x480f3f['attributes'],function(_0x5e3629){var _0x2356f9={};_0x2356f9[_0x5e3629]={'$like':'%'+_0x4b8661[_0x54c5('0x3d')][_0x54c5('0x49')]+'%'};return _0x2356f9;})});}_0x480f3f=_[_0x54c5('0x4b')]({},_0x480f3f,_0x4b8661['options']);return _0x5b6a46[_0x54c5('0x64')](_0x480f3f);}})[_0x54c5('0x2d')](function(_0x3988fe){if(_0x3988fe){_0xa6dc08=_0x3988fe[_0x54c5('0x43')];if(!_0x4b8661[_0x54c5('0x3d')][_0x54c5('0x44')](_0x54c5('0x45'))){_0x480f3f[_0x54c5('0x26')]=qs[_0x54c5('0x26')](_0x4b8661['query'][_0x54c5('0x26')]);_0x480f3f[_0x54c5('0x23')]=qs['offset'](_0x4b8661[_0x54c5('0x3d')][_0x54c5('0x23')]);}return _0x5b6a46[_0x54c5('0x64')](_0x480f3f);}})[_0x54c5('0x2d')](function(_0x266a60){if(_0x266a60){return _0x266a60?{'count':_0xa6dc08,'rows':_0x266a60}:null;}})[_0x54c5('0x2d')](respondWithResult(_0x1e35ae,null))[_0x54c5('0x52')](handleError(_0x1e35ae,null));};
\ No newline at end of file
+var _0x164c=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','destroy','addUsers','omit','removeUsers','isArray','ids','emit','userSquareProject:remove','getUsers','findOne','User','order','nolimit','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','get','SquareProjects','UserProfileResource','then','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','params','length','merge'];(function(_0x190502,_0x82e8bc){var _0x14fab8=function(_0x4b13c8){while(--_0x4b13c8){_0x190502['push'](_0x190502['shift']());}};_0x14fab8(++_0x82e8bc);}(_0x164c,0x1ad));var _0xc164=function(_0x5742af,_0x242a6c){_0x5742af=_0x5742af-0x0;var _0x3fa0df=_0x164c[_0x5742af];return _0x3fa0df;};'use strict';var emlformat=require(_0xc164('0x0'));var rimraf=require(_0xc164('0x1'));var zipdir=require(_0xc164('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc164('0x3'));var moment=require(_0xc164('0x4'));var BPromise=require(_0xc164('0x5'));var Mustache=require(_0xc164('0x6'));var util=require(_0xc164('0x7'));var path=require(_0xc164('0x8'));var sox=require(_0xc164('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc164('0xa'));var _=require(_0xc164('0xb'));var squel=require(_0xc164('0xc'));var crypto=require(_0xc164('0xd'));var jsforce=require(_0xc164('0xe'));var deskjs=require(_0xc164('0xf'));var toCsv=require(_0xc164('0x10'));var querystring=require(_0xc164('0x11'));var Papa=require(_0xc164('0x12'));var Redis=require(_0xc164('0x13'));var authService=require(_0xc164('0x14'));var qs=require(_0xc164('0x15'));var as=require(_0xc164('0x16'));var hardwareService=require(_0xc164('0x17'));var logger=require(_0xc164('0x18'))(_0xc164('0x19'));var utils=require(_0xc164('0x1a'));var config=require(_0xc164('0x1b'));var licenseUtil=require(_0xc164('0x1c'));var db=require(_0xc164('0x1d'))['db'];config[_0xc164('0x1e')]=_[_0xc164('0x1f')](config[_0xc164('0x1e')],{'host':_0xc164('0x20'),'port':0x18eb});var socket=require(_0xc164('0x21'))(new Redis(config[_0xc164('0x1e')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x21252f,_0x309d23){_0x309d23=_0x309d23||0xcc;return function(_0x407fd2){if(_0x407fd2){return _0x21252f[_0xc164('0x22')](_0x309d23);}return _0x21252f[_0xc164('0x23')](_0x309d23)[_0xc164('0x24')]();};}function respondWithResult(_0x298028,_0x5cf102){_0x5cf102=_0x5cf102||0xc8;return function(_0x4936a1){if(_0x4936a1){return _0x298028[_0xc164('0x23')](_0x5cf102)[_0xc164('0x25')](_0x4936a1);}};}function respondWithFilteredResult(_0x4237aa,_0x26ad92){return function(_0x7ce64f){if(_0x7ce64f){var _0x2decaa=typeof _0x26ad92[_0xc164('0x26')]===_0xc164('0x27')&&typeof _0x26ad92[_0xc164('0x28')]==='undefined';var _0x24c5ed=_0x7ce64f[_0xc164('0x29')];var _0x51a24c=_0x2decaa?0x0:_0x26ad92[_0xc164('0x26')];var _0xa85b83=_0x2decaa?_0x7ce64f[_0xc164('0x29')]:_0x26ad92['offset']+_0x26ad92[_0xc164('0x28')];var _0x3ea068;if(_0xa85b83>=_0x24c5ed){_0xa85b83=_0x24c5ed;_0x3ea068=0xc8;}else{_0x3ea068=0xce;}_0x4237aa[_0xc164('0x23')](_0x3ea068);return _0x4237aa[_0xc164('0x2a')](_0xc164('0x2b'),_0x51a24c+'-'+_0xa85b83+'/'+_0x24c5ed)['json'](_0x7ce64f);}return null;};}function patchUpdates(_0x300d5d){return function(_0x2bd2c8){try{jsonpatch[_0xc164('0x2c')](_0x2bd2c8,_0x300d5d,!![]);}catch(_0x8d2d2b){return BPromise[_0xc164('0x2d')](_0x8d2d2b);}return _0x2bd2c8['save']();};}function saveUpdates(_0x13e706,_0x3a5af8){return function(_0x3c9a50){if(_0x3c9a50){return _0x3c9a50[_0xc164('0x2e')](_0x13e706)['then'](function(_0x583b44){return _0x583b44;});}return null;};}function removeEntity(_0x5166da,_0x51e8d3){return function(_0x762a9f){if(_0x762a9f){return _0x762a9f['destroy']()['then'](function(){var _0x983bec=_0x762a9f[_0xc164('0x2f')]({'plain':!![]});var _0xcd83dd=_0xc164('0x30');return db[_0xc164('0x31')]['destroy']({'where':{'type':_0xcd83dd,'resourceId':_0x983bec['id']}})[_0xc164('0x32')](function(){return _0x762a9f;});})[_0xc164('0x32')](function(){_0x5166da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37f494,_0x5def0a){return function(_0x3d474b){if(!_0x3d474b){_0x37f494[_0xc164('0x22')](0x194);}return _0x3d474b;};}function handleError(_0x32b951,_0xc2e3bd){_0xc2e3bd=_0xc2e3bd||0x1f4;return function(_0x505510){logger[_0xc164('0x33')](_0x505510[_0xc164('0x34')]);if(_0x505510[_0xc164('0x35')]){delete _0x505510[_0xc164('0x35')];}_0x32b951[_0xc164('0x23')](_0xc2e3bd)['send'](_0x505510);};}exports[_0xc164('0x36')]=function(_0x5bce7f,_0x432e8a){var _0x3c4675={},_0x469144={},_0x2106b2={'count':0x0,'rows':[]};var _0x5a3f80=_[_0xc164('0x37')](db[_0xc164('0x38')][_0xc164('0x39')],function(_0x181a33){return{'name':_0x181a33[_0xc164('0x3a')],'type':_0x181a33[_0xc164('0x3b')]['key']};});_0x469144[_0xc164('0x3c')]=_[_0xc164('0x37')](_0x5a3f80,_0xc164('0x35'));_0x469144[_0xc164('0x3d')]=_[_0xc164('0x3e')](_0x5bce7f[_0xc164('0x3d')]);_0x469144[_0xc164('0x3f')]=_[_0xc164('0x40')](_0x469144['model'],_0x469144['query']);_0x3c4675[_0xc164('0x41')]=_[_0xc164('0x40')](_0x469144[_0xc164('0x3c')],qs[_0xc164('0x42')](_0x5bce7f[_0xc164('0x3d')]['fields']));_0x3c4675[_0xc164('0x41')]=_0x3c4675[_0xc164('0x41')]['length']?_0x3c4675[_0xc164('0x41')]:_0x469144[_0xc164('0x3c')];if(!_0x5bce7f['query'][_0xc164('0x43')]('nolimit')){_0x3c4675[_0xc164('0x28')]=qs[_0xc164('0x28')](_0x5bce7f[_0xc164('0x3d')][_0xc164('0x28')]);_0x3c4675[_0xc164('0x26')]=qs[_0xc164('0x26')](_0x5bce7f['query'][_0xc164('0x26')]);}_0x3c4675['order']=qs[_0xc164('0x44')](_0x5bce7f['query']['sort']);_0x3c4675[_0xc164('0x45')]=qs[_0xc164('0x3f')](_[_0xc164('0x46')](_0x5bce7f[_0xc164('0x3d')],_0x469144[_0xc164('0x3f')]),_0x5a3f80);if(_0x5bce7f[_0xc164('0x3d')][_0xc164('0x47')]){_0x3c4675[_0xc164('0x45')]=_['merge'](_0x3c4675['where'],{'$or':_[_0xc164('0x37')](_0x5a3f80,function(_0x24181e){if(_0x24181e[_0xc164('0x3b')]!==_0xc164('0x48')){var _0x1da1e6={};_0x1da1e6[_0x24181e['name']]={'$like':'%'+_0x5bce7f[_0xc164('0x3d')][_0xc164('0x47')]+'%'};return _0x1da1e6;}})});}_0x3c4675=_['merge']({},_0x3c4675,_0x5bce7f[_0xc164('0x49')]);var _0x58e129={'where':_0x3c4675[_0xc164('0x45')]};return db[_0xc164('0x38')][_0xc164('0x29')](_0x58e129)[_0xc164('0x32')](function(_0x19f3c9){_0x2106b2[_0xc164('0x29')]=_0x19f3c9;if(_0x5bce7f[_0xc164('0x3d')][_0xc164('0x4a')]){_0x3c4675[_0xc164('0x4b')]=[{'all':!![]}];}return db[_0xc164('0x38')]['findAll'](_0x3c4675);})['then'](function(_0x169c6b){_0x2106b2[_0xc164('0x4c')]=_0x169c6b;return _0x2106b2;})[_0xc164('0x32')](respondWithFilteredResult(_0x432e8a,_0x3c4675))[_0xc164('0x4d')](handleError(_0x432e8a,null));};exports['show']=function(_0x14a461,_0x49300e){var _0x1751a8={'raw':![],'where':{'id':_0x14a461[_0xc164('0x4e')]['id']}},_0x527aa6={};_0x527aa6['model']=_[_0xc164('0x3e')](db[_0xc164('0x38')][_0xc164('0x39')]);_0x527aa6[_0xc164('0x3d')]=_[_0xc164('0x3e')](_0x14a461[_0xc164('0x3d')]);_0x527aa6[_0xc164('0x3f')]=_[_0xc164('0x40')](_0x527aa6['model'],_0x527aa6[_0xc164('0x3d')]);_0x1751a8[_0xc164('0x41')]=_[_0xc164('0x40')](_0x527aa6[_0xc164('0x3c')],qs['fields'](_0x14a461[_0xc164('0x3d')][_0xc164('0x42')]));_0x1751a8[_0xc164('0x41')]=_0x1751a8['attributes'][_0xc164('0x4f')]?_0x1751a8[_0xc164('0x41')]:_0x527aa6[_0xc164('0x3c')];if(_0x14a461[_0xc164('0x3d')]['includeAll']){_0x1751a8[_0xc164('0x4b')]=[{'all':!![]}];}_0x1751a8=_[_0xc164('0x50')]({},_0x1751a8,_0x14a461['options']);return db[_0xc164('0x38')][_0xc164('0x51')](_0x1751a8)[_0xc164('0x32')](handleEntityNotFound(_0x49300e,null))['then'](respondWithResult(_0x49300e,null))[_0xc164('0x4d')](handleError(_0x49300e,null));};exports[_0xc164('0x52')]=function(_0x4168a7,_0x1a70af){return db['SquareProject'][_0xc164('0x52')](_0x4168a7['body'],{})[_0xc164('0x32')](function(_0x380c58){var _0x16dd1f=_0x4168a7[_0xc164('0x53')][_0xc164('0x2f')]({'plain':!![]});if(!_0x16dd1f)throw new Error(_0xc164('0x54'));if(_0x16dd1f[_0xc164('0x55')]===_0xc164('0x53')){var _0xabe686=_0x380c58['get']({'plain':!![]});var _0x16ecf5=_0xc164('0x30');return db[_0xc164('0x56')][_0xc164('0x51')]({'where':{'name':_0x16ecf5,'userProfileId':_0x16dd1f[_0xc164('0x57')]},'raw':!![]})['then'](function(_0x279328){if(_0x279328&&_0x279328['autoAssociation']===0x0){return db[_0xc164('0x31')]['create']({'name':_0xabe686['name'],'resourceId':_0xabe686['id'],'type':_0x279328[_0xc164('0x35')],'sectionId':_0x279328['id']},{})['then'](function(){return _0x380c58;});}else{return _0x380c58;}})['catch'](function(_0x8a2f69){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8a2f69);throw _0x8a2f69;});}return _0x380c58;})['then'](respondWithResult(_0x1a70af,0xc9))[_0xc164('0x4d')](handleError(_0x1a70af,null));};exports['update']=function(_0x419608,_0x36130e){if(_0x419608[_0xc164('0x58')]['id']){delete _0x419608[_0xc164('0x58')]['id'];}return db[_0xc164('0x38')][_0xc164('0x51')]({'where':{'id':_0x419608['params']['id']}})['then'](handleEntityNotFound(_0x36130e,null))[_0xc164('0x32')](saveUpdates(_0x419608['body'],null))[_0xc164('0x32')](respondWithResult(_0x36130e,null))[_0xc164('0x4d')](handleError(_0x36130e,null));};exports[_0xc164('0x59')]=function(_0x317b3f,_0x356164){return db[_0xc164('0x38')][_0xc164('0x51')]({'where':{'id':_0x317b3f[_0xc164('0x4e')]['id']}})['then'](handleEntityNotFound(_0x356164,null))[_0xc164('0x32')](removeEntity(_0x356164,null))['catch'](handleError(_0x356164,null));};exports['addUsers']=function(_0x3a6db7,_0x3d1391,_0xecc479){return db['SquareProject']['find']({'where':{'id':_0x3a6db7[_0xc164('0x4e')]['id']}})[_0xc164('0x32')](handleEntityNotFound(_0x3d1391,null))[_0xc164('0x32')](function(_0xa5c27d){if(_0xa5c27d){return _0xa5c27d[_0xc164('0x5a')](_0x3a6db7[_0xc164('0x58')]['ids'],_[_0xc164('0x5b')](_0x3a6db7[_0xc164('0x58')],['ids','id'])||{});}})[_0xc164('0x32')](respondWithResult(_0x3d1391,null))[_0xc164('0x4d')](handleError(_0x3d1391,null));};exports[_0xc164('0x5c')]=function(_0x44389d,_0x16ada0,_0x39e4f1){return db['SquareProject']['find']({'where':{'id':_0x44389d['params']['id']}})[_0xc164('0x32')](handleEntityNotFound(_0x16ada0,null))[_0xc164('0x32')](function(_0x41980f){if(_0x41980f){return _0x41980f[_0xc164('0x5c')](_0x44389d[_0xc164('0x3d')]['ids'])[_0xc164('0x32')](function(){if(_[_0xc164('0x5d')](_0x44389d[_0xc164('0x3d')][_0xc164('0x5e')])){for(var _0x52a497=0x0;_0x52a497<_0x44389d['query'][_0xc164('0x5e')][_0xc164('0x4f')];_0x52a497+=0x1){socket[_0xc164('0x5f')](_0xc164('0x60'),{'UserId':Number(_0x44389d[_0xc164('0x3d')][_0xc164('0x5e')][_0x52a497]),'SquareProjectId':Number(_0x44389d[_0xc164('0x4e')]['id'])});}}else{socket['emit'](_0xc164('0x60'),{'UserId':Number(_0x44389d[_0xc164('0x3d')][_0xc164('0x5e')]),'SquareProjectId':Number(_0x44389d[_0xc164('0x4e')]['id'])});}});}})[_0xc164('0x32')](respondWithStatusCode(_0x16ada0,null))[_0xc164('0x4d')](handleError(_0x16ada0,null));};exports[_0xc164('0x61')]=function(_0x2edf3f,_0x2a84af,_0x47f58c){var _0x2d60a4={};var _0x562993={};var _0x2ea88f;var _0x325ec4;return db[_0xc164('0x38')][_0xc164('0x62')]({'where':{'id':_0x2edf3f[_0xc164('0x4e')]['id']}})[_0xc164('0x32')](handleEntityNotFound(_0x2a84af,null))[_0xc164('0x32')](function(_0x1a0c42){if(_0x1a0c42){_0x2ea88f=_0x1a0c42;_0x562993['model']=_['keys'](db[_0xc164('0x63')][_0xc164('0x39')]);_0x562993['query']=_['keys'](_0x2edf3f[_0xc164('0x3d')]);_0x562993[_0xc164('0x3f')]=_[_0xc164('0x40')](_0x562993[_0xc164('0x3c')],_0x562993[_0xc164('0x3d')]);_0x2d60a4[_0xc164('0x41')]=_[_0xc164('0x40')](_0x562993[_0xc164('0x3c')],qs[_0xc164('0x42')](_0x2edf3f[_0xc164('0x3d')][_0xc164('0x42')]));_0x2d60a4['attributes']=_0x2d60a4[_0xc164('0x41')][_0xc164('0x4f')]?_0x2d60a4[_0xc164('0x41')]:_0x562993['model'];_0x2d60a4[_0xc164('0x64')]=qs['sort'](_0x2edf3f[_0xc164('0x3d')]['sort']);_0x2d60a4['where']=qs[_0xc164('0x3f')](_[_0xc164('0x46')](_0x2edf3f[_0xc164('0x3d')],_0x562993[_0xc164('0x3f')]));if(_0x2edf3f[_0xc164('0x3d')][_0xc164('0x47')]){_0x2d60a4[_0xc164('0x45')]=_['merge'](_0x2d60a4[_0xc164('0x45')],{'$or':_[_0xc164('0x37')](_0x2d60a4['attributes'],function(_0x3b2a13){var _0x23caff={};_0x23caff[_0x3b2a13]={'$like':'%'+_0x2edf3f[_0xc164('0x3d')][_0xc164('0x47')]+'%'};return _0x23caff;})});}_0x2d60a4=_[_0xc164('0x50')]({},_0x2d60a4,_0x2edf3f[_0xc164('0x49')]);return _0x2ea88f['getUsers'](_0x2d60a4);}})[_0xc164('0x32')](function(_0x3b2c69){if(_0x3b2c69){_0x325ec4=_0x3b2c69[_0xc164('0x4f')];if(!_0x2edf3f[_0xc164('0x3d')][_0xc164('0x43')](_0xc164('0x65'))){_0x2d60a4['limit']=qs['limit'](_0x2edf3f[_0xc164('0x3d')][_0xc164('0x28')]);_0x2d60a4[_0xc164('0x26')]=qs[_0xc164('0x26')](_0x2edf3f[_0xc164('0x3d')]['offset']);}return _0x2ea88f[_0xc164('0x61')](_0x2d60a4);}})[_0xc164('0x32')](function(_0x12100c){if(_0x12100c){return _0x12100c?{'count':_0x325ec4,'rows':_0x12100c}:null;}})[_0xc164('0x32')](respondWithResult(_0x2a84af,null))['catch'](handleError(_0x2a84af,null));};
\ No newline at end of file
index 5310512..6085630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x729a=['exports','events','../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x61309d,_0x5d309c){var _0x337e91=function(_0x9915e3){while(--_0x9915e3){_0x61309d['push'](_0x61309d['shift']());}};_0x337e91(++_0x5d309c);}(_0x729a,0x12d));var _0xa729=function(_0x594f77,_0x15659a){_0x594f77=_0x594f77-0x0;var _0x2c62cc=_0x729a[_0x594f77];return _0x2c62cc;};'use strict';var EventEmitter=require(_0xa729('0x0'));var SquareProject=require(_0xa729('0x1'))['db'][_0xa729('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa729('0x3'),'afterUpdate':_0xa729('0x4'),'afterDestroy':_0xa729('0x5')};function emitEvent(_0x2de2d9){return function(_0x343e58,_0x1eaaf0,_0x400a0e){SquareProjectEvents[_0xa729('0x6')](_0x2de2d9+':'+_0x343e58['id'],_0x343e58);SquareProjectEvents['emit'](_0x2de2d9,_0x343e58);_0x400a0e(null);};}for(var e in events){if(events[_0xa729('0x7')](e)){var event=events[e];SquareProject[_0xa729('0x8')](e,emitEvent(event));}}module[_0xa729('0x9')]=SquareProjectEvents;
\ No newline at end of file
+var _0x2f28=['SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x32ab8d,_0x534ff0){var _0xc661c9=function(_0x4a6958){while(--_0x4a6958){_0x32ab8d['push'](_0x32ab8d['shift']());}};_0xc661c9(++_0x534ff0);}(_0x2f28,0x185));var _0x82f2=function(_0x51c938,_0x7b322){_0x51c938=_0x51c938-0x0;var _0x4bb8b2=_0x2f28[_0x51c938];return _0x4bb8b2;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x82f2('0x0'))['db'][_0x82f2('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x82f2('0x2')](0x0);var events={'afterCreate':_0x82f2('0x3'),'afterUpdate':_0x82f2('0x4'),'afterDestroy':_0x82f2('0x5')};function emitEvent(_0x291df0){return function(_0x52fba5,_0x1e2c4f,_0xc3395d){SquareProjectEvents[_0x82f2('0x6')](_0x291df0+':'+_0x52fba5['id'],_0x52fba5);SquareProjectEvents[_0x82f2('0x6')](_0x291df0,_0x52fba5);_0xc3395d(null);};}for(var e in events){if(events[_0x82f2('0x7')](e)){var event=events[e];SquareProject[_0x82f2('0x8')](e,emitEvent(event));}}module[_0x82f2('0x9')]=SquareProjectEvents;
\ No newline at end of file
index 17f3271..1fa5d6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce6d=['exports','define','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0xbd3a05,_0xe6c6b7){var _0x101f90=function(_0x34fbcb){while(--_0x34fbcb){_0xbd3a05['push'](_0xbd3a05['shift']());}};_0x101f90(++_0xe6c6b7);}(_0xce6d,0xd2));var _0xdce6=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0xce6d[_0x4f6d08];return _0x53a9c6;};'use strict';var _=require(_0xdce6('0x0'));var util=require('util');var logger=require(_0xdce6('0x1'))(_0xdce6('0x2'));var moment=require(_0xdce6('0x3'));var BPromise=require(_0xdce6('0x4'));var rp=require(_0xdce6('0x5'));var fs=require('fs');var path=require(_0xdce6('0x6'));var rimraf=require(_0xdce6('0x7'));var config=require(_0xdce6('0x8'));var attributes=require(_0xdce6('0x9'));module[_0xdce6('0xa')]=function(_0x159adb,_0x4f12d1){return _0x159adb[_0xdce6('0xb')]('SquareProject',attributes,{'tableName':_0xdce6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51213b,_0x546f10,_0x17deb7){if(_0x51213b[_0xdce6('0xd')](_0xdce6('0xe'))){_0x51213b[_0xdce6('0xf')]=moment()[_0xdce6('0x10')](_0xdce6('0x11'));}if(_0x51213b['changed'](_0xdce6('0x12'))){_0x51213b[_0xdce6('0x13')]=moment()[_0xdce6('0x10')](_0xdce6('0x11'));}_0x17deb7(null,_0x51213b);}}});};
\ No newline at end of file
+var _0xbcff=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment'];(function(_0x4fd9e5,_0x322434){var _0xbb1cfe=function(_0x48d092){while(--_0x48d092){_0x4fd9e5['push'](_0x4fd9e5['shift']());}};_0xbb1cfe(++_0x322434);}(_0xbcff,0x1e9));var _0xfbcf=function(_0x41b768,_0xf976db){_0x41b768=_0x41b768-0x0;var _0x449102=_0xbcff[_0x41b768];return _0x449102;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var logger=require(_0xfbcf('0x2'))(_0xfbcf('0x3'));var moment=require(_0xfbcf('0x4'));var BPromise=require('bluebird');var rp=require(_0xfbcf('0x5'));var fs=require('fs');var path=require(_0xfbcf('0x6'));var rimraf=require(_0xfbcf('0x7'));var config=require(_0xfbcf('0x8'));var attributes=require(_0xfbcf('0x9'));module[_0xfbcf('0xa')]=function(_0x1c7127,_0x2019d4){return _0x1c7127[_0xfbcf('0xb')]('SquareProject',attributes,{'tableName':_0xfbcf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13fa3d,_0x50e3ac,_0x59afa0){if(_0x13fa3d[_0xfbcf('0xd')]('preproduction')){_0x13fa3d[_0xfbcf('0xe')]=moment()[_0xfbcf('0xf')](_0xfbcf('0x10'));}if(_0x13fa3d[_0xfbcf('0xd')](_0xfbcf('0x11'))){_0x13fa3d[_0xfbcf('0x12')]=moment()[_0xfbcf('0xf')](_0xfbcf('0x10'));}_0x59afa0(null,_0x13fa3d);}}});};
\ No newline at end of file
index b5416a9..5c64374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf77=['include','map','attributes','model','catch','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','request','then','request\x20sent','debug','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','ShowSquareProject','SquareProject','find','options'];(function(_0x270f34,_0x4ee1b6){var _0x52c452=function(_0x1b951c){while(--_0x1b951c){_0x270f34['push'](_0x270f34['shift']());}};_0x52c452(++_0x4ee1b6);}(_0xaf77,0xc5));var _0x7af7=function(_0x3c5735,_0x1f4f53){_0x3c5735=_0x3c5735-0x0;var _0x2cd61d=_0xaf77[_0x3c5735];return _0x2cd61d;};'use strict';var _=require('lodash');var util=require(_0x7af7('0x0'));var moment=require(_0x7af7('0x1'));var BPromise=require('bluebird');var rs=require(_0x7af7('0x2'));var fs=require('fs');var Redis=require(_0x7af7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7af7('0x4'));var config=require(_0x7af7('0x5'));var jayson=require(_0x7af7('0x6'));var client=jayson[_0x7af7('0x7')]['http']({'port':0x232a});config[_0x7af7('0x8')]=_[_0x7af7('0x9')](config[_0x7af7('0x8')],{'host':_0x7af7('0xa'),'port':0x18eb});var socket=require(_0x7af7('0xb'))(new Redis(config[_0x7af7('0x8')]));require(_0x7af7('0xc'))['register'](socket);function respondWithRpcPromise(_0x5564b2,_0xd69c85,_0x2119b4){return new BPromise(function(_0xd00bf7,_0x2e41de){return client[_0x7af7('0xd')](_0x5564b2,_0x2119b4)[_0x7af7('0xe')](function(_0x46c76a){logger['info']('SquareProject,\x20%s,\x20%s',_0xd69c85,_0x7af7('0xf'));logger[_0x7af7('0x10')]('SquareProject,\x20%s,\x20%s,\x20%s',_0xd69c85,_0x7af7('0xf'),JSON[_0x7af7('0x11')](_0x46c76a));if(_0x46c76a[_0x7af7('0x12')]){if(_0x46c76a[_0x7af7('0x12')][_0x7af7('0x13')]===0x1f4){logger[_0x7af7('0x12')](_0x7af7('0x14'),_0xd69c85,_0x46c76a[_0x7af7('0x12')][_0x7af7('0x15')]);return _0x2e41de(_0x46c76a['error'][_0x7af7('0x15')]);}logger[_0x7af7('0x12')](_0x7af7('0x14'),_0xd69c85,_0x46c76a[_0x7af7('0x12')][_0x7af7('0x15')]);return _0xd00bf7(_0x46c76a[_0x7af7('0x12')]['message']);}else{logger['info'](_0x7af7('0x14'),_0xd69c85,_0x7af7('0xf'));_0xd00bf7(_0x46c76a[_0x7af7('0x16')][_0x7af7('0x15')]);}})['catch'](function(_0x56c948){logger[_0x7af7('0x12')](_0x7af7('0x14'),_0xd69c85,_0x56c948);_0x2e41de(_0x56c948);});});}exports[_0x7af7('0x17')]=function(_0x12ac7e){var _0x3d2b8c=this;return new Promise(function(_0x274ebb,_0x1c4678){return db[_0x7af7('0x18')][_0x7af7('0x19')]({'raw':_0x12ac7e[_0x7af7('0x1a')]?_0x12ac7e[_0x7af7('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x12ac7e[_0x7af7('0x1a')]?_0x12ac7e[_0x7af7('0x1a')]['where']||null:null,'attributes':_0x12ac7e[_0x7af7('0x1a')]?_0x12ac7e[_0x7af7('0x1a')]['attributes']||null:null,'include':_0x12ac7e[_0x7af7('0x1a')]?_0x12ac7e[_0x7af7('0x1a')][_0x7af7('0x1b')]?_[_0x7af7('0x1c')](_0x12ac7e[_0x7af7('0x1a')]['include'],function(_0x580986){return{'model':db[_0x580986['model']],'as':_0x580986['as'],'attributes':_0x580986[_0x7af7('0x1d')],'include':_0x580986[_0x7af7('0x1b')]?_[_0x7af7('0x1c')](_0x580986[_0x7af7('0x1b')],function(_0x173af6){return{'model':db[_0x173af6[_0x7af7('0x1e')]],'as':_0x173af6['as'],'attributes':_0x173af6[_0x7af7('0x1d')],'include':_0x173af6[_0x7af7('0x1b')]?_['map'](_0x173af6[_0x7af7('0x1b')],function(_0x12f1ff){return{'model':db[_0x12f1ff[_0x7af7('0x1e')]],'as':_0x12f1ff['as'],'attributes':_0x12f1ff[_0x7af7('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30470a){logger['info'](_0x7af7('0x17'),_0x12ac7e);logger[_0x7af7('0x10')](_0x7af7('0x17'),_0x12ac7e,JSON[_0x7af7('0x11')](_0x30470a));_0x274ebb(_0x30470a);})[_0x7af7('0x1f')](function(_0x42c9a4){logger[_0x7af7('0x12')]('ShowSquareProject',_0x42c9a4['message'],_0x12ac7e);_0x1c4678(_0x3d2b8c[_0x7af7('0x12')](0x1f4,_0x42c9a4[_0x7af7('0x15')]));});});};
\ No newline at end of file
+var _0xbf08=['options','raw','where','attributes','include','map','model','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SquareProject,\x20%s,\x20%s','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','ShowSquareProject','SquareProject','find'];(function(_0x495b69,_0xe469bb){var _0x159311=function(_0x476a71){while(--_0x476a71){_0x495b69['push'](_0x495b69['shift']());}};_0x159311(++_0xe469bb);}(_0xbf08,0x104));var _0x8bf0=function(_0x584acd,_0x2fe8ee){_0x584acd=_0x584acd-0x0;var _0x5215dc=_0xbf08[_0x584acd];return _0x5215dc;};'use strict';var _=require(_0x8bf0('0x0'));var util=require('util');var moment=require(_0x8bf0('0x1'));var BPromise=require(_0x8bf0('0x2'));var rs=require(_0x8bf0('0x3'));var fs=require('fs');var Redis=require(_0x8bf0('0x4'));var db=require(_0x8bf0('0x5'))['db'];var utils=require(_0x8bf0('0x6'));var logger=require(_0x8bf0('0x7'))(_0x8bf0('0x8'));var config=require('../../config/environment');var jayson=require(_0x8bf0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x8bf0('0xa')]=_[_0x8bf0('0xb')](config[_0x8bf0('0xa')],{'host':_0x8bf0('0xc'),'port':0x18eb});var socket=require(_0x8bf0('0xd'))(new Redis(config[_0x8bf0('0xa')]));require('./squareProject.socket')[_0x8bf0('0xe')](socket);function respondWithRpcPromise(_0x144cd2,_0x2f0a4b,_0x2c278e){return new BPromise(function(_0xb533c1,_0x35dfbe){return client[_0x8bf0('0xf')](_0x144cd2,_0x2c278e)[_0x8bf0('0x10')](function(_0x44b18d){logger[_0x8bf0('0x11')](_0x8bf0('0x12'),_0x2f0a4b,'request\x20sent');logger['debug'](_0x8bf0('0x13'),_0x2f0a4b,_0x8bf0('0x14'),JSON['stringify'](_0x44b18d));if(_0x44b18d[_0x8bf0('0x15')]){if(_0x44b18d[_0x8bf0('0x15')][_0x8bf0('0x16')]===0x1f4){logger[_0x8bf0('0x15')](_0x8bf0('0x12'),_0x2f0a4b,_0x44b18d[_0x8bf0('0x15')][_0x8bf0('0x17')]);return _0x35dfbe(_0x44b18d[_0x8bf0('0x15')]['message']);}logger[_0x8bf0('0x15')](_0x8bf0('0x12'),_0x2f0a4b,_0x44b18d[_0x8bf0('0x15')][_0x8bf0('0x17')]);return _0xb533c1(_0x44b18d['error'][_0x8bf0('0x17')]);}else{logger[_0x8bf0('0x11')](_0x8bf0('0x12'),_0x2f0a4b,_0x8bf0('0x14'));_0xb533c1(_0x44b18d['result'][_0x8bf0('0x17')]);}})[_0x8bf0('0x18')](function(_0xec1968){logger['error'](_0x8bf0('0x12'),_0x2f0a4b,_0xec1968);_0x35dfbe(_0xec1968);});});}exports[_0x8bf0('0x19')]=function(_0x5f2aec){var _0x284cdd=this;return new Promise(function(_0x509cd5,_0x5cf3b9){return db[_0x8bf0('0x1a')][_0x8bf0('0x1b')]({'raw':_0x5f2aec[_0x8bf0('0x1c')]?_0x5f2aec[_0x8bf0('0x1c')][_0x8bf0('0x1d')]===undefined?!![]:![]:!![],'where':_0x5f2aec['options']?_0x5f2aec[_0x8bf0('0x1c')][_0x8bf0('0x1e')]||null:null,'attributes':_0x5f2aec[_0x8bf0('0x1c')]?_0x5f2aec[_0x8bf0('0x1c')][_0x8bf0('0x1f')]||null:null,'include':_0x5f2aec[_0x8bf0('0x1c')]?_0x5f2aec[_0x8bf0('0x1c')][_0x8bf0('0x20')]?_[_0x8bf0('0x21')](_0x5f2aec[_0x8bf0('0x1c')][_0x8bf0('0x20')],function(_0x1e78d1){return{'model':db[_0x1e78d1[_0x8bf0('0x22')]],'as':_0x1e78d1['as'],'attributes':_0x1e78d1[_0x8bf0('0x1f')],'include':_0x1e78d1[_0x8bf0('0x20')]?_[_0x8bf0('0x21')](_0x1e78d1[_0x8bf0('0x20')],function(_0x49f185){return{'model':db[_0x49f185['model']],'as':_0x49f185['as'],'attributes':_0x49f185[_0x8bf0('0x1f')],'include':_0x49f185[_0x8bf0('0x20')]?_[_0x8bf0('0x21')](_0x49f185[_0x8bf0('0x20')],function(_0xcac24){return{'model':db[_0xcac24[_0x8bf0('0x22')]],'as':_0xcac24['as'],'attributes':_0xcac24[_0x8bf0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8bf0('0x10')](function(_0x342da9){logger['info']('ShowSquareProject',_0x5f2aec);logger['debug']('ShowSquareProject',_0x5f2aec,JSON[_0x8bf0('0x23')](_0x342da9));_0x509cd5(_0x342da9);})['catch'](function(_0x3bf3c3){logger[_0x8bf0('0x15')](_0x8bf0('0x19'),_0x3bf3c3[_0x8bf0('0x17')],_0x5f2aec);_0x5cf3b9(_0x284cdd[_0x8bf0('0x15')](0x1f4,_0x3bf3c3[_0x8bf0('0x17')]));});});};
\ No newline at end of file
index c17a18d..2edc7e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81e8=['length','update','emit','register'];(function(_0x25ccac,_0x293032){var _0xe7aa52=function(_0x4f9ee1){while(--_0x4f9ee1){_0x25ccac['push'](_0x25ccac['shift']());}};_0xe7aa52(++_0x293032);}(_0x81e8,0xe9));var _0x881e=function(_0x12df5f,_0x459fb9){_0x12df5f=_0x12df5f-0x0;var _0x39baeb=_0x81e8[_0x12df5f];return _0x39baeb;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x881e('0x0')];function createListener(_0x45da80,_0x3a81cd){return function(_0x442700){_0x3a81cd[_0x881e('0x1')](_0x45da80,_0x442700);};}function removeListener(_0x4d1273,_0x2f0fc8){return function(){SquareProjectEvents['removeListener'](_0x4d1273,_0x2f0fc8);};}exports[_0x881e('0x2')]=function(_0xd44e11){for(var _0x384665=0x0,_0x2d86b0=events[_0x881e('0x3')];_0x384665<_0x2d86b0;_0x384665++){var _0x294b48=events[_0x384665];var _0xc01770=createListener('squareProject:'+_0x294b48,_0xd44e11);SquareProjectEvents['on'](_0x294b48,_0xc01770);}};
\ No newline at end of file
+var _0x8d2f=['register','length','squareProject:','./squareProject.events','remove','update','emit'];(function(_0x57f37c,_0x509412){var _0x4b3535=function(_0x3aae68){while(--_0x3aae68){_0x57f37c['push'](_0x57f37c['shift']());}};_0x4b3535(++_0x509412);}(_0x8d2f,0x15a));var _0xf8d2=function(_0x4c99d7,_0x378b6f){_0x4c99d7=_0x4c99d7-0x0;var _0x109a38=_0x8d2f[_0x4c99d7];return _0x109a38;};'use strict';var SquareProjectEvents=require(_0xf8d2('0x0'));var events=['save',_0xf8d2('0x1'),_0xf8d2('0x2')];function createListener(_0xb836f4,_0x152031){return function(_0x38ea51){_0x152031[_0xf8d2('0x3')](_0xb836f4,_0x38ea51);};}function removeListener(_0x4ebd8b,_0x282e81){return function(){SquareProjectEvents['removeListener'](_0x4ebd8b,_0x282e81);};}exports[_0xf8d2('0x4')]=function(_0x1d3681){for(var _0x1f0479=0x0,_0x585d5d=events[_0xf8d2('0x5')];_0x1f0479<_0x585d5d;_0x1f0479++){var _0x3d56e5=events[_0x1f0479];var _0x562ac3=createListener(_0xf8d2('0x6')+_0x3d56e5,_0x1d3681);SquareProjectEvents['on'](_0x3d56e5,_0x562ac3);}};
\ No newline at end of file
index 8a67d41..c4558d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x5a0722,_0xef0289){var _0x13e1b6=function(_0x146234){while(--_0x146234){_0x5a0722['push'](_0x5a0722['shift']());}};_0x13e1b6(++_0xef0289);}(_0xe14b,0x93));var _0xbe14=function(_0x160a4e,_0x6b75b){_0x160a4e=_0x160a4e-0x0;var _0x552404=_0xe14b[_0x160a4e];return _0x552404;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router;
\ No newline at end of file
+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(_0x425237,_0x4dd152){var _0x53f72b=function(_0x5d194f){while(--_0x5d194f){_0x425237['push'](_0x425237['shift']());}};_0x53f72b(++_0x4dd152);}(_0x53ec,0x192));var _0xc53e=function(_0x554d9b,_0x2ff157){_0x554d9b=_0x554d9b-0x0;var _0x24c6dd=_0x53ec[_0x554d9b];return _0x24c6dd;};'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
index 9d6d07e..b7dd7d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize'];(function(_0x357c03,_0x2cfc54){var _0x466257=function(_0xf9f6f2){while(--_0xf9f6f2){_0x357c03['push'](_0x357c03['shift']());}};_0x466257(++_0x2cfc54);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4050f1,_0x1214ae){_0x4050f1=_0x4050f1-0x0;var _0x3e22bb=_0x8d0e[_0x4050f1];return _0x3e22bb;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'callerid':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'context':{'type':Sequelize[_0xe8d0('0x2')]},'extension':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize[_0xe8d0('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xe8d0('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xe8d0('0x2')]},'format':{'type':Sequelize[_0xe8d0('0x3')],'get':function(){var _0x469d37='';var _0xcc03d0=this[_0xe8d0('0x4')](_0xe8d0('0x5'));if(_0xcc03d0){_0x469d37=_0xcc03d0[_0xe8d0('0x6')](_0xcc03d0[_0xe8d0('0x7')]('.'));}return _0x469d37;}}};
\ No newline at end of file
+var _0xdbf5=['lastIndexOf','exports','STRING','VIRTUAL','savePath'];(function(_0x2dbb1c,_0x21c600){var _0x46e168=function(_0x4b6e8e){while(--_0x4b6e8e){_0x2dbb1c['push'](_0x2dbb1c['shift']());}};_0x46e168(++_0x21c600);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4e5206,_0x1c3e9c){_0x4e5206=_0x4e5206-0x0;var _0x34de7f=_0xdbf5[_0x4e5206];return _0x34de7f;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5dbf('0x1')]},'context':{'type':Sequelize[_0x5dbf('0x1')]},'extension':{'type':Sequelize[_0x5dbf('0x1')]},'priority':{'type':Sequelize[_0x5dbf('0x1')]},'accountcode':{'type':Sequelize[_0x5dbf('0x1')]},'dnid':{'type':Sequelize[_0x5dbf('0x1')]},'projectName':{'type':Sequelize[_0x5dbf('0x1')]},'saveName':{'type':Sequelize[_0x5dbf('0x1')]},'filename':{'type':Sequelize[_0x5dbf('0x1')]},'savePath':{'type':Sequelize[_0x5dbf('0x1')]},'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){var _0x88128e='';var _0x93e657=this['getDataValue'](_0x5dbf('0x3'));if(_0x93e657){_0x88128e=_0x93e657['substring'](_0x93e657[_0x5dbf('0x4')]('.'));}return _0x88128e;}}};
\ No newline at end of file
index e4c6d68..9984745 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1638=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','save','then','destroy','sendStatus','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','find','catch','create','body','update','params','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','unlink','message','Entity\x20not\x20found','info','isNil','unlinkSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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'];(function(_0x4bc428,_0xf56dd9){var _0x3ca37f=function(_0x39db20){while(--_0x39db20){_0x4bc428['push'](_0x4bc428['shift']());}};_0x3ca37f(++_0xf56dd9);}(_0x1638,0x118));var _0x8163=function(_0x22d7e6,_0xa620e7){_0x22d7e6=_0x22d7e6-0x0;var _0x72bc58=_0x1638[_0x22d7e6];return _0x72bc58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8163('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8163('0x1'));var rp=require(_0x8163('0x2'));var moment=require(_0x8163('0x3'));var BPromise=require(_0x8163('0x4'));var Mustache=require(_0x8163('0x5'));var util=require(_0x8163('0x6'));var path=require(_0x8163('0x7'));var sox=require(_0x8163('0x8'));var csv=require('to-csv');var ejs=require(_0x8163('0x9'));var fs=require('fs');var fs_extra=require(_0x8163('0xa'));var _=require(_0x8163('0xb'));var squel=require(_0x8163('0xc'));var crypto=require(_0x8163('0xd'));var jsforce=require(_0x8163('0xe'));var deskjs=require(_0x8163('0xf'));var toCsv=require(_0x8163('0x10'));var querystring=require(_0x8163('0x11'));var Papa=require(_0x8163('0x12'));var Redis=require(_0x8163('0x13'));var authService=require(_0x8163('0x14'));var qs=require(_0x8163('0x15'));var as=require(_0x8163('0x16'));var hardwareService=require(_0x8163('0x17'));var logger=require(_0x8163('0x18'))(_0x8163('0x19'));var utils=require(_0x8163('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x8163('0x1b'));var db=require(_0x8163('0x1c'))['db'];function respondWithStatusCode(_0x1b12ea,_0x2cef7d){_0x2cef7d=_0x2cef7d||0xcc;return function(_0x3de356){if(_0x3de356){return _0x1b12ea['sendStatus'](_0x2cef7d);}return _0x1b12ea[_0x8163('0x1d')](_0x2cef7d)[_0x8163('0x1e')]();};}function respondWithResult(_0x2e3439,_0x4c497c){_0x4c497c=_0x4c497c||0xc8;return function(_0x4b8278){if(_0x4b8278){return _0x2e3439[_0x8163('0x1d')](_0x4c497c)[_0x8163('0x1f')](_0x4b8278);}};}function respondWithFilteredResult(_0x5675e9,_0x419365){return function(_0xfb05a5){if(_0xfb05a5){var _0x5b648a=typeof _0x419365[_0x8163('0x20')]==='undefined'&&typeof _0x419365[_0x8163('0x21')]===_0x8163('0x22');var _0xe8b121=_0xfb05a5['count'];var _0x3e475f=_0x5b648a?0x0:_0x419365['offset'];var _0x5cd2b9=_0x5b648a?_0xfb05a5[_0x8163('0x23')]:_0x419365[_0x8163('0x20')]+_0x419365[_0x8163('0x21')];var _0x4df462;if(_0x5cd2b9>=_0xe8b121){_0x5cd2b9=_0xe8b121;_0x4df462=0xc8;}else{_0x4df462=0xce;}_0x5675e9[_0x8163('0x1d')](_0x4df462);return _0x5675e9['set'](_0x8163('0x24'),_0x3e475f+'-'+_0x5cd2b9+'/'+_0xe8b121)[_0x8163('0x1f')](_0xfb05a5);}return null;};}function patchUpdates(_0x22923d){return function(_0x355bc6){try{jsonpatch['apply'](_0x355bc6,_0x22923d,!![]);}catch(_0x16d20f){return BPromise['reject'](_0x16d20f);}return _0x355bc6[_0x8163('0x25')]();};}function saveUpdates(_0x45f876,_0x3bffa3){return function(_0x481b31){if(_0x481b31){return _0x481b31['update'](_0x45f876)[_0x8163('0x26')](function(_0x3d9733){return _0x3d9733;});}return null;};}function removeEntity(_0x581308,_0x3b90d5){return function(_0x4e4b49){if(_0x4e4b49){return _0x4e4b49[_0x8163('0x27')]()[_0x8163('0x26')](function(){_0x581308['status'](0xcc)[_0x8163('0x1e')]();});}};}function handleEntityNotFound(_0x15add4,_0x55e010){return function(_0x56ce78){if(!_0x56ce78){_0x15add4[_0x8163('0x28')](0x194);}return _0x56ce78;};}function handleError(_0x130e36,_0xd63e31){_0xd63e31=_0xd63e31||0x1f4;return function(_0xc7a25e){logger['error'](_0xc7a25e[_0x8163('0x29')]);if(_0xc7a25e['name']){delete _0xc7a25e[_0x8163('0x2a')];}_0x130e36[_0x8163('0x1d')](_0xd63e31)[_0x8163('0x2b')](_0xc7a25e);};}exports[_0x8163('0x2c')]=function(_0x594ac4,_0x6d24bf){var _0x581803={},_0x18a94a={},_0x56f930={'count':0x0,'rows':[]};var _0x29fcef=_[_0x8163('0x2d')](db[_0x8163('0x2e')][_0x8163('0x2f')],function(_0x5575e5){return{'name':_0x5575e5[_0x8163('0x30')],'type':_0x5575e5['type'][_0x8163('0x31')]};});_0x18a94a[_0x8163('0x32')]=_[_0x8163('0x2d')](_0x29fcef,_0x8163('0x2a'));_0x18a94a[_0x8163('0x33')]=_[_0x8163('0x34')](_0x594ac4[_0x8163('0x33')]);_0x18a94a[_0x8163('0x35')]=_[_0x8163('0x36')](_0x18a94a['model'],_0x18a94a[_0x8163('0x33')]);_0x581803['attributes']=_[_0x8163('0x36')](_0x18a94a['model'],qs[_0x8163('0x37')](_0x594ac4[_0x8163('0x33')][_0x8163('0x37')]));_0x581803[_0x8163('0x38')]=_0x581803[_0x8163('0x38')][_0x8163('0x39')]?_0x581803[_0x8163('0x38')]:_0x18a94a[_0x8163('0x32')];if(!_0x594ac4[_0x8163('0x33')][_0x8163('0x3a')](_0x8163('0x3b'))){_0x581803[_0x8163('0x21')]=qs['limit'](_0x594ac4['query'][_0x8163('0x21')]);_0x581803[_0x8163('0x20')]=qs[_0x8163('0x20')](_0x594ac4[_0x8163('0x33')]['offset']);}_0x581803[_0x8163('0x3c')]=qs[_0x8163('0x3d')](_0x594ac4['query']['sort']);_0x581803[_0x8163('0x3e')]=qs['filters'](_[_0x8163('0x3f')](_0x594ac4[_0x8163('0x33')],_0x18a94a[_0x8163('0x35')]),_0x29fcef);if(_0x594ac4['query'][_0x8163('0x40')]){_0x581803[_0x8163('0x3e')]=_[_0x8163('0x41')](_0x581803[_0x8163('0x3e')],{'$or':_[_0x8163('0x2d')](_0x29fcef,function(_0x18ba07){if(_0x18ba07['type']!==_0x8163('0x42')){var _0x209af7={};_0x209af7[_0x18ba07[_0x8163('0x2a')]]={'$like':'%'+_0x594ac4[_0x8163('0x33')]['filter']+'%'};return _0x209af7;}})});}_0x581803=_[_0x8163('0x41')]({},_0x581803,_0x594ac4[_0x8163('0x43')]);var _0x1e9a4={'where':_0x581803[_0x8163('0x3e')]};return db[_0x8163('0x2e')][_0x8163('0x23')](_0x1e9a4)[_0x8163('0x26')](function(_0x59a1a3){_0x56f930[_0x8163('0x23')]=_0x59a1a3;if(_0x594ac4[_0x8163('0x33')][_0x8163('0x44')]){_0x581803[_0x8163('0x45')]=[{'all':!![]}];}return db[_0x8163('0x2e')][_0x8163('0x46')](_0x581803);})[_0x8163('0x26')](function(_0x1f2092){_0x56f930['rows']=_0x1f2092;return _0x56f930;})[_0x8163('0x26')](respondWithFilteredResult(_0x6d24bf,_0x581803))['catch'](handleError(_0x6d24bf,null));};exports['show']=function(_0xd77d3f,_0x466aec){var _0x47e419={'raw':!![],'where':{'id':_0xd77d3f['params']['id']}},_0x48cfe3={};_0x48cfe3['model']=_['keys'](db['SquareRecording']['rawAttributes']);_0x48cfe3[_0x8163('0x33')]=_['keys'](_0xd77d3f['query']);_0x48cfe3[_0x8163('0x35')]=_[_0x8163('0x36')](_0x48cfe3[_0x8163('0x32')],_0x48cfe3[_0x8163('0x33')]);_0x47e419[_0x8163('0x38')]=_['intersection'](_0x48cfe3['model'],qs[_0x8163('0x37')](_0xd77d3f[_0x8163('0x33')][_0x8163('0x37')]));_0x47e419['attributes']=_0x47e419[_0x8163('0x38')]['length']?_0x47e419[_0x8163('0x38')]:_0x48cfe3[_0x8163('0x32')];if(_0xd77d3f[_0x8163('0x33')]['includeAll']){_0x47e419['include']=[{'all':!![]}];}_0x47e419=_[_0x8163('0x41')]({},_0x47e419,_0xd77d3f[_0x8163('0x43')]);return db[_0x8163('0x2e')][_0x8163('0x47')](_0x47e419)[_0x8163('0x26')](handleEntityNotFound(_0x466aec,null))[_0x8163('0x26')](respondWithResult(_0x466aec,null))[_0x8163('0x48')](handleError(_0x466aec,null));};exports[_0x8163('0x49')]=function(_0x1b9f22,_0x4cdbde){return db[_0x8163('0x2e')]['create'](_0x1b9f22[_0x8163('0x4a')],{})[_0x8163('0x26')](respondWithResult(_0x4cdbde,0xc9))['catch'](handleError(_0x4cdbde,null));};exports[_0x8163('0x4b')]=function(_0x140d59,_0x2a9ca3){if(_0x140d59[_0x8163('0x4a')]['id']){delete _0x140d59['body']['id'];}return db[_0x8163('0x2e')][_0x8163('0x47')]({'where':{'id':_0x140d59[_0x8163('0x4c')]['id']}})[_0x8163('0x26')](handleEntityNotFound(_0x2a9ca3,null))['then'](saveUpdates(_0x140d59[_0x8163('0x4a')],null))[_0x8163('0x26')](respondWithResult(_0x2a9ca3,null))[_0x8163('0x48')](handleError(_0x2a9ca3,null));};exports['download']=function(_0x4cf5f6,_0x25025f,_0x16ead1){var _0x1d04f4=require(_0x8163('0x4d'));var _0x4355c9=![];var _0x328aea={};if(_0x4cf5f6[_0x8163('0x33')][_0x8163('0x4e')]&&_0x4cf5f6[_0x8163('0x33')]['type']===_0x8163('0x4f')){_0x328aea[_0x8163('0x4f')]=_0x4cf5f6[_0x8163('0x4c')]['id'];}else{_0x328aea['id']=_0x4cf5f6[_0x8163('0x4c')]['id'];}return db['SquareRecording']['find']({'where':_0x328aea,'attributes':['id',_0x8163('0x50'),_0x8163('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x25025f,null))[_0x8163('0x26')](function(_0x46b0e3){if(_0x46b0e3){var _0x293336=_0x46b0e3[_0x8163('0x50')];var _0x101fdd=util[_0x8163('0x52')](_0x8163('0x53'),_0x293336);if(fs['existsSync'](_0x101fdd)){_0x4355c9=!![];return _0x1d04f4[_0x8163('0x54')](_0x101fdd,_0x293336,config[_0x8163('0x55')][_0x8163('0x56')])[_0x8163('0x26')](function(){return _0x46b0e3;});}return _0x46b0e3;}})[_0x8163('0x26')](function(_0x28c774){if(_0x28c774){var _0x3b6d81=_0x28c774[_0x8163('0x50')];if(!fs[_0x8163('0x57')](_0x3b6d81)){throw new db[(_0x8163('0x58'))][(_0x8163('0x59'))](_0x8163('0x5a'));}if(_0x28c774['filename']){return _0x25025f[_0x8163('0x5b')](_0x3b6d81,_0x28c774[_0x8163('0x51')]+path['extname'](_0x3b6d81),function(){if(_0x4355c9){fs[_0x8163('0x5c')](_0x3b6d81);}});}else{return _0x25025f[_0x8163('0x5b')](_0x3b6d81,function(_0x9a6945){if(_0x4355c9){fs['unlink'](_0x3b6d81);}});}}})[_0x8163('0x48')](function(_0xf4afa9){if(_0xf4afa9[_0x8163('0x5d')]===_0x8163('0x5a')){_0x25025f[_0x8163('0x1d')](0x194)['send']('Not\x20found');}else{return handleError(_0x25025f,null);}});};exports[_0x8163('0x27')]=function(_0x35fc66,_0x3f8c3d){return db['SquareRecording'][_0x8163('0x47')]({'where':{'id':_0x35fc66[_0x8163('0x4c')]['id']}})[_0x8163('0x26')](function(_0x12ecc6){if(_['isNil'](_0x12ecc6)){throw new ReferenceError(_0x8163('0x5e'));}return _0x12ecc6;})[_0x8163('0x26')](function(_0x1a3dcc){var _0x46c8aa=_0x1a3dcc[_0x8163('0x50')];logger[_0x8163('0x5f')]('cancellazione\x20fisica\x20documento\x20%s',_0x46c8aa);if(!_[_0x8163('0x60')](_0x1a3dcc['savePath'])&&fs[_0x8163('0x57')](_0x46c8aa)){logger[_0x8163('0x5f')]('File:\x20\x22'+_0x46c8aa+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8163('0x61')](_0x46c8aa);}_0x46c8aa=_0x46c8aa+'.cypher';if(!_[_0x8163('0x60')](_0x1a3dcc[_0x8163('0x50')])&&fs['existsSync'](_0x46c8aa)){logger[_0x8163('0x5f')](_0x8163('0x62')+_0x46c8aa+_0x8163('0x63'));fs['unlinkSync'](_0x46c8aa);}return _0x1a3dcc;})[_0x8163('0x26')](function(_0x1a93a1){if(!_0x1a93a1)throw new InternalError();return _0x1a93a1[_0x8163('0x27')]();})[_0x8163('0x26')](function(){_0x3f8c3d[_0x8163('0x1d')](0xcc)[_0x8163('0x1e')]();})[_0x8163('0x48')](handleError(_0x3f8c3d,null));};
\ No newline at end of file
+var _0xe572=['Content-Range','apply','save','update','then','destroy','status','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','nolimit','limit','sort','where','filters','pick','filter','type','merge','options','SquareRecording','includeAll','include','rows','catch','show','params','keys','find','create','body','download','../../components/encryptor','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','count','set'];(function(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0xe572,0x16a));var _0x2e57=function(_0x239759,_0x13aac7){_0x239759=_0x239759-0x0;var _0x26fe30=_0xe572[_0x239759];return _0x26fe30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e57('0x0'));var zipdir=require(_0x2e57('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e57('0x2'));var moment=require('moment');var BPromise=require(_0x2e57('0x3'));var Mustache=require(_0x2e57('0x4'));var util=require(_0x2e57('0x5'));var path=require(_0x2e57('0x6'));var sox=require(_0x2e57('0x7'));var csv=require(_0x2e57('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e57('0x9'));var squel=require(_0x2e57('0xa'));var crypto=require(_0x2e57('0xb'));var jsforce=require(_0x2e57('0xc'));var deskjs=require(_0x2e57('0xd'));var toCsv=require(_0x2e57('0x8'));var querystring=require(_0x2e57('0xe'));var Papa=require(_0x2e57('0xf'));var Redis=require(_0x2e57('0x10'));var authService=require(_0x2e57('0x11'));var qs=require(_0x2e57('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e57('0x13'));var logger=require(_0x2e57('0x14'))('api');var utils=require(_0x2e57('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2e57('0x16'))['db'];function respondWithStatusCode(_0x28fc60,_0x237567){_0x237567=_0x237567||0xcc;return function(_0x4ce74d){if(_0x4ce74d){return _0x28fc60[_0x2e57('0x17')](_0x237567);}return _0x28fc60['status'](_0x237567)[_0x2e57('0x18')]();};}function respondWithResult(_0x560e1f,_0x4e2e23){_0x4e2e23=_0x4e2e23||0xc8;return function(_0x37eb5a){if(_0x37eb5a){return _0x560e1f['status'](_0x4e2e23)[_0x2e57('0x19')](_0x37eb5a);}};}function respondWithFilteredResult(_0x4947ae,_0x53fc5b){return function(_0x51d75f){if(_0x51d75f){var _0x53bfd4=typeof _0x53fc5b[_0x2e57('0x1a')]===_0x2e57('0x1b')&&typeof _0x53fc5b['limit']===_0x2e57('0x1b');var _0x24d8be=_0x51d75f[_0x2e57('0x1c')];var _0x32a2e5=_0x53bfd4?0x0:_0x53fc5b[_0x2e57('0x1a')];var _0x3122b9=_0x53bfd4?_0x51d75f[_0x2e57('0x1c')]:_0x53fc5b[_0x2e57('0x1a')]+_0x53fc5b['limit'];var _0x53b2b7;if(_0x3122b9>=_0x24d8be){_0x3122b9=_0x24d8be;_0x53b2b7=0xc8;}else{_0x53b2b7=0xce;}_0x4947ae['status'](_0x53b2b7);return _0x4947ae[_0x2e57('0x1d')](_0x2e57('0x1e'),_0x32a2e5+'-'+_0x3122b9+'/'+_0x24d8be)[_0x2e57('0x19')](_0x51d75f);}return null;};}function patchUpdates(_0x10c515){return function(_0x1f138b){try{jsonpatch[_0x2e57('0x1f')](_0x1f138b,_0x10c515,!![]);}catch(_0x47e43b){return BPromise['reject'](_0x47e43b);}return _0x1f138b[_0x2e57('0x20')]();};}function saveUpdates(_0x172729,_0x1e8636){return function(_0x2d2bec){if(_0x2d2bec){return _0x2d2bec[_0x2e57('0x21')](_0x172729)[_0x2e57('0x22')](function(_0x1b67da){return _0x1b67da;});}return null;};}function removeEntity(_0x5f1bfc,_0x4e5257){return function(_0x53e292){if(_0x53e292){return _0x53e292[_0x2e57('0x23')]()[_0x2e57('0x22')](function(){_0x5f1bfc[_0x2e57('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ebc8,_0x2a55df){return function(_0x123ffb){if(!_0x123ffb){_0x38ebc8['sendStatus'](0x194);}return _0x123ffb;};}function handleError(_0x3595f6,_0x592dbe){_0x592dbe=_0x592dbe||0x1f4;return function(_0x248ef1){logger[_0x2e57('0x25')](_0x248ef1[_0x2e57('0x26')]);if(_0x248ef1[_0x2e57('0x27')]){delete _0x248ef1[_0x2e57('0x27')];}_0x3595f6[_0x2e57('0x24')](_0x592dbe)[_0x2e57('0x28')](_0x248ef1);};}exports[_0x2e57('0x29')]=function(_0x4279ff,_0x26045c){var _0x3146a2={},_0x502cf6={},_0x3dc56b={'count':0x0,'rows':[]};var _0x232b5e=_[_0x2e57('0x2a')](db['SquareRecording'][_0x2e57('0x2b')],function(_0x35df2c){return{'name':_0x35df2c[_0x2e57('0x2c')],'type':_0x35df2c['type'][_0x2e57('0x2d')]};});_0x502cf6[_0x2e57('0x2e')]=_[_0x2e57('0x2a')](_0x232b5e,'name');_0x502cf6[_0x2e57('0x2f')]=_['keys'](_0x4279ff[_0x2e57('0x2f')]);_0x502cf6['filters']=_[_0x2e57('0x30')](_0x502cf6[_0x2e57('0x2e')],_0x502cf6['query']);_0x3146a2['attributes']=_['intersection'](_0x502cf6[_0x2e57('0x2e')],qs['fields'](_0x4279ff[_0x2e57('0x2f')][_0x2e57('0x31')]));_0x3146a2[_0x2e57('0x32')]=_0x3146a2[_0x2e57('0x32')][_0x2e57('0x33')]?_0x3146a2[_0x2e57('0x32')]:_0x502cf6[_0x2e57('0x2e')];if(!_0x4279ff[_0x2e57('0x2f')]['hasOwnProperty'](_0x2e57('0x34'))){_0x3146a2['limit']=qs['limit'](_0x4279ff[_0x2e57('0x2f')][_0x2e57('0x35')]);_0x3146a2[_0x2e57('0x1a')]=qs[_0x2e57('0x1a')](_0x4279ff[_0x2e57('0x2f')][_0x2e57('0x1a')]);}_0x3146a2['order']=qs[_0x2e57('0x36')](_0x4279ff[_0x2e57('0x2f')][_0x2e57('0x36')]);_0x3146a2[_0x2e57('0x37')]=qs[_0x2e57('0x38')](_[_0x2e57('0x39')](_0x4279ff['query'],_0x502cf6[_0x2e57('0x38')]),_0x232b5e);if(_0x4279ff['query'][_0x2e57('0x3a')]){_0x3146a2['where']=_['merge'](_0x3146a2[_0x2e57('0x37')],{'$or':_[_0x2e57('0x2a')](_0x232b5e,function(_0x715941){if(_0x715941[_0x2e57('0x3b')]!=='VIRTUAL'){var _0x2df0b8={};_0x2df0b8[_0x715941[_0x2e57('0x27')]]={'$like':'%'+_0x4279ff[_0x2e57('0x2f')][_0x2e57('0x3a')]+'%'};return _0x2df0b8;}})});}_0x3146a2=_[_0x2e57('0x3c')]({},_0x3146a2,_0x4279ff[_0x2e57('0x3d')]);var _0x1c5a3d={'where':_0x3146a2[_0x2e57('0x37')]};return db[_0x2e57('0x3e')]['count'](_0x1c5a3d)[_0x2e57('0x22')](function(_0x37f80d){_0x3dc56b['count']=_0x37f80d;if(_0x4279ff[_0x2e57('0x2f')][_0x2e57('0x3f')]){_0x3146a2[_0x2e57('0x40')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x3146a2);})[_0x2e57('0x22')](function(_0x287b07){_0x3dc56b[_0x2e57('0x41')]=_0x287b07;return _0x3dc56b;})[_0x2e57('0x22')](respondWithFilteredResult(_0x26045c,_0x3146a2))[_0x2e57('0x42')](handleError(_0x26045c,null));};exports[_0x2e57('0x43')]=function(_0x21f2b,_0x4cdd11){var _0x5ec1e9={'raw':!![],'where':{'id':_0x21f2b[_0x2e57('0x44')]['id']}},_0x4320ad={};_0x4320ad[_0x2e57('0x2e')]=_[_0x2e57('0x45')](db[_0x2e57('0x3e')][_0x2e57('0x2b')]);_0x4320ad[_0x2e57('0x2f')]=_['keys'](_0x21f2b['query']);_0x4320ad['filters']=_[_0x2e57('0x30')](_0x4320ad[_0x2e57('0x2e')],_0x4320ad[_0x2e57('0x2f')]);_0x5ec1e9[_0x2e57('0x32')]=_[_0x2e57('0x30')](_0x4320ad[_0x2e57('0x2e')],qs[_0x2e57('0x31')](_0x21f2b[_0x2e57('0x2f')][_0x2e57('0x31')]));_0x5ec1e9[_0x2e57('0x32')]=_0x5ec1e9[_0x2e57('0x32')][_0x2e57('0x33')]?_0x5ec1e9[_0x2e57('0x32')]:_0x4320ad[_0x2e57('0x2e')];if(_0x21f2b[_0x2e57('0x2f')][_0x2e57('0x3f')]){_0x5ec1e9[_0x2e57('0x40')]=[{'all':!![]}];}_0x5ec1e9=_['merge']({},_0x5ec1e9,_0x21f2b[_0x2e57('0x3d')]);return db[_0x2e57('0x3e')][_0x2e57('0x46')](_0x5ec1e9)[_0x2e57('0x22')](handleEntityNotFound(_0x4cdd11,null))[_0x2e57('0x22')](respondWithResult(_0x4cdd11,null))[_0x2e57('0x42')](handleError(_0x4cdd11,null));};exports[_0x2e57('0x47')]=function(_0x42afb3,_0x4b43e1){return db[_0x2e57('0x3e')]['create'](_0x42afb3[_0x2e57('0x48')],{})[_0x2e57('0x22')](respondWithResult(_0x4b43e1,0xc9))[_0x2e57('0x42')](handleError(_0x4b43e1,null));};exports[_0x2e57('0x21')]=function(_0x5ca6ce,_0x46cbc4){if(_0x5ca6ce[_0x2e57('0x48')]['id']){delete _0x5ca6ce['body']['id'];}return db[_0x2e57('0x3e')][_0x2e57('0x46')]({'where':{'id':_0x5ca6ce[_0x2e57('0x44')]['id']}})['then'](handleEntityNotFound(_0x46cbc4,null))[_0x2e57('0x22')](saveUpdates(_0x5ca6ce[_0x2e57('0x48')],null))[_0x2e57('0x22')](respondWithResult(_0x46cbc4,null))[_0x2e57('0x42')](handleError(_0x46cbc4,null));};exports[_0x2e57('0x49')]=function(_0x17a6a0,_0x459d56,_0x48ba7d){var _0x5aecb6=require(_0x2e57('0x4a'));var _0x169035=![];var _0x1000b5={};if(_0x17a6a0[_0x2e57('0x2f')][_0x2e57('0x3b')]&&_0x17a6a0['query'][_0x2e57('0x3b')]===_0x2e57('0x4b')){_0x1000b5[_0x2e57('0x4b')]=_0x17a6a0[_0x2e57('0x44')]['id'];}else{_0x1000b5['id']=_0x17a6a0[_0x2e57('0x44')]['id'];}return db['SquareRecording'][_0x2e57('0x46')]({'where':_0x1000b5,'attributes':['id','savePath',_0x2e57('0x4c')],'raw':!![]})[_0x2e57('0x22')](handleEntityNotFound(_0x459d56,null))[_0x2e57('0x22')](function(_0x5c92e5){if(_0x5c92e5){var _0x257f38=_0x5c92e5[_0x2e57('0x4d')];var _0x527a93=util['format'](_0x2e57('0x4e'),_0x257f38);if(fs[_0x2e57('0x4f')](_0x527a93)){_0x169035=!![];return _0x5aecb6[_0x2e57('0x50')](_0x527a93,_0x257f38,config[_0x2e57('0x51')][_0x2e57('0x52')])[_0x2e57('0x22')](function(){return _0x5c92e5;});}return _0x5c92e5;}})[_0x2e57('0x22')](function(_0x44f976){if(_0x44f976){var _0x471b4d=_0x44f976[_0x2e57('0x4d')];if(!fs[_0x2e57('0x4f')](_0x471b4d)){throw new db[(_0x2e57('0x53'))][(_0x2e57('0x54'))](_0x2e57('0x55'));}if(_0x44f976[_0x2e57('0x4c')]){return _0x459d56[_0x2e57('0x49')](_0x471b4d,_0x44f976[_0x2e57('0x4c')]+path[_0x2e57('0x56')](_0x471b4d),function(){if(_0x169035){fs[_0x2e57('0x57')](_0x471b4d);}});}else{return _0x459d56[_0x2e57('0x49')](_0x471b4d,function(_0x147157){if(_0x169035){fs[_0x2e57('0x57')](_0x471b4d);}});}}})['catch'](function(_0x295a79){if(_0x295a79[_0x2e57('0x58')]===_0x2e57('0x55')){_0x459d56[_0x2e57('0x24')](0x194)[_0x2e57('0x28')](_0x2e57('0x59'));}else{return handleError(_0x459d56,null);}});};exports[_0x2e57('0x23')]=function(_0x5dcc14,_0x333ff2){return db['SquareRecording']['find']({'where':{'id':_0x5dcc14[_0x2e57('0x44')]['id']}})['then'](function(_0x26edfb){if(_[_0x2e57('0x5a')](_0x26edfb)){throw new ReferenceError(_0x2e57('0x5b'));}return _0x26edfb;})[_0x2e57('0x22')](function(_0x1a77d6){var _0x16775c=_0x1a77d6['savePath'];logger[_0x2e57('0x5c')](_0x2e57('0x5d'),_0x16775c);if(!_[_0x2e57('0x5a')](_0x1a77d6['savePath'])&&fs[_0x2e57('0x4f')](_0x16775c)){logger[_0x2e57('0x5c')](_0x2e57('0x5e')+_0x16775c+_0x2e57('0x5f'));fs[_0x2e57('0x60')](_0x16775c);}_0x16775c=_0x16775c+_0x2e57('0x61');if(!_['isNil'](_0x1a77d6['savePath'])&&fs[_0x2e57('0x4f')](_0x16775c)){logger['info'](_0x2e57('0x5e')+_0x16775c+_0x2e57('0x5f'));fs[_0x2e57('0x60')](_0x16775c);}return _0x1a77d6;})['then'](function(_0xa9b05a){if(!_0xa9b05a)throw new InternalError();return _0xa9b05a[_0x2e57('0x23')]();})[_0x2e57('0x22')](function(){_0x333ff2['status'](0xcc)[_0x2e57('0x18')]();})[_0x2e57('0x42')](handleError(_0x333ff2,null));};
\ No newline at end of file
index 21deb6f..d2e55b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe953=['bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','SquareRecording','lodash','util','../../config/logger','moment'];(function(_0x152a48,_0x1aa9cf){var _0x32be57=function(_0x3082e9){while(--_0x3082e9){_0x152a48['push'](_0x152a48['shift']());}};_0x32be57(++_0x1aa9cf);}(_0xe953,0xf9));var _0x3e95=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xe953[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x3e95('0x0'));var util=require(_0x3e95('0x1'));var logger=require(_0x3e95('0x2'))('api');var moment=require(_0x3e95('0x3'));var BPromise=require(_0x3e95('0x4'));var rp=require(_0x3e95('0x5'));var fs=require('fs');var path=require(_0x3e95('0x6'));var rimraf=require(_0x3e95('0x7'));var config=require(_0x3e95('0x8'));var attributes=require(_0x3e95('0x9'));module['exports']=function(_0x4ec1b2,_0x2aaa3e){return _0x4ec1b2['define'](_0x3e95('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39d2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','../../config/logger'];(function(_0x23ce36,_0x25f816){var _0x3b0e01=function(_0x3fa0b6){while(--_0x3fa0b6){_0x23ce36['push'](_0x23ce36['shift']());}};_0x3b0e01(++_0x25f816);}(_0x39d2,0xf5));var _0x239d=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x39d2[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0x239d('0x0'));var util=require('util');var logger=require(_0x239d('0x1'))(_0x239d('0x2'));var moment=require(_0x239d('0x3'));var BPromise=require(_0x239d('0x4'));var rp=require(_0x239d('0x5'));var fs=require('fs');var path=require(_0x239d('0x6'));var rimraf=require(_0x239d('0x7'));var config=require(_0x239d('0x8'));var attributes=require(_0x239d('0x9'));module[_0x239d('0xa')]=function(_0x12302d,_0x1504c1){return _0x12302d[_0x239d('0xb')]('SquareRecording',attributes,{'tableName':_0x239d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index babd58e..6c5b42d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c82=['error','code','message','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x4c82,0x122));var _0x24c8=function(_0x2a04d4,_0xa57830){_0x2a04d4=_0x2a04d4-0x0;var _0x40b2f9=_0x4c82[_0x2a04d4];return _0x40b2f9;};'use strict';var _=require(_0x24c8('0x0'));var util=require(_0x24c8('0x1'));var moment=require('moment');var BPromise=require(_0x24c8('0x2'));var rs=require(_0x24c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24c8('0x4'))['db'];var utils=require(_0x24c8('0x5'));var logger=require(_0x24c8('0x6'))(_0x24c8('0x7'));var config=require(_0x24c8('0x8'));var jayson=require(_0x24c8('0x9'));var client=jayson['client'][_0x24c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a815,_0x459e44,_0x2b8213){return new BPromise(function(_0x706cfd,_0x54dd7b){return client['request'](_0x35a815,_0x2b8213)[_0x24c8('0xb')](function(_0xfa1183){logger[_0x24c8('0xc')](_0x24c8('0xd'),_0x459e44,_0x24c8('0xe'));logger[_0x24c8('0xf')](_0x24c8('0x10'),_0x459e44,'request\x20sent',JSON[_0x24c8('0x11')](_0xfa1183));if(_0xfa1183[_0x24c8('0x12')]){if(_0xfa1183[_0x24c8('0x12')][_0x24c8('0x13')]===0x1f4){logger[_0x24c8('0x12')](_0x24c8('0xd'),_0x459e44,_0xfa1183[_0x24c8('0x12')][_0x24c8('0x14')]);return _0x54dd7b(_0xfa1183[_0x24c8('0x12')]['message']);}logger[_0x24c8('0x12')](_0x24c8('0xd'),_0x459e44,_0xfa1183[_0x24c8('0x12')][_0x24c8('0x14')]);return _0x706cfd(_0xfa1183[_0x24c8('0x12')][_0x24c8('0x14')]);}else{logger[_0x24c8('0xc')](_0x24c8('0xd'),_0x459e44,_0x24c8('0xe'));_0x706cfd(_0xfa1183['result']['message']);}})[_0x24c8('0x15')](function(_0x2f9b86){logger[_0x24c8('0x12')](_0x24c8('0xd'),_0x459e44,_0x2f9b86);_0x54dd7b(_0x2f9b86);});});}exports['CreateSquareRecording']=function(_0x310bd3){var _0x5c3150=this;return new Promise(function(_0x3b231c,_0x13fa5a){return db[_0x24c8('0x16')][_0x24c8('0x17')](_0x310bd3[_0x24c8('0x18')],{'raw':_0x310bd3['options']?_0x310bd3[_0x24c8('0x19')][_0x24c8('0x1a')]===undefined?!![]:![]:!![]})[_0x24c8('0xb')](function(_0x592d32){logger['info']('CreateSquareRecording',_0x310bd3);logger['debug'](_0x24c8('0x1b'),_0x310bd3,JSON[_0x24c8('0x11')](_0x592d32));_0x3b231c(_0x592d32);})['catch'](function(_0x9932f6){logger[_0x24c8('0x12')](_0x24c8('0x1b'),_0x9932f6[_0x24c8('0x14')],_0x310bd3);_0x13fa5a(_0x5c3150[_0x24c8('0x12')](0x1f4,_0x9932f6[_0x24c8('0x14')]));});});};
\ No newline at end of file
+var _0x7d9d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareRecording','SquareRecording','options','raw','stringify','lodash','util','moment','randomstring'];(function(_0x16ab1a,_0x215490){var _0x3c82e1=function(_0x189be5){while(--_0x189be5){_0x16ab1a['push'](_0x16ab1a['shift']());}};_0x3c82e1(++_0x215490);}(_0x7d9d,0xc4));var _0xd7d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7d9('0x0'));var util=require(_0xd7d9('0x1'));var moment=require(_0xd7d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd7d9('0x3'));var fs=require('fs');var Redis=require(_0xd7d9('0x4'));var db=require(_0xd7d9('0x5'))['db'];var utils=require(_0xd7d9('0x6'));var logger=require(_0xd7d9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd7d9('0x8'));var client=jayson[_0xd7d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x336a02,_0x4a8cd7,_0x33c721){return new BPromise(function(_0x2ab315,_0x3a59ef){return client['request'](_0x336a02,_0x33c721)[_0xd7d9('0xa')](function(_0x1527b1){logger[_0xd7d9('0xb')](_0xd7d9('0xc'),_0x4a8cd7,_0xd7d9('0xd'));logger[_0xd7d9('0xe')](_0xd7d9('0xf'),_0x4a8cd7,'request\x20sent',JSON['stringify'](_0x1527b1));if(_0x1527b1[_0xd7d9('0x10')]){if(_0x1527b1['error']['code']===0x1f4){logger[_0xd7d9('0x10')](_0xd7d9('0xc'),_0x4a8cd7,_0x1527b1['error'][_0xd7d9('0x11')]);return _0x3a59ef(_0x1527b1[_0xd7d9('0x10')][_0xd7d9('0x11')]);}logger['error'](_0xd7d9('0xc'),_0x4a8cd7,_0x1527b1[_0xd7d9('0x10')][_0xd7d9('0x11')]);return _0x2ab315(_0x1527b1[_0xd7d9('0x10')][_0xd7d9('0x11')]);}else{logger[_0xd7d9('0xb')](_0xd7d9('0xc'),_0x4a8cd7,_0xd7d9('0xd'));_0x2ab315(_0x1527b1[_0xd7d9('0x12')][_0xd7d9('0x11')]);}})[_0xd7d9('0x13')](function(_0x194046){logger[_0xd7d9('0x10')](_0xd7d9('0xc'),_0x4a8cd7,_0x194046);_0x3a59ef(_0x194046);});});}exports[_0xd7d9('0x14')]=function(_0x4f58b7){var _0x4b7ea7=this;return new Promise(function(_0x5bc50d,_0x5844fd){return db[_0xd7d9('0x15')]['create'](_0x4f58b7['body'],{'raw':_0x4f58b7[_0xd7d9('0x16')]?_0x4f58b7[_0xd7d9('0x16')][_0xd7d9('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x6ba534){logger[_0xd7d9('0xb')]('CreateSquareRecording',_0x4f58b7);logger[_0xd7d9('0xe')]('CreateSquareRecording',_0x4f58b7,JSON[_0xd7d9('0x18')](_0x6ba534));_0x5bc50d(_0x6ba534);})['catch'](function(_0xa7547f){logger[_0xd7d9('0x10')]('CreateSquareRecording',_0xa7547f[_0xd7d9('0x11')],_0x4f58b7);_0x5844fd(_0x4b7ea7[_0xd7d9('0x10')](0x1f4,_0xa7547f[_0xd7d9('0x11')]));});});};
\ No newline at end of file
index e93490b..f5722a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x35a470,_0x1820a1){var _0x7349ff=function(_0x2680bb){while(--_0x2680bb){_0x35a470['push'](_0x35a470['shift']());}};_0x7349ff(++_0x1820a1);}(_0xe706,0xa3));var _0x6e70=function(_0x4f4107,_0x342cd4){_0x4f4107=_0x4f4107-0x0;var _0x2f02bc=_0xe706[_0x4f4107];return _0x2f02bc;};'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')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
index 37aa266..1d0ba90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95ce=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x95ce,0xd9));var _0xe95c=function(_0x58168a,_0x11221f){_0x58168a=_0x58168a-0x0;var _0x5114ad=_0x95ce[_0x58168a];return _0x5114ad;};'use strict';var Sequelize=require(_0xe95c('0x0'));module[_0xe95c('0x1')]={'network':{'type':Sequelize[_0xe95c('0x2')]},'network_script':{'type':Sequelize[_0xe95c('0x2')]},'request':{'type':Sequelize[_0xe95c('0x2')]},'channel':{'type':Sequelize[_0xe95c('0x2')]},'language':{'type':Sequelize[_0xe95c('0x2')]},'type':{'type':Sequelize[_0xe95c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xe95c('0x2')]},'callerid':{'type':Sequelize[_0xe95c('0x2')]},'calleridname':{'type':Sequelize[_0xe95c('0x2')]},'callingpres':{'type':Sequelize[_0xe95c('0x2')]},'callingani2':{'type':Sequelize[_0xe95c('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xe95c('0x2')]},'dnid':{'type':Sequelize[_0xe95c('0x2')]},'rdnis':{'type':Sequelize[_0xe95c('0x2')]},'context':{'type':Sequelize[_0xe95c('0x2')]},'extension':{'type':Sequelize[_0xe95c('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe95c('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xe95c('0x2')]},'joinAt':{'type':Sequelize[_0xe95c('0x3')]},'leaveAt':{'type':Sequelize[_0xe95c('0x3')]},'bot':{'type':Sequelize[_0xe95c('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1355=['exports','STRING','DATE','BOOLEAN'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1355,0xa4));var _0x5135=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0x1355[_0x16539a];return _0x200796;};'use strict';var Sequelize=require('sequelize');module[_0x5135('0x0')]={'network':{'type':Sequelize[_0x5135('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x5135('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5135('0x1')]},'type':{'type':Sequelize[_0x5135('0x1')]},'uniqueid':{'type':Sequelize[_0x5135('0x1')]},'version':{'type':Sequelize[_0x5135('0x1')]},'callerid':{'type':Sequelize[_0x5135('0x1')]},'calleridname':{'type':Sequelize[_0x5135('0x1')]},'callingpres':{'type':Sequelize[_0x5135('0x1')]},'callingani2':{'type':Sequelize[_0x5135('0x1')]},'callington':{'type':Sequelize[_0x5135('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5135('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5135('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5135('0x1')]},'threadid':{'type':Sequelize[_0x5135('0x1')]},'project_name':{'type':Sequelize[_0x5135('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5135('0x2')]},'bot':{'type':Sequelize[_0x5135('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 8c050d2..5803e91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37a4=['../../mysqldb','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','SquareReport','model','query','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','catch','show','params','keys','intersection','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37a4,0x102));var _0x437a=function(_0x1904bc,_0x3494cc){_0x1904bc=_0x1904bc-0x0;var _0x10211e=_0x37a4[_0x1904bc];return _0x10211e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x437a('0x0'));var zipdir=require(_0x437a('0x1'));var jsonpatch=require(_0x437a('0x2'));var rp=require('request-promise');var moment=require(_0x437a('0x3'));var BPromise=require(_0x437a('0x4'));var Mustache=require(_0x437a('0x5'));var util=require('util');var path=require(_0x437a('0x6'));var sox=require('sox');var csv=require(_0x437a('0x7'));var ejs=require(_0x437a('0x8'));var fs=require('fs');var fs_extra=require(_0x437a('0x9'));var _=require(_0x437a('0xa'));var squel=require(_0x437a('0xb'));var crypto=require(_0x437a('0xc'));var jsforce=require(_0x437a('0xd'));var deskjs=require(_0x437a('0xe'));var toCsv=require(_0x437a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x437a('0xf'));var qs=require(_0x437a('0x10'));var as=require(_0x437a('0x11'));var hardwareService=require(_0x437a('0x12'));var logger=require(_0x437a('0x13'))('api');var utils=require(_0x437a('0x14'));var config=require(_0x437a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x437a('0x16'))['db'];function respondWithStatusCode(_0x3fac6b,_0x5aecbc){_0x5aecbc=_0x5aecbc||0xcc;return function(_0x84f834){if(_0x84f834){return _0x3fac6b['sendStatus'](_0x5aecbc);}return _0x3fac6b['status'](_0x5aecbc)[_0x437a('0x17')]();};}function respondWithResult(_0x5d544b,_0x25ec2f){_0x25ec2f=_0x25ec2f||0xc8;return function(_0x4cf210){if(_0x4cf210){return _0x5d544b[_0x437a('0x18')](_0x25ec2f)[_0x437a('0x19')](_0x4cf210);}};}function respondWithFilteredResult(_0x2d23aa,_0x45d5c4){return function(_0x2f9320){if(_0x2f9320){var _0xd2a6ab=typeof _0x45d5c4['offset']==='undefined'&&typeof _0x45d5c4[_0x437a('0x1a')]===_0x437a('0x1b');var _0x5ff2f=_0x2f9320[_0x437a('0x1c')];var _0x1cd429=_0xd2a6ab?0x0:_0x45d5c4['offset'];var _0x38a06c=_0xd2a6ab?_0x2f9320[_0x437a('0x1c')]:_0x45d5c4[_0x437a('0x1d')]+_0x45d5c4[_0x437a('0x1a')];var _0x447139;if(_0x38a06c>=_0x5ff2f){_0x38a06c=_0x5ff2f;_0x447139=0xc8;}else{_0x447139=0xce;}_0x2d23aa[_0x437a('0x18')](_0x447139);return _0x2d23aa[_0x437a('0x1e')](_0x437a('0x1f'),_0x1cd429+'-'+_0x38a06c+'/'+_0x5ff2f)[_0x437a('0x19')](_0x2f9320);}return null;};}function patchUpdates(_0x55cb0f){return function(_0x1bd6e0){try{jsonpatch[_0x437a('0x20')](_0x1bd6e0,_0x55cb0f,!![]);}catch(_0x4bc636){return BPromise[_0x437a('0x21')](_0x4bc636);}return _0x1bd6e0['save']();};}function saveUpdates(_0x50b5fe,_0x35c2b5){return function(_0x16965a){if(_0x16965a){return _0x16965a[_0x437a('0x22')](_0x50b5fe)[_0x437a('0x23')](function(_0x3096f0){return _0x3096f0;});}return null;};}function removeEntity(_0x2628cc,_0x225830){return function(_0x2d27e1){if(_0x2d27e1){return _0x2d27e1[_0x437a('0x24')]()[_0x437a('0x23')](function(){_0x2628cc[_0x437a('0x18')](0xcc)[_0x437a('0x17')]();});}};}function handleEntityNotFound(_0x5cb43f,_0x320845){return function(_0x556770){if(!_0x556770){_0x5cb43f['sendStatus'](0x194);}return _0x556770;};}function handleError(_0xd8228f,_0x11799c){_0x11799c=_0x11799c||0x1f4;return function(_0xed62c4){logger[_0x437a('0x25')](_0xed62c4[_0x437a('0x26')]);if(_0xed62c4[_0x437a('0x27')]){delete _0xed62c4[_0x437a('0x27')];}_0xd8228f[_0x437a('0x18')](_0x11799c)['send'](_0xed62c4);};}exports[_0x437a('0x28')]=function(_0xea907c,_0x4d76f0){var _0x55a98b={},_0x1506ca={},_0x3ba129={'count':0x0,'rows':[]};var _0xddfb60=_['map'](db[_0x437a('0x29')]['rawAttributes'],function(_0x5eca8c){return{'name':_0x5eca8c['fieldName'],'type':_0x5eca8c['type']['key']};});_0x1506ca[_0x437a('0x2a')]=_['map'](_0xddfb60,'name');_0x1506ca[_0x437a('0x2b')]=_['keys'](_0xea907c[_0x437a('0x2b')]);_0x1506ca[_0x437a('0x2c')]=_['intersection'](_0x1506ca[_0x437a('0x2a')],_0x1506ca[_0x437a('0x2b')]);_0x55a98b['attributes']=_['intersection'](_0x1506ca[_0x437a('0x2a')],qs['fields'](_0xea907c['query'][_0x437a('0x2d')]));_0x55a98b[_0x437a('0x2e')]=_0x55a98b[_0x437a('0x2e')]['length']?_0x55a98b[_0x437a('0x2e')]:_0x1506ca[_0x437a('0x2a')];if(!_0xea907c[_0x437a('0x2b')][_0x437a('0x2f')]('nolimit')){_0x55a98b[_0x437a('0x1a')]=qs[_0x437a('0x1a')](_0xea907c[_0x437a('0x2b')][_0x437a('0x1a')]);_0x55a98b[_0x437a('0x1d')]=qs[_0x437a('0x1d')](_0xea907c[_0x437a('0x2b')][_0x437a('0x1d')]);}_0x55a98b[_0x437a('0x30')]=qs[_0x437a('0x31')](_0xea907c[_0x437a('0x2b')][_0x437a('0x31')]);_0x55a98b[_0x437a('0x32')]=qs[_0x437a('0x2c')](_[_0x437a('0x33')](_0xea907c['query'],_0x1506ca['filters']),_0xddfb60);if(_0xea907c[_0x437a('0x2b')][_0x437a('0x34')]){_0x55a98b[_0x437a('0x32')]=_[_0x437a('0x35')](_0x55a98b[_0x437a('0x32')],{'$or':_[_0x437a('0x36')](_0xddfb60,function(_0x563ec6){if(_0x563ec6[_0x437a('0x37')]!=='VIRTUAL'){var _0x270e0a={};_0x270e0a[_0x563ec6['name']]={'$like':'%'+_0xea907c[_0x437a('0x2b')][_0x437a('0x34')]+'%'};return _0x270e0a;}})});}_0x55a98b=_[_0x437a('0x35')]({},_0x55a98b,_0xea907c[_0x437a('0x38')]);var _0x1ce198={'where':_0x55a98b[_0x437a('0x32')]};return db[_0x437a('0x29')][_0x437a('0x1c')](_0x1ce198)['then'](function(_0x583498){_0x3ba129[_0x437a('0x1c')]=_0x583498;if(_0xea907c[_0x437a('0x2b')][_0x437a('0x39')]){_0x55a98b[_0x437a('0x3a')]=[{'all':!![]}];}return db[_0x437a('0x29')][_0x437a('0x3b')](_0x55a98b);})[_0x437a('0x23')](function(_0x47ff81){_0x3ba129['rows']=_0x47ff81;return _0x3ba129;})['then'](respondWithFilteredResult(_0x4d76f0,_0x55a98b))[_0x437a('0x3c')](handleError(_0x4d76f0,null));};exports[_0x437a('0x3d')]=function(_0x27f4fd,_0x24b910){var _0x3487c8={'raw':!![],'where':{'id':_0x27f4fd[_0x437a('0x3e')]['id']}},_0x132e69={};_0x132e69[_0x437a('0x2a')]=_[_0x437a('0x3f')](db[_0x437a('0x29')]['rawAttributes']);_0x132e69[_0x437a('0x2b')]=_[_0x437a('0x3f')](_0x27f4fd['query']);_0x132e69[_0x437a('0x2c')]=_[_0x437a('0x40')](_0x132e69[_0x437a('0x2a')],_0x132e69[_0x437a('0x2b')]);_0x3487c8[_0x437a('0x2e')]=_[_0x437a('0x40')](_0x132e69[_0x437a('0x2a')],qs[_0x437a('0x2d')](_0x27f4fd[_0x437a('0x2b')][_0x437a('0x2d')]));_0x3487c8[_0x437a('0x2e')]=_0x3487c8[_0x437a('0x2e')][_0x437a('0x41')]?_0x3487c8[_0x437a('0x2e')]:_0x132e69[_0x437a('0x2a')];if(_0x27f4fd[_0x437a('0x2b')][_0x437a('0x39')]){_0x3487c8['include']=[{'all':!![]}];}_0x3487c8=_[_0x437a('0x35')]({},_0x3487c8,_0x27f4fd['options']);return db['SquareReport'][_0x437a('0x42')](_0x3487c8)[_0x437a('0x23')](handleEntityNotFound(_0x24b910,null))['then'](respondWithResult(_0x24b910,null))[_0x437a('0x3c')](handleError(_0x24b910,null));};exports[_0x437a('0x43')]=function(_0x1859e6,_0x5ab84e){return db['SquareReport'][_0x437a('0x43')](_0x1859e6['body'],{})[_0x437a('0x23')](respondWithResult(_0x5ab84e,0xc9))[_0x437a('0x3c')](handleError(_0x5ab84e,null));};exports[_0x437a('0x22')]=function(_0x3f07be,_0x9ac3b0){if(_0x3f07be[_0x437a('0x44')]['id']){delete _0x3f07be[_0x437a('0x44')]['id'];}return db[_0x437a('0x29')]['find']({'where':{'id':_0x3f07be[_0x437a('0x3e')]['id']}})[_0x437a('0x23')](handleEntityNotFound(_0x9ac3b0,null))[_0x437a('0x23')](saveUpdates(_0x3f07be[_0x437a('0x44')],null))[_0x437a('0x23')](respondWithResult(_0x9ac3b0,null))['catch'](handleError(_0x9ac3b0,null));};exports[_0x437a('0x24')]=function(_0x588f81,_0x68c388){return db[_0x437a('0x29')][_0x437a('0x42')]({'where':{'id':_0x588f81[_0x437a('0x3e')]['id']}})[_0x437a('0x23')](handleEntityNotFound(_0x68c388,null))[_0x437a('0x23')](removeEntity(_0x68c388,null))[_0x437a('0x3c')](handleError(_0x68c388,null));};exports[_0x437a('0x45')]=function(_0x3d5abe,_0x58eb9b){return db['SquareReport'][_0x437a('0x45')]()[_0x437a('0x23')](respondWithResult(_0x58eb9b,null))[_0x437a('0x3c')](handleError(_0x58eb9b,null));};
\ No newline at end of file
+var _0xa317=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','save','update','sendStatus','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','then','show','params','keys','find','catch','create','body','describe','rimraf','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa317,0x1db));var _0x7a31=function(_0x48bac8,_0x46bf2b){_0x48bac8=_0x48bac8-0x0;var _0x2b78e5=_0xa317[_0x48bac8];return _0x2b78e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a31('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7a31('0x1'));var util=require(_0x7a31('0x2'));var path=require(_0x7a31('0x3'));var sox=require(_0x7a31('0x4'));var csv=require(_0x7a31('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7a31('0x6'));var squel=require(_0x7a31('0x7'));var crypto=require(_0x7a31('0x8'));var jsforce=require(_0x7a31('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x7a31('0x5'));var querystring=require(_0x7a31('0xa'));var Papa=require(_0x7a31('0xb'));var Redis=require(_0x7a31('0xc'));var authService=require(_0x7a31('0xd'));var qs=require(_0x7a31('0xe'));var as=require(_0x7a31('0xf'));var hardwareService=require(_0x7a31('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x7a31('0x11'));var config=require(_0x7a31('0x12'));var licenseUtil=require(_0x7a31('0x13'));var db=require(_0x7a31('0x14'))['db'];function respondWithStatusCode(_0x5a6176,_0x59170){_0x59170=_0x59170||0xcc;return function(_0x1dea79){if(_0x1dea79){return _0x5a6176['sendStatus'](_0x59170);}return _0x5a6176['status'](_0x59170)[_0x7a31('0x15')]();};}function respondWithResult(_0x398e07,_0x1bf58e){_0x1bf58e=_0x1bf58e||0xc8;return function(_0x2819f5){if(_0x2819f5){return _0x398e07[_0x7a31('0x16')](_0x1bf58e)[_0x7a31('0x17')](_0x2819f5);}};}function respondWithFilteredResult(_0x16cc1e,_0x14665d){return function(_0x2974ff){if(_0x2974ff){var _0x5d7d85=typeof _0x14665d[_0x7a31('0x18')]===_0x7a31('0x19')&&typeof _0x14665d[_0x7a31('0x1a')]===_0x7a31('0x19');var _0x5027ac=_0x2974ff[_0x7a31('0x1b')];var _0x1211e3=_0x5d7d85?0x0:_0x14665d['offset'];var _0x38d2cd=_0x5d7d85?_0x2974ff[_0x7a31('0x1b')]:_0x14665d['offset']+_0x14665d[_0x7a31('0x1a')];var _0x14c1d0;if(_0x38d2cd>=_0x5027ac){_0x38d2cd=_0x5027ac;_0x14c1d0=0xc8;}else{_0x14c1d0=0xce;}_0x16cc1e[_0x7a31('0x16')](_0x14c1d0);return _0x16cc1e[_0x7a31('0x1c')]('Content-Range',_0x1211e3+'-'+_0x38d2cd+'/'+_0x5027ac)[_0x7a31('0x17')](_0x2974ff);}return null;};}function patchUpdates(_0x2f69b0){return function(_0x4ae90e){try{jsonpatch['apply'](_0x4ae90e,_0x2f69b0,!![]);}catch(_0x380f3f){return BPromise['reject'](_0x380f3f);}return _0x4ae90e[_0x7a31('0x1d')]();};}function saveUpdates(_0x1bd768,_0x23e987){return function(_0xb35f77){if(_0xb35f77){return _0xb35f77[_0x7a31('0x1e')](_0x1bd768)['then'](function(_0x4c966c){return _0x4c966c;});}return null;};}function removeEntity(_0x398784,_0x5b5c7d){return function(_0x3477f4){if(_0x3477f4){return _0x3477f4['destroy']()['then'](function(){_0x398784[_0x7a31('0x16')](0xcc)[_0x7a31('0x15')]();});}};}function handleEntityNotFound(_0x1531b0,_0x12a4d8){return function(_0x5d30bb){if(!_0x5d30bb){_0x1531b0[_0x7a31('0x1f')](0x194);}return _0x5d30bb;};}function handleError(_0x4ee730,_0x592cd9){_0x592cd9=_0x592cd9||0x1f4;return function(_0x318797){logger[_0x7a31('0x20')](_0x318797['stack']);if(_0x318797[_0x7a31('0x21')]){delete _0x318797[_0x7a31('0x21')];}_0x4ee730[_0x7a31('0x16')](_0x592cd9)[_0x7a31('0x22')](_0x318797);};}exports[_0x7a31('0x23')]=function(_0x1c7be9,_0x560d85){var _0x9b1761={},_0x327ade={},_0x106217={'count':0x0,'rows':[]};var _0x373a86=_[_0x7a31('0x24')](db[_0x7a31('0x25')][_0x7a31('0x26')],function(_0x2621e6){return{'name':_0x2621e6[_0x7a31('0x27')],'type':_0x2621e6[_0x7a31('0x28')][_0x7a31('0x29')]};});_0x327ade[_0x7a31('0x2a')]=_[_0x7a31('0x24')](_0x373a86,_0x7a31('0x21'));_0x327ade[_0x7a31('0x2b')]=_['keys'](_0x1c7be9[_0x7a31('0x2b')]);_0x327ade[_0x7a31('0x2c')]=_['intersection'](_0x327ade[_0x7a31('0x2a')],_0x327ade[_0x7a31('0x2b')]);_0x9b1761[_0x7a31('0x2d')]=_[_0x7a31('0x2e')](_0x327ade['model'],qs[_0x7a31('0x2f')](_0x1c7be9[_0x7a31('0x2b')][_0x7a31('0x2f')]));_0x9b1761[_0x7a31('0x2d')]=_0x9b1761[_0x7a31('0x2d')][_0x7a31('0x30')]?_0x9b1761[_0x7a31('0x2d')]:_0x327ade[_0x7a31('0x2a')];if(!_0x1c7be9['query'][_0x7a31('0x31')](_0x7a31('0x32'))){_0x9b1761[_0x7a31('0x1a')]=qs['limit'](_0x1c7be9[_0x7a31('0x2b')][_0x7a31('0x1a')]);_0x9b1761[_0x7a31('0x18')]=qs[_0x7a31('0x18')](_0x1c7be9[_0x7a31('0x2b')][_0x7a31('0x18')]);}_0x9b1761[_0x7a31('0x33')]=qs[_0x7a31('0x34')](_0x1c7be9['query'][_0x7a31('0x34')]);_0x9b1761[_0x7a31('0x35')]=qs['filters'](_['pick'](_0x1c7be9[_0x7a31('0x2b')],_0x327ade[_0x7a31('0x2c')]),_0x373a86);if(_0x1c7be9[_0x7a31('0x2b')][_0x7a31('0x36')]){_0x9b1761[_0x7a31('0x35')]=_[_0x7a31('0x37')](_0x9b1761['where'],{'$or':_['map'](_0x373a86,function(_0x197a09){if(_0x197a09[_0x7a31('0x28')]!==_0x7a31('0x38')){var _0x45d391={};_0x45d391[_0x197a09['name']]={'$like':'%'+_0x1c7be9['query'][_0x7a31('0x36')]+'%'};return _0x45d391;}})});}_0x9b1761=_[_0x7a31('0x37')]({},_0x9b1761,_0x1c7be9['options']);var _0x1f9cf3={'where':_0x9b1761['where']};return db[_0x7a31('0x25')][_0x7a31('0x1b')](_0x1f9cf3)['then'](function(_0x124cc5){_0x106217[_0x7a31('0x1b')]=_0x124cc5;if(_0x1c7be9[_0x7a31('0x2b')][_0x7a31('0x39')]){_0x9b1761[_0x7a31('0x3a')]=[{'all':!![]}];}return db[_0x7a31('0x25')][_0x7a31('0x3b')](_0x9b1761);})[_0x7a31('0x3c')](function(_0x190b69){_0x106217['rows']=_0x190b69;return _0x106217;})['then'](respondWithFilteredResult(_0x560d85,_0x9b1761))['catch'](handleError(_0x560d85,null));};exports[_0x7a31('0x3d')]=function(_0x224b2f,_0x22df17){var _0x214cde={'raw':!![],'where':{'id':_0x224b2f[_0x7a31('0x3e')]['id']}},_0x32dfa5={};_0x32dfa5['model']=_[_0x7a31('0x3f')](db[_0x7a31('0x25')][_0x7a31('0x26')]);_0x32dfa5[_0x7a31('0x2b')]=_[_0x7a31('0x3f')](_0x224b2f[_0x7a31('0x2b')]);_0x32dfa5[_0x7a31('0x2c')]=_[_0x7a31('0x2e')](_0x32dfa5[_0x7a31('0x2a')],_0x32dfa5[_0x7a31('0x2b')]);_0x214cde[_0x7a31('0x2d')]=_[_0x7a31('0x2e')](_0x32dfa5[_0x7a31('0x2a')],qs[_0x7a31('0x2f')](_0x224b2f[_0x7a31('0x2b')]['fields']));_0x214cde[_0x7a31('0x2d')]=_0x214cde[_0x7a31('0x2d')][_0x7a31('0x30')]?_0x214cde['attributes']:_0x32dfa5[_0x7a31('0x2a')];if(_0x224b2f[_0x7a31('0x2b')]['includeAll']){_0x214cde['include']=[{'all':!![]}];}_0x214cde=_[_0x7a31('0x37')]({},_0x214cde,_0x224b2f['options']);return db['SquareReport'][_0x7a31('0x40')](_0x214cde)[_0x7a31('0x3c')](handleEntityNotFound(_0x22df17,null))[_0x7a31('0x3c')](respondWithResult(_0x22df17,null))[_0x7a31('0x41')](handleError(_0x22df17,null));};exports['create']=function(_0x30be70,_0xd790b){return db['SquareReport'][_0x7a31('0x42')](_0x30be70['body'],{})['then'](respondWithResult(_0xd790b,0xc9))[_0x7a31('0x41')](handleError(_0xd790b,null));};exports['update']=function(_0x29d5fb,_0x16f0e9){if(_0x29d5fb[_0x7a31('0x43')]['id']){delete _0x29d5fb[_0x7a31('0x43')]['id'];}return db['SquareReport'][_0x7a31('0x40')]({'where':{'id':_0x29d5fb[_0x7a31('0x3e')]['id']}})[_0x7a31('0x3c')](handleEntityNotFound(_0x16f0e9,null))[_0x7a31('0x3c')](saveUpdates(_0x29d5fb[_0x7a31('0x43')],null))['then'](respondWithResult(_0x16f0e9,null))['catch'](handleError(_0x16f0e9,null));};exports['destroy']=function(_0x43c1a3,_0x13ff24){return db[_0x7a31('0x25')][_0x7a31('0x40')]({'where':{'id':_0x43c1a3[_0x7a31('0x3e')]['id']}})[_0x7a31('0x3c')](handleEntityNotFound(_0x13ff24,null))[_0x7a31('0x3c')](removeEntity(_0x13ff24,null))['catch'](handleError(_0x13ff24,null));};exports['describe']=function(_0x5a94fc,_0x51bf30){return db['SquareReport'][_0x7a31('0x44')]()['then'](respondWithResult(_0x51bf30,null))[_0x7a31('0x41')](handleError(_0x51bf30,null));};
\ No newline at end of file
index 32b9aad..5133f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b0=['uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x00b0,0xf2));var _0x000b=function(_0x4d398b,_0x35a013){_0x4d398b=_0x4d398b-0x0;var _0x4b0df9=_0x00b0[_0x4d398b];return _0x4b0df9;};'use strict';var _=require(_0x000b('0x0'));var util=require(_0x000b('0x1'));var logger=require('../../config/logger')(_0x000b('0x2'));var moment=require(_0x000b('0x3'));var BPromise=require(_0x000b('0x4'));var rp=require(_0x000b('0x5'));var fs=require('fs');var path=require(_0x000b('0x6'));var rimraf=require(_0x000b('0x7'));var config=require(_0x000b('0x8'));var attributes=require(_0x000b('0x9'));module[_0x000b('0xa')]=function(_0x323a79,_0x4d29cb){return _0x323a79[_0x000b('0xb')](_0x000b('0xc'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x000b('0xd'),'fields':[_0x000b('0xe'),_0x000b('0xf')]},{'name':_0x000b('0x10'),'fields':[_0x000b('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfac=['../../config/environment','./squareReport.attributes','exports','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','api','moment','bluebird','path','rimraf'];(function(_0x1789bc,_0x1acf84){var _0x35efd1=function(_0x2329b2){while(--_0x2329b2){_0x1789bc['push'](_0x1789bc['shift']());}};_0x35efd1(++_0x1acf84);}(_0xdfac,0xf6));var _0xcdfa=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xdfac[_0x4b26b5];return _0x4dec71;};'use strict';var _=require(_0xcdfa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcdfa('0x1'));var moment=require(_0xcdfa('0x2'));var BPromise=require(_0xcdfa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdfa('0x4'));var rimraf=require(_0xcdfa('0x5'));var config=require(_0xcdfa('0x6'));var attributes=require(_0xcdfa('0x7'));module[_0xcdfa('0x8')]=function(_0x382ec0,_0x3f830d){return _0x382ec0['define'](_0xcdfa('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xcdfa('0xa'),'fields':[_0xcdfa('0xb'),_0xcdfa('0xc')]},{'name':_0xcdfa('0xd'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
index 3b63938..22f7495 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe001=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','SquareReport','create','body','options','raw','then','debug','CreateSquareReport','UpdateSquareReport','update','where','limit','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe001,0x158));var _0x1e00=function(_0x42b266,_0x27ef85){_0x42b266=_0x42b266-0x0;var _0x1afd77=_0xe001[_0x42b266];return _0x1afd77;};'use strict';var _=require(_0x1e00('0x0'));var util=require(_0x1e00('0x1'));var moment=require(_0x1e00('0x2'));var BPromise=require(_0x1e00('0x3'));var rs=require(_0x1e00('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1e00('0x5'));var logger=require(_0x1e00('0x6'))(_0x1e00('0x7'));var config=require(_0x1e00('0x8'));var jayson=require(_0x1e00('0x9'));var client=jayson[_0x1e00('0xa')][_0x1e00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c055b,_0x482743,_0x1ad3a3){return new BPromise(function(_0x42f8e2,_0x57ad7d){return client[_0x1e00('0xc')](_0x2c055b,_0x1ad3a3)['then'](function(_0x26cf66){logger[_0x1e00('0xd')]('SquareReport,\x20%s,\x20%s',_0x482743,_0x1e00('0xe'));logger['debug'](_0x1e00('0xf'),_0x482743,_0x1e00('0xe'),JSON[_0x1e00('0x10')](_0x26cf66));if(_0x26cf66['error']){if(_0x26cf66[_0x1e00('0x11')][_0x1e00('0x12')]===0x1f4){logger[_0x1e00('0x11')]('SquareReport,\x20%s,\x20%s',_0x482743,_0x26cf66[_0x1e00('0x11')]['message']);return _0x57ad7d(_0x26cf66[_0x1e00('0x11')]['message']);}logger[_0x1e00('0x11')](_0x1e00('0x13'),_0x482743,_0x26cf66['error'][_0x1e00('0x14')]);return _0x42f8e2(_0x26cf66[_0x1e00('0x11')][_0x1e00('0x14')]);}else{logger[_0x1e00('0xd')](_0x1e00('0x13'),_0x482743,'request\x20sent');_0x42f8e2(_0x26cf66[_0x1e00('0x15')][_0x1e00('0x14')]);}})[_0x1e00('0x16')](function(_0x25c16c){logger[_0x1e00('0x11')](_0x1e00('0x13'),_0x482743,_0x25c16c);_0x57ad7d(_0x25c16c);});});}exports['CreateSquareReport']=function(_0x2e9a83){var _0x22bb1e=this;return new Promise(function(_0x32bf7d,_0x2b329a){return db[_0x1e00('0x17')][_0x1e00('0x18')](_0x2e9a83[_0x1e00('0x19')],{'raw':_0x2e9a83[_0x1e00('0x1a')]?_0x2e9a83[_0x1e00('0x1a')][_0x1e00('0x1b')]===undefined?!![]:![]:!![]})[_0x1e00('0x1c')](function(_0x450b3a){logger[_0x1e00('0xd')]('CreateSquareReport',_0x2e9a83);logger[_0x1e00('0x1d')](_0x1e00('0x1e'),_0x2e9a83,JSON[_0x1e00('0x10')](_0x450b3a));_0x32bf7d(_0x450b3a);})[_0x1e00('0x16')](function(_0x342968){logger[_0x1e00('0x11')]('CreateSquareReport',_0x342968[_0x1e00('0x14')],_0x2e9a83);_0x2b329a(_0x22bb1e[_0x1e00('0x11')](0x1f4,_0x342968[_0x1e00('0x14')]));});});};exports[_0x1e00('0x1f')]=function(_0x1eab94){var _0x18985a=this;return new Promise(function(_0x4747f0,_0x27799a){return db[_0x1e00('0x17')][_0x1e00('0x20')](_0x1eab94[_0x1e00('0x19')],{'raw':_0x1eab94['options']?_0x1eab94[_0x1e00('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eab94['options']?_0x1eab94['options'][_0x1e00('0x21')]||null:null,'attributes':_0x1eab94[_0x1e00('0x1a')]?_0x1eab94[_0x1e00('0x1a')]['attributes']||null:null,'limit':_0x1eab94[_0x1e00('0x1a')]?_0x1eab94[_0x1e00('0x1a')][_0x1e00('0x22')]||null:null})[_0x1e00('0x1c')](function(_0x4c2049){logger[_0x1e00('0xd')](_0x1e00('0x1f'),_0x1eab94);logger[_0x1e00('0x1d')]('UpdateSquareReport',_0x1eab94,JSON['stringify'](_0x4c2049));_0x4747f0(_0x4c2049);})[_0x1e00('0x16')](function(_0x17243f){logger[_0x1e00('0x11')](_0x1e00('0x1f'),_0x17243f['message'],_0x1eab94);_0x27799a(_0x18985a['error'](0x1f4,_0x17243f[_0x1e00('0x14')]));});});};
\ No newline at end of file
+var _0x0e1a=['../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','CreateSquareReport','SquareReport','create','body','options','update','raw','attributes','limit','UpdateSquareReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5bda4f,_0x22b15f){var _0x11f675=function(_0x28cd5a){while(--_0x28cd5a){_0x5bda4f['push'](_0x5bda4f['shift']());}};_0x11f675(++_0x22b15f);}(_0x0e1a,0x142));var _0xa0e1=function(_0x59572f,_0x29a9fa){_0x59572f=_0x59572f-0x0;var _0x11beb4=_0x0e1a[_0x59572f];return _0x11beb4;};'use strict';var _=require('lodash');var util=require(_0xa0e1('0x0'));var moment=require('moment');var BPromise=require(_0xa0e1('0x1'));var rs=require(_0xa0e1('0x2'));var fs=require('fs');var Redis=require(_0xa0e1('0x3'));var db=require(_0xa0e1('0x4'))['db'];var utils=require(_0xa0e1('0x5'));var logger=require(_0xa0e1('0x6'))(_0xa0e1('0x7'));var config=require(_0xa0e1('0x8'));var jayson=require(_0xa0e1('0x9'));var client=jayson[_0xa0e1('0xa')][_0xa0e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c00af,_0x2ae484,_0x1373e){return new BPromise(function(_0x1c06c3,_0x33ab02){return client[_0xa0e1('0xc')](_0x2c00af,_0x1373e)[_0xa0e1('0xd')](function(_0x2a623b){logger[_0xa0e1('0xe')](_0xa0e1('0xf'),_0x2ae484,'request\x20sent');logger[_0xa0e1('0x10')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x2ae484,_0xa0e1('0x11'),JSON[_0xa0e1('0x12')](_0x2a623b));if(_0x2a623b[_0xa0e1('0x13')]){if(_0x2a623b[_0xa0e1('0x13')][_0xa0e1('0x14')]===0x1f4){logger[_0xa0e1('0x13')](_0xa0e1('0xf'),_0x2ae484,_0x2a623b[_0xa0e1('0x13')]['message']);return _0x33ab02(_0x2a623b[_0xa0e1('0x13')][_0xa0e1('0x15')]);}logger['error'](_0xa0e1('0xf'),_0x2ae484,_0x2a623b[_0xa0e1('0x13')][_0xa0e1('0x15')]);return _0x1c06c3(_0x2a623b[_0xa0e1('0x13')]['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x2ae484,_0xa0e1('0x11'));_0x1c06c3(_0x2a623b['result']['message']);}})[_0xa0e1('0x16')](function(_0x4e4191){logger[_0xa0e1('0x13')](_0xa0e1('0xf'),_0x2ae484,_0x4e4191);_0x33ab02(_0x4e4191);});});}exports[_0xa0e1('0x17')]=function(_0x4137f3){var _0x47998e=this;return new Promise(function(_0x1f4b9c,_0x1f2e46){return db[_0xa0e1('0x18')][_0xa0e1('0x19')](_0x4137f3[_0xa0e1('0x1a')],{'raw':_0x4137f3[_0xa0e1('0x1b')]?_0x4137f3[_0xa0e1('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xa0e1('0xd')](function(_0x6177e8){logger[_0xa0e1('0xe')](_0xa0e1('0x17'),_0x4137f3);logger[_0xa0e1('0x10')](_0xa0e1('0x17'),_0x4137f3,JSON[_0xa0e1('0x12')](_0x6177e8));_0x1f4b9c(_0x6177e8);})[_0xa0e1('0x16')](function(_0x5aaa22){logger[_0xa0e1('0x13')](_0xa0e1('0x17'),_0x5aaa22[_0xa0e1('0x15')],_0x4137f3);_0x1f2e46(_0x47998e[_0xa0e1('0x13')](0x1f4,_0x5aaa22['message']));});});};exports['UpdateSquareReport']=function(_0x32204e){var _0x4e4ae4=this;return new Promise(function(_0x129a7b,_0xb918d0){return db[_0xa0e1('0x18')][_0xa0e1('0x1c')](_0x32204e[_0xa0e1('0x1a')],{'raw':_0x32204e['options']?_0x32204e[_0xa0e1('0x1b')][_0xa0e1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32204e[_0xa0e1('0x1b')]?_0x32204e[_0xa0e1('0x1b')]['where']||null:null,'attributes':_0x32204e[_0xa0e1('0x1b')]?_0x32204e[_0xa0e1('0x1b')][_0xa0e1('0x1e')]||null:null,'limit':_0x32204e['options']?_0x32204e[_0xa0e1('0x1b')][_0xa0e1('0x1f')]||null:null})[_0xa0e1('0xd')](function(_0x30b0b0){logger['info']('UpdateSquareReport',_0x32204e);logger[_0xa0e1('0x10')](_0xa0e1('0x20'),_0x32204e,JSON['stringify'](_0x30b0b0));_0x129a7b(_0x30b0b0);})[_0xa0e1('0x16')](function(_0x3868ad){logger[_0xa0e1('0x13')](_0xa0e1('0x20'),_0x3868ad['message'],_0x32204e);_0xb918d0(_0x4e4ae4[_0xa0e1('0x13')](0x1f4,_0x3868ad[_0xa0e1('0x15')]));});});};
\ No newline at end of file
index 0057216..9605c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43b2=['isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller'];(function(_0xb7a00b,_0x4e2e7a){var _0x5188fa=function(_0x814379){while(--_0x814379){_0xb7a00b['push'](_0xb7a00b['shift']());}};_0x5188fa(++_0x4e2e7a);}(_0x43b2,0x1c5));var _0x243b=function(_0x222016,_0x3910f8){_0x222016=_0x222016-0x0;var _0x464a27=_0x43b2[_0x222016];return _0x464a27;};'use strict';var multer=require('multer');var util=require(_0x243b('0x0'));var path=require('path');var timeout=require(_0x243b('0x1'));var express=require(_0x243b('0x2'));var router=express[_0x243b('0x3')]();var fs_extra=require(_0x243b('0x4'));var auth=require(_0x243b('0x5'));var interaction=require(_0x243b('0x6'));var config=require(_0x243b('0x7'));var controller=require(_0x243b('0x8'));router['get']('/',auth[_0x243b('0x9')](),controller[_0x243b('0xa')]);router[_0x243b('0xb')](_0x243b('0xc'),auth['isAuthenticated'](),controller[_0x243b('0xd')]);router[_0x243b('0xb')](_0x243b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x243b('0xf')]('/',auth[_0x243b('0x9')](),controller[_0x243b('0x10')]);router[_0x243b('0x11')](_0x243b('0xe'),auth[_0x243b('0x9')](),controller[_0x243b('0x12')]);router[_0x243b('0x13')]('/:id',auth[_0x243b('0x9')](),controller[_0x243b('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xec8a=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec8a,0x121));var _0xaec8=function(_0x10a86e,_0x916cdd){_0x10a86e=_0x10a86e-0x0;var _0x2d2bcb=_0xec8a[_0x10a86e];return _0x2d2bcb;};'use strict';var multer=require('multer');var util=require(_0xaec8('0x0'));var path=require(_0xaec8('0x1'));var timeout=require(_0xaec8('0x2'));var express=require(_0xaec8('0x3'));var router=express[_0xaec8('0x4')]();var fs_extra=require(_0xaec8('0x5'));var auth=require(_0xaec8('0x6'));var interaction=require(_0xaec8('0x7'));var config=require(_0xaec8('0x8'));var controller=require(_0xaec8('0x9'));router[_0xaec8('0xa')]('/',auth[_0xaec8('0xb')](),controller[_0xaec8('0xc')]);router[_0xaec8('0xa')](_0xaec8('0xd'),auth[_0xaec8('0xb')](),controller[_0xaec8('0xe')]);router[_0xaec8('0xa')](_0xaec8('0xf'),auth[_0xaec8('0xb')](),controller[_0xaec8('0x10')]);router[_0xaec8('0x11')]('/',auth[_0xaec8('0xb')](),controller[_0xaec8('0x12')]);router['put'](_0xaec8('0xf'),auth[_0xaec8('0xb')](),controller[_0xaec8('0x13')]);router[_0xaec8('0x14')](_0xaec8('0xf'),auth[_0xaec8('0xb')](),controller[_0xaec8('0x15')]);module[_0xaec8('0x16')]=router;
\ No newline at end of file
index 4174b0d..472758d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x935c=['STRING','TEXT','exports'];(function(_0x1d5041,_0x553af8){var _0x1b2f5b=function(_0x1360d3){while(--_0x1360d3){_0x1d5041['push'](_0x1d5041['shift']());}};_0x1b2f5b(++_0x553af8);}(_0x935c,0x9b));var _0xc935=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x935c[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');module[_0xc935('0x0')]={'uniqueid':{'type':Sequelize[_0xc935('0x1')]},'node':{'type':Sequelize[_0xc935('0x1')]},'application':{'type':Sequelize[_0xc935('0x1')]},'data':{'type':Sequelize[_0xc935('0x2')]},'project_name':{'type':Sequelize[_0xc935('0x1')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9cb2=['exports','STRING','TEXT','sequelize'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x9cb2,0x137));var _0x29cb=function(_0x12c9d3,_0x2f577e){_0x12c9d3=_0x12c9d3-0x0;var _0x255de1=_0x9cb2[_0x12c9d3];return _0x255de1;};'use strict';var Sequelize=require(_0x29cb('0x0'));module[_0x29cb('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x29cb('0x2')]},'application':{'type':Sequelize[_0x29cb('0x2')]},'data':{'type':Sequelize[_0x29cb('0x3')]},'project_name':{'type':Sequelize[_0x29cb('0x2')]},'callerid':{'type':Sequelize[_0x29cb('0x2')]}};
\ No newline at end of file
index a47abec..18db91a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ad9=['findAll','catch','params','keys','fields','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../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','set','apply','reject','save','destroy','end','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','includeAll','include'];(function(_0x25e039,_0x331d95){var _0x1d9fce=function(_0x30265b){while(--_0x30265b){_0x25e039['push'](_0x25e039['shift']());}};_0x1d9fce(++_0x331d95);}(_0x9ad9,0x13a));var _0x99ad=function(_0x4e90e3,_0x570a1d){_0x4e90e3=_0x4e90e3-0x0;var _0x295e5b=_0x9ad9[_0x4e90e3];return _0x295e5b;};'use strict';var emlformat=require(_0x99ad('0x0'));var rimraf=require(_0x99ad('0x1'));var zipdir=require(_0x99ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99ad('0x3'));var moment=require('moment');var BPromise=require(_0x99ad('0x4'));var Mustache=require(_0x99ad('0x5'));var util=require('util');var path=require(_0x99ad('0x6'));var sox=require(_0x99ad('0x7'));var csv=require('to-csv');var ejs=require(_0x99ad('0x8'));var fs=require('fs');var fs_extra=require(_0x99ad('0x9'));var _=require(_0x99ad('0xa'));var squel=require(_0x99ad('0xb'));var crypto=require(_0x99ad('0xc'));var jsforce=require(_0x99ad('0xd'));var deskjs=require(_0x99ad('0xe'));var toCsv=require(_0x99ad('0xf'));var querystring=require('querystring');var Papa=require(_0x99ad('0x10'));var Redis=require('ioredis');var authService=require(_0x99ad('0x11'));var qs=require(_0x99ad('0x12'));var as=require(_0x99ad('0x13'));var hardwareService=require(_0x99ad('0x14'));var logger=require(_0x99ad('0x15'))(_0x99ad('0x16'));var utils=require(_0x99ad('0x17'));var config=require(_0x99ad('0x18'));var licenseUtil=require(_0x99ad('0x19'));var db=require(_0x99ad('0x1a'))['db'];function respondWithStatusCode(_0x4d4a9c,_0x2dc805){_0x2dc805=_0x2dc805||0xcc;return function(_0x47e891){if(_0x47e891){return _0x4d4a9c['sendStatus'](_0x2dc805);}return _0x4d4a9c[_0x99ad('0x1b')](_0x2dc805)['end']();};}function respondWithResult(_0x3c4a5c,_0x6f8d83){_0x6f8d83=_0x6f8d83||0xc8;return function(_0x4ecb08){if(_0x4ecb08){return _0x3c4a5c['status'](_0x6f8d83)[_0x99ad('0x1c')](_0x4ecb08);}};}function respondWithFilteredResult(_0x5002db,_0x1f639c){return function(_0xbb5fb2){if(_0xbb5fb2){var _0x2b2339=typeof _0x1f639c[_0x99ad('0x1d')]===_0x99ad('0x1e')&&typeof _0x1f639c[_0x99ad('0x1f')]===_0x99ad('0x1e');var _0x2c2ed8=_0xbb5fb2[_0x99ad('0x20')];var _0x5229a5=_0x2b2339?0x0:_0x1f639c[_0x99ad('0x1d')];var _0x2e9bd9=_0x2b2339?_0xbb5fb2[_0x99ad('0x20')]:_0x1f639c['offset']+_0x1f639c[_0x99ad('0x1f')];var _0x511b16;if(_0x2e9bd9>=_0x2c2ed8){_0x2e9bd9=_0x2c2ed8;_0x511b16=0xc8;}else{_0x511b16=0xce;}_0x5002db[_0x99ad('0x1b')](_0x511b16);return _0x5002db[_0x99ad('0x21')]('Content-Range',_0x5229a5+'-'+_0x2e9bd9+'/'+_0x2c2ed8)[_0x99ad('0x1c')](_0xbb5fb2);}return null;};}function patchUpdates(_0x4bbbb5){return function(_0x16962b){try{jsonpatch[_0x99ad('0x22')](_0x16962b,_0x4bbbb5,!![]);}catch(_0x12771a){return BPromise[_0x99ad('0x23')](_0x12771a);}return _0x16962b[_0x99ad('0x24')]();};}function saveUpdates(_0xee64a9,_0xf6d33e){return function(_0x2dddbc){if(_0x2dddbc){return _0x2dddbc['update'](_0xee64a9)['then'](function(_0x45be6b){return _0x45be6b;});}return null;};}function removeEntity(_0x26db93,_0x2e7984){return function(_0x1746eb){if(_0x1746eb){return _0x1746eb[_0x99ad('0x25')]()['then'](function(){_0x26db93[_0x99ad('0x1b')](0xcc)[_0x99ad('0x26')]();});}};}function handleEntityNotFound(_0x339d0c,_0x5d6ef3){return function(_0x26c358){if(!_0x26c358){_0x339d0c['sendStatus'](0x194);}return _0x26c358;};}function handleError(_0x217b2c,_0x4681d7){_0x4681d7=_0x4681d7||0x1f4;return function(_0x89d7e4){logger['error'](_0x89d7e4['stack']);if(_0x89d7e4['name']){delete _0x89d7e4[_0x99ad('0x27')];}_0x217b2c['status'](_0x4681d7)[_0x99ad('0x28')](_0x89d7e4);};}exports[_0x99ad('0x29')]=function(_0x505a3e,_0x15062e){var _0x4cbb90={},_0x1f10b3={},_0x5ae852={'count':0x0,'rows':[]};var _0x1cc30d=_[_0x99ad('0x2a')](db[_0x99ad('0x2b')][_0x99ad('0x2c')],function(_0x1d1d43){return{'name':_0x1d1d43[_0x99ad('0x2d')],'type':_0x1d1d43[_0x99ad('0x2e')][_0x99ad('0x2f')]};});_0x1f10b3[_0x99ad('0x30')]=_['map'](_0x1cc30d,_0x99ad('0x27'));_0x1f10b3[_0x99ad('0x31')]=_['keys'](_0x505a3e[_0x99ad('0x31')]);_0x1f10b3['filters']=_['intersection'](_0x1f10b3[_0x99ad('0x30')],_0x1f10b3[_0x99ad('0x31')]);_0x4cbb90[_0x99ad('0x32')]=_[_0x99ad('0x33')](_0x1f10b3[_0x99ad('0x30')],qs['fields'](_0x505a3e[_0x99ad('0x31')]['fields']));_0x4cbb90['attributes']=_0x4cbb90[_0x99ad('0x32')][_0x99ad('0x34')]?_0x4cbb90[_0x99ad('0x32')]:_0x1f10b3['model'];if(!_0x505a3e['query'][_0x99ad('0x35')]('nolimit')){_0x4cbb90[_0x99ad('0x1f')]=qs['limit'](_0x505a3e[_0x99ad('0x31')][_0x99ad('0x1f')]);_0x4cbb90[_0x99ad('0x1d')]=qs[_0x99ad('0x1d')](_0x505a3e[_0x99ad('0x31')][_0x99ad('0x1d')]);}_0x4cbb90[_0x99ad('0x36')]=qs['sort'](_0x505a3e[_0x99ad('0x31')][_0x99ad('0x37')]);_0x4cbb90[_0x99ad('0x38')]=qs[_0x99ad('0x39')](_[_0x99ad('0x3a')](_0x505a3e['query'],_0x1f10b3[_0x99ad('0x39')]),_0x1cc30d);if(_0x505a3e[_0x99ad('0x31')][_0x99ad('0x3b')]){_0x4cbb90[_0x99ad('0x38')]=_['merge'](_0x4cbb90['where'],{'$or':_[_0x99ad('0x2a')](_0x1cc30d,function(_0x416ab1){if(_0x416ab1['type']!==_0x99ad('0x3c')){var _0x49d4a5={};_0x49d4a5[_0x416ab1[_0x99ad('0x27')]]={'$like':'%'+_0x505a3e[_0x99ad('0x31')][_0x99ad('0x3b')]+'%'};return _0x49d4a5;}})});}_0x4cbb90=_[_0x99ad('0x3d')]({},_0x4cbb90,_0x505a3e[_0x99ad('0x3e')]);var _0x4c0d76={'where':_0x4cbb90[_0x99ad('0x38')]};return db[_0x99ad('0x2b')][_0x99ad('0x20')](_0x4c0d76)[_0x99ad('0x3f')](function(_0xff7210){_0x5ae852[_0x99ad('0x20')]=_0xff7210;if(_0x505a3e[_0x99ad('0x31')][_0x99ad('0x40')]){_0x4cbb90[_0x99ad('0x41')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x99ad('0x42')](_0x4cbb90);})[_0x99ad('0x3f')](function(_0x3d150c){_0x5ae852['rows']=_0x3d150c;return _0x5ae852;})[_0x99ad('0x3f')](respondWithFilteredResult(_0x15062e,_0x4cbb90))[_0x99ad('0x43')](handleError(_0x15062e,null));};exports['show']=function(_0x3364f1,_0x41ad9e){var _0x3009e8={'raw':!![],'where':{'id':_0x3364f1[_0x99ad('0x44')]['id']}},_0x40edee={};_0x40edee[_0x99ad('0x30')]=_[_0x99ad('0x45')](db[_0x99ad('0x2b')][_0x99ad('0x2c')]);_0x40edee[_0x99ad('0x31')]=_['keys'](_0x3364f1['query']);_0x40edee['filters']=_['intersection'](_0x40edee[_0x99ad('0x30')],_0x40edee[_0x99ad('0x31')]);_0x3009e8[_0x99ad('0x32')]=_[_0x99ad('0x33')](_0x40edee['model'],qs[_0x99ad('0x46')](_0x3364f1['query'][_0x99ad('0x46')]));_0x3009e8[_0x99ad('0x32')]=_0x3009e8['attributes']['length']?_0x3009e8[_0x99ad('0x32')]:_0x40edee[_0x99ad('0x30')];if(_0x3364f1[_0x99ad('0x31')]['includeAll']){_0x3009e8[_0x99ad('0x41')]=[{'all':!![]}];}_0x3009e8=_[_0x99ad('0x3d')]({},_0x3009e8,_0x3364f1[_0x99ad('0x3e')]);return db['SquareDetailsReport'][_0x99ad('0x47')](_0x3009e8)[_0x99ad('0x3f')](handleEntityNotFound(_0x41ad9e,null))[_0x99ad('0x3f')](respondWithResult(_0x41ad9e,null))[_0x99ad('0x43')](handleError(_0x41ad9e,null));};exports[_0x99ad('0x48')]=function(_0x17f7b0,_0x274e27){return db[_0x99ad('0x2b')][_0x99ad('0x48')](_0x17f7b0[_0x99ad('0x49')],{})[_0x99ad('0x3f')](respondWithResult(_0x274e27,0xc9))[_0x99ad('0x43')](handleError(_0x274e27,null));};exports[_0x99ad('0x4a')]=function(_0xc0efde,_0x10ca69){if(_0xc0efde['body']['id']){delete _0xc0efde['body']['id'];}return db[_0x99ad('0x2b')][_0x99ad('0x47')]({'where':{'id':_0xc0efde['params']['id']}})[_0x99ad('0x3f')](handleEntityNotFound(_0x10ca69,null))[_0x99ad('0x3f')](saveUpdates(_0xc0efde[_0x99ad('0x49')],null))['then'](respondWithResult(_0x10ca69,null))[_0x99ad('0x43')](handleError(_0x10ca69,null));};exports[_0x99ad('0x25')]=function(_0x225ba5,_0x5625b7){return db['SquareDetailsReport']['find']({'where':{'id':_0x225ba5[_0x99ad('0x44')]['id']}})[_0x99ad('0x3f')](handleEntityNotFound(_0x5625b7,null))[_0x99ad('0x3f')](removeEntity(_0x5625b7,null))[_0x99ad('0x43')](handleError(_0x5625b7,null));};exports[_0x99ad('0x4b')]=function(_0x545538,_0x540ba6){return db[_0x99ad('0x2b')]['describe']()['then'](respondWithResult(_0x540ba6,null))[_0x99ad('0x43')](handleError(_0x540ba6,null));};
\ No newline at end of file
+var _0x549d=['include','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','save','update','then','destroy','end','error','name','send','map','SquareDetailsReport','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','rawAttributes','length'];(function(_0x1b2aa0,_0x3864be){var _0x26d765=function(_0x5088c0){while(--_0x5088c0){_0x1b2aa0['push'](_0x1b2aa0['shift']());}};_0x26d765(++_0x3864be);}(_0x549d,0x9c));var _0xd549=function(_0x4d22cc,_0xda3cac){_0x4d22cc=_0x4d22cc-0x0;var _0x38ad44=_0x549d[_0x4d22cc];return _0x38ad44;};'use strict';var emlformat=require(_0xd549('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd549('0x1'));var jsonpatch=require(_0xd549('0x2'));var rp=require(_0xd549('0x3'));var moment=require(_0xd549('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd549('0x5'));var util=require(_0xd549('0x6'));var path=require(_0xd549('0x7'));var sox=require(_0xd549('0x8'));var csv=require(_0xd549('0x9'));var ejs=require(_0xd549('0xa'));var fs=require('fs');var fs_extra=require(_0xd549('0xb'));var _=require(_0xd549('0xc'));var squel=require(_0xd549('0xd'));var crypto=require(_0xd549('0xe'));var jsforce=require(_0xd549('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd549('0x10'));var Papa=require(_0xd549('0x11'));var Redis=require(_0xd549('0x12'));var authService=require(_0xd549('0x13'));var qs=require(_0xd549('0x14'));var as=require(_0xd549('0x15'));var hardwareService=require(_0xd549('0x16'));var logger=require(_0xd549('0x17'))('api');var utils=require(_0xd549('0x18'));var config=require(_0xd549('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aaae8,_0xc07218){_0xc07218=_0xc07218||0xcc;return function(_0x727647){if(_0x727647){return _0x3aaae8[_0xd549('0x1a')](_0xc07218);}return _0x3aaae8['status'](_0xc07218)['end']();};}function respondWithResult(_0x26dc99,_0xe657be){_0xe657be=_0xe657be||0xc8;return function(_0x20909f){if(_0x20909f){return _0x26dc99[_0xd549('0x1b')](_0xe657be)['json'](_0x20909f);}};}function respondWithFilteredResult(_0xa23ec9,_0x444ce5){return function(_0x230c27){if(_0x230c27){var _0x40c71b=typeof _0x444ce5[_0xd549('0x1c')]===_0xd549('0x1d')&&typeof _0x444ce5['limit']===_0xd549('0x1d');var _0xbdd117=_0x230c27[_0xd549('0x1e')];var _0x3139e8=_0x40c71b?0x0:_0x444ce5[_0xd549('0x1c')];var _0x364ec2=_0x40c71b?_0x230c27[_0xd549('0x1e')]:_0x444ce5[_0xd549('0x1c')]+_0x444ce5[_0xd549('0x1f')];var _0x3e96fb;if(_0x364ec2>=_0xbdd117){_0x364ec2=_0xbdd117;_0x3e96fb=0xc8;}else{_0x3e96fb=0xce;}_0xa23ec9['status'](_0x3e96fb);return _0xa23ec9[_0xd549('0x20')](_0xd549('0x21'),_0x3139e8+'-'+_0x364ec2+'/'+_0xbdd117)[_0xd549('0x22')](_0x230c27);}return null;};}function patchUpdates(_0x2da347){return function(_0x579fa5){try{jsonpatch['apply'](_0x579fa5,_0x2da347,!![]);}catch(_0x270fc1){return BPromise['reject'](_0x270fc1);}return _0x579fa5[_0xd549('0x23')]();};}function saveUpdates(_0x3a7cc6,_0x7e0dfb){return function(_0x398ab7){if(_0x398ab7){return _0x398ab7[_0xd549('0x24')](_0x3a7cc6)[_0xd549('0x25')](function(_0x2d8b3c){return _0x2d8b3c;});}return null;};}function removeEntity(_0xa8ba9,_0x59e2e9){return function(_0x25c2cb){if(_0x25c2cb){return _0x25c2cb[_0xd549('0x26')]()[_0xd549('0x25')](function(){_0xa8ba9[_0xd549('0x1b')](0xcc)[_0xd549('0x27')]();});}};}function handleEntityNotFound(_0x16ff7a,_0x37ea5a){return function(_0xf56116){if(!_0xf56116){_0x16ff7a['sendStatus'](0x194);}return _0xf56116;};}function handleError(_0xa33ac7,_0x2c043f){_0x2c043f=_0x2c043f||0x1f4;return function(_0x2810a5){logger[_0xd549('0x28')](_0x2810a5['stack']);if(_0x2810a5[_0xd549('0x29')]){delete _0x2810a5[_0xd549('0x29')];}_0xa33ac7['status'](_0x2c043f)[_0xd549('0x2a')](_0x2810a5);};}exports['index']=function(_0x4ff93d,_0x3d0bf5){var _0x333688={},_0x153229={},_0x300b18={'count':0x0,'rows':[]};var _0x5ec533=_[_0xd549('0x2b')](db[_0xd549('0x2c')]['rawAttributes'],function(_0x38fc52){return{'name':_0x38fc52['fieldName'],'type':_0x38fc52[_0xd549('0x2d')][_0xd549('0x2e')]};});_0x153229[_0xd549('0x2f')]=_['map'](_0x5ec533,_0xd549('0x29'));_0x153229[_0xd549('0x30')]=_[_0xd549('0x31')](_0x4ff93d[_0xd549('0x30')]);_0x153229[_0xd549('0x32')]=_[_0xd549('0x33')](_0x153229[_0xd549('0x2f')],_0x153229[_0xd549('0x30')]);_0x333688['attributes']=_['intersection'](_0x153229[_0xd549('0x2f')],qs[_0xd549('0x34')](_0x4ff93d[_0xd549('0x30')][_0xd549('0x34')]));_0x333688['attributes']=_0x333688[_0xd549('0x35')]['length']?_0x333688[_0xd549('0x35')]:_0x153229['model'];if(!_0x4ff93d[_0xd549('0x30')]['hasOwnProperty'](_0xd549('0x36'))){_0x333688[_0xd549('0x1f')]=qs[_0xd549('0x1f')](_0x4ff93d[_0xd549('0x30')]['limit']);_0x333688['offset']=qs[_0xd549('0x1c')](_0x4ff93d[_0xd549('0x30')]['offset']);}_0x333688['order']=qs[_0xd549('0x37')](_0x4ff93d[_0xd549('0x30')]['sort']);_0x333688['where']=qs[_0xd549('0x32')](_[_0xd549('0x38')](_0x4ff93d[_0xd549('0x30')],_0x153229[_0xd549('0x32')]),_0x5ec533);if(_0x4ff93d[_0xd549('0x30')]['filter']){_0x333688['where']=_[_0xd549('0x39')](_0x333688[_0xd549('0x3a')],{'$or':_[_0xd549('0x2b')](_0x5ec533,function(_0xd2db23){if(_0xd2db23['type']!==_0xd549('0x3b')){var _0x4db6f4={};_0x4db6f4[_0xd2db23['name']]={'$like':'%'+_0x4ff93d[_0xd549('0x30')][_0xd549('0x3c')]+'%'};return _0x4db6f4;}})});}_0x333688=_['merge']({},_0x333688,_0x4ff93d[_0xd549('0x3d')]);var _0x5b6d5e={'where':_0x333688[_0xd549('0x3a')]};return db[_0xd549('0x2c')][_0xd549('0x1e')](_0x5b6d5e)[_0xd549('0x25')](function(_0x159979){_0x300b18[_0xd549('0x1e')]=_0x159979;if(_0x4ff93d['query'][_0xd549('0x3e')]){_0x333688['include']=[{'all':!![]}];}return db[_0xd549('0x2c')][_0xd549('0x3f')](_0x333688);})[_0xd549('0x25')](function(_0x31bd39){_0x300b18[_0xd549('0x40')]=_0x31bd39;return _0x300b18;})[_0xd549('0x25')](respondWithFilteredResult(_0x3d0bf5,_0x333688))['catch'](handleError(_0x3d0bf5,null));};exports[_0xd549('0x41')]=function(_0x27e28c,_0x4fad1f){var _0xab8b64={'raw':!![],'where':{'id':_0x27e28c[_0xd549('0x42')]['id']}},_0x2565aa={};_0x2565aa[_0xd549('0x2f')]=_['keys'](db[_0xd549('0x2c')][_0xd549('0x43')]);_0x2565aa[_0xd549('0x30')]=_[_0xd549('0x31')](_0x27e28c['query']);_0x2565aa[_0xd549('0x32')]=_[_0xd549('0x33')](_0x2565aa['model'],_0x2565aa['query']);_0xab8b64['attributes']=_[_0xd549('0x33')](_0x2565aa[_0xd549('0x2f')],qs[_0xd549('0x34')](_0x27e28c[_0xd549('0x30')][_0xd549('0x34')]));_0xab8b64[_0xd549('0x35')]=_0xab8b64[_0xd549('0x35')][_0xd549('0x44')]?_0xab8b64['attributes']:_0x2565aa['model'];if(_0x27e28c[_0xd549('0x30')][_0xd549('0x3e')]){_0xab8b64[_0xd549('0x45')]=[{'all':!![]}];}_0xab8b64=_[_0xd549('0x39')]({},_0xab8b64,_0x27e28c[_0xd549('0x3d')]);return db[_0xd549('0x2c')][_0xd549('0x46')](_0xab8b64)[_0xd549('0x25')](handleEntityNotFound(_0x4fad1f,null))['then'](respondWithResult(_0x4fad1f,null))[_0xd549('0x47')](handleError(_0x4fad1f,null));};exports[_0xd549('0x48')]=function(_0x26a7e2,_0x5690b8){return db[_0xd549('0x2c')]['create'](_0x26a7e2[_0xd549('0x49')],{})[_0xd549('0x25')](respondWithResult(_0x5690b8,0xc9))[_0xd549('0x47')](handleError(_0x5690b8,null));};exports[_0xd549('0x24')]=function(_0x515d53,_0x1342f0){if(_0x515d53['body']['id']){delete _0x515d53[_0xd549('0x49')]['id'];}return db[_0xd549('0x2c')]['find']({'where':{'id':_0x515d53[_0xd549('0x42')]['id']}})[_0xd549('0x25')](handleEntityNotFound(_0x1342f0,null))[_0xd549('0x25')](saveUpdates(_0x515d53[_0xd549('0x49')],null))[_0xd549('0x25')](respondWithResult(_0x1342f0,null))[_0xd549('0x47')](handleError(_0x1342f0,null));};exports[_0xd549('0x26')]=function(_0xa63761,_0x2609ca){return db[_0xd549('0x2c')][_0xd549('0x46')]({'where':{'id':_0xa63761['params']['id']}})[_0xd549('0x25')](handleEntityNotFound(_0x2609ca,null))[_0xd549('0x25')](removeEntity(_0x2609ca,null))[_0xd549('0x47')](handleError(_0x2609ca,null));};exports[_0xd549('0x4a')]=function(_0x19b0dc,_0x3f4ab9){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0x3f4ab9,null))[_0xd549('0x47')](handleError(_0x3f4ab9,null));};
\ No newline at end of file
index 94f76e4..b11b6d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd111=['SquareDetailsReport','report_square_details','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x3e6ead,_0x61f91a){var _0x28f590=function(_0x1e2242){while(--_0x1e2242){_0x3e6ead['push'](_0x3e6ead['shift']());}};_0x28f590(++_0x61f91a);}(_0xd111,0x154));var _0x1d11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd111[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1d11('0x0'));var logger=require(_0x1d11('0x1'))(_0x1d11('0x2'));var moment=require(_0x1d11('0x3'));var BPromise=require(_0x1d11('0x4'));var rp=require(_0x1d11('0x5'));var fs=require('fs');var path=require(_0x1d11('0x6'));var rimraf=require(_0x1d11('0x7'));var config=require(_0x1d11('0x8'));var attributes=require(_0x1d11('0x9'));module[_0x1d11('0xa')]=function(_0x2d5e24,_0x273314){return _0x2d5e24['define'](_0x1d11('0xb'),attributes,{'tableName':_0x1d11('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7219=['api','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7219,0x159));var _0x9721=function(_0x13ca5e,_0x2b4f5a){_0x13ca5e=_0x13ca5e-0x0;var _0xedc9f3=_0x7219[_0x13ca5e];return _0xedc9f3;};'use strict';var _=require(_0x9721('0x0'));var util=require(_0x9721('0x1'));var logger=require(_0x9721('0x2'))(_0x9721('0x3'));var moment=require('moment');var BPromise=require(_0x9721('0x4'));var rp=require(_0x9721('0x5'));var fs=require('fs');var path=require(_0x9721('0x6'));var rimraf=require('rimraf');var config=require(_0x9721('0x7'));var attributes=require(_0x9721('0x8'));module[_0x9721('0x9')]=function(_0x3de8b7,_0x4f9151){return _0x3de8b7[_0x9721('0xa')](_0x9721('0xb'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ef5c737..c744de1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8a0=['raw','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x48fc26,_0x70eec8){_0x48fc26=_0x48fc26-0x0;var _0x45774f=_0xb8a0[_0x48fc26];return _0x45774f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b8a('0x0'));var BPromise=require(_0x0b8a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b8a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0b8a('0x3'));var jayson=require(_0x0b8a('0x4'));var client=jayson[_0x0b8a('0x5')][_0x0b8a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3527dd,_0x4039c2,_0x33a5bd){return new BPromise(function(_0x463015,_0x29ebdc){return client[_0x0b8a('0x7')](_0x3527dd,_0x33a5bd)[_0x0b8a('0x8')](function(_0x478492){logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,_0x0b8a('0xb'));logger[_0x0b8a('0xc')](_0x0b8a('0xd'),_0x4039c2,_0x0b8a('0xb'),JSON[_0x0b8a('0xe')](_0x478492));if(_0x478492[_0x0b8a('0xf')]){if(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x10')]===0x1f4){logger['error'](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x29ebdc(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);}logger[_0x0b8a('0xf')](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x463015(_0x478492['error'][_0x0b8a('0x11')]);}else{logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,'request\x20sent');_0x463015(_0x478492[_0x0b8a('0x12')][_0x0b8a('0x11')]);}})[_0x0b8a('0x13')](function(_0x5a2623){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x4039c2,_0x5a2623);_0x29ebdc(_0x5a2623);});});}exports[_0x0b8a('0x14')]=function(_0x51d28e){var _0x1a1d6b=this;return new Promise(function(_0x3c80c3,_0x12428e){return db[_0x0b8a('0x15')][_0x0b8a('0x16')](_0x51d28e[_0x0b8a('0x17')],{'raw':_0x51d28e[_0x0b8a('0x18')]?_0x51d28e[_0x0b8a('0x18')][_0x0b8a('0x19')]===undefined?!![]:![]:!![]})[_0x0b8a('0x8')](function(_0x313612){logger['info'](_0x0b8a('0x14'),_0x51d28e);logger[_0x0b8a('0xc')]('CreateSquareDetailsReport',_0x51d28e,JSON[_0x0b8a('0xe')](_0x313612));_0x3c80c3(_0x313612);})[_0x0b8a('0x13')](function(_0xba351e){logger[_0x0b8a('0xf')]('CreateSquareDetailsReport',_0xba351e[_0x0b8a('0x11')],_0x51d28e);_0x12428e(_0x1a1d6b['error'](0x1f4,_0xba351e[_0x0b8a('0x11')]));});});};
\ No newline at end of file
+var _0x25e7=['SquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareDetailsReport'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0x25e7,0x1d6));var _0x725e=function(_0x507d62,_0x1f83cb){_0x507d62=_0x507d62-0x0;var _0xed22f2=_0x25e7[_0x507d62];return _0xed22f2;};'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')]('SquareDetailsReport,\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')](_0x397e33[_0x725e('0x19')],{'raw':_0x397e33[_0x725e('0x1a')]?_0x397e33[_0x725e('0x1a')][_0x725e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2fc416){logger[_0x725e('0xd')](_0x725e('0x16'),_0x397e33);logger[_0x725e('0x10')](_0x725e('0x16'),_0x397e33,JSON[_0x725e('0x1c')](_0x2fc416));_0x2811e7(_0x2fc416);})[_0x725e('0x15')](function(_0x262b01){logger[_0x725e('0x12')]('CreateSquareDetailsReport',_0x262b01[_0x725e('0x13')],_0x397e33);_0x528e7d(_0x268438[_0x725e('0x12')](0x1f4,_0x262b01[_0x725e('0x13')]));});});};
\ No newline at end of file
index 07b1073..560c555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f0a=['Router','./system.controller','index','get','/process/:pid/kill','killProcess','exports','express'];(function(_0x1a73be,_0x4a7312){var _0x57b2b7=function(_0xb584a4){while(--_0xb584a4){_0x1a73be['push'](_0x1a73be['shift']());}};_0x57b2b7(++_0x4a7312);}(_0x1f0a,0x147));var _0xa1f0=function(_0x5310a7,_0x784e03){_0x5310a7=_0x5310a7-0x0;var _0x2ab234=_0x1f0a[_0x5310a7];return _0x2ab234;};'use strict';var express=require(_0xa1f0('0x0'));var router=express[_0xa1f0('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa1f0('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0xa1f0('0x3')]);router[_0xa1f0('0x4')](_0xa1f0('0x5'),auth['isAuthenticated'](),controller[_0xa1f0('0x6')]);module[_0xa1f0('0x7')]=router;
\ No newline at end of file
+var _0xae67=['Router','../../components/auth/service','isAuthenticated','index','get','/process/:pid/kill','exports','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xae67,0x157));var _0x7ae6=function(_0x2497e5,_0x496907){_0x2497e5=_0x2497e5-0x0;var _0x12193b=_0xae67[_0x2497e5];return _0x12193b;};'use strict';var express=require(_0x7ae6('0x0'));var router=express[_0x7ae6('0x1')]();var auth=require(_0x7ae6('0x2'));var controller=require('./system.controller');router['get']('/',auth[_0x7ae6('0x3')](),controller[_0x7ae6('0x4')]);router[_0x7ae6('0x5')](_0x7ae6('0x6'),auth[_0x7ae6('0x3')](),controller['killProcess']);module[_0x7ae6('0x7')]=router;
\ No newline at end of file
index 3d8949f..39598b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0af3=['length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split'];(function(_0x3cae18,_0x1c8c40){var _0x5847b7=function(_0x49ab9b){while(--_0x49ab9b){_0x3cae18['push'](_0x3cae18['shift']());}};_0x5847b7(++_0x1c8c40);}(_0x0af3,0x14b));var _0x30af=function(_0x5a7479,_0x4ce5c1){_0x5a7479=_0x5a7479-0x0;var _0x2c7948=_0x0af3[_0x5a7479];return _0x2c7948;};'use strict';var info=require('systeminformation');var exec=require(_0x30af('0x0'))['exec'];var logger=require('../../config/logger')('api');var util=require(_0x30af('0x1'));var BPromise=require(_0x30af('0x2'));var _=require(_0x30af('0x3'));function handleError(_0x156f1b,_0x45cd4d,_0x30a668){_0x45cd4d=_0x45cd4d||0x1f4;return function(_0x22d8f6){logger[_0x30af('0x4')](_0x30af('0x5'),_0x30a668,_0x45cd4d,util[_0x30af('0x6')](_0x22d8f6,{'showHidden':![],'depth':null}));delete _0x22d8f6['name'];_0x156f1b[_0x30af('0x7')](_0x45cd4d)[_0x30af('0x8')](_0x22d8f6);};}exports['index']=function(_0x33a6b5,_0x3b5589){return info[_0x30af('0x9')]()[_0x30af('0xa')](function(_0x10e593){return _0x3b5589[_0x30af('0x7')](0xc8)[_0x30af('0xb')](_0x10e593);})[_0x30af('0xc')](function(_0x5cc5f0){return _0x3b5589[_0x30af('0x7')](0x1f4)[_0x30af('0xb')](_0x5cc5f0);});};exports[_0x30af('0xd')]=function(_0x242470,_0x224da8){var _0x3de2f9=[_0x30af('0xe')];return new BPromise(function(_0x134cf6,_0x59f3e1){return exec(util[_0x30af('0xf')](_0x30af('0x10'),_0x242470[_0x30af('0x11')]['pid']),function(_0x356ea5,_0x821f85,_0x440abc){if(_0x356ea5){return _0x59f3e1(_0x356ea5);}return _0x134cf6(_0x821f85);});})[_0x30af('0xa')](function(_0x514a41){var _0x20c4d3=![];var _0x368926=_0x514a41[_0x30af('0x12')](/\n/);for(var _0x10e646=0x0,_0x7f4009=_0x3de2f9[_0x30af('0x13')];_0x10e646<_0x7f4009,_0x20c4d3===![];_0x10e646+=0x1){if(_0x514a41[_0x30af('0x14')](_0x3de2f9[_0x10e646])>=0x0){_0x20c4d3=!![];}}if(!_0x20c4d3){throw new Error(util[_0x30af('0xf')](_0x30af('0x15'),_0x242470[_0x30af('0x11')][_0x30af('0x16')]));}process['kill'](_0x242470[_0x30af('0x11')][_0x30af('0x16')],_0x30af('0x17'));return _0x224da8[_0x30af('0x7')](0xc8)[_0x30af('0xb')]({'message':util[_0x30af('0xf')](_0x30af('0x18'),_0x242470[_0x30af('0x11')][_0x30af('0x16')])});})[_0x30af('0xc')](handleError(_0x224da8,null,'killProcess'));};
\ No newline at end of file
+var _0x4963=['split','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4963,0xff));var _0x3496=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4963[_0x321bb2];return _0x9c12ed;};'use strict';var info=require(_0x3496('0x0'));var exec=require(_0x3496('0x1'))['exec'];var logger=require('../../config/logger')(_0x3496('0x2'));var util=require(_0x3496('0x3'));var BPromise=require('bluebird');var _=require(_0x3496('0x4'));function handleError(_0xd15903,_0x2e5f0c,_0x2c7c5b){_0x2e5f0c=_0x2e5f0c||0x1f4;return function(_0x527bdb){logger['error'](_0x3496('0x5'),_0x2c7c5b,_0x2e5f0c,util[_0x3496('0x6')](_0x527bdb,{'showHidden':![],'depth':null}));delete _0x527bdb[_0x3496('0x7')];_0xd15903[_0x3496('0x8')](_0x2e5f0c)['send'](_0x527bdb);};}exports[_0x3496('0x9')]=function(_0x1c2e4f,_0x575bb1){return info[_0x3496('0xa')]()['then'](function(_0x17c071){return _0x575bb1['status'](0xc8)[_0x3496('0xb')](_0x17c071);})[_0x3496('0xc')](function(_0x47c70e){return _0x575bb1[_0x3496('0x8')](0x1f4)[_0x3496('0xb')](_0x47c70e);});};exports[_0x3496('0xd')]=function(_0x389d01,_0x5be2c9){var _0x5504b0=[_0x3496('0xe')];return new BPromise(function(_0x32a2e0,_0x5adc7b){return exec(util[_0x3496('0xf')](_0x3496('0x10'),_0x389d01[_0x3496('0x11')][_0x3496('0x12')]),function(_0x5e5b6c,_0x2f7b10,_0x3b61de){if(_0x5e5b6c){return _0x5adc7b(_0x5e5b6c);}return _0x32a2e0(_0x2f7b10);});})[_0x3496('0x13')](function(_0xcdd7e7){var _0x27f64d=![];var _0x6af504=_0xcdd7e7[_0x3496('0x14')](/\n/);for(var _0x5998a9=0x0,_0x4e86a7=_0x5504b0['length'];_0x5998a9<_0x4e86a7,_0x27f64d===![];_0x5998a9+=0x1){if(_0xcdd7e7['indexOf'](_0x5504b0[_0x5998a9])>=0x0){_0x27f64d=!![];}}if(!_0x27f64d){throw new Error(util[_0x3496('0xf')](_0x3496('0x15'),_0x389d01[_0x3496('0x11')]['pid']));}process[_0x3496('0x16')](_0x389d01['params'][_0x3496('0x12')],_0x3496('0x17'));return _0x5be2c9[_0x3496('0x8')](0xc8)[_0x3496('0xb')]({'message':util[_0x3496('0xf')](_0x3496('0x18'),_0x389d01[_0x3496('0x11')][_0x3496('0x12')])});})['catch'](handleError(_0x5be2c9,null,'killProcess'));};
\ No newline at end of file
index fcbcd14..0929169 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f1e=['index','create','put','/:id','update','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated'];(function(_0x3e3e50,_0x57c114){var _0xca71fd=function(_0x44cf8a){while(--_0x44cf8a){_0x3e3e50['push'](_0x3e3e50['shift']());}};_0xca71fd(++_0x57c114);}(_0x6f1e,0x78));var _0xe6f1=function(_0x2ae5ce,_0x2cca31){_0x2ae5ce=_0x2ae5ce-0x0;var _0x596eea=_0x6f1e[_0x2ae5ce];return _0x596eea;};'use strict';var multer=require(_0xe6f1('0x0'));var util=require(_0xe6f1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe6f1('0x2'));var interaction=require(_0xe6f1('0x3'));var config=require(_0xe6f1('0x4'));var controller=require(_0xe6f1('0x5'));router[_0xe6f1('0x6')]('/',auth[_0xe6f1('0x7')](),controller[_0xe6f1('0x8')]);router[_0xe6f1('0x6')]('/:id',auth[_0xe6f1('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe6f1('0x9')]);router[_0xe6f1('0xa')](_0xe6f1('0xb'),auth[_0xe6f1('0x7')](),controller[_0xe6f1('0xc')]);router[_0xe6f1('0xd')](_0xe6f1('0xb'),auth[_0xe6f1('0x7')](),controller[_0xe6f1('0xe')]);module[_0xe6f1('0xf')]=router;
\ No newline at end of file
+var _0xdab3=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','update','destroy'];(function(_0x2a094f,_0x1ae3b0){var _0x5b6eb7=function(_0x34a007){while(--_0x34a007){_0x2a094f['push'](_0x2a094f['shift']());}};_0x5b6eb7(++_0x1ae3b0);}(_0xdab3,0xeb));var _0x3dab=function(_0x250321,_0x13dde0){_0x250321=_0x250321-0x0;var _0x20b910=_0xdab3[_0x250321];return _0x20b910;};'use strict';var multer=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var path=require('path');var timeout=require(_0x3dab('0x2'));var express=require(_0x3dab('0x3'));var router=express[_0x3dab('0x4')]();var fs_extra=require(_0x3dab('0x5'));var auth=require(_0x3dab('0x6'));var interaction=require(_0x3dab('0x7'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x3dab('0x8')]('/',auth[_0x3dab('0x9')](),controller[_0x3dab('0xa')]);router[_0x3dab('0x8')](_0x3dab('0xb'),auth[_0x3dab('0x9')](),controller['show']);router[_0x3dab('0xc')]('/',auth[_0x3dab('0x9')](),controller[_0x3dab('0xd')]);router[_0x3dab('0xe')](_0x3dab('0xb'),auth[_0x3dab('0x9')](),controller[_0x3dab('0xf')]);router['delete'](_0x3dab('0xb'),auth[_0x3dab('0x9')](),controller[_0x3dab('0x10')]);module[_0x3dab('0x11')]=router;
\ No newline at end of file
index a82f18f..a5469a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eba=['exports','STRING','name','sequelize'];(function(_0x2cc5df,_0x58f849){var _0x4bf59a=function(_0x39989c){while(--_0x39989c){_0x2cc5df['push'](_0x2cc5df['shift']());}};_0x4bf59a(++_0x58f849);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x1eba[_0x1b3564];return _0x504069;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa1eb('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x30d6=['#0091EA','STRING','sequelize','exports','name'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x30d6,0x1b0));var _0x630d=function(_0x5cc9ae,_0x116739){_0x5cc9ae=_0x5cc9ae-0x0;var _0xef9aa1=_0x30d6[_0x5cc9ae];return _0xef9aa1;};'use strict';var Sequelize=require(_0x630d('0x0'));module[_0x630d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x630d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x630d('0x3')},'description':{'type':Sequelize[_0x630d('0x4')]}};
\ No newline at end of file
index eee7c5c..306d23c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07c3=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','then','destroy','get','Tags','error','stack','name','send','map','Tag','rawAttributes','fieldName','type'];(function(_0x1d53e2,_0x2a9c50){var _0x38d629=function(_0x198ef5){while(--_0x198ef5){_0x1d53e2['push'](_0x1d53e2['shift']());}};_0x38d629(++_0x2a9c50);}(_0x07c3,0x1bf));var _0x307c=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0x07c3[_0x18f152];return _0xa10b34;};'use strict';var emlformat=require(_0x307c('0x0'));var rimraf=require(_0x307c('0x1'));var zipdir=require(_0x307c('0x2'));var jsonpatch=require(_0x307c('0x3'));var rp=require(_0x307c('0x4'));var moment=require(_0x307c('0x5'));var BPromise=require(_0x307c('0x6'));var Mustache=require(_0x307c('0x7'));var util=require('util');var path=require(_0x307c('0x8'));var sox=require(_0x307c('0x9'));var csv=require(_0x307c('0xa'));var ejs=require(_0x307c('0xb'));var fs=require('fs');var fs_extra=require(_0x307c('0xc'));var _=require(_0x307c('0xd'));var squel=require(_0x307c('0xe'));var crypto=require(_0x307c('0xf'));var jsforce=require(_0x307c('0x10'));var deskjs=require(_0x307c('0x11'));var toCsv=require(_0x307c('0xa'));var querystring=require(_0x307c('0x12'));var Papa=require(_0x307c('0x13'));var Redis=require(_0x307c('0x14'));var authService=require(_0x307c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x307c('0x16'));var hardwareService=require(_0x307c('0x17'));var logger=require(_0x307c('0x18'))(_0x307c('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x307c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c21fb,_0x1a00ec){_0x1a00ec=_0x1a00ec||0xcc;return function(_0x4d2559){if(_0x4d2559){return _0x3c21fb[_0x307c('0x1b')](_0x1a00ec);}return _0x3c21fb[_0x307c('0x1c')](_0x1a00ec)[_0x307c('0x1d')]();};}function respondWithResult(_0x45ef78,_0x4193d8){_0x4193d8=_0x4193d8||0xc8;return function(_0x2ea8c3){if(_0x2ea8c3){return _0x45ef78[_0x307c('0x1c')](_0x4193d8)[_0x307c('0x1e')](_0x2ea8c3);}};}function respondWithFilteredResult(_0x65678e,_0x38f028){return function(_0x405273){if(_0x405273){var _0x424a74=typeof _0x38f028['offset']===_0x307c('0x1f')&&typeof _0x38f028[_0x307c('0x20')]===_0x307c('0x1f');var _0x2f44ce=_0x405273[_0x307c('0x21')];var _0x2e21a6=_0x424a74?0x0:_0x38f028[_0x307c('0x22')];var _0x13f03b=_0x424a74?_0x405273[_0x307c('0x21')]:_0x38f028['offset']+_0x38f028['limit'];var _0x3bbb1e;if(_0x13f03b>=_0x2f44ce){_0x13f03b=_0x2f44ce;_0x3bbb1e=0xc8;}else{_0x3bbb1e=0xce;}_0x65678e['status'](_0x3bbb1e);return _0x65678e[_0x307c('0x23')]('Content-Range',_0x2e21a6+'-'+_0x13f03b+'/'+_0x2f44ce)['json'](_0x405273);}return null;};}function patchUpdates(_0x4bcc1a){return function(_0x25a503){try{jsonpatch['apply'](_0x25a503,_0x4bcc1a,!![]);}catch(_0x2b07da){return BPromise[_0x307c('0x24')](_0x2b07da);}return _0x25a503['save']();};}function saveUpdates(_0x1cdc48,_0x45fe2){return function(_0x574622){if(_0x574622){return _0x574622[_0x307c('0x25')](_0x1cdc48)[_0x307c('0x26')](function(_0x9a66a0){return _0x9a66a0;});}return null;};}function removeEntity(_0x519985,_0x36802c){return function(_0x2b5f2f){if(_0x2b5f2f){return _0x2b5f2f[_0x307c('0x27')]()[_0x307c('0x26')](function(){var _0xa278fc=_0x2b5f2f[_0x307c('0x28')]({'plain':!![]});var _0x5da864=_0x307c('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x5da864,'resourceId':_0xa278fc['id']}})[_0x307c('0x26')](function(){return _0x2b5f2f;});})[_0x307c('0x26')](function(){_0x519985[_0x307c('0x1c')](0xcc)[_0x307c('0x1d')]();});}};}function handleEntityNotFound(_0x25dede,_0x1591d1){return function(_0x4fd125){if(!_0x4fd125){_0x25dede[_0x307c('0x1b')](0x194);}return _0x4fd125;};}function handleError(_0x181fa2,_0x2ebab3){_0x2ebab3=_0x2ebab3||0x1f4;return function(_0x54da33){logger[_0x307c('0x2a')](_0x54da33[_0x307c('0x2b')]);if(_0x54da33[_0x307c('0x2c')]){delete _0x54da33[_0x307c('0x2c')];}_0x181fa2[_0x307c('0x1c')](_0x2ebab3)[_0x307c('0x2d')](_0x54da33);};}exports['index']=function(_0x1203f6,_0x1e448e){var _0x27dba3={},_0x313fcf={},_0x912246={'count':0x0,'rows':[]};var _0x80a20c=_[_0x307c('0x2e')](db[_0x307c('0x2f')][_0x307c('0x30')],function(_0x55f4c0){return{'name':_0x55f4c0[_0x307c('0x31')],'type':_0x55f4c0[_0x307c('0x32')][_0x307c('0x33')]};});_0x313fcf[_0x307c('0x34')]=_[_0x307c('0x2e')](_0x80a20c,_0x307c('0x2c'));_0x313fcf[_0x307c('0x35')]=_[_0x307c('0x36')](_0x1203f6[_0x307c('0x35')]);_0x313fcf[_0x307c('0x37')]=_[_0x307c('0x38')](_0x313fcf['model'],_0x313fcf[_0x307c('0x35')]);_0x27dba3[_0x307c('0x39')]=_['intersection'](_0x313fcf[_0x307c('0x34')],qs[_0x307c('0x3a')](_0x1203f6['query'][_0x307c('0x3a')]));_0x27dba3['attributes']=_0x27dba3[_0x307c('0x39')][_0x307c('0x3b')]?_0x27dba3[_0x307c('0x39')]:_0x313fcf[_0x307c('0x34')];if(!_0x1203f6[_0x307c('0x35')][_0x307c('0x3c')](_0x307c('0x3d'))){_0x27dba3['limit']=qs[_0x307c('0x20')](_0x1203f6[_0x307c('0x35')][_0x307c('0x20')]);_0x27dba3[_0x307c('0x22')]=qs[_0x307c('0x22')](_0x1203f6[_0x307c('0x35')][_0x307c('0x22')]);}_0x27dba3['order']=qs['sort'](_0x1203f6['query'][_0x307c('0x3e')]);_0x27dba3[_0x307c('0x3f')]=qs[_0x307c('0x37')](_['pick'](_0x1203f6[_0x307c('0x35')],_0x313fcf['filters']),_0x80a20c);if(_0x1203f6[_0x307c('0x35')][_0x307c('0x40')]){_0x27dba3[_0x307c('0x3f')]=_[_0x307c('0x41')](_0x27dba3[_0x307c('0x3f')],{'$or':_[_0x307c('0x2e')](_0x80a20c,function(_0x34fea9){if(_0x34fea9[_0x307c('0x32')]!=='VIRTUAL'){var _0x2d7544={};_0x2d7544[_0x34fea9['name']]={'$like':'%'+_0x1203f6[_0x307c('0x35')]['filter']+'%'};return _0x2d7544;}})});}_0x27dba3=_[_0x307c('0x41')]({},_0x27dba3,_0x1203f6[_0x307c('0x42')]);var _0x25f65e={'where':_0x27dba3[_0x307c('0x3f')]};return db[_0x307c('0x2f')][_0x307c('0x21')](_0x25f65e)[_0x307c('0x26')](function(_0x45cc33){_0x912246[_0x307c('0x21')]=_0x45cc33;if(_0x1203f6[_0x307c('0x35')][_0x307c('0x43')]){_0x27dba3[_0x307c('0x44')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x27dba3);})[_0x307c('0x26')](function(_0x264aa8){_0x912246[_0x307c('0x45')]=_0x264aa8;return _0x912246;})[_0x307c('0x26')](respondWithFilteredResult(_0x1e448e,_0x27dba3))[_0x307c('0x46')](handleError(_0x1e448e,null));};exports[_0x307c('0x47')]=function(_0x4a7f36,_0x492f8d){var _0x104aa4={'raw':!![],'where':{'id':_0x4a7f36[_0x307c('0x48')]['id']}},_0x5d7d0d={};_0x5d7d0d[_0x307c('0x34')]=_[_0x307c('0x36')](db['Tag'][_0x307c('0x30')]);_0x5d7d0d[_0x307c('0x35')]=_[_0x307c('0x36')](_0x4a7f36[_0x307c('0x35')]);_0x5d7d0d[_0x307c('0x37')]=_['intersection'](_0x5d7d0d[_0x307c('0x34')],_0x5d7d0d[_0x307c('0x35')]);_0x104aa4['attributes']=_[_0x307c('0x38')](_0x5d7d0d[_0x307c('0x34')],qs[_0x307c('0x3a')](_0x4a7f36[_0x307c('0x35')][_0x307c('0x3a')]));_0x104aa4[_0x307c('0x39')]=_0x104aa4[_0x307c('0x39')]['length']?_0x104aa4[_0x307c('0x39')]:_0x5d7d0d[_0x307c('0x34')];if(_0x4a7f36[_0x307c('0x35')]['includeAll']){_0x104aa4[_0x307c('0x44')]=[{'all':!![]}];}_0x104aa4=_[_0x307c('0x41')]({},_0x104aa4,_0x4a7f36[_0x307c('0x42')]);return db[_0x307c('0x2f')]['find'](_0x104aa4)[_0x307c('0x26')](handleEntityNotFound(_0x492f8d,null))['then'](respondWithResult(_0x492f8d,null))['catch'](handleError(_0x492f8d,null));};exports['create']=function(_0x26081b,_0x9820dc){return db[_0x307c('0x2f')][_0x307c('0x49')](_0x26081b['body'],{})[_0x307c('0x26')](function(_0x42263f){var _0x398ef5=_0x26081b[_0x307c('0x4a')][_0x307c('0x28')]({'plain':!![]});if(!_0x398ef5)throw new Error(_0x307c('0x4b'));if(_0x398ef5[_0x307c('0x4c')]==='user'){var _0x50876a=_0x42263f[_0x307c('0x28')]({'plain':!![]});var _0x424a92=_0x307c('0x29');return db[_0x307c('0x4d')][_0x307c('0x4e')]({'where':{'name':_0x424a92,'userProfileId':_0x398ef5[_0x307c('0x4f')]},'raw':!![]})[_0x307c('0x26')](function(_0x58e3ff){if(_0x58e3ff&&_0x58e3ff['autoAssociation']===0x0){return db[_0x307c('0x50')][_0x307c('0x49')]({'name':_0x50876a[_0x307c('0x2c')],'resourceId':_0x50876a['id'],'type':_0x58e3ff[_0x307c('0x2c')],'sectionId':_0x58e3ff['id']},{})[_0x307c('0x26')](function(){return _0x42263f;});}else{return _0x42263f;}})['catch'](function(_0x4792a7){logger['error'](_0x307c('0x51'),_0x4792a7);throw _0x4792a7;});}return _0x42263f;})[_0x307c('0x26')](respondWithResult(_0x9820dc,0xc9))['catch'](handleError(_0x9820dc,null));};exports[_0x307c('0x25')]=function(_0x1ce41a,_0x68b3ba){if(_0x1ce41a['body']['id']){delete _0x1ce41a['body']['id'];}return db['Tag'][_0x307c('0x4e')]({'where':{'id':_0x1ce41a[_0x307c('0x48')]['id']}})['then'](handleEntityNotFound(_0x68b3ba,null))['then'](saveUpdates(_0x1ce41a[_0x307c('0x52')],null))[_0x307c('0x26')](respondWithResult(_0x68b3ba,null))['catch'](handleError(_0x68b3ba,null));};exports[_0x307c('0x27')]=function(_0x383260,_0xd27876){return db[_0x307c('0x2f')]['find']({'where':{'id':_0x383260[_0x307c('0x48')]['id']}})[_0x307c('0x26')](handleEntityNotFound(_0xd27876,null))[_0x307c('0x26')](removeEntity(_0xd27876,null))[_0x307c('0x46')](handleError(_0xd27876,null));};
\ No newline at end of file
+var _0x7980=['Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','user'];(function(_0x501d21,_0x4fa765){var _0x4a6c6c=function(_0x4ed884){while(--_0x4ed884){_0x501d21['push'](_0x501d21['shift']());}};_0x4a6c6c(++_0x4fa765);}(_0x7980,0xab));var _0x0798=function(_0x4e7b3d,_0x3350f2){_0x4e7b3d=_0x4e7b3d-0x0;var _0x2cee62=_0x7980[_0x4e7b3d];return _0x2cee62;};'use strict';var emlformat=require(_0x0798('0x0'));var rimraf=require(_0x0798('0x1'));var zipdir=require(_0x0798('0x2'));var jsonpatch=require(_0x0798('0x3'));var rp=require(_0x0798('0x4'));var moment=require('moment');var BPromise=require(_0x0798('0x5'));var Mustache=require(_0x0798('0x6'));var util=require(_0x0798('0x7'));var path=require(_0x0798('0x8'));var sox=require(_0x0798('0x9'));var csv=require('to-csv');var ejs=require(_0x0798('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0798('0xb'));var squel=require(_0x0798('0xc'));var crypto=require(_0x0798('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0798('0xe'));var querystring=require(_0x0798('0xf'));var Papa=require(_0x0798('0x10'));var Redis=require(_0x0798('0x11'));var authService=require(_0x0798('0x12'));var qs=require(_0x0798('0x13'));var as=require(_0x0798('0x14'));var hardwareService=require(_0x0798('0x15'));var logger=require(_0x0798('0x16'))(_0x0798('0x17'));var utils=require('../../config/utils');var config=require(_0x0798('0x18'));var licenseUtil=require(_0x0798('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5323e5,_0x588f9d){_0x588f9d=_0x588f9d||0xcc;return function(_0x376a60){if(_0x376a60){return _0x5323e5[_0x0798('0x1a')](_0x588f9d);}return _0x5323e5[_0x0798('0x1b')](_0x588f9d)[_0x0798('0x1c')]();};}function respondWithResult(_0x39bacd,_0xfd88af){_0xfd88af=_0xfd88af||0xc8;return function(_0x5f1640){if(_0x5f1640){return _0x39bacd['status'](_0xfd88af)[_0x0798('0x1d')](_0x5f1640);}};}function respondWithFilteredResult(_0x112362,_0x47be56){return function(_0x555c45){if(_0x555c45){var _0x21c30b=typeof _0x47be56[_0x0798('0x1e')]===_0x0798('0x1f')&&typeof _0x47be56['limit']==='undefined';var _0x1c6d6f=_0x555c45['count'];var _0x41e217=_0x21c30b?0x0:_0x47be56[_0x0798('0x1e')];var _0x288f41=_0x21c30b?_0x555c45[_0x0798('0x20')]:_0x47be56['offset']+_0x47be56[_0x0798('0x21')];var _0x3039d6;if(_0x288f41>=_0x1c6d6f){_0x288f41=_0x1c6d6f;_0x3039d6=0xc8;}else{_0x3039d6=0xce;}_0x112362['status'](_0x3039d6);return _0x112362[_0x0798('0x22')](_0x0798('0x23'),_0x41e217+'-'+_0x288f41+'/'+_0x1c6d6f)[_0x0798('0x1d')](_0x555c45);}return null;};}function patchUpdates(_0x44ac33){return function(_0xfbb4a5){try{jsonpatch[_0x0798('0x24')](_0xfbb4a5,_0x44ac33,!![]);}catch(_0x3a7f8b){return BPromise[_0x0798('0x25')](_0x3a7f8b);}return _0xfbb4a5[_0x0798('0x26')]();};}function saveUpdates(_0x4a86d5,_0x2aaabf){return function(_0x35c141){if(_0x35c141){return _0x35c141[_0x0798('0x27')](_0x4a86d5)[_0x0798('0x28')](function(_0x20654b){return _0x20654b;});}return null;};}function removeEntity(_0x23f283,_0x52037c){return function(_0x3f66e2){if(_0x3f66e2){return _0x3f66e2[_0x0798('0x29')]()[_0x0798('0x28')](function(){var _0xd5e027=_0x3f66e2[_0x0798('0x2a')]({'plain':!![]});var _0x23d59c='Tags';return db[_0x0798('0x2b')][_0x0798('0x29')]({'where':{'type':_0x23d59c,'resourceId':_0xd5e027['id']}})[_0x0798('0x28')](function(){return _0x3f66e2;});})['then'](function(){_0x23f283[_0x0798('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53a3d7,_0x406030){return function(_0x2dfbff){if(!_0x2dfbff){_0x53a3d7[_0x0798('0x1a')](0x194);}return _0x2dfbff;};}function handleError(_0xaa949b,_0x11b7f4){_0x11b7f4=_0x11b7f4||0x1f4;return function(_0x161244){logger[_0x0798('0x2c')](_0x161244[_0x0798('0x2d')]);if(_0x161244['name']){delete _0x161244[_0x0798('0x2e')];}_0xaa949b['status'](_0x11b7f4)['send'](_0x161244);};}exports[_0x0798('0x2f')]=function(_0x4a7eeb,_0x1dabd5){var _0x4a5fb1={},_0x93c004={},_0xb8d33e={'count':0x0,'rows':[]};var _0x201e4c=_[_0x0798('0x30')](db[_0x0798('0x31')][_0x0798('0x32')],function(_0xa1376e){return{'name':_0xa1376e[_0x0798('0x33')],'type':_0xa1376e[_0x0798('0x34')][_0x0798('0x35')]};});_0x93c004[_0x0798('0x36')]=_[_0x0798('0x30')](_0x201e4c,'name');_0x93c004[_0x0798('0x37')]=_['keys'](_0x4a7eeb['query']);_0x93c004[_0x0798('0x38')]=_[_0x0798('0x39')](_0x93c004['model'],_0x93c004['query']);_0x4a5fb1[_0x0798('0x3a')]=_[_0x0798('0x39')](_0x93c004[_0x0798('0x36')],qs[_0x0798('0x3b')](_0x4a7eeb[_0x0798('0x37')][_0x0798('0x3b')]));_0x4a5fb1['attributes']=_0x4a5fb1['attributes'][_0x0798('0x3c')]?_0x4a5fb1[_0x0798('0x3a')]:_0x93c004[_0x0798('0x36')];if(!_0x4a7eeb['query']['hasOwnProperty']('nolimit')){_0x4a5fb1[_0x0798('0x21')]=qs[_0x0798('0x21')](_0x4a7eeb[_0x0798('0x37')][_0x0798('0x21')]);_0x4a5fb1[_0x0798('0x1e')]=qs[_0x0798('0x1e')](_0x4a7eeb[_0x0798('0x37')][_0x0798('0x1e')]);}_0x4a5fb1['order']=qs[_0x0798('0x3d')](_0x4a7eeb['query'][_0x0798('0x3d')]);_0x4a5fb1[_0x0798('0x3e')]=qs[_0x0798('0x38')](_['pick'](_0x4a7eeb[_0x0798('0x37')],_0x93c004['filters']),_0x201e4c);if(_0x4a7eeb[_0x0798('0x37')][_0x0798('0x3f')]){_0x4a5fb1[_0x0798('0x3e')]=_['merge'](_0x4a5fb1[_0x0798('0x3e')],{'$or':_[_0x0798('0x30')](_0x201e4c,function(_0x4edb16){if(_0x4edb16[_0x0798('0x34')]!=='VIRTUAL'){var _0x4e9d94={};_0x4e9d94[_0x4edb16[_0x0798('0x2e')]]={'$like':'%'+_0x4a7eeb[_0x0798('0x37')]['filter']+'%'};return _0x4e9d94;}})});}_0x4a5fb1=_['merge']({},_0x4a5fb1,_0x4a7eeb[_0x0798('0x40')]);var _0x331218={'where':_0x4a5fb1[_0x0798('0x3e')]};return db[_0x0798('0x31')][_0x0798('0x20')](_0x331218)[_0x0798('0x28')](function(_0x27a671){_0xb8d33e['count']=_0x27a671;if(_0x4a7eeb[_0x0798('0x37')][_0x0798('0x41')]){_0x4a5fb1[_0x0798('0x42')]=[{'all':!![]}];}return db[_0x0798('0x31')][_0x0798('0x43')](_0x4a5fb1);})[_0x0798('0x28')](function(_0x4c2d8a){_0xb8d33e[_0x0798('0x44')]=_0x4c2d8a;return _0xb8d33e;})[_0x0798('0x28')](respondWithFilteredResult(_0x1dabd5,_0x4a5fb1))[_0x0798('0x45')](handleError(_0x1dabd5,null));};exports[_0x0798('0x46')]=function(_0x387450,_0xecc618){var _0x3be652={'raw':!![],'where':{'id':_0x387450[_0x0798('0x47')]['id']}},_0x10a50a={};_0x10a50a[_0x0798('0x36')]=_[_0x0798('0x48')](db[_0x0798('0x31')]['rawAttributes']);_0x10a50a[_0x0798('0x37')]=_[_0x0798('0x48')](_0x387450[_0x0798('0x37')]);_0x10a50a[_0x0798('0x38')]=_['intersection'](_0x10a50a['model'],_0x10a50a[_0x0798('0x37')]);_0x3be652[_0x0798('0x3a')]=_[_0x0798('0x39')](_0x10a50a[_0x0798('0x36')],qs['fields'](_0x387450[_0x0798('0x37')]['fields']));_0x3be652['attributes']=_0x3be652[_0x0798('0x3a')][_0x0798('0x3c')]?_0x3be652[_0x0798('0x3a')]:_0x10a50a[_0x0798('0x36')];if(_0x387450[_0x0798('0x37')][_0x0798('0x41')]){_0x3be652[_0x0798('0x42')]=[{'all':!![]}];}_0x3be652=_[_0x0798('0x49')]({},_0x3be652,_0x387450[_0x0798('0x40')]);return db['Tag'][_0x0798('0x4a')](_0x3be652)['then'](handleEntityNotFound(_0xecc618,null))[_0x0798('0x28')](respondWithResult(_0xecc618,null))[_0x0798('0x45')](handleError(_0xecc618,null));};exports[_0x0798('0x4b')]=function(_0x54634d,_0x9dea1f){return db[_0x0798('0x31')][_0x0798('0x4b')](_0x54634d[_0x0798('0x4c')],{})['then'](function(_0x2695d5){var _0x9e6db6=_0x54634d[_0x0798('0x4d')][_0x0798('0x2a')]({'plain':!![]});if(!_0x9e6db6)throw new Error(_0x0798('0x4e'));if(_0x9e6db6['role']===_0x0798('0x4d')){var _0x3e1c15=_0x2695d5[_0x0798('0x2a')]({'plain':!![]});var _0x10173d=_0x0798('0x4f');return db[_0x0798('0x50')][_0x0798('0x4a')]({'where':{'name':_0x10173d,'userProfileId':_0x9e6db6[_0x0798('0x51')]},'raw':!![]})[_0x0798('0x28')](function(_0x48dc0d){if(_0x48dc0d&&_0x48dc0d['autoAssociation']===0x0){return db[_0x0798('0x2b')][_0x0798('0x4b')]({'name':_0x3e1c15[_0x0798('0x2e')],'resourceId':_0x3e1c15['id'],'type':_0x48dc0d[_0x0798('0x2e')],'sectionId':_0x48dc0d['id']},{})[_0x0798('0x28')](function(){return _0x2695d5;});}else{return _0x2695d5;}})[_0x0798('0x45')](function(_0x3fa571){logger['error'](_0x0798('0x52'),_0x3fa571);throw _0x3fa571;});}return _0x2695d5;})['then'](respondWithResult(_0x9dea1f,0xc9))[_0x0798('0x45')](handleError(_0x9dea1f,null));};exports[_0x0798('0x27')]=function(_0x3a3cc7,_0x48a072){if(_0x3a3cc7['body']['id']){delete _0x3a3cc7['body']['id'];}return db[_0x0798('0x31')]['find']({'where':{'id':_0x3a3cc7['params']['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x48a072,null))[_0x0798('0x28')](saveUpdates(_0x3a3cc7[_0x0798('0x4c')],null))['then'](respondWithResult(_0x48a072,null))[_0x0798('0x45')](handleError(_0x48a072,null));};exports[_0x0798('0x29')]=function(_0x359a4d,_0x743d26){return db['Tag']['find']({'where':{'id':_0x359a4d[_0x0798('0x47')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x743d26,null))[_0x0798('0x28')](removeEntity(_0x743d26,null))['catch'](handleError(_0x743d26,null));};
\ No newline at end of file
index a3b9dce..c5615f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d01=['../../config/environment','./tag.attributes','define','tools_tags','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3249c5,_0x3f0595){var _0x139b0e=function(_0x57ff84){while(--_0x57ff84){_0x3249c5['push'](_0x3249c5['shift']());}};_0x139b0e(++_0x3f0595);}(_0x4d01,0x158));var _0x14d0=function(_0x2fcf18,_0x10009a){_0x2fcf18=_0x2fcf18-0x0;var _0x4c68cc=_0x4d01[_0x2fcf18];return _0x4c68cc;};'use strict';var _=require(_0x14d0('0x0'));var util=require(_0x14d0('0x1'));var logger=require(_0x14d0('0x2'))(_0x14d0('0x3'));var moment=require(_0x14d0('0x4'));var BPromise=require(_0x14d0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x14d0('0x6'));var attributes=require(_0x14d0('0x7'));module['exports']=function(_0xed723c,_0x138e8d){return _0xed723c[_0x14d0('0x8')]('Tag',attributes,{'tableName':_0x14d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ce5=['../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x33a1f2,_0x2b9766){var _0x9e81d4=function(_0x593922){while(--_0x593922){_0x33a1f2['push'](_0x33a1f2['shift']());}};_0x9e81d4(++_0x2b9766);}(_0x4ce5,0x1b2));var _0x54ce=function(_0xa4ff36,_0x3e673c){_0xa4ff36=_0xa4ff36-0x0;var _0x2772fc=_0x4ce5[_0xa4ff36];return _0x2772fc;};'use strict';var _=require(_0x54ce('0x0'));var util=require('util');var logger=require(_0x54ce('0x1'))(_0x54ce('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x54ce('0x3'));var fs=require('fs');var path=require(_0x54ce('0x4'));var rimraf=require(_0x54ce('0x5'));var config=require(_0x54ce('0x6'));var attributes=require(_0x54ce('0x7'));module['exports']=function(_0x4baee7,_0x390e82){return _0x4baee7[_0x54ce('0x8')](_0x54ce('0x9'),attributes,{'tableName':_0x54ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d550f8d..e1bb92a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac95=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','Tag,\x20%s,\x20%s','message','result','catch'];(function(_0x3935c6,_0x39290b){var _0x5649c6=function(_0x3b38c7){while(--_0x3b38c7){_0x3935c6['push'](_0x3935c6['shift']());}};_0x5649c6(++_0x39290b);}(_0xac95,0xa8));var _0x5ac9=function(_0x578a5c,_0x5077cc){_0x578a5c=_0x578a5c-0x0;var _0x303d1c=_0xac95[_0x578a5c];return _0x303d1c;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var moment=require(_0x5ac9('0x2'));var BPromise=require(_0x5ac9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ac9('0x4'))['db'];var utils=require(_0x5ac9('0x5'));var logger=require('../../config/logger')(_0x5ac9('0x6'));var config=require(_0x5ac9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ac9('0x8')][_0x5ac9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8675ec,_0x4bddcf,_0x4dffb8){return new BPromise(function(_0x32afbc,_0x2ab11c){return client[_0x5ac9('0xa')](_0x8675ec,_0x4dffb8)[_0x5ac9('0xb')](function(_0x397bb8){logger[_0x5ac9('0xc')]('Tag,\x20%s,\x20%s',_0x4bddcf,_0x5ac9('0xd'));logger[_0x5ac9('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x4bddcf,_0x5ac9('0xd'),JSON['stringify'](_0x397bb8));if(_0x397bb8[_0x5ac9('0xf')]){if(_0x397bb8['error'][_0x5ac9('0x10')]===0x1f4){logger[_0x5ac9('0xf')](_0x5ac9('0x11'),_0x4bddcf,_0x397bb8[_0x5ac9('0xf')]['message']);return _0x2ab11c(_0x397bb8['error'][_0x5ac9('0x12')]);}logger['error'](_0x5ac9('0x11'),_0x4bddcf,_0x397bb8[_0x5ac9('0xf')]['message']);return _0x32afbc(_0x397bb8[_0x5ac9('0xf')][_0x5ac9('0x12')]);}else{logger[_0x5ac9('0xc')](_0x5ac9('0x11'),_0x4bddcf,_0x5ac9('0xd'));_0x32afbc(_0x397bb8[_0x5ac9('0x13')][_0x5ac9('0x12')]);}})[_0x5ac9('0x14')](function(_0x460fd7){logger['error']('Tag,\x20%s,\x20%s',_0x4bddcf,_0x460fd7);_0x2ab11c(_0x460fd7);});});}
\ No newline at end of file
+var _0x0b78=['request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info'];(function(_0x59f8d8,_0x1f343d){var _0x82aa15=function(_0x5cc0e8){while(--_0x5cc0e8){_0x59f8d8['push'](_0x59f8d8['shift']());}};_0x82aa15(++_0x1f343d);}(_0x0b78,0x1ad));var _0x80b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0b78[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var moment=require('moment');var BPromise=require(_0x80b7('0x2'));var rs=require(_0x80b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x584401,_0x5e19ef,_0x122ebe){return new BPromise(function(_0x3c248d,_0x445c23){return client['request'](_0x584401,_0x122ebe)[_0x80b7('0x9')](function(_0x25a015){logger[_0x80b7('0xa')]('Tag,\x20%s,\x20%s',_0x5e19ef,_0x80b7('0xb'));logger['debug'](_0x80b7('0xc'),_0x5e19ef,_0x80b7('0xb'),JSON[_0x80b7('0xd')](_0x25a015));if(_0x25a015[_0x80b7('0xe')]){if(_0x25a015[_0x80b7('0xe')][_0x80b7('0xf')]===0x1f4){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015[_0x80b7('0xe')][_0x80b7('0x11')]);return _0x445c23(_0x25a015[_0x80b7('0xe')]['message']);}logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015['error'][_0x80b7('0x11')]);return _0x3c248d(_0x25a015[_0x80b7('0xe')]['message']);}else{logger[_0x80b7('0xa')](_0x80b7('0x10'),_0x5e19ef,_0x80b7('0xb'));_0x3c248d(_0x25a015[_0x80b7('0x12')][_0x80b7('0x11')]);}})[_0x80b7('0x13')](function(_0x1e3d1c){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x1e3d1c);_0x445c23(_0x1e3d1c);});});}
\ No newline at end of file
index f8be88c..12768dd 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 16ea0f2..cdeca67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb7e7,0x121));var _0x7b7e=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xb7e7[_0x50007c];return _0x5c1ec7;};'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
+var _0xb7e7=['STRING','sequelize'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xb7e7,0x121));var _0x7b7e=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xb7e7[_0x47a349];return _0x18ab75;};'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 c295adc..b895cce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79d6=['send','index','Team','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','get','role','user','Teams','UserProfileSection','userProfileId','UserProfileResource','update','params','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','SmsQueueId','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','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','online','voicePause','upsert','isNil','interface','format','SIP/%s','TeamVoiceQueue','UserVoicePrefix','all','spread','removeAgents','Fax','UserVoiceQueueRt','VoicePrefixId','getAgents','pick','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus','error','stack','name'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x79d6,0x111));var _0x679d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x79d6[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x679d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x679d('0x1'));var jsonpatch=require(_0x679d('0x2'));var rp=require('request-promise');var moment=require(_0x679d('0x3'));var BPromise=require(_0x679d('0x4'));var Mustache=require(_0x679d('0x5'));var util=require(_0x679d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x679d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x679d('0x8'));var squel=require(_0x679d('0x9'));var crypto=require(_0x679d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x679d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x679d('0xc'));var Papa=require(_0x679d('0xd'));var Redis=require(_0x679d('0xe'));var authService=require(_0x679d('0xf'));var qs=require(_0x679d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x679d('0x11'));var logger=require(_0x679d('0x12'))(_0x679d('0x13'));var utils=require(_0x679d('0x14'));var config=require(_0x679d('0x15'));var licenseUtil=require(_0x679d('0x16'));var db=require(_0x679d('0x17'))['db'];config[_0x679d('0x18')]=_[_0x679d('0x19')](config['redis'],{'host':_0x679d('0x1a'),'port':0x18eb});var socket=require(_0x679d('0x1b'))(new Redis(config[_0x679d('0x18')]));require(_0x679d('0x1c'))[_0x679d('0x1d')](socket);function respondWithStatusCode(_0x41ee6a,_0x5c4000){_0x5c4000=_0x5c4000||0xcc;return function(_0x47bd76){if(_0x47bd76){return _0x41ee6a['sendStatus'](_0x5c4000);}return _0x41ee6a[_0x679d('0x1e')](_0x5c4000)['end']();};}function respondWithResult(_0x58e24a,_0x1817e2){_0x1817e2=_0x1817e2||0xc8;return function(_0x984998){if(_0x984998){return _0x58e24a[_0x679d('0x1e')](_0x1817e2)[_0x679d('0x1f')](_0x984998);}};}function respondWithFilteredResult(_0x50c491,_0x4e087e){return function(_0x39f904){if(_0x39f904){var _0x215330=typeof _0x4e087e[_0x679d('0x20')]===_0x679d('0x21')&&typeof _0x4e087e[_0x679d('0x22')]===_0x679d('0x21');var _0x267d8b=_0x39f904[_0x679d('0x23')];var _0x210f2d=_0x215330?0x0:_0x4e087e['offset'];var _0x2265c6=_0x215330?_0x39f904[_0x679d('0x23')]:_0x4e087e['offset']+_0x4e087e[_0x679d('0x22')];var _0x2f7625;if(_0x2265c6>=_0x267d8b){_0x2265c6=_0x267d8b;_0x2f7625=0xc8;}else{_0x2f7625=0xce;}_0x50c491[_0x679d('0x1e')](_0x2f7625);return _0x50c491['set'](_0x679d('0x24'),_0x210f2d+'-'+_0x2265c6+'/'+_0x267d8b)[_0x679d('0x1f')](_0x39f904);}return null;};}function patchUpdates(_0x2e7315){return function(_0x302350){try{jsonpatch[_0x679d('0x25')](_0x302350,_0x2e7315,!![]);}catch(_0x38da31){return BPromise[_0x679d('0x26')](_0x38da31);}return _0x302350[_0x679d('0x27')]();};}function saveUpdates(_0x189ff0,_0x26afec){return function(_0x4dd7a6){if(_0x4dd7a6){return _0x4dd7a6['update'](_0x189ff0)[_0x679d('0x28')](function(_0x2e4082){return _0x2e4082;});}return null;};}function handleEntityNotFound(_0x1fad0b,_0xc4ea95){return function(_0x4c3fc5){if(!_0x4c3fc5){_0x1fad0b[_0x679d('0x29')](0x194);}return _0x4c3fc5;};}function handleError(_0x4e4f66,_0x378e42){_0x378e42=_0x378e42||0x1f4;return function(_0x14cc88){logger[_0x679d('0x2a')](_0x14cc88[_0x679d('0x2b')]);if(_0x14cc88[_0x679d('0x2c')]){delete _0x14cc88[_0x679d('0x2c')];}_0x4e4f66[_0x679d('0x1e')](_0x378e42)[_0x679d('0x2d')](_0x14cc88);};}exports[_0x679d('0x2e')]=function(_0x489397,_0x425372){var _0x3ce05d={},_0x5a1b22={},_0x487fe1={'count':0x0,'rows':[]};var _0x216e68=_['map'](db[_0x679d('0x2f')][_0x679d('0x30')],function(_0x57ad49){return{'name':_0x57ad49[_0x679d('0x31')],'type':_0x57ad49[_0x679d('0x32')][_0x679d('0x33')]};});_0x5a1b22[_0x679d('0x34')]=_[_0x679d('0x35')](_0x216e68,'name');_0x5a1b22[_0x679d('0x36')]=_[_0x679d('0x37')](_0x489397['query']);_0x5a1b22[_0x679d('0x38')]=_['intersection'](_0x5a1b22[_0x679d('0x34')],_0x5a1b22[_0x679d('0x36')]);_0x3ce05d[_0x679d('0x39')]=_[_0x679d('0x3a')](_0x5a1b22[_0x679d('0x34')],qs['fields'](_0x489397[_0x679d('0x36')][_0x679d('0x3b')]));_0x3ce05d[_0x679d('0x39')]=_0x3ce05d[_0x679d('0x39')][_0x679d('0x3c')]?_0x3ce05d[_0x679d('0x39')]:_0x5a1b22[_0x679d('0x34')];if(!_0x489397['query'][_0x679d('0x3d')](_0x679d('0x3e'))){_0x3ce05d[_0x679d('0x22')]=qs['limit'](_0x489397[_0x679d('0x36')][_0x679d('0x22')]);_0x3ce05d['offset']=qs[_0x679d('0x20')](_0x489397['query']['offset']);}_0x3ce05d[_0x679d('0x3f')]=qs[_0x679d('0x40')](_0x489397[_0x679d('0x36')]['sort']);_0x3ce05d['where']=qs[_0x679d('0x38')](_['pick'](_0x489397['query'],_0x5a1b22['filters']),_0x216e68);if(_0x489397[_0x679d('0x36')][_0x679d('0x41')]){_0x3ce05d[_0x679d('0x42')]=_[_0x679d('0x43')](_0x3ce05d['where'],{'$or':_[_0x679d('0x35')](_0x216e68,function(_0x43eddd){if(_0x43eddd[_0x679d('0x32')]!==_0x679d('0x44')){var _0x11f7c7={};_0x11f7c7[_0x43eddd[_0x679d('0x2c')]]={'$like':'%'+_0x489397['query'][_0x679d('0x41')]+'%'};return _0x11f7c7;}})});}_0x3ce05d=_['merge']({},_0x3ce05d,_0x489397[_0x679d('0x45')]);var _0x5832d3={'where':_0x3ce05d['where']};return db['Team']['count'](_0x5832d3)[_0x679d('0x28')](function(_0x369020){_0x487fe1[_0x679d('0x23')]=_0x369020;if(_0x489397[_0x679d('0x36')][_0x679d('0x46')]){_0x3ce05d[_0x679d('0x47')]=[{'all':!![]}];}return db[_0x679d('0x2f')][_0x679d('0x48')](_0x3ce05d);})[_0x679d('0x28')](function(_0x1066d2){_0x487fe1[_0x679d('0x49')]=_0x1066d2;return _0x487fe1;})[_0x679d('0x28')](respondWithFilteredResult(_0x425372,_0x3ce05d))[_0x679d('0x4a')](handleError(_0x425372,null));};exports[_0x679d('0x4b')]=function(_0x36e0a2,_0x1a9c43){var _0x52bae0={'raw':![],'where':{'id':_0x36e0a2['params']['id']}},_0x308717={};_0x308717[_0x679d('0x34')]=_[_0x679d('0x37')](db[_0x679d('0x2f')][_0x679d('0x30')]);_0x308717['query']=_[_0x679d('0x37')](_0x36e0a2[_0x679d('0x36')]);_0x308717[_0x679d('0x38')]=_[_0x679d('0x3a')](_0x308717[_0x679d('0x34')],_0x308717[_0x679d('0x36')]);_0x52bae0[_0x679d('0x39')]=_[_0x679d('0x3a')](_0x308717[_0x679d('0x34')],qs[_0x679d('0x3b')](_0x36e0a2[_0x679d('0x36')]['fields']));_0x52bae0[_0x679d('0x39')]=_0x52bae0[_0x679d('0x39')]['length']?_0x52bae0[_0x679d('0x39')]:_0x308717['model'];if(_0x36e0a2['query'][_0x679d('0x46')]){_0x52bae0[_0x679d('0x47')]=[{'all':!![]}];}_0x52bae0=_['merge']({},_0x52bae0,_0x36e0a2['options']);return db[_0x679d('0x2f')][_0x679d('0x4c')](_0x52bae0)[_0x679d('0x28')](handleEntityNotFound(_0x1a9c43,null))[_0x679d('0x28')](respondWithResult(_0x1a9c43,null))[_0x679d('0x4a')](handleError(_0x1a9c43,null));};exports['create']=function(_0x1fd709,_0x5b02b3){return db[_0x679d('0x2f')][_0x679d('0x4d')](_0x1fd709[_0x679d('0x4e')],{})[_0x679d('0x28')](function(_0x5090ac){var _0x2d400c=_0x1fd709['user'][_0x679d('0x4f')]({'plain':!![]});if(!_0x2d400c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d400c[_0x679d('0x50')]===_0x679d('0x51')){var _0x232cb2=_0x5090ac[_0x679d('0x4f')]({'plain':!![]});var _0xc77a73=_0x679d('0x52');return db[_0x679d('0x53')][_0x679d('0x4c')]({'where':{'name':_0xc77a73,'userProfileId':_0x2d400c[_0x679d('0x54')]},'raw':!![]})['then'](function(_0x577381){if(_0x577381&&_0x577381['autoAssociation']===0x0){return db[_0x679d('0x55')]['create']({'name':_0x232cb2[_0x679d('0x2c')],'resourceId':_0x232cb2['id'],'type':_0x577381[_0x679d('0x2c')],'sectionId':_0x577381['id']},{})[_0x679d('0x28')](function(){return _0x5090ac;});}else{return _0x5090ac;}})[_0x679d('0x4a')](function(_0x205a88){logger[_0x679d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x205a88);throw _0x205a88;});}return _0x5090ac;})[_0x679d('0x28')](respondWithResult(_0x5b02b3,0xc9))['catch'](handleError(_0x5b02b3,null));};exports[_0x679d('0x56')]=function(_0x3c6069,_0x42e470){if(_0x3c6069[_0x679d('0x4e')]['id']){delete _0x3c6069['body']['id'];}return db[_0x679d('0x2f')][_0x679d('0x4c')]({'where':{'id':_0x3c6069[_0x679d('0x57')]['id']}})[_0x679d('0x28')](handleEntityNotFound(_0x42e470,null))[_0x679d('0x28')](saveUpdates(_0x3c6069[_0x679d('0x4e')],null))[_0x679d('0x28')](respondWithResult(_0x42e470,null))[_0x679d('0x4a')](handleError(_0x42e470,null));};exports['destroy']=function(_0x4d62a2,_0x3e954d){var _0x5482c8=_0x4d62a2[_0x679d('0x57')]['id'];var _0x51f974=[];return db[_0x679d('0x58')][_0x679d('0x59')](function(_0x4bde9d){var _0x1eb956=_0x679d('0x5a')+_0x5482c8;return db[_0x679d('0x58')][_0x679d('0x36')](_0x1eb956,{'type':db['Sequelize'][_0x679d('0x5b')][_0x679d('0x5c')],'raw':!![],'transaction':_0x4bde9d})['then'](function(_0xa3de5a){_0x51f974=_[_0x679d('0x35')](_0xa3de5a,function(_0x30cbae){return Number(_0x30cbae[_0x679d('0x5d')]);});})[_0x679d('0x28')](function(){var _0x422ff0=_0x679d('0x5e')+_0x5482c8;return db[_0x679d('0x58')][_0x679d('0x36')](_0x422ff0,{'type':db['Sequelize'][_0x679d('0x5b')][_0x679d('0x5c')],'raw':!![],'transaction':_0x4bde9d});})['then'](function(_0x1b2bf5){var _0x4db8ff=_[_0x679d('0x35')](_0x1b2bf5,function(_0x8c4e59){return Number(_0x8c4e59[_0x679d('0x5f')]);});return db['UserVoiceQueue'][_0x679d('0x60')]({'where':{'UserId':{'$in':_0x51f974},'VoiceQueueId':{'$in':_0x4db8ff}},'transaction':_0x4bde9d});})['then'](function(){var _0x2378b7=_0x679d('0x61')+_0x5482c8;return db[_0x679d('0x58')][_0x679d('0x36')](_0x2378b7,{'type':db['Sequelize']['QueryTypes'][_0x679d('0x5c')],'raw':!![],'transaction':_0x4bde9d});})[_0x679d('0x28')](function(_0x37e8c5){var _0x14f5c2=_[_0x679d('0x35')](_0x37e8c5,function(_0x238993){return Number(_0x238993[_0x679d('0x62')]);});return db[_0x679d('0x63')]['destroy']({'where':{'UserId':{'$in':_0x51f974},'MailQueueId':{'$in':_0x14f5c2}},'transaction':_0x4bde9d});})[_0x679d('0x28')](function(){var _0x1d26a2=_0x679d('0x64')+_0x5482c8;return db[_0x679d('0x58')][_0x679d('0x36')](_0x1d26a2,{'type':db[_0x679d('0x65')][_0x679d('0x5b')][_0x679d('0x5c')],'raw':!![],'transaction':_0x4bde9d});})[_0x679d('0x28')](function(_0x305654){var _0x549014=_['map'](_0x305654,function(_0x3806a4){return Number(_0x3806a4[_0x679d('0x66')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x51f974},'SmsQueueId':{'$in':_0x549014}},'transaction':_0x4bde9d});})[_0x679d('0x28')](function(){var _0x4e2920=_0x679d('0x67')+_0x5482c8;return db[_0x679d('0x58')]['query'](_0x4e2920,{'type':db[_0x679d('0x65')][_0x679d('0x5b')][_0x679d('0x5c')],'raw':!![],'transaction':_0x4bde9d});})['then'](function(_0x32bd59){var _0x56e6e0=_['map'](_0x32bd59,function(_0x1c8926){return Number(_0x1c8926[_0x679d('0x68')]);});return db['UserChatQueue'][_0x679d('0x60')]({'where':{'UserId':{'$in':_0x51f974},'ChatQueueId':{'$in':_0x56e6e0}},'transaction':_0x4bde9d});})[_0x679d('0x28')](function(){var _0x4f6129=_0x679d('0x69')+_0x5482c8;return db[_0x679d('0x58')]['query'](_0x4f6129,{'type':db[_0x679d('0x65')][_0x679d('0x5b')][_0x679d('0x5c')],'raw':!![],'transaction':_0x4bde9d});})[_0x679d('0x28')](function(_0x2a8131){var _0x5870a7=_['map'](_0x2a8131,function(_0xb33330){return Number(_0xb33330[_0x679d('0x6a')]);});return db[_0x679d('0x6b')][_0x679d('0x60')]({'where':{'UserId':{'$in':_0x51f974},'FaxQueueId':{'$in':_0x5870a7}},'transaction':_0x4bde9d});})['then'](function(){var _0x19fea7=_0x679d('0x6c')+_0x5482c8;return db[_0x679d('0x58')]['query'](_0x19fea7,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4bde9d});})[_0x679d('0x28')](function(_0x5f1489){var _0x130712=_[_0x679d('0x35')](_0x5f1489,function(_0x58b890){return Number(_0x58b890[_0x679d('0x6d')]);});return db['UserOpenchannelQueue'][_0x679d('0x60')]({'where':{'UserId':{'$in':_0x51f974},'OpenchannelQueueId':{'$in':_0x130712}},'transaction':_0x4bde9d});})[_0x679d('0x28')](function(){var _0x4eb6c6=_0x679d('0x6e')+_0x5482c8;return db[_0x679d('0x58')][_0x679d('0x36')](_0x4eb6c6,{'type':db['Sequelize'][_0x679d('0x5b')][_0x679d('0x5c')],'raw':!![],'transaction':_0x4bde9d});})[_0x679d('0x28')](function(_0x54e8da){var _0xda453d=_['map'](_0x54e8da,function(_0x87d2d0){return Number(_0x87d2d0[_0x679d('0x6f')]);});return db['UserWhatsappQueue'][_0x679d('0x60')]({'where':{'UserId':{'$in':_0x51f974},'WhatsappQueueId':{'$in':_0xda453d}},'transaction':_0x4bde9d});})[_0x679d('0x28')](function(){return db[_0x679d('0x70')][_0x679d('0x4c')]({'where':{'TeamId':_0x5482c8}});})[_0x679d('0x28')](function(_0x5141dc){if(_0x5141dc===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x51f974},'VoicePrefixId':_0x5141dc['VoicePrefixId']},'transaction':_0x4bde9d});})[_0x679d('0x28')](function(){return db[_0x679d('0x2f')]['destroy']({'where':{'id':_0x5482c8},'cascade':!![],'transaction':_0x4bde9d});})[_0x679d('0x28')](function(_0x3f9c97){if(_0x3f9c97===0x0){_0x3e954d[_0x679d('0x29')](0x194);}else{return db[_0x679d('0x55')][_0x679d('0x60')]({'where':{'type':_0x679d('0x52'),'resourceId':_0x5482c8},'cascade':!![],'transaction':_0x4bde9d})[_0x679d('0x28')](function(){_0x3e954d[_0x679d('0x1e')](0xcc)['end']();});}})['catch'](function(_0xb4321b){_0x3e954d['status'](0x1f4)['send'](_0xb4321b);});});};exports[_0x679d('0x71')]=function(_0x39262b,_0x2602da,_0x91d2ea){return db[_0x679d('0x2f')][_0x679d('0x72')]({'where':{'id':_0x39262b['params']['id']}})[_0x679d('0x28')](handleEntityNotFound(_0x2602da,null))['then'](function(_0x33de9f){if(!_0x39262b[_0x679d('0x36')][_0x679d('0x73')]||!utils[_0x679d('0x74')](_0x39262b[_0x679d('0x36')][_0x679d('0x73')])){throw new db[(_0x679d('0x65'))][(_0x679d('0x75'))](_0x679d('0x76'));}var _0x54ccf4={};var _0x29b560={};_0x29b560[_0x679d('0x34')]=_[_0x679d('0x37')](db[_[_0x679d('0x77')](_0x39262b['query'][_0x679d('0x73')][_0x679d('0x78')]())+_0x679d('0x79')][_0x679d('0x30')]);_0x29b560[_0x679d('0x36')]=_[_0x679d('0x37')](_0x39262b[_0x679d('0x36')]);_0x29b560['filters']=_[_0x679d('0x3a')](_0x29b560[_0x679d('0x34')],_0x29b560[_0x679d('0x36')]);_0x54ccf4[_0x679d('0x39')]=_[_0x679d('0x3a')](_0x29b560[_0x679d('0x34')],qs[_0x679d('0x3b')](_0x39262b[_0x679d('0x36')][_0x679d('0x3b')]));_0x54ccf4[_0x679d('0x39')]=_0x54ccf4['attributes']['length']?_0x54ccf4[_0x679d('0x39')]:_0x29b560[_0x679d('0x34')];_0x54ccf4[_0x679d('0x22')]=qs[_0x679d('0x22')](_0x39262b['query'][_0x679d('0x22')]);_0x54ccf4[_0x679d('0x20')]=qs[_0x679d('0x20')](_0x39262b[_0x679d('0x36')]['offset']);_0x54ccf4[_0x679d('0x3f')]=qs[_0x679d('0x40')](_0x39262b['query'][_0x679d('0x40')]);_0x54ccf4[_0x679d('0x42')]=qs[_0x679d('0x38')](_['pick'](_0x39262b[_0x679d('0x36')],_0x29b560[_0x679d('0x38')]));_0x54ccf4=_[_0x679d('0x43')]({},_0x54ccf4,_0x39262b['options']);return _0x33de9f['get'+_['capitalize'](_0x39262b[_0x679d('0x36')][_0x679d('0x73')]['toLowerCase']())+_0x679d('0x7a')](_0x54ccf4);})[_0x679d('0x28')](respondWithResult(_0x2602da,null))[_0x679d('0x4a')](handleError(_0x2602da,null));};exports[_0x679d('0x7b')]=function(_0x663cf8,_0x8e62fb,_0x300d15){return db[_0x679d('0x2f')]['findOne']({'where':{'id':_0x663cf8[_0x679d('0x57')]['id']}})['then'](function(_0x2e60c8){if(_0x2e60c8){if(!_0x663cf8[_0x679d('0x4e')]['channel']||!utils['isValidChannel'](_0x663cf8[_0x679d('0x4e')][_0x679d('0x73')])){throw new db[(_0x679d('0x65'))]['ValidationError'](_0x679d('0x76'));}return _0x2e60c8[_0x679d('0x7c')+_[_0x679d('0x77')](_0x663cf8[_0x679d('0x4e')]['channel'][_0x679d('0x78')]())+'Queues'](_0x663cf8['body'][_0x679d('0x7d')]);}return null;})[_0x679d('0x28')](handleEntityNotFound(_0x8e62fb,null))['then'](respondWithStatusCode(_0x8e62fb,null))['catch'](handleError(_0x8e62fb,null));};exports['removeQueues']=function(_0x724354,_0x3bb658,_0x1d59f9){return db[_0x679d('0x2f')][_0x679d('0x72')]({'where':{'id':_0x724354[_0x679d('0x57')]['id']}})[_0x679d('0x28')](function(_0xe8c123){if(_0xe8c123){if(!_0x724354[_0x679d('0x36')]['channel']||!utils[_0x679d('0x74')](_0x724354['query'][_0x679d('0x73')])){throw new db['Sequelize'][(_0x679d('0x75'))]('Unknown\x20channel');}return _0xe8c123[_0x679d('0x7e')+_['capitalize'](_0x724354[_0x679d('0x36')][_0x679d('0x73')][_0x679d('0x78')]())+_0x679d('0x7a')](_0x724354[_0x679d('0x36')][_0x679d('0x7d')]);}return null;})[_0x679d('0x28')](handleEntityNotFound(_0x3bb658,null))[_0x679d('0x28')](respondWithStatusCode(_0x3bb658,null))[_0x679d('0x4a')](handleError(_0x3bb658,null));};exports[_0x679d('0x7f')]=function(_0x652916,_0x58a961){var _0xf8ee5f=_[_0x679d('0x80')](_0x652916['body']['ids'])?_0x652916[_0x679d('0x4e')][_0x679d('0x7d')]:[_0x652916['body'][_0x679d('0x7d')]];var _0x5547ad=_0x652916[_0x679d('0x57')]['id'];return db[_0x679d('0x2f')][_0x679d('0x4c')]({'where':{'id':_0x5547ad}})[_0x679d('0x28')](handleEntityNotFound(_0x58a961,null))[_0x679d('0x28')](function(_0x233ceb){if(_0x233ceb){var _0x381c42=[_0x679d('0x81'),_0x679d('0x82'),_0x679d('0x83'),_0x679d('0x84'),'Fax',_0x679d('0x85'),_0x679d('0x86')];return db[_0x679d('0x58')][_0x679d('0x59')](function(_0x46b22f){var _0x546584=_[_0x679d('0x35')](_0x381c42,function(_0x537dd9){var _0x1f483e={'attributes':['id','name']};if(_0x537dd9==='Voice'){_0x1f483e[_0x679d('0x87')]={'attributes':[_0x679d('0x88')]};}return _0x233ceb[_0x679d('0x4f')+_0x537dd9+_0x679d('0x7a')](_0x1f483e)[_0x679d('0x28')](function(_0x201203){var _0x5b6911=_[_0x679d('0x35')](_0x201203,function(_0x41a34e){var _0x1dd5e3=_[_0x679d('0x35')](_0xf8ee5f,function(_0x18cf10){var _0x5aab7b={'where':{'UserId':_0x18cf10,[_0x537dd9+_0x679d('0x89')]:_0x41a34e['id']},'transaction':_0x46b22f};if(_0x537dd9==='Voice'){_0x5aab7b[_0x679d('0x19')]={'penalty':_0x41a34e['TeamVoiceQueue'][_0x679d('0x88')]};}return db[_0x679d('0x8a')+_0x537dd9+_0x679d('0x79')][_0x679d('0x8b')](_0x5aab7b)['then'](function(){socket[_0x679d('0x8c')](_0x679d('0x51')+_0x537dd9+_0x679d('0x8d'),{'UserId':_0x18cf10,[_0x537dd9+'QueueId']:_0x41a34e['id']});if(_0x537dd9!=='Voice'){return;}return db[_0x679d('0x8a')][_0x679d('0x48')]({'where':{'id':_0xf8ee5f,'online':0x1},'attributes':['id',_0x679d('0x2c'),_0x679d('0x8e'),_0x679d('0x8f'),'interface'],'raw':!![]})[_0x679d('0x28')](function(_0x47f1b7){var _0x3ac040=_[_0x679d('0x35')](_0x47f1b7,function(_0x2a1f62){return db['UserVoiceQueueRt'][_0x679d('0x90')]({'membername':_0x2a1f62[_0x679d('0x2c')],'UserId':_0x2a1f62['id'],'queue_name':_0x41a34e['name'],'VoiceQueueId':_0x41a34e['id'],'interface':_[_0x679d('0x91')](_0x2a1f62[_0x679d('0x92')])?util[_0x679d('0x93')](_0x679d('0x94'),_0x2a1f62[_0x679d('0x2c')]):_0x2a1f62['interface'],'paused':_0x2a1f62[_0x679d('0x8f')]||![],'penalty':_0x41a34e[_0x679d('0x95')][_0x679d('0x88')]},{'transaction':_0x46b22f});});return Promise['all'](_0x3ac040);});});});return Promise['all'](_0x1dd5e3);});return Promise['all'](_0x5b6911);})[_0x679d('0x28')](function(){return db['TeamVoicePrefix'][_0x679d('0x72')]({'where':{'teamId':_0x5547ad}})[_0x679d('0x28')](function(_0x2503b4){if(_0x2503b4){var _0x275877=_[_0x679d('0x35')](_0xf8ee5f,function(_0x4a9341){db[_0x679d('0x96')][_0x679d('0x90')]({'UserId':_0x4a9341,'VoicePrefixId':_0x2503b4['VoicePrefixId']});});return Promise[_0x679d('0x97')](_0x275877);}});});});return Promise[_0x679d('0x97')](_0x546584)[_0x679d('0x28')](function(){return _0x233ceb[_0x679d('0x7f')](_0xf8ee5f,{'transaction':_0x46b22f})[_0x679d('0x98')](function(_0x1d120c){return _0x1d120c;});});});}})[_0x679d('0x28')](respondWithResult(_0x58a961,null))['catch'](handleError(_0x58a961,null));};exports[_0x679d('0x99')]=function(_0x411622,_0x4048a0){var _0x3df28a=_['isArray'](_0x411622[_0x679d('0x36')]['ids'])?_0x411622[_0x679d('0x36')][_0x679d('0x7d')]:[_0x411622[_0x679d('0x36')]['ids']];var _0x5eac85=_0x411622[_0x679d('0x57')]['id'];return db[_0x679d('0x2f')][_0x679d('0x4c')]({'where':{'id':_0x5eac85}})[_0x679d('0x28')](handleEntityNotFound(_0x4048a0,null))[_0x679d('0x28')](function(_0x58193e){if(_0x58193e){var _0x2818f5=['Voice',_0x679d('0x82'),_0x679d('0x83'),'Sms',_0x679d('0x9a'),_0x679d('0x85'),_0x679d('0x86')];return db['sequelize']['transaction'](function(_0x7809b9){var _0x378725=_['map'](_0x2818f5,function(_0x3e0157){var _0xc8aee7={'attributes':['id','name']};return _0x58193e[_0x679d('0x4f')+_0x3e0157+_0x679d('0x7a')](_0xc8aee7)[_0x679d('0x28')](function(_0x5dc27a){var _0x766c19=_[_0x679d('0x35')](_0x5dc27a,function(_0x256932){return _0x256932['removeAgents'](_0x3df28a,{'transaction':_0x7809b9})[_0x679d('0x28')](function(){var _0x40ad75=_['map'](_0x3df28a,function(_0x23867e){socket[_0x679d('0x8c')](_0x679d('0x51')+_0x3e0157+'Queue:remove',{'UserId':Number(_0x23867e),[_0x3e0157+_0x679d('0x89')]:_0x256932['id']});if(_0x3e0157!==_0x679d('0x81')){return;}return db[_0x679d('0x9b')][_0x679d('0x60')]({'where':{'VoiceQueueId':_0x256932['id'],'UserId':_0x23867e},'transaction':_0x7809b9});});return Promise[_0x679d('0x97')](_0x40ad75);});});return Promise['all'](_0x766c19);});});return Promise[_0x679d('0x97')](_0x378725)[_0x679d('0x28')](function(){return _0x58193e['removeAgents'](_0x3df28a,{'transaction':_0x7809b9});})[_0x679d('0x28')](function(){return db[_0x679d('0x70')][_0x679d('0x72')]({'where':{'teamId':_0x5eac85}})[_0x679d('0x28')](function(_0x44f83e){if(_0x44f83e){var _0x3b8e6e=_['map'](_0x3df28a,function(_0x51eb22){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x51eb22,'VoicePrefixId':_0x44f83e[_0x679d('0x9c')]}});});return Promise[_0x679d('0x97')](_0x3b8e6e);}});});});}})[_0x679d('0x28')](respondWithStatusCode(_0x4048a0,null))[_0x679d('0x4a')](handleError(_0x4048a0,null));};exports[_0x679d('0x9d')]=function(_0x4ac595,_0x1bdbfd,_0x26ca6e){var _0x43b6b1={};var _0x388029={};var _0x18724c;var _0x50e53c;return db[_0x679d('0x2f')][_0x679d('0x72')]({'where':{'id':_0x4ac595[_0x679d('0x57')]['id']}})['then'](handleEntityNotFound(_0x1bdbfd,null))[_0x679d('0x28')](function(_0x522bf6){if(_0x522bf6){_0x18724c=_0x522bf6;_0x388029[_0x679d('0x34')]=_[_0x679d('0x37')](db[_0x679d('0x8a')][_0x679d('0x30')]);_0x388029['query']=_[_0x679d('0x37')](_0x4ac595[_0x679d('0x36')]);_0x388029[_0x679d('0x38')]=_[_0x679d('0x3a')](_0x388029[_0x679d('0x34')],_0x388029[_0x679d('0x36')]);_0x43b6b1[_0x679d('0x39')]=_[_0x679d('0x3a')](_0x388029[_0x679d('0x34')],qs['fields'](_0x4ac595['query'][_0x679d('0x3b')]));_0x43b6b1[_0x679d('0x39')]=_0x43b6b1['attributes'][_0x679d('0x3c')]?_0x43b6b1[_0x679d('0x39')]:_0x388029[_0x679d('0x34')];_0x43b6b1[_0x679d('0x3f')]=qs[_0x679d('0x40')](_0x4ac595[_0x679d('0x36')]['sort']);_0x43b6b1[_0x679d('0x42')]=qs[_0x679d('0x38')](_[_0x679d('0x9e')](_0x4ac595[_0x679d('0x36')],_0x388029[_0x679d('0x38')]));if(_0x4ac595[_0x679d('0x36')][_0x679d('0x41')]){_0x43b6b1['where']=_[_0x679d('0x43')](_0x43b6b1[_0x679d('0x42')],{'$or':_[_0x679d('0x35')](_0x43b6b1[_0x679d('0x39')],function(_0x4d017f){var _0xffb563={};_0xffb563[_0x4d017f]={'$like':'%'+_0x4ac595[_0x679d('0x36')][_0x679d('0x41')]+'%'};return _0xffb563;})});}_0x43b6b1=_[_0x679d('0x43')]({},_0x43b6b1,_0x4ac595['options']);return _0x18724c[_0x679d('0x9d')](_0x43b6b1);}})['then'](function(_0xfbe027){if(_0xfbe027){_0x50e53c=_0xfbe027[_0x679d('0x3c')];if(!_0x4ac595[_0x679d('0x36')][_0x679d('0x3d')](_0x679d('0x3e'))){_0x43b6b1[_0x679d('0x22')]=qs[_0x679d('0x22')](_0x4ac595[_0x679d('0x36')]['limit']);_0x43b6b1[_0x679d('0x20')]=qs[_0x679d('0x20')](_0x4ac595[_0x679d('0x36')][_0x679d('0x20')]);}return _0x18724c[_0x679d('0x9d')](_0x43b6b1);}})['then'](function(_0x1d6dcd){if(_0x1d6dcd){return _0x1d6dcd?{'count':_0x50e53c,'rows':_0x1d6dcd}:null;}})[_0x679d('0x28')](respondWithResult(_0x1bdbfd,null))[_0x679d('0x4a')](handleError(_0x1bdbfd,null));};
\ No newline at end of file
+var _0xd047=['Sequelize','QueryTypes','SELECT','map','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','Teams','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','remove','addAgents','isArray','Voice','Chat','Mail','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','emit','online','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all','VoicePrefixId','spread','removeAgents','Fax','Whatsapp','Queue:remove','getAgents','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./team.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','error','stack','name','send','index','Team','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'];(function(_0x3f7d30,_0x41b6a8){var _0x3b6b0e=function(_0x4a8177){while(--_0x4a8177){_0x3f7d30['push'](_0x3f7d30['shift']());}};_0x3b6b0e(++_0x41b6a8);}(_0xd047,0x176));var _0x7d04=function(_0x14265e,_0x1bb078){_0x14265e=_0x14265e-0x0;var _0x298534=_0xd047[_0x14265e];return _0x298534;};'use strict';var emlformat=require(_0x7d04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d04('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d04('0x2'));var moment=require('moment');var BPromise=require(_0x7d04('0x3'));var Mustache=require('mustache');var util=require(_0x7d04('0x4'));var path=require(_0x7d04('0x5'));var sox=require(_0x7d04('0x6'));var csv=require(_0x7d04('0x7'));var ejs=require(_0x7d04('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7d04('0x9'));var crypto=require(_0x7d04('0xa'));var jsforce=require(_0x7d04('0xb'));var deskjs=require(_0x7d04('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7d04('0xd'));var Papa=require(_0x7d04('0xe'));var Redis=require(_0x7d04('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7d04('0x10'));var as=require(_0x7d04('0x11'));var hardwareService=require(_0x7d04('0x12'));var logger=require(_0x7d04('0x13'))('api');var utils=require(_0x7d04('0x14'));var config=require(_0x7d04('0x15'));var licenseUtil=require(_0x7d04('0x16'));var db=require(_0x7d04('0x17'))['db'];config['redis']=_[_0x7d04('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7d04('0x19'))(new Redis(config[_0x7d04('0x1a')]));require(_0x7d04('0x1b'))[_0x7d04('0x1c')](socket);function respondWithStatusCode(_0x35ab5c,_0x1cc548){_0x1cc548=_0x1cc548||0xcc;return function(_0x452900){if(_0x452900){return _0x35ab5c[_0x7d04('0x1d')](_0x1cc548);}return _0x35ab5c[_0x7d04('0x1e')](_0x1cc548)[_0x7d04('0x1f')]();};}function respondWithResult(_0x3476f7,_0x133cbf){_0x133cbf=_0x133cbf||0xc8;return function(_0x528d70){if(_0x528d70){return _0x3476f7[_0x7d04('0x1e')](_0x133cbf)['json'](_0x528d70);}};}function respondWithFilteredResult(_0x245b96,_0x39286a){return function(_0x5af751){if(_0x5af751){var _0x531e95=typeof _0x39286a[_0x7d04('0x20')]===_0x7d04('0x21')&&typeof _0x39286a[_0x7d04('0x22')]===_0x7d04('0x21');var _0x1d7050=_0x5af751[_0x7d04('0x23')];var _0x3ee1a2=_0x531e95?0x0:_0x39286a[_0x7d04('0x20')];var _0x2abda8=_0x531e95?_0x5af751['count']:_0x39286a[_0x7d04('0x20')]+_0x39286a[_0x7d04('0x22')];var _0x54b8c2;if(_0x2abda8>=_0x1d7050){_0x2abda8=_0x1d7050;_0x54b8c2=0xc8;}else{_0x54b8c2=0xce;}_0x245b96[_0x7d04('0x1e')](_0x54b8c2);return _0x245b96[_0x7d04('0x24')]('Content-Range',_0x3ee1a2+'-'+_0x2abda8+'/'+_0x1d7050)[_0x7d04('0x25')](_0x5af751);}return null;};}function patchUpdates(_0x3982b8){return function(_0x16241d){try{jsonpatch[_0x7d04('0x26')](_0x16241d,_0x3982b8,!![]);}catch(_0x3a1862){return BPromise[_0x7d04('0x27')](_0x3a1862);}return _0x16241d['save']();};}function saveUpdates(_0x57d2d5,_0x2e5d06){return function(_0x2c427b){if(_0x2c427b){return _0x2c427b[_0x7d04('0x28')](_0x57d2d5)[_0x7d04('0x29')](function(_0x1a45bc){return _0x1a45bc;});}return null;};}function handleEntityNotFound(_0x323496,_0x517d64){return function(_0x4ed420){if(!_0x4ed420){_0x323496[_0x7d04('0x1d')](0x194);}return _0x4ed420;};}function handleError(_0x596719,_0x533efb){_0x533efb=_0x533efb||0x1f4;return function(_0x10173a){logger[_0x7d04('0x2a')](_0x10173a[_0x7d04('0x2b')]);if(_0x10173a[_0x7d04('0x2c')]){delete _0x10173a[_0x7d04('0x2c')];}_0x596719['status'](_0x533efb)[_0x7d04('0x2d')](_0x10173a);};}exports[_0x7d04('0x2e')]=function(_0x15f320,_0x5df5ee){var _0x31eb7f={},_0x55a766={},_0x412189={'count':0x0,'rows':[]};var _0x4015bd=_['map'](db[_0x7d04('0x2f')][_0x7d04('0x30')],function(_0x15b839){return{'name':_0x15b839[_0x7d04('0x31')],'type':_0x15b839['type'][_0x7d04('0x32')]};});_0x55a766[_0x7d04('0x33')]=_['map'](_0x4015bd,_0x7d04('0x2c'));_0x55a766['query']=_[_0x7d04('0x34')](_0x15f320[_0x7d04('0x35')]);_0x55a766[_0x7d04('0x36')]=_[_0x7d04('0x37')](_0x55a766[_0x7d04('0x33')],_0x55a766[_0x7d04('0x35')]);_0x31eb7f[_0x7d04('0x38')]=_[_0x7d04('0x37')](_0x55a766['model'],qs[_0x7d04('0x39')](_0x15f320[_0x7d04('0x35')][_0x7d04('0x39')]));_0x31eb7f[_0x7d04('0x38')]=_0x31eb7f[_0x7d04('0x38')][_0x7d04('0x3a')]?_0x31eb7f[_0x7d04('0x38')]:_0x55a766[_0x7d04('0x33')];if(!_0x15f320[_0x7d04('0x35')][_0x7d04('0x3b')](_0x7d04('0x3c'))){_0x31eb7f[_0x7d04('0x22')]=qs['limit'](_0x15f320[_0x7d04('0x35')]['limit']);_0x31eb7f[_0x7d04('0x20')]=qs[_0x7d04('0x20')](_0x15f320[_0x7d04('0x35')][_0x7d04('0x20')]);}_0x31eb7f[_0x7d04('0x3d')]=qs[_0x7d04('0x3e')](_0x15f320[_0x7d04('0x35')][_0x7d04('0x3e')]);_0x31eb7f[_0x7d04('0x3f')]=qs[_0x7d04('0x36')](_[_0x7d04('0x40')](_0x15f320[_0x7d04('0x35')],_0x55a766[_0x7d04('0x36')]),_0x4015bd);if(_0x15f320[_0x7d04('0x35')][_0x7d04('0x41')]){_0x31eb7f['where']=_[_0x7d04('0x42')](_0x31eb7f[_0x7d04('0x3f')],{'$or':_['map'](_0x4015bd,function(_0x5706ab){if(_0x5706ab[_0x7d04('0x43')]!=='VIRTUAL'){var _0x20b8b6={};_0x20b8b6[_0x5706ab[_0x7d04('0x2c')]]={'$like':'%'+_0x15f320[_0x7d04('0x35')][_0x7d04('0x41')]+'%'};return _0x20b8b6;}})});}_0x31eb7f=_[_0x7d04('0x42')]({},_0x31eb7f,_0x15f320[_0x7d04('0x44')]);var _0x2f561c={'where':_0x31eb7f[_0x7d04('0x3f')]};return db[_0x7d04('0x2f')][_0x7d04('0x23')](_0x2f561c)['then'](function(_0x2c9bdc){_0x412189[_0x7d04('0x23')]=_0x2c9bdc;if(_0x15f320[_0x7d04('0x35')][_0x7d04('0x45')]){_0x31eb7f[_0x7d04('0x46')]=[{'all':!![]}];}return db[_0x7d04('0x2f')][_0x7d04('0x47')](_0x31eb7f);})[_0x7d04('0x29')](function(_0x1ebffb){_0x412189[_0x7d04('0x48')]=_0x1ebffb;return _0x412189;})['then'](respondWithFilteredResult(_0x5df5ee,_0x31eb7f))['catch'](handleError(_0x5df5ee,null));};exports[_0x7d04('0x49')]=function(_0x2bfea6,_0x2011f1){var _0x21a007={'raw':![],'where':{'id':_0x2bfea6[_0x7d04('0x4a')]['id']}},_0x2cecc6={};_0x2cecc6[_0x7d04('0x33')]=_[_0x7d04('0x34')](db[_0x7d04('0x2f')][_0x7d04('0x30')]);_0x2cecc6[_0x7d04('0x35')]=_[_0x7d04('0x34')](_0x2bfea6[_0x7d04('0x35')]);_0x2cecc6[_0x7d04('0x36')]=_[_0x7d04('0x37')](_0x2cecc6[_0x7d04('0x33')],_0x2cecc6[_0x7d04('0x35')]);_0x21a007[_0x7d04('0x38')]=_[_0x7d04('0x37')](_0x2cecc6[_0x7d04('0x33')],qs['fields'](_0x2bfea6[_0x7d04('0x35')][_0x7d04('0x39')]));_0x21a007['attributes']=_0x21a007['attributes']['length']?_0x21a007['attributes']:_0x2cecc6['model'];if(_0x2bfea6[_0x7d04('0x35')][_0x7d04('0x45')]){_0x21a007[_0x7d04('0x46')]=[{'all':!![]}];}_0x21a007=_['merge']({},_0x21a007,_0x2bfea6[_0x7d04('0x44')]);return db[_0x7d04('0x2f')][_0x7d04('0x4b')](_0x21a007)[_0x7d04('0x29')](handleEntityNotFound(_0x2011f1,null))[_0x7d04('0x29')](respondWithResult(_0x2011f1,null))[_0x7d04('0x4c')](handleError(_0x2011f1,null));};exports[_0x7d04('0x4d')]=function(_0x47e088,_0x203136){return db[_0x7d04('0x2f')][_0x7d04('0x4d')](_0x47e088['body'],{})[_0x7d04('0x29')](function(_0x51b1dd){var _0x1465d7=_0x47e088[_0x7d04('0x4e')][_0x7d04('0x4f')]({'plain':!![]});if(!_0x1465d7)throw new Error(_0x7d04('0x50'));if(_0x1465d7[_0x7d04('0x51')]===_0x7d04('0x4e')){var _0x8e9286=_0x51b1dd[_0x7d04('0x4f')]({'plain':!![]});var _0x257fd1='Teams';return db[_0x7d04('0x52')][_0x7d04('0x4b')]({'where':{'name':_0x257fd1,'userProfileId':_0x1465d7['userProfileId']},'raw':!![]})[_0x7d04('0x29')](function(_0xb32750){if(_0xb32750&&_0xb32750[_0x7d04('0x53')]===0x0){return db[_0x7d04('0x54')][_0x7d04('0x4d')]({'name':_0x8e9286[_0x7d04('0x2c')],'resourceId':_0x8e9286['id'],'type':_0xb32750[_0x7d04('0x2c')],'sectionId':_0xb32750['id']},{})[_0x7d04('0x29')](function(){return _0x51b1dd;});}else{return _0x51b1dd;}})[_0x7d04('0x4c')](function(_0x2846f0){logger['error'](_0x7d04('0x55'),_0x2846f0);throw _0x2846f0;});}return _0x51b1dd;})[_0x7d04('0x29')](respondWithResult(_0x203136,0xc9))[_0x7d04('0x4c')](handleError(_0x203136,null));};exports['update']=function(_0x1a426a,_0x217098){if(_0x1a426a[_0x7d04('0x56')]['id']){delete _0x1a426a[_0x7d04('0x56')]['id'];}return db[_0x7d04('0x2f')][_0x7d04('0x4b')]({'where':{'id':_0x1a426a[_0x7d04('0x4a')]['id']}})[_0x7d04('0x29')](handleEntityNotFound(_0x217098,null))[_0x7d04('0x29')](saveUpdates(_0x1a426a[_0x7d04('0x56')],null))[_0x7d04('0x29')](respondWithResult(_0x217098,null))[_0x7d04('0x4c')](handleError(_0x217098,null));};exports[_0x7d04('0x57')]=function(_0x2d0004,_0xd7713){var _0x596e08=_0x2d0004[_0x7d04('0x4a')]['id'];var _0x1fdadd=[];return db[_0x7d04('0x58')][_0x7d04('0x59')](function(_0x16ac75){var _0x2bf53e=_0x7d04('0x5a')+_0x596e08;return db['sequelize'][_0x7d04('0x35')](_0x2bf53e,{'type':db[_0x7d04('0x5b')][_0x7d04('0x5c')][_0x7d04('0x5d')],'raw':!![],'transaction':_0x16ac75})[_0x7d04('0x29')](function(_0x5bff88){_0x1fdadd=_[_0x7d04('0x5e')](_0x5bff88,function(_0x58d2e8){return Number(_0x58d2e8['UserId']);});})[_0x7d04('0x29')](function(){var _0x349b9a=_0x7d04('0x5f')+_0x596e08;return db[_0x7d04('0x58')][_0x7d04('0x35')](_0x349b9a,{'type':db[_0x7d04('0x5b')][_0x7d04('0x5c')][_0x7d04('0x5d')],'raw':!![],'transaction':_0x16ac75});})[_0x7d04('0x29')](function(_0x1bd971){var _0x1bb83e=_[_0x7d04('0x5e')](_0x1bd971,function(_0x2d8cea){return Number(_0x2d8cea[_0x7d04('0x60')]);});return db[_0x7d04('0x61')][_0x7d04('0x57')]({'where':{'UserId':{'$in':_0x1fdadd},'VoiceQueueId':{'$in':_0x1bb83e}},'transaction':_0x16ac75});})[_0x7d04('0x29')](function(){var _0x6fe00e=_0x7d04('0x62')+_0x596e08;return db[_0x7d04('0x58')][_0x7d04('0x35')](_0x6fe00e,{'type':db[_0x7d04('0x5b')][_0x7d04('0x5c')][_0x7d04('0x5d')],'raw':!![],'transaction':_0x16ac75});})['then'](function(_0x3a370a){var _0x6e90d8=_[_0x7d04('0x5e')](_0x3a370a,function(_0x12cd79){return Number(_0x12cd79['MailQueueId']);});return db[_0x7d04('0x63')]['destroy']({'where':{'UserId':{'$in':_0x1fdadd},'MailQueueId':{'$in':_0x6e90d8}},'transaction':_0x16ac75});})['then'](function(){var _0x46cad8='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x596e08;return db['sequelize']['query'](_0x46cad8,{'type':db['Sequelize'][_0x7d04('0x5c')][_0x7d04('0x5d')],'raw':!![],'transaction':_0x16ac75});})[_0x7d04('0x29')](function(_0x5ae9b9){var _0x590b5a=_[_0x7d04('0x5e')](_0x5ae9b9,function(_0x19ec2f){return Number(_0x19ec2f[_0x7d04('0x64')]);});return db[_0x7d04('0x65')][_0x7d04('0x57')]({'where':{'UserId':{'$in':_0x1fdadd},'SmsQueueId':{'$in':_0x590b5a}},'transaction':_0x16ac75});})[_0x7d04('0x29')](function(){var _0x17b191=_0x7d04('0x66')+_0x596e08;return db[_0x7d04('0x58')][_0x7d04('0x35')](_0x17b191,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x16ac75});})[_0x7d04('0x29')](function(_0x21aeae){var _0xf9c830=_[_0x7d04('0x5e')](_0x21aeae,function(_0x15b72d){return Number(_0x15b72d['ChatQueueId']);});return db[_0x7d04('0x67')][_0x7d04('0x57')]({'where':{'UserId':{'$in':_0x1fdadd},'ChatQueueId':{'$in':_0xf9c830}},'transaction':_0x16ac75});})['then'](function(){var _0x5266e5=_0x7d04('0x68')+_0x596e08;return db[_0x7d04('0x58')]['query'](_0x5266e5,{'type':db[_0x7d04('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x16ac75});})['then'](function(_0x1fe372){var _0x2735d6=_[_0x7d04('0x5e')](_0x1fe372,function(_0x56a216){return Number(_0x56a216['FaxQueueId']);});return db[_0x7d04('0x69')][_0x7d04('0x57')]({'where':{'UserId':{'$in':_0x1fdadd},'FaxQueueId':{'$in':_0x2735d6}},'transaction':_0x16ac75});})['then'](function(){var _0x111a9e=_0x7d04('0x6a')+_0x596e08;return db['sequelize'][_0x7d04('0x35')](_0x111a9e,{'type':db[_0x7d04('0x5b')][_0x7d04('0x5c')][_0x7d04('0x5d')],'raw':!![],'transaction':_0x16ac75});})[_0x7d04('0x29')](function(_0x561913){var _0x35b980=_[_0x7d04('0x5e')](_0x561913,function(_0x267bfe){return Number(_0x267bfe[_0x7d04('0x6b')]);});return db[_0x7d04('0x6c')][_0x7d04('0x57')]({'where':{'UserId':{'$in':_0x1fdadd},'OpenchannelQueueId':{'$in':_0x35b980}},'transaction':_0x16ac75});})[_0x7d04('0x29')](function(){var _0x16dd41=_0x7d04('0x6d')+_0x596e08;return db[_0x7d04('0x58')][_0x7d04('0x35')](_0x16dd41,{'type':db[_0x7d04('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x16ac75});})[_0x7d04('0x29')](function(_0x50503c){var _0x342561=_[_0x7d04('0x5e')](_0x50503c,function(_0xa76b28){return Number(_0xa76b28[_0x7d04('0x6e')]);});return db[_0x7d04('0x6f')][_0x7d04('0x57')]({'where':{'UserId':{'$in':_0x1fdadd},'WhatsappQueueId':{'$in':_0x342561}},'transaction':_0x16ac75});})[_0x7d04('0x29')](function(){return db[_0x7d04('0x70')]['find']({'where':{'TeamId':_0x596e08}});})[_0x7d04('0x29')](function(_0x536753){if(_0x536753===null){return;}return db[_0x7d04('0x71')][_0x7d04('0x57')]({'where':{'UserId':{'$in':_0x1fdadd},'VoicePrefixId':_0x536753['VoicePrefixId']},'transaction':_0x16ac75});})[_0x7d04('0x29')](function(){return db[_0x7d04('0x2f')]['destroy']({'where':{'id':_0x596e08},'cascade':!![],'transaction':_0x16ac75});})[_0x7d04('0x29')](function(_0x3dc6c4){if(_0x3dc6c4===0x0){_0xd7713[_0x7d04('0x1d')](0x194);}else{return db[_0x7d04('0x54')][_0x7d04('0x57')]({'where':{'type':_0x7d04('0x72'),'resourceId':_0x596e08},'cascade':!![],'transaction':_0x16ac75})[_0x7d04('0x29')](function(){_0xd7713[_0x7d04('0x1e')](0xcc)[_0x7d04('0x1f')]();});}})[_0x7d04('0x4c')](function(_0x49e28b){_0xd7713[_0x7d04('0x1e')](0x1f4)['send'](_0x49e28b);});});};exports['getQueues']=function(_0x910f51,_0x30ccb8,_0x5d37e6){return db[_0x7d04('0x2f')][_0x7d04('0x73')]({'where':{'id':_0x910f51['params']['id']}})['then'](handleEntityNotFound(_0x30ccb8,null))[_0x7d04('0x29')](function(_0x45421d){if(!_0x910f51[_0x7d04('0x35')][_0x7d04('0x74')]||!utils[_0x7d04('0x75')](_0x910f51['query'][_0x7d04('0x74')])){throw new db[(_0x7d04('0x5b'))][(_0x7d04('0x76'))](_0x7d04('0x77'));}var _0x5d8ce3={};var _0x173cec={};_0x173cec[_0x7d04('0x33')]=_[_0x7d04('0x34')](db[_[_0x7d04('0x78')](_0x910f51['query'][_0x7d04('0x74')][_0x7d04('0x79')]())+_0x7d04('0x7a')]['rawAttributes']);_0x173cec['query']=_[_0x7d04('0x34')](_0x910f51['query']);_0x173cec[_0x7d04('0x36')]=_[_0x7d04('0x37')](_0x173cec[_0x7d04('0x33')],_0x173cec[_0x7d04('0x35')]);_0x5d8ce3['attributes']=_['intersection'](_0x173cec[_0x7d04('0x33')],qs[_0x7d04('0x39')](_0x910f51[_0x7d04('0x35')]['fields']));_0x5d8ce3['attributes']=_0x5d8ce3['attributes'][_0x7d04('0x3a')]?_0x5d8ce3['attributes']:_0x173cec[_0x7d04('0x33')];_0x5d8ce3[_0x7d04('0x22')]=qs[_0x7d04('0x22')](_0x910f51[_0x7d04('0x35')][_0x7d04('0x22')]);_0x5d8ce3[_0x7d04('0x20')]=qs[_0x7d04('0x20')](_0x910f51[_0x7d04('0x35')][_0x7d04('0x20')]);_0x5d8ce3[_0x7d04('0x3d')]=qs[_0x7d04('0x3e')](_0x910f51[_0x7d04('0x35')]['sort']);_0x5d8ce3[_0x7d04('0x3f')]=qs['filters'](_[_0x7d04('0x40')](_0x910f51[_0x7d04('0x35')],_0x173cec['filters']));_0x5d8ce3=_[_0x7d04('0x42')]({},_0x5d8ce3,_0x910f51[_0x7d04('0x44')]);return _0x45421d[_0x7d04('0x4f')+_[_0x7d04('0x78')](_0x910f51['query'][_0x7d04('0x74')][_0x7d04('0x79')]())+_0x7d04('0x7b')](_0x5d8ce3);})[_0x7d04('0x29')](respondWithResult(_0x30ccb8,null))[_0x7d04('0x4c')](handleError(_0x30ccb8,null));};exports[_0x7d04('0x7c')]=function(_0x506726,_0x29cd84,_0x8847){return db[_0x7d04('0x2f')][_0x7d04('0x73')]({'where':{'id':_0x506726[_0x7d04('0x4a')]['id']}})[_0x7d04('0x29')](function(_0x53e285){if(_0x53e285){if(!_0x506726[_0x7d04('0x56')][_0x7d04('0x74')]||!utils[_0x7d04('0x75')](_0x506726['body'][_0x7d04('0x74')])){throw new db[(_0x7d04('0x5b'))][(_0x7d04('0x76'))](_0x7d04('0x77'));}return _0x53e285[_0x7d04('0x7d')+_[_0x7d04('0x78')](_0x506726[_0x7d04('0x56')][_0x7d04('0x74')][_0x7d04('0x79')]())+'Queues'](_0x506726[_0x7d04('0x56')][_0x7d04('0x7e')]);}return null;})[_0x7d04('0x29')](handleEntityNotFound(_0x29cd84,null))[_0x7d04('0x29')](respondWithStatusCode(_0x29cd84,null))[_0x7d04('0x4c')](handleError(_0x29cd84,null));};exports['removeQueues']=function(_0x3f6898,_0x19e91d,_0x2b20a9){return db[_0x7d04('0x2f')][_0x7d04('0x73')]({'where':{'id':_0x3f6898['params']['id']}})[_0x7d04('0x29')](function(_0x5dd13){if(_0x5dd13){if(!_0x3f6898[_0x7d04('0x35')][_0x7d04('0x74')]||!utils[_0x7d04('0x75')](_0x3f6898[_0x7d04('0x35')]['channel'])){throw new db[(_0x7d04('0x5b'))][(_0x7d04('0x76'))](_0x7d04('0x77'));}return _0x5dd13[_0x7d04('0x7f')+_[_0x7d04('0x78')](_0x3f6898[_0x7d04('0x35')]['channel'][_0x7d04('0x79')]())+_0x7d04('0x7b')](_0x3f6898[_0x7d04('0x35')]['ids']);}return null;})[_0x7d04('0x29')](handleEntityNotFound(_0x19e91d,null))[_0x7d04('0x29')](respondWithStatusCode(_0x19e91d,null))[_0x7d04('0x4c')](handleError(_0x19e91d,null));};exports[_0x7d04('0x80')]=function(_0x47b734,_0x3b52d6){var _0x1f5806=_[_0x7d04('0x81')](_0x47b734[_0x7d04('0x56')]['ids'])?_0x47b734[_0x7d04('0x56')][_0x7d04('0x7e')]:[_0x47b734[_0x7d04('0x56')][_0x7d04('0x7e')]];var _0x5433f0=_0x47b734[_0x7d04('0x4a')]['id'];return db[_0x7d04('0x2f')][_0x7d04('0x4b')]({'where':{'id':_0x5433f0}})[_0x7d04('0x29')](handleEntityNotFound(_0x3b52d6,null))[_0x7d04('0x29')](function(_0x5a65a3){if(_0x5a65a3){var _0x3d51b7=[_0x7d04('0x82'),_0x7d04('0x83'),_0x7d04('0x84'),'Sms','Fax',_0x7d04('0x85'),'Whatsapp'];return db[_0x7d04('0x58')]['transaction'](function(_0xa7d456){var _0x54153a=_[_0x7d04('0x5e')](_0x3d51b7,function(_0x3d68cf){var _0x8de122={'attributes':['id',_0x7d04('0x2c')]};if(_0x3d68cf==='Voice'){_0x8de122[_0x7d04('0x86')]={'attributes':[_0x7d04('0x87')]};}return _0x5a65a3[_0x7d04('0x4f')+_0x3d68cf+_0x7d04('0x7b')](_0x8de122)['then'](function(_0x58d6d4){var _0x9911cd=_[_0x7d04('0x5e')](_0x58d6d4,function(_0x1437b0){var _0x124194=_['map'](_0x1f5806,function(_0x230de1){var _0x287603={'where':{'UserId':_0x230de1,[_0x3d68cf+_0x7d04('0x88')]:_0x1437b0['id']},'transaction':_0xa7d456};if(_0x3d68cf===_0x7d04('0x82')){_0x287603['defaults']={'penalty':_0x1437b0[_0x7d04('0x89')][_0x7d04('0x87')]};}return db[_0x7d04('0x8a')+_0x3d68cf+_0x7d04('0x7a')]['findOrCreate'](_0x287603)[_0x7d04('0x29')](function(){socket[_0x7d04('0x8b')](_0x7d04('0x4e')+_0x3d68cf+'Queue:save',{'UserId':_0x230de1,[_0x3d68cf+_0x7d04('0x88')]:_0x1437b0['id']});if(_0x3d68cf!==_0x7d04('0x82')){return;}return db[_0x7d04('0x8a')][_0x7d04('0x47')]({'where':{'id':_0x1f5806,'online':0x1},'attributes':['id','name',_0x7d04('0x8c'),_0x7d04('0x8d'),_0x7d04('0x8e')],'raw':!![]})[_0x7d04('0x29')](function(_0x3c9e6d){var _0x2cdcbd=_[_0x7d04('0x5e')](_0x3c9e6d,function(_0x4903cf){return db[_0x7d04('0x8f')][_0x7d04('0x90')]({'membername':_0x4903cf[_0x7d04('0x2c')],'UserId':_0x4903cf['id'],'queue_name':_0x1437b0[_0x7d04('0x2c')],'VoiceQueueId':_0x1437b0['id'],'interface':_['isNil'](_0x4903cf[_0x7d04('0x8e')])?util[_0x7d04('0x91')](_0x7d04('0x92'),_0x4903cf['name']):_0x4903cf[_0x7d04('0x8e')],'paused':_0x4903cf[_0x7d04('0x8d')]||![],'penalty':_0x1437b0[_0x7d04('0x89')][_0x7d04('0x87')]},{'transaction':_0xa7d456});});return Promise[_0x7d04('0x93')](_0x2cdcbd);});});});return Promise[_0x7d04('0x93')](_0x124194);});return Promise[_0x7d04('0x93')](_0x9911cd);})[_0x7d04('0x29')](function(){return db['TeamVoicePrefix'][_0x7d04('0x73')]({'where':{'teamId':_0x5433f0}})['then'](function(_0x55f822){if(_0x55f822){var _0x1b03fc=_['map'](_0x1f5806,function(_0x2cb87d){db[_0x7d04('0x71')][_0x7d04('0x90')]({'UserId':_0x2cb87d,'VoicePrefixId':_0x55f822[_0x7d04('0x94')]});});return Promise[_0x7d04('0x93')](_0x1b03fc);}});});});return Promise[_0x7d04('0x93')](_0x54153a)[_0x7d04('0x29')](function(){return _0x5a65a3[_0x7d04('0x80')](_0x1f5806,{'transaction':_0xa7d456})[_0x7d04('0x95')](function(_0x1aa6f6){return _0x1aa6f6;});});});}})[_0x7d04('0x29')](respondWithResult(_0x3b52d6,null))[_0x7d04('0x4c')](handleError(_0x3b52d6,null));};exports[_0x7d04('0x96')]=function(_0x3de214,_0xab8dd4){var _0x28e4da=_[_0x7d04('0x81')](_0x3de214['query']['ids'])?_0x3de214[_0x7d04('0x35')][_0x7d04('0x7e')]:[_0x3de214[_0x7d04('0x35')]['ids']];var _0x52e8d8=_0x3de214[_0x7d04('0x4a')]['id'];return db['Team']['find']({'where':{'id':_0x52e8d8}})[_0x7d04('0x29')](handleEntityNotFound(_0xab8dd4,null))[_0x7d04('0x29')](function(_0x23f266){if(_0x23f266){var _0x5e96bd=['Voice',_0x7d04('0x83'),'Mail','Sms',_0x7d04('0x97'),_0x7d04('0x85'),_0x7d04('0x98')];return db[_0x7d04('0x58')]['transaction'](function(_0x34c7a0){var _0x1e2c83=_['map'](_0x5e96bd,function(_0x141a21){var _0x580e09={'attributes':['id',_0x7d04('0x2c')]};return _0x23f266[_0x7d04('0x4f')+_0x141a21+_0x7d04('0x7b')](_0x580e09)['then'](function(_0x5a5a83){var _0x44d5af=_[_0x7d04('0x5e')](_0x5a5a83,function(_0x4c887d){return _0x4c887d[_0x7d04('0x96')](_0x28e4da,{'transaction':_0x34c7a0})[_0x7d04('0x29')](function(){var _0x36077c=_[_0x7d04('0x5e')](_0x28e4da,function(_0x56199b){socket[_0x7d04('0x8b')](_0x7d04('0x4e')+_0x141a21+_0x7d04('0x99'),{'UserId':Number(_0x56199b),[_0x141a21+_0x7d04('0x88')]:_0x4c887d['id']});if(_0x141a21!==_0x7d04('0x82')){return;}return db['UserVoiceQueueRt'][_0x7d04('0x57')]({'where':{'VoiceQueueId':_0x4c887d['id'],'UserId':_0x56199b},'transaction':_0x34c7a0});});return Promise[_0x7d04('0x93')](_0x36077c);});});return Promise[_0x7d04('0x93')](_0x44d5af);});});return Promise[_0x7d04('0x93')](_0x1e2c83)[_0x7d04('0x29')](function(){return _0x23f266[_0x7d04('0x96')](_0x28e4da,{'transaction':_0x34c7a0});})['then'](function(){return db[_0x7d04('0x70')][_0x7d04('0x73')]({'where':{'teamId':_0x52e8d8}})['then'](function(_0x110d4a){if(_0x110d4a){var _0x57399a=_[_0x7d04('0x5e')](_0x28e4da,function(_0x2c6883){db[_0x7d04('0x71')][_0x7d04('0x57')]({'where':{'UserId':_0x2c6883,'VoicePrefixId':_0x110d4a[_0x7d04('0x94')]}});});return Promise[_0x7d04('0x93')](_0x57399a);}});});});}})[_0x7d04('0x29')](respondWithStatusCode(_0xab8dd4,null))['catch'](handleError(_0xab8dd4,null));};exports[_0x7d04('0x9a')]=function(_0x35bb23,_0x4e5843,_0x73f1b4){var _0x57ee19={};var _0x57bc5a={};var _0x5610e8;var _0x1f1d05;return db[_0x7d04('0x2f')]['findOne']({'where':{'id':_0x35bb23[_0x7d04('0x4a')]['id']}})[_0x7d04('0x29')](handleEntityNotFound(_0x4e5843,null))[_0x7d04('0x29')](function(_0x343b76){if(_0x343b76){_0x5610e8=_0x343b76;_0x57bc5a['model']=_[_0x7d04('0x34')](db[_0x7d04('0x8a')][_0x7d04('0x30')]);_0x57bc5a[_0x7d04('0x35')]=_['keys'](_0x35bb23[_0x7d04('0x35')]);_0x57bc5a[_0x7d04('0x36')]=_[_0x7d04('0x37')](_0x57bc5a[_0x7d04('0x33')],_0x57bc5a[_0x7d04('0x35')]);_0x57ee19[_0x7d04('0x38')]=_[_0x7d04('0x37')](_0x57bc5a[_0x7d04('0x33')],qs[_0x7d04('0x39')](_0x35bb23['query']['fields']));_0x57ee19['attributes']=_0x57ee19[_0x7d04('0x38')]['length']?_0x57ee19[_0x7d04('0x38')]:_0x57bc5a['model'];_0x57ee19[_0x7d04('0x3d')]=qs['sort'](_0x35bb23['query']['sort']);_0x57ee19[_0x7d04('0x3f')]=qs[_0x7d04('0x36')](_[_0x7d04('0x40')](_0x35bb23[_0x7d04('0x35')],_0x57bc5a['filters']));if(_0x35bb23[_0x7d04('0x35')][_0x7d04('0x41')]){_0x57ee19['where']=_[_0x7d04('0x42')](_0x57ee19[_0x7d04('0x3f')],{'$or':_[_0x7d04('0x5e')](_0x57ee19['attributes'],function(_0x156472){var _0x312bde={};_0x312bde[_0x156472]={'$like':'%'+_0x35bb23['query'][_0x7d04('0x41')]+'%'};return _0x312bde;})});}_0x57ee19=_['merge']({},_0x57ee19,_0x35bb23[_0x7d04('0x44')]);return _0x5610e8[_0x7d04('0x9a')](_0x57ee19);}})[_0x7d04('0x29')](function(_0x4f2e20){if(_0x4f2e20){_0x1f1d05=_0x4f2e20['length'];if(!_0x35bb23['query'][_0x7d04('0x3b')]('nolimit')){_0x57ee19[_0x7d04('0x22')]=qs[_0x7d04('0x22')](_0x35bb23[_0x7d04('0x35')]['limit']);_0x57ee19['offset']=qs[_0x7d04('0x20')](_0x35bb23[_0x7d04('0x35')][_0x7d04('0x20')]);}return _0x5610e8['getAgents'](_0x57ee19);}})[_0x7d04('0x29')](function(_0x1c9862){if(_0x1c9862){return _0x1c9862?{'count':_0x1f1d05,'rows':_0x1c9862}:null;}})[_0x7d04('0x29')](respondWithResult(_0x4e5843,null))['catch'](handleError(_0x4e5843,null));};
\ No newline at end of file
index 8d68693..43a7091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeec=['events','../../mysqldb','Team','save','remove','emit','hasOwnProperty','exports'];(function(_0x4f3243,_0x17271d){var _0x2cad3a=function(_0x2d4131){while(--_0x2d4131){_0x4f3243['push'](_0x4f3243['shift']());}};_0x2cad3a(++_0x17271d);}(_0xdeec,0x160));var _0xcdee=function(_0x2a82b1,_0x3c3ff6){_0x2a82b1=_0x2a82b1-0x0;var _0xa7129c=_0xdeec[_0x2a82b1];return _0xa7129c;};'use strict';var EventEmitter=require(_0xcdee('0x0'));var Team=require(_0xcdee('0x1'))['db'][_0xcdee('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcdee('0x3'),'afterUpdate':'update','afterDestroy':_0xcdee('0x4')};function emitEvent(_0x27b31a){return function(_0x3562fe,_0x160578,_0x401e7f){TeamEvents[_0xcdee('0x5')](_0x27b31a+':'+_0x3562fe['id'],_0x3562fe);TeamEvents[_0xcdee('0x5')](_0x27b31a,_0x3562fe);_0x401e7f(null);};}for(var e in events){if(events[_0xcdee('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xcdee('0x7')]=TeamEvents;
\ No newline at end of file
+var _0x1464=['setMaxListeners','update','emit','hook','exports','events','../../mysqldb','Team'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x1464,0xa5));var _0x4146=function(_0x108de9,_0x59c896){_0x108de9=_0x108de9-0x0;var _0x3038af=_0x1464[_0x108de9];return _0x3038af;};'use strict';var EventEmitter=require(_0x4146('0x0'));var Team=require(_0x4146('0x1'))['db'][_0x4146('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4146('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4146('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d5f88){return function(_0x3bde1b,_0x299e86,_0x8d1e9a){TeamEvents[_0x4146('0x5')](_0x1d5f88+':'+_0x3bde1b['id'],_0x3bde1b);TeamEvents['emit'](_0x1d5f88,_0x3bde1b);_0x8d1e9a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x4146('0x6')](e,emitEvent(event));}}module[_0x4146('0x7')]=TeamEvents;
\ No newline at end of file
index 96248f9..565ad70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79ad=['path','../../config/environment','./team.attributes','exports','define','Team','../../config/logger','moment','bluebird','request-promise'];(function(_0x4a82a4,_0x2e611d){var _0x375d32=function(_0x49e010){while(--_0x49e010){_0x4a82a4['push'](_0x4a82a4['shift']());}};_0x375d32(++_0x2e611d);}(_0x79ad,0x132));var _0xd79a=function(_0x33a025,_0x1b733b){_0x33a025=_0x33a025-0x0;var _0x31f2f5=_0x79ad[_0x33a025];return _0x31f2f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd79a('0x0'))('api');var moment=require(_0xd79a('0x1'));var BPromise=require(_0xd79a('0x2'));var rp=require(_0xd79a('0x3'));var fs=require('fs');var path=require(_0xd79a('0x4'));var rimraf=require('rimraf');var config=require(_0xd79a('0x5'));var attributes=require(_0xd79a('0x6'));module[_0xd79a('0x7')]=function(_0x531f0c,_0x49f974){return _0x531f0c[_0xd79a('0x8')](_0xd79a('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa520=['request-promise','path','rimraf','../../config/environment','exports','define','Team','teams','lodash','util','../../config/logger','moment','bluebird'];(function(_0x48067,_0x241e93){var _0x5c3f87=function(_0x32f894){while(--_0x32f894){_0x48067['push'](_0x48067['shift']());}};_0x5c3f87(++_0x241e93);}(_0xa520,0x181));var _0x0a52=function(_0x3bbe35,_0x2fa99a){_0x3bbe35=_0x3bbe35-0x0;var _0x5afb96=_0xa520[_0x3bbe35];return _0x5afb96;};'use strict';var _=require(_0x0a52('0x0'));var util=require(_0x0a52('0x1'));var logger=require(_0x0a52('0x2'))('api');var moment=require(_0x0a52('0x3'));var BPromise=require(_0x0a52('0x4'));var rp=require(_0x0a52('0x5'));var fs=require('fs');var path=require(_0x0a52('0x6'));var rimraf=require(_0x0a52('0x7'));var config=require(_0x0a52('0x8'));var attributes=require('./team.attributes');module[_0x0a52('0x9')]=function(_0x41fd66,_0x384baf){return _0x41fd66[_0x0a52('0xa')](_0x0a52('0xb'),attributes,{'tableName':_0x0a52('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1362a39..d76e4cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef43=['code','Team,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0xef43,0x1bf));var _0x3ef4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xef43[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x3ef4('0x0'));var util=require(_0x3ef4('0x1'));var moment=require(_0x3ef4('0x2'));var BPromise=require(_0x3ef4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ef4('0x4'));var db=require(_0x3ef4('0x5'))['db'];var utils=require(_0x3ef4('0x6'));var logger=require(_0x3ef4('0x7'))(_0x3ef4('0x8'));var config=require(_0x3ef4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3ef4('0xa')]['http']({'port':0x232a});config[_0x3ef4('0xb')]=_[_0x3ef4('0xc')](config[_0x3ef4('0xb')],{'host':_0x3ef4('0xd'),'port':0x18eb});var socket=require(_0x3ef4('0xe'))(new Redis(config[_0x3ef4('0xb')]));require(_0x3ef4('0xf'))[_0x3ef4('0x10')](socket);function respondWithRpcPromise(_0x28e184,_0x5bff31,_0x5725b0){return new BPromise(function(_0x5297c8,_0x17eeb8){return client['request'](_0x28e184,_0x5725b0)[_0x3ef4('0x11')](function(_0x15f470){logger['info']('Team,\x20%s,\x20%s',_0x5bff31,_0x3ef4('0x12'));logger['debug'](_0x3ef4('0x13'),_0x5bff31,_0x3ef4('0x12'),JSON['stringify'](_0x15f470));if(_0x15f470[_0x3ef4('0x14')]){if(_0x15f470['error'][_0x3ef4('0x15')]===0x1f4){logger['error'](_0x3ef4('0x16'),_0x5bff31,_0x15f470[_0x3ef4('0x14')][_0x3ef4('0x17')]);return _0x17eeb8(_0x15f470['error'][_0x3ef4('0x17')]);}logger[_0x3ef4('0x14')]('Team,\x20%s,\x20%s',_0x5bff31,_0x15f470[_0x3ef4('0x14')][_0x3ef4('0x17')]);return _0x5297c8(_0x15f470[_0x3ef4('0x14')][_0x3ef4('0x17')]);}else{logger[_0x3ef4('0x18')](_0x3ef4('0x16'),_0x5bff31,_0x3ef4('0x12'));_0x5297c8(_0x15f470[_0x3ef4('0x19')][_0x3ef4('0x17')]);}})['catch'](function(_0x3f62dc){logger[_0x3ef4('0x14')](_0x3ef4('0x16'),_0x5bff31,_0x3f62dc);_0x17eeb8(_0x3f62dc);});});}
\ No newline at end of file
+var _0x35cb=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x3f9ac2,_0x1b670b){var _0xe6a436=function(_0x1f3ea5){while(--_0x1f3ea5){_0x3f9ac2['push'](_0x3f9ac2['shift']());}};_0xe6a436(++_0x1b670b);}(_0x35cb,0x127));var _0xb35c=function(_0x5ac299,_0x17c1dd){_0x5ac299=_0x5ac299-0x0;var _0x1613fe=_0x35cb[_0x5ac299];return _0x1613fe;};'use strict';var _=require(_0xb35c('0x0'));var util=require(_0xb35c('0x1'));var moment=require(_0xb35c('0x2'));var BPromise=require(_0xb35c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb35c('0x4'));var db=require(_0xb35c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb35c('0x6'))(_0xb35c('0x7'));var config=require(_0xb35c('0x8'));var jayson=require(_0xb35c('0x9'));var client=jayson[_0xb35c('0xa')][_0xb35c('0xb')]({'port':0x232a});config[_0xb35c('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0xb35c('0xd')](socket);function respondWithRpcPromise(_0xe3f8c3,_0x3d670a,_0x1bd9c5){return new BPromise(function(_0x3e60c7,_0x27a21a){return client[_0xb35c('0xe')](_0xe3f8c3,_0x1bd9c5)[_0xb35c('0xf')](function(_0x5c621f){logger[_0xb35c('0x10')]('Team,\x20%s,\x20%s',_0x3d670a,_0xb35c('0x11'));logger[_0xb35c('0x12')](_0xb35c('0x13'),_0x3d670a,'request\x20sent',JSON[_0xb35c('0x14')](_0x5c621f));if(_0x5c621f[_0xb35c('0x15')]){if(_0x5c621f[_0xb35c('0x15')][_0xb35c('0x16')]===0x1f4){logger[_0xb35c('0x15')](_0xb35c('0x17'),_0x3d670a,_0x5c621f[_0xb35c('0x15')][_0xb35c('0x18')]);return _0x27a21a(_0x5c621f[_0xb35c('0x15')][_0xb35c('0x18')]);}logger[_0xb35c('0x15')](_0xb35c('0x17'),_0x3d670a,_0x5c621f['error'][_0xb35c('0x18')]);return _0x3e60c7(_0x5c621f[_0xb35c('0x15')][_0xb35c('0x18')]);}else{logger[_0xb35c('0x10')](_0xb35c('0x17'),_0x3d670a,_0xb35c('0x11'));_0x3e60c7(_0x5c621f[_0xb35c('0x19')][_0xb35c('0x18')]);}})[_0xb35c('0x1a')](function(_0x284bcb){logger[_0xb35c('0x15')](_0xb35c('0x17'),_0x3d670a,_0x284bcb);_0x27a21a(_0x284bcb);});});}
\ No newline at end of file
index 1b77539..54453dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04c5=['removeListener','register','length','./team.events','emit'];(function(_0x12e3cb,_0x56b424){var _0x381e17=function(_0x34f495){while(--_0x34f495){_0x12e3cb['push'](_0x12e3cb['shift']());}};_0x381e17(++_0x56b424);}(_0x04c5,0x125));var _0x504c=function(_0x285132,_0x26a83a){_0x285132=_0x285132-0x0;var _0x46ccae=_0x04c5[_0x285132];return _0x46ccae;};'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
+var _0x6a98=['update','removeListener','register','team:','save'];(function(_0xd5edae,_0x67dbb0){var _0x4797a5=function(_0x221163){while(--_0x221163){_0xd5edae['push'](_0xd5edae['shift']());}};_0x4797a5(++_0x67dbb0);}(_0x6a98,0xc7));var _0x86a9=function(_0x19b709,_0x373b44){_0x19b709=_0x19b709-0x0;var _0x29eb28=_0x6a98[_0x19b709];return _0x29eb28;};'use strict';var TeamEvents=require('./team.events');var events=[_0x86a9('0x0'),'remove',_0x86a9('0x1')];function createListener(_0x3a5158,_0x334b0d){return function(_0x136401){_0x334b0d['emit'](_0x3a5158,_0x136401);};}function removeListener(_0x146e17,_0x4df741){return function(){TeamEvents[_0x86a9('0x2')](_0x146e17,_0x4df741);};}exports[_0x86a9('0x3')]=function(_0x3d8a1a){for(var _0x51e776=0x0,_0x26afb9=events['length'];_0x51e776<_0x26afb9;_0x51e776++){var _0x3d6fea=events[_0x51e776];var _0x32452c=createListener(_0x86a9('0x4')+_0x3d6fea,_0x3d8a1a);TeamEvents['on'](_0x3d6fea,_0x32452c);}};
\ No newline at end of file
index 329c629..8ca3695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0962=['exports','INTEGER','sequelize'];(function(_0x1dfb9c,_0x34f6f9){var _0x1232a7=function(_0x1b9bce){while(--_0x1b9bce){_0x1dfb9c['push'](_0x1dfb9c['shift']());}};_0x1232a7(++_0x34f6f9);}(_0x0962,0x116));var _0x2096=function(_0x35655f,_0x36677e){_0x35655f=_0x35655f-0x0;var _0x469f4d=_0x0962[_0x35655f];return _0x469f4d;};'use strict';var Sequelize=require(_0x2096('0x0'));module[_0x2096('0x1')]={'TeamId':{'type':Sequelize[_0x2096('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2096('0x2')]}};
\ No newline at end of file
+var _0x2b87=['sequelize','exports','INTEGER'];(function(_0x47b006,_0x1e8d0d){var _0x5d6b61=function(_0x540ae0){while(--_0x540ae0){_0x47b006['push'](_0x47b006['shift']());}};_0x5d6b61(++_0x1e8d0d);}(_0x2b87,0x186));var _0x72b8=function(_0x238e21,_0x252307){_0x238e21=_0x238e21-0x0;var _0x3842ef=_0x2b87[_0x238e21];return _0x3842ef;};'use strict';var Sequelize=require(_0x72b8('0x0'));module[_0x72b8('0x1')]={'TeamId':{'type':Sequelize[_0x72b8('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 2b36fd0..8eb5c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb299=['request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird'];(function(_0x16360c,_0x37c098){var _0x17dd2d=function(_0x32b306){while(--_0x32b306){_0x16360c['push'](_0x16360c['shift']());}};_0x17dd2d(++_0x37c098);}(_0xb299,0x19b));var _0x9b29=function(_0x31eba7,_0x514356){_0x31eba7=_0x31eba7-0x0;var _0x2e8d59=_0xb299[_0x31eba7];return _0x2e8d59;};'use strict';var _=require(_0x9b29('0x0'));var util=require('util');var logger=require(_0x9b29('0x1'))(_0x9b29('0x2'));var moment=require(_0x9b29('0x3'));var BPromise=require(_0x9b29('0x4'));var rp=require(_0x9b29('0x5'));var fs=require('fs');var path=require(_0x9b29('0x6'));var rimraf=require(_0x9b29('0x7'));var config=require('../../config/environment');var attributes=require(_0x9b29('0x8'));module[_0x9b29('0x9')]=function(_0x4da7ce,_0x321436){return _0x4da7ce[_0x9b29('0xa')](_0x9b29('0xb'),attributes,{'tableName':_0x9b29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd5f=['./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x318a27,_0x2be79b){var _0x538bc8=function(_0x4be92d){while(--_0x4be92d){_0x318a27['push'](_0x318a27['shift']());}};_0x538bc8(++_0x2be79b);}(_0xbd5f,0x1c7));var _0xfbd5=function(_0x2c3649,_0x5a901a){_0x2c3649=_0x2c3649-0x0;var _0x31e6b4=_0xbd5f[_0x2c3649];return _0x31e6b4;};'use strict';var _=require(_0xfbd5('0x0'));var util=require(_0xfbd5('0x1'));var logger=require(_0xfbd5('0x2'))('api');var moment=require(_0xfbd5('0x3'));var BPromise=require('bluebird');var rp=require(_0xfbd5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbd5('0x5'));var config=require(_0xfbd5('0x6'));var attributes=require(_0xfbd5('0x7'));module[_0xfbd5('0x8')]=function(_0x26f5ea,_0x9df06e){return _0x26f5ea[_0xfbd5('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0xfbd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e106623..af78e74 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(_0x434672,_0x178e5b){var _0x1a6d6a=function(_0x123b8f){while(--_0x123b8f){_0x434672['push'](_0x434672['shift']());}};_0x1a6d6a(++_0x178e5b);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b22fc,_0x1036e2){var _0x419721=function(_0x460773){while(--_0x460773){_0x5b22fc['push'](_0x5b22fc['shift']());}};_0x419721(++_0x1036e2);}(_0xe706,0xa3));var _0x6e70=function(_0x49aa99,_0x4ef618){_0x49aa99=_0x49aa99-0x0;var _0x1786d7=_0xe706[_0x49aa99];return _0x1786d7;};'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'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
index cec959b..702dd67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56aa=['sequelize','INTEGER'];(function(_0x3436b5,_0x40524a){var _0x3731b5=function(_0x17e5fd){while(--_0x17e5fd){_0x3436b5['push'](_0x3436b5['shift']());}};_0x3731b5(++_0x40524a);}(_0x56aa,0x126));var _0xa56a=function(_0x1db153,_0x1ab5d){_0x1db153=_0x1db153-0x0;var _0x530cbe=_0x56aa[_0x1db153];return _0x530cbe;};'use strict';var Sequelize=require(_0xa56a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa56a('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x244e=['INTEGER','sequelize'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x244e,0x1e9));var _0xe244=function(_0x37fc14,_0x1a7def){_0x37fc14=_0x37fc14-0x0;var _0x4f1b74=_0x244e[_0x37fc14];return _0x4f1b74;};'use strict';var Sequelize=require(_0xe244('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe244('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index f111b58..cd796bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b1=['./teamVoiceQueue.attributes','exports','TeamVoiceQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x51e45c,_0x475b8b){var _0x46727f=function(_0x2a18bc){while(--_0x2a18bc){_0x51e45c['push'](_0x51e45c['shift']());}};_0x46727f(++_0x475b8b);}(_0x72b1,0x16e));var _0x172b=function(_0x5c1248,_0x48eb3c){_0x5c1248=_0x5c1248-0x0;var _0x370670=_0x72b1[_0x5c1248];return _0x370670;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var logger=require(_0x172b('0x1'))(_0x172b('0x2'));var moment=require(_0x172b('0x3'));var BPromise=require(_0x172b('0x4'));var rp=require(_0x172b('0x5'));var fs=require('fs');var path=require(_0x172b('0x6'));var rimraf=require(_0x172b('0x7'));var config=require('../../config/environment');var attributes=require(_0x172b('0x8'));module[_0x172b('0x9')]=function(_0x475fd6,_0x222624){return _0x475fd6['define'](_0x172b('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1159=['define','TeamVoiceQueue','team_has_voice_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x2d4819,_0x115046){var _0x12a579=function(_0x570fa4){while(--_0x570fa4){_0x2d4819['push'](_0x2d4819['shift']());}};_0x12a579(++_0x115046);}(_0x1159,0xf3));var _0x9115=function(_0x359626,_0x3f91d8){_0x359626=_0x359626-0x0;var _0x4c8f22=_0x1159[_0x359626];return _0x4c8f22;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9115('0x1'));var moment=require(_0x9115('0x2'));var BPromise=require(_0x9115('0x3'));var rp=require(_0x9115('0x4'));var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var attributes=require(_0x9115('0x8'));module['exports']=function(_0x4a23ba,_0x3fd395){return _0x4a23ba[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3be47c7..d815a51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc17f=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x3647c5,_0x5c6f3b){var _0x191d4e=function(_0xb8927c){while(--_0xb8927c){_0x3647c5['push'](_0x3647c5['shift']());}};_0x191d4e(++_0x5c6f3b);}(_0xc17f,0xb8));var _0xfc17=function(_0x3a9570,_0x5232a6){_0x3a9570=_0x3a9570-0x0;var _0x211ecb=_0xc17f[_0x3a9570];return _0x211ecb;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require(_0xfc17('0x2'));var BPromise=require(_0xfc17('0x3'));var rs=require(_0xfc17('0x4'));var fs=require('fs');var Redis=require(_0xfc17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc17('0x6'));var logger=require(_0xfc17('0x7'))(_0xfc17('0x8'));var config=require(_0xfc17('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfc17('0xa')][_0xfc17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21c2ef,_0x11fa33,_0x404ee0){return new BPromise(function(_0x3cd590,_0x149054){return client[_0xfc17('0xc')](_0x21c2ef,_0x404ee0)['then'](function(_0x33bd35){logger[_0xfc17('0xd')](_0xfc17('0xe'),_0x11fa33,_0xfc17('0xf'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x11fa33,_0xfc17('0xf'),JSON[_0xfc17('0x10')](_0x33bd35));if(_0x33bd35[_0xfc17('0x11')]){if(_0x33bd35[_0xfc17('0x11')][_0xfc17('0x12')]===0x1f4){logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x33bd35[_0xfc17('0x11')][_0xfc17('0x13')]);return _0x149054(_0x33bd35[_0xfc17('0x11')]['message']);}logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x33bd35[_0xfc17('0x11')]['message']);return _0x3cd590(_0x33bd35[_0xfc17('0x11')][_0xfc17('0x13')]);}else{logger[_0xfc17('0xd')](_0xfc17('0xe'),_0x11fa33,_0xfc17('0xf'));_0x3cd590(_0x33bd35[_0xfc17('0x14')][_0xfc17('0x13')]);}})[_0xfc17('0x15')](function(_0x35f947){logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x35f947);_0x149054(_0x35f947);});});}
\ No newline at end of file
+var _0x2f14=['http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3ebc37,_0x1eb269){var _0x2a175f=function(_0x35bf76){while(--_0x35bf76){_0x3ebc37['push'](_0x3ebc37['shift']());}};_0x2a175f(++_0x1eb269);}(_0x2f14,0x199));var _0x42f1=function(_0x28891f,_0x44e57c){_0x28891f=_0x28891f-0x0;var _0x5ae28e=_0x2f14[_0x28891f];return _0x5ae28e;};'use strict';var _=require('lodash');var util=require(_0x42f1('0x0'));var moment=require(_0x42f1('0x1'));var BPromise=require('bluebird');var rs=require(_0x42f1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42f1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x42f1('0x4'))(_0x42f1('0x5'));var config=require(_0x42f1('0x6'));var jayson=require(_0x42f1('0x7'));var client=jayson[_0x42f1('0x8')][_0x42f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x230d3b,_0x1b0c67,_0x28748c){return new BPromise(function(_0x516359,_0x2a77a6){return client[_0x42f1('0xa')](_0x230d3b,_0x28748c)[_0x42f1('0xb')](function(_0x34bd74){logger[_0x42f1('0xc')](_0x42f1('0xd'),_0x1b0c67,'request\x20sent');logger[_0x42f1('0xe')](_0x42f1('0xf'),_0x1b0c67,_0x42f1('0x10'),JSON[_0x42f1('0x11')](_0x34bd74));if(_0x34bd74[_0x42f1('0x12')]){if(_0x34bd74[_0x42f1('0x12')][_0x42f1('0x13')]===0x1f4){logger['error'](_0x42f1('0xd'),_0x1b0c67,_0x34bd74['error'][_0x42f1('0x14')]);return _0x2a77a6(_0x34bd74['error']['message']);}logger['error'](_0x42f1('0xd'),_0x1b0c67,_0x34bd74[_0x42f1('0x12')]['message']);return _0x516359(_0x34bd74[_0x42f1('0x12')]['message']);}else{logger[_0x42f1('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1b0c67,_0x42f1('0x10'));_0x516359(_0x34bd74['result'][_0x42f1('0x14')]);}})[_0x42f1('0x15')](function(_0x3e2606){logger['error'](_0x42f1('0xd'),_0x1b0c67,_0x3e2606);_0x2a77a6(_0x3e2606);});});}
\ No newline at end of file
index 19be4a1..f2d91b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebcd=['../../config/environment','./template.controller','get','isAuthenticated','index','create','put','/:id','update','delete','destroy','exports','multer','path','Router','../../components/auth/service'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0xebcd,0x18c));var _0xdebc=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0xebcd[_0x5ac84c];return _0x3c53d2;};'use strict';var multer=require(_0xdebc('0x0'));var util=require('util');var path=require(_0xdebc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdebc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdebc('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdebc('0x4'));var controller=require(_0xdebc('0x5'));router[_0xdebc('0x6')]('/',auth[_0xdebc('0x7')](),controller[_0xdebc('0x8')]);router[_0xdebc('0x6')]('/:id',auth[_0xdebc('0x7')](),controller['show']);router['post']('/',auth[_0xdebc('0x7')](),controller[_0xdebc('0x9')]);router[_0xdebc('0xa')](_0xdebc('0xb'),auth[_0xdebc('0x7')](),controller[_0xdebc('0xc')]);router[_0xdebc('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xdebc('0xe')]);module[_0xdebc('0xf')]=router;
\ No newline at end of file
+var _0x0598=['../../components/auth/service','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x23bf7f,_0x578f6c){var _0x64b00e=function(_0x3e6da9){while(--_0x3e6da9){_0x23bf7f['push'](_0x23bf7f['shift']());}};_0x64b00e(++_0x578f6c);}(_0x0598,0x92));var _0x8059=function(_0x3d17c7,_0x187468){_0x3d17c7=_0x3d17c7-0x0;var _0x290ba8=_0x0598[_0x3d17c7];return _0x290ba8;};'use strict';var multer=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var path=require('path');var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8059('0x3'));var auth=require(_0x8059('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8059('0xa')](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router[_0x8059('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0xd')]);module[_0x8059('0xe')]=router;
\ No newline at end of file
index 9043815..c8b4c35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc719=['STRING','TEXT','sequelize'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0xc719,0xd4));var _0x9c71=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0xc719[_0x13e300];return _0x5a3eea;};'use strict';var Sequelize=require(_0x9c71('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c71('0x1')]},'description':{'type':Sequelize[_0x9c71('0x1')]},'html':{'type':Sequelize[_0x9c71('0x2')]}};
\ No newline at end of file
+var _0x744d=['TEXT','exports','STRING'];(function(_0xc350,_0x2fb0f8){var _0x126021=function(_0x3f0b9e){while(--_0x3f0b9e){_0xc350['push'](_0xc350['shift']());}};_0x126021(++_0x2fb0f8);}(_0x744d,0xf4));var _0xd744=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x744d[_0x5774be];return _0x4914b4;};'use strict';var Sequelize=require('sequelize');module[_0xd744('0x0')]={'name':{'type':Sequelize[_0xd744('0x1')]},'description':{'type':Sequelize[_0xd744('0x1')]},'html':{'type':Sequelize[_0xd744('0x2')]}};
\ No newline at end of file
index 506b1df..13caef0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe67e=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','eml-format','rimraf','zip-dir','request-promise','moment','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/logger','api','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Templates','UserProfileResource','sendStatus','error','stack','index','map','Template','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','find','create'];(function(_0x160790,_0x2c237f){var _0x149050=function(_0xf9d1b4){while(--_0xf9d1b4){_0x160790['push'](_0x160790['shift']());}};_0x149050(++_0x2c237f);}(_0xe67e,0xb0));var _0xee67=function(_0x116c94,_0x1ad6f8){_0x116c94=_0x116c94-0x0;var _0x534f0f=_0xe67e[_0x116c94];return _0x534f0f;};'use strict';var emlformat=require(_0xee67('0x0'));var rimraf=require(_0xee67('0x1'));var zipdir=require(_0xee67('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee67('0x3'));var moment=require(_0xee67('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xee67('0x5'));var util=require('util');var path=require(_0xee67('0x6'));var sox=require(_0xee67('0x7'));var csv=require(_0xee67('0x8'));var ejs=require(_0xee67('0x9'));var fs=require('fs');var fs_extra=require(_0xee67('0xa'));var _=require('lodash');var squel=require(_0xee67('0xb'));var crypto=require(_0xee67('0xc'));var jsforce=require(_0xee67('0xd'));var deskjs=require(_0xee67('0xe'));var toCsv=require('to-csv');var querystring=require(_0xee67('0xf'));var Papa=require(_0xee67('0x10'));var Redis=require(_0xee67('0x11'));var authService=require(_0xee67('0x12'));var qs=require(_0xee67('0x13'));var as=require(_0xee67('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee67('0x15'))(_0xee67('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xee67('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cf48a,_0x154194){_0x154194=_0x154194||0xcc;return function(_0x26e213){if(_0x26e213){return _0x2cf48a['sendStatus'](_0x154194);}return _0x2cf48a[_0xee67('0x18')](_0x154194)[_0xee67('0x19')]();};}function respondWithResult(_0x651928,_0x4d41cc){_0x4d41cc=_0x4d41cc||0xc8;return function(_0x3a4d12){if(_0x3a4d12){return _0x651928[_0xee67('0x18')](_0x4d41cc)['json'](_0x3a4d12);}};}function respondWithFilteredResult(_0x28e7e5,_0xdc76e9){return function(_0x37bbd2){if(_0x37bbd2){var _0x193178=typeof _0xdc76e9[_0xee67('0x1a')]===_0xee67('0x1b')&&typeof _0xdc76e9[_0xee67('0x1c')]==='undefined';var _0x6c92f2=_0x37bbd2[_0xee67('0x1d')];var _0x176b4a=_0x193178?0x0:_0xdc76e9[_0xee67('0x1a')];var _0x1adeea=_0x193178?_0x37bbd2[_0xee67('0x1d')]:_0xdc76e9[_0xee67('0x1a')]+_0xdc76e9[_0xee67('0x1c')];var _0x1459cb;if(_0x1adeea>=_0x6c92f2){_0x1adeea=_0x6c92f2;_0x1459cb=0xc8;}else{_0x1459cb=0xce;}_0x28e7e5['status'](_0x1459cb);return _0x28e7e5[_0xee67('0x1e')](_0xee67('0x1f'),_0x176b4a+'-'+_0x1adeea+'/'+_0x6c92f2)[_0xee67('0x20')](_0x37bbd2);}return null;};}function patchUpdates(_0x1e9d87){return function(_0x7c6334){try{jsonpatch[_0xee67('0x21')](_0x7c6334,_0x1e9d87,!![]);}catch(_0x2bb9d1){return BPromise[_0xee67('0x22')](_0x2bb9d1);}return _0x7c6334['save']();};}function saveUpdates(_0x52ba25,_0x434ae9){return function(_0x3dd44e){if(_0x3dd44e){return _0x3dd44e[_0xee67('0x23')](_0x52ba25)[_0xee67('0x24')](function(_0x4a4227){return _0x4a4227;});}return null;};}function removeEntity(_0x53a3a6,_0x57080d){return function(_0x55b2ae){if(_0x55b2ae){return _0x55b2ae[_0xee67('0x25')]()[_0xee67('0x24')](function(){var _0x42d409=_0x55b2ae[_0xee67('0x26')]({'plain':!![]});var _0x5c662e=_0xee67('0x27');return db[_0xee67('0x28')][_0xee67('0x25')]({'where':{'type':_0x5c662e,'resourceId':_0x42d409['id']}})['then'](function(){return _0x55b2ae;});})[_0xee67('0x24')](function(){_0x53a3a6['status'](0xcc)[_0xee67('0x19')]();});}};}function handleEntityNotFound(_0xddaa2f,_0x5920d9){return function(_0x19e3a8){if(!_0x19e3a8){_0xddaa2f[_0xee67('0x29')](0x194);}return _0x19e3a8;};}function handleError(_0x2a994a,_0x320227){_0x320227=_0x320227||0x1f4;return function(_0x1a918b){logger[_0xee67('0x2a')](_0x1a918b[_0xee67('0x2b')]);if(_0x1a918b['name']){delete _0x1a918b['name'];}_0x2a994a[_0xee67('0x18')](_0x320227)['send'](_0x1a918b);};}exports[_0xee67('0x2c')]=function(_0x118a1b,_0x3e03c1){var _0xe31457={},_0x66ec08={},_0x414cea={'count':0x0,'rows':[]};var _0x3e11d5=_[_0xee67('0x2d')](db[_0xee67('0x2e')][_0xee67('0x2f')],function(_0x4fff46){return{'name':_0x4fff46[_0xee67('0x30')],'type':_0x4fff46[_0xee67('0x31')][_0xee67('0x32')]};});_0x66ec08[_0xee67('0x33')]=_[_0xee67('0x2d')](_0x3e11d5,_0xee67('0x34'));_0x66ec08[_0xee67('0x35')]=_['keys'](_0x118a1b['query']);_0x66ec08[_0xee67('0x36')]=_[_0xee67('0x37')](_0x66ec08[_0xee67('0x33')],_0x66ec08[_0xee67('0x35')]);_0xe31457[_0xee67('0x38')]=_[_0xee67('0x37')](_0x66ec08[_0xee67('0x33')],qs[_0xee67('0x39')](_0x118a1b[_0xee67('0x35')][_0xee67('0x39')]));_0xe31457[_0xee67('0x38')]=_0xe31457[_0xee67('0x38')][_0xee67('0x3a')]?_0xe31457[_0xee67('0x38')]:_0x66ec08['model'];if(!_0x118a1b[_0xee67('0x35')][_0xee67('0x3b')](_0xee67('0x3c'))){_0xe31457[_0xee67('0x1c')]=qs['limit'](_0x118a1b[_0xee67('0x35')][_0xee67('0x1c')]);_0xe31457[_0xee67('0x1a')]=qs[_0xee67('0x1a')](_0x118a1b[_0xee67('0x35')]['offset']);}_0xe31457['order']=qs['sort'](_0x118a1b[_0xee67('0x35')][_0xee67('0x3d')]);_0xe31457[_0xee67('0x3e')]=qs[_0xee67('0x36')](_[_0xee67('0x3f')](_0x118a1b[_0xee67('0x35')],_0x66ec08[_0xee67('0x36')]),_0x3e11d5);if(_0x118a1b[_0xee67('0x35')]['filter']){_0xe31457[_0xee67('0x3e')]=_[_0xee67('0x40')](_0xe31457[_0xee67('0x3e')],{'$or':_['map'](_0x3e11d5,function(_0x3e952b){if(_0x3e952b[_0xee67('0x31')]!==_0xee67('0x41')){var _0x50f62e={};_0x50f62e[_0x3e952b[_0xee67('0x34')]]={'$like':'%'+_0x118a1b[_0xee67('0x35')][_0xee67('0x42')]+'%'};return _0x50f62e;}})});}_0xe31457=_[_0xee67('0x40')]({},_0xe31457,_0x118a1b[_0xee67('0x43')]);var _0x322c5d={'where':_0xe31457[_0xee67('0x3e')]};return db[_0xee67('0x2e')][_0xee67('0x1d')](_0x322c5d)[_0xee67('0x24')](function(_0x3bbb89){_0x414cea['count']=_0x3bbb89;if(_0x118a1b[_0xee67('0x35')][_0xee67('0x44')]){_0xe31457[_0xee67('0x45')]=[{'all':!![]}];}return db[_0xee67('0x2e')]['findAll'](_0xe31457);})[_0xee67('0x24')](function(_0x231243){_0x414cea[_0xee67('0x46')]=_0x231243;return _0x414cea;})[_0xee67('0x24')](respondWithFilteredResult(_0x3e03c1,_0xe31457))['catch'](handleError(_0x3e03c1,null));};exports[_0xee67('0x47')]=function(_0x7b71cb,_0x286670){var _0x107162={'raw':!![],'where':{'id':_0x7b71cb[_0xee67('0x48')]['id']}},_0x36f8ec={};_0x36f8ec[_0xee67('0x33')]=_[_0xee67('0x49')](db[_0xee67('0x2e')][_0xee67('0x2f')]);_0x36f8ec[_0xee67('0x35')]=_['keys'](_0x7b71cb[_0xee67('0x35')]);_0x36f8ec[_0xee67('0x36')]=_[_0xee67('0x37')](_0x36f8ec[_0xee67('0x33')],_0x36f8ec['query']);_0x107162[_0xee67('0x38')]=_['intersection'](_0x36f8ec[_0xee67('0x33')],qs['fields'](_0x7b71cb[_0xee67('0x35')][_0xee67('0x39')]));_0x107162['attributes']=_0x107162[_0xee67('0x38')]['length']?_0x107162['attributes']:_0x36f8ec[_0xee67('0x33')];if(_0x7b71cb[_0xee67('0x35')][_0xee67('0x44')]){_0x107162[_0xee67('0x45')]=[{'all':!![]}];}_0x107162=_[_0xee67('0x40')]({},_0x107162,_0x7b71cb[_0xee67('0x43')]);return db[_0xee67('0x2e')][_0xee67('0x4a')](_0x107162)['then'](handleEntityNotFound(_0x286670,null))[_0xee67('0x24')](respondWithResult(_0x286670,null))['catch'](handleError(_0x286670,null));};exports[_0xee67('0x4b')]=function(_0x2925a6,_0x16939e){return db[_0xee67('0x2e')][_0xee67('0x4b')](_0x2925a6[_0xee67('0x4c')],{})[_0xee67('0x24')](function(_0x141cdd){var _0x4d2ba7=_0x2925a6[_0xee67('0x4d')]['get']({'plain':!![]});if(!_0x4d2ba7)throw new Error(_0xee67('0x4e'));if(_0x4d2ba7[_0xee67('0x4f')]===_0xee67('0x4d')){var _0xb6f7f4=_0x141cdd[_0xee67('0x26')]({'plain':!![]});var _0x55a2b9=_0xee67('0x27');return db[_0xee67('0x50')][_0xee67('0x4a')]({'where':{'name':_0x55a2b9,'userProfileId':_0x4d2ba7[_0xee67('0x51')]},'raw':!![]})['then'](function(_0x4e831d){if(_0x4e831d&&_0x4e831d[_0xee67('0x52')]===0x0){return db[_0xee67('0x28')][_0xee67('0x4b')]({'name':_0xb6f7f4[_0xee67('0x34')],'resourceId':_0xb6f7f4['id'],'type':_0x4e831d[_0xee67('0x34')],'sectionId':_0x4e831d['id']},{})[_0xee67('0x24')](function(){return _0x141cdd;});}else{return _0x141cdd;}})[_0xee67('0x53')](function(_0x515a40){logger[_0xee67('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x515a40);throw _0x515a40;});}return _0x141cdd;})[_0xee67('0x24')](respondWithResult(_0x16939e,0xc9))[_0xee67('0x53')](handleError(_0x16939e,null));};exports['update']=function(_0x332d3d,_0x6d3516){if(_0x332d3d[_0xee67('0x4c')]['id']){delete _0x332d3d[_0xee67('0x4c')]['id'];}return db[_0xee67('0x2e')][_0xee67('0x4a')]({'where':{'id':_0x332d3d[_0xee67('0x48')]['id']}})[_0xee67('0x24')](handleEntityNotFound(_0x6d3516,null))[_0xee67('0x24')](saveUpdates(_0x332d3d[_0xee67('0x4c')],null))['then'](respondWithResult(_0x6d3516,null))[_0xee67('0x53')](handleError(_0x6d3516,null));};exports[_0xee67('0x25')]=function(_0x17c8a0,_0x1dd717){return db[_0xee67('0x2e')][_0xee67('0x4a')]({'where':{'id':_0x17c8a0['params']['id']}})[_0xee67('0x24')](handleEntityNotFound(_0x1dd717,null))[_0xee67('0x24')](removeEntity(_0x1dd717,null))['catch'](handleError(_0x1dd717,null));};
\ No newline at end of file
+var _0x8b76=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','end','stack','name','send','index','Template','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x38d1e0,_0x5e04af){var _0x3d9830=function(_0x35a325){while(--_0x35a325){_0x38d1e0['push'](_0x38d1e0['shift']());}};_0x3d9830(++_0x5e04af);}(_0x8b76,0x1a9));var _0x68b7=function(_0x515a1c,_0x2a7f77){_0x515a1c=_0x515a1c-0x0;var _0x54c3df=_0x8b76[_0x515a1c];return _0x54c3df;};'use strict';var emlformat=require(_0x68b7('0x0'));var rimraf=require(_0x68b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x68b7('0x2'));var rp=require(_0x68b7('0x3'));var moment=require(_0x68b7('0x4'));var BPromise=require(_0x68b7('0x5'));var Mustache=require(_0x68b7('0x6'));var util=require(_0x68b7('0x7'));var path=require('path');var sox=require(_0x68b7('0x8'));var csv=require('to-csv');var ejs=require(_0x68b7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68b7('0xa'));var squel=require('squel');var crypto=require(_0x68b7('0xb'));var jsforce=require(_0x68b7('0xc'));var deskjs=require(_0x68b7('0xd'));var toCsv=require(_0x68b7('0xe'));var querystring=require('querystring');var Papa=require(_0x68b7('0xf'));var Redis=require(_0x68b7('0x10'));var authService=require(_0x68b7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x68b7('0x12'));var hardwareService=require(_0x68b7('0x13'));var logger=require(_0x68b7('0x14'))(_0x68b7('0x15'));var utils=require(_0x68b7('0x16'));var config=require(_0x68b7('0x17'));var licenseUtil=require(_0x68b7('0x18'));var db=require(_0x68b7('0x19'))['db'];function respondWithStatusCode(_0x4fb82c,_0x3a4a76){_0x3a4a76=_0x3a4a76||0xcc;return function(_0x24446b){if(_0x24446b){return _0x4fb82c[_0x68b7('0x1a')](_0x3a4a76);}return _0x4fb82c[_0x68b7('0x1b')](_0x3a4a76)['end']();};}function respondWithResult(_0x169a9b,_0x542368){_0x542368=_0x542368||0xc8;return function(_0x3d183a){if(_0x3d183a){return _0x169a9b[_0x68b7('0x1b')](_0x542368)[_0x68b7('0x1c')](_0x3d183a);}};}function respondWithFilteredResult(_0x2118f9,_0x268df4){return function(_0x8a3bd6){if(_0x8a3bd6){var _0x50f4ab=typeof _0x268df4['offset']==='undefined'&&typeof _0x268df4[_0x68b7('0x1d')]===_0x68b7('0x1e');var _0x1dda2e=_0x8a3bd6[_0x68b7('0x1f')];var _0x263dbf=_0x50f4ab?0x0:_0x268df4['offset'];var _0x566aab=_0x50f4ab?_0x8a3bd6[_0x68b7('0x1f')]:_0x268df4[_0x68b7('0x20')]+_0x268df4[_0x68b7('0x1d')];var _0x2bb025;if(_0x566aab>=_0x1dda2e){_0x566aab=_0x1dda2e;_0x2bb025=0xc8;}else{_0x2bb025=0xce;}_0x2118f9[_0x68b7('0x1b')](_0x2bb025);return _0x2118f9[_0x68b7('0x21')](_0x68b7('0x22'),_0x263dbf+'-'+_0x566aab+'/'+_0x1dda2e)['json'](_0x8a3bd6);}return null;};}function patchUpdates(_0xd4b9cc){return function(_0x595b6a){try{jsonpatch[_0x68b7('0x23')](_0x595b6a,_0xd4b9cc,!![]);}catch(_0x3d5b02){return BPromise[_0x68b7('0x24')](_0x3d5b02);}return _0x595b6a[_0x68b7('0x25')]();};}function saveUpdates(_0x32cbc2,_0x48cc4b){return function(_0x63658d){if(_0x63658d){return _0x63658d[_0x68b7('0x26')](_0x32cbc2)[_0x68b7('0x27')](function(_0x2af8e8){return _0x2af8e8;});}return null;};}function removeEntity(_0x30835e,_0x1d87ce){return function(_0xe9b6b7){if(_0xe9b6b7){return _0xe9b6b7[_0x68b7('0x28')]()[_0x68b7('0x27')](function(){var _0x197363=_0xe9b6b7[_0x68b7('0x29')]({'plain':!![]});var _0x15cbf8=_0x68b7('0x2a');return db[_0x68b7('0x2b')][_0x68b7('0x28')]({'where':{'type':_0x15cbf8,'resourceId':_0x197363['id']}})[_0x68b7('0x27')](function(){return _0xe9b6b7;});})['then'](function(){_0x30835e[_0x68b7('0x1b')](0xcc)[_0x68b7('0x2c')]();});}};}function handleEntityNotFound(_0xf7a4e0,_0x42d082){return function(_0x3f2715){if(!_0x3f2715){_0xf7a4e0[_0x68b7('0x1a')](0x194);}return _0x3f2715;};}function handleError(_0x40e38f,_0xf28986){_0xf28986=_0xf28986||0x1f4;return function(_0x224d17){logger['error'](_0x224d17[_0x68b7('0x2d')]);if(_0x224d17[_0x68b7('0x2e')]){delete _0x224d17[_0x68b7('0x2e')];}_0x40e38f[_0x68b7('0x1b')](_0xf28986)[_0x68b7('0x2f')](_0x224d17);};}exports[_0x68b7('0x30')]=function(_0x145035,_0x55974f){var _0x450504={},_0x5d66a9={},_0xfaeb34={'count':0x0,'rows':[]};var _0xaf4fef=_['map'](db[_0x68b7('0x31')][_0x68b7('0x32')],function(_0x45ce0a){return{'name':_0x45ce0a[_0x68b7('0x33')],'type':_0x45ce0a[_0x68b7('0x34')]['key']};});_0x5d66a9[_0x68b7('0x35')]=_[_0x68b7('0x36')](_0xaf4fef,'name');_0x5d66a9['query']=_['keys'](_0x145035[_0x68b7('0x37')]);_0x5d66a9[_0x68b7('0x38')]=_[_0x68b7('0x39')](_0x5d66a9[_0x68b7('0x35')],_0x5d66a9['query']);_0x450504[_0x68b7('0x3a')]=_[_0x68b7('0x39')](_0x5d66a9['model'],qs['fields'](_0x145035['query'][_0x68b7('0x3b')]));_0x450504[_0x68b7('0x3a')]=_0x450504[_0x68b7('0x3a')][_0x68b7('0x3c')]?_0x450504[_0x68b7('0x3a')]:_0x5d66a9['model'];if(!_0x145035[_0x68b7('0x37')][_0x68b7('0x3d')](_0x68b7('0x3e'))){_0x450504[_0x68b7('0x1d')]=qs[_0x68b7('0x1d')](_0x145035['query'][_0x68b7('0x1d')]);_0x450504[_0x68b7('0x20')]=qs[_0x68b7('0x20')](_0x145035[_0x68b7('0x37')][_0x68b7('0x20')]);}_0x450504[_0x68b7('0x3f')]=qs[_0x68b7('0x40')](_0x145035['query'][_0x68b7('0x40')]);_0x450504[_0x68b7('0x41')]=qs[_0x68b7('0x38')](_[_0x68b7('0x42')](_0x145035[_0x68b7('0x37')],_0x5d66a9['filters']),_0xaf4fef);if(_0x145035['query']['filter']){_0x450504[_0x68b7('0x41')]=_[_0x68b7('0x43')](_0x450504['where'],{'$or':_[_0x68b7('0x36')](_0xaf4fef,function(_0x4fe07e){if(_0x4fe07e[_0x68b7('0x34')]!==_0x68b7('0x44')){var _0x592738={};_0x592738[_0x4fe07e[_0x68b7('0x2e')]]={'$like':'%'+_0x145035['query'][_0x68b7('0x45')]+'%'};return _0x592738;}})});}_0x450504=_['merge']({},_0x450504,_0x145035[_0x68b7('0x46')]);var _0x206491={'where':_0x450504['where']};return db[_0x68b7('0x31')][_0x68b7('0x1f')](_0x206491)['then'](function(_0x22bbe3){_0xfaeb34['count']=_0x22bbe3;if(_0x145035['query'][_0x68b7('0x47')]){_0x450504[_0x68b7('0x48')]=[{'all':!![]}];}return db[_0x68b7('0x31')][_0x68b7('0x49')](_0x450504);})[_0x68b7('0x27')](function(_0x4af1be){_0xfaeb34[_0x68b7('0x4a')]=_0x4af1be;return _0xfaeb34;})[_0x68b7('0x27')](respondWithFilteredResult(_0x55974f,_0x450504))['catch'](handleError(_0x55974f,null));};exports['show']=function(_0x28c49d,_0x5db12e){var _0x556c44={'raw':!![],'where':{'id':_0x28c49d[_0x68b7('0x4b')]['id']}},_0x9e8deb={};_0x9e8deb[_0x68b7('0x35')]=_[_0x68b7('0x4c')](db[_0x68b7('0x31')]['rawAttributes']);_0x9e8deb[_0x68b7('0x37')]=_[_0x68b7('0x4c')](_0x28c49d[_0x68b7('0x37')]);_0x9e8deb['filters']=_['intersection'](_0x9e8deb[_0x68b7('0x35')],_0x9e8deb['query']);_0x556c44[_0x68b7('0x3a')]=_['intersection'](_0x9e8deb[_0x68b7('0x35')],qs['fields'](_0x28c49d[_0x68b7('0x37')][_0x68b7('0x3b')]));_0x556c44['attributes']=_0x556c44[_0x68b7('0x3a')][_0x68b7('0x3c')]?_0x556c44[_0x68b7('0x3a')]:_0x9e8deb['model'];if(_0x28c49d['query'][_0x68b7('0x47')]){_0x556c44['include']=[{'all':!![]}];}_0x556c44=_[_0x68b7('0x43')]({},_0x556c44,_0x28c49d[_0x68b7('0x46')]);return db[_0x68b7('0x31')][_0x68b7('0x4d')](_0x556c44)['then'](handleEntityNotFound(_0x5db12e,null))[_0x68b7('0x27')](respondWithResult(_0x5db12e,null))[_0x68b7('0x4e')](handleError(_0x5db12e,null));};exports['create']=function(_0x993b7a,_0x49262e){return db[_0x68b7('0x31')][_0x68b7('0x4f')](_0x993b7a[_0x68b7('0x50')],{})[_0x68b7('0x27')](function(_0x559168){var _0x4a3500=_0x993b7a['user'][_0x68b7('0x29')]({'plain':!![]});if(!_0x4a3500)throw new Error(_0x68b7('0x51'));if(_0x4a3500[_0x68b7('0x52')]===_0x68b7('0x53')){var _0x21a6e7=_0x559168[_0x68b7('0x29')]({'plain':!![]});var _0x580b43='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x580b43,'userProfileId':_0x4a3500[_0x68b7('0x54')]},'raw':!![]})[_0x68b7('0x27')](function(_0x2ddc01){if(_0x2ddc01&&_0x2ddc01[_0x68b7('0x55')]===0x0){return db[_0x68b7('0x2b')]['create']({'name':_0x21a6e7[_0x68b7('0x2e')],'resourceId':_0x21a6e7['id'],'type':_0x2ddc01[_0x68b7('0x2e')],'sectionId':_0x2ddc01['id']},{})[_0x68b7('0x27')](function(){return _0x559168;});}else{return _0x559168;}})[_0x68b7('0x4e')](function(_0x455b9a){logger[_0x68b7('0x56')](_0x68b7('0x57'),_0x455b9a);throw _0x455b9a;});}return _0x559168;})[_0x68b7('0x27')](respondWithResult(_0x49262e,0xc9))[_0x68b7('0x4e')](handleError(_0x49262e,null));};exports[_0x68b7('0x26')]=function(_0x202a78,_0x3810ac){if(_0x202a78[_0x68b7('0x50')]['id']){delete _0x202a78[_0x68b7('0x50')]['id'];}return db['Template'][_0x68b7('0x4d')]({'where':{'id':_0x202a78[_0x68b7('0x4b')]['id']}})[_0x68b7('0x27')](handleEntityNotFound(_0x3810ac,null))['then'](saveUpdates(_0x202a78[_0x68b7('0x50')],null))['then'](respondWithResult(_0x3810ac,null))[_0x68b7('0x4e')](handleError(_0x3810ac,null));};exports[_0x68b7('0x28')]=function(_0x5a412b,_0x23e79d){return db['Template']['find']({'where':{'id':_0x5a412b['params']['id']}})['then'](handleEntityNotFound(_0x23e79d,null))[_0x68b7('0x27')](removeEntity(_0x23e79d,null))[_0x68b7('0x4e')](handleError(_0x23e79d,null));};
\ No newline at end of file
index f5c7a25..22d0638 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8103=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates','util','../../config/logger','api','bluebird'];(function(_0x3e45bc,_0xe62df6){var _0x5b91f7=function(_0x3dc55f){while(--_0x3dc55f){_0x3e45bc['push'](_0x3e45bc['shift']());}};_0x5b91f7(++_0xe62df6);}(_0x8103,0x1b8));var _0x3810=function(_0x4b744a,_0xd8b70d){_0x4b744a=_0x4b744a-0x0;var _0x50b26c=_0x8103[_0x4b744a];return _0x50b26c;};'use strict';var _=require('lodash');var util=require(_0x3810('0x0'));var logger=require(_0x3810('0x1'))(_0x3810('0x2'));var moment=require('moment');var BPromise=require(_0x3810('0x3'));var rp=require(_0x3810('0x4'));var fs=require('fs');var path=require(_0x3810('0x5'));var rimraf=require(_0x3810('0x6'));var config=require(_0x3810('0x7'));var attributes=require(_0x3810('0x8'));module[_0x3810('0x9')]=function(_0x11b63f,_0x2ee5cd){return _0x11b63f[_0x3810('0xa')]('Template',attributes,{'tableName':_0x3810('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x965c=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','Template'];(function(_0x5b8df6,_0x3afca6){var _0x234e78=function(_0x25fc14){while(--_0x25fc14){_0x5b8df6['push'](_0x5b8df6['shift']());}};_0x234e78(++_0x3afca6);}(_0x965c,0x140));var _0xc965=function(_0x3bab18,_0x53d735){_0x3bab18=_0x3bab18-0x0;var _0x12585f=_0x965c[_0x3bab18];return _0x12585f;};'use strict';var _=require('lodash');var util=require(_0xc965('0x0'));var logger=require(_0xc965('0x1'))('api');var moment=require(_0xc965('0x2'));var BPromise=require(_0xc965('0x3'));var rp=require(_0xc965('0x4'));var fs=require('fs');var path=require(_0xc965('0x5'));var rimraf=require('rimraf');var config=require(_0xc965('0x6'));var attributes=require(_0xc965('0x7'));module[_0xc965('0x8')]=function(_0x25ee83,_0x4b76ab){return _0x25ee83['define'](_0xc965('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a62b410..eae09ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86af=['options','where','limit','include','map','model','attributes','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetTemplate','Template','findAll','raw'];(function(_0x5384e5,_0x2eb6e1){var _0x29a3e9=function(_0x55ec68){while(--_0x55ec68){_0x5384e5['push'](_0x5384e5['shift']());}};_0x29a3e9(++_0x2eb6e1);}(_0x86af,0x152));var _0xf86a=function(_0xb94ff7,_0x46f8dc){_0xb94ff7=_0xb94ff7-0x0;var _0x5951de=_0x86af[_0xb94ff7];return _0x5951de;};'use strict';var _=require('lodash');var util=require(_0xf86a('0x0'));var moment=require(_0xf86a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf86a('0x2'));var fs=require('fs');var Redis=require(_0xf86a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf86a('0x4'));var logger=require(_0xf86a('0x5'))(_0xf86a('0x6'));var config=require(_0xf86a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf86a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x150dfb,_0x3ea0b8,_0x2c8667){return new BPromise(function(_0x4a25cc,_0x58a892){return client['request'](_0x150dfb,_0x2c8667)[_0xf86a('0x9')](function(_0x58c52e){logger[_0xf86a('0xa')](_0xf86a('0xb'),_0x3ea0b8,_0xf86a('0xc'));logger[_0xf86a('0xd')]('Template,\x20%s,\x20%s,\x20%s',_0x3ea0b8,_0xf86a('0xc'),JSON[_0xf86a('0xe')](_0x58c52e));if(_0x58c52e[_0xf86a('0xf')]){if(_0x58c52e[_0xf86a('0xf')]['code']===0x1f4){logger['error'](_0xf86a('0xb'),_0x3ea0b8,_0x58c52e[_0xf86a('0xf')][_0xf86a('0x10')]);return _0x58a892(_0x58c52e['error'][_0xf86a('0x10')]);}logger['error']('Template,\x20%s,\x20%s',_0x3ea0b8,_0x58c52e[_0xf86a('0xf')][_0xf86a('0x10')]);return _0x4a25cc(_0x58c52e[_0xf86a('0xf')][_0xf86a('0x10')]);}else{logger[_0xf86a('0xa')](_0xf86a('0xb'),_0x3ea0b8,_0xf86a('0xc'));_0x4a25cc(_0x58c52e[_0xf86a('0x11')]['message']);}})['catch'](function(_0x215f61){logger[_0xf86a('0xf')](_0xf86a('0xb'),_0x3ea0b8,_0x215f61);_0x58a892(_0x215f61);});});}exports[_0xf86a('0x12')]=function(_0x34181d){var _0x1052d2=this;return new Promise(function(_0x344588,_0x283424){return db[_0xf86a('0x13')][_0xf86a('0x14')]({'raw':_0x34181d['options']?_0x34181d['options'][_0xf86a('0x15')]===undefined?!![]:![]:!![],'where':_0x34181d['options']?_0x34181d[_0xf86a('0x16')][_0xf86a('0x17')]||null:null,'attributes':_0x34181d[_0xf86a('0x16')]?_0x34181d[_0xf86a('0x16')]['attributes']||null:null,'limit':_0x34181d[_0xf86a('0x16')]?_0x34181d[_0xf86a('0x16')][_0xf86a('0x18')]||null:null,'include':_0x34181d['options']?_0x34181d[_0xf86a('0x16')][_0xf86a('0x19')]?_[_0xf86a('0x1a')](_0x34181d[_0xf86a('0x16')][_0xf86a('0x19')],function(_0x1e27f4){return{'model':db[_0x1e27f4[_0xf86a('0x1b')]],'as':_0x1e27f4['as'],'attributes':_0x1e27f4[_0xf86a('0x1c')],'include':_0x1e27f4[_0xf86a('0x19')]?_[_0xf86a('0x1a')](_0x1e27f4['include'],function(_0x24b8eb){return{'model':db[_0x24b8eb[_0xf86a('0x1b')]],'as':_0x24b8eb['as'],'attributes':_0x24b8eb['attributes'],'include':_0x24b8eb[_0xf86a('0x19')]?_[_0xf86a('0x1a')](_0x24b8eb[_0xf86a('0x19')],function(_0x5729b1){return{'model':db[_0x5729b1[_0xf86a('0x1b')]],'as':_0x5729b1['as'],'attributes':_0x5729b1[_0xf86a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf86a('0x9')](function(_0x24aff4){logger[_0xf86a('0xa')](_0xf86a('0x12'),_0x34181d);logger[_0xf86a('0xd')](_0xf86a('0x12'),_0x34181d,JSON[_0xf86a('0xe')](_0x24aff4));_0x344588(_0x24aff4);})[_0xf86a('0x1d')](function(_0x2bbb2c){logger[_0xf86a('0xf')](_0xf86a('0x12'),_0x2bbb2c[_0xf86a('0x10')],_0x34181d);_0x283424(_0x1052d2[_0xf86a('0xf')](0x1f4,_0x2bbb2c['message']));});});};
\ No newline at end of file
+var _0xfd11=['raw','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Template,\x20%s,\x20%s','request\x20sent','debug','error','message','info','GetTemplate','Template','findAll','options'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0xfd11,0x13a));var _0x1fd1=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0xfd11[_0x1655bb];return _0x5e2020;};'use strict';var _=require('lodash');var util=require(_0x1fd1('0x0'));var moment=require(_0x1fd1('0x1'));var BPromise=require(_0x1fd1('0x2'));var rs=require(_0x1fd1('0x3'));var fs=require('fs');var Redis=require(_0x1fd1('0x4'));var db=require(_0x1fd1('0x5'))['db'];var utils=require(_0x1fd1('0x6'));var logger=require(_0x1fd1('0x7'))(_0x1fd1('0x8'));var config=require('../../config/environment');var jayson=require(_0x1fd1('0x9'));var client=jayson[_0x1fd1('0xa')][_0x1fd1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59ac4b,_0x1ed666,_0x35308b){return new BPromise(function(_0x3d82c2,_0x451127){return client['request'](_0x59ac4b,_0x35308b)['then'](function(_0x51ee4a){logger['info'](_0x1fd1('0xc'),_0x1ed666,_0x1fd1('0xd'));logger[_0x1fd1('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x1ed666,'request\x20sent',JSON['stringify'](_0x51ee4a));if(_0x51ee4a['error']){if(_0x51ee4a[_0x1fd1('0xf')]['code']===0x1f4){logger['error'](_0x1fd1('0xc'),_0x1ed666,_0x51ee4a[_0x1fd1('0xf')][_0x1fd1('0x10')]);return _0x451127(_0x51ee4a[_0x1fd1('0xf')][_0x1fd1('0x10')]);}logger['error'](_0x1fd1('0xc'),_0x1ed666,_0x51ee4a[_0x1fd1('0xf')][_0x1fd1('0x10')]);return _0x3d82c2(_0x51ee4a[_0x1fd1('0xf')]['message']);}else{logger[_0x1fd1('0x11')]('Template,\x20%s,\x20%s',_0x1ed666,_0x1fd1('0xd'));_0x3d82c2(_0x51ee4a['result']['message']);}})['catch'](function(_0x3b0907){logger[_0x1fd1('0xf')](_0x1fd1('0xc'),_0x1ed666,_0x3b0907);_0x451127(_0x3b0907);});});}exports[_0x1fd1('0x12')]=function(_0xd0c3e6){var _0x244de0=this;return new Promise(function(_0x481301,_0x7617b2){return db[_0x1fd1('0x13')][_0x1fd1('0x14')]({'raw':_0xd0c3e6['options']?_0xd0c3e6[_0x1fd1('0x15')][_0x1fd1('0x16')]===undefined?!![]:![]:!![],'where':_0xd0c3e6['options']?_0xd0c3e6['options']['where']||null:null,'attributes':_0xd0c3e6[_0x1fd1('0x15')]?_0xd0c3e6[_0x1fd1('0x15')][_0x1fd1('0x17')]||null:null,'limit':_0xd0c3e6[_0x1fd1('0x15')]?_0xd0c3e6[_0x1fd1('0x15')][_0x1fd1('0x18')]||null:null,'include':_0xd0c3e6[_0x1fd1('0x15')]?_0xd0c3e6[_0x1fd1('0x15')][_0x1fd1('0x19')]?_[_0x1fd1('0x1a')](_0xd0c3e6[_0x1fd1('0x15')][_0x1fd1('0x19')],function(_0x3332ad){return{'model':db[_0x3332ad['model']],'as':_0x3332ad['as'],'attributes':_0x3332ad[_0x1fd1('0x17')],'include':_0x3332ad[_0x1fd1('0x19')]?_[_0x1fd1('0x1a')](_0x3332ad[_0x1fd1('0x19')],function(_0xbb1f52){return{'model':db[_0xbb1f52[_0x1fd1('0x1b')]],'as':_0xbb1f52['as'],'attributes':_0xbb1f52['attributes'],'include':_0xbb1f52['include']?_['map'](_0xbb1f52[_0x1fd1('0x19')],function(_0xdf7d7c){return{'model':db[_0xdf7d7c[_0x1fd1('0x1b')]],'as':_0xdf7d7c['as'],'attributes':_0xdf7d7c[_0x1fd1('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fbead){logger['info']('GetTemplate',_0xd0c3e6);logger[_0x1fd1('0xe')](_0x1fd1('0x12'),_0xd0c3e6,JSON['stringify'](_0x1fbead));_0x481301(_0x1fbead);})['catch'](function(_0x2d416c){logger['error']('GetTemplate',_0x2d416c[_0x1fd1('0x10')],_0xd0c3e6);_0x7617b2(_0x244de0[_0x1fd1('0xf')](0x1f4,_0x2d416c[_0x1fd1('0x10')]));});});};
\ No newline at end of file
index 52598a0..5da730a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa82a=['../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x440def,_0x57a6f1){var _0x250211=function(_0x18c65e){while(--_0x18c65e){_0x440def['push'](_0x440def['shift']());}};_0x250211(++_0x57a6f1);}(_0xa82a,0xeb));var _0xaa82=function(_0x2aaae0,_0x2d2d49){_0x2aaae0=_0x2aaae0-0x0;var _0xb0a9b9=_0xa82a[_0x2aaae0];return _0xb0a9b9;};'use strict';var multer=require(_0xaa82('0x0'));var util=require(_0xaa82('0x1'));var path=require(_0xaa82('0x2'));var timeout=require(_0xaa82('0x3'));var express=require(_0xaa82('0x4'));var router=express[_0xaa82('0x5')]();var fs_extra=require(_0xaa82('0x6'));var auth=require(_0xaa82('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xaa82('0x8'));var controller=require(_0xaa82('0x9'));router['get']('/',auth[_0xaa82('0xa')](),controller[_0xaa82('0xb')]);router[_0xaa82('0xc')](_0xaa82('0xd'),auth[_0xaa82('0xa')](),controller[_0xaa82('0xe')]);router['get'](_0xaa82('0xf'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xaa82('0xc')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xaa82('0x10')]);router[_0xaa82('0xc')](_0xaa82('0x11'),auth['isAuthenticated'](),controller[_0xaa82('0x12')]);router[_0xaa82('0x13')]('/',auth[_0xaa82('0xa')](),controller['create']);router[_0xaa82('0x13')](_0xaa82('0xf'),auth[_0xaa82('0xa')](),controller[_0xaa82('0x14')]);router[_0xaa82('0x13')](_0xaa82('0x15'),auth[_0xaa82('0xa')](),controller[_0xaa82('0x16')]);router['post'](_0xaa82('0x11'),auth[_0xaa82('0xa')](),controller[_0xaa82('0x17')]);router['put'](_0xaa82('0xd'),auth[_0xaa82('0xa')](),controller['update']);router[_0xaa82('0x18')](_0xaa82('0xd'),auth[_0xaa82('0xa')](),controller[_0xaa82('0x19')]);module[_0xaa82('0x1a')]=router;
\ No newline at end of file
+var _0xd403=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/actions','post','create','/:id/any_conditions','addAnyCondition','addAction','put','update','destroy'];(function(_0x1382ed,_0x2016c1){var _0x3bf76e=function(_0x10a92b){while(--_0x10a92b){_0x1382ed['push'](_0x1382ed['shift']());}};_0x3bf76e(++_0x2016c1);}(_0xd403,0x1d5));var _0x3d40=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xd403[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0x3d40('0x0'));var util=require(_0x3d40('0x1'));var path=require(_0x3d40('0x2'));var timeout=require(_0x3d40('0x3'));var express=require('express');var router=express[_0x3d40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3d40('0x5'));var interaction=require(_0x3d40('0x6'));var config=require(_0x3d40('0x7'));var controller=require(_0x3d40('0x8'));router[_0x3d40('0x9')]('/',auth[_0x3d40('0xa')](),controller[_0x3d40('0xb')]);router[_0x3d40('0x9')](_0x3d40('0xc'),auth[_0x3d40('0xa')](),controller[_0x3d40('0xd')]);router[_0x3d40('0x9')](_0x3d40('0xe'),auth[_0x3d40('0xa')](),controller[_0x3d40('0xf')]);router[_0x3d40('0x9')]('/:id/any_conditions',auth[_0x3d40('0xa')](),controller['getAnyConditions']);router[_0x3d40('0x9')](_0x3d40('0x10'),auth[_0x3d40('0xa')](),controller['getActions']);router[_0x3d40('0x11')]('/',auth[_0x3d40('0xa')](),controller[_0x3d40('0x12')]);router['post'](_0x3d40('0xe'),auth[_0x3d40('0xa')](),controller['addAllCondition']);router['post'](_0x3d40('0x13'),auth[_0x3d40('0xa')](),controller[_0x3d40('0x14')]);router['post'](_0x3d40('0x10'),auth[_0x3d40('0xa')](),controller[_0x3d40('0x15')]);router[_0x3d40('0x16')](_0x3d40('0xc'),auth[_0x3d40('0xa')](),controller[_0x3d40('0x17')]);router['delete']('/:id',auth[_0x3d40('0xa')](),controller[_0x3d40('0x18')]);module[_0x3d40('0x19')]=router;
\ No newline at end of file
index e29310d..5385e6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f4c=['sequelize','exports','STRING'];(function(_0x2abd03,_0x15bd78){var _0x397306=function(_0x203b1e){while(--_0x203b1e){_0x2abd03['push'](_0x2abd03['shift']());}};_0x397306(++_0x15bd78);}(_0x4f4c,0x1ef));var _0xc4f4=function(_0x203ddd,_0x476a99){_0x203ddd=_0x203ddd-0x0;var _0xf2de84=_0x4f4c[_0x203ddd];return _0xf2de84;};'use strict';var Sequelize=require(_0xc4f4('0x0'));module[_0xc4f4('0x1')]={'name':{'type':Sequelize[_0xc4f4('0x2')]},'channel':{'type':Sequelize[_0xc4f4('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4718=['BOOLEAN','sequelize','exports','STRING'];(function(_0x641a5a,_0x3973ac){var _0x32d0bb=function(_0x2975b7){while(--_0x2975b7){_0x641a5a['push'](_0x641a5a['shift']());}};_0x32d0bb(++_0x3973ac);}(_0x4718,0x18d));var _0x8471=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x4718[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0x8471('0x0'));module[_0x8471('0x1')]={'name':{'type':Sequelize[_0x8471('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x8471('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 4d2c7ee..ff4fdc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08ce=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','Trigger','includeAll','include','findAll','catch','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring'];(function(_0x249785,_0x17f7d6){var _0x4c8419=function(_0x1abf3c){while(--_0x1abf3c){_0x249785['push'](_0x249785['shift']());}};_0x4c8419(++_0x17f7d6);}(_0x08ce,0x1cc));var _0xe08c=function(_0x566966,_0x6d1752){_0x566966=_0x566966-0x0;var _0x10ae12=_0x08ce[_0x566966];return _0x10ae12;};'use strict';var emlformat=require(_0xe08c('0x0'));var rimraf=require(_0xe08c('0x1'));var zipdir=require(_0xe08c('0x2'));var jsonpatch=require(_0xe08c('0x3'));var rp=require('request-promise');var moment=require(_0xe08c('0x4'));var BPromise=require(_0xe08c('0x5'));var Mustache=require(_0xe08c('0x6'));var util=require(_0xe08c('0x7'));var path=require(_0xe08c('0x8'));var sox=require(_0xe08c('0x9'));var csv=require(_0xe08c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe08c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe08c('0xc'));var deskjs=require(_0xe08c('0xd'));var toCsv=require(_0xe08c('0xa'));var querystring=require(_0xe08c('0xe'));var Papa=require(_0xe08c('0xf'));var Redis=require(_0xe08c('0x10'));var authService=require(_0xe08c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe08c('0x12'));var hardwareService=require(_0xe08c('0x13'));var logger=require(_0xe08c('0x14'))('api');var utils=require(_0xe08c('0x15'));var config=require(_0xe08c('0x16'));var licenseUtil=require(_0xe08c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3242d0,_0x575874){_0x575874=_0x575874||0xcc;return function(_0x376e8f){if(_0x376e8f){return _0x3242d0[_0xe08c('0x18')](_0x575874);}return _0x3242d0['status'](_0x575874)[_0xe08c('0x19')]();};}function respondWithResult(_0x2f4cf3,_0x55ed2f){_0x55ed2f=_0x55ed2f||0xc8;return function(_0x4a911b){if(_0x4a911b){return _0x2f4cf3['status'](_0x55ed2f)[_0xe08c('0x1a')](_0x4a911b);}};}function respondWithFilteredResult(_0x1d219a,_0x2f6e74){return function(_0x3c6cbc){if(_0x3c6cbc){var _0x4b20c9=typeof _0x2f6e74['offset']===_0xe08c('0x1b')&&typeof _0x2f6e74[_0xe08c('0x1c')]==='undefined';var _0x35ec72=_0x3c6cbc['count'];var _0x59c838=_0x4b20c9?0x0:_0x2f6e74['offset'];var _0x2d7402=_0x4b20c9?_0x3c6cbc[_0xe08c('0x1d')]:_0x2f6e74[_0xe08c('0x1e')]+_0x2f6e74[_0xe08c('0x1c')];var _0x3d85be;if(_0x2d7402>=_0x35ec72){_0x2d7402=_0x35ec72;_0x3d85be=0xc8;}else{_0x3d85be=0xce;}_0x1d219a[_0xe08c('0x1f')](_0x3d85be);return _0x1d219a[_0xe08c('0x20')]('Content-Range',_0x59c838+'-'+_0x2d7402+'/'+_0x35ec72)[_0xe08c('0x1a')](_0x3c6cbc);}return null;};}function patchUpdates(_0x51ae6c){return function(_0xf05959){try{jsonpatch[_0xe08c('0x21')](_0xf05959,_0x51ae6c,!![]);}catch(_0x52db15){return BPromise[_0xe08c('0x22')](_0x52db15);}return _0xf05959['save']();};}function saveUpdates(_0x28274d,_0x450383){return function(_0x3d7d2e){if(_0x3d7d2e){return _0x3d7d2e['update'](_0x28274d)[_0xe08c('0x23')](function(_0x339d2e){return _0x339d2e;});}return null;};}function removeEntity(_0x2a9f60,_0x5c5196){return function(_0x5ed409){if(_0x5ed409){return _0x5ed409[_0xe08c('0x24')]()[_0xe08c('0x23')](function(){var _0x398149=_0x5ed409[_0xe08c('0x25')]({'plain':!![]});var _0x148080='Triggers';return db[_0xe08c('0x26')][_0xe08c('0x24')]({'where':{'type':_0x148080,'resourceId':_0x398149['id']}})[_0xe08c('0x23')](function(){return _0x5ed409;});})[_0xe08c('0x23')](function(){_0x2a9f60['status'](0xcc)[_0xe08c('0x19')]();});}};}function handleEntityNotFound(_0x1dd4bc,_0x259e97){return function(_0x5d0464){if(!_0x5d0464){_0x1dd4bc[_0xe08c('0x18')](0x194);}return _0x5d0464;};}function handleError(_0x1514f1,_0x4ebbcb){_0x4ebbcb=_0x4ebbcb||0x1f4;return function(_0x4ba809){logger[_0xe08c('0x27')](_0x4ba809[_0xe08c('0x28')]);if(_0x4ba809[_0xe08c('0x29')]){delete _0x4ba809[_0xe08c('0x29')];}_0x1514f1[_0xe08c('0x1f')](_0x4ebbcb)[_0xe08c('0x2a')](_0x4ba809);};}exports[_0xe08c('0x2b')]=function(_0x4f7de7,_0x222dae){var _0x32807a={},_0x57248b={},_0x4acab4={'count':0x0,'rows':[]};var _0x485698=_[_0xe08c('0x2c')](db['Trigger']['rawAttributes'],function(_0x3c5284){return{'name':_0x3c5284[_0xe08c('0x2d')],'type':_0x3c5284['type'][_0xe08c('0x2e')]};});_0x57248b['model']=_[_0xe08c('0x2c')](_0x485698,_0xe08c('0x29'));_0x57248b[_0xe08c('0x2f')]=_[_0xe08c('0x30')](_0x4f7de7[_0xe08c('0x2f')]);_0x57248b[_0xe08c('0x31')]=_[_0xe08c('0x32')](_0x57248b[_0xe08c('0x33')],_0x57248b['query']);_0x32807a[_0xe08c('0x34')]=_[_0xe08c('0x32')](_0x57248b[_0xe08c('0x33')],qs['fields'](_0x4f7de7[_0xe08c('0x2f')][_0xe08c('0x35')]));_0x32807a['attributes']=_0x32807a['attributes'][_0xe08c('0x36')]?_0x32807a[_0xe08c('0x34')]:_0x57248b[_0xe08c('0x33')];if(!_0x4f7de7[_0xe08c('0x2f')][_0xe08c('0x37')](_0xe08c('0x38'))){_0x32807a[_0xe08c('0x1c')]=qs['limit'](_0x4f7de7[_0xe08c('0x2f')][_0xe08c('0x1c')]);_0x32807a[_0xe08c('0x1e')]=qs[_0xe08c('0x1e')](_0x4f7de7['query'][_0xe08c('0x1e')]);}_0x32807a[_0xe08c('0x39')]=qs[_0xe08c('0x3a')](_0x4f7de7[_0xe08c('0x2f')][_0xe08c('0x3a')]);_0x32807a[_0xe08c('0x3b')]=qs['filters'](_[_0xe08c('0x3c')](_0x4f7de7[_0xe08c('0x2f')],_0x57248b[_0xe08c('0x31')]),_0x485698);if(_0x4f7de7[_0xe08c('0x2f')][_0xe08c('0x3d')]){_0x32807a[_0xe08c('0x3b')]=_[_0xe08c('0x3e')](_0x32807a['where'],{'$or':_['map'](_0x485698,function(_0x2e12fd){if(_0x2e12fd[_0xe08c('0x3f')]!==_0xe08c('0x40')){var _0x126455={};_0x126455[_0x2e12fd[_0xe08c('0x29')]]={'$like':'%'+_0x4f7de7['query'][_0xe08c('0x3d')]+'%'};return _0x126455;}})});}_0x32807a=_[_0xe08c('0x3e')]({},_0x32807a,_0x4f7de7['options']);var _0x4a6ccb={'where':_0x32807a[_0xe08c('0x3b')]};return db[_0xe08c('0x41')][_0xe08c('0x1d')](_0x4a6ccb)[_0xe08c('0x23')](function(_0x3f7f67){_0x4acab4['count']=_0x3f7f67;if(_0x4f7de7[_0xe08c('0x2f')][_0xe08c('0x42')]){_0x32807a[_0xe08c('0x43')]=[{'all':!![]}];}return db[_0xe08c('0x41')][_0xe08c('0x44')](_0x32807a);})['then'](function(_0x213654){_0x4acab4['rows']=_0x213654;return _0x4acab4;})[_0xe08c('0x23')](respondWithFilteredResult(_0x222dae,_0x32807a))[_0xe08c('0x45')](handleError(_0x222dae,null));};exports[_0xe08c('0x46')]=function(_0x52982d,_0x1b188d){var _0x3af58f={'raw':![],'where':{'id':_0x52982d[_0xe08c('0x47')]['id']}},_0x28d2c4={};_0x28d2c4[_0xe08c('0x33')]=_[_0xe08c('0x30')](db['Trigger'][_0xe08c('0x48')]);_0x28d2c4[_0xe08c('0x2f')]=_[_0xe08c('0x30')](_0x52982d[_0xe08c('0x2f')]);_0x28d2c4[_0xe08c('0x31')]=_[_0xe08c('0x32')](_0x28d2c4[_0xe08c('0x33')],_0x28d2c4['query']);_0x3af58f[_0xe08c('0x34')]=_[_0xe08c('0x32')](_0x28d2c4['model'],qs[_0xe08c('0x35')](_0x52982d['query'][_0xe08c('0x35')]));_0x3af58f[_0xe08c('0x34')]=_0x3af58f[_0xe08c('0x34')][_0xe08c('0x36')]?_0x3af58f[_0xe08c('0x34')]:_0x28d2c4[_0xe08c('0x33')];if(_0x52982d[_0xe08c('0x2f')][_0xe08c('0x42')]){_0x3af58f['include']=[{'all':!![]}];}_0x3af58f=_['merge']({},_0x3af58f,_0x52982d[_0xe08c('0x49')]);return db['Trigger']['find'](_0x3af58f)['then'](handleEntityNotFound(_0x1b188d,null))[_0xe08c('0x23')](respondWithResult(_0x1b188d,null))[_0xe08c('0x45')](handleError(_0x1b188d,null));};exports[_0xe08c('0x4a')]=function(_0x52cc05,_0x1bda8f){return db['Trigger']['create'](_0x52cc05[_0xe08c('0x4b')],{})[_0xe08c('0x23')](function(_0x4c864c){var _0x1224ae=_0x52cc05[_0xe08c('0x4c')][_0xe08c('0x25')]({'plain':!![]});if(!_0x1224ae)throw new Error(_0xe08c('0x4d'));if(_0x1224ae[_0xe08c('0x4e')]===_0xe08c('0x4c')){var _0x11f2f9=_0x4c864c[_0xe08c('0x25')]({'plain':!![]});var _0x243856=_0xe08c('0x4f');return db['UserProfileSection'][_0xe08c('0x50')]({'where':{'name':_0x243856,'userProfileId':_0x1224ae[_0xe08c('0x51')]},'raw':!![]})[_0xe08c('0x23')](function(_0x1d76dc){if(_0x1d76dc&&_0x1d76dc[_0xe08c('0x52')]===0x0){return db['UserProfileResource'][_0xe08c('0x4a')]({'name':_0x11f2f9['name'],'resourceId':_0x11f2f9['id'],'type':_0x1d76dc[_0xe08c('0x29')],'sectionId':_0x1d76dc['id']},{})[_0xe08c('0x23')](function(){return _0x4c864c;});}else{return _0x4c864c;}})[_0xe08c('0x45')](function(_0x1c9890){logger[_0xe08c('0x27')](_0xe08c('0x53'),_0x1c9890);throw _0x1c9890;});}return _0x4c864c;})[_0xe08c('0x23')](respondWithResult(_0x1bda8f,0xc9))[_0xe08c('0x45')](handleError(_0x1bda8f,null));};exports[_0xe08c('0x54')]=function(_0x35d6b2,_0x1ee1cb){if(_0x35d6b2[_0xe08c('0x4b')]['id']){delete _0x35d6b2[_0xe08c('0x4b')]['id'];}return db[_0xe08c('0x41')][_0xe08c('0x50')]({'where':{'id':_0x35d6b2['params']['id']}})[_0xe08c('0x23')](handleEntityNotFound(_0x1ee1cb,null))[_0xe08c('0x23')](saveUpdates(_0x35d6b2[_0xe08c('0x4b')],null))[_0xe08c('0x23')](respondWithResult(_0x1ee1cb,null))[_0xe08c('0x45')](handleError(_0x1ee1cb,null));};exports[_0xe08c('0x24')]=function(_0x1d325d,_0x35a913){return db[_0xe08c('0x41')]['find']({'where':{'id':_0x1d325d[_0xe08c('0x47')]['id']}})[_0xe08c('0x23')](handleEntityNotFound(_0x35a913,null))[_0xe08c('0x23')](removeEntity(_0x35a913,null))[_0xe08c('0x45')](handleError(_0x35a913,null));};exports['addAllCondition']=function(_0x3d695a,_0x509d2a,_0x21ed72){if(_0x3d695a[_0xe08c('0x4b')]['id']){delete _0x3d695a[_0xe08c('0x4b')]['id'];}return db['Trigger'][_0xe08c('0x50')]({'where':{'id':_0x3d695a[_0xe08c('0x47')]['id']}})[_0xe08c('0x23')](handleEntityNotFound(_0x509d2a,null))[_0xe08c('0x23')](function(_0x1eecef){if(_0x1eecef){_0x3d695a[_0xe08c('0x4b')][_0xe08c('0x55')]=_0x1eecef['id'];return db[_0xe08c('0x56')][_0xe08c('0x4a')](_0x3d695a[_0xe08c('0x4b')]);}})[_0xe08c('0x23')](respondWithResult(_0x509d2a,null))['catch'](handleError(_0x509d2a,null));};exports['addAnyCondition']=function(_0x2694cb,_0x6fea9c,_0x235f46){if(_0x2694cb[_0xe08c('0x4b')]['id']){delete _0x2694cb[_0xe08c('0x4b')]['id'];}return db['Trigger'][_0xe08c('0x50')]({'where':{'id':_0x2694cb['params']['id']}})[_0xe08c('0x23')](handleEntityNotFound(_0x6fea9c,null))[_0xe08c('0x23')](function(_0xc883b){if(_0xc883b){_0x2694cb['body'][_0xe08c('0x57')]=_0xc883b['id'];return db[_0xe08c('0x56')][_0xe08c('0x4a')](_0x2694cb[_0xe08c('0x4b')]);}})[_0xe08c('0x23')](respondWithResult(_0x6fea9c,null))[_0xe08c('0x45')](handleError(_0x6fea9c,null));};exports[_0xe08c('0x58')]=function(_0x581911,_0x2c3b63,_0xbddad4){var _0x28f2c8={};var _0x2833ae={};var _0xc42c62;var _0x1d78d0;return db['Trigger'][_0xe08c('0x59')]({'where':{'id':_0x581911[_0xe08c('0x47')]['id']}})[_0xe08c('0x23')](handleEntityNotFound(_0x2c3b63,null))[_0xe08c('0x23')](function(_0x139680){if(_0x139680){_0xc42c62=_0x139680;_0x2833ae[_0xe08c('0x33')]=_[_0xe08c('0x30')](db[_0xe08c('0x56')]['rawAttributes']);_0x2833ae[_0xe08c('0x2f')]=_[_0xe08c('0x30')](_0x581911['query']);_0x2833ae['filters']=_[_0xe08c('0x32')](_0x2833ae[_0xe08c('0x33')],_0x2833ae[_0xe08c('0x2f')]);_0x28f2c8[_0xe08c('0x34')]=_[_0xe08c('0x32')](_0x2833ae['model'],qs[_0xe08c('0x35')](_0x581911[_0xe08c('0x2f')][_0xe08c('0x35')]));_0x28f2c8[_0xe08c('0x34')]=_0x28f2c8[_0xe08c('0x34')][_0xe08c('0x36')]?_0x28f2c8[_0xe08c('0x34')]:_0x2833ae[_0xe08c('0x33')];_0x28f2c8['order']=qs[_0xe08c('0x3a')](_0x581911[_0xe08c('0x2f')][_0xe08c('0x3a')]);_0x28f2c8['where']=qs[_0xe08c('0x31')](_[_0xe08c('0x3c')](_0x581911[_0xe08c('0x2f')],_0x2833ae[_0xe08c('0x31')]));if(_0x581911['query']['filter']){_0x28f2c8[_0xe08c('0x3b')]=_[_0xe08c('0x3e')](_0x28f2c8[_0xe08c('0x3b')],{'$or':_['map'](_0x28f2c8[_0xe08c('0x34')],function(_0x97a89c){var _0x14a2d4={};_0x14a2d4[_0x97a89c]={'$like':'%'+_0x581911['query'][_0xe08c('0x3d')]+'%'};return _0x14a2d4;})});}_0x28f2c8=_[_0xe08c('0x3e')]({},_0x28f2c8,_0x581911[_0xe08c('0x49')]);return _0xc42c62[_0xe08c('0x58')](_0x28f2c8);}})[_0xe08c('0x23')](function(_0xde0ad1){if(_0xde0ad1){_0x1d78d0=_0xde0ad1[_0xe08c('0x36')];if(!_0x581911[_0xe08c('0x2f')]['hasOwnProperty']('nolimit')){_0x28f2c8[_0xe08c('0x1c')]=qs[_0xe08c('0x1c')](_0x581911[_0xe08c('0x2f')][_0xe08c('0x1c')]);_0x28f2c8[_0xe08c('0x1e')]=qs[_0xe08c('0x1e')](_0x581911[_0xe08c('0x2f')][_0xe08c('0x1e')]);}return _0xc42c62[_0xe08c('0x58')](_0x28f2c8);}})[_0xe08c('0x23')](function(_0x1454fb){if(_0x1454fb){return _0x1454fb?{'count':_0x1d78d0,'rows':_0x1454fb}:null;}})[_0xe08c('0x23')](respondWithResult(_0x2c3b63,null))['catch'](handleError(_0x2c3b63,null));};exports[_0xe08c('0x5a')]=function(_0x4cc4ed,_0x2ccde3,_0x4bdab3){var _0x287055={};var _0x4202d7={};var _0x263449;var _0x4680ba;return db['Trigger'][_0xe08c('0x59')]({'where':{'id':_0x4cc4ed['params']['id']}})[_0xe08c('0x23')](handleEntityNotFound(_0x2ccde3,null))['then'](function(_0x45c971){if(_0x45c971){_0x263449=_0x45c971;_0x4202d7[_0xe08c('0x33')]=_[_0xe08c('0x30')](db[_0xe08c('0x56')][_0xe08c('0x48')]);_0x4202d7['query']=_[_0xe08c('0x30')](_0x4cc4ed[_0xe08c('0x2f')]);_0x4202d7[_0xe08c('0x31')]=_[_0xe08c('0x32')](_0x4202d7[_0xe08c('0x33')],_0x4202d7['query']);_0x287055[_0xe08c('0x34')]=_[_0xe08c('0x32')](_0x4202d7['model'],qs[_0xe08c('0x35')](_0x4cc4ed['query']['fields']));_0x287055[_0xe08c('0x34')]=_0x287055[_0xe08c('0x34')][_0xe08c('0x36')]?_0x287055[_0xe08c('0x34')]:_0x4202d7[_0xe08c('0x33')];_0x287055[_0xe08c('0x39')]=qs['sort'](_0x4cc4ed['query'][_0xe08c('0x3a')]);_0x287055[_0xe08c('0x3b')]=qs['filters'](_[_0xe08c('0x3c')](_0x4cc4ed[_0xe08c('0x2f')],_0x4202d7[_0xe08c('0x31')]));if(_0x4cc4ed['query'][_0xe08c('0x3d')]){_0x287055[_0xe08c('0x3b')]=_['merge'](_0x287055[_0xe08c('0x3b')],{'$or':_['map'](_0x287055[_0xe08c('0x34')],function(_0x222a11){var _0xb95f31={};_0xb95f31[_0x222a11]={'$like':'%'+_0x4cc4ed['query'][_0xe08c('0x3d')]+'%'};return _0xb95f31;})});}_0x287055=_['merge']({},_0x287055,_0x4cc4ed[_0xe08c('0x49')]);return _0x263449[_0xe08c('0x5a')](_0x287055);}})[_0xe08c('0x23')](function(_0x960335){if(_0x960335){_0x4680ba=_0x960335[_0xe08c('0x36')];if(!_0x4cc4ed[_0xe08c('0x2f')][_0xe08c('0x37')](_0xe08c('0x38'))){_0x287055['limit']=qs[_0xe08c('0x1c')](_0x4cc4ed[_0xe08c('0x2f')][_0xe08c('0x1c')]);_0x287055[_0xe08c('0x1e')]=qs[_0xe08c('0x1e')](_0x4cc4ed[_0xe08c('0x2f')]['offset']);}return _0x263449['getAnyConditions'](_0x287055);}})[_0xe08c('0x23')](function(_0x25234b){if(_0x25234b){return _0x25234b?{'count':_0x4680ba,'rows':_0x25234b}:null;}})[_0xe08c('0x23')](respondWithResult(_0x2ccde3,null))['catch'](handleError(_0x2ccde3,null));};exports[_0xe08c('0x5b')]=function(_0x1520dd,_0x568e19,_0x22ecad){if(_0x1520dd['body']['id']){delete _0x1520dd[_0xe08c('0x4b')]['id'];}return db['Trigger'][_0xe08c('0x50')]({'where':{'id':_0x1520dd[_0xe08c('0x47')]['id']}})[_0xe08c('0x23')](handleEntityNotFound(_0x568e19,null))['then'](function(_0x1ebf86){if(_0x1ebf86){_0x1520dd['body'][_0xe08c('0x5c')]=_0x1ebf86['id'];return db[_0xe08c('0x5d')]['create'](_0x1520dd[_0xe08c('0x4b')]);}})[_0xe08c('0x23')](respondWithResult(_0x568e19,null))[_0xe08c('0x45')](handleError(_0x568e19,null));};exports[_0xe08c('0x5e')]=function(_0x311ddc,_0xf693a9,_0x23bf61){var _0x302358={};var _0x420494={};var _0x1ba274;var _0x1e5d38;return db['Trigger'][_0xe08c('0x59')]({'where':{'id':_0x311ddc[_0xe08c('0x47')]['id']}})[_0xe08c('0x23')](handleEntityNotFound(_0xf693a9,null))['then'](function(_0x47b640){if(_0x47b640){_0x1ba274=_0x47b640;_0x420494[_0xe08c('0x33')]=_[_0xe08c('0x30')](db['Action'][_0xe08c('0x48')]);_0x420494[_0xe08c('0x2f')]=_['keys'](_0x311ddc[_0xe08c('0x2f')]);_0x420494[_0xe08c('0x31')]=_[_0xe08c('0x32')](_0x420494['model'],_0x420494['query']);_0x302358[_0xe08c('0x34')]=_['intersection'](_0x420494[_0xe08c('0x33')],qs[_0xe08c('0x35')](_0x311ddc['query'][_0xe08c('0x35')]));_0x302358[_0xe08c('0x34')]=_0x302358[_0xe08c('0x34')][_0xe08c('0x36')]?_0x302358[_0xe08c('0x34')]:_0x420494[_0xe08c('0x33')];_0x302358[_0xe08c('0x39')]=qs[_0xe08c('0x3a')](_0x311ddc[_0xe08c('0x2f')][_0xe08c('0x3a')]);_0x302358['where']=qs[_0xe08c('0x31')](_[_0xe08c('0x3c')](_0x311ddc[_0xe08c('0x2f')],_0x420494['filters']));if(_0x311ddc[_0xe08c('0x2f')][_0xe08c('0x3d')]){_0x302358[_0xe08c('0x3b')]=_['merge'](_0x302358['where'],{'$or':_[_0xe08c('0x2c')](_0x302358['attributes'],function(_0x42501c){var _0x19e29a={};_0x19e29a[_0x42501c]={'$like':'%'+_0x311ddc['query'][_0xe08c('0x3d')]+'%'};return _0x19e29a;})});}_0x302358=_['merge']({},_0x302358,_0x311ddc[_0xe08c('0x49')]);return _0x1ba274[_0xe08c('0x5e')](_0x302358);}})[_0xe08c('0x23')](function(_0x2644c5){if(_0x2644c5){_0x1e5d38=_0x2644c5[_0xe08c('0x36')];if(!_0x311ddc[_0xe08c('0x2f')][_0xe08c('0x37')]('nolimit')){_0x302358[_0xe08c('0x1c')]=qs[_0xe08c('0x1c')](_0x311ddc[_0xe08c('0x2f')][_0xe08c('0x1c')]);_0x302358[_0xe08c('0x1e')]=qs[_0xe08c('0x1e')](_0x311ddc['query'][_0xe08c('0x1e')]);}return _0x1ba274[_0xe08c('0x5e')](_0x302358);}})[_0xe08c('0x23')](function(_0x39b0ae){if(_0x39b0ae){return _0x39b0ae?{'count':_0x1e5d38,'rows':_0x39b0ae}:null;}})[_0xe08c('0x23')](respondWithResult(_0xf693a9,null))['catch'](handleError(_0xf693a9,null));};
\ No newline at end of file
+var _0xfc0b=['VIRTUAL','filter','includeAll','include','Trigger','rows','show','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','pick','getAllConditions','hasOwnProperty','getAnyConditions','Action','getActions','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','merge','type'];(function(_0x455ef0,_0x26c5a4){var _0x17f8ff=function(_0x5342e8){while(--_0x5342e8){_0x455ef0['push'](_0x455ef0['shift']());}};_0x17f8ff(++_0x26c5a4);}(_0xfc0b,0xdc));var _0xbfc0=function(_0x2f4bdd,_0x426860){_0x2f4bdd=_0x2f4bdd-0x0;var _0x186e45=_0xfc0b[_0x2f4bdd];return _0x186e45;};'use strict';var emlformat=require(_0xbfc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbfc0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbfc0('0x2'));var moment=require('moment');var BPromise=require(_0xbfc0('0x3'));var Mustache=require(_0xbfc0('0x4'));var util=require(_0xbfc0('0x5'));var path=require(_0xbfc0('0x6'));var sox=require(_0xbfc0('0x7'));var csv=require(_0xbfc0('0x8'));var ejs=require(_0xbfc0('0x9'));var fs=require('fs');var fs_extra=require(_0xbfc0('0xa'));var _=require('lodash');var squel=require(_0xbfc0('0xb'));var crypto=require(_0xbfc0('0xc'));var jsforce=require(_0xbfc0('0xd'));var deskjs=require(_0xbfc0('0xe'));var toCsv=require(_0xbfc0('0x8'));var querystring=require('querystring');var Papa=require(_0xbfc0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbfc0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfc0('0x11'))(_0xbfc0('0x12'));var utils=require(_0xbfc0('0x13'));var config=require(_0xbfc0('0x14'));var licenseUtil=require(_0xbfc0('0x15'));var db=require(_0xbfc0('0x16'))['db'];function respondWithStatusCode(_0x34ef31,_0x161e59){_0x161e59=_0x161e59||0xcc;return function(_0x16df8a){if(_0x16df8a){return _0x34ef31[_0xbfc0('0x17')](_0x161e59);}return _0x34ef31[_0xbfc0('0x18')](_0x161e59)[_0xbfc0('0x19')]();};}function respondWithResult(_0x178995,_0x4dcfcb){_0x4dcfcb=_0x4dcfcb||0xc8;return function(_0x232d02){if(_0x232d02){return _0x178995['status'](_0x4dcfcb)[_0xbfc0('0x1a')](_0x232d02);}};}function respondWithFilteredResult(_0xfc68f7,_0x4d5c8f){return function(_0x174df8){if(_0x174df8){var _0x549159=typeof _0x4d5c8f[_0xbfc0('0x1b')]===_0xbfc0('0x1c')&&typeof _0x4d5c8f[_0xbfc0('0x1d')]==='undefined';var _0x4431ae=_0x174df8[_0xbfc0('0x1e')];var _0x123b12=_0x549159?0x0:_0x4d5c8f[_0xbfc0('0x1b')];var _0x4d1c81=_0x549159?_0x174df8['count']:_0x4d5c8f['offset']+_0x4d5c8f['limit'];var _0x265791;if(_0x4d1c81>=_0x4431ae){_0x4d1c81=_0x4431ae;_0x265791=0xc8;}else{_0x265791=0xce;}_0xfc68f7[_0xbfc0('0x18')](_0x265791);return _0xfc68f7['set'](_0xbfc0('0x1f'),_0x123b12+'-'+_0x4d1c81+'/'+_0x4431ae)[_0xbfc0('0x1a')](_0x174df8);}return null;};}function patchUpdates(_0x260374){return function(_0x3a9e27){try{jsonpatch[_0xbfc0('0x20')](_0x3a9e27,_0x260374,!![]);}catch(_0x18f053){return BPromise[_0xbfc0('0x21')](_0x18f053);}return _0x3a9e27[_0xbfc0('0x22')]();};}function saveUpdates(_0x28e51f,_0x2dc691){return function(_0x474811){if(_0x474811){return _0x474811[_0xbfc0('0x23')](_0x28e51f)[_0xbfc0('0x24')](function(_0x9deb5b){return _0x9deb5b;});}return null;};}function removeEntity(_0x29ac0f,_0x3ebc81){return function(_0x8ef6db){if(_0x8ef6db){return _0x8ef6db[_0xbfc0('0x25')]()[_0xbfc0('0x24')](function(){var _0x3401b7=_0x8ef6db[_0xbfc0('0x26')]({'plain':!![]});var _0x2a50cd=_0xbfc0('0x27');return db[_0xbfc0('0x28')][_0xbfc0('0x25')]({'where':{'type':_0x2a50cd,'resourceId':_0x3401b7['id']}})[_0xbfc0('0x24')](function(){return _0x8ef6db;});})[_0xbfc0('0x24')](function(){_0x29ac0f[_0xbfc0('0x18')](0xcc)[_0xbfc0('0x19')]();});}};}function handleEntityNotFound(_0x54b0fe,_0x58e646){return function(_0x283dbf){if(!_0x283dbf){_0x54b0fe[_0xbfc0('0x17')](0x194);}return _0x283dbf;};}function handleError(_0x26707d,_0x238d21){_0x238d21=_0x238d21||0x1f4;return function(_0x428d7f){logger[_0xbfc0('0x29')](_0x428d7f[_0xbfc0('0x2a')]);if(_0x428d7f['name']){delete _0x428d7f[_0xbfc0('0x2b')];}_0x26707d[_0xbfc0('0x18')](_0x238d21)[_0xbfc0('0x2c')](_0x428d7f);};}exports[_0xbfc0('0x2d')]=function(_0xd7fe84,_0x5f0f69){var _0xe15292={},_0x4319eb={},_0x761237={'count':0x0,'rows':[]};var _0x1f70ea=_['map'](db['Trigger'][_0xbfc0('0x2e')],function(_0x5e6da8){return{'name':_0x5e6da8[_0xbfc0('0x2f')],'type':_0x5e6da8['type'][_0xbfc0('0x30')]};});_0x4319eb['model']=_[_0xbfc0('0x31')](_0x1f70ea,_0xbfc0('0x2b'));_0x4319eb[_0xbfc0('0x32')]=_['keys'](_0xd7fe84[_0xbfc0('0x32')]);_0x4319eb[_0xbfc0('0x33')]=_[_0xbfc0('0x34')](_0x4319eb[_0xbfc0('0x35')],_0x4319eb['query']);_0xe15292['attributes']=_['intersection'](_0x4319eb[_0xbfc0('0x35')],qs['fields'](_0xd7fe84['query'][_0xbfc0('0x36')]));_0xe15292[_0xbfc0('0x37')]=_0xe15292[_0xbfc0('0x37')][_0xbfc0('0x38')]?_0xe15292[_0xbfc0('0x37')]:_0x4319eb[_0xbfc0('0x35')];if(!_0xd7fe84[_0xbfc0('0x32')]['hasOwnProperty'](_0xbfc0('0x39'))){_0xe15292[_0xbfc0('0x1d')]=qs[_0xbfc0('0x1d')](_0xd7fe84['query'][_0xbfc0('0x1d')]);_0xe15292[_0xbfc0('0x1b')]=qs['offset'](_0xd7fe84[_0xbfc0('0x32')][_0xbfc0('0x1b')]);}_0xe15292['order']=qs['sort'](_0xd7fe84[_0xbfc0('0x32')][_0xbfc0('0x3a')]);_0xe15292[_0xbfc0('0x3b')]=qs[_0xbfc0('0x33')](_['pick'](_0xd7fe84[_0xbfc0('0x32')],_0x4319eb['filters']),_0x1f70ea);if(_0xd7fe84[_0xbfc0('0x32')]['filter']){_0xe15292[_0xbfc0('0x3b')]=_[_0xbfc0('0x3c')](_0xe15292['where'],{'$or':_['map'](_0x1f70ea,function(_0x59d920){if(_0x59d920[_0xbfc0('0x3d')]!==_0xbfc0('0x3e')){var _0x3e83ef={};_0x3e83ef[_0x59d920[_0xbfc0('0x2b')]]={'$like':'%'+_0xd7fe84['query'][_0xbfc0('0x3f')]+'%'};return _0x3e83ef;}})});}_0xe15292=_[_0xbfc0('0x3c')]({},_0xe15292,_0xd7fe84['options']);var _0x20decd={'where':_0xe15292[_0xbfc0('0x3b')]};return db['Trigger'][_0xbfc0('0x1e')](_0x20decd)[_0xbfc0('0x24')](function(_0x2b3507){_0x761237[_0xbfc0('0x1e')]=_0x2b3507;if(_0xd7fe84[_0xbfc0('0x32')][_0xbfc0('0x40')]){_0xe15292[_0xbfc0('0x41')]=[{'all':!![]}];}return db[_0xbfc0('0x42')]['findAll'](_0xe15292);})[_0xbfc0('0x24')](function(_0x15cf39){_0x761237[_0xbfc0('0x43')]=_0x15cf39;return _0x761237;})['then'](respondWithFilteredResult(_0x5f0f69,_0xe15292))['catch'](handleError(_0x5f0f69,null));};exports[_0xbfc0('0x44')]=function(_0x191e8c,_0x440048){var _0x228c74={'raw':![],'where':{'id':_0x191e8c[_0xbfc0('0x45')]['id']}},_0x46de80={};_0x46de80['model']=_[_0xbfc0('0x46')](db[_0xbfc0('0x42')][_0xbfc0('0x2e')]);_0x46de80[_0xbfc0('0x32')]=_['keys'](_0x191e8c[_0xbfc0('0x32')]);_0x46de80[_0xbfc0('0x33')]=_[_0xbfc0('0x34')](_0x46de80['model'],_0x46de80[_0xbfc0('0x32')]);_0x228c74[_0xbfc0('0x37')]=_[_0xbfc0('0x34')](_0x46de80[_0xbfc0('0x35')],qs[_0xbfc0('0x36')](_0x191e8c['query'][_0xbfc0('0x36')]));_0x228c74[_0xbfc0('0x37')]=_0x228c74['attributes']['length']?_0x228c74[_0xbfc0('0x37')]:_0x46de80[_0xbfc0('0x35')];if(_0x191e8c['query'][_0xbfc0('0x40')]){_0x228c74[_0xbfc0('0x41')]=[{'all':!![]}];}_0x228c74=_['merge']({},_0x228c74,_0x191e8c[_0xbfc0('0x47')]);return db[_0xbfc0('0x42')][_0xbfc0('0x48')](_0x228c74)[_0xbfc0('0x24')](handleEntityNotFound(_0x440048,null))['then'](respondWithResult(_0x440048,null))[_0xbfc0('0x49')](handleError(_0x440048,null));};exports[_0xbfc0('0x4a')]=function(_0x25098e,_0x172a37){return db[_0xbfc0('0x42')][_0xbfc0('0x4a')](_0x25098e[_0xbfc0('0x4b')],{})[_0xbfc0('0x24')](function(_0x541e60){var _0x39baf3=_0x25098e[_0xbfc0('0x4c')][_0xbfc0('0x26')]({'plain':!![]});if(!_0x39baf3)throw new Error(_0xbfc0('0x4d'));if(_0x39baf3['role']===_0xbfc0('0x4c')){var _0x655b8d=_0x541e60[_0xbfc0('0x26')]({'plain':!![]});var _0x5d613a=_0xbfc0('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x5d613a,'userProfileId':_0x39baf3[_0xbfc0('0x4e')]},'raw':!![]})[_0xbfc0('0x24')](function(_0xc9d0f3){if(_0xc9d0f3&&_0xc9d0f3[_0xbfc0('0x4f')]===0x0){return db[_0xbfc0('0x28')][_0xbfc0('0x4a')]({'name':_0x655b8d[_0xbfc0('0x2b')],'resourceId':_0x655b8d['id'],'type':_0xc9d0f3[_0xbfc0('0x2b')],'sectionId':_0xc9d0f3['id']},{})[_0xbfc0('0x24')](function(){return _0x541e60;});}else{return _0x541e60;}})[_0xbfc0('0x49')](function(_0xe28c58){logger['error'](_0xbfc0('0x50'),_0xe28c58);throw _0xe28c58;});}return _0x541e60;})[_0xbfc0('0x24')](respondWithResult(_0x172a37,0xc9))[_0xbfc0('0x49')](handleError(_0x172a37,null));};exports[_0xbfc0('0x23')]=function(_0x56bb73,_0x193a61){if(_0x56bb73[_0xbfc0('0x4b')]['id']){delete _0x56bb73['body']['id'];}return db[_0xbfc0('0x42')][_0xbfc0('0x48')]({'where':{'id':_0x56bb73[_0xbfc0('0x45')]['id']}})[_0xbfc0('0x24')](handleEntityNotFound(_0x193a61,null))[_0xbfc0('0x24')](saveUpdates(_0x56bb73[_0xbfc0('0x4b')],null))[_0xbfc0('0x24')](respondWithResult(_0x193a61,null))[_0xbfc0('0x49')](handleError(_0x193a61,null));};exports[_0xbfc0('0x25')]=function(_0x6159f5,_0x4a87d9){return db[_0xbfc0('0x42')][_0xbfc0('0x48')]({'where':{'id':_0x6159f5[_0xbfc0('0x45')]['id']}})[_0xbfc0('0x24')](handleEntityNotFound(_0x4a87d9,null))[_0xbfc0('0x24')](removeEntity(_0x4a87d9,null))[_0xbfc0('0x49')](handleError(_0x4a87d9,null));};exports[_0xbfc0('0x51')]=function(_0x3f4959,_0x375d42,_0x444191){if(_0x3f4959[_0xbfc0('0x4b')]['id']){delete _0x3f4959[_0xbfc0('0x4b')]['id'];}return db[_0xbfc0('0x42')]['find']({'where':{'id':_0x3f4959[_0xbfc0('0x45')]['id']}})[_0xbfc0('0x24')](handleEntityNotFound(_0x375d42,null))[_0xbfc0('0x24')](function(_0x1b1051){if(_0x1b1051){_0x3f4959[_0xbfc0('0x4b')][_0xbfc0('0x52')]=_0x1b1051['id'];return db[_0xbfc0('0x53')][_0xbfc0('0x4a')](_0x3f4959['body']);}})[_0xbfc0('0x24')](respondWithResult(_0x375d42,null))[_0xbfc0('0x49')](handleError(_0x375d42,null));};exports[_0xbfc0('0x54')]=function(_0x222b2f,_0x1410d7,_0x3f84b1){if(_0x222b2f['body']['id']){delete _0x222b2f[_0xbfc0('0x4b')]['id'];}return db['Trigger']['find']({'where':{'id':_0x222b2f[_0xbfc0('0x45')]['id']}})[_0xbfc0('0x24')](handleEntityNotFound(_0x1410d7,null))[_0xbfc0('0x24')](function(_0x254ba9){if(_0x254ba9){_0x222b2f[_0xbfc0('0x4b')][_0xbfc0('0x55')]=_0x254ba9['id'];return db[_0xbfc0('0x53')][_0xbfc0('0x4a')](_0x222b2f[_0xbfc0('0x4b')]);}})[_0xbfc0('0x24')](respondWithResult(_0x1410d7,null))[_0xbfc0('0x49')](handleError(_0x1410d7,null));};exports['getAllConditions']=function(_0x1cfc4e,_0x4e21e7,_0x59a3f2){var _0x2d99de={};var _0x5dc2d7={};var _0x36e093;var _0x33afaa;return db[_0xbfc0('0x42')][_0xbfc0('0x56')]({'where':{'id':_0x1cfc4e['params']['id']}})[_0xbfc0('0x24')](handleEntityNotFound(_0x4e21e7,null))[_0xbfc0('0x24')](function(_0xd0f92){if(_0xd0f92){_0x36e093=_0xd0f92;_0x5dc2d7[_0xbfc0('0x35')]=_[_0xbfc0('0x46')](db['Condition'][_0xbfc0('0x2e')]);_0x5dc2d7['query']=_[_0xbfc0('0x46')](_0x1cfc4e['query']);_0x5dc2d7[_0xbfc0('0x33')]=_[_0xbfc0('0x34')](_0x5dc2d7[_0xbfc0('0x35')],_0x5dc2d7['query']);_0x2d99de[_0xbfc0('0x37')]=_['intersection'](_0x5dc2d7[_0xbfc0('0x35')],qs[_0xbfc0('0x36')](_0x1cfc4e['query'][_0xbfc0('0x36')]));_0x2d99de[_0xbfc0('0x37')]=_0x2d99de['attributes'][_0xbfc0('0x38')]?_0x2d99de[_0xbfc0('0x37')]:_0x5dc2d7[_0xbfc0('0x35')];_0x2d99de[_0xbfc0('0x57')]=qs[_0xbfc0('0x3a')](_0x1cfc4e[_0xbfc0('0x32')][_0xbfc0('0x3a')]);_0x2d99de[_0xbfc0('0x3b')]=qs['filters'](_[_0xbfc0('0x58')](_0x1cfc4e[_0xbfc0('0x32')],_0x5dc2d7[_0xbfc0('0x33')]));if(_0x1cfc4e['query'][_0xbfc0('0x3f')]){_0x2d99de[_0xbfc0('0x3b')]=_['merge'](_0x2d99de['where'],{'$or':_[_0xbfc0('0x31')](_0x2d99de[_0xbfc0('0x37')],function(_0x4e5a2f){var _0x1da2d7={};_0x1da2d7[_0x4e5a2f]={'$like':'%'+_0x1cfc4e[_0xbfc0('0x32')][_0xbfc0('0x3f')]+'%'};return _0x1da2d7;})});}_0x2d99de=_['merge']({},_0x2d99de,_0x1cfc4e[_0xbfc0('0x47')]);return _0x36e093[_0xbfc0('0x59')](_0x2d99de);}})['then'](function(_0x1e61df){if(_0x1e61df){_0x33afaa=_0x1e61df[_0xbfc0('0x38')];if(!_0x1cfc4e[_0xbfc0('0x32')][_0xbfc0('0x5a')](_0xbfc0('0x39'))){_0x2d99de['limit']=qs[_0xbfc0('0x1d')](_0x1cfc4e[_0xbfc0('0x32')][_0xbfc0('0x1d')]);_0x2d99de[_0xbfc0('0x1b')]=qs[_0xbfc0('0x1b')](_0x1cfc4e['query'][_0xbfc0('0x1b')]);}return _0x36e093[_0xbfc0('0x59')](_0x2d99de);}})[_0xbfc0('0x24')](function(_0x338889){if(_0x338889){return _0x338889?{'count':_0x33afaa,'rows':_0x338889}:null;}})[_0xbfc0('0x24')](respondWithResult(_0x4e21e7,null))['catch'](handleError(_0x4e21e7,null));};exports[_0xbfc0('0x5b')]=function(_0x532b42,_0x462ba6,_0x4ae370){var _0x8dfdcc={};var _0x3d23dd={};var _0x3d9082;var _0x38d70a;return db[_0xbfc0('0x42')][_0xbfc0('0x56')]({'where':{'id':_0x532b42['params']['id']}})['then'](handleEntityNotFound(_0x462ba6,null))[_0xbfc0('0x24')](function(_0x427de2){if(_0x427de2){_0x3d9082=_0x427de2;_0x3d23dd['model']=_['keys'](db['Condition'][_0xbfc0('0x2e')]);_0x3d23dd[_0xbfc0('0x32')]=_[_0xbfc0('0x46')](_0x532b42['query']);_0x3d23dd[_0xbfc0('0x33')]=_['intersection'](_0x3d23dd[_0xbfc0('0x35')],_0x3d23dd['query']);_0x8dfdcc[_0xbfc0('0x37')]=_[_0xbfc0('0x34')](_0x3d23dd[_0xbfc0('0x35')],qs[_0xbfc0('0x36')](_0x532b42[_0xbfc0('0x32')][_0xbfc0('0x36')]));_0x8dfdcc['attributes']=_0x8dfdcc[_0xbfc0('0x37')]['length']?_0x8dfdcc[_0xbfc0('0x37')]:_0x3d23dd[_0xbfc0('0x35')];_0x8dfdcc[_0xbfc0('0x57')]=qs[_0xbfc0('0x3a')](_0x532b42[_0xbfc0('0x32')][_0xbfc0('0x3a')]);_0x8dfdcc[_0xbfc0('0x3b')]=qs[_0xbfc0('0x33')](_['pick'](_0x532b42[_0xbfc0('0x32')],_0x3d23dd[_0xbfc0('0x33')]));if(_0x532b42['query'][_0xbfc0('0x3f')]){_0x8dfdcc['where']=_['merge'](_0x8dfdcc[_0xbfc0('0x3b')],{'$or':_['map'](_0x8dfdcc[_0xbfc0('0x37')],function(_0x5840ba){var _0x4cdbf4={};_0x4cdbf4[_0x5840ba]={'$like':'%'+_0x532b42['query']['filter']+'%'};return _0x4cdbf4;})});}_0x8dfdcc=_[_0xbfc0('0x3c')]({},_0x8dfdcc,_0x532b42['options']);return _0x3d9082[_0xbfc0('0x5b')](_0x8dfdcc);}})['then'](function(_0x1c20af){if(_0x1c20af){_0x38d70a=_0x1c20af[_0xbfc0('0x38')];if(!_0x532b42[_0xbfc0('0x32')][_0xbfc0('0x5a')](_0xbfc0('0x39'))){_0x8dfdcc[_0xbfc0('0x1d')]=qs[_0xbfc0('0x1d')](_0x532b42['query'][_0xbfc0('0x1d')]);_0x8dfdcc[_0xbfc0('0x1b')]=qs['offset'](_0x532b42[_0xbfc0('0x32')][_0xbfc0('0x1b')]);}return _0x3d9082[_0xbfc0('0x5b')](_0x8dfdcc);}})[_0xbfc0('0x24')](function(_0x46cfbd){if(_0x46cfbd){return _0x46cfbd?{'count':_0x38d70a,'rows':_0x46cfbd}:null;}})['then'](respondWithResult(_0x462ba6,null))[_0xbfc0('0x49')](handleError(_0x462ba6,null));};exports['addAction']=function(_0x241d48,_0x3c3014,_0x21c4ed){if(_0x241d48[_0xbfc0('0x4b')]['id']){delete _0x241d48['body']['id'];}return db[_0xbfc0('0x42')][_0xbfc0('0x48')]({'where':{'id':_0x241d48[_0xbfc0('0x45')]['id']}})[_0xbfc0('0x24')](handleEntityNotFound(_0x3c3014,null))[_0xbfc0('0x24')](function(_0x194aec){if(_0x194aec){_0x241d48[_0xbfc0('0x4b')]['TriggerId']=_0x194aec['id'];return db[_0xbfc0('0x5c')]['create'](_0x241d48[_0xbfc0('0x4b')]);}})['then'](respondWithResult(_0x3c3014,null))['catch'](handleError(_0x3c3014,null));};exports['getActions']=function(_0x9e1b76,_0x460b10,_0x1987a0){var _0xd55d25={};var _0x278d39={};var _0xb4484a;var _0x179490;return db[_0xbfc0('0x42')][_0xbfc0('0x56')]({'where':{'id':_0x9e1b76[_0xbfc0('0x45')]['id']}})['then'](handleEntityNotFound(_0x460b10,null))[_0xbfc0('0x24')](function(_0x10a916){if(_0x10a916){_0xb4484a=_0x10a916;_0x278d39[_0xbfc0('0x35')]=_['keys'](db[_0xbfc0('0x5c')][_0xbfc0('0x2e')]);_0x278d39[_0xbfc0('0x32')]=_[_0xbfc0('0x46')](_0x9e1b76[_0xbfc0('0x32')]);_0x278d39['filters']=_[_0xbfc0('0x34')](_0x278d39['model'],_0x278d39[_0xbfc0('0x32')]);_0xd55d25[_0xbfc0('0x37')]=_['intersection'](_0x278d39[_0xbfc0('0x35')],qs[_0xbfc0('0x36')](_0x9e1b76[_0xbfc0('0x32')][_0xbfc0('0x36')]));_0xd55d25[_0xbfc0('0x37')]=_0xd55d25[_0xbfc0('0x37')][_0xbfc0('0x38')]?_0xd55d25[_0xbfc0('0x37')]:_0x278d39[_0xbfc0('0x35')];_0xd55d25[_0xbfc0('0x57')]=qs['sort'](_0x9e1b76[_0xbfc0('0x32')][_0xbfc0('0x3a')]);_0xd55d25[_0xbfc0('0x3b')]=qs[_0xbfc0('0x33')](_['pick'](_0x9e1b76[_0xbfc0('0x32')],_0x278d39[_0xbfc0('0x33')]));if(_0x9e1b76[_0xbfc0('0x32')][_0xbfc0('0x3f')]){_0xd55d25[_0xbfc0('0x3b')]=_[_0xbfc0('0x3c')](_0xd55d25[_0xbfc0('0x3b')],{'$or':_['map'](_0xd55d25[_0xbfc0('0x37')],function(_0x4a655c){var _0x38bac7={};_0x38bac7[_0x4a655c]={'$like':'%'+_0x9e1b76[_0xbfc0('0x32')][_0xbfc0('0x3f')]+'%'};return _0x38bac7;})});}_0xd55d25=_[_0xbfc0('0x3c')]({},_0xd55d25,_0x9e1b76['options']);return _0xb4484a[_0xbfc0('0x5d')](_0xd55d25);}})[_0xbfc0('0x24')](function(_0x1c7908){if(_0x1c7908){_0x179490=_0x1c7908['length'];if(!_0x9e1b76[_0xbfc0('0x32')]['hasOwnProperty'](_0xbfc0('0x39'))){_0xd55d25[_0xbfc0('0x1d')]=qs['limit'](_0x9e1b76[_0xbfc0('0x32')]['limit']);_0xd55d25[_0xbfc0('0x1b')]=qs[_0xbfc0('0x1b')](_0x9e1b76[_0xbfc0('0x32')][_0xbfc0('0x1b')]);}return _0xb4484a[_0xbfc0('0x5d')](_0xd55d25);}})[_0xbfc0('0x24')](function(_0x121d03){if(_0x121d03){return _0x121d03?{'count':_0x179490,'rows':_0x121d03}:null;}})[_0xbfc0('0x24')](respondWithResult(_0x460b10,null))['catch'](handleError(_0x460b10,null));};
\ No newline at end of file
index 5772735..3c91dcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','path','./trigger.attributes','exports','define'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x4ea3,0x70));var _0x34ea=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4ea3[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));module[_0x34ea('0x7')]=function(_0x962596,_0x123d48){return _0x962596[_0x34ea('0x8')](_0x34ea('0x9'),attributes,{'tableName':_0x34ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x394e=['../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x207101,_0x87ce3){var _0x2b3ef8=function(_0x591af7){while(--_0x591af7){_0x207101['push'](_0x207101['shift']());}};_0x2b3ef8(++_0x87ce3);}(_0x394e,0x88));var _0xe394=function(_0x42546d,_0x4b060a){_0x42546d=_0x42546d-0x0;var _0x5cac5b=_0x394e[_0x42546d];return _0x5cac5b;};'use strict';var _=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var logger=require('../../config/logger')(_0xe394('0x2'));var moment=require(_0xe394('0x3'));var BPromise=require(_0xe394('0x4'));var rp=require(_0xe394('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe394('0x6'));var config=require(_0xe394('0x7'));var attributes=require(_0xe394('0x8'));module[_0xe394('0x9')]=function(_0x2a4db6,_0x272c30){return _0x2a4db6[_0xe394('0xa')](_0xe394('0xb'),attributes,{'tableName':_0xe394('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7d48372..105a92f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f17=['then','ShowTrigger','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','catch','find','where'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6f17,0x1a6));var _0x76f1=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x6f17[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x76f1('0x0'));var rs=require(_0x76f1('0x1'));var fs=require('fs');var Redis=require(_0x76f1('0x2'));var db=require(_0x76f1('0x3'))['db'];var utils=require(_0x76f1('0x4'));var logger=require('../../config/logger')(_0x76f1('0x5'));var config=require(_0x76f1('0x6'));var jayson=require(_0x76f1('0x7'));var client=jayson[_0x76f1('0x8')][_0x76f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44e147,_0xfbf961,_0x3e56a8){return new BPromise(function(_0x16586c,_0x4a086c){return client[_0x76f1('0xa')](_0x44e147,_0x3e56a8)['then'](function(_0x43778c){logger[_0x76f1('0xb')]('Trigger,\x20%s,\x20%s',_0xfbf961,_0x76f1('0xc'));logger[_0x76f1('0xd')](_0x76f1('0xe'),_0xfbf961,'request\x20sent',JSON[_0x76f1('0xf')](_0x43778c));if(_0x43778c[_0x76f1('0x10')]){if(_0x43778c['error']['code']===0x1f4){logger[_0x76f1('0x10')](_0x76f1('0x11'),_0xfbf961,_0x43778c[_0x76f1('0x10')][_0x76f1('0x12')]);return _0x4a086c(_0x43778c['error'][_0x76f1('0x12')]);}logger[_0x76f1('0x10')]('Trigger,\x20%s,\x20%s',_0xfbf961,_0x43778c[_0x76f1('0x10')][_0x76f1('0x12')]);return _0x16586c(_0x43778c[_0x76f1('0x10')][_0x76f1('0x12')]);}else{logger[_0x76f1('0xb')](_0x76f1('0x11'),_0xfbf961,_0x76f1('0xc'));_0x16586c(_0x43778c[_0x76f1('0x13')][_0x76f1('0x12')]);}})['catch'](function(_0x41f5b1){logger['error']('Trigger,\x20%s,\x20%s',_0xfbf961,_0x41f5b1);_0x4a086c(_0x41f5b1);});});}exports[_0x76f1('0x14')]=function(_0x506413){var _0xa08b17=this;return new Promise(function(_0x32fc49,_0x164d53){return db[_0x76f1('0x15')][_0x76f1('0x16')]({'raw':_0x506413[_0x76f1('0x17')]?_0x506413[_0x76f1('0x17')][_0x76f1('0x18')]===undefined?!![]:![]:!![],'where':_0x506413[_0x76f1('0x17')]?_0x506413[_0x76f1('0x17')]['where']||null:null,'attributes':_0x506413[_0x76f1('0x17')]?_0x506413[_0x76f1('0x17')][_0x76f1('0x19')]||null:null,'limit':_0x506413[_0x76f1('0x17')]?_0x506413[_0x76f1('0x17')][_0x76f1('0x1a')]||null:null,'include':_0x506413[_0x76f1('0x17')]?_0x506413[_0x76f1('0x17')][_0x76f1('0x1b')]?_[_0x76f1('0x1c')](_0x506413['options']['include'],function(_0x517fdc){return{'model':db[_0x517fdc[_0x76f1('0x1d')]],'as':_0x517fdc['as'],'attributes':_0x517fdc['attributes'],'include':_0x517fdc['include']?_['map'](_0x517fdc['include'],function(_0x519e13){return{'model':db[_0x519e13[_0x76f1('0x1d')]],'as':_0x519e13['as'],'attributes':_0x519e13['attributes'],'include':_0x519e13[_0x76f1('0x1b')]?_[_0x76f1('0x1c')](_0x519e13['include'],function(_0x5ea085){return{'model':db[_0x5ea085['model']],'as':_0x5ea085['as'],'attributes':_0x5ea085['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c280c){logger[_0x76f1('0xb')]('GetTrigger',_0x506413);logger[_0x76f1('0xd')](_0x76f1('0x14'),_0x506413,JSON['stringify'](_0x2c280c));_0x32fc49(_0x2c280c);})[_0x76f1('0x1e')](function(_0x36e8af){logger[_0x76f1('0x10')](_0x76f1('0x14'),_0x36e8af[_0x76f1('0x12')],_0x506413);_0x164d53(_0xa08b17['error'](0x1f4,_0x36e8af[_0x76f1('0x12')]));});});};exports['ShowTrigger']=function(_0x77f2e2){var _0x34f81f=this;return new Promise(function(_0x100e16,_0x778ad2){return db['Trigger'][_0x76f1('0x1f')]({'raw':_0x77f2e2[_0x76f1('0x17')]?_0x77f2e2['options']['raw']===undefined?!![]:![]:!![],'where':_0x77f2e2[_0x76f1('0x17')]?_0x77f2e2[_0x76f1('0x17')][_0x76f1('0x20')]||null:null,'attributes':_0x77f2e2[_0x76f1('0x17')]?_0x77f2e2[_0x76f1('0x17')][_0x76f1('0x19')]||null:null,'include':_0x77f2e2[_0x76f1('0x17')]?_0x77f2e2['options'][_0x76f1('0x1b')]?_[_0x76f1('0x1c')](_0x77f2e2[_0x76f1('0x17')]['include'],function(_0x400cfe){return{'model':db[_0x400cfe[_0x76f1('0x1d')]],'as':_0x400cfe['as'],'attributes':_0x400cfe[_0x76f1('0x19')],'include':_0x400cfe['include']?_[_0x76f1('0x1c')](_0x400cfe[_0x76f1('0x1b')],function(_0x4101f0){return{'model':db[_0x4101f0['model']],'as':_0x4101f0['as'],'attributes':_0x4101f0['attributes'],'include':_0x4101f0['include']?_[_0x76f1('0x1c')](_0x4101f0[_0x76f1('0x1b')],function(_0x216a73){return{'model':db[_0x216a73[_0x76f1('0x1d')]],'as':_0x216a73['as'],'attributes':_0x216a73[_0x76f1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x76f1('0x21')](function(_0x5627a6){logger['info'](_0x76f1('0x22'),_0x77f2e2);logger[_0x76f1('0xd')](_0x76f1('0x22'),_0x77f2e2,JSON[_0x76f1('0xf')](_0x5627a6));_0x100e16(_0x5627a6);})['catch'](function(_0x490f46){logger['error'](_0x76f1('0x22'),_0x490f46[_0x76f1('0x12')],_0x77f2e2);_0x778ad2(_0x34f81f[_0x76f1('0x10')](0x1f4,_0x490f46[_0x76f1('0x12')]));});});};
\ No newline at end of file
+var _0x8aa5=['http','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','map','include','model','find','then','ShowTrigger','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x17a469,_0x36944c){var _0x284ebd=function(_0xd86277){while(--_0xd86277){_0x17a469['push'](_0x17a469['shift']());}};_0x284ebd(++_0x36944c);}(_0x8aa5,0x1c5));var _0x58aa=function(_0x5151ea,_0x2785){_0x5151ea=_0x5151ea-0x0;var _0x1977d8=_0x8aa5[_0x5151ea];return _0x1977d8;};'use strict';var _=require(_0x58aa('0x0'));var util=require(_0x58aa('0x1'));var moment=require('moment');var BPromise=require(_0x58aa('0x2'));var rs=require(_0x58aa('0x3'));var fs=require('fs');var Redis=require(_0x58aa('0x4'));var db=require(_0x58aa('0x5'))['db'];var utils=require(_0x58aa('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x58aa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x58aa('0x8')][_0x58aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16469b,_0x21be26,_0x42de14){return new BPromise(function(_0x487004,_0x133937){return client['request'](_0x16469b,_0x42de14)['then'](function(_0x4a3cc9){logger[_0x58aa('0xa')](_0x58aa('0xb'),_0x21be26,_0x58aa('0xc'));logger[_0x58aa('0xd')](_0x58aa('0xe'),_0x21be26,_0x58aa('0xc'),JSON['stringify'](_0x4a3cc9));if(_0x4a3cc9[_0x58aa('0xf')]){if(_0x4a3cc9[_0x58aa('0xf')][_0x58aa('0x10')]===0x1f4){logger[_0x58aa('0xf')](_0x58aa('0xb'),_0x21be26,_0x4a3cc9[_0x58aa('0xf')]['message']);return _0x133937(_0x4a3cc9[_0x58aa('0xf')][_0x58aa('0x11')]);}logger[_0x58aa('0xf')]('Trigger,\x20%s,\x20%s',_0x21be26,_0x4a3cc9[_0x58aa('0xf')][_0x58aa('0x11')]);return _0x487004(_0x4a3cc9[_0x58aa('0xf')][_0x58aa('0x11')]);}else{logger['info'](_0x58aa('0xb'),_0x21be26,_0x58aa('0xc'));_0x487004(_0x4a3cc9['result'][_0x58aa('0x11')]);}})[_0x58aa('0x12')](function(_0x4ba8f9){logger[_0x58aa('0xf')](_0x58aa('0xb'),_0x21be26,_0x4ba8f9);_0x133937(_0x4ba8f9);});});}exports[_0x58aa('0x13')]=function(_0x3ab015){var _0x2bfce1=this;return new Promise(function(_0x209363,_0x1f4051){return db[_0x58aa('0x14')][_0x58aa('0x15')]({'raw':_0x3ab015[_0x58aa('0x16')]?_0x3ab015['options'][_0x58aa('0x17')]===undefined?!![]:![]:!![],'where':_0x3ab015['options']?_0x3ab015['options'][_0x58aa('0x18')]||null:null,'attributes':_0x3ab015[_0x58aa('0x16')]?_0x3ab015[_0x58aa('0x16')][_0x58aa('0x19')]||null:null,'limit':_0x3ab015[_0x58aa('0x16')]?_0x3ab015[_0x58aa('0x16')][_0x58aa('0x1a')]||null:null,'include':_0x3ab015[_0x58aa('0x16')]?_0x3ab015['options']['include']?_[_0x58aa('0x1b')](_0x3ab015[_0x58aa('0x16')][_0x58aa('0x1c')],function(_0x273056){return{'model':db[_0x273056[_0x58aa('0x1d')]],'as':_0x273056['as'],'attributes':_0x273056[_0x58aa('0x19')],'include':_0x273056[_0x58aa('0x1c')]?_[_0x58aa('0x1b')](_0x273056[_0x58aa('0x1c')],function(_0x8a18c4){return{'model':db[_0x8a18c4[_0x58aa('0x1d')]],'as':_0x8a18c4['as'],'attributes':_0x8a18c4[_0x58aa('0x19')],'include':_0x8a18c4['include']?_[_0x58aa('0x1b')](_0x8a18c4['include'],function(_0x11e5cf){return{'model':db[_0x11e5cf[_0x58aa('0x1d')]],'as':_0x11e5cf['as'],'attributes':_0x11e5cf[_0x58aa('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c39ec){logger[_0x58aa('0xa')](_0x58aa('0x13'),_0x3ab015);logger[_0x58aa('0xd')](_0x58aa('0x13'),_0x3ab015,JSON['stringify'](_0x1c39ec));_0x209363(_0x1c39ec);})[_0x58aa('0x12')](function(_0x5bf6c8){logger[_0x58aa('0xf')](_0x58aa('0x13'),_0x5bf6c8[_0x58aa('0x11')],_0x3ab015);_0x1f4051(_0x2bfce1[_0x58aa('0xf')](0x1f4,_0x5bf6c8['message']));});});};exports['ShowTrigger']=function(_0x38008e){var _0x5c4956=this;return new Promise(function(_0x4e056e,_0x4b6207){return db[_0x58aa('0x14')][_0x58aa('0x1e')]({'raw':_0x38008e[_0x58aa('0x16')]?_0x38008e['options'][_0x58aa('0x17')]===undefined?!![]:![]:!![],'where':_0x38008e[_0x58aa('0x16')]?_0x38008e[_0x58aa('0x16')][_0x58aa('0x18')]||null:null,'attributes':_0x38008e['options']?_0x38008e['options']['attributes']||null:null,'include':_0x38008e[_0x58aa('0x16')]?_0x38008e[_0x58aa('0x16')]['include']?_[_0x58aa('0x1b')](_0x38008e[_0x58aa('0x16')][_0x58aa('0x1c')],function(_0x97520f){return{'model':db[_0x97520f[_0x58aa('0x1d')]],'as':_0x97520f['as'],'attributes':_0x97520f[_0x58aa('0x19')],'include':_0x97520f[_0x58aa('0x1c')]?_[_0x58aa('0x1b')](_0x97520f[_0x58aa('0x1c')],function(_0x18e7e0){return{'model':db[_0x18e7e0[_0x58aa('0x1d')]],'as':_0x18e7e0['as'],'attributes':_0x18e7e0[_0x58aa('0x19')],'include':_0x18e7e0[_0x58aa('0x1c')]?_[_0x58aa('0x1b')](_0x18e7e0[_0x58aa('0x1c')],function(_0x4d202a){return{'model':db[_0x4d202a['model']],'as':_0x4d202a['as'],'attributes':_0x4d202a[_0x58aa('0x19')]};}):[]};}):[]};}):[]:[]})[_0x58aa('0x1f')](function(_0xddc8c3){logger['info'](_0x58aa('0x20'),_0x38008e);logger[_0x58aa('0xd')](_0x58aa('0x20'),_0x38008e,JSON['stringify'](_0xddc8c3));_0x4e056e(_0xddc8c3);})[_0x58aa('0x12')](function(_0x2e6258){logger[_0x58aa('0xf')](_0x58aa('0x20'),_0x2e6258[_0x58aa('0x11')],_0x38008e);_0x4b6207(_0x5c4956['error'](0x1f4,_0x2e6258['message']));});});};
\ No newline at end of file
index 81434a4..fb9ea91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc604=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','post'];(function(_0x32f8a2,_0x49c502){var _0x258cca=function(_0x1040e4){while(--_0x1040e4){_0x32f8a2['push'](_0x32f8a2['shift']());}};_0x258cca(++_0x49c502);}(_0xc604,0x108));var _0x4c60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc604[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4c60('0x0'));var util=require(_0x4c60('0x1'));var path=require(_0x4c60('0x2'));var timeout=require(_0x4c60('0x3'));var express=require('express');var router=express[_0x4c60('0x4')]();var fs_extra=require(_0x4c60('0x5'));var auth=require(_0x4c60('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4c60('0x7'));router[_0x4c60('0x8')]('/',auth[_0x4c60('0x9')](),controller[_0x4c60('0xa')]);router[_0x4c60('0x8')](_0x4c60('0xb'),auth[_0x4c60('0x9')](),controller[_0x4c60('0xc')]);router['post'](_0x4c60('0xd'),auth[_0x4c60('0x9')](),controller[_0x4c60('0xe')]);router[_0x4c60('0xf')]('/',auth[_0x4c60('0x9')](),controller['create']);router[_0x4c60('0x10')](_0x4c60('0xb'),auth['isAuthenticated'](),controller[_0x4c60('0x11')]);router['delete'](_0x4c60('0xb'),auth['isAuthenticated'](),controller[_0x4c60('0x12')]);module[_0x4c60('0x13')]=router;
\ No newline at end of file
+var _0x86fb=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post','/:id/clone','clone','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86fb,0x17e));var _0xb86f=function(_0x44c483,_0x3ecd43){_0x44c483=_0x44c483-0x0;var _0x2a528f=_0x86fb[_0x44c483];return _0x2a528f;};'use strict';var multer=require('multer');var util=require(_0xb86f('0x0'));var path=require('path');var timeout=require(_0xb86f('0x1'));var express=require(_0xb86f('0x2'));var router=express[_0xb86f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb86f('0x4'));var interaction=require(_0xb86f('0x5'));var config=require(_0xb86f('0x6'));var controller=require(_0xb86f('0x7'));router[_0xb86f('0x8')]('/',auth['isAuthenticated'](),controller[_0xb86f('0x9')]);router['get'](_0xb86f('0xa'),auth[_0xb86f('0xb')](),controller[_0xb86f('0xc')]);router[_0xb86f('0xd')](_0xb86f('0xe'),auth[_0xb86f('0xb')](),controller[_0xb86f('0xf')]);router[_0xb86f('0xd')]('/',auth[_0xb86f('0xb')](),controller['create']);router[_0xb86f('0x10')](_0xb86f('0xa'),auth[_0xb86f('0xb')](),controller[_0xb86f('0x11')]);router[_0xb86f('0x12')](_0xb86f('0xa'),auth['isAuthenticated'](),controller[_0xb86f('0x13')]);module['exports']=router;
\ No newline at end of file
index 8cf66e6..de771c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdc2=['update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','fingerprint','certificate','active','passive','actpass','BOOLEAN','sequelize','exports','STRING','name','ENUM','peer','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','nonat'];(function(_0x150be3,_0x437842){var _0x3d84c3=function(_0xa366fd){while(--_0xa366fd){_0x150be3['push'](_0x150be3['shift']());}};_0x3d84c3(++_0x437842);}(_0xcdc2,0x153));var _0x2cdc=function(_0x3b505a,_0x2b4f31){_0x3b505a=_0x3b505a-0x0;var _0x749cd7=_0xcdc2[_0x3b505a];return _0x749cd7;};'use strict';var Sequelize=require(_0x2cdc('0x0'));module[_0x2cdc('0x1')]={'name':{'type':Sequelize[_0x2cdc('0x2')],'allowNull':![],'unique':_0x2cdc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2cdc('0x4')]('friend','user',_0x2cdc('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x2cdc('0x4')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x2cdc('0x6'),_0x2cdc('0x7'),'PROHIB_PASSED_SCREEN',_0x2cdc('0x8'),_0x2cdc('0x9'))},'deny':{'type':Sequelize[_0x2cdc('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x2cdc('0x2')]},'remotesecret':{'type':Sequelize[_0x2cdc('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x2cdc('0xa'),'set':function(_0x285585){this[_0x2cdc('0xb')](_0x2cdc('0xc'),_0x285585?_0x285585[_0x2cdc('0xd')](','):null);},'get':function(){return this[_0x2cdc('0xe')](_0x2cdc('0xc'))?this[_0x2cdc('0xe')](_0x2cdc('0xc'))['split'](','):null;},'comment':_0x2cdc('0xf')},'dtmfmode':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x10'),_0x2cdc('0x11'),'shortinfo','inband',_0x2cdc('0x12')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x2cdc('0x13'),'no',_0x2cdc('0x14'),_0x2cdc('0x15'),_0x2cdc('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x2cdc('0x2')],'defaultValue':_0x2cdc('0x17'),'set':function(_0x533a5e){this['setDataValue'](_0x2cdc('0x18'),_0x533a5e?_0x533a5e[_0x2cdc('0xd')](','):null);},'get':function(){return this[_0x2cdc('0xe')](_0x2cdc('0x18'))?this[_0x2cdc('0xe')](_0x2cdc('0x18'))['split'](','):null;},'comment':_0x2cdc('0x19')},'callgroup':{'type':Sequelize[_0x2cdc('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x2cdc('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2cdc('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2cdc('0x2')],'defaultValue':_0x2cdc('0x1a')},'allow':{'type':Sequelize[_0x2cdc('0x2')],'allowNull':![],'defaultValue':_0x2cdc('0x1b'),'set':function(_0x3e8eea){this['setDataValue'](_0x2cdc('0x1c'),_0x3e8eea?_0x3e8eea['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x2cdc('0xe')](_0x2cdc('0x1c'))?this[_0x2cdc('0xe')](_0x2cdc('0x1c'))['split'](';'):null;},'comment':_0x2cdc('0x1d')},'autoframing':{'type':Sequelize[_0x2cdc('0x4')]('yes','no')},'insecure':{'type':Sequelize[_0x2cdc('0x2')],'defaultValue':'port,invite','set':function(_0x10e480){this[_0x2cdc('0xb')](_0x2cdc('0x1e'),_0x10e480?_0x10e480[_0x2cdc('0xd')](','):null);},'get':function(){return this['getDataValue'](_0x2cdc('0x1e'))?this[_0x2cdc('0xe')](_0x2cdc('0x1e'))[_0x2cdc('0x1f')](','):null;},'comment':_0x2cdc('0x20')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no',_0x2cdc('0x21'))},'promiscredir':{'type':Sequelize[_0x2cdc('0x4')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x2cdc('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x2cdc('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x2cdc('0x2')]},'callcounter':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no'),'defaultValue':_0x2cdc('0x13')},'busylevel':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x2cdc('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no')},'allowtransfer':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2cdc('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x2cdc('0x2')]},'template':{'type':Sequelize[_0x2cdc('0x2')]},'videosupport':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no',_0x2cdc('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no')},'mailbox':{'type':Sequelize[_0x2cdc('0x2')]},'session_timers':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x24'),_0x2cdc('0x25'),'originate')},'session_expires':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x26'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x2cdc('0x2')]},'fromdomain':{'type':Sequelize[_0x2cdc('0x2')]},'fromuser':{'type':Sequelize[_0x2cdc('0x2')]},'port':{'type':Sequelize[_0x2cdc('0x22')](0x5)},'qualify':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no'),'defaultValue':_0x2cdc('0x13')},'keepalive':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x2cdc('0x2')]},'defaultuser':{'type':Sequelize[_0x2cdc('0x2')]},'rtptimeout':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2cdc('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x2cdc('0x2')]},'contactdeny':{'type':Sequelize[_0x2cdc('0x2')]},'contactacl':{'type':Sequelize[_0x2cdc('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x2cdc('0x2')]},'use_q850_reason':{'type':Sequelize[_0x2cdc('0x2')]},'maxforwards':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'encryption':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x2cdc('0x13'),'no')},'force_avp':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no')},'icesupport':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no',_0x2cdc('0x27'),_0x2cdc('0x28'))},'dtlsrekey':{'type':Sequelize[_0x2cdc('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2cdc('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x2cdc('0x2')]},'dtlscipher':{'type':Sequelize[_0x2cdc('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x2cdc('0x2')]},'dtlssetup':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x29'),_0x2cdc('0x2a'),_0x2cdc('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2cdc('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x2cdc('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2cdc('0x2')]},'recordofffeature':{'type':Sequelize[_0x2cdc('0x2')]},'call_limit':{'type':Sequelize[_0x2cdc('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2cdc('0x4')](_0x2cdc('0x13'),'no')},'subscribemwi':{'type':Sequelize[_0x2cdc('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x2cdc('0x2')]},'mohinterpret':{'type':Sequelize[_0x2cdc('0x2')]},'mohsuggest':{'type':Sequelize[_0x2cdc('0x2')]},'parkinglot':{'type':Sequelize[_0x2cdc('0x2')]},'description':{'type':Sequelize[_0x2cdc('0x2')]},'host':{'type':Sequelize[_0x2cdc('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x2cdc('0x13'),'no',_0x2cdc('0x14'),_0x2cdc('0x15'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x2cdc('0x2')]},'active':{'type':Sequelize[_0x2cdc('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
+var _0x395b=['ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','split','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','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN'];(function(_0x5378d6,_0x56e817){var _0x2a8e49=function(_0x1e74cd){while(--_0x1e74cd){_0x5378d6['push'](_0x5378d6['shift']());}};_0x2a8e49(++_0x56e817);}(_0x395b,0xca));var _0xb395=function(_0xec1b03,_0x1ed76f){_0xec1b03=_0xec1b03-0x0;var _0x140c51=_0x395b[_0xec1b03];return _0x140c51;};'use strict';var Sequelize=require(_0xb395('0x0'));module['exports']={'name':{'type':Sequelize[_0xb395('0x1')],'allowNull':![],'unique':_0xb395('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x4'),_0xb395('0x5'),_0xb395('0x6')),'allowNull':![],'defaultValue':_0xb395('0x4')},'context':{'type':Sequelize[_0xb395('0x1')],'allowNull':![],'defaultValue':_0xb395('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0xb395('0x8'),_0xb395('0x9'),'ALLOWED_FAILED_SCREEN',_0xb395('0xa'),'PROHIB_NOT_SCREENED',_0xb395('0xb'),'PROHIB_FAILED_SCREEN',_0xb395('0xc'))},'deny':{'type':Sequelize[_0xb395('0x1')]},'permit':{'type':Sequelize[_0xb395('0x1')]},'secret':{'type':Sequelize[_0xb395('0x1')]},'md5secret':{'type':Sequelize[_0xb395('0x1')]},'remotesecret':{'type':Sequelize[_0xb395('0x1')]},'transport':{'type':Sequelize[_0xb395('0x1')],'defaultValue':'udp','set':function(_0xc34a61){this[_0xb395('0xd')](_0xb395('0xe'),_0xc34a61?_0xc34a61[_0xb395('0xf')](','):null);},'get':function(){return this[_0xb395('0x10')]('transport')?this[_0xb395('0x10')](_0xb395('0xe'))['split'](','):null;},'comment':_0xb395('0x11')},'dtmfmode':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x12'),_0xb395('0x13'),_0xb395('0x14'),_0xb395('0x15'),_0xb395('0x16')),'defaultValue':_0xb395('0x12')},'directmedia':{'type':Sequelize[_0xb395('0x3')]('yes','no','nonat',_0xb395('0x17'),_0xb395('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xb395('0x1')],'defaultValue':_0xb395('0x1a'),'set':function(_0x3f2a41){this[_0xb395('0xd')](_0xb395('0x1b'),_0x3f2a41?_0x3f2a41[_0xb395('0xf')](','):null);},'get':function(){return this[_0xb395('0x10')](_0xb395('0x1b'))?this['getDataValue'](_0xb395('0x1b'))['split'](','):null;},'comment':_0xb395('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xb395('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xb395('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb395('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb395('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xb395('0x1')],'allowNull':![],'defaultValue':_0xb395('0x1d'),'set':function(_0x248286){this[_0xb395('0xd')]('allow',_0x248286?_0x248286[_0xb395('0xf')](';'):_0xb395('0x1d'));},'get':function(){return this[_0xb395('0x10')](_0xb395('0x1e'))?this['getDataValue']('allow')[_0xb395('0x1f')](';'):null;},'comment':_0xb395('0x20')},'autoframing':{'type':Sequelize['ENUM'](_0xb395('0x19'),'no')},'insecure':{'type':Sequelize[_0xb395('0x1')],'defaultValue':_0xb395('0x21'),'set':function(_0x4a940d){this[_0xb395('0xd')](_0xb395('0x22'),_0x4a940d?_0x4a940d['join'](','):null);},'get':function(){return this['getDataValue'](_0xb395('0x22'))?this['getDataValue']('insecure')[_0xb395('0x1f')](','):null;},'comment':_0xb395('0x23')},'trustrpid':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb395('0x3')]('yes','no',_0xb395('0x24'))},'promiscredir':{'type':Sequelize['ENUM'](_0xb395('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xb395('0x19'),'no')},'accountcode':{'type':Sequelize[_0xb395('0x25')](0xb)},'setvar':{'type':Sequelize[_0xb395('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xb395('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xb395('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xb395('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xb395('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0xb395('0x19'),'no',_0xb395('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb395('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb395('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xb395('0x1')]},'session_timers':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x28'),_0xb395('0x29'),_0xb395('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xb395('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xb395('0x3')]('uac',_0xb395('0x2b')),'defaultValue':_0xb395('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xb395('0x1')]},'regexten':{'type':Sequelize[_0xb395('0x1')]},'fromdomain':{'type':Sequelize[_0xb395('0x1')]},'fromuser':{'type':Sequelize[_0xb395('0x1')]},'port':{'type':Sequelize[_0xb395('0x25')](0x5)},'qualify':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xb395('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xb395('0x1')]},'defaultuser':{'type':Sequelize[_0xb395('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb395('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xb395('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no',_0xb395('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xb395('0x1')]},'timert1':{'type':Sequelize[_0xb395('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xb395('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xb395('0x1')]},'contactdeny':{'type':Sequelize[_0xb395('0x1')]},'contactacl':{'type':Sequelize[_0xb395('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xb395('0x1')]},'use_q850_reason':{'type':Sequelize[_0xb395('0x1')]},'maxforwards':{'type':Sequelize[_0xb395('0x25')](0xb)},'encryption':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xb395('0x19'),'no')},'force_avp':{'type':Sequelize[_0xb395('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0xb395('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no',_0xb395('0x2d'),_0xb395('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xb395('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xb395('0x1')]},'dtlscipher':{'type':Sequelize[_0xb395('0x1')]},'dtlscafile':{'type':Sequelize[_0xb395('0x1')]},'dtlscapath':{'type':Sequelize[_0xb395('0x1')]},'dtlssetup':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x2f'),_0xb395('0x30'),_0xb395('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb395('0x1')]},'usereqphone':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb395('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xb395('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb395('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no')},'vmexten':{'type':Sequelize[_0xb395('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xb395('0x1')]},'parkinglot':{'type':Sequelize[_0xb395('0x1')]},'description':{'type':Sequelize[_0xb395('0x1')]},'host':{'type':Sequelize[_0xb395('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xb395('0x3')](_0xb395('0x19'),'no',_0xb395('0x32'),_0xb395('0x17'),_0xb395('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb395('0x1')]},'otherFields':{'type':Sequelize[_0xb395('0x1')]},'active':{'type':Sequelize[_0xb395('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb395('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index d70c884..0ec9e02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x1ad12c,_0x5bd618){var _0xb60e0f=function(_0x9fb490){while(--_0x9fb490){_0x1ad12c['push'](_0x1ad12c['shift']());}};_0xb60e0f(++_0x5bd618);}(_0xe5b3,0x133));var _0x3e5b=function(_0x3fea8b,_0x9d130){_0x3fea8b=_0x3fea8b-0x0;var _0x22d5be=_0xe5b3[_0x3fea8b];return _0x22d5be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));};
\ No newline at end of file
+var _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x377df8,_0x42c66d){var _0x29508d=function(_0x2ea871){while(--_0x2ea871){_0x377df8['push'](_0x377df8['shift']());}};_0x29508d(++_0x42c66d);}(_0xa41a,0x6b));var _0xaa41=function(_0x4366a3,_0x4e8c2f){_0x4366a3=_0x4366a3-0x0;var _0x357319=_0xa41a[_0x4366a3];return _0x357319;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));};
\ No newline at end of file
index 75eef2f..e4e5e9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43f7=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger'];(function(_0x1fd4d7,_0x2feafd){var _0x7efe8a=function(_0xc54f55){while(--_0xc54f55){_0x1fd4d7['push'](_0x1fd4d7['shift']());}};_0x7efe8a(++_0x2feafd);}(_0x43f7,0xc1));var _0x743f=function(_0x22a832,_0x572f1f){_0x22a832=_0x22a832-0x0;var _0x2b3e03=_0x43f7[_0x22a832];return _0x2b3e03;};'use strict';var _=require('lodash');var util=require(_0x743f('0x0'));var logger=require(_0x743f('0x1'))(_0x743f('0x2'));var moment=require(_0x743f('0x3'));var BPromise=require(_0x743f('0x4'));var rp=require(_0x743f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x743f('0x6'));var config=require(_0x743f('0x7'));var attributes=require(_0x743f('0x8'));module[_0x743f('0x9')]=function(_0x5b6717,_0x5c09fb){return _0x5b6717[_0x743f('0xa')](_0x743f('0xb'),attributes,{'tableName':_0x743f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b50=['request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','bluebird'];(function(_0x4d6ac0,_0x201628){var _0x5296c4=function(_0x3d0b3d){while(--_0x3d0b3d){_0x4d6ac0['push'](_0x4d6ac0['shift']());}};_0x5296c4(++_0x201628);}(_0x0b50,0x7e));var _0x00b5=function(_0x18daeb,_0x1b8ff3){_0x18daeb=_0x18daeb-0x0;var _0x425a30=_0x0b50[_0x18daeb];return _0x425a30;};'use strict';var _=require(_0x00b5('0x0'));var util=require(_0x00b5('0x1'));var logger=require(_0x00b5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x00b5('0x3'));var rp=require(_0x00b5('0x4'));var fs=require('fs');var path=require(_0x00b5('0x5'));var rimraf=require(_0x00b5('0x6'));var config=require(_0x00b5('0x7'));var attributes=require(_0x00b5('0x8'));module[_0x00b5('0x9')]=function(_0x28175d,_0x15deae){return _0x28175d[_0x00b5('0xa')](_0x00b5('0xb'),attributes,{'tableName':_0x00b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e70fe15..50a2fa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f7e=['find','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrunk','Trunk','findAll','options','raw','where','limit','include','map','attributes','model','catch','ShowTrunk'];(function(_0x43e5d1,_0x1425b7){var _0x318d01=function(_0x3ccf06){while(--_0x3ccf06){_0x43e5d1['push'](_0x43e5d1['shift']());}};_0x318d01(++_0x1425b7);}(_0x3f7e,0x1d5));var _0xe3f7=function(_0x5ba7ca,_0x4ad0a1){_0x5ba7ca=_0x5ba7ca-0x0;var _0x426561=_0x3f7e[_0x5ba7ca];return _0x426561;};'use strict';var _=require('lodash');var util=require(_0xe3f7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe3f7('0x1'));var fs=require('fs');var Redis=require(_0xe3f7('0x2'));var db=require(_0xe3f7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3f7('0x4'))(_0xe3f7('0x5'));var config=require(_0xe3f7('0x6'));var jayson=require(_0xe3f7('0x7'));var client=jayson[_0xe3f7('0x8')][_0xe3f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26ba7f,_0x547f97,_0x564966){return new BPromise(function(_0x53eda5,_0x4266e1){return client[_0xe3f7('0xa')](_0x26ba7f,_0x564966)[_0xe3f7('0xb')](function(_0x4390c4){logger[_0xe3f7('0xc')](_0xe3f7('0xd'),_0x547f97,_0xe3f7('0xe'));logger[_0xe3f7('0xf')](_0xe3f7('0x10'),_0x547f97,_0xe3f7('0xe'),JSON[_0xe3f7('0x11')](_0x4390c4));if(_0x4390c4[_0xe3f7('0x12')]){if(_0x4390c4[_0xe3f7('0x12')][_0xe3f7('0x13')]===0x1f4){logger[_0xe3f7('0x12')](_0xe3f7('0xd'),_0x547f97,_0x4390c4[_0xe3f7('0x12')]['message']);return _0x4266e1(_0x4390c4[_0xe3f7('0x12')]['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x547f97,_0x4390c4['error'][_0xe3f7('0x14')]);return _0x53eda5(_0x4390c4[_0xe3f7('0x12')][_0xe3f7('0x14')]);}else{logger[_0xe3f7('0xc')](_0xe3f7('0xd'),_0x547f97,'request\x20sent');_0x53eda5(_0x4390c4[_0xe3f7('0x15')]['message']);}})['catch'](function(_0x2f2e70){logger['error'](_0xe3f7('0xd'),_0x547f97,_0x2f2e70);_0x4266e1(_0x2f2e70);});});}exports[_0xe3f7('0x16')]=function(_0x20d294){var _0x1518a4=this;return new Promise(function(_0xc2aec4,_0x1e642e){return db[_0xe3f7('0x17')][_0xe3f7('0x18')]({'raw':_0x20d294[_0xe3f7('0x19')]?_0x20d294[_0xe3f7('0x19')][_0xe3f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x20d294['options']?_0x20d294[_0xe3f7('0x19')][_0xe3f7('0x1b')]||null:null,'attributes':_0x20d294[_0xe3f7('0x19')]?_0x20d294['options']['attributes']||null:null,'limit':_0x20d294['options']?_0x20d294[_0xe3f7('0x19')][_0xe3f7('0x1c')]||null:null,'include':_0x20d294[_0xe3f7('0x19')]?_0x20d294[_0xe3f7('0x19')][_0xe3f7('0x1d')]?_[_0xe3f7('0x1e')](_0x20d294[_0xe3f7('0x19')][_0xe3f7('0x1d')],function(_0x24ff86){return{'model':db[_0x24ff86['model']],'as':_0x24ff86['as'],'attributes':_0x24ff86[_0xe3f7('0x1f')],'include':_0x24ff86[_0xe3f7('0x1d')]?_[_0xe3f7('0x1e')](_0x24ff86['include'],function(_0x19d9f8){return{'model':db[_0x19d9f8[_0xe3f7('0x20')]],'as':_0x19d9f8['as'],'attributes':_0x19d9f8[_0xe3f7('0x1f')],'include':_0x19d9f8[_0xe3f7('0x1d')]?_['map'](_0x19d9f8['include'],function(_0xb3d7d5){return{'model':db[_0xb3d7d5[_0xe3f7('0x20')]],'as':_0xb3d7d5['as'],'attributes':_0xb3d7d5[_0xe3f7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe3f7('0xb')](function(_0x42f746){logger['info'](_0xe3f7('0x16'),_0x20d294);logger[_0xe3f7('0xf')](_0xe3f7('0x16'),_0x20d294,JSON[_0xe3f7('0x11')](_0x42f746));_0xc2aec4(_0x42f746);})[_0xe3f7('0x21')](function(_0x323c89){logger[_0xe3f7('0x12')](_0xe3f7('0x16'),_0x323c89[_0xe3f7('0x14')],_0x20d294);_0x1e642e(_0x1518a4[_0xe3f7('0x12')](0x1f4,_0x323c89[_0xe3f7('0x14')]));});});};exports[_0xe3f7('0x22')]=function(_0x5df990){var _0x2e7140=this;return new Promise(function(_0x3c3119,_0x56da6f){return db[_0xe3f7('0x17')][_0xe3f7('0x23')]({'raw':_0x5df990[_0xe3f7('0x19')]?_0x5df990[_0xe3f7('0x19')][_0xe3f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x5df990[_0xe3f7('0x19')]?_0x5df990[_0xe3f7('0x19')][_0xe3f7('0x1b')]||null:null,'attributes':_0x5df990[_0xe3f7('0x19')]?_0x5df990[_0xe3f7('0x19')][_0xe3f7('0x1f')]||null:null,'include':_0x5df990[_0xe3f7('0x19')]?_0x5df990[_0xe3f7('0x19')][_0xe3f7('0x1d')]?_[_0xe3f7('0x1e')](_0x5df990[_0xe3f7('0x19')][_0xe3f7('0x1d')],function(_0xd3a154){return{'model':db[_0xd3a154[_0xe3f7('0x20')]],'as':_0xd3a154['as'],'attributes':_0xd3a154[_0xe3f7('0x1f')],'include':_0xd3a154[_0xe3f7('0x1d')]?_[_0xe3f7('0x1e')](_0xd3a154['include'],function(_0x53a050){return{'model':db[_0x53a050[_0xe3f7('0x20')]],'as':_0x53a050['as'],'attributes':_0x53a050[_0xe3f7('0x1f')],'include':_0x53a050['include']?_[_0xe3f7('0x1e')](_0x53a050[_0xe3f7('0x1d')],function(_0x3859d7){return{'model':db[_0x3859d7['model']],'as':_0x3859d7['as'],'attributes':_0x3859d7[_0xe3f7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe3f7('0xb')](function(_0x3ab17e){logger[_0xe3f7('0xc')](_0xe3f7('0x22'),_0x5df990);logger['debug'](_0xe3f7('0x22'),_0x5df990,JSON[_0xe3f7('0x11')](_0x3ab17e));_0x3c3119(_0x3ab17e);})[_0xe3f7('0x21')](function(_0x195b6b){logger[_0xe3f7('0x12')](_0xe3f7('0x22'),_0x195b6b['message'],_0x5df990);_0x56da6f(_0x2e7140[_0xe3f7('0x12')](0x1f4,_0x195b6b['message']));});});};
\ No newline at end of file
+var _0x2cee=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetTrunk','options','raw','where','limit','include','map','model','attributes','then','ShowTrunk'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x2cee,0x6d));var _0xe2ce=function(_0x1ff46d,_0x2d948e){_0x1ff46d=_0x1ff46d-0x0;var _0x45c12e=_0x2cee[_0x1ff46d];return _0x45c12e;};'use strict';var _=require(_0xe2ce('0x0'));var util=require(_0xe2ce('0x1'));var moment=require(_0xe2ce('0x2'));var BPromise=require(_0xe2ce('0x3'));var rs=require(_0xe2ce('0x4'));var fs=require('fs');var Redis=require(_0xe2ce('0x5'));var db=require(_0xe2ce('0x6'))['db'];var utils=require(_0xe2ce('0x7'));var logger=require(_0xe2ce('0x8'))(_0xe2ce('0x9'));var config=require(_0xe2ce('0xa'));var jayson=require(_0xe2ce('0xb'));var client=jayson[_0xe2ce('0xc')][_0xe2ce('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d1629,_0x1d12ef,_0x13a52e){return new BPromise(function(_0x27686c,_0xd2835){return client[_0xe2ce('0xe')](_0x4d1629,_0x13a52e)['then'](function(_0xd03a99){logger[_0xe2ce('0xf')](_0xe2ce('0x10'),_0x1d12ef,_0xe2ce('0x11'));logger[_0xe2ce('0x12')]('Trunk,\x20%s,\x20%s,\x20%s',_0x1d12ef,_0xe2ce('0x11'),JSON[_0xe2ce('0x13')](_0xd03a99));if(_0xd03a99['error']){if(_0xd03a99['error'][_0xe2ce('0x14')]===0x1f4){logger[_0xe2ce('0x15')](_0xe2ce('0x10'),_0x1d12ef,_0xd03a99[_0xe2ce('0x15')][_0xe2ce('0x16')]);return _0xd2835(_0xd03a99['error'][_0xe2ce('0x16')]);}logger[_0xe2ce('0x15')](_0xe2ce('0x10'),_0x1d12ef,_0xd03a99[_0xe2ce('0x15')][_0xe2ce('0x16')]);return _0x27686c(_0xd03a99['error'][_0xe2ce('0x16')]);}else{logger[_0xe2ce('0xf')]('Trunk,\x20%s,\x20%s',_0x1d12ef,_0xe2ce('0x11'));_0x27686c(_0xd03a99['result']['message']);}})[_0xe2ce('0x17')](function(_0x212a25){logger[_0xe2ce('0x15')](_0xe2ce('0x10'),_0x1d12ef,_0x212a25);_0xd2835(_0x212a25);});});}exports[_0xe2ce('0x18')]=function(_0xc40262){var _0x13673b=this;return new Promise(function(_0x5b5f07,_0x1b94c1){return db['Trunk']['findAll']({'raw':_0xc40262['options']?_0xc40262[_0xe2ce('0x19')][_0xe2ce('0x1a')]===undefined?!![]:![]:!![],'where':_0xc40262['options']?_0xc40262['options'][_0xe2ce('0x1b')]||null:null,'attributes':_0xc40262[_0xe2ce('0x19')]?_0xc40262[_0xe2ce('0x19')]['attributes']||null:null,'limit':_0xc40262[_0xe2ce('0x19')]?_0xc40262[_0xe2ce('0x19')][_0xe2ce('0x1c')]||null:null,'include':_0xc40262[_0xe2ce('0x19')]?_0xc40262[_0xe2ce('0x19')][_0xe2ce('0x1d')]?_[_0xe2ce('0x1e')](_0xc40262[_0xe2ce('0x19')]['include'],function(_0x36bd84){return{'model':db[_0x36bd84[_0xe2ce('0x1f')]],'as':_0x36bd84['as'],'attributes':_0x36bd84[_0xe2ce('0x20')],'include':_0x36bd84[_0xe2ce('0x1d')]?_[_0xe2ce('0x1e')](_0x36bd84['include'],function(_0xc4209c){return{'model':db[_0xc4209c[_0xe2ce('0x1f')]],'as':_0xc4209c['as'],'attributes':_0xc4209c[_0xe2ce('0x20')],'include':_0xc4209c[_0xe2ce('0x1d')]?_[_0xe2ce('0x1e')](_0xc4209c[_0xe2ce('0x1d')],function(_0x54eb02){return{'model':db[_0x54eb02[_0xe2ce('0x1f')]],'as':_0x54eb02['as'],'attributes':_0x54eb02['attributes']};}):[]};}):[]};}):[]:[]})[_0xe2ce('0x21')](function(_0x41b3bc){logger[_0xe2ce('0xf')](_0xe2ce('0x18'),_0xc40262);logger[_0xe2ce('0x12')](_0xe2ce('0x18'),_0xc40262,JSON['stringify'](_0x41b3bc));_0x5b5f07(_0x41b3bc);})[_0xe2ce('0x17')](function(_0x4c110c){logger[_0xe2ce('0x15')](_0xe2ce('0x18'),_0x4c110c['message'],_0xc40262);_0x1b94c1(_0x13673b[_0xe2ce('0x15')](0x1f4,_0x4c110c[_0xe2ce('0x16')]));});});};exports[_0xe2ce('0x22')]=function(_0x240d18){var _0x4b09ff=this;return new Promise(function(_0xf7b6c2,_0x4622a9){return db['Trunk'][_0xe2ce('0x23')]({'raw':_0x240d18[_0xe2ce('0x19')]?_0x240d18[_0xe2ce('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x240d18['options']?_0x240d18['options']['where']||null:null,'attributes':_0x240d18[_0xe2ce('0x19')]?_0x240d18[_0xe2ce('0x19')][_0xe2ce('0x20')]||null:null,'include':_0x240d18[_0xe2ce('0x19')]?_0x240d18[_0xe2ce('0x19')][_0xe2ce('0x1d')]?_[_0xe2ce('0x1e')](_0x240d18[_0xe2ce('0x19')][_0xe2ce('0x1d')],function(_0x352bff){return{'model':db[_0x352bff[_0xe2ce('0x1f')]],'as':_0x352bff['as'],'attributes':_0x352bff['attributes'],'include':_0x352bff[_0xe2ce('0x1d')]?_[_0xe2ce('0x1e')](_0x352bff['include'],function(_0x30c889){return{'model':db[_0x30c889[_0xe2ce('0x1f')]],'as':_0x30c889['as'],'attributes':_0x30c889[_0xe2ce('0x20')],'include':_0x30c889[_0xe2ce('0x1d')]?_[_0xe2ce('0x1e')](_0x30c889[_0xe2ce('0x1d')],function(_0x4cfbf8){return{'model':db[_0x4cfbf8[_0xe2ce('0x1f')]],'as':_0x4cfbf8['as'],'attributes':_0x4cfbf8[_0xe2ce('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe2ce('0x21')](function(_0x4df4e2){logger['info'](_0xe2ce('0x22'),_0x240d18);logger[_0xe2ce('0x12')](_0xe2ce('0x22'),_0x240d18,JSON[_0xe2ce('0x13')](_0x4df4e2));_0xf7b6c2(_0x4df4e2);})[_0xe2ce('0x17')](function(_0x45cd4a){logger[_0xe2ce('0x15')](_0xe2ce('0x22'),_0x45cd4a[_0xe2ce('0x16')],_0x240d18);_0x4622a9(_0x4b09ff[_0xe2ce('0x15')](0x1f4,_0x45cd4a[_0xe2ce('0x16')]));});});};
\ No newline at end of file
index 0ed2379..d4b229f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8312=['exports','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','update'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x8312,0x179));var _0x2831=function(_0x113a31,_0x5629b4){_0x113a31=_0x113a31-0x0;var _0x1ab191=_0x8312[_0x113a31];return _0x1ab191;};'use strict';var express=require(_0x2831('0x0'));var router=express[_0x2831('0x1')]();var auth=require(_0x2831('0x2'));var controller=require(_0x2831('0x3'));router[_0x2831('0x4')](_0x2831('0x5'),auth['isAuthenticated'](),controller[_0x2831('0x6')]);module[_0x2831('0x7')]=router;
\ No newline at end of file
+var _0xc2a7=['./user-setting.controller','put','/:id','isAuthenticated','update','exports','Router','../../components/auth/service'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc2a7,0x116));var _0x7c2a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc2a7[_0x57b54c];return _0x59cc19;};'use strict';var express=require('express');var router=express[_0x7c2a('0x0')]();var auth=require(_0x7c2a('0x1'));var controller=require(_0x7c2a('0x2'));router[_0x7c2a('0x3')](_0x7c2a('0x4'),auth[_0x7c2a('0x5')](),controller[_0x7c2a('0x6')]);module[_0x7c2a('0x7')]=router;
\ No newline at end of file
index a30e924..d66ed9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44ee=['warning','info','ENUM','BOOLEAN','TEXT','INTEGER','UserId','error'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x44ee,0xbf));var _0xe44e=function(_0x305537,_0x5d2211){_0x305537=_0x305537-0x0;var _0x1cfe18=_0x44ee[_0x305537];return _0x1cfe18;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xe44e('0x0'),_0xe44e('0x1'),_0xe44e('0x2'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xe44e('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xe44e('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xe44e('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xe44e('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xe44e('0x6')],'unique':_0xe44e('0x7')}};
\ No newline at end of file
+var _0xacf5=['debug','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0xacf5,0xd0));var _0x5acf=function(_0x2a7da1,_0xd8259){_0x2a7da1=_0x2a7da1-0x0;var _0x9a86cf=_0xacf5[_0x2a7da1];return _0x9a86cf;};'use strict';var Sequelize=require(_0x5acf('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x5acf('0x1'),'warning','info',_0x5acf('0x2')];module[_0x5acf('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x5acf('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x5acf('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x5acf('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x5acf('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x5acf('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x5acf('0x8')],'unique':_0x5acf('0x9')}};
\ No newline at end of file
index 215f469..aa48c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b83=['admin','Unauthorized','params','find','then','body','catch','lodash','ioredis','../../config/logger','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','status','sendStatus','error','name','send','update'];(function(_0xf363f0,_0x3b5eeb){var _0x55a386=function(_0x548349){while(--_0x548349){_0xf363f0['push'](_0xf363f0['shift']());}};_0x55a386(++_0x3b5eeb);}(_0x7b83,0xa1));var _0x37b8=function(_0x505bb2,_0x5d7637){_0x505bb2=_0x505bb2-0x0;var _0x342e85=_0x7b83[_0x505bb2];return _0x342e85;};'use strict';var _=require(_0x37b8('0x0'));var Redis=require(_0x37b8('0x1'));var logger=require(_0x37b8('0x2'))('api');var config=require('../../config/environment');var db=require(_0x37b8('0x3'))['db'];var socket=require(_0x37b8('0x4'))(new Redis(config[_0x37b8('0x5')]));require('./user-setting.socket')[_0x37b8('0x6')](socket);config[_0x37b8('0x5')]=_[_0x37b8('0x7')](config[_0x37b8('0x5')],{'host':_0x37b8('0x8'),'port':0x18eb});function respondWithResult(_0x220cd2,_0x5eb540){_0x5eb540=_0x5eb540||0xc8;return function(_0x45e094){if(_0x45e094){return _0x220cd2[_0x37b8('0x9')](_0x5eb540)['json'](_0x45e094);}};}function saveUpdates(_0x17f4c5){return function(_0x4df684){if(_0x4df684){return _0x4df684['update'](_0x17f4c5)['then'](function(_0x55e14b){return _0x55e14b;});}return null;};}function handleEntityNotFound(_0x11ef2d){return function(_0xa1526a){if(!_0xa1526a){_0x11ef2d[_0x37b8('0xa')](0x194);}return _0xa1526a;};}function handleError(_0x5f6aa5,_0x2b3932){_0x2b3932=_0x2b3932||0x1f4;return function(_0x51ed43){logger[_0x37b8('0xb')](_0x51ed43['stack']);if(_0x51ed43[_0x37b8('0xc')]){delete _0x51ed43['name'];}_0x5f6aa5[_0x37b8('0x9')](_0x2b3932)[_0x37b8('0xd')](_0x51ed43);};}exports[_0x37b8('0xe')]=function(_0xf737ae,_0x3dc8c5){if(_0xf737ae['user']['role']!==_0x37b8('0xf'))throw new Error(_0x37b8('0x10'));if(isNaN(Number(_0xf737ae[_0x37b8('0x11')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0x37b8('0x12')]({'where':{'id':_0xf737ae[_0x37b8('0x11')]['id']}})[_0x37b8('0x13')](handleEntityNotFound(_0x3dc8c5,null))[_0x37b8('0x13')](saveUpdates(_0xf737ae[_0x37b8('0x14')],null))[_0x37b8('0x13')](respondWithResult(_0x3dc8c5,null))[_0x37b8('0x15')](handleError(_0x3dc8c5,null));};
\ No newline at end of file
+var _0xc818=['api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','json','update','then','sendStatus','stack','name','status','send','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger'];(function(_0x3edb33,_0xa4302d){var _0x238608=function(_0xa0310f){while(--_0xa0310f){_0x3edb33['push'](_0x3edb33['shift']());}};_0x238608(++_0xa4302d);}(_0xc818,0x1e3));var _0x8c81=function(_0x4fea57,_0x3a129c){_0x4fea57=_0x4fea57-0x0;var _0x56cded=_0xc818[_0x4fea57];return _0x56cded;};'use strict';var _=require(_0x8c81('0x0'));var Redis=require(_0x8c81('0x1'));var logger=require(_0x8c81('0x2'))(_0x8c81('0x3'));var config=require('../../config/environment');var db=require(_0x8c81('0x4'))['db'];var socket=require(_0x8c81('0x5'))(new Redis(config[_0x8c81('0x6')]));require(_0x8c81('0x7'))[_0x8c81('0x8')](socket);config[_0x8c81('0x6')]=_[_0x8c81('0x9')](config['redis'],{'host':_0x8c81('0xa'),'port':0x18eb});function respondWithResult(_0x3d663e,_0x32cf31){_0x32cf31=_0x32cf31||0xc8;return function(_0x43d142){if(_0x43d142){return _0x3d663e['status'](_0x32cf31)[_0x8c81('0xb')](_0x43d142);}};}function saveUpdates(_0x448af6){return function(_0x186783){if(_0x186783){return _0x186783[_0x8c81('0xc')](_0x448af6)[_0x8c81('0xd')](function(_0x2ce097){return _0x2ce097;});}return null;};}function handleEntityNotFound(_0x64a425){return function(_0x4c8021){if(!_0x4c8021){_0x64a425[_0x8c81('0xe')](0x194);}return _0x4c8021;};}function handleError(_0x37dbb4,_0x639c8f){_0x639c8f=_0x639c8f||0x1f4;return function(_0x1775a6){logger['error'](_0x1775a6[_0x8c81('0xf')]);if(_0x1775a6[_0x8c81('0x10')]){delete _0x1775a6[_0x8c81('0x10')];}_0x37dbb4[_0x8c81('0x11')](_0x639c8f)[_0x8c81('0x12')](_0x1775a6);};}exports[_0x8c81('0xc')]=function(_0x1b7b1b,_0xd04a1){if(_0x1b7b1b[_0x8c81('0x13')]['role']!=='admin')throw new Error(_0x8c81('0x14'));if(isNaN(Number(_0x1b7b1b[_0x8c81('0x15')]['id'])))throw new Error(_0x8c81('0x16'));return db[_0x8c81('0x17')][_0x8c81('0x18')]({'where':{'id':_0x1b7b1b[_0x8c81('0x15')]['id']}})['then'](handleEntityNotFound(_0xd04a1,null))[_0x8c81('0xd')](saveUpdates(_0x1b7b1b[_0x8c81('0x19')],null))[_0x8c81('0xd')](respondWithResult(_0xd04a1,null))[_0x8c81('0x1a')](handleError(_0xd04a1,null));};
\ No newline at end of file
index 54788a5..9793631 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3506=['exports','events','../../mysqldb','UserSetting','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x519d36,_0x52ddc5){var _0x38b83c=function(_0x122bd8){while(--_0x122bd8){_0x519d36['push'](_0x519d36['shift']());}};_0x38b83c(++_0x52ddc5);}(_0x3506,0x19b));var _0x6350=function(_0xb68c07,_0xe54e57){_0xb68c07=_0xb68c07-0x0;var _0x238f2d=_0x3506[_0xb68c07];return _0x238f2d;};'use strict';var EventEmitter=require(_0x6350('0x0'));var UserSetting=require(_0x6350('0x1'))['db'][_0x6350('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6350('0x3'),'afterUpdate':_0x6350('0x4'),'afterDestroy':_0x6350('0x5')};function emitEvent(_0x55a78e){return function(_0x40fffe,_0x2244af,_0x11e95b){UserSettingEvents[_0x6350('0x6')](_0x55a78e+':'+_0x40fffe['id'],_0x40fffe);UserSettingEvents['emit'](_0x55a78e,_0x40fffe);_0x11e95b(null);};}for(var e in events){if(events[_0x6350('0x7')](e)){var event=events[e];UserSetting[_0x6350('0x8')](e,emitEvent(event));}}module[_0x6350('0x9')]=UserSettingEvents;
\ No newline at end of file
+var _0xb37c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners'];(function(_0x387e70,_0x359aad){var _0x518b1c=function(_0x5f1644){while(--_0x5f1644){_0x387e70['push'](_0x387e70['shift']());}};_0x518b1c(++_0x359aad);}(_0xb37c,0x13b));var _0xcb37=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb37c[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0xcb37('0x0'));var UserSetting=require(_0xcb37('0x1'))['db'][_0xcb37('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xcb37('0x3')](0x0);var events={'afterCreate':_0xcb37('0x4'),'afterUpdate':_0xcb37('0x5'),'afterDestroy':_0xcb37('0x6')};function emitEvent(_0x21b7f9){return function(_0x5c5948,_0x2c70b4,_0x1bf948){UserSettingEvents[_0xcb37('0x7')](_0x21b7f9+':'+_0x5c5948['id'],_0x5c5948);UserSettingEvents[_0xcb37('0x7')](_0x21b7f9,_0x5c5948);_0x1bf948(null);};}for(var e in events){if(events[_0xcb37('0x8')](e)){var event=events[e];UserSetting[_0xcb37('0x9')](e,emitEvent(event));}}module[_0xcb37('0xa')]=UserSettingEvents;
\ No newline at end of file
index 2a5b030..ab7e8f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9086=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x2f5d05,_0x425611){var _0x176944=function(_0x46a0d9){while(--_0x46a0d9){_0x2f5d05['push'](_0x2f5d05['shift']());}};_0x176944(++_0x425611);}(_0x9086,0x10b));var _0x6908=function(_0x304fc0,_0x350911){_0x304fc0=_0x304fc0-0x0;var _0x9c5be4=_0x9086[_0x304fc0];return _0x9c5be4;};'use strict';var attributes=require(_0x6908('0x0'));module[_0x6908('0x1')]=function(_0x48787c){return _0x48787c[_0x6908('0x2')](_0x6908('0x3'),attributes,{'tableName':_0x6908('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x230e29){if(!_0x230e29[_0x6908('0x5')])_0x230e29[_0x6908('0x6')]=null;else if(_0x230e29['clientSideLoggingEnabledSince']===null)_0x230e29[_0x6908('0x6')]=new Date();}}});};
\ No newline at end of file
+var _0x25c2=['clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings'];(function(_0x17b2fb,_0x43e4f5){var _0xd48ee3=function(_0x431cba){while(--_0x431cba){_0x17b2fb['push'](_0x17b2fb['shift']());}};_0xd48ee3(++_0x43e4f5);}(_0x25c2,0xdd));var _0x225c=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x25c2[_0x29db36];return _0x234e87;};'use strict';var attributes=require(_0x225c('0x0'));module['exports']=function(_0xbe7f12){return _0xbe7f12[_0x225c('0x1')]('UserSetting',attributes,{'tableName':_0x225c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20e09f){if(!_0x20e09f['clientSideLoggingEnabled'])_0x20e09f[_0x225c('0x3')]=null;else if(_0x20e09f[_0x225c('0x3')]===null)_0x20e09f['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
index da9a730..34b6ef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bce=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','emit','user-setting:update'];(function(_0x3f3071,_0xb668d3){var _0x143ad1=function(_0x4a4b91){while(--_0x4a4b91){_0x3f3071['push'](_0x3f3071['shift']());}};_0x143ad1(++_0xb668d3);}(_0x3bce,0x1c7));var _0xe3bc=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3bce[_0x42cae2];return _0x5f256f;};'use strict';var UserSettingEvents=require(_0xe3bc('0x0'));var events=[_0xe3bc('0x1'),'remove','update'];function createListener(_0x2dc355,_0x5151ed){return function(_0x28925b){_0x5151ed[_0xe3bc('0x2')](_0x2dc355,_0x28925b);if(_0x2dc355===_0xe3bc('0x3')){_0x5151ed[_0xe3bc('0x2')](_0xe3bc('0x4')+_0x28925b[_0xe3bc('0x5')],_0x28925b);}};}exports[_0xe3bc('0x6')]=function(_0x4b57ec){for(var _0x1c953d=0x0,_0x13668b=events[_0xe3bc('0x7')];_0x1c953d<_0x13668b;_0x1c953d++){var _0x214427=events[_0x1c953d];var _0x3ea971=createListener(_0xe3bc('0x8')+_0x214427,_0x4b57ec);UserSettingEvents['on'](_0x214427,_0x3ea971);}};
\ No newline at end of file
+var _0xb961=['update','emit','user-setting:update','user-setting:update:user-','UserId','length','./user-setting.events','save','remove'];(function(_0x5d03fa,_0x41d484){var _0x58f0a6=function(_0x3f7415){while(--_0x3f7415){_0x5d03fa['push'](_0x5d03fa['shift']());}};_0x58f0a6(++_0x41d484);}(_0xb961,0x114));var _0x1b96=function(_0x5b3fb6,_0x397dfc){_0x5b3fb6=_0x5b3fb6-0x0;var _0x5da9d4=_0xb961[_0x5b3fb6];return _0x5da9d4;};'use strict';var UserSettingEvents=require(_0x1b96('0x0'));var events=[_0x1b96('0x1'),_0x1b96('0x2'),_0x1b96('0x3')];function createListener(_0x49ee71,_0x2bf873){return function(_0x3ab366){_0x2bf873[_0x1b96('0x4')](_0x49ee71,_0x3ab366);if(_0x49ee71===_0x1b96('0x5')){_0x2bf873[_0x1b96('0x4')](_0x1b96('0x6')+_0x3ab366[_0x1b96('0x7')],_0x3ab366);}};}exports['register']=function(_0x2662ce){for(var _0x323469=0x0,_0x2af5f0=events[_0x1b96('0x8')];_0x323469<_0x2af5f0;_0x323469++){var _0x208250=events[_0x323469];var _0xbefdd1=createListener('user-setting:'+_0x208250,_0x2662ce);UserSettingEvents['on'](_0x208250,_0xbefdd1);}};
\ No newline at end of file
index e314361..a8b7e3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dfe=['./user.controller','get','isAuthenticated','index','describe','/whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/square_projects','addSquareProjects','put','update','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0dfe,0xe5));var _0xe0df=function(_0x42be34,_0x1de07e){_0x42be34=_0x42be34-0x0;var _0x180459=_0x0dfe[_0x42be34];return _0x180459;};'use strict';var multer=require(_0xe0df('0x0'));var util=require(_0xe0df('0x1'));var path=require(_0xe0df('0x2'));var timeout=require(_0xe0df('0x3'));var express=require(_0xe0df('0x4'));var router=express[_0xe0df('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe0df('0x6'));var interaction=require(_0xe0df('0x7'));var config=require(_0xe0df('0x8'));var controller=require(_0xe0df('0x9'));router[_0xe0df('0xa')]('/',auth[_0xe0df('0xb')](),controller[_0xe0df('0xc')]);router[_0xe0df('0xa')]('/describe',auth[_0xe0df('0xb')](),controller[_0xe0df('0xd')]);router[_0xe0df('0xa')](_0xe0df('0xe'),auth[_0xe0df('0xb')](),controller['whoami']);router['get'](_0xe0df('0xf'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x10')]);router[_0xe0df('0xa')](_0xe0df('0x11'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x12')]);router[_0xe0df('0xa')](_0xe0df('0x13'),controller['getAvatar']);router[_0xe0df('0xa')](_0xe0df('0x14'),auth[_0xe0df('0xb')](),controller['getOpenTabs']);router[_0xe0df('0xa')]('/:id/contacts',auth[_0xe0df('0xb')](),controller[_0xe0df('0x15')]);router[_0xe0df('0xa')](_0xe0df('0x16'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x17')]);router['get'](_0xe0df('0x18'),auth['isAuthenticated'](),controller[_0xe0df('0x19')]);router[_0xe0df('0xa')](_0xe0df('0x1a'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x1b')]);router[_0xe0df('0xa')](_0xe0df('0x1c'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x1d')]);router[_0xe0df('0xa')](_0xe0df('0x1e'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x1f')]);router[_0xe0df('0xa')](_0xe0df('0x20'),auth[_0xe0df('0xb')](),controller['getChatInteractions']);router[_0xe0df('0xa')](_0xe0df('0x21'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x22')]);router['get']('/:id/mail/interactions',auth[_0xe0df('0xb')](),controller[_0xe0df('0x23')]);router[_0xe0df('0xa')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0xe0df('0x24')]);router[_0xe0df('0xa')](_0xe0df('0x25'),auth[_0xe0df('0xb')](),controller['getFaxInteractions']);router[_0xe0df('0xa')](_0xe0df('0x26'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x27')]);router[_0xe0df('0xa')](_0xe0df('0x28'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x29')]);router[_0xe0df('0xa')](_0xe0df('0x2a'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x2b')]);router[_0xe0df('0xa')](_0xe0df('0x2c'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x2d')]);router[_0xe0df('0xa')]('/:id/prefixes',auth[_0xe0df('0xb')](),controller[_0xe0df('0x2e')]);router['get'](_0xe0df('0x2f'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x30')]);router[_0xe0df('0xa')]('/:id/mail_accounts',auth[_0xe0df('0xb')](),controller[_0xe0df('0x31')]);router[_0xe0df('0xa')](_0xe0df('0x32'),auth[_0xe0df('0xb')](),controller['getOpenchannelAccounts']);router[_0xe0df('0xa')]('/:id/sms_accounts',auth[_0xe0df('0xb')](),controller['getSmsAccounts']);router[_0xe0df('0xa')](_0xe0df('0x33'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x34')]);router[_0xe0df('0xa')](_0xe0df('0x35'),auth['isAuthenticated'](),controller[_0xe0df('0x36')]);router[_0xe0df('0xa')]('/:id/square_projects',auth[_0xe0df('0xb')](),controller[_0xe0df('0x37')]);router['get']('/:id/scheduled_calls',auth[_0xe0df('0xb')](),controller[_0xe0df('0x38')]);router[_0xe0df('0xa')](_0xe0df('0x39'),auth[_0xe0df('0xb')](),controller['getApiKey']);router[_0xe0df('0x3a')](_0xe0df('0x3b'),auth['isAuthenticated'](),controller[_0xe0df('0x3c')]);router[_0xe0df('0x3a')]('/',auth[_0xe0df('0xb')](),controller[_0xe0df('0x3d')]);router[_0xe0df('0x3a')](_0xe0df('0x3e'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x3f')]);router['post'](_0xe0df('0x16'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x40')]);var upload=multer({'storage':multer[_0xe0df('0x41')]({'destination':function(_0x59f37d,_0x21ebac,_0x253419){_0x253419(null,path[_0xe0df('0x42')](config[_0xe0df('0x43')],'server/files/images/'));},'filename':function(_0x3ad14e,_0x5e971b,_0x269020){_0x269020(null,util[_0xe0df('0x44')](_0xe0df('0x45'),Date[_0xe0df('0x46')](),_0x5e971b[_0xe0df('0x47')]));}})});router['post'](_0xe0df('0x13'),upload[_0xe0df('0x48')](_0xe0df('0x49')),controller[_0xe0df('0x4a')]);router[_0xe0df('0x3a')](_0xe0df('0x4b'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x4c')]);router[_0xe0df('0x3a')](_0xe0df('0x4d'),auth[_0xe0df('0xb')](),controller['logout']);router['post'](_0xe0df('0x4e'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x4f')]);router[_0xe0df('0x3a')]('/:id/unpause',auth['isAuthenticated'](),controller[_0xe0df('0x50')]);router[_0xe0df('0x3a')]('/:id/teams',auth[_0xe0df('0xb')](),controller[_0xe0df('0x51')]);router['post'](_0xe0df('0x52'),auth[_0xe0df('0xb')](),controller['addChatInteractions']);router['post'](_0xe0df('0x53'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xe0df('0x3a')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xe0df('0x54')]);router[_0xe0df('0x3a')](_0xe0df('0x55'),auth[_0xe0df('0xb')](),controller['addSmsInteractions']);router[_0xe0df('0x3a')](_0xe0df('0x56'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x57')]);router[_0xe0df('0x3a')](_0xe0df('0x58'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x59')]);router[_0xe0df('0x3a')](_0xe0df('0x2f'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x5a')]);router[_0xe0df('0x3a')](_0xe0df('0x5b'),auth[_0xe0df('0xb')](),controller['addMailAccounts']);router[_0xe0df('0x3a')]('/:id/openchannel_accounts',auth[_0xe0df('0xb')](),controller[_0xe0df('0x5c')]);router[_0xe0df('0x3a')](_0xe0df('0x5d'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x5e')]);router[_0xe0df('0x3a')](_0xe0df('0x33'),auth[_0xe0df('0xb')](),controller['addChatWebsites']);router[_0xe0df('0x3a')]('/:id/whatsapp_accounts',auth[_0xe0df('0xb')](),controller['addWhatsappAccounts']);router[_0xe0df('0x3a')](_0xe0df('0x5f'),auth['isAuthenticated'](),controller[_0xe0df('0x60')]);router['post'](_0xe0df('0x39'),auth[_0xe0df('0xb')](),controller['createApiKey']);router[_0xe0df('0x61')](_0xe0df('0x11'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x62')]);router['put'](_0xe0df('0x63'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x64')]);router['delete'](_0xe0df('0x16'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x65')]);router[_0xe0df('0x66')](_0xe0df('0x28'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x67')]);router[_0xe0df('0x66')](_0xe0df('0x11'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x68')]);router[_0xe0df('0x66')](_0xe0df('0x52'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x69')]);router['delete'](_0xe0df('0x53'),auth['isAuthenticated'](),controller[_0xe0df('0x6a')]);router[_0xe0df('0x66')](_0xe0df('0x6b'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x6c')]);router[_0xe0df('0x66')](_0xe0df('0x55'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x6d')]);router[_0xe0df('0x66')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0xe0df('0x6e')]);router[_0xe0df('0x66')](_0xe0df('0x58'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x6f')]);router['delete'](_0xe0df('0x2f'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x70')]);router[_0xe0df('0x66')]('/:id/mail_accounts',auth[_0xe0df('0xb')](),controller['removeMailAccounts']);router[_0xe0df('0x66')](_0xe0df('0x32'),auth['isAuthenticated'](),controller[_0xe0df('0x71')]);router[_0xe0df('0x66')]('/:id/sms_accounts',auth[_0xe0df('0xb')](),controller[_0xe0df('0x72')]);router[_0xe0df('0x66')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xe0df('0x73')]);router[_0xe0df('0x66')](_0xe0df('0x35'),auth[_0xe0df('0xb')](),controller[_0xe0df('0x74')]);router['delete'](_0xe0df('0x5f'),auth['isAuthenticated'](),controller['removeSquareProjects']);router[_0xe0df('0x66')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xe0df('0x75')]);module[_0xe0df('0x76')]=router;
\ No newline at end of file
+var _0x0f66=['getSquareProjects','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','put','update','/:id/password','changePassword','removeTeams','delete','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects'];(function(_0x1c3e2f,_0x14f882){var _0x36e8a7=function(_0x533d4f){while(--_0x533d4f){_0x1c3e2f['push'](_0x1c3e2f['shift']());}};_0x36e8a7(++_0x14f882);}(_0x0f66,0x12a));var _0x60f6=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x0f66[_0x231e16];return _0x570a7c;};'use strict';var multer=require(_0x60f6('0x0'));var util=require(_0x60f6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60f6('0x2'));var router=express[_0x60f6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x60f6('0x4'));var interaction=require(_0x60f6('0x5'));var config=require(_0x60f6('0x6'));var controller=require(_0x60f6('0x7'));router[_0x60f6('0x8')]('/',auth[_0x60f6('0x9')](),controller[_0x60f6('0xa')]);router[_0x60f6('0x8')](_0x60f6('0xb'),auth[_0x60f6('0x9')](),controller[_0x60f6('0xc')]);router[_0x60f6('0x8')](_0x60f6('0xd'),auth[_0x60f6('0x9')](),controller[_0x60f6('0xe')]);router[_0x60f6('0x8')]('/presence',auth[_0x60f6('0x9')](),controller[_0x60f6('0xf')]);router[_0x60f6('0x8')](_0x60f6('0x10'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x11')]);router[_0x60f6('0x8')](_0x60f6('0x12'),controller['getAvatar']);router[_0x60f6('0x8')](_0x60f6('0x13'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x60f6('0x8')](_0x60f6('0x14'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x15')]);router[_0x60f6('0x8')](_0x60f6('0x16'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x17')]);router['get'](_0x60f6('0x18'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x19')]);router[_0x60f6('0x8')]('/:id/groups',auth[_0x60f6('0x9')](),controller[_0x60f6('0x1a')]);router['get'](_0x60f6('0x1b'),auth[_0x60f6('0x9')](),controller['getRecordings']);router[_0x60f6('0x8')]('/:id/screen_recordings',auth[_0x60f6('0x9')](),controller[_0x60f6('0x1c')]);router[_0x60f6('0x8')](_0x60f6('0x1d'),auth['isAuthenticated'](),controller[_0x60f6('0x1e')]);router[_0x60f6('0x8')](_0x60f6('0x1f'),auth['isAuthenticated'](),controller[_0x60f6('0x20')]);router[_0x60f6('0x8')](_0x60f6('0x21'),auth['isAuthenticated'](),controller[_0x60f6('0x22')]);router['get']('/:id/sms/interactions',auth[_0x60f6('0x9')](),controller[_0x60f6('0x23')]);router[_0x60f6('0x8')](_0x60f6('0x24'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x25')]);router[_0x60f6('0x8')](_0x60f6('0x26'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x27')]);router[_0x60f6('0x8')](_0x60f6('0x28'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x60f6('0x29'),auth[_0x60f6('0x9')](),controller['getLists']);router[_0x60f6('0x8')](_0x60f6('0x2a'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x2b')]);router[_0x60f6('0x8')]('/:id/prefixes',auth[_0x60f6('0x9')](),controller[_0x60f6('0x2c')]);router[_0x60f6('0x8')](_0x60f6('0x2d'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x2e')]);router['get'](_0x60f6('0x2f'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x30')]);router[_0x60f6('0x8')](_0x60f6('0x31'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x32')]);router[_0x60f6('0x8')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x60f6('0x33')]);router[_0x60f6('0x8')]('/:id/chat_websites',auth[_0x60f6('0x9')](),controller[_0x60f6('0x34')]);router[_0x60f6('0x8')](_0x60f6('0x35'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x36')]);router[_0x60f6('0x8')](_0x60f6('0x37'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x38')]);router[_0x60f6('0x8')]('/:id/scheduled_calls',auth[_0x60f6('0x9')](),controller[_0x60f6('0x39')]);router[_0x60f6('0x8')](_0x60f6('0x3a'),auth['isAuthenticated'](),controller['getApiKey']);router[_0x60f6('0x3b')]('/:id/contacts',auth[_0x60f6('0x9')](),controller[_0x60f6('0x3c')]);router[_0x60f6('0x3b')]('/',auth['isAuthenticated'](),controller[_0x60f6('0x3d')]);router[_0x60f6('0x3b')](_0x60f6('0x3e'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x3f')]);router['post'](_0x60f6('0x16'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x40')]);var upload=multer({'storage':multer[_0x60f6('0x41')]({'destination':function(_0x2805cd,_0x442f60,_0x31e84e){_0x31e84e(null,path[_0x60f6('0x42')](config[_0x60f6('0x43')],_0x60f6('0x44')));},'filename':function(_0x1909f4,_0x56a585,_0x4dd4ed){_0x4dd4ed(null,util[_0x60f6('0x45')](_0x60f6('0x46'),Date[_0x60f6('0x47')](),_0x56a585[_0x60f6('0x48')]));}})});router[_0x60f6('0x3b')](_0x60f6('0x12'),upload[_0x60f6('0x49')](_0x60f6('0x4a')),controller[_0x60f6('0x4b')]);router[_0x60f6('0x3b')](_0x60f6('0x4c'),auth[_0x60f6('0x9')](),controller['login']);router[_0x60f6('0x3b')](_0x60f6('0x4d'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x4e')]);router['post'](_0x60f6('0x4f'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x50')]);router['post'](_0x60f6('0x51'),auth[_0x60f6('0x9')](),controller['unpause']);router[_0x60f6('0x3b')](_0x60f6('0x28'),auth[_0x60f6('0x9')](),controller['addTeams']);router['post'](_0x60f6('0x52'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x53')]);router['post'](_0x60f6('0x54'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x55')]);router[_0x60f6('0x3b')](_0x60f6('0x56'),auth[_0x60f6('0x9')](),controller['addFaxInteractions']);router['post'](_0x60f6('0x57'),auth[_0x60f6('0x9')](),controller['addSmsInteractions']);router[_0x60f6('0x3b')]('/:id/openchannel_interactions',auth[_0x60f6('0x9')](),controller[_0x60f6('0x58')]);router['post'](_0x60f6('0x59'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x5a')]);router[_0x60f6('0x3b')](_0x60f6('0x2d'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x5b')]);router[_0x60f6('0x3b')](_0x60f6('0x2f'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x5c')]);router[_0x60f6('0x3b')](_0x60f6('0x31'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x5d')]);router[_0x60f6('0x3b')](_0x60f6('0x5e'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x5f')]);router[_0x60f6('0x3b')](_0x60f6('0x60'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x61')]);router[_0x60f6('0x3b')](_0x60f6('0x35'),auth[_0x60f6('0x9')](),controller['addWhatsappAccounts']);router[_0x60f6('0x3b')](_0x60f6('0x37'),auth[_0x60f6('0x9')](),controller['addSquareProjects']);router['post'](_0x60f6('0x3a'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x60f6('0x62')]('/:id',auth[_0x60f6('0x9')](),controller[_0x60f6('0x63')]);router[_0x60f6('0x62')](_0x60f6('0x64'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x65')]);router['delete'](_0x60f6('0x16'),auth[_0x60f6('0x9')](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0x60f6('0x9')](),controller[_0x60f6('0x66')]);router['delete'](_0x60f6('0x10'),auth[_0x60f6('0x9')](),controller['destroy']);router[_0x60f6('0x67')](_0x60f6('0x52'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x68')]);router['delete'](_0x60f6('0x54'),auth['isAuthenticated'](),controller[_0x60f6('0x69')]);router['delete'](_0x60f6('0x56'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x6a')]);router[_0x60f6('0x67')](_0x60f6('0x57'),auth['isAuthenticated'](),controller[_0x60f6('0x6b')]);router[_0x60f6('0x67')](_0x60f6('0x6c'),auth[_0x60f6('0x9')](),controller['removeOpenchannelInteractions']);router[_0x60f6('0x67')](_0x60f6('0x59'),auth['isAuthenticated'](),controller[_0x60f6('0x6d')]);router[_0x60f6('0x67')](_0x60f6('0x2d'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x6e')]);router[_0x60f6('0x67')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x60f6('0x67')](_0x60f6('0x31'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x6f')]);router[_0x60f6('0x67')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x60f6('0x70')]);router[_0x60f6('0x67')](_0x60f6('0x60'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x71')]);router[_0x60f6('0x67')](_0x60f6('0x35'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x72')]);router[_0x60f6('0x67')](_0x60f6('0x37'),auth[_0x60f6('0x9')](),controller[_0x60f6('0x73')]);router[_0x60f6('0x67')](_0x60f6('0x3a'),auth['isAuthenticated'](),controller[_0x60f6('0x74')]);module[_0x60f6('0x75')]=router;
\ No newline at end of file
index b426560..2685112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x18c555,_0x236f86){var _0x1893cd=function(_0x10da60){while(--_0x10da60){_0x18c555['push'](_0x18c555['shift']());}};_0x1893cd(++_0x236f86);}(_0x34e8,0x12c));var _0x834e=function(_0x480bb4,_0x586359){_0x480bb4=_0x480bb4-0x0;var _0xd55517=_0x34e8[_0x480bb4];return _0xd55517;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','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]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index b617b17..eaaa830 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9013=['102','110','104','105','106','107','108','100','111','114','115','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','userProfileId','create','Telephones','autoAssociation','bulkCreate','Unauthorized','some','checkUserLimits','all','each','compact','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','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','online','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','get','interface','format','SIP/%s','voicePause','penalty','UserVoiceQueueRt','upsert','channel','remove','isArray','Queue:remove','addAvatar','userpic','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','getOpenTabs','CHAT','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','intersection','order','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','Queue','sort','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','loginInPause','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','MemberReport','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','omit','setDataValue','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','Voice','Whatsapp','getFaxQueues','removeAgent','TeamVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','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','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$gte','$lte','$ne','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','createApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','send','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','isEmpty','queues','lower','toString','asc','desc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','voiceStatus','slice','charAt','QueryTypes','select','field','InteractionId','ui.createdAt','user_has_','bluebird','util','path','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./user.socket','defaults','localhost','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','sendStatus','status','end','offset','limit','undefined','Content-Range','json','update','role','admin','Users','user','Agents','agent','telephone','ignore','map','value','includes','find','name','UserProfileResource','destroy','stack','User','fieldName','type','key','filter','password','salt','where','count','query','includeAll','userSetting','true','include','attributes','push','findAll','rows','openTabs','length','chat','dataValues','mail','openchannel','whatsapp','catch','show','params','model','differenceBy','keys','rawAttributes','filters','fields','UserSetting','merge','options','sms','fax','body','describe','addContacts','ids','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','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','SELECT','from','voicemail','mailbox','VoiceMail','fullname','permissions','101'];(function(_0x11352d,_0x42f7c){var _0x45b367=function(_0x3554c9){while(--_0x3554c9){_0x11352d['push'](_0x11352d['shift']());}};_0x45b367(++_0x42f7c);}(_0x9013,0x121));var _0x3901=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9013[_0x2e4aa2];return _0x5e6092;};'use strict';var moment=require('moment');var BPromise=require(_0x3901('0x0'));var util=require(_0x3901('0x1'));var path=require(_0x3901('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3901('0x3'));var jayson=require(_0x3901('0x4'));var Redis=require(_0x3901('0x5'));var authService=require(_0x3901('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x3901('0x7'))(_0x3901('0x8'));var utils=require(_0x3901('0x9'));var config=require(_0x3901('0xa'));var licenseUtil=require(_0x3901('0xb'));var db=require(_0x3901('0xc'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x3901('0xd')]));require(_0x3901('0xe'))['register'](socket);config[_0x3901('0xd')]=_[_0x3901('0xf')](config[_0x3901('0xd')],{'host':_0x3901('0x10'),'port':0x18eb});var client=jayson[_0x3901('0x11')][_0x3901('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x3e91f5,_0x5575e8,_0x167f71,_0x3a7e4c){return new BPromise(function(_0xc2c793,_0x282cab){var _0x2cca5f=_0x3a7e4c||client;return _0x2cca5f[_0x3901('0x13')](_0x3e91f5,_0x167f71)[_0x3901('0x14')](function(_0xeca4bc){logger[_0x3901('0x15')]('User,\x20%s,\x20%s',_0x5575e8,_0x3901('0x16'));logger[_0x3901('0x17')](_0x3901('0x18'),_0x5575e8,'request\x20sent',JSON[_0x3901('0x19')](_0xeca4bc));if(_0xeca4bc[_0x3901('0x1a')]){if(_0xeca4bc[_0x3901('0x1a')][_0x3901('0x1b')]===0x1f4){logger[_0x3901('0x1a')](_0x3901('0x1c'),_0x5575e8,_0xeca4bc['error']['message']);return _0x282cab(_0xeca4bc['error'][_0x3901('0x1d')]);}logger['error'](_0x3901('0x1c'),_0x5575e8,_0xeca4bc[_0x3901('0x1a')][_0x3901('0x1d')]);return _0xc2c793(_0xeca4bc[_0x3901('0x1a')]['message']);}else{logger[_0x3901('0x15')](_0x3901('0x1c'),_0x5575e8,_0x3901('0x16'));_0xc2c793(_0xeca4bc[_0x3901('0x1e')]['message']);}})['catch'](function(_0x1aa073){logger[_0x3901('0x1a')](_0x3901('0x1c'),_0x5575e8,_0x1aa073);_0x282cab(_0x1aa073);});});}function respondWithStatusCode(_0x5802fe,_0x158b4e){_0x158b4e=_0x158b4e||0xcc;return function(_0x49ac62){if(_0x49ac62){return _0x5802fe[_0x3901('0x1f')](_0x158b4e);}return _0x5802fe[_0x3901('0x20')](_0x158b4e)[_0x3901('0x21')]();};}function respondWithResult(_0x5c2ff5,_0x359497){_0x359497=_0x359497||0xc8;return function(_0x16d3bd){if(_0x16d3bd){return _0x5c2ff5[_0x3901('0x20')](_0x359497)['json'](_0x16d3bd);}};}function respondWithFilteredResult(_0x3b0c96,_0x3d6beb){return function(_0x26bff2){if(_0x26bff2){var _0x272a1e=typeof _0x3d6beb[_0x3901('0x22')]==='undefined'&&typeof _0x3d6beb[_0x3901('0x23')]===_0x3901('0x24');var _0x222195=_0x26bff2['count'];var _0x197500=_0x272a1e?0x0:_0x3d6beb['offset'];var _0x29976e=_0x272a1e?_0x26bff2['count']:_0x3d6beb[_0x3901('0x22')]+_0x3d6beb[_0x3901('0x23')];var _0x24bf13;if(_0x29976e>=_0x222195){_0x29976e=_0x222195;_0x24bf13=0xc8;}else{_0x24bf13=0xce;}_0x3b0c96[_0x3901('0x20')](_0x24bf13);return _0x3b0c96['set'](_0x3901('0x25'),_0x197500+'-'+_0x29976e+'/'+_0x222195)[_0x3901('0x26')](_0x26bff2);}return null;};}function saveUpdates(_0x583067){return function(_0x307b57){if(_0x307b57){return _0x307b57[_0x3901('0x27')](_0x583067)[_0x3901('0x14')](function(_0x2a5046){return _0x2a5046;});}return null;};}function removeEntity(_0x25bd7e){return function(_0x1ccebc){if(_0x1ccebc){return _0x1ccebc['destroy']()[_0x3901('0x14')](function(){var _0x23f856=_0x1ccebc['get']({'plain':!![]});if(_0x23f856[_0x3901('0x28')]===_0x3901('0x29'))return;var _0x18442a=[{'name':_0x3901('0x2a'),'value':_0x3901('0x2b'),'ignore':!![]},{'name':_0x3901('0x2c'),'value':_0x3901('0x2d'),'ignore':![]},{'name':'Telephones','value':_0x3901('0x2e'),'ignore':![]}];var _0x2c7431=_(_0x18442a)['filter'](_0x3901('0x2f'))[_0x3901('0x30')]('value')[_0x3901('0x31')]();if(_[_0x3901('0x32')](_0x2c7431,_0x23f856[_0x3901('0x28')])){return;}var _0x486836=_[_0x3901('0x33')](_0x18442a,[_0x3901('0x31'),_0x23f856['role']])[_0x3901('0x34')];return db[_0x3901('0x35')][_0x3901('0x36')]({'where':{'type':_0x486836,'resourceId':_0x23f856['id']}})[_0x3901('0x14')](function(){return _0x1ccebc;});})['then'](function(){_0x25bd7e['status'](0xcc)[_0x3901('0x21')]();});}};}function handleEntityNotFound(_0x379509){return function(_0x5a5c1d){if(!_0x5a5c1d){_0x379509[_0x3901('0x1f')](0x194);}return _0x5a5c1d;};}function handleError(_0x2ce0bd,_0x36b390){_0x36b390=_0x36b390||0x1f4;return function(_0x543a96){logger[_0x3901('0x1a')](_0x543a96[_0x3901('0x37')]);if(_0x543a96['name']){delete _0x543a96[_0x3901('0x34')];}_0x2ce0bd[_0x3901('0x20')](_0x36b390)['send'](_0x543a96);};}exports['index']=function(_0x7fc36a,_0x39af36){var _0x258cd1={},_0x410107={'count':0x0,'rows':[]};var _0x2f57e1=_(db[_0x3901('0x38')]['rawAttributes'])[_0x3901('0x30')](function(_0x4716dd){return{'name':_0x4716dd[_0x3901('0x39')],'type':_0x4716dd[_0x3901('0x3a')][_0x3901('0x3b')]};})[_0x3901('0x3c')](function(_0x446ad6){return!_[_0x3901('0x32')]([_0x3901('0x3d'),_0x3901('0x3e')],_0x446ad6[_0x3901('0x34')]);})[_0x3901('0x31')]();_0x258cd1=qs['getOptions'](_0x2f57e1,_0x7fc36a);var _0x20a59d={'where':_0x258cd1[_0x3901('0x3f')]};return db[_0x3901('0x38')][_0x3901('0x40')](_0x20a59d)[_0x3901('0x14')](function(_0x64c13a){_0x410107['count']=_0x64c13a;if(_0x7fc36a[_0x3901('0x41')][_0x3901('0x42')]){_0x258cd1['include']=[{'all':!![]}];}if(_0x7fc36a[_0x3901('0x41')][_0x3901('0x43')]===_0x3901('0x44')){_0x258cd1[_0x3901('0x45')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0x3901('0x32')](_0x258cd1[_0x3901('0x46')],'id')){_0x258cd1[_0x3901('0x46')][_0x3901('0x47')]('id');}return db['User'][_0x3901('0x48')](_0x258cd1);})[_0x3901('0x14')](function(_0xb05af5){_0x410107[_0x3901('0x49')]=_0xb05af5;if(_0x7fc36a[_0x3901('0x41')][_0x3901('0x4a')]===_0x3901('0x44')){var _0x59c2b0=[];for(var _0x5adb72=0x0;_0x5adb72<_0x410107['rows'][_0x3901('0x4b')];_0x5adb72++){_0x59c2b0[_0x3901('0x47')](get_open_tabs(_0x3901('0x4c'),_0x410107[_0x3901('0x49')][_0x5adb72]['dataValues']));_0x59c2b0[_0x3901('0x47')](get_open_tabs('sms',_0x410107['rows'][_0x5adb72][_0x3901('0x4d')]));_0x59c2b0[_0x3901('0x47')](get_open_tabs('fax',_0x410107[_0x3901('0x49')][_0x5adb72][_0x3901('0x4d')]));_0x59c2b0[_0x3901('0x47')](get_open_tabs(_0x3901('0x4e'),_0x410107['rows'][_0x5adb72][_0x3901('0x4d')]));_0x59c2b0[_0x3901('0x47')](get_open_tabs(_0x3901('0x4f'),_0x410107['rows'][_0x5adb72][_0x3901('0x4d')]));_0x59c2b0['push'](get_open_tabs(_0x3901('0x50'),_0x410107['rows'][_0x5adb72][_0x3901('0x4d')]));}return BPromise['all'](_0x59c2b0)[_0x3901('0x14')](function(){return _0x410107;});}else{return _0x410107;}})['then'](respondWithFilteredResult(_0x39af36,_0x258cd1))[_0x3901('0x51')](handleError(_0x39af36,null));};exports[_0x3901('0x52')]=function(_0x36496a,_0x6adceb){var _0x48f3c4={'raw':![],'where':{'id':_0x36496a[_0x3901('0x53')]['id']}},_0x16f5d8={};_0x16f5d8[_0x3901('0x54')]=_[_0x3901('0x55')](_[_0x3901('0x56')](db[_0x3901('0x38')][_0x3901('0x57')]),['password','salt']);_0x16f5d8['query']=_['keys'](_0x36496a[_0x3901('0x41')]);_0x16f5d8[_0x3901('0x58')]=_['intersection'](_0x16f5d8[_0x3901('0x54')],_0x16f5d8[_0x3901('0x41')]);_0x48f3c4[_0x3901('0x46')]=_['intersection'](_0x16f5d8['model'],qs[_0x3901('0x59')](_0x36496a[_0x3901('0x41')][_0x3901('0x59')]));_0x48f3c4[_0x3901('0x46')]=_0x48f3c4['attributes'][_0x3901('0x4b')]?_0x48f3c4[_0x3901('0x46')]:_0x16f5d8[_0x3901('0x54')];if(_0x36496a[_0x3901('0x41')][_0x3901('0x42')]){_0x48f3c4['include']=[{'all':!![]}];}if(_0x36496a[_0x3901('0x41')]['userSetting']===_0x3901('0x44')){_0x48f3c4[_0x3901('0x45')]=[{'model':db[_0x3901('0x5a')],'as':_0x3901('0x43')}];}_0x48f3c4=_[_0x3901('0x5b')]({},_0x48f3c4,_0x36496a[_0x3901('0x5c')]);if(!_[_0x3901('0x32')](_0x48f3c4['attributes'],'id')){_0x48f3c4[_0x3901('0x46')][_0x3901('0x47')]('id');}return db['User'][_0x3901('0x33')](_0x48f3c4)[_0x3901('0x14')](handleEntityNotFound(_0x6adceb,null))[_0x3901('0x14')](function(_0x1454dc){var _0x3500d4=[];values=_0x1454dc;if(_0x36496a['query'][_0x3901('0x4a')]===_0x3901('0x44')){_0x3500d4[_0x3901('0x47')](get_open_tabs(_0x3901('0x4c'),_0x1454dc[_0x3901('0x4d')]));_0x3500d4[_0x3901('0x47')](get_open_tabs(_0x3901('0x5d'),_0x1454dc[_0x3901('0x4d')]));_0x3500d4[_0x3901('0x47')](get_open_tabs(_0x3901('0x4f'),_0x1454dc[_0x3901('0x4d')]));_0x3500d4[_0x3901('0x47')](get_open_tabs('whatsapp',_0x1454dc[_0x3901('0x4d')]));_0x3500d4[_0x3901('0x47')](get_open_tabs(_0x3901('0x5e'),_0x1454dc[_0x3901('0x4d')]));_0x3500d4['push'](get_open_tabs(_0x3901('0x4e'),_0x1454dc[_0x3901('0x4d')]));return BPromise['all'](_0x3500d4);}else{return values;}})['then'](function(){return values;})[_0x3901('0x14')](respondWithResult(_0x6adceb,null))[_0x3901('0x51')](handleError(_0x6adceb,null));};exports[_0x3901('0x27')]=function(_0x543149,_0x3d9989){if(_0x543149[_0x3901('0x5f')]['id']){delete _0x543149['body']['id'];}delete _0x543149[_0x3901('0x5f')]['role'];return db['User']['find']({'where':{'id':_0x543149[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x3d9989,null))['then'](saveUpdates(_0x543149[_0x3901('0x5f')],null))[_0x3901('0x14')](respondWithResult(_0x3d9989,null))[_0x3901('0x51')](handleError(_0x3d9989,null));};exports[_0x3901('0x60')]=function(_0x3446d6,_0x8d1cf5){return db['User'][_0x3901('0x60')]()[_0x3901('0x14')](respondWithResult(_0x8d1cf5,null))[_0x3901('0x51')](handleError(_0x8d1cf5,null));};exports['addContacts']=function(_0x51300d,_0x38e503){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x51300d[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x38e503,null))[_0x3901('0x14')](function(_0x1b6152){if(_0x1b6152){return _0x1b6152[_0x3901('0x61')](_0x51300d[_0x3901('0x5f')][_0x3901('0x62')],_['omit'](_0x51300d['body'],[_0x3901('0x62'),'id'])||{});}})[_0x3901('0x14')](respondWithResult(_0x38e503,null))['catch'](handleError(_0x38e503,null));};function validateUser(_0x2cae74){return new BPromise(function(_0x1d89b3,_0x4b4023){if(_0x2cae74[_0x3901('0x63')])return _0x1d89b3(_0x2cae74);return db[_0x3901('0x64')][_0x3901('0x65')](0x1)[_0x3901('0x14')](function(_0x623c36){if(_0x623c36[_0x3901('0x66')])authService[_0x3901('0x67')](_0x2cae74['password']);db[_0x3901('0x38')]['max'](_0x3901('0x63'))['then'](function(_0x227a06){if(_[_0x3901('0x68')](_0x227a06)){_0x2cae74[_0x3901('0x63')]=_0x623c36[_0x3901('0x69')]||0x1;return;}if(_['isNil'](_0x623c36[_0x3901('0x69')])||_0x623c36[_0x3901('0x69')]===_0x227a06){_0x2cae74[_0x3901('0x63')]=_0x227a06+0x1;return;}if(_0x623c36[_0x3901('0x69')]>_0x227a06){_0x2cae74[_0x3901('0x63')]=_0x623c36[_0x3901('0x69')];return;}return db['sequelize'][_0x3901('0x41')](_0x3901('0x6a'),{'type':db[_0x3901('0x6b')]['QueryTypes'][_0x3901('0x6c')]})['then'](function(_0x5984b6){if(_0x5984b6&&_0x5984b6[_0x3901('0x4b')]){for(var _0x5364fd=0x0,_0x744a2f=_0x5984b6[_0x3901('0x4b')];_0x5364fd<_0x744a2f&&_['isNil'](_0x2cae74['internal']);_0x5364fd++){if(_0x623c36['min_internal']<=_0x5984b6[_0x5364fd][_0x3901('0x6d')]){_0x2cae74[_0x3901('0x63')]=_0x5984b6[_0x5364fd][_0x3901('0x6d')];}else if(_0x623c36['min_internal']>_0x5984b6[_0x5364fd][_0x3901('0x6d')]&&_0x623c36[_0x3901('0x69')]<=_0x5984b6[_0x5364fd]['to']){_0x2cae74[_0x3901('0x63')]=_0x623c36[_0x3901('0x69')];}}}if(_[_0x3901('0x68')](_0x2cae74[_0x3901('0x63')])){_0x2cae74['internal']=_0x227a06+0x1;}return _0x1d89b3(_0x2cae74);});});})[_0x3901('0x51')](function(_0x594b28){_0x4b4023(_0x594b28);});});}function updateUser(_0x12be85){return new BPromise(function(_0xf8bef5,_0x28eb4a){try{if(_0x12be85[_0x3901('0x6e')]){_0x12be85[_0x3901('0x6f')]=_0x12be85[_0x3901('0x63')];_0x12be85[_0x3901('0x70')]={'mailbox':_0x12be85['internal'],'password':_0x12be85['password'],'fullname':_0x12be85[_0x3901('0x71')],'email':_0x12be85['email']};}if(_0x12be85[_0x3901('0x28')]===_0x3901('0x2d')){if(!_0x12be85[_0x3901('0x72')])_0x12be85[_0x3901('0x72')]=[_0x3901('0x73'),_0x3901('0x74'),'103','113',_0x3901('0x75'),_0x3901('0x76'),_0x3901('0x77'),_0x3901('0x78'),_0x3901('0x79'),_0x3901('0x7a'),'109',_0x3901('0x7b'),_0x3901('0x7c'),_0x3901('0x7d'),_0x3901('0x7e')];}_0xf8bef5(_0x12be85);}catch(_0x324207){_0x28eb4a(_0x324207);}});}exports['create']=function(_0x19edcf,_0x116304){if(_0x19edcf[_0x3901('0x2b')][_0x3901('0x28')]===_0x3901('0x2d'))throw new Error('Unauthorized');if(_0x19edcf['body'][_0x3901('0x28')]==='user'&&_0x19edcf[_0x3901('0x2b')][_0x3901('0x28')]!==_0x3901('0x29')){throw new Error(_0x3901('0x7f'));}if(_0x19edcf[_0x3901('0x5f')]['role']==='admin'&&_0x19edcf[_0x3901('0x2b')][_0x3901('0x28')]!==_0x3901('0x29')){throw new Error(_0x3901('0x80'));}return licenseUtil['checkUserLimits']([_0x19edcf[_0x3901('0x5f')]])[_0x3901('0x14')](function(){return validateUser(_0x19edcf[_0x3901('0x5f')]);})['then'](function(_0x3a532a){return updateUser(_0x3a532a)[_0x3901('0x14')](function(_0x1ae28a){if(_0x1ae28a['role']==='admin'){_0x1ae28a[_0x3901('0x81')]=_0x19edcf[_0x3901('0x2b')][_0x3901('0x81')];delete _0x1ae28a[_0x3901('0x82')];}return _0x1ae28a;});})[_0x3901('0x14')](function(_0x2f831d){return db[_0x3901('0x38')][_0x3901('0x83')](_0x2f831d,{'include':[{'model':db['VoiceMail'],'as':_0x3901('0x70')}]});})['then'](function(_0x3c74b9){if(_0x19edcf[_0x3901('0x5f')][_0x3901('0x28')]===_0x3901('0x2b'))return _0x3c74b9;if(_0x19edcf[_0x3901('0x2b')][_0x3901('0x28')]!==_0x3901('0x2b'))return _0x3c74b9;return db['UserProfileSection']['find']({'where':{'name':_0x3c74b9[_0x3901('0x28')]==='agent'?'Agents':_0x3901('0x84'),'userProfileId':_0x19edcf[_0x3901('0x2b')][_0x3901('0x82')]},'raw':!![]})[_0x3901('0x14')](function(_0x360d09){if(!_0x360d09||_0x360d09[_0x3901('0x85')]!=0x0)return _0x3c74b9;return db['UserProfileResource'][_0x3901('0x83')]({'name':_0x3c74b9[_0x3901('0x34')],'resourceId':_0x3c74b9['id'],'type':_0x360d09[_0x3901('0x34')],'sectionId':_0x360d09['id']},{})[_0x3901('0x14')](function(){return _0x3c74b9;});})['catch'](function(_0xa13492){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa13492);throw _0xa13492;});})[_0x3901('0x14')](respondWithResult(_0x116304,0xc9))[_0x3901('0x51')](handleError(_0x116304,null));};exports[_0x3901('0x86')]=function(_0x8bdce2,_0x55fc2b){var _0x157ad3=_0x8bdce2[_0x3901('0x5f')];var _0x440d70=[];if(_0x8bdce2[_0x3901('0x2b')][_0x3901('0x28')]===_0x3901('0x2d'))throw new Error(_0x3901('0x87'));if(_[_0x3901('0x88')](_0x157ad3,[_0x3901('0x28'),_0x3901('0x2b')])&&_0x8bdce2[_0x3901('0x2b')]['role']!==_0x3901('0x29')){throw new Error(_0x3901('0x7f'));}if(_[_0x3901('0x88')](_0x157ad3,['role','admin'])&&_0x8bdce2[_0x3901('0x2b')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x3901('0x89')](_0x157ad3)[_0x3901('0x14')](function(){return validateUser(_0x157ad3[0x0]);})[_0x3901('0x14')](function(){for(var _0x57248c=0x1;_0x57248c<_0x157ad3[_0x3901('0x4b')];_0x57248c++){var _0x52d213=_0x157ad3[_0x57248c-0x1][_0x3901('0x63')];if(!_0x157ad3[_0x57248c][_0x3901('0x63')])_0x157ad3[_0x57248c][_0x3901('0x63')]=_0x52d213+0x1;_0x440d70[_0x3901('0x47')](validateUser(_0x157ad3[_0x57248c]));}return BPromise[_0x3901('0x8a')](_0x440d70);})['then'](function(){_0x440d70=[];for(var _0x19d545=0x0;_0x19d545<_0x157ad3[_0x3901('0x4b')];_0x19d545++){_0x440d70[_0x3901('0x47')](updateUser(_0x157ad3[_0x19d545]));}return BPromise[_0x3901('0x8a')](_0x440d70);})['then'](function(){return BPromise[_0x3901('0x8b')](_0x157ad3,function(_0x1d8657){return db[_0x3901('0x38')][_0x3901('0x83')](_0x1d8657,{'include':[{'model':db['VoiceMail'],'as':_0x3901('0x70')}]})[_0x3901('0x14')](function(_0x659916){_0x1d8657['id']=_0x659916['id'];return _0x1d8657;});});})[_0x3901('0x14')](function(_0x5d63a3){if(_0x8bdce2[_0x3901('0x5f')][_0x3901('0x28')]==='user')return _0x5d63a3;if(_0x8bdce2[_0x3901('0x2b')]['role']!==_0x3901('0x2b'))return _0x5d63a3;var _0x4e2ca4=_[_0x3901('0x88')](_0x5d63a3,function(_0x40c6bb){return _0x40c6bb[_0x3901('0x28')]===_0x3901('0x2d')||_0x40c6bb[_0x3901('0x28')]===_0x3901('0x2e');});if(!_0x4e2ca4)return _0x5d63a3;return db['UserProfileSection'][_0x3901('0x48')]({'where':{'name':{'$or':['Agents',_0x3901('0x84')]},'userProfileId':_0x8bdce2[_0x3901('0x2b')]['userProfileId']},'raw':!![]})['then'](function(_0x2e21c5){if(_['isEmpty'](_0x2e21c5)||!_['some'](_0x2e21c5,['autoAssociation',0x0]))return _0x5d63a3;_0x440d70=[];var _0x280a48=_(_0x2e21c5)['map'](function(_0x3524b3){if(_0x3524b3[_0x3901('0x85')]===0x1)return;return _0x3524b3['name']===_0x3901('0x2c')?_0x3901('0x2d'):_0x3901('0x2e');})[_0x3901('0x8c')]()[_0x3901('0x31')]();for(var _0x535b7b=0x0;_0x535b7b<_0x5d63a3[_0x3901('0x4b')];_0x535b7b++){if(!_[_0x3901('0x32')](_0x280a48,_0x5d63a3[_0x535b7b][_0x3901('0x28')]))return;var _0x33288c=_0x5d63a3[_0x535b7b][_0x3901('0x28')]===_0x3901('0x2d')?'Agents':_0x3901('0x84');_0x440d70['push'](db[_0x3901('0x35')]['create']({'name':_0x5d63a3[_0x535b7b][_0x3901('0x34')],'resourceId':_0x5d63a3[_0x535b7b]['id'],'type':_0x33288c,'sectionId':_[_0x3901('0x33')](_0x2e21c5,['name',_0x33288c])['id']},{}));}return BPromise[_0x3901('0x8a')](_0x440d70);});})[_0x3901('0x14')](respondWithResult(_0x55fc2b,0xc9))[_0x3901('0x51')](handleError(_0x55fc2b,null));};exports['changePassword']=function(_0x122e23,_0x3c49cc){if(_0x122e23[_0x3901('0x5f')]['id']){delete _0x122e23[_0x3901('0x5f')]['id'];}return db[_0x3901('0x38')]['find']({'where':{'id':_0x122e23['params']['id']}})[_0x3901('0x14')](function(_0x29286e){if(!_0x29286e)return null;if(_0x29286e['id']===_0x122e23[_0x3901('0x2b')]['id']){if(!_0x122e23[_0x3901('0x5f')][_0x3901('0x8d')]||!_0x122e23['body']['newPassword']){throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))](_0x3901('0x90'));}if(!_0x29286e[_0x3901('0x91')](_0x122e23['body']['oldPassword'])){throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))]('Wrong\x20credentials');}if(_0x122e23[_0x3901('0x5f')][_0x3901('0x8d')]===_0x122e23[_0x3901('0x5f')][_0x3901('0x92')]){throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))](_0x3901('0x93'));}}else if(_0x122e23['user'][_0x3901('0x28')]==='admin'){if(!_0x122e23[_0x3901('0x5f')][_0x3901('0x92')]){throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))](_0x3901('0x94'));}}else if(_0x122e23[_0x3901('0x2b')][_0x3901('0x28')]===_0x3901('0x2b')){if(!_0x122e23['body'][_0x3901('0x92')]){throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x29286e[_0x3901('0x28')]!==_0x3901('0x2d')){throw new db[(_0x3901('0x8e'))]['ValidationError'](_0x3901('0x87'));}}else{throw new db['Sequelize'][(_0x3901('0x8f'))]('Unauthorized');}return _0x29286e;})[_0x3901('0x14')](handleEntityNotFound(_0x3c49cc,null))[_0x3901('0x14')](function(_0x4b9107){return db[_0x3901('0x64')][_0x3901('0x95')]({'attributes':['id','securePassword',_0x3901('0x96'),_0x3901('0x97')]})[_0x3901('0x14')](function(_0x4537b1){if(_0x4537b1['securePassword'])authService[_0x3901('0x67')](_0x122e23['body']['newPassword']);if(!_0x4537b1['enforcePasswordHistory']||!_0x4b9107[_0x3901('0x98')])return _0x4b9107;authService[_0x3901('0x99')](_0x122e23['body'][_0x3901('0x92')],_0x4b9107[_0x3901('0x98')],_0x4537b1[_0x3901('0x97')]);return _0x4b9107;})[_0x3901('0x14')](saveUpdates({'password':_0x122e23[_0x3901('0x5f')][_0x3901('0x92')],'passwordResetAt':_0x122e23[_0x3901('0x2b')]['id']==_0x122e23[_0x3901('0x53')]['id']?moment():null,'previousPasswords':authService[_0x3901('0x9a')](_0x122e23[_0x3901('0x5f')][_0x3901('0x92')],_0x4b9107[_0x3901('0x98')])},null));})[_0x3901('0x14')](respondWithResult(_0x3c49cc,null))[_0x3901('0x51')](handleError(_0x3c49cc,null));};exports[_0x3901('0x9b')]=function(_0x57f87e,_0x4ca7cf){var _0x267adb=_0x57f87e[_0x3901('0x5f')]['channel'];return db['User'][_0x3901('0x33')]({'where':{'id':_0x57f87e['params']['id']},'attributes':['id','name','role',_0x3901('0x9c'),'loginInPause','voicePause','interface']})[_0x3901('0x14')](handleEntityNotFound(_0x4ca7cf,null))[_0x3901('0x14')](function(_0x4b75c0){if(_0x4b75c0){if(!utils[_0x3901('0x9d')](_0x267adb)){throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))](_0x3901('0x9e'));}return _0x4b75c0[_0x3901('0x9f')+_['capitalize'](_0x267adb[_0x3901('0xa0')]())+_0x3901('0xa1')](_0x57f87e[_0x3901('0x5f')][_0x3901('0x62')],{'penalty':_0x57f87e['body']['penalty']||0x0})['spread'](function(_0x2da94e){for(var _0xb54640=0x0;_0xb54640<_0x57f87e[_0x3901('0x5f')][_0x3901('0x62')][_0x3901('0x4b')];_0xb54640+=0x1){var _0x4cd166={'UserId':Number(_0x57f87e['params']['id'])};_0x4cd166[_[_0x3901('0xa2')](_0x267adb['toLowerCase']())+_0x3901('0xa3')]=Number(_0x57f87e['body'][_0x3901('0x62')][_0xb54640]);socket[_0x3901('0xa4')](_0x3901('0x2b')+_[_0x3901('0xa2')](_0x267adb[_0x3901('0xa0')]())+_0x3901('0xa5'),_0x4cd166);}return _0x2da94e;})[_0x3901('0x14')](function(){if(_0x267adb===_0x3901('0xa6')){return db[_0x3901('0xa7')]['findAll']({'where':{'id':_0x57f87e[_0x3901('0x5f')][_0x3901('0x62')]||[]},'raw':!![],'attributes':['id',_0x3901('0x34')]});}})[_0x3901('0x14')](function(_0x153306){var _0x539e1d=_0x4b75c0[_0x3901('0xa8')]({'plain':!![]});var _0xb3085e=[];if(_0x267adb===_0x3901('0xa6')&&_0x539e1d[_0x3901('0x28')]===_0x3901('0x2d')&&_0x539e1d[_0x3901('0x9c')]){for(var _0x182aa1=0x0;_0x182aa1<_0x153306[_0x3901('0x4b')];_0x182aa1+=0x1){_0xb3085e[_0x3901('0x47')]({'membername':_0x539e1d[_0x3901('0x34')],'UserId':_0x539e1d['id'],'queue_name':_0x153306[_0x182aa1][_0x3901('0x34')],'VoiceQueueId':_0x153306[_0x182aa1]['id'],'interface':_[_0x3901('0x68')](_0x539e1d[_0x3901('0xa9')])?util[_0x3901('0xaa')](_0x3901('0xab'),_0x539e1d[_0x3901('0x34')]):_0x539e1d[_0x3901('0xa9')],'paused':_0x539e1d[_0x3901('0xac')]||![],'penalty':_0x57f87e[_0x3901('0x5f')][_0x3901('0xad')]||0x0});}return BPromise[_0x3901('0x8b')](_0xb3085e,function(_0x584bde){return db[_0x3901('0xae')][_0x3901('0xaf')](_0x584bde);});}return _0x4b75c0;});}})[_0x3901('0x14')](respondWithStatusCode(_0x4ca7cf,null))[_0x3901('0x51')](handleError(_0x4ca7cf,null));};exports['removeQueues']=function(_0x42830d,_0x161213){var _0x3147d5,_0x434594;return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x42830d[_0x3901('0x53')]['id']},'attributes':['id',_0x3901('0x34'),'role']})['then'](handleEntityNotFound(_0x161213,null))[_0x3901('0x14')](function(_0x44fcad){if(_0x44fcad){_0x3147d5=_0x44fcad;if(!_0x42830d[_0x3901('0x41')][_0x3901('0xb0')]||!utils[_0x3901('0x9d')](_0x42830d[_0x3901('0x41')][_0x3901('0xb0')])){throw new db['Sequelize'][(_0x3901('0x8f'))](_0x3901('0x9e'));}return _0x44fcad[_0x3901('0xb1')+_[_0x3901('0xa2')](_0x42830d[_0x3901('0x41')]['channel'][_0x3901('0xa0')]())+_0x3901('0xa1')](_0x42830d[_0x3901('0x41')][_0x3901('0x62')]);}})[_0x3901('0x14')](function(_0x25bb95){if(_[_0x3901('0xb2')](_0x42830d[_0x3901('0x41')][_0x3901('0x62')])){for(var _0x427ee5=0x0;_0x427ee5<_0x42830d[_0x3901('0x41')][_0x3901('0x62')][_0x3901('0x4b')];_0x427ee5+=0x1){_0x434594={'UserId':Number(_0x42830d[_0x3901('0x53')]['id'])};_0x434594[_['capitalize'](_0x42830d[_0x3901('0x41')][_0x3901('0xb0')]['toLowerCase']())+_0x3901('0xa3')]=Number(_0x42830d[_0x3901('0x41')]['ids'][_0x427ee5]);socket['emit'](_0x3901('0x2b')+_[_0x3901('0xa2')](_0x42830d[_0x3901('0x41')][_0x3901('0xb0')][_0x3901('0xa0')]())+_0x3901('0xb3'),_0x434594);}}else{_0x434594={'UserId':Number(_0x42830d[_0x3901('0x53')]['id'])};_0x434594[_[_0x3901('0xa2')](_0x42830d['query'][_0x3901('0xb0')][_0x3901('0xa0')]())+_0x3901('0xa3')]=Number(_0x42830d['query']['ids']);socket[_0x3901('0xa4')](_0x3901('0x2b')+_[_0x3901('0xa2')](_0x42830d[_0x3901('0x41')][_0x3901('0xb0')][_0x3901('0xa0')]())+_0x3901('0xb3'),_0x434594);}return _0x25bb95;})['then'](function(){if(_0x42830d[_0x3901('0x41')][_0x3901('0xb0')]===_0x3901('0xa6')){return db['UserVoiceQueueRt'][_0x3901('0x36')]({'where':{'UserId':_0x42830d[_0x3901('0x53')]['id'],'VoiceQueueId':_0x42830d[_0x3901('0x41')]['ids']},'individualHooks':!![]})[_0x3901('0x14')](function(){return _0x3147d5;});}return _0x3147d5;})[_0x3901('0x14')](respondWithStatusCode(_0x161213,null))[_0x3901('0x51')](handleError(_0x161213,null));};exports[_0x3901('0xb4')]=function(_0x2b4da9,_0x3bb255){_0x2b4da9[_0x3901('0x5f')][_0x3901('0xb5')]=_0x2b4da9['file']['filename'];return db['User'][_0x3901('0x33')]({'where':{'id':_0x2b4da9[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x3bb255,null))[_0x3901('0x14')](saveUpdates(_0x2b4da9[_0x3901('0x5f')],null))[_0x3901('0x14')](respondWithResult(_0x3bb255,null))[_0x3901('0x51')](handleError(_0x3bb255,null));};exports[_0x3901('0xb6')]=function(_0x46feb0,_0x4ffa57){var _0x244c11=path['join'](config[_0x3901('0xb7')],_0x3901('0xb8'));return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x46feb0['params']['id']},'attributes':['id',_0x3901('0xb5')],'raw':!![]})['then'](handleEntityNotFound(_0x4ffa57,null))[_0x3901('0x14')](function(_0x52f9f0){if(_0x52f9f0){if(_[_0x3901('0x68')](_0x52f9f0[_0x3901('0xb5')])){return _0x4ffa57[_0x3901('0xb9')](_0x244c11);}else{if(!fs[_0x3901('0xba')](path['join'](config['root'],'server/files/images/',_0x52f9f0[_0x3901('0xb5')]))){return _0x4ffa57[_0x3901('0xb9')](_0x244c11);}return _0x4ffa57[_0x3901('0xb9')](path[_0x3901('0xbb')](config['root'],'server/files/images/',_0x52f9f0[_0x3901('0xb5')]));}}})[_0x3901('0x51')](handleError(_0x4ffa57,null));};exports[_0x3901('0xbc')]=function(_0x274964,_0x3ee842){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x274964['params']['id']},'attributes':['id']})[_0x3901('0x14')](handleEntityNotFound(_0x3ee842,null))[_0x3901('0x14')](function(_0x48513f){var _0x142b77=[];values=_0x48513f['dataValues'];_0x142b77[_0x3901('0x47')](get_open_tabs(_0x3901('0x4c'),_0x48513f[_0x3901('0x4d')]));_0x142b77['push'](get_open_tabs(_0x3901('0x5d'),_0x48513f[_0x3901('0x4d')]));_0x142b77['push'](get_open_tabs('openchannel',_0x48513f['dataValues']));_0x142b77[_0x3901('0x47')](get_open_tabs(_0x3901('0x50'),_0x48513f[_0x3901('0x4d')]));_0x142b77[_0x3901('0x47')](get_open_tabs('fax',_0x48513f[_0x3901('0x4d')]));_0x142b77[_0x3901('0x47')](get_open_tabs(_0x3901('0x4e'),_0x48513f[_0x3901('0x4d')]));return BPromise[_0x3901('0x8a')](_0x142b77);})[_0x3901('0x14')](function(_0x54a3be){if(_0x54a3be){var _0x18b9c6=_['map'](values['ChatOpenTabs'],function(_0x4de531){return{'channel':_0x3901('0xbd'),'id':_0x4de531['id'],'createdAt':_0x4de531['createdAt']};});var _0x455d0e=_[_0x3901('0x30')](values['FaxOpenTabs'],function(_0x18794d){return{'channel':_0x3901('0xbe'),'id':_0x18794d['id'],'createdAt':_0x18794d[_0x3901('0xbf')]};});var _0xdfd36d=_[_0x3901('0x30')](values[_0x3901('0xc0')],function(_0x4d3e7d){return{'channel':_0x3901('0xc1'),'id':_0x4d3e7d['id'],'createdAt':_0x4d3e7d[_0x3901('0xbf')]};});var _0xcd2c8a=_[_0x3901('0x30')](values[_0x3901('0xc2')],function(_0x190aae){return{'channel':'MAIL','id':_0x190aae['id'],'createdAt':_0x190aae['createdAt']};});var _0x492480=_[_0x3901('0x30')](values[_0x3901('0xc3')],function(_0x3cf670){return{'channel':_0x3901('0xc4'),'id':_0x3cf670['id'],'createdAt':_0x3cf670[_0x3901('0xbf')]};});var _0x37913d=_[_0x3901('0x30')](values[_0x3901('0xc5')],function(_0xf5942b){return{'channel':_0x3901('0xc6'),'id':_0xf5942b['id'],'createdAt':_0xf5942b[_0x3901('0xbf')]};});var _0x4a4aa9=_[_0x3901('0xc7')](_0x18b9c6,_0x455d0e,_0xdfd36d,_0xcd2c8a,_0x492480,_0x37913d);var _0x4914d4={'count':_0x4a4aa9[_0x3901('0x4b')],'rows':_0x4a4aa9};return _0x4914d4;}else return null;})[_0x3901('0x14')](respondWithResult(_0x3ee842,null))[_0x3901('0x51')](handleError(_0x3ee842,null));};exports[_0x3901('0xc8')]=function(_0x1b7fd6,_0x440b59){var _0x577a5c={};var _0x29189b={};var _0x3c9d15;var _0x3a6a28;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x1b7fd6[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x440b59,null))['then'](function(_0x1d76f5){if(_0x1d76f5){_0x3c9d15=_0x1d76f5;_0x29189b['model']=_[_0x3901('0x56')](db[_0x3901('0xc9')][_0x3901('0x57')]);_0x29189b[_0x3901('0x41')]=_[_0x3901('0x56')](_0x1b7fd6[_0x3901('0x41')]);_0x29189b['filters']=_[_0x3901('0xca')](_0x29189b[_0x3901('0x54')],_0x29189b[_0x3901('0x41')]);_0x577a5c[_0x3901('0x46')]=_[_0x3901('0xca')](_0x29189b[_0x3901('0x54')],qs[_0x3901('0x59')](_0x1b7fd6['query'][_0x3901('0x59')]));_0x577a5c[_0x3901('0x46')]=_0x577a5c[_0x3901('0x46')][_0x3901('0x4b')]?_0x577a5c[_0x3901('0x46')]:_0x29189b[_0x3901('0x54')];_0x577a5c[_0x3901('0xcb')]=qs['sort'](_0x1b7fd6[_0x3901('0x41')]['sort']);_0x577a5c[_0x3901('0x3f')]=qs[_0x3901('0x58')](_['pick'](_0x1b7fd6[_0x3901('0x41')],_0x29189b[_0x3901('0x58')]));if(_0x1b7fd6[_0x3901('0x41')]['filter']){_0x577a5c[_0x3901('0x3f')]=_['merge'](_0x577a5c[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x577a5c[_0x3901('0x46')],function(_0x3690e9){var _0x1174fd={};_0x1174fd[_0x3690e9]={'$like':'%'+_0x1b7fd6['query'][_0x3901('0x3c')]+'%'};return _0x1174fd;})});}_0x577a5c=_[_0x3901('0x5b')]({},_0x577a5c,_0x1b7fd6[_0x3901('0x5c')]);return _0x3c9d15[_0x3901('0xc8')](_0x577a5c);}})[_0x3901('0x14')](function(_0x227648){if(_0x227648){_0x3a6a28=_0x227648[_0x3901('0x4b')];if(_0x1b7fd6['query'][_0x3901('0xcc')](_0x3901('0x42'))){_0x577a5c['include']=[{'model':db[_0x3901('0xcd')],'as':_0x3901('0xce'),'required':![]},{'model':db[_0x3901('0xcf')],'as':_0x3901('0xd0'),'attributes':['id',_0x3901('0x34'),_0x3901('0xd1')],'where':_0x1b7fd6['query']['tag']?{'id':_0x1b7fd6['query'][_0x3901('0xd2')]}:undefined,'required':_0x1b7fd6[_0x3901('0x41')]['tag']?!![]:![]}];}if(!_0x1b7fd6['query'][_0x3901('0xcc')](_0x3901('0xd3'))){_0x577a5c[_0x3901('0x23')]=qs['limit'](_0x1b7fd6['query'][_0x3901('0x23')]);_0x577a5c[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x1b7fd6[_0x3901('0x41')][_0x3901('0x22')]);}return _0x3c9d15[_0x3901('0xc8')](_0x577a5c);}})[_0x3901('0x14')](function(_0x4d2356){if(_0x4d2356){return _0x4d2356?{'count':_0x3a6a28,'rows':_0x4d2356}:null;}})[_0x3901('0x14')](respondWithResult(_0x440b59,null))[_0x3901('0x51')](handleError(_0x440b59,null));};exports['getQueues']=function(_0x5eacb0,_0x4c05f4){var _0x539c93;var _0x491d7c={};var _0x289446;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x5eacb0[_0x3901('0x53')]['id']},'attributes':['id','name',_0x3901('0x28')]})[_0x3901('0x14')](handleEntityNotFound(_0x4c05f4,null))[_0x3901('0x14')](function(_0x274e4){if(!utils[_0x3901('0x9d')](_0x5eacb0['query'][_0x3901('0xb0')])){throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))]('Unknown\x20channel');}_0x539c93=_0x274e4;var _0x1d21f8={};_0x1d21f8[_0x3901('0x54')]=_[_0x3901('0x56')](db[_[_0x3901('0xa2')](_0x5eacb0[_0x3901('0x41')][_0x3901('0xb0')])+_0x3901('0xd4')][_0x3901('0x57')]);_0x1d21f8[_0x3901('0x41')]=_['keys'](_0x5eacb0[_0x3901('0x41')]);_0x1d21f8[_0x3901('0x58')]=_[_0x3901('0xca')](_0x1d21f8[_0x3901('0x54')],_0x1d21f8[_0x3901('0x41')]);_0x491d7c[_0x3901('0x46')]=_[_0x3901('0xca')](_0x1d21f8[_0x3901('0x54')],qs[_0x3901('0x59')](_0x5eacb0[_0x3901('0x41')][_0x3901('0x59')]));_0x491d7c[_0x3901('0x46')]=_0x491d7c[_0x3901('0x46')][_0x3901('0x4b')]?_0x491d7c[_0x3901('0x46')]:_0x1d21f8[_0x3901('0x54')];_0x491d7c[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x5eacb0['query'][_0x3901('0xd5')]);_0x491d7c[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x5eacb0[_0x3901('0x41')],_0x1d21f8[_0x3901('0x58')]));if(_0x5eacb0[_0x3901('0x41')][_0x3901('0x3c')]){_0x491d7c[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x491d7c[_0x3901('0x3f')],{'$or':_['map'](_0x491d7c[_0x3901('0x46')],function(_0x2ecf3b){var _0x31f2cd={};_0x31f2cd[_0x2ecf3b]={'$like':'%'+_0x5eacb0[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x31f2cd;})});}_0x491d7c=_[_0x3901('0x5b')]({},_0x491d7c,_0x5eacb0[_0x3901('0x5c')]);switch(_0x539c93[_0x3901('0x28')]){case _0x3901('0x29'):return db[_[_0x3901('0xa2')](_0x5eacb0[_0x3901('0x41')][_0x3901('0xb0')])+'Queue'][_0x3901('0x48')](_0x491d7c);case _0x3901('0x2b'):case _0x3901('0x2d'):return _0x539c93['get'+_[_0x3901('0xa2')](_0x5eacb0[_0x3901('0x41')][_0x3901('0xb0')])+_0x3901('0xa1')](_0x491d7c);default:throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))](_0x3901('0xd7'));}})[_0x3901('0x14')](function(_0x576056){_0x289446=_0x576056['length'];if(!_0x5eacb0[_0x3901('0x41')]['hasOwnProperty'](_0x3901('0xd3'))){_0x491d7c[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x5eacb0['query'][_0x3901('0x23')]);_0x491d7c['offset']=qs[_0x3901('0x22')](_0x5eacb0[_0x3901('0x41')]['offset']);}switch(_0x539c93[_0x3901('0x28')]){case _0x3901('0x29'):return db[_[_0x3901('0xa2')](_0x5eacb0[_0x3901('0x41')][_0x3901('0xb0')])+_0x3901('0xd4')][_0x3901('0x48')](_0x491d7c);case _0x3901('0x2b'):case _0x3901('0x2d'):return _0x539c93[_0x3901('0xa8')+_[_0x3901('0xa2')](_0x5eacb0[_0x3901('0x41')][_0x3901('0xb0')])+'Queues'](_0x491d7c);}})[_0x3901('0x14')](function(_0x40d850){return{'count':_0x289446,'rows':_0x40d850};})[_0x3901('0x14')](respondWithResult(_0x4c05f4,null))[_0x3901('0x51')](handleError(_0x4c05f4,null));};exports[_0x3901('0xd8')]=function(_0x3ae542,_0x55e808){var _0x17bc32={};var _0x467111={};var _0x38f92d;var _0x277df2;return db['User'][_0x3901('0x95')]({'where':{'id':_0x3ae542[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x55e808,null))[_0x3901('0x14')](function(_0x26dbdd){if(_0x26dbdd){_0x38f92d=_0x26dbdd;_0x467111['model']=_[_0x3901('0x56')](db[_0x3901('0xae')][_0x3901('0x57')]);_0x467111['query']=_[_0x3901('0x56')](_0x3ae542['query']);_0x467111[_0x3901('0x58')]=_['intersection'](_0x467111['model'],_0x467111[_0x3901('0x41')]);_0x17bc32['attributes']=_[_0x3901('0xca')](_0x467111['model'],qs[_0x3901('0x59')](_0x3ae542['query'][_0x3901('0x59')]));_0x17bc32[_0x3901('0x46')]=_0x17bc32['attributes']['length']?_0x17bc32[_0x3901('0x46')]:_0x467111[_0x3901('0x54')];_0x17bc32[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x3ae542[_0x3901('0x41')][_0x3901('0xd5')]);_0x17bc32[_0x3901('0x3f')]=qs['filters'](_['pick'](_0x3ae542[_0x3901('0x41')],_0x467111['filters']));if(_0x3ae542[_0x3901('0x41')][_0x3901('0x3c')]){_0x17bc32[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x17bc32[_0x3901('0x3f')],{'$or':_['map'](_0x17bc32['attributes'],function(_0x47c46e){var _0x485884={};_0x485884[_0x47c46e]={'$like':'%'+_0x3ae542['query']['filter']+'%'};return _0x485884;})});}_0x17bc32=_[_0x3901('0x5b')]({},_0x17bc32,_0x3ae542[_0x3901('0x5c')]);return _0x38f92d[_0x3901('0xd8')](_0x17bc32);}})[_0x3901('0x14')](function(_0x4105ea){if(_0x4105ea){_0x277df2=_0x4105ea[_0x3901('0x4b')];if(!_0x3ae542[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0x17bc32[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x3ae542[_0x3901('0x41')][_0x3901('0x23')]);_0x17bc32[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x3ae542['query'][_0x3901('0x22')]);}return _0x38f92d[_0x3901('0xd8')](_0x17bc32);}})[_0x3901('0x14')](function(_0x3187dc){if(_0x3187dc){return _0x3187dc?{'count':_0x277df2,'rows':_0x3187dc}:null;}})[_0x3901('0x14')](respondWithResult(_0x55e808,null))[_0x3901('0x51')](handleError(_0x55e808,null));};exports[_0x3901('0xd9')]=function(_0x39f968,_0x337891){var _0x5991e8={};var _0x10479f={};var _0x806e6d;var _0x2ec0bb;return db[_0x3901('0x38')]['findOne']({'where':{'id':_0x39f968[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x337891,null))[_0x3901('0x14')](function(_0x127c0e){if(_0x127c0e){_0x806e6d=_0x127c0e;_0x10479f['model']=_[_0x3901('0x56')](db[_0x3901('0xda')]['rawAttributes']);_0x10479f[_0x3901('0x41')]=_['keys'](_0x39f968[_0x3901('0x41')]);_0x10479f[_0x3901('0x58')]=_[_0x3901('0xca')](_0x10479f['model'],_0x10479f[_0x3901('0x41')]);_0x5991e8['attributes']=_[_0x3901('0xca')](_0x10479f[_0x3901('0x54')],qs['fields'](_0x39f968[_0x3901('0x41')]['fields']));_0x5991e8['attributes']=_0x5991e8[_0x3901('0x46')][_0x3901('0x4b')]?_0x5991e8['attributes']:_0x10479f[_0x3901('0x54')];_0x5991e8['order']=qs[_0x3901('0xd5')](_0x39f968[_0x3901('0x41')][_0x3901('0xd5')]);_0x5991e8[_0x3901('0x3f')]=qs['filters'](_[_0x3901('0xd6')](_0x39f968[_0x3901('0x41')],_0x10479f['filters']));if(_0x39f968[_0x3901('0x41')]['filter']){_0x5991e8[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x5991e8['where'],{'$or':_[_0x3901('0x30')](_0x5991e8[_0x3901('0x46')],function(_0x2da30d){var _0x5a9a17={};_0x5a9a17[_0x2da30d]={'$like':'%'+_0x39f968['query']['filter']+'%'};return _0x5a9a17;})});}_0x5991e8=_[_0x3901('0x5b')]({},_0x5991e8,_0x39f968[_0x3901('0x5c')]);return _0x806e6d[_0x3901('0xd9')](_0x5991e8);}})[_0x3901('0x14')](function(_0x13e329){if(_0x13e329){_0x2ec0bb=_0x13e329[_0x3901('0x4b')];if(!_0x39f968['query']['hasOwnProperty'](_0x3901('0xd3'))){_0x5991e8[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x39f968['query'][_0x3901('0x23')]);_0x5991e8[_0x3901('0x22')]=qs['offset'](_0x39f968['query'][_0x3901('0x22')]);}return _0x806e6d[_0x3901('0xd9')](_0x5991e8);}})[_0x3901('0x14')](function(_0x5061c3){if(_0x5061c3){return _0x5061c3?{'count':_0x2ec0bb,'rows':_0x5061c3}:null;}})[_0x3901('0x14')](respondWithResult(_0x337891,null))['catch'](handleError(_0x337891,null));};exports['getRecordings']=function(_0xcdf706,_0xe77b5f){var _0xd51766={'raw':!![],'where':{}};var _0x162e81={};var _0x1e4b10={'count':0x0,'rows':[]};return db['User'][_0x3901('0x95')]({'where':{'id':_0xcdf706[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0xe77b5f,null))[_0x3901('0x14')](function(_0x549f79){if(_0x549f79){_0x162e81[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0xdb')]['rawAttributes']);_0x162e81[_0x3901('0x41')]=_[_0x3901('0x56')](_0xcdf706[_0x3901('0x41')]);_0x162e81['filters']=_['intersection'](_0x162e81['model'],_0x162e81[_0x3901('0x41')]);_0xd51766[_0x3901('0x46')]=_[_0x3901('0xca')](_0x162e81[_0x3901('0x54')],qs[_0x3901('0x59')](_0xcdf706[_0x3901('0x41')][_0x3901('0x59')]));_0xd51766[_0x3901('0x46')]=_0xd51766[_0x3901('0x46')][_0x3901('0x4b')]?_0xd51766[_0x3901('0x46')]:_0x162e81[_0x3901('0x54')];if(!_0xcdf706[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0xd51766['limit']=qs[_0x3901('0x23')](_0xcdf706[_0x3901('0x41')][_0x3901('0x23')]);_0xd51766[_0x3901('0x22')]=qs['offset'](_0xcdf706[_0x3901('0x41')]['offset']);}_0xd51766['order']=qs[_0x3901('0xd5')](_0xcdf706[_0x3901('0x41')]['sort']);_0xd51766[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0xcdf706[_0x3901('0x41')],_0x162e81[_0x3901('0x58')]));_0xd51766[_0x3901('0x3f')][_0x3901('0xdc')]=_0x549f79['id'];if(_0xcdf706['query'][_0x3901('0x3c')]){_0xd51766[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0xd51766[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0xd51766['attributes'],function(_0x537cf4){var _0x53d9bc={};_0x53d9bc[_0x537cf4]={'$like':'%'+_0xcdf706[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x53d9bc;})});}_0xd51766=_[_0x3901('0x5b')]({},_0xd51766,_0xcdf706[_0x3901('0x5c')]);return db[_0x3901('0xdb')][_0x3901('0x40')]({'where':_0xd51766[_0x3901('0x3f')]})[_0x3901('0x14')](function(_0x3048f0){_0x1e4b10[_0x3901('0x40')]=_0x3048f0;if(_0xcdf706[_0x3901('0x41')][_0x3901('0x42')]){_0xd51766['include']=[{'all':!![]}];}return db[_0x3901('0xdb')][_0x3901('0x48')](_0xd51766);})[_0x3901('0x14')](function(_0x21af07){_0x1e4b10[_0x3901('0x49')]=_0x21af07;return _0x1e4b10;});}})[_0x3901('0x14')](respondWithFilteredResult(_0xe77b5f,_0xd51766))['catch'](handleError(_0xe77b5f,null));};exports[_0x3901('0xdd')]=function(_0x10244d,_0x4c71e6){var _0x39280b={'raw':!![],'where':{}};var _0x5bb984={};var _0x18b1bd={'count':0x0,'rows':[]};return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x10244d['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x4c71e6,null))[_0x3901('0x14')](function(_0x2bf7cc){if(_0x2bf7cc){_0x5bb984[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0xde')]['rawAttributes']);_0x5bb984[_0x3901('0x41')]=_[_0x3901('0x56')](_0x10244d[_0x3901('0x41')]);_0x5bb984['filters']=_[_0x3901('0xca')](_0x5bb984[_0x3901('0x54')],_0x5bb984[_0x3901('0x41')]);_0x39280b[_0x3901('0x46')]=_['intersection'](_0x5bb984['model'],qs['fields'](_0x10244d[_0x3901('0x41')]['fields']));_0x39280b[_0x3901('0x46')]=_0x39280b[_0x3901('0x46')][_0x3901('0x4b')]?_0x39280b[_0x3901('0x46')]:_0x5bb984['model'];if(!_0x10244d[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0x39280b[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x10244d['query'][_0x3901('0x23')]);_0x39280b[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x10244d[_0x3901('0x41')][_0x3901('0x22')]);}_0x39280b[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x10244d['query'][_0x3901('0xd5')]);_0x39280b['where']=qs['filters'](_[_0x3901('0xd6')](_0x10244d['query'],_0x5bb984['filters']));_0x39280b['where'][_0x3901('0xdc')]=_0x2bf7cc['id'];if(_0x10244d['query'][_0x3901('0x3c')]){_0x39280b[_0x3901('0x3f')]=_['merge'](_0x39280b[_0x3901('0x3f')],{'$or':_['map'](_0x39280b[_0x3901('0x46')],function(_0x4decdb){var _0x32cd95={};_0x32cd95[_0x4decdb]={'$like':'%'+_0x10244d[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x32cd95;})});}_0x39280b=_['merge']({},_0x39280b,_0x10244d[_0x3901('0x5c')]);return db[_0x3901('0xde')][_0x3901('0x40')]({'where':_0x39280b[_0x3901('0x3f')]})[_0x3901('0x14')](function(_0x30034f){_0x18b1bd[_0x3901('0x40')]=_0x30034f;if(_0x10244d['query'][_0x3901('0x42')]){_0x39280b[_0x3901('0x45')]=[{'all':!![]}];}return db[_0x3901('0xde')][_0x3901('0x48')](_0x39280b);})[_0x3901('0x14')](function(_0x13cd00){_0x18b1bd['rows']=_0x13cd00;return _0x18b1bd;});}})[_0x3901('0x14')](respondWithFilteredResult(_0x4c71e6,_0x39280b))[_0x3901('0x51')](handleError(_0x4c71e6,null));};exports[_0x3901('0xdf')]=function(_0x3f4ebd,_0x5ef0af){var _0x3e37f2={};var _0x5e8ed2={};var _0x2bafc7;var _0x1825aa;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x3f4ebd[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x5ef0af,null))[_0x3901('0x14')](function(_0x475886){if(_0x475886){_0x2bafc7=_0x475886;_0x5e8ed2[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0xe0')][_0x3901('0x57')]);_0x5e8ed2[_0x3901('0x41')]=_['keys'](_0x3f4ebd[_0x3901('0x41')]);_0x5e8ed2[_0x3901('0x58')]=_[_0x3901('0xca')](_0x5e8ed2[_0x3901('0x54')],_0x5e8ed2[_0x3901('0x41')]);_0x3e37f2['attributes']=_[_0x3901('0xca')](_0x5e8ed2[_0x3901('0x54')],qs[_0x3901('0x59')](_0x3f4ebd['query']['fields']));_0x3e37f2['attributes']=_0x3e37f2[_0x3901('0x46')][_0x3901('0x4b')]?_0x3e37f2[_0x3901('0x46')]:_0x5e8ed2[_0x3901('0x54')];_0x3e37f2[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x3f4ebd[_0x3901('0x41')][_0x3901('0xd5')]);_0x3e37f2[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x3f4ebd[_0x3901('0x41')],_0x5e8ed2[_0x3901('0x58')]));if(_0x3f4ebd[_0x3901('0x41')][_0x3901('0x3c')]){_0x3e37f2[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x3e37f2['where'],{'$or':_[_0x3901('0x30')](_0x3e37f2['attributes'],function(_0x56726f){var _0x14d001={};_0x14d001[_0x56726f]={'$like':'%'+_0x3f4ebd[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x14d001;})});}_0x3e37f2=_[_0x3901('0x5b')]({},_0x3e37f2,_0x3f4ebd['options']);return _0x2bafc7[_0x3901('0xdf')](_0x3e37f2);}})[_0x3901('0x14')](function(_0x1deb3b){if(_0x1deb3b){_0x1825aa=_0x1deb3b[_0x3901('0x4b')];if(!_0x3f4ebd['query'][_0x3901('0xcc')](_0x3901('0xd3'))){_0x3e37f2['limit']=qs[_0x3901('0x23')](_0x3f4ebd[_0x3901('0x41')][_0x3901('0x23')]);_0x3e37f2[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x3f4ebd[_0x3901('0x41')][_0x3901('0x22')]);}return _0x2bafc7['getChatInteractions'](_0x3e37f2);}})[_0x3901('0x14')](function(_0x1e4d45){if(_0x1e4d45){return _0x1e4d45?{'count':_0x1825aa,'rows':_0x1e4d45}:null;}})[_0x3901('0x14')](respondWithResult(_0x5ef0af,null))['catch'](handleError(_0x5ef0af,null));};exports[_0x3901('0xe1')]=function(_0x450866,_0x29a3fa){var _0x365274={};var _0x1220a3={};var _0x514a6b;var _0x213840;return db[_0x3901('0x38')]['findOne']({'where':{'id':_0x450866['params']['id']}})['then'](handleEntityNotFound(_0x29a3fa,null))[_0x3901('0x14')](function(_0x1dafa){if(_0x1dafa){_0x514a6b=_0x1dafa;_0x1220a3[_0x3901('0x54')]=_[_0x3901('0x56')](db['OpenchannelInteraction'][_0x3901('0x57')]);_0x1220a3['query']=_[_0x3901('0x56')](_0x450866[_0x3901('0x41')]);_0x1220a3[_0x3901('0x58')]=_['intersection'](_0x1220a3[_0x3901('0x54')],_0x1220a3[_0x3901('0x41')]);_0x365274['attributes']=_['intersection'](_0x1220a3[_0x3901('0x54')],qs[_0x3901('0x59')](_0x450866[_0x3901('0x41')][_0x3901('0x59')]));_0x365274[_0x3901('0x46')]=_0x365274[_0x3901('0x46')][_0x3901('0x4b')]?_0x365274[_0x3901('0x46')]:_0x1220a3[_0x3901('0x54')];_0x365274[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x450866[_0x3901('0x41')][_0x3901('0xd5')]);_0x365274[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x450866[_0x3901('0x41')],_0x1220a3[_0x3901('0x58')]));if(_0x450866[_0x3901('0x41')][_0x3901('0x3c')]){_0x365274[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x365274[_0x3901('0x3f')],{'$or':_['map'](_0x365274[_0x3901('0x46')],function(_0x5c2062){var _0x4147b0={};_0x4147b0[_0x5c2062]={'$like':'%'+_0x450866[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x4147b0;})});}_0x365274=_[_0x3901('0x5b')]({},_0x365274,_0x450866[_0x3901('0x5c')]);return _0x514a6b[_0x3901('0xe1')](_0x365274);}})[_0x3901('0x14')](function(_0x5c16af){if(_0x5c16af){_0x213840=_0x5c16af['length'];if(!_0x450866[_0x3901('0x41')][_0x3901('0xcc')]('nolimit')){_0x365274['limit']=qs[_0x3901('0x23')](_0x450866[_0x3901('0x41')][_0x3901('0x23')]);_0x365274[_0x3901('0x22')]=qs['offset'](_0x450866[_0x3901('0x41')]['offset']);}return _0x514a6b['getOpenchannelInteractions'](_0x365274);}})[_0x3901('0x14')](function(_0x261e12){if(_0x261e12){return _0x261e12?{'count':_0x213840,'rows':_0x261e12}:null;}})[_0x3901('0x14')](respondWithResult(_0x29a3fa,null))[_0x3901('0x51')](handleError(_0x29a3fa,null));};exports[_0x3901('0xe2')]=function(_0x453528,_0x50e28f){var _0x590a9f={'raw':!![],'where':{}};var _0x356b1d={};var _0x53294c={'count':0x0,'rows':[]};return db[_0x3901('0x38')]['findOne']({'where':{'id':_0x453528[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x50e28f,null))['then'](function(_0x142bd7){if(_0x142bd7){_0x356b1d[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0xe3')][_0x3901('0x57')]);_0x356b1d[_0x3901('0x41')]=_[_0x3901('0x56')](_0x453528[_0x3901('0x41')]);_0x356b1d[_0x3901('0x58')]=_[_0x3901('0xca')](_0x356b1d[_0x3901('0x54')],_0x356b1d[_0x3901('0x41')]);_0x590a9f['attributes']=_['intersection'](_0x356b1d[_0x3901('0x54')],qs[_0x3901('0x59')](_0x453528[_0x3901('0x41')][_0x3901('0x59')]));_0x590a9f[_0x3901('0x46')]=_0x590a9f[_0x3901('0x46')][_0x3901('0x4b')]?_0x590a9f[_0x3901('0x46')]:_0x356b1d['model'];if(!_0x453528['query'][_0x3901('0xcc')](_0x3901('0xd3'))){_0x590a9f[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x453528[_0x3901('0x41')][_0x3901('0x23')]);_0x590a9f['offset']=qs[_0x3901('0x22')](_0x453528[_0x3901('0x41')][_0x3901('0x22')]);}_0x590a9f[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x453528[_0x3901('0x41')][_0x3901('0xd5')]);_0x590a9f['where']=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x453528['query'],_0x356b1d[_0x3901('0x58')]));_0x590a9f[_0x3901('0x3f')]['UserId']=_0x142bd7['id'];if(_0x453528[_0x3901('0x41')][_0x3901('0x3c')]){_0x590a9f[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x590a9f[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x590a9f[_0x3901('0x46')],function(_0x929178){var _0x130f68={};_0x130f68[_0x929178]={'$like':'%'+_0x453528[_0x3901('0x41')]['filter']+'%'};return _0x130f68;})});}_0x590a9f=_['merge']({},_0x590a9f,_0x453528[_0x3901('0x5c')]);return db[_0x3901('0xe3')][_0x3901('0x40')]({'where':_0x590a9f[_0x3901('0x3f')]})[_0x3901('0x14')](function(_0x54de8f){_0x53294c['count']=_0x54de8f;if(_0x453528['query'][_0x3901('0x42')]){_0x590a9f[_0x3901('0x45')]=[{'all':!![]}];}return db[_0x3901('0xe3')][_0x3901('0x48')](_0x590a9f);})[_0x3901('0x14')](function(_0x34c52f){_0x53294c['rows']=_0x34c52f;return _0x53294c;});}})[_0x3901('0x14')](respondWithFilteredResult(_0x50e28f,_0x590a9f))[_0x3901('0x51')](handleError(_0x50e28f,null));};exports[_0x3901('0xe4')]=function(_0x56f86b,_0x4603bf){var _0x6dcdc1={};var _0x3b5d30={};var _0x548e9c;var _0x52b0d3;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x56f86b[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x4603bf,null))[_0x3901('0x14')](function(_0x488d45){if(_0x488d45){_0x548e9c=_0x488d45;_0x3b5d30[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0xe5')][_0x3901('0x57')]);_0x3b5d30[_0x3901('0x41')]=_[_0x3901('0x56')](_0x56f86b[_0x3901('0x41')]);_0x3b5d30[_0x3901('0x58')]=_[_0x3901('0xca')](_0x3b5d30[_0x3901('0x54')],_0x3b5d30[_0x3901('0x41')]);_0x6dcdc1['attributes']=_[_0x3901('0xca')](_0x3b5d30[_0x3901('0x54')],qs['fields'](_0x56f86b[_0x3901('0x41')][_0x3901('0x59')]));_0x6dcdc1[_0x3901('0x46')]=_0x6dcdc1[_0x3901('0x46')][_0x3901('0x4b')]?_0x6dcdc1[_0x3901('0x46')]:_0x3b5d30[_0x3901('0x54')];_0x6dcdc1[_0x3901('0xcb')]=qs['sort'](_0x56f86b[_0x3901('0x41')][_0x3901('0xd5')]);_0x6dcdc1[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x56f86b[_0x3901('0x41')],_0x3b5d30[_0x3901('0x58')]));if(_0x56f86b[_0x3901('0x41')][_0x3901('0x3c')]){_0x6dcdc1[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x6dcdc1[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x6dcdc1['attributes'],function(_0x980c64){var _0x23527f={};_0x23527f[_0x980c64]={'$like':'%'+_0x56f86b[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x23527f;})});}_0x6dcdc1=_['merge']({},_0x6dcdc1,_0x56f86b[_0x3901('0x5c')]);return _0x548e9c[_0x3901('0xe4')](_0x6dcdc1);}})['then'](function(_0x4bd74b){if(_0x4bd74b){_0x52b0d3=_0x4bd74b[_0x3901('0x4b')];if(!_0x56f86b['query']['hasOwnProperty'](_0x3901('0xd3'))){_0x6dcdc1[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x56f86b[_0x3901('0x41')][_0x3901('0x23')]);_0x6dcdc1['offset']=qs[_0x3901('0x22')](_0x56f86b[_0x3901('0x41')][_0x3901('0x22')]);}return _0x548e9c[_0x3901('0xe4')](_0x6dcdc1);}})[_0x3901('0x14')](function(_0x3bf4a2){if(_0x3bf4a2){return _0x3bf4a2?{'count':_0x52b0d3,'rows':_0x3bf4a2}:null;}})[_0x3901('0x14')](respondWithResult(_0x4603bf,null))['catch'](handleError(_0x4603bf,null));};exports[_0x3901('0xe6')]=function(_0x568479,_0xda43fd){var _0x554f94={};var _0x6d137a={};var _0x536551;var _0x27887b;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x568479[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0xda43fd,null))[_0x3901('0x14')](function(_0x262163){if(_0x262163){_0x536551=_0x262163;_0x6d137a[_0x3901('0x54')]=_['keys'](db['FaxInteraction'][_0x3901('0x57')]);_0x6d137a[_0x3901('0x41')]=_[_0x3901('0x56')](_0x568479[_0x3901('0x41')]);_0x6d137a[_0x3901('0x58')]=_['intersection'](_0x6d137a[_0x3901('0x54')],_0x6d137a[_0x3901('0x41')]);_0x554f94[_0x3901('0x46')]=_[_0x3901('0xca')](_0x6d137a[_0x3901('0x54')],qs[_0x3901('0x59')](_0x568479[_0x3901('0x41')][_0x3901('0x59')]));_0x554f94['attributes']=_0x554f94[_0x3901('0x46')]['length']?_0x554f94['attributes']:_0x6d137a[_0x3901('0x54')];_0x554f94[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x568479[_0x3901('0x41')][_0x3901('0xd5')]);_0x554f94[_0x3901('0x3f')]=qs['filters'](_[_0x3901('0xd6')](_0x568479[_0x3901('0x41')],_0x6d137a[_0x3901('0x58')]));if(_0x568479[_0x3901('0x41')][_0x3901('0x3c')]){_0x554f94[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x554f94[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x554f94[_0x3901('0x46')],function(_0x513516){var _0x5af86d={};_0x5af86d[_0x513516]={'$like':'%'+_0x568479[_0x3901('0x41')]['filter']+'%'};return _0x5af86d;})});}_0x554f94=_[_0x3901('0x5b')]({},_0x554f94,_0x568479['options']);return _0x536551[_0x3901('0xe6')](_0x554f94);}})[_0x3901('0x14')](function(_0x314cde){if(_0x314cde){_0x27887b=_0x314cde[_0x3901('0x4b')];if(!_0x568479['query'][_0x3901('0xcc')](_0x3901('0xd3'))){_0x554f94[_0x3901('0x23')]=qs['limit'](_0x568479['query'][_0x3901('0x23')]);_0x554f94[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x568479[_0x3901('0x41')][_0x3901('0x22')]);}return _0x536551[_0x3901('0xe6')](_0x554f94);}})[_0x3901('0x14')](function(_0x271b62){if(_0x271b62){return _0x271b62?{'count':_0x27887b,'rows':_0x271b62}:null;}})['then'](respondWithResult(_0xda43fd,null))['catch'](handleError(_0xda43fd,null));};exports[_0x3901('0xe7')]=function(_0x4035d1,_0x4c1723){var _0x24818a={};var _0x3cb170={};var _0x279ef0;var _0x5ed68f;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x4035d1['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x4c1723,null))[_0x3901('0x14')](function(_0x4320b6){if(_0x4320b6){_0x279ef0=_0x4320b6;_0x3cb170[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0xe8')]['rawAttributes']);_0x3cb170[_0x3901('0x41')]=_[_0x3901('0x56')](_0x4035d1[_0x3901('0x41')]);_0x3cb170['filters']=_[_0x3901('0xca')](_0x3cb170[_0x3901('0x54')],_0x3cb170[_0x3901('0x41')]);_0x24818a[_0x3901('0x46')]=_[_0x3901('0xca')](_0x3cb170[_0x3901('0x54')],qs[_0x3901('0x59')](_0x4035d1[_0x3901('0x41')][_0x3901('0x59')]));_0x24818a[_0x3901('0x46')]=_0x24818a['attributes'][_0x3901('0x4b')]?_0x24818a[_0x3901('0x46')]:_0x3cb170[_0x3901('0x54')];_0x24818a[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x4035d1[_0x3901('0x41')][_0x3901('0xd5')]);_0x24818a[_0x3901('0x3f')]=qs[_0x3901('0x58')](_['pick'](_0x4035d1[_0x3901('0x41')],_0x3cb170[_0x3901('0x58')]));if(_0x4035d1[_0x3901('0x41')][_0x3901('0x3c')]){_0x24818a['where']=_[_0x3901('0x5b')](_0x24818a[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x24818a['attributes'],function(_0x557558){var _0x2bb4d3={};_0x2bb4d3[_0x557558]={'$like':'%'+_0x4035d1[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x2bb4d3;})});}_0x24818a=_['merge']({},_0x24818a,_0x4035d1[_0x3901('0x5c')]);return _0x279ef0[_0x3901('0xe7')](_0x24818a);}})['then'](function(_0x1ad5a8){if(_0x1ad5a8){_0x5ed68f=_0x1ad5a8[_0x3901('0x4b')];if(!_0x4035d1[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0x24818a['limit']=qs[_0x3901('0x23')](_0x4035d1['query'][_0x3901('0x23')]);_0x24818a[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x4035d1['query'][_0x3901('0x22')]);}return _0x279ef0[_0x3901('0xe7')](_0x24818a);}})[_0x3901('0x14')](function(_0x5df527){if(_0x5df527){return _0x5df527?{'count':_0x5ed68f,'rows':_0x5df527}:null;}})[_0x3901('0x14')](respondWithResult(_0x4c1723,null))[_0x3901('0x51')](handleError(_0x4c1723,null));};exports[_0x3901('0xe9')]=function(_0x18aaa9,_0x154357,_0x3f3ddf){var _0x152334;var _0x2d4702;var _0x2e962d;var _0x3cc6c8=!_[_0x3901('0x68')](_0x18aaa9[_0x3901('0x53')]['id'])?_0x18aaa9[_0x3901('0x53')]['id']:!_[_0x3901('0x68')](_0x18aaa9[_0x3901('0x2b')]['id'])?_0x18aaa9['user']['id']:null;return db['User'][_0x3901('0x33')]({'where':{'id':_0x3cc6c8,'role':{'$or':[_0x3901('0x29'),_0x3901('0x2b'),_0x3901('0x2d')]}},'attributes':['id',_0x3901('0x34'),_0x3901('0xea'),_0x3901('0xeb'),_0x3901('0x28'),_0x3901('0x63'),_0x3901('0xec')]})[_0x3901('0x14')](function(_0x54e3d6){if(_0x54e3d6){if(_0x54e3d6[_0x3901('0x28')]===_0x3901('0x2d')){_0x152334=_0x54e3d6;if(_0x18aaa9['body'][_0x3901('0xa9')]){_0x2e962d=util[_0x3901('0xaa')]('LOCAL/%s@from-sip/n',_0x152334[_0x18aaa9['body'][_0x3901('0xa9')]]);}else if(_0x18aaa9['body'][_0x3901('0xed')]){_0x2e962d=util['format']('SIP/%s',_0x18aaa9['body'][_0x3901('0xed')]);}else{_0x2e962d=util[_0x3901('0xaa')](_0x3901('0xab'),_0x152334[_0x3901('0x34')]);}socket['to'](util[_0x3901('0xaa')](_0x3901('0xee'),_0x152334['name']))['emit'](_0x3901('0xef'),{'user':{'id':_0x152334['id'],'name':_0x152334[_0x3901('0x34')]},'ip':_0x18aaa9['headers'][_0x3901('0xf0')]||_0x18aaa9[_0x3901('0xf1')]['remoteAddress']||_0x18aaa9[_0x3901('0xf2')]['remoteAddress']||_0x18aaa9[_0x3901('0xf1')][_0x3901('0xf2')][_0x3901('0xf3')]});return db[_0x3901('0xae')][_0x3901('0x36')]({'where':{'membername':_0x152334[_0x3901('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0x3901('0x8e'))][(_0x3901('0x8f'))](_0x3901('0xf4'));}})[_0x3901('0x14')](function(){if(_0x152334){return _0x152334[_0x3901('0xf5')]({'raw':!![]});}})['then'](function(_0x5489ab){if(_0x152334){var _0x699f3a=[];if(_0x5489ab){_0x2d4702=_0x5489ab;if(_0x2d4702[_0x3901('0x4b')]){for(var _0x40fbe3=0x0;_0x40fbe3<_0x2d4702[_0x3901('0x4b')];_0x40fbe3++){_0x699f3a[_0x3901('0x47')]({'membername':_0x152334[_0x3901('0x34')],'UserId':_0x152334['id'],'queue_name':_0x2d4702[_0x40fbe3]['name'],'VoiceQueueId':_0x2d4702[_0x40fbe3]['id'],'interface':_0x2e962d,'paused':_0x152334[_0x3901('0xec')]||![],'penalty':_0x2d4702[_0x40fbe3][_0x3901('0xf6')]||0x0});}return BPromise[_0x3901('0x8b')](_0x699f3a,function(_0x9e4980){return db[_0x3901('0xae')][_0x3901('0xaf')](_0x9e4980);});}}}})[_0x3901('0x14')](function(){if(_0x152334){return db['MemberReport'][_0x3901('0x48')]({'where':{'membername':_0x152334[_0x3901('0x34')],'exitAt':null}});}})[_0x3901('0x14')](function(_0x587b03){if(_0x152334){var _0x3ea2d9=[];_0x587b03[_0x3901('0xf7')](function(_0x49b71c){_0x3ea2d9[_0x3901('0x47')](_0x49b71c[_0x3901('0x27')]({'exitAt':moment()[_0x3901('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x3ea2d9);}})[_0x3901('0x14')](function(){if(_0x152334){var _0x2e3a86=[];var _0x8b183f=[];var _0xfde5ec=utils[_0x3901('0xf8')]();var _0x490948={'membername':_0x152334[_0x3901('0x34')],'interface':_0x2e962d,'enterAt':moment()[_0x3901('0xaa')](_0x3901('0xf9')),'role':_0x152334['role'],'internal':_0x152334['internal']};_0xfde5ec[_0x3901('0xf7')](function(_0x1f52c0){_0x2e3a86['push'](_[_0x3901('0x5b')]({'channel':_0x1f52c0,'type':_0x3901('0xfa'),'data1':_0x18aaa9[_0x3901('0x5f')]['device'],'data2':_0x2e962d},_0x490948));if(_0x152334[_0x3901('0xec')]){_0x8b183f['push'](_[_0x3901('0x5b')]({'channel':_0x1f52c0,'type':_0x3901('0xfb'),'data1':_0x3901('0xfc')},_0x490948));}});return db[_0x3901('0xfd')][_0x3901('0x86')](_0x2e3a86[_0x3901('0xc7')](_0x8b183f),{'individualHooks':!![]});}})[_0x3901('0x14')](function(){if(_0x152334){return _0x152334[_0x3901('0x27')]({'online':!![],'lastLoginAt':moment()[_0x3901('0xaa')](_0x3901('0xf9')),'voicePause':_0x152334[_0x3901('0xec')]||![],'mailPause':_0x152334['loginInPause']||![],'chatPause':_0x152334[_0x3901('0xec')]||![],'faxPause':_0x152334[_0x3901('0xec')]||![],'smsPause':_0x152334[_0x3901('0xec')]||![],'openchannelPause':_0x152334[_0x3901('0xec')]||![],'whatsappPause':_0x152334['loginInPause']||![],'pauseType':_0x152334[_0x3901('0xec')]?_0x3901('0xfc'):null,'interface':_0x2e962d,'lastPauseAt':moment()['format'](_0x3901('0xf9'))});}})[_0x3901('0x14')](function(_0x10a8f4){if(_0x18aaa9['isMiddleware']){return _0x3f3ddf();}else{return BPromise[_0x3901('0xfe')](_0x10a8f4)[_0x3901('0x14')](respondWithResult(_0x154357,null));}})[_0x3901('0x51')](handleError(_0x154357,null));};exports[_0x3901('0xff')]=function(_0x1036f4,_0x1ea8d1){var _0x1f775a;return db['User'][_0x3901('0x33')]({'where':{'id':_0x1036f4[_0x3901('0x53')]['id'],'role':'agent'},'attributes':['id',_0x3901('0x34'),_0x3901('0x28')]})[_0x3901('0x14')](handleEntityNotFound(_0x1ea8d1,null))['then'](function(_0xc28d5d){if(_0xc28d5d){_0x1f775a=_0xc28d5d;return db[_0x3901('0xae')][_0x3901('0x36')]({'where':{'membername':_0x1f775a['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x3901('0xfd')][_0x3901('0x48')]({'where':{'membername':_0x1f775a['name'],'exitAt':null}});})[_0x3901('0x14')](function(_0x14c197){var _0x247c28=[];_0x14c197[_0x3901('0xf7')](function(_0x2d1f92){_0x247c28[_0x3901('0x47')](_0x2d1f92[_0x3901('0x27')]({'exitAt':moment()[_0x3901('0xaa')](_0x3901('0xf9'))}));});return BPromise[_0x3901('0x8a')](_0x247c28);})[_0x3901('0x14')](function(){return _0x1f775a[_0x3901('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x1ea8d1,null))[_0x3901('0x51')](handleError(_0x1ea8d1,null));};exports[_0x3901('0x100')]=function(_0x242955,_0x57ce5c){var _0x51b734;return db[_0x3901('0xae')][_0x3901('0x27')]({'paused':0x1},{'where':{'UserId':_0x242955[_0x3901('0x53')]['id']},'individualHooks':!![]})[_0x3901('0x14')](function(){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x242955[_0x3901('0x53')]['id'],'role':'agent'},'attributes':['id',_0x3901('0x34'),_0x3901('0x28'),_0x3901('0x63'),_0x3901('0xa9')]});})['then'](handleEntityNotFound(_0x57ce5c,null))['then'](function(_0x2e19e4){if(_0x2e19e4){_0x51b734=_0x2e19e4;return respondWithRpcPromise(_0x3901('0x101'),_0x3901('0x100'),{'id':_0x51b734['id'],'name':_0x51b734[_0x3901('0x34')],'pause':!![]});}})[_0x3901('0x14')](function(){if(_0x51b734){return db[_0x3901('0xfd')]['findAll']({'where':{'membername':_0x51b734[_0x3901('0x34')],'type':_0x3901('0xfb'),'exitAt':null}});}})[_0x3901('0x14')](function(_0xc6d139){if(_0xc6d139[_0x3901('0x4b')]){var _0x5e91d0=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x430393=0x0,_0x16ff2b=_0xc6d139[_0x3901('0x4b')];_0x430393<_0x16ff2b;_0x430393++){_0xc6d139[_0x430393][_0x3901('0x102')]({'exitAt':_0x5e91d0});}}})[_0x3901('0x14')](function(){var _0x58e355=[];var _0x37274f=utils[_0x3901('0xf8')]();_0x37274f['forEach'](function(_0xb0fdd6){_0x58e355['push']({'channel':_0xb0fdd6,'membername':_0x51b734['name'],'interface':_[_0x3901('0x68')](_0x51b734[_0x3901('0xa9')])?util[_0x3901('0xaa')]('SIP/%s',_0x51b734['name']):_0x51b734['interface'],'type':'PAUSE','enterAt':moment()[_0x3901('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x242955[_0x3901('0x5f')][_0x3901('0x3a')]||_0x3901('0x103'),'role':_0x51b734[_0x3901('0x28')],'internal':_0x51b734['internal']});});return db[_0x3901('0xfd')][_0x3901('0x86')](_0x58e355,{'individualHooks':!![]});})['then'](function(){return _0x51b734[_0x3901('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x242955[_0x3901('0x5f')]['type']||_0x3901('0x103'),'lastPauseAt':moment()[_0x3901('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x57ce5c,null))['catch'](handleError(_0x57ce5c,null));};exports[_0x3901('0x104')]=function(_0x1ff62f,_0x53c6fe){var _0x4bd8c3;return db['User']['find']({'where':{'id':_0x1ff62f[_0x3901('0x53')]['id']},'attributes':['id',_0x3901('0x34'),_0x3901('0x28'),_0x3901('0xac'),_0x3901('0x105'),_0x3901('0x106'),_0x3901('0x107'),_0x3901('0x108'),_0x3901('0x109'),'whatsapppause',_0x3901('0x10a'),_0x3901('0x10b')]})[_0x3901('0x14')](handleEntityNotFound(_0x53c6fe,null))[_0x3901('0x14')](function(_0x37a2de){if(_0x37a2de){_0x4bd8c3=_0x37a2de;if(_0x1ff62f[_0x3901('0x5f')][_0x3901('0xb0')]&&!utils['isValidChannel'](_0x1ff62f['body'][_0x3901('0xb0')])){throw new db['Sequelize'][(_0x3901('0x8f'))](_0x3901('0x9e'));}switch(_0x1ff62f[_0x3901('0x5f')][_0x3901('0xb0')]){case _0x3901('0xa6'):return respondWithRpcPromise('QueuePause',_0x3901('0x104'),{'id':_0x4bd8c3['id'],'name':_0x4bd8c3[_0x3901('0x34')],'pause':![]})[_0x3901('0x14')](function(){return db['UserVoiceQueueRt'][_0x3901('0x27')]({'paused':0x0},{'where':{'UserId':_0x4bd8c3['id']},'individualHooks':!![]});})[_0x3901('0x14')](function(){return db[_0x3901('0xfd')]['find']({'where':{'channel':_0x1ff62f[_0x3901('0x5f')]['channel'],'membername':_0x4bd8c3['name'],'type':'PAUSE','exitAt':null}});})[_0x3901('0x14')](function(_0x2fa9f5){if(_0x2fa9f5){return _0x2fa9f5['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x3901('0x14')](function(){return _0x4bd8c3[_0x3901('0x27')]({'voicePause':![]});});case'mail':case _0x3901('0x4c'):case _0x3901('0x5e'):case _0x3901('0x5d'):case _0x3901('0x50'):case _0x3901('0x4f'):return db[_0x3901('0xfd')]['find']({'where':{'channel':_0x1ff62f[_0x3901('0x5f')][_0x3901('0xb0')],'membername':_0x4bd8c3[_0x3901('0x34')],'type':_0x3901('0xfb'),'exitAt':null}})[_0x3901('0x14')](function(_0x55e1ec){if(_0x55e1ec){return _0x55e1ec[_0x3901('0x27')]({'exitAt':moment()['format'](_0x3901('0xf9')),'data2':_0x3901('0x10c')},{'individualHooks':!![]});}return null;})[_0x3901('0x14')](function(){var _0x26b28c={};_['set'](_0x26b28c,util[_0x3901('0xaa')](_0x3901('0x10d'),_0x1ff62f[_0x3901('0x5f')][_0x3901('0xb0')],_0x3901('0x10e')),![]);return _0x4bd8c3['update'](_0x26b28c);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x4bd8c3['id'],'name':_0x4bd8c3[_0x3901('0x34')],'pause':![]})[_0x3901('0x14')](function(){return db[_0x3901('0xae')][_0x3901('0x27')]({'paused':0x0},{'where':{'UserId':_0x4bd8c3['id']}});})[_0x3901('0x14')](function(){return db[_0x3901('0xfd')][_0x3901('0x48')]({'where':{'membername':_0x4bd8c3[_0x3901('0x34')],'type':_0x3901('0xfb'),'exitAt':null}});})['then'](function(_0x2f331f){var _0x5305de=[];_0x2f331f[_0x3901('0xf7')](function(_0x17e2df){_0x5305de[_0x3901('0x47')](_0x17e2df['update']({'exitAt':moment()['format'](_0x3901('0xf9')),'data2':_0x3901('0x10c')}));});return BPromise['all'](_0x5305de);})[_0x3901('0x14')](function(){return _0x4bd8c3[_0x3901('0x27')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x53c6fe,null))['catch'](handleError(_0x53c6fe,null));};exports[_0x3901('0x10f')]=function(_0x4429cc,_0x1ba5a4){var _0x318fd1={};var _0x3a6e89={};var _0x5ab021;var _0x3d16d8;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x4429cc[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x1ba5a4,null))['then'](function(_0x1d07d2){if(_0x1d07d2){_0x5ab021=_0x1d07d2;_0x3a6e89[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0x110')][_0x3901('0x57')]);_0x3a6e89[_0x3901('0x41')]=_[_0x3901('0x56')](_0x4429cc[_0x3901('0x41')]);_0x3a6e89[_0x3901('0x58')]=_[_0x3901('0xca')](_0x3a6e89[_0x3901('0x54')],_0x3a6e89[_0x3901('0x41')]);_0x318fd1['attributes']=_['intersection'](_0x3a6e89[_0x3901('0x54')],qs[_0x3901('0x59')](_0x4429cc[_0x3901('0x41')]['fields']));_0x318fd1['attributes']=_0x318fd1[_0x3901('0x46')]['length']?_0x318fd1[_0x3901('0x46')]:_0x3a6e89['model'];_0x318fd1[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x4429cc['query']['sort']);_0x318fd1[_0x3901('0x3f')]=qs['filters'](_[_0x3901('0xd6')](_0x4429cc[_0x3901('0x41')],_0x3a6e89[_0x3901('0x58')]));if(_0x4429cc[_0x3901('0x41')][_0x3901('0x3c')]){_0x318fd1[_0x3901('0x3f')]=_['merge'](_0x318fd1[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x318fd1['attributes'],function(_0x18a2b1){var _0x5b18a9={};_0x5b18a9[_0x18a2b1]={'$like':'%'+_0x4429cc[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x5b18a9;})});}_0x318fd1=_[_0x3901('0x5b')]({},_0x318fd1,_0x4429cc[_0x3901('0x5c')]);return _0x5ab021['getTeams'](_0x318fd1);}})[_0x3901('0x14')](function(_0x3ee280){if(_0x3ee280){_0x3d16d8=_0x3ee280[_0x3901('0x4b')];if(!_0x4429cc[_0x3901('0x41')]['hasOwnProperty']('nolimit')){_0x318fd1[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x4429cc['query'][_0x3901('0x23')]);_0x318fd1['offset']=qs['offset'](_0x4429cc['query'][_0x3901('0x22')]);}return _0x5ab021[_0x3901('0x10f')](_0x318fd1);}})[_0x3901('0x14')](function(_0xe6d85f){if(_0xe6d85f){return _0xe6d85f?{'count':_0x3d16d8,'rows':_0xe6d85f}:null;}})[_0x3901('0x14')](respondWithResult(_0x1ba5a4,null))['catch'](handleError(_0x1ba5a4,null));};exports[_0x3901('0x111')]=function(_0x4f75a8,_0x515439){return db[_0x3901('0x38')]['find']({'where':{'id':_0x4f75a8[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x515439,null))['then'](function(_0x1187a8){if(_0x1187a8){var _0x4b6252=_0x1187a8['get']({'plain':!![]});return _0x1187a8[_0x3901('0x111')](_0x4f75a8['body'][_0x3901('0x62')],_[_0x3901('0x112')](_0x4f75a8['body'],[_0x3901('0x62'),'id'])||{})[_0x3901('0x14')](function(){for(var _0x346001=0x0;_0x346001<_0x4f75a8[_0x3901('0x5f')]['ids']['length'];_0x346001++){var _0x1930eb=[];var _0x1c529c={};db[_0x3901('0x110')][_0x3901('0x95')]({'where':{'id':_0x4f75a8[_0x3901('0x5f')][_0x3901('0x62')][_0x346001]}})[_0x3901('0x14')](function(_0x6474d4){_0x1c529c=_0x6474d4['dataValues'];_0x1930eb['push'](_0x6474d4['getVoiceQueues']()[_0x3901('0x14')](function(_0x4cf249){for(var _0x27cd0a=0x0;_0x27cd0a<_0x4cf249[_0x3901('0x4b')];_0x27cd0a++){_0x4cf249[_0x27cd0a][_0x3901('0x113')](_0x3901('0xb0'),'Voice');}return _0x4cf249;}));_0x1930eb[_0x3901('0x47')](_0x6474d4[_0x3901('0x114')]()['then'](function(_0x407c77){for(var _0x3de7a4=0x0;_0x3de7a4<_0x407c77[_0x3901('0x4b')];_0x3de7a4++){_0x407c77[_0x3de7a4][_0x3901('0x113')](_0x3901('0xb0'),_0x3901('0x115'));}return _0x407c77;}));_0x1930eb[_0x3901('0x47')](_0x6474d4[_0x3901('0x116')]()[_0x3901('0x14')](function(_0x46f88e){for(var _0x1551f6=0x0;_0x1551f6<_0x46f88e[_0x3901('0x4b')];_0x1551f6++){_0x46f88e[_0x1551f6]['setDataValue']('channel',_0x3901('0x117'));}return _0x46f88e;}));_0x1930eb[_0x3901('0x47')](_0x6474d4[_0x3901('0x118')]()[_0x3901('0x14')](function(_0x31f802){for(var _0x3c5277=0x0;_0x3c5277<_0x31f802[_0x3901('0x4b')];_0x3c5277++){_0x31f802[_0x3c5277]['setDataValue'](_0x3901('0xb0'),_0x3901('0x119'));}return _0x31f802;}));_0x1930eb[_0x3901('0x47')](_0x6474d4[_0x3901('0x11a')]()[_0x3901('0x14')](function(_0x324088){for(var _0x488fc1=0x0;_0x488fc1<_0x324088[_0x3901('0x4b')];_0x488fc1++){_0x324088[_0x488fc1][_0x3901('0x113')]('channel','Whatsapp');}return _0x324088;}));_0x1930eb[_0x3901('0x47')](_0x6474d4['getFaxQueues']()['then'](function(_0x106a63){for(var _0x4b15e8=0x0;_0x4b15e8<_0x106a63[_0x3901('0x4b')];_0x4b15e8++){_0x106a63[_0x4b15e8][_0x3901('0x113')](_0x3901('0xb0'),_0x3901('0x11b'));}return _0x106a63;}));_0x1930eb[_0x3901('0x47')](_0x6474d4[_0x3901('0x11c')]()['then'](function(_0x2f5005){for(var _0x2d9d6f=0x0;_0x2d9d6f<_0x2f5005[_0x3901('0x4b')];_0x2d9d6f++){_0x2f5005[_0x2d9d6f][_0x3901('0x113')](_0x3901('0xb0'),_0x3901('0x11d'));}return _0x2f5005;}));return BPromise['all'](_0x1930eb);})[_0x3901('0x14')](function(_0xe51f3b){var _0x1b2dc1=_[_0x3901('0x11e')](_0xe51f3b);_0x1930eb=[];return db[_0x3901('0x6b')][_0x3901('0x11f')](function(_0xb53237){for(var _0x2bcaaa=0x0;_0x2bcaaa<_0x1b2dc1['length'];_0x2bcaaa++){_0x1930eb[_0x3901('0x47')](_0x1b2dc1[_0x2bcaaa]['addAgent'](_0x4b6252['id']),{'transaction':_0xb53237});}return BPromise[_0x3901('0x8a')](_0x1930eb)[_0x3901('0x14')](function(){if(_0x4b6252[_0x3901('0x9c')]){return BPromise[_0x3901('0x8b')](_[_0x3901('0x3c')](_0x1b2dc1,function(_0x503251){return _0x503251['getDataValue'](_0x3901('0xb0'))==='Voice';}),function(_0x32d861){return db[_0x3901('0xae')][_0x3901('0xaf')]({'membername':_0x4b6252[_0x3901('0x34')],'UserId':_0x4b6252['id'],'queue_name':_0x32d861['name'],'VoiceQueueId':_0x32d861['id'],'interface':_[_0x3901('0x68')](_0x4b6252[_0x3901('0xa9')])?util['format'](_0x3901('0xab'),_0x4b6252['name']):_0x4b6252[_0x3901('0xa9')],'paused':_0x4b6252[_0x3901('0xac')]||![],'penalty':_0x4b6252['penalty']},{'transaction':_0xb53237});});}else{return;}})[_0x3901('0x14')](function(){for(var _0x4b6957=0x0;_0x4b6957<_0x1b2dc1['length'];_0x4b6957++){var _0x4e4215=_0x1b2dc1[_0x4b6957][_0x3901('0x120')](_0x3901('0xb0'));var _0x1974f1=_0x4e4215+_0x3901('0xa3');socket[_0x3901('0xa4')](_0x3901('0x2b')+_0x4e4215+_0x3901('0xa5'),{'UserId':_0x4b6252['id'],['queueField']:_0x1b2dc1[_0x4b6957]['id']});}});});})[_0x3901('0x14')](function(){db['TeamVoicePrefix'][_0x3901('0x95')]({'where':{'teamId':_0x1c529c['id']}})[_0x3901('0x14')](function(_0x1660af){if(_0x1660af){db[_0x3901('0x121')]['create']({'UserId':_0x4f75a8[_0x3901('0x53')]['id'],'VoicePrefixId':_0x1660af[_0x3901('0x122')]});}});});}});}})[_0x3901('0x14')](respondWithStatusCode(_0x515439,null))['catch'](handleError(_0x515439,null));};exports[_0x3901('0x123')]=function(_0x302b7d,_0x565949){return db['User']['findOne']({'where':{'id':_0x302b7d[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x565949,null))['then'](function(_0x1c82ed){if(_0x1c82ed){var _0x2e788f=_0x1c82ed['get']({'plain':!![]});var _0x53e3d8=_0x302b7d[_0x3901('0x41')]['ids'];return _0x1c82ed[_0x3901('0x123')](_0x53e3d8)[_0x3901('0x14')](function(){for(var _0x5a925b=0x0;_0x5a925b<_0x53e3d8[_0x3901('0x4b')];_0x5a925b++){var _0x5a6efc=[];var _0x51b43f={};db[_0x3901('0x110')][_0x3901('0x95')]({'where':{'id':_0x53e3d8[_0x5a925b]}})[_0x3901('0x14')](function(_0x46882c){_0x51b43f=_0x46882c[_0x3901('0x4d')];_0x5a6efc[_0x3901('0x47')](_0x46882c[_0x3901('0xf5')]()['then'](function(_0x4011d3){for(var _0x26faa6=0x0;_0x26faa6<_0x4011d3[_0x3901('0x4b')];_0x26faa6++){_0x4011d3[_0x26faa6]['setDataValue'](_0x3901('0xb0'),_0x3901('0x124'));}return _0x4011d3;}));_0x5a6efc[_0x3901('0x47')](_0x46882c[_0x3901('0x114')]()[_0x3901('0x14')](function(_0x3fec32){for(var _0x590c98=0x0;_0x590c98<_0x3fec32[_0x3901('0x4b')];_0x590c98++){_0x3fec32[_0x590c98][_0x3901('0x113')](_0x3901('0xb0'),_0x3901('0x115'));}return _0x3fec32;}));_0x5a6efc[_0x3901('0x47')](_0x46882c[_0x3901('0x116')]()[_0x3901('0x14')](function(_0x4f0681){for(var _0xec52cf=0x0;_0xec52cf<_0x4f0681[_0x3901('0x4b')];_0xec52cf++){_0x4f0681[_0xec52cf][_0x3901('0x113')]('channel',_0x3901('0x117'));}return _0x4f0681;}));_0x5a6efc[_0x3901('0x47')](_0x46882c[_0x3901('0x118')]()[_0x3901('0x14')](function(_0x2cba03){for(var _0x1a838d=0x0;_0x1a838d<_0x2cba03[_0x3901('0x4b')];_0x1a838d++){_0x2cba03[_0x1a838d]['setDataValue'](_0x3901('0xb0'),_0x3901('0x119'));}return _0x2cba03;}));_0x5a6efc[_0x3901('0x47')](_0x46882c[_0x3901('0x11a')]()[_0x3901('0x14')](function(_0x42691c){for(var _0x57f2a6=0x0;_0x57f2a6<_0x42691c[_0x3901('0x4b')];_0x57f2a6++){_0x42691c[_0x57f2a6][_0x3901('0x113')](_0x3901('0xb0'),_0x3901('0x125'));}return _0x42691c;}));_0x5a6efc[_0x3901('0x47')](_0x46882c[_0x3901('0x126')]()[_0x3901('0x14')](function(_0x2c3d2e){for(var _0x172202=0x0;_0x172202<_0x2c3d2e[_0x3901('0x4b')];_0x172202++){_0x2c3d2e[_0x172202][_0x3901('0x113')](_0x3901('0xb0'),_0x3901('0x11b'));}return _0x2c3d2e;}));_0x5a6efc[_0x3901('0x47')](_0x46882c[_0x3901('0x11c')]()[_0x3901('0x14')](function(_0x54abe0){for(var _0x42b487=0x0;_0x42b487<_0x54abe0[_0x3901('0x4b')];_0x42b487++){_0x54abe0[_0x42b487]['setDataValue']('channel',_0x3901('0x11d'));}return _0x54abe0;}));return BPromise[_0x3901('0x8a')](_0x5a6efc);})[_0x3901('0x14')](function(_0x5ac0d6){var _0x47895b=_['flatten'](_0x5ac0d6);_0x5a6efc=[];return db[_0x3901('0x6b')][_0x3901('0x11f')](function(_0x3f09e4){for(var _0xcd0395=0x0;_0xcd0395<_0x47895b[_0x3901('0x4b')];_0xcd0395++){_0x5a6efc[_0x3901('0x47')](_0x47895b[_0xcd0395][_0x3901('0x127')](_0x2e788f['id']),{'transaction':_0x3f09e4});}return BPromise[_0x3901('0x8a')](_0x5a6efc)[_0x3901('0x14')](function(){if(_0x2e788f[_0x3901('0x9c')]){return BPromise[_0x3901('0x8b')](_['filter'](_0x47895b,function(_0x5bb0be){return _0x5bb0be[_0x3901('0x120')](_0x3901('0xb0'))===_0x3901('0x124');}),function(_0x48fcf9){return db[_0x3901('0xae')][_0x3901('0x36')]({'where':{'VoiceQueueId':_0x48fcf9['id'],'UserId':_0x2e788f['id']},'transaction':_0x3f09e4});});}else{return;}})['then'](function(){db[_0x3901('0x128')][_0x3901('0x95')]({'where':{'teamId':_0x51b43f['id']}})[_0x3901('0x14')](function(_0x603db3){if(_0x603db3){return db[_0x3901('0x121')]['destroy']({'where':{'UserId':_0x2e788f['id'],'VoicePrefixId':_0x603db3[_0x3901('0x4d')]['VoicePrefixId']}});}});})[_0x3901('0x14')](function(){for(var _0x4ffbfa=0x0;_0x4ffbfa<_0x47895b[_0x3901('0x4b')];_0x4ffbfa++){var _0x369815=_0x47895b[_0x4ffbfa][_0x3901('0x120')]('channel');var _0xf496d4=_0x369815+_0x3901('0xa3');socket['emit']('user'+_0x369815+_0x3901('0xb3'),{'UserId':_0x2e788f['id'],['queueField']:_0x47895b[_0x4ffbfa]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x565949,null))[_0x3901('0x51')](handleError(_0x565949,null));};exports['getLists']=function(_0x138bf4,_0x3fdb2d){var _0x54f300={};var _0x42c961={};var _0x2dad96;var _0x3c5c7f;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x138bf4[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x3fdb2d,null))[_0x3901('0x14')](function(_0x410cb6){if(_0x410cb6){_0x2dad96=_0x410cb6;_0x42c961[_0x3901('0x54')]=_[_0x3901('0x56')](db['CmList'][_0x3901('0x57')]);_0x42c961[_0x3901('0x41')]=_[_0x3901('0x56')](_0x138bf4[_0x3901('0x41')]);_0x42c961[_0x3901('0x58')]=_['intersection'](_0x42c961[_0x3901('0x54')],_0x42c961[_0x3901('0x41')]);_0x54f300[_0x3901('0x46')]=_[_0x3901('0xca')](_0x42c961['model'],qs[_0x3901('0x59')](_0x138bf4[_0x3901('0x41')][_0x3901('0x59')]));_0x54f300[_0x3901('0x46')]=_0x54f300['attributes'][_0x3901('0x4b')]?_0x54f300[_0x3901('0x46')]:_0x42c961[_0x3901('0x54')];_0x54f300[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x138bf4[_0x3901('0x41')][_0x3901('0xd5')]);_0x54f300['where']=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x138bf4['query'],_0x42c961[_0x3901('0x58')]));if(_0x138bf4[_0x3901('0x41')]['filter']){_0x54f300['where']=_[_0x3901('0x5b')](_0x54f300[_0x3901('0x3f')],{'$or':_['map'](_0x54f300[_0x3901('0x46')],function(_0x12b94a){var _0x566fc7={};_0x566fc7[_0x12b94a]={'$like':'%'+_0x138bf4[_0x3901('0x41')]['filter']+'%'};return _0x566fc7;})});}_0x54f300=_[_0x3901('0x5b')]({},_0x54f300,_0x138bf4[_0x3901('0x5c')]);return _0x2dad96[_0x3901('0x129')](_0x54f300);}})[_0x3901('0x14')](function(_0x452c72){if(_0x452c72){_0x3c5c7f=_0x452c72[_0x3901('0x4b')];if(!_0x138bf4[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0x54f300[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x138bf4['query'][_0x3901('0x23')]);_0x54f300[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x138bf4['query']['offset']);}return _0x2dad96[_0x3901('0x129')](_0x54f300);}})[_0x3901('0x14')](function(_0x202d90){if(_0x202d90){return _0x202d90?{'count':_0x3c5c7f,'rows':_0x202d90}:null;}})[_0x3901('0x14')](respondWithResult(_0x3fdb2d,null))[_0x3901('0x51')](handleError(_0x3fdb2d,null));};exports[_0x3901('0x12a')]=function(_0x33a09c,_0x1590b8){var _0x5ef3a7={};var _0x570caf={};var _0x1c71b9;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x33a09c[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x1590b8,null))[_0x3901('0x14')](function(_0x187f0c){if(_0x187f0c){_0x1c71b9=_0x187f0c;_0x570caf[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0x38')][_0x3901('0x57')]);_0x570caf[_0x3901('0x41')]=_[_0x3901('0x56')](_0x33a09c[_0x3901('0x41')]);_0x570caf[_0x3901('0x58')]=_['intersection'](_0x570caf[_0x3901('0x54')],_0x570caf[_0x3901('0x41')]);_0x5ef3a7['attributes']=_[_0x3901('0xca')](_0x570caf[_0x3901('0x54')],qs['fields'](_0x33a09c[_0x3901('0x41')][_0x3901('0x59')]));_0x5ef3a7['attributes']=_0x5ef3a7['attributes']['length']?_0x5ef3a7[_0x3901('0x46')]:_0x570caf['model'];_0x5ef3a7[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x33a09c[_0x3901('0x41')][_0x3901('0xd5')]);_0x5ef3a7[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x33a09c[_0x3901('0x41')],_0x570caf[_0x3901('0x58')]));if(_0x33a09c[_0x3901('0x41')][_0x3901('0x3c')]){_0x5ef3a7['where']=_[_0x3901('0x5b')](_0x5ef3a7['where'],{'$or':_[_0x3901('0x30')](_0x5ef3a7[_0x3901('0x46')],function(_0x50ee69){var _0x3c7f5f={};_0x3c7f5f[_0x50ee69]={'$like':'%'+_0x33a09c['query']['filter']+'%'};return _0x3c7f5f;})});}_0x5ef3a7[_0x3901('0x54')]=db[_0x3901('0x38')];_0x5ef3a7['as']=_0x3901('0x2c');_0x5ef3a7=_[_0x3901('0x5b')]({},_0x5ef3a7,_0x33a09c[_0x3901('0x5c')]);return _0x1c71b9[_0x3901('0xf5')]({'include':[_0x5ef3a7]});}})[_0x3901('0x14')](function(_0xf15946){if(_0xf15946){var _0x5ebfcc={},_0x4febdf=[];for(var _0x40df9b=0x0;_0x40df9b<_0xf15946[_0x3901('0x4b')];_0x40df9b+=0x1){for(var _0x5a2afa=0x0,_0x16bcd5;_0x5a2afa<_0xf15946[_0x40df9b][_0x3901('0x2c')]['length'];_0x5a2afa+=0x1){_0x16bcd5=_0xf15946[_0x40df9b][_0x3901('0x2c')][_0x5a2afa][_0x3901('0xa8')]({'plain':!![]});_0x5ebfcc[_0x16bcd5['id']]=_0x16bcd5;}}_0x5ebfcc=_[_0x3901('0x12b')](_0x5ebfcc);for(var _0x298f14=qs['offset'](_0x33a09c[_0x3901('0x41')][_0x3901('0x22')]);_0x298f14<_0x5ebfcc['length']&&_0x4febdf[_0x3901('0x4b')]<qs[_0x3901('0x23')](_0x33a09c['query']['limit']);_0x298f14+=0x1){if(_0x5ebfcc[_0x298f14]){_0x4febdf[_0x3901('0x47')](_0x5ebfcc[_0x298f14]);}}return{'count':_0x5ebfcc[_0x3901('0x4b')],'rows':_0x4febdf};}})[_0x3901('0x14')](respondWithResult(_0x1590b8,null))[_0x3901('0x51')](handleError(_0x1590b8,null));};exports[_0x3901('0x36')]=function(_0xddbd75,_0x580079){if(_0xddbd75[_0x3901('0x2b')]['id']==_0xddbd75['params']['id']){return _0x580079['status'](0x1f4)['send']({'message':_0x3901('0x12c')});}return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0xddbd75[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x580079,null))[_0x3901('0x14')](removeEntity(_0x580079,null))[_0x3901('0x51')](handleError(_0x580079,null));};exports['addChatInteractions']=function(_0x5d0692,_0xc4692e){return db[_0x3901('0x38')]['find']({'where':{'id':_0x5d0692[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0xc4692e,null))[_0x3901('0x14')](function(_0x58de77){if(_0x58de77){return _0x58de77[_0x3901('0x12d')](_0x5d0692[_0x3901('0x5f')]['ids'],_['omit'](_0x5d0692[_0x3901('0x5f')],[_0x3901('0x62'),'id'])||{})[_0x3901('0x12e')](function(){for(var _0x34bd1f=0x0;_0x34bd1f<_0x5d0692[_0x3901('0x5f')]['ids']['length'];_0x34bd1f+=0x1){socket[_0x3901('0xa4')](_0x3901('0x12f'),{'ChatInteractionId':Number(_0x5d0692[_0x3901('0x5f')][_0x3901('0x62')][_0x34bd1f]),'UserId':Number(_0x5d0692[_0x3901('0x53')]['id'])});}return _0x5d0692[_0x3901('0x5f')][_0x3901('0x62')];});}})[_0x3901('0x14')](respondWithResult(_0xc4692e,null))[_0x3901('0x51')](handleError(_0xc4692e,null));};exports[_0x3901('0x130')]=function(_0xe5668f,_0x1541a4){return db[_0x3901('0x38')]['find']({'where':{'id':_0xe5668f[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x1541a4,null))['then'](function(_0x2a76af){if(_0x2a76af){return _0x2a76af['removeChatInteractions'](_0xe5668f[_0x3901('0x41')][_0x3901('0x62')])[_0x3901('0x14')](function(){if(_[_0x3901('0xb2')](_0xe5668f[_0x3901('0x41')]['ids'])){for(var _0x506cc3=0x0;_0x506cc3<_0xe5668f[_0x3901('0x41')][_0x3901('0x62')][_0x3901('0x4b')];_0x506cc3+=0x1){socket[_0x3901('0xa4')](_0x3901('0x131'),{'ChatInteractionId':Number(_0xe5668f[_0x3901('0x41')][_0x3901('0x62')][_0x506cc3]),'UserId':Number(_0xe5668f[_0x3901('0x53')]['id'])});}}else{socket[_0x3901('0xa4')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xe5668f['query'][_0x3901('0x62')]),'UserId':Number(_0xe5668f['params']['id'])});}});}})[_0x3901('0x14')](respondWithStatusCode(_0x1541a4,null))['catch'](handleError(_0x1541a4,null));};exports['addMailInteractions']=function(_0x4227ac,_0x3fd438){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x4227ac[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x3fd438,null))[_0x3901('0x14')](function(_0x18cf5d){if(_0x18cf5d){return _0x18cf5d[_0x3901('0x132')](_0x4227ac[_0x3901('0x5f')][_0x3901('0x62')],_[_0x3901('0x112')](_0x4227ac[_0x3901('0x5f')],[_0x3901('0x62'),'id'])||{})[_0x3901('0x12e')](function(){for(var _0x120586=0x0;_0x120586<_0x4227ac[_0x3901('0x5f')]['ids'][_0x3901('0x4b')];_0x120586+=0x1){socket[_0x3901('0xa4')](_0x3901('0x133'),{'MailInteractionId':Number(_0x4227ac[_0x3901('0x5f')][_0x3901('0x62')][_0x120586]),'UserId':Number(_0x4227ac[_0x3901('0x53')]['id'])});}return _0x4227ac[_0x3901('0x5f')][_0x3901('0x62')];});}})[_0x3901('0x14')](respondWithResult(_0x3fd438,null))[_0x3901('0x51')](handleError(_0x3fd438,null));};exports[_0x3901('0x134')]=function(_0x1e2959,_0x2688f8){return db['User']['find']({'where':{'id':_0x1e2959[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x2688f8,null))[_0x3901('0x14')](function(_0x193705){if(_0x193705){return _0x193705['removeMailInteractions'](_0x1e2959[_0x3901('0x41')][_0x3901('0x62')])[_0x3901('0x14')](function(){if(_[_0x3901('0xb2')](_0x1e2959[_0x3901('0x41')][_0x3901('0x62')])){for(var _0x12008e=0x0;_0x12008e<_0x1e2959[_0x3901('0x41')][_0x3901('0x62')][_0x3901('0x4b')];_0x12008e+=0x1){socket[_0x3901('0xa4')](_0x3901('0x135'),{'MailInteractionId':Number(_0x1e2959[_0x3901('0x41')][_0x3901('0x62')][_0x12008e]),'UserId':Number(_0x1e2959[_0x3901('0x53')]['id'])});}}else{socket['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1e2959[_0x3901('0x41')][_0x3901('0x62')]),'UserId':Number(_0x1e2959[_0x3901('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x2688f8,null))[_0x3901('0x51')](handleError(_0x2688f8,null));};exports[_0x3901('0x136')]=function(_0x7cf3d6,_0x48c446){return db['User']['find']({'where':{'id':_0x7cf3d6[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x48c446,null))['then'](function(_0x4dbee9){if(_0x4dbee9){return _0x4dbee9[_0x3901('0x136')](_0x7cf3d6[_0x3901('0x5f')]['ids'],_[_0x3901('0x112')](_0x7cf3d6['body'],[_0x3901('0x62'),'id'])||{})[_0x3901('0x12e')](function(){for(var _0x3e0de0=0x0;_0x3e0de0<_0x7cf3d6[_0x3901('0x5f')]['ids'][_0x3901('0x4b')];_0x3e0de0+=0x1){socket[_0x3901('0xa4')](_0x3901('0x137'),{'FaxInteractionId':Number(_0x7cf3d6[_0x3901('0x5f')][_0x3901('0x62')][_0x3e0de0]),'UserId':Number(_0x7cf3d6[_0x3901('0x53')]['id'])});}return _0x7cf3d6[_0x3901('0x5f')][_0x3901('0x62')];});}})[_0x3901('0x14')](respondWithResult(_0x48c446,null))[_0x3901('0x51')](handleError(_0x48c446,null));};exports[_0x3901('0x138')]=function(_0x480729,_0x1fe460){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x480729['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x1fe460,null))[_0x3901('0x14')](function(_0x29e7fd){if(_0x29e7fd){return _0x29e7fd[_0x3901('0x138')](_0x480729['query']['ids'])['then'](function(){if(_[_0x3901('0xb2')](_0x480729['query'][_0x3901('0x62')])){for(var _0x8dbd0f=0x0;_0x8dbd0f<_0x480729[_0x3901('0x41')]['ids'][_0x3901('0x4b')];_0x8dbd0f+=0x1){socket['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x480729['query'][_0x3901('0x62')][_0x8dbd0f]),'UserId':Number(_0x480729[_0x3901('0x53')]['id'])});}}else{socket[_0x3901('0xa4')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x480729[_0x3901('0x41')][_0x3901('0x62')]),'UserId':Number(_0x480729['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1fe460,null))['catch'](handleError(_0x1fe460,null));};exports[_0x3901('0x139')]=function(_0x975907,_0x4cd928){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x975907[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x4cd928,null))[_0x3901('0x14')](function(_0x7619a2){if(_0x7619a2){return _0x7619a2['addSmsInteractions'](_0x975907[_0x3901('0x5f')][_0x3901('0x62')],_[_0x3901('0x112')](_0x975907[_0x3901('0x5f')],['ids','id'])||{})[_0x3901('0x12e')](function(){for(var _0x170766=0x0;_0x170766<_0x975907[_0x3901('0x5f')][_0x3901('0x62')]['length'];_0x170766+=0x1){socket[_0x3901('0xa4')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x975907['body'][_0x3901('0x62')][_0x170766]),'UserId':Number(_0x975907[_0x3901('0x53')]['id'])});}return _0x975907['body'][_0x3901('0x62')];});}})[_0x3901('0x14')](respondWithResult(_0x4cd928,null))['catch'](handleError(_0x4cd928,null));};exports[_0x3901('0x13a')]=function(_0xe3de39,_0x54f167){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0xe3de39[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x54f167,null))[_0x3901('0x14')](function(_0x31e950){if(_0x31e950){return _0x31e950[_0x3901('0x13a')](_0xe3de39[_0x3901('0x41')]['ids'])[_0x3901('0x14')](function(){if(_['isArray'](_0xe3de39[_0x3901('0x41')]['ids'])){for(var _0x3b2b61=0x0;_0x3b2b61<_0xe3de39[_0x3901('0x41')][_0x3901('0x62')]['length'];_0x3b2b61+=0x1){socket[_0x3901('0xa4')](_0x3901('0x13b'),{'SmsInteractionId':Number(_0xe3de39[_0x3901('0x41')]['ids'][_0x3b2b61]),'UserId':Number(_0xe3de39[_0x3901('0x53')]['id'])});}}else{socket[_0x3901('0xa4')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xe3de39[_0x3901('0x41')][_0x3901('0x62')]),'UserId':Number(_0xe3de39[_0x3901('0x53')]['id'])});}});}})[_0x3901('0x14')](respondWithStatusCode(_0x54f167,null))[_0x3901('0x51')](handleError(_0x54f167,null));};exports['addOpenchannelInteractions']=function(_0x3a68c0,_0x15413f){return db[_0x3901('0x38')]['find']({'where':{'id':_0x3a68c0[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x15413f,null))['then'](function(_0x2d1f50){if(_0x2d1f50){return _0x2d1f50['addOpenchannelInteractions'](_0x3a68c0[_0x3901('0x5f')][_0x3901('0x62')],_[_0x3901('0x112')](_0x3a68c0[_0x3901('0x5f')],[_0x3901('0x62'),'id'])||{})[_0x3901('0x12e')](function(){for(var _0x4dda2a=0x0;_0x4dda2a<_0x3a68c0[_0x3901('0x5f')][_0x3901('0x62')]['length'];_0x4dda2a+=0x1){socket[_0x3901('0xa4')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x3a68c0[_0x3901('0x5f')][_0x3901('0x62')][_0x4dda2a]),'UserId':Number(_0x3a68c0['params']['id'])});}return _0x3a68c0[_0x3901('0x5f')][_0x3901('0x62')];});}})[_0x3901('0x14')](respondWithResult(_0x15413f,null))[_0x3901('0x51')](handleError(_0x15413f,null));};exports[_0x3901('0x13c')]=function(_0x33caf4,_0xf240aa){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x33caf4[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0xf240aa,null))[_0x3901('0x14')](function(_0x3eec16){if(_0x3eec16){return _0x3eec16[_0x3901('0x13c')](_0x33caf4[_0x3901('0x41')][_0x3901('0x62')])['then'](function(){if(_[_0x3901('0xb2')](_0x33caf4['query']['ids'])){for(var _0x448611=0x0;_0x448611<_0x33caf4[_0x3901('0x41')][_0x3901('0x62')][_0x3901('0x4b')];_0x448611+=0x1){socket['emit'](_0x3901('0x13d'),{'OpenchannelInteractionId':Number(_0x33caf4[_0x3901('0x41')][_0x3901('0x62')][_0x448611]),'UserId':Number(_0x33caf4['params']['id'])});}}else{socket[_0x3901('0xa4')](_0x3901('0x13d'),{'OpenchannelInteractionId':Number(_0x33caf4[_0x3901('0x41')]['ids']),'UserId':Number(_0x33caf4[_0x3901('0x53')]['id'])});}});}})[_0x3901('0x14')](respondWithStatusCode(_0xf240aa,null))[_0x3901('0x51')](handleError(_0xf240aa,null));};exports[_0x3901('0x13e')]=function(_0xd50ace,_0x439b77){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0xd50ace[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x439b77,null))['then'](function(_0x464162){if(_0x464162){return _0x464162[_0x3901('0x13e')](_0xd50ace['body'][_0x3901('0x62')],_[_0x3901('0x112')](_0xd50ace['body'],[_0x3901('0x62'),'id'])||{})[_0x3901('0x12e')](function(){for(var _0x204089=0x0;_0x204089<_0xd50ace[_0x3901('0x5f')][_0x3901('0x62')][_0x3901('0x4b')];_0x204089+=0x1){socket[_0x3901('0xa4')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0xd50ace[_0x3901('0x5f')]['ids'][_0x204089]),'UserId':Number(_0xd50ace['params']['id'])});}return _0xd50ace['body'][_0x3901('0x62')];});}})['then'](respondWithResult(_0x439b77,null))[_0x3901('0x51')](handleError(_0x439b77,null));};exports['removeWhatsappInteractions']=function(_0x5c0389,_0x15635c){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x5c0389['params']['id']}})['then'](handleEntityNotFound(_0x15635c,null))['then'](function(_0x3a0450){if(_0x3a0450){return _0x3a0450[_0x3901('0x13f')](_0x5c0389[_0x3901('0x41')]['ids']);}})[_0x3901('0x14')](respondWithStatusCode(_0x15635c,null))[_0x3901('0x51')](handleError(_0x15635c,null));};exports[_0x3901('0x140')]=function(_0x386ae0,_0x13264f){var _0x24235d={};var _0x5472c5={};var _0x20572a;var _0x2200c7;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x386ae0[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x13264f,null))[_0x3901('0x14')](function(_0x3ed361){if(_0x3ed361){_0x20572a=_0x3ed361;_0x5472c5[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0x141')][_0x3901('0x57')]);_0x5472c5[_0x3901('0x41')]=_[_0x3901('0x56')](_0x386ae0['query']);_0x5472c5[_0x3901('0x58')]=_[_0x3901('0xca')](_0x5472c5[_0x3901('0x54')],_0x5472c5[_0x3901('0x41')]);_0x24235d[_0x3901('0x46')]=_[_0x3901('0xca')](_0x5472c5['model'],qs[_0x3901('0x59')](_0x386ae0['query'][_0x3901('0x59')]));_0x24235d[_0x3901('0x46')]=_0x24235d[_0x3901('0x46')]['length']?_0x24235d['attributes']:_0x5472c5['model'];_0x24235d[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x386ae0[_0x3901('0x41')][_0x3901('0xd5')]);_0x24235d[_0x3901('0x3f')]=qs['filters'](_['pick'](_0x386ae0['query'],_0x5472c5[_0x3901('0x58')]));if(_0x386ae0[_0x3901('0x41')][_0x3901('0x3c')]){_0x24235d['where']=_[_0x3901('0x5b')](_0x24235d[_0x3901('0x3f')],{'$or':_['map'](_0x24235d['attributes'],function(_0x11b41c){var _0x3b308d={};_0x3b308d[_0x11b41c]={'$like':'%'+_0x386ae0[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x3b308d;})});}_0x24235d=_[_0x3901('0x5b')]({},_0x24235d,_0x386ae0['options']);return _0x20572a[_0x3901('0x140')](_0x24235d);}})[_0x3901('0x14')](function(_0x48a037){if(_0x48a037){_0x2200c7=_0x48a037[_0x3901('0x4b')];if(!_0x386ae0[_0x3901('0x41')][_0x3901('0xcc')]('nolimit')){_0x24235d[_0x3901('0x23')]=qs['limit'](_0x386ae0[_0x3901('0x41')][_0x3901('0x23')]);_0x24235d[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x386ae0[_0x3901('0x41')][_0x3901('0x22')]);}return _0x20572a[_0x3901('0x140')](_0x24235d);}})['then'](function(_0xc35c72){if(_0xc35c72){return _0xc35c72?{'count':_0x2200c7,'rows':_0xc35c72}:null;}})[_0x3901('0x14')](respondWithResult(_0x13264f,null))[_0x3901('0x51')](handleError(_0x13264f,null));};exports[_0x3901('0x142')]=function(_0x4ea640,_0x418175){var _0x20cc58={};var _0x29895c={};var _0x366ed2;var _0x5c843b;return db[_0x3901('0x38')]['findOne']({'where':{'id':_0x4ea640[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x418175,null))[_0x3901('0x14')](function(_0x550c78){if(_0x550c78){_0x366ed2=_0x550c78;_0x29895c['model']=_[_0x3901('0x56')](db['FaxAccount'][_0x3901('0x57')]);_0x29895c['query']=_[_0x3901('0x56')](_0x4ea640['query']);_0x29895c[_0x3901('0x58')]=_[_0x3901('0xca')](_0x29895c['model'],_0x29895c[_0x3901('0x41')]);_0x20cc58[_0x3901('0x46')]=_[_0x3901('0xca')](_0x29895c[_0x3901('0x54')],qs['fields'](_0x4ea640[_0x3901('0x41')][_0x3901('0x59')]));_0x20cc58[_0x3901('0x46')]=_0x20cc58[_0x3901('0x46')]['length']?_0x20cc58[_0x3901('0x46')]:_0x29895c[_0x3901('0x54')];_0x20cc58[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x4ea640[_0x3901('0x41')][_0x3901('0xd5')]);_0x20cc58[_0x3901('0x3f')]=qs[_0x3901('0x58')](_['pick'](_0x4ea640[_0x3901('0x41')],_0x29895c[_0x3901('0x58')]));if(_0x4ea640[_0x3901('0x41')][_0x3901('0x3c')]){_0x20cc58[_0x3901('0x3f')]=_['merge'](_0x20cc58['where'],{'$or':_[_0x3901('0x30')](_0x20cc58[_0x3901('0x46')],function(_0x284782){var _0x49f5d5={};_0x49f5d5[_0x284782]={'$like':'%'+_0x4ea640['query'][_0x3901('0x3c')]+'%'};return _0x49f5d5;})});}_0x20cc58=_[_0x3901('0x5b')]({},_0x20cc58,_0x4ea640[_0x3901('0x5c')]);return _0x366ed2[_0x3901('0x142')](_0x20cc58);}})[_0x3901('0x14')](function(_0x2dbf8c){if(_0x2dbf8c){_0x5c843b=_0x2dbf8c[_0x3901('0x4b')];if(!_0x4ea640[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0x20cc58[_0x3901('0x23')]=qs['limit'](_0x4ea640[_0x3901('0x41')][_0x3901('0x23')]);_0x20cc58[_0x3901('0x22')]=qs['offset'](_0x4ea640[_0x3901('0x41')][_0x3901('0x22')]);}return _0x366ed2[_0x3901('0x142')](_0x20cc58);}})[_0x3901('0x14')](function(_0x1d8908){if(_0x1d8908){return _0x1d8908?{'count':_0x5c843b,'rows':_0x1d8908}:null;}})[_0x3901('0x14')](respondWithResult(_0x418175,null))['catch'](handleError(_0x418175,null));};exports['addFaxAccounts']=function(_0x18ab9c,_0x3be500){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x18ab9c[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x3be500,null))[_0x3901('0x14')](function(_0x3785e7){if(_0x3785e7){return _0x3785e7[_0x3901('0x143')](_0x18ab9c[_0x3901('0x5f')][_0x3901('0x62')],_[_0x3901('0x112')](_0x18ab9c[_0x3901('0x5f')],[_0x3901('0x62'),'id'])||{});}})['then'](respondWithResult(_0x3be500,null))[_0x3901('0x51')](handleError(_0x3be500,null));};exports[_0x3901('0x144')]=function(_0x1151d6,_0x4a8fcf){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x1151d6['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x4a8fcf,null))[_0x3901('0x14')](function(_0x5db59d){if(_0x5db59d){return _0x5db59d[_0x3901('0x144')](_0x1151d6[_0x3901('0x41')][_0x3901('0x62')]);}})[_0x3901('0x14')](respondWithStatusCode(_0x4a8fcf,null))[_0x3901('0x51')](handleError(_0x4a8fcf,null));};exports['getMailAccounts']=function(_0x31b51f,_0x46a862){var _0xfa6782={};var _0x5d4d6e={};var _0x499b99;var _0x52ad14;return db[_0x3901('0x38')]['findOne']({'where':{'id':_0x31b51f[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x46a862,null))[_0x3901('0x14')](function(_0x396efa){if(_0x396efa){_0x499b99=_0x396efa;_0x5d4d6e[_0x3901('0x54')]=_['keys'](db[_0x3901('0x145')][_0x3901('0x57')]);_0x5d4d6e['query']=_['keys'](_0x31b51f[_0x3901('0x41')]);_0x5d4d6e['filters']=_[_0x3901('0xca')](_0x5d4d6e[_0x3901('0x54')],_0x5d4d6e[_0x3901('0x41')]);_0xfa6782[_0x3901('0x46')]=_[_0x3901('0xca')](_0x5d4d6e[_0x3901('0x54')],qs[_0x3901('0x59')](_0x31b51f[_0x3901('0x41')]['fields']));_0xfa6782[_0x3901('0x46')]=_0xfa6782[_0x3901('0x46')][_0x3901('0x4b')]?_0xfa6782[_0x3901('0x46')]:_0x5d4d6e[_0x3901('0x54')];_0xfa6782['order']=qs[_0x3901('0xd5')](_0x31b51f[_0x3901('0x41')]['sort']);_0xfa6782[_0x3901('0x3f')]=qs['filters'](_[_0x3901('0xd6')](_0x31b51f[_0x3901('0x41')],_0x5d4d6e['filters']));if(_0x31b51f['query'][_0x3901('0x3c')]){_0xfa6782[_0x3901('0x3f')]=_['merge'](_0xfa6782[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0xfa6782['attributes'],function(_0x6841ff){var _0x523986={};_0x523986[_0x6841ff]={'$like':'%'+_0x31b51f[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x523986;})});}_0xfa6782=_[_0x3901('0x5b')]({},_0xfa6782,_0x31b51f[_0x3901('0x5c')]);return _0x499b99[_0x3901('0x146')](_0xfa6782);}})[_0x3901('0x14')](function(_0x54905c){if(_0x54905c){_0x52ad14=_0x54905c[_0x3901('0x4b')];if(!_0x31b51f[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0xfa6782[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x31b51f[_0x3901('0x41')][_0x3901('0x23')]);_0xfa6782[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x31b51f[_0x3901('0x41')][_0x3901('0x22')]);}return _0x499b99['getMailAccounts'](_0xfa6782);}})[_0x3901('0x14')](function(_0x373fc1){if(_0x373fc1){return _0x373fc1?{'count':_0x52ad14,'rows':_0x373fc1}:null;}})['then'](respondWithResult(_0x46a862,null))[_0x3901('0x51')](handleError(_0x46a862,null));};exports[_0x3901('0x147')]=function(_0x49e5ad,_0x3f5edf){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x49e5ad[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x3f5edf,null))[_0x3901('0x14')](function(_0x577316){if(_0x577316){return _0x577316[_0x3901('0x147')](_0x49e5ad['body'][_0x3901('0x62')],_[_0x3901('0x112')](_0x49e5ad[_0x3901('0x5f')],[_0x3901('0x62'),'id'])||{});}})[_0x3901('0x14')](respondWithResult(_0x3f5edf,null))[_0x3901('0x51')](handleError(_0x3f5edf,null));};exports[_0x3901('0x148')]=function(_0x58bb7f,_0x5c19a8){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x58bb7f[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x5c19a8,null))['then'](function(_0x24d43f){if(_0x24d43f){return _0x24d43f[_0x3901('0x148')](_0x58bb7f[_0x3901('0x41')][_0x3901('0x62')]);}})[_0x3901('0x14')](respondWithStatusCode(_0x5c19a8,null))[_0x3901('0x51')](handleError(_0x5c19a8,null));};exports['getOpenchannelAccounts']=function(_0x31333b,_0x20d5ed){var _0x278b49={};var _0x636942={};var _0x5ce107;var _0x23bd15;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x31333b['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x20d5ed,null))[_0x3901('0x14')](function(_0x164031){if(_0x164031){_0x5ce107=_0x164031;_0x636942[_0x3901('0x54')]=_['keys'](db[_0x3901('0x149')][_0x3901('0x57')]);_0x636942[_0x3901('0x41')]=_['keys'](_0x31333b[_0x3901('0x41')]);_0x636942[_0x3901('0x58')]=_[_0x3901('0xca')](_0x636942['model'],_0x636942[_0x3901('0x41')]);_0x278b49[_0x3901('0x46')]=_[_0x3901('0xca')](_0x636942[_0x3901('0x54')],qs[_0x3901('0x59')](_0x31333b[_0x3901('0x41')]['fields']));_0x278b49[_0x3901('0x46')]=_0x278b49[_0x3901('0x46')][_0x3901('0x4b')]?_0x278b49[_0x3901('0x46')]:_0x636942[_0x3901('0x54')];_0x278b49[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x31333b['query'][_0x3901('0xd5')]);_0x278b49[_0x3901('0x3f')]=qs['filters'](_['pick'](_0x31333b[_0x3901('0x41')],_0x636942[_0x3901('0x58')]));if(_0x31333b[_0x3901('0x41')][_0x3901('0x3c')]){_0x278b49[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x278b49[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x278b49['attributes'],function(_0x4e2860){var _0x10f215={};_0x10f215[_0x4e2860]={'$like':'%'+_0x31333b[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x10f215;})});}_0x278b49=_[_0x3901('0x5b')]({},_0x278b49,_0x31333b[_0x3901('0x5c')]);return _0x5ce107[_0x3901('0x14a')](_0x278b49);}})[_0x3901('0x14')](function(_0x4a97de){if(_0x4a97de){_0x23bd15=_0x4a97de[_0x3901('0x4b')];if(!_0x31333b['query'][_0x3901('0xcc')](_0x3901('0xd3'))){_0x278b49['limit']=qs[_0x3901('0x23')](_0x31333b[_0x3901('0x41')][_0x3901('0x23')]);_0x278b49[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x31333b[_0x3901('0x41')][_0x3901('0x22')]);}return _0x5ce107[_0x3901('0x14a')](_0x278b49);}})[_0x3901('0x14')](function(_0x448f57){if(_0x448f57){return _0x448f57?{'count':_0x23bd15,'rows':_0x448f57}:null;}})[_0x3901('0x14')](respondWithResult(_0x20d5ed,null))[_0x3901('0x51')](handleError(_0x20d5ed,null));};exports['addOpenchannelAccounts']=function(_0x3b1abe,_0x430ce0){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x3b1abe['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x430ce0,null))[_0x3901('0x14')](function(_0x1b77f0){if(_0x1b77f0){return _0x1b77f0[_0x3901('0x14b')](_0x3b1abe[_0x3901('0x5f')][_0x3901('0x62')],_[_0x3901('0x112')](_0x3b1abe[_0x3901('0x5f')],[_0x3901('0x62'),'id'])||{});}})[_0x3901('0x14')](respondWithResult(_0x430ce0,null))[_0x3901('0x51')](handleError(_0x430ce0,null));};exports['removeOpenchannelAccounts']=function(_0x4c02d0,_0x12fb80){return db[_0x3901('0x38')]['find']({'where':{'id':_0x4c02d0[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x12fb80,null))[_0x3901('0x14')](function(_0x3604c7){if(_0x3604c7){return _0x3604c7[_0x3901('0x14c')](_0x4c02d0[_0x3901('0x41')][_0x3901('0x62')]);}})[_0x3901('0x14')](respondWithStatusCode(_0x12fb80,null))['catch'](handleError(_0x12fb80,null));};exports[_0x3901('0x14d')]=function(_0x5c4ec2,_0x251e64){var _0x404e79={};var _0xfedeb3={};var _0x168d0f;var _0x22e16c;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x5c4ec2[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x251e64,null))[_0x3901('0x14')](function(_0x203338){if(_0x203338){_0x168d0f=_0x203338;_0xfedeb3['model']=_[_0x3901('0x56')](db[_0x3901('0x14e')][_0x3901('0x57')]);_0xfedeb3['query']=_[_0x3901('0x56')](_0x5c4ec2[_0x3901('0x41')]);_0xfedeb3['filters']=_[_0x3901('0xca')](_0xfedeb3[_0x3901('0x54')],_0xfedeb3[_0x3901('0x41')]);_0x404e79[_0x3901('0x46')]=_[_0x3901('0xca')](_0xfedeb3['model'],qs[_0x3901('0x59')](_0x5c4ec2[_0x3901('0x41')][_0x3901('0x59')]));_0x404e79['attributes']=_0x404e79[_0x3901('0x46')][_0x3901('0x4b')]?_0x404e79[_0x3901('0x46')]:_0xfedeb3[_0x3901('0x54')];_0x404e79['order']=qs[_0x3901('0xd5')](_0x5c4ec2['query'][_0x3901('0xd5')]);_0x404e79['where']=qs[_0x3901('0x58')](_['pick'](_0x5c4ec2[_0x3901('0x41')],_0xfedeb3[_0x3901('0x58')]));if(_0x5c4ec2[_0x3901('0x41')]['filter']){_0x404e79[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x404e79[_0x3901('0x3f')],{'$or':_['map'](_0x404e79[_0x3901('0x46')],function(_0x74391a){var _0x2dba81={};_0x2dba81[_0x74391a]={'$like':'%'+_0x5c4ec2[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0x2dba81;})});}_0x404e79=_[_0x3901('0x5b')]({},_0x404e79,_0x5c4ec2[_0x3901('0x5c')]);return _0x168d0f[_0x3901('0x14d')](_0x404e79);}})[_0x3901('0x14')](function(_0x4ccc1f){if(_0x4ccc1f){_0x22e16c=_0x4ccc1f[_0x3901('0x4b')];if(!_0x5c4ec2['query']['hasOwnProperty'](_0x3901('0xd3'))){_0x404e79[_0x3901('0x23')]=qs['limit'](_0x5c4ec2[_0x3901('0x41')]['limit']);_0x404e79[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x5c4ec2[_0x3901('0x41')][_0x3901('0x22')]);}return _0x168d0f[_0x3901('0x14d')](_0x404e79);}})['then'](function(_0x1a94c6){if(_0x1a94c6){return _0x1a94c6?{'count':_0x22e16c,'rows':_0x1a94c6}:null;}})[_0x3901('0x14')](respondWithResult(_0x251e64,null))['catch'](handleError(_0x251e64,null));};exports[_0x3901('0x14f')]=function(_0xdabadc,_0x5c5edc){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0xdabadc['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x5c5edc,null))[_0x3901('0x14')](function(_0x25232b){if(_0x25232b){return _0x25232b['addSmsAccounts'](_0xdabadc['body']['ids'],_[_0x3901('0x112')](_0xdabadc[_0x3901('0x5f')],[_0x3901('0x62'),'id'])||{});}})[_0x3901('0x14')](respondWithResult(_0x5c5edc,null))['catch'](handleError(_0x5c5edc,null));};exports[_0x3901('0x150')]=function(_0x44c922,_0x585cc3){return db['User'][_0x3901('0x33')]({'where':{'id':_0x44c922[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x585cc3,null))[_0x3901('0x14')](function(_0x2a29fa){if(_0x2a29fa){return _0x2a29fa[_0x3901('0x150')](_0x44c922['query'][_0x3901('0x62')]);}})['then'](respondWithStatusCode(_0x585cc3,null))[_0x3901('0x51')](handleError(_0x585cc3,null));};exports[_0x3901('0x151')]=function(_0x4e3c01,_0x50c21b){var _0x55d2e1={};var _0x26be6c={};var _0x5b5b11;var _0x4efd11;return db[_0x3901('0x38')]['findOne']({'where':{'id':_0x4e3c01[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x50c21b,null))['then'](function(_0x53625a){if(_0x53625a){_0x5b5b11=_0x53625a;_0x26be6c[_0x3901('0x54')]=_[_0x3901('0x56')](db[_0x3901('0x152')]['rawAttributes']);_0x26be6c[_0x3901('0x41')]=_['keys'](_0x4e3c01[_0x3901('0x41')]);_0x26be6c[_0x3901('0x58')]=_[_0x3901('0xca')](_0x26be6c[_0x3901('0x54')],_0x26be6c[_0x3901('0x41')]);_0x55d2e1[_0x3901('0x46')]=_[_0x3901('0xca')](_0x26be6c[_0x3901('0x54')],qs[_0x3901('0x59')](_0x4e3c01['query'][_0x3901('0x59')]));_0x55d2e1[_0x3901('0x46')]=_0x55d2e1[_0x3901('0x46')]['length']?_0x55d2e1[_0x3901('0x46')]:_0x26be6c[_0x3901('0x54')];_0x55d2e1['order']=qs['sort'](_0x4e3c01[_0x3901('0x41')]['sort']);_0x55d2e1[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x4e3c01['query'],_0x26be6c[_0x3901('0x58')]));if(_0x4e3c01[_0x3901('0x41')][_0x3901('0x3c')]){_0x55d2e1[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x55d2e1[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x55d2e1[_0x3901('0x46')],function(_0x3507cd){var _0xb5b930={};_0xb5b930[_0x3507cd]={'$like':'%'+_0x4e3c01['query'][_0x3901('0x3c')]+'%'};return _0xb5b930;})});}_0x55d2e1=_['merge']({},_0x55d2e1,_0x4e3c01['options']);return _0x5b5b11[_0x3901('0x151')](_0x55d2e1);}})[_0x3901('0x14')](function(_0x2847a0){if(_0x2847a0){_0x4efd11=_0x2847a0['length'];if(!_0x4e3c01['query'][_0x3901('0xcc')]('nolimit')){_0x55d2e1[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x4e3c01[_0x3901('0x41')]['limit']);_0x55d2e1[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x4e3c01[_0x3901('0x41')][_0x3901('0x22')]);}return _0x5b5b11[_0x3901('0x151')](_0x55d2e1);}})[_0x3901('0x14')](function(_0x2d00fc){if(_0x2d00fc){return _0x2d00fc?{'count':_0x4efd11,'rows':_0x2d00fc}:null;}})[_0x3901('0x14')](respondWithResult(_0x50c21b,null))['catch'](handleError(_0x50c21b,null));};exports['addChatWebsites']=function(_0x57e1d1,_0xdda305){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x57e1d1['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0xdda305,null))[_0x3901('0x14')](function(_0x15affb){if(_0x15affb){return _0x15affb[_0x3901('0x153')](_0x57e1d1[_0x3901('0x5f')][_0x3901('0x62')],_['omit'](_0x57e1d1['body'],[_0x3901('0x62'),'id'])||{});}})[_0x3901('0x14')](respondWithResult(_0xdda305,null))[_0x3901('0x51')](handleError(_0xdda305,null));};exports['removeChatWebsites']=function(_0x5eba83,_0x434e18){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x5eba83[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x434e18,null))['then'](function(_0x4ddf72){if(_0x4ddf72){return _0x4ddf72[_0x3901('0x154')](_0x5eba83['query'][_0x3901('0x62')]);}})[_0x3901('0x14')](respondWithStatusCode(_0x434e18,null))[_0x3901('0x51')](handleError(_0x434e18,null));};exports[_0x3901('0x155')]=function(_0x5371a8,_0x21273f){var _0x1925a5={};var _0x3957b5={};var _0x51d9a4;var _0x565238;return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x5371a8[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x21273f,null))[_0x3901('0x14')](function(_0x349b75){if(_0x349b75){_0x51d9a4=_0x349b75;_0x3957b5[_0x3901('0x54')]=_['keys'](db[_0x3901('0x156')]['rawAttributes']);_0x3957b5[_0x3901('0x41')]=_[_0x3901('0x56')](_0x5371a8[_0x3901('0x41')]);_0x3957b5[_0x3901('0x58')]=_[_0x3901('0xca')](_0x3957b5[_0x3901('0x54')],_0x3957b5[_0x3901('0x41')]);_0x1925a5[_0x3901('0x46')]=_[_0x3901('0xca')](_0x3957b5[_0x3901('0x54')],qs[_0x3901('0x59')](_0x5371a8[_0x3901('0x41')][_0x3901('0x59')]));_0x1925a5['attributes']=_0x1925a5[_0x3901('0x46')][_0x3901('0x4b')]?_0x1925a5[_0x3901('0x46')]:_0x3957b5[_0x3901('0x54')];_0x1925a5['order']=qs[_0x3901('0xd5')](_0x5371a8['query']['sort']);_0x1925a5[_0x3901('0x3f')]=qs['filters'](_[_0x3901('0xd6')](_0x5371a8[_0x3901('0x41')],_0x3957b5[_0x3901('0x58')]));if(_0x5371a8['query'][_0x3901('0x3c')]){_0x1925a5['where']=_['merge'](_0x1925a5[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x1925a5[_0x3901('0x46')],function(_0x15f8b4){var _0xf7a1ad={};_0xf7a1ad[_0x15f8b4]={'$like':'%'+_0x5371a8[_0x3901('0x41')][_0x3901('0x3c')]+'%'};return _0xf7a1ad;})});}_0x1925a5=_[_0x3901('0x5b')]({},_0x1925a5,_0x5371a8['options']);return _0x51d9a4[_0x3901('0x155')](_0x1925a5);}})[_0x3901('0x14')](function(_0x221a22){if(_0x221a22){_0x565238=_0x221a22[_0x3901('0x4b')];if(!_0x5371a8[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0x1925a5[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x5371a8[_0x3901('0x41')][_0x3901('0x23')]);_0x1925a5[_0x3901('0x22')]=qs[_0x3901('0x22')](_0x5371a8[_0x3901('0x41')][_0x3901('0x22')]);}return _0x51d9a4['getWhatsappAccounts'](_0x1925a5);}})[_0x3901('0x14')](function(_0x2bba1a){if(_0x2bba1a){return _0x2bba1a?{'count':_0x565238,'rows':_0x2bba1a}:null;}})[_0x3901('0x14')](respondWithResult(_0x21273f,null))[_0x3901('0x51')](handleError(_0x21273f,null));};exports[_0x3901('0x157')]=function(_0x52e328,_0x70700e){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x52e328['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x70700e,null))[_0x3901('0x14')](function(_0x447f5a){if(_0x447f5a){return _0x447f5a[_0x3901('0x157')](_0x52e328[_0x3901('0x5f')][_0x3901('0x62')],_[_0x3901('0x112')](_0x52e328['body'],[_0x3901('0x62'),'id'])||{});}})[_0x3901('0x14')](respondWithResult(_0x70700e,null))[_0x3901('0x51')](handleError(_0x70700e,null));};exports[_0x3901('0x158')]=function(_0x165093,_0x4d8726){return db[_0x3901('0x38')]['find']({'where':{'id':_0x165093[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x4d8726,null))['then'](function(_0x10c11b){if(_0x10c11b){return _0x10c11b[_0x3901('0x158')](_0x165093[_0x3901('0x41')][_0x3901('0x62')]);}})[_0x3901('0x14')](respondWithStatusCode(_0x4d8726,null))[_0x3901('0x51')](handleError(_0x4d8726,null));};exports['getSquareProjects']=function(_0xaf3966,_0x45a18c){var _0x4521b6={};var _0x4f5d4f={};var _0x470e72;var _0x17809e;return db['User'][_0x3901('0x95')]({'where':{'id':_0xaf3966[_0x3901('0x53')]['id']}})['then'](handleEntityNotFound(_0x45a18c,null))[_0x3901('0x14')](function(_0x3452aa){if(_0x3452aa){_0x470e72=_0x3452aa;_0x4f5d4f[_0x3901('0x54')]=_[_0x3901('0x56')](db['SquareProject'][_0x3901('0x57')]);_0x4f5d4f[_0x3901('0x41')]=_['keys'](_0xaf3966[_0x3901('0x41')]);_0x4f5d4f[_0x3901('0x58')]=_['intersection'](_0x4f5d4f[_0x3901('0x54')],_0x4f5d4f[_0x3901('0x41')]);_0x4521b6[_0x3901('0x46')]=_[_0x3901('0xca')](_0x4f5d4f[_0x3901('0x54')],qs[_0x3901('0x59')](_0xaf3966[_0x3901('0x41')][_0x3901('0x59')]));_0x4521b6[_0x3901('0x46')]=_0x4521b6[_0x3901('0x46')]['length']?_0x4521b6[_0x3901('0x46')]:_0x4f5d4f['model'];_0x4521b6['order']=qs[_0x3901('0xd5')](_0xaf3966[_0x3901('0x41')][_0x3901('0xd5')]);_0x4521b6[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0xaf3966[_0x3901('0x41')],_0x4f5d4f[_0x3901('0x58')]));if(_0xaf3966[_0x3901('0x41')]['filter']){_0x4521b6[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x4521b6[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x4521b6['attributes'],function(_0x4d57ac){var _0x5c50a3={};_0x5c50a3[_0x4d57ac]={'$like':'%'+_0xaf3966[_0x3901('0x41')]['filter']+'%'};return _0x5c50a3;})});}_0x4521b6=_[_0x3901('0x5b')]({},_0x4521b6,_0xaf3966[_0x3901('0x5c')]);return _0x470e72[_0x3901('0x159')](_0x4521b6);}})[_0x3901('0x14')](function(_0xe7361a){if(_0xe7361a){_0x17809e=_0xe7361a[_0x3901('0x4b')];if(!_0xaf3966['query']['hasOwnProperty'](_0x3901('0xd3'))){_0x4521b6[_0x3901('0x23')]=qs['limit'](_0xaf3966[_0x3901('0x41')]['limit']);_0x4521b6[_0x3901('0x22')]=qs['offset'](_0xaf3966[_0x3901('0x41')][_0x3901('0x22')]);}return _0x470e72[_0x3901('0x159')](_0x4521b6);}})[_0x3901('0x14')](function(_0x50df79){if(_0x50df79){return _0x50df79?{'count':_0x17809e,'rows':_0x50df79}:null;}})[_0x3901('0x14')](respondWithResult(_0x45a18c,null))[_0x3901('0x51')](handleError(_0x45a18c,null));};exports[_0x3901('0x15a')]=function(_0x5138c0,_0x21814e){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x5138c0[_0x3901('0x53')]['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x21814e,null))['then'](function(_0x3656de){if(_0x3656de){return _0x3656de[_0x3901('0x15a')](_0x5138c0['body'][_0x3901('0x62')],_['omit'](_0x5138c0[_0x3901('0x5f')],[_0x3901('0x62'),'id'])||{});}})[_0x3901('0x14')](respondWithResult(_0x21814e,null))[_0x3901('0x51')](handleError(_0x21814e,null));};exports[_0x3901('0x15b')]=function(_0xb2d6af,_0x573899){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0xb2d6af['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x573899,null))[_0x3901('0x14')](function(_0x575cf7){if(_0x575cf7){return _0x575cf7[_0x3901('0x15b')](_0xb2d6af[_0x3901('0x41')][_0x3901('0x62')]);}})[_0x3901('0x14')](respondWithStatusCode(_0x573899,null))['catch'](handleError(_0x573899,null));};exports[_0x3901('0x15c')]=function(_0x55d5c1,_0x101aff){var _0x601f2a={},_0x2edd3c={},_0x5c1aed={'count':0x0,'rows':[]};var _0x283fde=db[_0x3901('0x15d')][_0x3901('0x57')];_0x2edd3c[_0x3901('0x54')]=_['keys'](_0x283fde);_0x2edd3c[_0x3901('0x41')]=_[_0x3901('0x56')](_0x55d5c1[_0x3901('0x41')]);_0x2edd3c[_0x3901('0x58')]=_[_0x3901('0xca')](_0x2edd3c[_0x3901('0x54')],_0x2edd3c[_0x3901('0x41')]);_0x2edd3c[_0x3901('0x58')]=_[_0x3901('0xc7')](_0x2edd3c[_0x3901('0x58')],[_0x3901('0x15e'),'$or',_0x3901('0x15f'),_0x3901('0x160'),'$lt',_0x3901('0x161'),_0x3901('0x162'),'$eq','$not',_0x3901('0x163'),_0x3901('0x164'),_0x3901('0x165'),'$notIn',_0x3901('0x166'),_0x3901('0x167'),_0x3901('0x168'),_0x3901('0x169'),_0x3901('0x166'),_0x3901('0x16a'),_0x3901('0x16b'),_0x3901('0x16c'),_0x3901('0x16d')]);_0x601f2a['attributes']=_[_0x3901('0xca')](_0x2edd3c[_0x3901('0x54')],qs[_0x3901('0x59')](_0x55d5c1[_0x3901('0x41')]['fields']));_0x601f2a[_0x3901('0x46')]=_0x601f2a[_0x3901('0x46')]['length']?_0x601f2a[_0x3901('0x46')]:_0x2edd3c[_0x3901('0x54')];if(!_0x55d5c1['query'][_0x3901('0xcc')](_0x3901('0xd3'))){_0x601f2a[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x55d5c1['query']['limit']);_0x601f2a['offset']=qs[_0x3901('0x22')](_0x55d5c1[_0x3901('0x41')][_0x3901('0x22')]);}_0x601f2a[_0x3901('0xcb')]=qs[_0x3901('0xd5')](_0x55d5c1[_0x3901('0x41')]['sort']);_0x601f2a[_0x3901('0x3f')]=qs[_0x3901('0x58')](_[_0x3901('0xd6')](_0x55d5c1[_0x3901('0x41')],_0x2edd3c['filters']));if(_0x55d5c1[_0x3901('0x41')][_0x3901('0x3c')]){_0x601f2a[_0x3901('0x3f')]=_[_0x3901('0x5b')](_0x601f2a[_0x3901('0x3f')],{'$or':_[_0x3901('0x30')](_0x601f2a[_0x3901('0x46')],function(_0x2696d9){var _0x13ccf3={};_0x13ccf3[_0x2696d9]={'$like':'%'+_0x55d5c1[_0x3901('0x41')]['filter']+'%'};return _0x13ccf3;})});}_0x601f2a[_0x3901('0x3f')]={'$and':[_0x601f2a[_0x3901('0x3f')],{'$or':[{'UserId':_0x55d5c1[_0x3901('0x53')]['id']},{'OwnerId':_0x55d5c1['params']['id']}]}]};_0x601f2a=_[_0x3901('0x5b')]({},_0x601f2a,_0x55d5c1[_0x3901('0x5c')]);var _0x3de893={'where':_0x601f2a[_0x3901('0x3f')]};return db[_0x3901('0x15d')][_0x3901('0x40')](_0x3de893)[_0x3901('0x14')](function(_0xaedb16){_0x5c1aed[_0x3901('0x40')]=_0xaedb16;if(_0x55d5c1[_0x3901('0x41')]['includeAll']){_0x601f2a['include']=[{'attributes':['id',_0x3901('0x16e'),_0x3901('0x16f'),'phone'],'model':db[_0x3901('0xc9')],'as':_0x3901('0x170')},{'attributes':['id',_0x3901('0x34'),_0x3901('0x171')],'model':db['VoiceQueue'],'as':_0x3901('0xd4')}];}return db[_0x3901('0x15d')][_0x3901('0x48')](_0x601f2a);})[_0x3901('0x14')](function(_0x15eb58){_0x5c1aed[_0x3901('0x49')]=_0x15eb58;return _0x5c1aed;})['then'](respondWithFilteredResult(_0x101aff,_0x601f2a))[_0x3901('0x51')](handleError(_0x101aff,null));};exports[_0x3901('0x172')]=function(_0x4e728a,_0x45e284){if(!_[_0x3901('0x68')](_0x4e728a['user']['id'])&&(_0x4e728a[_0x3901('0x2b')][_0x3901('0x28')]==_0x3901('0x29')||_0x4e728a[_0x3901('0x2b')][_0x3901('0x28')]==_0x3901('0x2b'))){return db[_0x3901('0x38')][_0x3901('0x95')]({'where':{'id':_0x4e728a[_0x3901('0x53')]['id']},'raw':!![]})[_0x3901('0x14')](function(_0x246fdd){return authService[_0x3901('0x173')](_0x246fdd);})[_0x3901('0x14')](function(_0x1887a3){if(_0x1887a3){return _0x45e284[_0x3901('0x20')](0xc8)['json']({'api_key':_0x1887a3[_0x3901('0x174')]});}else{return _0x45e284[_0x3901('0x20')](0xcc)[_0x3901('0x26')]({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0x3901('0x51')](handleError(_0x45e284,0x193));}else{return _0x45e284[_0x3901('0x20')](0x191)[_0x3901('0x26')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x3901('0x175')]=function(_0x37e040,_0x522fee){if(!_[_0x3901('0x68')](_0x37e040[_0x3901('0x2b')]['id'])&&(_0x37e040[_0x3901('0x2b')][_0x3901('0x28')]=='admin'||_0x37e040[_0x3901('0x2b')][_0x3901('0x28')]==_0x3901('0x2b'))){return db[_0x3901('0x38')][_0x3901('0x33')]({'where':{'id':_0x37e040['params']['id']}})[_0x3901('0x14')](function(_0x207f74){return authService['generateApiKey'](_0x207f74);})[_0x3901('0x14')](function(_0x477447){return db[_0x3901('0x38')][_0x3901('0x27')]({'apiKeyIat':_0x477447['iat'],'apiKeyNonce':_0x477447[_0x3901('0x176')]},{'where':{'id':_0x37e040[_0x3901('0x53')]['id']}})[_0x3901('0x14')](function(){return _0x522fee[_0x3901('0x20')](0xc8)[_0x3901('0x26')]({'api_key':_0x477447[_0x3901('0x174')]});});})[_0x3901('0x51')](handleError(_0x522fee,0x193));}else{return _0x522fee['status'](0x191)['json']({'message':_0x3901('0x177')});}};exports[_0x3901('0x178')]=function(_0x5cc862,_0x1d8eab){if(!_[_0x3901('0x68')](_0x5cc862['user']['id'])&&(_0x5cc862['user'][_0x3901('0x28')]==_0x3901('0x29')||_0x5cc862['user']['role']==_0x3901('0x2b'))){return db[_0x3901('0x38')]['find']({'where':{'id':_0x5cc862['params']['id']}})[_0x3901('0x14')](handleEntityNotFound(_0x1d8eab,null))[_0x3901('0x14')](function(_0xe00630){if(_0xe00630&&_0xe00630[_0x3901('0x179')]&&_0xe00630[_0x3901('0x17a')])return _0xe00630;else throw{'message':_0x3901('0x17b')};})['then'](function(){return db[_0x3901('0x38')][_0x3901('0x27')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x5cc862[_0x3901('0x53')]['id']}});})[_0x3901('0x14')](respondWithStatusCode(_0x1d8eab,0xc8))[_0x3901('0x51')](handleError(_0x1d8eab,0x193));}else{return _0x1d8eab[_0x3901('0x20')](0x191)[_0x3901('0x26')]({'message':_0x3901('0x177')});}};exports[_0x3901('0x17c')]=function(_0x37b142,_0x483724){var _0x4a3a91=_0x37b142['user'][_0x3901('0xa8')]({'plain':!![]});if(!_0x4a3a91){return _0x483724['status'](0x191)[_0x3901('0x17d')](_0x3901('0x17e'));}else{Promise[_0x3901('0xfe')]()[_0x3901('0x14')](function(){if(_0x37b142[_0x3901('0x41')][_0x3901('0x43')]!==_0x3901('0x44'))return;return _0x37b142[_0x3901('0x2b')]['getUserSetting']();})[_0x3901('0x14')](function(_0x520fea){if(!_0x520fea)return;return _0x520fea[_0x3901('0xa8')]({'plain':!![]});})[_0x3901('0x14')](function(_0x549a1a){_0x4a3a91[_0x3901('0x43')]=_0x549a1a;return _0x483724[_0x3901('0x20')](0xc8)['json'](_0x4a3a91);});}};exports[_0x3901('0x17f')]=function(_0x55edf7,_0x383f43){var _0x5293c4={'offset':0x0},_0x44965d={'count':0x0,'rows':[]};Promise[_0x3901('0xfe')]()[_0x3901('0x14')](function(){if(!_0x55edf7[_0x3901('0x41')][_0x3901('0x3c')]&&!_0x55edf7['query'][_0x3901('0x180')]&&!_0x55edf7[_0x3901('0x41')]['queues'])return[];return Promise[_0x3901('0xfe')]()[_0x3901('0x14')](function(){var _0x16b58a=[];if(!_['isEmpty'](_0x55edf7[_0x3901('0x41')][_0x3901('0x180')])){_0x16b58a[_0x3901('0x47')](db[_0x3901('0x110')][_0x3901('0x48')]({'attributes':['id',_0x3901('0x34')],'where':{'id':_0x55edf7[_0x3901('0x41')][_0x3901('0x180')]}}));}if(!_[_0x3901('0x181')](_0x55edf7[_0x3901('0x41')]['queues'])){_0x16b58a[_0x3901('0x47')](db[_0x3901('0xa7')][_0x3901('0x48')]({'attributes':['id',_0x3901('0x34')],'type':'inbound','where':{'id':_0x55edf7[_0x3901('0x41')][_0x3901('0x182')]}}));}return Promise['all'](_0x16b58a);})[_0x3901('0x14')](function(_0x49511e){var _0x710160=_[_0x3901('0x11e')](_0x49511e)[_0x3901('0x30')](function(_0x2d5b3f){return _0x2d5b3f['getAgents']({'attributes':['id',_0x3901('0x34'),'internal','online'],'raw':!![]});});return Promise['all'](_0x710160);})[_0x3901('0x14')](function(_0x5b11f6){var _0x4c425a=_[_0x3901('0x11e')](_0x5b11f6);if(!_0x55edf7[_0x3901('0x41')][_0x3901('0x3c')])return _0x4c425a;if(_[_0x3901('0x181')](_0x4c425a)){return db[_0x3901('0x38')][_0x3901('0x48')]({'attributes':['id',_0x3901('0x34'),_0x3901('0x63'),_0x3901('0x9c')],'where':{'role':_0x3901('0x2d'),'$or':[db['sequelize'][_0x3901('0x3f')](db['sequelize']['fn'](_0x3901('0x183'),db[_0x3901('0x6b')]['col'](_0x3901('0x34'))),{'$like':'%'+_0x55edf7[_0x3901('0x41')]['filter'][_0x3901('0xa0')]()+'%'}),{'internal':{'$like':'%'+_0x55edf7[_0x3901('0x41')][_0x3901('0x3c')]+'%'}}]},'raw':!![]});}else{return _(_0x4c425a)[_0x3901('0x11e')]()[_0x3901('0x3c')](function(_0x50f7ae){return _0x50f7ae[_0x3901('0x34')][_0x3901('0xa0')]()[_0x3901('0x32')](_0x55edf7[_0x3901('0x41')][_0x3901('0x3c')]['toLowerCase']())||_0x50f7ae['internal'][_0x3901('0x184')]()[_0x3901('0x32')](_0x55edf7[_0x3901('0x41')][_0x3901('0x3c')]);})[_0x3901('0x31')]();}})[_0x3901('0x14')](function(_0x4b8e41){var _0x1ab8f9=_0x3901('0x34');var _0x17f789=_0x3901('0x185');if(_0x55edf7[_0x3901('0x41')][_0x3901('0xd5')]){_0x17f789=_0x55edf7[_0x3901('0x41')][_0x3901('0xd5')][0x0]==='-'?_0x3901('0x186'):_0x3901('0x185');_0x1ab8f9=_0x17f789==='asc'?_0x55edf7[_0x3901('0x41')]['sort']:_0x55edf7['query'][_0x3901('0xd5')][_0x3901('0x187')](0x1);}return _(_0x4b8e41)['uniqBy']('id')[_0x3901('0x188')]([function(_0x58f7a3){return _0x1ab8f9===_0x3901('0x34')?_0x58f7a3[_0x1ab8f9]['toLowerCase']():_0x58f7a3[_0x1ab8f9];}],[_0x17f789])[_0x3901('0x30')](function(_0x3f2446){return _[_0x3901('0xd6')](_0x3f2446,['id',_0x3901('0x34'),'internal','online']);})[_0x3901('0x31')]();})[_0x3901('0x14')](function(_0x8958cf){return client[_0x3901('0x13')]('Agents',_0x55edf7)[_0x3901('0x14')](function(_0x5a3928){if(_0x5a3928[_0x3901('0x1a')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x486ca7=_0x5a3928[_0x3901('0x1e')];var _0x12a2e3=jayson['client'][_0x3901('0x12')]({'port':0x232c});return _0x12a2e3[_0x3901('0x13')](_0x3901('0x2c'),_0x55edf7)[_0x3901('0x14')](function(_0x5116f0){if(_0x5116f0[_0x3901('0x1a')])throw new Error(_0x3901('0x189'));var _0x144a79=_0x5116f0[_0x3901('0x1e')];return _[_0x3901('0x5b')]({},_0x144a79,_0x486ca7);});})[_0x3901('0x14')](function(_0x56fb88){return _[_0x3901('0x30')](_0x8958cf,function(_0x501c5a){var _0x3b14a7=_[_0x3901('0x33')](_0x56fb88[_0x3901('0x49')],['id',_0x501c5a['id']]);if(!_0x3b14a7||!_0x501c5a[_0x3901('0x9c')]){_0x501c5a[_0x3901('0x20')]=_0x3901('0x18a');}else if(_0x3b14a7[_0x3901('0xac')]){_0x501c5a[_0x3901('0x20')]='pause';}else{_0x501c5a[_0x3901('0x20')]=_[_0x3901('0x32')]([_0x3901('0x18b'),'unknown','unavailable','ringing',null,undefined],_0x3b14a7[_0x3901('0x18c')])?_0x3901('0x9c'):'busy';}return _0x501c5a;});});});})[_0x3901('0x14')](function(_0x12c798){if(!_0x55edf7[_0x3901('0x41')][_0x3901('0xcc')](_0x3901('0xd3'))){_0x5293c4[_0x3901('0x23')]=qs[_0x3901('0x23')](_0x55edf7[_0x3901('0x41')][_0x3901('0x23')]||0xa);_0x5293c4[_0x3901('0x22')]=qs['offset'](_0x55edf7[_0x3901('0x41')][_0x3901('0x22')]);}_0x44965d[_0x3901('0x40')]=_0x12c798['length'];_0x44965d[_0x3901('0x49')]=_0x5293c4[_0x3901('0x23')]?_0x12c798[_0x3901('0x18d')](_0x5293c4[_0x3901('0x22')],_0x5293c4[_0x3901('0x22')]+_0x5293c4[_0x3901('0x23')]):_0x12c798;return _0x44965d;})[_0x3901('0x14')](respondWithFilteredResult(_0x383f43,_0x5293c4))[_0x3901('0x51')](handleError(_0x383f43,null));};function get_open_tabs(_0x480833,_0x8bddd7){var _0x842b00=_0x480833[_0x3901('0x18e')](0x0)['toUpperCase']()+_0x480833[_0x3901('0x18d')](0x1);var _0x2ee728={'type':db[_0x3901('0x8e')][_0x3901('0x18f')]['SELECT'],'raw':!![]};return new BPromise(function(_0x5f2a12,_0x542066){var _0x24ccf6=squel[_0x3901('0x190')]()[_0x3901('0x191')]('ui.'+_0x842b00+_0x3901('0x192'),'id')[_0x3901('0x191')](_0x3901('0x193'))[_0x3901('0x6d')](_0x3901('0x194')+_0x480833+'_interactions','ui')['where']('ui.UserId\x20=\x20?',_0x8bddd7['id']);return db[_0x3901('0x6b')]['query'](_0x24ccf6[_0x3901('0x184')](),_0x2ee728)[_0x3901('0x14')](function(_0x5d92ae){_0x8bddd7[_0x842b00+'OpenTabs']=_0x5d92ae;_0x5f2a12(_0x5d92ae);})[_0x3901('0x51')](function(_0x5e49f2){_0x542066(_0x5e49f2);});});}
\ No newline at end of file
+var _0xd25d=['download','getOpenTabs','fax','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','sort','where','getContacts','hasOwnProperty','CmList','List','Tag','Tags','tag','getQueues','Queue','order','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','nolimit','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','UserVoiceQueue.penalty','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','isMiddleware','resolve','pause','QueuePause','type','DEFAULT\x20PAUSE','mailPause','smsPause','whatsapppause','pauseType','lastPauseAt','unpause','manual','%s%s','getTeams','addTeams','Team','setDataValue','Mail','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','getVoiceQueues','Voice','getChatQueues','Chat','getMailQueues','getSmsQueues','removeAgent','TeamVoicePrefix','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','spread','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$lt','$ne','$eq','$not','$notBetween','$notIn','$notLike','$like','$overlap','$contains','firstName','lastName','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','inbound','lower','col','toString','asc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','ringing','voiceStatus','charAt','toUpperCase','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','localhost','client','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','json','update','destroy','get','role','admin','Users','user','Agents','agent','Telephones','telephone','ignore','map','value','includes','find','name','UserProfileResource','end','send','index','User','rawAttributes','fieldName','filter','password','salt','getOptions','query','includeAll','include','userSetting','true','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','mail','openchannel','whatsapp','show','keys','filters','intersection','model','fields','UserSetting','merge','options','body','params','describe','ids','omit','Setting','findById','validatePasswordPattern','internal','isNil','min_internal','sequelize','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','113','110','104','107','108','109','100','111','114','115','create','Unauthorized','settingsEnabled','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','each','userProfileId','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','updatePasswordsHistory','voicePause','isValidChannel','add','toLowerCase','Queues','capitalize','QueueId','emit','Queue:save','VoiceQueue','voice','online','interface','format','penalty','UserVoiceQueueRt','upsert','removeQueues','channel','Unknown\x20channel','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd25d,0xd5));var _0xdd25=function(_0x5c730a,_0x4a2a9f){_0x5c730a=_0x5c730a-0x0;var _0x1d99a6=_0xd25d[_0x5c730a];return _0x1d99a6;};'use strict';var moment=require(_0xdd25('0x0'));var BPromise=require(_0xdd25('0x1'));var util=require(_0xdd25('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xdd25('0x3'));var jayson=require(_0xdd25('0x4'));var Redis=require('ioredis');var authService=require(_0xdd25('0x5'));var qs=require(_0xdd25('0x6'));var logger=require(_0xdd25('0x7'))(_0xdd25('0x8'));var utils=require(_0xdd25('0x9'));var config=require(_0xdd25('0xa'));var licenseUtil=require(_0xdd25('0xb'));var db=require(_0xdd25('0xc'))['db'];var socket=require(_0xdd25('0xd'))(new Redis(config['redis']));require(_0xdd25('0xe'))[_0xdd25('0xf')](socket);config[_0xdd25('0x10')]=_[_0xdd25('0x11')](config[_0xdd25('0x10')],{'host':_0xdd25('0x12'),'port':0x18eb});var client=jayson[_0xdd25('0x13')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x398e84,_0x39cd55,_0x4fc614,_0x1db144){return new BPromise(function(_0xea5c47,_0x190053){var _0x35acf7=_0x1db144||client;return _0x35acf7[_0xdd25('0x14')](_0x398e84,_0x4fc614)[_0xdd25('0x15')](function(_0xed3185){logger[_0xdd25('0x16')](_0xdd25('0x17'),_0x39cd55,_0xdd25('0x18'));logger[_0xdd25('0x19')](_0xdd25('0x1a'),_0x39cd55,'request\x20sent',JSON[_0xdd25('0x1b')](_0xed3185));if(_0xed3185['error']){if(_0xed3185[_0xdd25('0x1c')][_0xdd25('0x1d')]===0x1f4){logger[_0xdd25('0x1c')](_0xdd25('0x17'),_0x39cd55,_0xed3185[_0xdd25('0x1c')][_0xdd25('0x1e')]);return _0x190053(_0xed3185[_0xdd25('0x1c')][_0xdd25('0x1e')]);}logger[_0xdd25('0x1c')](_0xdd25('0x17'),_0x39cd55,_0xed3185[_0xdd25('0x1c')][_0xdd25('0x1e')]);return _0xea5c47(_0xed3185[_0xdd25('0x1c')][_0xdd25('0x1e')]);}else{logger['info'](_0xdd25('0x17'),_0x39cd55,_0xdd25('0x18'));_0xea5c47(_0xed3185[_0xdd25('0x1f')]['message']);}})[_0xdd25('0x20')](function(_0x2dfc5a){logger[_0xdd25('0x1c')](_0xdd25('0x17'),_0x39cd55,_0x2dfc5a);_0x190053(_0x2dfc5a);});});}function respondWithStatusCode(_0x3ee18f,_0x278dce){_0x278dce=_0x278dce||0xcc;return function(_0x42d6f2){if(_0x42d6f2){return _0x3ee18f[_0xdd25('0x21')](_0x278dce);}return _0x3ee18f[_0xdd25('0x22')](_0x278dce)['end']();};}function respondWithResult(_0x367b6a,_0x37aa09){_0x37aa09=_0x37aa09||0xc8;return function(_0x100690){if(_0x100690){return _0x367b6a[_0xdd25('0x22')](_0x37aa09)['json'](_0x100690);}};}function respondWithFilteredResult(_0x44fc71,_0xbea7a0){return function(_0x2e30c7){if(_0x2e30c7){var _0x159187=typeof _0xbea7a0[_0xdd25('0x23')]===_0xdd25('0x24')&&typeof _0xbea7a0['limit']===_0xdd25('0x24');var _0xeb6e7f=_0x2e30c7[_0xdd25('0x25')];var _0x5560a8=_0x159187?0x0:_0xbea7a0[_0xdd25('0x23')];var _0x1818c0=_0x159187?_0x2e30c7[_0xdd25('0x25')]:_0xbea7a0[_0xdd25('0x23')]+_0xbea7a0[_0xdd25('0x26')];var _0x37634b;if(_0x1818c0>=_0xeb6e7f){_0x1818c0=_0xeb6e7f;_0x37634b=0xc8;}else{_0x37634b=0xce;}_0x44fc71['status'](_0x37634b);return _0x44fc71['set'](_0xdd25('0x27'),_0x5560a8+'-'+_0x1818c0+'/'+_0xeb6e7f)[_0xdd25('0x28')](_0x2e30c7);}return null;};}function saveUpdates(_0x412a94){return function(_0x546b28){if(_0x546b28){return _0x546b28[_0xdd25('0x29')](_0x412a94)[_0xdd25('0x15')](function(_0x2f945c){return _0x2f945c;});}return null;};}function removeEntity(_0x52ed00){return function(_0x3b5cc1){if(_0x3b5cc1){return _0x3b5cc1[_0xdd25('0x2a')]()['then'](function(){var _0x3bd78b=_0x3b5cc1[_0xdd25('0x2b')]({'plain':!![]});if(_0x3bd78b[_0xdd25('0x2c')]===_0xdd25('0x2d'))return;var _0x182499=[{'name':_0xdd25('0x2e'),'value':_0xdd25('0x2f'),'ignore':!![]},{'name':_0xdd25('0x30'),'value':_0xdd25('0x31'),'ignore':![]},{'name':_0xdd25('0x32'),'value':_0xdd25('0x33'),'ignore':![]}];var _0x4c0c1b=_(_0x182499)['filter'](_0xdd25('0x34'))[_0xdd25('0x35')]('value')[_0xdd25('0x36')]();if(_[_0xdd25('0x37')](_0x4c0c1b,_0x3bd78b[_0xdd25('0x2c')])){return;}var _0x45ad59=_[_0xdd25('0x38')](_0x182499,['value',_0x3bd78b[_0xdd25('0x2c')]])[_0xdd25('0x39')];return db[_0xdd25('0x3a')][_0xdd25('0x2a')]({'where':{'type':_0x45ad59,'resourceId':_0x3bd78b['id']}})['then'](function(){return _0x3b5cc1;});})['then'](function(){_0x52ed00['status'](0xcc)[_0xdd25('0x3b')]();});}};}function handleEntityNotFound(_0xb7f777){return function(_0x5368af){if(!_0x5368af){_0xb7f777['sendStatus'](0x194);}return _0x5368af;};}function handleError(_0x1ff88d,_0x4f40fc){_0x4f40fc=_0x4f40fc||0x1f4;return function(_0x4a64d5){logger[_0xdd25('0x1c')](_0x4a64d5['stack']);if(_0x4a64d5[_0xdd25('0x39')]){delete _0x4a64d5[_0xdd25('0x39')];}_0x1ff88d['status'](_0x4f40fc)[_0xdd25('0x3c')](_0x4a64d5);};}exports[_0xdd25('0x3d')]=function(_0x36de93,_0x28c670){var _0xabb2db={},_0x756c6c={'count':0x0,'rows':[]};var _0xa87dd=_(db[_0xdd25('0x3e')][_0xdd25('0x3f')])['map'](function(_0x37042a){return{'name':_0x37042a[_0xdd25('0x40')],'type':_0x37042a['type']['key']};})[_0xdd25('0x41')](function(_0x12d616){return!_['includes']([_0xdd25('0x42'),_0xdd25('0x43')],_0x12d616[_0xdd25('0x39')]);})[_0xdd25('0x36')]();_0xabb2db=qs[_0xdd25('0x44')](_0xa87dd,_0x36de93);var _0x1a931c={'where':_0xabb2db['where']};return db['User']['count'](_0x1a931c)[_0xdd25('0x15')](function(_0x2a5261){_0x756c6c[_0xdd25('0x25')]=_0x2a5261;if(_0x36de93[_0xdd25('0x45')][_0xdd25('0x46')]){_0xabb2db[_0xdd25('0x47')]=[{'all':!![]}];}if(_0x36de93[_0xdd25('0x45')][_0xdd25('0x48')]===_0xdd25('0x49')){_0xabb2db[_0xdd25('0x47')]=[{'model':db['UserSetting'],'as':_0xdd25('0x48')}];}if(!_[_0xdd25('0x37')](_0xabb2db[_0xdd25('0x4a')],'id')){_0xabb2db[_0xdd25('0x4a')][_0xdd25('0x4b')]('id');}return db[_0xdd25('0x3e')][_0xdd25('0x4c')](_0xabb2db);})[_0xdd25('0x15')](function(_0x248b86){_0x756c6c[_0xdd25('0x4d')]=_0x248b86;if(_0x36de93[_0xdd25('0x45')][_0xdd25('0x4e')]===_0xdd25('0x49')){var _0x431070=[];for(var _0x26e17b=0x0;_0x26e17b<_0x756c6c[_0xdd25('0x4d')][_0xdd25('0x4f')];_0x26e17b++){_0x431070[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x50'),_0x756c6c[_0xdd25('0x4d')][_0x26e17b][_0xdd25('0x51')]));_0x431070[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x52'),_0x756c6c[_0xdd25('0x4d')][_0x26e17b][_0xdd25('0x51')]));_0x431070[_0xdd25('0x4b')](get_open_tabs('fax',_0x756c6c['rows'][_0x26e17b][_0xdd25('0x51')]));_0x431070[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x53'),_0x756c6c[_0xdd25('0x4d')][_0x26e17b][_0xdd25('0x51')]));_0x431070[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x54'),_0x756c6c['rows'][_0x26e17b][_0xdd25('0x51')]));_0x431070[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x55'),_0x756c6c[_0xdd25('0x4d')][_0x26e17b]['dataValues']));}return BPromise['all'](_0x431070)[_0xdd25('0x15')](function(){return _0x756c6c;});}else{return _0x756c6c;}})[_0xdd25('0x15')](respondWithFilteredResult(_0x28c670,_0xabb2db))[_0xdd25('0x20')](handleError(_0x28c670,null));};exports[_0xdd25('0x56')]=function(_0x18d3d5,_0x3b1a38){var _0x6f0abe={'raw':![],'where':{'id':_0x18d3d5['params']['id']}},_0x5a8a9d={};_0x5a8a9d['model']=_['differenceBy'](_[_0xdd25('0x57')](db[_0xdd25('0x3e')][_0xdd25('0x3f')]),[_0xdd25('0x42'),_0xdd25('0x43')]);_0x5a8a9d[_0xdd25('0x45')]=_['keys'](_0x18d3d5[_0xdd25('0x45')]);_0x5a8a9d[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x5a8a9d[_0xdd25('0x5a')],_0x5a8a9d['query']);_0x6f0abe[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x5a8a9d[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x18d3d5[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x6f0abe[_0xdd25('0x4a')]=_0x6f0abe['attributes'][_0xdd25('0x4f')]?_0x6f0abe[_0xdd25('0x4a')]:_0x5a8a9d[_0xdd25('0x5a')];if(_0x18d3d5[_0xdd25('0x45')][_0xdd25('0x46')]){_0x6f0abe[_0xdd25('0x47')]=[{'all':!![]}];}if(_0x18d3d5['query'][_0xdd25('0x48')]===_0xdd25('0x49')){_0x6f0abe['include']=[{'model':db[_0xdd25('0x5c')],'as':_0xdd25('0x48')}];}_0x6f0abe=_[_0xdd25('0x5d')]({},_0x6f0abe,_0x18d3d5[_0xdd25('0x5e')]);if(!_[_0xdd25('0x37')](_0x6f0abe[_0xdd25('0x4a')],'id')){_0x6f0abe[_0xdd25('0x4a')][_0xdd25('0x4b')]('id');}return db[_0xdd25('0x3e')]['find'](_0x6f0abe)[_0xdd25('0x15')](handleEntityNotFound(_0x3b1a38,null))['then'](function(_0x412ea4){var _0x54a55d=[];values=_0x412ea4;if(_0x18d3d5['query']['openTabs']==='true'){_0x54a55d[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x50'),_0x412ea4['dataValues']));_0x54a55d['push'](get_open_tabs(_0xdd25('0x52'),_0x412ea4[_0xdd25('0x51')]));_0x54a55d['push'](get_open_tabs('openchannel',_0x412ea4[_0xdd25('0x51')]));_0x54a55d[_0xdd25('0x4b')](get_open_tabs('whatsapp',_0x412ea4['dataValues']));_0x54a55d[_0xdd25('0x4b')](get_open_tabs('fax',_0x412ea4[_0xdd25('0x51')]));_0x54a55d[_0xdd25('0x4b')](get_open_tabs('mail',_0x412ea4[_0xdd25('0x51')]));return BPromise['all'](_0x54a55d);}else{return values;}})[_0xdd25('0x15')](function(){return values;})[_0xdd25('0x15')](respondWithResult(_0x3b1a38,null))[_0xdd25('0x20')](handleError(_0x3b1a38,null));};exports[_0xdd25('0x29')]=function(_0x56fbfc,_0x4c8d36){if(_0x56fbfc[_0xdd25('0x5f')]['id']){delete _0x56fbfc[_0xdd25('0x5f')]['id'];}delete _0x56fbfc[_0xdd25('0x5f')][_0xdd25('0x2c')];return db['User'][_0xdd25('0x38')]({'where':{'id':_0x56fbfc[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x4c8d36,null))['then'](saveUpdates(_0x56fbfc[_0xdd25('0x5f')],null))[_0xdd25('0x15')](respondWithResult(_0x4c8d36,null))[_0xdd25('0x20')](handleError(_0x4c8d36,null));};exports[_0xdd25('0x61')]=function(_0x472a51,_0x5b9e0e){return db[_0xdd25('0x3e')][_0xdd25('0x61')]()[_0xdd25('0x15')](respondWithResult(_0x5b9e0e,null))[_0xdd25('0x20')](handleError(_0x5b9e0e,null));};exports['addContacts']=function(_0x485f4f,_0xe7abeb){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x485f4f[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0xe7abeb,null))[_0xdd25('0x15')](function(_0xa2c2b7){if(_0xa2c2b7){return _0xa2c2b7['addContacts'](_0x485f4f[_0xdd25('0x5f')][_0xdd25('0x62')],_[_0xdd25('0x63')](_0x485f4f[_0xdd25('0x5f')],[_0xdd25('0x62'),'id'])||{});}})[_0xdd25('0x15')](respondWithResult(_0xe7abeb,null))[_0xdd25('0x20')](handleError(_0xe7abeb,null));};function validateUser(_0x5030a8){return new BPromise(function(_0xe9c2ed,_0x283bb0){if(_0x5030a8['internal'])return _0xe9c2ed(_0x5030a8);return db[_0xdd25('0x64')][_0xdd25('0x65')](0x1)[_0xdd25('0x15')](function(_0xe8c599){if(_0xe8c599['securePassword'])authService[_0xdd25('0x66')](_0x5030a8[_0xdd25('0x42')]);db[_0xdd25('0x3e')]['max'](_0xdd25('0x67'))[_0xdd25('0x15')](function(_0x577643){if(_[_0xdd25('0x68')](_0x577643)){_0x5030a8[_0xdd25('0x67')]=_0xe8c599[_0xdd25('0x69')]||0x1;return;}if(_[_0xdd25('0x68')](_0xe8c599[_0xdd25('0x69')])||_0xe8c599[_0xdd25('0x69')]===_0x577643){_0x5030a8[_0xdd25('0x67')]=_0x577643+0x1;return;}if(_0xe8c599[_0xdd25('0x69')]>_0x577643){_0x5030a8[_0xdd25('0x67')]=_0xe8c599[_0xdd25('0x69')];return;}return db[_0xdd25('0x6a')]['query']('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)',{'type':db[_0xdd25('0x6a')]['QueryTypes'][_0xdd25('0x6b')]})[_0xdd25('0x15')](function(_0x13e9e7){if(_0x13e9e7&&_0x13e9e7['length']){for(var _0x28567b=0x0,_0x4d2558=_0x13e9e7[_0xdd25('0x4f')];_0x28567b<_0x4d2558&&_[_0xdd25('0x68')](_0x5030a8[_0xdd25('0x67')]);_0x28567b++){if(_0xe8c599['min_internal']<=_0x13e9e7[_0x28567b][_0xdd25('0x6c')]){_0x5030a8[_0xdd25('0x67')]=_0x13e9e7[_0x28567b][_0xdd25('0x6c')];}else if(_0xe8c599['min_internal']>_0x13e9e7[_0x28567b][_0xdd25('0x6c')]&&_0xe8c599[_0xdd25('0x69')]<=_0x13e9e7[_0x28567b]['to']){_0x5030a8[_0xdd25('0x67')]=_0xe8c599[_0xdd25('0x69')];}}}if(_['isNil'](_0x5030a8[_0xdd25('0x67')])){_0x5030a8['internal']=_0x577643+0x1;}return _0xe9c2ed(_0x5030a8);});});})[_0xdd25('0x20')](function(_0x32f661){_0x283bb0(_0x32f661);});});}function updateUser(_0x558cab){return new BPromise(function(_0x37a537,_0x29f249){try{if(_0x558cab[_0xdd25('0x6d')]){_0x558cab[_0xdd25('0x6e')]=_0x558cab[_0xdd25('0x67')];_0x558cab[_0xdd25('0x6f')]={'mailbox':_0x558cab[_0xdd25('0x67')],'password':_0x558cab[_0xdd25('0x42')],'fullname':_0x558cab[_0xdd25('0x70')],'email':_0x558cab[_0xdd25('0x71')]};}if(_0x558cab['role']===_0xdd25('0x31')){if(!_0x558cab[_0xdd25('0x72')])_0x558cab[_0xdd25('0x72')]=['101','102','103',_0xdd25('0x73'),_0xdd25('0x74'),_0xdd25('0x75'),'105','106',_0xdd25('0x76'),_0xdd25('0x77'),_0xdd25('0x78'),_0xdd25('0x79'),_0xdd25('0x7a'),_0xdd25('0x7b'),_0xdd25('0x7c')];}_0x37a537(_0x558cab);}catch(_0x29223b){_0x29f249(_0x29223b);}});}exports[_0xdd25('0x7d')]=function(_0x3bcdbb,_0x56748e){if(_0x3bcdbb['user'][_0xdd25('0x2c')]===_0xdd25('0x31'))throw new Error(_0xdd25('0x7e'));if(_0x3bcdbb[_0xdd25('0x5f')]['role']===_0xdd25('0x2f')&&_0x3bcdbb['user']['role']!==_0xdd25('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3bcdbb[_0xdd25('0x5f')][_0xdd25('0x2c')]===_0xdd25('0x2d')&&_0x3bcdbb['user'][_0xdd25('0x2c')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x3bcdbb[_0xdd25('0x5f')]])[_0xdd25('0x15')](function(){return validateUser(_0x3bcdbb[_0xdd25('0x5f')]);})[_0xdd25('0x15')](function(_0x1876e8){return updateUser(_0x1876e8)['then'](function(_0x5b0a9f){if(_0x5b0a9f[_0xdd25('0x2c')]===_0xdd25('0x2d')){_0x5b0a9f[_0xdd25('0x7f')]=_0x3bcdbb['user'][_0xdd25('0x7f')];delete _0x5b0a9f['userProfileId'];}return _0x5b0a9f;});})[_0xdd25('0x15')](function(_0x2d146c){return db[_0xdd25('0x3e')]['create'](_0x2d146c,{'include':[{'model':db[_0xdd25('0x6f')],'as':_0xdd25('0x6f')}]});})[_0xdd25('0x15')](function(_0x2cfe14){if(_0x3bcdbb[_0xdd25('0x5f')]['role']===_0xdd25('0x2f'))return _0x2cfe14;if(_0x3bcdbb[_0xdd25('0x2f')][_0xdd25('0x2c')]!==_0xdd25('0x2f'))return _0x2cfe14;return db[_0xdd25('0x80')]['find']({'where':{'name':_0x2cfe14[_0xdd25('0x2c')]==='agent'?_0xdd25('0x30'):_0xdd25('0x32'),'userProfileId':_0x3bcdbb['user']['userProfileId']},'raw':!![]})[_0xdd25('0x15')](function(_0x53974){if(!_0x53974||_0x53974['autoAssociation']!=0x0)return _0x2cfe14;return db[_0xdd25('0x3a')][_0xdd25('0x7d')]({'name':_0x2cfe14[_0xdd25('0x39')],'resourceId':_0x2cfe14['id'],'type':_0x53974[_0xdd25('0x39')],'sectionId':_0x53974['id']},{})[_0xdd25('0x15')](function(){return _0x2cfe14;});})[_0xdd25('0x20')](function(_0x2e840b){logger[_0xdd25('0x1c')](_0xdd25('0x81'),_0x2e840b);throw _0x2e840b;});})['then'](respondWithResult(_0x56748e,0xc9))[_0xdd25('0x20')](handleError(_0x56748e,null));};exports['bulkCreate']=function(_0x2683be,_0x58e962){var _0x50d647=_0x2683be[_0xdd25('0x5f')];var _0xb5e7d2=[];if(_0x2683be[_0xdd25('0x2f')][_0xdd25('0x2c')]===_0xdd25('0x31'))throw new Error(_0xdd25('0x7e'));if(_['some'](_0x50d647,[_0xdd25('0x2c'),'user'])&&_0x2683be[_0xdd25('0x2f')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xdd25('0x82')](_0x50d647,[_0xdd25('0x2c'),'admin'])&&_0x2683be[_0xdd25('0x2f')][_0xdd25('0x2c')]!==_0xdd25('0x2d')){throw new Error(_0xdd25('0x83'));}return licenseUtil['checkUserLimits'](_0x50d647)[_0xdd25('0x15')](function(){return validateUser(_0x50d647[0x0]);})[_0xdd25('0x15')](function(){for(var _0x5bfa5a=0x1;_0x5bfa5a<_0x50d647[_0xdd25('0x4f')];_0x5bfa5a++){var _0x524c99=_0x50d647[_0x5bfa5a-0x1][_0xdd25('0x67')];if(!_0x50d647[_0x5bfa5a][_0xdd25('0x67')])_0x50d647[_0x5bfa5a][_0xdd25('0x67')]=_0x524c99+0x1;_0xb5e7d2['push'](validateUser(_0x50d647[_0x5bfa5a]));}return BPromise['all'](_0xb5e7d2);})[_0xdd25('0x15')](function(){_0xb5e7d2=[];for(var _0x47cdf4=0x0;_0x47cdf4<_0x50d647[_0xdd25('0x4f')];_0x47cdf4++){_0xb5e7d2[_0xdd25('0x4b')](updateUser(_0x50d647[_0x47cdf4]));}return BPromise[_0xdd25('0x84')](_0xb5e7d2);})[_0xdd25('0x15')](function(){return BPromise[_0xdd25('0x85')](_0x50d647,function(_0x341a5a){return db[_0xdd25('0x3e')]['create'](_0x341a5a,{'include':[{'model':db[_0xdd25('0x6f')],'as':_0xdd25('0x6f')}]})[_0xdd25('0x15')](function(_0x2da4f0){_0x341a5a['id']=_0x2da4f0['id'];return _0x341a5a;});});})[_0xdd25('0x15')](function(_0x453f05){if(_0x2683be[_0xdd25('0x5f')][_0xdd25('0x2c')]===_0xdd25('0x2f'))return _0x453f05;if(_0x2683be[_0xdd25('0x2f')][_0xdd25('0x2c')]!==_0xdd25('0x2f'))return _0x453f05;var _0x27e0e4=_[_0xdd25('0x82')](_0x453f05,function(_0x435d79){return _0x435d79[_0xdd25('0x2c')]===_0xdd25('0x31')||_0x435d79[_0xdd25('0x2c')]===_0xdd25('0x33');});if(!_0x27e0e4)return _0x453f05;return db[_0xdd25('0x80')][_0xdd25('0x4c')]({'where':{'name':{'$or':[_0xdd25('0x30'),'Telephones']},'userProfileId':_0x2683be[_0xdd25('0x2f')][_0xdd25('0x86')]},'raw':!![]})[_0xdd25('0x15')](function(_0x1eb2e3){if(_[_0xdd25('0x87')](_0x1eb2e3)||!_['some'](_0x1eb2e3,[_0xdd25('0x88'),0x0]))return _0x453f05;_0xb5e7d2=[];var _0x3c0c0c=_(_0x1eb2e3)[_0xdd25('0x35')](function(_0x585819){if(_0x585819[_0xdd25('0x88')]===0x1)return;return _0x585819[_0xdd25('0x39')]===_0xdd25('0x30')?_0xdd25('0x31'):_0xdd25('0x33');})[_0xdd25('0x89')]()[_0xdd25('0x36')]();for(var _0x24f713=0x0;_0x24f713<_0x453f05[_0xdd25('0x4f')];_0x24f713++){if(!_['includes'](_0x3c0c0c,_0x453f05[_0x24f713][_0xdd25('0x2c')]))return;var _0x4a938c=_0x453f05[_0x24f713][_0xdd25('0x2c')]===_0xdd25('0x31')?_0xdd25('0x30'):_0xdd25('0x32');_0xb5e7d2[_0xdd25('0x4b')](db[_0xdd25('0x3a')][_0xdd25('0x7d')]({'name':_0x453f05[_0x24f713]['name'],'resourceId':_0x453f05[_0x24f713]['id'],'type':_0x4a938c,'sectionId':_[_0xdd25('0x38')](_0x1eb2e3,[_0xdd25('0x39'),_0x4a938c])['id']},{}));}return BPromise[_0xdd25('0x84')](_0xb5e7d2);});})[_0xdd25('0x15')](respondWithResult(_0x58e962,0xc9))[_0xdd25('0x20')](handleError(_0x58e962,null));};exports[_0xdd25('0x8a')]=function(_0x104ec3,_0x31926c){if(_0x104ec3[_0xdd25('0x5f')]['id']){delete _0x104ec3[_0xdd25('0x5f')]['id'];}return db['User'][_0xdd25('0x38')]({'where':{'id':_0x104ec3[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](function(_0x4bb1e0){if(!_0x4bb1e0)return null;if(_0x4bb1e0['id']===_0x104ec3[_0xdd25('0x2f')]['id']){if(!_0x104ec3[_0xdd25('0x5f')][_0xdd25('0x8b')]||!_0x104ec3['body'][_0xdd25('0x8c')]){throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))](_0xdd25('0x8f'));}if(!_0x4bb1e0[_0xdd25('0x90')](_0x104ec3['body']['oldPassword'])){throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))]('Wrong\x20credentials');}if(_0x104ec3[_0xdd25('0x5f')][_0xdd25('0x8b')]===_0x104ec3[_0xdd25('0x5f')][_0xdd25('0x8c')]){throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))](_0xdd25('0x91'));}}else if(_0x104ec3[_0xdd25('0x2f')]['role']===_0xdd25('0x2d')){if(!_0x104ec3[_0xdd25('0x5f')][_0xdd25('0x8c')]){throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))](_0xdd25('0x92'));}}else if(_0x104ec3[_0xdd25('0x2f')][_0xdd25('0x2c')]===_0xdd25('0x2f')){if(!_0x104ec3['body'][_0xdd25('0x8c')]){throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))](_0xdd25('0x92'));}if(_0x4bb1e0['role']!==_0xdd25('0x31')){throw new db['Sequelize'][(_0xdd25('0x8e'))](_0xdd25('0x7e'));}}else{throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))](_0xdd25('0x7e'));}return _0x4bb1e0;})['then'](handleEntityNotFound(_0x31926c,null))[_0xdd25('0x15')](function(_0x302a18){return db['Setting'][_0xdd25('0x93')]({'attributes':['id',_0xdd25('0x94'),'enforcePasswordHistory',_0xdd25('0x95')]})[_0xdd25('0x15')](function(_0x44d05a){if(_0x44d05a['securePassword'])authService['validatePasswordPattern'](_0x104ec3['body']['newPassword']);if(!_0x44d05a[_0xdd25('0x96')]||!_0x302a18['previousPasswords'])return _0x302a18;authService['validatePasswordHistory'](_0x104ec3[_0xdd25('0x5f')]['newPassword'],_0x302a18[_0xdd25('0x97')],_0x44d05a['passwordHistoryLimit']);return _0x302a18;})['then'](saveUpdates({'password':_0x104ec3[_0xdd25('0x5f')][_0xdd25('0x8c')],'passwordResetAt':_0x104ec3[_0xdd25('0x2f')]['id']==_0x104ec3[_0xdd25('0x60')]['id']?moment():null,'previousPasswords':authService[_0xdd25('0x98')](_0x104ec3[_0xdd25('0x5f')][_0xdd25('0x8c')],_0x302a18[_0xdd25('0x97')])},null));})[_0xdd25('0x15')](respondWithResult(_0x31926c,null))[_0xdd25('0x20')](handleError(_0x31926c,null));};exports['addQueues']=function(_0x2de7d3,_0x4d2461){var _0x16903d=_0x2de7d3[_0xdd25('0x5f')]['channel'];return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x2de7d3[_0xdd25('0x60')]['id']},'attributes':['id',_0xdd25('0x39'),'role','online','loginInPause',_0xdd25('0x99'),'interface']})[_0xdd25('0x15')](handleEntityNotFound(_0x4d2461,null))['then'](function(_0xdb73a){if(_0xdb73a){if(!utils[_0xdd25('0x9a')](_0x16903d)){throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))]('Unknown\x20channel');}return _0xdb73a[_0xdd25('0x9b')+_['capitalize'](_0x16903d[_0xdd25('0x9c')]())+_0xdd25('0x9d')](_0x2de7d3[_0xdd25('0x5f')]['ids'],{'penalty':_0x2de7d3[_0xdd25('0x5f')]['penalty']||0x0})['spread'](function(_0x383e00){for(var _0x107529=0x0;_0x107529<_0x2de7d3[_0xdd25('0x5f')]['ids']['length'];_0x107529+=0x1){var _0x24fbd6={'UserId':Number(_0x2de7d3[_0xdd25('0x60')]['id'])};_0x24fbd6[_[_0xdd25('0x9e')](_0x16903d[_0xdd25('0x9c')]())+_0xdd25('0x9f')]=Number(_0x2de7d3[_0xdd25('0x5f')][_0xdd25('0x62')][_0x107529]);socket[_0xdd25('0xa0')]('user'+_[_0xdd25('0x9e')](_0x16903d[_0xdd25('0x9c')]())+_0xdd25('0xa1'),_0x24fbd6);}return _0x383e00;})['then'](function(){if(_0x16903d==='voice'){return db[_0xdd25('0xa2')][_0xdd25('0x4c')]({'where':{'id':_0x2de7d3[_0xdd25('0x5f')]['ids']||[]},'raw':!![],'attributes':['id',_0xdd25('0x39')]});}})[_0xdd25('0x15')](function(_0x527b0a){var _0x23bdf0=_0xdb73a[_0xdd25('0x2b')]({'plain':!![]});var _0x170a5b=[];if(_0x16903d===_0xdd25('0xa3')&&_0x23bdf0[_0xdd25('0x2c')]==='agent'&&_0x23bdf0[_0xdd25('0xa4')]){for(var _0x24f7a1=0x0;_0x24f7a1<_0x527b0a[_0xdd25('0x4f')];_0x24f7a1+=0x1){_0x170a5b[_0xdd25('0x4b')]({'membername':_0x23bdf0['name'],'UserId':_0x23bdf0['id'],'queue_name':_0x527b0a[_0x24f7a1][_0xdd25('0x39')],'VoiceQueueId':_0x527b0a[_0x24f7a1]['id'],'interface':_[_0xdd25('0x68')](_0x23bdf0[_0xdd25('0xa5')])?util[_0xdd25('0xa6')]('SIP/%s',_0x23bdf0[_0xdd25('0x39')]):_0x23bdf0[_0xdd25('0xa5')],'paused':_0x23bdf0[_0xdd25('0x99')]||![],'penalty':_0x2de7d3['body'][_0xdd25('0xa7')]||0x0});}return BPromise[_0xdd25('0x85')](_0x170a5b,function(_0x5b9a88){return db[_0xdd25('0xa8')][_0xdd25('0xa9')](_0x5b9a88);});}return _0xdb73a;});}})[_0xdd25('0x15')](respondWithStatusCode(_0x4d2461,null))['catch'](handleError(_0x4d2461,null));};exports[_0xdd25('0xaa')]=function(_0x52f876,_0x683b38){var _0x1ca2f7,_0x3df35b;return db['User']['find']({'where':{'id':_0x52f876['params']['id']},'attributes':['id',_0xdd25('0x39'),_0xdd25('0x2c')]})['then'](handleEntityNotFound(_0x683b38,null))['then'](function(_0x3db284){if(_0x3db284){_0x1ca2f7=_0x3db284;if(!_0x52f876[_0xdd25('0x45')]['channel']||!utils['isValidChannel'](_0x52f876[_0xdd25('0x45')][_0xdd25('0xab')])){throw new db['Sequelize'][(_0xdd25('0x8e'))](_0xdd25('0xac'));}return _0x3db284['remove'+_[_0xdd25('0x9e')](_0x52f876['query'][_0xdd25('0xab')][_0xdd25('0x9c')]())+_0xdd25('0x9d')](_0x52f876[_0xdd25('0x45')][_0xdd25('0x62')]);}})['then'](function(_0x4f1da3){if(_[_0xdd25('0xad')](_0x52f876[_0xdd25('0x45')][_0xdd25('0x62')])){for(var _0x29acc7=0x0;_0x29acc7<_0x52f876[_0xdd25('0x45')][_0xdd25('0x62')][_0xdd25('0x4f')];_0x29acc7+=0x1){_0x3df35b={'UserId':Number(_0x52f876['params']['id'])};_0x3df35b[_['capitalize'](_0x52f876[_0xdd25('0x45')][_0xdd25('0xab')][_0xdd25('0x9c')]())+'QueueId']=Number(_0x52f876[_0xdd25('0x45')][_0xdd25('0x62')][_0x29acc7]);socket[_0xdd25('0xa0')](_0xdd25('0x2f')+_[_0xdd25('0x9e')](_0x52f876[_0xdd25('0x45')][_0xdd25('0xab')][_0xdd25('0x9c')]())+_0xdd25('0xae'),_0x3df35b);}}else{_0x3df35b={'UserId':Number(_0x52f876['params']['id'])};_0x3df35b[_[_0xdd25('0x9e')](_0x52f876[_0xdd25('0x45')][_0xdd25('0xab')][_0xdd25('0x9c')]())+'QueueId']=Number(_0x52f876[_0xdd25('0x45')]['ids']);socket[_0xdd25('0xa0')](_0xdd25('0x2f')+_[_0xdd25('0x9e')](_0x52f876[_0xdd25('0x45')]['channel'][_0xdd25('0x9c')]())+_0xdd25('0xae'),_0x3df35b);}return _0x4f1da3;})[_0xdd25('0x15')](function(){if(_0x52f876['query'][_0xdd25('0xab')]===_0xdd25('0xa3')){return db[_0xdd25('0xa8')][_0xdd25('0x2a')]({'where':{'UserId':_0x52f876['params']['id'],'VoiceQueueId':_0x52f876['query']['ids']},'individualHooks':!![]})[_0xdd25('0x15')](function(){return _0x1ca2f7;});}return _0x1ca2f7;})[_0xdd25('0x15')](respondWithStatusCode(_0x683b38,null))[_0xdd25('0x20')](handleError(_0x683b38,null));};exports[_0xdd25('0xaf')]=function(_0x3e8fed,_0x3c1abb){_0x3e8fed[_0xdd25('0x5f')][_0xdd25('0xb0')]=_0x3e8fed[_0xdd25('0xb1')]['filename'];return db['User']['find']({'where':{'id':_0x3e8fed[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x3c1abb,null))[_0xdd25('0x15')](saveUpdates(_0x3e8fed[_0xdd25('0x5f')],null))[_0xdd25('0x15')](respondWithResult(_0x3c1abb,null))[_0xdd25('0x20')](handleError(_0x3c1abb,null));};exports[_0xdd25('0xb2')]=function(_0x199d30,_0x2922fa){var _0x364cd4=path[_0xdd25('0xb3')](config[_0xdd25('0xb4')],_0xdd25('0xb5'));return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x199d30[_0xdd25('0x60')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xdd25('0x15')](handleEntityNotFound(_0x2922fa,null))['then'](function(_0x44c7ce){if(_0x44c7ce){if(_['isNil'](_0x44c7ce['userpic'])){return _0x2922fa['download'](_0x364cd4);}else{if(!fs[_0xdd25('0xb6')](path[_0xdd25('0xb3')](config['root'],_0xdd25('0xb7'),_0x44c7ce[_0xdd25('0xb0')]))){return _0x2922fa[_0xdd25('0xb8')](_0x364cd4);}return _0x2922fa['download'](path[_0xdd25('0xb3')](config[_0xdd25('0xb4')],'server/files/images/',_0x44c7ce[_0xdd25('0xb0')]));}}})[_0xdd25('0x20')](handleError(_0x2922fa,null));};exports[_0xdd25('0xb9')]=function(_0x5ed0c2,_0x20d028){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x5ed0c2[_0xdd25('0x60')]['id']},'attributes':['id']})[_0xdd25('0x15')](handleEntityNotFound(_0x20d028,null))[_0xdd25('0x15')](function(_0x4ef258){var _0x20144b=[];values=_0x4ef258[_0xdd25('0x51')];_0x20144b[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x50'),_0x4ef258[_0xdd25('0x51')]));_0x20144b[_0xdd25('0x4b')](get_open_tabs('sms',_0x4ef258[_0xdd25('0x51')]));_0x20144b[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x54'),_0x4ef258[_0xdd25('0x51')]));_0x20144b[_0xdd25('0x4b')](get_open_tabs('whatsapp',_0x4ef258[_0xdd25('0x51')]));_0x20144b[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0xba'),_0x4ef258[_0xdd25('0x51')]));_0x20144b[_0xdd25('0x4b')](get_open_tabs(_0xdd25('0x53'),_0x4ef258[_0xdd25('0x51')]));return BPromise[_0xdd25('0x84')](_0x20144b);})[_0xdd25('0x15')](function(_0xccd459){if(_0xccd459){var _0x43ee40=_[_0xdd25('0x35')](values[_0xdd25('0xbb')],function(_0x48508e){return{'channel':_0xdd25('0xbc'),'id':_0x48508e['id'],'createdAt':_0x48508e[_0xdd25('0xbd')]};});var _0x3b4d86=_[_0xdd25('0x35')](values[_0xdd25('0xbe')],function(_0x351991){return{'channel':_0xdd25('0xbf'),'id':_0x351991['id'],'createdAt':_0x351991['createdAt']};});var _0x31bb0c=_['map'](values[_0xdd25('0xc0')],function(_0x5af8f7){return{'channel':_0xdd25('0xc1'),'id':_0x5af8f7['id'],'createdAt':_0x5af8f7[_0xdd25('0xbd')]};});var _0x1fa77b=_[_0xdd25('0x35')](values[_0xdd25('0xc2')],function(_0x3af836){return{'channel':'MAIL','id':_0x3af836['id'],'createdAt':_0x3af836[_0xdd25('0xbd')]};});var _0x21fec8=_[_0xdd25('0x35')](values[_0xdd25('0xc3')],function(_0x2f02c2){return{'channel':_0xdd25('0xc4'),'id':_0x2f02c2['id'],'createdAt':_0x2f02c2[_0xdd25('0xbd')]};});var _0x505469=_[_0xdd25('0x35')](values[_0xdd25('0xc5')],function(_0x5e60b2){return{'channel':_0xdd25('0xc6'),'id':_0x5e60b2['id'],'createdAt':_0x5e60b2[_0xdd25('0xbd')]};});var _0x50d35b=_[_0xdd25('0xc7')](_0x43ee40,_0x3b4d86,_0x31bb0c,_0x1fa77b,_0x21fec8,_0x505469);var _0x10caa1={'count':_0x50d35b['length'],'rows':_0x50d35b};return _0x10caa1;}else return null;})[_0xdd25('0x15')](respondWithResult(_0x20d028,null))['catch'](handleError(_0x20d028,null));};exports['getContacts']=function(_0x23d53c,_0x2847be){var _0x29bbe9={};var _0x228fd6={};var _0x427011;var _0x4b26c0;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x23d53c[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x2847be,null))[_0xdd25('0x15')](function(_0x24163f){if(_0x24163f){_0x427011=_0x24163f;_0x228fd6[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db['CmContact'][_0xdd25('0x3f')]);_0x228fd6[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x23d53c[_0xdd25('0x45')]);_0x228fd6['filters']=_[_0xdd25('0x59')](_0x228fd6[_0xdd25('0x5a')],_0x228fd6[_0xdd25('0x45')]);_0x29bbe9[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x228fd6[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x23d53c[_0xdd25('0x45')]['fields']));_0x29bbe9[_0xdd25('0x4a')]=_0x29bbe9[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x29bbe9['attributes']:_0x228fd6[_0xdd25('0x5a')];_0x29bbe9['order']=qs[_0xdd25('0xc8')](_0x23d53c['query'][_0xdd25('0xc8')]);_0x29bbe9[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_['pick'](_0x23d53c[_0xdd25('0x45')],_0x228fd6[_0xdd25('0x58')]));if(_0x23d53c[_0xdd25('0x45')][_0xdd25('0x41')]){_0x29bbe9[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x29bbe9[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x29bbe9['attributes'],function(_0x4686c1){var _0x1ea274={};_0x1ea274[_0x4686c1]={'$like':'%'+_0x23d53c[_0xdd25('0x45')]['filter']+'%'};return _0x1ea274;})});}_0x29bbe9=_['merge']({},_0x29bbe9,_0x23d53c[_0xdd25('0x5e')]);return _0x427011[_0xdd25('0xca')](_0x29bbe9);}})[_0xdd25('0x15')](function(_0x10d370){if(_0x10d370){_0x4b26c0=_0x10d370[_0xdd25('0x4f')];if(_0x23d53c[_0xdd25('0x45')][_0xdd25('0xcb')]('includeAll')){_0x29bbe9[_0xdd25('0x47')]=[{'model':db[_0xdd25('0xcc')],'as':_0xdd25('0xcd'),'required':![]},{'model':db[_0xdd25('0xce')],'as':_0xdd25('0xcf'),'attributes':['id',_0xdd25('0x39'),'color'],'where':_0x23d53c['query'][_0xdd25('0xd0')]?{'id':_0x23d53c['query'][_0xdd25('0xd0')]}:undefined,'required':_0x23d53c[_0xdd25('0x45')][_0xdd25('0xd0')]?!![]:![]}];}if(!_0x23d53c[_0xdd25('0x45')][_0xdd25('0xcb')]('nolimit')){_0x29bbe9[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0x23d53c[_0xdd25('0x45')][_0xdd25('0x26')]);_0x29bbe9[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x23d53c[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x427011[_0xdd25('0xca')](_0x29bbe9);}})[_0xdd25('0x15')](function(_0x33baa5){if(_0x33baa5){return _0x33baa5?{'count':_0x4b26c0,'rows':_0x33baa5}:null;}})['then'](respondWithResult(_0x2847be,null))[_0xdd25('0x20')](handleError(_0x2847be,null));};exports[_0xdd25('0xd1')]=function(_0xfeabd3,_0x5f3c66){var _0x270d84;var _0x1abb5e={};var _0x128e4e;return db[_0xdd25('0x3e')]['findOne']({'where':{'id':_0xfeabd3['params']['id']},'attributes':['id',_0xdd25('0x39'),_0xdd25('0x2c')]})[_0xdd25('0x15')](handleEntityNotFound(_0x5f3c66,null))[_0xdd25('0x15')](function(_0x3a8c1c){if(!utils['isValidChannel'](_0xfeabd3[_0xdd25('0x45')][_0xdd25('0xab')])){throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))]('Unknown\x20channel');}_0x270d84=_0x3a8c1c;var _0x16114e={};_0x16114e[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_['capitalize'](_0xfeabd3[_0xdd25('0x45')][_0xdd25('0xab')])+_0xdd25('0xd2')]['rawAttributes']);_0x16114e['query']=_[_0xdd25('0x57')](_0xfeabd3[_0xdd25('0x45')]);_0x16114e[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x16114e[_0xdd25('0x5a')],_0x16114e[_0xdd25('0x45')]);_0x1abb5e[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x16114e[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0xfeabd3[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x1abb5e[_0xdd25('0x4a')]=_0x1abb5e[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x1abb5e['attributes']:_0x16114e[_0xdd25('0x5a')];_0x1abb5e[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0xfeabd3['query']['sort']);_0x1abb5e['where']=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0xfeabd3['query'],_0x16114e[_0xdd25('0x58')]));if(_0xfeabd3[_0xdd25('0x45')][_0xdd25('0x41')]){_0x1abb5e[_0xdd25('0xc9')]=_['merge'](_0x1abb5e[_0xdd25('0xc9')],{'$or':_['map'](_0x1abb5e['attributes'],function(_0x300ad5){var _0x1bf870={};_0x1bf870[_0x300ad5]={'$like':'%'+_0xfeabd3[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x1bf870;})});}_0x1abb5e=_[_0xdd25('0x5d')]({},_0x1abb5e,_0xfeabd3[_0xdd25('0x5e')]);switch(_0x270d84[_0xdd25('0x2c')]){case'admin':return db[_['capitalize'](_0xfeabd3['query'][_0xdd25('0xab')])+_0xdd25('0xd2')]['findAll'](_0x1abb5e);case _0xdd25('0x2f'):case'agent':return _0x270d84[_0xdd25('0x2b')+_[_0xdd25('0x9e')](_0xfeabd3['query']['channel'])+_0xdd25('0x9d')](_0x1abb5e);default:throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))](_0xdd25('0xd5'));}})['then'](function(_0x146d6d){_0x128e4e=_0x146d6d[_0xdd25('0x4f')];if(!_0xfeabd3['query'][_0xdd25('0xcb')]('nolimit')){_0x1abb5e[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0xfeabd3[_0xdd25('0x45')][_0xdd25('0x26')]);_0x1abb5e['offset']=qs[_0xdd25('0x23')](_0xfeabd3[_0xdd25('0x45')][_0xdd25('0x23')]);}switch(_0x270d84[_0xdd25('0x2c')]){case _0xdd25('0x2d'):return db[_[_0xdd25('0x9e')](_0xfeabd3[_0xdd25('0x45')]['channel'])+'Queue']['findAll'](_0x1abb5e);case _0xdd25('0x2f'):case _0xdd25('0x31'):return _0x270d84[_0xdd25('0x2b')+_[_0xdd25('0x9e')](_0xfeabd3[_0xdd25('0x45')][_0xdd25('0xab')])+_0xdd25('0x9d')](_0x1abb5e);}})['then'](function(_0x3581ac){return{'count':_0x128e4e,'rows':_0x3581ac};})[_0xdd25('0x15')](respondWithResult(_0x5f3c66,null))['catch'](handleError(_0x5f3c66,null));};exports[_0xdd25('0xd6')]=function(_0x2269a9,_0x337be7){var _0x273a76={};var _0x11c9e0={};var _0x5c4ebe;var _0x254414;return db[_0xdd25('0x3e')]['findOne']({'where':{'id':_0x2269a9[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x337be7,null))[_0xdd25('0x15')](function(_0x2259af){if(_0x2259af){_0x5c4ebe=_0x2259af;_0x11c9e0['model']=_[_0xdd25('0x57')](db['UserVoiceQueueRt'][_0xdd25('0x3f')]);_0x11c9e0[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x2269a9['query']);_0x11c9e0['filters']=_['intersection'](_0x11c9e0[_0xdd25('0x5a')],_0x11c9e0['query']);_0x273a76[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x11c9e0[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x2269a9['query'][_0xdd25('0x5b')]));_0x273a76[_0xdd25('0x4a')]=_0x273a76['attributes'][_0xdd25('0x4f')]?_0x273a76[_0xdd25('0x4a')]:_0x11c9e0[_0xdd25('0x5a')];_0x273a76['order']=qs[_0xdd25('0xc8')](_0x2269a9[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x273a76[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x2269a9[_0xdd25('0x45')],_0x11c9e0['filters']));if(_0x2269a9[_0xdd25('0x45')][_0xdd25('0x41')]){_0x273a76[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x273a76[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x273a76[_0xdd25('0x4a')],function(_0x1aa1a7){var _0x49f08c={};_0x49f08c[_0x1aa1a7]={'$like':'%'+_0x2269a9[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x49f08c;})});}_0x273a76=_[_0xdd25('0x5d')]({},_0x273a76,_0x2269a9[_0xdd25('0x5e')]);return _0x5c4ebe['getVoiceQueuesRt'](_0x273a76);}})['then'](function(_0x36444a){if(_0x36444a){_0x254414=_0x36444a[_0xdd25('0x4f')];if(!_0x2269a9[_0xdd25('0x45')][_0xdd25('0xcb')]('nolimit')){_0x273a76[_0xdd25('0x26')]=qs['limit'](_0x2269a9[_0xdd25('0x45')][_0xdd25('0x26')]);_0x273a76[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x2269a9[_0xdd25('0x45')]['offset']);}return _0x5c4ebe[_0xdd25('0xd6')](_0x273a76);}})[_0xdd25('0x15')](function(_0x5b8d04){if(_0x5b8d04){return _0x5b8d04?{'count':_0x254414,'rows':_0x5b8d04}:null;}})[_0xdd25('0x15')](respondWithResult(_0x337be7,null))[_0xdd25('0x20')](handleError(_0x337be7,null));};exports[_0xdd25('0xd7')]=function(_0x29aca5,_0x26ec87){var _0x5811ee={};var _0x123728={};var _0x42c6ab;var _0x219fb9;return db['User'][_0xdd25('0x93')]({'where':{'id':_0x29aca5[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x26ec87,null))[_0xdd25('0x15')](function(_0x4f9474){if(_0x4f9474){_0x42c6ab=_0x4f9474;_0x123728[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db['ChatGroup']['rawAttributes']);_0x123728[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x29aca5[_0xdd25('0x45')]);_0x123728['filters']=_[_0xdd25('0x59')](_0x123728[_0xdd25('0x5a')],_0x123728['query']);_0x5811ee[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x123728[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x29aca5[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x5811ee[_0xdd25('0x4a')]=_0x5811ee[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x5811ee[_0xdd25('0x4a')]:_0x123728[_0xdd25('0x5a')];_0x5811ee[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x29aca5[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x5811ee[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x29aca5[_0xdd25('0x45')],_0x123728['filters']));if(_0x29aca5['query']['filter']){_0x5811ee[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x5811ee[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x5811ee['attributes'],function(_0x4ee812){var _0x393932={};_0x393932[_0x4ee812]={'$like':'%'+_0x29aca5['query'][_0xdd25('0x41')]+'%'};return _0x393932;})});}_0x5811ee=_['merge']({},_0x5811ee,_0x29aca5[_0xdd25('0x5e')]);return _0x42c6ab[_0xdd25('0xd7')](_0x5811ee);}})[_0xdd25('0x15')](function(_0x2fc76d){if(_0x2fc76d){_0x219fb9=_0x2fc76d[_0xdd25('0x4f')];if(!_0x29aca5['query']['hasOwnProperty'](_0xdd25('0xd8'))){_0x5811ee[_0xdd25('0x26')]=qs['limit'](_0x29aca5['query']['limit']);_0x5811ee[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x29aca5[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x42c6ab[_0xdd25('0xd7')](_0x5811ee);}})['then'](function(_0x554ec8){if(_0x554ec8){return _0x554ec8?{'count':_0x219fb9,'rows':_0x554ec8}:null;}})[_0xdd25('0x15')](respondWithResult(_0x26ec87,null))[_0xdd25('0x20')](handleError(_0x26ec87,null));};exports['getRecordings']=function(_0x149489,_0x49803f){var _0x13d7fe={'raw':!![],'where':{}};var _0xf60915={};var _0x4feec3={'count':0x0,'rows':[]};return db['User'][_0xdd25('0x93')]({'where':{'id':_0x149489[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x49803f,null))['then'](function(_0x28bd95){if(_0x28bd95){_0xf60915[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0xd9')][_0xdd25('0x3f')]);_0xf60915[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x149489[_0xdd25('0x45')]);_0xf60915['filters']=_[_0xdd25('0x59')](_0xf60915[_0xdd25('0x5a')],_0xf60915[_0xdd25('0x45')]);_0x13d7fe[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0xf60915[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x149489['query'][_0xdd25('0x5b')]));_0x13d7fe[_0xdd25('0x4a')]=_0x13d7fe[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x13d7fe[_0xdd25('0x4a')]:_0xf60915[_0xdd25('0x5a')];if(!_0x149489[_0xdd25('0x45')][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0x13d7fe['limit']=qs[_0xdd25('0x26')](_0x149489['query'][_0xdd25('0x26')]);_0x13d7fe[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x149489['query'][_0xdd25('0x23')]);}_0x13d7fe['order']=qs[_0xdd25('0xc8')](_0x149489[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x13d7fe['where']=qs[_0xdd25('0x58')](_['pick'](_0x149489['query'],_0xf60915[_0xdd25('0x58')]));_0x13d7fe[_0xdd25('0xc9')][_0xdd25('0xda')]=_0x28bd95['id'];if(_0x149489[_0xdd25('0x45')]['filter']){_0x13d7fe[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x13d7fe[_0xdd25('0xc9')],{'$or':_['map'](_0x13d7fe[_0xdd25('0x4a')],function(_0x2bfe2e){var _0x494886={};_0x494886[_0x2bfe2e]={'$like':'%'+_0x149489[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x494886;})});}_0x13d7fe=_['merge']({},_0x13d7fe,_0x149489['options']);return db[_0xdd25('0xd9')][_0xdd25('0x25')]({'where':_0x13d7fe[_0xdd25('0xc9')]})[_0xdd25('0x15')](function(_0x20a921){_0x4feec3[_0xdd25('0x25')]=_0x20a921;if(_0x149489[_0xdd25('0x45')][_0xdd25('0x46')]){_0x13d7fe['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xdd25('0x4c')](_0x13d7fe);})[_0xdd25('0x15')](function(_0x447198){_0x4feec3['rows']=_0x447198;return _0x4feec3;});}})[_0xdd25('0x15')](respondWithFilteredResult(_0x49803f,_0x13d7fe))[_0xdd25('0x20')](handleError(_0x49803f,null));};exports['getScreenRecordings']=function(_0x26b08e,_0x383e3a){var _0x38efab={'raw':!![],'where':{}};var _0x46f6ca={};var _0x337693={'count':0x0,'rows':[]};return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x26b08e[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x383e3a,null))[_0xdd25('0x15')](function(_0x6e518b){if(_0x6e518b){_0x46f6ca[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0xdb')][_0xdd25('0x3f')]);_0x46f6ca[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x26b08e[_0xdd25('0x45')]);_0x46f6ca['filters']=_['intersection'](_0x46f6ca[_0xdd25('0x5a')],_0x46f6ca[_0xdd25('0x45')]);_0x38efab['attributes']=_[_0xdd25('0x59')](_0x46f6ca[_0xdd25('0x5a')],qs['fields'](_0x26b08e['query'][_0xdd25('0x5b')]));_0x38efab[_0xdd25('0x4a')]=_0x38efab[_0xdd25('0x4a')]['length']?_0x38efab[_0xdd25('0x4a')]:_0x46f6ca[_0xdd25('0x5a')];if(!_0x26b08e['query'][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0x38efab['limit']=qs[_0xdd25('0x26')](_0x26b08e[_0xdd25('0x45')][_0xdd25('0x26')]);_0x38efab[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x26b08e['query'][_0xdd25('0x23')]);}_0x38efab[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x26b08e[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x38efab[_0xdd25('0xc9')]=qs['filters'](_[_0xdd25('0xd4')](_0x26b08e[_0xdd25('0x45')],_0x46f6ca[_0xdd25('0x58')]));_0x38efab[_0xdd25('0xc9')][_0xdd25('0xda')]=_0x6e518b['id'];if(_0x26b08e[_0xdd25('0x45')][_0xdd25('0x41')]){_0x38efab[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x38efab['where'],{'$or':_[_0xdd25('0x35')](_0x38efab[_0xdd25('0x4a')],function(_0x41b784){var _0x9ad388={};_0x9ad388[_0x41b784]={'$like':'%'+_0x26b08e[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x9ad388;})});}_0x38efab=_[_0xdd25('0x5d')]({},_0x38efab,_0x26b08e[_0xdd25('0x5e')]);return db['ScreenRecording'][_0xdd25('0x25')]({'where':_0x38efab[_0xdd25('0xc9')]})['then'](function(_0x217624){_0x337693[_0xdd25('0x25')]=_0x217624;if(_0x26b08e[_0xdd25('0x45')][_0xdd25('0x46')]){_0x38efab[_0xdd25('0x47')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x38efab);})[_0xdd25('0x15')](function(_0x15384c){_0x337693['rows']=_0x15384c;return _0x337693;});}})['then'](respondWithFilteredResult(_0x383e3a,_0x38efab))[_0xdd25('0x20')](handleError(_0x383e3a,null));};exports[_0xdd25('0xdc')]=function(_0x3d744b,_0x5a1696){var _0x551e51={};var _0x478ac3={};var _0x24bb17;var _0x542081;return db[_0xdd25('0x3e')]['findOne']({'where':{'id':_0x3d744b[_0xdd25('0x60')]['id']}})['then'](handleEntityNotFound(_0x5a1696,null))[_0xdd25('0x15')](function(_0x4688d8){if(_0x4688d8){_0x24bb17=_0x4688d8;_0x478ac3[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0xdd')]['rawAttributes']);_0x478ac3['query']=_[_0xdd25('0x57')](_0x3d744b[_0xdd25('0x45')]);_0x478ac3[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x478ac3[_0xdd25('0x5a')],_0x478ac3[_0xdd25('0x45')]);_0x551e51['attributes']=_[_0xdd25('0x59')](_0x478ac3[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x3d744b[_0xdd25('0x45')]['fields']));_0x551e51['attributes']=_0x551e51[_0xdd25('0x4a')]['length']?_0x551e51[_0xdd25('0x4a')]:_0x478ac3[_0xdd25('0x5a')];_0x551e51[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x3d744b['query'][_0xdd25('0xc8')]);_0x551e51[_0xdd25('0xc9')]=qs['filters'](_['pick'](_0x3d744b['query'],_0x478ac3[_0xdd25('0x58')]));if(_0x3d744b[_0xdd25('0x45')]['filter']){_0x551e51[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x551e51['where'],{'$or':_[_0xdd25('0x35')](_0x551e51['attributes'],function(_0x2d3798){var _0x21d1a4={};_0x21d1a4[_0x2d3798]={'$like':'%'+_0x3d744b[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x21d1a4;})});}_0x551e51=_[_0xdd25('0x5d')]({},_0x551e51,_0x3d744b[_0xdd25('0x5e')]);return _0x24bb17[_0xdd25('0xdc')](_0x551e51);}})[_0xdd25('0x15')](function(_0x2f0ea4){if(_0x2f0ea4){_0x542081=_0x2f0ea4[_0xdd25('0x4f')];if(!_0x3d744b['query']['hasOwnProperty']('nolimit')){_0x551e51['limit']=qs[_0xdd25('0x26')](_0x3d744b['query']['limit']);_0x551e51[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x3d744b[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x24bb17['getChatInteractions'](_0x551e51);}})[_0xdd25('0x15')](function(_0x4f3885){if(_0x4f3885){return _0x4f3885?{'count':_0x542081,'rows':_0x4f3885}:null;}})[_0xdd25('0x15')](respondWithResult(_0x5a1696,null))['catch'](handleError(_0x5a1696,null));};exports[_0xdd25('0xde')]=function(_0x1c2f7e,_0xe74f7){var _0x22fd25={};var _0x1118d1={};var _0x44a005;var _0x41dbce;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x1c2f7e[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0xe74f7,null))[_0xdd25('0x15')](function(_0x4d3cf7){if(_0x4d3cf7){_0x44a005=_0x4d3cf7;_0x1118d1[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0xdf')][_0xdd25('0x3f')]);_0x1118d1[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x1c2f7e['query']);_0x1118d1[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x1118d1[_0xdd25('0x5a')],_0x1118d1['query']);_0x22fd25[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x1118d1[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x1c2f7e['query'][_0xdd25('0x5b')]));_0x22fd25[_0xdd25('0x4a')]=_0x22fd25[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x22fd25[_0xdd25('0x4a')]:_0x1118d1[_0xdd25('0x5a')];_0x22fd25[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x1c2f7e[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x22fd25[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x1c2f7e['query'],_0x1118d1['filters']));if(_0x1c2f7e[_0xdd25('0x45')]['filter']){_0x22fd25[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x22fd25[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x22fd25['attributes'],function(_0x5eea99){var _0x235745={};_0x235745[_0x5eea99]={'$like':'%'+_0x1c2f7e[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x235745;})});}_0x22fd25=_[_0xdd25('0x5d')]({},_0x22fd25,_0x1c2f7e[_0xdd25('0x5e')]);return _0x44a005[_0xdd25('0xde')](_0x22fd25);}})[_0xdd25('0x15')](function(_0x4fbd65){if(_0x4fbd65){_0x41dbce=_0x4fbd65[_0xdd25('0x4f')];if(!_0x1c2f7e[_0xdd25('0x45')][_0xdd25('0xcb')]('nolimit')){_0x22fd25['limit']=qs['limit'](_0x1c2f7e['query'][_0xdd25('0x26')]);_0x22fd25[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x1c2f7e['query'][_0xdd25('0x23')]);}return _0x44a005[_0xdd25('0xde')](_0x22fd25);}})[_0xdd25('0x15')](function(_0x2aec38){if(_0x2aec38){return _0x2aec38?{'count':_0x41dbce,'rows':_0x2aec38}:null;}})[_0xdd25('0x15')](respondWithResult(_0xe74f7,null))[_0xdd25('0x20')](handleError(_0xe74f7,null));};exports[_0xdd25('0xe0')]=function(_0x1a04d2,_0x59e499){var _0x2fb5fd={'raw':!![],'where':{}};var _0x537bde={};var _0x4a252b={'count':0x0,'rows':[]};return db['User'][_0xdd25('0x93')]({'where':{'id':_0x1a04d2['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x59e499,null))[_0xdd25('0x15')](function(_0x4df90a){if(_0x4df90a){_0x537bde[_0xdd25('0x5a')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x537bde[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x1a04d2['query']);_0x537bde[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x537bde[_0xdd25('0x5a')],_0x537bde[_0xdd25('0x45')]);_0x2fb5fd[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x537bde[_0xdd25('0x5a')],qs['fields'](_0x1a04d2[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x2fb5fd[_0xdd25('0x4a')]=_0x2fb5fd[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x2fb5fd[_0xdd25('0x4a')]:_0x537bde[_0xdd25('0x5a')];if(!_0x1a04d2['query']['hasOwnProperty'](_0xdd25('0xd8'))){_0x2fb5fd[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0x1a04d2[_0xdd25('0x45')][_0xdd25('0x26')]);_0x2fb5fd[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x1a04d2[_0xdd25('0x45')][_0xdd25('0x23')]);}_0x2fb5fd[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x1a04d2[_0xdd25('0x45')]['sort']);_0x2fb5fd[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x1a04d2['query'],_0x537bde['filters']));_0x2fb5fd[_0xdd25('0xc9')]['UserId']=_0x4df90a['id'];if(_0x1a04d2['query'][_0xdd25('0x41')]){_0x2fb5fd[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x2fb5fd[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x2fb5fd['attributes'],function(_0x109fdb){var _0x1987d8={};_0x1987d8[_0x109fdb]={'$like':'%'+_0x1a04d2['query'][_0xdd25('0x41')]+'%'};return _0x1987d8;})});}_0x2fb5fd=_[_0xdd25('0x5d')]({},_0x2fb5fd,_0x1a04d2[_0xdd25('0x5e')]);return db['MailInteraction'][_0xdd25('0x25')]({'where':_0x2fb5fd['where']})[_0xdd25('0x15')](function(_0x1d9a65){_0x4a252b[_0xdd25('0x25')]=_0x1d9a65;if(_0x1a04d2[_0xdd25('0x45')][_0xdd25('0x46')]){_0x2fb5fd[_0xdd25('0x47')]=[{'all':!![]}];}return db[_0xdd25('0xe1')][_0xdd25('0x4c')](_0x2fb5fd);})[_0xdd25('0x15')](function(_0x5aed19){_0x4a252b[_0xdd25('0x4d')]=_0x5aed19;return _0x4a252b;});}})[_0xdd25('0x15')](respondWithFilteredResult(_0x59e499,_0x2fb5fd))['catch'](handleError(_0x59e499,null));};exports['getSmsInteractions']=function(_0x2e773b,_0x2b7603){var _0x388b20={};var _0xf986f3={};var _0x170ca3;var _0x131df9;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x2e773b['params']['id']}})['then'](handleEntityNotFound(_0x2b7603,null))[_0xdd25('0x15')](function(_0x2503df){if(_0x2503df){_0x170ca3=_0x2503df;_0xf986f3[_0xdd25('0x5a')]=_['keys'](db['SmsInteraction'][_0xdd25('0x3f')]);_0xf986f3[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x2e773b[_0xdd25('0x45')]);_0xf986f3[_0xdd25('0x58')]=_['intersection'](_0xf986f3[_0xdd25('0x5a')],_0xf986f3[_0xdd25('0x45')]);_0x388b20['attributes']=_[_0xdd25('0x59')](_0xf986f3[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x2e773b[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x388b20[_0xdd25('0x4a')]=_0x388b20[_0xdd25('0x4a')]['length']?_0x388b20['attributes']:_0xf986f3['model'];_0x388b20[_0xdd25('0xd3')]=qs['sort'](_0x2e773b[_0xdd25('0x45')]['sort']);_0x388b20[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x2e773b[_0xdd25('0x45')],_0xf986f3[_0xdd25('0x58')]));if(_0x2e773b[_0xdd25('0x45')][_0xdd25('0x41')]){_0x388b20[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x388b20['where'],{'$or':_['map'](_0x388b20['attributes'],function(_0x1ffad4){var _0x372ce9={};_0x372ce9[_0x1ffad4]={'$like':'%'+_0x2e773b['query'][_0xdd25('0x41')]+'%'};return _0x372ce9;})});}_0x388b20=_[_0xdd25('0x5d')]({},_0x388b20,_0x2e773b[_0xdd25('0x5e')]);return _0x170ca3[_0xdd25('0xe2')](_0x388b20);}})[_0xdd25('0x15')](function(_0x5b815e){if(_0x5b815e){_0x131df9=_0x5b815e[_0xdd25('0x4f')];if(!_0x2e773b['query'][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0x388b20[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0x2e773b[_0xdd25('0x45')][_0xdd25('0x26')]);_0x388b20['offset']=qs[_0xdd25('0x23')](_0x2e773b['query'][_0xdd25('0x23')]);}return _0x170ca3[_0xdd25('0xe2')](_0x388b20);}})['then'](function(_0x1ed6ac){if(_0x1ed6ac){return _0x1ed6ac?{'count':_0x131df9,'rows':_0x1ed6ac}:null;}})[_0xdd25('0x15')](respondWithResult(_0x2b7603,null))[_0xdd25('0x20')](handleError(_0x2b7603,null));};exports[_0xdd25('0xe3')]=function(_0x515ede,_0x2ed9fc){var _0x2da5f6={};var _0x43833f={};var _0xf8f26e;var _0x11a7b6;return db[_0xdd25('0x3e')]['findOne']({'where':{'id':_0x515ede[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x2ed9fc,null))[_0xdd25('0x15')](function(_0x47b76b){if(_0x47b76b){_0xf8f26e=_0x47b76b;_0x43833f['model']=_[_0xdd25('0x57')](db[_0xdd25('0xe4')][_0xdd25('0x3f')]);_0x43833f[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x515ede[_0xdd25('0x45')]);_0x43833f[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x43833f[_0xdd25('0x5a')],_0x43833f[_0xdd25('0x45')]);_0x2da5f6[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x43833f[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x515ede[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x2da5f6[_0xdd25('0x4a')]=_0x2da5f6['attributes']['length']?_0x2da5f6[_0xdd25('0x4a')]:_0x43833f['model'];_0x2da5f6[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x515ede[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x2da5f6[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x515ede[_0xdd25('0x45')],_0x43833f[_0xdd25('0x58')]));if(_0x515ede[_0xdd25('0x45')][_0xdd25('0x41')]){_0x2da5f6[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x2da5f6['where'],{'$or':_[_0xdd25('0x35')](_0x2da5f6[_0xdd25('0x4a')],function(_0x43bbf0){var _0xffdbe2={};_0xffdbe2[_0x43bbf0]={'$like':'%'+_0x515ede[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0xffdbe2;})});}_0x2da5f6=_[_0xdd25('0x5d')]({},_0x2da5f6,_0x515ede[_0xdd25('0x5e')]);return _0xf8f26e[_0xdd25('0xe3')](_0x2da5f6);}})[_0xdd25('0x15')](function(_0x308908){if(_0x308908){_0x11a7b6=_0x308908[_0xdd25('0x4f')];if(!_0x515ede['query']['hasOwnProperty'](_0xdd25('0xd8'))){_0x2da5f6['limit']=qs['limit'](_0x515ede['query']['limit']);_0x2da5f6[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x515ede[_0xdd25('0x45')]['offset']);}return _0xf8f26e[_0xdd25('0xe3')](_0x2da5f6);}})[_0xdd25('0x15')](function(_0x314f48){if(_0x314f48){return _0x314f48?{'count':_0x11a7b6,'rows':_0x314f48}:null;}})[_0xdd25('0x15')](respondWithResult(_0x2ed9fc,null))['catch'](handleError(_0x2ed9fc,null));};exports[_0xdd25('0xe5')]=function(_0x519375,_0x4a6b82){var _0x21a675={};var _0x2917ce={};var _0x21123c;var _0x5e3a12;return db['User'][_0xdd25('0x93')]({'where':{'id':_0x519375['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x4a6b82,null))[_0xdd25('0x15')](function(_0x2a99f1){if(_0x2a99f1){_0x21123c=_0x2a99f1;_0x2917ce[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db['WhatsappInteraction'][_0xdd25('0x3f')]);_0x2917ce[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x519375[_0xdd25('0x45')]);_0x2917ce[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x2917ce[_0xdd25('0x5a')],_0x2917ce[_0xdd25('0x45')]);_0x21a675[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x2917ce[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x519375['query'][_0xdd25('0x5b')]));_0x21a675[_0xdd25('0x4a')]=_0x21a675[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x21a675[_0xdd25('0x4a')]:_0x2917ce[_0xdd25('0x5a')];_0x21a675['order']=qs[_0xdd25('0xc8')](_0x519375['query']['sort']);_0x21a675[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x519375[_0xdd25('0x45')],_0x2917ce[_0xdd25('0x58')]));if(_0x519375[_0xdd25('0x45')][_0xdd25('0x41')]){_0x21a675[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x21a675[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x21a675['attributes'],function(_0x17c19f){var _0x42b229={};_0x42b229[_0x17c19f]={'$like':'%'+_0x519375[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x42b229;})});}_0x21a675=_[_0xdd25('0x5d')]({},_0x21a675,_0x519375[_0xdd25('0x5e')]);return _0x21123c[_0xdd25('0xe5')](_0x21a675);}})[_0xdd25('0x15')](function(_0x1a786e){if(_0x1a786e){_0x5e3a12=_0x1a786e[_0xdd25('0x4f')];if(!_0x519375[_0xdd25('0x45')]['hasOwnProperty']('nolimit')){_0x21a675['limit']=qs['limit'](_0x519375[_0xdd25('0x45')][_0xdd25('0x26')]);_0x21a675[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x519375[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x21123c[_0xdd25('0xe5')](_0x21a675);}})[_0xdd25('0x15')](function(_0x3f9d53){if(_0x3f9d53){return _0x3f9d53?{'count':_0x5e3a12,'rows':_0x3f9d53}:null;}})['then'](respondWithResult(_0x4a6b82,null))[_0xdd25('0x20')](handleError(_0x4a6b82,null));};exports['login']=function(_0x40e7ec,_0x33e1a1,_0x215f37){var _0xfa8145;var _0x31aeb2;var _0x432891;var _0x598d00=!_[_0xdd25('0x68')](_0x40e7ec[_0xdd25('0x60')]['id'])?_0x40e7ec[_0xdd25('0x60')]['id']:!_[_0xdd25('0x68')](_0x40e7ec[_0xdd25('0x2f')]['id'])?_0x40e7ec[_0xdd25('0x2f')]['id']:null;return db['User']['find']({'where':{'id':_0x598d00,'role':{'$or':[_0xdd25('0x2d'),_0xdd25('0x2f'),_0xdd25('0x31')]}},'attributes':['id','name',_0xdd25('0xe6'),_0xdd25('0xe7'),_0xdd25('0x2c'),_0xdd25('0x67'),_0xdd25('0xe8')]})['then'](function(_0x299ee0){if(_0x299ee0){if(_0x299ee0[_0xdd25('0x2c')]===_0xdd25('0x31')){_0xfa8145=_0x299ee0;if(_0x40e7ec[_0xdd25('0x5f')][_0xdd25('0xa5')]){_0x432891=util[_0xdd25('0xa6')](_0xdd25('0xe9'),_0xfa8145[_0x40e7ec[_0xdd25('0x5f')]['interface']]);}else if(_0x40e7ec['body'][_0xdd25('0xea')]){_0x432891=util[_0xdd25('0xa6')](_0xdd25('0xeb'),_0x40e7ec[_0xdd25('0x5f')][_0xdd25('0xea')]);}else{_0x432891=util['format'](_0xdd25('0xeb'),_0xfa8145[_0xdd25('0x39')]);}socket['to'](util[_0xdd25('0xa6')](_0xdd25('0xec'),_0xfa8145[_0xdd25('0x39')]))[_0xdd25('0xa0')](_0xdd25('0xed'),{'user':{'id':_0xfa8145['id'],'name':_0xfa8145[_0xdd25('0x39')]},'ip':_0x40e7ec[_0xdd25('0xee')]['x-forwarded-for']||_0x40e7ec[_0xdd25('0xef')][_0xdd25('0xf0')]||_0x40e7ec[_0xdd25('0xf1')]['remoteAddress']||_0x40e7ec[_0xdd25('0xef')][_0xdd25('0xf1')][_0xdd25('0xf0')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xfa8145[_0xdd25('0x39')]},'individualHooks':!![]});}}else{throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0xfa8145){return _0xfa8145['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x145730){if(_0xfa8145){var _0x5d4602=[];if(_0x145730){_0x31aeb2=_0x145730;if(_0x31aeb2['length']){for(var _0x1cf8eb=0x0;_0x1cf8eb<_0x31aeb2[_0xdd25('0x4f')];_0x1cf8eb++){_0x5d4602[_0xdd25('0x4b')]({'membername':_0xfa8145[_0xdd25('0x39')],'UserId':_0xfa8145['id'],'queue_name':_0x31aeb2[_0x1cf8eb][_0xdd25('0x39')],'VoiceQueueId':_0x31aeb2[_0x1cf8eb]['id'],'interface':_0x432891,'paused':_0xfa8145['loginInPause']||![],'penalty':_0x31aeb2[_0x1cf8eb][_0xdd25('0xf2')]||0x0});}return BPromise[_0xdd25('0x85')](_0x5d4602,function(_0x36ff30){return db[_0xdd25('0xa8')][_0xdd25('0xa9')](_0x36ff30);});}}}})['then'](function(){if(_0xfa8145){return db[_0xdd25('0xf3')][_0xdd25('0x4c')]({'where':{'membername':_0xfa8145[_0xdd25('0x39')],'exitAt':null}});}})['then'](function(_0x1e32bb){if(_0xfa8145){var _0x4b27c6=[];_0x1e32bb[_0xdd25('0xf4')](function(_0x6ecc50){_0x4b27c6[_0xdd25('0x4b')](_0x6ecc50[_0xdd25('0x29')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xdd25('0x84')](_0x4b27c6);}})[_0xdd25('0x15')](function(){if(_0xfa8145){var _0x3dc6a8=[];var _0xa4b9a7=[];var _0x31a36f=utils[_0xdd25('0xf5')]();var _0x1ff719={'membername':_0xfa8145[_0xdd25('0x39')],'interface':_0x432891,'enterAt':moment()[_0xdd25('0xa6')](_0xdd25('0xf6')),'role':_0xfa8145[_0xdd25('0x2c')],'internal':_0xfa8145[_0xdd25('0x67')]};_0x31a36f['forEach'](function(_0x2e3904){_0x3dc6a8['push'](_[_0xdd25('0x5d')]({'channel':_0x2e3904,'type':_0xdd25('0xf7'),'data1':_0x40e7ec[_0xdd25('0x5f')][_0xdd25('0xf8')],'data2':_0x432891},_0x1ff719));if(_0xfa8145[_0xdd25('0xe8')]){_0xa4b9a7['push'](_[_0xdd25('0x5d')]({'channel':_0x2e3904,'type':_0xdd25('0xf9'),'data1':_0xdd25('0xfa')},_0x1ff719));}});return db['MemberReport'][_0xdd25('0xfb')](_0x3dc6a8[_0xdd25('0xc7')](_0xa4b9a7),{'individualHooks':!![]});}})[_0xdd25('0x15')](function(){if(_0xfa8145){return _0xfa8145['update']({'online':!![],'lastLoginAt':moment()[_0xdd25('0xa6')](_0xdd25('0xf6')),'voicePause':_0xfa8145[_0xdd25('0xe8')]||![],'mailPause':_0xfa8145['loginInPause']||![],'chatPause':_0xfa8145[_0xdd25('0xe8')]||![],'faxPause':_0xfa8145[_0xdd25('0xe8')]||![],'smsPause':_0xfa8145[_0xdd25('0xe8')]||![],'openchannelPause':_0xfa8145[_0xdd25('0xe8')]||![],'whatsappPause':_0xfa8145[_0xdd25('0xe8')]||![],'pauseType':_0xfa8145[_0xdd25('0xe8')]?'LOGININPAUSE':null,'interface':_0x432891,'lastPauseAt':moment()[_0xdd25('0xa6')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xdd25('0x15')](function(_0x572632){if(_0x40e7ec[_0xdd25('0xfc')]){return _0x215f37();}else{return BPromise[_0xdd25('0xfd')](_0x572632)['then'](respondWithResult(_0x33e1a1,null));}})[_0xdd25('0x20')](handleError(_0x33e1a1,null));};exports['logout']=function(_0x353a35,_0x5b03de){var _0x1a1902;return db['User'][_0xdd25('0x38')]({'where':{'id':_0x353a35[_0xdd25('0x60')]['id'],'role':_0xdd25('0x31')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x5b03de,null))[_0xdd25('0x15')](function(_0x387ff1){if(_0x387ff1){_0x1a1902=_0x387ff1;return db['UserVoiceQueueRt'][_0xdd25('0x2a')]({'where':{'membername':_0x1a1902[_0xdd25('0x39')]},'individualHooks':!![]});}})['then'](function(){return db[_0xdd25('0xf3')][_0xdd25('0x4c')]({'where':{'membername':_0x1a1902[_0xdd25('0x39')],'exitAt':null}});})['then'](function(_0xf93d9b){var _0x40a09d=[];_0xf93d9b[_0xdd25('0xf4')](function(_0x10268c){_0x40a09d[_0xdd25('0x4b')](_0x10268c[_0xdd25('0x29')]({'exitAt':moment()[_0xdd25('0xa6')](_0xdd25('0xf6'))}));});return BPromise[_0xdd25('0x84')](_0x40a09d);})['then'](function(){return _0x1a1902['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xdd25('0x15')](respondWithResult(_0x5b03de,null))[_0xdd25('0x20')](handleError(_0x5b03de,null));};exports[_0xdd25('0xfe')]=function(_0x11f80c,_0x5c18eb){var _0x2307a0;return db[_0xdd25('0xa8')]['update']({'paused':0x1},{'where':{'UserId':_0x11f80c['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x11f80c[_0xdd25('0x60')]['id'],'role':_0xdd25('0x31')},'attributes':['id',_0xdd25('0x39'),_0xdd25('0x2c'),_0xdd25('0x67'),_0xdd25('0xa5')]});})['then'](handleEntityNotFound(_0x5c18eb,null))[_0xdd25('0x15')](function(_0x1f75bf){if(_0x1f75bf){_0x2307a0=_0x1f75bf;return respondWithRpcPromise(_0xdd25('0xff'),_0xdd25('0xfe'),{'id':_0x2307a0['id'],'name':_0x2307a0[_0xdd25('0x39')],'pause':!![]});}})[_0xdd25('0x15')](function(){if(_0x2307a0){return db[_0xdd25('0xf3')]['findAll']({'where':{'membername':_0x2307a0['name'],'type':'PAUSE','exitAt':null}});}})[_0xdd25('0x15')](function(_0x1539a1){if(_0x1539a1[_0xdd25('0x4f')]){var _0x474959=moment()[_0xdd25('0xa6')](_0xdd25('0xf6'));for(var _0x3c8f4c=0x0,_0x374805=_0x1539a1[_0xdd25('0x4f')];_0x3c8f4c<_0x374805;_0x3c8f4c++){_0x1539a1[_0x3c8f4c]['updateAttributes']({'exitAt':_0x474959});}}})[_0xdd25('0x15')](function(){var _0x4a495e=[];var _0x5501ed=utils[_0xdd25('0xf5')]();_0x5501ed['forEach'](function(_0xdbb0c1){_0x4a495e['push']({'channel':_0xdbb0c1,'membername':_0x2307a0[_0xdd25('0x39')],'interface':_['isNil'](_0x2307a0[_0xdd25('0xa5')])?util[_0xdd25('0xa6')](_0xdd25('0xeb'),_0x2307a0[_0xdd25('0x39')]):_0x2307a0[_0xdd25('0xa5')],'type':_0xdd25('0xf9'),'enterAt':moment()[_0xdd25('0xa6')](_0xdd25('0xf6')),'data1':_0x11f80c[_0xdd25('0x5f')][_0xdd25('0x100')]||_0xdd25('0x101'),'role':_0x2307a0['role'],'internal':_0x2307a0[_0xdd25('0x67')]});});return db[_0xdd25('0xf3')][_0xdd25('0xfb')](_0x4a495e,{'individualHooks':!![]});})[_0xdd25('0x15')](function(){return _0x2307a0[_0xdd25('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x11f80c[_0xdd25('0x5f')]['type']||_0xdd25('0x101'),'lastPauseAt':moment()[_0xdd25('0xa6')](_0xdd25('0xf6'))});})[_0xdd25('0x15')](respondWithResult(_0x5c18eb,null))[_0xdd25('0x20')](handleError(_0x5c18eb,null));};exports['unpause']=function(_0x27e9f4,_0x2d3d2f){var _0x109e5f;return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x27e9f4[_0xdd25('0x60')]['id']},'attributes':['id',_0xdd25('0x39'),_0xdd25('0x2c'),_0xdd25('0x99'),_0xdd25('0x102'),'chatPause','faxPause','openchannelPause',_0xdd25('0x103'),_0xdd25('0x104'),_0xdd25('0x105'),_0xdd25('0x106')]})[_0xdd25('0x15')](handleEntityNotFound(_0x2d3d2f,null))[_0xdd25('0x15')](function(_0x32bd9b){if(_0x32bd9b){_0x109e5f=_0x32bd9b;if(_0x27e9f4[_0xdd25('0x5f')][_0xdd25('0xab')]&&!utils['isValidChannel'](_0x27e9f4[_0xdd25('0x5f')][_0xdd25('0xab')])){throw new db[(_0xdd25('0x8d'))][(_0xdd25('0x8e'))](_0xdd25('0xac'));}switch(_0x27e9f4[_0xdd25('0x5f')]['channel']){case _0xdd25('0xa3'):return respondWithRpcPromise(_0xdd25('0xff'),_0xdd25('0x107'),{'id':_0x109e5f['id'],'name':_0x109e5f[_0xdd25('0x39')],'pause':![]})[_0xdd25('0x15')](function(){return db[_0xdd25('0xa8')][_0xdd25('0x29')]({'paused':0x0},{'where':{'UserId':_0x109e5f['id']},'individualHooks':!![]});})['then'](function(){return db[_0xdd25('0xf3')][_0xdd25('0x38')]({'where':{'channel':_0x27e9f4[_0xdd25('0x5f')][_0xdd25('0xab')],'membername':_0x109e5f[_0xdd25('0x39')],'type':_0xdd25('0xf9'),'exitAt':null}});})[_0xdd25('0x15')](function(_0x55b82e){if(_0x55b82e){return _0x55b82e[_0xdd25('0x29')]({'exitAt':moment()[_0xdd25('0xa6')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xdd25('0x108')},{'individualHooks':!![]});}return null;})[_0xdd25('0x15')](function(){return _0x109e5f['update']({'voicePause':![]});});case _0xdd25('0x53'):case _0xdd25('0x50'):case'fax':case _0xdd25('0x52'):case _0xdd25('0x55'):case _0xdd25('0x54'):return db[_0xdd25('0xf3')][_0xdd25('0x38')]({'where':{'channel':_0x27e9f4['body']['channel'],'membername':_0x109e5f[_0xdd25('0x39')],'type':_0xdd25('0xf9'),'exitAt':null}})[_0xdd25('0x15')](function(_0x2ed766){if(_0x2ed766){return _0x2ed766[_0xdd25('0x29')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xdd25('0x15')](function(){var _0x272463={};_['set'](_0x272463,util[_0xdd25('0xa6')](_0xdd25('0x109'),_0x27e9f4[_0xdd25('0x5f')][_0xdd25('0xab')],'Pause'),![]);return _0x109e5f[_0xdd25('0x29')](_0x272463);});default:return respondWithRpcPromise('QueuePause',_0xdd25('0x107'),{'id':_0x109e5f['id'],'name':_0x109e5f[_0xdd25('0x39')],'pause':![]})[_0xdd25('0x15')](function(){return db['UserVoiceQueueRt'][_0xdd25('0x29')]({'paused':0x0},{'where':{'UserId':_0x109e5f['id']}});})['then'](function(){return db[_0xdd25('0xf3')][_0xdd25('0x4c')]({'where':{'membername':_0x109e5f[_0xdd25('0x39')],'type':_0xdd25('0xf9'),'exitAt':null}});})[_0xdd25('0x15')](function(_0x3da19b){var _0x3b18a8=[];_0x3da19b[_0xdd25('0xf4')](function(_0xc69506){_0x3b18a8[_0xdd25('0x4b')](_0xc69506[_0xdd25('0x29')]({'exitAt':moment()['format'](_0xdd25('0xf6')),'data2':_0xdd25('0x108')}));});return BPromise[_0xdd25('0x84')](_0x3b18a8);})[_0xdd25('0x15')](function(){return _0x109e5f['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xdd25('0x15')](respondWithResult(_0x2d3d2f,null))[_0xdd25('0x20')](handleError(_0x2d3d2f,null));};exports[_0xdd25('0x10a')]=function(_0x44d21b,_0x163bea){var _0x49a928={};var _0x2a8472={};var _0x28d96d;var _0x5595ea;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x44d21b[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x163bea,null))[_0xdd25('0x15')](function(_0x1ec971){if(_0x1ec971){_0x28d96d=_0x1ec971;_0x2a8472['model']=_['keys'](db['Team'][_0xdd25('0x3f')]);_0x2a8472[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x44d21b[_0xdd25('0x45')]);_0x2a8472[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x2a8472[_0xdd25('0x5a')],_0x2a8472[_0xdd25('0x45')]);_0x49a928[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x2a8472[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x44d21b[_0xdd25('0x45')]['fields']));_0x49a928[_0xdd25('0x4a')]=_0x49a928['attributes'][_0xdd25('0x4f')]?_0x49a928[_0xdd25('0x4a')]:_0x2a8472[_0xdd25('0x5a')];_0x49a928[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x44d21b[_0xdd25('0x45')]['sort']);_0x49a928[_0xdd25('0xc9')]=qs['filters'](_[_0xdd25('0xd4')](_0x44d21b[_0xdd25('0x45')],_0x2a8472[_0xdd25('0x58')]));if(_0x44d21b[_0xdd25('0x45')][_0xdd25('0x41')]){_0x49a928[_0xdd25('0xc9')]=_['merge'](_0x49a928[_0xdd25('0xc9')],{'$or':_['map'](_0x49a928[_0xdd25('0x4a')],function(_0x24237b){var _0x3f2974={};_0x3f2974[_0x24237b]={'$like':'%'+_0x44d21b[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x3f2974;})});}_0x49a928=_[_0xdd25('0x5d')]({},_0x49a928,_0x44d21b[_0xdd25('0x5e')]);return _0x28d96d[_0xdd25('0x10a')](_0x49a928);}})['then'](function(_0x55d1a6){if(_0x55d1a6){_0x5595ea=_0x55d1a6[_0xdd25('0x4f')];if(!_0x44d21b['query'][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0x49a928[_0xdd25('0x26')]=qs['limit'](_0x44d21b[_0xdd25('0x45')][_0xdd25('0x26')]);_0x49a928['offset']=qs[_0xdd25('0x23')](_0x44d21b[_0xdd25('0x45')]['offset']);}return _0x28d96d[_0xdd25('0x10a')](_0x49a928);}})[_0xdd25('0x15')](function(_0x595816){if(_0x595816){return _0x595816?{'count':_0x5595ea,'rows':_0x595816}:null;}})[_0xdd25('0x15')](respondWithResult(_0x163bea,null))[_0xdd25('0x20')](handleError(_0x163bea,null));};exports['addTeams']=function(_0x1c56cb,_0x364ba1){return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x1c56cb[_0xdd25('0x60')]['id']}})['then'](handleEntityNotFound(_0x364ba1,null))['then'](function(_0x968c83){if(_0x968c83){var _0x2b05d0=_0x968c83['get']({'plain':!![]});return _0x968c83[_0xdd25('0x10b')](_0x1c56cb['body'][_0xdd25('0x62')],_['omit'](_0x1c56cb[_0xdd25('0x5f')],[_0xdd25('0x62'),'id'])||{})[_0xdd25('0x15')](function(){for(var _0x21c150=0x0;_0x21c150<_0x1c56cb['body']['ids'][_0xdd25('0x4f')];_0x21c150++){var _0x5f4a8f=[];var _0x4f3709={};db[_0xdd25('0x10c')][_0xdd25('0x93')]({'where':{'id':_0x1c56cb['body'][_0xdd25('0x62')][_0x21c150]}})[_0xdd25('0x15')](function(_0x43f634){_0x4f3709=_0x43f634[_0xdd25('0x51')];_0x5f4a8f[_0xdd25('0x4b')](_0x43f634['getVoiceQueues']()[_0xdd25('0x15')](function(_0x29e5c0){for(var _0x132228=0x0;_0x132228<_0x29e5c0['length'];_0x132228++){_0x29e5c0[_0x132228][_0xdd25('0x10d')](_0xdd25('0xab'),'Voice');}return _0x29e5c0;}));_0x5f4a8f[_0xdd25('0x4b')](_0x43f634['getChatQueues']()['then'](function(_0x229423){for(var _0x3a2e89=0x0;_0x3a2e89<_0x229423[_0xdd25('0x4f')];_0x3a2e89++){_0x229423[_0x3a2e89][_0xdd25('0x10d')](_0xdd25('0xab'),'Chat');}return _0x229423;}));_0x5f4a8f[_0xdd25('0x4b')](_0x43f634['getMailQueues']()[_0xdd25('0x15')](function(_0x53b9e3){for(var _0x20e9f0=0x0;_0x20e9f0<_0x53b9e3[_0xdd25('0x4f')];_0x20e9f0++){_0x53b9e3[_0x20e9f0]['setDataValue'](_0xdd25('0xab'),_0xdd25('0x10e'));}return _0x53b9e3;}));_0x5f4a8f[_0xdd25('0x4b')](_0x43f634['getSmsQueues']()[_0xdd25('0x15')](function(_0x2790e3){for(var _0x1c0853=0x0;_0x1c0853<_0x2790e3[_0xdd25('0x4f')];_0x1c0853++){_0x2790e3[_0x1c0853][_0xdd25('0x10d')](_0xdd25('0xab'),_0xdd25('0x10f'));}return _0x2790e3;}));_0x5f4a8f[_0xdd25('0x4b')](_0x43f634[_0xdd25('0x110')]()[_0xdd25('0x15')](function(_0x5a8528){for(var _0x244719=0x0;_0x244719<_0x5a8528[_0xdd25('0x4f')];_0x244719++){_0x5a8528[_0x244719]['setDataValue'](_0xdd25('0xab'),_0xdd25('0x111'));}return _0x5a8528;}));_0x5f4a8f[_0xdd25('0x4b')](_0x43f634[_0xdd25('0x112')]()[_0xdd25('0x15')](function(_0x2c4dd2){for(var _0x4e5d4c=0x0;_0x4e5d4c<_0x2c4dd2[_0xdd25('0x4f')];_0x4e5d4c++){_0x2c4dd2[_0x4e5d4c][_0xdd25('0x10d')](_0xdd25('0xab'),'Fax');}return _0x2c4dd2;}));_0x5f4a8f[_0xdd25('0x4b')](_0x43f634[_0xdd25('0x113')]()[_0xdd25('0x15')](function(_0x4c9331){for(var _0x7db990=0x0;_0x7db990<_0x4c9331['length'];_0x7db990++){_0x4c9331[_0x7db990][_0xdd25('0x10d')](_0xdd25('0xab'),_0xdd25('0x114'));}return _0x4c9331;}));return BPromise['all'](_0x5f4a8f);})[_0xdd25('0x15')](function(_0x565e1b){var _0x317be5=_[_0xdd25('0x115')](_0x565e1b);_0x5f4a8f=[];return db[_0xdd25('0x6a')][_0xdd25('0x116')](function(_0x27823d){for(var _0x1e9507=0x0;_0x1e9507<_0x317be5[_0xdd25('0x4f')];_0x1e9507++){_0x5f4a8f[_0xdd25('0x4b')](_0x317be5[_0x1e9507][_0xdd25('0x117')](_0x2b05d0['id']),{'transaction':_0x27823d});}return BPromise['all'](_0x5f4a8f)[_0xdd25('0x15')](function(){if(_0x2b05d0['online']){return BPromise[_0xdd25('0x85')](_[_0xdd25('0x41')](_0x317be5,function(_0x1558e7){return _0x1558e7['getDataValue'](_0xdd25('0xab'))==='Voice';}),function(_0x2c9f35){return db[_0xdd25('0xa8')][_0xdd25('0xa9')]({'membername':_0x2b05d0['name'],'UserId':_0x2b05d0['id'],'queue_name':_0x2c9f35[_0xdd25('0x39')],'VoiceQueueId':_0x2c9f35['id'],'interface':_['isNil'](_0x2b05d0[_0xdd25('0xa5')])?util[_0xdd25('0xa6')]('SIP/%s',_0x2b05d0['name']):_0x2b05d0[_0xdd25('0xa5')],'paused':_0x2b05d0[_0xdd25('0x99')]||![],'penalty':_0x2b05d0['penalty']},{'transaction':_0x27823d});});}else{return;}})['then'](function(){for(var _0xc7a89e=0x0;_0xc7a89e<_0x317be5[_0xdd25('0x4f')];_0xc7a89e++){var _0x2f7586=_0x317be5[_0xc7a89e][_0xdd25('0x118')](_0xdd25('0xab'));var _0x3a171b=_0x2f7586+_0xdd25('0x9f');socket['emit'](_0xdd25('0x2f')+_0x2f7586+_0xdd25('0xa1'),{'UserId':_0x2b05d0['id'],['queueField']:_0x317be5[_0xc7a89e]['id']});}});});})[_0xdd25('0x15')](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x4f3709['id']}})[_0xdd25('0x15')](function(_0x2d12d9){if(_0x2d12d9){db[_0xdd25('0x119')][_0xdd25('0x7d')]({'UserId':_0x1c56cb[_0xdd25('0x60')]['id'],'VoicePrefixId':_0x2d12d9[_0xdd25('0x11a')]});}});});}});}})[_0xdd25('0x15')](respondWithStatusCode(_0x364ba1,null))['catch'](handleError(_0x364ba1,null));};exports['removeTeams']=function(_0x28133f,_0x58c0de){return db[_0xdd25('0x3e')]['findOne']({'where':{'id':_0x28133f[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x58c0de,null))[_0xdd25('0x15')](function(_0x14d279){if(_0x14d279){var _0xaa3a45=_0x14d279[_0xdd25('0x2b')]({'plain':!![]});var _0x286dcf=_0x28133f[_0xdd25('0x45')][_0xdd25('0x62')];return _0x14d279[_0xdd25('0x11b')](_0x286dcf)[_0xdd25('0x15')](function(){for(var _0x133cd1=0x0;_0x133cd1<_0x286dcf['length'];_0x133cd1++){var _0x1e683e=[];var _0x435821={};db['Team'][_0xdd25('0x93')]({'where':{'id':_0x286dcf[_0x133cd1]}})['then'](function(_0x14615b){_0x435821=_0x14615b[_0xdd25('0x51')];_0x1e683e[_0xdd25('0x4b')](_0x14615b[_0xdd25('0x11c')]()[_0xdd25('0x15')](function(_0x4e4c58){for(var _0x4d8643=0x0;_0x4d8643<_0x4e4c58[_0xdd25('0x4f')];_0x4d8643++){_0x4e4c58[_0x4d8643]['setDataValue'](_0xdd25('0xab'),_0xdd25('0x11d'));}return _0x4e4c58;}));_0x1e683e[_0xdd25('0x4b')](_0x14615b[_0xdd25('0x11e')]()[_0xdd25('0x15')](function(_0xd63708){for(var _0x15402b=0x0;_0x15402b<_0xd63708[_0xdd25('0x4f')];_0x15402b++){_0xd63708[_0x15402b][_0xdd25('0x10d')](_0xdd25('0xab'),_0xdd25('0x11f'));}return _0xd63708;}));_0x1e683e['push'](_0x14615b[_0xdd25('0x120')]()[_0xdd25('0x15')](function(_0x5957e){for(var _0x3cd62c=0x0;_0x3cd62c<_0x5957e[_0xdd25('0x4f')];_0x3cd62c++){_0x5957e[_0x3cd62c][_0xdd25('0x10d')](_0xdd25('0xab'),_0xdd25('0x10e'));}return _0x5957e;}));_0x1e683e['push'](_0x14615b[_0xdd25('0x121')]()[_0xdd25('0x15')](function(_0x4e6f0d){for(var _0x18b948=0x0;_0x18b948<_0x4e6f0d[_0xdd25('0x4f')];_0x18b948++){_0x4e6f0d[_0x18b948]['setDataValue'](_0xdd25('0xab'),_0xdd25('0x10f'));}return _0x4e6f0d;}));_0x1e683e[_0xdd25('0x4b')](_0x14615b['getWhatsappQueues']()[_0xdd25('0x15')](function(_0x2306dc){for(var _0x427ca2=0x0;_0x427ca2<_0x2306dc[_0xdd25('0x4f')];_0x427ca2++){_0x2306dc[_0x427ca2][_0xdd25('0x10d')](_0xdd25('0xab'),_0xdd25('0x111'));}return _0x2306dc;}));_0x1e683e[_0xdd25('0x4b')](_0x14615b[_0xdd25('0x112')]()[_0xdd25('0x15')](function(_0x256abf){for(var _0x23236f=0x0;_0x23236f<_0x256abf[_0xdd25('0x4f')];_0x23236f++){_0x256abf[_0x23236f][_0xdd25('0x10d')](_0xdd25('0xab'),'Fax');}return _0x256abf;}));_0x1e683e[_0xdd25('0x4b')](_0x14615b['getOpenchannelQueues']()[_0xdd25('0x15')](function(_0x570c31){for(var _0x763475=0x0;_0x763475<_0x570c31[_0xdd25('0x4f')];_0x763475++){_0x570c31[_0x763475][_0xdd25('0x10d')](_0xdd25('0xab'),_0xdd25('0x114'));}return _0x570c31;}));return BPromise['all'](_0x1e683e);})[_0xdd25('0x15')](function(_0x1d1fc4){var _0xf29fb1=_[_0xdd25('0x115')](_0x1d1fc4);_0x1e683e=[];return db[_0xdd25('0x6a')][_0xdd25('0x116')](function(_0x39d61e){for(var _0x4a04dc=0x0;_0x4a04dc<_0xf29fb1[_0xdd25('0x4f')];_0x4a04dc++){_0x1e683e[_0xdd25('0x4b')](_0xf29fb1[_0x4a04dc][_0xdd25('0x122')](_0xaa3a45['id']),{'transaction':_0x39d61e});}return BPromise[_0xdd25('0x84')](_0x1e683e)['then'](function(){if(_0xaa3a45[_0xdd25('0xa4')]){return BPromise[_0xdd25('0x85')](_[_0xdd25('0x41')](_0xf29fb1,function(_0x4b512b){return _0x4b512b['getDataValue'](_0xdd25('0xab'))===_0xdd25('0x11d');}),function(_0xddc6f1){return db[_0xdd25('0xa8')][_0xdd25('0x2a')]({'where':{'VoiceQueueId':_0xddc6f1['id'],'UserId':_0xaa3a45['id']},'transaction':_0x39d61e});});}else{return;}})[_0xdd25('0x15')](function(){db[_0xdd25('0x123')][_0xdd25('0x93')]({'where':{'teamId':_0x435821['id']}})[_0xdd25('0x15')](function(_0x1a8c21){if(_0x1a8c21){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0xaa3a45['id'],'VoicePrefixId':_0x1a8c21['dataValues'][_0xdd25('0x11a')]}});}});})[_0xdd25('0x15')](function(){for(var _0x4a9b87=0x0;_0x4a9b87<_0xf29fb1[_0xdd25('0x4f')];_0x4a9b87++){var _0x502bc2=_0xf29fb1[_0x4a9b87]['getDataValue'](_0xdd25('0xab'));var _0x218b70=_0x502bc2+_0xdd25('0x9f');socket[_0xdd25('0xa0')](_0xdd25('0x2f')+_0x502bc2+_0xdd25('0xae'),{'UserId':_0xaa3a45['id'],['queueField']:_0xf29fb1[_0x4a9b87]['id']});}});});});}});}})[_0xdd25('0x15')](respondWithStatusCode(_0x58c0de,null))['catch'](handleError(_0x58c0de,null));};exports[_0xdd25('0x124')]=function(_0x2793c3,_0x22f01f){var _0xa4573c={};var _0x22d58b={};var _0x30e28e;var _0x1ac930;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x2793c3[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x22f01f,null))[_0xdd25('0x15')](function(_0x269e6e){if(_0x269e6e){_0x30e28e=_0x269e6e;_0x22d58b[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0xcc')]['rawAttributes']);_0x22d58b['query']=_[_0xdd25('0x57')](_0x2793c3[_0xdd25('0x45')]);_0x22d58b[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x22d58b[_0xdd25('0x5a')],_0x22d58b[_0xdd25('0x45')]);_0xa4573c['attributes']=_['intersection'](_0x22d58b[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x2793c3[_0xdd25('0x45')][_0xdd25('0x5b')]));_0xa4573c[_0xdd25('0x4a')]=_0xa4573c[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0xa4573c[_0xdd25('0x4a')]:_0x22d58b['model'];_0xa4573c['order']=qs[_0xdd25('0xc8')](_0x2793c3[_0xdd25('0x45')][_0xdd25('0xc8')]);_0xa4573c['where']=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x2793c3[_0xdd25('0x45')],_0x22d58b[_0xdd25('0x58')]));if(_0x2793c3['query']['filter']){_0xa4573c[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0xa4573c[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0xa4573c['attributes'],function(_0x30e09c){var _0x130655={};_0x130655[_0x30e09c]={'$like':'%'+_0x2793c3[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x130655;})});}_0xa4573c=_[_0xdd25('0x5d')]({},_0xa4573c,_0x2793c3['options']);return _0x30e28e['getLists'](_0xa4573c);}})[_0xdd25('0x15')](function(_0x15079a){if(_0x15079a){_0x1ac930=_0x15079a['length'];if(!_0x2793c3[_0xdd25('0x45')][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0xa4573c['limit']=qs[_0xdd25('0x26')](_0x2793c3[_0xdd25('0x45')]['limit']);_0xa4573c['offset']=qs['offset'](_0x2793c3['query'][_0xdd25('0x23')]);}return _0x30e28e[_0xdd25('0x124')](_0xa4573c);}})[_0xdd25('0x15')](function(_0x1ff0b2){if(_0x1ff0b2){return _0x1ff0b2?{'count':_0x1ac930,'rows':_0x1ff0b2}:null;}})['then'](respondWithResult(_0x22f01f,null))[_0xdd25('0x20')](handleError(_0x22f01f,null));};exports[_0xdd25('0x125')]=function(_0x4bfd91,_0x1a470f){var _0x1888ca={};var _0x140115={};var _0x3b02c3;return db[_0xdd25('0x3e')]['findOne']({'where':{'id':_0x4bfd91[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x1a470f,null))[_0xdd25('0x15')](function(_0xa97875){if(_0xa97875){_0x3b02c3=_0xa97875;_0x140115[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0x3e')][_0xdd25('0x3f')]);_0x140115[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x4bfd91[_0xdd25('0x45')]);_0x140115[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x140115[_0xdd25('0x5a')],_0x140115[_0xdd25('0x45')]);_0x1888ca[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x140115[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x4bfd91['query'][_0xdd25('0x5b')]));_0x1888ca[_0xdd25('0x4a')]=_0x1888ca['attributes']['length']?_0x1888ca['attributes']:_0x140115[_0xdd25('0x5a')];_0x1888ca[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x4bfd91[_0xdd25('0x45')]['sort']);_0x1888ca[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x4bfd91['query'],_0x140115[_0xdd25('0x58')]));if(_0x4bfd91[_0xdd25('0x45')][_0xdd25('0x41')]){_0x1888ca[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x1888ca[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x1888ca['attributes'],function(_0x2d7122){var _0x1d4d0a={};_0x1d4d0a[_0x2d7122]={'$like':'%'+_0x4bfd91['query']['filter']+'%'};return _0x1d4d0a;})});}_0x1888ca[_0xdd25('0x5a')]=db['User'];_0x1888ca['as']='Agents';_0x1888ca=_['merge']({},_0x1888ca,_0x4bfd91['options']);return _0x3b02c3[_0xdd25('0x11c')]({'include':[_0x1888ca]});}})[_0xdd25('0x15')](function(_0x385e7d){if(_0x385e7d){var _0x350ffa={},_0x410422=[];for(var _0xefbb60=0x0;_0xefbb60<_0x385e7d[_0xdd25('0x4f')];_0xefbb60+=0x1){for(var _0x1fe361=0x0,_0x4297ef;_0x1fe361<_0x385e7d[_0xefbb60][_0xdd25('0x30')][_0xdd25('0x4f')];_0x1fe361+=0x1){_0x4297ef=_0x385e7d[_0xefbb60][_0xdd25('0x30')][_0x1fe361]['get']({'plain':!![]});_0x350ffa[_0x4297ef['id']]=_0x4297ef;}}_0x350ffa=_['values'](_0x350ffa);for(var _0x404291=qs[_0xdd25('0x23')](_0x4bfd91[_0xdd25('0x45')][_0xdd25('0x23')]);_0x404291<_0x350ffa[_0xdd25('0x4f')]&&_0x410422[_0xdd25('0x4f')]<qs['limit'](_0x4bfd91[_0xdd25('0x45')]['limit']);_0x404291+=0x1){if(_0x350ffa[_0x404291]){_0x410422[_0xdd25('0x4b')](_0x350ffa[_0x404291]);}}return{'count':_0x350ffa['length'],'rows':_0x410422};}})[_0xdd25('0x15')](respondWithResult(_0x1a470f,null))[_0xdd25('0x20')](handleError(_0x1a470f,null));};exports['destroy']=function(_0x33302a,_0x4ec90f){if(_0x33302a[_0xdd25('0x2f')]['id']==_0x33302a[_0xdd25('0x60')]['id']){return _0x4ec90f[_0xdd25('0x22')](0x1f4)[_0xdd25('0x3c')]({'message':_0xdd25('0x126')});}return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x33302a['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x4ec90f,null))[_0xdd25('0x15')](removeEntity(_0x4ec90f,null))[_0xdd25('0x20')](handleError(_0x4ec90f,null));};exports[_0xdd25('0x127')]=function(_0x76ac55,_0x1fe7e1){return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x76ac55['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x1fe7e1,null))[_0xdd25('0x15')](function(_0x5f23f0){if(_0x5f23f0){return _0x5f23f0['addChatInteractions'](_0x76ac55[_0xdd25('0x5f')][_0xdd25('0x62')],_['omit'](_0x76ac55[_0xdd25('0x5f')],[_0xdd25('0x62'),'id'])||{})['spread'](function(){for(var _0x145c7b=0x0;_0x145c7b<_0x76ac55[_0xdd25('0x5f')][_0xdd25('0x62')][_0xdd25('0x4f')];_0x145c7b+=0x1){socket[_0xdd25('0xa0')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x76ac55[_0xdd25('0x5f')][_0xdd25('0x62')][_0x145c7b]),'UserId':Number(_0x76ac55[_0xdd25('0x60')]['id'])});}return _0x76ac55[_0xdd25('0x5f')][_0xdd25('0x62')];});}})[_0xdd25('0x15')](respondWithResult(_0x1fe7e1,null))[_0xdd25('0x20')](handleError(_0x1fe7e1,null));};exports[_0xdd25('0x128')]=function(_0x5acebc,_0x49cc59){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x5acebc[_0xdd25('0x60')]['id']}})['then'](handleEntityNotFound(_0x49cc59,null))[_0xdd25('0x15')](function(_0x1758c1){if(_0x1758c1){return _0x1758c1['removeChatInteractions'](_0x5acebc[_0xdd25('0x45')][_0xdd25('0x62')])['then'](function(){if(_[_0xdd25('0xad')](_0x5acebc[_0xdd25('0x45')][_0xdd25('0x62')])){for(var _0x5129d2=0x0;_0x5129d2<_0x5acebc[_0xdd25('0x45')][_0xdd25('0x62')][_0xdd25('0x4f')];_0x5129d2+=0x1){socket[_0xdd25('0xa0')](_0xdd25('0x129'),{'ChatInteractionId':Number(_0x5acebc[_0xdd25('0x45')][_0xdd25('0x62')][_0x5129d2]),'UserId':Number(_0x5acebc[_0xdd25('0x60')]['id'])});}}else{socket[_0xdd25('0xa0')](_0xdd25('0x129'),{'ChatInteractionId':Number(_0x5acebc['query'][_0xdd25('0x62')]),'UserId':Number(_0x5acebc[_0xdd25('0x60')]['id'])});}});}})[_0xdd25('0x15')](respondWithStatusCode(_0x49cc59,null))[_0xdd25('0x20')](handleError(_0x49cc59,null));};exports['addMailInteractions']=function(_0x1ec01,_0x4237fe){return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x1ec01[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x4237fe,null))[_0xdd25('0x15')](function(_0x427acb){if(_0x427acb){return _0x427acb['addMailInteractions'](_0x1ec01[_0xdd25('0x5f')][_0xdd25('0x62')],_['omit'](_0x1ec01[_0xdd25('0x5f')],['ids','id'])||{})[_0xdd25('0x12a')](function(){for(var _0x59fbf3=0x0;_0x59fbf3<_0x1ec01['body']['ids']['length'];_0x59fbf3+=0x1){socket[_0xdd25('0xa0')](_0xdd25('0x12b'),{'MailInteractionId':Number(_0x1ec01[_0xdd25('0x5f')][_0xdd25('0x62')][_0x59fbf3]),'UserId':Number(_0x1ec01[_0xdd25('0x60')]['id'])});}return _0x1ec01[_0xdd25('0x5f')][_0xdd25('0x62')];});}})[_0xdd25('0x15')](respondWithResult(_0x4237fe,null))[_0xdd25('0x20')](handleError(_0x4237fe,null));};exports[_0xdd25('0x12c')]=function(_0xf35b1a,_0x1475a9){return db['User'][_0xdd25('0x38')]({'where':{'id':_0xf35b1a[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x1475a9,null))[_0xdd25('0x15')](function(_0x591a80){if(_0x591a80){return _0x591a80[_0xdd25('0x12c')](_0xf35b1a[_0xdd25('0x45')]['ids'])[_0xdd25('0x15')](function(){if(_['isArray'](_0xf35b1a[_0xdd25('0x45')]['ids'])){for(var _0x1316c4=0x0;_0x1316c4<_0xf35b1a[_0xdd25('0x45')][_0xdd25('0x62')][_0xdd25('0x4f')];_0x1316c4+=0x1){socket[_0xdd25('0xa0')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xf35b1a[_0xdd25('0x45')][_0xdd25('0x62')][_0x1316c4]),'UserId':Number(_0xf35b1a[_0xdd25('0x60')]['id'])});}}else{socket[_0xdd25('0xa0')](_0xdd25('0x12d'),{'MailInteractionId':Number(_0xf35b1a[_0xdd25('0x45')][_0xdd25('0x62')]),'UserId':Number(_0xf35b1a[_0xdd25('0x60')]['id'])});}});}})[_0xdd25('0x15')](respondWithStatusCode(_0x1475a9,null))[_0xdd25('0x20')](handleError(_0x1475a9,null));};exports[_0xdd25('0x12e')]=function(_0x8e1662,_0x4df74a){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x8e1662[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x4df74a,null))['then'](function(_0x355ca2){if(_0x355ca2){return _0x355ca2[_0xdd25('0x12e')](_0x8e1662[_0xdd25('0x5f')][_0xdd25('0x62')],_[_0xdd25('0x63')](_0x8e1662[_0xdd25('0x5f')],['ids','id'])||{})[_0xdd25('0x12a')](function(){for(var _0xbc8787=0x0;_0xbc8787<_0x8e1662['body'][_0xdd25('0x62')]['length'];_0xbc8787+=0x1){socket[_0xdd25('0xa0')](_0xdd25('0x12f'),{'FaxInteractionId':Number(_0x8e1662[_0xdd25('0x5f')][_0xdd25('0x62')][_0xbc8787]),'UserId':Number(_0x8e1662[_0xdd25('0x60')]['id'])});}return _0x8e1662[_0xdd25('0x5f')]['ids'];});}})[_0xdd25('0x15')](respondWithResult(_0x4df74a,null))[_0xdd25('0x20')](handleError(_0x4df74a,null));};exports['removeFaxInteractions']=function(_0x550238,_0x5417c7){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x550238[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x5417c7,null))['then'](function(_0x4cd61d){if(_0x4cd61d){return _0x4cd61d[_0xdd25('0x130')](_0x550238[_0xdd25('0x45')][_0xdd25('0x62')])['then'](function(){if(_[_0xdd25('0xad')](_0x550238['query']['ids'])){for(var _0x350ced=0x0;_0x350ced<_0x550238['query'][_0xdd25('0x62')][_0xdd25('0x4f')];_0x350ced+=0x1){socket[_0xdd25('0xa0')](_0xdd25('0x131'),{'FaxInteractionId':Number(_0x550238[_0xdd25('0x45')][_0xdd25('0x62')][_0x350ced]),'UserId':Number(_0x550238[_0xdd25('0x60')]['id'])});}}else{socket[_0xdd25('0xa0')](_0xdd25('0x131'),{'FaxInteractionId':Number(_0x550238[_0xdd25('0x45')][_0xdd25('0x62')]),'UserId':Number(_0x550238[_0xdd25('0x60')]['id'])});}});}})[_0xdd25('0x15')](respondWithStatusCode(_0x5417c7,null))[_0xdd25('0x20')](handleError(_0x5417c7,null));};exports['addSmsInteractions']=function(_0x42ccdc,_0x9c689){return db['User'][_0xdd25('0x38')]({'where':{'id':_0x42ccdc['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x9c689,null))[_0xdd25('0x15')](function(_0x4bf5a2){if(_0x4bf5a2){return _0x4bf5a2[_0xdd25('0x132')](_0x42ccdc[_0xdd25('0x5f')][_0xdd25('0x62')],_[_0xdd25('0x63')](_0x42ccdc[_0xdd25('0x5f')],[_0xdd25('0x62'),'id'])||{})[_0xdd25('0x12a')](function(){for(var _0x533c3f=0x0;_0x533c3f<_0x42ccdc[_0xdd25('0x5f')][_0xdd25('0x62')][_0xdd25('0x4f')];_0x533c3f+=0x1){socket['emit'](_0xdd25('0x133'),{'SmsInteractionId':Number(_0x42ccdc[_0xdd25('0x5f')]['ids'][_0x533c3f]),'UserId':Number(_0x42ccdc[_0xdd25('0x60')]['id'])});}return _0x42ccdc[_0xdd25('0x5f')][_0xdd25('0x62')];});}})[_0xdd25('0x15')](respondWithResult(_0x9c689,null))['catch'](handleError(_0x9c689,null));};exports['removeSmsInteractions']=function(_0x286d34,_0x5bf054){return db['User'][_0xdd25('0x38')]({'where':{'id':_0x286d34[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x5bf054,null))[_0xdd25('0x15')](function(_0x1c7ae9){if(_0x1c7ae9){return _0x1c7ae9[_0xdd25('0x134')](_0x286d34['query'][_0xdd25('0x62')])['then'](function(){if(_[_0xdd25('0xad')](_0x286d34[_0xdd25('0x45')][_0xdd25('0x62')])){for(var _0x7b20a8=0x0;_0x7b20a8<_0x286d34['query'][_0xdd25('0x62')][_0xdd25('0x4f')];_0x7b20a8+=0x1){socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x286d34[_0xdd25('0x45')][_0xdd25('0x62')][_0x7b20a8]),'UserId':Number(_0x286d34[_0xdd25('0x60')]['id'])});}}else{socket[_0xdd25('0xa0')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x286d34[_0xdd25('0x45')][_0xdd25('0x62')]),'UserId':Number(_0x286d34[_0xdd25('0x60')]['id'])});}});}})[_0xdd25('0x15')](respondWithStatusCode(_0x5bf054,null))[_0xdd25('0x20')](handleError(_0x5bf054,null));};exports['addOpenchannelInteractions']=function(_0x243b16,_0xecae5e){return db['User']['find']({'where':{'id':_0x243b16[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0xecae5e,null))[_0xdd25('0x15')](function(_0x28c4ae){if(_0x28c4ae){return _0x28c4ae['addOpenchannelInteractions'](_0x243b16[_0xdd25('0x5f')]['ids'],_['omit'](_0x243b16['body'],['ids','id'])||{})[_0xdd25('0x12a')](function(){for(var _0x1f803e=0x0;_0x1f803e<_0x243b16[_0xdd25('0x5f')][_0xdd25('0x62')][_0xdd25('0x4f')];_0x1f803e+=0x1){socket['emit']('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x243b16[_0xdd25('0x5f')][_0xdd25('0x62')][_0x1f803e]),'UserId':Number(_0x243b16[_0xdd25('0x60')]['id'])});}return _0x243b16[_0xdd25('0x5f')][_0xdd25('0x62')];});}})[_0xdd25('0x15')](respondWithResult(_0xecae5e,null))[_0xdd25('0x20')](handleError(_0xecae5e,null));};exports[_0xdd25('0x135')]=function(_0x6c7b87,_0x522386){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x6c7b87[_0xdd25('0x60')]['id']}})['then'](handleEntityNotFound(_0x522386,null))[_0xdd25('0x15')](function(_0x180070){if(_0x180070){return _0x180070[_0xdd25('0x135')](_0x6c7b87[_0xdd25('0x45')][_0xdd25('0x62')])[_0xdd25('0x15')](function(){if(_[_0xdd25('0xad')](_0x6c7b87[_0xdd25('0x45')][_0xdd25('0x62')])){for(var _0x468e34=0x0;_0x468e34<_0x6c7b87[_0xdd25('0x45')][_0xdd25('0x62')][_0xdd25('0x4f')];_0x468e34+=0x1){socket[_0xdd25('0xa0')](_0xdd25('0x136'),{'OpenchannelInteractionId':Number(_0x6c7b87[_0xdd25('0x45')]['ids'][_0x468e34]),'UserId':Number(_0x6c7b87[_0xdd25('0x60')]['id'])});}}else{socket[_0xdd25('0xa0')](_0xdd25('0x136'),{'OpenchannelInteractionId':Number(_0x6c7b87[_0xdd25('0x45')][_0xdd25('0x62')]),'UserId':Number(_0x6c7b87[_0xdd25('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x522386,null))[_0xdd25('0x20')](handleError(_0x522386,null));};exports[_0xdd25('0x137')]=function(_0x43327b,_0x25889e){return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x43327b[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x25889e,null))[_0xdd25('0x15')](function(_0x17b8ff){if(_0x17b8ff){return _0x17b8ff[_0xdd25('0x137')](_0x43327b[_0xdd25('0x5f')][_0xdd25('0x62')],_[_0xdd25('0x63')](_0x43327b[_0xdd25('0x5f')],['ids','id'])||{})[_0xdd25('0x12a')](function(){for(var _0x34ce7d=0x0;_0x34ce7d<_0x43327b['body'][_0xdd25('0x62')][_0xdd25('0x4f')];_0x34ce7d+=0x1){socket[_0xdd25('0xa0')](_0xdd25('0x138'),{'WhatsappInteractionId':Number(_0x43327b['body']['ids'][_0x34ce7d]),'UserId':Number(_0x43327b[_0xdd25('0x60')]['id'])});}return _0x43327b['body'][_0xdd25('0x62')];});}})['then'](respondWithResult(_0x25889e,null))[_0xdd25('0x20')](handleError(_0x25889e,null));};exports['removeWhatsappInteractions']=function(_0x12a8b1,_0x57a026){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x12a8b1[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x57a026,null))['then'](function(_0x496398){if(_0x496398){return _0x496398[_0xdd25('0x139')](_0x12a8b1[_0xdd25('0x45')][_0xdd25('0x62')]);}})[_0xdd25('0x15')](respondWithStatusCode(_0x57a026,null))[_0xdd25('0x20')](handleError(_0x57a026,null));};exports[_0xdd25('0x13a')]=function(_0x592ebb,_0x3c3e6c){var _0x1077c6={};var _0x2143b4={};var _0x36ea9b;var _0x5d18b7;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x592ebb[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x3c3e6c,null))['then'](function(_0x3d9520){if(_0x3d9520){_0x36ea9b=_0x3d9520;_0x2143b4[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0x13b')][_0xdd25('0x3f')]);_0x2143b4[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x592ebb[_0xdd25('0x45')]);_0x2143b4[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x2143b4[_0xdd25('0x5a')],_0x2143b4[_0xdd25('0x45')]);_0x1077c6[_0xdd25('0x4a')]=_['intersection'](_0x2143b4['model'],qs[_0xdd25('0x5b')](_0x592ebb[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x1077c6[_0xdd25('0x4a')]=_0x1077c6['attributes']['length']?_0x1077c6[_0xdd25('0x4a')]:_0x2143b4[_0xdd25('0x5a')];_0x1077c6[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x592ebb[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x1077c6['where']=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x592ebb['query'],_0x2143b4[_0xdd25('0x58')]));if(_0x592ebb[_0xdd25('0x45')]['filter']){_0x1077c6['where']=_[_0xdd25('0x5d')](_0x1077c6['where'],{'$or':_[_0xdd25('0x35')](_0x1077c6[_0xdd25('0x4a')],function(_0x433289){var _0x4bac05={};_0x4bac05[_0x433289]={'$like':'%'+_0x592ebb['query'][_0xdd25('0x41')]+'%'};return _0x4bac05;})});}_0x1077c6=_['merge']({},_0x1077c6,_0x592ebb[_0xdd25('0x5e')]);return _0x36ea9b['getVoicePrefixes'](_0x1077c6);}})[_0xdd25('0x15')](function(_0x2feb81){if(_0x2feb81){_0x5d18b7=_0x2feb81[_0xdd25('0x4f')];if(!_0x592ebb[_0xdd25('0x45')]['hasOwnProperty']('nolimit')){_0x1077c6[_0xdd25('0x26')]=qs['limit'](_0x592ebb[_0xdd25('0x45')]['limit']);_0x1077c6[_0xdd25('0x23')]=qs['offset'](_0x592ebb[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x36ea9b[_0xdd25('0x13a')](_0x1077c6);}})[_0xdd25('0x15')](function(_0x2b3806){if(_0x2b3806){return _0x2b3806?{'count':_0x5d18b7,'rows':_0x2b3806}:null;}})[_0xdd25('0x15')](respondWithResult(_0x3c3e6c,null))[_0xdd25('0x20')](handleError(_0x3c3e6c,null));};exports[_0xdd25('0x13c')]=function(_0x14a25,_0x4157e2){var _0x25676d={};var _0x2475d7={};var _0x229dde;var _0x1c8008;return db['User']['findOne']({'where':{'id':_0x14a25[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x4157e2,null))[_0xdd25('0x15')](function(_0x22796b){if(_0x22796b){_0x229dde=_0x22796b;_0x2475d7[_0xdd25('0x5a')]=_['keys'](db[_0xdd25('0x13d')]['rawAttributes']);_0x2475d7[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x14a25[_0xdd25('0x45')]);_0x2475d7[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x2475d7['model'],_0x2475d7[_0xdd25('0x45')]);_0x25676d['attributes']=_['intersection'](_0x2475d7[_0xdd25('0x5a')],qs['fields'](_0x14a25[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x25676d[_0xdd25('0x4a')]=_0x25676d[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x25676d[_0xdd25('0x4a')]:_0x2475d7[_0xdd25('0x5a')];_0x25676d[_0xdd25('0xd3')]=qs['sort'](_0x14a25[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x25676d[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x14a25[_0xdd25('0x45')],_0x2475d7['filters']));if(_0x14a25['query'][_0xdd25('0x41')]){_0x25676d['where']=_[_0xdd25('0x5d')](_0x25676d[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x25676d[_0xdd25('0x4a')],function(_0x45dc57){var _0x21d9bf={};_0x21d9bf[_0x45dc57]={'$like':'%'+_0x14a25[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x21d9bf;})});}_0x25676d=_[_0xdd25('0x5d')]({},_0x25676d,_0x14a25[_0xdd25('0x5e')]);return _0x229dde[_0xdd25('0x13c')](_0x25676d);}})[_0xdd25('0x15')](function(_0x59536a){if(_0x59536a){_0x1c8008=_0x59536a['length'];if(!_0x14a25['query']['hasOwnProperty'](_0xdd25('0xd8'))){_0x25676d[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0x14a25[_0xdd25('0x45')][_0xdd25('0x26')]);_0x25676d['offset']=qs[_0xdd25('0x23')](_0x14a25[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x229dde['getFaxAccounts'](_0x25676d);}})[_0xdd25('0x15')](function(_0x1bbdac){if(_0x1bbdac){return _0x1bbdac?{'count':_0x1c8008,'rows':_0x1bbdac}:null;}})[_0xdd25('0x15')](respondWithResult(_0x4157e2,null))[_0xdd25('0x20')](handleError(_0x4157e2,null));};exports['addFaxAccounts']=function(_0x281495,_0x55c71b){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x281495[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x55c71b,null))[_0xdd25('0x15')](function(_0x457360){if(_0x457360){return _0x457360[_0xdd25('0x13e')](_0x281495[_0xdd25('0x5f')][_0xdd25('0x62')],_[_0xdd25('0x63')](_0x281495[_0xdd25('0x5f')],['ids','id'])||{});}})[_0xdd25('0x15')](respondWithResult(_0x55c71b,null))['catch'](handleError(_0x55c71b,null));};exports[_0xdd25('0x13f')]=function(_0x36ea83,_0x3a79dd){return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x36ea83[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x3a79dd,null))[_0xdd25('0x15')](function(_0x46dfa5){if(_0x46dfa5){return _0x46dfa5[_0xdd25('0x13f')](_0x36ea83[_0xdd25('0x45')][_0xdd25('0x62')]);}})[_0xdd25('0x15')](respondWithStatusCode(_0x3a79dd,null))[_0xdd25('0x20')](handleError(_0x3a79dd,null));};exports[_0xdd25('0x140')]=function(_0x21122f,_0x145949){var _0x4591cc={};var _0x4e7a27={};var _0x1d9c1f;var _0x56f50e;return db['User']['findOne']({'where':{'id':_0x21122f['params']['id']}})['then'](handleEntityNotFound(_0x145949,null))['then'](function(_0x473356){if(_0x473356){_0x1d9c1f=_0x473356;_0x4e7a27[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0x141')]['rawAttributes']);_0x4e7a27['query']=_[_0xdd25('0x57')](_0x21122f['query']);_0x4e7a27[_0xdd25('0x58')]=_['intersection'](_0x4e7a27[_0xdd25('0x5a')],_0x4e7a27['query']);_0x4591cc[_0xdd25('0x4a')]=_['intersection'](_0x4e7a27['model'],qs[_0xdd25('0x5b')](_0x21122f['query']['fields']));_0x4591cc[_0xdd25('0x4a')]=_0x4591cc[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x4591cc[_0xdd25('0x4a')]:_0x4e7a27[_0xdd25('0x5a')];_0x4591cc[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x21122f[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x4591cc['where']=qs[_0xdd25('0x58')](_['pick'](_0x21122f['query'],_0x4e7a27['filters']));if(_0x21122f[_0xdd25('0x45')]['filter']){_0x4591cc[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x4591cc['where'],{'$or':_[_0xdd25('0x35')](_0x4591cc['attributes'],function(_0x1f1bcb){var _0x1a4cd3={};_0x1a4cd3[_0x1f1bcb]={'$like':'%'+_0x21122f[_0xdd25('0x45')]['filter']+'%'};return _0x1a4cd3;})});}_0x4591cc=_['merge']({},_0x4591cc,_0x21122f[_0xdd25('0x5e')]);return _0x1d9c1f['getMailAccounts'](_0x4591cc);}})[_0xdd25('0x15')](function(_0xc078d5){if(_0xc078d5){_0x56f50e=_0xc078d5[_0xdd25('0x4f')];if(!_0x21122f[_0xdd25('0x45')][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0x4591cc['limit']=qs[_0xdd25('0x26')](_0x21122f['query'][_0xdd25('0x26')]);_0x4591cc[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x21122f['query'][_0xdd25('0x23')]);}return _0x1d9c1f['getMailAccounts'](_0x4591cc);}})['then'](function(_0x37bac6){if(_0x37bac6){return _0x37bac6?{'count':_0x56f50e,'rows':_0x37bac6}:null;}})[_0xdd25('0x15')](respondWithResult(_0x145949,null))[_0xdd25('0x20')](handleError(_0x145949,null));};exports[_0xdd25('0x142')]=function(_0x5ea6af,_0x5ac084){return db['User'][_0xdd25('0x38')]({'where':{'id':_0x5ea6af[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x5ac084,null))['then'](function(_0x2d6521){if(_0x2d6521){return _0x2d6521['addMailAccounts'](_0x5ea6af[_0xdd25('0x5f')][_0xdd25('0x62')],_[_0xdd25('0x63')](_0x5ea6af[_0xdd25('0x5f')],[_0xdd25('0x62'),'id'])||{});}})[_0xdd25('0x15')](respondWithResult(_0x5ac084,null))[_0xdd25('0x20')](handleError(_0x5ac084,null));};exports['removeMailAccounts']=function(_0x31bd53,_0x538af4){return db['User'][_0xdd25('0x38')]({'where':{'id':_0x31bd53[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x538af4,null))[_0xdd25('0x15')](function(_0x462295){if(_0x462295){return _0x462295[_0xdd25('0x143')](_0x31bd53[_0xdd25('0x45')][_0xdd25('0x62')]);}})['then'](respondWithStatusCode(_0x538af4,null))[_0xdd25('0x20')](handleError(_0x538af4,null));};exports[_0xdd25('0x144')]=function(_0x5eaad6,_0x38ec88){var _0x1478d5={};var _0x264550={};var _0xedb32;var _0x3ad377;return db['User']['findOne']({'where':{'id':_0x5eaad6[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x38ec88,null))['then'](function(_0x182def){if(_0x182def){_0xedb32=_0x182def;_0x264550[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0x145')][_0xdd25('0x3f')]);_0x264550[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x5eaad6['query']);_0x264550[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x264550[_0xdd25('0x5a')],_0x264550[_0xdd25('0x45')]);_0x1478d5['attributes']=_[_0xdd25('0x59')](_0x264550['model'],qs[_0xdd25('0x5b')](_0x5eaad6['query'][_0xdd25('0x5b')]));_0x1478d5[_0xdd25('0x4a')]=_0x1478d5[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x1478d5[_0xdd25('0x4a')]:_0x264550[_0xdd25('0x5a')];_0x1478d5['order']=qs['sort'](_0x5eaad6[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x1478d5[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x5eaad6[_0xdd25('0x45')],_0x264550[_0xdd25('0x58')]));if(_0x5eaad6['query'][_0xdd25('0x41')]){_0x1478d5[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x1478d5[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x1478d5['attributes'],function(_0x44ac82){var _0x240f7a={};_0x240f7a[_0x44ac82]={'$like':'%'+_0x5eaad6[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x240f7a;})});}_0x1478d5=_['merge']({},_0x1478d5,_0x5eaad6[_0xdd25('0x5e')]);return _0xedb32[_0xdd25('0x144')](_0x1478d5);}})[_0xdd25('0x15')](function(_0x3820d4){if(_0x3820d4){_0x3ad377=_0x3820d4[_0xdd25('0x4f')];if(!_0x5eaad6[_0xdd25('0x45')][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0x1478d5[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0x5eaad6[_0xdd25('0x45')][_0xdd25('0x26')]);_0x1478d5[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x5eaad6['query'][_0xdd25('0x23')]);}return _0xedb32['getOpenchannelAccounts'](_0x1478d5);}})['then'](function(_0x34ed44){if(_0x34ed44){return _0x34ed44?{'count':_0x3ad377,'rows':_0x34ed44}:null;}})[_0xdd25('0x15')](respondWithResult(_0x38ec88,null))[_0xdd25('0x20')](handleError(_0x38ec88,null));};exports[_0xdd25('0x146')]=function(_0x5ce2ab,_0xaf42a5){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x5ce2ab[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0xaf42a5,null))[_0xdd25('0x15')](function(_0x4528a6){if(_0x4528a6){return _0x4528a6['addOpenchannelAccounts'](_0x5ce2ab[_0xdd25('0x5f')]['ids'],_[_0xdd25('0x63')](_0x5ce2ab[_0xdd25('0x5f')],[_0xdd25('0x62'),'id'])||{});}})[_0xdd25('0x15')](respondWithResult(_0xaf42a5,null))['catch'](handleError(_0xaf42a5,null));};exports[_0xdd25('0x147')]=function(_0x42ede2,_0x471a71){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x42ede2['params']['id']}})['then'](handleEntityNotFound(_0x471a71,null))['then'](function(_0x36973d){if(_0x36973d){return _0x36973d['removeOpenchannelAccounts'](_0x42ede2[_0xdd25('0x45')]['ids']);}})[_0xdd25('0x15')](respondWithStatusCode(_0x471a71,null))['catch'](handleError(_0x471a71,null));};exports['getSmsAccounts']=function(_0x21682d,_0x4af7c9){var _0x31cec4={};var _0x411e83={};var _0x1b9203;var _0x5a5768;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x21682d['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x4af7c9,null))[_0xdd25('0x15')](function(_0x35c86f){if(_0x35c86f){_0x1b9203=_0x35c86f;_0x411e83[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db['SmsAccount'][_0xdd25('0x3f')]);_0x411e83['query']=_[_0xdd25('0x57')](_0x21682d[_0xdd25('0x45')]);_0x411e83[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x411e83[_0xdd25('0x5a')],_0x411e83[_0xdd25('0x45')]);_0x31cec4[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x411e83['model'],qs[_0xdd25('0x5b')](_0x21682d[_0xdd25('0x45')]['fields']));_0x31cec4[_0xdd25('0x4a')]=_0x31cec4[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x31cec4[_0xdd25('0x4a')]:_0x411e83[_0xdd25('0x5a')];_0x31cec4[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x21682d[_0xdd25('0x45')]['sort']);_0x31cec4[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_['pick'](_0x21682d[_0xdd25('0x45')],_0x411e83[_0xdd25('0x58')]));if(_0x21682d[_0xdd25('0x45')][_0xdd25('0x41')]){_0x31cec4[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x31cec4['where'],{'$or':_[_0xdd25('0x35')](_0x31cec4[_0xdd25('0x4a')],function(_0x5f2cfa){var _0x3e1c86={};_0x3e1c86[_0x5f2cfa]={'$like':'%'+_0x21682d[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x3e1c86;})});}_0x31cec4=_[_0xdd25('0x5d')]({},_0x31cec4,_0x21682d[_0xdd25('0x5e')]);return _0x1b9203[_0xdd25('0x148')](_0x31cec4);}})['then'](function(_0x3e8843){if(_0x3e8843){_0x5a5768=_0x3e8843[_0xdd25('0x4f')];if(!_0x21682d['query']['hasOwnProperty']('nolimit')){_0x31cec4[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0x21682d[_0xdd25('0x45')][_0xdd25('0x26')]);_0x31cec4[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x21682d[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x1b9203[_0xdd25('0x148')](_0x31cec4);}})[_0xdd25('0x15')](function(_0x4faced){if(_0x4faced){return _0x4faced?{'count':_0x5a5768,'rows':_0x4faced}:null;}})['then'](respondWithResult(_0x4af7c9,null))[_0xdd25('0x20')](handleError(_0x4af7c9,null));};exports[_0xdd25('0x149')]=function(_0x415ec,_0x3c50c1){return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x415ec['params']['id']}})['then'](handleEntityNotFound(_0x3c50c1,null))[_0xdd25('0x15')](function(_0x17ddc4){if(_0x17ddc4){return _0x17ddc4[_0xdd25('0x149')](_0x415ec[_0xdd25('0x5f')]['ids'],_[_0xdd25('0x63')](_0x415ec['body'],['ids','id'])||{});}})[_0xdd25('0x15')](respondWithResult(_0x3c50c1,null))[_0xdd25('0x20')](handleError(_0x3c50c1,null));};exports['removeSmsAccounts']=function(_0x142a1c,_0x54f048){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x142a1c[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x54f048,null))[_0xdd25('0x15')](function(_0x68ca4d){if(_0x68ca4d){return _0x68ca4d[_0xdd25('0x14a')](_0x142a1c[_0xdd25('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x54f048,null))[_0xdd25('0x20')](handleError(_0x54f048,null));};exports['getChatWebsites']=function(_0x110a86,_0x1621cb){var _0x3290ae={};var _0x76c85={};var _0x5665d4;var _0x427836;return db[_0xdd25('0x3e')]['findOne']({'where':{'id':_0x110a86[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x1621cb,null))['then'](function(_0x269df6){if(_0x269df6){_0x5665d4=_0x269df6;_0x76c85[_0xdd25('0x5a')]=_['keys'](db[_0xdd25('0x14b')][_0xdd25('0x3f')]);_0x76c85[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x110a86[_0xdd25('0x45')]);_0x76c85[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x76c85[_0xdd25('0x5a')],_0x76c85[_0xdd25('0x45')]);_0x3290ae[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x76c85[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x110a86['query'][_0xdd25('0x5b')]));_0x3290ae[_0xdd25('0x4a')]=_0x3290ae[_0xdd25('0x4a')]['length']?_0x3290ae[_0xdd25('0x4a')]:_0x76c85['model'];_0x3290ae[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x110a86[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x3290ae[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x110a86['query'],_0x76c85[_0xdd25('0x58')]));if(_0x110a86[_0xdd25('0x45')][_0xdd25('0x41')]){_0x3290ae['where']=_[_0xdd25('0x5d')](_0x3290ae[_0xdd25('0xc9')],{'$or':_['map'](_0x3290ae[_0xdd25('0x4a')],function(_0x13c1a8){var _0x1f9fef={};_0x1f9fef[_0x13c1a8]={'$like':'%'+_0x110a86[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x1f9fef;})});}_0x3290ae=_[_0xdd25('0x5d')]({},_0x3290ae,_0x110a86['options']);return _0x5665d4['getChatWebsites'](_0x3290ae);}})[_0xdd25('0x15')](function(_0x306659){if(_0x306659){_0x427836=_0x306659[_0xdd25('0x4f')];if(!_0x110a86[_0xdd25('0x45')][_0xdd25('0xcb')]('nolimit')){_0x3290ae[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0x110a86['query'][_0xdd25('0x26')]);_0x3290ae[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x110a86[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x5665d4[_0xdd25('0x14c')](_0x3290ae);}})[_0xdd25('0x15')](function(_0x36987c){if(_0x36987c){return _0x36987c?{'count':_0x427836,'rows':_0x36987c}:null;}})[_0xdd25('0x15')](respondWithResult(_0x1621cb,null))['catch'](handleError(_0x1621cb,null));};exports['addChatWebsites']=function(_0x44f584,_0xafb21c){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x44f584[_0xdd25('0x60')]['id']}})['then'](handleEntityNotFound(_0xafb21c,null))[_0xdd25('0x15')](function(_0x571484){if(_0x571484){return _0x571484[_0xdd25('0x14d')](_0x44f584['body'][_0xdd25('0x62')],_['omit'](_0x44f584[_0xdd25('0x5f')],[_0xdd25('0x62'),'id'])||{});}})[_0xdd25('0x15')](respondWithResult(_0xafb21c,null))['catch'](handleError(_0xafb21c,null));};exports[_0xdd25('0x14e')]=function(_0x49c411,_0x10a0df){return db['User'][_0xdd25('0x38')]({'where':{'id':_0x49c411['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x10a0df,null))[_0xdd25('0x15')](function(_0x58da6d){if(_0x58da6d){return _0x58da6d[_0xdd25('0x14e')](_0x49c411['query']['ids']);}})[_0xdd25('0x15')](respondWithStatusCode(_0x10a0df,null))['catch'](handleError(_0x10a0df,null));};exports[_0xdd25('0x14f')]=function(_0x533e36,_0x299447){var _0x579c4d={};var _0x3a062d={};var _0x1b58e7;var _0x163786;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x533e36['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x299447,null))[_0xdd25('0x15')](function(_0x1e293e){if(_0x1e293e){_0x1b58e7=_0x1e293e;_0x3a062d[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0x150')][_0xdd25('0x3f')]);_0x3a062d[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x533e36[_0xdd25('0x45')]);_0x3a062d[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x3a062d[_0xdd25('0x5a')],_0x3a062d[_0xdd25('0x45')]);_0x579c4d[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x3a062d[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x533e36['query']['fields']));_0x579c4d['attributes']=_0x579c4d[_0xdd25('0x4a')]['length']?_0x579c4d[_0xdd25('0x4a')]:_0x3a062d['model'];_0x579c4d[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x533e36[_0xdd25('0x45')][_0xdd25('0xc8')]);_0x579c4d[_0xdd25('0xc9')]=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x533e36[_0xdd25('0x45')],_0x3a062d['filters']));if(_0x533e36[_0xdd25('0x45')]['filter']){_0x579c4d[_0xdd25('0xc9')]=_[_0xdd25('0x5d')](_0x579c4d[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x579c4d[_0xdd25('0x4a')],function(_0x3eeb30){var _0x244608={};_0x244608[_0x3eeb30]={'$like':'%'+_0x533e36[_0xdd25('0x45')]['filter']+'%'};return _0x244608;})});}_0x579c4d=_[_0xdd25('0x5d')]({},_0x579c4d,_0x533e36[_0xdd25('0x5e')]);return _0x1b58e7['getWhatsappAccounts'](_0x579c4d);}})[_0xdd25('0x15')](function(_0x20122f){if(_0x20122f){_0x163786=_0x20122f[_0xdd25('0x4f')];if(!_0x533e36[_0xdd25('0x45')][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0x579c4d[_0xdd25('0x26')]=qs['limit'](_0x533e36[_0xdd25('0x45')][_0xdd25('0x26')]);_0x579c4d[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x533e36[_0xdd25('0x45')][_0xdd25('0x23')]);}return _0x1b58e7[_0xdd25('0x14f')](_0x579c4d);}})[_0xdd25('0x15')](function(_0x31d686){if(_0x31d686){return _0x31d686?{'count':_0x163786,'rows':_0x31d686}:null;}})[_0xdd25('0x15')](respondWithResult(_0x299447,null))[_0xdd25('0x20')](handleError(_0x299447,null));};exports[_0xdd25('0x151')]=function(_0x178f30,_0x455d93){return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x178f30[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x455d93,null))[_0xdd25('0x15')](function(_0x48acb3){if(_0x48acb3){return _0x48acb3[_0xdd25('0x151')](_0x178f30['body'][_0xdd25('0x62')],_[_0xdd25('0x63')](_0x178f30[_0xdd25('0x5f')],[_0xdd25('0x62'),'id'])||{});}})[_0xdd25('0x15')](respondWithResult(_0x455d93,null))[_0xdd25('0x20')](handleError(_0x455d93,null));};exports['removeWhatsappAccounts']=function(_0x40f540,_0x55ad9f){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x40f540[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x55ad9f,null))[_0xdd25('0x15')](function(_0x2f0b01){if(_0x2f0b01){return _0x2f0b01[_0xdd25('0x152')](_0x40f540[_0xdd25('0x45')][_0xdd25('0x62')]);}})[_0xdd25('0x15')](respondWithStatusCode(_0x55ad9f,null))[_0xdd25('0x20')](handleError(_0x55ad9f,null));};exports[_0xdd25('0x153')]=function(_0x584717,_0xa0cf31){var _0x5eadad={};var _0x1afa5a={};var _0x21c337;var _0x191c64;return db[_0xdd25('0x3e')][_0xdd25('0x93')]({'where':{'id':_0x584717[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0xa0cf31,null))[_0xdd25('0x15')](function(_0x163b0f){if(_0x163b0f){_0x21c337=_0x163b0f;_0x1afa5a[_0xdd25('0x5a')]=_[_0xdd25('0x57')](db[_0xdd25('0x154')][_0xdd25('0x3f')]);_0x1afa5a[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x584717[_0xdd25('0x45')]);_0x1afa5a[_0xdd25('0x58')]=_[_0xdd25('0x59')](_0x1afa5a[_0xdd25('0x5a')],_0x1afa5a[_0xdd25('0x45')]);_0x5eadad[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x1afa5a[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x584717[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x5eadad[_0xdd25('0x4a')]=_0x5eadad[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x5eadad[_0xdd25('0x4a')]:_0x1afa5a[_0xdd25('0x5a')];_0x5eadad[_0xdd25('0xd3')]=qs[_0xdd25('0xc8')](_0x584717['query'][_0xdd25('0xc8')]);_0x5eadad[_0xdd25('0xc9')]=qs['filters'](_[_0xdd25('0xd4')](_0x584717['query'],_0x1afa5a['filters']));if(_0x584717[_0xdd25('0x45')][_0xdd25('0x41')]){_0x5eadad[_0xdd25('0xc9')]=_['merge'](_0x5eadad['where'],{'$or':_['map'](_0x5eadad[_0xdd25('0x4a')],function(_0x28e3c3){var _0x59636a={};_0x59636a[_0x28e3c3]={'$like':'%'+_0x584717[_0xdd25('0x45')]['filter']+'%'};return _0x59636a;})});}_0x5eadad=_[_0xdd25('0x5d')]({},_0x5eadad,_0x584717[_0xdd25('0x5e')]);return _0x21c337[_0xdd25('0x153')](_0x5eadad);}})[_0xdd25('0x15')](function(_0x39bf4e){if(_0x39bf4e){_0x191c64=_0x39bf4e[_0xdd25('0x4f')];if(!_0x584717[_0xdd25('0x45')]['hasOwnProperty']('nolimit')){_0x5eadad[_0xdd25('0x26')]=qs['limit'](_0x584717[_0xdd25('0x45')][_0xdd25('0x26')]);_0x5eadad['offset']=qs['offset'](_0x584717[_0xdd25('0x45')]['offset']);}return _0x21c337[_0xdd25('0x153')](_0x5eadad);}})[_0xdd25('0x15')](function(_0x67c3f3){if(_0x67c3f3){return _0x67c3f3?{'count':_0x191c64,'rows':_0x67c3f3}:null;}})['then'](respondWithResult(_0xa0cf31,null))[_0xdd25('0x20')](handleError(_0xa0cf31,null));};exports[_0xdd25('0x155')]=function(_0x3af04c,_0x3d95a8){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x3af04c[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x3d95a8,null))[_0xdd25('0x15')](function(_0x12f560){if(_0x12f560){return _0x12f560[_0xdd25('0x155')](_0x3af04c[_0xdd25('0x5f')][_0xdd25('0x62')],_[_0xdd25('0x63')](_0x3af04c['body'],[_0xdd25('0x62'),'id'])||{});}})[_0xdd25('0x15')](respondWithResult(_0x3d95a8,null))[_0xdd25('0x20')](handleError(_0x3d95a8,null));};exports[_0xdd25('0x156')]=function(_0x345a2b,_0x3a6068){return db[_0xdd25('0x3e')]['find']({'where':{'id':_0x345a2b[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x3a6068,null))['then'](function(_0x589dd9){if(_0x589dd9){return _0x589dd9['removeSquareProjects'](_0x345a2b[_0xdd25('0x45')][_0xdd25('0x62')]);}})[_0xdd25('0x15')](respondWithStatusCode(_0x3a6068,null))['catch'](handleError(_0x3a6068,null));};exports[_0xdd25('0x157')]=function(_0x2a155a,_0xc890b0){var _0x36b349={},_0x3099ed={},_0x292b52={'count':0x0,'rows':[]};var _0x2ce9df=db[_0xdd25('0x158')][_0xdd25('0x3f')];_0x3099ed[_0xdd25('0x5a')]=_['keys'](_0x2ce9df);_0x3099ed[_0xdd25('0x45')]=_[_0xdd25('0x57')](_0x2a155a[_0xdd25('0x45')]);_0x3099ed['filters']=_[_0xdd25('0x59')](_0x3099ed[_0xdd25('0x5a')],_0x3099ed[_0xdd25('0x45')]);_0x3099ed[_0xdd25('0x58')]=_['concat'](_0x3099ed['filters'],[_0xdd25('0x159'),_0xdd25('0x15a'),_0xdd25('0x15b'),'$gte',_0xdd25('0x15c'),'$lte',_0xdd25('0x15d'),_0xdd25('0x15e'),_0xdd25('0x15f'),'$between',_0xdd25('0x160'),'$in',_0xdd25('0x161'),'$like',_0xdd25('0x162'),'$iLike','$notILike',_0xdd25('0x163'),_0xdd25('0x164'),_0xdd25('0x165'),'$contained','$any']);_0x36b349[_0xdd25('0x4a')]=_[_0xdd25('0x59')](_0x3099ed[_0xdd25('0x5a')],qs[_0xdd25('0x5b')](_0x2a155a[_0xdd25('0x45')][_0xdd25('0x5b')]));_0x36b349[_0xdd25('0x4a')]=_0x36b349[_0xdd25('0x4a')][_0xdd25('0x4f')]?_0x36b349[_0xdd25('0x4a')]:_0x3099ed[_0xdd25('0x5a')];if(!_0x2a155a[_0xdd25('0x45')]['hasOwnProperty']('nolimit')){_0x36b349[_0xdd25('0x26')]=qs[_0xdd25('0x26')](_0x2a155a['query']['limit']);_0x36b349['offset']=qs[_0xdd25('0x23')](_0x2a155a[_0xdd25('0x45')][_0xdd25('0x23')]);}_0x36b349['order']=qs[_0xdd25('0xc8')](_0x2a155a['query']['sort']);_0x36b349['where']=qs[_0xdd25('0x58')](_[_0xdd25('0xd4')](_0x2a155a[_0xdd25('0x45')],_0x3099ed[_0xdd25('0x58')]));if(_0x2a155a[_0xdd25('0x45')]['filter']){_0x36b349[_0xdd25('0xc9')]=_['merge'](_0x36b349[_0xdd25('0xc9')],{'$or':_[_0xdd25('0x35')](_0x36b349[_0xdd25('0x4a')],function(_0x8fa650){var _0x38a53f={};_0x38a53f[_0x8fa650]={'$like':'%'+_0x2a155a[_0xdd25('0x45')][_0xdd25('0x41')]+'%'};return _0x38a53f;})});}_0x36b349[_0xdd25('0xc9')]={'$and':[_0x36b349[_0xdd25('0xc9')],{'$or':[{'UserId':_0x2a155a[_0xdd25('0x60')]['id']},{'OwnerId':_0x2a155a[_0xdd25('0x60')]['id']}]}]};_0x36b349=_[_0xdd25('0x5d')]({},_0x36b349,_0x2a155a[_0xdd25('0x5e')]);var _0x1f5b02={'where':_0x36b349['where']};return db['CmHopper'][_0xdd25('0x25')](_0x1f5b02)['then'](function(_0x11ebcb){_0x292b52['count']=_0x11ebcb;if(_0x2a155a['query'][_0xdd25('0x46')]){_0x36b349[_0xdd25('0x47')]=[{'attributes':['id',_0xdd25('0x166'),_0xdd25('0x167'),_0xdd25('0xe6')],'model':db['CmContact'],'as':'Contact'},{'attributes':['id',_0xdd25('0x39'),'dialActive'],'model':db[_0xdd25('0xa2')],'as':_0xdd25('0xd2')}];}return db['CmHopper']['findAll'](_0x36b349);})[_0xdd25('0x15')](function(_0x29fbe5){_0x292b52[_0xdd25('0x4d')]=_0x29fbe5;return _0x292b52;})[_0xdd25('0x15')](respondWithFilteredResult(_0xc890b0,_0x36b349))['catch'](handleError(_0xc890b0,null));};exports[_0xdd25('0x168')]=function(_0x381619,_0x3a8678){if(!_['isNil'](_0x381619[_0xdd25('0x2f')]['id'])&&(_0x381619[_0xdd25('0x2f')][_0xdd25('0x2c')]=='admin'||_0x381619[_0xdd25('0x2f')][_0xdd25('0x2c')]==_0xdd25('0x2f'))){return db[_0xdd25('0x3e')]['findOne']({'where':{'id':_0x381619[_0xdd25('0x60')]['id']},'raw':!![]})[_0xdd25('0x15')](function(_0x371433){return authService[_0xdd25('0x169')](_0x371433);})[_0xdd25('0x15')](function(_0x5782d2){if(_0x5782d2){return _0x3a8678['status'](0xc8)[_0xdd25('0x28')]({'api_key':_0x5782d2[_0xdd25('0x16a')]});}else{return _0x3a8678['status'](0xcc)['json']({'message':'No\x20API\x20access\x20key\x20found!'});}})['catch'](handleError(_0x3a8678,0x193));}else{return _0x3a8678[_0xdd25('0x22')](0x191)['json']({'message':_0xdd25('0x16b')});}};exports[_0xdd25('0x16c')]=function(_0x427ab1,_0xd7ddd4){if(!_[_0xdd25('0x68')](_0x427ab1[_0xdd25('0x2f')]['id'])&&(_0x427ab1[_0xdd25('0x2f')]['role']=='admin'||_0x427ab1['user'][_0xdd25('0x2c')]==_0xdd25('0x2f'))){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x427ab1[_0xdd25('0x60')]['id']}})['then'](function(_0x3a7f66){return authService['generateApiKey'](_0x3a7f66);})['then'](function(_0x92295){return db['User']['update']({'apiKeyIat':_0x92295['iat'],'apiKeyNonce':_0x92295['nonce']},{'where':{'id':_0x427ab1[_0xdd25('0x60')]['id']}})[_0xdd25('0x15')](function(){return _0xd7ddd4[_0xdd25('0x22')](0xc8)[_0xdd25('0x28')]({'api_key':_0x92295[_0xdd25('0x16a')]});});})['catch'](handleError(_0xd7ddd4,0x193));}else{return _0xd7ddd4['status'](0x191)[_0xdd25('0x28')]({'message':_0xdd25('0x16b')});}};exports['removeApiKey']=function(_0x86b442,_0x34d5a1){if(!_[_0xdd25('0x68')](_0x86b442[_0xdd25('0x2f')]['id'])&&(_0x86b442['user'][_0xdd25('0x2c')]==_0xdd25('0x2d')||_0x86b442[_0xdd25('0x2f')][_0xdd25('0x2c')]=='user')){return db[_0xdd25('0x3e')][_0xdd25('0x38')]({'where':{'id':_0x86b442['params']['id']}})[_0xdd25('0x15')](handleEntityNotFound(_0x34d5a1,null))[_0xdd25('0x15')](function(_0x3fdc38){if(_0x3fdc38&&_0x3fdc38[_0xdd25('0x16d')]&&_0x3fdc38[_0xdd25('0x16e')])return _0x3fdc38;else throw{'message':_0xdd25('0x16f')};})[_0xdd25('0x15')](function(){return db[_0xdd25('0x3e')][_0xdd25('0x29')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x86b442[_0xdd25('0x60')]['id']}});})['then'](respondWithStatusCode(_0x34d5a1,0xc8))[_0xdd25('0x20')](handleError(_0x34d5a1,0x193));}else{return _0x34d5a1['status'](0x191)[_0xdd25('0x28')]({'message':_0xdd25('0x16b')});}};exports[_0xdd25('0x170')]=function(_0x7dd8e1,_0x35fa0a){var _0x112f1e=_0x7dd8e1[_0xdd25('0x2f')][_0xdd25('0x2b')]({'plain':!![]});if(!_0x112f1e){return _0x35fa0a['status'](0x191)['send'](_0xdd25('0x171'));}else{Promise[_0xdd25('0xfd')]()[_0xdd25('0x15')](function(){if(_0x7dd8e1[_0xdd25('0x45')][_0xdd25('0x48')]!==_0xdd25('0x49'))return;return _0x7dd8e1[_0xdd25('0x2f')][_0xdd25('0x172')]();})[_0xdd25('0x15')](function(_0x4f6dbb){if(!_0x4f6dbb)return;return _0x4f6dbb['get']({'plain':!![]});})[_0xdd25('0x15')](function(_0x5e45bd){_0x112f1e[_0xdd25('0x48')]=_0x5e45bd;return _0x35fa0a[_0xdd25('0x22')](0xc8)['json'](_0x112f1e);});}};exports[_0xdd25('0x173')]=function(_0x538958,_0x5082eb){var _0x36e910={'offset':0x0},_0x28c170={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(!_0x538958[_0xdd25('0x45')][_0xdd25('0x41')]&&!_0x538958[_0xdd25('0x45')][_0xdd25('0x174')]&&!_0x538958[_0xdd25('0x45')][_0xdd25('0x175')])return[];return Promise['resolve']()[_0xdd25('0x15')](function(){var _0x1c6174=[];if(!_[_0xdd25('0x87')](_0x538958['query'][_0xdd25('0x174')])){_0x1c6174[_0xdd25('0x4b')](db['Team'][_0xdd25('0x4c')]({'attributes':['id',_0xdd25('0x39')],'where':{'id':_0x538958[_0xdd25('0x45')][_0xdd25('0x174')]}}));}if(!_[_0xdd25('0x87')](_0x538958['query'][_0xdd25('0x175')])){_0x1c6174[_0xdd25('0x4b')](db[_0xdd25('0xa2')][_0xdd25('0x4c')]({'attributes':['id','name'],'type':_0xdd25('0x176'),'where':{'id':_0x538958[_0xdd25('0x45')]['queues']}}));}return Promise[_0xdd25('0x84')](_0x1c6174);})[_0xdd25('0x15')](function(_0xe018c6){var _0x22bcd5=_['flatten'](_0xe018c6)['map'](function(_0x4c5152){return _0x4c5152[_0xdd25('0x125')]({'attributes':['id',_0xdd25('0x39'),_0xdd25('0x67'),_0xdd25('0xa4')],'raw':!![]});});return Promise[_0xdd25('0x84')](_0x22bcd5);})['then'](function(_0x469866){var _0x199171=_['flatten'](_0x469866);if(!_0x538958['query'][_0xdd25('0x41')])return _0x199171;if(_[_0xdd25('0x87')](_0x199171)){return db[_0xdd25('0x3e')]['findAll']({'attributes':['id',_0xdd25('0x39'),_0xdd25('0x67'),_0xdd25('0xa4')],'where':{'role':_0xdd25('0x31'),'$or':[db['sequelize'][_0xdd25('0xc9')](db[_0xdd25('0x6a')]['fn'](_0xdd25('0x177'),db[_0xdd25('0x6a')][_0xdd25('0x178')](_0xdd25('0x39'))),{'$like':'%'+_0x538958[_0xdd25('0x45')]['filter'][_0xdd25('0x9c')]()+'%'}),{'internal':{'$like':'%'+_0x538958[_0xdd25('0x45')][_0xdd25('0x41')]+'%'}}]},'raw':!![]});}else{return _(_0x199171)[_0xdd25('0x115')]()['filter'](function(_0x27b3c2){return _0x27b3c2['name'][_0xdd25('0x9c')]()['includes'](_0x538958[_0xdd25('0x45')]['filter']['toLowerCase']())||_0x27b3c2[_0xdd25('0x67')][_0xdd25('0x179')]()[_0xdd25('0x37')](_0x538958[_0xdd25('0x45')][_0xdd25('0x41')]);})[_0xdd25('0x36')]();}})[_0xdd25('0x15')](function(_0x31a8fb){var _0x25cc13=_0xdd25('0x39');var _0x522aeb=_0xdd25('0x17a');if(_0x538958[_0xdd25('0x45')][_0xdd25('0xc8')]){_0x522aeb=_0x538958[_0xdd25('0x45')][_0xdd25('0xc8')][0x0]==='-'?'desc':_0xdd25('0x17a');_0x25cc13=_0x522aeb==='asc'?_0x538958[_0xdd25('0x45')][_0xdd25('0xc8')]:_0x538958[_0xdd25('0x45')][_0xdd25('0xc8')][_0xdd25('0x17b')](0x1);}return _(_0x31a8fb)[_0xdd25('0x17c')]('id')['orderBy']([function(_0x1d0fd8){return _0x25cc13===_0xdd25('0x39')?_0x1d0fd8[_0x25cc13][_0xdd25('0x9c')]():_0x1d0fd8[_0x25cc13];}],[_0x522aeb])['map'](function(_0x46fe2b){return _[_0xdd25('0xd4')](_0x46fe2b,['id',_0xdd25('0x39'),_0xdd25('0x67'),'online']);})[_0xdd25('0x36')]();})[_0xdd25('0x15')](function(_0x43eb39){return client[_0xdd25('0x14')](_0xdd25('0x30'),_0x538958)['then'](function(_0x54eaaa){if(_0x54eaaa[_0xdd25('0x1c')])throw new Error(_0xdd25('0x17d'));var _0xb87d5b=_0x54eaaa[_0xdd25('0x1f')];var _0x344e70=jayson[_0xdd25('0x13')][_0xdd25('0x17e')]({'port':0x232c});return _0x344e70[_0xdd25('0x14')]('Agents',_0x538958)[_0xdd25('0x15')](function(_0xcf04d5){if(_0xcf04d5[_0xdd25('0x1c')])throw new Error(_0xdd25('0x17f'));var _0x497f58=_0xcf04d5[_0xdd25('0x1f')];return _[_0xdd25('0x5d')]({},_0x497f58,_0xb87d5b);});})[_0xdd25('0x15')](function(_0x362fe3){return _[_0xdd25('0x35')](_0x43eb39,function(_0x2b9e24){var _0x262bb9=_['find'](_0x362fe3[_0xdd25('0x4d')],['id',_0x2b9e24['id']]);if(!_0x262bb9||!_0x2b9e24['online']){_0x2b9e24[_0xdd25('0x22')]='offline';}else if(_0x262bb9[_0xdd25('0x99')]){_0x2b9e24[_0xdd25('0x22')]=_0xdd25('0xfe');}else{_0x2b9e24[_0xdd25('0x22')]=_[_0xdd25('0x37')]([_0xdd25('0x180'),'unknown','unavailable',_0xdd25('0x181'),null,undefined],_0x262bb9[_0xdd25('0x182')])?'online':'busy';}return _0x2b9e24;});});});})[_0xdd25('0x15')](function(_0x474ea1){if(!_0x538958[_0xdd25('0x45')][_0xdd25('0xcb')](_0xdd25('0xd8'))){_0x36e910['limit']=qs[_0xdd25('0x26')](_0x538958['query'][_0xdd25('0x26')]||0xa);_0x36e910[_0xdd25('0x23')]=qs['offset'](_0x538958['query'][_0xdd25('0x23')]);}_0x28c170['count']=_0x474ea1[_0xdd25('0x4f')];_0x28c170[_0xdd25('0x4d')]=_0x36e910[_0xdd25('0x26')]?_0x474ea1['slice'](_0x36e910[_0xdd25('0x23')],_0x36e910[_0xdd25('0x23')]+_0x36e910[_0xdd25('0x26')]):_0x474ea1;return _0x28c170;})[_0xdd25('0x15')](respondWithFilteredResult(_0x5082eb,_0x36e910))[_0xdd25('0x20')](handleError(_0x5082eb,null));};function get_open_tabs(_0x4861ce,_0x439854){var _0x292894=_0x4861ce[_0xdd25('0x183')](0x0)[_0xdd25('0x184')]()+_0x4861ce['slice'](0x1);var _0x5d676c={'type':db[_0xdd25('0x8d')]['QueryTypes']['SELECT'],'raw':!![]};return new BPromise(function(_0x433a0b,_0x18b72e){var _0x338400=squel[_0xdd25('0x185')]()[_0xdd25('0x186')](_0xdd25('0x187')+_0x292894+_0xdd25('0x188'),'id')[_0xdd25('0x186')]('ui.createdAt')[_0xdd25('0x6c')](_0xdd25('0x189')+_0x4861ce+_0xdd25('0x18a'),'ui')[_0xdd25('0xc9')](_0xdd25('0x18b'),_0x439854['id']);return db[_0xdd25('0x6a')][_0xdd25('0x45')](_0x338400[_0xdd25('0x179')](),_0x5d676c)[_0xdd25('0x15')](function(_0x208a74){_0x439854[_0x292894+_0xdd25('0x18c')]=_0x208a74;_0x433a0b(_0x208a74);})[_0xdd25('0x20')](function(_0xd5eacf){_0x18b72e(_0xd5eacf);});});}
\ No newline at end of file
index 4e651d9..157efb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21ab=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x8c8994,_0x3fefbe){var _0x49fdbd=function(_0x411c79){while(--_0x411c79){_0x8c8994['push'](_0x8c8994['shift']());}};_0x49fdbd(++_0x3fefbe);}(_0x21ab,0xe9));var _0xb21a=function(_0xbc25e1,_0x27007d){_0xbc25e1=_0xbc25e1-0x0;var _0xaf0a85=_0x21ab[_0xbc25e1];return _0xaf0a85;};'use strict';var EventEmitter=require('events');var User=require(_0xb21a('0x0'))['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0xb21a('0x1')](0x0);var events={'afterCreate':_0xb21a('0x2'),'afterUpdate':_0xb21a('0x3'),'afterDestroy':_0xb21a('0x4')};function emitEvent(_0x145bde){return function(_0x548765,_0x26c1ab,_0x1aab1f){UserEvents[_0xb21a('0x5')](_0x145bde+':'+_0x548765['id'],_0x548765);UserEvents[_0xb21a('0x5')](_0x145bde,_0x548765);_0x1aab1f(null);};}for(var e in events){if(events[_0xb21a('0x6')](e)){var event=events[e];User[_0xb21a('0x7')](e,emitEvent(event));}}module[_0xb21a('0x8')]=UserEvents;
\ No newline at end of file
+var _0xce0b=['setMaxListeners','save','emit','events','User'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0xce0b,0xd0));var _0xbce0=function(_0x595285,_0x4ecb2d){_0x595285=_0x595285-0x0;var _0xef9f93=_0xce0b[_0x595285];return _0xef9f93;};'use strict';var EventEmitter=require(_0xbce0('0x0'));var User=require('../../mysqldb')['db'][_0xbce0('0x1')];var UserEvents=new EventEmitter();UserEvents[_0xbce0('0x2')](0x0);var events={'afterCreate':_0xbce0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x178ead){return function(_0x49b92a,_0x1d972b,_0x3093ac){UserEvents['emit'](_0x178ead+':'+_0x49b92a['id'],_0x49b92a);UserEvents[_0xbce0('0x4')](_0x178ead,_0x49b92a);_0x3093ac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
index 8327b7e..8cbf788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15f9=['Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','VoiceChanSpy','findAll','then','internal','concat','exports','define','User','users','utf8','utf8_bin','userProfileId','resolve','privacyEnabled','catch','changed','find','password','updateMd5Password','updatePassword','userSetting','createUserSetting','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','salt','base64','pbkdf2Sync','sha1','pbkdf2','Invalid\x20password','md5secret','crypto','util','md5','lodash','./user.attributes','length','context','from-sip','system','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','wav','WAV','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s'];(function(_0x540c22,_0x48acfb){var _0x58c328=function(_0x5cd7de){while(--_0x5cd7de){_0x540c22['push'](_0x540c22['shift']());}};_0x58c328(++_0x48acfb);}(_0x15f9,0xb8));var _0x915f=function(_0x13a58b,_0x2a3943){_0x13a58b=_0x13a58b-0x0;var _0x3bba76=_0x15f9[_0x13a58b];return _0x3bba76;};'use strict';var BPromise=require('bluebird');var crypto=require(_0x915f('0x0'));var util=require(_0x915f('0x1'));var md5=require(_0x915f('0x2'));var _=require(_0x915f('0x3'));var attributes=require(_0x915f('0x4'));var authTypes=['google'];var validatePresenceOf=function(_0x43f089){return _0x43f089&&_0x43f089[_0x915f('0x5')];};var getChanSpyApplications=function(_0x1629eb,_0x103866,_0x1c8a37){var _0x3948ee={'context':_0x1629eb[_0x915f('0x6')]||_0x915f('0x7'),'type':_0x915f('0x8'),'isApp':![],'UserId':_0x1629eb['id']};var _0x3262a7=[];for(var _0xec78e3=0x0,_0x3420eb=0x1;_0xec78e3<_0x1c8a37[_0x915f('0x5')];_0xec78e3++,_0x3420eb=0x1){var _0x218c4d={'exten':util[_0x915f('0x9')](_0x915f('0xa'),_0x1c8a37[_0xec78e3][_0x915f('0xb')],_0x103866),'ChanSpyId':_0x1c8a37[_0xec78e3]['id']};_0x3262a7[_0x915f('0xc')](_[_0x915f('0xd')]({'app':_0x915f('0xe'),'appdata':util['format'](_0x915f('0xf'),_0x915f('0x10')),'priority':_0x3420eb++},_0x3948ee,_0x218c4d));if(_0x1c8a37[_0xec78e3]['record']){_0x3262a7[_0x915f('0xc')](_[_0x915f('0xd')]({'app':'MixMonitor','appdata':util[_0x915f('0x9')]('${UNIQUEID}.%s,a',_0x1c8a37[_0xec78e3]['recordingFormat']),'priority':_0x3420eb++},_0x3948ee,_0x218c4d));}if(_0x1c8a37[_0xec78e3]['auth']){_0x3262a7[_0x915f('0xc')](_['merge']({'app':_0x915f('0x11'),'appdata':_0x1c8a37[_0xec78e3]['password'],'priority':_0x3420eb++},_0x3948ee,_0x218c4d));}_0x3262a7[_0x915f('0xc')](_[_0x915f('0xd')]({'app':_0x915f('0x12'),'appdata':util[_0x915f('0x9')](_0x915f('0x13'),_0x1629eb[_0x915f('0x14')],_0x1c8a37[_0xec78e3][_0x915f('0x15')]?_0x1c8a37[_0xec78e3]['options'][_0x915f('0x16')](''):''),'priority':_0x3420eb++},_0x3948ee,_0x218c4d));if(_0x1c8a37[_0xec78e3]['record']){_0x3262a7[_0x915f('0xc')](_['merge']({'app':'StopMixMonitor','priority':_0x3420eb++},_0x3948ee,_0x218c4d));}}return _0x3262a7;};var getUserApplications=function(_0x19d77b,_0x3f7821){var _0x1036fb=[_0x915f('0x17'),_0x915f('0x18'),'gsm'];var _0x53536d={'context':_0x19d77b['context']||'from-sip','exten':_0x3f7821,'type':_0x915f('0x8'),'isApp':![],'UserId':_0x19d77b['id']};var _0x3ea4d6=[{'app':_0x915f('0xe'),'appdata':'CDR(type)=internal'}];if(_0x19d77b[_0x915f('0x19')]&&_[_0x915f('0x1a')](_0x1036fb,_0x19d77b[_0x915f('0x19')])){_0x3ea4d6[_0x915f('0xc')]({'app':_0x915f('0xe'),'appdata':_0x915f('0x1b')});_0x3ea4d6['push']({'app':'Set','appdata':util[_0x915f('0x9')](_0x915f('0x1c'),_0x19d77b['extensionMonitor'])});_0x3ea4d6['push']({'app':_0x915f('0x1d'),'appdata':util[_0x915f('0x9')](_0x915f('0x1e'),_0x19d77b['name'])});}else{_0x3ea4d6['push']({'app':'Dial','appdata':util['format'](_0x915f('0x1f'),_0x19d77b[_0x915f('0x14')])});}_0x3ea4d6[_0x915f('0xc')]({'app':_0x915f('0x20')});for(var _0x3ebcf6=0x0;_0x3ebcf6<_0x3ea4d6[_0x915f('0x5')];_0x3ebcf6++){_0x3ea4d6[_0x3ebcf6][_0x915f('0x21')]=_0x3ebcf6+0x1;_0x3ea4d6[_0x3ebcf6]=_['defaults'](_0x3ea4d6[_0x3ebcf6],_0x53536d);}return _0x3ea4d6;};var getChanSpyPromise=function(_0x953abd,_0x3d7d6c){return new BPromise(function(_0x240761,_0x25dbc5){return _0x953abd[_0x915f('0x22')][_0x915f('0x23')]()[_0x915f('0x24')](function(_0x4998b2){if(_0x4998b2){var _0x28a76f=getChanSpyApplications(_0x3d7d6c,_0x3d7d6c['internal'],_0x4998b2);if(_0x3d7d6c[_0x915f('0x25')]!=_0x3d7d6c[_0x915f('0x14')]){_0x28a76f=_0x28a76f[_0x915f('0x26')](getChanSpyApplications(_0x3d7d6c,_0x3d7d6c[_0x915f('0x14')],_0x4998b2));}return _0x240761(_0x28a76f);}return _0x240761([]);})['catch'](function(_0xc37041){_0x25dbc5(_0xc37041);});});};module[_0x915f('0x27')]=function(_0x2e4817){var _0x350f47=_0x2e4817['models'];return _0x2e4817[_0x915f('0x28')](_0x915f('0x29'),attributes,{'tableName':_0x915f('0x2a'),'charset':_0x915f('0x2b'),'collate':_0x915f('0x2c'),'hooks':{'beforeCreate':function(_0x143277,_0x1e8f51,_0x1fcebc){var _0x2bc0a5=typeof _0x143277[_0x915f('0x2d')]==='undefined'?BPromise[_0x915f('0x2e')](null):_0x350f47['UserProfile']['find']({'where':{'id':_0x143277['userProfileId']}});_0x2bc0a5[_0x915f('0x24')](function(_0x2e824d){if(_0x2e824d){_0x143277[_0x915f('0x2f')]=_0x2e824d['privacyEnabled'];}})[_0x915f('0x24')](function(){_0x143277['updateMd5Password']();_0x143277['updatePassword'](_0x1fcebc);})[_0x915f('0x30')](function(_0x708761){_0x1fcebc(_0x708761);});},'beforeUpdate':function(_0x2515e8,_0x317b16,_0x40d7d2){Promise['resolve']()[_0x915f('0x24')](function(){if(_0x2515e8[_0x915f('0x31')](_0x915f('0x2d'))===![])return;return _0x350f47['UserProfile'][_0x915f('0x32')]({'where':{'id':_0x2515e8[_0x915f('0x2d')]}})[_0x915f('0x24')](function(_0x92ad5e){if(_0x92ad5e)_0x2515e8[_0x915f('0x2f')]=_0x92ad5e[_0x915f('0x2f')];return;});})[_0x915f('0x24')](function(){if(_0x2515e8[_0x915f('0x31')](_0x915f('0x33'))){_0x2515e8[_0x915f('0x34')]();return _0x2515e8[_0x915f('0x35')](_0x40d7d2);}_0x40d7d2();})[_0x915f('0x30')](function(_0x5aa760){_0x40d7d2(_0x5aa760);});},'afterCreate':function(_0x4dad4b,_0x5383e0,_0x2902c2){var _0x4b027c=getUserApplications(_0x4dad4b,_0x4dad4b[_0x915f('0x25')]);if(_0x4dad4b['internal']!=_0x4dad4b['name']){_0x4b027c=_0x4b027c[_0x915f('0x26')](getUserApplications(_0x4dad4b,_0x4dad4b[_0x915f('0x14')]));}return Promise[_0x915f('0x2e')]()['then'](function(){if(!_0x4dad4b[_0x915f('0x36')]){return _0x4dad4b[_0x915f('0x37')]({'clientSideLoggingLevel':'error','clientSideLoggingEnabled':![]});}})[_0x915f('0x24')](function(){return _0x350f47[_0x915f('0x38')]['bulkCreate'](_0x4b027c);})[_0x915f('0x24')](function(){if(_0x4dad4b[_0x915f('0x10')]){return getChanSpyPromise(_0x350f47,_0x4dad4b);}})[_0x915f('0x24')](function(_0x4dff51){if(_0x4dff51&&_0x4dff51['length']){return _0x350f47[_0x915f('0x38')][_0x915f('0x39')](_0x4dff51);}})[_0x915f('0x24')](function(){_0x2902c2();})[_0x915f('0x30')](function(_0x53ad59){_0x2902c2(_0x53ad59);});},'afterUpdate':function(_0x51826f,_0xf98ae1,_0x5e26c9){return BPromise['resolve']()['then'](function(){if(_0x51826f[_0x915f('0x31')](_0x915f('0x10'))||_0x51826f[_0x915f('0x31')](_0x915f('0x6'))){return _0x350f47[_0x915f('0x38')][_0x915f('0x3a')]({'where':{'UserId':_0x51826f['id'],'type':_0x915f('0x8'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x51826f[_0x915f('0x10')]){return getChanSpyPromise(_0x350f47,_0x51826f)[_0x915f('0x24')](function(_0x3ee152){if(_0x3ee152&&_0x3ee152[_0x915f('0x5')]){return _0x350f47['VoiceExtension'][_0x915f('0x39')](_0x3ee152);}});}});}})['then'](function(){if(_0x51826f[_0x915f('0x31')](_0x915f('0x19'))||_0x51826f['changed'](_0x915f('0x6'))){return _0x350f47[_0x915f('0x38')][_0x915f('0x3a')]({'where':{'UserId':_0x51826f['id'],'type':_0x915f('0x8'),'ChanSpyId':null}})[_0x915f('0x24')](function(){var _0x44480f=getUserApplications(_0x51826f,_0x51826f[_0x915f('0x25')]);if(_0x51826f['internal']!=_0x51826f[_0x915f('0x14')]){_0x44480f=_0x44480f['concat'](getUserApplications(_0x51826f,_0x51826f[_0x915f('0x14')]));}return _0x350f47[_0x915f('0x38')][_0x915f('0x39')](_0x44480f);});}})[_0x915f('0x24')](function(){_0x5e26c9();})[_0x915f('0x30')](function(_0x5068d9){_0x5e26c9(_0x5068d9);});},'afterDestroy':function(_0x14668e){return _0x350f47[_0x915f('0x38')][_0x915f('0x3a')]({'where':{'UserId':_0x14668e['id'],'type':_0x915f('0x8')}});}},'instanceMethods':{'authenticate':function(_0x204682,_0x5f21a2){if(!_0x5f21a2){return this[_0x915f('0x33')]===this[_0x915f('0x3b')](_0x204682);}var _0x57a0f6=this;this[_0x915f('0x3b')](_0x204682,function(_0x47b999,_0x105364){if(_0x47b999){_0x5f21a2(_0x47b999);}if(_0x57a0f6[_0x915f('0x33')]===_0x105364){_0x5f21a2(null,!![]);}else{_0x5f21a2(null,![]);}});},'makeSalt':function(_0x56b61a,_0x11d3cc){var _0x1b109e=0x10;if(typeof arguments[0x0]===_0x915f('0x3c')){_0x11d3cc=arguments[0x0];_0x56b61a=_0x1b109e;}else if(typeof arguments[0x1]===_0x915f('0x3c')){_0x11d3cc=arguments[0x1];}else{throw new Error(_0x915f('0x3d'));}if(!_0x56b61a){_0x56b61a=_0x1b109e;}return crypto[_0x915f('0x3e')](_0x56b61a,function(_0x1ff3f5,_0x29c913){if(_0x1ff3f5){_0x11d3cc(_0x1ff3f5);}return _0x11d3cc(null,_0x29c913[_0x915f('0x3f')]('base64'));});},'encryptPassword':function(_0x250c29,_0x3ed4e3){if(!_0x250c29||!this[_0x915f('0x40')]){return _0x3ed4e3?_0x3ed4e3(null):null;}var _0x36dbfc=0x2710;var _0x464ee4=0x40;var _0x145058=new Buffer(this[_0x915f('0x40')],_0x915f('0x41'));if(!_0x3ed4e3){return crypto[_0x915f('0x42')](_0x250c29,_0x145058,_0x36dbfc,_0x464ee4,_0x915f('0x43'))['toString']('base64');}return crypto[_0x915f('0x44')](_0x250c29,_0x145058,_0x36dbfc,_0x464ee4,_0x915f('0x43'),function(_0x3f2e44,_0x4e5625){if(_0x3f2e44){_0x3ed4e3(_0x3f2e44);}return _0x3ed4e3(null,_0x4e5625[_0x915f('0x3f')]('base64'));});},'updatePassword':function(_0x15895d){if(!this[_0x915f('0x33')]){return _0x15895d(null);}if(!validatePresenceOf(this[_0x915f('0x33')])&&authTypes['indexOf'](this['provider'])===-0x1){_0x15895d(new Error(_0x915f('0x45')));}var _0x5beeab=this;this['makeSalt'](function(_0x23f5bc,_0x3b2449){if(_0x23f5bc){return _0x15895d(_0x23f5bc);}_0x5beeab[_0x915f('0x40')]=_0x3b2449;_0x5beeab[_0x915f('0x3b')](_0x5beeab['password'],function(_0x36acd3,_0x167523){if(_0x36acd3){_0x15895d(_0x36acd3);}_0x5beeab[_0x915f('0x33')]=_0x167523;_0x15895d(null);});});},'updateMd5Password':function(){this[_0x915f('0x46')]=md5(this['name']+':asterisk:'+this[_0x915f('0x33')]);return this['md5secret'];}}});};
\ No newline at end of file
+var _0x656c=['catch','models','User','users','utf8','utf8_bin','undefined','resolve','UserProfile','find','userProfileId','privacyEnabled','updateMd5Password','updatePassword','changed','userSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','crypto','md5','lodash','./user.attributes','google','length','context','format','%s%s','push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','options','join','wav','from-sip','system','CDR(type)=internal','includes','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','name','Dial','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','then','internal','concat'];(function(_0x138619,_0x4d39b3){var _0x34d075=function(_0x31f51f){while(--_0x31f51f){_0x138619['push'](_0x138619['shift']());}};_0x34d075(++_0x4d39b3);}(_0x656c,0x149));var _0xc656=function(_0x1f0a0e,_0x3b9fbc){_0x1f0a0e=_0x1f0a0e-0x0;var _0x484fb2=_0x656c[_0x1f0a0e];return _0x484fb2;};'use strict';var BPromise=require(_0xc656('0x0'));var crypto=require(_0xc656('0x1'));var util=require('util');var md5=require(_0xc656('0x2'));var _=require(_0xc656('0x3'));var attributes=require(_0xc656('0x4'));var authTypes=[_0xc656('0x5')];var validatePresenceOf=function(_0x2f0f75){return _0x2f0f75&&_0x2f0f75[_0xc656('0x6')];};var getChanSpyApplications=function(_0x400a26,_0x7df3fb,_0x27241f){var _0x3b5288={'context':_0x400a26[_0xc656('0x7')]||'from-sip','type':'system','isApp':![],'UserId':_0x400a26['id']};var _0x1d66fc=[];for(var _0x3871c2=0x0,_0x377385=0x1;_0x3871c2<_0x27241f['length'];_0x3871c2++,_0x377385=0x1){var _0x2e2f1f={'exten':util[_0xc656('0x8')](_0xc656('0x9'),_0x27241f[_0x3871c2]['prefix'],_0x7df3fb),'ChanSpyId':_0x27241f[_0x3871c2]['id']};_0x1d66fc[_0xc656('0xa')](_[_0xc656('0xb')]({'app':_0xc656('0xc'),'appdata':util[_0xc656('0x8')]('CDR(type)=%s',_0xc656('0xd')),'priority':_0x377385++},_0x3b5288,_0x2e2f1f));if(_0x27241f[_0x3871c2][_0xc656('0xe')]){_0x1d66fc['push'](_[_0xc656('0xb')]({'app':_0xc656('0xf'),'appdata':util[_0xc656('0x8')](_0xc656('0x10'),_0x27241f[_0x3871c2][_0xc656('0x11')]),'priority':_0x377385++},_0x3b5288,_0x2e2f1f));}if(_0x27241f[_0x3871c2][_0xc656('0x12')]){_0x1d66fc['push'](_[_0xc656('0xb')]({'app':'Authenticate','appdata':_0x27241f[_0x3871c2][_0xc656('0x13')],'priority':_0x377385++},_0x3b5288,_0x2e2f1f));}_0x1d66fc[_0xc656('0xa')](_['merge']({'app':_0xc656('0x14'),'appdata':util[_0xc656('0x8')]('SIP/%s,%s',_0x400a26['name'],_0x27241f[_0x3871c2][_0xc656('0x15')]?_0x27241f[_0x3871c2]['options'][_0xc656('0x16')](''):''),'priority':_0x377385++},_0x3b5288,_0x2e2f1f));if(_0x27241f[_0x3871c2]['record']){_0x1d66fc['push'](_[_0xc656('0xb')]({'app':'StopMixMonitor','priority':_0x377385++},_0x3b5288,_0x2e2f1f));}}return _0x1d66fc;};var getUserApplications=function(_0x39810d,_0x309399){var _0x44413b=[_0xc656('0x17'),'WAV','gsm'];var _0x15f200={'context':_0x39810d[_0xc656('0x7')]||_0xc656('0x18'),'exten':_0x309399,'type':_0xc656('0x19'),'isApp':![],'UserId':_0x39810d['id']};var _0xf75311=[{'app':'Set','appdata':_0xc656('0x1a')}];if(_0x39810d['extensionMonitor']&&_[_0xc656('0x1b')](_0x44413b,_0x39810d[_0xc656('0x1c')])){_0xf75311[_0xc656('0xa')]({'app':_0xc656('0xc'),'appdata':_0xc656('0x1d')});_0xf75311[_0xc656('0xa')]({'app':_0xc656('0xc'),'appdata':util['format'](_0xc656('0x1e'),_0x39810d['extensionMonitor'])});_0xf75311['push']({'app':'Dial','appdata':util[_0xc656('0x8')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x39810d[_0xc656('0x1f')])});}else{_0xf75311[_0xc656('0xa')]({'app':_0xc656('0x20'),'appdata':util[_0xc656('0x8')](_0xc656('0x21'),_0x39810d[_0xc656('0x1f')])});}_0xf75311['push']({'app':_0xc656('0x22')});for(var _0x4590b2=0x0;_0x4590b2<_0xf75311[_0xc656('0x6')];_0x4590b2++){_0xf75311[_0x4590b2][_0xc656('0x23')]=_0x4590b2+0x1;_0xf75311[_0x4590b2]=_[_0xc656('0x24')](_0xf75311[_0x4590b2],_0x15f200);}return _0xf75311;};var getChanSpyPromise=function(_0x3e7f96,_0x205308){return new BPromise(function(_0x236a78,_0x127b76){return _0x3e7f96[_0xc656('0x25')]['findAll']()[_0xc656('0x26')](function(_0x32fe1f){if(_0x32fe1f){var _0x1b7e28=getChanSpyApplications(_0x205308,_0x205308[_0xc656('0x27')],_0x32fe1f);if(_0x205308[_0xc656('0x27')]!=_0x205308[_0xc656('0x1f')]){_0x1b7e28=_0x1b7e28[_0xc656('0x28')](getChanSpyApplications(_0x205308,_0x205308[_0xc656('0x1f')],_0x32fe1f));}return _0x236a78(_0x1b7e28);}return _0x236a78([]);})[_0xc656('0x29')](function(_0x15bea0){_0x127b76(_0x15bea0);});});};module['exports']=function(_0x5f3970){var _0x140d6f=_0x5f3970[_0xc656('0x2a')];return _0x5f3970['define'](_0xc656('0x2b'),attributes,{'tableName':_0xc656('0x2c'),'charset':_0xc656('0x2d'),'collate':_0xc656('0x2e'),'hooks':{'beforeCreate':function(_0x3d2514,_0x31dc0e,_0x37ddeb){var _0x2a4280=typeof _0x3d2514['userProfileId']===_0xc656('0x2f')?BPromise[_0xc656('0x30')](null):_0x140d6f[_0xc656('0x31')][_0xc656('0x32')]({'where':{'id':_0x3d2514[_0xc656('0x33')]}});_0x2a4280[_0xc656('0x26')](function(_0x363b58){if(_0x363b58){_0x3d2514[_0xc656('0x34')]=_0x363b58[_0xc656('0x34')];}})[_0xc656('0x26')](function(){_0x3d2514[_0xc656('0x35')]();_0x3d2514[_0xc656('0x36')](_0x37ddeb);})[_0xc656('0x29')](function(_0x297b83){_0x37ddeb(_0x297b83);});},'beforeUpdate':function(_0x57535f,_0xe6f0d0,_0x42034a){Promise[_0xc656('0x30')]()[_0xc656('0x26')](function(){if(_0x57535f[_0xc656('0x37')](_0xc656('0x33'))===![])return;return _0x140d6f[_0xc656('0x31')]['find']({'where':{'id':_0x57535f[_0xc656('0x33')]}})[_0xc656('0x26')](function(_0x5b3152){if(_0x5b3152)_0x57535f[_0xc656('0x34')]=_0x5b3152['privacyEnabled'];return;});})[_0xc656('0x26')](function(){if(_0x57535f[_0xc656('0x37')](_0xc656('0x13'))){_0x57535f[_0xc656('0x35')]();return _0x57535f[_0xc656('0x36')](_0x42034a);}_0x42034a();})['catch'](function(_0x334393){_0x42034a(_0x334393);});},'afterCreate':function(_0x393f70,_0x5737b1,_0x18ae83){var _0x27a570=getUserApplications(_0x393f70,_0x393f70[_0xc656('0x27')]);if(_0x393f70['internal']!=_0x393f70[_0xc656('0x1f')]){_0x27a570=_0x27a570[_0xc656('0x28')](getUserApplications(_0x393f70,_0x393f70[_0xc656('0x1f')]));}return Promise[_0xc656('0x30')]()[_0xc656('0x26')](function(){if(!_0x393f70[_0xc656('0x38')]){return _0x393f70['createUserSetting']({'clientSideLoggingLevel':_0xc656('0x39'),'clientSideLoggingEnabled':![]});}})['then'](function(){return _0x140d6f[_0xc656('0x3a')]['bulkCreate'](_0x27a570);})[_0xc656('0x26')](function(){if(_0x393f70['chanspy']){return getChanSpyPromise(_0x140d6f,_0x393f70);}})[_0xc656('0x26')](function(_0x5c7cbe){if(_0x5c7cbe&&_0x5c7cbe[_0xc656('0x6')]){return _0x140d6f[_0xc656('0x3a')]['bulkCreate'](_0x5c7cbe);}})[_0xc656('0x26')](function(){_0x18ae83();})[_0xc656('0x29')](function(_0x8d37e0){_0x18ae83(_0x8d37e0);});},'afterUpdate':function(_0x492888,_0x4d8a0f,_0x49ad56){return BPromise[_0xc656('0x30')]()[_0xc656('0x26')](function(){if(_0x492888[_0xc656('0x37')]('chanspy')||_0x492888['changed'](_0xc656('0x7'))){return _0x140d6f[_0xc656('0x3a')]['destroy']({'where':{'UserId':_0x492888['id'],'type':_0xc656('0x19'),'ChanSpyId':{'$ne':null}}})[_0xc656('0x26')](function(){if(_0x492888[_0xc656('0xd')]){return getChanSpyPromise(_0x140d6f,_0x492888)[_0xc656('0x26')](function(_0x4141ba){if(_0x4141ba&&_0x4141ba[_0xc656('0x6')]){return _0x140d6f[_0xc656('0x3a')][_0xc656('0x3b')](_0x4141ba);}});}});}})['then'](function(){if(_0x492888[_0xc656('0x37')](_0xc656('0x1c'))||_0x492888[_0xc656('0x37')]('context')){return _0x140d6f[_0xc656('0x3a')][_0xc656('0x3c')]({'where':{'UserId':_0x492888['id'],'type':_0xc656('0x19'),'ChanSpyId':null}})[_0xc656('0x26')](function(){var _0x3cc697=getUserApplications(_0x492888,_0x492888[_0xc656('0x27')]);if(_0x492888['internal']!=_0x492888['name']){_0x3cc697=_0x3cc697[_0xc656('0x28')](getUserApplications(_0x492888,_0x492888['name']));}return _0x140d6f[_0xc656('0x3a')]['bulkCreate'](_0x3cc697);});}})['then'](function(){_0x49ad56();})['catch'](function(_0x257506){_0x49ad56(_0x257506);});},'afterDestroy':function(_0x483e84){return _0x140d6f[_0xc656('0x3a')][_0xc656('0x3c')]({'where':{'UserId':_0x483e84['id'],'type':_0xc656('0x19')}});}},'instanceMethods':{'authenticate':function(_0x232059,_0x38c4c3){if(!_0x38c4c3){return this[_0xc656('0x13')]===this[_0xc656('0x3d')](_0x232059);}var _0x37fff4=this;this[_0xc656('0x3d')](_0x232059,function(_0x4ece8a,_0x2a415e){if(_0x4ece8a){_0x38c4c3(_0x4ece8a);}if(_0x37fff4[_0xc656('0x13')]===_0x2a415e){_0x38c4c3(null,!![]);}else{_0x38c4c3(null,![]);}});},'makeSalt':function(_0x371a3a,_0x2c0a12){var _0x24eae5=0x10;if(typeof arguments[0x0]==='function'){_0x2c0a12=arguments[0x0];_0x371a3a=_0x24eae5;}else if(typeof arguments[0x1]===_0xc656('0x3e')){_0x2c0a12=arguments[0x1];}else{throw new Error(_0xc656('0x3f'));}if(!_0x371a3a){_0x371a3a=_0x24eae5;}return crypto['randomBytes'](_0x371a3a,function(_0x1e30f0,_0x30ce6b){if(_0x1e30f0){_0x2c0a12(_0x1e30f0);}return _0x2c0a12(null,_0x30ce6b[_0xc656('0x40')](_0xc656('0x41')));});},'encryptPassword':function(_0x35cc6c,_0xed8dae){if(!_0x35cc6c||!this[_0xc656('0x42')]){return _0xed8dae?_0xed8dae(null):null;}var _0x5b57af=0x2710;var _0x27ec84=0x40;var _0x3d3662=new Buffer(this[_0xc656('0x42')],_0xc656('0x41'));if(!_0xed8dae){return crypto[_0xc656('0x43')](_0x35cc6c,_0x3d3662,_0x5b57af,_0x27ec84,_0xc656('0x44'))[_0xc656('0x40')]('base64');}return crypto[_0xc656('0x45')](_0x35cc6c,_0x3d3662,_0x5b57af,_0x27ec84,_0xc656('0x44'),function(_0x443ea0,_0x1bbcd2){if(_0x443ea0){_0xed8dae(_0x443ea0);}return _0xed8dae(null,_0x1bbcd2[_0xc656('0x40')](_0xc656('0x41')));});},'updatePassword':function(_0x58c399){if(!this[_0xc656('0x13')]){return _0x58c399(null);}if(!validatePresenceOf(this[_0xc656('0x13')])&&authTypes['indexOf'](this['provider'])===-0x1){_0x58c399(new Error(_0xc656('0x46')));}var _0x2fda74=this;this[_0xc656('0x47')](function(_0x21a35f,_0x143ec4){if(_0x21a35f){return _0x58c399(_0x21a35f);}_0x2fda74['salt']=_0x143ec4;_0x2fda74[_0xc656('0x3d')](_0x2fda74[_0xc656('0x13')],function(_0x2c51a6,_0x3119b6){if(_0x2c51a6){_0x58c399(_0x2c51a6);}_0x2fda74[_0xc656('0x13')]=_0x3119b6;_0x58c399(null);});});},'updateMd5Password':function(){this[_0xc656('0x48')]=md5(this['name']+_0xc656('0x49')+this['password']);return this[_0xc656('0x48')];}}});};
\ No newline at end of file
index 0485bb8..08cc7a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7a6=['UserVoiceQueueRt','system','chat','sms','openchannel','%s%s','Pause','forEach','LogoutUser','push','all','LoginUser','mobile','phone','loginInPause','count','getLicense','agents','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','bulkCreate','LOGININPAUSE','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','./user.socket','register','request','then','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowUser','find','name','role','internal','interface','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','isNil','format','SIP/%s','body','type','DEFAULT\x20PAUSE','catch','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice'];(function(_0x56f810,_0x22d990){var _0x37dc6e=function(_0x3d41b1){while(--_0x3d41b1){_0x56f810['push'](_0x56f810['shift']());}};_0x37dc6e(++_0x22d990);}(_0xc7a6,0x71));var _0x6c7a=function(_0x3f0cb4,_0x49ec71){_0x3f0cb4=_0x3f0cb4-0x0;var _0x5f33b0=_0xc7a6[_0x3f0cb4];return _0x5f33b0;};'use strict';var _=require(_0x6c7a('0x0'));var util=require('util');var moment=require(_0x6c7a('0x1'));var BPromise=require('bluebird');var rs=require(_0x6c7a('0x2'));var fs=require('fs');var Redis=require(_0x6c7a('0x3'));var db=require(_0x6c7a('0x4'))['db'];var utils=require(_0x6c7a('0x5'));var logger=require('../../config/logger')(_0x6c7a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6c7a('0x7')][_0x6c7a('0x8')]({'port':0x232a});config[_0x6c7a('0x9')]=_[_0x6c7a('0xa')](config[_0x6c7a('0x9')],{'host':_0x6c7a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6c7a('0xc'))[_0x6c7a('0xd')](socket);function respondWithRpcPromise(_0x4b3ef7,_0x22ca72,_0x9e346f){return new BPromise(function(_0xa311f7,_0x2344b2){return client[_0x6c7a('0xe')](_0x4b3ef7,_0x9e346f)[_0x6c7a('0xf')](function(_0xc6d4f0){logger['info'](_0x6c7a('0x10'),_0x22ca72,'request\x20sent');logger['debug'](_0x6c7a('0x11'),_0x22ca72,'request\x20sent',JSON['stringify'](_0xc6d4f0));if(_0xc6d4f0[_0x6c7a('0x12')]){if(_0xc6d4f0[_0x6c7a('0x12')][_0x6c7a('0x13')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x22ca72,_0xc6d4f0[_0x6c7a('0x12')][_0x6c7a('0x14')]);return _0x2344b2(_0xc6d4f0[_0x6c7a('0x12')][_0x6c7a('0x14')]);}logger[_0x6c7a('0x12')]('User,\x20%s,\x20%s',_0x22ca72,_0xc6d4f0['error']['message']);return _0xa311f7(_0xc6d4f0[_0x6c7a('0x12')]['message']);}else{logger[_0x6c7a('0x15')](_0x6c7a('0x10'),_0x22ca72,_0x6c7a('0x16'));_0xa311f7(_0xc6d4f0[_0x6c7a('0x17')][_0x6c7a('0x14')]);}})['catch'](function(_0x5bba5c){logger[_0x6c7a('0x12')](_0x6c7a('0x10'),_0x22ca72,_0x5bba5c);_0x2344b2(_0x5bba5c);});});}exports[_0x6c7a('0x18')]=function(_0x4857b9){var _0x2d37c6=this;return new Promise(function(_0x584878,_0x1352dc){return db[_0x6c7a('0x19')][_0x6c7a('0x1a')]({'raw':_0x4857b9['options']?_0x4857b9[_0x6c7a('0x1b')][_0x6c7a('0x1c')]===undefined?!![]:![]:!![],'where':_0x4857b9['options']?_0x4857b9[_0x6c7a('0x1b')][_0x6c7a('0x1d')]||null:null,'attributes':_0x4857b9[_0x6c7a('0x1b')]?_0x4857b9[_0x6c7a('0x1b')][_0x6c7a('0x1e')]||null:null,'limit':_0x4857b9[_0x6c7a('0x1b')]?_0x4857b9['options'][_0x6c7a('0x1f')]||null:null,'include':_0x4857b9[_0x6c7a('0x1b')]?_0x4857b9[_0x6c7a('0x1b')][_0x6c7a('0x20')]?_[_0x6c7a('0x21')](_0x4857b9[_0x6c7a('0x1b')]['include'],function(_0x1d3153){return{'model':db[_0x1d3153['model']],'as':_0x1d3153['as'],'attributes':_0x1d3153['attributes'],'include':_0x1d3153[_0x6c7a('0x20')]?_['map'](_0x1d3153[_0x6c7a('0x20')],function(_0x4aac30){return{'model':db[_0x4aac30[_0x6c7a('0x22')]],'as':_0x4aac30['as'],'attributes':_0x4aac30[_0x6c7a('0x1e')],'include':_0x4aac30['include']?_[_0x6c7a('0x21')](_0x4aac30['include'],function(_0x54f3e1){return{'model':db[_0x54f3e1[_0x6c7a('0x22')]],'as':_0x54f3e1['as'],'attributes':_0x54f3e1[_0x6c7a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6c7a('0xf')](function(_0xa43c78){logger[_0x6c7a('0x15')]('GetUser',_0x4857b9);logger[_0x6c7a('0x23')](_0x6c7a('0x18'),_0x4857b9,JSON[_0x6c7a('0x24')](_0xa43c78));_0x584878(_0xa43c78);})['catch'](function(_0x18a3c4){logger[_0x6c7a('0x12')](_0x6c7a('0x18'),_0x18a3c4[_0x6c7a('0x14')],_0x4857b9);_0x1352dc(_0x2d37c6[_0x6c7a('0x12')](0x1f4,_0x18a3c4[_0x6c7a('0x14')]));});});};exports[_0x6c7a('0x25')]=function(_0x332e3d){var _0x146ecc=this;return new Promise(function(_0x3025c4,_0xd9e27d){return db['User'][_0x6c7a('0x26')]({'raw':_0x332e3d['options']?_0x332e3d['options']['raw']===undefined?!![]:![]:!![],'where':_0x332e3d[_0x6c7a('0x1b')]?_0x332e3d['options']['where']||null:null,'attributes':_0x332e3d['options']?_0x332e3d['options'][_0x6c7a('0x1e')]||null:null,'include':_0x332e3d['options']?_0x332e3d[_0x6c7a('0x1b')]['include']?_[_0x6c7a('0x21')](_0x332e3d[_0x6c7a('0x1b')][_0x6c7a('0x20')],function(_0x5f3956){return{'model':db[_0x5f3956['model']],'as':_0x5f3956['as'],'attributes':_0x5f3956[_0x6c7a('0x1e')],'include':_0x5f3956[_0x6c7a('0x20')]?_[_0x6c7a('0x21')](_0x5f3956[_0x6c7a('0x20')],function(_0x19b424){return{'model':db[_0x19b424[_0x6c7a('0x22')]],'as':_0x19b424['as'],'attributes':_0x19b424['attributes'],'include':_0x19b424[_0x6c7a('0x20')]?_[_0x6c7a('0x21')](_0x19b424[_0x6c7a('0x20')],function(_0x4fc781){return{'model':db[_0x4fc781[_0x6c7a('0x22')]],'as':_0x4fc781['as'],'attributes':_0x4fc781[_0x6c7a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6c7a('0xf')](function(_0x5eafe8){logger['info']('ShowUser',_0x332e3d);logger['debug'](_0x6c7a('0x25'),_0x332e3d,JSON[_0x6c7a('0x24')](_0x5eafe8));_0x3025c4(_0x5eafe8);})['catch'](function(_0x3c3697){logger[_0x6c7a('0x12')](_0x6c7a('0x25'),_0x3c3697[_0x6c7a('0x14')],_0x332e3d);_0xd9e27d(_0x146ecc[_0x6c7a('0x12')](0x1f4,_0x3c3697[_0x6c7a('0x14')]));});});};exports['PauseUser']=function(_0x3e31d2){var _0x4386d4=this;return new Promise(function(_0x5dc880,_0x451c43){var _0x1c72cf;return db[_0x6c7a('0x19')][_0x6c7a('0x26')]({'where':_0x3e31d2[_0x6c7a('0x1b')]['where']||{},'attributes':['id',_0x6c7a('0x27'),_0x6c7a('0x28'),_0x6c7a('0x29'),_0x6c7a('0x2a')]})['then'](function(_0x52ce2a){if(_0x52ce2a){_0x1c72cf=_0x52ce2a;return db['UserVoiceQueueRt'][_0x6c7a('0x2b')]({'paused':0x1},{'where':{'UserId':_0x1c72cf['id']},'individualHooks':!![]});}})[_0x6c7a('0xf')](function(){if(_0x1c72cf){return db[_0x6c7a('0x2c')][_0x6c7a('0x1a')]({'where':{'membername':_0x1c72cf[_0x6c7a('0x27')],'type':_0x6c7a('0x2d'),'exitAt':null}});}})[_0x6c7a('0xf')](function(_0x48ec51){if(_0x1c72cf){if(_0x48ec51&&_0x48ec51[_0x6c7a('0x2e')]){var _0x53ccf5=moment()['format'](_0x6c7a('0x2f'));for(var _0x1c4f2b=0x0,_0x137930=_0x48ec51[_0x6c7a('0x2e')];_0x1c4f2b<_0x137930;_0x1c4f2b++){_0x48ec51[_0x1c4f2b][_0x6c7a('0x30')]({'exitAt':_0x53ccf5});}}}})[_0x6c7a('0xf')](function(){if(_0x1c72cf){var _0x50fdd8=[];var _0x38072d=utils[_0x6c7a('0x31')]();_0x38072d['forEach'](function(_0x585e74){_0x50fdd8['push']({'channel':_0x585e74,'membername':_0x1c72cf[_0x6c7a('0x27')],'interface':_[_0x6c7a('0x32')](_0x1c72cf[_0x6c7a('0x2a')])?util[_0x6c7a('0x33')](_0x6c7a('0x34'),_0x1c72cf[_0x6c7a('0x27')]):_0x1c72cf[_0x6c7a('0x2a')],'type':'PAUSE','enterAt':moment()[_0x6c7a('0x33')](_0x6c7a('0x2f')),'data1':_0x3e31d2[_0x6c7a('0x35')][_0x6c7a('0x36')]||_0x6c7a('0x37'),'role':_0x1c72cf[_0x6c7a('0x28')],'internal':_0x1c72cf['internal'],'uniqueid':_0x3e31d2[_0x6c7a('0x35')]['uniqueid']||null});});return db[_0x6c7a('0x2c')]['bulkCreate'](_0x50fdd8,{'individualHooks':!![]});}})[_0x6c7a('0xf')](function(){if(_0x1c72cf){return _0x1c72cf[_0x6c7a('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3e31d2['body'][_0x6c7a('0x36')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x6c7a('0x33')](_0x6c7a('0x2f'))});}})[_0x6c7a('0xf')](function(_0x2d44bc){_0x5dc880(_0x2d44bc);})[_0x6c7a('0x38')](function(_0x58fc17){_0x451c43(_0x4386d4['error'](0x1f4,_0x58fc17[_0x6c7a('0x14')]));});});};exports[_0x6c7a('0x39')]=function(_0x3675f2){var _0x480ed2=this;return new Promise(function(_0x3af30f,_0xfebea8){var _0x24a3d;return db[_0x6c7a('0x19')][_0x6c7a('0x3a')]({'where':_0x3675f2['options'][_0x6c7a('0x1d')]||{},'attributes':['id',_0x6c7a('0x27')]})[_0x6c7a('0xf')](function(_0x226cda){if(_0x226cda){_0x24a3d=_0x226cda;if(_0x3675f2['body'][_0x6c7a('0x3b')]&&!utils[_0x6c7a('0x3c')](_0x3675f2[_0x6c7a('0x35')][_0x6c7a('0x3b')])){throw new Error(_0x6c7a('0x3d'));}switch(_0x3675f2[_0x6c7a('0x35')][_0x6c7a('0x3b')]){case _0x6c7a('0x3e'):return db[_0x6c7a('0x3f')][_0x6c7a('0x2b')]({'paused':0x0},{'where':{'UserId':_0x24a3d['id']}})[_0x6c7a('0xf')](function(){return db[_0x6c7a('0x2c')][_0x6c7a('0x26')]({'where':{'channel':_0x3675f2['body'][_0x6c7a('0x3b')],'membername':_0x24a3d[_0x6c7a('0x27')],'type':'PAUSE','exitAt':null}});})[_0x6c7a('0xf')](function(_0x3d5442){if(_0x3d5442){return _0x3d5442['update']({'exitAt':moment()['format'](_0x6c7a('0x2f')),'data2':_0x6c7a('0x40')},{'individualHooks':!![]});}return null;})[_0x6c7a('0xf')](function(){return _0x24a3d[_0x6c7a('0x2b')]({'voicePause':![]});});case'mail':case _0x6c7a('0x41'):case'fax':case _0x6c7a('0x42'):case _0x6c7a('0x43'):case'whatsapp':return db[_0x6c7a('0x2c')][_0x6c7a('0x26')]({'where':{'channel':_0x3675f2['body'][_0x6c7a('0x3b')],'membername':_0x24a3d['name'],'type':'PAUSE','exitAt':null}})[_0x6c7a('0xf')](function(_0x6683db){return _0x6683db['update']({'exitAt':moment()[_0x6c7a('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0x6c7a('0xf')](function(){var _0x20fbde={};_['set'](_0x20fbde,util['format'](_0x6c7a('0x44'),_0x3675f2[_0x6c7a('0x35')][_0x6c7a('0x3b')],_0x6c7a('0x45')),![]);return _0x24a3d[_0x6c7a('0x2b')](_0x20fbde);});default:return db[_0x6c7a('0x3f')][_0x6c7a('0x2b')]({'paused':0x0},{'where':{'UserId':_0x24a3d['id']}})[_0x6c7a('0xf')](function(){return db[_0x6c7a('0x2c')][_0x6c7a('0x1a')]({'where':{'membername':_0x24a3d[_0x6c7a('0x27')],'type':_0x6c7a('0x2d'),'exitAt':null}});})[_0x6c7a('0xf')](function(_0x43353c){var _0x2694a2=[];_0x43353c[_0x6c7a('0x46')](function(_0x2c4d6b){_0x2694a2['push'](_0x2c4d6b[_0x6c7a('0x2b')]({'exitAt':moment()[_0x6c7a('0x33')](_0x6c7a('0x2f')),'data2':_0x6c7a('0x40')}));});return BPromise['all'](_0x2694a2);})[_0x6c7a('0xf')](function(){return _0x24a3d[_0x6c7a('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x6c7a('0xf')](function(_0x37caee){_0x3af30f(_0x37caee);})['catch'](function(_0x1ab58c){_0xfebea8(_0x480ed2[_0x6c7a('0x12')](0x1f4,_0x1ab58c['message']));});});};exports[_0x6c7a('0x47')]=function(_0x125074){var _0x5c6923=this;return new Promise(function(_0x2d78fc,_0x1512ce){var _0x39dd3f;return db['User'][_0x6c7a('0x3a')]({'where':_0x125074[_0x6c7a('0x1b')][_0x6c7a('0x1d')]||{},'attributes':['id','name']})[_0x6c7a('0xf')](function(_0x2edad3){if(_0x2edad3){_0x39dd3f=_0x2edad3;return db[_0x6c7a('0x3f')]['destroy']({'where':{'membername':_0x39dd3f['name']},'individualHooks':!![]});}})[_0x6c7a('0xf')](function(){if(_0x39dd3f){return db['MemberReport'][_0x6c7a('0x1a')]({'where':{'membername':_0x39dd3f[_0x6c7a('0x27')],'exitAt':null}});}})['then'](function(_0x4f4e3a){if(_0x39dd3f){if(_0x4f4e3a&&_0x4f4e3a['length']){var _0xd0ab7c=[];_0x4f4e3a[_0x6c7a('0x46')](function(_0x43c90f){_0xd0ab7c[_0x6c7a('0x48')](_0x43c90f[_0x6c7a('0x2b')]({'exitAt':moment()[_0x6c7a('0x33')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6c7a('0x49')](_0xd0ab7c);}}})[_0x6c7a('0xf')](function(){if(_0x39dd3f){return _0x39dd3f[_0x6c7a('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x3b8d30){_0x2d78fc(_0x3b8d30);})['catch'](function(_0x1fd7ed){_0x1512ce(_0x5c6923['error'](0x1f4,_0x1fd7ed['message']));});});};exports[_0x6c7a('0x4a')]=function(_0x3ccb1c){var _0x5f1c23=this;return new Promise(function(_0x27decb,_0x2669f2){var _0x36613d;var _0x358151;var _0xc60917;var _0x2ced69;return db[_0x6c7a('0x19')]['findOne']({'where':_0x3ccb1c[_0x6c7a('0x1b')][_0x6c7a('0x1d')]||{},'attributes':['id',_0x6c7a('0x27'),'role',_0x6c7a('0x4b'),_0x6c7a('0x4c'),_0x6c7a('0x29'),_0x6c7a('0x4d'),'interface']})[_0x6c7a('0xf')](function(_0x13312c){if(_0x13312c){_0x36613d=_0x13312c;_0x2ced69=_0x3ccb1c['body'][_0x6c7a('0x2a')]?_0x3ccb1c['body'][_0x6c7a('0x2a')]:util[_0x6c7a('0x33')](_0x6c7a('0x34'),_0x36613d['name']);return db[_0x6c7a('0x19')][_0x6c7a('0x4e')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x36613d['id']}}});}})[_0x6c7a('0xf')](function(_0x3cfe0b){if(_0x3cfe0b){_0xc60917=_0x3cfe0b;return require('../../config/license/util')[_0x6c7a('0x4f')]();}})['then'](function(_0x11a833){if(_0x11a833&&_0x11a833[_0x6c7a('0x50')]&&_0xc60917>=_0x11a833[_0x6c7a('0x50')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x36613d){return db[_0x6c7a('0x3f')]['destroy']({'where':{'membername':_0x36613d[_0x6c7a('0x27')]},'individualHooks':!![]});}})[_0x6c7a('0xf')](function(){if(_0x36613d){return _0x36613d[_0x6c7a('0x51')]({'raw':!![]});}})[_0x6c7a('0xf')](function(_0x313436){if(_0x36613d){if(_0x313436){var _0x151484=[];_0x358151=_0x313436;if(_0x358151['length']){for(var _0x3c48e9=0x0;_0x3c48e9<_0x358151[_0x6c7a('0x2e')];_0x3c48e9++){_0x151484[_0x6c7a('0x48')](db['UserVoiceQueueRt']['upsert']({'membername':_0x36613d[_0x6c7a('0x27')],'UserId':_0x36613d['id'],'queue_name':_0x358151[_0x3c48e9][_0x6c7a('0x27')],'VoiceQueueId':_0x358151[_0x3c48e9]['id'],'interface':_0x2ced69,'paused':_0x36613d[_0x6c7a('0x4d')]||![],'penalty':_0x358151[_0x3c48e9][_0x6c7a('0x52')]||0x0}));}return BPromise[_0x6c7a('0x49')](_0x151484);}}}})[_0x6c7a('0xf')](function(){if(_0x36613d){return db[_0x6c7a('0x2c')][_0x6c7a('0x1a')]({'where':{'membername':_0x36613d['name'],'exitAt':null}});}})[_0x6c7a('0xf')](function(_0x48d834){if(_0x36613d){if(_0x48d834&&_0x48d834[_0x6c7a('0x2e')]){var _0x1d1938=[];_0x48d834[_0x6c7a('0x46')](function(_0xf0b149){_0x1d1938[_0x6c7a('0x48')](_0xf0b149['update']({'exitAt':moment()[_0x6c7a('0x33')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6c7a('0x49')](_0x1d1938);}}})[_0x6c7a('0xf')](function(_0x32c85e){if(_0x36613d){var _0x1ec2ba=[];var _0x1df96a=[];var _0x22b5a4=utils[_0x6c7a('0x31')]();var _0x550afd={'membername':_0x36613d[_0x6c7a('0x27')],'interface':_0x2ced69,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x36613d[_0x6c7a('0x28')],'internal':_0x36613d['internal']};_0x22b5a4[_0x6c7a('0x46')](function(_0x775eda){_0x1ec2ba[_0x6c7a('0x48')](_[_0x6c7a('0x53')]({'channel':_0x775eda,'type':_0x6c7a('0x54'),'data1':_0x6c7a('0x55'),'data2':_0x2ced69},_0x550afd));if(_0x36613d[_0x6c7a('0x4d')]){_0x1df96a['push'](_['merge']({'channel':_0x775eda,'type':_0x6c7a('0x2d'),'data1':'LOGININPAUSE'},_0x550afd));}});return db[_0x6c7a('0x2c')][_0x6c7a('0x56')](_0x1ec2ba['concat'](_0x1df96a),{'individualHooks':!![]});}})['then'](function(){if(_0x36613d){return _0x36613d[_0x6c7a('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x6c7a('0x33')](_0x6c7a('0x2f')),'voicePause':_0x36613d[_0x6c7a('0x4d')]||![],'mailPause':_0x36613d[_0x6c7a('0x4d')]||![],'chatPause':_0x36613d['loginInPause']||![],'faxPause':_0x36613d[_0x6c7a('0x4d')]||![],'smsPause':_0x36613d['loginInPause']||![],'openchannelPause':_0x36613d['loginInPause']||![],'pauseType':_0x36613d[_0x6c7a('0x4d')]?_0x6c7a('0x57'):null,'lastPauseAt':moment()['format'](_0x6c7a('0x2f')),'interface':_0x2ced69});}})[_0x6c7a('0xf')](function(_0x30f362){_0x27decb(_0x30f362);})[_0x6c7a('0x38')](function(_0x6dbf8a){_0x2669f2(_0x5f1c23[_0x6c7a('0x12')](0x1f4,_0x6dbf8a[_0x6c7a('0x14')]));});});};
\ No newline at end of file
+var _0x44a5=['model','debug','ShowUser','find','role','interface','update','MemberReport','name','PAUSE','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','format','SIP/%s','body','DEFAULT\x20PAUSE','bulkCreate','type','UnpauseUser','findOne','isValidChannel','channel','voice','UserVoiceQueueRt','mail','chat','fax','sms','openchannel','whatsapp','system','all','LogoutUser','destroy','LoginUser','phone','internal','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGININPAUSE','concat','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','./user.socket','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','include','map'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x44a5,0x137));var _0x544a=function(_0x443494,_0x51fc7e){_0x443494=_0x443494-0x0;var _0x4a6794=_0x44a5[_0x443494];return _0x4a6794;};'use strict';var _=require(_0x544a('0x0'));var util=require(_0x544a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x544a('0x2'));var fs=require('fs');var Redis=require(_0x544a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x544a('0x4'));var logger=require(_0x544a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x544a('0x6'));var client=jayson[_0x544a('0x7')]['http']({'port':0x232a});config[_0x544a('0x8')]=_[_0x544a('0x9')](config[_0x544a('0x8')],{'host':_0x544a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x544a('0xb'))['register'](socket);function respondWithRpcPromise(_0x367139,_0x1da686,_0x4aa636){return new BPromise(function(_0x179cd2,_0x348af6){return client[_0x544a('0xc')](_0x367139,_0x4aa636)[_0x544a('0xd')](function(_0x4f8214){logger[_0x544a('0xe')](_0x544a('0xf'),_0x1da686,_0x544a('0x10'));logger['debug'](_0x544a('0x11'),_0x1da686,_0x544a('0x10'),JSON[_0x544a('0x12')](_0x4f8214));if(_0x4f8214[_0x544a('0x13')]){if(_0x4f8214[_0x544a('0x13')][_0x544a('0x14')]===0x1f4){logger[_0x544a('0x13')](_0x544a('0xf'),_0x1da686,_0x4f8214[_0x544a('0x13')][_0x544a('0x15')]);return _0x348af6(_0x4f8214[_0x544a('0x13')][_0x544a('0x15')]);}logger[_0x544a('0x13')]('User,\x20%s,\x20%s',_0x1da686,_0x4f8214['error'][_0x544a('0x15')]);return _0x179cd2(_0x4f8214[_0x544a('0x13')][_0x544a('0x15')]);}else{logger[_0x544a('0xe')](_0x544a('0xf'),_0x1da686,_0x544a('0x10'));_0x179cd2(_0x4f8214[_0x544a('0x16')][_0x544a('0x15')]);}})[_0x544a('0x17')](function(_0x3b3035){logger[_0x544a('0x13')](_0x544a('0xf'),_0x1da686,_0x3b3035);_0x348af6(_0x3b3035);});});}exports[_0x544a('0x18')]=function(_0x5e3b91){var _0x32cee0=this;return new Promise(function(_0x253bdf,_0x5126ad){return db[_0x544a('0x19')][_0x544a('0x1a')]({'raw':_0x5e3b91[_0x544a('0x1b')]?_0x5e3b91[_0x544a('0x1b')][_0x544a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e3b91[_0x544a('0x1b')]?_0x5e3b91['options'][_0x544a('0x1d')]||null:null,'attributes':_0x5e3b91[_0x544a('0x1b')]?_0x5e3b91[_0x544a('0x1b')][_0x544a('0x1e')]||null:null,'limit':_0x5e3b91['options']?_0x5e3b91['options']['limit']||null:null,'include':_0x5e3b91['options']?_0x5e3b91[_0x544a('0x1b')][_0x544a('0x1f')]?_[_0x544a('0x20')](_0x5e3b91['options']['include'],function(_0x2e237d){return{'model':db[_0x2e237d[_0x544a('0x21')]],'as':_0x2e237d['as'],'attributes':_0x2e237d[_0x544a('0x1e')],'include':_0x2e237d[_0x544a('0x1f')]?_[_0x544a('0x20')](_0x2e237d[_0x544a('0x1f')],function(_0x3571be){return{'model':db[_0x3571be[_0x544a('0x21')]],'as':_0x3571be['as'],'attributes':_0x3571be[_0x544a('0x1e')],'include':_0x3571be[_0x544a('0x1f')]?_[_0x544a('0x20')](_0x3571be[_0x544a('0x1f')],function(_0x8d2a54){return{'model':db[_0x8d2a54['model']],'as':_0x8d2a54['as'],'attributes':_0x8d2a54[_0x544a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x544a('0xd')](function(_0x159a61){logger[_0x544a('0xe')](_0x544a('0x18'),_0x5e3b91);logger[_0x544a('0x22')](_0x544a('0x18'),_0x5e3b91,JSON[_0x544a('0x12')](_0x159a61));_0x253bdf(_0x159a61);})[_0x544a('0x17')](function(_0x529b02){logger[_0x544a('0x13')](_0x544a('0x18'),_0x529b02[_0x544a('0x15')],_0x5e3b91);_0x5126ad(_0x32cee0[_0x544a('0x13')](0x1f4,_0x529b02['message']));});});};exports[_0x544a('0x23')]=function(_0x2ec6c2){var _0x1853ea=this;return new Promise(function(_0x1fd3f9,_0x1a0f9d){return db[_0x544a('0x19')][_0x544a('0x24')]({'raw':_0x2ec6c2[_0x544a('0x1b')]?_0x2ec6c2[_0x544a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2ec6c2[_0x544a('0x1b')]?_0x2ec6c2[_0x544a('0x1b')]['where']||null:null,'attributes':_0x2ec6c2[_0x544a('0x1b')]?_0x2ec6c2[_0x544a('0x1b')][_0x544a('0x1e')]||null:null,'include':_0x2ec6c2[_0x544a('0x1b')]?_0x2ec6c2['options'][_0x544a('0x1f')]?_['map'](_0x2ec6c2[_0x544a('0x1b')]['include'],function(_0x25f6ba){return{'model':db[_0x25f6ba[_0x544a('0x21')]],'as':_0x25f6ba['as'],'attributes':_0x25f6ba[_0x544a('0x1e')],'include':_0x25f6ba[_0x544a('0x1f')]?_[_0x544a('0x20')](_0x25f6ba[_0x544a('0x1f')],function(_0xfff786){return{'model':db[_0xfff786[_0x544a('0x21')]],'as':_0xfff786['as'],'attributes':_0xfff786[_0x544a('0x1e')],'include':_0xfff786[_0x544a('0x1f')]?_['map'](_0xfff786['include'],function(_0x2f59fe){return{'model':db[_0x2f59fe[_0x544a('0x21')]],'as':_0x2f59fe['as'],'attributes':_0x2f59fe['attributes']};}):[]};}):[]};}):[]:[]})[_0x544a('0xd')](function(_0x181ee0){logger[_0x544a('0xe')](_0x544a('0x23'),_0x2ec6c2);logger['debug'](_0x544a('0x23'),_0x2ec6c2,JSON['stringify'](_0x181ee0));_0x1fd3f9(_0x181ee0);})[_0x544a('0x17')](function(_0x4dc642){logger['error'](_0x544a('0x23'),_0x4dc642[_0x544a('0x15')],_0x2ec6c2);_0x1a0f9d(_0x1853ea[_0x544a('0x13')](0x1f4,_0x4dc642[_0x544a('0x15')]));});});};exports['PauseUser']=function(_0x33bae7){var _0x5e55fb=this;return new Promise(function(_0x2821a4,_0x378dfb){var _0x26555a;return db[_0x544a('0x19')][_0x544a('0x24')]({'where':_0x33bae7[_0x544a('0x1b')][_0x544a('0x1d')]||{},'attributes':['id','name',_0x544a('0x25'),'internal',_0x544a('0x26')]})[_0x544a('0xd')](function(_0x533989){if(_0x533989){_0x26555a=_0x533989;return db['UserVoiceQueueRt'][_0x544a('0x27')]({'paused':0x1},{'where':{'UserId':_0x26555a['id']},'individualHooks':!![]});}})[_0x544a('0xd')](function(){if(_0x26555a){return db[_0x544a('0x28')]['findAll']({'where':{'membername':_0x26555a[_0x544a('0x29')],'type':_0x544a('0x2a'),'exitAt':null}});}})[_0x544a('0xd')](function(_0x2618bd){if(_0x26555a){if(_0x2618bd&&_0x2618bd['length']){var _0xb41125=moment()['format'](_0x544a('0x2b'));for(var _0x4c8f8c=0x0,_0x1acdc1=_0x2618bd[_0x544a('0x2c')];_0x4c8f8c<_0x1acdc1;_0x4c8f8c++){_0x2618bd[_0x4c8f8c][_0x544a('0x2d')]({'exitAt':_0xb41125});}}}})['then'](function(){if(_0x26555a){var _0x18e28d=[];var _0x30625e=utils[_0x544a('0x2e')]();_0x30625e[_0x544a('0x2f')](function(_0x1209b1){_0x18e28d[_0x544a('0x30')]({'channel':_0x1209b1,'membername':_0x26555a[_0x544a('0x29')],'interface':_[_0x544a('0x31')](_0x26555a[_0x544a('0x26')])?util[_0x544a('0x32')](_0x544a('0x33'),_0x26555a['name']):_0x26555a['interface'],'type':_0x544a('0x2a'),'enterAt':moment()['format'](_0x544a('0x2b')),'data1':_0x33bae7[_0x544a('0x34')]['type']||_0x544a('0x35'),'role':_0x26555a[_0x544a('0x25')],'internal':_0x26555a['internal'],'uniqueid':_0x33bae7[_0x544a('0x34')]['uniqueid']||null});});return db['MemberReport'][_0x544a('0x36')](_0x18e28d,{'individualHooks':!![]});}})[_0x544a('0xd')](function(){if(_0x26555a){return _0x26555a[_0x544a('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x33bae7[_0x544a('0x34')][_0x544a('0x37')]||_0x544a('0x35'),'lastPauseAt':moment()[_0x544a('0x32')](_0x544a('0x2b'))});}})[_0x544a('0xd')](function(_0x37bf30){_0x2821a4(_0x37bf30);})[_0x544a('0x17')](function(_0x3e6d1b){_0x378dfb(_0x5e55fb[_0x544a('0x13')](0x1f4,_0x3e6d1b['message']));});});};exports[_0x544a('0x38')]=function(_0x1be891){var _0x366844=this;return new Promise(function(_0x2b9656,_0x4b2260){var _0x1c34af;return db[_0x544a('0x19')][_0x544a('0x39')]({'where':_0x1be891[_0x544a('0x1b')][_0x544a('0x1d')]||{},'attributes':['id',_0x544a('0x29')]})[_0x544a('0xd')](function(_0x3630d4){if(_0x3630d4){_0x1c34af=_0x3630d4;if(_0x1be891['body']['channel']&&!utils[_0x544a('0x3a')](_0x1be891[_0x544a('0x34')][_0x544a('0x3b')])){throw new Error('Unknown\x20channel');}switch(_0x1be891[_0x544a('0x34')]['channel']){case _0x544a('0x3c'):return db[_0x544a('0x3d')]['update']({'paused':0x0},{'where':{'UserId':_0x1c34af['id']}})[_0x544a('0xd')](function(){return db[_0x544a('0x28')][_0x544a('0x24')]({'where':{'channel':_0x1be891[_0x544a('0x34')]['channel'],'membername':_0x1c34af[_0x544a('0x29')],'type':'PAUSE','exitAt':null}});})[_0x544a('0xd')](function(_0x6d2d88){if(_0x6d2d88){return _0x6d2d88[_0x544a('0x27')]({'exitAt':moment()[_0x544a('0x32')](_0x544a('0x2b')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x544a('0xd')](function(){return _0x1c34af['update']({'voicePause':![]});});case _0x544a('0x3e'):case _0x544a('0x3f'):case _0x544a('0x40'):case _0x544a('0x41'):case _0x544a('0x42'):case _0x544a('0x43'):return db[_0x544a('0x28')][_0x544a('0x24')]({'where':{'channel':_0x1be891['body'][_0x544a('0x3b')],'membername':_0x1c34af['name'],'type':'PAUSE','exitAt':null}})[_0x544a('0xd')](function(_0x5c18fd){return _0x5c18fd[_0x544a('0x27')]({'exitAt':moment()[_0x544a('0x32')](_0x544a('0x2b')),'data2':_0x544a('0x44')},{'individualHooks':!![]});})[_0x544a('0xd')](function(){var _0x3487b4={};_['set'](_0x3487b4,util[_0x544a('0x32')]('%s%s',_0x1be891[_0x544a('0x34')][_0x544a('0x3b')],'Pause'),![]);return _0x1c34af['update'](_0x3487b4);});default:return db[_0x544a('0x3d')][_0x544a('0x27')]({'paused':0x0},{'where':{'UserId':_0x1c34af['id']}})[_0x544a('0xd')](function(){return db[_0x544a('0x28')]['findAll']({'where':{'membername':_0x1c34af[_0x544a('0x29')],'type':_0x544a('0x2a'),'exitAt':null}});})[_0x544a('0xd')](function(_0x4b8482){var _0x4074c8=[];_0x4b8482[_0x544a('0x2f')](function(_0x4c3550){_0x4074c8[_0x544a('0x30')](_0x4c3550[_0x544a('0x27')]({'exitAt':moment()[_0x544a('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0x544a('0x45')](_0x4074c8);})['then'](function(){return _0x1c34af[_0x544a('0x27')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x544a('0xd')](function(_0x21a6fd){_0x2b9656(_0x21a6fd);})[_0x544a('0x17')](function(_0x91c0c0){_0x4b2260(_0x366844[_0x544a('0x13')](0x1f4,_0x91c0c0[_0x544a('0x15')]));});});};exports[_0x544a('0x46')]=function(_0x119d39){var _0x446c95=this;return new Promise(function(_0x49062c,_0xa922b){var _0x4e1205;return db[_0x544a('0x19')]['findOne']({'where':_0x119d39[_0x544a('0x1b')]['where']||{},'attributes':['id',_0x544a('0x29')]})[_0x544a('0xd')](function(_0x1d7c3b){if(_0x1d7c3b){_0x4e1205=_0x1d7c3b;return db[_0x544a('0x3d')][_0x544a('0x47')]({'where':{'membername':_0x4e1205[_0x544a('0x29')]},'individualHooks':!![]});}})['then'](function(){if(_0x4e1205){return db['MemberReport'][_0x544a('0x1a')]({'where':{'membername':_0x4e1205[_0x544a('0x29')],'exitAt':null}});}})[_0x544a('0xd')](function(_0x471bfa){if(_0x4e1205){if(_0x471bfa&&_0x471bfa[_0x544a('0x2c')]){var _0x9f0170=[];_0x471bfa['forEach'](function(_0x33bf1f){_0x9f0170[_0x544a('0x30')](_0x33bf1f[_0x544a('0x27')]({'exitAt':moment()[_0x544a('0x32')](_0x544a('0x2b'))}));});return BPromise[_0x544a('0x45')](_0x9f0170);}}})[_0x544a('0xd')](function(){if(_0x4e1205){return _0x4e1205[_0x544a('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x544a('0xd')](function(_0x536fb3){_0x49062c(_0x536fb3);})['catch'](function(_0x5f1dda){_0xa922b(_0x446c95[_0x544a('0x13')](0x1f4,_0x5f1dda[_0x544a('0x15')]));});});};exports[_0x544a('0x48')]=function(_0x39ed86){var _0x4aa3b2=this;return new Promise(function(_0x23dd68,_0x482057){var _0x10ecb3;var _0x49982c;var _0x33b69e;var _0x2db4cc;return db[_0x544a('0x19')][_0x544a('0x39')]({'where':_0x39ed86[_0x544a('0x1b')][_0x544a('0x1d')]||{},'attributes':['id','name','role','mobile',_0x544a('0x49'),_0x544a('0x4a'),_0x544a('0x4b'),_0x544a('0x26')]})[_0x544a('0xd')](function(_0x135683){if(_0x135683){_0x10ecb3=_0x135683;_0x2db4cc=_0x39ed86[_0x544a('0x34')][_0x544a('0x26')]?_0x39ed86[_0x544a('0x34')][_0x544a('0x26')]:util[_0x544a('0x32')](_0x544a('0x33'),_0x10ecb3[_0x544a('0x29')]);return db[_0x544a('0x19')][_0x544a('0x4c')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x10ecb3['id']}}});}})[_0x544a('0xd')](function(_0x388247){if(_0x388247){_0x33b69e=_0x388247;return require(_0x544a('0x4d'))[_0x544a('0x4e')]();}})[_0x544a('0xd')](function(_0x3d74ca){if(_0x3d74ca&&_0x3d74ca['agents']&&_0x33b69e>=_0x3d74ca[_0x544a('0x4f')]){throw new Error(_0x544a('0x50'));}})[_0x544a('0xd')](function(){if(_0x10ecb3){return db[_0x544a('0x3d')][_0x544a('0x47')]({'where':{'membername':_0x10ecb3[_0x544a('0x29')]},'individualHooks':!![]});}})[_0x544a('0xd')](function(){if(_0x10ecb3){return _0x10ecb3[_0x544a('0x51')]({'raw':!![]});}})[_0x544a('0xd')](function(_0x1ec113){if(_0x10ecb3){if(_0x1ec113){var _0x4110c4=[];_0x49982c=_0x1ec113;if(_0x49982c[_0x544a('0x2c')]){for(var _0x2b1f52=0x0;_0x2b1f52<_0x49982c[_0x544a('0x2c')];_0x2b1f52++){_0x4110c4[_0x544a('0x30')](db[_0x544a('0x3d')][_0x544a('0x52')]({'membername':_0x10ecb3[_0x544a('0x29')],'UserId':_0x10ecb3['id'],'queue_name':_0x49982c[_0x2b1f52][_0x544a('0x29')],'VoiceQueueId':_0x49982c[_0x2b1f52]['id'],'interface':_0x2db4cc,'paused':_0x10ecb3[_0x544a('0x4b')]||![],'penalty':_0x49982c[_0x2b1f52]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x4110c4);}}}})['then'](function(){if(_0x10ecb3){return db[_0x544a('0x28')][_0x544a('0x1a')]({'where':{'membername':_0x10ecb3['name'],'exitAt':null}});}})[_0x544a('0xd')](function(_0x2a58da){if(_0x10ecb3){if(_0x2a58da&&_0x2a58da[_0x544a('0x2c')]){var _0x57f034=[];_0x2a58da[_0x544a('0x2f')](function(_0x5293b5){_0x57f034[_0x544a('0x30')](_0x5293b5['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x57f034);}}})[_0x544a('0xd')](function(_0x2a2df8){if(_0x10ecb3){var _0x21c3d4=[];var _0x2d8169=[];var _0x38d392=utils[_0x544a('0x2e')]();var _0x423158={'membername':_0x10ecb3[_0x544a('0x29')],'interface':_0x2db4cc,'enterAt':moment()[_0x544a('0x32')](_0x544a('0x2b')),'role':_0x10ecb3[_0x544a('0x25')],'internal':_0x10ecb3[_0x544a('0x4a')]};_0x38d392['forEach'](function(_0x233114){_0x21c3d4[_0x544a('0x30')](_[_0x544a('0x53')]({'channel':_0x233114,'type':'LOGIN','data1':'callysquare','data2':_0x2db4cc},_0x423158));if(_0x10ecb3[_0x544a('0x4b')]){_0x2d8169['push'](_[_0x544a('0x53')]({'channel':_0x233114,'type':_0x544a('0x2a'),'data1':_0x544a('0x54')},_0x423158));}});return db[_0x544a('0x28')][_0x544a('0x36')](_0x21c3d4[_0x544a('0x55')](_0x2d8169),{'individualHooks':!![]});}})[_0x544a('0xd')](function(){if(_0x10ecb3){return _0x10ecb3['update']({'online':!![],'lastLoginAt':moment()[_0x544a('0x32')](_0x544a('0x2b')),'voicePause':_0x10ecb3['loginInPause']||![],'mailPause':_0x10ecb3[_0x544a('0x4b')]||![],'chatPause':_0x10ecb3[_0x544a('0x4b')]||![],'faxPause':_0x10ecb3['loginInPause']||![],'smsPause':_0x10ecb3[_0x544a('0x4b')]||![],'openchannelPause':_0x10ecb3[_0x544a('0x4b')]||![],'pauseType':_0x10ecb3[_0x544a('0x4b')]?_0x544a('0x54'):null,'lastPauseAt':moment()[_0x544a('0x32')](_0x544a('0x2b')),'interface':_0x2db4cc});}})['then'](function(_0x45f738){_0x23dd68(_0x45f738);})[_0x544a('0x17')](function(_0x56472e){_0x482057(_0x4aa3b2[_0x544a('0x13')](0x1f4,_0x56472e[_0x544a('0x15')]));});});};
\ No newline at end of file
index 2c01a32..94bd067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5da7=['save','remove','update','emit','removeListener'];(function(_0x227427,_0x3159c8){var _0x51d536=function(_0x4d7244){while(--_0x4d7244){_0x227427['push'](_0x227427['shift']());}};_0x51d536(++_0x3159c8);}(_0x5da7,0x195));var _0x75da=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5da7[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require('./user.events');var events=[_0x75da('0x0'),_0x75da('0x1'),_0x75da('0x2')];function createListener(_0x34e6dc,_0x4f9b9e){return function(_0x132b16){_0x4f9b9e[_0x75da('0x3')](_0x34e6dc,_0x132b16);};}function removeListener(_0x50e3e8,_0x5cffbf){return function(){UserEvents[_0x75da('0x4')](_0x50e3e8,_0x5cffbf);};}exports['register']=function(_0x541f70){for(var _0x3b7c8e=0x0,_0x1d6676=events['length'];_0x3b7c8e<_0x1d6676;_0x3b7c8e++){var _0x27334e=events[_0x3b7c8e];var _0x454370=createListener('user:'+_0x27334e,_0x541f70);UserEvents['on'](_0x27334e,_0x454370);}};
\ No newline at end of file
+var _0x1be6=['emit','removeListener','register','length','./user.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1be6,0x1b4));var _0x61be=function(_0x2d6f90,_0x4c9795){_0x2d6f90=_0x2d6f90-0x0;var _0x5cc745=_0x1be6[_0x2d6f90];return _0x5cc745;};'use strict';var UserEvents=require(_0x61be('0x0'));var events=[_0x61be('0x1'),_0x61be('0x2'),_0x61be('0x3')];function createListener(_0x3b0387,_0x51c059){return function(_0x592f96){_0x51c059[_0x61be('0x4')](_0x3b0387,_0x592f96);};}function removeListener(_0x2a36f3,_0x4f9bc8){return function(){UserEvents[_0x61be('0x5')](_0x2a36f3,_0x4f9bc8);};}exports[_0x61be('0x6')]=function(_0x1e7b2c){for(var _0x5908a3=0x0,_0x1fb568=events[_0x61be('0x7')];_0x5908a3<_0x1fb568;_0x5908a3++){var _0x4ffefa=events[_0x5908a3];var _0x31bc31=createListener('user:'+_0x4ffefa,_0x1e7b2c);UserEvents['on'](_0x4ffefa,_0x31bc31);}};
\ No newline at end of file
index 7bc2a22..30ac598 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(_0x53d219,_0x52a11f){var _0xeafae0=function(_0x58f467){while(--_0x58f467){_0x53d219['push'](_0x53d219['shift']());}};_0xeafae0(++_0x52a11f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xcb91[_0x2261ce];return _0x524640;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x10c326,_0xf78fb5){var _0x9866a7=function(_0x115021){while(--_0x115021){_0x10c326['push'](_0x10c326['shift']());}};_0x9866a7(++_0xf78fb5);}(_0xedd9,0xfc));var _0x9edd=function(_0x216389,_0x13a816){_0x216389=_0x216389-0x0;var _0x25821a=_0xedd9[_0x216389];return _0x25821a;};'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 1553838..6d928d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb6f=['INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb6f,0x93));var _0xfdb6=function(_0x35467b,_0x36613c){_0x35467b=_0x35467b-0x0;var _0x2daf9f=_0xdb6f[_0x35467b];return _0x2daf9f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xfdb6('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x580f=['exports','INTEGER'];(function(_0x325522,_0x4c1497){var _0x5030c2=function(_0xddd4a1){while(--_0xddd4a1){_0x325522['push'](_0x325522['shift']());}};_0x5030c2(++_0x4c1497);}(_0x580f,0x8c));var _0xf580=function(_0x2d2632,_0x234a58){_0x2d2632=_0x2d2632-0x0;var _0xe2baef=_0x580f[_0x2d2632];return _0xe2baef;};'use strict';var Sequelize=require('sequelize');module[_0xf580('0x0')]={'penalty':{'type':Sequelize[_0xf580('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 5b90a44..fb20c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cdf=['rimraf','exports','UserChatQueue','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1f239e,_0x367b43){var _0x826971=function(_0x2c5777){while(--_0x2c5777){_0x1f239e['push'](_0x1f239e['shift']());}};_0x826971(++_0x367b43);}(_0x7cdf,0xcb));var _0xf7cd=function(_0x3a70b4,_0x38b4b9){_0x3a70b4=_0x3a70b4-0x0;var _0x44ca14=_0x7cdf[_0x3a70b4];return _0x44ca14;};'use strict';var _=require('lodash');var util=require(_0xf7cd('0x0'));var logger=require(_0xf7cd('0x1'))(_0xf7cd('0x2'));var moment=require(_0xf7cd('0x3'));var BPromise=require(_0xf7cd('0x4'));var rp=require(_0xf7cd('0x5'));var fs=require('fs');var path=require(_0xf7cd('0x6'));var rimraf=require(_0xf7cd('0x7'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0xf7cd('0x8')]=function(_0x341a7b,_0x5937e6){return _0x341a7b['define'](_0xf7cd('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b12=['moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api'];(function(_0x5703ce,_0x2574a0){var _0xd2c8af=function(_0x12dfc0){while(--_0x12dfc0){_0x5703ce['push'](_0x5703ce['shift']());}};_0xd2c8af(++_0x2574a0);}(_0x3b12,0xce));var _0x23b1=function(_0x52cdc1,_0x1bc117){_0x52cdc1=_0x52cdc1-0x0;var _0x16e9d9=_0x3b12[_0x52cdc1];return _0x16e9d9;};'use strict';var _=require(_0x23b1('0x0'));var util=require(_0x23b1('0x1'));var logger=require(_0x23b1('0x2'))(_0x23b1('0x3'));var moment=require(_0x23b1('0x4'));var BPromise=require(_0x23b1('0x5'));var rp=require(_0x23b1('0x6'));var fs=require('fs');var path=require(_0x23b1('0x7'));var rimraf=require('rimraf');var config=require(_0x23b1('0x8'));var attributes=require(_0x23b1('0x9'));module[_0x23b1('0xa')]=function(_0x3b2f37,_0x3aea3a){return _0x3b2f37[_0x23b1('0xb')](_0x23b1('0xc'),attributes,{'tableName':_0x23b1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a46a3e1..9c46587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c81=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c81,0xd8));var _0x18c8=function(_0x329dba,_0x22446c){_0x329dba=_0x329dba-0x0;var _0x4410b3=_0x8c81[_0x329dba];return _0x4410b3;};'use strict';var _=require(_0x18c8('0x0'));var util=require(_0x18c8('0x1'));var moment=require(_0x18c8('0x2'));var BPromise=require(_0x18c8('0x3'));var rs=require(_0x18c8('0x4'));var fs=require('fs');var Redis=require(_0x18c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x18c8('0x6'));var logger=require(_0x18c8('0x7'))(_0x18c8('0x8'));var config=require(_0x18c8('0x9'));var jayson=require(_0x18c8('0xa'));var client=jayson[_0x18c8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40276b,_0x583ee2,_0x3eba9e){return new BPromise(function(_0x59a848,_0x1d0b55){return client[_0x18c8('0xc')](_0x40276b,_0x3eba9e)[_0x18c8('0xd')](function(_0x353543){logger[_0x18c8('0xe')](_0x18c8('0xf'),_0x583ee2,_0x18c8('0x10'));logger[_0x18c8('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x583ee2,_0x18c8('0x10'),JSON[_0x18c8('0x12')](_0x353543));if(_0x353543[_0x18c8('0x13')]){if(_0x353543[_0x18c8('0x13')][_0x18c8('0x14')]===0x1f4){logger[_0x18c8('0x13')](_0x18c8('0xf'),_0x583ee2,_0x353543[_0x18c8('0x13')][_0x18c8('0x15')]);return _0x1d0b55(_0x353543[_0x18c8('0x13')][_0x18c8('0x15')]);}logger[_0x18c8('0x13')](_0x18c8('0xf'),_0x583ee2,_0x353543[_0x18c8('0x13')]['message']);return _0x59a848(_0x353543[_0x18c8('0x13')][_0x18c8('0x15')]);}else{logger[_0x18c8('0xe')](_0x18c8('0xf'),_0x583ee2,_0x18c8('0x10'));_0x59a848(_0x353543[_0x18c8('0x16')][_0x18c8('0x15')]);}})[_0x18c8('0x17')](function(_0x53f5d2){logger[_0x18c8('0x13')](_0x18c8('0xf'),_0x583ee2,_0x53f5d2);_0x1d0b55(_0x53f5d2);});});}
\ No newline at end of file
+var _0x977b=['request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd2f6,_0x5e6913){var _0x5cf448=function(_0x32deab){while(--_0x32deab){_0x3dd2f6['push'](_0x3dd2f6['shift']());}};_0x5cf448(++_0x5e6913);}(_0x977b,0x162));var _0xb977=function(_0x456a43,_0x471c3a){_0x456a43=_0x456a43-0x0;var _0xfe97de=_0x977b[_0x456a43];return _0xfe97de;};'use strict';var _=require(_0xb977('0x0'));var util=require(_0xb977('0x1'));var moment=require(_0xb977('0x2'));var BPromise=require(_0xb977('0x3'));var rs=require(_0xb977('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb977('0x5'))['db'];var utils=require(_0xb977('0x6'));var logger=require('../../config/logger')(_0xb977('0x7'));var config=require(_0xb977('0x8'));var jayson=require(_0xb977('0x9'));var client=jayson[_0xb977('0xa')][_0xb977('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e3e5f,_0x560956,_0x31179b){return new BPromise(function(_0x597b7a,_0x410a99){return client[_0xb977('0xc')](_0x1e3e5f,_0x31179b)['then'](function(_0x300845){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x560956,'request\x20sent');logger['debug'](_0xb977('0xd'),_0x560956,_0xb977('0xe'),JSON[_0xb977('0xf')](_0x300845));if(_0x300845[_0xb977('0x10')]){if(_0x300845[_0xb977('0x10')][_0xb977('0x11')]===0x1f4){logger['error'](_0xb977('0x12'),_0x560956,_0x300845[_0xb977('0x10')][_0xb977('0x13')]);return _0x410a99(_0x300845[_0xb977('0x10')][_0xb977('0x13')]);}logger[_0xb977('0x10')](_0xb977('0x12'),_0x560956,_0x300845[_0xb977('0x10')][_0xb977('0x13')]);return _0x597b7a(_0x300845[_0xb977('0x10')][_0xb977('0x13')]);}else{logger[_0xb977('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x560956,_0xb977('0xe'));_0x597b7a(_0x300845[_0xb977('0x15')][_0xb977('0x13')]);}})[_0xb977('0x16')](function(_0x28ffcd){logger[_0xb977('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x560956,_0x28ffcd);_0x410a99(_0x28ffcd);});});}
\ No newline at end of file
index a76afad..75d6fd9 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(_0x412597,_0x12af6f){var _0x36f32a=function(_0x21f8ed){while(--_0x21f8ed){_0x412597['push'](_0x412597['shift']());}};_0x36f32a(++_0x12af6f);}(_0x70e0,0x17b));var _0x070e=function(_0x941ae5,_0x593cbc){_0x941ae5=_0x941ae5-0x0;var _0x4b0211=_0x70e0[_0x941ae5];return _0x4b0211;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x596b3d,_0x2a6e03){var _0x53dda8=function(_0x1986d3){while(--_0x1986d3){_0x596b3d['push'](_0x596b3d['shift']());}};_0x53dda8(++_0x2a6e03);}(_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
index 6497ced..9d02376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x605b=['INTEGER','sequelize'];(function(_0x4eac14,_0x33118a){var _0x62df9c=function(_0x3b8837){while(--_0x3b8837){_0x4eac14['push'](_0x4eac14['shift']());}};_0x62df9c(++_0x33118a);}(_0x605b,0x1c5));var _0xb605=function(_0x42f5b1,_0x4f0d2f){_0x42f5b1=_0x42f5b1-0x0;var _0x2d738d=_0x605b[_0x42f5b1];return _0x2d738d;};'use strict';var Sequelize=require(_0xb605('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb605('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1f33=['exports','INTEGER','STRING'];(function(_0x3dff7f,_0x1131f7){var _0xcd7287=function(_0x28c3b4){while(--_0x28c3b4){_0x3dff7f['push'](_0x3dff7f['shift']());}};_0xcd7287(++_0x1131f7);}(_0x1f33,0x156));var _0x31f3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x1f33[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require('sequelize');module[_0x31f3('0x0')]={'penalty':{'type':Sequelize[_0x31f3('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x31f3('0x2')]}};
\ No newline at end of file
index 135ff05..92b8c5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50cc=['moment','path','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api'];(function(_0x50e1dc,_0x336c48){var _0x54ca9e=function(_0x355bd8){while(--_0x355bd8){_0x50e1dc['push'](_0x50e1dc['shift']());}};_0x54ca9e(++_0x336c48);}(_0x50cc,0x68));var _0xc50c=function(_0x526611,_0x36a62c){_0x526611=_0x526611-0x0;var _0x10b541=_0x50cc[_0x526611];return _0x10b541;};'use strict';var _=require(_0xc50c('0x0'));var util=require(_0xc50c('0x1'));var logger=require(_0xc50c('0x2'))(_0xc50c('0x3'));var moment=require(_0xc50c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc50c('0x5'));var rimraf=require('rimraf');var config=require(_0xc50c('0x6'));var attributes=require(_0xc50c('0x7'));module[_0xc50c('0x8')]=function(_0x2b6adc,_0x142fea){return _0x2b6adc[_0xc50c('0x9')](_0xc50c('0xa'),attributes,{'tableName':_0xc50c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd35=['util','api','moment','bluebird','rimraf','./userFaxQueue.attributes','exports','lodash'];(function(_0x3d1257,_0x182816){var _0x2dd9bb=function(_0x154115){while(--_0x154115){_0x3d1257['push'](_0x3d1257['shift']());}};_0x2dd9bb(++_0x182816);}(_0xfd35,0xdf));var _0x5fd3=function(_0x3b6ebe,_0x313e2a){_0x3b6ebe=_0x3b6ebe-0x0;var _0x3793af=_0xfd35[_0x3b6ebe];return _0x3793af;};'use strict';var _=require(_0x5fd3('0x0'));var util=require(_0x5fd3('0x1'));var logger=require('../../config/logger')(_0x5fd3('0x2'));var moment=require(_0x5fd3('0x3'));var BPromise=require(_0x5fd3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5fd3('0x5'));var config=require('../../config/environment');var attributes=require(_0x5fd3('0x6'));module[_0x5fd3('0x7')]=function(_0x508938,_0x528d0a){return _0x508938['define']('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b3fe2a..0a35de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45db=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xeb4c8b,_0x1dc497){var _0x90b0d0=function(_0x332e32){while(--_0x332e32){_0xeb4c8b['push'](_0xeb4c8b['shift']());}};_0x90b0d0(++_0x1dc497);}(_0x45db,0x8e));var _0xb45d=function(_0x27cef7,_0x4811b4){_0x27cef7=_0x27cef7-0x0;var _0x40e8df=_0x45db[_0x27cef7];return _0x40e8df;};'use strict';var _=require(_0xb45d('0x0'));var util=require(_0xb45d('0x1'));var moment=require(_0xb45d('0x2'));var BPromise=require(_0xb45d('0x3'));var rs=require(_0xb45d('0x4'));var fs=require('fs');var Redis=require(_0xb45d('0x5'));var db=require(_0xb45d('0x6'))['db'];var utils=require(_0xb45d('0x7'));var logger=require('../../config/logger')(_0xb45d('0x8'));var config=require(_0xb45d('0x9'));var jayson=require(_0xb45d('0xa'));var client=jayson[_0xb45d('0xb')][_0xb45d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c1114,_0x54c582,_0x369d12){return new BPromise(function(_0x5ba32b,_0x5b9200){return client[_0xb45d('0xd')](_0x2c1114,_0x369d12)[_0xb45d('0xe')](function(_0x358926){logger['info'](_0xb45d('0xf'),_0x54c582,'request\x20sent');logger[_0xb45d('0x10')](_0xb45d('0x11'),_0x54c582,'request\x20sent',JSON[_0xb45d('0x12')](_0x358926));if(_0x358926[_0xb45d('0x13')]){if(_0x358926[_0xb45d('0x13')][_0xb45d('0x14')]===0x1f4){logger[_0xb45d('0x13')](_0xb45d('0xf'),_0x54c582,_0x358926[_0xb45d('0x13')][_0xb45d('0x15')]);return _0x5b9200(_0x358926[_0xb45d('0x13')][_0xb45d('0x15')]);}logger['error'](_0xb45d('0xf'),_0x54c582,_0x358926[_0xb45d('0x13')][_0xb45d('0x15')]);return _0x5ba32b(_0x358926[_0xb45d('0x13')][_0xb45d('0x15')]);}else{logger[_0xb45d('0x16')](_0xb45d('0xf'),_0x54c582,'request\x20sent');_0x5ba32b(_0x358926[_0xb45d('0x17')][_0xb45d('0x15')]);}})[_0xb45d('0x18')](function(_0x5e29ef){logger['error'](_0xb45d('0xf'),_0x54c582,_0x5e29ef);_0x5b9200(_0x5e29ef);});});}
\ No newline at end of file
+var _0x9748=['../../config/logger','rpc','jayson/promise','client','http','request','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4773e3,_0x4d1429){var _0x1b3afe=function(_0x5e3f2f){while(--_0x5e3f2f){_0x4773e3['push'](_0x4773e3['shift']());}};_0x1b3afe(++_0x4d1429);}(_0x9748,0x93));var _0x8974=function(_0x27b7bd,_0x43e7f1){_0x27b7bd=_0x27b7bd-0x0;var _0x41f4ce=_0x9748[_0x27b7bd];return _0x41f4ce;};'use strict';var _=require(_0x8974('0x0'));var util=require(_0x8974('0x1'));var moment=require(_0x8974('0x2'));var BPromise=require(_0x8974('0x3'));var rs=require(_0x8974('0x4'));var fs=require('fs');var Redis=require(_0x8974('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8974('0x6'));var logger=require(_0x8974('0x7'))(_0x8974('0x8'));var config=require('../../config/environment');var jayson=require(_0x8974('0x9'));var client=jayson[_0x8974('0xa')][_0x8974('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c2791,_0x2d9fbd,_0x343a85){return new BPromise(function(_0x9e4cb7,_0x172dec){return client[_0x8974('0xc')](_0x1c2791,_0x343a85)['then'](function(_0x1bc214){logger['info'](_0x8974('0xd'),_0x2d9fbd,_0x8974('0xe'));logger[_0x8974('0xf')](_0x8974('0x10'),_0x2d9fbd,_0x8974('0xe'),JSON['stringify'](_0x1bc214));if(_0x1bc214[_0x8974('0x11')]){if(_0x1bc214['error']['code']===0x1f4){logger['error'](_0x8974('0xd'),_0x2d9fbd,_0x1bc214[_0x8974('0x11')][_0x8974('0x12')]);return _0x172dec(_0x1bc214['error'][_0x8974('0x12')]);}logger[_0x8974('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x2d9fbd,_0x1bc214[_0x8974('0x11')][_0x8974('0x12')]);return _0x9e4cb7(_0x1bc214[_0x8974('0x11')][_0x8974('0x12')]);}else{logger[_0x8974('0x13')](_0x8974('0xd'),_0x2d9fbd,_0x8974('0xe'));_0x9e4cb7(_0x1bc214[_0x8974('0x14')][_0x8974('0x12')]);}})[_0x8974('0x15')](function(_0x598884){logger['error'](_0x8974('0xd'),_0x2d9fbd,_0x598884);_0x172dec(_0x598884);});});}
\ No newline at end of file
index bb2274f..b65572d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x396a42,_0xda0a3c){var _0x55236c=function(_0x31f3c7){while(--_0x31f3c7){_0x396a42['push'](_0x396a42['shift']());}};_0x55236c(++_0xda0a3c);}(_0xe706,0xa3));var _0x6e70=function(_0x5f2fea,_0x9fde07){_0x5f2fea=_0x5f2fea-0x0;var _0x198a0c=_0xe706[_0x5f2fea];return _0x198a0c;};'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'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1431f1,_0x310845){var _0x1d6b57=function(_0x1e0c73){while(--_0x1e0c73){_0x1431f1['push'](_0x1431f1['shift']());}};_0x1d6b57(++_0x310845);}(_0xe706,0xa3));var _0x6e70=function(_0x3fafb9,_0x5d6612){_0x3fafb9=_0x3fafb9-0x0;var _0xada4d4=_0xe706[_0x3fafb9];return _0xada4d4;};'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'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
index 17ac7d5..88c1cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15a4=['exports','INTEGER','sequelize'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x15a4,0x191));var _0x415a=function(_0x31ecbe,_0x5a424f){_0x31ecbe=_0x31ecbe-0x0;var _0x62cb0d=_0x15a4[_0x31ecbe];return _0x62cb0d;};'use strict';var Sequelize=require(_0x415a('0x0'));module[_0x415a('0x1')]={'penalty':{'type':Sequelize[_0x415a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe01b=['exports','INTEGER','sequelize'];(function(_0x534d49,_0x1715dd){var _0x3c55a5=function(_0x49f325){while(--_0x49f325){_0x534d49['push'](_0x534d49['shift']());}};_0x3c55a5(++_0x1715dd);}(_0xe01b,0x7a));var _0xbe01=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe01b[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xbe01('0x0'));module[_0xbe01('0x1')]={'penalty':{'type':Sequelize[_0xbe01('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index c86bb64..f5b2cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc98=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0xbc98,0x15b));var _0x8bc9=function(_0x5cee78,_0x30d1ad){_0x5cee78=_0x5cee78-0x0;var _0x2382e9=_0xbc98[_0x5cee78];return _0x2382e9;};'use strict';var _=require(_0x8bc9('0x0'));var util=require(_0x8bc9('0x1'));var logger=require(_0x8bc9('0x2'))(_0x8bc9('0x3'));var moment=require('moment');var BPromise=require(_0x8bc9('0x4'));var rp=require(_0x8bc9('0x5'));var fs=require('fs');var path=require(_0x8bc9('0x6'));var rimraf=require(_0x8bc9('0x7'));var config=require(_0x8bc9('0x8'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0xf10647,_0xebd198){return _0xf10647[_0x8bc9('0x9')](_0x8bc9('0xa'),attributes,{'tableName':_0x8bc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3611=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','user_has_mail_queues'];(function(_0xb1e99e,_0x5a20ef){var _0x11ba35=function(_0x23ea94){while(--_0x23ea94){_0xb1e99e['push'](_0xb1e99e['shift']());}};_0x11ba35(++_0x5a20ef);}(_0x3611,0x1a2));var _0x1361=function(_0x1d02ce,_0x4d362e){_0x1d02ce=_0x1d02ce-0x0;var _0x247446=_0x3611[_0x1d02ce];return _0x247446;};'use strict';var _=require(_0x1361('0x0'));var util=require(_0x1361('0x1'));var logger=require(_0x1361('0x2'))('api');var moment=require(_0x1361('0x3'));var BPromise=require(_0x1361('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1361('0x5'));var rimraf=require(_0x1361('0x6'));var config=require(_0x1361('0x7'));var attributes=require(_0x1361('0x8'));module[_0x1361('0x9')]=function(_0x38ca10,_0x52c606){return _0x38ca10['define']('UserMailQueue',attributes,{'tableName':_0x1361('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbb7365..222adcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x131212,_0x28bb23){var _0x2b4749=function(_0x319094){while(--_0x319094){_0x131212['push'](_0x131212['shift']());}};_0x2b4749(++_0x28bb23);}(_0xa41a,0x6b));var _0xaa41=function(_0x30771c,_0x5142c8){_0x30771c=_0x30771c-0x0;var _0x22530a=_0xa41a[_0x30771c];return _0x22530a;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}
\ No newline at end of file
+var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x314f15,_0x3675a9){var _0x462dbf=function(_0x455109){while(--_0x455109){_0x314f15['push'](_0x314f15['shift']());}};_0x462dbf(++_0x3675a9);}(_0xa41a,0x6b));var _0xaa41=function(_0x1ecc3b,_0x36620e){_0x1ecc3b=_0x1ecc3b-0x0;var _0xc483d=_0xa41a[_0x1ecc3b];return _0xc483d;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}
\ No newline at end of file
index 90f62ea..e3bf454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed7c=['Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','post','sendUserNotification','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed7c,0x157));var _0xced7=function(_0x25b59,_0x2cb4b7){_0x25b59=_0x25b59-0x0;var _0xe72fe7=_0xed7c[_0x25b59];return _0xe72fe7;};'use strict';var multer=require(_0xced7('0x0'));var util=require(_0xced7('0x1'));var path=require(_0xced7('0x2'));var timeout=require(_0xced7('0x3'));var express=require(_0xced7('0x4'));var router=express[_0xced7('0x5')]();var fs_extra=require(_0xced7('0x6'));var auth=require(_0xced7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xced7('0x8'));var controller=require(_0xced7('0x9'));router[_0xced7('0xa')]('/',auth['isAuthenticated'](),controller[_0xced7('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xd856=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','path','express'];(function(_0x5b05a3,_0x28ce2a){var _0x99ca=function(_0x38d506){while(--_0x38d506){_0x5b05a3['push'](_0x5b05a3['shift']());}};_0x99ca(++_0x28ce2a);}(_0xd856,0x1a2));var _0x6d85=function(_0x1a0054,_0x3964a2){_0x1a0054=_0x1a0054-0x0;var _0x4453e6=_0xd856[_0x1a0054];return _0x4453e6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6d85('0x0'));var timeout=require('connect-timeout');var express=require(_0x6d85('0x1'));var router=express[_0x6d85('0x2')]();var fs_extra=require(_0x6d85('0x3'));var auth=require(_0x6d85('0x4'));var interaction=require(_0x6d85('0x5'));var config=require(_0x6d85('0x6'));var controller=require(_0x6d85('0x7'));router[_0x6d85('0x8')]('/',auth[_0x6d85('0x9')](),controller[_0x6d85('0xa')]);module[_0x6d85('0xb')]=router;
\ No newline at end of file
index d53c817..0960850 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61f0=['TEXT','STRING','BOOLEAN','exports'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x61f0,0x1cf));var _0x061f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x61f0[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x061f('0x0')]={'body':{'type':Sequelize[_0x061f('0x1')]},'senderName':{'type':Sequelize[_0x061f('0x2')]},'recipientsId':{'type':Sequelize[_0x061f('0x1')]},'recipientsDescription':{'type':Sequelize[_0x061f('0x2')]},'beep':{'type':Sequelize[_0x061f('0x3')]}};
\ No newline at end of file
+var _0x742b=['BOOLEAN','sequelize','STRING','TEXT'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x742b,0x91));var _0xb742=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x742b[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0xb742('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xb742('0x1')]},'recipientsId':{'type':Sequelize[_0xb742('0x2')]},'recipientsDescription':{'type':Sequelize[_0xb742('0x1')]},'beep':{'type':Sequelize[_0xb742('0x3')]}};
\ No newline at end of file
index 94a351f..ba0ebe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22e1=['sequelize','transaction','UserNotification','create','forEach','userNotification:send','catch','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','model','User','queue','replace','Queue','ids','push','all','union','flatten','getAgents','map','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','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','status','end','offset','undefined','count','limit','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join'];(function(_0xedd0cf,_0x469449){var _0x2b4236=function(_0x4ef96){while(--_0x4ef96){_0xedd0cf['push'](_0xedd0cf['shift']());}};_0x2b4236(++_0x469449);}(_0x22e1,0x1c8));var _0x122e=function(_0x466b2a,_0xceceb7){_0x466b2a=_0x466b2a-0x0;var _0x5db328=_0x22e1[_0x466b2a];return _0x5db328;};'use strict';var emlformat=require(_0x122e('0x0'));var rimraf=require(_0x122e('0x1'));var zipdir=require(_0x122e('0x2'));var jsonpatch=require(_0x122e('0x3'));var rp=require(_0x122e('0x4'));var moment=require(_0x122e('0x5'));var BPromise=require(_0x122e('0x6'));var Mustache=require(_0x122e('0x7'));var util=require(_0x122e('0x8'));var path=require(_0x122e('0x9'));var sox=require(_0x122e('0xa'));var csv=require(_0x122e('0xb'));var ejs=require(_0x122e('0xc'));var fs=require('fs');var fs_extra=require(_0x122e('0xd'));var _=require(_0x122e('0xe'));var squel=require(_0x122e('0xf'));var crypto=require(_0x122e('0x10'));var jsforce=require(_0x122e('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x122e('0x12'));var Papa=require(_0x122e('0x13'));var Redis=require('ioredis');var authService=require(_0x122e('0x14'));var qs=require(_0x122e('0x15'));var as=require(_0x122e('0x16'));var hardwareService=require(_0x122e('0x17'));var logger=require(_0x122e('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x122e('0x19'));var licenseUtil=require(_0x122e('0x1a'));var db=require(_0x122e('0x1b'))['db'];config['redis']=_[_0x122e('0x1c')](config[_0x122e('0x1d')],{'host':_0x122e('0x1e'),'port':0x18eb});var socket=require(_0x122e('0x1f'))(new Redis(config[_0x122e('0x1d')]));require(_0x122e('0x20'))[_0x122e('0x21')](socket);function respondWithStatusCode(_0x21dc63,_0x2c5f2b){_0x2c5f2b=_0x2c5f2b||0xcc;return function(_0x336652){if(_0x336652){return _0x21dc63['sendStatus'](_0x2c5f2b);}return _0x21dc63[_0x122e('0x22')](_0x2c5f2b)[_0x122e('0x23')]();};}function respondWithResult(_0x341fdc,_0x30cbc3){_0x30cbc3=_0x30cbc3||0xc8;return function(_0x44fe5d){if(_0x44fe5d){return _0x341fdc[_0x122e('0x22')](_0x30cbc3)['json'](_0x44fe5d);}};}function respondWithFilteredResult(_0xd9035b,_0x4a4a5b){return function(_0x2c6124){if(_0x2c6124){var _0x5189e3=typeof _0x4a4a5b[_0x122e('0x24')]==='undefined'&&typeof _0x4a4a5b['limit']===_0x122e('0x25');var _0x4a49da=_0x2c6124[_0x122e('0x26')];var _0x13f9bf=_0x5189e3?0x0:_0x4a4a5b[_0x122e('0x24')];var _0x254a9f=_0x5189e3?_0x2c6124[_0x122e('0x26')]:_0x4a4a5b[_0x122e('0x24')]+_0x4a4a5b[_0x122e('0x27')];var _0xdbdd77;if(_0x254a9f>=_0x4a49da){_0x254a9f=_0x4a49da;_0xdbdd77=0xc8;}else{_0xdbdd77=0xce;}_0xd9035b[_0x122e('0x22')](_0xdbdd77);return _0xd9035b[_0x122e('0x28')]('Content-Range',_0x13f9bf+'-'+_0x254a9f+'/'+_0x4a49da)['json'](_0x2c6124);}return null;};}function patchUpdates(_0x25d621){return function(_0x4909ef){try{jsonpatch[_0x122e('0x29')](_0x4909ef,_0x25d621,!![]);}catch(_0x38a644){return BPromise[_0x122e('0x2a')](_0x38a644);}return _0x4909ef['save']();};}function saveUpdates(_0x344642,_0x2af70f){return function(_0x3911a2){if(_0x3911a2){return _0x3911a2['update'](_0x344642)[_0x122e('0x2b')](function(_0x414ccd){return _0x414ccd;});}return null;};}function removeEntity(_0x5578ec,_0x46ad39){return function(_0x5d88a4){if(_0x5d88a4){return _0x5d88a4[_0x122e('0x2c')]()[_0x122e('0x2b')](function(){_0x5578ec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38e36b,_0x2a3d66){return function(_0x227228){if(!_0x227228){_0x38e36b[_0x122e('0x2d')](0x194);}return _0x227228;};}function handleError(_0x274089,_0x525c20){_0x525c20=_0x525c20||0x1f4;return function(_0x117359){logger[_0x122e('0x2e')](_0x117359[_0x122e('0x2f')]);if(_0x117359[_0x122e('0x30')]){delete _0x117359['name'];}_0x274089[_0x122e('0x22')](_0x525c20)[_0x122e('0x31')](_0x117359);};}exports[_0x122e('0x32')]=function(_0xab3ab1,_0x22b1ff,_0x2dc36d){if(!_0xab3ab1[_0x122e('0x33')]['hasOwnProperty']('text')&&!_0xab3ab1[_0x122e('0x33')][_0x122e('0x34')](_0x122e('0x35'))){throw new db[(_0x122e('0x36'))][(_0x122e('0x37'))](_0x122e('0x38'));}else{if(_0xab3ab1[_0x122e('0x33')][_0x122e('0x34')](_0x122e('0x35'))&&!_0xab3ab1[_0x122e('0x33')][_0x122e('0x34')](_0x122e('0x39'))){throw new db[(_0x122e('0x36'))]['ValidationError'](_0x122e('0x3a'));}if(!_0xab3ab1[_0x122e('0x33')][_0x122e('0x34')](_0x122e('0x3b'))){throw new db[(_0x122e('0x36'))][(_0x122e('0x37'))](_0x122e('0x3c'));}else{try{var _0x36e5bc=JSON[_0x122e('0x3d')](_0xab3ab1['body'][_0x122e('0x3b')]);}catch(_0x107a25){logger[_0x122e('0x2e')](_0x107a25);throw new db[(_0x122e('0x36'))][(_0x122e('0x37'))](_0x122e('0x3e'));}var _0x504ccf=[_0x122e('0x3f'),'faxqueue',_0x122e('0x40'),_0x122e('0x41'),_0x122e('0x42'),_0x122e('0x43'),_0x122e('0x44'),_0x122e('0x45'),_0x122e('0x46')];if(_[_0x122e('0x47')](_0x36e5bc,function(_0x33ac68){return!_[_0x122e('0x48')](_0x504ccf,_0x33ac68['model'][_0x122e('0x49')]());})){throw new db[(_0x122e('0x36'))][(_0x122e('0x37'))](_0x122e('0x4a'));}}}var _0x40be13={};_0x40be13[_0x122e('0x4b')]=_0xab3ab1['body'][_0x122e('0x34')]('senderName')?_0xab3ab1['body'][_0x122e('0x4b')]:_0xab3ab1[_0x122e('0x46')][_0x122e('0x4c')];_0x40be13['recipientsDescription']=_[_0x122e('0x4d')](_0xab3ab1['body'][_0x122e('0x4e')])?null:_0xab3ab1[_0x122e('0x33')]['recipientsDescription'];_0x40be13[_0x122e('0x4f')]=_0xab3ab1['body'][_0x122e('0x4f')]||![];_0x40be13[_0x122e('0x50')]=_0xab3ab1['user']['id'];return getContent(_0xab3ab1[_0x122e('0x33')])[_0x122e('0x2b')](function(_0x3807ed){_0x40be13[_0x122e('0x33')]=_0x3807ed;return getRecipients(_0x36e5bc);})[_0x122e('0x2b')](function(_0x5592f0){_0x40be13[_0x122e('0x51')]=_[_0x122e('0x52')](_0x5592f0)[_0x122e('0x53')](',');return db[_0x122e('0x54')][_0x122e('0x55')](function(_0x3088e0){return db[_0x122e('0x56')][_0x122e('0x57')](_0x40be13,{'raw':!![],'transaction':_0x3088e0})[_0x122e('0x2b')](function(_0x316d6d){var _0x159f4e={'sender':_0x40be13[_0x122e('0x4b')],'description':_0x40be13['recipientsDescription'],'content':_0x40be13[_0x122e('0x33')],'beep':_0x40be13[_0x122e('0x4f')]};_0x5592f0[_0x122e('0x58')](function(_0x2500ba){_0x159f4e['recipient']=_0x2500ba;socket['emit'](_0x122e('0x59'),_0x159f4e);});return _0x316d6d;});});})[_0x122e('0x2b')](respondWithResult(_0x22b1ff,0xc9))[_0x122e('0x5a')](handleError(_0x22b1ff,null));};function getContent(_0x26a8fb){return new BPromise(function(_0x339793,_0x1b41e3){if(_0x26a8fb[_0x122e('0x5b')]){_0x339793(_0x26a8fb[_0x122e('0x5b')]);return;}return db['Template'][_0x122e('0x5c')]({'attributes':[_0x122e('0x5d')],'where':{'id':_0x26a8fb[_0x122e('0x35')]},'raw':!![]})['then'](function(_0x4589b9){if(!_0x4589b9)throw new db[(_0x122e('0x36'))][(_0x122e('0x37'))](_0x122e('0x5e'));var _0xe08177=Mustache['render'](_0x4589b9[_0x122e('0x5d')],_0x26a8fb['view']);_0x339793(_0xe08177);})[_0x122e('0x5a')](function(_0x350a79){_0x1b41e3(_0x350a79);});});}function getRecipients(_0x3b11bb){return new BPromise(function(_0x38e8c7,_0x315d53){var _0x30cba9=[];var _0x539bb7=[];_0x3b11bb['forEach'](function(_0x5db46b){var _0x5c6753=_[_0x122e('0x5f')](_0x5db46b[_0x122e('0x60')][_0x122e('0x49')]());if(_0x5c6753===_0x122e('0x61')){_0x30cba9=_['union'](_0x30cba9,_0x5db46b['ids']);}else{if(_['includes'](_0x5c6753,_0x122e('0x62')))_0x5c6753=_0x5c6753[_0x122e('0x63')](_0x122e('0x62'),_0x122e('0x64'));_0x5db46b[_0x122e('0x65')][_0x122e('0x58')](function(_0x4ce660){_0x539bb7[_0x122e('0x66')](getAgents(_0x5c6753,_0x4ce660));});}});return BPromise[_0x122e('0x67')](_0x539bb7)[_0x122e('0x2b')](function(_0x544686){_0x30cba9=_[_0x122e('0x68')](_0x30cba9,_[_0x122e('0x69')](_0x544686));_0x38e8c7(_0x30cba9);})[_0x122e('0x5a')](function(_0x46c459){_0x315d53(_0x46c459);});});}function getAgents(_0x3d62fa,_0xb807ca){return new BPromise(function(_0x467d6f,_0x53a3cc){return db[_0x3d62fa][_0x122e('0x5c')]({'where':{'id':_0xb807ca}})[_0x122e('0x2b')](function(_0x377fd4){return _0x377fd4[_0x122e('0x6a')]({'attributes':['id'],'raw':!![]})[_0x122e('0x2b')](function(_0x36784d){var _0x5d9cbf=_[_0x122e('0x6b')](_0x36784d,'id');_0x467d6f(_0x5d9cbf);});})[_0x122e('0x5a')](function(_0x25a94a){_0x53a3cc(_0x25a94a);});});}
\ No newline at end of file
+var _0x75cd=['Invalid\x20\x27TemplateId\x27\x20parameter','render','html','forEach','startCase','User','union','ids','queue','replace','Queue','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','mailqueue','smsqueue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','recipient','emit','userNotification:send','catch','Template'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x75cd,0x1a0));var _0xd75c=function(_0xf93f86,_0x478f28){_0xf93f86=_0xf93f86-0x0;var _0x266476=_0x75cd[_0xf93f86];return _0x266476;};'use strict';var emlformat=require(_0xd75c('0x0'));var rimraf=require(_0xd75c('0x1'));var zipdir=require(_0xd75c('0x2'));var jsonpatch=require(_0xd75c('0x3'));var rp=require('request-promise');var moment=require(_0xd75c('0x4'));var BPromise=require(_0xd75c('0x5'));var Mustache=require('mustache');var util=require(_0xd75c('0x6'));var path=require('path');var sox=require(_0xd75c('0x7'));var csv=require(_0xd75c('0x8'));var ejs=require(_0xd75c('0x9'));var fs=require('fs');var fs_extra=require(_0xd75c('0xa'));var _=require(_0xd75c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd75c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd75c('0x8'));var querystring=require(_0xd75c('0xd'));var Papa=require('papaparse');var Redis=require(_0xd75c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd75c('0xf'));var hardwareService=require(_0xd75c('0x10'));var logger=require(_0xd75c('0x11'))(_0xd75c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd75c('0x13'));var db=require('../../mysqldb')['db'];config[_0xd75c('0x14')]=_[_0xd75c('0x15')](config[_0xd75c('0x14')],{'host':_0xd75c('0x16'),'port':0x18eb});var socket=require(_0xd75c('0x17'))(new Redis(config['redis']));require(_0xd75c('0x18'))[_0xd75c('0x19')](socket);function respondWithStatusCode(_0x5aaced,_0x57256b){_0x57256b=_0x57256b||0xcc;return function(_0x55294a){if(_0x55294a){return _0x5aaced[_0xd75c('0x1a')](_0x57256b);}return _0x5aaced['status'](_0x57256b)[_0xd75c('0x1b')]();};}function respondWithResult(_0x4ffbe0,_0x12fdf5){_0x12fdf5=_0x12fdf5||0xc8;return function(_0x3f029b){if(_0x3f029b){return _0x4ffbe0['status'](_0x12fdf5)[_0xd75c('0x1c')](_0x3f029b);}};}function respondWithFilteredResult(_0x2d02a7,_0x4aac65){return function(_0x1fee2d){if(_0x1fee2d){var _0x14bf7b=typeof _0x4aac65[_0xd75c('0x1d')]===_0xd75c('0x1e')&&typeof _0x4aac65[_0xd75c('0x1f')]==='undefined';var _0x4b0337=_0x1fee2d[_0xd75c('0x20')];var _0x1837df=_0x14bf7b?0x0:_0x4aac65['offset'];var _0x560afa=_0x14bf7b?_0x1fee2d[_0xd75c('0x20')]:_0x4aac65['offset']+_0x4aac65[_0xd75c('0x1f')];var _0x19c072;if(_0x560afa>=_0x4b0337){_0x560afa=_0x4b0337;_0x19c072=0xc8;}else{_0x19c072=0xce;}_0x2d02a7[_0xd75c('0x21')](_0x19c072);return _0x2d02a7[_0xd75c('0x22')](_0xd75c('0x23'),_0x1837df+'-'+_0x560afa+'/'+_0x4b0337)[_0xd75c('0x1c')](_0x1fee2d);}return null;};}function patchUpdates(_0x22d854){return function(_0xf67a94){try{jsonpatch['apply'](_0xf67a94,_0x22d854,!![]);}catch(_0x2408ae){return BPromise[_0xd75c('0x24')](_0x2408ae);}return _0xf67a94[_0xd75c('0x25')]();};}function saveUpdates(_0xec36d1,_0x3de45e){return function(_0x661b4c){if(_0x661b4c){return _0x661b4c[_0xd75c('0x26')](_0xec36d1)[_0xd75c('0x27')](function(_0x21a856){return _0x21a856;});}return null;};}function removeEntity(_0x3011c2,_0x1cd90){return function(_0x46d3f2){if(_0x46d3f2){return _0x46d3f2[_0xd75c('0x28')]()[_0xd75c('0x27')](function(){_0x3011c2[_0xd75c('0x21')](0xcc)[_0xd75c('0x1b')]();});}};}function handleEntityNotFound(_0xc609d0,_0x26b2ad){return function(_0x29c00d){if(!_0x29c00d){_0xc609d0['sendStatus'](0x194);}return _0x29c00d;};}function handleError(_0x395947,_0xb279f2){_0xb279f2=_0xb279f2||0x1f4;return function(_0x580932){logger[_0xd75c('0x29')](_0x580932[_0xd75c('0x2a')]);if(_0x580932[_0xd75c('0x2b')]){delete _0x580932[_0xd75c('0x2b')];}_0x395947[_0xd75c('0x21')](_0xb279f2)[_0xd75c('0x2c')](_0x580932);};}exports[_0xd75c('0x2d')]=function(_0x58cb23,_0x5b7ad9,_0x116acc){if(!_0x58cb23[_0xd75c('0x2e')][_0xd75c('0x2f')](_0xd75c('0x30'))&&!_0x58cb23[_0xd75c('0x2e')]['hasOwnProperty'](_0xd75c('0x31'))){throw new db[(_0xd75c('0x32'))][(_0xd75c('0x33'))](_0xd75c('0x34'));}else{if(_0x58cb23[_0xd75c('0x2e')][_0xd75c('0x2f')](_0xd75c('0x31'))&&!_0x58cb23[_0xd75c('0x2e')][_0xd75c('0x2f')](_0xd75c('0x35'))){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x58cb23['body'][_0xd75c('0x2f')](_0xd75c('0x36'))){throw new db['Sequelize'][(_0xd75c('0x33'))](_0xd75c('0x37'));}else{try{var _0x3152f0=JSON['parse'](_0x58cb23[_0xd75c('0x2e')]['recipients']);}catch(_0x5a335e){logger[_0xd75c('0x29')](_0x5a335e);throw new db[(_0xd75c('0x32'))]['ValidationError'](_0xd75c('0x38'));}var _0x50e228=['chatqueue','faxqueue',_0xd75c('0x39'),'openchannelqueue',_0xd75c('0x3a'),'voicequeue',_0xd75c('0x3b'),_0xd75c('0x3c'),_0xd75c('0x3d')];if(_[_0xd75c('0x3e')](_0x3152f0,function(_0xc16055){return!_[_0xd75c('0x3f')](_0x50e228,_0xc16055[_0xd75c('0x40')][_0xd75c('0x41')]());})){throw new db['Sequelize'][(_0xd75c('0x33'))](_0xd75c('0x42'));}}}var _0x5a1807={};_0x5a1807[_0xd75c('0x43')]=_0x58cb23[_0xd75c('0x2e')]['hasOwnProperty']('senderName')?_0x58cb23[_0xd75c('0x2e')][_0xd75c('0x43')]:_0x58cb23[_0xd75c('0x3d')][_0xd75c('0x44')];_0x5a1807[_0xd75c('0x45')]=_[_0xd75c('0x46')](_0x58cb23[_0xd75c('0x2e')][_0xd75c('0x45')])?null:_0x58cb23['body'][_0xd75c('0x45')];_0x5a1807[_0xd75c('0x47')]=_0x58cb23[_0xd75c('0x2e')][_0xd75c('0x47')]||![];_0x5a1807[_0xd75c('0x48')]=_0x58cb23['user']['id'];return getContent(_0x58cb23[_0xd75c('0x2e')])[_0xd75c('0x27')](function(_0xf53711){_0x5a1807[_0xd75c('0x2e')]=_0xf53711;return getRecipients(_0x3152f0);})[_0xd75c('0x27')](function(_0x24c409){_0x5a1807[_0xd75c('0x49')]=_[_0xd75c('0x4a')](_0x24c409)[_0xd75c('0x4b')](',');return db[_0xd75c('0x4c')][_0xd75c('0x4d')](function(_0x3d9cf6){return db['UserNotification'][_0xd75c('0x4e')](_0x5a1807,{'raw':!![],'transaction':_0x3d9cf6})[_0xd75c('0x27')](function(_0x44af58){var _0x47023b={'sender':_0x5a1807[_0xd75c('0x43')],'description':_0x5a1807[_0xd75c('0x45')],'content':_0x5a1807[_0xd75c('0x2e')],'beep':_0x5a1807[_0xd75c('0x47')]};_0x24c409['forEach'](function(_0x409eb8){_0x47023b[_0xd75c('0x4f')]=_0x409eb8;socket[_0xd75c('0x50')](_0xd75c('0x51'),_0x47023b);});return _0x44af58;});});})[_0xd75c('0x27')](respondWithResult(_0x5b7ad9,0xc9))[_0xd75c('0x52')](handleError(_0x5b7ad9,null));};function getContent(_0x541c32){return new BPromise(function(_0x476f1c,_0x45dafc){if(_0x541c32[_0xd75c('0x30')]){_0x476f1c(_0x541c32[_0xd75c('0x30')]);return;}return db[_0xd75c('0x53')]['findOne']({'attributes':['html'],'where':{'id':_0x541c32[_0xd75c('0x31')]},'raw':!![]})[_0xd75c('0x27')](function(_0x8329b0){if(!_0x8329b0)throw new db[(_0xd75c('0x32'))]['ValidationError'](_0xd75c('0x54'));var _0x455c9e=Mustache[_0xd75c('0x55')](_0x8329b0[_0xd75c('0x56')],_0x541c32[_0xd75c('0x35')]);_0x476f1c(_0x455c9e);})[_0xd75c('0x52')](function(_0x2a2e2a){_0x45dafc(_0x2a2e2a);});});}function getRecipients(_0x496d31){return new BPromise(function(_0x2ea053,_0x169284){var _0x24e4b3=[];var _0x29efdf=[];_0x496d31[_0xd75c('0x57')](function(_0x5e50e9){var _0x4b2b4a=_[_0xd75c('0x58')](_0x5e50e9[_0xd75c('0x40')][_0xd75c('0x41')]());if(_0x4b2b4a===_0xd75c('0x59')){_0x24e4b3=_[_0xd75c('0x5a')](_0x24e4b3,_0x5e50e9[_0xd75c('0x5b')]);}else{if(_['includes'](_0x4b2b4a,_0xd75c('0x5c')))_0x4b2b4a=_0x4b2b4a[_0xd75c('0x5d')](_0xd75c('0x5c'),_0xd75c('0x5e'));_0x5e50e9[_0xd75c('0x5b')][_0xd75c('0x57')](function(_0x33058b){_0x29efdf['push'](getAgents(_0x4b2b4a,_0x33058b));});}});return BPromise[_0xd75c('0x5f')](_0x29efdf)[_0xd75c('0x27')](function(_0x3f228b){_0x24e4b3=_[_0xd75c('0x5a')](_0x24e4b3,_[_0xd75c('0x60')](_0x3f228b));_0x2ea053(_0x24e4b3);})[_0xd75c('0x52')](function(_0xb67d03){_0x169284(_0xb67d03);});});}function getAgents(_0x2c70c9,_0x3d77d1){return new BPromise(function(_0x27d78b,_0x338da5){return db[_0x2c70c9][_0xd75c('0x61')]({'where':{'id':_0x3d77d1}})[_0xd75c('0x27')](function(_0x5c17ed){return _0x5c17ed[_0xd75c('0x62')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b837b){var _0x2547b6=_[_0xd75c('0x63')](_0x1b837b,'id');_0x27d78b(_0x2547b6);});})['catch'](function(_0x3498db){_0x338da5(_0x3498db);});});}
\ No newline at end of file
index 8a65d9b..6691e85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42e6=['exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4f97ef,_0x2a88d1){var _0x3e56ee=function(_0x305c33){while(--_0x305c33){_0x4f97ef['push'](_0x4f97ef['shift']());}};_0x3e56ee(++_0x2a88d1);}(_0x42e6,0x177));var _0x642e=function(_0x10f30c,_0x206bb1){_0x10f30c=_0x10f30c-0x0;var _0x214d52=_0x42e6[_0x10f30c];return _0x214d52;};'use strict';var EventEmitter=require(_0x642e('0x0'));var UserNotification=require(_0x642e('0x1'))['db'][_0x642e('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x642e('0x3')](0x0);var events={'afterCreate':_0x642e('0x4'),'afterUpdate':_0x642e('0x5'),'afterDestroy':_0x642e('0x6')};function emitEvent(_0x48ed66){return function(_0xb1a301,_0x33d695,_0x4209fc){UserNotificationEvents[_0x642e('0x7')](_0x48ed66+':'+_0xb1a301['id'],_0xb1a301);UserNotificationEvents['emit'](_0x48ed66,_0xb1a301);_0x4209fc(null);};}for(var e in events){if(events[_0x642e('0x8')](e)){var event=events[e];UserNotification[_0x642e('0x9')](e,emitEvent(event));}}module[_0x642e('0xa')]=UserNotificationEvents;
\ No newline at end of file
+var _0x4f7b=['UserNotification','save','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x3ac312,_0x1f2646){var _0x16bbd9=function(_0x54ffda){while(--_0x54ffda){_0x3ac312['push'](_0x3ac312['shift']());}};_0x16bbd9(++_0x1f2646);}(_0x4f7b,0xdd));var _0xb4f7=function(_0x3294a5,_0x3bd15c){_0x3294a5=_0x3294a5-0x0;var _0x3a34ef=_0x4f7b[_0x3294a5];return _0x3a34ef;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xb4f7('0x0'))['db'][_0xb4f7('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb4f7('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x439ba3){return function(_0x319868,_0x5815d6,_0x148504){UserNotificationEvents[_0xb4f7('0x3')](_0x439ba3+':'+_0x319868['id'],_0x319868);UserNotificationEvents[_0xb4f7('0x3')](_0x439ba3,_0x319868);_0x148504(null);};}for(var e in events){if(events[_0xb4f7('0x4')](e)){var event=events[e];UserNotification[_0xb4f7('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
index e97d5d9..2017de3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e6b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci'];(function(_0x282536,_0x3ba66a){var _0x76aa80=function(_0x1625ae){while(--_0x1625ae){_0x282536['push'](_0x282536['shift']());}};_0x76aa80(++_0x3ba66a);}(_0x1e6b,0x1ad));var _0xb1e6=function(_0x5441f6,_0xc6f583){_0x5441f6=_0x5441f6-0x0;var _0x515268=_0x1e6b[_0x5441f6];return _0x515268;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb1e6('0x0'))(_0xb1e6('0x1'));var moment=require(_0xb1e6('0x2'));var BPromise=require(_0xb1e6('0x3'));var rp=require(_0xb1e6('0x4'));var fs=require('fs');var path=require(_0xb1e6('0x5'));var rimraf=require(_0xb1e6('0x6'));var config=require(_0xb1e6('0x7'));var attributes=require(_0xb1e6('0x8'));module['exports']=function(_0x5de089,_0x55e81e){return _0x5de089[_0xb1e6('0x9')](_0xb1e6('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb1e6('0xb'),'collate':_0xb1e6('0xc')});};
\ No newline at end of file
+var _0x765c=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications'];(function(_0x3dab96,_0x9ad0af){var _0x377a20=function(_0x30495b){while(--_0x30495b){_0x3dab96['push'](_0x3dab96['shift']());}};_0x377a20(++_0x9ad0af);}(_0x765c,0x12d));var _0xc765=function(_0x281c69,_0x52b29f){_0x281c69=_0x281c69-0x0;var _0x504b6c=_0x765c[_0x281c69];return _0x504b6c;};'use strict';var _=require('lodash');var util=require(_0xc765('0x0'));var logger=require(_0xc765('0x1'))(_0xc765('0x2'));var moment=require(_0xc765('0x3'));var BPromise=require(_0xc765('0x4'));var rp=require(_0xc765('0x5'));var fs=require('fs');var path=require(_0xc765('0x6'));var rimraf=require(_0xc765('0x7'));var config=require(_0xc765('0x8'));var attributes=require(_0xc765('0x9'));module[_0xc765('0xa')]=function(_0x54fb97,_0x1e7fd5){return _0x54fb97[_0xc765('0xb')](_0xc765('0xc'),attributes,{'tableName':_0xc765('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc765('0xe')});};
\ No newline at end of file
index a8005db..90e54da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd147=['../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserNotification,\x20%s,\x20%s','info','result','catch','ioredis','../../mysqldb'];(function(_0x22a524,_0x32c0d0){var _0x2ebb53=function(_0x4899a6){while(--_0x4899a6){_0x22a524['push'](_0x22a524['shift']());}};_0x2ebb53(++_0x32c0d0);}(_0xd147,0x94));var _0x7d14=function(_0x4a73c7,_0x3f98ac){_0x4a73c7=_0x4a73c7-0x0;var _0x4f35f9=_0xd147[_0x4a73c7];return _0x4f35f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d14('0x0'));var db=require(_0x7d14('0x1'))['db'];var utils=require(_0x7d14('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x7d14('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x7d14('0x4')][_0x7d14('0x5')]({'port':0x232a});config[_0x7d14('0x6')]=_[_0x7d14('0x7')](config['redis'],{'host':_0x7d14('0x8'),'port':0x18eb});var socket=require(_0x7d14('0x9'))(new Redis(config[_0x7d14('0x6')]));require(_0x7d14('0xa'))[_0x7d14('0xb')](socket);function respondWithRpcPromise(_0x215d1c,_0x2ef092,_0x48f7d2){return new BPromise(function(_0x30d4dc,_0x37b08b){return client[_0x7d14('0xc')](_0x215d1c,_0x48f7d2)[_0x7d14('0xd')](function(_0x165b4b){logger['info']('UserNotification,\x20%s,\x20%s',_0x2ef092,_0x7d14('0xe'));logger[_0x7d14('0xf')](_0x7d14('0x10'),_0x2ef092,_0x7d14('0xe'),JSON[_0x7d14('0x11')](_0x165b4b));if(_0x165b4b[_0x7d14('0x12')]){if(_0x165b4b[_0x7d14('0x12')][_0x7d14('0x13')]===0x1f4){logger[_0x7d14('0x12')]('UserNotification,\x20%s,\x20%s',_0x2ef092,_0x165b4b[_0x7d14('0x12')][_0x7d14('0x14')]);return _0x37b08b(_0x165b4b[_0x7d14('0x12')][_0x7d14('0x14')]);}logger[_0x7d14('0x12')](_0x7d14('0x15'),_0x2ef092,_0x165b4b['error'][_0x7d14('0x14')]);return _0x30d4dc(_0x165b4b[_0x7d14('0x12')][_0x7d14('0x14')]);}else{logger[_0x7d14('0x16')](_0x7d14('0x15'),_0x2ef092,_0x7d14('0xe'));_0x30d4dc(_0x165b4b[_0x7d14('0x17')][_0x7d14('0x14')]);}})[_0x7d14('0x18')](function(_0x2eb3a6){logger[_0x7d14('0x12')](_0x7d14('0x15'),_0x2ef092,_0x2eb3a6);_0x37b08b(_0x2eb3a6);});});}
\ No newline at end of file
+var _0xad70=['redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x38ce66,_0x38f2f0){var _0x58815a=function(_0x4895ea){while(--_0x4895ea){_0x38ce66['push'](_0x38ce66['shift']());}};_0x58815a(++_0x38f2f0);}(_0xad70,0x6f));var _0x0ad7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xad70[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ad7('0x0'));var BPromise=require(_0x0ad7('0x1'));var rs=require(_0x0ad7('0x2'));var fs=require('fs');var Redis=require(_0x0ad7('0x3'));var db=require(_0x0ad7('0x4'))['db'];var utils=require(_0x0ad7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0ad7('0x6'));var jayson=require(_0x0ad7('0x7'));var client=jayson['client'][_0x0ad7('0x8')]({'port':0x232a});config[_0x0ad7('0x9')]=_[_0x0ad7('0xa')](config[_0x0ad7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ad7('0xb'))(new Redis(config[_0x0ad7('0x9')]));require(_0x0ad7('0xc'))[_0x0ad7('0xd')](socket);function respondWithRpcPromise(_0x206a6a,_0x4c61ee,_0x22632e){return new BPromise(function(_0x404198,_0xf93823){return client[_0x0ad7('0xe')](_0x206a6a,_0x22632e)[_0x0ad7('0xf')](function(_0x1070c6){logger[_0x0ad7('0x10')](_0x0ad7('0x11'),_0x4c61ee,_0x0ad7('0x12'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x4c61ee,_0x0ad7('0x12'),JSON['stringify'](_0x1070c6));if(_0x1070c6[_0x0ad7('0x13')]){if(_0x1070c6['error'][_0x0ad7('0x14')]===0x1f4){logger[_0x0ad7('0x13')](_0x0ad7('0x11'),_0x4c61ee,_0x1070c6[_0x0ad7('0x13')][_0x0ad7('0x15')]);return _0xf93823(_0x1070c6['error'][_0x0ad7('0x15')]);}logger[_0x0ad7('0x13')](_0x0ad7('0x11'),_0x4c61ee,_0x1070c6['error'][_0x0ad7('0x15')]);return _0x404198(_0x1070c6[_0x0ad7('0x13')]['message']);}else{logger[_0x0ad7('0x10')](_0x0ad7('0x11'),_0x4c61ee,_0x0ad7('0x12'));_0x404198(_0x1070c6[_0x0ad7('0x16')][_0x0ad7('0x15')]);}})[_0x0ad7('0x17')](function(_0x182efe){logger['error'](_0x0ad7('0x11'),_0x4c61ee,_0x182efe);_0xf93823(_0x182efe);});});}
\ No newline at end of file
index f608d05..f7f3108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8eb=['emit','removeListener','register','length','userNotification:','./userNotification.events','save','update'];(function(_0x578e76,_0x2047bb){var _0x26e58b=function(_0x560d3a){while(--_0x560d3a){_0x578e76['push'](_0x578e76['shift']());}};_0x26e58b(++_0x2047bb);}(_0xf8eb,0xa5));var _0xbf8e=function(_0x11cc8a,_0x203bee){_0x11cc8a=_0x11cc8a-0x0;var _0x287a01=_0xf8eb[_0x11cc8a];return _0x287a01;};'use strict';var UserNotificationEvents=require(_0xbf8e('0x0'));var events=[_0xbf8e('0x1'),'remove',_0xbf8e('0x2')];function createListener(_0x1a630b,_0x424a8f){return function(_0xbbc3e0){_0x424a8f[_0xbf8e('0x3')](_0x1a630b,_0xbbc3e0);};}function removeListener(_0x582732,_0x213dd7){return function(){UserNotificationEvents[_0xbf8e('0x4')](_0x582732,_0x213dd7);};}exports[_0xbf8e('0x5')]=function(_0x72e74c){for(var _0xbe78b4=0x0,_0x532bc3=events[_0xbf8e('0x6')];_0xbe78b4<_0x532bc3;_0xbe78b4++){var _0x3b7cac=events[_0xbe78b4];var _0x31228a=createListener(_0xbf8e('0x7')+_0x3b7cac,_0x72e74c);UserNotificationEvents['on'](_0x3b7cac,_0x31228a);}};
\ No newline at end of file
+var _0xae2f=['remove','update','emit','register','length','userNotification:','./userNotification.events','save'];(function(_0x268147,_0xc54753){var _0x534f09=function(_0x14e6df){while(--_0x14e6df){_0x268147['push'](_0x268147['shift']());}};_0x534f09(++_0xc54753);}(_0xae2f,0xe6));var _0xfae2=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0xae2f[_0x3048ea];return _0x1a13c4;};'use strict';var UserNotificationEvents=require(_0xfae2('0x0'));var events=[_0xfae2('0x1'),_0xfae2('0x2'),_0xfae2('0x3')];function createListener(_0x5871b4,_0x5b0962){return function(_0x5a61af){_0x5b0962[_0xfae2('0x4')](_0x5871b4,_0x5a61af);};}function removeListener(_0x27d515,_0x2e6112){return function(){UserNotificationEvents['removeListener'](_0x27d515,_0x2e6112);};}exports[_0xfae2('0x5')]=function(_0x2476e5){for(var _0x1b81c3=0x0,_0x19e509=events[_0xfae2('0x6')];_0x1b81c3<_0x19e509;_0x1b81c3++){var _0x1562ef=events[_0x1b81c3];var _0x387eec=createListener(_0xfae2('0x7')+_0x1562ef,_0x2476e5);UserNotificationEvents['on'](_0x1562ef,_0x387eec);}};
\ No newline at end of file
index 6602acf..ba910d6 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(_0x2eadc9,_0x54b54b){var _0x59c2ac=function(_0xc4cc2){while(--_0xc4cc2){_0x2eadc9['push'](_0x2eadc9['shift']());}};_0x59c2ac(++_0x54b54b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xcb91[_0x21549c];return _0x426cbd;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x282932,_0x42703a){var _0x41365a=function(_0x531e6c){while(--_0x531e6c){_0x282932['push'](_0x282932['shift']());}};_0x41365a(++_0x42703a);}(_0x70e0,0x17b));var _0x070e=function(_0x5a76c9,_0x29915a){_0x5a76c9=_0x5a76c9-0x0;var _0x14e015=_0x70e0[_0x5a76c9];return _0x14e015;};'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 f1e2957..6959676 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0845=['sequelize'];(function(_0x5ac69a,_0x354e2d){var _0x33a28e=function(_0x5391e7){while(--_0x5391e7){_0x5ac69a['push'](_0x5ac69a['shift']());}};_0x33a28e(++_0x354e2d);}(_0x0845,0x125));var _0x5084=function(_0x588a44,_0x157b85){_0x588a44=_0x588a44-0x0;var _0x106d5c=_0x0845[_0x588a44];return _0x106d5c;};'use strict';var Sequelize=require(_0x5084('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x82d2=['exports','sequelize'];(function(_0x18bfdb,_0x241d43){var _0x44334c=function(_0x55e999){while(--_0x55e999){_0x18bfdb['push'](_0x18bfdb['shift']());}};_0x44334c(++_0x241d43);}(_0x82d2,0xdd));var _0x282d=function(_0x1afb9e,_0x242e2a){_0x1afb9e=_0x1afb9e-0x0;var _0x41bfb8=_0x82d2[_0x1afb9e];return _0x41bfb8;};'use strict';var Sequelize=require(_0x282d('0x0'));module[_0x282d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 34fef87..1a1b125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc40=['define','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','exports'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xfc40,0x157));var _0x0fc4=function(_0x195ea7,_0x25c298){_0x195ea7=_0x195ea7-0x0;var _0x4ef781=_0xfc40[_0x195ea7];return _0x4ef781;};'use strict';var _=require(_0x0fc4('0x0'));var util=require(_0x0fc4('0x1'));var logger=require(_0x0fc4('0x2'))('api');var moment=require(_0x0fc4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fc4('0x4'));var rimraf=require(_0x0fc4('0x5'));var config=require(_0x0fc4('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x0fc4('0x7')]=function(_0x3e3a3f,_0x20edec){return _0x3e3a3f[_0x0fc4('0x8')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3bda=['moment','request-promise','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x8b5e76,_0x183f5b){var _0x49daf8=function(_0x1991ae){while(--_0x1991ae){_0x8b5e76['push'](_0x8b5e76['shift']());}};_0x49daf8(++_0x183f5b);}(_0x3bda,0x148));var _0xa3bd=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x3bda[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0xa3bd('0x0'));var util=require(_0xa3bd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa3bd('0x2'));var BPromise=require('bluebird');var rp=require(_0xa3bd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa3bd('0x4'));var attributes=require(_0xa3bd('0x5'));module[_0xa3bd('0x6')]=function(_0x181bd6,_0x2b5f87){return _0x181bd6[_0xa3bd('0x7')](_0xa3bd('0x8'),attributes,{'tableName':_0xa3bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 11fda93..b45d7ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7672=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','../../mysqldb'];(function(_0x5df049,_0x260c2a){var _0x4886e2=function(_0x346d66){while(--_0x346d66){_0x5df049['push'](_0x5df049['shift']());}};_0x4886e2(++_0x260c2a);}(_0x7672,0x89));var _0x2767=function(_0x57a772,_0x7e0f64){_0x57a772=_0x57a772-0x0;var _0x365e2e=_0x7672[_0x57a772];return _0x365e2e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2767('0x0'));var BPromise=require(_0x2767('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2767('0x2'))['db'];var utils=require(_0x2767('0x3'));var logger=require(_0x2767('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2767('0x5'));var client=jayson[_0x2767('0x6')][_0x2767('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x31e6b9,_0x23fbd3,_0x23aeb7){return new BPromise(function(_0x3d9e6e,_0x5b4aba){return client[_0x2767('0x8')](_0x31e6b9,_0x23aeb7)[_0x2767('0x9')](function(_0x16c69d){logger[_0x2767('0xa')](_0x2767('0xb'),_0x23fbd3,'request\x20sent');logger[_0x2767('0xc')](_0x2767('0xd'),_0x23fbd3,_0x2767('0xe'),JSON[_0x2767('0xf')](_0x16c69d));if(_0x16c69d[_0x2767('0x10')]){if(_0x16c69d['error'][_0x2767('0x11')]===0x1f4){logger[_0x2767('0x10')](_0x2767('0xb'),_0x23fbd3,_0x16c69d[_0x2767('0x10')][_0x2767('0x12')]);return _0x5b4aba(_0x16c69d['error'][_0x2767('0x12')]);}logger[_0x2767('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23fbd3,_0x16c69d['error'][_0x2767('0x12')]);return _0x3d9e6e(_0x16c69d[_0x2767('0x10')][_0x2767('0x12')]);}else{logger[_0x2767('0xa')](_0x2767('0xb'),_0x23fbd3,_0x2767('0xe'));_0x3d9e6e(_0x16c69d[_0x2767('0x13')][_0x2767('0x12')]);}})['catch'](function(_0x2a098c){logger[_0x2767('0x10')](_0x2767('0xb'),_0x23fbd3,_0x2a098c);_0x5b4aba(_0x2a098c);});});}
\ No newline at end of file
+var _0x3b01=['http','request','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5c5d58,_0x46c90f){var _0x3211d6=function(_0x4dce89){while(--_0x4dce89){_0x5c5d58['push'](_0x5c5d58['shift']());}};_0x3211d6(++_0x46c90f);}(_0x3b01,0xdb));var _0x13b0=function(_0x983d8a,_0x1c1493){_0x983d8a=_0x983d8a-0x0;var _0x3908e6=_0x3b01[_0x983d8a];return _0x3908e6;};'use strict';var _=require(_0x13b0('0x0'));var util=require(_0x13b0('0x1'));var moment=require(_0x13b0('0x2'));var BPromise=require(_0x13b0('0x3'));var rs=require(_0x13b0('0x4'));var fs=require('fs');var Redis=require(_0x13b0('0x5'));var db=require(_0x13b0('0x6'))['db'];var utils=require(_0x13b0('0x7'));var logger=require(_0x13b0('0x8'))('rpc');var config=require(_0x13b0('0x9'));var jayson=require(_0x13b0('0xa'));var client=jayson['client'][_0x13b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ccf56,_0x3a800f,_0x1ec8ce){return new BPromise(function(_0x38bb6e,_0x20d4a5){return client[_0x13b0('0xc')](_0x5ccf56,_0x1ec8ce)['then'](function(_0x135988){logger[_0x13b0('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3a800f,'request\x20sent');logger[_0x13b0('0xe')](_0x13b0('0xf'),_0x3a800f,_0x13b0('0x10'),JSON[_0x13b0('0x11')](_0x135988));if(_0x135988[_0x13b0('0x12')]){if(_0x135988['error']['code']===0x1f4){logger[_0x13b0('0x12')](_0x13b0('0x13'),_0x3a800f,_0x135988[_0x13b0('0x12')][_0x13b0('0x14')]);return _0x20d4a5(_0x135988[_0x13b0('0x12')][_0x13b0('0x14')]);}logger[_0x13b0('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3a800f,_0x135988[_0x13b0('0x12')][_0x13b0('0x14')]);return _0x38bb6e(_0x135988[_0x13b0('0x12')][_0x13b0('0x14')]);}else{logger[_0x13b0('0xd')](_0x13b0('0x13'),_0x3a800f,_0x13b0('0x10'));_0x38bb6e(_0x135988[_0x13b0('0x15')]['message']);}})[_0x13b0('0x16')](function(_0x15c23b){logger['error'](_0x13b0('0x13'),_0x3a800f,_0x15c23b);_0x20d4a5(_0x15c23b);});});}
\ No newline at end of file
index f5eb018..b21f74b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbf2=['../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/sections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','update','delete','destroy','removeSections','removeResources','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1ddc67,_0x32101b){var _0x5d1822=function(_0x51987b){while(--_0x51987b){_0x1ddc67['push'](_0x1ddc67['shift']());}};_0x5d1822(++_0x32101b);}(_0xbbf2,0x1d7));var _0x2bbf=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0xbbf2[_0x57cc22];return _0x6f7bdc;};'use strict';var multer=require('multer');var util=require(_0x2bbf('0x0'));var path=require('path');var timeout=require(_0x2bbf('0x1'));var express=require('express');var router=express[_0x2bbf('0x2')]();var fs_extra=require(_0x2bbf('0x3'));var auth=require(_0x2bbf('0x4'));var interaction=require(_0x2bbf('0x5'));var config=require(_0x2bbf('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2bbf('0x7')](_0x2bbf('0x8'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0xa')]);router[_0x2bbf('0x7')](_0x2bbf('0xb'),auth['isAuthenticated'](),controller[_0x2bbf('0xc')]);router[_0x2bbf('0x7')](_0x2bbf('0xd'),auth[_0x2bbf('0x9')](),controller['getSections']);router['get'](_0x2bbf('0xe'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0xf')]);router['post']('/',auth[_0x2bbf('0x9')](),controller[_0x2bbf('0x10')]);router[_0x2bbf('0x11')](_0x2bbf('0x12'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0x13')]);router['post'](_0x2bbf('0xd'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0x14')]);router['post'](_0x2bbf('0xe'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0x15')]);router['put'](_0x2bbf('0xb'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0x16')]);router[_0x2bbf('0x17')](_0x2bbf('0xb'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0x18')]);router['delete'](_0x2bbf('0xd'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0x19')]);router['delete'](_0x2bbf('0xe'),auth[_0x2bbf('0x9')](),controller[_0x2bbf('0x1a')]);module[_0x2bbf('0x1b')]=router;
\ No newline at end of file
+var _0xbd8f=['/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1f4f60,_0x4a4202){var _0x3d1b03=function(_0x59be89){while(--_0x59be89){_0x1f4f60['push'](_0x1f4f60['shift']());}};_0x3d1b03(++_0x4a4202);}(_0xbd8f,0x130));var _0xfbd8=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0xbd8f[_0x146837];return _0x3d7e60;};'use strict';var multer=require(_0xfbd8('0x0'));var util=require(_0xfbd8('0x1'));var path=require(_0xfbd8('0x2'));var timeout=require(_0xfbd8('0x3'));var express=require('express');var router=express[_0xfbd8('0x4')]();var fs_extra=require(_0xfbd8('0x5'));var auth=require(_0xfbd8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfbd8('0x7'));var controller=require(_0xfbd8('0x8'));router[_0xfbd8('0x9')]('/',auth[_0xfbd8('0xa')](),controller[_0xfbd8('0xb')]);router[_0xfbd8('0x9')](_0xfbd8('0xc'),auth[_0xfbd8('0xa')](),controller[_0xfbd8('0xd')]);router[_0xfbd8('0x9')](_0xfbd8('0xe'),auth[_0xfbd8('0xa')](),controller[_0xfbd8('0xf')]);router['get'](_0xfbd8('0x10'),auth[_0xfbd8('0xa')](),controller[_0xfbd8('0x11')]);router[_0xfbd8('0x9')](_0xfbd8('0x12'),auth[_0xfbd8('0xa')](),controller[_0xfbd8('0x13')]);router[_0xfbd8('0x14')]('/',auth[_0xfbd8('0xa')](),controller[_0xfbd8('0x15')]);router[_0xfbd8('0x14')](_0xfbd8('0x16'),auth[_0xfbd8('0xa')](),controller['clone']);router[_0xfbd8('0x14')]('/:id/sections',auth[_0xfbd8('0xa')](),controller[_0xfbd8('0x17')]);router[_0xfbd8('0x14')](_0xfbd8('0x12'),auth[_0xfbd8('0xa')](),controller[_0xfbd8('0x18')]);router[_0xfbd8('0x19')](_0xfbd8('0xe'),auth[_0xfbd8('0xa')](),controller[_0xfbd8('0x1a')]);router[_0xfbd8('0x1b')](_0xfbd8('0xe'),auth[_0xfbd8('0xa')](),controller[_0xfbd8('0x1c')]);router[_0xfbd8('0x1b')]('/:id/sections',auth['isAuthenticated'](),controller[_0xfbd8('0x1d')]);router[_0xfbd8('0x1b')]('/:id/resources',auth[_0xfbd8('0xa')](),controller[_0xfbd8('0x1e')]);module[_0xfbd8('0x1f')]=router;
\ No newline at end of file
index 8edf28b..71277b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38b9=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x256e86,_0x280371){var _0x2d9230=function(_0x5a99f9){while(--_0x5a99f9){_0x256e86['push'](_0x256e86['shift']());}};_0x2d9230(++_0x280371);}(_0x38b9,0xe7));var _0x938b=function(_0x3afec1,_0x23aab9){_0x3afec1=_0x3afec1-0x0;var _0x29994c=_0x38b9[_0x3afec1];return _0x29994c;};'use strict';var Sequelize=require(_0x938b('0x0'));module[_0x938b('0x1')]={'name':{'type':Sequelize[_0x938b('0x2')],'allowNull':![],'unique':_0x938b('0x3')},'crudPermissions':{'type':Sequelize[_0x938b('0x2')],'set':function(_0xe5a131){this[_0x938b('0x4')](_0x938b('0x5'),_0xe5a131?_0xe5a131[_0x938b('0x6')](''):[]);},'get':function(){return this[_0x938b('0x7')](_0x938b('0x5'))?this['getDataValue'](_0x938b('0x5'))[_0x938b('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x938b('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x938b('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x938b('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x938b('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x938b('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x938b('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x938b('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x938b('0x9')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe15c=['split','BOOLEAN','sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x5dd4fe,_0x2bf86c){var _0x147235=function(_0x480e4f){while(--_0x480e4f){_0x5dd4fe['push'](_0x5dd4fe['shift']());}};_0x147235(++_0x2bf86c);}(_0xe15c,0x161));var _0xce15=function(_0x1bca44,_0x4be6ac){_0x1bca44=_0x1bca44-0x0;var _0x5376f2=_0xe15c[_0x1bca44];return _0x5376f2;};'use strict';var Sequelize=require(_0xce15('0x0'));module[_0xce15('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xce15('0x2')],'set':function(_0x4b1e32){this[_0xce15('0x3')](_0xce15('0x4'),_0x4b1e32?_0x4b1e32[_0xce15('0x5')](''):[]);},'get':function(){return this[_0xce15('0x6')](_0xce15('0x4'))?this[_0xce15('0x6')](_0xce15('0x4'))[_0xce15('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xce15('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xce15('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xce15('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xce15('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xce15('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xce15('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xce15('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xce15('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index aa04905..9b01f15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['clone','get','omit','createdAt','updatedAt','transaction','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','destroy','describe','removeSections','ids','filter','includes','subsections','push','enabled','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','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','redis','defaults','localhost','./userProfile.socket','sendStatus','status','end','json','undefined','count','offset','limit','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body'];(function(_0x3d6c10,_0x3fff3b){var _0x5ea736=function(_0x8103a){while(--_0x8103a){_0x3d6c10['push'](_0x3d6c10['shift']());}};_0x5ea736(++_0x3fff3b);}(_0x2542,0x169));var _0x2254=function(_0x31109f,_0x54d13e){_0x31109f=_0x31109f-0x0;var _0x1b3085=_0x2542[_0x31109f];return _0x1b3085;};'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'];config[_0x2254('0x1a')]=_[_0x2254('0x1b')](config[_0x2254('0x1a')],{'host':_0x2254('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2254('0x1a')]));require(_0x2254('0x1d'))['register'](socket);function respondWithStatusCode(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xcc;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1e')](_0x1e582d);}return _0x2f4de[_0x2254('0x1f')](_0x1e582d)[_0x2254('0x20')]();};}function respondWithResult(_0x50f137,_0x18baf4){_0x18baf4=_0x18baf4||0xc8;return function(_0x57247a){if(_0x57247a){return _0x50f137[_0x2254('0x1f')](_0x18baf4)[_0x2254('0x21')](_0x57247a);}};}function respondWithFilteredResult(_0x170ffa,_0x25f8b2){return function(_0x1ae11e){if(_0x1ae11e){var _0x34f90e=typeof _0x25f8b2['offset']==='undefined'&&typeof _0x25f8b2['limit']===_0x2254('0x22');var _0x3a79f8=_0x1ae11e[_0x2254('0x23')];var _0x1f1163=_0x34f90e?0x0:_0x25f8b2[_0x2254('0x24')];var _0x2339bc=_0x34f90e?_0x1ae11e['count']:_0x25f8b2[_0x2254('0x24')]+_0x25f8b2[_0x2254('0x25')];var _0x906cde;if(_0x2339bc>=_0x3a79f8){_0x2339bc=_0x3a79f8;_0x906cde=0xc8;}else{_0x906cde=0xce;}_0x170ffa['status'](_0x906cde);return _0x170ffa['set']('Content-Range',_0x1f1163+'-'+_0x2339bc+'/'+_0x3a79f8)[_0x2254('0x21')](_0x1ae11e);}return null;};}function patchUpdates(_0x559af4){return function(_0xf88b56){try{jsonpatch['apply'](_0xf88b56,_0x559af4,!![]);}catch(_0x5713e4){return BPromise['reject'](_0x5713e4);}return _0xf88b56['save']();};}function saveUpdates(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x26')](_0x5e5edb)[_0x2254('0x27')](function(_0x265467){return _0x265467;});}return null;};}function removeEntity(_0x13522d,_0x1349c9){return function(_0x51b578){if(_0x51b578){return _0x51b578['destroy']()[_0x2254('0x27')](function(){_0x13522d['status'](0xcc)[_0x2254('0x20')]();});}};}function handleEntityNotFound(_0x141dc5,_0x31a543){return function(_0x3aa0bd){if(!_0x3aa0bd){_0x141dc5[_0x2254('0x1e')](0x194);}return _0x3aa0bd;};}function handleError(_0x482688,_0x1a8a0d){_0x1a8a0d=_0x1a8a0d||0x1f4;return function(_0x2a789b){logger[_0x2254('0x28')](_0x2a789b[_0x2254('0x29')]);if(_0x2a789b[_0x2254('0x2a')]){delete _0x2a789b[_0x2254('0x2a')];}_0x482688[_0x2254('0x1f')](_0x1a8a0d)[_0x2254('0x2b')](_0x2a789b);};}exports[_0x2254('0x2c')]=function(_0x221db9,_0x21c641){var _0xad7774={},_0x220f2a={},_0x27d30a={'count':0x0,'rows':[]};var _0x4577f4=_[_0x2254('0x2d')](db[_0x2254('0x2e')][_0x2254('0x2f')],function(_0x2f32f8){return{'name':_0x2f32f8['fieldName'],'type':_0x2f32f8[_0x2254('0x30')][_0x2254('0x31')]};});_0x220f2a[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x4577f4,_0x2254('0x2a'));_0x220f2a[_0x2254('0x33')]=_[_0x2254('0x34')](_0x221db9[_0x2254('0x33')]);_0x220f2a[_0x2254('0x35')]=_['intersection'](_0x220f2a[_0x2254('0x32')],_0x220f2a[_0x2254('0x33')]);_0xad7774['attributes']=_[_0x2254('0x36')](_0x220f2a[_0x2254('0x32')],qs[_0x2254('0x37')](_0x221db9[_0x2254('0x33')]['fields']));_0xad7774['attributes']=_0xad7774[_0x2254('0x38')]['length']?_0xad7774[_0x2254('0x38')]:_0x220f2a[_0x2254('0x32')];if(!_0x221db9[_0x2254('0x33')][_0x2254('0x39')](_0x2254('0x3a'))){_0xad7774[_0x2254('0x25')]=qs[_0x2254('0x25')](_0x221db9['query'][_0x2254('0x25')]);_0xad7774[_0x2254('0x24')]=qs[_0x2254('0x24')](_0x221db9[_0x2254('0x33')][_0x2254('0x24')]);}_0xad7774[_0x2254('0x3b')]=qs[_0x2254('0x3c')](_0x221db9[_0x2254('0x33')][_0x2254('0x3c')]);_0xad7774[_0x2254('0x3d')]=qs['filters'](_[_0x2254('0x3e')](_0x221db9[_0x2254('0x33')],_0x220f2a[_0x2254('0x35')]),_0x4577f4);if(_0x221db9[_0x2254('0x33')]['filter']){_0xad7774[_0x2254('0x3d')]=_[_0x2254('0x3f')](_0xad7774[_0x2254('0x3d')],{'$or':_[_0x2254('0x2d')](_0x4577f4,function(_0x216199){if(_0x216199[_0x2254('0x30')]!==_0x2254('0x40')){var _0x1d285b={};_0x1d285b[_0x216199['name']]={'$like':'%'+_0x221db9[_0x2254('0x33')]['filter']+'%'};return _0x1d285b;}})});}_0xad7774=_[_0x2254('0x3f')]({},_0xad7774,_0x221db9[_0x2254('0x41')]);var _0x10a7ac={'where':_0xad7774[_0x2254('0x3d')]};return db[_0x2254('0x2e')][_0x2254('0x23')](_0x10a7ac)[_0x2254('0x27')](function(_0x568ec9){_0x27d30a[_0x2254('0x23')]=_0x568ec9;if(_0x221db9[_0x2254('0x33')][_0x2254('0x42')]){_0xad7774[_0x2254('0x43')]=[{'all':!![]}];}return db[_0x2254('0x2e')]['findAll'](_0xad7774);})[_0x2254('0x27')](function(_0x1dec43){_0x27d30a[_0x2254('0x44')]=_0x1dec43;return _0x27d30a;})[_0x2254('0x27')](respondWithFilteredResult(_0x21c641,_0xad7774))[_0x2254('0x45')](handleError(_0x21c641,null));};exports['show']=function(_0x12a227,_0x47c933){var _0x91e091={'raw':![],'where':{'id':_0x12a227[_0x2254('0x46')]['id']}},_0x1ded9a={};_0x1ded9a[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x2f')]);_0x1ded9a[_0x2254('0x33')]=_[_0x2254('0x34')](_0x12a227[_0x2254('0x33')]);_0x1ded9a[_0x2254('0x35')]=_[_0x2254('0x36')](_0x1ded9a[_0x2254('0x32')],_0x1ded9a['query']);_0x91e091[_0x2254('0x38')]=_[_0x2254('0x36')](_0x1ded9a[_0x2254('0x32')],qs['fields'](_0x12a227[_0x2254('0x33')][_0x2254('0x37')]));_0x91e091[_0x2254('0x38')]=_0x91e091[_0x2254('0x38')][_0x2254('0x47')]?_0x91e091[_0x2254('0x38')]:_0x1ded9a[_0x2254('0x32')];if(_0x12a227[_0x2254('0x33')][_0x2254('0x42')]){_0x91e091['include']=[{'all':!![]}];}_0x91e091=_[_0x2254('0x3f')]({},_0x91e091,_0x12a227[_0x2254('0x41')]);return db[_0x2254('0x2e')][_0x2254('0x48')](_0x91e091)[_0x2254('0x27')](handleEntityNotFound(_0x47c933,null))[_0x2254('0x27')](respondWithResult(_0x47c933,null))[_0x2254('0x45')](handleError(_0x47c933,null));};exports[_0x2254('0x49')]=function(_0x3ac691,_0xa103ea){return db['UserProfile'][_0x2254('0x49')](_0x3ac691[_0x2254('0x4a')],{})['then'](respondWithResult(_0xa103ea,0xc9))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4b')]=function(_0x12e2ff,_0x4331a9){var _0x5debf6={'where':{'id':_0x12e2ff[_0x2254('0x46')]['id']}},_0x102e4b={};_0x102e4b['model']=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x2f')]);_0x5debf6[_0x2254('0x38')]=_['intersection'](_0x102e4b[_0x2254('0x32')],qs[_0x2254('0x37')](_0x12e2ff[_0x2254('0x33')]['fields']));_0x5debf6['attributes']=_0x5debf6[_0x2254('0x38')][_0x2254('0x47')]?_0x5debf6['attributes']:_0x102e4b[_0x2254('0x32')];if(_0x12e2ff['query']['includeAll']){_0x5debf6[_0x2254('0x43')]=[{'all':!![]}];}_0x5debf6=_[_0x2254('0x3f')]({},_0x5debf6,_0x12e2ff[_0x2254('0x41')]);return db[_0x2254('0x2e')][_0x2254('0x48')](_0x5debf6)['then'](handleEntityNotFound(_0x4331a9,null))['then'](function(_0x1bd988){if(_0x1bd988){var _0x5e3fbc=_0x1bd988[_0x2254('0x4c')]({'plain':!![]});_0x5e3fbc=qs[_0x2254('0x4d')](_0x5e3fbc,['id',_0x2254('0x4e'),_0x2254('0x4f'),'crudPermissions']);_0x12e2ff[_0x2254('0x4a')]=_[_0x2254('0x4d')](_0x12e2ff['body'],['id','createdAt',_0x2254('0x4f')]);return db['sequelize'][_0x2254('0x50')](function(_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x49')](_[_0x2254('0x3f')](_0x5e3fbc,_0x12e2ff['body']),{'include':_0x12e2ff['query'][_0x2254('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x305ace})['then'](function(_0x335c66){var _0x510fe0=_0x335c66['get']({'plain':!![]});return db['UserProfileSection'][_0x2254('0x51')]({'where':{'userProfileId':_0x12e2ff[_0x2254('0x46')]['id']},'raw':!![]})[_0x2254('0x27')](function(_0x3ea2d9){if(_0x3ea2d9){return BPromise[_0x2254('0x52')](_0x3ea2d9,function(_0x1cf757){return new BPromise(function(_0x14b1ba,_0x25137c){if(_0x1cf757[_0x2254('0x53')]===null||_0x1cf757[_0x2254('0x53')]===0x1)_0x14b1ba(null);return db[_0x2254('0x54')][_0x2254('0x51')]({'where':{'sectionId':_0x1cf757['id']},'raw':!![]})[_0x2254('0x27')](function(_0x24e57a){var _0x2f391d=_[_0x2254('0x2d')](_0x24e57a,function(_0x4659fc){return qs[_0x2254('0x4d')](_0x4659fc,['id',_0x2254('0x4e'),'updatedAt',_0x2254('0x55')]);});_0x14b1ba(_0x2f391d);})[_0x2254('0x45')](function(_0x3b1aae){_0x25137c(_0x3b1aae);});})[_0x2254('0x27')](function(_0x4c966a){var _0x494347=qs[_0x2254('0x4d')](_0x1cf757,['id',_0x2254('0x4e'),_0x2254('0x4f')]);_0x494347[_0x2254('0x56')]=_0x510fe0['id'];if(_0x4c966a)_0x494347[_0x2254('0x57')]=_0x4c966a;return _0x494347;})['then'](function(_0x45b7bd){return db[_0x2254('0x58')][_0x2254('0x49')](_0x45b7bd,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x305ace});});})[_0x2254('0x27')](function(){return _0x510fe0;});}});});});}})['then'](respondWithResult(_0x4331a9,0xc9))[_0x2254('0x45')](handleError(_0x4331a9,null));};exports[_0x2254('0x26')]=function(_0x5b269d,_0x3c091e){if(_0x5b269d[_0x2254('0x4a')]['id']){delete _0x5b269d['body']['id'];}return db[_0x2254('0x2e')][_0x2254('0x48')]({'where':{'id':_0x5b269d['params']['id']}})['then'](handleEntityNotFound(_0x3c091e,null))[_0x2254('0x27')](saveUpdates(_0x5b269d[_0x2254('0x4a')],null))['then'](respondWithResult(_0x3c091e,null))['catch'](handleError(_0x3c091e,null));};exports[_0x2254('0x59')]=function(_0x53fca8,_0x1d880f){return db['UserProfile'][_0x2254('0x48')]({'where':{'id':_0x53fca8[_0x2254('0x46')]['id']}})[_0x2254('0x27')](handleEntityNotFound(_0x1d880f,null))[_0x2254('0x27')](removeEntity(_0x1d880f,null))['catch'](handleError(_0x1d880f,null));};exports[_0x2254('0x5a')]=function(_0x5ecf82,_0x1c2158){return db[_0x2254('0x2e')]['describe']()[_0x2254('0x27')](respondWithResult(_0x1c2158,null))[_0x2254('0x45')](handleError(_0x1c2158,null));};exports['addSections']=function(_0x32614f,_0x3b3b20){var _0x28ef48=_0x32614f[_0x2254('0x4a')];return db['UserProfile'][_0x2254('0x48')]({'where':{'id':_0x32614f[_0x2254('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b3b20,null))[_0x2254('0x27')](function(_0x4469c7){if(_0x4469c7){return db['sequelize'][_0x2254('0x50')](function(_0x566805){return db[_0x2254('0x58')]['destroy']({'where':{'userProfileId':_0x32614f[_0x2254('0x46')]['id'],'sectionId':_[_0x2254('0x2d')](_0x28ef48,function(_0x5e86d3){return _0x5e86d3[_0x2254('0x55')];})},'transaction':_0x566805})['then'](function(){var _0x2ad17c=_[_0x2254('0x2d')](_0x28ef48,function(_0x38294d){_0x38294d['userProfileId']=_0x32614f[_0x2254('0x46')]['id'];return _0x38294d;});var _0x5afa65=[];return BPromise[_0x2254('0x52')](_0x2ad17c,function(_0x33f29b){return db['UserProfileSection']['create'](_0x33f29b,{'include':[{'model':db[_0x2254('0x54')],'as':_0x2254('0x57')}],'raw':!![],'transaction':_0x566805})[_0x2254('0x27')](function(_0x2861d0){_0x5afa65['push'](_0x2861d0[_0x2254('0x4c')]({'plain':!![]}));});})[_0x2254('0x27')](function(){return _0x5afa65;});});});}})[_0x2254('0x27')](function(_0x403a4b){return _0x403a4b;})['then'](respondWithResult(_0x3b3b20,null))[_0x2254('0x45')](handleError(_0x3b3b20,null));};exports[_0x2254('0x5b')]=function(_0x5cddb0,_0x38e393){var _0x5cbdb0;return db[_0x2254('0x2e')]['find']({'where':{'id':_0x5cddb0['params']['id']},'attributes':['id','name']})[_0x2254('0x27')](handleEntityNotFound(_0x38e393,null))['then'](function(_0x20c5ef){if(_0x20c5ef){_0x5cbdb0=_0x20c5ef;return db[_0x2254('0x58')]['destroy']({'where':{'userProfileId':_0x5cddb0[_0x2254('0x46')]['id'],'sectionId':_0x5cddb0[_0x2254('0x33')][_0x2254('0x5c')]}});}})[_0x2254('0x27')](function(){return _0x5cbdb0;})[_0x2254('0x27')](respondWithStatusCode(_0x38e393,null))[_0x2254('0x45')](handleError(_0x38e393,null));};exports['getSections']=function(_0x553ac5,_0xeb4273){var _0xfaa537=[];var _0x148735=[];return db[_0x2254('0x58')][_0x2254('0x51')]({'where':{'userProfileId':_0x553ac5[_0x2254('0x46')]['id']},'raw':!![]})[_0x2254('0x27')](function(_0xf1a252){_0xfaa537=_[_0x2254('0x5d')](_0xf1a252,function(_0x39b95b){return _0x39b95b['enabled']===0x1||_[_0x2254('0x5e')]([0x3eb,0x709],_0x39b95b[_0x2254('0x55')]);});if(!_['isEmpty'](_0xfaa537)){return _[_0x2254('0x2d')](_0xfaa537,function(_0x57fb43){return _0x57fb43[_0x2254('0x55')];});}else{return;}})[_0x2254('0x27')](function(_0x4dfcb4){if(_0x4dfcb4)_0x148735=_0x4dfcb4;if(_[_0x2254('0x5e')](_0x148735,0x64)){var _0x4e699c=_[_0x2254('0x48')](_0xfaa537,{'sectionId':0x64});return hasDefaultDashboard(_0x4e699c)[_0x2254('0x27')](function(_0x30f2c9){return _[_0x2254('0x2d')](_0xfaa537,function(_0x5044a9){if(_0x5044a9[_0x2254('0x55')]===0x64){_0x5044a9[_0x2254('0x5f')]=_0x30f2c9;}return _0x5044a9;});});}else{return;}})[_0x2254('0x27')](function(_0x3a8d4f){if(_0x3a8d4f)_0xfaa537=_0x3a8d4f;if(_['includes'](_0x148735,0x3eb)){var _0x177f00=_[_0x2254('0x48')](_0xfaa537,{'sectionId':0x3eb});return getCustomDashboards(_0x177f00)['then'](function(_0x23f9ca){return _[_0x2254('0x2d')](_0xfaa537,function(_0x54a384){if(_0x177f00['enabled']){if(_0x54a384[_0x2254('0x55')]===0x3eb){_0x54a384[_0x2254('0x5f')]=_0x23f9ca;}}else{if(_0x54a384[_0x2254('0x55')]===0x64){_0x54a384[_0x2254('0x5f')]=_0x23f9ca;}}return _0x54a384;});});}else{return;}})[_0x2254('0x27')](function(_0x335c69){if(_0x335c69)_0xfaa537=_0x335c69;if(_[_0x2254('0x5e')](_0x148735,0x709)){var _0x251d70=_[_0x2254('0x48')](_0xfaa537,{'sectionId':0x709});return getPlugins(_0x251d70)['then'](function(_0x10c44){if(_0x251d70['enabled']){return _[_0x2254('0x2d')](_0xfaa537,function(_0x555f0e){if(_0x555f0e[_0x2254('0x55')]===0x709){_0x555f0e[_0x2254('0x5f')]=_0x10c44;}return _0x555f0e;});}else{var _0x2b0a45={'sectionId':0x76c,'enabled':0x1,'subsections':_0x10c44};var _0x53ef4e=_[_0x2254('0x2d')](_0xfaa537);_0x53ef4e[_0x2254('0x60')](_0x2b0a45);return _0x53ef4e;}});}else{return;}})[_0x2254('0x27')](function(_0x472758){if(_0x472758)_0xfaa537=_0x472758;return _[_0x2254('0x5d')](_0xfaa537,[_0x2254('0x61'),0x1]);})[_0x2254('0x27')](respondWithResult(_0xeb4273,null))[_0x2254('0x45')](handleError(_0xeb4273,null));};function hasDefaultDashboard(_0x203d05){var _0x146b52=[0x65];return new BPromise(function(_0x25a0aa,_0x46f6bc){try{if(_0x203d05[_0x2254('0x53')]){_0x25a0aa(_0x146b52);}else{return db['UserProfileResource'][_0x2254('0x62')]({'where':{'sectionId':_0x203d05['id']},'raw':!![]})['then'](function(_0x64c4f5){_0x64c4f5?_0x25a0aa(_0x146b52):_0x25a0aa();});}}catch(_0xb98b40){_0x46f6bc(_0xb98b40);}});}function getCustomDashboards(_0x3b1d5c){var _0x2c907a=[];return new BPromise(function(_0x23b78c,_0x2b5dba){try{if(_0x3b1d5c[_0x2254('0x53')]){return db['Dashboard'][_0x2254('0x51')]({'raw':!![]})['then'](function(_0x16aa33){_0x16aa33['forEach'](function(_0xa761ee){_0x2c907a[_0x2254('0x60')](_0xa761ee['id']+0x1869f);});_0x23b78c(_0x2c907a);});}else{return db[_0x2254('0x54')]['findAll']({'where':{'sectionId':_0x3b1d5c['id']},'raw':!![]})[_0x2254('0x27')](function(_0x160412){_0x160412[_0x2254('0x63')](function(_0x14f121){_0x2c907a[_0x2254('0x60')](_0x14f121[_0x2254('0x64')]+0x1869f);});_0x23b78c(_0x2c907a);});}}catch(_0x34185c){_0x2b5dba(_0x34185c);}});}function getPlugins(_0x13a4f6){var _0x5e94b6=[];return new BPromise(function(_0x56239e,_0x437d5b){try{if(_0x13a4f6['autoAssociation']){return db[_0x2254('0x65')][_0x2254('0x51')]({'raw':!![]})[_0x2254('0x27')](function(_0x438c95){_0x438c95[_0x2254('0x63')](function(_0x477a62){_0x5e94b6[_0x2254('0x60')](_0x477a62['id']+0x15b38);});_0x56239e(_0x5e94b6);});}else{return db['UserProfileResource'][_0x2254('0x51')]({'where':{'sectionId':_0x13a4f6['id']},'raw':!![]})[_0x2254('0x27')](function(_0x158e14){_0x158e14['forEach'](function(_0x3bbb35){_0x5e94b6[_0x2254('0x60')](_0x3bbb35[_0x2254('0x64')]+0x15b38);});_0x56239e(_0x5e94b6);});}}catch(_0x1426d6){_0x437d5b(_0x1426d6);}});}exports[_0x2254('0x66')]=function(_0x37ddcc,_0x461017){return db[_0x2254('0x2e')][_0x2254('0x48')]({'where':{'id':_0x37ddcc['params']['id']}})[_0x2254('0x27')](handleEntityNotFound(_0x461017,null))[_0x2254('0x27')](function(_0x590b46){if(_0x590b46){return db['sequelize'][_0x2254('0x50')](function(_0x54339e){return db[_0x2254('0x58')][_0x2254('0x51')]({'where':{'userProfileId':_0x37ddcc[_0x2254('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x2254('0x27')](function(_0x3a1d7c){if(_0x3a1d7c){return db[_0x2254('0x58')][_0x2254('0x59')]({'where':{'userProfileId':_0x37ddcc[_0x2254('0x46')]['id'],'id':_['map'](_0x3a1d7c,function(_0x59e759){return _0x59e759['id'];})},'transaction':_0x54339e});}})[_0x2254('0x27')](function(_0x1cfb9c){var _0x1e8617=_[_0x2254('0x2d')](_0x37ddcc[_0x2254('0x4a')],function(_0x4fac52){_0x4fac52['userProfileId']=_0x37ddcc[_0x2254('0x46')]['id'];return _0x4fac52;});return db['UserProfileSection'][_0x2254('0x67')](_0x1e8617,{'raw':!![],'transaction':_0x54339e});})[_0x2254('0x27')](function(_0x97117c){var _0x14b9a4=_[_0x2254('0x5d')](_[_0x2254('0x2d')](_0x97117c,function(_0x23e2a8){return _0x23e2a8['get']({'plain':!![]});}),{'includeAll':![]});if(_0x14b9a4){return db[_0x2254('0x58')][_0x2254('0x51')]({'where':{'userProfileId':_0x37ddcc['params']['id'],'sectionId':_[_0x2254('0x2d')](_0x14b9a4,function(_0x9cb479){return _0x9cb479[_0x2254('0x55')];})},'attributes':['id',_0x2254('0x55')],'raw':!![]})[_0x2254('0x27')](function(_0xa49145){var _0x121e7a=_[_0x2254('0x2d')](_0x37ddcc[_0x2254('0x4a')],function(_0xb24f9b){_0xb24f9b[_0x2254('0x56')]=_0x37ddcc['params']['id'];return _0xb24f9b;});return db[_0x2254('0x54')][_0x2254('0x67')](_0x121e7a,{'raw':!![],'transaction':_0x54339e});});}})[_0x2254('0x45')](handleError(_0x461017,null));});}})[_0x2254('0x27')](function(_0x346400){var _0x540c94=_[_0x2254('0x2d')](_0x346400,function(_0x5d579c){return _0x5d579c[_0x2254('0x4c')]({'plain':!![]});});})[_0x2254('0x27')](respondWithResult(_0x461017,null))[_0x2254('0x45')](handleError(_0x461017,null));};exports['removeResources']=function(_0x60f5ac,_0x2d2180,_0x45a011){return db[_0x2254('0x2e')][_0x2254('0x48')]({'where':{'id':_0x60f5ac[_0x2254('0x46')]['id']}})['then'](handleEntityNotFound(_0x2d2180,null))[_0x2254('0x27')](function(_0xf19a87){if(_0xf19a87){return _0xf19a87[_0x2254('0x68')](_0x60f5ac[_0x2254('0x33')][_0x2254('0x5c')]);}})['then'](respondWithStatusCode(_0x2d2180,null))['catch'](handleError(_0x2d2180,null));};exports[_0x2254('0x69')]=function(_0x4ca0b2,_0x25492b){var _0x3bea23={};if(!_0x4ca0b2[_0x2254('0x33')][_0x2254('0x6a')])throw new Error(_0x2254('0x6b'));if(!_0x4ca0b2[_0x2254('0x33')]['hasOwnProperty']('nolimit')){_0x3bea23[_0x2254('0x25')]=qs[_0x2254('0x25')](_0x4ca0b2[_0x2254('0x33')][_0x2254('0x25')]);_0x3bea23['offset']=qs[_0x2254('0x24')](_0x4ca0b2[_0x2254('0x33')][_0x2254('0x24')]);}return db[_0x2254('0x2e')][_0x2254('0x48')]({'where':{'id':_0x4ca0b2[_0x2254('0x46')]['id']}})[_0x2254('0x27')](function(_0x20414d){if(!_0x20414d)throw new Error(_0x2254('0x6c')+_0x4ca0b2['params']['id']);return db[_0x2254('0x2e')][_0x2254('0x69')](_0x4ca0b2);})[_0x2254('0x27')](respondWithFilteredResult(_0x25492b,_0x3bea23))['catch'](handleError(_0x25492b,null));};
\ No newline at end of file
+var _0x18c9=['../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','apply','save','then','destroy','end','error','stack','name','send','index','UserProfile','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','length','find','create','body','clone','get','omit','updatedAt','crudPermissions','createdAt','transaction','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','update','describe','addSections','UserProfileResource','push','ids','findAll','includes','isEmpty','subsections','enabled','Dashboard','forEach','resourceId','Plugin','sequelize','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x358f03,_0x5bf4d0){var _0x4f39fe=function(_0x5ad407){while(--_0x5ad407){_0x358f03['push'](_0x358f03['shift']());}};_0x4f39fe(++_0x5bf4d0);}(_0x18c9,0x13c));var _0x918c=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x18c9[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0x918c('0x0'));var rimraf=require(_0x918c('0x1'));var zipdir=require(_0x918c('0x2'));var jsonpatch=require(_0x918c('0x3'));var rp=require(_0x918c('0x4'));var moment=require(_0x918c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x918c('0x6'));var util=require(_0x918c('0x7'));var path=require('path');var sox=require(_0x918c('0x8'));var csv=require('to-csv');var ejs=require(_0x918c('0x9'));var fs=require('fs');var fs_extra=require(_0x918c('0xa'));var _=require(_0x918c('0xb'));var squel=require(_0x918c('0xc'));var crypto=require(_0x918c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x918c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x918c('0xf'));var Redis=require(_0x918c('0x10'));var authService=require(_0x918c('0x11'));var qs=require(_0x918c('0x12'));var as=require(_0x918c('0x13'));var hardwareService=require(_0x918c('0x14'));var logger=require(_0x918c('0x15'))(_0x918c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x918c('0x17'));var db=require(_0x918c('0x18'))['db'];config[_0x918c('0x19')]=_[_0x918c('0x1a')](config[_0x918c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x918c('0x1b'))(new Redis(config[_0x918c('0x19')]));require(_0x918c('0x1c'))[_0x918c('0x1d')](socket);function respondWithStatusCode(_0x1bd619,_0x2e3470){_0x2e3470=_0x2e3470||0xcc;return function(_0x3c68a4){if(_0x3c68a4){return _0x1bd619[_0x918c('0x1e')](_0x2e3470);}return _0x1bd619[_0x918c('0x1f')](_0x2e3470)['end']();};}function respondWithResult(_0x51b1bd,_0x50f880){_0x50f880=_0x50f880||0xc8;return function(_0x5baa51){if(_0x5baa51){return _0x51b1bd['status'](_0x50f880)[_0x918c('0x20')](_0x5baa51);}};}function respondWithFilteredResult(_0x54f9fa,_0x382775){return function(_0x1cad82){if(_0x1cad82){var _0x215eb8=typeof _0x382775['offset']==='undefined'&&typeof _0x382775[_0x918c('0x21')]===_0x918c('0x22');var _0x570482=_0x1cad82[_0x918c('0x23')];var _0x13d13a=_0x215eb8?0x0:_0x382775[_0x918c('0x24')];var _0x1c4a58=_0x215eb8?_0x1cad82['count']:_0x382775[_0x918c('0x24')]+_0x382775[_0x918c('0x21')];var _0x515cd6;if(_0x1c4a58>=_0x570482){_0x1c4a58=_0x570482;_0x515cd6=0xc8;}else{_0x515cd6=0xce;}_0x54f9fa['status'](_0x515cd6);return _0x54f9fa[_0x918c('0x25')]('Content-Range',_0x13d13a+'-'+_0x1c4a58+'/'+_0x570482)['json'](_0x1cad82);}return null;};}function patchUpdates(_0x33d952){return function(_0x53d829){try{jsonpatch[_0x918c('0x26')](_0x53d829,_0x33d952,!![]);}catch(_0xf3252){return BPromise['reject'](_0xf3252);}return _0x53d829[_0x918c('0x27')]();};}function saveUpdates(_0x30fd1b,_0x27c08b){return function(_0x1b395c){if(_0x1b395c){return _0x1b395c['update'](_0x30fd1b)[_0x918c('0x28')](function(_0x8577fe){return _0x8577fe;});}return null;};}function removeEntity(_0x2f22f5,_0x1b7f9c){return function(_0x124e3d){if(_0x124e3d){return _0x124e3d[_0x918c('0x29')]()['then'](function(){_0x2f22f5[_0x918c('0x1f')](0xcc)[_0x918c('0x2a')]();});}};}function handleEntityNotFound(_0x9aca49,_0x11e8bf){return function(_0x481fd7){if(!_0x481fd7){_0x9aca49[_0x918c('0x1e')](0x194);}return _0x481fd7;};}function handleError(_0x3b16d0,_0x48fa8c){_0x48fa8c=_0x48fa8c||0x1f4;return function(_0x2af472){logger[_0x918c('0x2b')](_0x2af472[_0x918c('0x2c')]);if(_0x2af472[_0x918c('0x2d')]){delete _0x2af472[_0x918c('0x2d')];}_0x3b16d0[_0x918c('0x1f')](_0x48fa8c)[_0x918c('0x2e')](_0x2af472);};}exports[_0x918c('0x2f')]=function(_0x1372a1,_0x344bbb){var _0x48d5da={},_0x183d31={},_0x38c253={'count':0x0,'rows':[]};var _0x4e7981=_['map'](db[_0x918c('0x30')][_0x918c('0x31')],function(_0x15d5d5){return{'name':_0x15d5d5['fieldName'],'type':_0x15d5d5[_0x918c('0x32')]['key']};});_0x183d31[_0x918c('0x33')]=_[_0x918c('0x34')](_0x4e7981,_0x918c('0x2d'));_0x183d31[_0x918c('0x35')]=_[_0x918c('0x36')](_0x1372a1['query']);_0x183d31[_0x918c('0x37')]=_[_0x918c('0x38')](_0x183d31[_0x918c('0x33')],_0x183d31[_0x918c('0x35')]);_0x48d5da[_0x918c('0x39')]=_[_0x918c('0x38')](_0x183d31['model'],qs['fields'](_0x1372a1[_0x918c('0x35')]['fields']));_0x48d5da[_0x918c('0x39')]=_0x48d5da['attributes']['length']?_0x48d5da[_0x918c('0x39')]:_0x183d31[_0x918c('0x33')];if(!_0x1372a1[_0x918c('0x35')]['hasOwnProperty']('nolimit')){_0x48d5da[_0x918c('0x21')]=qs[_0x918c('0x21')](_0x1372a1['query'][_0x918c('0x21')]);_0x48d5da[_0x918c('0x24')]=qs[_0x918c('0x24')](_0x1372a1[_0x918c('0x35')][_0x918c('0x24')]);}_0x48d5da['order']=qs[_0x918c('0x3a')](_0x1372a1[_0x918c('0x35')]['sort']);_0x48d5da[_0x918c('0x3b')]=qs['filters'](_[_0x918c('0x3c')](_0x1372a1[_0x918c('0x35')],_0x183d31['filters']),_0x4e7981);if(_0x1372a1[_0x918c('0x35')][_0x918c('0x3d')]){_0x48d5da[_0x918c('0x3b')]=_[_0x918c('0x3e')](_0x48d5da[_0x918c('0x3b')],{'$or':_[_0x918c('0x34')](_0x4e7981,function(_0x25b817){if(_0x25b817[_0x918c('0x32')]!==_0x918c('0x3f')){var _0x2caf6c={};_0x2caf6c[_0x25b817['name']]={'$like':'%'+_0x1372a1[_0x918c('0x35')][_0x918c('0x3d')]+'%'};return _0x2caf6c;}})});}_0x48d5da=_[_0x918c('0x3e')]({},_0x48d5da,_0x1372a1[_0x918c('0x40')]);var _0xc10161={'where':_0x48d5da['where']};return db[_0x918c('0x30')][_0x918c('0x23')](_0xc10161)[_0x918c('0x28')](function(_0x944087){_0x38c253[_0x918c('0x23')]=_0x944087;if(_0x1372a1['query'][_0x918c('0x41')]){_0x48d5da[_0x918c('0x42')]=[{'all':!![]}];}return db[_0x918c('0x30')]['findAll'](_0x48d5da);})[_0x918c('0x28')](function(_0x598f3d){_0x38c253[_0x918c('0x43')]=_0x598f3d;return _0x38c253;})[_0x918c('0x28')](respondWithFilteredResult(_0x344bbb,_0x48d5da))[_0x918c('0x44')](handleError(_0x344bbb,null));};exports[_0x918c('0x45')]=function(_0x5ddec5,_0x4125d9){var _0x14a376={'raw':![],'where':{'id':_0x5ddec5[_0x918c('0x46')]['id']}},_0x14f5e2={};_0x14f5e2['model']=_[_0x918c('0x36')](db[_0x918c('0x30')][_0x918c('0x31')]);_0x14f5e2['query']=_[_0x918c('0x36')](_0x5ddec5['query']);_0x14f5e2[_0x918c('0x37')]=_[_0x918c('0x38')](_0x14f5e2[_0x918c('0x33')],_0x14f5e2[_0x918c('0x35')]);_0x14a376[_0x918c('0x39')]=_[_0x918c('0x38')](_0x14f5e2[_0x918c('0x33')],qs[_0x918c('0x47')](_0x5ddec5[_0x918c('0x35')]['fields']));_0x14a376[_0x918c('0x39')]=_0x14a376[_0x918c('0x39')][_0x918c('0x48')]?_0x14a376[_0x918c('0x39')]:_0x14f5e2[_0x918c('0x33')];if(_0x5ddec5[_0x918c('0x35')]['includeAll']){_0x14a376[_0x918c('0x42')]=[{'all':!![]}];}_0x14a376=_['merge']({},_0x14a376,_0x5ddec5[_0x918c('0x40')]);return db[_0x918c('0x30')][_0x918c('0x49')](_0x14a376)[_0x918c('0x28')](handleEntityNotFound(_0x4125d9,null))[_0x918c('0x28')](respondWithResult(_0x4125d9,null))[_0x918c('0x44')](handleError(_0x4125d9,null));};exports[_0x918c('0x4a')]=function(_0x23bc40,_0xb637b4){return db[_0x918c('0x30')]['create'](_0x23bc40[_0x918c('0x4b')],{})[_0x918c('0x28')](respondWithResult(_0xb637b4,0xc9))['catch'](handleError(_0xb637b4,null));};exports[_0x918c('0x4c')]=function(_0x926a62,_0x3601c9){var _0x22603a={'where':{'id':_0x926a62['params']['id']}},_0x2f131f={};_0x2f131f['model']=_[_0x918c('0x36')](db[_0x918c('0x30')][_0x918c('0x31')]);_0x22603a[_0x918c('0x39')]=_['intersection'](_0x2f131f[_0x918c('0x33')],qs[_0x918c('0x47')](_0x926a62[_0x918c('0x35')][_0x918c('0x47')]));_0x22603a['attributes']=_0x22603a[_0x918c('0x39')]['length']?_0x22603a['attributes']:_0x2f131f[_0x918c('0x33')];if(_0x926a62['query'][_0x918c('0x41')]){_0x22603a[_0x918c('0x42')]=[{'all':!![]}];}_0x22603a=_['merge']({},_0x22603a,_0x926a62['options']);return db[_0x918c('0x30')]['find'](_0x22603a)[_0x918c('0x28')](handleEntityNotFound(_0x3601c9,null))['then'](function(_0x104e67){if(_0x104e67){var _0x39f7b2=_0x104e67[_0x918c('0x4d')]({'plain':!![]});_0x39f7b2=qs[_0x918c('0x4e')](_0x39f7b2,['id','createdAt',_0x918c('0x4f'),_0x918c('0x50')]);_0x926a62['body']=_[_0x918c('0x4e')](_0x926a62[_0x918c('0x4b')],['id',_0x918c('0x51'),_0x918c('0x4f')]);return db['sequelize'][_0x918c('0x52')](function(_0x43d632){return db[_0x918c('0x30')][_0x918c('0x4a')](_[_0x918c('0x3e')](_0x39f7b2,_0x926a62[_0x918c('0x4b')]),{'include':_0x926a62[_0x918c('0x35')][_0x918c('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x43d632})[_0x918c('0x28')](function(_0x4da2c3){var _0x291eb0=_0x4da2c3[_0x918c('0x4d')]({'plain':!![]});return db[_0x918c('0x53')]['findAll']({'where':{'userProfileId':_0x926a62[_0x918c('0x46')]['id']},'raw':!![]})[_0x918c('0x28')](function(_0x5e880d){if(_0x5e880d){return BPromise[_0x918c('0x54')](_0x5e880d,function(_0x1be1b0){return new BPromise(function(_0x2ab03a,_0x2cdfd0){if(_0x1be1b0['autoAssociation']===null||_0x1be1b0[_0x918c('0x55')]===0x1)_0x2ab03a(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1be1b0['id']},'raw':!![]})[_0x918c('0x28')](function(_0x1d317e){var _0x39ef96=_['map'](_0x1d317e,function(_0x190c3e){return qs[_0x918c('0x4e')](_0x190c3e,['id','createdAt',_0x918c('0x4f'),_0x918c('0x56')]);});_0x2ab03a(_0x39ef96);})['catch'](function(_0x31fd14){_0x2cdfd0(_0x31fd14);});})[_0x918c('0x28')](function(_0xba4df4){var _0x39f98=qs['omit'](_0x1be1b0,['id',_0x918c('0x51'),_0x918c('0x4f')]);_0x39f98[_0x918c('0x57')]=_0x291eb0['id'];if(_0xba4df4)_0x39f98[_0x918c('0x58')]=_0xba4df4;return _0x39f98;})[_0x918c('0x28')](function(_0x57aa9c){return db['UserProfileSection'][_0x918c('0x4a')](_0x57aa9c,{'include':[{'model':db['UserProfileResource'],'as':_0x918c('0x58')}],'raw':!![],'transaction':_0x43d632});});})[_0x918c('0x28')](function(){return _0x291eb0;});}});});});}})[_0x918c('0x28')](respondWithResult(_0x3601c9,0xc9))[_0x918c('0x44')](handleError(_0x3601c9,null));};exports[_0x918c('0x59')]=function(_0x496692,_0x1e26b7){if(_0x496692['body']['id']){delete _0x496692[_0x918c('0x4b')]['id'];}return db[_0x918c('0x30')][_0x918c('0x49')]({'where':{'id':_0x496692[_0x918c('0x46')]['id']}})[_0x918c('0x28')](handleEntityNotFound(_0x1e26b7,null))['then'](saveUpdates(_0x496692['body'],null))[_0x918c('0x28')](respondWithResult(_0x1e26b7,null))['catch'](handleError(_0x1e26b7,null));};exports[_0x918c('0x29')]=function(_0x55e9c1,_0x27fd2a){return db[_0x918c('0x30')][_0x918c('0x49')]({'where':{'id':_0x55e9c1[_0x918c('0x46')]['id']}})[_0x918c('0x28')](handleEntityNotFound(_0x27fd2a,null))[_0x918c('0x28')](removeEntity(_0x27fd2a,null))[_0x918c('0x44')](handleError(_0x27fd2a,null));};exports[_0x918c('0x5a')]=function(_0x361ca1,_0x38cf15){return db[_0x918c('0x30')][_0x918c('0x5a')]()['then'](respondWithResult(_0x38cf15,null))['catch'](handleError(_0x38cf15,null));};exports[_0x918c('0x5b')]=function(_0x23a3eb,_0x432960){var _0x47b33b=_0x23a3eb[_0x918c('0x4b')];return db[_0x918c('0x30')][_0x918c('0x49')]({'where':{'id':_0x23a3eb[_0x918c('0x46')]['id']}})[_0x918c('0x28')](handleEntityNotFound(_0x432960,null))[_0x918c('0x28')](function(_0x6cd31d){if(_0x6cd31d){return db['sequelize'][_0x918c('0x52')](function(_0x286487){return db[_0x918c('0x53')]['destroy']({'where':{'userProfileId':_0x23a3eb[_0x918c('0x46')]['id'],'sectionId':_[_0x918c('0x34')](_0x47b33b,function(_0x2defa5){return _0x2defa5[_0x918c('0x56')];})},'transaction':_0x286487})['then'](function(){var _0x5bdc70=_[_0x918c('0x34')](_0x47b33b,function(_0x2cc435){_0x2cc435['userProfileId']=_0x23a3eb['params']['id'];return _0x2cc435;});var _0x51ca4a=[];return BPromise[_0x918c('0x54')](_0x5bdc70,function(_0x37dbec){return db['UserProfileSection'][_0x918c('0x4a')](_0x37dbec,{'include':[{'model':db[_0x918c('0x5c')],'as':_0x918c('0x58')}],'raw':!![],'transaction':_0x286487})[_0x918c('0x28')](function(_0x11d527){_0x51ca4a[_0x918c('0x5d')](_0x11d527['get']({'plain':!![]}));});})[_0x918c('0x28')](function(){return _0x51ca4a;});});});}})['then'](function(_0x56be30){return _0x56be30;})[_0x918c('0x28')](respondWithResult(_0x432960,null))[_0x918c('0x44')](handleError(_0x432960,null));};exports['removeSections']=function(_0x2c985c,_0x4b99ca){var _0x404909;return db[_0x918c('0x30')][_0x918c('0x49')]({'where':{'id':_0x2c985c[_0x918c('0x46')]['id']},'attributes':['id',_0x918c('0x2d')]})[_0x918c('0x28')](handleEntityNotFound(_0x4b99ca,null))[_0x918c('0x28')](function(_0x525f07){if(_0x525f07){_0x404909=_0x525f07;return db[_0x918c('0x53')][_0x918c('0x29')]({'where':{'userProfileId':_0x2c985c[_0x918c('0x46')]['id'],'sectionId':_0x2c985c[_0x918c('0x35')][_0x918c('0x5e')]}});}})[_0x918c('0x28')](function(){return _0x404909;})[_0x918c('0x28')](respondWithStatusCode(_0x4b99ca,null))[_0x918c('0x44')](handleError(_0x4b99ca,null));};exports['getSections']=function(_0x22bbb5,_0x44a0f0){var _0x134309=[];var _0x1b0bb4=[];return db[_0x918c('0x53')][_0x918c('0x5f')]({'where':{'userProfileId':_0x22bbb5['params']['id']},'raw':!![]})[_0x918c('0x28')](function(_0x2c74bf){_0x134309=_[_0x918c('0x3d')](_0x2c74bf,function(_0x784606){return _0x784606['enabled']===0x1||_[_0x918c('0x60')]([0x3eb,0x709],_0x784606[_0x918c('0x56')]);});if(!_[_0x918c('0x61')](_0x134309)){return _[_0x918c('0x34')](_0x134309,function(_0x10ae97){return _0x10ae97[_0x918c('0x56')];});}else{return;}})['then'](function(_0x485154){if(_0x485154)_0x1b0bb4=_0x485154;if(_[_0x918c('0x60')](_0x1b0bb4,0x64)){var _0x55fcc6=_[_0x918c('0x49')](_0x134309,{'sectionId':0x64});return hasDefaultDashboard(_0x55fcc6)[_0x918c('0x28')](function(_0x31b8aa){return _['map'](_0x134309,function(_0xfd2d91){if(_0xfd2d91[_0x918c('0x56')]===0x64){_0xfd2d91[_0x918c('0x62')]=_0x31b8aa;}return _0xfd2d91;});});}else{return;}})['then'](function(_0x104a75){if(_0x104a75)_0x134309=_0x104a75;if(_[_0x918c('0x60')](_0x1b0bb4,0x3eb)){var _0x420c54=_[_0x918c('0x49')](_0x134309,{'sectionId':0x3eb});return getCustomDashboards(_0x420c54)[_0x918c('0x28')](function(_0x10b224){return _['map'](_0x134309,function(_0x116dc7){if(_0x420c54['enabled']){if(_0x116dc7[_0x918c('0x56')]===0x3eb){_0x116dc7['subsections']=_0x10b224;}}else{if(_0x116dc7[_0x918c('0x56')]===0x64){_0x116dc7[_0x918c('0x62')]=_0x10b224;}}return _0x116dc7;});});}else{return;}})[_0x918c('0x28')](function(_0x59b685){if(_0x59b685)_0x134309=_0x59b685;if(_['includes'](_0x1b0bb4,0x709)){var _0xe4d8d7=_[_0x918c('0x49')](_0x134309,{'sectionId':0x709});return getPlugins(_0xe4d8d7)['then'](function(_0x565718){if(_0xe4d8d7[_0x918c('0x63')]){return _[_0x918c('0x34')](_0x134309,function(_0x3663b8){if(_0x3663b8[_0x918c('0x56')]===0x709){_0x3663b8['subsections']=_0x565718;}return _0x3663b8;});}else{var _0x2f1c0b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x565718};var _0x263fa=_[_0x918c('0x34')](_0x134309);_0x263fa[_0x918c('0x5d')](_0x2f1c0b);return _0x263fa;}});}else{return;}})[_0x918c('0x28')](function(_0x4ba9b6){if(_0x4ba9b6)_0x134309=_0x4ba9b6;return _[_0x918c('0x3d')](_0x134309,['enabled',0x1]);})[_0x918c('0x28')](respondWithResult(_0x44a0f0,null))[_0x918c('0x44')](handleError(_0x44a0f0,null));};function hasDefaultDashboard(_0x12a188){var _0x59570c=[0x65];return new BPromise(function(_0x52bc6a,_0x539a43){try{if(_0x12a188[_0x918c('0x55')]){_0x52bc6a(_0x59570c);}else{return db[_0x918c('0x5c')]['findOne']({'where':{'sectionId':_0x12a188['id']},'raw':!![]})[_0x918c('0x28')](function(_0x194154){_0x194154?_0x52bc6a(_0x59570c):_0x52bc6a();});}}catch(_0x1d9a97){_0x539a43(_0x1d9a97);}});}function getCustomDashboards(_0x452392){var _0x1f8cc1=[];return new BPromise(function(_0x2df86e,_0x4f78b7){try{if(_0x452392['autoAssociation']){return db[_0x918c('0x64')]['findAll']({'raw':!![]})[_0x918c('0x28')](function(_0x24c261){_0x24c261['forEach'](function(_0x2a6092){_0x1f8cc1[_0x918c('0x5d')](_0x2a6092['id']+0x1869f);});_0x2df86e(_0x1f8cc1);});}else{return db[_0x918c('0x5c')][_0x918c('0x5f')]({'where':{'sectionId':_0x452392['id']},'raw':!![]})[_0x918c('0x28')](function(_0x2471bf){_0x2471bf[_0x918c('0x65')](function(_0x4e6cae){_0x1f8cc1[_0x918c('0x5d')](_0x4e6cae[_0x918c('0x66')]+0x1869f);});_0x2df86e(_0x1f8cc1);});}}catch(_0x387729){_0x4f78b7(_0x387729);}});}function getPlugins(_0x199525){var _0x294911=[];return new BPromise(function(_0x315004,_0x83b848){try{if(_0x199525[_0x918c('0x55')]){return db[_0x918c('0x67')][_0x918c('0x5f')]({'raw':!![]})[_0x918c('0x28')](function(_0x52ff17){_0x52ff17[_0x918c('0x65')](function(_0x3c1369){_0x294911['push'](_0x3c1369['id']+0x15b38);});_0x315004(_0x294911);});}else{return db[_0x918c('0x5c')][_0x918c('0x5f')]({'where':{'sectionId':_0x199525['id']},'raw':!![]})['then'](function(_0x13c542){_0x13c542[_0x918c('0x65')](function(_0x260595){_0x294911['push'](_0x260595[_0x918c('0x66')]+0x15b38);});_0x315004(_0x294911);});}}catch(_0x4a74aa){_0x83b848(_0x4a74aa);}});}exports['addResources']=function(_0x59300c,_0x1fe341){return db[_0x918c('0x30')][_0x918c('0x49')]({'where':{'id':_0x59300c['params']['id']}})['then'](handleEntityNotFound(_0x1fe341,null))[_0x918c('0x28')](function(_0x2a1d15){if(_0x2a1d15){return db[_0x918c('0x68')][_0x918c('0x52')](function(_0x121435){return db[_0x918c('0x53')][_0x918c('0x5f')]({'where':{'userProfileId':_0x59300c[_0x918c('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x918c('0x28')](function(_0x20185f){if(_0x20185f){return db[_0x918c('0x53')][_0x918c('0x29')]({'where':{'userProfileId':_0x59300c[_0x918c('0x46')]['id'],'id':_[_0x918c('0x34')](_0x20185f,function(_0x57ecde){return _0x57ecde['id'];})},'transaction':_0x121435});}})[_0x918c('0x28')](function(_0x49e9ae){var _0x37b5ec=_[_0x918c('0x34')](_0x59300c[_0x918c('0x4b')],function(_0x43bb3d){_0x43bb3d[_0x918c('0x57')]=_0x59300c[_0x918c('0x46')]['id'];return _0x43bb3d;});return db[_0x918c('0x53')][_0x918c('0x69')](_0x37b5ec,{'raw':!![],'transaction':_0x121435});})['then'](function(_0x4484d4){var _0x274126=_['filter'](_['map'](_0x4484d4,function(_0x4f6901){return _0x4f6901[_0x918c('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x274126){return db[_0x918c('0x53')][_0x918c('0x5f')]({'where':{'userProfileId':_0x59300c['params']['id'],'sectionId':_['map'](_0x274126,function(_0x37cc74){return _0x37cc74[_0x918c('0x56')];})},'attributes':['id',_0x918c('0x56')],'raw':!![]})[_0x918c('0x28')](function(_0x4e4403){var _0x4cb18a=_['map'](_0x59300c[_0x918c('0x4b')],function(_0x382984){_0x382984[_0x918c('0x57')]=_0x59300c['params']['id'];return _0x382984;});return db[_0x918c('0x5c')][_0x918c('0x69')](_0x4cb18a,{'raw':!![],'transaction':_0x121435});});}})['catch'](handleError(_0x1fe341,null));});}})[_0x918c('0x28')](function(_0x4eac60){var _0x1a3f7e=_[_0x918c('0x34')](_0x4eac60,function(_0x2054ae){return _0x2054ae[_0x918c('0x4d')]({'plain':!![]});});})[_0x918c('0x28')](respondWithResult(_0x1fe341,null))[_0x918c('0x44')](handleError(_0x1fe341,null));};exports[_0x918c('0x6a')]=function(_0x46bbda,_0x5414c0,_0x5ca625){return db[_0x918c('0x30')][_0x918c('0x49')]({'where':{'id':_0x46bbda[_0x918c('0x46')]['id']}})[_0x918c('0x28')](handleEntityNotFound(_0x5414c0,null))[_0x918c('0x28')](function(_0x2c51c6){if(_0x2c51c6){return _0x2c51c6[_0x918c('0x6a')](_0x46bbda[_0x918c('0x35')][_0x918c('0x5e')]);}})['then'](respondWithStatusCode(_0x5414c0,null))[_0x918c('0x44')](handleError(_0x5414c0,null));};exports[_0x918c('0x6b')]=function(_0x4ad851,_0x5a489a){var _0x2ab08d={};if(!_0x4ad851['query'][_0x918c('0x6c')])throw new Error(_0x918c('0x6d'));if(!_0x4ad851[_0x918c('0x35')][_0x918c('0x6e')](_0x918c('0x6f'))){_0x2ab08d['limit']=qs[_0x918c('0x21')](_0x4ad851[_0x918c('0x35')]['limit']);_0x2ab08d[_0x918c('0x24')]=qs[_0x918c('0x24')](_0x4ad851['query'][_0x918c('0x24')]);}return db[_0x918c('0x30')][_0x918c('0x49')]({'where':{'id':_0x4ad851[_0x918c('0x46')]['id']}})[_0x918c('0x28')](function(_0x2a5221){if(!_0x2a5221)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x4ad851['params']['id']);return db[_0x918c('0x30')][_0x918c('0x6b')](_0x4ad851);})[_0x918c('0x28')](respondWithFilteredResult(_0x5a489a,_0x2ab08d))[_0x918c('0x44')](handleError(_0x5a489a,null));};
\ No newline at end of file
index 87f6f79..3b60264 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed54=['../../mysqldb','UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x34c5e6,_0x29e841){var _0xfbc1e1=function(_0xa666){while(--_0xa666){_0x34c5e6['push'](_0x34c5e6['shift']());}};_0xfbc1e1(++_0x29e841);}(_0xed54,0xfc));var _0x4ed5=function(_0x5c1001,_0x2e6c25){_0x5c1001=_0x5c1001-0x0;var _0x2335c7=_0xed54[_0x5c1001];return _0x2335c7;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x4ed5('0x0'))['db'][_0x4ed5('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4ed5('0x2')](0x0);var events={'afterCreate':_0x4ed5('0x3'),'afterUpdate':'update','afterDestroy':_0x4ed5('0x4')};function emitEvent(_0x39d4d7){return function(_0x5f4777,_0x5c6d8b,_0xf1fb13){UserProfileEvents[_0x4ed5('0x5')](_0x39d4d7+':'+_0x5f4777['id'],_0x5f4777);UserProfileEvents[_0x4ed5('0x5')](_0x39d4d7,_0x5f4777);_0xf1fb13(null);};}for(var e in events){if(events[_0x4ed5('0x6')](e)){var event=events[e];UserProfile[_0x4ed5('0x7')](e,emitEvent(event));}}module[_0x4ed5('0x8')]=UserProfileEvents;
\ No newline at end of file
+var _0x9af6=['hook','exports','events','../../mysqldb','UserProfile','update','emit'];(function(_0x5874c9,_0x512f92){var _0xb5e1e9=function(_0x11c860){while(--_0x11c860){_0x5874c9['push'](_0x5874c9['shift']());}};_0xb5e1e9(++_0x512f92);}(_0x9af6,0x1d7));var _0x69af=function(_0xbd7690,_0x3fa1dd){_0xbd7690=_0xbd7690-0x0;var _0x2d16cf=_0x9af6[_0xbd7690];return _0x2d16cf;};'use strict';var EventEmitter=require(_0x69af('0x0'));var UserProfile=require(_0x69af('0x1'))['db'][_0x69af('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x69af('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5e0e6b){return function(_0x185b85,_0x11f0e4,_0x2b73be){UserProfileEvents['emit'](_0x5e0e6b+':'+_0x185b85['id'],_0x185b85);UserProfileEvents[_0x69af('0x4')](_0x5e0e6b,_0x185b85);_0x2b73be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x69af('0x5')](e,emitEvent(event));}}module[_0x69af('0x6')]=UserProfileEvents;
\ No newline at end of file
index aca58b7..25af6cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['sort','filters','pick','key','foreignKey','merge','options','forEach','CustomReports','count','rows','ids','CmContact','include','Tags','tag','color','openTabs','true','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','exports','models','filter','value','findAll','then','associatedResources','map','field','name','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','odbc','SquareOdbc','parentSections','SquareProjects','projectName','projects','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','Agents','zendeskaccounts','salesforceaccounts','FreshdeskAccount','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','customdashboards','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','find','params','ignore','union','autoAssociation','model','push','all','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x0b0e,0x187));var _0xe0b0=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x0b0e[_0x543242];return _0x4c99b6;};'use strict';var _=require(_0xe0b0('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xe0b0('0x1'));var squel=require('squel');module[_0xe0b0('0x2')]=function(_0xdf715e){var _0x3b5e2b=_0xdf715e[_0xe0b0('0x3')];function _0x28040c(_0x38a058,_0x399e67){return new Promise(function(_0x185efa,_0x30e20d){if(!_0x399e67)return _0x185efa(null);var _0x28e40f=_0x399e67[_0xe0b0('0x4')]?{[_0x399e67['filter']['field']]:_0x399e67[_0xe0b0('0x4')][_0xe0b0('0x5')]}:undefined;return _0x3b5e2b[_0x38a058][_0xe0b0('0x6')]({'where':_0x28e40f,'raw':!![]})[_0xe0b0('0x7')](function(_0x4c24f9){_0x399e67[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](_0x4c24f9,'id');_0x185efa(_0x399e67);})['catch'](function(_0x1fef28){_0x30e20d(_0x1fef28);});});}function _0x2f32b6(_0x574d96,_0x399320){return new Promise(function(_0x2cdad2,_0x39b1c2){var _0x585615=_0x574d96[_0xe0b0('0x4')]?{[_0x574d96[_0xe0b0('0x4')][_0xe0b0('0xa')]]:_0x574d96[_0xe0b0('0x4')][_0xe0b0('0x5')]}:undefined;return _0x3b5e2b[_0x574d96['model']][_0xe0b0('0x6')]({'where':_0x585615,'raw':!![]})[_0xe0b0('0x7')](function(_0x743318){_0x399320[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](_0x743318,function(_0x55d884){return _0x55d884[_0xe0b0('0xb')];});_0x2cdad2(_0x399320);})['catch'](function(_0x35cb40){_0x39b1c2(_0x35cb40);});});}function _0xadee6e(_0x519ae8,_0x11fdca,_0x4a4cc0){if(!_0x11fdca)return Promise[_0xe0b0('0xc')](null);return new Promise(function(_0x100204,_0x56bcc7){return _0x3b5e2b['UserProfileResource'][_0xe0b0('0x6')]({'where':{'sectionId':_0x11fdca['id']},'raw':!![]})['then'](function(_0x4df8da){if(_0x519ae8['field']&&_0x519ae8[_0xe0b0('0xa')]!=='id'){_0x11fdca['associatedResources']=_['map'](_0x4df8da,function(_0x10cde1){return _0x10cde1[_0x519ae8['field']];});}else{if(_0x4a4cc0===_0xe0b0('0xd')){_0x11fdca['associatedResources']=_[_0xe0b0('0x9')](_0x4df8da,function(_0x1cd7c4){return{'id':_0x1cd7c4[_0xe0b0('0xe')],'type':_0x1cd7c4[_0xe0b0('0xf')]};});}else{_0x11fdca[_0xe0b0('0x8')]=_['map'](_0x4df8da,function(_0x4cae54){return _0x4cae54[_0xe0b0('0xe')];});}}_0x100204(_0x11fdca);})['catch'](function(_0x12b260){_0x56bcc7(_0x12b260);});});}function _0x31b5f8(_0x513e63,_0x170ad8){var _0x503883={'parentSections':[]};switch(_0x513e63[_0xe0b0('0x10')]()){case'squareprojects':_0x503883[_0xe0b0('0x11')]='SquareProject';break;case _0xe0b0('0x12'):_0x503883['childModel']=_0xe0b0('0x13');break;case'squarerecordings':_0x503883[_0xe0b0('0x11')]='SquareRecording';_0x503883[_0xe0b0('0x14')]=[{'name':_0xe0b0('0x15'),'field':_0xe0b0('0xb'),'foreignKey':_0xe0b0('0x16')}];break;case _0xe0b0('0x17'):_0x503883[_0xe0b0('0x11')]='JscriptyProject';break;case _0xe0b0('0x18'):_0x503883[_0xe0b0('0x11')]='CmContact';_0x503883[_0xe0b0('0x14')]=[{'name':_0xe0b0('0x19'),'field':'id','foreignKey':_0xe0b0('0x1a')}];break;case _0xe0b0('0x1b'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x1c');break;case _0xe0b0('0x1d'):_0x503883['childModel']=_0xe0b0('0x1e');break;case _0xe0b0('0x1f'):_0x503883['childModel']='CmCustomField';break;case _0xe0b0('0x20'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x21');break;case _0xe0b0('0x22'):_0x503883[_0xe0b0('0x11')]='ChatWebsite';break;case _0xe0b0('0x23'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x24');break;case _0xe0b0('0x25'):_0x503883[_0xe0b0('0x11')]='FaxAccount';break;case _0xe0b0('0x26'):case _0xe0b0('0x27'):case _0xe0b0('0x28'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x29');break;case _0xe0b0('0x2a'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x2b');break;case _0xe0b0('0x2c'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x2d');break;case _0xe0b0('0x2e'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x2f');_0x503883[_0xe0b0('0x14')]=[{'name':'Agents','field':_0xe0b0('0xb'),'foreignKey':_0xe0b0('0x30'),'model':_0xe0b0('0x31'),'filter':{'field':_0xe0b0('0x32'),'value':[_0xe0b0('0x33')]}},{'name':_0xe0b0('0x34'),'field':_0xe0b0('0xb'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':['telephone']}},{'name':_0xe0b0('0x35'),'field':_0xe0b0('0xb'),'foreignKey':_0xe0b0('0x36'),'model':'VoiceQueue','filter':{'field':_0xe0b0('0xf'),'value':[_0xe0b0('0x37')]}},{'name':_0xe0b0('0x38'),'field':_0xe0b0('0xb'),'foreignKey':'queue','model':_0xe0b0('0x39'),'filter':{'field':_0xe0b0('0xf'),'value':[_0xe0b0('0x3a')]}}];break;case _0xe0b0('0x3b'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x3c');break;case _0xe0b0('0x3d'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x3e');break;case'voiceprefixes':_0x503883[_0xe0b0('0x11')]='VoicePrefix';break;case _0xe0b0('0x3f'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x40');break;case _0xe0b0('0x41'):_0x503883['childModel']=_0xe0b0('0x42');break;case _0xe0b0('0x43'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x44');break;case _0xe0b0('0x45'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x46');break;case _0xe0b0('0x47'):_0x503883['childModel']=_0xe0b0('0x48');break;case _0xe0b0('0x49'):_0x503883['childModel']='OpenchannelAccount';break;case _0xe0b0('0x4a'):_0x503883[_0xe0b0('0x11')]='SmsQueue';break;case _0xe0b0('0x4b'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x4c');break;case _0xe0b0('0x4d'):_0x503883[_0xe0b0('0x11')]='WhatsappQueue';break;case'whatsappaccounts':_0x503883['childModel']=_0xe0b0('0x4e');break;case _0xe0b0('0x4f'):_0x503883['childModel']=_0xe0b0('0x50');break;case _0xe0b0('0x51'):case _0xe0b0('0x52'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x39');if(_0x170ad8){_0x503883['parentSections']=[{'name':'VoiceQueues'},{'name':_0xe0b0('0x38')}];}break;case _0xe0b0('0x53'):case _0xe0b0('0x54'):case _0xe0b0('0x55'):_0x503883[_0xe0b0('0x11')]='User';if(_0x170ad8){_0x503883[_0xe0b0('0x14')]=[{'name':_0xe0b0('0x56'),'filter':{'field':'role','value':['admin','user']},'ignore':!![]},{'name':_0xe0b0('0x57')},{'name':_0xe0b0('0x34')}];}break;case _0xe0b0('0x58'):_0x503883[_0xe0b0('0x11')]='ZendeskAccount';break;case _0xe0b0('0x59'):_0x503883[_0xe0b0('0x11')]='SalesforceAccount';break;case'freshdeskaccounts':_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x5a');break;case'sugarcrmaccounts':_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x5b');break;case'deskaccounts':_0x503883['childModel']=_0xe0b0('0x5c');break;case'zohoaccounts':_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x5d');break;case _0xe0b0('0x5e'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x31');break;case _0xe0b0('0x5f'):_0x503883['childModel']='CannedAnswer';break;case _0xe0b0('0x60'):_0x503883['childModel']='Disposition';break;case _0xe0b0('0x61'):_0x503883[_0xe0b0('0x11')]='Dashboard';break;case'intervals':_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x62');break;case _0xe0b0('0x63'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x64');break;case _0xe0b0('0x65'):_0x503883[_0xe0b0('0x11')]='Schedule';break;case _0xe0b0('0x66'):_0x503883['childModel']=_0xe0b0('0x67');break;case'tags':_0x503883['childModel']=_0xe0b0('0x68');break;case _0xe0b0('0x69'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x6a');break;case _0xe0b0('0x6b'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x6c');break;case _0xe0b0('0x6d'):_0x503883[_0xe0b0('0x11')]='Trunk';break;case _0xe0b0('0x6e'):_0x503883['childModel']=_0xe0b0('0x6f');break;case _0xe0b0('0x70'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x71');break;case _0xe0b0('0x72'):_0x503883[_0xe0b0('0x11')]='AnalyticExtractedReport';_0x503883[_0xe0b0('0x14')]=[{'name':_0xe0b0('0x73'),'field':'id','foreignKey':_0xe0b0('0x74')}];break;case _0xe0b0('0x75'):_0x503883[_0xe0b0('0x11')]=_0xe0b0('0x76');break;}return _0x503883;}function _0x234cb7(_0x1a60d2,_0x85824c){var _0xf331df=_0x1a60d2[_0xe0b0('0x77')](0x0)[_0xe0b0('0x78')]()+_0x1a60d2[_0xe0b0('0x79')](0x1);var _0x10eb99={'type':_0x3b5e2b[_0xe0b0('0x7a')][_0xe0b0('0x7b')][_0xe0b0('0x7c')],'raw':!![]};return new Promise(function(_0x155738,_0x5aa79b){var _0x46627e=squel[_0xe0b0('0x7d')]()[_0xe0b0('0xa')](_0xe0b0('0x7e')+_0xf331df+_0xe0b0('0x7f'),'id')[_0xe0b0('0xa')](_0xe0b0('0x80'))['from']('user_has_'+_0x1a60d2+_0xe0b0('0x81'),'ui')[_0xe0b0('0x82')](_0xe0b0('0x83'),_0x85824c['id']);return _0x3b5e2b['sequelize'][_0xe0b0('0x84')](_0x46627e[_0xe0b0('0x85')](),_0x10eb99)[_0xe0b0('0x7')](function(_0x3d820c){_0x85824c[_0xf331df+_0xe0b0('0x86')]=_0x3d820c;_0x155738(_0x3d820c);})['catch'](function(_0x370f8c){_0x5aa79b(_0x370f8c);});});}return _0xdf715e[_0xe0b0('0x87')](_0xe0b0('0x88'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3604e6){var _0x30b3ae={'raw':_0x3604e6['query'][_0xe0b0('0x89')],'where':{}};var _0x4c5478={};var _0x5bb697={'count':0x0,'rows':[]};var _0x4474ac=_0x3604e6['query']['section'];var _0x416e0c=_0x3604e6[_0xe0b0('0x84')][_0xe0b0('0x8a')]||![];var _0x1a4fad=_0x31b5f8(_0x4474ac,_0x416e0c);if(!_0x1a4fad['childModel'])throw new Error(_0xe0b0('0x8b')+_0x4474ac+'\x27');var _0x2287a5=[{'name':_0x4474ac}];if(!_[_0xe0b0('0x8c')](_0x1a4fad[_0xe0b0('0x14')]))_0x2287a5=_0x1a4fad[_0xe0b0('0x14')];var _0xce497c=[];for(var _0xc5e88c=0x0;_0xc5e88c<_0x2287a5[_0xe0b0('0x8d')];_0xc5e88c++){_0xce497c['push'](_0x3b5e2b['UserProfileSection'][_0xe0b0('0x8e')]({'where':{'userProfileId':_0x3604e6[_0xe0b0('0x8f')]['id'],'name':_0x2287a5[_0xc5e88c][_0xe0b0('0xb')]},'raw':!![]}));}return Promise['all'](_0xce497c)['then'](function(_0x2eb16f){var _0x26f36f=_['filter'](_0x2eb16f,function(_0x5eca3d){return _0x5eca3d?_0x5eca3d:undefined;});var _0x691136=_[_0xe0b0('0x4')](_0x2287a5,[_0xe0b0('0x90'),!![]]);var _0x29175a=_[_0xe0b0('0x8c')](_0x26f36f)&&_[_0xe0b0('0x8c')](_0x691136)?null:_[_0xe0b0('0x91')](_0x691136,_0x26f36f);if(!_0x29175a)return null;var _0x1b997d=[];for(var _0x51f209=0x0;_0x51f209<_0x29175a[_0xe0b0('0x8d')];_0x51f209++){var _0x12e245=_[_0xe0b0('0x8e')](_0x2287a5,function(_0x494420){return _0x29175a[_0x51f209]?_0x494420['name']===_0x29175a[_0x51f209]['name']:null;});if(_0x12e245){if(_0x29175a[_0x51f209]['ignore']){_0x1b997d['push'](_0x28040c(_0x1a4fad['childModel'],_0x29175a[_0x51f209]));}else{if(!_0x29175a[_0x51f209][_0xe0b0('0x92')]){_0x1b997d['push'](_0xadee6e(_0x12e245,_0x29175a[_0x51f209],_0x1a4fad['childModel']));}else{if(_0x12e245[_0xe0b0('0x93')]){_0x1b997d[_0xe0b0('0x94')](_0x2f32b6(_0x12e245,_0x29175a[_0x51f209]));}}}}}return Promise[_0xe0b0('0x95')](_0x1b997d);})[_0xe0b0('0x7')](function(_0x3e7c9b){var _0xd0629e=_0x3e7c9b;var _0xdc56c2=null;if(_0xd0629e){_0xdc56c2=_0xd0629e[_0xe0b0('0x8d')]===0x1?_0xd0629e[0x0]:null;}if(!_0xdc56c2&&!_0xd0629e)return _0x5bb697;var _0x599332=_0x3b5e2b[_0x1a4fad[_0xe0b0('0x11')]][_0xe0b0('0x96')];_0x4c5478[_0xe0b0('0x93')]=_[_0xe0b0('0x97')](_0x599332);_0x4c5478[_0xe0b0('0x84')]=_[_0xe0b0('0x97')](_0x3604e6[_0xe0b0('0x84')]);_0x4c5478['filters']=_[_0xe0b0('0x98')](_0x4c5478['model'],_0x4c5478[_0xe0b0('0x84')]);_0x30b3ae[_0xe0b0('0x99')]=_[_0xe0b0('0x98')](_0x4c5478[_0xe0b0('0x93')],qs['fields'](_0x3604e6[_0xe0b0('0x84')][_0xe0b0('0x9a')]));_0x30b3ae['attributes']=_0x30b3ae['attributes'][_0xe0b0('0x8d')]?_0x30b3ae[_0xe0b0('0x99')]:_0x4c5478[_0xe0b0('0x93')];if(!_0x3604e6[_0xe0b0('0x84')][_0xe0b0('0x9b')](_0xe0b0('0x9c'))){_0x30b3ae[_0xe0b0('0x9d')]=qs[_0xe0b0('0x9d')](_0x3604e6[_0xe0b0('0x84')][_0xe0b0('0x9d')]);_0x30b3ae['offset']=qs['offset'](_0x3604e6[_0xe0b0('0x84')]['offset']);}_0x30b3ae['order']=qs['sort'](_0x3604e6['query'][_0xe0b0('0x9e')]);_0x30b3ae['where']=qs[_0xe0b0('0x9f')](_[_0xe0b0('0xa0')](_0x3604e6[_0xe0b0('0x84')],_0x4c5478[_0xe0b0('0x9f')]));if(_0x3604e6['query'][_0xe0b0('0x4')]){_0x30b3ae[_0xe0b0('0x82')]=_['merge'](_0x30b3ae[_0xe0b0('0x82')],{'$or':_[_0xe0b0('0x9')](_0x599332,function(_0x1ac31f){if(_0x1ac31f[_0xe0b0('0xf')][_0xe0b0('0xa1')]!=='VIRTUAL'){var _0x55d3f8={};_0x55d3f8[_0x1ac31f['field']]={'$like':'%'+_0x3604e6['query']['filter']+'%'};return _0x55d3f8;}})});}var _0xfbe16d=[];var _0x567e1a=null;var _0x3c09af={};if(_0xdc56c2){_0x567e1a=_['find'](_0x2287a5,[_0xe0b0('0xb'),_0xdc56c2[_0xe0b0('0xb')]]);if(_0x567e1a[_0xe0b0('0xa')]){_0x3c09af={};if(_0x1a4fad[_0xe0b0('0x11')]===_0xe0b0('0xd')){_0x3c09af[_0x567e1a[_0xe0b0('0xa2')]]=_['map'](_0xdc56c2['associatedResources'],'id');}else{_0x3c09af[_0x567e1a['foreignKey']]=_0xdc56c2['associatedResources'];}_0xfbe16d[_0xe0b0('0x94')](_0x3c09af);}else{_0x30b3ae[_0xe0b0('0x82')]['id']=_0xdc56c2[_0xe0b0('0x8')];}}else{for(var _0x4377f7=0x0;_0x4377f7<_0xd0629e[_0xe0b0('0x8d')];_0x4377f7++){_0x567e1a=_['find'](_0x2287a5,[_0xe0b0('0xb'),_0xd0629e[_0x4377f7][_0xe0b0('0xb')]]);if(_0x567e1a[_0xe0b0('0xa')]){_0x3c09af={};_0x3c09af[_0x567e1a[_0xe0b0('0xa2')]]=_0xd0629e[_0x4377f7][_0xe0b0('0x8')];_0xfbe16d[_0xe0b0('0x94')](_0x3c09af);}else{if(!_0x30b3ae[_0xe0b0('0x82')]['id'])_0x30b3ae[_0xe0b0('0x82')]['id']=[];_0xd0629e[_0x4377f7][_0xe0b0('0x8')]['forEach'](function(_0x589c47){_0x30b3ae[_0xe0b0('0x82')]['id'][_0xe0b0('0x94')](_0x589c47);});}}}if(!_['isEmpty'](_0xfbe16d)){_0x30b3ae[_0xe0b0('0x82')]=_[_0xe0b0('0xa3')](_0x30b3ae[_0xe0b0('0x82')],{'$and':{'$or':_0xfbe16d}});}_0x30b3ae=_[_0xe0b0('0xa3')]({},_0x30b3ae,_0x3604e6[_0xe0b0('0xa4')]);if(_0xdc56c2&&!_0xdc56c2[_0xe0b0('0x92')]&&_0x1a4fad[_0xe0b0('0x11')]===_0xe0b0('0xd')){if(_0x3604e6['query']['includeAll']){_0x30b3ae['include']=[{'all':!![]}];}return _0x3b5e2b[_0x1a4fad[_0xe0b0('0x11')]][_0xe0b0('0x6')](_0x30b3ae)['then'](function(_0x36b67c){var _0x448694=[];_0x36b67c[_0xe0b0('0xa5')](function(_0x328832){var _0x5c45ae;switch(_0x328832['reportType']){case'default':_0x5c45ae=_[_0xe0b0('0x8e')](_0xdc56c2[_0xe0b0('0x8')],function(_0x57535b){return _0x57535b['id']===_0x328832[_0xe0b0('0x74')]&&_0x57535b[_0xe0b0('0xf')]==='DefaultReports';});break;case'custom':_0x5c45ae=_[_0xe0b0('0x8e')](_0xdc56c2['associatedResources'],function(_0x251195){return _0x251195['id']===_0x328832['reportId']&&_0x251195[_0xe0b0('0xf')]===_0xe0b0('0xa6');});break;}if(_0x5c45ae)_0x448694[_0xe0b0('0x94')](_0x328832);});_0x5bb697[_0xe0b0('0xa7')]=_0x448694[_0xe0b0('0x8d')];_0x5bb697[_0xe0b0('0xa8')]=_0x448694;return _0x5bb697;});}else{if(!_[_0xe0b0('0x8c')](_0x3604e6[_0xe0b0('0x84')][_0xe0b0('0xa9')])){_0x30b3ae['where']['id']=_0x30b3ae[_0xe0b0('0x82')]['id']?_[_0xe0b0('0x98')](_0x30b3ae[_0xe0b0('0x82')]['id'],_0x3604e6['query'][_0xe0b0('0xa9')]):_0x3604e6['query'][_0xe0b0('0xa9')];}return _0x3b5e2b[_0x1a4fad[_0xe0b0('0x11')]]['count']({'where':_0x30b3ae[_0xe0b0('0x82')]})['then'](function(_0x528932){_0x5bb697[_0xe0b0('0xa7')]=_0x528932;if(_0x3604e6['query']['includeAll']){if(_0x1a4fad[_0xe0b0('0x11')]===_0xe0b0('0xaa')){_0x30b3ae[_0xe0b0('0xab')]=[{'model':_0x3b5e2b[_0xe0b0('0x68')],'as':_0xe0b0('0xac'),'attributes':['id',_0xe0b0('0xb'),'color'],'required':_0x3604e6[_0xe0b0('0x84')][_0xe0b0('0xad')]?!![]:![]},{'model':_0x3b5e2b[_0xe0b0('0x68')],'as':'ThroughTags','attributes':['id',_0xe0b0('0xb'),_0xe0b0('0xae')],'through':_0x3604e6['query']['tag']?{'attributes':[],'where':{'TagId':_0x3604e6[_0xe0b0('0x84')]['tag']||undefined}}:{},'required':_0x3604e6[_0xe0b0('0x84')][_0xe0b0('0xad')]?!![]:![]}];}else{_0x30b3ae[_0xe0b0('0xab')]=[{'all':!![]}];}}return _0x3b5e2b[_0x1a4fad[_0xe0b0('0x11')]][_0xe0b0('0x6')](_0x30b3ae);})[_0xe0b0('0x7')](function(_0x3d70d7){_0x5bb697['rows']=_0x3d70d7;if(_0x4474ac===_0xe0b0('0x57')&&_0x3604e6[_0xe0b0('0x84')][_0xe0b0('0xaf')]===_0xe0b0('0xb0')){var _0x2b087b=[];for(var _0x545dfd=0x0;_0x545dfd<_0x5bb697['rows'][_0xe0b0('0x8d')];_0x545dfd++){_0x2b087b[_0xe0b0('0x94')](_0x234cb7(_0xe0b0('0xb1'),_0x5bb697[_0xe0b0('0xa8')][_0x545dfd][_0xe0b0('0xb2')]));_0x2b087b[_0xe0b0('0x94')](_0x234cb7(_0xe0b0('0xb3'),_0x5bb697[_0xe0b0('0xa8')][_0x545dfd][_0xe0b0('0xb2')]));_0x2b087b[_0xe0b0('0x94')](_0x234cb7('fax',_0x5bb697[_0xe0b0('0xa8')][_0x545dfd][_0xe0b0('0xb2')]));_0x2b087b[_0xe0b0('0x94')](_0x234cb7(_0xe0b0('0xb4'),_0x5bb697['rows'][_0x545dfd][_0xe0b0('0xb2')]));_0x2b087b[_0xe0b0('0x94')](_0x234cb7(_0xe0b0('0xb5'),_0x5bb697[_0xe0b0('0xa8')][_0x545dfd][_0xe0b0('0xb2')]));_0x2b087b['push'](_0x234cb7(_0xe0b0('0xb6'),_0x5bb697['rows'][_0x545dfd][_0xe0b0('0xb2')]));}return Promise[_0xe0b0('0x95')](_0x2b087b)[_0xe0b0('0x7')](function(){return _0x5bb697;});}return _0x5bb697;});}});}}});};
\ No newline at end of file
+var _0x8603=['params','ignore','all','rawAttributes','keys','filters','intersection','attributes','fields','limit','offset','order','sort','key','foreignKey','forEach','merge','options','includeAll','include','reportType','DefaultReports','custom','CustomReports','count','rows','ids','Tag','Tags','color','tag','ThroughTags','openTabs','true','dataValues','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','then','map','catch','value','model','findAll','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareProjects','projectName','projects','childModel','JscriptyProject','CmContact','parentSections','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','VoiceRecording','membername','User','role','agent','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','deskaccounts','DeskAccount','vtigeraccounts','cannedanswers','Disposition','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','variables','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','QueryTypes','select','ui.','InteractionId','user_has_','_interactions','where','sequelize','toString','OpenTabs','define','user_profiles','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8603,0x190));var _0x3860=function(_0x1bb49c,_0x510210){_0x1bb49c=_0x1bb49c-0x0;var _0x45db79=_0x8603[_0x1bb49c];return _0x45db79;};'use strict';var _=require('lodash');var attributes=require(_0x3860('0x0'));var qs=require(_0x3860('0x1'));var squel=require(_0x3860('0x2'));module['exports']=function(_0x4961d6){var _0x2ebe8b=_0x4961d6[_0x3860('0x3')];function _0x2f56a3(_0x490262,_0x2fc97a){return new Promise(function(_0x56f8c5,_0xb0fc24){if(!_0x2fc97a)return _0x56f8c5(null);var _0x40739b=_0x2fc97a[_0x3860('0x4')]?{[_0x2fc97a[_0x3860('0x4')][_0x3860('0x5')]]:_0x2fc97a['filter']['value']}:undefined;return _0x2ebe8b[_0x490262]['findAll']({'where':_0x40739b,'raw':!![]})[_0x3860('0x6')](function(_0x441dc4){_0x2fc97a['associatedResources']=_[_0x3860('0x7')](_0x441dc4,'id');_0x56f8c5(_0x2fc97a);})[_0x3860('0x8')](function(_0x5909b8){_0xb0fc24(_0x5909b8);});});}function _0x101263(_0x45ba50,_0x4cd35d){return new Promise(function(_0x365579,_0x16ca69){var _0x4c6a45=_0x45ba50[_0x3860('0x4')]?{[_0x45ba50[_0x3860('0x4')][_0x3860('0x5')]]:_0x45ba50[_0x3860('0x4')][_0x3860('0x9')]}:undefined;return _0x2ebe8b[_0x45ba50[_0x3860('0xa')]][_0x3860('0xb')]({'where':_0x4c6a45,'raw':!![]})[_0x3860('0x6')](function(_0x465d8d){_0x4cd35d[_0x3860('0xc')]=_['map'](_0x465d8d,function(_0x3d861d){return _0x3d861d[_0x3860('0xd')];});_0x365579(_0x4cd35d);})[_0x3860('0x8')](function(_0x37d9ab){_0x16ca69(_0x37d9ab);});});}function _0x1055b3(_0xfa0c9a,_0x2d8a3a,_0x378305){if(!_0x2d8a3a)return Promise[_0x3860('0xe')](null);return new Promise(function(_0x3c0d91,_0x3e51b4){return _0x2ebe8b[_0x3860('0xf')]['findAll']({'where':{'sectionId':_0x2d8a3a['id']},'raw':!![]})['then'](function(_0x373b06){if(_0xfa0c9a[_0x3860('0x5')]&&_0xfa0c9a[_0x3860('0x5')]!=='id'){_0x2d8a3a['associatedResources']=_[_0x3860('0x7')](_0x373b06,function(_0x145b26){return _0x145b26[_0xfa0c9a[_0x3860('0x5')]];});}else{if(_0x378305===_0x3860('0x10')){_0x2d8a3a[_0x3860('0xc')]=_[_0x3860('0x7')](_0x373b06,function(_0xc06ba1){return{'id':_0xc06ba1[_0x3860('0x11')],'type':_0xc06ba1[_0x3860('0x12')]};});}else{_0x2d8a3a[_0x3860('0xc')]=_[_0x3860('0x7')](_0x373b06,function(_0x2e0b6e){return _0x2e0b6e[_0x3860('0x11')];});}}_0x3c0d91(_0x2d8a3a);})[_0x3860('0x8')](function(_0xd33a51){_0x3e51b4(_0xd33a51);});});}function _0x564efd(_0xfc10a5,_0x133093){var _0x2b91f2={'parentSections':[]};switch(_0xfc10a5[_0x3860('0x13')]()){case _0x3860('0x14'):_0x2b91f2['childModel']=_0x3860('0x15');break;case'odbc':_0x2b91f2['childModel']=_0x3860('0x16');break;case _0x3860('0x17'):_0x2b91f2['childModel']='SquareRecording';_0x2b91f2['parentSections']=[{'name':_0x3860('0x18'),'field':_0x3860('0xd'),'foreignKey':_0x3860('0x19')}];break;case _0x3860('0x1a'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x1c');break;case'contacts':_0x2b91f2['childModel']=_0x3860('0x1d');_0x2b91f2[_0x3860('0x1e')]=[{'name':'Lists','field':'id','foreignKey':_0x3860('0x1f')}];break;case _0x3860('0x20'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x21');break;case _0x3860('0x22'):_0x2b91f2['childModel']=_0x3860('0x23');break;case _0x3860('0x24'):_0x2b91f2[_0x3860('0x1b')]='CmCustomField';break;case _0x3860('0x25'):_0x2b91f2['childModel']=_0x3860('0x26');break;case'chatwebsites':_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x27');break;case _0x3860('0x28'):_0x2b91f2['childModel']=_0x3860('0x29');break;case _0x3860('0x2a'):_0x2b91f2['childModel']=_0x3860('0x2b');break;case'inboundroutes':case _0x3860('0x2c'):case _0x3860('0x2d'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x2e');break;case _0x3860('0x2f'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x30');break;case'voicemails':_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x31');break;case'voicerecordings':_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x32');_0x2b91f2[_0x3860('0x1e')]=[{'name':'Agents','field':'name','foreignKey':_0x3860('0x33'),'model':_0x3860('0x34'),'filter':{'field':_0x3860('0x35'),'value':[_0x3860('0x36')]}},{'name':'Telephones','field':'name','foreignKey':_0x3860('0x33'),'model':_0x3860('0x34'),'filter':{'field':_0x3860('0x35'),'value':[_0x3860('0x37')]}},{'name':_0x3860('0x38'),'field':'name','foreignKey':_0x3860('0x39'),'model':_0x3860('0x3a'),'filter':{'field':'type','value':['inbound']}},{'name':_0x3860('0x3b'),'field':_0x3860('0xd'),'foreignKey':_0x3860('0x39'),'model':_0x3860('0x3a'),'filter':{'field':_0x3860('0x12'),'value':['outbound']}}];break;case _0x3860('0x3c'):_0x2b91f2['childModel']=_0x3860('0x3d');break;case _0x3860('0x3e'):_0x2b91f2['childModel']=_0x3860('0x3f');break;case _0x3860('0x40'):_0x2b91f2['childModel']=_0x3860('0x41');break;case _0x3860('0x42'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x43');break;case'mailqueues':_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x44');break;case _0x3860('0x45'):_0x2b91f2['childModel']=_0x3860('0x46');break;case'mailsubstatuses':_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x47');break;case _0x3860('0x48'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x49');break;case _0x3860('0x4a'):_0x2b91f2['childModel']=_0x3860('0x4b');break;case _0x3860('0x4c'):_0x2b91f2['childModel']='SmsQueue';break;case _0x3860('0x4d'):_0x2b91f2[_0x3860('0x1b')]='SmsAccount';break;case _0x3860('0x4e'):_0x2b91f2[_0x3860('0x1b')]='WhatsappQueue';break;case _0x3860('0x4f'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x50');break;case _0x3860('0x51'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x52');break;case _0x3860('0x53'):case _0x3860('0x54'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x3a');if(_0x133093){_0x2b91f2[_0x3860('0x1e')]=[{'name':_0x3860('0x38')},{'name':_0x3860('0x3b')}];}break;case'users':case _0x3860('0x55'):case'telephones':_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x34');if(_0x133093){_0x2b91f2[_0x3860('0x1e')]=[{'name':_0x3860('0x56'),'filter':{'field':_0x3860('0x35'),'value':[_0x3860('0x57'),_0x3860('0x58')]},'ignore':!![]},{'name':_0x3860('0x59')},{'name':'Telephones'}];}break;case _0x3860('0x5a'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x5b');break;case'salesforceaccounts':_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x5c');break;case _0x3860('0x5d'):_0x2b91f2[_0x3860('0x1b')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x2b91f2[_0x3860('0x1b')]='SugarcrmAccount';break;case _0x3860('0x5e'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x5f');break;case'zohoaccounts':_0x2b91f2[_0x3860('0x1b')]='ZohoAccount';break;case _0x3860('0x60'):_0x2b91f2['childModel']=_0x3860('0x34');break;case _0x3860('0x61'):_0x2b91f2[_0x3860('0x1b')]='CannedAnswer';break;case'dispositions':_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x62');break;case'customdashboards':_0x2b91f2[_0x3860('0x1b')]='Dashboard';break;case _0x3860('0x63'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x64');break;case _0x3860('0x65'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x66');break;case _0x3860('0x67'):_0x2b91f2['childModel']=_0x3860('0x68');break;case _0x3860('0x69'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x6a');break;case _0x3860('0x6b'):_0x2b91f2[_0x3860('0x1b')]='Tag';break;case _0x3860('0x6c'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x6d');break;case _0x3860('0x6e'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x6f');break;case _0x3860('0x70'):_0x2b91f2[_0x3860('0x1b')]='Trunk';break;case _0x3860('0x71'):_0x2b91f2[_0x3860('0x1b')]='Variable';break;case _0x3860('0x72'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x73');break;case'extractedreports':_0x2b91f2[_0x3860('0x1b')]='AnalyticExtractedReport';_0x2b91f2[_0x3860('0x1e')]=[{'name':_0x3860('0x74'),'field':'id','foreignKey':_0x3860('0x75')}];break;case _0x3860('0x76'):_0x2b91f2[_0x3860('0x1b')]=_0x3860('0x77');break;}return _0x2b91f2;}function _0x1a4f58(_0x2c7218,_0x67e6b8){var _0x151492=_0x2c7218[_0x3860('0x78')](0x0)[_0x3860('0x79')]()+_0x2c7218['slice'](0x1);var _0x5ce9a4={'type':_0x2ebe8b['Sequelize'][_0x3860('0x7a')]['SELECT'],'raw':!![]};return new Promise(function(_0x5a2c1c,_0xc2bd40){var _0x412e0f=squel[_0x3860('0x7b')]()[_0x3860('0x5')](_0x3860('0x7c')+_0x151492+_0x3860('0x7d'),'id')['field']('ui.createdAt')['from'](_0x3860('0x7e')+_0x2c7218+_0x3860('0x7f'),'ui')[_0x3860('0x80')]('ui.UserId\x20=\x20?',_0x67e6b8['id']);return _0x2ebe8b[_0x3860('0x81')]['query'](_0x412e0f[_0x3860('0x82')](),_0x5ce9a4)[_0x3860('0x6')](function(_0x5176ff){_0x67e6b8[_0x151492+_0x3860('0x83')]=_0x5176ff;_0x5a2c1c(_0x5176ff);})[_0x3860('0x8')](function(_0xfe45d8){_0xc2bd40(_0xfe45d8);});});}return _0x4961d6[_0x3860('0x84')]('UserProfile',attributes,{'tableName':_0x3860('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x38a52f){var _0x17f248={'raw':_0x38a52f['query']['raw'],'where':{}};var _0x26e54b={};var _0x2ba958={'count':0x0,'rows':[]};var _0xe67023=_0x38a52f[_0x3860('0x86')][_0x3860('0x87')];var _0xbd8769=_0x38a52f['query'][_0x3860('0x88')]||![];var _0x4fe4e8=_0x564efd(_0xe67023,_0xbd8769);if(!_0x4fe4e8['childModel'])throw new Error(_0x3860('0x89')+_0xe67023+'\x27');var _0x2afdde=[{'name':_0xe67023}];if(!_[_0x3860('0x8a')](_0x4fe4e8[_0x3860('0x1e')]))_0x2afdde=_0x4fe4e8[_0x3860('0x1e')];var _0x2ee555=[];for(var _0x5b9a7b=0x0;_0x5b9a7b<_0x2afdde[_0x3860('0x8b')];_0x5b9a7b++){_0x2ee555[_0x3860('0x8c')](_0x2ebe8b[_0x3860('0x8d')][_0x3860('0x8e')]({'where':{'userProfileId':_0x38a52f[_0x3860('0x8f')]['id'],'name':_0x2afdde[_0x5b9a7b][_0x3860('0xd')]},'raw':!![]}));}return Promise['all'](_0x2ee555)[_0x3860('0x6')](function(_0x81010b){var _0x1c33dc=_['filter'](_0x81010b,function(_0x4e386e){return _0x4e386e?_0x4e386e:undefined;});var _0x150657=_[_0x3860('0x4')](_0x2afdde,[_0x3860('0x90'),!![]]);var _0x3b7a76=_[_0x3860('0x8a')](_0x1c33dc)&&_['isEmpty'](_0x150657)?null:_['union'](_0x150657,_0x1c33dc);if(!_0x3b7a76)return null;var _0x2db53f=[];for(var _0x393bc4=0x0;_0x393bc4<_0x3b7a76['length'];_0x393bc4++){var _0x5d9416=_[_0x3860('0x8e')](_0x2afdde,function(_0x38ad4e){return _0x3b7a76[_0x393bc4]?_0x38ad4e['name']===_0x3b7a76[_0x393bc4][_0x3860('0xd')]:null;});if(_0x5d9416){if(_0x3b7a76[_0x393bc4][_0x3860('0x90')]){_0x2db53f[_0x3860('0x8c')](_0x2f56a3(_0x4fe4e8[_0x3860('0x1b')],_0x3b7a76[_0x393bc4]));}else{if(!_0x3b7a76[_0x393bc4]['autoAssociation']){_0x2db53f[_0x3860('0x8c')](_0x1055b3(_0x5d9416,_0x3b7a76[_0x393bc4],_0x4fe4e8[_0x3860('0x1b')]));}else{if(_0x5d9416['model']){_0x2db53f['push'](_0x101263(_0x5d9416,_0x3b7a76[_0x393bc4]));}}}}}return Promise[_0x3860('0x91')](_0x2db53f);})[_0x3860('0x6')](function(_0x5102f2){var _0x2ff779=_0x5102f2;var _0x5a20de=null;if(_0x2ff779){_0x5a20de=_0x2ff779[_0x3860('0x8b')]===0x1?_0x2ff779[0x0]:null;}if(!_0x5a20de&&!_0x2ff779)return _0x2ba958;var _0x552435=_0x2ebe8b[_0x4fe4e8['childModel']][_0x3860('0x92')];_0x26e54b['model']=_[_0x3860('0x93')](_0x552435);_0x26e54b[_0x3860('0x86')]=_[_0x3860('0x93')](_0x38a52f[_0x3860('0x86')]);_0x26e54b[_0x3860('0x94')]=_[_0x3860('0x95')](_0x26e54b['model'],_0x26e54b[_0x3860('0x86')]);_0x17f248[_0x3860('0x96')]=_[_0x3860('0x95')](_0x26e54b['model'],qs[_0x3860('0x97')](_0x38a52f['query'][_0x3860('0x97')]));_0x17f248[_0x3860('0x96')]=_0x17f248['attributes'][_0x3860('0x8b')]?_0x17f248[_0x3860('0x96')]:_0x26e54b[_0x3860('0xa')];if(!_0x38a52f['query']['hasOwnProperty']('nolimit')){_0x17f248['limit']=qs[_0x3860('0x98')](_0x38a52f[_0x3860('0x86')][_0x3860('0x98')]);_0x17f248[_0x3860('0x99')]=qs['offset'](_0x38a52f['query'][_0x3860('0x99')]);}_0x17f248[_0x3860('0x9a')]=qs[_0x3860('0x9b')](_0x38a52f[_0x3860('0x86')]['sort']);_0x17f248[_0x3860('0x80')]=qs[_0x3860('0x94')](_['pick'](_0x38a52f['query'],_0x26e54b[_0x3860('0x94')]));if(_0x38a52f[_0x3860('0x86')][_0x3860('0x4')]){_0x17f248[_0x3860('0x80')]=_['merge'](_0x17f248['where'],{'$or':_[_0x3860('0x7')](_0x552435,function(_0x5d8438){if(_0x5d8438[_0x3860('0x12')][_0x3860('0x9c')]!=='VIRTUAL'){var _0x4e7713={};_0x4e7713[_0x5d8438['field']]={'$like':'%'+_0x38a52f[_0x3860('0x86')][_0x3860('0x4')]+'%'};return _0x4e7713;}})});}var _0x507480=[];var _0x22177b=null;var _0x1371b5={};if(_0x5a20de){_0x22177b=_[_0x3860('0x8e')](_0x2afdde,[_0x3860('0xd'),_0x5a20de[_0x3860('0xd')]]);if(_0x22177b['field']){_0x1371b5={};if(_0x4fe4e8[_0x3860('0x1b')]===_0x3860('0x10')){_0x1371b5[_0x22177b[_0x3860('0x9d')]]=_[_0x3860('0x7')](_0x5a20de[_0x3860('0xc')],'id');}else{_0x1371b5[_0x22177b['foreignKey']]=_0x5a20de[_0x3860('0xc')];}_0x507480[_0x3860('0x8c')](_0x1371b5);}else{_0x17f248[_0x3860('0x80')]['id']=_0x5a20de[_0x3860('0xc')];}}else{for(var _0x28fcb6=0x0;_0x28fcb6<_0x2ff779['length'];_0x28fcb6++){_0x22177b=_['find'](_0x2afdde,[_0x3860('0xd'),_0x2ff779[_0x28fcb6][_0x3860('0xd')]]);if(_0x22177b[_0x3860('0x5')]){_0x1371b5={};_0x1371b5[_0x22177b[_0x3860('0x9d')]]=_0x2ff779[_0x28fcb6][_0x3860('0xc')];_0x507480[_0x3860('0x8c')](_0x1371b5);}else{if(!_0x17f248[_0x3860('0x80')]['id'])_0x17f248['where']['id']=[];_0x2ff779[_0x28fcb6][_0x3860('0xc')][_0x3860('0x9e')](function(_0x58eddd){_0x17f248[_0x3860('0x80')]['id'][_0x3860('0x8c')](_0x58eddd);});}}}if(!_[_0x3860('0x8a')](_0x507480)){_0x17f248['where']=_[_0x3860('0x9f')](_0x17f248[_0x3860('0x80')],{'$and':{'$or':_0x507480}});}_0x17f248=_['merge']({},_0x17f248,_0x38a52f[_0x3860('0xa0')]);if(_0x5a20de&&!_0x5a20de['autoAssociation']&&_0x4fe4e8[_0x3860('0x1b')]===_0x3860('0x10')){if(_0x38a52f['query'][_0x3860('0xa1')]){_0x17f248[_0x3860('0xa2')]=[{'all':!![]}];}return _0x2ebe8b[_0x4fe4e8[_0x3860('0x1b')]][_0x3860('0xb')](_0x17f248)[_0x3860('0x6')](function(_0x5d37e4){var _0x307d19=[];_0x5d37e4[_0x3860('0x9e')](function(_0x43aa44){var _0x6e6513;switch(_0x43aa44[_0x3860('0xa3')]){case'default':_0x6e6513=_['find'](_0x5a20de[_0x3860('0xc')],function(_0x45f6d9){return _0x45f6d9['id']===_0x43aa44['reportId']&&_0x45f6d9[_0x3860('0x12')]===_0x3860('0xa4');});break;case _0x3860('0xa5'):_0x6e6513=_[_0x3860('0x8e')](_0x5a20de['associatedResources'],function(_0x3a0719){return _0x3a0719['id']===_0x43aa44['reportId']&&_0x3a0719[_0x3860('0x12')]===_0x3860('0xa6');});break;}if(_0x6e6513)_0x307d19[_0x3860('0x8c')](_0x43aa44);});_0x2ba958[_0x3860('0xa7')]=_0x307d19[_0x3860('0x8b')];_0x2ba958[_0x3860('0xa8')]=_0x307d19;return _0x2ba958;});}else{if(!_[_0x3860('0x8a')](_0x38a52f['query'][_0x3860('0xa9')])){_0x17f248[_0x3860('0x80')]['id']=_0x17f248['where']['id']?_['intersection'](_0x17f248['where']['id'],_0x38a52f['query'][_0x3860('0xa9')]):_0x38a52f[_0x3860('0x86')][_0x3860('0xa9')];}return _0x2ebe8b[_0x4fe4e8[_0x3860('0x1b')]][_0x3860('0xa7')]({'where':_0x17f248[_0x3860('0x80')]})['then'](function(_0x204da6){_0x2ba958['count']=_0x204da6;if(_0x38a52f[_0x3860('0x86')][_0x3860('0xa1')]){if(_0x4fe4e8[_0x3860('0x1b')]===_0x3860('0x1d')){_0x17f248[_0x3860('0xa2')]=[{'model':_0x2ebe8b[_0x3860('0xaa')],'as':_0x3860('0xab'),'attributes':['id',_0x3860('0xd'),_0x3860('0xac')],'required':_0x38a52f[_0x3860('0x86')][_0x3860('0xad')]?!![]:![]},{'model':_0x2ebe8b['Tag'],'as':_0x3860('0xae'),'attributes':['id',_0x3860('0xd'),_0x3860('0xac')],'through':_0x38a52f['query'][_0x3860('0xad')]?{'attributes':[],'where':{'TagId':_0x38a52f[_0x3860('0x86')][_0x3860('0xad')]||undefined}}:{},'required':_0x38a52f[_0x3860('0x86')]['tag']?!![]:![]}];}else{_0x17f248[_0x3860('0xa2')]=[{'all':!![]}];}}return _0x2ebe8b[_0x4fe4e8[_0x3860('0x1b')]][_0x3860('0xb')](_0x17f248);})['then'](function(_0x349e38){_0x2ba958[_0x3860('0xa8')]=_0x349e38;if(_0xe67023===_0x3860('0x59')&&_0x38a52f['query'][_0x3860('0xaf')]===_0x3860('0xb0')){var _0x171400=[];for(var _0x4907c5=0x0;_0x4907c5<_0x2ba958[_0x3860('0xa8')][_0x3860('0x8b')];_0x4907c5++){_0x171400[_0x3860('0x8c')](_0x1a4f58('chat',_0x2ba958[_0x3860('0xa8')][_0x4907c5][_0x3860('0xb1')]));_0x171400[_0x3860('0x8c')](_0x1a4f58('sms',_0x2ba958[_0x3860('0xa8')][_0x4907c5]['dataValues']));_0x171400[_0x3860('0x8c')](_0x1a4f58('fax',_0x2ba958[_0x3860('0xa8')][_0x4907c5][_0x3860('0xb1')]));_0x171400[_0x3860('0x8c')](_0x1a4f58(_0x3860('0xb2'),_0x2ba958[_0x3860('0xa8')][_0x4907c5][_0x3860('0xb1')]));_0x171400[_0x3860('0x8c')](_0x1a4f58(_0x3860('0xb3'),_0x2ba958[_0x3860('0xa8')][_0x4907c5][_0x3860('0xb1')]));_0x171400[_0x3860('0x8c')](_0x1a4f58(_0x3860('0xb4'),_0x2ba958[_0x3860('0xa8')][_0x4907c5][_0x3860('0xb1')]));}return Promise[_0x3860('0x91')](_0x171400)[_0x3860('0x6')](function(){return _0x2ba958;});}return _0x2ba958;});}});}}});};
\ No newline at end of file
index 280bbc9..1f3e829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b0=['socket.io-emitter','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x555b3d,_0x2fae4a){var _0x49727d=function(_0x5aa260){while(--_0x5aa260){_0x555b3d['push'](_0x555b3d['shift']());}};_0x49727d(++_0x2fae4a);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x1faee6,_0x355341){_0x1faee6=_0x1faee6-0x0;var _0x329b37=_0xa6b0[_0x1faee6];return _0x329b37;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});config[_0x0a6b('0xb')]=_[_0x0a6b('0xc')](config[_0x0a6b('0xb')],{'host':_0x0a6b('0xd'),'port':0x18eb});var socket=require(_0x0a6b('0xe'))(new Redis(config[_0x0a6b('0xb')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x25b93d,_0x100da8,_0xbdb0d0){return new BPromise(function(_0x25ad47,_0x81a412){return client[_0x0a6b('0xf')](_0x25b93d,_0xbdb0d0)[_0x0a6b('0x10')](function(_0x405046){logger[_0x0a6b('0x11')](_0x0a6b('0x12'),_0x100da8,_0x0a6b('0x13'));logger[_0x0a6b('0x14')](_0x0a6b('0x15'),_0x100da8,_0x0a6b('0x13'),JSON['stringify'](_0x405046));if(_0x405046['error']){if(_0x405046[_0x0a6b('0x16')][_0x0a6b('0x17')]===0x1f4){logger[_0x0a6b('0x16')](_0x0a6b('0x12'),_0x100da8,_0x405046[_0x0a6b('0x16')][_0x0a6b('0x18')]);return _0x81a412(_0x405046[_0x0a6b('0x16')][_0x0a6b('0x18')]);}logger[_0x0a6b('0x16')](_0x0a6b('0x12'),_0x100da8,_0x405046['error'][_0x0a6b('0x18')]);return _0x25ad47(_0x405046[_0x0a6b('0x16')]['message']);}else{logger[_0x0a6b('0x11')]('UserProfile,\x20%s,\x20%s',_0x100da8,_0x0a6b('0x13'));_0x25ad47(_0x405046[_0x0a6b('0x19')][_0x0a6b('0x18')]);}})[_0x0a6b('0x1a')](function(_0x5c512a){logger[_0x0a6b('0x16')](_0x0a6b('0x12'),_0x100da8,_0x5c512a);_0x81a412(_0x5c512a);});});}
\ No newline at end of file
+var _0xc0f9=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x32b54b,_0x3a2566){var _0x199f12=function(_0x4b1b21){while(--_0x4b1b21){_0x32b54b['push'](_0x32b54b['shift']());}};_0x199f12(++_0x3a2566);}(_0xc0f9,0xc5));var _0x9c0f=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xc0f9[_0xb0de07];return _0x4633d8;};'use strict';var _=require(_0x9c0f('0x0'));var util=require(_0x9c0f('0x1'));var moment=require(_0x9c0f('0x2'));var BPromise=require(_0x9c0f('0x3'));var rs=require(_0x9c0f('0x4'));var fs=require('fs');var Redis=require(_0x9c0f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c0f('0x6'));var logger=require(_0x9c0f('0x7'))(_0x9c0f('0x8'));var config=require('../../config/environment');var jayson=require(_0x9c0f('0x9'));var client=jayson[_0x9c0f('0xa')][_0x9c0f('0xb')]({'port':0x232a});config[_0x9c0f('0xc')]=_['defaults'](config[_0x9c0f('0xc')],{'host':_0x9c0f('0xd'),'port':0x18eb});var socket=require(_0x9c0f('0xe'))(new Redis(config[_0x9c0f('0xc')]));require('./userProfile.socket')[_0x9c0f('0xf')](socket);function respondWithRpcPromise(_0x15b0ca,_0x4902e8,_0x2edb0f){return new BPromise(function(_0x20e9d8,_0x17c8c3){return client[_0x9c0f('0x10')](_0x15b0ca,_0x2edb0f)[_0x9c0f('0x11')](function(_0x249674){logger[_0x9c0f('0x12')]('UserProfile,\x20%s,\x20%s',_0x4902e8,_0x9c0f('0x13'));logger[_0x9c0f('0x14')](_0x9c0f('0x15'),_0x4902e8,_0x9c0f('0x13'),JSON[_0x9c0f('0x16')](_0x249674));if(_0x249674[_0x9c0f('0x17')]){if(_0x249674[_0x9c0f('0x17')][_0x9c0f('0x18')]===0x1f4){logger[_0x9c0f('0x17')](_0x9c0f('0x19'),_0x4902e8,_0x249674[_0x9c0f('0x17')]['message']);return _0x17c8c3(_0x249674[_0x9c0f('0x17')]['message']);}logger[_0x9c0f('0x17')]('UserProfile,\x20%s,\x20%s',_0x4902e8,_0x249674[_0x9c0f('0x17')][_0x9c0f('0x1a')]);return _0x20e9d8(_0x249674[_0x9c0f('0x17')]['message']);}else{logger['info'](_0x9c0f('0x19'),_0x4902e8,_0x9c0f('0x13'));_0x20e9d8(_0x249674[_0x9c0f('0x1b')][_0x9c0f('0x1a')]);}})[_0x9c0f('0x1c')](function(_0x4e2496){logger[_0x9c0f('0x17')](_0x9c0f('0x19'),_0x4902e8,_0x4e2496);_0x17c8c3(_0x4e2496);});});}
\ No newline at end of file
index d59b51b..c067a1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf540=['userProfile:','./userProfile.events','update','emit'];(function(_0x4cc599,_0x32c136){var _0x4f2e7d=function(_0x31eb1c){while(--_0x31eb1c){_0x4cc599['push'](_0x4cc599['shift']());}};_0x4f2e7d(++_0x32c136);}(_0xf540,0xa5));var _0x0f54=function(_0x2ac8b0,_0x373e05){_0x2ac8b0=_0x2ac8b0-0x0;var _0x2c1916=_0xf540[_0x2ac8b0];return _0x2c1916;};'use strict';var UserProfileEvents=require(_0x0f54('0x0'));var events=['save','remove',_0x0f54('0x1')];function createListener(_0x20c474,_0x3904a1){return function(_0x15f20c){_0x3904a1[_0x0f54('0x2')](_0x20c474,_0x15f20c);};}function removeListener(_0x2b488e,_0xba9589){return function(){UserProfileEvents['removeListener'](_0x2b488e,_0xba9589);};}exports['register']=function(_0x331af2){for(var _0x3b2dee=0x0,_0xd4d1e6=events['length'];_0x3b2dee<_0xd4d1e6;_0x3b2dee++){var _0x177fea=events[_0x3b2dee];var _0xf9a231=createListener(_0x0f54('0x3')+_0x177fea,_0x331af2);UserProfileEvents['on'](_0x177fea,_0xf9a231);}};
\ No newline at end of file
+var _0x69be=['register','./userProfile.events','save','remove','removeListener'];(function(_0x1009e1,_0x3fe0d1){var _0x1ebbab=function(_0x53fd85){while(--_0x53fd85){_0x1009e1['push'](_0x1009e1['shift']());}};_0x1ebbab(++_0x3fe0d1);}(_0x69be,0x7e));var _0xe69b=function(_0x3e57e7,_0x1e7735){_0x3e57e7=_0x3e57e7-0x0;var _0x38056b=_0x69be[_0x3e57e7];return _0x38056b;};'use strict';var UserProfileEvents=require(_0xe69b('0x0'));var events=[_0xe69b('0x1'),_0xe69b('0x2'),'update'];function createListener(_0xde1258,_0x2099a4){return function(_0x1b6acc){_0x2099a4['emit'](_0xde1258,_0x1b6acc);};}function removeListener(_0x50b968,_0x2971fe){return function(){UserProfileEvents[_0xe69b('0x3')](_0x50b968,_0x2971fe);};}exports[_0xe69b('0x4')]=function(_0x4008b5){for(var _0x348b63=0x0,_0x461efe=events['length'];_0x348b63<_0x461efe;_0x348b63++){var _0x446e9e=events[_0x348b63];var _0x1e9072=createListener('userProfile:'+_0x446e9e,_0x4008b5);UserProfileEvents['on'](_0x446e9e,_0x1e9072);}};
\ No newline at end of file
index 1e69f7f..d1f539b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe232=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0xe232,0x148));var _0x2e23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe232[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2e23('0x0'));var util=require(_0x2e23('0x1'));var path=require(_0x2e23('0x2'));var timeout=require(_0x2e23('0x3'));var express=require(_0x2e23('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2e23('0x5'));var interaction=require(_0x2e23('0x6'));var config=require(_0x2e23('0x7'));var controller=require(_0x2e23('0x8'));router[_0x2e23('0x9')]('/',auth[_0x2e23('0xa')](),controller[_0x2e23('0xb')]);router[_0x2e23('0x9')](_0x2e23('0xc'),auth[_0x2e23('0xa')](),controller[_0x2e23('0xd')]);router[_0x2e23('0x9')](_0x2e23('0xe'),auth[_0x2e23('0xa')](),controller[_0x2e23('0xf')]);router[_0x2e23('0x10')]('/',auth[_0x2e23('0xa')](),controller[_0x2e23('0x11')]);router[_0x2e23('0x12')](_0x2e23('0xe'),auth[_0x2e23('0xa')](),controller[_0x2e23('0x13')]);router[_0x2e23('0x14')](_0x2e23('0xe'),auth['isAuthenticated'](),controller[_0x2e23('0x15')]);module[_0x2e23('0x16')]=router;
\ No newline at end of file
+var _0x6a7e=['index','/describe','isAuthenticated','/:id','post','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x6a7e,0x13b));var _0xe6a7=function(_0x2f4755,_0x186fce){_0x2f4755=_0x2f4755-0x0;var _0x1f7735=_0x6a7e[_0x2f4755];return _0x1f7735;};'use strict';var multer=require(_0xe6a7('0x0'));var util=require(_0xe6a7('0x1'));var path=require(_0xe6a7('0x2'));var timeout=require(_0xe6a7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe6a7('0x4'));var auth=require(_0xe6a7('0x5'));var interaction=require(_0xe6a7('0x6'));var config=require(_0xe6a7('0x7'));var controller=require('./userProfileResource.controller');router[_0xe6a7('0x8')]('/',auth['isAuthenticated'](),controller[_0xe6a7('0x9')]);router['get'](_0xe6a7('0xa'),auth[_0xe6a7('0xb')](),controller['describe']);router[_0xe6a7('0x8')](_0xe6a7('0xc'),auth[_0xe6a7('0xb')](),controller['show']);router[_0xe6a7('0xd')]('/',auth[_0xe6a7('0xb')](),controller['create']);router[_0xe6a7('0xe')](_0xe6a7('0xc'),auth[_0xe6a7('0xb')](),controller[_0xe6a7('0xf')]);router[_0xe6a7('0x10')](_0xe6a7('0xc'),auth[_0xe6a7('0xb')](),controller[_0xe6a7('0x11')]);module['exports']=router;
\ No newline at end of file
index 21f3657..318e159 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x714d=['STRING','INTEGER','sequelize','exports'];(function(_0xea8441,_0x8a912e){var _0x431b1e=function(_0x3a697e){while(--_0x3a697e){_0xea8441['push'](_0xea8441['shift']());}};_0x431b1e(++_0x8a912e);}(_0x714d,0x19a));var _0xd714=function(_0x2e8ca1,_0x1bc29b){_0x2e8ca1=_0x2e8ca1-0x0;var _0x142b80=_0x714d[_0x2e8ca1];return _0x142b80;};'use strict';var Sequelize=require(_0xd714('0x0'));module[_0xd714('0x1')]={'name':{'type':Sequelize[_0xd714('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd714('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd714('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x24c0=['INTEGER','exports','STRING'];(function(_0x3a1336,_0x51ab73){var _0x3e909b=function(_0x4cd5a5){while(--_0x4cd5a5){_0x3a1336['push'](_0x3a1336['shift']());}};_0x3e909b(++_0x51ab73);}(_0x24c0,0x76));var _0x024c=function(_0x2d05cf,_0x58750d){_0x2d05cf=_0x2d05cf-0x0;var _0x36421a=_0x24c0[_0x2d05cf];return _0x36421a;};'use strict';var Sequelize=require('sequelize');module[_0x024c('0x0')]={'name':{'type':Sequelize[_0x024c('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x024c('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 4d6195b..54879bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x5fab,0x177));var _0xb5fa=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x5fab[_0x4b2b03];return _0x1bf0ed;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['UserProfileResource'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['UserProfileResource'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));};exports[_0xb5fa('0x4e')]=function(_0x130a0d,_0x4dea87){return db['UserProfileResource'][_0xb5fa('0x4e')]()[_0xb5fa('0x43')](respondWithResult(_0x4dea87,null))[_0xb5fa('0x4b')](handleError(_0x4dea87,null));};
\ No newline at end of file
+var _0x9582=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir'];(function(_0x545c8a,_0x4a59d5){var _0x2561d6=function(_0x58cdfa){while(--_0x58cdfa){_0x545c8a['push'](_0x545c8a['shift']());}};_0x2561d6(++_0x4a59d5);}(_0x9582,0x95));var _0x2958=function(_0x547f13,_0x5858ee){_0x547f13=_0x547f13-0x0;var _0x26c23b=_0x9582[_0x547f13];return _0x26c23b;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));};exports[_0x2958('0x4b')]=function(_0x1db8b1,_0x534677){return db['UserProfileResource'][_0x2958('0x4b')]()[_0x2958('0x25')](respondWithResult(_0x534677,null))[_0x2958('0x44')](handleError(_0x534677,null));};
\ No newline at end of file
index a4f2cae..853c522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf799=['api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger'];(function(_0x3afd9e,_0x56bf40){var _0x1710a3=function(_0x2e5dc4){while(--_0x2e5dc4){_0x3afd9e['push'](_0x3afd9e['shift']());}};_0x1710a3(++_0x56bf40);}(_0xf799,0x147));var _0x9f79=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0xf799[_0x367336];return _0x3423a7;};'use strict';var _=require(_0x9f79('0x0'));var util=require(_0x9f79('0x1'));var logger=require(_0x9f79('0x2'))(_0x9f79('0x3'));var moment=require(_0x9f79('0x4'));var BPromise=require(_0x9f79('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f79('0x6'));var rimraf=require(_0x9f79('0x7'));var config=require(_0x9f79('0x8'));var attributes=require(_0x9f79('0x9'));module[_0x9f79('0xa')]=function(_0x5bc8d6,_0xec5047){return _0x5bc8d6['define'](_0x9f79('0xb'),attributes,{'tableName':_0x9f79('0xc'),'paranoid':![],'indexes':[{'name':_0x9f79('0xd'),'fields':[_0x9f79('0xe'),'sectionId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3902=['UserProfileResource','compositeIndex','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3902,0xff));var _0x2390=function(_0x16c00b,_0x5ccb15){_0x16c00b=_0x16c00b-0x0;var _0x26de25=_0x3902[_0x16c00b];return _0x26de25;};'use strict';var _=require(_0x2390('0x0'));var util=require(_0x2390('0x1'));var logger=require(_0x2390('0x2'))('api');var moment=require(_0x2390('0x3'));var BPromise=require(_0x2390('0x4'));var rp=require(_0x2390('0x5'));var fs=require('fs');var path=require(_0x2390('0x6'));var rimraf=require(_0x2390('0x7'));var config=require(_0x2390('0x8'));var attributes=require(_0x2390('0x9'));module['exports']=function(_0x227627,_0x467fad){return _0x227627[_0x2390('0xa')](_0x2390('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x2390('0xc'),'fields':['resourceId',_0x2390('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 2cd655d..4dba2d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa496=['request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x503d48,_0x42e5a9){var _0x59743e=function(_0x496dbd){while(--_0x496dbd){_0x503d48['push'](_0x503d48['shift']());}};_0x59743e(++_0x42e5a9);}(_0xa496,0x1c1));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6a49('0x0'));var util=require('util');var moment=require(_0x6a49('0x1'));var BPromise=require(_0x6a49('0x2'));var rs=require(_0x6a49('0x3'));var fs=require('fs');var Redis=require(_0x6a49('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a49('0x5'));var logger=require('../../config/logger')(_0x6a49('0x6'));var config=require(_0x6a49('0x7'));var jayson=require(_0x6a49('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26a127,_0x40bb4e,_0x4fa3de){return new BPromise(function(_0x1089c4,_0x1b6a49){return client[_0x6a49('0x9')](_0x26a127,_0x4fa3de)[_0x6a49('0xa')](function(_0x2dacb4){logger[_0x6a49('0xb')](_0x6a49('0xc'),_0x40bb4e,_0x6a49('0xd'));logger['debug'](_0x6a49('0xe'),_0x40bb4e,_0x6a49('0xd'),JSON[_0x6a49('0xf')](_0x2dacb4));if(_0x2dacb4['error']){if(_0x2dacb4['error'][_0x6a49('0x10')]===0x1f4){logger['error'](_0x6a49('0xc'),_0x40bb4e,_0x2dacb4[_0x6a49('0x11')][_0x6a49('0x12')]);return _0x1b6a49(_0x2dacb4['error'][_0x6a49('0x12')]);}logger[_0x6a49('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x40bb4e,_0x2dacb4[_0x6a49('0x11')]['message']);return _0x1089c4(_0x2dacb4[_0x6a49('0x11')][_0x6a49('0x12')]);}else{logger[_0x6a49('0xb')](_0x6a49('0xc'),_0x40bb4e,_0x6a49('0xd'));_0x1089c4(_0x2dacb4[_0x6a49('0x13')][_0x6a49('0x12')]);}})[_0x6a49('0x14')](function(_0x4abe9d){logger[_0x6a49('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x40bb4e,_0x4abe9d);_0x1b6a49(_0x4abe9d);});});}
\ No newline at end of file
+var _0x1dbe=['moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util'];(function(_0x106e02,_0x3c0ba3){var _0x8a94c7=function(_0x48ca3a){while(--_0x48ca3a){_0x106e02['push'](_0x106e02['shift']());}};_0x8a94c7(++_0x3c0ba3);}(_0x1dbe,0x14e));var _0xe1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe1db('0x0'));var util=require(_0xe1db('0x1'));var moment=require(_0xe1db('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1db('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1db('0x4'));var logger=require(_0xe1db('0x5'))('rpc');var config=require(_0xe1db('0x6'));var jayson=require(_0xe1db('0x7'));var client=jayson[_0xe1db('0x8')][_0xe1db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d82c,_0x5843bd,_0x53ba10){return new BPromise(function(_0x461f89,_0x5c286b){return client[_0xe1db('0xa')](_0x24d82c,_0x53ba10)[_0xe1db('0xb')](function(_0x6196bb){logger[_0xe1db('0xc')](_0xe1db('0xd'),_0x5843bd,_0xe1db('0xe'));logger[_0xe1db('0xf')](_0xe1db('0x10'),_0x5843bd,_0xe1db('0xe'),JSON['stringify'](_0x6196bb));if(_0x6196bb['error']){if(_0x6196bb[_0xe1db('0x11')]['code']===0x1f4){logger[_0xe1db('0x11')](_0xe1db('0xd'),_0x5843bd,_0x6196bb[_0xe1db('0x11')][_0xe1db('0x12')]);return _0x5c286b(_0x6196bb[_0xe1db('0x11')][_0xe1db('0x12')]);}logger[_0xe1db('0x11')](_0xe1db('0xd'),_0x5843bd,_0x6196bb['error'][_0xe1db('0x12')]);return _0x461f89(_0x6196bb[_0xe1db('0x11')][_0xe1db('0x12')]);}else{logger[_0xe1db('0xc')](_0xe1db('0xd'),_0x5843bd,'request\x20sent');_0x461f89(_0x6196bb[_0xe1db('0x13')]['message']);}})[_0xe1db('0x14')](function(_0x55bea7){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x5843bd,_0x55bea7);_0x5c286b(_0x55bea7);});});}
\ No newline at end of file
index 4942782..9d90618 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2964=['../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','describe','show','post','create','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x4e0ace,_0x1681f2){var _0x7bd924=function(_0x78a436){while(--_0x78a436){_0x4e0ace['push'](_0x4e0ace['shift']());}};_0x7bd924(++_0x1681f2);}(_0x2964,0x104));var _0x4296=function(_0xe4278f,_0x31cd9c){_0xe4278f=_0xe4278f-0x0;var _0x1cc85b=_0x2964[_0xe4278f];return _0x1cc85b;};'use strict';var multer=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var path=require(_0x4296('0x2'));var timeout=require('connect-timeout');var express=require(_0x4296('0x3'));var router=express[_0x4296('0x4')]();var fs_extra=require(_0x4296('0x5'));var auth=require(_0x4296('0x6'));var interaction=require(_0x4296('0x7'));var config=require('../../config/environment');var controller=require(_0x4296('0x8'));router[_0x4296('0x9')]('/',auth[_0x4296('0xa')](),controller[_0x4296('0xb')]);router[_0x4296('0x9')]('/describe',auth[_0x4296('0xa')](),controller[_0x4296('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4296('0xd')]);router[_0x4296('0xe')]('/',auth[_0x4296('0xa')](),controller[_0x4296('0xf')]);router['put']('/:id',auth[_0x4296('0xa')](),controller[_0x4296('0x10')]);router[_0x4296('0x11')]('/:id',auth[_0x4296('0xa')](),controller['destroy']);module[_0x4296('0x12')]=router;
\ No newline at end of file
+var _0x95cf=['Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','util','path','express'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x95cf,0x19f));var _0xf95c=function(_0x5e25ee,_0x516fba){_0x5e25ee=_0x5e25ee-0x0;var _0x1d682e=_0x95cf[_0x5e25ee];return _0x1d682e;};'use strict';var multer=require('multer');var util=require(_0xf95c('0x0'));var path=require(_0xf95c('0x1'));var timeout=require('connect-timeout');var express=require(_0xf95c('0x2'));var router=express[_0xf95c('0x3')]();var fs_extra=require(_0xf95c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf95c('0x5'));var config=require(_0xf95c('0x6'));var controller=require(_0xf95c('0x7'));router[_0xf95c('0x8')]('/',auth[_0xf95c('0x9')](),controller[_0xf95c('0xa')]);router[_0xf95c('0x8')](_0xf95c('0xb'),auth[_0xf95c('0x9')](),controller[_0xf95c('0xc')]);router[_0xf95c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf95c('0xd')]);router[_0xf95c('0xe')]('/',auth[_0xf95c('0x9')](),controller[_0xf95c('0xf')]);router[_0xf95c('0x10')](_0xf95c('0x11'),auth[_0xf95c('0x9')](),controller['update']);router[_0xf95c('0x12')](_0xf95c('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index fff8ac8..e58a5f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['split','sequelize','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d6b41,_0x3d1c8f){_0x5d6b41=_0x5d6b41-0x0;var _0x1c2dd6=_0xb10b[_0x5d6b41];return _0x1c2dd6;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xbb10('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xbb10('0x1')],'set':function(_0x460981){this[_0xbb10('0x4')](_0xbb10('0x5'),_0x460981?_0x460981[_0xbb10('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xbb10('0x5'))?this[_0xbb10('0x7')]('crudPermissions')[_0xbb10('0x8')](''):[];}}};
\ No newline at end of file
+var _0xb58b=['exports','STRING','BOOLEAN','crudPermissions','join','getDataValue','split'];(function(_0x520f7e,_0x67518d){var _0x587f49=function(_0x226a93){while(--_0x226a93){_0x520f7e['push'](_0x520f7e['shift']());}};_0x587f49(++_0x67518d);}(_0xb58b,0x1f1));var _0xbb58=function(_0x41ce34,_0x26a71d){_0x41ce34=_0x41ce34-0x0;var _0x5023c7=_0xb58b[_0x41ce34];return _0x5023c7;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'name':{'type':Sequelize[_0xbb58('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xbb58('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x226363){this['setDataValue'](_0xbb58('0x3'),_0x226363?_0x226363[_0xbb58('0x4')](''):[]);},'get':function(){return this[_0xbb58('0x5')]('crudPermissions')?this[_0xbb58('0x5')](_0xbb58('0x3'))[_0xbb58('0x6')](''):[];}}};
\ No newline at end of file
index 2f004e4..622cb27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa53=['fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','UserProfileSection','rawAttributes'];(function(_0x5ec448,_0x242dcf){var _0x47387e=function(_0x2aa58a){while(--_0x2aa58a){_0x5ec448['push'](_0x5ec448['shift']());}};_0x47387e(++_0x242dcf);}(_0xfa53,0x6d));var _0x3fa5=function(_0x1a03e4,_0x563edc){_0x1a03e4=_0x1a03e4-0x0;var _0x1810ad=_0xfa53[_0x1a03e4];return _0x1810ad;};'use strict';var emlformat=require(_0x3fa5('0x0'));var rimraf=require(_0x3fa5('0x1'));var zipdir=require(_0x3fa5('0x2'));var jsonpatch=require(_0x3fa5('0x3'));var rp=require('request-promise');var moment=require(_0x3fa5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3fa5('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3fa5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fa5('0x7'));var squel=require(_0x3fa5('0x8'));var crypto=require(_0x3fa5('0x9'));var jsforce=require(_0x3fa5('0xa'));var deskjs=require(_0x3fa5('0xb'));var toCsv=require(_0x3fa5('0xc'));var querystring=require(_0x3fa5('0xd'));var Papa=require(_0x3fa5('0xe'));var Redis=require(_0x3fa5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3fa5('0x10'));var as=require(_0x3fa5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fa5('0x12'))(_0x3fa5('0x13'));var utils=require(_0x3fa5('0x14'));var config=require(_0x3fa5('0x15'));var licenseUtil=require(_0x3fa5('0x16'));var db=require(_0x3fa5('0x17'))['db'];function respondWithStatusCode(_0x41a7c6,_0x3d1ff0){_0x3d1ff0=_0x3d1ff0||0xcc;return function(_0x304a18){if(_0x304a18){return _0x41a7c6[_0x3fa5('0x18')](_0x3d1ff0);}return _0x41a7c6[_0x3fa5('0x19')](_0x3d1ff0)[_0x3fa5('0x1a')]();};}function respondWithResult(_0x230cdb,_0x45ad42){_0x45ad42=_0x45ad42||0xc8;return function(_0x5250a7){if(_0x5250a7){return _0x230cdb[_0x3fa5('0x19')](_0x45ad42)[_0x3fa5('0x1b')](_0x5250a7);}};}function respondWithFilteredResult(_0x11c629,_0x259247){return function(_0x43c25a){if(_0x43c25a){var _0x4f6c0f=typeof _0x259247['offset']===_0x3fa5('0x1c')&&typeof _0x259247[_0x3fa5('0x1d')]==='undefined';var _0x168716=_0x43c25a['count'];var _0x289564=_0x4f6c0f?0x0:_0x259247[_0x3fa5('0x1e')];var _0x53bb25=_0x4f6c0f?_0x43c25a[_0x3fa5('0x1f')]:_0x259247[_0x3fa5('0x1e')]+_0x259247[_0x3fa5('0x1d')];var _0x531668;if(_0x53bb25>=_0x168716){_0x53bb25=_0x168716;_0x531668=0xc8;}else{_0x531668=0xce;}_0x11c629['status'](_0x531668);return _0x11c629['set'](_0x3fa5('0x20'),_0x289564+'-'+_0x53bb25+'/'+_0x168716)[_0x3fa5('0x1b')](_0x43c25a);}return null;};}function patchUpdates(_0x4122cd){return function(_0x1cb02c){try{jsonpatch[_0x3fa5('0x21')](_0x1cb02c,_0x4122cd,!![]);}catch(_0x29bd60){return BPromise[_0x3fa5('0x22')](_0x29bd60);}return _0x1cb02c[_0x3fa5('0x23')]();};}function saveUpdates(_0x424a35,_0x4a482d){return function(_0x225c16){if(_0x225c16){return _0x225c16[_0x3fa5('0x24')](_0x424a35)[_0x3fa5('0x25')](function(_0x516a5f){return _0x516a5f;});}return null;};}function removeEntity(_0x1d4281,_0x2e628e){return function(_0x20e9fb){if(_0x20e9fb){return _0x20e9fb['destroy']()[_0x3fa5('0x25')](function(){_0x1d4281['status'](0xcc)[_0x3fa5('0x1a')]();});}};}function handleEntityNotFound(_0x3347d9,_0x1727b5){return function(_0x351d6c){if(!_0x351d6c){_0x3347d9[_0x3fa5('0x18')](0x194);}return _0x351d6c;};}function handleError(_0x36f529,_0x1aa10f){_0x1aa10f=_0x1aa10f||0x1f4;return function(_0x434159){logger[_0x3fa5('0x26')](_0x434159[_0x3fa5('0x27')]);if(_0x434159[_0x3fa5('0x28')]){delete _0x434159[_0x3fa5('0x28')];}_0x36f529['status'](_0x1aa10f)[_0x3fa5('0x29')](_0x434159);};}exports[_0x3fa5('0x2a')]=function(_0x20d28d,_0x220664){var _0x40c096={},_0x5be77f={},_0x19140b={'count':0x0,'rows':[]};var _0x789781=_['map'](db[_0x3fa5('0x2b')][_0x3fa5('0x2c')],function(_0x3cfa8e){return{'name':_0x3cfa8e[_0x3fa5('0x2d')],'type':_0x3cfa8e[_0x3fa5('0x2e')][_0x3fa5('0x2f')]};});_0x5be77f[_0x3fa5('0x30')]=_['map'](_0x789781,_0x3fa5('0x28'));_0x5be77f['query']=_[_0x3fa5('0x31')](_0x20d28d['query']);_0x5be77f[_0x3fa5('0x32')]=_[_0x3fa5('0x33')](_0x5be77f['model'],_0x5be77f[_0x3fa5('0x34')]);_0x40c096[_0x3fa5('0x35')]=_[_0x3fa5('0x33')](_0x5be77f['model'],qs[_0x3fa5('0x36')](_0x20d28d[_0x3fa5('0x34')]['fields']));_0x40c096[_0x3fa5('0x35')]=_0x40c096[_0x3fa5('0x35')][_0x3fa5('0x37')]?_0x40c096[_0x3fa5('0x35')]:_0x5be77f[_0x3fa5('0x30')];if(!_0x20d28d[_0x3fa5('0x34')][_0x3fa5('0x38')](_0x3fa5('0x39'))){_0x40c096[_0x3fa5('0x1d')]=qs['limit'](_0x20d28d['query'][_0x3fa5('0x1d')]);_0x40c096['offset']=qs[_0x3fa5('0x1e')](_0x20d28d[_0x3fa5('0x34')][_0x3fa5('0x1e')]);}_0x40c096['order']=qs['sort'](_0x20d28d['query'][_0x3fa5('0x3a')]);_0x40c096[_0x3fa5('0x3b')]=qs[_0x3fa5('0x32')](_[_0x3fa5('0x3c')](_0x20d28d['query'],_0x5be77f[_0x3fa5('0x32')]),_0x789781);if(_0x20d28d[_0x3fa5('0x34')][_0x3fa5('0x3d')]){_0x40c096[_0x3fa5('0x3b')]=_[_0x3fa5('0x3e')](_0x40c096['where'],{'$or':_[_0x3fa5('0x3f')](_0x789781,function(_0x5c80ef){if(_0x5c80ef[_0x3fa5('0x2e')]!==_0x3fa5('0x40')){var _0x39da66={};_0x39da66[_0x5c80ef[_0x3fa5('0x28')]]={'$like':'%'+_0x20d28d[_0x3fa5('0x34')][_0x3fa5('0x3d')]+'%'};return _0x39da66;}})});}_0x40c096=_[_0x3fa5('0x3e')]({},_0x40c096,_0x20d28d[_0x3fa5('0x41')]);var _0x4aad76={'where':_0x40c096[_0x3fa5('0x3b')]};return db[_0x3fa5('0x2b')][_0x3fa5('0x1f')](_0x4aad76)['then'](function(_0x3bef5e){_0x19140b[_0x3fa5('0x1f')]=_0x3bef5e;if(_0x20d28d['query'][_0x3fa5('0x42')]){_0x40c096[_0x3fa5('0x43')]=[{'all':!![]}];}return db[_0x3fa5('0x2b')][_0x3fa5('0x44')](_0x40c096);})[_0x3fa5('0x25')](function(_0x22bdcf){_0x19140b[_0x3fa5('0x45')]=_0x22bdcf;return _0x19140b;})[_0x3fa5('0x25')](respondWithFilteredResult(_0x220664,_0x40c096))[_0x3fa5('0x46')](handleError(_0x220664,null));};exports[_0x3fa5('0x47')]=function(_0x384200,_0x5ed337){var _0x78d0c={'raw':![],'where':{'id':_0x384200['params']['id']}},_0x5e2fb5={};_0x5e2fb5[_0x3fa5('0x30')]=_[_0x3fa5('0x31')](db['UserProfileSection'][_0x3fa5('0x2c')]);_0x5e2fb5['query']=_['keys'](_0x384200[_0x3fa5('0x34')]);_0x5e2fb5[_0x3fa5('0x32')]=_[_0x3fa5('0x33')](_0x5e2fb5[_0x3fa5('0x30')],_0x5e2fb5[_0x3fa5('0x34')]);_0x78d0c[_0x3fa5('0x35')]=_[_0x3fa5('0x33')](_0x5e2fb5[_0x3fa5('0x30')],qs[_0x3fa5('0x36')](_0x384200[_0x3fa5('0x34')][_0x3fa5('0x36')]));_0x78d0c['attributes']=_0x78d0c[_0x3fa5('0x35')][_0x3fa5('0x37')]?_0x78d0c[_0x3fa5('0x35')]:_0x5e2fb5[_0x3fa5('0x30')];if(_0x384200[_0x3fa5('0x34')][_0x3fa5('0x42')]){_0x78d0c[_0x3fa5('0x43')]=[{'all':!![]}];}_0x78d0c=_[_0x3fa5('0x3e')]({},_0x78d0c,_0x384200[_0x3fa5('0x41')]);return db['UserProfileSection'][_0x3fa5('0x48')](_0x78d0c)[_0x3fa5('0x25')](handleEntityNotFound(_0x5ed337,null))[_0x3fa5('0x25')](respondWithResult(_0x5ed337,null))[_0x3fa5('0x46')](handleError(_0x5ed337,null));};exports['create']=function(_0x35e6c8,_0x13e3d6){return db[_0x3fa5('0x2b')][_0x3fa5('0x49')](_0x35e6c8[_0x3fa5('0x4a')],{})['then'](respondWithResult(_0x13e3d6,0xc9))['catch'](handleError(_0x13e3d6,null));};exports['update']=function(_0x161c0e,_0x5ad097){if(_0x161c0e['body']['id']){delete _0x161c0e[_0x3fa5('0x4a')]['id'];}return db['UserProfileSection'][_0x3fa5('0x48')]({'where':{'id':_0x161c0e[_0x3fa5('0x4b')]['id']}})[_0x3fa5('0x25')](handleEntityNotFound(_0x5ad097,null))[_0x3fa5('0x25')](saveUpdates(_0x161c0e[_0x3fa5('0x4a')],null))['then'](respondWithResult(_0x5ad097,null))[_0x3fa5('0x46')](handleError(_0x5ad097,null));};exports[_0x3fa5('0x4c')]=function(_0x2f7eb0,_0x25925c){return db['UserProfileSection'][_0x3fa5('0x48')]({'where':{'id':_0x2f7eb0[_0x3fa5('0x4b')]['id']}})[_0x3fa5('0x25')](handleEntityNotFound(_0x25925c,null))['then'](removeEntity(_0x25925c,null))[_0x3fa5('0x46')](handleError(_0x25925c,null));};exports['describe']=function(_0x4e1d00,_0xe9f3e3){return db[_0x3fa5('0x2b')]['describe']()[_0x3fa5('0x25')](respondWithResult(_0xe9f3e3,null))[_0x3fa5('0x46')](handleError(_0xe9f3e3,null));};
\ No newline at end of file
+var _0xedec=['show','length','options','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','stack','name','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','findAll','catch'];(function(_0x48f32e,_0x10ce63){var _0x2b0522=function(_0x3f0297){while(--_0x3f0297){_0x48f32e['push'](_0x48f32e['shift']());}};_0x2b0522(++_0x10ce63);}(_0xedec,0x115));var _0xcede=function(_0x4083da,_0x7aee27){_0x4083da=_0x4083da-0x0;var _0x46dfcc=_0xedec[_0x4083da];return _0x46dfcc;};'use strict';var emlformat=require(_0xcede('0x0'));var rimraf=require(_0xcede('0x1'));var zipdir=require(_0xcede('0x2'));var jsonpatch=require(_0xcede('0x3'));var rp=require(_0xcede('0x4'));var moment=require(_0xcede('0x5'));var BPromise=require(_0xcede('0x6'));var Mustache=require(_0xcede('0x7'));var util=require(_0xcede('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcede('0x9'));var ejs=require(_0xcede('0xa'));var fs=require('fs');var fs_extra=require(_0xcede('0xb'));var _=require(_0xcede('0xc'));var squel=require('squel');var crypto=require(_0xcede('0xd'));var jsforce=require(_0xcede('0xe'));var deskjs=require(_0xcede('0xf'));var toCsv=require(_0xcede('0x9'));var querystring=require('querystring');var Papa=require(_0xcede('0x10'));var Redis=require(_0xcede('0x11'));var authService=require(_0xcede('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcede('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcede('0x14'));var utils=require('../../config/utils');var config=require(_0xcede('0x15'));var licenseUtil=require(_0xcede('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43453a,_0x375e43){_0x375e43=_0x375e43||0xcc;return function(_0x12453b){if(_0x12453b){return _0x43453a[_0xcede('0x17')](_0x375e43);}return _0x43453a[_0xcede('0x18')](_0x375e43)[_0xcede('0x19')]();};}function respondWithResult(_0x279ea4,_0x519cab){_0x519cab=_0x519cab||0xc8;return function(_0x5d13f3){if(_0x5d13f3){return _0x279ea4[_0xcede('0x18')](_0x519cab)[_0xcede('0x1a')](_0x5d13f3);}};}function respondWithFilteredResult(_0x25b144,_0xb27b18){return function(_0x11f00d){if(_0x11f00d){var _0x50185f=typeof _0xb27b18[_0xcede('0x1b')]===_0xcede('0x1c')&&typeof _0xb27b18[_0xcede('0x1d')]===_0xcede('0x1c');var _0x16cb51=_0x11f00d[_0xcede('0x1e')];var _0x3d962c=_0x50185f?0x0:_0xb27b18[_0xcede('0x1b')];var _0x923397=_0x50185f?_0x11f00d[_0xcede('0x1e')]:_0xb27b18[_0xcede('0x1b')]+_0xb27b18[_0xcede('0x1d')];var _0x49f11f;if(_0x923397>=_0x16cb51){_0x923397=_0x16cb51;_0x49f11f=0xc8;}else{_0x49f11f=0xce;}_0x25b144[_0xcede('0x18')](_0x49f11f);return _0x25b144['set']('Content-Range',_0x3d962c+'-'+_0x923397+'/'+_0x16cb51)[_0xcede('0x1a')](_0x11f00d);}return null;};}function patchUpdates(_0x558e75){return function(_0x534729){try{jsonpatch[_0xcede('0x1f')](_0x534729,_0x558e75,!![]);}catch(_0x2c610b){return BPromise['reject'](_0x2c610b);}return _0x534729[_0xcede('0x20')]();};}function saveUpdates(_0x347dce,_0x25cd03){return function(_0x30590b){if(_0x30590b){return _0x30590b[_0xcede('0x21')](_0x347dce)[_0xcede('0x22')](function(_0x44126f){return _0x44126f;});}return null;};}function removeEntity(_0x468ff6,_0x75ce7d){return function(_0x4c4a61){if(_0x4c4a61){return _0x4c4a61['destroy']()['then'](function(){_0x468ff6[_0xcede('0x18')](0xcc)[_0xcede('0x19')]();});}};}function handleEntityNotFound(_0x25e59f,_0x2a75b1){return function(_0xacebe7){if(!_0xacebe7){_0x25e59f['sendStatus'](0x194);}return _0xacebe7;};}function handleError(_0x21329a,_0x5b9d49){_0x5b9d49=_0x5b9d49||0x1f4;return function(_0x45c31d){logger['error'](_0x45c31d[_0xcede('0x23')]);if(_0x45c31d[_0xcede('0x24')]){delete _0x45c31d[_0xcede('0x24')];}_0x21329a['status'](_0x5b9d49)['send'](_0x45c31d);};}exports[_0xcede('0x25')]=function(_0x4b6e94,_0x4b2eb4){var _0x4e9e55={},_0x499ea2={},_0x5bbb9d={'count':0x0,'rows':[]};var _0x43df57=_[_0xcede('0x26')](db[_0xcede('0x27')][_0xcede('0x28')],function(_0x3fc814){return{'name':_0x3fc814['fieldName'],'type':_0x3fc814[_0xcede('0x29')][_0xcede('0x2a')]};});_0x499ea2[_0xcede('0x2b')]=_[_0xcede('0x26')](_0x43df57,'name');_0x499ea2[_0xcede('0x2c')]=_[_0xcede('0x2d')](_0x4b6e94[_0xcede('0x2c')]);_0x499ea2[_0xcede('0x2e')]=_[_0xcede('0x2f')](_0x499ea2['model'],_0x499ea2[_0xcede('0x2c')]);_0x4e9e55[_0xcede('0x30')]=_[_0xcede('0x2f')](_0x499ea2['model'],qs['fields'](_0x4b6e94['query'][_0xcede('0x31')]));_0x4e9e55['attributes']=_0x4e9e55[_0xcede('0x30')]['length']?_0x4e9e55[_0xcede('0x30')]:_0x499ea2[_0xcede('0x2b')];if(!_0x4b6e94[_0xcede('0x2c')]['hasOwnProperty'](_0xcede('0x32'))){_0x4e9e55['limit']=qs[_0xcede('0x1d')](_0x4b6e94[_0xcede('0x2c')][_0xcede('0x1d')]);_0x4e9e55[_0xcede('0x1b')]=qs[_0xcede('0x1b')](_0x4b6e94[_0xcede('0x2c')]['offset']);}_0x4e9e55['order']=qs[_0xcede('0x33')](_0x4b6e94[_0xcede('0x2c')][_0xcede('0x33')]);_0x4e9e55['where']=qs[_0xcede('0x2e')](_[_0xcede('0x34')](_0x4b6e94['query'],_0x499ea2['filters']),_0x43df57);if(_0x4b6e94[_0xcede('0x2c')][_0xcede('0x35')]){_0x4e9e55[_0xcede('0x36')]=_[_0xcede('0x37')](_0x4e9e55[_0xcede('0x36')],{'$or':_['map'](_0x43df57,function(_0x562e5e){if(_0x562e5e[_0xcede('0x29')]!=='VIRTUAL'){var _0x56ab2e={};_0x56ab2e[_0x562e5e[_0xcede('0x24')]]={'$like':'%'+_0x4b6e94['query']['filter']+'%'};return _0x56ab2e;}})});}_0x4e9e55=_[_0xcede('0x37')]({},_0x4e9e55,_0x4b6e94['options']);var _0x698526={'where':_0x4e9e55[_0xcede('0x36')]};return db[_0xcede('0x27')][_0xcede('0x1e')](_0x698526)['then'](function(_0x408cfd){_0x5bbb9d[_0xcede('0x1e')]=_0x408cfd;if(_0x4b6e94[_0xcede('0x2c')]['includeAll']){_0x4e9e55['include']=[{'all':!![]}];}return db[_0xcede('0x27')][_0xcede('0x38')](_0x4e9e55);})[_0xcede('0x22')](function(_0x187c27){_0x5bbb9d['rows']=_0x187c27;return _0x5bbb9d;})['then'](respondWithFilteredResult(_0x4b2eb4,_0x4e9e55))[_0xcede('0x39')](handleError(_0x4b2eb4,null));};exports[_0xcede('0x3a')]=function(_0x3ccc3a,_0x45a294){var _0x2d3025={'raw':![],'where':{'id':_0x3ccc3a['params']['id']}},_0x2554c9={};_0x2554c9[_0xcede('0x2b')]=_[_0xcede('0x2d')](db[_0xcede('0x27')][_0xcede('0x28')]);_0x2554c9[_0xcede('0x2c')]=_['keys'](_0x3ccc3a[_0xcede('0x2c')]);_0x2554c9[_0xcede('0x2e')]=_[_0xcede('0x2f')](_0x2554c9['model'],_0x2554c9[_0xcede('0x2c')]);_0x2d3025[_0xcede('0x30')]=_[_0xcede('0x2f')](_0x2554c9[_0xcede('0x2b')],qs[_0xcede('0x31')](_0x3ccc3a[_0xcede('0x2c')][_0xcede('0x31')]));_0x2d3025['attributes']=_0x2d3025[_0xcede('0x30')][_0xcede('0x3b')]?_0x2d3025['attributes']:_0x2554c9[_0xcede('0x2b')];if(_0x3ccc3a[_0xcede('0x2c')]['includeAll']){_0x2d3025['include']=[{'all':!![]}];}_0x2d3025=_['merge']({},_0x2d3025,_0x3ccc3a[_0xcede('0x3c')]);return db[_0xcede('0x27')][_0xcede('0x3d')](_0x2d3025)['then'](handleEntityNotFound(_0x45a294,null))['then'](respondWithResult(_0x45a294,null))[_0xcede('0x39')](handleError(_0x45a294,null));};exports[_0xcede('0x3e')]=function(_0x4921c2,_0xaffb93){return db[_0xcede('0x27')][_0xcede('0x3e')](_0x4921c2[_0xcede('0x3f')],{})[_0xcede('0x22')](respondWithResult(_0xaffb93,0xc9))[_0xcede('0x39')](handleError(_0xaffb93,null));};exports[_0xcede('0x21')]=function(_0x19d3f6,_0x19db48){if(_0x19d3f6[_0xcede('0x3f')]['id']){delete _0x19d3f6[_0xcede('0x3f')]['id'];}return db[_0xcede('0x27')][_0xcede('0x3d')]({'where':{'id':_0x19d3f6['params']['id']}})['then'](handleEntityNotFound(_0x19db48,null))[_0xcede('0x22')](saveUpdates(_0x19d3f6['body'],null))['then'](respondWithResult(_0x19db48,null))[_0xcede('0x39')](handleError(_0x19db48,null));};exports[_0xcede('0x40')]=function(_0x5e5ff0,_0x45a6b4){return db[_0xcede('0x27')]['find']({'where':{'id':_0x5e5ff0[_0xcede('0x41')]['id']}})['then'](handleEntityNotFound(_0x45a6b4,null))[_0xcede('0x22')](removeEntity(_0x45a6b4,null))['catch'](handleError(_0x45a6b4,null));};exports[_0xcede('0x42')]=function(_0x7c1f7e,_0x3b2edd){return db[_0xcede('0x27')][_0xcede('0x42')]()[_0xcede('0x22')](respondWithResult(_0x3b2edd,null))['catch'](handleError(_0x3b2edd,null));};
\ No newline at end of file
index ecaf3ea..ffc930f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea82=['./userProfileSection.attributes','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2a5de1,_0x6aad88){var _0xc0aa99=function(_0x6f4ae3){while(--_0x6f4ae3){_0x2a5de1['push'](_0x2a5de1['shift']());}};_0xc0aa99(++_0x6aad88);}(_0xea82,0x1cd));var _0x2ea8=function(_0x188edb,_0x19fed6){_0x188edb=_0x188edb-0x0;var _0x669a3d=_0xea82[_0x188edb];return _0x669a3d;};'use strict';var _=require(_0x2ea8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ea8('0x1'));var moment=require('moment');var BPromise=require(_0x2ea8('0x2'));var rp=require(_0x2ea8('0x3'));var fs=require('fs');var path=require(_0x2ea8('0x4'));var rimraf=require(_0x2ea8('0x5'));var config=require(_0x2ea8('0x6'));var attributes=require(_0x2ea8('0x7'));module['exports']=function(_0x5392e7,_0x5932eb){return _0x5392e7[_0x2ea8('0x8')]('UserProfileSection',attributes,{'tableName':_0x2ea8('0x9'),'paranoid':![],'indexes':[{'name':_0x2ea8('0xa'),'fields':[_0x2ea8('0xb'),_0x2ea8('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc38b=['moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0xc38b,0x192));var _0xbc38=function(_0x195b2a,_0x265775){_0x195b2a=_0x195b2a-0x0;var _0x1a59a4=_0xc38b[_0x195b2a];return _0x1a59a4;};'use strict';var _=require(_0xbc38('0x0'));var util=require(_0xbc38('0x1'));var logger=require(_0xbc38('0x2'))('api');var moment=require(_0xbc38('0x3'));var BPromise=require(_0xbc38('0x4'));var rp=require(_0xbc38('0x5'));var fs=require('fs');var path=require(_0xbc38('0x6'));var rimraf=require('rimraf');var config=require(_0xbc38('0x7'));var attributes=require(_0xbc38('0x8'));module[_0xbc38('0x9')]=function(_0x48afa6,_0x285ba7){return _0x48afa6['define'](_0xbc38('0xa'),attributes,{'tableName':_0xbc38('0xb'),'paranoid':![],'indexes':[{'name':_0xbc38('0xc'),'fields':[_0xbc38('0xd'),_0xbc38('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 295267d..c11ad0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6867=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','moment'];(function(_0x1cd31b,_0xf1cb0){var _0x123acf=function(_0x33474c){while(--_0x33474c){_0x1cd31b['push'](_0x1cd31b['shift']());}};_0x123acf(++_0xf1cb0);}(_0x6867,0x98));var _0x7686=function(_0x20edd4,_0x7c30f2){_0x20edd4=_0x20edd4-0x0;var _0xc4a1e4=_0x6867[_0x20edd4];return _0xc4a1e4;};'use strict';var _=require(_0x7686('0x0'));var util=require('util');var moment=require(_0x7686('0x1'));var BPromise=require(_0x7686('0x2'));var rs=require(_0x7686('0x3'));var fs=require('fs');var Redis=require(_0x7686('0x4'));var db=require(_0x7686('0x5'))['db'];var utils=require(_0x7686('0x6'));var logger=require('../../config/logger')(_0x7686('0x7'));var config=require(_0x7686('0x8'));var jayson=require(_0x7686('0x9'));var client=jayson[_0x7686('0xa')][_0x7686('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ed553,_0x4af6ef,_0x41eeab){return new BPromise(function(_0x48573c,_0x4b9cfb){return client['request'](_0x3ed553,_0x41eeab)[_0x7686('0xc')](function(_0xeda484){logger['info'](_0x7686('0xd'),_0x4af6ef,_0x7686('0xe'));logger[_0x7686('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x4af6ef,_0x7686('0xe'),JSON[_0x7686('0x10')](_0xeda484));if(_0xeda484[_0x7686('0x11')]){if(_0xeda484['error']['code']===0x1f4){logger['error'](_0x7686('0xd'),_0x4af6ef,_0xeda484[_0x7686('0x11')][_0x7686('0x12')]);return _0x4b9cfb(_0xeda484[_0x7686('0x11')][_0x7686('0x12')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x4af6ef,_0xeda484[_0x7686('0x11')][_0x7686('0x12')]);return _0x48573c(_0xeda484[_0x7686('0x11')][_0x7686('0x12')]);}else{logger[_0x7686('0x13')](_0x7686('0xd'),_0x4af6ef,_0x7686('0xe'));_0x48573c(_0xeda484[_0x7686('0x14')][_0x7686('0x12')]);}})[_0x7686('0x15')](function(_0x6b0eb){logger[_0x7686('0x11')](_0x7686('0xd'),_0x4af6ef,_0x6b0eb);_0x4b9cfb(_0x6b0eb);});});}
\ No newline at end of file
+var _0xf53e=['stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x34d4cd,_0x44478e){var _0x55bdd1=function(_0x565224){while(--_0x565224){_0x34d4cd['push'](_0x34d4cd['shift']());}};_0x55bdd1(++_0x44478e);}(_0xf53e,0x146));var _0xef53=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf53e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xef53('0x0'));var util=require(_0xef53('0x1'));var moment=require(_0xef53('0x2'));var BPromise=require(_0xef53('0x3'));var rs=require(_0xef53('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef53('0x5'))['db'];var utils=require(_0xef53('0x6'));var logger=require('../../config/logger')(_0xef53('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xef53('0x8')][_0xef53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c38df,_0x59aa42,_0xc841be){return new BPromise(function(_0x393bd6,_0x54006c){return client['request'](_0x3c38df,_0xc841be)[_0xef53('0xa')](function(_0x184719){logger[_0xef53('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x59aa42,_0xef53('0xc'));logger['debug'](_0xef53('0xd'),_0x59aa42,_0xef53('0xc'),JSON[_0xef53('0xe')](_0x184719));if(_0x184719['error']){if(_0x184719[_0xef53('0xf')][_0xef53('0x10')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x59aa42,_0x184719[_0xef53('0xf')][_0xef53('0x11')]);return _0x54006c(_0x184719[_0xef53('0xf')][_0xef53('0x11')]);}logger[_0xef53('0xf')](_0xef53('0x12'),_0x59aa42,_0x184719[_0xef53('0xf')][_0xef53('0x11')]);return _0x393bd6(_0x184719[_0xef53('0xf')][_0xef53('0x11')]);}else{logger[_0xef53('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x59aa42,'request\x20sent');_0x393bd6(_0x184719[_0xef53('0x13')]['message']);}})['catch'](function(_0x598c4d){logger[_0xef53('0xf')](_0xef53('0x12'),_0x59aa42,_0x598c4d);_0x54006c(_0x598c4d);});});}
\ No newline at end of file
index 580bf3e..29eee83 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(_0x2adb04,_0x4d4356){var _0x3c1bca=function(_0x5e3b88){while(--_0x5e3b88){_0x2adb04['push'](_0x2adb04['shift']());}};_0x3c1bca(++_0x4d4356);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x53a270,_0x548ddc){var _0x4b4e80=function(_0x55b5a6){while(--_0x55b5a6){_0x53a270['push'](_0x53a270['shift']());}};_0x4b4e80(++_0x548ddc);}(_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 ed247a4..6b8e818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d54=['exports','INTEGER','sequelize'];(function(_0x53317e,_0x5a9ec9){var _0x463db9=function(_0x170557){while(--_0x170557){_0x53317e['push'](_0x53317e['shift']());}};_0x463db9(++_0x5a9ec9);}(_0x4d54,0xf5));var _0x44d5=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4d54[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x44d5('0x0'));module[_0x44d5('0x1')]={'penalty':{'type':Sequelize[_0x44d5('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7e57=['exports','INTEGER'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0x7e57,0xf6));var _0x77e5=function(_0xe7aa08,_0x480743){_0xe7aa08=_0xe7aa08-0x0;var _0xbc6799=_0x7e57[_0xe7aa08];return _0xbc6799;};'use strict';var Sequelize=require('sequelize');module[_0x77e5('0x0')]={'penalty':{'type':Sequelize[_0x77e5('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 76dd835..a46c92a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeda8,0x104));var _0x8eda=function(_0x2a240a,_0x51d15e){_0x2a240a=_0x2a240a-0x0;var _0x466172=_0xeda8[_0x2a240a];return _0x466172;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('UserSmsQueue',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdec3=['../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x531c3f,_0x156da4){var _0x2885c7=function(_0x549070){while(--_0x549070){_0x531c3f['push'](_0x531c3f['shift']());}};_0x2885c7(++_0x156da4);}(_0xdec3,0x89));var _0x3dec=function(_0x3020e2,_0x310f30){_0x3020e2=_0x3020e2-0x0;var _0x425ef8=_0xdec3[_0x3020e2];return _0x425ef8;};'use strict';var _=require(_0x3dec('0x0'));var util=require('util');var logger=require(_0x3dec('0x1'))(_0x3dec('0x2'));var moment=require(_0x3dec('0x3'));var BPromise=require('bluebird');var rp=require(_0x3dec('0x4'));var fs=require('fs');var path=require(_0x3dec('0x5'));var rimraf=require(_0x3dec('0x6'));var config=require(_0x3dec('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x3dec('0x8')]=function(_0x2894eb,_0x347c06){return _0x2894eb[_0x3dec('0x9')](_0x3dec('0xa'),attributes,{'tableName':_0x3dec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aba827d..62dd2d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8791=['client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2f8402,_0x2a3a00){var _0x5657f3=function(_0x149b2f){while(--_0x149b2f){_0x2f8402['push'](_0x2f8402['shift']());}};_0x5657f3(++_0x2a3a00);}(_0x8791,0xfe));var _0x1879=function(_0x4b8295,_0x3b1df1){_0x4b8295=_0x4b8295-0x0;var _0x3ef8a1=_0x8791[_0x4b8295];return _0x3ef8a1;};'use strict';var _=require(_0x1879('0x0'));var util=require(_0x1879('0x1'));var moment=require(_0x1879('0x2'));var BPromise=require(_0x1879('0x3'));var rs=require(_0x1879('0x4'));var fs=require('fs');var Redis=require(_0x1879('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1879('0x6'));var logger=require('../../config/logger')(_0x1879('0x7'));var config=require(_0x1879('0x8'));var jayson=require(_0x1879('0x9'));var client=jayson[_0x1879('0xa')][_0x1879('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c2251,_0x2ea82c,_0x19b9f9){return new BPromise(function(_0x2cf9bd,_0xba8cbd){return client['request'](_0x3c2251,_0x19b9f9)[_0x1879('0xc')](function(_0x440e7c){logger['info'](_0x1879('0xd'),_0x2ea82c,_0x1879('0xe'));logger[_0x1879('0xf')](_0x1879('0x10'),_0x2ea82c,'request\x20sent',JSON['stringify'](_0x440e7c));if(_0x440e7c[_0x1879('0x11')]){if(_0x440e7c[_0x1879('0x11')]['code']===0x1f4){logger[_0x1879('0x11')](_0x1879('0xd'),_0x2ea82c,_0x440e7c[_0x1879('0x11')][_0x1879('0x12')]);return _0xba8cbd(_0x440e7c[_0x1879('0x11')][_0x1879('0x12')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2ea82c,_0x440e7c[_0x1879('0x11')][_0x1879('0x12')]);return _0x2cf9bd(_0x440e7c[_0x1879('0x11')][_0x1879('0x12')]);}else{logger[_0x1879('0x13')](_0x1879('0xd'),_0x2ea82c,_0x1879('0xe'));_0x2cf9bd(_0x440e7c[_0x1879('0x14')]['message']);}})[_0x1879('0x15')](function(_0x33a7b8){logger[_0x1879('0x11')](_0x1879('0xd'),_0x2ea82c,_0x33a7b8);_0xba8cbd(_0x33a7b8);});});}
\ No newline at end of file
+var _0xf233=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x623ad7,_0x200178){var _0x2610af=function(_0x29a7ff){while(--_0x29a7ff){_0x623ad7['push'](_0x623ad7['shift']());}};_0x2610af(++_0x200178);}(_0xf233,0x10b));var _0x3f23=function(_0x419f64,_0x19eb13){_0x419f64=_0x419f64-0x0;var _0x5549a0=_0xf233[_0x419f64];return _0x5549a0;};'use strict';var _=require(_0x3f23('0x0'));var util=require(_0x3f23('0x1'));var moment=require('moment');var BPromise=require(_0x3f23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f23('0x3'));var db=require(_0x3f23('0x4'))['db'];var utils=require(_0x3f23('0x5'));var logger=require(_0x3f23('0x6'))(_0x3f23('0x7'));var config=require('../../config/environment');var jayson=require(_0x3f23('0x8'));var client=jayson[_0x3f23('0x9')][_0x3f23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfe6d73,_0x31925c,_0x5251d3){return new BPromise(function(_0x3346bf,_0x30e289){return client[_0x3f23('0xb')](_0xfe6d73,_0x5251d3)[_0x3f23('0xc')](function(_0x5b829d){logger[_0x3f23('0xd')](_0x3f23('0xe'),_0x31925c,'request\x20sent');logger[_0x3f23('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x31925c,_0x3f23('0x10'),JSON[_0x3f23('0x11')](_0x5b829d));if(_0x5b829d[_0x3f23('0x12')]){if(_0x5b829d[_0x3f23('0x12')][_0x3f23('0x13')]===0x1f4){logger[_0x3f23('0x12')](_0x3f23('0xe'),_0x31925c,_0x5b829d[_0x3f23('0x12')]['message']);return _0x30e289(_0x5b829d[_0x3f23('0x12')]['message']);}logger['error'](_0x3f23('0xe'),_0x31925c,_0x5b829d['error'][_0x3f23('0x14')]);return _0x3346bf(_0x5b829d['error'][_0x3f23('0x14')]);}else{logger[_0x3f23('0xd')](_0x3f23('0xe'),_0x31925c,_0x3f23('0x10'));_0x3346bf(_0x5b829d[_0x3f23('0x15')][_0x3f23('0x14')]);}})[_0x3f23('0x16')](function(_0x1955a4){logger[_0x3f23('0x12')](_0x3f23('0xe'),_0x31925c,_0x1955a4);_0x30e289(_0x1955a4);});});}
\ No newline at end of file
index f68a435..75280cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1262=['INTEGER','exports'];(function(_0x44f353,_0x5b6c2f){var _0x26a635=function(_0x32726e){while(--_0x32726e){_0x44f353['push'](_0x44f353['shift']());}};_0x26a635(++_0x5b6c2f);}(_0x1262,0xe7));var _0x2126=function(_0x2f20d9,_0x526464){_0x2f20d9=_0x2f20d9-0x0;var _0x45a4ee=_0x1262[_0x2f20d9];return _0x45a4ee;};'use strict';var Sequelize=require('sequelize');module[_0x2126('0x0')]={'UserId':{'type':Sequelize[_0x2126('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x2126('0x1')]}};
\ No newline at end of file
+var _0x0c66=['sequelize','exports','INTEGER'];(function(_0x16e6ea,_0x44978e){var _0x29ae3c=function(_0x54da81){while(--_0x54da81){_0x16e6ea['push'](_0x16e6ea['shift']());}};_0x29ae3c(++_0x44978e);}(_0x0c66,0xf9));var _0x60c6=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x0c66[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0x60c6('0x0'));module[_0x60c6('0x1')]={'UserId':{'type':Sequelize[_0x60c6('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x60c6('0x2')]}};
\ No newline at end of file
index e9a0751..925956a 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(_0x10c044,_0x1f4f9a){var _0x256237=function(_0x12e1f7){while(--_0x12e1f7){_0x10c044['push'](_0x10c044['shift']());}};_0x256237(++_0x1f4f9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x12fe80,_0x54ca2c){var _0x2ef3cf=function(_0x35860c){while(--_0x35860c){_0x12fe80['push'](_0x12fe80['shift']());}};_0x2ef3cf(++_0x54ca2c);}(_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 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 ad3f4ac..26ff07c 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(_0x61909f,_0x1afdea){var _0x4ad05e=function(_0x1380a0){while(--_0x1380a0){_0x61909f['push'](_0x61909f['shift']());}};_0x4ad05e(++_0x1afdea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xbe31a4,_0x11ba89){var _0x15ec28=function(_0x124633){while(--_0x124633){_0xbe31a4['push'](_0xbe31a4['shift']());}};_0x15ec28(++_0x11ba89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 d0a6499..ed1e03d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa584=['INTEGER','exports'];(function(_0x30eb5b,_0x234476){var _0x559d73=function(_0x35e62f){while(--_0x35e62f){_0x30eb5b['push'](_0x30eb5b['shift']());}};_0x559d73(++_0x234476);}(_0xa584,0x163));var _0x4a58=function(_0x39642c,_0x1a7851){_0x39642c=_0x39642c-0x0;var _0x3ac445=_0xa584[_0x39642c];return _0x3ac445;};'use strict';var Sequelize=require('sequelize');module[_0x4a58('0x0')]={'penalty':{'type':Sequelize[_0x4a58('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9af2=['sequelize','exports','INTEGER'];(function(_0x4bd67a,_0x4f9725){var _0x2be5fb=function(_0x33e132){while(--_0x33e132){_0x4bd67a['push'](_0x4bd67a['shift']());}};_0x2be5fb(++_0x4f9725);}(_0x9af2,0x12c));var _0x29af=function(_0x488f1a,_0x5bbef9){_0x488f1a=_0x488f1a-0x0;var _0x4e8346=_0x9af2[_0x488f1a];return _0x4e8346;};'use strict';var Sequelize=require(_0x29af('0x0'));module[_0x29af('0x1')]={'penalty':{'type':Sequelize[_0x29af('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index b534750..27e2ef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d4d=['bluebird','request-promise','path','rimraf','../../config/environment','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x2f0087,_0x12d79c){var _0x5be139=function(_0x779c5b){while(--_0x779c5b){_0x2f0087['push'](_0x2f0087['shift']());}};_0x5be139(++_0x12d79c);}(_0x3d4d,0xaf));var _0xd3d4=function(_0x19d48d,_0xc31e9e){_0x19d48d=_0x19d48d-0x0;var _0x1da815=_0x3d4d[_0x19d48d];return _0x1da815;};'use strict';var _=require(_0xd3d4('0x0'));var util=require(_0xd3d4('0x1'));var logger=require(_0xd3d4('0x2'))(_0xd3d4('0x3'));var moment=require(_0xd3d4('0x4'));var BPromise=require(_0xd3d4('0x5'));var rp=require(_0xd3d4('0x6'));var fs=require('fs');var path=require(_0xd3d4('0x7'));var rimraf=require(_0xd3d4('0x8'));var config=require(_0xd3d4('0x9'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x115e2c,_0x585baa){return _0x115e2c['define'](_0xd3d4('0xa'),attributes,{'tableName':_0xd3d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf817=['user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue'];(function(_0x424fd0,_0x43ef57){var _0x305693=function(_0x595d2d){while(--_0x595d2d){_0x424fd0['push'](_0x424fd0['shift']());}};_0x305693(++_0x43ef57);}(_0xf817,0x161));var _0x7f81=function(_0x7ebefd,_0x3be2b4){_0x7ebefd=_0x7ebefd-0x0;var _0x1fe20b=_0xf817[_0x7ebefd];return _0x1fe20b;};'use strict';var _=require(_0x7f81('0x0'));var util=require('util');var logger=require(_0x7f81('0x1'))(_0x7f81('0x2'));var moment=require(_0x7f81('0x3'));var BPromise=require(_0x7f81('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f81('0x5'));var rimraf=require(_0x7f81('0x6'));var config=require('../../config/environment');var attributes=require(_0x7f81('0x7'));module['exports']=function(_0x15d572,_0x22b0ff){return _0x15d572[_0x7f81('0x8')](_0x7f81('0x9'),attributes,{'tableName':_0x7f81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3387d7b..ce7cf09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9be0=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x5ce781,_0x736b15){var _0xa70499=function(_0x48558b){while(--_0x48558b){_0x5ce781['push'](_0x5ce781['shift']());}};_0xa70499(++_0x736b15);}(_0x9be0,0x138));var _0x09be=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9be0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x09be('0x0'));var util=require('util');var moment=require(_0x09be('0x1'));var BPromise=require(_0x09be('0x2'));var rs=require(_0x09be('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x09be('0x4'));var logger=require(_0x09be('0x5'))(_0x09be('0x6'));var config=require(_0x09be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x09be('0x8')][_0x09be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdfec1b,_0x326906,_0xbad233){return new BPromise(function(_0x1cd2da,_0x46c54f){return client['request'](_0xdfec1b,_0xbad233)[_0x09be('0xa')](function(_0x4b6e68){logger[_0x09be('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x326906,_0x09be('0xc'));logger[_0x09be('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x326906,_0x09be('0xc'),JSON[_0x09be('0xe')](_0x4b6e68));if(_0x4b6e68[_0x09be('0xf')]){if(_0x4b6e68[_0x09be('0xf')][_0x09be('0x10')]===0x1f4){logger[_0x09be('0xf')](_0x09be('0x11'),_0x326906,_0x4b6e68[_0x09be('0xf')]['message']);return _0x46c54f(_0x4b6e68[_0x09be('0xf')][_0x09be('0x12')]);}logger[_0x09be('0xf')](_0x09be('0x11'),_0x326906,_0x4b6e68[_0x09be('0xf')][_0x09be('0x12')]);return _0x1cd2da(_0x4b6e68['error'][_0x09be('0x12')]);}else{logger['info'](_0x09be('0x11'),_0x326906,_0x09be('0xc'));_0x1cd2da(_0x4b6e68[_0x09be('0x13')][_0x09be('0x12')]);}})[_0x09be('0x14')](function(_0x1135e3){logger['error'](_0x09be('0x11'),_0x326906,_0x1135e3);_0x46c54f(_0x1135e3);});});}
\ No newline at end of file
+var _0x6ee3=['request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x8ef372,_0x6759e9){var _0x1fc7ad=function(_0x285b27){while(--_0x285b27){_0x8ef372['push'](_0x8ef372['shift']());}};_0x1fc7ad(++_0x6759e9);}(_0x6ee3,0x12d));var _0x36ee=function(_0x4bec98,_0x28bd0c){_0x4bec98=_0x4bec98-0x0;var _0x18ebae=_0x6ee3[_0x4bec98];return _0x18ebae;};'use strict';var _=require(_0x36ee('0x0'));var util=require(_0x36ee('0x1'));var moment=require(_0x36ee('0x2'));var BPromise=require('bluebird');var rs=require(_0x36ee('0x3'));var fs=require('fs');var Redis=require(_0x36ee('0x4'));var db=require(_0x36ee('0x5'))['db'];var utils=require(_0x36ee('0x6'));var logger=require(_0x36ee('0x7'))(_0x36ee('0x8'));var config=require(_0x36ee('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x36ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50b416,_0x288e7a,_0x2d5ee5){return new BPromise(function(_0x135abc,_0x9ace9b){return client[_0x36ee('0xb')](_0x50b416,_0x2d5ee5)[_0x36ee('0xc')](function(_0x2a7a68){logger[_0x36ee('0xd')](_0x36ee('0xe'),_0x288e7a,_0x36ee('0xf'));logger[_0x36ee('0x10')](_0x36ee('0x11'),_0x288e7a,_0x36ee('0xf'),JSON[_0x36ee('0x12')](_0x2a7a68));if(_0x2a7a68['error']){if(_0x2a7a68['error'][_0x36ee('0x13')]===0x1f4){logger[_0x36ee('0x14')](_0x36ee('0xe'),_0x288e7a,_0x2a7a68['error'][_0x36ee('0x15')]);return _0x9ace9b(_0x2a7a68[_0x36ee('0x14')][_0x36ee('0x15')]);}logger[_0x36ee('0x14')](_0x36ee('0xe'),_0x288e7a,_0x2a7a68['error']['message']);return _0x135abc(_0x2a7a68[_0x36ee('0x14')][_0x36ee('0x15')]);}else{logger[_0x36ee('0xd')](_0x36ee('0xe'),_0x288e7a,_0x36ee('0xf'));_0x135abc(_0x2a7a68[_0x36ee('0x16')][_0x36ee('0x15')]);}})[_0x36ee('0x17')](function(_0x53add6){logger[_0x36ee('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x288e7a,_0x53add6);_0x9ace9b(_0x53add6);});});}
\ No newline at end of file
index baae765..aa4346e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x35d59c,_0x4aa57e){var _0x55d5cc=function(_0x243c04){while(--_0x243c04){_0x35d59c['push'](_0x35d59c['shift']());}};_0x55d5cc(++_0x4aa57e);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'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
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xb04cb1,_0x13b8e3){var _0x309445=function(_0x21422b){while(--_0x21422b){_0xb04cb1['push'](_0xb04cb1['shift']());}};_0x309445(++_0x13b8e3);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'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 0c7d940..5b6fa9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe9=['INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','exports'];(function(_0x2fffb2,_0x3c476f){var _0x46eb4f=function(_0x283ff2){while(--_0x283ff2){_0x2fffb2['push'](_0x2fffb2['shift']());}};_0x46eb4f(++_0x3c476f);}(_0x9fe9,0x184));var _0x99fe=function(_0x9932e6,_0x54d05a){_0x9932e6=_0x9932e6-0x0;var _0x4ec66b=_0x9fe9[_0x9932e6];return _0x4ec66b;};'use strict';var Sequelize=require(_0x99fe('0x0'));module[_0x99fe('0x1')]={'uniqueid':{'type':Sequelize[_0x99fe('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x99fe('0x3')],'allowNull':![],'comment':_0x99fe('0x4')},'UserId':{'type':Sequelize[_0x99fe('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x99fe('0x3')],'allowNull':![],'unique':_0x99fe('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x99fe('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x99fe('0x4')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x99fe('0x4')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x99fe('0x4')}};
\ No newline at end of file
+var _0x0d64=['INTEGER','Required\x20by\x20Asterisk','queue_interface','STRING','sequelize'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x0d64,0x77));var _0x40d6=function(_0x59197b,_0x35ec49){_0x59197b=_0x59197b-0x0;var _0x2c5edf=_0x0d64[_0x59197b];return _0x2c5edf;};'use strict';var Sequelize=require(_0x40d6('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x40d6('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x40d6('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x40d6('0x2')},'UserId':{'type':Sequelize[_0x40d6('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x40d6('0x3'),'comment':_0x40d6('0x2')},'VoiceQueueId':{'type':Sequelize[_0x40d6('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x40d6('0x4')],'allowNull':![],'unique':_0x40d6('0x3'),'comment':_0x40d6('0x2')},'penalty':{'type':Sequelize[_0x40d6('0x1')](0xb),'defaultValue':0x0,'comment':_0x40d6('0x2')},'paused':{'type':Sequelize[_0x40d6('0x1')](0xb),'defaultValue':0x0,'comment':_0x40d6('0x2')}};
\ No newline at end of file
index 47e522d..57594df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17bb=['../../mysqldb','update','emit','hook','events'];(function(_0x11af57,_0x3768a4){var _0x2c4cbc=function(_0x1a07ef){while(--_0x1a07ef){_0x11af57['push'](_0x11af57['shift']());}};_0x2c4cbc(++_0x3768a4);}(_0x17bb,0x1b7));var _0xb17b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x17bb[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xb17b('0x0'));var UserVoiceQueueRt=require(_0xb17b('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb17b('0x2'),'afterDestroy':'remove'};function emitEvent(_0x17c2df){return function(_0x203711,_0x46c21e,_0x561b5e){UserVoiceQueueRtEvents['emit'](_0x17c2df+':'+_0x203711['id'],_0x203711);UserVoiceQueueRtEvents[_0xb17b('0x3')](_0x17c2df,_0x203711);_0x561b5e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xb17b('0x4')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xe9e7=['hasOwnProperty','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0x367d93,_0x1c57c0){var _0x271a1d=function(_0x42331b){while(--_0x42331b){_0x367d93['push'](_0x367d93['shift']());}};_0x271a1d(++_0x1c57c0);}(_0xe9e7,0x11a));var _0x7e9e=function(_0x1946cc,_0x5a0002){_0x1946cc=_0x1946cc-0x0;var _0x5d8fb1=_0xe9e7[_0x1946cc];return _0x5d8fb1;};'use strict';var EventEmitter=require(_0x7e9e('0x0'));var UserVoiceQueueRt=require(_0x7e9e('0x1'))['db'][_0x7e9e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x7e9e('0x3')](0x0);var events={'afterCreate':_0x7e9e('0x4'),'afterUpdate':_0x7e9e('0x5'),'afterDestroy':_0x7e9e('0x6')};function emitEvent(_0x3281a8){return function(_0x31f44b,_0x3ced42,_0x6c8e97){UserVoiceQueueRtEvents[_0x7e9e('0x7')](_0x3281a8+':'+_0x31f44b['id'],_0x31f44b);UserVoiceQueueRtEvents['emit'](_0x3281a8,_0x31f44b);_0x6c8e97(null);};}for(var e in events){if(events[_0x7e9e('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x7e9e('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 715c2bc..06835c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bad=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x503742,_0x360163){var _0xa82daa=function(_0x4e2ff5){while(--_0x4e2ff5){_0x503742['push'](_0x503742['shift']());}};_0xa82daa(++_0x360163);}(_0x0bad,0x144));var _0xd0ba=function(_0x4626ad,_0x43f817){_0x4626ad=_0x4626ad-0x0;var _0x2b8b0d=_0x0bad[_0x4626ad];return _0x2b8b0d;};'use strict';var _=require(_0xd0ba('0x0'));var util=require(_0xd0ba('0x1'));var logger=require(_0xd0ba('0x2'))(_0xd0ba('0x3'));var moment=require(_0xd0ba('0x4'));var BPromise=require(_0xd0ba('0x5'));var rp=require(_0xd0ba('0x6'));var fs=require('fs');var path=require(_0xd0ba('0x7'));var rimraf=require('rimraf');var config=require(_0xd0ba('0x8'));var attributes=require(_0xd0ba('0x9'));module[_0xd0ba('0xa')]=function(_0xe24a53,_0x17014a){return _0xe24a53[_0xd0ba('0xb')](_0xd0ba('0xc'),attributes,{'tableName':_0xd0ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x73ca=['UserVoiceQueueRt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define'];(function(_0x57a043,_0x36be25){var _0x22d623=function(_0x4d02a1){while(--_0x4d02a1){_0x57a043['push'](_0x57a043['shift']());}};_0x22d623(++_0x36be25);}(_0x73ca,0x1a5));var _0xa73c=function(_0x456692,_0x378cd1){_0x456692=_0x456692-0x0;var _0x4bb005=_0x73ca[_0x456692];return _0x4bb005;};'use strict';var _=require(_0xa73c('0x0'));var util=require(_0xa73c('0x1'));var logger=require(_0xa73c('0x2'))('api');var moment=require(_0xa73c('0x3'));var BPromise=require(_0xa73c('0x4'));var rp=require(_0xa73c('0x5'));var fs=require('fs');var path=require(_0xa73c('0x6'));var rimraf=require(_0xa73c('0x7'));var config=require('../../config/environment');var attributes=require(_0xa73c('0x8'));module[_0xa73c('0x9')]=function(_0xaec889,_0x31e11a){return _0xaec889[_0xa73c('0xa')](_0xa73c('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3145bfc..1e1804a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7afc=['localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x18bbf5,_0x9e676){var _0x4d0103=function(_0x2a5431){while(--_0x2a5431){_0x18bbf5['push'](_0x18bbf5['shift']());}};_0x4d0103(++_0x9e676);}(_0x7afc,0x1a3));var _0xc7af=function(_0x4b55cb,_0x49791b){_0x4b55cb=_0x4b55cb-0x0;var _0x2631df=_0x7afc[_0x4b55cb];return _0x2631df;};'use strict';var _=require(_0xc7af('0x0'));var util=require(_0xc7af('0x1'));var moment=require('moment');var BPromise=require(_0xc7af('0x2'));var rs=require(_0xc7af('0x3'));var fs=require('fs');var Redis=require(_0xc7af('0x4'));var db=require(_0xc7af('0x5'))['db'];var utils=require(_0xc7af('0x6'));var logger=require(_0xc7af('0x7'))('rpc');var config=require(_0xc7af('0x8'));var jayson=require(_0xc7af('0x9'));var client=jayson[_0xc7af('0xa')][_0xc7af('0xb')]({'port':0x232a});config['redis']=_[_0xc7af('0xc')](config['redis'],{'host':_0xc7af('0xd'),'port':0x18eb});var socket=require(_0xc7af('0xe'))(new Redis(config[_0xc7af('0xf')]));require(_0xc7af('0x10'))['register'](socket);function respondWithRpcPromise(_0x550597,_0xa94370,_0xaa749){return new BPromise(function(_0x4c4843,_0x7ab97){return client['request'](_0x550597,_0xaa749)[_0xc7af('0x11')](function(_0x50ff14){logger[_0xc7af('0x12')](_0xc7af('0x13'),_0xa94370,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0xa94370,_0xc7af('0x14'),JSON[_0xc7af('0x15')](_0x50ff14));if(_0x50ff14['error']){if(_0x50ff14['error']['code']===0x1f4){logger['error'](_0xc7af('0x13'),_0xa94370,_0x50ff14[_0xc7af('0x16')][_0xc7af('0x17')]);return _0x7ab97(_0x50ff14['error'][_0xc7af('0x17')]);}logger['error'](_0xc7af('0x13'),_0xa94370,_0x50ff14['error'][_0xc7af('0x17')]);return _0x4c4843(_0x50ff14[_0xc7af('0x16')][_0xc7af('0x17')]);}else{logger[_0xc7af('0x12')](_0xc7af('0x13'),_0xa94370,_0xc7af('0x14'));_0x4c4843(_0x50ff14['result'][_0xc7af('0x17')]);}})['catch'](function(_0x120bbc){logger['error'](_0xc7af('0x13'),_0xa94370,_0x120bbc);_0x7ab97(_0x120bbc);});});}exports[_0xc7af('0x18')]=function(_0x1fcbac){var _0x2559b7=this;return new Promise(function(_0x4080fa,_0x70171d){return db['UserVoiceQueueRt'][_0xc7af('0x19')]({'raw':_0x1fcbac[_0xc7af('0x1a')]?_0x1fcbac['options'][_0xc7af('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fcbac[_0xc7af('0x1a')]?_0x1fcbac['options'][_0xc7af('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0xc7af('0x1d'),db[_0xc7af('0x1e')]['fn']('IF',db[_0xc7af('0x1e')][_0xc7af('0x1f')](_0xc7af('0x20')))),_0xc7af('0x21')]]})[_0xc7af('0x11')](function(_0x24bb85){logger[_0xc7af('0x12')](_0xc7af('0x18'),_0x1fcbac);logger[_0xc7af('0x22')]('GetVoiceQueueRtPauses',_0x1fcbac,JSON['stringify'](_0x24bb85));_0x4080fa(_0x24bb85);})[_0xc7af('0x23')](function(_0x1c4b51){logger[_0xc7af('0x16')](_0xc7af('0x18'),_0x1c4b51['message'],_0x1fcbac);_0x70171d(_0x2559b7['error'](0x1f4,_0x1c4b51[_0xc7af('0x17')]));});});};
\ No newline at end of file
+var _0x7cae=['defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','UserVoiceQueueRt','findAll','options','raw','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x7cae,0x154));var _0xe7ca=function(_0x5115f7,_0x28cafa){_0x5115f7=_0x5115f7-0x0;var _0x1d21f4=_0x7cae[_0x5115f7];return _0x1d21f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe7ca('0x0'));var rs=require(_0xe7ca('0x1'));var fs=require('fs');var Redis=require(_0xe7ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ca('0x3'));var logger=require(_0xe7ca('0x4'))('rpc');var config=require(_0xe7ca('0x5'));var jayson=require(_0xe7ca('0x6'));var client=jayson[_0xe7ca('0x7')][_0xe7ca('0x8')]({'port':0x232a});config[_0xe7ca('0x9')]=_[_0xe7ca('0xa')](config['redis'],{'host':_0xe7ca('0xb'),'port':0x18eb});var socket=require(_0xe7ca('0xc'))(new Redis(config[_0xe7ca('0x9')]));require(_0xe7ca('0xd'))[_0xe7ca('0xe')](socket);function respondWithRpcPromise(_0x427068,_0x23fd74,_0x544021){return new BPromise(function(_0x7d7f59,_0x24de52){return client['request'](_0x427068,_0x544021)[_0xe7ca('0xf')](function(_0x100edd){logger[_0xe7ca('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x23fd74,_0xe7ca('0x11'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x23fd74,_0xe7ca('0x11'),JSON[_0xe7ca('0x12')](_0x100edd));if(_0x100edd[_0xe7ca('0x13')]){if(_0x100edd[_0xe7ca('0x13')][_0xe7ca('0x14')]===0x1f4){logger[_0xe7ca('0x13')](_0xe7ca('0x15'),_0x23fd74,_0x100edd[_0xe7ca('0x13')][_0xe7ca('0x16')]);return _0x24de52(_0x100edd[_0xe7ca('0x13')][_0xe7ca('0x16')]);}logger[_0xe7ca('0x13')](_0xe7ca('0x15'),_0x23fd74,_0x100edd[_0xe7ca('0x13')]['message']);return _0x7d7f59(_0x100edd[_0xe7ca('0x13')][_0xe7ca('0x16')]);}else{logger[_0xe7ca('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x23fd74,_0xe7ca('0x11'));_0x7d7f59(_0x100edd[_0xe7ca('0x17')][_0xe7ca('0x16')]);}})[_0xe7ca('0x18')](function(_0x10218c){logger['error'](_0xe7ca('0x15'),_0x23fd74,_0x10218c);_0x24de52(_0x10218c);});});}exports['GetVoiceQueueRtPauses']=function(_0x46fdf2){var _0x40c201=this;return new Promise(function(_0x50aa10,_0x50b5ac){return db[_0xe7ca('0x19')][_0xe7ca('0x1a')]({'raw':_0x46fdf2[_0xe7ca('0x1b')]?_0x46fdf2[_0xe7ca('0x1b')][_0xe7ca('0x1c')]===undefined?!![]:![]:!![],'where':_0x46fdf2[_0xe7ca('0x1b')]?_0x46fdf2[_0xe7ca('0x1b')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xe7ca('0x1d'),db[_0xe7ca('0x1e')]['fn']('IF',db[_0xe7ca('0x1e')][_0xe7ca('0x1f')](_0xe7ca('0x20')))),_0xe7ca('0x21')]]})[_0xe7ca('0xf')](function(_0x2de244){logger[_0xe7ca('0x10')](_0xe7ca('0x22'),_0x46fdf2);logger['debug']('GetVoiceQueueRtPauses',_0x46fdf2,JSON['stringify'](_0x2de244));_0x50aa10(_0x2de244);})[_0xe7ca('0x18')](function(_0x5b9c6a){logger[_0xe7ca('0x13')](_0xe7ca('0x22'),_0x5b9c6a['message'],_0x46fdf2);_0x50b5ac(_0x40c201['error'](0x1f4,_0x5b9c6a[_0xe7ca('0x16')]));});});};
\ No newline at end of file
index f801d89..c6d7d61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbecd=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit','removeListener','register'];(function(_0x29cb88,_0x36e887){var _0x7988a7=function(_0x3de7f5){while(--_0x3de7f5){_0x29cb88['push'](_0x29cb88['shift']());}};_0x7988a7(++_0x36e887);}(_0xbecd,0x6a));var _0xdbec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbecd[_0x321bb2];return _0x9c12ed;};'use strict';var UserVoiceQueueRtEvents=require(_0xdbec('0x0'));var events=['save',_0xdbec('0x1'),_0xdbec('0x2')];function createListener(_0x545337,_0x3b57d4){return function(_0x2cf335){_0x3b57d4[_0xdbec('0x3')](_0x545337,_0x2cf335);};}function removeListener(_0x31d770,_0x4586e7){return function(){UserVoiceQueueRtEvents[_0xdbec('0x4')](_0x31d770,_0x4586e7);};}exports[_0xdbec('0x5')]=function(_0x411618){for(var _0x578a3b=0x0,_0x38cac4=events[_0xdbec('0x6')];_0x578a3b<_0x38cac4;_0x578a3b++){var _0x380bf8=events[_0x578a3b];var _0x406cd3=createListener(_0xdbec('0x7')+_0x380bf8,_0x411618);UserVoiceQueueRtEvents['on'](_0x380bf8,_0x406cd3);}};
\ No newline at end of file
+var _0x64f5=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','emit'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x64f5,0x17e));var _0x564f=function(_0x5c9d73,_0x1188d1){_0x5c9d73=_0x5c9d73-0x0;var _0x206419=_0x64f5[_0x5c9d73];return _0x206419;};'use strict';var UserVoiceQueueRtEvents=require(_0x564f('0x0'));var events=['save','remove','update'];function createListener(_0x39903b,_0x493091){return function(_0x2e7142){_0x493091[_0x564f('0x1')](_0x39903b,_0x2e7142);};}function removeListener(_0x59c424,_0x2607d6){return function(){UserVoiceQueueRtEvents[_0x564f('0x2')](_0x59c424,_0x2607d6);};}exports[_0x564f('0x3')]=function(_0x72b009){for(var _0x4bbedf=0x0,_0x4d3dae=events[_0x564f('0x4')];_0x4bbedf<_0x4d3dae;_0x4bbedf++){var _0x28db5a=events[_0x4bbedf];var _0x275bd6=createListener(_0x564f('0x5')+_0x28db5a,_0x72b009);UserVoiceQueueRtEvents['on'](_0x28db5a,_0x275bd6);}};
\ No newline at end of file
index 5846a91..65e34ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xe97d1,_0x1e3c71){var _0x6b77e6=function(_0x9ca714){while(--_0x9ca714){_0xe97d1['push'](_0xe97d1['shift']());}};_0x6b77e6(++_0x1e3c71);}(_0xe706,0xa3));var _0x6e70=function(_0x431c26,_0x4b8f47){_0x431c26=_0x431c26-0x0;var _0x3092fd=_0xe706[_0x431c26];return _0x3092fd;};'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'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x129b6b,_0x4faf08){var _0x24d8df=function(_0x6e758b){while(--_0x6e758b){_0x129b6b['push'](_0x129b6b['shift']());}};_0x24d8df(++_0x4faf08);}(_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'));module['exports']=router;
\ No newline at end of file
index d5f1a63..1db305d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3713=['sequelize','exports'];(function(_0x1ea4b8,_0x137f4b){var _0x1e30df=function(_0x38ca45){while(--_0x38ca45){_0x1ea4b8['push'](_0x1ea4b8['shift']());}};_0x1e30df(++_0x137f4b);}(_0x3713,0x192));var _0x3371=function(_0x21a4ca,_0x4ddb42){_0x21a4ca=_0x21a4ca-0x0;var _0x2fa129=_0x3713[_0x21a4ca];return _0x2fa129;};'use strict';var Sequelize=require(_0x3371('0x0'));module[_0x3371('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf603=['sequelize','exports'];(function(_0x2f3b5b,_0xc4a3fc){var _0x1ca75d=function(_0x1235ec){while(--_0x1235ec){_0x2f3b5b['push'](_0x2f3b5b['shift']());}};_0x1ca75d(++_0xc4a3fc);}(_0xf603,0x124));var _0x3f60=function(_0x2628bd,_0x5f1da4){_0x2628bd=_0x2628bd-0x0;var _0x362e5b=_0xf603[_0x2628bd];return _0x362e5b;};'use strict';var Sequelize=require(_0x3f60('0x0'));module[_0x3f60('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 2970451..aed0371 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb65=['api','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','util','../../config/logger'];(function(_0x38ae89,_0x3cc519){var _0x347ddd=function(_0x2d57ca){while(--_0x2d57ca){_0x38ae89['push'](_0x38ae89['shift']());}};_0x347ddd(++_0x3cc519);}(_0xbb65,0x1ca));var _0x5bb6=function(_0x181158,_0x103991){_0x181158=_0x181158-0x0;var _0x48457f=_0xbb65[_0x181158];return _0x48457f;};'use strict';var _=require('lodash');var util=require(_0x5bb6('0x0'));var logger=require(_0x5bb6('0x1'))(_0x5bb6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5bb6('0x3'));var fs=require('fs');var path=require(_0x5bb6('0x4'));var rimraf=require(_0x5bb6('0x5'));var config=require(_0x5bb6('0x6'));var attributes=require(_0x5bb6('0x7'));module[_0x5bb6('0x8')]=function(_0x339cf8,_0x4ecf19){return _0x339cf8['define'](_0x5bb6('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb93=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue'];(function(_0x2c63f7,_0x49ec00){var _0xeeaa93=function(_0x3e26f0){while(--_0x3e26f0){_0x2c63f7['push'](_0x2c63f7['shift']());}};_0xeeaa93(++_0x49ec00);}(_0xdb93,0x9a));var _0x3db9=function(_0x35f3c9,_0x1aaafe){_0x35f3c9=_0x35f3c9-0x0;var _0x483f61=_0xdb93[_0x35f3c9];return _0x483f61;};'use strict';var _=require(_0x3db9('0x0'));var util=require(_0x3db9('0x1'));var logger=require(_0x3db9('0x2'))(_0x3db9('0x3'));var moment=require(_0x3db9('0x4'));var BPromise=require(_0x3db9('0x5'));var rp=require(_0x3db9('0x6'));var fs=require('fs');var path=require(_0x3db9('0x7'));var rimraf=require(_0x3db9('0x8'));var config=require(_0x3db9('0x9'));var attributes=require(_0x3db9('0xa'));module[_0x3db9('0xb')]=function(_0x104777,_0x866ecc){return _0x104777[_0x3db9('0xc')](_0x3db9('0xd'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bb9d9c0..ded78ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4af=['info','UserWhatsappQueue,\x20%s,\x20%s','debug','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request'];(function(_0x2126c7,_0x5cd37f){var _0x2d91f4=function(_0x172922){while(--_0x172922){_0x2126c7['push'](_0x2126c7['shift']());}};_0x2d91f4(++_0x5cd37f);}(_0xd4af,0x14a));var _0xfd4a=function(_0xc45cc,_0x3656e6){_0xc45cc=_0xc45cc-0x0;var _0x41c979=_0xd4af[_0xc45cc];return _0x41c979;};'use strict';var _=require(_0xfd4a('0x0'));var util=require(_0xfd4a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd4a('0x2'));var fs=require('fs');var Redis=require(_0xfd4a('0x3'));var db=require(_0xfd4a('0x4'))['db'];var utils=require(_0xfd4a('0x5'));var logger=require(_0xfd4a('0x6'))(_0xfd4a('0x7'));var config=require('../../config/environment');var jayson=require(_0xfd4a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x106669,_0x41eced,_0x5db580){return new BPromise(function(_0x34344b,_0x2dbb12){return client[_0xfd4a('0x9')](_0x106669,_0x5db580)['then'](function(_0x31f5b5){logger[_0xfd4a('0xa')](_0xfd4a('0xb'),_0x41eced,'request\x20sent');logger[_0xfd4a('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x41eced,'request\x20sent',JSON[_0xfd4a('0xd')](_0x31f5b5));if(_0x31f5b5[_0xfd4a('0xe')]){if(_0x31f5b5['error']['code']===0x1f4){logger[_0xfd4a('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x41eced,_0x31f5b5['error'][_0xfd4a('0xf')]);return _0x2dbb12(_0x31f5b5[_0xfd4a('0xe')][_0xfd4a('0xf')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x41eced,_0x31f5b5[_0xfd4a('0xe')][_0xfd4a('0xf')]);return _0x34344b(_0x31f5b5[_0xfd4a('0xe')][_0xfd4a('0xf')]);}else{logger[_0xfd4a('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x41eced,'request\x20sent');_0x34344b(_0x31f5b5['result']['message']);}})[_0xfd4a('0x10')](function(_0x37d034){logger[_0xfd4a('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x41eced,_0x37d034);_0x2dbb12(_0x37d034);});});}
\ No newline at end of file
+var _0x73ef=['code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x47c63e,_0x2559de){var _0x3a4727=function(_0x48e07c){while(--_0x48e07c){_0x47c63e['push'](_0x47c63e['shift']());}};_0x3a4727(++_0x2559de);}(_0x73ef,0xd6));var _0xf73e=function(_0x19b3fd,_0xad68c7){_0x19b3fd=_0x19b3fd-0x0;var _0x442af1=_0x73ef[_0x19b3fd];return _0x442af1;};'use strict';var _=require(_0xf73e('0x0'));var util=require(_0xf73e('0x1'));var moment=require(_0xf73e('0x2'));var BPromise=require(_0xf73e('0x3'));var rs=require(_0xf73e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf73e('0x5'))['db'];var utils=require(_0xf73e('0x6'));var logger=require(_0xf73e('0x7'))(_0xf73e('0x8'));var config=require(_0xf73e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf73e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38f84c,_0x4c949a,_0x8661f7){return new BPromise(function(_0x2ac2df,_0x4bf65e){return client['request'](_0x38f84c,_0x8661f7)['then'](function(_0x1c1bc5){logger[_0xf73e('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4c949a,'request\x20sent');logger[_0xf73e('0xc')](_0xf73e('0xd'),_0x4c949a,_0xf73e('0xe'),JSON[_0xf73e('0xf')](_0x1c1bc5));if(_0x1c1bc5[_0xf73e('0x10')]){if(_0x1c1bc5[_0xf73e('0x10')][_0xf73e('0x11')]===0x1f4){logger[_0xf73e('0x10')](_0xf73e('0x12'),_0x4c949a,_0x1c1bc5[_0xf73e('0x10')][_0xf73e('0x13')]);return _0x4bf65e(_0x1c1bc5['error']['message']);}logger[_0xf73e('0x10')](_0xf73e('0x12'),_0x4c949a,_0x1c1bc5[_0xf73e('0x10')][_0xf73e('0x13')]);return _0x2ac2df(_0x1c1bc5[_0xf73e('0x10')][_0xf73e('0x13')]);}else{logger[_0xf73e('0xb')](_0xf73e('0x12'),_0x4c949a,_0xf73e('0xe'));_0x2ac2df(_0x1c1bc5['result']['message']);}})[_0xf73e('0x14')](function(_0x5a9009){logger['error'](_0xf73e('0x12'),_0x4c949a,_0x5a9009);_0x4bf65e(_0x5a9009);});});}
\ No newline at end of file
index db71e94..ae43b5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['../../components/interaction/service','../../config/environment','index','/:id','show','create','put','update','delete','isAuthenticated','destroy','exports','multer','util','express','../../components/auth/service'];(function(_0x378681,_0x49310d){var _0xee1ad5=function(_0x2f8fc2){while(--_0x2f8fc2){_0x378681['push'](_0x378681['shift']());}};_0xee1ad5(++_0x49310d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x4b84[_0x46a38b];return _0x346e75;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./variable.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x44b8('0x9')]);router[_0x44b8('0xa')](_0x44b8('0x7'),auth['isAuthenticated'](),controller[_0x44b8('0xb')]);router[_0x44b8('0xc')](_0x44b8('0x7'),auth[_0x44b8('0xd')](),controller[_0x44b8('0xe')]);module[_0x44b8('0xf')]=router;
\ No newline at end of file
+var _0x861a=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x861a,0x194));var _0xa861=function(_0x3c2753,_0x1455c7){_0x3c2753=_0x3c2753-0x0;var _0x30e10a=_0x861a[_0x3c2753];return _0x30e10a;};'use strict';var multer=require(_0xa861('0x0'));var util=require('util');var path=require(_0xa861('0x1'));var timeout=require(_0xa861('0x2'));var express=require(_0xa861('0x3'));var router=express[_0xa861('0x4')]();var fs_extra=require(_0xa861('0x5'));var auth=require(_0xa861('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa861('0x7'));var controller=require(_0xa861('0x8'));router[_0xa861('0x9')]('/',auth[_0xa861('0xa')](),controller[_0xa861('0xb')]);router['get'](_0xa861('0xc'),auth[_0xa861('0xa')](),controller[_0xa861('0xd')]);router[_0xa861('0xe')]('/',auth[_0xa861('0xa')](),controller[_0xa861('0xf')]);router[_0xa861('0x10')](_0xa861('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa861('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa861('0x12')]);module[_0xa861('0x13')]=router;
\ No newline at end of file
index 7c4b3d9..7cbe05e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb09=['STRING','sequelize'];(function(_0x4bd661,_0x41ce2b){var _0x47ed13=function(_0x1190c5){while(--_0x1190c5){_0x4bd661['push'](_0x4bd661['shift']());}};_0x47ed13(++_0x41ce2b);}(_0xfb09,0x19d));var _0x9fb0=function(_0x5388ce,_0x136200){_0x5388ce=_0x5388ce-0x0;var _0x14162d=_0xfb09[_0x5388ce];return _0x14162d;};'use strict';var Sequelize=require(_0x9fb0('0x0'));module['exports']={'name':{'type':Sequelize[_0x9fb0('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x362f=['exports','STRING'];(function(_0x180db0,_0x5e804b){var _0x4c4450=function(_0x334d53){while(--_0x334d53){_0x180db0['push'](_0x180db0['shift']());}};_0x4c4450(++_0x5e804b);}(_0x362f,0x1c0));var _0xf362=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x362f[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require('sequelize');module[_0xf362('0x0')]={'name':{'type':Sequelize[_0xf362('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf362('0x1')]}};
\ No newline at end of file
index 2ba616a..56984a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d6a=['fast-json-patch','request-promise','bluebird','mustache','util','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','name','send','map','Variable','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Variables','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d6a,0xa8));var _0xa2d6=function(_0x2ac224,_0x9b1583){_0x2ac224=_0x2ac224-0x0;var _0x240468=_0x2d6a[_0x2ac224];return _0x240468;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2d6('0x0'));var zipdir=require(_0xa2d6('0x1'));var jsonpatch=require(_0xa2d6('0x2'));var rp=require(_0xa2d6('0x3'));var moment=require('moment');var BPromise=require(_0xa2d6('0x4'));var Mustache=require(_0xa2d6('0x5'));var util=require(_0xa2d6('0x6'));var path=require('path');var sox=require(_0xa2d6('0x7'));var csv=require(_0xa2d6('0x8'));var ejs=require(_0xa2d6('0x9'));var fs=require('fs');var fs_extra=require(_0xa2d6('0xa'));var _=require(_0xa2d6('0xb'));var squel=require(_0xa2d6('0xc'));var crypto=require(_0xa2d6('0xd'));var jsforce=require(_0xa2d6('0xe'));var deskjs=require(_0xa2d6('0xf'));var toCsv=require(_0xa2d6('0x8'));var querystring=require(_0xa2d6('0x10'));var Papa=require(_0xa2d6('0x11'));var Redis=require('ioredis');var authService=require(_0xa2d6('0x12'));var qs=require(_0xa2d6('0x13'));var as=require(_0xa2d6('0x14'));var hardwareService=require(_0xa2d6('0x15'));var logger=require(_0xa2d6('0x16'))(_0xa2d6('0x17'));var utils=require('../../config/utils');var config=require(_0xa2d6('0x18'));var licenseUtil=require(_0xa2d6('0x19'));var db=require(_0xa2d6('0x1a'))['db'];function respondWithStatusCode(_0x3891e8,_0x4e3a2b){_0x4e3a2b=_0x4e3a2b||0xcc;return function(_0x318d51){if(_0x318d51){return _0x3891e8[_0xa2d6('0x1b')](_0x4e3a2b);}return _0x3891e8['status'](_0x4e3a2b)['end']();};}function respondWithResult(_0x21a1d3,_0x50777e){_0x50777e=_0x50777e||0xc8;return function(_0x4c9f90){if(_0x4c9f90){return _0x21a1d3[_0xa2d6('0x1c')](_0x50777e)[_0xa2d6('0x1d')](_0x4c9f90);}};}function respondWithFilteredResult(_0x541ef1,_0x3d2d81){return function(_0x464a80){if(_0x464a80){var _0x177ce6=typeof _0x3d2d81[_0xa2d6('0x1e')]===_0xa2d6('0x1f')&&typeof _0x3d2d81[_0xa2d6('0x20')]===_0xa2d6('0x1f');var _0x436cae=_0x464a80[_0xa2d6('0x21')];var _0x18c28d=_0x177ce6?0x0:_0x3d2d81[_0xa2d6('0x1e')];var _0x6cb95=_0x177ce6?_0x464a80[_0xa2d6('0x21')]:_0x3d2d81['offset']+_0x3d2d81[_0xa2d6('0x20')];var _0x32c225;if(_0x6cb95>=_0x436cae){_0x6cb95=_0x436cae;_0x32c225=0xc8;}else{_0x32c225=0xce;}_0x541ef1[_0xa2d6('0x1c')](_0x32c225);return _0x541ef1[_0xa2d6('0x22')](_0xa2d6('0x23'),_0x18c28d+'-'+_0x6cb95+'/'+_0x436cae)['json'](_0x464a80);}return null;};}function patchUpdates(_0xc62781){return function(_0x4b2fcb){try{jsonpatch['apply'](_0x4b2fcb,_0xc62781,!![]);}catch(_0x434da6){return BPromise[_0xa2d6('0x24')](_0x434da6);}return _0x4b2fcb[_0xa2d6('0x25')]();};}function saveUpdates(_0xf9b0cf,_0x5660a1){return function(_0x2a6803){if(_0x2a6803){return _0x2a6803['update'](_0xf9b0cf)[_0xa2d6('0x26')](function(_0x2d13ca){return _0x2d13ca;});}return null;};}function removeEntity(_0x2c4ee7,_0x35e9d8){return function(_0x30062f){if(_0x30062f){return _0x30062f[_0xa2d6('0x27')]()[_0xa2d6('0x26')](function(){var _0x25d52c=_0x30062f['get']({'plain':!![]});var _0x307de8='Variables';return db['UserProfileResource'][_0xa2d6('0x27')]({'where':{'type':_0x307de8,'resourceId':_0x25d52c['id']}})[_0xa2d6('0x26')](function(){return _0x30062f;});})[_0xa2d6('0x26')](function(){_0x2c4ee7[_0xa2d6('0x1c')](0xcc)[_0xa2d6('0x28')]();});}};}function handleEntityNotFound(_0x4ffbf6,_0x20682a){return function(_0x59bfea){if(!_0x59bfea){_0x4ffbf6[_0xa2d6('0x1b')](0x194);}return _0x59bfea;};}function handleError(_0x2edca3,_0x251614){_0x251614=_0x251614||0x1f4;return function(_0x6e3824){logger[_0xa2d6('0x29')](_0x6e3824['stack']);if(_0x6e3824[_0xa2d6('0x2a')]){delete _0x6e3824[_0xa2d6('0x2a')];}_0x2edca3[_0xa2d6('0x1c')](_0x251614)[_0xa2d6('0x2b')](_0x6e3824);};}exports['index']=function(_0x222c61,_0xddcfae){var _0x51d4a3={},_0x5d289a={},_0x56749c={'count':0x0,'rows':[]};var _0x319ae0=_[_0xa2d6('0x2c')](db[_0xa2d6('0x2d')][_0xa2d6('0x2e')],function(_0x12d633){return{'name':_0x12d633[_0xa2d6('0x2f')],'type':_0x12d633[_0xa2d6('0x30')][_0xa2d6('0x31')]};});_0x5d289a[_0xa2d6('0x32')]=_[_0xa2d6('0x2c')](_0x319ae0,'name');_0x5d289a['query']=_[_0xa2d6('0x33')](_0x222c61[_0xa2d6('0x34')]);_0x5d289a[_0xa2d6('0x35')]=_[_0xa2d6('0x36')](_0x5d289a[_0xa2d6('0x32')],_0x5d289a[_0xa2d6('0x34')]);_0x51d4a3[_0xa2d6('0x37')]=_[_0xa2d6('0x36')](_0x5d289a[_0xa2d6('0x32')],qs[_0xa2d6('0x38')](_0x222c61['query'][_0xa2d6('0x38')]));_0x51d4a3[_0xa2d6('0x37')]=_0x51d4a3[_0xa2d6('0x37')][_0xa2d6('0x39')]?_0x51d4a3[_0xa2d6('0x37')]:_0x5d289a[_0xa2d6('0x32')];if(!_0x222c61[_0xa2d6('0x34')][_0xa2d6('0x3a')](_0xa2d6('0x3b'))){_0x51d4a3[_0xa2d6('0x20')]=qs[_0xa2d6('0x20')](_0x222c61[_0xa2d6('0x34')][_0xa2d6('0x20')]);_0x51d4a3[_0xa2d6('0x1e')]=qs[_0xa2d6('0x1e')](_0x222c61[_0xa2d6('0x34')]['offset']);}_0x51d4a3[_0xa2d6('0x3c')]=qs[_0xa2d6('0x3d')](_0x222c61[_0xa2d6('0x34')][_0xa2d6('0x3d')]);_0x51d4a3[_0xa2d6('0x3e')]=qs[_0xa2d6('0x35')](_[_0xa2d6('0x3f')](_0x222c61[_0xa2d6('0x34')],_0x5d289a[_0xa2d6('0x35')]),_0x319ae0);if(_0x222c61['query'][_0xa2d6('0x40')]){_0x51d4a3[_0xa2d6('0x3e')]=_['merge'](_0x51d4a3[_0xa2d6('0x3e')],{'$or':_[_0xa2d6('0x2c')](_0x319ae0,function(_0x2c465c){if(_0x2c465c[_0xa2d6('0x30')]!==_0xa2d6('0x41')){var _0x1d8a31={};_0x1d8a31[_0x2c465c['name']]={'$like':'%'+_0x222c61[_0xa2d6('0x34')][_0xa2d6('0x40')]+'%'};return _0x1d8a31;}})});}_0x51d4a3=_[_0xa2d6('0x42')]({},_0x51d4a3,_0x222c61[_0xa2d6('0x43')]);var _0xdd0b75={'where':_0x51d4a3[_0xa2d6('0x3e')]};return db[_0xa2d6('0x2d')][_0xa2d6('0x21')](_0xdd0b75)[_0xa2d6('0x26')](function(_0x291370){_0x56749c[_0xa2d6('0x21')]=_0x291370;if(_0x222c61[_0xa2d6('0x34')][_0xa2d6('0x44')]){_0x51d4a3[_0xa2d6('0x45')]=[{'all':!![]}];}return db[_0xa2d6('0x2d')][_0xa2d6('0x46')](_0x51d4a3);})[_0xa2d6('0x26')](function(_0x1734ab){_0x56749c[_0xa2d6('0x47')]=_0x1734ab;return _0x56749c;})['then'](respondWithFilteredResult(_0xddcfae,_0x51d4a3))[_0xa2d6('0x48')](handleError(_0xddcfae,null));};exports['show']=function(_0x6e7d0d,_0x1e3f5b){var _0x29286d={'raw':!![],'where':{'id':_0x6e7d0d[_0xa2d6('0x49')]['id']}},_0x47b049={};_0x47b049[_0xa2d6('0x32')]=_['keys'](db[_0xa2d6('0x2d')][_0xa2d6('0x2e')]);_0x47b049[_0xa2d6('0x34')]=_[_0xa2d6('0x33')](_0x6e7d0d[_0xa2d6('0x34')]);_0x47b049[_0xa2d6('0x35')]=_[_0xa2d6('0x36')](_0x47b049[_0xa2d6('0x32')],_0x47b049[_0xa2d6('0x34')]);_0x29286d[_0xa2d6('0x37')]=_[_0xa2d6('0x36')](_0x47b049[_0xa2d6('0x32')],qs[_0xa2d6('0x38')](_0x6e7d0d[_0xa2d6('0x34')][_0xa2d6('0x38')]));_0x29286d[_0xa2d6('0x37')]=_0x29286d[_0xa2d6('0x37')][_0xa2d6('0x39')]?_0x29286d['attributes']:_0x47b049['model'];if(_0x6e7d0d[_0xa2d6('0x34')][_0xa2d6('0x44')]){_0x29286d[_0xa2d6('0x45')]=[{'all':!![]}];}_0x29286d=_[_0xa2d6('0x42')]({},_0x29286d,_0x6e7d0d[_0xa2d6('0x43')]);return db[_0xa2d6('0x2d')]['find'](_0x29286d)[_0xa2d6('0x26')](handleEntityNotFound(_0x1e3f5b,null))[_0xa2d6('0x26')](respondWithResult(_0x1e3f5b,null))[_0xa2d6('0x48')](handleError(_0x1e3f5b,null));};exports['create']=function(_0x17d471,_0x15a5bd){return db[_0xa2d6('0x2d')][_0xa2d6('0x4a')](_0x17d471[_0xa2d6('0x4b')],{})[_0xa2d6('0x26')](function(_0x168b23){var _0x17c0ee=_0x17d471[_0xa2d6('0x4c')]['get']({'plain':!![]});if(!_0x17c0ee)throw new Error(_0xa2d6('0x4d'));if(_0x17c0ee['role']===_0xa2d6('0x4c')){var _0xad53bd=_0x168b23[_0xa2d6('0x4e')]({'plain':!![]});var _0x433727=_0xa2d6('0x4f');return db[_0xa2d6('0x50')][_0xa2d6('0x51')]({'where':{'name':_0x433727,'userProfileId':_0x17c0ee['userProfileId']},'raw':!![]})[_0xa2d6('0x26')](function(_0x129572){if(_0x129572&&_0x129572['autoAssociation']===0x0){return db[_0xa2d6('0x52')][_0xa2d6('0x4a')]({'name':_0xad53bd[_0xa2d6('0x2a')],'resourceId':_0xad53bd['id'],'type':_0x129572[_0xa2d6('0x2a')],'sectionId':_0x129572['id']},{})[_0xa2d6('0x26')](function(){return _0x168b23;});}else{return _0x168b23;}})['catch'](function(_0xbe6ce7){logger[_0xa2d6('0x29')](_0xa2d6('0x53'),_0xbe6ce7);throw _0xbe6ce7;});}return _0x168b23;})[_0xa2d6('0x26')](respondWithResult(_0x15a5bd,0xc9))[_0xa2d6('0x48')](handleError(_0x15a5bd,null));};exports[_0xa2d6('0x54')]=function(_0xe2fdb3,_0x285300){if(_0xe2fdb3[_0xa2d6('0x4b')]['id']){delete _0xe2fdb3[_0xa2d6('0x4b')]['id'];}return db['Variable'][_0xa2d6('0x51')]({'where':{'id':_0xe2fdb3[_0xa2d6('0x49')]['id']}})[_0xa2d6('0x26')](handleEntityNotFound(_0x285300,null))['then'](saveUpdates(_0xe2fdb3[_0xa2d6('0x4b')],null))[_0xa2d6('0x26')](respondWithResult(_0x285300,null))[_0xa2d6('0x48')](handleError(_0x285300,null));};exports[_0xa2d6('0x27')]=function(_0x80dcfc,_0x5dc1ef){return db[_0xa2d6('0x2d')][_0xa2d6('0x51')]({'where':{'id':_0x80dcfc['params']['id']}})[_0xa2d6('0x26')](handleEntityNotFound(_0x5dc1ef,null))[_0xa2d6('0x26')](removeEntity(_0x5dc1ef,null))[_0xa2d6('0x48')](handleError(_0x5dc1ef,null));};
\ No newline at end of file
+var _0x2cb6=['includeAll','include','findAll','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options'];(function(_0x8623f7,_0x3ba628){var _0xb64036=function(_0x995f9f){while(--_0x995f9f){_0x8623f7['push'](_0x8623f7['shift']());}};_0xb64036(++_0x3ba628);}(_0x2cb6,0x116));var _0x62cb=function(_0x18047d,_0x374bf1){_0x18047d=_0x18047d-0x0;var _0x3ca81c=_0x2cb6[_0x18047d];return _0x3ca81c;};'use strict';var emlformat=require(_0x62cb('0x0'));var rimraf=require(_0x62cb('0x1'));var zipdir=require(_0x62cb('0x2'));var jsonpatch=require(_0x62cb('0x3'));var rp=require('request-promise');var moment=require(_0x62cb('0x4'));var BPromise=require(_0x62cb('0x5'));var Mustache=require(_0x62cb('0x6'));var util=require(_0x62cb('0x7'));var path=require(_0x62cb('0x8'));var sox=require(_0x62cb('0x9'));var csv=require(_0x62cb('0xa'));var ejs=require(_0x62cb('0xb'));var fs=require('fs');var fs_extra=require(_0x62cb('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x62cb('0xd'));var jsforce=require(_0x62cb('0xe'));var deskjs=require(_0x62cb('0xf'));var toCsv=require(_0x62cb('0xa'));var querystring=require(_0x62cb('0x10'));var Papa=require('papaparse');var Redis=require(_0x62cb('0x11'));var authService=require(_0x62cb('0x12'));var qs=require(_0x62cb('0x13'));var as=require(_0x62cb('0x14'));var hardwareService=require(_0x62cb('0x15'));var logger=require('../../config/logger')(_0x62cb('0x16'));var utils=require(_0x62cb('0x17'));var config=require(_0x62cb('0x18'));var licenseUtil=require(_0x62cb('0x19'));var db=require(_0x62cb('0x1a'))['db'];function respondWithStatusCode(_0x2c4cb9,_0x100da4){_0x100da4=_0x100da4||0xcc;return function(_0x1dded5){if(_0x1dded5){return _0x2c4cb9[_0x62cb('0x1b')](_0x100da4);}return _0x2c4cb9['status'](_0x100da4)['end']();};}function respondWithResult(_0x51d887,_0x33c035){_0x33c035=_0x33c035||0xc8;return function(_0x501f0c){if(_0x501f0c){return _0x51d887[_0x62cb('0x1c')](_0x33c035)['json'](_0x501f0c);}};}function respondWithFilteredResult(_0x215727,_0x25e004){return function(_0x1fe0ca){if(_0x1fe0ca){var _0x2a7e6c=typeof _0x25e004[_0x62cb('0x1d')]===_0x62cb('0x1e')&&typeof _0x25e004[_0x62cb('0x1f')]==='undefined';var _0x12e198=_0x1fe0ca[_0x62cb('0x20')];var _0x3c705f=_0x2a7e6c?0x0:_0x25e004['offset'];var _0x59581b=_0x2a7e6c?_0x1fe0ca['count']:_0x25e004[_0x62cb('0x1d')]+_0x25e004['limit'];var _0x29c773;if(_0x59581b>=_0x12e198){_0x59581b=_0x12e198;_0x29c773=0xc8;}else{_0x29c773=0xce;}_0x215727[_0x62cb('0x1c')](_0x29c773);return _0x215727[_0x62cb('0x21')]('Content-Range',_0x3c705f+'-'+_0x59581b+'/'+_0x12e198)[_0x62cb('0x22')](_0x1fe0ca);}return null;};}function patchUpdates(_0x49289e){return function(_0x1110a7){try{jsonpatch[_0x62cb('0x23')](_0x1110a7,_0x49289e,!![]);}catch(_0x10c7de){return BPromise[_0x62cb('0x24')](_0x10c7de);}return _0x1110a7[_0x62cb('0x25')]();};}function saveUpdates(_0x5e1947,_0x5a8740){return function(_0x21dbc6){if(_0x21dbc6){return _0x21dbc6[_0x62cb('0x26')](_0x5e1947)[_0x62cb('0x27')](function(_0x7631c6){return _0x7631c6;});}return null;};}function removeEntity(_0xc1a827,_0x1118d7){return function(_0x213c2f){if(_0x213c2f){return _0x213c2f[_0x62cb('0x28')]()[_0x62cb('0x27')](function(){var _0xd7e025=_0x213c2f[_0x62cb('0x29')]({'plain':!![]});var _0x27b314='Variables';return db[_0x62cb('0x2a')][_0x62cb('0x28')]({'where':{'type':_0x27b314,'resourceId':_0xd7e025['id']}})[_0x62cb('0x27')](function(){return _0x213c2f;});})['then'](function(){_0xc1a827[_0x62cb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fca61,_0xd90166){return function(_0x1afde7){if(!_0x1afde7){_0x4fca61[_0x62cb('0x1b')](0x194);}return _0x1afde7;};}function handleError(_0x22b835,_0x5c1f99){_0x5c1f99=_0x5c1f99||0x1f4;return function(_0x22efa3){logger[_0x62cb('0x2b')](_0x22efa3[_0x62cb('0x2c')]);if(_0x22efa3[_0x62cb('0x2d')]){delete _0x22efa3[_0x62cb('0x2d')];}_0x22b835[_0x62cb('0x1c')](_0x5c1f99)[_0x62cb('0x2e')](_0x22efa3);};}exports[_0x62cb('0x2f')]=function(_0x1b1972,_0x13d3d9){var _0x1c5878={},_0x55a648={},_0x2298cc={'count':0x0,'rows':[]};var _0x4859bd=_[_0x62cb('0x30')](db[_0x62cb('0x31')][_0x62cb('0x32')],function(_0x4df58a){return{'name':_0x4df58a[_0x62cb('0x33')],'type':_0x4df58a[_0x62cb('0x34')][_0x62cb('0x35')]};});_0x55a648[_0x62cb('0x36')]=_['map'](_0x4859bd,_0x62cb('0x2d'));_0x55a648['query']=_[_0x62cb('0x37')](_0x1b1972[_0x62cb('0x38')]);_0x55a648[_0x62cb('0x39')]=_[_0x62cb('0x3a')](_0x55a648[_0x62cb('0x36')],_0x55a648['query']);_0x1c5878[_0x62cb('0x3b')]=_[_0x62cb('0x3a')](_0x55a648['model'],qs[_0x62cb('0x3c')](_0x1b1972[_0x62cb('0x38')][_0x62cb('0x3c')]));_0x1c5878[_0x62cb('0x3b')]=_0x1c5878[_0x62cb('0x3b')]['length']?_0x1c5878[_0x62cb('0x3b')]:_0x55a648[_0x62cb('0x36')];if(!_0x1b1972[_0x62cb('0x38')][_0x62cb('0x3d')](_0x62cb('0x3e'))){_0x1c5878['limit']=qs[_0x62cb('0x1f')](_0x1b1972[_0x62cb('0x38')][_0x62cb('0x1f')]);_0x1c5878['offset']=qs['offset'](_0x1b1972['query'][_0x62cb('0x1d')]);}_0x1c5878[_0x62cb('0x3f')]=qs['sort'](_0x1b1972[_0x62cb('0x38')]['sort']);_0x1c5878[_0x62cb('0x40')]=qs[_0x62cb('0x39')](_[_0x62cb('0x41')](_0x1b1972[_0x62cb('0x38')],_0x55a648[_0x62cb('0x39')]),_0x4859bd);if(_0x1b1972[_0x62cb('0x38')][_0x62cb('0x42')]){_0x1c5878[_0x62cb('0x40')]=_[_0x62cb('0x43')](_0x1c5878[_0x62cb('0x40')],{'$or':_[_0x62cb('0x30')](_0x4859bd,function(_0x36e202){if(_0x36e202[_0x62cb('0x34')]!==_0x62cb('0x44')){var _0x4b03c3={};_0x4b03c3[_0x36e202[_0x62cb('0x2d')]]={'$like':'%'+_0x1b1972[_0x62cb('0x38')]['filter']+'%'};return _0x4b03c3;}})});}_0x1c5878=_[_0x62cb('0x43')]({},_0x1c5878,_0x1b1972[_0x62cb('0x45')]);var _0xb561f0={'where':_0x1c5878['where']};return db['Variable'][_0x62cb('0x20')](_0xb561f0)[_0x62cb('0x27')](function(_0x5d0053){_0x2298cc[_0x62cb('0x20')]=_0x5d0053;if(_0x1b1972[_0x62cb('0x38')][_0x62cb('0x46')]){_0x1c5878[_0x62cb('0x47')]=[{'all':!![]}];}return db['Variable'][_0x62cb('0x48')](_0x1c5878);})['then'](function(_0x27aab6){_0x2298cc['rows']=_0x27aab6;return _0x2298cc;})[_0x62cb('0x27')](respondWithFilteredResult(_0x13d3d9,_0x1c5878))[_0x62cb('0x49')](handleError(_0x13d3d9,null));};exports[_0x62cb('0x4a')]=function(_0xd40c44,_0x50be6e){var _0x4b9058={'raw':!![],'where':{'id':_0xd40c44['params']['id']}},_0x5f1d5a={};_0x5f1d5a[_0x62cb('0x36')]=_[_0x62cb('0x37')](db['Variable'][_0x62cb('0x32')]);_0x5f1d5a[_0x62cb('0x38')]=_[_0x62cb('0x37')](_0xd40c44[_0x62cb('0x38')]);_0x5f1d5a[_0x62cb('0x39')]=_[_0x62cb('0x3a')](_0x5f1d5a[_0x62cb('0x36')],_0x5f1d5a[_0x62cb('0x38')]);_0x4b9058[_0x62cb('0x3b')]=_[_0x62cb('0x3a')](_0x5f1d5a[_0x62cb('0x36')],qs[_0x62cb('0x3c')](_0xd40c44[_0x62cb('0x38')][_0x62cb('0x3c')]));_0x4b9058[_0x62cb('0x3b')]=_0x4b9058[_0x62cb('0x3b')][_0x62cb('0x4b')]?_0x4b9058[_0x62cb('0x3b')]:_0x5f1d5a['model'];if(_0xd40c44['query'][_0x62cb('0x46')]){_0x4b9058[_0x62cb('0x47')]=[{'all':!![]}];}_0x4b9058=_[_0x62cb('0x43')]({},_0x4b9058,_0xd40c44[_0x62cb('0x45')]);return db[_0x62cb('0x31')]['find'](_0x4b9058)[_0x62cb('0x27')](handleEntityNotFound(_0x50be6e,null))[_0x62cb('0x27')](respondWithResult(_0x50be6e,null))[_0x62cb('0x49')](handleError(_0x50be6e,null));};exports[_0x62cb('0x4c')]=function(_0x4e1fec,_0x48f698){return db[_0x62cb('0x31')][_0x62cb('0x4c')](_0x4e1fec[_0x62cb('0x4d')],{})[_0x62cb('0x27')](function(_0x574b82){var _0x3ca401=_0x4e1fec[_0x62cb('0x4e')][_0x62cb('0x29')]({'plain':!![]});if(!_0x3ca401)throw new Error(_0x62cb('0x4f'));if(_0x3ca401[_0x62cb('0x50')]===_0x62cb('0x4e')){var _0x4aa7bc=_0x574b82[_0x62cb('0x29')]({'plain':!![]});var _0x2c68fa=_0x62cb('0x51');return db[_0x62cb('0x52')]['find']({'where':{'name':_0x2c68fa,'userProfileId':_0x3ca401[_0x62cb('0x53')]},'raw':!![]})[_0x62cb('0x27')](function(_0x2e7a39){if(_0x2e7a39&&_0x2e7a39['autoAssociation']===0x0){return db['UserProfileResource'][_0x62cb('0x4c')]({'name':_0x4aa7bc['name'],'resourceId':_0x4aa7bc['id'],'type':_0x2e7a39[_0x62cb('0x2d')],'sectionId':_0x2e7a39['id']},{})[_0x62cb('0x27')](function(){return _0x574b82;});}else{return _0x574b82;}})[_0x62cb('0x49')](function(_0x5a12a9){logger['error'](_0x62cb('0x54'),_0x5a12a9);throw _0x5a12a9;});}return _0x574b82;})[_0x62cb('0x27')](respondWithResult(_0x48f698,0xc9))['catch'](handleError(_0x48f698,null));};exports[_0x62cb('0x26')]=function(_0x59d1b7,_0x1267ed){if(_0x59d1b7[_0x62cb('0x4d')]['id']){delete _0x59d1b7[_0x62cb('0x4d')]['id'];}return db[_0x62cb('0x31')][_0x62cb('0x55')]({'where':{'id':_0x59d1b7[_0x62cb('0x56')]['id']}})[_0x62cb('0x27')](handleEntityNotFound(_0x1267ed,null))[_0x62cb('0x27')](saveUpdates(_0x59d1b7[_0x62cb('0x4d')],null))[_0x62cb('0x27')](respondWithResult(_0x1267ed,null))[_0x62cb('0x49')](handleError(_0x1267ed,null));};exports[_0x62cb('0x28')]=function(_0x284e3e,_0x533ae0){return db[_0x62cb('0x31')]['find']({'where':{'id':_0x284e3e['params']['id']}})['then'](handleEntityNotFound(_0x533ae0,null))[_0x62cb('0x27')](removeEntity(_0x533ae0,null))[_0x62cb('0x49')](handleError(_0x533ae0,null));};
\ No newline at end of file
index adaaf2e..914afd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9461=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','define','Variable','tools_variables'];(function(_0x3a3afe,_0x15da25){var _0x262dab=function(_0x364a7f){while(--_0x364a7f){_0x3a3afe['push'](_0x3a3afe['shift']());}};_0x262dab(++_0x15da25);}(_0x9461,0x1ea));var _0x1946=function(_0x1c2877,_0x1b65c0){_0x1c2877=_0x1c2877-0x0;var _0x46b2c6=_0x9461[_0x1c2877];return _0x46b2c6;};'use strict';var _=require(_0x1946('0x0'));var util=require(_0x1946('0x1'));var logger=require(_0x1946('0x2'))(_0x1946('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1946('0x4'));var rimraf=require(_0x1946('0x5'));var config=require(_0x1946('0x6'));var attributes=require('./variable.attributes');module['exports']=function(_0x5e1fcd,_0x43bd82){return _0x5e1fcd[_0x1946('0x7')](_0x1946('0x8'),attributes,{'tableName':_0x1946('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xece8=['tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0xece8,0x16c));var _0x8ece=function(_0x27052c,_0x3774e1){_0x27052c=_0x27052c-0x0;var _0x4cecc1=_0xece8[_0x27052c];return _0x4cecc1;};'use strict';var _=require(_0x8ece('0x0'));var util=require(_0x8ece('0x1'));var logger=require(_0x8ece('0x2'))(_0x8ece('0x3'));var moment=require(_0x8ece('0x4'));var BPromise=require(_0x8ece('0x5'));var rp=require(_0x8ece('0x6'));var fs=require('fs');var path=require(_0x8ece('0x7'));var rimraf=require('rimraf');var config=require(_0x8ece('0x8'));var attributes=require('./variable.attributes');module['exports']=function(_0x24d5ef,_0x1cd83e){return _0x24d5ef[_0x8ece('0x9')]('Variable',attributes,{'tableName':_0x8ece('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f18cf3..71f6c05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x27e321,_0x222eb5){var _0x19ac6c=function(_0x4cb61a){while(--_0x4cb61a){_0x27e321['push'](_0x27e321['shift']());}};_0x19ac6c(++_0x222eb5);}(_0x6aa7,0x178));var _0x76aa=function(_0x1a9ee0,_0x53ad18){_0x1a9ee0=_0x1a9ee0-0x0;var _0x58fe1f=_0x6aa7[_0x1a9ee0];return _0x58fe1f;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});};
\ No newline at end of file
+var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x52d4ad,_0x25e611){var _0x34a767=function(_0x1f3daa){while(--_0x1f3daa){_0x52d4ad['push'](_0x52d4ad['shift']());}};_0x34a767(++_0x25e611);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5b7643,_0x244068){_0x5b7643=_0x5b7643-0x0;var _0x1f7b97=_0x1cb9[_0x5b7643];return _0x1f7b97;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});};
\ No newline at end of file
index 9970803..768d946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3900=['/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch','/reset','isAuthenticated','/pull','pull','/restart','restart'];(function(_0x43c3f9,_0x1861cb){var _0x4f4f54=function(_0x53ac81){while(--_0x53ac81){_0x43c3f9['push'](_0x43c3f9['shift']());}};_0x4f4f54(++_0x1861cb);}(_0x3900,0x1df));var _0x0390=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x3900[_0x30c649];return _0x3edfb9;};'use strict';var express=require('express');var router=express[_0x0390('0x0')]();var auth=require(_0x0390('0x1'));var controller=require(_0x0390('0x2'));router[_0x0390('0x3')]('/',controller[_0x0390('0x4')]);router[_0x0390('0x3')](_0x0390('0x5'),auth['isAuthenticated'](),auth[_0x0390('0x6')](),controller[_0x0390('0x7')]);router['get'](_0x0390('0x8'),auth[_0x0390('0x9')](),auth[_0x0390('0x6')](),controller['reset']);router[_0x0390('0x3')](_0x0390('0xa'),auth[_0x0390('0x9')](),auth[_0x0390('0x6')](),controller[_0x0390('0xb')]);router['get'](_0x0390('0xc'),auth[_0x0390('0x9')](),controller[_0x0390('0xd')]);router[_0x0390('0x3')](_0x0390('0xe'),controller[_0x0390('0xf')]);module[_0x0390('0x10')]=router;
\ No newline at end of file
+var _0x5ede=['/restart','restart','migrations','express','Router','../../components/auth/service','get','index','/fetch','canUpdate','fetch','isAuthenticated','reset','/pull'];(function(_0x11b63c,_0x3302a3){var _0x5c5c53=function(_0xdb96f3){while(--_0xdb96f3){_0x11b63c['push'](_0x11b63c['shift']());}};_0x5c5c53(++_0x3302a3);}(_0x5ede,0x73));var _0xe5ed=function(_0x4d21e3,_0x4abda9){_0x4d21e3=_0x4d21e3-0x0;var _0x4d2c5e=_0x5ede[_0x4d21e3];return _0x4d2c5e;};'use strict';var express=require(_0xe5ed('0x0'));var router=express[_0xe5ed('0x1')]();var auth=require(_0xe5ed('0x2'));var controller=require('./version.controller');router[_0xe5ed('0x3')]('/',controller[_0xe5ed('0x4')]);router['get'](_0xe5ed('0x5'),auth['isAuthenticated'](),auth[_0xe5ed('0x6')](),controller[_0xe5ed('0x7')]);router['get']('/reset',auth[_0xe5ed('0x8')](),auth['canUpdate'](),controller[_0xe5ed('0x9')]);router[_0xe5ed('0x3')](_0xe5ed('0xa'),auth[_0xe5ed('0x8')](),auth[_0xe5ed('0x6')](),controller['pull']);router[_0xe5ed('0x3')](_0xe5ed('0xb'),auth['isAuthenticated'](),controller[_0xe5ed('0xc')]);router[_0xe5ed('0x3')]('/migrations',controller[_0xe5ed('0xd')]);module['exports']=router;
\ No newline at end of file
index 24213fe..1319ccb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22e1=['fetch','tags','json','origin','error','status','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','.js','push','sequelize','Migration','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest'];(function(_0x423be0,_0xe9439b){var _0x2b55d7=function(_0x349a2d){while(--_0x349a2d){_0x423be0['push'](_0x423be0['shift']());}};_0x2b55d7(++_0xe9439b);}(_0x22e1,0x177));var _0x122e=function(_0x4f2840,_0x56204e){_0x4f2840=_0x4f2840-0x0;var _0x503ae8=_0x22e1[_0x4f2840];return _0x503ae8;};'use strict';var Umzug=require(_0x122e('0x0'));var path=require(_0x122e('0x1'));var fs=require('fs');var _=require(_0x122e('0x2'));var pkginfo=require(_0x122e('0x3'))(module,_0x122e('0x4'));var compareVersions=require(_0x122e('0x5'));var exec=require(_0x122e('0x6'))[_0x122e('0x7')];var db=require('../../mysqldb')['db'];var config=require(_0x122e('0x8'));var pm2=require(_0x122e('0x9'));var logger=require('../../config/logger')(_0x122e('0xa'));var git=require(_0x122e('0xb'))(config[_0x122e('0xc')]);exports[_0x122e('0xd')]=function(_0x347a59,_0x4ffa30){var _0x226c88={'current':module[_0x122e('0xe')]['version'],'phonebar':0x2};if(_0x347a59['query']&&_0x347a59[_0x122e('0xf')][_0x122e('0x10')]){return git[_0x122e('0x11')]()[_0x122e('0x12')](function(_0x595c21,_0x5d3378){_0x226c88[_0x122e('0x10')]=(_0x595c21?module[_0x122e('0xe')][_0x122e('0x4')]:_0x5d3378[_0x122e('0x10')])||'2.0.0';return _0x4ffa30['status'](0xc8)['json'](_0x226c88);});}else{return _0x4ffa30['status'](0xc8)[_0x122e('0x13')](_0x226c88);}};exports[_0x122e('0x11')]=function(_0x6c117d,_0x2f0a5a){return git[_0x122e('0x11')]([_0x122e('0x14'),'master'],function(_0x3d622b){if(_0x3d622b){logger[_0x122e('0x15')](_0x3d622b);return _0x2f0a5a[_0x122e('0x16')](0x1f4)[_0x122e('0x13')](_0x3d622b);}logger['info']('git\x20fetch');return _0x2f0a5a[_0x122e('0x16')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x5b2fa9,_0x2d63c1){return git['reset']([_0x122e('0x17'),_0x122e('0x18')],function(_0x33ed4e){if(_0x33ed4e){logger[_0x122e('0x15')](_0x33ed4e);return _0x2d63c1[_0x122e('0x16')](0x1f4)[_0x122e('0x13')](_0x33ed4e);}logger['info'](_0x122e('0x19'));return _0x2d63c1['status'](0xc8)[_0x122e('0x13')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x2fb188,_0x19f65c){exec(_0x122e('0x1a'),function(_0xdd9a80,_0xb99292,_0x1e4911){logger[_0x122e('0x1b')](_0xb99292);logger[_0x122e('0x1b')](_0x1e4911);if(_0xdd9a80){logger[_0x122e('0x15')](_0xdd9a80);return _0x19f65c[_0x122e('0x16')](0x1f4)[_0x122e('0x13')](_0xdd9a80);}return _0x19f65c[_0x122e('0x16')](0xc8)[_0x122e('0x13')]({'output':_0xb99292});});};exports[_0x122e('0x1c')]=function(_0x40c86f,_0xcf01f5){return pm2[_0x122e('0x1c')](_0x122e('0x1d'))[_0x122e('0x1e')](function(_0x3ec818){logger['info'](_0x122e('0x1f'),_0x3ec818);return _0xcf01f5[_0x122e('0x16')](0xc8)[_0x122e('0x13')]({'output':_0x122e('0x20')});})[_0x122e('0x21')](function(_0x58fab2){logger[_0x122e('0x15')](_0x58fab2);return _0xcf01f5[_0x122e('0x16')](0x1f4)['json'](_0x58fab2);});};exports[_0x122e('0x22')]=function(_0x5ddcab,_0x42548e){var _0x5c5448=fs[_0x122e('0x23')](path['join'](config[_0x122e('0xc')],_0x122e('0x24'),_0x122e('0x22')));var _0x5765ed=[];for(var _0x53934f=0x0;_0x53934f<_0x5c5448[_0x122e('0x25')];_0x53934f++){var _0x4d9ab0=_0x5c5448[_0x53934f]['replace'](_0x122e('0x26'),'');if(compareVersions(module['exports'][_0x122e('0x4')],_0x4d9ab0)===-0x1){_0x5765ed[_0x122e('0x27')](_0x4d9ab0);}}if(_0x5765ed[_0x122e('0x25')]){var _0x3b1d5a=_0x5765ed['sort'](compareVersions);var _0x161e2f=new Umzug({'storage':_0x122e('0x28'),'storageOptions':{'model':db[_0x122e('0x29')],'modelName':_0x122e('0x29'),'columnName':_0x122e('0x4')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0x122e('0x28')]['constructor'],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[_0x122e('0x2a')](config[_0x122e('0xc')],_0x122e('0x24'),'migrations'),'pattern':/\.js$/}});_0x161e2f['up']({'migrations':_[_0x122e('0x2b')](_0x3b1d5a,function(_0x332a7f){return _0x332a7f+_0x122e('0x26');})})[_0x122e('0x1e')](function(){return _0x42548e[_0x122e('0x16')](0xc8)[_0x122e('0x13')]({'output':_0x122e('0x2c')+module['exports'][_0x122e('0x4')]+_0x122e('0x2d')+_[_0x122e('0x2e')](_0x3b1d5a),'migrations':_[_0x122e('0x2a')](_0x3b1d5a)});})[_0x122e('0x21')](function(_0x3666a2){if(_0x3666a2 instanceof db[_0x122e('0x28')][_0x122e('0x2f')]){return _0x42548e['status'](0xc8)[_0x122e('0x13')]({'output':_0x122e('0x30')});}else{return _0x42548e[_0x122e('0x16')](0x1f4)[_0x122e('0x13')](_0x3666a2);}});}else{return _0x42548e[_0x122e('0x16')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
+var _0xb4bf=['latest','tags','2.0.0','status','json','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','info','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','replace','.js','push','sort','Migration','sequelize','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','index','exports','version','query'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xb4bf,0x91));var _0xfb4b=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb4bf[_0x5d4607];return _0x5e4a86;};'use strict';var Umzug=require('umzug');var path=require(_0xfb4b('0x0'));var fs=require('fs');var _=require(_0xfb4b('0x1'));var pkginfo=require(_0xfb4b('0x2'))(module,'version');var compareVersions=require(_0xfb4b('0x3'));var exec=require(_0xfb4b('0x4'))['exec'];var db=require(_0xfb4b('0x5'))['db'];var config=require(_0xfb4b('0x6'));var pm2=require('../../config/pm2');var logger=require(_0xfb4b('0x7'))('update');var git=require(_0xfb4b('0x8'))(config[_0xfb4b('0x9')]);exports[_0xfb4b('0xa')]=function(_0x117f9c,_0x1a3219){var _0x2ed167={'current':module[_0xfb4b('0xb')][_0xfb4b('0xc')],'phonebar':0x2};if(_0x117f9c['query']&&_0x117f9c[_0xfb4b('0xd')][_0xfb4b('0xe')]){return git['fetch']()[_0xfb4b('0xf')](function(_0x3a4eaf,_0x1690a0){_0x2ed167[_0xfb4b('0xe')]=(_0x3a4eaf?module[_0xfb4b('0xb')]['version']:_0x1690a0[_0xfb4b('0xe')])||_0xfb4b('0x10');return _0x1a3219[_0xfb4b('0x11')](0xc8)[_0xfb4b('0x12')](_0x2ed167);});}else{return _0x1a3219[_0xfb4b('0x11')](0xc8)[_0xfb4b('0x12')](_0x2ed167);}};exports['fetch']=function(_0x2fcb57,_0x3e77dd){return git['fetch']([_0xfb4b('0x13'),_0xfb4b('0x14')],function(_0x299468){if(_0x299468){logger['error'](_0x299468);return _0x3e77dd[_0xfb4b('0x11')](0x1f4)[_0xfb4b('0x12')](_0x299468);}logger['info'](_0xfb4b('0x15'));return _0x3e77dd['status'](0xc8)[_0xfb4b('0x12')]({'output':_0xfb4b('0x16')});});};exports[_0xfb4b('0x17')]=function(_0x302367,_0x346892){return git[_0xfb4b('0x17')]([_0xfb4b('0x18'),'FETCH_HEAD'],function(_0x458c1c){if(_0x458c1c){logger['error'](_0x458c1c);return _0x346892['status'](0x1f4)[_0xfb4b('0x12')](_0x458c1c);}logger['info'](_0xfb4b('0x19'));return _0x346892[_0xfb4b('0x11')](0xc8)[_0xfb4b('0x12')]({'output':_0xfb4b('0x1a')});});};exports['pull']=function(_0xb0bdbd,_0x400a28){exec(_0xfb4b('0x1b'),function(_0x4bde0e,_0x27cc10,_0x5e9b53){logger['info'](_0x27cc10);logger[_0xfb4b('0x1c')](_0x5e9b53);if(_0x4bde0e){logger[_0xfb4b('0x1d')](_0x4bde0e);return _0x400a28[_0xfb4b('0x11')](0x1f4)[_0xfb4b('0x12')](_0x4bde0e);}return _0x400a28[_0xfb4b('0x11')](0xc8)[_0xfb4b('0x12')]({'output':_0x27cc10});});};exports[_0xfb4b('0x1e')]=function(_0x578d31,_0x4a5342){return pm2[_0xfb4b('0x1e')](_0xfb4b('0x1f'))[_0xfb4b('0x20')](function(_0x4dbab5){logger[_0xfb4b('0x1c')](_0xfb4b('0x21'),_0x4dbab5);return _0x4a5342[_0xfb4b('0x11')](0xc8)[_0xfb4b('0x12')]({'output':_0xfb4b('0x22')});})[_0xfb4b('0x23')](function(_0xcadb7){logger[_0xfb4b('0x1d')](_0xcadb7);return _0x4a5342[_0xfb4b('0x11')](0x1f4)[_0xfb4b('0x12')](_0xcadb7);});};exports[_0xfb4b('0x24')]=function(_0x5dfa6e,_0x14a383){var _0x226350=fs[_0xfb4b('0x25')](path['join'](config[_0xfb4b('0x9')],_0xfb4b('0x26'),_0xfb4b('0x24')));var _0x54fcdd=[];for(var _0x5be213=0x0;_0x5be213<_0x226350[_0xfb4b('0x27')];_0x5be213++){var _0x1ca810=_0x226350[_0x5be213][_0xfb4b('0x28')](_0xfb4b('0x29'),'');if(compareVersions(module[_0xfb4b('0xb')]['version'],_0x1ca810)===-0x1){_0x54fcdd[_0xfb4b('0x2a')](_0x1ca810);}}if(_0x54fcdd[_0xfb4b('0x27')]){var _0x215f3f=_0x54fcdd[_0xfb4b('0x2b')](compareVersions);var _0x39b68b=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xfb4b('0x2c')],'modelName':_0xfb4b('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0xfb4b('0x2d')]['getQueryInterface'](),db[_0xfb4b('0x2d')][_0xfb4b('0x2e')],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['join'](config[_0xfb4b('0x9')],'server','migrations'),'pattern':/\.js$/}});_0x39b68b['up']({'migrations':_[_0xfb4b('0x2f')](_0x215f3f,function(_0x3d4d27){return _0x3d4d27+_0xfb4b('0x29');})})[_0xfb4b('0x20')](function(){return _0x14a383[_0xfb4b('0x11')](0xc8)[_0xfb4b('0x12')]({'output':_0xfb4b('0x30')+module[_0xfb4b('0xb')][_0xfb4b('0xc')]+_0xfb4b('0x31')+_[_0xfb4b('0x32')](_0x215f3f),'migrations':_['join'](_0x215f3f)});})['catch'](function(_0x47c05c){if(_0x47c05c instanceof db[_0xfb4b('0x2d')][_0xfb4b('0x33')]){return _0x14a383['status'](0xc8)[_0xfb4b('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x14a383[_0xfb4b('0x11')](0x1f4)[_0xfb4b('0x12')](_0x47c05c);}});}else{return _0x14a383[_0xfb4b('0x11')](0xc8)[_0xfb4b('0x12')]({'output':_0xfb4b('0x34')});}};
\ No newline at end of file
index 2dd1721..73eae3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fc0=['delete','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','/:id','show','post','create','put','update'];(function(_0x10d1bf,_0x3b6413){var _0x305c6e=function(_0xc3c60e){while(--_0xc3c60e){_0x10d1bf['push'](_0x10d1bf['shift']());}};_0x305c6e(++_0x3b6413);}(_0x2fc0,0x112));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x02fc('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x02fc('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x02fc('0x2'));var interaction=require(_0x02fc('0x3'));var config=require(_0x02fc('0x4'));var controller=require(_0x02fc('0x5'));router['get']('/',auth[_0x02fc('0x6')](),controller['index']);router[_0x02fc('0x7')]('/describe',auth[_0x02fc('0x6')](),controller['describe']);router['get'](_0x02fc('0x8'),auth[_0x02fc('0x6')](),controller[_0x02fc('0x9')]);router[_0x02fc('0xa')]('/',auth[_0x02fc('0x6')](),controller[_0x02fc('0xb')]);router[_0x02fc('0xc')](_0x02fc('0x8'),auth[_0x02fc('0x6')](),controller[_0x02fc('0xd')]);router[_0x02fc('0xe')](_0x02fc('0x8'),auth[_0x02fc('0x6')](),controller['destroy']);module[_0x02fc('0xf')]=router;
\ No newline at end of file
+var _0xf966=['get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x1b033d,_0x81dcee){var _0x184b5b=function(_0x45af34){while(--_0x45af34){_0x1b033d['push'](_0x1b033d['shift']());}};_0x184b5b(++_0x81dcee);}(_0xf966,0x199));var _0x6f96=function(_0x5fef9d,_0x200a76){_0x5fef9d=_0x5fef9d-0x0;var _0x37519d=_0xf966[_0x5fef9d];return _0x37519d;};'use strict';var multer=require(_0x6f96('0x0'));var util=require(_0x6f96('0x1'));var path=require(_0x6f96('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f96('0x3'));var router=express[_0x6f96('0x4')]();var fs_extra=require(_0x6f96('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6f96('0x6'));var config=require(_0x6f96('0x7'));var controller=require(_0x6f96('0x8'));router[_0x6f96('0x9')]('/',auth[_0x6f96('0xa')](),controller[_0x6f96('0xb')]);router[_0x6f96('0x9')](_0x6f96('0xc'),auth[_0x6f96('0xa')](),controller[_0x6f96('0xd')]);router[_0x6f96('0x9')](_0x6f96('0xe'),auth[_0x6f96('0xa')](),controller['show']);router[_0x6f96('0xf')]('/',auth[_0x6f96('0xa')](),controller['create']);router[_0x6f96('0x10')]('/:id',auth[_0x6f96('0xa')](),controller['update']);router[_0x6f96('0x11')](_0x6f96('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x6f96('0x12')]=router;
\ No newline at end of file
index 9cf1b5f..131a806 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30a=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'type':{'type':Sequelize[_0xaa30('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xaa30('0x2')]},'calleridname':{'type':Sequelize[_0xaa30('0x2')]},'queue':{'type':Sequelize[_0xaa30('0x2')]},'interface':{'type':Sequelize[_0xaa30('0x2')]},'membername':{'type':Sequelize[_0xaa30('0x2')]},'agentcalledAt':{'type':Sequelize[_0xaa30('0x3')]},'agentconnectAt':{'type':Sequelize[_0xaa30('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xaa30('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xaa30('0x4')]},'agentcomplete':{'type':Sequelize[_0xaa30('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xaa30('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xaa30('0x4')]},'agentacw':{'type':Sequelize[_0xaa30('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xaa30('0x4')]},'reason':{'type':Sequelize[_0xaa30('0x2')]},'lastevent':{'type':Sequelize[_0xaa30('0x2')]},'channel':{'type':Sequelize[_0xaa30('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xaa30('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xaa30('0x2')]},'accountcode':{'type':Sequelize[_0xaa30('0x2')]},'context':{'type':Sequelize[_0xaa30('0x2')]},'exten':{'type':Sequelize[_0xaa30('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xaa30('0x2')]},'destchannelstate':{'type':Sequelize[_0xaa30('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xaa30('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaa30('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa30('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa30('0x2')]},'destlanguage':{'type':Sequelize[_0xaa30('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa30('0x2')]},'destcontext':{'type':Sequelize[_0xaa30('0x2')]},'destexten':{'type':Sequelize[_0xaa30('0x2')]},'destpriority':{'type':Sequelize[_0xaa30('0x2')]},'destuniqueid':{'type':Sequelize[_0xaa30('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xaa30('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xaa30('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xaa30('0x2')]},'transferuniqueid':{'type':Sequelize[_0xaa30('0x2')]},'agententerreason':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x42f4=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x2c8b7a,_0x483fe0){var _0x1c1cf9=function(_0x464bcf){while(--_0x464bcf){_0x2c8b7a['push'](_0x2c8b7a['shift']());}};_0x1c1cf9(++_0x483fe0);}(_0x42f4,0x19d));var _0x442f=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x42f4[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0x442f('0x0'));module['exports']={'type':{'type':Sequelize[_0x442f('0x1')]},'uniqueid':{'type':Sequelize[_0x442f('0x1')]},'calleridnum':{'type':Sequelize[_0x442f('0x1')]},'calleridname':{'type':Sequelize[_0x442f('0x1')]},'queue':{'type':Sequelize[_0x442f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x442f('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x442f('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x442f('0x2')]},'holdtime':{'type':Sequelize[_0x442f('0x3')]},'agentcomplete':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x442f('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x442f('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x442f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x442f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x442f('0x1')]},'connectedlinename':{'type':Sequelize[_0x442f('0x1')]},'language':{'type':Sequelize[_0x442f('0x1')]},'accountcode':{'type':Sequelize[_0x442f('0x1')]},'context':{'type':Sequelize[_0x442f('0x1')]},'exten':{'type':Sequelize[_0x442f('0x1')]},'priority':{'type':Sequelize[_0x442f('0x1')]},'destchannel':{'type':Sequelize[_0x442f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x442f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x442f('0x1')]},'destcalleridname':{'type':Sequelize[_0x442f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x442f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x442f('0x1')]},'destlanguage':{'type':Sequelize[_0x442f('0x1')]},'destaccountcode':{'type':Sequelize[_0x442f('0x1')]},'destcontext':{'type':Sequelize[_0x442f('0x1')]},'destexten':{'type':Sequelize[_0x442f('0x1')]},'destpriority':{'type':Sequelize[_0x442f('0x1')]},'destuniqueid':{'type':Sequelize[_0x442f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x442f('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x442f('0x1')]},'transfer':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x442f('0x1')],'comment':_0x442f('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x442f('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index c959ce5..af8a0c3 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(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 cf22a6e..21795a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac95=['define','uniqueid','destuniqueid','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceAgentReport.attributes'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0xac95,0xa8));var _0x5ac9=function(_0x44b413,_0x2b2e91){_0x44b413=_0x44b413-0x0;var _0x3df3b8=_0xac95[_0x44b413];return _0x3df3b8;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var logger=require(_0x5ac9('0x2'))(_0x5ac9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ac9('0x4'));var fs=require('fs');var path=require(_0x5ac9('0x5'));var rimraf=require('rimraf');var config=require(_0x5ac9('0x6'));var attributes=require(_0x5ac9('0x7'));module['exports']=function(_0x1dc09a,_0x2bb4da){return _0x1dc09a[_0x5ac9('0x8')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5ac9('0x9'),_0x5ac9('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x615a=['path','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x4f76db,_0x1fb293){var _0x31a2c0=function(_0xb71d06){while(--_0xb71d06){_0x4f76db['push'](_0x4f76db['shift']());}};_0x31a2c0(++_0x1fb293);}(_0x615a,0x119));var _0xa615=function(_0x162ee0,_0x291661){_0x162ee0=_0x162ee0-0x0;var _0x48fc5e=_0x615a[_0x162ee0];return _0x48fc5e;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var logger=require(_0xa615('0x1'))('api');var moment=require(_0xa615('0x2'));var BPromise=require(_0xa615('0x3'));var rp=require(_0xa615('0x4'));var fs=require('fs');var path=require(_0xa615('0x5'));var rimraf=require('rimraf');var config=require(_0xa615('0x6'));var attributes=require(_0xa615('0x7'));module['exports']=function(_0x320680,_0x5d04bd){return _0x320680[_0xa615('0x8')](_0xa615('0x9'),attributes,{'tableName':_0xa615('0xa'),'paranoid':![],'indexes':[{'fields':[_0xa615('0xb'),_0xa615('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 2cfc84d..394c40e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aac=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','update','where','attributes','limit','UpdateVoiceAgentReport','debug','lodash','util','moment'];(function(_0xce87e3,_0x58cae4){var _0x7d87f4=function(_0x5bc232){while(--_0x5bc232){_0xce87e3['push'](_0xce87e3['shift']());}};_0x7d87f4(++_0x58cae4);}(_0x2aac,0x195));var _0xc2aa=function(_0x5259f2,_0x4860e0){_0x5259f2=_0x5259f2-0x0;var _0x385799=_0x2aac[_0x5259f2];return _0x385799;};'use strict';var _=require(_0xc2aa('0x0'));var util=require(_0xc2aa('0x1'));var moment=require(_0xc2aa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2aa('0x3'));var db=require(_0xc2aa('0x4'))['db'];var utils=require(_0xc2aa('0x5'));var logger=require('../../config/logger')(_0xc2aa('0x6'));var config=require(_0xc2aa('0x7'));var jayson=require(_0xc2aa('0x8'));var client=jayson[_0xc2aa('0x9')][_0xc2aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x472309,_0x3bc778,_0xc775eb){return new BPromise(function(_0x1e5c56,_0x2557b8){return client[_0xc2aa('0xb')](_0x472309,_0xc775eb)[_0xc2aa('0xc')](function(_0x5d1b88){logger[_0xc2aa('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bc778,'request\x20sent');logger['debug'](_0xc2aa('0xe'),_0x3bc778,_0xc2aa('0xf'),JSON[_0xc2aa('0x10')](_0x5d1b88));if(_0x5d1b88[_0xc2aa('0x11')]){if(_0x5d1b88[_0xc2aa('0x11')][_0xc2aa('0x12')]===0x1f4){logger['error'](_0xc2aa('0x13'),_0x3bc778,_0x5d1b88[_0xc2aa('0x11')][_0xc2aa('0x14')]);return _0x2557b8(_0x5d1b88[_0xc2aa('0x11')][_0xc2aa('0x14')]);}logger[_0xc2aa('0x11')](_0xc2aa('0x13'),_0x3bc778,_0x5d1b88[_0xc2aa('0x11')]['message']);return _0x1e5c56(_0x5d1b88[_0xc2aa('0x11')]['message']);}else{logger[_0xc2aa('0xd')](_0xc2aa('0x13'),_0x3bc778,'request\x20sent');_0x1e5c56(_0x5d1b88[_0xc2aa('0x15')][_0xc2aa('0x14')]);}})[_0xc2aa('0x16')](function(_0x1c3965){logger['error'](_0xc2aa('0x13'),_0x3bc778,_0x1c3965);_0x2557b8(_0x1c3965);});});}exports[_0xc2aa('0x17')]=function(_0x20b9ee){var _0x1fd000=this;return new Promise(function(_0x59db0d,_0xe5ed33){return db['VoiceAgentReport'][_0xc2aa('0x18')](_0x20b9ee[_0xc2aa('0x19')],{'raw':_0x20b9ee[_0xc2aa('0x1a')]?_0x20b9ee[_0xc2aa('0x1a')][_0xc2aa('0x1b')]===undefined?!![]:![]:!![]})[_0xc2aa('0xc')](function(_0x1e9bda){logger['info'](_0xc2aa('0x17'),_0x20b9ee);logger['debug'](_0xc2aa('0x17'),_0x20b9ee,JSON[_0xc2aa('0x10')](_0x1e9bda));_0x59db0d(_0x1e9bda);})[_0xc2aa('0x16')](function(_0x59051a){logger['error']('CreateVoiceAgentReport',_0x59051a[_0xc2aa('0x14')],_0x20b9ee);_0xe5ed33(_0x1fd000[_0xc2aa('0x11')](0x1f4,_0x59051a[_0xc2aa('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x26ce6c){var _0x4e0bff=this;return new Promise(function(_0x323a46,_0x36bea9){return db['VoiceAgentReport'][_0xc2aa('0x1c')](_0x26ce6c[_0xc2aa('0x19')],{'raw':_0x26ce6c[_0xc2aa('0x1a')]?_0x26ce6c[_0xc2aa('0x1a')][_0xc2aa('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26ce6c[_0xc2aa('0x1a')]?_0x26ce6c[_0xc2aa('0x1a')][_0xc2aa('0x1d')]||null:null,'attributes':_0x26ce6c[_0xc2aa('0x1a')]?_0x26ce6c[_0xc2aa('0x1a')][_0xc2aa('0x1e')]||null:null,'limit':_0x26ce6c['options']?_0x26ce6c[_0xc2aa('0x1a')][_0xc2aa('0x1f')]||null:null})[_0xc2aa('0xc')](function(_0x546be5){logger[_0xc2aa('0xd')](_0xc2aa('0x20'),_0x26ce6c);logger[_0xc2aa('0x21')](_0xc2aa('0x20'),_0x26ce6c,JSON[_0xc2aa('0x10')](_0x546be5));_0x323a46(_0x546be5);})['catch'](function(_0x399d70){logger['error'](_0xc2aa('0x20'),_0x399d70[_0xc2aa('0x14')],_0x26ce6c);_0x36bea9(_0x4e0bff[_0xc2aa('0x11')](0x1f4,_0x399d70['message']));});});};
\ No newline at end of file
+var _0x580d=['where','attributes','limit','UpdateVoiceAgentReport','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateVoiceAgentReport','create','options','update','raw'];(function(_0x368abc,_0x8bbc6f){var _0x2fd9f0=function(_0x129756){while(--_0x129756){_0x368abc['push'](_0x368abc['shift']());}};_0x2fd9f0(++_0x8bbc6f);}(_0x580d,0xaf));var _0xd580=function(_0x2361fb,_0x547c8c){_0x2361fb=_0x2361fb-0x0;var _0x3932ea=_0x580d[_0x2361fb];return _0x3932ea;};'use strict';var _=require('lodash');var util=require(_0xd580('0x0'));var moment=require(_0xd580('0x1'));var BPromise=require(_0xd580('0x2'));var rs=require(_0xd580('0x3'));var fs=require('fs');var Redis=require(_0xd580('0x4'));var db=require(_0xd580('0x5'))['db'];var utils=require(_0xd580('0x6'));var logger=require(_0xd580('0x7'))(_0xd580('0x8'));var config=require(_0xd580('0x9'));var jayson=require(_0xd580('0xa'));var client=jayson[_0xd580('0xb')][_0xd580('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x182970,_0xc7c5f1,_0x1f04f2){return new BPromise(function(_0x2c64b8,_0x283a92){return client[_0xd580('0xd')](_0x182970,_0x1f04f2)[_0xd580('0xe')](function(_0x1e63df){logger['info'](_0xd580('0xf'),_0xc7c5f1,_0xd580('0x10'));logger[_0xd580('0x11')](_0xd580('0x12'),_0xc7c5f1,'request\x20sent',JSON['stringify'](_0x1e63df));if(_0x1e63df[_0xd580('0x13')]){if(_0x1e63df[_0xd580('0x13')][_0xd580('0x14')]===0x1f4){logger[_0xd580('0x13')](_0xd580('0xf'),_0xc7c5f1,_0x1e63df[_0xd580('0x13')][_0xd580('0x15')]);return _0x283a92(_0x1e63df[_0xd580('0x13')][_0xd580('0x15')]);}logger[_0xd580('0x13')](_0xd580('0xf'),_0xc7c5f1,_0x1e63df[_0xd580('0x13')][_0xd580('0x15')]);return _0x2c64b8(_0x1e63df[_0xd580('0x13')]['message']);}else{logger[_0xd580('0x16')](_0xd580('0xf'),_0xc7c5f1,'request\x20sent');_0x2c64b8(_0x1e63df['result'][_0xd580('0x15')]);}})[_0xd580('0x17')](function(_0x56cd39){logger[_0xd580('0x13')](_0xd580('0xf'),_0xc7c5f1,_0x56cd39);_0x283a92(_0x56cd39);});});}exports[_0xd580('0x18')]=function(_0x189ed8){var _0x1be82d=this;return new Promise(function(_0x4cb2d5,_0x34a8a7){return db['VoiceAgentReport'][_0xd580('0x19')](_0x189ed8['body'],{'raw':_0x189ed8[_0xd580('0x1a')]?_0x189ed8[_0xd580('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xd580('0xe')](function(_0x53d8c8){logger[_0xd580('0x16')]('CreateVoiceAgentReport',_0x189ed8);logger[_0xd580('0x11')](_0xd580('0x18'),_0x189ed8,JSON['stringify'](_0x53d8c8));_0x4cb2d5(_0x53d8c8);})[_0xd580('0x17')](function(_0x52086e){logger[_0xd580('0x13')](_0xd580('0x18'),_0x52086e[_0xd580('0x15')],_0x189ed8);_0x34a8a7(_0x1be82d[_0xd580('0x13')](0x1f4,_0x52086e[_0xd580('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x2c2c71){var _0x219c0a=this;return new Promise(function(_0xe9558c,_0x3e59e1){return db['VoiceAgentReport'][_0xd580('0x1b')](_0x2c2c71['body'],{'raw':_0x2c2c71[_0xd580('0x1a')]?_0x2c2c71[_0xd580('0x1a')][_0xd580('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c2c71[_0xd580('0x1a')]?_0x2c2c71[_0xd580('0x1a')][_0xd580('0x1d')]||null:null,'attributes':_0x2c2c71[_0xd580('0x1a')]?_0x2c2c71[_0xd580('0x1a')][_0xd580('0x1e')]||null:null,'limit':_0x2c2c71[_0xd580('0x1a')]?_0x2c2c71[_0xd580('0x1a')][_0xd580('0x1f')]||null:null})[_0xd580('0xe')](function(_0x1a21ef){logger[_0xd580('0x16')](_0xd580('0x20'),_0x2c2c71);logger[_0xd580('0x11')]('UpdateVoiceAgentReport',_0x2c2c71,JSON[_0xd580('0x21')](_0x1a21ef));_0xe9558c(_0x1a21ef);})['catch'](function(_0x512dd1){logger[_0xd580('0x13')](_0xd580('0x20'),_0x512dd1['message'],_0x2c2c71);_0x3e59e1(_0x219c0a[_0xd580('0x13')](0x1f4,_0x512dd1[_0xd580('0x15')]));});});};
\ No newline at end of file
index 66de2ca..25a6ebd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1efc19,_0x1d44c1){var _0x5eb212=function(_0x34b3d4){while(--_0x34b3d4){_0x1efc19['push'](_0x1efc19['shift']());}};_0x5eb212(++_0x1d44c1);}(_0xe5b3,0x133));var _0x3e5b=function(_0x434acd,_0x20a658){_0x434acd=_0x434acd-0x0;var _0x20b131=_0xe5b3[_0x434acd];return _0x20b131;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/describe',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0xd')]);router[_0x3e5b('0xa')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3e5b('0xf')]('/',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x10')]);router[_0x3e5b('0x11')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller[_0x3e5b('0x12')]);router['delete'](_0x3e5b('0xe'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x13')]);module[_0x3e5b('0x14')]=router;
\ No newline at end of file
+var _0x6737=['isAuthenticated','index','get','show','create','put','update','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0xbcaf83,_0x4e3e98){var _0x2cf75f=function(_0x26e748){while(--_0x26e748){_0xbcaf83['push'](_0xbcaf83['shift']());}};_0x2cf75f(++_0x4e3e98);}(_0x6737,0xe2));var _0x7673=function(_0xae2689,_0x330757){_0xae2689=_0xae2689-0x0;var _0xde2a5c=_0x6737[_0xae2689];return _0xde2a5c;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7673('0xa')]('/:id',auth[_0x7673('0x8')](),controller[_0x7673('0xb')]);router['post']('/',auth[_0x7673('0x8')](),controller[_0x7673('0xc')]);router[_0x7673('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x7673('0xe')]);router['delete'](_0x7673('0xf'),auth[_0x7673('0x8')](),controller[_0x7673('0x10')]);module[_0x7673('0x11')]=router;
\ No newline at end of file
index 899cea8..983a5f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9808=['outbound','outbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x9808,0xa7));var _0x8980=function(_0x4471b3,_0x511a9f){_0x4471b3=_0x4471b3-0x0;var _0x386593=_0x9808[_0x4471b3];return _0x386593;};'use strict';var Sequelize=require(_0x8980('0x0'));module[_0x8980('0x1')]={'uniqueid':{'type':Sequelize[_0x8980('0x2')]},'type':{'type':Sequelize[_0x8980('0x3')]('inbound','internal',_0x8980('0x4'),'inbound-fax',_0x8980('0x5'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8980('0x2')]},'source':{'type':Sequelize[_0x8980('0x2')]},'destination':{'type':Sequelize[_0x8980('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8980('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x8980('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8980('0x6')]},'starttime':{'type':Sequelize[_0x8980('0x7')]},'systemanswertime':{'type':Sequelize[_0x8980('0x7')]},'answertime':{'type':Sequelize[_0x8980('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x8980('0x8')]},'billableseconds':{'type':Sequelize[_0x8980('0x8')]},'mohtime':{'type':Sequelize[_0x8980('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8980('0x2')]},'amaflags':{'type':Sequelize[_0x8980('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x8980('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x8980('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x8980('0x2')]},'note':{'type':Sequelize[_0x8980('0x2')]},'prefix':{'type':Sequelize[_0x8980('0x2')]},'routeid':{'type':Sequelize[_0x8980('0x8')]},'sipcallid':{'type':Sequelize[_0x8980('0x2')]}};
\ No newline at end of file
+var _0x1df7=['DATE','INTEGER','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT'];(function(_0x37b013,_0x3065d1){var _0xcca5be=function(_0x3f931a){while(--_0x3f931a){_0x37b013['push'](_0x37b013['shift']());}};_0xcca5be(++_0x3065d1);}(_0x1df7,0x6e));var _0x71df=function(_0x42c5a2,_0x38a2b9){_0x42c5a2=_0x42c5a2-0x0;var _0xbaf6e1=_0x1df7[_0x42c5a2];return _0xbaf6e1;};'use strict';var Sequelize=require('sequelize');module[_0x71df('0x0')]={'uniqueid':{'type':Sequelize[_0x71df('0x1')]},'type':{'type':Sequelize[_0x71df('0x2')](_0x71df('0x3'),_0x71df('0x4'),_0x71df('0x5'),_0x71df('0x6'),_0x71df('0x7'),_0x71df('0x8'))},'tag':{'type':Sequelize[_0x71df('0x1')]},'accountcode':{'type':Sequelize[_0x71df('0x1')]},'source':{'type':Sequelize[_0x71df('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x71df('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x71df('0x1')]},'destinationchannel':{'type':Sequelize[_0x71df('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x71df('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x71df('0xa')]},'answertime':{'type':Sequelize[_0x71df('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x71df('0xb')]},'billableseconds':{'type':Sequelize[_0x71df('0xb')]},'mohtime':{'type':Sequelize[_0x71df('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x71df('0x1')]},'userfield':{'type':Sequelize[_0x71df('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x71df('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x71df('0x1')]},'note':{'type':Sequelize[_0x71df('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x71df('0x1')]}};
\ No newline at end of file
index 93b0ed6..fc43015 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(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0xadb5,0xad));var _0x5adb=function(_0x1e9384,_0x5d98e8){_0x1e9384=_0x1e9384-0x0;var _0x1ea04d=_0xadb5[_0x1e9384];return _0x1ea04d;};'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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2ef3,0xba));var _0x32ef=function(_0x2afc50,_0x149232){_0x2afc50=_0x2afc50-0x0;var _0x305cfc=_0x2ef3[_0x2afc50];return _0x305cfc;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));};
\ No newline at end of file
index 3f413ad..eea4f56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x550e=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call'];(function(_0x2d4661,_0x2da65c){var _0x42ed1e=function(_0x263c50){while(--_0x263c50){_0x2d4661['push'](_0x2d4661['shift']());}};_0x42ed1e(++_0x2da65c);}(_0x550e,0x9d));var _0xe550=function(_0x543e0b,_0x5daec4){_0x543e0b=_0x543e0b-0x0;var _0x44e378=_0x550e[_0x543e0b];return _0x44e378;};'use strict';var _=require(_0xe550('0x0'));var util=require(_0xe550('0x1'));var logger=require(_0xe550('0x2'))(_0xe550('0x3'));var moment=require('moment');var BPromise=require(_0xe550('0x4'));var rp=require(_0xe550('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe550('0x6'));var attributes=require(_0xe550('0x7'));module[_0xe550('0x8')]=function(_0x2674cb,_0x5f0d53){return _0x2674cb['define'](_0xe550('0x9'),attributes,{'tableName':_0xe550('0xa'),'paranoid':![],'indexes':[{'fields':[_0xe550('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e12=['define','VoiceCallReport','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x216c8f,_0x2f4d65){var _0x4dde99=function(_0x323921){while(--_0x323921){_0x216c8f['push'](_0x216c8f['shift']());}};_0x4dde99(++_0x2f4d65);}(_0x6e12,0xf2));var _0x26e1=function(_0x5061a3,_0x489ab5){_0x5061a3=_0x5061a3-0x0;var _0x66e81c=_0x6e12[_0x5061a3];return _0x66e81c;};'use strict';var _=require('lodash');var util=require(_0x26e1('0x0'));var logger=require(_0x26e1('0x1'))(_0x26e1('0x2'));var moment=require(_0x26e1('0x3'));var BPromise=require(_0x26e1('0x4'));var rp=require(_0x26e1('0x5'));var fs=require('fs');var path=require(_0x26e1('0x6'));var rimraf=require(_0x26e1('0x7'));var config=require(_0x26e1('0x8'));var attributes=require(_0x26e1('0x9'));module['exports']=function(_0x42a12e,_0x1b27a1){return _0x42a12e[_0x26e1('0xa')](_0x26e1('0xb'),attributes,{'tableName':_0x26e1('0xc'),'paranoid':![],'indexes':[{'fields':[_0x26e1('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index b121eca..93e094e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0054=['error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','then','CreateVoiceCallReport','create','update','body','where','UpdateVoiceCallReport','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2264f9,_0x580bcb){var _0x38b842=function(_0x109771){while(--_0x109771){_0x2264f9['push'](_0x2264f9['shift']());}};_0x38b842(++_0x580bcb);}(_0x0054,0x175));var _0x4005=function(_0x3f1b81,_0x4fb0f7){_0x3f1b81=_0x3f1b81-0x0;var _0x170d5e=_0x0054[_0x3f1b81];return _0x170d5e;};'use strict';var _=require(_0x4005('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4005('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4005('0x2'))['db'];var utils=require(_0x4005('0x3'));var logger=require(_0x4005('0x4'))(_0x4005('0x5'));var config=require(_0x4005('0x6'));var jayson=require(_0x4005('0x7'));var client=jayson[_0x4005('0x8')][_0x4005('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x584090,_0x5f2cf8,_0xe5be06){return new BPromise(function(_0x3581df,_0x37e11a){return client[_0x4005('0xa')](_0x584090,_0xe5be06)['then'](function(_0xbd2ed6){logger[_0x4005('0xb')](_0x4005('0xc'),_0x5f2cf8,_0x4005('0xd'));logger[_0x4005('0xe')](_0x4005('0xf'),_0x5f2cf8,_0x4005('0xd'),JSON[_0x4005('0x10')](_0xbd2ed6));if(_0xbd2ed6[_0x4005('0x11')]){if(_0xbd2ed6['error'][_0x4005('0x12')]===0x1f4){logger['error'](_0x4005('0xc'),_0x5f2cf8,_0xbd2ed6[_0x4005('0x11')][_0x4005('0x13')]);return _0x37e11a(_0xbd2ed6['error'][_0x4005('0x13')]);}logger[_0x4005('0x11')](_0x4005('0xc'),_0x5f2cf8,_0xbd2ed6['error'][_0x4005('0x13')]);return _0x3581df(_0xbd2ed6[_0x4005('0x11')][_0x4005('0x13')]);}else{logger[_0x4005('0xb')](_0x4005('0xc'),_0x5f2cf8,_0x4005('0xd'));_0x3581df(_0xbd2ed6[_0x4005('0x14')][_0x4005('0x13')]);}})[_0x4005('0x15')](function(_0x1c797d){logger[_0x4005('0x11')](_0x4005('0xc'),_0x5f2cf8,_0x1c797d);_0x37e11a(_0x1c797d);});});}exports[_0x4005('0x16')]=function(_0x1c206a){var _0x1ba69d=this;return new Promise(function(_0x11336c,_0xbb5ee3){return db[_0x4005('0x17')][_0x4005('0x18')]({'raw':_0x1c206a[_0x4005('0x19')]?_0x1c206a['options'][_0x4005('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c206a[_0x4005('0x19')]?_0x1c206a[_0x4005('0x19')]['where']||null:null,'attributes':_0x1c206a[_0x4005('0x19')]?_0x1c206a['options'][_0x4005('0x1b')]||null:null,'limit':_0x1c206a[_0x4005('0x19')]?_0x1c206a[_0x4005('0x19')][_0x4005('0x1c')]||null:null,'include':_0x1c206a[_0x4005('0x19')]?_0x1c206a[_0x4005('0x19')][_0x4005('0x1d')]?_[_0x4005('0x1e')](_0x1c206a[_0x4005('0x19')][_0x4005('0x1d')],function(_0x29babc){return{'model':db[_0x29babc[_0x4005('0x1f')]],'as':_0x29babc['as'],'attributes':_0x29babc[_0x4005('0x1b')],'include':_0x29babc[_0x4005('0x1d')]?_['map'](_0x29babc[_0x4005('0x1d')],function(_0x42c0bb){return{'model':db[_0x42c0bb[_0x4005('0x1f')]],'as':_0x42c0bb['as'],'attributes':_0x42c0bb['attributes'],'include':_0x42c0bb[_0x4005('0x1d')]?_[_0x4005('0x1e')](_0x42c0bb[_0x4005('0x1d')],function(_0x1f592e){return{'model':db[_0x1f592e[_0x4005('0x1f')]],'as':_0x1f592e['as'],'attributes':_0x1f592e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4005('0x20')](function(_0x43ce00){logger['info']('GetVoiceCallReport',_0x1c206a);logger['debug'](_0x4005('0x16'),_0x1c206a,JSON[_0x4005('0x10')](_0x43ce00));_0x11336c(_0x43ce00);})[_0x4005('0x15')](function(_0x2bcc1f){logger[_0x4005('0x11')](_0x4005('0x16'),_0x2bcc1f[_0x4005('0x13')],_0x1c206a);_0xbb5ee3(_0x1ba69d['error'](0x1f4,_0x2bcc1f[_0x4005('0x13')]));});});};exports[_0x4005('0x21')]=function(_0x147e2d){var _0x342d7b=this;return new Promise(function(_0x4b1f7d,_0x4b344e){return db[_0x4005('0x17')][_0x4005('0x22')](_0x147e2d['body'],{'raw':_0x147e2d[_0x4005('0x19')]?_0x147e2d[_0x4005('0x19')][_0x4005('0x1a')]===undefined?!![]:![]:!![]})[_0x4005('0x20')](function(_0x44c226){logger[_0x4005('0xb')](_0x4005('0x21'),_0x147e2d);logger['debug'](_0x4005('0x21'),_0x147e2d,JSON[_0x4005('0x10')](_0x44c226));_0x4b1f7d(_0x44c226);})['catch'](function(_0x2c7e96){logger[_0x4005('0x11')]('CreateVoiceCallReport',_0x2c7e96['message'],_0x147e2d);_0x4b344e(_0x342d7b[_0x4005('0x11')](0x1f4,_0x2c7e96[_0x4005('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0xdfeb39){var _0x524f63=this;return new Promise(function(_0x5bb36b,_0x168466){return db[_0x4005('0x17')][_0x4005('0x23')](_0xdfeb39[_0x4005('0x24')],{'raw':_0xdfeb39['options']?_0xdfeb39[_0x4005('0x19')][_0x4005('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdfeb39[_0x4005('0x19')]?_0xdfeb39[_0x4005('0x19')][_0x4005('0x25')]||null:null,'attributes':_0xdfeb39['options']?_0xdfeb39['options'][_0x4005('0x1b')]||null:null,'limit':_0xdfeb39[_0x4005('0x19')]?_0xdfeb39['options'][_0x4005('0x1c')]||null:null})[_0x4005('0x20')](function(_0x1cad74){logger['info'](_0x4005('0x26'),_0xdfeb39);logger[_0x4005('0xe')](_0x4005('0x26'),_0xdfeb39,JSON[_0x4005('0x10')](_0x1cad74));_0x5bb36b(_0x1cad74);})[_0x4005('0x15')](function(_0x307d72){logger[_0x4005('0x11')](_0x4005('0x26'),_0x307d72[_0x4005('0x13')],_0xdfeb39);_0x168466(_0x524f63[_0x4005('0x11')](0x1f4,_0x307d72['message']));});});};
\ No newline at end of file
+var _0xda6c=['limit','include','map','model','then','stringify','catch','VoiceCallReport','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceCallReport','findAll','options','raw','attributes'];(function(_0x1aaf54,_0x434fcb){var _0x5927db=function(_0xa9e85e){while(--_0xa9e85e){_0x1aaf54['push'](_0x1aaf54['shift']());}};_0x5927db(++_0x434fcb);}(_0xda6c,0x80));var _0xcda6=function(_0x3c3c85,_0x116bfc){_0x3c3c85=_0x3c3c85-0x0;var _0x254653=_0xda6c[_0x3c3c85];return _0x254653;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcda6('0x0'));var BPromise=require(_0xcda6('0x1'));var rs=require(_0xcda6('0x2'));var fs=require('fs');var Redis=require(_0xcda6('0x3'));var db=require(_0xcda6('0x4'))['db'];var utils=require(_0xcda6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcda6('0x6'));var jayson=require(_0xcda6('0x7'));var client=jayson[_0xcda6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b4235,_0x1394ac,_0x314c31){return new BPromise(function(_0x5eb829,_0x176e85){return client[_0xcda6('0x9')](_0x3b4235,_0x314c31)['then'](function(_0x3d8046){logger[_0xcda6('0xa')](_0xcda6('0xb'),_0x1394ac,_0xcda6('0xc'));logger[_0xcda6('0xd')](_0xcda6('0xe'),_0x1394ac,_0xcda6('0xc'),JSON['stringify'](_0x3d8046));if(_0x3d8046[_0xcda6('0xf')]){if(_0x3d8046['error'][_0xcda6('0x10')]===0x1f4){logger['error'](_0xcda6('0xb'),_0x1394ac,_0x3d8046[_0xcda6('0xf')]['message']);return _0x176e85(_0x3d8046[_0xcda6('0xf')][_0xcda6('0x11')]);}logger[_0xcda6('0xf')](_0xcda6('0xb'),_0x1394ac,_0x3d8046[_0xcda6('0xf')]['message']);return _0x5eb829(_0x3d8046[_0xcda6('0xf')][_0xcda6('0x11')]);}else{logger[_0xcda6('0xa')](_0xcda6('0xb'),_0x1394ac,'request\x20sent');_0x5eb829(_0x3d8046[_0xcda6('0x12')][_0xcda6('0x11')]);}})['catch'](function(_0x52c743){logger[_0xcda6('0xf')](_0xcda6('0xb'),_0x1394ac,_0x52c743);_0x176e85(_0x52c743);});});}exports[_0xcda6('0x13')]=function(_0x37e8f1){var _0x2c7184=this;return new Promise(function(_0x36ffb6,_0x903e01){return db['VoiceCallReport'][_0xcda6('0x14')]({'raw':_0x37e8f1[_0xcda6('0x15')]?_0x37e8f1[_0xcda6('0x15')][_0xcda6('0x16')]===undefined?!![]:![]:!![],'where':_0x37e8f1['options']?_0x37e8f1[_0xcda6('0x15')]['where']||null:null,'attributes':_0x37e8f1[_0xcda6('0x15')]?_0x37e8f1[_0xcda6('0x15')][_0xcda6('0x17')]||null:null,'limit':_0x37e8f1[_0xcda6('0x15')]?_0x37e8f1[_0xcda6('0x15')][_0xcda6('0x18')]||null:null,'include':_0x37e8f1[_0xcda6('0x15')]?_0x37e8f1[_0xcda6('0x15')][_0xcda6('0x19')]?_[_0xcda6('0x1a')](_0x37e8f1[_0xcda6('0x15')][_0xcda6('0x19')],function(_0x521e25){return{'model':db[_0x521e25[_0xcda6('0x1b')]],'as':_0x521e25['as'],'attributes':_0x521e25[_0xcda6('0x17')],'include':_0x521e25['include']?_[_0xcda6('0x1a')](_0x521e25[_0xcda6('0x19')],function(_0x5755d6){return{'model':db[_0x5755d6['model']],'as':_0x5755d6['as'],'attributes':_0x5755d6[_0xcda6('0x17')],'include':_0x5755d6[_0xcda6('0x19')]?_[_0xcda6('0x1a')](_0x5755d6[_0xcda6('0x19')],function(_0x2aaac1){return{'model':db[_0x2aaac1[_0xcda6('0x1b')]],'as':_0x2aaac1['as'],'attributes':_0x2aaac1[_0xcda6('0x17')]};}):[]};}):[]};}):[]:[]})[_0xcda6('0x1c')](function(_0x9dd14f){logger['info'](_0xcda6('0x13'),_0x37e8f1);logger['debug'](_0xcda6('0x13'),_0x37e8f1,JSON[_0xcda6('0x1d')](_0x9dd14f));_0x36ffb6(_0x9dd14f);})[_0xcda6('0x1e')](function(_0x404575){logger[_0xcda6('0xf')](_0xcda6('0x13'),_0x404575[_0xcda6('0x11')],_0x37e8f1);_0x903e01(_0x2c7184[_0xcda6('0xf')](0x1f4,_0x404575['message']));});});};exports['CreateVoiceCallReport']=function(_0xc3d3b9){var _0x4dd035=this;return new Promise(function(_0x5a890c,_0x5abdb4){return db[_0xcda6('0x1f')][_0xcda6('0x20')](_0xc3d3b9[_0xcda6('0x21')],{'raw':_0xc3d3b9[_0xcda6('0x15')]?_0xc3d3b9[_0xcda6('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xcda6('0x1c')](function(_0x583179){logger[_0xcda6('0xa')](_0xcda6('0x22'),_0xc3d3b9);logger[_0xcda6('0xd')]('CreateVoiceCallReport',_0xc3d3b9,JSON[_0xcda6('0x1d')](_0x583179));_0x5a890c(_0x583179);})['catch'](function(_0x157b92){logger[_0xcda6('0xf')](_0xcda6('0x22'),_0x157b92[_0xcda6('0x11')],_0xc3d3b9);_0x5abdb4(_0x4dd035[_0xcda6('0xf')](0x1f4,_0x157b92[_0xcda6('0x11')]));});});};exports[_0xcda6('0x23')]=function(_0x2198ae){var _0x4f2775=this;return new Promise(function(_0x33aad7,_0x190661){return db[_0xcda6('0x1f')][_0xcda6('0x24')](_0x2198ae['body'],{'raw':_0x2198ae[_0xcda6('0x15')]?_0x2198ae[_0xcda6('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2198ae[_0xcda6('0x15')]?_0x2198ae[_0xcda6('0x15')][_0xcda6('0x25')]||null:null,'attributes':_0x2198ae['options']?_0x2198ae['options'][_0xcda6('0x17')]||null:null,'limit':_0x2198ae[_0xcda6('0x15')]?_0x2198ae[_0xcda6('0x15')]['limit']||null:null})['then'](function(_0x19794c){logger[_0xcda6('0xa')](_0xcda6('0x23'),_0x2198ae);logger[_0xcda6('0xd')](_0xcda6('0x23'),_0x2198ae,JSON[_0xcda6('0x1d')](_0x19794c));_0x33aad7(_0x19794c);})[_0xcda6('0x1e')](function(_0x221891){logger[_0xcda6('0xf')](_0xcda6('0x23'),_0x221891[_0xcda6('0x11')],_0x2198ae);_0x190661(_0x4f2775[_0xcda6('0xf')](0x1f4,_0x221891[_0xcda6('0x11')]));});});};
\ No newline at end of file
index 5a9ce94..ceacf18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e95=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports'];(function(_0x1bc3df,_0x2fe5a1){var _0x577570=function(_0x2c3b89){while(--_0x2c3b89){_0x1bc3df['push'](_0x1bc3df['shift']());}};_0x577570(++_0x2fe5a1);}(_0x9e95,0x1cb));var _0x59e9=function(_0x4e79d4,_0x5eda32){_0x4e79d4=_0x4e79d4-0x0;var _0x3b9df2=_0x9e95[_0x4e79d4];return _0x3b9df2;};'use strict';var multer=require(_0x59e9('0x0'));var util=require(_0x59e9('0x1'));var path=require('path');var timeout=require(_0x59e9('0x2'));var express=require(_0x59e9('0x3'));var router=express[_0x59e9('0x4')]();var fs_extra=require(_0x59e9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x59e9('0x6'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x59e9('0x7')]('/',auth[_0x59e9('0x8')](),controller[_0x59e9('0x9')]);router[_0x59e9('0x7')](_0x59e9('0xa'),auth[_0x59e9('0x8')](),controller[_0x59e9('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x59e9('0xc')](_0x59e9('0xa'),auth[_0x59e9('0x8')](),controller[_0x59e9('0xd')]);router[_0x59e9('0xe')]('/:id',auth[_0x59e9('0x8')](),controller[_0x59e9('0xf')]);module[_0x59e9('0x10')]=router;
\ No newline at end of file
+var _0x79bb=['show','post','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id'];(function(_0x34e4bf,_0x2e7350){var _0x4f4302=function(_0x2a3c6e){while(--_0x2a3c6e){_0x34e4bf['push'](_0x34e4bf['shift']());}};_0x4f4302(++_0x2e7350);}(_0x79bb,0x16f));var _0xb79b=function(_0x4c1399,_0x3deb58){_0x4c1399=_0x4c1399-0x0;var _0x3f9717=_0x79bb[_0x4c1399];return _0x3f9717;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb79b('0x0'));var timeout=require(_0xb79b('0x1'));var express=require(_0xb79b('0x2'));var router=express[_0xb79b('0x3')]();var fs_extra=require(_0xb79b('0x4'));var auth=require(_0xb79b('0x5'));var interaction=require(_0xb79b('0x6'));var config=require(_0xb79b('0x7'));var controller=require(_0xb79b('0x8'));router[_0xb79b('0x9')]('/',auth[_0xb79b('0xa')](),controller[_0xb79b('0xb')]);router['get'](_0xb79b('0xc'),auth[_0xb79b('0xa')](),controller[_0xb79b('0xd')]);router[_0xb79b('0xe')]('/',auth[_0xb79b('0xa')](),controller[_0xb79b('0xf')]);router[_0xb79b('0x10')](_0xb79b('0xc'),auth[_0xb79b('0xa')](),controller[_0xb79b('0x11')]);router[_0xb79b('0x12')](_0xb79b('0xc'),auth[_0xb79b('0xa')](),controller['destroy']);module[_0xb79b('0x13')]=router;
\ No newline at end of file
index 7dd6924..ccc7b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x773f=['split','BOOLEAN','sequelize','name','STRING','setDataValue','getDataValue','options'];(function(_0x44a35d,_0x4ea6a4){var _0x5f3f55=function(_0x1117c0){while(--_0x1117c0){_0x44a35d['push'](_0x44a35d['shift']());}};_0x5f3f55(++_0x4ea6a4);}(_0x773f,0xfa));var _0xf773=function(_0x2986fb,_0x9482a0){_0x2986fb=_0x2986fb-0x0;var _0xb3c156=_0x773f[_0x2986fb];return _0xb3c156;};'use strict';var Sequelize=require(_0xf773('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0xf773('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xf773('0x2')],'set':function(_0x38b416){this[_0xf773('0x3')]('options',_0x38b416?_0x38b416['join'](''):[]);},'get':function(){return this[_0xf773('0x4')](_0xf773('0x5'))?this[_0xf773('0x4')]('options')[_0xf773('0x6')](''):[];}},'auth':{'type':Sequelize[_0xf773('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xf773('0x2')]},'record':{'type':Sequelize[_0xf773('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf773('0x2')]},'description':{'type':Sequelize[_0xf773('0x2')]}};
\ No newline at end of file
+var _0x60fb=['join','getDataValue','BOOLEAN','exports','STRING','name','setDataValue','options'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x60fb,0x1ab));var _0xb60f=function(_0x54c261,_0xa80a8f){_0x54c261=_0x54c261-0x0;var _0x4af7b9=_0x60fb[_0x54c261];return _0x4af7b9;};'use strict';var Sequelize=require('sequelize');module[_0xb60f('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb60f('0x1')],'unique':_0xb60f('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xb60f('0x1')],'set':function(_0x2a7a6a){this[_0xb60f('0x3')](_0xb60f('0x4'),_0x2a7a6a?_0x2a7a6a[_0xb60f('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xb60f('0x4'))?this[_0xb60f('0x6')](_0xb60f('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xb60f('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xb60f('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb60f('0x1')]},'description':{'type':Sequelize[_0xb60f('0x1')]}};
\ No newline at end of file
index f40e7b4..527edb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e63=['update','then','destroy','get','ChanSpies','UserProfileResource','end','error','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x4dc1fe,_0x173220){var _0xa2c5c8=function(_0x488634){while(--_0x488634){_0x4dc1fe['push'](_0x4dc1fe['shift']());}};_0xa2c5c8(++_0x173220);}(_0x8e63,0x7c));var _0x38e6=function(_0x1abac2,_0x189eb9){_0x1abac2=_0x1abac2-0x0;var _0x28f10e=_0x8e63[_0x1abac2];return _0x28f10e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x38e6('0x1'));var moment=require(_0x38e6('0x2'));var BPromise=require(_0x38e6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x38e6('0x4'));var sox=require(_0x38e6('0x5'));var csv=require(_0x38e6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38e6('0x7'));var _=require(_0x38e6('0x8'));var squel=require(_0x38e6('0x9'));var crypto=require(_0x38e6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38e6('0x6'));var querystring=require(_0x38e6('0xb'));var Papa=require(_0x38e6('0xc'));var Redis=require(_0x38e6('0xd'));var authService=require(_0x38e6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38e6('0xf'));var logger=require('../../config/logger')(_0x38e6('0x10'));var utils=require('../../config/utils');var config=require(_0x38e6('0x11'));var licenseUtil=require(_0x38e6('0x12'));var db=require(_0x38e6('0x13'))['db'];function respondWithStatusCode(_0x14d2cf,_0x2e2585){_0x2e2585=_0x2e2585||0xcc;return function(_0x57c207){if(_0x57c207){return _0x14d2cf[_0x38e6('0x14')](_0x2e2585);}return _0x14d2cf[_0x38e6('0x15')](_0x2e2585)['end']();};}function respondWithResult(_0x1fcdeb,_0xfd7f2){_0xfd7f2=_0xfd7f2||0xc8;return function(_0x229f18){if(_0x229f18){return _0x1fcdeb[_0x38e6('0x15')](_0xfd7f2)[_0x38e6('0x16')](_0x229f18);}};}function respondWithFilteredResult(_0x46b525,_0x55208f){return function(_0x279688){if(_0x279688){var _0x36a263=typeof _0x55208f[_0x38e6('0x17')]===_0x38e6('0x18')&&typeof _0x55208f[_0x38e6('0x19')]==='undefined';var _0x91997a=_0x279688['count'];var _0x800418=_0x36a263?0x0:_0x55208f[_0x38e6('0x17')];var _0x57ded4=_0x36a263?_0x279688[_0x38e6('0x1a')]:_0x55208f['offset']+_0x55208f[_0x38e6('0x19')];var _0x521453;if(_0x57ded4>=_0x91997a){_0x57ded4=_0x91997a;_0x521453=0xc8;}else{_0x521453=0xce;}_0x46b525[_0x38e6('0x15')](_0x521453);return _0x46b525[_0x38e6('0x1b')](_0x38e6('0x1c'),_0x800418+'-'+_0x57ded4+'/'+_0x91997a)[_0x38e6('0x16')](_0x279688);}return null;};}function patchUpdates(_0x3f1d54){return function(_0x41bb24){try{jsonpatch['apply'](_0x41bb24,_0x3f1d54,!![]);}catch(_0x5f3f67){return BPromise['reject'](_0x5f3f67);}return _0x41bb24[_0x38e6('0x1d')]();};}function saveUpdates(_0x58dc63,_0x4a82f6){return function(_0x2d995f){if(_0x2d995f){return _0x2d995f[_0x38e6('0x1e')](_0x58dc63)[_0x38e6('0x1f')](function(_0x2a8a11){return _0x2a8a11;});}return null;};}function removeEntity(_0x5f5ab2,_0x140fc3){return function(_0x4530a7){if(_0x4530a7){return _0x4530a7[_0x38e6('0x20')]()['then'](function(){var _0x832025=_0x4530a7[_0x38e6('0x21')]({'plain':!![]});var _0x24e3d6=_0x38e6('0x22');return db[_0x38e6('0x23')][_0x38e6('0x20')]({'where':{'type':_0x24e3d6,'resourceId':_0x832025['id']}})[_0x38e6('0x1f')](function(){return _0x4530a7;});})[_0x38e6('0x1f')](function(){_0x5f5ab2['status'](0xcc)[_0x38e6('0x24')]();});}};}function handleEntityNotFound(_0x491588,_0x23902b){return function(_0x4d2b24){if(!_0x4d2b24){_0x491588[_0x38e6('0x14')](0x194);}return _0x4d2b24;};}function handleError(_0x16ed33,_0x43f05f){_0x43f05f=_0x43f05f||0x1f4;return function(_0x1afc04){logger[_0x38e6('0x25')](_0x1afc04['stack']);if(_0x1afc04[_0x38e6('0x26')]){delete _0x1afc04[_0x38e6('0x26')];}_0x16ed33[_0x38e6('0x15')](_0x43f05f)[_0x38e6('0x27')](_0x1afc04);};}exports[_0x38e6('0x28')]=function(_0x526569,_0x468310){var _0x192893={},_0x39eafd={},_0x3ce1c2={'count':0x0,'rows':[]};var _0xe7489=_[_0x38e6('0x29')](db[_0x38e6('0x2a')]['rawAttributes'],function(_0x220c19){return{'name':_0x220c19[_0x38e6('0x2b')],'type':_0x220c19[_0x38e6('0x2c')][_0x38e6('0x2d')]};});_0x39eafd[_0x38e6('0x2e')]=_[_0x38e6('0x29')](_0xe7489,_0x38e6('0x26'));_0x39eafd['query']=_[_0x38e6('0x2f')](_0x526569[_0x38e6('0x30')]);_0x39eafd[_0x38e6('0x31')]=_[_0x38e6('0x32')](_0x39eafd[_0x38e6('0x2e')],_0x39eafd[_0x38e6('0x30')]);_0x192893[_0x38e6('0x33')]=_['intersection'](_0x39eafd[_0x38e6('0x2e')],qs[_0x38e6('0x34')](_0x526569[_0x38e6('0x30')][_0x38e6('0x34')]));_0x192893['attributes']=_0x192893[_0x38e6('0x33')][_0x38e6('0x35')]?_0x192893['attributes']:_0x39eafd[_0x38e6('0x2e')];if(!_0x526569[_0x38e6('0x30')][_0x38e6('0x36')](_0x38e6('0x37'))){_0x192893['limit']=qs[_0x38e6('0x19')](_0x526569[_0x38e6('0x30')][_0x38e6('0x19')]);_0x192893[_0x38e6('0x17')]=qs['offset'](_0x526569[_0x38e6('0x30')][_0x38e6('0x17')]);}_0x192893[_0x38e6('0x38')]=qs[_0x38e6('0x39')](_0x526569[_0x38e6('0x30')][_0x38e6('0x39')]);_0x192893[_0x38e6('0x3a')]=qs['filters'](_[_0x38e6('0x3b')](_0x526569[_0x38e6('0x30')],_0x39eafd['filters']),_0xe7489);if(_0x526569['query'][_0x38e6('0x3c')]){_0x192893[_0x38e6('0x3a')]=_[_0x38e6('0x3d')](_0x192893[_0x38e6('0x3a')],{'$or':_[_0x38e6('0x29')](_0xe7489,function(_0x2cb64c){if(_0x2cb64c[_0x38e6('0x2c')]!==_0x38e6('0x3e')){var _0x200c9e={};_0x200c9e[_0x2cb64c[_0x38e6('0x26')]]={'$like':'%'+_0x526569['query'][_0x38e6('0x3c')]+'%'};return _0x200c9e;}})});}_0x192893=_[_0x38e6('0x3d')]({},_0x192893,_0x526569[_0x38e6('0x3f')]);var _0xb486bb={'where':_0x192893[_0x38e6('0x3a')]};return db['VoiceChanSpy'][_0x38e6('0x1a')](_0xb486bb)['then'](function(_0x7a8077){_0x3ce1c2[_0x38e6('0x1a')]=_0x7a8077;if(_0x526569[_0x38e6('0x30')][_0x38e6('0x40')]){_0x192893[_0x38e6('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x38e6('0x42')](_0x192893);})[_0x38e6('0x1f')](function(_0x5f4ae3){_0x3ce1c2[_0x38e6('0x43')]=_0x5f4ae3;return _0x3ce1c2;})[_0x38e6('0x1f')](respondWithFilteredResult(_0x468310,_0x192893))[_0x38e6('0x44')](handleError(_0x468310,null));};exports['show']=function(_0x1904b5,_0x295e5c){var _0x49a021={'raw':![],'where':{'id':_0x1904b5[_0x38e6('0x45')]['id']}},_0x454d58={};_0x454d58[_0x38e6('0x2e')]=_[_0x38e6('0x2f')](db[_0x38e6('0x2a')]['rawAttributes']);_0x454d58[_0x38e6('0x30')]=_['keys'](_0x1904b5[_0x38e6('0x30')]);_0x454d58[_0x38e6('0x31')]=_['intersection'](_0x454d58[_0x38e6('0x2e')],_0x454d58[_0x38e6('0x30')]);_0x49a021['attributes']=_[_0x38e6('0x32')](_0x454d58[_0x38e6('0x2e')],qs[_0x38e6('0x34')](_0x1904b5['query'][_0x38e6('0x34')]));_0x49a021[_0x38e6('0x33')]=_0x49a021[_0x38e6('0x33')]['length']?_0x49a021['attributes']:_0x454d58[_0x38e6('0x2e')];if(_0x1904b5[_0x38e6('0x30')]['includeAll']){_0x49a021[_0x38e6('0x41')]=[{'all':!![]}];}_0x49a021=_[_0x38e6('0x3d')]({},_0x49a021,_0x1904b5[_0x38e6('0x3f')]);return db[_0x38e6('0x2a')][_0x38e6('0x46')](_0x49a021)[_0x38e6('0x1f')](handleEntityNotFound(_0x295e5c,null))[_0x38e6('0x1f')](respondWithResult(_0x295e5c,null))['catch'](handleError(_0x295e5c,null));};exports['create']=function(_0x447808,_0x5d1e7b){return db[_0x38e6('0x2a')][_0x38e6('0x47')](_0x447808['body'],{})['then'](function(_0x3ffa84){var _0x358baa=_0x447808['user'][_0x38e6('0x21')]({'plain':!![]});if(!_0x358baa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x358baa['role']===_0x38e6('0x48')){var _0x432179=_0x3ffa84[_0x38e6('0x21')]({'plain':!![]});var _0x1b6291=_0x38e6('0x22');return db['UserProfileSection'][_0x38e6('0x46')]({'where':{'name':_0x1b6291,'userProfileId':_0x358baa[_0x38e6('0x49')]},'raw':!![]})[_0x38e6('0x1f')](function(_0x957a2a){if(_0x957a2a&&_0x957a2a[_0x38e6('0x4a')]===0x0){return db[_0x38e6('0x23')][_0x38e6('0x47')]({'name':_0x432179['name'],'resourceId':_0x432179['id'],'type':_0x957a2a['name'],'sectionId':_0x957a2a['id']},{})['then'](function(){return _0x3ffa84;});}else{return _0x3ffa84;}})[_0x38e6('0x44')](function(_0x3cdcbd){logger['error'](_0x38e6('0x4b'),_0x3cdcbd);throw _0x3cdcbd;});}return _0x3ffa84;})[_0x38e6('0x1f')](respondWithResult(_0x5d1e7b,0xc9))[_0x38e6('0x44')](handleError(_0x5d1e7b,null));};exports[_0x38e6('0x1e')]=function(_0x38590e,_0x34ab19){if(_0x38590e[_0x38e6('0x4c')]['id']){delete _0x38590e[_0x38e6('0x4c')]['id'];}return db[_0x38e6('0x2a')][_0x38e6('0x46')]({'where':{'id':_0x38590e['params']['id']}})[_0x38e6('0x1f')](handleEntityNotFound(_0x34ab19,null))[_0x38e6('0x1f')](saveUpdates(_0x38590e[_0x38e6('0x4c')],null))[_0x38e6('0x1f')](respondWithResult(_0x34ab19,null))[_0x38e6('0x44')](handleError(_0x34ab19,null));};exports[_0x38e6('0x20')]=function(_0x1175e0,_0x503418){return db[_0x38e6('0x2a')][_0x38e6('0x46')]({'where':{'id':_0x1175e0[_0x38e6('0x45')]['id']}})[_0x38e6('0x1f')](handleEntityNotFound(_0x503418,null))['then'](removeEntity(_0x503418,null))['catch'](handleError(_0x503418,null));};
\ No newline at end of file
+var _0x867f=['../../config/logger','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','ChanSpies','UserProfileResource','then','end','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xe142c,_0xfd9ada){var _0xd3880a=function(_0x1c86a4){while(--_0x1c86a4){_0xe142c['push'](_0xe142c['shift']());}};_0xd3880a(++_0xfd9ada);}(_0x867f,0xe6));var _0xf867=function(_0x506ff5,_0x16d10f){_0x506ff5=_0x506ff5-0x0;var _0x2bd51b=_0x867f[_0x506ff5];return _0x2bd51b;};'use strict';var emlformat=require(_0xf867('0x0'));var rimraf=require(_0xf867('0x1'));var zipdir=require(_0xf867('0x2'));var jsonpatch=require(_0xf867('0x3'));var rp=require(_0xf867('0x4'));var moment=require(_0xf867('0x5'));var BPromise=require(_0xf867('0x6'));var Mustache=require(_0xf867('0x7'));var util=require(_0xf867('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf867('0x9'));var ejs=require(_0xf867('0xa'));var fs=require('fs');var fs_extra=require(_0xf867('0xb'));var _=require(_0xf867('0xc'));var squel=require(_0xf867('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf867('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf867('0xf'));var Papa=require(_0xf867('0x10'));var Redis=require(_0xf867('0x11'));var authService=require(_0xf867('0x12'));var qs=require(_0xf867('0x13'));var as=require(_0xf867('0x14'));var hardwareService=require(_0xf867('0x15'));var logger=require(_0xf867('0x16'))('api');var utils=require(_0xf867('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf867('0x18'))['db'];function respondWithStatusCode(_0x1792ae,_0x20fe34){_0x20fe34=_0x20fe34||0xcc;return function(_0x56740c){if(_0x56740c){return _0x1792ae['sendStatus'](_0x20fe34);}return _0x1792ae[_0xf867('0x19')](_0x20fe34)['end']();};}function respondWithResult(_0x352f0b,_0x49ff40){_0x49ff40=_0x49ff40||0xc8;return function(_0x48ff28){if(_0x48ff28){return _0x352f0b[_0xf867('0x19')](_0x49ff40)[_0xf867('0x1a')](_0x48ff28);}};}function respondWithFilteredResult(_0x7a143e,_0x13973b){return function(_0x38fed9){if(_0x38fed9){var _0x1e5161=typeof _0x13973b[_0xf867('0x1b')]===_0xf867('0x1c')&&typeof _0x13973b[_0xf867('0x1d')]==='undefined';var _0x44f6f1=_0x38fed9['count'];var _0x39f9e8=_0x1e5161?0x0:_0x13973b['offset'];var _0x51bdb3=_0x1e5161?_0x38fed9[_0xf867('0x1e')]:_0x13973b['offset']+_0x13973b['limit'];var _0x2092af;if(_0x51bdb3>=_0x44f6f1){_0x51bdb3=_0x44f6f1;_0x2092af=0xc8;}else{_0x2092af=0xce;}_0x7a143e[_0xf867('0x19')](_0x2092af);return _0x7a143e['set']('Content-Range',_0x39f9e8+'-'+_0x51bdb3+'/'+_0x44f6f1)[_0xf867('0x1a')](_0x38fed9);}return null;};}function patchUpdates(_0x23e7dd){return function(_0x1456ce){try{jsonpatch[_0xf867('0x1f')](_0x1456ce,_0x23e7dd,!![]);}catch(_0x419f75){return BPromise[_0xf867('0x20')](_0x419f75);}return _0x1456ce[_0xf867('0x21')]();};}function saveUpdates(_0x34db74,_0x586a25){return function(_0x568aba){if(_0x568aba){return _0x568aba[_0xf867('0x22')](_0x34db74)['then'](function(_0x3072b7){return _0x3072b7;});}return null;};}function removeEntity(_0x3fc971,_0x4da34b){return function(_0x419b6f){if(_0x419b6f){return _0x419b6f[_0xf867('0x23')]()['then'](function(){var _0x231076=_0x419b6f[_0xf867('0x24')]({'plain':!![]});var _0x167e70=_0xf867('0x25');return db[_0xf867('0x26')][_0xf867('0x23')]({'where':{'type':_0x167e70,'resourceId':_0x231076['id']}})[_0xf867('0x27')](function(){return _0x419b6f;});})[_0xf867('0x27')](function(){_0x3fc971[_0xf867('0x19')](0xcc)[_0xf867('0x28')]();});}};}function handleEntityNotFound(_0x28b44a,_0x1f8aa1){return function(_0xa40271){if(!_0xa40271){_0x28b44a[_0xf867('0x29')](0x194);}return _0xa40271;};}function handleError(_0x327a13,_0x3ed616){_0x3ed616=_0x3ed616||0x1f4;return function(_0x57bf28){logger[_0xf867('0x2a')](_0x57bf28[_0xf867('0x2b')]);if(_0x57bf28[_0xf867('0x2c')]){delete _0x57bf28[_0xf867('0x2c')];}_0x327a13[_0xf867('0x19')](_0x3ed616)[_0xf867('0x2d')](_0x57bf28);};}exports[_0xf867('0x2e')]=function(_0x517b9c,_0x44ddd4){var _0x3e076c={},_0x216716={},_0x36ed62={'count':0x0,'rows':[]};var _0x40517f=_[_0xf867('0x2f')](db[_0xf867('0x30')][_0xf867('0x31')],function(_0x4ffce9){return{'name':_0x4ffce9[_0xf867('0x32')],'type':_0x4ffce9['type'][_0xf867('0x33')]};});_0x216716['model']=_[_0xf867('0x2f')](_0x40517f,_0xf867('0x2c'));_0x216716[_0xf867('0x34')]=_['keys'](_0x517b9c[_0xf867('0x34')]);_0x216716[_0xf867('0x35')]=_['intersection'](_0x216716['model'],_0x216716[_0xf867('0x34')]);_0x3e076c['attributes']=_[_0xf867('0x36')](_0x216716[_0xf867('0x37')],qs[_0xf867('0x38')](_0x517b9c[_0xf867('0x34')]['fields']));_0x3e076c['attributes']=_0x3e076c[_0xf867('0x39')][_0xf867('0x3a')]?_0x3e076c[_0xf867('0x39')]:_0x216716['model'];if(!_0x517b9c[_0xf867('0x34')][_0xf867('0x3b')]('nolimit')){_0x3e076c[_0xf867('0x1d')]=qs['limit'](_0x517b9c[_0xf867('0x34')][_0xf867('0x1d')]);_0x3e076c[_0xf867('0x1b')]=qs['offset'](_0x517b9c[_0xf867('0x34')]['offset']);}_0x3e076c[_0xf867('0x3c')]=qs[_0xf867('0x3d')](_0x517b9c[_0xf867('0x34')][_0xf867('0x3d')]);_0x3e076c[_0xf867('0x3e')]=qs[_0xf867('0x35')](_[_0xf867('0x3f')](_0x517b9c[_0xf867('0x34')],_0x216716['filters']),_0x40517f);if(_0x517b9c['query'][_0xf867('0x40')]){_0x3e076c[_0xf867('0x3e')]=_[_0xf867('0x41')](_0x3e076c[_0xf867('0x3e')],{'$or':_[_0xf867('0x2f')](_0x40517f,function(_0x462df6){if(_0x462df6[_0xf867('0x42')]!=='VIRTUAL'){var _0x4513e1={};_0x4513e1[_0x462df6[_0xf867('0x2c')]]={'$like':'%'+_0x517b9c[_0xf867('0x34')][_0xf867('0x40')]+'%'};return _0x4513e1;}})});}_0x3e076c=_[_0xf867('0x41')]({},_0x3e076c,_0x517b9c[_0xf867('0x43')]);var _0x419b34={'where':_0x3e076c[_0xf867('0x3e')]};return db[_0xf867('0x30')]['count'](_0x419b34)[_0xf867('0x27')](function(_0x4e31d8){_0x36ed62[_0xf867('0x1e')]=_0x4e31d8;if(_0x517b9c[_0xf867('0x34')][_0xf867('0x44')]){_0x3e076c['include']=[{'all':!![]}];}return db[_0xf867('0x30')][_0xf867('0x45')](_0x3e076c);})[_0xf867('0x27')](function(_0xed868d){_0x36ed62[_0xf867('0x46')]=_0xed868d;return _0x36ed62;})[_0xf867('0x27')](respondWithFilteredResult(_0x44ddd4,_0x3e076c))['catch'](handleError(_0x44ddd4,null));};exports[_0xf867('0x47')]=function(_0x2d02f8,_0x1d5dad){var _0x20ec01={'raw':![],'where':{'id':_0x2d02f8['params']['id']}},_0x3b8929={};_0x3b8929[_0xf867('0x37')]=_['keys'](db[_0xf867('0x30')][_0xf867('0x31')]);_0x3b8929['query']=_[_0xf867('0x48')](_0x2d02f8[_0xf867('0x34')]);_0x3b8929[_0xf867('0x35')]=_[_0xf867('0x36')](_0x3b8929[_0xf867('0x37')],_0x3b8929[_0xf867('0x34')]);_0x20ec01['attributes']=_[_0xf867('0x36')](_0x3b8929['model'],qs[_0xf867('0x38')](_0x2d02f8[_0xf867('0x34')][_0xf867('0x38')]));_0x20ec01[_0xf867('0x39')]=_0x20ec01[_0xf867('0x39')][_0xf867('0x3a')]?_0x20ec01[_0xf867('0x39')]:_0x3b8929['model'];if(_0x2d02f8['query'][_0xf867('0x44')]){_0x20ec01[_0xf867('0x49')]=[{'all':!![]}];}_0x20ec01=_[_0xf867('0x41')]({},_0x20ec01,_0x2d02f8['options']);return db[_0xf867('0x30')][_0xf867('0x4a')](_0x20ec01)[_0xf867('0x27')](handleEntityNotFound(_0x1d5dad,null))['then'](respondWithResult(_0x1d5dad,null))[_0xf867('0x4b')](handleError(_0x1d5dad,null));};exports['create']=function(_0xc01c03,_0x2d56c0){return db[_0xf867('0x30')][_0xf867('0x4c')](_0xc01c03[_0xf867('0x4d')],{})[_0xf867('0x27')](function(_0x422b28){var _0x1b6253=_0xc01c03['user']['get']({'plain':!![]});if(!_0x1b6253)throw new Error(_0xf867('0x4e'));if(_0x1b6253[_0xf867('0x4f')]===_0xf867('0x50')){var _0x199ce0=_0x422b28[_0xf867('0x24')]({'plain':!![]});var _0x42990f=_0xf867('0x25');return db['UserProfileSection'][_0xf867('0x4a')]({'where':{'name':_0x42990f,'userProfileId':_0x1b6253[_0xf867('0x51')]},'raw':!![]})[_0xf867('0x27')](function(_0x357bc4){if(_0x357bc4&&_0x357bc4['autoAssociation']===0x0){return db[_0xf867('0x26')][_0xf867('0x4c')]({'name':_0x199ce0['name'],'resourceId':_0x199ce0['id'],'type':_0x357bc4['name'],'sectionId':_0x357bc4['id']},{})['then'](function(){return _0x422b28;});}else{return _0x422b28;}})[_0xf867('0x4b')](function(_0x347273){logger['error'](_0xf867('0x52'),_0x347273);throw _0x347273;});}return _0x422b28;})[_0xf867('0x27')](respondWithResult(_0x2d56c0,0xc9))['catch'](handleError(_0x2d56c0,null));};exports[_0xf867('0x22')]=function(_0x3041cf,_0x59d460){if(_0x3041cf[_0xf867('0x4d')]['id']){delete _0x3041cf[_0xf867('0x4d')]['id'];}return db[_0xf867('0x30')][_0xf867('0x4a')]({'where':{'id':_0x3041cf[_0xf867('0x53')]['id']}})['then'](handleEntityNotFound(_0x59d460,null))['then'](saveUpdates(_0x3041cf[_0xf867('0x4d')],null))[_0xf867('0x27')](respondWithResult(_0x59d460,null))[_0xf867('0x4b')](handleError(_0x59d460,null));};exports[_0xf867('0x23')]=function(_0x3afdc9,_0x44229e){return db['VoiceChanSpy'][_0xf867('0x4a')]({'where':{'id':_0x3afdc9[_0xf867('0x53')]['id']}})[_0xf867('0x27')](handleEntityNotFound(_0x44229e,null))[_0xf867('0x27')](removeEntity(_0x44229e,null))[_0xf867('0x4b')](handleError(_0x44229e,null));};
\ No newline at end of file
index 40149f9..f3b0688 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cf2=['voice_chanspy','bulkCreate','catch','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','Set','chanspy','record','merge','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','then','define','VoiceChanSpy'];(function(_0x25b878,_0x3ffd56){var _0x31386a=function(_0x26d808){while(--_0x26d808){_0x25b878['push'](_0x25b878['shift']());}};_0x31386a(++_0x3ffd56);}(_0x6cf2,0x191));var _0x26cf=function(_0x1e1ee2,_0x4c03fa){_0x1e1ee2=_0x1e1ee2-0x0;var _0x2e8cb2=_0x6cf2[_0x1e1ee2];return _0x2e8cb2;};'use strict';var _=require(_0x26cf('0x0'));var util=require(_0x26cf('0x1'));var BPromise=require(_0x26cf('0x2'));var attributes=require(_0x26cf('0x3'));var getUserApplications=function(_0x5ccc18,_0x1fd29d,_0x2b4a67){var _0x5dbddc=0x1;var _0x130b78=[];var _0x2b43b4={'context':_0x1fd29d[_0x26cf('0x4')]||'from-sip','exten':util[_0x26cf('0x5')](_0x26cf('0x6'),_0x5ccc18[_0x26cf('0x7')],_0x2b4a67),'type':_0x26cf('0x8'),'isApp':![],'ChanSpyId':_0x5ccc18['id'],'UserId':_0x1fd29d['id']};_0x130b78[_0x26cf('0x9')](_['merge']({'app':_0x26cf('0xa'),'appdata':util[_0x26cf('0x5')]('CDR(type)=%s',_0x26cf('0xb')),'priority':_0x5dbddc++},_0x2b43b4));if(_0x5ccc18[_0x26cf('0xc')]){_0x130b78[_0x26cf('0x9')](_[_0x26cf('0xd')]({'app':'MixMonitor','appdata':util[_0x26cf('0x5')]('${UNIQUEID}.%s,a',_0x5ccc18['recordingFormat']),'priority':_0x5dbddc++},_0x2b43b4));}if(_0x5ccc18[_0x26cf('0xe')]){_0x130b78[_0x26cf('0x9')](_[_0x26cf('0xd')]({'app':_0x26cf('0xf'),'appdata':_0x5ccc18[_0x26cf('0x10')],'priority':_0x5dbddc++},_0x2b43b4));}_0x130b78[_0x26cf('0x9')](_[_0x26cf('0xd')]({'app':_0x26cf('0x11'),'appdata':util[_0x26cf('0x5')](_0x26cf('0x12'),_0x1fd29d[_0x26cf('0x13')],_0x5ccc18[_0x26cf('0x14')]?_0x5ccc18[_0x26cf('0x14')]['join'](''):''),'priority':_0x5dbddc++},_0x2b43b4));if(_0x5ccc18['record']){_0x130b78[_0x26cf('0x9')](_[_0x26cf('0xd')]({'app':_0x26cf('0x15'),'priority':_0x5dbddc++},_0x2b43b4));}return _0x130b78;};var getChanSpyApplications=function(_0x2b068b,_0x572558){var _0x4b28b7=[];for(var _0x5b7204=0x0,_0x317c96=0x1;_0x5b7204<_0x572558[_0x26cf('0x16')];_0x5b7204++,_0x317c96=0x1){_0x4b28b7=_0x4b28b7[_0x26cf('0x17')](getUserApplications(_0x2b068b,_0x572558[_0x5b7204],_0x572558[_0x5b7204][_0x26cf('0x18')]));if(_0x572558[_0x5b7204][_0x26cf('0x18')]!=_0x572558[_0x5b7204][_0x26cf('0x13')]){_0x4b28b7=_0x4b28b7[_0x26cf('0x17')](getUserApplications(_0x2b068b,_0x572558[_0x5b7204],_0x572558[_0x5b7204][_0x26cf('0x13')]));}}return _0x4b28b7;};var getChanSpyPromise=function(_0x58c0e8,_0x158c1b){return new BPromise(function(_0x2cd032,_0x21db90){return _0x58c0e8[_0x26cf('0x19')][_0x26cf('0x1a')]({'attributes':['id',_0x26cf('0x13'),_0x26cf('0x18')],'where':{'role':_0x26cf('0x1b'),'chanspy':!![]},'raw':!![]})[_0x26cf('0x1c')](function(_0x52c8f7){if(_0x52c8f7){return _0x2cd032(getChanSpyApplications(_0x158c1b,_0x52c8f7));}return _0x2cd032([]);})['catch'](function(_0x4274c1){_0x21db90(_0x4274c1);});});};module['exports']=function(_0x58056b,_0x3ff869){var _0x3d1796=_0x58056b['models'];return _0x58056b[_0x26cf('0x1d')](_0x26cf('0x1e'),attributes,{'tableName':_0x26cf('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x6b6e39,_0x96845,_0x398d31){return getChanSpyPromise(_0x3d1796,_0x6b6e39)[_0x26cf('0x1c')](function(_0x1fd307){if(_0x1fd307&&_0x1fd307[_0x26cf('0x16')]){return _0x3d1796['VoiceExtension'][_0x26cf('0x20')](_0x1fd307);}})['then'](function(){_0x398d31();})[_0x26cf('0x21')](function(_0x31e807){_0x398d31(_0x31e807);});},'afterUpdate':function(_0x3c5d9c,_0x30bd66,_0x58c04d){return _0x3d1796[_0x26cf('0x22')]['destroy']({'where':{'ChanSpyId':_0x3c5d9c['id']}})[_0x26cf('0x1c')](function(){return getChanSpyPromise(_0x3d1796,_0x3c5d9c);})[_0x26cf('0x1c')](function(_0x2931c1){if(_0x2931c1&&_0x2931c1['length']){return _0x3d1796[_0x26cf('0x22')][_0x26cf('0x20')](_0x2931c1);}})[_0x26cf('0x1c')](function(){_0x58c04d();})[_0x26cf('0x21')](function(_0x292c28){_0x58c04d(_0x292c28);});},'afterDestroy':function(_0x4fdeb8,_0x2f0f61,_0x570b22){return _0x3d1796['VoiceExtension'][_0x26cf('0x23')]({'where':{'ChanSpyId':_0x4fdeb8['id']}})[_0x26cf('0x1c')](function(){_0x570b22();})[_0x26cf('0x21')](function(_0x26f44d){_0x570b22(_0x26f44d);});}}});};
\ No newline at end of file
+var _0x4ce8=['join','concat','internal','name','User','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','options'];(function(_0x1b6b1c,_0x2f0ad7){var _0x368946=function(_0x26c19f){while(--_0x26c19f){_0x1b6b1c['push'](_0x1b6b1c['shift']());}};_0x368946(++_0x2f0ad7);}(_0x4ce8,0x1be));var _0x84ce=function(_0x1790d2,_0x427e8d){_0x1790d2=_0x1790d2-0x0;var _0x2ceeda=_0x4ce8[_0x1790d2];return _0x2ceeda;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x84ce('0x0'));var attributes=require(_0x84ce('0x1'));var getUserApplications=function(_0x515e8e,_0x9c6957,_0x347392){var _0x294df4=0x1;var _0x404840=[];var _0x43ebc7={'context':_0x9c6957[_0x84ce('0x2')]||_0x84ce('0x3'),'exten':util[_0x84ce('0x4')](_0x84ce('0x5'),_0x515e8e[_0x84ce('0x6')],_0x347392),'type':_0x84ce('0x7'),'isApp':![],'ChanSpyId':_0x515e8e['id'],'UserId':_0x9c6957['id']};_0x404840[_0x84ce('0x8')](_[_0x84ce('0x9')]({'app':_0x84ce('0xa'),'appdata':util['format'](_0x84ce('0xb'),_0x84ce('0xc')),'priority':_0x294df4++},_0x43ebc7));if(_0x515e8e[_0x84ce('0xd')]){_0x404840[_0x84ce('0x8')](_[_0x84ce('0x9')]({'app':_0x84ce('0xe'),'appdata':util[_0x84ce('0x4')](_0x84ce('0xf'),_0x515e8e[_0x84ce('0x10')]),'priority':_0x294df4++},_0x43ebc7));}if(_0x515e8e[_0x84ce('0x11')]){_0x404840['push'](_[_0x84ce('0x9')]({'app':_0x84ce('0x12'),'appdata':_0x515e8e[_0x84ce('0x13')],'priority':_0x294df4++},_0x43ebc7));}_0x404840[_0x84ce('0x8')](_[_0x84ce('0x9')]({'app':_0x84ce('0x14'),'appdata':util[_0x84ce('0x4')]('SIP/%s,%s',_0x9c6957['name'],_0x515e8e[_0x84ce('0x15')]?_0x515e8e[_0x84ce('0x15')][_0x84ce('0x16')](''):''),'priority':_0x294df4++},_0x43ebc7));if(_0x515e8e[_0x84ce('0xd')]){_0x404840[_0x84ce('0x8')](_['merge']({'app':'StopMixMonitor','priority':_0x294df4++},_0x43ebc7));}return _0x404840;};var getChanSpyApplications=function(_0x39089c,_0x2579d8){var _0x4f500e=[];for(var _0x427171=0x0,_0x562bfb=0x1;_0x427171<_0x2579d8['length'];_0x427171++,_0x562bfb=0x1){_0x4f500e=_0x4f500e[_0x84ce('0x17')](getUserApplications(_0x39089c,_0x2579d8[_0x427171],_0x2579d8[_0x427171]['internal']));if(_0x2579d8[_0x427171][_0x84ce('0x18')]!=_0x2579d8[_0x427171][_0x84ce('0x19')]){_0x4f500e=_0x4f500e['concat'](getUserApplications(_0x39089c,_0x2579d8[_0x427171],_0x2579d8[_0x427171][_0x84ce('0x19')]));}}return _0x4f500e;};var getChanSpyPromise=function(_0x14cdcb,_0x24e7c8){return new BPromise(function(_0x46cf58,_0x279a2d){return _0x14cdcb[_0x84ce('0x1a')][_0x84ce('0x1b')]({'attributes':['id','name',_0x84ce('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x84ce('0x1c')](function(_0x51cd9d){if(_0x51cd9d){return _0x46cf58(getChanSpyApplications(_0x24e7c8,_0x51cd9d));}return _0x46cf58([]);})[_0x84ce('0x1d')](function(_0x1a5379){_0x279a2d(_0x1a5379);});});};module[_0x84ce('0x1e')]=function(_0x148b4d,_0x42c558){var _0x520114=_0x148b4d[_0x84ce('0x1f')];return _0x148b4d[_0x84ce('0x20')](_0x84ce('0x21'),attributes,{'tableName':_0x84ce('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x599071,_0x1fed8c,_0x2e3b54){return getChanSpyPromise(_0x520114,_0x599071)[_0x84ce('0x1c')](function(_0x3ea136){if(_0x3ea136&&_0x3ea136[_0x84ce('0x23')]){return _0x520114[_0x84ce('0x24')][_0x84ce('0x25')](_0x3ea136);}})['then'](function(){_0x2e3b54();})[_0x84ce('0x1d')](function(_0x30d46a){_0x2e3b54(_0x30d46a);});},'afterUpdate':function(_0x4b9142,_0x5ab426,_0x7cb653){return _0x520114[_0x84ce('0x24')]['destroy']({'where':{'ChanSpyId':_0x4b9142['id']}})['then'](function(){return getChanSpyPromise(_0x520114,_0x4b9142);})['then'](function(_0x3562ea){if(_0x3562ea&&_0x3562ea[_0x84ce('0x23')]){return _0x520114[_0x84ce('0x24')][_0x84ce('0x25')](_0x3562ea);}})[_0x84ce('0x1c')](function(){_0x7cb653();})[_0x84ce('0x1d')](function(_0x25136b){_0x7cb653(_0x25136b);});},'afterDestroy':function(_0x1e6e6b,_0x44f704,_0x2b15b3){return _0x520114['VoiceExtension'][_0x84ce('0x26')]({'where':{'ChanSpyId':_0x1e6e6b['id']}})[_0x84ce('0x1c')](function(){_0x2b15b3();})['catch'](function(_0x47145d){_0x2b15b3(_0x47145d);});}}});};
\ No newline at end of file
index 28658ae..8c86bca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0565=['client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','message','error','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4d01cd,_0x3fd1d8){var _0x4cbe1e=function(_0x41b947){while(--_0x41b947){_0x4d01cd['push'](_0x4d01cd['shift']());}};_0x4cbe1e(++_0x3fd1d8);}(_0x0565,0xf2));var _0x5056=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x0565[_0x369151];return _0x4292d5;};'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']('VoiceChanSpy,\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);});});}
\ No newline at end of file
+var _0x4ea3=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x4ea3,0x70));var _0x34ea=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4ea3[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});}
\ No newline at end of file
index fce4f28..43d3678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb66=['./voiceContext.controller','get','isAuthenticated','index','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xeb66,0x14e));var _0x6eb6=function(_0x3043d9,_0x2a7124){_0x3043d9=_0x3043d9-0x0;var _0x139c25=_0xeb66[_0x3043d9];return _0x139c25;};'use strict';var multer=require(_0x6eb6('0x0'));var util=require(_0x6eb6('0x1'));var path=require(_0x6eb6('0x2'));var timeout=require(_0x6eb6('0x3'));var express=require(_0x6eb6('0x4'));var router=express['Router']();var fs_extra=require(_0x6eb6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6eb6('0x6'));var config=require(_0x6eb6('0x7'));var controller=require(_0x6eb6('0x8'));router[_0x6eb6('0x9')]('/',auth[_0x6eb6('0xa')](),controller[_0x6eb6('0xb')]);router[_0x6eb6('0x9')]('/:id',auth[_0x6eb6('0xa')](),controller['show']);router[_0x6eb6('0xc')]('/',auth[_0x6eb6('0xa')](),controller[_0x6eb6('0xd')]);router[_0x6eb6('0xe')](_0x6eb6('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6eb6('0x10')](_0x6eb6('0xf'),auth[_0x6eb6('0xa')](),controller[_0x6eb6('0x11')]);module[_0x6eb6('0x12')]=router;
\ No newline at end of file
+var _0xc8c8=['connect-timeout','express','fs-extra','../../components/interaction/service','./voiceContext.controller','get','index','/:id','post','create','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc8c8,0x12e));var _0x8c8c=function(_0x328b69,_0x1ff8f6){_0x328b69=_0x328b69-0x0;var _0x39a84d=_0xc8c8[_0x328b69];return _0x39a84d;};'use strict';var multer=require(_0x8c8c('0x0'));var util=require(_0x8c8c('0x1'));var path=require('path');var timeout=require(_0x8c8c('0x2'));var express=require(_0x8c8c('0x3'));var router=express['Router']();var fs_extra=require(_0x8c8c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8c8c('0x5'));var config=require('../../config/environment');var controller=require(_0x8c8c('0x6'));router[_0x8c8c('0x7')]('/',auth['isAuthenticated'](),controller[_0x8c8c('0x8')]);router[_0x8c8c('0x7')](_0x8c8c('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8c8c('0xa')]('/',auth['isAuthenticated'](),controller[_0x8c8c('0xb')]);router['put'](_0x8c8c('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x8c8c('0xc')](_0x8c8c('0x9'),auth[_0x8c8c('0xd')](),controller[_0x8c8c('0xe')]);module[_0x8c8c('0xf')]=router;
\ No newline at end of file
index ff7122b..a08e460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb923=['exports','STRING','BOOLEAN','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb923,0x12f));var _0x3b92=function(_0x47e0d0,_0x5cac47){_0x47e0d0=_0x47e0d0-0x0;var _0x88b240=_0xb923[_0x47e0d0];return _0x88b240;};'use strict';var Sequelize=require(_0x3b92('0x0'));module[_0x3b92('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x3b92('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x3b92('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2dd8=['exports','name','STRING','BOOLEAN'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x2dd8,0xdc));var _0x82dd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2dd8[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x82dd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x82dd('0x1')},'description':{'type':Sequelize[_0x82dd('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x82dd('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 7d894a2..bbc5c22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5292=['error','code','message','info','catch','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','name','send','map','VoiceContext','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','show','params','includeAll','create','readFileSync','root','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','join','utf8','writeFileSync','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x479bf6,_0x51c2ed){var _0x16e49b=function(_0x1bab10){while(--_0x1bab10){_0x479bf6['push'](_0x479bf6['shift']());}};_0x16e49b(++_0x51c2ed);}(_0x5292,0xa4));var _0x2529=function(_0x2157ab,_0x379b9d){_0x2157ab=_0x2157ab-0x0;var _0x4d1011=_0x5292[_0x2157ab];return _0x4d1011;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2529('0x0'));var zipdir=require(_0x2529('0x1'));var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2529('0x4'));var util=require(_0x2529('0x5'));var path=require(_0x2529('0x6'));var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require(_0x2529('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x9'));var squel=require(_0x2529('0xa'));var crypto=require(_0x2529('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2529('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2529('0xd'));var qs=require(_0x2529('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2529('0xf'))(_0x2529('0x10'));var utils=require(_0x2529('0x11'));var config=require(_0x2529('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x2529('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2529('0x14')][_0x2529('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x555f12,_0x26e79d,_0x40b964,_0x1b3167){return new BPromise(function(_0x5b1264,_0x50af89){var _0x8bb33b=_0x1b3167||client;return _0x8bb33b[_0x2529('0x16')](_0x555f12,_0x40b964)[_0x2529('0x17')](function(_0x359236){logger['info'](_0x2529('0x18'),_0x26e79d,_0x2529('0x19'));logger[_0x2529('0x1a')](_0x2529('0x1b'),_0x26e79d,'request\x20sent',JSON['stringify'](_0x359236));if(_0x359236[_0x2529('0x1c')]){if(_0x359236['error'][_0x2529('0x1d')]===0x1f4){logger[_0x2529('0x1c')](_0x2529('0x18'),_0x26e79d,_0x359236[_0x2529('0x1c')]['message']);return _0x50af89(_0x359236[_0x2529('0x1c')]['message']);}logger[_0x2529('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x26e79d,_0x359236[_0x2529('0x1c')][_0x2529('0x1e')]);return _0x5b1264(_0x359236[_0x2529('0x1c')][_0x2529('0x1e')]);}else{logger[_0x2529('0x1f')](_0x2529('0x18'),_0x26e79d,'request\x20sent');_0x5b1264(_0x359236['result'][_0x2529('0x1e')]);}})[_0x2529('0x20')](function(_0x30ac5f){logger[_0x2529('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x26e79d,_0x30ac5f);_0x50af89(_0x30ac5f);});});}function respondWithStatusCode(_0x211beb,_0x595f04){_0x595f04=_0x595f04||0xcc;return function(_0x4d82ae){if(_0x4d82ae){return _0x211beb['sendStatus'](_0x595f04);}return _0x211beb['status'](_0x595f04)[_0x2529('0x21')]();};}function respondWithResult(_0x3101ac,_0x3d7134){_0x3d7134=_0x3d7134||0xc8;return function(_0x18ed5c){if(_0x18ed5c){return _0x3101ac['status'](_0x3d7134)[_0x2529('0x22')](_0x18ed5c);}};}function respondWithFilteredResult(_0x5cc410,_0x1250d0){return function(_0xd3fa5b){if(_0xd3fa5b){var _0x133a22=typeof _0x1250d0[_0x2529('0x23')]===_0x2529('0x24')&&typeof _0x1250d0[_0x2529('0x25')]===_0x2529('0x24');var _0x3dd62d=_0xd3fa5b['count'];var _0x57bce3=_0x133a22?0x0:_0x1250d0[_0x2529('0x23')];var _0x159376=_0x133a22?_0xd3fa5b[_0x2529('0x26')]:_0x1250d0[_0x2529('0x23')]+_0x1250d0[_0x2529('0x25')];var _0x5e4bd1;if(_0x159376>=_0x3dd62d){_0x159376=_0x3dd62d;_0x5e4bd1=0xc8;}else{_0x5e4bd1=0xce;}_0x5cc410[_0x2529('0x27')](_0x5e4bd1);return _0x5cc410[_0x2529('0x28')](_0x2529('0x29'),_0x57bce3+'-'+_0x159376+'/'+_0x3dd62d)[_0x2529('0x22')](_0xd3fa5b);}return null;};}function patchUpdates(_0x12a620){return function(_0x6d4f7c){try{jsonpatch[_0x2529('0x2a')](_0x6d4f7c,_0x12a620,!![]);}catch(_0x5ca9ea){return BPromise[_0x2529('0x2b')](_0x5ca9ea);}return _0x6d4f7c[_0x2529('0x2c')]();};}function saveUpdates(_0x2441d6,_0x407b22){return function(_0x1332fe){if(_0x1332fe){return _0x1332fe[_0x2529('0x2d')](_0x2441d6)[_0x2529('0x17')](function(_0x15ca34){return _0x15ca34;});}return null;};}function removeEntity(_0x26c99f,_0x39889a){return function(_0x49da7d){if(_0x49da7d){return _0x49da7d[_0x2529('0x2e')]()['then'](function(){var _0x16667b=_0x49da7d[_0x2529('0x2f')]({'plain':!![]});var _0x55377a=_0x2529('0x30');return db['UserProfileResource'][_0x2529('0x2e')]({'where':{'type':_0x55377a,'resourceId':_0x16667b['id']}})[_0x2529('0x17')](function(){return _0x49da7d;});})['then'](function(){_0x26c99f[_0x2529('0x27')](0xcc)[_0x2529('0x21')]();});}};}function handleEntityNotFound(_0x316399,_0x1e7166){return function(_0x27b8e0){if(!_0x27b8e0){_0x316399['sendStatus'](0x194);}return _0x27b8e0;};}function handleError(_0x53b59f,_0x32e0d8){_0x32e0d8=_0x32e0d8||0x1f4;return function(_0xa2c9b8){logger['error'](_0xa2c9b8['stack']);if(_0xa2c9b8[_0x2529('0x31')]){delete _0xa2c9b8[_0x2529('0x31')];}_0x53b59f[_0x2529('0x27')](_0x32e0d8)[_0x2529('0x32')](_0xa2c9b8);};}exports['index']=function(_0x56ebb9,_0xf1db26){var _0x50e35f={},_0x3bb516={},_0x575c6c={'count':0x0,'rows':[]};var _0xa6e5c2=_[_0x2529('0x33')](db[_0x2529('0x34')][_0x2529('0x35')],function(_0x1c51d2){return{'name':_0x1c51d2['fieldName'],'type':_0x1c51d2[_0x2529('0x36')][_0x2529('0x37')]};});_0x3bb516[_0x2529('0x38')]=_[_0x2529('0x33')](_0xa6e5c2,_0x2529('0x31'));_0x3bb516[_0x2529('0x39')]=_[_0x2529('0x3a')](_0x56ebb9[_0x2529('0x39')]);_0x3bb516[_0x2529('0x3b')]=_[_0x2529('0x3c')](_0x3bb516[_0x2529('0x38')],_0x3bb516['query']);_0x50e35f['attributes']=_['intersection'](_0x3bb516[_0x2529('0x38')],qs[_0x2529('0x3d')](_0x56ebb9[_0x2529('0x39')][_0x2529('0x3d')]));_0x50e35f['attributes']=_0x50e35f['attributes']['length']?_0x50e35f[_0x2529('0x3e')]:_0x3bb516[_0x2529('0x38')];if(!_0x56ebb9['query']['hasOwnProperty'](_0x2529('0x3f'))){_0x50e35f['limit']=qs[_0x2529('0x25')](_0x56ebb9[_0x2529('0x39')][_0x2529('0x25')]);_0x50e35f[_0x2529('0x23')]=qs[_0x2529('0x23')](_0x56ebb9['query'][_0x2529('0x23')]);}_0x50e35f[_0x2529('0x40')]=qs[_0x2529('0x41')](_0x56ebb9[_0x2529('0x39')][_0x2529('0x41')]);_0x50e35f['where']=qs['filters'](_[_0x2529('0x42')](_0x56ebb9['query'],_0x3bb516['filters']),_0xa6e5c2);if(_0x56ebb9[_0x2529('0x39')][_0x2529('0x43')]){_0x50e35f[_0x2529('0x44')]=_['merge'](_0x50e35f[_0x2529('0x44')],{'$or':_[_0x2529('0x33')](_0xa6e5c2,function(_0x58dcd9){if(_0x58dcd9[_0x2529('0x36')]!=='VIRTUAL'){var _0x179359={};_0x179359[_0x58dcd9[_0x2529('0x31')]]={'$like':'%'+_0x56ebb9[_0x2529('0x39')]['filter']+'%'};return _0x179359;}})});}_0x50e35f=_[_0x2529('0x45')]({},_0x50e35f,_0x56ebb9[_0x2529('0x46')]);var _0x282a03={'where':_0x50e35f[_0x2529('0x44')]};return db[_0x2529('0x34')][_0x2529('0x26')](_0x282a03)[_0x2529('0x17')](function(_0x15c28d){_0x575c6c[_0x2529('0x26')]=_0x15c28d;if(_0x56ebb9['query']['includeAll']){_0x50e35f[_0x2529('0x47')]=[{'all':!![]}];}return db[_0x2529('0x34')][_0x2529('0x48')](_0x50e35f);})[_0x2529('0x17')](function(_0xb5fc95){_0x575c6c[_0x2529('0x49')]=_0xb5fc95;return _0x575c6c;})[_0x2529('0x17')](respondWithFilteredResult(_0xf1db26,_0x50e35f))[_0x2529('0x20')](handleError(_0xf1db26,null));};exports[_0x2529('0x4a')]=function(_0x50c37d,_0x396d1b){var _0x34db81={'raw':![],'where':{'id':_0x50c37d[_0x2529('0x4b')]['id']}},_0x561c6d={};_0x561c6d[_0x2529('0x38')]=_[_0x2529('0x3a')](db['VoiceContext'][_0x2529('0x35')]);_0x561c6d[_0x2529('0x39')]=_['keys'](_0x50c37d['query']);_0x561c6d[_0x2529('0x3b')]=_[_0x2529('0x3c')](_0x561c6d['model'],_0x561c6d['query']);_0x34db81[_0x2529('0x3e')]=_[_0x2529('0x3c')](_0x561c6d[_0x2529('0x38')],qs['fields'](_0x50c37d[_0x2529('0x39')][_0x2529('0x3d')]));_0x34db81['attributes']=_0x34db81[_0x2529('0x3e')]['length']?_0x34db81[_0x2529('0x3e')]:_0x561c6d['model'];if(_0x50c37d['query'][_0x2529('0x4c')]){_0x34db81[_0x2529('0x47')]=[{'all':!![]}];}_0x34db81=_['merge']({},_0x34db81,_0x50c37d[_0x2529('0x46')]);return db[_0x2529('0x34')]['find'](_0x34db81)[_0x2529('0x17')](handleEntityNotFound(_0x396d1b,null))[_0x2529('0x17')](respondWithResult(_0x396d1b,null))[_0x2529('0x20')](handleError(_0x396d1b,null));};exports['create']=function(_0x2b24ae,_0x7fb6ce,_0x239d35){var _0x10a807;return db[_0x2529('0x34')][_0x2529('0x4d')](_0x2b24ae['body'],{'raw':!![]})[_0x2529('0x17')](function(_0x2f6b7d){_0x10a807=_0x2f6b7d;return db[_0x2529('0x34')][_0x2529('0x48')]({'raw':!![]});})[_0x2529('0x17')](function(_0xbab718){var _0x461f89=fs[_0x2529('0x4e')](path['join'](config[_0x2529('0x4f')],_0x2529('0x50')),'utf8');var _0x24d306=ejs[_0x2529('0x51')](_0x461f89,{'contexts':_0xbab718||[]});fs['writeFileSync'](_0x2529('0x52'),_0x24d306);})[_0x2529('0x17')](function(){return respondWithRpcPromise(_0x2529('0x53'),_0x2529('0x4d'),{'module':_0x2529('0x54')});})[_0x2529('0x17')](function(){var _0x123590=_0x2b24ae[_0x2529('0x55')][_0x2529('0x2f')]({'plain':!![]});if(!_0x123590)throw new Error(_0x2529('0x56'));if(_0x123590[_0x2529('0x57')]===_0x2529('0x55')){var _0x1b4de5=_0x10a807[_0x2529('0x2f')]({'plain':!![]});return db[_0x2529('0x58')][_0x2529('0x59')]({'where':{'name':_0x2529('0x30'),'userProfileId':_0x123590[_0x2529('0x5a')]},'raw':!![]})[_0x2529('0x17')](function(_0x4a72f7){if(_0x4a72f7&&_0x4a72f7[_0x2529('0x5b')]===0x0){return db[_0x2529('0x5c')][_0x2529('0x4d')]({'name':_0x1b4de5[_0x2529('0x31')],'resourceId':_0x1b4de5['id'],'type':_0x4a72f7['name'],'sectionId':_0x4a72f7['id']},{})[_0x2529('0x17')](function(){return _0x10a807;});}else{return _0x10a807;}})['catch'](function(_0x59f940){logger[_0x2529('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59f940);throw _0x59f940;});}return _0x10a807;})[_0x2529('0x17')](respondWithResult(_0x7fb6ce,0xc9))[_0x2529('0x20')](handleError(_0x7fb6ce,null));};exports[_0x2529('0x2d')]=function(_0x573b19,_0x430f96,_0x24692c){var _0x3f2c49;return db[_0x2529('0x34')][_0x2529('0x59')]({'where':{'id':_0x573b19[_0x2529('0x4b')]['id']}})[_0x2529('0x17')](handleEntityNotFound(_0x430f96,null))[_0x2529('0x17')](saveUpdates(_0x573b19['body'],null))[_0x2529('0x17')](function(_0x59f221){if(_0x59f221){_0x3f2c49=_0x59f221;return db[_0x2529('0x34')][_0x2529('0x48')]({'raw':!![]});}})[_0x2529('0x17')](function(_0x5e2470){var _0x135072=fs[_0x2529('0x4e')](path[_0x2529('0x5d')](config[_0x2529('0x4f')],_0x2529('0x50')),_0x2529('0x5e'));var _0x5b84d8=ejs[_0x2529('0x51')](_0x135072,{'contexts':_0x5e2470||[]});fs[_0x2529('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5b84d8);})[_0x2529('0x17')](function(){return respondWithRpcPromise(_0x2529('0x53'),_0x2529('0x2d'),{'module':_0x2529('0x54')});})[_0x2529('0x17')](function(){return _0x3f2c49;})[_0x2529('0x17')](respondWithResult(_0x430f96,null))[_0x2529('0x20')](handleError(_0x430f96,null));};exports[_0x2529('0x2e')]=function(_0x3f23c7,_0x5e886b,_0x276773){var _0x2d09e1;return db[_0x2529('0x34')][_0x2529('0x59')]({'where':{'id':_0x3f23c7[_0x2529('0x4b')]['id']}})[_0x2529('0x17')](handleEntityNotFound(_0x5e886b,null))[_0x2529('0x17')](removeEntity(_0x5e886b,null))[_0x2529('0x17')](function(){return db['VoiceContext'][_0x2529('0x48')]({'raw':!![]});})['then'](function(_0xc730f8){var _0x39f8fb=fs['readFileSync'](path[_0x2529('0x5d')](config[_0x2529('0x4f')],'server/files/templates/context.ejs'),_0x2529('0x5e'));var _0x597319=ejs[_0x2529('0x51')](_0x39f8fb,{'contexts':_0xc730f8});fs[_0x2529('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x597319);return respondWithRpcPromise(_0x2529('0x53'),_0x2529('0x2e'),{'module':_0x2529('0x54')});})[_0x2529('0x20')](handleError(_0x5e886b,null));};
\ No newline at end of file
+var _0x12f4=['api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','get','Contexts','UserProfileResource','destroy','stack','name','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','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/logger'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0x12f4,0x12a));var _0x412f=function(_0x460279,_0x2f93e9){_0x460279=_0x460279-0x0;var _0x4f122f=_0x12f4[_0x460279];return _0x4f122f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x412f('0x0'));var zipdir=require(_0x412f('0x1'));var jsonpatch=require(_0x412f('0x2'));var rp=require(_0x412f('0x3'));var moment=require(_0x412f('0x4'));var BPromise=require(_0x412f('0x5'));var Mustache=require(_0x412f('0x6'));var util=require(_0x412f('0x7'));var path=require(_0x412f('0x8'));var sox=require(_0x412f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x412f('0xa'));var _=require(_0x412f('0xb'));var squel=require(_0x412f('0xc'));var crypto=require(_0x412f('0xd'));var jsforce=require(_0x412f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x412f('0xf'));var querystring=require(_0x412f('0x10'));var Papa=require(_0x412f('0x11'));var Redis=require(_0x412f('0x12'));var authService=require(_0x412f('0x13'));var qs=require(_0x412f('0x14'));var as=require(_0x412f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x412f('0x16'))(_0x412f('0x17'));var utils=require('../../config/utils');var config=require(_0x412f('0x18'));var licenseUtil=require(_0x412f('0x19'));var db=require(_0x412f('0x1a'))['db'];var jayson=require(_0x412f('0x1b'));var client=jayson[_0x412f('0x1c')][_0x412f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x120b2c,_0x96a6eb,_0x1faff9,_0x2a4129){return new BPromise(function(_0x43968f,_0x2884ff){var _0x31aeb8=_0x2a4129||client;return _0x31aeb8[_0x412f('0x1e')](_0x120b2c,_0x1faff9)[_0x412f('0x1f')](function(_0x1e1a60){logger[_0x412f('0x20')](_0x412f('0x21'),_0x96a6eb,_0x412f('0x22'));logger[_0x412f('0x23')](_0x412f('0x24'),_0x96a6eb,_0x412f('0x22'),JSON[_0x412f('0x25')](_0x1e1a60));if(_0x1e1a60[_0x412f('0x26')]){if(_0x1e1a60[_0x412f('0x26')][_0x412f('0x27')]===0x1f4){logger[_0x412f('0x26')](_0x412f('0x21'),_0x96a6eb,_0x1e1a60['error']['message']);return _0x2884ff(_0x1e1a60['error'][_0x412f('0x28')]);}logger[_0x412f('0x26')](_0x412f('0x21'),_0x96a6eb,_0x1e1a60['error'][_0x412f('0x28')]);return _0x43968f(_0x1e1a60[_0x412f('0x26')][_0x412f('0x28')]);}else{logger[_0x412f('0x20')]('VoiceContext,\x20%s,\x20%s',_0x96a6eb,_0x412f('0x22'));_0x43968f(_0x1e1a60[_0x412f('0x29')][_0x412f('0x28')]);}})['catch'](function(_0x3f4253){logger[_0x412f('0x26')]('VoiceContext,\x20%s,\x20%s',_0x96a6eb,_0x3f4253);_0x2884ff(_0x3f4253);});});}function respondWithStatusCode(_0x287ad4,_0x252109){_0x252109=_0x252109||0xcc;return function(_0x168e1b){if(_0x168e1b){return _0x287ad4[_0x412f('0x2a')](_0x252109);}return _0x287ad4[_0x412f('0x2b')](_0x252109)[_0x412f('0x2c')]();};}function respondWithResult(_0x2ff3df,_0x2e3db7){_0x2e3db7=_0x2e3db7||0xc8;return function(_0xbed65){if(_0xbed65){return _0x2ff3df['status'](_0x2e3db7)['json'](_0xbed65);}};}function respondWithFilteredResult(_0x10b42a,_0x429d22){return function(_0x2d6402){if(_0x2d6402){var _0x6df6f0=typeof _0x429d22[_0x412f('0x2d')]==='undefined'&&typeof _0x429d22['limit']===_0x412f('0x2e');var _0x5a3b78=_0x2d6402[_0x412f('0x2f')];var _0x3b6658=_0x6df6f0?0x0:_0x429d22['offset'];var _0x2bec92=_0x6df6f0?_0x2d6402[_0x412f('0x2f')]:_0x429d22[_0x412f('0x2d')]+_0x429d22[_0x412f('0x30')];var _0x488113;if(_0x2bec92>=_0x5a3b78){_0x2bec92=_0x5a3b78;_0x488113=0xc8;}else{_0x488113=0xce;}_0x10b42a['status'](_0x488113);return _0x10b42a['set'](_0x412f('0x31'),_0x3b6658+'-'+_0x2bec92+'/'+_0x5a3b78)[_0x412f('0x32')](_0x2d6402);}return null;};}function patchUpdates(_0x275bd4){return function(_0x4b18d8){try{jsonpatch[_0x412f('0x33')](_0x4b18d8,_0x275bd4,!![]);}catch(_0x423b64){return BPromise[_0x412f('0x34')](_0x423b64);}return _0x4b18d8['save']();};}function saveUpdates(_0x5522c9,_0x2ba3b1){return function(_0x74f3c1){if(_0x74f3c1){return _0x74f3c1[_0x412f('0x35')](_0x5522c9)[_0x412f('0x1f')](function(_0x2c013a){return _0x2c013a;});}return null;};}function removeEntity(_0x2a7903,_0x453374){return function(_0x72c29b){if(_0x72c29b){return _0x72c29b['destroy']()[_0x412f('0x1f')](function(){var _0x10094d=_0x72c29b[_0x412f('0x36')]({'plain':!![]});var _0x27f503=_0x412f('0x37');return db[_0x412f('0x38')][_0x412f('0x39')]({'where':{'type':_0x27f503,'resourceId':_0x10094d['id']}})[_0x412f('0x1f')](function(){return _0x72c29b;});})['then'](function(){_0x2a7903[_0x412f('0x2b')](0xcc)[_0x412f('0x2c')]();});}};}function handleEntityNotFound(_0x14f03a,_0x4a73b1){return function(_0x35b5ff){if(!_0x35b5ff){_0x14f03a[_0x412f('0x2a')](0x194);}return _0x35b5ff;};}function handleError(_0x5c9d6b,_0x444161){_0x444161=_0x444161||0x1f4;return function(_0x4a5d10){logger[_0x412f('0x26')](_0x4a5d10[_0x412f('0x3a')]);if(_0x4a5d10[_0x412f('0x3b')]){delete _0x4a5d10[_0x412f('0x3b')];}_0x5c9d6b[_0x412f('0x2b')](_0x444161)['send'](_0x4a5d10);};}exports[_0x412f('0x3c')]=function(_0x9bfda0,_0x3ae0eb){var _0x2e57fe={},_0x5cdb1e={},_0x58cddb={'count':0x0,'rows':[]};var _0x2149ba=_['map'](db[_0x412f('0x3d')][_0x412f('0x3e')],function(_0x4e1c17){return{'name':_0x4e1c17[_0x412f('0x3f')],'type':_0x4e1c17[_0x412f('0x40')][_0x412f('0x41')]};});_0x5cdb1e[_0x412f('0x42')]=_[_0x412f('0x43')](_0x2149ba,_0x412f('0x3b'));_0x5cdb1e[_0x412f('0x44')]=_['keys'](_0x9bfda0['query']);_0x5cdb1e[_0x412f('0x45')]=_[_0x412f('0x46')](_0x5cdb1e['model'],_0x5cdb1e[_0x412f('0x44')]);_0x2e57fe[_0x412f('0x47')]=_[_0x412f('0x46')](_0x5cdb1e[_0x412f('0x42')],qs['fields'](_0x9bfda0['query'][_0x412f('0x48')]));_0x2e57fe[_0x412f('0x47')]=_0x2e57fe[_0x412f('0x47')][_0x412f('0x49')]?_0x2e57fe['attributes']:_0x5cdb1e['model'];if(!_0x9bfda0[_0x412f('0x44')]['hasOwnProperty'](_0x412f('0x4a'))){_0x2e57fe[_0x412f('0x30')]=qs[_0x412f('0x30')](_0x9bfda0[_0x412f('0x44')][_0x412f('0x30')]);_0x2e57fe[_0x412f('0x2d')]=qs[_0x412f('0x2d')](_0x9bfda0['query'][_0x412f('0x2d')]);}_0x2e57fe['order']=qs[_0x412f('0x4b')](_0x9bfda0[_0x412f('0x44')][_0x412f('0x4b')]);_0x2e57fe[_0x412f('0x4c')]=qs['filters'](_['pick'](_0x9bfda0[_0x412f('0x44')],_0x5cdb1e['filters']),_0x2149ba);if(_0x9bfda0['query'][_0x412f('0x4d')]){_0x2e57fe[_0x412f('0x4c')]=_['merge'](_0x2e57fe['where'],{'$or':_[_0x412f('0x43')](_0x2149ba,function(_0xb071ad){if(_0xb071ad['type']!==_0x412f('0x4e')){var _0x3ba3e2={};_0x3ba3e2[_0xb071ad['name']]={'$like':'%'+_0x9bfda0['query'][_0x412f('0x4d')]+'%'};return _0x3ba3e2;}})});}_0x2e57fe=_[_0x412f('0x4f')]({},_0x2e57fe,_0x9bfda0[_0x412f('0x50')]);var _0x385350={'where':_0x2e57fe[_0x412f('0x4c')]};return db[_0x412f('0x3d')][_0x412f('0x2f')](_0x385350)[_0x412f('0x1f')](function(_0x1237cb){_0x58cddb[_0x412f('0x2f')]=_0x1237cb;if(_0x9bfda0[_0x412f('0x44')][_0x412f('0x51')]){_0x2e57fe[_0x412f('0x52')]=[{'all':!![]}];}return db[_0x412f('0x3d')][_0x412f('0x53')](_0x2e57fe);})['then'](function(_0x5eb049){_0x58cddb[_0x412f('0x54')]=_0x5eb049;return _0x58cddb;})[_0x412f('0x1f')](respondWithFilteredResult(_0x3ae0eb,_0x2e57fe))['catch'](handleError(_0x3ae0eb,null));};exports[_0x412f('0x55')]=function(_0x3517b4,_0xe92539){var _0x2246c5={'raw':![],'where':{'id':_0x3517b4[_0x412f('0x56')]['id']}},_0x4fc717={};_0x4fc717[_0x412f('0x42')]=_[_0x412f('0x57')](db[_0x412f('0x3d')][_0x412f('0x3e')]);_0x4fc717[_0x412f('0x44')]=_[_0x412f('0x57')](_0x3517b4[_0x412f('0x44')]);_0x4fc717['filters']=_[_0x412f('0x46')](_0x4fc717['model'],_0x4fc717['query']);_0x2246c5[_0x412f('0x47')]=_[_0x412f('0x46')](_0x4fc717[_0x412f('0x42')],qs[_0x412f('0x48')](_0x3517b4[_0x412f('0x44')][_0x412f('0x48')]));_0x2246c5['attributes']=_0x2246c5['attributes'][_0x412f('0x49')]?_0x2246c5[_0x412f('0x47')]:_0x4fc717[_0x412f('0x42')];if(_0x3517b4[_0x412f('0x44')]['includeAll']){_0x2246c5[_0x412f('0x52')]=[{'all':!![]}];}_0x2246c5=_['merge']({},_0x2246c5,_0x3517b4[_0x412f('0x50')]);return db[_0x412f('0x3d')][_0x412f('0x58')](_0x2246c5)[_0x412f('0x1f')](handleEntityNotFound(_0xe92539,null))[_0x412f('0x1f')](respondWithResult(_0xe92539,null))[_0x412f('0x59')](handleError(_0xe92539,null));};exports['create']=function(_0x149392,_0x241a06,_0x338c55){var _0x440302;return db[_0x412f('0x3d')][_0x412f('0x5a')](_0x149392[_0x412f('0x5b')],{'raw':!![]})[_0x412f('0x1f')](function(_0x36c1ae){_0x440302=_0x36c1ae;return db[_0x412f('0x3d')][_0x412f('0x53')]({'raw':!![]});})[_0x412f('0x1f')](function(_0x16d02b){var _0x37fa1e=fs[_0x412f('0x5c')](path[_0x412f('0x5d')](config['root'],_0x412f('0x5e')),_0x412f('0x5f'));var _0x40e84d=ejs[_0x412f('0x60')](_0x37fa1e,{'contexts':_0x16d02b||[]});fs[_0x412f('0x61')](_0x412f('0x62'),_0x40e84d);})[_0x412f('0x1f')](function(){return respondWithRpcPromise(_0x412f('0x63'),_0x412f('0x5a'),{'module':_0x412f('0x64')});})['then'](function(){var _0x5e8c05=_0x149392['user'][_0x412f('0x36')]({'plain':!![]});if(!_0x5e8c05)throw new Error(_0x412f('0x65'));if(_0x5e8c05['role']==='user'){var _0x206b3c=_0x440302[_0x412f('0x36')]({'plain':!![]});return db[_0x412f('0x66')][_0x412f('0x58')]({'where':{'name':_0x412f('0x37'),'userProfileId':_0x5e8c05[_0x412f('0x67')]},'raw':!![]})[_0x412f('0x1f')](function(_0x13d15a){if(_0x13d15a&&_0x13d15a[_0x412f('0x68')]===0x0){return db[_0x412f('0x38')][_0x412f('0x5a')]({'name':_0x206b3c['name'],'resourceId':_0x206b3c['id'],'type':_0x13d15a['name'],'sectionId':_0x13d15a['id']},{})[_0x412f('0x1f')](function(){return _0x440302;});}else{return _0x440302;}})['catch'](function(_0x32bfd6){logger['error'](_0x412f('0x69'),_0x32bfd6);throw _0x32bfd6;});}return _0x440302;})['then'](respondWithResult(_0x241a06,0xc9))[_0x412f('0x59')](handleError(_0x241a06,null));};exports[_0x412f('0x35')]=function(_0x3032c0,_0x96d867,_0xdaa165){var _0x2a7b49;return db[_0x412f('0x3d')][_0x412f('0x58')]({'where':{'id':_0x3032c0['params']['id']}})['then'](handleEntityNotFound(_0x96d867,null))[_0x412f('0x1f')](saveUpdates(_0x3032c0[_0x412f('0x5b')],null))[_0x412f('0x1f')](function(_0x1ee5c4){if(_0x1ee5c4){_0x2a7b49=_0x1ee5c4;return db[_0x412f('0x3d')][_0x412f('0x53')]({'raw':!![]});}})[_0x412f('0x1f')](function(_0x229251){var _0x32e271=fs[_0x412f('0x5c')](path[_0x412f('0x5d')](config[_0x412f('0x6a')],_0x412f('0x5e')),_0x412f('0x5f'));var _0xd830f3=ejs['render'](_0x32e271,{'contexts':_0x229251||[]});fs[_0x412f('0x61')](_0x412f('0x62'),_0xd830f3);})[_0x412f('0x1f')](function(){return respondWithRpcPromise('Reload',_0x412f('0x35'),{'module':_0x412f('0x64')});})[_0x412f('0x1f')](function(){return _0x2a7b49;})[_0x412f('0x1f')](respondWithResult(_0x96d867,null))['catch'](handleError(_0x96d867,null));};exports[_0x412f('0x39')]=function(_0x4dfec6,_0x27f59d,_0x417684){var _0x535261;return db[_0x412f('0x3d')][_0x412f('0x58')]({'where':{'id':_0x4dfec6['params']['id']}})[_0x412f('0x1f')](handleEntityNotFound(_0x27f59d,null))[_0x412f('0x1f')](removeEntity(_0x27f59d,null))[_0x412f('0x1f')](function(){return db[_0x412f('0x3d')]['findAll']({'raw':!![]});})[_0x412f('0x1f')](function(_0x57c36c){var _0x5b54c7=fs[_0x412f('0x5c')](path[_0x412f('0x5d')](config[_0x412f('0x6a')],_0x412f('0x5e')),'utf8');var _0x1817f0=ejs['render'](_0x5b54c7,{'contexts':_0x57c36c});fs[_0x412f('0x61')](_0x412f('0x62'),_0x1817f0);return respondWithRpcPromise('Reload',_0x412f('0x39'),{'module':_0x412f('0x64')});})[_0x412f('0x59')](handleError(_0x27f59d,null));};
\ No newline at end of file
index 563d67f..48e6fd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc6b=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x336cfc,_0xe73c8c){var _0x5cd362=function(_0x228aa1){while(--_0x228aa1){_0x336cfc['push'](_0x336cfc['shift']());}};_0x5cd362(++_0xe73c8c);}(_0xdc6b,0xde));var _0xbdc6=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xdc6b[_0xffa198];return _0x1e4b50;};'use strict';var _=require(_0xbdc6('0x0'));var util=require('util');var logger=require(_0xbdc6('0x1'))(_0xbdc6('0x2'));var moment=require('moment');var BPromise=require(_0xbdc6('0x3'));var rp=require(_0xbdc6('0x4'));var fs=require('fs');var path=require(_0xbdc6('0x5'));var rimraf=require('rimraf');var config=require(_0xbdc6('0x6'));var attributes=require(_0xbdc6('0x7'));module[_0xbdc6('0x8')]=function(_0x179721,_0x3ec594){return _0x179721[_0xbdc6('0x9')](_0xbdc6('0xa'),attributes,{'tableName':_0xbdc6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f54=['request-promise','rimraf','../../config/environment','define','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x50e286,_0x365765){var _0x30797a=function(_0x55618d){while(--_0x55618d){_0x50e286['push'](_0x50e286['shift']());}};_0x30797a(++_0x365765);}(_0x4f54,0x123));var _0x44f5=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4f54[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x44f5('0x0'));var util=require(_0x44f5('0x1'));var logger=require(_0x44f5('0x2'))(_0x44f5('0x3'));var moment=require(_0x44f5('0x4'));var BPromise=require(_0x44f5('0x5'));var rp=require(_0x44f5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44f5('0x7'));var config=require(_0x44f5('0x8'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x4b15c6,_0x5815ed){return _0x4b15c6[_0x44f5('0x9')]('VoiceContext',attributes,{'tableName':_0x44f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 70c3cfb..22e00c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cf1=['then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x12f53d,_0x3b8f99){var _0x590201=function(_0x718df4){while(--_0x718df4){_0x12f53d['push'](_0x12f53d['shift']());}};_0x590201(++_0x3b8f99);}(_0x1cf1,0x10e));var _0x11cf=function(_0x530e34,_0x5e3050){_0x530e34=_0x530e34-0x0;var _0x246ad7=_0x1cf1[_0x530e34];return _0x246ad7;};'use strict';var _=require(_0x11cf('0x0'));var util=require('util');var moment=require(_0x11cf('0x1'));var BPromise=require(_0x11cf('0x2'));var rs=require(_0x11cf('0x3'));var fs=require('fs');var Redis=require(_0x11cf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x11cf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x11cf('0x6'));var jayson=require(_0x11cf('0x7'));var client=jayson[_0x11cf('0x8')][_0x11cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53484f,_0x42a89e,_0xc0fcc9){return new BPromise(function(_0x5dad93,_0x20b65c){return client['request'](_0x53484f,_0xc0fcc9)[_0x11cf('0xa')](function(_0x3d3229){logger[_0x11cf('0xb')](_0x11cf('0xc'),_0x42a89e,_0x11cf('0xd'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x42a89e,'request\x20sent',JSON[_0x11cf('0xe')](_0x3d3229));if(_0x3d3229['error']){if(_0x3d3229[_0x11cf('0xf')][_0x11cf('0x10')]===0x1f4){logger[_0x11cf('0xf')](_0x11cf('0xc'),_0x42a89e,_0x3d3229[_0x11cf('0xf')]['message']);return _0x20b65c(_0x3d3229['error'][_0x11cf('0x11')]);}logger[_0x11cf('0xf')](_0x11cf('0xc'),_0x42a89e,_0x3d3229[_0x11cf('0xf')][_0x11cf('0x11')]);return _0x5dad93(_0x3d3229[_0x11cf('0xf')][_0x11cf('0x11')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x42a89e,_0x11cf('0xd'));_0x5dad93(_0x3d3229[_0x11cf('0x12')][_0x11cf('0x11')]);}})[_0x11cf('0x13')](function(_0xe9d3af){logger['error'](_0x11cf('0xc'),_0x42a89e,_0xe9d3af);_0x20b65c(_0xe9d3af);});});}
\ No newline at end of file
+var _0x99e7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x13a25f,_0x5e13c8){var _0x332665=function(_0x49c827){while(--_0x49c827){_0x13a25f['push'](_0x13a25f['shift']());}};_0x332665(++_0x5e13c8);}(_0x99e7,0x1b5));var _0x799e=function(_0x3f6c29,_0x370d86){_0x3f6c29=_0x3f6c29-0x0;var _0x4af959=_0x99e7[_0x3f6c29];return _0x4af959;};'use strict';var _=require(_0x799e('0x0'));var util=require(_0x799e('0x1'));var moment=require(_0x799e('0x2'));var BPromise=require(_0x799e('0x3'));var rs=require(_0x799e('0x4'));var fs=require('fs');var Redis=require(_0x799e('0x5'));var db=require(_0x799e('0x6'))['db'];var utils=require(_0x799e('0x7'));var logger=require(_0x799e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x799e('0x9'));var client=jayson['client'][_0x799e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f98e4,_0x1612ad,_0x373341){return new BPromise(function(_0x3cec49,_0x1edc75){return client[_0x799e('0xb')](_0x4f98e4,_0x373341)['then'](function(_0x21df07){logger[_0x799e('0xc')](_0x799e('0xd'),_0x1612ad,_0x799e('0xe'));logger['debug'](_0x799e('0xf'),_0x1612ad,_0x799e('0xe'),JSON[_0x799e('0x10')](_0x21df07));if(_0x21df07[_0x799e('0x11')]){if(_0x21df07[_0x799e('0x11')][_0x799e('0x12')]===0x1f4){logger[_0x799e('0x11')]('VoiceContext,\x20%s,\x20%s',_0x1612ad,_0x21df07[_0x799e('0x11')][_0x799e('0x13')]);return _0x1edc75(_0x21df07[_0x799e('0x11')][_0x799e('0x13')]);}logger[_0x799e('0x11')](_0x799e('0xd'),_0x1612ad,_0x21df07[_0x799e('0x11')][_0x799e('0x13')]);return _0x3cec49(_0x21df07[_0x799e('0x11')][_0x799e('0x13')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x1612ad,_0x799e('0xe'));_0x3cec49(_0x21df07[_0x799e('0x14')][_0x799e('0x13')]);}})['catch'](function(_0x3af3ec){logger[_0x799e('0x11')](_0x799e('0xd'),_0x1612ad,_0x3af3ec);_0x1edc75(_0x3af3ec);});});}
\ No newline at end of file
index a8a4a94..39b65a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa530=['describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe'];(function(_0x4b1501,_0x3267b0){var _0x5f4dd4=function(_0x521e37){while(--_0x521e37){_0x4b1501['push'](_0x4b1501['shift']());}};_0x5f4dd4(++_0x3267b0);}(_0xa530,0x7a));var _0x0a53=function(_0x4fa489,_0x4cba6b){_0x4fa489=_0x4fa489-0x0;var _0x41d2ce=_0xa530[_0x4fa489];return _0x41d2ce;};'use strict';var multer=require(_0x0a53('0x0'));var util=require(_0x0a53('0x1'));var path=require('path');var timeout=require(_0x0a53('0x2'));var express=require(_0x0a53('0x3'));var router=express[_0x0a53('0x4')]();var fs_extra=require(_0x0a53('0x5'));var auth=require(_0x0a53('0x6'));var interaction=require(_0x0a53('0x7'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x0a53('0x8')]('/',auth[_0x0a53('0x9')](),controller['index']);router[_0x0a53('0x8')](_0x0a53('0xa'),auth[_0x0a53('0x9')](),controller[_0x0a53('0xb')]);router[_0x0a53('0x8')](_0x0a53('0xc'),auth[_0x0a53('0x9')](),controller[_0x0a53('0xd')]);router['post']('/',auth[_0x0a53('0x9')](),controller[_0x0a53('0xe')]);router['put'](_0x0a53('0xc'),auth['isAuthenticated'](),controller[_0x0a53('0xf')]);router[_0x0a53('0x10')](_0x0a53('0xc'),auth[_0x0a53('0x9')](),controller[_0x0a53('0x11')]);module[_0x0a53('0x12')]=router;
\ No newline at end of file
+var _0x3e7c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','exports','multer','util','path','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3e7c,0x136));var _0xc3e7=function(_0x16f72d,_0x41b571){_0x16f72d=_0x16f72d-0x0;var _0x17aa3c=_0x3e7c[_0x16f72d];return _0x17aa3c;};'use strict';var multer=require(_0xc3e7('0x0'));var util=require(_0xc3e7('0x1'));var path=require(_0xc3e7('0x2'));var timeout=require('connect-timeout');var express=require(_0xc3e7('0x3'));var router=express[_0xc3e7('0x4')]();var fs_extra=require(_0xc3e7('0x5'));var auth=require(_0xc3e7('0x6'));var interaction=require(_0xc3e7('0x7'));var config=require(_0xc3e7('0x8'));var controller=require(_0xc3e7('0x9'));router['get']('/',auth[_0xc3e7('0xa')](),controller[_0xc3e7('0xb')]);router[_0xc3e7('0xc')](_0xc3e7('0xd'),auth[_0xc3e7('0xa')](),controller[_0xc3e7('0xe')]);router[_0xc3e7('0xc')](_0xc3e7('0xf'),auth[_0xc3e7('0xa')](),controller['show']);router[_0xc3e7('0x10')]('/',auth[_0xc3e7('0xa')](),controller[_0xc3e7('0x11')]);router[_0xc3e7('0x12')](_0xc3e7('0xf'),auth[_0xc3e7('0xa')](),controller['update']);router[_0xc3e7('0x13')](_0xc3e7('0xf'),auth[_0xc3e7('0xa')](),controller['destroy']);module[_0xc3e7('0x14')]=router;
\ No newline at end of file
index 4ee1823..3df5d2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x5d1c83,_0x17c196){var _0x275598=function(_0x1f66cb){while(--_0x1f66cb){_0x5d1c83['push'](_0x5d1c83['shift']());}};_0x275598(++_0x17c196);}(_0x98a8,0x12c));var _0x898a=function(_0x29c630,_0x41a662){_0x29c630=_0x29c630-0x0;var _0x486312=_0x98a8[_0x29c630];return _0x486312;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}};
\ No newline at end of file
+var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x530bc,_0x101e09){var _0x648d6a=function(_0x2e2fec){while(--_0x2e2fec){_0x530bc['push'](_0x530bc['shift']());}};_0x648d6a(++_0x101e09);}(_0x55ca,0x126));var _0xa55c=function(_0x414f45,_0x1ee7d3){_0x414f45=_0x414f45-0x0;var _0x3bc907=_0x55ca[_0x414f45];return _0x3bc907;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}};
\ No newline at end of file
index f7e6328..acd5e63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x978d=['VoiceDialReport','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','save','update','then','destroy','sendStatus','error','name'];(function(_0x27713e,_0x8a7df2){var _0x37c05f=function(_0x303a59){while(--_0x303a59){_0x27713e['push'](_0x27713e['shift']());}};_0x37c05f(++_0x8a7df2);}(_0x978d,0x1b2));var _0xd978=function(_0x167576,_0x3eca5d){_0x167576=_0x167576-0x0;var _0x240e43=_0x978d[_0x167576];return _0x240e43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd978('0x0'));var zipdir=require(_0xd978('0x1'));var jsonpatch=require(_0xd978('0x2'));var rp=require(_0xd978('0x3'));var moment=require(_0xd978('0x4'));var BPromise=require(_0xd978('0x5'));var Mustache=require(_0xd978('0x6'));var util=require('util');var path=require(_0xd978('0x7'));var sox=require(_0xd978('0x8'));var csv=require(_0xd978('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd978('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd978('0xb'));var jsforce=require(_0xd978('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd978('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd978('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd978('0xe'));var logger=require(_0xd978('0xf'))(_0xd978('0x10'));var utils=require(_0xd978('0x11'));var config=require(_0xd978('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd978('0x13'))['db'];function respondWithStatusCode(_0x17a0b5,_0x4c0320){_0x4c0320=_0x4c0320||0xcc;return function(_0x417595){if(_0x417595){return _0x17a0b5['sendStatus'](_0x4c0320);}return _0x17a0b5['status'](_0x4c0320)[_0xd978('0x14')]();};}function respondWithResult(_0x4f1b4d,_0x42231c){_0x42231c=_0x42231c||0xc8;return function(_0x1d24c7){if(_0x1d24c7){return _0x4f1b4d[_0xd978('0x15')](_0x42231c)[_0xd978('0x16')](_0x1d24c7);}};}function respondWithFilteredResult(_0x2ee0de,_0x447e2b){return function(_0x39231c){if(_0x39231c){var _0x25596e=typeof _0x447e2b[_0xd978('0x17')]===_0xd978('0x18')&&typeof _0x447e2b[_0xd978('0x19')]===_0xd978('0x18');var _0x5ebaab=_0x39231c[_0xd978('0x1a')];var _0x1e3d24=_0x25596e?0x0:_0x447e2b[_0xd978('0x17')];var _0x38a484=_0x25596e?_0x39231c[_0xd978('0x1a')]:_0x447e2b['offset']+_0x447e2b[_0xd978('0x19')];var _0x758459;if(_0x38a484>=_0x5ebaab){_0x38a484=_0x5ebaab;_0x758459=0xc8;}else{_0x758459=0xce;}_0x2ee0de[_0xd978('0x15')](_0x758459);return _0x2ee0de[_0xd978('0x1b')]('Content-Range',_0x1e3d24+'-'+_0x38a484+'/'+_0x5ebaab)[_0xd978('0x16')](_0x39231c);}return null;};}function patchUpdates(_0x56b326){return function(_0xae75ac){try{jsonpatch['apply'](_0xae75ac,_0x56b326,!![]);}catch(_0x11c5d8){return BPromise['reject'](_0x11c5d8);}return _0xae75ac[_0xd978('0x1c')]();};}function saveUpdates(_0x2bf7da,_0x49dc78){return function(_0x2e6e7b){if(_0x2e6e7b){return _0x2e6e7b[_0xd978('0x1d')](_0x2bf7da)[_0xd978('0x1e')](function(_0x458d6b){return _0x458d6b;});}return null;};}function removeEntity(_0x2ccef2,_0x105760){return function(_0x237e1a){if(_0x237e1a){return _0x237e1a[_0xd978('0x1f')]()['then'](function(){_0x2ccef2[_0xd978('0x15')](0xcc)[_0xd978('0x14')]();});}};}function handleEntityNotFound(_0x5b1895,_0x1b9948){return function(_0x1df282){if(!_0x1df282){_0x5b1895[_0xd978('0x20')](0x194);}return _0x1df282;};}function handleError(_0x36821d,_0x582da2){_0x582da2=_0x582da2||0x1f4;return function(_0x3c35de){logger[_0xd978('0x21')](_0x3c35de['stack']);if(_0x3c35de[_0xd978('0x22')]){delete _0x3c35de[_0xd978('0x22')];}_0x36821d['status'](_0x582da2)['send'](_0x3c35de);};}exports['index']=function(_0x35b102,_0x26527c){var _0x757579={},_0x3985f7={},_0x17d8e3={'count':0x0,'rows':[]};var _0x3d29ae=_['map'](db[_0xd978('0x23')]['rawAttributes'],function(_0x3e6cf7){return{'name':_0x3e6cf7['fieldName'],'type':_0x3e6cf7[_0xd978('0x24')][_0xd978('0x25')]};});_0x3985f7[_0xd978('0x26')]=_[_0xd978('0x27')](_0x3d29ae,_0xd978('0x22'));_0x3985f7[_0xd978('0x28')]=_[_0xd978('0x29')](_0x35b102['query']);_0x3985f7['filters']=_['intersection'](_0x3985f7['model'],_0x3985f7['query']);_0x757579[_0xd978('0x2a')]=_[_0xd978('0x2b')](_0x3985f7[_0xd978('0x26')],qs[_0xd978('0x2c')](_0x35b102['query']['fields']));_0x757579['attributes']=_0x757579['attributes']['length']?_0x757579['attributes']:_0x3985f7['model'];if(!_0x35b102[_0xd978('0x28')][_0xd978('0x2d')](_0xd978('0x2e'))){_0x757579[_0xd978('0x19')]=qs[_0xd978('0x19')](_0x35b102['query']['limit']);_0x757579[_0xd978('0x17')]=qs[_0xd978('0x17')](_0x35b102['query'][_0xd978('0x17')]);}_0x757579[_0xd978('0x2f')]=qs['sort'](_0x35b102[_0xd978('0x28')][_0xd978('0x30')]);_0x757579['where']=qs[_0xd978('0x31')](_['pick'](_0x35b102['query'],_0x3985f7[_0xd978('0x31')]),_0x3d29ae);if(_0x35b102[_0xd978('0x28')][_0xd978('0x32')]){_0x757579['where']=_[_0xd978('0x33')](_0x757579['where'],{'$or':_[_0xd978('0x27')](_0x3d29ae,function(_0x329e68){if(_0x329e68[_0xd978('0x24')]!==_0xd978('0x34')){var _0x4d6181={};_0x4d6181[_0x329e68[_0xd978('0x22')]]={'$like':'%'+_0x35b102[_0xd978('0x28')]['filter']+'%'};return _0x4d6181;}})});}_0x757579=_[_0xd978('0x33')]({},_0x757579,_0x35b102['options']);var _0x2b242e={'where':_0x757579['where']};return db[_0xd978('0x23')][_0xd978('0x1a')](_0x2b242e)[_0xd978('0x1e')](function(_0x2e00c6){_0x17d8e3[_0xd978('0x1a')]=_0x2e00c6;if(_0x35b102[_0xd978('0x28')][_0xd978('0x35')]){_0x757579['include']=[{'all':!![]}];}return db[_0xd978('0x23')][_0xd978('0x36')](_0x757579);})['then'](function(_0x4f5507){_0x17d8e3[_0xd978('0x37')]=_0x4f5507;return _0x17d8e3;})['then'](respondWithFilteredResult(_0x26527c,_0x757579))[_0xd978('0x38')](handleError(_0x26527c,null));};exports[_0xd978('0x39')]=function(_0x3deca3,_0x5c5160){var _0x1ae8e5={'raw':!![],'where':{'id':_0x3deca3[_0xd978('0x3a')]['id']}},_0x588e21={};_0x588e21[_0xd978('0x26')]=_[_0xd978('0x29')](db['VoiceDialReport'][_0xd978('0x3b')]);_0x588e21[_0xd978('0x28')]=_[_0xd978('0x29')](_0x3deca3['query']);_0x588e21[_0xd978('0x31')]=_[_0xd978('0x2b')](_0x588e21[_0xd978('0x26')],_0x588e21[_0xd978('0x28')]);_0x1ae8e5[_0xd978('0x2a')]=_[_0xd978('0x2b')](_0x588e21[_0xd978('0x26')],qs[_0xd978('0x2c')](_0x3deca3[_0xd978('0x28')][_0xd978('0x2c')]));_0x1ae8e5[_0xd978('0x2a')]=_0x1ae8e5[_0xd978('0x2a')][_0xd978('0x3c')]?_0x1ae8e5[_0xd978('0x2a')]:_0x588e21[_0xd978('0x26')];if(_0x3deca3[_0xd978('0x28')]['includeAll']){_0x1ae8e5[_0xd978('0x3d')]=[{'all':!![]}];}_0x1ae8e5=_[_0xd978('0x33')]({},_0x1ae8e5,_0x3deca3[_0xd978('0x3e')]);return db['VoiceDialReport']['find'](_0x1ae8e5)[_0xd978('0x1e')](handleEntityNotFound(_0x5c5160,null))['then'](respondWithResult(_0x5c5160,null))[_0xd978('0x38')](handleError(_0x5c5160,null));};exports[_0xd978('0x3f')]=function(_0x4aec54,_0x382d31){return db[_0xd978('0x23')][_0xd978('0x3f')](_0x4aec54[_0xd978('0x40')],{})[_0xd978('0x1e')](respondWithResult(_0x382d31,0xc9))[_0xd978('0x38')](handleError(_0x382d31,null));};exports[_0xd978('0x1d')]=function(_0x3229c7,_0x20fc56){if(_0x3229c7[_0xd978('0x40')]['id']){delete _0x3229c7[_0xd978('0x40')]['id'];}return db[_0xd978('0x23')][_0xd978('0x41')]({'where':{'id':_0x3229c7[_0xd978('0x3a')]['id']}})[_0xd978('0x1e')](handleEntityNotFound(_0x20fc56,null))[_0xd978('0x1e')](saveUpdates(_0x3229c7['body'],null))[_0xd978('0x1e')](respondWithResult(_0x20fc56,null))[_0xd978('0x38')](handleError(_0x20fc56,null));};exports['destroy']=function(_0x42c241,_0xc60c28){return db[_0xd978('0x23')]['find']({'where':{'id':_0x42c241[_0xd978('0x3a')]['id']}})[_0xd978('0x1e')](handleEntityNotFound(_0xc60c28,null))['then'](removeEntity(_0xc60c28,null))[_0xd978('0x38')](handleError(_0xc60c28,null));};exports[_0xd978('0x42')]=function(_0x3373ee,_0x14cfb3){return db[_0xd978('0x23')][_0xd978('0x42')]()[_0xd978('0x1e')](respondWithResult(_0x14cfb3,null))[_0xd978('0x38')](handleError(_0x14cfb3,null));};
\ No newline at end of file
+var _0xc01b=['VIRTUAL','options','includeAll','findAll','catch','show','params','fields','include','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x579307,_0x5df80e){var _0x561a6f=function(_0x58a884){while(--_0x58a884){_0x579307['push'](_0x579307['shift']());}};_0x561a6f(++_0x5df80e);}(_0xc01b,0xac));var _0xbc01=function(_0x3c4628,_0x380bcd){_0x3c4628=_0x3c4628-0x0;var _0x4dc97f=_0xc01b[_0x3c4628];return _0x4dc97f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc01('0x0'));var zipdir=require(_0xbc01('0x1'));var jsonpatch=require(_0xbc01('0x2'));var rp=require(_0xbc01('0x3'));var moment=require(_0xbc01('0x4'));var BPromise=require(_0xbc01('0x5'));var Mustache=require(_0xbc01('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbc01('0x7'));var csv=require(_0xbc01('0x8'));var ejs=require(_0xbc01('0x9'));var fs=require('fs');var fs_extra=require(_0xbc01('0xa'));var _=require(_0xbc01('0xb'));var squel=require(_0xbc01('0xc'));var crypto=require(_0xbc01('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbc01('0xe'));var toCsv=require(_0xbc01('0x8'));var querystring=require(_0xbc01('0xf'));var Papa=require(_0xbc01('0x10'));var Redis=require(_0xbc01('0x11'));var authService=require(_0xbc01('0x12'));var qs=require(_0xbc01('0x13'));var as=require(_0xbc01('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc01('0x15'))(_0xbc01('0x16'));var utils=require(_0xbc01('0x17'));var config=require(_0xbc01('0x18'));var licenseUtil=require(_0xbc01('0x19'));var db=require(_0xbc01('0x1a'))['db'];function respondWithStatusCode(_0x2a5330,_0x3889e1){_0x3889e1=_0x3889e1||0xcc;return function(_0x41f026){if(_0x41f026){return _0x2a5330[_0xbc01('0x1b')](_0x3889e1);}return _0x2a5330[_0xbc01('0x1c')](_0x3889e1)[_0xbc01('0x1d')]();};}function respondWithResult(_0x55081a,_0x292bd4){_0x292bd4=_0x292bd4||0xc8;return function(_0x1b3d00){if(_0x1b3d00){return _0x55081a[_0xbc01('0x1c')](_0x292bd4)[_0xbc01('0x1e')](_0x1b3d00);}};}function respondWithFilteredResult(_0x5d9e40,_0x52a84c){return function(_0x2d704a){if(_0x2d704a){var _0x12fcc5=typeof _0x52a84c[_0xbc01('0x1f')]==='undefined'&&typeof _0x52a84c[_0xbc01('0x20')]==='undefined';var _0x1a4b3f=_0x2d704a[_0xbc01('0x21')];var _0x311cca=_0x12fcc5?0x0:_0x52a84c[_0xbc01('0x1f')];var _0x1b4324=_0x12fcc5?_0x2d704a[_0xbc01('0x21')]:_0x52a84c[_0xbc01('0x1f')]+_0x52a84c[_0xbc01('0x20')];var _0x375691;if(_0x1b4324>=_0x1a4b3f){_0x1b4324=_0x1a4b3f;_0x375691=0xc8;}else{_0x375691=0xce;}_0x5d9e40[_0xbc01('0x1c')](_0x375691);return _0x5d9e40[_0xbc01('0x22')](_0xbc01('0x23'),_0x311cca+'-'+_0x1b4324+'/'+_0x1a4b3f)[_0xbc01('0x1e')](_0x2d704a);}return null;};}function patchUpdates(_0xbf49d0){return function(_0xabeb0b){try{jsonpatch[_0xbc01('0x24')](_0xabeb0b,_0xbf49d0,!![]);}catch(_0x2e4adc){return BPromise['reject'](_0x2e4adc);}return _0xabeb0b['save']();};}function saveUpdates(_0x1e3eea,_0x38646d){return function(_0x44f2c1){if(_0x44f2c1){return _0x44f2c1[_0xbc01('0x25')](_0x1e3eea)[_0xbc01('0x26')](function(_0x412bb8){return _0x412bb8;});}return null;};}function removeEntity(_0x435e2d,_0x972200){return function(_0x53c617){if(_0x53c617){return _0x53c617['destroy']()['then'](function(){_0x435e2d['status'](0xcc)[_0xbc01('0x1d')]();});}};}function handleEntityNotFound(_0x10c6e2,_0x2dffa1){return function(_0x210378){if(!_0x210378){_0x10c6e2['sendStatus'](0x194);}return _0x210378;};}function handleError(_0x11cc03,_0x9c1b){_0x9c1b=_0x9c1b||0x1f4;return function(_0x30cd8b){logger[_0xbc01('0x27')](_0x30cd8b[_0xbc01('0x28')]);if(_0x30cd8b[_0xbc01('0x29')]){delete _0x30cd8b[_0xbc01('0x29')];}_0x11cc03[_0xbc01('0x1c')](_0x9c1b)[_0xbc01('0x2a')](_0x30cd8b);};}exports[_0xbc01('0x2b')]=function(_0x1e7be7,_0x5db9d9){var _0x3d00a0={},_0x9d06f={},_0x5edd9e={'count':0x0,'rows':[]};var _0x5c0c5d=_[_0xbc01('0x2c')](db[_0xbc01('0x2d')][_0xbc01('0x2e')],function(_0x1f7c45){return{'name':_0x1f7c45[_0xbc01('0x2f')],'type':_0x1f7c45[_0xbc01('0x30')][_0xbc01('0x31')]};});_0x9d06f[_0xbc01('0x32')]=_[_0xbc01('0x2c')](_0x5c0c5d,_0xbc01('0x29'));_0x9d06f[_0xbc01('0x33')]=_[_0xbc01('0x34')](_0x1e7be7[_0xbc01('0x33')]);_0x9d06f[_0xbc01('0x35')]=_[_0xbc01('0x36')](_0x9d06f[_0xbc01('0x32')],_0x9d06f[_0xbc01('0x33')]);_0x3d00a0['attributes']=_[_0xbc01('0x36')](_0x9d06f[_0xbc01('0x32')],qs['fields'](_0x1e7be7[_0xbc01('0x33')]['fields']));_0x3d00a0['attributes']=_0x3d00a0[_0xbc01('0x37')][_0xbc01('0x38')]?_0x3d00a0[_0xbc01('0x37')]:_0x9d06f[_0xbc01('0x32')];if(!_0x1e7be7[_0xbc01('0x33')][_0xbc01('0x39')](_0xbc01('0x3a'))){_0x3d00a0[_0xbc01('0x20')]=qs[_0xbc01('0x20')](_0x1e7be7[_0xbc01('0x33')][_0xbc01('0x20')]);_0x3d00a0[_0xbc01('0x1f')]=qs['offset'](_0x1e7be7['query'][_0xbc01('0x1f')]);}_0x3d00a0[_0xbc01('0x3b')]=qs[_0xbc01('0x3c')](_0x1e7be7[_0xbc01('0x33')]['sort']);_0x3d00a0[_0xbc01('0x3d')]=qs[_0xbc01('0x35')](_[_0xbc01('0x3e')](_0x1e7be7[_0xbc01('0x33')],_0x9d06f[_0xbc01('0x35')]),_0x5c0c5d);if(_0x1e7be7['query'][_0xbc01('0x3f')]){_0x3d00a0['where']=_[_0xbc01('0x40')](_0x3d00a0[_0xbc01('0x3d')],{'$or':_[_0xbc01('0x2c')](_0x5c0c5d,function(_0x27b302){if(_0x27b302[_0xbc01('0x30')]!==_0xbc01('0x41')){var _0x177270={};_0x177270[_0x27b302[_0xbc01('0x29')]]={'$like':'%'+_0x1e7be7[_0xbc01('0x33')]['filter']+'%'};return _0x177270;}})});}_0x3d00a0=_[_0xbc01('0x40')]({},_0x3d00a0,_0x1e7be7[_0xbc01('0x42')]);var _0x3dfaf6={'where':_0x3d00a0[_0xbc01('0x3d')]};return db[_0xbc01('0x2d')]['count'](_0x3dfaf6)[_0xbc01('0x26')](function(_0x500113){_0x5edd9e['count']=_0x500113;if(_0x1e7be7[_0xbc01('0x33')][_0xbc01('0x43')]){_0x3d00a0['include']=[{'all':!![]}];}return db[_0xbc01('0x2d')][_0xbc01('0x44')](_0x3d00a0);})[_0xbc01('0x26')](function(_0x1c9efc){_0x5edd9e['rows']=_0x1c9efc;return _0x5edd9e;})['then'](respondWithFilteredResult(_0x5db9d9,_0x3d00a0))[_0xbc01('0x45')](handleError(_0x5db9d9,null));};exports[_0xbc01('0x46')]=function(_0x38fd85,_0x9bc9ba){var _0x3dfb00={'raw':!![],'where':{'id':_0x38fd85[_0xbc01('0x47')]['id']}},_0x287921={};_0x287921[_0xbc01('0x32')]=_[_0xbc01('0x34')](db[_0xbc01('0x2d')][_0xbc01('0x2e')]);_0x287921[_0xbc01('0x33')]=_['keys'](_0x38fd85[_0xbc01('0x33')]);_0x287921[_0xbc01('0x35')]=_[_0xbc01('0x36')](_0x287921[_0xbc01('0x32')],_0x287921[_0xbc01('0x33')]);_0x3dfb00[_0xbc01('0x37')]=_[_0xbc01('0x36')](_0x287921['model'],qs[_0xbc01('0x48')](_0x38fd85['query'][_0xbc01('0x48')]));_0x3dfb00[_0xbc01('0x37')]=_0x3dfb00[_0xbc01('0x37')][_0xbc01('0x38')]?_0x3dfb00[_0xbc01('0x37')]:_0x287921[_0xbc01('0x32')];if(_0x38fd85[_0xbc01('0x33')][_0xbc01('0x43')]){_0x3dfb00[_0xbc01('0x49')]=[{'all':!![]}];}_0x3dfb00=_[_0xbc01('0x40')]({},_0x3dfb00,_0x38fd85[_0xbc01('0x42')]);return db[_0xbc01('0x2d')][_0xbc01('0x4a')](_0x3dfb00)[_0xbc01('0x26')](handleEntityNotFound(_0x9bc9ba,null))[_0xbc01('0x26')](respondWithResult(_0x9bc9ba,null))['catch'](handleError(_0x9bc9ba,null));};exports[_0xbc01('0x4b')]=function(_0x18ca44,_0x5164c5){return db['VoiceDialReport'][_0xbc01('0x4b')](_0x18ca44[_0xbc01('0x4c')],{})[_0xbc01('0x26')](respondWithResult(_0x5164c5,0xc9))['catch'](handleError(_0x5164c5,null));};exports['update']=function(_0x29ddeb,_0x33a9a4){if(_0x29ddeb['body']['id']){delete _0x29ddeb['body']['id'];}return db[_0xbc01('0x2d')]['find']({'where':{'id':_0x29ddeb['params']['id']}})['then'](handleEntityNotFound(_0x33a9a4,null))[_0xbc01('0x26')](saveUpdates(_0x29ddeb['body'],null))[_0xbc01('0x26')](respondWithResult(_0x33a9a4,null))[_0xbc01('0x45')](handleError(_0x33a9a4,null));};exports[_0xbc01('0x4d')]=function(_0x3c1279,_0x97d66a){return db[_0xbc01('0x2d')][_0xbc01('0x4a')]({'where':{'id':_0x3c1279['params']['id']}})[_0xbc01('0x26')](handleEntityNotFound(_0x97d66a,null))[_0xbc01('0x26')](removeEntity(_0x97d66a,null))[_0xbc01('0x45')](handleError(_0x97d66a,null));};exports[_0xbc01('0x4e')]=function(_0x4d9988,_0x167ace){return db[_0xbc01('0x2d')]['describe']()[_0xbc01('0x26')](respondWithResult(_0x167ace,null))[_0xbc01('0x45')](handleError(_0x167ace,null));};
\ No newline at end of file
index d3bbc9f..f696456 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa44a=['lodash','api','moment','bluebird','request-promise','path','rimraf','exports','define','report_dial','uniqueid'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xa44a,0x9a));var _0xaa44=function(_0x577acd,_0x2dddb2){_0x577acd=_0x577acd-0x0;var _0x2bfd74=_0xa44a[_0x577acd];return _0x2bfd74;};'use strict';var _=require(_0xaa44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa44('0x1'));var moment=require(_0xaa44('0x2'));var BPromise=require(_0xaa44('0x3'));var rp=require(_0xaa44('0x4'));var fs=require('fs');var path=require(_0xaa44('0x5'));var rimraf=require(_0xaa44('0x6'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xaa44('0x7')]=function(_0x39a3f6,_0x4979e3){return _0x39a3f6[_0xaa44('0x8')]('VoiceDialReport',attributes,{'tableName':_0xaa44('0x9'),'paranoid':![],'indexes':[{'fields':[_0xaa44('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x97da=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x399a12,_0x48202b){var _0x874a03=function(_0x549d58){while(--_0x549d58){_0x399a12['push'](_0x399a12['shift']());}};_0x874a03(++_0x48202b);}(_0x97da,0x164));var _0xa97d=function(_0xbb9850,_0x52942c){_0xbb9850=_0xbb9850-0x0;var _0x38f6fe=_0x97da[_0xbb9850];return _0x38f6fe;};'use strict';var _=require(_0xa97d('0x0'));var util=require(_0xa97d('0x1'));var logger=require(_0xa97d('0x2'))('api');var moment=require(_0xa97d('0x3'));var BPromise=require(_0xa97d('0x4'));var rp=require(_0xa97d('0x5'));var fs=require('fs');var path=require(_0xa97d('0x6'));var rimraf=require(_0xa97d('0x7'));var config=require('../../config/environment');var attributes=require(_0xa97d('0x8'));module[_0xa97d('0x9')]=function(_0x56b30c,_0x1644a0){return _0x56b30c[_0xa97d('0xa')](_0xa97d('0xb'),attributes,{'tableName':_0xa97d('0xc'),'paranoid':![],'indexes':[{'fields':[_0xa97d('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 771e808..1613474 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb44=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','options','UpdateVoiceDialReport','update','body','raw','attributes','lodash','util','moment'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xfb44,0x17d));var _0x4fb4=function(_0x43bb56,_0x3d5d7d){_0x43bb56=_0x43bb56-0x0;var _0x2692d8=_0xfb44[_0x43bb56];return _0x2692d8;};'use strict';var _=require(_0x4fb4('0x0'));var util=require(_0x4fb4('0x1'));var moment=require(_0x4fb4('0x2'));var BPromise=require(_0x4fb4('0x3'));var rs=require(_0x4fb4('0x4'));var fs=require('fs');var Redis=require(_0x4fb4('0x5'));var db=require(_0x4fb4('0x6'))['db'];var utils=require(_0x4fb4('0x7'));var logger=require('../../config/logger')(_0x4fb4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4fb4('0x9')][_0x4fb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24484c,_0x3b6d8a,_0x2d0099){return new BPromise(function(_0xd9a3d6,_0x4ca13c){return client[_0x4fb4('0xb')](_0x24484c,_0x2d0099)[_0x4fb4('0xc')](function(_0xf1d662){logger[_0x4fb4('0xd')](_0x4fb4('0xe'),_0x3b6d8a,_0x4fb4('0xf'));logger[_0x4fb4('0x10')](_0x4fb4('0x11'),_0x3b6d8a,_0x4fb4('0xf'),JSON[_0x4fb4('0x12')](_0xf1d662));if(_0xf1d662[_0x4fb4('0x13')]){if(_0xf1d662[_0x4fb4('0x13')][_0x4fb4('0x14')]===0x1f4){logger[_0x4fb4('0x13')](_0x4fb4('0xe'),_0x3b6d8a,_0xf1d662[_0x4fb4('0x13')][_0x4fb4('0x15')]);return _0x4ca13c(_0xf1d662[_0x4fb4('0x13')][_0x4fb4('0x15')]);}logger[_0x4fb4('0x13')](_0x4fb4('0xe'),_0x3b6d8a,_0xf1d662['error'][_0x4fb4('0x15')]);return _0xd9a3d6(_0xf1d662[_0x4fb4('0x13')][_0x4fb4('0x15')]);}else{logger[_0x4fb4('0xd')](_0x4fb4('0xe'),_0x3b6d8a,'request\x20sent');_0xd9a3d6(_0xf1d662[_0x4fb4('0x16')][_0x4fb4('0x15')]);}})['catch'](function(_0xb6bd10){logger[_0x4fb4('0x13')](_0x4fb4('0xe'),_0x3b6d8a,_0xb6bd10);_0x4ca13c(_0xb6bd10);});});}exports[_0x4fb4('0x17')]=function(_0x2119e6){var _0xacea42=this;return new Promise(function(_0x838c25,_0xe88d25){return db[_0x4fb4('0x18')][_0x4fb4('0x19')](_0x2119e6['body'],{'raw':_0x2119e6[_0x4fb4('0x1a')]?_0x2119e6['options']['raw']===undefined?!![]:![]:!![]})[_0x4fb4('0xc')](function(_0x1326a2){logger[_0x4fb4('0xd')](_0x4fb4('0x17'),_0x2119e6);logger[_0x4fb4('0x10')]('CreateVoiceDialReport',_0x2119e6,JSON[_0x4fb4('0x12')](_0x1326a2));_0x838c25(_0x1326a2);})['catch'](function(_0xfa049f){logger[_0x4fb4('0x13')](_0x4fb4('0x17'),_0xfa049f[_0x4fb4('0x15')],_0x2119e6);_0xe88d25(_0xacea42[_0x4fb4('0x13')](0x1f4,_0xfa049f[_0x4fb4('0x15')]));});});};exports[_0x4fb4('0x1b')]=function(_0x1ff6ec){var _0x44fae6=this;return new Promise(function(_0x5569b2,_0x42387d){return db[_0x4fb4('0x18')][_0x4fb4('0x1c')](_0x1ff6ec[_0x4fb4('0x1d')],{'raw':_0x1ff6ec[_0x4fb4('0x1a')]?_0x1ff6ec[_0x4fb4('0x1a')][_0x4fb4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff6ec[_0x4fb4('0x1a')]?_0x1ff6ec[_0x4fb4('0x1a')]['where']||null:null,'attributes':_0x1ff6ec['options']?_0x1ff6ec[_0x4fb4('0x1a')][_0x4fb4('0x1f')]||null:null,'limit':_0x1ff6ec[_0x4fb4('0x1a')]?_0x1ff6ec[_0x4fb4('0x1a')]['limit']||null:null})[_0x4fb4('0xc')](function(_0xf55e3b){logger[_0x4fb4('0xd')](_0x4fb4('0x1b'),_0x1ff6ec);logger[_0x4fb4('0x10')]('UpdateVoiceDialReport',_0x1ff6ec,JSON[_0x4fb4('0x12')](_0xf55e3b));_0x5569b2(_0xf55e3b);})['catch'](function(_0x498799){logger[_0x4fb4('0x13')](_0x4fb4('0x1b'),_0x498799[_0x4fb4('0x15')],_0x1ff6ec);_0x42387d(_0x44fae6[_0x4fb4('0x13')](0x1f4,_0x498799['message']));});});};
\ No newline at end of file
+var _0xbf65=['UpdateVoiceDialReport','VoiceDialReport','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','debug','CreateVoiceDialReport'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xbf65,0x1a5));var _0x5bf6=function(_0x27f2b9,_0x144e11){_0x27f2b9=_0x27f2b9-0x0;var _0x440385=_0xbf65[_0x27f2b9];return _0x440385;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5bf6('0x0'));var BPromise=require(_0x5bf6('0x1'));var rs=require(_0x5bf6('0x2'));var fs=require('fs');var Redis=require(_0x5bf6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bf6('0x4'))(_0x5bf6('0x5'));var config=require(_0x5bf6('0x6'));var jayson=require(_0x5bf6('0x7'));var client=jayson[_0x5bf6('0x8')][_0x5bf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43c203,_0x151abd,_0x1b3cb7){return new BPromise(function(_0x1d3837,_0x221bd2){return client[_0x5bf6('0xa')](_0x43c203,_0x1b3cb7)[_0x5bf6('0xb')](function(_0x309062){logger[_0x5bf6('0xc')](_0x5bf6('0xd'),_0x151abd,_0x5bf6('0xe'));logger['debug'](_0x5bf6('0xf'),_0x151abd,'request\x20sent',JSON[_0x5bf6('0x10')](_0x309062));if(_0x309062[_0x5bf6('0x11')]){if(_0x309062[_0x5bf6('0x11')][_0x5bf6('0x12')]===0x1f4){logger[_0x5bf6('0x11')](_0x5bf6('0xd'),_0x151abd,_0x309062[_0x5bf6('0x11')][_0x5bf6('0x13')]);return _0x221bd2(_0x309062[_0x5bf6('0x11')][_0x5bf6('0x13')]);}logger[_0x5bf6('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x151abd,_0x309062['error'][_0x5bf6('0x13')]);return _0x1d3837(_0x309062[_0x5bf6('0x11')][_0x5bf6('0x13')]);}else{logger['info'](_0x5bf6('0xd'),_0x151abd,_0x5bf6('0xe'));_0x1d3837(_0x309062['result'][_0x5bf6('0x13')]);}})[_0x5bf6('0x14')](function(_0x91c470){logger[_0x5bf6('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x151abd,_0x91c470);_0x221bd2(_0x91c470);});});}exports['CreateVoiceDialReport']=function(_0x1b186e){var _0x3b394d=this;return new Promise(function(_0x3fa9a3,_0x32b81e){return db['VoiceDialReport'][_0x5bf6('0x15')](_0x1b186e[_0x5bf6('0x16')],{'raw':_0x1b186e[_0x5bf6('0x17')]?_0x1b186e[_0x5bf6('0x17')][_0x5bf6('0x18')]===undefined?!![]:![]:!![]})[_0x5bf6('0xb')](function(_0x3a2e84){logger['info']('CreateVoiceDialReport',_0x1b186e);logger[_0x5bf6('0x19')](_0x5bf6('0x1a'),_0x1b186e,JSON[_0x5bf6('0x10')](_0x3a2e84));_0x3fa9a3(_0x3a2e84);})[_0x5bf6('0x14')](function(_0x4f88b7){logger[_0x5bf6('0x11')](_0x5bf6('0x1a'),_0x4f88b7[_0x5bf6('0x13')],_0x1b186e);_0x32b81e(_0x3b394d[_0x5bf6('0x11')](0x1f4,_0x4f88b7[_0x5bf6('0x13')]));});});};exports[_0x5bf6('0x1b')]=function(_0x35880c){var _0x2bd265=this;return new Promise(function(_0x545ca7,_0x27c67d){return db[_0x5bf6('0x1c')]['update'](_0x35880c[_0x5bf6('0x16')],{'raw':_0x35880c[_0x5bf6('0x17')]?_0x35880c[_0x5bf6('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35880c[_0x5bf6('0x17')]?_0x35880c[_0x5bf6('0x17')][_0x5bf6('0x1d')]||null:null,'attributes':_0x35880c[_0x5bf6('0x17')]?_0x35880c[_0x5bf6('0x17')][_0x5bf6('0x1e')]||null:null,'limit':_0x35880c[_0x5bf6('0x17')]?_0x35880c[_0x5bf6('0x17')][_0x5bf6('0x1f')]||null:null})[_0x5bf6('0xb')](function(_0x113dbf){logger[_0x5bf6('0xc')]('UpdateVoiceDialReport',_0x35880c);logger['debug']('UpdateVoiceDialReport',_0x35880c,JSON[_0x5bf6('0x10')](_0x113dbf));_0x545ca7(_0x113dbf);})['catch'](function(_0x33f5ce){logger[_0x5bf6('0x11')](_0x5bf6('0x1b'),_0x33f5ce[_0x5bf6('0x13')],_0x35880c);_0x27c67d(_0x2bd265[_0x5bf6('0x11')](0x1f4,_0x33f5ce[_0x5bf6('0x13')]));});});};
\ No newline at end of file
index 400a0f4..62c7ec0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd254=['get','isAuthenticated','/:id','show','post','addApplications','put','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xd254,0xcc));var _0x4d25=function(_0x1c0e28,_0xd5ce2f){_0x1c0e28=_0x1c0e28-0x0;var _0x5ca618=_0xd254[_0x1c0e28];return _0x5ca618;};'use strict';var multer=require(_0x4d25('0x0'));var util=require(_0x4d25('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d25('0x2')]();var fs_extra=require(_0x4d25('0x3'));var auth=require(_0x4d25('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4d25('0x5'));var controller=require('./voiceExtension.controller');router[_0x4d25('0x6')]('/',auth[_0x4d25('0x7')](),controller['index']);router[_0x4d25('0x6')](_0x4d25('0x8'),auth[_0x4d25('0x7')](),controller[_0x4d25('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4d25('0xa')]('/:id/applications',auth[_0x4d25('0x7')](),controller[_0x4d25('0xb')]);router[_0x4d25('0xc')]('/:id',auth[_0x4d25('0x7')](),controller['update']);router['delete'](_0x4d25('0x8'),auth[_0x4d25('0x7')](),controller[_0x4d25('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x1d41=['fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','index','/:id','show','isAuthenticated','create','post','addApplications','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1d41,0xed));var _0x11d4=function(_0x340756,_0xad31ae){_0x340756=_0x340756-0x0;var _0x2ef745=_0x1d41[_0x340756];return _0x2ef745;};'use strict';var multer=require(_0x11d4('0x0'));var util=require('util');var path=require(_0x11d4('0x1'));var timeout=require(_0x11d4('0x2'));var express=require(_0x11d4('0x3'));var router=express[_0x11d4('0x4')]();var fs_extra=require(_0x11d4('0x5'));var auth=require(_0x11d4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x11d4('0x7'));var controller=require(_0x11d4('0x8'));router[_0x11d4('0x9')]('/',auth['isAuthenticated'](),controller[_0x11d4('0xa')]);router[_0x11d4('0x9')](_0x11d4('0xb'),auth['isAuthenticated'](),controller[_0x11d4('0xc')]);router['post']('/',auth[_0x11d4('0xd')](),controller[_0x11d4('0xe')]);router[_0x11d4('0xf')]('/:id/applications',auth[_0x11d4('0xd')](),controller[_0x11d4('0x10')]);router[_0x11d4('0x11')](_0x11d4('0xb'),auth['isAuthenticated'](),controller[_0x11d4('0x12')]);router[_0x11d4('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x11d4('0x14')]);module[_0x11d4('0x15')]=router;
\ No newline at end of file
index c6ee317..a1f785e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf19a=['inbound','outbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xf19a,0x1ec));var _0xaf19=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0xf19a[_0x179c4a];return _0x5d1879;};'use strict';var Sequelize=require(_0xaf19('0x0'));module[_0xaf19('0x1')]={'context':{'type':Sequelize[_0xaf19('0x2')],'allowNull':![],'unique':_0xaf19('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xaf19('0x2')],'allowNull':![],'unique':_0xaf19('0x3')},'priority':{'type':Sequelize[_0xaf19('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xaf19('0x3')},'tag':{'type':Sequelize[_0xaf19('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xaf19('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xaf19('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xaf19('0x4'),_0xaf19('0x5'),_0xaf19('0x6'),_0xaf19('0x7'),_0xaf19('0x8'),_0xaf19('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xaf19('0x2')]},'interval':{'type':Sequelize[_0xaf19('0x2')],'allowNull':![],'defaultValue':_0xaf19('0xa')},'IntervalId':{'type':Sequelize[_0xaf19('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xaf19('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xaf19('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xaf19('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xaf19('0xb')]},'recordingFormat':{'type':Sequelize[_0xaf19('0x2')],'defaultValue':_0xaf19('0xd')},'answer':{'type':Sequelize[_0xaf19('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xaf19('0xe')],'get':function(_0x21228e){return this['getDataValue'](_0xaf19('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x0501=['inbound','internal','inbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','exten','sequelize','STRING','compositeIndex','ENUM'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0501,0x14e));var _0x1050=function(_0x2b7858,_0x23c7c2){_0x2b7858=_0x2b7858-0x0;var _0xb7f58f=_0x0501[_0x2b7858];return _0xb7f58f;};'use strict';var Sequelize=require(_0x1050('0x0'));module['exports']={'context':{'type':Sequelize[_0x1050('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1050('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x1050('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x1050('0x2')},'tag':{'type':Sequelize[_0x1050('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x1050('0x3')](_0x1050('0x4'),'outbound',_0x1050('0x5'),_0x1050('0x6'),'outbound-fax','system',_0x1050('0x7')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1050('0x1')],'allowNull':![],'defaultValue':_0x1050('0x8')},'IntervalId':{'type':Sequelize[_0x1050('0x9')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1050('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x1050('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x1050('0x1')],'defaultValue':_0x1050('0xb')},'answer':{'type':Sequelize[_0x1050('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4b73d4){return this['getDataValue'](_0x1050('0xc'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 204d5ea..587bb9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18bd=['merge','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','cutdigits','mandatoryDisposition','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','./voiceExtension.socket','register','status','end','offset','undefined','count','set','Content-Range','json','destroy','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','then','sendStatus','error','send','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filters','where','VIRTUAL','options','findAll','rows','catch','show','params','length','includeAll','include'];(function(_0x259ff2,_0x36167c){var _0x1ab636=function(_0x48b48c){while(--_0x48b48c){_0x259ff2['push'](_0x259ff2['shift']());}};_0x1ab636(++_0x36167c);}(_0x18bd,0x73));var _0xd18b=function(_0x962282,_0x13aaf6){_0x962282=_0x962282-0x0;var _0x115fe4=_0x18bd[_0x962282];return _0x115fe4;};'use strict';var _=require(_0xd18b('0x0'));var Redis=require(_0xd18b('0x1'));var qs=require(_0xd18b('0x2'));var logger=require(_0xd18b('0x3'))('api');var config=require(_0xd18b('0x4'));var db=require('../../mysqldb')['db'];config[_0xd18b('0x5')]=_[_0xd18b('0x6')](config[_0xd18b('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd18b('0x5')]));require(_0xd18b('0x7'))[_0xd18b('0x8')](socket);function respondWithStatusCode(_0x556201,_0x54eb3d){_0x54eb3d=_0x54eb3d||0xcc;return function(_0x25d088){if(_0x25d088){return _0x556201['sendStatus'](_0x54eb3d);}return _0x556201[_0xd18b('0x9')](_0x54eb3d)[_0xd18b('0xa')]();};}function respondWithResult(_0x2c27e0,_0x51e8ca){_0x51e8ca=_0x51e8ca||0xc8;return function(_0x2bf91f){if(_0x2bf91f){return _0x2c27e0[_0xd18b('0x9')](_0x51e8ca)['json'](_0x2bf91f);}};}function respondWithFilteredResult(_0x2b2b9a,_0x100048){return function(_0x21d043){if(_0x21d043){var _0x46d084=typeof _0x100048[_0xd18b('0xb')]===_0xd18b('0xc')&&typeof _0x100048['limit']===_0xd18b('0xc');var _0x4fae3b=_0x21d043['count'];var _0xc07485=_0x46d084?0x0:_0x100048[_0xd18b('0xb')];var _0x396cf7=_0x46d084?_0x21d043[_0xd18b('0xd')]:_0x100048[_0xd18b('0xb')]+_0x100048['limit'];var _0x2eeeb7;if(_0x396cf7>=_0x4fae3b){_0x396cf7=_0x4fae3b;_0x2eeeb7=0xc8;}else{_0x2eeeb7=0xce;}_0x2b2b9a[_0xd18b('0x9')](_0x2eeeb7);return _0x2b2b9a[_0xd18b('0xe')](_0xd18b('0xf'),_0xc07485+'-'+_0x396cf7+'/'+_0x4fae3b)[_0xd18b('0x10')](_0x21d043);}return null;};}function removeEntity(_0x1f41d6){return function(_0x2eecdc){if(_0x2eecdc){return _0x2eecdc[_0xd18b('0x11')]()['then'](function(){var _0x42f3ef=_0x2eecdc[_0xd18b('0x12')]({'plain':!![]});var _0x2cad96=[{'name':_0xd18b('0x13'),'value':_0xd18b('0x14'),'ignore':![]},{'name':'OutboundRoutes','value':_0xd18b('0x15'),'ignore':![]},{'name':_0xd18b('0x16'),'value':_0xd18b('0x17'),'ignore':![]}];var _0x1609bc=_(_0x2cad96)[_0xd18b('0x18')](_0xd18b('0x19'))[_0xd18b('0x1a')](_0xd18b('0x1b'))[_0xd18b('0x1b')]();if(_[_0xd18b('0x1c')](_0x1609bc,_0x42f3ef[_0xd18b('0x1d')])){return;}var _0x44859d=_[_0xd18b('0x1e')](_0x2cad96,['value',_0x42f3ef['type']])[_0xd18b('0x1f')];return db[_0xd18b('0x20')][_0xd18b('0x11')]({'where':{'type':_0x44859d,'resourceId':_0x42f3ef['id']}})[_0xd18b('0x21')](function(){return _0x2eecdc;});})[_0xd18b('0x21')](function(){_0x1f41d6[_0xd18b('0x9')](0xcc)[_0xd18b('0xa')]();});}};}function handleEntityNotFound(_0x292b6a){return function(_0x438056){if(!_0x438056){_0x292b6a[_0xd18b('0x22')](0x194);}return _0x438056;};}function handleError(_0x15a712,_0x3ec467){_0x3ec467=_0x3ec467||0x1f4;return function(_0x1e57e7){logger[_0xd18b('0x23')](_0x1e57e7['stack']);if(_0x1e57e7[_0xd18b('0x1f')]){delete _0x1e57e7[_0xd18b('0x1f')];}_0x15a712['status'](_0x3ec467)[_0xd18b('0x24')](_0x1e57e7);};}exports[_0xd18b('0x25')]=function(_0x25d7a6,_0x10e789){var _0x494a70={},_0x3c8020={},_0x204199={'count':0x0,'rows':[]};var _0x1af354=_[_0xd18b('0x1a')](db[_0xd18b('0x26')][_0xd18b('0x27')],function(_0x169ec2){return{'name':_0x169ec2[_0xd18b('0x28')],'type':_0x169ec2[_0xd18b('0x1d')][_0xd18b('0x29')]};});_0x3c8020[_0xd18b('0x2a')]=_['map'](_0x1af354,_0xd18b('0x1f'));_0x3c8020['query']=_[_0xd18b('0x2b')](_0x25d7a6[_0xd18b('0x2c')]);_0x3c8020['filters']=_[_0xd18b('0x2d')](_0x3c8020['model'],_0x3c8020[_0xd18b('0x2c')]);_0x494a70[_0xd18b('0x2e')]=_[_0xd18b('0x2d')](_0x3c8020[_0xd18b('0x2a')],qs['fields'](_0x25d7a6[_0xd18b('0x2c')][_0xd18b('0x2f')]));_0x494a70[_0xd18b('0x2e')]=_0x494a70[_0xd18b('0x2e')]['length']?_0x494a70['attributes']:_0x3c8020[_0xd18b('0x2a')];if(!_0x25d7a6[_0xd18b('0x2c')][_0xd18b('0x30')](_0xd18b('0x31'))){_0x494a70[_0xd18b('0x32')]=qs[_0xd18b('0x32')](_0x25d7a6[_0xd18b('0x2c')][_0xd18b('0x32')]);_0x494a70['offset']=qs['offset'](_0x25d7a6[_0xd18b('0x2c')][_0xd18b('0xb')]);}_0x494a70['order']=qs[_0xd18b('0x33')](_0x25d7a6[_0xd18b('0x2c')]['sort']);_0x494a70['where']=qs['filters'](_[_0xd18b('0x34')](_0x25d7a6[_0xd18b('0x2c')],_0x3c8020[_0xd18b('0x35')]),_0x1af354);if(_0x25d7a6['query']['filter']){_0x494a70[_0xd18b('0x36')]=_['merge'](_0x494a70['where'],{'$or':_['map'](_0x1af354,function(_0xedf749){if(_0xedf749['type']!==_0xd18b('0x37')){var _0x336ccb={};_0x336ccb[_0xedf749['name']]={'$like':'%'+_0x25d7a6[_0xd18b('0x2c')]['filter']+'%'};return _0x336ccb;}})});}_0x494a70=_['merge']({},_0x494a70,_0x25d7a6[_0xd18b('0x38')]);var _0x188a6c={'where':_0x494a70['where']};return db[_0xd18b('0x26')][_0xd18b('0xd')](_0x188a6c)['then'](function(_0x2d99cc){_0x204199[_0xd18b('0xd')]=_0x2d99cc;if(_0x25d7a6['query']['includeAll']){_0x494a70['include']=[{'all':!![]}];}return db[_0xd18b('0x26')][_0xd18b('0x39')](_0x494a70);})[_0xd18b('0x21')](function(_0x2ad614){_0x204199[_0xd18b('0x3a')]=_0x2ad614;return _0x204199;})[_0xd18b('0x21')](respondWithFilteredResult(_0x10e789,_0x494a70))[_0xd18b('0x3b')](handleError(_0x10e789,null));};exports[_0xd18b('0x3c')]=function(_0x48c803,_0x216755){var _0x3f131d={'raw':![],'where':{'id':_0x48c803[_0xd18b('0x3d')]['id']}},_0x104e57={};_0x104e57[_0xd18b('0x2a')]=_['keys'](db[_0xd18b('0x26')][_0xd18b('0x27')]);_0x104e57[_0xd18b('0x2c')]=_[_0xd18b('0x2b')](_0x48c803[_0xd18b('0x2c')]);_0x104e57[_0xd18b('0x35')]=_[_0xd18b('0x2d')](_0x104e57[_0xd18b('0x2a')],_0x104e57[_0xd18b('0x2c')]);_0x3f131d['attributes']=_[_0xd18b('0x2d')](_0x104e57['model'],qs[_0xd18b('0x2f')](_0x48c803[_0xd18b('0x2c')][_0xd18b('0x2f')]));_0x3f131d['attributes']=_0x3f131d[_0xd18b('0x2e')][_0xd18b('0x3e')]?_0x3f131d['attributes']:_0x104e57[_0xd18b('0x2a')];if(_0x48c803[_0xd18b('0x2c')][_0xd18b('0x3f')]){_0x3f131d[_0xd18b('0x40')]=[{'all':!![]}];}_0x3f131d=_[_0xd18b('0x41')]({},_0x3f131d,_0x48c803['options']);return db[_0xd18b('0x26')][_0xd18b('0x1e')](_0x3f131d)[_0xd18b('0x21')](handleEntityNotFound(_0x216755,null))[_0xd18b('0x21')](respondWithResult(_0x216755,null))['catch'](handleError(_0x216755,null));};exports[_0xd18b('0x11')]=function(_0x40fe46,_0x3b6991){return db[_0xd18b('0x26')][_0xd18b('0x1e')]({'where':{'id':_0x40fe46[_0xd18b('0x3d')]['id']}})[_0xd18b('0x21')](handleEntityNotFound(_0x3b6991,null))[_0xd18b('0x21')](removeEntity(_0x3b6991,null))[_0xd18b('0x3b')](handleError(_0x3b6991,null));};exports['create']=function(_0x18263d,_0x59d43b){if(_0x18263d[_0xd18b('0x42')][_0xd18b('0x1d')]===_0xd18b('0x15')&&!_[_0xd18b('0x43')](_0x18263d['body'][_0xd18b('0x44')],'_')){_0x18263d['body'][_0xd18b('0x44')]='_'[_0xd18b('0x45')](_0x18263d[_0xd18b('0x42')]['exten']);}return db[_0xd18b('0x26')]['create'](_0x18263d[_0xd18b('0x42')],{'raw':![]})['then'](function(_0x5a8ac4){var _0x3f104f=_0x18263d[_0xd18b('0x46')][_0xd18b('0x12')]({'plain':!![]});if(!_0x3f104f)throw new Error(_0xd18b('0x47'));if(_0x3f104f['role']===_0xd18b('0x46')){var _0x4d3e17=_0x5a8ac4[_0xd18b('0x12')]({'plain':!![]});var _0x46b159=[{'name':'InboundRoutes','value':'inbound'},{'name':'OutboundRoutes','value':_0xd18b('0x15')},{'name':_0xd18b('0x16'),'value':_0xd18b('0x17')}];var _0x58d8a8=_[_0xd18b('0x1e')](_0x46b159,[_0xd18b('0x1b'),_0x4d3e17[_0xd18b('0x1d')]])[_0xd18b('0x1f')];return db[_0xd18b('0x48')][_0xd18b('0x1e')]({'where':{'name':_0x58d8a8,'userProfileId':_0x3f104f[_0xd18b('0x49')]},'raw':!![]})[_0xd18b('0x21')](function(_0x4d2ada){if(_0x4d2ada&&_0x4d2ada[_0xd18b('0x4a')]===0x0){return db['UserProfileResource'][_0xd18b('0x4b')]({'name':_0x4d3e17[_0xd18b('0x1f')],'resourceId':_0x4d3e17['id'],'type':_0x4d2ada[_0xd18b('0x1f')],'sectionId':_0x4d2ada['id']},{})[_0xd18b('0x21')](function(){return _0x5a8ac4;});}else{return _0x5a8ac4;}})['catch'](function(_0x43005c){logger[_0xd18b('0x23')](_0xd18b('0x4c'),_0x43005c);throw _0x43005c;});}return _0x5a8ac4;})[_0xd18b('0x21')](respondWithResult(_0x59d43b,0xc9))[_0xd18b('0x3b')](handleError(_0x59d43b,null));};exports[_0xd18b('0x4d')]=function(_0x3bcf9a,_0x138589){if(_0x3bcf9a[_0xd18b('0x42')]['id']){delete _0x3bcf9a[_0xd18b('0x42')]['id'];}return db[_0xd18b('0x26')]['find']({'where':{'id':_0x3bcf9a[_0xd18b('0x3d')]['id']}})[_0xd18b('0x21')](handleEntityNotFound(_0x138589,null))[_0xd18b('0x21')](function(_0x101d86){if(_0x101d86){return db[_0xd18b('0x26')][_0xd18b('0x4d')](_[_0xd18b('0x34')](_0x3bcf9a[_0xd18b('0x42')],['exten',_0xd18b('0x4e'),'description','recordingFormat',_0xd18b('0x4f'),_0xd18b('0x50'),'alias']),{'where':{'context':_0x101d86[_0xd18b('0x4e')],'exten':_0x101d86[_0xd18b('0x44')]},'individualHooks':!![]})[_0xd18b('0x21')](function(_0x24d950){return _0x24d950;});}return null;})[_0xd18b('0x21')](respondWithStatusCode(_0x138589,null))[_0xd18b('0x3b')](handleError(_0x138589,null));};exports['addApplications']=function(_0x29b0a7,_0x1c71d6){var _0x13c506=_0x29b0a7[_0xd18b('0x3d')]['id'];var _0x134035=_0x29b0a7[_0xd18b('0x42')];var _0x75fb75=0xc8;var _0x3da1ef=null;return db[_0xd18b('0x51')][_0xd18b('0x52')]({'isolationLevel':db[_0xd18b('0x51')]['Transaction'][_0xd18b('0x53')][_0xd18b('0x54')]},function(_0x5d4657){return db['VoiceExtension'][_0xd18b('0x55')]({'where':{'id':_0x13c506},'transaction':_0x5d4657})['then'](function(_0x50cdf1){if(_0x50cdf1){return db[_0xd18b('0x26')][_0xd18b('0x11')]({'where':{'VoiceExtensionId':_0x13c506},'transaction':_0x5d4657})[_0xd18b('0x21')](function(){var _0x5e5723=_[_0xd18b('0x1a')](_0x134035,function(_0x27f493){_0x27f493['VoiceExtensionId']=_0x13c506;_0x27f493[_0xd18b('0x56')]=!![];return _0x27f493;});return _0x50cdf1[_0xd18b('0x57')](_0x5e5723);})[_0xd18b('0x21')](function(_0x4ba61c){return db[_0xd18b('0x26')][_0xd18b('0x58')](_0x4ba61c,{'transaction':_0x5d4657});});}else{_0x75fb75=0x194;_0x3da1ef=[];}});})['then'](function(){if(_0x75fb75!==0x194){return db[_0xd18b('0x26')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x13c506},'order':_0xd18b('0x59')})[_0xd18b('0x21')](function(_0x22937f){_0x3da1ef=_0x22937f;});}})[_0xd18b('0x3b')](function(_0x4b3852){_0x75fb75=0x1f4;logger[_0xd18b('0x23')](_0x4b3852['stack']);if(_0x4b3852[_0xd18b('0x1f')]){delete _0x4b3852[_0xd18b('0x1f')];}_0x3da1ef=_0x4b3852;})['finally'](function(){if(_0x3da1ef===null){_0x1c71d6[_0xd18b('0x22')](_0x75fb75);}else{if(_0x75fb75===0x1f4){_0x1c71d6['status'](_0x75fb75)[_0xd18b('0x24')](_0x3da1ef);}else{_0x1c71d6['status'](_0x75fb75)[_0xd18b('0x10')](_0x3da1ef);}}});};
\ No newline at end of file
+var _0x0c8a=['context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','finally','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','then','InboundRoutes','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x103bb8,_0x60aaa2){var _0x2df356=function(_0x3b2dae){while(--_0x3b2dae){_0x103bb8['push'](_0x103bb8['shift']());}};_0x2df356(++_0x60aaa2);}(_0x0c8a,0x125));var _0xa0c8=function(_0x5dca83,_0xa78c1f){_0x5dca83=_0x5dca83-0x0;var _0x152e24=_0x0c8a[_0x5dca83];return _0x152e24;};'use strict';var _=require(_0xa0c8('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xa0c8('0x1'))(_0xa0c8('0x2'));var config=require(_0xa0c8('0x3'));var db=require(_0xa0c8('0x4'))['db'];config[_0xa0c8('0x5')]=_[_0xa0c8('0x6')](config[_0xa0c8('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0c8('0x7'))(new Redis(config[_0xa0c8('0x5')]));require(_0xa0c8('0x8'))[_0xa0c8('0x9')](socket);function respondWithStatusCode(_0x363f4f,_0x5165fd){_0x5165fd=_0x5165fd||0xcc;return function(_0x16ad32){if(_0x16ad32){return _0x363f4f[_0xa0c8('0xa')](_0x5165fd);}return _0x363f4f[_0xa0c8('0xb')](_0x5165fd)[_0xa0c8('0xc')]();};}function respondWithResult(_0x59dcb3,_0x520dc4){_0x520dc4=_0x520dc4||0xc8;return function(_0x308794){if(_0x308794){return _0x59dcb3[_0xa0c8('0xb')](_0x520dc4)[_0xa0c8('0xd')](_0x308794);}};}function respondWithFilteredResult(_0x13825a,_0x4f5971){return function(_0x32e90e){if(_0x32e90e){var _0x5c390d=typeof _0x4f5971[_0xa0c8('0xe')]==='undefined'&&typeof _0x4f5971[_0xa0c8('0xf')]===_0xa0c8('0x10');var _0xf3b34=_0x32e90e['count'];var _0x50c92b=_0x5c390d?0x0:_0x4f5971[_0xa0c8('0xe')];var _0x55c7a4=_0x5c390d?_0x32e90e[_0xa0c8('0x11')]:_0x4f5971['offset']+_0x4f5971[_0xa0c8('0xf')];var _0x40d86b;if(_0x55c7a4>=_0xf3b34){_0x55c7a4=_0xf3b34;_0x40d86b=0xc8;}else{_0x40d86b=0xce;}_0x13825a['status'](_0x40d86b);return _0x13825a['set']('Content-Range',_0x50c92b+'-'+_0x55c7a4+'/'+_0xf3b34)[_0xa0c8('0xd')](_0x32e90e);}return null;};}function removeEntity(_0x429dd7){return function(_0x264e97){if(_0x264e97){return _0x264e97['destroy']()[_0xa0c8('0x12')](function(){var _0x435e8c=_0x264e97['get']({'plain':!![]});var _0x30e6ba=[{'name':_0xa0c8('0x13'),'value':'inbound','ignore':![]},{'name':_0xa0c8('0x14'),'value':_0xa0c8('0x15'),'ignore':![]},{'name':'InternalRoutes','value':_0xa0c8('0x16'),'ignore':![]}];var _0x36a605=_(_0x30e6ba)[_0xa0c8('0x17')](_0xa0c8('0x18'))[_0xa0c8('0x19')](_0xa0c8('0x1a'))[_0xa0c8('0x1a')]();if(_[_0xa0c8('0x1b')](_0x36a605,_0x435e8c[_0xa0c8('0x1c')])){return;}var _0x275c89=_[_0xa0c8('0x1d')](_0x30e6ba,[_0xa0c8('0x1a'),_0x435e8c[_0xa0c8('0x1c')]])[_0xa0c8('0x1e')];return db[_0xa0c8('0x1f')][_0xa0c8('0x20')]({'where':{'type':_0x275c89,'resourceId':_0x435e8c['id']}})[_0xa0c8('0x12')](function(){return _0x264e97;});})[_0xa0c8('0x12')](function(){_0x429dd7[_0xa0c8('0xb')](0xcc)[_0xa0c8('0xc')]();});}};}function handleEntityNotFound(_0x3df7e2){return function(_0x2563a5){if(!_0x2563a5){_0x3df7e2[_0xa0c8('0xa')](0x194);}return _0x2563a5;};}function handleError(_0x32f286,_0x4aebe1){_0x4aebe1=_0x4aebe1||0x1f4;return function(_0x54ffe3){logger[_0xa0c8('0x21')](_0x54ffe3[_0xa0c8('0x22')]);if(_0x54ffe3[_0xa0c8('0x1e')]){delete _0x54ffe3[_0xa0c8('0x1e')];}_0x32f286[_0xa0c8('0xb')](_0x4aebe1)[_0xa0c8('0x23')](_0x54ffe3);};}exports['index']=function(_0x25f310,_0x186206){var _0x474add={},_0x3a727d={},_0x5c9f8e={'count':0x0,'rows':[]};var _0x505072=_[_0xa0c8('0x19')](db[_0xa0c8('0x24')][_0xa0c8('0x25')],function(_0x282dd1){return{'name':_0x282dd1[_0xa0c8('0x26')],'type':_0x282dd1[_0xa0c8('0x1c')][_0xa0c8('0x27')]};});_0x3a727d[_0xa0c8('0x28')]=_[_0xa0c8('0x19')](_0x505072,_0xa0c8('0x1e'));_0x3a727d['query']=_['keys'](_0x25f310[_0xa0c8('0x29')]);_0x3a727d[_0xa0c8('0x2a')]=_[_0xa0c8('0x2b')](_0x3a727d['model'],_0x3a727d[_0xa0c8('0x29')]);_0x474add[_0xa0c8('0x2c')]=_[_0xa0c8('0x2b')](_0x3a727d[_0xa0c8('0x28')],qs['fields'](_0x25f310[_0xa0c8('0x29')][_0xa0c8('0x2d')]));_0x474add[_0xa0c8('0x2c')]=_0x474add[_0xa0c8('0x2c')][_0xa0c8('0x2e')]?_0x474add[_0xa0c8('0x2c')]:_0x3a727d[_0xa0c8('0x28')];if(!_0x25f310[_0xa0c8('0x29')][_0xa0c8('0x2f')](_0xa0c8('0x30'))){_0x474add[_0xa0c8('0xf')]=qs[_0xa0c8('0xf')](_0x25f310[_0xa0c8('0x29')][_0xa0c8('0xf')]);_0x474add[_0xa0c8('0xe')]=qs[_0xa0c8('0xe')](_0x25f310['query'][_0xa0c8('0xe')]);}_0x474add[_0xa0c8('0x31')]=qs[_0xa0c8('0x32')](_0x25f310['query'][_0xa0c8('0x32')]);_0x474add[_0xa0c8('0x33')]=qs[_0xa0c8('0x2a')](_[_0xa0c8('0x34')](_0x25f310['query'],_0x3a727d[_0xa0c8('0x2a')]),_0x505072);if(_0x25f310[_0xa0c8('0x29')][_0xa0c8('0x17')]){_0x474add[_0xa0c8('0x33')]=_[_0xa0c8('0x35')](_0x474add[_0xa0c8('0x33')],{'$or':_[_0xa0c8('0x19')](_0x505072,function(_0x1fb0ab){if(_0x1fb0ab['type']!==_0xa0c8('0x36')){var _0x2f8a1b={};_0x2f8a1b[_0x1fb0ab[_0xa0c8('0x1e')]]={'$like':'%'+_0x25f310[_0xa0c8('0x29')][_0xa0c8('0x17')]+'%'};return _0x2f8a1b;}})});}_0x474add=_[_0xa0c8('0x35')]({},_0x474add,_0x25f310[_0xa0c8('0x37')]);var _0x180687={'where':_0x474add[_0xa0c8('0x33')]};return db[_0xa0c8('0x24')]['count'](_0x180687)[_0xa0c8('0x12')](function(_0x279928){_0x5c9f8e[_0xa0c8('0x11')]=_0x279928;if(_0x25f310[_0xa0c8('0x29')][_0xa0c8('0x38')]){_0x474add[_0xa0c8('0x39')]=[{'all':!![]}];}return db['VoiceExtension'][_0xa0c8('0x3a')](_0x474add);})[_0xa0c8('0x12')](function(_0x6ed38c){_0x5c9f8e[_0xa0c8('0x3b')]=_0x6ed38c;return _0x5c9f8e;})[_0xa0c8('0x12')](respondWithFilteredResult(_0x186206,_0x474add))[_0xa0c8('0x3c')](handleError(_0x186206,null));};exports[_0xa0c8('0x3d')]=function(_0x52d48e,_0x1b37b8){var _0x18bd02={'raw':![],'where':{'id':_0x52d48e[_0xa0c8('0x3e')]['id']}},_0x1f1285={};_0x1f1285[_0xa0c8('0x28')]=_[_0xa0c8('0x3f')](db[_0xa0c8('0x24')][_0xa0c8('0x25')]);_0x1f1285[_0xa0c8('0x29')]=_[_0xa0c8('0x3f')](_0x52d48e[_0xa0c8('0x29')]);_0x1f1285[_0xa0c8('0x2a')]=_[_0xa0c8('0x2b')](_0x1f1285[_0xa0c8('0x28')],_0x1f1285[_0xa0c8('0x29')]);_0x18bd02[_0xa0c8('0x2c')]=_['intersection'](_0x1f1285[_0xa0c8('0x28')],qs[_0xa0c8('0x2d')](_0x52d48e['query'][_0xa0c8('0x2d')]));_0x18bd02['attributes']=_0x18bd02[_0xa0c8('0x2c')][_0xa0c8('0x2e')]?_0x18bd02[_0xa0c8('0x2c')]:_0x1f1285['model'];if(_0x52d48e[_0xa0c8('0x29')][_0xa0c8('0x38')]){_0x18bd02[_0xa0c8('0x39')]=[{'all':!![]}];}_0x18bd02=_[_0xa0c8('0x35')]({},_0x18bd02,_0x52d48e[_0xa0c8('0x37')]);return db[_0xa0c8('0x24')]['find'](_0x18bd02)[_0xa0c8('0x12')](handleEntityNotFound(_0x1b37b8,null))['then'](respondWithResult(_0x1b37b8,null))[_0xa0c8('0x3c')](handleError(_0x1b37b8,null));};exports[_0xa0c8('0x20')]=function(_0x4bd2c3,_0x1b4be0){return db[_0xa0c8('0x24')]['find']({'where':{'id':_0x4bd2c3['params']['id']}})[_0xa0c8('0x12')](handleEntityNotFound(_0x1b4be0,null))['then'](removeEntity(_0x1b4be0,null))[_0xa0c8('0x3c')](handleError(_0x1b4be0,null));};exports[_0xa0c8('0x40')]=function(_0x33a1c8,_0x10cf63){if(_0x33a1c8[_0xa0c8('0x41')][_0xa0c8('0x1c')]===_0xa0c8('0x15')&&!_['startsWith'](_0x33a1c8[_0xa0c8('0x41')]['exten'],'_')){_0x33a1c8['body'][_0xa0c8('0x42')]='_'[_0xa0c8('0x43')](_0x33a1c8[_0xa0c8('0x41')][_0xa0c8('0x42')]);}return db[_0xa0c8('0x24')]['create'](_0x33a1c8[_0xa0c8('0x41')],{'raw':![]})['then'](function(_0x22a392){var _0x3229ce=_0x33a1c8['user'][_0xa0c8('0x44')]({'plain':!![]});if(!_0x3229ce)throw new Error(_0xa0c8('0x45'));if(_0x3229ce[_0xa0c8('0x46')]==='user'){var _0x185289=_0x22a392[_0xa0c8('0x44')]({'plain':!![]});var _0x290d97=[{'name':_0xa0c8('0x13'),'value':'inbound'},{'name':_0xa0c8('0x14'),'value':'outbound'},{'name':'InternalRoutes','value':_0xa0c8('0x16')}];var _0x2f1dc0=_['find'](_0x290d97,['value',_0x185289[_0xa0c8('0x1c')]])[_0xa0c8('0x1e')];return db['UserProfileSection'][_0xa0c8('0x1d')]({'where':{'name':_0x2f1dc0,'userProfileId':_0x3229ce[_0xa0c8('0x47')]},'raw':!![]})['then'](function(_0x1f0608){if(_0x1f0608&&_0x1f0608[_0xa0c8('0x48')]===0x0){return db[_0xa0c8('0x1f')][_0xa0c8('0x40')]({'name':_0x185289[_0xa0c8('0x1e')],'resourceId':_0x185289['id'],'type':_0x1f0608[_0xa0c8('0x1e')],'sectionId':_0x1f0608['id']},{})[_0xa0c8('0x12')](function(){return _0x22a392;});}else{return _0x22a392;}})[_0xa0c8('0x3c')](function(_0x268fc4){logger[_0xa0c8('0x21')](_0xa0c8('0x49'),_0x268fc4);throw _0x268fc4;});}return _0x22a392;})[_0xa0c8('0x12')](respondWithResult(_0x10cf63,0xc9))['catch'](handleError(_0x10cf63,null));};exports[_0xa0c8('0x4a')]=function(_0x61a2c9,_0x26f4c7){if(_0x61a2c9[_0xa0c8('0x41')]['id']){delete _0x61a2c9[_0xa0c8('0x41')]['id'];}return db[_0xa0c8('0x24')][_0xa0c8('0x1d')]({'where':{'id':_0x61a2c9[_0xa0c8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x26f4c7,null))['then'](function(_0x554037){if(_0x554037){return db['VoiceExtension'][_0xa0c8('0x4a')](_['pick'](_0x61a2c9['body'],[_0xa0c8('0x42'),_0xa0c8('0x4b'),_0xa0c8('0x4c'),_0xa0c8('0x4d'),_0xa0c8('0x4e'),_0xa0c8('0x4f'),'alias']),{'where':{'context':_0x554037[_0xa0c8('0x4b')],'exten':_0x554037['exten']},'individualHooks':!![]})[_0xa0c8('0x12')](function(_0x187bf7){return _0x187bf7;});}return null;})[_0xa0c8('0x12')](respondWithStatusCode(_0x26f4c7,null))['catch'](handleError(_0x26f4c7,null));};exports[_0xa0c8('0x50')]=function(_0xad7c7d,_0x522261){var _0x1ada8b=_0xad7c7d[_0xa0c8('0x3e')]['id'];var _0x3bc7b1=_0xad7c7d[_0xa0c8('0x41')];var _0x231202=0xc8;var _0x23b0ed=null;return db[_0xa0c8('0x51')]['transaction']({'isolationLevel':db[_0xa0c8('0x51')][_0xa0c8('0x52')][_0xa0c8('0x53')][_0xa0c8('0x54')]},function(_0x133b11){return db['VoiceExtension'][_0xa0c8('0x55')]({'where':{'id':_0x1ada8b},'transaction':_0x133b11})[_0xa0c8('0x12')](function(_0x537187){if(_0x537187){return db['VoiceExtension'][_0xa0c8('0x20')]({'where':{'VoiceExtensionId':_0x1ada8b},'transaction':_0x133b11})[_0xa0c8('0x12')](function(){var _0x16f85f=_['map'](_0x3bc7b1,function(_0xf159b0){_0xf159b0[_0xa0c8('0x56')]=_0x1ada8b;_0xf159b0[_0xa0c8('0x57')]=!![];return _0xf159b0;});return _0x537187[_0xa0c8('0x58')](_0x16f85f);})['then'](function(_0x13c0b8){return db[_0xa0c8('0x24')][_0xa0c8('0x59')](_0x13c0b8,{'transaction':_0x133b11});});}else{_0x231202=0x194;_0x23b0ed=[];}});})[_0xa0c8('0x12')](function(){if(_0x231202!==0x194){return db['VoiceExtension'][_0xa0c8('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1ada8b},'order':'cast(priority\x20as\x20unsigned)'})[_0xa0c8('0x12')](function(_0x559ceb){_0x23b0ed=_0x559ceb;});}})['catch'](function(_0x1962f6){_0x231202=0x1f4;logger[_0xa0c8('0x21')](_0x1962f6[_0xa0c8('0x22')]);if(_0x1962f6[_0xa0c8('0x1e')]){delete _0x1962f6[_0xa0c8('0x1e')];}_0x23b0ed=_0x1962f6;})[_0xa0c8('0x5b')](function(){if(_0x23b0ed===null){_0x522261[_0xa0c8('0xa')](_0x231202);}else{if(_0x231202===0x1f4){_0x522261['status'](_0x231202)['send'](_0x23b0ed);}else{_0x522261[_0xa0c8('0xb')](_0x231202)[_0xa0c8('0xd')](_0x23b0ed);}}});};
\ No newline at end of file
index 9c01f3b..99ab705 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb248=['hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x73d140,_0xfd42b2){var _0x29a520=function(_0x2370c6){while(--_0x2370c6){_0x73d140['push'](_0x73d140['shift']());}};_0x29a520(++_0xfd42b2);}(_0xb248,0x1cd));var _0x8b24=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xb248[_0x1969a7];return _0x3d665f;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x8b24('0x0'))['db'][_0x8b24('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8b24('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b24('0x3'),'afterDestroy':_0x8b24('0x4')};function emitEvent(_0x13acd2){return function(_0x47aed5,_0x486a7c,_0x6f1d5f){VoiceExtensionEvents[_0x8b24('0x5')](_0x13acd2+':'+_0x47aed5['id'],_0x47aed5);VoiceExtensionEvents[_0x8b24('0x5')](_0x13acd2,_0x47aed5);_0x6f1d5f(null);};}for(var e in events){if(events[_0x8b24('0x6')](e)){var event=events[e];VoiceExtension[_0x8b24('0x7')](e,emitEvent(event));}}module[_0x8b24('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x75eb=['update','emit','hasOwnProperty','events','VoiceExtension','setMaxListeners','save'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x75eb,0x10d));var _0xb75e=function(_0x448f83,_0x225ffa){_0x448f83=_0x448f83-0x0;var _0x476a34=_0x75eb[_0x448f83];return _0x476a34;};'use strict';var EventEmitter=require(_0xb75e('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xb75e('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb75e('0x2')](0x0);var events={'afterCreate':_0xb75e('0x3'),'afterUpdate':_0xb75e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5ce78a){return function(_0x5ad1ea,_0x200e21,_0xfa9aff){VoiceExtensionEvents['emit'](_0x5ce78a+':'+_0x5ad1ea['id'],_0x5ad1ea);VoiceExtensionEvents[_0xb75e('0x5')](_0x5ce78a,_0x5ad1ea);_0xfa9aff(null);};}for(var e in events){if(events[_0xb75e('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index a827432..e3a5ba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c9a=['CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','XCALLY-MOTION-ANSWER=1','splice',',${EXTEN},','appdata','priority','concat','catch','VoiceExtension','get','Hangup','last','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','No\x20alias\x20set','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','name','param','phone','prefix','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','filter','toLowerCase','tag'];(function(_0x279cb4,_0x1585dc){var _0x388542=function(_0x8946d9){while(--_0x8946d9){_0x279cb4['push'](_0x279cb4['shift']());}};_0x388542(++_0x1585dc);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x71fe3d,_0x331649){_0x71fe3d=_0x71fe3d-0x0;var _0x4a81ab=_0x1c9a[_0x71fe3d];return _0x4a81ab;};'use strict';var _=require(_0xa1c9('0x0'));var attributes=require(_0xa1c9('0x1'));module['exports']=function(_0x6084bf){var _0x867bbb=_0x6084bf[_0xa1c9('0x2')];function _0x408418(_0x3d8576){var _0x4a0d3d=0x2;var _0x2f883c=[{'type':_0x3d8576['type'],'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0x4')+_0x3d8576[_0xa1c9('0x5')],'context':_0x3d8576[_0xa1c9('0x6')],'exten':_0x3d8576[_0xa1c9('0x7')],'priority':_0x4a0d3d++,'VoiceExtensionId':_0x3d8576['id']},{'type':_0x3d8576[_0xa1c9('0x5')],'app':_0x3d8576[_0xa1c9('0x8')]?_0xa1c9('0x3'):_0xa1c9('0x9'),'appdata':_0x3d8576[_0xa1c9('0x8')]?_0xa1c9('0xa')+_0x3d8576[_0xa1c9('0x8')]:'No\x20alias\x20set','context':_0x3d8576['context'],'exten':_0x3d8576[_0xa1c9('0x7')],'priority':_0x4a0d3d++,'VoiceExtensionId':_0x3d8576['id']}];if(_0x3d8576['type']===_0xa1c9('0xb')){_0x2f883c[_0xa1c9('0xc')]({'type':_0xa1c9('0xb'),'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0xd')+_0x3d8576['id'],'context':_0x3d8576[_0xa1c9('0x6')],'exten':_0x3d8576[_0xa1c9('0x7')],'priority':_0x4a0d3d++,'VoiceExtensionId':_0x3d8576['id']});}_0x2f883c[_0xa1c9('0xc')]({'type':_0x3d8576[_0xa1c9('0x5')],'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0xe'),'context':_0x3d8576[_0xa1c9('0x6')],'exten':_0x3d8576[_0xa1c9('0x7')],'priority':_0x4a0d3d++,'VoiceExtensionId':_0x3d8576['id']},{'type':_0x3d8576[_0xa1c9('0x5')],'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0xf'),'context':_0x3d8576[_0xa1c9('0x6')],'exten':_0x3d8576[_0xa1c9('0x7')],'priority':_0x4a0d3d++,'VoiceExtensionId':_0x3d8576['id']},{'type':_0x3d8576[_0xa1c9('0x5')],'app':_0xa1c9('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3d8576[_0xa1c9('0x6')],'exten':_0x3d8576['exten'],'priority':_0x4a0d3d++,'VoiceExtensionId':_0x3d8576['id']});return _0x2f883c;}function _0x12d989(_0x176ccf){var _0x3f244b=0x2;var _0xcce312=[{'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0x11'),'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':_0x176ccf[_0xa1c9('0x8')]?_0xa1c9('0x3'):'NoOp','appdata':_0x176ccf[_0xa1c9('0x8')]?_0xa1c9('0xa')+_0x176ccf[_0xa1c9('0x8')]:_0xa1c9('0x12'),'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':'CDR(destination)='+(_0x176ccf[_0xa1c9('0x13')]?_0xa1c9('0x14')+_0x176ccf['cutdigits']+'}':_0xa1c9('0x15')),'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':'CDR(routeid)='+_0x176ccf['id'],'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':'ExecIf','appdata':_0xa1c9('0x16')+(_0x3f244b+0x2)+_0xa1c9('0x17')+(_0x3f244b+0x1)+')','context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':_0x176ccf[_0xa1c9('0x13')]?_0xa1c9('0x18')+_0x176ccf[_0xa1c9('0x13')]+'}':_0xa1c9('0x19'),'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0xe'),'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf['exten'],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0xf'),'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':'outbound','app':_0xa1c9('0x3'),'appdata':_0xa1c9('0x1a'),'context':_0x176ccf['context'],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0x1b')+_0x176ccf['id'],'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']}];if(_0x176ccf[_0xa1c9('0x1c')](_0xa1c9('0x1d'))&&_0x176ccf[_0xa1c9('0x1d')]!==_0xa1c9('0x1e')){_0xcce312[_0xa1c9('0xc')]({'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0x1f'),'context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf['exten'],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']},{'type':_0xa1c9('0x10'),'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0x20')+_0x176ccf[_0xa1c9('0x1d')]||'wav','context':_0x176ccf[_0xa1c9('0x6')],'exten':_0x176ccf[_0xa1c9('0x7')],'priority':_0x3f244b++,'VoiceExtensionId':_0x176ccf['id']});}return _0xcce312;}function _0x4eb4fd(_0x5ab2f2,_0x1aae5d){var _0x8bce3a=[{'name':_0xa1c9('0x21'),'param':0x0},{'name':_0xa1c9('0x22'),'param':0x1},{'name':_0xa1c9('0x23'),'param':0x2},{'name':_0xa1c9('0x24'),'param':0x3}];var _0xcedfe3={};var _0x32720c=_0x1aae5d[_0xa1c9('0x25')](',');var _0x277793=[];for(var _0x100381=0x0;_0x100381<_0x8bce3a['length'];_0x100381++){switch(_0x8bce3a[_0x100381][_0xa1c9('0x26')]){case _0xa1c9('0x21'):_0xcedfe3[_0xa1c9('0x21')]=_0x32720c[_0x8bce3a[_0x100381][_0xa1c9('0x27')]][_0xa1c9('0x25')]('/')[0x1];_0xcedfe3[_0xa1c9('0x28')]=_0x32720c[_0x8bce3a[_0x100381][_0xa1c9('0x27')]][_0xa1c9('0x25')]('/')[0x2];_0xcedfe3['prefix']=_0xcedfe3[_0xa1c9('0x28')]?_0xcedfe3[_0xa1c9('0x28')][_0xa1c9('0x25')]('$')[0x0]:undefined;_0xcedfe3['phone']=_0x5ab2f2[_0xa1c9('0x13')]?(_0xcedfe3[_0xa1c9('0x29')]||'')+_0xa1c9('0x14')+_0x5ab2f2[_0xa1c9('0x13')]+'}':(_0xcedfe3[_0xa1c9('0x29')]||'')+_0xa1c9('0x15');_0x277793[_0x8bce3a[_0x100381][_0xa1c9('0x27')]]=['SIP',_0xcedfe3[_0xa1c9('0x21')],_0xcedfe3['phone']][_0xa1c9('0x2a')]('/');break;case'options':_0xcedfe3[_0xa1c9('0x23')]=_0x32720c[_0x8bce3a[_0x100381][_0xa1c9('0x27')]];if(_0x5ab2f2[_0xa1c9('0x1d')]!=='none'){if(_0xcedfe3[_0xa1c9('0x23')]['indexOf'](_0xa1c9('0x2b'))<0x0){_0xcedfe3['options']+='U(xcally-mixmonitor-context)';}}else{_0xcedfe3[_0xa1c9('0x23')]=_0xcedfe3['options'][_0xa1c9('0x2c')]('U(xcally-mixmonitor-context)','');}_0x277793[_0x8bce3a[_0x100381]['param']]=_0xcedfe3[_0xa1c9('0x23')];break;default:_0x277793[_0x8bce3a[_0x100381][_0xa1c9('0x27')]]=_0x32720c[_0x8bce3a[_0x100381][_0xa1c9('0x27')]];}}return _0x277793[_0xa1c9('0x2a')](',');}function _0x568a3c(_0x107f69,_0x52e97b,_0x2d8b5a){return new Promise(function(_0xbaa2f1,_0x3d292d){var _0xb31e7b=[];if(_[_0xa1c9('0x2d')](_0x52e97b))return _0xbaa2f1(_0xb31e7b);_0x867bbb[_0xa1c9('0x2e')][_0xa1c9('0x2f')]({'attributes':['id',_0xa1c9('0x30'),_0xa1c9('0x31')],'raw':!![]})[_0xa1c9('0x32')](function(_0x4cf7c4){for(var _0x46b234=0x0,_0xd25c72=0x0;_0x46b234<_0x52e97b[_0xa1c9('0x33')];_0x46b234++,_0xd25c72=0x0){var _0x93c501=_0x52e97b[_0x46b234];var _0x1663c4=[];var _0x23b72d=[];delete _0x93c501['id'];if(_0x93c501[_0xa1c9('0x30')]!==_0xa1c9('0x34')){_0x93c501[_0xa1c9('0x35')]=[_0x93c501['interval']];}else{_0x93c501[_0xa1c9('0x35')]=_0x93c501[_0xa1c9('0x31')]?_['map'](_[_0xa1c9('0x36')](_0x4cf7c4,{'IntervalId':_0x93c501[_0xa1c9('0x31')]}),'interval'):[];}_0x93c501[_0xa1c9('0x6')]=_0x107f69[_0xa1c9('0x6')];_0x93c501[_0xa1c9('0x7')]=_0x107f69[_0xa1c9('0x7')];if(_0x93c501['type'])_0x93c501[_0xa1c9('0x5')]=_0x93c501['type'][_0xa1c9('0x37')]();if(_0x107f69['type']===_0xa1c9('0x10')){if(_0x93c501[_0xa1c9('0x1c')](_0xa1c9('0x38'))&&_0x93c501[_0xa1c9('0x38')]&&_0x93c501[_0xa1c9('0x38')]!=='--'){_0x1663c4[_0xa1c9('0xc')]({'type':_0x93c501[_0xa1c9('0x5')][_0xa1c9('0x37')](),'app':_0xa1c9('0x3'),'appdata':_0xa1c9('0x39')+_0x93c501[_0xa1c9('0x38')],'context':_0x107f69[_0xa1c9('0x6')],'exten':_0x107f69[_0xa1c9('0x7')],'priority':_0x93c501[_0xa1c9('0x35')][_0xa1c9('0x33')]+_0x2d8b5a+_0xd25c72++,'VoiceExtensionId':_0x107f69['id']});}_0x1663c4['push']({'type':_0x93c501[_0xa1c9('0x5')][_0xa1c9('0x37')](),'app':_0xa1c9('0x3a'),'appdata':_0xa1c9('0x3b')+(_0x93c501['callerID']?_0xa1c9('0x3c')+_0x93c501[_0xa1c9('0x3d')]+')':_0xa1c9('0x3e')),'context':_0x107f69[_0xa1c9('0x6')],'exten':_0x107f69['exten'],'priority':_0x93c501[_0xa1c9('0x35')][_0xa1c9('0x33')]+_0x2d8b5a+_0xd25c72++,'VoiceExtensionId':_0x107f69['id']});}else{if(_0x93c501[_0xa1c9('0x1c')](_0xa1c9('0x3f'))){if([_0xa1c9('0x40'),_0xa1c9('0x41')]['includes'](_0x93c501[_0xa1c9('0x42')][_0xa1c9('0x37')]())&&_0x93c501[_0xa1c9('0x43')]!==_0xa1c9('0x44')){if(_0x93c501[_0xa1c9('0x3f')]){_0x1663c4[_0xa1c9('0xc')]({'type':_0x93c501['type']['toLowerCase'](),'app':_0xa1c9('0x3a'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x107f69['context'],'exten':_0x107f69[_0xa1c9('0x7')],'priority':_0x93c501[_0xa1c9('0x35')][_0xa1c9('0x33')]+_0x2d8b5a+_0xd25c72++,'VoiceExtensionId':_0x107f69['id']});_0x1663c4['push']({'type':_0x93c501['type'][_0xa1c9('0x37')](),'app':'Set','appdata':_0xa1c9('0x45'),'context':_0x107f69[_0xa1c9('0x6')],'exten':_0x107f69[_0xa1c9('0x7')],'priority':_0x93c501['intervals'][_0xa1c9('0x33')]+_0x2d8b5a+_0xd25c72++,'VoiceExtensionId':_0x107f69['id']});}else{_0x1663c4[_0xa1c9('0xc')]({'type':_0x93c501[_0xa1c9('0x5')][_0xa1c9('0x37')](),'app':_0xa1c9('0x3a'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x107f69[_0xa1c9('0x6')],'exten':_0x107f69['exten'],'priority':_0x93c501[_0xa1c9('0x35')]['length']+_0x2d8b5a+_0xd25c72++,'VoiceExtensionId':_0x107f69['id']});_0x1663c4[_0xa1c9('0xc')]({'type':_0x93c501[_0xa1c9('0x5')][_0xa1c9('0x37')](),'app':_0xa1c9('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x107f69[_0xa1c9('0x6')],'exten':_0x107f69['exten'],'priority':_0x93c501[_0xa1c9('0x35')][_0xa1c9('0x33')]+_0x2d8b5a+_0xd25c72++,'VoiceExtensionId':_0x107f69['id']});}}}}for(var _0x904c05=0x0;_0x904c05<_0x93c501[_0xa1c9('0x35')][_0xa1c9('0x33')];_0x904c05++){var _0x1f00af=_0x2d8b5a+_0x93c501[_0xa1c9('0x35')][_0xa1c9('0x33')];var _0x39fce9=_0x904c05===_0x93c501[_0xa1c9('0x35')][_0xa1c9('0x33')]-0x1?_0x2d8b5a+_0x1663c4[_0xa1c9('0x33')]+_0x23b72d[_0xa1c9('0x33')]+0x2:_0x2d8b5a+_0x904c05+0x1;_0x1663c4[_0xa1c9('0x46')](_0x904c05,0x0,{'type':_0x107f69['type'],'app':'GotoIfTime','appdata':_0x93c501[_0xa1c9('0x35')][_0x904c05]+'?'+_0x107f69[_0xa1c9('0x6')]+_0xa1c9('0x47')+_0x1f00af+':'+_0x107f69[_0xa1c9('0x6')]+_0xa1c9('0x47')+_0x39fce9,'exten':_0x107f69[_0xa1c9('0x7')],'context':_0x107f69[_0xa1c9('0x6')],'priority':_0x2d8b5a+_0x904c05,'VoiceExtensionId':_0x107f69['id']});}if(_0x93c501[_0xa1c9('0x43')]==='outboundDial')_0x93c501[_0xa1c9('0x48')]=_0x4eb4fd(_0x107f69,_0x93c501[_0xa1c9('0x48')]);_0x93c501[_0xa1c9('0x49')]=_0x1663c4[_0xa1c9('0x33')]?_['last'](_0x1663c4)[_0xa1c9('0x49')]+0x1:_0x2d8b5a;_0xb31e7b=_[_0xa1c9('0x4a')](_0xb31e7b,_0x1663c4,[_0x93c501],_0x23b72d);_0x2d8b5a=_['last'](_0xb31e7b)[_0xa1c9('0x49')]+0x1;}return _0xbaa2f1(_0xb31e7b);})[_0xa1c9('0x4b')](function(_0x25bc30){_0x3d292d(_0x25bc30);});});}return _0x6084bf['define'](_0xa1c9('0x4c'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2a1ed2){var _0x41b9e9=this[_0xa1c9('0x4d')]({'plain':!![]});var _0x12abb3=_0x41b9e9[_0xa1c9('0x5')]===_0xa1c9('0x10')?_0x12d989(_0x41b9e9):_0x408418(_0x41b9e9);return _0x568a3c(_0x41b9e9,_0x2a1ed2,_['last'](_0x12abb3)[_0xa1c9('0x49')]+0x1)['then'](function(_0x1755b8){var _0x516ba8=_[_0xa1c9('0x4a')](_0x12abb3,_0x1755b8);_0x516ba8[_0xa1c9('0xc')]({'type':_0x41b9e9[_0xa1c9('0x5')],'app':_0xa1c9('0x4e'),'exten':_0x41b9e9[_0xa1c9('0x7')],'context':_0x41b9e9[_0xa1c9('0x6')],'priority':_[_0xa1c9('0x4f')](_0x516ba8)[_0xa1c9('0x49')]+0x1,'VoiceExtensionId':_0x41b9e9['id']});return _0x516ba8;});}}});};
\ No newline at end of file
+var _0xf6ca=['concat','catch','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','type','Set','CDR(type)=','context','exten','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','length','name','param','split','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last'];(function(_0x3adfb7,_0x19428c){var _0x4f7b82=function(_0x4ad082){while(--_0x4ad082){_0x3adfb7['push'](_0x3adfb7['shift']());}};_0x4f7b82(++_0x19428c);}(_0xf6ca,0x15a));var _0xaf6c=function(_0x606a15,_0x172191){_0x606a15=_0x606a15-0x0;var _0x238702=_0xf6ca[_0x606a15];return _0x238702;};'use strict';var _=require(_0xaf6c('0x0'));var attributes=require(_0xaf6c('0x1'));module[_0xaf6c('0x2')]=function(_0x53853a){var _0x2ceaaf=_0x53853a['models'];function _0x534200(_0x5abfc7){var _0x4fe59d=0x2;var _0x370fbd=[{'type':_0x5abfc7[_0xaf6c('0x3')],'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0x5')+_0x5abfc7['type'],'context':_0x5abfc7[_0xaf6c('0x6')],'exten':_0x5abfc7[_0xaf6c('0x7')],'priority':_0x4fe59d++,'VoiceExtensionId':_0x5abfc7['id']},{'type':_0x5abfc7[_0xaf6c('0x3')],'app':_0x5abfc7[_0xaf6c('0x8')]?_0xaf6c('0x4'):'NoOp','appdata':_0x5abfc7[_0xaf6c('0x8')]?'CDR(routeAlias)='+_0x5abfc7[_0xaf6c('0x8')]:_0xaf6c('0x9'),'context':_0x5abfc7[_0xaf6c('0x6')],'exten':_0x5abfc7[_0xaf6c('0x7')],'priority':_0x4fe59d++,'VoiceExtensionId':_0x5abfc7['id']}];if(_0x5abfc7[_0xaf6c('0x3')]===_0xaf6c('0xa')){_0x370fbd[_0xaf6c('0xb')]({'type':'inbound','app':_0xaf6c('0x4'),'appdata':_0xaf6c('0xc')+_0x5abfc7['id'],'context':_0x5abfc7[_0xaf6c('0x6')],'exten':_0x5abfc7[_0xaf6c('0x7')],'priority':_0x4fe59d++,'VoiceExtensionId':_0x5abfc7['id']});}_0x370fbd[_0xaf6c('0xb')]({'type':_0x5abfc7[_0xaf6c('0x3')],'app':_0xaf6c('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5abfc7[_0xaf6c('0x6')],'exten':_0x5abfc7[_0xaf6c('0x7')],'priority':_0x4fe59d++,'VoiceExtensionId':_0x5abfc7['id']},{'type':_0x5abfc7[_0xaf6c('0x3')],'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0xd'),'context':_0x5abfc7['context'],'exten':_0x5abfc7['exten'],'priority':_0x4fe59d++,'VoiceExtensionId':_0x5abfc7['id']},{'type':_0x5abfc7['type'],'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0xe'),'context':_0x5abfc7['context'],'exten':_0x5abfc7['exten'],'priority':_0x4fe59d++,'VoiceExtensionId':_0x5abfc7['id']});return _0x370fbd;}function _0x24fd70(_0x2c0a29){var _0x3d71dc=0x2;var _0x3d9c04=[{'type':_0xaf6c('0xf'),'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0x10'),'context':_0x2c0a29['context'],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':_0xaf6c('0xf'),'app':_0x2c0a29[_0xaf6c('0x8')]?_0xaf6c('0x4'):_0xaf6c('0x11'),'appdata':_0x2c0a29[_0xaf6c('0x8')]?'CDR(routeAlias)='+_0x2c0a29['alias']:_0xaf6c('0x9'),'context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':'outbound','app':_0xaf6c('0x4'),'appdata':'CDR(destination)='+(_0x2c0a29[_0xaf6c('0x12')]?'${EXTEN:'+_0x2c0a29[_0xaf6c('0x12')]+'}':_0xaf6c('0x13')),'context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':_0xaf6c('0xf'),'app':'Set','appdata':_0xaf6c('0xc')+_0x2c0a29['id'],'context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':_0xaf6c('0xf'),'app':_0xaf6c('0x14'),'appdata':_0xaf6c('0x15')+(_0x3d71dc+0x2)+_0xaf6c('0x16')+(_0x3d71dc+0x1)+')','context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29['exten'],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':'outbound','app':_0xaf6c('0x4'),'appdata':_0x2c0a29[_0xaf6c('0x12')]?_0xaf6c('0x17')+_0x2c0a29[_0xaf6c('0x12')]+'}':_0xaf6c('0x18'),'context':_0x2c0a29['context'],'exten':_0x2c0a29['exten'],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':'outbound','app':_0xaf6c('0x4'),'appdata':_0xaf6c('0x19'),'context':_0x2c0a29['context'],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':_0xaf6c('0xf'),'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0xd'),'context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':_0xaf6c('0xf'),'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0xe'),'context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':_0xaf6c('0xf'),'app':'Set','appdata':_0xaf6c('0x1a')+_0x2c0a29['id'],'context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']}];if(_0x2c0a29[_0xaf6c('0x1b')](_0xaf6c('0x1c'))&&_0x2c0a29[_0xaf6c('0x1c')]!==_0xaf6c('0x1d')){_0x3d9c04['push']({'type':_0xaf6c('0xf'),'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0x1e'),'context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29[_0xaf6c('0x7')],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']},{'type':'outbound','app':_0xaf6c('0x4'),'appdata':_0xaf6c('0x1f')+_0x2c0a29[_0xaf6c('0x1c')]||'wav','context':_0x2c0a29[_0xaf6c('0x6')],'exten':_0x2c0a29['exten'],'priority':_0x3d71dc++,'VoiceExtensionId':_0x2c0a29['id']});}return _0x3d9c04;}function _0x161c5a(_0x570f57,_0x146765){var _0x3d73c8=[{'name':_0xaf6c('0x20'),'param':0x0},{'name':_0xaf6c('0x21'),'param':0x1},{'name':_0xaf6c('0x22'),'param':0x2},{'name':'url','param':0x3}];var _0x584823={};var _0x41710b=_0x146765['split'](',');var _0xdd371a=[];for(var _0x20051a=0x0;_0x20051a<_0x3d73c8[_0xaf6c('0x23')];_0x20051a++){switch(_0x3d73c8[_0x20051a][_0xaf6c('0x24')]){case _0xaf6c('0x20'):_0x584823[_0xaf6c('0x20')]=_0x41710b[_0x3d73c8[_0x20051a][_0xaf6c('0x25')]][_0xaf6c('0x26')]('/')[0x1];_0x584823[_0xaf6c('0x27')]=_0x41710b[_0x3d73c8[_0x20051a]['param']][_0xaf6c('0x26')]('/')[0x2];_0x584823[_0xaf6c('0x28')]=_0x584823[_0xaf6c('0x27')]?_0x584823[_0xaf6c('0x27')]['split']('$')[0x0]:undefined;_0x584823[_0xaf6c('0x27')]=_0x570f57[_0xaf6c('0x12')]?(_0x584823[_0xaf6c('0x28')]||'')+'${EXTEN:'+_0x570f57['cutdigits']+'}':(_0x584823[_0xaf6c('0x28')]||'')+_0xaf6c('0x13');_0xdd371a[_0x3d73c8[_0x20051a][_0xaf6c('0x25')]]=[_0xaf6c('0x29'),_0x584823['trunk'],_0x584823[_0xaf6c('0x27')]]['join']('/');break;case _0xaf6c('0x22'):_0x584823[_0xaf6c('0x22')]=_0x41710b[_0x3d73c8[_0x20051a][_0xaf6c('0x25')]];if(_0x570f57[_0xaf6c('0x1c')]!==_0xaf6c('0x1d')){if(_0x584823['options'][_0xaf6c('0x2a')](_0xaf6c('0x2b'))<0x0){_0x584823[_0xaf6c('0x22')]+=_0xaf6c('0x2b');}}else{_0x584823[_0xaf6c('0x22')]=_0x584823[_0xaf6c('0x22')][_0xaf6c('0x2c')]('U(xcally-mixmonitor-context)','');}_0xdd371a[_0x3d73c8[_0x20051a]['param']]=_0x584823['options'];break;default:_0xdd371a[_0x3d73c8[_0x20051a]['param']]=_0x41710b[_0x3d73c8[_0x20051a][_0xaf6c('0x25')]];}}return _0xdd371a[_0xaf6c('0x2d')](',');}function _0x3402af(_0x2041d1,_0x53366b,_0xa9db25){return new Promise(function(_0x3130bb,_0x13dcb0){var _0x5b7b70=[];if(_[_0xaf6c('0x2e')](_0x53366b))return _0x3130bb(_0x5b7b70);_0x2ceaaf[_0xaf6c('0x2f')][_0xaf6c('0x30')]({'attributes':['id',_0xaf6c('0x31'),_0xaf6c('0x32')],'raw':!![]})[_0xaf6c('0x33')](function(_0xfb7814){for(var _0x4f4aff=0x0,_0x5d838e=0x0;_0x4f4aff<_0x53366b[_0xaf6c('0x23')];_0x4f4aff++,_0x5d838e=0x0){var _0x29f074=_0x53366b[_0x4f4aff];var _0x2fb109=[];var _0x8d98a4=[];delete _0x29f074['id'];if(_0x29f074[_0xaf6c('0x31')]!==_0xaf6c('0x34')){_0x29f074[_0xaf6c('0x35')]=[_0x29f074['interval']];}else{_0x29f074[_0xaf6c('0x35')]=_0x29f074[_0xaf6c('0x32')]?_[_0xaf6c('0x36')](_[_0xaf6c('0x37')](_0xfb7814,{'IntervalId':_0x29f074['IntervalId']}),_0xaf6c('0x31')):[];}_0x29f074['context']=_0x2041d1[_0xaf6c('0x6')];_0x29f074['exten']=_0x2041d1['exten'];if(_0x29f074[_0xaf6c('0x3')])_0x29f074['type']=_0x29f074[_0xaf6c('0x3')]['toLowerCase']();if(_0x2041d1[_0xaf6c('0x3')]==='outbound'){if(_0x29f074[_0xaf6c('0x1b')](_0xaf6c('0x38'))&&_0x29f074[_0xaf6c('0x38')]&&_0x29f074[_0xaf6c('0x38')]!=='--'){_0x2fb109[_0xaf6c('0xb')]({'type':_0x29f074['type'][_0xaf6c('0x39')](),'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0x3a')+_0x29f074[_0xaf6c('0x38')],'context':_0x2041d1['context'],'exten':_0x2041d1[_0xaf6c('0x7')],'priority':_0x29f074[_0xaf6c('0x35')][_0xaf6c('0x23')]+_0xa9db25+_0x5d838e++,'VoiceExtensionId':_0x2041d1['id']});}_0x2fb109[_0xaf6c('0xb')]({'type':_0x29f074[_0xaf6c('0x3')][_0xaf6c('0x39')](),'app':'ExecIf','appdata':_0xaf6c('0x3b')+(_0x29f074['callerID']?_0xaf6c('0x3c')+_0x29f074['callerID']+')':_0xaf6c('0x3d')),'context':_0x2041d1[_0xaf6c('0x6')],'exten':_0x2041d1[_0xaf6c('0x7')],'priority':_0x29f074[_0xaf6c('0x35')]['length']+_0xa9db25+_0x5d838e++,'VoiceExtensionId':_0x2041d1['id']});}else{if(_0x29f074['hasOwnProperty'](_0xaf6c('0x3e'))){if([_0xaf6c('0x3f'),_0xaf6c('0x40')][_0xaf6c('0x41')](_0x29f074['app'][_0xaf6c('0x39')]())&&_0x29f074[_0xaf6c('0x42')]!==_0xaf6c('0x43')){if(_0x29f074[_0xaf6c('0x3e')]){_0x2fb109[_0xaf6c('0xb')]({'type':_0x29f074[_0xaf6c('0x3')][_0xaf6c('0x39')](),'app':_0xaf6c('0x14'),'appdata':_0xaf6c('0x44'),'context':_0x2041d1[_0xaf6c('0x6')],'exten':_0x2041d1[_0xaf6c('0x7')],'priority':_0x29f074[_0xaf6c('0x35')][_0xaf6c('0x23')]+_0xa9db25+_0x5d838e++,'VoiceExtensionId':_0x2041d1['id']});_0x2fb109[_0xaf6c('0xb')]({'type':_0x29f074[_0xaf6c('0x3')][_0xaf6c('0x39')](),'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0x45'),'context':_0x2041d1[_0xaf6c('0x6')],'exten':_0x2041d1['exten'],'priority':_0x29f074[_0xaf6c('0x35')][_0xaf6c('0x23')]+_0xa9db25+_0x5d838e++,'VoiceExtensionId':_0x2041d1['id']});}else{_0x2fb109[_0xaf6c('0xb')]({'type':_0x29f074[_0xaf6c('0x3')][_0xaf6c('0x39')](),'app':_0xaf6c('0x14'),'appdata':_0xaf6c('0x46'),'context':_0x2041d1[_0xaf6c('0x6')],'exten':_0x2041d1[_0xaf6c('0x7')],'priority':_0x29f074['intervals'][_0xaf6c('0x23')]+_0xa9db25+_0x5d838e++,'VoiceExtensionId':_0x2041d1['id']});_0x2fb109[_0xaf6c('0xb')]({'type':_0x29f074['type'][_0xaf6c('0x39')](),'app':_0xaf6c('0x4'),'appdata':_0xaf6c('0x47'),'context':_0x2041d1[_0xaf6c('0x6')],'exten':_0x2041d1[_0xaf6c('0x7')],'priority':_0x29f074[_0xaf6c('0x35')][_0xaf6c('0x23')]+_0xa9db25+_0x5d838e++,'VoiceExtensionId':_0x2041d1['id']});}}}}for(var _0x5b6303=0x0;_0x5b6303<_0x29f074[_0xaf6c('0x35')]['length'];_0x5b6303++){var _0x4ea555=_0xa9db25+_0x29f074[_0xaf6c('0x35')][_0xaf6c('0x23')];var _0x438c63=_0x5b6303===_0x29f074['intervals']['length']-0x1?_0xa9db25+_0x2fb109[_0xaf6c('0x23')]+_0x8d98a4['length']+0x2:_0xa9db25+_0x5b6303+0x1;_0x2fb109[_0xaf6c('0x48')](_0x5b6303,0x0,{'type':_0x2041d1[_0xaf6c('0x3')],'app':_0xaf6c('0x49'),'appdata':_0x29f074[_0xaf6c('0x35')][_0x5b6303]+'?'+_0x2041d1[_0xaf6c('0x6')]+_0xaf6c('0x4a')+_0x4ea555+':'+_0x2041d1['context']+_0xaf6c('0x4a')+_0x438c63,'exten':_0x2041d1[_0xaf6c('0x7')],'context':_0x2041d1[_0xaf6c('0x6')],'priority':_0xa9db25+_0x5b6303,'VoiceExtensionId':_0x2041d1['id']});}if(_0x29f074[_0xaf6c('0x42')]===_0xaf6c('0x4b'))_0x29f074[_0xaf6c('0x4c')]=_0x161c5a(_0x2041d1,_0x29f074[_0xaf6c('0x4c')]);_0x29f074[_0xaf6c('0x4d')]=_0x2fb109[_0xaf6c('0x23')]?_[_0xaf6c('0x4e')](_0x2fb109)[_0xaf6c('0x4d')]+0x1:_0xa9db25;_0x5b7b70=_[_0xaf6c('0x4f')](_0x5b7b70,_0x2fb109,[_0x29f074],_0x8d98a4);_0xa9db25=_[_0xaf6c('0x4e')](_0x5b7b70)[_0xaf6c('0x4d')]+0x1;}return _0x3130bb(_0x5b7b70);})[_0xaf6c('0x50')](function(_0x53d6e4){_0x13dcb0(_0x53d6e4);});});}return _0x53853a[_0xaf6c('0x51')](_0xaf6c('0x52'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x44ab74){var _0x1debc5=this[_0xaf6c('0x53')]({'plain':!![]});var _0x1cee29=_0x1debc5[_0xaf6c('0x3')]==='outbound'?_0x24fd70(_0x1debc5):_0x534200(_0x1debc5);return _0x3402af(_0x1debc5,_0x44ab74,_[_0xaf6c('0x4e')](_0x1cee29)[_0xaf6c('0x4d')]+0x1)[_0xaf6c('0x33')](function(_0x7d5786){var _0x19befa=_[_0xaf6c('0x4f')](_0x1cee29,_0x7d5786);_0x19befa[_0xaf6c('0xb')]({'type':_0x1debc5[_0xaf6c('0x3')],'app':_0xaf6c('0x54'),'exten':_0x1debc5[_0xaf6c('0x7')],'context':_0x1debc5[_0xaf6c('0x6')],'priority':_[_0xaf6c('0x4e')](_0x19befa)['priority']+0x1,'VoiceExtensionId':_0x1debc5['id']});return _0x19befa;});}}});};
\ No newline at end of file
index e1c8871..b15401e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3079=['client','http','redis','localhost','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','include','model','map','debug','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x5b1053,_0x14c6e3){var _0xec3b3c=function(_0x333c79){while(--_0x333c79){_0x5b1053['push'](_0x5b1053['shift']());}};_0xec3b3c(++_0x14c6e3);}(_0x3079,0x110));var _0x9307=function(_0xfbb0ce,_0x1579f9){_0xfbb0ce=_0xfbb0ce-0x0;var _0xc7cf13=_0x3079[_0xfbb0ce];return _0xc7cf13;};'use strict';var _=require('lodash');var util=require(_0x9307('0x0'));var moment=require(_0x9307('0x1'));var BPromise=require(_0x9307('0x2'));var rs=require(_0x9307('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9307('0x4'))['db'];var utils=require(_0x9307('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9307('0x6'));var jayson=require(_0x9307('0x7'));var client=jayson[_0x9307('0x8')][_0x9307('0x9')]({'port':0x232a});config[_0x9307('0xa')]=_['defaults'](config['redis'],{'host':_0x9307('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9307('0xa')]));require(_0x9307('0xc'))['register'](socket);function respondWithRpcPromise(_0x2ec28f,_0x2ecfde,_0x211a48){return new BPromise(function(_0x4bb79e,_0x56f42b){return client[_0x9307('0xd')](_0x2ec28f,_0x211a48)[_0x9307('0xe')](function(_0x13f83b){logger[_0x9307('0xf')](_0x9307('0x10'),_0x2ecfde,_0x9307('0x11'));logger['debug'](_0x9307('0x12'),_0x2ecfde,_0x9307('0x11'),JSON['stringify'](_0x13f83b));if(_0x13f83b['error']){if(_0x13f83b[_0x9307('0x13')][_0x9307('0x14')]===0x1f4){logger['error'](_0x9307('0x10'),_0x2ecfde,_0x13f83b[_0x9307('0x13')]['message']);return _0x56f42b(_0x13f83b[_0x9307('0x13')][_0x9307('0x15')]);}logger['error'](_0x9307('0x10'),_0x2ecfde,_0x13f83b[_0x9307('0x13')][_0x9307('0x15')]);return _0x4bb79e(_0x13f83b['error'][_0x9307('0x15')]);}else{logger[_0x9307('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x2ecfde,_0x9307('0x11'));_0x4bb79e(_0x13f83b[_0x9307('0x16')][_0x9307('0x15')]);}})[_0x9307('0x17')](function(_0x16a061){logger[_0x9307('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x2ecfde,_0x16a061);_0x56f42b(_0x16a061);});});}exports[_0x9307('0x18')]=function(_0x10aa66){var _0x435b7a=this;return new Promise(function(_0x58574e,_0x2f35c7){return db[_0x9307('0x19')]['findAll']({'raw':_0x10aa66[_0x9307('0x1a')]?_0x10aa66[_0x9307('0x1a')][_0x9307('0x1b')]===undefined?!![]:![]:!![],'where':_0x10aa66[_0x9307('0x1a')]?_0x10aa66[_0x9307('0x1a')][_0x9307('0x1c')]||null:null,'attributes':_0x10aa66[_0x9307('0x1a')]?_0x10aa66[_0x9307('0x1a')][_0x9307('0x1d')]||null:null,'limit':_0x10aa66[_0x9307('0x1a')]?_0x10aa66[_0x9307('0x1a')]['limit']||null:null,'include':_0x10aa66[_0x9307('0x1a')]?_0x10aa66['options'][_0x9307('0x1e')]?_['map'](_0x10aa66[_0x9307('0x1a')]['include'],function(_0x4d1a13){return{'model':db[_0x4d1a13[_0x9307('0x1f')]],'as':_0x4d1a13['as'],'attributes':_0x4d1a13[_0x9307('0x1d')],'include':_0x4d1a13[_0x9307('0x1e')]?_[_0x9307('0x20')](_0x4d1a13[_0x9307('0x1e')],function(_0xd89e2f){return{'model':db[_0xd89e2f[_0x9307('0x1f')]],'as':_0xd89e2f['as'],'attributes':_0xd89e2f['attributes'],'include':_0xd89e2f[_0x9307('0x1e')]?_['map'](_0xd89e2f[_0x9307('0x1e')],function(_0x1c7e60){return{'model':db[_0x1c7e60[_0x9307('0x1f')]],'as':_0x1c7e60['as'],'attributes':_0x1c7e60['attributes']};}):[]};}):[]};}):[]:[]})[_0x9307('0xe')](function(_0x5459c1){logger['info']('GetVoiceExtension',_0x10aa66);logger[_0x9307('0x21')]('GetVoiceExtension',_0x10aa66,JSON[_0x9307('0x22')](_0x5459c1));_0x58574e(_0x5459c1);})[_0x9307('0x17')](function(_0x3c1764){logger[_0x9307('0x13')](_0x9307('0x18'),_0x3c1764[_0x9307('0x15')],_0x10aa66);_0x2f35c7(_0x435b7a['error'](0x1f4,_0x3c1764[_0x9307('0x15')]));});});};
\ No newline at end of file
+var _0xfc76=['http','redis','localhost','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','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfc76,0xb5));var _0x6fc7=function(_0x8301d0,_0x3cc29f){_0x8301d0=_0x8301d0-0x0;var _0x36b85b=_0xfc76[_0x8301d0];return _0x36b85b;};'use strict';var _=require('lodash');var util=require(_0x6fc7('0x0'));var moment=require(_0x6fc7('0x1'));var BPromise=require(_0x6fc7('0x2'));var rs=require(_0x6fc7('0x3'));var fs=require('fs');var Redis=require(_0x6fc7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6fc7('0x5'));var logger=require(_0x6fc7('0x6'))('rpc');var config=require(_0x6fc7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6fc7('0x8')][_0x6fc7('0x9')]({'port':0x232a});config[_0x6fc7('0xa')]=_['defaults'](config[_0x6fc7('0xa')],{'host':_0x6fc7('0xb'),'port':0x18eb});var socket=require(_0x6fc7('0xc'))(new Redis(config[_0x6fc7('0xa')]));require(_0x6fc7('0xd'))[_0x6fc7('0xe')](socket);function respondWithRpcPromise(_0x4de75e,_0xdddc47,_0x61730a){return new BPromise(function(_0x138129,_0x20d043){return client[_0x6fc7('0xf')](_0x4de75e,_0x61730a)[_0x6fc7('0x10')](function(_0x55d183){logger[_0x6fc7('0x11')](_0x6fc7('0x12'),_0xdddc47,'request\x20sent');logger[_0x6fc7('0x13')](_0x6fc7('0x14'),_0xdddc47,'request\x20sent',JSON[_0x6fc7('0x15')](_0x55d183));if(_0x55d183[_0x6fc7('0x16')]){if(_0x55d183['error'][_0x6fc7('0x17')]===0x1f4){logger[_0x6fc7('0x16')](_0x6fc7('0x12'),_0xdddc47,_0x55d183['error']['message']);return _0x20d043(_0x55d183[_0x6fc7('0x16')][_0x6fc7('0x18')]);}logger['error'](_0x6fc7('0x12'),_0xdddc47,_0x55d183[_0x6fc7('0x16')][_0x6fc7('0x18')]);return _0x138129(_0x55d183[_0x6fc7('0x16')]['message']);}else{logger[_0x6fc7('0x11')](_0x6fc7('0x12'),_0xdddc47,_0x6fc7('0x19'));_0x138129(_0x55d183[_0x6fc7('0x1a')][_0x6fc7('0x18')]);}})[_0x6fc7('0x1b')](function(_0x59bb98){logger[_0x6fc7('0x16')](_0x6fc7('0x12'),_0xdddc47,_0x59bb98);_0x20d043(_0x59bb98);});});}exports[_0x6fc7('0x1c')]=function(_0x3bd771){var _0x13f5f8=this;return new Promise(function(_0x526dba,_0x277f9e){return db[_0x6fc7('0x1d')]['findAll']({'raw':_0x3bd771[_0x6fc7('0x1e')]?_0x3bd771['options'][_0x6fc7('0x1f')]===undefined?!![]:![]:!![],'where':_0x3bd771['options']?_0x3bd771[_0x6fc7('0x1e')][_0x6fc7('0x20')]||null:null,'attributes':_0x3bd771[_0x6fc7('0x1e')]?_0x3bd771['options'][_0x6fc7('0x21')]||null:null,'limit':_0x3bd771['options']?_0x3bd771[_0x6fc7('0x1e')][_0x6fc7('0x22')]||null:null,'include':_0x3bd771[_0x6fc7('0x1e')]?_0x3bd771[_0x6fc7('0x1e')][_0x6fc7('0x23')]?_[_0x6fc7('0x24')](_0x3bd771[_0x6fc7('0x1e')][_0x6fc7('0x23')],function(_0x2b6b55){return{'model':db[_0x2b6b55[_0x6fc7('0x25')]],'as':_0x2b6b55['as'],'attributes':_0x2b6b55[_0x6fc7('0x21')],'include':_0x2b6b55[_0x6fc7('0x23')]?_[_0x6fc7('0x24')](_0x2b6b55[_0x6fc7('0x23')],function(_0x232324){return{'model':db[_0x232324['model']],'as':_0x232324['as'],'attributes':_0x232324[_0x6fc7('0x21')],'include':_0x232324[_0x6fc7('0x23')]?_[_0x6fc7('0x24')](_0x232324[_0x6fc7('0x23')],function(_0x5c1fd3){return{'model':db[_0x5c1fd3[_0x6fc7('0x25')]],'as':_0x5c1fd3['as'],'attributes':_0x5c1fd3[_0x6fc7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6fc7('0x10')](function(_0x2aa91c){logger[_0x6fc7('0x11')](_0x6fc7('0x1c'),_0x3bd771);logger[_0x6fc7('0x13')](_0x6fc7('0x1c'),_0x3bd771,JSON['stringify'](_0x2aa91c));_0x526dba(_0x2aa91c);})['catch'](function(_0x15a856){logger[_0x6fc7('0x16')](_0x6fc7('0x1c'),_0x15a856[_0x6fc7('0x18')],_0x3bd771);_0x277f9e(_0x13f5f8[_0x6fc7('0x16')](0x1f4,_0x15a856[_0x6fc7('0x18')]));});});};
\ No newline at end of file
index 3570c43..0efd45c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x29c1d9,_0x2d2360){var _0x177cf7=function(_0x553682){while(--_0x553682){_0x29c1d9['push'](_0x29c1d9['shift']());}};_0x177cf7(++_0x2d2360);}(_0x2ef3,0xba));var _0x32ef=function(_0x1bef03,_0x15b5c7){_0x1bef03=_0x1bef03-0x0;var _0x163ba2=_0x2ef3[_0x1bef03];return _0x163ba2;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}};
\ No newline at end of file
+var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x28aac9,_0xd1674b){var _0x3cda8a=function(_0x2b5f02){while(--_0x2b5f02){_0x28aac9['push'](_0x28aac9['shift']());}};_0x3cda8a(++_0xd1674b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}};
\ No newline at end of file
index 493acb7..653bec0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d9=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x49ddca,_0x3f0174){var _0x48930b=function(_0x540d91){while(--_0x540d91){_0x49ddca['push'](_0x49ddca['shift']());}};_0x48930b(++_0x3f0174);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')]('/',auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router[_0x901d('0x13')]('/:id',auth[_0x901d('0xd')](),controller['update']);router[_0x901d('0x14')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0x15')]);module[_0x901d('0x16')]=router;
\ No newline at end of file
+var _0x8f9d=['/:id/messages','getMessages','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x8f9d,0x93));var _0xd8f9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8f9d[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var fs_extra=require(_0xd8f9('0x4'));var auth=require(_0xd8f9('0x5'));var interaction=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var controller=require(_0xd8f9('0x8'));router['get']('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xa')]);router[_0xd8f9('0xb')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller['show']);router[_0xd8f9('0xb')](_0xd8f9('0xd'),auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0x10')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x11')]);router[_0xd8f9('0x12')](_0xd8f9('0xc'),auth['isAuthenticated'](),controller[_0xd8f9('0x13')]);module['exports']=router;
\ No newline at end of file
index 1e21c64..4121e34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb42=['TIMESTAMP','INTEGER','VIRTUAL','fullname','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xfb42,0x149));var _0x2fb4=function(_0x35771e,_0x2b23b6){_0x35771e=_0x35771e-0x0;var _0xe0c63a=_0xfb42[_0x35771e];return _0xe0c63a;};'use strict';var Sequelize=require(_0x2fb4('0x0'));module[_0x2fb4('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2fb4('0x2')],'defaultValue':_0x2fb4('0x3'),'unique':_0x2fb4('0x4')},'mailbox':{'type':Sequelize[_0x2fb4('0x2')],'defaultValue':'','allowNull':![],'unique':_0x2fb4('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x2fb4('0x2')]},'email':{'type':Sequelize[_0x2fb4('0x2')],'validate':{'isEmail':!![]},'set':function(_0x18fe98){this[_0x2fb4('0x5')](_0x2fb4('0x6'),typeof _0x18fe98===_0x2fb4('0x7')&&_0x18fe98[_0x2fb4('0x8')]()?_0x18fe98[_0x2fb4('0x8')]():null);}},'pager':{'type':Sequelize[_0x2fb4('0x2')]},'tz':{'type':Sequelize[_0x2fb4('0x2')],'defaultValue':_0x2fb4('0x9')},'attach':{'type':Sequelize[_0x2fb4('0xa')](_0x2fb4('0xb'),'no'),'defaultValue':_0x2fb4('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x2fb4('0xa')](_0x2fb4('0xb'),'no'),'defaultValue':_0x2fb4('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x2fb4('0x2')]},'callback':{'type':Sequelize[_0x2fb4('0x2')]},'review':{'type':Sequelize[_0x2fb4('0xa')](_0x2fb4('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2fb4('0xa')](_0x2fb4('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x2fb4('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x2fb4('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2fb4('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2fb4('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2fb4('0xa')](_0x2fb4('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x2fb4('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x2fb4('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2fb4('0xa')](_0x2fb4('0xb'),'no'),'defaultValue':_0x2fb4('0xb'),'allowNull':![]},'stamp':{'type':_0x2fb4('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x2fb4('0x2')]},'maxsecs':{'type':Sequelize[_0x2fb4('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2fb4('0xf')],'get':function(){return this['getDataValue'](_0x2fb4('0x10'))+'\x20-\x20'+this[_0x2fb4('0x11')](_0x2fb4('0x12'));}}};
\ No newline at end of file
+var _0x6d4f=['string','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x34ea1c,_0x16300a){var _0x1bb0d4=function(_0xf287c2){while(--_0xf287c2){_0x34ea1c['push'](_0x34ea1c['shift']());}};_0x1bb0d4(++_0x16300a);}(_0x6d4f,0x1e7));var _0xf6d4=function(_0x279ab1,_0x527374){_0x279ab1=_0x279ab1-0x0;var _0x8ba87c=_0x6d4f[_0x279ab1];return _0x8ba87c;};'use strict';var Sequelize=require(_0xf6d4('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xf6d4('0x1')]},'context':{'type':Sequelize[_0xf6d4('0x1')],'defaultValue':_0xf6d4('0x2'),'unique':_0xf6d4('0x3')},'mailbox':{'type':Sequelize[_0xf6d4('0x1')],'defaultValue':'','allowNull':![],'unique':_0xf6d4('0x3')},'password':{'type':Sequelize[_0xf6d4('0x1')]},'fullname':{'type':Sequelize[_0xf6d4('0x1')]},'email':{'type':Sequelize[_0xf6d4('0x1')],'validate':{'isEmail':!![]},'set':function(_0x57bf27){this[_0xf6d4('0x4')](_0xf6d4('0x5'),typeof _0x57bf27===_0xf6d4('0x6')&&_0x57bf27['trim']()?_0x57bf27['trim']():null);}},'pager':{'type':Sequelize[_0xf6d4('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xf6d4('0x7')},'attach':{'type':Sequelize[_0xf6d4('0x8')](_0xf6d4('0x9'),'no'),'defaultValue':_0xf6d4('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf6d4('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xf6d4('0x1')]},'review':{'type':Sequelize['ENUM'](_0xf6d4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xf6d4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf6d4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf6d4('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xf6d4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xf6d4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf6d4('0x8')](_0xf6d4('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xf6d4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf6d4('0x8')](_0xf6d4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf6d4('0x8')](_0xf6d4('0x9'),'no'),'defaultValue':_0xf6d4('0x9'),'allowNull':![]},'stamp':{'type':_0xf6d4('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xf6d4('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf6d4('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf6d4('0xd')],'get':function(){return this[_0xf6d4('0xe')](_0xf6d4('0xf'))+'\x20-\x20'+this[_0xf6d4('0xe')](_0xf6d4('0x10'));}}};
\ No newline at end of file
index 2d8faab..cf7d175 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f4=['get','Voicemails','then','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy'];(function(_0x3daec9,_0x4a911d){var _0x20b57b=function(_0x500b6a){while(--_0x500b6a){_0x3daec9['push'](_0x3daec9['shift']());}};_0x20b57b(++_0x4a911d);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x5f0202,_0x5df47f){_0x5f0202=_0x5f0202-0x0;var _0x53fc9f=_0xd4f4[_0x5f0202];return _0x53fc9f;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551a10,_0x5b4f4e){_0x5b4f4e=_0x5b4f4e||0xcc;return function(_0x15fe6a){if(_0x15fe6a){return _0x551a10[_0x4d4f('0x1d')](_0x5b4f4e);}return _0x551a10['status'](_0x5b4f4e)[_0x4d4f('0x1e')]();};}function respondWithResult(_0x301380,_0x1878b6){_0x1878b6=_0x1878b6||0xc8;return function(_0x59252c){if(_0x59252c){return _0x301380[_0x4d4f('0x1f')](_0x1878b6)[_0x4d4f('0x20')](_0x59252c);}};}function respondWithFilteredResult(_0x1a9173,_0x4a3364){return function(_0x59bfb5){if(_0x59bfb5){var _0x5e4ff5=typeof _0x4a3364[_0x4d4f('0x21')]===_0x4d4f('0x22')&&typeof _0x4a3364[_0x4d4f('0x23')]==='undefined';var _0x30b6b1=_0x59bfb5[_0x4d4f('0x24')];var _0x51dcf1=_0x5e4ff5?0x0:_0x4a3364['offset'];var _0x519501=_0x5e4ff5?_0x59bfb5['count']:_0x4a3364['offset']+_0x4a3364[_0x4d4f('0x23')];var _0x15100a;if(_0x519501>=_0x30b6b1){_0x519501=_0x30b6b1;_0x15100a=0xc8;}else{_0x15100a=0xce;}_0x1a9173[_0x4d4f('0x1f')](_0x15100a);return _0x1a9173[_0x4d4f('0x25')]('Content-Range',_0x51dcf1+'-'+_0x519501+'/'+_0x30b6b1)['json'](_0x59bfb5);}return null;};}function patchUpdates(_0x1e1ae2){return function(_0x4dd360){try{jsonpatch[_0x4d4f('0x26')](_0x4dd360,_0x1e1ae2,!![]);}catch(_0x1e3e9a){return BPromise[_0x4d4f('0x27')](_0x1e3e9a);}return _0x4dd360[_0x4d4f('0x28')]();};}function saveUpdates(_0x3dd36a,_0x5beab4){return function(_0x570520){if(_0x570520){return _0x570520[_0x4d4f('0x29')](_0x3dd36a)['then'](function(_0x247077){return _0x247077;});}return null;};}function removeEntity(_0x3d5d93,_0x2d2fb3){return function(_0x3f4a55){if(_0x3f4a55){return _0x3f4a55[_0x4d4f('0x2a')]()['then'](function(){var _0x44bd2f=_0x3f4a55[_0x4d4f('0x2b')]({'plain':!![]});var _0x1cf365=_0x4d4f('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x1cf365,'resourceId':_0x44bd2f['id']}})[_0x4d4f('0x2d')](function(){return _0x3f4a55;});})[_0x4d4f('0x2d')](function(){_0x3d5d93[_0x4d4f('0x1f')](0xcc)[_0x4d4f('0x1e')]();});}};}function handleEntityNotFound(_0x58acbe,_0x671c87){return function(_0x380ebf){if(!_0x380ebf){_0x58acbe[_0x4d4f('0x1d')](0x194);}return _0x380ebf;};}function handleError(_0x2e91b2,_0x4effb1){_0x4effb1=_0x4effb1||0x1f4;return function(_0x338ba2){logger['error'](_0x338ba2[_0x4d4f('0x2e')]);if(_0x338ba2[_0x4d4f('0x2f')]){delete _0x338ba2['name'];}_0x2e91b2[_0x4d4f('0x1f')](_0x4effb1)[_0x4d4f('0x30')](_0x338ba2);};}exports[_0x4d4f('0x31')]=function(_0x3d7f14,_0x19a502){var _0x43a704={},_0x4c69cb={},_0x36eede={'count':0x0,'rows':[]};var _0x4578b6=_[_0x4d4f('0x32')](db[_0x4d4f('0x33')][_0x4d4f('0x34')],function(_0x4e47e5){return{'name':_0x4e47e5[_0x4d4f('0x35')],'type':_0x4e47e5['type'][_0x4d4f('0x36')]};});_0x4c69cb['model']=_['map'](_0x4578b6,'name');_0x4c69cb[_0x4d4f('0x37')]=_['keys'](_0x3d7f14[_0x4d4f('0x37')]);_0x4c69cb[_0x4d4f('0x38')]=_[_0x4d4f('0x39')](_0x4c69cb['model'],_0x4c69cb[_0x4d4f('0x37')]);_0x43a704[_0x4d4f('0x3a')]=_[_0x4d4f('0x39')](_0x4c69cb['model'],qs[_0x4d4f('0x3b')](_0x3d7f14['query'][_0x4d4f('0x3b')]));_0x43a704[_0x4d4f('0x3a')]=_0x43a704[_0x4d4f('0x3a')][_0x4d4f('0x3c')]?_0x43a704[_0x4d4f('0x3a')]:_0x4c69cb[_0x4d4f('0x3d')];if(!_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x3e')]('nolimit')){_0x43a704['limit']=qs[_0x4d4f('0x23')](_0x3d7f14['query']['limit']);_0x43a704[_0x4d4f('0x21')]=qs[_0x4d4f('0x21')](_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x21')]);}_0x43a704[_0x4d4f('0x3f')]=qs['sort'](_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x40')]);_0x43a704['where']=qs[_0x4d4f('0x38')](_[_0x4d4f('0x41')](_0x3d7f14[_0x4d4f('0x37')],_0x4c69cb[_0x4d4f('0x38')]),_0x4578b6);if(_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x42')]){_0x43a704[_0x4d4f('0x43')]=_[_0x4d4f('0x44')](_0x43a704[_0x4d4f('0x43')],{'$or':_['map'](_0x4578b6,function(_0x55a151){if(_0x55a151[_0x4d4f('0x45')]!==_0x4d4f('0x46')){var _0x4b3ba1={};_0x4b3ba1[_0x55a151[_0x4d4f('0x2f')]]={'$like':'%'+_0x3d7f14['query']['filter']+'%'};return _0x4b3ba1;}})});}_0x43a704=_[_0x4d4f('0x44')]({},_0x43a704,_0x3d7f14[_0x4d4f('0x47')]);var _0x58b52c={'where':_0x43a704['where']};return db[_0x4d4f('0x33')][_0x4d4f('0x24')](_0x58b52c)['then'](function(_0x949a6d){_0x36eede[_0x4d4f('0x24')]=_0x949a6d;if(_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x48')]){_0x43a704[_0x4d4f('0x49')]=[{'all':!![]}];}return db['VoiceMail'][_0x4d4f('0x4a')](_0x43a704);})['then'](function(_0x45a0c1){_0x36eede[_0x4d4f('0x4b')]=_0x45a0c1;return _0x36eede;})['then'](respondWithFilteredResult(_0x19a502,_0x43a704))[_0x4d4f('0x4c')](handleError(_0x19a502,null));};exports[_0x4d4f('0x4d')]=function(_0x1f7169,_0x489abe){var _0x379b59={'raw':!![],'where':{'id':_0x1f7169[_0x4d4f('0x4e')]['id']}},_0x48caa2={};_0x48caa2['model']=_[_0x4d4f('0x4f')](db[_0x4d4f('0x33')][_0x4d4f('0x34')]);_0x48caa2[_0x4d4f('0x37')]=_[_0x4d4f('0x4f')](_0x1f7169['query']);_0x48caa2['filters']=_[_0x4d4f('0x39')](_0x48caa2[_0x4d4f('0x3d')],_0x48caa2[_0x4d4f('0x37')]);_0x379b59[_0x4d4f('0x3a')]=_['intersection'](_0x48caa2['model'],qs['fields'](_0x1f7169[_0x4d4f('0x37')][_0x4d4f('0x3b')]));_0x379b59[_0x4d4f('0x3a')]=_0x379b59[_0x4d4f('0x3a')][_0x4d4f('0x3c')]?_0x379b59[_0x4d4f('0x3a')]:_0x48caa2[_0x4d4f('0x3d')];if(_0x1f7169[_0x4d4f('0x37')][_0x4d4f('0x48')]){_0x379b59[_0x4d4f('0x49')]=[{'all':!![]}];}_0x379b59=_[_0x4d4f('0x44')]({},_0x379b59,_0x1f7169[_0x4d4f('0x47')]);return db['VoiceMail'][_0x4d4f('0x50')](_0x379b59)[_0x4d4f('0x2d')](handleEntityNotFound(_0x489abe,null))['then'](respondWithResult(_0x489abe,null))[_0x4d4f('0x4c')](handleError(_0x489abe,null));};exports['create']=function(_0x15cf38,_0x401466){return db['VoiceMail'][_0x4d4f('0x51')](_0x15cf38[_0x4d4f('0x52')],{})[_0x4d4f('0x2d')](function(_0x21d0d6){var _0x7f22f2=_0x15cf38[_0x4d4f('0x53')][_0x4d4f('0x2b')]({'plain':!![]});if(!_0x7f22f2)throw new Error(_0x4d4f('0x54'));if(_0x7f22f2[_0x4d4f('0x55')]===_0x4d4f('0x53')){var _0xa6cef=_0x21d0d6[_0x4d4f('0x2b')]({'plain':!![]});var _0x504d85=_0x4d4f('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x504d85,'userProfileId':_0x7f22f2['userProfileId']},'raw':!![]})[_0x4d4f('0x2d')](function(_0x168742){if(_0x168742&&_0x168742['autoAssociation']===0x0){return db['UserProfileResource'][_0x4d4f('0x51')]({'name':_0xa6cef[_0x4d4f('0x2f')],'resourceId':_0xa6cef['id'],'type':_0x168742['name'],'sectionId':_0x168742['id']},{})[_0x4d4f('0x2d')](function(){return _0x21d0d6;});}else{return _0x21d0d6;}})['catch'](function(_0x17b59e){logger[_0x4d4f('0x56')](_0x4d4f('0x57'),_0x17b59e);throw _0x17b59e;});}return _0x21d0d6;})[_0x4d4f('0x2d')](respondWithResult(_0x401466,0xc9))['catch'](handleError(_0x401466,null));};exports[_0x4d4f('0x29')]=function(_0x2008c3,_0x36a446){if(_0x2008c3[_0x4d4f('0x52')]['id']){delete _0x2008c3[_0x4d4f('0x52')]['id'];}return db['VoiceMail'][_0x4d4f('0x50')]({'where':{'id':_0x2008c3['params']['id']}})[_0x4d4f('0x2d')](handleEntityNotFound(_0x36a446,null))['then'](saveUpdates(_0x2008c3[_0x4d4f('0x52')],null))[_0x4d4f('0x2d')](respondWithResult(_0x36a446,null))['catch'](handleError(_0x36a446,null));};exports[_0x4d4f('0x2a')]=function(_0x1d8ae6,_0x4d08c8){return db[_0x4d4f('0x33')]['find']({'where':{'id':_0x1d8ae6[_0x4d4f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d08c8,null))['then'](removeEntity(_0x4d08c8,null))[_0x4d4f('0x4c')](handleError(_0x4d08c8,null));};exports[_0x4d4f('0x58')]=function(_0x23bf8e,_0x213cdb,_0x29a3a1){return db['VoiceMail']['findOne']({'where':{'id':_0x23bf8e[_0x4d4f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x213cdb,null))[_0x4d4f('0x2d')](function(_0xadc9ac){var _0x23771c;var _0x4585b5={},_0x31aba3={};_0x31aba3[_0x4d4f('0x3d')]=_['keys'](db[_0x4d4f('0x59')][_0x4d4f('0x34')]);_0x31aba3[_0x4d4f('0x37')]=_['keys'](_0x23bf8e[_0x4d4f('0x37')]);_0x31aba3[_0x4d4f('0x38')]=_[_0x4d4f('0x39')](_0x31aba3['model'],_0x31aba3[_0x4d4f('0x37')]);_0x4585b5['attributes']=_[_0x4d4f('0x39')](_0x31aba3[_0x4d4f('0x3d')],qs[_0x4d4f('0x3b')](_0x23bf8e[_0x4d4f('0x37')][_0x4d4f('0x3b')]));_0x4585b5[_0x4d4f('0x3a')]=_0x4585b5[_0x4d4f('0x3a')][_0x4d4f('0x3c')]?_0x4585b5[_0x4d4f('0x3a')]:_0x31aba3['model'];if(!_0x23bf8e[_0x4d4f('0x37')][_0x4d4f('0x3e')]('nolimit')){_0x4585b5[_0x4d4f('0x23')]=qs[_0x4d4f('0x23')](_0x23bf8e[_0x4d4f('0x37')][_0x4d4f('0x23')]);_0x4585b5['offset']=qs[_0x4d4f('0x21')](_0x23bf8e[_0x4d4f('0x37')]['offset']);}_0x4585b5['order']=qs[_0x4d4f('0x40')](_0x23bf8e[_0x4d4f('0x37')]['sort']);_0x4585b5['where']=qs['filters'](_[_0x4d4f('0x41')](_0x23bf8e[_0x4d4f('0x37')],_0x31aba3['filters']));if(_0x23bf8e[_0x4d4f('0x37')][_0x4d4f('0x42')]){_0x4585b5[_0x4d4f('0x43')]=_[_0x4d4f('0x44')](_0x4585b5[_0x4d4f('0x43')],{'$or':_[_0x4d4f('0x32')](_0x4585b5[_0x4d4f('0x3a')],function(_0x20845c){var _0x542513={};_0x542513[_0x20845c]={'$like':'%'+_0x23bf8e[_0x4d4f('0x37')]['filter']+'%'};return _0x542513;})});}_0x4585b5[_0x4d4f('0x43')]=_[_0x4d4f('0x44')](_0x4585b5[_0x4d4f('0x43')],{'mailboxuser':_0xadc9ac['mailbox']});_0x4585b5=_[_0x4d4f('0x44')]({},_0x4585b5,_0x23bf8e[_0x4d4f('0x47')]);return db[_0x4d4f('0x59')][_0x4d4f('0x5a')](_0x4585b5)['then'](respondWithFilteredResult(_0x213cdb,_0x4585b5));})[_0x4d4f('0x4c')](handleError(_0x213cdb,null));};
\ No newline at end of file
+var _0xbaf0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getMessages','findOne','VoiceMailMessage','order','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','Voicemails','UserProfileResource','then','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user'];(function(_0x50ed6,_0x29f35a){var _0xeb1ad5=function(_0x97d306){while(--_0x97d306){_0x50ed6['push'](_0x50ed6['shift']());}};_0xeb1ad5(++_0x29f35a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xcc;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0x1b')](_0xe4378c);}return _0x465dd7['status'](_0xe4378c)[_0x0baf('0x1c')]();};}function respondWithResult(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0xc8;return function(_0x1f50c3){if(_0x1f50c3){return _0x49e44b[_0x0baf('0x1d')](_0x1c76a8)[_0x0baf('0x1e')](_0x1f50c3);}};}function respondWithFilteredResult(_0xb8339e,_0x469599){return function(_0x4f80a8){if(_0x4f80a8){var _0x4cd79d=typeof _0x469599[_0x0baf('0x1f')]===_0x0baf('0x20')&&typeof _0x469599[_0x0baf('0x21')]===_0x0baf('0x20');var _0x2cf7da=_0x4f80a8[_0x0baf('0x22')];var _0x53c338=_0x4cd79d?0x0:_0x469599[_0x0baf('0x1f')];var _0xfbecec=_0x4cd79d?_0x4f80a8[_0x0baf('0x22')]:_0x469599[_0x0baf('0x1f')]+_0x469599[_0x0baf('0x21')];var _0x42b7f2;if(_0xfbecec>=_0x2cf7da){_0xfbecec=_0x2cf7da;_0x42b7f2=0xc8;}else{_0x42b7f2=0xce;}_0xb8339e['status'](_0x42b7f2);return _0xb8339e['set'](_0x0baf('0x23'),_0x53c338+'-'+_0xfbecec+'/'+_0x2cf7da)[_0x0baf('0x1e')](_0x4f80a8);}return null;};}function patchUpdates(_0x32e839){return function(_0x1848e8){try{jsonpatch[_0x0baf('0x24')](_0x1848e8,_0x32e839,!![]);}catch(_0x3e3e20){return BPromise[_0x0baf('0x25')](_0x3e3e20);}return _0x1848e8[_0x0baf('0x26')]();};}function saveUpdates(_0x2c42e2,_0x15a2c3){return function(_0x54f2fa){if(_0x54f2fa){return _0x54f2fa[_0x0baf('0x27')](_0x2c42e2)['then'](function(_0xf6c158){return _0xf6c158;});}return null;};}function removeEntity(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(_0x2ef0aa){return _0x2ef0aa['destroy']()['then'](function(){var _0x47c4b=_0x2ef0aa[_0x0baf('0x28')]({'plain':!![]});var _0x34e264=_0x0baf('0x29');return db[_0x0baf('0x2a')]['destroy']({'where':{'type':_0x34e264,'resourceId':_0x47c4b['id']}})[_0x0baf('0x2b')](function(){return _0x2ef0aa;});})[_0x0baf('0x2b')](function(){_0x5dbf00[_0x0baf('0x1d')](0xcc)[_0x0baf('0x1c')]();});}};}function handleEntityNotFound(_0x3843b8,_0x3b9b31){return function(_0x453525){if(!_0x453525){_0x3843b8['sendStatus'](0x194);}return _0x453525;};}function handleError(_0x1590b4,_0x393a5a){_0x393a5a=_0x393a5a||0x1f4;return function(_0xcaf13d){logger[_0x0baf('0x2c')](_0xcaf13d['stack']);if(_0xcaf13d[_0x0baf('0x2d')]){delete _0xcaf13d[_0x0baf('0x2d')];}_0x1590b4['status'](_0x393a5a)[_0x0baf('0x2e')](_0xcaf13d);};}exports[_0x0baf('0x2f')]=function(_0x478ce8,_0xb4dbb1){var _0xd14f0f={},_0x366924={},_0x213a6a={'count':0x0,'rows':[]};var _0x57476f=_[_0x0baf('0x30')](db[_0x0baf('0x31')][_0x0baf('0x32')],function(_0x3ed995){return{'name':_0x3ed995[_0x0baf('0x33')],'type':_0x3ed995[_0x0baf('0x34')][_0x0baf('0x35')]};});_0x366924[_0x0baf('0x36')]=_[_0x0baf('0x30')](_0x57476f,_0x0baf('0x2d'));_0x366924[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x478ce8[_0x0baf('0x37')]);_0x366924[_0x0baf('0x39')]=_['intersection'](_0x366924[_0x0baf('0x36')],_0x366924['query']);_0xd14f0f[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x366924[_0x0baf('0x36')],qs[_0x0baf('0x3c')](_0x478ce8['query'][_0x0baf('0x3c')]));_0xd14f0f[_0x0baf('0x3a')]=_0xd14f0f['attributes'][_0x0baf('0x3d')]?_0xd14f0f[_0x0baf('0x3a')]:_0x366924[_0x0baf('0x36')];if(!_0x478ce8[_0x0baf('0x37')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0xd14f0f[_0x0baf('0x21')]=qs[_0x0baf('0x21')](_0x478ce8['query'][_0x0baf('0x21')]);_0xd14f0f[_0x0baf('0x1f')]=qs['offset'](_0x478ce8[_0x0baf('0x37')]['offset']);}_0xd14f0f['order']=qs[_0x0baf('0x40')](_0x478ce8[_0x0baf('0x37')]['sort']);_0xd14f0f['where']=qs[_0x0baf('0x39')](_[_0x0baf('0x41')](_0x478ce8[_0x0baf('0x37')],_0x366924[_0x0baf('0x39')]),_0x57476f);if(_0x478ce8[_0x0baf('0x37')][_0x0baf('0x42')]){_0xd14f0f[_0x0baf('0x43')]=_[_0x0baf('0x44')](_0xd14f0f[_0x0baf('0x43')],{'$or':_[_0x0baf('0x30')](_0x57476f,function(_0x200864){if(_0x200864[_0x0baf('0x34')]!==_0x0baf('0x45')){var _0x229ea6={};_0x229ea6[_0x200864['name']]={'$like':'%'+_0x478ce8[_0x0baf('0x37')][_0x0baf('0x42')]+'%'};return _0x229ea6;}})});}_0xd14f0f=_['merge']({},_0xd14f0f,_0x478ce8[_0x0baf('0x46')]);var _0x324369={'where':_0xd14f0f[_0x0baf('0x43')]};return db[_0x0baf('0x31')][_0x0baf('0x22')](_0x324369)[_0x0baf('0x2b')](function(_0x57b581){_0x213a6a[_0x0baf('0x22')]=_0x57b581;if(_0x478ce8[_0x0baf('0x37')]['includeAll']){_0xd14f0f[_0x0baf('0x47')]=[{'all':!![]}];}return db[_0x0baf('0x31')][_0x0baf('0x48')](_0xd14f0f);})[_0x0baf('0x2b')](function(_0x504031){_0x213a6a[_0x0baf('0x49')]=_0x504031;return _0x213a6a;})[_0x0baf('0x2b')](respondWithFilteredResult(_0xb4dbb1,_0xd14f0f))[_0x0baf('0x4a')](handleError(_0xb4dbb1,null));};exports[_0x0baf('0x4b')]=function(_0x2b6d54,_0x385b24){var _0x33da34={'raw':!![],'where':{'id':_0x2b6d54[_0x0baf('0x4c')]['id']}},_0x1fa237={};_0x1fa237[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0x31')][_0x0baf('0x32')]);_0x1fa237[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x2b6d54[_0x0baf('0x37')]);_0x1fa237['filters']=_[_0x0baf('0x3b')](_0x1fa237[_0x0baf('0x36')],_0x1fa237[_0x0baf('0x37')]);_0x33da34[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1fa237['model'],qs[_0x0baf('0x3c')](_0x2b6d54[_0x0baf('0x37')][_0x0baf('0x3c')]));_0x33da34[_0x0baf('0x3a')]=_0x33da34[_0x0baf('0x3a')][_0x0baf('0x3d')]?_0x33da34[_0x0baf('0x3a')]:_0x1fa237['model'];if(_0x2b6d54[_0x0baf('0x37')][_0x0baf('0x4d')]){_0x33da34[_0x0baf('0x47')]=[{'all':!![]}];}_0x33da34=_['merge']({},_0x33da34,_0x2b6d54[_0x0baf('0x46')]);return db[_0x0baf('0x31')][_0x0baf('0x4e')](_0x33da34)[_0x0baf('0x2b')](handleEntityNotFound(_0x385b24,null))[_0x0baf('0x2b')](respondWithResult(_0x385b24,null))[_0x0baf('0x4a')](handleError(_0x385b24,null));};exports[_0x0baf('0x4f')]=function(_0x5a54bb,_0x22c451){return db[_0x0baf('0x31')][_0x0baf('0x4f')](_0x5a54bb[_0x0baf('0x50')],{})[_0x0baf('0x2b')](function(_0xc427b2){var _0x40d4a6=_0x5a54bb[_0x0baf('0x51')][_0x0baf('0x28')]({'plain':!![]});if(!_0x40d4a6)throw new Error(_0x0baf('0x52'));if(_0x40d4a6[_0x0baf('0x53')]==='user'){var _0x528ff6=_0xc427b2[_0x0baf('0x28')]({'plain':!![]});var _0x3d6b19=_0x0baf('0x29');return db[_0x0baf('0x54')][_0x0baf('0x4e')]({'where':{'name':_0x3d6b19,'userProfileId':_0x40d4a6[_0x0baf('0x55')]},'raw':!![]})[_0x0baf('0x2b')](function(_0x4b492c){if(_0x4b492c&&_0x4b492c[_0x0baf('0x56')]===0x0){return db[_0x0baf('0x2a')][_0x0baf('0x4f')]({'name':_0x528ff6[_0x0baf('0x2d')],'resourceId':_0x528ff6['id'],'type':_0x4b492c[_0x0baf('0x2d')],'sectionId':_0x4b492c['id']},{})[_0x0baf('0x2b')](function(){return _0xc427b2;});}else{return _0xc427b2;}})['catch'](function(_0x3eebe5){logger['error'](_0x0baf('0x57'),_0x3eebe5);throw _0x3eebe5;});}return _0xc427b2;})['then'](respondWithResult(_0x22c451,0xc9))[_0x0baf('0x4a')](handleError(_0x22c451,null));};exports['update']=function(_0x35b1a5,_0x4c035b){if(_0x35b1a5[_0x0baf('0x50')]['id']){delete _0x35b1a5[_0x0baf('0x50')]['id'];}return db[_0x0baf('0x31')][_0x0baf('0x4e')]({'where':{'id':_0x35b1a5[_0x0baf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c035b,null))[_0x0baf('0x2b')](saveUpdates(_0x35b1a5[_0x0baf('0x50')],null))[_0x0baf('0x2b')](respondWithResult(_0x4c035b,null))[_0x0baf('0x4a')](handleError(_0x4c035b,null));};exports[_0x0baf('0x58')]=function(_0xa19b21,_0x480834){return db[_0x0baf('0x31')][_0x0baf('0x4e')]({'where':{'id':_0xa19b21[_0x0baf('0x4c')]['id']}})[_0x0baf('0x2b')](handleEntityNotFound(_0x480834,null))[_0x0baf('0x2b')](removeEntity(_0x480834,null))[_0x0baf('0x4a')](handleError(_0x480834,null));};exports[_0x0baf('0x59')]=function(_0x565292,_0x48e855,_0x23f6ea){return db[_0x0baf('0x31')][_0x0baf('0x5a')]({'where':{'id':_0x565292[_0x0baf('0x4c')]['id']}})[_0x0baf('0x2b')](handleEntityNotFound(_0x48e855,null))[_0x0baf('0x2b')](function(_0xaa4293){var _0x14a667;var _0x3d9a32={},_0x585969={};_0x585969[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x5b')][_0x0baf('0x32')]);_0x585969[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x565292[_0x0baf('0x37')]);_0x585969['filters']=_[_0x0baf('0x3b')](_0x585969[_0x0baf('0x36')],_0x585969[_0x0baf('0x37')]);_0x3d9a32[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x585969[_0x0baf('0x36')],qs[_0x0baf('0x3c')](_0x565292[_0x0baf('0x37')]['fields']));_0x3d9a32[_0x0baf('0x3a')]=_0x3d9a32['attributes'][_0x0baf('0x3d')]?_0x3d9a32['attributes']:_0x585969['model'];if(!_0x565292[_0x0baf('0x37')]['hasOwnProperty'](_0x0baf('0x3f'))){_0x3d9a32[_0x0baf('0x21')]=qs['limit'](_0x565292[_0x0baf('0x37')][_0x0baf('0x21')]);_0x3d9a32[_0x0baf('0x1f')]=qs['offset'](_0x565292['query'][_0x0baf('0x1f')]);}_0x3d9a32[_0x0baf('0x5c')]=qs[_0x0baf('0x40')](_0x565292[_0x0baf('0x37')][_0x0baf('0x40')]);_0x3d9a32['where']=qs[_0x0baf('0x39')](_['pick'](_0x565292['query'],_0x585969['filters']));if(_0x565292[_0x0baf('0x37')]['filter']){_0x3d9a32['where']=_[_0x0baf('0x44')](_0x3d9a32[_0x0baf('0x43')],{'$or':_[_0x0baf('0x30')](_0x3d9a32[_0x0baf('0x3a')],function(_0x245967){var _0x27ddc7={};_0x27ddc7[_0x245967]={'$like':'%'+_0x565292['query'][_0x0baf('0x42')]+'%'};return _0x27ddc7;})});}_0x3d9a32[_0x0baf('0x43')]=_[_0x0baf('0x44')](_0x3d9a32[_0x0baf('0x43')],{'mailboxuser':_0xaa4293[_0x0baf('0x5d')]});_0x3d9a32=_[_0x0baf('0x44')]({},_0x3d9a32,_0x565292['options']);return db[_0x0baf('0x5b')][_0x0baf('0x5e')](_0x3d9a32)[_0x0baf('0x2b')](respondWithFilteredResult(_0x48e855,_0x3d9a32));})['catch'](handleError(_0x48e855,null));};
\ No newline at end of file
index f42b0c2..5b433a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e17=['api','moment','path','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','mailbox_context','context','lodash','util','../../config/logger'];(function(_0x1d5cfa,_0x57efb0){var _0x19a273=function(_0x2fe3f5){while(--_0x2fe3f5){_0x1d5cfa['push'](_0x1d5cfa['shift']());}};_0x19a273(++_0x57efb0);}(_0x9e17,0x128));var _0x79e1=function(_0x279095,_0x15f37e){_0x279095=_0x279095-0x0;var _0x5a5cdb=_0x9e17[_0x279095];return _0x5a5cdb;};'use strict';var _=require(_0x79e1('0x0'));var util=require(_0x79e1('0x1'));var logger=require(_0x79e1('0x2'))(_0x79e1('0x3'));var moment=require(_0x79e1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x79e1('0x5'));var rimraf=require(_0x79e1('0x6'));var config=require(_0x79e1('0x7'));var attributes=require(_0x79e1('0x8'));module[_0x79e1('0x9')]=function(_0x22b752,_0x6ca58b){return _0x22b752['define'](_0x79e1('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x79e1('0xb'),'fields':['mailbox',_0x79e1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x653a=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','bluebird'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x653a,0x127));var _0xa653=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0x653a[_0xfd495c];return _0x561dd8;};'use strict';var _=require(_0xa653('0x0'));var util=require(_0xa653('0x1'));var logger=require(_0xa653('0x2'))(_0xa653('0x3'));var moment=require('moment');var BPromise=require(_0xa653('0x4'));var rp=require(_0xa653('0x5'));var fs=require('fs');var path=require(_0xa653('0x6'));var rimraf=require(_0xa653('0x7'));var config=require(_0xa653('0x8'));var attributes=require('./voiceMail.attributes');module[_0xa653('0x9')]=function(_0xec7091,_0x3c82a4){return _0xec7091[_0xa653('0xa')](_0xa653('0xb'),attributes,{'tableName':_0xa653('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xa653('0xd'),_0xa653('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 0f68ad3..2d4f470 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd5=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x195ef2,_0x30ab1f){var _0x4f19e5=function(_0x46b71c){while(--_0x46b71c){_0x195ef2['push'](_0x195ef2['shift']());}};_0x4f19e5(++_0x30ab1f);}(_0x0bd5,0xa6));var _0x50bd=function(_0x2dc09d,_0x12d07a){_0x2dc09d=_0x2dc09d-0x0;var _0x1f4dd1=_0x0bd5[_0x2dc09d];return _0x1f4dd1;};'use strict';var _=require(_0x50bd('0x0'));var util=require(_0x50bd('0x1'));var moment=require(_0x50bd('0x2'));var BPromise=require(_0x50bd('0x3'));var rs=require(_0x50bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x50bd('0x5'));var logger=require(_0x50bd('0x6'))(_0x50bd('0x7'));var config=require(_0x50bd('0x8'));var jayson=require(_0x50bd('0x9'));var client=jayson[_0x50bd('0xa')][_0x50bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1371d6,_0x44b5af,_0xb6f39a){return new BPromise(function(_0x5a2edc,_0x3f2a06){return client['request'](_0x1371d6,_0xb6f39a)[_0x50bd('0xc')](function(_0x3504fe){logger[_0x50bd('0xd')](_0x50bd('0xe'),_0x44b5af,_0x50bd('0xf'));logger[_0x50bd('0x10')](_0x50bd('0x11'),_0x44b5af,_0x50bd('0xf'),JSON[_0x50bd('0x12')](_0x3504fe));if(_0x3504fe[_0x50bd('0x13')]){if(_0x3504fe[_0x50bd('0x13')][_0x50bd('0x14')]===0x1f4){logger[_0x50bd('0x13')](_0x50bd('0xe'),_0x44b5af,_0x3504fe[_0x50bd('0x13')][_0x50bd('0x15')]);return _0x3f2a06(_0x3504fe['error']['message']);}logger[_0x50bd('0x13')](_0x50bd('0xe'),_0x44b5af,_0x3504fe[_0x50bd('0x13')][_0x50bd('0x15')]);return _0x5a2edc(_0x3504fe[_0x50bd('0x13')][_0x50bd('0x15')]);}else{logger['info'](_0x50bd('0xe'),_0x44b5af,'request\x20sent');_0x5a2edc(_0x3504fe[_0x50bd('0x16')][_0x50bd('0x15')]);}})[_0x50bd('0x17')](function(_0x52e31a){logger['error'](_0x50bd('0xe'),_0x44b5af,_0x52e31a);_0x3f2a06(_0x52e31a);});});}
\ No newline at end of file
+var _0x1948=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x23e79e,_0x236d6e){var _0x18bf9e=function(_0x661aaa){while(--_0x661aaa){_0x23e79e['push'](_0x23e79e['shift']());}};_0x18bf9e(++_0x236d6e);}(_0x1948,0x125));var _0x8194=function(_0xb351c5,_0x1e8425){_0xb351c5=_0xb351c5-0x0;var _0x5b34d1=_0x1948[_0xb351c5];return _0x5b34d1;};'use strict';var _=require(_0x8194('0x0'));var util=require(_0x8194('0x1'));var moment=require(_0x8194('0x2'));var BPromise=require('bluebird');var rs=require(_0x8194('0x3'));var fs=require('fs');var Redis=require(_0x8194('0x4'));var db=require(_0x8194('0x5'))['db'];var utils=require(_0x8194('0x6'));var logger=require(_0x8194('0x7'))(_0x8194('0x8'));var config=require(_0x8194('0x9'));var jayson=require(_0x8194('0xa'));var client=jayson[_0x8194('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x60bb1b,_0x4fd99c,_0x793d5f){return new BPromise(function(_0x7a0da2,_0x313713){return client['request'](_0x60bb1b,_0x793d5f)[_0x8194('0xc')](function(_0x4cc3cb){logger['info'](_0x8194('0xd'),_0x4fd99c,_0x8194('0xe'));logger[_0x8194('0xf')](_0x8194('0x10'),_0x4fd99c,_0x8194('0xe'),JSON[_0x8194('0x11')](_0x4cc3cb));if(_0x4cc3cb[_0x8194('0x12')]){if(_0x4cc3cb[_0x8194('0x12')]['code']===0x1f4){logger[_0x8194('0x12')](_0x8194('0xd'),_0x4fd99c,_0x4cc3cb[_0x8194('0x12')][_0x8194('0x13')]);return _0x313713(_0x4cc3cb[_0x8194('0x12')]['message']);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x4fd99c,_0x4cc3cb[_0x8194('0x12')]['message']);return _0x7a0da2(_0x4cc3cb[_0x8194('0x12')]['message']);}else{logger[_0x8194('0x14')](_0x8194('0xd'),_0x4fd99c,'request\x20sent');_0x7a0da2(_0x4cc3cb[_0x8194('0x15')][_0x8194('0x13')]);}})[_0x8194('0x16')](function(_0x4843b2){logger[_0x8194('0x12')](_0x8194('0xd'),_0x4fd99c,_0x4843b2);_0x313713(_0x4843b2);});});}
\ No newline at end of file
index 1f9fb4f..263db08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f8d=['get','/:id','show','/:id/download','isAuthenticated','download','post','create','put','update','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x35634e,_0x261cf9){var _0x30b8f9=function(_0x2f2fca){while(--_0x2f2fca){_0x35634e['push'](_0x35634e['shift']());}};_0x30b8f9(++_0x261cf9);}(_0x2f8d,0x1e7));var _0xd2f8=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x2f8d[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd2f8('0x0'));var timeout=require(_0xd2f8('0x1'));var express=require(_0xd2f8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd2f8('0x3'));var interaction=require(_0xd2f8('0x4'));var config=require(_0xd2f8('0x5'));var controller=require(_0xd2f8('0x6'));router[_0xd2f8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd2f8('0x7')](_0xd2f8('0x8'),auth['isAuthenticated'](),controller[_0xd2f8('0x9')]);router[_0xd2f8('0x7')](_0xd2f8('0xa'),auth[_0xd2f8('0xb')](),controller[_0xd2f8('0xc')]);router[_0xd2f8('0xd')]('/',auth[_0xd2f8('0xb')](),controller[_0xd2f8('0xe')]);router[_0xd2f8('0xf')](_0xd2f8('0x8'),auth[_0xd2f8('0xb')](),controller[_0xd2f8('0x10')]);router[_0xd2f8('0x11')](_0xd2f8('0x8'),auth[_0xd2f8('0xb')](),controller['destroy']);module[_0xd2f8('0x12')]=router;
\ No newline at end of file
+var _0xd6f2=['./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x46a4a5,_0x1799e9){var _0xcef2c5=function(_0x1289f3){while(--_0x1289f3){_0x46a4a5['push'](_0x46a4a5['shift']());}};_0xcef2c5(++_0x1799e9);}(_0xd6f2,0x1ee));var _0x2d6f=function(_0x3fa0a3,_0x1e361d){_0x3fa0a3=_0x3fa0a3-0x0;var _0x2a6715=_0xd6f2[_0x3fa0a3];return _0x2a6715;};'use strict';var multer=require('multer');var util=require(_0x2d6f('0x0'));var path=require('path');var timeout=require(_0x2d6f('0x1'));var express=require('express');var router=express[_0x2d6f('0x2')]();var fs_extra=require(_0x2d6f('0x3'));var auth=require(_0x2d6f('0x4'));var interaction=require(_0x2d6f('0x5'));var config=require('../../config/environment');var controller=require(_0x2d6f('0x6'));router[_0x2d6f('0x7')]('/',auth[_0x2d6f('0x8')](),controller[_0x2d6f('0x9')]);router[_0x2d6f('0x7')](_0x2d6f('0xa'),auth['isAuthenticated'](),controller[_0x2d6f('0xb')]);router[_0x2d6f('0x7')](_0x2d6f('0xc'),auth[_0x2d6f('0x8')](),controller[_0x2d6f('0xd')]);router[_0x2d6f('0xe')]('/',auth['isAuthenticated'](),controller[_0x2d6f('0xf')]);router[_0x2d6f('0x10')](_0x2d6f('0xa'),auth[_0x2d6f('0x8')](),controller[_0x2d6f('0x11')]);router['delete'](_0x2d6f('0xa'),auth[_0x2d6f('0x8')](),controller[_0x2d6f('0x12')]);module[_0x2d6f('0x13')]=router;
\ No newline at end of file
index 32cbcf5..280c191 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36a6=['long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x36a6,0x103));var _0x636a=function(_0x508f27,_0x494e72){_0x508f27=_0x508f27-0x0;var _0x7d4144=_0x36a6[_0x508f27];return _0x7d4144;};'use strict';var Sequelize=require('sequelize');module[_0x636a('0x0')]={'name':{'type':Sequelize[_0x636a('0x1')],'get':function(_0x3edca4){return this[_0x636a('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x636a('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x636a('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x636a('0x4')],'defaultValue':''},'stamp':{'type':_0x636a('0x6'),'defaultValue':Sequelize['literal'](_0x636a('0x7'))}};
\ No newline at end of file
+var _0x54f5=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','STRING','BLOB','long'];(function(_0x2c4aaf,_0x4b2278){var _0x365220=function(_0x38ecf2){while(--_0x38ecf2){_0x2c4aaf['push'](_0x2c4aaf['shift']());}};_0x365220(++_0x4b2278);}(_0x54f5,0xc0));var _0x554f=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x54f5[_0x54bac5];return _0xc15971;};'use strict';var Sequelize=require(_0x554f('0x0'));module[_0x554f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x27539c){return this[_0x554f('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x554f('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x554f('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x554f('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x554f('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x554f('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x554f('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x554f('0x4')](_0x554f('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x554f('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x554f('0x3')],'defaultValue':''},'stamp':{'type':_0x554f('0x6'),'defaultValue':Sequelize[_0x554f('0x7')](_0x554f('0x8'))}};
\ No newline at end of file
index 40d1b96..0f4de03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a2b=['attachment;\x20filename=\x22','.wav\x22','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','offset','count','limit','json','apply','save','then','destroy','error','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','update','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment'];(function(_0x362733,_0x46e9fa){var _0x4fccca=function(_0x57289e){while(--_0x57289e){_0x362733['push'](_0x362733['shift']());}};_0x4fccca(++_0x46e9fa);}(_0x7a2b,0x13a));var _0xb7a2=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x7a2b[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0xb7a2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb7a2('0x1'));var rp=require(_0xb7a2('0x2'));var moment=require(_0xb7a2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb7a2('0x4'));var util=require(_0xb7a2('0x5'));var path=require('path');var sox=require(_0xb7a2('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7a2('0x7'));var _=require(_0xb7a2('0x8'));var squel=require('squel');var crypto=require(_0xb7a2('0x9'));var jsforce=require(_0xb7a2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb7a2('0xb'));var querystring=require(_0xb7a2('0xc'));var Papa=require('papaparse');var Redis=require(_0xb7a2('0xd'));var authService=require(_0xb7a2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb7a2('0xf'));var hardwareService=require(_0xb7a2('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb7a2('0x11'));var licenseUtil=require(_0xb7a2('0x12'));var db=require(_0xb7a2('0x13'))['db'];function respondWithStatusCode(_0x4f20b0,_0x48d84c){_0x48d84c=_0x48d84c||0xcc;return function(_0x5e55e5){if(_0x5e55e5){return _0x4f20b0[_0xb7a2('0x14')](_0x48d84c);}return _0x4f20b0[_0xb7a2('0x15')](_0x48d84c)['end']();};}function respondWithResult(_0x2df5ba,_0x25e30b){_0x25e30b=_0x25e30b||0xc8;return function(_0x52aa9b){if(_0x52aa9b){return _0x2df5ba[_0xb7a2('0x15')](_0x25e30b)['json'](_0x52aa9b);}};}function respondWithFilteredResult(_0x310f81,_0x36ca57){return function(_0x315fc4){if(_0x315fc4){var _0x12ac66=typeof _0x36ca57['offset']===_0xb7a2('0x16')&&typeof _0x36ca57['limit']===_0xb7a2('0x16');var _0x1b57a9=_0x315fc4['count'];var _0x338070=_0x12ac66?0x0:_0x36ca57[_0xb7a2('0x17')];var _0x27de61=_0x12ac66?_0x315fc4[_0xb7a2('0x18')]:_0x36ca57[_0xb7a2('0x17')]+_0x36ca57[_0xb7a2('0x19')];var _0x1c00dd;if(_0x27de61>=_0x1b57a9){_0x27de61=_0x1b57a9;_0x1c00dd=0xc8;}else{_0x1c00dd=0xce;}_0x310f81['status'](_0x1c00dd);return _0x310f81['set']('Content-Range',_0x338070+'-'+_0x27de61+'/'+_0x1b57a9)[_0xb7a2('0x1a')](_0x315fc4);}return null;};}function patchUpdates(_0x3e1894){return function(_0x459e5a){try{jsonpatch[_0xb7a2('0x1b')](_0x459e5a,_0x3e1894,!![]);}catch(_0x447150){return BPromise['reject'](_0x447150);}return _0x459e5a[_0xb7a2('0x1c')]();};}function saveUpdates(_0x1792a6,_0x499925){return function(_0x4caa42){if(_0x4caa42){return _0x4caa42['update'](_0x1792a6)[_0xb7a2('0x1d')](function(_0x1f2c55){return _0x1f2c55;});}return null;};}function removeEntity(_0x2ac171,_0x31adf7){return function(_0x42a1b2){if(_0x42a1b2){return _0x42a1b2[_0xb7a2('0x1e')]()[_0xb7a2('0x1d')](function(){_0x2ac171[_0xb7a2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbe62b3,_0x1742b0){return function(_0x14e50c){if(!_0x14e50c){_0xbe62b3[_0xb7a2('0x14')](0x194);}return _0x14e50c;};}function handleError(_0x245636,_0x4f8b34){_0x4f8b34=_0x4f8b34||0x1f4;return function(_0x37adf5){logger[_0xb7a2('0x1f')](_0x37adf5[_0xb7a2('0x20')]);if(_0x37adf5[_0xb7a2('0x21')]){delete _0x37adf5[_0xb7a2('0x21')];}_0x245636[_0xb7a2('0x15')](_0x4f8b34)[_0xb7a2('0x22')](_0x37adf5);};}exports['index']=function(_0x42e135,_0x14ef4){var _0x46836d={},_0x205803={},_0x2e8a98={'count':0x0,'rows':[]};var _0x597a9a=_[_0xb7a2('0x23')](db[_0xb7a2('0x24')][_0xb7a2('0x25')],function(_0x4c666c){return{'name':_0x4c666c[_0xb7a2('0x26')],'type':_0x4c666c[_0xb7a2('0x27')][_0xb7a2('0x28')]};});_0x205803['model']=_[_0xb7a2('0x29')](_['map'](_0x597a9a,_0xb7a2('0x21')),[_0xb7a2('0x21')]);_0x205803[_0xb7a2('0x2a')]=_['keys'](_0x42e135[_0xb7a2('0x2a')]);_0x205803[_0xb7a2('0x2b')]=_['intersection'](_0x205803['model'],_0x205803[_0xb7a2('0x2a')]);_0x46836d['attributes']=_[_0xb7a2('0x2c')](_0x205803[_0xb7a2('0x2d')],qs[_0xb7a2('0x2e')](_0x42e135[_0xb7a2('0x2a')][_0xb7a2('0x2e')]));_0x46836d[_0xb7a2('0x2f')]=_0x46836d['attributes']['length']?_0x46836d[_0xb7a2('0x2f')]:_0x205803[_0xb7a2('0x2d')];if(!_0x42e135[_0xb7a2('0x2a')][_0xb7a2('0x30')](_0xb7a2('0x31'))){_0x46836d['limit']=qs[_0xb7a2('0x19')](_0x42e135[_0xb7a2('0x2a')][_0xb7a2('0x19')]);_0x46836d[_0xb7a2('0x17')]=qs['offset'](_0x42e135[_0xb7a2('0x2a')]['offset']);}_0x46836d[_0xb7a2('0x32')]=qs[_0xb7a2('0x33')](_0x42e135[_0xb7a2('0x2a')][_0xb7a2('0x33')]);_0x46836d['where']=qs[_0xb7a2('0x2b')](_[_0xb7a2('0x34')](_0x42e135[_0xb7a2('0x2a')],_0x205803[_0xb7a2('0x2b')]),_0x597a9a);if(_0x42e135[_0xb7a2('0x2a')][_0xb7a2('0x35')]){_0x46836d[_0xb7a2('0x36')]=_['merge'](_0x46836d['where'],{'$or':_[_0xb7a2('0x23')](_0x597a9a,function(_0xc0f658){if(_0xc0f658[_0xb7a2('0x27')]!==_0xb7a2('0x37')){var _0x3640b4={};_0x3640b4[_0xc0f658[_0xb7a2('0x21')]]={'$like':'%'+_0x42e135[_0xb7a2('0x2a')][_0xb7a2('0x35')]+'%'};return _0x3640b4;}})});}_0x46836d=_[_0xb7a2('0x38')]({},_0x46836d,_0x42e135[_0xb7a2('0x39')]);var _0x5b3bfd={'where':_0x46836d[_0xb7a2('0x36')]};return db[_0xb7a2('0x24')][_0xb7a2('0x18')](_0x5b3bfd)[_0xb7a2('0x1d')](function(_0x164b5a){_0x2e8a98[_0xb7a2('0x18')]=_0x164b5a;if(_0x42e135['query'][_0xb7a2('0x3a')]){_0x46836d[_0xb7a2('0x3b')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xb7a2('0x3c')](_0x46836d);})[_0xb7a2('0x1d')](function(_0x45f5ed){_0x2e8a98[_0xb7a2('0x3d')]=_0x45f5ed;return _0x2e8a98;})[_0xb7a2('0x1d')](respondWithFilteredResult(_0x14ef4,_0x46836d))[_0xb7a2('0x3e')](handleError(_0x14ef4,null));};exports['show']=function(_0x125881,_0x5e5f3d){var _0x12a428={'raw':!![],'where':{'id':_0x125881[_0xb7a2('0x3f')]['id']}},_0x262bce={};_0x262bce[_0xb7a2('0x2d')]=_['keys'](db[_0xb7a2('0x24')][_0xb7a2('0x25')]);_0x262bce[_0xb7a2('0x2a')]=_[_0xb7a2('0x40')](_0x125881[_0xb7a2('0x2a')]);_0x262bce[_0xb7a2('0x2b')]=_[_0xb7a2('0x2c')](_0x262bce[_0xb7a2('0x2d')],_0x262bce['query']);_0x12a428[_0xb7a2('0x2f')]=_['intersection'](_0x262bce[_0xb7a2('0x2d')],qs[_0xb7a2('0x2e')](_0x125881[_0xb7a2('0x2a')][_0xb7a2('0x2e')]));_0x12a428[_0xb7a2('0x2f')]=_0x12a428[_0xb7a2('0x2f')][_0xb7a2('0x41')]?_0x12a428[_0xb7a2('0x2f')]:_0x262bce[_0xb7a2('0x2d')];if(_0x125881[_0xb7a2('0x2a')][_0xb7a2('0x3a')]){_0x12a428[_0xb7a2('0x3b')]=[{'all':!![]}];}_0x12a428=_['merge']({},_0x12a428,_0x125881[_0xb7a2('0x39')]);return db[_0xb7a2('0x24')][_0xb7a2('0x42')](_0x12a428)[_0xb7a2('0x1d')](handleEntityNotFound(_0x5e5f3d,null))['then'](respondWithResult(_0x5e5f3d,null))['catch'](handleError(_0x5e5f3d,null));};exports[_0xb7a2('0x43')]=function(_0x190eca,_0x37517e){return db[_0xb7a2('0x24')][_0xb7a2('0x43')](_0x190eca[_0xb7a2('0x44')],{})['then'](respondWithResult(_0x37517e,0xc9))['catch'](handleError(_0x37517e,null));};exports[_0xb7a2('0x45')]=function(_0x353a53,_0x4f027b){if(_0x353a53['body']['id']){delete _0x353a53[_0xb7a2('0x44')]['id'];}return db[_0xb7a2('0x24')][_0xb7a2('0x42')]({'where':{'id':_0x353a53[_0xb7a2('0x3f')]['id']}})[_0xb7a2('0x1d')](handleEntityNotFound(_0x4f027b,null))[_0xb7a2('0x1d')](saveUpdates(_0x353a53[_0xb7a2('0x44')],null))[_0xb7a2('0x1d')](respondWithResult(_0x4f027b,null))[_0xb7a2('0x3e')](handleError(_0x4f027b,null));};exports[_0xb7a2('0x1e')]=function(_0x23a5f1,_0x2965a4){return db[_0xb7a2('0x24')][_0xb7a2('0x42')]({'where':{'id':_0x23a5f1['params']['id']}})[_0xb7a2('0x1d')](handleEntityNotFound(_0x2965a4,null))['then'](removeEntity(_0x2965a4,null))[_0xb7a2('0x3e')](handleError(_0x2965a4,null));};exports['download']=function(_0x3e079e,_0x12e6c2,_0x1aea0f){return db[_0xb7a2('0x24')]['find']({'where':{'id':_0x3e079e[_0xb7a2('0x3f')]['id']},'attributes':['id',_0xb7a2('0x46'),_0xb7a2('0x47')]})[_0xb7a2('0x1d')](handleEntityNotFound(_0x12e6c2,null))[_0xb7a2('0x1d')](function(_0x20d5af){if(_0x20d5af){if(!_0x20d5af[_0xb7a2('0x46')]){throw new db['Sequelize'][(_0xb7a2('0x48'))](_0xb7a2('0x49'));}var _0x5bada5={'Content-Type':_0xb7a2('0x4a'),'Content-Disposition':_0xb7a2('0x4b')};if(_0x20d5af[_0xb7a2('0x47')]){_0x5bada5['Content-Disposition']=_0xb7a2('0x4c')+_0x20d5af[_0xb7a2('0x47')]+_0xb7a2('0x4d');}_0x12e6c2['set'](_0x5bada5);return _0x12e6c2[_0xb7a2('0x22')](new Buffer(_0x20d5af[_0xb7a2('0x46')]));}})[_0xb7a2('0x3e')](handleError(_0x12e6c2,null));};
\ No newline at end of file
+var _0xd2b4=['sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','merge','where','VoiceMailMessage','includeAll','rows','catch','show','include','options','find','create','body','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','zip-dir','fast-json-patch','mustache','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x42a826,_0x51e7d2){var _0x2604f4=function(_0x50cba6){while(--_0x50cba6){_0x42a826['push'](_0x42a826['shift']());}};_0x2604f4(++_0x51e7d2);}(_0xd2b4,0x12b));var _0x4d2b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xd2b4[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require(_0x4d2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d2b('0x1'));var jsonpatch=require(_0x4d2b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4d2b('0x3'));var util=require('util');var path=require(_0x4d2b('0x4'));var sox=require(_0x4d2b('0x5'));var csv=require('to-csv');var ejs=require(_0x4d2b('0x6'));var fs=require('fs');var fs_extra=require(_0x4d2b('0x7'));var _=require(_0x4d2b('0x8'));var squel=require('squel');var crypto=require(_0x4d2b('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d2b('0xa'));var querystring=require(_0x4d2b('0xb'));var Papa=require('papaparse');var Redis=require(_0x4d2b('0xc'));var authService=require(_0x4d2b('0xd'));var qs=require(_0x4d2b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d2b('0xf'));var logger=require('../../config/logger')(_0x4d2b('0x10'));var utils=require(_0x4d2b('0x11'));var config=require(_0x4d2b('0x12'));var licenseUtil=require(_0x4d2b('0x13'));var db=require(_0x4d2b('0x14'))['db'];function respondWithStatusCode(_0x1ff064,_0x769e7c){_0x769e7c=_0x769e7c||0xcc;return function(_0x4e4066){if(_0x4e4066){return _0x1ff064[_0x4d2b('0x15')](_0x769e7c);}return _0x1ff064['status'](_0x769e7c)[_0x4d2b('0x16')]();};}function respondWithResult(_0x49e23d,_0x2a1959){_0x2a1959=_0x2a1959||0xc8;return function(_0x26d807){if(_0x26d807){return _0x49e23d[_0x4d2b('0x17')](_0x2a1959)[_0x4d2b('0x18')](_0x26d807);}};}function respondWithFilteredResult(_0x139ffb,_0x549100){return function(_0x26d579){if(_0x26d579){var _0x145e0b=typeof _0x549100[_0x4d2b('0x19')]==='undefined'&&typeof _0x549100[_0x4d2b('0x1a')]===_0x4d2b('0x1b');var _0x3577e2=_0x26d579[_0x4d2b('0x1c')];var _0x3bb94c=_0x145e0b?0x0:_0x549100[_0x4d2b('0x19')];var _0xaeb5b7=_0x145e0b?_0x26d579[_0x4d2b('0x1c')]:_0x549100[_0x4d2b('0x19')]+_0x549100['limit'];var _0x53db38;if(_0xaeb5b7>=_0x3577e2){_0xaeb5b7=_0x3577e2;_0x53db38=0xc8;}else{_0x53db38=0xce;}_0x139ffb[_0x4d2b('0x17')](_0x53db38);return _0x139ffb[_0x4d2b('0x1d')](_0x4d2b('0x1e'),_0x3bb94c+'-'+_0xaeb5b7+'/'+_0x3577e2)[_0x4d2b('0x18')](_0x26d579);}return null;};}function patchUpdates(_0x5affbe){return function(_0x349b14){try{jsonpatch['apply'](_0x349b14,_0x5affbe,!![]);}catch(_0x5aff74){return BPromise[_0x4d2b('0x1f')](_0x5aff74);}return _0x349b14[_0x4d2b('0x20')]();};}function saveUpdates(_0x2bb403,_0x543857){return function(_0x486a41){if(_0x486a41){return _0x486a41['update'](_0x2bb403)[_0x4d2b('0x21')](function(_0x3b4041){return _0x3b4041;});}return null;};}function removeEntity(_0x2121f0,_0x586330){return function(_0x37ea6d){if(_0x37ea6d){return _0x37ea6d[_0x4d2b('0x22')]()['then'](function(){_0x2121f0[_0x4d2b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7c85,_0x1f3892){return function(_0x3383c2){if(!_0x3383c2){_0x9d7c85[_0x4d2b('0x15')](0x194);}return _0x3383c2;};}function handleError(_0xf0cd5,_0x5f55e6){_0x5f55e6=_0x5f55e6||0x1f4;return function(_0x1cd05d){logger[_0x4d2b('0x23')](_0x1cd05d['stack']);if(_0x1cd05d[_0x4d2b('0x24')]){delete _0x1cd05d[_0x4d2b('0x24')];}_0xf0cd5[_0x4d2b('0x17')](_0x5f55e6)[_0x4d2b('0x25')](_0x1cd05d);};}exports[_0x4d2b('0x26')]=function(_0x2f9858,_0x261af1){var _0x2335e5={},_0x3006f6={},_0x158441={'count':0x0,'rows':[]};var _0x478e33=_['map'](db['VoiceMailMessage'][_0x4d2b('0x27')],function(_0x452625){return{'name':_0x452625[_0x4d2b('0x28')],'type':_0x452625[_0x4d2b('0x29')][_0x4d2b('0x2a')]};});_0x3006f6[_0x4d2b('0x2b')]=_[_0x4d2b('0x2c')](_[_0x4d2b('0x2d')](_0x478e33,_0x4d2b('0x24')),[_0x4d2b('0x24')]);_0x3006f6[_0x4d2b('0x2e')]=_[_0x4d2b('0x2f')](_0x2f9858[_0x4d2b('0x2e')]);_0x3006f6[_0x4d2b('0x30')]=_[_0x4d2b('0x31')](_0x3006f6[_0x4d2b('0x2b')],_0x3006f6['query']);_0x2335e5['attributes']=_[_0x4d2b('0x31')](_0x3006f6[_0x4d2b('0x2b')],qs['fields'](_0x2f9858[_0x4d2b('0x2e')][_0x4d2b('0x32')]));_0x2335e5['attributes']=_0x2335e5[_0x4d2b('0x33')][_0x4d2b('0x34')]?_0x2335e5[_0x4d2b('0x33')]:_0x3006f6[_0x4d2b('0x2b')];if(!_0x2f9858[_0x4d2b('0x2e')][_0x4d2b('0x35')]('nolimit')){_0x2335e5[_0x4d2b('0x1a')]=qs[_0x4d2b('0x1a')](_0x2f9858[_0x4d2b('0x2e')][_0x4d2b('0x1a')]);_0x2335e5[_0x4d2b('0x19')]=qs['offset'](_0x2f9858[_0x4d2b('0x2e')][_0x4d2b('0x19')]);}_0x2335e5['order']=qs[_0x4d2b('0x36')](_0x2f9858[_0x4d2b('0x2e')][_0x4d2b('0x36')]);_0x2335e5['where']=qs[_0x4d2b('0x30')](_[_0x4d2b('0x37')](_0x2f9858['query'],_0x3006f6[_0x4d2b('0x30')]),_0x478e33);if(_0x2f9858[_0x4d2b('0x2e')][_0x4d2b('0x38')]){_0x2335e5['where']=_[_0x4d2b('0x39')](_0x2335e5[_0x4d2b('0x3a')],{'$or':_[_0x4d2b('0x2d')](_0x478e33,function(_0x32a691){if(_0x32a691['type']!=='VIRTUAL'){var _0x560dbf={};_0x560dbf[_0x32a691[_0x4d2b('0x24')]]={'$like':'%'+_0x2f9858[_0x4d2b('0x2e')][_0x4d2b('0x38')]+'%'};return _0x560dbf;}})});}_0x2335e5=_['merge']({},_0x2335e5,_0x2f9858['options']);var _0x2eb0f7={'where':_0x2335e5['where']};return db[_0x4d2b('0x3b')]['count'](_0x2eb0f7)[_0x4d2b('0x21')](function(_0x38464e){_0x158441[_0x4d2b('0x1c')]=_0x38464e;if(_0x2f9858[_0x4d2b('0x2e')][_0x4d2b('0x3c')]){_0x2335e5['include']=[{'all':!![]}];}return db[_0x4d2b('0x3b')]['findAll'](_0x2335e5);})[_0x4d2b('0x21')](function(_0x3d03c8){_0x158441[_0x4d2b('0x3d')]=_0x3d03c8;return _0x158441;})['then'](respondWithFilteredResult(_0x261af1,_0x2335e5))[_0x4d2b('0x3e')](handleError(_0x261af1,null));};exports[_0x4d2b('0x3f')]=function(_0x3867cd,_0x49d622){var _0x4587be={'raw':!![],'where':{'id':_0x3867cd['params']['id']}},_0x5bd108={};_0x5bd108['model']=_[_0x4d2b('0x2f')](db['VoiceMailMessage'][_0x4d2b('0x27')]);_0x5bd108[_0x4d2b('0x2e')]=_[_0x4d2b('0x2f')](_0x3867cd[_0x4d2b('0x2e')]);_0x5bd108[_0x4d2b('0x30')]=_[_0x4d2b('0x31')](_0x5bd108[_0x4d2b('0x2b')],_0x5bd108['query']);_0x4587be[_0x4d2b('0x33')]=_['intersection'](_0x5bd108[_0x4d2b('0x2b')],qs[_0x4d2b('0x32')](_0x3867cd['query']['fields']));_0x4587be['attributes']=_0x4587be[_0x4d2b('0x33')][_0x4d2b('0x34')]?_0x4587be[_0x4d2b('0x33')]:_0x5bd108[_0x4d2b('0x2b')];if(_0x3867cd['query'][_0x4d2b('0x3c')]){_0x4587be[_0x4d2b('0x40')]=[{'all':!![]}];}_0x4587be=_[_0x4d2b('0x39')]({},_0x4587be,_0x3867cd[_0x4d2b('0x41')]);return db[_0x4d2b('0x3b')][_0x4d2b('0x42')](_0x4587be)['then'](handleEntityNotFound(_0x49d622,null))[_0x4d2b('0x21')](respondWithResult(_0x49d622,null))[_0x4d2b('0x3e')](handleError(_0x49d622,null));};exports[_0x4d2b('0x43')]=function(_0x14dcc4,_0x1bf82a){return db['VoiceMailMessage'][_0x4d2b('0x43')](_0x14dcc4[_0x4d2b('0x44')],{})[_0x4d2b('0x21')](respondWithResult(_0x1bf82a,0xc9))[_0x4d2b('0x3e')](handleError(_0x1bf82a,null));};exports['update']=function(_0x38e330,_0x5a6473){if(_0x38e330['body']['id']){delete _0x38e330[_0x4d2b('0x44')]['id'];}return db['VoiceMailMessage'][_0x4d2b('0x42')]({'where':{'id':_0x38e330[_0x4d2b('0x45')]['id']}})[_0x4d2b('0x21')](handleEntityNotFound(_0x5a6473,null))['then'](saveUpdates(_0x38e330[_0x4d2b('0x44')],null))['then'](respondWithResult(_0x5a6473,null))[_0x4d2b('0x3e')](handleError(_0x5a6473,null));};exports[_0x4d2b('0x22')]=function(_0x4a262c,_0x20c01c){return db[_0x4d2b('0x3b')][_0x4d2b('0x42')]({'where':{'id':_0x4a262c[_0x4d2b('0x45')]['id']}})[_0x4d2b('0x21')](handleEntityNotFound(_0x20c01c,null))['then'](removeEntity(_0x20c01c,null))[_0x4d2b('0x3e')](handleError(_0x20c01c,null));};exports[_0x4d2b('0x46')]=function(_0x435bea,_0x23f02d,_0x30b028){return db['VoiceMailMessage'][_0x4d2b('0x42')]({'where':{'id':_0x435bea[_0x4d2b('0x45')]['id']},'attributes':['id',_0x4d2b('0x47'),_0x4d2b('0x48')]})['then'](handleEntityNotFound(_0x23f02d,null))[_0x4d2b('0x21')](function(_0xd8e46d){if(_0xd8e46d){if(!_0xd8e46d[_0x4d2b('0x47')]){throw new db[(_0x4d2b('0x49'))][(_0x4d2b('0x4a'))](_0x4d2b('0x4b'));}var _0x49e230={'Content-Type':_0x4d2b('0x4c'),'Content-Disposition':_0x4d2b('0x4d')};if(_0xd8e46d[_0x4d2b('0x48')]){_0x49e230[_0x4d2b('0x4e')]='attachment;\x20filename=\x22'+_0xd8e46d[_0x4d2b('0x48')]+_0x4d2b('0x4f');}_0x23f02d['set'](_0x49e230);return _0x23f02d[_0x4d2b('0x25')](new Buffer(_0xd8e46d[_0x4d2b('0x47')]));}})['catch'](handleError(_0x23f02d,null));};
\ No newline at end of file
index 4441b6a..c2d4ae3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf43d=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0xf43d,0x169));var _0xdf43=function(_0x235b6c,_0x3bcf43){_0x235b6c=_0x235b6c-0x0;var _0x374d67=_0xf43d[_0x235b6c];return _0x374d67;};'use strict';var _=require(_0xdf43('0x0'));var util=require(_0xdf43('0x1'));var logger=require(_0xdf43('0x2'))(_0xdf43('0x3'));var moment=require(_0xdf43('0x4'));var BPromise=require(_0xdf43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf43('0x6'));var rimraf=require(_0xdf43('0x7'));var config=require(_0xdf43('0x8'));var attributes=require(_0xdf43('0x9'));module[_0xdf43('0xa')]=function(_0x6b9a2e,_0x3429b9){return _0x6b9a2e[_0xdf43('0xb')](_0xdf43('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0xdf43('0xd')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xfcd9=['define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xfcd9,0x177));var _0x9fcd=function(_0x11c221,_0x65c6a5){_0x11c221=_0x11c221-0x0;var _0x26deef=_0xfcd9[_0x11c221];return _0x26deef;};'use strict';var _=require(_0x9fcd('0x0'));var util=require(_0x9fcd('0x1'));var logger=require(_0x9fcd('0x2'))(_0x9fcd('0x3'));var moment=require(_0x9fcd('0x4'));var BPromise=require(_0x9fcd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fcd('0x6'));var rimraf=require(_0x9fcd('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x9fcd('0x8')]=function(_0x195514,_0xfaff3e){return _0x195514[_0x9fcd('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x9fcd('0xa'),'paranoid':![],'indexes':[{'name':_0x9fcd('0xb'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
index 1a810f3..2c03848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ca=['../../config/utils','rpc','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','../../mysqldb'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x02ca,0x18c));var _0xa02c=function(_0x3f8a02,_0x1223e4){_0x3f8a02=_0x3f8a02-0x0;var _0x2cf8bb=_0x02ca[_0x3f8a02];return _0x2cf8bb;};'use strict';var _=require(_0xa02c('0x0'));var util=require('util');var moment=require(_0xa02c('0x1'));var BPromise=require(_0xa02c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa02c('0x3'))['db'];var utils=require(_0xa02c('0x4'));var logger=require('../../config/logger')(_0xa02c('0x5'));var config=require('../../config/environment');var jayson=require(_0xa02c('0x6'));var client=jayson[_0xa02c('0x7')][_0xa02c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2131d3,_0xbfb216,_0xb8b9c7){return new BPromise(function(_0x48ee76,_0x4f0530){return client[_0xa02c('0x9')](_0x2131d3,_0xb8b9c7)['then'](function(_0x405c96){logger[_0xa02c('0xa')](_0xa02c('0xb'),_0xbfb216,_0xa02c('0xc'));logger[_0xa02c('0xd')](_0xa02c('0xe'),_0xbfb216,_0xa02c('0xc'),JSON[_0xa02c('0xf')](_0x405c96));if(_0x405c96['error']){if(_0x405c96['error'][_0xa02c('0x10')]===0x1f4){logger['error'](_0xa02c('0xb'),_0xbfb216,_0x405c96[_0xa02c('0x11')]['message']);return _0x4f0530(_0x405c96['error'][_0xa02c('0x12')]);}logger[_0xa02c('0x11')](_0xa02c('0xb'),_0xbfb216,_0x405c96[_0xa02c('0x11')]['message']);return _0x48ee76(_0x405c96[_0xa02c('0x11')][_0xa02c('0x12')]);}else{logger[_0xa02c('0xa')](_0xa02c('0xb'),_0xbfb216,'request\x20sent');_0x48ee76(_0x405c96[_0xa02c('0x13')][_0xa02c('0x12')]);}})['catch'](function(_0x1a0dc9){logger['error'](_0xa02c('0xb'),_0xbfb216,_0x1a0dc9);_0x4f0530(_0x1a0dc9);});});}
\ No newline at end of file
+var _0xd3ce=['error','code','VoiceMailMessage,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15b5d4,_0x5556b7){var _0x4c713d=function(_0x42dbc5){while(--_0x42dbc5){_0x15b5d4['push'](_0x15b5d4['shift']());}};_0x4c713d(++_0x5556b7);}(_0xd3ce,0xd6));var _0xed3c=function(_0x3e34a1,_0x7aa905){_0x3e34a1=_0x3e34a1-0x0;var _0x3dc916=_0xd3ce[_0x3e34a1];return _0x3dc916;};'use strict';var _=require('lodash');var util=require(_0xed3c('0x0'));var moment=require(_0xed3c('0x1'));var BPromise=require('bluebird');var rs=require(_0xed3c('0x2'));var fs=require('fs');var Redis=require(_0xed3c('0x3'));var db=require(_0xed3c('0x4'))['db'];var utils=require(_0xed3c('0x5'));var logger=require('../../config/logger')(_0xed3c('0x6'));var config=require(_0xed3c('0x7'));var jayson=require(_0xed3c('0x8'));var client=jayson['client'][_0xed3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e21fe,_0x3eaff0,_0x5ddb5f){return new BPromise(function(_0x2d48ac,_0x1da3c0){return client[_0xed3c('0xa')](_0x3e21fe,_0x5ddb5f)[_0xed3c('0xb')](function(_0x3f4100){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x3eaff0,_0xed3c('0xc'));logger[_0xed3c('0xd')](_0xed3c('0xe'),_0x3eaff0,_0xed3c('0xc'),JSON[_0xed3c('0xf')](_0x3f4100));if(_0x3f4100[_0xed3c('0x10')]){if(_0x3f4100[_0xed3c('0x10')][_0xed3c('0x11')]===0x1f4){logger[_0xed3c('0x10')](_0xed3c('0x12'),_0x3eaff0,_0x3f4100[_0xed3c('0x10')]['message']);return _0x1da3c0(_0x3f4100[_0xed3c('0x10')][_0xed3c('0x13')]);}logger[_0xed3c('0x10')](_0xed3c('0x12'),_0x3eaff0,_0x3f4100[_0xed3c('0x10')][_0xed3c('0x13')]);return _0x2d48ac(_0x3f4100['error'][_0xed3c('0x13')]);}else{logger[_0xed3c('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x3eaff0,_0xed3c('0xc'));_0x2d48ac(_0x3f4100[_0xed3c('0x15')]['message']);}})[_0xed3c('0x16')](function(_0x2b28d4){logger[_0xed3c('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x3eaff0,_0x2b28d4);_0x1da3c0(_0x2b28d4);});});}
\ No newline at end of file
index cb8e580..ff13844 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e63=['fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','create','addSound','update','delete','removeSound','exports','multer','path','connect-timeout','express','Router'];(function(_0x1260cf,_0x268039){var _0x59af86=function(_0x211984){while(--_0x211984){_0x1260cf['push'](_0x1260cf['shift']());}};_0x59af86(++_0x268039);}(_0x6e63,0x1f3));var _0x36e6=function(_0x5d25d1,_0x3e7a97){_0x5d25d1=_0x5d25d1-0x0;var _0x5695cb=_0x6e63[_0x5d25d1];return _0x5695cb;};'use strict';var multer=require(_0x36e6('0x0'));var util=require('util');var path=require(_0x36e6('0x1'));var timeout=require(_0x36e6('0x2'));var express=require(_0x36e6('0x3'));var router=express[_0x36e6('0x4')]();var fs_extra=require(_0x36e6('0x5'));var auth=require(_0x36e6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x36e6('0x7'));var controller=require(_0x36e6('0x8'));router[_0x36e6('0x9')]('/',auth[_0x36e6('0xa')](),controller[_0x36e6('0xb')]);router['get'](_0x36e6('0xc'),auth[_0x36e6('0xa')](),controller[_0x36e6('0xd')]);router[_0x36e6('0x9')](_0x36e6('0xe'),auth[_0x36e6('0xa')](),controller['getSounds']);router['post']('/',auth[_0x36e6('0xa')](),controller[_0x36e6('0xf')]);router['post']('/:id/sounds',auth[_0x36e6('0xa')](),controller[_0x36e6('0x10')]);router['put'](_0x36e6('0xc'),auth[_0x36e6('0xa')](),controller[_0x36e6('0x11')]);router[_0x36e6('0x12')](_0x36e6('0xc'),auth[_0x36e6('0xa')](),controller['destroy']);router[_0x36e6('0x12')]('/:id/sounds/:id2',auth[_0x36e6('0xa')](),controller[_0x36e6('0x13')]);module[_0x36e6('0x14')]=router;
\ No newline at end of file
+var _0xe753=['index','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0xe753,0xd5));var _0x3e75=function(_0x4107c1,_0x3adb65){_0x4107c1=_0x4107c1-0x0;var _0x588e29=_0xe753[_0x4107c1];return _0x588e29;};'use strict';var multer=require(_0x3e75('0x0'));var util=require(_0x3e75('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3e75('0x2'));var router=express[_0x3e75('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3e75('0x4'));var config=require(_0x3e75('0x5'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x3e75('0x6')](),controller[_0x3e75('0x7')]);router[_0x3e75('0x8')](_0x3e75('0x9'),auth[_0x3e75('0x6')](),controller[_0x3e75('0xa')]);router[_0x3e75('0x8')](_0x3e75('0xb'),auth[_0x3e75('0x6')](),controller[_0x3e75('0xc')]);router[_0x3e75('0xd')]('/',auth[_0x3e75('0x6')](),controller[_0x3e75('0xe')]);router['post']('/:id/sounds',auth[_0x3e75('0x6')](),controller[_0x3e75('0xf')]);router[_0x3e75('0x10')](_0x3e75('0x9'),auth['isAuthenticated'](),controller[_0x3e75('0x11')]);router[_0x3e75('0x12')](_0x3e75('0x9'),auth[_0x3e75('0x6')](),controller['destroy']);router['delete']('/:id/sounds/:id2',auth[_0x3e75('0x6')](),controller['removeSound']);module[_0x3e75('0x13')]=router;
\ No newline at end of file
index 387d5ec..cb550e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb32=['mp3nb','quietmp3nb','quietmp3','mp3','alpha','sequelize','STRING','name','ENUM','custom','files'];(function(_0x3329d0,_0x56826c){var _0x522bb2=function(_0x223a32){while(--_0x223a32){_0x3329d0['push'](_0x3329d0['shift']());}};_0x522bb2(++_0x56826c);}(_0xeb32,0x1bd));var _0x2eb3=function(_0x3a3a65,_0x12a35a){_0x3a3a65=_0x3a3a65-0x0;var _0x1f78e7=_0xeb32[_0x3a3a65];return _0x1f78e7;};'use strict';var Sequelize=require(_0x2eb3('0x0'));module['exports']={'name':{'type':Sequelize[_0x2eb3('0x1')],'allowNull':![],'unique':_0x2eb3('0x2')},'mode':{'type':Sequelize[_0x2eb3('0x3')](_0x2eb3('0x4'),_0x2eb3('0x5'),_0x2eb3('0x6'),_0x2eb3('0x7'),_0x2eb3('0x8'),_0x2eb3('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x2eb3('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2eb3('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2eb3('0x1')],'allowNull':!![],'defaultValue':_0x2eb3('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf9ac=['sequelize','exports','STRING','name','ENUM','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x24a7bc,_0x4ab3cd){var _0xf213f3=function(_0x115eef){while(--_0x115eef){_0x24a7bc['push'](_0x24a7bc['shift']());}};_0xf213f3(++_0x4ab3cd);}(_0xf9ac,0x82));var _0xcf9a=function(_0x4c0945,_0x339ef9){_0x4c0945=_0x4c0945-0x0;var _0x1d8012=_0xf9ac[_0x4c0945];return _0x1d8012;};'use strict';var Sequelize=require(_0xcf9a('0x0'));module[_0xcf9a('0x1')]={'name':{'type':Sequelize[_0xcf9a('0x2')],'allowNull':![],'unique':_0xcf9a('0x3')},'mode':{'type':Sequelize[_0xcf9a('0x4')]('custom',_0xcf9a('0x5'),_0xcf9a('0x6'),_0xcf9a('0x7'),_0xcf9a('0x8'),_0xcf9a('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xcf9a('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcf9a('0xa')},'format':{'type':Sequelize[_0xcf9a('0x2')],'allowNull':!![]},'stamp':{'type':_0xcf9a('0xb')},'defaultEntry':{'type':Sequelize[_0xcf9a('0xc')],'defaultValue':0x0}};
\ No newline at end of file
index 31bb4ac..728075e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb331=['server/files/moh','mkdirSync','0777','user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','Sequelize','message','removeSound','id2','ValidationError','getSounds','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','get','MusicOnHolds','stack','name','index','map','VoiceMusicOnHold','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','transaction','mode','files','directory','join','root'];(function(_0x5a03da,_0x232a30){var _0x30a051=function(_0x2effe1){while(--_0x2effe1){_0x5a03da['push'](_0x5a03da['shift']());}};_0x30a051(++_0x232a30);}(_0xb331,0xff));var _0x1b33=function(_0x4536f8,_0x13401c){_0x4536f8=_0x4536f8-0x0;var _0x59ad49=_0xb331[_0x4536f8];return _0x59ad49;};'use strict';var emlformat=require(_0x1b33('0x0'));var rimraf=require(_0x1b33('0x1'));var zipdir=require(_0x1b33('0x2'));var jsonpatch=require(_0x1b33('0x3'));var rp=require(_0x1b33('0x4'));var moment=require(_0x1b33('0x5'));var BPromise=require(_0x1b33('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1b33('0x7'));var sox=require('sox');var csv=require(_0x1b33('0x8'));var ejs=require(_0x1b33('0x9'));var fs=require('fs');var fs_extra=require(_0x1b33('0xa'));var _=require(_0x1b33('0xb'));var squel=require(_0x1b33('0xc'));var crypto=require(_0x1b33('0xd'));var jsforce=require(_0x1b33('0xe'));var deskjs=require(_0x1b33('0xf'));var toCsv=require(_0x1b33('0x8'));var querystring=require(_0x1b33('0x10'));var Papa=require(_0x1b33('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b33('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b33('0x13'));var logger=require('../../config/logger')(_0x1b33('0x14'));var utils=require(_0x1b33('0x15'));var config=require(_0x1b33('0x16'));var licenseUtil=require(_0x1b33('0x17'));var db=require(_0x1b33('0x18'))['db'];function respondWithStatusCode(_0x92cd21,_0xab2e7e){_0xab2e7e=_0xab2e7e||0xcc;return function(_0x273c55){if(_0x273c55){return _0x92cd21['sendStatus'](_0xab2e7e);}return _0x92cd21[_0x1b33('0x19')](_0xab2e7e)[_0x1b33('0x1a')]();};}function respondWithResult(_0x3fe2e4,_0x42f7ef){_0x42f7ef=_0x42f7ef||0xc8;return function(_0x3bb70d){if(_0x3bb70d){return _0x3fe2e4['status'](_0x42f7ef)[_0x1b33('0x1b')](_0x3bb70d);}};}function respondWithFilteredResult(_0x248fa8,_0x4f66f2){return function(_0x5aa9c2){if(_0x5aa9c2){var _0x1c8d45=typeof _0x4f66f2[_0x1b33('0x1c')]===_0x1b33('0x1d')&&typeof _0x4f66f2[_0x1b33('0x1e')]===_0x1b33('0x1d');var _0x6c6370=_0x5aa9c2[_0x1b33('0x1f')];var _0x5d360c=_0x1c8d45?0x0:_0x4f66f2[_0x1b33('0x1c')];var _0x42c632=_0x1c8d45?_0x5aa9c2[_0x1b33('0x1f')]:_0x4f66f2[_0x1b33('0x1c')]+_0x4f66f2[_0x1b33('0x1e')];var _0xbbdf95;if(_0x42c632>=_0x6c6370){_0x42c632=_0x6c6370;_0xbbdf95=0xc8;}else{_0xbbdf95=0xce;}_0x248fa8[_0x1b33('0x19')](_0xbbdf95);return _0x248fa8['set'](_0x1b33('0x20'),_0x5d360c+'-'+_0x42c632+'/'+_0x6c6370)[_0x1b33('0x1b')](_0x5aa9c2);}return null;};}function patchUpdates(_0x2f9a60){return function(_0x4d6bb9){try{jsonpatch[_0x1b33('0x21')](_0x4d6bb9,_0x2f9a60,!![]);}catch(_0x293b23){return BPromise[_0x1b33('0x22')](_0x293b23);}return _0x4d6bb9['save']();};}function saveUpdates(_0x52cb0b,_0x57cd8){return function(_0x5c0409){if(_0x5c0409){return _0x5c0409['update'](_0x52cb0b)[_0x1b33('0x23')](function(_0x2b0b98){return _0x2b0b98;});}return null;};}function removeEntity(_0x3307ad,_0x1324d7){return function(_0x524cda){if(_0x524cda){return _0x524cda[_0x1b33('0x24')]()['then'](function(){var _0x561840=_0x524cda[_0x1b33('0x25')]({'plain':!![]});var _0x4a1617=_0x1b33('0x26');return db['UserProfileResource'][_0x1b33('0x24')]({'where':{'type':_0x4a1617,'resourceId':_0x561840['id']}})[_0x1b33('0x23')](function(){return _0x524cda;});})[_0x1b33('0x23')](function(){_0x3307ad[_0x1b33('0x19')](0xcc)[_0x1b33('0x1a')]();});}};}function handleEntityNotFound(_0x377dda,_0x31ec1b){return function(_0x22d6f7){if(!_0x22d6f7){_0x377dda['sendStatus'](0x194);}return _0x22d6f7;};}function handleError(_0x1a205d,_0x438323){_0x438323=_0x438323||0x1f4;return function(_0x380028){logger['error'](_0x380028[_0x1b33('0x27')]);if(_0x380028[_0x1b33('0x28')]){delete _0x380028[_0x1b33('0x28')];}_0x1a205d[_0x1b33('0x19')](_0x438323)['send'](_0x380028);};}exports[_0x1b33('0x29')]=function(_0xcc3487,_0x4093fd){var _0x34a8d8={},_0x5efc7b={},_0x2e8db8={'count':0x0,'rows':[]};var _0x4405e7=_[_0x1b33('0x2a')](db[_0x1b33('0x2b')]['rawAttributes'],function(_0x1e290b){return{'name':_0x1e290b['fieldName'],'type':_0x1e290b['type']['key']};});_0x5efc7b[_0x1b33('0x2c')]=_['map'](_0x4405e7,_0x1b33('0x28'));_0x5efc7b[_0x1b33('0x2d')]=_[_0x1b33('0x2e')](_0xcc3487['query']);_0x5efc7b['filters']=_[_0x1b33('0x2f')](_0x5efc7b[_0x1b33('0x2c')],_0x5efc7b[_0x1b33('0x2d')]);_0x34a8d8[_0x1b33('0x30')]=_['intersection'](_0x5efc7b[_0x1b33('0x2c')],qs[_0x1b33('0x31')](_0xcc3487[_0x1b33('0x2d')]['fields']));_0x34a8d8['attributes']=_0x34a8d8['attributes'][_0x1b33('0x32')]?_0x34a8d8[_0x1b33('0x30')]:_0x5efc7b[_0x1b33('0x2c')];if(!_0xcc3487[_0x1b33('0x2d')][_0x1b33('0x33')](_0x1b33('0x34'))){_0x34a8d8[_0x1b33('0x1e')]=qs[_0x1b33('0x1e')](_0xcc3487[_0x1b33('0x2d')][_0x1b33('0x1e')]);_0x34a8d8[_0x1b33('0x1c')]=qs[_0x1b33('0x1c')](_0xcc3487[_0x1b33('0x2d')][_0x1b33('0x1c')]);}_0x34a8d8[_0x1b33('0x35')]=qs[_0x1b33('0x36')](_0xcc3487[_0x1b33('0x2d')][_0x1b33('0x36')]);delete _0xcc3487[_0x1b33('0x2d')]['sort'];_0x34a8d8[_0x1b33('0x37')]=qs['filters'](_[_0x1b33('0x38')](_0xcc3487[_0x1b33('0x2d')],_0x5efc7b[_0x1b33('0x39')]),_0x4405e7);if(_0xcc3487[_0x1b33('0x2d')][_0x1b33('0x3a')]){_0x34a8d8['where']=_[_0x1b33('0x3b')](_0x34a8d8['where'],{'$or':_[_0x1b33('0x2a')](_0x4405e7,function(_0x2154e4){if(_0x2154e4[_0x1b33('0x3c')]!=='VIRTUAL'){var _0x598be2={};_0x598be2[_0x2154e4['name']]={'$like':'%'+_0xcc3487[_0x1b33('0x2d')][_0x1b33('0x3a')]+'%'};return _0x598be2;}})});}_0x34a8d8=_[_0x1b33('0x3b')]({},_0x34a8d8,_0xcc3487[_0x1b33('0x3d')]);var _0x400981={'where':_0x34a8d8[_0x1b33('0x37')]};return db[_0x1b33('0x2b')]['count'](_0x400981)[_0x1b33('0x23')](function(_0x4ced02){_0x2e8db8[_0x1b33('0x1f')]=_0x4ced02;if(_0xcc3487[_0x1b33('0x2d')][_0x1b33('0x3e')]){_0x34a8d8[_0x1b33('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x1b33('0x40')](_0x34a8d8);})['then'](function(_0x49745e){_0x2e8db8[_0x1b33('0x41')]=_0x49745e;return _0x2e8db8;})[_0x1b33('0x23')](respondWithFilteredResult(_0x4093fd,_0x34a8d8))[_0x1b33('0x42')](handleError(_0x4093fd,null));};exports[_0x1b33('0x43')]=function(_0xecb507,_0x41a06a){var _0x160579={'raw':![],'where':{'id':_0xecb507[_0x1b33('0x44')]['id']}},_0x15791e={};_0x15791e['model']=_[_0x1b33('0x2e')](db[_0x1b33('0x2b')]['rawAttributes']);_0x15791e['query']=_[_0x1b33('0x2e')](_0xecb507[_0x1b33('0x2d')]);_0x15791e[_0x1b33('0x39')]=_['intersection'](_0x15791e['model'],_0x15791e[_0x1b33('0x2d')]);_0x160579[_0x1b33('0x30')]=_[_0x1b33('0x2f')](_0x15791e[_0x1b33('0x2c')],qs[_0x1b33('0x31')](_0xecb507['query'][_0x1b33('0x31')]));_0x160579['attributes']=_0x160579[_0x1b33('0x30')]['length']?_0x160579[_0x1b33('0x30')]:_0x15791e['model'];if(_0xecb507['query'][_0x1b33('0x3e')]){_0x160579[_0x1b33('0x3f')]=[{'all':!![]}];}_0x160579=_[_0x1b33('0x3b')]({},_0x160579,_0xecb507['options']);return db[_0x1b33('0x2b')][_0x1b33('0x45')](_0x160579)[_0x1b33('0x23')](handleEntityNotFound(_0x41a06a,null))[_0x1b33('0x23')](respondWithResult(_0x41a06a,null))[_0x1b33('0x42')](handleError(_0x41a06a,null));};exports['update']=function(_0x4e22d9,_0x3b8a3d){if(_0x4e22d9[_0x1b33('0x46')]['id']){delete _0x4e22d9['body']['id'];}return db[_0x1b33('0x2b')][_0x1b33('0x45')]({'where':{'id':_0x4e22d9['params']['id']}})['then'](handleEntityNotFound(_0x3b8a3d,null))['then'](saveUpdates(_0x4e22d9[_0x1b33('0x46')],null))[_0x1b33('0x23')](respondWithResult(_0x3b8a3d,null))[_0x1b33('0x42')](handleError(_0x3b8a3d,null));};exports[_0x1b33('0x47')]=function(_0x5e0e91,_0x285d96,_0x32456d){return db['sequelize'][_0x1b33('0x48')](function(_0x5a027f){if(_0x5e0e91['body'][_0x1b33('0x49')]===_0x1b33('0x4a')){_0x5e0e91['body'][_0x1b33('0x4b')]=path[_0x1b33('0x4c')](config[_0x1b33('0x4d')],_0x1b33('0x4e'),_0x5e0e91['body'][_0x1b33('0x28')]);}return db[_0x1b33('0x2b')][_0x1b33('0x47')](_0x5e0e91[_0x1b33('0x46')],{'transaction':_0x5a027f})[_0x1b33('0x23')](function(_0x2322da){if(_0x5e0e91[_0x1b33('0x46')]['mode']==='files'){fs[_0x1b33('0x4f')](_0x2322da['directory'],parseInt(_0x1b33('0x50'),0x8));}var _0x37edf0=_0x5e0e91[_0x1b33('0x51')]['get']({'plain':!![]});if(!_0x37edf0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37edf0[_0x1b33('0x52')]===_0x1b33('0x51')){var _0x2a3cf9=_0x2322da[_0x1b33('0x25')]({'plain':!![]});return db[_0x1b33('0x53')]['find']({'where':{'name':_0x1b33('0x26'),'userProfileId':_0x37edf0['userProfileId']},'raw':!![]})[_0x1b33('0x23')](function(_0xf1fe13){if(_0xf1fe13&&_0xf1fe13[_0x1b33('0x54')]===0x0){return db[_0x1b33('0x55')]['create']({'name':_0x2a3cf9[_0x1b33('0x28')],'resourceId':_0x2a3cf9['id'],'type':_0xf1fe13[_0x1b33('0x28')],'sectionId':_0xf1fe13['id']},{})['then'](function(){return _0x2322da;});}else{return _0x2322da;}})[_0x1b33('0x42')](function(_0x5c4715){logger[_0x1b33('0x56')](_0x1b33('0x57'),_0x5c4715);});}return _0x2322da;});})[_0x1b33('0x23')](respondWithResult(_0x285d96,0xc9))[_0x1b33('0x42')](handleError(_0x285d96,null));};exports['destroy']=function(_0x2097a4,_0x3c54c0,_0x2fd425){var _0x23fe81;return db[_0x1b33('0x2b')][_0x1b33('0x45')]({'where':{'id':_0x2097a4[_0x1b33('0x44')]['id']}})['then'](function(_0x5db2f6){if(_0x5db2f6){return db[_0x1b33('0x58')][_0x1b33('0x48')](function(_0x3c0356){return _0x5db2f6['destroy']({'transaction':_0x3c0356,'raw':!![]})[_0x1b33('0x23')](function(_0x4d6d00){if(_0x4d6d00['directory']){fs[_0x1b33('0x59')](_0x4d6d00['directory'])[_0x1b33('0x5a')](function(_0x4e96a1){fs[_0x1b33('0x5b')](path[_0x1b33('0x4c')](_0x4d6d00[_0x1b33('0x4b')],_0x4e96a1));});fs[_0x1b33('0x5c')](_0x4d6d00[_0x1b33('0x4b')]);}return _0x4d6d00;});})[_0x1b33('0x42')](function(_0x2edac1){throw new db['Sequelize']['ValidationError'](_0x2edac1['message']);});}})[_0x1b33('0x23')](handleEntityNotFound(_0x3c54c0,null))[_0x1b33('0x23')](removeEntity(_0x3c54c0,null))['catch'](handleError(_0x3c54c0,null));};exports[_0x1b33('0x5d')]=function(_0x1cb0cc,_0x5e456e,_0x284277){return db['sequelize'][_0x1b33('0x48')](function(_0x3992f9){var _0x31a07a;return db['VoiceMusicOnHold'][_0x1b33('0x45')]({'where':{'id':_0x1cb0cc[_0x1b33('0x44')]['id']}})[_0x1b33('0x23')](function(_0x243da4){if(_0x243da4){_0x31a07a=_0x243da4;return _0x243da4[_0x1b33('0x5d')](_0x1cb0cc['body']['id'],{'transaction':_0x3992f9});}})[_0x1b33('0x23')](function(_0x2aa037){if(_0x2aa037){return db[_0x1b33('0x5e')][_0x1b33('0x5f')]({'where':{'id':_0x1cb0cc[_0x1b33('0x46')]['id']},'attributes':['id',_0x1b33('0x28'),_0x1b33('0x60'),_0x1b33('0x61'),_0x1b33('0x62')],'raw':!![]});}})[_0x1b33('0x23')](function(_0x544eec){if(_0x544eec){var _0x15b790=path['join'](config['root'],_0x1b33('0x63'),util[_0x1b33('0x64')](_0x1b33('0x65'),path[_0x1b33('0x66')](_0x544eec[_0x1b33('0x60')],path['extname'](_0x544eec['save_name'])),_0x544eec[_0x1b33('0x61')]));var _0xeeb79c=path['join'](config[_0x1b33('0x4d')],_0x1b33('0x4e'),_0x31a07a[_0x1b33('0x28')],util[_0x1b33('0x64')]('%s.%s',_0x544eec[_0x1b33('0x28')],_0x544eec[_0x1b33('0x61')]));fs[_0x1b33('0x67')](_0x15b790,_0xeeb79c);return _0x544eec;}})[_0x1b33('0x42')](function(_0x358416){throw new db[(_0x1b33('0x68'))]['ValidationError'](_0x358416[_0x1b33('0x69')]);});})[_0x1b33('0x23')](handleEntityNotFound(_0x5e456e,null))[_0x1b33('0x23')](respondWithResult(_0x5e456e,0xc9))[_0x1b33('0x42')](handleError(_0x5e456e,null));};exports[_0x1b33('0x6a')]=function(_0x48142c,_0x2e6a12,_0x405889){return db['sequelize'][_0x1b33('0x48')](function(_0x5a512f){var _0x1018fd;return db[_0x1b33('0x2b')][_0x1b33('0x5f')]({'where':{'id':_0x48142c[_0x1b33('0x44')]['id']}})[_0x1b33('0x23')](handleEntityNotFound(_0x2e6a12,null))[_0x1b33('0x23')](function(_0x5a184b){if(_0x5a184b){_0x1018fd=_0x5a184b;return _0x5a184b[_0x1b33('0x6a')](_0x48142c[_0x1b33('0x44')]['id2']);}})['then'](function(_0x3d75e6){if(_0x3d75e6){return db['Sound']['findOne']({'where':{'id':_0x48142c[_0x1b33('0x44')][_0x1b33('0x6b')]},'attributes':['id',_0x1b33('0x28'),_0x1b33('0x60'),'converted_format',_0x1b33('0x62')],'raw':!![]});}})[_0x1b33('0x23')](function(_0x562500){if(_0x562500){fs[_0x1b33('0x5b')](path[_0x1b33('0x4c')](_0x1018fd[_0x1b33('0x4b')],util['format']('%s.%s',_0x562500['name'],_0x562500[_0x1b33('0x61')])));return _0x562500;}})['catch'](function(_0x298f3d){throw new db[(_0x1b33('0x68'))][(_0x1b33('0x6c'))](_0x298f3d[_0x1b33('0x69')]);});})[_0x1b33('0x23')](handleEntityNotFound(_0x2e6a12,null))[_0x1b33('0x23')](respondWithStatusCode(_0x2e6a12,0xcc))[_0x1b33('0x42')](handleError(_0x2e6a12,null));};exports[_0x1b33('0x6d')]=function(_0x5c1ebf,_0x404d41,_0x141a14){var _0x522495={};var _0x2dff72={};var _0x1972cb;var _0x5cd478;return db[_0x1b33('0x2b')][_0x1b33('0x5f')]({'where':{'id':_0x5c1ebf[_0x1b33('0x44')]['id']}})['then'](handleEntityNotFound(_0x404d41,null))[_0x1b33('0x23')](function(_0x41a77a){if(_0x41a77a){_0x1972cb=_0x41a77a;_0x2dff72[_0x1b33('0x2c')]=_[_0x1b33('0x2e')](db['Sound'][_0x1b33('0x6e')]);_0x2dff72[_0x1b33('0x2d')]=_[_0x1b33('0x2e')](_0x5c1ebf[_0x1b33('0x2d')]);_0x2dff72[_0x1b33('0x39')]=_['intersection'](_0x2dff72[_0x1b33('0x2c')],_0x2dff72['query']);_0x522495[_0x1b33('0x30')]=_[_0x1b33('0x2f')](_0x2dff72[_0x1b33('0x2c')],qs[_0x1b33('0x31')](_0x5c1ebf[_0x1b33('0x2d')]['fields']));_0x522495[_0x1b33('0x30')]=_0x522495['attributes']['length']?_0x522495[_0x1b33('0x30')]:_0x2dff72[_0x1b33('0x2c')];_0x522495[_0x1b33('0x35')]=qs['sort'](_0x5c1ebf['query'][_0x1b33('0x36')]);_0x522495[_0x1b33('0x37')]=qs[_0x1b33('0x39')](_['pick'](_0x5c1ebf['query'],_0x2dff72['filters']));if(_0x5c1ebf['query']['filter']){_0x522495[_0x1b33('0x37')]=_['merge'](_0x522495[_0x1b33('0x37')],{'$or':_[_0x1b33('0x2a')](_0x522495[_0x1b33('0x30')],function(_0xa2d00c){var _0x3ac745={};_0x3ac745[_0xa2d00c]={'$like':'%'+_0x5c1ebf['query']['filter']+'%'};return _0x3ac745;})});}_0x522495=_[_0x1b33('0x3b')]({},_0x522495,_0x5c1ebf[_0x1b33('0x3d')]);return _0x1972cb['getSounds'](_0x522495);}})[_0x1b33('0x23')](function(_0x32d6fc){if(_0x32d6fc){_0x5cd478=_0x32d6fc['length'];if(!_0x5c1ebf[_0x1b33('0x2d')]['hasOwnProperty'](_0x1b33('0x34'))){_0x522495[_0x1b33('0x1e')]=qs[_0x1b33('0x1e')](_0x5c1ebf[_0x1b33('0x2d')][_0x1b33('0x1e')]);_0x522495[_0x1b33('0x1c')]=qs['offset'](_0x5c1ebf['query']['offset']);}return _0x1972cb[_0x1b33('0x6d')](_0x522495);}})[_0x1b33('0x23')](function(_0x503482){if(_0x503482){return _0x503482?{'count':_0x5cd478,'rows':_0x503482}:null;}})[_0x1b33('0x23')](respondWithResult(_0x404d41,null))['catch'](handleError(_0x404d41,null));};
\ No newline at end of file
+var _0x9615=['../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','params','rawAttributes','body','find','create','sequelize','transaction','files','directory','join','root','server/files/moh','mode','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','readdirSync','unlinkSync','rmdirSync','Sequelize','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','ValidationError','Sound','id2','getSounds','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x4aaed7,_0x3595dd){var _0x3a1fbc=function(_0x53bcfb){while(--_0x53bcfb){_0x4aaed7['push'](_0x4aaed7['shift']());}};_0x3a1fbc(++_0x3595dd);}(_0x9615,0x130));var _0x5961=function(_0xa68515,_0x35c85e){_0xa68515=_0xa68515-0x0;var _0x5ba8f3=_0x9615[_0xa68515];return _0x5ba8f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5961('0x0'));var zipdir=require(_0x5961('0x1'));var jsonpatch=require(_0x5961('0x2'));var rp=require(_0x5961('0x3'));var moment=require(_0x5961('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5961('0x5'));var util=require(_0x5961('0x6'));var path=require(_0x5961('0x7'));var sox=require(_0x5961('0x8'));var csv=require(_0x5961('0x9'));var ejs=require(_0x5961('0xa'));var fs=require('fs');var fs_extra=require(_0x5961('0xb'));var _=require(_0x5961('0xc'));var squel=require(_0x5961('0xd'));var crypto=require(_0x5961('0xe'));var jsforce=require(_0x5961('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5961('0x9'));var querystring=require(_0x5961('0x10'));var Papa=require(_0x5961('0x11'));var Redis=require(_0x5961('0x12'));var authService=require(_0x5961('0x13'));var qs=require(_0x5961('0x14'));var as=require(_0x5961('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5961('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5961('0x17'));var db=require(_0x5961('0x18'))['db'];function respondWithStatusCode(_0x16a8a5,_0x45e0b7){_0x45e0b7=_0x45e0b7||0xcc;return function(_0x40692e){if(_0x40692e){return _0x16a8a5[_0x5961('0x19')](_0x45e0b7);}return _0x16a8a5[_0x5961('0x1a')](_0x45e0b7)['end']();};}function respondWithResult(_0x43453e,_0x45e6dc){_0x45e6dc=_0x45e6dc||0xc8;return function(_0x539b70){if(_0x539b70){return _0x43453e[_0x5961('0x1a')](_0x45e6dc)[_0x5961('0x1b')](_0x539b70);}};}function respondWithFilteredResult(_0x18f1b0,_0x5c62a6){return function(_0x28dd55){if(_0x28dd55){var _0x1d5433=typeof _0x5c62a6['offset']==='undefined'&&typeof _0x5c62a6[_0x5961('0x1c')]===_0x5961('0x1d');var _0x5d8c9e=_0x28dd55[_0x5961('0x1e')];var _0x482b00=_0x1d5433?0x0:_0x5c62a6[_0x5961('0x1f')];var _0x5bfdd3=_0x1d5433?_0x28dd55[_0x5961('0x1e')]:_0x5c62a6[_0x5961('0x1f')]+_0x5c62a6['limit'];var _0x16c599;if(_0x5bfdd3>=_0x5d8c9e){_0x5bfdd3=_0x5d8c9e;_0x16c599=0xc8;}else{_0x16c599=0xce;}_0x18f1b0[_0x5961('0x1a')](_0x16c599);return _0x18f1b0['set'](_0x5961('0x20'),_0x482b00+'-'+_0x5bfdd3+'/'+_0x5d8c9e)['json'](_0x28dd55);}return null;};}function patchUpdates(_0x3ceabf){return function(_0x84520e){try{jsonpatch[_0x5961('0x21')](_0x84520e,_0x3ceabf,!![]);}catch(_0x53e607){return BPromise[_0x5961('0x22')](_0x53e607);}return _0x84520e[_0x5961('0x23')]();};}function saveUpdates(_0xd91de4,_0x54db24){return function(_0x414a05){if(_0x414a05){return _0x414a05[_0x5961('0x24')](_0xd91de4)[_0x5961('0x25')](function(_0x591560){return _0x591560;});}return null;};}function removeEntity(_0x28e78d,_0x39818d){return function(_0x35719e){if(_0x35719e){return _0x35719e[_0x5961('0x26')]()[_0x5961('0x25')](function(){var _0x16552c=_0x35719e[_0x5961('0x27')]({'plain':!![]});var _0x56aa12=_0x5961('0x28');return db[_0x5961('0x29')][_0x5961('0x26')]({'where':{'type':_0x56aa12,'resourceId':_0x16552c['id']}})[_0x5961('0x25')](function(){return _0x35719e;});})['then'](function(){_0x28e78d[_0x5961('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x174dde,_0xf1740e){return function(_0x38b808){if(!_0x38b808){_0x174dde['sendStatus'](0x194);}return _0x38b808;};}function handleError(_0x1b584d,_0x2fa05e){_0x2fa05e=_0x2fa05e||0x1f4;return function(_0x186c17){logger[_0x5961('0x2a')](_0x186c17[_0x5961('0x2b')]);if(_0x186c17[_0x5961('0x2c')]){delete _0x186c17[_0x5961('0x2c')];}_0x1b584d[_0x5961('0x1a')](_0x2fa05e)['send'](_0x186c17);};}exports['index']=function(_0x5e867c,_0x4cb979){var _0x352ba5={},_0x5ba70c={},_0x1994fe={'count':0x0,'rows':[]};var _0x42d0f2=_[_0x5961('0x2d')](db[_0x5961('0x2e')]['rawAttributes'],function(_0x23b7f4){return{'name':_0x23b7f4[_0x5961('0x2f')],'type':_0x23b7f4[_0x5961('0x30')][_0x5961('0x31')]};});_0x5ba70c[_0x5961('0x32')]=_['map'](_0x42d0f2,_0x5961('0x2c'));_0x5ba70c[_0x5961('0x33')]=_[_0x5961('0x34')](_0x5e867c[_0x5961('0x33')]);_0x5ba70c[_0x5961('0x35')]=_[_0x5961('0x36')](_0x5ba70c['model'],_0x5ba70c[_0x5961('0x33')]);_0x352ba5['attributes']=_[_0x5961('0x36')](_0x5ba70c[_0x5961('0x32')],qs[_0x5961('0x37')](_0x5e867c[_0x5961('0x33')][_0x5961('0x37')]));_0x352ba5[_0x5961('0x38')]=_0x352ba5[_0x5961('0x38')][_0x5961('0x39')]?_0x352ba5[_0x5961('0x38')]:_0x5ba70c[_0x5961('0x32')];if(!_0x5e867c['query'][_0x5961('0x3a')](_0x5961('0x3b'))){_0x352ba5[_0x5961('0x1c')]=qs[_0x5961('0x1c')](_0x5e867c[_0x5961('0x33')][_0x5961('0x1c')]);_0x352ba5[_0x5961('0x1f')]=qs[_0x5961('0x1f')](_0x5e867c['query'][_0x5961('0x1f')]);}_0x352ba5[_0x5961('0x3c')]=qs[_0x5961('0x3d')](_0x5e867c['query'][_0x5961('0x3d')]);delete _0x5e867c[_0x5961('0x33')]['sort'];_0x352ba5[_0x5961('0x3e')]=qs[_0x5961('0x35')](_[_0x5961('0x3f')](_0x5e867c[_0x5961('0x33')],_0x5ba70c['filters']),_0x42d0f2);if(_0x5e867c[_0x5961('0x33')][_0x5961('0x40')]){_0x352ba5[_0x5961('0x3e')]=_[_0x5961('0x41')](_0x352ba5[_0x5961('0x3e')],{'$or':_[_0x5961('0x2d')](_0x42d0f2,function(_0x421543){if(_0x421543['type']!=='VIRTUAL'){var _0x31adfa={};_0x31adfa[_0x421543['name']]={'$like':'%'+_0x5e867c[_0x5961('0x33')]['filter']+'%'};return _0x31adfa;}})});}_0x352ba5=_['merge']({},_0x352ba5,_0x5e867c[_0x5961('0x42')]);var _0x2beb64={'where':_0x352ba5[_0x5961('0x3e')]};return db[_0x5961('0x2e')][_0x5961('0x1e')](_0x2beb64)[_0x5961('0x25')](function(_0xdb11aa){_0x1994fe['count']=_0xdb11aa;if(_0x5e867c[_0x5961('0x33')]['includeAll']){_0x352ba5['include']=[{'all':!![]}];}return db[_0x5961('0x2e')][_0x5961('0x43')](_0x352ba5);})[_0x5961('0x25')](function(_0x4d06d8){_0x1994fe[_0x5961('0x44')]=_0x4d06d8;return _0x1994fe;})[_0x5961('0x25')](respondWithFilteredResult(_0x4cb979,_0x352ba5))[_0x5961('0x45')](handleError(_0x4cb979,null));};exports['show']=function(_0x2d543b,_0xadea36){var _0x183af6={'raw':![],'where':{'id':_0x2d543b[_0x5961('0x46')]['id']}},_0x26ac9f={};_0x26ac9f[_0x5961('0x32')]=_[_0x5961('0x34')](db[_0x5961('0x2e')][_0x5961('0x47')]);_0x26ac9f['query']=_['keys'](_0x2d543b['query']);_0x26ac9f[_0x5961('0x35')]=_[_0x5961('0x36')](_0x26ac9f[_0x5961('0x32')],_0x26ac9f[_0x5961('0x33')]);_0x183af6['attributes']=_['intersection'](_0x26ac9f['model'],qs['fields'](_0x2d543b['query'][_0x5961('0x37')]));_0x183af6[_0x5961('0x38')]=_0x183af6['attributes'][_0x5961('0x39')]?_0x183af6['attributes']:_0x26ac9f[_0x5961('0x32')];if(_0x2d543b[_0x5961('0x33')]['includeAll']){_0x183af6['include']=[{'all':!![]}];}_0x183af6=_['merge']({},_0x183af6,_0x2d543b[_0x5961('0x42')]);return db[_0x5961('0x2e')]['find'](_0x183af6)[_0x5961('0x25')](handleEntityNotFound(_0xadea36,null))[_0x5961('0x25')](respondWithResult(_0xadea36,null))['catch'](handleError(_0xadea36,null));};exports['update']=function(_0x22ced6,_0x2ccc99){if(_0x22ced6['body']['id']){delete _0x22ced6[_0x5961('0x48')]['id'];}return db['VoiceMusicOnHold'][_0x5961('0x49')]({'where':{'id':_0x22ced6['params']['id']}})[_0x5961('0x25')](handleEntityNotFound(_0x2ccc99,null))[_0x5961('0x25')](saveUpdates(_0x22ced6[_0x5961('0x48')],null))[_0x5961('0x25')](respondWithResult(_0x2ccc99,null))['catch'](handleError(_0x2ccc99,null));};exports[_0x5961('0x4a')]=function(_0x57e620,_0x26f9b7,_0x29ef5f){return db[_0x5961('0x4b')][_0x5961('0x4c')](function(_0xef0396){if(_0x57e620[_0x5961('0x48')]['mode']===_0x5961('0x4d')){_0x57e620[_0x5961('0x48')][_0x5961('0x4e')]=path[_0x5961('0x4f')](config[_0x5961('0x50')],_0x5961('0x51'),_0x57e620[_0x5961('0x48')][_0x5961('0x2c')]);}return db[_0x5961('0x2e')][_0x5961('0x4a')](_0x57e620[_0x5961('0x48')],{'transaction':_0xef0396})[_0x5961('0x25')](function(_0x4bce42){if(_0x57e620[_0x5961('0x48')][_0x5961('0x52')]===_0x5961('0x4d')){fs[_0x5961('0x53')](_0x4bce42[_0x5961('0x4e')],parseInt('0777',0x8));}var _0x4a4ab6=_0x57e620[_0x5961('0x54')][_0x5961('0x27')]({'plain':!![]});if(!_0x4a4ab6)throw new Error(_0x5961('0x55'));if(_0x4a4ab6[_0x5961('0x56')]===_0x5961('0x54')){var _0x4c7b34=_0x4bce42[_0x5961('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x5961('0x49')]({'where':{'name':_0x5961('0x28'),'userProfileId':_0x4a4ab6[_0x5961('0x57')]},'raw':!![]})[_0x5961('0x25')](function(_0x48d823){if(_0x48d823&&_0x48d823[_0x5961('0x58')]===0x0){return db[_0x5961('0x29')]['create']({'name':_0x4c7b34[_0x5961('0x2c')],'resourceId':_0x4c7b34['id'],'type':_0x48d823['name'],'sectionId':_0x48d823['id']},{})['then'](function(){return _0x4bce42;});}else{return _0x4bce42;}})[_0x5961('0x45')](function(_0x59a6eb){logger[_0x5961('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59a6eb);});}return _0x4bce42;});})['then'](respondWithResult(_0x26f9b7,0xc9))[_0x5961('0x45')](handleError(_0x26f9b7,null));};exports['destroy']=function(_0x2395b3,_0xcd4a6d,_0x43eb1c){var _0x5f302b;return db[_0x5961('0x2e')][_0x5961('0x49')]({'where':{'id':_0x2395b3['params']['id']}})['then'](function(_0x81f55f){if(_0x81f55f){return db[_0x5961('0x4b')][_0x5961('0x4c')](function(_0x51e530){return _0x81f55f['destroy']({'transaction':_0x51e530,'raw':!![]})[_0x5961('0x25')](function(_0x32f7d3){if(_0x32f7d3[_0x5961('0x4e')]){fs[_0x5961('0x59')](_0x32f7d3[_0x5961('0x4e')])['forEach'](function(_0x1136da){fs[_0x5961('0x5a')](path['join'](_0x32f7d3[_0x5961('0x4e')],_0x1136da));});fs[_0x5961('0x5b')](_0x32f7d3['directory']);}return _0x32f7d3;});})[_0x5961('0x45')](function(_0x1d09f5){throw new db[(_0x5961('0x5c'))]['ValidationError'](_0x1d09f5[_0x5961('0x5d')]);});}})[_0x5961('0x25')](handleEntityNotFound(_0xcd4a6d,null))[_0x5961('0x25')](removeEntity(_0xcd4a6d,null))[_0x5961('0x45')](handleError(_0xcd4a6d,null));};exports[_0x5961('0x5e')]=function(_0x1886e5,_0x166fc3,_0x24aced){return db[_0x5961('0x4b')][_0x5961('0x4c')](function(_0x2b856){var _0x5ca0bd;return db[_0x5961('0x2e')]['find']({'where':{'id':_0x1886e5[_0x5961('0x46')]['id']}})[_0x5961('0x25')](function(_0x48eb65){if(_0x48eb65){_0x5ca0bd=_0x48eb65;return _0x48eb65['addSound'](_0x1886e5[_0x5961('0x48')]['id'],{'transaction':_0x2b856});}})['then'](function(_0x5587d0){if(_0x5587d0){return db['Sound'][_0x5961('0x5f')]({'where':{'id':_0x1886e5[_0x5961('0x48')]['id']},'attributes':['id',_0x5961('0x2c'),_0x5961('0x60'),_0x5961('0x61'),_0x5961('0x62')],'raw':!![]});}})[_0x5961('0x25')](function(_0x2c3944){if(_0x2c3944){var _0x3cae2b=path[_0x5961('0x4f')](config[_0x5961('0x50')],_0x5961('0x63'),util[_0x5961('0x64')](_0x5961('0x65'),path[_0x5961('0x66')](_0x2c3944['save_name'],path[_0x5961('0x67')](_0x2c3944[_0x5961('0x60')])),_0x2c3944[_0x5961('0x61')]));var _0x3cad23=path['join'](config['root'],_0x5961('0x51'),_0x5ca0bd[_0x5961('0x2c')],util[_0x5961('0x64')](_0x5961('0x65'),_0x2c3944['name'],_0x2c3944['converted_format']));fs[_0x5961('0x68')](_0x3cae2b,_0x3cad23);return _0x2c3944;}})[_0x5961('0x45')](function(_0x43542b){throw new db[(_0x5961('0x5c'))][(_0x5961('0x69'))](_0x43542b[_0x5961('0x5d')]);});})[_0x5961('0x25')](handleEntityNotFound(_0x166fc3,null))[_0x5961('0x25')](respondWithResult(_0x166fc3,0xc9))['catch'](handleError(_0x166fc3,null));};exports['removeSound']=function(_0x4fe397,_0x4abd23,_0x48c166){return db[_0x5961('0x4b')][_0x5961('0x4c')](function(_0x30d98e){var _0x408d46;return db[_0x5961('0x2e')][_0x5961('0x5f')]({'where':{'id':_0x4fe397[_0x5961('0x46')]['id']}})[_0x5961('0x25')](handleEntityNotFound(_0x4abd23,null))[_0x5961('0x25')](function(_0x2f058d){if(_0x2f058d){_0x408d46=_0x2f058d;return _0x2f058d['removeSound'](_0x4fe397[_0x5961('0x46')]['id2']);}})[_0x5961('0x25')](function(_0x43f3c0){if(_0x43f3c0){return db[_0x5961('0x6a')]['findOne']({'where':{'id':_0x4fe397[_0x5961('0x46')][_0x5961('0x6b')]},'attributes':['id','name',_0x5961('0x60'),_0x5961('0x61'),'createdAt'],'raw':!![]});}})[_0x5961('0x25')](function(_0xa8027d){if(_0xa8027d){fs[_0x5961('0x5a')](path[_0x5961('0x4f')](_0x408d46[_0x5961('0x4e')],util['format']('%s.%s',_0xa8027d['name'],_0xa8027d[_0x5961('0x61')])));return _0xa8027d;}})[_0x5961('0x45')](function(_0x2a029b){throw new db[(_0x5961('0x5c'))][(_0x5961('0x69'))](_0x2a029b[_0x5961('0x5d')]);});})['then'](handleEntityNotFound(_0x4abd23,null))['then'](respondWithStatusCode(_0x4abd23,0xcc))[_0x5961('0x45')](handleError(_0x4abd23,null));};exports[_0x5961('0x6c')]=function(_0x2c8041,_0x51c4ee,_0x211d57){var _0x91d94f={};var _0x3265dc={};var _0x3ec010;var _0x40b4d0;return db['VoiceMusicOnHold'][_0x5961('0x5f')]({'where':{'id':_0x2c8041[_0x5961('0x46')]['id']}})['then'](handleEntityNotFound(_0x51c4ee,null))[_0x5961('0x25')](function(_0x52c20d){if(_0x52c20d){_0x3ec010=_0x52c20d;_0x3265dc[_0x5961('0x32')]=_['keys'](db[_0x5961('0x6a')]['rawAttributes']);_0x3265dc['query']=_[_0x5961('0x34')](_0x2c8041[_0x5961('0x33')]);_0x3265dc['filters']=_[_0x5961('0x36')](_0x3265dc['model'],_0x3265dc[_0x5961('0x33')]);_0x91d94f[_0x5961('0x38')]=_['intersection'](_0x3265dc[_0x5961('0x32')],qs[_0x5961('0x37')](_0x2c8041[_0x5961('0x33')][_0x5961('0x37')]));_0x91d94f[_0x5961('0x38')]=_0x91d94f[_0x5961('0x38')][_0x5961('0x39')]?_0x91d94f['attributes']:_0x3265dc[_0x5961('0x32')];_0x91d94f['order']=qs[_0x5961('0x3d')](_0x2c8041[_0x5961('0x33')][_0x5961('0x3d')]);_0x91d94f[_0x5961('0x3e')]=qs[_0x5961('0x35')](_['pick'](_0x2c8041[_0x5961('0x33')],_0x3265dc[_0x5961('0x35')]));if(_0x2c8041[_0x5961('0x33')][_0x5961('0x40')]){_0x91d94f[_0x5961('0x3e')]=_[_0x5961('0x41')](_0x91d94f[_0x5961('0x3e')],{'$or':_[_0x5961('0x2d')](_0x91d94f[_0x5961('0x38')],function(_0x1efdbf){var _0x255f8d={};_0x255f8d[_0x1efdbf]={'$like':'%'+_0x2c8041[_0x5961('0x33')][_0x5961('0x40')]+'%'};return _0x255f8d;})});}_0x91d94f=_['merge']({},_0x91d94f,_0x2c8041[_0x5961('0x42')]);return _0x3ec010[_0x5961('0x6c')](_0x91d94f);}})['then'](function(_0x3e245f){if(_0x3e245f){_0x40b4d0=_0x3e245f[_0x5961('0x39')];if(!_0x2c8041['query'][_0x5961('0x3a')](_0x5961('0x3b'))){_0x91d94f['limit']=qs[_0x5961('0x1c')](_0x2c8041[_0x5961('0x33')][_0x5961('0x1c')]);_0x91d94f['offset']=qs[_0x5961('0x1f')](_0x2c8041[_0x5961('0x33')][_0x5961('0x1f')]);}return _0x3ec010['getSounds'](_0x91d94f);}})['then'](function(_0x49e90a){if(_0x49e90a){return _0x49e90a?{'count':_0x40b4d0,'rows':_0x49e90a}:null;}})[_0x5961('0x25')](respondWithResult(_0x51c4ee,null))['catch'](handleError(_0x51c4ee,null));};
\ No newline at end of file
index c61a2f4..827e8c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf2=['rimraf','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcaf2,0xd6));var _0x2caf=function(_0x3b2d98,_0xaa0b26){_0x3b2d98=_0x3b2d98-0x0;var _0x256bf1=_0xcaf2[_0x3b2d98];return _0x256bf1;};'use strict';var _=require(_0x2caf('0x0'));var util=require(_0x2caf('0x1'));var logger=require(_0x2caf('0x2'))(_0x2caf('0x3'));var moment=require('moment');var BPromise=require(_0x2caf('0x4'));var rp=require(_0x2caf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2caf('0x6'));var config=require('../../config/environment');var attributes=require(_0x2caf('0x7'));module['exports']=function(_0x2616ea,_0x6b7ca2){return _0x2616ea[_0x2caf('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0x2caf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4af5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util'];(function(_0x1155ef,_0x4a77ea){var _0x1d6614=function(_0x5a46d3){while(--_0x5a46d3){_0x1155ef['push'](_0x1155ef['shift']());}};_0x1d6614(++_0x4a77ea);}(_0x4af5,0x14e));var _0x54af=function(_0x33abfb,_0x21270f){_0x33abfb=_0x33abfb-0x0;var _0x3b5623=_0x4af5[_0x33abfb];return _0x3b5623;};'use strict';var _=require(_0x54af('0x0'));var util=require(_0x54af('0x1'));var logger=require(_0x54af('0x2'))(_0x54af('0x3'));var moment=require(_0x54af('0x4'));var BPromise=require(_0x54af('0x5'));var rp=require(_0x54af('0x6'));var fs=require('fs');var path=require(_0x54af('0x7'));var rimraf=require(_0x54af('0x8'));var config=require(_0x54af('0x9'));var attributes=require(_0x54af('0xa'));module[_0x54af('0xb')]=function(_0x23b7f1,_0x10563a){return _0x23b7f1[_0x54af('0xc')](_0x54af('0xd'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 301abf4..3b26760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3840b9,_0x41ebe5){var _0x1e7fa4=function(_0x547082){while(--_0x547082){_0x3840b9['push'](_0x3840b9['shift']());}};_0x1e7fa4(++_0x41ebe5);}(_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 moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x4826e2,_0x112378){var _0x3bc599=function(_0x1056c5){while(--_0x1056c5){_0x4826e2['push'](_0x4826e2['shift']());}};_0x3bc599(++_0x112378);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}
\ No newline at end of file
index 3e3e66a..64d26a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3248=['show','getAgents','/:id/teams','create','post','/:id/users','addTeams','put','update','delete','removeAgents','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x2cc2a3,_0xadda0e){var _0x45c6fb=function(_0x147796){while(--_0x147796){_0x2cc2a3['push'](_0x2cc2a3['shift']());}};_0x45c6fb(++_0xadda0e);}(_0x3248,0x1bc));var _0x8324=function(_0x75f5a1,_0x538a82){_0x75f5a1=_0x75f5a1-0x0;var _0x54d9aa=_0x3248[_0x75f5a1];return _0x54d9aa;};'use strict';var multer=require('multer');var util=require(_0x8324('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8324('0x1'));var router=express[_0x8324('0x2')]();var fs_extra=require(_0x8324('0x3'));var auth=require(_0x8324('0x4'));var interaction=require(_0x8324('0x5'));var config=require(_0x8324('0x6'));var controller=require('./voicePrefix.controller');router[_0x8324('0x7')]('/',auth[_0x8324('0x8')](),controller['index']);router[_0x8324('0x7')](_0x8324('0x9'),auth[_0x8324('0x8')](),controller[_0x8324('0xa')]);router['get'](_0x8324('0xb'),auth[_0x8324('0x8')](),controller[_0x8324('0xc')]);router[_0x8324('0x7')]('/:id/users',auth[_0x8324('0x8')](),controller[_0x8324('0xd')]);router['get'](_0x8324('0xe'),auth[_0x8324('0x8')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller[_0x8324('0xf')]);router[_0x8324('0x10')](_0x8324('0x11'),auth[_0x8324('0x8')](),controller['addAgents']);router[_0x8324('0x10')](_0x8324('0xe'),auth[_0x8324('0x8')](),controller[_0x8324('0x12')]);router[_0x8324('0x13')]('/:id',auth[_0x8324('0x8')](),controller[_0x8324('0x14')]);router[_0x8324('0x15')](_0x8324('0xb'),auth[_0x8324('0x8')](),controller['destroy']);router[_0x8324('0x15')](_0x8324('0x11'),auth[_0x8324('0x8')](),controller[_0x8324('0x16')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);module[_0x8324('0x17')]=router;
\ No newline at end of file
+var _0x75f0=['show','/:id/users','/:id/teams','getTeams','post','create','addAgents','addTeams','put','/:id','delete','destroy','removeAgents','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','describe'];(function(_0x509dc3,_0x1c3704){var _0x3a33b7=function(_0x4a7a9d){while(--_0x4a7a9d){_0x509dc3['push'](_0x509dc3['shift']());}};_0x3a33b7(++_0x1c3704);}(_0x75f0,0x196));var _0x075f=function(_0x25c9fd,_0x37df36){_0x25c9fd=_0x25c9fd-0x0;var _0x28eedc=_0x75f0[_0x25c9fd];return _0x28eedc;};'use strict';var multer=require(_0x075f('0x0'));var util=require(_0x075f('0x1'));var path=require(_0x075f('0x2'));var timeout=require(_0x075f('0x3'));var express=require(_0x075f('0x4'));var router=express[_0x075f('0x5')]();var fs_extra=require(_0x075f('0x6'));var auth=require(_0x075f('0x7'));var interaction=require(_0x075f('0x8'));var config=require('../../config/environment');var controller=require(_0x075f('0x9'));router[_0x075f('0xa')]('/',auth[_0x075f('0xb')](),controller['index']);router['get'](_0x075f('0xc'),auth['isAuthenticated'](),controller[_0x075f('0xd')]);router[_0x075f('0xa')]('/:id',auth[_0x075f('0xb')](),controller[_0x075f('0xe')]);router[_0x075f('0xa')](_0x075f('0xf'),auth[_0x075f('0xb')](),controller['getAgents']);router['get'](_0x075f('0x10'),auth[_0x075f('0xb')](),controller[_0x075f('0x11')]);router[_0x075f('0x12')]('/',auth[_0x075f('0xb')](),controller[_0x075f('0x13')]);router[_0x075f('0x12')](_0x075f('0xf'),auth[_0x075f('0xb')](),controller[_0x075f('0x14')]);router[_0x075f('0x12')](_0x075f('0x10'),auth[_0x075f('0xb')](),controller[_0x075f('0x15')]);router[_0x075f('0x16')](_0x075f('0x17'),auth[_0x075f('0xb')](),controller['update']);router[_0x075f('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x075f('0x19')]);router[_0x075f('0x18')](_0x075f('0xf'),auth['isAuthenticated'](),controller[_0x075f('0x1a')]);router[_0x075f('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x075f('0x1b')]);module['exports']=router;
\ No newline at end of file
index 2a2cb06..f8431d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb27=['INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x426e74,_0x3f9e93){var _0x541bb9=function(_0x50c8d9){while(--_0x50c8d9){_0x426e74['push'](_0x426e74['shift']());}};_0x541bb9(++_0x3f9e93);}(_0xbb27,0x99));var _0x7bb2=function(_0x574a93,_0x3aba5c){_0x574a93=_0x574a93-0x0;var _0x58f028=_0xbb27[_0x574a93];return _0x58f028;};'use strict';var Sequelize=require(_0x7bb2('0x0'));module[_0x7bb2('0x1')]={'name':{'type':Sequelize[_0x7bb2('0x2')],'allowNull':![],'unique':_0x7bb2('0x3')},'prefix':{'type':Sequelize[_0x7bb2('0x4')],'get':function(_0x45ece6){return _0x7bb2('0x5')+this[_0x7bb2('0x6')](_0x7bb2('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x7bb2('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7bb2('0x7')]}};
\ No newline at end of file
+var _0x0a77=['getDataValue','sequelize','exports','STRING','VIRTUAL','system-'];(function(_0x1428d3,_0x925d43){var _0x103810=function(_0xfb0767){while(--_0xfb0767){_0x1428d3['push'](_0x1428d3['shift']());}};_0x103810(++_0x925d43);}(_0x0a77,0x1db));var _0x70a7=function(_0x3097dd,_0x24f9a4){_0x3097dd=_0x3097dd-0x0;var _0x35dca7=_0x0a77[_0x3097dd];return _0x35dca7;};'use strict';var Sequelize=require(_0x70a7('0x0'));module[_0x70a7('0x1')]={'name':{'type':Sequelize[_0x70a7('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x70a7('0x3')],'get':function(_0x52067c){return _0x70a7('0x4')+this[_0x70a7('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x70a7('0x2')]},'callerIdAll':{'type':Sequelize[_0x70a7('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 4cfe121..89776d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a5=['merge','VIRTUAL','options','includeAll','include','VoicePrefix','findAll','rows','catch','show','params','rawAttributes','keys','find','describe','create','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','context','from-sip','exten','app','appdata','prefix','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','charAt','system-','transaction','findById','addAgents','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x448253,_0xd353bb){var _0x5acc30=function(_0x525554){while(--_0x525554){_0x448253['push'](_0x448253['shift']());}};_0x5acc30(++_0xd353bb);}(_0x63a5,0x18e));var _0x563a=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x63a5[_0x176329];return _0x31997c;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];config[_0x563a('0x19')]=_[_0x563a('0x1a')](config[_0x563a('0x19')],{'host':_0x563a('0x1b'),'port':0x18eb});var socket=require(_0x563a('0x1c'))(new Redis(config[_0x563a('0x19')]));require('./voicePrefix.socket')[_0x563a('0x1d')](socket);function respondWithStatusCode(_0x3045ac,_0x8c3727){_0x8c3727=_0x8c3727||0xcc;return function(_0x26987f){if(_0x26987f){return _0x3045ac['sendStatus'](_0x8c3727);}return _0x3045ac['status'](_0x8c3727)[_0x563a('0x1e')]();};}function respondWithResult(_0x2ad667,_0x5b291f){_0x5b291f=_0x5b291f||0xc8;return function(_0x2ade24){if(_0x2ade24){return _0x2ad667[_0x563a('0x1f')](_0x5b291f)[_0x563a('0x20')](_0x2ade24);}};}function respondWithFilteredResult(_0x9c2f77,_0x4f947d){return function(_0x598693){if(_0x598693){var _0xe3d2bd=typeof _0x4f947d[_0x563a('0x21')]===_0x563a('0x22')&&typeof _0x4f947d['limit']==='undefined';var _0x52b99a=_0x598693['count'];var _0x40916a=_0xe3d2bd?0x0:_0x4f947d[_0x563a('0x21')];var _0x26061f=_0xe3d2bd?_0x598693[_0x563a('0x23')]:_0x4f947d['offset']+_0x4f947d['limit'];var _0x3930f0;if(_0x26061f>=_0x52b99a){_0x26061f=_0x52b99a;_0x3930f0=0xc8;}else{_0x3930f0=0xce;}_0x9c2f77[_0x563a('0x1f')](_0x3930f0);return _0x9c2f77[_0x563a('0x24')](_0x563a('0x25'),_0x40916a+'-'+_0x26061f+'/'+_0x52b99a)[_0x563a('0x20')](_0x598693);}return null;};}function patchUpdates(_0x2dc7e2){return function(_0x44b460){try{jsonpatch[_0x563a('0x26')](_0x44b460,_0x2dc7e2,!![]);}catch(_0x506491){return BPromise[_0x563a('0x27')](_0x506491);}return _0x44b460['save']();};}function saveUpdates(_0x44e2c1,_0xd3e0ae){return function(_0x3a36a4){if(_0x3a36a4){return _0x3a36a4[_0x563a('0x28')](_0x44e2c1)[_0x563a('0x29')](function(_0x1682ee){return _0x1682ee;});}return null;};}function removeEntity(_0x3642b3,_0x173990){return function(_0x4de4c3){if(_0x4de4c3){return _0x4de4c3[_0x563a('0x2a')]()[_0x563a('0x29')](function(){var _0x2311f2=_0x4de4c3[_0x563a('0x2b')]({'plain':!![]});var _0xce8165=_0x563a('0x2c');return db[_0x563a('0x2d')][_0x563a('0x2a')]({'where':{'type':_0xce8165,'resourceId':_0x2311f2['id']}})[_0x563a('0x29')](function(){return _0x4de4c3;});})[_0x563a('0x29')](function(){_0x3642b3[_0x563a('0x1f')](0xcc)[_0x563a('0x1e')]();});}};}function handleEntityNotFound(_0x1bdfb0,_0x7696c2){return function(_0x579cb5){if(!_0x579cb5){_0x1bdfb0[_0x563a('0x2e')](0x194);}return _0x579cb5;};}function handleError(_0x3c16d0,_0x2257e1){_0x2257e1=_0x2257e1||0x1f4;return function(_0x4aaa3d){logger[_0x563a('0x2f')](_0x4aaa3d[_0x563a('0x30')]);if(_0x4aaa3d[_0x563a('0x31')]){delete _0x4aaa3d[_0x563a('0x31')];}_0x3c16d0[_0x563a('0x1f')](_0x2257e1)[_0x563a('0x32')](_0x4aaa3d);};}exports[_0x563a('0x33')]=function(_0x4a2d28,_0x2418ae){var _0x24ec9d={},_0x4259f6={},_0x2ea6c2={'count':0x0,'rows':[]};var _0x1a77b8=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x4e5c46){return{'name':_0x4e5c46[_0x563a('0x34')],'type':_0x4e5c46[_0x563a('0x35')][_0x563a('0x36')]};});_0x4259f6[_0x563a('0x37')]=_[_0x563a('0x38')](_0x1a77b8,_0x563a('0x31'));_0x4259f6['query']=_['keys'](_0x4a2d28[_0x563a('0x39')]);_0x4259f6[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x4259f6[_0x563a('0x37')],_0x4259f6[_0x563a('0x39')]);_0x24ec9d[_0x563a('0x3c')]=_[_0x563a('0x3b')](_0x4259f6[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x4a2d28[_0x563a('0x39')][_0x563a('0x3d')]));_0x24ec9d[_0x563a('0x3c')]=_0x24ec9d[_0x563a('0x3c')][_0x563a('0x3e')]?_0x24ec9d[_0x563a('0x3c')]:_0x4259f6[_0x563a('0x37')];if(!_0x4a2d28['query'][_0x563a('0x3f')](_0x563a('0x40'))){_0x24ec9d[_0x563a('0x41')]=qs['limit'](_0x4a2d28[_0x563a('0x39')]['limit']);_0x24ec9d[_0x563a('0x21')]=qs[_0x563a('0x21')](_0x4a2d28['query']['offset']);}_0x24ec9d[_0x563a('0x42')]=qs['sort'](_0x4a2d28[_0x563a('0x39')][_0x563a('0x43')]);_0x24ec9d[_0x563a('0x44')]=qs[_0x563a('0x3a')](_['pick'](_0x4a2d28['query'],_0x4259f6[_0x563a('0x3a')]),_0x1a77b8);if(_0x4a2d28['query'][_0x563a('0x45')]){_0x24ec9d[_0x563a('0x44')]=_[_0x563a('0x46')](_0x24ec9d[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x1a77b8,function(_0x38fab5){if(_0x38fab5[_0x563a('0x35')]!==_0x563a('0x47')){var _0x4c71df={};_0x4c71df[_0x38fab5[_0x563a('0x31')]]={'$like':'%'+_0x4a2d28['query'][_0x563a('0x45')]+'%'};return _0x4c71df;}})});}_0x24ec9d=_[_0x563a('0x46')]({},_0x24ec9d,_0x4a2d28[_0x563a('0x48')]);var _0x2d3800={'where':_0x24ec9d['where']};return db['VoicePrefix']['count'](_0x2d3800)[_0x563a('0x29')](function(_0x1255da){_0x2ea6c2[_0x563a('0x23')]=_0x1255da;if(_0x4a2d28[_0x563a('0x39')][_0x563a('0x49')]){_0x24ec9d[_0x563a('0x4a')]=[{'all':!![]}];}return db[_0x563a('0x4b')][_0x563a('0x4c')](_0x24ec9d);})[_0x563a('0x29')](function(_0x433353){_0x2ea6c2[_0x563a('0x4d')]=_0x433353;return _0x2ea6c2;})[_0x563a('0x29')](respondWithFilteredResult(_0x2418ae,_0x24ec9d))[_0x563a('0x4e')](handleError(_0x2418ae,null));};exports[_0x563a('0x4f')]=function(_0x144e15,_0x456d27){var _0x4643c4={'raw':![],'where':{'id':_0x144e15[_0x563a('0x50')]['id']}},_0x21bafb={};_0x21bafb['model']=_['keys'](db[_0x563a('0x4b')][_0x563a('0x51')]);_0x21bafb[_0x563a('0x39')]=_[_0x563a('0x52')](_0x144e15[_0x563a('0x39')]);_0x21bafb[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x21bafb[_0x563a('0x37')],_0x21bafb['query']);_0x4643c4['attributes']=_[_0x563a('0x3b')](_0x21bafb[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x144e15[_0x563a('0x39')][_0x563a('0x3d')]));_0x4643c4[_0x563a('0x3c')]=_0x4643c4[_0x563a('0x3c')][_0x563a('0x3e')]?_0x4643c4['attributes']:_0x21bafb[_0x563a('0x37')];if(_0x144e15[_0x563a('0x39')]['includeAll']){_0x4643c4[_0x563a('0x4a')]=[{'all':!![]}];}_0x4643c4=_['merge']({},_0x4643c4,_0x144e15[_0x563a('0x48')]);return db[_0x563a('0x4b')][_0x563a('0x53')](_0x4643c4)['then'](handleEntityNotFound(_0x456d27,null))[_0x563a('0x29')](respondWithResult(_0x456d27,null))[_0x563a('0x4e')](handleError(_0x456d27,null));};exports[_0x563a('0x2a')]=function(_0x39c104,_0x6fe8a9){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x39c104[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x6fe8a9,null))[_0x563a('0x29')](removeEntity(_0x6fe8a9,null))[_0x563a('0x4e')](handleError(_0x6fe8a9,null));};exports[_0x563a('0x54')]=function(_0x406d4a,_0x497469){return db['VoicePrefix'][_0x563a('0x54')]()[_0x563a('0x29')](respondWithResult(_0x497469,null))[_0x563a('0x4e')](handleError(_0x497469,null));};exports['create']=function(_0x5ae08f,_0x13530f){var _0x1fc4d2;return db['sequelize']['transaction'](function(_0x51e142){return db[_0x563a('0x4b')][_0x563a('0x55')](_0x5ae08f[_0x563a('0x56')],{'transaction':_0x51e142})[_0x563a('0x29')](function(_0x8d3997){_0x1fc4d2=_0x8d3997[_0x563a('0x2b')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x1fc4d2[_0x563a('0x57')]},'raw':!![]})['then'](function(_0x4453b2){return createVoicePrefixExtensions(_0x1fc4d2,_0x4453b2,_0x51e142);});});})[_0x563a('0x29')](function(){var _0x3e993e=_0x5ae08f[_0x563a('0x58')][_0x563a('0x2b')]({'plain':!![]});if(!_0x3e993e)throw new Error(_0x563a('0x59'));if(_0x3e993e[_0x563a('0x5a')]==='user'){var _0x22cc91=_0x1fc4d2;return db[_0x563a('0x5b')]['find']({'where':{'name':_0x563a('0x2c'),'userProfileId':_0x3e993e[_0x563a('0x5c')]},'raw':!![]})[_0x563a('0x29')](function(_0x2afa8c){if(_0x2afa8c&&_0x2afa8c[_0x563a('0x5d')]===0x0){return db[_0x563a('0x2d')][_0x563a('0x55')]({'name':_0x22cc91[_0x563a('0x31')],'resourceId':_0x22cc91['id'],'type':_0x2afa8c[_0x563a('0x31')],'sectionId':_0x2afa8c['id']},{})[_0x563a('0x29')](function(){return _0x1fc4d2;});}else{return _0x1fc4d2;}})['catch'](function(_0x1926f1){logger[_0x563a('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1926f1);throw _0x1926f1;});}return _0x1fc4d2;})['then'](respondWithResult(_0x13530f,null))[_0x563a('0x4e')](handleError(_0x13530f,null));};function Extension(_0x709bfd,_0x579d61,_0x19edc3,_0x59e371){this[_0x563a('0x5e')]=_0x563a('0x5f');this[_0x563a('0x60')]=_0x709bfd;this[_0x563a('0x61')]=_0x19edc3;this[_0x563a('0x35')]='system';this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x579d61;this[_0x563a('0x62')]=_0x59e371;}function createVoicePrefixExtensions(_0x5141d5,_0x111444,_0x496b6a){return new BPromise(function(_0x2a82cf,_0x3f2750){var _0xbe3343=new Extension(formatPrefixName(_0x5141d5[_0x563a('0x63')]),0x1,_0x563a('0x64'),'Voice\x20Prefix');_0xbe3343[_0x563a('0x65')]=_0x5141d5['id'];return db['VoiceExtension']['create'](_0xbe3343,{'transaction':_0x496b6a})[_0x563a('0x29')](function(_0x3b7993){var _0x409f3c=_0x3b7993[_0x563a('0x2b')]({'plain':!![]});var _0x1c8ad7=_['map'](addVoicePrefixExtensions(_0x5141d5,_0x111444),function(_0x10eb03){_0x10eb03[_0x563a('0x57')]=_0x409f3c['id'];_0x10eb03[_0x563a('0x65')]=_0x5141d5['id'];return _0x10eb03;});return db[_0x563a('0x66')][_0x563a('0x67')](_0x1c8ad7,{'transaction':_0x496b6a})['then'](function(_0xac578c){if(!_0xac578c){return _0x3f2750('Extensions\x20creation\x20failed');}else{return _0x2a82cf(_0xac578c);}})[_0x563a('0x4e')](function(_0x201c9d){return _0x3f2750(_0x201c9d);});});;});};function addVoicePrefixExtensions(_0x47d6cd,_0x34dd59){var _0x30bf2b=[];var _0x18a26b=formatPrefixName(_0x47d6cd[_0x563a('0x63')]);_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x2,_0x563a('0x69'),_0x563a('0x6a')+_0x47d6cd[_0x563a('0x31')]));if(_0x47d6cd['callerIdAll']){_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x3,_0x563a('0x69'),_0x563a('0x6b')+_0x47d6cd[_0x563a('0x6c')]));}else{_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x3,_0x563a('0x64'),_0x563a('0x6d')));}_0x30bf2b['push'](new Extension(_0x18a26b,0x4,_0x563a('0x6e'),_0x34dd59['context']+','+'${EXTEN:'+(0x8+_0x47d6cd['name'][_0x563a('0x3e')])+'}'+','+0x1));return _0x30bf2b;}function formatPrefixName(_0x4e4e60){var _0x529587='_';for(var _0x30d775=0x0;_0x30d775<_0x4e4e60[_0x563a('0x3e')];_0x30d775++){if(_0x4e4e60[_0x563a('0x6f')](_0x30d775)=='-'){_0x529587+=_0x4e4e60[_0x563a('0x6f')](_0x30d775);}else{_0x529587+='['+_0x4e4e60[_0x563a('0x6f')](_0x30d775)+']';}}_0x529587+='.';return _0x529587;}exports['update']=function(_0x4814b3,_0x4c9ad7,_0x39b8f8){var _0x8b2e10=_0x4814b3[_0x563a('0x56')];_0x8b2e10[_0x563a('0x63')]=_0x563a('0x70')+_0x8b2e10[_0x563a('0x31')]+'-';return db['sequelize'][_0x563a('0x71')](function(_0x43b2f1){return db['VoicePrefix'][_0x563a('0x28')](_0x8b2e10,{'where':{'id':_0x8b2e10['id']},'transaction':_0x43b2f1})[_0x563a('0x29')](function(){return db[_0x563a('0x66')]['destroy']({'where':{'VoicePrefixId':_0x8b2e10['id']},'transaction':_0x43b2f1})[_0x563a('0x29')](function(){return db[_0x563a('0x66')][_0x563a('0x53')]({'where':{'id':_0x8b2e10[_0x563a('0x57')]},'raw':!![]})['then'](function(_0x229690){return createVoicePrefixExtensions(_0x8b2e10,_0x229690,_0x43b2f1);});});});})[_0x563a('0x29')](function(){return db[_0x563a('0x4b')][_0x563a('0x72')](_0x8b2e10['id']);})[_0x563a('0x29')](respondWithResult(_0x4c9ad7,null))['catch'](handleError(_0x4c9ad7,null));};exports['addAgents']=function(_0x4346fe,_0x598a91,_0x46beba){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x4346fe[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x598a91,null))[_0x563a('0x29')](function(_0x3f66be){if(_0x3f66be){return _0x3f66be[_0x563a('0x73')](_0x4346fe[_0x563a('0x56')][_0x563a('0x74')],_['omit'](_0x4346fe[_0x563a('0x56')],['ids','id'])||{})[_0x563a('0x75')](function(_0x441933){for(var _0x54c512=0x0;_0x54c512<_0x4346fe[_0x563a('0x56')]['ids'][_0x563a('0x3e')];_0x54c512+=0x1){socket[_0x563a('0x76')]('userVoicePrefix:save',{'UserId':Number(_0x4346fe[_0x563a('0x56')][_0x563a('0x74')][_0x54c512]),'VoicePrefixId':Number(_0x4346fe[_0x563a('0x50')]['id'])});}return _0x441933;});}})[_0x563a('0x29')](respondWithResult(_0x598a91,null))['catch'](handleError(_0x598a91,null));};exports[_0x563a('0x77')]=function(_0x31faef,_0x17000b,_0x3cdfc1){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x31faef[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x17000b,null))[_0x563a('0x29')](function(_0x238ae4){if(_0x238ae4){return _0x238ae4['removeAgents'](_0x31faef[_0x563a('0x39')][_0x563a('0x74')])[_0x563a('0x29')](function(){if(_['isArray'](_0x31faef[_0x563a('0x39')][_0x563a('0x74')])){for(var _0x3dc800=0x0;_0x3dc800<_0x31faef[_0x563a('0x39')][_0x563a('0x74')][_0x563a('0x3e')];_0x3dc800+=0x1){socket[_0x563a('0x76')](_0x563a('0x78'),{'UserId':Number(_0x31faef[_0x563a('0x39')][_0x563a('0x74')][_0x3dc800]),'VoicePrefixId':Number(_0x31faef[_0x563a('0x50')]['id'])});}}else{socket[_0x563a('0x76')](_0x563a('0x78'),{'UserId':Number(_0x31faef['query'][_0x563a('0x74')]),'VoicePrefixId':Number(_0x31faef[_0x563a('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x17000b,null))[_0x563a('0x4e')](handleError(_0x17000b,null));};exports[_0x563a('0x79')]=function(_0x1ecca5,_0x162ab6,_0xf3ed04){var _0x44cbb4={};var _0x3a00b8={};var _0x9b753b;var _0x41898f;return db['VoicePrefix'][_0x563a('0x7a')]({'where':{'id':_0x1ecca5[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x162ab6,null))[_0x563a('0x29')](function(_0x4c5547){if(_0x4c5547){_0x9b753b=_0x4c5547;_0x3a00b8['model']=_['keys'](db[_0x563a('0x7b')][_0x563a('0x51')]);_0x3a00b8[_0x563a('0x39')]=_[_0x563a('0x52')](_0x1ecca5[_0x563a('0x39')]);_0x3a00b8[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x3a00b8[_0x563a('0x37')],_0x3a00b8[_0x563a('0x39')]);_0x44cbb4[_0x563a('0x3c')]=_['intersection'](_0x3a00b8[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x3d')]));_0x44cbb4[_0x563a('0x3c')]=_0x44cbb4[_0x563a('0x3c')][_0x563a('0x3e')]?_0x44cbb4[_0x563a('0x3c')]:_0x3a00b8[_0x563a('0x37')];_0x44cbb4[_0x563a('0x42')]=qs[_0x563a('0x43')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x43')]);_0x44cbb4['where']=qs[_0x563a('0x3a')](_[_0x563a('0x7c')](_0x1ecca5[_0x563a('0x39')],_0x3a00b8[_0x563a('0x3a')]));if(_0x1ecca5[_0x563a('0x39')][_0x563a('0x45')]){_0x44cbb4[_0x563a('0x44')]=_['merge'](_0x44cbb4[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x44cbb4[_0x563a('0x3c')],function(_0x562120){var _0x1e3b8c={};_0x1e3b8c[_0x562120]={'$like':'%'+_0x1ecca5[_0x563a('0x39')][_0x563a('0x45')]+'%'};return _0x1e3b8c;})});}_0x44cbb4=_[_0x563a('0x46')]({},_0x44cbb4,_0x1ecca5[_0x563a('0x48')]);return _0x9b753b[_0x563a('0x79')](_0x44cbb4);}})['then'](function(_0x2d46f5){if(_0x2d46f5){_0x41898f=_0x2d46f5[_0x563a('0x3e')];if(!_0x1ecca5[_0x563a('0x39')][_0x563a('0x3f')](_0x563a('0x40'))){_0x44cbb4['limit']=qs[_0x563a('0x41')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x41')]);_0x44cbb4[_0x563a('0x21')]=qs['offset'](_0x1ecca5[_0x563a('0x39')][_0x563a('0x21')]);}return _0x9b753b['getAgents'](_0x44cbb4);}})['then'](function(_0x458a21){if(_0x458a21){return _0x458a21?{'count':_0x41898f,'rows':_0x458a21}:null;}})[_0x563a('0x29')](respondWithResult(_0x162ab6,null))[_0x563a('0x4e')](handleError(_0x162ab6,null));};exports[_0x563a('0x7d')]=function(_0x241361,_0x31a58e,_0x1e324a){var _0x38857b={};var _0x43b6a2={};var _0x2385eb;var _0x36fe22;return db['VoicePrefix'][_0x563a('0x7a')]({'where':{'id':_0x241361[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x31a58e,null))['then'](function(_0x1dc77d){if(_0x1dc77d){_0x2385eb=_0x1dc77d;_0x43b6a2[_0x563a('0x37')]=_['keys'](db[_0x563a('0x7e')][_0x563a('0x51')]);_0x43b6a2[_0x563a('0x39')]=_[_0x563a('0x52')](_0x241361[_0x563a('0x39')]);_0x43b6a2[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x43b6a2[_0x563a('0x37')],_0x43b6a2['query']);_0x38857b[_0x563a('0x3c')]=_[_0x563a('0x3b')](_0x43b6a2[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x241361[_0x563a('0x39')]['fields']));_0x38857b[_0x563a('0x3c')]=_0x38857b['attributes']['length']?_0x38857b[_0x563a('0x3c')]:_0x43b6a2[_0x563a('0x37')];_0x38857b[_0x563a('0x42')]=qs[_0x563a('0x43')](_0x241361['query'][_0x563a('0x43')]);_0x38857b[_0x563a('0x44')]=qs['filters'](_[_0x563a('0x7c')](_0x241361['query'],_0x43b6a2[_0x563a('0x3a')]));if(_0x241361[_0x563a('0x39')][_0x563a('0x45')]){_0x38857b[_0x563a('0x44')]=_[_0x563a('0x46')](_0x38857b[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x38857b[_0x563a('0x3c')],function(_0x372e43){var _0x484953={};_0x484953[_0x372e43]={'$like':'%'+_0x241361[_0x563a('0x39')]['filter']+'%'};return _0x484953;})});}_0x38857b=_['merge']({},_0x38857b,_0x241361[_0x563a('0x48')]);return _0x2385eb[_0x563a('0x7d')](_0x38857b);}})['then'](function(_0x44859c){if(_0x44859c){_0x36fe22=_0x44859c[_0x563a('0x3e')];if(!_0x241361[_0x563a('0x39')][_0x563a('0x3f')](_0x563a('0x40'))){_0x38857b[_0x563a('0x41')]=qs[_0x563a('0x41')](_0x241361[_0x563a('0x39')]['limit']);_0x38857b[_0x563a('0x21')]=qs[_0x563a('0x21')](_0x241361['query'][_0x563a('0x21')]);}return _0x2385eb[_0x563a('0x7d')](_0x38857b);}})['then'](function(_0x38601a){if(_0x38601a){return _0x38601a?{'count':_0x36fe22,'rows':_0x38601a}:null;}})[_0x563a('0x29')](respondWithResult(_0x31a58e,null))[_0x563a('0x4e')](handleError(_0x31a58e,null));};exports['addTeams']=function(_0x10c81e,_0x4928de,_0x95bb77){var _0x33d74b=_0x10c81e[_0x563a('0x56')]['ids'];var _0x2d9810;return db['Team'][_0x563a('0x4c')]({'where':{'id':_0x33d74b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x563a('0x7f'),'attributes':['id',_0x563a('0x31'),_0x563a('0x80'),_0x563a('0x81'),_0x563a('0x82')],'raw':!![]}]})[_0x563a('0x29')](function(_0x2d2cb9){if(_0x2d2cb9){_0x2d9810=_0x2d2cb9;var _0x2c4b52=_[_0x563a('0x83')](_0x2d2cb9,function(_0x5c8df5){var _0x579601=_0x5c8df5[_0x563a('0x2b')]({'plain':!![]});return _0x579601[_0x563a('0x7f')];});return db['VoicePrefix'][_0x563a('0x53')]({'where':{'id':_0x10c81e[_0x563a('0x50')]['id']}})[_0x563a('0x29')](function(_0x1ebdd0){return db[_0x563a('0x84')][_0x563a('0x71')](function(_0x2a3bdd){return _0x1ebdd0['addTeams'](_0x33d74b,{'transaction':_0x2a3bdd})[_0x563a('0x29')](function(){return BPromise[_0x563a('0x85')](_0x2d9810,function(_0x28bbe5){return db[_0x563a('0x86')]['upsert']({'TeamId':_0x28bbe5['id'],'VoicePrefixId':_0x10c81e[_0x563a('0x50')]['id']},{'transaction':_0x2a3bdd});});})[_0x563a('0x29')](function(){return BPromise[_0x563a('0x85')](_0x2c4b52,function(_0x150fd6){return db[_0x563a('0x87')][_0x563a('0x88')]({'where':{'UserId':_0x150fd6['id'],'VoicePrefixId':_0x10c81e[_0x563a('0x50')]['id']},'transaction':_0x2a3bdd});});})[_0x563a('0x29')](function(){_0x2c4b52[_0x563a('0x89')](function(_0x3f78b7){socket[_0x563a('0x76')](_0x563a('0x8a'),{'UserId':_0x3f78b7['id'],'VoicePrefixId':_0x1ebdd0['id']});});});});});}})[_0x563a('0x29')](respondWithStatusCode(_0x4928de,null))[_0x563a('0x4e')](handleError(_0x4928de,null));};exports[_0x563a('0x8b')]=function(_0x115188,_0x713637,_0x12bb1b){return db[_0x563a('0x7e')][_0x563a('0x4c')]({'where':{'id':_0x115188[_0x563a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x563a('0x7b')],'as':_0x563a('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x563a('0x29')](handleEntityNotFound(_0x713637,null))[_0x563a('0x29')](function(_0xb9cbc9){var _0x42831f=_[_0x563a('0x38')](_0xb9cbc9,'id');var _0x5385e0=[];var _0x1d0ed4=[];var _0x14bc9e=squel[_0x563a('0x8c')]();_0x14bc9e[_0x563a('0x8d')](_0x563a('0x8e'))['from'](_0x563a('0x8f'),'tq')['join'](_0x563a('0x90'),'ut',_0x563a('0x91'))[_0x563a('0x44')]('VoicePrefixId\x20=\x20?',_0x115188[_0x563a('0x50')]['id']);for(var _0x25e5d1=0x0;_0x25e5d1<_0xb9cbc9[_0x563a('0x3e')];_0x25e5d1+=0x1){let _0x5ba698=_0xb9cbc9[_0x25e5d1];for(var _0x2dadc1=0x0;_0x2dadc1<_0x5ba698[_0x563a('0x7f')]['length'];_0x2dadc1+=0x1){let _0x55f64e=_0x5ba698[_0x563a('0x7f')][_0x2dadc1];var _0x41d0df=_0x14bc9e['clone']();_0x41d0df['where'](_0x563a('0x92'),_0x55f64e['id']);_0x1d0ed4['push'](db[_0x563a('0x84')][_0x563a('0x39')](_0x41d0df[_0x563a('0x93')](),{'type':db[_0x563a('0x84')][_0x563a('0x94')][_0x563a('0x95')]})[_0x563a('0x29')](function(_0xc24817){if(_0xc24817[_0x563a('0x3e')]===0x1){return _0x55f64e['id'];}else{var _0xd04cd=_[_0x563a('0x96')](_['map'](_0xc24817,'TeamId'),function(_0x571a84){return _[_0x563a('0x97')](_0x42831f,_0x571a84);});if(_0xd04cd){return _0x55f64e['id'];}}}));}}return BPromise[_0x563a('0x98')](_0x1d0ed4)[_0x563a('0x29')](function(_0x5244e5){_0x5385e0=_(_0x5385e0)['union'](_0x5244e5)[_0x563a('0x99')]()[_0x563a('0x9a')]();return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x115188[_0x563a('0x50')]['id']}})[_0x563a('0x29')](function(_0x23e33f){return db['sequelize'][_0x563a('0x71')](function(_0x25049d){return _0x23e33f[_0x563a('0x8b')](_0x115188[_0x563a('0x39')][_0x563a('0x74')],{'transaction':_0x25049d})[_0x563a('0x29')](function(){if(!_[_0x563a('0x9b')](_0x5385e0)){return _0x23e33f[_0x563a('0x77')](_0x5385e0,{'transaction':_0x25049d});}})[_0x563a('0x29')](function(){_0x5385e0[_0x563a('0x89')](function(_0x482d21){socket[_0x563a('0x76')]('userVoicePrefix:remove',{'UserId':_0x482d21,'VoicePrefixId':_0x23e33f['id']});});});});});});})[_0x563a('0x29')](respondWithStatusCode(_0x713637,null))[_0x563a('0x4e')](handleError(_0x713637,null));};
\ No newline at end of file
+var _0xfef3=['../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','VoicePrefixes','then','error','stack','name','index','map','VoicePrefix','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','hasOwnProperty','Team','Agents','online','interface','flatMap','each','TeamVoicePrefix','upsert','findOrCreate','forEach','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','value','isEmpty','eml-format','zip-dir','request-promise','moment','mustache','util','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'];(function(_0x3d878c,_0x3fa0d5){var _0x577980=function(_0x2b3205){while(--_0x2b3205){_0x3d878c['push'](_0x3d878c['shift']());}};_0x577980(++_0x3fa0d5);}(_0xfef3,0x118));var _0x3fef=function(_0x4d692a,_0x5c1506){_0x4d692a=_0x4d692a-0x0;var _0x9ef565=_0xfef3[_0x4d692a];return _0x9ef565;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];config['redis']=_[_0x3fef('0x19')](config[_0x3fef('0x1a')],{'host':_0x3fef('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fef('0x1a')]));require('./voicePrefix.socket')[_0x3fef('0x1c')](socket);function respondWithStatusCode(_0x14c053,_0x56a65d){_0x56a65d=_0x56a65d||0xcc;return function(_0x2dec1b){if(_0x2dec1b){return _0x14c053[_0x3fef('0x1d')](_0x56a65d);}return _0x14c053[_0x3fef('0x1e')](_0x56a65d)[_0x3fef('0x1f')]();};}function respondWithResult(_0x395df0,_0x2af1ba){_0x2af1ba=_0x2af1ba||0xc8;return function(_0x5c899f){if(_0x5c899f){return _0x395df0[_0x3fef('0x1e')](_0x2af1ba)[_0x3fef('0x20')](_0x5c899f);}};}function respondWithFilteredResult(_0x1ec282,_0x3f2997){return function(_0x1613ad){if(_0x1613ad){var _0xaa0ae3=typeof _0x3f2997['offset']===_0x3fef('0x21')&&typeof _0x3f2997[_0x3fef('0x22')]==='undefined';var _0x2c7f36=_0x1613ad[_0x3fef('0x23')];var _0x42e095=_0xaa0ae3?0x0:_0x3f2997[_0x3fef('0x24')];var _0x245332=_0xaa0ae3?_0x1613ad[_0x3fef('0x23')]:_0x3f2997[_0x3fef('0x24')]+_0x3f2997[_0x3fef('0x22')];var _0x124e7c;if(_0x245332>=_0x2c7f36){_0x245332=_0x2c7f36;_0x124e7c=0xc8;}else{_0x124e7c=0xce;}_0x1ec282[_0x3fef('0x1e')](_0x124e7c);return _0x1ec282[_0x3fef('0x25')](_0x3fef('0x26'),_0x42e095+'-'+_0x245332+'/'+_0x2c7f36)[_0x3fef('0x20')](_0x1613ad);}return null;};}function patchUpdates(_0x39a8ea){return function(_0x433a3e){try{jsonpatch['apply'](_0x433a3e,_0x39a8ea,!![]);}catch(_0x5b56de){return BPromise['reject'](_0x5b56de);}return _0x433a3e[_0x3fef('0x27')]();};}function saveUpdates(_0x3ba38d,_0xa16dc){return function(_0x5f047c){if(_0x5f047c){return _0x5f047c[_0x3fef('0x28')](_0x3ba38d)['then'](function(_0x45464b){return _0x45464b;});}return null;};}function removeEntity(_0x2c0848,_0x64d3e6){return function(_0xf2b269){if(_0xf2b269){return _0xf2b269[_0x3fef('0x29')]()['then'](function(){var _0x4b4dee=_0xf2b269['get']({'plain':!![]});var _0x121ff0=_0x3fef('0x2a');return db['UserProfileResource'][_0x3fef('0x29')]({'where':{'type':_0x121ff0,'resourceId':_0x4b4dee['id']}})[_0x3fef('0x2b')](function(){return _0xf2b269;});})['then'](function(){_0x2c0848[_0x3fef('0x1e')](0xcc)[_0x3fef('0x1f')]();});}};}function handleEntityNotFound(_0xf892bb,_0x2b73fb){return function(_0x3a1a0a){if(!_0x3a1a0a){_0xf892bb[_0x3fef('0x1d')](0x194);}return _0x3a1a0a;};}function handleError(_0x20abb6,_0x4a632c){_0x4a632c=_0x4a632c||0x1f4;return function(_0x34576a){logger[_0x3fef('0x2c')](_0x34576a[_0x3fef('0x2d')]);if(_0x34576a[_0x3fef('0x2e')]){delete _0x34576a['name'];}_0x20abb6[_0x3fef('0x1e')](_0x4a632c)['send'](_0x34576a);};}exports[_0x3fef('0x2f')]=function(_0x3c4483,_0x16009a){var _0x1136b3={},_0x10b803={},_0x464763={'count':0x0,'rows':[]};var _0x355c03=_[_0x3fef('0x30')](db[_0x3fef('0x31')][_0x3fef('0x32')],function(_0x4f1061){return{'name':_0x4f1061['fieldName'],'type':_0x4f1061[_0x3fef('0x33')]['key']};});_0x10b803[_0x3fef('0x34')]=_[_0x3fef('0x30')](_0x355c03,_0x3fef('0x2e'));_0x10b803[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x3c4483[_0x3fef('0x35')]);_0x10b803[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x10b803[_0x3fef('0x34')],_0x10b803[_0x3fef('0x35')]);_0x1136b3[_0x3fef('0x39')]=_[_0x3fef('0x38')](_0x10b803[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x3c4483['query'][_0x3fef('0x3a')]));_0x1136b3[_0x3fef('0x39')]=_0x1136b3[_0x3fef('0x39')][_0x3fef('0x3b')]?_0x1136b3[_0x3fef('0x39')]:_0x10b803[_0x3fef('0x34')];if(!_0x3c4483['query']['hasOwnProperty'](_0x3fef('0x3c'))){_0x1136b3[_0x3fef('0x22')]=qs[_0x3fef('0x22')](_0x3c4483[_0x3fef('0x35')][_0x3fef('0x22')]);_0x1136b3[_0x3fef('0x24')]=qs[_0x3fef('0x24')](_0x3c4483[_0x3fef('0x35')][_0x3fef('0x24')]);}_0x1136b3[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x3c4483['query'][_0x3fef('0x3e')]);_0x1136b3[_0x3fef('0x3f')]=qs['filters'](_['pick'](_0x3c4483[_0x3fef('0x35')],_0x10b803[_0x3fef('0x37')]),_0x355c03);if(_0x3c4483[_0x3fef('0x35')][_0x3fef('0x40')]){_0x1136b3[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x1136b3[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x355c03,function(_0x577ab8){if(_0x577ab8[_0x3fef('0x33')]!==_0x3fef('0x42')){var _0x2859db={};_0x2859db[_0x577ab8[_0x3fef('0x2e')]]={'$like':'%'+_0x3c4483[_0x3fef('0x35')][_0x3fef('0x40')]+'%'};return _0x2859db;}})});}_0x1136b3=_[_0x3fef('0x41')]({},_0x1136b3,_0x3c4483[_0x3fef('0x43')]);var _0x3df52b={'where':_0x1136b3[_0x3fef('0x3f')]};return db[_0x3fef('0x31')][_0x3fef('0x23')](_0x3df52b)[_0x3fef('0x2b')](function(_0x15d2c7){_0x464763[_0x3fef('0x23')]=_0x15d2c7;if(_0x3c4483['query'][_0x3fef('0x44')]){_0x1136b3[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x31')][_0x3fef('0x46')](_0x1136b3);})[_0x3fef('0x2b')](function(_0x33b145){_0x464763['rows']=_0x33b145;return _0x464763;})[_0x3fef('0x2b')](respondWithFilteredResult(_0x16009a,_0x1136b3))['catch'](handleError(_0x16009a,null));};exports[_0x3fef('0x47')]=function(_0x40a206,_0x59e3b0){var _0xa1a53d={'raw':![],'where':{'id':_0x40a206[_0x3fef('0x48')]['id']}},_0x4e662c={};_0x4e662c[_0x3fef('0x34')]=_[_0x3fef('0x36')](db[_0x3fef('0x31')][_0x3fef('0x32')]);_0x4e662c[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x40a206[_0x3fef('0x35')]);_0x4e662c[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x4e662c[_0x3fef('0x34')],_0x4e662c[_0x3fef('0x35')]);_0xa1a53d[_0x3fef('0x39')]=_['intersection'](_0x4e662c[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x40a206['query'][_0x3fef('0x3a')]));_0xa1a53d[_0x3fef('0x39')]=_0xa1a53d[_0x3fef('0x39')]['length']?_0xa1a53d[_0x3fef('0x39')]:_0x4e662c[_0x3fef('0x34')];if(_0x40a206['query'][_0x3fef('0x44')]){_0xa1a53d['include']=[{'all':!![]}];}_0xa1a53d=_['merge']({},_0xa1a53d,_0x40a206[_0x3fef('0x43')]);return db['VoicePrefix'][_0x3fef('0x49')](_0xa1a53d)[_0x3fef('0x2b')](handleEntityNotFound(_0x59e3b0,null))['then'](respondWithResult(_0x59e3b0,null))[_0x3fef('0x4a')](handleError(_0x59e3b0,null));};exports[_0x3fef('0x29')]=function(_0x2f8bb2,_0x5902b1){return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x2f8bb2[_0x3fef('0x48')]['id']}})['then'](handleEntityNotFound(_0x5902b1,null))[_0x3fef('0x2b')](removeEntity(_0x5902b1,null))[_0x3fef('0x4a')](handleError(_0x5902b1,null));};exports[_0x3fef('0x4b')]=function(_0x6a5321,_0x3ae6a7){return db['VoicePrefix'][_0x3fef('0x4b')]()[_0x3fef('0x2b')](respondWithResult(_0x3ae6a7,null))[_0x3fef('0x4a')](handleError(_0x3ae6a7,null));};exports[_0x3fef('0x4c')]=function(_0x3dc5b5,_0x15be93){var _0x3f9d35;return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x4862a5){return db['VoicePrefix'][_0x3fef('0x4c')](_0x3dc5b5[_0x3fef('0x4f')],{'transaction':_0x4862a5})[_0x3fef('0x2b')](function(_0x29c619){_0x3f9d35=_0x29c619[_0x3fef('0x50')]({'plain':!![]});return db[_0x3fef('0x51')][_0x3fef('0x49')]({'where':{'id':_0x3f9d35[_0x3fef('0x52')]},'raw':!![]})[_0x3fef('0x2b')](function(_0x36e054){return createVoicePrefixExtensions(_0x3f9d35,_0x36e054,_0x4862a5);});});})[_0x3fef('0x2b')](function(){var _0x109fac=_0x3dc5b5['user'][_0x3fef('0x50')]({'plain':!![]});if(!_0x109fac)throw new Error(_0x3fef('0x53'));if(_0x109fac[_0x3fef('0x54')]===_0x3fef('0x55')){var _0x5b0415=_0x3f9d35;return db[_0x3fef('0x56')][_0x3fef('0x49')]({'where':{'name':_0x3fef('0x2a'),'userProfileId':_0x109fac[_0x3fef('0x57')]},'raw':!![]})['then'](function(_0x189d48){if(_0x189d48&&_0x189d48[_0x3fef('0x58')]===0x0){return db[_0x3fef('0x59')]['create']({'name':_0x5b0415['name'],'resourceId':_0x5b0415['id'],'type':_0x189d48[_0x3fef('0x2e')],'sectionId':_0x189d48['id']},{})[_0x3fef('0x2b')](function(){return _0x3f9d35;});}else{return _0x3f9d35;}})[_0x3fef('0x4a')](function(_0x3370ef){logger['error'](_0x3fef('0x5a'),_0x3370ef);throw _0x3370ef;});}return _0x3f9d35;})['then'](respondWithResult(_0x15be93,null))[_0x3fef('0x4a')](handleError(_0x15be93,null));};function Extension(_0x48a329,_0x43b311,_0x4cc6de,_0x155fcb){this[_0x3fef('0x5b')]=_0x3fef('0x5c');this['exten']=_0x48a329;this['app']=_0x4cc6de;this[_0x3fef('0x33')]=_0x3fef('0x5d');this[_0x3fef('0x5e')]=_0x3fef('0x5f');this[_0x3fef('0x60')]=_0x43b311;this[_0x3fef('0x61')]=_0x155fcb;}function createVoicePrefixExtensions(_0x1095b6,_0x2b9a5e,_0x5493a8){return new BPromise(function(_0x12ffca,_0x4b6d74){var _0x5ec4e7=new Extension(formatPrefixName(_0x1095b6[_0x3fef('0x62')]),0x1,_0x3fef('0x63'),_0x3fef('0x64'));_0x5ec4e7[_0x3fef('0x65')]=_0x1095b6['id'];return db[_0x3fef('0x51')][_0x3fef('0x4c')](_0x5ec4e7,{'transaction':_0x5493a8})[_0x3fef('0x2b')](function(_0x187c0f){var _0x62e2c4=_0x187c0f['get']({'plain':!![]});var _0x2d36fd=_['map'](addVoicePrefixExtensions(_0x1095b6,_0x2b9a5e),function(_0xc01327){_0xc01327[_0x3fef('0x52')]=_0x62e2c4['id'];_0xc01327[_0x3fef('0x65')]=_0x1095b6['id'];return _0xc01327;});return db[_0x3fef('0x51')][_0x3fef('0x66')](_0x2d36fd,{'transaction':_0x5493a8})[_0x3fef('0x2b')](function(_0x4a4631){if(!_0x4a4631){return _0x4b6d74(_0x3fef('0x67'));}else{return _0x12ffca(_0x4a4631);}})[_0x3fef('0x4a')](function(_0x3e98fb){return _0x4b6d74(_0x3e98fb);});});;});};function addVoicePrefixExtensions(_0x200d07,_0x6cc4a3){var _0x40bd7e=[];var _0x10b869=formatPrefixName(_0x200d07[_0x3fef('0x62')]);_0x40bd7e[_0x3fef('0x68')](new Extension(_0x10b869,0x2,_0x3fef('0x69'),_0x3fef('0x6a')+_0x200d07['name']));if(_0x200d07[_0x3fef('0x6b')]){_0x40bd7e['push'](new Extension(_0x10b869,0x3,'Set','PREFIX-CALLERIDALL='+_0x200d07[_0x3fef('0x6b')]));}else{_0x40bd7e['push'](new Extension(_0x10b869,0x3,_0x3fef('0x63'),_0x3fef('0x6c')));}_0x40bd7e[_0x3fef('0x68')](new Extension(_0x10b869,0x4,'goto',_0x6cc4a3[_0x3fef('0x5b')]+','+'${EXTEN:'+(0x8+_0x200d07[_0x3fef('0x2e')][_0x3fef('0x3b')])+'}'+','+0x1));return _0x40bd7e;}function formatPrefixName(_0x51ea04){var _0x1d0ae0='_';for(var _0x458583=0x0;_0x458583<_0x51ea04[_0x3fef('0x3b')];_0x458583++){if(_0x51ea04[_0x3fef('0x6d')](_0x458583)=='-'){_0x1d0ae0+=_0x51ea04[_0x3fef('0x6d')](_0x458583);}else{_0x1d0ae0+='['+_0x51ea04[_0x3fef('0x6d')](_0x458583)+']';}}_0x1d0ae0+='.';return _0x1d0ae0;}exports[_0x3fef('0x28')]=function(_0x1362ce,_0x4fde10,_0x25467e){var _0x410951=_0x1362ce[_0x3fef('0x4f')];_0x410951[_0x3fef('0x62')]=_0x3fef('0x6e')+_0x410951[_0x3fef('0x2e')]+'-';return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0xaff567){return db[_0x3fef('0x31')][_0x3fef('0x28')](_0x410951,{'where':{'id':_0x410951['id']},'transaction':_0xaff567})[_0x3fef('0x2b')](function(){return db[_0x3fef('0x51')][_0x3fef('0x29')]({'where':{'VoicePrefixId':_0x410951['id']},'transaction':_0xaff567})['then'](function(){return db[_0x3fef('0x51')][_0x3fef('0x49')]({'where':{'id':_0x410951[_0x3fef('0x52')]},'raw':!![]})['then'](function(_0x5e430a){return createVoicePrefixExtensions(_0x410951,_0x5e430a,_0xaff567);});});});})['then'](function(){return db[_0x3fef('0x31')][_0x3fef('0x6f')](_0x410951['id']);})[_0x3fef('0x2b')](respondWithResult(_0x4fde10,null))[_0x3fef('0x4a')](handleError(_0x4fde10,null));};exports['addAgents']=function(_0x441f1f,_0x17856b,_0x2f9b5f){return db[_0x3fef('0x31')]['find']({'where':{'id':_0x441f1f[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x17856b,null))[_0x3fef('0x2b')](function(_0xf80bab){if(_0xf80bab){return _0xf80bab[_0x3fef('0x70')](_0x441f1f['body'][_0x3fef('0x71')],_['omit'](_0x441f1f[_0x3fef('0x4f')],['ids','id'])||{})[_0x3fef('0x72')](function(_0x13b272){for(var _0x2948c4=0x0;_0x2948c4<_0x441f1f[_0x3fef('0x4f')][_0x3fef('0x71')][_0x3fef('0x3b')];_0x2948c4+=0x1){socket[_0x3fef('0x73')](_0x3fef('0x74'),{'UserId':Number(_0x441f1f[_0x3fef('0x4f')]['ids'][_0x2948c4]),'VoicePrefixId':Number(_0x441f1f[_0x3fef('0x48')]['id'])});}return _0x13b272;});}})[_0x3fef('0x2b')](respondWithResult(_0x17856b,null))[_0x3fef('0x4a')](handleError(_0x17856b,null));};exports[_0x3fef('0x75')]=function(_0x4d8a00,_0x766e5d,_0x244d0b){return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x4d8a00[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x766e5d,null))['then'](function(_0x34aecb){if(_0x34aecb){return _0x34aecb[_0x3fef('0x75')](_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')])[_0x3fef('0x2b')](function(){if(_[_0x3fef('0x76')](_0x4d8a00['query'][_0x3fef('0x71')])){for(var _0x414bfe=0x0;_0x414bfe<_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')][_0x3fef('0x3b')];_0x414bfe+=0x1){socket['emit'](_0x3fef('0x77'),{'UserId':Number(_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')][_0x414bfe]),'VoicePrefixId':Number(_0x4d8a00['params']['id'])});}}else{socket[_0x3fef('0x73')](_0x3fef('0x77'),{'UserId':Number(_0x4d8a00[_0x3fef('0x35')]['ids']),'VoicePrefixId':Number(_0x4d8a00['params']['id'])});}});}})[_0x3fef('0x2b')](respondWithStatusCode(_0x766e5d,null))[_0x3fef('0x4a')](handleError(_0x766e5d,null));};exports[_0x3fef('0x78')]=function(_0x25914c,_0x573323,_0x169b33){var _0x1361d2={};var _0x29b668={};var _0x5bf8b7;var _0x1cddf6;return db[_0x3fef('0x31')][_0x3fef('0x79')]({'where':{'id':_0x25914c[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x573323,null))[_0x3fef('0x2b')](function(_0x277f65){if(_0x277f65){_0x5bf8b7=_0x277f65;_0x29b668['model']=_['keys'](db[_0x3fef('0x7a')]['rawAttributes']);_0x29b668[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x25914c[_0x3fef('0x35')]);_0x29b668['filters']=_[_0x3fef('0x38')](_0x29b668['model'],_0x29b668[_0x3fef('0x35')]);_0x1361d2['attributes']=_['intersection'](_0x29b668['model'],qs[_0x3fef('0x3a')](_0x25914c[_0x3fef('0x35')][_0x3fef('0x3a')]));_0x1361d2[_0x3fef('0x39')]=_0x1361d2[_0x3fef('0x39')][_0x3fef('0x3b')]?_0x1361d2[_0x3fef('0x39')]:_0x29b668['model'];_0x1361d2[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x25914c[_0x3fef('0x35')]['sort']);_0x1361d2[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x7b')](_0x25914c[_0x3fef('0x35')],_0x29b668['filters']));if(_0x25914c[_0x3fef('0x35')]['filter']){_0x1361d2[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x1361d2[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x1361d2[_0x3fef('0x39')],function(_0x1804a5){var _0x3100c3={};_0x3100c3[_0x1804a5]={'$like':'%'+_0x25914c[_0x3fef('0x35')]['filter']+'%'};return _0x3100c3;})});}_0x1361d2=_[_0x3fef('0x41')]({},_0x1361d2,_0x25914c['options']);return _0x5bf8b7['getAgents'](_0x1361d2);}})[_0x3fef('0x2b')](function(_0x1b9cdc){if(_0x1b9cdc){_0x1cddf6=_0x1b9cdc[_0x3fef('0x3b')];if(!_0x25914c[_0x3fef('0x35')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x1361d2[_0x3fef('0x22')]=qs[_0x3fef('0x22')](_0x25914c[_0x3fef('0x35')]['limit']);_0x1361d2[_0x3fef('0x24')]=qs[_0x3fef('0x24')](_0x25914c[_0x3fef('0x35')][_0x3fef('0x24')]);}return _0x5bf8b7[_0x3fef('0x78')](_0x1361d2);}})['then'](function(_0x27fd0b){if(_0x27fd0b){return _0x27fd0b?{'count':_0x1cddf6,'rows':_0x27fd0b}:null;}})[_0x3fef('0x2b')](respondWithResult(_0x573323,null))[_0x3fef('0x4a')](handleError(_0x573323,null));};exports[_0x3fef('0x7c')]=function(_0x14e142,_0x5894f5,_0xe6a6b7){var _0x26b1c0={};var _0x2000b2={};var _0x44310b;var _0x400fff;return db['VoicePrefix'][_0x3fef('0x79')]({'where':{'id':_0x14e142[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x5894f5,null))[_0x3fef('0x2b')](function(_0x1a5f47){if(_0x1a5f47){_0x44310b=_0x1a5f47;_0x2000b2[_0x3fef('0x34')]=_['keys'](db['Team']['rawAttributes']);_0x2000b2['query']=_['keys'](_0x14e142[_0x3fef('0x35')]);_0x2000b2[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x2000b2[_0x3fef('0x34')],_0x2000b2[_0x3fef('0x35')]);_0x26b1c0['attributes']=_[_0x3fef('0x38')](_0x2000b2[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x3a')]));_0x26b1c0[_0x3fef('0x39')]=_0x26b1c0[_0x3fef('0x39')]['length']?_0x26b1c0[_0x3fef('0x39')]:_0x2000b2['model'];_0x26b1c0[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x3e')]);_0x26b1c0[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x7b')](_0x14e142['query'],_0x2000b2['filters']));if(_0x14e142['query']['filter']){_0x26b1c0[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x26b1c0[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x26b1c0[_0x3fef('0x39')],function(_0x580a23){var _0x8d6d0e={};_0x8d6d0e[_0x580a23]={'$like':'%'+_0x14e142[_0x3fef('0x35')][_0x3fef('0x40')]+'%'};return _0x8d6d0e;})});}_0x26b1c0=_['merge']({},_0x26b1c0,_0x14e142[_0x3fef('0x43')]);return _0x44310b[_0x3fef('0x7c')](_0x26b1c0);}})['then'](function(_0x59654f){if(_0x59654f){_0x400fff=_0x59654f[_0x3fef('0x3b')];if(!_0x14e142['query'][_0x3fef('0x7d')](_0x3fef('0x3c'))){_0x26b1c0['limit']=qs[_0x3fef('0x22')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x22')]);_0x26b1c0['offset']=qs[_0x3fef('0x24')](_0x14e142[_0x3fef('0x35')]['offset']);}return _0x44310b[_0x3fef('0x7c')](_0x26b1c0);}})[_0x3fef('0x2b')](function(_0xb08e2c){if(_0xb08e2c){return _0xb08e2c?{'count':_0x400fff,'rows':_0xb08e2c}:null;}})[_0x3fef('0x2b')](respondWithResult(_0x5894f5,null))['catch'](handleError(_0x5894f5,null));};exports['addTeams']=function(_0x91a872,_0x5ce3d8,_0x15cc4f){var _0x11a3d3=_0x91a872[_0x3fef('0x4f')][_0x3fef('0x71')];var _0x4e4a3c;return db[_0x3fef('0x7e')][_0x3fef('0x46')]({'where':{'id':_0x11a3d3},'attributes':['id'],'include':[{'model':db[_0x3fef('0x7a')],'as':_0x3fef('0x7f'),'attributes':['id','name',_0x3fef('0x80'),'voicePause',_0x3fef('0x81')],'raw':!![]}]})[_0x3fef('0x2b')](function(_0x578303){if(_0x578303){_0x4e4a3c=_0x578303;var _0x4c575a=_[_0x3fef('0x82')](_0x578303,function(_0xee8848){var _0x5089f2=_0xee8848[_0x3fef('0x50')]({'plain':!![]});return _0x5089f2[_0x3fef('0x7f')];});return db['VoicePrefix']['find']({'where':{'id':_0x91a872[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](function(_0x5e5b34){return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x14c4bb){return _0x5e5b34['addTeams'](_0x11a3d3,{'transaction':_0x14c4bb})[_0x3fef('0x2b')](function(){return BPromise[_0x3fef('0x83')](_0x4e4a3c,function(_0x349180){return db[_0x3fef('0x84')][_0x3fef('0x85')]({'TeamId':_0x349180['id'],'VoicePrefixId':_0x91a872['params']['id']},{'transaction':_0x14c4bb});});})[_0x3fef('0x2b')](function(){return BPromise[_0x3fef('0x83')](_0x4c575a,function(_0x45ab57){return db['UserVoicePrefix'][_0x3fef('0x86')]({'where':{'UserId':_0x45ab57['id'],'VoicePrefixId':_0x91a872['params']['id']},'transaction':_0x14c4bb});});})['then'](function(){_0x4c575a[_0x3fef('0x87')](function(_0x1d43ba){socket['emit'](_0x3fef('0x74'),{'UserId':_0x1d43ba['id'],'VoicePrefixId':_0x5e5b34['id']});});});});});}})[_0x3fef('0x2b')](respondWithStatusCode(_0x5ce3d8,null))['catch'](handleError(_0x5ce3d8,null));};exports['removeTeams']=function(_0x373a45,_0x1a792b,_0x34e182){return db['Team'][_0x3fef('0x46')]({'where':{'id':_0x373a45[_0x3fef('0x35')][_0x3fef('0x71')]},'attributes':['id'],'include':[{'model':db[_0x3fef('0x7a')],'as':_0x3fef('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x3fef('0x2b')](handleEntityNotFound(_0x1a792b,null))[_0x3fef('0x2b')](function(_0x114585){var _0x4725dd=_[_0x3fef('0x30')](_0x114585,'id');var _0x3b9285=[];var _0x550ba3=[];var _0x778837=squel[_0x3fef('0x88')]();_0x778837[_0x3fef('0x89')](_0x3fef('0x8a'))['from'](_0x3fef('0x8b'),'tq')[_0x3fef('0x8c')](_0x3fef('0x8d'),'ut',_0x3fef('0x8e'))['where']('VoicePrefixId\x20=\x20?',_0x373a45[_0x3fef('0x48')]['id']);for(var _0x9110ca=0x0;_0x9110ca<_0x114585[_0x3fef('0x3b')];_0x9110ca+=0x1){let _0x2bb28c=_0x114585[_0x9110ca];for(var _0x99fa04=0x0;_0x99fa04<_0x2bb28c['Agents'][_0x3fef('0x3b')];_0x99fa04+=0x1){let _0x2aa67e=_0x2bb28c['Agents'][_0x99fa04];var _0x541b46=_0x778837[_0x3fef('0x8f')]();_0x541b46[_0x3fef('0x3f')](_0x3fef('0x90'),_0x2aa67e['id']);_0x550ba3[_0x3fef('0x68')](db[_0x3fef('0x4d')][_0x3fef('0x35')](_0x541b46['toString'](),{'type':db['sequelize'][_0x3fef('0x91')]['SELECT']})[_0x3fef('0x2b')](function(_0x18afc9){if(_0x18afc9[_0x3fef('0x3b')]===0x1){return _0x2aa67e['id'];}else{var _0x5b6489=_[_0x3fef('0x92')](_[_0x3fef('0x30')](_0x18afc9,_0x3fef('0x93')),function(_0x259fc1){return _['includes'](_0x4725dd,_0x259fc1);});if(_0x5b6489){return _0x2aa67e['id'];}}}));}}return BPromise[_0x3fef('0x94')](_0x550ba3)[_0x3fef('0x2b')](function(_0x37b1a3){_0x3b9285=_(_0x3b9285)[_0x3fef('0x95')](_0x37b1a3)['compact']()[_0x3fef('0x96')]();return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x373a45[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](function(_0x446bab){return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x2eddc5){return _0x446bab['removeTeams'](_0x373a45['query'][_0x3fef('0x71')],{'transaction':_0x2eddc5})[_0x3fef('0x2b')](function(){if(!_[_0x3fef('0x97')](_0x3b9285)){return _0x446bab[_0x3fef('0x75')](_0x3b9285,{'transaction':_0x2eddc5});}})['then'](function(){_0x3b9285[_0x3fef('0x87')](function(_0x2e642d){socket[_0x3fef('0x73')]('userVoicePrefix:remove',{'UserId':_0x2e642d,'VoicePrefixId':_0x446bab['id']});});});});});});})[_0x3fef('0x2b')](respondWithStatusCode(_0x1a792b,null))['catch'](handleError(_0x1a792b,null));};
\ No newline at end of file
index d6b170e..ea42e37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb604=['save','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0xc33411,_0x28f6e0){var _0x19c930=function(_0x4a0337){while(--_0x4a0337){_0xc33411['push'](_0xc33411['shift']());}};_0x19c930(++_0x28f6e0);}(_0xb604,0x14c));var _0x4b60=function(_0x55e11c,_0x463a84){_0x55e11c=_0x55e11c-0x0;var _0xf006c5=_0xb604[_0x55e11c];return _0xf006c5;};'use strict';var EventEmitter=require(_0x4b60('0x0'));var VoicePrefix=require(_0x4b60('0x1'))['db'][_0x4b60('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4b60('0x3')](0x0);var events={'afterCreate':_0x4b60('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x177589){return function(_0x8c584c,_0xeca0ac,_0x188145){VoicePrefixEvents['emit'](_0x177589+':'+_0x8c584c['id'],_0x8c584c);VoicePrefixEvents['emit'](_0x177589,_0x8c584c);_0x188145(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x4b60('0x5')](e,emitEvent(event));}}module[_0x4b60('0x6')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x01a2=['hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','remove','emit'];(function(_0xcf638,_0x29002d){var _0x38d848=function(_0x287c76){while(--_0x287c76){_0xcf638['push'](_0xcf638['shift']());}};_0x38d848(++_0x29002d);}(_0x01a2,0x183));var _0x201a=function(_0xfb46fb,_0x1b4a8d){_0xfb46fb=_0xfb46fb-0x0;var _0x256191=_0x01a2[_0xfb46fb];return _0x256191;};'use strict';var EventEmitter=require(_0x201a('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x201a('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x201a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x201a('0x3')};function emitEvent(_0x41ee5b){return function(_0xb3ed25,_0x4440c8,_0x43e0cb){VoicePrefixEvents[_0x201a('0x4')](_0x41ee5b+':'+_0xb3ed25['id'],_0xb3ed25);VoicePrefixEvents[_0x201a('0x4')](_0x41ee5b,_0xb3ed25);_0x43e0cb(null);};}for(var e in events){if(events[_0x201a('0x5')](e)){var event=events[e];VoicePrefix[_0x201a('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index d3bbda7..d58955e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x666d=['voice_prefixes','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix'];(function(_0x33f254,_0x20b21f){var _0x113e8b=function(_0x2dd028){while(--_0x2dd028){_0x33f254['push'](_0x33f254['shift']());}};_0x113e8b(++_0x20b21f);}(_0x666d,0xf1));var _0xd666=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x666d[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0xd666('0x0'));var logger=require('../../config/logger')(_0xd666('0x1'));var moment=require(_0xd666('0x2'));var BPromise=require(_0xd666('0x3'));var rp=require(_0xd666('0x4'));var fs=require('fs');var path=require(_0xd666('0x5'));var rimraf=require(_0xd666('0x6'));var config=require(_0xd666('0x7'));var attributes=require(_0xd666('0x8'));module[_0xd666('0x9')]=function(_0x4dd46f,_0x28e42b){return _0x4dd46f['define'](_0xd666('0xa'),attributes,{'tableName':_0xd666('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8041=['rimraf','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x8041,0xd5));var _0x1804=function(_0x552c4d,_0x277237){_0x552c4d=_0x552c4d-0x0;var _0x3e8064=_0x8041[_0x552c4d];return _0x3e8064;};'use strict';var _=require(_0x1804('0x0'));var util=require(_0x1804('0x1'));var logger=require(_0x1804('0x2'))(_0x1804('0x3'));var moment=require(_0x1804('0x4'));var BPromise=require(_0x1804('0x5'));var rp=require(_0x1804('0x6'));var fs=require('fs');var path=require(_0x1804('0x7'));var rimraf=require(_0x1804('0x8'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x1804('0x9')]=function(_0x509173,_0x4de13e){return _0x509173[_0x1804('0xa')](_0x1804('0xb'),attributes,{'tableName':_0x1804('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd75280..b543f7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x720b=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0x720b,0x1d8));var _0xb720=function(_0xc4c57d,_0x1c1da7){_0xc4c57d=_0xc4c57d-0x0;var _0x5e4fe8=_0x720b[_0xc4c57d];return _0x5e4fe8;};'use strict';var _=require(_0xb720('0x0'));var util=require(_0xb720('0x1'));var moment=require(_0xb720('0x2'));var BPromise=require('bluebird');var rs=require(_0xb720('0x3'));var fs=require('fs');var Redis=require(_0xb720('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb720('0x5'));var logger=require(_0xb720('0x6'))(_0xb720('0x7'));var config=require('../../config/environment');var jayson=require(_0xb720('0x8'));var client=jayson[_0xb720('0x9')][_0xb720('0xa')]({'port':0x232a});config[_0xb720('0xb')]=_[_0xb720('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb720('0xd'))(new Redis(config[_0xb720('0xb')]));require(_0xb720('0xe'))[_0xb720('0xf')](socket);function respondWithRpcPromise(_0x4351eb,_0x141d72,_0x2b66ef){return new BPromise(function(_0x2922c7,_0x4e7422){return client[_0xb720('0x10')](_0x4351eb,_0x2b66ef)[_0xb720('0x11')](function(_0x5384e6){logger[_0xb720('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x141d72,_0xb720('0x13'));logger['debug'](_0xb720('0x14'),_0x141d72,_0xb720('0x13'),JSON[_0xb720('0x15')](_0x5384e6));if(_0x5384e6[_0xb720('0x16')]){if(_0x5384e6[_0xb720('0x16')][_0xb720('0x17')]===0x1f4){logger[_0xb720('0x16')](_0xb720('0x18'),_0x141d72,_0x5384e6['error'][_0xb720('0x19')]);return _0x4e7422(_0x5384e6[_0xb720('0x16')][_0xb720('0x19')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x141d72,_0x5384e6[_0xb720('0x16')][_0xb720('0x19')]);return _0x2922c7(_0x5384e6[_0xb720('0x16')]['message']);}else{logger[_0xb720('0x12')](_0xb720('0x18'),_0x141d72,_0xb720('0x13'));_0x2922c7(_0x5384e6[_0xb720('0x1a')][_0xb720('0x19')]);}})[_0xb720('0x1b')](function(_0x4203ce){logger[_0xb720('0x16')](_0xb720('0x18'),_0x141d72,_0x4203ce);_0x4e7422(_0x4203ce);});});}
\ No newline at end of file
+var _0xe61c=['message','info','request\x20sent','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x691548,_0x5b2a79){var _0x25ebd9=function(_0x537ff0){while(--_0x537ff0){_0x691548['push'](_0x691548['shift']());}};_0x25ebd9(++_0x5b2a79);}(_0xe61c,0xee));var _0xce61=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0xe61c[_0x289e64];return _0x30246c;};'use strict';var _=require(_0xce61('0x0'));var util=require('util');var moment=require(_0xce61('0x1'));var BPromise=require(_0xce61('0x2'));var rs=require(_0xce61('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xce61('0x4'));var logger=require('../../config/logger')(_0xce61('0x5'));var config=require(_0xce61('0x6'));var jayson=require(_0xce61('0x7'));var client=jayson[_0xce61('0x8')][_0xce61('0x9')]({'port':0x232a});config[_0xce61('0xa')]=_[_0xce61('0xb')](config['redis'],{'host':_0xce61('0xc'),'port':0x18eb});var socket=require(_0xce61('0xd'))(new Redis(config[_0xce61('0xa')]));require(_0xce61('0xe'))[_0xce61('0xf')](socket);function respondWithRpcPromise(_0x2b227f,_0x194398,_0x4c5b02){return new BPromise(function(_0x64a2fd,_0x3f764d){return client['request'](_0x2b227f,_0x4c5b02)[_0xce61('0x10')](function(_0x30f2cb){logger['info'](_0xce61('0x11'),_0x194398,'request\x20sent');logger[_0xce61('0x12')](_0xce61('0x13'),_0x194398,'request\x20sent',JSON[_0xce61('0x14')](_0x30f2cb));if(_0x30f2cb['error']){if(_0x30f2cb[_0xce61('0x15')]['code']===0x1f4){logger[_0xce61('0x15')](_0xce61('0x11'),_0x194398,_0x30f2cb[_0xce61('0x15')][_0xce61('0x16')]);return _0x3f764d(_0x30f2cb[_0xce61('0x15')]['message']);}logger['error'](_0xce61('0x11'),_0x194398,_0x30f2cb['error']['message']);return _0x64a2fd(_0x30f2cb[_0xce61('0x15')][_0xce61('0x16')]);}else{logger[_0xce61('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x194398,_0xce61('0x18'));_0x64a2fd(_0x30f2cb['result'][_0xce61('0x16')]);}})[_0xce61('0x19')](function(_0x4216c4){logger[_0xce61('0x15')](_0xce61('0x11'),_0x194398,_0x4216c4);_0x3f764d(_0x4216c4);});});}
\ No newline at end of file
index ff71dfd..f21f8ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2948=['save','remove','update','emit','removeListener','./voicePrefix.events'];(function(_0xab1c1c,_0x4878c4){var _0x2f834f=function(_0x18d3f6){while(--_0x18d3f6){_0xab1c1c['push'](_0xab1c1c['shift']());}};_0x2f834f(++_0x4878c4);}(_0x2948,0xcb));var _0x8294=function(_0x5b5f00,_0xa163b4){_0x5b5f00=_0x5b5f00-0x0;var _0x295cd3=_0x2948[_0x5b5f00];return _0x295cd3;};'use strict';var VoicePrefixEvents=require(_0x8294('0x0'));var events=[_0x8294('0x1'),_0x8294('0x2'),_0x8294('0x3')];function createListener(_0x8e99bd,_0xbbaec1){return function(_0xcb5eea){_0xbbaec1[_0x8294('0x4')](_0x8e99bd,_0xcb5eea);};}function removeListener(_0x3ac253,_0x4bddff){return function(){VoicePrefixEvents[_0x8294('0x5')](_0x3ac253,_0x4bddff);};}exports['register']=function(_0x11c415){for(var _0x26128c=0x0,_0x39aa65=events['length'];_0x26128c<_0x39aa65;_0x26128c++){var _0x5a7135=events[_0x26128c];var _0x56f7c8=createListener('voicePrefix:'+_0x5a7135,_0x11c415);VoicePrefixEvents['on'](_0x5a7135,_0x56f7c8);}};
\ No newline at end of file
+var _0x38a5=['length','./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x1d0458,_0x4ed6d4){var _0x2fad3c=function(_0x44b181){while(--_0x44b181){_0x1d0458['push'](_0x1d0458['shift']());}};_0x2fad3c(++_0x4ed6d4);}(_0x38a5,0x69));var _0x538a=function(_0x48efb0,_0xd20d4f){_0x48efb0=_0x48efb0-0x0;var _0x3fcab8=_0x38a5[_0x48efb0];return _0x3fcab8;};'use strict';var VoicePrefixEvents=require(_0x538a('0x0'));var events=[_0x538a('0x1'),_0x538a('0x2'),_0x538a('0x3')];function createListener(_0x4d5f33,_0x50b5e2){return function(_0x2c3a52){_0x50b5e2[_0x538a('0x4')](_0x4d5f33,_0x2c3a52);};}function removeListener(_0x31a6bd,_0x22163a){return function(){VoicePrefixEvents[_0x538a('0x5')](_0x31a6bd,_0x22163a);};}exports[_0x538a('0x6')]=function(_0x16ab09){for(var _0x1e3587=0x0,_0x3fcf5b=events[_0x538a('0x7')];_0x1e3587<_0x3fcf5b;_0x1e3587++){var _0x3d4e22=events[_0x1e3587];var _0x6eed8e=createListener('voicePrefix:'+_0x3d4e22,_0x16ab09);VoicePrefixEvents['on'](_0x3d4e22,_0x6eed8e);}};
\ No newline at end of file
index 91796a8..62a345c 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(_0xd6c010,_0x5355e6){var _0x15893b=function(_0x1b0a5a){while(--_0x1b0a5a){_0xd6c010['push'](_0xd6c010['shift']());}};_0x15893b(++_0x5355e6);}(_0xb10b,0x12a));var _0xbb10=function(_0x271a95,_0x4d2a07){_0x271a95=_0x271a95-0x0;var _0x3fa489=_0xb10b[_0x271a95];return _0x3fa489;};'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 _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(_0x1e5068,_0x31e9c4){var _0x2230b6=function(_0xaa2ee){while(--_0xaa2ee){_0x1e5068['push'](_0x1e5068['shift']());}};_0x2230b6(++_0x31e9c4);}(_0xb10b,0x12a));var _0xbb10=function(_0x21d0d7,_0x4c55a3){_0x21d0d7=_0x21d0d7-0x0;var _0x5e725b=_0xb10b[_0x21d0d7];return _0x5e725b;};'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
index ca92396..c9a728c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf87b=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','inbound','outbound','default','leastrecent','random','rrmemory','linear','wrandom','ringall','setDataValue','strategy','type','getDataValue','booked','roundrobin','progressive','predictive','INTEGER','ENUM','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf87b,0x1cf));var _0xbf87=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf87b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xbf87('0x0'));module[_0xbf87('0x1')]={'name':{'type':Sequelize[_0xbf87('0x2')],'allowNull':![],'unique':_0xbf87('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xbf87('0x4'),_0xbf87('0x5')),'allowNull':![],'defaultValue':_0xbf87('0x4')},'musiconhold':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':_0xbf87('0x6')},'announce':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0xbf87('0x7'),'fewestcalls',_0xbf87('0x8'),_0xbf87('0x9'),_0xbf87('0xa'),_0xbf87('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0xbf87('0xc'),'set':function(_0x15ee23){this[_0xbf87('0xd')](_0xbf87('0xe'),_0x15ee23?_0x15ee23:'rrmemory');},'get':function(){var _0x574053=this['getDataValue'](_0xbf87('0xf'));var _0x52f84d=this[_0xbf87('0x10')]('dialMethod');var _0x34bb39=this['getDataValue'](_0xbf87('0xe'));if(_0x574053==='inbound'){return _0x34bb39;}if(_0x52f84d===_0xbf87('0x11')&&_0x34bb39===_0xbf87('0x9')||_0x52f84d===_0xbf87('0x11')&&_0x34bb39===_0xbf87('0x12')){return _0x34bb39;}if(_0x52f84d===_0xbf87('0x13')||_0x52f84d===_0xbf87('0x14')||_0x52f84d==='power'){return _0x34bb39;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xbf87('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xbf87('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xbf87('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xbf87('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x17'),'no'),'defaultValue':_0xbf87('0x17')},'autopause':{'type':Sequelize['ENUM'](_0xbf87('0x17'),'no',_0xbf87('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xbf87('0x16')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xbf87('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xbf87('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xbf87('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xbf87('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x17'),'no',_0xbf87('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xbf87('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xbf87('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xbf87('0x2')]},'queue_youarenext':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xbf87('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xbf87('0x2')]},'queue_quantity1':{'type':Sequelize[_0xbf87('0x2')]},'queue_quantity2':{'type':Sequelize[_0xbf87('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xbf87('0x1a')],'set':function(_0x54c4de){this[_0xbf87('0xd')](_0xbf87('0x1b'),_0x54c4de?_0x54c4de[_0xbf87('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0xbf87('0x1b'))?this['getDataValue'](_0xbf87('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':_0xbf87('0x17'),'set':function(_0x484e9c){this[_0xbf87('0xd')](_0xbf87('0x1d'),_0x484e9c?_0x484e9c[_0xbf87('0x1c')](','):undefined);},'get':function(){return this[_0xbf87('0x10')](_0xbf87('0x1d'))?this[_0xbf87('0x10')]('joinempty')[_0xbf87('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x3e8d79){this[_0xbf87('0xd')](_0xbf87('0x1f'),_0x3e8d79?_0x3e8d79[_0xbf87('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0xbf87('0x1f'))?this[_0xbf87('0x10')](_0xbf87('0x1f'))[_0xbf87('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xbf87('0x16')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xbf87('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xbf87('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xbf87('0x2')]},'description':{'type':Sequelize[_0xbf87('0x2')]},'acw':{'type':Sequelize[_0xbf87('0x20')],'defaultValue':0x0,'set':function(_0x432673){this[_0xbf87('0xd')](_0xbf87('0x21'),_0x432673);if(_0x432673){if(this[_0xbf87('0x10')](_0xbf87('0x22'))<0x2){this[_0xbf87('0xd')](_0xbf87('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xbf87('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xbf87('0x20')],'defaultValue':0x0,'comment':_0xbf87('0x23')},'dialMethod':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x24'),'progressive',_0xbf87('0x25'),'predictive',_0xbf87('0x11')),'defaultValue':_0xbf87('0x13'),'comment':_0xbf87('0x26')},'dialLimitChannel':{'type':Sequelize[_0xbf87('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xbf87('0x27')},'dialLimitQueue':{'type':Sequelize[_0xbf87('0x15')](0x4)[_0xbf87('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xbf87('0x29')},'dialPowerLevel':{'type':Sequelize[_0xbf87('0x2a')](0x2)[_0xbf87('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xbf87('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0xbf87('0x16')]('agentBusyFactor',_0xbf87('0x2c')),'defaultValue':_0xbf87('0x2c'),'comment':_0xbf87('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xbf87('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xbf87('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xbf87('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbf87('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbf87('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':_0xbf87('0x30'),'comment':_0xbf87('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf87('0x32')},'dialQueueProject':{'type':Sequelize[_0xbf87('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf87('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf87('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbf87('0x15')](0x5)[_0xbf87('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf87('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0xbf87('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf87('0x35')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf87('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf87('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'defaultValue':0x3,'comment':_0xbf87('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbf87('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf87('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbf87('0x39')},'dialTimezone':{'type':Sequelize[_0xbf87('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xbf87('0x3a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xbf87('0x16')](_0xbf87('0x3b'),_0xbf87('0x3c'),_0xbf87('0x3d')),'defaultValue':_0xbf87('0x3b')},'dialAMDActive':{'type':Sequelize[_0xbf87('0x20')],'defaultValue':0x0,'comment':_0xbf87('0x3e')},'dialAMDInitialSilence':{'type':Sequelize[_0xbf87('0x15')](0x9)[_0xbf87('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbf87('0x3f')},'dialAMDGreeting':{'type':Sequelize[_0xbf87('0x15')](0x9)[_0xbf87('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbf87('0x40')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbf87('0x15')](0x9)[_0xbf87('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbf87('0x41')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbf87('0x15')](0x9)[_0xbf87('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xbf87('0x15')](0x9)[_0xbf87('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbf87('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbf87('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbf87('0x43')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xbf87('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbf87('0x44')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbf87('0x15')](0x5)[_0xbf87('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbf87('0x45')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbf87('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbf87('0x46')},'dialRecallMeTimeout':{'type':Sequelize[_0xbf87('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xbf87('0x47')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbf87('0x48')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xbf87('0x49'),_0xbf87('0x4a')),'defaultValue':_0xbf87('0x49')},'dialQueueProject2':{'type':Sequelize[_0xbf87('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xbf87('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf87('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf87('0x4b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbf87('0x15')](0x5)[_0xbf87('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf87('0x4c')},'dialDropMaxRetry':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf87('0x4d')},'dialDropRetryFrequency':{'type':Sequelize[_0xbf87('0x15')](0x5)[_0xbf87('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf87('0x4e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf87('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf87('0x4f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbf87('0x15')](0x5)[_0xbf87('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf87('0x50')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbf87('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf87('0x51')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf87('0x52')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbf87('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbf87('0x53')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbf87('0x15')](0x5)[_0xbf87('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbf87('0x54')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xbf87('0x55')},'mandatoryDisposition':{'type':Sequelize[_0xbf87('0x20')],'defaultValue':![],'comment':_0xbf87('0x56'),'set':function(_0x3abb21){if(!_0x3abb21)this[_0xbf87('0xd')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xbf87('0x57'),_0x3abb21);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xbf87('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xbf87('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xbf87('0x15')](0x3)[_0xbf87('0x28')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xbf87('0x20')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1639=['random','rrmemory','linear','type','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','ENUM','yes','all','once','TEXT','periodic_announce','split','setDataValue','joinempty','join','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\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)','07:00-22:00,*,*,*','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','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)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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','mandatoryDisposition','sequelize','exports','name','outbound','inbound','STRING','default','ringall','fewestcalls'];(function(_0x358fb5,_0x4407b8){var _0x4abfeb=function(_0x55c45d){while(--_0x55c45d){_0x358fb5['push'](_0x358fb5['shift']());}};_0x4abfeb(++_0x4407b8);}(_0x1639,0x127));var _0x9163=function(_0x5f2b6d,_0x33b15b){_0x5f2b6d=_0x5f2b6d-0x0;var _0x44b017=_0x1639[_0x5f2b6d];return _0x44b017;};'use strict';var Sequelize=require(_0x9163('0x0'));module[_0x9163('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9163('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x9163('0x3')),'allowNull':![],'defaultValue':_0x9163('0x4')},'musiconhold':{'type':Sequelize[_0x9163('0x5')],'defaultValue':_0x9163('0x6')},'announce':{'type':Sequelize[_0x9163('0x5')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x9163('0x7'),'leastrecent',_0x9163('0x8'),_0x9163('0x9'),_0x9163('0xa'),_0x9163('0xb'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x1d86a2){this['setDataValue']('strategy',_0x1d86a2?_0x1d86a2:_0x9163('0xa'));},'get':function(){var _0x19b4b2=this['getDataValue'](_0x9163('0xc'));var _0x369c6c=this[_0x9163('0xd')](_0x9163('0xe'));var _0x52f792=this[_0x9163('0xd')]('strategy');if(_0x19b4b2===_0x9163('0x4')){return _0x52f792;}if(_0x369c6c===_0x9163('0xf')&&_0x52f792===_0x9163('0xa')||_0x369c6c===_0x9163('0xf')&&_0x52f792===_0x9163('0x10')){return _0x52f792;}if(_0x369c6c===_0x9163('0x11')||_0x369c6c===_0x9163('0x12')||_0x369c6c===_0x9163('0x13')){return _0x52f792;}return null;}},'servicelevel':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9163('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9163('0x14')](0xb)},'timeout':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9163('0x5')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9163('0x15')]('yes','no'),'defaultValue':_0x9163('0x16')},'autopause':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no',_0x9163('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x9163('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9163('0x15')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9163('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x9163('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9163('0x15')]('yes','no'),'defaultValue':_0x9163('0x16')},'announce_holdtime':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no',_0x9163('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x9163('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9163('0x15')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9163('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x9163('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9163('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9163('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9163('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9163('0x5')]},'queue_quantity1':{'type':Sequelize[_0x9163('0x5')]},'queue_quantity2':{'type':Sequelize[_0x9163('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x9163('0x5')]},'queue_less_than':{'type':Sequelize[_0x9163('0x5')]},'periodic_announce':{'type':Sequelize[_0x9163('0x19')],'set':function(_0x37fb2c){this['setDataValue'](_0x9163('0x1a'),_0x37fb2c?_0x37fb2c['join'](','):[]);},'get':function(){return this[_0x9163('0xd')]('periodic_announce')?this[_0x9163('0xd')]('periodic_announce')[_0x9163('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x9163('0x5')],'defaultValue':'yes','set':function(_0x485ccd){this[_0x9163('0x1c')](_0x9163('0x1d'),_0x485ccd?_0x485ccd[_0x9163('0x1e')](','):undefined);},'get':function(){return this[_0x9163('0xd')](_0x9163('0x1d'))?this[_0x9163('0xd')](_0x9163('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9163('0x5')],'defaultValue':'no','set':function(_0x3d0dc8){this[_0x9163('0x1c')](_0x9163('0x1f'),_0x3d0dc8?_0x3d0dc8[_0x9163('0x1e')](','):undefined);},'get':function(){return this[_0x9163('0xd')](_0x9163('0x1f'))?this[_0x9163('0xd')](_0x9163('0x1f'))[_0x9163('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9163('0x5')]},'description':{'type':Sequelize[_0x9163('0x5')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x23cebd){this[_0x9163('0x1c')]('acw',_0x23cebd);if(_0x23cebd){if(this[_0x9163('0xd')](_0x9163('0x20'))<0x2){this[_0x9163('0x1c')](_0x9163('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9163('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9163('0x21')],'defaultValue':0x0,'comment':_0x9163('0x22')},'dialMethod':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x23'),_0x9163('0x11'),_0x9163('0x13'),_0x9163('0x12'),'booked'),'defaultValue':_0x9163('0x11'),'comment':_0x9163('0x24')},'dialLimitChannel':{'type':Sequelize[_0x9163('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9163('0x25')},'dialLimitQueue':{'type':Sequelize[_0x9163('0x14')](0x4)[_0x9163('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9163('0x27')},'dialPowerLevel':{'type':Sequelize[_0x9163('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9163('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x9163('0x15')]('agentBusyFactor',_0x9163('0x2a')),'defaultValue':_0x9163('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9163('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9163('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x9163('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9163('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9163('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9163('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9163('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x9163('0x5')],'defaultValue':'tTxX','comment':_0x9163('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9163('0x2f')},'dialQueueProject':{'type':Sequelize[_0x9163('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9163('0x14')](0x5)[_0x9163('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9163('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9163('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9163('0x14')](0x5)[_0x9163('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9163('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9163('0x14')](0x5)[_0x9163('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x9163('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9163('0x5')],'defaultValue':_0x9163('0x33')},'dialPrefix':{'type':Sequelize[_0x9163('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x9163('0x34')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x9163('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9163('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9163('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9163('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9163('0x35')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9163('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9163('0x36')},'dialAMDMinWordLength':{'type':Sequelize[_0x9163('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9163('0x37')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9163('0x14')](0x9)[_0x9163('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9163('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9163('0x14')](0x9)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x9163('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9163('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9163('0x14')](0x9)[_0x9163('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9163('0x21')],'defaultValue':0x0,'comment':_0x9163('0x3a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9163('0x15')](_0x9163('0x3b'),_0x9163('0x3c')),'defaultValue':_0x9163('0x3b')},'dialQueueProject2':{'type':Sequelize[_0x9163('0x5')],'comment':_0x9163('0x3d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9163('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9163('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9163('0x3e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x9163('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9163('0x3f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9163('0x40')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9163('0x14')](0x5)[_0x9163('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9163('0x41')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x9163('0x14')](0x5)[_0x9163('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9163('0x42')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9163('0x43')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9163('0x14')](0x5)[_0x9163('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9163('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x9163('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9163('0x45')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9163('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9163('0x46')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9163('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9163('0x47')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9163('0x14')],'allowNull':!![],'comment':_0x9163('0x48')},'mandatoryDisposition':{'type':Sequelize[_0x9163('0x21')],'defaultValue':![],'comment':_0x9163('0x49'),'set':function(_0x5e5588){if(!_0x5e5588)this[_0x9163('0x1c')](_0x9163('0x4a'),null);this['setDataValue'](_0x9163('0x4b'),_0x5e5588);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9163('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9163('0x14')](0x3)[_0x9163('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9163('0x21')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 348e80c..f00f143 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88b0=['addTeams','teams','Team','User','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','removeAgents','forEach','addAgents','spread','format','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','ContactId','ListId','phone','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','scheduledAt','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','fromQuery','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','reject','then','destroy','get','inbound','QueueCampaigns','outbound','map','value','includes','type','find','name','UserProfileResource','stack','index','VoiceQueue','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams'];(function(_0x310a1b,_0x4c9129){var _0xdea206=function(_0x1f1e8d){while(--_0x1f1e8d){_0x310a1b['push'](_0x310a1b['shift']());}};_0xdea206(++_0x4c9129);}(_0x88b0,0x1cb));var _0x088b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x88b0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x088b('0x0'));var rimraf=require(_0x088b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x088b('0x2'));var moment=require(_0x088b('0x3'));var BPromise=require(_0x088b('0x4'));var Mustache=require(_0x088b('0x5'));var util=require('util');var path=require(_0x088b('0x6'));var sox=require(_0x088b('0x7'));var csv=require(_0x088b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x088b('0x9'));var squel=require(_0x088b('0xa'));var crypto=require(_0x088b('0xb'));var jsforce=require(_0x088b('0xc'));var deskjs=require(_0x088b('0xd'));var toCsv=require(_0x088b('0x8'));var querystring=require(_0x088b('0xe'));var Papa=require('papaparse');var Redis=require(_0x088b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x088b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x088b('0x11'));var logger=require(_0x088b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x088b('0x13'));var licenseUtil=require(_0x088b('0x14'));var db=require(_0x088b('0x15'))['db'];config['redis']=_[_0x088b('0x16')](config[_0x088b('0x17')],{'host':_0x088b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x088b('0x17')]));require(_0x088b('0x19'))[_0x088b('0x1a')](socket);function respondWithStatusCode(_0xf6bd53,_0x1ec5e5){_0x1ec5e5=_0x1ec5e5||0xcc;return function(_0x3d659d){if(_0x3d659d){return _0xf6bd53[_0x088b('0x1b')](_0x1ec5e5);}return _0xf6bd53['status'](_0x1ec5e5)[_0x088b('0x1c')]();};}function respondWithResult(_0x1c1096,_0x458b47){_0x458b47=_0x458b47||0xc8;return function(_0xdee68a){if(_0xdee68a){return _0x1c1096[_0x088b('0x1d')](_0x458b47)[_0x088b('0x1e')](_0xdee68a);}};}function respondWithFilteredResult(_0x54a27e,_0x331cb0){return function(_0x3ce059){if(_0x3ce059){var _0x135e00=typeof _0x331cb0[_0x088b('0x1f')]===_0x088b('0x20')&&typeof _0x331cb0['limit']==='undefined';var _0x35e006=_0x3ce059[_0x088b('0x21')];var _0x12e3ac=_0x135e00?0x0:_0x331cb0[_0x088b('0x1f')];var _0x3c9c1d=_0x135e00?_0x3ce059[_0x088b('0x21')]:_0x331cb0['offset']+_0x331cb0[_0x088b('0x22')];var _0x293604;if(_0x3c9c1d>=_0x35e006){_0x3c9c1d=_0x35e006;_0x293604=0xc8;}else{_0x293604=0xce;}_0x54a27e[_0x088b('0x1d')](_0x293604);return _0x54a27e['set']('Content-Range',_0x12e3ac+'-'+_0x3c9c1d+'/'+_0x35e006)[_0x088b('0x1e')](_0x3ce059);}return null;};}function patchUpdates(_0x1db300){return function(_0x587bad){try{jsonpatch['apply'](_0x587bad,_0x1db300,!![]);}catch(_0x187350){return BPromise[_0x088b('0x23')](_0x187350);}return _0x587bad['save']();};}function saveUpdates(_0x4b4d3f,_0x48bbaa){return function(_0x282156){if(_0x282156){return _0x282156['update'](_0x4b4d3f)[_0x088b('0x24')](function(_0x4178d0){return _0x4178d0;});}return null;};}function removeEntity(_0x8f18b7,_0x2c551f){return function(_0x43ee2e){if(_0x43ee2e){return _0x43ee2e[_0x088b('0x25')]()['then'](function(){var _0x339eb9=_0x43ee2e[_0x088b('0x26')]({'plain':!![]});var _0x3da9e1=[{'name':'VoiceQueues','value':_0x088b('0x27'),'ignore':![]},{'name':_0x088b('0x28'),'value':_0x088b('0x29'),'ignore':![]}];var _0x3ed176=_(_0x3da9e1)['filter']('ignore')[_0x088b('0x2a')](_0x088b('0x2b'))[_0x088b('0x2b')]();if(_[_0x088b('0x2c')](_0x3ed176,_0x339eb9[_0x088b('0x2d')])){return;}var _0x4f17f9=_[_0x088b('0x2e')](_0x3da9e1,[_0x088b('0x2b'),_0x339eb9[_0x088b('0x2d')]])[_0x088b('0x2f')];return db[_0x088b('0x30')]['destroy']({'where':{'type':_0x4f17f9,'resourceId':_0x339eb9['id']}})[_0x088b('0x24')](function(){return _0x43ee2e;});})[_0x088b('0x24')](function(){_0x8f18b7[_0x088b('0x1d')](0xcc)[_0x088b('0x1c')]();});}};}function handleEntityNotFound(_0x124bb6,_0x296ffa){return function(_0x13f87f){if(!_0x13f87f){_0x124bb6[_0x088b('0x1b')](0x194);}return _0x13f87f;};}function handleError(_0x1fff93,_0x17f4bc){_0x17f4bc=_0x17f4bc||0x1f4;return function(_0x46c0c0){logger['error'](_0x46c0c0[_0x088b('0x31')]);if(_0x46c0c0[_0x088b('0x2f')]){delete _0x46c0c0[_0x088b('0x2f')];}_0x1fff93[_0x088b('0x1d')](_0x17f4bc)['send'](_0x46c0c0);};}exports[_0x088b('0x32')]=function(_0x5a7a9f,_0x213b0e){var _0x59a607={},_0x572e24={},_0x172edc={'count':0x0,'rows':[]};var _0x38f851=_[_0x088b('0x2a')](db[_0x088b('0x33')][_0x088b('0x34')],function(_0x1e3700){return{'name':_0x1e3700['fieldName'],'type':_0x1e3700[_0x088b('0x2d')][_0x088b('0x35')]};});_0x572e24[_0x088b('0x36')]=_['map'](_0x38f851,_0x088b('0x2f'));_0x572e24[_0x088b('0x37')]=_['keys'](_0x5a7a9f[_0x088b('0x37')]);_0x572e24[_0x088b('0x38')]=_[_0x088b('0x39')](_0x572e24[_0x088b('0x36')],_0x572e24['query']);_0x59a607[_0x088b('0x3a')]=_['intersection'](_0x572e24[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x5a7a9f[_0x088b('0x37')]['fields']));_0x59a607[_0x088b('0x3a')]=_0x59a607['attributes'][_0x088b('0x3c')]?_0x59a607[_0x088b('0x3a')]:_0x572e24[_0x088b('0x36')];if(!_0x5a7a9f[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x59a607[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x5a7a9f['query'][_0x088b('0x22')]);_0x59a607[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x5a7a9f['query'][_0x088b('0x1f')]);}_0x59a607[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x5a7a9f['query']['sort']);_0x59a607['where']=qs['filters'](_[_0x088b('0x41')](_0x5a7a9f[_0x088b('0x37')],_0x572e24[_0x088b('0x38')]),_0x38f851);if(_0x5a7a9f[_0x088b('0x37')][_0x088b('0x42')]){_0x59a607[_0x088b('0x43')]=_['merge'](_0x59a607[_0x088b('0x43')],{'$or':_['map'](_0x38f851,function(_0x5c8cb3){if(_0x5c8cb3['type']!=='VIRTUAL'){var _0x2cb360={};_0x2cb360[_0x5c8cb3[_0x088b('0x2f')]]={'$like':'%'+_0x5a7a9f[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x2cb360;}})});}_0x59a607=_[_0x088b('0x44')]({},_0x59a607,_0x5a7a9f[_0x088b('0x45')]);var _0x3aa0bc={'where':_0x59a607[_0x088b('0x43')]};return db[_0x088b('0x33')][_0x088b('0x21')](_0x3aa0bc)[_0x088b('0x24')](function(_0x55be78){_0x172edc[_0x088b('0x21')]=_0x55be78;if(_0x5a7a9f[_0x088b('0x37')][_0x088b('0x46')]){_0x59a607[_0x088b('0x47')]=[{'all':!![]}];}return db['VoiceQueue'][_0x088b('0x48')](_0x59a607);})['then'](function(_0x2153c7){_0x172edc[_0x088b('0x49')]=_0x2153c7;return _0x172edc;})[_0x088b('0x24')](respondWithFilteredResult(_0x213b0e,_0x59a607))['catch'](handleError(_0x213b0e,null));};exports[_0x088b('0x4a')]=function(_0x31b3fc,_0x266e8b){var _0x1dbf16={'raw':![],'where':{'id':_0x31b3fc[_0x088b('0x4b')]['id']}},_0x3dc19b={};_0x3dc19b[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x33')]['rawAttributes']);_0x3dc19b[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x31b3fc[_0x088b('0x37')]);_0x3dc19b[_0x088b('0x38')]=_[_0x088b('0x39')](_0x3dc19b[_0x088b('0x36')],_0x3dc19b[_0x088b('0x37')]);_0x1dbf16[_0x088b('0x3a')]=_['intersection'](_0x3dc19b[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x31b3fc[_0x088b('0x37')][_0x088b('0x3b')]));_0x1dbf16['attributes']=_0x1dbf16[_0x088b('0x3a')][_0x088b('0x3c')]?_0x1dbf16[_0x088b('0x3a')]:_0x3dc19b['model'];if(_0x31b3fc[_0x088b('0x37')]['includeAll']){_0x1dbf16['include']=[{'all':!![]}];}_0x1dbf16=_[_0x088b('0x44')]({},_0x1dbf16,_0x31b3fc[_0x088b('0x45')]);return db[_0x088b('0x33')][_0x088b('0x2e')](_0x1dbf16)[_0x088b('0x24')](handleEntityNotFound(_0x266e8b,null))[_0x088b('0x24')](respondWithResult(_0x266e8b,null))[_0x088b('0x4d')](handleError(_0x266e8b,null));};exports['create']=function(_0x409db7,_0x30d235){return db['VoiceQueue'][_0x088b('0x4e')](_0x409db7[_0x088b('0x4f')],{})[_0x088b('0x24')](function(_0x2d9e32){var _0x12d063=_0x409db7[_0x088b('0x50')][_0x088b('0x26')]({'plain':!![]});if(!_0x12d063)throw new Error(_0x088b('0x51'));if(_0x12d063[_0x088b('0x52')]===_0x088b('0x50')){var _0x316ab4=_0x2d9e32['get']({'plain':!![]});var _0x5ec1f1=[{'name':_0x088b('0x53'),'value':'inbound'},{'name':_0x088b('0x28'),'value':_0x088b('0x29')}];var _0x99fbd6=_[_0x088b('0x2e')](_0x5ec1f1,[_0x088b('0x2b'),_0x316ab4[_0x088b('0x2d')]])['name'];return db[_0x088b('0x54')][_0x088b('0x2e')]({'where':{'name':_0x99fbd6,'userProfileId':_0x12d063[_0x088b('0x55')]},'raw':!![]})['then'](function(_0x118e13){if(_0x118e13&&_0x118e13[_0x088b('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x316ab4[_0x088b('0x2f')],'resourceId':_0x316ab4['id'],'type':_0x118e13[_0x088b('0x2f')],'sectionId':_0x118e13['id']},{})[_0x088b('0x24')](function(){return _0x2d9e32;});}else{return _0x2d9e32;}})['catch'](function(_0x26c7b9){logger[_0x088b('0x57')](_0x088b('0x58'),_0x26c7b9);throw _0x26c7b9;});}return _0x2d9e32;})[_0x088b('0x24')](respondWithResult(_0x30d235,0xc9))[_0x088b('0x4d')](handleError(_0x30d235,null));};exports[_0x088b('0x59')]=function(_0x151a66,_0x46e33c){var _0x289a3b={'where':{'id':_0x151a66[_0x088b('0x4b')]['id']}},_0x333066={};_0x333066[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x33')]['rawAttributes']);_0x289a3b[_0x088b('0x3a')]=_['intersection'](_0x333066['model'],qs['fields'](_0x151a66[_0x088b('0x37')][_0x088b('0x3b')]));_0x289a3b[_0x088b('0x3a')]=_0x289a3b['attributes']['length']?_0x289a3b[_0x088b('0x3a')]:_0x333066[_0x088b('0x36')];if(_0x151a66[_0x088b('0x37')][_0x088b('0x46')]){_0x289a3b[_0x088b('0x47')]=[{'all':!![]}];}_0x289a3b=_[_0x088b('0x44')]({},_0x289a3b,_0x151a66[_0x088b('0x45')]);return db[_0x088b('0x33')][_0x088b('0x2e')](_0x289a3b)[_0x088b('0x24')](handleEntityNotFound(_0x46e33c,null))[_0x088b('0x24')](function(_0x33ff98){if(_0x33ff98){var _0x2496da=_0x33ff98['get']({'plain':!![]});_0x2496da=qs[_0x088b('0x5a')](_0x2496da,['id','createdAt',_0x088b('0x5b')]);_0x151a66['body']=_[_0x088b('0x5a')](_0x151a66['body'],['id',_0x088b('0x5c'),_0x088b('0x5b')]);return db[_0x088b('0x33')][_0x088b('0x4e')](_[_0x088b('0x44')](_0x2496da,_0x151a66['body']),{'include':_0x151a66[_0x088b('0x37')][_0x088b('0x46')]?[{'all':!![]}]:undefined})[_0x088b('0x24')](function(_0x5b2935){var _0x3ad76b=_0x151a66[_0x088b('0x50')][_0x088b('0x26')]({'plain':!![]});if(!_0x3ad76b)throw new Error(_0x088b('0x51'));if(_0x3ad76b[_0x088b('0x52')]===_0x088b('0x50')){var _0x429e7d=_0x5b2935['get']({'plain':!![]});var _0x181e0a=[{'name':_0x088b('0x53'),'value':_0x088b('0x27')},{'name':_0x088b('0x28'),'value':'outbound'}];var _0x228a8d=_[_0x088b('0x2e')](_0x181e0a,[_0x088b('0x2b'),_0x429e7d[_0x088b('0x2d')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x228a8d,'userProfileId':_0x3ad76b[_0x088b('0x55')]},'raw':!![]})[_0x088b('0x24')](function(_0x1b98ce){if(_0x1b98ce&&_0x1b98ce['autoAssociation']===0x0){return db[_0x088b('0x30')]['create']({'name':_0x429e7d['name'],'resourceId':_0x429e7d['id'],'type':_0x1b98ce[_0x088b('0x2f')],'sectionId':_0x1b98ce['id']},{})[_0x088b('0x24')](function(){return _0x5b2935;});}else{return _0x5b2935;}})['catch'](function(_0x20484c){logger[_0x088b('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20484c);throw _0x20484c;});}return _0x5b2935;});}})[_0x088b('0x24')](respondWithResult(_0x46e33c,0xc9))['catch'](handleError(_0x46e33c,null));};exports[_0x088b('0x5d')]=function(_0x255632,_0x35b07a){if(_0x255632[_0x088b('0x4f')]['id']){delete _0x255632['body']['id'];}return db[_0x088b('0x33')]['find']({'where':{'id':_0x255632[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x35b07a,null))[_0x088b('0x24')](saveUpdates(_0x255632['body'],null))[_0x088b('0x24')](respondWithResult(_0x35b07a,null))['catch'](handleError(_0x35b07a,null));};exports['destroy']=function(_0x1bd60d,_0x2387cd){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1bd60d['params']['id']}})['then'](handleEntityNotFound(_0x2387cd,null))['then'](removeEntity(_0x2387cd,null))[_0x088b('0x4d')](handleError(_0x2387cd,null));};exports[_0x088b('0x5e')]=function(_0x406e94,_0x2e726e,_0x10ecfb){var _0x3cc35f={'raw':![],'where':{}};var _0x24c6e7={};var _0x4ea258={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x406e94['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x2e726e,null))['then'](function(_0x1d0a90){if(_0x1d0a90){_0x24c6e7[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x60')][_0x088b('0x34')]);_0x24c6e7[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x406e94[_0x088b('0x37')]);_0x24c6e7[_0x088b('0x38')]=_[_0x088b('0x39')](_0x24c6e7[_0x088b('0x36')],_0x24c6e7['query']);_0x3cc35f[_0x088b('0x3a')]=_['intersection'](_0x24c6e7['model'],qs['fields'](_0x406e94[_0x088b('0x37')][_0x088b('0x3b')]));_0x3cc35f[_0x088b('0x3a')]=_0x3cc35f[_0x088b('0x3a')][_0x088b('0x3c')]?_0x3cc35f['attributes']:_0x24c6e7['model'];if(!_0x406e94[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x3cc35f['limit']=qs[_0x088b('0x22')](_0x406e94[_0x088b('0x37')]['limit']);_0x3cc35f[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x406e94[_0x088b('0x37')][_0x088b('0x1f')]);}_0x3cc35f[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x406e94[_0x088b('0x37')][_0x088b('0x40')]);_0x3cc35f[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x406e94[_0x088b('0x37')],_0x24c6e7[_0x088b('0x38')]));_0x3cc35f[_0x088b('0x43')][_0x088b('0x61')]=_0x1d0a90['id'];if(_0x406e94[_0x088b('0x37')][_0x088b('0x42')]){_0x3cc35f[_0x088b('0x43')]=_[_0x088b('0x44')](_0x3cc35f[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x3cc35f[_0x088b('0x3a')],function(_0x4a297f){var _0x4b3f78={};_0x4b3f78[_0x4a297f]={'$like':'%'+_0x406e94['query'][_0x088b('0x42')]+'%'};return _0x4b3f78;})});}_0x3cc35f=_[_0x088b('0x44')]({},_0x3cc35f,_0x406e94[_0x088b('0x45')]);return db[_0x088b('0x60')][_0x088b('0x21')]({'where':_0x3cc35f[_0x088b('0x43')]})[_0x088b('0x24')](function(_0x2cade3){_0x4ea258[_0x088b('0x21')]=_0x2cade3;if(_0x406e94[_0x088b('0x37')][_0x088b('0x46')]){_0x3cc35f[_0x088b('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0x088b('0x48')](_0x3cc35f);})['then'](function(_0x48af4a){_0x4ea258[_0x088b('0x49')]=_0x48af4a;return _0x4ea258;});}})[_0x088b('0x24')](respondWithFilteredResult(_0x2e726e,_0x3cc35f))['catch'](handleError(_0x2e726e,null));};exports[_0x088b('0x62')]=function(_0x3dd39b,_0x3b8e17,_0x1dfed6){var _0xedd84={'raw':!![],'where':{}};var _0x34841b={};var _0x30e553={'count':0x0,'rows':[]};return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x3dd39b[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b8e17,null))[_0x088b('0x24')](function(_0x162350){if(_0x162350){_0x34841b[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x63')][_0x088b('0x34')]);_0x34841b[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x3dd39b[_0x088b('0x37')]);_0x34841b[_0x088b('0x38')]=_[_0x088b('0x39')](_0x34841b[_0x088b('0x36')],_0x34841b[_0x088b('0x37')]);_0xedd84[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x34841b[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x3dd39b['query']['fields']));_0xedd84[_0x088b('0x3a')]=_0xedd84['attributes'][_0x088b('0x3c')]?_0xedd84[_0x088b('0x3a')]:_0x34841b[_0x088b('0x36')];if(!_0x3dd39b[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0xedd84[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x3dd39b['query'][_0x088b('0x22')]);_0xedd84['offset']=qs[_0x088b('0x1f')](_0x3dd39b['query'][_0x088b('0x1f')]);}_0xedd84[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x3dd39b[_0x088b('0x37')]['sort']);_0xedd84[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x3dd39b['query'],_0x34841b[_0x088b('0x38')]));_0xedd84['where']['VoiceQueueId']=_0x162350['id'];if(_0x3dd39b[_0x088b('0x37')]['filter']){_0xedd84[_0x088b('0x43')]=_[_0x088b('0x44')](_0xedd84[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0xedd84['attributes'],function(_0x3be504){var _0x3e6399={};_0x3e6399[_0x3be504]={'$like':'%'+_0x3dd39b[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x3e6399;})});}_0xedd84=_[_0x088b('0x44')]({},_0xedd84,_0x3dd39b[_0x088b('0x45')]);return db[_0x088b('0x63')][_0x088b('0x21')]({'where':_0xedd84[_0x088b('0x43')]})[_0x088b('0x24')](function(_0x503737){_0x30e553[_0x088b('0x21')]=_0x503737;if(_0x3dd39b[_0x088b('0x37')][_0x088b('0x46')]){_0xedd84[_0x088b('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x088b('0x48')](_0xedd84);})[_0x088b('0x24')](function(_0x392ed3){_0x30e553[_0x088b('0x49')]=_0x392ed3;return _0x30e553;});}})[_0x088b('0x24')](respondWithFilteredResult(_0x3b8e17,_0xedd84))[_0x088b('0x4d')](handleError(_0x3b8e17,null));};exports[_0x088b('0x64')]=function(_0x118f0c,_0x4c7693,_0x5c54c6){var _0x56b40c={'raw':!![],'where':{}};var _0x14f011={};var _0x29d3c7={'count':0x0,'rows':[]};return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x118f0c['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x4c7693,null))[_0x088b('0x24')](function(_0x2cbac7){if(_0x2cbac7){_0x14f011[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x65')]['rawAttributes']);_0x14f011[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x118f0c[_0x088b('0x37')]);_0x14f011[_0x088b('0x38')]=_['intersection'](_0x14f011[_0x088b('0x36')],_0x14f011[_0x088b('0x37')]);_0x56b40c['attributes']=_[_0x088b('0x39')](_0x14f011['model'],qs[_0x088b('0x3b')](_0x118f0c[_0x088b('0x37')][_0x088b('0x3b')]));_0x56b40c[_0x088b('0x3a')]=_0x56b40c[_0x088b('0x3a')][_0x088b('0x3c')]?_0x56b40c[_0x088b('0x3a')]:_0x14f011[_0x088b('0x36')];if(!_0x118f0c[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x56b40c['limit']=qs[_0x088b('0x22')](_0x118f0c['query'][_0x088b('0x22')]);_0x56b40c[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x118f0c[_0x088b('0x37')][_0x088b('0x1f')]);}_0x56b40c[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x118f0c[_0x088b('0x37')][_0x088b('0x40')]);_0x56b40c['where']=qs['filters'](_[_0x088b('0x41')](_0x118f0c[_0x088b('0x37')],_0x14f011[_0x088b('0x38')]));_0x56b40c[_0x088b('0x43')][_0x088b('0x61')]=_0x2cbac7['id'];if(_0x118f0c['query'][_0x088b('0x42')]){_0x56b40c[_0x088b('0x43')]=_[_0x088b('0x44')](_0x56b40c['where'],{'$or':_[_0x088b('0x2a')](_0x56b40c[_0x088b('0x3a')],function(_0x199244){var _0x8f2c44={};_0x8f2c44[_0x199244]={'$like':'%'+_0x118f0c[_0x088b('0x37')]['filter']+'%'};return _0x8f2c44;})});}_0x56b40c=_['merge']({},_0x56b40c,_0x118f0c[_0x088b('0x45')]);return db['CmHopperFinal'][_0x088b('0x21')]({'where':_0x56b40c['where']})[_0x088b('0x24')](function(_0x195d45){_0x29d3c7[_0x088b('0x21')]=_0x195d45;if(_0x118f0c['query']['includeAll']){_0x56b40c['include']=[{'all':!![]}];}return db[_0x088b('0x65')][_0x088b('0x48')](_0x56b40c);})['then'](function(_0x451e38){_0x29d3c7[_0x088b('0x49')]=_0x451e38;return _0x29d3c7;});}})['then'](respondWithFilteredResult(_0x4c7693,_0x56b40c))[_0x088b('0x4d')](handleError(_0x4c7693,null));};exports[_0x088b('0x66')]=function(_0x5adbbe,_0x525706,_0x4c47f1){var _0x3b1a0b={'raw':!![],'where':{}};var _0x20ad09={};var _0xf8109={'count':0x0,'rows':[]};return db[_0x088b('0x33')]['findOne']({'where':{'id':_0x5adbbe[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x525706,null))[_0x088b('0x24')](function(_0x2751ba){if(_0x2751ba){_0x20ad09[_0x088b('0x36')]=_['keys'](db[_0x088b('0x67')][_0x088b('0x34')]);_0x20ad09[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x5adbbe[_0x088b('0x37')]);_0x20ad09['filters']=_[_0x088b('0x39')](_0x20ad09[_0x088b('0x36')],_0x20ad09[_0x088b('0x37')]);_0x3b1a0b[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x20ad09[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x5adbbe[_0x088b('0x37')]['fields']));_0x3b1a0b[_0x088b('0x3a')]=_0x3b1a0b['attributes'][_0x088b('0x3c')]?_0x3b1a0b['attributes']:_0x20ad09[_0x088b('0x36')];if(!_0x5adbbe['query']['hasOwnProperty'](_0x088b('0x3e'))){_0x3b1a0b[_0x088b('0x22')]=qs['limit'](_0x5adbbe['query']['limit']);_0x3b1a0b[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x5adbbe['query'][_0x088b('0x1f')]);}_0x3b1a0b[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x5adbbe[_0x088b('0x37')]['sort']);_0x3b1a0b[_0x088b('0x43')]=qs['filters'](_[_0x088b('0x41')](_0x5adbbe['query'],_0x20ad09[_0x088b('0x38')]));_0x3b1a0b[_0x088b('0x43')][_0x088b('0x61')]=_0x2751ba['id'];if(_0x5adbbe[_0x088b('0x37')][_0x088b('0x42')]){_0x3b1a0b['where']=_['merge'](_0x3b1a0b['where'],{'$or':_['map'](_0x3b1a0b[_0x088b('0x3a')],function(_0x47262b){var _0x3dee93={};_0x3dee93[_0x47262b]={'$like':'%'+_0x5adbbe[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x3dee93;})});}_0x3b1a0b=_[_0x088b('0x44')]({},_0x3b1a0b,_0x5adbbe[_0x088b('0x45')]);return db['CmHopperBlack'][_0x088b('0x21')]({'where':_0x3b1a0b['where']})[_0x088b('0x24')](function(_0xb90164){_0xf8109[_0x088b('0x21')]=_0xb90164;if(_0x5adbbe[_0x088b('0x37')][_0x088b('0x46')]){_0x3b1a0b[_0x088b('0x47')]=[{'all':!![]}];}return db[_0x088b('0x67')][_0x088b('0x48')](_0x3b1a0b);})[_0x088b('0x24')](function(_0x1d0f7d){_0xf8109[_0x088b('0x49')]=_0x1d0f7d;return _0xf8109;});}})['then'](respondWithFilteredResult(_0x525706,_0x3b1a0b))[_0x088b('0x4d')](handleError(_0x525706,null));};exports[_0x088b('0x68')]=function(_0x18b7b5,_0x1f44f1,_0x1de83){var _0x27cc10={};var _0x249451={};var _0x4e69fd;var _0x25cd56;return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x18b7b5[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x1f44f1,null))[_0x088b('0x24')](function(_0x388373){if(_0x388373){_0x4e69fd=_0x388373;_0x249451[_0x088b('0x36')]=_[_0x088b('0x4c')](db['Team'][_0x088b('0x34')]);_0x249451[_0x088b('0x37')]=_['keys'](_0x18b7b5[_0x088b('0x37')]);_0x249451[_0x088b('0x38')]=_[_0x088b('0x39')](_0x249451[_0x088b('0x36')],_0x249451[_0x088b('0x37')]);_0x27cc10['attributes']=_[_0x088b('0x39')](_0x249451[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x18b7b5[_0x088b('0x37')]['fields']));_0x27cc10[_0x088b('0x3a')]=_0x27cc10[_0x088b('0x3a')][_0x088b('0x3c')]?_0x27cc10[_0x088b('0x3a')]:_0x249451[_0x088b('0x36')];_0x27cc10[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x18b7b5[_0x088b('0x37')][_0x088b('0x40')]);_0x27cc10[_0x088b('0x43')]=qs[_0x088b('0x38')](_['pick'](_0x18b7b5[_0x088b('0x37')],_0x249451[_0x088b('0x38')]));if(_0x18b7b5[_0x088b('0x37')][_0x088b('0x42')]){_0x27cc10[_0x088b('0x43')]=_[_0x088b('0x44')](_0x27cc10[_0x088b('0x43')],{'$or':_['map'](_0x27cc10[_0x088b('0x3a')],function(_0x5dc63c){var _0x21cd5a={};_0x21cd5a[_0x5dc63c]={'$like':'%'+_0x18b7b5['query'][_0x088b('0x42')]+'%'};return _0x21cd5a;})});}_0x27cc10=_[_0x088b('0x44')]({},_0x27cc10,_0x18b7b5['options']);return _0x4e69fd[_0x088b('0x68')](_0x27cc10);}})[_0x088b('0x24')](function(_0x2ed071){if(_0x2ed071){_0x25cd56=_0x2ed071['length'];if(!_0x18b7b5['query']['hasOwnProperty'](_0x088b('0x3e'))){_0x27cc10['limit']=qs['limit'](_0x18b7b5[_0x088b('0x37')][_0x088b('0x22')]);_0x27cc10['offset']=qs[_0x088b('0x1f')](_0x18b7b5[_0x088b('0x37')][_0x088b('0x1f')]);}return _0x4e69fd[_0x088b('0x68')](_0x27cc10);}})[_0x088b('0x24')](function(_0x4bbd7d){if(_0x4bbd7d){return _0x4bbd7d?{'count':_0x25cd56,'rows':_0x4bbd7d}:null;}})['then'](respondWithResult(_0x1f44f1,null))['catch'](handleError(_0x1f44f1,null));};exports[_0x088b('0x69')]=function(_0x1483b6,_0x1d9c64,_0x539bd3){var _0x5c75ea=_0x1483b6['body'][_0x088b('0x6a')];var _0x514106=_[_0x088b('0x2a')](_0x5c75ea,'id');return db[_0x088b('0x6b')]['findAll']({'where':{'id':_0x514106},'attributes':['id'],'include':[{'model':db[_0x088b('0x6c')],'as':'Agents','attributes':['id','name',_0x088b('0x6d'),_0x088b('0x6e'),_0x088b('0x6f')],'raw':!![]}]})[_0x088b('0x24')](function(_0x57ead5){if(_0x57ead5){var _0x29eeaf=_[_0x088b('0x70')](_0x57ead5,function(_0x58a0e6){var _0x42f94a=_0x58a0e6[_0x088b('0x26')]({'plain':!![]});_0x42f94a[_0x088b('0x71')]['forEach'](function(_0x5cbc9d){_0x5cbc9d[_0x088b('0x72')]=_[_0x088b('0x2e')](_0x5c75ea,{'id':_0x42f94a['id']})[_0x088b('0x72')];});return _0x42f94a['Agents'];});return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1483b6[_0x088b('0x4b')]['id']}})['then'](function(_0x9c3501){return db[_0x088b('0x73')][_0x088b('0x74')](function(_0x2e82e9){return _0x9c3501[_0x088b('0x69')](_0x514106,{'transaction':_0x2e82e9})[_0x088b('0x24')](function(){return BPromise[_0x088b('0x75')](_0x5c75ea,function(_0x5b7b2e){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x5b7b2e['id'],'VoiceQueueId':_0x1483b6[_0x088b('0x4b')]['id'],'penalty':_0x5b7b2e[_0x088b('0x72')]},{'transaction':_0x2e82e9});});})['then'](function(){return BPromise[_0x088b('0x75')](_0x29eeaf,function(_0x4e248e){return db['UserVoiceQueue'][_0x088b('0x76')]({'where':{'UserId':_0x4e248e['id'],'VoiceQueueId':_0x1483b6[_0x088b('0x4b')]['id']},'defaults':{'penalty':_0x4e248e[_0x088b('0x72')]},'transaction':_0x2e82e9});});})[_0x088b('0x24')](function(){return BPromise[_0x088b('0x75')](_[_0x088b('0x42')](_0x29eeaf,{'online':!![]}),function(_0x13717f){return db[_0x088b('0x77')][_0x088b('0x78')]({'membername':_0x13717f['name'],'UserId':_0x13717f['id'],'queue_name':_0x9c3501['name'],'VoiceQueueId':_0x9c3501['id'],'interface':_[_0x088b('0x79')](_0x13717f[_0x088b('0x6f')])?util['format'](_0x088b('0x7a'),_0x13717f[_0x088b('0x2f')]):_0x13717f[_0x088b('0x6f')],'paused':_0x13717f[_0x088b('0x6e')]||![],'penalty':_0x13717f['penalty']},{'transaction':_0x2e82e9});});})['then'](function(){_0x29eeaf['forEach'](function(_0x3465d6){socket[_0x088b('0x7b')](_0x088b('0x7c'),{'UserId':_0x3465d6['id'],'VoiceQueueId':_0x9c3501['id']});});});});});}})[_0x088b('0x24')](respondWithStatusCode(_0x1d9c64,null))[_0x088b('0x4d')](handleError(_0x1d9c64,null));};exports['removeTeams']=function(_0x55e165,_0xc99d64,_0x1e11ca){return db[_0x088b('0x6b')][_0x088b('0x48')]({'where':{'id':_0x55e165['query'][_0x088b('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x088b('0x6c')],'as':_0x088b('0x71'),'attributes':['id'],'raw':!![]}]})[_0x088b('0x24')](handleEntityNotFound(_0xc99d64,null))[_0x088b('0x24')](function(_0x4e9679){var _0x2f022d=_['map'](_0x4e9679,'id');var _0x5590a3=[];var _0x1b2f26=[];var _0x270d6c=squel[_0x088b('0x7e')]();_0x270d6c[_0x088b('0x7f')](_0x088b('0x80'))[_0x088b('0x81')](_0x088b('0x82'),'tq')[_0x088b('0x83')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x088b('0x43')]('VoiceQueueId\x20=\x20?',_0x55e165[_0x088b('0x4b')]['id']);for(var _0x136109=0x0;_0x136109<_0x4e9679[_0x088b('0x3c')];_0x136109+=0x1){let _0x160f2a=_0x4e9679[_0x136109];for(var _0x5b570d=0x0;_0x5b570d<_0x160f2a[_0x088b('0x71')][_0x088b('0x3c')];_0x5b570d+=0x1){let _0x363227=_0x160f2a[_0x088b('0x71')][_0x5b570d];var _0x12bd5e=_0x270d6c[_0x088b('0x59')]();_0x12bd5e[_0x088b('0x43')](_0x088b('0x84'),_0x363227['id']);_0x1b2f26[_0x088b('0x85')](db[_0x088b('0x73')][_0x088b('0x37')](_0x12bd5e['toString'](),{'type':db['sequelize'][_0x088b('0x86')][_0x088b('0x87')]})[_0x088b('0x24')](function(_0x36755b){if(_0x36755b[_0x088b('0x3c')]===0x1){return _0x363227['id'];}else{var _0xff60c5=_['every'](_[_0x088b('0x2a')](_0x36755b,_0x088b('0x88')),function(_0x473c76){return _[_0x088b('0x2c')](_0x2f022d,_0x473c76);});if(_0xff60c5){return _0x363227['id'];}}}));}}return BPromise[_0x088b('0x89')](_0x1b2f26)[_0x088b('0x24')](function(_0xf59f24){_0x5590a3=_(_0x5590a3)[_0x088b('0x8a')](_0xf59f24)[_0x088b('0x8b')]()[_0x088b('0x2b')]();return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x55e165[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](function(_0x25ac59){return db[_0x088b('0x73')][_0x088b('0x74')](function(_0x5aa732){return _0x25ac59['removeTeams'](_0x55e165['query'][_0x088b('0x7d')],{'transaction':_0x5aa732})[_0x088b('0x24')](function(){if(!_['isEmpty'](_0x5590a3)){return _0x25ac59[_0x088b('0x8c')](_0x5590a3,{'transaction':_0x5aa732})[_0x088b('0x24')](function(){return db['UserVoiceQueueRt'][_0x088b('0x25')]({'where':{'VoiceQueueId':_0x55e165[_0x088b('0x4b')]['id'],'UserId':_0x5590a3},'transaction':_0x5aa732});});}})[_0x088b('0x24')](function(){_0x5590a3[_0x088b('0x8d')](function(_0x5dc854){socket[_0x088b('0x7b')]('userVoiceQueue:remove',{'UserId':_0x5dc854,'VoiceQueueId':_0x25ac59['id']});});});});});});})[_0x088b('0x24')](respondWithStatusCode(_0xc99d64,null))[_0x088b('0x4d')](handleError(_0xc99d64,null));};exports[_0x088b('0x8e')]=function(_0x6b8fb1,_0x3ed607,_0x47c2f5){var _0x27fbca,_0x831e;return db[_0x088b('0x33')]['find']({'where':{'id':_0x6b8fb1['params']['id']}})['then'](handleEntityNotFound(_0x3ed607,null))[_0x088b('0x24')](function(_0x42601a){if(_0x42601a){_0x831e=_0x42601a;return _0x42601a[_0x088b('0x8e')](_0x6b8fb1[_0x088b('0x4f')]['ids'],_['omit'](_0x6b8fb1[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{})[_0x088b('0x8f')](function(_0x16948b){for(var _0x18c2f4=0x0;_0x18c2f4<_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x7d')][_0x088b('0x3c')];_0x18c2f4+=0x1){socket[_0x088b('0x7b')](_0x088b('0x7c'),{'UserId':Number(_0x6b8fb1['body'][_0x088b('0x7d')][_0x18c2f4]),'VoiceQueueId':Number(_0x6b8fb1[_0x088b('0x4b')]['id'])});}return _0x16948b;});}})[_0x088b('0x24')](function(_0x58a9a5){_0x27fbca=_0x58a9a5||[];if(_0x831e){return db[_0x088b('0x6c')][_0x088b('0x48')]({'where':{'id':_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x7d')]},'attributes':['id',_0x088b('0x2f'),_0x088b('0x6d'),'voicePause',_0x088b('0x6f')],'raw':!![]});}})[_0x088b('0x24')](function(_0x246914){if(!_['isEmpty'](_0x246914)){var _0x1e3ec2=[];for(var _0x553fc0=0x0;_0x553fc0<_0x246914[_0x088b('0x3c')];_0x553fc0++){if(_0x246914[_0x553fc0]['online']){_0x1e3ec2[_0x088b('0x85')](db['UserVoiceQueueRt'][_0x088b('0x78')]({'membername':_0x246914[_0x553fc0]['name'],'UserId':_0x246914[_0x553fc0]['id'],'queue_name':_0x831e['name'],'VoiceQueueId':_0x831e['id'],'interface':_[_0x088b('0x79')](_0x246914[_0x553fc0][_0x088b('0x6f')])?util[_0x088b('0x90')](_0x088b('0x7a'),_0x246914[_0x553fc0][_0x088b('0x2f')]):_0x246914[_0x553fc0][_0x088b('0x6f')],'paused':_0x246914[_0x553fc0][_0x088b('0x6e')]||![],'penalty':_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x72')]||0x0}));}}return BPromise[_0x088b('0x89')](_0x1e3ec2);}})[_0x088b('0x24')](function(){return _0x27fbca;})[_0x088b('0x24')](respondWithResult(_0x3ed607,null))[_0x088b('0x4d')](handleError(_0x3ed607,null));};exports[_0x088b('0x8c')]=function(_0x214947,_0x53fe94,_0x444cb6){return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x214947[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53fe94,null))[_0x088b('0x24')](function(_0x2a2532){if(_0x2a2532){return _0x2a2532['removeAgents'](_0x214947[_0x088b('0x37')][_0x088b('0x7d')])[_0x088b('0x24')](function(){if(_[_0x088b('0x91')](_0x214947[_0x088b('0x37')][_0x088b('0x7d')])){for(var _0x250787=0x0;_0x250787<_0x214947[_0x088b('0x37')]['ids'][_0x088b('0x3c')];_0x250787+=0x1){socket['emit'](_0x088b('0x92'),{'UserId':Number(_0x214947[_0x088b('0x37')][_0x088b('0x7d')][_0x250787]),'VoiceQueueId':Number(_0x214947[_0x088b('0x4b')]['id'])});}}else{socket[_0x088b('0x7b')](_0x088b('0x92'),{'UserId':Number(_0x214947[_0x088b('0x37')][_0x088b('0x7d')]),'VoiceQueueId':Number(_0x214947['params']['id'])});}});}})[_0x088b('0x24')](function(_0x19955d){return db['UserVoiceQueueRt'][_0x088b('0x25')]({'where':{'VoiceQueueId':_0x214947['params']['id'],'UserId':_0x214947[_0x088b('0x37')]['ids']}})[_0x088b('0x24')](function(){return _0x19955d;});})[_0x088b('0x24')](respondWithStatusCode(_0x53fe94,null))[_0x088b('0x4d')](handleError(_0x53fe94,null));};exports[_0x088b('0x93')]=function(_0x29a112,_0x27bf16,_0x316497){var _0x901fe3={};var _0x387fac={};var _0x2f7a4c;var _0x361401;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x29a112[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x27bf16,null))[_0x088b('0x24')](function(_0x212cdb){if(_0x212cdb){_0x2f7a4c=_0x212cdb;_0x387fac[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x6c')][_0x088b('0x34')]);_0x387fac[_0x088b('0x37')]=_['keys'](_0x29a112[_0x088b('0x37')]);_0x387fac[_0x088b('0x38')]=_['intersection'](_0x387fac['model'],_0x387fac['query']);_0x901fe3[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x387fac[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x29a112[_0x088b('0x37')][_0x088b('0x3b')]));_0x901fe3[_0x088b('0x3a')]=_0x901fe3['attributes'][_0x088b('0x3c')]?_0x901fe3[_0x088b('0x3a')]:_0x387fac[_0x088b('0x36')];_0x901fe3[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x29a112[_0x088b('0x37')][_0x088b('0x40')]);_0x901fe3[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x29a112['query'],_0x387fac[_0x088b('0x38')]));if(_0x29a112[_0x088b('0x37')][_0x088b('0x42')]){_0x901fe3[_0x088b('0x43')]=_[_0x088b('0x44')](_0x901fe3[_0x088b('0x43')],{'$or':_['map'](_0x901fe3[_0x088b('0x3a')],function(_0x1a8df5){var _0xb0fa12={};_0xb0fa12[_0x1a8df5]={'$like':'%'+_0x29a112['query'][_0x088b('0x42')]+'%'};return _0xb0fa12;})});}_0x901fe3=_[_0x088b('0x44')]({},_0x901fe3,_0x29a112[_0x088b('0x45')]);return _0x2f7a4c[_0x088b('0x93')](_0x901fe3);}})[_0x088b('0x24')](function(_0x244e7f){if(_0x244e7f){_0x361401=_0x244e7f[_0x088b('0x3c')];if(!_0x29a112[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x901fe3[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x29a112[_0x088b('0x37')]['limit']);_0x901fe3[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x29a112[_0x088b('0x37')]['offset']);}return _0x2f7a4c[_0x088b('0x93')](_0x901fe3);}})[_0x088b('0x24')](function(_0x3a78bf){if(_0x3a78bf){return _0x3a78bf?{'count':_0x361401,'rows':_0x3a78bf}:null;}})[_0x088b('0x24')](respondWithResult(_0x27bf16,null))['catch'](handleError(_0x27bf16,null));};exports[_0x088b('0x94')]=function(_0x132915,_0x3dc68c,_0x461937){var _0x2258ed={};var _0x119e15={};var _0x4759ab;var _0x5dd5aa;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x132915[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3dc68c,null))[_0x088b('0x24')](function(_0x4a8642){if(_0x4a8642){_0x4759ab=_0x4a8642;_0x119e15['model']=_[_0x088b('0x4c')](db[_0x088b('0x77')]['rawAttributes']);_0x119e15[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x132915['query']);_0x119e15[_0x088b('0x38')]=_[_0x088b('0x39')](_0x119e15['model'],_0x119e15[_0x088b('0x37')]);_0x2258ed[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x119e15[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x132915[_0x088b('0x37')][_0x088b('0x3b')]));_0x2258ed[_0x088b('0x3a')]=_0x2258ed[_0x088b('0x3a')][_0x088b('0x3c')]?_0x2258ed[_0x088b('0x3a')]:_0x119e15[_0x088b('0x36')];_0x2258ed['order']=qs[_0x088b('0x40')](_0x132915[_0x088b('0x37')][_0x088b('0x40')]);_0x2258ed[_0x088b('0x43')]=qs['filters'](_[_0x088b('0x41')](_0x132915['query'],_0x119e15[_0x088b('0x38')]));if(_0x132915[_0x088b('0x37')][_0x088b('0x42')]){_0x2258ed['where']=_[_0x088b('0x44')](_0x2258ed[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x2258ed[_0x088b('0x3a')],function(_0x12013c){var _0x18e831={};_0x18e831[_0x12013c]={'$like':'%'+_0x132915['query'][_0x088b('0x42')]+'%'};return _0x18e831;})});}_0x2258ed=_[_0x088b('0x44')]({},_0x2258ed,_0x132915[_0x088b('0x45')]);return _0x4759ab[_0x088b('0x94')](_0x2258ed);}})[_0x088b('0x24')](function(_0x51eb91){if(_0x51eb91){_0x5dd5aa=_0x51eb91[_0x088b('0x3c')];if(!_0x132915[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0x2258ed[_0x088b('0x22')]=qs['limit'](_0x132915[_0x088b('0x37')][_0x088b('0x22')]);_0x2258ed[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x132915['query']['offset']);}return _0x4759ab[_0x088b('0x94')](_0x2258ed);}})[_0x088b('0x24')](function(_0x110fb8){return _0x110fb8?{'count':_0x5dd5aa,'rows':_0x110fb8}:null;})[_0x088b('0x24')](respondWithResult(_0x3dc68c,null))[_0x088b('0x4d')](handleError(_0x3dc68c,null));};exports[_0x088b('0x95')]=function(_0x2b4bbe,_0x2d5f08,_0x1fcfa8){var _0x1500ba={};var _0x14d87d={};var _0x17258f;var _0x22c53a;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x2b4bbe[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x2d5f08,null))[_0x088b('0x24')](function(_0x260235){if(_0x260235){_0x17258f=_0x260235;_0x14d87d[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x96')][_0x088b('0x34')]);_0x14d87d[_0x088b('0x37')]=_['keys'](_0x2b4bbe[_0x088b('0x37')]);_0x14d87d[_0x088b('0x38')]=_[_0x088b('0x39')](_0x14d87d[_0x088b('0x36')],_0x14d87d[_0x088b('0x37')]);_0x1500ba[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x14d87d[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x3b')]));_0x1500ba['attributes']=_0x1500ba['attributes'][_0x088b('0x3c')]?_0x1500ba[_0x088b('0x3a')]:_0x14d87d[_0x088b('0x36')];_0x1500ba[_0x088b('0x3f')]=qs['sort'](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x40')]);_0x1500ba[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x2b4bbe[_0x088b('0x37')],_0x14d87d['filters']));if(_0x2b4bbe[_0x088b('0x37')][_0x088b('0x42')]){_0x1500ba[_0x088b('0x43')]=_[_0x088b('0x44')](_0x1500ba[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x1500ba[_0x088b('0x3a')],function(_0x37e0fa){var _0x565723={};_0x565723[_0x37e0fa]={'$like':'%'+_0x2b4bbe[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x565723;})});}_0x1500ba=_[_0x088b('0x44')]({},_0x1500ba,_0x2b4bbe[_0x088b('0x45')]);return _0x17258f[_0x088b('0x95')](_0x1500ba);}})[_0x088b('0x24')](function(_0x4d68ef){if(_0x4d68ef){_0x22c53a=_0x4d68ef[_0x088b('0x3c')];if(!_0x2b4bbe[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0x1500ba['limit']=qs['limit'](_0x2b4bbe['query'][_0x088b('0x22')]);_0x1500ba['offset']=qs['offset'](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x1f')]);}return _0x17258f[_0x088b('0x95')](_0x1500ba);}})[_0x088b('0x24')](function(_0x3da9f7){if(_0x3da9f7){return _0x3da9f7?{'count':_0x22c53a,'rows':_0x3da9f7}:null;}})[_0x088b('0x24')](respondWithResult(_0x2d5f08,null))['catch'](handleError(_0x2d5f08,null));};exports['addLists']=function(_0xcec66f,_0x46d0c6,_0x52a461){var _0x4546f6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x299d3d,_0x5a2cdc;return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0xcec66f['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x46d0c6,null))[_0x088b('0x24')](function(_0x43af00){if(_0x43af00){_0x5a2cdc=_0x43af00;return _0x43af00[_0x088b('0x97')](_0xcec66f[_0x088b('0x4f')][_0x088b('0x7d')],_[_0x088b('0x5a')](_0xcec66f[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{});}return null;})[_0x088b('0x8f')](function(_0x5e5162){var _0xa3a341;_0x299d3d=_0x5e5162||[];var _0x4f521d=[];if(_0x5e5162){for(var _0x4077a2=0x0;_0x4077a2<_0x5e5162['length'];_0x4077a2+=0x1){var _0x5aa1a2=_0x5e5162[_0x4077a2][_0x088b('0x26')]({'plain':!![]});_0x5a2cdc[_0x088b('0x98')]=_0xcec66f[_0x088b('0x4f')]['dialCheckDuplicateType']?_0xcec66f[_0x088b('0x4f')][_0x088b('0x98')]:_0x5a2cdc['dialCheckDuplicateType'];switch(_0x5a2cdc[_0x088b('0x98')]){case _0x088b('0x99'):_0xa3a341=squel[_0x088b('0x9a')]()[_0x088b('0x9b')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),_0x088b('0x5c'),_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','scheduledAt')[_0x088b('0x7f')]('id','ContactId')[_0x088b('0x7f')](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),_0x088b('0x9d'))[_0x088b('0x7f')](_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))['from'](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2['CmListId'][_0x088b('0xa0')]())[_0x088b('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0xa5'))['from'](_0x088b('0xa6'))[_0x088b('0x43')](_0x088b('0xa7'),_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')]()))[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()['field'](_0x088b('0xa8'))[_0x088b('0x81')](_0x088b('0xa9'))[_0x088b('0x43')](_0x088b('0xa7'),_0xcec66f['params']['id'][_0x088b('0xa0')]())))[_0x088b('0xa0')]();break;case _0x088b('0xaa'):_0xa3a341=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x088b('0x9e'),_0x088b('0xab'),_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),'createdAt',_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')]('phone',_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','scheduledAt')[_0x088b('0x7f')]('id',_0x088b('0x9c'))['field'](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),'ListId')[_0x088b('0x7f')](_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))[_0x088b('0x81')](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2[_0x088b('0x9f')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0xa8'))[_0x088b('0x81')]('cm_hopper')['where'](_0x088b('0xa7'),_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')]())))[_0x088b('0xa0')]();break;default:_0xa3a341=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xa9'))['fromQuery']([_0x088b('0x9e'),'scheduledAt','ContactId',_0x088b('0x9d'),'VoiceQueueId',_0x088b('0x5c'),_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0xab'))[_0x088b('0x7f')]('id',_0x088b('0x9c'))['field'](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),_0x088b('0x9d'))[_0x088b('0x7f')](_0xcec66f['params']['id'][_0x088b('0xa0')](),_0x088b('0x61'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))[_0x088b('0x81')](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2[_0x088b('0x9f')]['toString']())[_0x088b('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4f521d['push'](db['sequelize'][_0x088b('0x37')](_0xa3a341));}return BPromise[_0x088b('0x89')](_0x4f521d);}})['then'](function(){var _0x3dfa80=[];var _0x55cc74=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xac'))['fromQuery']([_0x088b('0xad'),_0x088b('0x9e'),_0x088b('0xae'),_0x088b('0x5c'),'updatedAt'],squel[_0x088b('0x7e')]()[_0x088b('0x7f')]('h.id')[_0x088b('0x7f')](_0x088b('0xaf'))['field'](_0x088b('0xb0'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','updatedAt')[_0x088b('0x81')](_0x088b('0xb1'),'ci')['join'](_0x088b('0xa9'),'h','h.ContactId=ci.CmContactId')[_0x088b('0x43')](_0x088b('0xb2'),_0x4546f6)[_0x088b('0x43')]('ci.ItemClass=?',_0x088b('0xb3')))[_0x088b('0xa0')]();_0x3dfa80['push'](db[_0x088b('0x73')]['query'](_0x55cc74));return BPromise[_0x088b('0x89')](_0x3dfa80);})[_0x088b('0x24')](function(){return _0x299d3d;})[_0x088b('0x24')](respondWithResult(_0x46d0c6,null))['catch'](handleError(_0x46d0c6,null));};exports[_0x088b('0xb4')]=function(_0x2bb3ba,_0x395ed0,_0x3db304){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x2bb3ba[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x395ed0,null))[_0x088b('0x24')](function(_0x32b9e2){if(_0x32b9e2){return _0x32b9e2[_0x088b('0xb4')](_0x2bb3ba[_0x088b('0x37')]['ids']);}})[_0x088b('0x24')](function(_0x598c86){if(_0x598c86){return db[_0x088b('0x60')]['destroy']({'where':{'ListId':_0x2bb3ba['query'][_0x088b('0x7d')],'VoiceQueueId':_0x2bb3ba[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](function(){return _0x598c86;});}})['then'](respondWithStatusCode(_0x395ed0,null))['catch'](handleError(_0x395ed0,null));};exports[_0x088b('0xb5')]=function(_0x4979b7,_0x43732f,_0x3df719){var _0x741eec={};var _0x383b52={};var _0x3beb37;var _0x536038;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x4979b7[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x43732f,null))['then'](function(_0x29c794){if(_0x29c794){_0x3beb37=_0x29c794;_0x383b52[_0x088b('0x36')]=_['keys'](db['CmList']['rawAttributes']);_0x383b52[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x4979b7[_0x088b('0x37')]);_0x383b52[_0x088b('0x38')]=_[_0x088b('0x39')](_0x383b52['model'],_0x383b52[_0x088b('0x37')]);_0x741eec[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x383b52[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x4979b7[_0x088b('0x37')][_0x088b('0x3b')]));_0x741eec['attributes']=_0x741eec[_0x088b('0x3a')]['length']?_0x741eec[_0x088b('0x3a')]:_0x383b52[_0x088b('0x36')];_0x741eec['order']=qs[_0x088b('0x40')](_0x4979b7['query'][_0x088b('0x40')]);_0x741eec[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x4979b7['query'],_0x383b52[_0x088b('0x38')]));if(_0x4979b7[_0x088b('0x37')][_0x088b('0x42')]){_0x741eec[_0x088b('0x43')]=_[_0x088b('0x44')](_0x741eec[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x741eec['attributes'],function(_0x155644){var _0x205475={};_0x205475[_0x155644]={'$like':'%'+_0x4979b7[_0x088b('0x37')]['filter']+'%'};return _0x205475;})});}_0x741eec=_[_0x088b('0x44')]({},_0x741eec,_0x4979b7['options']);return _0x3beb37[_0x088b('0xb5')](_0x741eec);}})[_0x088b('0x24')](function(_0x1877fb){if(_0x1877fb){_0x536038=_0x1877fb['length'];if(!_0x4979b7['query'][_0x088b('0x3d')]('nolimit')){_0x741eec[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x4979b7[_0x088b('0x37')][_0x088b('0x22')]);_0x741eec[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x4979b7[_0x088b('0x37')]['offset']);}return _0x3beb37[_0x088b('0xb5')](_0x741eec);}})['then'](function(_0x201539){if(_0x201539){return _0x201539?{'count':_0x536038,'rows':_0x201539}:null;}})[_0x088b('0x24')](respondWithResult(_0x43732f,null))[_0x088b('0x4d')](handleError(_0x43732f,null));};exports[_0x088b('0xb6')]=function(_0x42ad81,_0xacacf7,_0x183cfb){var _0x50a6c8,_0x1621de;return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x42ad81['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0xacacf7,null))[_0x088b('0x24')](function(_0xff8164){if(_0xff8164){_0x1621de=_0xff8164;return _0xff8164[_0x088b('0xb6')](_0x42ad81[_0x088b('0x4f')][_0x088b('0x7d')],_[_0x088b('0x5a')](_0x42ad81[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{});}return null;})[_0x088b('0x8f')](function(_0x54ea92){var _0x223021;_0x50a6c8=_0x54ea92||[];var _0x2776bc=[];if(_0x54ea92){for(var _0x3cf220=0x0;_0x3cf220<_0x54ea92[_0x088b('0x3c')];_0x3cf220+=0x1){var _0x14e077=_0x54ea92[_0x3cf220][_0x088b('0x26')]({'plain':!![]});_0x223021=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xb7'))[_0x088b('0xb8')]([_0x088b('0x9e'),_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),_0x088b('0x5c'),'updatedAt'],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),'phone')['field']('id',_0x088b('0x9c'))[_0x088b('0x7f')](_0x14e077[_0x088b('0x9f')]['toString'](),_0x088b('0x9d'))[_0x088b('0x7f')](_0x42ad81[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))[_0x088b('0x7f')](_0x088b('0xb9'),_0x088b('0x5c'))[_0x088b('0x7f')](_0x088b('0xb9'),_0x088b('0x5b'))['from'](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x14e077[_0x088b('0x9f')][_0x088b('0xa0')]())[_0x088b('0x43')](_0x088b('0xba')))[_0x088b('0xa0')]();_0x2776bc[_0x088b('0x85')](db[_0x088b('0x73')][_0x088b('0x37')](_0x223021));}return BPromise['all'](_0x2776bc);}})[_0x088b('0x24')](function(){return _0x50a6c8;})[_0x088b('0x24')](respondWithResult(_0xacacf7,null))[_0x088b('0x4d')](handleError(_0xacacf7,null));};exports[_0x088b('0xbb')]=function(_0x1414b6,_0x3d20f0,_0x27542b){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1414b6[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d20f0,null))[_0x088b('0x24')](function(_0x1ed3c2){if(_0x1ed3c2){return _0x1ed3c2[_0x088b('0xbb')](_0x1414b6[_0x088b('0x37')][_0x088b('0x7d')]);}})[_0x088b('0x24')](function(_0x470b5b){if(_0x470b5b){return db[_0x088b('0x67')][_0x088b('0x25')]({'where':{'ListId':_0x1414b6['query'][_0x088b('0x7d')],'VoiceQueueId':_0x1414b6['params']['id']}})[_0x088b('0x24')](function(){return _0x470b5b;});}})[_0x088b('0x24')](respondWithStatusCode(_0x3d20f0,null))[_0x088b('0x4d')](handleError(_0x3d20f0,null));};
\ No newline at end of file
+var _0x4a69=['cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','type','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','clone','omit','updatedAt','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','VoiceQueueId','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','online','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','interface','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','transaction','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','isNil','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','ContactId','CmListId','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)'];(function(_0x24337c,_0x89ebce){var _0x17f5c5=function(_0x2ad642){while(--_0x2ad642){_0x24337c['push'](_0x24337c['shift']());}};_0x17f5c5(++_0x89ebce);}(_0x4a69,0x181));var _0x94a6=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x4a69[_0x44bcb0];return _0xfaf881;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94a6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94a6('0x1'));var rp=require(_0x94a6('0x2'));var moment=require(_0x94a6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x94a6('0x4'));var path=require(_0x94a6('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x94a6('0x6'));var fs=require('fs');var fs_extra=require(_0x94a6('0x7'));var _=require('lodash');var squel=require(_0x94a6('0x8'));var crypto=require(_0x94a6('0x9'));var jsforce=require(_0x94a6('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x94a6('0xb'));var Papa=require(_0x94a6('0xc'));var Redis=require(_0x94a6('0xd'));var authService=require(_0x94a6('0xe'));var qs=require(_0x94a6('0xf'));var as=require(_0x94a6('0x10'));var hardwareService=require(_0x94a6('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x94a6('0x12'));var config=require(_0x94a6('0x13'));var licenseUtil=require(_0x94a6('0x14'));var db=require(_0x94a6('0x15'))['db'];config[_0x94a6('0x16')]=_[_0x94a6('0x17')](config['redis'],{'host':_0x94a6('0x18'),'port':0x18eb});var socket=require(_0x94a6('0x19'))(new Redis(config[_0x94a6('0x16')]));require(_0x94a6('0x1a'))[_0x94a6('0x1b')](socket);function respondWithStatusCode(_0x47a267,_0x184298){_0x184298=_0x184298||0xcc;return function(_0x5721ef){if(_0x5721ef){return _0x47a267[_0x94a6('0x1c')](_0x184298);}return _0x47a267['status'](_0x184298)[_0x94a6('0x1d')]();};}function respondWithResult(_0x190192,_0x34ad1c){_0x34ad1c=_0x34ad1c||0xc8;return function(_0xef0296){if(_0xef0296){return _0x190192[_0x94a6('0x1e')](_0x34ad1c)['json'](_0xef0296);}};}function respondWithFilteredResult(_0x288d33,_0x1154b5){return function(_0x292c85){if(_0x292c85){var _0x4ba5f0=typeof _0x1154b5[_0x94a6('0x1f')]===_0x94a6('0x20')&&typeof _0x1154b5[_0x94a6('0x21')]===_0x94a6('0x20');var _0x129b25=_0x292c85[_0x94a6('0x22')];var _0x2c41bf=_0x4ba5f0?0x0:_0x1154b5['offset'];var _0x54f25f=_0x4ba5f0?_0x292c85['count']:_0x1154b5[_0x94a6('0x1f')]+_0x1154b5[_0x94a6('0x21')];var _0x36060a;if(_0x54f25f>=_0x129b25){_0x54f25f=_0x129b25;_0x36060a=0xc8;}else{_0x36060a=0xce;}_0x288d33[_0x94a6('0x1e')](_0x36060a);return _0x288d33[_0x94a6('0x23')](_0x94a6('0x24'),_0x2c41bf+'-'+_0x54f25f+'/'+_0x129b25)[_0x94a6('0x25')](_0x292c85);}return null;};}function patchUpdates(_0x1b6497){return function(_0x100929){try{jsonpatch[_0x94a6('0x26')](_0x100929,_0x1b6497,!![]);}catch(_0x5c08ed){return BPromise[_0x94a6('0x27')](_0x5c08ed);}return _0x100929['save']();};}function saveUpdates(_0x32918f,_0x375126){return function(_0x2fb115){if(_0x2fb115){return _0x2fb115[_0x94a6('0x28')](_0x32918f)['then'](function(_0x2051a9){return _0x2051a9;});}return null;};}function removeEntity(_0x6ab4c5,_0x2c3e70){return function(_0x5592bd){if(_0x5592bd){return _0x5592bd[_0x94a6('0x29')]()[_0x94a6('0x2a')](function(){var _0x158ab5=_0x5592bd[_0x94a6('0x2b')]({'plain':!![]});var _0xcb5d8a=[{'name':_0x94a6('0x2c'),'value':_0x94a6('0x2d'),'ignore':![]},{'name':_0x94a6('0x2e'),'value':_0x94a6('0x2f'),'ignore':![]}];var _0x882722=_(_0xcb5d8a)[_0x94a6('0x30')]('ignore')[_0x94a6('0x31')](_0x94a6('0x32'))[_0x94a6('0x32')]();if(_['includes'](_0x882722,_0x158ab5[_0x94a6('0x33')])){return;}var _0x18b56b=_['find'](_0xcb5d8a,[_0x94a6('0x32'),_0x158ab5[_0x94a6('0x33')]])['name'];return db[_0x94a6('0x34')][_0x94a6('0x29')]({'where':{'type':_0x18b56b,'resourceId':_0x158ab5['id']}})[_0x94a6('0x2a')](function(){return _0x5592bd;});})[_0x94a6('0x2a')](function(){_0x6ab4c5[_0x94a6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fb32,_0x496235){return function(_0x430262){if(!_0x430262){_0x56fb32[_0x94a6('0x1c')](0x194);}return _0x430262;};}function handleError(_0x2fdfdc,_0x2d9600){_0x2d9600=_0x2d9600||0x1f4;return function(_0x4447ad){logger[_0x94a6('0x35')](_0x4447ad[_0x94a6('0x36')]);if(_0x4447ad[_0x94a6('0x37')]){delete _0x4447ad[_0x94a6('0x37')];}_0x2fdfdc[_0x94a6('0x1e')](_0x2d9600)[_0x94a6('0x38')](_0x4447ad);};}exports['index']=function(_0x494720,_0x5547b2){var _0x421031={},_0x2a387d={},_0x23ad2e={'count':0x0,'rows':[]};var _0x49a273=_[_0x94a6('0x31')](db['VoiceQueue'][_0x94a6('0x39')],function(_0x4fc262){return{'name':_0x4fc262[_0x94a6('0x3a')],'type':_0x4fc262[_0x94a6('0x33')]['key']};});_0x2a387d['model']=_[_0x94a6('0x31')](_0x49a273,_0x94a6('0x37'));_0x2a387d[_0x94a6('0x3b')]=_[_0x94a6('0x3c')](_0x494720[_0x94a6('0x3b')]);_0x2a387d[_0x94a6('0x3d')]=_['intersection'](_0x2a387d[_0x94a6('0x3e')],_0x2a387d['query']);_0x421031[_0x94a6('0x3f')]=_[_0x94a6('0x40')](_0x2a387d[_0x94a6('0x3e')],qs['fields'](_0x494720[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x421031[_0x94a6('0x3f')]=_0x421031[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x421031['attributes']:_0x2a387d[_0x94a6('0x3e')];if(!_0x494720[_0x94a6('0x3b')][_0x94a6('0x43')](_0x94a6('0x44'))){_0x421031[_0x94a6('0x21')]=qs[_0x94a6('0x21')](_0x494720[_0x94a6('0x3b')]['limit']);_0x421031[_0x94a6('0x1f')]=qs[_0x94a6('0x1f')](_0x494720[_0x94a6('0x3b')][_0x94a6('0x1f')]);}_0x421031[_0x94a6('0x45')]=qs[_0x94a6('0x46')](_0x494720[_0x94a6('0x3b')][_0x94a6('0x46')]);_0x421031[_0x94a6('0x47')]=qs[_0x94a6('0x3d')](_[_0x94a6('0x48')](_0x494720[_0x94a6('0x3b')],_0x2a387d[_0x94a6('0x3d')]),_0x49a273);if(_0x494720[_0x94a6('0x3b')][_0x94a6('0x30')]){_0x421031[_0x94a6('0x47')]=_[_0x94a6('0x49')](_0x421031['where'],{'$or':_[_0x94a6('0x31')](_0x49a273,function(_0x5bd21b){if(_0x5bd21b['type']!==_0x94a6('0x4a')){var _0x242035={};_0x242035[_0x5bd21b[_0x94a6('0x37')]]={'$like':'%'+_0x494720[_0x94a6('0x3b')]['filter']+'%'};return _0x242035;}})});}_0x421031=_[_0x94a6('0x49')]({},_0x421031,_0x494720[_0x94a6('0x4b')]);var _0x45c7e4={'where':_0x421031['where']};return db[_0x94a6('0x4c')][_0x94a6('0x22')](_0x45c7e4)[_0x94a6('0x2a')](function(_0x1269d2){_0x23ad2e[_0x94a6('0x22')]=_0x1269d2;if(_0x494720['query'][_0x94a6('0x4d')]){_0x421031[_0x94a6('0x4e')]=[{'all':!![]}];}return db[_0x94a6('0x4c')][_0x94a6('0x4f')](_0x421031);})[_0x94a6('0x2a')](function(_0x39ee2b){_0x23ad2e['rows']=_0x39ee2b;return _0x23ad2e;})[_0x94a6('0x2a')](respondWithFilteredResult(_0x5547b2,_0x421031))[_0x94a6('0x50')](handleError(_0x5547b2,null));};exports[_0x94a6('0x51')]=function(_0x13b4a1,_0x38463e){var _0x5dd6e7={'raw':![],'where':{'id':_0x13b4a1[_0x94a6('0x52')]['id']}},_0x125712={};_0x125712[_0x94a6('0x3e')]=_['keys'](db[_0x94a6('0x4c')][_0x94a6('0x39')]);_0x125712[_0x94a6('0x3b')]=_['keys'](_0x13b4a1['query']);_0x125712[_0x94a6('0x3d')]=_['intersection'](_0x125712[_0x94a6('0x3e')],_0x125712['query']);_0x5dd6e7[_0x94a6('0x3f')]=_[_0x94a6('0x40')](_0x125712[_0x94a6('0x3e')],qs[_0x94a6('0x41')](_0x13b4a1[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x5dd6e7[_0x94a6('0x3f')]=_0x5dd6e7['attributes'][_0x94a6('0x42')]?_0x5dd6e7['attributes']:_0x125712['model'];if(_0x13b4a1['query']['includeAll']){_0x5dd6e7[_0x94a6('0x4e')]=[{'all':!![]}];}_0x5dd6e7=_['merge']({},_0x5dd6e7,_0x13b4a1[_0x94a6('0x4b')]);return db[_0x94a6('0x4c')][_0x94a6('0x53')](_0x5dd6e7)[_0x94a6('0x2a')](handleEntityNotFound(_0x38463e,null))[_0x94a6('0x2a')](respondWithResult(_0x38463e,null))[_0x94a6('0x50')](handleError(_0x38463e,null));};exports[_0x94a6('0x54')]=function(_0x2514fb,_0x2ff1fa){return db[_0x94a6('0x4c')][_0x94a6('0x54')](_0x2514fb[_0x94a6('0x55')],{})['then'](function(_0xb5052c){var _0xe2b810=_0x2514fb['user']['get']({'plain':!![]});if(!_0xe2b810)throw new Error(_0x94a6('0x56'));if(_0xe2b810[_0x94a6('0x57')]===_0x94a6('0x58')){var _0x357003=_0xb5052c[_0x94a6('0x2b')]({'plain':!![]});var _0xf5bcc3=[{'name':_0x94a6('0x2c'),'value':_0x94a6('0x2d')},{'name':_0x94a6('0x2e'),'value':_0x94a6('0x2f')}];var _0x33e8cb=_[_0x94a6('0x53')](_0xf5bcc3,[_0x94a6('0x32'),_0x357003[_0x94a6('0x33')]])[_0x94a6('0x37')];return db[_0x94a6('0x59')][_0x94a6('0x53')]({'where':{'name':_0x33e8cb,'userProfileId':_0xe2b810[_0x94a6('0x5a')]},'raw':!![]})[_0x94a6('0x2a')](function(_0x2c2cd7){if(_0x2c2cd7&&_0x2c2cd7[_0x94a6('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x357003['name'],'resourceId':_0x357003['id'],'type':_0x2c2cd7[_0x94a6('0x37')],'sectionId':_0x2c2cd7['id']},{})['then'](function(){return _0xb5052c;});}else{return _0xb5052c;}})['catch'](function(_0x4359fe){logger[_0x94a6('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4359fe);throw _0x4359fe;});}return _0xb5052c;})[_0x94a6('0x2a')](respondWithResult(_0x2ff1fa,0xc9))[_0x94a6('0x50')](handleError(_0x2ff1fa,null));};exports[_0x94a6('0x5c')]=function(_0x3db25c,_0x237ad1){var _0x2c6984={'where':{'id':_0x3db25c['params']['id']}},_0x9d1a0a={};_0x9d1a0a['model']=_[_0x94a6('0x3c')](db[_0x94a6('0x4c')][_0x94a6('0x39')]);_0x2c6984[_0x94a6('0x3f')]=_[_0x94a6('0x40')](_0x9d1a0a['model'],qs['fields'](_0x3db25c[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x2c6984[_0x94a6('0x3f')]=_0x2c6984[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x2c6984[_0x94a6('0x3f')]:_0x9d1a0a['model'];if(_0x3db25c['query']['includeAll']){_0x2c6984[_0x94a6('0x4e')]=[{'all':!![]}];}_0x2c6984=_['merge']({},_0x2c6984,_0x3db25c['options']);return db[_0x94a6('0x4c')][_0x94a6('0x53')](_0x2c6984)[_0x94a6('0x2a')](handleEntityNotFound(_0x237ad1,null))['then'](function(_0x405d54){if(_0x405d54){var _0xf26434=_0x405d54[_0x94a6('0x2b')]({'plain':!![]});_0xf26434=qs[_0x94a6('0x5d')](_0xf26434,['id','createdAt',_0x94a6('0x5e')]);_0x3db25c[_0x94a6('0x55')]=_[_0x94a6('0x5d')](_0x3db25c[_0x94a6('0x55')],['id',_0x94a6('0x5f'),_0x94a6('0x5e')]);return db['VoiceQueue'][_0x94a6('0x54')](_['merge'](_0xf26434,_0x3db25c[_0x94a6('0x55')]),{'include':_0x3db25c['query'][_0x94a6('0x4d')]?[{'all':!![]}]:undefined})['then'](function(_0x461010){var _0x3fbf51=_0x3db25c['user'][_0x94a6('0x2b')]({'plain':!![]});if(!_0x3fbf51)throw new Error(_0x94a6('0x56'));if(_0x3fbf51['role']===_0x94a6('0x58')){var _0xe16821=_0x461010[_0x94a6('0x2b')]({'plain':!![]});var _0x1fe768=[{'name':_0x94a6('0x2c'),'value':_0x94a6('0x2d')},{'name':_0x94a6('0x2e'),'value':_0x94a6('0x2f')}];var _0x19748c=_[_0x94a6('0x53')](_0x1fe768,[_0x94a6('0x32'),_0xe16821[_0x94a6('0x33')]])['name'];return db['UserProfileSection'][_0x94a6('0x53')]({'where':{'name':_0x19748c,'userProfileId':_0x3fbf51[_0x94a6('0x5a')]},'raw':!![]})[_0x94a6('0x2a')](function(_0x10ecd7){if(_0x10ecd7&&_0x10ecd7[_0x94a6('0x5b')]===0x0){return db[_0x94a6('0x34')][_0x94a6('0x54')]({'name':_0xe16821[_0x94a6('0x37')],'resourceId':_0xe16821['id'],'type':_0x10ecd7['name'],'sectionId':_0x10ecd7['id']},{})[_0x94a6('0x2a')](function(){return _0x461010;});}else{return _0x461010;}})[_0x94a6('0x50')](function(_0x5cedcc){logger[_0x94a6('0x35')](_0x94a6('0x60'),_0x5cedcc);throw _0x5cedcc;});}return _0x461010;});}})[_0x94a6('0x2a')](respondWithResult(_0x237ad1,0xc9))['catch'](handleError(_0x237ad1,null));};exports[_0x94a6('0x28')]=function(_0x5d5973,_0x3e6c61){if(_0x5d5973[_0x94a6('0x55')]['id']){delete _0x5d5973[_0x94a6('0x55')]['id'];}return db[_0x94a6('0x4c')][_0x94a6('0x53')]({'where':{'id':_0x5d5973[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x3e6c61,null))['then'](saveUpdates(_0x5d5973[_0x94a6('0x55')],null))[_0x94a6('0x2a')](respondWithResult(_0x3e6c61,null))[_0x94a6('0x50')](handleError(_0x3e6c61,null));};exports[_0x94a6('0x29')]=function(_0x311f20,_0x5d25da){return db[_0x94a6('0x4c')][_0x94a6('0x53')]({'where':{'id':_0x311f20[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x5d25da,null))[_0x94a6('0x2a')](removeEntity(_0x5d25da,null))['catch'](handleError(_0x5d25da,null));};exports[_0x94a6('0x61')]=function(_0x3551c0,_0x205d78,_0x4b21a7){var _0x2f9c9f={'raw':![],'where':{}};var _0x162c4f={};var _0x17c0d0={'count':0x0,'rows':[]};return db[_0x94a6('0x4c')][_0x94a6('0x62')]({'where':{'id':_0x3551c0[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x205d78,null))[_0x94a6('0x2a')](function(_0x34f093){if(_0x34f093){_0x162c4f[_0x94a6('0x3e')]=_[_0x94a6('0x3c')](db[_0x94a6('0x63')][_0x94a6('0x39')]);_0x162c4f[_0x94a6('0x3b')]=_['keys'](_0x3551c0[_0x94a6('0x3b')]);_0x162c4f[_0x94a6('0x3d')]=_[_0x94a6('0x40')](_0x162c4f['model'],_0x162c4f['query']);_0x2f9c9f[_0x94a6('0x3f')]=_[_0x94a6('0x40')](_0x162c4f[_0x94a6('0x3e')],qs['fields'](_0x3551c0[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x2f9c9f[_0x94a6('0x3f')]=_0x2f9c9f[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x2f9c9f[_0x94a6('0x3f')]:_0x162c4f[_0x94a6('0x3e')];if(!_0x3551c0[_0x94a6('0x3b')][_0x94a6('0x43')](_0x94a6('0x44'))){_0x2f9c9f[_0x94a6('0x21')]=qs[_0x94a6('0x21')](_0x3551c0[_0x94a6('0x3b')]['limit']);_0x2f9c9f[_0x94a6('0x1f')]=qs[_0x94a6('0x1f')](_0x3551c0[_0x94a6('0x3b')][_0x94a6('0x1f')]);}_0x2f9c9f[_0x94a6('0x45')]=qs[_0x94a6('0x46')](_0x3551c0['query']['sort']);_0x2f9c9f[_0x94a6('0x47')]=qs[_0x94a6('0x3d')](_['pick'](_0x3551c0[_0x94a6('0x3b')],_0x162c4f[_0x94a6('0x3d')]));_0x2f9c9f[_0x94a6('0x47')]['VoiceQueueId']=_0x34f093['id'];if(_0x3551c0[_0x94a6('0x3b')][_0x94a6('0x30')]){_0x2f9c9f[_0x94a6('0x47')]=_[_0x94a6('0x49')](_0x2f9c9f[_0x94a6('0x47')],{'$or':_['map'](_0x2f9c9f[_0x94a6('0x3f')],function(_0x15f144){var _0xae305={};_0xae305[_0x15f144]={'$like':'%'+_0x3551c0[_0x94a6('0x3b')][_0x94a6('0x30')]+'%'};return _0xae305;})});}_0x2f9c9f=_['merge']({},_0x2f9c9f,_0x3551c0[_0x94a6('0x4b')]);return db[_0x94a6('0x63')][_0x94a6('0x22')]({'where':_0x2f9c9f['where']})[_0x94a6('0x2a')](function(_0x411d99){_0x17c0d0[_0x94a6('0x22')]=_0x411d99;if(_0x3551c0['query']['includeAll']){_0x2f9c9f[_0x94a6('0x4e')]=[{'all':!![]}];}return db[_0x94a6('0x63')][_0x94a6('0x4f')](_0x2f9c9f);})[_0x94a6('0x2a')](function(_0x1fce6a){_0x17c0d0[_0x94a6('0x64')]=_0x1fce6a;return _0x17c0d0;});}})['then'](respondWithFilteredResult(_0x205d78,_0x2f9c9f))[_0x94a6('0x50')](handleError(_0x205d78,null));};exports[_0x94a6('0x65')]=function(_0x5e82f9,_0x576249,_0x2c4df1){var _0x18d1a5={'raw':!![],'where':{}};var _0x12be31={};var _0x3f6a6e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x94a6('0x62')]({'where':{'id':_0x5e82f9[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x576249,null))[_0x94a6('0x2a')](function(_0xf34e91){if(_0xf34e91){_0x12be31[_0x94a6('0x3e')]=_[_0x94a6('0x3c')](db['CmHopperHistory'][_0x94a6('0x39')]);_0x12be31['query']=_[_0x94a6('0x3c')](_0x5e82f9[_0x94a6('0x3b')]);_0x12be31[_0x94a6('0x3d')]=_['intersection'](_0x12be31['model'],_0x12be31[_0x94a6('0x3b')]);_0x18d1a5[_0x94a6('0x3f')]=_['intersection'](_0x12be31['model'],qs['fields'](_0x5e82f9[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x18d1a5['attributes']=_0x18d1a5[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x18d1a5['attributes']:_0x12be31[_0x94a6('0x3e')];if(!_0x5e82f9['query'][_0x94a6('0x43')](_0x94a6('0x44'))){_0x18d1a5[_0x94a6('0x21')]=qs[_0x94a6('0x21')](_0x5e82f9[_0x94a6('0x3b')][_0x94a6('0x21')]);_0x18d1a5[_0x94a6('0x1f')]=qs['offset'](_0x5e82f9['query']['offset']);}_0x18d1a5[_0x94a6('0x45')]=qs[_0x94a6('0x46')](_0x5e82f9[_0x94a6('0x3b')]['sort']);_0x18d1a5[_0x94a6('0x47')]=qs[_0x94a6('0x3d')](_['pick'](_0x5e82f9['query'],_0x12be31[_0x94a6('0x3d')]));_0x18d1a5['where']['VoiceQueueId']=_0xf34e91['id'];if(_0x5e82f9['query']['filter']){_0x18d1a5['where']=_[_0x94a6('0x49')](_0x18d1a5[_0x94a6('0x47')],{'$or':_['map'](_0x18d1a5[_0x94a6('0x3f')],function(_0xd24785){var _0x20dcdc={};_0x20dcdc[_0xd24785]={'$like':'%'+_0x5e82f9[_0x94a6('0x3b')][_0x94a6('0x30')]+'%'};return _0x20dcdc;})});}_0x18d1a5=_[_0x94a6('0x49')]({},_0x18d1a5,_0x5e82f9[_0x94a6('0x4b')]);return db[_0x94a6('0x66')][_0x94a6('0x22')]({'where':_0x18d1a5['where']})[_0x94a6('0x2a')](function(_0x4d383d){_0x3f6a6e[_0x94a6('0x22')]=_0x4d383d;if(_0x5e82f9[_0x94a6('0x3b')]['includeAll']){_0x18d1a5[_0x94a6('0x4e')]=[{'all':!![]}];}return db[_0x94a6('0x66')][_0x94a6('0x4f')](_0x18d1a5);})['then'](function(_0x1bdd7b){_0x3f6a6e[_0x94a6('0x64')]=_0x1bdd7b;return _0x3f6a6e;});}})[_0x94a6('0x2a')](respondWithFilteredResult(_0x576249,_0x18d1a5))[_0x94a6('0x50')](handleError(_0x576249,null));};exports[_0x94a6('0x67')]=function(_0x2ea74e,_0x291388,_0x45c7e8){var _0x567068={'raw':!![],'where':{}};var _0x2956cc={};var _0x689075={'count':0x0,'rows':[]};return db[_0x94a6('0x4c')]['findOne']({'where':{'id':_0x2ea74e['params']['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x291388,null))[_0x94a6('0x2a')](function(_0x394fb8){if(_0x394fb8){_0x2956cc[_0x94a6('0x3e')]=_['keys'](db[_0x94a6('0x68')]['rawAttributes']);_0x2956cc[_0x94a6('0x3b')]=_[_0x94a6('0x3c')](_0x2ea74e['query']);_0x2956cc[_0x94a6('0x3d')]=_[_0x94a6('0x40')](_0x2956cc[_0x94a6('0x3e')],_0x2956cc[_0x94a6('0x3b')]);_0x567068[_0x94a6('0x3f')]=_[_0x94a6('0x40')](_0x2956cc[_0x94a6('0x3e')],qs[_0x94a6('0x41')](_0x2ea74e[_0x94a6('0x3b')]['fields']));_0x567068[_0x94a6('0x3f')]=_0x567068[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x567068[_0x94a6('0x3f')]:_0x2956cc[_0x94a6('0x3e')];if(!_0x2ea74e['query'][_0x94a6('0x43')](_0x94a6('0x44'))){_0x567068[_0x94a6('0x21')]=qs['limit'](_0x2ea74e[_0x94a6('0x3b')][_0x94a6('0x21')]);_0x567068['offset']=qs['offset'](_0x2ea74e[_0x94a6('0x3b')][_0x94a6('0x1f')]);}_0x567068[_0x94a6('0x45')]=qs['sort'](_0x2ea74e[_0x94a6('0x3b')][_0x94a6('0x46')]);_0x567068[_0x94a6('0x47')]=qs[_0x94a6('0x3d')](_[_0x94a6('0x48')](_0x2ea74e['query'],_0x2956cc['filters']));_0x567068[_0x94a6('0x47')][_0x94a6('0x69')]=_0x394fb8['id'];if(_0x2ea74e[_0x94a6('0x3b')][_0x94a6('0x30')]){_0x567068[_0x94a6('0x47')]=_[_0x94a6('0x49')](_0x567068[_0x94a6('0x47')],{'$or':_[_0x94a6('0x31')](_0x567068[_0x94a6('0x3f')],function(_0x2d65d4){var _0x38fce2={};_0x38fce2[_0x2d65d4]={'$like':'%'+_0x2ea74e[_0x94a6('0x3b')]['filter']+'%'};return _0x38fce2;})});}_0x567068=_[_0x94a6('0x49')]({},_0x567068,_0x2ea74e[_0x94a6('0x4b')]);return db[_0x94a6('0x68')][_0x94a6('0x22')]({'where':_0x567068[_0x94a6('0x47')]})['then'](function(_0x240159){_0x689075[_0x94a6('0x22')]=_0x240159;if(_0x2ea74e[_0x94a6('0x3b')][_0x94a6('0x4d')]){_0x567068[_0x94a6('0x4e')]=[{'all':!![]}];}return db[_0x94a6('0x68')]['findAll'](_0x567068);})[_0x94a6('0x2a')](function(_0x362004){_0x689075[_0x94a6('0x64')]=_0x362004;return _0x689075;});}})[_0x94a6('0x2a')](respondWithFilteredResult(_0x291388,_0x567068))[_0x94a6('0x50')](handleError(_0x291388,null));};exports[_0x94a6('0x6a')]=function(_0x2d71f3,_0xf85f,_0x89d825){var _0x2f9961={'raw':!![],'where':{}};var _0x1e9273={};var _0x1148d3={'count':0x0,'rows':[]};return db[_0x94a6('0x4c')][_0x94a6('0x62')]({'where':{'id':_0x2d71f3[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0xf85f,null))[_0x94a6('0x2a')](function(_0x40cc38){if(_0x40cc38){_0x1e9273['model']=_[_0x94a6('0x3c')](db[_0x94a6('0x6b')][_0x94a6('0x39')]);_0x1e9273[_0x94a6('0x3b')]=_[_0x94a6('0x3c')](_0x2d71f3[_0x94a6('0x3b')]);_0x1e9273[_0x94a6('0x3d')]=_[_0x94a6('0x40')](_0x1e9273[_0x94a6('0x3e')],_0x1e9273[_0x94a6('0x3b')]);_0x2f9961['attributes']=_['intersection'](_0x1e9273[_0x94a6('0x3e')],qs[_0x94a6('0x41')](_0x2d71f3[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x2f9961[_0x94a6('0x3f')]=_0x2f9961[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x2f9961[_0x94a6('0x3f')]:_0x1e9273[_0x94a6('0x3e')];if(!_0x2d71f3[_0x94a6('0x3b')][_0x94a6('0x43')](_0x94a6('0x44'))){_0x2f9961['limit']=qs[_0x94a6('0x21')](_0x2d71f3[_0x94a6('0x3b')][_0x94a6('0x21')]);_0x2f9961[_0x94a6('0x1f')]=qs[_0x94a6('0x1f')](_0x2d71f3['query'][_0x94a6('0x1f')]);}_0x2f9961['order']=qs[_0x94a6('0x46')](_0x2d71f3[_0x94a6('0x3b')][_0x94a6('0x46')]);_0x2f9961['where']=qs[_0x94a6('0x3d')](_[_0x94a6('0x48')](_0x2d71f3[_0x94a6('0x3b')],_0x1e9273['filters']));_0x2f9961['where'][_0x94a6('0x69')]=_0x40cc38['id'];if(_0x2d71f3[_0x94a6('0x3b')][_0x94a6('0x30')]){_0x2f9961['where']=_['merge'](_0x2f9961[_0x94a6('0x47')],{'$or':_[_0x94a6('0x31')](_0x2f9961[_0x94a6('0x3f')],function(_0x312e04){var _0x2b8759={};_0x2b8759[_0x312e04]={'$like':'%'+_0x2d71f3[_0x94a6('0x3b')]['filter']+'%'};return _0x2b8759;})});}_0x2f9961=_[_0x94a6('0x49')]({},_0x2f9961,_0x2d71f3[_0x94a6('0x4b')]);return db['CmHopperBlack'][_0x94a6('0x22')]({'where':_0x2f9961[_0x94a6('0x47')]})[_0x94a6('0x2a')](function(_0x29a43e){_0x1148d3[_0x94a6('0x22')]=_0x29a43e;if(_0x2d71f3[_0x94a6('0x3b')][_0x94a6('0x4d')]){_0x2f9961[_0x94a6('0x4e')]=[{'all':!![]}];}return db[_0x94a6('0x6b')]['findAll'](_0x2f9961);})['then'](function(_0x166eae){_0x1148d3[_0x94a6('0x64')]=_0x166eae;return _0x1148d3;});}})[_0x94a6('0x2a')](respondWithFilteredResult(_0xf85f,_0x2f9961))[_0x94a6('0x50')](handleError(_0xf85f,null));};exports[_0x94a6('0x6c')]=function(_0x3a44cb,_0x2941d5,_0x5cdbd1){var _0x142c26={};var _0x7031f5={};var _0x33ea24;var _0xf1822b;return db[_0x94a6('0x4c')][_0x94a6('0x62')]({'where':{'id':_0x3a44cb[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x2941d5,null))[_0x94a6('0x2a')](function(_0xd31883){if(_0xd31883){_0x33ea24=_0xd31883;_0x7031f5[_0x94a6('0x3e')]=_[_0x94a6('0x3c')](db['Team']['rawAttributes']);_0x7031f5['query']=_[_0x94a6('0x3c')](_0x3a44cb[_0x94a6('0x3b')]);_0x7031f5[_0x94a6('0x3d')]=_[_0x94a6('0x40')](_0x7031f5['model'],_0x7031f5[_0x94a6('0x3b')]);_0x142c26[_0x94a6('0x3f')]=_[_0x94a6('0x40')](_0x7031f5[_0x94a6('0x3e')],qs['fields'](_0x3a44cb[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x142c26[_0x94a6('0x3f')]=_0x142c26[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x142c26[_0x94a6('0x3f')]:_0x7031f5[_0x94a6('0x3e')];_0x142c26[_0x94a6('0x45')]=qs['sort'](_0x3a44cb[_0x94a6('0x3b')][_0x94a6('0x46')]);_0x142c26['where']=qs[_0x94a6('0x3d')](_[_0x94a6('0x48')](_0x3a44cb[_0x94a6('0x3b')],_0x7031f5[_0x94a6('0x3d')]));if(_0x3a44cb[_0x94a6('0x3b')]['filter']){_0x142c26[_0x94a6('0x47')]=_['merge'](_0x142c26[_0x94a6('0x47')],{'$or':_[_0x94a6('0x31')](_0x142c26[_0x94a6('0x3f')],function(_0x1f8016){var _0x5da350={};_0x5da350[_0x1f8016]={'$like':'%'+_0x3a44cb[_0x94a6('0x3b')]['filter']+'%'};return _0x5da350;})});}_0x142c26=_[_0x94a6('0x49')]({},_0x142c26,_0x3a44cb[_0x94a6('0x4b')]);return _0x33ea24[_0x94a6('0x6c')](_0x142c26);}})['then'](function(_0x4f173f){if(_0x4f173f){_0xf1822b=_0x4f173f[_0x94a6('0x42')];if(!_0x3a44cb['query'][_0x94a6('0x43')]('nolimit')){_0x142c26[_0x94a6('0x21')]=qs[_0x94a6('0x21')](_0x3a44cb[_0x94a6('0x3b')]['limit']);_0x142c26[_0x94a6('0x1f')]=qs['offset'](_0x3a44cb[_0x94a6('0x3b')][_0x94a6('0x1f')]);}return _0x33ea24[_0x94a6('0x6c')](_0x142c26);}})[_0x94a6('0x2a')](function(_0x102ec1){if(_0x102ec1){return _0x102ec1?{'count':_0xf1822b,'rows':_0x102ec1}:null;}})[_0x94a6('0x2a')](respondWithResult(_0x2941d5,null))[_0x94a6('0x50')](handleError(_0x2941d5,null));};exports[_0x94a6('0x6d')]=function(_0x42a4a8,_0x17775d,_0x10fb35){var _0x4603b7=_0x42a4a8['body'][_0x94a6('0x6e')];var _0x235377=_[_0x94a6('0x31')](_0x4603b7,'id');return db[_0x94a6('0x6f')]['findAll']({'where':{'id':_0x235377},'attributes':['id'],'include':[{'model':db[_0x94a6('0x70')],'as':_0x94a6('0x71'),'attributes':['id',_0x94a6('0x37'),_0x94a6('0x72'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x425db1){if(_0x425db1){var _0x220ec2=_[_0x94a6('0x73')](_0x425db1,function(_0x33ce25){var _0x5d9852=_0x33ce25[_0x94a6('0x2b')]({'plain':!![]});_0x5d9852[_0x94a6('0x71')][_0x94a6('0x74')](function(_0x1679dc){_0x1679dc[_0x94a6('0x75')]=_[_0x94a6('0x53')](_0x4603b7,{'id':_0x5d9852['id']})[_0x94a6('0x75')];});return _0x5d9852[_0x94a6('0x71')];});return db[_0x94a6('0x4c')][_0x94a6('0x53')]({'where':{'id':_0x42a4a8[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](function(_0x28dda1){return db[_0x94a6('0x76')]['transaction'](function(_0x5d8d50){return _0x28dda1[_0x94a6('0x6d')](_0x235377,{'transaction':_0x5d8d50})['then'](function(){return BPromise[_0x94a6('0x77')](_0x4603b7,function(_0x466d0c){return db[_0x94a6('0x78')][_0x94a6('0x79')]({'TeamId':_0x466d0c['id'],'VoiceQueueId':_0x42a4a8[_0x94a6('0x52')]['id'],'penalty':_0x466d0c[_0x94a6('0x75')]},{'transaction':_0x5d8d50});});})[_0x94a6('0x2a')](function(){return BPromise[_0x94a6('0x77')](_0x220ec2,function(_0x5accd0){return db['UserVoiceQueue'][_0x94a6('0x7a')]({'where':{'UserId':_0x5accd0['id'],'VoiceQueueId':_0x42a4a8[_0x94a6('0x52')]['id']},'defaults':{'penalty':_0x5accd0[_0x94a6('0x75')]},'transaction':_0x5d8d50});});})[_0x94a6('0x2a')](function(){return BPromise[_0x94a6('0x77')](_[_0x94a6('0x30')](_0x220ec2,{'online':!![]}),function(_0x4f05f1){return db['UserVoiceQueueRt'][_0x94a6('0x79')]({'membername':_0x4f05f1['name'],'UserId':_0x4f05f1['id'],'queue_name':_0x28dda1[_0x94a6('0x37')],'VoiceQueueId':_0x28dda1['id'],'interface':_['isNil'](_0x4f05f1[_0x94a6('0x7b')])?util[_0x94a6('0x7c')](_0x94a6('0x7d'),_0x4f05f1[_0x94a6('0x37')]):_0x4f05f1[_0x94a6('0x7b')],'paused':_0x4f05f1['voicePause']||![],'penalty':_0x4f05f1['penalty']},{'transaction':_0x5d8d50});});})['then'](function(){_0x220ec2['forEach'](function(_0x3743e4){socket[_0x94a6('0x7e')](_0x94a6('0x7f'),{'UserId':_0x3743e4['id'],'VoiceQueueId':_0x28dda1['id']});});});});});}})['then'](respondWithStatusCode(_0x17775d,null))['catch'](handleError(_0x17775d,null));};exports[_0x94a6('0x80')]=function(_0x4c1d08,_0x216ab3,_0x546058){return db[_0x94a6('0x6f')]['findAll']({'where':{'id':_0x4c1d08[_0x94a6('0x3b')][_0x94a6('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x94a6('0x71'),'attributes':['id'],'raw':!![]}]})[_0x94a6('0x2a')](handleEntityNotFound(_0x216ab3,null))['then'](function(_0x108f3f){var _0x43e2d3=_['map'](_0x108f3f,'id');var _0x5aa2ec=[];var _0x23d51b=[];var _0x294c37=squel[_0x94a6('0x82')]();_0x294c37['field'](_0x94a6('0x83'))[_0x94a6('0x84')]('team_has_voice_queues','tq')[_0x94a6('0x85')](_0x94a6('0x86'),'ut',_0x94a6('0x87'))['where']('VoiceQueueId\x20=\x20?',_0x4c1d08[_0x94a6('0x52')]['id']);for(var _0x454013=0x0;_0x454013<_0x108f3f[_0x94a6('0x42')];_0x454013+=0x1){let _0xfd94fb=_0x108f3f[_0x454013];for(var _0xb5254c=0x0;_0xb5254c<_0xfd94fb[_0x94a6('0x71')]['length'];_0xb5254c+=0x1){let _0x3f71bd=_0xfd94fb[_0x94a6('0x71')][_0xb5254c];var _0x475932=_0x294c37[_0x94a6('0x5c')]();_0x475932[_0x94a6('0x47')](_0x94a6('0x88'),_0x3f71bd['id']);_0x23d51b[_0x94a6('0x89')](db[_0x94a6('0x76')]['query'](_0x475932[_0x94a6('0x8a')](),{'type':db[_0x94a6('0x76')][_0x94a6('0x8b')][_0x94a6('0x8c')]})[_0x94a6('0x2a')](function(_0x4858ea){if(_0x4858ea[_0x94a6('0x42')]===0x1){return _0x3f71bd['id'];}else{var _0x20eb4f=_[_0x94a6('0x8d')](_[_0x94a6('0x31')](_0x4858ea,'TeamId'),function(_0xd90f7b){return _[_0x94a6('0x8e')](_0x43e2d3,_0xd90f7b);});if(_0x20eb4f){return _0x3f71bd['id'];}}}));}}return BPromise[_0x94a6('0x8f')](_0x23d51b)['then'](function(_0x2eb05d){_0x5aa2ec=_(_0x5aa2ec)[_0x94a6('0x90')](_0x2eb05d)[_0x94a6('0x91')]()[_0x94a6('0x32')]();return db[_0x94a6('0x4c')][_0x94a6('0x53')]({'where':{'id':_0x4c1d08[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](function(_0x5227e6){return db[_0x94a6('0x76')][_0x94a6('0x92')](function(_0x580e21){return _0x5227e6[_0x94a6('0x80')](_0x4c1d08[_0x94a6('0x3b')][_0x94a6('0x81')],{'transaction':_0x580e21})[_0x94a6('0x2a')](function(){if(!_[_0x94a6('0x93')](_0x5aa2ec)){return _0x5227e6[_0x94a6('0x94')](_0x5aa2ec,{'transaction':_0x580e21})[_0x94a6('0x2a')](function(){return db[_0x94a6('0x95')][_0x94a6('0x29')]({'where':{'VoiceQueueId':_0x4c1d08[_0x94a6('0x52')]['id'],'UserId':_0x5aa2ec},'transaction':_0x580e21});});}})['then'](function(){_0x5aa2ec['forEach'](function(_0x87371d){socket[_0x94a6('0x7e')](_0x94a6('0x96'),{'UserId':_0x87371d,'VoiceQueueId':_0x5227e6['id']});});});});});});})[_0x94a6('0x2a')](respondWithStatusCode(_0x216ab3,null))[_0x94a6('0x50')](handleError(_0x216ab3,null));};exports[_0x94a6('0x97')]=function(_0x358d4e,_0x212c09,_0x30c1ab){var _0xcd1677,_0x3cd830;return db['VoiceQueue'][_0x94a6('0x53')]({'where':{'id':_0x358d4e[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x212c09,null))[_0x94a6('0x2a')](function(_0x2589e4){if(_0x2589e4){_0x3cd830=_0x2589e4;return _0x2589e4[_0x94a6('0x97')](_0x358d4e[_0x94a6('0x55')][_0x94a6('0x81')],_[_0x94a6('0x5d')](_0x358d4e[_0x94a6('0x55')],[_0x94a6('0x81'),'id'])||{})[_0x94a6('0x98')](function(_0x4a2a09){for(var _0x53cf27=0x0;_0x53cf27<_0x358d4e[_0x94a6('0x55')]['ids'][_0x94a6('0x42')];_0x53cf27+=0x1){socket[_0x94a6('0x7e')](_0x94a6('0x7f'),{'UserId':Number(_0x358d4e[_0x94a6('0x55')]['ids'][_0x53cf27]),'VoiceQueueId':Number(_0x358d4e[_0x94a6('0x52')]['id'])});}return _0x4a2a09;});}})[_0x94a6('0x2a')](function(_0x57b5c0){_0xcd1677=_0x57b5c0||[];if(_0x3cd830){return db['User']['findAll']({'where':{'id':_0x358d4e[_0x94a6('0x55')][_0x94a6('0x81')]},'attributes':['id',_0x94a6('0x37'),_0x94a6('0x72'),'voicePause',_0x94a6('0x7b')],'raw':!![]});}})[_0x94a6('0x2a')](function(_0x4d5e2b){if(!_[_0x94a6('0x93')](_0x4d5e2b)){var _0x3aee0e=[];for(var _0x45e30b=0x0;_0x45e30b<_0x4d5e2b['length'];_0x45e30b++){if(_0x4d5e2b[_0x45e30b][_0x94a6('0x72')]){_0x3aee0e['push'](db['UserVoiceQueueRt'][_0x94a6('0x79')]({'membername':_0x4d5e2b[_0x45e30b]['name'],'UserId':_0x4d5e2b[_0x45e30b]['id'],'queue_name':_0x3cd830[_0x94a6('0x37')],'VoiceQueueId':_0x3cd830['id'],'interface':_[_0x94a6('0x99')](_0x4d5e2b[_0x45e30b][_0x94a6('0x7b')])?util[_0x94a6('0x7c')]('SIP/%s',_0x4d5e2b[_0x45e30b]['name']):_0x4d5e2b[_0x45e30b][_0x94a6('0x7b')],'paused':_0x4d5e2b[_0x45e30b]['voicePause']||![],'penalty':_0x358d4e[_0x94a6('0x55')][_0x94a6('0x75')]||0x0}));}}return BPromise['all'](_0x3aee0e);}})[_0x94a6('0x2a')](function(){return _0xcd1677;})['then'](respondWithResult(_0x212c09,null))[_0x94a6('0x50')](handleError(_0x212c09,null));};exports[_0x94a6('0x94')]=function(_0x494a5f,_0x10c9a0,_0x3d2b49){return db[_0x94a6('0x4c')][_0x94a6('0x53')]({'where':{'id':_0x494a5f[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x10c9a0,null))[_0x94a6('0x2a')](function(_0x55a1c0){if(_0x55a1c0){return _0x55a1c0[_0x94a6('0x94')](_0x494a5f[_0x94a6('0x3b')]['ids'])[_0x94a6('0x2a')](function(){if(_['isArray'](_0x494a5f[_0x94a6('0x3b')][_0x94a6('0x81')])){for(var _0x484e05=0x0;_0x484e05<_0x494a5f[_0x94a6('0x3b')][_0x94a6('0x81')][_0x94a6('0x42')];_0x484e05+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x494a5f['query'][_0x94a6('0x81')][_0x484e05]),'VoiceQueueId':Number(_0x494a5f[_0x94a6('0x52')]['id'])});}}else{socket[_0x94a6('0x7e')](_0x94a6('0x96'),{'UserId':Number(_0x494a5f['query'][_0x94a6('0x81')]),'VoiceQueueId':Number(_0x494a5f[_0x94a6('0x52')]['id'])});}});}})[_0x94a6('0x2a')](function(_0x293b73){return db[_0x94a6('0x95')][_0x94a6('0x29')]({'where':{'VoiceQueueId':_0x494a5f[_0x94a6('0x52')]['id'],'UserId':_0x494a5f[_0x94a6('0x3b')][_0x94a6('0x81')]}})[_0x94a6('0x2a')](function(){return _0x293b73;});})[_0x94a6('0x2a')](respondWithStatusCode(_0x10c9a0,null))[_0x94a6('0x50')](handleError(_0x10c9a0,null));};exports[_0x94a6('0x9a')]=function(_0x33dac2,_0x3f6d82,_0x2cba8d){var _0x340023={};var _0x19bc5c={};var _0x217e85;var _0x32e8b7;return db[_0x94a6('0x4c')][_0x94a6('0x62')]({'where':{'id':_0x33dac2['params']['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x3f6d82,null))['then'](function(_0x51856a){if(_0x51856a){_0x217e85=_0x51856a;_0x19bc5c[_0x94a6('0x3e')]=_[_0x94a6('0x3c')](db['User'][_0x94a6('0x39')]);_0x19bc5c[_0x94a6('0x3b')]=_[_0x94a6('0x3c')](_0x33dac2[_0x94a6('0x3b')]);_0x19bc5c[_0x94a6('0x3d')]=_[_0x94a6('0x40')](_0x19bc5c['model'],_0x19bc5c[_0x94a6('0x3b')]);_0x340023['attributes']=_['intersection'](_0x19bc5c[_0x94a6('0x3e')],qs[_0x94a6('0x41')](_0x33dac2['query'][_0x94a6('0x41')]));_0x340023[_0x94a6('0x3f')]=_0x340023[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x340023['attributes']:_0x19bc5c[_0x94a6('0x3e')];_0x340023[_0x94a6('0x45')]=qs[_0x94a6('0x46')](_0x33dac2[_0x94a6('0x3b')]['sort']);_0x340023[_0x94a6('0x47')]=qs['filters'](_['pick'](_0x33dac2['query'],_0x19bc5c[_0x94a6('0x3d')]));if(_0x33dac2[_0x94a6('0x3b')][_0x94a6('0x30')]){_0x340023[_0x94a6('0x47')]=_[_0x94a6('0x49')](_0x340023[_0x94a6('0x47')],{'$or':_[_0x94a6('0x31')](_0x340023[_0x94a6('0x3f')],function(_0x41fe9a){var _0x684e77={};_0x684e77[_0x41fe9a]={'$like':'%'+_0x33dac2[_0x94a6('0x3b')]['filter']+'%'};return _0x684e77;})});}_0x340023=_[_0x94a6('0x49')]({},_0x340023,_0x33dac2[_0x94a6('0x4b')]);return _0x217e85[_0x94a6('0x9a')](_0x340023);}})[_0x94a6('0x2a')](function(_0x5bfb5b){if(_0x5bfb5b){_0x32e8b7=_0x5bfb5b[_0x94a6('0x42')];if(!_0x33dac2[_0x94a6('0x3b')][_0x94a6('0x43')](_0x94a6('0x44'))){_0x340023[_0x94a6('0x21')]=qs[_0x94a6('0x21')](_0x33dac2[_0x94a6('0x3b')][_0x94a6('0x21')]);_0x340023[_0x94a6('0x1f')]=qs[_0x94a6('0x1f')](_0x33dac2[_0x94a6('0x3b')][_0x94a6('0x1f')]);}return _0x217e85[_0x94a6('0x9a')](_0x340023);}})['then'](function(_0x89855a){if(_0x89855a){return _0x89855a?{'count':_0x32e8b7,'rows':_0x89855a}:null;}})[_0x94a6('0x2a')](respondWithResult(_0x3f6d82,null))[_0x94a6('0x50')](handleError(_0x3f6d82,null));};exports[_0x94a6('0x9b')]=function(_0x3e56c7,_0x32281d,_0x98f30a){var _0x142aa2={};var _0x4d05fa={};var _0x422f82;var _0x59aa86;return db[_0x94a6('0x4c')][_0x94a6('0x62')]({'where':{'id':_0x3e56c7[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x32281d,null))[_0x94a6('0x2a')](function(_0xcca928){if(_0xcca928){_0x422f82=_0xcca928;_0x4d05fa[_0x94a6('0x3e')]=_[_0x94a6('0x3c')](db[_0x94a6('0x95')]['rawAttributes']);_0x4d05fa[_0x94a6('0x3b')]=_[_0x94a6('0x3c')](_0x3e56c7[_0x94a6('0x3b')]);_0x4d05fa[_0x94a6('0x3d')]=_[_0x94a6('0x40')](_0x4d05fa[_0x94a6('0x3e')],_0x4d05fa['query']);_0x142aa2['attributes']=_[_0x94a6('0x40')](_0x4d05fa[_0x94a6('0x3e')],qs[_0x94a6('0x41')](_0x3e56c7[_0x94a6('0x3b')]['fields']));_0x142aa2[_0x94a6('0x3f')]=_0x142aa2['attributes'][_0x94a6('0x42')]?_0x142aa2[_0x94a6('0x3f')]:_0x4d05fa['model'];_0x142aa2[_0x94a6('0x45')]=qs[_0x94a6('0x46')](_0x3e56c7[_0x94a6('0x3b')][_0x94a6('0x46')]);_0x142aa2[_0x94a6('0x47')]=qs['filters'](_[_0x94a6('0x48')](_0x3e56c7['query'],_0x4d05fa[_0x94a6('0x3d')]));if(_0x3e56c7[_0x94a6('0x3b')][_0x94a6('0x30')]){_0x142aa2['where']=_[_0x94a6('0x49')](_0x142aa2[_0x94a6('0x47')],{'$or':_['map'](_0x142aa2[_0x94a6('0x3f')],function(_0x566dda){var _0x1dff51={};_0x1dff51[_0x566dda]={'$like':'%'+_0x3e56c7[_0x94a6('0x3b')]['filter']+'%'};return _0x1dff51;})});}_0x142aa2=_[_0x94a6('0x49')]({},_0x142aa2,_0x3e56c7[_0x94a6('0x4b')]);return _0x422f82['getMembers'](_0x142aa2);}})[_0x94a6('0x2a')](function(_0x504400){if(_0x504400){_0x59aa86=_0x504400[_0x94a6('0x42')];if(!_0x3e56c7['query']['hasOwnProperty'](_0x94a6('0x44'))){_0x142aa2[_0x94a6('0x21')]=qs[_0x94a6('0x21')](_0x3e56c7[_0x94a6('0x3b')][_0x94a6('0x21')]);_0x142aa2[_0x94a6('0x1f')]=qs[_0x94a6('0x1f')](_0x3e56c7[_0x94a6('0x3b')][_0x94a6('0x1f')]);}return _0x422f82['getMembers'](_0x142aa2);}})[_0x94a6('0x2a')](function(_0x43f98a){return _0x43f98a?{'count':_0x59aa86,'rows':_0x43f98a}:null;})[_0x94a6('0x2a')](respondWithResult(_0x32281d,null))[_0x94a6('0x50')](handleError(_0x32281d,null));};exports[_0x94a6('0x9c')]=function(_0x385240,_0x547d13,_0x49dae2){var _0x577d47={};var _0xd63d41={};var _0x4cc70c;var _0x2c950e;return db['VoiceQueue']['findOne']({'where':{'id':_0x385240['params']['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x547d13,null))[_0x94a6('0x2a')](function(_0x1841a0){if(_0x1841a0){_0x4cc70c=_0x1841a0;_0xd63d41[_0x94a6('0x3e')]=_[_0x94a6('0x3c')](db[_0x94a6('0x9d')][_0x94a6('0x39')]);_0xd63d41[_0x94a6('0x3b')]=_[_0x94a6('0x3c')](_0x385240[_0x94a6('0x3b')]);_0xd63d41['filters']=_[_0x94a6('0x40')](_0xd63d41[_0x94a6('0x3e')],_0xd63d41[_0x94a6('0x3b')]);_0x577d47[_0x94a6('0x3f')]=_[_0x94a6('0x40')](_0xd63d41[_0x94a6('0x3e')],qs[_0x94a6('0x41')](_0x385240[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x577d47[_0x94a6('0x3f')]=_0x577d47['attributes'][_0x94a6('0x42')]?_0x577d47[_0x94a6('0x3f')]:_0xd63d41[_0x94a6('0x3e')];_0x577d47[_0x94a6('0x45')]=qs[_0x94a6('0x46')](_0x385240[_0x94a6('0x3b')][_0x94a6('0x46')]);_0x577d47[_0x94a6('0x47')]=qs[_0x94a6('0x3d')](_['pick'](_0x385240['query'],_0xd63d41[_0x94a6('0x3d')]));if(_0x385240['query'][_0x94a6('0x30')]){_0x577d47[_0x94a6('0x47')]=_['merge'](_0x577d47[_0x94a6('0x47')],{'$or':_[_0x94a6('0x31')](_0x577d47[_0x94a6('0x3f')],function(_0x5569e2){var _0x3a223d={};_0x3a223d[_0x5569e2]={'$like':'%'+_0x385240['query'][_0x94a6('0x30')]+'%'};return _0x3a223d;})});}_0x577d47=_['merge']({},_0x577d47,_0x385240[_0x94a6('0x4b')]);return _0x4cc70c[_0x94a6('0x9c')](_0x577d47);}})['then'](function(_0x30409f){if(_0x30409f){_0x2c950e=_0x30409f[_0x94a6('0x42')];if(!_0x385240[_0x94a6('0x3b')]['hasOwnProperty']('nolimit')){_0x577d47['limit']=qs[_0x94a6('0x21')](_0x385240[_0x94a6('0x3b')]['limit']);_0x577d47[_0x94a6('0x1f')]=qs[_0x94a6('0x1f')](_0x385240['query']['offset']);}return _0x4cc70c[_0x94a6('0x9c')](_0x577d47);}})[_0x94a6('0x2a')](function(_0x3b9edf){if(_0x3b9edf){return _0x3b9edf?{'count':_0x2c950e,'rows':_0x3b9edf}:null;}})[_0x94a6('0x2a')](respondWithResult(_0x547d13,null))[_0x94a6('0x50')](handleError(_0x547d13,null));};exports['addLists']=function(_0xef3adf,_0x3b4af3,_0x42f8af){var _0x4478dd,_0x266e7c;return db[_0x94a6('0x4c')][_0x94a6('0x53')]({'where':{'id':_0xef3adf[_0x94a6('0x52')]['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x3b4af3,null))[_0x94a6('0x2a')](function(_0x3a8445){if(_0x3a8445){_0x266e7c=_0x3a8445;return _0x3a8445[_0x94a6('0x9e')](_0xef3adf[_0x94a6('0x55')][_0x94a6('0x81')],_[_0x94a6('0x5d')](_0xef3adf[_0x94a6('0x55')],[_0x94a6('0x81'),'id'])||{});}return null;})[_0x94a6('0x98')](function(_0x1ecd34){var _0x437b5f;_0x4478dd=_0x1ecd34||[];var _0x4628e8=[];if(_0x1ecd34){for(var _0xac63a7=0x0;_0xac63a7<_0x1ecd34[_0x94a6('0x42')];_0xac63a7+=0x1){var _0x2ff61e=_0x1ecd34[_0xac63a7][_0x94a6('0x2b')]({'plain':!![]});_0x266e7c[_0x94a6('0x9f')]=_0xef3adf[_0x94a6('0x55')][_0x94a6('0x9f')]?_0xef3adf[_0x94a6('0x55')][_0x94a6('0x9f')]:_0x266e7c['dialCheckDuplicateType'];switch(_0x266e7c['dialCheckDuplicateType']){case _0x94a6('0xa0'):_0x437b5f=squel['insert']()[_0x94a6('0xa1')](_0x94a6('0xa2'))[_0x94a6('0xa3')]([_0x94a6('0xa4'),_0x94a6('0xa5'),'ContactId',_0x94a6('0xa6'),_0x94a6('0x69'),_0x94a6('0x5f'),_0x94a6('0x5e')],squel[_0x94a6('0x82')]()['field'](_0x94a6('0xa4'),_0x94a6('0xa4'))['field']('NOW()','scheduledAt')[_0x94a6('0xa7')]('id',_0x94a6('0xa8'))[_0x94a6('0xa7')](_0x2ff61e[_0x94a6('0xa9')][_0x94a6('0x8a')](),_0x94a6('0xa6'))['field'](_0xef3adf['params']['id'][_0x94a6('0x8a')](),_0x94a6('0x69'))[_0x94a6('0xa7')](_0x94a6('0xaa'),'createdAt')[_0x94a6('0xa7')](_0x94a6('0xaa'),'updatedAt')[_0x94a6('0x84')](_0x94a6('0xab'))[_0x94a6('0x47')]('deletedAt\x20IS\x20NULL')['where'](_0x94a6('0xac'),_0x2ff61e[_0x94a6('0xa9')][_0x94a6('0x8a')]())[_0x94a6('0x47')](_0x94a6('0xad'))[_0x94a6('0x47')](_0x94a6('0xae'),squel[_0x94a6('0x82')]()[_0x94a6('0xa7')](_0x94a6('0xaf'))[_0x94a6('0x84')](_0x94a6('0xb0'))[_0x94a6('0x47')](_0x94a6('0xb1'),_0xef3adf[_0x94a6('0x52')]['id']['toString']()))[_0x94a6('0x47')](_0x94a6('0xae'),squel[_0x94a6('0x82')]()[_0x94a6('0xa7')](_0x94a6('0xb2'))[_0x94a6('0x84')](_0x94a6('0xa2'))[_0x94a6('0x47')](_0x94a6('0xb1'),_0xef3adf['params']['id'][_0x94a6('0x8a')]())))[_0x94a6('0x8a')]();break;case _0x94a6('0xb3'):_0x437b5f=squel[_0x94a6('0xb4')]()[_0x94a6('0xa1')](_0x94a6('0xa2'))[_0x94a6('0xa3')](['phone',_0x94a6('0xa5'),_0x94a6('0xa8'),_0x94a6('0xa6'),'VoiceQueueId','createdAt','updatedAt'],squel['select']()['field']('phone','phone')['field'](_0x94a6('0xaa'),_0x94a6('0xa5'))[_0x94a6('0xa7')]('id','ContactId')[_0x94a6('0xa7')](_0x2ff61e[_0x94a6('0xa9')]['toString'](),_0x94a6('0xa6'))[_0x94a6('0xa7')](_0xef3adf[_0x94a6('0x52')]['id']['toString'](),_0x94a6('0x69'))[_0x94a6('0xa7')](_0x94a6('0xaa'),_0x94a6('0x5f'))[_0x94a6('0xa7')](_0x94a6('0xaa'),_0x94a6('0x5e'))[_0x94a6('0x84')]('cm_contacts')[_0x94a6('0x47')](_0x94a6('0xb5'))[_0x94a6('0x47')](_0x94a6('0xac'),_0x2ff61e['CmListId'][_0x94a6('0x8a')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x94a6('0x47')](_0x94a6('0xae'),squel[_0x94a6('0x82')]()[_0x94a6('0xa7')](_0x94a6('0xb2'))[_0x94a6('0x84')](_0x94a6('0xa2'))[_0x94a6('0x47')](_0x94a6('0xb1'),_0xef3adf[_0x94a6('0x52')]['id']['toString']())))[_0x94a6('0x8a')]();break;default:_0x437b5f=squel[_0x94a6('0xb4')]()['into'](_0x94a6('0xa2'))[_0x94a6('0xa3')](['phone',_0x94a6('0xa5'),_0x94a6('0xa8'),_0x94a6('0xa6'),'VoiceQueueId',_0x94a6('0x5f'),'updatedAt'],squel[_0x94a6('0x82')]()[_0x94a6('0xa7')](_0x94a6('0xa4'),_0x94a6('0xa4'))[_0x94a6('0xa7')](_0x94a6('0xaa'),_0x94a6('0xa5'))[_0x94a6('0xa7')]('id',_0x94a6('0xa8'))[_0x94a6('0xa7')](_0x2ff61e[_0x94a6('0xa9')][_0x94a6('0x8a')](),'ListId')['field'](_0xef3adf[_0x94a6('0x52')]['id']['toString'](),_0x94a6('0x69'))[_0x94a6('0xa7')](_0x94a6('0xaa'),_0x94a6('0x5f'))['field'](_0x94a6('0xaa'),_0x94a6('0x5e'))[_0x94a6('0x84')](_0x94a6('0xab'))[_0x94a6('0x47')](_0x94a6('0xb5'))[_0x94a6('0x47')]('ListId\x20=\x20?',_0x2ff61e[_0x94a6('0xa9')]['toString']())['where'](_0x94a6('0xad')))[_0x94a6('0x8a')]();}_0x4628e8[_0x94a6('0x89')](db[_0x94a6('0x76')][_0x94a6('0x3b')](_0x437b5f));}return BPromise['all'](_0x4628e8);}})[_0x94a6('0x2a')](function(){return _0x4478dd;})[_0x94a6('0x2a')](respondWithResult(_0x3b4af3,null))[_0x94a6('0x50')](handleError(_0x3b4af3,null));};exports[_0x94a6('0xb6')]=function(_0x9fbce5,_0xd889aa,_0xff92d4){return db['VoiceQueue']['find']({'where':{'id':_0x9fbce5['params']['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0xd889aa,null))[_0x94a6('0x2a')](function(_0x2a91e3){if(_0x2a91e3){return _0x2a91e3['removeLists'](_0x9fbce5['query'][_0x94a6('0x81')]);}})['then'](function(_0x475873){if(_0x475873){return db[_0x94a6('0x63')][_0x94a6('0x29')]({'where':{'ListId':_0x9fbce5[_0x94a6('0x3b')][_0x94a6('0x81')],'VoiceQueueId':_0x9fbce5['params']['id']}})[_0x94a6('0x2a')](function(){return _0x475873;});}})[_0x94a6('0x2a')](respondWithStatusCode(_0xd889aa,null))[_0x94a6('0x50')](handleError(_0xd889aa,null));};exports[_0x94a6('0xb7')]=function(_0xcb56a3,_0x195e28,_0x43825b){var _0x398de2={};var _0x4f8efe={};var _0x51f9c0;var _0x3e6985;return db['VoiceQueue'][_0x94a6('0x62')]({'where':{'id':_0xcb56a3['params']['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0x195e28,null))[_0x94a6('0x2a')](function(_0xb03434){if(_0xb03434){_0x51f9c0=_0xb03434;_0x4f8efe[_0x94a6('0x3e')]=_['keys'](db[_0x94a6('0x9d')]['rawAttributes']);_0x4f8efe[_0x94a6('0x3b')]=_[_0x94a6('0x3c')](_0xcb56a3[_0x94a6('0x3b')]);_0x4f8efe[_0x94a6('0x3d')]=_[_0x94a6('0x40')](_0x4f8efe[_0x94a6('0x3e')],_0x4f8efe[_0x94a6('0x3b')]);_0x398de2[_0x94a6('0x3f')]=_[_0x94a6('0x40')](_0x4f8efe[_0x94a6('0x3e')],qs[_0x94a6('0x41')](_0xcb56a3[_0x94a6('0x3b')][_0x94a6('0x41')]));_0x398de2[_0x94a6('0x3f')]=_0x398de2[_0x94a6('0x3f')][_0x94a6('0x42')]?_0x398de2[_0x94a6('0x3f')]:_0x4f8efe[_0x94a6('0x3e')];_0x398de2[_0x94a6('0x45')]=qs[_0x94a6('0x46')](_0xcb56a3['query'][_0x94a6('0x46')]);_0x398de2['where']=qs[_0x94a6('0x3d')](_[_0x94a6('0x48')](_0xcb56a3[_0x94a6('0x3b')],_0x4f8efe['filters']));if(_0xcb56a3[_0x94a6('0x3b')][_0x94a6('0x30')]){_0x398de2[_0x94a6('0x47')]=_[_0x94a6('0x49')](_0x398de2[_0x94a6('0x47')],{'$or':_[_0x94a6('0x31')](_0x398de2[_0x94a6('0x3f')],function(_0x3344ca){var _0x40b5e2={};_0x40b5e2[_0x3344ca]={'$like':'%'+_0xcb56a3[_0x94a6('0x3b')]['filter']+'%'};return _0x40b5e2;})});}_0x398de2=_[_0x94a6('0x49')]({},_0x398de2,_0xcb56a3[_0x94a6('0x4b')]);return _0x51f9c0[_0x94a6('0xb7')](_0x398de2);}})[_0x94a6('0x2a')](function(_0x2b1076){if(_0x2b1076){_0x3e6985=_0x2b1076[_0x94a6('0x42')];if(!_0xcb56a3[_0x94a6('0x3b')][_0x94a6('0x43')]('nolimit')){_0x398de2[_0x94a6('0x21')]=qs['limit'](_0xcb56a3[_0x94a6('0x3b')]['limit']);_0x398de2[_0x94a6('0x1f')]=qs[_0x94a6('0x1f')](_0xcb56a3[_0x94a6('0x3b')]['offset']);}return _0x51f9c0[_0x94a6('0xb7')](_0x398de2);}})[_0x94a6('0x2a')](function(_0x4bf92f){if(_0x4bf92f){return _0x4bf92f?{'count':_0x3e6985,'rows':_0x4bf92f}:null;}})[_0x94a6('0x2a')](respondWithResult(_0x195e28,null))[_0x94a6('0x50')](handleError(_0x195e28,null));};exports[_0x94a6('0xb8')]=function(_0x43535c,_0x67f25,_0x4ae1e0){var _0x2a7b72,_0x5c120c;return db['VoiceQueue'][_0x94a6('0x53')]({'where':{'id':_0x43535c[_0x94a6('0x52')]['id']}})['then'](handleEntityNotFound(_0x67f25,null))['then'](function(_0x596099){if(_0x596099){_0x5c120c=_0x596099;return _0x596099[_0x94a6('0xb8')](_0x43535c['body'][_0x94a6('0x81')],_[_0x94a6('0x5d')](_0x43535c[_0x94a6('0x55')],[_0x94a6('0x81'),'id'])||{});}return null;})[_0x94a6('0x98')](function(_0xf56daf){var _0x4cce17;_0x2a7b72=_0xf56daf||[];var _0x58957b=[];if(_0xf56daf){for(var _0x4e3d90=0x0;_0x4e3d90<_0xf56daf[_0x94a6('0x42')];_0x4e3d90+=0x1){var _0x2557f5=_0xf56daf[_0x4e3d90][_0x94a6('0x2b')]({'plain':!![]});_0x4cce17=squel[_0x94a6('0xb4')]()[_0x94a6('0xa1')](_0x94a6('0xb9'))[_0x94a6('0xa3')](['phone',_0x94a6('0xa8'),_0x94a6('0xa6'),'VoiceQueueId',_0x94a6('0x5f'),_0x94a6('0x5e')],squel[_0x94a6('0x82')]()['field']('phone',_0x94a6('0xa4'))[_0x94a6('0xa7')]('id',_0x94a6('0xa8'))[_0x94a6('0xa7')](_0x2557f5[_0x94a6('0xa9')][_0x94a6('0x8a')](),'ListId')['field'](_0x43535c['params']['id'][_0x94a6('0x8a')](),_0x94a6('0x69'))[_0x94a6('0xa7')](_0x94a6('0xaa'),_0x94a6('0x5f'))[_0x94a6('0xa7')](_0x94a6('0xaa'),_0x94a6('0x5e'))['from']('cm_contacts')[_0x94a6('0x47')]('deletedAt\x20IS\x20NULL')['where'](_0x94a6('0xac'),_0x2557f5[_0x94a6('0xa9')][_0x94a6('0x8a')]())[_0x94a6('0x47')](_0x94a6('0xad')))[_0x94a6('0x8a')]();_0x58957b[_0x94a6('0x89')](db['sequelize'][_0x94a6('0x3b')](_0x4cce17));}return BPromise['all'](_0x58957b);}})['then'](function(){return _0x2a7b72;})[_0x94a6('0x2a')](respondWithResult(_0x67f25,null))['catch'](handleError(_0x67f25,null));};exports[_0x94a6('0xba')]=function(_0x1e9eef,_0xa9e5d7,_0x19519d){return db['VoiceQueue']['find']({'where':{'id':_0x1e9eef['params']['id']}})[_0x94a6('0x2a')](handleEntityNotFound(_0xa9e5d7,null))[_0x94a6('0x2a')](function(_0x186ec0){if(_0x186ec0){return _0x186ec0[_0x94a6('0xba')](_0x1e9eef[_0x94a6('0x3b')][_0x94a6('0x81')]);}})['then'](function(_0x136f4b){if(_0x136f4b){return db[_0x94a6('0x6b')][_0x94a6('0x29')]({'where':{'ListId':_0x1e9eef['query']['ids'],'VoiceQueueId':_0x1e9eef['params']['id']}})[_0x94a6('0x2a')](function(){return _0x136f4b;});}})[_0x94a6('0x2a')](respondWithStatusCode(_0xa9e5d7,null))[_0x94a6('0x50')](handleError(_0xa9e5d7,null));};
\ No newline at end of file
index 16b5571..a362f2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf801=['hasOwnProperty','hook','events','../../mysqldb','VoiceQueue','update','remove','emit'];(function(_0x4b5cdc,_0x4476fe){var _0x370f91=function(_0x2bf095){while(--_0x2bf095){_0x4b5cdc['push'](_0x4b5cdc['shift']());}};_0x370f91(++_0x4476fe);}(_0xf801,0x15a));var _0x1f80=function(_0x567ef4,_0x10a870){_0x567ef4=_0x567ef4-0x0;var _0x481cd6=_0xf801[_0x567ef4];return _0x481cd6;};'use strict';var EventEmitter=require(_0x1f80('0x0'));var VoiceQueue=require(_0x1f80('0x1'))['db'][_0x1f80('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f80('0x3'),'afterDestroy':_0x1f80('0x4')};function emitEvent(_0x1038ec){return function(_0x13d910,_0x367ebf,_0x3ecba1){VoiceQueueEvents[_0x1f80('0x5')](_0x1038ec+':'+_0x13d910['id'],_0x13d910);VoiceQueueEvents[_0x1f80('0x5')](_0x1038ec,_0x13d910);_0x3ecba1(null);};}for(var e in events){if(events[_0x1f80('0x6')](e)){var event=events[e];VoiceQueue[_0x1f80('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0xd4fb=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0xdfc869,_0x729ac2){var _0x2baa83=function(_0xbf4427){while(--_0xbf4427){_0xdfc869['push'](_0xdfc869['shift']());}};_0x2baa83(++_0x729ac2);}(_0xd4fb,0xcc));var _0xbd4f=function(_0x31f7ea,_0x2f1ff0){_0x31f7ea=_0x31f7ea-0x0;var _0x3e53d0=_0xd4fb[_0x31f7ea];return _0x3e53d0;};'use strict';var EventEmitter=require(_0xbd4f('0x0'));var VoiceQueue=require(_0xbd4f('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbd4f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd4f('0x3'),'afterDestroy':_0xbd4f('0x4')};function emitEvent(_0x678dc5){return function(_0x41f809,_0x3c8bd7,_0x1501f2){VoiceQueueEvents[_0xbd4f('0x5')](_0x678dc5+':'+_0x41f809['id'],_0x41f809);VoiceQueueEvents['emit'](_0x678dc5,_0x41f809);_0x1501f2(null);};}for(var e in events){if(events[_0xbd4f('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xbd4f('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 7f5e319..f46707a 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(_0x179d2e,_0x3f7d68){var _0x5a2ecc=function(_0x3a0f52){while(--_0x3a0f52){_0x179d2e['push'](_0x179d2e['shift']());}};_0x5a2ecc(++_0x3f7d68);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x55ca,0x126));var _0xa55c=function(_0x4a0f62,_0x19f781){_0x4a0f62=_0x4a0f62-0x0;var _0x3ffcc1=_0x55ca[_0x4a0f62];return _0x3ffcc1;};'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')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ed58995..edca7d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c59=['catch','GetVoiceQueue','findAll','options','where','attributes','limit','include','map','model','info','ShowVoiceQueue','VoiceQueue','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','socket.io-emitter','redis','./voiceQueue.socket','register','then','request\x20sent','debug','stringify','error','code','message','VoiceQueue,\x20%s,\x20%s','result'];(function(_0x2c396c,_0x4db177){var _0x26219b=function(_0x1a4a6e){while(--_0x1a4a6e){_0x2c396c['push'](_0x2c396c['shift']());}};_0x26219b(++_0x4db177);}(_0x8c59,0x1a5));var _0x98c5=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x8c59[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0x98c5('0x0'));var moment=require(_0x98c5('0x1'));var BPromise=require(_0x98c5('0x2'));var rs=require(_0x98c5('0x3'));var fs=require('fs');var Redis=require(_0x98c5('0x4'));var db=require(_0x98c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x98c5('0x6'));var config=require(_0x98c5('0x7'));var jayson=require(_0x98c5('0x8'));var client=jayson[_0x98c5('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x98c5('0xa'))(new Redis(config[_0x98c5('0xb')]));require(_0x98c5('0xc'))[_0x98c5('0xd')](socket);function respondWithRpcPromise(_0x51a02c,_0x41e829,_0xc1c989){return new BPromise(function(_0x236cef,_0x322627){return client['request'](_0x51a02c,_0xc1c989)[_0x98c5('0xe')](function(_0x2849ad){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x41e829,_0x98c5('0xf'));logger[_0x98c5('0x10')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x41e829,_0x98c5('0xf'),JSON[_0x98c5('0x11')](_0x2849ad));if(_0x2849ad['error']){if(_0x2849ad[_0x98c5('0x12')][_0x98c5('0x13')]===0x1f4){logger[_0x98c5('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x41e829,_0x2849ad[_0x98c5('0x12')][_0x98c5('0x14')]);return _0x322627(_0x2849ad['error']['message']);}logger['error'](_0x98c5('0x15'),_0x41e829,_0x2849ad[_0x98c5('0x12')][_0x98c5('0x14')]);return _0x236cef(_0x2849ad['error']['message']);}else{logger['info'](_0x98c5('0x15'),_0x41e829,'request\x20sent');_0x236cef(_0x2849ad[_0x98c5('0x16')][_0x98c5('0x14')]);}})[_0x98c5('0x17')](function(_0x1a6b3a){logger[_0x98c5('0x12')](_0x98c5('0x15'),_0x41e829,_0x1a6b3a);_0x322627(_0x1a6b3a);});});}exports[_0x98c5('0x18')]=function(_0x1f1d7a){var _0x423837=this;return new Promise(function(_0xf97712,_0x421de5){return db['VoiceQueue'][_0x98c5('0x19')]({'raw':_0x1f1d7a[_0x98c5('0x1a')]?_0x1f1d7a[_0x98c5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1f1d7a['options']?_0x1f1d7a[_0x98c5('0x1a')][_0x98c5('0x1b')]||null:null,'attributes':_0x1f1d7a[_0x98c5('0x1a')]?_0x1f1d7a[_0x98c5('0x1a')][_0x98c5('0x1c')]||null:null,'limit':_0x1f1d7a[_0x98c5('0x1a')]?_0x1f1d7a[_0x98c5('0x1a')][_0x98c5('0x1d')]||null:null,'include':_0x1f1d7a[_0x98c5('0x1a')]?_0x1f1d7a[_0x98c5('0x1a')][_0x98c5('0x1e')]?_[_0x98c5('0x1f')](_0x1f1d7a[_0x98c5('0x1a')][_0x98c5('0x1e')],function(_0x56a685){return{'model':db[_0x56a685[_0x98c5('0x20')]],'as':_0x56a685['as'],'attributes':_0x56a685[_0x98c5('0x1c')],'include':_0x56a685[_0x98c5('0x1e')]?_['map'](_0x56a685['include'],function(_0x13b8a9){return{'model':db[_0x13b8a9['model']],'as':_0x13b8a9['as'],'attributes':_0x13b8a9['attributes'],'include':_0x13b8a9[_0x98c5('0x1e')]?_[_0x98c5('0x1f')](_0x13b8a9['include'],function(_0x59867d){return{'model':db[_0x59867d[_0x98c5('0x20')]],'as':_0x59867d['as'],'attributes':_0x59867d[_0x98c5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15247f){logger[_0x98c5('0x21')](_0x98c5('0x18'),_0x1f1d7a);logger[_0x98c5('0x10')](_0x98c5('0x18'),_0x1f1d7a,JSON[_0x98c5('0x11')](_0x15247f));_0xf97712(_0x15247f);})[_0x98c5('0x17')](function(_0x4d71ea){logger['error'](_0x98c5('0x18'),_0x4d71ea[_0x98c5('0x14')],_0x1f1d7a);_0x421de5(_0x423837[_0x98c5('0x12')](0x1f4,_0x4d71ea[_0x98c5('0x14')]));});});};exports[_0x98c5('0x22')]=function(_0x56f453){var _0x3123d4=this;return new Promise(function(_0x2c1d54,_0x12348d){return db[_0x98c5('0x23')]['find']({'raw':_0x56f453[_0x98c5('0x1a')]?_0x56f453[_0x98c5('0x1a')][_0x98c5('0x24')]===undefined?!![]:![]:!![],'where':_0x56f453[_0x98c5('0x1a')]?_0x56f453[_0x98c5('0x1a')][_0x98c5('0x1b')]||null:null,'attributes':_0x56f453[_0x98c5('0x1a')]?_0x56f453['options']['attributes']||null:null,'include':_0x56f453[_0x98c5('0x1a')]?_0x56f453[_0x98c5('0x1a')]['include']?_[_0x98c5('0x1f')](_0x56f453['options']['include'],function(_0x154d6a){return{'model':db[_0x154d6a[_0x98c5('0x20')]],'as':_0x154d6a['as'],'attributes':_0x154d6a[_0x98c5('0x1c')],'include':_0x154d6a[_0x98c5('0x1e')]?_[_0x98c5('0x1f')](_0x154d6a[_0x98c5('0x1e')],function(_0x433a5a){return{'model':db[_0x433a5a[_0x98c5('0x20')]],'as':_0x433a5a['as'],'attributes':_0x433a5a[_0x98c5('0x1c')],'include':_0x433a5a[_0x98c5('0x1e')]?_[_0x98c5('0x1f')](_0x433a5a['include'],function(_0x42008d){return{'model':db[_0x42008d[_0x98c5('0x20')]],'as':_0x42008d['as'],'attributes':_0x42008d[_0x98c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x98c5('0xe')](function(_0xed3077){logger[_0x98c5('0x21')](_0x98c5('0x22'),_0x56f453);logger['debug'](_0x98c5('0x22'),_0x56f453,JSON[_0x98c5('0x11')](_0xed3077));_0x2c1d54(_0xed3077);})[_0x98c5('0x17')](function(_0x715eee){logger[_0x98c5('0x12')]('ShowVoiceQueue',_0x715eee[_0x98c5('0x14')],_0x56f453);_0x12348d(_0x3123d4[_0x98c5('0x12')](0x1f4,_0x715eee['message']));});});};
\ No newline at end of file
+var _0x7dc1=['model','then','stringify','catch','ShowVoiceQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','VoiceQueue,\x20%s,\x20%s','message','info','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x5d9be4,_0x5df4b6){var _0x44650b=function(_0x105191){while(--_0x105191){_0x5d9be4['push'](_0x5d9be4['shift']());}};_0x44650b(++_0x5df4b6);}(_0x7dc1,0xd2));var _0x17dc=function(_0x9ed6f4,_0x21d798){_0x9ed6f4=_0x9ed6f4-0x0;var _0x904fe2=_0x7dc1[_0x9ed6f4];return _0x904fe2;};'use strict';var _=require(_0x17dc('0x0'));var util=require(_0x17dc('0x1'));var moment=require(_0x17dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x17dc('0x3'));var fs=require('fs');var Redis=require(_0x17dc('0x4'));var db=require(_0x17dc('0x5'))['db'];var utils=require(_0x17dc('0x6'));var logger=require(_0x17dc('0x7'))(_0x17dc('0x8'));var config=require(_0x17dc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x17dc('0xa')][_0x17dc('0xb')]({'port':0x232a});config[_0x17dc('0xc')]=_['defaults'](config[_0x17dc('0xc')],{'host':_0x17dc('0xd'),'port':0x18eb});var socket=require(_0x17dc('0xe'))(new Redis(config[_0x17dc('0xc')]));require(_0x17dc('0xf'))[_0x17dc('0x10')](socket);function respondWithRpcPromise(_0x15ca80,_0x16c090,_0x39ffa7){return new BPromise(function(_0x2901d1,_0x38e2f4){return client['request'](_0x15ca80,_0x39ffa7)['then'](function(_0x5a2cfa){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x16c090,_0x17dc('0x11'));logger[_0x17dc('0x12')](_0x17dc('0x13'),_0x16c090,'request\x20sent',JSON['stringify'](_0x5a2cfa));if(_0x5a2cfa[_0x17dc('0x14')]){if(_0x5a2cfa[_0x17dc('0x14')][_0x17dc('0x15')]===0x1f4){logger[_0x17dc('0x14')](_0x17dc('0x16'),_0x16c090,_0x5a2cfa[_0x17dc('0x14')][_0x17dc('0x17')]);return _0x38e2f4(_0x5a2cfa[_0x17dc('0x14')]['message']);}logger['error'](_0x17dc('0x16'),_0x16c090,_0x5a2cfa[_0x17dc('0x14')][_0x17dc('0x17')]);return _0x2901d1(_0x5a2cfa[_0x17dc('0x14')][_0x17dc('0x17')]);}else{logger[_0x17dc('0x18')](_0x17dc('0x16'),_0x16c090,_0x17dc('0x11'));_0x2901d1(_0x5a2cfa[_0x17dc('0x19')][_0x17dc('0x17')]);}})['catch'](function(_0x64b2c4){logger['error'](_0x17dc('0x16'),_0x16c090,_0x64b2c4);_0x38e2f4(_0x64b2c4);});});}exports[_0x17dc('0x1a')]=function(_0x7be9b8){var _0x2604e2=this;return new Promise(function(_0x38a8b0,_0xf67157){return db[_0x17dc('0x1b')][_0x17dc('0x1c')]({'raw':_0x7be9b8[_0x17dc('0x1d')]?_0x7be9b8[_0x17dc('0x1d')][_0x17dc('0x1e')]===undefined?!![]:![]:!![],'where':_0x7be9b8[_0x17dc('0x1d')]?_0x7be9b8['options'][_0x17dc('0x1f')]||null:null,'attributes':_0x7be9b8[_0x17dc('0x1d')]?_0x7be9b8[_0x17dc('0x1d')][_0x17dc('0x20')]||null:null,'limit':_0x7be9b8[_0x17dc('0x1d')]?_0x7be9b8[_0x17dc('0x1d')][_0x17dc('0x21')]||null:null,'include':_0x7be9b8[_0x17dc('0x1d')]?_0x7be9b8[_0x17dc('0x1d')][_0x17dc('0x22')]?_[_0x17dc('0x23')](_0x7be9b8[_0x17dc('0x1d')][_0x17dc('0x22')],function(_0x1f55a8){return{'model':db[_0x1f55a8[_0x17dc('0x24')]],'as':_0x1f55a8['as'],'attributes':_0x1f55a8['attributes'],'include':_0x1f55a8[_0x17dc('0x22')]?_['map'](_0x1f55a8[_0x17dc('0x22')],function(_0x3e647c){return{'model':db[_0x3e647c[_0x17dc('0x24')]],'as':_0x3e647c['as'],'attributes':_0x3e647c[_0x17dc('0x20')],'include':_0x3e647c[_0x17dc('0x22')]?_[_0x17dc('0x23')](_0x3e647c[_0x17dc('0x22')],function(_0x29428c){return{'model':db[_0x29428c[_0x17dc('0x24')]],'as':_0x29428c['as'],'attributes':_0x29428c[_0x17dc('0x20')]};}):[]};}):[]};}):[]:[]})[_0x17dc('0x25')](function(_0x27a100){logger[_0x17dc('0x18')](_0x17dc('0x1a'),_0x7be9b8);logger[_0x17dc('0x12')](_0x17dc('0x1a'),_0x7be9b8,JSON[_0x17dc('0x26')](_0x27a100));_0x38a8b0(_0x27a100);})[_0x17dc('0x27')](function(_0xb8346b){logger['error']('GetVoiceQueue',_0xb8346b[_0x17dc('0x17')],_0x7be9b8);_0xf67157(_0x2604e2['error'](0x1f4,_0xb8346b[_0x17dc('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x1600d9){var _0x70fcdf=this;return new Promise(function(_0x132b8a,_0x526cd1){return db[_0x17dc('0x1b')]['find']({'raw':_0x1600d9[_0x17dc('0x1d')]?_0x1600d9[_0x17dc('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1600d9['options']?_0x1600d9[_0x17dc('0x1d')][_0x17dc('0x1f')]||null:null,'attributes':_0x1600d9[_0x17dc('0x1d')]?_0x1600d9[_0x17dc('0x1d')]['attributes']||null:null,'include':_0x1600d9[_0x17dc('0x1d')]?_0x1600d9[_0x17dc('0x1d')][_0x17dc('0x22')]?_['map'](_0x1600d9[_0x17dc('0x1d')][_0x17dc('0x22')],function(_0x2cbcf8){return{'model':db[_0x2cbcf8[_0x17dc('0x24')]],'as':_0x2cbcf8['as'],'attributes':_0x2cbcf8[_0x17dc('0x20')],'include':_0x2cbcf8['include']?_[_0x17dc('0x23')](_0x2cbcf8[_0x17dc('0x22')],function(_0x35b490){return{'model':db[_0x35b490[_0x17dc('0x24')]],'as':_0x35b490['as'],'attributes':_0x35b490[_0x17dc('0x20')],'include':_0x35b490['include']?_['map'](_0x35b490[_0x17dc('0x22')],function(_0x1d4404){return{'model':db[_0x1d4404[_0x17dc('0x24')]],'as':_0x1d4404['as'],'attributes':_0x1d4404[_0x17dc('0x20')]};}):[]};}):[]};}):[]:[]})[_0x17dc('0x25')](function(_0x1a75fe){logger[_0x17dc('0x18')](_0x17dc('0x28'),_0x1600d9);logger[_0x17dc('0x12')](_0x17dc('0x28'),_0x1600d9,JSON[_0x17dc('0x26')](_0x1a75fe));_0x132b8a(_0x1a75fe);})[_0x17dc('0x27')](function(_0xd29fb5){logger[_0x17dc('0x14')](_0x17dc('0x28'),_0xd29fb5[_0x17dc('0x17')],_0x1600d9);_0x526cd1(_0x70fcdf[_0x17dc('0x14')](0x1f4,_0xd29fb5[_0x17dc('0x17')]));});});};
\ No newline at end of file
index 8667be5..918de9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8520=['./voiceQueue.events','save','remove','update','emit','removeListener','register','voiceQueue:'];(function(_0x4e0a8b,_0x87957){var _0x4b360b=function(_0xfe0350){while(--_0xfe0350){_0x4e0a8b['push'](_0x4e0a8b['shift']());}};_0x4b360b(++_0x87957);}(_0x8520,0xe8));var _0x0852=function(_0x5b799a,_0x28b345){_0x5b799a=_0x5b799a-0x0;var _0x58ce08=_0x8520[_0x5b799a];return _0x58ce08;};'use strict';var VoiceQueueEvents=require(_0x0852('0x0'));var events=[_0x0852('0x1'),_0x0852('0x2'),_0x0852('0x3')];function createListener(_0x476eb8,_0x3c63f0){return function(_0x54d678){_0x3c63f0[_0x0852('0x4')](_0x476eb8,_0x54d678);};}function removeListener(_0x181fe5,_0xc696f5){return function(){VoiceQueueEvents[_0x0852('0x5')](_0x181fe5,_0xc696f5);};}exports[_0x0852('0x6')]=function(_0x3d8839){for(var _0x4401b1=0x0,_0xb4c3a3=events['length'];_0x4401b1<_0xb4c3a3;_0x4401b1++){var _0x265a0d=events[_0x4401b1];var _0x508003=createListener(_0x0852('0x7')+_0x265a0d,_0x3d8839);VoiceQueueEvents['on'](_0x265a0d,_0x508003);}};
\ No newline at end of file
+var _0xe69f=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','remove','update'];(function(_0x205bea,_0x4695f2){var _0x59e5a3=function(_0x5d80f5){while(--_0x5d80f5){_0x205bea['push'](_0x205bea['shift']());}};_0x59e5a3(++_0x4695f2);}(_0xe69f,0x105));var _0xfe69=function(_0x2abcac,_0x1b416f){_0x2abcac=_0x2abcac-0x0;var _0x3fe66b=_0xe69f[_0x2abcac];return _0x3fe66b;};'use strict';var VoiceQueueEvents=require(_0xfe69('0x0'));var events=['save',_0xfe69('0x1'),_0xfe69('0x2')];function createListener(_0x2bcc7e,_0x5e02cd){return function(_0xe32024){_0x5e02cd[_0xfe69('0x3')](_0x2bcc7e,_0xe32024);};}function removeListener(_0x2b00e4,_0x51f63b){return function(){VoiceQueueEvents[_0xfe69('0x4')](_0x2b00e4,_0x51f63b);};}exports[_0xfe69('0x5')]=function(_0x115bc2){for(var _0x64c896=0x0,_0x29b1ab=events[_0xfe69('0x6')];_0x64c896<_0x29b1ab;_0x64c896++){var _0x14ff32=events[_0x64c896];var _0x462d6c=createListener(_0xfe69('0x7')+_0x14ff32,_0x115bc2);VoiceQueueEvents['on'](_0x14ff32,_0x462d6c);}};
\ No newline at end of file
index a4b316f..f0da997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bd9=['delete','destroy','exports','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','/:id','show','create','update'];(function(_0x350ec3,_0x1dcb41){var _0x1eef31=function(_0x388869){while(--_0x388869){_0x350ec3['push'](_0x350ec3['shift']());}};_0x1eef31(++_0x1dcb41);}(_0x1bd9,0x1c3));var _0x91bd=function(_0x34377c,_0x3c6d11){_0x34377c=_0x34377c-0x0;var _0x48494b=_0x1bd9[_0x34377c];return _0x48494b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x91bd('0x0'));var express=require(_0x91bd('0x1'));var router=express['Router']();var fs_extra=require(_0x91bd('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x91bd('0x3'));var config=require('../../config/environment');var controller=require(_0x91bd('0x4'));router[_0x91bd('0x5')]('/',auth[_0x91bd('0x6')](),controller['index']);router[_0x91bd('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x91bd('0x7')]);router[_0x91bd('0x5')](_0x91bd('0x8'),auth[_0x91bd('0x6')](),controller['getVoiceQueuesReport']);router['get'](_0x91bd('0x9'),auth[_0x91bd('0x6')](),controller[_0x91bd('0xa')]);router['post']('/',auth[_0x91bd('0x6')](),controller[_0x91bd('0xb')]);router['put'](_0x91bd('0x9'),auth[_0x91bd('0x6')](),controller[_0x91bd('0xc')]);router[_0x91bd('0xd')](_0x91bd('0x9'),auth[_0x91bd('0x6')](),controller[_0x91bd('0xe')]);module[_0x91bd('0xf')]=router;
\ No newline at end of file
+var _0xaabe=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','describe','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x20cd0c,_0x47d282){var _0xd006de=function(_0x441d7c){while(--_0x441d7c){_0x20cd0c['push'](_0x20cd0c['shift']());}};_0xd006de(++_0x47d282);}(_0xaabe,0xa1));var _0xeaab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaabe[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xeaab('0x0'));var path=require(_0xeaab('0x1'));var timeout=require(_0xeaab('0x2'));var express=require('express');var router=express[_0xeaab('0x3')]();var fs_extra=require(_0xeaab('0x4'));var auth=require(_0xeaab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeaab('0x6'));var controller=require(_0xeaab('0x7'));router[_0xeaab('0x8')]('/',auth['isAuthenticated'](),controller[_0xeaab('0x9')]);router[_0xeaab('0x8')](_0xeaab('0xa'),auth['isAuthenticated'](),controller[_0xeaab('0xb')]);router[_0xeaab('0x8')]('/index',auth[_0xeaab('0xc')](),controller[_0xeaab('0xd')]);router[_0xeaab('0x8')](_0xeaab('0xe'),auth[_0xeaab('0xc')](),controller[_0xeaab('0xf')]);router[_0xeaab('0x10')]('/',auth['isAuthenticated'](),controller[_0xeaab('0x11')]);router[_0xeaab('0x12')](_0xeaab('0xe'),auth['isAuthenticated'](),controller[_0xeaab('0x13')]);router[_0xeaab('0x14')](_0xeaab('0xe'),auth[_0xeaab('0xc')](),controller[_0xeaab('0x15')]);module[_0xeaab('0x16')]=router;
\ No newline at end of file
index 4818536..f33beb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b01=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x2dfe59,_0x4f4346){var _0x587e76=function(_0x1b3284){while(--_0x1b3284){_0x2dfe59['push'](_0x2dfe59['shift']());}};_0x587e76(++_0x4f4346);}(_0x9b01,0x82));var _0x19b0=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x9b01[_0x5d860f];return _0x236490;};'use strict';var Sequelize=require(_0x19b0('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x19b0('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x19b0('0x1')]},'calleridname':{'type':Sequelize[_0x19b0('0x1')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x19b0('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x19b0('0x2')],'set':function(_0x1b976a){var _0x1c4b21=moment(_0x1b976a);var _0x186efb=moment(this[_0x19b0('0x3')](_0x19b0('0x4')))[_0x19b0('0x5')](_0x19b0('0x6'));var _0x122452=_0x1c4b21[_0x19b0('0x7')](_0x186efb,_0x19b0('0x8'));this[_0x19b0('0x9')](_0x19b0('0xa'),_0x1b976a);this[_0x19b0('0x9')](_0x19b0('0xb'),_0x122452||null);}},'position':{'type':Sequelize[_0x19b0('0xc')]},'count':{'type':Sequelize[_0x19b0('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x19b0('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x19b0('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x19b0('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x19b0('0x2')]},'queuecallerexit':{'type':Sequelize[_0x19b0('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x19b0('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x19b0('0x1')],'comment':_0x19b0('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x19b0('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x19b0('0x1')]},'accountcode':{'type':Sequelize[_0x19b0('0x1')]},'context':{'type':Sequelize[_0x19b0('0x1')]},'exten':{'type':Sequelize[_0x19b0('0x1')]},'priority':{'type':Sequelize[_0x19b0('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x19b0('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x19b0('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x19b0('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x19b0('0x1')],'comment':_0x19b0('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x19b0('0x1')]},'disposition':{'type':Sequelize[_0x19b0('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x19b0('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x19b0('0xc')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x78d9=['queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x536895,_0x4351bd){var _0x31876e=function(_0x142736){while(--_0x142736){_0x536895['push'](_0x536895['shift']());}};_0x31876e(++_0x4351bd);}(_0x78d9,0x177));var _0x978d=function(_0x5023cc,_0x598ad9){_0x5023cc=_0x5023cc-0x0;var _0xe06e1c=_0x78d9[_0x5023cc];return _0xe06e1c;};'use strict';var Sequelize=require(_0x978d('0x0'));var moment=require('moment');module[_0x978d('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x978d('0x2')]},'calleridnum':{'type':Sequelize[_0x978d('0x2')]},'calleridname':{'type':Sequelize[_0x978d('0x2')]},'queue':{'type':Sequelize[_0x978d('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x978d('0x3')],'set':function(_0x4b606a){var _0x30694f=moment(_0x4b606a);var _0x216aaa=moment(this['getDataValue'](_0x978d('0x4')))[_0x978d('0x5')](_0x978d('0x6'));var _0x3f7f75=_0x30694f[_0x978d('0x7')](_0x216aaa,_0x978d('0x8'));this['setDataValue'](_0x978d('0x9'),_0x4b606a);this[_0x978d('0xa')](_0x978d('0xb'),_0x3f7f75||null);}},'position':{'type':Sequelize[_0x978d('0xc')]},'count':{'type':Sequelize[_0x978d('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x978d('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x978d('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x978d('0x3')]},'queuecallerexit':{'type':Sequelize[_0x978d('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x978d('0xe')},'originalposition':{'type':Sequelize[_0x978d('0xc')]},'channel':{'type':Sequelize[_0x978d('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x978d('0x2')]},'accountcode':{'type':Sequelize[_0x978d('0x2')]},'context':{'type':Sequelize[_0x978d('0x2')]},'exten':{'type':Sequelize[_0x978d('0x2')]},'priority':{'type':Sequelize[_0x978d('0x2')]},'holdtime':{'type':Sequelize[_0x978d('0xc')]},'mohtime':{'type':Sequelize[_0x978d('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x978d('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x978d('0x2')]},'transfer':{'type':Sequelize[_0x978d('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x978d('0x2')],'comment':_0x978d('0xf')},'transferexten':{'type':Sequelize[_0x978d('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x978d('0x2')]},'secondDisposition':{'type':Sequelize[_0x978d('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x978d('0xc')],'defaultValue':0x0}};
\ No newline at end of file
index 0944083..62cee87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8555=['destroy','then','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','findAll','rows','show','params','includeAll','include','find','create','catch','body','describe','getVoiceQueuesReport','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','json','reject','save','update'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x8555,0x79));var _0x5855=function(_0x3f20a4,_0xb84ce0){_0x3f20a4=_0x3f20a4-0x0;var _0x100dbe=_0x8555[_0x3f20a4];return _0x100dbe;};'use strict';var emlformat=require(_0x5855('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5855('0x1'));var jsonpatch=require(_0x5855('0x2'));var rp=require(_0x5855('0x3'));var moment=require(_0x5855('0x4'));var BPromise=require(_0x5855('0x5'));var Mustache=require(_0x5855('0x6'));var util=require(_0x5855('0x7'));var path=require(_0x5855('0x8'));var sox=require(_0x5855('0x9'));var csv=require(_0x5855('0xa'));var ejs=require(_0x5855('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5855('0xc'));var squel=require('squel');var crypto=require(_0x5855('0xd'));var jsforce=require(_0x5855('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5855('0xa'));var querystring=require(_0x5855('0xf'));var Papa=require(_0x5855('0x10'));var Redis=require('ioredis');var authService=require(_0x5855('0x11'));var qs=require(_0x5855('0x12'));var as=require(_0x5855('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5855('0x14'))(_0x5855('0x15'));var utils=require(_0x5855('0x16'));var config=require(_0x5855('0x17'));var licenseUtil=require(_0x5855('0x18'));var db=require(_0x5855('0x19'))['db'];config[_0x5855('0x1a')]=_[_0x5855('0x1b')](config[_0x5855('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5855('0x1c'))(new Redis(config[_0x5855('0x1a')]));require('./voiceQueueReport.socket')[_0x5855('0x1d')](socket);function respondWithStatusCode(_0x216279,_0x3059c0){_0x3059c0=_0x3059c0||0xcc;return function(_0x51d3c4){if(_0x51d3c4){return _0x216279[_0x5855('0x1e')](_0x3059c0);}return _0x216279['status'](_0x3059c0)[_0x5855('0x1f')]();};}function respondWithResult(_0x3f7012,_0x4affb9){_0x4affb9=_0x4affb9||0xc8;return function(_0x483fca){if(_0x483fca){return _0x3f7012[_0x5855('0x20')](_0x4affb9)['json'](_0x483fca);}};}function respondWithFilteredResult(_0x1abd93,_0x27a2b4){return function(_0x21dbc6){if(_0x21dbc6){var _0x187c4c=typeof _0x27a2b4[_0x5855('0x21')]===_0x5855('0x22')&&typeof _0x27a2b4[_0x5855('0x23')]===_0x5855('0x22');var _0x4f6f33=_0x21dbc6[_0x5855('0x24')];var _0x43bdf3=_0x187c4c?0x0:_0x27a2b4[_0x5855('0x21')];var _0x54ca1e=_0x187c4c?_0x21dbc6[_0x5855('0x24')]:_0x27a2b4['offset']+_0x27a2b4[_0x5855('0x23')];var _0x531244;if(_0x54ca1e>=_0x4f6f33){_0x54ca1e=_0x4f6f33;_0x531244=0xc8;}else{_0x531244=0xce;}_0x1abd93[_0x5855('0x20')](_0x531244);return _0x1abd93['set']('Content-Range',_0x43bdf3+'-'+_0x54ca1e+'/'+_0x4f6f33)[_0x5855('0x25')](_0x21dbc6);}return null;};}function patchUpdates(_0x279e62){return function(_0x27bf75){try{jsonpatch['apply'](_0x27bf75,_0x279e62,!![]);}catch(_0x2ca1b7){return BPromise[_0x5855('0x26')](_0x2ca1b7);}return _0x27bf75[_0x5855('0x27')]();};}function saveUpdates(_0x3d7560,_0x5de02c){return function(_0x554f95){if(_0x554f95){return _0x554f95[_0x5855('0x28')](_0x3d7560)['then'](function(_0x1cd49d){return _0x1cd49d;});}return null;};}function removeEntity(_0x2f1f90,_0x4b1194){return function(_0x15a537){if(_0x15a537){return _0x15a537[_0x5855('0x29')]()[_0x5855('0x2a')](function(){_0x2f1f90[_0x5855('0x20')](0xcc)[_0x5855('0x1f')]();});}};}function handleEntityNotFound(_0x117407,_0x3286da){return function(_0x4c978c){if(!_0x4c978c){_0x117407[_0x5855('0x1e')](0x194);}return _0x4c978c;};}function handleError(_0x252358,_0x594076){_0x594076=_0x594076||0x1f4;return function(_0x35c65f){logger[_0x5855('0x2b')](_0x35c65f[_0x5855('0x2c')]);if(_0x35c65f['name']){delete _0x35c65f[_0x5855('0x2d')];}_0x252358[_0x5855('0x20')](_0x594076)[_0x5855('0x2e')](_0x35c65f);};}exports[_0x5855('0x2f')]=function(_0x1e2742,_0x8fc11){var _0x1fbcd0={},_0x3c4bff={},_0x4b3c4d={'count':0x0,'rows':[]};var _0x1d09cc=_[_0x5855('0x30')](db[_0x5855('0x31')][_0x5855('0x32')],function(_0x9b0d09){return{'name':_0x9b0d09['fieldName'],'type':_0x9b0d09['type'][_0x5855('0x33')]};});_0x3c4bff[_0x5855('0x34')]=_[_0x5855('0x30')](_0x1d09cc,_0x5855('0x2d'));_0x3c4bff[_0x5855('0x35')]=_[_0x5855('0x36')](_0x1e2742[_0x5855('0x35')]);_0x3c4bff[_0x5855('0x37')]=_[_0x5855('0x38')](_0x3c4bff[_0x5855('0x34')],_0x3c4bff[_0x5855('0x35')]);_0x1fbcd0[_0x5855('0x39')]=_['intersection'](_0x3c4bff[_0x5855('0x34')],qs[_0x5855('0x3a')](_0x1e2742[_0x5855('0x35')]['fields']));_0x1fbcd0[_0x5855('0x39')]=_0x1fbcd0[_0x5855('0x39')][_0x5855('0x3b')]?_0x1fbcd0[_0x5855('0x39')]:_0x3c4bff[_0x5855('0x34')];if(!_0x1e2742[_0x5855('0x35')][_0x5855('0x3c')](_0x5855('0x3d'))){_0x1fbcd0['limit']=qs[_0x5855('0x23')](_0x1e2742[_0x5855('0x35')][_0x5855('0x23')]);_0x1fbcd0['offset']=qs[_0x5855('0x21')](_0x1e2742[_0x5855('0x35')][_0x5855('0x21')]);}_0x1fbcd0['order']=qs[_0x5855('0x3e')](_0x1e2742[_0x5855('0x35')]['sort']);_0x1fbcd0[_0x5855('0x3f')]=qs[_0x5855('0x37')](_[_0x5855('0x40')](_0x1e2742['query'],_0x3c4bff['filters']),_0x1d09cc);if(_0x1e2742[_0x5855('0x35')]['filter']){_0x1fbcd0[_0x5855('0x3f')]=_[_0x5855('0x41')](_0x1fbcd0[_0x5855('0x3f')],{'$or':_['map'](_0x1d09cc,function(_0x338d66){if(_0x338d66['type']!=='VIRTUAL'){var _0x3eadcf={};_0x3eadcf[_0x338d66[_0x5855('0x2d')]]={'$like':'%'+_0x1e2742['query'][_0x5855('0x42')]+'%'};return _0x3eadcf;}})});}_0x1fbcd0=_[_0x5855('0x41')]({},_0x1fbcd0,_0x1e2742[_0x5855('0x43')]);var _0x2b54ed={'where':_0x1fbcd0['where']};return db[_0x5855('0x31')][_0x5855('0x24')](_0x2b54ed)[_0x5855('0x2a')](function(_0x5bc6a3){_0x4b3c4d['count']=_0x5bc6a3;if(_0x1e2742[_0x5855('0x35')]['includeAll']){_0x1fbcd0['include']=[{'all':!![]}];}return db[_0x5855('0x31')][_0x5855('0x44')](_0x1fbcd0);})[_0x5855('0x2a')](function(_0x28924c){_0x4b3c4d[_0x5855('0x45')]=_0x28924c;return _0x4b3c4d;})['then'](respondWithFilteredResult(_0x8fc11,_0x1fbcd0))['catch'](handleError(_0x8fc11,null));};exports[_0x5855('0x46')]=function(_0x21f305,_0x770eaf){var _0xd33d97={'raw':![],'where':{'id':_0x21f305[_0x5855('0x47')]['id']}},_0x483264={};_0x483264['model']=_[_0x5855('0x36')](db[_0x5855('0x31')]['rawAttributes']);_0x483264[_0x5855('0x35')]=_['keys'](_0x21f305[_0x5855('0x35')]);_0x483264[_0x5855('0x37')]=_[_0x5855('0x38')](_0x483264[_0x5855('0x34')],_0x483264[_0x5855('0x35')]);_0xd33d97[_0x5855('0x39')]=_['intersection'](_0x483264[_0x5855('0x34')],qs['fields'](_0x21f305[_0x5855('0x35')][_0x5855('0x3a')]));_0xd33d97['attributes']=_0xd33d97[_0x5855('0x39')][_0x5855('0x3b')]?_0xd33d97[_0x5855('0x39')]:_0x483264[_0x5855('0x34')];if(_0x21f305['query'][_0x5855('0x48')]){_0xd33d97[_0x5855('0x49')]=[{'all':!![]}];}_0xd33d97=_[_0x5855('0x41')]({},_0xd33d97,_0x21f305[_0x5855('0x43')]);return db[_0x5855('0x31')][_0x5855('0x4a')](_0xd33d97)[_0x5855('0x2a')](handleEntityNotFound(_0x770eaf,null))[_0x5855('0x2a')](respondWithResult(_0x770eaf,null))['catch'](handleError(_0x770eaf,null));};exports[_0x5855('0x4b')]=function(_0x1b84dc,_0x1b4beb){return db[_0x5855('0x31')][_0x5855('0x4b')](_0x1b84dc['body'],{})[_0x5855('0x2a')](respondWithResult(_0x1b4beb,0xc9))[_0x5855('0x4c')](handleError(_0x1b4beb,null));};exports[_0x5855('0x28')]=function(_0xb08e0a,_0x2c36e4){if(_0xb08e0a['body']['id']){delete _0xb08e0a[_0x5855('0x4d')]['id'];}return db[_0x5855('0x31')][_0x5855('0x4a')]({'where':{'id':_0xb08e0a['params']['id']}})[_0x5855('0x2a')](handleEntityNotFound(_0x2c36e4,null))['then'](saveUpdates(_0xb08e0a['body'],null))['then'](respondWithResult(_0x2c36e4,null))[_0x5855('0x4c')](handleError(_0x2c36e4,null));};exports[_0x5855('0x29')]=function(_0x343c8b,_0x34324a){return db[_0x5855('0x31')][_0x5855('0x4a')]({'where':{'id':_0x343c8b[_0x5855('0x47')]['id']}})[_0x5855('0x2a')](handleEntityNotFound(_0x34324a,null))[_0x5855('0x2a')](removeEntity(_0x34324a,null))[_0x5855('0x4c')](handleError(_0x34324a,null));};exports[_0x5855('0x4e')]=function(_0x181e7b,_0x2cfc14){return db['VoiceQueueReport'][_0x5855('0x4e')]()[_0x5855('0x2a')](respondWithResult(_0x2cfc14,null))['catch'](handleError(_0x2cfc14,null));};exports[_0x5855('0x4f')]=function(_0x48d2ef,_0x2f5ae2){var _0x503218={},_0xa225dd={},_0x297b62={'count':0x0,'rows':[]};_0xa225dd[_0x5855('0x34')]=_[_0x5855('0x36')](db['VoiceQueueReport']['rawAttributes']);_0xa225dd[_0x5855('0x35')]=_[_0x5855('0x36')](_0x48d2ef['query']);_0xa225dd[_0x5855('0x37')]=_[_0x5855('0x38')](_0xa225dd['model'],_0xa225dd[_0x5855('0x35')]);_0x503218[_0x5855('0x39')]=_[_0x5855('0x38')](_0xa225dd['model'],qs['fields'](_0x48d2ef[_0x5855('0x35')][_0x5855('0x3a')]));_0x503218[_0x5855('0x39')]=_0x503218[_0x5855('0x39')][_0x5855('0x3b')]?_0x503218[_0x5855('0x39')]:_0xa225dd[_0x5855('0x34')];if(!_0x48d2ef[_0x5855('0x35')][_0x5855('0x3c')](_0x5855('0x3d'))){_0x503218[_0x5855('0x23')]=qs[_0x5855('0x23')](_0x48d2ef[_0x5855('0x35')][_0x5855('0x23')]);_0x503218['offset']=qs['offset'](_0x48d2ef[_0x5855('0x35')][_0x5855('0x21')]);}_0x503218[_0x5855('0x50')]=qs[_0x5855('0x3e')](_0x48d2ef[_0x5855('0x35')][_0x5855('0x3e')]);_0x503218[_0x5855('0x3f')]=qs['filters'](_['pick'](_0x48d2ef['query'],_0xa225dd['filters']));if(_0x48d2ef['query'][_0x5855('0x42')]){_0x503218[_0x5855('0x3f')]=_[_0x5855('0x41')](_0x503218[_0x5855('0x3f')],{'$or':_['map'](_0x503218[_0x5855('0x39')],function(_0x13a67d){var _0x448c3a={};_0x448c3a[_0x13a67d]={'$like':'%'+_0x48d2ef[_0x5855('0x35')][_0x5855('0x42')]+'%'};return _0x448c3a;})});}_0x503218=_[_0x5855('0x41')]({},_0x503218,_0x48d2ef[_0x5855('0x43')]);var _0x43c3d2={'where':_0x503218[_0x5855('0x3f')]};return db[_0x5855('0x31')][_0x5855('0x24')](_0x43c3d2)[_0x5855('0x2a')](function(_0x2ae7de){_0x297b62[_0x5855('0x24')]=_0x2ae7de;if(_0x48d2ef[_0x5855('0x35')]['includeAll']){_0x503218[_0x5855('0x49')]=[{'all':!![]}];}return db[_0x5855('0x31')][_0x5855('0x44')](_0x503218);})[_0x5855('0x2a')](function(_0x332e29){_0x297b62[_0x5855('0x45')]=_0x332e29;return _0x297b62;})[_0x5855('0x2a')](respondWithFilteredResult(_0x2f5ae2,_0x503218,_0x5855('0x4f')))[_0x5855('0x4c')](handleError(_0x2f5ae2,null,_0x5855('0x4f')));};
\ No newline at end of file
+var _0x151e=['stack','name','send','index','map','VoiceQueueReport','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','rows','show','params','rawAttributes','catch','body','find','describe','getVoiceQueuesReport','length','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','end','status','json','offset','limit','count','set','reject','update','then','destroy','sendStatus','error'];(function(_0x435b91,_0x40ee23){var _0x43bdf6=function(_0x547318){while(--_0x547318){_0x435b91['push'](_0x435b91['shift']());}};_0x43bdf6(++_0x40ee23);}(_0x151e,0xcb));var _0xe151=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x151e[_0x440917];return _0x5e906b;};'use strict';var emlformat=require(_0xe151('0x0'));var rimraf=require(_0xe151('0x1'));var zipdir=require(_0xe151('0x2'));var jsonpatch=require(_0xe151('0x3'));var rp=require('request-promise');var moment=require(_0xe151('0x4'));var BPromise=require(_0xe151('0x5'));var Mustache=require(_0xe151('0x6'));var util=require('util');var path=require(_0xe151('0x7'));var sox=require(_0xe151('0x8'));var csv=require(_0xe151('0x9'));var ejs=require(_0xe151('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe151('0xb'));var squel=require(_0xe151('0xc'));var crypto=require('crypto');var jsforce=require(_0xe151('0xd'));var deskjs=require(_0xe151('0xe'));var toCsv=require(_0xe151('0x9'));var querystring=require(_0xe151('0xf'));var Papa=require(_0xe151('0x10'));var Redis=require(_0xe151('0x11'));var authService=require(_0xe151('0x12'));var qs=require(_0xe151('0x13'));var as=require(_0xe151('0x14'));var hardwareService=require(_0xe151('0x15'));var logger=require(_0xe151('0x16'))(_0xe151('0x17'));var utils=require('../../config/utils');var config=require(_0xe151('0x18'));var licenseUtil=require(_0xe151('0x19'));var db=require(_0xe151('0x1a'))['db'];config[_0xe151('0x1b')]=_[_0xe151('0x1c')](config[_0xe151('0x1b')],{'host':_0xe151('0x1d'),'port':0x18eb});var socket=require(_0xe151('0x1e'))(new Redis(config[_0xe151('0x1b')]));require(_0xe151('0x1f'))[_0xe151('0x20')](socket);function respondWithStatusCode(_0x2733f9,_0x426ae1){_0x426ae1=_0x426ae1||0xcc;return function(_0x55e945){if(_0x55e945){return _0x2733f9['sendStatus'](_0x426ae1);}return _0x2733f9['status'](_0x426ae1)[_0xe151('0x21')]();};}function respondWithResult(_0x55bd7e,_0x396096){_0x396096=_0x396096||0xc8;return function(_0x59877e){if(_0x59877e){return _0x55bd7e[_0xe151('0x22')](_0x396096)[_0xe151('0x23')](_0x59877e);}};}function respondWithFilteredResult(_0x5cb93c,_0x2adaec){return function(_0x571b68){if(_0x571b68){var _0x1c1254=typeof _0x2adaec[_0xe151('0x24')]==='undefined'&&typeof _0x2adaec[_0xe151('0x25')]==='undefined';var _0x9a9296=_0x571b68[_0xe151('0x26')];var _0x44324c=_0x1c1254?0x0:_0x2adaec['offset'];var _0x280aca=_0x1c1254?_0x571b68[_0xe151('0x26')]:_0x2adaec['offset']+_0x2adaec[_0xe151('0x25')];var _0x5e4165;if(_0x280aca>=_0x9a9296){_0x280aca=_0x9a9296;_0x5e4165=0xc8;}else{_0x5e4165=0xce;}_0x5cb93c['status'](_0x5e4165);return _0x5cb93c[_0xe151('0x27')]('Content-Range',_0x44324c+'-'+_0x280aca+'/'+_0x9a9296)[_0xe151('0x23')](_0x571b68);}return null;};}function patchUpdates(_0x4ec1e0){return function(_0x15f051){try{jsonpatch['apply'](_0x15f051,_0x4ec1e0,!![]);}catch(_0x4af634){return BPromise[_0xe151('0x28')](_0x4af634);}return _0x15f051['save']();};}function saveUpdates(_0x374a71,_0x55885e){return function(_0x4f9e69){if(_0x4f9e69){return _0x4f9e69[_0xe151('0x29')](_0x374a71)[_0xe151('0x2a')](function(_0x1fb141){return _0x1fb141;});}return null;};}function removeEntity(_0x273e6f,_0x18ca40){return function(_0x5309f5){if(_0x5309f5){return _0x5309f5[_0xe151('0x2b')]()['then'](function(){_0x273e6f[_0xe151('0x22')](0xcc)[_0xe151('0x21')]();});}};}function handleEntityNotFound(_0x140f6d,_0x3b4c2c){return function(_0x2ec4ff){if(!_0x2ec4ff){_0x140f6d[_0xe151('0x2c')](0x194);}return _0x2ec4ff;};}function handleError(_0x49b99f,_0x2aff3e){_0x2aff3e=_0x2aff3e||0x1f4;return function(_0x7378f2){logger[_0xe151('0x2d')](_0x7378f2[_0xe151('0x2e')]);if(_0x7378f2[_0xe151('0x2f')]){delete _0x7378f2[_0xe151('0x2f')];}_0x49b99f[_0xe151('0x22')](_0x2aff3e)[_0xe151('0x30')](_0x7378f2);};}exports[_0xe151('0x31')]=function(_0xe65be4,_0x14f8db){var _0x4ce3b4={},_0x150a83={},_0x25c00b={'count':0x0,'rows':[]};var _0x3888d6=_[_0xe151('0x32')](db[_0xe151('0x33')]['rawAttributes'],function(_0x57faaa){return{'name':_0x57faaa[_0xe151('0x34')],'type':_0x57faaa['type'][_0xe151('0x35')]};});_0x150a83['model']=_[_0xe151('0x32')](_0x3888d6,_0xe151('0x2f'));_0x150a83['query']=_[_0xe151('0x36')](_0xe65be4[_0xe151('0x37')]);_0x150a83[_0xe151('0x38')]=_[_0xe151('0x39')](_0x150a83[_0xe151('0x3a')],_0x150a83['query']);_0x4ce3b4[_0xe151('0x3b')]=_[_0xe151('0x39')](_0x150a83[_0xe151('0x3a')],qs['fields'](_0xe65be4[_0xe151('0x37')][_0xe151('0x3c')]));_0x4ce3b4['attributes']=_0x4ce3b4[_0xe151('0x3b')]['length']?_0x4ce3b4[_0xe151('0x3b')]:_0x150a83[_0xe151('0x3a')];if(!_0xe65be4['query'][_0xe151('0x3d')](_0xe151('0x3e'))){_0x4ce3b4['limit']=qs[_0xe151('0x25')](_0xe65be4[_0xe151('0x37')]['limit']);_0x4ce3b4[_0xe151('0x24')]=qs[_0xe151('0x24')](_0xe65be4[_0xe151('0x37')]['offset']);}_0x4ce3b4[_0xe151('0x3f')]=qs[_0xe151('0x40')](_0xe65be4[_0xe151('0x37')][_0xe151('0x40')]);_0x4ce3b4[_0xe151('0x41')]=qs['filters'](_['pick'](_0xe65be4[_0xe151('0x37')],_0x150a83[_0xe151('0x38')]),_0x3888d6);if(_0xe65be4[_0xe151('0x37')][_0xe151('0x42')]){_0x4ce3b4[_0xe151('0x41')]=_[_0xe151('0x43')](_0x4ce3b4[_0xe151('0x41')],{'$or':_['map'](_0x3888d6,function(_0x9fc6fd){if(_0x9fc6fd[_0xe151('0x44')]!=='VIRTUAL'){var _0x8969fa={};_0x8969fa[_0x9fc6fd['name']]={'$like':'%'+_0xe65be4[_0xe151('0x37')]['filter']+'%'};return _0x8969fa;}})});}_0x4ce3b4=_[_0xe151('0x43')]({},_0x4ce3b4,_0xe65be4[_0xe151('0x45')]);var _0x14b732={'where':_0x4ce3b4[_0xe151('0x41')]};return db[_0xe151('0x33')][_0xe151('0x26')](_0x14b732)['then'](function(_0x263b27){_0x25c00b[_0xe151('0x26')]=_0x263b27;if(_0xe65be4[_0xe151('0x37')][_0xe151('0x46')]){_0x4ce3b4[_0xe151('0x47')]=[{'all':!![]}];}return db[_0xe151('0x33')]['findAll'](_0x4ce3b4);})[_0xe151('0x2a')](function(_0x1a4976){_0x25c00b[_0xe151('0x48')]=_0x1a4976;return _0x25c00b;})[_0xe151('0x2a')](respondWithFilteredResult(_0x14f8db,_0x4ce3b4))['catch'](handleError(_0x14f8db,null));};exports[_0xe151('0x49')]=function(_0x4960af,_0x5e7443){var _0x287bb5={'raw':![],'where':{'id':_0x4960af[_0xe151('0x4a')]['id']}},_0x141a7d={};_0x141a7d['model']=_[_0xe151('0x36')](db[_0xe151('0x33')][_0xe151('0x4b')]);_0x141a7d['query']=_[_0xe151('0x36')](_0x4960af[_0xe151('0x37')]);_0x141a7d[_0xe151('0x38')]=_['intersection'](_0x141a7d['model'],_0x141a7d[_0xe151('0x37')]);_0x287bb5[_0xe151('0x3b')]=_[_0xe151('0x39')](_0x141a7d[_0xe151('0x3a')],qs[_0xe151('0x3c')](_0x4960af['query'][_0xe151('0x3c')]));_0x287bb5[_0xe151('0x3b')]=_0x287bb5[_0xe151('0x3b')]['length']?_0x287bb5[_0xe151('0x3b')]:_0x141a7d['model'];if(_0x4960af[_0xe151('0x37')][_0xe151('0x46')]){_0x287bb5['include']=[{'all':!![]}];}_0x287bb5=_['merge']({},_0x287bb5,_0x4960af[_0xe151('0x45')]);return db[_0xe151('0x33')]['find'](_0x287bb5)[_0xe151('0x2a')](handleEntityNotFound(_0x5e7443,null))[_0xe151('0x2a')](respondWithResult(_0x5e7443,null))[_0xe151('0x4c')](handleError(_0x5e7443,null));};exports['create']=function(_0x4b6827,_0x5bd327){return db[_0xe151('0x33')]['create'](_0x4b6827[_0xe151('0x4d')],{})['then'](respondWithResult(_0x5bd327,0xc9))[_0xe151('0x4c')](handleError(_0x5bd327,null));};exports[_0xe151('0x29')]=function(_0x5af977,_0x35be71){if(_0x5af977[_0xe151('0x4d')]['id']){delete _0x5af977[_0xe151('0x4d')]['id'];}return db[_0xe151('0x33')][_0xe151('0x4e')]({'where':{'id':_0x5af977[_0xe151('0x4a')]['id']}})[_0xe151('0x2a')](handleEntityNotFound(_0x35be71,null))['then'](saveUpdates(_0x5af977[_0xe151('0x4d')],null))['then'](respondWithResult(_0x35be71,null))['catch'](handleError(_0x35be71,null));};exports[_0xe151('0x2b')]=function(_0xa4b638,_0xeb1236){return db[_0xe151('0x33')][_0xe151('0x4e')]({'where':{'id':_0xa4b638[_0xe151('0x4a')]['id']}})[_0xe151('0x2a')](handleEntityNotFound(_0xeb1236,null))[_0xe151('0x2a')](removeEntity(_0xeb1236,null))[_0xe151('0x4c')](handleError(_0xeb1236,null));};exports['describe']=function(_0xfe05bc,_0x538da9){return db['VoiceQueueReport'][_0xe151('0x4f')]()['then'](respondWithResult(_0x538da9,null))[_0xe151('0x4c')](handleError(_0x538da9,null));};exports[_0xe151('0x50')]=function(_0x581e93,_0x23bc0b){var _0x6a1c60={},_0x216c3f={},_0x101d17={'count':0x0,'rows':[]};_0x216c3f[_0xe151('0x3a')]=_[_0xe151('0x36')](db[_0xe151('0x33')][_0xe151('0x4b')]);_0x216c3f['query']=_['keys'](_0x581e93[_0xe151('0x37')]);_0x216c3f['filters']=_[_0xe151('0x39')](_0x216c3f[_0xe151('0x3a')],_0x216c3f['query']);_0x6a1c60[_0xe151('0x3b')]=_[_0xe151('0x39')](_0x216c3f[_0xe151('0x3a')],qs[_0xe151('0x3c')](_0x581e93[_0xe151('0x37')][_0xe151('0x3c')]));_0x6a1c60[_0xe151('0x3b')]=_0x6a1c60[_0xe151('0x3b')][_0xe151('0x51')]?_0x6a1c60[_0xe151('0x3b')]:_0x216c3f[_0xe151('0x3a')];if(!_0x581e93['query'][_0xe151('0x3d')](_0xe151('0x3e'))){_0x6a1c60[_0xe151('0x25')]=qs['limit'](_0x581e93['query'][_0xe151('0x25')]);_0x6a1c60[_0xe151('0x24')]=qs[_0xe151('0x24')](_0x581e93['query'][_0xe151('0x24')]);}_0x6a1c60['order']=qs[_0xe151('0x40')](_0x581e93[_0xe151('0x37')][_0xe151('0x40')]);_0x6a1c60[_0xe151('0x41')]=qs[_0xe151('0x38')](_['pick'](_0x581e93[_0xe151('0x37')],_0x216c3f['filters']));if(_0x581e93[_0xe151('0x37')][_0xe151('0x42')]){_0x6a1c60['where']=_['merge'](_0x6a1c60['where'],{'$or':_['map'](_0x6a1c60[_0xe151('0x3b')],function(_0x1925ce){var _0x227997={};_0x227997[_0x1925ce]={'$like':'%'+_0x581e93[_0xe151('0x37')][_0xe151('0x42')]+'%'};return _0x227997;})});}_0x6a1c60=_['merge']({},_0x6a1c60,_0x581e93[_0xe151('0x45')]);var _0x23e0ee={'where':_0x6a1c60[_0xe151('0x41')]};return db[_0xe151('0x33')]['count'](_0x23e0ee)['then'](function(_0x4117d6){_0x101d17[_0xe151('0x26')]=_0x4117d6;if(_0x581e93[_0xe151('0x37')]['includeAll']){_0x6a1c60[_0xe151('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xe151('0x52')](_0x6a1c60);})['then'](function(_0x304a8c){_0x101d17[_0xe151('0x48')]=_0x304a8c;return _0x101d17;})['then'](respondWithFilteredResult(_0x23bc0b,_0x6a1c60,'getVoiceQueuesReport'))[_0xe151('0x4c')](handleError(_0x23bc0b,null,_0xe151('0x50')));};
\ No newline at end of file
index 78da7fd..08b0ddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb281=['../../mysqldb','VoiceQueueReport','setMaxListeners','update','emit','hasOwnProperty','exports','events'];(function(_0x31e156,_0x5cdd3f){var _0x3ef78d=function(_0x284e8a){while(--_0x284e8a){_0x31e156['push'](_0x31e156['shift']());}};_0x3ef78d(++_0x5cdd3f);}(_0xb281,0x8f));var _0x1b28=function(_0x11882c,_0xb638e7){_0x11882c=_0x11882c-0x0;var _0x51d571=_0xb281[_0x11882c];return _0x51d571;};'use strict';var EventEmitter=require(_0x1b28('0x0'));var VoiceQueueReport=require(_0x1b28('0x1'))['db'][_0x1b28('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1b28('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b28('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1af786){return function(_0x3af195,_0x12bd9f,_0x24cf13){VoiceQueueReportEvents[_0x1b28('0x5')](_0x1af786+':'+_0x3af195['id'],_0x3af195);VoiceQueueReportEvents[_0x1b28('0x5')](_0x1af786,_0x3af195);_0x24cf13(null);};}for(var e in events){if(events[_0x1b28('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x1b28('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x908e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','VoiceQueueReport'];(function(_0x1761f0,_0x27fe8b){var _0x371d9f=function(_0x4b1a4e){while(--_0x4b1a4e){_0x1761f0['push'](_0x1761f0['shift']());}};_0x371d9f(++_0x27fe8b);}(_0x908e,0x154));var _0xe908=function(_0x4918a5,_0x528d80){_0x4918a5=_0x4918a5-0x0;var _0x50e059=_0x908e[_0x4918a5];return _0x50e059;};'use strict';var EventEmitter=require(_0xe908('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xe908('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe908('0x2')](0x0);var events={'afterCreate':_0xe908('0x3'),'afterUpdate':_0xe908('0x4'),'afterDestroy':_0xe908('0x5')};function emitEvent(_0x3acd03){return function(_0x3a8283,_0x440a83,_0x2eefe2){VoiceQueueReportEvents['emit'](_0x3acd03+':'+_0x3a8283['id'],_0x3a8283);VoiceQueueReportEvents[_0xe908('0x6')](_0x3acd03,_0x3a8283);_0x2eefe2(null);};}for(var e in events){if(events[_0xe908('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xe908('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
index b221e91..89bb151 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbb7=['uniqueid','calleridnum','lodash','util','../../config/logger','api','../../config/environment','./voiceQueueReport.attributes','report_queue'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcbb7,0x1df));var _0x7cbb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xcbb7[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7cbb('0x0'));var util=require(_0x7cbb('0x1'));var logger=require(_0x7cbb('0x2'))(_0x7cbb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7cbb('0x4'));var attributes=require(_0x7cbb('0x5'));module['exports']=function(_0x146393,_0x4dfc35){return _0x146393['define']('VoiceQueueReport',attributes,{'tableName':_0x7cbb('0x6'),'paranoid':![],'indexes':[{'fields':[_0x7cbb('0x7')]},{'fields':[_0x7cbb('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xae98=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x149198,_0x180b3e){var _0x58b2b9=function(_0x2bddbd){while(--_0x2bddbd){_0x149198['push'](_0x149198['shift']());}};_0x58b2b9(++_0x180b3e);}(_0xae98,0x69));var _0x8ae9=function(_0x12974f,_0x8b2a0c){_0x12974f=_0x12974f-0x0;var _0xb21b38=_0xae98[_0x12974f];return _0xb21b38;};'use strict';var _=require(_0x8ae9('0x0'));var util=require('util');var logger=require(_0x8ae9('0x1'))(_0x8ae9('0x2'));var moment=require(_0x8ae9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ae9('0x4'));var rimraf=require(_0x8ae9('0x5'));var config=require(_0x8ae9('0x6'));var attributes=require(_0x8ae9('0x7'));module[_0x8ae9('0x8')]=function(_0x53a623,_0x1d7bd4){return _0x53a623[_0x8ae9('0x9')](_0x8ae9('0xa'),attributes,{'tableName':_0x8ae9('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8ae9('0xc')]},{'fields':[_0x8ae9('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 70f1ad8..c19ca75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94af=['redis','localhost','socket.io-emitter','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','map','include','model','CreateVoiceQueueReport','create','body','raw','update','where','UpdateVoiceQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client'];(function(_0x567bcb,_0x4978c1){var _0x4eebc2=function(_0x42a456){while(--_0x42a456){_0x567bcb['push'](_0x567bcb['shift']());}};_0x4eebc2(++_0x4978c1);}(_0x94af,0x146));var _0xf94a=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x94af[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xf94a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf94a('0x1'));var rs=require(_0xf94a('0x2'));var fs=require('fs');var Redis=require(_0xf94a('0x3'));var db=require(_0xf94a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf94a('0x5'));var client=jayson[_0xf94a('0x6')]['http']({'port':0x232a});config[_0xf94a('0x7')]=_['defaults'](config[_0xf94a('0x7')],{'host':_0xf94a('0x8'),'port':0x18eb});var socket=require(_0xf94a('0x9'))(new Redis(config[_0xf94a('0x7')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x95e34b,_0x5e1f4c,_0x2e74a1){return new BPromise(function(_0x35588e,_0x5b2c78){return client[_0xf94a('0xa')](_0x95e34b,_0x2e74a1)[_0xf94a('0xb')](function(_0x3b0ae5){logger[_0xf94a('0xc')](_0xf94a('0xd'),_0x5e1f4c,_0xf94a('0xe'));logger[_0xf94a('0xf')](_0xf94a('0x10'),_0x5e1f4c,'request\x20sent',JSON[_0xf94a('0x11')](_0x3b0ae5));if(_0x3b0ae5[_0xf94a('0x12')]){if(_0x3b0ae5['error']['code']===0x1f4){logger['error'](_0xf94a('0xd'),_0x5e1f4c,_0x3b0ae5[_0xf94a('0x12')]['message']);return _0x5b2c78(_0x3b0ae5[_0xf94a('0x12')]['message']);}logger[_0xf94a('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x5e1f4c,_0x3b0ae5[_0xf94a('0x12')][_0xf94a('0x13')]);return _0x35588e(_0x3b0ae5[_0xf94a('0x12')]['message']);}else{logger[_0xf94a('0xc')](_0xf94a('0xd'),_0x5e1f4c,'request\x20sent');_0x35588e(_0x3b0ae5['result'][_0xf94a('0x13')]);}})[_0xf94a('0x14')](function(_0x50bfd2){logger[_0xf94a('0x12')](_0xf94a('0xd'),_0x5e1f4c,_0x50bfd2);_0x5b2c78(_0x50bfd2);});});}exports[_0xf94a('0x15')]=function(_0x57d706){var _0x20c538=this;return new Promise(function(_0xd8071c,_0x29c960){return db[_0xf94a('0x16')][_0xf94a('0x17')]({'raw':_0x57d706[_0xf94a('0x18')]?_0x57d706[_0xf94a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x57d706[_0xf94a('0x18')]?_0x57d706[_0xf94a('0x18')]['where']||null:null,'attributes':_0x57d706[_0xf94a('0x18')]?_0x57d706[_0xf94a('0x18')][_0xf94a('0x19')]||null:null,'limit':_0x57d706[_0xf94a('0x18')]?_0x57d706['options'][_0xf94a('0x1a')]||null:null,'include':_0x57d706[_0xf94a('0x18')]?_0x57d706['options']['include']?_[_0xf94a('0x1b')](_0x57d706['options'][_0xf94a('0x1c')],function(_0x52aabf){return{'model':db[_0x52aabf[_0xf94a('0x1d')]],'as':_0x52aabf['as'],'attributes':_0x52aabf[_0xf94a('0x19')],'include':_0x52aabf[_0xf94a('0x1c')]?_[_0xf94a('0x1b')](_0x52aabf[_0xf94a('0x1c')],function(_0x270967){return{'model':db[_0x270967[_0xf94a('0x1d')]],'as':_0x270967['as'],'attributes':_0x270967[_0xf94a('0x19')],'include':_0x270967['include']?_[_0xf94a('0x1b')](_0x270967['include'],function(_0x419009){return{'model':db[_0x419009['model']],'as':_0x419009['as'],'attributes':_0x419009[_0xf94a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf94a('0xb')](function(_0x11efe8){logger[_0xf94a('0xc')](_0xf94a('0x15'),_0x57d706);logger['debug'](_0xf94a('0x15'),_0x57d706,JSON[_0xf94a('0x11')](_0x11efe8));_0xd8071c(_0x11efe8);})[_0xf94a('0x14')](function(_0x2ae55d){logger[_0xf94a('0x12')]('GetVoiceQueueReport',_0x2ae55d['message'],_0x57d706);_0x29c960(_0x20c538[_0xf94a('0x12')](0x1f4,_0x2ae55d[_0xf94a('0x13')]));});});};exports[_0xf94a('0x1e')]=function(_0x4fdd26){var _0x5ad65a=this;return new Promise(function(_0x5c1109,_0x3f50f1){return db['VoiceQueueReport'][_0xf94a('0x1f')](_0x4fdd26[_0xf94a('0x20')],{'raw':_0x4fdd26[_0xf94a('0x18')]?_0x4fdd26[_0xf94a('0x18')][_0xf94a('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x599398){logger['info'](_0xf94a('0x1e'),_0x4fdd26);logger[_0xf94a('0xf')]('CreateVoiceQueueReport',_0x4fdd26,JSON['stringify'](_0x599398));_0x5c1109(_0x599398);})[_0xf94a('0x14')](function(_0x475a1f){logger[_0xf94a('0x12')]('CreateVoiceQueueReport',_0x475a1f['message'],_0x4fdd26);_0x3f50f1(_0x5ad65a[_0xf94a('0x12')](0x1f4,_0x475a1f[_0xf94a('0x13')]));});});};exports['UpdateVoiceQueueReport']=function(_0x7aed5a){var _0x314465=this;return new Promise(function(_0x433098,_0x84b2a0){return db['VoiceQueueReport'][_0xf94a('0x22')](_0x7aed5a[_0xf94a('0x20')],{'raw':_0x7aed5a[_0xf94a('0x18')]?_0x7aed5a[_0xf94a('0x18')][_0xf94a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7aed5a[_0xf94a('0x18')]?_0x7aed5a[_0xf94a('0x18')][_0xf94a('0x23')]||null:null,'attributes':_0x7aed5a['options']?_0x7aed5a[_0xf94a('0x18')]['attributes']||null:null,'limit':_0x7aed5a[_0xf94a('0x18')]?_0x7aed5a[_0xf94a('0x18')][_0xf94a('0x1a')]||null:null})[_0xf94a('0xb')](function(_0x367db6){logger[_0xf94a('0xc')](_0xf94a('0x24'),_0x7aed5a);logger[_0xf94a('0xf')](_0xf94a('0x24'),_0x7aed5a,JSON[_0xf94a('0x11')](_0x367db6));_0x433098(_0x367db6);})[_0xf94a('0x14')](function(_0xbec43d){logger[_0xf94a('0x12')](_0xf94a('0x24'),_0xbec43d['message'],_0x7aed5a);_0x84b2a0(_0x314465[_0xf94a('0x12')](0x1f4,_0xbec43d[_0xf94a('0x13')]));});});};
\ No newline at end of file
+var _0xac3a=['raw','attributes','limit','include','model','map','info','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','where','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','VoiceQueueReport','findAll','options'];(function(_0x1e459a,_0x44ee4e){var _0x51a1b2=function(_0x39027e){while(--_0x39027e){_0x1e459a['push'](_0x1e459a['shift']());}};_0x51a1b2(++_0x44ee4e);}(_0xac3a,0x134));var _0xaac3=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0xac3a[_0x40b3f2];return _0x4ce90c;};'use strict';var _=require('lodash');var util=require(_0xaac3('0x0'));var moment=require(_0xaac3('0x1'));var BPromise=require('bluebird');var rs=require(_0xaac3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaac3('0x3'))['db'];var utils=require(_0xaac3('0x4'));var logger=require(_0xaac3('0x5'))(_0xaac3('0x6'));var config=require(_0xaac3('0x7'));var jayson=require(_0xaac3('0x8'));var client=jayson[_0xaac3('0x9')][_0xaac3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaac3('0xb')],{'host':_0xaac3('0xc'),'port':0x18eb});var socket=require(_0xaac3('0xd'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xaac3('0xe')](socket);function respondWithRpcPromise(_0x3aad46,_0x36b727,_0x2f8b47){return new BPromise(function(_0x4dcc69,_0x4256c2){return client[_0xaac3('0xf')](_0x3aad46,_0x2f8b47)[_0xaac3('0x10')](function(_0x87270d){logger['info'](_0xaac3('0x11'),_0x36b727,_0xaac3('0x12'));logger[_0xaac3('0x13')](_0xaac3('0x14'),_0x36b727,_0xaac3('0x12'),JSON[_0xaac3('0x15')](_0x87270d));if(_0x87270d[_0xaac3('0x16')]){if(_0x87270d['error']['code']===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x36b727,_0x87270d['error'][_0xaac3('0x17')]);return _0x4256c2(_0x87270d['error'][_0xaac3('0x17')]);}logger[_0xaac3('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x36b727,_0x87270d[_0xaac3('0x16')][_0xaac3('0x17')]);return _0x4dcc69(_0x87270d[_0xaac3('0x16')][_0xaac3('0x17')]);}else{logger['info'](_0xaac3('0x11'),_0x36b727,_0xaac3('0x12'));_0x4dcc69(_0x87270d[_0xaac3('0x18')]['message']);}})['catch'](function(_0x3f30ca){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x36b727,_0x3f30ca);_0x4256c2(_0x3f30ca);});});}exports['GetVoiceQueueReport']=function(_0x12ddfe){var _0x5f3587=this;return new Promise(function(_0xcd9a5c,_0x3da0eb){return db[_0xaac3('0x19')][_0xaac3('0x1a')]({'raw':_0x12ddfe[_0xaac3('0x1b')]?_0x12ddfe[_0xaac3('0x1b')][_0xaac3('0x1c')]===undefined?!![]:![]:!![],'where':_0x12ddfe['options']?_0x12ddfe[_0xaac3('0x1b')]['where']||null:null,'attributes':_0x12ddfe[_0xaac3('0x1b')]?_0x12ddfe[_0xaac3('0x1b')][_0xaac3('0x1d')]||null:null,'limit':_0x12ddfe['options']?_0x12ddfe[_0xaac3('0x1b')][_0xaac3('0x1e')]||null:null,'include':_0x12ddfe['options']?_0x12ddfe[_0xaac3('0x1b')][_0xaac3('0x1f')]?_['map'](_0x12ddfe[_0xaac3('0x1b')][_0xaac3('0x1f')],function(_0x539a3a){return{'model':db[_0x539a3a[_0xaac3('0x20')]],'as':_0x539a3a['as'],'attributes':_0x539a3a[_0xaac3('0x1d')],'include':_0x539a3a[_0xaac3('0x1f')]?_[_0xaac3('0x21')](_0x539a3a['include'],function(_0x2b1902){return{'model':db[_0x2b1902[_0xaac3('0x20')]],'as':_0x2b1902['as'],'attributes':_0x2b1902[_0xaac3('0x1d')],'include':_0x2b1902[_0xaac3('0x1f')]?_['map'](_0x2b1902[_0xaac3('0x1f')],function(_0x47c1ff){return{'model':db[_0x47c1ff[_0xaac3('0x20')]],'as':_0x47c1ff['as'],'attributes':_0x47c1ff[_0xaac3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xaac3('0x10')](function(_0x387b31){logger[_0xaac3('0x22')](_0xaac3('0x23'),_0x12ddfe);logger[_0xaac3('0x13')](_0xaac3('0x23'),_0x12ddfe,JSON[_0xaac3('0x15')](_0x387b31));_0xcd9a5c(_0x387b31);})[_0xaac3('0x24')](function(_0x483eef){logger['error'](_0xaac3('0x23'),_0x483eef[_0xaac3('0x17')],_0x12ddfe);_0x3da0eb(_0x5f3587[_0xaac3('0x16')](0x1f4,_0x483eef[_0xaac3('0x17')]));});});};exports[_0xaac3('0x25')]=function(_0x347464){var _0x1a9e2b=this;return new Promise(function(_0x5ee6c8,_0x2039a7){return db['VoiceQueueReport'][_0xaac3('0x26')](_0x347464[_0xaac3('0x27')],{'raw':_0x347464[_0xaac3('0x1b')]?_0x347464[_0xaac3('0x1b')][_0xaac3('0x1c')]===undefined?!![]:![]:!![]})[_0xaac3('0x10')](function(_0x194272){logger[_0xaac3('0x22')](_0xaac3('0x25'),_0x347464);logger['debug'](_0xaac3('0x25'),_0x347464,JSON[_0xaac3('0x15')](_0x194272));_0x5ee6c8(_0x194272);})['catch'](function(_0x21ffec){logger[_0xaac3('0x16')](_0xaac3('0x25'),_0x21ffec[_0xaac3('0x17')],_0x347464);_0x2039a7(_0x1a9e2b['error'](0x1f4,_0x21ffec[_0xaac3('0x17')]));});});};exports[_0xaac3('0x28')]=function(_0x1ee878){var _0x5b966a=this;return new Promise(function(_0x32a5e1,_0x493a14){return db[_0xaac3('0x19')]['update'](_0x1ee878[_0xaac3('0x27')],{'raw':_0x1ee878['options']?_0x1ee878[_0xaac3('0x1b')][_0xaac3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ee878[_0xaac3('0x1b')]?_0x1ee878[_0xaac3('0x1b')][_0xaac3('0x29')]||null:null,'attributes':_0x1ee878[_0xaac3('0x1b')]?_0x1ee878['options']['attributes']||null:null,'limit':_0x1ee878[_0xaac3('0x1b')]?_0x1ee878[_0xaac3('0x1b')][_0xaac3('0x1e')]||null:null})[_0xaac3('0x10')](function(_0x1c8fd8){logger[_0xaac3('0x22')]('UpdateVoiceQueueReport',_0x1ee878);logger[_0xaac3('0x13')](_0xaac3('0x28'),_0x1ee878,JSON[_0xaac3('0x15')](_0x1c8fd8));_0x32a5e1(_0x1c8fd8);})[_0xaac3('0x24')](function(_0x544b7c){logger[_0xaac3('0x16')](_0xaac3('0x28'),_0x544b7c[_0xaac3('0x17')],_0x1ee878);_0x493a14(_0x5b966a[_0xaac3('0x16')](0x1f4,_0x544b7c[_0xaac3('0x17')]));});});};
\ No newline at end of file
index d2b5934..1c2312b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7cf=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0xb7cf,0xca));var _0xfb7c=function(_0x5358cd,_0x293fd6){_0x5358cd=_0x5358cd-0x0;var _0xc144e2=_0xb7cf[_0x5358cd];return _0xc144e2;};'use strict';var VoiceQueueReportEvents=require(_0xfb7c('0x0'));var events=[_0xfb7c('0x1'),_0xfb7c('0x2'),_0xfb7c('0x3')];function createListener(_0x8b8e96,_0x55696e){return function(_0x228b05){_0x55696e[_0xfb7c('0x4')](_0x8b8e96,_0x228b05);};}function removeListener(_0xf6b92f,_0xf47c1d){return function(){VoiceQueueReportEvents[_0xfb7c('0x5')](_0xf6b92f,_0xf47c1d);};}exports[_0xfb7c('0x6')]=function(_0x2e245c){for(var _0x135394=0x0,_0x41dcce=events[_0xfb7c('0x7')];_0x135394<_0x41dcce;_0x135394++){var _0x3c21f3=events[_0x135394];var _0x34b889=createListener(_0xfb7c('0x8')+_0x3c21f3,_0x2e245c);VoiceQueueReportEvents['on'](_0x3c21f3,_0x34b889);}};
\ No newline at end of file
+var _0x5aaa=['./voiceQueueReport.events','emit','removeListener','register','length'];(function(_0x5dee2f,_0x33149c){var _0x20d623=function(_0x209a35){while(--_0x209a35){_0x5dee2f['push'](_0x5dee2f['shift']());}};_0x20d623(++_0x33149c);}(_0x5aaa,0xff));var _0xa5aa=function(_0x525484,_0x33741e){_0x525484=_0x525484-0x0;var _0x19d0aa=_0x5aaa[_0x525484];return _0x19d0aa;};'use strict';var VoiceQueueReportEvents=require(_0xa5aa('0x0'));var events=['save','remove','update'];function createListener(_0x59ccda,_0x4926c9){return function(_0x128d2a){_0x4926c9[_0xa5aa('0x1')](_0x59ccda,_0x128d2a);};}function removeListener(_0x473061,_0x54ca19){return function(){VoiceQueueReportEvents[_0xa5aa('0x2')](_0x473061,_0x54ca19);};}exports[_0xa5aa('0x3')]=function(_0x5e1865){for(var _0x21d216=0x0,_0x143817=events[_0xa5aa('0x4')];_0x21d216<_0x143817;_0x21d216++){var _0x2c0b72=events[_0x21d216];var _0x5574aa=createListener('voiceQueueReport:'+_0x2c0b72,_0x5e1865);VoiceQueueReportEvents['on'](_0x2c0b72,_0x5574aa);}};
\ No newline at end of file
index 3bc1611..e80c849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9ff=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','multer','path','connect-timeout','express'];(function(_0x1cdc68,_0x287dcb){var _0x1afda8=function(_0x5da56b){while(--_0x5da56b){_0x1cdc68['push'](_0x1cdc68['shift']());}};_0x1afda8(++_0x287dcb);}(_0xe9ff,0x19a));var _0xfe9f=function(_0x549be1,_0x562b07){_0x549be1=_0x549be1-0x0;var _0x152cc9=_0xe9ff[_0x549be1];return _0x152cc9;};'use strict';var multer=require(_0xfe9f('0x0'));var util=require('util');var path=require(_0xfe9f('0x1'));var timeout=require(_0xfe9f('0x2'));var express=require(_0xfe9f('0x3'));var router=express[_0xfe9f('0x4')]();var fs_extra=require(_0xfe9f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfe9f('0x6'));var config=require(_0xfe9f('0x7'));var controller=require(_0xfe9f('0x8'));router[_0xfe9f('0x9')]('/',auth[_0xfe9f('0xa')](),controller[_0xfe9f('0xb')]);router[_0xfe9f('0x9')](_0xfe9f('0xc'),auth['isAuthenticated'](),controller[_0xfe9f('0xd')]);router[_0xfe9f('0xe')]('/',auth[_0xfe9f('0xa')](),controller[_0xfe9f('0xf')]);router['put'](_0xfe9f('0xc'),auth[_0xfe9f('0xa')](),controller[_0xfe9f('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfe9f('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xff1b=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0xff1b,0x1cd));var _0xbff1=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0xff1b[_0x44b7d6];return _0x5346f0;};'use strict';var multer=require(_0xbff1('0x0'));var util=require(_0xbff1('0x1'));var path=require(_0xbff1('0x2'));var timeout=require(_0xbff1('0x3'));var express=require(_0xbff1('0x4'));var router=express[_0xbff1('0x5')]();var fs_extra=require(_0xbff1('0x6'));var auth=require(_0xbff1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbff1('0x8'));var controller=require(_0xbff1('0x9'));router[_0xbff1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xbff1('0xb'),auth[_0xbff1('0xc')](),controller['show']);router[_0xbff1('0xd')]('/',auth['isAuthenticated'](),controller[_0xbff1('0xe')]);router[_0xbff1('0xf')]('/:id',auth[_0xbff1('0xc')](),controller[_0xbff1('0x10')]);router[_0xbff1('0x11')]('/:id',auth[_0xbff1('0xc')](),controller[_0xbff1('0x12')]);module[_0xbff1('0x13')]=router;
\ No newline at end of file
index b79cf69..c8d94fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb36=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x380836,_0x5eaa19){var _0x4bcadf=function(_0x2a3ed){while(--_0x2a3ed){_0x380836['push'](_0x380836['shift']());}};_0x4bcadf(++_0x5eaa19);}(_0xbb36,0x105));var _0x6bb3=function(_0x561a37,_0x1ba05e){_0x561a37=_0x561a37-0x0;var _0x14bd6c=_0xbb36[_0x561a37];return _0x14bd6c;};'use strict';var Sequelize=require(_0x6bb3('0x0'));var moment=require(_0x6bb3('0x1'));module[_0x6bb3('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6bb3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6bb3('0x4')],'allowNull':![],'defaultValue':moment()[_0x6bb3('0x5')](_0x6bb3('0x6'))}};
\ No newline at end of file
+var _0xdc35=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x125813,_0x15dfc7){var _0x26eda0=function(_0x312c16){while(--_0x312c16){_0x125813['push'](_0x125813['shift']());}};_0x26eda0(++_0x15dfc7);}(_0xdc35,0xd3));var _0x5dc3=function(_0x1a33ef,_0x281d3f){_0x1a33ef=_0x1a33ef-0x0;var _0x2d1094=_0xdc35[_0x1a33ef];return _0x2d1094;};'use strict';var Sequelize=require(_0x5dc3('0x0'));var moment=require(_0x5dc3('0x1'));module[_0x5dc3('0x2')]={'time':{'type':Sequelize[_0x5dc3('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5dc3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5dc3('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5dc3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5dc3('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5dc3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5dc3('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x5dc3('0x5'))}};
\ No newline at end of file
index a434359..cf0e901 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bf4=['undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','VoiceQueuesLog','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0xa059ea,_0x5cb91e){var _0x156a4c=function(_0x1b4717){while(--_0x1b4717){_0xa059ea['push'](_0xa059ea['shift']());}};_0x156a4c(++_0x5cb91e);}(_0x5bf4,0xc4));var _0x45bf=function(_0x176380,_0x2e963e){_0x176380=_0x176380-0x0;var _0x2e0bab=_0x5bf4[_0x176380];return _0x2e0bab;};'use strict';var emlformat=require(_0x45bf('0x0'));var rimraf=require(_0x45bf('0x1'));var zipdir=require(_0x45bf('0x2'));var jsonpatch=require(_0x45bf('0x3'));var rp=require(_0x45bf('0x4'));var moment=require('moment');var BPromise=require(_0x45bf('0x5'));var Mustache=require(_0x45bf('0x6'));var util=require('util');var path=require(_0x45bf('0x7'));var sox=require(_0x45bf('0x8'));var csv=require('to-csv');var ejs=require(_0x45bf('0x9'));var fs=require('fs');var fs_extra=require(_0x45bf('0xa'));var _=require(_0x45bf('0xb'));var squel=require('squel');var crypto=require(_0x45bf('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x45bf('0xd'));var Papa=require(_0x45bf('0xe'));var Redis=require(_0x45bf('0xf'));var authService=require(_0x45bf('0x10'));var qs=require(_0x45bf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45bf('0x12'));var logger=require(_0x45bf('0x13'))(_0x45bf('0x14'));var utils=require('../../config/utils');var config=require(_0x45bf('0x15'));var licenseUtil=require(_0x45bf('0x16'));var db=require(_0x45bf('0x17'))['db'];function respondWithStatusCode(_0xb305d8,_0x4d692d){_0x4d692d=_0x4d692d||0xcc;return function(_0x2fa661){if(_0x2fa661){return _0xb305d8[_0x45bf('0x18')](_0x4d692d);}return _0xb305d8[_0x45bf('0x19')](_0x4d692d)[_0x45bf('0x1a')]();};}function respondWithResult(_0x24da38,_0x2c180d){_0x2c180d=_0x2c180d||0xc8;return function(_0x1b0310){if(_0x1b0310){return _0x24da38['status'](_0x2c180d)[_0x45bf('0x1b')](_0x1b0310);}};}function respondWithFilteredResult(_0x2e10cc,_0x2d2abf){return function(_0x53c41f){if(_0x53c41f){var _0x3f564d=typeof _0x2d2abf[_0x45bf('0x1c')]===_0x45bf('0x1d')&&typeof _0x2d2abf['limit']===_0x45bf('0x1d');var _0x48e2d3=_0x53c41f['count'];var _0x5e3989=_0x3f564d?0x0:_0x2d2abf['offset'];var _0x38e2df=_0x3f564d?_0x53c41f[_0x45bf('0x1e')]:_0x2d2abf[_0x45bf('0x1c')]+_0x2d2abf[_0x45bf('0x1f')];var _0x1e301a;if(_0x38e2df>=_0x48e2d3){_0x38e2df=_0x48e2d3;_0x1e301a=0xc8;}else{_0x1e301a=0xce;}_0x2e10cc[_0x45bf('0x19')](_0x1e301a);return _0x2e10cc['set'](_0x45bf('0x20'),_0x5e3989+'-'+_0x38e2df+'/'+_0x48e2d3)[_0x45bf('0x1b')](_0x53c41f);}return null;};}function patchUpdates(_0x201639){return function(_0x418282){try{jsonpatch[_0x45bf('0x21')](_0x418282,_0x201639,!![]);}catch(_0x12d180){return BPromise[_0x45bf('0x22')](_0x12d180);}return _0x418282[_0x45bf('0x23')]();};}function saveUpdates(_0x291586,_0x345bf9){return function(_0x5a9f04){if(_0x5a9f04){return _0x5a9f04[_0x45bf('0x24')](_0x291586)['then'](function(_0x1873ca){return _0x1873ca;});}return null;};}function removeEntity(_0x26d8bc,_0x535c3e){return function(_0x357f0b){if(_0x357f0b){return _0x357f0b[_0x45bf('0x25')]()[_0x45bf('0x26')](function(){_0x26d8bc[_0x45bf('0x19')](0xcc)[_0x45bf('0x1a')]();});}};}function handleEntityNotFound(_0x269e3c,_0x20d975){return function(_0x41286c){if(!_0x41286c){_0x269e3c[_0x45bf('0x18')](0x194);}return _0x41286c;};}function handleError(_0x4cd913,_0x570f82){_0x570f82=_0x570f82||0x1f4;return function(_0x2ea5a4){logger[_0x45bf('0x27')](_0x2ea5a4['stack']);if(_0x2ea5a4['name']){delete _0x2ea5a4[_0x45bf('0x28')];}_0x4cd913[_0x45bf('0x19')](_0x570f82)[_0x45bf('0x29')](_0x2ea5a4);};}exports[_0x45bf('0x2a')]=function(_0x25ce0f,_0x3c10a0){var _0x3bc172={},_0x4404ee={},_0x2611c={'count':0x0,'rows':[]};var _0xdcea3c=_['map'](db[_0x45bf('0x2b')]['rawAttributes'],function(_0x7bdc0e){return{'name':_0x7bdc0e[_0x45bf('0x2c')],'type':_0x7bdc0e[_0x45bf('0x2d')][_0x45bf('0x2e')]};});_0x4404ee[_0x45bf('0x2f')]=_[_0x45bf('0x30')](_0xdcea3c,_0x45bf('0x28'));_0x4404ee[_0x45bf('0x31')]=_[_0x45bf('0x32')](_0x25ce0f['query']);_0x4404ee[_0x45bf('0x33')]=_[_0x45bf('0x34')](_0x4404ee[_0x45bf('0x2f')],_0x4404ee[_0x45bf('0x31')]);_0x3bc172[_0x45bf('0x35')]=_[_0x45bf('0x34')](_0x4404ee[_0x45bf('0x2f')],qs[_0x45bf('0x36')](_0x25ce0f[_0x45bf('0x31')][_0x45bf('0x36')]));_0x3bc172[_0x45bf('0x35')]=_0x3bc172['attributes']['length']?_0x3bc172[_0x45bf('0x35')]:_0x4404ee[_0x45bf('0x2f')];if(!_0x25ce0f[_0x45bf('0x31')][_0x45bf('0x37')](_0x45bf('0x38'))){_0x3bc172[_0x45bf('0x1f')]=qs[_0x45bf('0x1f')](_0x25ce0f[_0x45bf('0x31')][_0x45bf('0x1f')]);_0x3bc172['offset']=qs[_0x45bf('0x1c')](_0x25ce0f['query'][_0x45bf('0x1c')]);}_0x3bc172[_0x45bf('0x39')]=qs[_0x45bf('0x3a')](_0x25ce0f['query'][_0x45bf('0x3a')]);_0x3bc172[_0x45bf('0x3b')]=qs['filters'](_[_0x45bf('0x3c')](_0x25ce0f[_0x45bf('0x31')],_0x4404ee['filters']),_0xdcea3c);if(_0x25ce0f[_0x45bf('0x31')][_0x45bf('0x3d')]){_0x3bc172[_0x45bf('0x3b')]=_[_0x45bf('0x3e')](_0x3bc172[_0x45bf('0x3b')],{'$or':_[_0x45bf('0x30')](_0xdcea3c,function(_0x374c1e){if(_0x374c1e['type']!=='VIRTUAL'){var _0x49675b={};_0x49675b[_0x374c1e['name']]={'$like':'%'+_0x25ce0f[_0x45bf('0x31')][_0x45bf('0x3d')]+'%'};return _0x49675b;}})});}_0x3bc172=_[_0x45bf('0x3e')]({},_0x3bc172,_0x25ce0f['options']);var _0x2a3c67={'where':_0x3bc172[_0x45bf('0x3b')]};return db['VoiceQueuesLog'][_0x45bf('0x1e')](_0x2a3c67)[_0x45bf('0x26')](function(_0x1251df){_0x2611c[_0x45bf('0x1e')]=_0x1251df;if(_0x25ce0f['query'][_0x45bf('0x3f')]){_0x3bc172[_0x45bf('0x40')]=[{'all':!![]}];}return db[_0x45bf('0x2b')][_0x45bf('0x41')](_0x3bc172);})[_0x45bf('0x26')](function(_0x1a6b61){_0x2611c['rows']=_0x1a6b61;return _0x2611c;})[_0x45bf('0x26')](respondWithFilteredResult(_0x3c10a0,_0x3bc172))[_0x45bf('0x42')](handleError(_0x3c10a0,null));};exports[_0x45bf('0x43')]=function(_0x3f0efb,_0xe5e45e){var _0x4ca93c={'raw':!![],'where':{'id':_0x3f0efb[_0x45bf('0x44')]['id']}},_0x4478f6={};_0x4478f6['model']=_[_0x45bf('0x32')](db[_0x45bf('0x2b')][_0x45bf('0x45')]);_0x4478f6[_0x45bf('0x31')]=_['keys'](_0x3f0efb['query']);_0x4478f6[_0x45bf('0x33')]=_[_0x45bf('0x34')](_0x4478f6[_0x45bf('0x2f')],_0x4478f6[_0x45bf('0x31')]);_0x4ca93c[_0x45bf('0x35')]=_['intersection'](_0x4478f6[_0x45bf('0x2f')],qs['fields'](_0x3f0efb['query']['fields']));_0x4ca93c[_0x45bf('0x35')]=_0x4ca93c[_0x45bf('0x35')][_0x45bf('0x46')]?_0x4ca93c[_0x45bf('0x35')]:_0x4478f6[_0x45bf('0x2f')];if(_0x3f0efb[_0x45bf('0x31')]['includeAll']){_0x4ca93c['include']=[{'all':!![]}];}_0x4ca93c=_['merge']({},_0x4ca93c,_0x3f0efb[_0x45bf('0x47')]);return db[_0x45bf('0x2b')][_0x45bf('0x48')](_0x4ca93c)[_0x45bf('0x26')](handleEntityNotFound(_0xe5e45e,null))[_0x45bf('0x26')](respondWithResult(_0xe5e45e,null))['catch'](handleError(_0xe5e45e,null));};exports[_0x45bf('0x49')]=function(_0x31e068,_0x37b4e9){return db['VoiceQueuesLog'][_0x45bf('0x49')](_0x31e068['body'],{})[_0x45bf('0x26')](respondWithResult(_0x37b4e9,0xc9))['catch'](handleError(_0x37b4e9,null));};exports[_0x45bf('0x24')]=function(_0x33b85c,_0x7821ac){if(_0x33b85c[_0x45bf('0x4a')]['id']){delete _0x33b85c[_0x45bf('0x4a')]['id'];}return db[_0x45bf('0x2b')][_0x45bf('0x48')]({'where':{'id':_0x33b85c[_0x45bf('0x44')]['id']}})[_0x45bf('0x26')](handleEntityNotFound(_0x7821ac,null))[_0x45bf('0x26')](saveUpdates(_0x33b85c['body'],null))['then'](respondWithResult(_0x7821ac,null))[_0x45bf('0x42')](handleError(_0x7821ac,null));};exports[_0x45bf('0x25')]=function(_0x4d9156,_0x4b0873){return db[_0x45bf('0x2b')]['find']({'where':{'id':_0x4d9156[_0x45bf('0x44')]['id']}})[_0x45bf('0x26')](handleEntityNotFound(_0x4b0873,null))[_0x45bf('0x26')](removeEntity(_0x4b0873,null))[_0x45bf('0x42')](handleError(_0x4b0873,null));};
\ No newline at end of file
+var _0xebe3=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','undefined','count','offset','status','Content-Range','json','apply','update','then','destroy','error','name','send','index','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','VoiceQueuesLog','includeAll','catch','show','params','include','options','find','create','body','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xebe3,0x80));var _0x3ebe=function(_0x344543,_0x4a6db4){_0x344543=_0x344543-0x0;var _0x310699=_0xebe3[_0x344543];return _0x310699;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3ebe('0x0'));var jsonpatch=require(_0x3ebe('0x1'));var rp=require(_0x3ebe('0x2'));var moment=require('moment');var BPromise=require(_0x3ebe('0x3'));var Mustache=require(_0x3ebe('0x4'));var util=require(_0x3ebe('0x5'));var path=require('path');var sox=require(_0x3ebe('0x6'));var csv=require(_0x3ebe('0x7'));var ejs=require(_0x3ebe('0x8'));var fs=require('fs');var fs_extra=require(_0x3ebe('0x9'));var _=require(_0x3ebe('0xa'));var squel=require(_0x3ebe('0xb'));var crypto=require(_0x3ebe('0xc'));var jsforce=require(_0x3ebe('0xd'));var deskjs=require(_0x3ebe('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3ebe('0xf'));var Papa=require(_0x3ebe('0x10'));var Redis=require(_0x3ebe('0x11'));var authService=require(_0x3ebe('0x12'));var qs=require(_0x3ebe('0x13'));var as=require(_0x3ebe('0x14'));var hardwareService=require(_0x3ebe('0x15'));var logger=require(_0x3ebe('0x16'))(_0x3ebe('0x17'));var utils=require(_0x3ebe('0x18'));var config=require(_0x3ebe('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ebe('0x1a'))['db'];function respondWithStatusCode(_0x319e0d,_0xb8a7d1){_0xb8a7d1=_0xb8a7d1||0xcc;return function(_0x57180f){if(_0x57180f){return _0x319e0d[_0x3ebe('0x1b')](_0xb8a7d1);}return _0x319e0d['status'](_0xb8a7d1)['end']();};}function respondWithResult(_0x3fa6d9,_0x146c42){_0x146c42=_0x146c42||0xc8;return function(_0x3e2655){if(_0x3e2655){return _0x3fa6d9['status'](_0x146c42)['json'](_0x3e2655);}};}function respondWithFilteredResult(_0x29f31c,_0x2dfbfd){return function(_0x48768c){if(_0x48768c){var _0x55921c=typeof _0x2dfbfd['offset']==='undefined'&&typeof _0x2dfbfd['limit']===_0x3ebe('0x1c');var _0x576839=_0x48768c[_0x3ebe('0x1d')];var _0x2bb453=_0x55921c?0x0:_0x2dfbfd[_0x3ebe('0x1e')];var _0x51eb3a=_0x55921c?_0x48768c['count']:_0x2dfbfd[_0x3ebe('0x1e')]+_0x2dfbfd['limit'];var _0x5d86f0;if(_0x51eb3a>=_0x576839){_0x51eb3a=_0x576839;_0x5d86f0=0xc8;}else{_0x5d86f0=0xce;}_0x29f31c[_0x3ebe('0x1f')](_0x5d86f0);return _0x29f31c['set'](_0x3ebe('0x20'),_0x2bb453+'-'+_0x51eb3a+'/'+_0x576839)[_0x3ebe('0x21')](_0x48768c);}return null;};}function patchUpdates(_0x37b22b){return function(_0x387ab1){try{jsonpatch[_0x3ebe('0x22')](_0x387ab1,_0x37b22b,!![]);}catch(_0x13dbb6){return BPromise['reject'](_0x13dbb6);}return _0x387ab1['save']();};}function saveUpdates(_0x249a33,_0x417814){return function(_0x3ede00){if(_0x3ede00){return _0x3ede00[_0x3ebe('0x23')](_0x249a33)[_0x3ebe('0x24')](function(_0x2cfc54){return _0x2cfc54;});}return null;};}function removeEntity(_0x46808d,_0x56ed07){return function(_0xaf19de){if(_0xaf19de){return _0xaf19de[_0x3ebe('0x25')]()[_0x3ebe('0x24')](function(){_0x46808d[_0x3ebe('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30539e,_0x3852fc){return function(_0x219297){if(!_0x219297){_0x30539e[_0x3ebe('0x1b')](0x194);}return _0x219297;};}function handleError(_0x29f7c6,_0x46ba2b){_0x46ba2b=_0x46ba2b||0x1f4;return function(_0xd498b7){logger[_0x3ebe('0x26')](_0xd498b7['stack']);if(_0xd498b7[_0x3ebe('0x27')]){delete _0xd498b7['name'];}_0x29f7c6[_0x3ebe('0x1f')](_0x46ba2b)[_0x3ebe('0x28')](_0xd498b7);};}exports[_0x3ebe('0x29')]=function(_0x43904,_0x3f12c1){var _0x1d1691={},_0x5388b0={},_0x1c688e={'count':0x0,'rows':[]};var _0x4c7962=_[_0x3ebe('0x2a')](db['VoiceQueuesLog'][_0x3ebe('0x2b')],function(_0x4ed5c4){return{'name':_0x4ed5c4['fieldName'],'type':_0x4ed5c4['type'][_0x3ebe('0x2c')]};});_0x5388b0[_0x3ebe('0x2d')]=_[_0x3ebe('0x2a')](_0x4c7962,'name');_0x5388b0[_0x3ebe('0x2e')]=_[_0x3ebe('0x2f')](_0x43904[_0x3ebe('0x2e')]);_0x5388b0['filters']=_[_0x3ebe('0x30')](_0x5388b0['model'],_0x5388b0[_0x3ebe('0x2e')]);_0x1d1691[_0x3ebe('0x31')]=_['intersection'](_0x5388b0['model'],qs[_0x3ebe('0x32')](_0x43904[_0x3ebe('0x2e')][_0x3ebe('0x32')]));_0x1d1691[_0x3ebe('0x31')]=_0x1d1691[_0x3ebe('0x31')][_0x3ebe('0x33')]?_0x1d1691[_0x3ebe('0x31')]:_0x5388b0[_0x3ebe('0x2d')];if(!_0x43904[_0x3ebe('0x2e')][_0x3ebe('0x34')](_0x3ebe('0x35'))){_0x1d1691[_0x3ebe('0x36')]=qs[_0x3ebe('0x36')](_0x43904[_0x3ebe('0x2e')]['limit']);_0x1d1691[_0x3ebe('0x1e')]=qs[_0x3ebe('0x1e')](_0x43904[_0x3ebe('0x2e')]['offset']);}_0x1d1691[_0x3ebe('0x37')]=qs[_0x3ebe('0x38')](_0x43904[_0x3ebe('0x2e')][_0x3ebe('0x38')]);_0x1d1691[_0x3ebe('0x39')]=qs[_0x3ebe('0x3a')](_[_0x3ebe('0x3b')](_0x43904[_0x3ebe('0x2e')],_0x5388b0['filters']),_0x4c7962);if(_0x43904[_0x3ebe('0x2e')]['filter']){_0x1d1691[_0x3ebe('0x39')]=_[_0x3ebe('0x3c')](_0x1d1691[_0x3ebe('0x39')],{'$or':_[_0x3ebe('0x2a')](_0x4c7962,function(_0x279966){if(_0x279966[_0x3ebe('0x3d')]!==_0x3ebe('0x3e')){var _0x3187e={};_0x3187e[_0x279966['name']]={'$like':'%'+_0x43904['query'][_0x3ebe('0x3f')]+'%'};return _0x3187e;}})});}_0x1d1691=_[_0x3ebe('0x3c')]({},_0x1d1691,_0x43904['options']);var _0x100592={'where':_0x1d1691[_0x3ebe('0x39')]};return db[_0x3ebe('0x40')]['count'](_0x100592)[_0x3ebe('0x24')](function(_0x17325c){_0x1c688e[_0x3ebe('0x1d')]=_0x17325c;if(_0x43904[_0x3ebe('0x2e')][_0x3ebe('0x41')]){_0x1d1691['include']=[{'all':!![]}];}return db[_0x3ebe('0x40')]['findAll'](_0x1d1691);})[_0x3ebe('0x24')](function(_0x121f8b){_0x1c688e['rows']=_0x121f8b;return _0x1c688e;})[_0x3ebe('0x24')](respondWithFilteredResult(_0x3f12c1,_0x1d1691))[_0x3ebe('0x42')](handleError(_0x3f12c1,null));};exports[_0x3ebe('0x43')]=function(_0x111ae3,_0x49902f){var _0x162831={'raw':!![],'where':{'id':_0x111ae3[_0x3ebe('0x44')]['id']}},_0x2495c0={};_0x2495c0[_0x3ebe('0x2d')]=_[_0x3ebe('0x2f')](db[_0x3ebe('0x40')][_0x3ebe('0x2b')]);_0x2495c0[_0x3ebe('0x2e')]=_[_0x3ebe('0x2f')](_0x111ae3['query']);_0x2495c0['filters']=_['intersection'](_0x2495c0[_0x3ebe('0x2d')],_0x2495c0[_0x3ebe('0x2e')]);_0x162831['attributes']=_[_0x3ebe('0x30')](_0x2495c0['model'],qs['fields'](_0x111ae3[_0x3ebe('0x2e')][_0x3ebe('0x32')]));_0x162831[_0x3ebe('0x31')]=_0x162831[_0x3ebe('0x31')][_0x3ebe('0x33')]?_0x162831[_0x3ebe('0x31')]:_0x2495c0[_0x3ebe('0x2d')];if(_0x111ae3[_0x3ebe('0x2e')][_0x3ebe('0x41')]){_0x162831[_0x3ebe('0x45')]=[{'all':!![]}];}_0x162831=_['merge']({},_0x162831,_0x111ae3[_0x3ebe('0x46')]);return db['VoiceQueuesLog'][_0x3ebe('0x47')](_0x162831)[_0x3ebe('0x24')](handleEntityNotFound(_0x49902f,null))[_0x3ebe('0x24')](respondWithResult(_0x49902f,null))['catch'](handleError(_0x49902f,null));};exports[_0x3ebe('0x48')]=function(_0x3a56b1,_0x42ae0c){return db[_0x3ebe('0x40')][_0x3ebe('0x48')](_0x3a56b1[_0x3ebe('0x49')],{})[_0x3ebe('0x24')](respondWithResult(_0x42ae0c,0xc9))['catch'](handleError(_0x42ae0c,null));};exports[_0x3ebe('0x23')]=function(_0x3c0fc2,_0x2da6fd){if(_0x3c0fc2[_0x3ebe('0x49')]['id']){delete _0x3c0fc2[_0x3ebe('0x49')]['id'];}return db[_0x3ebe('0x40')][_0x3ebe('0x47')]({'where':{'id':_0x3c0fc2[_0x3ebe('0x44')]['id']}})[_0x3ebe('0x24')](handleEntityNotFound(_0x2da6fd,null))[_0x3ebe('0x24')](saveUpdates(_0x3c0fc2['body'],null))[_0x3ebe('0x24')](respondWithResult(_0x2da6fd,null))[_0x3ebe('0x42')](handleError(_0x2da6fd,null));};exports[_0x3ebe('0x25')]=function(_0x487067,_0x72d9cf){return db[_0x3ebe('0x40')]['find']({'where':{'id':_0x487067[_0x3ebe('0x44')]['id']}})['then'](handleEntityNotFound(_0x72d9cf,null))[_0x3ebe('0x24')](removeEntity(_0x72d9cf,null))[_0x3ebe('0x42')](handleError(_0x72d9cf,null));};
\ No newline at end of file
index 5a2ecc2..1eb8aab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46b2=['exports','define','VoiceQueuesLog','voice_queues_log','dtm','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x46b2,0x109));var _0x246b=function(_0x49a44e,_0x2544b4){_0x49a44e=_0x49a44e-0x0;var _0xbc54e6=_0x46b2[_0x49a44e];return _0xbc54e6;};'use strict';var _=require(_0x246b('0x0'));var util=require(_0x246b('0x1'));var logger=require(_0x246b('0x2'))('api');var moment=require(_0x246b('0x3'));var BPromise=require(_0x246b('0x4'));var rp=require(_0x246b('0x5'));var fs=require('fs');var path=require(_0x246b('0x6'));var rimraf=require('rimraf');var config=require(_0x246b('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x246b('0x8')]=function(_0x4bded0,_0x3cb896){return _0x4bded0[_0x246b('0x9')](_0x246b('0xa'),attributes,{'tableName':_0x246b('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x246b('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x28b5=['../../config/environment','./voiceQueuesLog.attributes','exports','define','event_dtm','event','dtm','lodash','../../config/logger','api','moment','request-promise'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0x28b5,0x13f));var _0x528b=function(_0x1245de,_0x133527){_0x1245de=_0x1245de-0x0;var _0x252625=_0x28b5[_0x1245de];return _0x252625;};'use strict';var _=require(_0x528b('0x0'));var util=require('util');var logger=require(_0x528b('0x1'))(_0x528b('0x2'));var moment=require(_0x528b('0x3'));var BPromise=require('bluebird');var rp=require(_0x528b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x528b('0x5'));var attributes=require(_0x528b('0x6'));module[_0x528b('0x7')]=function(_0x1bc1db,_0x52cb92){return _0x1bc1db[_0x528b('0x8')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x528b('0x9'),'fields':[_0x528b('0xa'),_0x528b('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index f7ff402..762b9ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6127=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5aaadb,_0xeeab51){var _0x379c74=function(_0x10319a){while(--_0x10319a){_0x5aaadb['push'](_0x5aaadb['shift']());}};_0x379c74(++_0xeeab51);}(_0x6127,0x165));var _0x7612=function(_0x4f25f9,_0x255051){_0x4f25f9=_0x4f25f9-0x0;var _0x92083c=_0x6127[_0x4f25f9];return _0x92083c;};'use strict';var _=require(_0x7612('0x0'));var util=require(_0x7612('0x1'));var moment=require(_0x7612('0x2'));var BPromise=require(_0x7612('0x3'));var rs=require(_0x7612('0x4'));var fs=require('fs');var Redis=require(_0x7612('0x5'));var db=require(_0x7612('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7612('0x7'));var config=require(_0x7612('0x8'));var jayson=require(_0x7612('0x9'));var client=jayson[_0x7612('0xa')][_0x7612('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x553b48,_0x2dc201,_0x195aaf){return new BPromise(function(_0x36e432,_0x332592){return client[_0x7612('0xc')](_0x553b48,_0x195aaf)[_0x7612('0xd')](function(_0x1e191a){logger[_0x7612('0xe')](_0x7612('0xf'),_0x2dc201,_0x7612('0x10'));logger[_0x7612('0x11')](_0x7612('0x12'),_0x2dc201,_0x7612('0x10'),JSON[_0x7612('0x13')](_0x1e191a));if(_0x1e191a[_0x7612('0x14')]){if(_0x1e191a[_0x7612('0x14')][_0x7612('0x15')]===0x1f4){logger[_0x7612('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2dc201,_0x1e191a[_0x7612('0x14')]['message']);return _0x332592(_0x1e191a['error'][_0x7612('0x16')]);}logger[_0x7612('0x14')](_0x7612('0xf'),_0x2dc201,_0x1e191a[_0x7612('0x14')][_0x7612('0x16')]);return _0x36e432(_0x1e191a[_0x7612('0x14')][_0x7612('0x16')]);}else{logger[_0x7612('0xe')](_0x7612('0xf'),_0x2dc201,'request\x20sent');_0x36e432(_0x1e191a[_0x7612('0x17')][_0x7612('0x16')]);}})[_0x7612('0x18')](function(_0x147776){logger[_0x7612('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2dc201,_0x147776);_0x332592(_0x147776);});});}
\ No newline at end of file
+var _0x5d99=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x30392f,_0xe4e3c0){var _0x528ebb=function(_0x3ff4c0){while(--_0x3ff4c0){_0x30392f['push'](_0x30392f['shift']());}};_0x528ebb(++_0xe4e3c0);}(_0x5d99,0x150));var _0x95d9=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0x5d99[_0xb301d4];return _0x3b5bde;};'use strict';var _=require('lodash');var util=require(_0x95d9('0x0'));var moment=require(_0x95d9('0x1'));var BPromise=require(_0x95d9('0x2'));var rs=require(_0x95d9('0x3'));var fs=require('fs');var Redis=require(_0x95d9('0x4'));var db=require(_0x95d9('0x5'))['db'];var utils=require(_0x95d9('0x6'));var logger=require(_0x95d9('0x7'))(_0x95d9('0x8'));var config=require(_0x95d9('0x9'));var jayson=require(_0x95d9('0xa'));var client=jayson[_0x95d9('0xb')][_0x95d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3eb1ab,_0x4d71cd,_0x28529a){return new BPromise(function(_0x12d768,_0x12e7be){return client['request'](_0x3eb1ab,_0x28529a)['then'](function(_0x73c1ed){logger[_0x95d9('0xd')](_0x95d9('0xe'),_0x4d71cd,_0x95d9('0xf'));logger[_0x95d9('0x10')](_0x95d9('0x11'),_0x4d71cd,'request\x20sent',JSON[_0x95d9('0x12')](_0x73c1ed));if(_0x73c1ed['error']){if(_0x73c1ed[_0x95d9('0x13')][_0x95d9('0x14')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x4d71cd,_0x73c1ed['error'][_0x95d9('0x15')]);return _0x12e7be(_0x73c1ed['error']['message']);}logger[_0x95d9('0x13')](_0x95d9('0xe'),_0x4d71cd,_0x73c1ed['error'][_0x95d9('0x15')]);return _0x12d768(_0x73c1ed[_0x95d9('0x13')][_0x95d9('0x15')]);}else{logger[_0x95d9('0xd')](_0x95d9('0xe'),_0x4d71cd,_0x95d9('0xf'));_0x12d768(_0x73c1ed['result'][_0x95d9('0x15')]);}})['catch'](function(_0x1abb12){logger[_0x95d9('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4d71cd,_0x1abb12);_0x12e7be(_0x1abb12);});});}
\ No newline at end of file
index 62d7c62..7b7347b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c66=['fs-extra','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','exports','path','connect-timeout','express','Router'];(function(_0x5ba8b6,_0x186a1e){var _0x34da16=function(_0x313685){while(--_0x313685){_0x5ba8b6['push'](_0x5ba8b6['shift']());}};_0x34da16(++_0x186a1e);}(_0x5c66,0x134));var _0x65c6=function(_0x35ef21,_0x13aab5){_0x35ef21=_0x35ef21-0x0;var _0x22b28b=_0x5c66[_0x35ef21];return _0x22b28b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x65c6('0x0'));var timeout=require(_0x65c6('0x1'));var express=require(_0x65c6('0x2'));var router=express[_0x65c6('0x3')]();var fs_extra=require(_0x65c6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x65c6('0x5'));var config=require('../../config/environment');var controller=require(_0x65c6('0x6'));router[_0x65c6('0x7')]('/',auth[_0x65c6('0x8')](),controller[_0x65c6('0x9')]);router['get']('/describe',auth[_0x65c6('0x8')](),controller[_0x65c6('0xa')]);router[_0x65c6('0x7')](_0x65c6('0xb'),auth[_0x65c6('0x8')](),controller[_0x65c6('0xc')]);router[_0x65c6('0x7')](_0x65c6('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x65c6('0x7')](_0x65c6('0xe'),controller[_0x65c6('0xf')]);router[_0x65c6('0x7')](_0x65c6('0x10'),auth['isAuthenticated'](),controller[_0x65c6('0x11')]);router[_0x65c6('0x12')]('/',auth[_0x65c6('0x8')](),controller[_0x65c6('0x13')]);router[_0x65c6('0x12')](_0x65c6('0x10'),auth[_0x65c6('0x8')](),controller[_0x65c6('0x14')]);router[_0x65c6('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x65c6('0x16')]);router['delete'](_0x65c6('0xb'),auth[_0x65c6('0x8')](),controller['destroy']);module[_0x65c6('0x17')]=router;
\ No newline at end of file
+var _0x7282=['index','/describe','/:id','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','/:id/transcribe','runTranscribe','update','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated'];(function(_0x54545e,_0x5220e4){var _0x610536=function(_0x2ecedc){while(--_0x2ecedc){_0x54545e['push'](_0x54545e['shift']());}};_0x610536(++_0x5220e4);}(_0x7282,0x121));var _0x2728=function(_0x5f4a33,_0x5a9b58){_0x5f4a33=_0x5f4a33-0x0;var _0x3f19b6=_0x7282[_0x5f4a33];return _0x3f19b6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2728('0x0'));var timeout=require(_0x2728('0x1'));var express=require('express');var router=express[_0x2728('0x2')]();var fs_extra=require(_0x2728('0x3'));var auth=require(_0x2728('0x4'));var interaction=require(_0x2728('0x5'));var config=require(_0x2728('0x6'));var controller=require(_0x2728('0x7'));router[_0x2728('0x8')]('/',auth[_0x2728('0x9')](),controller[_0x2728('0xa')]);router[_0x2728('0x8')](_0x2728('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2728('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2728('0x8')](_0x2728('0xd'),auth[_0x2728('0x9')](),controller[_0x2728('0xe')]);router[_0x2728('0x8')](_0x2728('0xf'),controller[_0x2728('0x10')]);router[_0x2728('0x8')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x2728('0x11')]);router[_0x2728('0x12')]('/',auth[_0x2728('0x9')](),controller['create']);router[_0x2728('0x12')](_0x2728('0x13'),auth[_0x2728('0x9')](),controller[_0x2728('0x14')]);router['put']('/:id',auth[_0x2728('0x9')](),controller[_0x2728('0x15')]);router['delete'](_0x2728('0xc'),auth[_0x2728('0x9')](),controller['destroy']);module[_0x2728('0x16')]=router;
\ No newline at end of file
index c591cac..8bfb896 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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 8e4e432..f433fac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7738=['update','then','end','sendStatus','error','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','secrets','Sequelize','ValidationError','extname','destroy','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeRegion','language','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','json','apply','reject','save'];(function(_0x40403a,_0x2a41aa){var _0x43c449=function(_0x5b95cc){while(--_0x5b95cc){_0x40403a['push'](_0x40403a['shift']());}};_0x43c449(++_0x2a41aa);}(_0x7738,0x1a7));var _0x8773=function(_0xb25c71,_0x184611){_0xb25c71=_0xb25c71-0x0;var _0x4ad3a4=_0x7738[_0xb25c71];return _0x4ad3a4;};'use strict';var emlformat=require(_0x8773('0x0'));var rimraf=require(_0x8773('0x1'));var zipdir=require(_0x8773('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8773('0x3'));var moment=require('moment');var BPromise=require(_0x8773('0x4'));var Mustache=require(_0x8773('0x5'));var util=require(_0x8773('0x6'));var path=require(_0x8773('0x7'));var sox=require(_0x8773('0x8'));var csv=require(_0x8773('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8773('0xa'));var deskjs=require(_0x8773('0xb'));var toCsv=require(_0x8773('0x9'));var querystring=require('querystring');var Papa=require(_0x8773('0xc'));var AWS=require(_0x8773('0xd'));var uuidv4=require(_0x8773('0xe'));var Redis=require(_0x8773('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8773('0x10'));var as=require(_0x8773('0x11'));var hardwareService=require(_0x8773('0x12'));var logger=require(_0x8773('0x13'))(_0x8773('0x14'));var utils=require(_0x8773('0x15'));var config=require(_0x8773('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8773('0x17'))['db'];function respondWithStatusCode(_0x18879d,_0x33259e){_0x33259e=_0x33259e||0xcc;return function(_0x55dcdb){if(_0x55dcdb){return _0x18879d['sendStatus'](_0x33259e);}return _0x18879d[_0x8773('0x18')](_0x33259e)['end']();};}function respondWithResult(_0x29ef22,_0x535885){_0x535885=_0x535885||0xc8;return function(_0x289744){if(_0x289744){return _0x29ef22[_0x8773('0x18')](_0x535885)['json'](_0x289744);}};}function respondWithFilteredResult(_0x147e68,_0x540186){return function(_0x326f3d){if(_0x326f3d){var _0x145454=typeof _0x540186[_0x8773('0x19')]===_0x8773('0x1a')&&typeof _0x540186[_0x8773('0x1b')]===_0x8773('0x1a');var _0x5985a2=_0x326f3d[_0x8773('0x1c')];var _0x46e8fd=_0x145454?0x0:_0x540186[_0x8773('0x19')];var _0x1736cb=_0x145454?_0x326f3d[_0x8773('0x1c')]:_0x540186['offset']+_0x540186[_0x8773('0x1b')];var _0x505059;if(_0x1736cb>=_0x5985a2){_0x1736cb=_0x5985a2;_0x505059=0xc8;}else{_0x505059=0xce;}_0x147e68[_0x8773('0x18')](_0x505059);return _0x147e68['set']('Content-Range',_0x46e8fd+'-'+_0x1736cb+'/'+_0x5985a2)[_0x8773('0x1d')](_0x326f3d);}return null;};}function patchUpdates(_0x230595){return function(_0x3ea659){try{jsonpatch[_0x8773('0x1e')](_0x3ea659,_0x230595,!![]);}catch(_0x13a18c){return BPromise[_0x8773('0x1f')](_0x13a18c);}return _0x3ea659[_0x8773('0x20')]();};}function saveUpdates(_0x59b014,_0x546059){return function(_0x4b9260){if(_0x4b9260){return _0x4b9260[_0x8773('0x21')](_0x59b014)[_0x8773('0x22')](function(_0x392dcc){return _0x392dcc;});}return null;};}function removeEntity(_0x54e2c6,_0x4c11ec){return function(_0x4f2544){if(_0x4f2544){return _0x4f2544['destroy']()[_0x8773('0x22')](function(){_0x54e2c6[_0x8773('0x18')](0xcc)[_0x8773('0x23')]();});}};}function handleEntityNotFound(_0x14827e,_0xeea636){return function(_0x3916a0){if(!_0x3916a0){_0x14827e[_0x8773('0x24')](0x194);}return _0x3916a0;};}function handleError(_0x1e0208,_0x1b6000){_0x1b6000=_0x1b6000||0x1f4;return function(_0x50e755){logger[_0x8773('0x25')](_0x50e755['stack']);if(_0x50e755['name']){delete _0x50e755[_0x8773('0x26')];}_0x1e0208['status'](_0x1b6000)['send'](_0x50e755);};}exports[_0x8773('0x27')]=function(_0x5146f6,_0x1e2423){var _0x5b2912={},_0x38e4b7={},_0xbfe63b={'count':0x0,'rows':[]};var _0x1cff40=_[_0x8773('0x28')](db[_0x8773('0x29')][_0x8773('0x2a')],function(_0x26dce7){return{'name':_0x26dce7[_0x8773('0x2b')],'type':_0x26dce7[_0x8773('0x2c')][_0x8773('0x2d')]};});_0x38e4b7['model']=_[_0x8773('0x2e')](_['map'](_0x1cff40,_0x8773('0x26')),['format']);_0x38e4b7[_0x8773('0x2f')]=_[_0x8773('0x30')](_0x5146f6['query']);_0x38e4b7['filters']=_[_0x8773('0x31')](_0x38e4b7[_0x8773('0x32')],_0x38e4b7[_0x8773('0x2f')]);_0x5b2912[_0x8773('0x33')]=_[_0x8773('0x31')](_0x38e4b7[_0x8773('0x32')],qs[_0x8773('0x34')](_0x5146f6[_0x8773('0x2f')][_0x8773('0x34')]));_0x5b2912[_0x8773('0x33')]=_0x5b2912[_0x8773('0x33')][_0x8773('0x35')]?_0x5b2912[_0x8773('0x33')]:_0x38e4b7[_0x8773('0x32')];if(!_0x5146f6[_0x8773('0x2f')][_0x8773('0x36')]('nolimit')){_0x5b2912[_0x8773('0x1b')]=qs['limit'](_0x5146f6[_0x8773('0x2f')][_0x8773('0x1b')]);_0x5b2912[_0x8773('0x19')]=qs[_0x8773('0x19')](_0x5146f6[_0x8773('0x2f')]['offset']);}_0x5b2912[_0x8773('0x37')]=qs[_0x8773('0x38')](_0x5146f6[_0x8773('0x2f')][_0x8773('0x38')]);_0x5b2912[_0x8773('0x39')]=qs[_0x8773('0x3a')](_[_0x8773('0x3b')](_0x5146f6[_0x8773('0x2f')],_0x38e4b7[_0x8773('0x3a')]),_0x1cff40);if(_0x5146f6[_0x8773('0x2f')]['filter']){_0x5b2912[_0x8773('0x39')]=_['merge'](_0x5b2912[_0x8773('0x39')],{'$or':_[_0x8773('0x28')](_0x1cff40,function(_0x47a650){if(_0x47a650[_0x8773('0x2c')]!==_0x8773('0x3c')){var _0x4dfca6={};_0x4dfca6[_0x47a650[_0x8773('0x26')]]={'$like':'%'+_0x5146f6[_0x8773('0x2f')]['filter']+'%'};return _0x4dfca6;}})});}_0x5b2912=_[_0x8773('0x3d')]({},_0x5b2912,_0x5146f6[_0x8773('0x3e')]);var _0x3dc0a4={'where':_0x5b2912['where']};return db[_0x8773('0x29')][_0x8773('0x1c')](_0x3dc0a4)[_0x8773('0x22')](function(_0x285fbe){_0xbfe63b['count']=_0x285fbe;if(_0x5146f6['query'][_0x8773('0x3f')]){_0x5b2912[_0x8773('0x40')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8773('0x41')](_0x5b2912);})['then'](function(_0x1d1c68){_0xbfe63b[_0x8773('0x42')]=_0x1d1c68;return _0xbfe63b;})[_0x8773('0x22')](respondWithFilteredResult(_0x1e2423,_0x5b2912))[_0x8773('0x43')](handleError(_0x1e2423,null));};exports[_0x8773('0x44')]=function(_0x5c6a8a,_0x32f11c){var _0x3a71d6={'raw':![],'where':{'id':_0x5c6a8a[_0x8773('0x45')]['id']}},_0x30143a={};_0x30143a['model']=_[_0x8773('0x30')](db[_0x8773('0x29')][_0x8773('0x2a')]);_0x30143a[_0x8773('0x2f')]=_['keys'](_0x5c6a8a['query']);_0x30143a[_0x8773('0x3a')]=_[_0x8773('0x31')](_0x30143a[_0x8773('0x32')],_0x30143a['query']);_0x3a71d6[_0x8773('0x33')]=_[_0x8773('0x31')](_0x30143a[_0x8773('0x32')],qs['fields'](_0x5c6a8a[_0x8773('0x2f')][_0x8773('0x34')]));_0x3a71d6[_0x8773('0x33')]=_0x3a71d6[_0x8773('0x33')][_0x8773('0x35')]?_0x3a71d6['attributes']:_0x30143a[_0x8773('0x32')];if(_0x5c6a8a[_0x8773('0x2f')]['includeAll']){_0x3a71d6['include']=[{'all':!![]}];}_0x3a71d6=_['merge']({},_0x3a71d6,_0x5c6a8a[_0x8773('0x3e')]);return db[_0x8773('0x29')][_0x8773('0x46')](_0x3a71d6)[_0x8773('0x22')](handleEntityNotFound(_0x32f11c,null))[_0x8773('0x22')](respondWithResult(_0x32f11c,null))[_0x8773('0x43')](handleError(_0x32f11c,null));};exports[_0x8773('0x47')]=function(_0x1b7d82,_0x420edb){return db[_0x8773('0x29')][_0x8773('0x47')](_0x1b7d82[_0x8773('0x48')],{})[_0x8773('0x22')](respondWithResult(_0x420edb,0xc9))[_0x8773('0x43')](handleError(_0x420edb,null));};exports[_0x8773('0x21')]=function(_0x56bc88,_0x4d529a){if(_0x56bc88[_0x8773('0x48')]['id']){delete _0x56bc88[_0x8773('0x48')]['id'];}return db[_0x8773('0x29')][_0x8773('0x46')]({'where':{'id':_0x56bc88['params']['id']}})[_0x8773('0x22')](handleEntityNotFound(_0x4d529a,null))['then'](saveUpdates(_0x56bc88[_0x8773('0x48')],null))[_0x8773('0x22')](respondWithResult(_0x4d529a,null))[_0x8773('0x43')](handleError(_0x4d529a,null));};exports[_0x8773('0x49')]=function(_0x11a4f2,_0x278d1b){return db[_0x8773('0x29')][_0x8773('0x49')]()[_0x8773('0x22')](respondWithResult(_0x278d1b,null))[_0x8773('0x43')](handleError(_0x278d1b,null));};exports[_0x8773('0x4a')]=function(_0x37d45f,_0x701506,_0x4eaa20){var _0x569c5a=require(_0x8773('0x4b'));var _0x294846=![];var _0x56208e={};if(_0x37d45f['query'][_0x8773('0x2c')]&&_0x37d45f['query'][_0x8773('0x2c')]===_0x8773('0x4c')){_0x56208e[_0x8773('0x4c')]=_0x37d45f[_0x8773('0x45')]['id'];}else{_0x56208e['id']=_0x37d45f['params']['id'];}return db[_0x8773('0x29')]['find']({'where':_0x56208e,'attributes':['id','value'],'raw':!![]})[_0x8773('0x22')](handleEntityNotFound(_0x701506,null))[_0x8773('0x22')](function(_0x324eb4){if(_0x324eb4){var _0x72bf2d=_0x324eb4[_0x8773('0x4d')];var _0x36d8b5=util[_0x8773('0x4e')](_0x8773('0x4f'),_0x72bf2d);if(fs[_0x8773('0x50')](_0x36d8b5)){_0x294846=!![];return _0x569c5a[_0x8773('0x51')](_0x36d8b5,_0x72bf2d,config['secrets'][_0x8773('0x52')])[_0x8773('0x22')](function(){return _0x324eb4;});}return _0x324eb4;}})[_0x8773('0x22')](function(_0x1a24e5){if(_0x1a24e5){var _0x4d5add=_0x1a24e5['value'];if(!fs[_0x8773('0x50')](_0x4d5add)){throw new db['Sequelize']['ValidationError'](_0x8773('0x53'));}if(_0x1a24e5[_0x8773('0x54')]){return _0x701506['download'](_0x4d5add,_0x1a24e5[_0x8773('0x54')]+path['extname'](_0x4d5add),function(){if(_0x294846){fs[_0x8773('0x55')](_0x4d5add);}});}else{return _0x701506[_0x8773('0x4a')](_0x4d5add,function(_0x4ec0a3){if(_0x294846){fs[_0x8773('0x55')](_0x4d5add);}});}}})[_0x8773('0x43')](function(_0x2f7581){if(_0x2f7581[_0x8773('0x56')]===_0x8773('0x53')){_0x701506[_0x8773('0x18')](0x194)[_0x8773('0x57')](_0x8773('0x58'));}else{return handleError(_0x701506,null);}});};exports[_0x8773('0x59')]=function(_0x24c0b0,_0x410281,_0xe8367c){var _0x38509c=require(_0x8773('0x4b'));var _0xa4fc81=![];var _0x19add5={'$and':[db[_0x8773('0x5a')]['where'](db[_0x8773('0x5a')]['fn'](_0x8773('0x5b'),db[_0x8773('0x5a')][_0x8773('0x5c')](_0x8773('0x4c'))),_0x24c0b0[_0x8773('0x2f')][_0x8773('0x5d')])]};if(_0x24c0b0[_0x8773('0x2f')]['type']&&_0x24c0b0['query'][_0x8773('0x2c')]===_0x8773('0x4c')){_0x19add5['$and'][_0x8773('0x5e')]({'uniqueid':_0x24c0b0[_0x8773('0x45')]['id']});}else{_0x19add5[_0x8773('0x5f')][_0x8773('0x5e')]({'id':_0x24c0b0['params']['id']});}return db['VoiceRecording']['find']({'where':_0x19add5,'attributes':['id',_0x8773('0x4d')],'raw':!![]})[_0x8773('0x22')](handleEntityNotFound(_0x410281,null))['then'](function(_0x46145c){if(_0x46145c){var _0x20fb19=util['format'](_0x8773('0x4f'),_0x46145c['value']);if(fs[_0x8773('0x50')](_0x20fb19)){_0xa4fc81=!![];return _0x38509c[_0x8773('0x51')](_0x20fb19,_0x46145c[_0x8773('0x4d')],config[_0x8773('0x60')][_0x8773('0x52')])[_0x8773('0x22')](function(){return _0x46145c;});}return _0x46145c;}})['then'](function(_0x37ccb2){if(_0x37ccb2){if(!fs[_0x8773('0x50')](_0x37ccb2[_0x8773('0x4d')])){throw new db[(_0x8773('0x61'))][(_0x8773('0x62'))](_0x8773('0x53'));}if(_0x37ccb2[_0x8773('0x54')]){return _0x410281[_0x8773('0x4a')](_0x37ccb2[_0x8773('0x4d')],_0x37ccb2['filename']+path[_0x8773('0x63')](_0x37ccb2['value']),function(){if(_0xa4fc81){fs[_0x8773('0x55')](_0x37ccb2['value']);}});}else{return _0x410281['download'](_0x37ccb2['value'],function(_0x255339){if(_0xa4fc81){fs[_0x8773('0x55')](_0x37ccb2[_0x8773('0x4d')]);}});}}})['catch'](handleError(_0x410281,null));};exports[_0x8773('0x64')]=function(_0x3775bc,_0x52578e){return db[_0x8773('0x29')]['find']({'where':{'id':_0x3775bc[_0x8773('0x45')]['id']}})['then'](function(_0x24ed71){if(_[_0x8773('0x65')](_0x24ed71)){throw new ReferenceError('Entity\x20not\x20found');}return _0x24ed71;})[_0x8773('0x22')](function(_0x99940a){var _0x38cb34=_0x99940a[_0x8773('0x4d')];logger[_0x8773('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x38cb34);if(!_['isNil'](_0x99940a[_0x8773('0x4d')])&&fs['existsSync'](_0x38cb34)){logger[_0x8773('0x66')](_0x8773('0x67')+_0x38cb34+_0x8773('0x68'));fs[_0x8773('0x69')](_0x38cb34);}_0x38cb34=_0x38cb34+_0x8773('0x6a');if(!_[_0x8773('0x65')](_0x99940a[_0x8773('0x4d')])&&fs[_0x8773('0x50')](_0x38cb34)){logger['info']('File:\x20\x22'+_0x38cb34+_0x8773('0x68'));fs['unlinkSync'](_0x38cb34);}return _0x99940a;})[_0x8773('0x22')](function(_0x45247f){if(!_0x45247f)throw new InternalError();return _0x45247f[_0x8773('0x64')]();})[_0x8773('0x22')](function(){_0x52578e['status'](0xcc)['end']();})[_0x8773('0x43')](handleError(_0x52578e,null));};function getBucketslist(_0x23aada,_0x31beb2,_0x36490f){return new Promise(function(_0x322c27,_0x34b65c){var _0x542997=new AWS['S3']({'accessKeyId':_0x31beb2,'secretAccessKey':_0x23aada,'region':_0x36490f});_0x542997[_0x8773('0x6b')]({},function(_0x158256,_0x5b9456){if(_0x158256){return _0x34b65c(_0x158256);}else{return _0x322c27(_0x5b9456);}});});}function createBucket(_0x3f63f0,_0x1d7766,_0x43b734,_0x59230c){return new Promise(function(_0x33e80e,_0x5effc2){var _0x29cce3=new AWS['S3']({'accessKeyId':_0x1d7766,'secretAccessKey':_0x3f63f0,'region':_0x43b734});_0x29cce3['createBucket']({'Bucket':_0x59230c},function(_0x13465f,_0x53af37){if(_0x13465f){return _0x5effc2(_0x13465f);}else{return _0x33e80e(_0x53af37);}});});}function uploadFile(_0x7f467b,_0x13e19e,_0x39ea61,_0x2cf1f2,_0x543c2e,_0x48afc0){return new Promise(function(_0x4c5003,_0x59f05b){var _0x464361=new AWS['S3']({'accessKeyId':_0x13e19e,'secretAccessKey':_0x7f467b,'region':_0x39ea61});_0x464361['upload']({'Bucket':_0x2cf1f2,'Key':_0x543c2e,'Body':_0x48afc0},function(_0x254c28,_0x50789a){if(_0x254c28){return _0x59f05b(_0x254c28);}else{return _0x4c5003(_0x50789a);}});});}function startTranscribe(_0x575a5e,_0x37d7cf,_0xbacd61,_0xbccce3,_0x17fbdf,_0x3db273){return new Promise(function(_0x5eed07,_0x87383c){var _0x1d22f9=new AWS[(_0x8773('0x6c'))]({'accessKeyId':_0x37d7cf,'secretAccessKey':_0x575a5e,'region':_0xbacd61});_0x1d22f9['startTranscriptionJob']({'TranscriptionJobName':_0xbccce3,'LanguageCode':_0x17fbdf,'Media':{'MediaFileUri':_0x3db273}},function(_0x4d9e78,_0x3486ac){if(_0x4d9e78){return _0x87383c(_0x4d9e78);}else{return _0x5eed07(_0x3486ac);}});});}function transcribe(_0x48bf18,_0x1d272e,_0x5a1857,_0xdec54,_0x372c7e,_0x36730b,_0x5dc35d){return new Promise(function(_0x38f2cf,_0xd7adf5){var _0x51ae4d={};logger[_0x8773('0x66')](util['format'](_0x8773('0x6d'),_0x48bf18,_0x372c7e));return uploadFile(_0x1d272e,_0x5a1857,_0xdec54,_0x372c7e,path['basename'](_0x36730b),fs[_0x8773('0x6e')](_0x36730b))[_0x8773('0x22')](function(_0x54249c){logger[_0x8773('0x66')](util[_0x8773('0x4e')](_0x8773('0x6f'),_0x48bf18,_0x372c7e,_0x54249c['Location']));_0x51ae4d[_0x8773('0x70')]=_0x54249c[_0x8773('0x71')];_0x51ae4d['location']=_0x54249c[_0x8773('0x72')];logger[_0x8773('0x66')](util[_0x8773('0x4e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x48bf18));return startTranscribe(_0x1d272e,_0x5a1857,_0xdec54,uuidv4(),_0x5dc35d,_0x54249c[_0x8773('0x72')]);})['then'](function(_0xb823bf){logger['info'](util[_0x8773('0x4e')](_0x8773('0x73'),_0x48bf18,_0xb823bf[_0x8773('0x74')]['TranscriptionJobName']));_0x51ae4d[_0x8773('0x75')]=_0xb823bf['TranscriptionJob']['TranscriptionJobName'];_0x51ae4d[_0x8773('0x76')]=_0xb823bf[_0x8773('0x74')][_0x8773('0x77')];return _0x38f2cf(_0x51ae4d);})[_0x8773('0x43')](function(_0x2e621c){return _0xd7adf5(_0x2e621c);});});}exports[_0x8773('0x78')]=function(_0x4e0dfa,_0x45d8f7,_0x308af4){var _0x4f1052;var _0xb2bf5d;var _0x398656;var _0x517879=require(_0x8773('0x4b'));return db[_0x8773('0x29')]['findOne']({'where':{'id':_0x4e0dfa[_0x8773('0x45')]['id']}})[_0x8773('0x22')](function(_0x5dc674){if(_0x5dc674){var _0x51f357=util[_0x8773('0x4e')](_0x8773('0x4f'),_0x5dc674[_0x8773('0x4d')]);if(fs[_0x8773('0x50')](_0x51f357)){cypher=!![];return _0x517879[_0x8773('0x51')](_0x51f357,_0x5dc674[_0x8773('0x4d')],config['secrets'][_0x8773('0x52')])[_0x8773('0x22')](function(){return _0x5dc674;});}return _0x5dc674;}})[_0x8773('0x22')](function(_0x541c44){if(!_0x541c44){throw new db[(_0x8773('0x61'))]['ValidationError'](_0x8773('0x79'));}_0xb2bf5d=_0x541c44;return db[_0x8773('0x7a')][_0x8773('0x7b')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x45d8f7,null))['then'](function(_0x75ec04){if(_0x75ec04){_0x4f1052=_0x75ec04;if(!_0x4f1052['transcribe']||!_0x4f1052['transcribeAccountId']||!_0x4f1052[_0x8773('0x7c')]||!_0x4f1052[_0x8773('0x7d')]||!_0x4f1052[_0x8773('0x70')]){throw new db[(_0x8773('0x61'))][(_0x8773('0x62'))]('Transcribe\x20not\x20configured');}if(_0x4e0dfa[_0x8773('0x48')]['runSentiment']&&(!_0x4f1052[_0x8773('0x7e')]||!_0x4f1052['sentimentAccountId']||!_0x4f1052[_0x8773('0x7f')]||!_0x4f1052[_0x8773('0x7d')]||!_0x4f1052[_0x8773('0x70')])){throw new db[(_0x8773('0x61'))]['ValidationError'](_0x8773('0x80'));}return db[_0x8773('0x81')][_0x8773('0x7b')]({'where':{'id':_0x4f1052[_0x8773('0x82')]}});}})[_0x8773('0x22')](function(_0x6b1663){if(!_0x6b1663){throw new db[(_0x8773('0x61'))][(_0x8773('0x62'))](_0x8773('0x83'));}if(!_0x6b1663[_0x8773('0x84')]||!_0x6b1663[_0x8773('0x85')]){throw new db['Sequelize'][(_0x8773('0x62'))](_0x8773('0x86'));}_0x398656=_0x6b1663;return getBucketslist(_0x398656[_0x8773('0x84')],_0x398656[_0x8773('0x85')],_0x4f1052['transcribeRegion']);})[_0x8773('0x22')](function(_0x1d811d){if(_0x1d811d&&_0x1d811d[_0x8773('0x87')]){var _0xf9875=_[_0x8773('0x46')](_0x1d811d['Buckets'],function(_0x10a841){return _0x10a841[_0x8773('0x88')]===_0x4f1052['bucket'];});if(!_0xf9875){logger[_0x8773('0x66')](util[_0x8773('0x4e')](_0x8773('0x89'),_0x4e0dfa[_0x8773('0x45')]['id'],_0x4f1052[_0x8773('0x70')]));return createBucket(_0x398656[_0x8773('0x84')],_0x398656['data2'],_0x4f1052[_0x8773('0x7c')],_0x4f1052[_0x8773('0x70')]);}logger[_0x8773('0x66')](util[_0x8773('0x4e')](_0x8773('0x8a'),_0x4e0dfa[_0x8773('0x45')]['id'],_0x4f1052['bucket']));return;}})['then'](function(_0x5a6b89){if(_0xb2bf5d['transcribeStatus']===_0x8773('0x8b')){return transcribe(_0x4e0dfa[_0x8773('0x45')]['id'],_0x398656[_0x8773('0x84')],_0x398656[_0x8773('0x85')],_0x4f1052[_0x8773('0x7c')],_0x4f1052[_0x8773('0x70')],_0xb2bf5d[_0x8773('0x4d')],_0x4f1052[_0x8773('0x7d')]);}else{logger[_0x8773('0x66')](util[_0x8773('0x4e')](_0x8773('0x8c'),_0x4e0dfa[_0x8773('0x45')]['id']));return{'transcribeStatus':_0x8773('0x8d')};}})[_0x8773('0x22')](function(_0x19b81b){if(_0x19b81b){_0x19b81b[_0x8773('0x8e')]=_0x4e0dfa[_0x8773('0x48')][_0x8773('0x8f')];return _0xb2bf5d[_0x8773('0x90')](_0x19b81b);}})[_0x8773('0x22')](respondWithResult(_0x45d8f7,null))['catch'](handleError(_0x45d8f7,null));};function writeFile(_0x574156,_0x1dc4ea){return new Promise(function(_0x14e80c,_0x1277da){fs[_0x8773('0x91')](_0x1dc4ea,_0x574156,function(_0x268305,_0x3a2902){if(_0x268305){return _0x1277da(_0x268305);}else{return _0x14e80c(_0x3a2902);}});});}exports[_0x8773('0x92')]=function(_0x4f8563,_0x2f0f20,_0x4cc768){return db[_0x8773('0x29')][_0x8773('0x7b')]({'where':{'id':_0x4f8563['params']['id']}})[_0x8773('0x22')](handleEntityNotFound(_0x2f0f20))[_0x8773('0x22')](function(_0x3b9f31){if(_0x3b9f31&&_0x3b9f31[_0x8773('0x93')]){var _0x5919c5=_0x3b9f31[_0x8773('0x93')];var _0x3f162c=config[_0x8773('0x94')]+_0x8773('0x95')+_0x3b9f31['id']+_0x8773('0x96');if(fs[_0x8773('0x50')](_0x3f162c)){return _0x3f162c;}return writeFile(_0x5919c5,_0x3f162c)[_0x8773('0x22')](function(){return _0x3f162c;});}else{throw new db[(_0x8773('0x61'))][(_0x8773('0x62'))](_0x8773('0x97'));}})[_0x8773('0x22')](function(_0x1f3961){return _0x2f0f20['download'](_0x1f3961);})[_0x8773('0x43')](handleError(_0x2f0f20));};
\ No newline at end of file
+var _0x5560=['cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','findOne','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','update','then','end','stack','name','map','VoiceRecording','rawAttributes','key','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','body','describe','download','../../components/encryptor','uniqueid','find','value','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','downloads','sequelize','MD5','col','token','$and','push','secrets','destroy','isNil','Entity\x20not\x20found','info'];(function(_0x3518ea,_0x4abc){var _0x257790=function(_0x3b7e02){while(--_0x3b7e02){_0x3518ea['push'](_0x3518ea['shift']());}};_0x257790(++_0x4abc);}(_0x5560,0xc7));var _0x0556=function(_0x1624bd,_0x1c935b){_0x1624bd=_0x1624bd-0x0;var _0x12b9cc=_0x5560[_0x1624bd];return _0x12b9cc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0556('0x0'));var rp=require(_0x0556('0x1'));var moment=require(_0x0556('0x2'));var BPromise=require(_0x0556('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0556('0x4'));var sox=require(_0x0556('0x5'));var csv=require(_0x0556('0x6'));var ejs=require(_0x0556('0x7'));var fs=require('fs');var fs_extra=require(_0x0556('0x8'));var _=require('lodash');var squel=require(_0x0556('0x9'));var crypto=require(_0x0556('0xa'));var jsforce=require(_0x0556('0xb'));var deskjs=require(_0x0556('0xc'));var toCsv=require(_0x0556('0x6'));var querystring=require(_0x0556('0xd'));var Papa=require(_0x0556('0xe'));var AWS=require(_0x0556('0xf'));var uuidv4=require(_0x0556('0x10'));var Redis=require(_0x0556('0x11'));var authService=require(_0x0556('0x12'));var qs=require(_0x0556('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0556('0x14'));var logger=require(_0x0556('0x15'))(_0x0556('0x16'));var utils=require(_0x0556('0x17'));var config=require(_0x0556('0x18'));var licenseUtil=require(_0x0556('0x19'));var db=require(_0x0556('0x1a'))['db'];function respondWithStatusCode(_0x366770,_0xd52631){_0xd52631=_0xd52631||0xcc;return function(_0x49dfa2){if(_0x49dfa2){return _0x366770[_0x0556('0x1b')](_0xd52631);}return _0x366770['status'](_0xd52631)['end']();};}function respondWithResult(_0x584f84,_0x5e63a5){_0x5e63a5=_0x5e63a5||0xc8;return function(_0x56b046){if(_0x56b046){return _0x584f84['status'](_0x5e63a5)['json'](_0x56b046);}};}function respondWithFilteredResult(_0x2a1a82,_0x5d1e2f){return function(_0x292949){if(_0x292949){var _0x3fdff2=typeof _0x5d1e2f[_0x0556('0x1c')]===_0x0556('0x1d')&&typeof _0x5d1e2f[_0x0556('0x1e')]==='undefined';var _0x37bcc9=_0x292949[_0x0556('0x1f')];var _0x50f873=_0x3fdff2?0x0:_0x5d1e2f[_0x0556('0x1c')];var _0x51b7cc=_0x3fdff2?_0x292949[_0x0556('0x1f')]:_0x5d1e2f[_0x0556('0x1c')]+_0x5d1e2f[_0x0556('0x1e')];var _0x16b195;if(_0x51b7cc>=_0x37bcc9){_0x51b7cc=_0x37bcc9;_0x16b195=0xc8;}else{_0x16b195=0xce;}_0x2a1a82[_0x0556('0x20')](_0x16b195);return _0x2a1a82[_0x0556('0x21')](_0x0556('0x22'),_0x50f873+'-'+_0x51b7cc+'/'+_0x37bcc9)[_0x0556('0x23')](_0x292949);}return null;};}function patchUpdates(_0x377e20){return function(_0x33c032){try{jsonpatch[_0x0556('0x24')](_0x33c032,_0x377e20,!![]);}catch(_0x5b123d){return BPromise[_0x0556('0x25')](_0x5b123d);}return _0x33c032['save']();};}function saveUpdates(_0x2d7a9f,_0xd4766d){return function(_0x125d16){if(_0x125d16){return _0x125d16[_0x0556('0x26')](_0x2d7a9f)[_0x0556('0x27')](function(_0x4a206f){return _0x4a206f;});}return null;};}function removeEntity(_0xcbe1c,_0x2a6888){return function(_0x16cadc){if(_0x16cadc){return _0x16cadc['destroy']()[_0x0556('0x27')](function(){_0xcbe1c['status'](0xcc)[_0x0556('0x28')]();});}};}function handleEntityNotFound(_0x53b5b6,_0x21179f){return function(_0x582675){if(!_0x582675){_0x53b5b6[_0x0556('0x1b')](0x194);}return _0x582675;};}function handleError(_0x3f1d90,_0x5558fe){_0x5558fe=_0x5558fe||0x1f4;return function(_0x23529d){logger['error'](_0x23529d[_0x0556('0x29')]);if(_0x23529d['name']){delete _0x23529d[_0x0556('0x2a')];}_0x3f1d90[_0x0556('0x20')](_0x5558fe)['send'](_0x23529d);};}exports['index']=function(_0x1eeb8d,_0x51c5ae){var _0x27bbdc={},_0x59828d={},_0x2d3ff9={'count':0x0,'rows':[]};var _0x3b9c58=_[_0x0556('0x2b')](db[_0x0556('0x2c')][_0x0556('0x2d')],function(_0x3f2045){return{'name':_0x3f2045['fieldName'],'type':_0x3f2045['type'][_0x0556('0x2e')]};});_0x59828d[_0x0556('0x2f')]=_[_0x0556('0x30')](_['map'](_0x3b9c58,_0x0556('0x2a')),[_0x0556('0x31')]);_0x59828d[_0x0556('0x32')]=_['keys'](_0x1eeb8d[_0x0556('0x32')]);_0x59828d[_0x0556('0x33')]=_[_0x0556('0x34')](_0x59828d[_0x0556('0x2f')],_0x59828d[_0x0556('0x32')]);_0x27bbdc[_0x0556('0x35')]=_['intersection'](_0x59828d['model'],qs[_0x0556('0x36')](_0x1eeb8d[_0x0556('0x32')][_0x0556('0x36')]));_0x27bbdc[_0x0556('0x35')]=_0x27bbdc[_0x0556('0x35')][_0x0556('0x37')]?_0x27bbdc[_0x0556('0x35')]:_0x59828d[_0x0556('0x2f')];if(!_0x1eeb8d[_0x0556('0x32')][_0x0556('0x38')](_0x0556('0x39'))){_0x27bbdc[_0x0556('0x1e')]=qs[_0x0556('0x1e')](_0x1eeb8d['query'][_0x0556('0x1e')]);_0x27bbdc[_0x0556('0x1c')]=qs[_0x0556('0x1c')](_0x1eeb8d[_0x0556('0x32')]['offset']);}_0x27bbdc[_0x0556('0x3a')]=qs[_0x0556('0x3b')](_0x1eeb8d[_0x0556('0x32')][_0x0556('0x3b')]);_0x27bbdc[_0x0556('0x3c')]=qs[_0x0556('0x33')](_['pick'](_0x1eeb8d[_0x0556('0x32')],_0x59828d[_0x0556('0x33')]),_0x3b9c58);if(_0x1eeb8d['query']['filter']){_0x27bbdc[_0x0556('0x3c')]=_['merge'](_0x27bbdc[_0x0556('0x3c')],{'$or':_[_0x0556('0x2b')](_0x3b9c58,function(_0x852599){if(_0x852599[_0x0556('0x3d')]!==_0x0556('0x3e')){var _0x361dca={};_0x361dca[_0x852599['name']]={'$like':'%'+_0x1eeb8d[_0x0556('0x32')]['filter']+'%'};return _0x361dca;}})});}_0x27bbdc=_[_0x0556('0x3f')]({},_0x27bbdc,_0x1eeb8d[_0x0556('0x40')]);var _0x413fc2={'where':_0x27bbdc[_0x0556('0x3c')]};return db[_0x0556('0x2c')][_0x0556('0x1f')](_0x413fc2)[_0x0556('0x27')](function(_0x209712){_0x2d3ff9['count']=_0x209712;if(_0x1eeb8d[_0x0556('0x32')][_0x0556('0x41')]){_0x27bbdc['include']=[{'all':!![]}];}return db[_0x0556('0x2c')][_0x0556('0x42')](_0x27bbdc);})[_0x0556('0x27')](function(_0x2deaa7){_0x2d3ff9[_0x0556('0x43')]=_0x2deaa7;return _0x2d3ff9;})[_0x0556('0x27')](respondWithFilteredResult(_0x51c5ae,_0x27bbdc))[_0x0556('0x44')](handleError(_0x51c5ae,null));};exports[_0x0556('0x45')]=function(_0x4ec813,_0xf0489){var _0x1bb025={'raw':![],'where':{'id':_0x4ec813[_0x0556('0x46')]['id']}},_0x11d0db={};_0x11d0db[_0x0556('0x2f')]=_[_0x0556('0x47')](db[_0x0556('0x2c')][_0x0556('0x2d')]);_0x11d0db[_0x0556('0x32')]=_[_0x0556('0x47')](_0x4ec813['query']);_0x11d0db[_0x0556('0x33')]=_['intersection'](_0x11d0db[_0x0556('0x2f')],_0x11d0db['query']);_0x1bb025[_0x0556('0x35')]=_[_0x0556('0x34')](_0x11d0db[_0x0556('0x2f')],qs[_0x0556('0x36')](_0x4ec813[_0x0556('0x32')][_0x0556('0x36')]));_0x1bb025[_0x0556('0x35')]=_0x1bb025[_0x0556('0x35')][_0x0556('0x37')]?_0x1bb025[_0x0556('0x35')]:_0x11d0db['model'];if(_0x4ec813[_0x0556('0x32')][_0x0556('0x41')]){_0x1bb025[_0x0556('0x48')]=[{'all':!![]}];}_0x1bb025=_['merge']({},_0x1bb025,_0x4ec813[_0x0556('0x40')]);return db[_0x0556('0x2c')]['find'](_0x1bb025)[_0x0556('0x27')](handleEntityNotFound(_0xf0489,null))['then'](respondWithResult(_0xf0489,null))[_0x0556('0x44')](handleError(_0xf0489,null));};exports['create']=function(_0x48af09,_0x4cc88e){return db['VoiceRecording']['create'](_0x48af09[_0x0556('0x49')],{})[_0x0556('0x27')](respondWithResult(_0x4cc88e,0xc9))['catch'](handleError(_0x4cc88e,null));};exports[_0x0556('0x26')]=function(_0x4e32f3,_0x4b547e){if(_0x4e32f3[_0x0556('0x49')]['id']){delete _0x4e32f3[_0x0556('0x49')]['id'];}return db[_0x0556('0x2c')]['find']({'where':{'id':_0x4e32f3[_0x0556('0x46')]['id']}})[_0x0556('0x27')](handleEntityNotFound(_0x4b547e,null))[_0x0556('0x27')](saveUpdates(_0x4e32f3[_0x0556('0x49')],null))[_0x0556('0x27')](respondWithResult(_0x4b547e,null))[_0x0556('0x44')](handleError(_0x4b547e,null));};exports[_0x0556('0x4a')]=function(_0x396e16,_0x567600){return db[_0x0556('0x2c')][_0x0556('0x4a')]()[_0x0556('0x27')](respondWithResult(_0x567600,null))[_0x0556('0x44')](handleError(_0x567600,null));};exports[_0x0556('0x4b')]=function(_0x53e538,_0x1cf229,_0x1263ed){var _0x129577=require(_0x0556('0x4c'));var _0x137063=![];var _0x41e115={};if(_0x53e538[_0x0556('0x32')][_0x0556('0x3d')]&&_0x53e538['query']['type']===_0x0556('0x4d')){_0x41e115['uniqueid']=_0x53e538[_0x0556('0x46')]['id'];}else{_0x41e115['id']=_0x53e538[_0x0556('0x46')]['id'];}return db[_0x0556('0x2c')][_0x0556('0x4e')]({'where':_0x41e115,'attributes':['id','value'],'raw':!![]})[_0x0556('0x27')](handleEntityNotFound(_0x1cf229,null))['then'](function(_0x59fb56){if(_0x59fb56){var _0x36bbba=_0x59fb56[_0x0556('0x4f')];var _0x47966a=util[_0x0556('0x31')](_0x0556('0x50'),_0x36bbba);if(fs[_0x0556('0x51')](_0x47966a)){_0x137063=!![];return _0x129577[_0x0556('0x52')](_0x47966a,_0x36bbba,config['secrets']['recording'])[_0x0556('0x27')](function(){return _0x59fb56;});}return _0x59fb56;}})['then'](function(_0x29cf6b){if(_0x29cf6b){var _0x59a8fc=_0x29cf6b[_0x0556('0x4f')];if(!fs['existsSync'](_0x59a8fc)){throw new db[(_0x0556('0x53'))][(_0x0556('0x54'))](_0x0556('0x55'));}if(_0x29cf6b[_0x0556('0x56')]){return _0x1cf229[_0x0556('0x4b')](_0x59a8fc,_0x29cf6b[_0x0556('0x56')]+path[_0x0556('0x57')](_0x59a8fc),function(){if(_0x137063){fs[_0x0556('0x58')](_0x59a8fc);}});}else{return _0x1cf229[_0x0556('0x4b')](_0x59a8fc,function(_0x43984e){if(_0x137063){fs[_0x0556('0x58')](_0x59a8fc);}});}}})['catch'](function(_0x7726dd){if(_0x7726dd[_0x0556('0x59')]===_0x0556('0x55')){_0x1cf229[_0x0556('0x20')](0x194)[_0x0556('0x5a')]('Not\x20found');}else{return handleError(_0x1cf229,null);}});};exports[_0x0556('0x5b')]=function(_0x8eb445,_0x30863d,_0x485f70){var _0x4458a0=require(_0x0556('0x4c'));var _0x30befc=![];var _0x6a6e00={'$and':[db[_0x0556('0x5c')][_0x0556('0x3c')](db[_0x0556('0x5c')]['fn'](_0x0556('0x5d'),db[_0x0556('0x5c')][_0x0556('0x5e')](_0x0556('0x4d'))),_0x8eb445[_0x0556('0x32')][_0x0556('0x5f')])]};if(_0x8eb445[_0x0556('0x32')][_0x0556('0x3d')]&&_0x8eb445[_0x0556('0x32')][_0x0556('0x3d')]===_0x0556('0x4d')){_0x6a6e00[_0x0556('0x60')][_0x0556('0x61')]({'uniqueid':_0x8eb445[_0x0556('0x46')]['id']});}else{_0x6a6e00[_0x0556('0x60')][_0x0556('0x61')]({'id':_0x8eb445[_0x0556('0x46')]['id']});}return db[_0x0556('0x2c')][_0x0556('0x4e')]({'where':_0x6a6e00,'attributes':['id',_0x0556('0x4f')],'raw':!![]})[_0x0556('0x27')](handleEntityNotFound(_0x30863d,null))[_0x0556('0x27')](function(_0x34a537){if(_0x34a537){var _0x3a470e=util[_0x0556('0x31')](_0x0556('0x50'),_0x34a537['value']);if(fs[_0x0556('0x51')](_0x3a470e)){_0x30befc=!![];return _0x4458a0['decryptFile'](_0x3a470e,_0x34a537['value'],config[_0x0556('0x62')]['recording'])[_0x0556('0x27')](function(){return _0x34a537;});}return _0x34a537;}})[_0x0556('0x27')](function(_0xaeba0d){if(_0xaeba0d){if(!fs[_0x0556('0x51')](_0xaeba0d[_0x0556('0x4f')])){throw new db[(_0x0556('0x53'))][(_0x0556('0x54'))](_0x0556('0x55'));}if(_0xaeba0d[_0x0556('0x56')]){return _0x30863d['download'](_0xaeba0d[_0x0556('0x4f')],_0xaeba0d[_0x0556('0x56')]+path[_0x0556('0x57')](_0xaeba0d[_0x0556('0x4f')]),function(){if(_0x30befc){fs[_0x0556('0x58')](_0xaeba0d[_0x0556('0x4f')]);}});}else{return _0x30863d[_0x0556('0x4b')](_0xaeba0d[_0x0556('0x4f')],function(_0x464d72){if(_0x30befc){fs[_0x0556('0x58')](_0xaeba0d[_0x0556('0x4f')]);}});}}})[_0x0556('0x44')](handleError(_0x30863d,null));};exports[_0x0556('0x63')]=function(_0x13898b,_0x524fa8){return db[_0x0556('0x2c')][_0x0556('0x4e')]({'where':{'id':_0x13898b['params']['id']}})[_0x0556('0x27')](function(_0x17b18f){if(_[_0x0556('0x64')](_0x17b18f)){throw new ReferenceError(_0x0556('0x65'));}return _0x17b18f;})[_0x0556('0x27')](function(_0x23335b){var _0x1c15e5=_0x23335b[_0x0556('0x4f')];logger[_0x0556('0x66')](_0x0556('0x67'),_0x1c15e5);if(!_[_0x0556('0x64')](_0x23335b[_0x0556('0x4f')])&&fs[_0x0556('0x51')](_0x1c15e5)){logger[_0x0556('0x66')](_0x0556('0x68')+_0x1c15e5+_0x0556('0x69'));fs['unlinkSync'](_0x1c15e5);}_0x1c15e5=_0x1c15e5+_0x0556('0x6a');if(!_['isNil'](_0x23335b[_0x0556('0x4f')])&&fs[_0x0556('0x51')](_0x1c15e5)){logger[_0x0556('0x66')](_0x0556('0x68')+_0x1c15e5+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0556('0x6b')](_0x1c15e5);}return _0x23335b;})[_0x0556('0x27')](function(_0x3ba482){if(!_0x3ba482)throw new InternalError();return _0x3ba482[_0x0556('0x63')]();})['then'](function(){_0x524fa8[_0x0556('0x20')](0xcc)[_0x0556('0x28')]();})[_0x0556('0x44')](handleError(_0x524fa8,null));};function getBucketslist(_0x38e898,_0x5ee49c,_0x3c95db){return new Promise(function(_0x409abc,_0x4d5629){var _0x43c314=new AWS['S3']({'accessKeyId':_0x5ee49c,'secretAccessKey':_0x38e898,'region':_0x3c95db});_0x43c314[_0x0556('0x6c')]({},function(_0x10b3ad,_0x55a4a2){if(_0x10b3ad){return _0x4d5629(_0x10b3ad);}else{return _0x409abc(_0x55a4a2);}});});}function createBucket(_0x4fafbb,_0x3d42b8,_0x19c283,_0x450acc){return new Promise(function(_0x3bdfce,_0x5a40e0){var _0x1059c6=new AWS['S3']({'accessKeyId':_0x3d42b8,'secretAccessKey':_0x4fafbb,'region':_0x19c283});_0x1059c6[_0x0556('0x6d')]({'Bucket':_0x450acc},function(_0x2ce247,_0x44ec77){if(_0x2ce247){return _0x5a40e0(_0x2ce247);}else{return _0x3bdfce(_0x44ec77);}});});}function uploadFile(_0x5bf6d0,_0x4340e2,_0x56aea9,_0x44c83d,_0x34b5ec,_0x3502e8){return new Promise(function(_0x4e7da3,_0x3b1df4){var _0x134cd=new AWS['S3']({'accessKeyId':_0x4340e2,'secretAccessKey':_0x5bf6d0,'region':_0x56aea9});_0x134cd[_0x0556('0x6e')]({'Bucket':_0x44c83d,'Key':_0x34b5ec,'Body':_0x3502e8},function(_0x274ce0,_0x1b89bb){if(_0x274ce0){return _0x3b1df4(_0x274ce0);}else{return _0x4e7da3(_0x1b89bb);}});});}function startTranscribe(_0x617c4f,_0x5db787,_0x24fbdb,_0xa42f2b,_0x9fb600,_0x5791cb){return new Promise(function(_0x533854,_0x14d362){var _0x27e3f2=new AWS[(_0x0556('0x6f'))]({'accessKeyId':_0x5db787,'secretAccessKey':_0x617c4f,'region':_0x24fbdb});_0x27e3f2['startTranscriptionJob']({'TranscriptionJobName':_0xa42f2b,'LanguageCode':_0x9fb600,'Media':{'MediaFileUri':_0x5791cb}},function(_0x4491d9,_0x7c938e){if(_0x4491d9){return _0x14d362(_0x4491d9);}else{return _0x533854(_0x7c938e);}});});}function transcribe(_0x4db3c3,_0x4c9185,_0x40e787,_0x5a17c4,_0x263582,_0x3d9ae7,_0x382247){return new Promise(function(_0x4bb752,_0x36a152){var _0x167c31={};logger[_0x0556('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x4db3c3,_0x263582));return uploadFile(_0x4c9185,_0x40e787,_0x5a17c4,_0x263582,path[_0x0556('0x70')](_0x3d9ae7),fs[_0x0556('0x71')](_0x3d9ae7))[_0x0556('0x27')](function(_0x280a6e){logger[_0x0556('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x4db3c3,_0x263582,_0x280a6e[_0x0556('0x72')]));_0x167c31[_0x0556('0x73')]=_0x280a6e[_0x0556('0x74')];_0x167c31[_0x0556('0x75')]=_0x280a6e[_0x0556('0x72')];logger[_0x0556('0x66')](util['format'](_0x0556('0x76'),_0x4db3c3));return startTranscribe(_0x4c9185,_0x40e787,_0x5a17c4,uuidv4(),_0x382247,_0x280a6e[_0x0556('0x72')]);})[_0x0556('0x27')](function(_0x5d7ef0){logger[_0x0556('0x66')](util[_0x0556('0x31')](_0x0556('0x77'),_0x4db3c3,_0x5d7ef0[_0x0556('0x78')][_0x0556('0x79')]));_0x167c31['transcribeName']=_0x5d7ef0['TranscriptionJob'][_0x0556('0x79')];_0x167c31[_0x0556('0x7a')]=_0x5d7ef0[_0x0556('0x78')][_0x0556('0x7b')];return _0x4bb752(_0x167c31);})[_0x0556('0x44')](function(_0x4c0ebf){return _0x36a152(_0x4c0ebf);});});}exports[_0x0556('0x7c')]=function(_0x2bb10b,_0x4a3bb8,_0x29ceb3){var _0x2b728d;var _0x526c24;var _0xda4b54;var _0x297942=require(_0x0556('0x4c'));return db[_0x0556('0x2c')]['findOne']({'where':{'id':_0x2bb10b[_0x0556('0x46')]['id']}})[_0x0556('0x27')](function(_0x6f7b2b){if(_0x6f7b2b){var _0x4bed41=util['format'](_0x0556('0x50'),_0x6f7b2b['value']);if(fs[_0x0556('0x51')](_0x4bed41)){cypher=!![];return _0x297942[_0x0556('0x52')](_0x4bed41,_0x6f7b2b[_0x0556('0x4f')],config[_0x0556('0x62')]['recording'])[_0x0556('0x27')](function(){return _0x6f7b2b;});}return _0x6f7b2b;}})[_0x0556('0x27')](function(_0x111b5a){if(!_0x111b5a){throw new db[(_0x0556('0x53'))][(_0x0556('0x54'))](_0x0556('0x7d'));}_0x526c24=_0x111b5a;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x0556('0x27')](handleEntityNotFound(_0x4a3bb8,null))[_0x0556('0x27')](function(_0x146d3c){if(_0x146d3c){_0x2b728d=_0x146d3c;if(!_0x2b728d[_0x0556('0x7e')]||!_0x2b728d[_0x0556('0x7f')]||!_0x2b728d[_0x0556('0x80')]||!_0x2b728d[_0x0556('0x81')]||!_0x2b728d[_0x0556('0x73')]){throw new db[(_0x0556('0x53'))][(_0x0556('0x54'))](_0x0556('0x82'));}if(_0x2bb10b['body']['runSentiment']&&(!_0x2b728d['sentiment']||!_0x2b728d[_0x0556('0x83')]||!_0x2b728d[_0x0556('0x84')]||!_0x2b728d['language']||!_0x2b728d[_0x0556('0x73')])){throw new db['Sequelize'][(_0x0556('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x0556('0x85')]({'where':{'id':_0x2b728d[_0x0556('0x7f')]}});}})[_0x0556('0x27')](function(_0x578b3f){if(!_0x578b3f){throw new db[(_0x0556('0x53'))]['ValidationError'](_0x0556('0x86'));}if(!_0x578b3f[_0x0556('0x87')]||!_0x578b3f[_0x0556('0x88')]){throw new db['Sequelize'][(_0x0556('0x54'))]('Cloud\x20Provider\x20not\x20configured');}_0xda4b54=_0x578b3f;return getBucketslist(_0xda4b54[_0x0556('0x87')],_0xda4b54[_0x0556('0x88')],_0x2b728d[_0x0556('0x80')]);})[_0x0556('0x27')](function(_0x6d0894){if(_0x6d0894&&_0x6d0894[_0x0556('0x89')]){var _0x867c54=_[_0x0556('0x4e')](_0x6d0894['Buckets'],function(_0x5e65a5){return _0x5e65a5[_0x0556('0x8a')]===_0x2b728d[_0x0556('0x73')];});if(!_0x867c54){logger[_0x0556('0x66')](util[_0x0556('0x31')](_0x0556('0x8b'),_0x2bb10b[_0x0556('0x46')]['id'],_0x2b728d['bucket']));return createBucket(_0xda4b54['data1'],_0xda4b54[_0x0556('0x88')],_0x2b728d[_0x0556('0x80')],_0x2b728d[_0x0556('0x73')]);}logger[_0x0556('0x66')](util[_0x0556('0x31')](_0x0556('0x8c'),_0x2bb10b[_0x0556('0x46')]['id'],_0x2b728d[_0x0556('0x73')]));return;}})[_0x0556('0x27')](function(_0x54c99a){if(_0x526c24[_0x0556('0x7a')]==='NEW'){return transcribe(_0x2bb10b[_0x0556('0x46')]['id'],_0xda4b54[_0x0556('0x87')],_0xda4b54[_0x0556('0x88')],_0x2b728d[_0x0556('0x80')],_0x2b728d['bucket'],_0x526c24[_0x0556('0x4f')],_0x2b728d['language']);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x2bb10b['params']['id']));return{'transcribeStatus':_0x0556('0x8d')};}})[_0x0556('0x27')](function(_0x4a1da1){if(_0x4a1da1){_0x4a1da1[_0x0556('0x8e')]=_0x2bb10b['body'][_0x0556('0x8f')];return _0x526c24[_0x0556('0x90')](_0x4a1da1);}})[_0x0556('0x27')](respondWithResult(_0x4a3bb8,null))[_0x0556('0x44')](handleError(_0x4a3bb8,null));};function writeFile(_0x20702e,_0x401f46){return new Promise(function(_0x1b2470,_0x42ea75){fs[_0x0556('0x91')](_0x401f46,_0x20702e,function(_0x2552a9,_0x5bb510){if(_0x2552a9){return _0x42ea75(_0x2552a9);}else{return _0x1b2470(_0x5bb510);}});});}exports[_0x0556('0x92')]=function(_0x1f407f,_0x186976,_0x5658d1){return db[_0x0556('0x2c')][_0x0556('0x85')]({'where':{'id':_0x1f407f[_0x0556('0x46')]['id']}})[_0x0556('0x27')](handleEntityNotFound(_0x186976))[_0x0556('0x27')](function(_0x2e2113){if(_0x2e2113&&_0x2e2113['fileText']){var _0x12b6c4=_0x2e2113[_0x0556('0x93')];var _0x573653=config[_0x0556('0x94')]+'/server/files/transcribes/transcribe_'+_0x2e2113['id']+_0x0556('0x95');if(fs[_0x0556('0x51')](_0x573653)){return _0x573653;}return writeFile(_0x12b6c4,_0x573653)[_0x0556('0x27')](function(){return _0x573653;});}else{throw new db['Sequelize'][(_0x0556('0x54'))](_0x0556('0x96'));}})['then'](function(_0x119fb4){return _0x186976[_0x0556('0x4b')](_0x119fb4);})['catch'](handleError(_0x186976));};
\ No newline at end of file
index c02e24a..498ae53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd00d=['exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd00d,0xec));var _0xdd00=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xd00d[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xdd00('0x0'));var util=require('util');var logger=require(_0xdd00('0x1'))(_0xdd00('0x2'));var moment=require(_0xdd00('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd00('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdd00('0x5'));var attributes=require('./voiceRecording.attributes');module[_0xdd00('0x6')]=function(_0x57e8cc,_0xb0b62d){return _0x57e8cc[_0xdd00('0x7')](_0xdd00('0x8'),attributes,{'tableName':_0xdd00('0x9'),'paranoid':![],'indexes':[{'name':_0xdd00('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e36=['exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x284967,_0x2b46bc){var _0x5d866d=function(_0x4b581f){while(--_0x4b581f){_0x284967['push'](_0x284967['shift']());}};_0x5d866d(++_0x2b46bc);}(_0x5e36,0xc8));var _0x65e3=function(_0x5d5601,_0x321b58){_0x5d5601=_0x5d5601-0x0;var _0x252b08=_0x5e36[_0x5d5601];return _0x252b08;};'use strict';var _=require(_0x65e3('0x0'));var util=require(_0x65e3('0x1'));var logger=require('../../config/logger')(_0x65e3('0x2'));var moment=require(_0x65e3('0x3'));var BPromise=require(_0x65e3('0x4'));var rp=require(_0x65e3('0x5'));var fs=require('fs');var path=require(_0x65e3('0x6'));var rimraf=require(_0x65e3('0x7'));var config=require(_0x65e3('0x8'));var attributes=require(_0x65e3('0x9'));module[_0x65e3('0xa')]=function(_0x59a502,_0x35060c){return _0x59a502[_0x65e3('0xb')](_0x65e3('0xc'),attributes,{'tableName':_0x65e3('0xd'),'paranoid':![],'indexes':[{'name':_0x65e3('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index a85b38b..cfdf2f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['attributes','limit','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','callRecordingEncryption','value','format','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','where'];(function(_0x205b49,_0x57d2b4){var _0x5830c3=function(_0x2aeb9f){while(--_0x2aeb9f){_0x205b49['push'](_0x205b49['shift']());}};_0x5830c3(++_0x57d2b4);}(_0x5204,0xdf));var _0x4520=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x5204[_0x285800];return _0x4b809e;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')](_0x2e00f4[_0x4520('0x1a')],{'raw':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e00f4['options']?_0x2e00f4['options'][_0x4520('0x1c')]||null:null,'attributes':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')][_0x4520('0x1d')]||null:null,'limit':_0x2e00f4[_0x4520('0x1b')]?_0x2e00f4['options'][_0x4520('0x1e')]||null:null})[_0x4520('0x1f')](function(_0x3b2ede){logger['info'](_0x4520('0x17'),_0x2e00f4);logger[_0x4520('0xf')](_0x4520('0x17'),_0x2e00f4,JSON[_0x4520('0x11')](_0x3b2ede));_0x4ba69f(_0x3b2ede);})[_0x4520('0x16')](function(_0x552da1){logger[_0x4520('0x12')](_0x4520('0x17'),_0x552da1[_0x4520('0x14')],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x552da1['message']));});});};exports[_0x4520('0x20')]=function(_0x4602a4){var _0x92168b=this;return new Promise(function(_0x21e1f3,_0xad9f8){var _0x2c95ea=require(_0x4520('0x21'));var _0x195c58;return db[_0x4520('0x22')][_0x4520('0x23')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x4520('0x1f')](function(_0x5c1a0b){_0x195c58=_0x5c1a0b;return db[_0x4520('0x18')][_0x4520('0x24')](_0x4602a4[_0x4520('0x1a')]);})[_0x4520('0x1f')](function(_0x1da740){if(_0x195c58[_0x4520('0x25')]&&fs['existsSync'](_0x1da740[_0x4520('0x26')])){var _0x508c05=util[_0x4520('0x27')]('%s.cypher',_0x1da740[_0x4520('0x26')]);return _0x2c95ea['encryptFile'](_0x1da740[_0x4520('0x26')],_0x508c05,config['secrets']['recording'])[_0x4520('0x1f')](function(){fs[_0x4520('0x28')](_0x1da740[_0x4520('0x26')]);logger['info'](_0x4520('0x29'));return _0x1da740;});}return _0x1da740;})[_0x4520('0x1f')](function(_0x2acb4e){logger[_0x4520('0xc')]('CreateVoiceRecording',_0x4602a4);logger['debug'](_0x4520('0x20'),_0x4602a4,JSON[_0x4520('0x11')](_0x2acb4e));_0x21e1f3(_0x2acb4e);})['catch'](function(_0x779e94){logger[_0x4520('0x12')](_0x4520('0x20'),_0x779e94[_0x4520('0x14')],_0x4602a4);_0xad9f8(_0x92168b[_0x4520('0x12')](0x1f4,_0x779e94[_0x4520('0x14')]));});});};
\ No newline at end of file
+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(_0x2a4dda,_0x394a1b){var _0xe725e=function(_0x5c005c){while(--_0x5c005c){_0x2a4dda['push'](_0x2a4dda['shift']());}};_0xe725e(++_0x394a1b);}(_0xd943,0x15d));var _0x3d94=function(_0x29a1da,_0x40aa06){_0x29a1da=_0x29a1da-0x0;var _0x2a54fd=_0xd943[_0x29a1da];return _0x2a54fd;};'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
index 33c14d1..0dc1e0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc55=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','create','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0xcc55,0x1ee));var _0x5cc5=function(_0x1dfb65,_0x4a0064){_0x1dfb65=_0x1dfb65-0x0;var _0x4a6150=_0xcc55[_0x1dfb65];return _0x4a6150;};'use strict';var multer=require(_0x5cc5('0x0'));var util=require(_0x5cc5('0x1'));var path=require('path');var timeout=require(_0x5cc5('0x2'));var express=require(_0x5cc5('0x3'));var router=express[_0x5cc5('0x4')]();var fs_extra=require(_0x5cc5('0x5'));var auth=require(_0x5cc5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5cc5('0x7'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x5cc5('0x8')](),controller[_0x5cc5('0x9')]);router[_0x5cc5('0xa')](_0x5cc5('0xb'),auth[_0x5cc5('0x8')](),controller[_0x5cc5('0xc')]);router[_0x5cc5('0xa')]('/:id',auth[_0x5cc5('0x8')](),controller[_0x5cc5('0xd')]);router[_0x5cc5('0xe')]('/',auth[_0x5cc5('0x8')](),controller[_0x5cc5('0xf')]);router['put'](_0x5cc5('0x10'),auth[_0x5cc5('0x8')](),controller[_0x5cc5('0x11')]);router[_0x5cc5('0x12')](_0x5cc5('0x10'),auth['isAuthenticated'](),controller[_0x5cc5('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x1237=['delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x1237,0x66));var _0x7123=function(_0x2e205a,_0x4f5927){_0x2e205a=_0x2e205a-0x0;var _0x405e04=_0x1237[_0x2e205a];return _0x405e04;};'use strict';var multer=require('multer');var util=require(_0x7123('0x0'));var path=require(_0x7123('0x1'));var timeout=require('connect-timeout');var express=require(_0x7123('0x2'));var router=express[_0x7123('0x3')]();var fs_extra=require(_0x7123('0x4'));var auth=require(_0x7123('0x5'));var interaction=require(_0x7123('0x6'));var config=require(_0x7123('0x7'));var controller=require(_0x7123('0x8'));router[_0x7123('0x9')]('/',auth[_0x7123('0xa')](),controller[_0x7123('0xb')]);router[_0x7123('0x9')](_0x7123('0xc'),auth[_0x7123('0xa')](),controller[_0x7123('0xd')]);router['get'](_0x7123('0xe'),auth[_0x7123('0xa')](),controller['show']);router[_0x7123('0xf')]('/',auth[_0x7123('0xa')](),controller[_0x7123('0x10')]);router[_0x7123('0x11')](_0x7123('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x7123('0x12')](_0x7123('0xe'),auth[_0x7123('0xa')](),controller['destroy']);module[_0x7123('0x13')]=router;
\ No newline at end of file
index 4079622..8a748e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f8=['sequelize','moment','exports','ENUM','blind','STRING'];(function(_0x211c69,_0x27d6d8){var _0x4dddf0=function(_0x5ee9ee){while(--_0x5ee9ee){_0x211c69['push'](_0x211c69['shift']());}};_0x4dddf0(++_0x27d6d8);}(_0x04f8,0xe4));var _0x804f=function(_0x1dcd76,_0x148c35){_0x1dcd76=_0x1dcd76-0x0;var _0x10d152=_0x04f8[_0x1dcd76];return _0x10d152;};'use strict';var Sequelize=require(_0x804f('0x0'));var moment=require(_0x804f('0x1'));module[_0x804f('0x2')]={'type':{'type':Sequelize[_0x804f('0x3')](_0x804f('0x4'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x804f('0x5')]},'transferercalleridname':{'type':Sequelize[_0x804f('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x804f('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x804f('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x804f('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x804f('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x804f('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x804f('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x804f('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x804f('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x804f('0x5')]},'transfereecontext':{'type':Sequelize[_0x804f('0x5')]},'transfereeexten':{'type':Sequelize[_0x804f('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x804f('0x5')]},'isexternal':{'type':Sequelize[_0x804f('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x804f('0x5')]},'extension':{'type':Sequelize[_0x804f('0x5')]}};
\ No newline at end of file
+var _0x6a13=['ENUM','moment','exports','blind','attended','STRING'];(function(_0x49fa22,_0x3a8ccb){var _0x4af7a1=function(_0x5010c3){while(--_0x5010c3){_0x49fa22['push'](_0x49fa22['shift']());}};_0x4af7a1(++_0x3a8ccb);}(_0x6a13,0xf1));var _0x36a1=function(_0x48f601,_0x2b09e7){_0x48f601=_0x48f601-0x0;var _0x2d949f=_0x6a13[_0x48f601];return _0x2d949f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x36a1('0x0'));module[_0x36a1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x36a1('0x2'),_0x36a1('0x3'))},'result':{'type':Sequelize[_0x36a1('0x4')]},'transfererchannel':{'type':Sequelize[_0x36a1('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x36a1('0x4')]},'transferercalleridname':{'type':Sequelize[_0x36a1('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x36a1('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x36a1('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x36a1('0x4')]},'transferercontext':{'type':Sequelize[_0x36a1('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x36a1('0x4')]},'transfereechannel':{'type':Sequelize[_0x36a1('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x36a1('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x36a1('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x36a1('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x36a1('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x36a1('0x4')]},'transfereecontext':{'type':Sequelize[_0x36a1('0x4')]},'transfereeexten':{'type':Sequelize[_0x36a1('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x36a1('0x4')]},'isexternal':{'type':Sequelize[_0x36a1('0x5')]('Yes','No')},'context':{'type':Sequelize[_0x36a1('0x4')]},'extension':{'type':Sequelize[_0x36a1('0x4')]}};
\ No newline at end of file
index 23ec80a..6b65be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73c1=['show','params','fields','find','create','catch','update','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','VoiceTransferReport','type','model','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x73c1,0xde));var _0x173c=function(_0x4b7056,_0x14f82a){_0x4b7056=_0x4b7056-0x0;var _0x320b2e=_0x73c1[_0x4b7056];return _0x320b2e;};'use strict';var emlformat=require(_0x173c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x173c('0x1'));var jsonpatch=require(_0x173c('0x2'));var rp=require('request-promise');var moment=require(_0x173c('0x3'));var BPromise=require(_0x173c('0x4'));var Mustache=require('mustache');var util=require(_0x173c('0x5'));var path=require(_0x173c('0x6'));var sox=require(_0x173c('0x7'));var csv=require('to-csv');var ejs=require(_0x173c('0x8'));var fs=require('fs');var fs_extra=require(_0x173c('0x9'));var _=require(_0x173c('0xa'));var squel=require(_0x173c('0xb'));var crypto=require(_0x173c('0xc'));var jsforce=require(_0x173c('0xd'));var deskjs=require(_0x173c('0xe'));var toCsv=require(_0x173c('0xf'));var querystring=require(_0x173c('0x10'));var Papa=require('papaparse');var Redis=require(_0x173c('0x11'));var authService=require(_0x173c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x173c('0x13'));var hardwareService=require(_0x173c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x173c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x173c('0x16'))['db'];function respondWithStatusCode(_0x44c865,_0x4f214d){_0x4f214d=_0x4f214d||0xcc;return function(_0x2bea58){if(_0x2bea58){return _0x44c865[_0x173c('0x17')](_0x4f214d);}return _0x44c865[_0x173c('0x18')](_0x4f214d)[_0x173c('0x19')]();};}function respondWithResult(_0x1c98be,_0x3ad3f4){_0x3ad3f4=_0x3ad3f4||0xc8;return function(_0x316bbb){if(_0x316bbb){return _0x1c98be[_0x173c('0x18')](_0x3ad3f4)[_0x173c('0x1a')](_0x316bbb);}};}function respondWithFilteredResult(_0xadeb25,_0x47e4a8){return function(_0x4629bf){if(_0x4629bf){var _0x512507=typeof _0x47e4a8['offset']===_0x173c('0x1b')&&typeof _0x47e4a8[_0x173c('0x1c')]===_0x173c('0x1b');var _0x50c11f=_0x4629bf[_0x173c('0x1d')];var _0x4cf572=_0x512507?0x0:_0x47e4a8[_0x173c('0x1e')];var _0x2edd1c=_0x512507?_0x4629bf['count']:_0x47e4a8[_0x173c('0x1e')]+_0x47e4a8[_0x173c('0x1c')];var _0x9dfd73;if(_0x2edd1c>=_0x50c11f){_0x2edd1c=_0x50c11f;_0x9dfd73=0xc8;}else{_0x9dfd73=0xce;}_0xadeb25[_0x173c('0x18')](_0x9dfd73);return _0xadeb25[_0x173c('0x1f')](_0x173c('0x20'),_0x4cf572+'-'+_0x2edd1c+'/'+_0x50c11f)[_0x173c('0x1a')](_0x4629bf);}return null;};}function patchUpdates(_0x3654aa){return function(_0x1d0c2d){try{jsonpatch[_0x173c('0x21')](_0x1d0c2d,_0x3654aa,!![]);}catch(_0x2d145e){return BPromise[_0x173c('0x22')](_0x2d145e);}return _0x1d0c2d[_0x173c('0x23')]();};}function saveUpdates(_0x534bf9,_0x497c9c){return function(_0x286e13){if(_0x286e13){return _0x286e13['update'](_0x534bf9)[_0x173c('0x24')](function(_0x2e6c46){return _0x2e6c46;});}return null;};}function removeEntity(_0x524829,_0xdabe4c){return function(_0x3b2ccd){if(_0x3b2ccd){return _0x3b2ccd[_0x173c('0x25')]()['then'](function(){_0x524829[_0x173c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38b3dc,_0x51b878){return function(_0x57b9d3){if(!_0x57b9d3){_0x38b3dc[_0x173c('0x17')](0x194);}return _0x57b9d3;};}function handleError(_0x1a5fc9,_0x48b7c5){_0x48b7c5=_0x48b7c5||0x1f4;return function(_0x4985ab){logger['error'](_0x4985ab[_0x173c('0x26')]);if(_0x4985ab[_0x173c('0x27')]){delete _0x4985ab[_0x173c('0x27')];}_0x1a5fc9[_0x173c('0x18')](_0x48b7c5)[_0x173c('0x28')](_0x4985ab);};}exports['index']=function(_0xdba680,_0x309810){var _0x5eb186={},_0x570eca={},_0x2e8379={'count':0x0,'rows':[]};var _0x5daae2=_[_0x173c('0x29')](db[_0x173c('0x2a')]['rawAttributes'],function(_0xb5c403){return{'name':_0xb5c403['fieldName'],'type':_0xb5c403[_0x173c('0x2b')]['key']};});_0x570eca[_0x173c('0x2c')]=_[_0x173c('0x29')](_0x5daae2,'name');_0x570eca[_0x173c('0x2d')]=_['keys'](_0xdba680[_0x173c('0x2d')]);_0x570eca['filters']=_[_0x173c('0x2e')](_0x570eca[_0x173c('0x2c')],_0x570eca[_0x173c('0x2d')]);_0x5eb186[_0x173c('0x2f')]=_[_0x173c('0x2e')](_0x570eca['model'],qs['fields'](_0xdba680[_0x173c('0x2d')]['fields']));_0x5eb186['attributes']=_0x5eb186['attributes'][_0x173c('0x30')]?_0x5eb186['attributes']:_0x570eca['model'];if(!_0xdba680['query'][_0x173c('0x31')]('nolimit')){_0x5eb186[_0x173c('0x1c')]=qs[_0x173c('0x1c')](_0xdba680['query'][_0x173c('0x1c')]);_0x5eb186[_0x173c('0x1e')]=qs[_0x173c('0x1e')](_0xdba680[_0x173c('0x2d')][_0x173c('0x1e')]);}_0x5eb186[_0x173c('0x32')]=qs[_0x173c('0x33')](_0xdba680['query'][_0x173c('0x33')]);_0x5eb186[_0x173c('0x34')]=qs[_0x173c('0x35')](_[_0x173c('0x36')](_0xdba680['query'],_0x570eca['filters']),_0x5daae2);if(_0xdba680[_0x173c('0x2d')][_0x173c('0x37')]){_0x5eb186['where']=_['merge'](_0x5eb186[_0x173c('0x34')],{'$or':_['map'](_0x5daae2,function(_0x24deb8){if(_0x24deb8[_0x173c('0x2b')]!==_0x173c('0x38')){var _0x51697e={};_0x51697e[_0x24deb8[_0x173c('0x27')]]={'$like':'%'+_0xdba680[_0x173c('0x2d')][_0x173c('0x37')]+'%'};return _0x51697e;}})});}_0x5eb186=_[_0x173c('0x39')]({},_0x5eb186,_0xdba680[_0x173c('0x3a')]);var _0x1448e3={'where':_0x5eb186[_0x173c('0x34')]};return db[_0x173c('0x2a')]['count'](_0x1448e3)[_0x173c('0x24')](function(_0x1c2990){_0x2e8379[_0x173c('0x1d')]=_0x1c2990;if(_0xdba680[_0x173c('0x2d')][_0x173c('0x3b')]){_0x5eb186[_0x173c('0x3c')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x173c('0x3d')](_0x5eb186);})[_0x173c('0x24')](function(_0x706599){_0x2e8379['rows']=_0x706599;return _0x2e8379;})[_0x173c('0x24')](respondWithFilteredResult(_0x309810,_0x5eb186))['catch'](handleError(_0x309810,null));};exports[_0x173c('0x3e')]=function(_0x5236fd,_0x5b4b7a){var _0x2f25ac={'raw':!![],'where':{'id':_0x5236fd[_0x173c('0x3f')]['id']}},_0x3036d5={};_0x3036d5[_0x173c('0x2c')]=_['keys'](db[_0x173c('0x2a')]['rawAttributes']);_0x3036d5[_0x173c('0x2d')]=_['keys'](_0x5236fd[_0x173c('0x2d')]);_0x3036d5[_0x173c('0x35')]=_[_0x173c('0x2e')](_0x3036d5[_0x173c('0x2c')],_0x3036d5[_0x173c('0x2d')]);_0x2f25ac['attributes']=_[_0x173c('0x2e')](_0x3036d5[_0x173c('0x2c')],qs[_0x173c('0x40')](_0x5236fd[_0x173c('0x2d')]['fields']));_0x2f25ac[_0x173c('0x2f')]=_0x2f25ac['attributes'][_0x173c('0x30')]?_0x2f25ac[_0x173c('0x2f')]:_0x3036d5[_0x173c('0x2c')];if(_0x5236fd['query'][_0x173c('0x3b')]){_0x2f25ac[_0x173c('0x3c')]=[{'all':!![]}];}_0x2f25ac=_[_0x173c('0x39')]({},_0x2f25ac,_0x5236fd[_0x173c('0x3a')]);return db['VoiceTransferReport'][_0x173c('0x41')](_0x2f25ac)[_0x173c('0x24')](handleEntityNotFound(_0x5b4b7a,null))[_0x173c('0x24')](respondWithResult(_0x5b4b7a,null))['catch'](handleError(_0x5b4b7a,null));};exports[_0x173c('0x42')]=function(_0x16dfa1,_0x4142f7){return db[_0x173c('0x2a')][_0x173c('0x42')](_0x16dfa1['body'],{})['then'](respondWithResult(_0x4142f7,0xc9))[_0x173c('0x43')](handleError(_0x4142f7,null));};exports[_0x173c('0x44')]=function(_0xc5769f,_0x3b7873){if(_0xc5769f['body']['id']){delete _0xc5769f['body']['id'];}return db['VoiceTransferReport'][_0x173c('0x41')]({'where':{'id':_0xc5769f[_0x173c('0x3f')]['id']}})[_0x173c('0x24')](handleEntityNotFound(_0x3b7873,null))[_0x173c('0x24')](saveUpdates(_0xc5769f[_0x173c('0x45')],null))[_0x173c('0x24')](respondWithResult(_0x3b7873,null))[_0x173c('0x43')](handleError(_0x3b7873,null));};exports[_0x173c('0x25')]=function(_0x4d2d1b,_0x2120b7){return db['VoiceTransferReport'][_0x173c('0x41')]({'where':{'id':_0x4d2d1b[_0x173c('0x3f')]['id']}})[_0x173c('0x24')](handleEntityNotFound(_0x2120b7,null))[_0x173c('0x24')](removeEntity(_0x2120b7,null))[_0x173c('0x43')](handleError(_0x2120b7,null));};exports[_0x173c('0x46')]=function(_0x1fdf89,_0x38b72e){return db['VoiceTransferReport'][_0x173c('0x46')]()[_0x173c('0x24')](respondWithResult(_0x38b72e,null))[_0x173c('0x43')](handleError(_0x38b72e,null));};
\ No newline at end of file
+var _0xac6e=['params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','../../config/license/util','status','offset','undefined','limit','count','Content-Range','json','apply','reject','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','pick','filter','where','VIRTUAL','merge','options','VoiceTransferReport','includeAll','findAll','rows','catch','length','include','create','body','find'];(function(_0x270b31,_0x234254){var _0x396380=function(_0x48a7f9){while(--_0x48a7f9){_0x270b31['push'](_0x270b31['shift']());}};_0x396380(++_0x234254);}(_0xac6e,0x98));var _0xeac6=function(_0x50d8b2,_0x46f88d){_0x50d8b2=_0x50d8b2-0x0;var _0x2f9972=_0xac6e[_0x50d8b2];return _0x2f9972;};'use strict';var emlformat=require(_0xeac6('0x0'));var rimraf=require(_0xeac6('0x1'));var zipdir=require(_0xeac6('0x2'));var jsonpatch=require(_0xeac6('0x3'));var rp=require(_0xeac6('0x4'));var moment=require('moment');var BPromise=require(_0xeac6('0x5'));var Mustache=require(_0xeac6('0x6'));var util=require(_0xeac6('0x7'));var path=require(_0xeac6('0x8'));var sox=require(_0xeac6('0x9'));var csv=require(_0xeac6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeac6('0xb'));var squel=require(_0xeac6('0xc'));var crypto=require(_0xeac6('0xd'));var jsforce=require(_0xeac6('0xe'));var deskjs=require(_0xeac6('0xf'));var toCsv=require(_0xeac6('0xa'));var querystring=require(_0xeac6('0x10'));var Papa=require('papaparse');var Redis=require(_0xeac6('0x11'));var authService=require(_0xeac6('0x12'));var qs=require(_0xeac6('0x13'));var as=require(_0xeac6('0x14'));var hardwareService=require(_0xeac6('0x15'));var logger=require(_0xeac6('0x16'))(_0xeac6('0x17'));var utils=require(_0xeac6('0x18'));var config=require(_0xeac6('0x19'));var licenseUtil=require(_0xeac6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3967bc,_0x253329){_0x253329=_0x253329||0xcc;return function(_0x225b1c){if(_0x225b1c){return _0x3967bc['sendStatus'](_0x253329);}return _0x3967bc[_0xeac6('0x1b')](_0x253329)['end']();};}function respondWithResult(_0x24268b,_0x1bdedf){_0x1bdedf=_0x1bdedf||0xc8;return function(_0x25049e){if(_0x25049e){return _0x24268b[_0xeac6('0x1b')](_0x1bdedf)['json'](_0x25049e);}};}function respondWithFilteredResult(_0x36e3e2,_0x4b96e3){return function(_0xac1a0d){if(_0xac1a0d){var _0x1c8615=typeof _0x4b96e3[_0xeac6('0x1c')]===_0xeac6('0x1d')&&typeof _0x4b96e3[_0xeac6('0x1e')]===_0xeac6('0x1d');var _0x3d687e=_0xac1a0d[_0xeac6('0x1f')];var _0x208448=_0x1c8615?0x0:_0x4b96e3[_0xeac6('0x1c')];var _0x24b955=_0x1c8615?_0xac1a0d[_0xeac6('0x1f')]:_0x4b96e3[_0xeac6('0x1c')]+_0x4b96e3['limit'];var _0x248b43;if(_0x24b955>=_0x3d687e){_0x24b955=_0x3d687e;_0x248b43=0xc8;}else{_0x248b43=0xce;}_0x36e3e2[_0xeac6('0x1b')](_0x248b43);return _0x36e3e2['set'](_0xeac6('0x20'),_0x208448+'-'+_0x24b955+'/'+_0x3d687e)[_0xeac6('0x21')](_0xac1a0d);}return null;};}function patchUpdates(_0x2b2a69){return function(_0x1e99c3){try{jsonpatch[_0xeac6('0x22')](_0x1e99c3,_0x2b2a69,!![]);}catch(_0x13cd0e){return BPromise[_0xeac6('0x23')](_0x13cd0e);}return _0x1e99c3['save']();};}function saveUpdates(_0x54c68c,_0x131dcf){return function(_0x4782bf){if(_0x4782bf){return _0x4782bf['update'](_0x54c68c)[_0xeac6('0x24')](function(_0x2ee6e9){return _0x2ee6e9;});}return null;};}function removeEntity(_0x3b18cc,_0x132939){return function(_0x530800){if(_0x530800){return _0x530800[_0xeac6('0x25')]()[_0xeac6('0x24')](function(){_0x3b18cc['status'](0xcc)[_0xeac6('0x26')]();});}};}function handleEntityNotFound(_0x1a07c9,_0x4d84a4){return function(_0x3496e7){if(!_0x3496e7){_0x1a07c9['sendStatus'](0x194);}return _0x3496e7;};}function handleError(_0x2dd856,_0x4f4a02){_0x4f4a02=_0x4f4a02||0x1f4;return function(_0x543328){logger[_0xeac6('0x27')](_0x543328['stack']);if(_0x543328['name']){delete _0x543328[_0xeac6('0x28')];}_0x2dd856[_0xeac6('0x1b')](_0x4f4a02)[_0xeac6('0x29')](_0x543328);};}exports[_0xeac6('0x2a')]=function(_0x596040,_0x408333){var _0x2c74c6={},_0x39bba8={},_0x352d61={'count':0x0,'rows':[]};var _0x1b1721=_[_0xeac6('0x2b')](db['VoiceTransferReport'][_0xeac6('0x2c')],function(_0x5e58c5){return{'name':_0x5e58c5[_0xeac6('0x2d')],'type':_0x5e58c5[_0xeac6('0x2e')][_0xeac6('0x2f')]};});_0x39bba8[_0xeac6('0x30')]=_[_0xeac6('0x2b')](_0x1b1721,_0xeac6('0x28'));_0x39bba8[_0xeac6('0x31')]=_[_0xeac6('0x32')](_0x596040[_0xeac6('0x31')]);_0x39bba8[_0xeac6('0x33')]=_[_0xeac6('0x34')](_0x39bba8[_0xeac6('0x30')],_0x39bba8[_0xeac6('0x31')]);_0x2c74c6['attributes']=_[_0xeac6('0x34')](_0x39bba8[_0xeac6('0x30')],qs[_0xeac6('0x35')](_0x596040[_0xeac6('0x31')][_0xeac6('0x35')]));_0x2c74c6[_0xeac6('0x36')]=_0x2c74c6[_0xeac6('0x36')]['length']?_0x2c74c6['attributes']:_0x39bba8['model'];if(!_0x596040[_0xeac6('0x31')][_0xeac6('0x37')](_0xeac6('0x38'))){_0x2c74c6[_0xeac6('0x1e')]=qs[_0xeac6('0x1e')](_0x596040[_0xeac6('0x31')]['limit']);_0x2c74c6[_0xeac6('0x1c')]=qs[_0xeac6('0x1c')](_0x596040[_0xeac6('0x31')]['offset']);}_0x2c74c6['order']=qs['sort'](_0x596040['query']['sort']);_0x2c74c6['where']=qs[_0xeac6('0x33')](_[_0xeac6('0x39')](_0x596040[_0xeac6('0x31')],_0x39bba8[_0xeac6('0x33')]),_0x1b1721);if(_0x596040[_0xeac6('0x31')][_0xeac6('0x3a')]){_0x2c74c6[_0xeac6('0x3b')]=_['merge'](_0x2c74c6[_0xeac6('0x3b')],{'$or':_[_0xeac6('0x2b')](_0x1b1721,function(_0x1e00aa){if(_0x1e00aa[_0xeac6('0x2e')]!==_0xeac6('0x3c')){var _0x111895={};_0x111895[_0x1e00aa['name']]={'$like':'%'+_0x596040[_0xeac6('0x31')][_0xeac6('0x3a')]+'%'};return _0x111895;}})});}_0x2c74c6=_[_0xeac6('0x3d')]({},_0x2c74c6,_0x596040[_0xeac6('0x3e')]);var _0x109e24={'where':_0x2c74c6[_0xeac6('0x3b')]};return db[_0xeac6('0x3f')][_0xeac6('0x1f')](_0x109e24)[_0xeac6('0x24')](function(_0x49c5fe){_0x352d61[_0xeac6('0x1f')]=_0x49c5fe;if(_0x596040[_0xeac6('0x31')][_0xeac6('0x40')]){_0x2c74c6['include']=[{'all':!![]}];}return db[_0xeac6('0x3f')][_0xeac6('0x41')](_0x2c74c6);})[_0xeac6('0x24')](function(_0x975655){_0x352d61[_0xeac6('0x42')]=_0x975655;return _0x352d61;})[_0xeac6('0x24')](respondWithFilteredResult(_0x408333,_0x2c74c6))[_0xeac6('0x43')](handleError(_0x408333,null));};exports['show']=function(_0x131bd,_0x4e418b){var _0x2a92fc={'raw':!![],'where':{'id':_0x131bd['params']['id']}},_0x251889={};_0x251889['model']=_[_0xeac6('0x32')](db[_0xeac6('0x3f')][_0xeac6('0x2c')]);_0x251889[_0xeac6('0x31')]=_[_0xeac6('0x32')](_0x131bd[_0xeac6('0x31')]);_0x251889[_0xeac6('0x33')]=_[_0xeac6('0x34')](_0x251889[_0xeac6('0x30')],_0x251889[_0xeac6('0x31')]);_0x2a92fc[_0xeac6('0x36')]=_[_0xeac6('0x34')](_0x251889[_0xeac6('0x30')],qs[_0xeac6('0x35')](_0x131bd[_0xeac6('0x31')][_0xeac6('0x35')]));_0x2a92fc[_0xeac6('0x36')]=_0x2a92fc['attributes'][_0xeac6('0x44')]?_0x2a92fc[_0xeac6('0x36')]:_0x251889[_0xeac6('0x30')];if(_0x131bd[_0xeac6('0x31')][_0xeac6('0x40')]){_0x2a92fc[_0xeac6('0x45')]=[{'all':!![]}];}_0x2a92fc=_[_0xeac6('0x3d')]({},_0x2a92fc,_0x131bd[_0xeac6('0x3e')]);return db[_0xeac6('0x3f')]['find'](_0x2a92fc)[_0xeac6('0x24')](handleEntityNotFound(_0x4e418b,null))[_0xeac6('0x24')](respondWithResult(_0x4e418b,null))[_0xeac6('0x43')](handleError(_0x4e418b,null));};exports[_0xeac6('0x46')]=function(_0x1df36b,_0x52f1c7){return db[_0xeac6('0x3f')]['create'](_0x1df36b[_0xeac6('0x47')],{})[_0xeac6('0x24')](respondWithResult(_0x52f1c7,0xc9))['catch'](handleError(_0x52f1c7,null));};exports['update']=function(_0xed142f,_0x1f4d32){if(_0xed142f['body']['id']){delete _0xed142f['body']['id'];}return db[_0xeac6('0x3f')][_0xeac6('0x48')]({'where':{'id':_0xed142f['params']['id']}})[_0xeac6('0x24')](handleEntityNotFound(_0x1f4d32,null))['then'](saveUpdates(_0xed142f['body'],null))[_0xeac6('0x24')](respondWithResult(_0x1f4d32,null))[_0xeac6('0x43')](handleError(_0x1f4d32,null));};exports[_0xeac6('0x25')]=function(_0x35b479,_0x492d55){return db['VoiceTransferReport'][_0xeac6('0x48')]({'where':{'id':_0x35b479[_0xeac6('0x49')]['id']}})[_0xeac6('0x24')](handleEntityNotFound(_0x492d55,null))[_0xeac6('0x24')](removeEntity(_0x492d55,null))[_0xeac6('0x43')](handleError(_0x492d55,null));};exports[_0xeac6('0x4a')]=function(_0x1db2e5,_0x14b062){return db[_0xeac6('0x3f')][_0xeac6('0x4a')]()[_0xeac6('0x24')](respondWithResult(_0x14b062,null))[_0xeac6('0x43')](handleError(_0x14b062,null));};
\ No newline at end of file
index 6b56a68..1c9a742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4462=['request-promise','path','rimraf','../../config/environment','define','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x4462,0x1c2));var _0x2446=function(_0x4566db,_0x5da9a1){_0x4566db=_0x4566db-0x0;var _0x3167e6=_0x4462[_0x4566db];return _0x3167e6;};'use strict';var _=require(_0x2446('0x0'));var util=require(_0x2446('0x1'));var logger=require(_0x2446('0x2'))(_0x2446('0x3'));var moment=require(_0x2446('0x4'));var BPromise=require(_0x2446('0x5'));var rp=require(_0x2446('0x6'));var fs=require('fs');var path=require(_0x2446('0x7'));var rimraf=require(_0x2446('0x8'));var config=require(_0x2446('0x9'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x10d12f,_0x467f71){return _0x10d12f[_0x2446('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x2446('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0127=['api','moment','request-promise','path','rimraf','exports','VoiceTransferReport','report_call_transfer','../../config/logger'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0x0127,0x15e));var _0x7012=function(_0x3d4aef,_0x1a9c2d){_0x3d4aef=_0x3d4aef-0x0;var _0xe9f8ad=_0x0127[_0x3d4aef];return _0xe9f8ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7012('0x0'))(_0x7012('0x1'));var moment=require(_0x7012('0x2'));var BPromise=require('bluebird');var rp=require(_0x7012('0x3'));var fs=require('fs');var path=require(_0x7012('0x4'));var rimraf=require(_0x7012('0x5'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x7012('0x6')]=function(_0x88f09c,_0xef61d4){return _0x88f09c['define'](_0x7012('0x7'),attributes,{'tableName':_0x7012('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b44d8d..ff94794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04d8=['VoiceTransferReport','options','raw','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceTransferReport'];(function(_0x19fd58,_0x5d2adf){var _0x55d734=function(_0x5268a4){while(--_0x5268a4){_0x19fd58['push'](_0x19fd58['shift']());}};_0x55d734(++_0x5d2adf);}(_0x04d8,0x1ad));var _0x804d=function(_0x92713a,_0x68f8b0){_0x92713a=_0x92713a-0x0;var _0x1893e1=_0x04d8[_0x92713a];return _0x1893e1;};'use strict';var _=require(_0x804d('0x0'));var util=require(_0x804d('0x1'));var moment=require(_0x804d('0x2'));var BPromise=require(_0x804d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x804d('0x4'));var logger=require(_0x804d('0x5'))(_0x804d('0x6'));var config=require(_0x804d('0x7'));var jayson=require(_0x804d('0x8'));var client=jayson['client'][_0x804d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x430038,_0x78a28e,_0x4b62e9){return new BPromise(function(_0x29270f,_0x6513bf){return client[_0x804d('0xa')](_0x430038,_0x4b62e9)['then'](function(_0x132b47){logger[_0x804d('0xb')](_0x804d('0xc'),_0x78a28e,_0x804d('0xd'));logger[_0x804d('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x78a28e,'request\x20sent',JSON[_0x804d('0xf')](_0x132b47));if(_0x132b47[_0x804d('0x10')]){if(_0x132b47[_0x804d('0x10')][_0x804d('0x11')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x78a28e,_0x132b47[_0x804d('0x10')][_0x804d('0x12')]);return _0x6513bf(_0x132b47[_0x804d('0x10')]['message']);}logger[_0x804d('0x10')](_0x804d('0xc'),_0x78a28e,_0x132b47['error']['message']);return _0x29270f(_0x132b47['error'][_0x804d('0x12')]);}else{logger['info'](_0x804d('0xc'),_0x78a28e,'request\x20sent');_0x29270f(_0x132b47['result'][_0x804d('0x12')]);}})[_0x804d('0x13')](function(_0x10ab00){logger['error'](_0x804d('0xc'),_0x78a28e,_0x10ab00);_0x6513bf(_0x10ab00);});});}exports[_0x804d('0x14')]=function(_0x52624d){var _0x41d469=this;return new Promise(function(_0x20ae51,_0x407b44){return db[_0x804d('0x15')]['create'](_0x52624d['body'],{'raw':_0x52624d['options']?_0x52624d[_0x804d('0x16')][_0x804d('0x17')]===undefined?!![]:![]:!![]})[_0x804d('0x18')](function(_0x288dbc){logger[_0x804d('0xb')](_0x804d('0x14'),_0x52624d);logger[_0x804d('0xe')](_0x804d('0x14'),_0x52624d,JSON[_0x804d('0xf')](_0x288dbc));_0x20ae51(_0x288dbc);})[_0x804d('0x13')](function(_0x22b271){logger['error']('CreateVoiceTransferReport',_0x22b271[_0x804d('0x12')],_0x52624d);_0x407b44(_0x41d469['error'](0x1f4,_0x22b271[_0x804d('0x12')]));});});};
\ No newline at end of file
+var _0xd7de=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','lodash','util','bluebird','ioredis'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0xd7de,0x64));var _0xed7d=function(_0x47f356,_0x2958a9){_0x47f356=_0x47f356-0x0;var _0x269bc1=_0xd7de[_0x47f356];return _0x269bc1;};'use strict';var _=require(_0xed7d('0x0'));var util=require(_0xed7d('0x1'));var moment=require('moment');var BPromise=require(_0xed7d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed7d('0x3'));var db=require(_0xed7d('0x4'))['db'];var utils=require(_0xed7d('0x5'));var logger=require(_0xed7d('0x6'))('rpc');var config=require(_0xed7d('0x7'));var jayson=require(_0xed7d('0x8'));var client=jayson[_0xed7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x159a3c,_0x431c1a,_0x20058a){return new BPromise(function(_0x16a4b2,_0x590095){return client['request'](_0x159a3c,_0x20058a)['then'](function(_0x3a72a6){logger[_0xed7d('0xa')](_0xed7d('0xb'),_0x431c1a,_0xed7d('0xc'));logger[_0xed7d('0xd')](_0xed7d('0xe'),_0x431c1a,_0xed7d('0xc'),JSON[_0xed7d('0xf')](_0x3a72a6));if(_0x3a72a6[_0xed7d('0x10')]){if(_0x3a72a6['error'][_0xed7d('0x11')]===0x1f4){logger[_0xed7d('0x10')](_0xed7d('0xb'),_0x431c1a,_0x3a72a6['error'][_0xed7d('0x12')]);return _0x590095(_0x3a72a6[_0xed7d('0x10')][_0xed7d('0x12')]);}logger[_0xed7d('0x10')](_0xed7d('0xb'),_0x431c1a,_0x3a72a6[_0xed7d('0x10')][_0xed7d('0x12')]);return _0x16a4b2(_0x3a72a6[_0xed7d('0x10')][_0xed7d('0x12')]);}else{logger[_0xed7d('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x431c1a,_0xed7d('0xc'));_0x16a4b2(_0x3a72a6['result'][_0xed7d('0x12')]);}})['catch'](function(_0x56419b){logger[_0xed7d('0x10')](_0xed7d('0xb'),_0x431c1a,_0x56419b);_0x590095(_0x56419b);});});}exports[_0xed7d('0x13')]=function(_0x439a53){var _0x1ec4a3=this;return new Promise(function(_0x5e2ff4,_0x457c22){return db[_0xed7d('0x14')][_0xed7d('0x15')](_0x439a53[_0xed7d('0x16')],{'raw':_0x439a53[_0xed7d('0x17')]?_0x439a53[_0xed7d('0x17')][_0xed7d('0x18')]===undefined?!![]:![]:!![]})[_0xed7d('0x19')](function(_0x96b68f){logger['info'](_0xed7d('0x13'),_0x439a53);logger[_0xed7d('0xd')](_0xed7d('0x13'),_0x439a53,JSON[_0xed7d('0xf')](_0x96b68f));_0x5e2ff4(_0x96b68f);})['catch'](function(_0x4b5e75){logger[_0xed7d('0x10')](_0xed7d('0x13'),_0x4b5e75[_0xed7d('0x12')],_0x439a53);_0x457c22(_0x1ec4a3[_0xed7d('0x10')](0x1f4,_0x4b5e75[_0xed7d('0x12')]));});});};
\ No newline at end of file
index 00cbcbc..94d9681 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x107cf7,_0x1a6be5){var _0x300103=function(_0x3cda8f){while(--_0x3cda8f){_0x107cf7['push'](_0x107cf7['shift']());}};_0x300103(++_0x1a6be5);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xb4e6[_0x44b3bd];return _0x1efc4a;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router;
\ No newline at end of file
+var _0x91a7=['/originate','isWebrtcLicence','/hangup','isAuthenticated','hangup','/answer','answer','post','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller'];(function(_0x1ba868,_0x2c3dac){var _0x454122=function(_0x312e28){while(--_0x312e28){_0x1ba868['push'](_0x1ba868['shift']());}};_0x454122(++_0x2c3dac);}(_0x91a7,0xe7));var _0x791a=function(_0x5c8a3c,_0x23289a){_0x5c8a3c=_0x5c8a3c-0x0;var _0x8c0cb1=_0x91a7[_0x5c8a3c];return _0x8c0cb1;};'use strict';var express=require('express');var router=express[_0x791a('0x0')]();var auth=require(_0x791a('0x1'));var controller=require(_0x791a('0x2'));router['post'](_0x791a('0x3'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller['originate']);router['post'](_0x791a('0x5'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x7')]);router['post'](_0x791a('0x8'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x9')]);router[_0x791a('0xa')](_0x791a('0xb'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['hold']);router[_0x791a('0xa')](_0x791a('0xc'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller[_0x791a('0xd')]);router[_0x791a('0xa')](_0x791a('0xe'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['calls']);router['post'](_0x791a('0xf'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x10')]);module[_0x791a('0x11')]=router;
\ No newline at end of file
index 0880d73..1676e02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54f3=['sessionId\x20is\x20required','transferNumber\x20is\x20required','number','info','stringify','emit','log','error','stack','name','status','send','request','then','code','message','result','findOne','agent','all','filter','rows','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','catch','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','sessionId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','UserId','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','lodash','../../mysqldb','../../config/environment','util','bluebird','http','../../config/logger','webbarapi','defaults','localhost','socket.io-emitter','redis','validate','userId\x20is\x20required','callNumber\x20is\x20required','string'];(function(_0x5395e6,_0x38b7b1){var _0x5bef5a=function(_0x1567c0){while(--_0x1567c0){_0x5395e6['push'](_0x5395e6['shift']());}};_0x5bef5a(++_0x38b7b1);}(_0x54f3,0x120));var _0x354f=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x54f3[_0x4b055c];return _0x4b62bb;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x354f('0x0'));var db=require(_0x354f('0x1'))['db'];var config=require(_0x354f('0x2'));var util=require(_0x354f('0x3'));var BPromise=require(_0x354f('0x4'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x354f('0x5')]({'port':0x232a});var logger=require(_0x354f('0x6'))(_0x354f('0x7'));var Redis=require('ioredis');config['redis']=_[_0x354f('0x8')](config['redis'],{'host':_0x354f('0x9'),'port':0x18eb});var io=require(_0x354f('0xa'))(new Redis(config[_0x354f('0xb')]));var Schema=require(_0x354f('0xc'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]},'callNumber':{'type':'string','required':[!![],_0x354f('0xe')]},'callerId':{'type':_0x354f('0xf')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]},'sessionId':{'type':_0x354f('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]},'sessionId':{'type':_0x354f('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]},'sessionId':{'type':_0x354f('0xf'),'required':[!![],_0x354f('0x10')]},'transferNumber':{'type':_0x354f('0xf'),'required':[!![],_0x354f('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x354f('0x12'),'required':[!![],_0x354f('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x354f('0x12'),'required':[!![],_0x354f('0xd')]},'sessionId':{'type':_0x354f('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x354f('0x12'),'required':[!![],_0x354f('0xd')]}});function emit(_0x4cc0e9,_0x588741,_0x1a02eb){logger[_0x354f('0x13')](_0x4cc0e9,_0x588741,JSON[_0x354f('0x14')](_0x1a02eb));io['to'](_0x4cc0e9)[_0x354f('0x15')](_0x588741,_0x1a02eb);}function handleError(_0x3703bb){return function(_0x36402d){console[_0x354f('0x16')]('handleError:',_0x36402d,_0x36402d instanceof RangeError);logger[_0x354f('0x17')](_0x36402d[_0x354f('0x18')]);if(_0x36402d instanceof RangeError){if(_0x36402d[_0x354f('0x19')]){delete _0x36402d['name'];}_0x3703bb[_0x354f('0x1a')](0x194)['send'](_0x36402d);}else{if(_0x36402d[_0x354f('0x19')]){delete _0x36402d[_0x354f('0x19')];}_0x3703bb['status'](0x1f4)[_0x354f('0x1b')](_0x36402d);}};}function checkError(){return function(_0x39898c){if(!_0x39898c){throw new RangeError('NotFound');}return _0x39898c;};}function respondWithRpcPromise(_0x4c2c4f,_0x25ea69){return new BPromise(function(_0x574753,_0x52e7cb){var _0xa6050f=amiClient;return _0xa6050f[_0x354f('0x1c')](_0x4c2c4f,_0x25ea69)[_0x354f('0x1d')](function(_0x2f4277){if(_0x2f4277[_0x354f('0x17')]){if(_0x2f4277[_0x354f('0x17')][_0x354f('0x1e')]===0x1f4){return _0x52e7cb(_0x2f4277['error'][_0x354f('0x1f')]);}return _0x574753(_0x2f4277['error']['message']);}else{_0x574753(_0x2f4277[_0x354f('0x20')]);}})['catch'](function(_0x4b1820){_0x52e7cb(_0x4b1820);});});}function getAgent(_0xdb861e){return db['User'][_0x354f('0x21')]({'where':{'id':_0xdb861e,'role':_0x354f('0x22')}})['then'](checkError());}function getAgentCheckSession(_0x73c95e,_0x3c5c38){return new BPromise(function(_0x1467e7,_0x4c62c3){var _0x1a968d=respondWithRpcPromise('VoiceChannels');var _0x227d9b=getAgent(_0x73c95e);Promise[_0x354f('0x23')]([_0x1a968d,_0x227d9b])[_0x354f('0x1d')](function(_0x2816cf){var _0x596b48=_0x2816cf[0x0];var _0x21c121=_0x2816cf[0x1];var _0xb50aec=_[_0x354f('0x24')](_0x596b48[_0x354f('0x25')],function(_0x223464){return _0x223464['UserId']==_0x21c121['id']&&_0x223464['sessionId']==_0x3c5c38;});if(_0xb50aec[_0x354f('0x26')]==0x1){_0x1467e7(_0x21c121);}else{_0x4c62c3(new RangeError(_0x354f('0x27')+_0x3c5c38+_0x354f('0x28')));}});});}exports[_0x354f('0x29')]=function(_0x5c38d7,_0x576a95){logger[_0x354f('0x13')](_0x354f('0x2a'),_0x5c38d7[_0x354f('0x2b')]);var _0x8ef91e=originateValidation['validate'](_0x5c38d7[_0x354f('0x2b')]);if(_0x8ef91e[_0x354f('0x26')]>0x0){return _0x576a95[_0x354f('0x1a')](0x190)[_0x354f('0x2c')](_0x8ef91e);}var _0x4cd19e=_0x5c38d7['body'][_0x354f('0x2d')];var _0xc3b77d=_0x5c38d7[_0x354f('0x2b')][_0x354f('0x2e')];var _0x33bd5a=_0x5c38d7[_0x354f('0x2b')][_0x354f('0x2f')];var _0xf3b83b=_0x5c38d7[_0x354f('0x2b')][_0x354f('0x30')];return getAgent(_0x4cd19e)[_0x354f('0x1d')](function(_0x4d59f3){logger[_0x354f('0x13')]('entityFound:',_0x4d59f3[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x4d59f3[_0x354f('0x19')]),_0x354f('0x33'),{'callNumber':_0xc3b77d,'callerId':_0x33bd5a,'callbackUrl':_0xf3b83b});return _0x576a95[_0x354f('0x1a')](0xc8)['json']({'error':![],'message':_0x354f('0x34')});})[_0x354f('0x35')](handleError(_0x576a95));};exports['hangup']=function(_0x89dcb6,_0x944fda){logger[_0x354f('0x13')]('hangup\x20fired:',_0x89dcb6[_0x354f('0x2b')]);var _0x269871=hangupValidation[_0x354f('0xc')](_0x89dcb6[_0x354f('0x2b')]);if(_0x269871['length']>0x0){return _0x944fda[_0x354f('0x1a')](0x190)['json'](_0x269871);}var _0x2f6873=_0x89dcb6[_0x354f('0x2b')][_0x354f('0x2d')];var _0x22682a=_0x89dcb6[_0x354f('0x2b')]['sessionId'];return getAgent(_0x2f6873)['then'](function(_0x162a10){logger[_0x354f('0x13')](_0x354f('0x36'),_0x162a10[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x162a10['name']),_0x354f('0x37'),{'sessionId':_0x22682a});return _0x944fda[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':_0x354f('0x38')});})['catch'](handleError(_0x944fda));};exports[_0x354f('0x39')]=function(_0x46956e,_0x3a7180){logger[_0x354f('0x13')](_0x354f('0x3a'),_0x46956e[_0x354f('0x2b')]);var _0x5f33b2=answerValidation[_0x354f('0xc')](_0x46956e[_0x354f('0x2b')]);if(_0x5f33b2[_0x354f('0x26')]>0x0){return _0x3a7180['status'](0x190)['json'](_0x5f33b2);}var _0x7835a0=_0x46956e[_0x354f('0x2b')][_0x354f('0x2d')];var _0x3b34ca=_0x46956e[_0x354f('0x2b')][_0x354f('0x3b')];return getAgent(_0x7835a0)[_0x354f('0x1d')](function(_0x445b7d){logger['info'](_0x354f('0x36'),_0x445b7d[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x445b7d[_0x354f('0x19')]),_0x354f('0x3c'),{'sessionId':_0x3b34ca});return _0x3a7180[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':_0x354f('0x3d')});})['catch'](handleError(_0x3a7180));};exports[_0x354f('0x3e')]=function(_0x577fa6,_0x5503d6){logger['info'](_0x354f('0x3f'),_0x577fa6[_0x354f('0x2b')]);var _0x4d26a9=holdValidation[_0x354f('0xc')](_0x577fa6[_0x354f('0x2b')]);if(_0x4d26a9[_0x354f('0x26')]>0x0){return _0x5503d6['status'](0x190)['json'](_0x4d26a9);}var _0x178313=_0x577fa6[_0x354f('0x2b')][_0x354f('0x2d')];var _0x1d6952=_0x577fa6[_0x354f('0x2b')][_0x354f('0x3b')];return getAgent(_0x178313)['then'](function(_0x55f2c9){logger[_0x354f('0x13')]('entityFound:',_0x55f2c9[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x55f2c9['name']),'webbar:hold',{'sessionId':_0x1d6952});return _0x5503d6[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':'hold\x20executed!'});})[_0x354f('0x35')](handleError(_0x5503d6));};exports[_0x354f('0x40')]=function(_0xf71a4f,_0x2dd012){logger[_0x354f('0x13')](_0x354f('0x41'),_0xf71a4f[_0x354f('0x2b')]);var _0x4deff4=unholdValidation[_0x354f('0xc')](_0xf71a4f[_0x354f('0x2b')]);if(_0x4deff4[_0x354f('0x26')]>0x0){return _0x2dd012[_0x354f('0x1a')](0x190)[_0x354f('0x2c')](_0x4deff4);}var _0x4bb00c=_0xf71a4f[_0x354f('0x2b')][_0x354f('0x2d')];var _0x576e1d=_0xf71a4f['body'][_0x354f('0x3b')];return getAgent(_0x4bb00c)[_0x354f('0x1d')](function(_0x54914c){logger['info'](_0x354f('0x36'),_0x54914c[_0x354f('0x19')]);emit(util['format'](_0x354f('0x32'),_0x54914c[_0x354f('0x19')]),_0x354f('0x42'),{'sessionId':_0x576e1d});return _0x2dd012[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':_0x354f('0x43')});})[_0x354f('0x35')](handleError(_0x2dd012));};exports['calls']=function(_0x2ca633,_0x4535cb){logger[_0x354f('0x13')](_0x354f('0x44'),_0x4535cb['body']);var _0x2edb7c=callsValidation[_0x354f('0xc')](_0x2ca633[_0x354f('0x2b')]);if(_0x2edb7c[_0x354f('0x26')]>0x0){return _0x4535cb['status'](0x190)[_0x354f('0x2c')](_0x2edb7c);}var _0x1e9558=_0x2ca633[_0x354f('0x2b')][_0x354f('0x2d')];var _0x58c25f=respondWithRpcPromise(_0x354f('0x45'));var _0x16a32f=getAgent(_0x1e9558);return Promise[_0x354f('0x23')]([_0x58c25f,_0x16a32f])[_0x354f('0x1d')](function(_0x6164f7){var _0x294518=_0x6164f7[0x0];var _0x3d32de=_0x6164f7[0x1];var _0x3f1770=_[_0x354f('0x24')](_0x294518[_0x354f('0x25')],function(_0x102f91){return _0x102f91[_0x354f('0x46')]==_0x3d32de['id'];});return _0x4535cb[_0x354f('0x1a')](0xc8)['json']({'count':_0x3f1770[_0x354f('0x26')],'rows':_0x3f1770});})[_0x354f('0x35')](handleError(_0x4535cb));};exports['conference']=function(_0x575b76,_0xa3d1cb){logger['info'](_0x354f('0x47'),_0x575b76[_0x354f('0x2b')]);var _0x2e08e2=conferenceValidation[_0x354f('0xc')](_0x575b76[_0x354f('0x2b')]);if(_0x2e08e2[_0x354f('0x26')]>0x0){return _0xa3d1cb[_0x354f('0x1a')](0x190)[_0x354f('0x2c')](_0x2e08e2);}var _0x5dbf67=_0x575b76[_0x354f('0x2b')][_0x354f('0x2d')];return getAgent(_0x5dbf67)[_0x354f('0x1d')](function(_0x583d97){logger[_0x354f('0x13')](_0x354f('0x36'),_0x583d97[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x583d97[_0x354f('0x19')]),'webbar:conference');return _0xa3d1cb[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0x354f('0x35')](handleError(_0xa3d1cb));};exports[_0x354f('0x48')]=function(_0x1c8401,_0x1088d2){logger['info'](_0x354f('0x49'),_0x1c8401['body']);var _0x4b9a9f=transferValidation[_0x354f('0xc')](_0x1c8401[_0x354f('0x2b')]);if(_0x4b9a9f[_0x354f('0x26')]>0x0){return _0x1088d2[_0x354f('0x1a')](0x190)[_0x354f('0x2c')](_0x4b9a9f);}var _0x4ca3df=_0x1c8401['body'][_0x354f('0x2d')];var _0x41b1a5=_0x1c8401[_0x354f('0x2b')][_0x354f('0x3b')];var _0x5681d9=_0x1c8401[_0x354f('0x2b')][_0x354f('0x4a')];return getAgent(_0x4ca3df)['then'](function(_0x1139b8){logger[_0x354f('0x13')](_0x354f('0x36'),_0x1139b8[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x1139b8[_0x354f('0x19')]),_0x354f('0x4b'),{'sessionId':_0x41b1a5,'transferNumber':_0x5681d9});return _0x1088d2[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x354f('0x35')](handleError(_0x1088d2));};
\ No newline at end of file
+var _0x57d4=['filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','catch','hangup\x20fired:','json','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','webbar:conference','conference\x20executed!','transfer','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','log','handleError:','stack','status','send','name','NotFound','request','error','code','message','result','findOne','agent','then','VoiceChannels'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0x57d4,0x78));var _0x457d=function(_0x29bc94,_0x4ecef8){_0x29bc94=_0x29bc94-0x0;var _0x3dd1a3=_0x57d4[_0x29bc94];return _0x3dd1a3;};'use strict';var path=require(_0x457d('0x0'));var fs=require('fs');var _=require(_0x457d('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x457d('0x2'));var util=require(_0x457d('0x3'));var BPromise=require(_0x457d('0x4'));var jayson=require(_0x457d('0x5'));var amiClient=jayson[_0x457d('0x6')][_0x457d('0x7')]({'port':0x232a});var logger=require(_0x457d('0x8'))(_0x457d('0x9'));var Redis=require(_0x457d('0xa'));config[_0x457d('0xb')]=_[_0x457d('0xc')](config['redis'],{'host':_0x457d('0xd'),'port':0x18eb});var io=require(_0x457d('0xe'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'callNumber':{'type':_0x457d('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'sessionId':{'type':_0x457d('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'sessionId':{'type':_0x457d('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'sessionId':{'type':_0x457d('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x457d('0x11'),'required':[!![],_0x457d('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x457d('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'sessionId':{'type':_0x457d('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]}});function emit(_0x55c6e4,_0xc9b3f8,_0x1ebc33){logger[_0x457d('0x13')](_0x55c6e4,_0xc9b3f8,JSON['stringify'](_0x1ebc33));io['to'](_0x55c6e4)['emit'](_0xc9b3f8,_0x1ebc33);}function handleError(_0xc0751f){return function(_0x4d988f){console[_0x457d('0x14')](_0x457d('0x15'),_0x4d988f,_0x4d988f instanceof RangeError);logger['error'](_0x4d988f[_0x457d('0x16')]);if(_0x4d988f instanceof RangeError){if(_0x4d988f['name']){delete _0x4d988f['name'];}_0xc0751f[_0x457d('0x17')](0x194)[_0x457d('0x18')](_0x4d988f);}else{if(_0x4d988f[_0x457d('0x19')]){delete _0x4d988f[_0x457d('0x19')];}_0xc0751f[_0x457d('0x17')](0x1f4)[_0x457d('0x18')](_0x4d988f);}};}function checkError(){return function(_0x1cc0ba){if(!_0x1cc0ba){throw new RangeError(_0x457d('0x1a'));}return _0x1cc0ba;};}function respondWithRpcPromise(_0x2087a5,_0x46fe6a){return new BPromise(function(_0x57f229,_0x4bf90d){var _0x4e2dff=amiClient;return _0x4e2dff[_0x457d('0x1b')](_0x2087a5,_0x46fe6a)['then'](function(_0x5177cf){if(_0x5177cf['error']){if(_0x5177cf[_0x457d('0x1c')][_0x457d('0x1d')]===0x1f4){return _0x4bf90d(_0x5177cf['error'][_0x457d('0x1e')]);}return _0x57f229(_0x5177cf[_0x457d('0x1c')][_0x457d('0x1e')]);}else{_0x57f229(_0x5177cf[_0x457d('0x1f')]);}})['catch'](function(_0x5d6554){_0x4bf90d(_0x5d6554);});});}function getAgent(_0x556a8){return db['User'][_0x457d('0x20')]({'where':{'id':_0x556a8,'role':_0x457d('0x21')}})[_0x457d('0x22')](checkError());}function getAgentCheckSession(_0x1bc311,_0x54de66){return new BPromise(function(_0x298dd4,_0x57a47f){var _0x4eb5ca=respondWithRpcPromise(_0x457d('0x23'));var _0x3f696d=getAgent(_0x1bc311);Promise['all']([_0x4eb5ca,_0x3f696d])[_0x457d('0x22')](function(_0x2d69d2){var _0x5b5b31=_0x2d69d2[0x0];var _0xec380b=_0x2d69d2[0x1];var _0x41f012=_[_0x457d('0x24')](_0x5b5b31[_0x457d('0x25')],function(_0x381a9d){return _0x381a9d[_0x457d('0x26')]==_0xec380b['id']&&_0x381a9d[_0x457d('0x27')]==_0x54de66;});if(_0x41f012[_0x457d('0x28')]==0x1){_0x298dd4(_0xec380b);}else{_0x57a47f(new RangeError(_0x457d('0x29')+_0x54de66+_0x457d('0x2a')));}});});}exports[_0x457d('0x2b')]=function(_0x5782ce,_0xf668ff){logger[_0x457d('0x13')](_0x457d('0x2c'),_0x5782ce[_0x457d('0x2d')]);var _0xf8b8dc=originateValidation[_0x457d('0x2e')](_0x5782ce['body']);if(_0xf8b8dc[_0x457d('0x28')]>0x0){return _0xf668ff[_0x457d('0x17')](0x190)['json'](_0xf8b8dc);}var _0x47b7e8=_0x5782ce[_0x457d('0x2d')][_0x457d('0x2f')];var _0x5b4622=_0x5782ce[_0x457d('0x2d')][_0x457d('0x30')];var _0x1acf15=_0x5782ce[_0x457d('0x2d')][_0x457d('0x31')];var _0x36a90b=_0x5782ce[_0x457d('0x2d')][_0x457d('0x32')];return getAgent(_0x47b7e8)[_0x457d('0x22')](function(_0xde9836){logger[_0x457d('0x13')](_0x457d('0x33'),_0xde9836[_0x457d('0x19')]);emit(util[_0x457d('0x34')](_0x457d('0x35'),_0xde9836['name']),_0x457d('0x36'),{'callNumber':_0x5b4622,'callerId':_0x1acf15,'callbackUrl':_0x36a90b});return _0xf668ff['status'](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x457d('0x37')](handleError(_0xf668ff));};exports['hangup']=function(_0x18ed88,_0x55e580){logger['info'](_0x457d('0x38'),_0x18ed88[_0x457d('0x2d')]);var _0x2618f4=hangupValidation[_0x457d('0x2e')](_0x18ed88[_0x457d('0x2d')]);if(_0x2618f4[_0x457d('0x28')]>0x0){return _0x55e580[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x2618f4);}var _0x41a4a3=_0x18ed88[_0x457d('0x2d')][_0x457d('0x2f')];var _0x160755=_0x18ed88[_0x457d('0x2d')][_0x457d('0x27')];return getAgent(_0x41a4a3)[_0x457d('0x22')](function(_0x1bbd9d){logger[_0x457d('0x13')]('entityFound:',_0x1bbd9d[_0x457d('0x19')]);emit(util['format'](_0x457d('0x35'),_0x1bbd9d[_0x457d('0x19')]),_0x457d('0x3a'),{'sessionId':_0x160755});return _0x55e580[_0x457d('0x17')](0xc8)[_0x457d('0x39')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x55e580));};exports[_0x457d('0x3b')]=function(_0x4f7bad,_0x2db2ca){logger[_0x457d('0x13')](_0x457d('0x3c'),_0x4f7bad['body']);var _0x73e45d=answerValidation[_0x457d('0x2e')](_0x4f7bad[_0x457d('0x2d')]);if(_0x73e45d[_0x457d('0x28')]>0x0){return _0x2db2ca[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x73e45d);}var _0x34fdc0=_0x4f7bad[_0x457d('0x2d')][_0x457d('0x2f')];var _0x4a9896=_0x4f7bad['body'][_0x457d('0x27')];return getAgent(_0x34fdc0)[_0x457d('0x22')](function(_0x3bfce4){logger[_0x457d('0x13')](_0x457d('0x33'),_0x3bfce4[_0x457d('0x19')]);emit(util['format'](_0x457d('0x35'),_0x3bfce4[_0x457d('0x19')]),_0x457d('0x3d'),{'sessionId':_0x4a9896});return _0x2db2ca['status'](0xc8)[_0x457d('0x39')]({'error':![],'message':_0x457d('0x3e')});})[_0x457d('0x37')](handleError(_0x2db2ca));};exports['hold']=function(_0x1b8072,_0x57b0a5){logger[_0x457d('0x13')](_0x457d('0x3f'),_0x1b8072['body']);var _0xdc984c=holdValidation[_0x457d('0x2e')](_0x1b8072[_0x457d('0x2d')]);if(_0xdc984c[_0x457d('0x28')]>0x0){return _0x57b0a5[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0xdc984c);}var _0x13787f=_0x1b8072[_0x457d('0x2d')][_0x457d('0x2f')];var _0x15ae26=_0x1b8072['body'][_0x457d('0x27')];return getAgent(_0x13787f)[_0x457d('0x22')](function(_0x7abdf1){logger[_0x457d('0x13')]('entityFound:',_0x7abdf1[_0x457d('0x19')]);emit(util[_0x457d('0x34')](_0x457d('0x35'),_0x7abdf1[_0x457d('0x19')]),_0x457d('0x40'),{'sessionId':_0x15ae26});return _0x57b0a5[_0x457d('0x17')](0xc8)[_0x457d('0x39')]({'error':![],'message':_0x457d('0x41')});})['catch'](handleError(_0x57b0a5));};exports['unhold']=function(_0xec7449,_0x3e31cb){logger[_0x457d('0x13')](_0x457d('0x42'),_0xec7449[_0x457d('0x2d')]);var _0x10610a=unholdValidation[_0x457d('0x2e')](_0xec7449[_0x457d('0x2d')]);if(_0x10610a[_0x457d('0x28')]>0x0){return _0x3e31cb[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x10610a);}var _0x101afc=_0xec7449[_0x457d('0x2d')][_0x457d('0x2f')];var _0x4fe2f3=_0xec7449[_0x457d('0x2d')][_0x457d('0x27')];return getAgent(_0x101afc)[_0x457d('0x22')](function(_0x379a09){logger['info'](_0x457d('0x33'),_0x379a09[_0x457d('0x19')]);emit(util['format'](_0x457d('0x35'),_0x379a09[_0x457d('0x19')]),_0x457d('0x43'),{'sessionId':_0x4fe2f3});return _0x3e31cb['status'](0xc8)['json']({'error':![],'message':_0x457d('0x44')});})['catch'](handleError(_0x3e31cb));};exports[_0x457d('0x45')]=function(_0x3daf2c,_0xbed708){logger[_0x457d('0x13')](_0x457d('0x46'),_0xbed708[_0x457d('0x2d')]);var _0x2485bd=callsValidation[_0x457d('0x2e')](_0x3daf2c[_0x457d('0x2d')]);if(_0x2485bd[_0x457d('0x28')]>0x0){return _0xbed708[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x2485bd);}var _0x1d661e=_0x3daf2c[_0x457d('0x2d')]['userId'];var _0x2969b4=respondWithRpcPromise(_0x457d('0x23'));var _0x4e865a=getAgent(_0x1d661e);return Promise[_0x457d('0x47')]([_0x2969b4,_0x4e865a])['then'](function(_0x125f6f){var _0x1bec33=_0x125f6f[0x0];var _0x57a690=_0x125f6f[0x1];var _0x5ca847=_[_0x457d('0x24')](_0x1bec33[_0x457d('0x25')],function(_0x56de45){return _0x56de45['UserId']==_0x57a690['id'];});return _0xbed708[_0x457d('0x17')](0xc8)['json']({'count':_0x5ca847[_0x457d('0x28')],'rows':_0x5ca847});})['catch'](handleError(_0xbed708));};exports[_0x457d('0x48')]=function(_0x4786c4,_0x5a6d2d){logger[_0x457d('0x13')]('conference\x20fired:',_0x4786c4['body']);var _0x55ab65=conferenceValidation[_0x457d('0x2e')](_0x4786c4[_0x457d('0x2d')]);if(_0x55ab65['length']>0x0){return _0x5a6d2d[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x55ab65);}var _0x43dc83=_0x4786c4[_0x457d('0x2d')][_0x457d('0x2f')];return getAgent(_0x43dc83)[_0x457d('0x22')](function(_0x3c9a87){logger[_0x457d('0x13')](_0x457d('0x33'),_0x3c9a87['name']);emit(util['format'](_0x457d('0x35'),_0x3c9a87[_0x457d('0x19')]),_0x457d('0x49'));return _0x5a6d2d[_0x457d('0x17')](0xc8)[_0x457d('0x39')]({'error':![],'message':_0x457d('0x4a')});})[_0x457d('0x37')](handleError(_0x5a6d2d));};exports[_0x457d('0x4b')]=function(_0x1931e3,_0x270086){logger['info']('transfer\x20fired:',_0x1931e3[_0x457d('0x2d')]);var _0x4dc307=transferValidation[_0x457d('0x2e')](_0x1931e3['body']);if(_0x4dc307[_0x457d('0x28')]>0x0){return _0x270086[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x4dc307);}var _0x54a1e4=_0x1931e3['body'][_0x457d('0x2f')];var _0x155a2a=_0x1931e3['body']['sessionId'];var _0x1fd860=_0x1931e3[_0x457d('0x2d')]['transferNumber'];return getAgent(_0x54a1e4)[_0x457d('0x22')](function(_0x270cd5){logger[_0x457d('0x13')](_0x457d('0x33'),_0x270cd5['name']);emit(util[_0x457d('0x34')](_0x457d('0x35'),_0x270cd5[_0x457d('0x19')]),_0x457d('0x4c'),{'sessionId':_0x155a2a,'transferNumber':_0x1fd860});return _0x270086[_0x457d('0x17')](0xc8)['json']({'error':![],'message':_0x457d('0x4d')});})[_0x457d('0x37')](handleError(_0x270086));};
\ No newline at end of file
index c729fb7..65481f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','/:id/dispositions','addDisposition','addAgents','/:id/notify','notify','/:id/send','send','put'];(function(_0x1d0740,_0x209872){var _0x41f73a=function(_0xf8858){while(--_0xf8858){_0x1d0740['push'](_0x1d0740['shift']());}};_0x41f73a(++_0x209872);}(_0x66fa,0x117));var _0xa66f=function(_0x563883,_0x3a61c7){_0x563883=_0x563883-0x0;var _0x3a55c1=_0x66fa[_0x563883];return _0x3a55c1;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xa66f('0xb')](_0xa66f('0xd'),auth['isAuthenticated'](),controller[_0xa66f('0xe')]);router['get'](_0xa66f('0xf'),auth['isAuthenticated'](),controller[_0xa66f('0x10')]);router[_0xa66f('0xb')](_0xa66f('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa66f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x14')]);router[_0xa66f('0x12')](_0xa66f('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xa66f('0x12')](_0xa66f('0xf'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x15')]);router['post'](_0xa66f('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa66f('0x12')](_0xa66f('0x16'),controller[_0xa66f('0x17')]);router[_0xa66f('0x12')](_0xa66f('0x18'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x19')]);router[_0xa66f('0x1a')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1c')]);router[_0xa66f('0x1d')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1e')]);router['delete'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1f')]);router[_0xa66f('0x1d')]('/:id/canned_answers',auth[_0xa66f('0x9')](),controller[_0xa66f('0x20')]);router[_0xa66f('0x1d')](_0xa66f('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa66f('0x21')]=router;
\ No newline at end of file
+var _0x430c=['Router','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','send','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','connect-timeout','express'];(function(_0x23b56e,_0x2fe273){var _0x1865b2=function(_0x5da60a){while(--_0x5da60a){_0x23b56e['push'](_0x23b56e['shift']());}};_0x1865b2(++_0x2fe273);}(_0x430c,0x1a1));var _0xc430=function(_0x584291,_0x24b5b3){_0x584291=_0x584291-0x0;var _0x4e7d08=_0x430c[_0x584291];return _0x4e7d08;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();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(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['getAnswers']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0x5')](_0xc430('0xf'),auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc430('0x11')](_0xc430('0xc'),auth[_0xc430('0x8')](),controller[_0xc430('0x12')]);router[_0xc430('0x11')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['addAnswer']);router['post'](_0xc430('0x13'),auth[_0xc430('0x8')](),controller[_0xc430('0x14')]);router['post']('/:id/applications',auth[_0xc430('0x8')](),controller['addApplications']);router[_0xc430('0x11')]('/:id/notify',controller['notify']);router[_0xc430('0x11')]('/:id/send',auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router[_0xc430('0x16')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller['update']);router[_0xc430('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc430('0x18')]);router[_0xc430('0x17')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0x19')]);router['delete'](_0xc430('0x1a'),auth[_0xc430('0x8')](),controller['removeAnswers']);router[_0xc430('0x17')](_0xc430('0x13'),auth['isAuthenticated'](),controller[_0xc430('0x1b')]);module['exports']=router;
\ No newline at end of file
index cbbab75..df534f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc415=['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','sequelize','randomstring','exports','STRING','name','generate','sinch'];(function(_0x5306f7,_0x284b94){var _0x108184=function(_0x162229){while(--_0x162229){_0x5306f7['push'](_0x5306f7['shift']());}};_0x108184(++_0x284b94);}(_0xc415,0x19d));var _0x5c41=function(_0x12924f,_0x29b6f3){_0x12924f=_0x12924f-0x0;var _0x293df5=_0xc415[_0x12924f];return _0x293df5;};'use strict';var Sequelize=require(_0x5c41('0x0'));var rs=require(_0x5c41('0x1'));module[_0x5c41('0x2')]={'name':{'type':Sequelize[_0x5c41('0x3')],'unique':_0x5c41('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x5c41('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x5c41('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x5c41('0x3')],'defaultValue':function(){return rs[_0x5c41('0x5')]();}},'phone':{'type':Sequelize[_0x5c41('0x3')]},'type':{'type':Sequelize['ENUM']('twilio',_0x5c41('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x5c41('0x3')]},'authToken':{'type':Sequelize[_0x5c41('0x3')]},'notificationTemplate':{'type':Sequelize[_0x5c41('0x7')],'defaultValue':function(){return _0x5c41('0x8');}},'notificationSound':{'type':Sequelize[_0x5c41('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5c41('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5c41('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5c41('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5c41('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5c41('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5c41('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5c41('0xc'),'set':function(_0xabeae){if(!_0xabeae){this[_0x5c41('0xd')](_0x5c41('0xe'),null);}this[_0x5c41('0xd')]('mandatoryDisposition',_0xabeae);}},'description':{'type':Sequelize[_0x5c41('0x3')]}};
\ No newline at end of file
+var _0xe609=['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','randomstring','exports','STRING','name','ENUM','sinch'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xe609,0x143));var _0x9e60=function(_0x82db7a,_0x1b9129){_0x82db7a=_0x82db7a-0x0;var _0x76f85=_0xe609[_0x82db7a];return _0x76f85;};'use strict';var Sequelize=require(_0x9e60('0x0'));var rs=require(_0x9e60('0x1'));module[_0x9e60('0x2')]={'name':{'type':Sequelize[_0x9e60('0x3')],'unique':_0x9e60('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x9e60('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9e60('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x9e60('0x3')]},'type':{'type':Sequelize[_0x9e60('0x5')]('twilio',_0x9e60('0x6'))},'accountSid':{'type':Sequelize[_0x9e60('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9e60('0x7')],'defaultValue':function(){return _0x9e60('0x8');}},'notificationSound':{'type':Sequelize[_0x9e60('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9e60('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9e60('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9e60('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9e60('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e60('0xa')],'comment':_0x9e60('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x9e60('0x9')],'defaultValue':![],'comment':_0x9e60('0xc'),'set':function(_0x18a860){if(!_0x18a860){this[_0x9e60('0xd')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x9e60('0xe'),_0x18a860);}},'description':{'type':Sequelize[_0x9e60('0x3')]}};
\ No newline at end of file
index 056d102..9150228 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27bd=['request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','body','describe','Disposition','getDispositions','findOne','length','WhatsappAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','applications','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','From','replace','messageId','sinch','notifications','message_id','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','DESC','Messages','dataValues','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s'];(function(_0x51a399,_0x3830ab){var _0xb32dcc=function(_0x10f860){while(--_0x10f860){_0x51a399['push'](_0x51a399['shift']());}};_0xb32dcc(++_0x3830ab);}(_0x27bd,0x9b));var _0xd27b=function(_0x50a6fd,_0x31ef4e){_0x50a6fd=_0x50a6fd-0x0;var _0x498522=_0x27bd[_0x50a6fd];return _0x498522;};'use strict';var emlformat=require(_0xd27b('0x0'));var rimraf=require(_0xd27b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd27b('0x2'));var moment=require(_0xd27b('0x3'));var BPromise=require(_0xd27b('0x4'));var Mustache=require(_0xd27b('0x5'));var util=require('util');var path=require(_0xd27b('0x6'));var sox=require(_0xd27b('0x7'));var csv=require(_0xd27b('0x8'));var ejs=require(_0xd27b('0x9'));var fs=require('fs');var fs_extra=require(_0xd27b('0xa'));var _=require(_0xd27b('0xb'));var squel=require(_0xd27b('0xc'));var crypto=require(_0xd27b('0xd'));var jsforce=require(_0xd27b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd27b('0x8'));var querystring=require(_0xd27b('0xf'));var Papa=require(_0xd27b('0x10'));var Redis=require(_0xd27b('0x11'));var authService=require(_0xd27b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd27b('0x13'));var hardwareService=require(_0xd27b('0x14'));var logger=require(_0xd27b('0x15'))(_0xd27b('0x16'));var utils=require(_0xd27b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd27b('0x18'));var db=require(_0xd27b('0x19'))['db'];config['redis']=_[_0xd27b('0x1a')](config[_0xd27b('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xd27b('0x1c'))(new Redis(config['redis']));require(_0xd27b('0x1d'))[_0xd27b('0x1e')](socket);var jayson=require(_0xd27b('0x1f'));var client=jayson['client'][_0xd27b('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5d4d84,_0x5b2249,_0x2eec62,_0x2d7a33){return new BPromise(function(_0x432437,_0x4ad5d5){var _0x44c33c=_0x2d7a33||client;return _0x44c33c[_0xd27b('0x21')](_0x5d4d84,_0x2eec62)[_0xd27b('0x22')](function(_0x299cf5){logger[_0xd27b('0x23')](_0xd27b('0x24'),_0x5b2249,_0xd27b('0x25'));logger[_0xd27b('0x26')](_0xd27b('0x27'),_0x5b2249,'request\x20sent',JSON[_0xd27b('0x28')](_0x299cf5));if(_0x299cf5[_0xd27b('0x29')]){if(_0x299cf5['error'][_0xd27b('0x2a')]===0x1f4){logger[_0xd27b('0x29')](_0xd27b('0x24'),_0x5b2249,_0x299cf5[_0xd27b('0x29')]['message']);return _0x4ad5d5(_0x299cf5['error'][_0xd27b('0x2b')]);}logger[_0xd27b('0x29')](_0xd27b('0x24'),_0x5b2249,_0x299cf5[_0xd27b('0x29')]['message']);return _0x432437(_0x299cf5[_0xd27b('0x29')][_0xd27b('0x2b')]);}else{logger[_0xd27b('0x23')](_0xd27b('0x24'),_0x5b2249,_0xd27b('0x25'));_0x432437(_0x299cf5[_0xd27b('0x2c')][_0xd27b('0x2b')]);}})['catch'](function(_0x37f7be){logger['error'](_0xd27b('0x24'),_0x5b2249,_0x37f7be);_0x4ad5d5(_0x37f7be);});});}function respondWithStatusCode(_0x452488,_0x34b320){_0x34b320=_0x34b320||0xcc;return function(_0x3e554c){if(_0x3e554c){return _0x452488[_0xd27b('0x2d')](_0x34b320);}return _0x452488[_0xd27b('0x2e')](_0x34b320)[_0xd27b('0x2f')]();};}function respondWithResult(_0x317caf,_0x154977){_0x154977=_0x154977||0xc8;return function(_0x4fdbc6){if(_0x4fdbc6){return _0x317caf[_0xd27b('0x2e')](_0x154977)[_0xd27b('0x30')](_0x4fdbc6);}};}function respondWithFilteredResult(_0x5d72a6,_0x377f72){return function(_0x5a31bd){if(_0x5a31bd){var _0x2232c9=typeof _0x377f72[_0xd27b('0x31')]===_0xd27b('0x32')&&typeof _0x377f72[_0xd27b('0x33')]===_0xd27b('0x32');var _0x3c9bec=_0x5a31bd[_0xd27b('0x34')];var _0x44a908=_0x2232c9?0x0:_0x377f72[_0xd27b('0x31')];var _0x456d55=_0x2232c9?_0x5a31bd[_0xd27b('0x34')]:_0x377f72[_0xd27b('0x31')]+_0x377f72['limit'];var _0xec71b8;if(_0x456d55>=_0x3c9bec){_0x456d55=_0x3c9bec;_0xec71b8=0xc8;}else{_0xec71b8=0xce;}_0x5d72a6['status'](_0xec71b8);return _0x5d72a6[_0xd27b('0x35')](_0xd27b('0x36'),_0x44a908+'-'+_0x456d55+'/'+_0x3c9bec)[_0xd27b('0x30')](_0x5a31bd);}return null;};}function patchUpdates(_0x42a689){return function(_0x49800b){try{jsonpatch['apply'](_0x49800b,_0x42a689,!![]);}catch(_0x4e3f4c){return BPromise['reject'](_0x4e3f4c);}return _0x49800b['save']();};}function saveUpdates(_0x49dba9,_0x49e7ce){return function(_0x5cf60e){if(_0x5cf60e){return _0x5cf60e[_0xd27b('0x37')](_0x49dba9)['then'](function(_0x5e9520){return _0x5e9520;});}return null;};}function removeEntity(_0x18e21e,_0x43710f){return function(_0x5a39e3){if(_0x5a39e3){return _0x5a39e3['destroy']()[_0xd27b('0x22')](function(){var _0x3a118c=_0x5a39e3[_0xd27b('0x38')]({'plain':!![]});var _0x2f04c6=_0xd27b('0x39');return db[_0xd27b('0x3a')][_0xd27b('0x3b')]({'where':{'type':_0x2f04c6,'resourceId':_0x3a118c['id']}})[_0xd27b('0x22')](function(){return _0x5a39e3;});})[_0xd27b('0x22')](function(){_0x18e21e[_0xd27b('0x2e')](0xcc)[_0xd27b('0x2f')]();});}};}function handleEntityNotFound(_0x260171,_0x3b4aac){return function(_0x3e2d63){if(!_0x3e2d63){_0x260171[_0xd27b('0x2d')](0x194);}return _0x3e2d63;};}function handleError(_0x130058,_0x1f2f73){_0x1f2f73=_0x1f2f73||0x1f4;return function(_0x12a806){logger[_0xd27b('0x29')](_0x12a806[_0xd27b('0x3c')]);if(_0x12a806['name']){delete _0x12a806[_0xd27b('0x3d')];}_0x130058[_0xd27b('0x2e')](_0x1f2f73)['send'](_0x12a806);};}exports[_0xd27b('0x3e')]=function(_0x262733,_0x51ae76){var _0x4930f7={'include':[{'model':db[_0xd27b('0x3f')],'as':_0xd27b('0x40')}]},_0x18ae69={},_0x5d8872={'count':0x0,'rows':[]};var _0x512d4f=_[_0xd27b('0x41')](db[_0xd27b('0x42')][_0xd27b('0x43')],function(_0x3ff75c){return{'name':_0x3ff75c['fieldName'],'type':_0x3ff75c[_0xd27b('0x44')][_0xd27b('0x45')]};});_0x18ae69[_0xd27b('0x46')]=_[_0xd27b('0x41')](_0x512d4f,_0xd27b('0x3d'));_0x18ae69[_0xd27b('0x47')]=_[_0xd27b('0x48')](_0x262733[_0xd27b('0x47')]);_0x18ae69[_0xd27b('0x49')]=_['intersection'](_0x18ae69[_0xd27b('0x46')],_0x18ae69['query']);_0x4930f7[_0xd27b('0x4a')]=_[_0xd27b('0x4b')](_0x18ae69['model'],qs['fields'](_0x262733['query']['fields']));_0x4930f7['attributes']=_0x4930f7[_0xd27b('0x4a')]['length']?_0x4930f7[_0xd27b('0x4a')]:_0x18ae69[_0xd27b('0x46')];if(!_0x262733['query'][_0xd27b('0x4c')](_0xd27b('0x4d'))){_0x4930f7['limit']=qs[_0xd27b('0x33')](_0x262733['query'][_0xd27b('0x33')]);_0x4930f7[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0x262733[_0xd27b('0x47')][_0xd27b('0x31')]);}_0x4930f7[_0xd27b('0x4e')]=qs['sort'](_0x262733[_0xd27b('0x47')][_0xd27b('0x4f')]);_0x4930f7[_0xd27b('0x50')]=qs['filters'](_[_0xd27b('0x51')](_0x262733[_0xd27b('0x47')],_0x18ae69[_0xd27b('0x49')]),_0x512d4f);if(_0x262733[_0xd27b('0x47')][_0xd27b('0x52')]){_0x4930f7['where']=_[_0xd27b('0x53')](_0x4930f7[_0xd27b('0x50')],{'$or':_['map'](_0x512d4f,function(_0x5296dd){if(_0x5296dd[_0xd27b('0x44')]!==_0xd27b('0x54')){var _0x280d98={};_0x280d98[_0x5296dd[_0xd27b('0x3d')]]={'$like':'%'+_0x262733[_0xd27b('0x47')][_0xd27b('0x52')]+'%'};return _0x280d98;}})});}_0x4930f7=_[_0xd27b('0x53')]({},_0x4930f7,_0x262733[_0xd27b('0x55')]);var _0x5b95bd={'where':_0x4930f7['where']};return db['WhatsappAccount'][_0xd27b('0x34')](_0x5b95bd)[_0xd27b('0x22')](function(_0x385224){_0x5d8872['count']=_0x385224;if(_0x262733[_0xd27b('0x47')]['includeAll']){_0x4930f7[_0xd27b('0x56')]=[{'all':!![]}];}return db[_0xd27b('0x42')][_0xd27b('0x57')](_0x4930f7);})[_0xd27b('0x22')](function(_0xe17ca3){_0x5d8872[_0xd27b('0x58')]=_0xe17ca3;return _0x5d8872;})['then'](respondWithFilteredResult(_0x51ae76,_0x4930f7))[_0xd27b('0x59')](handleError(_0x51ae76,null));};exports[_0xd27b('0x5a')]=function(_0x32e1cf,_0x5baae7){var _0x1e5b61={'raw':![],'where':{'id':_0x32e1cf[_0xd27b('0x5b')]['id']},'include':[{'model':db[_0xd27b('0x3f')],'as':_0xd27b('0x40')}]},_0x5a0763={};_0x5a0763['model']=_[_0xd27b('0x48')](db[_0xd27b('0x42')][_0xd27b('0x43')]);_0x5a0763[_0xd27b('0x47')]=_[_0xd27b('0x48')](_0x32e1cf[_0xd27b('0x47')]);_0x5a0763['filters']=_['intersection'](_0x5a0763['model'],_0x5a0763[_0xd27b('0x47')]);_0x1e5b61[_0xd27b('0x4a')]=_['intersection'](_0x5a0763[_0xd27b('0x46')],qs[_0xd27b('0x5c')](_0x32e1cf[_0xd27b('0x47')][_0xd27b('0x5c')]));_0x1e5b61[_0xd27b('0x4a')]=_0x1e5b61['attributes']['length']?_0x1e5b61['attributes']:_0x5a0763[_0xd27b('0x46')];if(_0x32e1cf['query'][_0xd27b('0x5d')]){_0x1e5b61['include']=[{'all':!![]}];}_0x1e5b61=_[_0xd27b('0x53')]({},_0x1e5b61,_0x32e1cf[_0xd27b('0x55')]);return db[_0xd27b('0x42')][_0xd27b('0x5e')](_0x1e5b61)[_0xd27b('0x22')](handleEntityNotFound(_0x5baae7,null))[_0xd27b('0x22')](respondWithResult(_0x5baae7,null))['catch'](handleError(_0x5baae7,null));};exports[_0xd27b('0x5f')]=function(_0x2cca7c,_0x513faa){return db[_0xd27b('0x42')]['create'](_0x2cca7c['body'],{})[_0xd27b('0x22')](function(_0x57fedf){var _0x160031=_0x2cca7c[_0xd27b('0x60')][_0xd27b('0x38')]({'plain':!![]});if(!_0x160031)throw new Error(_0xd27b('0x61'));if(_0x160031['role']===_0xd27b('0x60')){var _0x23c74b=_0x57fedf[_0xd27b('0x38')]({'plain':!![]});var _0xb39f6b='WhatsappAccounts';return db[_0xd27b('0x62')]['find']({'where':{'name':_0xb39f6b,'userProfileId':_0x160031['userProfileId']},'raw':!![]})[_0xd27b('0x22')](function(_0x3e30fc){if(_0x3e30fc&&_0x3e30fc[_0xd27b('0x63')]===0x0){return db[_0xd27b('0x3a')][_0xd27b('0x5f')]({'name':_0x23c74b[_0xd27b('0x3d')],'resourceId':_0x23c74b['id'],'type':_0x3e30fc[_0xd27b('0x3d')],'sectionId':_0x3e30fc['id']},{})['then'](function(){return _0x57fedf;});}else{return _0x57fedf;}})[_0xd27b('0x59')](function(_0x1e1c43){logger[_0xd27b('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e1c43);throw _0x1e1c43;});}return _0x57fedf;})[_0xd27b('0x22')](respondWithResult(_0x513faa,0xc9))[_0xd27b('0x59')](handleError(_0x513faa,null));};exports[_0xd27b('0x37')]=function(_0x411090,_0x415627){if(_0x411090[_0xd27b('0x64')]['id']){delete _0x411090[_0xd27b('0x64')]['id'];}return db[_0xd27b('0x42')][_0xd27b('0x5e')]({'where':{'id':_0x411090['params']['id']},'include':[{'model':db[_0xd27b('0x3f')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x415627,null))[_0xd27b('0x22')](saveUpdates(_0x411090[_0xd27b('0x64')],null))[_0xd27b('0x22')](respondWithResult(_0x415627,null))[_0xd27b('0x59')](handleError(_0x415627,null));};exports['destroy']=function(_0x42c8f8,_0x1cd141){return db['WhatsappAccount'][_0xd27b('0x5e')]({'where':{'id':_0x42c8f8['params']['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x1cd141,null))[_0xd27b('0x22')](removeEntity(_0x1cd141,null))['catch'](handleError(_0x1cd141,null));};exports['describe']=function(_0x2cea96,_0x56f8f4){return db[_0xd27b('0x42')][_0xd27b('0x65')]()['then'](respondWithResult(_0x56f8f4,null))[_0xd27b('0x59')](handleError(_0x56f8f4,null));};exports['addDisposition']=function(_0x2ee56a,_0x4acbdf,_0x56c909){if(_0x2ee56a[_0xd27b('0x64')]['id']){delete _0x2ee56a['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2ee56a[_0xd27b('0x5b')]['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x4acbdf,null))['then'](function(_0x303f52){if(_0x303f52){_0x2ee56a[_0xd27b('0x64')]['WhatsappAccountId']=_0x303f52['id'];return db[_0xd27b('0x66')][_0xd27b('0x5f')](_0x2ee56a[_0xd27b('0x64')]);}})[_0xd27b('0x22')](respondWithResult(_0x4acbdf,null))[_0xd27b('0x59')](handleError(_0x4acbdf,null));};exports[_0xd27b('0x67')]=function(_0x552a06,_0x5531fb,_0x214f27){var _0x1b3949={'raw':![],'where':{}};var _0x22bcb0={};var _0x352aad={'count':0x0,'rows':[]};return db[_0xd27b('0x42')][_0xd27b('0x68')]({'where':{'id':_0x552a06[_0xd27b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5531fb,null))[_0xd27b('0x22')](function(_0x4ee4fe){if(_0x4ee4fe){_0x22bcb0['model']=_[_0xd27b('0x48')](db['Disposition']['rawAttributes']);_0x22bcb0['query']=_[_0xd27b('0x48')](_0x552a06[_0xd27b('0x47')]);_0x22bcb0['filters']=_[_0xd27b('0x4b')](_0x22bcb0['model'],_0x22bcb0['query']);_0x1b3949['attributes']=_['intersection'](_0x22bcb0[_0xd27b('0x46')],qs['fields'](_0x552a06[_0xd27b('0x47')][_0xd27b('0x5c')]));_0x1b3949[_0xd27b('0x4a')]=_0x1b3949['attributes'][_0xd27b('0x69')]?_0x1b3949[_0xd27b('0x4a')]:_0x22bcb0['model'];if(!_0x552a06[_0xd27b('0x47')][_0xd27b('0x4c')](_0xd27b('0x4d'))){_0x1b3949[_0xd27b('0x33')]=qs['limit'](_0x552a06[_0xd27b('0x47')][_0xd27b('0x33')]);_0x1b3949[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0x552a06['query'][_0xd27b('0x31')]);}_0x1b3949[_0xd27b('0x4e')]=qs[_0xd27b('0x4f')](_0x552a06[_0xd27b('0x47')][_0xd27b('0x4f')]);_0x1b3949[_0xd27b('0x50')]=qs[_0xd27b('0x49')](_[_0xd27b('0x51')](_0x552a06[_0xd27b('0x47')],_0x22bcb0[_0xd27b('0x49')]));_0x1b3949[_0xd27b('0x50')][_0xd27b('0x6a')]=_0x4ee4fe['id'];if(_0x552a06[_0xd27b('0x47')][_0xd27b('0x52')]){_0x1b3949['where']=_[_0xd27b('0x53')](_0x1b3949[_0xd27b('0x50')],{'$or':_[_0xd27b('0x41')](_0x1b3949[_0xd27b('0x4a')],function(_0x4faa39){var _0x482b21={};_0x482b21[_0x4faa39]={'$like':'%'+_0x552a06[_0xd27b('0x47')][_0xd27b('0x52')]+'%'};return _0x482b21;})});}_0x1b3949=_[_0xd27b('0x53')]({},_0x1b3949,_0x552a06[_0xd27b('0x55')]);return db[_0xd27b('0x66')]['count']({'where':_0x1b3949[_0xd27b('0x50')]})[_0xd27b('0x22')](function(_0x24bbae){_0x352aad[_0xd27b('0x34')]=_0x24bbae;if(_0x552a06[_0xd27b('0x47')][_0xd27b('0x5d')]){_0x1b3949[_0xd27b('0x56')]=[{'all':!![]}];}return db[_0xd27b('0x66')]['findAll'](_0x1b3949);})[_0xd27b('0x22')](function(_0x22e6df){_0x352aad[_0xd27b('0x58')]=_0x22e6df;return _0x352aad;});}})[_0xd27b('0x22')](respondWithFilteredResult(_0x5531fb,_0x1b3949))[_0xd27b('0x59')](handleError(_0x5531fb,null));};exports[_0xd27b('0x6b')]=function(_0x245924,_0x3a995a,_0x701d64){return db[_0xd27b('0x42')]['find']({'where':{'id':_0x245924[_0xd27b('0x5b')]['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x3a995a,null))[_0xd27b('0x22')](function(_0x32449f){if(_0x32449f){return _0x32449f[_0xd27b('0x6b')](_0x245924['query'][_0xd27b('0x6c')]);}})[_0xd27b('0x22')](respondWithStatusCode(_0x3a995a,null))[_0xd27b('0x59')](handleError(_0x3a995a,null));};exports[_0xd27b('0x6d')]=function(_0x3f4b96,_0x4e35ce,_0x77ab3a){if(_0x3f4b96[_0xd27b('0x64')]['id']){delete _0x3f4b96['body']['id'];}return db[_0xd27b('0x42')][_0xd27b('0x5e')]({'where':{'id':_0x3f4b96[_0xd27b('0x5b')]['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x4e35ce,null))['then'](function(_0x1162c9){if(_0x1162c9){_0x3f4b96['body']['WhatsappAccountId']=_0x1162c9['id'];return db['CannedAnswer']['create'](_0x3f4b96['body']);}})[_0xd27b('0x22')](respondWithResult(_0x4e35ce,null))[_0xd27b('0x59')](handleError(_0x4e35ce,null));};exports[_0xd27b('0x6e')]=function(_0x2b8d1b,_0x3c9f92,_0x3bca3c){var _0x3ef100={'raw':![],'where':{}};var _0x535c9e={};var _0x24ccb1={'count':0x0,'rows':[]};return db[_0xd27b('0x42')][_0xd27b('0x68')]({'where':{'id':_0x2b8d1b[_0xd27b('0x5b')]['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x3c9f92,null))['then'](function(_0x4202e4){if(_0x4202e4){_0x535c9e[_0xd27b('0x46')]=_[_0xd27b('0x48')](db['CannedAnswer']['rawAttributes']);_0x535c9e[_0xd27b('0x47')]=_[_0xd27b('0x48')](_0x2b8d1b[_0xd27b('0x47')]);_0x535c9e[_0xd27b('0x49')]=_[_0xd27b('0x4b')](_0x535c9e['model'],_0x535c9e[_0xd27b('0x47')]);_0x3ef100['attributes']=_[_0xd27b('0x4b')](_0x535c9e[_0xd27b('0x46')],qs[_0xd27b('0x5c')](_0x2b8d1b[_0xd27b('0x47')][_0xd27b('0x5c')]));_0x3ef100[_0xd27b('0x4a')]=_0x3ef100[_0xd27b('0x4a')][_0xd27b('0x69')]?_0x3ef100[_0xd27b('0x4a')]:_0x535c9e[_0xd27b('0x46')];if(!_0x2b8d1b[_0xd27b('0x47')]['hasOwnProperty'](_0xd27b('0x4d'))){_0x3ef100[_0xd27b('0x33')]=qs[_0xd27b('0x33')](_0x2b8d1b[_0xd27b('0x47')][_0xd27b('0x33')]);_0x3ef100[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0x2b8d1b['query'][_0xd27b('0x31')]);}_0x3ef100['order']=qs['sort'](_0x2b8d1b[_0xd27b('0x47')][_0xd27b('0x4f')]);_0x3ef100[_0xd27b('0x50')]=qs[_0xd27b('0x49')](_[_0xd27b('0x51')](_0x2b8d1b[_0xd27b('0x47')],_0x535c9e[_0xd27b('0x49')]));_0x3ef100[_0xd27b('0x50')]['WhatsappAccountId']=_0x4202e4['id'];if(_0x2b8d1b[_0xd27b('0x47')]['filter']){_0x3ef100[_0xd27b('0x50')]=_[_0xd27b('0x53')](_0x3ef100[_0xd27b('0x50')],{'$or':_['map'](_0x3ef100['attributes'],function(_0xfce7c5){var _0x55d833={};_0x55d833[_0xfce7c5]={'$like':'%'+_0x2b8d1b['query'][_0xd27b('0x52')]+'%'};return _0x55d833;})});}_0x3ef100=_['merge']({},_0x3ef100,_0x2b8d1b[_0xd27b('0x55')]);return db[_0xd27b('0x6f')][_0xd27b('0x34')]({'where':_0x3ef100[_0xd27b('0x50')]})[_0xd27b('0x22')](function(_0x26b5f6){_0x24ccb1[_0xd27b('0x34')]=_0x26b5f6;if(_0x2b8d1b[_0xd27b('0x47')][_0xd27b('0x5d')]){_0x3ef100[_0xd27b('0x56')]=[{'all':!![]}];}return db[_0xd27b('0x6f')][_0xd27b('0x57')](_0x3ef100);})[_0xd27b('0x22')](function(_0x5c4656){_0x24ccb1[_0xd27b('0x58')]=_0x5c4656;return _0x24ccb1;});}})['then'](respondWithFilteredResult(_0x3c9f92,_0x3ef100))[_0xd27b('0x59')](handleError(_0x3c9f92,null));};exports[_0xd27b('0x70')]=function(_0xecb21c,_0x348bce,_0x337428){return db[_0xd27b('0x42')]['find']({'where':{'id':_0xecb21c[_0xd27b('0x5b')]['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x348bce,null))[_0xd27b('0x22')](function(_0x2ec855){if(_0x2ec855){return _0x2ec855[_0xd27b('0x70')](_0xecb21c[_0xd27b('0x47')][_0xd27b('0x6c')]);}})['then'](respondWithStatusCode(_0x348bce,null))[_0xd27b('0x59')](handleError(_0x348bce,null));};exports[_0xd27b('0x71')]=function(_0x1026e3,_0x96be61,_0x295085){return db[_0xd27b('0x42')]['find']({'where':{'id':_0x1026e3['params']['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x96be61,null))[_0xd27b('0x22')](function(_0x2e4bdc){if(_0x2e4bdc){return _0x2e4bdc[_0xd27b('0x71')](_0x1026e3[_0xd27b('0x64')][_0xd27b('0x6c')],_[_0xd27b('0x72')](_0x1026e3[_0xd27b('0x64')],[_0xd27b('0x6c'),'id'])||{})[_0xd27b('0x73')](function(_0x3c9c5b){for(var _0xee9e4e=0x0;_0xee9e4e<_0x1026e3[_0xd27b('0x64')][_0xd27b('0x6c')][_0xd27b('0x69')];_0xee9e4e+=0x1){socket[_0xd27b('0x74')](_0xd27b('0x75'),{'UserId':Number(_0x1026e3[_0xd27b('0x64')][_0xd27b('0x6c')][_0xee9e4e]),'WhatsappAccountId':Number(_0x1026e3[_0xd27b('0x5b')]['id'])});}return _0x3c9c5b;});}})[_0xd27b('0x22')](respondWithResult(_0x96be61,null))['catch'](handleError(_0x96be61,null));};exports[_0xd27b('0x76')]=function(_0xdec3d8,_0x37bc62,_0x3eb34e){return db[_0xd27b('0x42')]['find']({'where':{'id':_0xdec3d8[_0xd27b('0x5b')]['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x37bc62,null))[_0xd27b('0x22')](function(_0x43cad9){if(_0x43cad9){return _0x43cad9[_0xd27b('0x76')](_0xdec3d8[_0xd27b('0x47')][_0xd27b('0x6c')])[_0xd27b('0x22')](function(){if(_['isArray'](_0xdec3d8[_0xd27b('0x47')]['ids'])){for(var _0xf28fba=0x0;_0xf28fba<_0xdec3d8[_0xd27b('0x47')][_0xd27b('0x6c')][_0xd27b('0x69')];_0xf28fba+=0x1){socket[_0xd27b('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0xdec3d8[_0xd27b('0x47')][_0xd27b('0x6c')][_0xf28fba]),'WhatsappAccountId':Number(_0xdec3d8['params']['id'])});}}else{socket['emit'](_0xd27b('0x77'),{'UserId':Number(_0xdec3d8[_0xd27b('0x47')][_0xd27b('0x6c')]),'WhatsappAccountId':Number(_0xdec3d8[_0xd27b('0x5b')]['id'])});}});}})[_0xd27b('0x22')](respondWithStatusCode(_0x37bc62,null))['catch'](handleError(_0x37bc62,null));};exports[_0xd27b('0x78')]=function(_0x1c8e7f,_0x5221e0,_0x2dac0c){var _0x242a8a={};var _0x207a87={};var _0x29dc50;var _0x12fe60;return db[_0xd27b('0x42')]['findOne']({'where':{'id':_0x1c8e7f['params']['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x5221e0,null))[_0xd27b('0x22')](function(_0x53d27c){if(_0x53d27c){_0x29dc50=_0x53d27c;_0x207a87[_0xd27b('0x46')]=_['keys'](db[_0xd27b('0x79')]['rawAttributes']);_0x207a87[_0xd27b('0x47')]=_[_0xd27b('0x48')](_0x1c8e7f[_0xd27b('0x47')]);_0x207a87[_0xd27b('0x49')]=_[_0xd27b('0x4b')](_0x207a87['model'],_0x207a87[_0xd27b('0x47')]);_0x242a8a['attributes']=_[_0xd27b('0x4b')](_0x207a87[_0xd27b('0x46')],qs['fields'](_0x1c8e7f['query'][_0xd27b('0x5c')]));_0x242a8a[_0xd27b('0x4a')]=_0x242a8a['attributes'][_0xd27b('0x69')]?_0x242a8a[_0xd27b('0x4a')]:_0x207a87[_0xd27b('0x46')];_0x242a8a[_0xd27b('0x4e')]=qs[_0xd27b('0x4f')](_0x1c8e7f['query'][_0xd27b('0x4f')]);_0x242a8a[_0xd27b('0x50')]=qs['filters'](_[_0xd27b('0x51')](_0x1c8e7f[_0xd27b('0x47')],_0x207a87['filters']));if(_0x1c8e7f[_0xd27b('0x47')][_0xd27b('0x52')]){_0x242a8a[_0xd27b('0x50')]=_[_0xd27b('0x53')](_0x242a8a[_0xd27b('0x50')],{'$or':_[_0xd27b('0x41')](_0x242a8a['attributes'],function(_0x2d56cd){var _0x3af433={};_0x3af433[_0x2d56cd]={'$like':'%'+_0x1c8e7f['query']['filter']+'%'};return _0x3af433;})});}_0x242a8a=_[_0xd27b('0x53')]({},_0x242a8a,_0x1c8e7f['options']);return _0x29dc50[_0xd27b('0x78')](_0x242a8a);}})[_0xd27b('0x22')](function(_0x20119f){if(_0x20119f){_0x12fe60=_0x20119f[_0xd27b('0x69')];if(!_0x1c8e7f['query']['hasOwnProperty'](_0xd27b('0x4d'))){_0x242a8a['limit']=qs[_0xd27b('0x33')](_0x1c8e7f[_0xd27b('0x47')][_0xd27b('0x33')]);_0x242a8a[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0x1c8e7f[_0xd27b('0x47')]['offset']);}return _0x29dc50[_0xd27b('0x78')](_0x242a8a);}})[_0xd27b('0x22')](function(_0x586218){if(_0x586218){return _0x586218?{'count':_0x12fe60,'rows':_0x586218}:null;}})[_0xd27b('0x22')](respondWithResult(_0x5221e0,null))[_0xd27b('0x59')](handleError(_0x5221e0,null));};exports[_0xd27b('0x7a')]=function(_0x312e9e,_0x1e278f){var _0xcca228=_0x312e9e[_0xd27b('0x5b')]['id'];var _0x4d41e8=_0x312e9e['body'];var _0x576daf=0xc8;var _0x505af7=null;return db[_0xd27b('0x7b')][_0xd27b('0x7c')]({'isolationLevel':db[_0xd27b('0x7b')][_0xd27b('0x7d')][_0xd27b('0x7e')]['READ_COMMITTED']},function(_0x546603){return db[_0xd27b('0x42')]['findOne']({'where':{'id':_0xcca228},'transaction':_0x546603})[_0xd27b('0x22')](function(_0x4b98d4){if(_0x4b98d4){return db[_0xd27b('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0xcca228},'transaction':_0x546603})['then'](function(){var _0x595066=_[_0xd27b('0x41')](_0x4d41e8,function(_0xb1f66c){_0xb1f66c['WhatsappAccountId']=_0xcca228;return _0xb1f66c;});return db[_0xd27b('0x7f')][_0xd27b('0x80')](_0x595066,{'transaction':_0x546603});});}else{_0x576daf=0x194;_0x505af7=[];}});})[_0xd27b('0x22')](function(){if(_0x576daf!==0x194){return db['WhatsappApplication'][_0xd27b('0x81')]({'where':{'WhatsappAccountId':_0xcca228},'order':_0xd27b('0x82')})['then'](function(_0xc8e259){_0x505af7=_0xc8e259;});}})['catch'](function(_0x5c59d7){_0x576daf=0x1f4;logger[_0xd27b('0x29')](_0x5c59d7[_0xd27b('0x3c')]);if(_0x5c59d7[_0xd27b('0x3d')]){delete _0x5c59d7[_0xd27b('0x3d')];}_0x505af7=_0x5c59d7;})[_0xd27b('0x83')](function(){if(_0x505af7===null){_0x1e278f['sendStatus'](_0x576daf);}else{if(_0x576daf===0x1f4){_0x1e278f[_0xd27b('0x2e')](_0x576daf)['send'](_0x505af7);}else{_0x1e278f['status'](_0x576daf)[_0xd27b('0x30')](_0x505af7);}}});};exports[_0xd27b('0x84')]=function(_0x2ae451,_0x3ecdad,_0x3dc508){var _0x19f680={};var _0x8aa00d={};var _0x160f37;var _0x3e651f;return db[_0xd27b('0x42')][_0xd27b('0x68')]({'where':{'id':_0x2ae451['params']['id']}})[_0xd27b('0x22')](handleEntityNotFound(_0x3ecdad,null))[_0xd27b('0x22')](function(_0x3c4a25){if(_0x3c4a25){_0x160f37=_0x3c4a25;_0x8aa00d[_0xd27b('0x46')]=_['keys'](db[_0xd27b('0x7f')]['rawAttributes']);_0x8aa00d['query']=_[_0xd27b('0x48')](_0x2ae451[_0xd27b('0x47')]);_0x8aa00d[_0xd27b('0x49')]=_[_0xd27b('0x4b')](_0x8aa00d[_0xd27b('0x46')],_0x8aa00d[_0xd27b('0x47')]);_0x19f680['attributes']=_[_0xd27b('0x4b')](_0x8aa00d[_0xd27b('0x46')],qs['fields'](_0x2ae451[_0xd27b('0x47')][_0xd27b('0x5c')]));_0x19f680[_0xd27b('0x4a')]=_0x19f680['attributes'][_0xd27b('0x69')]?_0x19f680[_0xd27b('0x4a')]:_0x8aa00d[_0xd27b('0x46')];_0x19f680['order']=qs[_0xd27b('0x4f')](_0x2ae451[_0xd27b('0x47')][_0xd27b('0x4f')]);_0x19f680[_0xd27b('0x50')]=qs['filters'](_[_0xd27b('0x51')](_0x2ae451[_0xd27b('0x47')],_0x8aa00d[_0xd27b('0x49')]));if(_0x2ae451['query'][_0xd27b('0x52')]){_0x19f680['where']=_['merge'](_0x19f680[_0xd27b('0x50')],{'$or':_[_0xd27b('0x41')](_0x19f680[_0xd27b('0x4a')],function(_0x9e93a2){var _0x30d729={};_0x30d729[_0x9e93a2]={'$like':'%'+_0x2ae451[_0xd27b('0x47')]['filter']+'%'};return _0x30d729;})});}_0x19f680=_[_0xd27b('0x53')]({},_0x19f680,_0x2ae451['options']);return _0x160f37[_0xd27b('0x84')](_0x19f680);}})[_0xd27b('0x22')](function(_0x475d91){if(_0x475d91){_0x3e651f=_0x475d91[_0xd27b('0x69')];if(!_0x2ae451[_0xd27b('0x47')]['hasOwnProperty']('nolimit')){_0x19f680[_0xd27b('0x33')]=qs[_0xd27b('0x33')](_0x2ae451[_0xd27b('0x47')][_0xd27b('0x33')]);_0x19f680[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0x2ae451[_0xd27b('0x47')][_0xd27b('0x31')]);}return _0x160f37[_0xd27b('0x84')](_0x19f680);}})[_0xd27b('0x22')](function(_0x25cfd8){if(_0x25cfd8){return _0x25cfd8?{'count':_0x3e651f,'rows':_0x25cfd8}:null;}})['then'](respondWithResult(_0x3ecdad,null))[_0xd27b('0x59')](handleError(_0x3ecdad,null));};exports[_0xd27b('0x85')]=function(_0x3af5b7,_0x8d8c94,_0x2f06a7){var _0x313695={'channel':_0xd27b('0x86')};var _0x3b0fbb=[];var _0x2efb7f=[];var _0x130410={};return db[_0xd27b('0x42')][_0xd27b('0x5e')]({'where':{'id':_0x3af5b7[_0xd27b('0x5b')]['id']},'include':[{'model':db[_0xd27b('0x7f')],'as':_0xd27b('0x87')}]})['then'](handleEntityNotFound(_0x8d8c94,null))[_0xd27b('0x22')](function(_0x3e5cd2){_0x313695[_0xd27b('0x88')]=_0x3e5cd2;if(_0x313695['account']&&_0x313695['account'][_0xd27b('0x44')]==='sinch'&&_0x3af5b7[_0xd27b('0x64')][_0xd27b('0x89')]){if(_0x3af5b7['body'][_0xd27b('0x89')][_0xd27b('0x69')]===0x0)return;if(_0x3af5b7[_0xd27b('0x64')]['statuses'][0x0][_0xd27b('0x8a')]!==_0xd27b('0x8b'))return;return db[_0xd27b('0x8c')][_0xd27b('0x37')]({'read':!![],'readAt':_0x3af5b7[_0xd27b('0x64')][_0xd27b('0x89')][0x0]['timestamp']},{'where':{'messageId':_0x3af5b7[_0xd27b('0x64')]['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x14f1bc){return _0x8d8c94['status'](0xc8)[_0xd27b('0x30')](_0x14f1bc);});}_0x313695[_0xd27b('0x8d')]=_['orderBy'](_0x3e5cd2['Applications'],[_0xd27b('0x82')],['asc']);if(_0x313695[_0xd27b('0x88')][_0xd27b('0x87')]){delete _0x313695[_0xd27b('0x88')]['Applications'];}return db[_0xd27b('0x8e')]['describe']()[_0xd27b('0x22')](function(_0x3f93da){if(!_0x3f93da){throw new db['Sequelize'][(_0xd27b('0x8f'))](_0xd27b('0x90'));}_0x3b0fbb=_[_0xd27b('0x91')](_[_0xd27b('0x48')](_0x3f93da),[_0xd27b('0x92'),_0xd27b('0x93')]);_0x2efb7f=_[_0xd27b('0x91')](_[_0xd27b('0x48')](_0x3f93da),[_0xd27b('0x92'),_0xd27b('0x93'),'CompanyId',_0xd27b('0x94')]);_0x313695['body']={'mapKey':_0xd27b('0x95')};if(_0x313695[_0xd27b('0x88')]&&_0x313695[_0xd27b('0x88')][_0xd27b('0x44')]==='twilio'){_0x313695[_0xd27b('0x64')][_0xd27b('0x96')]=_0x3af5b7[_0xd27b('0x64')][_0xd27b('0x97')][_0xd27b('0x98')]('whatsapp:','');_0x313695[_0xd27b('0x64')][_0xd27b('0x64')]=_0x3af5b7[_0xd27b('0x64')]['Body'];_0x313695[_0xd27b('0x64')][_0xd27b('0x99')]=_0x3af5b7[_0xd27b('0x64')]['MessageSid'];}if(_0x313695[_0xd27b('0x88')]&&_0x313695[_0xd27b('0x88')][_0xd27b('0x44')]===_0xd27b('0x9a')){_0x313695['body']['from']=_0x3af5b7[_0xd27b('0x64')][_0xd27b('0x9b')][0x0][_0xd27b('0x96')];_0x313695[_0xd27b('0x64')][_0xd27b('0x64')]=_0x3af5b7[_0xd27b('0x64')][_0xd27b('0x9b')][0x0][_0xd27b('0x2b')][_0xd27b('0x64')];_0x313695[_0xd27b('0x64')][_0xd27b('0x99')]=_0x3af5b7[_0xd27b('0x64')][_0xd27b('0x9b')][0x0][_0xd27b('0x9c')];}if(_0x313695[_0xd27b('0x64')]['id']){delete _0x313695[_0xd27b('0x64')]['id'];}if(_[_0xd27b('0x9d')](_0x313695[_0xd27b('0x64')]['from'])){throw new db[(_0xd27b('0x9e'))][(_0xd27b('0x8f'))](_0xd27b('0x9f'));}if(_['isNil'](_0x313695[_0xd27b('0x64')][_0xd27b('0x64')])||_0x313695[_0xd27b('0x64')]['body']===''){throw new db[(_0xd27b('0x9e'))]['ValidationError'](_0xd27b('0xa0'));}if(_[_0xd27b('0x9d')](_0x313695['body']['mapKey'])){throw new db[(_0xd27b('0x9e'))][(_0xd27b('0x8f'))](_0xd27b('0xa1')+_0x2efb7f);}if(!_['includes'](_0x2efb7f,_0x313695['body'][_0xd27b('0xa2')])){throw new db['Sequelize'][(_0xd27b('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2efb7f);}_0x130410[_0x313695[_0xd27b('0x64')][_0xd27b('0xa2')]]=_0x313695['body'][_0xd27b('0x96')];return db[_0xd27b('0xa3')][_0xd27b('0x5e')]({'where':{'id':_0x313695[_0xd27b('0x88')][_0xd27b('0x94')]},'include':[{'model':db[_0xd27b('0x8e')],'as':_0xd27b('0xa4'),'where':_0x130410,'limit':0x1,'order':[[_0xd27b('0x93'),'DESC']]}]});})[_0xd27b('0x22')](handleEntityNotFound(_0x8d8c94,null))[_0xd27b('0x22')](function(_0x2a5543){if(_0x2a5543){_0x313695[_0xd27b('0xa5')]=_[_0xd27b('0x72')](_0x2a5543,[_0xd27b('0xa4')]);if(_0x2a5543['Contacts'][_0xd27b('0x69')]){return _0x2a5543[_0xd27b('0xa4')][0x0];}var _0x4880ea=_['defaults'](_0x313695[_0xd27b('0x64')],{'firstName':_0x313695[_0xd27b('0x64')][_0xd27b('0x96')],'ListId':_0x2a5543['id']});_0x4880ea[_0x313695[_0xd27b('0x64')][_0xd27b('0xa2')]]=_0x313695[_0xd27b('0x64')][_0xd27b('0x96')];return db[_0xd27b('0x8e')][_0xd27b('0x5f')](_0x4880ea,{'fields':_0x3b0fbb,'raw':!![]});}})[_0xd27b('0x22')](handleEntityNotFound(_0x8d8c94,null))[_0xd27b('0x22')](function(_0x35a547){if(_0x35a547){_0x313695[_0xd27b('0xa6')]=_0x35a547;var _0x56b41d={'ContactId':_0x35a547['id'],'phone':_0x313695['body'][_0xd27b('0x96')],'WhatsappAccountId':_0x3af5b7['params']['id']};var _0x2ff044={'ContactId':_0x35a547['id'],'WhatsappAccountId':_0x3af5b7['params']['id'],'closed':![]};return db[_0xd27b('0xa7')][_0xd27b('0x5e')]({'where':_0x2ff044})[_0xd27b('0x22')](function(_0x5ccb0d){if(_0x5ccb0d){return[_0x5ccb0d,![]];}return db[_0xd27b('0xa7')][_0xd27b('0x5f')](_0x56b41d)['then'](function(_0x2e83d4){return[_0x2e83d4,!![]];});});}})[_0xd27b('0x73')](function(_0x90e30a,_0x3dd0cb){_0x313695[_0xd27b('0xa8')]=_0x90e30a[_0xd27b('0x38')]({'plain':!![]});_0x313695[_0xd27b('0xa8')][_0xd27b('0xa9')]=![];if(_0x3dd0cb){if(_0x313695[_0xd27b('0x88')][_0xd27b('0xaa')]){_0x313695['applications'][_0xd27b('0xab')]({'id':0x0,'priority':_0x313695[_0xd27b('0x8d')][_0xd27b('0x69')]+0x1,'app':_0xd27b('0xac'),'appdata':_0xd27b('0xad'),'interval':_0xd27b('0xae')});}_0x313695[_0xd27b('0xa8')][_0xd27b('0xa9')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x313695[_0xd27b('0x64')][_0xd27b('0x96')],'messageId':_0x313695[_0xd27b('0x64')][_0xd27b('0x99')],'body':_0x313695[_0xd27b('0x64')][_0xd27b('0x64')],'WhatsappAccountId':_0x3af5b7['params']['id'],'WhatsappInteractionId':_0x90e30a['id'],'direction':'in','ContactId':_0x90e30a['ContactId'],'AttachmentId':_0x313695['body'][_0xd27b('0xaf')]});})[_0xd27b('0x22')](function(_0x182844){_0x313695[_0xd27b('0x2b')]=_0x182844;if(_0x313695['interaction']['UserId']){return db[_0xd27b('0x79')]['find']({'attributes':['id',_0xd27b('0x3d')],'where':{'id':_0x313695['interaction']['UserId']}})[_0xd27b('0x22')](function(_0x4afa0b){if(_0x4afa0b){_0x313695['applications'][_0xd27b('0xb0')]({'id':0x0,'priority':0x0,'app':_0xd27b('0xb1'),'appdata':_0x4afa0b['name']+','+(_0x313695[_0xd27b('0x88')][_0xd27b('0xb2')]||0xa),'interval':_0xd27b('0xae')});}return respondWithRpcPromise(_0xd27b('0xb3'),_0xd27b('0xb4'),_0x313695);});}return respondWithRpcPromise('Start',_0xd27b('0xb4'),_0x313695);})[_0xd27b('0x22')](function(_0x4ba66b){if(_0x4ba66b){var _0x16a296=0xc8;var _0x1f43d0='receiveMessage';logger[_0xd27b('0x23')](_0xd27b('0x27'),_0x1f43d0,_0x16a296,_0xd27b('0xb5'));logger[_0xd27b('0x26')](_0xd27b('0xb6'),_0x1f43d0,_0x16a296,_0xd27b('0xb5'),JSON[_0xd27b('0x28')](_0x4ba66b));if(_0x313695[_0xd27b('0x88')]['type']===_0xd27b('0xb7')){return _0x8d8c94[_0xd27b('0x2e')](_0x16a296)[_0xd27b('0x35')]('Content-Type',_0xd27b('0xb8'))[_0xd27b('0xb9')](_0xd27b('0xba'));}else{return _0x8d8c94[_0xd27b('0x2e')](_0x16a296)[_0xd27b('0x30')](_0x4ba66b);}}});})[_0xd27b('0x59')](handleError(_0x8d8c94,null));};exports[_0xd27b('0xb9')]=function(_0x251b4e,_0x13cf33,_0x226bdb){var _0x5cb4a0,_0x146899,_0x4b055f;if(_[_0xd27b('0x9d')](_0x251b4e[_0xd27b('0x64')][_0xd27b('0x64')])||_0x251b4e[_0xd27b('0x64')]['body']===''){throw new db[(_0xd27b('0x9e'))][(_0xd27b('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd27b('0x9d')](_0x251b4e[_0xd27b('0x64')]['to'])){throw new db['Sequelize'][(_0xd27b('0x8f'))](_0xd27b('0xbb'));}_0x5cb4a0=_0x251b4e['body']['to'];return db[_0xd27b('0x42')][_0xd27b('0x5e')]({'where':{'id':_0x251b4e[_0xd27b('0x5b')]['id']},'include':[{'model':db[_0xd27b('0xa3')],'as':_0xd27b('0xbc'),'include':[{'model':db['CmContact'],'as':_0xd27b('0xa4'),'where':{'mobile':_0x5cb4a0},'limit':0x1,'order':[[_0xd27b('0x93'),_0xd27b('0xbd')]]}]}]})['then'](handleEntityNotFound(_0x13cf33,null))[_0xd27b('0x22')](function(_0x5f0dcf){if(_0x5f0dcf&&_0x5f0dcf[_0xd27b('0xbc')]){_0x146899=_0x5f0dcf[_0xd27b('0x38')]({'plain':!![]});if(_0x146899[_0xd27b('0xbc')]&&_0x146899[_0xd27b('0xbc')][_0xd27b('0xa4')][_0xd27b('0x69')]){return _0x146899[_0xd27b('0xbc')][_0xd27b('0xa4')][0x0];}return db[_0xd27b('0x8e')][_0xd27b('0x5f')](_[_0xd27b('0x1a')](_0x251b4e[_0xd27b('0x64')],{'firstName':_0x5cb4a0,'mobile':_0x5cb4a0,'phone':_0x5cb4a0,'ListId':_0x146899['ListId']}));}})[_0xd27b('0x22')](handleEntityNotFound(_0x13cf33,null))['then'](function(_0x44f275){if(_0x44f275){_0x4b055f=_0x44f275;return db[_0xd27b('0xa7')][_0xd27b('0x5e')]({'where':{'ContactId':_0x4b055f['id'],'closed':![],'WhatsappAccountId':_0x146899['id']}})[_0xd27b('0x22')](function(_0x5cdf24){if(_0x5cdf24){return[_0x5cdf24,![]];}return db[_0xd27b('0xa7')]['create']({'UserId':_0x251b4e['user']['id'],'ContactId':_0x4b055f['id'],'WhatsappAccountId':_0x146899['id'],'phone':_0x5cb4a0,'firstMsgDirection':'out','Messages':[_['merge'](_0x251b4e['body'],{'read':![],'body':_0x251b4e[_0xd27b('0x64')][_0xd27b('0x64')],'phone':_0x5cb4a0,'WhatsappAccountId':_0x146899['id'],'UserId':_0x251b4e['user']['id'],'ContactId':_0x4b055f['id']})]},{'include':[{'model':db[_0xd27b('0x8c')],'as':_0xd27b('0xbe')}]})[_0xd27b('0x22')](function(_0x4bb420){return[_0x4bb420,!![]];});});}})['spread'](function(_0x253935,_0x5e45b5){if(_0x5e45b5){return _0x253935;}return db[_0xd27b('0x8c')][_0xd27b('0x5f')](_[_0xd27b('0x53')](_0x251b4e[_0xd27b('0x64')],{'read':![],'body':_0x251b4e[_0xd27b('0x64')]['body'],'phone':_0x5cb4a0,'WhatsappAccountId':_0x146899['id'],'WhatsappInteractionId':_0x253935['id'],'UserId':_0x251b4e[_0xd27b('0x60')]['id'],'ContactId':_0x4b055f['id']}))[_0xd27b('0x22')](function(_0x85c612){_0x253935[_0xd27b('0xbf')][_0xd27b('0xbe')]=[];_0x253935[_0xd27b('0xbf')][_0xd27b('0xbe')][_0xd27b('0xab')](_0x85c612[_0xd27b('0xbf')]);return _0x253935;});})['then'](respondWithResult(_0x13cf33,null))[_0xd27b('0x59')](handleError(_0x13cf33,null));};
\ No newline at end of file
+var _0x08af=['from\x20is\x20mandatory','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','WhatsappAccounts','destroy','stack','name','Pause','WhatsappAccount','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','includeAll','include','rows','show','mandatoryDispositionPause','merge','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','From','replace','Body','messageId','MessageSid','from','notifications'];(function(_0x436849,_0x430b00){var _0x5c5f73=function(_0x5bdf78){while(--_0x5bdf78){_0x436849['push'](_0x436849['shift']());}};_0x5c5f73(++_0x430b00);}(_0x08af,0xe3));var _0xf08a=function(_0x38db77,_0x18239f){_0x38db77=_0x38db77-0x0;var _0x916e60=_0x08af[_0x38db77];return _0x916e60;};'use strict';var emlformat=require(_0xf08a('0x0'));var rimraf=require(_0xf08a('0x1'));var zipdir=require(_0xf08a('0x2'));var jsonpatch=require(_0xf08a('0x3'));var rp=require(_0xf08a('0x4'));var moment=require(_0xf08a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf08a('0x6'));var path=require(_0xf08a('0x7'));var sox=require(_0xf08a('0x8'));var csv=require(_0xf08a('0x9'));var ejs=require(_0xf08a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf08a('0xb'));var squel=require(_0xf08a('0xc'));var crypto=require('crypto');var jsforce=require(_0xf08a('0xd'));var deskjs=require(_0xf08a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf08a('0xf'));var Papa=require(_0xf08a('0x10'));var Redis=require('ioredis');var authService=require(_0xf08a('0x11'));var qs=require(_0xf08a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf08a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf08a('0x14'))['db'];config[_0xf08a('0x15')]=_[_0xf08a('0x16')](config[_0xf08a('0x15')],{'host':_0xf08a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf08a('0x18'))['register'](socket);var jayson=require(_0xf08a('0x19'));var client=jayson['client'][_0xf08a('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x323c7d,_0x33acf7,_0x4a0c0c,_0xe74ddf){return new BPromise(function(_0x2b3a68,_0x2194f3){var _0x1e0a45=_0xe74ddf||client;return _0x1e0a45[_0xf08a('0x1b')](_0x323c7d,_0x4a0c0c)[_0xf08a('0x1c')](function(_0x2baf11){logger[_0xf08a('0x1d')](_0xf08a('0x1e'),_0x33acf7,'request\x20sent');logger[_0xf08a('0x1f')](_0xf08a('0x20'),_0x33acf7,'request\x20sent',JSON['stringify'](_0x2baf11));if(_0x2baf11[_0xf08a('0x21')]){if(_0x2baf11[_0xf08a('0x21')][_0xf08a('0x22')]===0x1f4){logger[_0xf08a('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x33acf7,_0x2baf11[_0xf08a('0x21')][_0xf08a('0x23')]);return _0x2194f3(_0x2baf11['error'][_0xf08a('0x23')]);}logger[_0xf08a('0x21')](_0xf08a('0x1e'),_0x33acf7,_0x2baf11[_0xf08a('0x21')]['message']);return _0x2b3a68(_0x2baf11['error'][_0xf08a('0x23')]);}else{logger['info'](_0xf08a('0x1e'),_0x33acf7,_0xf08a('0x24'));_0x2b3a68(_0x2baf11['result'][_0xf08a('0x23')]);}})[_0xf08a('0x25')](function(_0x55bc82){logger[_0xf08a('0x21')](_0xf08a('0x1e'),_0x33acf7,_0x55bc82);_0x2194f3(_0x55bc82);});});}function respondWithStatusCode(_0x5d204c,_0x5f0adb){_0x5f0adb=_0x5f0adb||0xcc;return function(_0xf86e0d){if(_0xf86e0d){return _0x5d204c[_0xf08a('0x26')](_0x5f0adb);}return _0x5d204c[_0xf08a('0x27')](_0x5f0adb)[_0xf08a('0x28')]();};}function respondWithResult(_0x3cdb05,_0xc41328){_0xc41328=_0xc41328||0xc8;return function(_0xc92ce2){if(_0xc92ce2){return _0x3cdb05[_0xf08a('0x27')](_0xc41328)[_0xf08a('0x29')](_0xc92ce2);}};}function respondWithFilteredResult(_0x1bd3bc,_0x3e302e){return function(_0xb81fb0){if(_0xb81fb0){var _0x17ce43=typeof _0x3e302e[_0xf08a('0x2a')]==='undefined'&&typeof _0x3e302e[_0xf08a('0x2b')]===_0xf08a('0x2c');var _0x36db38=_0xb81fb0[_0xf08a('0x2d')];var _0x355868=_0x17ce43?0x0:_0x3e302e[_0xf08a('0x2a')];var _0x51e20b=_0x17ce43?_0xb81fb0['count']:_0x3e302e[_0xf08a('0x2a')]+_0x3e302e[_0xf08a('0x2b')];var _0x1186bc;if(_0x51e20b>=_0x36db38){_0x51e20b=_0x36db38;_0x1186bc=0xc8;}else{_0x1186bc=0xce;}_0x1bd3bc['status'](_0x1186bc);return _0x1bd3bc[_0xf08a('0x2e')](_0xf08a('0x2f'),_0x355868+'-'+_0x51e20b+'/'+_0x36db38)['json'](_0xb81fb0);}return null;};}function patchUpdates(_0x3702c5){return function(_0x4dbcb2){try{jsonpatch[_0xf08a('0x30')](_0x4dbcb2,_0x3702c5,!![]);}catch(_0x2c4ffa){return BPromise[_0xf08a('0x31')](_0x2c4ffa);}return _0x4dbcb2['save']();};}function saveUpdates(_0x362bca,_0x3863ab){return function(_0xdf001d){if(_0xdf001d){return _0xdf001d[_0xf08a('0x32')](_0x362bca)['then'](function(_0x298cd0){return _0x298cd0;});}return null;};}function removeEntity(_0x83d6f4,_0x4289e1){return function(_0x2058a3){if(_0x2058a3){return _0x2058a3['destroy']()['then'](function(){var _0x166445=_0x2058a3['get']({'plain':!![]});var _0x1d863d=_0xf08a('0x33');return db['UserProfileResource'][_0xf08a('0x34')]({'where':{'type':_0x1d863d,'resourceId':_0x166445['id']}})[_0xf08a('0x1c')](function(){return _0x2058a3;});})[_0xf08a('0x1c')](function(){_0x83d6f4[_0xf08a('0x27')](0xcc)[_0xf08a('0x28')]();});}};}function handleEntityNotFound(_0xc47776,_0x50f6ff){return function(_0xfab904){if(!_0xfab904){_0xc47776[_0xf08a('0x26')](0x194);}return _0xfab904;};}function handleError(_0x360b24,_0x391616){_0x391616=_0x391616||0x1f4;return function(_0x4d99a4){logger[_0xf08a('0x21')](_0x4d99a4[_0xf08a('0x35')]);if(_0x4d99a4[_0xf08a('0x36')]){delete _0x4d99a4[_0xf08a('0x36')];}_0x360b24[_0xf08a('0x27')](_0x391616)['send'](_0x4d99a4);};}exports['index']=function(_0x55bfce,_0x5194d5){var _0x8f8b43={'include':[{'model':db[_0xf08a('0x37')],'as':'mandatoryDispositionPause'}]},_0x3b5a11={},_0x409392={'count':0x0,'rows':[]};var _0x3e95b2=_['map'](db[_0xf08a('0x38')][_0xf08a('0x39')],function(_0x233587){return{'name':_0x233587[_0xf08a('0x3a')],'type':_0x233587[_0xf08a('0x3b')][_0xf08a('0x3c')]};});_0x3b5a11['model']=_[_0xf08a('0x3d')](_0x3e95b2,_0xf08a('0x36'));_0x3b5a11['query']=_[_0xf08a('0x3e')](_0x55bfce[_0xf08a('0x3f')]);_0x3b5a11[_0xf08a('0x40')]=_[_0xf08a('0x41')](_0x3b5a11[_0xf08a('0x42')],_0x3b5a11[_0xf08a('0x3f')]);_0x8f8b43[_0xf08a('0x43')]=_[_0xf08a('0x41')](_0x3b5a11[_0xf08a('0x42')],qs[_0xf08a('0x44')](_0x55bfce[_0xf08a('0x3f')][_0xf08a('0x44')]));_0x8f8b43['attributes']=_0x8f8b43['attributes'][_0xf08a('0x45')]?_0x8f8b43['attributes']:_0x3b5a11[_0xf08a('0x42')];if(!_0x55bfce['query'][_0xf08a('0x46')](_0xf08a('0x47'))){_0x8f8b43['limit']=qs['limit'](_0x55bfce['query'][_0xf08a('0x2b')]);_0x8f8b43[_0xf08a('0x2a')]=qs['offset'](_0x55bfce[_0xf08a('0x3f')][_0xf08a('0x2a')]);}_0x8f8b43['order']=qs[_0xf08a('0x48')](_0x55bfce[_0xf08a('0x3f')][_0xf08a('0x48')]);_0x8f8b43[_0xf08a('0x49')]=qs[_0xf08a('0x40')](_[_0xf08a('0x4a')](_0x55bfce[_0xf08a('0x3f')],_0x3b5a11['filters']),_0x3e95b2);if(_0x55bfce['query'][_0xf08a('0x4b')]){_0x8f8b43[_0xf08a('0x49')]=_['merge'](_0x8f8b43['where'],{'$or':_['map'](_0x3e95b2,function(_0x336b62){if(_0x336b62['type']!=='VIRTUAL'){var _0x320b58={};_0x320b58[_0x336b62[_0xf08a('0x36')]]={'$like':'%'+_0x55bfce[_0xf08a('0x3f')][_0xf08a('0x4b')]+'%'};return _0x320b58;}})});}_0x8f8b43=_['merge']({},_0x8f8b43,_0x55bfce['options']);var _0x1db436={'where':_0x8f8b43['where']};return db[_0xf08a('0x38')][_0xf08a('0x2d')](_0x1db436)['then'](function(_0x1773a1){_0x409392[_0xf08a('0x2d')]=_0x1773a1;if(_0x55bfce[_0xf08a('0x3f')][_0xf08a('0x4c')]){_0x8f8b43[_0xf08a('0x4d')]=[{'all':!![]}];}return db[_0xf08a('0x38')]['findAll'](_0x8f8b43);})[_0xf08a('0x1c')](function(_0xe24ae9){_0x409392[_0xf08a('0x4e')]=_0xe24ae9;return _0x409392;})['then'](respondWithFilteredResult(_0x5194d5,_0x8f8b43))['catch'](handleError(_0x5194d5,null));};exports[_0xf08a('0x4f')]=function(_0x239780,_0x140fcf){var _0x5b83ff={'raw':![],'where':{'id':_0x239780['params']['id']},'include':[{'model':db[_0xf08a('0x37')],'as':_0xf08a('0x50')}]},_0x508ae3={};_0x508ae3[_0xf08a('0x42')]=_[_0xf08a('0x3e')](db[_0xf08a('0x38')][_0xf08a('0x39')]);_0x508ae3[_0xf08a('0x3f')]=_[_0xf08a('0x3e')](_0x239780[_0xf08a('0x3f')]);_0x508ae3[_0xf08a('0x40')]=_[_0xf08a('0x41')](_0x508ae3[_0xf08a('0x42')],_0x508ae3[_0xf08a('0x3f')]);_0x5b83ff[_0xf08a('0x43')]=_[_0xf08a('0x41')](_0x508ae3['model'],qs[_0xf08a('0x44')](_0x239780[_0xf08a('0x3f')]['fields']));_0x5b83ff[_0xf08a('0x43')]=_0x5b83ff[_0xf08a('0x43')][_0xf08a('0x45')]?_0x5b83ff[_0xf08a('0x43')]:_0x508ae3[_0xf08a('0x42')];if(_0x239780[_0xf08a('0x3f')][_0xf08a('0x4c')]){_0x5b83ff['include']=[{'all':!![]}];}_0x5b83ff=_[_0xf08a('0x51')]({},_0x5b83ff,_0x239780[_0xf08a('0x52')]);return db[_0xf08a('0x38')][_0xf08a('0x53')](_0x5b83ff)[_0xf08a('0x1c')](handleEntityNotFound(_0x140fcf,null))[_0xf08a('0x1c')](respondWithResult(_0x140fcf,null))[_0xf08a('0x25')](handleError(_0x140fcf,null));};exports['create']=function(_0x1669e4,_0x41a461){return db[_0xf08a('0x38')]['create'](_0x1669e4['body'],{})[_0xf08a('0x1c')](function(_0x228a58){var _0xc18b28=_0x1669e4[_0xf08a('0x54')]['get']({'plain':!![]});if(!_0xc18b28)throw new Error(_0xf08a('0x55'));if(_0xc18b28['role']==='user'){var _0x475419=_0x228a58[_0xf08a('0x56')]({'plain':!![]});var _0x2d6c08=_0xf08a('0x33');return db[_0xf08a('0x57')]['find']({'where':{'name':_0x2d6c08,'userProfileId':_0xc18b28[_0xf08a('0x58')]},'raw':!![]})[_0xf08a('0x1c')](function(_0x487e65){if(_0x487e65&&_0x487e65[_0xf08a('0x59')]===0x0){return db['UserProfileResource'][_0xf08a('0x5a')]({'name':_0x475419['name'],'resourceId':_0x475419['id'],'type':_0x487e65[_0xf08a('0x36')],'sectionId':_0x487e65['id']},{})['then'](function(){return _0x228a58;});}else{return _0x228a58;}})[_0xf08a('0x25')](function(_0x5808d7){logger['error'](_0xf08a('0x5b'),_0x5808d7);throw _0x5808d7;});}return _0x228a58;})[_0xf08a('0x1c')](respondWithResult(_0x41a461,0xc9))[_0xf08a('0x25')](handleError(_0x41a461,null));};exports['update']=function(_0x2bdb7f,_0x5e12a1){if(_0x2bdb7f[_0xf08a('0x5c')]['id']){delete _0x2bdb7f['body']['id'];}return db[_0xf08a('0x38')][_0xf08a('0x53')]({'where':{'id':_0x2bdb7f[_0xf08a('0x5d')]['id']},'include':[{'model':db[_0xf08a('0x37')],'as':_0xf08a('0x50')}]})[_0xf08a('0x1c')](handleEntityNotFound(_0x5e12a1,null))[_0xf08a('0x1c')](saveUpdates(_0x2bdb7f['body'],null))[_0xf08a('0x1c')](respondWithResult(_0x5e12a1,null))[_0xf08a('0x25')](handleError(_0x5e12a1,null));};exports[_0xf08a('0x34')]=function(_0x271b2f,_0x4a576a){return db['WhatsappAccount'][_0xf08a('0x53')]({'where':{'id':_0x271b2f['params']['id']}})['then'](handleEntityNotFound(_0x4a576a,null))[_0xf08a('0x1c')](removeEntity(_0x4a576a,null))[_0xf08a('0x25')](handleError(_0x4a576a,null));};exports['describe']=function(_0x3cd47b,_0x1057c8){return db['WhatsappAccount'][_0xf08a('0x5e')]()['then'](respondWithResult(_0x1057c8,null))[_0xf08a('0x25')](handleError(_0x1057c8,null));};exports[_0xf08a('0x5f')]=function(_0x31921c,_0x24c6a3,_0x185cf2){if(_0x31921c[_0xf08a('0x5c')]['id']){delete _0x31921c[_0xf08a('0x5c')]['id'];}return db[_0xf08a('0x38')][_0xf08a('0x53')]({'where':{'id':_0x31921c[_0xf08a('0x5d')]['id']}})[_0xf08a('0x1c')](handleEntityNotFound(_0x24c6a3,null))['then'](function(_0x2ab1b2){if(_0x2ab1b2){_0x31921c[_0xf08a('0x5c')][_0xf08a('0x60')]=_0x2ab1b2['id'];return db[_0xf08a('0x61')][_0xf08a('0x5a')](_0x31921c[_0xf08a('0x5c')]);}})['then'](respondWithResult(_0x24c6a3,null))[_0xf08a('0x25')](handleError(_0x24c6a3,null));};exports[_0xf08a('0x62')]=function(_0x1c6bbd,_0x2540b3,_0x1d6db5){var _0x530bec={'raw':![],'where':{}};var _0x33c7de={};var _0x5e3f86={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xf08a('0x63')]({'where':{'id':_0x1c6bbd['params']['id']}})[_0xf08a('0x1c')](handleEntityNotFound(_0x2540b3,null))[_0xf08a('0x1c')](function(_0x296a70){if(_0x296a70){_0x33c7de['model']=_[_0xf08a('0x3e')](db['Disposition'][_0xf08a('0x39')]);_0x33c7de['query']=_[_0xf08a('0x3e')](_0x1c6bbd[_0xf08a('0x3f')]);_0x33c7de[_0xf08a('0x40')]=_[_0xf08a('0x41')](_0x33c7de[_0xf08a('0x42')],_0x33c7de[_0xf08a('0x3f')]);_0x530bec[_0xf08a('0x43')]=_['intersection'](_0x33c7de['model'],qs[_0xf08a('0x44')](_0x1c6bbd[_0xf08a('0x3f')][_0xf08a('0x44')]));_0x530bec[_0xf08a('0x43')]=_0x530bec[_0xf08a('0x43')]['length']?_0x530bec['attributes']:_0x33c7de[_0xf08a('0x42')];if(!_0x1c6bbd[_0xf08a('0x3f')][_0xf08a('0x46')](_0xf08a('0x47'))){_0x530bec['limit']=qs[_0xf08a('0x2b')](_0x1c6bbd[_0xf08a('0x3f')][_0xf08a('0x2b')]);_0x530bec[_0xf08a('0x2a')]=qs[_0xf08a('0x2a')](_0x1c6bbd[_0xf08a('0x3f')][_0xf08a('0x2a')]);}_0x530bec[_0xf08a('0x64')]=qs['sort'](_0x1c6bbd[_0xf08a('0x3f')][_0xf08a('0x48')]);_0x530bec['where']=qs['filters'](_[_0xf08a('0x4a')](_0x1c6bbd[_0xf08a('0x3f')],_0x33c7de['filters']));_0x530bec[_0xf08a('0x49')][_0xf08a('0x60')]=_0x296a70['id'];if(_0x1c6bbd['query'][_0xf08a('0x4b')]){_0x530bec['where']=_['merge'](_0x530bec['where'],{'$or':_[_0xf08a('0x3d')](_0x530bec[_0xf08a('0x43')],function(_0xd517e3){var _0x1fb791={};_0x1fb791[_0xd517e3]={'$like':'%'+_0x1c6bbd[_0xf08a('0x3f')][_0xf08a('0x4b')]+'%'};return _0x1fb791;})});}_0x530bec=_['merge']({},_0x530bec,_0x1c6bbd['options']);return db[_0xf08a('0x61')][_0xf08a('0x2d')]({'where':_0x530bec[_0xf08a('0x49')]})['then'](function(_0x55416e){_0x5e3f86[_0xf08a('0x2d')]=_0x55416e;if(_0x1c6bbd['query'][_0xf08a('0x4c')]){_0x530bec[_0xf08a('0x4d')]=[{'all':!![]}];}return db[_0xf08a('0x61')]['findAll'](_0x530bec);})['then'](function(_0x3b73c0){_0x5e3f86[_0xf08a('0x4e')]=_0x3b73c0;return _0x5e3f86;});}})[_0xf08a('0x1c')](respondWithFilteredResult(_0x2540b3,_0x530bec))[_0xf08a('0x25')](handleError(_0x2540b3,null));};exports['removeDispositions']=function(_0x27d13d,_0x4e350e,_0x122fc3){return db[_0xf08a('0x38')][_0xf08a('0x53')]({'where':{'id':_0x27d13d[_0xf08a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4e350e,null))[_0xf08a('0x1c')](function(_0x5c4916){if(_0x5c4916){return _0x5c4916[_0xf08a('0x65')](_0x27d13d[_0xf08a('0x3f')]['ids']);}})[_0xf08a('0x1c')](respondWithStatusCode(_0x4e350e,null))[_0xf08a('0x25')](handleError(_0x4e350e,null));};exports[_0xf08a('0x66')]=function(_0x3d3364,_0x2d3ddc,_0x24b35a){if(_0x3d3364[_0xf08a('0x5c')]['id']){delete _0x3d3364[_0xf08a('0x5c')]['id'];}return db[_0xf08a('0x38')][_0xf08a('0x53')]({'where':{'id':_0x3d3364[_0xf08a('0x5d')]['id']}})[_0xf08a('0x1c')](handleEntityNotFound(_0x2d3ddc,null))['then'](function(_0x533409){if(_0x533409){_0x3d3364[_0xf08a('0x5c')][_0xf08a('0x60')]=_0x533409['id'];return db[_0xf08a('0x67')][_0xf08a('0x5a')](_0x3d3364['body']);}})['then'](respondWithResult(_0x2d3ddc,null))[_0xf08a('0x25')](handleError(_0x2d3ddc,null));};exports[_0xf08a('0x68')]=function(_0x252424,_0x297a5a,_0x2daa6d){var _0x49e34c={'raw':![],'where':{}};var _0xa96538={};var _0x553f56={'count':0x0,'rows':[]};return db[_0xf08a('0x38')][_0xf08a('0x63')]({'where':{'id':_0x252424[_0xf08a('0x5d')]['id']}})[_0xf08a('0x1c')](handleEntityNotFound(_0x297a5a,null))[_0xf08a('0x1c')](function(_0x144cb8){if(_0x144cb8){_0xa96538[_0xf08a('0x42')]=_[_0xf08a('0x3e')](db['CannedAnswer'][_0xf08a('0x39')]);_0xa96538[_0xf08a('0x3f')]=_[_0xf08a('0x3e')](_0x252424['query']);_0xa96538[_0xf08a('0x40')]=_[_0xf08a('0x41')](_0xa96538[_0xf08a('0x42')],_0xa96538['query']);_0x49e34c[_0xf08a('0x43')]=_['intersection'](_0xa96538[_0xf08a('0x42')],qs[_0xf08a('0x44')](_0x252424[_0xf08a('0x3f')][_0xf08a('0x44')]));_0x49e34c[_0xf08a('0x43')]=_0x49e34c['attributes']['length']?_0x49e34c['attributes']:_0xa96538['model'];if(!_0x252424[_0xf08a('0x3f')]['hasOwnProperty'](_0xf08a('0x47'))){_0x49e34c['limit']=qs[_0xf08a('0x2b')](_0x252424[_0xf08a('0x3f')][_0xf08a('0x2b')]);_0x49e34c[_0xf08a('0x2a')]=qs[_0xf08a('0x2a')](_0x252424['query'][_0xf08a('0x2a')]);}_0x49e34c['order']=qs[_0xf08a('0x48')](_0x252424[_0xf08a('0x3f')]['sort']);_0x49e34c[_0xf08a('0x49')]=qs['filters'](_['pick'](_0x252424[_0xf08a('0x3f')],_0xa96538[_0xf08a('0x40')]));_0x49e34c[_0xf08a('0x49')]['WhatsappAccountId']=_0x144cb8['id'];if(_0x252424[_0xf08a('0x3f')]['filter']){_0x49e34c[_0xf08a('0x49')]=_['merge'](_0x49e34c[_0xf08a('0x49')],{'$or':_[_0xf08a('0x3d')](_0x49e34c[_0xf08a('0x43')],function(_0x4cdc0f){var _0x2c71e9={};_0x2c71e9[_0x4cdc0f]={'$like':'%'+_0x252424[_0xf08a('0x3f')][_0xf08a('0x4b')]+'%'};return _0x2c71e9;})});}_0x49e34c=_[_0xf08a('0x51')]({},_0x49e34c,_0x252424[_0xf08a('0x52')]);return db[_0xf08a('0x67')][_0xf08a('0x2d')]({'where':_0x49e34c[_0xf08a('0x49')]})[_0xf08a('0x1c')](function(_0x7781a2){_0x553f56[_0xf08a('0x2d')]=_0x7781a2;if(_0x252424[_0xf08a('0x3f')][_0xf08a('0x4c')]){_0x49e34c['include']=[{'all':!![]}];}return db[_0xf08a('0x67')][_0xf08a('0x69')](_0x49e34c);})['then'](function(_0x1845e8){_0x553f56[_0xf08a('0x4e')]=_0x1845e8;return _0x553f56;});}})['then'](respondWithFilteredResult(_0x297a5a,_0x49e34c))[_0xf08a('0x25')](handleError(_0x297a5a,null));};exports[_0xf08a('0x6a')]=function(_0x405475,_0x32f21d,_0x13d6b8){return db[_0xf08a('0x38')][_0xf08a('0x53')]({'where':{'id':_0x405475[_0xf08a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x32f21d,null))[_0xf08a('0x1c')](function(_0x1325e7){if(_0x1325e7){return _0x1325e7[_0xf08a('0x6a')](_0x405475[_0xf08a('0x3f')][_0xf08a('0x6b')]);}})['then'](respondWithStatusCode(_0x32f21d,null))['catch'](handleError(_0x32f21d,null));};exports[_0xf08a('0x6c')]=function(_0x1ff613,_0x354b8d,_0x2bf955){return db['WhatsappAccount'][_0xf08a('0x53')]({'where':{'id':_0x1ff613[_0xf08a('0x5d')]['id']}})[_0xf08a('0x1c')](handleEntityNotFound(_0x354b8d,null))['then'](function(_0x23cc6f){if(_0x23cc6f){return _0x23cc6f[_0xf08a('0x6c')](_0x1ff613[_0xf08a('0x5c')][_0xf08a('0x6b')],_[_0xf08a('0x6d')](_0x1ff613[_0xf08a('0x5c')],[_0xf08a('0x6b'),'id'])||{})[_0xf08a('0x6e')](function(_0x1b57ba){for(var _0x450cea=0x0;_0x450cea<_0x1ff613[_0xf08a('0x5c')][_0xf08a('0x6b')][_0xf08a('0x45')];_0x450cea+=0x1){socket[_0xf08a('0x6f')](_0xf08a('0x70'),{'UserId':Number(_0x1ff613[_0xf08a('0x5c')]['ids'][_0x450cea]),'WhatsappAccountId':Number(_0x1ff613[_0xf08a('0x5d')]['id'])});}return _0x1b57ba;});}})[_0xf08a('0x1c')](respondWithResult(_0x354b8d,null))[_0xf08a('0x25')](handleError(_0x354b8d,null));};exports[_0xf08a('0x71')]=function(_0x3de63b,_0x4605dc,_0x21fc9e){return db[_0xf08a('0x38')][_0xf08a('0x53')]({'where':{'id':_0x3de63b[_0xf08a('0x5d')]['id']}})[_0xf08a('0x1c')](handleEntityNotFound(_0x4605dc,null))['then'](function(_0x39aea4){if(_0x39aea4){return _0x39aea4[_0xf08a('0x71')](_0x3de63b['query'][_0xf08a('0x6b')])['then'](function(){if(_[_0xf08a('0x72')](_0x3de63b[_0xf08a('0x3f')][_0xf08a('0x6b')])){for(var _0x4dd07c=0x0;_0x4dd07c<_0x3de63b['query'][_0xf08a('0x6b')][_0xf08a('0x45')];_0x4dd07c+=0x1){socket[_0xf08a('0x6f')](_0xf08a('0x73'),{'UserId':Number(_0x3de63b[_0xf08a('0x3f')]['ids'][_0x4dd07c]),'WhatsappAccountId':Number(_0x3de63b[_0xf08a('0x5d')]['id'])});}}else{socket[_0xf08a('0x6f')](_0xf08a('0x73'),{'UserId':Number(_0x3de63b[_0xf08a('0x3f')]['ids']),'WhatsappAccountId':Number(_0x3de63b[_0xf08a('0x5d')]['id'])});}});}})[_0xf08a('0x1c')](respondWithStatusCode(_0x4605dc,null))[_0xf08a('0x25')](handleError(_0x4605dc,null));};exports['getAgents']=function(_0x5d0600,_0xcc09ff,_0x523808){var _0x3529b5={};var _0x5f0bcd={};var _0x2cdff6;var _0xedbca4;return db[_0xf08a('0x38')]['findOne']({'where':{'id':_0x5d0600[_0xf08a('0x5d')]['id']}})['then'](handleEntityNotFound(_0xcc09ff,null))[_0xf08a('0x1c')](function(_0xaa4b6f){if(_0xaa4b6f){_0x2cdff6=_0xaa4b6f;_0x5f0bcd[_0xf08a('0x42')]=_[_0xf08a('0x3e')](db['User'][_0xf08a('0x39')]);_0x5f0bcd[_0xf08a('0x3f')]=_[_0xf08a('0x3e')](_0x5d0600[_0xf08a('0x3f')]);_0x5f0bcd[_0xf08a('0x40')]=_[_0xf08a('0x41')](_0x5f0bcd['model'],_0x5f0bcd[_0xf08a('0x3f')]);_0x3529b5['attributes']=_['intersection'](_0x5f0bcd[_0xf08a('0x42')],qs['fields'](_0x5d0600['query'][_0xf08a('0x44')]));_0x3529b5[_0xf08a('0x43')]=_0x3529b5[_0xf08a('0x43')]['length']?_0x3529b5[_0xf08a('0x43')]:_0x5f0bcd['model'];_0x3529b5[_0xf08a('0x64')]=qs['sort'](_0x5d0600['query'][_0xf08a('0x48')]);_0x3529b5[_0xf08a('0x49')]=qs[_0xf08a('0x40')](_[_0xf08a('0x4a')](_0x5d0600[_0xf08a('0x3f')],_0x5f0bcd[_0xf08a('0x40')]));if(_0x5d0600[_0xf08a('0x3f')]['filter']){_0x3529b5[_0xf08a('0x49')]=_[_0xf08a('0x51')](_0x3529b5[_0xf08a('0x49')],{'$or':_['map'](_0x3529b5['attributes'],function(_0x5983a2){var _0x358ef5={};_0x358ef5[_0x5983a2]={'$like':'%'+_0x5d0600[_0xf08a('0x3f')][_0xf08a('0x4b')]+'%'};return _0x358ef5;})});}_0x3529b5=_['merge']({},_0x3529b5,_0x5d0600[_0xf08a('0x52')]);return _0x2cdff6[_0xf08a('0x74')](_0x3529b5);}})['then'](function(_0x59ec23){if(_0x59ec23){_0xedbca4=_0x59ec23['length'];if(!_0x5d0600[_0xf08a('0x3f')]['hasOwnProperty']('nolimit')){_0x3529b5[_0xf08a('0x2b')]=qs[_0xf08a('0x2b')](_0x5d0600[_0xf08a('0x3f')]['limit']);_0x3529b5[_0xf08a('0x2a')]=qs[_0xf08a('0x2a')](_0x5d0600[_0xf08a('0x3f')][_0xf08a('0x2a')]);}return _0x2cdff6['getAgents'](_0x3529b5);}})[_0xf08a('0x1c')](function(_0x3053a7){if(_0x3053a7){return _0x3053a7?{'count':_0xedbca4,'rows':_0x3053a7}:null;}})[_0xf08a('0x1c')](respondWithResult(_0xcc09ff,null))['catch'](handleError(_0xcc09ff,null));};exports[_0xf08a('0x75')]=function(_0x19af56,_0x144642){var _0x876f09=_0x19af56['params']['id'];var _0x504306=_0x19af56['body'];var _0x1b966c=0xc8;var _0x264adb=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xf08a('0x76')][_0xf08a('0x77')][_0xf08a('0x78')][_0xf08a('0x79')]},function(_0x34d812){return db['WhatsappAccount'][_0xf08a('0x63')]({'where':{'id':_0x876f09},'transaction':_0x34d812})['then'](function(_0xfd4442){if(_0xfd4442){return db[_0xf08a('0x7a')]['destroy']({'where':{'WhatsappAccountId':_0x876f09},'transaction':_0x34d812})['then'](function(){var _0x17f706=_[_0xf08a('0x3d')](_0x504306,function(_0x37c873){_0x37c873[_0xf08a('0x60')]=_0x876f09;return _0x37c873;});return db['WhatsappApplication'][_0xf08a('0x7b')](_0x17f706,{'transaction':_0x34d812});});}else{_0x1b966c=0x194;_0x264adb=[];}});})[_0xf08a('0x1c')](function(){if(_0x1b966c!==0x194){return db[_0xf08a('0x7a')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x876f09},'order':_0xf08a('0x7c')})[_0xf08a('0x1c')](function(_0x3e5922){_0x264adb=_0x3e5922;});}})[_0xf08a('0x25')](function(_0x255a77){_0x1b966c=0x1f4;logger[_0xf08a('0x21')](_0x255a77[_0xf08a('0x35')]);if(_0x255a77[_0xf08a('0x36')]){delete _0x255a77[_0xf08a('0x36')];}_0x264adb=_0x255a77;})[_0xf08a('0x7d')](function(){if(_0x264adb===null){_0x144642[_0xf08a('0x26')](_0x1b966c);}else{if(_0x1b966c===0x1f4){_0x144642['status'](_0x1b966c)[_0xf08a('0x7e')](_0x264adb);}else{_0x144642['status'](_0x1b966c)[_0xf08a('0x29')](_0x264adb);}}});};exports[_0xf08a('0x7f')]=function(_0x82f4b,_0x1b53ad,_0x3bc71a){var _0x4011e0={};var _0x1e8671={};var _0x5c203a;var _0x3602e8;return db['WhatsappAccount'][_0xf08a('0x63')]({'where':{'id':_0x82f4b['params']['id']}})[_0xf08a('0x1c')](handleEntityNotFound(_0x1b53ad,null))[_0xf08a('0x1c')](function(_0x6b9160){if(_0x6b9160){_0x5c203a=_0x6b9160;_0x1e8671[_0xf08a('0x42')]=_['keys'](db[_0xf08a('0x7a')][_0xf08a('0x39')]);_0x1e8671[_0xf08a('0x3f')]=_[_0xf08a('0x3e')](_0x82f4b[_0xf08a('0x3f')]);_0x1e8671[_0xf08a('0x40')]=_[_0xf08a('0x41')](_0x1e8671[_0xf08a('0x42')],_0x1e8671[_0xf08a('0x3f')]);_0x4011e0['attributes']=_[_0xf08a('0x41')](_0x1e8671[_0xf08a('0x42')],qs[_0xf08a('0x44')](_0x82f4b['query']['fields']));_0x4011e0[_0xf08a('0x43')]=_0x4011e0[_0xf08a('0x43')][_0xf08a('0x45')]?_0x4011e0['attributes']:_0x1e8671[_0xf08a('0x42')];_0x4011e0[_0xf08a('0x64')]=qs['sort'](_0x82f4b[_0xf08a('0x3f')][_0xf08a('0x48')]);_0x4011e0[_0xf08a('0x49')]=qs[_0xf08a('0x40')](_[_0xf08a('0x4a')](_0x82f4b['query'],_0x1e8671['filters']));if(_0x82f4b[_0xf08a('0x3f')][_0xf08a('0x4b')]){_0x4011e0[_0xf08a('0x49')]=_[_0xf08a('0x51')](_0x4011e0['where'],{'$or':_[_0xf08a('0x3d')](_0x4011e0[_0xf08a('0x43')],function(_0x482184){var _0x3f6add={};_0x3f6add[_0x482184]={'$like':'%'+_0x82f4b[_0xf08a('0x3f')][_0xf08a('0x4b')]+'%'};return _0x3f6add;})});}_0x4011e0=_['merge']({},_0x4011e0,_0x82f4b['options']);return _0x5c203a['getApplications'](_0x4011e0);}})[_0xf08a('0x1c')](function(_0x38e6f8){if(_0x38e6f8){_0x3602e8=_0x38e6f8['length'];if(!_0x82f4b['query'][_0xf08a('0x46')]('nolimit')){_0x4011e0[_0xf08a('0x2b')]=qs[_0xf08a('0x2b')](_0x82f4b[_0xf08a('0x3f')][_0xf08a('0x2b')]);_0x4011e0[_0xf08a('0x2a')]=qs[_0xf08a('0x2a')](_0x82f4b['query']['offset']);}return _0x5c203a[_0xf08a('0x7f')](_0x4011e0);}})['then'](function(_0x5b109d){if(_0x5b109d){return _0x5b109d?{'count':_0x3602e8,'rows':_0x5b109d}:null;}})['then'](respondWithResult(_0x1b53ad,null))['catch'](handleError(_0x1b53ad,null));};exports[_0xf08a('0x80')]=function(_0x2e74e9,_0x9907f0,_0x5a5c66){var _0x14dc96={'channel':_0xf08a('0x81')};var _0x44eb5e=[];var _0x452493=[];var _0x8e06de={};return db[_0xf08a('0x38')][_0xf08a('0x53')]({'where':{'id':_0x2e74e9[_0xf08a('0x5d')]['id']},'include':[{'model':db[_0xf08a('0x7a')],'as':_0xf08a('0x82')}]})[_0xf08a('0x1c')](handleEntityNotFound(_0x9907f0,null))['then'](function(_0x4167d8){_0x14dc96[_0xf08a('0x83')]=_0x4167d8;if(_0x14dc96[_0xf08a('0x83')]&&_0x14dc96['account'][_0xf08a('0x3b')]===_0xf08a('0x84')&&_0x2e74e9[_0xf08a('0x5c')][_0xf08a('0x85')]){if(_0x2e74e9['body']['statuses'][_0xf08a('0x45')]===0x0)return;if(_0x2e74e9['body']['statuses'][0x0][_0xf08a('0x86')]!==_0xf08a('0x87'))return;return db[_0xf08a('0x88')][_0xf08a('0x32')]({'read':!![],'readAt':_0x2e74e9[_0xf08a('0x5c')][_0xf08a('0x85')][0x0][_0xf08a('0x89')]},{'where':{'messageId':_0x2e74e9[_0xf08a('0x5c')][_0xf08a('0x85')][0x0][_0xf08a('0x8a')]},'individualHooks':!![]})['then'](function(_0x243e77){return _0x9907f0[_0xf08a('0x27')](0xc8)[_0xf08a('0x29')](_0x243e77);});}_0x14dc96[_0xf08a('0x8b')]=_[_0xf08a('0x8c')](_0x4167d8[_0xf08a('0x82')],['priority'],[_0xf08a('0x8d')]);if(_0x14dc96[_0xf08a('0x83')]['Applications']){delete _0x14dc96['account']['Applications'];}return db[_0xf08a('0x8e')]['describe']()['then'](function(_0x37d31e){if(!_0x37d31e){throw new db['Sequelize'][(_0xf08a('0x8f'))](_0xf08a('0x90'));}_0x44eb5e=_['difference'](_[_0xf08a('0x3e')](_0x37d31e),[_0xf08a('0x91'),_0xf08a('0x92')]);_0x452493=_[_0xf08a('0x93')](_[_0xf08a('0x3e')](_0x37d31e),['createdAt',_0xf08a('0x92'),_0xf08a('0x94'),_0xf08a('0x95')]);_0x14dc96[_0xf08a('0x5c')]={'mapKey':_0xf08a('0x96')};if(_0x14dc96[_0xf08a('0x83')]&&_0x14dc96[_0xf08a('0x83')][_0xf08a('0x3b')]===_0xf08a('0x97')){_0x14dc96[_0xf08a('0x5c')]['from']=_0x2e74e9[_0xf08a('0x5c')][_0xf08a('0x98')][_0xf08a('0x99')]('whatsapp:','');_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x5c')]=_0x2e74e9['body'][_0xf08a('0x9a')];_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x9b')]=_0x2e74e9[_0xf08a('0x5c')][_0xf08a('0x9c')];}if(_0x14dc96[_0xf08a('0x83')]&&_0x14dc96['account']['type']==='sinch'){_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x9d')]=_0x2e74e9[_0xf08a('0x5c')][_0xf08a('0x9e')][0x0][_0xf08a('0x9d')];_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x5c')]=_0x2e74e9[_0xf08a('0x5c')][_0xf08a('0x9e')][0x0]['message'][_0xf08a('0x5c')];_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x9b')]=_0x2e74e9[_0xf08a('0x5c')]['notifications'][0x0][_0xf08a('0x8a')];}if(_0x14dc96[_0xf08a('0x5c')]['id']){delete _0x14dc96[_0xf08a('0x5c')]['id'];}if(_['isNil'](_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x9d')])){throw new db['Sequelize'][(_0xf08a('0x8f'))](_0xf08a('0x9f'));}if(_[_0xf08a('0xa0')](_0x14dc96['body'][_0xf08a('0x5c')])||_0x14dc96[_0xf08a('0x5c')]['body']===''){throw new db[(_0xf08a('0xa1'))]['ValidationError'](_0xf08a('0xa2'));}if(_[_0xf08a('0xa0')](_0x14dc96['body'][_0xf08a('0xa3')])){throw new db[(_0xf08a('0xa1'))][(_0xf08a('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x452493);}if(!_[_0xf08a('0xa4')](_0x452493,_0x14dc96[_0xf08a('0x5c')]['mapKey'])){throw new db[(_0xf08a('0xa1'))]['ValidationError'](_0xf08a('0xa5')+_0x452493);}_0x8e06de[_0x14dc96[_0xf08a('0x5c')][_0xf08a('0xa3')]]=_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x9d')];return db[_0xf08a('0xa6')][_0xf08a('0x53')]({'where':{'id':_0x14dc96[_0xf08a('0x83')][_0xf08a('0x95')]},'include':[{'model':db[_0xf08a('0x8e')],'as':_0xf08a('0xa7'),'where':_0x8e06de,'limit':0x1,'order':[[_0xf08a('0x92'),_0xf08a('0xa8')]]}]});})[_0xf08a('0x1c')](handleEntityNotFound(_0x9907f0,null))[_0xf08a('0x1c')](function(_0x6863c3){if(_0x6863c3){_0x14dc96[_0xf08a('0xa9')]=_[_0xf08a('0x6d')](_0x6863c3,[_0xf08a('0xa7')]);if(_0x6863c3[_0xf08a('0xa7')]['length']){return _0x6863c3[_0xf08a('0xa7')][0x0];}var _0x13a6aa=_['defaults'](_0x14dc96[_0xf08a('0x5c')],{'firstName':_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x9d')],'ListId':_0x6863c3['id']});_0x13a6aa[_0x14dc96['body'][_0xf08a('0xa3')]]=_0x14dc96[_0xf08a('0x5c')]['from'];return db[_0xf08a('0x8e')][_0xf08a('0x5a')](_0x13a6aa,{'fields':_0x44eb5e,'raw':!![]});}})[_0xf08a('0x1c')](handleEntityNotFound(_0x9907f0,null))[_0xf08a('0x1c')](function(_0x1f97bf){if(_0x1f97bf){_0x14dc96['contact']=_0x1f97bf;var _0x24d661={'ContactId':_0x1f97bf['id'],'phone':_0x14dc96['body'][_0xf08a('0x9d')],'WhatsappAccountId':_0x2e74e9[_0xf08a('0x5d')]['id']};var _0x5639d3={'ContactId':_0x1f97bf['id'],'WhatsappAccountId':_0x2e74e9[_0xf08a('0x5d')]['id'],'closed':![]};return db[_0xf08a('0xaa')]['find']({'where':_0x5639d3})[_0xf08a('0x1c')](function(_0x1b90ce){if(_0x1b90ce){return[_0x1b90ce,![]];}return db[_0xf08a('0xaa')][_0xf08a('0x5a')](_0x24d661)['then'](function(_0x2e2478){return[_0x2e2478,!![]];});});}})[_0xf08a('0x6e')](function(_0x5498b1,_0x3ebdfd){_0x14dc96[_0xf08a('0xab')]=_0x5498b1[_0xf08a('0x56')]({'plain':!![]});_0x14dc96[_0xf08a('0xab')][_0xf08a('0xac')]=![];if(_0x3ebdfd){if(_0x14dc96[_0xf08a('0x83')]['autoclose']){_0x14dc96['applications'][_0xf08a('0xad')]({'id':0x0,'priority':_0x14dc96[_0xf08a('0x8b')][_0xf08a('0x45')]+0x1,'app':_0xf08a('0xae'),'appdata':_0xf08a('0xaf'),'interval':_0xf08a('0xb0')});}_0x14dc96['interaction'][_0xf08a('0xac')]=!![];}return db[_0xf08a('0x88')][_0xf08a('0x5a')]({'phone':_0x14dc96['body'][_0xf08a('0x9d')],'messageId':_0x14dc96[_0xf08a('0x5c')]['messageId'],'body':_0x14dc96[_0xf08a('0x5c')][_0xf08a('0x5c')],'WhatsappAccountId':_0x2e74e9['params']['id'],'WhatsappInteractionId':_0x5498b1['id'],'direction':'in','ContactId':_0x5498b1[_0xf08a('0xb1')],'AttachmentId':_0x14dc96[_0xf08a('0x5c')][_0xf08a('0xb2')]});})[_0xf08a('0x1c')](function(_0x337f7b){_0x14dc96[_0xf08a('0x23')]=_0x337f7b;if(_0x14dc96['interaction']['UserId']){return db[_0xf08a('0xb3')][_0xf08a('0x53')]({'attributes':['id',_0xf08a('0x36')],'where':{'id':_0x14dc96[_0xf08a('0xab')]['UserId']}})[_0xf08a('0x1c')](function(_0x327ffb){if(_0x327ffb){_0x14dc96[_0xf08a('0x8b')][_0xf08a('0xb4')]({'id':0x0,'priority':0x0,'app':_0xf08a('0xb5'),'appdata':_0x327ffb[_0xf08a('0x36')]+','+(_0x14dc96['account']['waitForTheAssignedAgent']||0xa),'interval':_0xf08a('0xb0')});}return respondWithRpcPromise(_0xf08a('0xb6'),_0xf08a('0xb7'),_0x14dc96);});}return respondWithRpcPromise(_0xf08a('0xb6'),'startRouting',_0x14dc96);})['then'](function(_0x24f958){if(_0x24f958){var _0x3d813a=0xc8;var _0x2f73cb=_0xf08a('0xb8');logger['info'](_0xf08a('0x20'),_0x2f73cb,_0x3d813a,_0xf08a('0xb9'));logger[_0xf08a('0x1f')](_0xf08a('0xba'),_0x2f73cb,_0x3d813a,_0xf08a('0xb9'),JSON[_0xf08a('0xbb')](_0x24f958));if(_0x14dc96['account'][_0xf08a('0x3b')]===_0xf08a('0x97')){return _0x9907f0['status'](_0x3d813a)[_0xf08a('0x2e')](_0xf08a('0xbc'),'text/xml')[_0xf08a('0x7e')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x9907f0[_0xf08a('0x27')](_0x3d813a)[_0xf08a('0x29')](_0x24f958);}}});})[_0xf08a('0x25')](handleError(_0x9907f0,null));};exports[_0xf08a('0x7e')]=function(_0xf252f0,_0x439acc,_0x36ebcf){var _0xe55190,_0x2078ae,_0x3499e5;if(_[_0xf08a('0xa0')](_0xf252f0[_0xf08a('0x5c')][_0xf08a('0x5c')])||_0xf252f0['body']['body']===''){throw new db[(_0xf08a('0xa1'))][(_0xf08a('0x8f'))](_0xf08a('0xa2'));}if(_[_0xf08a('0xa0')](_0xf252f0[_0xf08a('0x5c')]['to'])){throw new db[(_0xf08a('0xa1'))][(_0xf08a('0x8f'))]('to\x20is\x20mandatory');}_0xe55190=_0xf252f0[_0xf08a('0x5c')]['to'];return db[_0xf08a('0x38')][_0xf08a('0x53')]({'where':{'id':_0xf252f0['params']['id']},'include':[{'model':db[_0xf08a('0xa6')],'as':_0xf08a('0xbd'),'include':[{'model':db['CmContact'],'as':_0xf08a('0xa7'),'where':{'mobile':_0xe55190},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xf08a('0x1c')](handleEntityNotFound(_0x439acc,null))[_0xf08a('0x1c')](function(_0x58caff){if(_0x58caff&&_0x58caff[_0xf08a('0xbd')]){_0x2078ae=_0x58caff[_0xf08a('0x56')]({'plain':!![]});if(_0x2078ae[_0xf08a('0xbd')]&&_0x2078ae[_0xf08a('0xbd')][_0xf08a('0xa7')][_0xf08a('0x45')]){return _0x2078ae['List'][_0xf08a('0xa7')][0x0];}return db[_0xf08a('0x8e')][_0xf08a('0x5a')](_[_0xf08a('0x16')](_0xf252f0['body'],{'firstName':_0xe55190,'mobile':_0xe55190,'phone':_0xe55190,'ListId':_0x2078ae['ListId']}));}})['then'](handleEntityNotFound(_0x439acc,null))['then'](function(_0x4e0ac3){if(_0x4e0ac3){_0x3499e5=_0x4e0ac3;return db[_0xf08a('0xaa')][_0xf08a('0x53')]({'where':{'ContactId':_0x3499e5['id'],'closed':![],'WhatsappAccountId':_0x2078ae['id']}})[_0xf08a('0x1c')](function(_0x39c59e){if(_0x39c59e){return[_0x39c59e,![]];}return db[_0xf08a('0xaa')][_0xf08a('0x5a')]({'UserId':_0xf252f0[_0xf08a('0x54')]['id'],'ContactId':_0x3499e5['id'],'WhatsappAccountId':_0x2078ae['id'],'phone':_0xe55190,'firstMsgDirection':_0xf08a('0xbe'),'Messages':[_[_0xf08a('0x51')](_0xf252f0[_0xf08a('0x5c')],{'read':![],'body':_0xf252f0['body'][_0xf08a('0x5c')],'phone':_0xe55190,'WhatsappAccountId':_0x2078ae['id'],'UserId':_0xf252f0[_0xf08a('0x54')]['id'],'ContactId':_0x3499e5['id']})]},{'include':[{'model':db[_0xf08a('0x88')],'as':_0xf08a('0xbf')}]})[_0xf08a('0x1c')](function(_0x1a0f08){return[_0x1a0f08,!![]];});});}})[_0xf08a('0x6e')](function(_0x21528c,_0x2e2970){if(_0x2e2970){return _0x21528c;}return db[_0xf08a('0x88')][_0xf08a('0x5a')](_[_0xf08a('0x51')](_0xf252f0[_0xf08a('0x5c')],{'read':![],'body':_0xf252f0[_0xf08a('0x5c')][_0xf08a('0x5c')],'phone':_0xe55190,'WhatsappAccountId':_0x2078ae['id'],'WhatsappInteractionId':_0x21528c['id'],'UserId':_0xf252f0[_0xf08a('0x54')]['id'],'ContactId':_0x3499e5['id']}))[_0xf08a('0x1c')](function(_0x4e4ad1){_0x21528c[_0xf08a('0xc0')][_0xf08a('0xbf')]=[];_0x21528c['dataValues']['Messages']['push'](_0x4e4ad1[_0xf08a('0xc0')]);return _0x21528c;});})['then'](respondWithResult(_0x439acc,null))[_0xf08a('0x25')](handleError(_0x439acc,null));};
\ No newline at end of file
index 145d7dd..77f5c04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c20=['hasOwnProperty','events','../../mysqldb','WhatsappAccount','save','update','emit'];(function(_0x3b8ae3,_0x13a7c9){var _0x2e3e4f=function(_0x48535a){while(--_0x48535a){_0x3b8ae3['push'](_0x3b8ae3['shift']());}};_0x2e3e4f(++_0x13a7c9);}(_0x3c20,0x13c));var _0x03c2=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3c20[_0x187ee1];return _0x388160;};'use strict';var EventEmitter=require(_0x03c2('0x0'));var WhatsappAccount=require(_0x03c2('0x1'))['db'][_0x03c2('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x03c2('0x3'),'afterUpdate':_0x03c2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2084f0){return function(_0x18165f,_0x25f2a1,_0x4e554a){WhatsappAccountEvents[_0x03c2('0x5')](_0x2084f0+':'+_0x18165f['id'],_0x18165f);WhatsappAccountEvents['emit'](_0x2084f0,_0x18165f);_0x4e554a(null);};}for(var e in events){if(events[_0x03c2('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
+var _0xcc2b=['events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','hook','exports'];(function(_0x1a9c75,_0xa83750){var _0xb2f37e=function(_0x2b90f6){while(--_0x2b90f6){_0x1a9c75['push'](_0x1a9c75['shift']());}};_0xb2f37e(++_0xa83750);}(_0xcc2b,0x1e8));var _0xbcc2=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xcc2b[_0xc0a3d3];return _0x3386e8;};'use strict';var EventEmitter=require(_0xbcc2('0x0'));var WhatsappAccount=require(_0xbcc2('0x1'))['db'][_0xbcc2('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbcc2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbcc2('0x4'),'afterDestroy':_0xbcc2('0x5')};function emitEvent(_0x33b488){return function(_0x3511a6,_0x54f213,_0xc2f7f4){WhatsappAccountEvents['emit'](_0x33b488+':'+_0x3511a6['id'],_0x3511a6);WhatsappAccountEvents['emit'](_0x33b488,_0x3511a6);_0xc2f7f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xbcc2('0x6')](e,emitEvent(event));}}module[_0xbcc2('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
index 6e6afce..7cb19cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65e6=['./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0xdcf45e,_0x114dd6){var _0x57d04b=function(_0x11d907){while(--_0x11d907){_0xdcf45e['push'](_0xdcf45e['shift']());}};_0x57d04b(++_0x114dd6);}(_0x65e6,0xc4));var _0x665e=function(_0x2f192f,_0x18b0c2){_0x2f192f=_0x2f192f-0x0;var _0x461230=_0x65e6[_0x2f192f];return _0x461230;};'use strict';var _=require(_0x665e('0x0'));var util=require(_0x665e('0x1'));var logger=require(_0x665e('0x2'))(_0x665e('0x3'));var moment=require(_0x665e('0x4'));var BPromise=require(_0x665e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x665e('0x6'));var rimraf=require('rimraf');var config=require(_0x665e('0x7'));var attributes=require(_0x665e('0x8'));module['exports']=function(_0x44e02f,_0x9b8b95){return _0x44e02f[_0x665e('0x9')](_0x665e('0xa'),attributes,{'tableName':_0x665e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfca9=['WhatsappAccount','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','define'];(function(_0x31fe44,_0x33271b){var _0x424745=function(_0x1e5b97){while(--_0x1e5b97){_0x31fe44['push'](_0x31fe44['shift']());}};_0x424745(++_0x33271b);}(_0xfca9,0xbc));var _0x9fca=function(_0x57417e,_0xa8f133){_0x57417e=_0x57417e-0x0;var _0x356fca=_0xfca9[_0x57417e];return _0x356fca;};'use strict';var _=require(_0x9fca('0x0'));var util=require(_0x9fca('0x1'));var logger=require('../../config/logger')(_0x9fca('0x2'));var moment=require(_0x9fca('0x3'));var BPromise=require(_0x9fca('0x4'));var rp=require(_0x9fca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fca('0x6'));var config=require(_0x9fca('0x7'));var attributes=require(_0x9fca('0x8'));module['exports']=function(_0x210f08,_0x395704){return _0x210f08[_0x9fca('0x9')](_0x9fca('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c46697e..de9e932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdae9=['client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','model','map','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17ab63,_0x2a23fd){var _0x1c7015=function(_0x3b8447){while(--_0x3b8447){_0x17ab63['push'](_0x17ab63['shift']());}};_0x1c7015(++_0x2a23fd);}(_0xdae9,0x182));var _0x9dae=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0xdae9[_0x361d3f];return _0x320229;};'use strict';var _=require('lodash');var util=require(_0x9dae('0x0'));var moment=require(_0x9dae('0x1'));var BPromise=require('bluebird');var rs=require(_0x9dae('0x2'));var fs=require('fs');var Redis=require(_0x9dae('0x3'));var db=require(_0x9dae('0x4'))['db'];var utils=require(_0x9dae('0x5'));var logger=require(_0x9dae('0x6'))(_0x9dae('0x7'));var config=require(_0x9dae('0x8'));var jayson=require(_0x9dae('0x9'));var client=jayson[_0x9dae('0xa')][_0x9dae('0xb')]({'port':0x232a});config[_0x9dae('0xc')]=_['defaults'](config[_0x9dae('0xc')],{'host':_0x9dae('0xd'),'port':0x18eb});var socket=require(_0x9dae('0xe'))(new Redis(config[_0x9dae('0xc')]));require(_0x9dae('0xf'))['register'](socket);function respondWithRpcPromise(_0x23cc7b,_0x24b2fd,_0xc62780){return new BPromise(function(_0x466e73,_0x421004){return client[_0x9dae('0x10')](_0x23cc7b,_0xc62780)[_0x9dae('0x11')](function(_0x26d7a3){logger[_0x9dae('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x24b2fd,_0x9dae('0x13'));logger['debug'](_0x9dae('0x14'),_0x24b2fd,_0x9dae('0x13'),JSON['stringify'](_0x26d7a3));if(_0x26d7a3[_0x9dae('0x15')]){if(_0x26d7a3[_0x9dae('0x15')][_0x9dae('0x16')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x24b2fd,_0x26d7a3['error'][_0x9dae('0x17')]);return _0x421004(_0x26d7a3[_0x9dae('0x15')][_0x9dae('0x17')]);}logger[_0x9dae('0x15')](_0x9dae('0x18'),_0x24b2fd,_0x26d7a3[_0x9dae('0x15')][_0x9dae('0x17')]);return _0x466e73(_0x26d7a3[_0x9dae('0x15')][_0x9dae('0x17')]);}else{logger[_0x9dae('0x12')](_0x9dae('0x18'),_0x24b2fd,_0x9dae('0x13'));_0x466e73(_0x26d7a3[_0x9dae('0x19')][_0x9dae('0x17')]);}})['catch'](function(_0x5ae67f){logger[_0x9dae('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x24b2fd,_0x5ae67f);_0x421004(_0x5ae67f);});});}exports[_0x9dae('0x1a')]=function(_0x102032){var _0x21ec82=this;return new Promise(function(_0x3dc267,_0x394f31){return db[_0x9dae('0x1b')][_0x9dae('0x1c')]({'raw':_0x102032[_0x9dae('0x1d')]?_0x102032[_0x9dae('0x1d')][_0x9dae('0x1e')]===undefined?!![]:![]:!![],'where':_0x102032[_0x9dae('0x1d')]?_0x102032[_0x9dae('0x1d')][_0x9dae('0x1f')]||null:null,'attributes':_0x102032[_0x9dae('0x1d')]?_0x102032['options'][_0x9dae('0x20')]||null:null,'include':_0x102032[_0x9dae('0x1d')]?_0x102032[_0x9dae('0x1d')][_0x9dae('0x21')]?_['map'](_0x102032[_0x9dae('0x1d')][_0x9dae('0x21')],function(_0x189b17){return{'model':db[_0x189b17[_0x9dae('0x22')]],'as':_0x189b17['as'],'attributes':_0x189b17[_0x9dae('0x20')],'include':_0x189b17[_0x9dae('0x21')]?_[_0x9dae('0x23')](_0x189b17['include'],function(_0x7b2d15){return{'model':db[_0x7b2d15['model']],'as':_0x7b2d15['as'],'attributes':_0x7b2d15['attributes'],'include':_0x7b2d15[_0x9dae('0x21')]?_['map'](_0x7b2d15[_0x9dae('0x21')],function(_0x4d8b2a){return{'model':db[_0x4d8b2a[_0x9dae('0x22')]],'as':_0x4d8b2a['as'],'attributes':_0x4d8b2a[_0x9dae('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9dae('0x11')](function(_0x39c662){logger[_0x9dae('0x12')](_0x9dae('0x1a'),_0x102032);logger['debug'](_0x9dae('0x1a'),_0x102032,JSON['stringify'](_0x39c662));_0x3dc267(_0x39c662);})['catch'](function(_0x9632fc){logger['error'](_0x9dae('0x1a'),_0x9632fc[_0x9dae('0x17')],_0x102032);_0x394f31(_0x21ec82[_0x9dae('0x15')](0x1f4,_0x9632fc[_0x9dae('0x17')]));});});};
\ No newline at end of file
+var _0x6069=['rpc','../../config/environment','jayson/promise','client','defaults','redis','./whatsappAccount.socket','register','request','then','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','WhatsappAccount','find','options','raw','where','attributes','map','include','model','info','debug','ShowWhatsappAccount','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x6069,0x1c1));var _0x9606=function(_0x173ac2,_0x3eed2d){_0x173ac2=_0x173ac2-0x0;var _0x37ba89=_0x6069[_0x173ac2];return _0x37ba89;};'use strict';var _=require(_0x9606('0x0'));var util=require(_0x9606('0x1'));var moment=require('moment');var BPromise=require(_0x9606('0x2'));var rs=require(_0x9606('0x3'));var fs=require('fs');var Redis=require(_0x9606('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9606('0x5'));var logger=require(_0x9606('0x6'))(_0x9606('0x7'));var config=require(_0x9606('0x8'));var jayson=require(_0x9606('0x9'));var client=jayson[_0x9606('0xa')]['http']({'port':0x232a});config['redis']=_[_0x9606('0xb')](config[_0x9606('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9606('0xc')]));require(_0x9606('0xd'))[_0x9606('0xe')](socket);function respondWithRpcPromise(_0x282146,_0x108904,_0x18a64d){return new BPromise(function(_0x197966,_0x3b0989){return client[_0x9606('0xf')](_0x282146,_0x18a64d)[_0x9606('0x10')](function(_0xbf8ff8){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x108904,_0x9606('0x11'));logger['debug'](_0x9606('0x12'),_0x108904,_0x9606('0x11'),JSON[_0x9606('0x13')](_0xbf8ff8));if(_0xbf8ff8[_0x9606('0x14')]){if(_0xbf8ff8[_0x9606('0x14')][_0x9606('0x15')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x108904,_0xbf8ff8[_0x9606('0x14')][_0x9606('0x16')]);return _0x3b0989(_0xbf8ff8['error'][_0x9606('0x16')]);}logger[_0x9606('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x108904,_0xbf8ff8[_0x9606('0x14')][_0x9606('0x16')]);return _0x197966(_0xbf8ff8[_0x9606('0x14')][_0x9606('0x16')]);}else{logger['info'](_0x9606('0x17'),_0x108904,_0x9606('0x11'));_0x197966(_0xbf8ff8[_0x9606('0x18')]['message']);}})['catch'](function(_0x4429f8){logger[_0x9606('0x14')](_0x9606('0x17'),_0x108904,_0x4429f8);_0x3b0989(_0x4429f8);});});}exports['ShowWhatsappAccount']=function(_0x5289ad){var _0xfc5bb2=this;return new Promise(function(_0x4af90a,_0x205a6b){return db[_0x9606('0x19')][_0x9606('0x1a')]({'raw':_0x5289ad['options']?_0x5289ad[_0x9606('0x1b')][_0x9606('0x1c')]===undefined?!![]:![]:!![],'where':_0x5289ad[_0x9606('0x1b')]?_0x5289ad['options'][_0x9606('0x1d')]||null:null,'attributes':_0x5289ad[_0x9606('0x1b')]?_0x5289ad[_0x9606('0x1b')][_0x9606('0x1e')]||null:null,'include':_0x5289ad['options']?_0x5289ad[_0x9606('0x1b')]['include']?_[_0x9606('0x1f')](_0x5289ad['options'][_0x9606('0x20')],function(_0x1e730b){return{'model':db[_0x1e730b[_0x9606('0x21')]],'as':_0x1e730b['as'],'attributes':_0x1e730b['attributes'],'include':_0x1e730b[_0x9606('0x20')]?_['map'](_0x1e730b[_0x9606('0x20')],function(_0x8b1d6c){return{'model':db[_0x8b1d6c[_0x9606('0x21')]],'as':_0x8b1d6c['as'],'attributes':_0x8b1d6c[_0x9606('0x1e')],'include':_0x8b1d6c[_0x9606('0x20')]?_[_0x9606('0x1f')](_0x8b1d6c[_0x9606('0x20')],function(_0x5384e8){return{'model':db[_0x5384e8[_0x9606('0x21')]],'as':_0x5384e8['as'],'attributes':_0x5384e8[_0x9606('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbd38d6){logger[_0x9606('0x22')]('ShowWhatsappAccount',_0x5289ad);logger[_0x9606('0x23')](_0x9606('0x24'),_0x5289ad,JSON[_0x9606('0x13')](_0xbd38d6));_0x4af90a(_0xbd38d6);})[_0x9606('0x25')](function(_0x32466e){logger[_0x9606('0x14')]('ShowWhatsappAccount',_0x32466e[_0x9606('0x16')],_0x5289ad);_0x205a6b(_0xfc5bb2[_0x9606('0x14')](0x1f4,_0x32466e['message']));});});};
\ No newline at end of file
index e6ed1c8..af87a0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4a3=['removeListener','length','whatsappAccount:','./whatsappAccount.events','save','emit'];(function(_0x62295d,_0x5d12e1){var _0x462b2b=function(_0x30bc9c){while(--_0x30bc9c){_0x62295d['push'](_0x62295d['shift']());}};_0x462b2b(++_0x5d12e1);}(_0xb4a3,0xa5));var _0x3b4a=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0xb4a3[_0x1d30a3];return _0x32bba1;};'use strict';var WhatsappAccountEvents=require(_0x3b4a('0x0'));var events=[_0x3b4a('0x1'),'remove','update'];function createListener(_0x5ac92b,_0x165cdf){return function(_0x405f64){_0x165cdf[_0x3b4a('0x2')](_0x5ac92b,_0x405f64);};}function removeListener(_0x1369ac,_0x5a1316){return function(){WhatsappAccountEvents[_0x3b4a('0x3')](_0x1369ac,_0x5a1316);};}exports['register']=function(_0x56d658){for(var _0x576696=0x0,_0x14b085=events[_0x3b4a('0x4')];_0x576696<_0x14b085;_0x576696++){var _0x5aaf9f=events[_0x576696];var _0x419711=createListener(_0x3b4a('0x5')+_0x5aaf9f,_0x56d658);WhatsappAccountEvents['on'](_0x5aaf9f,_0x419711);}};
\ No newline at end of file
+var _0xb2a8=['save','remove','emit','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x4525f7,_0x124d2d){var _0x1a9994=function(_0x27a5ff){while(--_0x27a5ff){_0x4525f7['push'](_0x4525f7['shift']());}};_0x1a9994(++_0x124d2d);}(_0xb2a8,0xd7));var _0x8b2a=function(_0x4796eb,_0x2f8389){_0x4796eb=_0x4796eb-0x0;var _0x1fb1a4=_0xb2a8[_0x4796eb];return _0x1fb1a4;};'use strict';var WhatsappAccountEvents=require(_0x8b2a('0x0'));var events=[_0x8b2a('0x1'),_0x8b2a('0x2'),'update'];function createListener(_0x5c31c5,_0x538ee3){return function(_0x474878){_0x538ee3[_0x8b2a('0x3')](_0x5c31c5,_0x474878);};}function removeListener(_0x5f2217,_0x36dd99){return function(){WhatsappAccountEvents['removeListener'](_0x5f2217,_0x36dd99);};}exports['register']=function(_0x1eb5bb){for(var _0x497b46=0x0,_0x30aa22=events[_0x8b2a('0x4')];_0x497b46<_0x30aa22;_0x497b46++){var _0x1ff93c=events[_0x497b46];var _0x3e96bd=createListener(_0x8b2a('0x5')+_0x1ff93c,_0x1eb5bb);WhatsappAccountEvents['on'](_0x1ff93c,_0x3e96bd);}};
\ No newline at end of file
index 31fbc06..51f4890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x329f=['delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','show','put','/:id','update'];(function(_0x45a11d,_0x528790){var _0x158f61=function(_0x34041a){while(--_0x34041a){_0x45a11d['push'](_0x45a11d['shift']());}};_0x158f61(++_0x528790);}(_0x329f,0x168));var _0xf329=function(_0x5576c4,_0x4f9cbf){_0x5576c4=_0x5576c4-0x0;var _0x234b3b=_0x329f[_0x5576c4];return _0x234b3b;};'use strict';var multer=require(_0xf329('0x0'));var util=require(_0xf329('0x1'));var path=require(_0xf329('0x2'));var timeout=require(_0xf329('0x3'));var express=require(_0xf329('0x4'));var router=express[_0xf329('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf329('0x6'));var config=require(_0xf329('0x7'));var controller=require('./whatsappApplication.controller');router[_0xf329('0x8')]('/',auth['isAuthenticated'](),controller[_0xf329('0x9')]);router[_0xf329('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf329('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf329('0xb')](_0xf329('0xc'),auth['isAuthenticated'](),controller[_0xf329('0xd')]);router[_0xf329('0xe')](_0xf329('0xc'),auth[_0xf329('0xf')](),controller['destroy']);module[_0xf329('0x10')]=router;
\ No newline at end of file
+var _0x238a=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','create','/:id','delete'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x238a,0xc5));var _0xa238=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0x238a[_0xc0d9bc];return _0x32ff73;};'use strict';var multer=require('multer');var util=require(_0xa238('0x0'));var path=require(_0xa238('0x1'));var timeout=require(_0xa238('0x2'));var express=require(_0xa238('0x3'));var router=express[_0xa238('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa238('0x5'));var interaction=require(_0xa238('0x6'));var config=require(_0xa238('0x7'));var controller=require(_0xa238('0x8'));router['get']('/',auth[_0xa238('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xa238('0xa')]);router['put'](_0xa238('0xb'),auth[_0xa238('0x9')](),controller['update']);router[_0xa238('0xc')](_0xa238('0xb'),auth[_0xa238('0x9')](),controller[_0xa238('0xd')]);module[_0xa238('0xe')]=router;
\ No newline at end of file
index 9be5988..2de3e80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59fb=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0xe96149,_0xa30cc1){var _0x33f44c=function(_0x2e8e03){while(--_0x2e8e03){_0xe96149['push'](_0xe96149['shift']());}};_0x33f44c(++_0xa30cc1);}(_0x59fb,0x84));var _0xb59f=function(_0x431b45,_0x40b3c8){_0x431b45=_0x431b45-0x0;var _0x21b559=_0x59fb[_0x431b45];return _0x21b559;};'use strict';var Sequelize=require('sequelize');module[_0xb59f('0x0')]={'priority':{'type':Sequelize[_0xb59f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb59f('0x2')],'allowNull':![],'defaultValue':_0xb59f('0x3')},'appdata':{'type':Sequelize[_0xb59f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb59f('0x2')],'defaultValue':_0xb59f('0x5')}};
\ No newline at end of file
+var _0x4711=['sequelize','STRING','noop'];(function(_0x35a3c6,_0x551d51){var _0x2874d3=function(_0x5e4cd0){while(--_0x5e4cd0){_0x35a3c6['push'](_0x35a3c6['shift']());}};_0x2874d3(++_0x551d51);}(_0x4711,0x111));var _0x1471=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4711[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1471('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1471('0x1')],'allowNull':![],'defaultValue':_0x1471('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1471('0x1')]},'interval':{'type':Sequelize[_0x1471('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index a76e69c..7672f26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x804d=['offset','undefined','limit','set','apply','reject','destroy','end','error','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','filter','count','includeAll','include','findAll','then','rows','catch','show','intersection','options','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x57b882,_0x492507){var _0x527f99=function(_0x4387dd){while(--_0x4387dd){_0x57b882['push'](_0x57b882['shift']());}};_0x527f99(++_0x492507);}(_0x804d,0x116));var _0xd804=function(_0x3a398f,_0x166681){_0x3a398f=_0x3a398f-0x0;var _0x24e696=_0x804d[_0x3a398f];return _0x24e696;};'use strict';var emlformat=require(_0xd804('0x0'));var rimraf=require(_0xd804('0x1'));var zipdir=require(_0xd804('0x2'));var jsonpatch=require(_0xd804('0x3'));var rp=require(_0xd804('0x4'));var moment=require(_0xd804('0x5'));var BPromise=require(_0xd804('0x6'));var Mustache=require(_0xd804('0x7'));var util=require('util');var path=require(_0xd804('0x8'));var sox=require(_0xd804('0x9'));var csv=require(_0xd804('0xa'));var ejs=require(_0xd804('0xb'));var fs=require('fs');var fs_extra=require(_0xd804('0xc'));var _=require(_0xd804('0xd'));var squel=require(_0xd804('0xe'));var crypto=require(_0xd804('0xf'));var jsforce=require(_0xd804('0x10'));var deskjs=require(_0xd804('0x11'));var toCsv=require(_0xd804('0xa'));var querystring=require(_0xd804('0x12'));var Papa=require('papaparse');var Redis=require(_0xd804('0x13'));var authService=require(_0xd804('0x14'));var qs=require(_0xd804('0x15'));var as=require(_0xd804('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd804('0x17'));var utils=require(_0xd804('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd804('0x19'));var db=require(_0xd804('0x1a'))['db'];function respondWithStatusCode(_0x4fff76,_0x1d5594){_0x1d5594=_0x1d5594||0xcc;return function(_0x2dd4e5){if(_0x2dd4e5){return _0x4fff76[_0xd804('0x1b')](_0x1d5594);}return _0x4fff76['status'](_0x1d5594)['end']();};}function respondWithResult(_0x31b189,_0x3298f5){_0x3298f5=_0x3298f5||0xc8;return function(_0xcec83){if(_0xcec83){return _0x31b189[_0xd804('0x1c')](_0x3298f5)[_0xd804('0x1d')](_0xcec83);}};}function respondWithFilteredResult(_0x5ee270,_0x18c4a0){return function(_0x30be96){if(_0x30be96){var _0x597be3=typeof _0x18c4a0[_0xd804('0x1e')]===_0xd804('0x1f')&&typeof _0x18c4a0[_0xd804('0x20')]==='undefined';var _0x335203=_0x30be96['count'];var _0x421ddb=_0x597be3?0x0:_0x18c4a0[_0xd804('0x1e')];var _0x13fa46=_0x597be3?_0x30be96['count']:_0x18c4a0[_0xd804('0x1e')]+_0x18c4a0[_0xd804('0x20')];var _0x398f79;if(_0x13fa46>=_0x335203){_0x13fa46=_0x335203;_0x398f79=0xc8;}else{_0x398f79=0xce;}_0x5ee270[_0xd804('0x1c')](_0x398f79);return _0x5ee270[_0xd804('0x21')]('Content-Range',_0x421ddb+'-'+_0x13fa46+'/'+_0x335203)['json'](_0x30be96);}return null;};}function patchUpdates(_0x37021f){return function(_0x5425f0){try{jsonpatch[_0xd804('0x22')](_0x5425f0,_0x37021f,!![]);}catch(_0x103f52){return BPromise[_0xd804('0x23')](_0x103f52);}return _0x5425f0['save']();};}function saveUpdates(_0x29a3b4,_0x5dd939){return function(_0x18d28c){if(_0x18d28c){return _0x18d28c['update'](_0x29a3b4)['then'](function(_0x52c85c){return _0x52c85c;});}return null;};}function removeEntity(_0x51b191,_0x2cde57){return function(_0x2fc18b){if(_0x2fc18b){return _0x2fc18b[_0xd804('0x24')]()['then'](function(){_0x51b191[_0xd804('0x1c')](0xcc)[_0xd804('0x25')]();});}};}function handleEntityNotFound(_0x2a2502,_0x35bfef){return function(_0x5045a1){if(!_0x5045a1){_0x2a2502[_0xd804('0x1b')](0x194);}return _0x5045a1;};}function handleError(_0x11d2c4,_0x5da178){_0x5da178=_0x5da178||0x1f4;return function(_0x38a6f6){logger[_0xd804('0x26')](_0x38a6f6['stack']);if(_0x38a6f6['name']){delete _0x38a6f6['name'];}_0x11d2c4[_0xd804('0x1c')](_0x5da178)[_0xd804('0x27')](_0x38a6f6);};}exports[_0xd804('0x28')]=function(_0x570990,_0x225615){var _0x28a26f={},_0x1858f0={},_0x1f4234={'count':0x0,'rows':[]};var _0x473588=_[_0xd804('0x29')](db[_0xd804('0x2a')][_0xd804('0x2b')],function(_0x5b197a){return{'name':_0x5b197a[_0xd804('0x2c')],'type':_0x5b197a[_0xd804('0x2d')][_0xd804('0x2e')]};});_0x1858f0[_0xd804('0x2f')]=_[_0xd804('0x29')](_0x473588,_0xd804('0x30'));_0x1858f0[_0xd804('0x31')]=_[_0xd804('0x32')](_0x570990[_0xd804('0x31')]);_0x1858f0[_0xd804('0x33')]=_['intersection'](_0x1858f0['model'],_0x1858f0[_0xd804('0x31')]);_0x28a26f[_0xd804('0x34')]=_['intersection'](_0x1858f0['model'],qs[_0xd804('0x35')](_0x570990['query']['fields']));_0x28a26f[_0xd804('0x34')]=_0x28a26f[_0xd804('0x34')][_0xd804('0x36')]?_0x28a26f[_0xd804('0x34')]:_0x1858f0[_0xd804('0x2f')];if(!_0x570990[_0xd804('0x31')][_0xd804('0x37')](_0xd804('0x38'))){_0x28a26f['limit']=qs[_0xd804('0x20')](_0x570990['query'][_0xd804('0x20')]);_0x28a26f[_0xd804('0x1e')]=qs[_0xd804('0x1e')](_0x570990[_0xd804('0x31')][_0xd804('0x1e')]);}_0x28a26f['order']=qs['sort'](_0x570990['query'][_0xd804('0x39')]);_0x28a26f['where']=qs[_0xd804('0x33')](_[_0xd804('0x3a')](_0x570990[_0xd804('0x31')],_0x1858f0[_0xd804('0x33')]),_0x473588);if(_0x570990[_0xd804('0x31')]['filter']){_0x28a26f['where']=_[_0xd804('0x3b')](_0x28a26f[_0xd804('0x3c')],{'$or':_[_0xd804('0x29')](_0x473588,function(_0x46018c){if(_0x46018c['type']!=='VIRTUAL'){var _0x24c0a1={};_0x24c0a1[_0x46018c[_0xd804('0x30')]]={'$like':'%'+_0x570990[_0xd804('0x31')][_0xd804('0x3d')]+'%'};return _0x24c0a1;}})});}_0x28a26f=_['merge']({},_0x28a26f,_0x570990['options']);var _0x5628cf={'where':_0x28a26f[_0xd804('0x3c')]};return db[_0xd804('0x2a')][_0xd804('0x3e')](_0x5628cf)['then'](function(_0x293aee){_0x1f4234['count']=_0x293aee;if(_0x570990[_0xd804('0x31')][_0xd804('0x3f')]){_0x28a26f[_0xd804('0x40')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xd804('0x41')](_0x28a26f);})[_0xd804('0x42')](function(_0xd13bf0){_0x1f4234[_0xd804('0x43')]=_0xd13bf0;return _0x1f4234;})['then'](respondWithFilteredResult(_0x225615,_0x28a26f))[_0xd804('0x44')](handleError(_0x225615,null));};exports[_0xd804('0x45')]=function(_0x14099b,_0xadfde0){var _0x45c011={'raw':!![],'where':{'id':_0x14099b['params']['id']}},_0x409278={};_0x409278['model']=_[_0xd804('0x32')](db['WhatsappApplication'][_0xd804('0x2b')]);_0x409278[_0xd804('0x31')]=_[_0xd804('0x32')](_0x14099b[_0xd804('0x31')]);_0x409278[_0xd804('0x33')]=_[_0xd804('0x46')](_0x409278[_0xd804('0x2f')],_0x409278[_0xd804('0x31')]);_0x45c011[_0xd804('0x34')]=_['intersection'](_0x409278['model'],qs[_0xd804('0x35')](_0x14099b[_0xd804('0x31')][_0xd804('0x35')]));_0x45c011[_0xd804('0x34')]=_0x45c011['attributes']['length']?_0x45c011[_0xd804('0x34')]:_0x409278['model'];if(_0x14099b[_0xd804('0x31')][_0xd804('0x3f')]){_0x45c011[_0xd804('0x40')]=[{'all':!![]}];}_0x45c011=_[_0xd804('0x3b')]({},_0x45c011,_0x14099b[_0xd804('0x47')]);return db[_0xd804('0x2a')][_0xd804('0x48')](_0x45c011)[_0xd804('0x42')](handleEntityNotFound(_0xadfde0,null))['then'](respondWithResult(_0xadfde0,null))[_0xd804('0x44')](handleError(_0xadfde0,null));};exports[_0xd804('0x49')]=function(_0x504f76,_0x12a15b){return db[_0xd804('0x2a')]['create'](_0x504f76[_0xd804('0x4a')],{})['then'](respondWithResult(_0x12a15b,0xc9))[_0xd804('0x44')](handleError(_0x12a15b,null));};exports[_0xd804('0x4b')]=function(_0x514eb2,_0x2f0146){if(_0x514eb2[_0xd804('0x4a')]['id']){delete _0x514eb2['body']['id'];}return db[_0xd804('0x2a')][_0xd804('0x48')]({'where':{'id':_0x514eb2[_0xd804('0x4c')]['id']}})[_0xd804('0x42')](handleEntityNotFound(_0x2f0146,null))[_0xd804('0x42')](saveUpdates(_0x514eb2[_0xd804('0x4a')],null))[_0xd804('0x42')](respondWithResult(_0x2f0146,null))[_0xd804('0x44')](handleError(_0x2f0146,null));};exports[_0xd804('0x24')]=function(_0x4d988d,_0x187cf2){return db['WhatsappApplication'][_0xd804('0x48')]({'where':{'id':_0x4d988d[_0xd804('0x4c')]['id']}})[_0xd804('0x42')](handleEntityNotFound(_0x187cf2,null))[_0xd804('0x42')](removeEntity(_0x187cf2,null))[_0xd804('0x44')](handleError(_0x187cf2,null));};
\ No newline at end of file
+var _0xef66=['fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','merge','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','type','model','query','filters','intersection'];(function(_0x16ec8d,_0x4bf3f0){var _0x12bdbf=function(_0x1a73ba){while(--_0x1a73ba){_0x16ec8d['push'](_0x16ec8d['shift']());}};_0x12bdbf(++_0x4bf3f0);}(_0xef66,0x1db));var _0x6ef6=function(_0x5a124f,_0x4ca733){_0x5a124f=_0x5a124f-0x0;var _0x5c3fc1=_0xef66[_0x5a124f];return _0x5c3fc1;};'use strict';var emlformat=require(_0x6ef6('0x0'));var rimraf=require(_0x6ef6('0x1'));var zipdir=require(_0x6ef6('0x2'));var jsonpatch=require(_0x6ef6('0x3'));var rp=require(_0x6ef6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6ef6('0x5'));var util=require(_0x6ef6('0x6'));var path=require(_0x6ef6('0x7'));var sox=require(_0x6ef6('0x8'));var csv=require(_0x6ef6('0x9'));var ejs=require(_0x6ef6('0xa'));var fs=require('fs');var fs_extra=require(_0x6ef6('0xb'));var _=require(_0x6ef6('0xc'));var squel=require(_0x6ef6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ef6('0xe'));var toCsv=require(_0x6ef6('0x9'));var querystring=require(_0x6ef6('0xf'));var Papa=require(_0x6ef6('0x10'));var Redis=require(_0x6ef6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6ef6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef6('0x13'))('api');var utils=require(_0x6ef6('0x14'));var config=require(_0x6ef6('0x15'));var licenseUtil=require(_0x6ef6('0x16'));var db=require(_0x6ef6('0x17'))['db'];function respondWithStatusCode(_0x596b91,_0x3aa045){_0x3aa045=_0x3aa045||0xcc;return function(_0x22b44e){if(_0x22b44e){return _0x596b91[_0x6ef6('0x18')](_0x3aa045);}return _0x596b91[_0x6ef6('0x19')](_0x3aa045)['end']();};}function respondWithResult(_0x265583,_0x5845b7){_0x5845b7=_0x5845b7||0xc8;return function(_0x40d198){if(_0x40d198){return _0x265583[_0x6ef6('0x19')](_0x5845b7)['json'](_0x40d198);}};}function respondWithFilteredResult(_0x248ab3,_0x1f4c3d){return function(_0x453aa3){if(_0x453aa3){var _0x3f0a84=typeof _0x1f4c3d[_0x6ef6('0x1a')]===_0x6ef6('0x1b')&&typeof _0x1f4c3d[_0x6ef6('0x1c')]===_0x6ef6('0x1b');var _0x1ed381=_0x453aa3[_0x6ef6('0x1d')];var _0x53586d=_0x3f0a84?0x0:_0x1f4c3d[_0x6ef6('0x1a')];var _0x2510be=_0x3f0a84?_0x453aa3[_0x6ef6('0x1d')]:_0x1f4c3d[_0x6ef6('0x1a')]+_0x1f4c3d[_0x6ef6('0x1c')];var _0x2e6e52;if(_0x2510be>=_0x1ed381){_0x2510be=_0x1ed381;_0x2e6e52=0xc8;}else{_0x2e6e52=0xce;}_0x248ab3[_0x6ef6('0x19')](_0x2e6e52);return _0x248ab3['set'](_0x6ef6('0x1e'),_0x53586d+'-'+_0x2510be+'/'+_0x1ed381)[_0x6ef6('0x1f')](_0x453aa3);}return null;};}function patchUpdates(_0x2903ea){return function(_0x11ade5){try{jsonpatch['apply'](_0x11ade5,_0x2903ea,!![]);}catch(_0x164ed9){return BPromise[_0x6ef6('0x20')](_0x164ed9);}return _0x11ade5[_0x6ef6('0x21')]();};}function saveUpdates(_0x4f6df6,_0x4257d8){return function(_0x1096de){if(_0x1096de){return _0x1096de['update'](_0x4f6df6)[_0x6ef6('0x22')](function(_0x3c225f){return _0x3c225f;});}return null;};}function removeEntity(_0x4d7f90,_0x366f2c){return function(_0xb1c6b0){if(_0xb1c6b0){return _0xb1c6b0[_0x6ef6('0x23')]()[_0x6ef6('0x22')](function(){_0x4d7f90[_0x6ef6('0x19')](0xcc)[_0x6ef6('0x24')]();});}};}function handleEntityNotFound(_0x1cd549,_0x499d4f){return function(_0x2e5059){if(!_0x2e5059){_0x1cd549['sendStatus'](0x194);}return _0x2e5059;};}function handleError(_0x39d3cc,_0x692c3d){_0x692c3d=_0x692c3d||0x1f4;return function(_0x443ded){logger[_0x6ef6('0x25')](_0x443ded[_0x6ef6('0x26')]);if(_0x443ded[_0x6ef6('0x27')]){delete _0x443ded[_0x6ef6('0x27')];}_0x39d3cc[_0x6ef6('0x19')](_0x692c3d)[_0x6ef6('0x28')](_0x443ded);};}exports[_0x6ef6('0x29')]=function(_0x136d20,_0x2d87a8){var _0x483f4d={},_0x40f9f6={},_0x295616={'count':0x0,'rows':[]};var _0x2e4bed=_[_0x6ef6('0x2a')](db[_0x6ef6('0x2b')][_0x6ef6('0x2c')],function(_0x23f979){return{'name':_0x23f979['fieldName'],'type':_0x23f979[_0x6ef6('0x2d')]['key']};});_0x40f9f6[_0x6ef6('0x2e')]=_[_0x6ef6('0x2a')](_0x2e4bed,_0x6ef6('0x27'));_0x40f9f6['query']=_['keys'](_0x136d20[_0x6ef6('0x2f')]);_0x40f9f6[_0x6ef6('0x30')]=_[_0x6ef6('0x31')](_0x40f9f6['model'],_0x40f9f6[_0x6ef6('0x2f')]);_0x483f4d['attributes']=_[_0x6ef6('0x31')](_0x40f9f6[_0x6ef6('0x2e')],qs['fields'](_0x136d20['query'][_0x6ef6('0x32')]));_0x483f4d['attributes']=_0x483f4d[_0x6ef6('0x33')]['length']?_0x483f4d[_0x6ef6('0x33')]:_0x40f9f6['model'];if(!_0x136d20['query'][_0x6ef6('0x34')](_0x6ef6('0x35'))){_0x483f4d['limit']=qs[_0x6ef6('0x1c')](_0x136d20['query'][_0x6ef6('0x1c')]);_0x483f4d['offset']=qs[_0x6ef6('0x1a')](_0x136d20['query'][_0x6ef6('0x1a')]);}_0x483f4d[_0x6ef6('0x36')]=qs[_0x6ef6('0x37')](_0x136d20['query']['sort']);_0x483f4d[_0x6ef6('0x38')]=qs[_0x6ef6('0x30')](_[_0x6ef6('0x39')](_0x136d20[_0x6ef6('0x2f')],_0x40f9f6['filters']),_0x2e4bed);if(_0x136d20['query'][_0x6ef6('0x3a')]){_0x483f4d['where']=_['merge'](_0x483f4d[_0x6ef6('0x38')],{'$or':_['map'](_0x2e4bed,function(_0x38969c){if(_0x38969c[_0x6ef6('0x2d')]!==_0x6ef6('0x3b')){var _0x31facc={};_0x31facc[_0x38969c[_0x6ef6('0x27')]]={'$like':'%'+_0x136d20[_0x6ef6('0x2f')][_0x6ef6('0x3a')]+'%'};return _0x31facc;}})});}_0x483f4d=_['merge']({},_0x483f4d,_0x136d20[_0x6ef6('0x3c')]);var _0x58fed8={'where':_0x483f4d['where']};return db[_0x6ef6('0x2b')][_0x6ef6('0x1d')](_0x58fed8)[_0x6ef6('0x22')](function(_0x4da800){_0x295616[_0x6ef6('0x1d')]=_0x4da800;if(_0x136d20[_0x6ef6('0x2f')][_0x6ef6('0x3d')]){_0x483f4d['include']=[{'all':!![]}];}return db[_0x6ef6('0x2b')][_0x6ef6('0x3e')](_0x483f4d);})[_0x6ef6('0x22')](function(_0x1bf2af){_0x295616[_0x6ef6('0x3f')]=_0x1bf2af;return _0x295616;})[_0x6ef6('0x22')](respondWithFilteredResult(_0x2d87a8,_0x483f4d))[_0x6ef6('0x40')](handleError(_0x2d87a8,null));};exports[_0x6ef6('0x41')]=function(_0x2c03a7,_0x230f30){var _0x51b0a1={'raw':!![],'where':{'id':_0x2c03a7[_0x6ef6('0x42')]['id']}},_0xf46913={};_0xf46913[_0x6ef6('0x2e')]=_[_0x6ef6('0x43')](db[_0x6ef6('0x2b')][_0x6ef6('0x2c')]);_0xf46913[_0x6ef6('0x2f')]=_[_0x6ef6('0x43')](_0x2c03a7[_0x6ef6('0x2f')]);_0xf46913[_0x6ef6('0x30')]=_[_0x6ef6('0x31')](_0xf46913['model'],_0xf46913[_0x6ef6('0x2f')]);_0x51b0a1['attributes']=_[_0x6ef6('0x31')](_0xf46913['model'],qs[_0x6ef6('0x32')](_0x2c03a7[_0x6ef6('0x2f')]['fields']));_0x51b0a1[_0x6ef6('0x33')]=_0x51b0a1[_0x6ef6('0x33')][_0x6ef6('0x44')]?_0x51b0a1[_0x6ef6('0x33')]:_0xf46913[_0x6ef6('0x2e')];if(_0x2c03a7['query'][_0x6ef6('0x3d')]){_0x51b0a1[_0x6ef6('0x45')]=[{'all':!![]}];}_0x51b0a1=_[_0x6ef6('0x46')]({},_0x51b0a1,_0x2c03a7[_0x6ef6('0x3c')]);return db[_0x6ef6('0x2b')][_0x6ef6('0x47')](_0x51b0a1)[_0x6ef6('0x22')](handleEntityNotFound(_0x230f30,null))[_0x6ef6('0x22')](respondWithResult(_0x230f30,null))['catch'](handleError(_0x230f30,null));};exports[_0x6ef6('0x48')]=function(_0x2d54c0,_0x52e93f){return db['WhatsappApplication'][_0x6ef6('0x48')](_0x2d54c0['body'],{})[_0x6ef6('0x22')](respondWithResult(_0x52e93f,0xc9))['catch'](handleError(_0x52e93f,null));};exports[_0x6ef6('0x49')]=function(_0x712015,_0x23edde){if(_0x712015[_0x6ef6('0x4a')]['id']){delete _0x712015['body']['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x712015['params']['id']}})[_0x6ef6('0x22')](handleEntityNotFound(_0x23edde,null))[_0x6ef6('0x22')](saveUpdates(_0x712015[_0x6ef6('0x4a')],null))['then'](respondWithResult(_0x23edde,null))[_0x6ef6('0x40')](handleError(_0x23edde,null));};exports[_0x6ef6('0x23')]=function(_0x30a2a5,_0x43fda4){return db[_0x6ef6('0x2b')][_0x6ef6('0x47')]({'where':{'id':_0x30a2a5[_0x6ef6('0x42')]['id']}})['then'](handleEntityNotFound(_0x43fda4,null))[_0x6ef6('0x22')](removeEntity(_0x43fda4,null))['catch'](handleError(_0x43fda4,null));};
\ No newline at end of file
index df4e865..d157da7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd51f=['lodash','util','api','moment','request-promise','path','../../config/environment','./whatsappApplication.attributes','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5c52a3,_0x13c8d5){var _0x5537b9=function(_0x469e93){while(--_0x469e93){_0x5c52a3['push'](_0x5c52a3['shift']());}};_0x5537b9(++_0x13c8d5);}(_0xd51f,0xf0));var _0xfd51=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd51f[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var logger=require('../../config/logger')(_0xfd51('0x2'));var moment=require(_0xfd51('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd51('0x4'));var fs=require('fs');var path=require(_0xfd51('0x5'));var rimraf=require('rimraf');var config=require(_0xfd51('0x6'));var attributes=require(_0xfd51('0x7'));module['exports']=function(_0x3e3517,_0x3a2cd4){return _0x3e3517['define'](_0xfd51('0x8'),attributes,{'tableName':_0xfd51('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd51('0xa'),'collate':_0xfd51('0xb')});};
\ No newline at end of file
+var _0x6726=['moment','bluebird','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x6726,0xdb));var _0x6672=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x6726[_0x912d27];return _0x31b918;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var logger=require(_0x6672('0x1'))('api');var moment=require(_0x6672('0x2'));var BPromise=require(_0x6672('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6672('0x4'));var rimraf=require('rimraf');var config=require(_0x6672('0x5'));var attributes=require(_0x6672('0x6'));module[_0x6672('0x7')]=function(_0x40ba7e,_0x5701b9){return _0x40ba7e[_0x6672('0x8')](_0x6672('0x9'),attributes,{'tableName':_0x6672('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6672('0xb'),'collate':_0x6672('0xc')});};
\ No newline at end of file
index 71dfa3d..70ab415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x3d1308,_0x48a5d8){var _0x1ee591=function(_0x3c77c5){while(--_0x3c77c5){_0x3d1308['push'](_0x3d1308['shift']());}};_0x1ee591(++_0x48a5d8);}(_0xa8a8,0xec));var _0x8a8a=function(_0x53e7f5,_0x56907a){_0x53e7f5=_0x53e7f5-0x0;var _0x451bda=_0xa8a8[_0x53e7f5];return _0x451bda;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});}
\ No newline at end of file
+var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','util'];(function(_0x4943c3,_0x2875c7){var _0x24c59a=function(_0x46c951){while(--_0x46c951){_0x4943c3['push'](_0x4943c3['shift']());}};_0x24c59a(++_0x2875c7);}(_0xedd9,0xfc));var _0x9edd=function(_0x484e47,_0x155a54){_0x484e47=_0x484e47-0x0;var _0x5c6ea5=_0xedd9[_0x484e47];return _0x5c6ea5;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
index 5eea562..17961e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b8f=['/:id/messages','getMessages','post','create','addMessage','tracked','whatsapp','addTags','whatsappinteraction:update','delete','/:id/tags','removeTags','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x4ec73f,_0x5d97d4){var _0x3a5c46=function(_0x2ef3eb){while(--_0x2ef3eb){_0x4ec73f['push'](_0x4ec73f['shift']());}};_0x3a5c46(++_0x5d97d4);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x52a312,_0x52fa77){_0x52a312=_0x52a312-0x0;var _0x2fbf53=_0x6b8f[_0x52a312];return _0x2fbf53;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6b8('0x2'));var auth=require(_0xf6b8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6b8('0x4'));var controller=require(_0xf6b8('0x5'));router[_0xf6b8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b8('0x7')]);router[_0xf6b8('0x6')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller['describe']);router['get'](_0xf6b8('0xa'),auth['isAuthenticated'](),controller[_0xf6b8('0xb')]);router[_0xf6b8('0x6')](_0xf6b8('0xc'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xd')]);router[_0xf6b8('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xf6b8('0xe')]('/',auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xf')]);router[_0xf6b8('0xe')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf6b8('0x10')]);router[_0xf6b8('0xe')]('/:id/tags',auth[_0xf6b8('0x9')](),interaction[_0xf6b8('0x11')](_0xf6b8('0x12'),'whatsappinteraction:addtags'),controller[_0xf6b8('0x13')]);router['put'](_0xf6b8('0xa'),auth[_0xf6b8('0x9')](),interaction[_0xf6b8('0x11')](_0xf6b8('0x12'),_0xf6b8('0x14')),controller['update']);router['delete'](_0xf6b8('0xa'),auth['isAuthenticated'](),interaction[_0xf6b8('0x11')](_0xf6b8('0x12'),'whatsappinteraction:destroy'),controller['destroy']);router[_0xf6b8('0x15')](_0xf6b8('0x16'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x3831=['whatsappinteraction:destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete'];(function(_0x2145a3,_0x5221fc){var _0x5b7fad=function(_0x5e5d6f){while(--_0x5e5d6f){_0x2145a3['push'](_0x2145a3['shift']());}};_0x5b7fad(++_0x5221fc);}(_0x3831,0x14c));var _0x1383=function(_0x2e72c7,_0x3cefda){_0x2e72c7=_0x2e72c7-0x0;var _0x12f876=_0x3831[_0x2e72c7];return _0x12f876;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/describe',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0x8')](_0x1383('0xd'),auth['isAuthenticated'](),controller[_0x1383('0xe')]);router[_0x1383('0x8')](_0x1383('0xf'),auth[_0x1383('0x9')](),controller[_0x1383('0x10')]);router['post']('/',auth[_0x1383('0x9')](),controller[_0x1383('0x11')]);router[_0x1383('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1383('0x13')]);router[_0x1383('0x12')](_0x1383('0x14'),auth[_0x1383('0x9')](),interaction[_0x1383('0x15')](_0x1383('0x16'),_0x1383('0x17')),controller[_0x1383('0x18')]);router['put'](_0x1383('0xb'),auth[_0x1383('0x9')](),interaction[_0x1383('0x15')](_0x1383('0x16'),_0x1383('0x19')),controller[_0x1383('0x1a')]);router[_0x1383('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x1383('0x15')]('whatsapp',_0x1383('0x1c')),controller['destroy']);router['delete']('/:id/tags',auth[_0x1383('0x9')](),controller['removeTags']);module[_0x1383('0x1d')]=router;
\ No newline at end of file
index 9b55595..75fb211 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0309=['STRING','ENUM','BOOLEAN','sequelize','exports','DATE'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0309,0x165));var _0x9030=function(_0xe5795e,_0x12a8ef){_0xe5795e=_0xe5795e-0x0;var _0x2289fb=_0x0309[_0xe5795e];return _0x2289fb;};'use strict';var Sequelize=require(_0x9030('0x0'));var moment=require('moment');module[_0x9030('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9030('0x2')]},'disposition':{'type':Sequelize[_0x9030('0x3')]},'secondDisposition':{'type':Sequelize[_0x9030('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9030('0x3')]},'note':{'type':Sequelize[_0x9030('0x3')]},'phone':{'type':Sequelize[_0x9030('0x3')]},'read1stAt':{'type':Sequelize[_0x9030('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9030('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x9030('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9030('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4d61=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x566ce2,_0x201f86){var _0x2aa9df=function(_0x587fc9){while(--_0x587fc9){_0x566ce2['push'](_0x566ce2['shift']());}};_0x2aa9df(++_0x201f86);}(_0x4d61,0x147));var _0x14d6=function(_0x9906ff,_0x471c43){_0x9906ff=_0x9906ff-0x0;var _0x143a16=_0x4d61[_0x9906ff];return _0x143a16;};'use strict';var Sequelize=require(_0x14d6('0x0'));var moment=require(_0x14d6('0x1'));module[_0x14d6('0x2')]={'closed':{'type':Sequelize[_0x14d6('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x14d6('0x4')]},'disposition':{'type':Sequelize[_0x14d6('0x5')]},'secondDisposition':{'type':Sequelize[_0x14d6('0x5')]},'thirdDisposition':{'type':Sequelize[_0x14d6('0x5')]},'note':{'type':Sequelize[_0x14d6('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x14d6('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x14d6('0x6')]('in',_0x14d6('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x14d6('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x14d6('0x6')]('in',_0x14d6('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x14d6('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 77bf582..1996442 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2581=['reject','save','then','destroy','stack','name','send','Users','TagIds','split','forEach','Tags','push','catch','answered','total','UserId','waiting','closed','talking','unmanaged','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','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','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','i.WhatsappAccountId\x20IS\x20NULL','role','toString','sequelize','keyBy','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname','CmContact','lastName','Attachment','Messages','secret','WhatsappAccount','Account','Owner','mkdirSync','N.A.','disposition','basename','createReadStream','pipe','direction','out','System','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x2ecdd5,_0x171b17){var _0x58b3c2=function(_0x166e18){while(--_0x166e18){_0x2ecdd5['push'](_0x2ecdd5['shift']());}};_0x58b3c2(++_0x171b17);}(_0x2581,0xcb));var _0x1258=function(_0x5129f4,_0x26380b){_0x5129f4=_0x5129f4-0x0;var _0x3b1d9a=_0x2581[_0x5129f4];return _0x3b1d9a;};'use strict';var emlformat=require(_0x1258('0x0'));var rimraf=require(_0x1258('0x1'));var zipdir=require(_0x1258('0x2'));var jsonpatch=require(_0x1258('0x3'));var rp=require(_0x1258('0x4'));var moment=require('moment');var BPromise=require(_0x1258('0x5'));var Mustache=require(_0x1258('0x6'));var util=require(_0x1258('0x7'));var path=require(_0x1258('0x8'));var sox=require(_0x1258('0x9'));var csv=require(_0x1258('0xa'));var ejs=require(_0x1258('0xb'));var fs=require('fs');var fs_extra=require(_0x1258('0xc'));var _=require('lodash');var squel=require(_0x1258('0xd'));var crypto=require(_0x1258('0xe'));var jsforce=require(_0x1258('0xf'));var deskjs=require(_0x1258('0x10'));var toCsv=require(_0x1258('0xa'));var querystring=require(_0x1258('0x11'));var Papa=require(_0x1258('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1258('0x13'));var as=require(_0x1258('0x14'));var pdf=require(_0x1258('0x15'));var hardwareService=require(_0x1258('0x16'));var logger=require('../../config/logger')(_0x1258('0x17'));var utils=require(_0x1258('0x18'));var config=require(_0x1258('0x19'));var licenseUtil=require(_0x1258('0x1a'));var db=require('../../mysqldb')['db'];config[_0x1258('0x1b')]=_[_0x1258('0x1c')](config[_0x1258('0x1b')],{'host':_0x1258('0x1d'),'port':0x18eb});var socket=require(_0x1258('0x1e'))(new Redis(config[_0x1258('0x1b')]));require(_0x1258('0x1f'))['register'](socket);function respondWithStatusCode(_0x77d12c,_0x56bd82){_0x56bd82=_0x56bd82||0xcc;return function(_0x477502){if(_0x477502){return _0x77d12c[_0x1258('0x20')](_0x56bd82);}return _0x77d12c[_0x1258('0x21')](_0x56bd82)[_0x1258('0x22')]();};}function respondWithResult(_0x313717,_0x4a85e4){_0x4a85e4=_0x4a85e4||0xc8;return function(_0x1645a6){if(_0x1645a6){return _0x313717[_0x1258('0x21')](_0x4a85e4)[_0x1258('0x23')](_0x1645a6);}};}function respondWithFilteredResult(_0x55f1dc,_0x97c02e){return function(_0xf234e8){if(_0xf234e8){var _0x55c458=typeof _0x97c02e[_0x1258('0x24')]===_0x1258('0x25')&&typeof _0x97c02e[_0x1258('0x26')]===_0x1258('0x25');var _0x24074b=_0xf234e8[_0x1258('0x27')];var _0x8de82c=_0x55c458?0x0:_0x97c02e[_0x1258('0x24')];var _0x3dade8=_0x55c458?_0xf234e8[_0x1258('0x27')]:_0x97c02e[_0x1258('0x24')]+_0x97c02e[_0x1258('0x26')];var _0x21bbd6;if(_0x3dade8>=_0x24074b){_0x3dade8=_0x24074b;_0x21bbd6=0xc8;}else{_0x21bbd6=0xce;}_0x55f1dc[_0x1258('0x21')](_0x21bbd6);return _0x55f1dc[_0x1258('0x28')]('Content-Range',_0x8de82c+'-'+_0x3dade8+'/'+_0x24074b)[_0x1258('0x23')](_0xf234e8);}return null;};}function patchUpdates(_0x528a62){return function(_0x569f65){try{jsonpatch[_0x1258('0x29')](_0x569f65,_0x528a62,!![]);}catch(_0x2c661a){return BPromise[_0x1258('0x2a')](_0x2c661a);}return _0x569f65[_0x1258('0x2b')]();};}function saveUpdates(_0x437fce,_0xdf6639){return function(_0x385acb){if(_0x385acb){return _0x385acb['update'](_0x437fce)[_0x1258('0x2c')](function(_0xe30e8d){return _0xe30e8d;});}return null;};}function removeEntity(_0x1cbfd1,_0x195986){return function(_0x14a77b){if(_0x14a77b){return _0x14a77b[_0x1258('0x2d')]()[_0x1258('0x2c')](function(){_0x1cbfd1[_0x1258('0x21')](0xcc)[_0x1258('0x22')]();});}};}function handleEntityNotFound(_0x120abd,_0x2edb84){return function(_0x42a3b4){if(!_0x42a3b4){_0x120abd[_0x1258('0x20')](0x194);}return _0x42a3b4;};}function handleError(_0x556096,_0x5a6365){_0x5a6365=_0x5a6365||0x1f4;return function(_0x18ab7a){logger['error'](_0x18ab7a[_0x1258('0x2e')]);if(_0x18ab7a[_0x1258('0x2f')]){delete _0x18ab7a['name'];}_0x556096[_0x1258('0x21')](_0x5a6365)[_0x1258('0x30')](_0x18ab7a);};}function getInteractionUsers(_0x3c0216,_0x5b5743){return new BPromise(function(_0x58e7be,_0x1b46bf){try{if(_0x5b5743[_0x3c0216['id']]){_0x3c0216[_0x1258('0x31')]=_['map'](_0x5b5743[_0x3c0216['id']],function(_0xa93e0b){return{'id':_0xa93e0b['id'],'fullname':_0xa93e0b['fullname']};});}}catch(_0x374028){_0x1b46bf(_0x374028);}_0x58e7be(_0x3c0216);});}function getInteractionTags(_0xdf98ba,_0x27d072){return new BPromise(function(_0x3c384c,_0xba3901){try{if(_0xdf98ba['TagIds']){_0xdf98ba['Tags']=[];_0xdf98ba[_0x1258('0x32')][_0x1258('0x33')](',')[_0x1258('0x34')](function(_0xea698c){_0xdf98ba[_0x1258('0x35')][_0x1258('0x36')](_0x27d072[_0xea698c]);});}delete _0xdf98ba['TagIds'];}catch(_0x48c41d){_0xba3901(_0x48c41d);}_0x3c384c(_0xdf98ba);});}function updateWhatsappInteraction(_0x3e6af4,_0x38057e,_0x5cb805){return new BPromise(function(_0x47af67,_0x5872e1){return getInteractionUsers(_0x3e6af4,_0x5cb805)['then'](function(_0x205ca4){return getInteractionTags(_0x205ca4,_0x38057e);})[_0x1258('0x2c')](function(_0x36fdf6){return getStateInteraction(_0x36fdf6);})[_0x1258('0x2c')](function(_0x228203){_0x47af67(_0x228203);})[_0x1258('0x37')](function(_0x3d95ec){_0x5872e1(_0x3d95ec);});});}function getStateInteraction(_0x3b0aa3){return new BPromise(function(_0x32aed5){_0x3b0aa3['waiting']=0x0;_0x3b0aa3['talking']=0x0;_0x3b0aa3[_0x1258('0x38')]=0x0;_0x3b0aa3['unmanaged']=0x0;_0x3b0aa3[_0x1258('0x39')]=0x0;if(!_0x3b0aa3['closed']&&!_0x3b0aa3[_0x1258('0x3a')]){_0x3b0aa3[_0x1258('0x3b')]+=0x1;}if(!_0x3b0aa3[_0x1258('0x3c')]&&_0x3b0aa3[_0x1258('0x3a')]){_0x3b0aa3[_0x1258('0x3d')]+=0x1;if(_0x3b0aa3[_0x1258('0x3b')]){_0x3b0aa3[_0x1258('0x3b')]-=0x1;}}if(_0x3b0aa3[_0x1258('0x3c')]&&_0x3b0aa3['UserId']){_0x3b0aa3[_0x1258('0x38')]+=0x1;if(_0x3b0aa3[_0x1258('0x3d')]){_0x3b0aa3[_0x1258('0x3d')]-=0x1;}}if(_0x3b0aa3[_0x1258('0x3c')]&&!_0x3b0aa3[_0x1258('0x3a')]){_0x3b0aa3[_0x1258('0x3e')]+=0x1;if(_0x3b0aa3['waiting']){_0x3b0aa3['waiting']-=0x1;}}_0x3b0aa3[_0x1258('0x39')]+=0x1;_0x32aed5(_0x3b0aa3);});}exports[_0x1258('0x3f')]=function(_0x1bed44,_0x55a971){var _0x3e63d3={},_0x592232={},_0x5d03dd={'count':0x0,'rows':[]};var _0x46da76=_[_0x1258('0x40')](db[_0x1258('0x41')][_0x1258('0x42')],function(_0x2139d4){return{'name':_0x2139d4[_0x1258('0x43')],'type':_0x2139d4[_0x1258('0x44')][_0x1258('0x45')]};});_0x592232[_0x1258('0x46')]=_[_0x1258('0x40')](_0x46da76,_0x1258('0x2f'));_0x592232[_0x1258('0x47')]=_[_0x1258('0x48')](_0x1bed44[_0x1258('0x47')]);_0x592232['filters']=_[_0x1258('0x49')](_0x592232[_0x1258('0x46')],_0x592232[_0x1258('0x47')]);_0x3e63d3[_0x1258('0x4a')]=_[_0x1258('0x49')](_0x592232[_0x1258('0x46')],qs[_0x1258('0x4b')](_0x1bed44['query'][_0x1258('0x4b')]));_0x3e63d3[_0x1258('0x4a')]=_0x3e63d3[_0x1258('0x4a')][_0x1258('0x4c')]?_0x3e63d3[_0x1258('0x4a')]:_0x592232[_0x1258('0x46')];if(!_0x1bed44[_0x1258('0x47')][_0x1258('0x4d')](_0x1258('0x4e'))){_0x3e63d3[_0x1258('0x26')]=qs[_0x1258('0x26')](_0x1bed44[_0x1258('0x47')][_0x1258('0x26')]);_0x3e63d3[_0x1258('0x24')]=qs[_0x1258('0x24')](_0x1bed44[_0x1258('0x47')][_0x1258('0x24')]);}_0x3e63d3[_0x1258('0x4f')]=qs[_0x1258('0x50')](_0x1bed44['query'][_0x1258('0x50')]);_0x3e63d3[_0x1258('0x51')]=qs['filters'](_['pick'](_0x1bed44[_0x1258('0x47')],_0x592232[_0x1258('0x52')]),_0x46da76);var _0x2e7eb0=[];var _0x5954b8=squel[_0x1258('0x53')]()[_0x1258('0x54')]('id')[_0x1258('0x54')]('name')[_0x1258('0x54')](_0x1258('0x55'))[_0x1258('0x56')](_0x1258('0x57'));var _0x48789e=squel['select']()['field'](_0x1258('0x58'))[_0x1258('0x54')]('u.fullname')[_0x1258('0x54')](_0x1258('0x59'))[_0x1258('0x56')](_0x1258('0x5a'),'ui')['left_join'](_0x1258('0x5b'),'u',_0x1258('0x5c'));var _0x2bdc64=squel[_0x1258('0x53')]()['from'](_0x1258('0x5d'),'i')[_0x1258('0x5e')](_0x1258('0x5f'),'c',_0x1258('0x60'))[_0x1258('0x5e')](_0x1258('0x5b'),'o',_0x1258('0x61'))[_0x1258('0x5e')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x1258('0x5e')](_0x1258('0x62'),'me',_0x1258('0x63'))[_0x1258('0x5e')](_0x1258('0x64'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x1258('0x5e')](_0x1258('0x57'),'t',_0x1258('0x65'));var _0x58b6a9=squel['expr']();var _0x553042=[];var _0x2bcad7=squel[_0x1258('0x66')]();var _0x2de959;if(_0x1bed44[_0x1258('0x47')][_0x1258('0x67')]){_0x2de959=as['parseSearch'](_0x1bed44[_0x1258('0x47')][_0x1258('0x67')]);var _0x153d4f=_0x2de959[_0x1258('0x68')];for(var _0x3186f5=0x0;_0x3186f5<_0x2de959[_0x1258('0x69')][_0x1258('0x4c')];_0x3186f5++){var _0x2d73da=_0x2de959[_0x1258('0x69')][_0x3186f5];var _0x481d3a='i';var _0x10e186=_[_0x1258('0x6a')](_0x46da76,[_0x1258('0x2f'),_0x2d73da['field']]);if(!_0x10e186){switch(_0x2d73da[_0x1258('0x54')]){case _0x1258('0x6b'):if(_0x2d73da[_0x1258('0x6c')]==0x1){_0x2bdc64[_0x1258('0x6d')]('`'+_0x2d73da[_0x1258('0x54')]+_0x1258('0x6e'));}else{_0x2bdc64[_0x1258('0x6d')]('`'+_0x2d73da[_0x1258('0x54')]+_0x1258('0x6f'));}break;case _0x1258('0x70'):if(_0x2d73da[_0x1258('0x71')]===_0x1258('0x72')){if(_0x2d73da[_0x1258('0x6c')]['split']('\x20')[_0x1258('0x4c')]>0x1){_0x58b6a9[_0x153d4f](_0x1258('0x73'),qs[_0x1258('0x74')](_0x2d73da[_0x1258('0x6c')]),null);}else{var _0x11aa96='%'+_0x2d73da[_0x1258('0x6c')]+'%';_0x58b6a9[_0x153d4f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x11aa96,_0x11aa96,_0x11aa96);}}else{_0x10e186=_[_0x1258('0x6a')](_0x46da76,[_0x1258('0x2f'),_0x1258('0x75')]);_0x2d73da[_0x1258('0x54')]=_0x1258('0x75');_0x4b9b26=as[_0x1258('0x76')](_0x481d3a,_0x10e186['type'],_0x2d73da);_0x58b6a9[_0x153d4f](_0x4b9b26[_0x1258('0x77')],_0x4b9b26['value'][_0x1258('0x78')],_0x4b9b26[_0x1258('0x6c')][_0x1258('0x22')]);}break;case _0x1258('0x79'):var _0xe209e3=_0x2d73da[_0x1258('0x6c')][_0x1258('0x33')](',')[_0x1258('0x40')](function(_0x21a6d6){return Number(_0x21a6d6);});_0xe209e3[_0x1258('0x34')](function(_0x4aff84){_0x2bcad7['or'](_0x1258('0x7a'),'%,'+_0x4aff84+',%');});_0x553042=_[_0x1258('0x7b')](_0x553042,_0xe209e3);break;case'User':if(_0x2d73da[_0x1258('0x71')]==='$substring'){_0x58b6a9[_0x153d4f](_0x1258('0x7c'),'%'+_0x2d73da['value']+'%',null);}else{_0x10e186=_[_0x1258('0x6a')](_0x46da76,[_0x1258('0x2f'),_0x1258('0x3a')]);_0x2d73da[_0x1258('0x54')]=_0x1258('0x3a');_0x4b9b26=as[_0x1258('0x76')](_0x481d3a,_0x10e186[_0x1258('0x44')],_0x2d73da);_0x58b6a9[_0x153d4f](_0x4b9b26[_0x1258('0x77')],_0x4b9b26[_0x1258('0x6c')][_0x1258('0x78')],_0x4b9b26[_0x1258('0x6c')][_0x1258('0x22')]);}break;case _0x1258('0x7d'):_0x4b9b26=as[_0x1258('0x76')]('me',null,_0x2d73da);_0x58b6a9[_0x153d4f](_0x4b9b26[_0x1258('0x77')],_0x4b9b26[_0x1258('0x6c')][_0x1258('0x78')],_0x4b9b26[_0x1258('0x6c')]['end']);break;}}else{var _0x4b9b26=as[_0x1258('0x76')](_0x481d3a,_0x10e186[_0x1258('0x44')],_0x2d73da);_0x58b6a9[_0x153d4f](_0x4b9b26[_0x1258('0x77')],_0x4b9b26[_0x1258('0x6c')][_0x1258('0x78')],_0x4b9b26[_0x1258('0x6c')][_0x1258('0x22')]);}}}else{var _0x2279a1=_(_0x1bed44[_0x1258('0x47')])[_0x1258('0x48')]()[_0x1258('0x40')](function(_0xba960c){return _['some'](_0x46da76,[_0x1258('0x2f'),_0xba960c])?_0xba960c:undefined;})['compact']()[_0x1258('0x6c')]();if(!_[_0x1258('0x7e')](_0x2279a1)){_0x2279a1[_0x1258('0x34')](function(_0x23470a){if(_0x23470a===_0x1258('0x7f')){_0x2bdc64[_0x1258('0x51')](_0x1258('0x80'),[][_0x1258('0x81')](_0x1bed44['query'][_0x23470a]));}else if(_0x23470a===_0x1258('0x82')){var _0x5810ac=JSON[_0x1258('0x83')](_0x1bed44[_0x1258('0x47')][_0x23470a])['$gte'];var _0x5a254e=JSON[_0x1258('0x83')](_0x1bed44[_0x1258('0x47')][_0x23470a])[_0x1258('0x84')];_0x2bdc64[_0x1258('0x51')](_0x1258('0x85'),_0x5810ac,_0x5a254e);}else{if(_0x1bed44[_0x1258('0x47')][_0x23470a]===_0x1258('0x86')){_0x2bdc64[_0x1258('0x51')]('i.'+_0x23470a+_0x1258('0x87'));}else{_0x2bdc64[_0x1258('0x51')]('i.'+_0x23470a+_0x1258('0x88'),_0x1bed44[_0x1258('0x47')][_0x23470a]);}}});}if(_0x1bed44['query'][_0x1258('0x89')]){if(_0x1bed44[_0x1258('0x47')][_0x1258('0x89')]==0x1){_0x2bdc64[_0x1258('0x6d')](_0x1258('0x8a'));}else{_0x2bdc64[_0x1258('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x1bed44[_0x1258('0x47')]['tag']){_0x553042=_[_0x1258('0x8b')](_0x1bed44[_0x1258('0x47')]['tag'])?_0x1bed44[_0x1258('0x47')][_0x1258('0x8c')]:new Array(_0x1bed44[_0x1258('0x47')][_0x1258('0x8c')]);_0x553042[_0x1258('0x34')](function(_0x16c735){_0x2bcad7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x16c735+',%');});}if(_0x1bed44['query'][_0x1258('0x8d')]){var _0x2b8a48=_0x1bed44[_0x1258('0x47')]['filter'][_0x1258('0x8e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1258('0x8f')](_0x2b8a48)){_0x58b6a9['or']('i.id\x20LIKE\x20?',_0x2b8a48+'%')['or'](_0x1258('0x90'),_0x2b8a48+'%');}else{_0x58b6a9['or'](_0x1258('0x91'),qs[_0x1258('0x74')](_0x2b8a48))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2b8a48+'%');}}}_0x2bdc64['where'](_0x58b6a9);_0x2bdc64[_0x1258('0x92')](_0x1258('0x93'));var _0x119488={'type':db['Sequelize'][_0x1258('0x94')]['SELECT'],'raw':!![]};var _0x50ca3d=_0x2bdc64[_0x1258('0x95')]();_0x50ca3d['field'](_0x1258('0x93'));_0x50ca3d[_0x1258('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1258('0x6b'));if(_0x3e63d3[_0x1258('0x4f')]){_0x3e63d3[_0x1258('0x4f')][_0x1258('0x34')](function(_0x247f6b){var _0x3321a8=_0x247f6b[0x0]===_0x1258('0x96')?_0x247f6b[0x0]:'i.'+_0x247f6b[0x0];_0x2bdc64['order'](_0x3321a8,_0x247f6b[0x1]===_0x1258('0x97')?![]:!![]);});}if(!_[_0x1258('0x7e')](_0x553042)){_0x2bdc64[_0x1258('0x6d')](_0x2bcad7);_0x50ca3d[_0x1258('0x51')](_0x1258('0x98'),_0x553042);}BPromise[_0x1258('0x99')]()[_0x1258('0x2c')](function(){if(!_0x2de959){if(_0x1bed44[_0x1258('0x47')]['WhatsappAccountId'])return;_0x50ca3d['where'](_0x1258('0x9a'));_0x2bdc64[_0x1258('0x51')](_0x1258('0x9a'));return;}if(_0x1bed44['user']['role']!==_0x1258('0x9b'))return;return _0x1bed44[_0x1258('0x9c')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x4bd427){if(_[_0x1258('0x7e')](_0x4bd427)){_0x50ca3d['where'](_0x1258('0x9d'));_0x2bdc64[_0x1258('0x51')](_0x1258('0x9d'));}else{_0x50ca3d[_0x1258('0x51')](_0x1258('0x80'),_[_0x1258('0x40')](_0x4bd427,'id'));_0x2bdc64[_0x1258('0x51')](_0x1258('0x80'),_[_0x1258('0x40')](_0x4bd427,'id'));}});})['then'](function(){if(_0x1bed44[_0x1258('0x9c')][_0x1258('0x9e')]===_0x1258('0x9b')&&!_0x2de959&&!_0x1bed44[_0x1258('0x47')][_0x1258('0x7f')])return[];return db['sequelize']['query'](_0x50ca3d[_0x1258('0x9f')](),_0x119488);})[_0x1258('0x2c')](function(_0x17d23f){_0x5d03dd[_0x1258('0x27')]=_0x17d23f[_0x1258('0x4c')];if(_0x5d03dd['count']===0x0)return[];return db[_0x1258('0xa0')][_0x1258('0x47')](_0x5954b8['toString'](),_0x119488)[_0x1258('0x2c')](function(_0x29cc2b){_0x2e7eb0=_[_0x1258('0xa1')](_0x29cc2b,'id');_0x119488=_['merge'](_0x119488,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1bed44['query'][_0x1258('0x4b')]){_0x3e63d3[_0x1258('0x4a')][_0x1258('0x34')](function(_0x37e446){_0x2bdc64[_0x1258('0x54')]('i.'+_0x37e446);});}else{_0x2bdc64[_0x1258('0x54')](_0x1258('0xa2'),_0x1258('0x6b'));_0x2bdc64[_0x1258('0x54')](_0x1258('0xa3'),_0x1258('0xa4'));_0x2bdc64[_0x1258('0x54')](_0x1258('0xa5'),_0x1258('0xa6'));_0x2bdc64[_0x1258('0x54')](_0x1258('0xa7'),_0x1258('0x96'));_0x2bdc64[_0x1258('0x54')]('i.*');_0x2bdc64[_0x1258('0x54')](_0x1258('0xa8'),_0x1258('0xa9'));_0x2bdc64[_0x1258('0x54')](_0x1258('0xaa'),_0x1258('0xab'));_0x2bdc64[_0x1258('0x54')](_0x1258('0xac'),'Contact.email');_0x2bdc64['field'](_0x1258('0xad'),_0x1258('0xae'));_0x2bdc64[_0x1258('0x54')](_0x1258('0xaf'),_0x1258('0xb0'));_0x2bdc64[_0x1258('0x54')](_0x1258('0xb1'),'Contact.fax');_0x2bdc64[_0x1258('0x54')](_0x1258('0xb2'),_0x1258('0xb3'));_0x2bdc64[_0x1258('0x54')]('o.internal',_0x1258('0xb4'));_0x2bdc64[_0x1258('0x54')](_0x1258('0xb5'),_0x1258('0x32'));}if(_0x3e63d3[_0x1258('0x26')])_0x2bdc64['limit'](_0x3e63d3[_0x1258('0x26')]);if(_0x3e63d3[_0x1258('0x24')])_0x2bdc64[_0x1258('0x24')](_0x3e63d3[_0x1258('0x24')]);return db[_0x1258('0xa0')]['query'](_0x2bdc64['toString'](),_0x119488);})[_0x1258('0x2c')](function(_0x121e53){if(_0x121e53[_0x1258('0x4c')]>0x0)_0x48789e[_0x1258('0x51')](_0x1258('0xb6'),_[_0x1258('0x40')](_0x121e53,'id'));return db['sequelize'][_0x1258('0x47')](_0x48789e['toString'](),_0x119488)[_0x1258('0x2c')](function(_0xee5b49){var _0x4697a7=_['groupBy'](_0xee5b49,_0x1258('0xb7'));var _0x4becf7=[];_0x121e53['forEach'](function(_0x4d7455){_0x4becf7[_0x1258('0x36')](updateWhatsappInteraction(_0x4d7455,_0x2e7eb0,_0x4697a7));});return BPromise[_0x1258('0xb8')](_0x4becf7);});});})[_0x1258('0x2c')](function(_0x212712){_0x5d03dd[_0x1258('0xb9')]=_0x212712;return _0x5d03dd;})[_0x1258('0x2c')](respondWithFilteredResult(_0x55a971,_0x3e63d3))[_0x1258('0x37')](handleError(_0x55a971,null));};exports[_0x1258('0xba')]=function(_0x58aadc,_0x13a53e){var _0xfb0d28={'raw':![],'where':{'id':_0x58aadc[_0x1258('0xbb')]['id']}},_0xa4c3f8={};_0xa4c3f8['model']=_['keys'](db['WhatsappInteraction'][_0x1258('0x42')]);_0xa4c3f8[_0x1258('0x47')]=_['keys'](_0x58aadc['query']);_0xa4c3f8['filters']=_[_0x1258('0x49')](_0xa4c3f8[_0x1258('0x46')],_0xa4c3f8[_0x1258('0x47')]);_0xfb0d28['attributes']=_[_0x1258('0x49')](_0xa4c3f8[_0x1258('0x46')],qs[_0x1258('0x4b')](_0x58aadc[_0x1258('0x47')][_0x1258('0x4b')]));_0xfb0d28[_0x1258('0x4a')]=_0xfb0d28[_0x1258('0x4a')]['length']?_0xfb0d28['attributes']:_0xa4c3f8['model'];if(_0x58aadc[_0x1258('0x47')][_0x1258('0xbc')]){_0xfb0d28[_0x1258('0xbd')]=[{'all':!![]}];}_0xfb0d28=_['merge']({},_0xfb0d28,_0x58aadc[_0x1258('0xbe')]);return db[_0x1258('0x41')][_0x1258('0x6a')](_0xfb0d28)[_0x1258('0x2c')](handleEntityNotFound(_0x13a53e,null))[_0x1258('0x2c')](respondWithResult(_0x13a53e,null))[_0x1258('0x37')](handleError(_0x13a53e,null));};exports[_0x1258('0xbf')]=function(_0x5dbc62,_0xcde6d2){return db['WhatsappInteraction']['create'](_0x5dbc62[_0x1258('0x7d')],{})['then'](respondWithResult(_0xcde6d2,0xc9))[_0x1258('0x37')](handleError(_0xcde6d2,null));};exports['update']=function(_0x22cc9e,_0x992b92){if(_0x22cc9e[_0x1258('0x7d')]['id']){delete _0x22cc9e['body']['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x22cc9e['params']['id']}})['then'](handleEntityNotFound(_0x992b92,null))[_0x1258('0x2c')](saveUpdates(_0x22cc9e['body'],null))[_0x1258('0x2c')](respondWithResult(_0x992b92,null))[_0x1258('0x37')](handleError(_0x992b92,null));};exports['destroy']=function(_0x5db075,_0x3ae00b){return db[_0x1258('0x41')][_0x1258('0x6a')]({'where':{'id':_0x5db075[_0x1258('0xbb')]['id']}})[_0x1258('0x2c')](handleEntityNotFound(_0x3ae00b,null))[_0x1258('0x2c')](removeEntity(_0x3ae00b,null))['catch'](handleError(_0x3ae00b,null));};exports[_0x1258('0xc0')]=function(_0x5f14c4,_0x6cabaf){return db[_0x1258('0x41')][_0x1258('0xc0')]()[_0x1258('0x2c')](respondWithResult(_0x6cabaf,null))[_0x1258('0x37')](handleError(_0x6cabaf,null));};exports[_0x1258('0xc1')]=function(_0x53607b,_0x1b25a0,_0xdee6b3){return db[_0x1258('0xc2')][_0x1258('0x6a')]({'where':{'id':_0x53607b[_0x1258('0xbb')]['id']}})[_0x1258('0x2c')](handleEntityNotFound(_0x1b25a0,null))['then'](function(_0xe6c898){if(_0xe6c898){return _0xe6c898['addMessage'](_0x53607b[_0x1258('0x7d')][_0x1258('0xc3')],_[_0x1258('0xc4')](_0x53607b[_0x1258('0x7d')],[_0x1258('0xc3'),'id'])||{});}})[_0x1258('0x2c')](respondWithResult(_0x1b25a0,null))[_0x1258('0x37')](handleError(_0x1b25a0,null));};exports[_0x1258('0xc5')]=function(_0x3dc18a,_0x1ac288,_0x4bb901){var _0x6f3497={'raw':![],'where':{}};var _0x53d447={};var _0x43c0f5={'count':0x0,'rows':[]};return db[_0x1258('0x41')]['findOne']({'where':{'id':_0x3dc18a[_0x1258('0xbb')]['id']}})['then'](handleEntityNotFound(_0x1ac288,null))['then'](function(_0x18ecce){if(_0x18ecce){_0x53d447[_0x1258('0x46')]=_['keys'](db[_0x1258('0xc2')][_0x1258('0x42')]);_0x53d447['query']=_['keys'](_0x3dc18a['query']);_0x53d447[_0x1258('0x52')]=_['intersection'](_0x53d447[_0x1258('0x46')],_0x53d447['query']);_0x6f3497[_0x1258('0x4a')]=_[_0x1258('0x49')](_0x53d447[_0x1258('0x46')],qs['fields'](_0x3dc18a[_0x1258('0x47')]['fields']));_0x6f3497['attributes']=_0x6f3497[_0x1258('0x4a')]['length']?_0x6f3497[_0x1258('0x4a')]:_0x53d447[_0x1258('0x46')];if(!_0x3dc18a[_0x1258('0x47')][_0x1258('0x4d')](_0x1258('0x4e'))){_0x6f3497['limit']=qs[_0x1258('0x26')](_0x3dc18a[_0x1258('0x47')][_0x1258('0x26')]);_0x6f3497[_0x1258('0x24')]=qs[_0x1258('0x24')](_0x3dc18a[_0x1258('0x47')]['offset']);}_0x6f3497[_0x1258('0x4f')]=qs[_0x1258('0x50')](_0x3dc18a[_0x1258('0x47')][_0x1258('0x50')]);_0x6f3497['where']=qs[_0x1258('0x52')](_['pick'](_0x3dc18a[_0x1258('0x47')],_0x53d447['filters']));_0x6f3497['where'][_0x1258('0xb7')]=_0x18ecce['id'];if(_0x3dc18a[_0x1258('0x47')][_0x1258('0x8d')]){_0x6f3497[_0x1258('0x51')]=_[_0x1258('0xc6')](_0x6f3497[_0x1258('0x51')],{'$or':_[_0x1258('0x40')](_0x6f3497[_0x1258('0x4a')],function(_0x55d07b){var _0x5a4349={};_0x5a4349[_0x55d07b]={'$like':'%'+_0x3dc18a['query'][_0x1258('0x8d')]+'%'};return _0x5a4349;})});}if(_0x3dc18a[_0x1258('0x47')]['$gte']){var _0x27f29f=_0x3dc18a['query'][_0x1258('0xc7')]['split'](',');var _0x517135={};_0x517135[_0x27f29f[0x0]]={'$gte':moment(_0x27f29f[0x1])[_0x1258('0xc8')](_0x1258('0xc9'))};_0x6f3497[_0x1258('0x51')]=_[_0x1258('0xc6')](_0x6f3497[_0x1258('0x51')],_0x517135);}_0x6f3497=_[_0x1258('0xc6')]({},_0x6f3497,_0x3dc18a[_0x1258('0xbe')]);return db[_0x1258('0xc2')][_0x1258('0x27')]({'where':_0x6f3497[_0x1258('0x51')]})[_0x1258('0x2c')](function(_0x55434c){_0x43c0f5[_0x1258('0x27')]=_0x55434c;if(_0x3dc18a['query'][_0x1258('0xbc')]){_0x6f3497[_0x1258('0xbd')]=[{'all':!![]}];}return db[_0x1258('0xc2')][_0x1258('0xca')](_0x6f3497);})['then'](function(_0x3d41bb){_0x43c0f5['rows']=_0x3d41bb;return _0x43c0f5;});}})[_0x1258('0x2c')](respondWithFilteredResult(_0x1ac288,_0x6f3497))['catch'](handleError(_0x1ac288,null));};exports[_0x1258('0xcb')]=function(_0x4ea1c6,_0x5a655a,_0x15dcf3){return db[_0x1258('0x41')][_0x1258('0x6a')]({'where':{'id':_0x4ea1c6[_0x1258('0xbb')]['id']}})[_0x1258('0x2c')](handleEntityNotFound(_0x5a655a,null))['then'](function(_0x49d184){if(_0x49d184){return _0x49d184[_0x1258('0xcc')](_0x4ea1c6[_0x1258('0x7d')][_0x1258('0xc3')],_[_0x1258('0xc4')](_0x4ea1c6[_0x1258('0x7d')],[_0x1258('0xc3'),'id'])||{})['spread'](function(){return db['Tag'][_0x1258('0xca')]({'attributes':['id','name','color'],'where':{'id':_0x4ea1c6[_0x1258('0x7d')][_0x1258('0xc3')]}});})[_0x1258('0x2c')](function(_0x41edb6){socket[_0x1258('0xcd')]('whatsappInteractionTags:save',{'id':Number(_0x4ea1c6['params']['id']),'tags':_0x41edb6||[]});return{'id':Number(_0x4ea1c6[_0x1258('0xbb')]['id']),'tags':_0x41edb6||[]};});}})[_0x1258('0x2c')](respondWithResult(_0x5a655a,null))[_0x1258('0x37')](handleError(_0x5a655a,null));};exports[_0x1258('0xce')]=function(_0x2533aa,_0x487d04,_0x1f0112){return db[_0x1258('0x41')]['find']({'where':{'id':_0x2533aa['params']['id']}})[_0x1258('0x2c')](handleEntityNotFound(_0x487d04,null))[_0x1258('0x2c')](function(_0x2bf139){if(_0x2bf139){return _0x2bf139[_0x1258('0xce')](_0x2533aa[_0x1258('0x47')][_0x1258('0xc3')]);}})[_0x1258('0x2c')](respondWithStatusCode(_0x487d04,null))['catch'](handleError(_0x487d04,null));};exports[_0x1258('0xcf')]=function(_0x33a7c2,_0x4684e3){var _0x1a72c7=moment()[_0x1258('0xd0')]()[_0x1258('0x9f')]();var _0x46a594=path[_0x1258('0xd1')](config[_0x1258('0xd2')],_0x1258('0xd3'),_0x1258('0xd4'),_0x1258('0xd5'));var _0x12ae68=path[_0x1258('0xd1')](config[_0x1258('0xd2')],_0x1258('0xd3'),'files',_0x1258('0xd6'));var _0x5a3ae9=path[_0x1258('0xd1')](_0x46a594,_0x1a72c7);var _0x3f02e8=util[_0x1258('0xc8')](_0x1258('0xd7'),_0x33a7c2[_0x1258('0xbb')]['id'],_0x1a72c7);var _0x2e1d8e=path[_0x1258('0xd1')](_0x46a594,_0x3f02e8);var _0x4d1147=[];_0x4d1147['push']({'model':db[_0x1258('0xd8')],'as':'User','attributes':['id',_0x1258('0xd9')],'raw':!![]});_0x4d1147[_0x1258('0x36')]({'model':db[_0x1258('0xda')],'as':'Contact','attributes':['id','firstName',_0x1258('0xdb')],'raw':!![]});if(_0x33a7c2[_0x1258('0x47')]['attachments']){_0x4d1147[_0x1258('0x36')]({'model':db['Attachment'],'as':_0x1258('0xdc'),'raw':!![]});}var _0x27658e=[{'model':db['WhatsappMessage'],'as':_0x1258('0xdd'),'attributes':['id',_0x1258('0x7d'),_0x1258('0x82'),'direction',_0x1258('0xde'),'read'],'include':_0x4d1147}];_0x27658e[_0x1258('0x36')]({'model':db[_0x1258('0xdf')],'as':_0x1258('0xe0'),'attributes':['id','name']});_0x27658e[_0x1258('0x36')]({'model':db[_0x1258('0xd8')],'as':_0x1258('0xe1'),'attributes':['id',_0x1258('0xd9')]});return db[_0x1258('0x41')][_0x1258('0x6a')]({'where':{'id':_0x33a7c2[_0x1258('0xbb')]['id']},'include':_0x27658e})[_0x1258('0x2c')](handleEntityNotFound(_0x4684e3,null))['then'](function(_0x5832c9){if(_0x5832c9){var _0x14681c=_0x5832c9['get']({'plain':!![]});fs[_0x1258('0xe2')](_0x5a3ae9);var _0x490652={'channel':'Whatsapp','account':_0x14681c[_0x1258('0xe0')][_0x1258('0x2f')],'agent':_0x14681c[_0x1258('0xe1')]?_0x14681c[_0x1258('0xe1')][_0x1258('0xd9')]:_0x1258('0xe3'),'createdAt':moment(_0x14681c[_0x1258('0x82')])['format'](_0x1258('0xc9'))['toString'](),'closedAt':_0x14681c[_0x1258('0x3c')]?moment(_0x14681c['closedAt'])[_0x1258('0xc8')](_0x1258('0xc9'))[_0x1258('0x9f')]():'','disposition':_0x14681c[_0x1258('0xe4')],'messages':_(_0x14681c[_0x1258('0xdd')])['filter']({'secret':![]})[_0x1258('0x40')](function(_0x1ab77b){if(_0x1ab77b[_0x1258('0xdc')]){var _0x3314bc=path[_0x1258('0xd1')](_0x12ae68,_0x1ab77b[_0x1258('0xdc')][_0x1258('0xe5')]);if(fs['existsSync'](_0x3314bc)){fs[_0x1258('0xe6')](_0x3314bc)[_0x1258('0xe7')](fs['createWriteStream'](path[_0x1258('0xd1')](_0x5a3ae9,_0x1ab77b['Attachment'][_0x1258('0xe5')])));}}return{'date':moment(_0x1ab77b['createdAt'])[_0x1258('0xc8')](_0x1258('0xc9'))[_0x1258('0x9f')](),'sender':_0x1ab77b[_0x1258('0xe8')]===_0x1258('0xe9')?_0x1ab77b[_0x1258('0xd8')]?_0x1ab77b[_0x1258('0xd8')]['fullname']:_0x1258('0xea'):_0x1ab77b[_0x1258('0x70')][_0x1258('0xeb')]+(_0x1ab77b['Contact']['lastName']?'\x20'+_0x1ab77b[_0x1258('0x70')][_0x1258('0xdb')]:''),'body':_0x1ab77b[_0x1258('0xdc')]?_0x1ab77b['Attachment'][_0x1258('0xe5')]:_0x1ab77b[_0x1258('0x7d')],'direction':_0x1ab77b['direction']==='out'?'A':'C','secret':_0x1ab77b[_0x1258('0xde')],'read':_0x1ab77b[_0x1258('0x89')],'attachment':_0x1ab77b[_0x1258('0xdc')]};})[_0x1258('0x6c')]()};return ejs[_0x1258('0xec')](path[_0x1258('0xd1')](config[_0x1258('0xd2')],_0x1258('0xd3'),_0x1258('0xed'),_0x1258('0xee')),{'interaction':_0x490652})[_0x1258('0x2c')](function(_0x4b9464){var _0x551e00=path['join'](_0x5a3ae9,_0x1258('0xef')+_0x14681c['id']+'-'+_0x1a72c7+_0x1258('0xf0'));var _0x267863={'path':_0x551e00,'channel':_0x1258('0xf1'),'interactionId':_0x14681c['id']};return pdf['createPdfFromHTML'](_0x4b9464,_0x267863);})['then'](function(){return new BPromise(function(_0x23561e,_0x54a6b1){zipdir(_0x5a3ae9,{'saveTo':_0x2e1d8e},function(_0xd37daa,_0x58d322){if(_0xd37daa)return _0x54a6b1(_0xd37daa);return _0x23561e(_0x58d322);});})[_0x1258('0x2c')](function(){return new BPromise(function(_0x2cf40c,_0x35d199){rimraf(_0x5a3ae9,function(_0x3c36aa){if(_0x3c36aa)_0x35d199(_0x3c36aa);return _0x2cf40c();});});})[_0x1258('0x2c')](function(){return _0x4684e3[_0x1258('0xcf')](_0x2e1d8e,_0x3f02e8,function(_0x4654c6){if(_0x4654c6){console[_0x1258('0xf2')](_0x1258('0xf3'),_0x4654c6);}else{fs[_0x1258('0xf4')](_0x2e1d8e);}});});});}else{return _0x4684e3[_0x1258('0x20')](0xc8);}})['catch'](handleError(_0x4684e3,null));};
\ No newline at end of file
+var _0xf277=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','map','WhatsappInteraction','rawAttributes','type','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','users','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','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','union','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','keys','some','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$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','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','show','params','include','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','join','server','files','tmp','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','createdAt','secret','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','direction','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x1a1f21,_0x305aa1){var _0x5f0e83=function(_0x377400){while(--_0x377400){_0x1a1f21['push'](_0x1a1f21['shift']());}};_0x5f0e83(++_0x305aa1);}(_0xf277,0x1e1));var _0x7f27=function(_0xca4d39,_0x6d9cdc){_0xca4d39=_0xca4d39-0x0;var _0x51725a=_0xf277[_0xca4d39];return _0x51725a;};'use strict';var emlformat=require(_0x7f27('0x0'));var rimraf=require(_0x7f27('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f27('0x2'));var rp=require('request-promise');var moment=require(_0x7f27('0x3'));var BPromise=require(_0x7f27('0x4'));var Mustache=require(_0x7f27('0x5'));var util=require(_0x7f27('0x6'));var path=require(_0x7f27('0x7'));var sox=require('sox');var csv=require(_0x7f27('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f27('0x9'));var _=require(_0x7f27('0xa'));var squel=require('squel');var crypto=require(_0x7f27('0xb'));var jsforce=require(_0x7f27('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7f27('0x8'));var querystring=require(_0x7f27('0xd'));var Papa=require(_0x7f27('0xe'));var Redis=require(_0x7f27('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7f27('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x7f27('0x11'));var logger=require(_0x7f27('0x12'))(_0x7f27('0x13'));var utils=require(_0x7f27('0x14'));var config=require(_0x7f27('0x15'));var licenseUtil=require(_0x7f27('0x16'));var db=require('../../mysqldb')['db'];config[_0x7f27('0x17')]=_[_0x7f27('0x18')](config['redis'],{'host':_0x7f27('0x19'),'port':0x18eb});var socket=require(_0x7f27('0x1a'))(new Redis(config[_0x7f27('0x17')]));require(_0x7f27('0x1b'))[_0x7f27('0x1c')](socket);function respondWithStatusCode(_0xddc730,_0x3aeb70){_0x3aeb70=_0x3aeb70||0xcc;return function(_0x19a061){if(_0x19a061){return _0xddc730['sendStatus'](_0x3aeb70);}return _0xddc730[_0x7f27('0x1d')](_0x3aeb70)[_0x7f27('0x1e')]();};}function respondWithResult(_0x4c4548,_0x43f3da){_0x43f3da=_0x43f3da||0xc8;return function(_0x402610){if(_0x402610){return _0x4c4548['status'](_0x43f3da)[_0x7f27('0x1f')](_0x402610);}};}function respondWithFilteredResult(_0x30a56b,_0x9ec445){return function(_0x16266b){if(_0x16266b){var _0x4c0e35=typeof _0x9ec445[_0x7f27('0x20')]===_0x7f27('0x21')&&typeof _0x9ec445[_0x7f27('0x22')]===_0x7f27('0x21');var _0x14150e=_0x16266b[_0x7f27('0x23')];var _0x25cb87=_0x4c0e35?0x0:_0x9ec445[_0x7f27('0x20')];var _0x14adf7=_0x4c0e35?_0x16266b[_0x7f27('0x23')]:_0x9ec445['offset']+_0x9ec445[_0x7f27('0x22')];var _0x25f252;if(_0x14adf7>=_0x14150e){_0x14adf7=_0x14150e;_0x25f252=0xc8;}else{_0x25f252=0xce;}_0x30a56b[_0x7f27('0x1d')](_0x25f252);return _0x30a56b[_0x7f27('0x24')](_0x7f27('0x25'),_0x25cb87+'-'+_0x14adf7+'/'+_0x14150e)[_0x7f27('0x1f')](_0x16266b);}return null;};}function patchUpdates(_0x25bcc8){return function(_0x524733){try{jsonpatch[_0x7f27('0x26')](_0x524733,_0x25bcc8,!![]);}catch(_0x37b249){return BPromise[_0x7f27('0x27')](_0x37b249);}return _0x524733[_0x7f27('0x28')]();};}function saveUpdates(_0x5cb7d0,_0x4af612){return function(_0x1a9e04){if(_0x1a9e04){return _0x1a9e04[_0x7f27('0x29')](_0x5cb7d0)['then'](function(_0x5c266f){return _0x5c266f;});}return null;};}function removeEntity(_0x33de24,_0x2701d9){return function(_0x3ddb49){if(_0x3ddb49){return _0x3ddb49[_0x7f27('0x2a')]()[_0x7f27('0x2b')](function(){_0x33de24[_0x7f27('0x1d')](0xcc)[_0x7f27('0x1e')]();});}};}function handleEntityNotFound(_0x49c61e,_0x5d13d9){return function(_0x16ecc0){if(!_0x16ecc0){_0x49c61e[_0x7f27('0x2c')](0x194);}return _0x16ecc0;};}function handleError(_0x50a1e4,_0x4aa824){_0x4aa824=_0x4aa824||0x1f4;return function(_0x41a2b2){logger[_0x7f27('0x2d')](_0x41a2b2[_0x7f27('0x2e')]);if(_0x41a2b2[_0x7f27('0x2f')]){delete _0x41a2b2[_0x7f27('0x2f')];}_0x50a1e4[_0x7f27('0x1d')](_0x4aa824)[_0x7f27('0x30')](_0x41a2b2);};}function getInteractionUsers(_0x363986,_0x368fc3){return new BPromise(function(_0x6838ef,_0x3ddacf){try{if(_0x368fc3[_0x363986['id']]){_0x363986[_0x7f27('0x31')]=_['map'](_0x368fc3[_0x363986['id']],function(_0x160216){return{'id':_0x160216['id'],'fullname':_0x160216[_0x7f27('0x32')]};});}}catch(_0x30f331){_0x3ddacf(_0x30f331);}_0x6838ef(_0x363986);});}function getInteractionTags(_0x5bec8b,_0x3c585a){return new BPromise(function(_0x7d094a,_0x5b0da9){try{if(_0x5bec8b[_0x7f27('0x33')]){_0x5bec8b[_0x7f27('0x34')]=[];_0x5bec8b[_0x7f27('0x33')]['split'](',')['forEach'](function(_0x5908b3){_0x5bec8b['Tags'][_0x7f27('0x35')](_0x3c585a[_0x5908b3]);});}delete _0x5bec8b[_0x7f27('0x33')];}catch(_0x46e7eb){_0x5b0da9(_0x46e7eb);}_0x7d094a(_0x5bec8b);});}function updateWhatsappInteraction(_0x663d2b,_0x4f30e4,_0x50b69f){return new BPromise(function(_0xe80090,_0x27c996){return getInteractionUsers(_0x663d2b,_0x50b69f)['then'](function(_0x728430){return getInteractionTags(_0x728430,_0x4f30e4);})['then'](function(_0x6ae642){return getStateInteraction(_0x6ae642);})['then'](function(_0x486d29){_0xe80090(_0x486d29);})[_0x7f27('0x36')](function(_0x11d269){_0x27c996(_0x11d269);});});}function getStateInteraction(_0x5f5b3f){return new BPromise(function(_0x3907b1){_0x5f5b3f[_0x7f27('0x37')]=0x0;_0x5f5b3f[_0x7f27('0x38')]=0x0;_0x5f5b3f[_0x7f27('0x39')]=0x0;_0x5f5b3f[_0x7f27('0x3a')]=0x0;_0x5f5b3f[_0x7f27('0x3b')]=0x0;if(!_0x5f5b3f[_0x7f27('0x3c')]&&!_0x5f5b3f['UserId']){_0x5f5b3f[_0x7f27('0x37')]+=0x1;}if(!_0x5f5b3f[_0x7f27('0x3c')]&&_0x5f5b3f['UserId']){_0x5f5b3f[_0x7f27('0x38')]+=0x1;if(_0x5f5b3f['waiting']){_0x5f5b3f[_0x7f27('0x37')]-=0x1;}}if(_0x5f5b3f['closed']&&_0x5f5b3f[_0x7f27('0x3d')]){_0x5f5b3f[_0x7f27('0x39')]+=0x1;if(_0x5f5b3f[_0x7f27('0x38')]){_0x5f5b3f[_0x7f27('0x38')]-=0x1;}}if(_0x5f5b3f[_0x7f27('0x3c')]&&!_0x5f5b3f[_0x7f27('0x3d')]){_0x5f5b3f[_0x7f27('0x3a')]+=0x1;if(_0x5f5b3f[_0x7f27('0x37')]){_0x5f5b3f[_0x7f27('0x37')]-=0x1;}}_0x5f5b3f[_0x7f27('0x3b')]+=0x1;_0x3907b1(_0x5f5b3f);});}exports['index']=function(_0x56f386,_0x1cf2ff){var _0x4abdbd={},_0x557f62={},_0x3e2a11={'count':0x0,'rows':[]};var _0x28f143=_[_0x7f27('0x3e')](db[_0x7f27('0x3f')][_0x7f27('0x40')],function(_0x35e5dc){return{'name':_0x35e5dc['fieldName'],'type':_0x35e5dc[_0x7f27('0x41')]['key']};});_0x557f62[_0x7f27('0x42')]=_['map'](_0x28f143,'name');_0x557f62['query']=_['keys'](_0x56f386['query']);_0x557f62[_0x7f27('0x43')]=_[_0x7f27('0x44')](_0x557f62[_0x7f27('0x42')],_0x557f62[_0x7f27('0x45')]);_0x4abdbd['attributes']=_[_0x7f27('0x44')](_0x557f62[_0x7f27('0x42')],qs['fields'](_0x56f386[_0x7f27('0x45')][_0x7f27('0x46')]));_0x4abdbd[_0x7f27('0x47')]=_0x4abdbd['attributes'][_0x7f27('0x48')]?_0x4abdbd[_0x7f27('0x47')]:_0x557f62[_0x7f27('0x42')];if(!_0x56f386[_0x7f27('0x45')][_0x7f27('0x49')](_0x7f27('0x4a'))){_0x4abdbd[_0x7f27('0x22')]=qs[_0x7f27('0x22')](_0x56f386[_0x7f27('0x45')][_0x7f27('0x22')]);_0x4abdbd[_0x7f27('0x20')]=qs[_0x7f27('0x20')](_0x56f386[_0x7f27('0x45')][_0x7f27('0x20')]);}_0x4abdbd['order']=qs[_0x7f27('0x4b')](_0x56f386[_0x7f27('0x45')][_0x7f27('0x4b')]);_0x4abdbd[_0x7f27('0x4c')]=qs[_0x7f27('0x43')](_[_0x7f27('0x4d')](_0x56f386[_0x7f27('0x45')],_0x557f62[_0x7f27('0x43')]),_0x28f143);var _0x3797b8=[];var _0x52baf9=squel[_0x7f27('0x4e')]()['field']('id')[_0x7f27('0x4f')]('name')[_0x7f27('0x4f')](_0x7f27('0x50'))[_0x7f27('0x51')](_0x7f27('0x52'));var _0x541972=squel[_0x7f27('0x4e')]()[_0x7f27('0x4f')]('u.id')[_0x7f27('0x4f')]('u.fullname')[_0x7f27('0x4f')](_0x7f27('0x53'))['from'](_0x7f27('0x54'),'ui')[_0x7f27('0x55')]('users','u',_0x7f27('0x56'));var _0x5a0ddc=squel[_0x7f27('0x4e')]()[_0x7f27('0x51')]('whatsapp_interactions','i')[_0x7f27('0x55')](_0x7f27('0x57'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x7f27('0x58'),'o',_0x7f27('0x59'))[_0x7f27('0x55')](_0x7f27('0x5a'),'a',_0x7f27('0x5b'))[_0x7f27('0x55')](_0x7f27('0x5c'),'me',_0x7f27('0x5d'))['left_join'](_0x7f27('0x5e'),'it',_0x7f27('0x5f'))[_0x7f27('0x55')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x2d3100=squel[_0x7f27('0x60')]();var _0x238b9c=[];var _0x498080=squel[_0x7f27('0x60')]();var _0x2e28fc;if(_0x56f386[_0x7f27('0x45')][_0x7f27('0x61')]){_0x2e28fc=as[_0x7f27('0x62')](_0x56f386[_0x7f27('0x45')]['search']);var _0x1d772=_0x2e28fc['sqlOperator'];for(var _0x5c53bd=0x0;_0x5c53bd<_0x2e28fc[_0x7f27('0x63')]['length'];_0x5c53bd++){var _0x395787=_0x2e28fc[_0x7f27('0x63')][_0x5c53bd];var _0x1f0538='i';var _0x466ad8=_[_0x7f27('0x64')](_0x28f143,['name',_0x395787['field']]);if(!_0x466ad8){switch(_0x395787[_0x7f27('0x4f')]){case _0x7f27('0x65'):if(_0x395787[_0x7f27('0x66')]==0x1){_0x5a0ddc[_0x7f27('0x67')]('`'+_0x395787[_0x7f27('0x4f')]+_0x7f27('0x68'));}else{_0x5a0ddc[_0x7f27('0x67')]('`'+_0x395787['field']+'`\x20>\x200');}break;case'Contact':if(_0x395787['operator']==='$substring'){if(_0x395787[_0x7f27('0x66')][_0x7f27('0x69')]('\x20')[_0x7f27('0x48')]>0x1){_0x2d3100[_0x1d772]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7f27('0x6a')](_0x395787[_0x7f27('0x66')]),null);}else{var _0x357d96='%'+_0x395787[_0x7f27('0x66')]+'%';_0x2d3100[_0x1d772](_0x7f27('0x6b'),_0x357d96,_0x357d96,_0x357d96);}}else{_0x466ad8=_[_0x7f27('0x64')](_0x28f143,[_0x7f27('0x2f'),'ContactId']);_0x395787[_0x7f27('0x4f')]=_0x7f27('0x6c');_0x1df29d=as['buildExpression'](_0x1f0538,_0x466ad8[_0x7f27('0x41')],_0x395787);_0x2d3100[_0x1d772](_0x1df29d[_0x7f27('0x6d')],_0x1df29d[_0x7f27('0x66')][_0x7f27('0x6e')],_0x1df29d['value'][_0x7f27('0x1e')]);}break;case _0x7f27('0x6f'):var _0xe1ccde=_0x395787['value'][_0x7f27('0x69')](',')[_0x7f27('0x3e')](function(_0x3be13c){return Number(_0x3be13c);});_0xe1ccde[_0x7f27('0x70')](function(_0x5df816){_0x498080['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5df816+',%');});_0x238b9c=_[_0x7f27('0x71')](_0x238b9c,_0xe1ccde);break;case'User':if(_0x395787[_0x7f27('0x72')]===_0x7f27('0x73')){_0x2d3100[_0x1d772](_0x7f27('0x74'),'%'+_0x395787[_0x7f27('0x66')]+'%',null);}else{_0x466ad8=_[_0x7f27('0x64')](_0x28f143,['name',_0x7f27('0x3d')]);_0x395787[_0x7f27('0x4f')]=_0x7f27('0x3d');_0x1df29d=as[_0x7f27('0x75')](_0x1f0538,_0x466ad8[_0x7f27('0x41')],_0x395787);_0x2d3100[_0x1d772](_0x1df29d[_0x7f27('0x6d')],_0x1df29d['value'][_0x7f27('0x6e')],_0x1df29d[_0x7f27('0x66')][_0x7f27('0x1e')]);}break;case _0x7f27('0x76'):_0x1df29d=as[_0x7f27('0x75')]('me',null,_0x395787);_0x2d3100[_0x1d772](_0x1df29d[_0x7f27('0x6d')],_0x1df29d[_0x7f27('0x66')][_0x7f27('0x6e')],_0x1df29d['value'][_0x7f27('0x1e')]);break;}}else{var _0x1df29d=as[_0x7f27('0x75')](_0x1f0538,_0x466ad8[_0x7f27('0x41')],_0x395787);_0x2d3100[_0x1d772](_0x1df29d[_0x7f27('0x6d')],_0x1df29d[_0x7f27('0x66')][_0x7f27('0x6e')],_0x1df29d[_0x7f27('0x66')][_0x7f27('0x1e')]);}}}else{var _0x4bc05c=_(_0x56f386[_0x7f27('0x45')])[_0x7f27('0x77')]()[_0x7f27('0x3e')](function(_0x128ada){return _[_0x7f27('0x78')](_0x28f143,[_0x7f27('0x2f'),_0x128ada])?_0x128ada:undefined;})['compact']()['value']();if(!_[_0x7f27('0x79')](_0x4bc05c)){_0x4bc05c[_0x7f27('0x70')](function(_0x1f017d){if(_0x1f017d==='WhatsappAccountId'){_0x5a0ddc[_0x7f27('0x4c')](_0x7f27('0x7a'),[][_0x7f27('0x7b')](_0x56f386[_0x7f27('0x45')][_0x1f017d]));}else if(_0x1f017d==='createdAt'){var _0x1fe9ff=JSON[_0x7f27('0x7c')](_0x56f386[_0x7f27('0x45')][_0x1f017d])[_0x7f27('0x7d')];var _0x430dc8=JSON['parse'](_0x56f386[_0x7f27('0x45')][_0x1f017d])[_0x7f27('0x7e')];_0x5a0ddc[_0x7f27('0x4c')](_0x7f27('0x7f'),_0x1fe9ff,_0x430dc8);}else{if(_0x56f386[_0x7f27('0x45')][_0x1f017d]===_0x7f27('0x80')){_0x5a0ddc['where']('i.'+_0x1f017d+_0x7f27('0x81'));}else{_0x5a0ddc[_0x7f27('0x4c')]('i.'+_0x1f017d+_0x7f27('0x82'),_0x56f386['query'][_0x1f017d]);}}});}if(_0x56f386['query']['read']){if(_0x56f386['query'][_0x7f27('0x83')]==0x1){_0x5a0ddc['having'](_0x7f27('0x84'));}else{_0x5a0ddc['having'](_0x7f27('0x85'));}}if(_0x56f386[_0x7f27('0x45')][_0x7f27('0x86')]){_0x238b9c=_[_0x7f27('0x87')](_0x56f386['query']['tag'])?_0x56f386[_0x7f27('0x45')][_0x7f27('0x86')]:new Array(_0x56f386[_0x7f27('0x45')][_0x7f27('0x86')]);_0x238b9c[_0x7f27('0x70')](function(_0x17b786){_0x498080['or'](_0x7f27('0x88'),'%,'+_0x17b786+',%');});}if(_0x56f386[_0x7f27('0x45')][_0x7f27('0x89')]){var _0x3402a3=_0x56f386['query']['filter'][_0x7f27('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7f27('0x8b')](_0x3402a3)){_0x2d3100['or'](_0x7f27('0x8c'),_0x3402a3+'%')['or'](_0x7f27('0x8d'),_0x3402a3+'%');}else{_0x2d3100['or'](_0x7f27('0x8e'),qs[_0x7f27('0x6a')](_0x3402a3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3402a3+'%');}}}_0x5a0ddc[_0x7f27('0x4c')](_0x2d3100);_0x5a0ddc[_0x7f27('0x8f')](_0x7f27('0x90'));var _0x1c793e={'type':db['Sequelize'][_0x7f27('0x91')]['SELECT'],'raw':!![]};var _0x5be716=_0x5a0ddc[_0x7f27('0x92')]();_0x5be716[_0x7f27('0x4f')]('i.id');_0x5be716['field'](_0x7f27('0x93'),'unreadMessages');if(_0x4abdbd[_0x7f27('0x94')]){_0x4abdbd[_0x7f27('0x94')][_0x7f27('0x70')](function(_0x428835){var _0x326f11=_0x428835[0x0]===_0x7f27('0x95')?_0x428835[0x0]:'i.'+_0x428835[0x0];_0x5a0ddc[_0x7f27('0x94')](_0x326f11,_0x428835[0x1]===_0x7f27('0x96')?![]:!![]);});}if(!_[_0x7f27('0x79')](_0x238b9c)){_0x5a0ddc[_0x7f27('0x67')](_0x498080);_0x5be716['where'](_0x7f27('0x97'),_0x238b9c);}BPromise[_0x7f27('0x98')]()[_0x7f27('0x2b')](function(){if(!_0x2e28fc){if(_0x56f386[_0x7f27('0x45')][_0x7f27('0x99')])return;_0x5be716['where'](_0x7f27('0x9a'));_0x5a0ddc[_0x7f27('0x4c')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x56f386[_0x7f27('0x9b')][_0x7f27('0x9c')]!==_0x7f27('0x9d'))return;return _0x56f386[_0x7f27('0x9b')][_0x7f27('0x9e')]({'attributes':['id'],'raw':!![]})[_0x7f27('0x2b')](function(_0x3da33){if(_[_0x7f27('0x79')](_0x3da33)){_0x5be716[_0x7f27('0x4c')](_0x7f27('0x9f'));_0x5a0ddc[_0x7f27('0x4c')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x5be716[_0x7f27('0x4c')](_0x7f27('0x7a'),_[_0x7f27('0x3e')](_0x3da33,'id'));_0x5a0ddc['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x7f27('0x3e')](_0x3da33,'id'));}});})['then'](function(){if(_0x56f386['user'][_0x7f27('0x9c')]===_0x7f27('0x9d')&&!_0x2e28fc&&!_0x56f386[_0x7f27('0x45')]['WhatsappAccountId'])return[];return db[_0x7f27('0xa0')]['query'](_0x5be716[_0x7f27('0xa1')](),_0x1c793e);})[_0x7f27('0x2b')](function(_0x25055d){_0x3e2a11[_0x7f27('0x23')]=_0x25055d[_0x7f27('0x48')];if(_0x3e2a11[_0x7f27('0x23')]===0x0)return[];return db[_0x7f27('0xa0')][_0x7f27('0x45')](_0x52baf9[_0x7f27('0xa1')](),_0x1c793e)[_0x7f27('0x2b')](function(_0x396317){_0x3797b8=_['keyBy'](_0x396317,'id');_0x1c793e=_[_0x7f27('0xa2')](_0x1c793e,{'model':db[_0x7f27('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x56f386['query'][_0x7f27('0x46')]){_0x4abdbd['attributes']['forEach'](function(_0x2cde8f){_0x5a0ddc[_0x7f27('0x4f')]('i.'+_0x2cde8f);});}else{_0x5a0ddc['field'](_0x7f27('0x93'),'unreadMessages');_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xa3'),'Account.key');_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xa4'),_0x7f27('0xa5'));_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xa6'),'contactName');_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xa7'));_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xa8'),_0x7f27('0xa9'));_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xaa'),_0x7f27('0xab'));_0x5a0ddc[_0x7f27('0x4f')]('c.email',_0x7f27('0xac'));_0x5a0ddc['field'](_0x7f27('0xad'),_0x7f27('0xae'));_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xaf'),_0x7f27('0xb0'));_0x5a0ddc['field']('c.fax',_0x7f27('0xb1'));_0x5a0ddc[_0x7f27('0x4f')]('o.fullname','Owner.fullname');_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xb2'),_0x7f27('0xb3'));_0x5a0ddc[_0x7f27('0x4f')](_0x7f27('0xb4'),_0x7f27('0x33'));}if(_0x4abdbd[_0x7f27('0x22')])_0x5a0ddc[_0x7f27('0x22')](_0x4abdbd[_0x7f27('0x22')]);if(_0x4abdbd['offset'])_0x5a0ddc[_0x7f27('0x20')](_0x4abdbd['offset']);return db[_0x7f27('0xa0')][_0x7f27('0x45')](_0x5a0ddc[_0x7f27('0xa1')](),_0x1c793e);})[_0x7f27('0x2b')](function(_0x15a3d9){if(_0x15a3d9[_0x7f27('0x48')]>0x0)_0x541972[_0x7f27('0x4c')](_0x7f27('0xb5'),_[_0x7f27('0x3e')](_0x15a3d9,'id'));return db[_0x7f27('0xa0')][_0x7f27('0x45')](_0x541972[_0x7f27('0xa1')](),_0x1c793e)['then'](function(_0x433717){var _0x12264f=_['groupBy'](_0x433717,_0x7f27('0xb6'));var _0x5e2a3c=[];_0x15a3d9[_0x7f27('0x70')](function(_0x126934){_0x5e2a3c[_0x7f27('0x35')](updateWhatsappInteraction(_0x126934,_0x3797b8,_0x12264f));});return BPromise[_0x7f27('0xb7')](_0x5e2a3c);});});})['then'](function(_0x4b09c4){_0x3e2a11[_0x7f27('0xb8')]=_0x4b09c4;return _0x3e2a11;})['then'](respondWithFilteredResult(_0x1cf2ff,_0x4abdbd))[_0x7f27('0x36')](handleError(_0x1cf2ff,null));};exports[_0x7f27('0xb9')]=function(_0x44b370,_0xd7427f){var _0x5a65a9={'raw':![],'where':{'id':_0x44b370[_0x7f27('0xba')]['id']}},_0x632861={};_0x632861[_0x7f27('0x42')]=_[_0x7f27('0x77')](db['WhatsappInteraction'][_0x7f27('0x40')]);_0x632861[_0x7f27('0x45')]=_[_0x7f27('0x77')](_0x44b370[_0x7f27('0x45')]);_0x632861[_0x7f27('0x43')]=_[_0x7f27('0x44')](_0x632861[_0x7f27('0x42')],_0x632861['query']);_0x5a65a9[_0x7f27('0x47')]=_['intersection'](_0x632861[_0x7f27('0x42')],qs[_0x7f27('0x46')](_0x44b370[_0x7f27('0x45')][_0x7f27('0x46')]));_0x5a65a9[_0x7f27('0x47')]=_0x5a65a9[_0x7f27('0x47')][_0x7f27('0x48')]?_0x5a65a9[_0x7f27('0x47')]:_0x632861['model'];if(_0x44b370[_0x7f27('0x45')]['includeAll']){_0x5a65a9[_0x7f27('0xbb')]=[{'all':!![]}];}_0x5a65a9=_[_0x7f27('0xa2')]({},_0x5a65a9,_0x44b370['options']);return db[_0x7f27('0x3f')]['find'](_0x5a65a9)[_0x7f27('0x2b')](handleEntityNotFound(_0xd7427f,null))[_0x7f27('0x2b')](respondWithResult(_0xd7427f,null))[_0x7f27('0x36')](handleError(_0xd7427f,null));};exports[_0x7f27('0xbc')]=function(_0x25e33d,_0x6918ce){return db[_0x7f27('0x3f')]['create'](_0x25e33d[_0x7f27('0x76')],{})['then'](respondWithResult(_0x6918ce,0xc9))[_0x7f27('0x36')](handleError(_0x6918ce,null));};exports[_0x7f27('0x29')]=function(_0x27c0c7,_0x49f78f){if(_0x27c0c7['body']['id']){delete _0x27c0c7[_0x7f27('0x76')]['id'];}return db[_0x7f27('0x3f')][_0x7f27('0x64')]({'where':{'id':_0x27c0c7[_0x7f27('0xba')]['id']}})[_0x7f27('0x2b')](handleEntityNotFound(_0x49f78f,null))[_0x7f27('0x2b')](saveUpdates(_0x27c0c7[_0x7f27('0x76')],null))[_0x7f27('0x2b')](respondWithResult(_0x49f78f,null))[_0x7f27('0x36')](handleError(_0x49f78f,null));};exports[_0x7f27('0x2a')]=function(_0x2902f5,_0x57e49e){return db['WhatsappInteraction']['find']({'where':{'id':_0x2902f5[_0x7f27('0xba')]['id']}})[_0x7f27('0x2b')](handleEntityNotFound(_0x57e49e,null))['then'](removeEntity(_0x57e49e,null))[_0x7f27('0x36')](handleError(_0x57e49e,null));};exports[_0x7f27('0xbd')]=function(_0x1f4026,_0x50c458){return db[_0x7f27('0x3f')][_0x7f27('0xbd')]()['then'](respondWithResult(_0x50c458,null))[_0x7f27('0x36')](handleError(_0x50c458,null));};exports[_0x7f27('0xbe')]=function(_0x22cfd6,_0x59ae7d,_0x5e6189){return db[_0x7f27('0xbf')]['find']({'where':{'id':_0x22cfd6[_0x7f27('0xba')]['id']}})[_0x7f27('0x2b')](handleEntityNotFound(_0x59ae7d,null))[_0x7f27('0x2b')](function(_0x4e074a){if(_0x4e074a){return _0x4e074a[_0x7f27('0xbe')](_0x22cfd6['body'][_0x7f27('0xc0')],_[_0x7f27('0xc1')](_0x22cfd6[_0x7f27('0x76')],['ids','id'])||{});}})[_0x7f27('0x2b')](respondWithResult(_0x59ae7d,null))[_0x7f27('0x36')](handleError(_0x59ae7d,null));};exports[_0x7f27('0xc2')]=function(_0x7aefd5,_0x3e65ba,_0x553b55){var _0x550bbf={'raw':![],'where':{}};var _0x11b5fe={};var _0x32da7e={'count':0x0,'rows':[]};return db[_0x7f27('0x3f')][_0x7f27('0xc3')]({'where':{'id':_0x7aefd5['params']['id']}})[_0x7f27('0x2b')](handleEntityNotFound(_0x3e65ba,null))[_0x7f27('0x2b')](function(_0x55c750){if(_0x55c750){_0x11b5fe['model']=_[_0x7f27('0x77')](db[_0x7f27('0xbf')]['rawAttributes']);_0x11b5fe[_0x7f27('0x45')]=_[_0x7f27('0x77')](_0x7aefd5[_0x7f27('0x45')]);_0x11b5fe[_0x7f27('0x43')]=_[_0x7f27('0x44')](_0x11b5fe['model'],_0x11b5fe['query']);_0x550bbf[_0x7f27('0x47')]=_[_0x7f27('0x44')](_0x11b5fe[_0x7f27('0x42')],qs[_0x7f27('0x46')](_0x7aefd5['query'][_0x7f27('0x46')]));_0x550bbf['attributes']=_0x550bbf['attributes'][_0x7f27('0x48')]?_0x550bbf[_0x7f27('0x47')]:_0x11b5fe[_0x7f27('0x42')];if(!_0x7aefd5[_0x7f27('0x45')]['hasOwnProperty'](_0x7f27('0x4a'))){_0x550bbf[_0x7f27('0x22')]=qs[_0x7f27('0x22')](_0x7aefd5[_0x7f27('0x45')][_0x7f27('0x22')]);_0x550bbf[_0x7f27('0x20')]=qs['offset'](_0x7aefd5[_0x7f27('0x45')][_0x7f27('0x20')]);}_0x550bbf[_0x7f27('0x94')]=qs['sort'](_0x7aefd5[_0x7f27('0x45')][_0x7f27('0x4b')]);_0x550bbf[_0x7f27('0x4c')]=qs[_0x7f27('0x43')](_[_0x7f27('0x4d')](_0x7aefd5[_0x7f27('0x45')],_0x11b5fe[_0x7f27('0x43')]));_0x550bbf[_0x7f27('0x4c')][_0x7f27('0xb6')]=_0x55c750['id'];if(_0x7aefd5[_0x7f27('0x45')][_0x7f27('0x89')]){_0x550bbf[_0x7f27('0x4c')]=_[_0x7f27('0xa2')](_0x550bbf[_0x7f27('0x4c')],{'$or':_[_0x7f27('0x3e')](_0x550bbf[_0x7f27('0x47')],function(_0x5210c1){var _0x387a9a={};_0x387a9a[_0x5210c1]={'$like':'%'+_0x7aefd5[_0x7f27('0x45')][_0x7f27('0x89')]+'%'};return _0x387a9a;})});}if(_0x7aefd5[_0x7f27('0x45')][_0x7f27('0x7d')]){var _0x378c93=_0x7aefd5[_0x7f27('0x45')][_0x7f27('0x7d')][_0x7f27('0x69')](',');var _0x2d0e85={};_0x2d0e85[_0x378c93[0x0]]={'$gte':moment(_0x378c93[0x1])[_0x7f27('0xc4')](_0x7f27('0xc5'))};_0x550bbf['where']=_[_0x7f27('0xa2')](_0x550bbf[_0x7f27('0x4c')],_0x2d0e85);}_0x550bbf=_[_0x7f27('0xa2')]({},_0x550bbf,_0x7aefd5[_0x7f27('0xc6')]);return db[_0x7f27('0xbf')][_0x7f27('0x23')]({'where':_0x550bbf[_0x7f27('0x4c')]})[_0x7f27('0x2b')](function(_0x2578df){_0x32da7e[_0x7f27('0x23')]=_0x2578df;if(_0x7aefd5[_0x7f27('0x45')][_0x7f27('0xc7')]){_0x550bbf[_0x7f27('0xbb')]=[{'all':!![]}];}return db[_0x7f27('0xbf')][_0x7f27('0xc8')](_0x550bbf);})[_0x7f27('0x2b')](function(_0x855fc9){_0x32da7e[_0x7f27('0xb8')]=_0x855fc9;return _0x32da7e;});}})[_0x7f27('0x2b')](respondWithFilteredResult(_0x3e65ba,_0x550bbf))['catch'](handleError(_0x3e65ba,null));};exports[_0x7f27('0xc9')]=function(_0x43a3df,_0xb83927,_0x392208){return db[_0x7f27('0x3f')][_0x7f27('0x64')]({'where':{'id':_0x43a3df[_0x7f27('0xba')]['id']}})[_0x7f27('0x2b')](handleEntityNotFound(_0xb83927,null))[_0x7f27('0x2b')](function(_0x2d76ae){if(_0x2d76ae){return _0x2d76ae[_0x7f27('0xca')](_0x43a3df[_0x7f27('0x76')][_0x7f27('0xc0')],_['omit'](_0x43a3df[_0x7f27('0x76')],[_0x7f27('0xc0'),'id'])||{})[_0x7f27('0xcb')](function(){return db[_0x7f27('0x6f')][_0x7f27('0xc8')]({'attributes':['id',_0x7f27('0x2f'),_0x7f27('0x50')],'where':{'id':_0x43a3df[_0x7f27('0x76')][_0x7f27('0xc0')]}});})[_0x7f27('0x2b')](function(_0x591675){socket[_0x7f27('0xcc')](_0x7f27('0xcd'),{'id':Number(_0x43a3df[_0x7f27('0xba')]['id']),'tags':_0x591675||[]});return{'id':Number(_0x43a3df[_0x7f27('0xba')]['id']),'tags':_0x591675||[]};});}})[_0x7f27('0x2b')](respondWithResult(_0xb83927,null))[_0x7f27('0x36')](handleError(_0xb83927,null));};exports[_0x7f27('0xce')]=function(_0xb43f02,_0x15ec41,_0x3f2908){return db[_0x7f27('0x3f')][_0x7f27('0x64')]({'where':{'id':_0xb43f02[_0x7f27('0xba')]['id']}})[_0x7f27('0x2b')](handleEntityNotFound(_0x15ec41,null))[_0x7f27('0x2b')](function(_0x3be0ed){if(_0x3be0ed){return _0x3be0ed['removeTags'](_0xb43f02['query'][_0x7f27('0xc0')]);}})['then'](respondWithStatusCode(_0x15ec41,null))['catch'](handleError(_0x15ec41,null));};exports[_0x7f27('0xcf')]=function(_0x47c8c7,_0x24fdf3){var _0x16945c=moment()['unix']()[_0x7f27('0xa1')]();var _0x2fac73=path[_0x7f27('0xd0')](config['root'],_0x7f27('0xd1'),_0x7f27('0xd2'),_0x7f27('0xd3'));var _0x5151e7=path[_0x7f27('0xd0')](config['root'],_0x7f27('0xd1'),'files','attachments');var _0xf5ed15=path['join'](_0x2fac73,_0x16945c);var _0x2c326d=util[_0x7f27('0xc4')](_0x7f27('0xd4'),_0x47c8c7[_0x7f27('0xba')]['id'],_0x16945c);var _0x44e41c=path['join'](_0x2fac73,_0x2c326d);var _0x526d65=[];_0x526d65[_0x7f27('0x35')]({'model':db[_0x7f27('0xd5')],'as':_0x7f27('0xd5'),'attributes':['id',_0x7f27('0x32')],'raw':!![]});_0x526d65['push']({'model':db[_0x7f27('0xd6')],'as':'Contact','attributes':['id',_0x7f27('0xd7'),_0x7f27('0xd8')],'raw':!![]});if(_0x47c8c7[_0x7f27('0x45')]['attachments']){_0x526d65[_0x7f27('0x35')]({'model':db['Attachment'],'as':_0x7f27('0xd9'),'raw':!![]});}var _0x2b180d=[{'model':db[_0x7f27('0xbf')],'as':'Messages','attributes':['id',_0x7f27('0x76'),_0x7f27('0xda'),'direction',_0x7f27('0xdb'),_0x7f27('0x83')],'include':_0x526d65}];_0x2b180d[_0x7f27('0x35')]({'model':db['WhatsappAccount'],'as':_0x7f27('0xdc'),'attributes':['id','name']});_0x2b180d[_0x7f27('0x35')]({'model':db[_0x7f27('0xd5')],'as':_0x7f27('0xdd'),'attributes':['id',_0x7f27('0x32')]});return db[_0x7f27('0x3f')][_0x7f27('0x64')]({'where':{'id':_0x47c8c7['params']['id']},'include':_0x2b180d})['then'](handleEntityNotFound(_0x24fdf3,null))['then'](function(_0x50cc0c){if(_0x50cc0c){var _0x2b4f78=_0x50cc0c[_0x7f27('0xde')]({'plain':!![]});fs[_0x7f27('0xdf')](_0xf5ed15);var _0x1d6a43={'channel':_0x7f27('0xe0'),'account':_0x2b4f78[_0x7f27('0xdc')]['name'],'agent':_0x2b4f78[_0x7f27('0xdd')]?_0x2b4f78['Owner'][_0x7f27('0x32')]:_0x7f27('0xe1'),'createdAt':moment(_0x2b4f78['createdAt'])[_0x7f27('0xc4')](_0x7f27('0xc5'))[_0x7f27('0xa1')](),'closedAt':_0x2b4f78[_0x7f27('0x3c')]?moment(_0x2b4f78[_0x7f27('0xe2')])[_0x7f27('0xc4')](_0x7f27('0xc5'))[_0x7f27('0xa1')]():'','disposition':_0x2b4f78[_0x7f27('0xe3')],'messages':_(_0x2b4f78[_0x7f27('0xe4')])['filter']({'secret':![]})[_0x7f27('0x3e')](function(_0x3dd2b5){if(_0x3dd2b5[_0x7f27('0xd9')]){var _0x52184e=path[_0x7f27('0xd0')](_0x5151e7,_0x3dd2b5[_0x7f27('0xd9')][_0x7f27('0xe5')]);if(fs[_0x7f27('0xe6')](_0x52184e)){fs[_0x7f27('0xe7')](_0x52184e)[_0x7f27('0xe8')](fs[_0x7f27('0xe9')](path['join'](_0xf5ed15,_0x3dd2b5['Attachment'][_0x7f27('0xe5')])));}}return{'date':moment(_0x3dd2b5[_0x7f27('0xda')])[_0x7f27('0xc4')](_0x7f27('0xc5'))[_0x7f27('0xa1')](),'sender':_0x3dd2b5['direction']===_0x7f27('0xea')?_0x3dd2b5[_0x7f27('0xd5')]?_0x3dd2b5[_0x7f27('0xd5')]['fullname']:_0x7f27('0xeb'):_0x3dd2b5[_0x7f27('0xec')][_0x7f27('0xd7')]+(_0x3dd2b5[_0x7f27('0xec')][_0x7f27('0xd8')]?'\x20'+_0x3dd2b5[_0x7f27('0xec')][_0x7f27('0xd8')]:''),'body':_0x3dd2b5[_0x7f27('0xd9')]?_0x3dd2b5[_0x7f27('0xd9')][_0x7f27('0xe5')]:_0x3dd2b5[_0x7f27('0x76')],'direction':_0x3dd2b5[_0x7f27('0xed')]==='out'?'A':'C','secret':_0x3dd2b5['secret'],'read':_0x3dd2b5[_0x7f27('0x83')],'attachment':_0x3dd2b5['Attachment']};})[_0x7f27('0x66')]()};return ejs[_0x7f27('0xee')](path[_0x7f27('0xd0')](config[_0x7f27('0xef')],_0x7f27('0xd1'),_0x7f27('0xf0'),_0x7f27('0xf1')),{'interaction':_0x1d6a43})['then'](function(_0x179adb){var _0x21170c=path[_0x7f27('0xd0')](_0xf5ed15,_0x7f27('0xf2')+_0x2b4f78['id']+'-'+_0x16945c+_0x7f27('0xf3'));var _0x3724de={'path':_0x21170c,'channel':_0x7f27('0xe0'),'interactionId':_0x2b4f78['id']};return pdf[_0x7f27('0xf4')](_0x179adb,_0x3724de);})[_0x7f27('0x2b')](function(){return new BPromise(function(_0x4f8d66,_0x2ca6ad){zipdir(_0xf5ed15,{'saveTo':_0x44e41c},function(_0x5d7d3c,_0x40b6cd){if(_0x5d7d3c)return _0x2ca6ad(_0x5d7d3c);return _0x4f8d66(_0x40b6cd);});})[_0x7f27('0x2b')](function(){return new BPromise(function(_0x1450ff,_0x139aa0){rimraf(_0xf5ed15,function(_0x4de4ae){if(_0x4de4ae)_0x139aa0(_0x4de4ae);return _0x1450ff();});});})[_0x7f27('0x2b')](function(){return _0x24fdf3[_0x7f27('0xcf')](_0x44e41c,_0x2c326d,function(_0x26a91a){if(_0x26a91a){console[_0x7f27('0xf5')](_0x7f27('0xf6'),_0x26a91a);}else{fs['unlinkSync'](_0x44e41c);}});});});}else{return _0x24fdf3[_0x7f27('0x2c')](0xc8);}})[_0x7f27('0x36')](handleError(_0x24fdf3,null));};
\ No newline at end of file
index 37649ac..ed361cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c0d=['findAll','then','unreadMessages','emit','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map'];(function(_0x513fbb,_0x470e2b){var _0x4bdbe6=function(_0x29c445){while(--_0x29c445){_0x513fbb['push'](_0x513fbb['shift']());}};_0x4bdbe6(++_0x470e2b);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x3ba27f,_0x308ae4){_0x3ba27f=_0x3ba27f-0x0;var _0x3511d9=_0x3c0d[_0x3ba27f];return _0x3511d9;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xd3c0('0x0'))['db'][_0xd3c0('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd3c0('0x2')](0x0);var events={'afterCreate':_0xd3c0('0x3'),'afterUpdate':_0xd3c0('0x4'),'afterDestroy':_0xd3c0('0x5')};function emitEvent(_0xe14278){return function(_0x161aac,_0x347711,_0x4d5cf1){_0x161aac[_0xd3c0('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x6308e2){_0x161aac[_0xd3c0('0x7')](_0xd3c0('0x8'),_0x6308e2[_0xd3c0('0x9')](function(_0x30775d){return{'id':_0x30775d['id']};}));return WhatsappMessage[_0xd3c0('0xa')]({'where':{'WhatsappInteractionId':_0x161aac['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd3c0('0xb')](function(_0x3414ff){_0x161aac[_0xd3c0('0x7')](_0xd3c0('0xc'),_0x3414ff['length']);WhatsappInteractionEvents[_0xd3c0('0xd')](_0xe14278+':'+_0x161aac['id'],_0x161aac);WhatsappInteractionEvents[_0xd3c0('0xd')](_0xe14278,_0x161aac);_0x4d5cf1(null);})['catch'](_0x4d5cf1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xd3c0('0xe')](e,emitEvent(event));}}module[_0xd3c0('0xf')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x4ffe=['hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','then','setDataValue','Users','unreadMessages','emit','catch','hasOwnProperty'];(function(_0xb9efc8,_0x4869f1){var _0x5d990d=function(_0x26f4f7){while(--_0x26f4f7){_0xb9efc8['push'](_0xb9efc8['shift']());}};_0x5d990d(++_0x4869f1);}(_0x4ffe,0x172));var _0xe4ff=function(_0x4a4563,_0x2771c3){_0x4a4563=_0x4a4563-0x0;var _0x201be1=_0x4ffe[_0x4a4563];return _0x201be1;};'use strict';var EventEmitter=require(_0xe4ff('0x0'));var WhatsappInteraction=require(_0xe4ff('0x1'))['db'][_0xe4ff('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xe4ff('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe4ff('0x4')](0x0);var events={'afterCreate':_0xe4ff('0x5'),'afterUpdate':'update','afterDestroy':_0xe4ff('0x6')};function emitEvent(_0x2621fc){return function(_0x1397e1,_0x33a19a,_0x68c0c7){_0x1397e1['getUsers']({'attributes':['id'],'raw':!![]})[_0xe4ff('0x7')](function(_0x455874){_0x1397e1[_0xe4ff('0x8')](_0xe4ff('0x9'),_0x455874['map'](function(_0x4718d9){return{'id':_0x4718d9['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x1397e1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe4ff('0x7')](function(_0x188173){_0x1397e1[_0xe4ff('0x8')](_0xe4ff('0xa'),_0x188173['length']);WhatsappInteractionEvents['emit'](_0x2621fc+':'+_0x1397e1['id'],_0x1397e1);WhatsappInteractionEvents[_0xe4ff('0xb')](_0x2621fc,_0x1397e1);_0x68c0c7(null);})[_0xe4ff('0xc')](_0x68c0c7(null));};}for(var e in events){if(events[_0xe4ff('0xd')](e)){var event=events[e];WhatsappInteraction[_0xe4ff('0xe')](e,emitEvent(event));}}module[_0xe4ff('0xf')]=WhatsappInteractionEvents;
\ No newline at end of file
index 70ea7c8..9545d5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6da=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','WhatsappInteraction'];(function(_0x110391,_0x46ff5c){var _0x5509a6=function(_0x48d50e){while(--_0x48d50e){_0x110391['push'](_0x110391['shift']());}};_0x5509a6(++_0x46ff5c);}(_0xe6da,0x1ee));var _0xae6d=function(_0x12deba,_0x1223fa){_0x12deba=_0x12deba-0x0;var _0x347ae1=_0xe6da[_0x12deba];return _0x347ae1;};'use strict';var _=require('lodash');var util=require(_0xae6d('0x0'));var logger=require(_0xae6d('0x1'))(_0xae6d('0x2'));var moment=require(_0xae6d('0x3'));var BPromise=require(_0xae6d('0x4'));var rp=require(_0xae6d('0x5'));var fs=require('fs');var path=require(_0xae6d('0x6'));var rimraf=require('rimraf');var config=require(_0xae6d('0x7'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x2b9376,_0x5b684a){return _0x2b9376[_0xae6d('0x8')](_0xae6d('0x9'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11ac1e,_0x4a02c9,_0x351b2e){if(_0x11ac1e[_0xae6d('0xa')](_0xae6d('0xb'))){_0x11ac1e[_0xae6d('0xc')]=moment()['format'](_0xae6d('0xd'));}_0x351b2e(null,_0x11ac1e);}}});};
\ No newline at end of file
+var _0xf007=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x2c86e1,_0x2e2547){var _0x5e9fa0=function(_0x5962ba){while(--_0x5962ba){_0x2c86e1['push'](_0x2c86e1['shift']());}};_0x5e9fa0(++_0x2e2547);}(_0xf007,0x19f));var _0x7f00=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xf007[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0x7f00('0x0'));var util=require(_0x7f00('0x1'));var logger=require(_0x7f00('0x2'))(_0x7f00('0x3'));var moment=require(_0x7f00('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f00('0x5'));var rimraf=require(_0x7f00('0x6'));var config=require(_0x7f00('0x7'));var attributes=require(_0x7f00('0x8'));module[_0x7f00('0x9')]=function(_0x3a79ff,_0x20d84a){return _0x3a79ff[_0x7f00('0xa')](_0x7f00('0xb'),attributes,{'tableName':_0x7f00('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8ed6c6,_0x2f7a78,_0xb40369){if(_0x8ed6c6['changed'](_0x7f00('0xd'))){_0x8ed6c6['closedAt']=moment()[_0x7f00('0xe')](_0x7f00('0xf'));}_0xb40369(null,_0x8ed6c6);}}});};
\ No newline at end of file
index 2afdfe3..b5ddb26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x649f=['find','then','addTags','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','UpdateWhatsappInteraction','WhatsappInteraction','body','options','where','attributes','limit','catch'];(function(_0x2c151e,_0x3f4b4d){var _0x10a2e8=function(_0x1f2624){while(--_0x1f2624){_0x2c151e['push'](_0x2c151e['shift']());}};_0x10a2e8(++_0x3f4b4d);}(_0x649f,0xc5));var _0xf649=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x649f[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0xf649('0x0'));var moment=require(_0xf649('0x1'));var BPromise=require(_0xf649('0x2'));var rs=require(_0xf649('0x3'));var fs=require('fs');var Redis=require(_0xf649('0x4'));var db=require(_0xf649('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf649('0x6'));var client=jayson['client'][_0xf649('0x7')]({'port':0x232a});config['redis']=_[_0xf649('0x8')](config[_0xf649('0x9')],{'host':_0xf649('0xa'),'port':0x18eb});var socket=require(_0xf649('0xb'))(new Redis(config[_0xf649('0x9')]));require('./whatsappInteraction.socket')[_0xf649('0xc')](socket);function respondWithRpcPromise(_0x36e0ac,_0x4cdb0f,_0xb85acb){return new BPromise(function(_0x57d612,_0xb1e556){return client[_0xf649('0xd')](_0x36e0ac,_0xb85acb)['then'](function(_0x343bba){logger[_0xf649('0xe')](_0xf649('0xf'),_0x4cdb0f,_0xf649('0x10'));logger[_0xf649('0x11')](_0xf649('0x12'),_0x4cdb0f,_0xf649('0x10'),JSON[_0xf649('0x13')](_0x343bba));if(_0x343bba['error']){if(_0x343bba['error'][_0xf649('0x14')]===0x1f4){logger['error'](_0xf649('0xf'),_0x4cdb0f,_0x343bba[_0xf649('0x15')]['message']);return _0xb1e556(_0x343bba[_0xf649('0x15')][_0xf649('0x16')]);}logger[_0xf649('0x15')](_0xf649('0xf'),_0x4cdb0f,_0x343bba[_0xf649('0x15')]['message']);return _0x57d612(_0x343bba[_0xf649('0x15')][_0xf649('0x16')]);}else{logger[_0xf649('0xe')](_0xf649('0xf'),_0x4cdb0f,_0xf649('0x10'));_0x57d612(_0x343bba['result'][_0xf649('0x16')]);}})['catch'](function(_0x4d0c45){logger[_0xf649('0x15')](_0xf649('0xf'),_0x4cdb0f,_0x4d0c45);_0xb1e556(_0x4d0c45);});});}exports[_0xf649('0x17')]=function(_0x10a50c){var _0x465493=this;return new Promise(function(_0x527fd8,_0x53e054){return db[_0xf649('0x18')]['update'](_0x10a50c[_0xf649('0x19')],{'raw':_0x10a50c[_0xf649('0x1a')]?_0x10a50c[_0xf649('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10a50c['options']?_0x10a50c['options'][_0xf649('0x1b')]||null:null,'attributes':_0x10a50c[_0xf649('0x1a')]?_0x10a50c[_0xf649('0x1a')][_0xf649('0x1c')]||null:null,'limit':_0x10a50c[_0xf649('0x1a')]?_0x10a50c[_0xf649('0x1a')][_0xf649('0x1d')]||null:null})['then'](function(_0x269c4d){logger[_0xf649('0xe')](_0xf649('0x17'),_0x10a50c);logger[_0xf649('0x11')]('UpdateWhatsappInteraction',_0x10a50c,JSON[_0xf649('0x13')](_0x269c4d));_0x527fd8(_0x269c4d);})[_0xf649('0x1e')](function(_0x3ddf80){logger[_0xf649('0x15')](_0xf649('0x17'),_0x3ddf80[_0xf649('0x16')],_0x10a50c);_0x53e054(_0x465493['error'](0x1f4,_0x3ddf80[_0xf649('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3e32c8){return new Promise(function(_0x3fc8a2,_0x56589d){return db[_0xf649('0x18')][_0xf649('0x1f')]({'where':_0x3e32c8['options']?_0x3e32c8['options'][_0xf649('0x1b')]||null:null})[_0xf649('0x20')](function(_0x258e38){if(_0x258e38){return _0x258e38[_0xf649('0x21')](_0x3e32c8[_0xf649('0x19')]['ids'],_[_0xf649('0x22')](_0x3e32c8[_0xf649('0x19')],[_0xf649('0x23'),'id'])||{});}})[_0xf649('0x24')](function(_0x507e4b){logger['info'](_0xf649('0x25'),_0x3e32c8);logger['debug'](_0xf649('0x25'),_0x3e32c8,JSON[_0xf649('0x13')](_0x507e4b));_0x3fc8a2(_0x507e4b);})[_0xf649('0x1e')](function(_0xbbf9b6){logger[_0xf649('0x15')]('AddTags',_0xbbf9b6['message'],_0x3e32c8);_0x56589d(_this['error'](0x1f4,_0xbbf9b6[_0xf649('0x16')]));});});};
\ No newline at end of file
+var _0xb3f4=['code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','limit','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x199160,_0x1136a8){var _0x502cd0=function(_0x188819){while(--_0x188819){_0x199160['push'](_0x199160['shift']());}};_0x502cd0(++_0x1136a8);}(_0xb3f4,0x69));var _0x4b3f=function(_0x2e01d2,_0x34e33b){_0x2e01d2=_0x2e01d2-0x0;var _0x324a7b=_0xb3f4[_0x2e01d2];return _0x324a7b;};'use strict';var _=require(_0x4b3f('0x0'));var util=require(_0x4b3f('0x1'));var moment=require(_0x4b3f('0x2'));var BPromise=require(_0x4b3f('0x3'));var rs=require(_0x4b3f('0x4'));var fs=require('fs');var Redis=require(_0x4b3f('0x5'));var db=require(_0x4b3f('0x6'))['db'];var utils=require(_0x4b3f('0x7'));var logger=require('../../config/logger')(_0x4b3f('0x8'));var config=require(_0x4b3f('0x9'));var jayson=require(_0x4b3f('0xa'));var client=jayson[_0x4b3f('0xb')][_0x4b3f('0xc')]({'port':0x232a});config[_0x4b3f('0xd')]=_[_0x4b3f('0xe')](config[_0x4b3f('0xd')],{'host':_0x4b3f('0xf'),'port':0x18eb});var socket=require(_0x4b3f('0x10'))(new Redis(config[_0x4b3f('0xd')]));require(_0x4b3f('0x11'))[_0x4b3f('0x12')](socket);function respondWithRpcPromise(_0x531d8b,_0x2ea862,_0x6083f3){return new BPromise(function(_0x5ed7c6,_0x5c6f3b){return client['request'](_0x531d8b,_0x6083f3)[_0x4b3f('0x13')](function(_0x22bfbd){logger[_0x4b3f('0x14')](_0x4b3f('0x15'),_0x2ea862,_0x4b3f('0x16'));logger[_0x4b3f('0x17')](_0x4b3f('0x18'),_0x2ea862,_0x4b3f('0x16'),JSON[_0x4b3f('0x19')](_0x22bfbd));if(_0x22bfbd[_0x4b3f('0x1a')]){if(_0x22bfbd[_0x4b3f('0x1a')][_0x4b3f('0x1b')]===0x1f4){logger[_0x4b3f('0x1a')]('WhatsappInteraction,\x20%s,\x20%s',_0x2ea862,_0x22bfbd[_0x4b3f('0x1a')][_0x4b3f('0x1c')]);return _0x5c6f3b(_0x22bfbd['error']['message']);}logger['error'](_0x4b3f('0x15'),_0x2ea862,_0x22bfbd[_0x4b3f('0x1a')][_0x4b3f('0x1c')]);return _0x5ed7c6(_0x22bfbd[_0x4b3f('0x1a')][_0x4b3f('0x1c')]);}else{logger[_0x4b3f('0x14')](_0x4b3f('0x15'),_0x2ea862,_0x4b3f('0x16'));_0x5ed7c6(_0x22bfbd[_0x4b3f('0x1d')][_0x4b3f('0x1c')]);}})[_0x4b3f('0x1e')](function(_0x326bb3){logger[_0x4b3f('0x1a')](_0x4b3f('0x15'),_0x2ea862,_0x326bb3);_0x5c6f3b(_0x326bb3);});});}exports[_0x4b3f('0x1f')]=function(_0x2c4c80){var _0x43fe9a=this;return new Promise(function(_0x396f57,_0x3b6d86){return db[_0x4b3f('0x20')][_0x4b3f('0x21')](_0x2c4c80[_0x4b3f('0x22')],{'raw':_0x2c4c80['options']?_0x2c4c80[_0x4b3f('0x23')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c4c80[_0x4b3f('0x23')]?_0x2c4c80[_0x4b3f('0x23')][_0x4b3f('0x24')]||null:null,'attributes':_0x2c4c80[_0x4b3f('0x23')]?_0x2c4c80[_0x4b3f('0x23')]['attributes']||null:null,'limit':_0x2c4c80[_0x4b3f('0x23')]?_0x2c4c80[_0x4b3f('0x23')][_0x4b3f('0x25')]||null:null})[_0x4b3f('0x13')](function(_0x51b708){logger[_0x4b3f('0x14')]('UpdateWhatsappInteraction',_0x2c4c80);logger[_0x4b3f('0x17')](_0x4b3f('0x1f'),_0x2c4c80,JSON[_0x4b3f('0x19')](_0x51b708));_0x396f57(_0x51b708);})['catch'](function(_0x46049){logger['error']('UpdateWhatsappInteraction',_0x46049[_0x4b3f('0x1c')],_0x2c4c80);_0x3b6d86(_0x43fe9a[_0x4b3f('0x1a')](0x1f4,_0x46049['message']));});});};exports[_0x4b3f('0x26')]=function(_0x525ded){return new Promise(function(_0x468d52,_0x2e4e48){return db[_0x4b3f('0x20')][_0x4b3f('0x27')]({'where':_0x525ded[_0x4b3f('0x23')]?_0x525ded[_0x4b3f('0x23')][_0x4b3f('0x24')]||null:null})['then'](function(_0x57fab2){if(_0x57fab2){return _0x57fab2[_0x4b3f('0x28')](_0x525ded[_0x4b3f('0x22')][_0x4b3f('0x29')],_['omit'](_0x525ded[_0x4b3f('0x22')],[_0x4b3f('0x29'),'id'])||{});}})[_0x4b3f('0x2a')](function(_0x281bfa){logger['info'](_0x4b3f('0x2b'),_0x525ded);logger[_0x4b3f('0x17')](_0x4b3f('0x2b'),_0x525ded,JSON['stringify'](_0x281bfa));_0x468d52(_0x281bfa);})[_0x4b3f('0x1e')](function(_0x1a7b29){logger[_0x4b3f('0x1a')](_0x4b3f('0x2b'),_0x1a7b29[_0x4b3f('0x1c')],_0x525ded);_0x2e4e48(_this[_0x4b3f('0x1a')](0x1f4,_0x1a7b29[_0x4b3f('0x1c')]));});});};
\ No newline at end of file
index 7d4c19d..6157d70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d56=['length','whatsappInteraction:','update','emit','register'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x8d56,0x1ba));var _0x68d5=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x8d56[_0x374ccf];return _0x443cde;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0x68d5('0x0')];function createListener(_0x33e600,_0x33eb87){return function(_0x5ad76b){_0x33eb87[_0x68d5('0x1')](_0x33e600,_0x5ad76b);};}function removeListener(_0x3c98cc,_0x1f4541){return function(){WhatsappInteractionEvents['removeListener'](_0x3c98cc,_0x1f4541);};}exports[_0x68d5('0x2')]=function(_0x150ca5){for(var _0x359d28=0x0,_0x3f4c5b=events[_0x68d5('0x3')];_0x359d28<_0x3f4c5b;_0x359d28++){var _0x5e1f11=events[_0x359d28];var _0x27416b=createListener(_0x68d5('0x4')+_0x5e1f11,_0x150ca5);WhatsappInteractionEvents['on'](_0x5e1f11,_0x27416b);}};
\ No newline at end of file
+var _0x4f1c=['whatsappInteraction:','save','remove','update','removeListener','register','length'];(function(_0x10c2bf,_0x399929){var _0x173d26=function(_0x545ef5){while(--_0x545ef5){_0x10c2bf['push'](_0x10c2bf['shift']());}};_0x173d26(++_0x399929);}(_0x4f1c,0x158));var _0xc4f1=function(_0x53dc01,_0x4f8130){_0x53dc01=_0x53dc01-0x0;var _0xc0b3fe=_0x4f1c[_0x53dc01];return _0xc0b3fe;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xc4f1('0x0'),_0xc4f1('0x1'),_0xc4f1('0x2')];function createListener(_0x3a06c7,_0x44a397){return function(_0x4f442){_0x44a397['emit'](_0x3a06c7,_0x4f442);};}function removeListener(_0x5530ac,_0x487aaa){return function(){WhatsappInteractionEvents[_0xc4f1('0x3')](_0x5530ac,_0x487aaa);};}exports[_0xc4f1('0x4')]=function(_0x5852d0){for(var _0x29ecac=0x0,_0x207764=events[_0xc4f1('0x5')];_0x29ecac<_0x207764;_0x29ecac++){var _0x255205=events[_0x29ecac];var _0x357cc7=createListener(_0xc4f1('0x6')+_0x255205,_0x5852d0);WhatsappInteractionEvents['on'](_0x255205,_0x357cc7);}};
\ No newline at end of file
index ac9423e..3f302d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5225=['accept','reject','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','/describe','get','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept'];(function(_0x279f6d,_0x122316){var _0x5874a5=function(_0x4823ae){while(--_0x4823ae){_0x279f6d['push'](_0x279f6d['shift']());}};_0x5874a5(++_0x122316);}(_0x5225,0x122));var _0x5522=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x5225[_0x54b396];return _0x532e6d;};'use strict';var multer=require(_0x5522('0x0'));var util=require('util');var path=require(_0x5522('0x1'));var timeout=require('connect-timeout');var express=require(_0x5522('0x2'));var router=express['Router']();var fs_extra=require(_0x5522('0x3'));var auth=require(_0x5522('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5522('0x5'));var controller=require(_0x5522('0x6'));router['get']('/',auth[_0x5522('0x7')](),controller[_0x5522('0x8')]);router['get'](_0x5522('0x9'),auth[_0x5522('0x7')](),controller['describe']);router[_0x5522('0xa')](_0x5522('0xb'),auth[_0x5522('0x7')](),controller['show']);router[_0x5522('0xc')]('/',auth[_0x5522('0x7')](),interaction[_0x5522('0xd')](_0x5522('0xe'),_0x5522('0xf')),controller[_0x5522('0x10')]);router[_0x5522('0xc')](_0x5522('0x11'),controller[_0x5522('0x12')]);router[_0x5522('0x13')](_0x5522('0xb'),auth[_0x5522('0x7')](),controller[_0x5522('0x14')]);router[_0x5522('0x13')](_0x5522('0x15'),auth[_0x5522('0x7')](),controller[_0x5522('0x16')]);router['put']('/:id/reject',auth[_0x5522('0x7')](),controller[_0x5522('0x17')]);router[_0x5522('0x18')](_0x5522('0xb'),auth['isAuthenticated'](),controller[_0x5522('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x07aa=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/:id','tracked','whatsapp','create','post','/:id/status','status','put','update','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x07aa,0x168));var _0xa07a=function(_0x393c87,_0x19849c){_0x393c87=_0x393c87-0x0;var _0x443a04=_0x07aa[_0x393c87];return _0x443a04;};'use strict';var multer=require(_0xa07a('0x0'));var util=require(_0xa07a('0x1'));var path=require(_0xa07a('0x2'));var timeout=require(_0xa07a('0x3'));var express=require(_0xa07a('0x4'));var router=express[_0xa07a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa07a('0x6'));var interaction=require(_0xa07a('0x7'));var config=require(_0xa07a('0x8'));var controller=require(_0xa07a('0x9'));router['get']('/',auth[_0xa07a('0xa')](),controller[_0xa07a('0xb')]);router[_0xa07a('0xc')]('/describe',auth[_0xa07a('0xa')](),controller['describe']);router[_0xa07a('0xc')](_0xa07a('0xd'),auth[_0xa07a('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0xa07a('0xe')](_0xa07a('0xf'),'whatsappmessage:create'),controller[_0xa07a('0x10')]);router[_0xa07a('0x11')](_0xa07a('0x12'),controller[_0xa07a('0x13')]);router[_0xa07a('0x14')](_0xa07a('0xd'),auth[_0xa07a('0xa')](),controller[_0xa07a('0x15')]);router[_0xa07a('0x14')]('/:id/accept',auth[_0xa07a('0xa')](),controller[_0xa07a('0x16')]);router[_0xa07a('0x14')](_0xa07a('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xa07a('0xd'),auth['isAuthenticated'](),controller[_0xa07a('0x18')]);module[_0xa07a('0x19')]=router;
\ No newline at end of file
index 50b6004..66dafea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1580=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x19e1f6,_0x52d013){var _0x4b9242=function(_0x372dab){while(--_0x372dab){_0x19e1f6['push'](_0x19e1f6['shift']());}};_0x4b9242(++_0x52d013);}(_0x1580,0x15a));var _0x0158=function(_0x4fece1,_0x3186f7){_0x4fece1=_0x4fece1-0x0;var _0x2d9dc3=_0x1580[_0x4fece1];return _0x2d9dc3;};'use strict';var Sequelize=require(_0x0158('0x0'));module[_0x0158('0x1')]={'body':{'type':Sequelize[_0x0158('0x2')](_0x0158('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0158('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0158('0x5')]('in',_0x0158('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x0158('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x0158('0x8')]},'secret':{'type':Sequelize[_0x0158('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0158('0x2')]}};
\ No newline at end of file
+var _0x836c=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x7dcb8a,_0xb9694){var _0x382a66=function(_0x456f48){while(--_0x456f48){_0x7dcb8a['push'](_0x7dcb8a['shift']());}};_0x382a66(++_0xb9694);}(_0x836c,0x11f));var _0xc836=function(_0x2acef1,_0x3d77c6){_0x2acef1=_0x2acef1-0x0;var _0x3b2634=_0x836c[_0x2acef1];return _0x3b2634;};'use strict';var Sequelize=require(_0xc836('0x0'));module[_0xc836('0x1')]={'body':{'type':Sequelize[_0xc836('0x2')](_0xc836('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc836('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc836('0x5')]('in',_0xc836('0x6')),'defaultValue':_0xc836('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc836('0x7')](0xbe)},'phone':{'type':Sequelize[_0xc836('0x7')]},'readAt':{'type':Sequelize[_0xc836('0x8')]},'secret':{'type':Sequelize[_0xc836('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc836('0x7')]},'providerResponse':{'type':Sequelize[_0xc836('0x2')]}};
\ No newline at end of file
index 0fc18f2..af7f3ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x347f=['User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','Sequelize','QueryTypes','SELECT','email','event','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','fast-json-patch','util','sox','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','length','find','create','body','params','destroy','describe','accept','whatsapp','read','readAt','format','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact'];(function(_0x557741,_0x43d009){var _0x4cd544=function(_0xde56cc){while(--_0xde56cc){_0x557741['push'](_0x557741['shift']());}};_0x4cd544(++_0x43d009);}(_0x347f,0x136));var _0xf347=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x347f[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf347('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf347('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf347('0x2'));var path=require('path');var sox=require(_0xf347('0x3'));var csv=require(_0xf347('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf347('0x5'));var _=require('lodash');var squel=require(_0xf347('0x6'));var crypto=require('crypto');var jsforce=require(_0xf347('0x7'));var deskjs=require('desk.js');var toCsv=require(_0xf347('0x4'));var querystring=require(_0xf347('0x8'));var Papa=require('papaparse');var Redis=require(_0xf347('0x9'));var authService=require(_0xf347('0xa'));var qs=require(_0xf347('0xb'));var as=require(_0xf347('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf347('0xd'))(_0xf347('0xe'));var utils=require(_0xf347('0xf'));var config=require(_0xf347('0x10'));var licenseUtil=require(_0xf347('0x11'));var db=require(_0xf347('0x12'))['db'];config[_0xf347('0x13')]=_[_0xf347('0x14')](config[_0xf347('0x13')],{'host':_0xf347('0x15'),'port':0x18eb});var socket=require(_0xf347('0x16'))(new Redis(config[_0xf347('0x13')]));require(_0xf347('0x17'))[_0xf347('0x18')](socket);var jayson=require(_0xf347('0x19'));var client=jayson[_0xf347('0x1a')][_0xf347('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xf347('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2883c1,_0xddd2b7,_0x4f027a,_0x41ca68){return new BPromise(function(_0x202a58,_0xe1ce06){var _0x2743cd=_0x41ca68||client;return _0x2743cd[_0xf347('0x1c')](_0x2883c1,_0x4f027a)[_0xf347('0x1d')](function(_0x1f47ff){logger['info'](_0xf347('0x1e'),_0xddd2b7,_0xf347('0x1f'));logger['debug'](_0xf347('0x20'),_0xddd2b7,_0xf347('0x1f'),JSON[_0xf347('0x21')](_0x1f47ff));if(_0x1f47ff[_0xf347('0x22')]){if(_0x1f47ff[_0xf347('0x22')]['code']===0x1f4){logger[_0xf347('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0xddd2b7,_0x1f47ff[_0xf347('0x22')][_0xf347('0x23')]);return _0xe1ce06(_0x1f47ff[_0xf347('0x22')]['message']);}logger[_0xf347('0x22')](_0xf347('0x1e'),_0xddd2b7,_0x1f47ff[_0xf347('0x22')][_0xf347('0x23')]);return _0x202a58(_0x1f47ff[_0xf347('0x22')][_0xf347('0x23')]);}else{logger[_0xf347('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0xddd2b7,_0xf347('0x1f'));_0x202a58(_0x1f47ff['result'][_0xf347('0x23')]);}})[_0xf347('0x25')](function(_0x44d706){logger[_0xf347('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0xddd2b7,_0x44d706);_0xe1ce06(_0x44d706);});});}function respondWithStatusCode(_0x57d90b,_0x5bf6f8){_0x5bf6f8=_0x5bf6f8||0xcc;return function(_0x505b95){if(_0x505b95){return _0x57d90b[_0xf347('0x26')](_0x5bf6f8);}return _0x57d90b[_0xf347('0x27')](_0x5bf6f8)[_0xf347('0x28')]();};}function respondWithResult(_0x2445cd,_0x47a869){_0x47a869=_0x47a869||0xc8;return function(_0x47761a){if(_0x47761a){return _0x2445cd['status'](_0x47a869)[_0xf347('0x29')](_0x47761a);}};}function respondWithFilteredResult(_0x342220,_0x28abfc){return function(_0x17b3ec){if(_0x17b3ec){var _0x1a670e=typeof _0x28abfc[_0xf347('0x2a')]==='undefined'&&typeof _0x28abfc[_0xf347('0x2b')]==='undefined';var _0x122893=_0x17b3ec[_0xf347('0x2c')];var _0x294ffd=_0x1a670e?0x0:_0x28abfc[_0xf347('0x2a')];var _0x2c071a=_0x1a670e?_0x17b3ec[_0xf347('0x2c')]:_0x28abfc['offset']+_0x28abfc[_0xf347('0x2b')];var _0x43d545;if(_0x2c071a>=_0x122893){_0x2c071a=_0x122893;_0x43d545=0xc8;}else{_0x43d545=0xce;}_0x342220[_0xf347('0x27')](_0x43d545);return _0x342220['set'](_0xf347('0x2d'),_0x294ffd+'-'+_0x2c071a+'/'+_0x122893)[_0xf347('0x29')](_0x17b3ec);}return null;};}function patchUpdates(_0x486115){return function(_0x51baa2){try{jsonpatch[_0xf347('0x2e')](_0x51baa2,_0x486115,!![]);}catch(_0x3ffcb9){return BPromise[_0xf347('0x2f')](_0x3ffcb9);}return _0x51baa2['save']();};}function saveUpdates(_0x11b873,_0x23aeca){return function(_0x496cd7){if(_0x496cd7){return _0x496cd7[_0xf347('0x30')](_0x11b873)[_0xf347('0x1d')](function(_0xb30851){return _0xb30851;});}return null;};}function removeEntity(_0x3e7a72,_0x3ed90e){return function(_0x4fd87d){if(_0x4fd87d){return _0x4fd87d['destroy']()[_0xf347('0x1d')](function(){_0x3e7a72['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x96b673,_0x5bc3b5){return function(_0x50995a){if(!_0x50995a){_0x96b673[_0xf347('0x26')](0x194);}return _0x50995a;};}function handleError(_0x2adf64,_0x17ead5){_0x17ead5=_0x17ead5||0x1f4;return function(_0x2d7cf6){logger[_0xf347('0x22')](_0x2d7cf6[_0xf347('0x31')]);if(_0x2d7cf6[_0xf347('0x32')]){delete _0x2d7cf6[_0xf347('0x32')];}_0x2adf64[_0xf347('0x27')](_0x17ead5)['send'](_0x2d7cf6);};}exports[_0xf347('0x33')]=function(_0x3a617d,_0x5eca0c){var _0xf005a3={},_0x214a94={},_0x500202={'count':0x0,'rows':[]};var _0x1ecdb9=_[_0xf347('0x34')](db[_0xf347('0x35')][_0xf347('0x36')],function(_0x27cbb3){return{'name':_0x27cbb3[_0xf347('0x37')],'type':_0x27cbb3['type'][_0xf347('0x38')]};});_0x214a94['model']=_[_0xf347('0x34')](_0x1ecdb9,_0xf347('0x32'));_0x214a94[_0xf347('0x39')]=_[_0xf347('0x3a')](_0x3a617d[_0xf347('0x39')]);_0x214a94['filters']=_['intersection'](_0x214a94['model'],_0x214a94[_0xf347('0x39')]);_0xf005a3['attributes']=_[_0xf347('0x3b')](_0x214a94[_0xf347('0x3c')],qs[_0xf347('0x3d')](_0x3a617d[_0xf347('0x39')]['fields']));_0xf005a3[_0xf347('0x3e')]=_0xf005a3[_0xf347('0x3e')]['length']?_0xf005a3['attributes']:_0x214a94[_0xf347('0x3c')];if(!_0x3a617d[_0xf347('0x39')][_0xf347('0x3f')](_0xf347('0x40'))){_0xf005a3[_0xf347('0x2b')]=qs[_0xf347('0x2b')](_0x3a617d[_0xf347('0x39')][_0xf347('0x2b')]);_0xf005a3['offset']=qs[_0xf347('0x2a')](_0x3a617d[_0xf347('0x39')][_0xf347('0x2a')]);}_0xf005a3[_0xf347('0x41')]=qs[_0xf347('0x42')](_0x3a617d[_0xf347('0x39')][_0xf347('0x42')]);_0xf005a3['where']=qs[_0xf347('0x43')](_[_0xf347('0x44')](_0x3a617d[_0xf347('0x39')],_0x214a94[_0xf347('0x43')]),_0x1ecdb9);if(_0x3a617d[_0xf347('0x39')][_0xf347('0x45')]){_0xf005a3[_0xf347('0x46')]=_[_0xf347('0x47')](_0xf005a3['where'],{'$or':_[_0xf347('0x34')](_0x1ecdb9,function(_0x6e86db){if(_0x6e86db[_0xf347('0x48')]!==_0xf347('0x49')){var _0x30b9bd={};_0x30b9bd[_0x6e86db[_0xf347('0x32')]]={'$like':'%'+_0x3a617d['query'][_0xf347('0x45')]+'%'};return _0x30b9bd;}})});}_0xf005a3=_[_0xf347('0x47')]({},_0xf005a3,_0x3a617d[_0xf347('0x4a')]);var _0x6ac48={'where':_0xf005a3[_0xf347('0x46')]};return db[_0xf347('0x35')][_0xf347('0x2c')](_0x6ac48)[_0xf347('0x1d')](function(_0xa182c1){_0x500202['count']=_0xa182c1;if(_0x3a617d[_0xf347('0x39')][_0xf347('0x4b')]){_0xf005a3[_0xf347('0x4c')]=[{'all':!![]}];}return db[_0xf347('0x35')]['findAll'](_0xf005a3);})[_0xf347('0x1d')](function(_0x4d8133){_0x500202[_0xf347('0x4d')]=_0x4d8133;return _0x500202;})['then'](respondWithFilteredResult(_0x5eca0c,_0xf005a3))[_0xf347('0x25')](handleError(_0x5eca0c,null));};exports[_0xf347('0x4e')]=function(_0x47441f,_0x45d1db){var _0x4bd883={'raw':!![],'where':{'id':_0x47441f['params']['id']}},_0x17c7bd={};_0x17c7bd['model']=_[_0xf347('0x3a')](db['WhatsappMessage']['rawAttributes']);_0x17c7bd[_0xf347('0x39')]=_[_0xf347('0x3a')](_0x47441f[_0xf347('0x39')]);_0x17c7bd[_0xf347('0x43')]=_['intersection'](_0x17c7bd['model'],_0x17c7bd['query']);_0x4bd883[_0xf347('0x3e')]=_[_0xf347('0x3b')](_0x17c7bd[_0xf347('0x3c')],qs[_0xf347('0x3d')](_0x47441f[_0xf347('0x39')][_0xf347('0x3d')]));_0x4bd883[_0xf347('0x3e')]=_0x4bd883[_0xf347('0x3e')][_0xf347('0x4f')]?_0x4bd883['attributes']:_0x17c7bd[_0xf347('0x3c')];if(_0x47441f['query'][_0xf347('0x4b')]){_0x4bd883[_0xf347('0x4c')]=[{'all':!![]}];}_0x4bd883=_[_0xf347('0x47')]({},_0x4bd883,_0x47441f[_0xf347('0x4a')]);return db[_0xf347('0x35')][_0xf347('0x50')](_0x4bd883)[_0xf347('0x1d')](handleEntityNotFound(_0x45d1db,null))[_0xf347('0x1d')](respondWithResult(_0x45d1db,null))[_0xf347('0x25')](handleError(_0x45d1db,null));};exports[_0xf347('0x51')]=function(_0x596f81,_0x158a4f){return db[_0xf347('0x35')][_0xf347('0x51')](_0x596f81['body'],{})['then'](respondWithResult(_0x158a4f,0xc9))[_0xf347('0x25')](handleError(_0x158a4f,null));};exports[_0xf347('0x30')]=function(_0x4c1e56,_0x54990a){if(_0x4c1e56['body']['id']){delete _0x4c1e56[_0xf347('0x52')]['id'];}return db[_0xf347('0x35')][_0xf347('0x50')]({'where':{'id':_0x4c1e56[_0xf347('0x53')]['id']}})[_0xf347('0x1d')](handleEntityNotFound(_0x54990a,null))['then'](saveUpdates(_0x4c1e56[_0xf347('0x52')],null))[_0xf347('0x1d')](respondWithResult(_0x54990a,null))[_0xf347('0x25')](handleError(_0x54990a,null));};exports[_0xf347('0x54')]=function(_0x331271,_0x5d28d4){return db[_0xf347('0x35')][_0xf347('0x50')]({'where':{'id':_0x331271[_0xf347('0x53')]['id']}})[_0xf347('0x1d')](handleEntityNotFound(_0x5d28d4,null))[_0xf347('0x1d')](removeEntity(_0x5d28d4,null))['catch'](handleError(_0x5d28d4,null));};exports['describe']=function(_0x4fdfe4,_0x49b61c){return db[_0xf347('0x35')][_0xf347('0x55')]()['then'](respondWithResult(_0x49b61c,null))[_0xf347('0x25')](handleError(_0x49b61c,null));};var interaction_log=require(_0xf347('0xd'))('whatsapp-interactions');exports[_0xf347('0x56')]=function(_0x538ef8,_0x501ee6,_0x22b298){var _0x1ff1ff={'agent':{},'channel':_0xf347('0x57')};if(_0x538ef8[_0xf347('0x52')]['id']){delete _0x538ef8[_0xf347('0x52')]['id'];}_0x538ef8[_0xf347('0x52')][_0xf347('0x58')]=!![];_0x538ef8[_0xf347('0x52')][_0xf347('0x59')]=moment()[_0xf347('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x538ef8['body']['UserId']=_0x538ef8[_0xf347('0x52')][_0xf347('0x5b')]||_0x538ef8[_0xf347('0x5c')]['id'];_0x1ff1ff[_0xf347('0x5d')]['id']=_0x538ef8[_0xf347('0x52')][_0xf347('0x5b')];return db[_0xf347('0x35')][_0xf347('0x50')]({'where':{'id':_0x538ef8['params']['id'],'UserId':null}})[_0xf347('0x1d')](handleEntityNotFound(_0x501ee6,null))[_0xf347('0x1d')](saveUpdates(_0x538ef8[_0xf347('0x52')],null))['then'](function(_0x18d10b){if(_0x18d10b){_0x1ff1ff[_0xf347('0x23')]=_0x18d10b['get']({'plain':!![]});return db[_0xf347('0x5e')][_0xf347('0x50')]({'where':{'id':_0x18d10b[_0xf347('0x5f')]}});}return null;})[_0xf347('0x1d')](handleEntityNotFound(_0x501ee6,null))[_0xf347('0x1d')](function(_0x3311c9){if(_0x3311c9){return _0x3311c9[_0xf347('0x30')]({'UserId':_0x538ef8[_0xf347('0x52')]['UserId'],'read1stAt':_[_0xf347('0x60')](_0x3311c9['read1stAt'])?moment()[_0xf347('0x5a')](_0xf347('0x61')):undefined});}return null;})['then'](function(_0x4dea5b){if(_0x4dea5b){_0x1ff1ff['interaction']=_0x4dea5b[_0xf347('0x62')]({'plain':!![]});interaction_log[_0xf347('0x24')](_0xf347('0x63'),_0x538ef8[_0xf347('0x5c')]['id'],_0x538ef8['user'][_0xf347('0x32')],_0x538ef8[_0xf347('0x5c')][_0xf347('0x64')],_0x1ff1ff[_0xf347('0x65')]['id'],_0x538ef8['body']?JSON[_0xf347('0x21')](_0x538ef8[_0xf347('0x52')]):'null');return respondWithRpcPromise(_0xf347('0x66'),_0xf347('0x67'),_0x1ff1ff);}return null;})[_0xf347('0x1d')](function(_0x4f45f3){var _0x114976=_0xf347('0x68')+_0x4f45f3[_0xf347('0x23')]['ContactId'];return db[_0xf347('0x69')]['query'](_0x114976,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xf347('0x1d')](function(_0x23ffa6){return _0x23ffa6;});})[_0xf347('0x1d')](function(_0x56bee0){if(_0x56bee0){_0x1ff1ff[_0xf347('0x23')][_0xf347('0x6a')]=_0x56bee0[0x0];if(!_0x538ef8[_0xf347('0x52')]['UserId'])return;return db[_0xf347('0x6b')]['find']({'where':{'id':_0x538ef8['body'][_0xf347('0x5b')],'role':_0xf347('0x5d')},'attributes':['id',_0xf347('0x32'),_0xf347('0x6c'),'email',_0xf347('0x6d')],'raw':!![]});}return null;})[_0xf347('0x1d')](function(_0x11f9aa){if(!_0x11f9aa)return null;_0x1ff1ff[_0xf347('0x23')][_0xf347('0x5d')]=_0x11f9aa;return _0x1ff1ff;})[_0xf347('0x1d')](function(_0x1bf997){if(_0x1bf997){if(_0x538ef8[_0xf347('0x52')][_0xf347('0x6e')]){_0x1ff1ff[_0xf347('0x23')][_0xf347('0x6f')]=util[_0xf347('0x5a')](_0xf347('0x70'),_0x538ef8['user'][_0xf347('0x32')]);_0x1ff1ff[_0xf347('0x23')][_0xf347('0x71')]=_0x1ff1ff[_0xf347('0x71')];_0x1ff1ff['message'][_0xf347('0x72')]=_0x1ff1ff[_0xf347('0x71')];_0x1ff1ff[_0xf347('0x23')]['event']=_0xf347('0x56');return respondWithRpcPromise(_0xf347('0x73'),_0xf347('0x73'),{'event':_0xf347('0x74'),'message':_0x1ff1ff[_0xf347('0x23')]},client9002)[_0xf347('0x1d')](function(){return _0x1ff1ff;});}return _0x1ff1ff;}return null;})['then'](respondWithResult(_0x501ee6,null))[_0xf347('0x25')](handleError(_0x501ee6,null));};var interaction_log=require(_0xf347('0xd'))('whatsapp-interactions');exports['reject']=function(_0x35dd2c,_0xa813f6,_0x46e633){var _0x321f3b={'agent':{},'channel':'whatsapp'};if(_0x35dd2c[_0xf347('0x52')]['id']){delete _0x35dd2c[_0xf347('0x52')]['id'];}_0x35dd2c[_0xf347('0x52')]['UserId']=_0x35dd2c[_0xf347('0x52')]['UserId']||_0x35dd2c[_0xf347('0x5c')]['id'];_0x321f3b[_0xf347('0x5d')]['id']=_0x35dd2c[_0xf347('0x52')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x35dd2c[_0xf347('0x53')]['id'],'UserId':null}})[_0xf347('0x1d')](handleEntityNotFound(_0xa813f6,null))[_0xf347('0x1d')](function(_0x449521){if(_0x449521){_0x321f3b[_0xf347('0x23')]=_0x449521['get']({'plain':!![]});return db[_0xf347('0x5e')]['find']({'where':{'id':_0x449521[_0xf347('0x5f')]}});}return null;})[_0xf347('0x1d')](handleEntityNotFound(_0xa813f6,null))[_0xf347('0x1d')](function(_0x24b49a){if(_0x24b49a){_0x321f3b[_0xf347('0x65')]=_0x24b49a[_0xf347('0x62')]({'plain':!![]});interaction_log[_0xf347('0x24')](_0xf347('0x75'),_0x35dd2c[_0xf347('0x5c')]['id'],_0x35dd2c['user'][_0xf347('0x32')],_0x35dd2c[_0xf347('0x5c')][_0xf347('0x64')],_0x321f3b[_0xf347('0x65')]['id'],_0x35dd2c[_0xf347('0x52')]?JSON[_0xf347('0x21')](_0x35dd2c[_0xf347('0x52')]):_0xf347('0x76'));return respondWithRpcPromise(_0xf347('0x77'),_0xf347('0x78'),_0x321f3b);}return null;})['then'](function(_0x2890d0){var _0x51ffc8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2890d0[_0xf347('0x23')][_0xf347('0x79')];return db[_0xf347('0x69')]['query'](_0x51ffc8,{'type':db[_0xf347('0x7a')][_0xf347('0x7b')][_0xf347('0x7c')],'raw':!![]})['then'](function(_0x5b5310){return _0x5b5310;});})['then'](function(_0x27c2d6){if(_0x27c2d6){_0x321f3b[_0xf347('0x23')][_0xf347('0x6a')]=_0x27c2d6[0x0];if(!_0x35dd2c[_0xf347('0x52')][_0xf347('0x5b')])return;return db[_0xf347('0x6b')][_0xf347('0x50')]({'where':{'id':_0x35dd2c[_0xf347('0x52')][_0xf347('0x5b')],'role':'agent'},'attributes':['id','name',_0xf347('0x6c'),_0xf347('0x7d'),_0xf347('0x6d')],'raw':!![]});}return null;})[_0xf347('0x1d')](function(_0x41825b){if(!_0x41825b)return null;_0x321f3b[_0xf347('0x23')][_0xf347('0x5d')]=_0x41825b;return _0x321f3b;})[_0xf347('0x1d')](function(_0x33ecda){if(_0x33ecda){_0x33ecda[_0xf347('0x23')][_0xf347('0x6f')]=util[_0xf347('0x5a')]('SIP/%s',_0x35dd2c[_0xf347('0x5c')][_0xf347('0x32')]);_0x33ecda[_0xf347('0x23')][_0xf347('0x71')]=_0x321f3b[_0xf347('0x71')];_0x33ecda[_0xf347('0x23')][_0xf347('0x72')]=_0x321f3b[_0xf347('0x71')];_0x33ecda[_0xf347('0x23')][_0xf347('0x7e')]=_0xf347('0x2f');respondWithRpcPromise(_0xf347('0x73'),_0xf347('0x73'),{'event':_0xf347('0x7f'),'message':_0x33ecda[_0xf347('0x23')]},client9002);return _0x321f3b;}return null;})[_0xf347('0x1d')](respondWithResult(_0xa813f6,null))['catch'](handleError(_0xa813f6,null));};exports[_0xf347('0x27')]=function(_0x2be9cc,_0x4c8cc1,_0x21d6a3){if(_0x2be9cc['body']['id']){delete _0x2be9cc[_0xf347('0x52')]['id'];}var _0x408e98;return db['WhatsappMessage']['find']({'where':{'id':_0x2be9cc[_0xf347('0x53')]['id']}})[_0xf347('0x1d')](handleEntityNotFound(_0x4c8cc1,null))[_0xf347('0x1d')](function(_0x53f361){if(_0x53f361){_0x408e98=_0x53f361;return db[_0xf347('0x80')][_0xf347('0x50')]({'where':{'id':_0x53f361[_0xf347('0x81')]}});}})[_0xf347('0x1d')](handleEntityNotFound(_0x4c8cc1,null))[_0xf347('0x1d')](function(_0x3fe0a1){if(_0x3fe0a1){logger[_0xf347('0x82')](_0xf347('0x83'),_0xf347('0x27'),_0xf347('0x84'),_0x3fe0a1[_0xf347('0x48')],util[_0xf347('0x85')](_0x2be9cc[_0xf347('0x52')],{'showHidden':![],'depth':null}));switch(_0x3fe0a1['type']){case _0xf347('0x86'):if(_0x2be9cc['body'][_0xf347('0x87')]&&_0x2be9cc[_0xf347('0x52')]['MessageSid']===_0x408e98[_0xf347('0x88')]&&_0x2be9cc[_0xf347('0x52')][_0xf347('0x89')]&&_0x2be9cc[_0xf347('0x52')][_0xf347('0x89')]==='read'){return _0x408e98[_0xf347('0x30')]({'read':!![]});}else{logger[_0xf347('0x22')](_0xf347('0x8a'),_0xf347('0x27'),'twilio',util[_0xf347('0x85')](_0x2be9cc[_0xf347('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x408e98;}})[_0xf347('0x1d')](respondWithResult(_0x4c8cc1,null))[_0xf347('0x25')](handleError(_0x4c8cc1,null));};
\ No newline at end of file
+var _0xf825=['debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','intersection','find','create','body','describe','whatsapp-interactions','accept','read','readAt','format','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','whatsapp','rejectMessage','sequelize','Sequelize','contact','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x252699,_0x134b4e){var _0x56d0c6=function(_0x5551a8){while(--_0x5551a8){_0x252699['push'](_0x252699['shift']());}};_0x56d0c6(++_0x134b4e);}(_0xf825,0xf6));var _0x5f82=function(_0x5d624d,_0xde7b4){_0x5d624d=_0x5d624d-0x0;var _0x110fb0=_0xf825[_0x5d624d];return _0x110fb0;};'use strict';var emlformat=require(_0x5f82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f82('0x1'));var jsonpatch=require(_0x5f82('0x2'));var rp=require(_0x5f82('0x3'));var moment=require('moment');var BPromise=require(_0x5f82('0x4'));var Mustache=require('mustache');var util=require(_0x5f82('0x5'));var path=require(_0x5f82('0x6'));var sox=require(_0x5f82('0x7'));var csv=require(_0x5f82('0x8'));var ejs=require(_0x5f82('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f82('0xa'));var squel=require(_0x5f82('0xb'));var crypto=require(_0x5f82('0xc'));var jsforce=require(_0x5f82('0xd'));var deskjs=require(_0x5f82('0xe'));var toCsv=require(_0x5f82('0x8'));var querystring=require(_0x5f82('0xf'));var Papa=require(_0x5f82('0x10'));var Redis=require(_0x5f82('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f82('0x12'));var as=require(_0x5f82('0x13'));var hardwareService=require(_0x5f82('0x14'));var logger=require(_0x5f82('0x15'))(_0x5f82('0x16'));var utils=require(_0x5f82('0x17'));var config=require(_0x5f82('0x18'));var licenseUtil=require(_0x5f82('0x19'));var db=require(_0x5f82('0x1a'))['db'];config[_0x5f82('0x1b')]=_[_0x5f82('0x1c')](config[_0x5f82('0x1b')],{'host':_0x5f82('0x1d'),'port':0x18eb});var socket=require(_0x5f82('0x1e'))(new Redis(config[_0x5f82('0x1b')]));require(_0x5f82('0x1f'))[_0x5f82('0x20')](socket);var jayson=require(_0x5f82('0x21'));var client=jayson[_0x5f82('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x5f82('0x22')][_0x5f82('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x15ebc9,_0x42d865,_0x5ae7bd,_0x4f73f9){return new BPromise(function(_0x3ec274,_0x470337){var _0x20dba2=_0x4f73f9||client;return _0x20dba2['request'](_0x15ebc9,_0x5ae7bd)[_0x5f82('0x24')](function(_0x55d208){logger[_0x5f82('0x25')](_0x5f82('0x26'),_0x42d865,_0x5f82('0x27'));logger[_0x5f82('0x28')](_0x5f82('0x29'),_0x42d865,'request\x20sent',JSON['stringify'](_0x55d208));if(_0x55d208['error']){if(_0x55d208[_0x5f82('0x2a')][_0x5f82('0x2b')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x42d865,_0x55d208['error']['message']);return _0x470337(_0x55d208[_0x5f82('0x2a')][_0x5f82('0x2c')]);}logger[_0x5f82('0x2a')](_0x5f82('0x26'),_0x42d865,_0x55d208[_0x5f82('0x2a')][_0x5f82('0x2c')]);return _0x3ec274(_0x55d208[_0x5f82('0x2a')][_0x5f82('0x2c')]);}else{logger[_0x5f82('0x25')](_0x5f82('0x26'),_0x42d865,'request\x20sent');_0x3ec274(_0x55d208[_0x5f82('0x2d')][_0x5f82('0x2c')]);}})[_0x5f82('0x2e')](function(_0x6da0e4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x42d865,_0x6da0e4);_0x470337(_0x6da0e4);});});}function respondWithStatusCode(_0x5559e6,_0x3a1bcf){_0x3a1bcf=_0x3a1bcf||0xcc;return function(_0xd9af3f){if(_0xd9af3f){return _0x5559e6[_0x5f82('0x2f')](_0x3a1bcf);}return _0x5559e6['status'](_0x3a1bcf)[_0x5f82('0x30')]();};}function respondWithResult(_0x1f099d,_0x2c0ffd){_0x2c0ffd=_0x2c0ffd||0xc8;return function(_0xdbf41c){if(_0xdbf41c){return _0x1f099d[_0x5f82('0x31')](_0x2c0ffd)['json'](_0xdbf41c);}};}function respondWithFilteredResult(_0x25beba,_0xf0e211){return function(_0x89ad5f){if(_0x89ad5f){var _0x10a677=typeof _0xf0e211[_0x5f82('0x32')]===_0x5f82('0x33')&&typeof _0xf0e211[_0x5f82('0x34')]==='undefined';var _0x2d4b04=_0x89ad5f['count'];var _0x14558f=_0x10a677?0x0:_0xf0e211['offset'];var _0x37a834=_0x10a677?_0x89ad5f[_0x5f82('0x35')]:_0xf0e211[_0x5f82('0x32')]+_0xf0e211['limit'];var _0x5f1b7b;if(_0x37a834>=_0x2d4b04){_0x37a834=_0x2d4b04;_0x5f1b7b=0xc8;}else{_0x5f1b7b=0xce;}_0x25beba['status'](_0x5f1b7b);return _0x25beba['set'](_0x5f82('0x36'),_0x14558f+'-'+_0x37a834+'/'+_0x2d4b04)[_0x5f82('0x37')](_0x89ad5f);}return null;};}function patchUpdates(_0x81a6b5){return function(_0x41d816){try{jsonpatch[_0x5f82('0x38')](_0x41d816,_0x81a6b5,!![]);}catch(_0x4c7e88){return BPromise[_0x5f82('0x39')](_0x4c7e88);}return _0x41d816[_0x5f82('0x3a')]();};}function saveUpdates(_0x2518ba,_0x4105e6){return function(_0xd25da0){if(_0xd25da0){return _0xd25da0[_0x5f82('0x3b')](_0x2518ba)[_0x5f82('0x24')](function(_0x5597dc){return _0x5597dc;});}return null;};}function removeEntity(_0x29acea,_0x2e5abf){return function(_0x3073df){if(_0x3073df){return _0x3073df[_0x5f82('0x3c')]()['then'](function(){_0x29acea[_0x5f82('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1063c3,_0x564563){return function(_0x11ca83){if(!_0x11ca83){_0x1063c3[_0x5f82('0x2f')](0x194);}return _0x11ca83;};}function handleError(_0x392bc8,_0x1aa298){_0x1aa298=_0x1aa298||0x1f4;return function(_0x48d6ee){logger[_0x5f82('0x2a')](_0x48d6ee[_0x5f82('0x3d')]);if(_0x48d6ee[_0x5f82('0x3e')]){delete _0x48d6ee[_0x5f82('0x3e')];}_0x392bc8[_0x5f82('0x31')](_0x1aa298)[_0x5f82('0x3f')](_0x48d6ee);};}exports[_0x5f82('0x40')]=function(_0x19ef6f,_0x1eec0b){var _0x43642a={},_0x3ed43c={},_0x1e81c2={'count':0x0,'rows':[]};var _0x254552=_[_0x5f82('0x41')](db[_0x5f82('0x42')][_0x5f82('0x43')],function(_0x5a456e){return{'name':_0x5a456e[_0x5f82('0x44')],'type':_0x5a456e[_0x5f82('0x45')][_0x5f82('0x46')]};});_0x3ed43c[_0x5f82('0x47')]=_[_0x5f82('0x41')](_0x254552,'name');_0x3ed43c['query']=_[_0x5f82('0x48')](_0x19ef6f['query']);_0x3ed43c['filters']=_['intersection'](_0x3ed43c[_0x5f82('0x47')],_0x3ed43c[_0x5f82('0x49')]);_0x43642a[_0x5f82('0x4a')]=_['intersection'](_0x3ed43c[_0x5f82('0x47')],qs['fields'](_0x19ef6f[_0x5f82('0x49')][_0x5f82('0x4b')]));_0x43642a[_0x5f82('0x4a')]=_0x43642a['attributes'][_0x5f82('0x4c')]?_0x43642a['attributes']:_0x3ed43c[_0x5f82('0x47')];if(!_0x19ef6f[_0x5f82('0x49')][_0x5f82('0x4d')](_0x5f82('0x4e'))){_0x43642a[_0x5f82('0x34')]=qs['limit'](_0x19ef6f['query'][_0x5f82('0x34')]);_0x43642a['offset']=qs[_0x5f82('0x32')](_0x19ef6f[_0x5f82('0x49')][_0x5f82('0x32')]);}_0x43642a['order']=qs[_0x5f82('0x4f')](_0x19ef6f[_0x5f82('0x49')]['sort']);_0x43642a[_0x5f82('0x50')]=qs[_0x5f82('0x51')](_[_0x5f82('0x52')](_0x19ef6f[_0x5f82('0x49')],_0x3ed43c[_0x5f82('0x51')]),_0x254552);if(_0x19ef6f[_0x5f82('0x49')][_0x5f82('0x53')]){_0x43642a[_0x5f82('0x50')]=_['merge'](_0x43642a[_0x5f82('0x50')],{'$or':_['map'](_0x254552,function(_0x2777a0){if(_0x2777a0[_0x5f82('0x45')]!==_0x5f82('0x54')){var _0x1cbe6e={};_0x1cbe6e[_0x2777a0['name']]={'$like':'%'+_0x19ef6f[_0x5f82('0x49')][_0x5f82('0x53')]+'%'};return _0x1cbe6e;}})});}_0x43642a=_[_0x5f82('0x55')]({},_0x43642a,_0x19ef6f[_0x5f82('0x56')]);var _0x132f83={'where':_0x43642a[_0x5f82('0x50')]};return db[_0x5f82('0x42')][_0x5f82('0x35')](_0x132f83)[_0x5f82('0x24')](function(_0xde4aa){_0x1e81c2[_0x5f82('0x35')]=_0xde4aa;if(_0x19ef6f[_0x5f82('0x49')][_0x5f82('0x57')]){_0x43642a[_0x5f82('0x58')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x5f82('0x59')](_0x43642a);})[_0x5f82('0x24')](function(_0x40d8af){_0x1e81c2['rows']=_0x40d8af;return _0x1e81c2;})[_0x5f82('0x24')](respondWithFilteredResult(_0x1eec0b,_0x43642a))[_0x5f82('0x2e')](handleError(_0x1eec0b,null));};exports[_0x5f82('0x5a')]=function(_0x5a2276,_0xa3e269){var _0x226b36={'raw':!![],'where':{'id':_0x5a2276[_0x5f82('0x5b')]['id']}},_0x13b4b1={};_0x13b4b1[_0x5f82('0x47')]=_[_0x5f82('0x48')](db['WhatsappMessage'][_0x5f82('0x43')]);_0x13b4b1[_0x5f82('0x49')]=_[_0x5f82('0x48')](_0x5a2276[_0x5f82('0x49')]);_0x13b4b1[_0x5f82('0x51')]=_[_0x5f82('0x5c')](_0x13b4b1[_0x5f82('0x47')],_0x13b4b1[_0x5f82('0x49')]);_0x226b36['attributes']=_['intersection'](_0x13b4b1[_0x5f82('0x47')],qs[_0x5f82('0x4b')](_0x5a2276[_0x5f82('0x49')][_0x5f82('0x4b')]));_0x226b36[_0x5f82('0x4a')]=_0x226b36[_0x5f82('0x4a')][_0x5f82('0x4c')]?_0x226b36[_0x5f82('0x4a')]:_0x13b4b1[_0x5f82('0x47')];if(_0x5a2276[_0x5f82('0x49')][_0x5f82('0x57')]){_0x226b36[_0x5f82('0x58')]=[{'all':!![]}];}_0x226b36=_['merge']({},_0x226b36,_0x5a2276['options']);return db['WhatsappMessage'][_0x5f82('0x5d')](_0x226b36)[_0x5f82('0x24')](handleEntityNotFound(_0xa3e269,null))[_0x5f82('0x24')](respondWithResult(_0xa3e269,null))['catch'](handleError(_0xa3e269,null));};exports['create']=function(_0x37e891,_0x5a886c){return db['WhatsappMessage'][_0x5f82('0x5e')](_0x37e891[_0x5f82('0x5f')],{})[_0x5f82('0x24')](respondWithResult(_0x5a886c,0xc9))[_0x5f82('0x2e')](handleError(_0x5a886c,null));};exports['update']=function(_0x48edb8,_0x52b352){if(_0x48edb8[_0x5f82('0x5f')]['id']){delete _0x48edb8['body']['id'];}return db[_0x5f82('0x42')][_0x5f82('0x5d')]({'where':{'id':_0x48edb8[_0x5f82('0x5b')]['id']}})['then'](handleEntityNotFound(_0x52b352,null))[_0x5f82('0x24')](saveUpdates(_0x48edb8[_0x5f82('0x5f')],null))['then'](respondWithResult(_0x52b352,null))['catch'](handleError(_0x52b352,null));};exports[_0x5f82('0x3c')]=function(_0x2c916f,_0x4e52c6){return db[_0x5f82('0x42')][_0x5f82('0x5d')]({'where':{'id':_0x2c916f[_0x5f82('0x5b')]['id']}})[_0x5f82('0x24')](handleEntityNotFound(_0x4e52c6,null))['then'](removeEntity(_0x4e52c6,null))[_0x5f82('0x2e')](handleError(_0x4e52c6,null));};exports[_0x5f82('0x60')]=function(_0x50c40c,_0x29f1e3){return db[_0x5f82('0x42')]['describe']()[_0x5f82('0x24')](respondWithResult(_0x29f1e3,null))[_0x5f82('0x2e')](handleError(_0x29f1e3,null));};var interaction_log=require(_0x5f82('0x15'))(_0x5f82('0x61'));exports[_0x5f82('0x62')]=function(_0x3ceea3,_0x1f8dfa,_0x411374){var _0x40374a={'agent':{},'channel':'whatsapp'};if(_0x3ceea3[_0x5f82('0x5f')]['id']){delete _0x3ceea3['body']['id'];}_0x3ceea3['body'][_0x5f82('0x63')]=!![];_0x3ceea3[_0x5f82('0x5f')][_0x5f82('0x64')]=moment()[_0x5f82('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ceea3[_0x5f82('0x5f')][_0x5f82('0x66')]=_0x3ceea3[_0x5f82('0x5f')][_0x5f82('0x66')]||_0x3ceea3[_0x5f82('0x67')]['id'];_0x40374a['agent']['id']=_0x3ceea3[_0x5f82('0x5f')][_0x5f82('0x66')];return db[_0x5f82('0x42')][_0x5f82('0x5d')]({'where':{'id':_0x3ceea3['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1f8dfa,null))[_0x5f82('0x24')](saveUpdates(_0x3ceea3[_0x5f82('0x5f')],null))['then'](function(_0x512a20){if(_0x512a20){_0x40374a[_0x5f82('0x2c')]=_0x512a20[_0x5f82('0x68')]({'plain':!![]});return db[_0x5f82('0x69')][_0x5f82('0x5d')]({'where':{'id':_0x512a20[_0x5f82('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x1f8dfa,null))[_0x5f82('0x24')](function(_0x173242){if(_0x173242){return _0x173242[_0x5f82('0x3b')]({'UserId':_0x3ceea3[_0x5f82('0x5f')]['UserId'],'read1stAt':_[_0x5f82('0x6b')](_0x173242[_0x5f82('0x6c')])?moment()[_0x5f82('0x65')](_0x5f82('0x6d')):undefined});}return null;})['then'](function(_0x524a58){if(_0x524a58){_0x40374a['interaction']=_0x524a58['get']({'plain':!![]});interaction_log[_0x5f82('0x25')](_0x5f82('0x6e'),_0x3ceea3[_0x5f82('0x67')]['id'],_0x3ceea3[_0x5f82('0x67')]['name'],_0x3ceea3[_0x5f82('0x67')][_0x5f82('0x6f')],_0x40374a[_0x5f82('0x70')]['id'],_0x3ceea3[_0x5f82('0x5f')]?JSON[_0x5f82('0x71')](_0x3ceea3[_0x5f82('0x5f')]):_0x5f82('0x72'));return respondWithRpcPromise(_0x5f82('0x73'),_0x5f82('0x74'),_0x40374a);}return null;})['then'](function(_0xb479e7){var _0x4d2e43='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xb479e7['message'][_0x5f82('0x75')];return db['sequelize'][_0x5f82('0x49')](_0x4d2e43,{'type':db['Sequelize'][_0x5f82('0x76')][_0x5f82('0x77')],'raw':!![]})[_0x5f82('0x24')](function(_0x3cb717){return _0x3cb717;});})[_0x5f82('0x24')](function(_0x184696){if(_0x184696){_0x40374a[_0x5f82('0x2c')]['contact']=_0x184696[0x0];if(!_0x3ceea3[_0x5f82('0x5f')][_0x5f82('0x66')])return;return db[_0x5f82('0x78')][_0x5f82('0x5d')]({'where':{'id':_0x3ceea3[_0x5f82('0x5f')][_0x5f82('0x66')],'role':_0x5f82('0x79')},'attributes':['id',_0x5f82('0x3e'),_0x5f82('0x7a'),_0x5f82('0x7b'),_0x5f82('0x7c')],'raw':!![]});}return null;})[_0x5f82('0x24')](function(_0x2c2e01){if(!_0x2c2e01)return null;_0x40374a[_0x5f82('0x2c')][_0x5f82('0x79')]=_0x2c2e01;return _0x40374a;})[_0x5f82('0x24')](function(_0x17d0f0){if(_0x17d0f0){if(_0x3ceea3['body'][_0x5f82('0x7d')]){_0x40374a['message']['interface']=util[_0x5f82('0x65')](_0x5f82('0x7e'),_0x3ceea3['user']['name']);_0x40374a[_0x5f82('0x2c')]['channel']=_0x40374a[_0x5f82('0x7f')];_0x40374a['message'][_0x5f82('0x80')]=_0x40374a[_0x5f82('0x7f')];_0x40374a['message'][_0x5f82('0x81')]=_0x5f82('0x62');return respondWithRpcPromise(_0x5f82('0x82'),'EventManager',{'event':'acceptmessage','message':_0x40374a[_0x5f82('0x2c')]},client9002)[_0x5f82('0x24')](function(){return _0x40374a;});}return _0x40374a;}return null;})[_0x5f82('0x24')](respondWithResult(_0x1f8dfa,null))['catch'](handleError(_0x1f8dfa,null));};var interaction_log=require(_0x5f82('0x15'))(_0x5f82('0x61'));exports['reject']=function(_0x3a8575,_0x501973,_0xa06c89){var _0xb7d74c={'agent':{},'channel':_0x5f82('0x83')};if(_0x3a8575[_0x5f82('0x5f')]['id']){delete _0x3a8575['body']['id'];}_0x3a8575[_0x5f82('0x5f')][_0x5f82('0x66')]=_0x3a8575[_0x5f82('0x5f')][_0x5f82('0x66')]||_0x3a8575['user']['id'];_0xb7d74c[_0x5f82('0x79')]['id']=_0x3a8575[_0x5f82('0x5f')][_0x5f82('0x66')];return db[_0x5f82('0x42')][_0x5f82('0x5d')]({'where':{'id':_0x3a8575[_0x5f82('0x5b')]['id'],'UserId':null}})[_0x5f82('0x24')](handleEntityNotFound(_0x501973,null))[_0x5f82('0x24')](function(_0x35db01){if(_0x35db01){_0xb7d74c[_0x5f82('0x2c')]=_0x35db01[_0x5f82('0x68')]({'plain':!![]});return db[_0x5f82('0x69')][_0x5f82('0x5d')]({'where':{'id':_0x35db01[_0x5f82('0x6a')]}});}return null;})[_0x5f82('0x24')](handleEntityNotFound(_0x501973,null))['then'](function(_0x3a4beb){if(_0x3a4beb){_0xb7d74c[_0x5f82('0x70')]=_0x3a4beb['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a8575['user']['id'],_0x3a8575['user'][_0x5f82('0x3e')],_0x3a8575[_0x5f82('0x67')][_0x5f82('0x6f')],_0xb7d74c['interaction']['id'],_0x3a8575[_0x5f82('0x5f')]?JSON['stringify'](_0x3a8575['body']):_0x5f82('0x72'));return respondWithRpcPromise('RejectMessage',_0x5f82('0x84'),_0xb7d74c);}return null;})[_0x5f82('0x24')](function(_0x1233cc){var _0x1cfbf4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1233cc[_0x5f82('0x2c')]['ContactId'];return db[_0x5f82('0x85')][_0x5f82('0x49')](_0x1cfbf4,{'type':db[_0x5f82('0x86')][_0x5f82('0x76')][_0x5f82('0x77')],'raw':!![]})[_0x5f82('0x24')](function(_0x6e9a6){return _0x6e9a6;});})[_0x5f82('0x24')](function(_0x6decf0){if(_0x6decf0){_0xb7d74c[_0x5f82('0x2c')][_0x5f82('0x87')]=_0x6decf0[0x0];if(!_0x3a8575[_0x5f82('0x5f')][_0x5f82('0x66')])return;return db[_0x5f82('0x78')]['find']({'where':{'id':_0x3a8575[_0x5f82('0x5f')][_0x5f82('0x66')],'role':_0x5f82('0x79')},'attributes':['id','name',_0x5f82('0x7a'),_0x5f82('0x7b'),_0x5f82('0x7c')],'raw':!![]});}return null;})['then'](function(_0x3a347b){if(!_0x3a347b)return null;_0xb7d74c[_0x5f82('0x2c')][_0x5f82('0x79')]=_0x3a347b;return _0xb7d74c;})['then'](function(_0x3fec7a){if(_0x3fec7a){_0x3fec7a[_0x5f82('0x2c')]['interface']=util[_0x5f82('0x65')](_0x5f82('0x7e'),_0x3a8575['user'][_0x5f82('0x3e')]);_0x3fec7a[_0x5f82('0x2c')][_0x5f82('0x7f')]=_0xb7d74c[_0x5f82('0x7f')];_0x3fec7a[_0x5f82('0x2c')][_0x5f82('0x80')]=_0xb7d74c[_0x5f82('0x7f')];_0x3fec7a[_0x5f82('0x2c')][_0x5f82('0x81')]=_0x5f82('0x39');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x3fec7a[_0x5f82('0x2c')]},client9002);return _0xb7d74c;}return null;})['then'](respondWithResult(_0x501973,null))[_0x5f82('0x2e')](handleError(_0x501973,null));};exports[_0x5f82('0x31')]=function(_0x94bc9f,_0x54664e,_0x471fc4){if(_0x94bc9f['body']['id']){delete _0x94bc9f['body']['id'];}var _0x553113;return db[_0x5f82('0x42')][_0x5f82('0x5d')]({'where':{'id':_0x94bc9f[_0x5f82('0x5b')]['id']}})[_0x5f82('0x24')](handleEntityNotFound(_0x54664e,null))[_0x5f82('0x24')](function(_0xf3eee6){if(_0xf3eee6){_0x553113=_0xf3eee6;return db['WhatsappAccount'][_0x5f82('0x5d')]({'where':{'id':_0xf3eee6[_0x5f82('0x88')]}});}})[_0x5f82('0x24')](handleEntityNotFound(_0x54664e,null))[_0x5f82('0x24')](function(_0x2994c8){if(_0x2994c8){logger[_0x5f82('0x28')](_0x5f82('0x89'),_0x5f82('0x31'),_0x5f82('0x8a'),_0x2994c8[_0x5f82('0x45')],util[_0x5f82('0x8b')](_0x94bc9f[_0x5f82('0x5f')],{'showHidden':![],'depth':null}));switch(_0x2994c8[_0x5f82('0x45')]){case'twilio':if(_0x94bc9f[_0x5f82('0x5f')][_0x5f82('0x8c')]&&_0x94bc9f[_0x5f82('0x5f')][_0x5f82('0x8c')]===_0x553113[_0x5f82('0x8d')]&&_0x94bc9f[_0x5f82('0x5f')][_0x5f82('0x8e')]&&_0x94bc9f[_0x5f82('0x5f')][_0x5f82('0x8e')]==='read'){return _0x553113[_0x5f82('0x3b')]({'read':!![]});}else{logger[_0x5f82('0x2a')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5f82('0x31'),'twilio',util[_0x5f82('0x8b')](_0x94bc9f['body'],{'showHidden':![],'depth':null}));}break;}return _0x553113;}})['then'](respondWithResult(_0x54664e,null))[_0x5f82('0x2e')](handleError(_0x54664e,null));};
\ No newline at end of file
index 60f7c1c..87d3ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc36d=['../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x3d2842,_0x170e20){var _0x4ed5b8=function(_0x229879){while(--_0x229879){_0x3d2842['push'](_0x3d2842['shift']());}};_0x4ed5b8(++_0x170e20);}(_0xc36d,0x7d));var _0xdc36=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0xc36d[_0x1a8bbc];return _0x212fc2;};'use strict';var EventEmitter=require(_0xdc36('0x0'));var WhatsappMessage=require(_0xdc36('0x1'))['db'][_0xdc36('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xdc36('0x3')](0x0);var events={'afterCreate':_0xdc36('0x4'),'afterUpdate':_0xdc36('0x5'),'afterDestroy':'remove'};function emitEvent(_0x42522b){return function(_0x3431f9,_0x53ac17,_0x18c8fe){WhatsappMessageEvents[_0xdc36('0x6')](_0x42522b+':'+_0x3431f9['id'],_0x3431f9);WhatsappMessageEvents[_0xdc36('0x6')](_0x42522b,_0x3431f9);_0x18c8fe(null);};}for(var e in events){if(events[_0xdc36('0x7')](e)){var event=events[e];WhatsappMessage[_0xdc36('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0xe1e3=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x16cad8,_0x168cc5){var _0xf23da0=function(_0x4e63d8){while(--_0x4e63d8){_0x16cad8['push'](_0x16cad8['shift']());}};_0xf23da0(++_0x168cc5);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5160be,_0x129730){_0x5160be=_0x5160be-0x0;var _0x23c35f=_0xe1e3[_0x5160be];return _0x23c35f;};'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 6304580..2d99174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf33d=['token','sid','afterCreate','sinch','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','catch','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','error','out','find','type','twilio','accountSid','authToken','create','phone','whatsapp:','remote','/api/whatsapp/messages/','/status?token='];(function(_0x51914e,_0x19ec4b){var _0x472d3b=function(_0x5c7403){while(--_0x5c7403){_0x51914e['push'](_0x51914e['shift']());}};_0x472d3b(++_0x19ec4b);}(_0xf33d,0xc5));var _0xdf33=function(_0x2659e7,_0x377ed1){_0x2659e7=_0x2659e7-0x0;var _0x2f86e5=_0xf33d[_0x2659e7];return _0x2f86e5;};'use strict';var _=require(_0xdf33('0x0'));var util=require(_0xdf33('0x1'));var logger=require(_0xdf33('0x2'))(_0xdf33('0x3'));var moment=require('moment');var BPromise=require(_0xdf33('0x4'));var rp=require(_0xdf33('0x5'));var fetch=require(_0xdf33('0x6'));var fs=require('fs');var path=require(_0xdf33('0x7'));var rimraf=require(_0xdf33('0x8'));var config=require(_0xdf33('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0xdf33('0xa')]=function(_0x4b4b4e,_0x3d4765){return _0x4b4b4e[_0xdf33('0xb')](_0xdf33('0xc'),attributes,{'tableName':_0xdf33('0xd'),'paranoid':![],'indexes':[{'name':_0xdf33('0xe'),'fields':[_0xdf33('0xe')]},{'name':_0xdf33('0xf'),'fields':[_0xdf33('0x10')],'type':_0xdf33('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f356d,_0x2542c1,_0x30428c){var _0x1a2df5=_0x4b4b4e[_0xdf33('0x12')];var _0x4a344d=_0x1f356d[_0xdf33('0x13')]({'plain':!![]});if(_0x4a344d['direction'][_0xdf33('0x14')]()==='in'||_0x4a344d[_0xdf33('0x15')]['toLowerCase']()==='out'&&!_0x4a344d[_0xdf33('0x16')]&&!_[_0xdf33('0x17')](_0x4a344d[_0xdf33('0x18')])){_0x1a2df5['WhatsappInteraction'][_0xdf33('0x19')]({'where':{'id':_0x4a344d[_0xdf33('0x1a')]}})[_0xdf33('0x1b')](function(_0x5ab1a6){if(_0x5ab1a6){_0x5ab1a6[_0xdf33('0x1c')]({'lastMsgAt':_0x4a344d[_0xdf33('0x1d')],'lastMsgDirection':_0x4a344d[_0xdf33('0x15')][_0xdf33('0x14')]()});}})['catch'](function(_0x5261c9){console[_0xdf33('0x1e')](_0x5261c9);});}if(_0x4a344d['direction']===_0xdf33('0x1f')&&!_0x4a344d[_0xdf33('0x16')]){var _0x1b990f;_0x1a2df5['WhatsappAccount'][_0xdf33('0x20')]({'where':{'id':_0x4a344d['WhatsappAccountId']},'raw':!![]})['then'](function(_0x56c0c4){_0x1b990f=_0x56c0c4;if(_0x1b990f&&_0x1b990f['type']){switch(_0x1b990f[_0xdf33('0x21')]){case _0xdf33('0x22'):var _0xf78291=require(_0xdf33('0x22'));if(_0x1b990f[_0xdf33('0x23')]&&_0x1b990f[_0xdf33('0x24')]&&_0x1b990f['phone']){var _0x5b4dab=new _0xf78291(_0x1b990f['accountSid'],_0x1b990f[_0xdf33('0x24')]);_0x5b4dab['messages'][_0xdf33('0x25')]({'body':_0x4a344d[_0xdf33('0x10')],'to':'whatsapp:'+_0x4a344d[_0xdf33('0x26')],'from':_0xdf33('0x27')+_0x1b990f[_0xdf33('0x26')],'statusCallback':_0x1b990f[_0xdf33('0x28')]+_0xdf33('0x29')+_0x4a344d['id']+_0xdf33('0x2a')+_0x1b990f[_0xdf33('0x2b')]})[_0xdf33('0x1b')](function(_0x1a41e1){if(_0x1a41e1[_0xdf33('0x2c')]){return _0x1f356d[_0xdf33('0x1c')]({'messageId':_0x1a41e1[_0xdf33('0x2c')]});}})['catch'](function(_0xfaeb0f){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xdf33('0x22'),util['inspect'](_0xfaeb0f,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xdf33('0x2d'),_0xdf33('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xdf33('0x2e'):var _0x36f107=_0x1b990f[_0xdf33('0x23')];var _0x242602=_0x1b990f[_0xdf33('0x24')];var _0x42ae69=_0x1b990f[_0xdf33('0x2f')]+_0xdf33('0x30')+_0x36f107+'/messages/';var _0x2a1396={'to':[_0x4a344d[_0xdf33('0x26')]],'message':{'type':_0xdf33('0x31'),'text':_0x4a344d[_0xdf33('0x10')]}};var _0x31cb57={'method':_0xdf33('0x32'),'uri':_0x42ae69,'headers':{'Authorization':_0xdf33('0x33')+_0x242602,'Content-Type':_0xdf33('0x34')},'body':_0x2a1396,'json':!![]};rp(_0x31cb57)['then'](function(_0x448df7){if(_0x448df7['statuses'][0x0]['message_id']){return _0x1f356d[_0xdf33('0x1c')]({'messageId':_0x448df7[_0xdf33('0x35')][0x0][_0xdf33('0x36')]});}})[_0xdf33('0x37')](function(_0x219a2f){logger[_0xdf33('0x38')](_0xdf33('0x39'),_0x219a2f);});break;}}})[_0xdf33('0x3a')](function(){_0x30428c();});}else{_0x30428c();}}},'charset':'utf8mb4','collate':_0xdf33('0x3b')});};
\ No newline at end of file
+var _0xf842=['catch','error','WhatsappAccount','WhatsappAccountId','twilio','accountSid','authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','token','then','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','message_id','err','WhatsappMessage,\x20%s','finally','lodash','util','../../config/logger','api','bluebird','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','update','createdAt'];(function(_0x3003ef,_0x4273f8){var _0x4779ec=function(_0x38b89c){while(--_0x38b89c){_0x3003ef['push'](_0x3003ef['shift']());}};_0x4779ec(++_0x4273f8);}(_0xf842,0x172));var _0x2f84=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xf842[_0x454018];return _0x24697d;};'use strict';var _=require(_0x2f84('0x0'));var util=require(_0x2f84('0x1'));var logger=require(_0x2f84('0x2'))(_0x2f84('0x3'));var moment=require('moment');var BPromise=require(_0x2f84('0x4'));var rp=require(_0x2f84('0x5'));var fetch=require(_0x2f84('0x6'));var fs=require('fs');var path=require(_0x2f84('0x7'));var rimraf=require(_0x2f84('0x8'));var config=require('../../config/environment');var attributes=require(_0x2f84('0x9'));module[_0x2f84('0xa')]=function(_0x88a4cb,_0x55bc67){return _0x88a4cb[_0x2f84('0xb')](_0x2f84('0xc'),attributes,{'tableName':_0x2f84('0xd'),'paranoid':![],'indexes':[{'name':_0x2f84('0xe'),'fields':[_0x2f84('0xe')]},{'name':_0x2f84('0xf'),'fields':[_0x2f84('0x10')],'type':_0x2f84('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d789f,_0x171cca,_0x4edf3b){var _0x9f00c3=_0x88a4cb['models'];var _0x1f8cb1=_0x2d789f[_0x2f84('0x12')]({'plain':!![]});if(_0x1f8cb1[_0x2f84('0x13')][_0x2f84('0x14')]()==='in'||_0x1f8cb1[_0x2f84('0x13')][_0x2f84('0x14')]()===_0x2f84('0x15')&&!_0x1f8cb1[_0x2f84('0x16')]&&!_[_0x2f84('0x17')](_0x1f8cb1[_0x2f84('0x18')])){_0x9f00c3[_0x2f84('0x19')][_0x2f84('0x1a')]({'where':{'id':_0x1f8cb1['WhatsappInteractionId']}})['then'](function(_0x50d906){if(_0x50d906){_0x50d906[_0x2f84('0x1b')]({'lastMsgAt':_0x1f8cb1[_0x2f84('0x1c')],'lastMsgDirection':_0x1f8cb1[_0x2f84('0x13')]['toLowerCase']()});}})[_0x2f84('0x1d')](function(_0x31958b){console[_0x2f84('0x1e')](_0x31958b);});}if(_0x1f8cb1['direction']===_0x2f84('0x15')&&!_0x1f8cb1[_0x2f84('0x16')]){var _0xed58cb;_0x9f00c3[_0x2f84('0x1f')]['find']({'where':{'id':_0x1f8cb1[_0x2f84('0x20')]},'raw':!![]})['then'](function(_0x468f01){_0xed58cb=_0x468f01;if(_0xed58cb&&_0xed58cb['type']){switch(_0xed58cb['type']){case _0x2f84('0x21'):var _0x2117d3=require(_0x2f84('0x21'));if(_0xed58cb[_0x2f84('0x22')]&&_0xed58cb[_0x2f84('0x23')]&&_0xed58cb[_0x2f84('0x24')]){var _0x4c45bb=new _0x2117d3(_0xed58cb['accountSid'],_0xed58cb[_0x2f84('0x23')]);_0x4c45bb[_0x2f84('0x25')][_0x2f84('0x26')]({'body':_0x1f8cb1[_0x2f84('0x10')],'to':_0x2f84('0x27')+_0x1f8cb1[_0x2f84('0x24')],'from':'whatsapp:'+_0xed58cb[_0x2f84('0x24')],'statusCallback':_0xed58cb['remote']+_0x2f84('0x28')+_0x1f8cb1['id']+'/status?token='+_0xed58cb[_0x2f84('0x29')]})[_0x2f84('0x2a')](function(_0x2b747f){if(_0x2b747f['sid']){return _0x2d789f[_0x2f84('0x1b')]({'messageId':_0x2b747f[_0x2f84('0x2b')]});}})[_0x2f84('0x1d')](function(_0x362ae8){logger[_0x2f84('0x1e')](_0x2f84('0x2c'),'afterCreate',_0x2f84('0x21'),util[_0x2f84('0x2d')](_0x362ae8,{'showHidden':![],'depth':null}));});}else{logger[_0x2f84('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2f84('0x21'),_0x2f84('0x2e'));}break;case'sinch':var _0x3cadc2=_0xed58cb[_0x2f84('0x22')];var _0x4e193d=_0xed58cb[_0x2f84('0x23')];var _0x5c56fb=_0xed58cb[_0x2f84('0x2f')]+_0x2f84('0x30')+_0x3cadc2+_0x2f84('0x31');var _0x1e2e54={'to':[_0x1f8cb1[_0x2f84('0x24')]],'message':{'type':'text','text':_0x1f8cb1[_0x2f84('0x10')]}};var _0x371110={'method':_0x2f84('0x32'),'uri':_0x5c56fb,'headers':{'Authorization':_0x2f84('0x33')+_0x4e193d,'Content-Type':_0x2f84('0x34')},'body':_0x1e2e54,'json':!![]};rp(_0x371110)['then'](function(_0x326698){if(_0x326698['statuses'][0x0][_0x2f84('0x35')]){return _0x2d789f['update']({'messageId':_0x326698['statuses'][0x0]['message_id']});}})[_0x2f84('0x1d')](function(_0x5db877){logger[_0x2f84('0x36')](_0x2f84('0x37'),_0x5db877);});break;}}})[_0x2f84('0x38')](function(){_0x4edf3b();});}else{_0x4edf3b();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 30f872e..e2b7131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1c=['error','code','WhatsappMessage,\x20%s,\x20%s','message','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0xaf1c,0x9b));var _0xcaf1=function(_0x1ff628,_0x28cdca){_0x1ff628=_0x1ff628-0x0;var _0x33b1d1=_0xaf1c[_0x1ff628];return _0x33b1d1;};'use strict';var _=require(_0xcaf1('0x0'));var util=require('util');var moment=require(_0xcaf1('0x1'));var BPromise=require(_0xcaf1('0x2'));var rs=require(_0xcaf1('0x3'));var fs=require('fs');var Redis=require(_0xcaf1('0x4'));var db=require(_0xcaf1('0x5'))['db'];var utils=require(_0xcaf1('0x6'));var logger=require(_0xcaf1('0x7'))(_0xcaf1('0x8'));var config=require(_0xcaf1('0x9'));var jayson=require(_0xcaf1('0xa'));var client=jayson[_0xcaf1('0xb')]['http']({'port':0x232a});config['redis']=_[_0xcaf1('0xc')](config[_0xcaf1('0xd')],{'host':_0xcaf1('0xe'),'port':0x18eb});var socket=require(_0xcaf1('0xf'))(new Redis(config[_0xcaf1('0xd')]));require(_0xcaf1('0x10'))[_0xcaf1('0x11')](socket);function respondWithRpcPromise(_0x4749e2,_0x5f2c9c,_0x8c98b4){return new BPromise(function(_0x4b05e0,_0xa2f355){return client[_0xcaf1('0x12')](_0x4749e2,_0x8c98b4)[_0xcaf1('0x13')](function(_0x6e0936){logger[_0xcaf1('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x5f2c9c,_0xcaf1('0x15'));logger[_0xcaf1('0x16')](_0xcaf1('0x17'),_0x5f2c9c,_0xcaf1('0x15'),JSON[_0xcaf1('0x18')](_0x6e0936));if(_0x6e0936[_0xcaf1('0x19')]){if(_0x6e0936[_0xcaf1('0x19')][_0xcaf1('0x1a')]===0x1f4){logger[_0xcaf1('0x19')](_0xcaf1('0x1b'),_0x5f2c9c,_0x6e0936['error'][_0xcaf1('0x1c')]);return _0xa2f355(_0x6e0936['error'][_0xcaf1('0x1c')]);}logger[_0xcaf1('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x5f2c9c,_0x6e0936['error'][_0xcaf1('0x1c')]);return _0x4b05e0(_0x6e0936[_0xcaf1('0x19')]['message']);}else{logger[_0xcaf1('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x5f2c9c,_0xcaf1('0x15'));_0x4b05e0(_0x6e0936[_0xcaf1('0x1d')][_0xcaf1('0x1c')]);}})['catch'](function(_0x27d07e){logger[_0xcaf1('0x19')](_0xcaf1('0x1b'),_0x5f2c9c,_0x27d07e);_0xa2f355(_0x27d07e);});});}exports[_0xcaf1('0x1e')]=function(_0x2c274d){var _0x51ad83=this;return new Promise(function(_0x4109aa,_0x465c6e){return db[_0xcaf1('0x1f')][_0xcaf1('0x20')](_0x2c274d['body'],{'raw':_0x2c274d[_0xcaf1('0x21')]?_0x2c274d[_0xcaf1('0x21')][_0xcaf1('0x22')]===undefined?!![]:![]:!![]})[_0xcaf1('0x13')](function(_0x3d2a3a){logger[_0xcaf1('0x14')](_0xcaf1('0x1e'),_0x2c274d);logger[_0xcaf1('0x16')](_0xcaf1('0x1e'),_0x2c274d,JSON['stringify'](_0x3d2a3a));_0x4109aa(_0x3d2a3a);})[_0xcaf1('0x23')](function(_0x5d6b1b){logger[_0xcaf1('0x19')](_0xcaf1('0x1e'),_0x5d6b1b['message'],_0x2c274d);_0x465c6e(_0x51ad83['error'](0x1f4,_0x5d6b1b[_0xcaf1('0x1c')]));});});};
\ No newline at end of file
+var _0xf5e1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','util','bluebird','ioredis','../../mysqldb'];(function(_0x20b856,_0x91ac8a){var _0x3a6a5a=function(_0x4fde3a){while(--_0x4fde3a){_0x20b856['push'](_0x20b856['shift']());}};_0x3a6a5a(++_0x91ac8a);}(_0xf5e1,0xc8));var _0x1f5e=function(_0x348bac,_0x1804b2){_0x348bac=_0x348bac-0x0;var _0x4e2cbf=_0xf5e1[_0x348bac];return _0x4e2cbf;};'use strict';var _=require('lodash');var util=require(_0x1f5e('0x0'));var moment=require('moment');var BPromise=require(_0x1f5e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f5e('0x2'));var db=require(_0x1f5e('0x3'))['db'];var utils=require(_0x1f5e('0x4'));var logger=require(_0x1f5e('0x5'))(_0x1f5e('0x6'));var config=require(_0x1f5e('0x7'));var jayson=require(_0x1f5e('0x8'));var client=jayson[_0x1f5e('0x9')][_0x1f5e('0xa')]({'port':0x232a});config['redis']=_[_0x1f5e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1f5e('0xc'))(new Redis(config[_0x1f5e('0xd')]));require(_0x1f5e('0xe'))[_0x1f5e('0xf')](socket);function respondWithRpcPromise(_0x3567f1,_0x4ac337,_0x3351a9){return new BPromise(function(_0x6391c6,_0x578087){return client['request'](_0x3567f1,_0x3351a9)[_0x1f5e('0x10')](function(_0x21bfb7){logger[_0x1f5e('0x11')](_0x1f5e('0x12'),_0x4ac337,'request\x20sent');logger[_0x1f5e('0x13')](_0x1f5e('0x14'),_0x4ac337,_0x1f5e('0x15'),JSON[_0x1f5e('0x16')](_0x21bfb7));if(_0x21bfb7[_0x1f5e('0x17')]){if(_0x21bfb7[_0x1f5e('0x17')][_0x1f5e('0x18')]===0x1f4){logger[_0x1f5e('0x17')](_0x1f5e('0x12'),_0x4ac337,_0x21bfb7[_0x1f5e('0x17')][_0x1f5e('0x19')]);return _0x578087(_0x21bfb7[_0x1f5e('0x17')][_0x1f5e('0x19')]);}logger[_0x1f5e('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x4ac337,_0x21bfb7[_0x1f5e('0x17')][_0x1f5e('0x19')]);return _0x6391c6(_0x21bfb7[_0x1f5e('0x17')][_0x1f5e('0x19')]);}else{logger[_0x1f5e('0x11')](_0x1f5e('0x12'),_0x4ac337,'request\x20sent');_0x6391c6(_0x21bfb7[_0x1f5e('0x1a')][_0x1f5e('0x19')]);}})[_0x1f5e('0x1b')](function(_0x40e52a){logger['error'](_0x1f5e('0x12'),_0x4ac337,_0x40e52a);_0x578087(_0x40e52a);});});}exports[_0x1f5e('0x1c')]=function(_0x5b33dd){var _0x1514cf=this;return new Promise(function(_0x25c080,_0x5084a9){return db[_0x1f5e('0x1d')][_0x1f5e('0x1e')](_0x5b33dd[_0x1f5e('0x1f')],{'raw':_0x5b33dd[_0x1f5e('0x20')]?_0x5b33dd[_0x1f5e('0x20')][_0x1f5e('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x46d6f1){logger[_0x1f5e('0x11')](_0x1f5e('0x1c'),_0x5b33dd);logger['debug'](_0x1f5e('0x1c'),_0x5b33dd,JSON[_0x1f5e('0x16')](_0x46d6f1));_0x25c080(_0x46d6f1);})[_0x1f5e('0x1b')](function(_0x466968){logger[_0x1f5e('0x17')](_0x1f5e('0x1c'),_0x466968[_0x1f5e('0x19')],_0x5b33dd);_0x5084a9(_0x1514cf['error'](0x1f4,_0x466968['message']));});});};
\ No newline at end of file
index d2afaa9..5ce5473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab0e=['whatsappMessage:','./whatsappMessage.events','save','remove','emit','removeListener','register','length'];(function(_0x33f614,_0x5242a8){var _0x564db2=function(_0x16d3e0){while(--_0x16d3e0){_0x33f614['push'](_0x33f614['shift']());}};_0x564db2(++_0x5242a8);}(_0xab0e,0xa1));var _0xeab0=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xab0e[_0x68c979];return _0x4f0001;};'use strict';var WhatsappMessageEvents=require(_0xeab0('0x0'));var events=[_0xeab0('0x1'),_0xeab0('0x2'),'update'];function createListener(_0x3e41c1,_0x40451e){return function(_0x4721d0){_0x40451e[_0xeab0('0x3')](_0x3e41c1,_0x4721d0);};}function removeListener(_0x520fbd,_0x1b6578){return function(){WhatsappMessageEvents[_0xeab0('0x4')](_0x520fbd,_0x1b6578);};}exports[_0xeab0('0x5')]=function(_0x5e82b7){for(var _0x3e99db=0x0,_0xd16488=events[_0xeab0('0x6')];_0x3e99db<_0xd16488;_0x3e99db++){var _0x226946=events[_0x3e99db];var _0x31d76c=createListener(_0xeab0('0x7')+_0x226946,_0x5e82b7);WhatsappMessageEvents['on'](_0x226946,_0x31d76c);}};
\ No newline at end of file
+var _0x2b69=['register','length','whatsappMessage:','./whatsappMessage.events','remove','update'];(function(_0x99227,_0x2e807c){var _0x17896b=function(_0xcdd082){while(--_0xcdd082){_0x99227['push'](_0x99227['shift']());}};_0x17896b(++_0x2e807c);}(_0x2b69,0x17d));var _0x92b6=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x2b69[_0x6cf19c];return _0xce14f3;};'use strict';var WhatsappMessageEvents=require(_0x92b6('0x0'));var events=['save',_0x92b6('0x1'),_0x92b6('0x2')];function createListener(_0xc14ff1,_0x19f6c3){return function(_0x2215c9){_0x19f6c3['emit'](_0xc14ff1,_0x2215c9);};}function removeListener(_0x44e95a,_0x836b0f){return function(){WhatsappMessageEvents['removeListener'](_0x44e95a,_0x836b0f);};}exports[_0x92b6('0x3')]=function(_0x324b63){for(var _0x1aecfe=0x0,_0x3ac83d=events[_0x92b6('0x4')];_0x1aecfe<_0x3ac83d;_0x1aecfe++){var _0x1389dc=events[_0x1aecfe];var _0x4b06a7=createListener(_0x92b6('0x5')+_0x1389dc,_0x324b63);WhatsappMessageEvents['on'](_0x1389dc,_0x4b06a7);}};
\ No newline at end of file
index c1d19c8..497b8ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1ce=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc1ce,0x163));var _0xec1c=function(_0x3097eb,_0x2a8c2e){_0x3097eb=_0x3097eb-0x0;var _0x5989f9=_0xc1ce[_0x3097eb];return _0x5989f9;};'use strict';var multer=require(_0xec1c('0x0'));var util=require(_0xec1c('0x1'));var path=require(_0xec1c('0x2'));var timeout=require(_0xec1c('0x3'));var express=require(_0xec1c('0x4'));var router=express[_0xec1c('0x5')]();var fs_extra=require(_0xec1c('0x6'));var auth=require(_0xec1c('0x7'));var interaction=require(_0xec1c('0x8'));var config=require(_0xec1c('0x9'));var controller=require(_0xec1c('0xa'));router[_0xec1c('0xb')]('/',auth['isAuthenticated'](),controller[_0xec1c('0xc')]);router[_0xec1c('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xec1c('0xd')]);router[_0xec1c('0xb')](_0xec1c('0xe'),auth[_0xec1c('0xf')](),controller[_0xec1c('0x10')]);router[_0xec1c('0xb')](_0xec1c('0x11'),auth[_0xec1c('0xf')](),controller[_0xec1c('0x12')]);router[_0xec1c('0xb')](_0xec1c('0x13'),auth['isAuthenticated'](),controller[_0xec1c('0x14')]);router[_0xec1c('0xb')](_0xec1c('0x15'),auth[_0xec1c('0xf')](),controller[_0xec1c('0x16')]);router[_0xec1c('0x17')]('/',auth['isAuthenticated'](),controller[_0xec1c('0x18')]);router['post']('/:id/teams',auth[_0xec1c('0xf')](),controller[_0xec1c('0x19')]);router[_0xec1c('0x17')](_0xec1c('0x15'),auth[_0xec1c('0xf')](),controller['addAgents']);router[_0xec1c('0x1a')](_0xec1c('0xe'),auth[_0xec1c('0xf')](),controller[_0xec1c('0x1b')]);router[_0xec1c('0x1c')](_0xec1c('0xe'),auth[_0xec1c('0xf')](),controller['destroy']);router[_0xec1c('0x1c')]('/:id/teams',auth[_0xec1c('0xf')](),controller['removeTeams']);router[_0xec1c('0x1c')](_0xec1c('0x15'),auth[_0xec1c('0xf')](),controller['removeAgents']);module[_0xec1c('0x1d')]=router;
\ No newline at end of file
+var _0x5764=['removeTeams','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','destroy','delete'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5764,0xa9));var _0x4576=function(_0x2e4191,_0x5eec5f){_0x2e4191=_0x2e4191-0x0;var _0xe83670=_0x5764[_0x2e4191];return _0xe83670;};'use strict';var multer=require(_0x4576('0x0'));var util=require(_0x4576('0x1'));var path=require(_0x4576('0x2'));var timeout=require('connect-timeout');var express=require(_0x4576('0x3'));var router=express[_0x4576('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4576('0x5'));var interaction=require(_0x4576('0x6'));var config=require(_0x4576('0x7'));var controller=require(_0x4576('0x8'));router['get']('/',auth[_0x4576('0x9')](),controller[_0x4576('0xa')]);router[_0x4576('0xb')](_0x4576('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x4576('0xb')](_0x4576('0xd'),auth[_0x4576('0x9')](),controller[_0x4576('0xe')]);router[_0x4576('0xb')](_0x4576('0xf'),auth[_0x4576('0x9')](),controller[_0x4576('0x10')]);router['get'](_0x4576('0x11'),auth[_0x4576('0x9')](),controller[_0x4576('0x12')]);router[_0x4576('0xb')](_0x4576('0x13'),auth[_0x4576('0x9')](),controller[_0x4576('0x14')]);router['post']('/',auth[_0x4576('0x9')](),controller['create']);router[_0x4576('0x15')](_0x4576('0x11'),auth['isAuthenticated'](),controller[_0x4576('0x16')]);router[_0x4576('0x15')](_0x4576('0x13'),auth[_0x4576('0x9')](),controller[_0x4576('0x17')]);router['put'](_0x4576('0xd'),auth[_0x4576('0x9')](),controller[_0x4576('0x18')]);router['delete'](_0x4576('0xd'),auth['isAuthenticated'](),controller[_0x4576('0x19')]);router[_0x4576('0x1a')](_0x4576('0x11'),auth[_0x4576('0x9')](),controller[_0x4576('0x1b')]);router['delete'](_0x4576('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 0fb7cae..1a014ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc817=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5c4ce1,_0x3be64c){var _0x2fd310=function(_0x1ab4e8){while(--_0x1ab4e8){_0x5c4ce1['push'](_0x5c4ce1['shift']());}};_0x2fd310(++_0x3be64c);}(_0xc817,0x75));var _0x7c81=function(_0x138174,_0x31ae52){_0x138174=_0x138174-0x0;var _0xde06f1=_0xc817[_0x138174];return _0xde06f1;};'use strict';var Sequelize=require(_0x7c81('0x0'));module[_0x7c81('0x1')]={'name':{'type':Sequelize[_0x7c81('0x2')],'unique':_0x7c81('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c81('0x4')](_0x7c81('0x5'),_0x7c81('0x6'),_0x7c81('0x7'))},'description':{'type':Sequelize[_0x7c81('0x2')]}};
\ No newline at end of file
+var _0x62c8=['ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x33f13e,_0x3cc1e6){var _0x36cb2a=function(_0x15ecb6){while(--_0x15ecb6){_0x33f13e['push'](_0x33f13e['shift']());}};_0x36cb2a(++_0x3cc1e6);}(_0x62c8,0x1ad));var _0x862c=function(_0x51635d,_0x2f66c2){_0x51635d=_0x51635d-0x0;var _0x205fdf=_0x62c8[_0x51635d];return _0x205fdf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x862c('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x862c('0x1')](_0x862c('0x2'),_0x862c('0x3'),_0x862c('0x4'))},'description':{'type':Sequelize[_0x862c('0x0')]}};
\ No newline at end of file
index a3f0830..dac9182 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cea=['count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','WhatsappQueue','include','catch','show','params','includeAll','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','update','describe','getMembers','findOne','UserWhatsappQueue','length','pick','WhatsappQueueId','findAndCountAll','UserId','updatedAt','rows','%s/%s','SIP','whatsappPause','createdAt','Team','getTeams','Agents','online','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','all','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','undefined'];(function(_0x402887,_0x5a38e1){var _0x1c90bc=function(_0x12bfba){while(--_0x12bfba){_0x402887['push'](_0x402887['shift']());}};_0x1c90bc(++_0x5a38e1);}(_0x7cea,0xff));var _0xa7ce=function(_0x23e310,_0x421906){_0x23e310=_0x23e310-0x0;var _0x576643=_0x7cea[_0x23e310];return _0x576643;};'use strict';var emlformat=require(_0xa7ce('0x0'));var rimraf=require(_0xa7ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7ce('0x2'));var rp=require(_0xa7ce('0x3'));var moment=require(_0xa7ce('0x4'));var BPromise=require(_0xa7ce('0x5'));var Mustache=require(_0xa7ce('0x6'));var util=require('util');var path=require(_0xa7ce('0x7'));var sox=require(_0xa7ce('0x8'));var csv=require(_0xa7ce('0x9'));var ejs=require(_0xa7ce('0xa'));var fs=require('fs');var fs_extra=require(_0xa7ce('0xb'));var _=require(_0xa7ce('0xc'));var squel=require(_0xa7ce('0xd'));var crypto=require(_0xa7ce('0xe'));var jsforce=require(_0xa7ce('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa7ce('0x10'));var Papa=require(_0xa7ce('0x11'));var Redis=require(_0xa7ce('0x12'));var authService=require(_0xa7ce('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7ce('0x14'));var logger=require(_0xa7ce('0x15'))(_0xa7ce('0x16'));var utils=require(_0xa7ce('0x17'));var config=require(_0xa7ce('0x18'));var licenseUtil=require(_0xa7ce('0x19'));var db=require(_0xa7ce('0x1a'))['db'];config[_0xa7ce('0x1b')]=_[_0xa7ce('0x1c')](config[_0xa7ce('0x1b')],{'host':_0xa7ce('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7ce('0x1b')]));require('./whatsappQueue.socket')[_0xa7ce('0x1e')](socket);function respondWithStatusCode(_0x1d0081,_0xca2b5a){_0xca2b5a=_0xca2b5a||0xcc;return function(_0x9278){if(_0x9278){return _0x1d0081['sendStatus'](_0xca2b5a);}return _0x1d0081[_0xa7ce('0x1f')](_0xca2b5a)['end']();};}function respondWithResult(_0x1cf2b7,_0xbf49aa){_0xbf49aa=_0xbf49aa||0xc8;return function(_0x22f26c){if(_0x22f26c){return _0x1cf2b7[_0xa7ce('0x1f')](_0xbf49aa)['json'](_0x22f26c);}};}function respondWithFilteredResult(_0x4177f8,_0x4bba72){return function(_0x351bd8){if(_0x351bd8){var _0x505c8a=typeof _0x4bba72['offset']===_0xa7ce('0x20')&&typeof _0x4bba72['limit']==='undefined';var _0x93ae4c=_0x351bd8[_0xa7ce('0x21')];var _0x326510=_0x505c8a?0x0:_0x4bba72[_0xa7ce('0x22')];var _0x2d9d48=_0x505c8a?_0x351bd8[_0xa7ce('0x21')]:_0x4bba72[_0xa7ce('0x22')]+_0x4bba72[_0xa7ce('0x23')];var _0x5d3e0a;if(_0x2d9d48>=_0x93ae4c){_0x2d9d48=_0x93ae4c;_0x5d3e0a=0xc8;}else{_0x5d3e0a=0xce;}_0x4177f8[_0xa7ce('0x1f')](_0x5d3e0a);return _0x4177f8[_0xa7ce('0x24')](_0xa7ce('0x25'),_0x326510+'-'+_0x2d9d48+'/'+_0x93ae4c)[_0xa7ce('0x26')](_0x351bd8);}return null;};}function patchUpdates(_0x42a95b){return function(_0x59a186){try{jsonpatch[_0xa7ce('0x27')](_0x59a186,_0x42a95b,!![]);}catch(_0x59cb54){return BPromise[_0xa7ce('0x28')](_0x59cb54);}return _0x59a186[_0xa7ce('0x29')]();};}function saveUpdates(_0x272e33,_0x3f680f){return function(_0x37d9fb){if(_0x37d9fb){return _0x37d9fb['update'](_0x272e33)[_0xa7ce('0x2a')](function(_0x495129){return _0x495129;});}return null;};}function removeEntity(_0x3867fd,_0x47b4aa){return function(_0x4d3b1c){if(_0x4d3b1c){return _0x4d3b1c[_0xa7ce('0x2b')]()[_0xa7ce('0x2a')](function(){var _0xa8c6d5=_0x4d3b1c[_0xa7ce('0x2c')]({'plain':!![]});var _0x31eb89=_0xa7ce('0x2d');return db[_0xa7ce('0x2e')][_0xa7ce('0x2b')]({'where':{'type':_0x31eb89,'resourceId':_0xa8c6d5['id']}})[_0xa7ce('0x2a')](function(){return _0x4d3b1c;});})['then'](function(){_0x3867fd[_0xa7ce('0x1f')](0xcc)[_0xa7ce('0x2f')]();});}};}function handleEntityNotFound(_0x3f840a,_0xe0d895){return function(_0x221241){if(!_0x221241){_0x3f840a['sendStatus'](0x194);}return _0x221241;};}function handleError(_0xff4e7e,_0xb5b63){_0xb5b63=_0xb5b63||0x1f4;return function(_0x142985){logger[_0xa7ce('0x30')](_0x142985[_0xa7ce('0x31')]);if(_0x142985['name']){delete _0x142985[_0xa7ce('0x32')];}_0xff4e7e['status'](_0xb5b63)[_0xa7ce('0x33')](_0x142985);};}exports[_0xa7ce('0x34')]=function(_0x572f0c,_0x5f43df){var _0x5ce240={},_0x2a54b9={},_0x369e13={'count':0x0,'rows':[]};var _0x5b7d1c=_[_0xa7ce('0x35')](db['WhatsappQueue'][_0xa7ce('0x36')],function(_0x5576aa){return{'name':_0x5576aa[_0xa7ce('0x37')],'type':_0x5576aa[_0xa7ce('0x38')][_0xa7ce('0x39')]};});_0x2a54b9['model']=_['map'](_0x5b7d1c,_0xa7ce('0x32'));_0x2a54b9[_0xa7ce('0x3a')]=_[_0xa7ce('0x3b')](_0x572f0c[_0xa7ce('0x3a')]);_0x2a54b9[_0xa7ce('0x3c')]=_[_0xa7ce('0x3d')](_0x2a54b9['model'],_0x2a54b9[_0xa7ce('0x3a')]);_0x5ce240[_0xa7ce('0x3e')]=_[_0xa7ce('0x3d')](_0x2a54b9['model'],qs[_0xa7ce('0x3f')](_0x572f0c[_0xa7ce('0x3a')][_0xa7ce('0x3f')]));_0x5ce240[_0xa7ce('0x3e')]=_0x5ce240[_0xa7ce('0x3e')]['length']?_0x5ce240[_0xa7ce('0x3e')]:_0x2a54b9[_0xa7ce('0x40')];if(!_0x572f0c[_0xa7ce('0x3a')][_0xa7ce('0x41')](_0xa7ce('0x42'))){_0x5ce240['limit']=qs[_0xa7ce('0x23')](_0x572f0c['query'][_0xa7ce('0x23')]);_0x5ce240['offset']=qs[_0xa7ce('0x22')](_0x572f0c[_0xa7ce('0x3a')][_0xa7ce('0x22')]);}_0x5ce240[_0xa7ce('0x43')]=qs[_0xa7ce('0x44')](_0x572f0c[_0xa7ce('0x3a')]['sort']);_0x5ce240['where']=qs[_0xa7ce('0x3c')](_['pick'](_0x572f0c[_0xa7ce('0x3a')],_0x2a54b9[_0xa7ce('0x3c')]),_0x5b7d1c);if(_0x572f0c[_0xa7ce('0x3a')][_0xa7ce('0x45')]){_0x5ce240[_0xa7ce('0x46')]=_['merge'](_0x5ce240[_0xa7ce('0x46')],{'$or':_[_0xa7ce('0x35')](_0x5b7d1c,function(_0x53f979){if(_0x53f979[_0xa7ce('0x38')]!==_0xa7ce('0x47')){var _0xdff9dc={};_0xdff9dc[_0x53f979[_0xa7ce('0x32')]]={'$like':'%'+_0x572f0c[_0xa7ce('0x3a')]['filter']+'%'};return _0xdff9dc;}})});}_0x5ce240=_[_0xa7ce('0x48')]({},_0x5ce240,_0x572f0c[_0xa7ce('0x49')]);var _0x48eccf={'where':_0x5ce240[_0xa7ce('0x46')]};return db[_0xa7ce('0x4a')]['count'](_0x48eccf)['then'](function(_0x202ec0){_0x369e13[_0xa7ce('0x21')]=_0x202ec0;if(_0x572f0c[_0xa7ce('0x3a')]['includeAll']){_0x5ce240[_0xa7ce('0x4b')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x5ce240);})[_0xa7ce('0x2a')](function(_0x227e3f){_0x369e13['rows']=_0x227e3f;return _0x369e13;})[_0xa7ce('0x2a')](respondWithFilteredResult(_0x5f43df,_0x5ce240))[_0xa7ce('0x4c')](handleError(_0x5f43df,null));};exports[_0xa7ce('0x4d')]=function(_0x25f8ca,_0x59344d){var _0xc212a3={'raw':!![],'where':{'id':_0x25f8ca[_0xa7ce('0x4e')]['id']}},_0x391897={};_0x391897[_0xa7ce('0x40')]=_['keys'](db[_0xa7ce('0x4a')]['rawAttributes']);_0x391897[_0xa7ce('0x3a')]=_[_0xa7ce('0x3b')](_0x25f8ca['query']);_0x391897[_0xa7ce('0x3c')]=_[_0xa7ce('0x3d')](_0x391897[_0xa7ce('0x40')],_0x391897[_0xa7ce('0x3a')]);_0xc212a3[_0xa7ce('0x3e')]=_['intersection'](_0x391897['model'],qs[_0xa7ce('0x3f')](_0x25f8ca[_0xa7ce('0x3a')][_0xa7ce('0x3f')]));_0xc212a3[_0xa7ce('0x3e')]=_0xc212a3['attributes']['length']?_0xc212a3['attributes']:_0x391897['model'];if(_0x25f8ca[_0xa7ce('0x3a')][_0xa7ce('0x4f')]){_0xc212a3['include']=[{'all':!![]}];}_0xc212a3=_['merge']({},_0xc212a3,_0x25f8ca[_0xa7ce('0x49')]);return db[_0xa7ce('0x4a')]['find'](_0xc212a3)[_0xa7ce('0x2a')](handleEntityNotFound(_0x59344d,null))[_0xa7ce('0x2a')](respondWithResult(_0x59344d,null))[_0xa7ce('0x4c')](handleError(_0x59344d,null));};exports[_0xa7ce('0x50')]=function(_0x24b48a,_0x298f80){return db[_0xa7ce('0x4a')]['create'](_0x24b48a[_0xa7ce('0x51')],{})[_0xa7ce('0x2a')](function(_0x3afef0){var _0x6277ed=_0x24b48a[_0xa7ce('0x52')]['get']({'plain':!![]});if(!_0x6277ed)throw new Error(_0xa7ce('0x53'));if(_0x6277ed[_0xa7ce('0x54')]===_0xa7ce('0x52')){var _0x2af62b=_0x3afef0[_0xa7ce('0x2c')]({'plain':!![]});var _0x5cef53='WhatsappQueues';return db[_0xa7ce('0x55')][_0xa7ce('0x56')]({'where':{'name':_0x5cef53,'userProfileId':_0x6277ed[_0xa7ce('0x57')]},'raw':!![]})[_0xa7ce('0x2a')](function(_0x2f18fb){if(_0x2f18fb&&_0x2f18fb[_0xa7ce('0x58')]===0x0){return db[_0xa7ce('0x2e')][_0xa7ce('0x50')]({'name':_0x2af62b[_0xa7ce('0x32')],'resourceId':_0x2af62b['id'],'type':_0x2f18fb[_0xa7ce('0x32')],'sectionId':_0x2f18fb['id']},{})[_0xa7ce('0x2a')](function(){return _0x3afef0;});}else{return _0x3afef0;}})[_0xa7ce('0x4c')](function(_0x5d3431){logger[_0xa7ce('0x30')](_0xa7ce('0x59'),_0x5d3431);throw _0x5d3431;});}return _0x3afef0;})[_0xa7ce('0x2a')](respondWithResult(_0x298f80,0xc9))['catch'](handleError(_0x298f80,null));};exports[_0xa7ce('0x5a')]=function(_0x51d9b6,_0x1682b4){if(_0x51d9b6['body']['id']){delete _0x51d9b6[_0xa7ce('0x51')]['id'];}return db[_0xa7ce('0x4a')][_0xa7ce('0x56')]({'where':{'id':_0x51d9b6[_0xa7ce('0x4e')]['id']}})[_0xa7ce('0x2a')](handleEntityNotFound(_0x1682b4,null))['then'](saveUpdates(_0x51d9b6['body'],null))[_0xa7ce('0x2a')](respondWithResult(_0x1682b4,null))[_0xa7ce('0x4c')](handleError(_0x1682b4,null));};exports['destroy']=function(_0x25635b,_0x5eecfe){return db[_0xa7ce('0x4a')][_0xa7ce('0x56')]({'where':{'id':_0x25635b[_0xa7ce('0x4e')]['id']}})[_0xa7ce('0x2a')](handleEntityNotFound(_0x5eecfe,null))[_0xa7ce('0x2a')](removeEntity(_0x5eecfe,null))[_0xa7ce('0x4c')](handleError(_0x5eecfe,null));};exports['describe']=function(_0x133609,_0x57a67a){return db[_0xa7ce('0x4a')][_0xa7ce('0x5b')]()[_0xa7ce('0x2a')](respondWithResult(_0x57a67a,null))[_0xa7ce('0x4c')](handleError(_0x57a67a,null));};exports[_0xa7ce('0x5c')]=function(_0x69435a,_0x29fb1b,_0x1dcd86){var _0x593a00={'raw':!![],'where':{}},_0x3daea3={},_0x5f2964;return db[_0xa7ce('0x4a')][_0xa7ce('0x5d')]({'where':{'id':_0x69435a[_0xa7ce('0x4e')]['id']}})[_0xa7ce('0x2a')](handleEntityNotFound(_0x29fb1b,null))[_0xa7ce('0x2a')](function(_0x3483f9){if(_0x3483f9){_0x5f2964=_0x3483f9['get']({'plain':!![]});_0x3daea3[_0xa7ce('0x40')]=_[_0xa7ce('0x3b')](db[_0xa7ce('0x5e')]['rawAttributes']);_0x3daea3[_0xa7ce('0x3a')]=_[_0xa7ce('0x3b')](_0x69435a[_0xa7ce('0x3a')]);_0x3daea3['filters']=_[_0xa7ce('0x3d')](_0x3daea3[_0xa7ce('0x40')],_0x3daea3[_0xa7ce('0x3a')]);_0x593a00[_0xa7ce('0x3e')]=_[_0xa7ce('0x3d')](_0x3daea3[_0xa7ce('0x40')],qs[_0xa7ce('0x3f')](_0x69435a['query']['fields']));_0x593a00[_0xa7ce('0x3e')]=_0x593a00[_0xa7ce('0x3e')][_0xa7ce('0x5f')]?_0x593a00['attributes']:_0x3daea3[_0xa7ce('0x40')];if(!_0x69435a['query'][_0xa7ce('0x41')](_0xa7ce('0x42'))){_0x593a00['limit']=qs['limit'](_0x69435a[_0xa7ce('0x3a')]['limit']);_0x593a00[_0xa7ce('0x22')]=qs[_0xa7ce('0x22')](_0x69435a[_0xa7ce('0x3a')]['offset']);}_0x593a00[_0xa7ce('0x43')]=qs[_0xa7ce('0x44')](_0x69435a[_0xa7ce('0x3a')]['sort']);_0x593a00[_0xa7ce('0x46')]=qs['filters'](_[_0xa7ce('0x60')](_0x69435a[_0xa7ce('0x3a')],_0x3daea3['filters']));_0x593a00[_0xa7ce('0x46')][_0xa7ce('0x61')]=_0x3483f9['id'];if(_0x69435a['query'][_0xa7ce('0x45')]){_0x593a00[_0xa7ce('0x46')]=_[_0xa7ce('0x48')](_0x593a00['where'],{'$or':_[_0xa7ce('0x35')](_0x593a00[_0xa7ce('0x3e')],function(_0x2b8967){var _0x434f0b={};_0x434f0b[_0x2b8967]={'$like':'%'+_0x69435a[_0xa7ce('0x3a')][_0xa7ce('0x45')]+'%'};return _0x434f0b;})});}_0x593a00=_[_0xa7ce('0x48')]({},_0x593a00,_0x69435a[_0xa7ce('0x49')]);return db[_0xa7ce('0x5e')]['findAll'](_0x593a00);}})[_0xa7ce('0x2a')](function(_0x5767b6){if(_0x5767b6){return db['User'][_0xa7ce('0x62')]({'where':{'id':_['map'](_0x5767b6,_0xa7ce('0x63')),'role':'agent'},'attributes':['id',_0xa7ce('0x32'),'whatsappPause',_0xa7ce('0x64'),'createdAt']});}})[_0xa7ce('0x2a')](function(_0x1b5fd2){if(_0x1b5fd2){return{'count':_0x1b5fd2[_0xa7ce('0x21')],'rows':_['map'](_0x1b5fd2[_0xa7ce('0x65')],function(_0x56bb15){return{'membername':_0x56bb15[_0xa7ce('0x32')],'UserId':_0x56bb15['id'],'queue_name':_0x5f2964['name'],'WhatsappQueueId':_0x5f2964['id'],'interface':util['format'](_0xa7ce('0x66'),_0xa7ce('0x67'),_0x56bb15[_0xa7ce('0x32')]),'penalty':0x0,'paused':_0x56bb15[_0xa7ce('0x68')],'createdAt':_0x56bb15[_0xa7ce('0x69')],'updatedAt':_0x56bb15['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x29fb1b,_0x593a00))[_0xa7ce('0x4c')](handleError(_0x29fb1b,null));};exports['getTeams']=function(_0x91cd24,_0x2fbcaf,_0x403c26){var _0x1dcf5f={};var _0x4ec4d2={};var _0x405f3a;var _0x57c6ff;return db[_0xa7ce('0x4a')]['findOne']({'where':{'id':_0x91cd24[_0xa7ce('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2fbcaf,null))['then'](function(_0x257650){if(_0x257650){_0x405f3a=_0x257650;_0x4ec4d2[_0xa7ce('0x40')]=_['keys'](db[_0xa7ce('0x6a')]['rawAttributes']);_0x4ec4d2[_0xa7ce('0x3a')]=_[_0xa7ce('0x3b')](_0x91cd24[_0xa7ce('0x3a')]);_0x4ec4d2[_0xa7ce('0x3c')]=_[_0xa7ce('0x3d')](_0x4ec4d2['model'],_0x4ec4d2[_0xa7ce('0x3a')]);_0x1dcf5f['attributes']=_['intersection'](_0x4ec4d2[_0xa7ce('0x40')],qs[_0xa7ce('0x3f')](_0x91cd24[_0xa7ce('0x3a')]['fields']));_0x1dcf5f[_0xa7ce('0x3e')]=_0x1dcf5f['attributes'][_0xa7ce('0x5f')]?_0x1dcf5f[_0xa7ce('0x3e')]:_0x4ec4d2[_0xa7ce('0x40')];_0x1dcf5f[_0xa7ce('0x43')]=qs[_0xa7ce('0x44')](_0x91cd24['query'][_0xa7ce('0x44')]);_0x1dcf5f['where']=qs[_0xa7ce('0x3c')](_[_0xa7ce('0x60')](_0x91cd24[_0xa7ce('0x3a')],_0x4ec4d2[_0xa7ce('0x3c')]));if(_0x91cd24[_0xa7ce('0x3a')][_0xa7ce('0x45')]){_0x1dcf5f[_0xa7ce('0x46')]=_[_0xa7ce('0x48')](_0x1dcf5f[_0xa7ce('0x46')],{'$or':_[_0xa7ce('0x35')](_0x1dcf5f[_0xa7ce('0x3e')],function(_0x2e2010){var _0x583cc0={};_0x583cc0[_0x2e2010]={'$like':'%'+_0x91cd24[_0xa7ce('0x3a')][_0xa7ce('0x45')]+'%'};return _0x583cc0;})});}_0x1dcf5f=_[_0xa7ce('0x48')]({},_0x1dcf5f,_0x91cd24[_0xa7ce('0x49')]);return _0x405f3a[_0xa7ce('0x6b')](_0x1dcf5f);}})[_0xa7ce('0x2a')](function(_0x4ad232){if(_0x4ad232){_0x57c6ff=_0x4ad232[_0xa7ce('0x5f')];if(!_0x91cd24[_0xa7ce('0x3a')][_0xa7ce('0x41')](_0xa7ce('0x42'))){_0x1dcf5f[_0xa7ce('0x23')]=qs['limit'](_0x91cd24['query'][_0xa7ce('0x23')]);_0x1dcf5f[_0xa7ce('0x22')]=qs['offset'](_0x91cd24[_0xa7ce('0x3a')]['offset']);}return _0x405f3a[_0xa7ce('0x6b')](_0x1dcf5f);}})['then'](function(_0x4a2ee5){if(_0x4a2ee5){return _0x4a2ee5?{'count':_0x57c6ff,'rows':_0x4a2ee5}:null;}})[_0xa7ce('0x2a')](respondWithResult(_0x2fbcaf,null))[_0xa7ce('0x4c')](handleError(_0x2fbcaf,null));};exports['addTeams']=function(_0x5d9f22,_0x30d815,_0x38e272){var _0x816450=_0x5d9f22[_0xa7ce('0x51')]['ids'];return db[_0xa7ce('0x6a')]['findAll']({'where':{'id':_0x816450},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa7ce('0x6c'),'attributes':['id',_0xa7ce('0x32'),_0xa7ce('0x6d'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x58ed7d){if(_0x58ed7d){var _0x841c15=_[_0xa7ce('0x6e')](_0x58ed7d,function(_0x4aaef7){var _0x3db232=_0x4aaef7[_0xa7ce('0x2c')]({'plain':!![]});return _0x3db232[_0xa7ce('0x6c')];});return db['WhatsappQueue'][_0xa7ce('0x56')]({'where':{'id':_0x5d9f22[_0xa7ce('0x4e')]['id']}})[_0xa7ce('0x2a')](function(_0x20517e){return db['sequelize'][_0xa7ce('0x6f')](function(_0x1190a1){return _0x20517e[_0xa7ce('0x70')](_0x816450,{'transaction':_0x1190a1})[_0xa7ce('0x2a')](function(){return BPromise[_0xa7ce('0x71')](_0x841c15,function(_0x4815b6){return db[_0xa7ce('0x5e')][_0xa7ce('0x72')]({'where':{'UserId':_0x4815b6['id'],'WhatsappQueueId':_0x5d9f22[_0xa7ce('0x4e')]['id']},'transaction':_0x1190a1});});})[_0xa7ce('0x2a')](function(){_0x841c15[_0xa7ce('0x73')](function(_0x8ca5f9){socket[_0xa7ce('0x74')](_0xa7ce('0x75'),{'UserId':_0x8ca5f9['id'],'WhatsappQueueId':_0x20517e['id']});});});});});}})[_0xa7ce('0x2a')](respondWithStatusCode(_0x30d815,null))[_0xa7ce('0x4c')](handleError(_0x30d815,null));};exports[_0xa7ce('0x76')]=function(_0x382d39,_0x2b6e20,_0x30b12b){return db[_0xa7ce('0x6a')]['findAll']({'where':{'id':_0x382d39[_0xa7ce('0x3a')][_0xa7ce('0x77')]},'attributes':['id'],'include':[{'model':db[_0xa7ce('0x78')],'as':_0xa7ce('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xa7ce('0x2a')](handleEntityNotFound(_0x2b6e20,null))[_0xa7ce('0x2a')](function(_0x11cfb5){var _0xecc803=_['map'](_0x11cfb5,'id');var _0x5c5ac2=[];var _0x4a9810=[];var _0x4e52e9=squel[_0xa7ce('0x79')]();_0x4e52e9[_0xa7ce('0x7a')](_0xa7ce('0x7b'))[_0xa7ce('0x7c')](_0xa7ce('0x7d'),'tq')[_0xa7ce('0x7e')](_0xa7ce('0x7f'),'ut',_0xa7ce('0x80'))['where']('WhatsappQueueId\x20=\x20?',_0x382d39['params']['id']);for(var _0xc7c650=0x0;_0xc7c650<_0x11cfb5['length'];_0xc7c650+=0x1){let _0x28686e=_0x11cfb5[_0xc7c650];for(var _0x2b378b=0x0;_0x2b378b<_0x28686e[_0xa7ce('0x6c')]['length'];_0x2b378b+=0x1){let _0x13ab9e=_0x28686e[_0xa7ce('0x6c')][_0x2b378b];var _0x27858c=_0x4e52e9[_0xa7ce('0x81')]();_0x27858c['where'](_0xa7ce('0x82'),_0x13ab9e['id']);_0x4a9810[_0xa7ce('0x83')](db[_0xa7ce('0x84')][_0xa7ce('0x3a')](_0x27858c[_0xa7ce('0x85')](),{'type':db[_0xa7ce('0x84')]['QueryTypes'][_0xa7ce('0x86')]})['then'](function(_0x10e851){if(_0x10e851['length']===0x1){return _0x13ab9e['id'];}else{var _0x402711=_[_0xa7ce('0x87')](_['map'](_0x10e851,'TeamId'),function(_0x540d4f){return _['includes'](_0xecc803,_0x540d4f);});if(_0x402711){return _0x13ab9e['id'];}}}));}}return BPromise[_0xa7ce('0x88')](_0x4a9810)['then'](function(_0x1228d3){_0x5c5ac2=_(_0x5c5ac2)['union'](_0x1228d3)['compact']()[_0xa7ce('0x89')]();return db['WhatsappQueue']['find']({'where':{'id':_0x382d39[_0xa7ce('0x4e')]['id']}})[_0xa7ce('0x2a')](function(_0x388c86){return db[_0xa7ce('0x84')][_0xa7ce('0x6f')](function(_0x2b683f){return _0x388c86[_0xa7ce('0x76')](_0x382d39[_0xa7ce('0x3a')]['ids'],{'transaction':_0x2b683f})[_0xa7ce('0x2a')](function(){if(!_['isEmpty'](_0x5c5ac2)){return _0x388c86[_0xa7ce('0x8a')](_0x5c5ac2,{'transaction':_0x2b683f});}})[_0xa7ce('0x2a')](function(){_0x5c5ac2[_0xa7ce('0x73')](function(_0x80e589){socket[_0xa7ce('0x74')](_0xa7ce('0x8b'),{'UserId':_0x80e589,'WhatsappQueueId':_0x388c86['id']});});});});});});})[_0xa7ce('0x2a')](respondWithStatusCode(_0x2b6e20,null))[_0xa7ce('0x4c')](handleError(_0x2b6e20,null));};exports[_0xa7ce('0x8c')]=function(_0x2d4b97,_0x452119,_0x533588){return db[_0xa7ce('0x4a')]['find']({'where':{'id':_0x2d4b97[_0xa7ce('0x4e')]['id']}})['then'](handleEntityNotFound(_0x452119,null))[_0xa7ce('0x2a')](function(_0x37c6b6){if(_0x37c6b6){return _0x37c6b6[_0xa7ce('0x8c')](_0x2d4b97[_0xa7ce('0x51')][_0xa7ce('0x77')],_[_0xa7ce('0x8d')](_0x2d4b97[_0xa7ce('0x51')],[_0xa7ce('0x77'),'id'])||{})['spread'](function(_0x539c3a){for(var _0x5d8123=0x0;_0x5d8123<_0x2d4b97['body'][_0xa7ce('0x77')]['length'];_0x5d8123+=0x1){socket[_0xa7ce('0x74')](_0xa7ce('0x75'),{'UserId':Number(_0x2d4b97[_0xa7ce('0x51')][_0xa7ce('0x77')][_0x5d8123]),'WhatsappQueueId':Number(_0x2d4b97[_0xa7ce('0x4e')]['id'])});}return _0x539c3a;});}})['then'](respondWithResult(_0x452119,null))[_0xa7ce('0x4c')](handleError(_0x452119,null));};exports[_0xa7ce('0x8a')]=function(_0x4dd84e,_0x50f058,_0x22a59f){return db[_0xa7ce('0x4a')][_0xa7ce('0x56')]({'where':{'id':_0x4dd84e['params']['id']}})[_0xa7ce('0x2a')](handleEntityNotFound(_0x50f058,null))['then'](function(_0x2693b3){if(_0x2693b3){return _0x2693b3[_0xa7ce('0x8a')](_0x4dd84e[_0xa7ce('0x3a')][_0xa7ce('0x77')])[_0xa7ce('0x2a')](function(){if(_[_0xa7ce('0x8e')](_0x4dd84e[_0xa7ce('0x3a')][_0xa7ce('0x77')])){for(var _0x2de11a=0x0;_0x2de11a<_0x4dd84e['query'][_0xa7ce('0x77')]['length'];_0x2de11a+=0x1){socket[_0xa7ce('0x74')](_0xa7ce('0x8b'),{'UserId':Number(_0x4dd84e[_0xa7ce('0x3a')][_0xa7ce('0x77')][_0x2de11a]),'WhatsappQueueId':Number(_0x4dd84e[_0xa7ce('0x4e')]['id'])});}}else{socket['emit'](_0xa7ce('0x8b'),{'UserId':Number(_0x4dd84e[_0xa7ce('0x3a')]['ids']),'WhatsappQueueId':Number(_0x4dd84e[_0xa7ce('0x4e')]['id'])});}});}})[_0xa7ce('0x2a')](respondWithStatusCode(_0x50f058,null))[_0xa7ce('0x4c')](handleError(_0x50f058,null));};exports[_0xa7ce('0x8f')]=function(_0x32a600,_0x4f7e74,_0x1e5db5){var _0x45ded9={};var _0x3f4d7b={};var _0x27dddb;var _0x413679;return db[_0xa7ce('0x4a')][_0xa7ce('0x5d')]({'where':{'id':_0x32a600['params']['id']}})[_0xa7ce('0x2a')](handleEntityNotFound(_0x4f7e74,null))[_0xa7ce('0x2a')](function(_0x36e5b1){if(_0x36e5b1){_0x27dddb=_0x36e5b1;_0x3f4d7b[_0xa7ce('0x40')]=_[_0xa7ce('0x3b')](db[_0xa7ce('0x78')][_0xa7ce('0x36')]);_0x3f4d7b['query']=_[_0xa7ce('0x3b')](_0x32a600[_0xa7ce('0x3a')]);_0x3f4d7b[_0xa7ce('0x3c')]=_[_0xa7ce('0x3d')](_0x3f4d7b[_0xa7ce('0x40')],_0x3f4d7b[_0xa7ce('0x3a')]);_0x45ded9[_0xa7ce('0x3e')]=_[_0xa7ce('0x3d')](_0x3f4d7b[_0xa7ce('0x40')],qs[_0xa7ce('0x3f')](_0x32a600[_0xa7ce('0x3a')]['fields']));_0x45ded9[_0xa7ce('0x3e')]=_0x45ded9[_0xa7ce('0x3e')][_0xa7ce('0x5f')]?_0x45ded9['attributes']:_0x3f4d7b['model'];_0x45ded9[_0xa7ce('0x43')]=qs['sort'](_0x32a600[_0xa7ce('0x3a')][_0xa7ce('0x44')]);_0x45ded9[_0xa7ce('0x46')]=qs[_0xa7ce('0x3c')](_[_0xa7ce('0x60')](_0x32a600[_0xa7ce('0x3a')],_0x3f4d7b[_0xa7ce('0x3c')]));if(_0x32a600[_0xa7ce('0x3a')][_0xa7ce('0x45')]){_0x45ded9['where']=_[_0xa7ce('0x48')](_0x45ded9[_0xa7ce('0x46')],{'$or':_['map'](_0x45ded9[_0xa7ce('0x3e')],function(_0x496d07){var _0x1d7449={};_0x1d7449[_0x496d07]={'$like':'%'+_0x32a600[_0xa7ce('0x3a')][_0xa7ce('0x45')]+'%'};return _0x1d7449;})});}_0x45ded9=_['merge']({},_0x45ded9,_0x32a600[_0xa7ce('0x49')]);return _0x27dddb[_0xa7ce('0x8f')](_0x45ded9);}})[_0xa7ce('0x2a')](function(_0x2ffbe2){if(_0x2ffbe2){_0x413679=_0x2ffbe2[_0xa7ce('0x5f')];if(!_0x32a600[_0xa7ce('0x3a')][_0xa7ce('0x41')]('nolimit')){_0x45ded9[_0xa7ce('0x23')]=qs['limit'](_0x32a600[_0xa7ce('0x3a')][_0xa7ce('0x23')]);_0x45ded9[_0xa7ce('0x22')]=qs[_0xa7ce('0x22')](_0x32a600[_0xa7ce('0x3a')][_0xa7ce('0x22')]);}return _0x27dddb[_0xa7ce('0x8f')](_0x45ded9);}})[_0xa7ce('0x2a')](function(_0x3ff65c){if(_0x3ff65c){return _0x3ff65c?{'count':_0x413679,'rows':_0x3ff65c}:null;}})['then'](respondWithResult(_0x4f7e74,null))[_0xa7ce('0x4c')](handleError(_0x4f7e74,null));};
\ No newline at end of file
+var _0x0381=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','WhatsappQueues','error','stack','name','send','WhatsappQueue','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','agent','createdAt','format','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','interface','flatMap','transaction','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','emit','userWhatsappQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel'];(function(_0xfad07e,_0x3f1361){var _0x4aa9f2=function(_0x5e7ece){while(--_0x5e7ece){_0xfad07e['push'](_0xfad07e['shift']());}};_0x4aa9f2(++_0x3f1361);}(_0x0381,0x1a4));var _0x1038=function(_0x56139c,_0x28b962){_0x56139c=_0x56139c-0x0;var _0x40b9d5=_0x0381[_0x56139c];return _0x40b9d5;};'use strict';var emlformat=require(_0x1038('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1038('0x1'));var jsonpatch=require(_0x1038('0x2'));var rp=require(_0x1038('0x3'));var moment=require(_0x1038('0x4'));var BPromise=require(_0x1038('0x5'));var Mustache=require(_0x1038('0x6'));var util=require(_0x1038('0x7'));var path=require(_0x1038('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1038('0x9'));var fs=require('fs');var fs_extra=require(_0x1038('0xa'));var _=require('lodash');var squel=require(_0x1038('0xb'));var crypto=require('crypto');var jsforce=require(_0x1038('0xc'));var deskjs=require(_0x1038('0xd'));var toCsv=require(_0x1038('0xe'));var querystring=require(_0x1038('0xf'));var Papa=require(_0x1038('0x10'));var Redis=require(_0x1038('0x11'));var authService=require(_0x1038('0x12'));var qs=require(_0x1038('0x13'));var as=require(_0x1038('0x14'));var hardwareService=require(_0x1038('0x15'));var logger=require(_0x1038('0x16'))(_0x1038('0x17'));var utils=require(_0x1038('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1038('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1038('0x1a')](config[_0x1038('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1038('0x1c'))(new Redis(config[_0x1038('0x1b')]));require(_0x1038('0x1d'))[_0x1038('0x1e')](socket);function respondWithStatusCode(_0x5b3825,_0x90792f){_0x90792f=_0x90792f||0xcc;return function(_0x2867bd){if(_0x2867bd){return _0x5b3825[_0x1038('0x1f')](_0x90792f);}return _0x5b3825[_0x1038('0x20')](_0x90792f)[_0x1038('0x21')]();};}function respondWithResult(_0x705bc0,_0x38bea8){_0x38bea8=_0x38bea8||0xc8;return function(_0x42f03d){if(_0x42f03d){return _0x705bc0[_0x1038('0x20')](_0x38bea8)[_0x1038('0x22')](_0x42f03d);}};}function respondWithFilteredResult(_0x5a5d5b,_0x54b50f){return function(_0x3eda56){if(_0x3eda56){var _0x4b8f76=typeof _0x54b50f[_0x1038('0x23')]===_0x1038('0x24')&&typeof _0x54b50f[_0x1038('0x25')]==='undefined';var _0x452bec=_0x3eda56[_0x1038('0x26')];var _0x54ad35=_0x4b8f76?0x0:_0x54b50f[_0x1038('0x23')];var _0x4e58a1=_0x4b8f76?_0x3eda56[_0x1038('0x26')]:_0x54b50f[_0x1038('0x23')]+_0x54b50f['limit'];var _0x310cb4;if(_0x4e58a1>=_0x452bec){_0x4e58a1=_0x452bec;_0x310cb4=0xc8;}else{_0x310cb4=0xce;}_0x5a5d5b[_0x1038('0x20')](_0x310cb4);return _0x5a5d5b[_0x1038('0x27')](_0x1038('0x28'),_0x54ad35+'-'+_0x4e58a1+'/'+_0x452bec)['json'](_0x3eda56);}return null;};}function patchUpdates(_0x3c5b1e){return function(_0xe93bd){try{jsonpatch[_0x1038('0x29')](_0xe93bd,_0x3c5b1e,!![]);}catch(_0x150170){return BPromise['reject'](_0x150170);}return _0xe93bd[_0x1038('0x2a')]();};}function saveUpdates(_0x3e0d69,_0x166981){return function(_0x4ee640){if(_0x4ee640){return _0x4ee640[_0x1038('0x2b')](_0x3e0d69)[_0x1038('0x2c')](function(_0x48feec){return _0x48feec;});}return null;};}function removeEntity(_0x312dcc,_0x5ae7ba){return function(_0x581b8d){if(_0x581b8d){return _0x581b8d[_0x1038('0x2d')]()[_0x1038('0x2c')](function(){var _0x5843e5=_0x581b8d[_0x1038('0x2e')]({'plain':!![]});var _0x5b2dfb=_0x1038('0x2f');return db['UserProfileResource'][_0x1038('0x2d')]({'where':{'type':_0x5b2dfb,'resourceId':_0x5843e5['id']}})[_0x1038('0x2c')](function(){return _0x581b8d;});})[_0x1038('0x2c')](function(){_0x312dcc[_0x1038('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a84e6,_0x403a2c){return function(_0x5c0f6f){if(!_0x5c0f6f){_0x1a84e6[_0x1038('0x1f')](0x194);}return _0x5c0f6f;};}function handleError(_0x44a151,_0x1e38d1){_0x1e38d1=_0x1e38d1||0x1f4;return function(_0x3c7800){logger[_0x1038('0x30')](_0x3c7800[_0x1038('0x31')]);if(_0x3c7800[_0x1038('0x32')]){delete _0x3c7800['name'];}_0x44a151[_0x1038('0x20')](_0x1e38d1)[_0x1038('0x33')](_0x3c7800);};}exports['index']=function(_0x28085b,_0x306b50){var _0x331d1a={},_0x57bbf3={},_0x3ca9a4={'count':0x0,'rows':[]};var _0x3f223c=_['map'](db[_0x1038('0x34')][_0x1038('0x35')],function(_0x29f184){return{'name':_0x29f184[_0x1038('0x36')],'type':_0x29f184[_0x1038('0x37')]['key']};});_0x57bbf3[_0x1038('0x38')]=_[_0x1038('0x39')](_0x3f223c,_0x1038('0x32'));_0x57bbf3[_0x1038('0x3a')]=_[_0x1038('0x3b')](_0x28085b['query']);_0x57bbf3[_0x1038('0x3c')]=_[_0x1038('0x3d')](_0x57bbf3[_0x1038('0x38')],_0x57bbf3['query']);_0x331d1a[_0x1038('0x3e')]=_[_0x1038('0x3d')](_0x57bbf3['model'],qs['fields'](_0x28085b[_0x1038('0x3a')][_0x1038('0x3f')]));_0x331d1a[_0x1038('0x3e')]=_0x331d1a['attributes'][_0x1038('0x40')]?_0x331d1a[_0x1038('0x3e')]:_0x57bbf3['model'];if(!_0x28085b['query'][_0x1038('0x41')](_0x1038('0x42'))){_0x331d1a[_0x1038('0x25')]=qs[_0x1038('0x25')](_0x28085b['query'][_0x1038('0x25')]);_0x331d1a['offset']=qs[_0x1038('0x23')](_0x28085b[_0x1038('0x3a')][_0x1038('0x23')]);}_0x331d1a[_0x1038('0x43')]=qs[_0x1038('0x44')](_0x28085b[_0x1038('0x3a')]['sort']);_0x331d1a[_0x1038('0x45')]=qs[_0x1038('0x3c')](_[_0x1038('0x46')](_0x28085b['query'],_0x57bbf3[_0x1038('0x3c')]),_0x3f223c);if(_0x28085b['query'][_0x1038('0x47')]){_0x331d1a[_0x1038('0x45')]=_[_0x1038('0x48')](_0x331d1a[_0x1038('0x45')],{'$or':_[_0x1038('0x39')](_0x3f223c,function(_0x3214a5){if(_0x3214a5[_0x1038('0x37')]!==_0x1038('0x49')){var _0x22ee31={};_0x22ee31[_0x3214a5['name']]={'$like':'%'+_0x28085b['query']['filter']+'%'};return _0x22ee31;}})});}_0x331d1a=_[_0x1038('0x48')]({},_0x331d1a,_0x28085b[_0x1038('0x4a')]);var _0x2c2401={'where':_0x331d1a[_0x1038('0x45')]};return db['WhatsappQueue'][_0x1038('0x26')](_0x2c2401)['then'](function(_0x70784d){_0x3ca9a4[_0x1038('0x26')]=_0x70784d;if(_0x28085b[_0x1038('0x3a')][_0x1038('0x4b')]){_0x331d1a['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x1038('0x4c')](_0x331d1a);})[_0x1038('0x2c')](function(_0x31f530){_0x3ca9a4[_0x1038('0x4d')]=_0x31f530;return _0x3ca9a4;})['then'](respondWithFilteredResult(_0x306b50,_0x331d1a))[_0x1038('0x4e')](handleError(_0x306b50,null));};exports[_0x1038('0x4f')]=function(_0xd0ec12,_0x1950b4){var _0x43607a={'raw':!![],'where':{'id':_0xd0ec12['params']['id']}},_0x20e8c7={};_0x20e8c7[_0x1038('0x38')]=_[_0x1038('0x3b')](db[_0x1038('0x34')][_0x1038('0x35')]);_0x20e8c7[_0x1038('0x3a')]=_[_0x1038('0x3b')](_0xd0ec12[_0x1038('0x3a')]);_0x20e8c7[_0x1038('0x3c')]=_[_0x1038('0x3d')](_0x20e8c7[_0x1038('0x38')],_0x20e8c7['query']);_0x43607a[_0x1038('0x3e')]=_[_0x1038('0x3d')](_0x20e8c7[_0x1038('0x38')],qs['fields'](_0xd0ec12[_0x1038('0x3a')]['fields']));_0x43607a[_0x1038('0x3e')]=_0x43607a['attributes'][_0x1038('0x40')]?_0x43607a['attributes']:_0x20e8c7[_0x1038('0x38')];if(_0xd0ec12[_0x1038('0x3a')][_0x1038('0x4b')]){_0x43607a[_0x1038('0x50')]=[{'all':!![]}];}_0x43607a=_[_0x1038('0x48')]({},_0x43607a,_0xd0ec12[_0x1038('0x4a')]);return db[_0x1038('0x34')][_0x1038('0x51')](_0x43607a)[_0x1038('0x2c')](handleEntityNotFound(_0x1950b4,null))[_0x1038('0x2c')](respondWithResult(_0x1950b4,null))[_0x1038('0x4e')](handleError(_0x1950b4,null));};exports[_0x1038('0x52')]=function(_0x5566c1,_0x4d256){return db[_0x1038('0x34')][_0x1038('0x52')](_0x5566c1[_0x1038('0x53')],{})[_0x1038('0x2c')](function(_0x3880f4){var _0x3ba20b=_0x5566c1[_0x1038('0x54')][_0x1038('0x2e')]({'plain':!![]});if(!_0x3ba20b)throw new Error(_0x1038('0x55'));if(_0x3ba20b[_0x1038('0x56')]===_0x1038('0x54')){var _0x36039d=_0x3880f4['get']({'plain':!![]});var _0x21753c=_0x1038('0x2f');return db[_0x1038('0x57')][_0x1038('0x51')]({'where':{'name':_0x21753c,'userProfileId':_0x3ba20b[_0x1038('0x58')]},'raw':!![]})['then'](function(_0x80d5b7){if(_0x80d5b7&&_0x80d5b7['autoAssociation']===0x0){return db[_0x1038('0x59')][_0x1038('0x52')]({'name':_0x36039d['name'],'resourceId':_0x36039d['id'],'type':_0x80d5b7[_0x1038('0x32')],'sectionId':_0x80d5b7['id']},{})[_0x1038('0x2c')](function(){return _0x3880f4;});}else{return _0x3880f4;}})[_0x1038('0x4e')](function(_0x2563f0){logger[_0x1038('0x30')](_0x1038('0x5a'),_0x2563f0);throw _0x2563f0;});}return _0x3880f4;})[_0x1038('0x2c')](respondWithResult(_0x4d256,0xc9))[_0x1038('0x4e')](handleError(_0x4d256,null));};exports[_0x1038('0x2b')]=function(_0x257a88,_0x2b0fe9){if(_0x257a88['body']['id']){delete _0x257a88['body']['id'];}return db[_0x1038('0x34')][_0x1038('0x51')]({'where':{'id':_0x257a88[_0x1038('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2b0fe9,null))[_0x1038('0x2c')](saveUpdates(_0x257a88[_0x1038('0x53')],null))[_0x1038('0x2c')](respondWithResult(_0x2b0fe9,null))['catch'](handleError(_0x2b0fe9,null));};exports['destroy']=function(_0x555e16,_0x34dc92){return db['WhatsappQueue']['find']({'where':{'id':_0x555e16[_0x1038('0x5b')]['id']}})['then'](handleEntityNotFound(_0x34dc92,null))[_0x1038('0x2c')](removeEntity(_0x34dc92,null))[_0x1038('0x4e')](handleError(_0x34dc92,null));};exports[_0x1038('0x5c')]=function(_0x116c02,_0x4727cc){return db[_0x1038('0x34')]['describe']()[_0x1038('0x2c')](respondWithResult(_0x4727cc,null))[_0x1038('0x4e')](handleError(_0x4727cc,null));};exports[_0x1038('0x5d')]=function(_0x503550,_0x512eaf,_0x3d0d9f){var _0x28ff3c={'raw':!![],'where':{}},_0x2981d5={},_0x4b0e3f;return db['WhatsappQueue']['findOne']({'where':{'id':_0x503550['params']['id']}})['then'](handleEntityNotFound(_0x512eaf,null))['then'](function(_0x45c84b){if(_0x45c84b){_0x4b0e3f=_0x45c84b['get']({'plain':!![]});_0x2981d5[_0x1038('0x38')]=_[_0x1038('0x3b')](db['UserWhatsappQueue'][_0x1038('0x35')]);_0x2981d5[_0x1038('0x3a')]=_[_0x1038('0x3b')](_0x503550[_0x1038('0x3a')]);_0x2981d5[_0x1038('0x3c')]=_[_0x1038('0x3d')](_0x2981d5[_0x1038('0x38')],_0x2981d5[_0x1038('0x3a')]);_0x28ff3c[_0x1038('0x3e')]=_[_0x1038('0x3d')](_0x2981d5['model'],qs[_0x1038('0x3f')](_0x503550[_0x1038('0x3a')][_0x1038('0x3f')]));_0x28ff3c['attributes']=_0x28ff3c['attributes'][_0x1038('0x40')]?_0x28ff3c['attributes']:_0x2981d5['model'];if(!_0x503550[_0x1038('0x3a')]['hasOwnProperty']('nolimit')){_0x28ff3c[_0x1038('0x25')]=qs[_0x1038('0x25')](_0x503550[_0x1038('0x3a')][_0x1038('0x25')]);_0x28ff3c['offset']=qs[_0x1038('0x23')](_0x503550[_0x1038('0x3a')][_0x1038('0x23')]);}_0x28ff3c[_0x1038('0x43')]=qs[_0x1038('0x44')](_0x503550[_0x1038('0x3a')][_0x1038('0x44')]);_0x28ff3c['where']=qs['filters'](_[_0x1038('0x46')](_0x503550[_0x1038('0x3a')],_0x2981d5[_0x1038('0x3c')]));_0x28ff3c[_0x1038('0x45')][_0x1038('0x5e')]=_0x45c84b['id'];if(_0x503550[_0x1038('0x3a')][_0x1038('0x47')]){_0x28ff3c[_0x1038('0x45')]=_[_0x1038('0x48')](_0x28ff3c['where'],{'$or':_['map'](_0x28ff3c[_0x1038('0x3e')],function(_0x3d389b){var _0x522618={};_0x522618[_0x3d389b]={'$like':'%'+_0x503550['query']['filter']+'%'};return _0x522618;})});}_0x28ff3c=_[_0x1038('0x48')]({},_0x28ff3c,_0x503550[_0x1038('0x4a')]);return db[_0x1038('0x5f')][_0x1038('0x4c')](_0x28ff3c);}})[_0x1038('0x2c')](function(_0x44b715){if(_0x44b715){return db[_0x1038('0x60')][_0x1038('0x61')]({'where':{'id':_[_0x1038('0x39')](_0x44b715,_0x1038('0x62')),'role':_0x1038('0x63')},'attributes':['id',_0x1038('0x32'),'whatsappPause','updatedAt',_0x1038('0x64')]});}})[_0x1038('0x2c')](function(_0x150e53){if(_0x150e53){return{'count':_0x150e53[_0x1038('0x26')],'rows':_['map'](_0x150e53[_0x1038('0x4d')],function(_0x7ff330){return{'membername':_0x7ff330['name'],'UserId':_0x7ff330['id'],'queue_name':_0x4b0e3f['name'],'WhatsappQueueId':_0x4b0e3f['id'],'interface':util[_0x1038('0x65')]('%s/%s',_0x1038('0x66'),_0x7ff330[_0x1038('0x32')]),'penalty':0x0,'paused':_0x7ff330['whatsappPause'],'createdAt':_0x7ff330['createdAt'],'updatedAt':_0x7ff330[_0x1038('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1038('0x2c')](respondWithFilteredResult(_0x512eaf,_0x28ff3c))[_0x1038('0x4e')](handleError(_0x512eaf,null));};exports[_0x1038('0x68')]=function(_0x4d02e8,_0x4c50ed,_0x1b1801){var _0x406675={};var _0x33c891={};var _0x12333e;var _0x576a70;return db[_0x1038('0x34')][_0x1038('0x69')]({'where':{'id':_0x4d02e8[_0x1038('0x5b')]['id']}})[_0x1038('0x2c')](handleEntityNotFound(_0x4c50ed,null))[_0x1038('0x2c')](function(_0x4ca70e){if(_0x4ca70e){_0x12333e=_0x4ca70e;_0x33c891[_0x1038('0x38')]=_[_0x1038('0x3b')](db[_0x1038('0x6a')][_0x1038('0x35')]);_0x33c891[_0x1038('0x3a')]=_[_0x1038('0x3b')](_0x4d02e8[_0x1038('0x3a')]);_0x33c891['filters']=_[_0x1038('0x3d')](_0x33c891['model'],_0x33c891[_0x1038('0x3a')]);_0x406675[_0x1038('0x3e')]=_[_0x1038('0x3d')](_0x33c891['model'],qs[_0x1038('0x3f')](_0x4d02e8['query'][_0x1038('0x3f')]));_0x406675[_0x1038('0x3e')]=_0x406675[_0x1038('0x3e')][_0x1038('0x40')]?_0x406675[_0x1038('0x3e')]:_0x33c891[_0x1038('0x38')];_0x406675[_0x1038('0x43')]=qs[_0x1038('0x44')](_0x4d02e8[_0x1038('0x3a')]['sort']);_0x406675[_0x1038('0x45')]=qs[_0x1038('0x3c')](_[_0x1038('0x46')](_0x4d02e8['query'],_0x33c891[_0x1038('0x3c')]));if(_0x4d02e8['query']['filter']){_0x406675[_0x1038('0x45')]=_[_0x1038('0x48')](_0x406675[_0x1038('0x45')],{'$or':_['map'](_0x406675[_0x1038('0x3e')],function(_0x366ba3){var _0x58420b={};_0x58420b[_0x366ba3]={'$like':'%'+_0x4d02e8[_0x1038('0x3a')][_0x1038('0x47')]+'%'};return _0x58420b;})});}_0x406675=_[_0x1038('0x48')]({},_0x406675,_0x4d02e8[_0x1038('0x4a')]);return _0x12333e[_0x1038('0x68')](_0x406675);}})[_0x1038('0x2c')](function(_0x3cc632){if(_0x3cc632){_0x576a70=_0x3cc632[_0x1038('0x40')];if(!_0x4d02e8[_0x1038('0x3a')][_0x1038('0x41')]('nolimit')){_0x406675['limit']=qs[_0x1038('0x25')](_0x4d02e8['query']['limit']);_0x406675[_0x1038('0x23')]=qs[_0x1038('0x23')](_0x4d02e8[_0x1038('0x3a')][_0x1038('0x23')]);}return _0x12333e[_0x1038('0x68')](_0x406675);}})['then'](function(_0x3165a4){if(_0x3165a4){return _0x3165a4?{'count':_0x576a70,'rows':_0x3165a4}:null;}})[_0x1038('0x2c')](respondWithResult(_0x4c50ed,null))[_0x1038('0x4e')](handleError(_0x4c50ed,null));};exports[_0x1038('0x6b')]=function(_0x4ba8f8,_0x452c68,_0x32b616){var _0x2d861f=_0x4ba8f8[_0x1038('0x53')][_0x1038('0x6c')];return db['Team'][_0x1038('0x4c')]({'where':{'id':_0x2d861f},'attributes':['id'],'include':[{'model':db[_0x1038('0x60')],'as':_0x1038('0x6d'),'attributes':['id',_0x1038('0x32'),'online','voicePause',_0x1038('0x6e')],'raw':!![]}]})[_0x1038('0x2c')](function(_0x3c08cc){if(_0x3c08cc){var _0x49aa5b=_[_0x1038('0x6f')](_0x3c08cc,function(_0x3b3581){var _0x425934=_0x3b3581[_0x1038('0x2e')]({'plain':!![]});return _0x425934[_0x1038('0x6d')];});return db[_0x1038('0x34')][_0x1038('0x51')]({'where':{'id':_0x4ba8f8[_0x1038('0x5b')]['id']}})[_0x1038('0x2c')](function(_0x477633){return db['sequelize'][_0x1038('0x70')](function(_0x2788fa){return _0x477633['addTeams'](_0x2d861f,{'transaction':_0x2788fa})[_0x1038('0x2c')](function(){return BPromise['each'](_0x49aa5b,function(_0x4688de){return db[_0x1038('0x5f')][_0x1038('0x71')]({'where':{'UserId':_0x4688de['id'],'WhatsappQueueId':_0x4ba8f8[_0x1038('0x5b')]['id']},'transaction':_0x2788fa});});})['then'](function(){_0x49aa5b[_0x1038('0x72')](function(_0x3d1a82){socket['emit'](_0x1038('0x73'),{'UserId':_0x3d1a82['id'],'WhatsappQueueId':_0x477633['id']});});});});});}})['then'](respondWithStatusCode(_0x452c68,null))[_0x1038('0x4e')](handleError(_0x452c68,null));};exports[_0x1038('0x74')]=function(_0x652cd1,_0x12a2ed,_0x412d34){return db['Team'][_0x1038('0x4c')]({'where':{'id':_0x652cd1[_0x1038('0x3a')][_0x1038('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x1038('0x60')],'as':_0x1038('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x1038('0x2c')](handleEntityNotFound(_0x12a2ed,null))['then'](function(_0x1ef6bc){var _0x582673=_[_0x1038('0x39')](_0x1ef6bc,'id');var _0x40ed11=[];var _0x242ab5=[];var _0x195de7=squel['select']();_0x195de7[_0x1038('0x75')](_0x1038('0x76'))[_0x1038('0x77')]('team_has_whatsapp_queues','tq')[_0x1038('0x78')](_0x1038('0x79'),'ut',_0x1038('0x7a'))[_0x1038('0x45')](_0x1038('0x7b'),_0x652cd1[_0x1038('0x5b')]['id']);for(var _0x2eeebc=0x0;_0x2eeebc<_0x1ef6bc[_0x1038('0x40')];_0x2eeebc+=0x1){let _0x241bcb=_0x1ef6bc[_0x2eeebc];for(var _0x2df5a6=0x0;_0x2df5a6<_0x241bcb[_0x1038('0x6d')][_0x1038('0x40')];_0x2df5a6+=0x1){let _0x11f13a=_0x241bcb[_0x1038('0x6d')][_0x2df5a6];var _0x272f70=_0x195de7['clone']();_0x272f70[_0x1038('0x45')](_0x1038('0x7c'),_0x11f13a['id']);_0x242ab5[_0x1038('0x7d')](db['sequelize']['query'](_0x272f70[_0x1038('0x7e')](),{'type':db[_0x1038('0x7f')]['QueryTypes'][_0x1038('0x80')]})['then'](function(_0x4d3b46){if(_0x4d3b46['length']===0x1){return _0x11f13a['id'];}else{var _0x12db47=_['every'](_[_0x1038('0x39')](_0x4d3b46,_0x1038('0x81')),function(_0x3c4fcf){return _[_0x1038('0x82')](_0x582673,_0x3c4fcf);});if(_0x12db47){return _0x11f13a['id'];}}}));}}return BPromise[_0x1038('0x83')](_0x242ab5)[_0x1038('0x2c')](function(_0x225a37){_0x40ed11=_(_0x40ed11)[_0x1038('0x84')](_0x225a37)[_0x1038('0x85')]()[_0x1038('0x86')]();return db[_0x1038('0x34')][_0x1038('0x51')]({'where':{'id':_0x652cd1['params']['id']}})['then'](function(_0x16dc44){return db[_0x1038('0x7f')]['transaction'](function(_0x35ee01){return _0x16dc44['removeTeams'](_0x652cd1['query'][_0x1038('0x6c')],{'transaction':_0x35ee01})[_0x1038('0x2c')](function(){if(!_[_0x1038('0x87')](_0x40ed11)){return _0x16dc44[_0x1038('0x88')](_0x40ed11,{'transaction':_0x35ee01});}})[_0x1038('0x2c')](function(){_0x40ed11[_0x1038('0x72')](function(_0x86b397){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x86b397,'WhatsappQueueId':_0x16dc44['id']});});});});});});})[_0x1038('0x2c')](respondWithStatusCode(_0x12a2ed,null))[_0x1038('0x4e')](handleError(_0x12a2ed,null));};exports[_0x1038('0x89')]=function(_0x50c1db,_0x34f7f1,_0x5aa360){return db[_0x1038('0x34')][_0x1038('0x51')]({'where':{'id':_0x50c1db['params']['id']}})[_0x1038('0x2c')](handleEntityNotFound(_0x34f7f1,null))['then'](function(_0x540f01){if(_0x540f01){return _0x540f01[_0x1038('0x89')](_0x50c1db['body'][_0x1038('0x6c')],_[_0x1038('0x8a')](_0x50c1db['body'],['ids','id'])||{})[_0x1038('0x8b')](function(_0x17148b){for(var _0x30d912=0x0;_0x30d912<_0x50c1db['body']['ids']['length'];_0x30d912+=0x1){socket['emit'](_0x1038('0x73'),{'UserId':Number(_0x50c1db[_0x1038('0x53')]['ids'][_0x30d912]),'WhatsappQueueId':Number(_0x50c1db[_0x1038('0x5b')]['id'])});}return _0x17148b;});}})[_0x1038('0x2c')](respondWithResult(_0x34f7f1,null))['catch'](handleError(_0x34f7f1,null));};exports[_0x1038('0x88')]=function(_0x42fda0,_0x17aae0,_0x445016){return db[_0x1038('0x34')][_0x1038('0x51')]({'where':{'id':_0x42fda0[_0x1038('0x5b')]['id']}})[_0x1038('0x2c')](handleEntityNotFound(_0x17aae0,null))[_0x1038('0x2c')](function(_0x4003b1){if(_0x4003b1){return _0x4003b1[_0x1038('0x88')](_0x42fda0[_0x1038('0x3a')][_0x1038('0x6c')])[_0x1038('0x2c')](function(){if(_[_0x1038('0x8c')](_0x42fda0['query'][_0x1038('0x6c')])){for(var _0x181778=0x0;_0x181778<_0x42fda0[_0x1038('0x3a')][_0x1038('0x6c')][_0x1038('0x40')];_0x181778+=0x1){socket[_0x1038('0x8d')]('userWhatsappQueue:remove',{'UserId':Number(_0x42fda0[_0x1038('0x3a')]['ids'][_0x181778]),'WhatsappQueueId':Number(_0x42fda0[_0x1038('0x5b')]['id'])});}}else{socket[_0x1038('0x8d')](_0x1038('0x8e'),{'UserId':Number(_0x42fda0[_0x1038('0x3a')][_0x1038('0x6c')]),'WhatsappQueueId':Number(_0x42fda0['params']['id'])});}});}})[_0x1038('0x2c')](respondWithStatusCode(_0x17aae0,null))['catch'](handleError(_0x17aae0,null));};exports[_0x1038('0x8f')]=function(_0x27927f,_0xc4863e,_0x269808){var _0x4bbca3={};var _0x12fb54={};var _0x1a5d6e;var _0x3b5f7e;return db['WhatsappQueue']['findOne']({'where':{'id':_0x27927f[_0x1038('0x5b')]['id']}})['then'](handleEntityNotFound(_0xc4863e,null))[_0x1038('0x2c')](function(_0x109297){if(_0x109297){_0x1a5d6e=_0x109297;_0x12fb54['model']=_['keys'](db['User'][_0x1038('0x35')]);_0x12fb54['query']=_[_0x1038('0x3b')](_0x27927f['query']);_0x12fb54['filters']=_[_0x1038('0x3d')](_0x12fb54['model'],_0x12fb54['query']);_0x4bbca3[_0x1038('0x3e')]=_[_0x1038('0x3d')](_0x12fb54[_0x1038('0x38')],qs[_0x1038('0x3f')](_0x27927f['query']['fields']));_0x4bbca3['attributes']=_0x4bbca3[_0x1038('0x3e')]['length']?_0x4bbca3[_0x1038('0x3e')]:_0x12fb54['model'];_0x4bbca3[_0x1038('0x43')]=qs[_0x1038('0x44')](_0x27927f['query']['sort']);_0x4bbca3[_0x1038('0x45')]=qs[_0x1038('0x3c')](_['pick'](_0x27927f[_0x1038('0x3a')],_0x12fb54[_0x1038('0x3c')]));if(_0x27927f[_0x1038('0x3a')][_0x1038('0x47')]){_0x4bbca3[_0x1038('0x45')]=_['merge'](_0x4bbca3['where'],{'$or':_[_0x1038('0x39')](_0x4bbca3[_0x1038('0x3e')],function(_0x44369a){var _0x3dedd7={};_0x3dedd7[_0x44369a]={'$like':'%'+_0x27927f[_0x1038('0x3a')]['filter']+'%'};return _0x3dedd7;})});}_0x4bbca3=_[_0x1038('0x48')]({},_0x4bbca3,_0x27927f[_0x1038('0x4a')]);return _0x1a5d6e[_0x1038('0x8f')](_0x4bbca3);}})['then'](function(_0x4fff9e){if(_0x4fff9e){_0x3b5f7e=_0x4fff9e['length'];if(!_0x27927f[_0x1038('0x3a')][_0x1038('0x41')](_0x1038('0x42'))){_0x4bbca3['limit']=qs['limit'](_0x27927f['query']['limit']);_0x4bbca3[_0x1038('0x23')]=qs[_0x1038('0x23')](_0x27927f[_0x1038('0x3a')]['offset']);}return _0x1a5d6e['getAgents'](_0x4bbca3);}})[_0x1038('0x2c')](function(_0x333fc6){if(_0x333fc6){return _0x333fc6?{'count':_0x3b5f7e,'rows':_0x333fc6}:null;}})['then'](respondWithResult(_0xc4863e,null))[_0x1038('0x4e')](handleError(_0xc4863e,null));};
\ No newline at end of file
index ca32541..d8c24de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c20=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x16a555,_0x1a7fd5){var _0x50094b=function(_0x23746a){while(--_0x23746a){_0x16a555['push'](_0x16a555['shift']());}};_0x50094b(++_0x1a7fd5);}(_0x3c20,0x198));var _0x03c2=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3c20[_0x311c35];return _0x5cc50c;};'use strict';var EventEmitter=require(_0x03c2('0x0'));var WhatsappQueue=require(_0x03c2('0x1'))['db'][_0x03c2('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x03c2('0x3')](0x0);var events={'afterCreate':_0x03c2('0x4'),'afterUpdate':_0x03c2('0x5'),'afterDestroy':_0x03c2('0x6')};function emitEvent(_0x3bc047){return function(_0x1b3216,_0x5a53a3,_0x5dd4fa){WhatsappQueueEvents['emit'](_0x3bc047+':'+_0x1b3216['id'],_0x1b3216);WhatsappQueueEvents[_0x03c2('0x7')](_0x3bc047,_0x1b3216);_0x5dd4fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x03c2('0x8')](e,emitEvent(event));}}module[_0x03c2('0x9')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x3120=['WhatsappQueue','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0xd5afb3,_0x5d45a1){var _0x18794a=function(_0x5166e8){while(--_0x5166e8){_0xd5afb3['push'](_0xd5afb3['shift']());}};_0x18794a(++_0x5d45a1);}(_0x3120,0xef));var _0x0312=function(_0x22a298,_0x1b82c9){_0x22a298=_0x22a298-0x0;var _0x3d2c1b=_0x3120[_0x22a298];return _0x3d2c1b;};'use strict';var EventEmitter=require(_0x0312('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x0312('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0312('0x2')](0x0);var events={'afterCreate':_0x0312('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1419a1){return function(_0x5b44a7,_0x3d9a1d,_0x46ede3){WhatsappQueueEvents[_0x0312('0x4')](_0x1419a1+':'+_0x5b44a7['id'],_0x5b44a7);WhatsappQueueEvents[_0x0312('0x4')](_0x1419a1,_0x5b44a7);_0x46ede3(null);};}for(var e in events){if(events[_0x0312('0x5')](e)){var event=events[e];WhatsappQueue[_0x0312('0x6')](e,emitEvent(event));}}module[_0x0312('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
index b6eba1b..90ab425 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fc4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','util','../../config/logger'];(function(_0x5688ee,_0x51f2b){var _0x57103f=function(_0x5c3567){while(--_0x5c3567){_0x5688ee['push'](_0x5688ee['shift']());}};_0x57103f(++_0x51f2b);}(_0x9fc4,0x8e));var _0x49fc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9fc4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x49fc('0x0'));var logger=require(_0x49fc('0x1'))(_0x49fc('0x2'));var moment=require(_0x49fc('0x3'));var BPromise=require(_0x49fc('0x4'));var rp=require(_0x49fc('0x5'));var fs=require('fs');var path=require(_0x49fc('0x6'));var rimraf=require(_0x49fc('0x7'));var config=require(_0x49fc('0x8'));var attributes=require(_0x49fc('0x9'));module['exports']=function(_0xe037df,_0x3decd6){return _0xe037df[_0x49fc('0xa')](_0x49fc('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2ae=['../../config/logger','api','request-promise','path','rimraf','define','lodash'];(function(_0x4927aa,_0xb0f141){var _0x155180=function(_0x12ffdc){while(--_0x12ffdc){_0x4927aa['push'](_0x4927aa['shift']());}};_0x155180(++_0xb0f141);}(_0xc2ae,0x102));var _0xec2a=function(_0x316f30,_0x3e7332){_0x316f30=_0x316f30-0x0;var _0xce4aa2=_0xc2ae[_0x316f30];return _0xce4aa2;};'use strict';var _=require(_0xec2a('0x0'));var util=require('util');var logger=require(_0xec2a('0x1'))(_0xec2a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xec2a('0x3'));var fs=require('fs');var path=require(_0xec2a('0x4'));var rimraf=require(_0xec2a('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x37fad6,_0x4a5e57){return _0x37fad6[_0xec2a('0x6')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3f242fa..469eee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bec=['WhatsappQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./whatsappQueue.socket','request','then','info','request\x20sent','debug','stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','catch','GetWhatsappQueue','options','where','attributes','include','model','map','ShowWhatsappQueue'];(function(_0x66ff82,_0xabdb1c){var _0x318053=function(_0x4b43cb){while(--_0x4b43cb){_0x66ff82['push'](_0x66ff82['shift']());}};_0x318053(++_0xabdb1c);}(_0x9bec,0x174));var _0xc9be=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x9bec[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0xc9be('0x0'));var util=require(_0xc9be('0x1'));var moment=require(_0xc9be('0x2'));var BPromise=require(_0xc9be('0x3'));var rs=require(_0xc9be('0x4'));var fs=require('fs');var Redis=require(_0xc9be('0x5'));var db=require(_0xc9be('0x6'))['db'];var utils=require(_0xc9be('0x7'));var logger=require(_0xc9be('0x8'))(_0xc9be('0x9'));var config=require(_0xc9be('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc9be('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc9be('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc9be('0xd'))(new Redis(config[_0xc9be('0xc')]));require(_0xc9be('0xe'))['register'](socket);function respondWithRpcPromise(_0x38450e,_0x121db3,_0x3b3aa6){return new BPromise(function(_0xadba1d,_0x80461f){return client[_0xc9be('0xf')](_0x38450e,_0x3b3aa6)[_0xc9be('0x10')](function(_0x2fc447){logger[_0xc9be('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x121db3,_0xc9be('0x12'));logger[_0xc9be('0x13')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x121db3,_0xc9be('0x12'),JSON[_0xc9be('0x14')](_0x2fc447));if(_0x2fc447[_0xc9be('0x15')]){if(_0x2fc447['error'][_0xc9be('0x16')]===0x1f4){logger[_0xc9be('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x121db3,_0x2fc447[_0xc9be('0x15')][_0xc9be('0x17')]);return _0x80461f(_0x2fc447[_0xc9be('0x15')]['message']);}logger[_0xc9be('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x121db3,_0x2fc447[_0xc9be('0x15')][_0xc9be('0x17')]);return _0xadba1d(_0x2fc447[_0xc9be('0x15')][_0xc9be('0x17')]);}else{logger['info'](_0xc9be('0x18'),_0x121db3,_0xc9be('0x12'));_0xadba1d(_0x2fc447[_0xc9be('0x19')][_0xc9be('0x17')]);}})[_0xc9be('0x1a')](function(_0x38de91){logger['error'](_0xc9be('0x18'),_0x121db3,_0x38de91);_0x80461f(_0x38de91);});});}exports[_0xc9be('0x1b')]=function(_0x37920c){var _0x47add6=this;return new Promise(function(_0x540c32,_0x1fabea){return db['WhatsappQueue']['findAll']({'raw':_0x37920c[_0xc9be('0x1c')]?_0x37920c[_0xc9be('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x37920c[_0xc9be('0x1c')]?_0x37920c[_0xc9be('0x1c')][_0xc9be('0x1d')]||null:null,'attributes':_0x37920c[_0xc9be('0x1c')]?_0x37920c['options'][_0xc9be('0x1e')]||null:null,'limit':_0x37920c[_0xc9be('0x1c')]?_0x37920c[_0xc9be('0x1c')]['limit']||null:null,'include':_0x37920c[_0xc9be('0x1c')]?_0x37920c[_0xc9be('0x1c')][_0xc9be('0x1f')]?_['map'](_0x37920c[_0xc9be('0x1c')][_0xc9be('0x1f')],function(_0x107014){return{'model':db[_0x107014[_0xc9be('0x20')]],'as':_0x107014['as'],'attributes':_0x107014[_0xc9be('0x1e')],'include':_0x107014['include']?_[_0xc9be('0x21')](_0x107014['include'],function(_0x1fa104){return{'model':db[_0x1fa104['model']],'as':_0x1fa104['as'],'attributes':_0x1fa104[_0xc9be('0x1e')],'include':_0x1fa104['include']?_[_0xc9be('0x21')](_0x1fa104[_0xc9be('0x1f')],function(_0x2a071d){return{'model':db[_0x2a071d[_0xc9be('0x20')]],'as':_0x2a071d['as'],'attributes':_0x2a071d[_0xc9be('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc9be('0x10')](function(_0x53eea6){logger[_0xc9be('0x11')](_0xc9be('0x1b'),_0x37920c);logger['debug'](_0xc9be('0x1b'),_0x37920c,JSON[_0xc9be('0x14')](_0x53eea6));_0x540c32(_0x53eea6);})['catch'](function(_0x275117){logger[_0xc9be('0x15')](_0xc9be('0x1b'),_0x275117['message'],_0x37920c);_0x1fabea(_0x47add6[_0xc9be('0x15')](0x1f4,_0x275117[_0xc9be('0x17')]));});});};exports[_0xc9be('0x22')]=function(_0x27c7ce){var _0x1e49d3=this;return new Promise(function(_0x3de334,_0x3426a5){return db[_0xc9be('0x23')]['find']({'raw':_0x27c7ce[_0xc9be('0x1c')]?_0x27c7ce['options'][_0xc9be('0x24')]===undefined?!![]:![]:!![],'where':_0x27c7ce['options']?_0x27c7ce[_0xc9be('0x1c')][_0xc9be('0x1d')]||null:null,'attributes':_0x27c7ce[_0xc9be('0x1c')]?_0x27c7ce[_0xc9be('0x1c')]['attributes']||null:null,'include':_0x27c7ce[_0xc9be('0x1c')]?_0x27c7ce[_0xc9be('0x1c')][_0xc9be('0x1f')]?_[_0xc9be('0x21')](_0x27c7ce[_0xc9be('0x1c')]['include'],function(_0x362c6d){return{'model':db[_0x362c6d[_0xc9be('0x20')]],'as':_0x362c6d['as'],'attributes':_0x362c6d[_0xc9be('0x1e')],'include':_0x362c6d[_0xc9be('0x1f')]?_[_0xc9be('0x21')](_0x362c6d[_0xc9be('0x1f')],function(_0x502c1c){return{'model':db[_0x502c1c['model']],'as':_0x502c1c['as'],'attributes':_0x502c1c['attributes'],'include':_0x502c1c[_0xc9be('0x1f')]?_['map'](_0x502c1c[_0xc9be('0x1f')],function(_0x5da19a){return{'model':db[_0x5da19a['model']],'as':_0x5da19a['as'],'attributes':_0x5da19a[_0xc9be('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc9be('0x10')](function(_0x5160e6){logger[_0xc9be('0x11')](_0xc9be('0x22'),_0x27c7ce);logger[_0xc9be('0x13')](_0xc9be('0x22'),_0x27c7ce,JSON['stringify'](_0x5160e6));_0x3de334(_0x5160e6);})[_0xc9be('0x1a')](function(_0xc6c198){logger[_0xc9be('0x15')]('ShowWhatsappQueue',_0xc6c198[_0xc9be('0x17')],_0x27c7ce);_0x3426a5(_0x1e49d3[_0xc9be('0x15')](0x1f4,_0xc6c198[_0xc9be('0x17')]));});});};
\ No newline at end of file
+var _0x7168=['error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','ShowWhatsappQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x5ba453,_0x211b18){var _0x493dee=function(_0x3b1153){while(--_0x3b1153){_0x5ba453['push'](_0x5ba453['shift']());}};_0x493dee(++_0x211b18);}(_0x7168,0x16a));var _0x8716=function(_0x171e78,_0x2707bc){_0x171e78=_0x171e78-0x0;var _0x23e2b0=_0x7168[_0x171e78];return _0x23e2b0;};'use strict';var _=require(_0x8716('0x0'));var util=require(_0x8716('0x1'));var moment=require('moment');var BPromise=require(_0x8716('0x2'));var rs=require(_0x8716('0x3'));var fs=require('fs');var Redis=require(_0x8716('0x4'));var db=require(_0x8716('0x5'))['db'];var utils=require(_0x8716('0x6'));var logger=require(_0x8716('0x7'))(_0x8716('0x8'));var config=require(_0x8716('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8716('0xa')][_0x8716('0xb')]({'port':0x232a});config['redis']=_[_0x8716('0xc')](config[_0x8716('0xd')],{'host':_0x8716('0xe'),'port':0x18eb});var socket=require(_0x8716('0xf'))(new Redis(config['redis']));require(_0x8716('0x10'))[_0x8716('0x11')](socket);function respondWithRpcPromise(_0x112f8a,_0x5d85e1,_0x4dde55){return new BPromise(function(_0x22e24a,_0x3b6f63){return client['request'](_0x112f8a,_0x4dde55)[_0x8716('0x12')](function(_0x1e7fbb){logger[_0x8716('0x13')](_0x8716('0x14'),_0x5d85e1,_0x8716('0x15'));logger['debug'](_0x8716('0x16'),_0x5d85e1,'request\x20sent',JSON[_0x8716('0x17')](_0x1e7fbb));if(_0x1e7fbb['error']){if(_0x1e7fbb['error'][_0x8716('0x18')]===0x1f4){logger['error'](_0x8716('0x14'),_0x5d85e1,_0x1e7fbb[_0x8716('0x19')][_0x8716('0x1a')]);return _0x3b6f63(_0x1e7fbb[_0x8716('0x19')]['message']);}logger[_0x8716('0x19')](_0x8716('0x14'),_0x5d85e1,_0x1e7fbb[_0x8716('0x19')][_0x8716('0x1a')]);return _0x22e24a(_0x1e7fbb[_0x8716('0x19')][_0x8716('0x1a')]);}else{logger[_0x8716('0x13')](_0x8716('0x14'),_0x5d85e1,_0x8716('0x15'));_0x22e24a(_0x1e7fbb[_0x8716('0x1b')][_0x8716('0x1a')]);}})[_0x8716('0x1c')](function(_0x46208d){logger[_0x8716('0x19')](_0x8716('0x14'),_0x5d85e1,_0x46208d);_0x3b6f63(_0x46208d);});});}exports[_0x8716('0x1d')]=function(_0x138e18){var _0x386aa7=this;return new Promise(function(_0x881343,_0x281b18){return db[_0x8716('0x1e')][_0x8716('0x1f')]({'raw':_0x138e18[_0x8716('0x20')]?_0x138e18['options'][_0x8716('0x21')]===undefined?!![]:![]:!![],'where':_0x138e18[_0x8716('0x20')]?_0x138e18['options'][_0x8716('0x22')]||null:null,'attributes':_0x138e18['options']?_0x138e18[_0x8716('0x20')][_0x8716('0x23')]||null:null,'limit':_0x138e18[_0x8716('0x20')]?_0x138e18[_0x8716('0x20')][_0x8716('0x24')]||null:null,'include':_0x138e18['options']?_0x138e18[_0x8716('0x20')][_0x8716('0x25')]?_[_0x8716('0x26')](_0x138e18[_0x8716('0x20')][_0x8716('0x25')],function(_0x9c3074){return{'model':db[_0x9c3074['model']],'as':_0x9c3074['as'],'attributes':_0x9c3074[_0x8716('0x23')],'include':_0x9c3074[_0x8716('0x25')]?_[_0x8716('0x26')](_0x9c3074[_0x8716('0x25')],function(_0x54719d){return{'model':db[_0x54719d[_0x8716('0x27')]],'as':_0x54719d['as'],'attributes':_0x54719d['attributes'],'include':_0x54719d['include']?_['map'](_0x54719d[_0x8716('0x25')],function(_0x566b3f){return{'model':db[_0x566b3f[_0x8716('0x27')]],'as':_0x566b3f['as'],'attributes':_0x566b3f[_0x8716('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8716('0x12')](function(_0x518554){logger[_0x8716('0x13')](_0x8716('0x1d'),_0x138e18);logger[_0x8716('0x28')](_0x8716('0x1d'),_0x138e18,JSON['stringify'](_0x518554));_0x881343(_0x518554);})[_0x8716('0x1c')](function(_0x3faff0){logger['error']('GetWhatsappQueue',_0x3faff0[_0x8716('0x1a')],_0x138e18);_0x281b18(_0x386aa7['error'](0x1f4,_0x3faff0[_0x8716('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x5db995){var _0x1e1f40=this;return new Promise(function(_0xf2e363,_0x54c9d4){return db['WhatsappQueue'][_0x8716('0x29')]({'raw':_0x5db995[_0x8716('0x20')]?_0x5db995[_0x8716('0x20')][_0x8716('0x21')]===undefined?!![]:![]:!![],'where':_0x5db995['options']?_0x5db995[_0x8716('0x20')][_0x8716('0x22')]||null:null,'attributes':_0x5db995[_0x8716('0x20')]?_0x5db995[_0x8716('0x20')][_0x8716('0x23')]||null:null,'include':_0x5db995[_0x8716('0x20')]?_0x5db995[_0x8716('0x20')][_0x8716('0x25')]?_['map'](_0x5db995[_0x8716('0x20')][_0x8716('0x25')],function(_0x5c9666){return{'model':db[_0x5c9666[_0x8716('0x27')]],'as':_0x5c9666['as'],'attributes':_0x5c9666[_0x8716('0x23')],'include':_0x5c9666[_0x8716('0x25')]?_['map'](_0x5c9666[_0x8716('0x25')],function(_0x34e0b7){return{'model':db[_0x34e0b7['model']],'as':_0x34e0b7['as'],'attributes':_0x34e0b7[_0x8716('0x23')],'include':_0x34e0b7[_0x8716('0x25')]?_[_0x8716('0x26')](_0x34e0b7[_0x8716('0x25')],function(_0x686623){return{'model':db[_0x686623[_0x8716('0x27')]],'as':_0x686623['as'],'attributes':_0x686623[_0x8716('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8716('0x12')](function(_0x339bf6){logger[_0x8716('0x13')](_0x8716('0x2a'),_0x5db995);logger[_0x8716('0x28')](_0x8716('0x2a'),_0x5db995,JSON[_0x8716('0x17')](_0x339bf6));_0xf2e363(_0x339bf6);})[_0x8716('0x1c')](function(_0x51d789){logger[_0x8716('0x19')](_0x8716('0x2a'),_0x51d789[_0x8716('0x1a')],_0x5db995);_0x54c9d4(_0x1e1f40[_0x8716('0x19')](0x1f4,_0x51d789['message']));});});};
\ No newline at end of file
index 32b2f15..38785e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf619=['emit','removeListener','register','length','./whatsappQueue.events','save','remove','update'];(function(_0x4277fd,_0x38136d){var _0x5192af=function(_0x127783){while(--_0x127783){_0x4277fd['push'](_0x4277fd['shift']());}};_0x5192af(++_0x38136d);}(_0xf619,0x13c));var _0x9f61=function(_0x39b670,_0x6d951e){_0x39b670=_0x39b670-0x0;var _0x3085bb=_0xf619[_0x39b670];return _0x3085bb;};'use strict';var WhatsappQueueEvents=require(_0x9f61('0x0'));var events=[_0x9f61('0x1'),_0x9f61('0x2'),_0x9f61('0x3')];function createListener(_0x301b97,_0x52a6d3){return function(_0x36486d){_0x52a6d3[_0x9f61('0x4')](_0x301b97,_0x36486d);};}function removeListener(_0xde6b39,_0x46f5cc){return function(){WhatsappQueueEvents[_0x9f61('0x5')](_0xde6b39,_0x46f5cc);};}exports[_0x9f61('0x6')]=function(_0x10e015){for(var _0x497b0f=0x0,_0x5e656a=events[_0x9f61('0x7')];_0x497b0f<_0x5e656a;_0x497b0f++){var _0x612841=events[_0x497b0f];var _0x543761=createListener('whatsappQueue:'+_0x612841,_0x10e015);WhatsappQueueEvents['on'](_0x612841,_0x543761);}};
\ No newline at end of file
+var _0xb52e=['update','emit','removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x9efe0,_0x1e7272){var _0x232a0f=function(_0x377439){while(--_0x377439){_0x9efe0['push'](_0x9efe0['shift']());}};_0x232a0f(++_0x1e7272);}(_0xb52e,0x105));var _0xeb52=function(_0x4abdc2,_0xa5f153){_0x4abdc2=_0x4abdc2-0x0;var _0x363283=_0xb52e[_0x4abdc2];return _0x363283;};'use strict';var WhatsappQueueEvents=require(_0xeb52('0x0'));var events=[_0xeb52('0x1'),_0xeb52('0x2'),_0xeb52('0x3')];function createListener(_0xd6927f,_0x4e7086){return function(_0x2949d6){_0x4e7086[_0xeb52('0x4')](_0xd6927f,_0x2949d6);};}function removeListener(_0x2eb575,_0x1edd63){return function(){WhatsappQueueEvents[_0xeb52('0x5')](_0x2eb575,_0x1edd63);};}exports['register']=function(_0x33ad9e){for(var _0x3749e6=0x0,_0xab0bae=events[_0xeb52('0x6')];_0x3749e6<_0xab0bae;_0x3749e6++){var _0x5bc297=events[_0x3749e6];var _0xcac80f=createListener(_0xeb52('0x7')+_0x5bc297,_0x33ad9e);WhatsappQueueEvents['on'](_0x5bc297,_0xcac80f);}};
\ No newline at end of file
index 9441494..15c736e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e2f=['get','isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller'];(function(_0x2c1ddd,_0x2a667f){var _0x49fa39=function(_0x581c2d){while(--_0x581c2d){_0x2c1ddd['push'](_0x2c1ddd['shift']());}};_0x49fa39(++_0x2a667f);}(_0x2e2f,0x14f));var _0xf2e2=function(_0x24e23d,_0x26684a){_0x24e23d=_0x24e23d-0x0;var _0x14db43=_0x2e2f[_0x24e23d];return _0x14db43;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf2e2('0x0'));var timeout=require('connect-timeout');var express=require(_0xf2e2('0x1'));var router=express[_0xf2e2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf2e2('0x3'));var interaction=require(_0xf2e2('0x4'));var config=require(_0xf2e2('0x5'));var controller=require(_0xf2e2('0x6'));router[_0xf2e2('0x7')]('/',auth[_0xf2e2('0x8')](),controller[_0xf2e2('0x9')]);router[_0xf2e2('0x7')]('/describe',auth[_0xf2e2('0x8')](),controller[_0xf2e2('0xa')]);router[_0xf2e2('0x7')](_0xf2e2('0xb'),auth['isAuthenticated'](),controller[_0xf2e2('0xc')]);router['post']('/',auth[_0xf2e2('0x8')](),controller['create']);router[_0xf2e2('0xd')](_0xf2e2('0xb'),auth[_0xf2e2('0x8')](),controller[_0xf2e2('0xe')]);router[_0xf2e2('0xf')]('/:id',auth[_0xf2e2('0x8')](),controller[_0xf2e2('0x10')]);module[_0xf2e2('0x11')]=router;
\ No newline at end of file
+var _0x7f8c=['put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x54c261,_0x2d84da){var _0x20540d=function(_0x250d86){while(--_0x250d86){_0x54c261['push'](_0x54c261['shift']());}};_0x20540d(++_0x2d84da);}(_0x7f8c,0xb0));var _0xc7f8=function(_0x20197c,_0x51e4fc){_0x20197c=_0x20197c-0x0;var _0x24919d=_0x7f8c[_0x20197c];return _0x24919d;};'use strict';var multer=require(_0xc7f8('0x0'));var util=require(_0xc7f8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc7f8('0x2')]();var fs_extra=require(_0xc7f8('0x3'));var auth=require(_0xc7f8('0x4'));var interaction=require(_0xc7f8('0x5'));var config=require(_0xc7f8('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xc7f8('0x7')]('/',auth[_0xc7f8('0x8')](),controller[_0xc7f8('0x9')]);router[_0xc7f8('0x7')](_0xc7f8('0xa'),auth[_0xc7f8('0x8')](),controller['describe']);router[_0xc7f8('0x7')](_0xc7f8('0xb'),auth[_0xc7f8('0x8')](),controller[_0xc7f8('0xc')]);router[_0xc7f8('0xd')]('/',auth[_0xc7f8('0x8')](),controller['create']);router[_0xc7f8('0xe')](_0xc7f8('0xb'),auth[_0xc7f8('0x8')](),controller[_0xc7f8('0xf')]);router[_0xc7f8('0x10')](_0xc7f8('0xb'),auth[_0xc7f8('0x8')](),controller[_0xc7f8('0x11')]);module[_0xc7f8('0x12')]=router;
\ No newline at end of file
index bf3e595..04f1e8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x2158a0,_0x474673){var _0x4cfd9f=function(_0x46a6c0){while(--_0x46a6c0){_0x2158a0['push'](_0x2158a0['shift']());}};_0x4cfd9f(++_0x474673);}(_0x7a54,0x106));var _0x47a5=function(_0x32baa4,_0x3104a5){_0x32baa4=_0x32baa4-0x0;var _0x490ee9=_0x7a54[_0x32baa4];return _0x490ee9;};'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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x980fa0,_0x4de5e7){var _0x440876=function(_0x4cca75){while(--_0x4cca75){_0x980fa0['push'](_0x980fa0['shift']());}};_0x440876(++_0x4de5e7);}(_0x7a54,0x106));var _0x47a5=function(_0x1152ea,_0x2e25c0){_0x1152ea=_0x1152ea-0x0;var _0x8794ac=_0x7a54[_0x1152ea];return _0x8794ac;};'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
index 7de828e..3df42c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236c=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','WhatsappQueueReport','fieldName','key','query','filters','intersection'];(function(_0x3da9af,_0x40c7e6){var _0x316718=function(_0x1455cc){while(--_0x1455cc){_0x3da9af['push'](_0x3da9af['shift']());}};_0x316718(++_0x40c7e6);}(_0x236c,0x155));var _0xc236=function(_0x584088,_0x3da671){_0x584088=_0x584088-0x0;var _0x39e62a=_0x236c[_0x584088];return _0x39e62a;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){_0x21fab8[_0xc236('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308cd6,_0x21d78f){return function(_0x356042){if(!_0x356042){_0x308cd6[_0xc236('0x26')](0x194);}return _0x356042;};}function handleError(_0x561da1,_0x42f248){_0x42f248=_0x42f248||0x1f4;return function(_0x5da4b2){logger['error'](_0x5da4b2[_0xc236('0x27')]);if(_0x5da4b2['name']){delete _0x5da4b2[_0xc236('0x28')];}_0x561da1['status'](_0x42f248)[_0xc236('0x29')](_0x5da4b2);};}exports['index']=function(_0x423842,_0x1d144b){var _0x4f5175={},_0x5a61b5={},_0x265c8d={'count':0x0,'rows':[]};var _0x1fd31d=_[_0xc236('0x2a')](db[_0xc236('0x2b')]['rawAttributes'],function(_0x4e3262){return{'name':_0x4e3262[_0xc236('0x2c')],'type':_0x4e3262['type'][_0xc236('0x2d')]};});_0x5a61b5['model']=_[_0xc236('0x2a')](_0x1fd31d,_0xc236('0x28'));_0x5a61b5['query']=_['keys'](_0x423842[_0xc236('0x2e')]);_0x5a61b5[_0xc236('0x2f')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],_0x5a61b5[_0xc236('0x2e')]);_0x4f5175[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x423842['query']['fields']));_0x4f5175['attributes']=_0x4f5175[_0xc236('0x32')][_0xc236('0x34')]?_0x4f5175[_0xc236('0x32')]:_0x5a61b5[_0xc236('0x31')];if(!_0x423842[_0xc236('0x2e')][_0xc236('0x35')](_0xc236('0x36'))){_0x4f5175['limit']=qs[_0xc236('0x37')](_0x423842[_0xc236('0x2e')][_0xc236('0x37')]);_0x4f5175['offset']=qs[_0xc236('0x1a')](_0x423842[_0xc236('0x2e')][_0xc236('0x1a')]);}_0x4f5175[_0xc236('0x38')]=qs['sort'](_0x423842[_0xc236('0x2e')][_0xc236('0x39')]);_0x4f5175[_0xc236('0x3a')]=qs[_0xc236('0x2f')](_[_0xc236('0x3b')](_0x423842[_0xc236('0x2e')],_0x5a61b5[_0xc236('0x2f')]),_0x1fd31d);if(_0x423842[_0xc236('0x2e')][_0xc236('0x3c')]){_0x4f5175[_0xc236('0x3a')]=_[_0xc236('0x3d')](_0x4f5175[_0xc236('0x3a')],{'$or':_[_0xc236('0x2a')](_0x1fd31d,function(_0x237193){if(_0x237193[_0xc236('0x3e')]!==_0xc236('0x3f')){var _0x46db5a={};_0x46db5a[_0x237193['name']]={'$like':'%'+_0x423842['query']['filter']+'%'};return _0x46db5a;}})});}_0x4f5175=_['merge']({},_0x4f5175,_0x423842[_0xc236('0x40')]);var _0x5c4739={'where':_0x4f5175[_0xc236('0x3a')]};return db[_0xc236('0x2b')][_0xc236('0x1c')](_0x5c4739)[_0xc236('0x24')](function(_0xdf7897){_0x265c8d[_0xc236('0x1c')]=_0xdf7897;if(_0x423842[_0xc236('0x2e')][_0xc236('0x41')]){_0x4f5175[_0xc236('0x42')]=[{'all':!![]}];}return db[_0xc236('0x2b')][_0xc236('0x43')](_0x4f5175);})[_0xc236('0x24')](function(_0x3b2f2f){_0x265c8d[_0xc236('0x44')]=_0x3b2f2f;return _0x265c8d;})[_0xc236('0x24')](respondWithFilteredResult(_0x1d144b,_0x4f5175))['catch'](handleError(_0x1d144b,null));};exports[_0xc236('0x45')]=function(_0x24b851,_0x506ba0){var _0xb90a83={'raw':!![],'where':{'id':_0x24b851[_0xc236('0x46')]['id']}},_0x5b0bc5={};_0x5b0bc5['model']=_[_0xc236('0x47')](db[_0xc236('0x2b')][_0xc236('0x48')]);_0x5b0bc5['query']=_[_0xc236('0x47')](_0x24b851[_0xc236('0x2e')]);_0x5b0bc5[_0xc236('0x2f')]=_['intersection'](_0x5b0bc5[_0xc236('0x31')],_0x5b0bc5[_0xc236('0x2e')]);_0xb90a83[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5b0bc5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x24b851['query'][_0xc236('0x33')]));_0xb90a83['attributes']=_0xb90a83[_0xc236('0x32')][_0xc236('0x34')]?_0xb90a83[_0xc236('0x32')]:_0x5b0bc5[_0xc236('0x31')];if(_0x24b851[_0xc236('0x2e')][_0xc236('0x41')]){_0xb90a83[_0xc236('0x42')]=[{'all':!![]}];}_0xb90a83=_['merge']({},_0xb90a83,_0x24b851[_0xc236('0x40')]);return db['WhatsappQueueReport'][_0xc236('0x49')](_0xb90a83)[_0xc236('0x24')](handleEntityNotFound(_0x506ba0,null))['then'](respondWithResult(_0x506ba0,null))[_0xc236('0x4a')](handleError(_0x506ba0,null));};exports[_0xc236('0x4b')]=function(_0x3c1c5c,_0x161890){return db[_0xc236('0x2b')][_0xc236('0x4b')](_0x3c1c5c[_0xc236('0x4c')],{})['then'](respondWithResult(_0x161890,0xc9))['catch'](handleError(_0x161890,null));};exports[_0xc236('0x23')]=function(_0x2afed2,_0x510f7f){if(_0x2afed2[_0xc236('0x4c')]['id']){delete _0x2afed2[_0xc236('0x4c')]['id'];}return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x2afed2[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x510f7f,null))[_0xc236('0x24')](saveUpdates(_0x2afed2[_0xc236('0x4c')],null))[_0xc236('0x24')](respondWithResult(_0x510f7f,null))['catch'](handleError(_0x510f7f,null));};exports[_0xc236('0x25')]=function(_0x307663,_0x41b7d5){return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x307663[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x41b7d5,null))['then'](removeEntity(_0x41b7d5,null))[_0xc236('0x4a')](handleError(_0x41b7d5,null));};exports[_0xc236('0x4d')]=function(_0x17c86b,_0x16ff63){return db['WhatsappQueueReport'][_0xc236('0x4d')]()[_0xc236('0x24')](respondWithResult(_0x16ff63,null))[_0xc236('0x4a')](handleError(_0x16ff63,null));};
\ No newline at end of file
+var _0x5423=['params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','then','rows','catch','show','WhatsappQueueReport','find','create','body','update'];(function(_0x411531,_0x244848){var _0x239895=function(_0xf1ea8a){while(--_0xf1ea8a){_0x411531['push'](_0x411531['shift']());}};_0x239895(++_0x244848);}(_0x5423,0xe3));var _0x3542=function(_0x5d57ba,_0x204785){_0x5d57ba=_0x5d57ba-0x0;var _0x4e31c8=_0x5423[_0x5d57ba];return _0x4e31c8;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];function respondWithStatusCode(_0x1cf710,_0x43e977){_0x43e977=_0x43e977||0xcc;return function(_0x4ee86){if(_0x4ee86){return _0x1cf710[_0x3542('0x18')](_0x43e977);}return _0x1cf710[_0x3542('0x19')](_0x43e977)[_0x3542('0x1a')]();};}function respondWithResult(_0x15863d,_0x4bac5b){_0x4bac5b=_0x4bac5b||0xc8;return function(_0x14fe57){if(_0x14fe57){return _0x15863d['status'](_0x4bac5b)[_0x3542('0x1b')](_0x14fe57);}};}function respondWithFilteredResult(_0x13fe0b,_0xc33d42){return function(_0x546fbd){if(_0x546fbd){var _0x270312=typeof _0xc33d42[_0x3542('0x1c')]===_0x3542('0x1d')&&typeof _0xc33d42['limit']===_0x3542('0x1d');var _0x23b0de=_0x546fbd[_0x3542('0x1e')];var _0x3d5199=_0x270312?0x0:_0xc33d42['offset'];var _0x32df3f=_0x270312?_0x546fbd['count']:_0xc33d42[_0x3542('0x1c')]+_0xc33d42[_0x3542('0x1f')];var _0x4d93bc;if(_0x32df3f>=_0x23b0de){_0x32df3f=_0x23b0de;_0x4d93bc=0xc8;}else{_0x4d93bc=0xce;}_0x13fe0b[_0x3542('0x19')](_0x4d93bc);return _0x13fe0b[_0x3542('0x20')](_0x3542('0x21'),_0x3d5199+'-'+_0x32df3f+'/'+_0x23b0de)[_0x3542('0x1b')](_0x546fbd);}return null;};}function patchUpdates(_0x212950){return function(_0x4a7695){try{jsonpatch['apply'](_0x4a7695,_0x212950,!![]);}catch(_0x4c58f1){return BPromise[_0x3542('0x22')](_0x4c58f1);}return _0x4a7695['save']();};}function saveUpdates(_0x1d5488,_0x551645){return function(_0x1d5f1e){if(_0x1d5f1e){return _0x1d5f1e['update'](_0x1d5488)['then'](function(_0x3eacd0){return _0x3eacd0;});}return null;};}function removeEntity(_0xe3f983,_0x5ae097){return function(_0x5d05b2){if(_0x5d05b2){return _0x5d05b2[_0x3542('0x23')]()['then'](function(){_0xe3f983[_0x3542('0x19')](0xcc)[_0x3542('0x1a')]();});}};}function handleEntityNotFound(_0x1e0723,_0x2f2e63){return function(_0x298763){if(!_0x298763){_0x1e0723[_0x3542('0x18')](0x194);}return _0x298763;};}function handleError(_0x412184,_0x1e156e){_0x1e156e=_0x1e156e||0x1f4;return function(_0x18dc6c){logger[_0x3542('0x24')](_0x18dc6c[_0x3542('0x25')]);if(_0x18dc6c[_0x3542('0x26')]){delete _0x18dc6c[_0x3542('0x26')];}_0x412184[_0x3542('0x19')](_0x1e156e)[_0x3542('0x27')](_0x18dc6c);};}exports[_0x3542('0x28')]=function(_0x303412,_0x20eda1){var _0x3bd666={},_0x5590a2={},_0x31ad47={'count':0x0,'rows':[]};var _0x35bbc9=_[_0x3542('0x29')](db['WhatsappQueueReport'][_0x3542('0x2a')],function(_0xc6f23b){return{'name':_0xc6f23b[_0x3542('0x2b')],'type':_0xc6f23b[_0x3542('0x2c')]['key']};});_0x5590a2['model']=_[_0x3542('0x29')](_0x35bbc9,_0x3542('0x26'));_0x5590a2[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x303412[_0x3542('0x2d')]);_0x5590a2[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5590a2['model'],_0x5590a2['query']);_0x3bd666[_0x3542('0x31')]=_['intersection'](_0x5590a2['model'],qs[_0x3542('0x32')](_0x303412['query']['fields']));_0x3bd666[_0x3542('0x31')]=_0x3bd666[_0x3542('0x31')][_0x3542('0x33')]?_0x3bd666['attributes']:_0x5590a2[_0x3542('0x34')];if(!_0x303412['query'][_0x3542('0x35')](_0x3542('0x36'))){_0x3bd666['limit']=qs[_0x3542('0x1f')](_0x303412['query'][_0x3542('0x1f')]);_0x3bd666[_0x3542('0x1c')]=qs[_0x3542('0x1c')](_0x303412['query'][_0x3542('0x1c')]);}_0x3bd666['order']=qs[_0x3542('0x37')](_0x303412[_0x3542('0x2d')][_0x3542('0x37')]);_0x3bd666[_0x3542('0x38')]=qs[_0x3542('0x2f')](_[_0x3542('0x39')](_0x303412[_0x3542('0x2d')],_0x5590a2[_0x3542('0x2f')]),_0x35bbc9);if(_0x303412[_0x3542('0x2d')][_0x3542('0x3a')]){_0x3bd666[_0x3542('0x38')]=_[_0x3542('0x3b')](_0x3bd666[_0x3542('0x38')],{'$or':_['map'](_0x35bbc9,function(_0x62429){if(_0x62429['type']!=='VIRTUAL'){var _0x2782f2={};_0x2782f2[_0x62429[_0x3542('0x26')]]={'$like':'%'+_0x303412[_0x3542('0x2d')][_0x3542('0x3a')]+'%'};return _0x2782f2;}})});}_0x3bd666=_[_0x3542('0x3b')]({},_0x3bd666,_0x303412[_0x3542('0x3c')]);var _0xc7f13c={'where':_0x3bd666[_0x3542('0x38')]};return db['WhatsappQueueReport'][_0x3542('0x1e')](_0xc7f13c)['then'](function(_0x1c8855){_0x31ad47[_0x3542('0x1e')]=_0x1c8855;if(_0x303412['query'][_0x3542('0x3d')]){_0x3bd666[_0x3542('0x3e')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x3542('0x3f')](_0x3bd666);})[_0x3542('0x40')](function(_0x5e1b29){_0x31ad47[_0x3542('0x41')]=_0x5e1b29;return _0x31ad47;})[_0x3542('0x40')](respondWithFilteredResult(_0x20eda1,_0x3bd666))[_0x3542('0x42')](handleError(_0x20eda1,null));};exports[_0x3542('0x43')]=function(_0x290c7c,_0xb12441){var _0x2b54b9={'raw':!![],'where':{'id':_0x290c7c['params']['id']}},_0x4bf45a={};_0x4bf45a[_0x3542('0x34')]=_[_0x3542('0x2e')](db[_0x3542('0x44')][_0x3542('0x2a')]);_0x4bf45a[_0x3542('0x2d')]=_['keys'](_0x290c7c[_0x3542('0x2d')]);_0x4bf45a['filters']=_[_0x3542('0x30')](_0x4bf45a[_0x3542('0x34')],_0x4bf45a[_0x3542('0x2d')]);_0x2b54b9['attributes']=_[_0x3542('0x30')](_0x4bf45a[_0x3542('0x34')],qs['fields'](_0x290c7c[_0x3542('0x2d')][_0x3542('0x32')]));_0x2b54b9[_0x3542('0x31')]=_0x2b54b9[_0x3542('0x31')][_0x3542('0x33')]?_0x2b54b9[_0x3542('0x31')]:_0x4bf45a[_0x3542('0x34')];if(_0x290c7c[_0x3542('0x2d')]['includeAll']){_0x2b54b9['include']=[{'all':!![]}];}_0x2b54b9=_['merge']({},_0x2b54b9,_0x290c7c[_0x3542('0x3c')]);return db[_0x3542('0x44')][_0x3542('0x45')](_0x2b54b9)[_0x3542('0x40')](handleEntityNotFound(_0xb12441,null))[_0x3542('0x40')](respondWithResult(_0xb12441,null))[_0x3542('0x42')](handleError(_0xb12441,null));};exports[_0x3542('0x46')]=function(_0x5adf34,_0x157683){return db[_0x3542('0x44')][_0x3542('0x46')](_0x5adf34[_0x3542('0x47')],{})['then'](respondWithResult(_0x157683,0xc9))[_0x3542('0x42')](handleError(_0x157683,null));};exports[_0x3542('0x48')]=function(_0x55b43a,_0x528f8c){if(_0x55b43a[_0x3542('0x47')]['id']){delete _0x55b43a[_0x3542('0x47')]['id'];}return db[_0x3542('0x44')][_0x3542('0x45')]({'where':{'id':_0x55b43a[_0x3542('0x49')]['id']}})[_0x3542('0x40')](handleEntityNotFound(_0x528f8c,null))[_0x3542('0x40')](saveUpdates(_0x55b43a['body'],null))[_0x3542('0x40')](respondWithResult(_0x528f8c,null))[_0x3542('0x42')](handleError(_0x528f8c,null));};exports[_0x3542('0x23')]=function(_0x392c6e,_0x1ebc82){return db[_0x3542('0x44')][_0x3542('0x45')]({'where':{'id':_0x392c6e[_0x3542('0x49')]['id']}})[_0x3542('0x40')](handleEntityNotFound(_0x1ebc82,null))['then'](removeEntity(_0x1ebc82,null))['catch'](handleError(_0x1ebc82,null));};exports[_0x3542('0x4a')]=function(_0x4b406b,_0x5a798a){return db['WhatsappQueueReport'][_0x3542('0x4a')]()[_0x3542('0x40')](respondWithResult(_0x5a798a,null))[_0x3542('0x42')](handleError(_0x5a798a,null));};
\ No newline at end of file
index f5a4baf..f6283d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x985e=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0x985e,0x128));var _0xe985=function(_0x378097,_0x20828d){_0x378097=_0x378097-0x0;var _0x5a8bcd=_0x985e[_0x378097];return _0x5a8bcd;};'use strict';var _=require(_0xe985('0x0'));var util=require(_0xe985('0x1'));var logger=require(_0xe985('0x2'))(_0xe985('0x3'));var moment=require(_0xe985('0x4'));var BPromise=require('bluebird');var rp=require(_0xe985('0x5'));var fs=require('fs');var path=require(_0xe985('0x6'));var rimraf=require(_0xe985('0x7'));var config=require(_0xe985('0x8'));var attributes=require(_0xe985('0x9'));module[_0xe985('0xa')]=function(_0x5c06c5,_0x15f785){return _0x5c06c5[_0xe985('0xb')]('WhatsappQueueReport',attributes,{'tableName':_0xe985('0xc'),'paranoid':![],'indexes':[{'name':_0xe985('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6c0=['api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','uniqueid','util','../../config/logger'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0xe6c0,0x142));var _0x0e6c=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xe6c0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require('lodash');var util=require(_0x0e6c('0x0'));var logger=require(_0x0e6c('0x1'))(_0x0e6c('0x2'));var moment=require(_0x0e6c('0x3'));var BPromise=require(_0x0e6c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e6c('0x5'));var rimraf=require(_0x0e6c('0x6'));var config=require(_0x0e6c('0x7'));var attributes=require(_0x0e6c('0x8'));module[_0x0e6c('0x9')]=function(_0x3155cc,_0x5e9616){return _0x3155cc['define'](_0x0e6c('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x0e6c('0xb'),'fields':[_0x0e6c('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index b960d52..55fb4ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c98=['message','result','catch','WhatsappQueueReport','create','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','body','where','attributes','limit','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0x9c98,0x1ee));var _0x89c9=function(_0x566b5a,_0x3d59fc){_0x566b5a=_0x566b5a-0x0;var _0x51477b=_0x9c98[_0x566b5a];return _0x51477b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x89c9('0x0'));var rs=require(_0x89c9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89c9('0x2'))['db'];var utils=require(_0x89c9('0x3'));var logger=require(_0x89c9('0x4'))(_0x89c9('0x5'));var config=require('../../config/environment');var jayson=require(_0x89c9('0x6'));var client=jayson[_0x89c9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc290,_0x2e5ae3,_0x28e978){return new BPromise(function(_0x3f54e9,_0x318ebf){return client[_0x89c9('0x8')](_0x1bc290,_0x28e978)[_0x89c9('0x9')](function(_0x5b4e7b){logger[_0x89c9('0xa')](_0x89c9('0xb'),_0x2e5ae3,_0x89c9('0xc'));logger[_0x89c9('0xd')](_0x89c9('0xe'),_0x2e5ae3,_0x89c9('0xc'),JSON[_0x89c9('0xf')](_0x5b4e7b));if(_0x5b4e7b[_0x89c9('0x10')]){if(_0x5b4e7b[_0x89c9('0x10')][_0x89c9('0x11')]===0x1f4){logger[_0x89c9('0x10')](_0x89c9('0xb'),_0x2e5ae3,_0x5b4e7b['error']['message']);return _0x318ebf(_0x5b4e7b[_0x89c9('0x10')][_0x89c9('0x12')]);}logger[_0x89c9('0x10')](_0x89c9('0xb'),_0x2e5ae3,_0x5b4e7b['error'][_0x89c9('0x12')]);return _0x3f54e9(_0x5b4e7b[_0x89c9('0x10')][_0x89c9('0x12')]);}else{logger[_0x89c9('0xa')](_0x89c9('0xb'),_0x2e5ae3,'request\x20sent');_0x3f54e9(_0x5b4e7b[_0x89c9('0x13')]['message']);}})[_0x89c9('0x14')](function(_0x531300){logger[_0x89c9('0x10')](_0x89c9('0xb'),_0x2e5ae3,_0x531300);_0x318ebf(_0x531300);});});}exports['CreateWhatsappQueueReport']=function(_0x5627b3){var _0x4e094f=this;return new Promise(function(_0x1d5502,_0x2d1f93){return db[_0x89c9('0x15')][_0x89c9('0x16')](_0x5627b3['body'],{'raw':_0x5627b3[_0x89c9('0x17')]?_0x5627b3[_0x89c9('0x17')][_0x89c9('0x18')]===undefined?!![]:![]:!![]})[_0x89c9('0x9')](function(_0xec7e4d){logger[_0x89c9('0xa')](_0x89c9('0x19'),_0x5627b3);logger[_0x89c9('0xd')](_0x89c9('0x19'),_0x5627b3,JSON[_0x89c9('0xf')](_0xec7e4d));_0x1d5502(_0xec7e4d);})[_0x89c9('0x14')](function(_0x2e26a1){logger['error'](_0x89c9('0x19'),_0x2e26a1[_0x89c9('0x12')],_0x5627b3);_0x2d1f93(_0x4e094f[_0x89c9('0x10')](0x1f4,_0x2e26a1[_0x89c9('0x12')]));});});};exports[_0x89c9('0x1a')]=function(_0x1d159c){var _0x4bf750=this;return new Promise(function(_0x1a9260,_0x4eb1a7){return db[_0x89c9('0x15')][_0x89c9('0x1b')](_0x1d159c[_0x89c9('0x1c')],{'raw':_0x1d159c[_0x89c9('0x17')]?_0x1d159c['options'][_0x89c9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d159c[_0x89c9('0x17')]?_0x1d159c[_0x89c9('0x17')][_0x89c9('0x1d')]||null:null,'attributes':_0x1d159c['options']?_0x1d159c[_0x89c9('0x17')][_0x89c9('0x1e')]||null:null,'limit':_0x1d159c['options']?_0x1d159c[_0x89c9('0x17')][_0x89c9('0x1f')]||null:null})[_0x89c9('0x9')](function(_0x1a9265){logger['info']('UpdateWhatsappQueueReport',_0x1d159c);logger[_0x89c9('0xd')](_0x89c9('0x1a'),_0x1d159c,JSON[_0x89c9('0xf')](_0x1a9265));_0x1a9260(_0x1a9265);})[_0x89c9('0x14')](function(_0x2428d1){logger[_0x89c9('0x10')](_0x89c9('0x1a'),_0x2428d1[_0x89c9('0x12')],_0x1d159c);_0x4eb1a7(_0x4bf750[_0x89c9('0x10')](0x1f4,_0x2428d1['message']));});});};
\ No newline at end of file
+var _0xdb7e=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','WhatsappQueueReport','create','body','options','raw','then','CreateWhatsappQueueReport','stringify','catch','UpdateWhatsappQueueReport','update','limit','lodash','moment','bluebird','randomstring'];(function(_0x3c8939,_0x4fa380){var _0x7c270f=function(_0x1bcc35){while(--_0x1bcc35){_0x3c8939['push'](_0x3c8939['shift']());}};_0x7c270f(++_0x4fa380);}(_0xdb7e,0x1ec));var _0xedb7=function(_0x101e3a,_0x373a9e){_0x101e3a=_0x101e3a-0x0;var _0x34407b=_0xdb7e[_0x101e3a];return _0x34407b;};'use strict';var _=require(_0xedb7('0x0'));var util=require('util');var moment=require(_0xedb7('0x1'));var BPromise=require(_0xedb7('0x2'));var rs=require(_0xedb7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedb7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xedb7('0x5'))(_0xedb7('0x6'));var config=require(_0xedb7('0x7'));var jayson=require(_0xedb7('0x8'));var client=jayson[_0xedb7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x200c9f,_0x8183ce,_0x105430){return new BPromise(function(_0x4d07bb,_0x184272){return client[_0xedb7('0xa')](_0x200c9f,_0x105430)['then'](function(_0x1ef8fa){logger[_0xedb7('0xb')](_0xedb7('0xc'),_0x8183ce,'request\x20sent');logger[_0xedb7('0xd')](_0xedb7('0xe'),_0x8183ce,_0xedb7('0xf'),JSON['stringify'](_0x1ef8fa));if(_0x1ef8fa[_0xedb7('0x10')]){if(_0x1ef8fa[_0xedb7('0x10')]['code']===0x1f4){logger[_0xedb7('0x10')](_0xedb7('0xc'),_0x8183ce,_0x1ef8fa[_0xedb7('0x10')]['message']);return _0x184272(_0x1ef8fa[_0xedb7('0x10')]['message']);}logger[_0xedb7('0x10')](_0xedb7('0xc'),_0x8183ce,_0x1ef8fa[_0xedb7('0x10')][_0xedb7('0x11')]);return _0x4d07bb(_0x1ef8fa[_0xedb7('0x10')][_0xedb7('0x11')]);}else{logger[_0xedb7('0xb')](_0xedb7('0xc'),_0x8183ce,_0xedb7('0xf'));_0x4d07bb(_0x1ef8fa[_0xedb7('0x12')][_0xedb7('0x11')]);}})['catch'](function(_0x18594b){logger['error'](_0xedb7('0xc'),_0x8183ce,_0x18594b);_0x184272(_0x18594b);});});}exports['CreateWhatsappQueueReport']=function(_0x318741){var _0xbcbef6=this;return new Promise(function(_0x3ed6f7,_0x50b25a){return db[_0xedb7('0x13')][_0xedb7('0x14')](_0x318741[_0xedb7('0x15')],{'raw':_0x318741[_0xedb7('0x16')]?_0x318741['options'][_0xedb7('0x17')]===undefined?!![]:![]:!![]})[_0xedb7('0x18')](function(_0x3e5e8d){logger[_0xedb7('0xb')](_0xedb7('0x19'),_0x318741);logger[_0xedb7('0xd')](_0xedb7('0x19'),_0x318741,JSON[_0xedb7('0x1a')](_0x3e5e8d));_0x3ed6f7(_0x3e5e8d);})[_0xedb7('0x1b')](function(_0x5906c6){logger[_0xedb7('0x10')]('CreateWhatsappQueueReport',_0x5906c6[_0xedb7('0x11')],_0x318741);_0x50b25a(_0xbcbef6[_0xedb7('0x10')](0x1f4,_0x5906c6[_0xedb7('0x11')]));});});};exports[_0xedb7('0x1c')]=function(_0x19c07f){var _0x169eff=this;return new Promise(function(_0xd31aec,_0x5b0756){return db[_0xedb7('0x13')][_0xedb7('0x1d')](_0x19c07f[_0xedb7('0x15')],{'raw':_0x19c07f[_0xedb7('0x16')]?_0x19c07f[_0xedb7('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19c07f[_0xedb7('0x16')]?_0x19c07f['options']['where']||null:null,'attributes':_0x19c07f[_0xedb7('0x16')]?_0x19c07f[_0xedb7('0x16')]['attributes']||null:null,'limit':_0x19c07f[_0xedb7('0x16')]?_0x19c07f['options'][_0xedb7('0x1e')]||null:null})[_0xedb7('0x18')](function(_0x27fae0){logger[_0xedb7('0xb')](_0xedb7('0x1c'),_0x19c07f);logger[_0xedb7('0xd')](_0xedb7('0x1c'),_0x19c07f,JSON['stringify'](_0x27fae0));_0xd31aec(_0x27fae0);})['catch'](function(_0x1ef8f0){logger[_0xedb7('0x10')](_0xedb7('0x1c'),_0x1ef8f0[_0xedb7('0x11')],_0x19c07f);_0x5b0756(_0x169eff['error'](0x1f4,_0x1ef8f0['message']));});});};
\ No newline at end of file
index 72bb585..ff9637a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21b3=['./whatsappTransferReport.controller','get','isAuthenticated','/describe','/:id','post','put','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x21b3,0x81));var _0x321b=function(_0x20aeb6,_0x10e946){_0x20aeb6=_0x20aeb6-0x0;var _0x1973cb=_0x21b3[_0x20aeb6];return _0x1973cb;};'use strict';var multer=require(_0x321b('0x0'));var util=require(_0x321b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x321b('0x2'));var router=express['Router']();var fs_extra=require(_0x321b('0x3'));var auth=require(_0x321b('0x4'));var interaction=require(_0x321b('0x5'));var config=require(_0x321b('0x6'));var controller=require(_0x321b('0x7'));router[_0x321b('0x8')]('/',auth[_0x321b('0x9')](),controller['index']);router[_0x321b('0x8')](_0x321b('0xa'),auth[_0x321b('0x9')](),controller['describe']);router[_0x321b('0x8')](_0x321b('0xb'),auth[_0x321b('0x9')](),controller['show']);router[_0x321b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x321b('0xd')](_0x321b('0xb'),auth[_0x321b('0x9')](),controller[_0x321b('0xe')]);router['delete']('/:id',auth[_0x321b('0x9')](),controller[_0x321b('0xf')]);module[_0x321b('0x10')]=router;
\ No newline at end of file
+var _0xa63a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x585ed8,_0x3e44ac){var _0x9d5f3a=function(_0x2dd721){while(--_0x2dd721){_0x585ed8['push'](_0x585ed8['shift']());}};_0x9d5f3a(++_0x3e44ac);}(_0xa63a,0x1a0));var _0xaa63=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xa63a[_0x3712e2];return _0x1faff4;};'use strict';var multer=require(_0xaa63('0x0'));var util=require(_0xaa63('0x1'));var path=require(_0xaa63('0x2'));var timeout=require(_0xaa63('0x3'));var express=require('express');var router=express[_0xaa63('0x4')]();var fs_extra=require(_0xaa63('0x5'));var auth=require(_0xaa63('0x6'));var interaction=require(_0xaa63('0x7'));var config=require(_0xaa63('0x8'));var controller=require(_0xaa63('0x9'));router[_0xaa63('0xa')]('/',auth[_0xaa63('0xb')](),controller[_0xaa63('0xc')]);router[_0xaa63('0xa')](_0xaa63('0xd'),auth[_0xaa63('0xb')](),controller['describe']);router[_0xaa63('0xa')](_0xaa63('0xe'),auth['isAuthenticated'](),controller[_0xaa63('0xf')]);router['post']('/',auth[_0xaa63('0xb')](),controller[_0xaa63('0x10')]);router['put'](_0xaa63('0xe'),auth['isAuthenticated'](),controller[_0xaa63('0x11')]);router[_0xaa63('0x12')](_0xaa63('0xe'),auth[_0xaa63('0xb')](),controller[_0xaa63('0x13')]);module[_0xaa63('0x14')]=router;
\ No newline at end of file
index f1218f9..fdde2e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x594d=['DATE','sequelize','ENUM','account','agent'];(function(_0x4aa09f,_0x3c9d3a){var _0x1f8b57=function(_0x259326){while(--_0x259326){_0x4aa09f['push'](_0x4aa09f['shift']());}};_0x1f8b57(++_0x3c9d3a);}(_0x594d,0x92));var _0xd594=function(_0x1abbf1,_0x27c202){_0x1abbf1=_0x1abbf1-0x0;var _0x37c226=_0x594d[_0x1abbf1];return _0x37c226;};'use strict';var Sequelize=require(_0xd594('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd594('0x1')](_0xd594('0x2'),_0xd594('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd594('0x4')]}};
\ No newline at end of file
+var _0xf5b6=['DATE','STRING','ENUM','account','agent'];(function(_0x46d2fe,_0x33b7e9){var _0x1b3951=function(_0x9b2968){while(--_0x9b2968){_0x46d2fe['push'](_0x46d2fe['shift']());}};_0x1b3951(++_0x33b7e9);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x5f06da,_0x627f6a){_0x5f06da=_0x5f06da-0x0;var _0x413a7d=_0xf5b6[_0x5f06da];return _0x413a7d;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6f5b('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x6f5b('0x1')](_0x6f5b('0x2'),_0x6f5b('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6f5b('0x4')]}};
\ No newline at end of file
index c85c225..9d663da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa768=['body','destroy','describe','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','end','error','stack','name','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create'];(function(_0x5e8c7c,_0x52b970){var _0x2edb9b=function(_0x34d05a){while(--_0x34d05a){_0x5e8c7c['push'](_0x5e8c7c['shift']());}};_0x2edb9b(++_0x52b970);}(_0xa768,0x93));var _0x8a76=function(_0x36e57d,_0x509bde){_0x36e57d=_0x36e57d-0x0;var _0x36213f=_0xa768[_0x36e57d];return _0x36213f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a76('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8a76('0x1'));var moment=require(_0x8a76('0x2'));var BPromise=require(_0x8a76('0x3'));var Mustache=require(_0x8a76('0x4'));var util=require(_0x8a76('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8a76('0x6'));var ejs=require(_0x8a76('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a76('0x8'));var squel=require(_0x8a76('0x9'));var crypto=require(_0x8a76('0xa'));var jsforce=require(_0x8a76('0xb'));var deskjs=require(_0x8a76('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8a76('0xd'));var Papa=require(_0x8a76('0xe'));var Redis=require(_0x8a76('0xf'));var authService=require(_0x8a76('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a76('0x11'));var logger=require(_0x8a76('0x12'))(_0x8a76('0x13'));var utils=require(_0x8a76('0x14'));var config=require(_0x8a76('0x15'));var licenseUtil=require(_0x8a76('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fa455,_0x3b9a1d){_0x3b9a1d=_0x3b9a1d||0xcc;return function(_0x2e0eec){if(_0x2e0eec){return _0x4fa455[_0x8a76('0x17')](_0x3b9a1d);}return _0x4fa455[_0x8a76('0x18')](_0x3b9a1d)['end']();};}function respondWithResult(_0x16a0c0,_0x311848){_0x311848=_0x311848||0xc8;return function(_0x10b8fb){if(_0x10b8fb){return _0x16a0c0[_0x8a76('0x18')](_0x311848)[_0x8a76('0x19')](_0x10b8fb);}};}function respondWithFilteredResult(_0x3233ff,_0x29364e){return function(_0x51502d){if(_0x51502d){var _0x2893db=typeof _0x29364e[_0x8a76('0x1a')]===_0x8a76('0x1b')&&typeof _0x29364e[_0x8a76('0x1c')]===_0x8a76('0x1b');var _0x29ae8e=_0x51502d[_0x8a76('0x1d')];var _0x8dccdd=_0x2893db?0x0:_0x29364e[_0x8a76('0x1a')];var _0x3c2ae5=_0x2893db?_0x51502d['count']:_0x29364e[_0x8a76('0x1a')]+_0x29364e[_0x8a76('0x1c')];var _0x5cecc9;if(_0x3c2ae5>=_0x29ae8e){_0x3c2ae5=_0x29ae8e;_0x5cecc9=0xc8;}else{_0x5cecc9=0xce;}_0x3233ff[_0x8a76('0x18')](_0x5cecc9);return _0x3233ff['set']('Content-Range',_0x8dccdd+'-'+_0x3c2ae5+'/'+_0x29ae8e)[_0x8a76('0x19')](_0x51502d);}return null;};}function patchUpdates(_0x27760f){return function(_0x1bca54){try{jsonpatch[_0x8a76('0x1e')](_0x1bca54,_0x27760f,!![]);}catch(_0x1c9637){return BPromise[_0x8a76('0x1f')](_0x1c9637);}return _0x1bca54[_0x8a76('0x20')]();};}function saveUpdates(_0x351ffc,_0x25b7fa){return function(_0xe2c4f3){if(_0xe2c4f3){return _0xe2c4f3[_0x8a76('0x21')](_0x351ffc)[_0x8a76('0x22')](function(_0x47245f){return _0x47245f;});}return null;};}function removeEntity(_0x57dbdd,_0x4e5d23){return function(_0x21ff23){if(_0x21ff23){return _0x21ff23['destroy']()['then'](function(){_0x57dbdd['status'](0xcc)[_0x8a76('0x23')]();});}};}function handleEntityNotFound(_0x899ca,_0x48ba87){return function(_0x269bb3){if(!_0x269bb3){_0x899ca[_0x8a76('0x17')](0x194);}return _0x269bb3;};}function handleError(_0x176845,_0x5e6482){_0x5e6482=_0x5e6482||0x1f4;return function(_0x346577){logger[_0x8a76('0x24')](_0x346577[_0x8a76('0x25')]);if(_0x346577[_0x8a76('0x26')]){delete _0x346577['name'];}_0x176845['status'](_0x5e6482)['send'](_0x346577);};}exports[_0x8a76('0x27')]=function(_0x4f7835,_0x413d41){var _0x35e949={},_0xaa72f1={},_0x258b2e={'count':0x0,'rows':[]};var _0x1c931f=_[_0x8a76('0x28')](db[_0x8a76('0x29')]['rawAttributes'],function(_0x500331){return{'name':_0x500331[_0x8a76('0x2a')],'type':_0x500331[_0x8a76('0x2b')][_0x8a76('0x2c')]};});_0xaa72f1[_0x8a76('0x2d')]=_[_0x8a76('0x28')](_0x1c931f,_0x8a76('0x26'));_0xaa72f1[_0x8a76('0x2e')]=_[_0x8a76('0x2f')](_0x4f7835[_0x8a76('0x2e')]);_0xaa72f1[_0x8a76('0x30')]=_[_0x8a76('0x31')](_0xaa72f1[_0x8a76('0x2d')],_0xaa72f1['query']);_0x35e949['attributes']=_[_0x8a76('0x31')](_0xaa72f1['model'],qs[_0x8a76('0x32')](_0x4f7835[_0x8a76('0x2e')][_0x8a76('0x32')]));_0x35e949[_0x8a76('0x33')]=_0x35e949[_0x8a76('0x33')][_0x8a76('0x34')]?_0x35e949['attributes']:_0xaa72f1['model'];if(!_0x4f7835[_0x8a76('0x2e')][_0x8a76('0x35')](_0x8a76('0x36'))){_0x35e949[_0x8a76('0x1c')]=qs['limit'](_0x4f7835[_0x8a76('0x2e')][_0x8a76('0x1c')]);_0x35e949[_0x8a76('0x1a')]=qs[_0x8a76('0x1a')](_0x4f7835[_0x8a76('0x2e')][_0x8a76('0x1a')]);}_0x35e949[_0x8a76('0x37')]=qs['sort'](_0x4f7835[_0x8a76('0x2e')][_0x8a76('0x38')]);_0x35e949[_0x8a76('0x39')]=qs[_0x8a76('0x30')](_['pick'](_0x4f7835[_0x8a76('0x2e')],_0xaa72f1[_0x8a76('0x30')]),_0x1c931f);if(_0x4f7835['query'][_0x8a76('0x3a')]){_0x35e949['where']=_['merge'](_0x35e949[_0x8a76('0x39')],{'$or':_[_0x8a76('0x28')](_0x1c931f,function(_0x5931e3){if(_0x5931e3[_0x8a76('0x2b')]!==_0x8a76('0x3b')){var _0x1c37e5={};_0x1c37e5[_0x5931e3['name']]={'$like':'%'+_0x4f7835['query'][_0x8a76('0x3a')]+'%'};return _0x1c37e5;}})});}_0x35e949=_[_0x8a76('0x3c')]({},_0x35e949,_0x4f7835[_0x8a76('0x3d')]);var _0x2a853e={'where':_0x35e949[_0x8a76('0x39')]};return db[_0x8a76('0x29')][_0x8a76('0x1d')](_0x2a853e)[_0x8a76('0x22')](function(_0x767fe3){_0x258b2e[_0x8a76('0x1d')]=_0x767fe3;if(_0x4f7835[_0x8a76('0x2e')][_0x8a76('0x3e')]){_0x35e949[_0x8a76('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x35e949);})['then'](function(_0x5617ca){_0x258b2e['rows']=_0x5617ca;return _0x258b2e;})[_0x8a76('0x22')](respondWithFilteredResult(_0x413d41,_0x35e949))[_0x8a76('0x40')](handleError(_0x413d41,null));};exports[_0x8a76('0x41')]=function(_0x2547ed,_0x293371){var _0x19d648={'raw':!![],'where':{'id':_0x2547ed[_0x8a76('0x42')]['id']}},_0x268d3f={};_0x268d3f[_0x8a76('0x2d')]=_[_0x8a76('0x2f')](db[_0x8a76('0x29')]['rawAttributes']);_0x268d3f[_0x8a76('0x2e')]=_[_0x8a76('0x2f')](_0x2547ed[_0x8a76('0x2e')]);_0x268d3f[_0x8a76('0x30')]=_[_0x8a76('0x31')](_0x268d3f['model'],_0x268d3f['query']);_0x19d648[_0x8a76('0x33')]=_[_0x8a76('0x31')](_0x268d3f[_0x8a76('0x2d')],qs[_0x8a76('0x32')](_0x2547ed[_0x8a76('0x2e')][_0x8a76('0x32')]));_0x19d648['attributes']=_0x19d648[_0x8a76('0x33')]['length']?_0x19d648[_0x8a76('0x33')]:_0x268d3f['model'];if(_0x2547ed['query'][_0x8a76('0x3e')]){_0x19d648[_0x8a76('0x3f')]=[{'all':!![]}];}_0x19d648=_['merge']({},_0x19d648,_0x2547ed[_0x8a76('0x3d')]);return db[_0x8a76('0x29')][_0x8a76('0x43')](_0x19d648)[_0x8a76('0x22')](handleEntityNotFound(_0x293371,null))[_0x8a76('0x22')](respondWithResult(_0x293371,null))[_0x8a76('0x40')](handleError(_0x293371,null));};exports[_0x8a76('0x44')]=function(_0x534ffb,_0x2abb41){return db[_0x8a76('0x29')][_0x8a76('0x44')](_0x534ffb['body'],{})['then'](respondWithResult(_0x2abb41,0xc9))[_0x8a76('0x40')](handleError(_0x2abb41,null));};exports[_0x8a76('0x21')]=function(_0x3def36,_0x4ce2ff){if(_0x3def36[_0x8a76('0x45')]['id']){delete _0x3def36[_0x8a76('0x45')]['id'];}return db[_0x8a76('0x29')][_0x8a76('0x43')]({'where':{'id':_0x3def36[_0x8a76('0x42')]['id']}})[_0x8a76('0x22')](handleEntityNotFound(_0x4ce2ff,null))[_0x8a76('0x22')](saveUpdates(_0x3def36['body'],null))['then'](respondWithResult(_0x4ce2ff,null))[_0x8a76('0x40')](handleError(_0x4ce2ff,null));};exports[_0x8a76('0x46')]=function(_0x3e603d,_0x256674){return db[_0x8a76('0x29')][_0x8a76('0x43')]({'where':{'id':_0x3e603d['params']['id']}})[_0x8a76('0x22')](handleEntityNotFound(_0x256674,null))[_0x8a76('0x22')](removeEntity(_0x256674,null))['catch'](handleError(_0x256674,null));};exports['describe']=function(_0x1bd9ab,_0x21800b){return db[_0x8a76('0x29')][_0x8a76('0x47')]()[_0x8a76('0x22')](respondWithResult(_0x21800b,null))[_0x8a76('0x40')](handleError(_0x21800b,null));};
\ No newline at end of file
+var _0xf6e6=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','json','apply','reject','save','then','end','sendStatus','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','find','create','body','update','destroy','describe','eml-format','rimraf'];(function(_0x1f5a63,_0x511504){var _0x30bb7a=function(_0x476310){while(--_0x476310){_0x1f5a63['push'](_0x1f5a63['shift']());}};_0x30bb7a(++_0x511504);}(_0xf6e6,0x1a8));var _0x6f6e=function(_0xdeb03,_0x50f872){_0xdeb03=_0xdeb03-0x0;var _0x34103b=_0xf6e6[_0xdeb03];return _0x34103b;};'use strict';var emlformat=require(_0x6f6e('0x0'));var rimraf=require(_0x6f6e('0x1'));var zipdir=require(_0x6f6e('0x2'));var jsonpatch=require(_0x6f6e('0x3'));var rp=require(_0x6f6e('0x4'));var moment=require(_0x6f6e('0x5'));var BPromise=require(_0x6f6e('0x6'));var Mustache=require(_0x6f6e('0x7'));var util=require(_0x6f6e('0x8'));var path=require(_0x6f6e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f6e('0xa'));var _=require('lodash');var squel=require(_0x6f6e('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f6e('0xc'));var deskjs=require(_0x6f6e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f6e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6f6e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f6e('0x10'));var logger=require(_0x6f6e('0x11'))(_0x6f6e('0x12'));var utils=require(_0x6f6e('0x13'));var config=require(_0x6f6e('0x14'));var licenseUtil=require(_0x6f6e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4792f3,_0x2f7af0){_0x2f7af0=_0x2f7af0||0xcc;return function(_0x4c3a91){if(_0x4c3a91){return _0x4792f3['sendStatus'](_0x2f7af0);}return _0x4792f3['status'](_0x2f7af0)['end']();};}function respondWithResult(_0x17eb84,_0x9686fb){_0x9686fb=_0x9686fb||0xc8;return function(_0x50332a){if(_0x50332a){return _0x17eb84[_0x6f6e('0x16')](_0x9686fb)['json'](_0x50332a);}};}function respondWithFilteredResult(_0x71c1fe,_0x12e293){return function(_0x1ab0f1){if(_0x1ab0f1){var _0x15139c=typeof _0x12e293[_0x6f6e('0x17')]===_0x6f6e('0x18')&&typeof _0x12e293[_0x6f6e('0x19')]==='undefined';var _0x38e32f=_0x1ab0f1[_0x6f6e('0x1a')];var _0x2c7a0b=_0x15139c?0x0:_0x12e293[_0x6f6e('0x17')];var _0x155e91=_0x15139c?_0x1ab0f1[_0x6f6e('0x1a')]:_0x12e293[_0x6f6e('0x17')]+_0x12e293[_0x6f6e('0x19')];var _0x867a1;if(_0x155e91>=_0x38e32f){_0x155e91=_0x38e32f;_0x867a1=0xc8;}else{_0x867a1=0xce;}_0x71c1fe['status'](_0x867a1);return _0x71c1fe[_0x6f6e('0x1b')]('Content-Range',_0x2c7a0b+'-'+_0x155e91+'/'+_0x38e32f)[_0x6f6e('0x1c')](_0x1ab0f1);}return null;};}function patchUpdates(_0xb4d2e5){return function(_0x13dd9e){try{jsonpatch[_0x6f6e('0x1d')](_0x13dd9e,_0xb4d2e5,!![]);}catch(_0x262ab9){return BPromise[_0x6f6e('0x1e')](_0x262ab9);}return _0x13dd9e[_0x6f6e('0x1f')]();};}function saveUpdates(_0x156ce3,_0xc12e2){return function(_0x3a35d0){if(_0x3a35d0){return _0x3a35d0['update'](_0x156ce3)[_0x6f6e('0x20')](function(_0x123152){return _0x123152;});}return null;};}function removeEntity(_0x479feb,_0x3dff1b){return function(_0x4a0565){if(_0x4a0565){return _0x4a0565['destroy']()['then'](function(){_0x479feb[_0x6f6e('0x16')](0xcc)[_0x6f6e('0x21')]();});}};}function handleEntityNotFound(_0x1f9fe1,_0xf2cace){return function(_0x285b3c){if(!_0x285b3c){_0x1f9fe1[_0x6f6e('0x22')](0x194);}return _0x285b3c;};}function handleError(_0x376402,_0x14aaef){_0x14aaef=_0x14aaef||0x1f4;return function(_0xbbfbe1){logger[_0x6f6e('0x23')](_0xbbfbe1[_0x6f6e('0x24')]);if(_0xbbfbe1[_0x6f6e('0x25')]){delete _0xbbfbe1[_0x6f6e('0x25')];}_0x376402[_0x6f6e('0x16')](_0x14aaef)[_0x6f6e('0x26')](_0xbbfbe1);};}exports['index']=function(_0x51f7c6,_0x404da9){var _0x3172bd={},_0x4fbc90={},_0x58cd76={'count':0x0,'rows':[]};var _0x5c4cf3=_[_0x6f6e('0x27')](db[_0x6f6e('0x28')][_0x6f6e('0x29')],function(_0x39535e){return{'name':_0x39535e[_0x6f6e('0x2a')],'type':_0x39535e[_0x6f6e('0x2b')][_0x6f6e('0x2c')]};});_0x4fbc90[_0x6f6e('0x2d')]=_[_0x6f6e('0x27')](_0x5c4cf3,'name');_0x4fbc90[_0x6f6e('0x2e')]=_[_0x6f6e('0x2f')](_0x51f7c6['query']);_0x4fbc90[_0x6f6e('0x30')]=_[_0x6f6e('0x31')](_0x4fbc90['model'],_0x4fbc90[_0x6f6e('0x2e')]);_0x3172bd[_0x6f6e('0x32')]=_[_0x6f6e('0x31')](_0x4fbc90[_0x6f6e('0x2d')],qs[_0x6f6e('0x33')](_0x51f7c6[_0x6f6e('0x2e')][_0x6f6e('0x33')]));_0x3172bd[_0x6f6e('0x32')]=_0x3172bd[_0x6f6e('0x32')][_0x6f6e('0x34')]?_0x3172bd[_0x6f6e('0x32')]:_0x4fbc90['model'];if(!_0x51f7c6[_0x6f6e('0x2e')][_0x6f6e('0x35')]('nolimit')){_0x3172bd['limit']=qs[_0x6f6e('0x19')](_0x51f7c6['query'][_0x6f6e('0x19')]);_0x3172bd[_0x6f6e('0x17')]=qs[_0x6f6e('0x17')](_0x51f7c6[_0x6f6e('0x2e')][_0x6f6e('0x17')]);}_0x3172bd[_0x6f6e('0x36')]=qs['sort'](_0x51f7c6[_0x6f6e('0x2e')]['sort']);_0x3172bd[_0x6f6e('0x37')]=qs[_0x6f6e('0x30')](_[_0x6f6e('0x38')](_0x51f7c6['query'],_0x4fbc90['filters']),_0x5c4cf3);if(_0x51f7c6[_0x6f6e('0x2e')][_0x6f6e('0x39')]){_0x3172bd[_0x6f6e('0x37')]=_['merge'](_0x3172bd[_0x6f6e('0x37')],{'$or':_[_0x6f6e('0x27')](_0x5c4cf3,function(_0x9d762d){if(_0x9d762d[_0x6f6e('0x2b')]!==_0x6f6e('0x3a')){var _0x3829c0={};_0x3829c0[_0x9d762d[_0x6f6e('0x25')]]={'$like':'%'+_0x51f7c6[_0x6f6e('0x2e')]['filter']+'%'};return _0x3829c0;}})});}_0x3172bd=_[_0x6f6e('0x3b')]({},_0x3172bd,_0x51f7c6[_0x6f6e('0x3c')]);var _0xf9159e={'where':_0x3172bd[_0x6f6e('0x37')]};return db[_0x6f6e('0x28')][_0x6f6e('0x1a')](_0xf9159e)['then'](function(_0xc88798){_0x58cd76[_0x6f6e('0x1a')]=_0xc88798;if(_0x51f7c6[_0x6f6e('0x2e')]['includeAll']){_0x3172bd[_0x6f6e('0x3d')]=[{'all':!![]}];}return db[_0x6f6e('0x28')][_0x6f6e('0x3e')](_0x3172bd);})[_0x6f6e('0x20')](function(_0xeefa1f){_0x58cd76['rows']=_0xeefa1f;return _0x58cd76;})[_0x6f6e('0x20')](respondWithFilteredResult(_0x404da9,_0x3172bd))[_0x6f6e('0x3f')](handleError(_0x404da9,null));};exports['show']=function(_0xd52472,_0x4d49c0){var _0x496fd3={'raw':!![],'where':{'id':_0xd52472[_0x6f6e('0x40')]['id']}},_0x38313f={};_0x38313f[_0x6f6e('0x2d')]=_[_0x6f6e('0x2f')](db[_0x6f6e('0x28')]['rawAttributes']);_0x38313f[_0x6f6e('0x2e')]=_[_0x6f6e('0x2f')](_0xd52472[_0x6f6e('0x2e')]);_0x38313f[_0x6f6e('0x30')]=_['intersection'](_0x38313f[_0x6f6e('0x2d')],_0x38313f[_0x6f6e('0x2e')]);_0x496fd3['attributes']=_[_0x6f6e('0x31')](_0x38313f[_0x6f6e('0x2d')],qs[_0x6f6e('0x33')](_0xd52472['query']['fields']));_0x496fd3[_0x6f6e('0x32')]=_0x496fd3[_0x6f6e('0x32')][_0x6f6e('0x34')]?_0x496fd3['attributes']:_0x38313f[_0x6f6e('0x2d')];if(_0xd52472[_0x6f6e('0x2e')]['includeAll']){_0x496fd3[_0x6f6e('0x3d')]=[{'all':!![]}];}_0x496fd3=_['merge']({},_0x496fd3,_0xd52472[_0x6f6e('0x3c')]);return db[_0x6f6e('0x28')][_0x6f6e('0x41')](_0x496fd3)[_0x6f6e('0x20')](handleEntityNotFound(_0x4d49c0,null))['then'](respondWithResult(_0x4d49c0,null))[_0x6f6e('0x3f')](handleError(_0x4d49c0,null));};exports[_0x6f6e('0x42')]=function(_0x3a65e6,_0xee9470){return db['WhatsappTransferReport'][_0x6f6e('0x42')](_0x3a65e6[_0x6f6e('0x43')],{})['then'](respondWithResult(_0xee9470,0xc9))['catch'](handleError(_0xee9470,null));};exports[_0x6f6e('0x44')]=function(_0x523dfc,_0x1ee983){if(_0x523dfc['body']['id']){delete _0x523dfc['body']['id'];}return db[_0x6f6e('0x28')][_0x6f6e('0x41')]({'where':{'id':_0x523dfc[_0x6f6e('0x40')]['id']}})[_0x6f6e('0x20')](handleEntityNotFound(_0x1ee983,null))[_0x6f6e('0x20')](saveUpdates(_0x523dfc[_0x6f6e('0x43')],null))[_0x6f6e('0x20')](respondWithResult(_0x1ee983,null))[_0x6f6e('0x3f')](handleError(_0x1ee983,null));};exports[_0x6f6e('0x45')]=function(_0x287872,_0x2fc526){return db['WhatsappTransferReport']['find']({'where':{'id':_0x287872[_0x6f6e('0x40')]['id']}})[_0x6f6e('0x20')](handleEntityNotFound(_0x2fc526,null))[_0x6f6e('0x20')](removeEntity(_0x2fc526,null))['catch'](handleError(_0x2fc526,null));};exports['describe']=function(_0x5ef156,_0x3684ff){return db['WhatsappTransferReport'][_0x6f6e('0x46')]()['then'](respondWithResult(_0x3684ff,null))[_0x6f6e('0x3f')](handleError(_0x3684ff,null));};
\ No newline at end of file
index 20b5b24..3e0d22a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a79=['./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x4a79,0x19c));var _0x94a7=function(_0x301075,_0x33b785){_0x301075=_0x301075-0x0;var _0x1a04c5=_0x4a79[_0x301075];return _0x1a04c5;};'use strict';var _=require('lodash');var util=require(_0x94a7('0x0'));var logger=require(_0x94a7('0x1'))('api');var moment=require(_0x94a7('0x2'));var BPromise=require(_0x94a7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94a7('0x4'));var rimraf=require(_0x94a7('0x5'));var config=require('../../config/environment');var attributes=require(_0x94a7('0x6'));module[_0x94a7('0x7')]=function(_0x24e6d6,_0x217a4c){return _0x24e6d6[_0x94a7('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0x94a7('0x9'),'paranoid':![],'indexes':[{'name':_0x94a7('0xa'),'fields':[_0x94a7('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8abe=['bluebird','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4dca87,_0x44fdfc){var _0x30bb6b=function(_0x554c2d){while(--_0x554c2d){_0x4dca87['push'](_0x4dca87['shift']());}};_0x30bb6b(++_0x44fdfc);}(_0x8abe,0x8b));var _0xe8ab=function(_0x226314,_0x919efe){_0x226314=_0x226314-0x0;var _0x25f460=_0x8abe[_0x226314];return _0x25f460;};'use strict';var _=require(_0xe8ab('0x0'));var util=require(_0xe8ab('0x1'));var logger=require(_0xe8ab('0x2'))(_0xe8ab('0x3'));var moment=require(_0xe8ab('0x4'));var BPromise=require(_0xe8ab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8ab('0x6'));var config=require(_0xe8ab('0x7'));var attributes=require(_0xe8ab('0x8'));module['exports']=function(_0x5c41bb,_0x38ed1a){return _0x5c41bb[_0xe8ab('0x9')](_0xe8ab('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xe8ab('0xb'),'fields':[_0xe8ab('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 359da08..1502932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x573c=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x573c,0x1c7));var _0xc573=function(_0x1f578e,_0x54564b){_0x1f578e=_0x1f578e-0x0;var _0x58b710=_0x573c[_0x1f578e];return _0x58b710;};'use strict';var _=require(_0xc573('0x0'));var util=require(_0xc573('0x1'));var moment=require('moment');var BPromise=require(_0xc573('0x2'));var rs=require(_0xc573('0x3'));var fs=require('fs');var Redis=require(_0xc573('0x4'));var db=require(_0xc573('0x5'))['db'];var utils=require(_0xc573('0x6'));var logger=require(_0xc573('0x7'))(_0xc573('0x8'));var config=require(_0xc573('0x9'));var jayson=require(_0xc573('0xa'));var client=jayson[_0xc573('0xb')][_0xc573('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x25a6a3,_0x3a9705,_0x4e4ae4){return new BPromise(function(_0xdf2d90,_0x1acf4e){return client[_0xc573('0xd')](_0x25a6a3,_0x4e4ae4)[_0xc573('0xe')](function(_0x3c90b4){logger[_0xc573('0xf')](_0xc573('0x10'),_0x3a9705,_0xc573('0x11'));logger[_0xc573('0x12')](_0xc573('0x13'),_0x3a9705,'request\x20sent',JSON['stringify'](_0x3c90b4));if(_0x3c90b4[_0xc573('0x14')]){if(_0x3c90b4[_0xc573('0x14')][_0xc573('0x15')]===0x1f4){logger['error'](_0xc573('0x10'),_0x3a9705,_0x3c90b4[_0xc573('0x14')][_0xc573('0x16')]);return _0x1acf4e(_0x3c90b4[_0xc573('0x14')][_0xc573('0x16')]);}logger[_0xc573('0x14')](_0xc573('0x10'),_0x3a9705,_0x3c90b4['error'][_0xc573('0x16')]);return _0xdf2d90(_0x3c90b4[_0xc573('0x14')][_0xc573('0x16')]);}else{logger['info'](_0xc573('0x10'),_0x3a9705,_0xc573('0x11'));_0xdf2d90(_0x3c90b4[_0xc573('0x17')]['message']);}})[_0xc573('0x18')](function(_0x450650){logger[_0xc573('0x14')](_0xc573('0x10'),_0x3a9705,_0x450650);_0x1acf4e(_0x450650);});});}
\ No newline at end of file
+var _0xeb88=['request','then','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2bec6d,_0x199740){var _0x36c0f6=function(_0x5c335f){while(--_0x5c335f){_0x2bec6d['push'](_0x2bec6d['shift']());}};_0x36c0f6(++_0x199740);}(_0xeb88,0x1d8));var _0x8eb8=function(_0x3b7c4f,_0x44f72f){_0x3b7c4f=_0x3b7c4f-0x0;var _0x1f7f11=_0xeb88[_0x3b7c4f];return _0x1f7f11;};'use strict';var _=require(_0x8eb8('0x0'));var util=require(_0x8eb8('0x1'));var moment=require(_0x8eb8('0x2'));var BPromise=require(_0x8eb8('0x3'));var rs=require(_0x8eb8('0x4'));var fs=require('fs');var Redis=require(_0x8eb8('0x5'));var db=require(_0x8eb8('0x6'))['db'];var utils=require(_0x8eb8('0x7'));var logger=require(_0x8eb8('0x8'))(_0x8eb8('0x9'));var config=require(_0x8eb8('0xa'));var jayson=require(_0x8eb8('0xb'));var client=jayson[_0x8eb8('0xc')][_0x8eb8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28d031,_0x34588c,_0x5492ea){return new BPromise(function(_0x527106,_0x19b558){return client[_0x8eb8('0xe')](_0x28d031,_0x5492ea)[_0x8eb8('0xf')](function(_0x16267d){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x34588c,_0x8eb8('0x10'));logger[_0x8eb8('0x11')](_0x8eb8('0x12'),_0x34588c,_0x8eb8('0x10'),JSON[_0x8eb8('0x13')](_0x16267d));if(_0x16267d[_0x8eb8('0x14')]){if(_0x16267d['error'][_0x8eb8('0x15')]===0x1f4){logger[_0x8eb8('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x34588c,_0x16267d[_0x8eb8('0x14')]['message']);return _0x19b558(_0x16267d[_0x8eb8('0x14')][_0x8eb8('0x16')]);}logger['error'](_0x8eb8('0x17'),_0x34588c,_0x16267d['error'][_0x8eb8('0x16')]);return _0x527106(_0x16267d[_0x8eb8('0x14')][_0x8eb8('0x16')]);}else{logger[_0x8eb8('0x18')](_0x8eb8('0x17'),_0x34588c,'request\x20sent');_0x527106(_0x16267d[_0x8eb8('0x19')][_0x8eb8('0x16')]);}})[_0x8eb8('0x1a')](function(_0x402106){logger[_0x8eb8('0x14')](_0x8eb8('0x17'),_0x34588c,_0x402106);_0x19b558(_0x402106);});});}
\ No newline at end of file
index 1809a2f..38dc6db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e11=['Offline\x20apps:','status','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join'];(function(_0x4b8a26,_0x55f486){var _0xfaee7b=function(_0x58717f){while(--_0x58717f){_0x4b8a26['push'](_0x4b8a26['shift']());}};_0xfaee7b(++_0x55f486);}(_0x5e11,0x1c3));var _0x15e1=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0x5e11[_0x212a37];return _0x5d0bf9;};'use strict';var _=require(_0x15e1('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x15e1('0x1'));var checkLicense=require(_0x15e1('0x2'));var rpc=require(_0x15e1('0x3'));var config=require(_0x15e1('0x4'));var logger=require(_0x15e1('0x5'))(_0x15e1('0x6'));var pm2=require('./config/pm2');var pm2Config=require(_0x15e1('0x7'));var schedule=require('./config/schedule');var chat=require(_0x15e1('0x8'));var whatsapp=require(_0x15e1('0x9'));var transcribe=require(_0x15e1('0xa'));var provider=require(_0x15e1('0xb'));function main(){return db[_0x15e1('0xc')]['sync']()[_0x15e1('0xd')](function(){if(config[_0x15e1('0xe')]){return seedDb[_0x15e1('0xf')]();}})[_0x15e1('0xd')](function(){return checkLicense['default']();})[_0x15e1('0xd')](function(){return rpc[_0x15e1('0x10')]();})[_0x15e1('0xd')](function(_0x4e7409){logger[_0x15e1('0x11')](_0x4e7409);return chat[_0x15e1('0x12')]();})[_0x15e1('0xd')](function(){return whatsapp[_0x15e1('0x12')]();})[_0x15e1('0xd')](function(){return schedule[_0x15e1('0x12')]();})[_0x15e1('0xd')](function(){return transcribe[_0x15e1('0x12')]();})[_0x15e1('0xd')](function(){return provider[_0x15e1('0x12')]();})[_0x15e1('0xd')](function(_0x389cbc){logger['info'](_0x389cbc);return pm2[_0x15e1('0x12')](pm2Config);})[_0x15e1('0xd')](function(_0x3db265){var _0x56b623=_0x3db265[_0x15e1('0x13')](function(_0x4647a0){return typeof _0x4647a0['exitCode']===_0x15e1('0x14')&&_0x4647a0[_0x15e1('0x15')]>=0x0;});if(_0x56b623[_0x15e1('0x16')]>0x0){throw new Error(_0x56b623[_0x15e1('0x16')]+_0x15e1('0x17')+_[_0x15e1('0x18')](_0x56b623,function(_0x376500){return'\x22'+_0x376500[_0x15e1('0x19')][_0x15e1('0x1a')]+'\x22';}));}logger[_0x15e1('0x11')](_0x15e1('0x1b'),_[_0x15e1('0x18')](_[_0x15e1('0x13')](_0x3db265,{'status':_0x15e1('0x1c')}),_0x15e1('0x1a'))[_0x15e1('0x1d')]());logger['info'](_0x15e1('0x1e'),_[_0x15e1('0x18')](_['filter'](_0x3db265,function(_0x4712fe){return _0x4712fe[_0x15e1('0x1f')]!==_0x15e1('0x1c');}),_0x15e1('0x1a'))['join']()||'None');console[_0x15e1('0x20')](_0x15e1('0x21'));})[_0x15e1('0x22')](function(_0x5a95f3){console[_0x15e1('0x20')](_0x15e1('0x23'),_0x5a95f3);logger[_0x15e1('0x24')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5a95f3);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0xe4b8=['./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','default','listen','then','info','start','filter','exitCode','\x20processes\x20failed\x20at\x20startup:\x20','name','online','join','Offline\x20apps:','map','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xe4b8,0x179));var _0x8e4b=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xe4b8[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x8e4b('0x0'));var db=require(_0x8e4b('0x1'))['db'];var seedDb=require(_0x8e4b('0x2'));var checkLicense=require(_0x8e4b('0x3'));var rpc=require(_0x8e4b('0x4'));var config=require(_0x8e4b('0x5'));var logger=require(_0x8e4b('0x6'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x8e4b('0x7'));var schedule=require(_0x8e4b('0x8'));var chat=require(_0x8e4b('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x8e4b('0xa'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x8e4b('0xb')]['sync']()['then'](function(){if(config['seedDB']){return seedDb['default']();}})['then'](function(){return checkLicense[_0x8e4b('0xc')]();})['then'](function(){return rpc[_0x8e4b('0xd')]();})[_0x8e4b('0xe')](function(_0x57bbcb){logger[_0x8e4b('0xf')](_0x57bbcb);return chat[_0x8e4b('0x10')]();})[_0x8e4b('0xe')](function(){return whatsapp['start']();})[_0x8e4b('0xe')](function(){return schedule[_0x8e4b('0x10')]();})[_0x8e4b('0xe')](function(){return transcribe[_0x8e4b('0x10')]();})[_0x8e4b('0xe')](function(){return provider[_0x8e4b('0x10')]();})[_0x8e4b('0xe')](function(_0x211bae){logger['info'](_0x211bae);return pm2['start'](pm2Config);})[_0x8e4b('0xe')](function(_0x261e76){var _0x19e83d=_0x261e76[_0x8e4b('0x11')](function(_0x276d96){return typeof _0x276d96['exitCode']==='number'&&_0x276d96[_0x8e4b('0x12')]>=0x0;});if(_0x19e83d['length']>0x0){throw new Error(_0x19e83d['length']+_0x8e4b('0x13')+_['map'](_0x19e83d,function(_0x38cbf5){return'\x22'+_0x38cbf5['pm2_env'][_0x8e4b('0x14')]+'\x22';}));}logger[_0x8e4b('0xf')]('Online\x20apps:',_['map'](_[_0x8e4b('0x11')](_0x261e76,{'status':_0x8e4b('0x15')}),_0x8e4b('0x14'))[_0x8e4b('0x16')]());logger[_0x8e4b('0xf')](_0x8e4b('0x17'),_[_0x8e4b('0x18')](_[_0x8e4b('0x11')](_0x261e76,function(_0x9eeb68){return _0x9eeb68[_0x8e4b('0x19')]!==_0x8e4b('0x15');}),_0x8e4b('0x14'))['join']()||_0x8e4b('0x1a'));console[_0x8e4b('0x1b')]('App\x20Ready!');})[_0x8e4b('0x1c')](function(_0x1fb12d){console['log'](_0x8e4b('0x1d'),_0x1fb12d);logger[_0x8e4b('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x1fb12d);process[_0x8e4b('0x1f')](0x1);});}main();
\ No newline at end of file
index 082abec..862c1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x2110ec,_0x35886a){var _0x482103=function(_0x1cba7e){while(--_0x1cba7e){_0x2110ec['push'](_0x2110ec['shift']());}};_0x482103(++_0x35886a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('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[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});}
\ No newline at end of file
+var _0x54ef=['../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','moment','secrets','session','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','headers','authorization','Basic','User','find','name','authenticate','Wrong\x20credentials.','catch','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','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.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','payload','options','toString','hex','floor','HS512','../../mysqldb','../../config/environment'];(function(_0x7fd9ce,_0x5ed983){var _0xc7a465=function(_0x34142e){while(--_0x34142e){_0x7fd9ce['push'](_0x7fd9ce['shift']());}};_0xc7a465(++_0x5ed983);}(_0x54ef,0x112));var _0xf54e=function(_0x5302a7,_0x33ebcc){_0x5302a7=_0x5302a7-0x0;var _0x354de3=_0x54ef[_0x5302a7];return _0x354de3;};'use strict';var db=require(_0xf54e('0x0'))['db'];var config=require(_0xf54e('0x1'));var hardwareConf=require(_0xf54e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf54e('0x3'));var _=require(_0xf54e('0x4'));var jwt=require(_0xf54e('0x5'));var expressJwt=require(_0xf54e('0x6'));var compose=require(_0xf54e('0x7'));var basicAuth=require(_0xf54e('0x8'));var crypto=require(_0xf54e('0x9'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xf54e('0xa'));var validateJwt=expressJwt({'secret':config[_0xf54e('0xb')][_0xf54e('0xc')]});var userAttributes=['id','role',_0xf54e('0xd'),'name',_0xf54e('0xe'),_0xf54e('0xf'),'userpic',_0xf54e('0x10'),_0xf54e('0x11'),_0xf54e('0x12'),_0xf54e('0x13'),'mailPause',_0xf54e('0x14'),_0xf54e('0x15'),_0xf54e('0x16'),_0xf54e('0x17'),'showWebBar',_0xf54e('0x18'),'lastPauseAt','crudPermissions',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'phoneBarAutoAnswerDelay',_0xf54e('0x1d'),_0xf54e('0x1e'),_0xf54e('0x1f'),_0xf54e('0x20'),'phoneBarExpires',_0xf54e('0x21'),_0xf54e('0x22'),_0xf54e('0x23'),'hotdesk','interface',_0xf54e('0x24'),_0xf54e('0x25'),_0xf54e('0x26'),_0xf54e('0x27'),_0xf54e('0x28'),_0xf54e('0x29'),_0xf54e('0x2a'),_0xf54e('0x2b'),_0xf54e('0x2c'),_0xf54e('0x2d'),_0xf54e('0x2e'),'emailAutoanswer','emailAutoanswerDelay',_0xf54e('0x2f'),'smsAutoanswerDelay',_0xf54e('0x30'),_0xf54e('0x31'),_0xf54e('0x32'),_0xf54e('0x33'),_0xf54e('0x34'),_0xf54e('0x35')];exports[_0xf54e('0x36')]=function(){return this[_0xf54e('0x37')](!![])[_0xf54e('0x38')](function(_0x5f9eea,_0x1c58bd,_0x5b83df){if(_0x5f9eea[_0xf54e('0x39')]){_0x5b83df();}else{return db['ChatInteraction'][_0xf54e('0x3a')]({'where':{'id':_0x5f9eea[_0xf54e('0x3b')]['id']},'attributes':['id',_0xf54e('0x3c'),_0xf54e('0x3d')],'raw':!![]})[_0xf54e('0x3e')](function(_0x160160){if(_0x160160&&_0x160160[_0xf54e('0x3c')]){return _0x1c58bd[_0xf54e('0x3f')](_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?0x195:0x193)[_0xf54e('0x41')]({'message':_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?'Unmanaged.':_0xf54e('0x42')});}else{_0x5b83df();}})['catch'](function(_0x282c63){_0x5b83df(_0x282c63);});}});};exports['isAuthenticated']=function isAuthenticated(_0x15b888){return compose()[_0xf54e('0x38')](function(_0x21ba00,_0xa13cd0,_0x25b643){var _0x3993e4;if(_0x21ba00[_0xf54e('0x43')]['authorization']){if(_['startsWith'](_0x21ba00[_0xf54e('0x43')][_0xf54e('0x44')],_0xf54e('0x45'))){var _0x16d00f=basicAuth(_0x21ba00);db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'name':_0x16d00f[_0xf54e('0x48')]}})[_0xf54e('0x3e')](function(_0x3ae704){if(!_0x3ae704||!_0x3ae704[_0xf54e('0x49')](_0x16d00f['pass'])){return _0xa13cd0['status'](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x4a')});}_0x21ba00['user']={'id':_0x3ae704['id']};_0x25b643();})[_0xf54e('0x4b')](function(_0x82e313){_0x25b643(_0x82e313);});}else if(_[_0xf54e('0x4c')](_0x21ba00[_0xf54e('0x43')]['authorization'],'Bearer')){validateJwt(_0x21ba00,_0xa13cd0,_0x25b643);}else{if(_0x15b888){_0x25b643();}else{return _0xa13cd0['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x4d')});}}}else if(_0x21ba00[_0xf54e('0x4e')][_0xf54e('0x4f')]){try{var _0x29dc39={'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x21ba00['query']['apikey'],_0x29dc39)[_0xf54e('0x3e')](function(_0x734187){return db['User']['find']({'where':{'id':_0x734187[_0xf54e('0x51')]}})[_0xf54e('0x3e')](function(_0x173e6c){_0x3993e4=_0x173e6c;return db['Setting'][_0xf54e('0x3a')]({'where':{'id':0x1},'attributes':[_0xf54e('0x52'),'blockDuration'],'raw':!![]});})[_0xf54e('0x3e')](function(_0x6e5bdf){if(!_0x3993e4||!_[_0xf54e('0x53')](_0x3993e4[_0xf54e('0x54')],_0x734187[_0xf54e('0x55')])){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3993e4[_0xf54e('0x56')]){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3993e4[_0xf54e('0x57')]){if(_0x6e5bdf[_0xf54e('0x58')]>0x0){if(moment(_0x3993e4[_0xf54e('0x59')])[_0xf54e('0x5a')](_0x6e5bdf[_0xf54e('0x58')],_0xf54e('0x5b'))>moment()){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}else{return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}_0x21ba00[_0xf54e('0x39')]={'id':_0x3993e4['id']};_0x25b643();});})[_0xf54e('0x4b')](function(){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x533423){_0x25b643(_0x533423);}}else if(_0x15b888){_0x25b643();}else{return _0xa13cd0[_0xf54e('0x3f')](0x193)[_0xf54e('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf54e('0x38')](function(_0x311ce1,_0x381c03,_0x4f61d7){if(_0x311ce1[_0xf54e('0x39')]){db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'id':_0x311ce1[_0xf54e('0x39')]['id']},'attributes':userAttributes})[_0xf54e('0x3e')](function(_0x143a39){if(!_0x143a39){return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5d')});}_0x311ce1['user']=_0x143a39;_0x4f61d7();})[_0xf54e('0x4b')](function(_0x3447fd){_0x4f61d7(_0x3447fd);});}else if(_0x15b888){_0x4f61d7();}else{return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5e')});}});};exports[_0xf54e('0x5f')]=function canUpdate(){return compose()['use'](function(_0x23a4a1,_0x59af72,_0x1d16e0){return licenseUtil['getLicense']()[_0xf54e('0x3e')](function(_0x331b16){if(_0x331b16[_0xf54e('0x60')]){_0x1d16e0();}else{return _0x59af72['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0x32fb46){_0x1d16e0(_0x32fb46);});});};exports[_0xf54e('0x62')]=function isWebrtcLicence(){return compose()['use'](function(_0x427799,_0x297737,_0x346bb4){return licenseUtil[_0xf54e('0x63')]()['then'](function(_0x1bdb5a){if(_0x1bdb5a[_0xf54e('0x64')]){_0x346bb4();}else{return _0x297737['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0xca0141){_0x346bb4(_0xca0141);});});};exports['isMiddleware']=function(_0x196e68,_0x2b645e,_0x2527f6){_0x196e68[_0xf54e('0x65')]=!![];return _0x2527f6();};exports[_0xf54e('0x66')]=function signToken(_0x3237ef){return signJwt(_0x3237ef);};exports[_0xf54e('0x67')]=function(_0xd7b0c5,_0x15bfef){if(!_0xd7b0c5[_0xf54e('0x39')]){return _0x15bfef[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x68')});}var _0x2de1fe={'payload':{'id':_0xd7b0c5[_0xf54e('0x39')]['id'],'role':_0xd7b0c5[_0xf54e('0x39')][_0xf54e('0x69')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2de1fe)[_0xf54e('0x3e')](function(_0x21fd80){_0x15bfef[_0xf54e('0x6a')]('motion.token',_0x21fd80);_0x15bfef['redirect'](_0xf54e('0x6b'));})[_0xf54e('0x4b')](function(_0x45861b){return _0x15bfef[_0xf54e('0x3f')](0x1f4)[_0xf54e('0x6c')](_0x45861b);});};exports[_0xf54e('0x6d')]=function(_0x22763f){if(_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x54')])||_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x6f')])){return null;}else{return createJwt(_0x22763f);}};exports['generateApiKey']=function(_0x2aacf6){_0x2aacf6[_0xf54e('0x54')]=generateNonce();_0x2aacf6[_0xf54e('0x6f')]=generateIssuedAt();return createJwt(_0x2aacf6);};exports[_0xf54e('0x70')]=function(_0x1b8f16,_0x30f53b){var _0x18a25f=_0x1b8f16['query'][_0xf54e('0x4f')];if(_0x18a25f){var _0x5fabd2={'nonce':_0x30f53b[_0xf54e('0x54')],'iat':_0x30f53b['apiKeyIat'],'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x18a25f,_0x5fabd2)[_0xf54e('0x3e')](function(){return generateApiKey(_0x30f53b);});}else{throw{'message':_0xf54e('0x71')};}};exports[_0xf54e('0x72')]=function(_0x5b882f){var _0x1d8ccf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1d8ccf[_0xf54e('0x73')](_0x5b882f))throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0xf54e('0x76'));return;};exports[_0xf54e('0x77')]=function(_0x21d485,_0x55d57f,_0x55de5c){var _0x4270e1=encryptor[_0xf54e('0x78')](_0x55d57f)['split'](',');for(var _0x29743e=0x0;_0x29743e<_0x55de5c;_0x29743e++){if(!_0x4270e1[_0x29743e])break;if(_0x21d485['toLowerCase']()===_0x4270e1[_0x29743e][_0xf54e('0x79')]()){var _0x528a64=util[_0xf54e('0x7a')](_0xf54e('0x7b'),_0x55de5c);if(_0x55de5c===0x1){_0x528a64=_0xf54e('0x7c');}throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0x528a64);}}return;};exports[_0xf54e('0x7d')]=function(_0x556e55,_0x479572){var _0x79345=_0x479572?encryptor[_0xf54e('0x78')](_0x479572)['split'](','):[];if(_0x79345['length']===0x5){_0x79345[_0xf54e('0x7e')](-0x1,0x1);}_0x79345['unshift'](_0x556e55);return encryptor[_0xf54e('0x7f')](_0x79345[_0xf54e('0x80')](','));};function signJwt(_0x47596c){var _0x2b11f8=BPromise[_0xf54e('0x81')](jwt[_0xf54e('0x82')],{'context':jwt});var _0x3bf476=_0x47596c[_0xf54e('0x83')]||config[_0xf54e('0xb')][_0xf54e('0xc')];return new BPromise(function(_0x1f9dad,_0x2c6d0e){_0x2b11f8(_0x47596c[_0xf54e('0x84')],_0x3bf476,_0x47596c[_0xf54e('0x85')])['then'](function(_0x302f3d){_0x1f9dad(_0x302f3d);})[_0xf54e('0x4b')](function(_0xb7ff4d){_0x2c6d0e(_0xb7ff4d);});});}function verifyJwt(_0x11908b,_0x1e4c0d,_0x494629){var _0xf50b1b=BPromise[_0xf54e('0x81')](jwt['verify'],{'context':jwt});var _0x51ec35=_0x494629||config[_0xf54e('0xb')]['session'];return new BPromise(function(_0x26322a,_0x39c5eb){_0xf50b1b(_0x11908b,_0x51ec35,_0x1e4c0d)[_0xf54e('0x3e')](function(_0x9789b9){_0x26322a(_0x9789b9);})['catch'](function(_0x2ecda1){_0x39c5eb(_0x2ecda1);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xf54e('0x86')](_0xf54e('0x87'));}function generateIssuedAt(){return Math[_0xf54e('0x88')](Date['now']()/0x3e8)[_0xf54e('0x86')]();}function createJwt(_0x504ec7){var _0x3f7224={'payload':{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce']},'options':{'algorithm':_0xf54e('0x89'),'subject':_0x504ec7['id']['toString'](),'issuer':hardwareConf[_0xf54e('0x50')](),'audience':hardwareConf[_0xf54e('0x50')]()}};return signJwt(_0x3f7224)[_0xf54e('0x3e')](function(_0x38405c){return{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce'],'token':_0x38405c};});}
\ No newline at end of file
index f24e0f9..b16aa51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb87=['bluebird','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','final','binary','write','end','close','unlink','decryptFile','createDecipher','update','encryptString','secret','utf8','base64','decryptString'];(function(_0x368371,_0x25bbb1){var _0x28da02=function(_0xe0eac3){while(--_0xe0eac3){_0x368371['push'](_0x368371['shift']());}};_0x28da02(++_0x25bbb1);}(_0xeb87,0x1c7));var _0x7eb8=function(_0x193f01,_0xedaeac){_0x193f01=_0x193f01-0x0;var _0x4ab354=_0xeb87[_0x193f01];return _0x4ab354;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x7eb8('0x0'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0x7eb8('0x1'))(_0x7eb8('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x7eb8('0x3')][_0x7eb8('0x4')],'algorithm':_0x7eb8('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0x7eb8('0x6')]&&config[_0x7eb8('0x6')][_0x7eb8('0x7')]){var isSupported=isAlgorithmSupported(config[_0x7eb8('0x6')]['algorithm']);if(isSupported){fileOptions[_0x7eb8('0x7')]=config[_0x7eb8('0x6')][_0x7eb8('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x7eb8('0x8')](',\x20');logger[_0x7eb8('0x9')](config['encrypt'][_0x7eb8('0x7')],_0x7eb8('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x1badaa){return AES_SUPPORTED_RX[_0x7eb8('0xb')](_0x1badaa);}function getSupportedCiphers(){return crypto[_0x7eb8('0xc')]()[_0x7eb8('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x1c455d){return getSupportedCiphers()[_0x7eb8('0xe')](_0x1c455d)>-0x1;}function combineOptions(_0x484ebe){var _0x1defcb={};for(var _0x4adb01 in fileOptions){if(fileOptions['hasOwnProperty'](_0x4adb01)){_0x1defcb[_0x4adb01]=fileOptions[_0x4adb01];}}if(_0x484ebe){for(var _0x1c3207 in _0x484ebe){if(_0x484ebe[_0x7eb8('0xf')](_0x1c3207)){_0x1defcb[_0x1c3207]=_0x484ebe[_0x1c3207];}}}return _0x1defcb;}exports[_0x7eb8('0x10')]=function(_0x1c1ed8,_0x270545,_0x512829,_0x52a23c){return new BPromise(function(_0x5195ef,_0x244187){_0x52a23c=combineOptions(_0x52a23c);var _0xd926b2=new Buffer(_0x512829);var _0xd75b65=fs[_0x7eb8('0x11')](_0x1c1ed8);var _0x19aab1=fs[_0x7eb8('0x12')](_0x270545);var _0x3851fa=crypto[_0x7eb8('0x13')](_0x52a23c[_0x7eb8('0x7')],_0xd926b2);_0xd75b65['on'](_0x7eb8('0x14'),function(_0x4bb4a3){var _0x512d89=new Buffer(_0x3851fa['update'](_0x4bb4a3),'binary');_0x19aab1['write'](_0x512d89);});_0xd75b65['on']('end',function(){try{var _0x1ae5af=new Buffer(_0x3851fa[_0x7eb8('0x15')](_0x7eb8('0x16')),_0x7eb8('0x16'));_0x19aab1[_0x7eb8('0x17')](_0x1ae5af);_0x19aab1[_0x7eb8('0x18')]();_0x19aab1['on'](_0x7eb8('0x19'),function(){return _0x5195ef(_0x270545);});}catch(_0x3190ee){fs[_0x7eb8('0x1a')](_0x270545);return _0x244187(_0x3190ee);}});});};exports[_0x7eb8('0x1b')]=function(_0x4f9f8d,_0x2adb86,_0x1f670b,_0x11fd05){return new BPromise(function(_0x3e0175,_0x4d4856){_0x11fd05=combineOptions(_0x11fd05);var _0x3ddf0c=new Buffer(_0x1f670b);var _0x462b4f=fs['createReadStream'](_0x4f9f8d);var _0x448fa0=fs[_0x7eb8('0x12')](_0x2adb86);var _0x174487=crypto[_0x7eb8('0x1c')](_0x11fd05['algorithm'],_0x3ddf0c);_0x462b4f['on'](_0x7eb8('0x14'),function(_0xf1d3f1){var _0x2a4954=new Buffer(_0x174487[_0x7eb8('0x1d')](_0xf1d3f1),_0x7eb8('0x16'));_0x448fa0[_0x7eb8('0x17')](_0x2a4954);});_0x462b4f['on'](_0x7eb8('0x18'),function(){try{var _0x279525=new Buffer(_0x174487[_0x7eb8('0x15')](_0x7eb8('0x16')),_0x7eb8('0x16'));_0x448fa0[_0x7eb8('0x17')](_0x279525);_0x448fa0[_0x7eb8('0x18')]();_0x448fa0['on'](_0x7eb8('0x19'),function(){return _0x3e0175(_0x2adb86);});}catch(_0x56ff42){fs[_0x7eb8('0x1a')](_0x2adb86);return _0x4d4856(_0x56ff42);}});});};exports[_0x7eb8('0x1e')]=function(_0x225249,_0x2fae12,_0x1241d7){var _0x4f45f4=_0x1241d7||stringOptions[_0x7eb8('0x7')];var _0x1d4181=_0x2fae12||stringOptions[_0x7eb8('0x1f')];var _0x53290a=crypto['createCipher'](_0x4f45f4,_0x1d4181);var _0x3b7552=_0x53290a[_0x7eb8('0x1d')](_0x225249,_0x7eb8('0x20'),_0x7eb8('0x21'));_0x3b7552+=_0x53290a[_0x7eb8('0x15')]('base64');return _0x3b7552;};exports[_0x7eb8('0x22')]=function(_0x5d4366,_0x15f7d2,_0x31f70f){var _0x56808f=_0x31f70f||stringOptions[_0x7eb8('0x7')];var _0x175e01=_0x15f7d2||stringOptions[_0x7eb8('0x1f')];var _0x3aca3a=crypto[_0x7eb8('0x1c')](_0x56808f,_0x175e01);var _0x19e199=_0x3aca3a[_0x7eb8('0x1d')](_0x5d4366,_0x7eb8('0x21'),_0x7eb8('0x20'));_0x19e199+=_0x3aca3a[_0x7eb8('0x15')](_0x7eb8('0x20'));return _0x19e199;};
\ No newline at end of file
+var _0x998d=['secret','utf8','final','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','write','binary','end','close','decryptFile','createDecipher','update','unlink','encryptString'];(function(_0x57e1b1,_0x193d66){var _0x34249d=function(_0x5969cc){while(--_0x5969cc){_0x57e1b1['push'](_0x57e1b1['shift']());}};_0x34249d(++_0x193d66);}(_0x998d,0x19c));var _0xd998=function(_0x122cab,_0x34353b){_0x122cab=_0x122cab-0x0;var _0x47694f=_0x998d[_0x122cab];return _0x47694f;};'use strict';var crypto=require(_0xd998('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xd998('0x1'));var config=require(_0xd998('0x2'));var logger=require(_0xd998('0x3'))(_0xd998('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xd998('0x5')][_0xd998('0x6')],'algorithm':_0xd998('0x7')};const fileOptions={'algorithm':_0xd998('0x8')};if(config[_0xd998('0x9')]&&config['encrypt'][_0xd998('0xa')]){var isSupported=isAlgorithmSupported(config[_0xd998('0x9')][_0xd998('0xa')]);if(isSupported){fileOptions[_0xd998('0xa')]=config['encrypt'][_0xd998('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xd998('0xb')](',\x20');logger['error'](config[_0xd998('0x9')][_0xd998('0xa')],_0xd998('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x33fb02){return AES_SUPPORTED_RX[_0xd998('0xd')](_0x33fb02);}function getSupportedCiphers(){return crypto[_0xd998('0xe')]()[_0xd998('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x275536){return getSupportedCiphers()[_0xd998('0x10')](_0x275536)>-0x1;}function combineOptions(_0xd74c7b){var _0x17b61a={};for(var _0x196d7f in fileOptions){if(fileOptions[_0xd998('0x11')](_0x196d7f)){_0x17b61a[_0x196d7f]=fileOptions[_0x196d7f];}}if(_0xd74c7b){for(var _0xc286e8 in _0xd74c7b){if(_0xd74c7b[_0xd998('0x11')](_0xc286e8)){_0x17b61a[_0xc286e8]=_0xd74c7b[_0xc286e8];}}}return _0x17b61a;}exports[_0xd998('0x12')]=function(_0x222959,_0xdfcff7,_0x56d25b,_0x1f813d){return new BPromise(function(_0x21592e,_0x1cc1be){_0x1f813d=combineOptions(_0x1f813d);var _0x48a00b=new Buffer(_0x56d25b);var _0x61e363=fs[_0xd998('0x13')](_0x222959);var _0x2a70d1=fs[_0xd998('0x14')](_0xdfcff7);var _0x5d8a6e=crypto[_0xd998('0x15')](_0x1f813d[_0xd998('0xa')],_0x48a00b);_0x61e363['on'](_0xd998('0x16'),function(_0x3addda){var _0x498f33=new Buffer(_0x5d8a6e['update'](_0x3addda),'binary');_0x2a70d1[_0xd998('0x17')](_0x498f33);});_0x61e363['on']('end',function(){try{var _0xab97a9=new Buffer(_0x5d8a6e['final']('binary'),_0xd998('0x18'));_0x2a70d1[_0xd998('0x17')](_0xab97a9);_0x2a70d1[_0xd998('0x19')]();_0x2a70d1['on'](_0xd998('0x1a'),function(){return _0x21592e(_0xdfcff7);});}catch(_0x4b6126){fs['unlink'](_0xdfcff7);return _0x1cc1be(_0x4b6126);}});});};exports[_0xd998('0x1b')]=function(_0x483ccd,_0x3e23e0,_0x152ec2,_0x1d2062){return new BPromise(function(_0x2610b7,_0x27a49c){_0x1d2062=combineOptions(_0x1d2062);var _0x12e18f=new Buffer(_0x152ec2);var _0x26d1ac=fs[_0xd998('0x13')](_0x483ccd);var _0x4625ad=fs[_0xd998('0x14')](_0x3e23e0);var _0x40df63=crypto[_0xd998('0x1c')](_0x1d2062[_0xd998('0xa')],_0x12e18f);_0x26d1ac['on'](_0xd998('0x16'),function(_0x2a8bd4){var _0x460179=new Buffer(_0x40df63[_0xd998('0x1d')](_0x2a8bd4),'binary');_0x4625ad[_0xd998('0x17')](_0x460179);});_0x26d1ac['on'](_0xd998('0x19'),function(){try{var _0x233fe2=new Buffer(_0x40df63['final'](_0xd998('0x18')),_0xd998('0x18'));_0x4625ad['write'](_0x233fe2);_0x4625ad['end']();_0x4625ad['on'](_0xd998('0x1a'),function(){return _0x2610b7(_0x3e23e0);});}catch(_0x273078){fs[_0xd998('0x1e')](_0x3e23e0);return _0x27a49c(_0x273078);}});});};exports[_0xd998('0x1f')]=function(_0x5efacd,_0x28c782,_0x4918ae){var _0x4dcfe5=_0x4918ae||stringOptions['algorithm'];var _0x2c7339=_0x28c782||stringOptions[_0xd998('0x20')];var _0x9275d3=crypto[_0xd998('0x15')](_0x4dcfe5,_0x2c7339);var _0x394b93=_0x9275d3[_0xd998('0x1d')](_0x5efacd,_0xd998('0x21'),'base64');_0x394b93+=_0x9275d3[_0xd998('0x22')](_0xd998('0x23'));return _0x394b93;};exports[_0xd998('0x24')]=function(_0x1b77fb,_0x36e784,_0x2a1005){var _0x4a5893=_0x2a1005||stringOptions[_0xd998('0xa')];var _0x27b2a1=_0x36e784||stringOptions[_0xd998('0x20')];var _0x10e3e2=crypto[_0xd998('0x1c')](_0x4a5893,_0x27b2a1);var _0x64e5d5=_0x10e3e2[_0xd998('0x1d')](_0x1b77fb,_0xd998('0x23'),_0xd998('0x21'));_0x64e5d5+=_0x10e3e2[_0xd998('0x22')](_0xd998('0x21'));return _0x64e5d5;};
\ No newline at end of file
index 8d94b9e..ccef79f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x734c=['csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','SELECT','Empty','length','num','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s'];(function(_0x474cb8,_0x373820){var _0x134e37=function(_0x48c4f1){while(--_0x48c4f1){_0x474cb8['push'](_0x474cb8['shift']());}};_0x134e37(++_0x373820);}(_0x734c,0x18a));var _0xc734=function(_0x2ad268,_0x49c5e0){_0x2ad268=_0x2ad268-0x0;var _0x426764=_0x734c[_0x2ad268];return _0x426764;};'use strict';var util=require(_0xc734('0x0'));var path=require(_0xc734('0x1'));var _=require(_0xc734('0x2'));var csv=require(_0xc734('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xc734('0x4'));var rimraf=require(_0xc734('0x5'));var db=require(_0xc734('0x6'))['db'];var dbH=require('../../mysqldb')[_0xc734('0x7')];var logger=require('../../config/logger')(_0xc734('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xc734('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xc734('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x272fbc,_0x325715){var _0x216358={'status':_0x272fbc};var _0x1b1b17={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x325715){_0x216358['savename']=_0x325715;}return db['AnalyticExtractedReport'][_0xc734('0xa')](_0x216358,_0x1b1b17);}function main(){var _0x219189=0x1388;var _0x27b05f;logger[_0xc734('0xb')](util[_0xc734('0xc')](_0xc734('0xd'),EXTRACTED_REPORT_ID,_0xc734('0xe')));return db['Setting'][_0xc734('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc734('0x10'),_0xc734('0x11')]})[_0xc734('0x12')](function(_0x275621){if(_0x275621){_0x27b05f=_0x275621;_0x219189=_0x27b05f['splitSizeCsv']||0x1388;}})[_0xc734('0x12')](function(){return dbH['sequelize']['query'](util[_0xc734('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xc734('0x13')]['QueryTypes'][_0xc734('0x14')]});})['then'](function(_0x38fc7d){if(!_0x38fc7d[0x0]['num']){return analyticExtractedReport(_0xc734('0x15'));}var _0xf996a5=[];var _0x51f375=0x0;if(_0x27b05f[_0xc734('0x10')]){if(_0x38fc7d&&_0x38fc7d[_0xc734('0x16')]){var _0x55e734=_['range'](_0x38fc7d[0x0][_0xc734('0x17')]/_0x219189);var _0x1e8be7=Number[_0xc734('0x18')](_0x38fc7d[0x0][_0xc734('0x17')]/_0x219189)?_0x38fc7d[0x0][_0xc734('0x17')]%_0x219189:0x0;_0x55e734[_0xc734('0x19')](function(_0x5f4192){if(_0x5f4192>0x0){_0x51f375+=_0x219189;}_0xf996a5['push'](dbH['sequelize'][_0xc734('0x1a')](util[_0xc734('0xc')](_0xc734('0x1b'),QUERY,_0x219189,_0x51f375),{'type':dbH[_0xc734('0x13')]['QueryTypes'][_0xc734('0x14')]}));});if(_0x1e8be7>0x0){_0x51f375+=_0x219189;_0xf996a5[_0xc734('0x1c')](dbH['sequelize'][_0xc734('0x1a')](util[_0xc734('0xc')](_0xc734('0x1b'),QUERY,_0x1e8be7,_0x51f375),{'type':dbH['sequelize'][_0xc734('0x1d')][_0xc734('0x14')]}));}}}else{_0xf996a5[_0xc734('0x1c')](dbH[_0xc734('0x13')][_0xc734('0x1a')](QUERY,{'type':dbH[_0xc734('0x13')]['QueryTypes'][_0xc734('0x14')]}));}var _0x5d3a3d=path[_0xc734('0x1e')](PATH);var _0x218298=path[_0xc734('0x1f')](PATH,_0xc734('0x20'));var _0x5e2f8b=_0x27b05f['split']&&_0xf996a5['length']>0x1;var _0x2a5807=[];if(!fs[_0xc734('0x21')](path[_0xc734('0x22')](_0x5d3a3d,_0x218298))&&_0x5e2f8b){fs[_0xc734('0x23')](path[_0xc734('0x22')](_0x5d3a3d,_0x218298));}return BPromise[_0xc734('0x24')](_0xf996a5,function(_0x39fc81){_0x2a5807['push'](_0x39fc81);})[_0xc734('0x12')](function(){for(var _0x338003=0x0;_0x338003<_0x2a5807[_0xc734('0x16')];_0x338003+=0x1){var _0x2d9731;var _0x40dfa6=_0x2a5807[_0x338003];if(_0x5e2f8b){_0x2d9731=path[_0xc734('0x22')](_0x5d3a3d,_0x218298,util['format'](_0xc734('0x25'),_0x218298,_0x338003,_0xc734('0x26')));}else{_0x2d9731=path[_0xc734('0x22')](_0x5d3a3d,util[_0xc734('0xc')](_0xc734('0x27'),_0x218298,'csv'));}fs[_0xc734('0x28')](_0x2d9731,csv(_0x40dfa6));}})['then'](function(){if(_0x5e2f8b){return new Promise(function(_0x2f97fc){zipdir(path[_0xc734('0x22')](_0x5d3a3d,_0x218298),{'saveTo':path['join'](_0x5d3a3d,util[_0xc734('0xc')]('%s.%s',_0x218298,_0xc734('0x29')))},function(_0x258465,_0x58e88b){rimraf(path[_0xc734('0x22')](_0x5d3a3d,_0x218298),function(){});_0x2f97fc(_0xc734('0x2a'));});});}})[_0xc734('0x12')](function(){logger['info'](util[_0xc734('0xc')](_0xc734('0x2b'),EXTRACTED_REPORT_ID,_0xc734('0xe')));return analyticExtractedReport('Completed',_0x5e2f8b?util[_0xc734('0xc')](_0xc734('0x27'),_0x218298,_0x5e2f8b?_0xc734('0x29'):'csv'):null);});})['catch'](function(_0x4f586a){logger[_0xc734('0xb')](util[_0xc734('0xc')](_0xc734('0x2c'),EXTRACTED_REPORT_ID,_0xc734('0xe')),util[_0xc734('0x2d')](_0x4f586a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xc734('0x2e')](function(){process[_0xc734('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x9739=['analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','existsSync','join','mkdirSync','each','csv','%s.%s','zip','zip\x20finished','Completed','catch','Failed','finally','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger'];(function(_0x327040,_0x6f7206){var _0x201070=function(_0x33f64d){while(--_0x33f64d){_0x327040['push'](_0x327040['shift']());}};_0x201070(++_0x6f7206);}(_0x9739,0x81));var _0x9973=function(_0x112aa9,_0x51a391){_0x112aa9=_0x112aa9-0x0;var _0xebc169=_0x9739[_0x112aa9];return _0xebc169;};'use strict';var util=require(_0x9973('0x0'));var path=require(_0x9973('0x1'));var _=require(_0x9973('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x9973('0x3'));var zipdir=require(_0x9973('0x4'));var rimraf=require(_0x9973('0x5'));var db=require(_0x9973('0x6'))['db'];var dbH=require('../../mysqldb')[_0x9973('0x7')];var logger=require(_0x9973('0x8'))(_0x9973('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x9973('0xa')][0x2]);var QUERY=process[_0x9973('0xa')][0x3];var PATH=process[_0x9973('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2c6e50,_0x26b019){var _0x22be18={'status':_0x2c6e50};var _0x19a270={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x26b019){_0x22be18[_0x9973('0xb')]=_0x26b019;}return db[_0x9973('0xc')]['update'](_0x22be18,_0x19a270);}function main(){var _0x542331=0x1388;var _0x410cc0;logger[_0x9973('0xd')](util[_0x9973('0xe')](_0x9973('0xf'),EXTRACTED_REPORT_ID,_0x9973('0x10')));return db['Setting'][_0x9973('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9973('0x12'),_0x9973('0x13')]})[_0x9973('0x14')](function(_0x450dfe){if(_0x450dfe){_0x410cc0=_0x450dfe;_0x542331=_0x410cc0[_0x9973('0x13')]||0x1388;}})[_0x9973('0x14')](function(){return dbH[_0x9973('0x15')][_0x9973('0x16')](util[_0x9973('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9973('0x15')][_0x9973('0x17')][_0x9973('0x18')]});})['then'](function(_0x161a79){if(!_0x161a79[0x0][_0x9973('0x19')]){return analyticExtractedReport(_0x9973('0x1a'));}var _0x266ab3=[];var _0x54d018=0x0;if(_0x410cc0['split']){if(_0x161a79&&_0x161a79[_0x9973('0x1b')]){var _0x1e2b06=_[_0x9973('0x1c')](_0x161a79[0x0]['num']/_0x542331);var _0x5e32e3=Number[_0x9973('0x1d')](_0x161a79[0x0][_0x9973('0x19')]/_0x542331)?_0x161a79[0x0]['num']%_0x542331:0x0;_0x1e2b06[_0x9973('0x1e')](function(_0x191ce3){if(_0x191ce3>0x0){_0x54d018+=_0x542331;}_0x266ab3[_0x9973('0x1f')](dbH[_0x9973('0x15')]['query'](util[_0x9973('0xe')](_0x9973('0x20'),QUERY,_0x542331,_0x54d018),{'type':dbH[_0x9973('0x15')]['QueryTypes'][_0x9973('0x18')]}));});if(_0x5e32e3>0x0){_0x54d018+=_0x542331;_0x266ab3['push'](dbH[_0x9973('0x15')][_0x9973('0x16')](util['format'](_0x9973('0x20'),QUERY,_0x5e32e3,_0x54d018),{'type':dbH[_0x9973('0x15')][_0x9973('0x17')][_0x9973('0x18')]}));}}}else{_0x266ab3[_0x9973('0x1f')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x9973('0x17')][_0x9973('0x18')]}));}var _0x147b91=path[_0x9973('0x21')](PATH);var _0x304cbd=path['basename'](PATH,'.csv');var _0x2420a1=_0x410cc0[_0x9973('0x12')]&&_0x266ab3[_0x9973('0x1b')]>0x1;var _0x1ad548=[];if(!fs[_0x9973('0x22')](path[_0x9973('0x23')](_0x147b91,_0x304cbd))&&_0x2420a1){fs[_0x9973('0x24')](path[_0x9973('0x23')](_0x147b91,_0x304cbd));}return BPromise[_0x9973('0x25')](_0x266ab3,function(_0x9b5d93){_0x1ad548[_0x9973('0x1f')](_0x9b5d93);})[_0x9973('0x14')](function(){for(var _0x5b8304=0x0;_0x5b8304<_0x1ad548['length'];_0x5b8304+=0x1){var _0x155c41;var _0x1d48f7=_0x1ad548[_0x5b8304];if(_0x2420a1){_0x155c41=path[_0x9973('0x23')](_0x147b91,_0x304cbd,util['format']('%s%d.%s',_0x304cbd,_0x5b8304,_0x9973('0x26')));}else{_0x155c41=path[_0x9973('0x23')](_0x147b91,util[_0x9973('0xe')](_0x9973('0x27'),_0x304cbd,'csv'));}fs['writeFileSync'](_0x155c41,csv(_0x1d48f7));}})[_0x9973('0x14')](function(){if(_0x2420a1){return new Promise(function(_0x1f1fa3){zipdir(path['join'](_0x147b91,_0x304cbd),{'saveTo':path['join'](_0x147b91,util[_0x9973('0xe')](_0x9973('0x27'),_0x304cbd,_0x9973('0x28')))},function(_0x37dafa,_0x3016bd){rimraf(path[_0x9973('0x23')](_0x147b91,_0x304cbd),function(){});_0x1f1fa3(_0x9973('0x29'));});});}})['then'](function(){logger[_0x9973('0xd')](util[_0x9973('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x9973('0x2a'),_0x2420a1?util[_0x9973('0xe')](_0x9973('0x27'),_0x304cbd,_0x2420a1?_0x9973('0x28'):'csv'):null);});})[_0x9973('0x2b')](function(_0x242e45){logger[_0x9973('0xd')](util[_0x9973('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x242e45,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9973('0x2c'));})[_0x9973('0x2d')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 342a07f..169d962 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedeb=['Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','footer','Arial','right','num','find','split','splitSizePdf','then','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','basename','.pdf','existsSync','join','mkdirSync','each','length','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','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','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','tableHeader','map','pick','value','fill','auto','body','push','concat','chunk','keys','forEach','format'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0xedeb,0xa0));var _0xbede=function(_0x192331,_0x535ca2){_0x192331=_0x192331-0x0;var _0x403fb4=_0xedeb[_0x192331];return _0x403fb4;};'use strict';var _=require(_0xbede('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xbede('0x1'));var moment=require(_0xbede('0x2'));var htmlToPdfmake=require(_0xbede('0x3'));var PdfPrinter=require(_0xbede('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xbede('0x5'));var JSDOM=require(_0xbede('0x6'))[_0xbede('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0xbede('0x8'));var db=require(_0xbede('0x9'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xbede('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbede('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xbede('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xbede('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2692e9,_0x1d617c){var _0x5950e3={'status':_0x2692e9};var _0x490e13={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1d617c){_0x5950e3[_0xbede('0xd')]=_0x1d617c;}return db['AnalyticExtractedReport'][_0xbede('0xe')](_0x5950e3,_0x490e13);}function getHeaders(_0x5eac33){return _['map'](_0x5eac33,function(_0x605adf){return{'text':_0x605adf,'style':_0xbede('0xf')};});}function getRows(_0x2c310b,_0x4e2021){return _[_0xbede('0x10')](_0x4e2021,function(_0xdcf175){return _(_0xdcf175)[_0xbede('0x11')](_0x2c310b)[_0xbede('0x10')](function(_0x3307a1){return _0x3307a1?_['toString'](_0x3307a1):'';})[_0xbede('0x12')]();});}function createTable(_0x3b7b8d,_0x25e8ae){var _0x592a72={'widths':_[_0xbede('0x13')](Array(_0x3b7b8d['length']),0x91),'heights':function(_0x343d0f){return _0x343d0f===0x0?_0xbede('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1f2fda=getHeaders(_0x3b7b8d);_0x592a72[_0xbede('0x15')][_0xbede('0x16')](_0x1f2fda);var _0x5946ee=getRows(_0x3b7b8d,_0x25e8ae);_0x592a72[_0xbede('0x15')]=_0x592a72['body'][_0xbede('0x17')](_0x5946ee);return _0x592a72;}function createTables(_0x4a95f5){var _0x4ecdff=[];var _0x1d8663=_[_0xbede('0x18')](Object[_0xbede('0x19')](_0x4a95f5[0x0]),0x5);_0x1d8663[_0xbede('0x1a')](function(_0x387971){_0x4ecdff[_0xbede('0x16')](createTable(_0x387971,_0x4a95f5));});return _0x4ecdff;}function getPDFDocDefinition(_0x228394){var _0xcc2bf=util[_0xbede('0x1b')](_0xbede('0x1c'),NAME,EXTRACTED_REPORT[_0xbede('0x1d')],moment(EXTRACTED_REPORT[_0xbede('0x1e')])[_0xbede('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xbede('0x1f')])[_0xbede('0x1b')](FORMAT));var _0x5ad32c=[];for(var _0x2dd80d=0x0;_0x2dd80d<_0x228394['length'];_0x2dd80d++){var _0x43d77c=[];if(_0x2dd80d===0x0){_0x43d77c[_0xbede('0x16')]({'text':_0xcc2bf,'style':_0xbede('0x20')});}var _0x4f2516={'table':_0x228394[_0x2dd80d]};if(_0x2dd80d>0x0){_0x4f2516[_0xbede('0x21')]=_0xbede('0x22');_0x4f2516[_0xbede('0x23')]=[0x0,0x46,0x0,0x0];}_0x43d77c[_0xbede('0x16')](_0x4f2516);_0x5ad32c[_0xbede('0x16')](_0x43d77c);}return{'pageSize':'A4','pageOrientation':_0xbede('0x24'),'content':_0x5ad32c,'footer':function(_0x919bb7,_0x42d7be){return{'text':_0x919bb7['toString']()+'\x20/\x20'+_0x42d7be,'style':_0xbede('0x25')};},'defaultStyle':{'font':_0xbede('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xbede('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2afb41){var _0x56baf9=0x1388;var _0x2b64a3;if(!_0x2afb41[0x0][_0xbede('0x28')]){return analyticExtractedReport('Empty');}return db['Setting'][_0xbede('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbede('0x2a'),_0xbede('0x2b')]})[_0xbede('0x2c')](function(_0x4be289){if(_0x4be289){_0x2b64a3=_0x4be289;_0x56baf9=_0x2b64a3[_0xbede('0x2b')]||0x3e8;}})['then'](function(){var _0x37ff27=[];var _0x35563b=0x0;if(_0x2b64a3[_0xbede('0x2a')]){if(_0x2afb41&&_0x2afb41['length']){var _0x4bdbeb=_[_0xbede('0x2d')](_0x2afb41[0x0]['num']/_0x56baf9);var _0x41214b=Number[_0xbede('0x2e')](_0x2afb41[0x0][_0xbede('0x28')]/_0x56baf9)?_0x2afb41[0x0][_0xbede('0x28')]%_0x56baf9:0x0;_0x4bdbeb['forEach'](function(_0x1dbd5d){if(_0x1dbd5d>0x0){_0x35563b+=_0x56baf9;}_0x37ff27[_0xbede('0x16')](dbH['sequelize'][_0xbede('0x2f')](util[_0xbede('0x1b')](_0xbede('0x30'),QUERY,_0x56baf9,_0x35563b),{'type':dbH[_0xbede('0x31')][_0xbede('0x32')]['SELECT']}));});if(_0x41214b>0x0){_0x35563b+=_0x56baf9;_0x37ff27[_0xbede('0x16')](dbH[_0xbede('0x31')][_0xbede('0x2f')](util[_0xbede('0x1b')](_0xbede('0x30'),QUERY,_0x41214b,_0x35563b),{'type':dbH[_0xbede('0x31')][_0xbede('0x32')][_0xbede('0x33')]}));}}}else{_0x37ff27['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xbede('0x31')]['QueryTypes']['SELECT']}));}var _0x5d2684=path['dirname'](PATH);var _0x3aa035=path[_0xbede('0x34')](PATH,_0xbede('0x35'));var _0x1b1651=_0x2b64a3['split']&&_0x37ff27['length']>0x1;var _0x560674=[];if(!fs[_0xbede('0x36')](path[_0xbede('0x37')](_0x5d2684,_0x3aa035))&&_0x1b1651){fs[_0xbede('0x38')](path[_0xbede('0x37')](_0x5d2684,_0x3aa035));}return BPromise[_0xbede('0x39')](_0x37ff27,function(_0x4f804e){_0x560674['push'](_0x4f804e);})[_0xbede('0x2c')](function(){var _0xc9602=[];for(var _0x475280=0x0;_0x475280<_0x560674[_0xbede('0x3a')];_0x475280+=0x1){var _0x30b70f=_0x560674[_0x475280];var _0x55de10=createTables(_[_0xbede('0x3b')](_0x30b70f));var _0x474cd9;var _0xfc3ef1=getPDFDocDefinition(_0x55de10);var _0x1a932a=getPDFPrinter();var _0x480264=_0x1a932a[_0xbede('0x3c')](_0xfc3ef1);if(_0x1b1651){_0x474cd9=path[_0xbede('0x37')](_0x5d2684,_0x3aa035,util['format'](_0xbede('0x3d'),_0x3aa035,_0x475280,'pdf'));}else{_0x474cd9=path[_0xbede('0x37')](_0x5d2684,util['format'](_0xbede('0x3e'),_0x3aa035,_0xbede('0x3f')));}_0xc9602['push'](writePDFDocument(_0x480264,_0x474cd9));}return Promise[_0xbede('0x40')](_0xc9602);})[_0xbede('0x2c')](function(){if(_0x1b1651){return new Promise(function(_0x304aad){zipdir(path[_0xbede('0x37')](_0x5d2684,_0x3aa035),{'saveTo':path[_0xbede('0x37')](_0x5d2684,util[_0xbede('0x1b')]('%s.%s',_0x3aa035,_0xbede('0x41')))},function(){rimraf(path[_0xbede('0x37')](_0x5d2684,_0x3aa035),function(){});_0x304aad('zip\x20finished');});});}})[_0xbede('0x2c')](function(){if(!_0x1b1651)return;rimraf(path[_0xbede('0x37')](_0x5d2684,_0x3aa035),function(){});})[_0xbede('0x2c')](function(){logger[_0xbede('0x42')](util[_0xbede('0x1b')](_0xbede('0x43'),EXTRACTED_REPORT_ID,_0xbede('0x44')));return analyticExtractedReport('Completed',_0x1b1651?util[_0xbede('0x1b')](_0xbede('0x3e'),_0x3aa035,_0x1b1651?_0xbede('0x41'):_0xbede('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbede('0x42')](util[_0xbede('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0xbede('0x45')][_0xbede('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbede('0x2c')](function(_0x4a08c3){EXTRACTED_REPORT=_0x4a08c3;return dbH[_0xbede('0x31')]['query'](util[_0xbede('0x1b')](_0xbede('0x47'),QUERY),{'type':dbH[_0xbede('0x31')][_0xbede('0x32')][_0xbede('0x33')]});})['then'](extractReport)[_0xbede('0x48')](function(_0x22d657){logger['info'](util[_0xbede('0x1b')](_0xbede('0x49'),EXTRACTED_REPORT_ID,_0xbede('0x44')),util[_0xbede('0x4a')](_0x22d657,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbede('0x4b'));})[_0xbede('0x4c')](function(){process[_0xbede('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3927e8=new PdfPrinter({'Arial':{'normal':__dirname+_0xbede('0x4e'),'bold':__dirname+_0xbede('0x4f'),'italics':__dirname+_0xbede('0x50'),'bolditalics':__dirname+_0xbede('0x51')}});return _0x3927e8;}function getPDFDocDefinitionFromHTML(_0x303332,_0x500724){var _0xf206a4=util[_0xbede('0x1b')](_0xbede('0x52'),_0x500724[_0xbede('0x53')],_0x500724[_0xbede('0x54')]);var _0x5ac4c3=moment()[_0xbede('0x1b')](_0xbede('0x55'))['toString']();var _0xb41965=htmlToPdfmake(_0x303332,{'window':window,'tableAutoSize':!![]});return{'content':[_0xb41965],'defaultStyle':{'font':_0xbede('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xbede('0x56'),'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':_0xbede('0x56')}},'header':function(){return[{'text':_0xbede('0x57'),'style':_0xbede('0x20')}];},'footer':function(_0x2b39a1,_0x1596b4){return[{'text':util[_0xbede('0x1b')](_0xbede('0x58'),_0xf206a4,_0x2b39a1,_0x1596b4,_0x5ac4c3),'style':_0xbede('0x25')}];}};}function writePDFDocument(_0x3ee91f,_0x5aea6c){return new Promise(function(_0x15f05c,_0x32c005){var _0x536749=_0x3ee91f[_0xbede('0x59')](fs[_0xbede('0x5a')](_0x5aea6c));_0x536749['on'](_0xbede('0x5b'),function(){_0x15f05c('finish');});_0x536749['on']('error',function(_0xe662d2){_0x32c005(_0xe662d2);});_0x3ee91f[_0xbede('0x5c')]();});}exports[_0xbede('0x5d')]=function(_0x53c47d,_0x3575fa){var _0x17bd68=getPDFPrinter();var _0x85f14f=getPDFDocDefinitionFromHTML(_0x53c47d,_0x3575fa);var _0x1c8cd6=_0x17bd68[_0xbede('0x3c')](_0x85f14f);return writePDFDocument(_0x1c8cd6,_0x3575fa[_0xbede('0x1')])[_0xbede('0x48')](function(_0x1c7b51){throw _0x1c7b51;});};
\ No newline at end of file
+var _0x989a=['center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','util','path','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','../../config/logger','analytics','argv','savename','update','map','tableHeader','pick','toString','value','length','auto','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','right','num','Setting','find','then','splitSizePdf','split','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','sequelize','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD'];(function(_0x43554e,_0x1e3896){var _0x2e0ff6=function(_0x225dc1){while(--_0x225dc1){_0x43554e['push'](_0x43554e['shift']());}};_0x2e0ff6(++_0x1e3896);}(_0x989a,0xb7));var _0xa989=function(_0x4c89e4,_0x15022c){_0x4c89e4=_0x4c89e4-0x0;var _0x416661=_0x989a[_0x4c89e4];return _0x416661;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xa989('0x0'));var path=require(_0xa989('0x1'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xa989('0x2'));var zipdir=require(_0xa989('0x3'));var rimraf=require(_0xa989('0x4'));var JSDOM=require(_0xa989('0x5'))[_0xa989('0x6')];var window=new JSDOM('')[_0xa989('0x7')];var BPromise=require('bluebird');var db=require(_0xa989('0x8'))['db'];var dbH=require(_0xa989('0x8'))['dbH'];var logger=require(_0xa989('0x9'))(_0xa989('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xa989('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xa989('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x42ea1a,_0x5f2269){var _0x5281a6={'status':_0x42ea1a};var _0x551c73={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f2269){_0x5281a6[_0xa989('0xc')]=_0x5f2269;}return db['AnalyticExtractedReport'][_0xa989('0xd')](_0x5281a6,_0x551c73);}function getHeaders(_0xd3ec39){return _[_0xa989('0xe')](_0xd3ec39,function(_0x3875db){return{'text':_0x3875db,'style':_0xa989('0xf')};});}function getRows(_0x5c2a02,_0x5001f9){return _[_0xa989('0xe')](_0x5001f9,function(_0x1b3487){return _(_0x1b3487)[_0xa989('0x10')](_0x5c2a02)[_0xa989('0xe')](function(_0x5d346b){return _0x5d346b?_[_0xa989('0x11')](_0x5d346b):'';})[_0xa989('0x12')]();});}function createTable(_0x1740e9,_0xc52d98){var _0x5e3278={'widths':_['fill'](Array(_0x1740e9[_0xa989('0x13')]),0x91),'heights':function(_0x321f70){return _0x321f70===0x0?_0xa989('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xc66c6c=getHeaders(_0x1740e9);_0x5e3278[_0xa989('0x15')]['push'](_0xc66c6c);var _0x1af905=getRows(_0x1740e9,_0xc52d98);_0x5e3278[_0xa989('0x15')]=_0x5e3278['body'][_0xa989('0x16')](_0x1af905);return _0x5e3278;}function createTables(_0x59ea19){var _0x3496f6=[];var _0x2b65c9=_[_0xa989('0x17')](Object[_0xa989('0x18')](_0x59ea19[0x0]),0x5);_0x2b65c9[_0xa989('0x19')](function(_0x3945d2){_0x3496f6[_0xa989('0x1a')](createTable(_0x3945d2,_0x59ea19));});return _0x3496f6;}function getPDFDocDefinition(_0x4abfe8){var _0x34aa3e=util[_0xa989('0x1b')](_0xa989('0x1c'),NAME,EXTRACTED_REPORT[_0xa989('0x1d')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xa989('0x1b')](FORMAT));var _0xe3f1f4=[];for(var _0x2f928f=0x0;_0x2f928f<_0x4abfe8[_0xa989('0x13')];_0x2f928f++){var _0x5b5b85=[];if(_0x2f928f===0x0){_0x5b5b85[_0xa989('0x1a')]({'text':_0x34aa3e,'style':_0xa989('0x1e')});}var _0x12cafc={'table':_0x4abfe8[_0x2f928f]};if(_0x2f928f>0x0){_0x12cafc[_0xa989('0x1f')]=_0xa989('0x20');_0x12cafc[_0xa989('0x21')]=[0x0,0x46,0x0,0x0];}_0x5b5b85[_0xa989('0x1a')](_0x12cafc);_0xe3f1f4[_0xa989('0x1a')](_0x5b5b85);}return{'pageSize':'A4','pageOrientation':_0xa989('0x22'),'content':_0xe3f1f4,'footer':function(_0x550c1d,_0x3ed5a7){return{'text':_0x550c1d[_0xa989('0x11')]()+_0xa989('0x23')+_0x3ed5a7,'style':'footer'};},'defaultStyle':{'font':_0xa989('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa989('0x25')},'footer':{'alignment':_0xa989('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x50ced9){var _0x5a7819=0x1388;var _0x4f8d13;if(!_0x50ced9[0x0][_0xa989('0x27')]){return analyticExtractedReport('Empty');}return db[_0xa989('0x28')][_0xa989('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xa989('0x2a')](function(_0x29983e){if(_0x29983e){_0x4f8d13=_0x29983e;_0x5a7819=_0x4f8d13[_0xa989('0x2b')]||0x3e8;}})[_0xa989('0x2a')](function(){var _0x2e694d=[];var _0x11d914=0x0;if(_0x4f8d13[_0xa989('0x2c')]){if(_0x50ced9&&_0x50ced9[_0xa989('0x13')]){var _0x304cdc=_['range'](_0x50ced9[0x0][_0xa989('0x27')]/_0x5a7819);var _0x103594=Number[_0xa989('0x2d')](_0x50ced9[0x0][_0xa989('0x27')]/_0x5a7819)?_0x50ced9[0x0][_0xa989('0x27')]%_0x5a7819:0x0;_0x304cdc[_0xa989('0x19')](function(_0x3cec4f){if(_0x3cec4f>0x0){_0x11d914+=_0x5a7819;}_0x2e694d[_0xa989('0x1a')](dbH['sequelize'][_0xa989('0x2e')](util[_0xa989('0x1b')](_0xa989('0x2f'),QUERY,_0x5a7819,_0x11d914),{'type':dbH['sequelize'][_0xa989('0x30')]['SELECT']}));});if(_0x103594>0x0){_0x11d914+=_0x5a7819;_0x2e694d[_0xa989('0x1a')](dbH[_0xa989('0x31')]['query'](util[_0xa989('0x1b')](_0xa989('0x2f'),QUERY,_0x103594,_0x11d914),{'type':dbH[_0xa989('0x31')][_0xa989('0x30')][_0xa989('0x32')]}));}}}else{_0x2e694d[_0xa989('0x1a')](dbH[_0xa989('0x31')][_0xa989('0x2e')](QUERY,{'type':dbH[_0xa989('0x31')][_0xa989('0x30')]['SELECT']}));}var _0x296edf=path[_0xa989('0x33')](PATH);var _0x48e69a=path[_0xa989('0x34')](PATH,_0xa989('0x35'));var _0x34d957=_0x4f8d13['split']&&_0x2e694d[_0xa989('0x13')]>0x1;var _0x30c016=[];if(!fs[_0xa989('0x36')](path[_0xa989('0x37')](_0x296edf,_0x48e69a))&&_0x34d957){fs[_0xa989('0x38')](path[_0xa989('0x37')](_0x296edf,_0x48e69a));}return BPromise[_0xa989('0x39')](_0x2e694d,function(_0x48f404){_0x30c016[_0xa989('0x1a')](_0x48f404);})[_0xa989('0x2a')](function(){var _0x1745dc=[];for(var _0x1c52e8=0x0;_0x1c52e8<_0x30c016['length'];_0x1c52e8+=0x1){var _0x145baf=_0x30c016[_0x1c52e8];var _0x556951=createTables(_['flatten'](_0x145baf));var _0x5a4c0b;var _0x1f8a83=getPDFDocDefinition(_0x556951);var _0x1f16a3=getPDFPrinter();var _0x456373=_0x1f16a3[_0xa989('0x3a')](_0x1f8a83);if(_0x34d957){_0x5a4c0b=path[_0xa989('0x37')](_0x296edf,_0x48e69a,util[_0xa989('0x1b')](_0xa989('0x3b'),_0x48e69a,_0x1c52e8,'pdf'));}else{_0x5a4c0b=path['join'](_0x296edf,util[_0xa989('0x1b')](_0xa989('0x3c'),_0x48e69a,'pdf'));}_0x1745dc[_0xa989('0x1a')](writePDFDocument(_0x456373,_0x5a4c0b));}return Promise[_0xa989('0x3d')](_0x1745dc);})['then'](function(){if(_0x34d957){return new Promise(function(_0xc034db){zipdir(path['join'](_0x296edf,_0x48e69a),{'saveTo':path[_0xa989('0x37')](_0x296edf,util['format']('%s.%s',_0x48e69a,_0xa989('0x3e')))},function(){rimraf(path[_0xa989('0x37')](_0x296edf,_0x48e69a),function(){});_0xc034db(_0xa989('0x3f'));});});}})[_0xa989('0x2a')](function(){if(!_0x34d957)return;rimraf(path[_0xa989('0x37')](_0x296edf,_0x48e69a),function(){});})[_0xa989('0x2a')](function(){logger[_0xa989('0x40')](util[_0xa989('0x1b')](_0xa989('0x41'),EXTRACTED_REPORT_ID,_0xa989('0x42')));return analyticExtractedReport(_0xa989('0x43'),_0x34d957?util[_0xa989('0x1b')](_0xa989('0x3c'),_0x48e69a,_0x34d957?_0xa989('0x3e'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xa989('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa989('0x42')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa989('0x2a')](function(_0x5f2207){EXTRACTED_REPORT=_0x5f2207;return dbH[_0xa989('0x31')][_0xa989('0x2e')](util[_0xa989('0x1b')](_0xa989('0x44'),QUERY),{'type':dbH[_0xa989('0x31')]['QueryTypes'][_0xa989('0x32')]});})[_0xa989('0x2a')](extractReport)[_0xa989('0x45')](function(_0x41ed8d){logger[_0xa989('0x40')](util[_0xa989('0x1b')](_0xa989('0x46'),EXTRACTED_REPORT_ID,'PDF'),util[_0xa989('0x47')](_0x41ed8d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3728e7=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xa989('0x48'),'italics':__dirname+_0xa989('0x49'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x3728e7;}function getPDFDocDefinitionFromHTML(_0x5a5252,_0x5b4ce6){var _0x319045=util[_0xa989('0x1b')](_0xa989('0x4a'),_0x5b4ce6[_0xa989('0x4b')],_0x5b4ce6[_0xa989('0x4c')]);var _0x334bb1=moment()[_0xa989('0x1b')](_0xa989('0x4d'))[_0xa989('0x11')]();var _0x3d1f1c=htmlToPdfmake(_0x5a5252,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3d1f1c],'defaultStyle':{'font':_0xa989('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa989('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':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x122f28,_0x21b007){return[{'text':util['format'](_0xa989('0x4f'),_0x319045,_0x122f28,_0x21b007,_0x334bb1),'style':_0xa989('0x50')}];}};}function writePDFDocument(_0x20854e,_0x12f518){return new Promise(function(_0x51394a,_0x2e1fbb){var _0x4c14bd=_0x20854e[_0xa989('0x51')](fs[_0xa989('0x52')](_0x12f518));_0x4c14bd['on'](_0xa989('0x53'),function(){_0x51394a(_0xa989('0x53'));});_0x4c14bd['on'](_0xa989('0x54'),function(_0x24b2be){_0x2e1fbb(_0x24b2be);});_0x20854e[_0xa989('0x55')]();});}exports[_0xa989('0x56')]=function(_0x3788c7,_0x58f41b){var _0x21e981=getPDFPrinter();var _0x2a4694=getPDFDocDefinitionFromHTML(_0x3788c7,_0x58f41b);var _0x2ddd60=_0x21e981[_0xa989('0x3a')](_0x2a4694);return writePDFDocument(_0x2ddd60,_0x58f41b['path'])[_0xa989('0x45')](function(_0x24309c){throw _0x24309c;});};
\ No newline at end of file
index 8433c08..8149224 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6301=['join','each','%s%d.%s','xlsx','binary','%s.%s','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','query','sequelize','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','existsSync'];(function(_0x43474c,_0x529fcf){var _0x2f9ca3=function(_0x575565){while(--_0x575565){_0x43474c['push'](_0x43474c['shift']());}};_0x2f9ca3(++_0x529fcf);}(_0x6301,0x9e));var _0x1630=function(_0x2880cd,_0x4fd6f4){_0x2880cd=_0x2880cd-0x0;var _0x540615=_0x6301[_0x2880cd];return _0x540615;};'use strict';var util=require(_0x1630('0x0'));var path=require(_0x1630('0x1'));var _=require(_0x1630('0x2'));var fs=require('fs');var json2xls=require(_0x1630('0x3'));var BPromise=require(_0x1630('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x1630('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1630('0x6'))[_0x1630('0x7')];var logger=require(_0x1630('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1630('0x9')][0x3];var PATH=process[_0x1630('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1916cc,_0x496099){var _0x374c93={'status':_0x1916cc};var _0x3800b9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x496099){_0x374c93['savename']=_0x496099;}return db[_0x1630('0xa')]['update'](_0x374c93,_0x3800b9);}function main(){var _0x4eebd5=0x1388;var _0x445d83;logger[_0x1630('0xb')](util[_0x1630('0xc')](_0x1630('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x1630('0xe')][_0x1630('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1630('0x10'),_0x1630('0x11')]})[_0x1630('0x12')](function(_0x4001ba){if(_0x4001ba){_0x445d83=_0x4001ba;_0x4eebd5=_0x445d83[_0x1630('0x11')]||0x1388;}})[_0x1630('0x12')](function(){return dbH['sequelize'][_0x1630('0x13')](util[_0x1630('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1630('0x14')][_0x1630('0x15')][_0x1630('0x16')]});})[_0x1630('0x12')](function(_0x17d944){if(!_0x17d944[0x0]['num']){return analyticExtractedReport(_0x1630('0x17'));}var _0x1bb023=[];var _0xd75d92=0x0;if(_0x445d83[_0x1630('0x10')]){if(_0x17d944&&_0x17d944[_0x1630('0x18')]){var _0x3c9008=_[_0x1630('0x19')](_0x17d944[0x0][_0x1630('0x1a')]/_0x4eebd5);var _0x4a7cae=Number[_0x1630('0x1b')](_0x17d944[0x0]['num']/_0x4eebd5)?_0x17d944[0x0][_0x1630('0x1a')]%_0x4eebd5:0x0;_0x3c9008[_0x1630('0x1c')](function(_0x2c6c81){if(_0x2c6c81>0x0){_0xd75d92+=_0x4eebd5;}_0x1bb023['push'](dbH[_0x1630('0x14')][_0x1630('0x13')](util[_0x1630('0xc')](_0x1630('0x1d'),QUERY,_0x4eebd5,_0xd75d92),{'type':dbH[_0x1630('0x14')][_0x1630('0x15')][_0x1630('0x16')]}));});if(_0x4a7cae>0x0){_0xd75d92+=_0x4eebd5;_0x1bb023['push'](dbH['sequelize'][_0x1630('0x13')](util['format'](_0x1630('0x1d'),QUERY,_0x4a7cae,_0xd75d92),{'type':dbH[_0x1630('0x14')][_0x1630('0x15')][_0x1630('0x16')]}));}}}else{_0x1bb023[_0x1630('0x1e')](dbH['sequelize'][_0x1630('0x13')](QUERY,{'type':dbH[_0x1630('0x14')][_0x1630('0x15')][_0x1630('0x16')]}));}var _0x149647=path[_0x1630('0x1f')](PATH);var _0x33cdb2=path[_0x1630('0x20')](PATH,'.xlsx');var _0x380d6e=_0x445d83[_0x1630('0x10')]&&_0x1bb023[_0x1630('0x18')]>0x1;var _0x381db1=[];if(!fs[_0x1630('0x21')](path['join'](_0x149647,_0x33cdb2))&&_0x380d6e){fs['mkdirSync'](path[_0x1630('0x22')](_0x149647,_0x33cdb2));}return BPromise[_0x1630('0x23')](_0x1bb023,function(_0x188399){_0x381db1[_0x1630('0x1e')](_0x188399);})[_0x1630('0x12')](function(){for(var _0xb17c1e=0x0;_0xb17c1e<_0x381db1[_0x1630('0x18')];_0xb17c1e+=0x1){var _0x1490ce;var _0x32a73d=_0x381db1[_0xb17c1e];if(_0x380d6e){_0x1490ce=path[_0x1630('0x22')](_0x149647,_0x33cdb2,util[_0x1630('0xc')](_0x1630('0x24'),_0x33cdb2,_0xb17c1e,_0x1630('0x25')));}else{_0x1490ce=path[_0x1630('0x22')](_0x149647,util[_0x1630('0xc')]('%s.%s',_0x33cdb2,_0x1630('0x25')));}fs['writeFileSync'](_0x1490ce,json2xls(_0x32a73d),_0x1630('0x26'));}})[_0x1630('0x12')](function(){if(_0x380d6e){return new Promise(function(_0xe0a657){zipdir(path[_0x1630('0x22')](_0x149647,_0x33cdb2),{'saveTo':path[_0x1630('0x22')](_0x149647,util[_0x1630('0xc')](_0x1630('0x27'),_0x33cdb2,'zip'))},function(_0x5d3019,_0x57192e){rimraf(path['join'](_0x149647,_0x33cdb2),function(){});_0xe0a657('zip\x20finished');});});}})[_0x1630('0x12')](function(){logger[_0x1630('0xb')](util[_0x1630('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1630('0x28')));return analyticExtractedReport(_0x1630('0x29'),_0x380d6e?util[_0x1630('0xc')](_0x1630('0x27'),_0x33cdb2,_0x380d6e?'zip':_0x1630('0x25')):null);});})[_0x1630('0x2a')](function(_0x407910){logger['info'](util[_0x1630('0xc')](_0x1630('0x2b'),EXTRACTED_REPORT_ID,_0x1630('0x28')),util[_0x1630('0x2c')](_0x407910,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1630('0x2d'));})[_0x1630('0x2e')](function(){process[_0x1630('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xac99=['num','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip\x20finished','info','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','dbH','../../config/logger','analytics','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','QueryTypes','SELECT','Empty','length','isInteger'];(function(_0x517e98,_0x4ae621){var _0x39bc4c=function(_0x214146){while(--_0x214146){_0x517e98['push'](_0x517e98['shift']());}};_0x39bc4c(++_0x4ae621);}(_0xac99,0x108));var _0x9ac9=function(_0x33cb97,_0x2be8e8){_0x33cb97=_0x33cb97-0x0;var _0xe85595=_0xac99[_0x33cb97];return _0xe85595;};'use strict';var util=require(_0x9ac9('0x0'));var path=require(_0x9ac9('0x1'));var _=require(_0x9ac9('0x2'));var fs=require('fs');var json2xls=require(_0x9ac9('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x9ac9('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x9ac9('0x5')];var logger=require(_0x9ac9('0x6'))(_0x9ac9('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3dcacf,_0x835e26){var _0x2d4db7={'status':_0x3dcacf};var _0x1c92cd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x835e26){_0x2d4db7[_0x9ac9('0x8')]=_0x835e26;}return db[_0x9ac9('0x9')]['update'](_0x2d4db7,_0x1c92cd);}function main(){var _0x420579=0x1388;var _0x6ed02a;logger['info'](util[_0x9ac9('0xa')](_0x9ac9('0xb'),EXTRACTED_REPORT_ID,_0x9ac9('0xc')));return db[_0x9ac9('0xd')][_0x9ac9('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9ac9('0xf'),'splitSizeXlsx']})[_0x9ac9('0x10')](function(_0x4534ea){if(_0x4534ea){_0x6ed02a=_0x4534ea;_0x420579=_0x6ed02a[_0x9ac9('0x11')]||0x1388;}})[_0x9ac9('0x10')](function(){return dbH[_0x9ac9('0x12')]['query'](util[_0x9ac9('0xa')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9ac9('0x12')][_0x9ac9('0x13')][_0x9ac9('0x14')]});})[_0x9ac9('0x10')](function(_0x42268f){if(!_0x42268f[0x0]['num']){return analyticExtractedReport(_0x9ac9('0x15'));}var _0x25731e=[];var _0x1e0c53=0x0;if(_0x6ed02a[_0x9ac9('0xf')]){if(_0x42268f&&_0x42268f[_0x9ac9('0x16')]){var _0x7d2b64=_['range'](_0x42268f[0x0]['num']/_0x420579);var _0x3f3ea4=Number[_0x9ac9('0x17')](_0x42268f[0x0][_0x9ac9('0x18')]/_0x420579)?_0x42268f[0x0][_0x9ac9('0x18')]%_0x420579:0x0;_0x7d2b64[_0x9ac9('0x19')](function(_0x134524){if(_0x134524>0x0){_0x1e0c53+=_0x420579;}_0x25731e[_0x9ac9('0x1a')](dbH[_0x9ac9('0x12')][_0x9ac9('0x1b')](util[_0x9ac9('0xa')](_0x9ac9('0x1c'),QUERY,_0x420579,_0x1e0c53),{'type':dbH[_0x9ac9('0x12')][_0x9ac9('0x13')]['SELECT']}));});if(_0x3f3ea4>0x0){_0x1e0c53+=_0x420579;_0x25731e[_0x9ac9('0x1a')](dbH[_0x9ac9('0x12')][_0x9ac9('0x1b')](util['format'](_0x9ac9('0x1c'),QUERY,_0x3f3ea4,_0x1e0c53),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x25731e[_0x9ac9('0x1a')](dbH['sequelize'][_0x9ac9('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x9ac9('0x14')]}));}var _0x1f5809=path[_0x9ac9('0x1d')](PATH);var _0x404bc2=path[_0x9ac9('0x1e')](PATH,'.xlsx');var _0x1929f4=_0x6ed02a[_0x9ac9('0xf')]&&_0x25731e[_0x9ac9('0x16')]>0x1;var _0x4e0de1=[];if(!fs[_0x9ac9('0x1f')](path[_0x9ac9('0x20')](_0x1f5809,_0x404bc2))&&_0x1929f4){fs[_0x9ac9('0x21')](path['join'](_0x1f5809,_0x404bc2));}return BPromise[_0x9ac9('0x22')](_0x25731e,function(_0x541d77){_0x4e0de1[_0x9ac9('0x1a')](_0x541d77);})[_0x9ac9('0x10')](function(){for(var _0x4bc822=0x0;_0x4bc822<_0x4e0de1[_0x9ac9('0x16')];_0x4bc822+=0x1){var _0x357dae;var _0x50928e=_0x4e0de1[_0x4bc822];if(_0x1929f4){_0x357dae=path[_0x9ac9('0x20')](_0x1f5809,_0x404bc2,util[_0x9ac9('0xa')](_0x9ac9('0x23'),_0x404bc2,_0x4bc822,_0x9ac9('0x24')));}else{_0x357dae=path['join'](_0x1f5809,util[_0x9ac9('0xa')](_0x9ac9('0x25'),_0x404bc2,_0x9ac9('0x24')));}fs['writeFileSync'](_0x357dae,json2xls(_0x50928e),_0x9ac9('0x26'));}})[_0x9ac9('0x10')](function(){if(_0x1929f4){return new Promise(function(_0x443c2f){zipdir(path[_0x9ac9('0x20')](_0x1f5809,_0x404bc2),{'saveTo':path[_0x9ac9('0x20')](_0x1f5809,util[_0x9ac9('0xa')](_0x9ac9('0x25'),_0x404bc2,'zip'))},function(_0x1703f2,_0x4b955e){rimraf(path['join'](_0x1f5809,_0x404bc2),function(){});_0x443c2f(_0x9ac9('0x27'));});});}})[_0x9ac9('0x10')](function(){logger[_0x9ac9('0x28')](util[_0x9ac9('0xa')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x9ac9('0xc')));return analyticExtractedReport(_0x9ac9('0x29'),_0x1929f4?util[_0x9ac9('0xa')]('%s.%s',_0x404bc2,_0x1929f4?_0x9ac9('0x2a'):'xlsx'):null);});})['catch'](function(_0x261260){logger[_0x9ac9('0x28')](util[_0x9ac9('0xa')](_0x9ac9('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x9ac9('0x2c')](_0x261260,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9ac9('0x2d'));})[_0x9ac9('0x2e')](function(){process[_0x9ac9('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
index 70c33c3..c7c8ac6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08fa=['CDR(tag)=','length','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','indexOf','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','then','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','uniq','exten','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','CDR(type)=%s','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','${EXTEN:','cutdigits','${EXTEN}','context','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','map','tag'];(function(_0x5da3dd,_0x59778e){var _0xf13a52=function(_0x376f40){while(--_0x376f40){_0x5da3dd['push'](_0x5da3dd['shift']());}};_0xf13a52(++_0x59778e);}(_0x08fa,0xaf));var _0xa08f=function(_0x480b57,_0xa38c4e){_0x480b57=_0x480b57-0x0;var _0x22c966=_0x08fa[_0x480b57];return _0x22c966;};'use strict';var _=require(_0xa08f('0x0'));var util=require(_0xa08f('0x1'));function rewrite(_0x26486a,_0x76a502){var _0x975081=this;return _0x26486a[_0xa08f('0x2')][_0xa08f('0x3')][_0xa08f('0x4')]({'raw':!![]})['then'](function(_0x5905ac){_0x975081[_0xa08f('0x5')]=_0x5905ac;return _0x26486a[_0xa08f('0x2')][_0xa08f('0x6')]['findAll']({'where':{'IntervalId':_0x76a502[_0xa08f('0x7')]},'raw':!![]});})['then'](function(_0xd30114){return _0x26486a['models'][_0xa08f('0x6')][_0xa08f('0x4')]({'where':{'exten':{'$in':_[_0xa08f('0x8')](_['map'](_0xd30114,_0xa08f('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x27a645){var _0x49be43=_['filter'](_0x27a645,{'priority':'1'});var _0x2306f1=_['filter'](_0x27a645,{'isApp':0x1});var _0x33123b=_[_0xa08f('0xa')](_0x2306f1,_0xa08f('0x9'));var _0x195f89=[_0xa08f('0xb'),_0xa08f('0xc')];var _0x4e12d9=[];var _0x38f4d7=[];for(var _0x4dedd1 in _0x33123b){if(_0x33123b[_0xa08f('0xd')](_0x4dedd1)){_0x975081[_0xa08f('0xe')]=0x2;_0x975081[_0xa08f('0xf')]=[];_0x975081[_0xa08f('0x10')]=_[_0xa08f('0x11')](_0x49be43,{'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')]});_0x975081[_0xa08f('0xf')][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':'Set','appdata':util[_0xa08f('0x14')](_0xa08f('0x15'),_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')]),'context':_0x33123b[_0x4dedd1][0x0]['context'],'exten':_0x33123b[_0x4dedd1][0x0]['exten'],'priority':_0x975081['priority']++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});if(_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')]===_0xa08f('0x17')){_0x975081[_0xa08f('0xf')][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x19')+_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')],'context':_0x33123b[_0x4dedd1][0x0]['context'],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081[_0xa08f('0xe')]++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});}else if(_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')]===_0xa08f('0x1a')){if(_0x975081[_0xa08f('0x10')]){_0x975081[_0xa08f('0xf')][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':'Set','appdata':'CDR(destination)='+(_0x975081[_0xa08f('0x10')]['cutdigits']?_0xa08f('0x1b')+_0x975081[_0xa08f('0x10')][_0xa08f('0x1c')]+'}':_0xa08f('0x1d')),'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081['priority']++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});}_0x975081[_0xa08f('0xf')][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x19')+_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')],'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0]['exten'],'priority':_0x975081[_0xa08f('0xe')]++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});var _0x29b742=_0x975081[_0xa08f('0xe')]++;_0x975081[_0xa08f('0xf')]['push']({'type':_0x33123b[_0x4dedd1][0x0]['type'],'app':_0xa08f('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x29b742+0x2)+_0xa08f('0x20')+(_0x29b742+0x1)+')','context':_0x33123b[_0x4dedd1][0x0]['context'],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x29b742,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});if(_0x975081[_0xa08f('0x10')]){_0x975081['extensions']['push']({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':_0xa08f('0x18'),'appdata':_0x975081[_0xa08f('0x10')][_0xa08f('0x1c')]?_0xa08f('0x21')+_0x975081[_0xa08f('0x10')][_0xa08f('0x1c')]+'}':_0xa08f('0x22'),'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081[_0xa08f('0xe')]++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});}_0x975081[_0xa08f('0xf')][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0]['type'],'app':'Set','appdata':_0xa08f('0x23')+_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')],'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081['priority']++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});if(_0x975081[_0xa08f('0x10')]&&_0x975081[_0xa08f('0x10')][_0xa08f('0xd')](_0xa08f('0x24'))&&_0x975081[_0xa08f('0x10')][_0xa08f('0x24')]!=='none'){_0x975081[_0xa08f('0xf')][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0]['type'],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x25'),'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081['priority']++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});_0x975081[_0xa08f('0xf')]['push']({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x26')+_0x975081[_0xa08f('0x10')][_0xa08f('0x24')]||_0xa08f('0x27'),'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081[_0xa08f('0xe')]++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});}}_0x975081[_0xa08f('0xf')][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x28'),'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081[_0xa08f('0xe')]++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0]['VoiceExtensionId']});_0x975081['extensions'][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x29'),'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081[_0xa08f('0xe')]++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0]['VoiceExtensionId']});_0x975081[_0xa08f('0xf')][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x13')],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x2a'),'context':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x1e')],'exten':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x9')],'priority':_0x975081['priority']++,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});for(var _0x29f909=0x0,_0x184c6e=0x0;_0x29f909<_0x33123b[_0x4dedd1]['length'];_0x29f909+=0x1,_0x184c6e=0x0){var _0x9ebb18=_0x33123b[_0x4dedd1][_0x29f909];if(_0x9ebb18[_0xa08f('0x13')]){_0x9ebb18[_0xa08f('0x13')]=_0x9ebb18[_0xa08f('0x13')][_0xa08f('0x2b')]();}var _0x98a035=[];var _0x35c699=[];delete _0x9ebb18['id'];delete _0x9ebb18[_0xa08f('0x2c')];delete _0x9ebb18[_0xa08f('0x2d')];var _0x258b3a=_0x9ebb18[_0xa08f('0x2e')]!==_0xa08f('0x2f')?[_0x9ebb18[_0xa08f('0x2e')]]:_0x9ebb18[_0xa08f('0x7')]?_[_0xa08f('0x30')](_['filter'](_0x975081[_0xa08f('0x5')],{'IntervalId':_0x9ebb18[_0xa08f('0x7')]}),_0xa08f('0x2e')):[];if(_0x9ebb18[_0xa08f('0xd')](_0xa08f('0x31'))){if(_0x9ebb18[_0xa08f('0x31')]&&_0x9ebb18[_0xa08f('0x31')]!=='--'){_0x98a035[_0xa08f('0x12')]({'type':_0x9ebb18[_0xa08f('0x13')],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x32')+_0x9ebb18[_0xa08f('0x31')],'context':_0x9ebb18[_0xa08f('0x1e')],'exten':_0x9ebb18['exten'],'priority':_0x258b3a[_0xa08f('0x33')]+_0x975081[_0xa08f('0xe')]+_0x184c6e++,'VoiceExtensionId':_0x9ebb18[_0xa08f('0x16')]});}}if(_0x9ebb18[_0xa08f('0x13')]===_0xa08f('0x1a')&&_0x9ebb18['hasOwnProperty'](_0xa08f('0x34'))){if(_0x9ebb18[_0xa08f('0x34')]){_0x98a035[_0xa08f('0x12')]({'type':_0x9ebb18[_0xa08f('0x13')],'app':_0xa08f('0x1f'),'appdata':_0xa08f('0x35')+_0x9ebb18[_0xa08f('0x34')]+')','context':_0x9ebb18[_0xa08f('0x1e')],'exten':_0x9ebb18[_0xa08f('0x9')],'priority':_0x258b3a['length']+_0x975081[_0xa08f('0xe')]+_0x184c6e++,'VoiceExtensionId':_0x9ebb18[_0xa08f('0x16')]});}else{_0x98a035['push']({'type':_0x9ebb18[_0xa08f('0x13')],'app':_0xa08f('0x1f'),'appdata':_0xa08f('0x36'),'context':_0x9ebb18[_0xa08f('0x1e')],'exten':_0x9ebb18[_0xa08f('0x9')],'priority':_0x258b3a[_0xa08f('0x33')]+_0x975081[_0xa08f('0xe')]+_0x184c6e++,'VoiceExtensionId':_0x9ebb18['VoiceExtensionId']});}}if(_0x9ebb18[_0xa08f('0xd')](_0xa08f('0x37'))){if(_0x195f89[_0xa08f('0x38')](_0x9ebb18['app'][_0xa08f('0x2b')]())>=0x0&&_0x9ebb18[_0xa08f('0x39')]!==_0xa08f('0x3a')){if(_0x9ebb18[_0xa08f('0x37')]){_0x98a035[_0xa08f('0x12')]({'type':_0x9ebb18[_0xa08f('0x13')],'app':_0xa08f('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x9ebb18[_0xa08f('0x1e')],'exten':_0x9ebb18[_0xa08f('0x9')],'priority':_0x258b3a[_0xa08f('0x33')]+_0x975081[_0xa08f('0xe')]+_0x184c6e++,'VoiceExtensionId':_0x9ebb18[_0xa08f('0x16')]});_0x98a035['push']({'type':_0x9ebb18['type'],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x3b'),'context':_0x9ebb18['context'],'exten':_0x9ebb18[_0xa08f('0x9')],'priority':_0x258b3a['length']+_0x975081[_0xa08f('0xe')]+_0x184c6e++,'VoiceExtensionId':_0x9ebb18[_0xa08f('0x16')]});}else{_0x98a035[_0xa08f('0x12')]({'type':_0x9ebb18[_0xa08f('0x13')],'app':_0xa08f('0x1f'),'appdata':_0xa08f('0x3c'),'context':_0x9ebb18[_0xa08f('0x1e')],'exten':_0x9ebb18[_0xa08f('0x9')],'priority':_0x258b3a[_0xa08f('0x33')]+_0x975081['priority']+_0x184c6e++,'VoiceExtensionId':_0x9ebb18[_0xa08f('0x16')]});_0x98a035[_0xa08f('0x12')]({'type':_0x9ebb18['type'],'app':_0xa08f('0x18'),'appdata':_0xa08f('0x3d'),'context':_0x9ebb18[_0xa08f('0x1e')],'exten':_0x9ebb18[_0xa08f('0x9')],'priority':_0x258b3a[_0xa08f('0x33')]+_0x975081[_0xa08f('0xe')]+_0x184c6e++,'VoiceExtensionId':_0x9ebb18[_0xa08f('0x16')]});}}}for(var _0x31f591=0x0;_0x31f591<_0x258b3a[_0xa08f('0x33')];_0x31f591+=0x1){var _0x1bd3b7=_0x975081[_0xa08f('0xe')]+_0x258b3a[_0xa08f('0x33')];var _0x22f648=_0x31f591===_0x258b3a[_0xa08f('0x33')]-0x1?_0x975081[_0xa08f('0xe')]+_0x98a035[_0xa08f('0x33')]+_0x35c699[_0xa08f('0x33')]+0x2:_0x975081[_0xa08f('0xe')]+_0x31f591+0x1;_0x98a035[_0xa08f('0x3e')](_0x31f591,0x0,{'type':_0x9ebb18[_0xa08f('0x13')],'app':_0xa08f('0x3f'),'appdata':_0x258b3a[_0x31f591]+'?'+_0x9ebb18[_0xa08f('0x1e')]+_0xa08f('0x40')+_0x1bd3b7+':'+_0x9ebb18[_0xa08f('0x1e')]+',${EXTEN},'+_0x22f648,'exten':_0x9ebb18['exten'],'context':_0x9ebb18[_0xa08f('0x1e')],'priority':_0x975081['priority']+_0x31f591,'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]});}_0x9ebb18[_0xa08f('0xe')]=_0x98a035[_0xa08f('0x33')]?_['last'](_0x98a035)['priority']+0x1:_0x975081[_0xa08f('0xe')];_0x975081[_0xa08f('0xe')]=(_0x35c699[_0xa08f('0x33')]?_[_0xa08f('0x41')](_0x35c699)[_0xa08f('0xe')]:_0x9ebb18[_0xa08f('0xe')])+0x1;_0x975081[_0xa08f('0xf')]=_[_0xa08f('0x42')](_0x975081[_0xa08f('0xf')],_0x98a035,[_0x9ebb18],_0x35c699);}_0x975081['extensions'][_0xa08f('0x12')]({'type':_0x33123b[_0x4dedd1][0x0]['type'],'app':_0xa08f('0x43'),'exten':_0x33123b[_0x4dedd1][0x0]['exten'],'context':_0x33123b[_0x4dedd1][0x0]['context'],'priority':_0x975081[_0xa08f('0xe')],'VoiceExtensionId':_0x33123b[_0x4dedd1][0x0]['VoiceExtensionId']});_0x4e12d9[_0xa08f('0x12')](_0x33123b[_0x4dedd1][0x0][_0xa08f('0x16')]);_0x38f4d7=_[_0xa08f('0x42')](_0x38f4d7,_0x975081[_0xa08f('0xf')]);}}return _0x26486a[_0xa08f('0x44')](function(_0xd15e9d){return _0x26486a[_0xa08f('0x2')][_0xa08f('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x4e12d9}},'transaction':_0xd15e9d})[_0xa08f('0x45')](function(_0x394dbf){return _0x26486a[_0xa08f('0x2')][_0xa08f('0x6')][_0xa08f('0x46')](_[_0xa08f('0x47')](_0x38f4d7,_0xa08f('0xe')),{'transaction':_0xd15e9d});});});})[_0xa08f('0x48')](function(_0x34b516){console[_0xa08f('0x49')](_0x34b516);});}exports[_0xa08f('0x4a')]=rewrite;
\ No newline at end of file
+var _0x42b5=['exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','push','type','Set','format','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','MONITOR_OPTIONS=ab','createdAt','interval','*,*,*,*','IntervalId','intervals','tag','CDR(tag)=','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','Interval','findAll','models','then','VoiceExtension','uniq','map'];(function(_0x3a292e,_0x257d9){var _0x2fb40f=function(_0x43a699){while(--_0x43a699){_0x3a292e['push'](_0x3a292e['shift']());}};_0x2fb40f(++_0x257d9);}(_0x42b5,0x1ad));var _0x542b=function(_0x189b1f,_0x189f27){_0x189b1f=_0x189b1f-0x0;var _0x52c66f=_0x42b5[_0x189b1f];return _0x52c66f;};'use strict';var _=require(_0x542b('0x0'));var util=require(_0x542b('0x1'));function rewrite(_0xdd5933,_0x340d09){var _0x3715a7=this;return _0xdd5933['models'][_0x542b('0x2')][_0x542b('0x3')]({'raw':!![]})['then'](function(_0x3e2590){_0x3715a7['intervals']=_0x3e2590;return _0xdd5933[_0x542b('0x4')]['VoiceExtension'][_0x542b('0x3')]({'where':{'IntervalId':_0x340d09['IntervalId']},'raw':!![]});})[_0x542b('0x5')](function(_0x100367){return _0xdd5933[_0x542b('0x4')][_0x542b('0x6')][_0x542b('0x3')]({'where':{'exten':{'$in':_[_0x542b('0x7')](_[_0x542b('0x8')](_0x100367,_0x542b('0x9')))}},'order':[{'raw':_0x542b('0xa')}],'raw':!![]});})[_0x542b('0x5')](function(_0x1de2cc){var _0x5b46d5=_[_0x542b('0xb')](_0x1de2cc,{'priority':'1'});var _0x274c1b=_[_0x542b('0xb')](_0x1de2cc,{'isApp':0x1});var _0x23cf6a=_[_0x542b('0xc')](_0x274c1b,_0x542b('0x9'));var _0x22999a=[_0x542b('0xd'),'playback'];var _0x2a484a=[];var _0x4c9afb=[];for(var _0x277828 in _0x23cf6a){if(_0x23cf6a['hasOwnProperty'](_0x277828)){_0x3715a7[_0x542b('0xe')]=0x2;_0x3715a7[_0x542b('0xf')]=[];_0x3715a7[_0x542b('0x10')]=_[_0x542b('0x11')](_0x5b46d5,{'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')]});_0x3715a7[_0x542b('0xf')][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0][_0x542b('0x13')],'app':_0x542b('0x14'),'appdata':util[_0x542b('0x15')]('CDR(type)=%s',_0x23cf6a[_0x277828][0x0][_0x542b('0x13')]),'context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0]['exten'],'priority':_0x3715a7[_0x542b('0xe')]++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});if(_0x23cf6a[_0x277828][0x0][_0x542b('0x13')]===_0x542b('0x18')){_0x3715a7[_0x542b('0xf')]['push']({'type':_0x23cf6a[_0x277828][0x0][_0x542b('0x13')],'app':_0x542b('0x14'),'appdata':'CDR(routeid)='+_0x23cf6a[_0x277828][0x0][_0x542b('0x17')],'context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x3715a7[_0x542b('0xe')]++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});}else if(_0x23cf6a[_0x277828][0x0]['type']===_0x542b('0x19')){if(_0x3715a7[_0x542b('0x10')]){_0x3715a7[_0x542b('0xf')][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0][_0x542b('0x13')],'app':_0x542b('0x14'),'appdata':_0x542b('0x1a')+(_0x3715a7[_0x542b('0x10')][_0x542b('0x1b')]?_0x542b('0x1c')+_0x3715a7[_0x542b('0x10')][_0x542b('0x1b')]+'}':_0x542b('0x1d')),'context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0]['exten'],'priority':_0x3715a7[_0x542b('0xe')]++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0]['VoiceExtensionId']});}_0x3715a7[_0x542b('0xf')][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0]['type'],'app':_0x542b('0x14'),'appdata':_0x542b('0x1e')+_0x23cf6a[_0x277828][0x0][_0x542b('0x17')],'context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x3715a7['priority']++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});var _0x25b4fd=_0x3715a7[_0x542b('0xe')]++;_0x3715a7[_0x542b('0xf')][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0][_0x542b('0x13')],'app':'ExecIf','appdata':_0x542b('0x1f')+(_0x25b4fd+0x2)+_0x542b('0x20')+(_0x25b4fd+0x1)+')','context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x25b4fd,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});if(_0x3715a7[_0x542b('0x10')]){_0x3715a7[_0x542b('0xf')][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0][_0x542b('0x13')],'app':_0x542b('0x14'),'appdata':_0x3715a7[_0x542b('0x10')][_0x542b('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x3715a7[_0x542b('0x10')][_0x542b('0x1b')]+'}':_0x542b('0x21'),'context':_0x23cf6a[_0x277828][0x0]['context'],'exten':_0x23cf6a[_0x277828][0x0]['exten'],'priority':_0x3715a7['priority']++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0]['VoiceExtensionId']});}_0x3715a7[_0x542b('0xf')]['push']({'type':_0x23cf6a[_0x277828][0x0][_0x542b('0x13')],'app':'Set','appdata':_0x542b('0x22')+_0x23cf6a[_0x277828][0x0][_0x542b('0x17')],'context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x3715a7['priority']++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});if(_0x3715a7[_0x542b('0x10')]&&_0x3715a7[_0x542b('0x10')][_0x542b('0x23')](_0x542b('0x24'))&&_0x3715a7[_0x542b('0x10')][_0x542b('0x24')]!==_0x542b('0x25')){_0x3715a7[_0x542b('0xf')][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0]['type'],'app':_0x542b('0x14'),'appdata':_0x542b('0x26'),'context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x3715a7[_0x542b('0xe')]++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});_0x3715a7['extensions']['push']({'type':_0x23cf6a[_0x277828][0x0][_0x542b('0x13')],'app':_0x542b('0x14'),'appdata':_0x542b('0x27')+_0x3715a7[_0x542b('0x10')]['recordingFormat']||'wav','context':_0x23cf6a[_0x277828][0x0]['context'],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x3715a7[_0x542b('0xe')]++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});}}_0x3715a7[_0x542b('0xf')]['push']({'type':_0x23cf6a[_0x277828][0x0]['type'],'app':_0x542b('0x14'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x3715a7[_0x542b('0xe')]++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});_0x3715a7[_0x542b('0xf')][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0]['type'],'app':_0x542b('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x3715a7['priority']++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});_0x3715a7['extensions'][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0][_0x542b('0x13')],'app':'Set','appdata':_0x542b('0x28'),'context':_0x23cf6a[_0x277828][0x0]['context'],'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'priority':_0x3715a7[_0x542b('0xe')]++,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});for(var _0x29ab0a=0x0,_0x214aaa=0x0;_0x29ab0a<_0x23cf6a[_0x277828]['length'];_0x29ab0a+=0x1,_0x214aaa=0x0){var _0x4858dd=_0x23cf6a[_0x277828][_0x29ab0a];if(_0x4858dd['type']){_0x4858dd[_0x542b('0x13')]=_0x4858dd[_0x542b('0x13')]['toLowerCase']();}var _0x2a554f=[];var _0x2512d5=[];delete _0x4858dd['id'];delete _0x4858dd[_0x542b('0x29')];delete _0x4858dd['updatedAt'];var _0x1c5a20=_0x4858dd[_0x542b('0x2a')]!==_0x542b('0x2b')?[_0x4858dd[_0x542b('0x2a')]]:_0x4858dd[_0x542b('0x2c')]?_[_0x542b('0x8')](_[_0x542b('0xb')](_0x3715a7[_0x542b('0x2d')],{'IntervalId':_0x4858dd[_0x542b('0x2c')]}),'interval'):[];if(_0x4858dd[_0x542b('0x23')](_0x542b('0x2e'))){if(_0x4858dd[_0x542b('0x2e')]&&_0x4858dd[_0x542b('0x2e')]!=='--'){_0x2a554f[_0x542b('0x12')]({'type':_0x4858dd[_0x542b('0x13')],'app':_0x542b('0x14'),'appdata':_0x542b('0x2f')+_0x4858dd[_0x542b('0x2e')],'context':_0x4858dd[_0x542b('0x16')],'exten':_0x4858dd[_0x542b('0x9')],'priority':_0x1c5a20[_0x542b('0x30')]+_0x3715a7[_0x542b('0xe')]+_0x214aaa++,'VoiceExtensionId':_0x4858dd[_0x542b('0x17')]});}}if(_0x4858dd['type']===_0x542b('0x19')&&_0x4858dd[_0x542b('0x23')](_0x542b('0x31'))){if(_0x4858dd[_0x542b('0x31')]){_0x2a554f[_0x542b('0x12')]({'type':_0x4858dd[_0x542b('0x13')],'app':_0x542b('0x32'),'appdata':_0x542b('0x33')+_0x4858dd[_0x542b('0x31')]+')','context':_0x4858dd[_0x542b('0x16')],'exten':_0x4858dd[_0x542b('0x9')],'priority':_0x1c5a20[_0x542b('0x30')]+_0x3715a7[_0x542b('0xe')]+_0x214aaa++,'VoiceExtensionId':_0x4858dd[_0x542b('0x17')]});}else{_0x2a554f[_0x542b('0x12')]({'type':_0x4858dd[_0x542b('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4858dd[_0x542b('0x16')],'exten':_0x4858dd[_0x542b('0x9')],'priority':_0x1c5a20[_0x542b('0x30')]+_0x3715a7['priority']+_0x214aaa++,'VoiceExtensionId':_0x4858dd[_0x542b('0x17')]});}}if(_0x4858dd[_0x542b('0x23')](_0x542b('0x34'))){if(_0x22999a[_0x542b('0x35')](_0x4858dd[_0x542b('0x36')][_0x542b('0x37')]())>=0x0&&_0x4858dd[_0x542b('0x38')]!==_0x542b('0x39')){if(_0x4858dd[_0x542b('0x34')]){_0x2a554f[_0x542b('0x12')]({'type':_0x4858dd['type'],'app':'ExecIf','appdata':_0x542b('0x3a'),'context':_0x4858dd[_0x542b('0x16')],'exten':_0x4858dd[_0x542b('0x9')],'priority':_0x1c5a20[_0x542b('0x30')]+_0x3715a7[_0x542b('0xe')]+_0x214aaa++,'VoiceExtensionId':_0x4858dd[_0x542b('0x17')]});_0x2a554f['push']({'type':_0x4858dd[_0x542b('0x13')],'app':_0x542b('0x14'),'appdata':_0x542b('0x3b'),'context':_0x4858dd[_0x542b('0x16')],'exten':_0x4858dd[_0x542b('0x9')],'priority':_0x1c5a20[_0x542b('0x30')]+_0x3715a7['priority']+_0x214aaa++,'VoiceExtensionId':_0x4858dd[_0x542b('0x17')]});}else{_0x2a554f[_0x542b('0x12')]({'type':_0x4858dd['type'],'app':'ExecIf','appdata':_0x542b('0x3c'),'context':_0x4858dd[_0x542b('0x16')],'exten':_0x4858dd['exten'],'priority':_0x1c5a20[_0x542b('0x30')]+_0x3715a7['priority']+_0x214aaa++,'VoiceExtensionId':_0x4858dd[_0x542b('0x17')]});_0x2a554f[_0x542b('0x12')]({'type':_0x4858dd[_0x542b('0x13')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4858dd[_0x542b('0x16')],'exten':_0x4858dd[_0x542b('0x9')],'priority':_0x1c5a20[_0x542b('0x30')]+_0x3715a7['priority']+_0x214aaa++,'VoiceExtensionId':_0x4858dd[_0x542b('0x17')]});}}}for(var _0x362688=0x0;_0x362688<_0x1c5a20[_0x542b('0x30')];_0x362688+=0x1){var _0x536869=_0x3715a7['priority']+_0x1c5a20[_0x542b('0x30')];var _0x27048e=_0x362688===_0x1c5a20['length']-0x1?_0x3715a7[_0x542b('0xe')]+_0x2a554f[_0x542b('0x30')]+_0x2512d5[_0x542b('0x30')]+0x2:_0x3715a7[_0x542b('0xe')]+_0x362688+0x1;_0x2a554f[_0x542b('0x3d')](_0x362688,0x0,{'type':_0x4858dd[_0x542b('0x13')],'app':_0x542b('0x3e'),'appdata':_0x1c5a20[_0x362688]+'?'+_0x4858dd[_0x542b('0x16')]+_0x542b('0x3f')+_0x536869+':'+_0x4858dd[_0x542b('0x16')]+_0x542b('0x3f')+_0x27048e,'exten':_0x4858dd[_0x542b('0x9')],'context':_0x4858dd[_0x542b('0x16')],'priority':_0x3715a7[_0x542b('0xe')]+_0x362688,'VoiceExtensionId':_0x23cf6a[_0x277828][0x0][_0x542b('0x17')]});}_0x4858dd['priority']=_0x2a554f['length']?_[_0x542b('0x40')](_0x2a554f)[_0x542b('0xe')]+0x1:_0x3715a7[_0x542b('0xe')];_0x3715a7[_0x542b('0xe')]=(_0x2512d5[_0x542b('0x30')]?_[_0x542b('0x40')](_0x2512d5)[_0x542b('0xe')]:_0x4858dd[_0x542b('0xe')])+0x1;_0x3715a7[_0x542b('0xf')]=_[_0x542b('0x41')](_0x3715a7[_0x542b('0xf')],_0x2a554f,[_0x4858dd],_0x2512d5);}_0x3715a7[_0x542b('0xf')][_0x542b('0x12')]({'type':_0x23cf6a[_0x277828][0x0]['type'],'app':_0x542b('0x42'),'exten':_0x23cf6a[_0x277828][0x0][_0x542b('0x9')],'context':_0x23cf6a[_0x277828][0x0][_0x542b('0x16')],'priority':_0x3715a7['priority'],'VoiceExtensionId':_0x23cf6a[_0x277828][0x0]['VoiceExtensionId']});_0x2a484a[_0x542b('0x12')](_0x23cf6a[_0x277828][0x0]['VoiceExtensionId']);_0x4c9afb=_[_0x542b('0x41')](_0x4c9afb,_0x3715a7[_0x542b('0xf')]);}}return _0xdd5933[_0x542b('0x43')](function(_0x22a7ef){return _0xdd5933['models']['VoiceExtension'][_0x542b('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x2a484a}},'transaction':_0x22a7ef})['then'](function(_0x4c9376){return _0xdd5933[_0x542b('0x4')]['VoiceExtension'][_0x542b('0x45')](_[_0x542b('0x46')](_0x4c9afb,'priority'),{'transaction':_0x22a7ef});});});})[_0x542b('0x47')](function(_0x35365b){console[_0x542b('0x48')](_0x35365b);});}exports['rewrite']=rewrite;
\ No newline at end of file
index 7c18793..5ae5092 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcfa=['contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','zipObject','split','Missing\x20ListId\x20parameter!','error','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','hasOwnProperty','data','firstName','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','Duplicate\x20Contact','CmContact','keys','pick','catch','message','stringify','cmContact','insert','into','cm_hopper','scheduledAt','ContactId','select','field','NOW()','toString','createdAt','updatedAt','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','fromQuery','id\x20IN\x20?','calleridnum','cm_hopper_final','cm_contacts','str','cm_hopper_black','VoiceQueue','CmList','Lists','then','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','outbound','Campaign','findAll','dialCheckDuplicateType','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit'];(function(_0x539001,_0x289d10){var _0x14f2fb=function(_0x1fe17a){while(--_0x1fe17a){_0x539001['push'](_0x539001['shift']());}};_0x14f2fb(++_0x289d10);}(_0xdcfa,0x146));var _0xadcf=function(_0x59b48b,_0x584733){_0x59b48b=_0x59b48b-0x0;var _0x4c3f79=_0xdcfa[_0x59b48b];return _0x4c3f79;};'use strict';var BPromise=require(_0xadcf('0x0'));var util=require(_0xadcf('0x1'));var _=require(_0xadcf('0x2'));var fs=require('fs');var squel=require(_0xadcf('0x3'));var Papa=require(_0xadcf('0x4'));var Redis=require('ioredis');var db=require(_0xadcf('0x5'))['db'];var config=require(_0xadcf('0x6'));var logger=require(_0xadcf('0x7'))(_0xadcf('0x8'));config['redis']=_['defaults'](config[_0xadcf('0x9')],{'host':_0xadcf('0xa'),'port':0x18eb});var socket=require(_0xadcf('0xb'))(new Redis(config[_0xadcf('0x9')]));require(_0xadcf('0xc'))[_0xadcf('0xd')](socket);try{if(!process[_0xadcf('0xe')][0x2]||process[_0xadcf('0xe')][0x2]==='undefined'||process[_0xadcf('0xe')][0x2]===_0xadcf('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xadcf('0xe')][0x2];if(!process[_0xadcf('0xe')][0x3]||process['argv'][0x3]==='undefined'||process[_0xadcf('0xe')][0x3]===_0xadcf('0xf')||!process[_0xadcf('0xe')][0x4]||process['argv'][0x4]===_0xadcf('0x10')||process[_0xadcf('0xe')][0x4]===_0xadcf('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xadcf('0x11')](process['argv'][0x3][_0xadcf('0x12')](','),process[_0xadcf('0xe')][0x4][_0xadcf('0x12')](','));if(!process[_0xadcf('0xe')][0x5]||process['argv'][0x5]===_0xadcf('0x10')||process[_0xadcf('0xe')][0x5]===_0xadcf('0xf')){throw new Error(_0xadcf('0x13'));}var LISTID=process[_0xadcf('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xadcf('0xe')][0x6]!==_0xadcf('0x10')&&process[_0xadcf('0xe')][0x6]!==_0xadcf('0xf')?process[_0xadcf('0xe')][0x6]:null;var DUPLICATES=process[_0xadcf('0xe')][0x7]&&process[_0xadcf('0xe')][0x7]!=='undefined'&&process[_0xadcf('0xe')][0x7]!==_0xadcf('0xf')?process[_0xadcf('0xe')][0x7]:null;if(!process[_0xadcf('0xe')][0x8]||process[_0xadcf('0xe')][0x8]==='undefined'||process['argv'][0x8]===_0xadcf('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x111beb){logger[_0xadcf('0x14')](_0x111beb);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(_0xb99ec6,_0x3c772e,_0x5e054d,_0x280662){var _0x3b9765={'message':_0x3c772e};_0x3b9765[_0xb99ec6]=!![];if(_0x5e054d){_0x3b9765['contact']=_0x5e054d;}if(_0x280662){_0x3b9765[_0xadcf('0x15')]=_0x280662;}return _0x3b9765;}function isEmail(_0x40a720){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'](_0x40a720);}function checkRow(_0x107b3b,_0x1b927a,_0x1b1b0e){return new BPromise(function(_0x198b52,_0x49a464){if(_[_0xadcf('0x16')](_0x107b3b)){return _0x49a464(handleCheckRowError(_0xadcf('0x14'),_0xadcf('0x17'),null,_0x1b1b0e));}if(_0x107b3b['errors']&&_0x107b3b[_0xadcf('0x18')][_0xadcf('0x19')]){var _0x2af3e7=_['map'](_0x107b3b[_0xadcf('0x18')],'message')[_0xadcf('0x1a')](';');return _0x49a464(handleCheckRowError(_0xadcf('0x14'),_0x2af3e7,null,_0x1b1b0e));}var _0x4149a0={};for(var _0x3f8fc0 in FIELDS){if(FIELDS[_0xadcf('0x1b')](_0x3f8fc0)&&FIELDS[_0x3f8fc0]){_0x4149a0[_0x3f8fc0]=_0x107b3b[_0xadcf('0x1c')][0x0][FIELDS[_0x3f8fc0]]||_0x107b3b['data'][0x0]['\ufeff'+FIELDS[_0x3f8fc0]];}}if(!_0x4149a0[_0xadcf('0x1d')]){return _0x49a464(handleCheckRowError(_0xadcf('0x14'),'firstName\x20not\x20specified!',null,_0x1b1b0e));}if(!_0x4149a0[_0xadcf('0x1e')]){return _0x49a464(handleCheckRowError(_0xadcf('0x14'),'phone\x20not\x20specified!',null,_0x1b1b0e));}if(_0x4149a0[_0xadcf('0x1f')]){var _0x2fe8ff=moment(_0x4149a0[_0xadcf('0x1f')],_0xadcf('0x20'));if(!_0x2fe8ff[_0xadcf('0x21')]()){return _0x49a464(handleCheckRowError(_0xadcf('0x14'),_0xadcf('0x22'),null,_0x1b1b0e));}}if(_0x4149a0[_0xadcf('0x23')]){if(!isEmail(_0x4149a0['email'])){return _0x49a464(handleCheckRowError(_0xadcf('0x14'),'email\x20format\x20is\x20not\x20valid!',null,_0x1b1b0e));}}_0x4149a0[_0xadcf('0x24')]=LISTID;_0x4149a0['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xadcf('0x19')]&&_0x1b927a){var _0x2aa017={};for(var _0x4cc702=0x0,_0x46a077=DUPLICATES[_0xadcf('0x19')];_0x4cc702<_0x46a077;_0x4cc702+=0x1){_0x2aa017[DUPLICATES[_0x4cc702]]=_0x4149a0[DUPLICATES[_0x4cc702]];}var _0x23f960=_['find'](_0x1b927a,_0x2aa017);if(_0x23f960){return _0x49a464(handleCheckRowError('duplicate',_0xadcf('0x25'),_0x23f960,_0x1b1b0e));}}return db[_0xadcf('0x26')]['create'](_0x4149a0,{'raw':!![],'hooks':![],'fields':_[_0xadcf('0x27')](_0x4149a0)})['then'](function(_0x57d129){if(DUPLICATES&&DUPLICATES[_0xadcf('0x19')]&&_0x1b927a){_0x1b927a['push'](_[_0xadcf('0x28')](_0x4149a0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x57d129['id'];return _0x198b52();})[_0xadcf('0x29')](function(_0x1b2ef9){return _0x49a464(handleCheckRowError(_0xadcf('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1b2ef9[_0xadcf('0x2a')]||JSON[_0xadcf('0x2b')](_0x1b2ef9)),null,_0x1b1b0e));});});}function checkHopper(){function _0x4e9198(){return function(_0x4cab3f){logger[_0xadcf('0x14')](_0xadcf('0x2c'),'checkHopper',util['inspect'](_0x4cab3f,{'showHidden':![],'depth':null}));};}var _0x9da2b2=function(_0xd26c63,_0xb0c3ec){var _0x3be303=squel[_0xadcf('0x2d')]()[_0xadcf('0x2e')](_0xadcf('0x2f'))['fromQuery']([_0xadcf('0x1e'),_0xadcf('0x30'),_0xadcf('0x31'),'ListId',_0xb0c3ec,'createdAt','updatedAt'],squel[_0xadcf('0x32')]()[_0xadcf('0x33')]('phone',_0xadcf('0x1e'))[_0xadcf('0x33')](_0xadcf('0x34'),_0xadcf('0x30'))[_0xadcf('0x33')]('id','ContactId')[_0xadcf('0x33')](LISTID[_0xadcf('0x35')](),_0xadcf('0x24'))[_0xadcf('0x33')](_0xd26c63['id']['toString'](),_0xb0c3ec)[_0xadcf('0x33')](_0xadcf('0x34'),_0xadcf('0x36'))['field']('NOW()',_0xadcf('0x37'))['from']('cm_contacts')[_0xadcf('0x38')](_0xadcf('0x39'))[_0xadcf('0x38')](_0xadcf('0x3a'),LISTID[_0xadcf('0x35')]())[_0xadcf('0x38')](_0xadcf('0x3b'))[_0xadcf('0x38')](_0xadcf('0x3c'),squel[_0xadcf('0x32')]()[_0xadcf('0x33')](_0xadcf('0x1e'))[_0xadcf('0x3d')]('cm_hopper')[_0xadcf('0x38')](_0xb0c3ec+_0xadcf('0x3e'),_0xd26c63['id'][_0xadcf('0x35')]())))[_0xadcf('0x35')]();return _0x3be303;};var _0x6c07e5=function(_0x53ed8c,_0x12e8af){var _0x4552ec=squel[_0xadcf('0x2d')]()[_0xadcf('0x2e')](_0xadcf('0x2f'))[_0xadcf('0x3f')](['phone',_0xadcf('0x30'),_0xadcf('0x31'),'ListId',_0x12e8af,_0xadcf('0x36'),'updatedAt'],squel[_0xadcf('0x32')]()['field'](_0xadcf('0x1e'),_0xadcf('0x1e'))[_0xadcf('0x33')](_0xadcf('0x34'),'scheduledAt')['field']('id',_0xadcf('0x31'))['field'](LISTID['toString'](),_0xadcf('0x24'))['field'](_0x53ed8c['id'][_0xadcf('0x35')](),_0x12e8af)[_0xadcf('0x33')](_0xadcf('0x34'),_0xadcf('0x36'))[_0xadcf('0x33')](_0xadcf('0x34'),_0xadcf('0x37'))[_0xadcf('0x3d')]('cm_contacts')[_0xadcf('0x38')](_0xadcf('0x39'))[_0xadcf('0x38')](_0xadcf('0x3a'),LISTID[_0xadcf('0x35')]())[_0xadcf('0x38')](_0xadcf('0x40'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xadcf('0x38')](_0xadcf('0x3c'),squel[_0xadcf('0x32')]()[_0xadcf('0x33')](_0xadcf('0x41'))[_0xadcf('0x3d')](_0xadcf('0x42'))['where'](_0x12e8af+_0xadcf('0x3e'),_0x53ed8c['id'][_0xadcf('0x35')]()))[_0xadcf('0x38')](_0xadcf('0x3c'),squel[_0xadcf('0x32')]()[_0xadcf('0x33')]('phone')[_0xadcf('0x3d')](_0xadcf('0x2f'))[_0xadcf('0x38')](_0x12e8af+_0xadcf('0x3e'),_0x53ed8c['id'][_0xadcf('0x35')]())))[_0xadcf('0x35')]();return _0x4552ec;};function _0x55f009(_0x516f39,_0x3f1715){var _0x479363=squel['insert']()[_0xadcf('0x2e')](_0xadcf('0x2f'))[_0xadcf('0x3f')]([_0xadcf('0x1e'),'scheduledAt',_0xadcf('0x31'),'ListId',_0x3f1715,_0xadcf('0x36'),_0xadcf('0x37')],squel[_0xadcf('0x32')]()['field']('phone',_0xadcf('0x1e'))[_0xadcf('0x33')](_0xadcf('0x34'),_0xadcf('0x30'))[_0xadcf('0x33')]('id',_0xadcf('0x31'))[_0xadcf('0x33')](LISTID['toString'](),'ListId')[_0xadcf('0x33')](_0x516f39['id'][_0xadcf('0x35')](),_0x3f1715)['field'](_0xadcf('0x34'),_0xadcf('0x36'))[_0xadcf('0x33')](_0xadcf('0x34'),'updatedAt')[_0xadcf('0x3d')](_0xadcf('0x43'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xadcf('0x3a'),LISTID[_0xadcf('0x35')]())[_0xadcf('0x38')]('id\x20IN\x20?',squel[_0xadcf('0x44')](hopperContacts))[_0xadcf('0x38')](_0xadcf('0x3b')))[_0xadcf('0x35')]();return _0x479363;}function _0x2f5761(_0x22009d,_0x4b273b){var _0x2af88b=squel[_0xadcf('0x2d')]()[_0xadcf('0x2e')](_0xadcf('0x45'))[_0xadcf('0x3f')]([_0xadcf('0x1e'),'ContactId',_0xadcf('0x24'),_0x4b273b,_0xadcf('0x36'),_0xadcf('0x37')],squel[_0xadcf('0x32')]()[_0xadcf('0x33')](_0xadcf('0x1e'),_0xadcf('0x1e'))[_0xadcf('0x33')]('id',_0xadcf('0x31'))['field'](LISTID['toString'](),_0xadcf('0x24'))[_0xadcf('0x33')](_0x22009d['id'][_0xadcf('0x35')](),_0x4b273b)[_0xadcf('0x33')](_0xadcf('0x34'),_0xadcf('0x36'))[_0xadcf('0x33')](_0xadcf('0x34'),_0xadcf('0x37'))[_0xadcf('0x3d')](_0xadcf('0x43'))['where']('deletedAt\x20IS\x20NULL')[_0xadcf('0x38')](_0xadcf('0x3a'),LISTID[_0xadcf('0x35')]())[_0xadcf('0x38')](_0xadcf('0x40'),squel['str'](hopperContacts))[_0xadcf('0x38')](_0xadcf('0x3b')))[_0xadcf('0x35')]();return _0x2af88b;}return db[_0xadcf('0x46')]['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xadcf('0x47')],'as':_0xadcf('0x48'),'where':{'id':LISTID}}]})[_0xadcf('0x49')](function(_0x505124){var _0x275cd9=[];if(_0x505124){var _0x4445dc;for(var _0x48403e=0x0,_0x5d1aa6;_0x48403e<_0x505124['length'];_0x48403e+=0x1){_0x5d1aa6=_0x505124[_0x48403e][_0xadcf('0x4a')]({'plain':!![]});switch(_0x5d1aa6['dialCheckDuplicateType']){case'always':_0x275cd9[_0xadcf('0x4b')](db[_0xadcf('0x4c')][_0xadcf('0x4d')](_0x6c07e5(_0x5d1aa6,_0xadcf('0x4e')))[_0xadcf('0x49')](function(){})[_0xadcf('0x29')](_0x4e9198()));break;case _0xadcf('0x4f'):_0x275cd9[_0xadcf('0x4b')](db[_0xadcf('0x4c')]['query'](_0x9da2b2(_0x5d1aa6,_0xadcf('0x4e')))[_0xadcf('0x49')](function(){})['catch'](_0x4e9198()));break;default:_0x275cd9[_0xadcf('0x4b')](db[_0xadcf('0x4c')]['query'](_0x55f009(_0x5d1aa6,_0xadcf('0x4e')))['then'](function(){})[_0xadcf('0x29')](_0x4e9198()));}}}return _0x275cd9;})[_0xadcf('0x50')]()[_0xadcf('0x49')](function(){return db[_0xadcf('0x46')]['findAll']({'where':{'type':_0xadcf('0x51')},'attributes':['id'],'include':[{'model':db[_0xadcf('0x47')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xadcf('0x49')](function(_0x3fb8c3){var _0x2c68d0=[];if(_0x3fb8c3){var _0x1a330b;for(var _0x3e61ff=0x0,_0x3c5dd4;_0x3e61ff<_0x3fb8c3[_0xadcf('0x19')];_0x3e61ff+=0x1){_0x3c5dd4=_0x3fb8c3[_0x3e61ff][_0xadcf('0x4a')]({'plain':!![]});_0x2c68d0[_0xadcf('0x4b')](db[_0xadcf('0x4c')]['query'](_0x2f5761(_0x3c5dd4,_0xadcf('0x4e')))[_0xadcf('0x49')](function(){})['catch'](_0x4e9198()));}}return _0x2c68d0;})[_0xadcf('0x50')]();})[_0xadcf('0x49')](function(){return db[_0xadcf('0x52')][_0xadcf('0x53')]({'attributes':['id',_0xadcf('0x54')],'include':[{'model':db[_0xadcf('0x47')],'as':_0xadcf('0x48'),'where':{'id':LISTID}}]})['then'](function(_0x2b78fb){var _0x468d3a=[];if(_0x2b78fb){for(var _0x28fde6=0x0,_0x41348a;_0x28fde6<_0x2b78fb[_0xadcf('0x19')];_0x28fde6+=0x1){_0x41348a=_0x2b78fb[_0x28fde6][_0xadcf('0x4a')]({'plain':!![]});switch(_0x41348a['dialCheckDuplicateType']){case'always':_0x468d3a['push'](db[_0xadcf('0x4c')][_0xadcf('0x4d')](_0x6c07e5(_0x41348a,_0xadcf('0x55')))['then'](function(){})[_0xadcf('0x29')](_0x4e9198()));break;case _0xadcf('0x4f'):_0x468d3a['push'](db[_0xadcf('0x4c')]['query'](_0x9da2b2(_0x41348a,_0xadcf('0x55')))[_0xadcf('0x49')](function(){})[_0xadcf('0x29')](_0x4e9198()));break;default:_0x468d3a[_0xadcf('0x4b')](db[_0xadcf('0x4c')][_0xadcf('0x4d')](_0x55f009(_0x41348a,'CampaignId'))['then'](function(){})['catch'](_0x4e9198()));}}}return _0x468d3a;})['all']();})[_0xadcf('0x49')](function(){return db[_0xadcf('0x52')][_0xadcf('0x53')]({'attributes':['id'],'include':[{'model':db[_0xadcf('0x47')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0xe57d0c){var _0x3aee2b=[];if(_0xe57d0c){for(var _0x35605f=0x0,_0x2ff45b;_0x35605f<_0xe57d0c[_0xadcf('0x19')];_0x35605f+=0x1){_0x2ff45b=_0xe57d0c[_0x35605f]['get']({'plain':!![]});_0x3aee2b[_0xadcf('0x4b')](db[_0xadcf('0x4c')]['query'](_0x2f5761(_0x2ff45b,_0xadcf('0x55')))['then'](function(){})['catch'](_0x4e9198()));}}return _0x3aee2b;})[_0xadcf('0x50')]();})[_0xadcf('0x29')](function(_0x333a6e){logger['error']('cmContact,\x20%s,\x20%s',_0xadcf('0x56'),_0x333a6e[_0xadcf('0x2a')]);});}var processPromises=function(_0x1ab907){return BPromise[_0xadcf('0x50')](promises)[_0xadcf('0x49')](function(_0x86d2e8){})[_0xadcf('0x29')](function(_0x404e5e){logger[_0xadcf('0x14')](_0xadcf('0x57'),JSON[_0xadcf('0x2b')](_0x404e5e));})[_0xadcf('0x58')](function(){socket[_0xadcf('0x59')](_0xadcf('0x5a')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1ab907){return _0x1ab907[_0xadcf('0x5b')]();}});};var endCsv=function(){return BPromise[_0xadcf('0x5c')]()[_0xadcf('0x49')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xadcf('0x59')](_0xadcf('0x5a')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x3f1aed){logger[_0xadcf('0x14')](_0xadcf('0x5d'),JSON[_0xadcf('0x2b')](_0x3f1aed));}finally{process['exit'](0x0);}});};process['on'](_0xadcf('0x5e'),function(){logger[_0xadcf('0x5f')](_0xadcf('0x60'));endCsv();});function main(){return BPromise[_0xadcf('0x5c')]()[_0xadcf('0x49')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xadcf('0x12')](',');return db[_0xadcf('0x26')][_0xadcf('0x53')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x652dac){var _0x52811e=fs[_0xadcf('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xadcf('0x62')](_0x52811e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5af805,_0x1fb0b2){total+=0x1;var _0x9c6a84=total;promises[_0xadcf('0x4b')](checkRow(_0x5af805,_0x652dac,_0x9c6a84)[_0xadcf('0x49')](function(){success+=0x1;})[_0xadcf('0x29')](function(_0x2a0918){if(_0x2a0918[_0xadcf('0x14')]){errors+=0x1;delete _0x2a0918[_0xadcf('0x14')];}else if(_0x2a0918[_0xadcf('0x63')]){duplicates+=0x1;delete _0x2a0918[_0xadcf('0x63')];}rows[_0xadcf('0x4b')](_0x2a0918);}));if(total%0xc8===0x0){_0x1fb0b2[_0xadcf('0x64')]();return processPromises(_0x1fb0b2);}},'complete':function(){return processPromises()[_0xadcf('0x49')](function(){logger['info'](_0xadcf('0x65'));endCsv();});},'error':function(_0x943c1c,_0x2348b4){logger['info'](_0xadcf('0x66'),JSON[_0xadcf('0x2b')](_0x943c1c));endCsv();}});})[_0xadcf('0x29')](function(_0x1ee219){logger[_0xadcf('0x14')](_0xadcf('0x67'),JSON[_0xadcf('0x2b')](_0x1ee219));});}main();
\ No newline at end of file
+var _0xf79d=['str','VoiceQueue','findAll','outbound','CmList','Lists','then','get','dialCheckDuplicateType','sequelize','query','VoiceQueueId','all','Campaign','always','CampaignId','onlyIfOpen','BlackLists','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','squel','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','Missing\x20filepath\x20parameter!','argv','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','Duplicate\x20Contact','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','phone','field','toString','NOW()','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','into','calleridnum','insert','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black'];(function(_0x4dc9d4,_0x16813f){var _0x7db194=function(_0x5b48d5){while(--_0x5b48d5){_0x4dc9d4['push'](_0x4dc9d4['shift']());}};_0x7db194(++_0x16813f);}(_0xf79d,0x1e1));var _0xdf79=function(_0x260010,_0xb0e543){_0x260010=_0x260010-0x0;var _0x6c06f2=_0xf79d[_0x260010];return _0x6c06f2;};'use strict';var BPromise=require(_0xdf79('0x0'));var util=require(_0xdf79('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xdf79('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xdf79('0x3'))['db'];var config=require(_0xdf79('0x4'));var logger=require(_0xdf79('0x5'))(_0xdf79('0x6'));config[_0xdf79('0x7')]=_[_0xdf79('0x8')](config[_0xdf79('0x7')],{'host':_0xdf79('0x9'),'port':0x18eb});var socket=require(_0xdf79('0xa'))(new Redis(config[_0xdf79('0x7')]));require(_0xdf79('0xb'))['register'](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]==='undefined'||process['argv'][0x2]==='null'){throw new Error(_0xdf79('0xc'));}var FILEPATH=process[_0xdf79('0xd')][0x2];if(!process[_0xdf79('0xd')][0x3]||process['argv'][0x3]===_0xdf79('0xe')||process[_0xdf79('0xd')][0x3]===_0xdf79('0xf')||!process[_0xdf79('0xd')][0x4]||process[_0xdf79('0xd')][0x4]===_0xdf79('0xe')||process['argv'][0x4]===_0xdf79('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xdf79('0x10')](process[_0xdf79('0xd')][0x3][_0xdf79('0x11')](','),process[_0xdf79('0xd')][0x4][_0xdf79('0x11')](','));if(!process[_0xdf79('0xd')][0x5]||process[_0xdf79('0xd')][0x5]===_0xdf79('0xe')||process[_0xdf79('0xd')][0x5]===_0xdf79('0xf')){throw new Error(_0xdf79('0x12'));}var LISTID=process[_0xdf79('0xd')][0x5];var COMPANYID=process[_0xdf79('0xd')][0x6]&&process['argv'][0x6]!==_0xdf79('0xe')&&process[_0xdf79('0xd')][0x6]!==_0xdf79('0xf')?process[_0xdf79('0xd')][0x6]:null;var DUPLICATES=process[_0xdf79('0xd')][0x7]&&process['argv'][0x7]!==_0xdf79('0xe')&&process[_0xdf79('0xd')][0x7]!=='null'?process[_0xdf79('0xd')][0x7]:null;if(!process[_0xdf79('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0xdf79('0xd')][0x8]===_0xdf79('0xf')){throw new Error(_0xdf79('0x13'));}var SOCKET_TIMESTAMP=process[_0xdf79('0xd')][0x8];}catch(_0xc00b7c){logger[_0xdf79('0x14')](_0xc00b7c);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(_0x177e54,_0x445ef6,_0x38ae88,_0x26683b){var _0x1dab39={'message':_0x445ef6};_0x1dab39[_0x177e54]=!![];if(_0x38ae88){_0x1dab39[_0xdf79('0x15')]=_0x38ae88;}if(_0x26683b){_0x1dab39[_0xdf79('0x16')]=_0x26683b;}return _0x1dab39;}function isEmail(_0x5bae7e){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))*$/[_0xdf79('0x17')](_0x5bae7e);}function checkRow(_0x102608,_0x16b4b5,_0x380b66){return new BPromise(function(_0x5ae611,_0x3d4a2f){if(_['isNil'](_0x102608)){return _0x3d4a2f(handleCheckRowError('error',_0xdf79('0x18'),null,_0x380b66));}if(_0x102608[_0xdf79('0x19')]&&_0x102608[_0xdf79('0x19')][_0xdf79('0x1a')]){var _0x2827b4=_[_0xdf79('0x1b')](_0x102608[_0xdf79('0x19')],_0xdf79('0x1c'))[_0xdf79('0x1d')](';');return _0x3d4a2f(handleCheckRowError('error',_0x2827b4,null,_0x380b66));}var _0x3e6b90={};for(var _0x5172b2 in FIELDS){if(FIELDS[_0xdf79('0x1e')](_0x5172b2)&&FIELDS[_0x5172b2]){_0x3e6b90[_0x5172b2]=_0x102608[_0xdf79('0x1f')][0x0][FIELDS[_0x5172b2]]||_0x102608[_0xdf79('0x1f')][0x0]['\ufeff'+FIELDS[_0x5172b2]];}}if(!_0x3e6b90[_0xdf79('0x20')]){return _0x3d4a2f(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x380b66));}if(!_0x3e6b90['phone']){return _0x3d4a2f(handleCheckRowError(_0xdf79('0x14'),_0xdf79('0x21'),null,_0x380b66));}if(_0x3e6b90[_0xdf79('0x22')]){var _0x5c1f36=moment(_0x3e6b90['birthDate'],'YYYY-MM-DD');if(!_0x5c1f36[_0xdf79('0x23')]()){return _0x3d4a2f(handleCheckRowError('error',_0xdf79('0x24'),null,_0x380b66));}}if(_0x3e6b90[_0xdf79('0x25')]){if(!isEmail(_0x3e6b90[_0xdf79('0x25')])){return _0x3d4a2f(handleCheckRowError(_0xdf79('0x14'),_0xdf79('0x26'),null,_0x380b66));}}_0x3e6b90[_0xdf79('0x27')]=LISTID;_0x3e6b90['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xdf79('0x1a')]&&_0x16b4b5){var _0x81f656={};for(var _0x4eb3ed=0x0,_0x186b67=DUPLICATES['length'];_0x4eb3ed<_0x186b67;_0x4eb3ed+=0x1){_0x81f656[DUPLICATES[_0x4eb3ed]]=_0x3e6b90[DUPLICATES[_0x4eb3ed]];}var _0x206b03=_[_0xdf79('0x28')](_0x16b4b5,_0x81f656);if(_0x206b03){return _0x3d4a2f(handleCheckRowError('duplicate',_0xdf79('0x29'),_0x206b03,_0x380b66));}}return db[_0xdf79('0x2a')][_0xdf79('0x2b')](_0x3e6b90,{'raw':!![],'hooks':![],'fields':_[_0xdf79('0x2c')](_0x3e6b90)})['then'](function(_0x332730){if(DUPLICATES&&DUPLICATES[_0xdf79('0x1a')]&&_0x16b4b5){_0x16b4b5[_0xdf79('0x2d')](_[_0xdf79('0x2e')](_0x3e6b90,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x332730['id'];return _0x5ae611();})[_0xdf79('0x2f')](function(_0x4959ad){return _0x3d4a2f(handleCheckRowError('error',_0xdf79('0x30')+(_0x4959ad['message']||JSON['stringify'](_0x4959ad)),null,_0x380b66));});});}function checkHopper(){function _0x41abc5(){return function(_0x252162){logger[_0xdf79('0x14')](_0xdf79('0x31'),'checkHopper',util['inspect'](_0x252162,{'showHidden':![],'depth':null}));};}var _0xf20968=function(_0x20ff93,_0xd8f9a){var _0x34d988=squel['insert']()['into']('cm_hopper')[_0xdf79('0x32')](['phone',_0xdf79('0x33'),_0xdf79('0x34'),_0xdf79('0x27'),_0xd8f9a,_0xdf79('0x35'),_0xdf79('0x36')],squel[_0xdf79('0x37')]()['field'](_0xdf79('0x38'),_0xdf79('0x38'))['field']('NOW()','scheduledAt')[_0xdf79('0x39')]('id',_0xdf79('0x34'))[_0xdf79('0x39')](LISTID[_0xdf79('0x3a')](),_0xdf79('0x27'))[_0xdf79('0x39')](_0x20ff93['id'][_0xdf79('0x3a')](),_0xd8f9a)[_0xdf79('0x39')](_0xdf79('0x3b'),'createdAt')['field'](_0xdf79('0x3b'),_0xdf79('0x36'))['from']('cm_contacts')[_0xdf79('0x3c')](_0xdf79('0x3d'))[_0xdf79('0x3c')]('ListId\x20=\x20?',LISTID['toString']())[_0xdf79('0x3c')](_0xdf79('0x3e'))[_0xdf79('0x3c')](_0xdf79('0x3f'),squel[_0xdf79('0x37')]()[_0xdf79('0x39')](_0xdf79('0x38'))[_0xdf79('0x40')](_0xdf79('0x41'))[_0xdf79('0x3c')](_0xd8f9a+_0xdf79('0x42'),_0x20ff93['id']['toString']())))[_0xdf79('0x3a')]();return _0x34d988;};var _0x557ad0=function(_0x5df876,_0x61e19d){var _0x2aa6a8=squel['insert']()[_0xdf79('0x43')](_0xdf79('0x41'))['fromQuery']([_0xdf79('0x38'),_0xdf79('0x33'),_0xdf79('0x34'),_0xdf79('0x27'),_0x61e19d,_0xdf79('0x35'),'updatedAt'],squel['select']()['field'](_0xdf79('0x38'),_0xdf79('0x38'))['field'](_0xdf79('0x3b'),'scheduledAt')[_0xdf79('0x39')]('id',_0xdf79('0x34'))['field'](LISTID['toString'](),_0xdf79('0x27'))['field'](_0x5df876['id'][_0xdf79('0x3a')](),_0x61e19d)[_0xdf79('0x39')](_0xdf79('0x3b'),_0xdf79('0x35'))[_0xdf79('0x39')]('NOW()',_0xdf79('0x36'))[_0xdf79('0x40')]('cm_contacts')[_0xdf79('0x3c')](_0xdf79('0x3d'))[_0xdf79('0x3c')]('ListId\x20=\x20?',LISTID[_0xdf79('0x3a')]())[_0xdf79('0x3c')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0xdf79('0x3e'))[_0xdf79('0x3c')](_0xdf79('0x3f'),squel[_0xdf79('0x37')]()[_0xdf79('0x39')](_0xdf79('0x44'))[_0xdf79('0x40')]('cm_hopper_final')['where'](_0x61e19d+_0xdf79('0x42'),_0x5df876['id'][_0xdf79('0x3a')]()))[_0xdf79('0x3c')](_0xdf79('0x3f'),squel[_0xdf79('0x37')]()[_0xdf79('0x39')](_0xdf79('0x38'))[_0xdf79('0x40')]('cm_hopper')[_0xdf79('0x3c')](_0x61e19d+_0xdf79('0x42'),_0x5df876['id'][_0xdf79('0x3a')]())))[_0xdf79('0x3a')]();return _0x2aa6a8;};function _0x135e06(_0x11be08,_0xa25cfc){var _0x259dcc=squel[_0xdf79('0x45')]()['into'](_0xdf79('0x41'))[_0xdf79('0x32')](['phone',_0xdf79('0x33'),_0xdf79('0x34'),_0xdf79('0x27'),_0xa25cfc,'createdAt',_0xdf79('0x36')],squel[_0xdf79('0x37')]()[_0xdf79('0x39')](_0xdf79('0x38'),_0xdf79('0x38'))[_0xdf79('0x39')](_0xdf79('0x3b'),_0xdf79('0x33'))[_0xdf79('0x39')]('id',_0xdf79('0x34'))[_0xdf79('0x39')](LISTID['toString'](),_0xdf79('0x27'))[_0xdf79('0x39')](_0x11be08['id'][_0xdf79('0x3a')](),_0xa25cfc)[_0xdf79('0x39')](_0xdf79('0x3b'),_0xdf79('0x35'))[_0xdf79('0x39')]('NOW()',_0xdf79('0x36'))[_0xdf79('0x40')](_0xdf79('0x46'))[_0xdf79('0x3c')]('deletedAt\x20IS\x20NULL')[_0xdf79('0x3c')](_0xdf79('0x47'),LISTID[_0xdf79('0x3a')]())[_0xdf79('0x3c')](_0xdf79('0x48'),squel['str'](hopperContacts))[_0xdf79('0x3c')](_0xdf79('0x3e')))[_0xdf79('0x3a')]();return _0x259dcc;}function _0x273c2f(_0x889e2a,_0x5b22d4){var _0x1d6812=squel['insert']()[_0xdf79('0x43')](_0xdf79('0x49'))[_0xdf79('0x32')](['phone',_0xdf79('0x34'),'ListId',_0x5b22d4,_0xdf79('0x35'),_0xdf79('0x36')],squel['select']()[_0xdf79('0x39')]('phone','phone')[_0xdf79('0x39')]('id',_0xdf79('0x34'))[_0xdf79('0x39')](LISTID[_0xdf79('0x3a')](),_0xdf79('0x27'))['field'](_0x889e2a['id'][_0xdf79('0x3a')](),_0x5b22d4)[_0xdf79('0x39')](_0xdf79('0x3b'),_0xdf79('0x35'))[_0xdf79('0x39')](_0xdf79('0x3b'),_0xdf79('0x36'))[_0xdf79('0x40')](_0xdf79('0x46'))['where']('deletedAt\x20IS\x20NULL')[_0xdf79('0x3c')](_0xdf79('0x47'),LISTID[_0xdf79('0x3a')]())[_0xdf79('0x3c')](_0xdf79('0x48'),squel[_0xdf79('0x4a')](hopperContacts))['where'](_0xdf79('0x3e')))[_0xdf79('0x3a')]();return _0x1d6812;}return db[_0xdf79('0x4b')][_0xdf79('0x4c')]({'where':{'type':_0xdf79('0x4d')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xdf79('0x4e')],'as':_0xdf79('0x4f'),'where':{'id':LISTID}}]})[_0xdf79('0x50')](function(_0x226e90){var _0x30755a=[];if(_0x226e90){var _0x3b6d45;for(var _0x917227=0x0,_0x14a592;_0x917227<_0x226e90[_0xdf79('0x1a')];_0x917227+=0x1){_0x14a592=_0x226e90[_0x917227][_0xdf79('0x51')]({'plain':!![]});switch(_0x14a592[_0xdf79('0x52')]){case'always':_0x30755a['push'](db[_0xdf79('0x53')][_0xdf79('0x54')](_0x557ad0(_0x14a592,_0xdf79('0x55')))[_0xdf79('0x50')](function(){})['catch'](_0x41abc5()));break;case'onlyIfOpen':_0x30755a[_0xdf79('0x2d')](db[_0xdf79('0x53')][_0xdf79('0x54')](_0xf20968(_0x14a592,_0xdf79('0x55')))[_0xdf79('0x50')](function(){})[_0xdf79('0x2f')](_0x41abc5()));break;default:_0x30755a[_0xdf79('0x2d')](db['sequelize'][_0xdf79('0x54')](_0x135e06(_0x14a592,'VoiceQueueId'))['then'](function(){})[_0xdf79('0x2f')](_0x41abc5()));}}}return _0x30755a;})['all']()[_0xdf79('0x50')](function(){return db[_0xdf79('0x4b')][_0xdf79('0x4c')]({'where':{'type':_0xdf79('0x4d')},'attributes':['id'],'include':[{'model':db[_0xdf79('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xdf79('0x50')](function(_0x3904fd){var _0x2f0bba=[];if(_0x3904fd){var _0x1fa151;for(var _0x20b508=0x0,_0x26bcac;_0x20b508<_0x3904fd[_0xdf79('0x1a')];_0x20b508+=0x1){_0x26bcac=_0x3904fd[_0x20b508]['get']({'plain':!![]});_0x2f0bba[_0xdf79('0x2d')](db['sequelize']['query'](_0x273c2f(_0x26bcac,_0xdf79('0x55')))[_0xdf79('0x50')](function(){})[_0xdf79('0x2f')](_0x41abc5()));}}return _0x2f0bba;})[_0xdf79('0x56')]();})[_0xdf79('0x50')](function(){return db[_0xdf79('0x57')][_0xdf79('0x4c')]({'attributes':['id',_0xdf79('0x52')],'include':[{'model':db[_0xdf79('0x4e')],'as':_0xdf79('0x4f'),'where':{'id':LISTID}}]})[_0xdf79('0x50')](function(_0x51c3e2){var _0x1c2b5e=[];if(_0x51c3e2){for(var _0x218ec0=0x0,_0x460869;_0x218ec0<_0x51c3e2['length'];_0x218ec0+=0x1){_0x460869=_0x51c3e2[_0x218ec0][_0xdf79('0x51')]({'plain':!![]});switch(_0x460869[_0xdf79('0x52')]){case _0xdf79('0x58'):_0x1c2b5e[_0xdf79('0x2d')](db['sequelize']['query'](_0x557ad0(_0x460869,_0xdf79('0x59')))['then'](function(){})[_0xdf79('0x2f')](_0x41abc5()));break;case _0xdf79('0x5a'):_0x1c2b5e['push'](db[_0xdf79('0x53')][_0xdf79('0x54')](_0xf20968(_0x460869,'CampaignId'))[_0xdf79('0x50')](function(){})['catch'](_0x41abc5()));break;default:_0x1c2b5e[_0xdf79('0x2d')](db['sequelize'][_0xdf79('0x54')](_0x135e06(_0x460869,'CampaignId'))['then'](function(){})['catch'](_0x41abc5()));}}}return _0x1c2b5e;})[_0xdf79('0x56')]();})['then'](function(){return db[_0xdf79('0x57')][_0xdf79('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xdf79('0x5b'),'where':{'id':LISTID}}]})[_0xdf79('0x50')](function(_0x333b85){var _0x15454e=[];if(_0x333b85){for(var _0x18487f=0x0,_0x599200;_0x18487f<_0x333b85[_0xdf79('0x1a')];_0x18487f+=0x1){_0x599200=_0x333b85[_0x18487f]['get']({'plain':!![]});_0x15454e[_0xdf79('0x2d')](db[_0xdf79('0x53')][_0xdf79('0x54')](_0x273c2f(_0x599200,_0xdf79('0x59')))[_0xdf79('0x50')](function(){})[_0xdf79('0x2f')](_0x41abc5()));}}return _0x15454e;})[_0xdf79('0x56')]();})[_0xdf79('0x2f')](function(_0x4724e6){logger['error']('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x4724e6['message']);});}var processPromises=function(_0x96187){return BPromise[_0xdf79('0x56')](promises)[_0xdf79('0x50')](function(_0x1de60b){})['catch'](function(_0x8e3b39){logger['error'](_0xdf79('0x5c'),JSON[_0xdf79('0x5d')](_0x8e3b39));})[_0xdf79('0x5e')](function(){socket[_0xdf79('0x5f')](_0xdf79('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x96187){return _0x96187[_0xdf79('0x61')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xdf79('0x50')](function(){if(hopperContacts){return checkHopper();}})[_0xdf79('0x50')](function(){socket[_0xdf79('0x5f')](_0xdf79('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xdf79('0x62')](FILEPATH);}catch(_0x473ea2){logger['error'](_0xdf79('0x63'),JSON[_0xdf79('0x5d')](_0x473ea2));}finally{process[_0xdf79('0x64')](0x0);}});};process['on'](_0xdf79('0x65'),function(){logger['info'](_0xdf79('0x66'));endCsv();});function main(){return BPromise[_0xdf79('0x67')]()[_0xdf79('0x50')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xdf79('0x2a')][_0xdf79('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x348988){var _0x2d5f9c=fs[_0xdf79('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xdf79('0x69')](_0x2d5f9c,{'header':!![],'skipEmptyLines':!![],'step':function(_0x206f6e,_0x57a493){total+=0x1;var _0x211230=total;promises[_0xdf79('0x2d')](checkRow(_0x206f6e,_0x348988,_0x211230)[_0xdf79('0x50')](function(){success+=0x1;})[_0xdf79('0x2f')](function(_0x1fc1da){if(_0x1fc1da[_0xdf79('0x14')]){errors+=0x1;delete _0x1fc1da['error'];}else if(_0x1fc1da[_0xdf79('0x6a')]){duplicates+=0x1;delete _0x1fc1da[_0xdf79('0x6a')];}rows['push'](_0x1fc1da);}));if(total%0xc8===0x0){_0x57a493[_0xdf79('0x6b')]();return processPromises(_0x57a493);}},'complete':function(){return processPromises()[_0xdf79('0x50')](function(){logger[_0xdf79('0x6c')](_0xdf79('0x6d'));endCsv();});},'error':function(_0x29a460,_0x3d3eee){logger[_0xdf79('0x6c')](_0xdf79('0x6e'),JSON[_0xdf79('0x5d')](_0x29a460));endCsv();}});})['catch'](function(_0x268247){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xdf79('0x5d')](_0x268247));});}main();
\ No newline at end of file
index 17ed720..bcd2b67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30d7=['No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','localhost','redis','format','YYYY-MM-DD\x20HH:mm:ss','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','then','push','split','length','isNil','filter','CmContactHasItem','findOne','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','toString','cm_hopper_black','fields','cm_contacts.phone\x20NOT\x20IN\x20(?)','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','UserId','\x22onlyIfOpen\x22','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','field','group','info','Received\x20SIGINT','error','message','sequelize','spread','catch','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','query','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=','timezones','utcOffset','set','dialTimezone','stringify','send','clone','socket_timestamp','root','server/files/tmp','.csv','keys','includes','header','ContactItemType','name','_description','parse','data','errors','find','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','replace','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','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()','contactId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','affectedRows','exit','argv','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory'];(function(_0x3fe08e,_0x2619af){var _0x7da8df=function(_0x5ab32f){while(--_0x5ab32f){_0x3fe08e['push'](_0x3fe08e['shift']());}};_0x7da8df(++_0x2619af);}(_0x30d7,0x173));var _0x730d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30d7[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x730d('0x0'));var _=require(_0x730d('0x1'));var Papa=require(_0x730d('0x2'));var util=require(_0x730d('0x3'));var BPromise=require(_0x730d('0x4'));var moment=require('moment');var squel=require(_0x730d('0x5'));var Redis=require(_0x730d('0x6'));var db=require(_0x730d('0x7'))['db'];var config=require(_0x730d('0x8'));var shared=require(_0x730d('0x9'));var logger=require('../../../config/logger')(_0x730d('0xa'));config['redis']=_['defaults'](config['redis'],{'host':_0x730d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x730d('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x730d('0xd')](_0x730d('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x730d('0xe'));function isEmail(_0x5cc9ae){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'](_0x5cc9ae);}function selectNotIn(_0x410632,_0x3b4a83,_0x155ddc,_0x4342cc,_0xb78e86){return squel[_0x730d('0xf')]()['field'](_0x730d('0x10'))[_0x730d('0x11')](_0x4342cc)[_0x730d('0x12')](_0x3b4a83,null,_0x3b4a83+_0x730d('0x13')+_0x4342cc+'.'+_0x155ddc)[_0x730d('0x14')](_0x4342cc+'.'+_0x155ddc+_0x730d('0x15')+_0x410632+'.'+_0x155ddc)[_0x730d('0x14')](_0x3b4a83+_0x730d('0x16')+_0xb78e86[_0x730d('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x538ead,_0x3e0ab4){promisesAdditionalPhones=[];return db[_0x730d('0x17')]['findAll']({'raw':!![],'attributes':['id',_0x730d('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x730d('0x19')](function(_0x24badd){if(_0x24badd!==null){var _0x146c06=[];for(var _0x5a6ccd=0x0;_0x5a6ccd<_0x24badd['length'];_0x5a6ccd++){var _0x25ca0f=_0x24badd[_0x5a6ccd];_0x146c06[_0x730d('0x1a')](insertAdditionalPhones(_0x25ca0f));}}Promise['all'](_0x146c06)[_0x730d('0x19')](function(){_0x538ead({'val':0x1});});});});}function insertAdditionalPhones(_0x29ad61){return new Promise(function(_0x36c700,_0x5e62f9){var _0x1a4bc8=_0x29ad61[_0x730d('0x18')];var _0x2cc959=_0x1a4bc8[_0x730d('0x1b')](';');var _0x216b75=[];orderBy=0x0;for(var _0x9d502e=0x0;_0x9d502e<_0x2cc959[_0x730d('0x1c')];_0x9d502e++){_0x216b75[_0x730d('0x1a')](splitAdditionalPhone(_0x29ad61['id'],_0x2cc959[_0x9d502e]));}Promise['all'](_0x216b75)[_0x730d('0x19')](function(){_0x36c700({'val':_0x2cc959[_0x730d('0x1c')]});});});}function splitAdditionalPhone(_0x32b0cf,_0x250abb){return new Promise(function(_0x3350bb,_0x3c29fe){var _0x2db05f=_0x250abb[_0x730d('0x1b')](':');var _0x41c24d=_0x2db05f[0x0];var _0x228c78=_0x2db05f[0x1];if(!_[_0x730d('0x1d')](_0x228c78)){var _0x4c027b=_0x228c78['split']('|');var _0xad02cd=[];for(var _0x3f2dea=0x0;_0x3f2dea<_0x4c027b[_0x730d('0x1c')];_0x3f2dea++){if(_0x4c027b[_0x3f2dea]!==''){var _0x49be9e=_[_0x730d('0x1e')](promisesAdditionalPhones,{'contactId':_0x32b0cf,'phone':_0x4c027b[_0x3f2dea]});if(_0x49be9e['length']==0x0){orderBy++;promisesAdditionalPhones[_0x730d('0x1a')]({'contactId':_0x32b0cf,'contactTypeId':_0x41c24d,'phone':_0x4c027b[_0x3f2dea],'orderBy':orderBy});}}}_0x3350bb({'ok':0x1});}else _0x3350bb({'res':0x0});});}function createAdditionalPhone(_0x3e0b23,_0x2eea76,_0x4a3635,_0x7493e8){var _0x573186='';var _0x3eb573='';var _0x50cd15=_0x4a3635[_0x730d('0x1b')]('§');_0x573186=_0x50cd15[0x0];if(_0x50cd15[_0x730d('0x1c')]==0x2)_0x3eb573=_0x50cd15[0x1];return new Promise(function(_0x31b857,_0x3b7ee2){return db[_0x730d('0x1f')][_0x730d('0x20')]({'where':{'CmContactId':_0x3e0b23,'item':_0x573186}})['then'](function(_0x998f4d){if(_0x998f4d){return db['CmContactHasItem']['update']({'ItemTypeId':_0x2eea76,'description':_0x3eb573,'OrderBy':_0x7493e8},{'where':{'CmContactId':_0x3e0b23,'item':_0x573186}})['then'](function(_0x552281){_0x31b857({'res':_0x730d('0x21')});});}else{return db[_0x730d('0x1f')][_0x730d('0x22')]({'CmContactId':_0x3e0b23,'item':_0x573186,'description':_0x3eb573,'ItemTypeId':_0x2eea76,'OrderBy':_0x7493e8,'ItemClass':'PHONE'})['then'](function(_0x1abe2e){_0x31b857({'res':_0x730d('0x23')});});}});});}function insertCmHopper(_0x1548dd,_0x537ed8,_0x20e811,_0x17da9d,_0x29ec23){var _0x3cd11e=[_0x730d('0x24'),_0x730d('0x25'),_0x730d('0x26'),_0x730d('0x27'),_0x537ed8+'.'+_0x17da9d,_0x730d('0x28'),_0x730d('0x29'),_0x730d('0x2a'),'cm_contacts.UserId','\x22'+_0x29ec23+'\x22'];return squel[_0x730d('0x2b')]()[_0x730d('0x2c')]('cm_hopper')[_0x730d('0x2d')]([_0x730d('0x10'),_0x730d('0x2e'),_0x730d('0x2f'),_0x730d('0x30'),_0x17da9d,_0x730d('0x31'),_0x730d('0x32'),_0x730d('0x33'),'UserId',_0x730d('0x34')],squel['select']()['fields'](_0x3cd11e)[_0x730d('0x11')](_0x537ed8)[_0x730d('0x12')](_0x730d('0x35'),null,_0x730d('0x36')+_0x537ed8+_0x730d('0x37'))[_0x730d('0x12')](_0x20e811,null,_0x20e811+_0x730d('0x13')+_0x537ed8+'.'+_0x17da9d)[_0x730d('0x14')](_0x537ed8+_0x730d('0x38'),_0x1548dd)[_0x730d('0x14')](_0x730d('0x39'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x537ed8,_0x20e811,_0x17da9d,_0x730d('0x3a'),[_0x730d('0x3b'),'\x22onlyIfOpen\x22']))[_0x730d('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x537ed8,_0x20e811,_0x17da9d,'cm_hopper',[_0x730d('0x3b')])))[_0x730d('0x3c')]();}function insertCmHopperBlack(_0x436a8c,_0x529979,_0x1629a4,_0x459bd8){var _0x12c618=[_0x730d('0x24'),_0x730d('0x26'),_0x730d('0x27'),_0x529979+'.'+_0x459bd8,_0x730d('0x28'),_0x730d('0x29')];return squel['insert']()[_0x730d('0x2c')](_0x730d('0x3d'))[_0x730d('0x2d')](['phone',_0x730d('0x2f'),_0x730d('0x30'),_0x459bd8,_0x730d('0x31'),_0x730d('0x32')],squel['select']()[_0x730d('0x3e')](_0x12c618)[_0x730d('0x11')](_0x529979)[_0x730d('0x12')](_0x730d('0x35'),null,_0x730d('0x36')+_0x529979+_0x730d('0x37'))[_0x730d('0x12')](_0x1629a4,null,_0x1629a4+_0x730d('0x13')+_0x529979+'.'+_0x459bd8)[_0x730d('0x14')](_0x529979+'.CmListId\x20=\x20?',_0x436a8c)[_0x730d('0x14')](_0x730d('0x39'),NOW)[_0x730d('0x14')](_0x730d('0x3f'),squel['select']()['field'](_0x730d('0x10'))[_0x730d('0x11')](_0x730d('0x3d'))[_0x730d('0x14')]('ListId\x20=\x20?',_0x436a8c)[_0x730d('0x14')](_0x459bd8+'\x20=\x20'+_0x529979+'.'+_0x459bd8)))[_0x730d('0x3c')]();}function insertTzCmHopper(_0x3a89e9,_0x1c7390,_0x3a7c37,_0x14b881,_0x4c1195,_0x48ac6b){var _0x48629b=[_0x730d('0x24'),_0x730d('0x40')+_0x48ac6b+_0x730d('0x41'),_0x730d('0x26'),_0x730d('0x27'),_0x1c7390+'.'+_0x14b881,_0x730d('0x28'),_0x730d('0x29'),_0x730d('0x2a'),_0x730d('0x42'),'\x22'+_0x4c1195+'\x22'];var _0xfafb56=squel[_0x730d('0x2b')]()[_0x730d('0x2c')]('cm_hopper')[_0x730d('0x2d')](['phone','scheduledat',_0x730d('0x2f'),'ListId',_0x14b881,_0x730d('0x31'),_0x730d('0x32'),_0x730d('0x33'),_0x730d('0x43'),'recallme'],squel[_0x730d('0xf')]()[_0x730d('0x3e')](_0x48629b)[_0x730d('0x11')](_0x1c7390)['join'](_0x730d('0x35'),null,_0x730d('0x36')+_0x1c7390+'.CmListId')[_0x730d('0x12')](_0x3a7c37,null,_0x3a7c37+_0x730d('0x13')+_0x1c7390+'.'+_0x14b881)[_0x730d('0x12')](_0x48ac6b,null,_0x48ac6b+'.id\x20=\x20'+_0x1c7390+'.'+_0x14b881)['where'](_0x1c7390+_0x730d('0x38'),_0x3a89e9)[_0x730d('0x14')](_0x730d('0x39'),NOW)[_0x730d('0x14')](_0x730d('0x3f'),selectNotIn(_0x1c7390,_0x3a7c37,_0x14b881,_0x730d('0x3a'),[_0x730d('0x3b'),_0x730d('0x44')]))[_0x730d('0x14')](_0x730d('0x3f'),selectNotIn(_0x1c7390,_0x3a7c37,_0x14b881,'cm_hopper',[_0x730d('0x3b')])))[_0x730d('0x3c')]();return _0xfafb56;}function insertTzCmHopperBlack(_0x5025be,_0x55e14a,_0x9f903d,_0x530deb){var _0x4eddee=[_0x730d('0x24'),_0x730d('0x26'),_0x730d('0x27'),_0x55e14a+'.'+_0x530deb,_0x730d('0x28'),_0x730d('0x29')];return squel[_0x730d('0x2b')]()['into']('cm_hopper_black')[_0x730d('0x2d')](['phone','ContactId',_0x730d('0x30'),_0x530deb,'createdAt','updatedAt'],squel[_0x730d('0xf')]()['fields'](_0x4eddee)[_0x730d('0x11')](_0x55e14a)[_0x730d('0x12')](_0x730d('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x55e14a+_0x730d('0x37'))[_0x730d('0x12')](_0x9f903d,null,_0x9f903d+'.id\x20=\x20'+_0x55e14a+'.'+_0x530deb)[_0x730d('0x14')](_0x55e14a+_0x730d('0x38'),_0x5025be)[_0x730d('0x14')](_0x730d('0x39'),NOW)[_0x730d('0x14')](_0x730d('0x3f'),squel[_0x730d('0xf')]()['field'](_0x730d('0x10'))[_0x730d('0x11')]('cm_hopper_black')['where'](_0x730d('0x45'),_0x5025be)[_0x730d('0x14')](_0x530deb+_0x730d('0x15')+_0x55e14a+'.'+_0x530deb)))[_0x730d('0x3c')]();}function insertCmHopperAdditionalPhones(_0x28b86b){var _0x386207=[_0x730d('0x46'),_0x730d('0x47'),_0x730d('0x48'),_0x730d('0x49'),'cm_contact_has_items.updatedAt'];return squel[_0x730d('0x2b')]()[_0x730d('0x2c')](_0x730d('0x4a'))['fromQuery']([_0x730d('0x4b'),_0x730d('0x10'),_0x730d('0x4c'),_0x730d('0x31'),_0x730d('0x32')],squel[_0x730d('0xf')]()[_0x730d('0x3e')](_0x386207)['from'](_0x730d('0x3a'))[_0x730d('0x12')](_0x730d('0x35'),null,_0x730d('0x4d'))[_0x730d('0x12')](_0x730d('0x4e'),null,_0x730d('0x4f'))[_0x730d('0x14')](_0x730d('0x50'),_0x28b86b)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x730d('0x3c')]();}function insertCmContact(_0x475b7c,_0x471a1d,_0x3ec097,_0x49fe36){var _0x5e917f=_[_0x730d('0x51')](_['keys'](_0x49fe36),[_0x730d('0x30'),_0x730d('0x52'),_0x730d('0x31'),_0x730d('0x32')]);return squel[_0x730d('0x2b')]()[_0x730d('0x2c')](_0x730d('0x35'))[_0x730d('0x2d')](_0x5e917f,squel[_0x730d('0xf')]()[_0x730d('0x3e')](_0x5e917f)[_0x730d('0x11')](_0x471a1d)[_0x730d('0x14')]('('+_0x3ec097[_0x730d('0x12')](',')+_0x730d('0x53'),squel[_0x730d('0xf')]()['fields'](_0x3ec097)[_0x730d('0x11')](_0x730d('0x35'))[_0x730d('0x14')](_0x730d('0x45'),_0x475b7c)[_0x730d('0x14')]('deletedAt\x20IS\x20NULL'))[_0x730d('0x14')](_0x730d('0x54'),squel[_0x730d('0xf')]()[_0x730d('0x55')]('MIN(id)','min_id')[_0x730d('0x11')](_0x471a1d)[_0x730d('0x56')](_0x3ec097[_0x730d('0x12')](','))))[_0x730d('0x3c')]();}function handleStop(){logger[_0x730d('0x57')](_0x730d('0x58'));stopped=!![];}function handleUncaughtException(_0x76139f){logger[_0x730d('0x59')](_0x76139f['message']);process['exit'](0x1);}function handleError(_0x432afd,_0xbf8d7){stats['errors'][_0x730d('0x1a')]({'name':_0xbf8d7['code'],'message':_0xbf8d7[_0x730d('0x5a')],'row':_0x432afd});}function handleQuery(_0x3f41b0){logger['info'](_0x3f41b0);return db[_0x730d('0x5b')]['query'](_0x3f41b0)[_0x730d('0x5c')](function(_0x3c95e3){results[_0x730d('0x1a')](_0x3c95e3);})[_0x730d('0x5d')](function(_0x35d1d6){logger[_0x730d('0x59')](_0x35d1d6['message']);});}function updateTzCampaigns(_0x3913c0){return new Promise(function(_0x422e84,_0x13ce68){var _0x35e959=squel['select']()[_0x730d('0x3e')]([_0x730d('0x5e'),'campaigns.dialTimezone'])['from'](_0x730d('0x5f'))[_0x730d('0x12')](_0x730d('0x60'),null,_0x730d('0x61'))[_0x730d('0x14')](_0x730d('0x62')+_0x3913c0);db[_0x730d('0x5b')][_0x730d('0x63')](_0x35e959[_0x730d('0x3c')]())[_0x730d('0x5c')](function(_0x9cd27e){var _0x2d13ba=[];for(var _0x31b0d8=0x0;_0x31b0d8<_0x9cd27e[_0x730d('0x1c')];_0x31b0d8++){_0x2d13ba['push'](getTimezoneData(_0x9cd27e[_0x31b0d8],tmp_campaigns));}BPromise[_0x730d('0x64')](_0x2d13ba)[_0x730d('0x19')](function(){_0x422e84({'val':0x1});});})[_0x730d('0x5d')](function(_0x57dc50){logger[_0x730d('0x59')](_0x57dc50[_0x730d('0x5a')]);_0x422e84({'val':0x0});});});}function updateTzVoiceQueues(_0x5cbe02){return new Promise(function(_0x500253,_0x1d3141){var _0x4d6660=squel[_0x730d('0xf')]()['fields']([_0x730d('0x65'),_0x730d('0x66')])[_0x730d('0x11')](_0x730d('0x67'))[_0x730d('0x12')]('voice_queues_has_cm_lists',null,_0x730d('0x68'))['where'](_0x730d('0x69')+_0x5cbe02);db[_0x730d('0x5b')][_0x730d('0x63')](_0x4d6660[_0x730d('0x3c')]())[_0x730d('0x5c')](function(_0x59b806){var _0x33166c=[];for(var _0x48dcce=0x0;_0x48dcce<_0x59b806[_0x730d('0x1c')];_0x48dcce++){_0x33166c['push'](getTimezoneData(_0x59b806[_0x48dcce],tmp_voice_queues));}BPromise['all'](_0x33166c)[_0x730d('0x19')](function(){_0x500253({'val':0x1});});})[_0x730d('0x5d')](function(_0x40ebf1){logger[_0x730d('0x59')](_0x40ebf1[_0x730d('0x5a')]);_0x500253({'val':0x0});});});}function getTimezoneData(_0x2cc867,_0x27e400){return new Promise(function(_0x38b666,_0x19d4e4){var _0x48f68a=shared[_0x730d('0x6a')];var _0x1ae2cb=_0x48f68a[_0x2cc867['dialTimezone']];if(_[_0x730d('0x1d')](_0x1ae2cb)){_0x38b666({'ret':0x1});}else{var _0x2f1dde=_0x1ae2cb[_0x730d('0x6b')];var _0x14dfdb=squel[_0x730d('0x2b')]()[_0x730d('0x2c')](_0x27e400)[_0x730d('0x6c')]('id',_0x2cc867['id'])[_0x730d('0x6c')]('offset',_0x2f1dde)[_0x730d('0x6c')](_0x730d('0x6d'),_0x2cc867[_0x730d('0x6d')])[_0x730d('0x3c')]();return db[_0x730d('0x5b')]['query'](_0x14dfdb)[_0x730d('0x5c')](function(_0x3c2354){_0x38b666({'ret':0x1});})[_0x730d('0x5d')](function(_0x2aa94b){logger[_0x730d('0x59')](_0x2aa94b[_0x730d('0x5a')]);_0x19d4e4({'ret':0x1});});}});}function handleTZQuery(_0x47c4ff){logger['info'](_0x47c4ff);return db[_0x730d('0x5b')][_0x730d('0x63')](_0x47c4ff)[_0x730d('0x5c')](function(_0x38e43e){})[_0x730d('0x5d')](function(_0x1f9d80){logger['error'](_0x1f9d80[_0x730d('0x5a')]);});}function main(_0x246a08,_0xdd57d6,_0x2fcb0f,_0x4a7ffb){logger[_0x730d('0x57')]('main',_0x246a08,JSON[_0x730d('0x6e')](_0xdd57d6));process[_0x730d('0x6f')]('start');var _0x2bcae0=_0xdd57d6['binding'];var _0x3985d3=_[_0x730d('0x70')](_0x2bcae0);var _0x1b04cf=_0xdd57d6[_0x730d('0x71')];var _0x3e8dd6=path[_0x730d('0x12')](config[_0x730d('0x72')],_0x730d('0x73'),_0x1b04cf+_0x730d('0x74'));hasTZ=_[_0x730d('0x75')](_0x2bcae0)[_0x730d('0x76')](_0x730d('0x6d'));var _0x5a51e7=_[_0x730d('0x75')](_0x2bcae0)[_0x730d('0x12')]();logger[_0x730d('0x57')](_0x730d('0x77'),_0x5a51e7);db[_0x730d('0x78')]['findAll']({'raw':!![],'attributes':['id',_0x730d('0x79')]})[_0x730d('0x19')](function(_0x1ef9a2){for(var _0x39adb8=0x0;_0x39adb8<_0x1ef9a2['length'];_0x39adb8++){if(_0x1ef9a2[_0x39adb8][_0x730d('0x79')]in _0x2bcae0){contactItemTypes['push'](_0x1ef9a2[_0x39adb8]);delete _0x3985d3[_0x1ef9a2[_0x39adb8][_0x730d('0x79')]];hasAdditionalPhones=!![];}for(var _0x52d366 in _0x2bcae0){if(_0x1ef9a2[_0x39adb8][_0x730d('0x79')]+_0x730d('0x7a')===_0x52d366){phoneDescriptions[_0x730d('0x1a')]({'itemTypeId':_0x1ef9a2[_0x39adb8]['id'],'description':_0x52d366});delete _0x3985d3[_0x52d366];}}}if(hasAdditionalPhones)_0x3985d3[_0x730d('0x18')]='';var _0x1ec2cf=_[_0x730d('0x75')](_0x3985d3)[_0x730d('0x12')]();logger[_0x730d('0x57')](_0x730d('0x77'),_0x1ec2cf);fs['writeFileSync'](_0x3e8dd6,_0x1ec2cf+'\x0a');Papa[_0x730d('0x7b')](fs['createReadStream'](_0x246a08),{'header':!![],'skipEmptyLines':!![],'step':function(_0x8a855e,_0x18351){try{for(var _0x376342=0x0,_0x3ac81e=[];_0x376342<_0x8a855e[_0x730d('0x7c')][_0x730d('0x1c')];_0x376342++){stats['rows']+=0x1;if(_0x8a855e[_0x730d('0x7d')][_0x376342]){handleError(_0x8a855e[_0x730d('0x7c')][_0x376342],_0x8a855e[_0x730d('0x7d')][_0x376342]);}else{var _0x1db5b7=[];var _0x34fc7b=[];var _0x1d3f0e={};for(var _0x3b35c7 in _0x2bcae0){let _0x109279=contactItemTypes['find'](_0x265574=>_0x265574[_0x730d('0x79')]===_0x3b35c7);let _0x1a9b6f=contactItemTypes[_0x730d('0x7e')](_0x29e77e=>_0x29e77e['name']+_0x730d('0x7a')===_0x3b35c7);if(_[_0x730d('0x1d')](_0x109279)&&_[_0x730d('0x1d')](_0x1a9b6f)){if(_0x2bcae0['hasOwnProperty'](_0x3b35c7)){if(_0x8a855e[_0x730d('0x7c')][_0x376342][_0x2bcae0[_0x3b35c7]]){var _0x1f20d3=_[_0x730d('0x7f')](_0x8a855e[_0x730d('0x7c')][_0x376342][_0x2bcae0[_0x3b35c7]]['replace'](/"/g,'\x27'));switch(_0x3b35c7){case _0x730d('0x2e'):var _0x447084=moment(_0x1f20d3,_0x730d('0xe'),!![]);if(_0x447084[_0x730d('0x80')]()){_0x3ac81e[_0x730d('0x1a')]('\x22'+_0x1f20d3+'\x22');}else{_0x1db5b7['push'](_0x730d('0x81'));}break;case _0x730d('0x33'):var _0x3c1194=parseInt(_0x1f20d3);_0x1f20d3=_[_0x730d('0x82')](_0x3c1194)||_0x3c1194<0x0||_0x3c1194>0x4?_0x4a7ffb?0x3:0x2:_0x3c1194;_0x3ac81e['push']('\x22'+_0x1f20d3+'\x22');break;case _0x730d('0x43'):var _0x2d84c5=parseInt(_0x1f20d3);if(_['isNumber'](_0x2d84c5)&&_[_0x730d('0x76')](_0x2fcb0f,_0x2d84c5)){_0x3ac81e['push']('\x22'+_0x2d84c5+'\x22');}else{_0x1db5b7['push'](_0x730d('0x83'));}break;case _0x730d('0x84'):if(isEmail(_0x1f20d3)){_0x3ac81e['push']('\x22'+_0x1f20d3+'\x22');}else{_0x1db5b7[_0x730d('0x1a')](_0x730d('0x85'));}break;case'dateOfBirth':var _0x3c8354=moment(_0x1f20d3,_0x730d('0x86'),!![]);if(_0x3c8354['isValid']()){_0x3ac81e[_0x730d('0x1a')]('\x22'+_0x1f20d3+'\x22');}else{_0x1db5b7[_0x730d('0x1a')](_0x730d('0x87'));}break;case _0x730d('0x6d'):var _0x198fe9=shared[_0x730d('0x6a')];var _0xc2e138=_0x198fe9[_0x1f20d3];if(!_[_0x730d('0x1d')](_0xc2e138)){var _0x4d6244=_0xc2e138[_0x730d('0x6b')];_0x3ac81e[_0x730d('0x1a')]('\x22'+_0x1f20d3+'\x22');_0x3ac81e['push']('\x22'+_0x4d6244+'\x22');}break;default:_0x3ac81e['push']('\x22'+_0x1f20d3+'\x22');}}else{switch(_0x3b35c7){case _0x730d('0x88'):case'phone':_0x1db5b7[_0x730d('0x1a')](_0x3b35c7+_0x730d('0x89'));break;default:_0x3ac81e[_0x730d('0x1a')]('\x22\x22');}}}}else{var _0x56443f='';if(!_[_0x730d('0x1d')](_0x109279)){if(!_0x1d3f0e[_0x730d('0x8a')](_0x109279['id'])){if(!_['isNil'](_0x8a855e[_0x730d('0x7c')][_0x376342][_0x2bcae0[_0x3b35c7]])){var _0x1f20d3=_[_0x730d('0x7f')](_0x8a855e[_0x730d('0x7c')][_0x376342][_0x2bcae0[_0x3b35c7]]['replace'](/"/g,'\x27'));var _0x562c59=phoneDescriptions['find'](_0x54cc2d=>_0x54cc2d[_0x730d('0x8b')]===_0x109279['id']);if(!_['isNil'](_0x562c59)){var _0xc4c535=_[_0x730d('0x7f')](_0x8a855e[_0x730d('0x7c')][_0x376342][_0x2bcae0[_0x562c59[_0x730d('0x8c')]]][_0x730d('0x8d')](/"/g,'\x27'));if(!_[_0x730d('0x1d')](_0xc4c535))_0x1f20d3=_0x1f20d3+'§'+_0xc4c535;}if(_0x56443f=='')_0x56443f=_0x1f20d3;else _0x56443f+='|'+_0x1f20d3;}_0x34fc7b[_0x730d('0x1a')](_0x109279['id']+':'+_0x56443f);_0x1d3f0e[_0x109279['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3ac81e[_0x730d('0x1a')]('\x22'+_0x34fc7b[_0x730d('0x12')](';')+'\x22');}if(_0x1db5b7[_0x730d('0x1c')]){handleError(_0x8a855e[_0x730d('0x7c')][_0x376342],{'code':_0x730d('0x8e'),'message':_0x1db5b7[_0x730d('0x12')]()});}else{fs[_0x730d('0x8f')](_0x3e8dd6,_0x3ac81e[_0x730d('0x12')]()+'\x0a');}_0x3ac81e=[];}if(!(stats[_0x730d('0x90')]%0xc8)){socket[_0x730d('0x91')](_0x730d('0x92')+_0x1b04cf,stats);stats[_0x730d('0x7d')]=[];}}if(stopped){logger[_0x730d('0x57')](_0x730d('0x93'));_0x18351[_0x730d('0x94')]();}}catch(_0x13e4dc){handleError(_0x8a855e[_0x730d('0x7c')][_0x376342],{'code':_0x730d('0x95'),'message':_0x13e4dc[_0x730d('0x5a')]});logger[_0x730d('0x59')](_0x730d('0x96'),_0x13e4dc[_0x730d('0x5a')]);}},'complete':function(){try{var _0x368fcb=[];var _0x539cee=[];var _0x1ac6cd='cm_contacts';if(_0xdd57d6[_0x730d('0x97')]&&_0xdd57d6[_0x730d('0x97')][_0x730d('0x1c')]){_0x1ac6cd=_0x730d('0x98')+_0x1b04cf;_0x368fcb[_0x730d('0x1a')](_0x730d('0x99')+_0x1ac6cd+_0x730d('0x9a'));}tmp_campaigns=_0x730d('0x9b')+_0x1b04cf;tmp_voice_queues=_0x730d('0x9c')+_0x1b04cf;_0x539cee[_0x730d('0x1a')](_0x730d('0x99')+tmp_campaigns+_0x730d('0x9d'));_0x539cee[_0x730d('0x1a')](_0x730d('0x99')+tmp_voice_queues+_0x730d('0x9d'));BPromise[_0x730d('0x9e')](_0x539cee,handleTZQuery)['then'](function(_0x3e1706){updateTzCampaigns(_0xdd57d6[_0x730d('0x30')])[_0x730d('0x19')](function(_0x41c44b){updateTzVoiceQueues(_0xdd57d6[_0x730d('0x30')])[_0x730d('0x19')](function(_0x2b20b6){if(hasTZ)_0x1ec2cf=_0x1ec2cf[_0x730d('0x8d')]('dialTimezone',_0x730d('0x9f'));var _0x11208d=util[_0x730d('0xd')](_0x730d('0xa0'),_0x3e8dd6,_0x1ac6cd,_0x1ec2cf,_0xdd57d6[_0x730d('0x30')],_0xdd57d6[_0x730d('0x52')]||null,NOW,NOW);if(_[_0x730d('0x1d')](_0x2bcae0['scheduledat'])){_0x11208d+=_0x730d('0xa1');}_0x368fcb['push'](_0x11208d);if(_0xdd57d6[_0x730d('0x97')]&&_0xdd57d6[_0x730d('0x97')][_0x730d('0x1c')]){_0x368fcb[_0x730d('0x1a')](insertCmContact(_0xdd57d6[_0x730d('0x30')],_0x1ac6cd,_0xdd57d6[_0x730d('0x97')],_0x2bcae0));_0x368fcb['push']('DROP\x20TABLE\x20'+_0x1ac6cd+';');}BPromise['each'](_0x368fcb,handleQuery)[_0x730d('0x19')](function(_0x57a02e){BPromise['all']([handleAdditionalPhones()])[_0x730d('0x19')](function(){_0x368fcb=[];for(var _0x3bfd6c=0x0;_0x3bfd6c<promisesAdditionalPhones[_0x730d('0x1c')];_0x3bfd6c++){if(promisesAdditionalPhones[_0x3bfd6c][_0x730d('0x10')]!='§'){_0x368fcb['push'](createAdditionalPhone(promisesAdditionalPhones[_0x3bfd6c][_0x730d('0xa2')],promisesAdditionalPhones[_0x3bfd6c]['contactTypeId'],promisesAdditionalPhones[_0x3bfd6c][_0x730d('0x10')],promisesAdditionalPhones[_0x3bfd6c][_0x730d('0xa3')]));}}BPromise[_0x730d('0x64')](_0x368fcb)['then'](function(){_0x368fcb=[];if(hasTZ){_0x368fcb[_0x730d('0x1a')](insertTzCmHopper(_0xdd57d6[_0x730d('0x30')],_0x730d('0xa4'),_0x730d('0x67'),_0x730d('0xa5'),_0x4a7ffb,tmp_voice_queues));_0x368fcb[_0x730d('0x1a')](insertTzCmHopperBlack(_0xdd57d6[_0x730d('0x30')],_0x730d('0xa6'),_0x730d('0x67'),_0x730d('0xa5')));_0x368fcb[_0x730d('0x1a')](insertTzCmHopper(_0xdd57d6[_0x730d('0x30')],_0x730d('0x60'),_0x730d('0x5f'),_0x730d('0xa7'),_0x4a7ffb,tmp_campaigns));_0x368fcb[_0x730d('0x1a')](insertTzCmHopperBlack(_0xdd57d6[_0x730d('0x30')],_0x730d('0xa8'),_0x730d('0x5f'),_0x730d('0xa7')));_0x368fcb[_0x730d('0x1a')](insertCmHopperAdditionalPhones(_0xdd57d6[_0x730d('0x30')]));}else{_0x368fcb[_0x730d('0x1a')](insertCmHopper(_0xdd57d6[_0x730d('0x30')],'voice_queues_has_cm_lists',_0x730d('0x67'),_0x730d('0xa5'),_0x4a7ffb));_0x368fcb[_0x730d('0x1a')](insertCmHopperBlack(_0xdd57d6['ListId'],_0x730d('0xa6'),_0x730d('0x67'),_0x730d('0xa5')));_0x368fcb['push'](insertCmHopper(_0xdd57d6['ListId'],_0x730d('0x60'),'campaigns','CampaignId',_0x4a7ffb));_0x368fcb[_0x730d('0x1a')](insertCmHopperBlack(_0xdd57d6[_0x730d('0x30')],_0x730d('0xa8'),'campaigns',_0x730d('0xa7')));_0x368fcb[_0x730d('0x1a')](insertCmHopperAdditionalPhones(_0xdd57d6[_0x730d('0x30')]));}_0x368fcb['push'](_0x730d('0xa9')+tmp_campaigns+';');_0x368fcb['push'](_0x730d('0xa9')+tmp_voice_queues+';');BPromise[_0x730d('0x9e')](_0x368fcb,handleQuery)[_0x730d('0x19')](function(_0x34a16b){stats['finish']=!![];stats['affectedRows']=_0xdd57d6[_0x730d('0x97')]&&_0xdd57d6[_0x730d('0x97')][_0x730d('0x1c')]?results[0x2]['affectedRows']:results[0x0][_0x730d('0xaa')];socket[_0x730d('0x91')]('contact:import:'+_0x1b04cf,stats);fs['unlink'](_0x246a08);fs['unlink'](_0x3e8dd6);process['exit'](0x0);})[_0x730d('0x5d')](function(_0x3eab0f){logger[_0x730d('0x59')](_0x3eab0f[_0x730d('0x5a')]);process[_0x730d('0xab')](0x1);});});});})[_0x730d('0x5d')](function(_0x255435){logger[_0x730d('0x59')](_0x255435[_0x730d('0x5a')]);process[_0x730d('0xab')](0x1);});});});});}catch(_0x30fa66){logger[_0x730d('0x59')]('complete',_0x30fa66[_0x730d('0x5a')]);process[_0x730d('0xab')](0x1);}},'error':function(_0x1c54ba,_0x138564,_0x400a7b,_0x50673c){throw new Error(_0x50673c);}});});}function validate(){if(process['argv']&&process[_0x730d('0xac')][_0x730d('0x1c')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x2e21dc=path[_0x730d('0x12')](config[_0x730d('0x72')],_0x730d('0x73'),process['argv'][0x2]);if(!fs[_0x730d('0xad')](_0x2e21dc)){throw new Error(_0x730d('0xae'));}var _0x5d3dbc={};try{_0x5d3dbc=JSON[_0x730d('0x7b')](process[_0x730d('0xac')][0x3]);if(!_0x5d3dbc[_0x730d('0xaf')]){throw new Error(_0x730d('0xb0'));}if(!_0x5d3dbc[_0x730d('0xaf')][_0x730d('0x10')]){throw new Error(_0x730d('0xb1'));}if(!_0x5d3dbc[_0x730d('0xaf')][_0x730d('0x88')]){throw new Error(_0x730d('0xb2'));}var _0x1c18df=0x0;if(_0x5d3dbc[_0x730d('0xaf')]['UserId']){_0x1c18df=0x1;}if(!_0x5d3dbc[_0x730d('0x30')]){throw new Error(_0x730d('0xb3'));}}catch(_0x13c551){throw new Error(_0x730d('0xb4'));}var _0x10b43d=[];try{_0x10b43d=_['map'](JSON[_0x730d('0x7b')](process[_0x730d('0xac')][0x4]),'id');}catch(_0x4cbf7c){logger[_0x730d('0x57')](_0x730d('0xb5'));}main(_0x2e21dc,_0x5d3dbc,_0x10b43d,_0x1c18df);}validate();process['on'](_0x730d('0xb6'),handleStop);process['on'](_0x730d('0xb7'),handleUncaughtException);
\ No newline at end of file
+var _0x3c96=['ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','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','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.ListId','cm_hopper_black','ContactId','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','\x22onlyIfOpen\x22','concat','keys','group','error','message','exit','info','query','spread','push','catch','campaigns.id','campaigns','campaigns_has_cm_lists','sequelize','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','length','all','timezones','dialTimezone','isNil','utcOffset','set','offset','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','errors','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','then','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()','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x3c96,0x1d1));var _0x63c9=function(_0x25f175,_0x49861b){_0x25f175=_0x25f175-0x0;var _0x396935=_0x3c96[_0x25f175];return _0x396935;};'use strict';var fs=require('fs');var path=require(_0x63c9('0x0'));var _=require('lodash');var Papa=require(_0x63c9('0x1'));var util=require(_0x63c9('0x2'));var BPromise=require(_0x63c9('0x3'));var moment=require(_0x63c9('0x4'));var squel=require(_0x63c9('0x5'));var Redis=require(_0x63c9('0x6'));var db=require(_0x63c9('0x7'))['db'];var config=require(_0x63c9('0x8'));var shared=require('../../../config/environment/shared');var logger=require(_0x63c9('0x9'))(_0x63c9('0xa'));config[_0x63c9('0xb')]=_[_0x63c9('0xc')](config[_0x63c9('0xb')],{'host':_0x63c9('0xd'),'port':0x18eb});var socket=require(_0x63c9('0xe'))(new Redis(config[_0x63c9('0xb')]));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()[_0x63c9('0xf')](_0x63c9('0x10'));function isEmail(_0x1c86d5){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))*$/[_0x63c9('0x11')](_0x1c86d5);}function selectNotIn(_0x5b2604,_0x5d57df,_0xceae16,_0xc6ecf,_0x43aaf0){return squel[_0x63c9('0x12')]()[_0x63c9('0x13')](_0x63c9('0x14'))[_0x63c9('0x15')](_0xc6ecf)[_0x63c9('0x16')](_0x5d57df,null,_0x5d57df+'.id\x20=\x20'+_0xc6ecf+'.'+_0xceae16)[_0x63c9('0x17')](_0xc6ecf+'.'+_0xceae16+_0x63c9('0x18')+_0x5b2604+'.'+_0xceae16)['where'](_0x5d57df+_0x63c9('0x19')+_0x43aaf0[_0x63c9('0x16')]()+')');}function insertCmHopper(_0x7e8cb9,_0x1b24f2,_0x12a13f,_0x27b013,_0xf16922){var _0x139786=[_0x63c9('0x1a'),_0x63c9('0x1b'),_0x63c9('0x1c'),'cm_contacts.ListId',_0x1b24f2+'.'+_0x27b013,_0x63c9('0x1d'),_0x63c9('0x1e'),_0x63c9('0x1f'),_0x63c9('0x20'),'\x22'+_0xf16922+'\x22'];return squel[_0x63c9('0x21')]()[_0x63c9('0x22')](_0x63c9('0x23'))[_0x63c9('0x24')]([_0x63c9('0x14'),_0x63c9('0x25'),'ContactId',_0x63c9('0x26'),_0x27b013,_0x63c9('0x27'),_0x63c9('0x28'),_0x63c9('0x29'),_0x63c9('0x2a'),_0x63c9('0x2b')],squel[_0x63c9('0x12')]()[_0x63c9('0x2c')](_0x139786)['from'](_0x1b24f2)['join'](_0x63c9('0x2d'),null,_0x63c9('0x2e')+_0x1b24f2+_0x63c9('0x2f'))['join'](_0x12a13f,null,_0x12a13f+_0x63c9('0x30')+_0x1b24f2+'.'+_0x27b013)[_0x63c9('0x17')](_0x1b24f2+_0x63c9('0x31'),_0x7e8cb9)['where'](_0x63c9('0x32'),NOW)[_0x63c9('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1b24f2,_0x12a13f,_0x27b013,_0x63c9('0x23'),[_0x63c9('0x33'),'\x22onlyIfOpen\x22']))[_0x63c9('0x17')](_0x63c9('0x34'),selectNotIn(_0x1b24f2,_0x12a13f,_0x27b013,_0x63c9('0x23'),[_0x63c9('0x33')])))[_0x63c9('0x35')]();}function insertCmHopperBlack(_0x21c66b,_0x324eb3,_0x346002,_0x58fb8b){var _0x546d28=[_0x63c9('0x1a'),_0x63c9('0x1c'),_0x63c9('0x36'),_0x324eb3+'.'+_0x58fb8b,'cm_contacts.createdAt',_0x63c9('0x1e')];return squel[_0x63c9('0x21')]()[_0x63c9('0x22')](_0x63c9('0x37'))[_0x63c9('0x24')]([_0x63c9('0x14'),_0x63c9('0x38'),_0x63c9('0x26'),_0x58fb8b,'createdAt',_0x63c9('0x28')],squel[_0x63c9('0x12')]()[_0x63c9('0x2c')](_0x546d28)['from'](_0x324eb3)[_0x63c9('0x16')](_0x63c9('0x2d'),null,_0x63c9('0x2e')+_0x324eb3+_0x63c9('0x2f'))[_0x63c9('0x16')](_0x346002,null,_0x346002+_0x63c9('0x30')+_0x324eb3+'.'+_0x58fb8b)[_0x63c9('0x17')](_0x324eb3+_0x63c9('0x31'),_0x21c66b)[_0x63c9('0x17')](_0x63c9('0x32'),NOW)[_0x63c9('0x17')](_0x63c9('0x34'),squel['select']()[_0x63c9('0x13')](_0x63c9('0x14'))['from'](_0x63c9('0x37'))[_0x63c9('0x17')](_0x63c9('0x39'),_0x21c66b)[_0x63c9('0x17')](_0x58fb8b+_0x63c9('0x3a'),_0x324eb3+'.'+_0x58fb8b)))['toString']();}function insertTzCmHopper(_0x1fc285,_0x2a66fc,_0x4d610f,_0x476d2c,_0x333025,_0x26fa10){var _0x3ac242=[_0x63c9('0x1a'),_0x63c9('0x3b')+_0x26fa10+_0x63c9('0x3c'),_0x63c9('0x1c'),_0x63c9('0x36'),_0x2a66fc+'.'+_0x476d2c,_0x63c9('0x1d'),_0x63c9('0x1e'),_0x63c9('0x1f'),'cm_contacts.UserId','\x22'+_0x333025+'\x22'];var _0x33e3f3=squel['insert']()[_0x63c9('0x22')](_0x63c9('0x23'))[_0x63c9('0x24')]([_0x63c9('0x14'),_0x63c9('0x25'),_0x63c9('0x38'),'ListId',_0x476d2c,_0x63c9('0x27'),_0x63c9('0x28'),_0x63c9('0x29'),'UserId','recallme'],squel[_0x63c9('0x12')]()[_0x63c9('0x2c')](_0x3ac242)[_0x63c9('0x15')](_0x2a66fc)[_0x63c9('0x16')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2a66fc+_0x63c9('0x2f'))['join'](_0x4d610f,null,_0x4d610f+_0x63c9('0x30')+_0x2a66fc+'.'+_0x476d2c)[_0x63c9('0x16')](_0x26fa10,null,_0x26fa10+'.id\x20=\x20'+_0x2a66fc+'.'+_0x476d2c)['where'](_0x2a66fc+_0x63c9('0x31'),_0x1fc285)[_0x63c9('0x17')](_0x63c9('0x32'),NOW)['where'](_0x63c9('0x34'),selectNotIn(_0x2a66fc,_0x4d610f,_0x476d2c,_0x63c9('0x23'),[_0x63c9('0x33'),_0x63c9('0x3d')]))[_0x63c9('0x17')](_0x63c9('0x34'),selectNotIn(_0x2a66fc,_0x4d610f,_0x476d2c,_0x63c9('0x23'),[_0x63c9('0x33')])))[_0x63c9('0x35')]();return _0x33e3f3;}function insertTzCmHopperBlack(_0x2b89d2,_0x101ef2,_0x276946,_0x34cab1){var _0x120f25=[_0x63c9('0x1a'),_0x63c9('0x1c'),_0x63c9('0x36'),_0x101ef2+'.'+_0x34cab1,_0x63c9('0x1d'),_0x63c9('0x1e')];return squel['insert']()[_0x63c9('0x22')]('cm_hopper_black')[_0x63c9('0x24')]([_0x63c9('0x14'),'ContactId',_0x63c9('0x26'),_0x34cab1,_0x63c9('0x27'),_0x63c9('0x28')],squel['select']()['fields'](_0x120f25)['from'](_0x101ef2)['join']('cm_contacts',null,_0x63c9('0x2e')+_0x101ef2+_0x63c9('0x2f'))[_0x63c9('0x16')](_0x276946,null,_0x276946+_0x63c9('0x30')+_0x101ef2+'.'+_0x34cab1)[_0x63c9('0x17')](_0x101ef2+_0x63c9('0x31'),_0x2b89d2)['where'](_0x63c9('0x32'),NOW)['where'](_0x63c9('0x34'),squel[_0x63c9('0x12')]()[_0x63c9('0x13')]('phone')[_0x63c9('0x15')](_0x63c9('0x37'))[_0x63c9('0x17')](_0x63c9('0x39'),_0x2b89d2)[_0x63c9('0x17')](_0x34cab1+'\x20=\x20?',_0x101ef2+'.'+_0x34cab1)))[_0x63c9('0x35')]();}function insertCmContact(_0x37d42f,_0x3f7776,_0x43ace8,_0x37486e){var _0x1ed957=_[_0x63c9('0x3e')](_[_0x63c9('0x3f')](_0x37486e),['ListId','CompanyId',_0x63c9('0x27'),_0x63c9('0x28')]);return squel[_0x63c9('0x21')]()[_0x63c9('0x22')](_0x63c9('0x2d'))[_0x63c9('0x24')](_0x1ed957,squel[_0x63c9('0x12')]()['fields'](_0x1ed957)[_0x63c9('0x15')](_0x3f7776)[_0x63c9('0x17')]('('+_0x43ace8[_0x63c9('0x16')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x63c9('0x2c')](_0x43ace8)[_0x63c9('0x15')](_0x63c9('0x2d'))[_0x63c9('0x17')]('ListId\x20=\x20?',_0x37d42f)[_0x63c9('0x17')]('deletedAt\x20IS\x20NULL'))[_0x63c9('0x17')]('id\x20IN\x20?',squel[_0x63c9('0x12')]()['field']('MIN(id)','min_id')[_0x63c9('0x15')](_0x3f7776)[_0x63c9('0x40')](_0x43ace8[_0x63c9('0x16')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x7bd9f){logger[_0x63c9('0x41')](_0x7bd9f[_0x63c9('0x42')]);process[_0x63c9('0x43')](0x1);}function handleError(_0x43e318,_0x55512d){stats['errors']['push']({'name':_0x55512d['code'],'message':_0x55512d[_0x63c9('0x42')],'row':_0x43e318});}function handleQuery(_0x19704b){logger[_0x63c9('0x44')](_0x19704b);return db['sequelize'][_0x63c9('0x45')](_0x19704b)[_0x63c9('0x46')](function(_0x258fda){results[_0x63c9('0x47')](_0x258fda);})[_0x63c9('0x48')](function(_0x2bbd30){logger[_0x63c9('0x41')](_0x2bbd30[_0x63c9('0x42')]);});}function updateTzCampaigns(_0x2a44d2){return new Promise(function(_0x11903b,_0x182020){var _0x489c2f=squel[_0x63c9('0x12')]()[_0x63c9('0x2c')]([_0x63c9('0x49'),'campaigns.dialTimezone'])[_0x63c9('0x15')](_0x63c9('0x4a'))['join'](_0x63c9('0x4b'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x63c9('0x17')]('campaigns_has_cm_lists.CmListId='+_0x2a44d2);db[_0x63c9('0x4c')]['query'](_0x489c2f[_0x63c9('0x35')]())['spread'](function(_0x25b154){var _0x5716d8=[];for(var _0x27db13=0x0;_0x27db13<_0x25b154['length'];_0x27db13++){_0x5716d8['push'](getTimezoneData(_0x25b154[_0x27db13],tmp_campaigns));}BPromise['all'](_0x5716d8)['then'](function(){_0x11903b({'val':0x1});});})[_0x63c9('0x48')](function(_0x33a80b){logger[_0x63c9('0x41')](_0x33a80b[_0x63c9('0x42')]);_0x11903b({'val':0x0});});});}function updateTzVoiceQueues(_0x3651d5){return new Promise(function(_0x2818b6,_0x17b3ac){var _0x47c07e=squel[_0x63c9('0x12')]()['fields'](['voice_queues.id',_0x63c9('0x4d')])[_0x63c9('0x15')](_0x63c9('0x4e'))[_0x63c9('0x16')](_0x63c9('0x4f'),null,_0x63c9('0x50'))[_0x63c9('0x17')](_0x63c9('0x51')+_0x3651d5);db[_0x63c9('0x4c')][_0x63c9('0x45')](_0x47c07e['toString']())['spread'](function(_0x1544c2){var _0x24b4b9=[];for(var _0x3c0618=0x0;_0x3c0618<_0x1544c2[_0x63c9('0x52')];_0x3c0618++){_0x24b4b9[_0x63c9('0x47')](getTimezoneData(_0x1544c2[_0x3c0618],tmp_voice_queues));}BPromise[_0x63c9('0x53')](_0x24b4b9)['then'](function(){_0x2818b6({'val':0x1});});})[_0x63c9('0x48')](function(_0xf8b138){logger[_0x63c9('0x41')](_0xf8b138[_0x63c9('0x42')]);_0x2818b6({'val':0x0});});});}function getTimezoneData(_0x256fe6,_0x32f395){return new Promise(function(_0x28b6cb,_0x5acb3b){var _0x23d3f7=shared[_0x63c9('0x54')];var _0x56270f=_0x23d3f7[_0x256fe6[_0x63c9('0x55')]];if(_[_0x63c9('0x56')](_0x56270f)){_0x28b6cb({'ret':0x1});}else{var _0x487a38=_0x56270f[_0x63c9('0x57')];var _0x2d1e7e=squel[_0x63c9('0x21')]()['into'](_0x32f395)[_0x63c9('0x58')]('id',_0x256fe6['id'])[_0x63c9('0x58')](_0x63c9('0x59'),_0x487a38)['set']('dialTimezone',_0x256fe6['dialTimezone'])[_0x63c9('0x35')]();return db['sequelize'][_0x63c9('0x45')](_0x2d1e7e)[_0x63c9('0x46')](function(_0x310617){_0x28b6cb({'ret':0x1});})[_0x63c9('0x48')](function(_0x145c87){logger[_0x63c9('0x41')](_0x145c87['message']);_0x5acb3b({'ret':0x1});});}});}function handleTZQuery(_0x134ff4){logger[_0x63c9('0x44')](_0x134ff4);return db[_0x63c9('0x4c')][_0x63c9('0x45')](_0x134ff4)[_0x63c9('0x46')](function(_0xd986f3){})['catch'](function(_0x4676dc){logger[_0x63c9('0x41')](_0x4676dc['message']);});}function main(_0x2b7194,_0x3168a0,_0xa6629e,_0x33b9ab){logger[_0x63c9('0x44')]('main',_0x2b7194,JSON[_0x63c9('0x5a')](_0x3168a0));process['send'](_0x63c9('0x5b'));var _0x1cc015=_0x3168a0[_0x63c9('0x5c')];var _0x38856d=_0x3168a0[_0x63c9('0x5d')];var _0xc32081=path[_0x63c9('0x16')](config[_0x63c9('0x5e')],_0x63c9('0x5f'),_0x38856d+_0x63c9('0x60'));hasTZ=_[_0x63c9('0x3f')](_0x1cc015)['includes'](_0x63c9('0x55'));var _0x1ddf24=_[_0x63c9('0x3f')](_0x1cc015)[_0x63c9('0x16')]();logger['info'](_0x63c9('0x61'),_0x1ddf24);if(hasTZ)_0x1ddf24+=_0x63c9('0x62');fs[_0x63c9('0x63')](_0xc32081,_0x1ddf24+'\x0a');Papa[_0x63c9('0x64')](fs[_0x63c9('0x65')](_0x2b7194),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4712c6,_0x5d8765){try{for(var _0x2ecbe9=0x0,_0x3debd0=[];_0x2ecbe9<_0x4712c6[_0x63c9('0x66')][_0x63c9('0x52')];_0x2ecbe9++){stats[_0x63c9('0x67')]+=0x1;if(_0x4712c6[_0x63c9('0x68')][_0x2ecbe9]){handleError(_0x4712c6[_0x63c9('0x66')][_0x2ecbe9],_0x4712c6['errors'][_0x2ecbe9]);}else{var _0x261206=[];for(var _0x4f2f55 in _0x1cc015){if(_0x1cc015[_0x63c9('0x69')](_0x4f2f55)){if(_0x4712c6['data'][_0x2ecbe9][_0x1cc015[_0x4f2f55]]){var _0x5a99ff=_[_0x63c9('0x6a')](_0x4712c6[_0x63c9('0x66')][_0x2ecbe9][_0x1cc015[_0x4f2f55]]['replace'](/"/g,'\x27'));switch(_0x4f2f55){case'scheduledat':var _0x355fd0=moment(_0x5a99ff,_0x63c9('0x10'),!![]);if(_0x355fd0[_0x63c9('0x6b')]()){_0x3debd0[_0x63c9('0x47')]('\x22'+_0x5a99ff+'\x22');}else{_0x261206[_0x63c9('0x47')](_0x63c9('0x6c'));}break;case'priority':var _0x1039e2=parseInt(_0x5a99ff);_0x5a99ff=_[_0x63c9('0x6d')](_0x1039e2)||_0x1039e2<0x0||_0x1039e2>0x4?_0x33b9ab?0x3:0x2:_0x1039e2;_0x3debd0[_0x63c9('0x47')]('\x22'+_0x5a99ff+'\x22');break;case'UserId':var _0x4e99af=parseInt(_0x5a99ff);if(_[_0x63c9('0x6e')](_0x4e99af)&&_[_0x63c9('0x6f')](_0xa6629e,_0x4e99af)){_0x3debd0[_0x63c9('0x47')]('\x22'+_0x4e99af+'\x22');}else{_0x261206['push'](_0x63c9('0x70'));}break;case _0x63c9('0x71'):if(isEmail(_0x5a99ff)){_0x3debd0[_0x63c9('0x47')]('\x22'+_0x5a99ff+'\x22');}else{_0x261206['push']('email\x20wrong\x20format');}break;case _0x63c9('0x72'):var _0x268335=moment(_0x5a99ff,'YYYY-MM-DD',!![]);if(_0x268335[_0x63c9('0x6b')]()){_0x3debd0['push']('\x22'+_0x5a99ff+'\x22');}else{_0x261206[_0x63c9('0x47')](_0x63c9('0x73'));}break;case _0x63c9('0x55'):var _0x5d6286=shared[_0x63c9('0x54')];var _0x4dffd9=_0x5d6286[_0x5a99ff];if(!_[_0x63c9('0x56')](_0x4dffd9)){var _0x47b56f=_0x4dffd9[_0x63c9('0x57')];_0x3debd0[_0x63c9('0x47')]('\x22'+_0x5a99ff+'\x22');_0x3debd0[_0x63c9('0x47')]('\x22'+_0x47b56f+'\x22');}break;default:_0x3debd0[_0x63c9('0x47')]('\x22'+_0x5a99ff+'\x22');}}else{switch(_0x4f2f55){case'firstName':case _0x63c9('0x14'):_0x261206['push'](_0x4f2f55+_0x63c9('0x74'));break;default:_0x3debd0[_0x63c9('0x47')]('\x22\x22');}}}}if(_0x261206['length']){handleError(_0x4712c6[_0x63c9('0x66')][_0x2ecbe9],{'code':'SystemRow','message':_0x261206[_0x63c9('0x16')]()});}else{fs[_0x63c9('0x75')](_0xc32081,_0x3debd0[_0x63c9('0x16')]()+'\x0a');}_0x3debd0=[];}if(!(stats[_0x63c9('0x67')]%0xc8)){socket['emit'](_0x63c9('0x76')+_0x38856d,stats);stats[_0x63c9('0x68')]=[];}}if(stopped){logger[_0x63c9('0x44')](_0x63c9('0x77'));_0x5d8765[_0x63c9('0x78')]();}}catch(_0x2efc6a){handleError(_0x4712c6['data'][_0x2ecbe9],{'code':_0x63c9('0x79'),'message':_0x2efc6a[_0x63c9('0x42')]});logger[_0x63c9('0x41')](_0x63c9('0x7a'),_0x2efc6a[_0x63c9('0x42')]);}},'complete':function(){try{var _0x5e023b=[];var _0x4b5261=[];var _0x40b29a='cm_contacts';if(_0x3168a0[_0x63c9('0x7b')]&&_0x3168a0[_0x63c9('0x7b')][_0x63c9('0x52')]){_0x40b29a=_0x63c9('0x7c')+_0x38856d;_0x5e023b[_0x63c9('0x47')](_0x63c9('0x7d')+_0x40b29a+_0x63c9('0x7e'));}tmp_campaigns=_0x63c9('0x7f')+_0x38856d;tmp_voice_queues='voice_queues_'+_0x38856d;_0x4b5261['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0x63c9('0x80'));_0x4b5261[_0x63c9('0x47')](_0x63c9('0x7d')+tmp_voice_queues+_0x63c9('0x80'));BPromise[_0x63c9('0x81')](_0x4b5261,handleTZQuery)[_0x63c9('0x82')](function(_0x48562d){updateTzCampaigns(_0x3168a0[_0x63c9('0x26')])[_0x63c9('0x82')](function(_0xff8f69){updateTzVoiceQueues(_0x3168a0[_0x63c9('0x26')])['then'](function(_0x5101b3){var _0x23e333=util['format'](_0x63c9('0x83'),_0xc32081,_0x40b29a,_0x1ddf24,_0x3168a0[_0x63c9('0x26')],_0x3168a0['CompanyId']||null,NOW,NOW);if(_[_0x63c9('0x56')](_0x1cc015[_0x63c9('0x25')])){_0x23e333+=_0x63c9('0x84');}_0x5e023b[_0x63c9('0x47')](_0x23e333);if(_0x3168a0[_0x63c9('0x7b')]&&_0x3168a0['duplicates'][_0x63c9('0x52')]){_0x5e023b[_0x63c9('0x47')](insertCmContact(_0x3168a0[_0x63c9('0x26')],_0x40b29a,_0x3168a0[_0x63c9('0x7b')],_0x1cc015));_0x5e023b['push']('DROP\x20TABLE\x20'+_0x40b29a+';');}if(hasTZ){_0x5e023b[_0x63c9('0x47')](insertTzCmHopper(_0x3168a0[_0x63c9('0x26')],'voice_queues_has_cm_lists',_0x63c9('0x4e'),_0x63c9('0x85'),_0x33b9ab,tmp_voice_queues));_0x5e023b['push'](insertTzCmHopperBlack(_0x3168a0[_0x63c9('0x26')],'voice_queues_has_cm_blacklists',_0x63c9('0x4e'),_0x63c9('0x85')));_0x5e023b[_0x63c9('0x47')](insertTzCmHopper(_0x3168a0[_0x63c9('0x26')],_0x63c9('0x4b'),_0x63c9('0x4a'),_0x63c9('0x86'),_0x33b9ab,tmp_campaigns));_0x5e023b['push'](insertTzCmHopperBlack(_0x3168a0['ListId'],_0x63c9('0x87'),_0x63c9('0x4a'),_0x63c9('0x86')));}else{_0x5e023b['push'](insertCmHopper(_0x3168a0['ListId'],'voice_queues_has_cm_lists',_0x63c9('0x4e'),_0x63c9('0x85'),_0x33b9ab));_0x5e023b[_0x63c9('0x47')](insertCmHopperBlack(_0x3168a0[_0x63c9('0x26')],'voice_queues_has_cm_blacklists',_0x63c9('0x4e'),_0x63c9('0x85')));_0x5e023b['push'](insertCmHopper(_0x3168a0['ListId'],_0x63c9('0x4b'),_0x63c9('0x4a'),_0x63c9('0x86'),_0x33b9ab));_0x5e023b[_0x63c9('0x47')](insertCmHopperBlack(_0x3168a0[_0x63c9('0x26')],_0x63c9('0x87'),_0x63c9('0x4a'),_0x63c9('0x86')));}_0x5e023b[_0x63c9('0x47')](_0x63c9('0x88')+tmp_campaigns+';');_0x5e023b['push']('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x63c9('0x81')](_0x5e023b,handleQuery)[_0x63c9('0x82')](function(_0x14d896){stats[_0x63c9('0x89')]=!![];stats[_0x63c9('0x8a')]=_0x3168a0[_0x63c9('0x7b')]&&_0x3168a0[_0x63c9('0x7b')][_0x63c9('0x52')]?results[0x2][_0x63c9('0x8a')]:results[0x0]['affectedRows'];socket[_0x63c9('0x8b')](_0x63c9('0x76')+_0x38856d,stats);fs['unlink'](_0x2b7194);fs[_0x63c9('0x8c')](_0xc32081);process[_0x63c9('0x43')](0x0);})[_0x63c9('0x48')](function(_0x19ab8a){logger[_0x63c9('0x41')](_0x19ab8a[_0x63c9('0x42')]);process[_0x63c9('0x43')](0x1);});});});});}catch(_0x11b7f4){logger['error'](_0x63c9('0x8d'),_0x11b7f4['message']);process[_0x63c9('0x43')](0x1);}},'error':function(_0x26adae,_0x49f496,_0x2613e1,_0x978457){throw new Error(_0x978457);}});}function validate(){if(process[_0x63c9('0x8e')]&&process[_0x63c9('0x8e')][_0x63c9('0x52')]<0x4){throw new Error(_0x63c9('0x8f'));}var _0x568197=path[_0x63c9('0x16')](config['root'],_0x63c9('0x5f'),process[_0x63c9('0x8e')][0x2]);if(!fs[_0x63c9('0x90')](_0x568197)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x22094a={};try{_0x22094a=JSON[_0x63c9('0x64')](process[_0x63c9('0x8e')][0x3]);if(!_0x22094a[_0x63c9('0x5c')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x22094a['binding']['phone']){throw new Error(_0x63c9('0x91'));}if(!_0x22094a['binding']['firstName']){throw new Error(_0x63c9('0x92'));}var _0x5739b8=0x0;if(_0x22094a[_0x63c9('0x5c')][_0x63c9('0x2a')]){_0x5739b8=0x1;}if(!_0x22094a[_0x63c9('0x26')]){throw new Error(_0x63c9('0x93'));}}catch(_0x5199d5){throw new Error(_0x63c9('0x94'));}var _0x457a23=[];try{_0x457a23=_[_0x63c9('0x95')](JSON[_0x63c9('0x64')](process['argv'][0x4]),'id');}catch(_0x193fa1){logger[_0x63c9('0x44')](_0x63c9('0x96'));}main(_0x568197,_0x22094a,_0x457a23,_0x5739b8);}validate();process['on'](_0x63c9('0x97'),handleStop);process['on'](_0x63c9('0x98'),handleUncaughtException);
\ No newline at end of file
diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js
deleted file mode 100644 (file)
index a0d7d7b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0x8dab=['existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','cm_contacts_temp_','format','test','from','join','.id\x20=\x20','where','sequelize','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','message','split','CmContactHasItem','update','updated','create','inserted','CmHopper','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','toString','cm_contacts.phone','cm_contacts.id','into','cm_hopper_black','ContactId','ListId','createdAt','select','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','exit','errors','code','info','query','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','parse','createReadStream','data','find','hasOwnProperty','trim','replace','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','description','SystemRow','appendFileSync','rows','emit','Abort\x20parser','abort','step','CIS\x20len','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x8dab,0x1ec));var _0xb8da=function(_0x4b7380,_0x3e040b){_0x4b7380=_0x4b7380-0x0;var _0x3a2f6b=_0x8dab[_0x4b7380];return _0x3a2f6b;};'use strict';var fs=require('fs');var path=require(_0xb8da('0x0'));var _=require(_0xb8da('0x1'));var Papa=require(_0xb8da('0x2'));var util=require(_0xb8da('0x3'));var BPromise=require(_0xb8da('0x4'));var moment=require(_0xb8da('0x5'));var squel=require(_0xb8da('0x6'));var Redis=require(_0xb8da('0x7'));var db=require(_0xb8da('0x8'))['db'];var config=require(_0xb8da('0x9'));var logger=require(_0xb8da('0xa'))(_0xb8da('0xb'));config[_0xb8da('0xc')]=_[_0xb8da('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb8da('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0xb8da('0xe')+moment()[_0xb8da('0xf')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4ce09a){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))*$/[_0xb8da('0x10')](_0x4ce09a);}function selectNotIn(_0x49754e,_0x440f9d,_0xe91455,_0x17f422,_0x3ffd5f){return squel['select']()['field']('phone')[_0xb8da('0x11')](_0x17f422)[_0xb8da('0x12')](_0x440f9d,null,_0x440f9d+_0xb8da('0x13')+_0x17f422+'.'+_0xe91455)[_0xb8da('0x14')](_0x17f422+'.'+_0xe91455+'\x20=\x20'+_0x49754e+'.'+_0xe91455)[_0xb8da('0x14')](_0x440f9d+'.dialCheckDuplicateType\x20IN\x20('+_0x3ffd5f['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x451087,_0x54173e){promisesAdditionalPhones=[];promisesContact=[];return db[_0xb8da('0x15')]['query'](_0xb8da('0x16')+tempTableName)[_0xb8da('0x17')](function(_0x4225dd){if(_0x4225dd!==null){var _0x27ae46=[];for(var _0x5e0c15=0x0;_0x5e0c15<_0x4225dd[_0xb8da('0x18')];_0x5e0c15++){var _0x20380e=_0x4225dd[_0x5e0c15];if(!_[_0xb8da('0x19')](_0x20380e[_0xb8da('0x1a')])){if(!_['isNil'](_0x20380e[_0xb8da('0x1b')]))_0x27ae46[_0xb8da('0x1c')](insertAdditionalPhones(_0x20380e));promisesContact[_0xb8da('0x1c')]({'contact':_0x20380e});}}}Promise[_0xb8da('0x1d')](_0x27ae46)[_0xb8da('0x1e')](function(){_0x451087({'val':0x1});});})[_0xb8da('0x1f')](function(_0x1e5feb){logger[_0xb8da('0x20')](_0x1e5feb[_0xb8da('0x21')]);});});}function insertAdditionalPhones(_0x173a6b){return new Promise(function(_0x54c95e,_0x25e3eb){var _0x1e5ae2=_0x173a6b[_0xb8da('0x1b')];if(_[_0xb8da('0x19')](_0x1e5ae2))_0x25e3eb({'val':0x0});else{var _0x11c217=_0x1e5ae2[_0xb8da('0x22')](';');var _0x26dda0=[];orderBy=0x0;for(var _0x57b88a=0x0;_0x57b88a<_0x11c217['length'];_0x57b88a++){_0x26dda0[_0xb8da('0x1c')](splitAdditionalPhone(_0x173a6b['id'],_0x11c217[_0x57b88a]));}Promise['all'](_0x26dda0)[_0xb8da('0x1e')](function(){_0x54c95e({'val':_0x11c217[_0xb8da('0x18')]});});}});}function splitAdditionalPhone(_0x3aba10,_0x29ab2a){return new Promise(function(_0xb51a8d,_0xde2fc1){var _0x1bc5d5=_0x29ab2a[_0xb8da('0x22')](':');var _0x535ed5=_0x1bc5d5[0x0];var _0x1dcaea=_0x1bc5d5[0x1];if(_0x1dcaea!==''){var _0xfb396c=_0x1dcaea[_0xb8da('0x22')]('|');var _0x17c746=[];for(var _0x523e62=0x0;_0x523e62<_0xfb396c[_0xb8da('0x18')];_0x523e62++){if(_0xfb396c[_0x523e62]!==''){var _0x268f1c=_['filter'](promisesAdditionalPhones,{'contactId':_0x3aba10,'phone':_0xfb396c[_0x523e62]});if(_0x268f1c['length']==0x0){orderBy++;promisesAdditionalPhones[_0xb8da('0x1c')]({'contactId':_0x3aba10,'contactTypeId':_0x535ed5,'phone':_0xfb396c[_0x523e62],'orderBy':orderBy});}}}_0xb51a8d({'ok':0x1});}else _0xb51a8d({'res':0x0});});}function createAdditionalPhone(_0x25f676,_0x241f49,_0x46d206,_0x57b018){var _0x3ebbf1='';var _0x37e21f='';var _0x474b26=_0x46d206[_0xb8da('0x22')]('§');_0x3ebbf1=_0x474b26[0x0];if(_0x474b26[_0xb8da('0x18')]==0x2)_0x37e21f=_0x474b26[0x1];return new Promise(function(_0x3ba5d7,_0x393cc3){return db[_0xb8da('0x23')]['findOne']({'where':{'CmContactId':_0x25f676,'item':_0x3ebbf1}})['then'](function(_0x3ed31e){if(_0x3ed31e){return db[_0xb8da('0x23')][_0xb8da('0x24')]({'ItemTypeId':_0x241f49,'description':_0x37e21f,'OrderBy':_0x57b018},{'where':{'CmContactId':_0x25f676,'item':_0x3ebbf1}})[_0xb8da('0x1e')](function(_0x2c1e1a){_0x3ba5d7({'res':_0xb8da('0x25')});});}else{return db['CmContactHasItem'][_0xb8da('0x26')]({'CmContactId':_0x25f676,'item':_0x3ebbf1,'ItemTypeId':_0x241f49,'description':_0x37e21f,'OrderBy':_0x57b018,'ItemClass':'PHONE'})[_0xb8da('0x1e')](function(_0x2bd20a){_0x3ba5d7({'res':_0xb8da('0x27')});});}});});}function updateContact(_0x9e2747){return new Promise(function(_0x2ddd43,_0x503f76){var _0x598c28=_0x9e2747['id'];delete _0x9e2747['id'];return db['CmContact']['update'](_0x9e2747,{'where':{'id':_0x598c28}})['then'](function(_0x46c472){updatedRows+=0x1;return db[_0xb8da('0x28')][_0xb8da('0x24')]({'phone':_0x9e2747[_0xb8da('0x1a')]},{'where':{'ContactId':_0x598c28}})[_0xb8da('0x1e')](function(_0x44ffa8){_0x2ddd43({'ret':'OK'});});});});}function insertCmHopper(_0x5ee890,_0x3a44c6,_0x497f7d,_0x303718,_0x33853d){var _0x274f00=['cm_contacts.phone',_0xb8da('0x29'),'cm_contacts.id',_0xb8da('0x2a'),_0x3a44c6+'.'+_0x303718,_0xb8da('0x2b'),_0xb8da('0x2c'),_0xb8da('0x2d'),_0xb8da('0x2e'),'\x22'+_0x33853d+'\x22'];return squel[_0xb8da('0x2f')]()['into']('cm_hopper')[_0xb8da('0x30')]([_0xb8da('0x1a'),'scheduledat','ContactId','ListId',_0x303718,'createdAt',_0xb8da('0x31'),_0xb8da('0x32'),_0xb8da('0x33'),_0xb8da('0x34')],squel['select']()[_0xb8da('0x35')](_0x274f00)['from'](_0x3a44c6)[_0xb8da('0x12')](_0xb8da('0x36'),null,_0xb8da('0x37')+_0x3a44c6+_0xb8da('0x38'))[_0xb8da('0x12')](_0x497f7d,null,_0x497f7d+_0xb8da('0x13')+_0x3a44c6+'.'+_0x303718)[_0xb8da('0x14')](_0x3a44c6+_0xb8da('0x39'),_0x5ee890)[_0xb8da('0x14')](_0xb8da('0x3a'),NOW)[_0xb8da('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3a44c6,_0x497f7d,_0x303718,'cm_hopper',[_0xb8da('0x3b'),_0xb8da('0x3c')]))[_0xb8da('0x14')](_0xb8da('0x3d'),selectNotIn(_0x3a44c6,_0x497f7d,_0x303718,_0xb8da('0x3e'),[_0xb8da('0x3b')])))[_0xb8da('0x3f')]();}function insertCmHopperBlack(_0x2d7488,_0x286c8c,_0x9b03c0,_0x5a708e){var _0xbb6a04=[_0xb8da('0x40'),_0xb8da('0x41'),_0xb8da('0x2a'),_0x286c8c+'.'+_0x5a708e,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xb8da('0x2f')]()[_0xb8da('0x42')](_0xb8da('0x43'))[_0xb8da('0x30')]([_0xb8da('0x1a'),_0xb8da('0x44'),_0xb8da('0x45'),_0x5a708e,_0xb8da('0x46'),_0xb8da('0x31')],squel[_0xb8da('0x47')]()[_0xb8da('0x35')](_0xbb6a04)[_0xb8da('0x11')](_0x286c8c)[_0xb8da('0x12')](_0xb8da('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x286c8c+'.CmListId')[_0xb8da('0x12')](_0x9b03c0,null,_0x9b03c0+_0xb8da('0x13')+_0x286c8c+'.'+_0x5a708e)['where'](_0x286c8c+_0xb8da('0x39'),_0x2d7488)['where'](_0xb8da('0x3a'),NOW)['where'](_0xb8da('0x3d'),squel[_0xb8da('0x47')]()['field'](_0xb8da('0x1a'))['from']('cm_hopper_black')['where'](_0xb8da('0x48'),_0x2d7488)[_0xb8da('0x14')](_0x5a708e+_0xb8da('0x49'),_0x286c8c+'.'+_0x5a708e)))['toString']();}function insertCmHopperAdditionalPhones(_0x4b22c5){var _0x60a972=[_0xb8da('0x4a'),_0xb8da('0x4b'),_0xb8da('0x4c'),_0xb8da('0x4d'),_0xb8da('0x4e')];return squel[_0xb8da('0x2f')]()['into'](_0xb8da('0x4f'))[_0xb8da('0x30')](['CmHopperId',_0xb8da('0x1a'),_0xb8da('0x50'),_0xb8da('0x46'),_0xb8da('0x31')],squel[_0xb8da('0x47')]()['fields'](_0x60a972)[_0xb8da('0x11')](_0xb8da('0x3e'))[_0xb8da('0x12')](_0xb8da('0x36'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xb8da('0x12')]('cm_contact_has_items',null,_0xb8da('0x51'))['where'](_0xb8da('0x52'),_0x4b22c5)[_0xb8da('0x14')](_0xb8da('0x3a'),NOW))[_0xb8da('0x3f')]();}function insertCmContact(_0x573641,_0x3ad951,_0x445949,_0x352714){var _0x40f156=_['concat'](_[_0xb8da('0x53')](_0x352714),[_0xb8da('0x45'),_0xb8da('0x54'),'createdAt',_0xb8da('0x31')]);return squel[_0xb8da('0x2f')]()[_0xb8da('0x42')](_0xb8da('0x36'))[_0xb8da('0x30')](_0x40f156,squel[_0xb8da('0x47')]()[_0xb8da('0x35')](_0x40f156)['from'](_0x3ad951)[_0xb8da('0x14')]('('+_0x445949['join'](',')+_0xb8da('0x55'),squel[_0xb8da('0x47')]()['fields'](_0x445949)[_0xb8da('0x11')](_0xb8da('0x36'))[_0xb8da('0x14')]('ListId\x20=\x20?',_0x573641))[_0xb8da('0x14')](_0xb8da('0x56'),squel[_0xb8da('0x47')]()['field'](_0xb8da('0x57'),_0xb8da('0x58'))['from'](_0x3ad951)[_0xb8da('0x59')](_0x445949[_0xb8da('0x12')](','))))[_0xb8da('0x3f')]();}function handleStop(){logger['info'](_0xb8da('0x5a'));stopped=!![];}function handleUncaughtException(_0x2018e6){logger[_0xb8da('0x20')](_0x2018e6['message']);process[_0xb8da('0x5b')](0x1);}function handleError(_0x1dbeac,_0x39492d){stats[_0xb8da('0x5c')][_0xb8da('0x1c')]({'name':_0x39492d[_0xb8da('0x5d')],'message':_0x39492d[_0xb8da('0x21')],'row':_0x1dbeac});}function handleQuery(_0x5958bd){logger[_0xb8da('0x5e')](_0x5958bd);return db[_0xb8da('0x15')][_0xb8da('0x5f')](_0x5958bd)['spread'](function(_0x5a17a4){results['push'](_0x5a17a4);})[_0xb8da('0x1f')](function(_0x1c1a28){logger[_0xb8da('0x20')](_0x1c1a28['message']);});}function main(_0x5c428f,_0x80f967,_0x105b6c,_0x4707ba){logger['info'](_0xb8da('0x60'),_0x5c428f,JSON[_0xb8da('0x61')](_0x80f967));process[_0xb8da('0x62')](_0xb8da('0x63'));var _0x381eb8=_0x80f967[_0xb8da('0x64')];var _0x3fa4db=_['clone'](_0x381eb8);var _0x41b671=_0x80f967[_0xb8da('0x65')];var _0xc52dfb=path[_0xb8da('0x12')](config['root'],_0xb8da('0x66'),_0x41b671+_0xb8da('0x67'));logger['info'](_0xb8da('0x68'),_0x80f967);db[_0xb8da('0x69')][_0xb8da('0x6a')]({'raw':!![],'attributes':['id','name']})[_0xb8da('0x1e')](function(_0x315e9b){for(var _0x5db801=0x0;_0x5db801<_0x315e9b[_0xb8da('0x18')];_0x5db801++){if(_0x315e9b[_0x5db801]['name']in _0x381eb8){contactItemTypes[_0xb8da('0x1c')](_0x315e9b[_0x5db801]);delete _0x3fa4db[_0x315e9b[_0x5db801][_0xb8da('0x6b')]];hasAdditionalPhones=!![];}for(var _0x4b2fd7 in _0x381eb8){if(_0x315e9b[_0x5db801][_0xb8da('0x6b')]+_0xb8da('0x6c')===_0x4b2fd7){phoneDescriptions['push']({'itemTypeId':_0x315e9b[_0x5db801]['id'],'description':_0x4b2fd7});delete _0x3fa4db[_0x4b2fd7];}}}if(hasAdditionalPhones)_0x3fa4db['AdditionalPhones']='';var _0x4c971a=_['keys'](_0x3fa4db)[_0xb8da('0x12')]();logger['info'](_0xb8da('0x6d'),_0x4c971a);fs['writeFileSync'](_0xc52dfb,_0x4c971a+'\x0a');Papa[_0xb8da('0x6e')](fs[_0xb8da('0x6f')](_0x5c428f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x39a757,_0x39bbf8){try{for(var _0x5637c5=0x0,_0x83e227=[];_0x5637c5<_0x39a757[_0xb8da('0x70')]['length'];_0x5637c5++){stats['rows']+=0x1;if(_0x39a757[_0xb8da('0x5c')][_0x5637c5]){handleError(_0x39a757[_0xb8da('0x70')][_0x5637c5],_0x39a757[_0xb8da('0x5c')][_0x5637c5]);}else{var _0x4fb0ab=[];var _0x2c14d7=[];var _0x39c41d={};for(var _0x3b2e85 in _0x381eb8){let _0x2be45c=contactItemTypes[_0xb8da('0x71')](_0x459216=>_0x459216[_0xb8da('0x6b')]===_0x3b2e85);let _0x4fba9a=contactItemTypes['find'](_0x2d999e=>_0x2d999e[_0xb8da('0x6b')]+_0xb8da('0x6c')===_0x3b2e85);if(_[_0xb8da('0x19')](_0x2be45c)&&_[_0xb8da('0x19')](_0x4fba9a)){if(_0x381eb8[_0xb8da('0x72')](_0x3b2e85)){if(_0x39a757[_0xb8da('0x70')][_0x5637c5][_0x381eb8[_0x3b2e85]]){var _0x52ea15=_[_0xb8da('0x73')](_0x39a757[_0xb8da('0x70')][_0x5637c5][_0x381eb8[_0x3b2e85]][_0xb8da('0x74')](/"/g,'\x27'));switch(_0x3b2e85){case _0xb8da('0x75'):var _0x2da36d=moment(_0x52ea15,_0xb8da('0x76'),!![]);if(_0x2da36d[_0xb8da('0x77')]()){_0x83e227['push']('\x22'+_0x52ea15+'\x22');}else{_0x4fb0ab[_0xb8da('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xb8da('0x32'):var _0x37c4f1=parseInt(_0x52ea15);_0x52ea15=_[_0xb8da('0x78')](_0x37c4f1)||_0x37c4f1<0x0||_0x37c4f1>0x4?_0x4707ba?0x3:0x2:_0x37c4f1;_0x83e227['push']('\x22'+_0x52ea15+'\x22');break;case _0xb8da('0x33'):var _0x4ddf6d=parseInt(_0x52ea15);if(_[_0xb8da('0x79')](_0x4ddf6d)&&_[_0xb8da('0x7a')](_0x105b6c,_0x4ddf6d)){_0x83e227[_0xb8da('0x1c')]('\x22'+_0x4ddf6d+'\x22');}else{_0x4fb0ab[_0xb8da('0x1c')](_0xb8da('0x7b'));}break;case _0xb8da('0x7c'):if(isEmail(_0x52ea15)){_0x83e227[_0xb8da('0x1c')]('\x22'+_0x52ea15+'\x22');}else{_0x4fb0ab[_0xb8da('0x1c')](_0xb8da('0x7d'));}break;case _0xb8da('0x7e'):var _0x255f38=moment(_0x52ea15,'YYYY-MM-DD',!![]);if(_0x255f38[_0xb8da('0x77')]()){_0x83e227[_0xb8da('0x1c')]('\x22'+_0x52ea15+'\x22');}else{_0x4fb0ab[_0xb8da('0x1c')](_0xb8da('0x7f'));}break;default:_0x83e227[_0xb8da('0x1c')]('\x22'+_0x52ea15+'\x22');}}else{switch(_0x3b2e85){case _0xb8da('0x80'):case'phone':_0x4fb0ab[_0xb8da('0x1c')](_0x3b2e85+'\x20not\x20specified');break;default:_0x83e227[_0xb8da('0x1c')]('\x22\x22');}}}}else{var _0x54b4bc='';if(!_[_0xb8da('0x19')](_0x2be45c)){if(!_0x39c41d[_0xb8da('0x72')](_0x2be45c['id'])){for(var _0x522fb0=0x0;_0x522fb0<_0x381eb8[_0x3b2e85][_0xb8da('0x18')];_0x522fb0++){var _0x52ea15=_['trim'](_0x39a757[_0xb8da('0x70')][_0x5637c5][_0x381eb8[_0x3b2e85][_0x522fb0]][_0xb8da('0x74')](/"/g,'\x27'));var _0x28abff=phoneDescriptions[_0xb8da('0x71')](_0x2eb1e1=>_0x2eb1e1[_0xb8da('0x81')]===_0x2be45c['id']);if(!_[_0xb8da('0x19')](_0x28abff)){var _0x2c310d=_[_0xb8da('0x73')](_0x39a757['data'][_0x5637c5][_0x381eb8[_0x28abff[_0xb8da('0x82')]][0x0]][_0xb8da('0x74')](/"/g,'\x27'));if(!_[_0xb8da('0x19')](_0x2c310d))_0x52ea15=_0x52ea15+'§'+_0x2c310d;}if(_0x54b4bc=='')_0x54b4bc=_0x52ea15;else _0x54b4bc+='|'+_0x52ea15;}_0x2c14d7['push'](_0x2be45c['id']+':'+_0x54b4bc);_0x39c41d[_0x2be45c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x83e227[_0xb8da('0x1c')]('\x22'+_0x2c14d7[_0xb8da('0x12')](';')+'\x22');}if(_0x4fb0ab['length']){handleError(_0x39a757[_0xb8da('0x70')][_0x5637c5],{'code':_0xb8da('0x83'),'message':_0x4fb0ab['join']()});}else{fs[_0xb8da('0x84')](_0xc52dfb,_0x83e227[_0xb8da('0x12')]()+'\x0a');}_0x83e227=[];}if(!(stats[_0xb8da('0x85')]%0xc8)){socket[_0xb8da('0x86')]('contact:import:'+_0x41b671,stats);stats[_0xb8da('0x5c')]=[];}}if(stopped){logger['info'](_0xb8da('0x87'));_0x39bbf8[_0xb8da('0x88')]();}}catch(_0x26d61e){handleError(_0x39a757[_0xb8da('0x70')][_0x5637c5],{'code':'SystemError','message':_0x26d61e['message']});logger[_0xb8da('0x20')](_0xb8da('0x89'),_0x26d61e[_0xb8da('0x21')]);}},'complete':function(){try{var _0x2dcfd2=[];var _0x376543=tempTableName;_0x2dcfd2[_0xb8da('0x1c')]('CREATE\x20TABLE\x20'+_0x376543+'\x20LIKE\x20cm_contacts;');logger[_0xb8da('0x5e')](_0xb8da('0x8a'),contactItemTypes['length']);var _0x3bd35a=util[_0xb8da('0xf')](_0xb8da('0x8b'),_0xc52dfb,_0x376543,_0x4c971a,_0x80f967[_0xb8da('0x45')],_0x80f967['CompanyId']||null,NOW,NOW);if(_[_0xb8da('0x19')](_0x381eb8[_0xb8da('0x75')])){_0x3bd35a+=_0xb8da('0x8c');}_0x2dcfd2['push'](_0x3bd35a);BPromise[_0xb8da('0x8d')](_0x2dcfd2,handleQuery)['then'](function(_0x3e5a1b){BPromise[_0xb8da('0x1d')]([handleAdditionalPhones()])['then'](function(){_0x2dcfd2=[];for(var _0x528a1c=0x0;_0x528a1c<promisesContact[_0xb8da('0x18')];_0x528a1c++){_0x2dcfd2[_0xb8da('0x1c')](updateContact(promisesContact[_0x528a1c]['contact']));}BPromise[_0xb8da('0x1d')](_0x2dcfd2)[_0xb8da('0x1e')](function(){_0x2dcfd2=[];for(var _0x576259=0x0;_0x576259<promisesAdditionalPhones['length'];_0x576259++){_0x2dcfd2[_0xb8da('0x1c')](createAdditionalPhone(promisesAdditionalPhones[_0x576259][_0xb8da('0x8e')],promisesAdditionalPhones[_0x576259][_0xb8da('0x8f')],promisesAdditionalPhones[_0x576259][_0xb8da('0x1a')],promisesAdditionalPhones[_0x576259][_0xb8da('0x90')]));}BPromise[_0xb8da('0x1d')](_0x2dcfd2)['then'](function(){_0x2dcfd2=[];_0x2dcfd2[_0xb8da('0x1c')](insertCmHopperAdditionalPhones(_0x80f967[_0xb8da('0x45')]));_0x2dcfd2[_0xb8da('0x1c')](_0xb8da('0x91')+_0x376543+';');BPromise['each'](_0x2dcfd2,handleQuery)[_0xb8da('0x1e')](function(_0x56a550){stats[_0xb8da('0x92')]=!![];stats[_0xb8da('0x93')]=updatedRows;socket[_0xb8da('0x86')]('contact:import:'+_0x41b671,stats);fs[_0xb8da('0x94')](_0x5c428f);fs[_0xb8da('0x94')](_0xc52dfb);process[_0xb8da('0x5b')](0x0);})[_0xb8da('0x1f')](function(_0x1d425c){logger[_0xb8da('0x20')](_0x1d425c[_0xb8da('0x21')]);process[_0xb8da('0x5b')](0x1);});});});});})[_0xb8da('0x1f')](function(_0x5cafa2){logger[_0xb8da('0x20')](_0x5cafa2[_0xb8da('0x21')]);process[_0xb8da('0x5b')](0x1);});}catch(_0x15cb1b){logger['error']('complete',_0x15cb1b[_0xb8da('0x21')]);process[_0xb8da('0x5b')](0x1);}},'error':function(_0x381e4b,_0x1a5163,_0x1267e1,_0x5354fe){throw new Error(_0x5354fe);}});});}function validate(){if(process[_0xb8da('0x95')]&&process[_0xb8da('0x95')][_0xb8da('0x18')]<0x4){throw new Error(_0xb8da('0x96'));}var _0x21f66a=path[_0xb8da('0x12')](config[_0xb8da('0x97')],_0xb8da('0x66'),process['argv'][0x2]);if(!fs[_0xb8da('0x98')](_0x21f66a)){throw new Error(_0xb8da('0x99'));}var _0x1d9f02={};try{_0x1d9f02=JSON[_0xb8da('0x6e')](process['argv'][0x3]);if(!_0x1d9f02[_0xb8da('0x64')]){throw new Error(_0xb8da('0x9a'));}var _0x352d91=0x0;if(_0x1d9f02[_0xb8da('0x64')][_0xb8da('0x33')]){_0x352d91=0x1;}if(!_0x1d9f02[_0xb8da('0x45')]){throw new Error(_0xb8da('0x9b'));}}catch(_0x2dc7bd){throw new Error(_0xb8da('0x9c'));}var _0x2767d2=[];try{_0x2767d2=_[_0xb8da('0x9d')](JSON[_0xb8da('0x6e')](process[_0xb8da('0x95')][0x4]),'id');}catch(_0x71fac7){logger['info'](_0xb8da('0x9e'));}main(_0x21f66a,_0x1d9f02,_0x2767d2,_0x352d91);}validate();process['on'](_0xb8da('0x9f'),handleStop);process['on'](_0xb8da('0xa0'),handleUncaughtException);
\ No newline at end of file
index 0a87e62..f183e72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed1=['Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','queue','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt'];(function(_0x2b1552,_0x17993f){var _0x4cd48e=function(_0x30c176){while(--_0x30c176){_0x2b1552['push'](_0x2b1552['shift']());}};_0x4cd48e(++_0x17993f);}(_0xfed1,0x1b7));var _0x1fed=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xfed1[_0x12fc8d];return _0x3f9d04;};'use strict';exports[_0x1fed('0x0')]=function(_0x3c93d9,_0x51b549){var _0x2dbd96=[{'type':_0x1fed('0x1'),'content':_0x1fed('0x2'),'variableName':null}];switch(_0x3c93d9['toLowerCase']()){case _0x1fed('0x3'):switch(_0x51b549[_0x1fed('0x4')]()){case _0x1fed('0x5'):_0x2dbd96[_0x1fed('0x6')]({'type':_0x1fed('0x7'),'content':'','variableName':'queue'});_0x2dbd96[_0x1fed('0x6')]({'type':_0x1fed('0x7'),'content':'','variableName':_0x1fed('0x8')});break;case _0x1fed('0x9'):_0x2dbd96['push']({'type':_0x1fed('0x1'),'content':_0x1fed('0xa'),'variableName':null});_0x2dbd96['push']({'type':_0x1fed('0x7'),'content':'','variableName':_0x1fed('0xb')});break;}}return _0x2dbd96;};exports[_0x1fed('0xc')]=function(_0x2d1b59,_0x49cec3){var _0x2e6939=[];switch(_0x2d1b59[_0x1fed('0x4')]()){case'voice':switch(_0x49cec3['toLowerCase']()){case _0x1fed('0x5'):_0x2e6939=[{'type':_0x1fed('0x1'),'content':_0x1fed('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0xf'),'keyType':_0x1fed('0x7'),'variableName':_0x1fed('0x8')},{'type':'keyValue','content':'','key':_0x1fed('0x10'),'keyType':_0x1fed('0x7'),'variableName':_0x1fed('0x11')},{'type':_0x1fed('0xe'),'content':'','key':'Call\x20To','keyType':_0x1fed('0x7'),'variableName':_0x1fed('0x12')},{'type':_0x1fed('0xe'),'content':'','key':'Queue','keyType':_0x1fed('0x7'),'variableName':_0x1fed('0x13')},{'type':_0x1fed('0xe'),'content':'','key':'UniqueId','keyType':_0x1fed('0x7'),'variableName':_0x1fed('0x14')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x15'),'keyType':_0x1fed('0x7'),'variableName':'agentcalledAt'},{'type':_0x1fed('0x1'),'content':_0x1fed('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x17'),'keyType':_0x1fed('0x7'),'variableName':_0x1fed('0x18')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x19'),'keyType':_0x1fed('0x7'),'variableName':_0x1fed('0xb')},{'type':'string','content':_0x1fed('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x1b'),'keyType':_0x1fed('0x7'),'variableName':_0x1fed('0x1c')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x1d'),'keyType':'variable','variableName':_0x1fed('0x1e')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x1f'),'keyType':_0x1fed('0x7'),'variableName':_0x1fed('0x20')},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x1fed('0x21')},{'type':'keyValue','content':'','key':_0x1fed('0x22'),'keyType':'variable','variableName':_0x1fed('0x23')}];break;case'outbound':_0x2e6939=[{'type':_0x1fed('0x1'),'content':_0x1fed('0xd'),'variableName':null},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x24'),'keyType':_0x1fed('0x7'),'keyContent':'','variableName':_0x1fed('0xb')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x25'),'keyType':'variable','keyContent':'','variableName':_0x1fed('0x26')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x27'),'keyType':_0x1fed('0x7'),'keyContent':'','variableName':_0x1fed('0x14')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x15'),'keyType':_0x1fed('0x7'),'keyContent':'','variableName':'starttime'},{'type':_0x1fed('0x1'),'content':_0x1fed('0x1a')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x28'),'keyType':'variable','keyContent':'','variableName':_0x1fed('0x29')},{'type':'keyValue','content':'','key':_0x1fed('0x2a'),'keyType':_0x1fed('0x7'),'keyContent':'','variableName':_0x1fed('0x2b')},{'type':_0x1fed('0xe'),'content':'','key':_0x1fed('0x2c'),'keyType':'variable','keyContent':'','variableName':_0x1fed('0x2d')},{'type':_0x1fed('0xe'),'content':'','key':'Billable\x20Time','keyType':_0x1fed('0x7'),'keyContent':'','variableName':_0x1fed('0x2e')}];break;}}return _0x2e6939;};
\ No newline at end of file
+var _0xb782=['talktime','Called\x20Number','starttime','answertime','Complete\x20Time','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time'];(function(_0xece0c3,_0x47ddab){var _0x4a1939=function(_0x5a63e6){while(--_0x5a63e6){_0xece0c3['push'](_0xece0c3['shift']());}};_0x4a1939(++_0x47ddab);}(_0xb782,0x110));var _0x2b78=function(_0x39b0cb,_0x57f473){_0x39b0cb=_0x39b0cb-0x0;var _0x1d6a54=_0xb782[_0x39b0cb];return _0x1d6a54;};'use strict';exports['getSubjects']=function(_0x194f4f,_0x497039){var _0x39770b=[{'type':_0x2b78('0x0'),'content':_0x2b78('0x1'),'variableName':null}];switch(_0x194f4f[_0x2b78('0x2')]()){case _0x2b78('0x3'):switch(_0x497039['toLowerCase']()){case'inbound':_0x39770b[_0x2b78('0x4')]({'type':_0x2b78('0x5'),'content':'','variableName':_0x2b78('0x6')});_0x39770b[_0x2b78('0x4')]({'type':'variable','content':'','variableName':_0x2b78('0x7')});break;case _0x2b78('0x8'):_0x39770b[_0x2b78('0x4')]({'type':_0x2b78('0x0'),'content':_0x2b78('0x9'),'variableName':null});_0x39770b['push']({'type':'variable','content':'','variableName':_0x2b78('0xa')});break;}}return _0x39770b;};exports[_0x2b78('0xb')]=function(_0x2985f1,_0x1e8128){var _0x329f41=[];switch(_0x2985f1[_0x2b78('0x2')]()){case _0x2b78('0x3'):switch(_0x1e8128[_0x2b78('0x2')]()){case _0x2b78('0xc'):_0x329f41=[{'type':_0x2b78('0x0'),'content':_0x2b78('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0xf'),'keyType':'variable','variableName':_0x2b78('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x2b78('0x5'),'variableName':_0x2b78('0x10')},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x11'),'keyType':_0x2b78('0x5'),'variableName':_0x2b78('0x12')},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x13'),'keyType':_0x2b78('0x5'),'variableName':_0x2b78('0x6')},{'type':'keyValue','content':'','key':_0x2b78('0x14'),'keyType':_0x2b78('0x5'),'variableName':_0x2b78('0x15')},{'type':'keyValue','content':'','key':_0x2b78('0x16'),'keyType':_0x2b78('0x5'),'variableName':_0x2b78('0x17')},{'type':'string','content':_0x2b78('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x19'),'keyType':'variable','variableName':_0x2b78('0x1a')},{'type':'keyValue','content':'','key':_0x2b78('0x1b'),'keyType':_0x2b78('0x5'),'variableName':_0x2b78('0xa')},{'type':_0x2b78('0x0'),'content':_0x2b78('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x1d'),'keyType':_0x2b78('0x5'),'variableName':_0x2b78('0x17')},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x1e'),'keyType':_0x2b78('0x5'),'variableName':_0x2b78('0x1f')},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x20'),'keyType':'variable','variableName':_0x2b78('0x21')},{'type':_0x2b78('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x2b78('0x5'),'variableName':_0x2b78('0x22')},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x23'),'keyType':'variable','variableName':_0x2b78('0x24')}];break;case _0x2b78('0x8'):_0x329f41=[{'type':_0x2b78('0x0'),'content':_0x2b78('0xd'),'variableName':null},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x25'),'keyType':'variable','keyContent':'','variableName':_0x2b78('0xa')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x14'),'keyType':_0x2b78('0x5'),'keyContent':'','variableName':_0x2b78('0x15')},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x16'),'keyType':_0x2b78('0x5'),'keyContent':'','variableName':_0x2b78('0x26')},{'type':_0x2b78('0x0'),'content':_0x2b78('0x1c')},{'type':_0x2b78('0xe'),'content':'','key':'Answer\x20Time','keyType':_0x2b78('0x5'),'keyContent':'','variableName':_0x2b78('0x27')},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x28'),'keyType':_0x2b78('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x2b78('0xe'),'content':'','key':'Duration','keyType':_0x2b78('0x5'),'keyContent':'','variableName':_0x2b78('0x29')},{'type':_0x2b78('0xe'),'content':'','key':_0x2b78('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x2b78('0x2b')}];break;}}return _0x329f41;};
\ No newline at end of file
index 828eaea..b3df52f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3be=['mail-interactions','sms-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','info','catch','error','tracked','query','body','html','fax','mobile','lodash','../../mysqldb','../../config/logger'];(function(_0x4e2a1e,_0x50cb5c){var _0x16e5f4=function(_0x31ad06){while(--_0x31ad06){_0x4e2a1e['push'](_0x4e2a1e['shift']());}};_0x16e5f4(++_0x50cb5c);}(_0xf3be,0x110));var _0xef3b=function(_0x164a23,_0x4c9f03){_0x164a23=_0x164a23-0x0;var _0x2e297b=_0xf3be[_0x164a23];return _0x2e297b;};'use strict';var _=require(_0xef3b('0x0'));var db=require(_0xef3b('0x1'))['db'];var loggers={'openchannel':require(_0xef3b('0x2'))('openchannel-interactions'),'mail':require(_0xef3b('0x2'))(_0xef3b('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xef3b('0x2'))(_0xef3b('0x4')),'chat':require(_0xef3b('0x2'))('chat-interactions'),'whatsapp':require(_0xef3b('0x2'))('whatsapp-interactions')};function getInteractionId(_0x5cbaf0,_0x4890ac,_0x22a6ca){if(_0x5cbaf0&&_0x5cbaf0[_[_0xef3b('0x5')](_0x22a6ca)+_0xef3b('0x6')]){return _0x5cbaf0[_[_0xef3b('0x5')](_0x22a6ca)+_0xef3b('0x6')];}else if(_0x5cbaf0&&_0x5cbaf0['id']){return _0x5cbaf0['id'];}else if(_0x4890ac&&_0x4890ac['id']){return _0x4890ac['id'];}else{return'unknown';}}function log(_0x4e2c36,_0x21017c,_0x28a26f,_0x2fda3e,_0x19543c,_0x30c2e9){loggers[_0x19543c[_0xef3b('0x7')]()][_0x4e2c36](_0xef3b('0x8'),_0x30c2e9[_0xef3b('0x9')](),_0x21017c?_0x21017c['id']:null,_0x21017c?_0x21017c[_0xef3b('0xa')]:null,_0x21017c?_0x21017c['role']:null,getInteractionId(_0x28a26f,_0x2fda3e,_0x19543c),_0x28a26f?JSON[_0xef3b('0xb')](_0x28a26f):_0xef3b('0xc'));}function updateUser(_0x61a9f,_0x23267f,_0x2b4713,_0x26c672,_0x5cf21c){db[_[_0xef3b('0x5')](_0x26c672)+_0xef3b('0xd')][_0xef3b('0xe')]({'where':{'id':getInteractionId(_0x23267f,_0x2b4713,_0x26c672)}})[_0xef3b('0xf')](function(_0xf91712){if(_0xf91712){return _0xf91712['update']({'UserId':_0x61a9f?_0x61a9f['id']:null});}})[_0xef3b('0xf')](function(_0x4a2fdb){if(_0x4a2fdb){log(_0xef3b('0x10'),_0x61a9f,_0x23267f,_0x2b4713,_0x26c672,_0x5cf21c);}})[_0xef3b('0x11')](function(){log(_0xef3b('0x12'),_0x61a9f,_0x23267f,_0x2b4713,_0x26c672,_0x5cf21c);});}exports[_0xef3b('0x13')]=function(_0x40d96f,_0x550c6a){return function(_0x1b6124,_0x787183,_0xca813d){var _0x287dcb=_0x1b6124['user'];var _0x4f9ee7={};var _0x2845e7=_0x1b6124[_0xef3b('0x14')];if(_0x4f9ee7){_0x4f9ee7=_['clone'](_0x1b6124['body']);_0x4f9ee7=_['omit'](_0x4f9ee7,[_0xef3b('0x15'),_0xef3b('0x16'),'phone',_0xef3b('0x17'),_0xef3b('0x18')]);}updateUser(_0x287dcb,_0x4f9ee7,_0x2845e7,_0x40d96f,_0x550c6a);_0xca813d(null);};};
\ No newline at end of file
+var _0x400a=['InteractionId','upperFirst','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','null','Interaction','update','catch','tracked','user','clone','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions'];(function(_0x33f959,_0x4946fd){var _0x4f09f5=function(_0x1c09f0){while(--_0x1c09f0){_0x33f959['push'](_0x33f959['shift']());}};_0x4f09f5(++_0x4946fd);}(_0x400a,0x1a1));var _0xa400=function(_0x39de46,_0x3cda5b){_0x39de46=_0x39de46-0x0;var _0xa3b350=_0x400a[_0x39de46];return _0xa3b350;};'use strict';var _=require(_0xa400('0x0'));var db=require(_0xa400('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0xa400('0x2'))(_0xa400('0x3')),'fax':require(_0xa400('0x2'))(_0xa400('0x4')),'sms':require('../../config/logger')(_0xa400('0x5')),'chat':require(_0xa400('0x2'))(_0xa400('0x6')),'whatsapp':require(_0xa400('0x2'))(_0xa400('0x7'))};function getInteractionId(_0x5c0c94,_0xd46bf5,_0x2761ee){if(_0x5c0c94&&_0x5c0c94[_['upperFirst'](_0x2761ee)+_0xa400('0x8')]){return _0x5c0c94[_[_0xa400('0x9')](_0x2761ee)+_0xa400('0x8')];}else if(_0x5c0c94&&_0x5c0c94['id']){return _0x5c0c94['id'];}else if(_0xd46bf5&&_0xd46bf5['id']){return _0xd46bf5['id'];}else{return'unknown';}}function log(_0x1f5bda,_0x629973,_0x52138d,_0x997e87,_0x203839,_0x28964d){loggers[_0x203839[_0xa400('0xa')]()][_0x1f5bda](_0xa400('0xb'),_0x28964d['toUpperCase'](),_0x629973?_0x629973['id']:null,_0x629973?_0x629973[_0xa400('0xc')]:null,_0x629973?_0x629973['role']:null,getInteractionId(_0x52138d,_0x997e87,_0x203839),_0x52138d?JSON['stringify'](_0x52138d):_0xa400('0xd'));}function updateUser(_0x70ced0,_0x4e6083,_0xca8e66,_0xe41bec,_0x22322a){db[_[_0xa400('0x9')](_0xe41bec)+_0xa400('0xe')]['findOne']({'where':{'id':getInteractionId(_0x4e6083,_0xca8e66,_0xe41bec)}})['then'](function(_0x3ce62b){if(_0x3ce62b){return _0x3ce62b[_0xa400('0xf')]({'UserId':_0x70ced0?_0x70ced0['id']:null});}})['then'](function(_0xfdce8d){if(_0xfdce8d){log('info',_0x70ced0,_0x4e6083,_0xca8e66,_0xe41bec,_0x22322a);}})[_0xa400('0x10')](function(){log('error',_0x70ced0,_0x4e6083,_0xca8e66,_0xe41bec,_0x22322a);});}exports[_0xa400('0x11')]=function(_0x4db81c,_0x3f91f6){return function(_0x392374,_0x138edf,_0x4cafb7){var _0x1bfd70=_0x392374[_0xa400('0x12')];var _0x5c5abf={};var _0x61056c=_0x392374['query'];if(_0x5c5abf){_0x5c5abf=_[_0xa400('0x13')](_0x392374[_0xa400('0x14')]);_0x5c5abf=_['omit'](_0x5c5abf,[_0xa400('0x14'),_0xa400('0x15'),_0xa400('0x16'),_0xa400('0x17'),_0xa400('0x18')]);}updateUser(_0x1bfd70,_0x5c5abf,_0x61056c,_0x4db81c,_0x3f91f6);_0x4cafb7(null);};};
\ No newline at end of file
index b58acdf..7ade84d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e43=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','util','composable-middleware','license','data1','split','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','findOne','then','status'];(function(_0x42d5d8,_0x4b5ae8){var _0x3be35b=function(_0x10ad7a){while(--_0x10ad7a){_0x42d5d8['push'](_0x42d5d8['shift']());}};_0x3be35b(++_0x4b5ae8);}(_0x4e43,0x132));var _0x34e4=function(_0x3df042,_0x4ce182){_0x3df042=_0x3df042-0x0;var _0xe0ef6d=_0x4e43[_0x3df042];return _0xe0ef6d;};'use strict';var crypto=require('crypto');var util=require(_0x34e4('0x0'));var compose=require(_0x34e4('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x190e14,_0x37943d){if(_0x190e14&&_0x37943d){if(_0x37943d['data1']&&_0x37943d[_0x34e4('0x2')]){var _0x29f1e6=_0x37943d[_0x34e4('0x3')];var _0x417575=_0x37943d[_0x34e4('0x2')];var _0x30774c=_0x29f1e6[_0x34e4('0x4')]('-')[0x4];var _0x1f4348=_0x29f1e6[_0x34e4('0x4')]('-')[0x0];var _0x572e0c=crypto['createDecipher'](_0x34e4('0x5'),util[_0x34e4('0x6')](_0x34e4('0x7'),_0x30774c,_0x29f1e6,_0x1f4348));var _0x57155d=_0x572e0c[_0x34e4('0x8')](_0x417575,'base64',_0x34e4('0x9'));_0x57155d+=_0x572e0c[_0x34e4('0xa')](_0x34e4('0x9'));var _0x45b5f2=JSON[_0x34e4('0xb')](_0x57155d);return _0x45b5f2[_0x34e4('0xc')](_0x190e14)?_0x45b5f2[_0x190e14]:null;}}return null;}function isLimit(_0x236559,_0x756f2c,_0x5e8a4b,_0x17a2e8){var _0x1e5214=_0x756f2c;return compose()['use'](function(_0x356dc3,_0x6cc241,_0x1acdb2){return db['License'][_0x34e4('0xd')]({'where':{'id':0x1},'raw':!![]})[_0x34e4('0xe')](function(_0x216cda){var _0x336745=getValueFromLicense(_0x236559,_0x216cda);return _0x336745?_0x336745:_0x1e5214;})['then'](function(_0x3d18d6){_0x1e5214=_0x3d18d6;return _0x5e8a4b['count'](_0x17a2e8);})[_0x34e4('0xe')](function(_0x43e0ef){if(_0x43e0ef>=_0x1e5214){return _0x6cc241[_0x34e4('0xf')](0x193)[_0x34e4('0x10')]({'message':util[_0x34e4('0x6')](_0x34e4('0x11'),_0x236559)});}_0x1acdb2();})[_0x34e4('0x12')](function(_0x33f85d){_0x1acdb2(_0x33f85d);});});}function isUserLimit(){return isLimit(_0x34e4('0x13'),0x1,db[_0x34e4('0x14')],{'where':{'$or':[{'role':'admin'},{'role':_0x34e4('0x15')}]}});}exports[_0x34e4('0x16')]=isUserLimit;
\ No newline at end of file
+var _0x72db=['License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','hasOwnProperty','use'];(function(_0x51a303,_0x372f44){var _0x49e7f4=function(_0x6a8eab){while(--_0x6a8eab){_0x51a303['push'](_0x51a303['shift']());}};_0x49e7f4(++_0x372f44);}(_0x72db,0x141));var _0xb72d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72db[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0xb72d('0x0'));var util=require(_0xb72d('0x1'));var compose=require(_0xb72d('0x2'));var db=require(_0xb72d('0x3'))['db'];var config=require(_0xb72d('0x4'));function getValueFromLicense(_0x3b0b17,_0xa879){if(_0x3b0b17&&_0xa879){if(_0xa879[_0xb72d('0x5')]&&_0xa879['license']){var _0xd3e441=_0xa879[_0xb72d('0x5')];var _0x5111a4=_0xa879[_0xb72d('0x6')];var _0x426b1b=_0xd3e441[_0xb72d('0x7')]('-')[0x4];var _0x46dafe=_0xd3e441[_0xb72d('0x7')]('-')[0x0];var _0x18d18f=crypto[_0xb72d('0x8')](_0xb72d('0x9'),util[_0xb72d('0xa')](_0xb72d('0xb'),_0x426b1b,_0xd3e441,_0x46dafe));var _0xff6099=_0x18d18f[_0xb72d('0xc')](_0x5111a4,_0xb72d('0xd'),'utf8');_0xff6099+=_0x18d18f['final'](_0xb72d('0xe'));var _0x3c6167=JSON['parse'](_0xff6099);return _0x3c6167[_0xb72d('0xf')](_0x3b0b17)?_0x3c6167[_0x3b0b17]:null;}}return null;}function isLimit(_0x569409,_0x32c6b7,_0x4eb093,_0xa885e5){var _0x49cc81=_0x32c6b7;return compose()[_0xb72d('0x10')](function(_0x7a9a41,_0x3cd515,_0x1fade4){return db[_0xb72d('0x11')][_0xb72d('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xb72d('0x13')](function(_0x288beb){var _0x283cd9=getValueFromLicense(_0x569409,_0x288beb);return _0x283cd9?_0x283cd9:_0x49cc81;})[_0xb72d('0x13')](function(_0x3184cd){_0x49cc81=_0x3184cd;return _0x4eb093[_0xb72d('0x14')](_0xa885e5);})['then'](function(_0xb57491){if(_0xb57491>=_0x49cc81){return _0x3cd515[_0xb72d('0x15')](0x193)[_0xb72d('0x16')]({'message':util[_0xb72d('0xa')](_0xb72d('0x17'),_0x569409)});}_0x1fade4();})['catch'](function(_0x4a831d){_0x1fade4(_0x4a831d);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xb72d('0x18')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xb72d('0x19')]=isUserLimit;
\ No newline at end of file
index 068c366..a28f981 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5078=['field','$ne','$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','$in','start','$substring','$startsWith','pop','utcOffset','hours','add','seconds','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','forEach','shift','match','filter','map','conditions','buildExpression','DATE','operator','$between','value','includes','$lte','castTo','text','CAST('];(function(_0x5bb331,_0x5d7d4c){var _0x485355=function(_0x28c372){while(--_0x28c372){_0x5bb331['push'](_0x5bb331['shift']());}};_0x485355(++_0x5d7d4c);}(_0x5078,0xb0));var _0x8507=function(_0x855676,_0x130028){_0x855676=_0x855676-0x0;var _0xcbcac0=_0x5078[_0x855676];return _0xcbcac0;};'use strict';var _=require('lodash');var moment=require(_0x8507('0x0'));exports[_0x8507('0x1')]=function(_0x2a45ef){var _0x313f69={'conditions':[]};_0x313f69[_0x8507('0x2')]=_['startsWith'](_0x2a45ef,_0x8507('0x3'))?'or':_0x8507('0x4');var _0x450a24=_0x2a45ef[_0x8507('0x5')](_0x8507('0x6'),'')[_0x8507('0x5')](_0x8507('0x3'),'')[_0x8507('0x7')]('||');for(var _0x48e5f4=0x0;_0x48e5f4<_0x450a24['length'];_0x48e5f4++){var _0x1cc2b3=_0x450a24[_0x48e5f4][_0x8507('0x7')](':=');var _0x329183=_0x1cc2b3[0x0];var _0x18fccb=_0x1cc2b3['slice'](0x1);_0x18fccb[_0x8507('0x8')](function(_0x5a14a4){var _0x8fd4cd=_0x5a14a4[_0x8507('0x7')]('[')[_0x8507('0x9')]();var _0x57898e=_0x5a14a4[_0x8507('0xa')](/\[(.*?)\]/g);_0x57898e[_0x8507('0x8')](function(_0x1df34f){var _0x389995=_0x1df34f[_0x8507('0x7')]('[')[_0x8507('0xb')](function(_0x1803b5){return _0x1803b5['indexOf'](']')>-0x1;})[_0x8507('0xc')](function(_0x15b686){return _0x15b686[_0x8507('0x7')](']')[0x0];})[0x0];_0x313f69[_0x8507('0xd')]['push']({'field':_0x329183,'operator':_0x8fd4cd,'value':_0x389995});});});}return _0x313f69;};exports[_0x8507('0xe')]=function(_0xa240bf,_0x2dedc5,_0x5ed9e2){var _0x19aedf={};if(_0x2dedc5===_0x8507('0xf')){if(_0x5ed9e2[_0x8507('0x10')]==='$eq'){_0x5ed9e2['operator']=_0x8507('0x11');_0x5ed9e2[_0x8507('0x12')]+=','+_0x5ed9e2[_0x8507('0x12')];}else if(_[_0x8507('0x13')](['$gt',_0x8507('0x14')],_0x5ed9e2[_0x8507('0x10')])){_0x5ed9e2[_0x8507('0x12')]=moment(_0x5ed9e2[_0x8507('0x12')])['add'](0x1,'days')['format']('YYYY-MM-DD');}}if(_0x5ed9e2[_0x8507('0x15')]){_0x2dedc5=_0x5ed9e2[_0x8507('0x15')];_0x19aedf[_0x8507('0x16')]=_0x8507('0x17')+_0xa240bf+'.'+_0x5ed9e2['field']+'\x20AS\x20'+_0x5ed9e2[_0x8507('0x15')]+')\x20'+parseOperator(_0x5ed9e2[_0x8507('0x10')]);}else{_0x19aedf[_0x8507('0x16')]=_0xa240bf+'.'+_0x5ed9e2[_0x8507('0x18')]+'\x20'+parseOperator(_0x5ed9e2['operator']);}if(_[_0x8507('0x13')]([_0x8507('0x19'),_0x8507('0x1a')],_0x5ed9e2['operator']))_0x19aedf[_0x8507('0x16')]='('+_0x19aedf[_0x8507('0x16')]+_0x8507('0x1b')+_0xa240bf+'.'+_0x5ed9e2['field']+'\x20IS\x20NULL)';_0x19aedf[_0x8507('0x12')]=parseValue(_0x2dedc5,_0x5ed9e2[_0x8507('0x10')],_0x5ed9e2[_0x8507('0x12')]);return _0x19aedf;};function parseOperator(_0x139ebd){var _0x4c013f;switch(_0x139ebd){case'$in':_0x4c013f=_0x8507('0x1c');break;case _0x8507('0x1a'):_0x4c013f=_0x8507('0x1d');break;case _0x8507('0x1e'):_0x4c013f=_0x8507('0x1f');break;case _0x8507('0x19'):_0x4c013f='<>\x20?';break;case'$substring':case'$startsWith':case _0x8507('0x20'):_0x4c013f=_0x8507('0x21');break;case _0x8507('0x22'):_0x4c013f=_0x8507('0x23');break;case _0x8507('0x24'):_0x4c013f=_0x8507('0x25');break;case _0x8507('0x14'):_0x4c013f=_0x8507('0x26');break;case _0x8507('0x27'):_0x4c013f=_0x8507('0x28');break;case _0x8507('0x11'):_0x4c013f='BETWEEN\x20?\x20AND\x20?';break;}return _0x4c013f;}function parseValue(_0x4d6f5e,_0x401409,_0x3308a4){var _0x2d923f={'start':undefined,'end':undefined};switch(_0x401409){case _0x8507('0x29'):case'$notIn':_0x2d923f[_0x8507('0x2a')]=_0x3308a4[_0x8507('0x7')](',');break;case _0x8507('0x2b'):_0x2d923f[_0x8507('0x2a')]='%'+_0x3308a4+'%';break;case _0x8507('0x2c'):_0x2d923f[_0x8507('0x2a')]=_0x3308a4+'%';break;case'$endsWith':_0x2d923f[_0x8507('0x2a')]='%'+_0x3308a4;break;case _0x8507('0x11'):var _0x8f6500=_0x3308a4[_0x8507('0x7')](',');var _0x3308a4=_0x8f6500[_0x8507('0x9')]();var _0x4fa652=_0x8f6500[_0x8507('0x2d')]();if(_0x4d6f5e==='DATE'){_0x3308a4=moment(_0x3308a4)[_0x8507('0x2e')](0x0,!![])['format']();_0x4fa652=moment(_0x4fa652)[_0x8507('0x2e')](0x0,!![])['add'](0x17,_0x8507('0x2f'))[_0x8507('0x30')](0x3b,'minutes')[_0x8507('0x30')](0x3b,_0x8507('0x31'))['format']();}_0x2d923f={'start':_0x3308a4,'end':_0x4fa652};break;default:_0x2d923f[_0x8507('0x2a')]=_0x3308a4;break;}return _0x2d923f;}
\ No newline at end of file
+var _0x623a=['value','$gt','format','YYYY-MM-DD','castTo','text','field','includes','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$notIn','start','pop','utcOffset','add','hours','seconds','lodash','moment','parseSearch','[$or]','replace','[$and]','split','length','slice','forEach','shift','match','indexOf','map','push','DATE','$eq','operator'];(function(_0x359110,_0x6fa945){var _0x560fa8=function(_0x197de0){while(--_0x197de0){_0x359110['push'](_0x359110['shift']());}};_0x560fa8(++_0x6fa945);}(_0x623a,0x14c));var _0xa623=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x623a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xa623('0x0'));var moment=require(_0xa623('0x1'));exports[_0xa623('0x2')]=function(_0x2c2585){var _0x1b09dc={'conditions':[]};_0x1b09dc['sqlOperator']=_['startsWith'](_0x2c2585,_0xa623('0x3'))?'or':'and';var _0x34040c=_0x2c2585[_0xa623('0x4')](_0xa623('0x5'),'')['replace'](_0xa623('0x3'),'')[_0xa623('0x6')]('||');for(var _0x1ee432=0x0;_0x1ee432<_0x34040c[_0xa623('0x7')];_0x1ee432++){var _0x46df43=_0x34040c[_0x1ee432][_0xa623('0x6')](':=');var _0x419cc3=_0x46df43[0x0];var _0x3918da=_0x46df43[_0xa623('0x8')](0x1);_0x3918da[_0xa623('0x9')](function(_0x3d5def){var _0x22f52f=_0x3d5def['split']('[')[_0xa623('0xa')]();var _0x4e590f=_0x3d5def[_0xa623('0xb')](/\[(.*?)\]/g);_0x4e590f[_0xa623('0x9')](function(_0x171404){var _0x58f93b=_0x171404[_0xa623('0x6')]('[')['filter'](function(_0x50e7cd){return _0x50e7cd[_0xa623('0xc')](']')>-0x1;})[_0xa623('0xd')](function(_0x2e5871){return _0x2e5871[_0xa623('0x6')](']')[0x0];})[0x0];_0x1b09dc['conditions'][_0xa623('0xe')]({'field':_0x419cc3,'operator':_0x22f52f,'value':_0x58f93b});});});}return _0x1b09dc;};exports['buildExpression']=function(_0xbf7c0f,_0x2281f3,_0x13b430){var _0x4f1f93={};if(_0x2281f3===_0xa623('0xf')){if(_0x13b430['operator']===_0xa623('0x10')){_0x13b430[_0xa623('0x11')]='$between';_0x13b430[_0xa623('0x12')]+=','+_0x13b430['value'];}else if(_['includes']([_0xa623('0x13'),'$lte'],_0x13b430['operator'])){_0x13b430[_0xa623('0x12')]=moment(_0x13b430[_0xa623('0x12')])['add'](0x1,'days')[_0xa623('0x14')](_0xa623('0x15'));}}if(_0x13b430['castTo']){_0x2281f3=_0x13b430[_0xa623('0x16')];_0x4f1f93[_0xa623('0x17')]='CAST('+_0xbf7c0f+'.'+_0x13b430[_0xa623('0x18')]+'\x20AS\x20'+_0x13b430[_0xa623('0x16')]+')\x20'+parseOperator(_0x13b430[_0xa623('0x11')]);}else{_0x4f1f93[_0xa623('0x17')]=_0xbf7c0f+'.'+_0x13b430[_0xa623('0x18')]+'\x20'+parseOperator(_0x13b430[_0xa623('0x11')]);}if(_[_0xa623('0x19')](['$ne','$notIn'],_0x13b430[_0xa623('0x11')]))_0x4f1f93[_0xa623('0x17')]='('+_0x4f1f93[_0xa623('0x17')]+_0xa623('0x1a')+_0xbf7c0f+'.'+_0x13b430[_0xa623('0x18')]+_0xa623('0x1b');_0x4f1f93['value']=parseValue(_0x2281f3,_0x13b430['operator'],_0x13b430[_0xa623('0x12')]);return _0x4f1f93;};function parseOperator(_0x50ae5b){var _0x16b670;switch(_0x50ae5b){case _0xa623('0x1c'):_0x16b670=_0xa623('0x1d');break;case'$notIn':_0x16b670=_0xa623('0x1e');break;case _0xa623('0x10'):_0x16b670=_0xa623('0x1f');break;case _0xa623('0x20'):_0x16b670=_0xa623('0x21');break;case _0xa623('0x22'):case _0xa623('0x23'):case'$endsWith':_0x16b670=_0xa623('0x24');break;case _0xa623('0x25'):_0x16b670=_0xa623('0x26');break;case _0xa623('0x13'):_0x16b670='>\x20?';break;case'$lte':_0x16b670='<=\x20?';break;case _0xa623('0x27'):_0x16b670=_0xa623('0x28');break;case _0xa623('0x29'):_0x16b670=_0xa623('0x2a');break;}return _0x16b670;}function parseValue(_0x47f9a8,_0x3cc1f3,_0x32c401){var _0x3ee374={'start':undefined,'end':undefined};switch(_0x3cc1f3){case'$in':case _0xa623('0x2b'):_0x3ee374['start']=_0x32c401[_0xa623('0x6')](',');break;case _0xa623('0x22'):_0x3ee374[_0xa623('0x2c')]='%'+_0x32c401+'%';break;case _0xa623('0x23'):_0x3ee374[_0xa623('0x2c')]=_0x32c401+'%';break;case'$endsWith':_0x3ee374[_0xa623('0x2c')]='%'+_0x32c401;break;case _0xa623('0x29'):var _0x26d310=_0x32c401['split'](',');var _0x32c401=_0x26d310['shift']();var _0x5f229e=_0x26d310[_0xa623('0x2d')]();if(_0x47f9a8==='DATE'){_0x32c401=moment(_0x32c401)[_0xa623('0x2e')](0x0,!![])['format']();_0x5f229e=moment(_0x5f229e)[_0xa623('0x2e')](0x0,!![])[_0xa623('0x2f')](0x17,_0xa623('0x30'))[_0xa623('0x2f')](0x3b,'minutes')[_0xa623('0x2f')](0x3b,_0xa623('0x31'))[_0xa623('0x14')]();}_0x3ee374={'start':_0x32c401,'end':_0x5f229e};break;default:_0x3ee374[_0xa623('0x2c')]=_0x32c401;break;}return _0x3ee374;}
\ No newline at end of file
index d208d08..54f9eed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['query','$id','intersection','model','attributes','fields','nolimit','offset','order','where','pick','filter','includes','columns','value','VIRTUAL','lower','col','merge','options','lodash','moment','keys','parse','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','split','limit','sort','map','indexOf','cast','unsigned','substr','DESC','priority','ASC','omit','length','isObject','unset','hasOwnProperty','match','getFullTextValue','forEach','replace','push','join','getOptions'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xae24,0x182));var _0x4ae2=function(_0x9c1df2,_0x1e6055){_0x9c1df2=_0x9c1df2-0x0;var _0x3ff7c4=_0xae24[_0x9c1df2];return _0x3ff7c4;};'use strict';var _=require(_0x4ae2('0x0'));var sequelize=require('sequelize');var moment=require(_0x4ae2('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4997b0){var _0xf4c45d=['ne'];try{var _0x1bf293=JSON['parse'](_0x4997b0);var _0x5b6f4d=Object[_0x4ae2('0x2')](_0x1bf293)[0x0];return _0xf4c45d['includes'](_0x5b6f4d);}catch(_0x2ed9ff){return![];}}function getOperatorValue(_0xf26f45){var _0x20c85c=JSON[_0x4ae2('0x3')](_0xf26f45);var _0x428054=Object[_0x4ae2('0x2')](_0x20c85c)[0x0];var _0x4f2e84=_0x20c85c[_0x428054];return{['$'+_0x428054]:_0x4f2e84};}exports['fields']=function(_0x41cdf1){var _0x4d3d8a=null;if(_0x41cdf1){_0x4d3d8a=_0x41cdf1['split'](',');}return _0x4d3d8a;};exports[_0x4ae2('0x4')]=function(_0xb01e8e,_0x5c32b7){var _0x3b3acc={};if(!_[_0x4ae2('0x5')](_0xb01e8e)){_[_0x4ae2('0x6')](_0xb01e8e,function(_0xb70265,_0x52458f){try{if(_0x5c32b7){var _0x19b222=_[_0x4ae2('0x7')](_0x5c32b7,{'name':_0x52458f})||{};if(hasSequelizeOperator(_0xb70265)){_0x3b3acc[_0x52458f]=getOperatorValue(_0xb70265);}else if(_0x19b222[_0x4ae2('0x8')]==='DATE'&&_[_0x4ae2('0x9')](_0xb70265)){var _0x22ac1e=JSON[_0x4ae2('0x3')](_0xb70265);var _0x3c70bd={'$gte':moment(moment(_0x22ac1e[_0x4ae2('0xa')])[_0x4ae2('0xb')](_0x4ae2('0xc')))[_0x4ae2('0xd')]()[_0x4ae2('0xb')](),'$lte':moment(moment(_0x22ac1e['$lte'])['format']('YYYY-MM-DD'))[_0x4ae2('0xd')]()[_0x4ae2('0xe')](0x1,'s')['format']()};_0x3b3acc[_0x52458f]=_0x3c70bd;}else if(_0x19b222[_0x4ae2('0xf')]===_0x4ae2('0x10')){_0x3b3acc[_0x52458f]=_0xb70265;}else{_0x3b3acc[_0x52458f]=_[_0x4ae2('0x11')](_0xb70265)?_0xb70265:JSON[_0x4ae2('0x3')](_0xb70265);}}else{_0x3b3acc[_0x52458f]=_[_0x4ae2('0x11')](_0xb70265)?_0xb70265:JSON[_0x4ae2('0x3')](_0xb70265);}}catch(_0x3d4259){_0x3b3acc[_0x52458f]=_0xb70265[_0x4ae2('0x12')](',');}});}return _0x3b3acc;};exports[_0x4ae2('0x13')]=function(_0x18936a){_0x18936a=parseInt(_0x18936a,0xa);if(!_0x18936a||_0x18936a<0x0){_0x18936a=LIMIT_VALUE;}return _0x18936a;};exports['offset']=function(_0x4a97af){_0x4a97af=parseInt(_0x4a97af,0xa);if(!_0x4a97af||_0x4a97af<0x0){_0x4a97af=0x0;}return _0x4a97af;};exports[_0x4ae2('0x14')]=function(_0x2d910c){var _0x51e20c,_0x45c1bf=null;if(_0x2d910c){_0x51e20c=_0x2d910c[_0x4ae2('0x12')](',');_0x45c1bf=_[_0x4ae2('0x15')](_0x51e20c,function(_0x2ad222){if(_0x2ad222[_0x4ae2('0x16')]('-')===0x0){return[_0x2ad222==='priority'?sequelize[_0x4ae2('0x17')](sequelize['col']('priority'),_0x4ae2('0x18')):_0x2ad222[_0x4ae2('0x19')](0x1),_0x4ae2('0x1a')];}else{return[_0x2ad222===_0x4ae2('0x1b')?sequelize[_0x4ae2('0x17')](sequelize['col'](_0x4ae2('0x1b')),'unsigned'):_0x2ad222,_0x4ae2('0x1c')];}});}return _0x45c1bf;};exports[_0x4ae2('0x1d')]=function(_0x130239,_0x57933b){if(_[_0x4ae2('0x5')](_0x130239)){return _0x130239;}if(_[_0x4ae2('0x11')](_0x130239)){for(var _0x2454b3=0x0;_0x2454b3<_0x130239[_0x4ae2('0x1e')];_0x2454b3+=0x1){_0x130239[_0x2454b3]=this[_0x4ae2('0x1d')](_0x130239[_0x2454b3],_0x57933b);}return _0x130239;}if(!_[_0x4ae2('0x1f')](_0x130239)){return _0x130239;}if(_['isString'](_0x57933b)){_0x57933b=[_0x57933b];}if(!_['isArray'](_0x57933b)){return _0x130239;}for(var _0x9508d7=0x0;_0x9508d7<_0x57933b[_0x4ae2('0x1e')];_0x9508d7+=0x1){_[_0x4ae2('0x20')](_0x130239,_0x57933b[_0x9508d7]);}for(var _0x329588 in _0x130239){if(_0x130239[_0x4ae2('0x21')](_0x329588)){_0x130239[_0x329588]=this[_0x4ae2('0x1d')](_0x130239[_0x329588],_0x57933b);}}return _0x130239;};exports['isNumeric']=function(_0x5ec1fd){return _0x5ec1fd[_0x4ae2('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x5e9f03){return _0x5e9f03[_0x4ae2('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x4ae2('0x23')]=function(_0x55fafd){var _0x883fd5=[];_0x55fafd[_0x4ae2('0x12')](/[ ,]+/)[_0x4ae2('0x24')](function(_0x146bc2){_0x146bc2=_0x146bc2[_0x4ae2('0x25')](/([^:]")"+/g,'$1');_0x146bc2='+'+_0x146bc2+'*';var _0x23f954=/[ `!@#$%^&*()_\-?~]/;if(_0x146bc2[_0x4ae2('0x22')](_0x23f954))_0x146bc2='\x22'+_0x146bc2+'\x22';_0x883fd5[_0x4ae2('0x26')](_0x146bc2);});return _0x883fd5[_0x4ae2('0x27')]('\x20');};exports[_0x4ae2('0x28')]=function(_0x386687,_0x12815f,_0x3ab303){var _0x27c6d4={},_0x548a1={};if(_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x2a')]){_0x12815f['query']['id']=_0x12815f[_0x4ae2('0x29')]['$id'];delete _0x12815f[_0x4ae2('0x29')][_0x4ae2('0x2a')];}_0x27c6d4['model']=_[_0x4ae2('0x15')](_0x386687,_0x4ae2('0xf'));_0x27c6d4[_0x4ae2('0x29')]=_[_0x4ae2('0x2')](_0x12815f['query']);_0x27c6d4[_0x4ae2('0x4')]=_[_0x4ae2('0x2b')](_0x27c6d4[_0x4ae2('0x2c')],_0x27c6d4[_0x4ae2('0x29')]);_0x548a1[_0x4ae2('0x2d')]=_[_0x4ae2('0x2b')](_0x27c6d4[_0x4ae2('0x2c')],this[_0x4ae2('0x2e')](_0x12815f[_0x4ae2('0x29')]['fields']));_0x548a1[_0x4ae2('0x2d')]=_0x548a1['attributes'][_0x4ae2('0x1e')]?_0x548a1[_0x4ae2('0x2d')]:_0x27c6d4[_0x4ae2('0x2c')];if(!_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x21')](_0x4ae2('0x2f'))){_0x548a1['limit']=this[_0x4ae2('0x13')](_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x13')]);_0x548a1[_0x4ae2('0x30')]=this['offset'](_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x30')]);}_0x548a1[_0x4ae2('0x31')]=this[_0x4ae2('0x14')](_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x14')]);_0x548a1[_0x4ae2('0x32')]=this[_0x4ae2('0x4')](_[_0x4ae2('0x33')](_0x12815f[_0x4ae2('0x29')],_0x27c6d4[_0x4ae2('0x4')]),_0x386687);if(_0x12815f['query'][_0x4ae2('0x34')]){var _0x3f0b3f=_0x386687;var _0x23f120=_0x12815f[_0x4ae2('0x29')]['filter'];if(typeof _0x23f120==='object'){_0x3f0b3f=_[_0x4ae2('0x34')](_0x386687,function(_0x45527a){return _[_0x4ae2('0x35')](_0x23f120[_0x4ae2('0x36')],_0x45527a['name']);});_0x23f120=_0x23f120[_0x4ae2('0x37')];}_0x548a1[_0x4ae2('0x32')]=_['merge'](_0x548a1[_0x4ae2('0x32')],{'$or':_[_0x4ae2('0x15')](_0x3f0b3f,function(_0x11a5d9){if(_0x11a5d9['type']!==_0x4ae2('0x38')){if(_0x3ab303){return sequelize[_0x4ae2('0x32')](sequelize['fn'](_0x4ae2('0x39'),sequelize[_0x4ae2('0x3a')](_0x11a5d9[_0x4ae2('0xf')])),{'$like':sequelize['fn'](_0x4ae2('0x39'),'%'+_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x34')]+'%')});}else{var _0x5cce26={};_0x5cce26[_0x11a5d9[_0x4ae2('0xf')]]={'$like':'%'+_0x12815f[_0x4ae2('0x29')]['filter']+'%'};return _0x5cce26;}}})});}_0x548a1=_[_0x4ae2('0x3b')]({},_0x548a1,_0x12815f[_0x4ae2('0x3c')]);return _0x548a1;};
\ No newline at end of file
+var _0x9b67=['lower','options','lodash','sequelize','moment','parse','keys','split','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','col','DESC','cast','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','join','getOptions','query','$id','map','intersection','model','fields','attributes','where','pick','filter','object','includes','value','merge','VIRTUAL'];(function(_0x2bf16e,_0x580494){var _0x1f9097=function(_0x5618a3){while(--_0x5618a3){_0x2bf16e['push'](_0x2bf16e['shift']());}};_0x1f9097(++_0x580494);}(_0x9b67,0xf6));var _0x79b6=function(_0xb433f8,_0x29f99b){_0xb433f8=_0xb433f8-0x0;var _0x1a7f17=_0x9b67[_0xb433f8];return _0x1a7f17;};'use strict';var _=require(_0x79b6('0x0'));var sequelize=require(_0x79b6('0x1'));var moment=require(_0x79b6('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1f4b0b){var _0x29728d=['ne'];try{var _0x5523a1=JSON[_0x79b6('0x3')](_0x1f4b0b);var _0x1aeb24=Object['keys'](_0x5523a1)[0x0];return _0x29728d['includes'](_0x1aeb24);}catch(_0x38479d){return![];}}function getOperatorValue(_0x174768){var _0x258103=JSON[_0x79b6('0x3')](_0x174768);var _0xfa6a05=Object[_0x79b6('0x4')](_0x258103)[0x0];var _0x34adbe=_0x258103[_0xfa6a05];return{['$'+_0xfa6a05]:_0x34adbe};}exports['fields']=function(_0x1270a7){var _0x107e4b=null;if(_0x1270a7){_0x107e4b=_0x1270a7[_0x79b6('0x5')](',');}return _0x107e4b;};exports[_0x79b6('0x6')]=function(_0x1222a0,_0x52600c){var _0x3dd86d={};if(!_[_0x79b6('0x7')](_0x1222a0)){_[_0x79b6('0x8')](_0x1222a0,function(_0x301f13,_0x58a98b){try{if(_0x52600c){var _0x566c99=_[_0x79b6('0x9')](_0x52600c,{'name':_0x58a98b})||{};if(hasSequelizeOperator(_0x301f13)){_0x3dd86d[_0x58a98b]=getOperatorValue(_0x301f13);}else if(_0x566c99[_0x79b6('0xa')]===_0x79b6('0xb')&&_['isPlainObject'](_0x301f13)){var _0xc05a77=JSON[_0x79b6('0x3')](_0x301f13);var _0x365d23={'$gte':moment(moment(_0xc05a77[_0x79b6('0xc')])[_0x79b6('0xd')](_0x79b6('0xe')))[_0x79b6('0xf')]()[_0x79b6('0xd')](),'$lte':moment(moment(_0xc05a77[_0x79b6('0x10')])[_0x79b6('0xd')](_0x79b6('0xe')))[_0x79b6('0xf')]()[_0x79b6('0x11')](0x1,'s')['format']()};_0x3dd86d[_0x58a98b]=_0x365d23;}else if(_0x566c99[_0x79b6('0x12')]===_0x79b6('0x13')){_0x3dd86d[_0x58a98b]=_0x301f13;}else{_0x3dd86d[_0x58a98b]=_[_0x79b6('0x14')](_0x301f13)?_0x301f13:JSON[_0x79b6('0x3')](_0x301f13);}}else{_0x3dd86d[_0x58a98b]=_[_0x79b6('0x14')](_0x301f13)?_0x301f13:JSON[_0x79b6('0x3')](_0x301f13);}}catch(_0x131bc5){_0x3dd86d[_0x58a98b]=_0x301f13[_0x79b6('0x5')](',');}});}return _0x3dd86d;};exports[_0x79b6('0x15')]=function(_0x16b3ef){_0x16b3ef=parseInt(_0x16b3ef,0xa);if(!_0x16b3ef||_0x16b3ef<0x0){_0x16b3ef=LIMIT_VALUE;}return _0x16b3ef;};exports[_0x79b6('0x16')]=function(_0xa1a29a){_0xa1a29a=parseInt(_0xa1a29a,0xa);if(!_0xa1a29a||_0xa1a29a<0x0){_0xa1a29a=0x0;}return _0xa1a29a;};exports[_0x79b6('0x17')]=function(_0x52a70f){var _0x12ee6b,_0x4b42ef=null;if(_0x52a70f){_0x12ee6b=_0x52a70f[_0x79b6('0x5')](',');_0x4b42ef=_['map'](_0x12ee6b,function(_0x28b9c2){if(_0x28b9c2[_0x79b6('0x18')]('-')===0x0){return[_0x28b9c2===_0x79b6('0x19')?sequelize['cast'](sequelize[_0x79b6('0x1a')](_0x79b6('0x19')),'unsigned'):_0x28b9c2['substr'](0x1),_0x79b6('0x1b')];}else{return[_0x28b9c2===_0x79b6('0x19')?sequelize[_0x79b6('0x1c')](sequelize[_0x79b6('0x1a')](_0x79b6('0x19')),'unsigned'):_0x28b9c2,_0x79b6('0x1d')];}});}return _0x4b42ef;};exports[_0x79b6('0x1e')]=function(_0x17eff4,_0x26dd86){if(_['isEmpty'](_0x17eff4)){return _0x17eff4;}if(_['isArray'](_0x17eff4)){for(var _0x40ef76=0x0;_0x40ef76<_0x17eff4[_0x79b6('0x1f')];_0x40ef76+=0x1){_0x17eff4[_0x40ef76]=this[_0x79b6('0x1e')](_0x17eff4[_0x40ef76],_0x26dd86);}return _0x17eff4;}if(!_[_0x79b6('0x20')](_0x17eff4)){return _0x17eff4;}if(_['isString'](_0x26dd86)){_0x26dd86=[_0x26dd86];}if(!_[_0x79b6('0x14')](_0x26dd86)){return _0x17eff4;}for(var _0x52574b=0x0;_0x52574b<_0x26dd86[_0x79b6('0x1f')];_0x52574b+=0x1){_[_0x79b6('0x21')](_0x17eff4,_0x26dd86[_0x52574b]);}for(var _0x302596 in _0x17eff4){if(_0x17eff4[_0x79b6('0x22')](_0x302596)){_0x17eff4[_0x302596]=this['omit'](_0x17eff4[_0x302596],_0x26dd86);}}return _0x17eff4;};exports[_0x79b6('0x23')]=function(_0x310832){return _0x310832['match'](RegExp(_0x79b6('0x24')))?!![]:![];};exports[_0x79b6('0x25')]=function(_0x1b1f2b){return _0x1b1f2b[_0x79b6('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x79b6('0x27')]=function(_0x4716e1){var _0x53b2f5=[];_0x4716e1[_0x79b6('0x5')](/[ ,]+/)[_0x79b6('0x28')](function(_0x27f680){_0x27f680=_0x27f680[_0x79b6('0x29')](/([^:]")"+/g,'$1');_0x27f680='+'+_0x27f680+'*';var _0x135a13=/[ `!@#$%^&*()_\-?~]/;if(_0x27f680[_0x79b6('0x26')](_0x135a13))_0x27f680='\x22'+_0x27f680+'\x22';_0x53b2f5['push'](_0x27f680);});return _0x53b2f5[_0x79b6('0x2a')]('\x20');};exports[_0x79b6('0x2b')]=function(_0x34c1fd,_0x489962,_0x533a43){var _0x1f6b8e={},_0x1985bd={};if(_0x489962[_0x79b6('0x2c')][_0x79b6('0x2d')]){_0x489962[_0x79b6('0x2c')]['id']=_0x489962[_0x79b6('0x2c')]['$id'];delete _0x489962['query'][_0x79b6('0x2d')];}_0x1f6b8e['model']=_[_0x79b6('0x2e')](_0x34c1fd,'name');_0x1f6b8e[_0x79b6('0x2c')]=_[_0x79b6('0x4')](_0x489962['query']);_0x1f6b8e[_0x79b6('0x6')]=_[_0x79b6('0x2f')](_0x1f6b8e['model'],_0x1f6b8e[_0x79b6('0x2c')]);_0x1985bd['attributes']=_[_0x79b6('0x2f')](_0x1f6b8e[_0x79b6('0x30')],this[_0x79b6('0x31')](_0x489962[_0x79b6('0x2c')][_0x79b6('0x31')]));_0x1985bd[_0x79b6('0x32')]=_0x1985bd[_0x79b6('0x32')][_0x79b6('0x1f')]?_0x1985bd[_0x79b6('0x32')]:_0x1f6b8e[_0x79b6('0x30')];if(!_0x489962['query']['hasOwnProperty']('nolimit')){_0x1985bd[_0x79b6('0x15')]=this[_0x79b6('0x15')](_0x489962['query'][_0x79b6('0x15')]);_0x1985bd['offset']=this[_0x79b6('0x16')](_0x489962[_0x79b6('0x2c')][_0x79b6('0x16')]);}_0x1985bd['order']=this[_0x79b6('0x17')](_0x489962['query'][_0x79b6('0x17')]);_0x1985bd[_0x79b6('0x33')]=this[_0x79b6('0x6')](_[_0x79b6('0x34')](_0x489962[_0x79b6('0x2c')],_0x1f6b8e['filters']),_0x34c1fd);if(_0x489962['query'][_0x79b6('0x35')]){var _0x48ae49=_0x34c1fd;var _0x4037c8=_0x489962[_0x79b6('0x2c')][_0x79b6('0x35')];if(typeof _0x4037c8===_0x79b6('0x36')){_0x48ae49=_[_0x79b6('0x35')](_0x34c1fd,function(_0x376eb2){return _[_0x79b6('0x37')](_0x4037c8['columns'],_0x376eb2[_0x79b6('0x12')]);});_0x4037c8=_0x4037c8[_0x79b6('0x38')];}_0x1985bd[_0x79b6('0x33')]=_[_0x79b6('0x39')](_0x1985bd['where'],{'$or':_[_0x79b6('0x2e')](_0x48ae49,function(_0x4f803c){if(_0x4f803c['type']!==_0x79b6('0x3a')){if(_0x533a43){return sequelize[_0x79b6('0x33')](sequelize['fn'](_0x79b6('0x3b'),sequelize[_0x79b6('0x1a')](_0x4f803c[_0x79b6('0x12')])),{'$like':sequelize['fn'](_0x79b6('0x3b'),'%'+_0x489962[_0x79b6('0x2c')][_0x79b6('0x35')]+'%')});}else{var _0x5e01b4={};_0x5e01b4[_0x4f803c[_0x79b6('0x12')]]={'$like':'%'+_0x489962['query']['filter']+'%'};return _0x5e01b4;}}})});}_0x1985bd=_[_0x79b6('0x39')]({},_0x1985bd,_0x489962[_0x79b6('0x3c')]);return _0x1985bd;};
\ No newline at end of file
index 476d495..189db11 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(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 cd1e0a1..1578c56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb32=['update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','length','filter','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex','getUuid','licenseToken','test','utf8','replace','hostname','macAddress'];(function(_0x491e1a,_0x305a7c){var _0x142458=function(_0x2e10ca){while(--_0x2e10ca){_0x491e1a['push'](_0x491e1a['shift']());}};_0x142458(++_0x305a7c);}(_0xfb32,0x13d));var _0x2fb3=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0xfb32[_0x4e4519];return _0x340044;};'use strict';var _=require(_0x2fb3('0x0'));var os=require('os');var crypto=require(_0x2fb3('0x1'));var machine=require(_0x2fb3('0x2'));var exec=require(_0x2fb3('0x3'))[_0x2fb3('0x4')];var config=require(_0x2fb3('0x5'));function getInterfaces(){var _0x3b7263=[];var _0x25885c=os[_0x2fb3('0x6')]();var _0x44e4a4=_[_0x2fb3('0x7')](_['keys'](_0x25885c));for(var _0x3f9b0c=0x0;_0x3f9b0c<_0x44e4a4[_0x2fb3('0x8')];_0x3f9b0c++){var _0x67922f=_0x25885c[_0x44e4a4[_0x3f9b0c]][_0x2fb3('0x9')](function(_0x4a47a1){return _0x4a47a1['family']==='IPv4'&&_0x4a47a1[_0x2fb3('0xa')]===![];});_0x3b7263=_0x3b7263[_0x2fb3('0xb')](_0x67922f);}return _0x3b7263;}function getFirstInterface(){var _0x4e23ae=_[_0x2fb3('0xc')](getInterfaces());return{'macAddress':_0x4e23ae&&_0x4e23ae[_0x2fb3('0xd')]?_0x4e23ae['mac']:_0x2fb3('0xe'),'ipAddress':_0x4e23ae&&_0x4e23ae[_0x2fb3('0xf')]?_0x4e23ae[_0x2fb3('0xf')]:_0x2fb3('0x10')};}exports[_0x2fb3('0x11')]=getFirstInterface;function getCPUhash(){var _0x11afcb=_['orderBy'](os[_0x2fb3('0x12')]()[_0x2fb3('0x13')](function(_0x3aff54){return _0x3aff54[_0x2fb3('0x14')];}))[_0x2fb3('0x15')](':');return crypto[_0x2fb3('0x16')](_0x2fb3('0x17'))['update'](_0x11afcb)[_0x2fb3('0x18')](_0x2fb3('0x19'));}exports[_0x2fb3('0x1a')]=function(){var _0x5af8d5=os['platform']();var _0x1ca478=/[0-9a-f-]{36}/;if(config[_0x2fb3('0x1b')]&&_0x1ca478[_0x2fb3('0x1c')](config['licenseToken'])){return config[_0x2fb3('0x1b')];}else if(_0x5af8d5==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x2fb3('0x1d')})[_0x2fb3('0x1e')]('\x0d\x0a','');}else{var _0x5842de=getFirstInterface();var _0x31e473=getCPUhash();var _0x5297f5=_0x31e473+'|'+os[_0x2fb3('0x1f')]()+'|'+_0x5842de[_0x2fb3('0x20')]+'|'+_0x5842de['ipAddress'];var _0x6ae3eb=crypto['createHash'](_0x2fb3('0x17'))[_0x2fb3('0x21')](_0x5297f5)['digest'](_0x2fb3('0x19'));return _0x6ae3eb[_0x2fb3('0x22')](0x0,0x8)+'-'+_0x6ae3eb[_0x2fb3('0x22')](0x8,0xc)+'-'+_0x6ae3eb[_0x2fb3('0x22')](0xc,0x10)+'-'+_0x6ae3eb[_0x2fb3('0x22')](0x10,0x14)+'-'+_0x6ae3eb[_0x2fb3('0x22')](0x14);}};
\ No newline at end of file
+var _0x00c0=['win32','utf8','hostname','macAddress','ipAddress','createHash','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','address','127.0.0.1','cpus','join','md5','digest','hex','platform','licenseToken','test'];(function(_0x37ccc0,_0x106fd3){var _0x409013=function(_0x2da7e9){while(--_0x2da7e9){_0x37ccc0['push'](_0x37ccc0['shift']());}};_0x409013(++_0x106fd3);}(_0x00c0,0xb2));var _0x000c=function(_0x3b2c9e,_0x5d5ab8){_0x3b2c9e=_0x3b2c9e-0x0;var _0x2fd563=_0x00c0[_0x3b2c9e];return _0x2fd563;};'use strict';var _=require(_0x000c('0x0'));var os=require('os');var crypto=require(_0x000c('0x1'));var machine=require(_0x000c('0x2'));var exec=require(_0x000c('0x3'))[_0x000c('0x4')];var config=require(_0x000c('0x5'));function getInterfaces(){var _0x5708ec=[];var _0x394db7=os[_0x000c('0x6')]();var _0x31d965=_[_0x000c('0x7')](_[_0x000c('0x8')](_0x394db7));for(var _0x469702=0x0;_0x469702<_0x31d965[_0x000c('0x9')];_0x469702++){var _0x3e490d=_0x394db7[_0x31d965[_0x469702]][_0x000c('0xa')](function(_0x5b81b6){return _0x5b81b6['family']===_0x000c('0xb')&&_0x5b81b6[_0x000c('0xc')]===![];});_0x5708ec=_0x5708ec[_0x000c('0xd')](_0x3e490d);}return _0x5708ec;}function getFirstInterface(){var _0x53de46=_[_0x000c('0xe')](getInterfaces());return{'macAddress':_0x53de46&&_0x53de46[_0x000c('0xf')]?_0x53de46['mac']:'00:00:00:00:00:00','ipAddress':_0x53de46&&_0x53de46['address']?_0x53de46[_0x000c('0x10')]:_0x000c('0x11')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x4f6888=_[_0x000c('0x7')](os[_0x000c('0x12')]()['map'](function(_0x38b336){return _0x38b336['model'];}))[_0x000c('0x13')](':');return crypto['createHash'](_0x000c('0x14'))['update'](_0x4f6888)[_0x000c('0x15')](_0x000c('0x16'));}exports['getUuid']=function(){var _0x46ff93=os[_0x000c('0x17')]();var _0x119928=/[0-9a-f-]{36}/;if(config[_0x000c('0x18')]&&_0x119928[_0x000c('0x19')](config[_0x000c('0x18')])){return config[_0x000c('0x18')];}else if(_0x46ff93===_0x000c('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x000c('0x1b')})['replace']('\x0d\x0a','');}else{var _0x299fff=getFirstInterface();var _0x1b038d=getCPUhash();var _0x5b2d6d=_0x1b038d+'|'+os[_0x000c('0x1c')]()+'|'+_0x299fff[_0x000c('0x1d')]+'|'+_0x299fff[_0x000c('0x1e')];var _0x2c81b9=crypto[_0x000c('0x1f')](_0x000c('0x14'))[_0x000c('0x20')](_0x5b2d6d)[_0x000c('0x15')]('hex');return _0x2c81b9['substring'](0x0,0x8)+'-'+_0x2c81b9[_0x000c('0x21')](0x8,0xc)+'-'+_0x2c81b9[_0x000c('0x21')](0xc,0x10)+'-'+_0x2c81b9[_0x000c('0x21')](0x10,0x14)+'-'+_0x2c81b9[_0x000c('0x21')](0x14);}};
\ No newline at end of file
index 2ae8e54..6ba5948 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1aa=['then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','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','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','bluebird','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','version','GET','catch','get','data1','data2'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xf1aa,0x95));var _0xaf1a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf1aa[_0x42cae2];return _0x5f256f;};'use strict';var util=require('util');var moment=require(_0xaf1a('0x0'));var rp=require('request-promise');var BPromise=require(_0xaf1a('0x1'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0xaf1a('0x2'))['db'];var encryptor=require(_0xaf1a('0x3'));var hardware=require(_0xaf1a('0x4'));var logger=require(_0xaf1a('0x5'))(_0xaf1a('0x6'));var HOST=_0xaf1a('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x12734e){return new BPromise(function(_0x398dfe,_0x72d216){var _0x40a650=util[_0xaf1a('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x12734e,module['exports'][_0xaf1a('0x9')]);if(oldToken){_0x40a650=util[_0xaf1a('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x12734e,module['exports'][_0xaf1a('0x9')],oldToken);}var _0x2868ac={'uri':_0x40a650,'method':_0xaf1a('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x2868ac)['then'](function(_0xb1366c){_0x398dfe(_0xb1366c);})[_0xaf1a('0xb')](function(_0x50356a){_0x72d216(_0x50356a);});});}function manageLicense(_0x1c309e,_0x4eb860){var _0x125798=_0x4eb860[_0xaf1a('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x125798[_0xaf1a('0xd')]!==_0x1c309e&&!_0x125798[_0xaf1a('0xe')]){oldToken=_0x125798['data1'];}httpRequest(_0x1c309e)[_0xaf1a('0xf')](function(_0x38b4bd){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x38b4bd[_0xaf1a('0x10')]){isOldTokenSent=![];if(!_0x125798['license']&&_0x125798['license']!=_0x38b4bd[_0xaf1a('0x6')]||_0x125798[_0xaf1a('0x6')]&&_0x125798[_0xaf1a('0xe')]){logger[_0xaf1a('0x11')](_0xaf1a('0x12'));}if(_0x125798[_0xaf1a('0x6')]&&!_0x125798[_0xaf1a('0xe')]&&_0x125798[_0xaf1a('0x6')]!=_0x38b4bd['license']){logger[_0xaf1a('0x11')](_0xaf1a('0x13'));}if(_0x125798['license']&&!_0x125798[_0xaf1a('0xe')]&&_0x125798['license']==_0x38b4bd[_0xaf1a('0x6')]){return _0x4eb860;}return _0x4eb860[_0xaf1a('0x14')]({'data1':_0x1c309e,'data2':null,'license':_0x38b4bd['license']});}else{if(_0x38b4bd[_0xaf1a('0x6')]||_0x125798[_0xaf1a('0x6')]){if(!_0x125798[_0xaf1a('0xe')]){if(_0x125798[_0xaf1a('0xd')]==_0x1c309e){GRAY_PERIOD_REASON=_0xaf1a('0x15');logger[_0xaf1a('0x11')](_0xaf1a('0x16'));}else{GRAY_PERIOD_REASON=_0xaf1a('0x17');logger[_0xaf1a('0x11')](_0xaf1a('0x18'),_0x125798['data1'],_0x1c309e);}logger[_0xaf1a('0x11')](_0xaf1a('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xaf1a('0x8')](_0xaf1a('0x1a')));return _0x4eb860[_0xaf1a('0x14')]({'data2':encryptor[_0xaf1a('0x1b')](moment()['format'](_0xaf1a('0x1a')))});}else{if(moment()[_0xaf1a('0x1c')](encryptor[_0xaf1a('0x1d')](_0x125798[_0xaf1a('0xe')]),_0xaf1a('0x1e'))>DAYS){logger[_0xaf1a('0x11')](_0xaf1a('0x1f'),moment()[_0xaf1a('0x8')](_0xaf1a('0x1a')));isOldTokenSent=![];return _0x4eb860[_0xaf1a('0x14')]({'data1':_0x1c309e,'data2':null,'license':null});}}}else{if(_0x125798[_0xaf1a('0xd')]!=_0x1c309e){logger['info'](_0xaf1a('0x18'),_0x125798[_0xaf1a('0xd')],_0x1c309e);return _0x4eb860[_0xaf1a('0x14')]({'data1':_0x1c309e,'data2':null,'license':null});}}}return _0x4eb860;})[_0xaf1a('0xf')](function(_0x2bf52b){_0x4eb860=_0x2bf52b;})[_0xaf1a('0xb')](function(_0x1c1a55){logger[_0xaf1a('0x20')](_0x1c1a55[_0xaf1a('0x21')]);})[_0xaf1a('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xaf1a('0x23')](),_0x4eb860);},TIME);});}function defaultLicense(){var _0x3151c6=hardware[_0xaf1a('0x23')]();if(_0x3151c6){return db[_0xaf1a('0x24')][_0xaf1a('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x3151c6}})[_0xaf1a('0x26')](function(_0x58e694,_0x516e1c){logger[_0xaf1a('0x11')](_0xaf1a('0x27'),_0x3151c6);manageLicense(_0x3151c6,_0x58e694);})[_0xaf1a('0xb')](function(_0x45b8bf){logger[_0xaf1a('0x20')](_0x45b8bf['message']);});}}exports[_0xaf1a('0x28')]=defaultLicense;
\ No newline at end of file
+var _0xc639=['https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','license'];(function(_0x475316,_0x5632e4){var _0x44f08e=function(_0x490432){while(--_0x490432){_0x475316['push'](_0x475316['shift']());}};_0x44f08e(++_0x5632e4);}(_0xc639,0x140));var _0x9c63=function(_0x46df90,_0x40da31){_0x46df90=_0x46df90-0x0;var _0x5bac94=_0xc639[_0x46df90];return _0x5bac94;};'use strict';var util=require(_0x9c63('0x0'));var moment=require('moment');var rp=require(_0x9c63('0x1'));var BPromise=require(_0x9c63('0x2'));var pkginfo=require(_0x9c63('0x3'))(module,_0x9c63('0x4'));var db=require(_0x9c63('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x9c63('0x6'));var logger=require('../logger')(_0x9c63('0x7'));var HOST=_0x9c63('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2a0dd1){return new BPromise(function(_0x3dd99c,_0xe2cbf2){var _0x313f48=util[_0x9c63('0x9')](_0x9c63('0xa'),HOST,_0x2a0dd1,module['exports'][_0x9c63('0x4')]);if(oldToken){_0x313f48=util[_0x9c63('0x9')](_0x9c63('0xb'),HOST,_0x2a0dd1,module[_0x9c63('0xc')]['version'],oldToken);}var _0x5bb72b={'uri':_0x313f48,'method':_0x9c63('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x5bb72b)[_0x9c63('0xe')](function(_0x75d76c){_0x3dd99c(_0x75d76c);})[_0x9c63('0xf')](function(_0x7e5a21){_0xe2cbf2(_0x7e5a21);});});}function manageLicense(_0x5ce97e,_0x4ae6e6){var _0x5c0193=_0x4ae6e6['get']({'plain':!![]});if(!isOldTokenSent&&_0x5c0193['data1']!==_0x5ce97e&&!_0x5c0193[_0x9c63('0x10')]){oldToken=_0x5c0193[_0x9c63('0x11')];}httpRequest(_0x5ce97e)[_0x9c63('0xe')](function(_0x47dd9a){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x47dd9a[_0x9c63('0x12')]){isOldTokenSent=![];if(!_0x5c0193[_0x9c63('0x7')]&&_0x5c0193[_0x9c63('0x7')]!=_0x47dd9a['license']||_0x5c0193[_0x9c63('0x7')]&&_0x5c0193[_0x9c63('0x10')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5c0193[_0x9c63('0x7')]&&!_0x5c0193['data2']&&_0x5c0193[_0x9c63('0x7')]!=_0x47dd9a[_0x9c63('0x7')]){logger[_0x9c63('0x13')](_0x9c63('0x14'));}if(_0x5c0193['license']&&!_0x5c0193[_0x9c63('0x10')]&&_0x5c0193[_0x9c63('0x7')]==_0x47dd9a['license']){return _0x4ae6e6;}return _0x4ae6e6[_0x9c63('0x15')]({'data1':_0x5ce97e,'data2':null,'license':_0x47dd9a['license']});}else{if(_0x47dd9a['license']||_0x5c0193[_0x9c63('0x7')]){if(!_0x5c0193[_0x9c63('0x10')]){if(_0x5c0193['data1']==_0x5ce97e){GRAY_PERIOD_REASON=_0x9c63('0x16');logger['info'](_0x9c63('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x9c63('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5c0193[_0x9c63('0x11')],_0x5ce97e);}logger[_0x9c63('0x13')](_0x9c63('0x18'),GRAY_PERIOD_REASON[_0x9c63('0x19')](),moment()[_0x9c63('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x4ae6e6['update']({'data2':encryptor[_0x9c63('0x1a')](moment()[_0x9c63('0x9')](_0x9c63('0x1b')))});}else{if(moment()[_0x9c63('0x1c')](encryptor['decryptString'](_0x5c0193[_0x9c63('0x10')]),_0x9c63('0x1d'))>DAYS){logger[_0x9c63('0x13')](_0x9c63('0x1e'),moment()[_0x9c63('0x9')](_0x9c63('0x1b')));isOldTokenSent=![];return _0x4ae6e6[_0x9c63('0x15')]({'data1':_0x5ce97e,'data2':null,'license':null});}}}else{if(_0x5c0193['data1']!=_0x5ce97e){logger['info'](_0x9c63('0x1f'),_0x5c0193[_0x9c63('0x11')],_0x5ce97e);return _0x4ae6e6[_0x9c63('0x15')]({'data1':_0x5ce97e,'data2':null,'license':null});}}}return _0x4ae6e6;})['then'](function(_0x2a1ceb){_0x4ae6e6=_0x2a1ceb;})[_0x9c63('0xf')](function(_0x1d6c83){logger['error'](_0x1d6c83[_0x9c63('0x20')]);})[_0x9c63('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x9c63('0x22')](),_0x4ae6e6);},TIME);});}function defaultLicense(){var _0xfbe9ea=hardware[_0x9c63('0x22')]();if(_0xfbe9ea){return db[_0x9c63('0x23')][_0x9c63('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0xfbe9ea}})[_0x9c63('0x25')](function(_0x576623,_0x3e5c9a){logger[_0x9c63('0x13')](_0x9c63('0x26'),_0xfbe9ea);manageLicense(_0xfbe9ea,_0x576623);})[_0x9c63('0xf')](function(_0x230592){logger[_0x9c63('0x27')](_0x230592['message']);});}}exports[_0x9c63('0x28')]=defaultLicense;
\ No newline at end of file
index f73036e..2bf026e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedcd=['demo','machineUuid','gray','deadline','add','days','grayReason','uuid','changed','disabled','User','findAll','role','sequelize','COUNT','admin','user','telephone','users','telephones','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','decryptString','format','%s:%s:%s'];(function(_0x38511a,_0x226b17){var _0x165d9e=function(_0x142362){while(--_0x142362){_0x38511a['push'](_0x38511a['shift']());}};_0x165d9e(++_0x226b17);}(_0xedcd,0x7c));var _0xdedc=function(_0x2c07d0,_0x15eeae){_0x2c07d0=_0x2c07d0-0x0;var _0x408b46=_0xedcd[_0x2c07d0];return _0x408b46;};'use strict';var util=require(_0xdedc('0x0'));var _=require(_0xdedc('0x1'));var moment=require(_0xdedc('0x2'));var BPromise=require(_0xdedc('0x3'));var hardware=require(_0xdedc('0x4'));var encryptor=require(_0xdedc('0x5'));var db=require(_0xdedc('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdedc('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdedc('0x8'),'machineUuid':hardware[_0xdedc('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdedc('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdedc('0xa'),'machineUuid':hardware[_0xdedc('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4d75e6){return new BPromise(function(_0x234133,_0x2787b9){return db[_0xdedc('0xb')][_0xdedc('0xc')](_['defaults'](_0x4d75e6,{'raw':!![],'where':{'id':0x1}}))[_0xdedc('0xd')](function(_0x3c3443){return checkLicense(_0x3c3443,null);})['then'](function(_0x509ca8){_0x234133(_0x509ca8);return;})[_0xdedc('0xe')](function(_0x511837){_0x2787b9(_0x511837);});});}function checkLicense(_0x3e11d5,_0x3e2a54){if(!_0x3e11d5){demoLicense['uuid']=_0x3e11d5[_0xdedc('0xf')];return demoLicense;}try{var _0x49b649=_0x3e2a54||_0x3e11d5[_0xdedc('0x10')];if(_[_0xdedc('0x11')](_0x49b649)){throw new Error(_0xdedc('0x12'));}var _0x3db094=_0x3e11d5[_0xdedc('0xf')];var _0x56b3a7=_0x3e11d5[_0xdedc('0x13')];var _0xb018be=_0x3db094['split']('-')[0x4];var _0x554f6e=_0x3db094['split']('-')[0x0];var _0x325f64=encryptor[_0xdedc('0x14')](_0x49b649,util[_0xdedc('0x15')](_0xdedc('0x16'),_0xb018be,_0x3db094,_0x554f6e));var _0x2408c8=JSON['parse'](_0x325f64);_0x2408c8[_0xdedc('0x17')]=![];_0x2408c8['uuid']=_0x3db094;_0x2408c8[_0xdedc('0x18')]=hardware[_0xdedc('0x9')]();if(_0x56b3a7){var _0x51313b=encryptor[_0xdedc('0x14')](_0x56b3a7);_0x2408c8[_0xdedc('0x19')]=_0x51313b;_0x2408c8[_0xdedc('0x1a')]=moment(_0x51313b)[_0xdedc('0x1b')](0x7,_0xdedc('0x1c'))[_0xdedc('0x15')]();_0x2408c8[_0xdedc('0x1d')]=_0x2408c8[_0xdedc('0x1e')]!=_0x2408c8[_0xdedc('0x18')]?_0xdedc('0x1f'):_0xdedc('0x20');}return _0x2408c8;}catch(_0x30f979){breakingLicense[_0xdedc('0x1e')]=_0x3e11d5[_0xdedc('0xf')];breakingLicense['message']=_0x30f979['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2a7d30,_0x2659cb){getLicense()[_0xdedc('0xd')](function(_0x277a5c){return db[_0xdedc('0x21')][_0xdedc('0x22')]({'attributes':[_0xdedc('0x23'),[db[_0xdedc('0x24')]['fn'](_0xdedc('0x25'),db[_0xdedc('0x24')]['col'](_0xdedc('0x23'))),'count']],'group':_0xdedc('0x23'),'where':{'role':{'$or':[_0xdedc('0x26'),_0xdedc('0x27'),_0xdedc('0x28')]}},'raw':!![]})[_0xdedc('0xd')](function(_0x51366b){var _0x3175e1={'user':_0x277a5c[_0xdedc('0x29')]||0x0,'telephone':_0x277a5c[_0xdedc('0x2a')]||0x0};_0x51366b[_0xdedc('0x2b')](function(_0x259651){var _0x5aab24=_0x259651['role']==='admin'?'user':_0x259651['role'];_0x3175e1[_0x5aab24]-=_0x259651[_0xdedc('0x2c')];if(_0x3175e1[_0x5aab24]<0x0)_0x3175e1[_0x5aab24]=0x0;});_0x2a7d30(_0x3175e1);return;});})[_0xdedc('0xe')](function(_0x517fa8){_0x2659cb(_0x517fa8);});});}function checkUserLimits(_0x4e4452){return new BPromise(function(_0x543422,_0x2098b3){getLimits()[_0xdedc('0xd')](function(_0x51e4c7){var _0x4fb338=_[_0xdedc('0x2d')](_[_0xdedc('0x2e')](_0x4e4452,'role'),[_0xdedc('0x26'),'user',_0xdedc('0x28')]);var _0x8f842a=(_0x4fb338[_0xdedc('0x26')]||0x0)+(_0x4fb338[_0xdedc('0x27')]||0x0);var _0x124d13=_0x4fb338[_0xdedc('0x28')]||0x0;if(_0x8f842a>_0x51e4c7[_0xdedc('0x27')])return _0x2098b3('License\x20limit\x20reached\x20for\x20users');if(_0x124d13>_0x51e4c7[_0xdedc('0x28')])return _0x2098b3(_0xdedc('0x2f'));return _0x543422();})[_0xdedc('0xe')](function(_0x4682b7){_0x2098b3(_0x4682b7);});});}module[_0xdedc('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xaaa5=['getUuid','Breaking\x20license','License','find','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','machineUuid','add','days','changed','disabled','message','User','findAll','role','sequelize','col','count','users','telephones','forEach','admin','pick','countBy','user','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x452d48,_0x5cdc1e){var _0x2c18fd=function(_0x5bc2ce){while(--_0x5bc2ce){_0x452d48['push'](_0x452d48['shift']());}};_0x2c18fd(++_0x5cdc1e);}(_0xaaa5,0x1b3));var _0x5aaa=function(_0x59efce,_0x596669){_0x59efce=_0x59efce-0x0;var _0x3247d6=_0xaaa5[_0x59efce];return _0x3247d6;};'use strict';var util=require('util');var _=require(_0x5aaa('0x0'));var moment=require(_0x5aaa('0x1'));var BPromise=require('bluebird');var hardware=require(_0x5aaa('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x5aaa('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5aaa('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x5aaa('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'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':![],'update':![],'description':_0x5aaa('0x6'),'machineUuid':hardware[_0x5aaa('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2b205f){return new BPromise(function(_0x48569d,_0x4716d0){return db[_0x5aaa('0x7')][_0x5aaa('0x8')](_['defaults'](_0x2b205f,{'raw':!![],'where':{'id':0x1}}))[_0x5aaa('0x9')](function(_0x2e2f14){return checkLicense(_0x2e2f14,null);})[_0x5aaa('0x9')](function(_0x6a65ee){_0x48569d(_0x6a65ee);return;})[_0x5aaa('0xa')](function(_0x5c117b){_0x4716d0(_0x5c117b);});});}function checkLicense(_0x176de4,_0x58a993){if(!_0x176de4){demoLicense[_0x5aaa('0xb')]=_0x176de4['data1'];return demoLicense;}try{var _0x42220f=_0x58a993||_0x176de4[_0x5aaa('0xc')];if(_[_0x5aaa('0xd')](_0x42220f)){throw new Error(_0x5aaa('0xe'));}var _0x2eb8ae=_0x176de4[_0x5aaa('0xf')];var _0x1dc074=_0x176de4[_0x5aaa('0x10')];var _0x4467f9=_0x2eb8ae[_0x5aaa('0x11')]('-')[0x4];var _0x3893c1=_0x2eb8ae[_0x5aaa('0x11')]('-')[0x0];var _0x226a7a=encryptor[_0x5aaa('0x12')](_0x42220f,util[_0x5aaa('0x13')](_0x5aaa('0x14'),_0x4467f9,_0x2eb8ae,_0x3893c1));var _0x1529f0=JSON[_0x5aaa('0x15')](_0x226a7a);_0x1529f0['demo']=![];_0x1529f0[_0x5aaa('0xb')]=_0x2eb8ae;_0x1529f0[_0x5aaa('0x16')]=hardware[_0x5aaa('0x5')]();if(_0x1dc074){var _0x69e251=encryptor[_0x5aaa('0x12')](_0x1dc074);_0x1529f0['gray']=_0x69e251;_0x1529f0['deadline']=moment(_0x69e251)[_0x5aaa('0x17')](0x7,_0x5aaa('0x18'))[_0x5aaa('0x13')]();_0x1529f0['grayReason']=_0x1529f0[_0x5aaa('0xb')]!=_0x1529f0[_0x5aaa('0x16')]?_0x5aaa('0x19'):_0x5aaa('0x1a');}return _0x1529f0;}catch(_0x1f4c07){breakingLicense[_0x5aaa('0xb')]=_0x176de4[_0x5aaa('0xf')];breakingLicense[_0x5aaa('0x1b')]=_0x1f4c07[_0x5aaa('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x270c25,_0x2f8071){getLicense()['then'](function(_0x51adc0){return db[_0x5aaa('0x1c')][_0x5aaa('0x1d')]({'attributes':[_0x5aaa('0x1e'),[db[_0x5aaa('0x1f')]['fn']('COUNT',db[_0x5aaa('0x1f')][_0x5aaa('0x20')]('role')),_0x5aaa('0x21')]],'group':_0x5aaa('0x1e'),'where':{'role':{'$or':['admin','user','telephone']}},'raw':!![]})[_0x5aaa('0x9')](function(_0x59f19b){var _0x54a340={'user':_0x51adc0[_0x5aaa('0x22')]||0x0,'telephone':_0x51adc0[_0x5aaa('0x23')]||0x0};_0x59f19b[_0x5aaa('0x24')](function(_0x260021){var _0x3a192c=_0x260021['role']===_0x5aaa('0x25')?'user':_0x260021['role'];_0x54a340[_0x3a192c]-=_0x260021['count'];if(_0x54a340[_0x3a192c]<0x0)_0x54a340[_0x3a192c]=0x0;});_0x270c25(_0x54a340);return;});})['catch'](function(_0x3787aa){_0x2f8071(_0x3787aa);});});}function checkUserLimits(_0x232241){return new BPromise(function(_0x48ab7b,_0x57a9ee){getLimits()['then'](function(_0x14f08e){var _0x5baa25=_[_0x5aaa('0x26')](_[_0x5aaa('0x27')](_0x232241,_0x5aaa('0x1e')),[_0x5aaa('0x25'),'user','telephone']);var _0x32b7c7=(_0x5baa25[_0x5aaa('0x25')]||0x0)+(_0x5baa25[_0x5aaa('0x28')]||0x0);var _0x5985da=_0x5baa25[_0x5aaa('0x29')]||0x0;if(_0x32b7c7>_0x14f08e[_0x5aaa('0x28')])return _0x57a9ee('License\x20limit\x20reached\x20for\x20users');if(_0x5985da>_0x14f08e[_0x5aaa('0x29')])return _0x57a9ee(_0x5aaa('0x2a'));return _0x48ab7b();})[_0x5aaa('0xa')](function(_0x42980c){_0x57a9ee(_0x42980c);});});}module[_0x5aaa('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 4f2fbd3..ea18201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30a=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0x2b281b,_0x360f48){var _0x514213=function(_0x2d9ac1){while(--_0x2d9ac1){_0x2b281b['push'](_0x2b281b['shift']());}};_0x514213(++_0x360f48);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';module[_0xaa30('0x0')]={'DOMAIN':_0xaa30('0x1'),'SESSION_SECRET':_0xaa30('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xaa30('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0x93e9=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x93e9,0xcc));var _0x993e=function(_0xac4196,_0x3f58aa){_0xac4196=_0xac4196-0x0;var _0x97704a=_0x93e9[_0xac4196];return _0x97704a;};'use strict';module[_0x993e('0x0')]={'DOMAIN':_0x993e('0x1'),'SESSION_SECRET':_0x993e('0x2'),'GOOGLE_ID':_0x993e('0x3'),'GOOGLE_SECRET':_0x993e('0x4'),'DEBUG':''};
\ No newline at end of file
index 65b5a3b..3ec8e44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module['exports']=fileLogger;
\ No newline at end of file
+var _0x6189=['../utils/loggers','fileLogger'];(function(_0x5c6397,_0x142fc1){var _0x1a8a76=function(_0x25140c){while(--_0x25140c){_0x5c6397['push'](_0x5c6397['shift']());}};_0x1a8a76(++_0x142fc1);}(_0x6189,0x180));var _0x9618=function(_0x62d63e,_0x4fe844){_0x62d63e=_0x62d63e-0x0;var _0x2e4f66=_0x6189[_0x62d63e];return _0x2e4f66;};'use strict';var fileLogger=require(_0x9618('0x0'))[_0x9618('0x1')];module['exports']=fileLogger;
\ No newline at end of file
index 753c81a..46224fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x903d=['../../services/express/index.js','ami','join','../../services/agi/index.js','email','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express'];(function(_0x44e5c2,_0x47fc68){var _0x2a78b4=function(_0x9c41db){while(--_0x9c41db){_0x44e5c2['push'](_0x44e5c2['shift']());}};_0x2a78b4(++_0x47fc68);}(_0x903d,0x15e));var _0xd903=function(_0x419a71,_0x1ee333){_0x419a71=_0x419a71-0x0;var _0xcfbef4=_0x903d[_0x419a71];return _0xcfbef4;};'use strict';var path=require(_0xd903('0x0'));var os=require('os');var config={'apps':[{'name':_0xd903('0x1'),'script':path['join'](__dirname,_0xd903('0x2'))},{'name':_0xd903('0x3'),'script':path[_0xd903('0x4')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path['join'](__dirname,_0xd903('0x5'))},{'name':_0xd903('0x6'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0xd903('0x7'),'script':path[_0xd903('0x4')](__dirname,_0xd903('0x8'))},{'name':'xdr','script':path[_0xd903('0x4')](__dirname,_0xd903('0x9'))}]};module[_0xd903('0xa')]=config;
\ No newline at end of file
+var _0xdee3=['../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/xdr/index.js','path','../../services/express/index.js','join'];(function(_0x484057,_0x33e4a9){var _0x2ef1d2=function(_0x24e679){while(--_0x24e679){_0x484057['push'](_0x484057['shift']());}};_0x2ef1d2(++_0x33e4a9);}(_0xdee3,0x189));var _0x3dee=function(_0xe878f1,_0x3d8720){_0xe878f1=_0xe878f1-0x0;var _0x4a1028=_0xdee3[_0xe878f1];return _0x4a1028;};'use strict';var path=require(_0x3dee('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x3dee('0x1'))},{'name':'ami','script':path[_0x3dee('0x2')](__dirname,_0x3dee('0x3'))},{'name':_0x3dee('0x4'),'script':path[_0x3dee('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x3dee('0x5'),'script':path[_0x3dee('0x2')](__dirname,_0x3dee('0x6'))},{'name':_0x3dee('0x7'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,_0x3dee('0x8'))}]};module['exports']=config;
\ No newline at end of file
index 5bd06f1..984af30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab5c=['./config','connect','connected','then','start','stop','restart','disconnect','list','describe','delete','dump','saved','bluebird'];(function(_0x5847af,_0x20ec5a){var _0x388b22=function(_0x35ceb4){while(--_0x35ceb4){_0x5847af['push'](_0x5847af['shift']());}};_0x388b22(++_0x20ec5a);}(_0xab5c,0x109));var _0xcab5=function(_0x4952c7,_0xfd4dc6){_0x4952c7=_0x4952c7-0x0;var _0x418fb3=_0xab5c[_0x4952c7];return _0x418fb3;};'use strict';var pm2=require('pm2');var BPromise=require(_0xcab5('0x0'));var config=require(_0xcab5('0x1'));function connect(){return new BPromise(function(_0x14870b,_0x4ae43c){return pm2[_0xcab5('0x2')](function(_0x376fb0){if(_0x376fb0){return _0x4ae43c(_0x376fb0);}return _0x14870b(_0xcab5('0x3'));});});};exports['start']=function(_0x52d846){return connect()[_0xcab5('0x4')](function(){return new BPromise(function(_0x1642a4,_0x29e83a){return pm2[_0xcab5('0x5')](_0x52d846,function(_0x4bc617,_0x775e51){if(_0x4bc617){return _0x29e83a(_0x4bc617);}pm2['disconnect']();return _0x1642a4(_0x775e51);});});});};exports[_0xcab5('0x6')]=function(_0x2d227c){return connect()[_0xcab5('0x4')](function(){return new BPromise(function(_0x56df97,_0x1360cb){return pm2[_0xcab5('0x6')](_0x2d227c,function(_0x37a74a,_0x22a4d2){if(_0x37a74a){return _0x1360cb(_0x37a74a);}pm2['disconnect']();return _0x56df97(_0x22a4d2);});});});};exports[_0xcab5('0x7')]=function(_0x345cfa){return connect()['then'](function(){return new BPromise(function(_0x5b66e5,_0x11f838){return pm2[_0xcab5('0x7')](_0x345cfa,function(_0x475eb4,_0x103a81){if(_0x475eb4){return _0x11f838(_0x475eb4);}pm2[_0xcab5('0x8')]();return _0x5b66e5(_0x103a81);});});});};exports[_0xcab5('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4c4145,_0x30531c){return pm2['list'](function(_0x4f1dde,_0x21e224){if(_0x4f1dde){return _0x30531c(_0x4f1dde);}pm2['disconnect']();return _0x4c4145(_0x21e224);});});});};exports[_0xcab5('0xa')]=function(_0xf9fc8c){return connect()[_0xcab5('0x4')](function(){return new BPromise(function(_0x40cd9f,_0xe01039){return pm2[_0xcab5('0xa')](_0xf9fc8c,function(_0x31335f,_0x273047){if(_0x31335f){return _0xe01039(_0x31335f);}pm2[_0xcab5('0x8')]();return _0x40cd9f(_0x273047);});});});};exports[_0xcab5('0xb')]=function(_0x9678fd){return connect()[_0xcab5('0x4')](function(){return new BPromise(function(_0x5f4c56,_0x65fc85){return pm2[_0xcab5('0xb')](_0x9678fd,function(_0x65e2fd,_0x2f978e){if(_0x65e2fd){return _0x65fc85(_0x65e2fd);}pm2[_0xcab5('0x8')]();return _0x5f4c56(_0x2f978e);});});});};exports[_0xcab5('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x48b2d5,_0x2936d0){return pm2['dump'](function(_0x4bfe34){if(_0x4bfe34){return _0x2936d0(_0x4bfe34);}return _0x48b2d5(_0xcab5('0xd'));});});});};
\ No newline at end of file
+var _0xa56e=['then','disconnect','stop','restart','list','dump','saved','pm2','bluebird','connect','connected','start'];(function(_0xe2347c,_0x1f9646){var _0x756aea=function(_0x117321){while(--_0x117321){_0xe2347c['push'](_0xe2347c['shift']());}};_0x756aea(++_0x1f9646);}(_0xa56e,0xc7));var _0xea56=function(_0x18b7e8,_0x58058c){_0x18b7e8=_0x18b7e8-0x0;var _0x4a8bc0=_0xa56e[_0x18b7e8];return _0x4a8bc0;};'use strict';var pm2=require(_0xea56('0x0'));var BPromise=require(_0xea56('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x4158ef,_0xe0e70b){return pm2[_0xea56('0x2')](function(_0x110011){if(_0x110011){return _0xe0e70b(_0x110011);}return _0x4158ef(_0xea56('0x3'));});});};exports[_0xea56('0x4')]=function(_0xf90a7a){return connect()[_0xea56('0x5')](function(){return new BPromise(function(_0x15f6e9,_0x10d0ed){return pm2['start'](_0xf90a7a,function(_0x3927be,_0x4f2e1a){if(_0x3927be){return _0x10d0ed(_0x3927be);}pm2[_0xea56('0x6')]();return _0x15f6e9(_0x4f2e1a);});});});};exports[_0xea56('0x7')]=function(_0x162760){return connect()[_0xea56('0x5')](function(){return new BPromise(function(_0x517424,_0x29434f){return pm2[_0xea56('0x7')](_0x162760,function(_0x3f64c9,_0x1f5f5f){if(_0x3f64c9){return _0x29434f(_0x3f64c9);}pm2[_0xea56('0x6')]();return _0x517424(_0x1f5f5f);});});});};exports['restart']=function(_0x23ec54){return connect()[_0xea56('0x5')](function(){return new BPromise(function(_0x509aae,_0x3c4c80){return pm2[_0xea56('0x8')](_0x23ec54,function(_0x438be1,_0x5828b7){if(_0x438be1){return _0x3c4c80(_0x438be1);}pm2[_0xea56('0x6')]();return _0x509aae(_0x5828b7);});});});};exports[_0xea56('0x9')]=function(){return connect()[_0xea56('0x5')](function(){return new BPromise(function(_0x14d25c,_0x20dbf3){return pm2[_0xea56('0x9')](function(_0x3e8814,_0x23ddcc){if(_0x3e8814){return _0x20dbf3(_0x3e8814);}pm2[_0xea56('0x6')]();return _0x14d25c(_0x23ddcc);});});});};exports['describe']=function(_0x2f0033){return connect()['then'](function(){return new BPromise(function(_0x38624d,_0x12a9d3){return pm2['describe'](_0x2f0033,function(_0x5c0740,_0x25c8df){if(_0x5c0740){return _0x12a9d3(_0x5c0740);}pm2[_0xea56('0x6')]();return _0x38624d(_0x25c8df);});});});};exports['delete']=function(_0x492d07){return connect()[_0xea56('0x5')](function(){return new BPromise(function(_0x44fb27,_0x2a0571){return pm2['delete'](_0x492d07,function(_0x251d05,_0x5c3f39){if(_0x251d05){return _0x2a0571(_0x251d05);}pm2[_0xea56('0x6')]();return _0x44fb27(_0x5c3f39);});});});};exports[_0xea56('0xa')]=function(){return connect()[_0xea56('0x5')](function(){return new BPromise(function(_0x5ca03e,_0x4bfd38){return pm2[_0xea56('0xa')](function(_0x317a4f){if(_0x317a4f){return _0x4bfd38(_0x317a4f);}return _0x5ca03e(_0xea56('0xb'));});});});};
\ No newline at end of file
index 122e04d..5485291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a0f=['format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','system','timeout'];(function(_0x413bb8,_0x5466f5){var _0x275992=function(_0x148419){while(--_0x148419){_0x413bb8['push'](_0x413bb8['shift']());}};_0x275992(++_0x5466f5);}(_0x5a0f,0x15e));var _0xf5a0=function(_0x49f690,_0x525ad2){_0x49f690=_0x49f690-0x0;var _0x50f5b4=_0x5a0f[_0x49f690];return _0x50f5b4;};'use strict';var _=require(_0xf5a0('0x0'));var moment=require(_0xf5a0('0x1'));var Redis=require(_0xf5a0('0x2'));var util=require(_0xf5a0('0x3'));var config=require('../../config/environment');var db=require(_0xf5a0('0x4'))['db'];var logger=require(_0xf5a0('0x5'))(_0xf5a0('0x6'));config[_0xf5a0('0x7')]=_[_0xf5a0('0x8')](config[_0xf5a0('0x7')],{'host':_0xf5a0('0x9'),'port':0x18eb});var io=require(_0xf5a0('0xa'))(new Redis(config[_0xf5a0('0x7')]));function closeInteractions(){var _0x35b6b9=0x0;var _0x1d72c2=[];return db[_0xf5a0('0xb')]['find']({'raw':!![],'attributes':['id',_0xf5a0('0xc')],'where':{'id':0x1}})[_0xf5a0('0xd')](function(_0x6f9b2f){_0x35b6b9=_0x6f9b2f[_0xf5a0('0xc')];if(_0x35b6b9){return db[_0xf5a0('0xe')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x6f9b2f[_0xf5a0('0xc')],_0xf5a0('0xf'))}}});}else{return[];}})[_0xf5a0('0xd')](function(_0x2ec0e1){if(_0x2ec0e1&&_0x2ec0e1[_0xf5a0('0x10')]){_0x1d72c2=_[_0xf5a0('0x11')](_0x2ec0e1||[],'id');logger[_0xf5a0('0x12')](_0xf5a0('0x13'),_0x1d72c2['join']());return db[_0xf5a0('0xe')]['update']({'closeReason':_0xf5a0('0x14'),'disposition':_0xf5a0('0x15'),'closed':!![],'closedAt':moment()[_0xf5a0('0x16')](_0xf5a0('0x17'))},{'where':{'id':_0x1d72c2}});}})[_0xf5a0('0xd')](function(){if(_0x1d72c2&&_0x1d72c2[_0xf5a0('0x10')]){logger['info'](_0xf5a0('0x18'),_0x1d72c2['join']());for(var _0x40e021=0x0;_0x40e021<_0x1d72c2['length'];_0x40e021++){io[_0xf5a0('0x19')](_0xf5a0('0x1a'),{'id':_0x1d72c2[_0x40e021],'closed':!![]});}}})[_0xf5a0('0x1b')](function(_0x46fe01){logger[_0xf5a0('0x1c')](_0xf5a0('0x1d'),_0x46fe01?util['inspect'](_0x46fe01,{'showHidden':![],'depth':null}):'');});}exports[_0xf5a0('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x22dc=['lodash','moment','ioredis','util','../../mysqldb','schedule','redis','defaults','socket.io-emitter','Setting','ChatInteraction','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0x22dc,0x1f0));var _0xc22d=function(_0x54fa32,_0x357fa5){_0x54fa32=_0x54fa32-0x0;var _0x5be899=_0x22dc[_0x54fa32];return _0x5be899;};'use strict';var _=require(_0xc22d('0x0'));var moment=require(_0xc22d('0x1'));var Redis=require(_0xc22d('0x2'));var util=require(_0xc22d('0x3'));var config=require('../../config/environment');var db=require(_0xc22d('0x4'))['db'];var logger=require('../logger')(_0xc22d('0x5'));config[_0xc22d('0x6')]=_[_0xc22d('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc22d('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x331f4c=0x0;var _0x29a42b=[];return db[_0xc22d('0x9')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x4e1e4c){_0x331f4c=_0x4e1e4c['chatTimeout'];if(_0x331f4c){return db[_0xc22d('0xa')]['findAll']({'raw':!![],'attributes':['id',_0xc22d('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xc22d('0xc')](_0x4e1e4c['chatTimeout'],_0xc22d('0xd'))}}});}else{return[];}})['then'](function(_0x2a91cc){if(_0x2a91cc&&_0x2a91cc[_0xc22d('0xe')]){_0x29a42b=_[_0xc22d('0xf')](_0x2a91cc||[],'id');logger[_0xc22d('0x10')](_0xc22d('0x11'),_0x29a42b[_0xc22d('0x12')]());return db['ChatInteraction'][_0xc22d('0x13')]({'closeReason':_0xc22d('0x14'),'disposition':_0xc22d('0x15'),'closed':!![],'closedAt':moment()[_0xc22d('0x16')](_0xc22d('0x17'))},{'where':{'id':_0x29a42b}});}})[_0xc22d('0x18')](function(){if(_0x29a42b&&_0x29a42b[_0xc22d('0xe')]){logger[_0xc22d('0x10')](_0xc22d('0x19'),_0x29a42b['join']());for(var _0x3f26a4=0x0;_0x3f26a4<_0x29a42b[_0xc22d('0xe')];_0x3f26a4++){io['emit'](_0xc22d('0x1a'),{'id':_0x29a42b[_0x3f26a4],'closed':!![]});}}})[_0xc22d('0x1b')](function(_0x17abf9){logger[_0xc22d('0x1c')](_0xc22d('0x1d'),_0x17abf9?util['inspect'](_0x17abf9,{'showHidden':![],'depth':null}):'');});}exports[_0xc22d('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 218970e..55ee5cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad88=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x4b6342,_0x3e3f20){var _0x118d03=function(_0x1f9adb){while(--_0x1f9adb){_0x4b6342['push'](_0x4b6342['shift']());}};_0x118d03(++_0x3e3f20);}(_0xad88,0x87));var _0x8ad8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xad88[_0x49b207];return _0x2dc8fa;};'use strict';function start(){var _0x59967d=require(_0x8ad8('0x0'));return _0x59967d[_0x8ad8('0x1')]();}module[_0x8ad8('0x2')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0xb64c=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4c1db4,_0x5548b7){var _0x3b463b=function(_0x335136){while(--_0x335136){_0x4c1db4['push'](_0x4c1db4['shift']());}};_0x3b463b(++_0x5548b7);}(_0xb64c,0x1c5));var _0xcb64=function(_0x2acbce,_0x1bba43){_0x2acbce=_0x2acbce-0x0;var _0x5f0461=_0xb64c[_0x2acbce];return _0x5f0461;};'use strict';function start(){var _0x3adf43=require(_0xcb64('0x0'));return _0x3adf43['startAllRefreshIntervals']();}module[_0xcb64('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
index 945a1b5..2e0785d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3303=['subtract','format','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','keyBy','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update\x20cron','catch','run','util','path','cron-job-manager','jayson/promise','bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','bcc','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','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','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','data','Smtp','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined'];(function(_0x463828,_0x5e0d8c){var _0x3e4644=function(_0x20019e){while(--_0x20019e){_0x463828['push'](_0x463828['shift']());}};_0x3e4644(++_0x5e0d8c);}(_0x3303,0xdc));var _0x3330=function(_0xfef0ee,_0x15cba7){_0xfef0ee=_0xfef0ee-0x0;var _0x2fa6d4=_0x3303[_0xfef0ee];return _0x2fa6d4;};'use strict';var fs=require('fs');var util=require(_0x3330('0x0'));var path=require(_0x3330('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x3330('0x2'));var jayson=require(_0x3330('0x3'));var BPromise=require(_0x3330('0x4'));var logger=require(_0x3330('0x5'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x3330('0x6'));var analyticDefaultReportController=require(_0x3330('0x7'));var client=jayson[_0x3330('0x8')][_0x3330('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f47a7,_0x881eab){return function(){logger['info'](_0x3330('0xa'),_0x2f47a7[_0x3330('0xb')]);var _0x37797f=!![];var _0x4ab063=_0x2f47a7[_0x3330('0xc')][_0x3330('0xd')]();var _0x29e645={'account':_0x4ab063,'message':{'from':util['format'](_0x3330('0xe'),_0x2f47a7[_0x3330('0xc')][_0x3330('0xf')],_0x2f47a7[_0x3330('0xc')][_0x3330('0xb')]||_0x2f47a7['MailAccount']['Smtp']['user']),'to':_0x2f47a7['email'],'cc':_0x2f47a7['cc'],'bcc':_0x2f47a7[_0x3330('0x10')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x881eab[_0x3330('0xf')],_0x2f47a7['subtractNumber'],_0x2f47a7[_0x3330('0x11')])}};var _0x4614b7=path[_0x3330('0x12')](__dirname,_0x3330('0x13'));var _0x13a0b2=_0x881eab[_0x3330('0x14')];var _0x2c60dc=util['format'](_0x3330('0x15'),path['basename'](_0x881eab[_0x3330('0x14')],path[_0x3330('0x16')](_0x881eab[_0x3330('0x14')])),_0x3330('0x17'));var _0x5aa2d7=path['join'](_0x4614b7,_0x13a0b2);var _0x3932ed=path[_0x3330('0x12')](_0x4614b7,_0x2c60dc);if(fs[_0x3330('0x18')](_0x5aa2d7)){_0x881eab[_0x3330('0x19')]=_0x3330('0x1a');_0x29e645[_0x3330('0x1b')][_0x3330('0x1c')]=[{'filename':_0x13a0b2,'path':_0x5aa2d7}];_0x29e645[_0x3330('0x1b')][_0x3330('0x1d')]=util['format'](_0x3330('0x1e'),JSON[_0x3330('0x1f')](_0x881eab,null,0x2));}else if(fs[_0x3330('0x18')](_0x3932ed)){_0x881eab[_0x3330('0x19')]='Sent';_0x29e645[_0x3330('0x1b')][_0x3330('0x1c')]=[{'filename':_0x2c60dc,'path':_0x3932ed}];}else{_0x29e645[_0x3330('0x1b')][_0x3330('0x1d')]=_0x3330('0x20');if(!_0x2f47a7[_0x3330('0x21')]){_0x37797f=![];logger[_0x3330('0x22')](_0x3330('0x23'));}}if(_0x37797f){return client[_0x3330('0x24')]('SendMail',_0x29e645)[_0x3330('0x25')](function(_0x1c3501){if(_0x1c3501[_0x3330('0x26')]){return logger[_0x3330('0x26')](_0x3330('0x27'),JSON[_0x3330('0x1f')](_0x1c3501));}return logger[_0x3330('0x22')](_0x3330('0x28'));})['catch'](function(_0x3e1114){return logger['error']('error\x20mail',JSON[_0x3330('0x1f')](_0x3e1114));});}};}function handleError(){return function(_0x5b53d6){return logger[_0x3330('0x26')](JSON['stringify'](_0x5b53d6));};}function handleResult(_0x574994){return function(_0x33c974){logger[_0x3330('0x22')](_0x3330('0x29'),JSON[_0x3330('0x1f')](_0x33c974));if(_0x574994[_0x3330('0xc')]&&_0x574994[_0x3330('0xc')][_0x3330('0x2a')]&&!_[_0x3330('0x2b')](_0x574994['email'])){setTimeout(handleSendEmail(_0x574994,_0x33c974),0x3c*0x3e8);}};}function handleJob(_0x1e4388){return function(){try{if(_['isNil'](_0x1e4388[_0x3330('0x2c')])){return logger[_0x3330('0x22')](_0x3330('0x2d'));}if(_[_0x3330('0x2b')](_0x1e4388['subtractUnit'])){return logger[_0x3330('0x22')](_0x3330('0x2e'));}var _0x46d6e8={'startDate':moment()[_0x3330('0x2f')](_0x1e4388[_0x3330('0x2c')],_0x1e4388[_0x3330('0x11')])[_0x3330('0x30')](_0x3330('0x31')),'endDate':moment()['format'](_0x3330('0x31')),'type':_0x3330('0x32'),'output':_0x1e4388[_0x3330('0x33')],'name':_0x1e4388[_0x3330('0xf')]};if(!_['isNil'](_0x1e4388[_0x3330('0x34')])){logger['info'](_0x3330('0x35'),_0x1e4388['DefaultReportId']);return analyticDefaultReportController[_0x3330('0x36')]({'id':_0x1e4388[_0x3330('0x34')]},_0x46d6e8)[_0x3330('0x25')](handleResult(_0x1e4388))['catch'](handleError());}if(!_[_0x3330('0x2b')](_0x1e4388[_0x3330('0x37')])){logger['info'](_0x3330('0x38'),_0x1e4388[_0x3330('0x37')]);return analyticCustomReportController[_0x3330('0x36')]({'id':_0x1e4388[_0x3330('0x37')]},_0x46d6e8)['then'](handleResult(_0x1e4388))['catch'](handleError());}}catch(_0x1ec981){logger[_0x3330('0x26')](JSON['stringify'](_0x1ec981));}return logger['info'](_0x3330('0x39'));};}function getJobs(_0x4c8885){var _0x11279f={};if(_0x4c8885){_0x11279f['id']=_0x4c8885;}return db[_0x3330('0x3a')][_0x3330('0x3b')]({'where':_0x11279f,'include':[{'model':db[_0x3330('0xc')],'attributes':['id','name',_0x3330('0xb')],'include':[{'model':db[_0x3330('0x3c')],'as':_0x3330('0x2a'),'include':[{'model':db[_0x3330('0x3d')],'as':'CloudProvider'}]}]}]})[_0x3330('0x25')](function(_0x907488){var _0xdc0fad=_[_0x3330('0x3e')](manager[_0x3330('0x3f')]);var _0x1020ed=_['map'](_0x907488,function(_0x5264a9){return _0x5264a9['id']['toString']();});var _0x1b60df=_[_0x3330('0x40')](_0x907488,function(_0x3b7cbd){return _0x3b7cbd['id'][_0x3330('0x41')]();});var _0x5d34a2=_0x4c8885?_0x1020ed:_[_0x3330('0x42')](_0x1020ed,_0xdc0fad);var _0x46af8a=_[_0x3330('0x43')](_0x1020ed,_0xdc0fad);var _0x1790e5=_[_0x3330('0x42')](_0xdc0fad,_0x1020ed);var _0x4df2af;var _0xcc88;for(_0x4df2af=0x0;_0x4df2af<_0x1790e5['length']&&!_0x4c8885;_0x4df2af+=0x1){_0xcc88=_0x1790e5[_0x4df2af][_0x3330('0x41')]();if(manager[_0x3330('0x44')](_0xcc88)){manager[_0x3330('0x45')](_0xcc88);manager[_0x3330('0x46')](_0xcc88);logger['info'](_0x3330('0x47'),_0xcc88);}}logger[_0x3330('0x22')](_0x3330('0x48'),JSON[_0x3330('0x1f')](_0x5d34a2));for(_0x4df2af=0x0;_0x4df2af<_0x5d34a2[_0x3330('0x49')];_0x4df2af+=0x1){_0xcc88=_0x5d34a2[_0x4df2af]['toString']();logger[_0x3330('0x22')](_0x3330('0x4a'),_0xcc88);if(_0x4c8885){logger[_0x3330('0x22')](_0x3330('0x4b'),_0x4c8885);logger[_0x3330('0x22')](JSON[_0x3330('0x1f')](_0x1b60df[_0xcc88]));BPromise[_0x3330('0x4c')]()[_0x3330('0x25')](handleJob(_0x1b60df[_0xcc88]));logger['info']('run\x20job',_0x1b60df[_0xcc88][_0x3330('0xf')],_0x1b60df[_0xcc88][_0x3330('0x4d')]);}else if(_0x1b60df[_0xcc88]['cron']&&_0x1b60df[_0xcc88][_0x3330('0x4e')]&&moment()[_0x3330('0x4f')](_0x1b60df[_0xcc88][_0x3330('0x50')],_0x1b60df[_0xcc88][_0x3330('0x51')])){manager[_0x3330('0x52')](_0xcc88,_0x1b60df[_0xcc88][_0x3330('0x4d')],handleJob(_0x1b60df[_0xcc88]));manager[_0x3330('0x53')](_0xcc88);logger[_0x3330('0x22')](_0x3330('0x54'),_0x1b60df[_0xcc88][_0x3330('0xf')],_0x1b60df[_0xcc88]['cron']);}else if(manager[_0x3330('0x44')](_0xcc88)){manager[_0x3330('0x45')](_0xcc88);manager[_0x3330('0x46')](_0xcc88);logger['info'](_0x3330('0x55'),_0x1b60df[_0xcc88][_0x3330('0xf')],_0x1b60df[_0xcc88][_0x3330('0x4d')]);}}for(_0x4df2af=0x0,_0xcc88;_0x4df2af<_0x46af8a[_0x3330('0x49')]&&!_0x4c8885;_0x4df2af+=0x1){_0xcc88=_0x46af8a[_0x4df2af][_0x3330('0x41')]();if(manager['exists'](_0xcc88)){if(_0x1b60df[_0xcc88][_0x3330('0x4d')]&&_0x1b60df[_0xcc88][_0x3330('0x4e')]&&moment()[_0x3330('0x4f')](_0x1b60df[_0xcc88]['startAt'],_0x1b60df[_0xcc88][_0x3330('0x51')])){manager['update'](_0xcc88,_0x1b60df[_0xcc88]['cron'],handleJob(_0x1b60df[_0xcc88]));logger[_0x3330('0x22')](_0x3330('0x56'),_0x1b60df[_0xcc88][_0x3330('0xf')],_0x1b60df[_0xcc88][_0x3330('0x4d')]);}else{manager['stop'](_0xcc88);manager[_0x3330('0x46')](_0xcc88);logger[_0x3330('0x22')]('stop\x20cron',_0x1b60df[_0xcc88]['name'],_0x1b60df[_0xcc88][_0x3330('0x4d')]);}}}})[_0x3330('0x57')](function(_0x4b3565){logger[_0x3330('0x26')](JSON[_0x3330('0x1f')](_0x4b3565));});}exports[_0x3330('0x58')]=function(_0x4ee4e0){return getJobs(_0x4ee4e0);};exports[_0x3330('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x673c=['toString','keyBy','difference','exists','stop','deleteJob','length','index','resolve','run\x20job','active','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','cron','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','user','bcc','format','name','subtractNumber','subtractUnit','join','savename','basename','extname','zip','existsSync','Sent','message','text','status','attachments','sendIfEmpty','request','SendMail','then','error','error\x20mail','stringify','catch','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','exec\x20custom\x20report\x20id:%s','CustomReportId','runReport','Schedule','MailServerOut','CloudProvider','keys','jobs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x673c,0x101));var _0xc673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x673c[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0xc673('0x0'));var path=require(_0xc673('0x1'));var _=require(_0xc673('0x2'));var moment=require(_0xc673('0x3'));var CronJobManager=require(_0xc673('0x4'));var jayson=require(_0xc673('0x5'));var BPromise=require('bluebird');var logger=require('../logger')(_0xc673('0x6'));var db=require(_0xc673('0x7'))['db'];var analyticCustomReportController=require(_0xc673('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xc673('0x9')][_0xc673('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x120cd3,_0x33278b){return function(){logger[_0xc673('0xb')](_0xc673('0xc'),_0x120cd3[_0xc673('0xd')]);var _0x4f4fac=!![];var _0x349d9c=_0x120cd3[_0xc673('0xe')][_0xc673('0xf')]();var _0x314ec0={'account':_0x349d9c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x120cd3[_0xc673('0xe')]['name'],_0x120cd3['MailAccount'][_0xc673('0xd')]||_0x120cd3['MailAccount']['Smtp'][_0xc673('0x10')]),'to':_0x120cd3[_0xc673('0xd')],'cc':_0x120cd3['cc'],'bcc':_0x120cd3[_0xc673('0x11')],'subject':util[_0xc673('0x12')]('Report\x20%s\x20last\x20%s\x20%s',_0x33278b[_0xc673('0x13')],_0x120cd3[_0xc673('0x14')],_0x120cd3[_0xc673('0x15')])}};var _0x15d274=path[_0xc673('0x16')](__dirname,'../../files/reports');var _0x5484fe=_0x33278b[_0xc673('0x17')];var _0x2be2b9=util[_0xc673('0x12')]('%s.%s',path[_0xc673('0x18')](_0x33278b['savename'],path[_0xc673('0x19')](_0x33278b[_0xc673('0x17')])),_0xc673('0x1a'));var _0x5aa651=path[_0xc673('0x16')](_0x15d274,_0x5484fe);var _0x5d7157=path['join'](_0x15d274,_0x2be2b9);if(fs[_0xc673('0x1b')](_0x5aa651)){_0x33278b['status']=_0xc673('0x1c');_0x314ec0['message']['attachments']=[{'filename':_0x5484fe,'path':_0x5aa651}];_0x314ec0[_0xc673('0x1d')][_0xc673('0x1e')]=util[_0xc673('0x12')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x33278b,null,0x2));}else if(fs[_0xc673('0x1b')](_0x5d7157)){_0x33278b[_0xc673('0x1f')]='Sent';_0x314ec0[_0xc673('0x1d')][_0xc673('0x20')]=[{'filename':_0x2be2b9,'path':_0x5d7157}];}else{_0x314ec0[_0xc673('0x1d')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x120cd3[_0xc673('0x21')]){_0x4f4fac=![];logger[_0xc673('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x4f4fac){return client[_0xc673('0x22')](_0xc673('0x23'),_0x314ec0)[_0xc673('0x24')](function(_0x4d5a41){if(_0x4d5a41[_0xc673('0x25')]){return logger[_0xc673('0x25')](_0xc673('0x26'),JSON[_0xc673('0x27')](_0x4d5a41));}return logger[_0xc673('0xb')]('email\x20sent');})[_0xc673('0x28')](function(_0x999c31){return logger[_0xc673('0x25')]('error\x20mail',JSON[_0xc673('0x27')](_0x999c31));});}};}function handleError(){return function(_0x457b15){return logger[_0xc673('0x25')](JSON[_0xc673('0x27')](_0x457b15));};}function handleResult(_0x3a14dd){return function(_0x2183f5){logger[_0xc673('0xb')](_0xc673('0x29'),JSON['stringify'](_0x2183f5));if(_0x3a14dd[_0xc673('0xe')]&&_0x3a14dd[_0xc673('0xe')][_0xc673('0x2a')]&&!_[_0xc673('0x2b')](_0x3a14dd[_0xc673('0xd')])){setTimeout(handleSendEmail(_0x3a14dd,_0x2183f5),0x3c*0x3e8);}};}function handleJob(_0x4c8d8a){return function(){try{if(_[_0xc673('0x2b')](_0x4c8d8a[_0xc673('0x14')])){return logger[_0xc673('0xb')](_0xc673('0x2c'));}if(_[_0xc673('0x2b')](_0x4c8d8a[_0xc673('0x15')])){return logger[_0xc673('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x21fc8e={'startDate':moment()[_0xc673('0x2d')](_0x4c8d8a[_0xc673('0x14')],_0x4c8d8a[_0xc673('0x15')])['format'](_0xc673('0x2e')),'endDate':moment()['format'](_0xc673('0x2e')),'type':_0xc673('0x2f'),'output':_0x4c8d8a[_0xc673('0x30')],'name':_0x4c8d8a[_0xc673('0x13')]};if(!_[_0xc673('0x2b')](_0x4c8d8a[_0xc673('0x31')])){logger['info'](_0xc673('0x32'),_0x4c8d8a[_0xc673('0x31')]);return analyticDefaultReportController['runReport']({'id':_0x4c8d8a[_0xc673('0x31')]},_0x21fc8e)['then'](handleResult(_0x4c8d8a))[_0xc673('0x28')](handleError());}if(!_[_0xc673('0x2b')](_0x4c8d8a['CustomReportId'])){logger['info'](_0xc673('0x33'),_0x4c8d8a[_0xc673('0x34')]);return analyticCustomReportController[_0xc673('0x35')]({'id':_0x4c8d8a[_0xc673('0x34')]},_0x21fc8e)[_0xc673('0x24')](handleResult(_0x4c8d8a))[_0xc673('0x28')](handleError());}}catch(_0x3eda20){logger[_0xc673('0x25')](JSON[_0xc673('0x27')](_0x3eda20));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x38eb05){var _0x3e33f8={};if(_0x38eb05){_0x3e33f8['id']=_0x38eb05;}return db[_0xc673('0x36')]['findAll']({'where':_0x3e33f8,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0xc673('0xd')],'include':[{'model':db[_0xc673('0x37')],'as':_0xc673('0x2a'),'include':[{'model':db[_0xc673('0x38')],'as':'CloudProvider'}]}]}]})['then'](function(_0x512e48){var _0x49f4f1=_[_0xc673('0x39')](manager[_0xc673('0x3a')]);var _0x352e02=_['map'](_0x512e48,function(_0xa74a30){return _0xa74a30['id'][_0xc673('0x3b')]();});var _0x59b7ff=_[_0xc673('0x3c')](_0x512e48,function(_0x162e5c){return _0x162e5c['id'][_0xc673('0x3b')]();});var _0x2ca16d=_0x38eb05?_0x352e02:_[_0xc673('0x3d')](_0x352e02,_0x49f4f1);var _0x2fc0b1=_['intersection'](_0x352e02,_0x49f4f1);var _0x21f3f7=_[_0xc673('0x3d')](_0x49f4f1,_0x352e02);var _0x4c58e1;var _0x19b192;for(_0x4c58e1=0x0;_0x4c58e1<_0x21f3f7['length']&&!_0x38eb05;_0x4c58e1+=0x1){_0x19b192=_0x21f3f7[_0x4c58e1][_0xc673('0x3b')]();if(manager[_0xc673('0x3e')](_0x19b192)){manager[_0xc673('0x3f')](_0x19b192);manager[_0xc673('0x40')](_0x19b192);logger[_0xc673('0xb')]('delete\x20cron',_0x19b192);}}logger[_0xc673('0xb')]('toRun',JSON[_0xc673('0x27')](_0x2ca16d));for(_0x4c58e1=0x0;_0x4c58e1<_0x2ca16d[_0xc673('0x41')];_0x4c58e1+=0x1){_0x19b192=_0x2ca16d[_0x4c58e1][_0xc673('0x3b')]();logger['info'](_0xc673('0x42'),_0x19b192);if(_0x38eb05){logger['info']('my\x20id',_0x38eb05);logger[_0xc673('0xb')](JSON[_0xc673('0x27')](_0x59b7ff[_0x19b192]));BPromise[_0xc673('0x43')]()['then'](handleJob(_0x59b7ff[_0x19b192]));logger[_0xc673('0xb')](_0xc673('0x44'),_0x59b7ff[_0x19b192][_0xc673('0x13')],_0x59b7ff[_0x19b192]['cron']);}else if(_0x59b7ff[_0x19b192]['cron']&&_0x59b7ff[_0x19b192][_0xc673('0x45')]&&moment()[_0xc673('0x46')](_0x59b7ff[_0x19b192][_0xc673('0x47')],_0x59b7ff[_0x19b192][_0xc673('0x48')])){manager['add'](_0x19b192,_0x59b7ff[_0x19b192]['cron'],handleJob(_0x59b7ff[_0x19b192]));manager[_0xc673('0x49')](_0x19b192);logger[_0xc673('0xb')](_0xc673('0x4a'),_0x59b7ff[_0x19b192][_0xc673('0x13')],_0x59b7ff[_0x19b192]['cron']);}else if(manager[_0xc673('0x3e')](_0x19b192)){manager[_0xc673('0x3f')](_0x19b192);manager['deleteJob'](_0x19b192);logger[_0xc673('0xb')](_0xc673('0x4b'),_0x59b7ff[_0x19b192][_0xc673('0x13')],_0x59b7ff[_0x19b192]['cron']);}}for(_0x4c58e1=0x0,_0x19b192;_0x4c58e1<_0x2fc0b1['length']&&!_0x38eb05;_0x4c58e1+=0x1){_0x19b192=_0x2fc0b1[_0x4c58e1][_0xc673('0x3b')]();if(manager[_0xc673('0x3e')](_0x19b192)){if(_0x59b7ff[_0x19b192]['cron']&&_0x59b7ff[_0x19b192][_0xc673('0x45')]&&moment()[_0xc673('0x46')](_0x59b7ff[_0x19b192][_0xc673('0x47')],_0x59b7ff[_0x19b192]['endAt'])){manager['update'](_0x19b192,_0x59b7ff[_0x19b192][_0xc673('0x4c')],handleJob(_0x59b7ff[_0x19b192]));logger['info'](_0xc673('0x4d'),_0x59b7ff[_0x19b192][_0xc673('0x13')],_0x59b7ff[_0x19b192][_0xc673('0x4c')]);}else{manager[_0xc673('0x3f')](_0x19b192);manager[_0xc673('0x40')](_0x19b192);logger['info'](_0xc673('0x4b'),_0x59b7ff[_0x19b192][_0xc673('0x13')],_0x59b7ff[_0x19b192][_0xc673('0x4c')]);}}}})[_0xc673('0x28')](function(_0x2e1ac5){logger[_0xc673('0x25')](JSON[_0xc673('0x27')](_0x2e1ac5));});}exports[_0xc673('0x4e')]=function(_0xf38374){return getJobs(_0xf38374);};exports[_0xc673('0x49')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 235fbb4..43ff39f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca56=['error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','catch','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeName','then','info','TranscriptionJob','fileText','COMPLETED','TranscriptionJobStatus','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','resolve','sentiment','Cloud\x20Provider\x20not\x20configured','Sentiment','Negative','name','SequelizeValidationError'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xca56,0xee));var _0x6ca5=function(_0x52a1f2,_0x3034fd){_0x52a1f2=_0x52a1f2-0x0;var _0x12fb40=_0xca56[_0x52a1f2];return _0x12fb40;};var _=require(_0x6ca5('0x0'));var AWS=require(_0x6ca5('0x1'));var rp=require(_0x6ca5('0x2'));var util=require(_0x6ca5('0x3'));var BPromise=require(_0x6ca5('0x4'));var db=require(_0x6ca5('0x5'))['db'];var logger=require(_0x6ca5('0x6'))(_0x6ca5('0x7'));function getTranscriptionJob(_0x15105e,_0x5456b0,_0x3b0a11,_0x21b540){return new Promise(function(_0x4440bd,_0x2c078a){var _0x529cbe=new AWS[(_0x6ca5('0x8'))]({'accessKeyId':_0x5456b0,'secretAccessKey':_0x15105e,'region':_0x3b0a11});_0x529cbe[_0x6ca5('0x9')]({'TranscriptionJobName':_0x21b540},function(_0x511b48,_0x586799){if(_0x511b48){return _0x2c078a(_0x511b48);}else{return _0x4440bd(_0x586799);}});});}function sentiment(_0x468d92,_0x40bf93,_0x1d5253,_0x147fd3,_0x4b916f){return new Promise(function(_0x52583a,_0x9aa61f){var _0x14e821=new AWS[(_0x6ca5('0xa'))]({'accessKeyId':_0x40bf93,'secretAccessKey':_0x468d92,'region':_0x1d5253});_0x14e821[_0x6ca5('0xb')]({'Text':_0x147fd3,'LanguageCode':_0x4b916f[_0x6ca5('0xc')](0x0,0x2)},function(_0x492ed4,_0x1380f4){if(_0x492ed4){return _0x9aa61f(_0x492ed4);}else{return _0x52583a(_0x1380f4);}});});}function checkTranscribeJob(_0x56a888,_0x2eb3b9,_0x4fb08b){var _0x5dd594;return new BPromise(function(_0xecb81d,_0x4baa83){logger['info'](util[_0x6ca5('0xd')](_0x6ca5('0xe'),_0x56a888['id'],_0x56a888['transcribeName']));return getTranscriptionJob(_0x4fb08b[_0x6ca5('0xf')],_0x4fb08b[_0x6ca5('0x10')],_0x2eb3b9['transcribeRegion'],_0x56a888[_0x6ca5('0x11')])[_0x6ca5('0x12')](function(_0x1cdfdc){logger[_0x6ca5('0x13')](util[_0x6ca5('0xd')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x56a888['id'],_0x56a888[_0x6ca5('0x11')],_0x1cdfdc[_0x6ca5('0x14')]['TranscriptionJobStatus']));if(!_0x56a888[_0x6ca5('0x15')]){switch(_0x1cdfdc[_0x6ca5('0x14')]['TranscriptionJobStatus']){case _0x6ca5('0x16'):var _0x929bbf={'transcribeStatus':_0x1cdfdc[_0x6ca5('0x14')][_0x6ca5('0x17')],'fileUri':_0x1cdfdc[_0x6ca5('0x14')][_0x6ca5('0x18')]['TranscriptFileUri']};logger[_0x6ca5('0x13')](util[_0x6ca5('0xd')](_0x6ca5('0x19'),_0x56a888['id']));return rp({'uri':_0x1cdfdc[_0x6ca5('0x14')][_0x6ca5('0x18')][_0x6ca5('0x1a')],'json':!![]})[_0x6ca5('0x12')](function(_0x1f8119){logger[_0x6ca5('0x13')](util[_0x6ca5('0xd')](_0x6ca5('0x1b'),_0x56a888['id']));if(_0x1f8119&&_0x1f8119[_0x6ca5('0x1c')]&&_0x1f8119[_0x6ca5('0x1c')][_0x6ca5('0x1d')]&&_0x1f8119[_0x6ca5('0x1c')]['transcripts'][_0x6ca5('0x1e')]){_0x929bbf[_0x6ca5('0x15')]='';for(var _0x1a7b0f=0x0;_0x1a7b0f<_0x1f8119[_0x6ca5('0x1c')]['transcripts'][_0x6ca5('0x1e')];_0x1a7b0f++){_0x929bbf[_0x6ca5('0x15')]+=_0x1f8119[_0x6ca5('0x1c')][_0x6ca5('0x1d')][_0x1a7b0f][_0x6ca5('0x1f')]+'';}}return _0x56a888[_0x6ca5('0x20')](_0x929bbf);})[_0x6ca5('0x12')](function(){logger['info'](util[_0x6ca5('0xd')](_0x6ca5('0x21'),_0x56a888['id']));if(!_0x56a888[_0x6ca5('0x22')]){throw new db[(_0x6ca5('0x23'))][(_0x6ca5('0x24'))](_0x6ca5('0x25'));}if(!_0x2eb3b9['sentiment']||!_0x2eb3b9[_0x6ca5('0x26')]||!_0x2eb3b9[_0x6ca5('0x27')]||!_0x2eb3b9[_0x6ca5('0x28')]||!_0x2eb3b9[_0x6ca5('0x29')]){throw new db[(_0x6ca5('0x23'))][(_0x6ca5('0x24'))](_0x6ca5('0x2a'));}if(!_0x929bbf[_0x6ca5('0x15')]){throw new Error(_0x6ca5('0x2b'));}if(_0x2eb3b9[_0x6ca5('0x26')]===_0x4fb08b['id']){return _0x4fb08b;}else{return db[_0x6ca5('0x2c')][_0x6ca5('0x2d')]({'where':{'id':_settings[_0x6ca5('0x26')]}});}})[_0x6ca5('0x12')](function(_0x73314c){if(!_0x73314c){throw new db[(_0x6ca5('0x23'))][(_0x6ca5('0x24'))](_0x6ca5('0x2e'));}if(!_0x73314c[_0x6ca5('0xf')]||!_0x73314c[_0x6ca5('0x10')]){throw new db['Sequelize'][(_0x6ca5('0x24'))]('Cloud\x20Provider\x20not\x20configured');}_0x5dd594=_0x73314c;logger[_0x6ca5('0x13')](util[_0x6ca5('0xd')](_0x6ca5('0x2f'),_0x56a888['id']));return sentiment(_0x5dd594[_0x6ca5('0xf')],_0x5dd594['data2'],_0x2eb3b9[_0x6ca5('0x27')],_0x929bbf[_0x6ca5('0x15')],_0x2eb3b9[_0x6ca5('0x28')]);})[_0x6ca5('0x12')](function(_0xce09fb){logger[_0x6ca5('0x13')](util[_0x6ca5('0xd')](_0x6ca5('0x30'),_0x56a888['id']));return _0x56a888[_0x6ca5('0x20')]({'sentiment':_0xce09fb['Sentiment'],'sPositive':_0xce09fb[_0x6ca5('0x31')][_0x6ca5('0x32')],'sNegative':_0xce09fb[_0x6ca5('0x31')]['Negative'],'sMixed':_0xce09fb[_0x6ca5('0x31')][_0x6ca5('0x33')],'sNeutral':_0xce09fb[_0x6ca5('0x31')][_0x6ca5('0x34')]});})['then'](function(){logger[_0x6ca5('0x13')](util[_0x6ca5('0xd')](_0x6ca5('0x21'),_0x56a888['id']));_0xecb81d();});case _0x6ca5('0x35'):return _0x56a888[_0x6ca5('0x20')]({'transcribeStatus':'FAILED','failureReason':_0x1cdfdc[_0x6ca5('0x14')][_0x6ca5('0x36')]})[_0x6ca5('0x12')](function(){logger[_0x6ca5('0x13')](util['format'](_0x6ca5('0x21'),_0x56a888['id']));_0xecb81d();});default:logger[_0x6ca5('0x13')](util[_0x6ca5('0xd')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x56a888['id']));break;}}else{return BPromise[_0x6ca5('0x37')]()[_0x6ca5('0x12')](function(){if(!_0x56a888[_0x6ca5('0x22')]){throw new db[(_0x6ca5('0x23'))]['ValidationError'](_0x6ca5('0x25'));}if(!_0x2eb3b9[_0x6ca5('0x38')]||!_0x2eb3b9['sentimentAccountId']||!_0x2eb3b9[_0x6ca5('0x27')]||!_0x2eb3b9[_0x6ca5('0x28')]||!_0x2eb3b9[_0x6ca5('0x29')]){throw new db[(_0x6ca5('0x23'))][(_0x6ca5('0x24'))](_0x6ca5('0x2a'));}if(!_0x56a888[_0x6ca5('0x15')]){throw new Error(_0x6ca5('0x2b'));}if(_0x2eb3b9[_0x6ca5('0x26')]===_0x4fb08b['id']){return _0x4fb08b;}else{return db[_0x6ca5('0x2c')][_0x6ca5('0x2d')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x6ca5('0x12')](function(_0x1679d6){if(!_0x1679d6){throw new db[(_0x6ca5('0x23'))][(_0x6ca5('0x24'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1679d6[_0x6ca5('0xf')]||!_0x1679d6[_0x6ca5('0x10')]){throw new db['Sequelize'][(_0x6ca5('0x24'))](_0x6ca5('0x39'));}_0x5dd594=_0x1679d6;logger['info'](util[_0x6ca5('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x56a888['id']));return sentiment(_0x5dd594['data1'],_0x5dd594['data2'],_0x2eb3b9[_0x6ca5('0x27')],_0x56a888[_0x6ca5('0x15')],_0x2eb3b9[_0x6ca5('0x28')]);})[_0x6ca5('0x12')](function(_0x582a29){logger[_0x6ca5('0x13')](util[_0x6ca5('0xd')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x56a888['id']));return _0x56a888['update']({'sentiment':_0x582a29[_0x6ca5('0x3a')],'sPositive':_0x582a29[_0x6ca5('0x31')][_0x6ca5('0x32')],'sNegative':_0x582a29[_0x6ca5('0x31')][_0x6ca5('0x3b')],'sMixed':_0x582a29['SentimentScore'][_0x6ca5('0x33')],'sNeutral':_0x582a29[_0x6ca5('0x31')][_0x6ca5('0x34')],'transcribeStatus':_0x6ca5('0x16')});})[_0x6ca5('0x12')](function(){logger['info'](util['format'](_0x6ca5('0x21'),_0x56a888['id']));_0xecb81d();});}})['catch'](function(_0x23805b){if(_0x23805b){if(!_0x23805b[_0x6ca5('0x3c')]||_0x23805b['name']!==_0x6ca5('0x3d')){logger[_0x6ca5('0x3e')](util[_0x6ca5('0xd')](_0x6ca5('0x3f'),_0x56a888['id']),util['inspect'](_0x23805b,{'showHidden':![],'depth':null}));}}_0xecb81d();});});}function checkTranscribe(){var _0x3268cd;var _0x1ce99b;var _0x290c6c;return db[_0x6ca5('0x40')][_0x6ca5('0x41')]({'where':{'transcribeStatus':_0x6ca5('0x42')}})[_0x6ca5('0x12')](function(_0x11179c){if(!_0x11179c||!_0x11179c['length']){throw new db[(_0x6ca5('0x23'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x3268cd=_0x11179c;return db[_0x6ca5('0x43')][_0x6ca5('0x2d')]({'where':{'id':0x1}});})[_0x6ca5('0x12')](function(_0x555a52){if(!_0x555a52){throw new db[(_0x6ca5('0x23'))][(_0x6ca5('0x24'))](_0x6ca5('0x44'));}_0x1ce99b=_0x555a52;if(!_0x1ce99b[_0x6ca5('0x7')]||!_0x1ce99b[_0x6ca5('0x45')]||!_0x1ce99b[_0x6ca5('0x46')]||!_0x1ce99b['language']||!_0x1ce99b[_0x6ca5('0x29')]){throw new db['Sequelize'][(_0x6ca5('0x24'))](_0x6ca5('0x47'));}return db['CloudProvider'][_0x6ca5('0x2d')]({'where':{'id':_0x1ce99b['transcribeAccountId']}});})['then'](function(_0x355f77){if(!_0x355f77){throw new db[(_0x6ca5('0x23'))][(_0x6ca5('0x24'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x355f77[_0x6ca5('0xf')]||!_0x355f77[_0x6ca5('0x10')]){throw new db['Sequelize'][(_0x6ca5('0x24'))]('Cloud\x20Provider\x20not\x20configured');}_0x290c6c=_0x355f77;var _0x4406ee=[];_0x3268cd[_0x6ca5('0x48')](function(_0x4b6273){_0x4406ee[_0x6ca5('0x49')](checkTranscribeJob(_0x4b6273,_0x1ce99b,_0x290c6c));});return BPromise['all'](_0x4406ee);})[_0x6ca5('0x4a')](function(_0x120c28){if(_0x120c28){if(!_0x120c28[_0x6ca5('0x3c')]||_0x120c28[_0x6ca5('0x3c')]!==_0x6ca5('0x3d')){logger['error'](util['inspect'](_0x120c28,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x693f=['name','SequelizeValidationError','error','inspect','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','forEach','push','all','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','info','transcribeName','data1','data2','transcribeRegion','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','then','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','catch'];(function(_0x35368a,_0xef8286){var _0x39300a=function(_0x432280){while(--_0x432280){_0x35368a['push'](_0x35368a['shift']());}};_0x39300a(++_0xef8286);}(_0x693f,0x9d));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};var _=require(_0xf693('0x0'));var AWS=require(_0xf693('0x1'));var rp=require(_0xf693('0x2'));var util=require(_0xf693('0x3'));var BPromise=require('bluebird');var db=require(_0xf693('0x4'))['db'];var logger=require(_0xf693('0x5'))(_0xf693('0x6'));function getTranscriptionJob(_0x1d272f,_0x3d2e05,_0x6e749b,_0x42578c){return new Promise(function(_0x4b4d39,_0x1d3b17){var _0x33305c=new AWS['TranscribeService']({'accessKeyId':_0x3d2e05,'secretAccessKey':_0x1d272f,'region':_0x6e749b});_0x33305c[_0xf693('0x7')]({'TranscriptionJobName':_0x42578c},function(_0x594505,_0x38e78a){if(_0x594505){return _0x1d3b17(_0x594505);}else{return _0x4b4d39(_0x38e78a);}});});}function sentiment(_0x4ae88f,_0x3dfb0d,_0x17075d,_0x48984a,_0x4b09d6){return new Promise(function(_0x5d9159,_0x38b847){var _0x527cd9=new AWS[(_0xf693('0x8'))]({'accessKeyId':_0x3dfb0d,'secretAccessKey':_0x4ae88f,'region':_0x17075d});_0x527cd9[_0xf693('0x9')]({'Text':_0x48984a,'LanguageCode':_0x4b09d6[_0xf693('0xa')](0x0,0x2)},function(_0x1dc0da,_0x1f9205){if(_0x1dc0da){return _0x38b847(_0x1dc0da);}else{return _0x5d9159(_0x1f9205);}});});}function checkTranscribeJob(_0x5a5a35,_0x5d0d4c,_0xd08be1){var _0x38bd65;return new BPromise(function(_0x4c9ab7,_0x25d3f6){logger[_0xf693('0xb')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x5a5a35['id'],_0x5a5a35[_0xf693('0xc')]));return getTranscriptionJob(_0xd08be1[_0xf693('0xd')],_0xd08be1[_0xf693('0xe')],_0x5d0d4c[_0xf693('0xf')],_0x5a5a35[_0xf693('0xc')])['then'](function(_0x1d9278){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x11'),_0x5a5a35['id'],_0x5a5a35[_0xf693('0xc')],_0x1d9278[_0xf693('0x12')]['TranscriptionJobStatus']));if(!_0x5a5a35['fileText']){switch(_0x1d9278['TranscriptionJob'][_0xf693('0x13')]){case _0xf693('0x14'):var _0x3f4d4d={'transcribeStatus':_0x1d9278[_0xf693('0x12')][_0xf693('0x13')],'fileUri':_0x1d9278['TranscriptionJob'][_0xf693('0x15')][_0xf693('0x16')]};logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x17'),_0x5a5a35['id']));return rp({'uri':_0x1d9278[_0xf693('0x12')][_0xf693('0x15')][_0xf693('0x16')],'json':!![]})['then'](function(_0x505ada){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x18'),_0x5a5a35['id']));if(_0x505ada&&_0x505ada[_0xf693('0x19')]&&_0x505ada[_0xf693('0x19')][_0xf693('0x1a')]&&_0x505ada['results'][_0xf693('0x1a')][_0xf693('0x1b')]){_0x3f4d4d[_0xf693('0x1c')]='';for(var _0x414a3f=0x0;_0x414a3f<_0x505ada['results'][_0xf693('0x1a')][_0xf693('0x1b')];_0x414a3f++){_0x3f4d4d[_0xf693('0x1c')]+=_0x505ada[_0xf693('0x19')][_0xf693('0x1a')][_0x414a3f][_0xf693('0x1d')]+'';}}return _0x5a5a35[_0xf693('0x1e')](_0x3f4d4d);})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util[_0xf693('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5a5a35['id']));if(!_0x5a5a35[_0xf693('0x20')]){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x23'));}if(!_0x5d0d4c[_0xf693('0x24')]||!_0x5d0d4c[_0xf693('0x25')]||!_0x5d0d4c[_0xf693('0x26')]||!_0x5d0d4c[_0xf693('0x27')]||!_0x5d0d4c['bucket']){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x28'));}if(!_0x3f4d4d[_0xf693('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x5d0d4c['sentimentAccountId']===_0xd08be1['id']){return _0xd08be1;}else{return db[_0xf693('0x29')][_0xf693('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf693('0x1f')](function(_0x3f6bb5){if(!_0x3f6bb5){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3f6bb5[_0xf693('0xd')]||!_0x3f6bb5[_0xf693('0xe')]){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x2b'));}_0x38bd65=_0x3f6bb5;logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x2c'),_0x5a5a35['id']));return sentiment(_0x38bd65['data1'],_0x38bd65[_0xf693('0xe')],_0x5d0d4c[_0xf693('0x26')],_0x3f4d4d[_0xf693('0x1c')],_0x5d0d4c[_0xf693('0x27')]);})[_0xf693('0x1f')](function(_0x192f20){logger['info'](util['format'](_0xf693('0x2d'),_0x5a5a35['id']));return _0x5a5a35[_0xf693('0x1e')]({'sentiment':_0x192f20[_0xf693('0x2e')],'sPositive':_0x192f20['SentimentScore'][_0xf693('0x2f')],'sNegative':_0x192f20[_0xf693('0x30')][_0xf693('0x31')],'sMixed':_0x192f20[_0xf693('0x30')][_0xf693('0x32')],'sNeutral':_0x192f20['SentimentScore'][_0xf693('0x33')]});})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util['format'](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});case'FAILED':return _0x5a5a35[_0xf693('0x1e')]({'transcribeStatus':_0xf693('0x35'),'failureReason':_0x1d9278[_0xf693('0x12')][_0xf693('0x36')]})[_0xf693('0x1f')](function(){logger['info'](util[_0xf693('0x10')](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});default:logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x37'),_0x5a5a35['id']));break;}}else{return BPromise[_0xf693('0x38')]()[_0xf693('0x1f')](function(){if(!_0x5a5a35[_0xf693('0x20')]){throw new db[(_0xf693('0x21'))]['ValidationError'](_0xf693('0x23'));}if(!_0x5d0d4c['sentiment']||!_0x5d0d4c['sentimentAccountId']||!_0x5d0d4c[_0xf693('0x26')]||!_0x5d0d4c[_0xf693('0x27')]||!_0x5d0d4c[_0xf693('0x39')]){throw new db['Sequelize'][(_0xf693('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5a5a35[_0xf693('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x5d0d4c[_0xf693('0x25')]===_0xd08be1['id']){return _0xd08be1;}else{return db[_0xf693('0x29')][_0xf693('0x2a')]({'where':{'id':_settings[_0xf693('0x25')]}});}})[_0xf693('0x1f')](function(_0x47bc1b){if(!_0x47bc1b){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x47bc1b[_0xf693('0xd')]||!_0x47bc1b[_0xf693('0xe')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x38bd65=_0x47bc1b;logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x2c'),_0x5a5a35['id']));return sentiment(_0x38bd65[_0xf693('0xd')],_0x38bd65['data2'],_0x5d0d4c[_0xf693('0x26')],_0x5a5a35[_0xf693('0x1c')],_0x5d0d4c[_0xf693('0x27')]);})['then'](function(_0x40a47c){logger[_0xf693('0xb')](util['format'](_0xf693('0x2d'),_0x5a5a35['id']));return _0x5a5a35[_0xf693('0x1e')]({'sentiment':_0x40a47c['Sentiment'],'sPositive':_0x40a47c[_0xf693('0x30')][_0xf693('0x2f')],'sNegative':_0x40a47c['SentimentScore'][_0xf693('0x31')],'sMixed':_0x40a47c[_0xf693('0x30')][_0xf693('0x32')],'sNeutral':_0x40a47c[_0xf693('0x30')]['Neutral'],'transcribeStatus':_0xf693('0x14')});})[_0xf693('0x1f')](function(){logger[_0xf693('0xb')](util[_0xf693('0x10')](_0xf693('0x34'),_0x5a5a35['id']));_0x4c9ab7();});}})[_0xf693('0x3a')](function(_0x4a6266){if(_0x4a6266){if(!_0x4a6266[_0xf693('0x3b')]||_0x4a6266[_0xf693('0x3b')]!==_0xf693('0x3c')){logger[_0xf693('0x3d')](util[_0xf693('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x5a5a35['id']),util[_0xf693('0x3e')](_0x4a6266,{'showHidden':![],'depth':null}));}}_0x4c9ab7();});});}function checkTranscribe(){var _0x14e256;var _0x5b66a4;var _0x1952fb;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xf693('0x1f')](function(_0x178cca){if(!_0x178cca||!_0x178cca[_0xf693('0x1b')]){throw new db[(_0xf693('0x21'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x14e256=_0x178cca;return db[_0xf693('0x3f')]['findOne']({'where':{'id':0x1}});})[_0xf693('0x1f')](function(_0x2fe232){if(!_0x2fe232){throw new db[(_0xf693('0x21'))]['ValidationError'](_0xf693('0x40'));}_0x5b66a4=_0x2fe232;if(!_0x5b66a4[_0xf693('0x6')]||!_0x5b66a4[_0xf693('0x41')]||!_0x5b66a4[_0xf693('0xf')]||!_0x5b66a4[_0xf693('0x27')]||!_0x5b66a4[_0xf693('0x39')]){throw new db['Sequelize']['ValidationError'](_0xf693('0x42'));}return db['CloudProvider']['findOne']({'where':{'id':_0x5b66a4[_0xf693('0x41')]}});})[_0xf693('0x1f')](function(_0x4ed7fa){if(!_0x4ed7fa){throw new db[(_0xf693('0x21'))][(_0xf693('0x22'))](_0xf693('0x43'));}if(!_0x4ed7fa[_0xf693('0xd')]||!_0x4ed7fa['data2']){throw new db['Sequelize'][(_0xf693('0x22'))](_0xf693('0x2b'));}_0x1952fb=_0x4ed7fa;var _0x1361ac=[];_0x14e256[_0xf693('0x44')](function(_0x54fb64){_0x1361ac[_0xf693('0x45')](checkTranscribeJob(_0x54fb64,_0x5b66a4,_0x1952fb));});return BPromise[_0xf693('0x46')](_0x1361ac);})['catch'](function(_0x22044c){if(_0x22044c){if(!_0x22044c[_0xf693('0x3b')]||_0x22044c[_0xf693('0x3b')]!==_0xf693('0x3c')){logger[_0xf693('0x3d')](util[_0xf693('0x3e')](_0x22044c,{'showHidden':![],'depth':null}));}}});}exports[_0xf693('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 005fc56..fea14ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e1=['then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','schedule','defaults','localhost','socket.io-emitter','redis','findAll','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x34e1,0x1ca));var _0x134e=function(_0x4169a6,_0x5921c9){_0x4169a6=_0x4169a6-0x0;var _0x279e37=_0x34e1[_0x4169a6];return _0x279e37;};'use strict';var _=require(_0x134e('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x134e('0x1'));var config=require(_0x134e('0x2'));var db=require(_0x134e('0x3'))['db'];var logger=require('../logger')(_0x134e('0x4'));config['redis']=_[_0x134e('0x5')](config['redis'],{'host':_0x134e('0x6'),'port':0x18eb});var io=require(_0x134e('0x7'))(new Redis(config[_0x134e('0x8')]));function closeInteractions(){var _0x270e0b=[];return db['WhatsappInteraction'][_0x134e('0x9')]({'raw':!![],'attributes':['id',_0x134e('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x134e('0xb')](0x18,_0x134e('0xc'))}}})['then'](function(_0x36516d){if(_0x36516d&&_0x36516d[_0x134e('0xd')]){_0x270e0b=_[_0x134e('0xe')](_0x36516d||[],'id');logger[_0x134e('0xf')](_0x134e('0x10'),_0x270e0b[_0x134e('0x11')]());return db['WhatsappInteraction'][_0x134e('0x12')]({'closeReason':_0x134e('0x13'),'disposition':_0x134e('0x14'),'closed':!![],'closedAt':moment()['format'](_0x134e('0x15'))},{'where':{'id':_0x270e0b}});}})[_0x134e('0x16')](function(){if(_0x270e0b&&_0x270e0b[_0x134e('0xd')]){logger[_0x134e('0xf')](_0x134e('0x17'),_0x270e0b[_0x134e('0x11')]());for(var _0x437918=0x0;_0x437918<_0x270e0b[_0x134e('0xd')];_0x437918++){io['emit'](_0x134e('0x18'),{'id':_0x270e0b[_0x437918],'closed':!![]});}}})[_0x134e('0x19')](function(_0x2103cb){logger[_0x134e('0x1a')](_0x134e('0x1b'),_0x2103cb?util[_0x134e('0x1c')](_0x2103cb,{'showHidden':![],'depth':null}):'');});}exports[_0x134e('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xb11f=['findAll','lastMsgAt','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','emit','whatsappInteraction:update','catch','error','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xb11f,0xde));var _0xfb11=function(_0xd6b7a4,_0x5de400){_0xd6b7a4=_0xd6b7a4-0x0;var _0x341928=_0xb11f[_0xd6b7a4];return _0x341928;};'use strict';var _=require(_0xfb11('0x0'));var moment=require(_0xfb11('0x1'));var Redis=require('ioredis');var util=require(_0xfb11('0x2'));var config=require(_0xfb11('0x3'));var db=require(_0xfb11('0x4'))['db'];var logger=require(_0xfb11('0x5'))(_0xfb11('0x6'));config[_0xfb11('0x7')]=_[_0xfb11('0x8')](config[_0xfb11('0x7')],{'host':_0xfb11('0x9'),'port':0x18eb});var io=require(_0xfb11('0xa'))(new Redis(config[_0xfb11('0x7')]));function closeInteractions(){var _0x1398ee=[];return db[_0xfb11('0xb')][_0xfb11('0xc')]({'raw':!![],'attributes':['id',_0xfb11('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xfb11('0xe'))}}})[_0xfb11('0xf')](function(_0x56c564){if(_0x56c564&&_0x56c564[_0xfb11('0x10')]){_0x1398ee=_['map'](_0x56c564||[],'id');logger[_0xfb11('0x11')](_0xfb11('0x12'),_0x1398ee[_0xfb11('0x13')]());return db['WhatsappInteraction']['update']({'closeReason':_0xfb11('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1398ee}});}})[_0xfb11('0xf')](function(){if(_0x1398ee&&_0x1398ee['length']){logger[_0xfb11('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x1398ee['join']());for(var _0x211096=0x0;_0x211096<_0x1398ee[_0xfb11('0x10')];_0x211096++){io[_0xfb11('0x15')](_0xfb11('0x16'),{'id':_0x1398ee[_0x211096],'closed':!![]});}}})[_0xfb11('0x17')](function(_0x137937){logger[_0xfb11('0x18')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x137937?util['inspect'](_0x137937,{'showHidden':![],'depth':null}):'');});}exports[_0xfb11('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index f25545f..09b0758 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1920=['push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','destroy','CmHopper','hopper1','contacts2','hopper2','catch','util'];(function(_0x2b5bbb,_0x1837e4){var _0x54b012=function(_0x3576c0){while(--_0x3576c0){_0x2b5bbb['push'](_0x2b5bbb['shift']());}};_0x54b012(++_0x1837e4);}(_0x1920,0x84));var _0x0192=function(_0x1410bc,_0x25fcc0){_0x1410bc=_0x1410bc-0x0;var _0xebee1b=_0x1920[_0x1410bc];return _0xebee1b;};'use strict';var util=require(_0x0192('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0192('0x1')]({'id':i,'firstName':_0x0192('0x2')+i,'lastName':_0x0192('0x3')+i,'phone':0xf879fb460+i,'email':_0x0192('0x4')+i+_0x0192('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0192('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0192('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0192('0x6')](),'updatedAt':Date[_0x0192('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0192('0x1')]({'id':i,'firstName':_0x0192('0x2')+i,'lastName':_0x0192('0x3')+i,'phone':0xf879fb460+i,'email':_0x0192('0x4')+i+_0x0192('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0192('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0192('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x0192('0x6')]()});}db[_0x0192('0x7')]['destroy']({'where':{}})[_0x0192('0x8')](function(){return db[_0x0192('0x7')][_0x0192('0x9')](contacts);})[_0x0192('0x8')](function(){console[_0x0192('0xa')](_0x0192('0xb'),_0x0192('0xc'));return db['CmHopper'][_0x0192('0xd')]({'where':{}});})[_0x0192('0x8')](function(){return db[_0x0192('0xe')][_0x0192('0x9')](hopper);})[_0x0192('0x8')](function(){console[_0x0192('0xa')](_0x0192('0xb'),_0x0192('0xf'));return db[_0x0192('0x7')][_0x0192('0x9')](contacts2);})['then'](function(){console[_0x0192('0xa')](_0x0192('0xb'),_0x0192('0x10'));return db['CmHopper'][_0x0192('0x9')](hopper2);})['then'](function(){console[_0x0192('0xa')](_0x0192('0xb'),_0x0192('0x11'));})[_0x0192('0x12')](function(_0x491419){console['log'](_0x491419);});
\ No newline at end of file
+var _0xf416=['hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','finished\x20populating','contacts1','CmHopper','log'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf416,0xd4));var _0x6f41=function(_0x4481d9,_0x422afd){_0x4481d9=_0x4481d9-0x0;var _0x3bc18e=_0xf416[_0x4481d9];return _0x3bc18e;};'use strict';var util=require(_0x6f41('0x0'));var db=require(_0x6f41('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6f41('0x2')]({'id':i,'firstName':_0x6f41('0x3')+i,'lastName':_0x6f41('0x4')+i,'phone':0xf879fb460+i,'email':_0x6f41('0x5')+i+_0x6f41('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6f41('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6f41('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6f41('0x7')](),'updatedAt':Date[_0x6f41('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6f41('0x2')]({'id':i,'firstName':_0x6f41('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6f41('0x5')+i+_0x6f41('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6f41('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6f41('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6f41('0x7')](),'updatedAt':Date['now']()});}db[_0x6f41('0x8')][_0x6f41('0x9')]({'where':{}})[_0x6f41('0xa')](function(){return db[_0x6f41('0x8')][_0x6f41('0xb')](contacts);})[_0x6f41('0xa')](function(){console['log'](_0x6f41('0xc'),_0x6f41('0xd'));return db[_0x6f41('0xe')][_0x6f41('0x9')]({'where':{}});})['then'](function(){return db[_0x6f41('0xe')][_0x6f41('0xb')](hopper);})[_0x6f41('0xa')](function(){console[_0x6f41('0xf')](_0x6f41('0xc'),_0x6f41('0x10'));return db['CmContact']['bulkCreate'](contacts2);})[_0x6f41('0xa')](function(){console[_0x6f41('0xf')](_0x6f41('0xc'),_0x6f41('0x11'));return db[_0x6f41('0xe')]['bulkCreate'](hopper2);})[_0x6f41('0xa')](function(){console[_0x6f41('0xf')](_0x6f41('0xc'),_0x6f41('0x12'));})['catch'](function(_0x1616f4){console['log'](_0x1616f4);});
\ No newline at end of file
index 3308ed2..9ee28ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45f5=['password','friend','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','add\x20user','catch','log','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com'];(function(_0x51a388,_0x56b32d){var _0x541b8b=function(_0x19be21){while(--_0x19be21){_0x51a388['push'](_0x51a388['shift']());}};_0x541b8b(++_0x56b32d);}(_0x45f5,0x13a));var _0x545f=function(_0x1cec84,_0x101ec2){_0x1cec84=_0x1cec84-0x0;var _0x12b7d3=_0x45f5[_0x1cec84];return _0x12b7d3;};'use strict';var util=require(_0x545f('0x0'));var db=require(_0x545f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x545f('0x2')](_0x545f('0x3'),_0x545f('0x4'),i),'fullname':util[_0x545f('0x2')](_0x545f('0x3'),_0x545f('0x4'),i),'email':util[_0x545f('0x2')](_0x545f('0x5'),'agent',i),'role':_0x545f('0x4'),'password':_0x545f('0x6'),'internal':0xfa0+i,'type':_0x545f('0x7'),'transport':['udp','ws','wss'],'disallow':[_0x545f('0x8')],'allow':[_0x545f('0x9')],'defaultuser':util['format']('%s%s',_0x545f('0x4'),i),'encryption':'yes','avpf':_0x545f('0xa'),'force_avp':_0x545f('0xa'),'icesupport':'yes','dtlsenable':_0x545f('0xa'),'dtlsverify':'no','dtlscertfile':_0x545f('0xb'),'dtlsprivatekey':_0x545f('0xc'),'dtlssetup':_0x545f('0xd'),'callerid':util[_0x545f('0x2')](_0x545f('0xe'),util[_0x545f('0x2')](_0x545f('0x3'),'agent',i),0xfa0+i)});}db[_0x545f('0xf')][_0x545f('0x10')](users)['then'](function(){console['log'](_0x545f('0x11'));})[_0x545f('0x12')](function(_0x15a8da){console[_0x545f('0x13')](_0x15a8da);});
\ No newline at end of file
+var _0x9d07=['catch','util','../mysqldb','push','%s%s','format','agent','%s%s@xcally.com','friend','udp','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user'];(function(_0x51e9ee,_0x58d1f9){var _0x349834=function(_0x5af607){while(--_0x5af607){_0x51e9ee['push'](_0x51e9ee['shift']());}};_0x349834(++_0x58d1f9);}(_0x9d07,0x144));var _0x79d0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9d07[_0x160c73];return _0xd9302;};'use strict';var util=require(_0x79d0('0x0'));var db=require(_0x79d0('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x79d0('0x2')]({'name':util['format'](_0x79d0('0x3'),'agent',i),'fullname':util[_0x79d0('0x4')]('%s%s',_0x79d0('0x5'),i),'email':util[_0x79d0('0x4')](_0x79d0('0x6'),_0x79d0('0x5'),i),'role':_0x79d0('0x5'),'password':'password','internal':0xfa0+i,'type':_0x79d0('0x7'),'transport':[_0x79d0('0x8'),'ws','wss'],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x79d0('0x4')](_0x79d0('0x3'),_0x79d0('0x5'),i),'encryption':_0x79d0('0x9'),'avpf':_0x79d0('0x9'),'force_avp':_0x79d0('0x9'),'icesupport':_0x79d0('0x9'),'dtlsenable':_0x79d0('0x9'),'dtlsverify':'no','dtlscertfile':_0x79d0('0xa'),'dtlsprivatekey':_0x79d0('0xb'),'dtlssetup':_0x79d0('0xc'),'callerid':util[_0x79d0('0x4')](_0x79d0('0xd'),util[_0x79d0('0x4')](_0x79d0('0x3'),_0x79d0('0x5'),i),0xfa0+i)});}db[_0x79d0('0xe')]['bulkCreate'](users)[_0x79d0('0xf')](function(){console[_0x79d0('0x10')](_0x79d0('0x11'));})[_0x79d0('0x12')](function(_0x17d045){console[_0x79d0('0x10')](_0x17d045);});
\ No newline at end of file
index 709bc54..183504d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a1c=['address','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','bluebird','../mysqldb','./environment','User','name','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','resourceId','then','map','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','ChatInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','include','VoiceQueue','push','FaxQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:outbound','userProfileId','ChatQueues','SmsQueue','MailQueue','OpenchannelQueues','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','voice','chat','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','setMaxListeners'];(function(_0x6cd702,_0x1dd736){var _0x1d3b4e=function(_0x4e3552){while(--_0x4e3552){_0x6cd702['push'](_0x6cd702['shift']());}};_0x1d3b4e(++_0x1dd736);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x0a1c[_0x47e7cb];return _0x2a8874;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xc0a1('0x0'));var db=require(_0xc0a1('0x1'))['db'];var config=require(_0xc0a1('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0xc0a1('0x3')],'attributes':['id',_0xc0a1('0x4'),_0xc0a1('0x5')],'raw':!![],'where':{'role':_0xc0a1('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc0a1('0x4')],'where':{'role':_0xc0a1('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc0a1('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xc0a1('0x4')],'where':{'role':_0xc0a1('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc0a1('0x4'),_0xc0a1('0x8')],'where':{'type':_0xc0a1('0x9')}};function getAssociatedResources(_0x14e116,_0x2cfd8a,_0x38ed7b){return db[_0xc0a1('0xa')][_0xc0a1('0xb')]({'where':{'name':_0x14e116,'userProfileId':_0x2cfd8a},'raw':!![]})['then'](function(_0x9457ef){if(_0x9457ef){if(_0x9457ef[_0xc0a1('0xc')]){switch(_0x14e116){case _0xc0a1('0xd'):case'ChatQueues':case _0xc0a1('0xe'):case _0xc0a1('0xf'):case _0xc0a1('0x10'):case'OpenchannelQueues':case _0xc0a1('0x11'):return db[_0x38ed7b][_0xc0a1('0x12')](queryQueues);case'Telephones':return db[_0x38ed7b][_0xc0a1('0x12')](queryTelephones);case _0xc0a1('0x13'):return db[_0x38ed7b][_0xc0a1('0x12')](queryTrunks);case _0xc0a1('0x14'):return db[_0x38ed7b][_0xc0a1('0x12')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0xc0a1('0x15')],'where':{'sectionId':_0x9457ef['id']},'raw':!![]})[_0xc0a1('0x16')](function(_0x49a97c){if(_0x49a97c){var _0x5a3e1d={'where':{'id':_[_0xc0a1('0x17')](_0x49a97c,_0xc0a1('0x15'))},'raw':!![]};switch(_0x38ed7b){case'User':_0x5a3e1d[_0xc0a1('0x18')][_0xc0a1('0x5')]=_0xc0a1('0x7');break;case _0xc0a1('0x19'):_0x5a3e1d[_0xc0a1('0x18')][_0xc0a1('0x8')]=_0xc0a1('0x9');break;}return db[_0x38ed7b][_0xc0a1('0x12')](_0x5a3e1d);}else{return[];}});}}else{return[];}})[_0xc0a1('0x16')](function(_0x36acc2){return _0x36acc2;});}function joinOrLeaveQueues(_0x1e02aa,_0x26ca3c,_0x260571,_0x398c6a){_0x1e02aa[_0x26ca3c](util[_0xc0a1('0x1a')](_0xc0a1('0x1b'),_0x260571,_0x398c6a['name']));if(_0x398c6a[_0xc0a1('0x1c')]){for(var _0x4f0f02=0x0;_0x4f0f02<_0x398c6a[_0xc0a1('0x1c')][_0xc0a1('0x1d')];_0x4f0f02+=0x1){_0x1e02aa[_0x26ca3c](util[_0xc0a1('0x1a')](_0xc0a1('0x1e'),_0x398c6a[_0xc0a1('0x1c')][_0x4f0f02]['name']));}}}function joinOrLeave(_0x20a8d7,_0x1ae706,_0x247179){var _0x3e7997;if(_0x20a8d7[_0xc0a1('0x1f')][_0xc0a1('0x20')]['id']){db[_0xc0a1('0x3')][_0xc0a1('0x21')]({'attributes':['id',_0xc0a1('0x4'),_0xc0a1('0x5'),'userProfileId'],'where':{'id':_0x20a8d7['handshake'][_0xc0a1('0x20')]['id']},'include':[{'model':db[_0xc0a1('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xc0a1('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xc0a1('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc0a1('0x25')],'as':_0xc0a1('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xc0a1('0x27')],'as':_0xc0a1('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xc0a1('0x29')],'as':_0xc0a1('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xc0a1('0x16')](function(_0x2bc99f){if(_0x2bc99f){_0x3e7997=_0x2bc99f;_0x20a8d7[_0x1ae706](util['format'](_0xc0a1('0x1e'),_0x2bc99f[_0xc0a1('0x4')]));var _0xa6fa30=[];switch(_0x2bc99f[_0xc0a1('0x5')]){case _0xc0a1('0x2b'):_0x20a8d7[_0x1ae706](_0xc0a1('0x2c'));_0x20a8d7[_0x1ae706]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xc0a1('0x2d'))){delete queryQueues[_0xc0a1('0x2d')];}_0xa6fa30['push'](db[_0xc0a1('0x2e')]['findAll'](queryQueues));_0xa6fa30[_0xc0a1('0x2f')](db['ChatQueue'][_0xc0a1('0x12')](queryQueues));_0xa6fa30[_0xc0a1('0x2f')](db[_0xc0a1('0x30')]['findAll'](queryQueues));_0xa6fa30[_0xc0a1('0x2f')](db['SmsQueue'][_0xc0a1('0x12')](queryQueues));_0xa6fa30[_0xc0a1('0x2f')](db['MailQueue'][_0xc0a1('0x12')](queryQueues));_0xa6fa30[_0xc0a1('0x2f')](db[_0xc0a1('0x31')][_0xc0a1('0x12')](queryQueues));_0xa6fa30[_0xc0a1('0x2f')](db[_0xc0a1('0x32')]['findAll'](queryQueues));_0xa6fa30[_0xc0a1('0x2f')](db[_0xc0a1('0x3')][_0xc0a1('0x12')](queryTelephones));_0xa6fa30[_0xc0a1('0x2f')](db[_0xc0a1('0x33')][_0xc0a1('0x12')](queryTrunks));_0xa6fa30['push'](db['Campaign'][_0xc0a1('0x12')](queryCampaigns));_0xa6fa30[_0xc0a1('0x2f')](db[_0xc0a1('0x3')]['findAll'](queryAgents));break;case'user':_0x20a8d7[_0x1ae706](_0xc0a1('0x2c'));_0x20a8d7[_0x1ae706](_0xc0a1('0x34'));_0xa6fa30[_0xc0a1('0x2f')](getAssociatedResources('VoiceQueues',_0x2bc99f[_0xc0a1('0x35')],_0xc0a1('0x2e')));_0xa6fa30['push'](getAssociatedResources(_0xc0a1('0x36'),_0x2bc99f[_0xc0a1('0x35')],'ChatQueue'));_0xa6fa30[_0xc0a1('0x2f')](getAssociatedResources(_0xc0a1('0xe'),_0x2bc99f[_0xc0a1('0x35')],_0xc0a1('0x30')));_0xa6fa30[_0xc0a1('0x2f')](getAssociatedResources(_0xc0a1('0xf'),_0x2bc99f[_0xc0a1('0x35')],_0xc0a1('0x37')));_0xa6fa30['push'](getAssociatedResources('MailQueues',_0x2bc99f[_0xc0a1('0x35')],_0xc0a1('0x38')));_0xa6fa30['push'](getAssociatedResources(_0xc0a1('0x39'),_0x2bc99f[_0xc0a1('0x35')],_0xc0a1('0x31')));_0xa6fa30[_0xc0a1('0x2f')](getAssociatedResources(_0xc0a1('0x11'),_0x2bc99f[_0xc0a1('0x35')],'WhatsappQueue'));_0xa6fa30[_0xc0a1('0x2f')](getAssociatedResources(_0xc0a1('0x3a'),_0x2bc99f['userProfileId'],_0xc0a1('0x3')));_0xa6fa30[_0xc0a1('0x2f')](getAssociatedResources(_0xc0a1('0x13'),_0x2bc99f[_0xc0a1('0x35')],_0xc0a1('0x33')));_0xa6fa30[_0xc0a1('0x2f')](getAssociatedResources(_0xc0a1('0x14'),_0x2bc99f['userProfileId'],'Campaign'));_0xa6fa30[_0xc0a1('0x2f')](db['User'][_0xc0a1('0x12')](queryAgents));break;case'agent':_0x20a8d7[_0x1ae706]('voice:inbound');_0x20a8d7[_0x1ae706](_0xc0a1('0x34'));_0xa6fa30[_0xc0a1('0x2f')](_0x2bc99f[_0xc0a1('0x3b')]({'attributes':['id',_0xc0a1('0x4')]}));_0xa6fa30[_0xc0a1('0x2f')](_0x2bc99f[_0xc0a1('0x3c')]({'attributes':['id',_0xc0a1('0x4')]}));_0xa6fa30[_0xc0a1('0x2f')](_0x2bc99f[_0xc0a1('0x3d')]({'attributes':['id',_0xc0a1('0x4')]}));_0xa6fa30[_0xc0a1('0x2f')](_0x2bc99f[_0xc0a1('0x3e')]({'attributes':['id',_0xc0a1('0x4')]}));_0xa6fa30[_0xc0a1('0x2f')](_0x2bc99f[_0xc0a1('0x3f')]({'attributes':['id',_0xc0a1('0x4')]}));_0xa6fa30['push'](_0x2bc99f[_0xc0a1('0x40')]({'attributes':['id',_0xc0a1('0x4')]}));_0xa6fa30['push'](_0x2bc99f['getWhatsappQueues']({'attributes':['id',_0xc0a1('0x4')]}));break;}return BPromise['all'](_0xa6fa30);}})[_0xc0a1('0x16')](function(_0x1bc504){if(_0x1bc504&&_0x1bc504[_0xc0a1('0x1d')]){for(var _0x5cde6e=0x0;_0x5cde6e<_0x1bc504[_0xc0a1('0x1d')];_0x5cde6e+=0x1){for(var _0x3256db=0x0;_0x3256db<_0x1bc504[_0x5cde6e]['length'];_0x3256db+=0x1){switch(_0x5cde6e){case 0x0:joinOrLeaveQueues(_0x20a8d7,_0x1ae706,_0xc0a1('0x41'),_0x1bc504[_0x5cde6e][_0x3256db]);break;case 0x1:joinOrLeaveQueues(_0x20a8d7,_0x1ae706,_0xc0a1('0x42'),_0x1bc504[_0x5cde6e][_0x3256db]);break;case 0x2:joinOrLeaveQueues(_0x20a8d7,_0x1ae706,'fax',_0x1bc504[_0x5cde6e][_0x3256db]);break;case 0x3:joinOrLeaveQueues(_0x20a8d7,_0x1ae706,'sms',_0x1bc504[_0x5cde6e][_0x3256db]);break;case 0x4:joinOrLeaveQueues(_0x20a8d7,_0x1ae706,_0xc0a1('0x43'),_0x1bc504[_0x5cde6e][_0x3256db]);break;case 0x5:joinOrLeaveQueues(_0x20a8d7,_0x1ae706,_0xc0a1('0x44'),_0x1bc504[_0x5cde6e][_0x3256db]);break;case 0x6:joinOrLeaveQueues(_0x20a8d7,_0x1ae706,'whatsapp',_0x1bc504[_0x5cde6e][_0x3256db]);break;case 0x7:if(_0x3e7997[_0xc0a1('0x5')]!==_0xc0a1('0x6'))_0x20a8d7[_0x1ae706](util[_0xc0a1('0x1a')](_0xc0a1('0x45'),_0x1bc504[_0x5cde6e][_0x3256db]['name']));break;case 0x8:if(_0x3e7997['role']!==_0xc0a1('0x6'))_0x20a8d7[_0x1ae706](util['format'](_0xc0a1('0x46'),_0x1bc504[_0x5cde6e][_0x3256db]['name']));break;case 0x9:if(_0x3e7997[_0xc0a1('0x5')]!=='agent')_0x20a8d7[_0x1ae706](util[_0xc0a1('0x1a')](_0xc0a1('0x47'),_0x1bc504[_0x5cde6e][_0x3256db]['type'],_0x1bc504[_0x5cde6e][_0x3256db][_0xc0a1('0x4')]));break;case 0xa:_0x20a8d7[_0x1ae706](util[_0xc0a1('0x1a')](_0xc0a1('0x1e'),_0x1bc504[_0x5cde6e][_0x3256db][_0xc0a1('0x4')]));break;}}}}})[_0xc0a1('0x16')](function(){if(_0x1ae706==='leave'){var _0x5944aa=_[_0xc0a1('0x17')](_0x3e7997['ChatInteractions'],'id');return _0x3e7997[_0xc0a1('0x48')](_0x5944aa)['then'](function(){for(var _0x38a2c7=0x0;_0x38a2c7<_0x5944aa[_0xc0a1('0x1d')];_0x38a2c7+=0x1){_0x247179[_0xc0a1('0x49')](_0xc0a1('0x4a'),{'ChatInteractionId':Number(_0x5944aa[_0x38a2c7]),'UserId':Number(_0x3e7997['id'])});}});}})[_0xc0a1('0x16')](function(){if(_0x1ae706===_0xc0a1('0x4b')){var _0x2c9555=_[_0xc0a1('0x17')](_0x3e7997[_0xc0a1('0x23')],'id');return _0x3e7997[_0xc0a1('0x4c')](_0x2c9555)[_0xc0a1('0x16')](function(){for(var _0x3da40a=0x0;_0x3da40a<_0x2c9555[_0xc0a1('0x1d')];_0x3da40a+=0x1){_0x247179[_0xc0a1('0x49')](_0xc0a1('0x4d'),{'MailInteractionId':Number(_0x2c9555[_0x3da40a]),'UserId':Number(_0x3e7997['id'])});}});}})[_0xc0a1('0x16')](function(){if(_0x1ae706===_0xc0a1('0x4b')){var _0x58e4b6=_['map'](_0x3e7997[_0xc0a1('0x4e')],'id');return _0x3e7997[_0xc0a1('0x4f')](_0x58e4b6)[_0xc0a1('0x16')](function(){for(var _0x3d37d1=0x0;_0x3d37d1<_0x58e4b6[_0xc0a1('0x1d')];_0x3d37d1+=0x1){_0x247179[_0xc0a1('0x49')](_0xc0a1('0x50'),{'FaxInteractionId':Number(_0x58e4b6[_0x3d37d1]),'UserId':Number(_0x3e7997['id'])});}});}})[_0xc0a1('0x16')](function(){if(_0x1ae706===_0xc0a1('0x4b')){var _0x5ac979=_[_0xc0a1('0x17')](_0x3e7997[_0xc0a1('0x26')],'id');return _0x3e7997[_0xc0a1('0x51')](_0x5ac979)[_0xc0a1('0x16')](function(){for(var _0x52aeb0=0x0;_0x52aeb0<_0x5ac979[_0xc0a1('0x1d')];_0x52aeb0+=0x1){_0x247179[_0xc0a1('0x49')](_0xc0a1('0x52'),{'SmsInteractionId':Number(_0x5ac979[_0x52aeb0]),'UserId':Number(_0x3e7997['id'])});}});}})['then'](function(){if(_0x1ae706===_0xc0a1('0x4b')){var _0x554a4e=_[_0xc0a1('0x17')](_0x3e7997[_0xc0a1('0x28')],'id');return _0x3e7997['removeOpenchannelInteractions'](_0x554a4e)[_0xc0a1('0x16')](function(){for(var _0x5927fe=0x0;_0x5927fe<_0x554a4e['length'];_0x5927fe+=0x1){_0x247179[_0xc0a1('0x49')](_0xc0a1('0x53'),{'OpenchannelInteractionId':Number(_0x554a4e[_0x5927fe]),'UserId':Number(_0x3e7997['id'])});}});}})[_0xc0a1('0x16')](function(){if(_0x1ae706===_0xc0a1('0x4b')){var _0x5be7ee=_['map'](_0x3e7997['WhatsappInteractions'],'id');return _0x3e7997[_0xc0a1('0x54')](_0x5be7ee)['then'](function(){for(var _0x1c1b15=0x0;_0x1c1b15<_0x5be7ee[_0xc0a1('0x1d')];_0x1c1b15+=0x1){_0x247179[_0xc0a1('0x49')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x5be7ee[_0x1c1b15]),'UserId':Number(_0x3e7997['id'])});}});}})[_0xc0a1('0x55')](function(_0x246a05){_0x20a8d7[_0xc0a1('0x56')](_0x246a05);});}}function onDisconnect(_0x11ff04,_0x33a06b){joinOrLeave(_0x11ff04,'leave',_0x33a06b);}function onConnect(_0x29a2e7){joinOrLeave(_0x29a2e7,_0xc0a1('0x57'));}exports[_0xc0a1('0x58')]=function(_0x5005ba){_0x5005ba['on']('connection',function(_0x5e3450){_0x5e3450[_0xc0a1('0x59')](0x0);_0x5e3450[_0xc0a1('0x5a')]=_0x5e3450[_0xc0a1('0x5b')][_0xc0a1('0x5c')][_0xc0a1('0x5d')]+':'+_0x5e3450[_0xc0a1('0x5b')][_0xc0a1('0x5c')][_0xc0a1('0x5e')];_0x5e3450[_0xc0a1('0x5f')]=new Date();_0x5e3450[_0xc0a1('0x56')]=function(_0x50cdc2){console[_0xc0a1('0x56')](_0xc0a1('0x60')+_0x5e3450[_0xc0a1('0x61')][_0xc0a1('0x4')]+'['+_0x5e3450[_0xc0a1('0x5a')]+']',_0x50cdc2);};_0x5e3450['on'](_0xc0a1('0x62'),function(){onDisconnect(_0x5e3450,_0x5005ba);_0x5e3450[_0xc0a1('0x56')]('DISCONNECTED');});onConnect(_0x5e3450);_0x5e3450[_0xc0a1('0x56')](_0xc0a1('0x63'));});};
\ No newline at end of file
+var _0xc43c=['SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','bluebird','Agents','agent','name','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','UserProfileResource','resourceId','map','User','role','Campaign','%s:queue:%s','format','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','userProfileId','IvrCampaigns','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt'];(function(_0x75ea2d,_0x229909){var _0x50b6a2=function(_0x37582a){while(--_0x37582a){_0x75ea2d['push'](_0x75ea2d['shift']());}};_0x50b6a2(++_0x229909);}(_0xc43c,0xd4));var _0xcc43=function(_0x459936,_0x3b5617){_0x459936=_0x459936-0x0;var _0x46677f=_0xc43c[_0x459936];return _0x46677f;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var BPromise=require(_0xcc43('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0xcc43('0x3'),'model':db['User'],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0xcc43('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xcc43('0x5')],'where':{'role':_0xcc43('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xcc43('0x5')],'where':{'role':_0xcc43('0x4')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xcc43('0x5'),_0xcc43('0x7')],'where':{'type':_0xcc43('0x8')}};function getAssociatedResources(_0x327c4e,_0x3d0462,_0xd311b1){return db['UserProfileSection'][_0xcc43('0x9')]({'where':{'name':_0x327c4e,'userProfileId':_0x3d0462},'raw':!![]})[_0xcc43('0xa')](function(_0x2656bc){if(_0x2656bc){if(_0x2656bc[_0xcc43('0xb')]){switch(_0x327c4e){case _0xcc43('0xc'):case _0xcc43('0xd'):case _0xcc43('0xe'):case _0xcc43('0xf'):case _0xcc43('0x10'):case _0xcc43('0x11'):case _0xcc43('0x12'):return db[_0xd311b1]['findAll'](queryQueues);case _0xcc43('0x13'):return db[_0xd311b1][_0xcc43('0x14')](queryTelephones);case _0xcc43('0x15'):return db[_0xd311b1][_0xcc43('0x14')](queryTrunks);case'IvrCampaigns':return db[_0xd311b1][_0xcc43('0x14')](queryCampaigns);}}else{return db[_0xcc43('0x16')][_0xcc43('0x14')]({'attributes':[_0xcc43('0x17')],'where':{'sectionId':_0x2656bc['id']},'raw':!![]})[_0xcc43('0xa')](function(_0x538d67){if(_0x538d67){var _0x2e2a21={'where':{'id':_[_0xcc43('0x18')](_0x538d67,'resourceId')},'raw':!![]};switch(_0xd311b1){case _0xcc43('0x19'):_0x2e2a21['where'][_0xcc43('0x1a')]=_0xcc43('0x6');break;case _0xcc43('0x1b'):_0x2e2a21['where'][_0xcc43('0x7')]=_0xcc43('0x8');break;}return db[_0xd311b1][_0xcc43('0x14')](_0x2e2a21);}else{return[];}});}}else{return[];}})[_0xcc43('0xa')](function(_0x485d14){return _0x485d14;});}function joinOrLeaveQueues(_0x2d526e,_0x42e028,_0x57bd2d,_0x7ec240){_0x2d526e[_0x42e028](util['format'](_0xcc43('0x1c'),_0x57bd2d,_0x7ec240['name']));if(_0x7ec240[_0xcc43('0x3')]){for(var _0x2a604e=0x0;_0x2a604e<_0x7ec240[_0xcc43('0x3')]['length'];_0x2a604e+=0x1){_0x2d526e[_0x42e028](util[_0xcc43('0x1d')]('user:%s',_0x7ec240[_0xcc43('0x3')][_0x2a604e][_0xcc43('0x5')]));}}}function joinOrLeave(_0x3fd749,_0x948783,_0x36b655){var _0x5b9195;if(_0x3fd749[_0xcc43('0x1e')][_0xcc43('0x1f')]['id']){db['User'][_0xcc43('0x20')]({'attributes':['id',_0xcc43('0x5'),_0xcc43('0x1a'),'userProfileId'],'where':{'id':_0x3fd749[_0xcc43('0x1e')]['query']['id']},'include':[{'model':db[_0xcc43('0x21')],'as':_0xcc43('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xcc43('0x23')],'as':_0xcc43('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xcc43('0x25')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xcc43('0x26')],'as':_0xcc43('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xcc43('0x28')],'as':_0xcc43('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xcc43('0x2a')],'as':_0xcc43('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x17acce){if(_0x17acce){_0x5b9195=_0x17acce;_0x3fd749[_0x948783](util[_0xcc43('0x1d')](_0xcc43('0x2c'),_0x17acce[_0xcc43('0x5')]));var _0x532526=[];switch(_0x17acce[_0xcc43('0x1a')]){case _0xcc43('0x2d'):_0x3fd749[_0x948783](_0xcc43('0x2e'));_0x3fd749[_0x948783](_0xcc43('0x2f'));if(queryQueues['hasOwnProperty'](_0xcc43('0x30'))){delete queryQueues[_0xcc43('0x30')];}_0x532526[_0xcc43('0x31')](db[_0xcc43('0x32')]['findAll'](queryQueues));_0x532526['push'](db[_0xcc43('0x33')][_0xcc43('0x14')](queryQueues));_0x532526[_0xcc43('0x31')](db[_0xcc43('0x34')][_0xcc43('0x14')](queryQueues));_0x532526[_0xcc43('0x31')](db[_0xcc43('0x35')][_0xcc43('0x14')](queryQueues));_0x532526['push'](db[_0xcc43('0x36')]['findAll'](queryQueues));_0x532526['push'](db[_0xcc43('0x37')][_0xcc43('0x14')](queryQueues));_0x532526[_0xcc43('0x31')](db[_0xcc43('0x38')][_0xcc43('0x14')](queryQueues));_0x532526['push'](db['User']['findAll'](queryTelephones));_0x532526['push'](db[_0xcc43('0x39')][_0xcc43('0x14')](queryTrunks));_0x532526[_0xcc43('0x31')](db['Campaign'][_0xcc43('0x14')](queryCampaigns));_0x532526[_0xcc43('0x31')](db[_0xcc43('0x19')]['findAll'](queryAgents));break;case _0xcc43('0x3a'):_0x3fd749[_0x948783](_0xcc43('0x2e'));_0x3fd749[_0x948783]('voice:outbound');_0x532526[_0xcc43('0x31')](getAssociatedResources(_0xcc43('0xc'),_0x17acce[_0xcc43('0x3b')],_0xcc43('0x32')));_0x532526[_0xcc43('0x31')](getAssociatedResources(_0xcc43('0xd'),_0x17acce[_0xcc43('0x3b')],_0xcc43('0x33')));_0x532526[_0xcc43('0x31')](getAssociatedResources(_0xcc43('0xe'),_0x17acce[_0xcc43('0x3b')],_0xcc43('0x34')));_0x532526[_0xcc43('0x31')](getAssociatedResources(_0xcc43('0xf'),_0x17acce['userProfileId'],_0xcc43('0x35')));_0x532526[_0xcc43('0x31')](getAssociatedResources('MailQueues',_0x17acce[_0xcc43('0x3b')],'MailQueue'));_0x532526[_0xcc43('0x31')](getAssociatedResources(_0xcc43('0x11'),_0x17acce[_0xcc43('0x3b')],_0xcc43('0x37')));_0x532526[_0xcc43('0x31')](getAssociatedResources(_0xcc43('0x12'),_0x17acce[_0xcc43('0x3b')],_0xcc43('0x38')));_0x532526['push'](getAssociatedResources('Telephones',_0x17acce['userProfileId'],_0xcc43('0x19')));_0x532526[_0xcc43('0x31')](getAssociatedResources(_0xcc43('0x15'),_0x17acce[_0xcc43('0x3b')],'Trunk'));_0x532526[_0xcc43('0x31')](getAssociatedResources(_0xcc43('0x3c'),_0x17acce[_0xcc43('0x3b')],'Campaign'));_0x532526['push'](db[_0xcc43('0x19')][_0xcc43('0x14')](queryAgents));break;case _0xcc43('0x4'):_0x3fd749[_0x948783](_0xcc43('0x2e'));_0x3fd749[_0x948783]('voice:outbound');_0x532526[_0xcc43('0x31')](_0x17acce['getVoiceQueues']({'attributes':['id','name']}));_0x532526[_0xcc43('0x31')](_0x17acce[_0xcc43('0x3d')]({'attributes':['id',_0xcc43('0x5')]}));_0x532526[_0xcc43('0x31')](_0x17acce['getFaxQueues']({'attributes':['id','name']}));_0x532526[_0xcc43('0x31')](_0x17acce[_0xcc43('0x3e')]({'attributes':['id',_0xcc43('0x5')]}));_0x532526[_0xcc43('0x31')](_0x17acce[_0xcc43('0x3f')]({'attributes':['id',_0xcc43('0x5')]}));_0x532526[_0xcc43('0x31')](_0x17acce[_0xcc43('0x40')]({'attributes':['id',_0xcc43('0x5')]}));_0x532526[_0xcc43('0x31')](_0x17acce[_0xcc43('0x41')]({'attributes':['id',_0xcc43('0x5')]}));break;}return BPromise[_0xcc43('0x42')](_0x532526);}})[_0xcc43('0xa')](function(_0x318ca7){if(_0x318ca7&&_0x318ca7[_0xcc43('0x43')]){for(var _0x15b6a5=0x0;_0x15b6a5<_0x318ca7[_0xcc43('0x43')];_0x15b6a5+=0x1){for(var _0x5b04eb=0x0;_0x5b04eb<_0x318ca7[_0x15b6a5][_0xcc43('0x43')];_0x5b04eb+=0x1){switch(_0x15b6a5){case 0x0:joinOrLeaveQueues(_0x3fd749,_0x948783,'voice',_0x318ca7[_0x15b6a5][_0x5b04eb]);break;case 0x1:joinOrLeaveQueues(_0x3fd749,_0x948783,_0xcc43('0x44'),_0x318ca7[_0x15b6a5][_0x5b04eb]);break;case 0x2:joinOrLeaveQueues(_0x3fd749,_0x948783,_0xcc43('0x45'),_0x318ca7[_0x15b6a5][_0x5b04eb]);break;case 0x3:joinOrLeaveQueues(_0x3fd749,_0x948783,_0xcc43('0x46'),_0x318ca7[_0x15b6a5][_0x5b04eb]);break;case 0x4:joinOrLeaveQueues(_0x3fd749,_0x948783,_0xcc43('0x47'),_0x318ca7[_0x15b6a5][_0x5b04eb]);break;case 0x5:joinOrLeaveQueues(_0x3fd749,_0x948783,'openchannel',_0x318ca7[_0x15b6a5][_0x5b04eb]);break;case 0x6:joinOrLeaveQueues(_0x3fd749,_0x948783,_0xcc43('0x48'),_0x318ca7[_0x15b6a5][_0x5b04eb]);break;case 0x7:if(_0x5b9195[_0xcc43('0x1a')]!=='agent')_0x3fd749[_0x948783](util[_0xcc43('0x1d')](_0xcc43('0x49'),_0x318ca7[_0x15b6a5][_0x5b04eb][_0xcc43('0x5')]));break;case 0x8:if(_0x5b9195[_0xcc43('0x1a')]!==_0xcc43('0x4'))_0x3fd749[_0x948783](util[_0xcc43('0x1d')](_0xcc43('0x4a'),_0x318ca7[_0x15b6a5][_0x5b04eb][_0xcc43('0x5')]));break;case 0x9:if(_0x5b9195[_0xcc43('0x1a')]!==_0xcc43('0x4'))_0x3fd749[_0x948783](util[_0xcc43('0x1d')]('campaign:%s:%s',_0x318ca7[_0x15b6a5][_0x5b04eb][_0xcc43('0x7')],_0x318ca7[_0x15b6a5][_0x5b04eb][_0xcc43('0x5')]));break;case 0xa:_0x3fd749[_0x948783](util['format'](_0xcc43('0x2c'),_0x318ca7[_0x15b6a5][_0x5b04eb][_0xcc43('0x5')]));break;}}}}})[_0xcc43('0xa')](function(){if(_0x948783===_0xcc43('0x4b')){var _0x3f00e6=_['map'](_0x5b9195[_0xcc43('0x22')],'id');return _0x5b9195[_0xcc43('0x4c')](_0x3f00e6)[_0xcc43('0xa')](function(){for(var _0x1c8491=0x0;_0x1c8491<_0x3f00e6[_0xcc43('0x43')];_0x1c8491+=0x1){_0x36b655[_0xcc43('0x4d')](_0xcc43('0x4e'),{'ChatInteractionId':Number(_0x3f00e6[_0x1c8491]),'UserId':Number(_0x5b9195['id'])});}});}})[_0xcc43('0xa')](function(){if(_0x948783===_0xcc43('0x4b')){var _0x3e2398=_[_0xcc43('0x18')](_0x5b9195[_0xcc43('0x24')],'id');return _0x5b9195[_0xcc43('0x4f')](_0x3e2398)['then'](function(){for(var _0x395c76=0x0;_0x395c76<_0x3e2398['length'];_0x395c76+=0x1){_0x36b655[_0xcc43('0x4d')](_0xcc43('0x50'),{'MailInteractionId':Number(_0x3e2398[_0x395c76]),'UserId':Number(_0x5b9195['id'])});}});}})[_0xcc43('0xa')](function(){if(_0x948783===_0xcc43('0x4b')){var _0x39f9bd=_['map'](_0x5b9195[_0xcc43('0x51')],'id');return _0x5b9195['removeFaxInteractions'](_0x39f9bd)[_0xcc43('0xa')](function(){for(var _0x46528c=0x0;_0x46528c<_0x39f9bd[_0xcc43('0x43')];_0x46528c+=0x1){_0x36b655[_0xcc43('0x4d')](_0xcc43('0x52'),{'FaxInteractionId':Number(_0x39f9bd[_0x46528c]),'UserId':Number(_0x5b9195['id'])});}});}})[_0xcc43('0xa')](function(){if(_0x948783===_0xcc43('0x4b')){var _0x3ec04b=_[_0xcc43('0x18')](_0x5b9195[_0xcc43('0x27')],'id');return _0x5b9195[_0xcc43('0x53')](_0x3ec04b)[_0xcc43('0xa')](function(){for(var _0x12c739=0x0;_0x12c739<_0x3ec04b[_0xcc43('0x43')];_0x12c739+=0x1){_0x36b655[_0xcc43('0x4d')](_0xcc43('0x54'),{'SmsInteractionId':Number(_0x3ec04b[_0x12c739]),'UserId':Number(_0x5b9195['id'])});}});}})[_0xcc43('0xa')](function(){if(_0x948783==='leave'){var _0x107394=_[_0xcc43('0x18')](_0x5b9195[_0xcc43('0x29')],'id');return _0x5b9195[_0xcc43('0x55')](_0x107394)[_0xcc43('0xa')](function(){for(var _0x44fc66=0x0;_0x44fc66<_0x107394[_0xcc43('0x43')];_0x44fc66+=0x1){_0x36b655[_0xcc43('0x4d')](_0xcc43('0x56'),{'OpenchannelInteractionId':Number(_0x107394[_0x44fc66]),'UserId':Number(_0x5b9195['id'])});}});}})['then'](function(){if(_0x948783===_0xcc43('0x4b')){var _0x54acee=_['map'](_0x5b9195[_0xcc43('0x2b')],'id');return _0x5b9195[_0xcc43('0x57')](_0x54acee)[_0xcc43('0xa')](function(){for(var _0x11c82b=0x0;_0x11c82b<_0x54acee[_0xcc43('0x43')];_0x11c82b+=0x1){_0x36b655['emit'](_0xcc43('0x58'),{'WhatsappInteractionId':Number(_0x54acee[_0x11c82b]),'UserId':Number(_0x5b9195['id'])});}});}})[_0xcc43('0x59')](function(_0xc3fbf7){_0x3fd749[_0xcc43('0x5a')](_0xc3fbf7);});}}function onDisconnect(_0x133ab9,_0x151338){joinOrLeave(_0x133ab9,_0xcc43('0x4b'),_0x151338);}function onConnect(_0x56d6b5){joinOrLeave(_0x56d6b5,_0xcc43('0x5b'));}exports[_0xcc43('0x5c')]=function(_0x19520f){_0x19520f['on']('connection',function(_0x274896){_0x274896[_0xcc43('0x5d')](0x0);_0x274896[_0xcc43('0x5e')]=_0x274896[_0xcc43('0x5f')][_0xcc43('0x60')][_0xcc43('0x61')]+':'+_0x274896['request']['connection'][_0xcc43('0x62')];_0x274896[_0xcc43('0x63')]=new Date();_0x274896[_0xcc43('0x5a')]=function(_0x27c689){console['log'](_0xcc43('0x64')+_0x274896[_0xcc43('0x65')]['name']+'['+_0x274896[_0xcc43('0x5e')]+']',_0x27c689);};_0x274896['on'](_0xcc43('0x66'),function(){onDisconnect(_0x274896,_0x19520f);_0x274896[_0xcc43('0x5a')]('DISCONNECTED');});onConnect(_0x274896);_0x274896[_0xcc43('0x5a')](_0xcc43('0x67'));});};
\ No newline at end of file
index bb9cecc..052f353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe120=['get','motionChannel','event','resolve','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','query','Sequelize','QueryTypes','UserId','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','catch','AfterCreateMessage','opened','SELECT','interface','format','AfterCreate','changed','closed','substatus','sequelize','contact','AfterUpdate','fullname','email','internal','length','hasOwnProperty','model','callback','toLowerCase','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','afterCreate','newinteraction','ChatInteraction','closedinteraction','ChatMessage','ChatOfflineMessage','newmessage','Sms','SmsInteraction','afterUpdate','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code'];(function(_0x270d4c,_0x5296c2){var _0x5c4b23=function(_0x2f0fbf){while(--_0x2f0fbf){_0x270d4c['push'](_0x270d4c['shift']());}};_0x5c4b23(++_0x5296c2);}(_0xe120,0x104));var _0x0e12=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xe120[_0x4d7f3f];return _0x5d67cc;};'use strict';var util=require(_0x0e12('0x0'));var db=require(_0x0e12('0x1'))['db'];var jayson=require(_0x0e12('0x2'));var logger=require(_0x0e12('0x3'))('triggers');var client=jayson[_0x0e12('0x4')][_0x0e12('0x5')]({'port':0x232a});var triggers=[{'channel':_0x0e12('0x6'),'model':'ChatInteraction','event':_0x0e12('0x7'),'condition':_0x0e12('0x8'),'callback':afterCreate},{'channel':_0x0e12('0x6'),'model':_0x0e12('0x9'),'event':'afterUpdate','condition':_0x0e12('0xa'),'callback':afterUpdate},{'channel':_0x0e12('0x6'),'model':_0x0e12('0xb'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':_0x0e12('0xc'),'event':_0x0e12('0x7'),'condition':_0x0e12('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0x0e12('0xe'),'model':_0x0e12('0xf'),'event':'afterCreate','condition':_0x0e12('0x8'),'callback':afterCreate},{'channel':_0x0e12('0xe'),'model':_0x0e12('0xf'),'event':_0x0e12('0x10'),'condition':_0x0e12('0xa'),'callback':afterUpdate},{'channel':_0x0e12('0xe'),'model':_0x0e12('0x11'),'event':_0x0e12('0x7'),'condition':_0x0e12('0xd'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x0e12('0x12'),'event':_0x0e12('0x7'),'condition':_0x0e12('0x8'),'callback':afterCreate},{'channel':_0x0e12('0x13'),'model':_0x0e12('0x12'),'event':_0x0e12('0x10'),'condition':_0x0e12('0xa'),'callback':afterUpdate},{'channel':_0x0e12('0x13'),'model':_0x0e12('0x14'),'event':_0x0e12('0x7'),'condition':_0x0e12('0xd'),'callback':afterCreateMessage},{'channel':_0x0e12('0x15'),'model':_0x0e12('0x16'),'event':_0x0e12('0x7'),'condition':_0x0e12('0x8'),'callback':afterCreate},{'channel':_0x0e12('0x15'),'model':_0x0e12('0x16'),'event':_0x0e12('0x10'),'condition':_0x0e12('0xa'),'callback':afterUpdate},{'channel':'Fax','model':_0x0e12('0x17'),'event':_0x0e12('0x7'),'condition':_0x0e12('0xd'),'callback':afterCreateMessage},{'channel':_0x0e12('0x18'),'model':_0x0e12('0x19'),'event':_0x0e12('0x7'),'condition':_0x0e12('0x8'),'callback':afterCreate},{'channel':_0x0e12('0x18'),'model':'MailInteraction','event':_0x0e12('0x10'),'condition':_0x0e12('0xa'),'callback':afterUpdate},{'channel':_0x0e12('0x18'),'model':_0x0e12('0x1a'),'event':_0x0e12('0x7'),'condition':_0x0e12('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x0e12('0x1b'),'event':'afterCreate','condition':_0x0e12('0x8'),'callback':afterCreate},{'channel':_0x0e12('0x1c'),'model':'OpenchannelInteraction','event':_0x0e12('0x10'),'condition':_0x0e12('0xa'),'callback':afterUpdate},{'channel':_0x0e12('0x1c'),'model':_0x0e12('0x1d'),'event':_0x0e12('0x7'),'condition':_0x0e12('0xd'),'callback':afterCreateMessage}];function request(_0x1f0bfe){return client[_0x0e12('0x1e')](_0x0e12('0x1f'),_0x1f0bfe)[_0x0e12('0x20')](function(_0x3ff1db){logger['info'](_0x0e12('0x21'),_0x0e12('0x1f'),_0x3ff1db);if(_0x3ff1db[_0x0e12('0x22')]){if(_0x3ff1db['error'][_0x0e12('0x23')]===0x1f4){logger[_0x0e12('0x22')]('Trigger,\x20%s',_0x0e12('0x1f'),_0x3ff1db['error']);}}})['catch'](function(_0x2e0075){logger['error'](_0x0e12('0x21'),_0x0e12('0x1f'),_0x2e0075);});}function afterCreateMessage(_0x1ac7dd){return function(_0x4e912c){_0x4e912c=_0x4e912c[_0x0e12('0x24')]({'plain':!![]});_0x4e912c['channel']=_0x1ac7dd;_0x4e912c[_0x0e12('0x25')]=_0x1ac7dd;_0x4e912c[_0x0e12('0x26')]=_0x4e912c['direction'];Promise[_0x0e12('0x27')]()[_0x0e12('0x20')](function(){if(typeof _0x4e912c['ContactId']===_0x0e12('0x28'))return null;var _0x175708=_0x0e12('0x29')+_0x4e912c[_0x0e12('0x2a')];return db['sequelize'][_0x0e12('0x2b')](_0x175708,{'type':db[_0x0e12('0x2c')][_0x0e12('0x2d')]['SELECT'],'raw':!![]});})[_0x0e12('0x20')](function(_0x45f5b7){if(_0x45f5b7){_0x4e912c['contact']=_0x45f5b7[0x0];}if(typeof _0x4e912c[_0x0e12('0x2e')]===_0x0e12('0x28'))return;return getAgent(_0x4e912c[_0x0e12('0x2e')]);})['then'](function(_0x4f389c){if(_0x4f389c){_0x4e912c['interface']=util['format'](_0x0e12('0x2f'),_0x4f389c[_0x0e12('0x30')]);_0x4e912c[_0x0e12('0x31')]=_0x4f389c;_0x4e912c[_0x0e12('0x32')]=_0x1ac7dd;return request({'event':_0x0e12('0x33'),'message':_0x4e912c});}else{return request({'event':_0x0e12('0x34'),'message':_0x4e912c});}})[_0x0e12('0x35')](function(_0x455dca){logger[_0x0e12('0x22')](_0x0e12('0x21'),_0x0e12('0x36'),_0x455dca);});};}function afterCreateOfflineMessage(_0x29b2f3){return function(_0xc1bb3c){_0xc1bb3c=_0xc1bb3c[_0x0e12('0x24')]({'plain':!![]});_0xc1bb3c[_0x0e12('0x32')]=_0x29b2f3;_0xc1bb3c[_0x0e12('0x25')]=_0x29b2f3;_0xc1bb3c[_0x0e12('0x26')]='offlineMessage';return request({'event':_0xc1bb3c['event'],'message':_0xc1bb3c});};}function afterCreate(_0xaa683e,_0xdd398f){return function(_0x305c6c){_0x305c6c=_0x305c6c[_0x0e12('0x24')]({'plain':!![]});_0x305c6c[_0x0e12('0x32')]=_0xaa683e;_0x305c6c[_0x0e12('0x25')]=_0xaa683e;_0x305c6c[_0x0e12('0x26')]=_0x0e12('0x37');Promise[_0x0e12('0x27')]()[_0x0e12('0x20')](function(){var _0x6c806=_0x0e12('0x29')+_0x305c6c[_0x0e12('0x2a')];return db['sequelize'][_0x0e12('0x2b')](_0x6c806,{'type':db[_0x0e12('0x2c')][_0x0e12('0x2d')][_0x0e12('0x38')],'raw':!![]});})[_0x0e12('0x20')](function(_0x5860a0){if(_0x5860a0){_0x305c6c['contact']=_0x5860a0[0x0];}if(typeof _0x305c6c[_0x0e12('0x2e')]===_0x0e12('0x28'))return;return getAgent(_0x305c6c['UserId']);})[_0x0e12('0x20')](function(_0xb557bd){if(_0xb557bd){_0x305c6c[_0x0e12('0x39')]=util[_0x0e12('0x3a')](_0x0e12('0x2f'),_0xb557bd[_0x0e12('0x30')]);_0x305c6c[_0x0e12('0x31')]=_0xb557bd;}return request({'event':_0xdd398f,'message':_0x305c6c});})[_0x0e12('0x35')](function(_0x3d544e){logger[_0x0e12('0x22')](_0x0e12('0x21'),_0x0e12('0x3b'),_0x3d544e);});};}function afterUpdate(_0x59e044){return function(_0x1b3190){var _0xc5be06=_0x1b3190[_0x0e12('0x3c')](_0x0e12('0x3d'))&&_0x1b3190['closed'];var _0x23aa41=_0x1b3190[_0x0e12('0x3c')](_0x0e12('0x3e'));if(_0xc5be06||_0x23aa41){var _0xbb9330=_0xc5be06?_0x0e12('0xa'):'substatus';var _0x55f159=_0x1b3190[_0x0e12('0x24')]({'plain':!![]});_0x55f159[_0x0e12('0x32')]=_0x59e044;_0x55f159[_0x0e12('0x25')]=_0x59e044;_0x55f159[_0x0e12('0x26')]=_0xc5be06?_0x0e12('0x3d'):_0x0e12('0x3e');var _0x34d71c=_0x0e12('0x29')+_0x55f159[_0x0e12('0x2a')];return db[_0x0e12('0x3f')][_0x0e12('0x2b')](_0x34d71c,{'type':db[_0x0e12('0x2c')][_0x0e12('0x2d')][_0x0e12('0x38')],'raw':!![]})[_0x0e12('0x20')](function(_0xd6d71d){if(_0xd6d71d){_0x55f159[_0x0e12('0x40')]=_0xd6d71d[0x0];}if(typeof _0x55f159[_0x0e12('0x2e')]==='undefined')return;return getAgent(_0x55f159[_0x0e12('0x2e')]);})[_0x0e12('0x20')](function(_0x44a3b3){if(_0x44a3b3){_0x55f159[_0x0e12('0x39')]=util[_0x0e12('0x3a')](_0x0e12('0x2f'),_0x44a3b3[_0x0e12('0x30')]);_0x55f159['agent']=_0x44a3b3;}return request({'event':_0xbb9330,'message':_0x55f159});})['catch'](function(_0x484d86){logger[_0x0e12('0x22')]('Trigger,\x20%s',_0x0e12('0x41'),_0x484d86);});}};}function getAgent(_0x2736b4){return db['User']['find']({'where':{'id':_0x2736b4},'attributes':['id',_0x0e12('0x30'),_0x0e12('0x42'),_0x0e12('0x43'),_0x0e12('0x44')],'raw':!![]})[_0x0e12('0x20')](function(_0x530540){return _0x530540;});}exports['default']=function(){for(var _0x2730bc=0x0;_0x2730bc<triggers[_0x0e12('0x45')];_0x2730bc+=0x1){if(db[_0x0e12('0x46')](triggers[_0x2730bc][_0x0e12('0x47')])){db[triggers[_0x2730bc][_0x0e12('0x47')]]['hook'](triggers[_0x2730bc][_0x0e12('0x26')],triggers[_0x2730bc][_0x0e12('0x48')](triggers[_0x2730bc][_0x0e12('0x32')][_0x0e12('0x49')](),triggers[_0x2730bc]['condition']));}}};
\ No newline at end of file
+var _0xeb99=['email','internal','default','hasOwnProperty','callback','toLowerCase','condition','../../mysqldb','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','incomingmessage','catch','AfterCreateMessage','get','opened','query','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname'];(function(_0x14d987,_0x55fb48){var _0x3004f2=function(_0x4cdd63){while(--_0x4cdd63){_0x14d987['push'](_0x14d987['shift']());}};_0x3004f2(++_0x55fb48);}(_0xeb99,0x97));var _0x9eb9=function(_0x34366b,_0x248c3c){_0x34366b=_0x34366b-0x0;var _0x33921b=_0xeb99[_0x34366b];return _0x33921b;};'use strict';var util=require('util');var db=require(_0x9eb9('0x0'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0x9eb9('0x1'));var client=jayson[_0x9eb9('0x2')][_0x9eb9('0x3')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x9eb9('0x4'),'event':_0x9eb9('0x5'),'condition':_0x9eb9('0x6'),'callback':afterCreate},{'channel':_0x9eb9('0x7'),'model':'ChatInteraction','event':_0x9eb9('0x8'),'condition':_0x9eb9('0x9'),'callback':afterUpdate},{'channel':_0x9eb9('0x7'),'model':_0x9eb9('0xa'),'event':_0x9eb9('0x5'),'condition':_0x9eb9('0xb'),'callback':afterCreateMessage},{'channel':_0x9eb9('0x7'),'model':_0x9eb9('0xc'),'event':_0x9eb9('0x5'),'condition':_0x9eb9('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0x9eb9('0xd'),'model':'SmsInteraction','event':_0x9eb9('0x5'),'condition':_0x9eb9('0x6'),'callback':afterCreate},{'channel':'Sms','model':_0x9eb9('0xe'),'event':'afterUpdate','condition':_0x9eb9('0x9'),'callback':afterUpdate},{'channel':_0x9eb9('0xd'),'model':'SmsMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x9eb9('0xf'),'event':_0x9eb9('0x5'),'condition':_0x9eb9('0x6'),'callback':afterCreate},{'channel':_0x9eb9('0x10'),'model':_0x9eb9('0xf'),'event':_0x9eb9('0x8'),'condition':_0x9eb9('0x9'),'callback':afterUpdate},{'channel':_0x9eb9('0x10'),'model':_0x9eb9('0x11'),'event':_0x9eb9('0x5'),'condition':_0x9eb9('0xb'),'callback':afterCreateMessage},{'channel':_0x9eb9('0x12'),'model':'FaxInteraction','event':_0x9eb9('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9eb9('0x12'),'model':_0x9eb9('0x13'),'event':'afterUpdate','condition':_0x9eb9('0x9'),'callback':afterUpdate},{'channel':_0x9eb9('0x12'),'model':'FaxMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x9eb9('0x14'),'model':'MailInteraction','event':'afterCreate','condition':_0x9eb9('0x6'),'callback':afterCreate},{'channel':'Mail','model':_0x9eb9('0x15'),'event':'afterUpdate','condition':_0x9eb9('0x9'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x9eb9('0x5'),'condition':_0x9eb9('0xb'),'callback':afterCreateMessage},{'channel':_0x9eb9('0x16'),'model':_0x9eb9('0x17'),'event':_0x9eb9('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9eb9('0x16'),'model':'OpenchannelInteraction','event':_0x9eb9('0x8'),'condition':_0x9eb9('0x9'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x9eb9('0x18'),'event':_0x9eb9('0x5'),'condition':_0x9eb9('0xb'),'callback':afterCreateMessage}];function request(_0x642c50){return client[_0x9eb9('0x19')](_0x9eb9('0x1a'),_0x642c50)[_0x9eb9('0x1b')](function(_0x91cdc4){logger[_0x9eb9('0x1c')](_0x9eb9('0x1d'),_0x9eb9('0x1a'),_0x91cdc4);if(_0x91cdc4[_0x9eb9('0x1e')]){if(_0x91cdc4[_0x9eb9('0x1e')][_0x9eb9('0x1f')]===0x1f4){logger[_0x9eb9('0x1e')](_0x9eb9('0x1d'),_0x9eb9('0x1a'),_0x91cdc4[_0x9eb9('0x1e')]);}}})['catch'](function(_0x5c9db6){logger[_0x9eb9('0x1e')](_0x9eb9('0x1d'),'EventManager',_0x5c9db6);});}function afterCreateMessage(_0x53a2d3){return function(_0x427a0d){_0x427a0d=_0x427a0d['get']({'plain':!![]});_0x427a0d[_0x9eb9('0x20')]=_0x53a2d3;_0x427a0d[_0x9eb9('0x21')]=_0x53a2d3;_0x427a0d[_0x9eb9('0x22')]=_0x427a0d[_0x9eb9('0x23')];Promise[_0x9eb9('0x24')]()['then'](function(){if(typeof _0x427a0d[_0x9eb9('0x25')]===_0x9eb9('0x26'))return null;var _0x59f854=_0x9eb9('0x27')+_0x427a0d[_0x9eb9('0x25')];return db[_0x9eb9('0x28')]['query'](_0x59f854,{'type':db[_0x9eb9('0x29')][_0x9eb9('0x2a')][_0x9eb9('0x2b')],'raw':!![]});})[_0x9eb9('0x1b')](function(_0x38c207){if(_0x38c207){_0x427a0d[_0x9eb9('0x2c')]=_0x38c207[0x0];}if(typeof _0x427a0d[_0x9eb9('0x2d')]===_0x9eb9('0x26'))return;return getAgent(_0x427a0d[_0x9eb9('0x2d')]);})[_0x9eb9('0x1b')](function(_0x158322){if(_0x158322){_0x427a0d[_0x9eb9('0x2e')]=util[_0x9eb9('0x2f')](_0x9eb9('0x30'),_0x158322[_0x9eb9('0x31')]);_0x427a0d[_0x9eb9('0x32')]=_0x158322;_0x427a0d[_0x9eb9('0x20')]=_0x53a2d3;return request({'event':_0x9eb9('0x33'),'message':_0x427a0d});}else{return request({'event':'outgoingmessage','message':_0x427a0d});}})[_0x9eb9('0x34')](function(_0x40d9ca){logger[_0x9eb9('0x1e')]('Trigger,\x20%s',_0x9eb9('0x35'),_0x40d9ca);});};}function afterCreateOfflineMessage(_0x3dd587){return function(_0xf34b08){_0xf34b08=_0xf34b08[_0x9eb9('0x36')]({'plain':!![]});_0xf34b08[_0x9eb9('0x20')]=_0x3dd587;_0xf34b08[_0x9eb9('0x21')]=_0x3dd587;_0xf34b08['event']='offlineMessage';return request({'event':_0xf34b08['event'],'message':_0xf34b08});};}function afterCreate(_0x179825,_0x4e75f1){return function(_0x2e7e98){_0x2e7e98=_0x2e7e98[_0x9eb9('0x36')]({'plain':!![]});_0x2e7e98[_0x9eb9('0x20')]=_0x179825;_0x2e7e98['motionChannel']=_0x179825;_0x2e7e98[_0x9eb9('0x22')]=_0x9eb9('0x37');Promise[_0x9eb9('0x24')]()[_0x9eb9('0x1b')](function(){var _0x296577='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e7e98[_0x9eb9('0x25')];return db[_0x9eb9('0x28')][_0x9eb9('0x38')](_0x296577,{'type':db['Sequelize'][_0x9eb9('0x2a')][_0x9eb9('0x2b')],'raw':!![]});})[_0x9eb9('0x1b')](function(_0x1cdc57){if(_0x1cdc57){_0x2e7e98[_0x9eb9('0x2c')]=_0x1cdc57[0x0];}if(typeof _0x2e7e98[_0x9eb9('0x2d')]==='undefined')return;return getAgent(_0x2e7e98[_0x9eb9('0x2d')]);})['then'](function(_0x195ef4){if(_0x195ef4){_0x2e7e98['interface']=util[_0x9eb9('0x2f')](_0x9eb9('0x30'),_0x195ef4[_0x9eb9('0x31')]);_0x2e7e98[_0x9eb9('0x32')]=_0x195ef4;}return request({'event':_0x4e75f1,'message':_0x2e7e98});})[_0x9eb9('0x34')](function(_0xbd4eb8){logger[_0x9eb9('0x1e')](_0x9eb9('0x1d'),_0x9eb9('0x39'),_0xbd4eb8);});};}function afterUpdate(_0x66be3a){return function(_0x57fe4a){var _0x3bc45e=_0x57fe4a[_0x9eb9('0x3a')]('closed')&&_0x57fe4a[_0x9eb9('0x3b')];var _0x2dd136=_0x57fe4a[_0x9eb9('0x3a')](_0x9eb9('0x3c'));if(_0x3bc45e||_0x2dd136){var _0x4358e4=_0x3bc45e?'closedinteraction':_0x9eb9('0x3c');var _0x3cb27e=_0x57fe4a[_0x9eb9('0x36')]({'plain':!![]});_0x3cb27e[_0x9eb9('0x20')]=_0x66be3a;_0x3cb27e[_0x9eb9('0x21')]=_0x66be3a;_0x3cb27e['event']=_0x3bc45e?_0x9eb9('0x3b'):'substatus';var _0x2a758f=_0x9eb9('0x27')+_0x3cb27e[_0x9eb9('0x25')];return db['sequelize'][_0x9eb9('0x38')](_0x2a758f,{'type':db['Sequelize'][_0x9eb9('0x2a')][_0x9eb9('0x2b')],'raw':!![]})[_0x9eb9('0x1b')](function(_0x34b486){if(_0x34b486){_0x3cb27e[_0x9eb9('0x2c')]=_0x34b486[0x0];}if(typeof _0x3cb27e[_0x9eb9('0x2d')]===_0x9eb9('0x26'))return;return getAgent(_0x3cb27e[_0x9eb9('0x2d')]);})[_0x9eb9('0x1b')](function(_0x11d302){if(_0x11d302){_0x3cb27e[_0x9eb9('0x2e')]=util[_0x9eb9('0x2f')]('SIP/%s',_0x11d302[_0x9eb9('0x31')]);_0x3cb27e[_0x9eb9('0x32')]=_0x11d302;}return request({'event':_0x4358e4,'message':_0x3cb27e});})[_0x9eb9('0x34')](function(_0x68dffa){logger[_0x9eb9('0x1e')](_0x9eb9('0x1d'),_0x9eb9('0x3d'),_0x68dffa);});}};}function getAgent(_0x2c46fe){return db[_0x9eb9('0x3e')][_0x9eb9('0x3f')]({'where':{'id':_0x2c46fe},'attributes':['id',_0x9eb9('0x31'),_0x9eb9('0x40'),_0x9eb9('0x41'),_0x9eb9('0x42')],'raw':!![]})['then'](function(_0x5a9243){return _0x5a9243;});}exports[_0x9eb9('0x43')]=function(){for(var _0x58b45c=0x0;_0x58b45c<triggers['length'];_0x58b45c+=0x1){if(db[_0x9eb9('0x44')](triggers[_0x58b45c]['model'])){db[triggers[_0x58b45c]['model']]['hook'](triggers[_0x58b45c][_0x9eb9('0x22')],triggers[_0x58b45c][_0x9eb9('0x45')](triggers[_0x58b45c][_0x9eb9('0x20')][_0x9eb9('0x46')](),triggers[_0x58b45c][_0x9eb9('0x47')]));}}};
\ No newline at end of file
index 3b24c08..c525aca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f4=['then','agents','catch','lodash','bluebird','voice','mail','fax','sms','whatsapp','openchannel','isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','count'];(function(_0x60fe5d,_0x51261d){var _0x5ccfb1=function(_0x224aec){while(--_0x224aec){_0x60fe5d['push'](_0x60fe5d['shift']());}};_0x5ccfb1(++_0x51261d);}(_0x31f4,0x129));var _0x431f=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x31f4[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x431f('0x0'));var BPromise=require(_0x431f('0x1'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0x431f('0x2'),_0x431f('0x3'),'chat',_0x431f('0x4'),_0x431f('0x5'),_0x431f('0x6'),_0x431f('0x7')];exports['getChannels']=function(){return channels;};exports[_0x431f('0x8')]=function(_0x3cf07b){_0x3cf07b=_0x3cf07b[_0x431f('0x9')]();return _['includes'](channels,_0x3cf07b);};exports[_0x431f('0xa')]=function(_0x10b75f,_0x16c341,_0x314d14,_0x39fffc){var _0x3ac05a={'loginAttempts':_0x16c341,'blocked':_0x314d14};if(!_[_0x431f('0xb')](_0x39fffc)){_0x3ac05a[_0x431f('0xc')]=_0x39fffc;}return _0x10b75f[_0x431f('0xd')](_0x3ac05a);};exports[_0x431f('0xe')]=function(_0x3455c9){return new BPromise(function(_0x148b14,_0x5d9a8b){var _0x5d9443=0x0;if(_0x3455c9['role']!==_0x431f('0xf')){_0x148b14(_0x3455c9);}db[_0x431f('0x10')][_0x431f('0x11')]({'where':{'role':_0x431f('0xf'),'online':!![],'id':{'$ne':_0x3455c9['id']}}})[_0x431f('0x12')](function(_0x39b256){_0x5d9443=_0x39b256;return util['getLicense']();})[_0x431f('0x12')](function(_0x2cf864){if(_0x2cf864&&_0x2cf864[_0x431f('0x13')]&&_0x5d9443>=_0x2cf864[_0x431f('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x148b14(_0x3455c9);})[_0x431f('0x14')](function(_0x3302cc){_0x5d9a8b(_0x3302cc);});});};
\ No newline at end of file
+var _0x0572=['openchannel','getChannels','isValidChannel','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','voice','mail','chat','sms'];(function(_0x2d92ac,_0x58e39d){var _0x1a2e39=function(_0xca2a36){while(--_0xca2a36){_0x2d92ac['push'](_0x2d92ac['shift']());}};_0x1a2e39(++_0x58e39d);}(_0x0572,0xf2));var _0x2057=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x0572[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x2057('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0x2057('0x1'),_0x2057('0x2'),_0x2057('0x3'),'fax',_0x2057('0x4'),'whatsapp',_0x2057('0x5')];exports[_0x2057('0x6')]=function(){return channels;};exports[_0x2057('0x7')]=function(_0x18ac2e){_0x18ac2e=_0x18ac2e['toLowerCase']();return _[_0x2057('0x8')](channels,_0x18ac2e);};exports[_0x2057('0x9')]=function(_0xe72432,_0xebf39,_0x19b196,_0x1e83ca){var _0x25361b={'loginAttempts':_0xebf39,'blocked':_0x19b196};if(!_['isUndefined'](_0x1e83ca)){_0x25361b[_0x2057('0xa')]=_0x1e83ca;}return _0xe72432[_0x2057('0xb')](_0x25361b);};exports[_0x2057('0xc')]=function(_0x4d16cf){return new BPromise(function(_0x3fd44a,_0x2dbabd){var _0x4c4537=0x0;if(_0x4d16cf[_0x2057('0xd')]!==_0x2057('0xe')){_0x3fd44a(_0x4d16cf);}db['User'][_0x2057('0xf')]({'where':{'role':_0x2057('0xe'),'online':!![],'id':{'$ne':_0x4d16cf['id']}}})[_0x2057('0x10')](function(_0x53af06){_0x4c4537=_0x53af06;return util[_0x2057('0xc')]();})[_0x2057('0x10')](function(_0x5268ad){if(_0x5268ad&&_0x5268ad[_0x2057('0x11')]&&_0x4c4537>=_0x5268ad[_0x2057('0x11')]){throw Error(_0x2057('0x12'));}_0x3fd44a(_0x4d16cf);})['catch'](function(_0x36ecee){_0x2dbabd(_0x36ecee);});});};
\ No newline at end of file
index ddaee93..ba1e9a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a75=['send','exports','status','render'];(function(_0x3d1639,_0x2fe6dd){var _0x29b47f=function(_0x170499){while(--_0x170499){_0x3d1639['push'](_0x3d1639['shift']());}};_0x29b47f(++_0x2fe6dd);}(_0x9a75,0xf1));var _0x59a7=function(_0xa9585b,_0x40239e){_0xa9585b=_0xa9585b-0x0;var _0x5c681a=_0x9a75[_0xa9585b];return _0x5c681a;};'use strict';module[_0x59a7('0x0')][0x194]=function pageNotFound(_0x1000eb,_0xeaedbf){var _0x57125f='404';var _0x365ad2=0x194;var _0x3238d6={'status':_0x365ad2};_0xeaedbf[_0x59a7('0x1')](_0x3238d6[_0x59a7('0x1')]);_0xeaedbf[_0x59a7('0x2')](_0x57125f,{},function(_0x8675be,_0x5bc325){if(_0x8675be){return _0xeaedbf[_0x59a7('0x1')](_0x3238d6[_0x59a7('0x1')])['json'](_0x3238d6);}_0xeaedbf[_0x59a7('0x3')](_0x5bc325);});};
\ No newline at end of file
+var _0x78d2=['json','send','exports','404','status','render'];(function(_0x4b0e7e,_0x1e8b2c){var _0x19faff=function(_0x7a60bd){while(--_0x7a60bd){_0x4b0e7e['push'](_0x4b0e7e['shift']());}};_0x19faff(++_0x1e8b2c);}(_0x78d2,0x1c4));var _0x278d=function(_0x4879f7,_0x33749d){_0x4879f7=_0x4879f7-0x0;var _0x41771a=_0x78d2[_0x4879f7];return _0x41771a;};'use strict';module[_0x278d('0x0')][0x194]=function pageNotFound(_0x10d0bd,_0x56eff2){var _0x2490af=_0x278d('0x1');var _0x3d08b2=0x194;var _0x572e67={'status':_0x3d08b2};_0x56eff2['status'](_0x572e67[_0x278d('0x2')]);_0x56eff2[_0x278d('0x3')](_0x2490af,{},function(_0x36bde6,_0xea2d53){if(_0x36bde6){return _0x56eff2[_0x278d('0x2')](_0x572e67[_0x278d('0x2')])[_0x278d('0x4')](_0x572e67);}_0x56eff2[_0x278d('0x5')](_0xea2d53);});};
\ No newline at end of file
index 22df2f1..f7d42ec 100644 (file)
-'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);
-  }
+'use strict';\r
+\r
+var BPromise = require('bluebird');\r
+var util = require('util');\r
+\r
+var logger = require('../config/logger')('migration');\r
+\r
+var Sequence = function() {};\r
+\r
+Sequence.prototype.enqueue = function(fn) {\r
+  this.tail = this.tail ? this.tail.finally(fn) : fn();\r
+};\r
+\r
+var Migration = function(queryInterface) {\r
+  this.queryInterface = queryInterface;\r
+  this.sequence = new Sequence();\r
+};\r
+\r
+Migration.prototype.changeColumn = function(table, column, type) {\r
+  var _this = this;\r
+  this.sequence.enqueue(function() {\r
+    return _this.queryInterface\r
+      .changeColumn(table, column, type)\r
+      .then(function() {\r
+        logger.info('Changed column %s in table %s', column, table);\r
+      })\r
+      .catch(function(err) {\r
+        logger.info(JSON.stringify(err));\r
+      });\r
+  });\r
+};\r
+\r
+Migration.prototype.addColumn = function(table, column, type) {\r
+  var _this = this;\r
+  this.sequence.enqueue(function() {\r
+    return _this.queryInterface\r
+      .addColumn(table, column, type)\r
+      .then(function() {\r
+        logger.info('Added column %s to %s', column, table);\r
+      })\r
+      .catch(function(err) {\r
+        logger.info(JSON.stringify(err));\r
+      });\r
+  });\r
+};\r
+\r
+Migration.prototype.dropTable = function(table) {\r
+  var _this = this;\r
+  this.sequence.enqueue(function() {\r
+    return _this.queryInterface\r
+      .dropTable(table, {\r
+        force: true\r
+      })\r
+      .then(function() {\r
+        logger.info('table dropped %s', table);\r
+      })\r
+      .catch(function(err) {\r
+        logger.info(JSON.stringify(err));\r
+      });\r
+  });\r
+};\r
+\r
+Migration.prototype.addIndex = function(table, column, indexName) {\r
+  var _this = this;\r
+  this.sequence.enqueue(function() {\r
+    return _this.queryInterface\r
+      .addIndex(table, column, {\r
+        indexName: indexName\r
+      })\r
+      .then(function() {\r
+        logger.info('addIndex %s %s %s', table, column.join(','), indexName);\r
+      })\r
+      .catch(function(err) {\r
+        logger.info(JSON.stringify(err));\r
+      });\r
+  });\r
+};\r
+\r
+Migration.prototype.removeIndex = function(table, indexName) {\r
+  var _this = this;\r
+  this.sequence.enqueue(function() {\r
+    return _this.queryInterface\r
+      .removeIndex(table, indexName)\r
+      .then(function() {\r
+        logger.info('removeIndex %s %s', table, indexName);\r
+      })\r
+      .catch(function(err) {\r
+        logger.info(JSON.stringify(err));\r
+      });\r
+  });\r
+};\r
+\r
+Migration.prototype.query = function(sql) {\r
+  var _this = this;\r
+  this.sequence.enqueue(function() {\r
+    return _this.queryInterface.sequelize\r
+      .query(sql)\r
+      .then(function() {\r
+        logger.info('query %s', sql);\r
+      })\r
+      .catch(function(err) {\r
+        logger.info(JSON.stringify(err));\r
+      });\r
+  });\r
+};\r
+\r
+Migration.prototype.removeColumn = function(table, column) {\r
+  var _this = this;\r
+  this.sequence.enqueue(function() {\r
+    return _this.queryInterface\r
+      .removeColumn(table, column)\r
+      .then(function() {\r
+        logger.info('Removed column %s from %s', column, table);\r
+      })\r
+      .catch(function(err) {\r
+        logger.info(\r
+          util.inspect(err, {\r
+            showHidden: false,\r
+            depth: null\r
+          })\r
+        );\r
+      });\r
+  });\r
+};\r
+\r
+Migration.prototype.renameColumn = function(table, oldColumn, newColumn) {\r
+  var _this = this;\r
+  this.sequence.enqueue(function() {\r
+    return _this.queryInterface\r
+      .renameColumn(table, oldColumn, newColumn)\r
+      .then(function() {\r
+        logger.info('Renamed column from %s to %s on %s', oldColumn, newColumn, table);\r
+      })\r
+      .catch(function(err) {\r
+        logger.info(\r
+          util.inspect(err, {\r
+            showHidden: false,\r
+            depth: null\r
+          })\r
+        );\r
+      });\r
+  });\r
+};\r
+\r
+Migration.prototype.final = function(resolve) {\r
+  this.sequence.enqueue(function() {\r
+    return resolve();\r
+  });\r
+};\r
+\r
+module.exports = {\r
+  up: function(queryInterface, Sequelize) {\r
+    return new BPromise(function(resolve) {\r
+      var migration = new Migration(queryInterface);\r
+\r
+      // START FINAL\r
+      migration.final(resolve);\r
+      // END FINAL\r
+    });\r
+  },\r
+\r
+  down: function(queryInterface, Sequelize) {\r
+    // var migration = new Migration(queryInterface);\r
+  }\r
 };
\ No newline at end of file
diff --git a/server/migrations/2.6.0.js b/server/migrations/2.6.0.js
deleted file mode 100644 (file)
index 75b29b4..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-'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 tools_contact_item_types
-      migration.query(
-        "CREATE TABLE `tools_contact_item_types` (" +
-        "  `id` INT AUTO_INCREMENT NOT NULL," +
-        "  `name` varchar(255) NOT NULL," +
-        "  `OrderBy` INT NULL," +
-        "  `rgbBackgroundColor` varchar(20) NULL," +
-        "  `createdAt` datetime NOT NULL," +
-        "  `updatedAt` datetime NOT NULL," +
-        "  UNIQUE  INDEX `item_type_id` (id) " +
-        ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"
-      );
-      // END tools_contact_item_types
-
-      // START cm_contact_has_items
-      migration.query(
-        "CREATE TABLE `cm_contact_has_items` (" +
-        "  `CmContactId` INT NOT NULL," +
-        "  `item` varchar(255) NOT NULL," +
-        "  `ItemTypeId` INT NULL," +
-        "  `ItemClass` VARCHAR(20) NOT NULL," +
-        "  `OrderBy` INT NULL," +
-        "  `description` varchar(255) DEFAULT NULL," +
-        "  `createdAt` datetime NOT NULL," +
-        "  `updatedAt` datetime NOT NULL," +
-        "  UNIQUE  INDEX `contact_item` (CmContactId,item), " +
-        "  CONSTRAINT `cm_contact_has_items_ibfk_1` FOREIGN KEY (`CmContactId`) REFERENCES `cm_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, " +
-        "  CONSTRAINT `cm_contact_has_items_ibfk_2` FOREIGN KEY (`ItemTypeId`) REFERENCES `tools_contact_item_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE" +
-        ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"
-      );
-      // END cm_contact_has_items
-
-      // START cm_hopper_additional_phones
-      migration.query(
-        "CREATE TABLE `cm_hopper_additional_phones` (" +
-        "  `id` INT AUTO_INCREMENT NOT NULL," +
-        "  `CmHopperId` INT NOT NULL," +
-        "  `phone` varchar(255) NOT NULL," +
-        "  `OrderBy` INT NULL default 0," +
-        "  `scheduledat` datetime NULL," +
-        "  `countbusyretry` INT NULL default 0," +
-        "  `countcongestionretry` INT NULL default 0," +
-        "  `countnoanswerretry` INT NULL default 0," +
-        "  `countnosuchnumberretry` INT NULL default 0," +
-        "  `countdropretry` INT NULL default 0," +
-        "  `countabandonedretry` INT NULL default 0," +
-        "  `countmachineretry` INT NULL default 0," +
-        "  `countagentrejectretry` INT NULL default 0," +
-        "  `createdAt` datetime NOT NULL," +
-        "  `updatedAt` datetime NOT NULL," +
-        "  UNIQUE  INDEX `hopper_additional_phone_id` (id), " +
-        "  INDEX `cm_hopper_phone_item` (CmHopperId), " +
-        "  CONSTRAINT `cm_hopper_phone_item1` FOREIGN KEY (`CmHopperId`) REFERENCES `cm_hopper` (`id`) ON DELETE CASCADE ON UPDATE CASCADE " +
-        ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"
-      );
-      // END cm_hopper_additional_phones
-
-      // START cm_hopper
-      migration.addColumn("cm_hopper", "OrderBy", {
-        type: Sequelize.INTEGER,
-        allowNull: true,
-        defaultValue: 0
-      });
-      // END cm_hopper
-
-      // START cm_contacts
-      migration.addColumn("cm_contacts", "AdditionalPhones", {
-        type: Sequelize.STRING,
-        allowNull: true
-      });
-      // START cm_contacts
-
-      // START voice_queues
-      migration.addColumn("voice_queues", "callAdditionalPhoneAfterMin", {
-        type: Sequelize.INTEGER,
-        defaultValue: 3
-      });
-      // END voice_queues
-
-      // START FINAL
-      migration.final(resolve);
-      // END FINAL
-    });
-  },
-
-  down: function(queryInterface, Sequelize) {
-    // var migration = new Migration(queryInterface);
-  },
-};
\ No newline at end of file
diff --git a/server/migrations/2.6.1.js b/server/migrations/2.6.1.js
deleted file mode 100644 (file)
index 99a8015..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-'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
diff --git a/server/migrations/2.6.2.js b/server/migrations/2.6.2.js
deleted file mode 100644 (file)
index 9d3dde7..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-'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 int_dynamics365_configurations
-      migration.addColumn('int_dynamics365_configurations', 'additionalSearchContact', {
-        type: Sequelize.STRING,
-        allowNull: true
-      });
-      // END int_dynamics365_configurations
-
-      // START FINAL
-      migration.final(resolve);
-      // END FINAL
-    });
-  },
-
-  down: function(queryInterface, Sequelize) {
-    // var migration = new Migration(queryInterface);
-  },
-};
\ No newline at end of file
index b6c1261..0160054 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb1e=['Members','CompanyId','CmContactId','Hoppers','HopperHistories','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','Sound','Mohs','ItemType','Hopper','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticDefaultReport','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','Subject','Description','Field','FieldId','VariableId','SugarcrmField','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','CloudProviderId','Dynamics365Account','FromId','ToId','SessionId','SmsQueueReport','ProjectId','MailQueues','team_has_chat_queues','FaxQueues','OpenchannelQueues','TrunkId','SquareProjectId','campaigns_has_cm_blacklists','FromAccount','FromUserId','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToChatWebsiteId','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','user','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','database','username','options','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','../api/tag/tag.model','ContactItemType','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/team/team.model','License','Campaign','Migration','../api/migration/migration.model','Attachment','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','VoiceMail','UserId','User','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_lists','Team','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','ChatQueue','ChatQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','VoiceQueue','VoiceQueueId','JscriptySessionReport','JscriptySessions','belongsTo','Trunk','TrunkBackup','TrunkBackupId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','CloudProvider','restrict','Imap','Smtp','Interactions','List','Template','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','ListId','Dashboard','Items','FaxAccount','Dispositions','FaxAccountId','Answers','Exntensions','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','IntervalId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId'];(function(_0x1bed64,_0x4f5705){var _0x2d26dc=function(_0x56ba41){while(--_0x56ba41){_0x1bed64['push'](_0x1bed64['shift']());}};_0x2d26dc(++_0x4f5705);}(_0xeb1e,0x64));var _0xeeb1=function(_0x51c80e,_0x2972a3){_0x51c80e=_0x51c80e-0x0;var _0x4b6b7e=_0xeb1e[_0x51c80e];return _0x4b6b7e;};'use strict';var config=require(_0xeeb1('0x0'));var Sequelize=require(_0xeeb1('0x1'));var _=require(_0xeeb1('0x2'));var jstz=require(_0xeeb1('0x3'));var timezone=jstz[_0xeeb1('0x4')]();config['sequelize']=_[_0xeeb1('0x5')](config[_0xeeb1('0x1')],{'database':'motion2','username':_0xeeb1('0x6'),'password':_0xeeb1('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xeeb1('0x8'),'dialectOptions':{'charset':_0xeeb1('0x9')},'logging':![],'timezone':timezone[_0xeeb1('0xa')](),'define':{'charset':_0xeeb1('0xb'),'collate':_0xeeb1('0xc')}}});config['sequelizeHistory']=_[_0xeeb1('0x5')](config[_0xeeb1('0xd')],{'database':_0xeeb1('0xe'),'username':_0xeeb1('0x6'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xeeb1('0x9')},'logging':![],'timezone':timezone[_0xeeb1('0xa')](),'define':{'charset':_0xeeb1('0xb'),'collate':_0xeeb1('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xeeb1('0xf')],config[_0xeeb1('0x1')]['username'],config[_0xeeb1('0x1')]['password'],config[_0xeeb1('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xeeb1('0xd')][_0xeeb1('0xf')],config[_0xeeb1('0xd')][_0xeeb1('0x10')],config['sequelizeHistory']['password'],config['sequelizeHistory'][_0xeeb1('0x11')])};db['User']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x13'));db['VoiceChanSpy']=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x14'));db[_0xeeb1('0x15')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x16'));db['VoiceExtension']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x17'));db[_0xeeb1('0x18')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x19'));db['VoiceQueue']=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x1a'));db[_0xeeb1('0x1b')]=db['sequelize'][_0xeeb1('0x12')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x1c'));db['VoiceMail']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x1d'));db[_0xeeb1('0x1e')]=db['sequelize']['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xeeb1('0x1f')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x20'));db[_0xeeb1('0x21')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x22'));db['VoiceAgentReport']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x23'));db[_0xeeb1('0x24')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x25'));db[_0xeeb1('0x26')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x27'));db['Trunk']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x28'));db[_0xeeb1('0x29')]=db[_0xeeb1('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xeeb1('0x2a')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xeeb1('0x2b')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x2c'));db[_0xeeb1('0x2d')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x2e'));db[_0xeeb1('0x2f')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x30'));db[_0xeeb1('0x31')]=db[_0xeeb1('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0xeeb1('0x32')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x33'));db[_0xeeb1('0x34')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x35'));db[_0xeeb1('0x36')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x37'));db['MailServerIn']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x38'));db[_0xeeb1('0x39')]=db['sequelize']['import'](_0xeeb1('0x3a'));db[_0xeeb1('0x3b')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x3c'));db[_0xeeb1('0x3d')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x3e'));db[_0xeeb1('0x3f')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x40'));db[_0xeeb1('0x41')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x42'));db[_0xeeb1('0x43')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x44'));db[_0xeeb1('0x45')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x46'));db['MailQueueReport']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x47'));db['Dashboard']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x48'));db[_0xeeb1('0x49')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x4a'));db['FaxAccount']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x4b'));db[_0xeeb1('0x4c')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x4d'));db[_0xeeb1('0x4e')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x4f'));db[_0xeeb1('0x50')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x51'));db[_0xeeb1('0x52')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x53'));db['FaxQueueReport']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/faxQueueReport/faxQueueReport.model');db[_0xeeb1('0x54')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x55'));db[_0xeeb1('0x56')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x57'));db[_0xeeb1('0x58')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x59'));db[_0xeeb1('0x5a')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x5b'));db[_0xeeb1('0x5c')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x5d'));db[_0xeeb1('0x5e')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x5f'));db[_0xeeb1('0x60')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x61'));db['OpenchannelInteraction']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x62'));db[_0xeeb1('0x63')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x64'));db[_0xeeb1('0x65')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x66'));db[_0xeeb1('0x67')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xeeb1('0x68')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x69'));db[_0xeeb1('0x6a')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x6b'));db[_0xeeb1('0x6c')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/chatMessage/chatMessage.model');db[_0xeeb1('0x6d')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x6e'));db['ChatQueue']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/chatQueue/chatQueue.model');db[_0xeeb1('0x6f')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x70'));db['ChatProactiveAction']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x71'));db[_0xeeb1('0x72')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x73'));db['CmContact']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x74'));db[_0xeeb1('0x75')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x76'));db[_0xeeb1('0x77')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x78'));db[_0xeeb1('0x79')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xeeb1('0x7a')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x7b'));db[_0xeeb1('0x7c')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x7d'));db[_0xeeb1('0x7e')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x7f'));db[_0xeeb1('0x80')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x81'));db['Automation']=db['sequelize'][_0xeeb1('0x12')]('../api/automation/automation.model');db[_0xeeb1('0x82')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x83'));db[_0xeeb1('0x84')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x85'));db[_0xeeb1('0x86')]=db['sequelize'][_0xeeb1('0x12')]('../api/condition/condition.model');db[_0xeeb1('0x87')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/interval/interval.model');db[_0xeeb1('0x88')]=db['sequelize']['import'](_0xeeb1('0x89'));db[_0xeeb1('0x8a')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/cdr/cdr.model');db[_0xeeb1('0x8b')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x8c'));db['Schedule']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x8d'));db['Sound']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/sound/sound.model');db['Tag']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x8e'));db[_0xeeb1('0x8f')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/contactItemType/contactItemType.model');db[_0xeeb1('0x90')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0xeeb1('0x91')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x92'));db['Template']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x93'));db[_0xeeb1('0x94')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x95'));db[_0xeeb1('0x96')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x97'));db[_0xeeb1('0x98')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/integration/integration.model');db['IntegrationReport']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x99'));db[_0xeeb1('0x9a')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x9b'));db['AnalyticDefaultReport']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xeeb1('0x9c')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x9d'));db[_0xeeb1('0x9e')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0xeeb1('0x9f')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0xa0'));db['AnalyticTreeReport']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0xa1'));db[_0xeeb1('0xa2')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xa3'));db[_0xeeb1('0xa4')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xeeb1('0xa5')]=db['sequelize']['import']('../api/intSalesforceField/intSalesforceField.model');db[_0xeeb1('0xa6')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xa7'));db[_0xeeb1('0xa8')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0xa9'));db['SugarcrmField']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0xaa'));db[_0xeeb1('0xab')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xac'));db[_0xeeb1('0xad')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xeeb1('0xae')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xaf'));db[_0xeeb1('0xb0')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xb1'));db[_0xeeb1('0xb2')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xb3'));db['ZohoField']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0xb4'));db[_0xeeb1('0xb5')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xb6'));db[_0xeeb1('0xb7')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xb8'));db[_0xeeb1('0xb9')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xba'));db[_0xeeb1('0xbb')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xbc'));db[_0xeeb1('0xbd')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0xbe'));db[_0xeeb1('0xbf')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xc0'));db[_0xeeb1('0xc1')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xc2'));db[_0xeeb1('0xc3')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xc4'));db[_0xeeb1('0xc5')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xeeb1('0xc6')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0xc7'));db['Dynamics365Account']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xeeb1('0xc8')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xeeb1('0xc9')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xca'));db[_0xeeb1('0xcb')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xcc'));db[_0xeeb1('0xcd')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xce'));db[_0xeeb1('0xcf')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xd0'));db['Integration']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/integration/integration.model');db[_0xeeb1('0xd1')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xd2'));db[_0xeeb1('0xd3')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xd4'));db[_0xeeb1('0xd5')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xd6'));db[_0xeeb1('0xd7')]=db['sequelize'][_0xeeb1('0x12')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xeeb1('0xd8')]=db['sequelize']['import'](_0xeeb1('0xd9'));db['JscriptySessionReport']=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0xda'));db['SmsQueueReport']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xdb'));db[_0xeeb1('0xdc')]=db[_0xeeb1('0x1')]['import']('../api/squareReport/squareReport.model');db[_0xeeb1('0xdd')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xde'));db[_0xeeb1('0xdf')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0xe0'));db[_0xeeb1('0xe1')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xe2'));db['SquareOdbc']=db['sequelize']['import'](_0xeeb1('0xe3'));db[_0xeeb1('0xe4')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0xe5'));db[_0xeeb1('0xe6')]=db[_0xeeb1('0x1')]['import']('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xe7'));db[_0xeeb1('0xe8')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/license/license.model');db[_0xeeb1('0xe9')]=db[_0xeeb1('0x1')]['import']('../api/campaign/campaign.model');db[_0xeeb1('0xea')]=db['sequelize']['import'](_0xeeb1('0xeb'));db[_0xeeb1('0xec')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/attachment/attachment.model');db['Plugin']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/plugin/plugin.model');db[_0xeeb1('0xed')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xee'));db[_0xeeb1('0xef')]=db['sequelize']['import'](_0xeeb1('0xf0'));db[_0xeeb1('0xf1')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0xf2'));db[_0xeeb1('0xf3')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xeeb1('0xf4')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0xf5'));db[_0xeeb1('0xf6')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/cmList/cmList.model');db[_0xeeb1('0xf7')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xf8'));db[_0xeeb1('0xf9')]=db[_0xeeb1('0x1')]['import']('../api/userProfile/userProfile.model');db[_0xeeb1('0xfa')]=db['sequelize']['import'](_0xeeb1('0xfb'));db['UserProfileResource']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xfc'));db[_0xeeb1('0xfd')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0xfe'));db[_0xeeb1('0xff')]=db['sequelize']['import'](_0xeeb1('0x100'));db[_0xeeb1('0x101')]=db['sequelize'][_0xeeb1('0x12')](_0xeeb1('0x102'));db[_0xeeb1('0x103')]=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x104'));db[_0xeeb1('0x105')]=db[_0xeeb1('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0xeeb1('0x106')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x107'));db['WhatsappTransferReport']=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xeeb1('0x108')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x109'));db['CloudProvider']=db[_0xeeb1('0x1')]['import'](_0xeeb1('0x10a'));db[_0xeeb1('0x10b')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xeeb1('0x10c')]=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x10d'));db['UserVoicePrefix']=db['sequelize'][_0xeeb1('0x12')]('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db[_0xeeb1('0x1')][_0xeeb1('0x12')](_0xeeb1('0x10e'));db['User'][_0xeeb1('0x10f')](db[_0xeeb1('0x110')],{'as':_0xeeb1('0x110'),'onDelete':'cascade','foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x10f')](db['UserSetting'],{'as':'userSetting','onDelete':'cascade','foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db[_0xeeb1('0x1b')],{'as':_0xeeb1('0x114'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db[_0xeeb1('0x2a')],{'as':_0xeeb1('0x115'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db[_0xeeb1('0x116')],{'as':_0xeeb1('0x117'),'onDelete':_0xeeb1('0x118'),'hooks':!![]});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db[_0xeeb1('0x79')],{'as':_0xeeb1('0x119'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')]['hasMany'](db[_0xeeb1('0x7a')],{'as':_0xeeb1('0x11a'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')]['hasMany'](db[_0xeeb1('0x7c')],{'as':'ReportAgentPreview','foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db[_0xeeb1('0x11b')],{'as':'OpenchannelInteractions','foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db[_0xeeb1('0x6a')],{'as':_0xeeb1('0x11c'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')]['hasMany'](db[_0xeeb1('0x58')],{'as':_0xeeb1('0x11d'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db[_0xeeb1('0x4e')],{'as':_0xeeb1('0x11e'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db[_0xeeb1('0x41')],{'as':_0xeeb1('0x11f'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x112')][_0xeeb1('0x113')](db['WhatsappInteraction'],{'as':_0xeeb1('0x120'),'foreignKey':_0xeeb1('0x111')});db['User'][_0xeeb1('0x113')](db[_0xeeb1('0xfd')],{'as':_0xeeb1('0x121'),'foreignKey':'SenderId'});db['User']['belongsTo'](db[_0xeeb1('0xf9')],{'as':_0xeeb1('0xf9'),'foreignKey':'userProfileId'});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x6f')],{'as':_0xeeb1('0x123'),'through':_0xeeb1('0x124')});db['User'][_0xeeb1('0x122')](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x126'),'through':'cm_user_has_contacts'});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0xf6')],{'as':'Lists','through':_0xeeb1('0x127')});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x128')],{'through':_0xeeb1('0x129')});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x41')],{'as':_0xeeb1('0x11f'),'through':'user_has_mail_interactions'});db[_0xeeb1('0x112')]['belongsToMany'](db[_0xeeb1('0x6a')],{'as':_0xeeb1('0x11c'),'through':_0xeeb1('0x12a')});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db['FaxInteraction'],{'as':_0xeeb1('0x11e'),'through':_0xeeb1('0x12b')});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x58')],{'as':_0xeeb1('0x11d'),'through':_0xeeb1('0x12c')});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x11b')],{'as':_0xeeb1('0x12d'),'through':'user_has_openchannel_interactions'});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db['WhatsappInteraction'],{'as':_0xeeb1('0x120'),'through':_0xeeb1('0x12e')});db[_0xeeb1('0x112')]['belongsToMany'](db['VoiceQueue'],{'as':_0xeeb1('0x12f'),'through':_0xeeb1('0x2b'),'required':![]});db['User']['belongsToMany'](db[_0xeeb1('0xf7')],{'as':_0xeeb1('0x130'),'through':_0xeeb1('0x131'),'required':![]});db[_0xeeb1('0x112')]['belongsToMany'](db[_0xeeb1('0x3d')],{'as':'MailQueues','through':_0xeeb1('0x2f'),'required':![]});db['User'][_0xeeb1('0x122')](db[_0xeeb1('0x132')],{'as':_0xeeb1('0x133'),'through':_0xeeb1('0x2d'),'required':![],'hooks':!![]});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db['FaxQueue'],{'as':'FaxQueues','through':_0xeeb1('0x31'),'required':![]});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x5c')],{'as':_0xeeb1('0x134'),'through':'UserSmsQueue','required':![]});db['User']['belongsToMany'](db[_0xeeb1('0x135')],{'as':'OpenchannelQueues','through':_0xeeb1('0x34'),'required':![]});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x108')],{'as':_0xeeb1('0x136'),'through':'UserWhatsappQueue','required':![]});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0xf6')],{'through':_0xeeb1('0x127')});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x65')],{'as':_0xeeb1('0x137'),'through':_0xeeb1('0x138')});db['User'][_0xeeb1('0x122')](db['FaxAccount'],{'as':_0xeeb1('0x139'),'through':_0xeeb1('0x13a')});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x3b')],{'as':'MailAccounts','through':_0xeeb1('0x13b')});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0x5e')],{'as':_0xeeb1('0x13c'),'through':_0xeeb1('0x13d')});db[_0xeeb1('0x112')]['belongsToMany'](db[_0xeeb1('0x54')],{'as':_0xeeb1('0x13e'),'through':_0xeeb1('0x13f')});db['User'][_0xeeb1('0x122')](db['WhatsappAccount'],{'as':_0xeeb1('0x140'),'through':'user_has_whatsapp_accounts'});db[_0xeeb1('0x112')][_0xeeb1('0x122')](db[_0xeeb1('0xe4')],{'as':_0xeeb1('0x141'),'through':_0xeeb1('0x142')});db[_0xeeb1('0x143')]['hasMany'](db['VoiceExtension'],{'as':_0xeeb1('0x144'),'onDelete':'cascade','foreignKey':_0xeeb1('0x145')});db[_0xeeb1('0x15')][_0xeeb1('0x113')](db['VoiceExtension'],{'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x116')]['hasMany'](db[_0xeeb1('0x116')],{'as':_0xeeb1('0x146'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xeeb1('0x122')](db['Sound'],{'as':'Sounds','through':_0xeeb1('0x147')});db[_0xeeb1('0x148')][_0xeeb1('0x113')](db[_0xeeb1('0x2a')],{'as':'Members','foreignKey':_0xeeb1('0x149')});db[_0xeeb1('0x148')][_0xeeb1('0x113')](db[_0xeeb1('0x75')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0xeeb1('0x148')][_0xeeb1('0x113')](db[_0xeeb1('0x79')],{'as':_0xeeb1('0x119'),'foreignKey':_0xeeb1('0x149')});db[_0xeeb1('0x148')]['hasMany'](db[_0xeeb1('0x7a')],{'as':'HopperHistories','foreignKey':_0xeeb1('0x149')});db['VoiceQueue'][_0xeeb1('0x113')](db[_0xeeb1('0x7c')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0xeeb1('0x148')][_0xeeb1('0x113')](db[_0xeeb1('0x77')],{'as':'HopperBlacks','foreignKey':_0xeeb1('0x149')});db[_0xeeb1('0x148')][_0xeeb1('0x113')](db[_0xeeb1('0x14a')],{'as':_0xeeb1('0x14b'),'foreignKey':_0xeeb1('0x149')});db['VoiceQueue'][_0xeeb1('0x14c')](db[_0xeeb1('0x14d')],{'as':_0xeeb1('0x14d'),'foreignKey':'TrunkId'});db[_0xeeb1('0x148')][_0xeeb1('0x14c')](db['Trunk'],{'as':_0xeeb1('0x14e'),'foreignKey':_0xeeb1('0x14f')});db['VoiceQueue'][_0xeeb1('0x14c')](db[_0xeeb1('0x87')],{'as':_0xeeb1('0x87'),'foreignKey':'IntervalId'});db[_0xeeb1('0x148')]['belongsTo'](db[_0xeeb1('0x88')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xeeb1('0x148')][_0xeeb1('0x122')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x150'),'through':_0xeeb1('0x151')});db['VoiceQueue'][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x152'),'through':_0xeeb1('0x2b')});db[_0xeeb1('0x148')][_0xeeb1('0x122')](db[_0xeeb1('0x128')],{'as':_0xeeb1('0x153'),'through':'TeamVoiceQueue'});db[_0xeeb1('0x148')][_0xeeb1('0x122')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x154'),'through':_0xeeb1('0x155')});db[_0xeeb1('0x1b')]['belongsTo'](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x112'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x156')][_0xeeb1('0x14c')](db['User'],{'as':_0xeeb1('0x112'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x110')][_0xeeb1('0x113')](db[_0xeeb1('0x1e')],{'as':_0xeeb1('0x157'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x158'),'sourceKey':'mailbox'});db[_0xeeb1('0x1e')][_0xeeb1('0x14c')](db['VoiceMail'],{'foreignKey':_0xeeb1('0x158'),'targetKey':_0xeeb1('0x159')});db[_0xeeb1('0x1f')]['hasMany'](db[_0xeeb1('0x24')],{'as':_0xeeb1('0x15a'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0xeeb1('0x113')](db[_0xeeb1('0x15b')],{'as':'AgentReports','foreignKey':_0xeeb1('0x15c'),'constraints':![]});db[_0xeeb1('0x1f')][_0xeeb1('0x14c')](db['User'],{'as':_0xeeb1('0x112'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x1f')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x15f')][_0xeeb1('0x14c')](db[_0xeeb1('0x3b')],{'as':_0xeeb1('0x3b'),'foreignKey':_0xeeb1('0x160')});db[_0xeeb1('0x15f')][_0xeeb1('0x14c')](db[_0xeeb1('0x161')],{'as':_0xeeb1('0x161'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0xeeb1('0x39')][_0xeeb1('0x14c')](db[_0xeeb1('0x3b')],{'as':_0xeeb1('0x3b'),'foreignKey':_0xeeb1('0x160')});db[_0xeeb1('0x39')][_0xeeb1('0x14c')](db[_0xeeb1('0x161')],{'as':_0xeeb1('0x161'),'foreignKey':'CloudProviderId','onDelete':_0xeeb1('0x162')});db['MailAccount'][_0xeeb1('0x10f')](db[_0xeeb1('0x15f')],{'as':_0xeeb1('0x163'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x3b')][_0xeeb1('0x10f')](db[_0xeeb1('0x39')],{'as':_0xeeb1('0x164'),'onDelete':_0xeeb1('0x118')});db['MailAccount']['hasMany'](db[_0xeeb1('0x84')],{'as':'Dispositions','foreignKey':_0xeeb1('0x160'),'onDelete':'cascade'});db[_0xeeb1('0x3b')][_0xeeb1('0x113')](db[_0xeeb1('0x82')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xeeb1('0x3b')][_0xeeb1('0x113')](db[_0xeeb1('0x43')],{'as':_0xeeb1('0x157'),'foreignKey':'MailAccountId'});db[_0xeeb1('0x3b')]['hasMany'](db[_0xeeb1('0x41')],{'as':_0xeeb1('0x165')});db['MailAccount'][_0xeeb1('0x113')](db[_0xeeb1('0x45')],{'as':_0xeeb1('0x146')});db[_0xeeb1('0x3b')][_0xeeb1('0x14c')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x166'),'foreignKey':'ListId'});db['MailAccount'][_0xeeb1('0x14c')](db[_0xeeb1('0x167')],{'as':_0xeeb1('0x167'),'foreignKey':_0xeeb1('0x168')});db[_0xeeb1('0x3b')]['belongsTo'](db[_0xeeb1('0x88')],{'as':_0xeeb1('0x169'),'foreignKey':_0xeeb1('0x16a')});db['MailAccount'][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':'Agents','through':_0xeeb1('0x13b')});db[_0xeeb1('0x3d')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':'Agents','through':_0xeeb1('0x2f')});db[_0xeeb1('0x3d')]['belongsToMany'](db[_0xeeb1('0x128')],{'through':_0xeeb1('0x16b'),'as':_0xeeb1('0x153')});db['MailInteraction'][_0xeeb1('0x113')](db['MailMessage'],{'as':_0xeeb1('0x157'),'onDelete':'cascade','foreignKey':_0xeeb1('0x16c')});db[_0xeeb1('0x41')][_0xeeb1('0x14c')](db[_0xeeb1('0x3b')],{'as':'Account','foreignKey':_0xeeb1('0x160')});db['MailInteraction'][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x41')]['belongsTo'](db[_0xeeb1('0x112')],{'as':'Owner','foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x41')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x16e'),'as':_0xeeb1('0x16f')});db[_0xeeb1('0x41')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x16e'),'as':_0xeeb1('0x170')});db[_0xeeb1('0x41')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x171'),'through':_0xeeb1('0x172'),'foreignKey':_0xeeb1('0x16c')});db[_0xeeb1('0x43')][_0xeeb1('0x113')](db[_0xeeb1('0xec')],{'as':_0xeeb1('0x173'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x43')]['belongsTo'](db['User'],{'as':_0xeeb1('0x112')});db[_0xeeb1('0x43')][_0xeeb1('0x14c')](db['CmContact'],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x15d')});db[_0xeeb1('0x43')]['belongsTo'](db[_0xeeb1('0x41')],{'as':_0xeeb1('0x174'),'foreignKey':_0xeeb1('0x16c')});db[_0xeeb1('0x43')][_0xeeb1('0x14c')](db['MailAccount'],{'as':'Account','foreignKey':_0xeeb1('0x160')});db['MailMessage'][_0xeeb1('0x14c')](db[_0xeeb1('0x65')],{'as':_0xeeb1('0x65'),'foreignKey':_0xeeb1('0x175')});db[_0xeeb1('0x43')][_0xeeb1('0x14c')](db[_0xeeb1('0x6d')],{'as':_0xeeb1('0x6d'),'foreignKey':_0xeeb1('0x176')});db[_0xeeb1('0x45')][_0xeeb1('0x14c')](db['User'],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x45')]['belongsTo'](db[_0xeeb1('0x3d')],{'onDelete':'restrict'});db[_0xeeb1('0x45')]['belongsTo'](db[_0xeeb1('0x3b')],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x45')][_0xeeb1('0x14c')](db[_0xeeb1('0x87')],{'onDelete':_0xeeb1('0x162'),'foreignKey':'IntervalId'});db['MailApplication'][_0xeeb1('0x14c')](db['Tag'],{'onDelete':_0xeeb1('0x162'),'foreignKey':_0xeeb1('0x177')});db[_0xeeb1('0x178')][_0xeeb1('0x14c')](db[_0xeeb1('0x3b')],{});db['MailQueueReport'][_0xeeb1('0x14c')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x166'),'foreignKey':_0xeeb1('0x179')});db['MailQueueReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x178')][_0xeeb1('0x14c')](db[_0xeeb1('0x41')],{});db[_0xeeb1('0x178')][_0xeeb1('0x14c')](db['MailMessage'],{});db[_0xeeb1('0x178')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{});db[_0xeeb1('0x178')]['belongsTo'](db['MailQueue'],{});db[_0xeeb1('0x17a')][_0xeeb1('0x113')](db[_0xeeb1('0x49')],{'as':_0xeeb1('0x17b'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x17c')][_0xeeb1('0x113')](db[_0xeeb1('0x84')],{'as':_0xeeb1('0x17d'),'foreignKey':_0xeeb1('0x17e'),'onDelete':'cascade'});db[_0xeeb1('0x17c')][_0xeeb1('0x113')](db[_0xeeb1('0x82')],{'as':_0xeeb1('0x17f'),'foreignKey':_0xeeb1('0x17e')});db[_0xeeb1('0x17c')][_0xeeb1('0x113')](db[_0xeeb1('0x4e')],{'as':_0xeeb1('0x165')});db[_0xeeb1('0x17c')]['hasMany'](db['FaxApplication'],{'as':_0xeeb1('0x146')});db[_0xeeb1('0x17c')][_0xeeb1('0x113')](db[_0xeeb1('0x116')],{'as':_0xeeb1('0x180'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x17c')][_0xeeb1('0x113')](db['FaxMessage'],{'as':_0xeeb1('0x157')});db[_0xeeb1('0x17c')]['belongsTo'](db['Trunk'],{'as':_0xeeb1('0x14d')});db[_0xeeb1('0x17c')]['belongsTo'](db['CmList'],{'as':_0xeeb1('0x166'),'foreignKey':_0xeeb1('0x179')});db['FaxAccount'][_0xeeb1('0x14c')](db['Pause'],{'as':_0xeeb1('0x169'),'foreignKey':_0xeeb1('0x16a')});db[_0xeeb1('0x17c')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':'Agents','through':_0xeeb1('0x13a')});db[_0xeeb1('0x4c')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x4c')]['belongsTo'](db[_0xeeb1('0x52')],{'onDelete':'restrict'});db[_0xeeb1('0x4c')]['belongsTo'](db[_0xeeb1('0x17c')],{'onDelete':'restrict'});db['FaxApplication'][_0xeeb1('0x14c')](db['Tag'],{'onDelete':_0xeeb1('0x162'),'foreignKey':'TagId'});db[_0xeeb1('0x4e')][_0xeeb1('0x113')](db[_0xeeb1('0x50')],{'as':'Messages','onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x181')});db[_0xeeb1('0x4e')]['belongsTo'](db['FaxAccount'],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x17e')});db[_0xeeb1('0x4e')]['belongsTo'](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':'ContactId'});db[_0xeeb1('0x4e')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x183'),'foreignKey':'UserId'});db[_0xeeb1('0x4e')]['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xeeb1('0x16f')});db[_0xeeb1('0x4e')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x184'),'as':_0xeeb1('0x170')});db['FaxInteraction'][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':'Users','through':_0xeeb1('0x12b'),'foreignKey':_0xeeb1('0x181')});db['FaxMessage'][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x112')});db['FaxMessage'][_0xeeb1('0x14c')](db['FaxInteraction'],{'as':_0xeeb1('0x174'),'foreignKey':_0xeeb1('0x181')});db[_0xeeb1('0x50')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x15d')});db[_0xeeb1('0x50')][_0xeeb1('0x14c')](db[_0xeeb1('0xec')],{'as':_0xeeb1('0xec'),'foreignKey':_0xeeb1('0x185')});db['FaxMessage'][_0xeeb1('0x14c')](db[_0xeeb1('0x17c')],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x17e')});db['FaxQueue'][_0xeeb1('0x122')](db['User'],{'as':'Agents','through':_0xeeb1('0x31')});db[_0xeeb1('0x52')][_0xeeb1('0x122')](db[_0xeeb1('0x128')],{'through':_0xeeb1('0x186'),'as':_0xeeb1('0x153')});db[_0xeeb1('0x187')][_0xeeb1('0x14c')](db[_0xeeb1('0x17c')],{});db[_0xeeb1('0x187')][_0xeeb1('0x14c')](db['CmList'],{'as':_0xeeb1('0x166'),'foreignKey':'ListId'});db[_0xeeb1('0x187')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x187')][_0xeeb1('0x14c')](db['FaxInteraction'],{});db[_0xeeb1('0x187')][_0xeeb1('0x14c')](db[_0xeeb1('0x50')],{});db['FaxQueueReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{});db[_0xeeb1('0x187')][_0xeeb1('0x14c')](db[_0xeeb1('0x52')],{});db[_0xeeb1('0x54')][_0xeeb1('0x113')](db['Disposition'],{'as':_0xeeb1('0x17d'),'foreignKey':_0xeeb1('0x188'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x54')][_0xeeb1('0x113')](db[_0xeeb1('0x82')],{'as':'Answers','foreignKey':_0xeeb1('0x188')});db[_0xeeb1('0x54')][_0xeeb1('0x113')](db[_0xeeb1('0x5a')],{'as':_0xeeb1('0x157'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0xeeb1('0x58')],{'as':_0xeeb1('0x165')});db['SmsAccount'][_0xeeb1('0x113')](db['SmsApplication'],{'as':'Applications'});db['SmsAccount'][_0xeeb1('0x14c')](db[_0xeeb1('0xf6')],{'as':'List','foreignKey':_0xeeb1('0x179')});db[_0xeeb1('0x54')][_0xeeb1('0x14c')](db[_0xeeb1('0x88')],{'as':_0xeeb1('0x169'),'foreignKey':_0xeeb1('0x16a')});db[_0xeeb1('0x54')]['belongsToMany'](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x152'),'through':_0xeeb1('0x13f')});db[_0xeeb1('0x56')]['belongsTo'](db[_0xeeb1('0x112')],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x56')]['belongsTo'](db['SmsQueue'],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x56')][_0xeeb1('0x14c')](db[_0xeeb1('0x54')],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x56')][_0xeeb1('0x14c')](db[_0xeeb1('0x87')],{'onDelete':_0xeeb1('0x162'),'foreignKey':_0xeeb1('0x189')});db[_0xeeb1('0x56')][_0xeeb1('0x14c')](db['Tag'],{'onDelete':_0xeeb1('0x162'),'foreignKey':_0xeeb1('0x177')});db[_0xeeb1('0x58')][_0xeeb1('0x113')](db[_0xeeb1('0x5a')],{'as':_0xeeb1('0x157'),'onDelete':'cascade','foreignKey':_0xeeb1('0x18a')});db[_0xeeb1('0x58')][_0xeeb1('0x14c')](db[_0xeeb1('0x54')],{'as':_0xeeb1('0x182'),'foreignKey':'SmsAccountId'});db[_0xeeb1('0x58')]['belongsTo'](db['CmContact'],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db['SmsInteraction'][_0xeeb1('0x14c')](db['User'],{'as':_0xeeb1('0x183'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x58')]['belongsToMany'](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x18b'),'as':'Tags'});db[_0xeeb1('0x58')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x18b'),'as':'ThroughTags'});db[_0xeeb1('0x58')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x171'),'through':'user_has_sms_interactions','foreignKey':_0xeeb1('0x18a')});db[_0xeeb1('0x5a')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x112')});db['SmsMessage'][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'onDelete':'cascade','as':_0xeeb1('0x15d')});db[_0xeeb1('0x5a')][_0xeeb1('0x14c')](db[_0xeeb1('0x58')],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x174'),'foreignKey':_0xeeb1('0x18a')});db[_0xeeb1('0x5a')][_0xeeb1('0x14c')](db['SmsAccount'],{'as':'Account','foreignKey':_0xeeb1('0x188')});db[_0xeeb1('0x5c')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':'Agents','through':_0xeeb1('0x32'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0xeeb1('0x122')](db['Team'],{'through':_0xeeb1('0x18c'),'as':_0xeeb1('0x153')});db[_0xeeb1('0x5e')]['hasMany'](db[_0xeeb1('0x84')],{'as':_0xeeb1('0x17d'),'foreignKey':_0xeeb1('0x18d'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x5e')][_0xeeb1('0x113')](db['CannedAnswer'],{'as':_0xeeb1('0x17f'),'foreignKey':_0xeeb1('0x18d')});db[_0xeeb1('0x5e')][_0xeeb1('0x113')](db[_0xeeb1('0x11b')],{'as':_0xeeb1('0x165'),'foreignKey':_0xeeb1('0x18d')});db[_0xeeb1('0x5e')][_0xeeb1('0x113')](db[_0xeeb1('0x63')],{'as':_0xeeb1('0x157'),'foreignKey':_0xeeb1('0x18d')});db[_0xeeb1('0x5e')]['hasMany'](db['OpenchannelApplication'],{'as':_0xeeb1('0x146'),'foreignKey':'OpenchannelAccountId'});db[_0xeeb1('0x5e')][_0xeeb1('0x14c')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x166'),'foreignKey':'ListId'});db[_0xeeb1('0x5e')]['belongsTo'](db[_0xeeb1('0x88')],{'as':_0xeeb1('0x169'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xeeb1('0x5e')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x152'),'through':'user_has_openchannel_accounts'});db[_0xeeb1('0x60')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x60')][_0xeeb1('0x14c')](db[_0xeeb1('0x135')],{'onDelete':_0xeeb1('0x162'),'foreignKey':_0xeeb1('0x18e')});db[_0xeeb1('0x60')][_0xeeb1('0x14c')](db[_0xeeb1('0x5e')],{'onDelete':'restrict','foreignKey':_0xeeb1('0x18d')});db[_0xeeb1('0x60')][_0xeeb1('0x14c')](db[_0xeeb1('0x87')],{'onDelete':_0xeeb1('0x162'),'foreignKey':_0xeeb1('0x189')});db[_0xeeb1('0x60')][_0xeeb1('0x14c')](db[_0xeeb1('0x16d')],{'onDelete':'restrict','foreignKey':_0xeeb1('0x177')});db[_0xeeb1('0x11b')][_0xeeb1('0x113')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x18f')});db[_0xeeb1('0x11b')][_0xeeb1('0x14c')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xeeb1('0x18d')});db[_0xeeb1('0x11b')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':'Contact','foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x11b')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'as':'Owner','foreignKey':'UserId'});db[_0xeeb1('0x11b')][_0xeeb1('0x122')](db['Tag'],{'through':_0xeeb1('0x190'),'as':_0xeeb1('0x16f')});db[_0xeeb1('0x11b')][_0xeeb1('0x122')](db['Tag'],{'through':_0xeeb1('0x190'),'as':'ThroughTags'});db[_0xeeb1('0x11b')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x171'),'through':_0xeeb1('0x191'),'foreignKey':'OpenchannelInteractionId'});db[_0xeeb1('0x63')]['belongsTo'](db['User'],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x112')});db['OpenchannelMessage'][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x15d')});db[_0xeeb1('0x63')]['belongsTo'](db[_0xeeb1('0x11b')],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x174'),'foreignKey':'OpenchannelInteractionId'});db[_0xeeb1('0x63')][_0xeeb1('0x14c')](db[_0xeeb1('0xec')],{'as':_0xeeb1('0xec'),'foreignKey':_0xeeb1('0x185')});db[_0xeeb1('0x63')][_0xeeb1('0x14c')](db[_0xeeb1('0x5e')],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x18d')});db[_0xeeb1('0x135')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x152'),'through':_0xeeb1('0x34'),'foreignKey':_0xeeb1('0x18e')});db[_0xeeb1('0x135')]['belongsToMany'](db[_0xeeb1('0x128')],{'through':_0xeeb1('0x192'),'as':_0xeeb1('0x153')});db['ChatWebsite']['hasMany'](db['Disposition'],{'as':_0xeeb1('0x17d'),'foreignKey':_0xeeb1('0x175'),'onDelete':_0xeeb1('0x118')});db['ChatWebsite'][_0xeeb1('0x113')](db[_0xeeb1('0x82')],{'as':_0xeeb1('0x17f'),'foreignKey':'ChatWebsiteId'});db[_0xeeb1('0x65')][_0xeeb1('0x113')](db[_0xeeb1('0x193')],{'as':_0xeeb1('0x194')});db[_0xeeb1('0x65')][_0xeeb1('0x113')](db[_0xeeb1('0x6a')],{'as':'Interactions'});db['ChatWebsite']['hasMany'](db[_0xeeb1('0x68')],{'as':_0xeeb1('0x146')});db['ChatWebsite']['hasMany'](db[_0xeeb1('0x6c')],{'as':_0xeeb1('0x157')});db[_0xeeb1('0x65')]['belongsTo'](db['CmList'],{'as':_0xeeb1('0x166'),'foreignKey':_0xeeb1('0x179')});db[_0xeeb1('0x65')][_0xeeb1('0x14c')](db[_0xeeb1('0x87')],{'as':_0xeeb1('0x87'),'foreignKey':_0xeeb1('0x189')});db[_0xeeb1('0x65')][_0xeeb1('0x14c')](db[_0xeeb1('0x3b')],{'as':_0xeeb1('0x3b'),'foreignKey':_0xeeb1('0x160')});db['ChatWebsite'][_0xeeb1('0x14c')](db['Pause'],{'as':_0xeeb1('0x169'),'foreignKey':_0xeeb1('0x16a')});db['ChatWebsite']['belongsToMany'](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x152'),'through':_0xeeb1('0x138')});db['OpenchannelQueueReport']['belongsTo'](db[_0xeeb1('0x5e')],{});db[_0xeeb1('0x67')][_0xeeb1('0x14c')](db['CmList'],{'as':_0xeeb1('0x166'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':'Contact','foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x67')][_0xeeb1('0x14c')](db[_0xeeb1('0x11b')],{});db[_0xeeb1('0x67')][_0xeeb1('0x14c')](db[_0xeeb1('0x63')],{});db[_0xeeb1('0x67')][_0xeeb1('0x14c')](db['User'],{});db[_0xeeb1('0x67')][_0xeeb1('0x14c')](db[_0xeeb1('0x135')],{});db[_0xeeb1('0x68')]['belongsTo'](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x195'),'foreignKey':'UserId','onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x68')][_0xeeb1('0x14c')](db[_0xeeb1('0x132')],{'as':_0xeeb1('0x196'),'foreignKey':_0xeeb1('0x197'),'onDelete':_0xeeb1('0x162')});db['ChatApplication'][_0xeeb1('0x14c')](db[_0xeeb1('0x65')],{'as':_0xeeb1('0x198'),'foreignKey':_0xeeb1('0x175'),'onDelete':_0xeeb1('0x162')});db['ChatApplication'][_0xeeb1('0x14c')](db[_0xeeb1('0x16d')],{'onDelete':'restrict','foreignKey':_0xeeb1('0x177')});db['ChatInteraction'][_0xeeb1('0x113')](db[_0xeeb1('0x6c')],{'as':_0xeeb1('0x157'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x199')});db[_0xeeb1('0x6a')][_0xeeb1('0x14c')](db['ChatWebsite'],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x175')});db[_0xeeb1('0x6a')][_0xeeb1('0x14c')](db['CmContact'],{'as':'Contact','foreignKey':_0xeeb1('0x15e')});db['ChatInteraction'][_0xeeb1('0x14c')](db['User'],{'as':_0xeeb1('0x183'),'foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x6a')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':'chat_interaction_has_tags','as':_0xeeb1('0x16f')});db[_0xeeb1('0x6a')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':'chat_interaction_has_tags','as':_0xeeb1('0x170')});db[_0xeeb1('0x6a')][_0xeeb1('0x122')](db['User'],{'as':_0xeeb1('0x171'),'through':_0xeeb1('0x12a'),'foreignKey':_0xeeb1('0x199')});db[_0xeeb1('0x6c')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x112')});db['ChatMessage'][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'onDelete':'cascade','as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x6c')][_0xeeb1('0x14c')](db['ChatInteraction'],{'onDelete':_0xeeb1('0x118'),'as':'Interaction','foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xeeb1('0x14c')](db[_0xeeb1('0xec')],{'as':_0xeeb1('0xec'),'foreignKey':_0xeeb1('0x185')});db[_0xeeb1('0x6c')][_0xeeb1('0x14c')](db[_0xeeb1('0x65')],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x175')});db['ChatOfflineMessage'][_0xeeb1('0x113')](db[_0xeeb1('0xec')],{'as':'Attachments','foreignKey':_0xeeb1('0x176'),'onDelete':'cascade','hooks':!![]});db[_0xeeb1('0x6d')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x6d')][_0xeeb1('0x14c')](db['ChatWebsite'],{'as':_0xeeb1('0x182'),'foreignKey':'ChatWebsiteId'});db[_0xeeb1('0x132')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x152'),'through':_0xeeb1('0x2d'),'hooks':!![]});db[_0xeeb1('0x132')][_0xeeb1('0x122')](db['Team'],{'through':'team_has_chat_queues','as':_0xeeb1('0x153')});db[_0xeeb1('0x6f')]['hasMany'](db[_0xeeb1('0xd5')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xeeb1('0x118')});db['ChatGroup'][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x19a'),'through':_0xeeb1('0x124')});db['ChatProactiveAction'][_0xeeb1('0x14c')](db[_0xeeb1('0x65')],{'as':_0xeeb1('0x198'),'foreignKey':_0xeeb1('0x175')});db[_0xeeb1('0x72')][_0xeeb1('0x113')](db[_0xeeb1('0x125')],{'as':'Contacts','foreignKey':_0xeeb1('0x19b')});db[_0xeeb1('0x125')][_0xeeb1('0x113')](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0xeeb1('0x19c')});db[_0xeeb1('0x125')]['hasMany'](db['CmHopper'],{'as':_0xeeb1('0x19d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x125')][_0xeeb1('0x113')](db['CmHopperFinal'],{'as':_0xeeb1('0x119'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x125')][_0xeeb1('0x113')](db[_0xeeb1('0x7a')],{'as':_0xeeb1('0x19e'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x125')]['hasMany'](db[_0xeeb1('0x7c')],{'as':_0xeeb1('0x7c'),'foreignKey':_0xeeb1('0x15e')});db['CmContact'][_0xeeb1('0x113')](db[_0xeeb1('0x14a')],{'as':_0xeeb1('0x14b'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x125')]['hasMany'](db[_0xeeb1('0x11b')],{'as':_0xeeb1('0x12d'),'foreignKey':_0xeeb1('0x15e'),'onDelete':'restrict'});db[_0xeeb1('0x125')][_0xeeb1('0x113')](db[_0xeeb1('0x6a')],{'as':_0xeeb1('0x11c'),'foreignKey':_0xeeb1('0x15e'),'onDelete':_0xeeb1('0x162')});db['CmContact'][_0xeeb1('0x113')](db[_0xeeb1('0x58')],{'as':'SmsInteractions','foreignKey':_0xeeb1('0x15e'),'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x125')]['hasMany'](db[_0xeeb1('0x4e')],{'as':_0xeeb1('0x11e'),'foreignKey':_0xeeb1('0x15e'),'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x125')][_0xeeb1('0x113')](db[_0xeeb1('0x41')],{'as':_0xeeb1('0x11f'),'foreignKey':_0xeeb1('0x15e'),'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x125')][_0xeeb1('0x14c')](db[_0xeeb1('0x72')],{'as':_0xeeb1('0x19f'),'foreignKey':_0xeeb1('0x19b')});db[_0xeeb1('0x125')]['belongsTo'](db[_0xeeb1('0xf6')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0xeeb1('0x125')]['belongsToMany'](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x171'),'through':_0xeeb1('0x1a0')});db[_0xeeb1('0x125')]['belongsToMany'](db[_0xeeb1('0x16d')],{'as':_0xeeb1('0x16f'),'through':_0xeeb1('0x1a1')});db[_0xeeb1('0x125')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x1a1'),'as':_0xeeb1('0x170')});db[_0xeeb1('0x75')]['hasMany'](db['CmHopperAdditionalPhone'],{'as':_0xeeb1('0x1a2'),'foreignKey':_0xeeb1('0x1a3')});db['CmHopper'][_0xeeb1('0x14c')](db['CmContact'],{'as':_0xeeb1('0x15d'),'foreignKey':'ContactId','onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x75')][_0xeeb1('0x14c')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x166'),'foreignKey':_0xeeb1('0x179'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x75')]['belongsTo'](db[_0xeeb1('0x112')],{'as':'Agent','foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x75')]['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xeeb1('0x149'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x75')][_0xeeb1('0x14c')](db[_0xeeb1('0xe9')],{'as':_0xeeb1('0xe9'),'foreignKey':_0xeeb1('0x1a4'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x75')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x183'),'foreignKey':_0xeeb1('0x1a5')});db[_0xeeb1('0x77')][_0xeeb1('0x14c')](db['CmContact'],{'as':'Contact','foreignKey':_0xeeb1('0x15e'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x77')][_0xeeb1('0x14c')](db['CmList'],{'as':'List','foreignKey':_0xeeb1('0x179'),'onDelete':_0xeeb1('0x118')});db['CmHopperBlack'][_0xeeb1('0x14c')](db[_0xeeb1('0x148')],{'as':_0xeeb1('0x196'),'foreignKey':_0xeeb1('0x149'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0xeeb1('0xe9')],{'as':'Campaign','foreignKey':_0xeeb1('0x1a4'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x1a6')]['hasMany'](db[_0xeeb1('0x86')],{'as':{'plural':_0xeeb1('0x1a7'),'singular':_0xeeb1('0x1a8')},'foreignKey':_0xeeb1('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0xeeb1('0x1a6')]['hasMany'](db[_0xeeb1('0x86')],{'as':{'plural':'Any','singular':_0xeeb1('0x1aa')},'foreignKey':_0xeeb1('0x1ab'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xeeb1('0x113')](db[_0xeeb1('0x80')],{'as':_0xeeb1('0x1ac'),'foreignKey':_0xeeb1('0x1ad'),'onDelete':_0xeeb1('0x118'),'hooks':!![]});db['Disposition'][_0xeeb1('0x113')](db[_0xeeb1('0x84')],{'as':_0xeeb1('0x17d'),'foreignKey':_0xeeb1('0x1ae'),'onDelete':_0xeeb1('0x118')});db['Interval'][_0xeeb1('0x113')](db[_0xeeb1('0x87')],{'as':'Intervals','foreignKey':_0xeeb1('0x189'),'onDelete':_0xeeb1('0x118'),'hooks':!![],'required':![]});db[_0xeeb1('0x87')][_0xeeb1('0x113')](db['VoiceExtension'],{'as':_0xeeb1('0x117'),'foreignKey':_0xeeb1('0x189'),'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x87')][_0xeeb1('0x113')](db[_0xeeb1('0x45')],{'as':'MailApplications','foreignKey':'IntervalId'});db['Interval'][_0xeeb1('0x113')](db[_0xeeb1('0x68')],{'as':_0xeeb1('0x1af'),'foreignKey':_0xeeb1('0x189')});db[_0xeeb1('0x87')][_0xeeb1('0x113')](db['FaxApplication'],{'as':_0xeeb1('0x1b0'),'foreignKey':_0xeeb1('0x189')});db['Interval'][_0xeeb1('0x113')](db[_0xeeb1('0x56')],{'as':'SmsApplications','foreignKey':_0xeeb1('0x189')});db[_0xeeb1('0x1b1')][_0xeeb1('0x14c')](db[_0xeeb1('0x3b')],{});db[_0xeeb1('0x1b1')][_0xeeb1('0x14c')](db['AnalyticDefaultReport'],{'foreignKey':_0xeeb1('0x1b2')});db[_0xeeb1('0x1b1')][_0xeeb1('0x14c')](db[_0xeeb1('0x9a')],{'foreignKey':_0xeeb1('0x1b3')});db[_0xeeb1('0x1b4')][_0xeeb1('0x122')](db[_0xeeb1('0x18')],{'as':_0xeeb1('0x1b5'),'through':'moh_has_sounds','onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x16d')][_0xeeb1('0x122')](db[_0xeeb1('0x125')],{'through':'cm_contact_has_tags'});db[_0xeeb1('0x16d')][_0xeeb1('0x122')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0xeeb1('0x16d')][_0xeeb1('0x122')](db['MailInteraction'],{'through':_0xeeb1('0x16e')});db['Tag'][_0xeeb1('0x122')](db[_0xeeb1('0x58')],{'through':_0xeeb1('0x18b')});db[_0xeeb1('0x16d')][_0xeeb1('0x122')](db[_0xeeb1('0x4e')],{'through':_0xeeb1('0x184')});db[_0xeeb1('0x16d')][_0xeeb1('0x122')](db[_0xeeb1('0x11b')],{'through':_0xeeb1('0x190')});db[_0xeeb1('0x16d')][_0xeeb1('0x122')](db[_0xeeb1('0x103')],{'through':'whatsapp_interaction_has_tags'});db[_0xeeb1('0x90')][_0xeeb1('0x14c')](db['ContactItemType'],{'as':_0xeeb1('0x1b6'),'foreignKey':'ItemTypeId'});db['CmHopperAdditionalPhone']['belongsTo'](db[_0xeeb1('0x75')],{'as':_0xeeb1('0x1b7'),'foreignKey':_0xeeb1('0x1a3')});db['CmContactHasItem']['belongsTo'](db[_0xeeb1('0x125')],{'as':'Contact','foreignKey':_0xeeb1('0x19c')});db['Trigger'][_0xeeb1('0x113')](db[_0xeeb1('0x86')],{'as':{'plural':_0xeeb1('0x1b8'),'singular':_0xeeb1('0x1b9')},'foreignKey':'TriggerAllId','onDelete':_0xeeb1('0x118'),'hooks':!![]});db[_0xeeb1('0x94')][_0xeeb1('0x113')](db[_0xeeb1('0x86')],{'as':{'plural':_0xeeb1('0x1ba'),'singular':_0xeeb1('0x1bb')},'foreignKey':_0xeeb1('0x1bc'),'onDelete':_0xeeb1('0x118'),'hooks':!![]});db[_0xeeb1('0x94')][_0xeeb1('0x113')](db[_0xeeb1('0x80')],{'as':_0xeeb1('0x1ac'),'foreignKey':_0xeeb1('0x1bd'),'onDelete':_0xeeb1('0x118'),'hooks':!![]});db[_0xeeb1('0x9a')][_0xeeb1('0x113')](db[_0xeeb1('0x9f')],{'as':_0xeeb1('0x1be'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1b3'),'hooks':!![]});db[_0xeeb1('0x1bf')][_0xeeb1('0x113')](db[_0xeeb1('0x9f')],{'as':_0xeeb1('0x1be'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1b2')});db['AnalyticMetric']['hasMany'](db[_0xeeb1('0x9f')],{'as':_0xeeb1('0x1be'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c0')});db[_0xeeb1('0x9f')]['belongsTo'](db[_0xeeb1('0x9e')],{'foreignKey':_0xeeb1('0x1c0')});db[_0xeeb1('0xa2')][_0xeeb1('0x113')](db[_0xeeb1('0xa4')],{'as':_0xeeb1('0x1c1'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0xa4')][_0xeeb1('0x113')](db[_0xeeb1('0xa5')],{'as':_0xeeb1('0x1c3'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xa4')][_0xeeb1('0x113')](db[_0xeeb1('0xa5')],{'as':_0xeeb1('0x1c5'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c6')});db['SalesforceConfiguration'][_0xeeb1('0x113')](db[_0xeeb1('0xa5')],{'as':_0xeeb1('0x1be'),'onDelete':_0xeeb1('0x118'),'foreignKey':'FieldId'});db[_0xeeb1('0xa4')][_0xeeb1('0x14c')](db[_0xeeb1('0xa2')],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0xa5')]['hasMany'](db[_0xeeb1('0xa5')],{'as':_0xeeb1('0x1c7'),'foreignKey':_0xeeb1('0x1c4')});db['SalesforceField'][_0xeeb1('0x113')](db[_0xeeb1('0xa5')],{'as':_0xeeb1('0x1c8'),'foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0xa5')][_0xeeb1('0x113')](db[_0xeeb1('0xa5')],{'as':_0xeeb1('0x1c9'),'foreignKey':_0xeeb1('0x1ca')});db['SalesforceField'][_0xeeb1('0x14c')](db[_0xeeb1('0x96')],{'as':_0xeeb1('0x96'),'foreignKey':_0xeeb1('0x1cb')});db['SugarcrmAccount'][_0xeeb1('0x113')](db[_0xeeb1('0xa8')],{'as':_0xeeb1('0x1c1'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c2')});db['SugarcrmConfiguration'][_0xeeb1('0x113')](db[_0xeeb1('0x1cc')],{'as':_0xeeb1('0x1c3'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xa8')][_0xeeb1('0x113')](db[_0xeeb1('0x1cc')],{'as':_0xeeb1('0x1c5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SugarcrmConfiguration']['hasMany'](db[_0xeeb1('0x1cc')],{'as':_0xeeb1('0x1be'),'onDelete':'cascade','foreignKey':_0xeeb1('0x1ca')});db[_0xeeb1('0xa8')][_0xeeb1('0x14c')](db[_0xeeb1('0xa6')],{'as':'Account','foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0x1cc')][_0xeeb1('0x113')](db[_0xeeb1('0x1cc')],{'as':_0xeeb1('0x1c7'),'foreignKey':_0xeeb1('0x1c4')});db['SugarcrmField'][_0xeeb1('0x113')](db[_0xeeb1('0x1cc')],{'as':_0xeeb1('0x1c8'),'foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0x1cc')][_0xeeb1('0x113')](db[_0xeeb1('0x1cc')],{'as':'Field','foreignKey':'FieldId'});db[_0xeeb1('0x1cc')][_0xeeb1('0x14c')](db[_0xeeb1('0x96')],{'as':_0xeeb1('0x96'),'foreignKey':'VariableId'});db[_0xeeb1('0xab')][_0xeeb1('0x113')](db[_0xeeb1('0xad')],{'as':_0xeeb1('0x1c1'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c2')});db['DeskConfiguration'][_0xeeb1('0x113')](db[_0xeeb1('0xae')],{'as':_0xeeb1('0x1c3'),'onDelete':'cascade','foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xad')][_0xeeb1('0x113')](db['DeskField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xeeb1('0x113')](db[_0xeeb1('0xae')],{'as':_0xeeb1('0x1be'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1ca')});db[_0xeeb1('0xad')]['belongsTo'](db['DeskAccount'],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x1c2')});db['DeskConfiguration']['belongsToMany'](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x1cd')});db[_0xeeb1('0xae')][_0xeeb1('0x113')](db[_0xeeb1('0xae')],{'as':_0xeeb1('0x1c7'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xae')][_0xeeb1('0x113')](db[_0xeeb1('0xae')],{'as':_0xeeb1('0x1c8'),'foreignKey':_0xeeb1('0x1c6')});db['DeskField'][_0xeeb1('0x113')](db[_0xeeb1('0xae')],{'as':_0xeeb1('0x1c9'),'foreignKey':'FieldId'});db[_0xeeb1('0xae')][_0xeeb1('0x14c')](db[_0xeeb1('0x96')],{'as':_0xeeb1('0x96'),'foreignKey':_0xeeb1('0x1cb')});db[_0xeeb1('0xb0')][_0xeeb1('0x113')](db[_0xeeb1('0xb2')],{'as':_0xeeb1('0x1c1'),'onDelete':_0xeeb1('0x118'),'foreignKey':'AccountId'});db[_0xeeb1('0xb2')][_0xeeb1('0x113')](db[_0xeeb1('0x1ce')],{'as':'Subjects','onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xb2')][_0xeeb1('0x113')](db[_0xeeb1('0x1ce')],{'as':_0xeeb1('0x1c5'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0xb2')][_0xeeb1('0x113')](db[_0xeeb1('0x1ce')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xeeb1('0x1ca')});db[_0xeeb1('0xb2')][_0xeeb1('0x14c')](db[_0xeeb1('0xb0')],{'as':_0xeeb1('0x182'),'foreignKey':'AccountId'});db[_0xeeb1('0x1ce')]['hasMany'](db[_0xeeb1('0x1ce')],{'as':_0xeeb1('0x1c7'),'foreignKey':'SubjectId'});db[_0xeeb1('0x1ce')]['hasMany'](db[_0xeeb1('0x1ce')],{'as':'Description','foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0x1ce')]['hasMany'](db[_0xeeb1('0x1ce')],{'as':_0xeeb1('0x1c9'),'foreignKey':'FieldId'});db[_0xeeb1('0x1ce')][_0xeeb1('0x14c')](db['Variable'],{'as':_0xeeb1('0x96'),'foreignKey':_0xeeb1('0x1cb')});db[_0xeeb1('0xb5')][_0xeeb1('0x113')](db['ZendeskConfiguration'],{'as':_0xeeb1('0x1c1'),'onDelete':'cascade','foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0xb7')][_0xeeb1('0x113')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xb7')]['hasMany'](db[_0xeeb1('0xb9')],{'as':'Descriptions','foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0xb7')][_0xeeb1('0x113')](db['ZendeskField'],{'as':_0xeeb1('0x1be'),'foreignKey':_0xeeb1('0x1ca')});db['ZendeskConfiguration'][_0xeeb1('0x14c')](db[_0xeeb1('0xb5')],{'as':_0xeeb1('0x182'),'foreignKey':'AccountId'});db[_0xeeb1('0xb7')]['belongsToMany'](db['Tag'],{'through':_0xeeb1('0x1cf')});db[_0xeeb1('0xb9')][_0xeeb1('0x113')](db[_0xeeb1('0xb9')],{'as':_0xeeb1('0x1c7'),'foreignKey':'SubjectId'});db[_0xeeb1('0xb9')]['hasMany'](db['ZendeskField'],{'as':_0xeeb1('0x1c8'),'foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0xb9')][_0xeeb1('0x113')](db[_0xeeb1('0xb9')],{'as':'Field','foreignKey':_0xeeb1('0x1ca')});db['ZendeskField'][_0xeeb1('0x14c')](db[_0xeeb1('0x96')],{'as':_0xeeb1('0x96'),'foreignKey':_0xeeb1('0x1cb')});db[_0xeeb1('0xbb')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0xeeb1('0x1c1'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0x1d0')][_0xeeb1('0x113')](db[_0xeeb1('0x1d1')],{'as':_0xeeb1('0x1c3'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c4')});db['FreshdeskConfiguration'][_0xeeb1('0x113')](db[_0xeeb1('0x1d1')],{'as':_0xeeb1('0x1c5'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0x1d0')][_0xeeb1('0x113')](db[_0xeeb1('0x1d1')],{'as':_0xeeb1('0x1be'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1ca')});db[_0xeeb1('0x1d0')][_0xeeb1('0x14c')](db[_0xeeb1('0xbb')],{'as':_0xeeb1('0x182'),'foreignKey':'AccountId'});db[_0xeeb1('0x1d0')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x1d2')});db[_0xeeb1('0x1d1')][_0xeeb1('0x113')](db['FreshdeskField'],{'as':_0xeeb1('0x1c7'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0x1d1')][_0xeeb1('0x113')](db[_0xeeb1('0x1d1')],{'as':_0xeeb1('0x1c8'),'foreignKey':'DescriptionId'});db[_0xeeb1('0x1d1')]['hasMany'](db[_0xeeb1('0x1d1')],{'as':_0xeeb1('0x1c9'),'foreignKey':_0xeeb1('0x1ca')});db[_0xeeb1('0x1d1')][_0xeeb1('0x14c')](db[_0xeeb1('0x96')],{'as':_0xeeb1('0x96'),'foreignKey':'VariableId'});db[_0xeeb1('0xbd')][_0xeeb1('0x113')](db[_0xeeb1('0xbf')],{'as':_0xeeb1('0x1c1'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0xbf')][_0xeeb1('0x113')](db[_0xeeb1('0xc1')],{'as':_0xeeb1('0x1c3'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xbf')][_0xeeb1('0x113')](db['VtigerField'],{'as':_0xeeb1('0x1c5'),'foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0xbf')][_0xeeb1('0x113')](db['VtigerField'],{'as':'Fields','foreignKey':_0xeeb1('0x1ca')});db[_0xeeb1('0xbf')][_0xeeb1('0x14c')](db['VtigerAccount'],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0xc1')]['hasMany'](db[_0xeeb1('0xc1')],{'as':_0xeeb1('0x1c7'),'foreignKey':'SubjectId'});db[_0xeeb1('0xc1')][_0xeeb1('0x113')](db[_0xeeb1('0xc1')],{'as':_0xeeb1('0x1c8'),'foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0xc1')][_0xeeb1('0x113')](db['VtigerField'],{'as':_0xeeb1('0x1c9'),'foreignKey':_0xeeb1('0x1ca')});db[_0xeeb1('0xc1')]['belongsTo'](db[_0xeeb1('0x96')],{'as':_0xeeb1('0x96'),'foreignKey':_0xeeb1('0x1cb')});db['ServicenowAccount']['hasMany'](db[_0xeeb1('0xc5')],{'as':'Configurations','onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0xc5')]['hasMany'](db[_0xeeb1('0xc6')],{'as':'Subjects','foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xc5')][_0xeeb1('0x113')](db[_0xeeb1('0xc6')],{'as':'Descriptions','foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0xc5')][_0xeeb1('0x113')](db['ServicenowField'],{'as':'Fields','foreignKey':_0xeeb1('0x1ca')});db[_0xeeb1('0xc5')]['belongsTo'](db[_0xeeb1('0xc3')],{'as':_0xeeb1('0x182'),'foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0xc6')][_0xeeb1('0x113')](db['ServicenowField'],{'as':_0xeeb1('0x1c7'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xc6')]['hasMany'](db[_0xeeb1('0xc6')],{'as':_0xeeb1('0x1c8'),'foreignKey':'DescriptionId'});db[_0xeeb1('0xc6')]['hasMany'](db['ServicenowField'],{'as':'Field','foreignKey':'FieldId'});db[_0xeeb1('0xc6')]['belongsTo'](db[_0xeeb1('0x96')],{'as':_0xeeb1('0x96'),'foreignKey':_0xeeb1('0x1cb')});db['Dynamics365Account']['hasMany'](db[_0xeeb1('0xc8')],{'as':_0xeeb1('0x1c1'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c2')});db['Dynamics365Account'][_0xeeb1('0x14c')](db[_0xeeb1('0x161')],{'as':_0xeeb1('0x161'),'foreignKey':_0xeeb1('0x1d3')});db['Dynamics365Configuration'][_0xeeb1('0x113')](db[_0xeeb1('0xc9')],{'as':_0xeeb1('0x1c3'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xc8')]['hasMany'](db[_0xeeb1('0xc9')],{'as':_0xeeb1('0x1c5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xeeb1('0xc8')]['hasMany'](db[_0xeeb1('0xc9')],{'as':_0xeeb1('0x1be'),'onDelete':'cascade','foreignKey':_0xeeb1('0x1ca')});db['Dynamics365Configuration']['belongsTo'](db[_0xeeb1('0x1d4')],{'as':'Account','foreignKey':_0xeeb1('0x1c2')});db[_0xeeb1('0xc9')]['hasMany'](db[_0xeeb1('0xc9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xeeb1('0xc9')][_0xeeb1('0x113')](db[_0xeeb1('0xc9')],{'as':_0xeeb1('0x1c8'),'foreignKey':'DescriptionId'});db[_0xeeb1('0xc9')][_0xeeb1('0x113')](db[_0xeeb1('0xc9')],{'as':'Field','foreignKey':'FieldId'});db['Dynamics365Field']['belongsTo'](db['Variable'],{'as':_0xeeb1('0x96'),'foreignKey':_0xeeb1('0x1cb')});db[_0xeeb1('0xcb')][_0xeeb1('0x113')](db['FreshsalesConfiguration'],{'as':_0xeeb1('0x1c1'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1c2')});db['FreshsalesConfiguration'][_0xeeb1('0x113')](db[_0xeeb1('0xcf')],{'as':'Subjects','foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xcd')][_0xeeb1('0x113')](db[_0xeeb1('0xcf')],{'as':'Descriptions','foreignKey':_0xeeb1('0x1c6')});db[_0xeeb1('0xcd')]['hasMany'](db[_0xeeb1('0xcf')],{'as':_0xeeb1('0x1be'),'foreignKey':'FieldId'});db[_0xeeb1('0xcd')][_0xeeb1('0x14c')](db[_0xeeb1('0xcb')],{'as':_0xeeb1('0x182'),'foreignKey':'AccountId'});db[_0xeeb1('0xcf')][_0xeeb1('0x113')](db[_0xeeb1('0xcf')],{'as':_0xeeb1('0x1c7'),'foreignKey':_0xeeb1('0x1c4')});db[_0xeeb1('0xcf')][_0xeeb1('0x113')](db[_0xeeb1('0xcf')],{'as':_0xeeb1('0x1c8'),'foreignKey':_0xeeb1('0x1c6')});db['FreshsalesField'][_0xeeb1('0x113')](db[_0xeeb1('0xcf')],{'as':_0xeeb1('0x1c9'),'foreignKey':'FieldId'});db[_0xeeb1('0xcf')][_0xeeb1('0x14c')](db[_0xeeb1('0x96')],{'as':'Variable','foreignKey':_0xeeb1('0x1cb')});db[_0xeeb1('0xd3')][_0xeeb1('0x14c')](db[_0xeeb1('0x65')],{});db[_0xeeb1('0xd3')]['belongsTo'](db[_0xeeb1('0xf6')],{'as':'List','foreignKey':_0xeeb1('0x179')});db['ChatQueueReport']['belongsTo'](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0xd3')][_0xeeb1('0x14c')](db[_0xeeb1('0x6a')],{});db[_0xeeb1('0xd3')]['belongsTo'](db[_0xeeb1('0x6c')],{});db[_0xeeb1('0xd3')][_0xeeb1('0x14c')](db['User'],{});db[_0xeeb1('0xd3')][_0xeeb1('0x14c')](db[_0xeeb1('0x132')],{});db[_0xeeb1('0xd5')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1d5')});db[_0xeeb1('0xd5')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'onDelete':'cascade','foreignKey':_0xeeb1('0x1d6')});db[_0xeeb1('0x14a')]['hasMany'](db[_0xeeb1('0xd8')],{'foreignKey':_0xeeb1('0x1d7'),'onDelete':'cascade'});db[_0xeeb1('0x14a')][_0xeeb1('0x113')](db[_0xeeb1('0xd7')],{'foreignKey':_0xeeb1('0x1d7'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0x1d8')]['belongsTo'](db[_0xeeb1('0x54')],{});db[_0xeeb1('0x1d8')][_0xeeb1('0x14c')](db[_0xeeb1('0xf6')],{'as':'List','foreignKey':_0xeeb1('0x179')});db[_0xeeb1('0x1d8')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x1d8')][_0xeeb1('0x14c')](db[_0xeeb1('0x58')],{});db[_0xeeb1('0x1d8')][_0xeeb1('0x14c')](db[_0xeeb1('0x5a')],{});db[_0xeeb1('0x1d8')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{});db[_0xeeb1('0x1d8')][_0xeeb1('0x14c')](db[_0xeeb1('0x5c')],{});db[_0xeeb1('0xdf')][_0xeeb1('0x113')](db[_0xeeb1('0x14a')],{'foreignKey':_0xeeb1('0x1d9')});db[_0xeeb1('0xdf')][_0xeeb1('0x113')](db['JscriptyQuestionReport'],{'foreignKey':_0xeeb1('0x1d9')});db['JscriptyProject'][_0xeeb1('0x113')](db[_0xeeb1('0xd7')],{'foreignKey':_0xeeb1('0x1d9')});db[_0xeeb1('0xe4')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x171'),'through':_0xeeb1('0x142')});db['Team'][_0xeeb1('0x122')](db['User'],{'as':_0xeeb1('0x152'),'through':_0xeeb1('0x129')});db['Team'][_0xeeb1('0x122')](db['VoiceQueue'],{'through':_0xeeb1('0x10b'),'as':_0xeeb1('0x12f')});db[_0xeeb1('0x128')][_0xeeb1('0x122')](db['MailQueue'],{'through':_0xeeb1('0x16b'),'as':_0xeeb1('0x1da')});db['Team'][_0xeeb1('0x122')](db[_0xeeb1('0x132')],{'through':_0xeeb1('0x1db'),'as':_0xeeb1('0x133')});db[_0xeeb1('0x128')]['belongsToMany'](db[_0xeeb1('0x52')],{'through':_0xeeb1('0x186'),'as':_0xeeb1('0x1dc')});db[_0xeeb1('0x128')]['belongsToMany'](db[_0xeeb1('0x5c')],{'through':_0xeeb1('0x18c'),'as':'SmsQueues'});db['Team'][_0xeeb1('0x122')](db[_0xeeb1('0x135')],{'through':_0xeeb1('0x192'),'as':_0xeeb1('0x1dd')});db[_0xeeb1('0x128')][_0xeeb1('0x122')](db['WhatsappQueue'],{'through':'team_has_whatsapp_queues','as':_0xeeb1('0x136')});db[_0xeeb1('0x128')][_0xeeb1('0x122')](db[_0xeeb1('0xf7')],{'through':_0xeeb1('0x10c'),'as':_0xeeb1('0x130')});db[_0xeeb1('0xe9')][_0xeeb1('0x113')](db[_0xeeb1('0x75')],{'as':'Hoppers','foreignKey':_0xeeb1('0x1a4')});db['Campaign'][_0xeeb1('0x113')](db[_0xeeb1('0x79')],{'as':_0xeeb1('0x119'),'foreignKey':_0xeeb1('0x1a4')});db['Campaign']['hasMany'](db['CmHopperHistory'],{'as':_0xeeb1('0x19e'),'foreignKey':_0xeeb1('0x1a4')});db[_0xeeb1('0xe9')][_0xeeb1('0x113')](db[_0xeeb1('0x77')],{'as':'HopperBlacks','foreignKey':_0xeeb1('0x1a4')});db[_0xeeb1('0xe9')]['belongsTo'](db[_0xeeb1('0x14d')],{'as':_0xeeb1('0x14d'),'foreignKey':_0xeeb1('0x1de')});db[_0xeeb1('0xe9')][_0xeeb1('0x14c')](db[_0xeeb1('0x14d')],{'as':_0xeeb1('0x14e'),'foreignKey':_0xeeb1('0x14f')});db[_0xeeb1('0xe9')][_0xeeb1('0x14c')](db[_0xeeb1('0x87')],{'as':_0xeeb1('0x87'),'foreignKey':_0xeeb1('0x189')});db[_0xeeb1('0xe9')]['belongsTo'](db[_0xeeb1('0xe4')],{'as':_0xeeb1('0xe4'),'foreignKey':_0xeeb1('0x1df')});db['Campaign'][_0xeeb1('0x122')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x150'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0xeeb1('0x122')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x154'),'through':_0xeeb1('0x1e0')});db[_0xeeb1('0xec')][_0xeeb1('0x14c')](db[_0xeeb1('0x6d')],{'as':_0xeeb1('0x6d'),'foreignKey':_0xeeb1('0x176')});db[_0xeeb1('0xed')][_0xeeb1('0x14c')](db[_0xeeb1('0x43')],{});db[_0xeeb1('0xed')]['belongsTo'](db[_0xeeb1('0x41')],{});db['MailTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x3b')],{'foreignKey':'FromMailAccountId','as':_0xeeb1('0x1e1')});db[_0xeeb1('0xed')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'foreignKey':_0xeeb1('0x1e2'),'as':'FromAgent'});db[_0xeeb1('0xed')][_0xeeb1('0x14c')](db['User'],{'foreignKey':_0xeeb1('0x1e3'),'as':'ToAgent'});db['MailTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x3d')],{'foreignKey':_0xeeb1('0x1e4'),'as':_0xeeb1('0x1e5')});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0xeeb1('0x1e6'),'as':_0xeeb1('0x1e7')});db[_0xeeb1('0xef')][_0xeeb1('0x14c')](db[_0xeeb1('0x6c')],{});db[_0xeeb1('0xef')][_0xeeb1('0x14c')](db[_0xeeb1('0x6a')],{});db['ChatTransferReport'][_0xeeb1('0x14c')](db['ChatWebsite'],{'foreignKey':_0xeeb1('0x1e8'),'as':_0xeeb1('0x1e1')});db[_0xeeb1('0xef')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'foreignKey':'FromUserId','as':_0xeeb1('0x1e9')});db[_0xeeb1('0xef')][_0xeeb1('0x14c')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xeeb1('0xef')][_0xeeb1('0x14c')](db[_0xeeb1('0x132')],{'foreignKey':'ToChatQueueId','as':_0xeeb1('0x1e5')});db[_0xeeb1('0xef')][_0xeeb1('0x14c')](db['ChatWebsite'],{'foreignKey':_0xeeb1('0x1ea'),'as':_0xeeb1('0x1e7')});db[_0xeeb1('0xf1')][_0xeeb1('0x14c')](db[_0xeeb1('0x50')],{});db[_0xeeb1('0xf1')][_0xeeb1('0x14c')](db[_0xeeb1('0x4e')],{});db[_0xeeb1('0xf1')][_0xeeb1('0x14c')](db[_0xeeb1('0x17c')],{'foreignKey':_0xeeb1('0x1eb'),'as':'FromAccount'});db['FaxTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'foreignKey':_0xeeb1('0x1e2'),'as':'FromAgent'});db['FaxTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'foreignKey':'ToUserId','as':_0xeeb1('0x1ec')});db['FaxTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x52')],{'foreignKey':_0xeeb1('0x1ed'),'as':_0xeeb1('0x1e5')});db[_0xeeb1('0xf1')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xeeb1('0x1ee'),'as':_0xeeb1('0x1e7')});db[_0xeeb1('0xf3')][_0xeeb1('0x14c')](db[_0xeeb1('0x63')],{});db[_0xeeb1('0xf3')][_0xeeb1('0x14c')](db['OpenchannelInteraction'],{});db[_0xeeb1('0xf3')][_0xeeb1('0x14c')](db[_0xeeb1('0x5e')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0xeeb1('0xf3')][_0xeeb1('0x14c')](db['User'],{'foreignKey':_0xeeb1('0x1e2'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0xeeb1('0x14c')](db['User'],{'foreignKey':_0xeeb1('0x1e3'),'as':_0xeeb1('0x1ec')});db[_0xeeb1('0xf3')][_0xeeb1('0x14c')](db[_0xeeb1('0x135')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0xeeb1('0xf3')][_0xeeb1('0x14c')](db[_0xeeb1('0x5e')],{'foreignKey':_0xeeb1('0x1ef'),'as':_0xeeb1('0x1e7')});db[_0xeeb1('0xf4')][_0xeeb1('0x14c')](db[_0xeeb1('0x5a')],{});db['SmsTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x58')],{});db[_0xeeb1('0xf4')][_0xeeb1('0x14c')](db[_0xeeb1('0x54')],{'foreignKey':_0xeeb1('0x1f0'),'as':_0xeeb1('0x1e1')});db['SmsTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'foreignKey':_0xeeb1('0x1e2'),'as':_0xeeb1('0x1e9')});db[_0xeeb1('0xf4')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'foreignKey':_0xeeb1('0x1e3'),'as':_0xeeb1('0x1ec')});db[_0xeeb1('0xf4')][_0xeeb1('0x14c')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0xeeb1('0x1e5')});db['SmsTransferReport']['belongsTo'](db[_0xeeb1('0x54')],{'foreignKey':_0xeeb1('0x1f1'),'as':'ToAccount'});db[_0xeeb1('0xf6')]['hasMany'](db[_0xeeb1('0x84')],{'as':_0xeeb1('0x17d'),'foreignKey':_0xeeb1('0x179'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0xf6')][_0xeeb1('0x113')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0xeeb1('0x179')});db[_0xeeb1('0xf6')]['hasMany'](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x126'),'onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x179')});db[_0xeeb1('0xf6')][_0xeeb1('0x113')](db['CmHopperFinal'],{'as':_0xeeb1('0x119'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xeeb1('0x7a')],{'as':_0xeeb1('0x11a'),'foreignKey':_0xeeb1('0x179')});db[_0xeeb1('0xf6')]['hasMany'](db[_0xeeb1('0x7c')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xeeb1('0xf6')][_0xeeb1('0x122')](db[_0xeeb1('0x148')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db['CmList'][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':'Agents','through':_0xeeb1('0x127')});db['VoicePrefix'][_0xeeb1('0x113')](db[_0xeeb1('0x116')],{'as':_0xeeb1('0x117'),'onDelete':'cascade'});db[_0xeeb1('0xf7')][_0xeeb1('0x122')](db['User'],{'as':_0xeeb1('0x152'),'through':_0xeeb1('0x131')});db[_0xeeb1('0xf7')]['belongsToMany'](db['Team'],{'through':_0xeeb1('0x10c'),'as':_0xeeb1('0x153')});db[_0xeeb1('0xf9')][_0xeeb1('0x113')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x171'),'foreignKey':_0xeeb1('0x1f2')});db[_0xeeb1('0xf9')][_0xeeb1('0x113')](db[_0xeeb1('0xfa')],{'as':'UserProfileSections','foreignKey':_0xeeb1('0x1f2'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0xfa')]['hasMany'](db['UserProfileResource'],{'as':_0xeeb1('0x1f3'),'foreignKey':_0xeeb1('0x1f4'),'onDelete':_0xeeb1('0x118')});db[_0xeeb1('0xff')][_0xeeb1('0x113')](db[_0xeeb1('0x84')],{'as':'Dispositions','foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xeeb1('0xff')][_0xeeb1('0x113')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xeeb1('0x1f5')});db[_0xeeb1('0xff')][_0xeeb1('0x113')](db[_0xeeb1('0x105')],{'as':_0xeeb1('0x157'),'foreignKey':_0xeeb1('0x1f5')});db[_0xeeb1('0xff')][_0xeeb1('0x113')](db[_0xeeb1('0x103')],{'as':_0xeeb1('0x165')});db[_0xeeb1('0xff')]['hasMany'](db[_0xeeb1('0x101')],{'as':_0xeeb1('0x146')});db[_0xeeb1('0xff')]['belongsTo'](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x166'),'foreignKey':_0xeeb1('0x179')});db[_0xeeb1('0xff')][_0xeeb1('0x14c')](db[_0xeeb1('0x88')],{'as':_0xeeb1('0x169'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xeeb1('0xff')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x152'),'through':'user_has_whatsapp_accounts'});db[_0xeeb1('0x101')]['belongsTo'](db[_0xeeb1('0x112')],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x101')][_0xeeb1('0x14c')](db[_0xeeb1('0x108')],{'onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x101')][_0xeeb1('0x14c')](db[_0xeeb1('0xff')],{'onDelete':_0xeeb1('0x162')});db['WhatsappApplication']['belongsTo'](db[_0xeeb1('0x87')],{'onDelete':_0xeeb1('0x162'),'foreignKey':'IntervalId'});db[_0xeeb1('0x101')][_0xeeb1('0x14c')](db[_0xeeb1('0x16d')],{'onDelete':'restrict','foreignKey':_0xeeb1('0x177')});db['WhatsappInteraction'][_0xeeb1('0x113')](db[_0xeeb1('0x105')],{'as':'Messages','onDelete':_0xeeb1('0x118'),'foreignKey':_0xeeb1('0x1f6')});db[_0xeeb1('0x103')][_0xeeb1('0x14c')](db[_0xeeb1('0xff')],{'as':_0xeeb1('0x182'),'foreignKey':'WhatsappAccountId'});db[_0xeeb1('0x103')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x103')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'as':'Owner','foreignKey':_0xeeb1('0x111')});db[_0xeeb1('0x103')][_0xeeb1('0x122')](db[_0xeeb1('0x16d')],{'through':_0xeeb1('0x1f7'),'as':_0xeeb1('0x16f')});db[_0xeeb1('0x103')]['belongsToMany'](db[_0xeeb1('0x16d')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0xeeb1('0x1f6')});db[_0xeeb1('0x105')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'as':_0xeeb1('0x112')});db[_0xeeb1('0x105')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'onDelete':_0xeeb1('0x118'),'as':_0xeeb1('0x15d')});db['WhatsappMessage'][_0xeeb1('0x14c')](db[_0xeeb1('0x103')],{'onDelete':_0xeeb1('0x118'),'as':'Interaction','foreignKey':_0xeeb1('0x1f6')});db['WhatsappMessage'][_0xeeb1('0x14c')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xeeb1('0x1f5')});db[_0xeeb1('0x106')]['belongsTo'](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0xeeb1('0x14c')](db[_0xeeb1('0xf6')],{'as':_0xeeb1('0x166'),'foreignKey':_0xeeb1('0x179')});db[_0xeeb1('0x106')][_0xeeb1('0x14c')](db[_0xeeb1('0x125')],{'as':_0xeeb1('0x15d'),'foreignKey':_0xeeb1('0x15e')});db[_0xeeb1('0x106')][_0xeeb1('0x14c')](db[_0xeeb1('0x103')],{});db[_0xeeb1('0x106')][_0xeeb1('0x14c')](db[_0xeeb1('0x108')],{});db[_0xeeb1('0x106')][_0xeeb1('0x14c')](db[_0xeeb1('0x105')],{});db[_0xeeb1('0x106')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{});db[_0xeeb1('0x1f8')]['belongsTo'](db['WhatsappMessage'],{});db[_0xeeb1('0x1f8')][_0xeeb1('0x14c')](db[_0xeeb1('0x103')],{});db[_0xeeb1('0x1f8')][_0xeeb1('0x14c')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0xeeb1('0x1e1')});db['WhatsappTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0xff')],{'foreignKey':_0xeeb1('0x1f9'),'as':'ToAccount'});db['WhatsappTransferReport'][_0xeeb1('0x14c')](db[_0xeeb1('0x108')],{'foreignKey':_0xeeb1('0x1fa'),'as':'ToQueue'});db[_0xeeb1('0x1f8')][_0xeeb1('0x14c')](db[_0xeeb1('0x112')],{'foreignKey':_0xeeb1('0x1e2'),'as':_0xeeb1('0x1e9')});db[_0xeeb1('0x1f8')]['belongsTo'](db[_0xeeb1('0x112')],{'foreignKey':_0xeeb1('0x1e3'),'as':_0xeeb1('0x1ec')});db[_0xeeb1('0x108')][_0xeeb1('0x122')](db[_0xeeb1('0x112')],{'as':'Agents','through':_0xeeb1('0x36'),'foreignKey':_0xeeb1('0x1fb')});db[_0xeeb1('0x108')][_0xeeb1('0x122')](db[_0xeeb1('0x128')],{'through':_0xeeb1('0x1fc'),'as':_0xeeb1('0x153')});db['UserSetting']['belongsTo'](db['User'],{'as':_0xeeb1('0x1fd'),'foreignKey':_0xeeb1('0x111'),'onDelete':_0xeeb1('0x118'),'hooks':!![]});db[_0xeeb1('0x161')][_0xeeb1('0x10f')](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0xeeb1('0x162')});db[_0xeeb1('0x161')][_0xeeb1('0x10f')](db[_0xeeb1('0x15f')],{'as':'Imap','onDelete':_0xeeb1('0x162')});db['CloudProvider'][_0xeeb1('0x10f')](db['MailServerOut'],{'as':_0xeeb1('0x164'),'onDelete':_0xeeb1('0x162')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xe9b1=['OpenchannelAccount','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Tag','../api/tag/tag.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../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','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','hasMany','UserId','Extensions','CmHopperFinal','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','UserProfile','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteraction','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','UserFaxQueue','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceContext','Sound','moh_has_sounds','Members','CmHopper','HopperFinals','HopperHistories','ReportAgentPreview','VoiceQueueId','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','voice_queues_has_cm_blacklists','mailbox','mailboxuser','uniqueid','AgentReports','VoiceCallReport','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Messages','Applications','List','ListId','Template','TemplateId','user_has_mail_accounts','Teams','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','ThroughTags','Users','ChatOfflineMessageId','Items','FaxAccountId','Interactions','FaxApplication','fax_interaction_has_tags','FaxInteractionId','Interaction','team_has_fax_queues','SmsAccountId','IntervalId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','TagId','OpenchannelInteractionId','openchannel_interaction_has_tags','Tags','AttachmentId','ChatWebsiteId','ProactiveActions','ChatQueueId','Website','ChatInteractionId','Attachments','team_has_chat_queues','ChatGroupId','Company','CompanyId','cm_contact_has_tags','OwnerId','Queue','CampaignId','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','SalesforceAccount','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Description','Field','VariableId','Configurations','Subject','Descriptions','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','VtigerConfiguration','VtigerField','FreshsalesAccount','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','team_has_mail_queues','Hoppers','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','motion2','xcall','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','xC@LL1234','name','database','username','password','options','sequelizeHistory','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage'];(function(_0x452853,_0x34a19f){var _0x2d7496=function(_0x4cb522){while(--_0x4cb522){_0x452853['push'](_0x452853['shift']());}};_0x2d7496(++_0x34a19f);}(_0xe9b1,0x193));var _0x1e9b=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0xe9b1[_0x217ff6];return _0x417c93;};'use strict';var config=require(_0x1e9b('0x0'));var Sequelize=require(_0x1e9b('0x1'));var _=require(_0x1e9b('0x2'));var jstz=require(_0x1e9b('0x3'));var timezone=jstz['determine']();config[_0x1e9b('0x1')]=_['defaultsDeep'](config[_0x1e9b('0x1')],{'database':_0x1e9b('0x4'),'username':_0x1e9b('0x5'),'password':'xC@LL1234','options':{'host':_0x1e9b('0x6'),'port':0xcea,'dialect':_0x1e9b('0x7'),'dialectOptions':{'charset':_0x1e9b('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x1e9b('0x9'),'collate':_0x1e9b('0xa')}}});config['sequelizeHistory']=_['defaultsDeep'](config['sequelizeHistory'],{'database':'motion2','username':_0x1e9b('0x5'),'password':_0x1e9b('0xb'),'options':{'host':_0x1e9b('0x6'),'port':0xcea,'dialect':_0x1e9b('0x7'),'dialectOptions':{'charset':_0x1e9b('0x8')},'logging':![],'timezone':timezone[_0x1e9b('0xc')](),'define':{'charset':'utf8','collate':_0x1e9b('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1e9b('0x1')][_0x1e9b('0xd')],config[_0x1e9b('0x1')][_0x1e9b('0xe')],config[_0x1e9b('0x1')][_0x1e9b('0xf')],config[_0x1e9b('0x1')][_0x1e9b('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1e9b('0x11')][_0x1e9b('0xd')],config[_0x1e9b('0x11')][_0x1e9b('0xe')],config[_0x1e9b('0x11')][_0x1e9b('0xf')],config['sequelizeHistory'][_0x1e9b('0x10')])};db[_0x1e9b('0x12')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x14'));db[_0x1e9b('0x15')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x16'));db['VoiceContext']=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x17'));db[_0x1e9b('0x18')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x19'));db[_0x1e9b('0x1a')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db['sequelize'][_0x1e9b('0x13')]('../api/voiceQueue/voiceQueue.model');db[_0x1e9b('0x1b')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x1c'));db[_0x1e9b('0x1d')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x1e'));db[_0x1e9b('0x1f')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x20'));db[_0x1e9b('0x21')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x22'));db['VoiceCallReport']=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x23'));db['VoiceDialReport']=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x24'));db[_0x1e9b('0x25')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x26'));db[_0x1e9b('0x27')]=db['sequelize'][_0x1e9b('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x1e9b('0x28')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x29'));db[_0x1e9b('0x2a')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x2b'));db[_0x1e9b('0x2c')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x2d'));db[_0x1e9b('0x2e')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x2f'));db[_0x1e9b('0x30')]=db[_0x1e9b('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x1e9b('0x31')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x32'));db[_0x1e9b('0x33')]=db[_0x1e9b('0x1')]['import']('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x1e9b('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x1e9b('0x34')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x35'));db[_0x1e9b('0x36')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x37'));db[_0x1e9b('0x38')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x39'));db[_0x1e9b('0x3a')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x1e9b('0x3b')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x3c'));db[_0x1e9b('0x3d')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x3e'));db[_0x1e9b('0x3f')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x40'));db['MailSubstatus']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x41'));db['MailInteraction']=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x42'));db[_0x1e9b('0x43')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x44'));db[_0x1e9b('0x45')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x46'));db[_0x1e9b('0x47')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x48'));db[_0x1e9b('0x49')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x4a'));db[_0x1e9b('0x4b')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x4c'));db[_0x1e9b('0x4d')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x4e'));db[_0x1e9b('0x4f')]=db['sequelize']['import'](_0x1e9b('0x50'));db[_0x1e9b('0x51')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x52'));db[_0x1e9b('0x53')]=db[_0x1e9b('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0x1e9b('0x54')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x1e9b('0x55')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/smsAccount/smsAccount.model');db[_0x1e9b('0x56')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x57'));db[_0x1e9b('0x58')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x59'));db[_0x1e9b('0x5a')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/smsQueue/smsQueue.model');db[_0x1e9b('0x5b')]=db[_0x1e9b('0x1')]['import']('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0x1e9b('0x5c')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x5d'));db[_0x1e9b('0x5e')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x5f'));db[_0x1e9b('0x60')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x61'));db[_0x1e9b('0x62')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x63'));db[_0x1e9b('0x64')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x65'));db[_0x1e9b('0x66')]=db['sequelize'][_0x1e9b('0x13')]('../api/chatApplication/chatApplication.model');db[_0x1e9b('0x67')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x68'));db[_0x1e9b('0x69')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/chatMessage/chatMessage.model');db[_0x1e9b('0x6a')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x6b'));db[_0x1e9b('0x6c')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/chatQueue/chatQueue.model');db[_0x1e9b('0x6d')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/chatGroup/chatGroup.model');db[_0x1e9b('0x6e')]=db[_0x1e9b('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x1e9b('0x6f')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/cmCompany/cmCompany.model');db[_0x1e9b('0x70')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x71'));db['CmHopper']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x72'));db[_0x1e9b('0x73')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x74'));db['CmHopperFinal']=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x75'));db[_0x1e9b('0x76')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x77'));db['ReportAgentPreview']=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x78'));db[_0x1e9b('0x79')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x7a'));db[_0x1e9b('0x7b')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x7c'));db[_0x1e9b('0x7d')]=db['sequelize'][_0x1e9b('0x13')]('../api/automation/automation.model');db[_0x1e9b('0x7e')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x7f'));db[_0x1e9b('0x80')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x81'));db[_0x1e9b('0x82')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x83'));db[_0x1e9b('0x84')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/interval/interval.model');db[_0x1e9b('0x85')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x86'));db[_0x1e9b('0x87')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x88'));db['VoiceQueuesLog']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x89'));db[_0x1e9b('0x8a')]=db['sequelize'][_0x1e9b('0x13')]('../api/schedule/schedule.model');db['Sound']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x8b'));db[_0x1e9b('0x8c')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x8d'));db['Template']=db['sequelize'][_0x1e9b('0x13')]('../api/template/template.model');db[_0x1e9b('0x8e')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x8f'));db[_0x1e9b('0x90')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x91'));db[_0x1e9b('0x92')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x93'));db[_0x1e9b('0x94')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x95'));db[_0x1e9b('0x96')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x97'));db[_0x1e9b('0x98')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x1e9b('0x99')]=db['sequelize'][_0x1e9b('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x1e9b('0x9a')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x9b'));db[_0x1e9b('0x9c')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x9d'));db[_0x1e9b('0x9e')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x9f'));db['SalesforceAccount']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xa0'));db[_0x1e9b('0xa1')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0xa2'));db[_0x1e9b('0xa3')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xa4'));db[_0x1e9b('0xa5')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0xa6'));db[_0x1e9b('0xa7')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xa8'));db[_0x1e9b('0xa9')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xaa'));db[_0x1e9b('0xab')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xac'));db[_0x1e9b('0xad')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0xae'));db[_0x1e9b('0xaf')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xb0'));db[_0x1e9b('0xb1')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x1e9b('0xb2')]=db['sequelize'][_0x1e9b('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x1e9b('0xb3')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xb4'));db[_0x1e9b('0xb5')]=db['sequelize']['import'](_0x1e9b('0xb6'));db['ZendeskConfiguration']=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xb7'));db[_0x1e9b('0xb8')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x1e9b('0x1')]['import'](_0x1e9b('0xb9'));db[_0x1e9b('0xba')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xbb'));db[_0x1e9b('0xbc')]=db[_0x1e9b('0x1')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xbd'));db['VtigerField']=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x1e9b('0xbe')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xbf'));db[_0x1e9b('0xc0')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x1e9b('0xc1')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xc2'));db[_0x1e9b('0xc3')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0xc4'));db[_0x1e9b('0xc5')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xc6'));db[_0x1e9b('0xc7')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0xc8'));db['FreshsalesAccount']=db[_0x1e9b('0x1')]['import'](_0x1e9b('0xc9'));db['FreshsalesConfiguration']=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x1e9b('0xca')]=db['sequelize'][_0x1e9b('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x1e9b('0x92')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x93'));db[_0x1e9b('0xcb')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xcc'));db[_0x1e9b('0xcd')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xce'));db[_0x1e9b('0xcf')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xd0'));db[_0x1e9b('0xd1')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xd2'));db[_0x1e9b('0xd3')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x1e9b('0xd4')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0xd5'));db[_0x1e9b('0xd6')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xd7'));db[_0x1e9b('0xd8')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xd9'));db[_0x1e9b('0xda')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xdb'));db[_0x1e9b('0xdc')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xdd'));db[_0x1e9b('0xde')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xdf'));db['SquareOdbc']=db[_0x1e9b('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x1e9b('0xe0')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xe1'));db[_0x1e9b('0xe2')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xe3'));db[_0x1e9b('0xe4')]=db[_0x1e9b('0x1')]['import']('../api/squareMessage/squareMessage.model');db[_0x1e9b('0xe5')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/team/team.model');db[_0x1e9b('0xe6')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/license/license.model');db[_0x1e9b('0xe7')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xe8'));db[_0x1e9b('0xe9')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xea'));db[_0x1e9b('0xeb')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xec'));db[_0x1e9b('0xed')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xee'));db['MailTransferReport']=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xef'));db['ChatTransferReport']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xf0'));db['FaxTransferReport']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xf1'));db[_0x1e9b('0xf2')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xf3'));db[_0x1e9b('0xf4')]=db[_0x1e9b('0x1')]['import']('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x1e9b('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db['sequelize']['import']('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xf5'));db[_0x1e9b('0xf6')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xf7'));db[_0x1e9b('0xf8')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xf9'));db[_0x1e9b('0xfa')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0x1e9b('0xfb')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0xfc'));db['WhatsappInteraction']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0xfd'));db[_0x1e9b('0xfe')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/whatsappMessage/whatsappMessage.model');db[_0x1e9b('0xff')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x100'));db[_0x1e9b('0x101')]=db[_0x1e9b('0x1')]['import'](_0x1e9b('0x102'));db[_0x1e9b('0x103')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x1e9b('0x104')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x105'));db['TeamVoiceQueue']=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x106'));db[_0x1e9b('0x107')]=db['sequelize'][_0x1e9b('0x13')](_0x1e9b('0x108'));db[_0x1e9b('0x109')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')](_0x1e9b('0x10a'));db[_0x1e9b('0x10b')]=db[_0x1e9b('0x1')][_0x1e9b('0x13')]('../api/user-setting/user-setting.model');db[_0x1e9b('0x12')][_0x1e9b('0x10c')](db[_0x1e9b('0x1f')],{'as':_0x1e9b('0x1f'),'onDelete':_0x1e9b('0x10d'),'foreignKey':'UserId'});db[_0x1e9b('0x12')]['hasOne'](db['UserSetting'],{'as':'userSetting','onDelete':_0x1e9b('0x10d'),'foreignKey':'UserId'});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db[_0x1e9b('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db['User']['hasMany'](db[_0x1e9b('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0x1e9b('0x10f')});db['User'][_0x1e9b('0x10e')](db[_0x1e9b('0x18')],{'as':_0x1e9b('0x110'),'onDelete':_0x1e9b('0x10d'),'hooks':!![]});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db[_0x1e9b('0x111')],{'as':'HopperFinals','foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db[_0x1e9b('0x76')],{'as':_0x1e9b('0x112'),'foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x12')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db['OpenchannelInteraction'],{'as':_0x1e9b('0x113'),'foreignKey':'UserId'});db['User']['hasMany'](db['ChatInteraction'],{'as':_0x1e9b('0x114'),'foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db[_0x1e9b('0x58')],{'as':_0x1e9b('0x115'),'foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db['MailInteraction'],{'as':_0x1e9b('0x116'),'foreignKey':'UserId'});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db[_0x1e9b('0x117')],{'as':_0x1e9b('0x118'),'foreignKey':'UserId'});db[_0x1e9b('0x12')][_0x1e9b('0x10e')](db[_0x1e9b('0xf8')],{'as':_0x1e9b('0x119'),'foreignKey':_0x1e9b('0x11a')});db[_0x1e9b('0x12')][_0x1e9b('0x11b')](db[_0x1e9b('0x11c')],{'as':_0x1e9b('0x11c'),'foreignKey':'userProfileId'});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x6d')],{'as':_0x1e9b('0x11e'),'through':_0x1e9b('0x11f')});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x120'),'through':_0x1e9b('0x121')});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db['CmList'],{'as':_0x1e9b('0x122'),'through':_0x1e9b('0x123')});db['User']['belongsToMany'](db[_0x1e9b('0xe5')],{'through':_0x1e9b('0x124')});db[_0x1e9b('0x12')]['belongsToMany'](db[_0x1e9b('0x125')],{'as':_0x1e9b('0x116'),'through':_0x1e9b('0x126')});db[_0x1e9b('0x12')]['belongsToMany'](db[_0x1e9b('0x67')],{'as':_0x1e9b('0x114'),'through':'user_has_chat_interactions'});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x4f')],{'as':_0x1e9b('0x127'),'through':_0x1e9b('0x128')});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x58')],{'as':_0x1e9b('0x115'),'through':_0x1e9b('0x129')});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x5c')],{'as':_0x1e9b('0x113'),'through':_0x1e9b('0x12a')});db['User'][_0x1e9b('0x11d')](db[_0x1e9b('0x117')],{'as':_0x1e9b('0x118'),'through':_0x1e9b('0x12b')});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x12c')],{'as':_0x1e9b('0x12d'),'through':_0x1e9b('0x30'),'required':![]});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x12e')],{'as':_0x1e9b('0x12f'),'through':_0x1e9b('0x109'),'required':![]});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db['MailQueue'],{'as':_0x1e9b('0x130'),'through':_0x1e9b('0x33'),'required':![]});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x6c')],{'as':_0x1e9b('0x131'),'through':_0x1e9b('0x31'),'required':![],'hooks':!![]});db[_0x1e9b('0x12')]['belongsToMany'](db[_0x1e9b('0x53')],{'as':'FaxQueues','through':_0x1e9b('0x132'),'required':![]});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x133')],{'as':_0x1e9b('0x134'),'through':_0x1e9b('0x34'),'required':![]});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x60')],{'as':_0x1e9b('0x135'),'through':_0x1e9b('0x36'),'required':![]});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x103')],{'as':_0x1e9b('0x136'),'through':_0x1e9b('0x38'),'required':![]});db['User']['belongsToMany'](db[_0x1e9b('0xf4')],{'through':_0x1e9b('0x123')});db[_0x1e9b('0x12')]['belongsToMany'](db[_0x1e9b('0x62')],{'as':_0x1e9b('0x137'),'through':_0x1e9b('0x138')});db['User']['belongsToMany'](db[_0x1e9b('0x4d')],{'as':_0x1e9b('0x139'),'through':_0x1e9b('0x13a')});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x3d')],{'as':_0x1e9b('0x13b'),'through':'user_has_mail_accounts'});db['User'][_0x1e9b('0x11d')](db['OpenchannelAccount'],{'as':_0x1e9b('0x13c'),'through':_0x1e9b('0x13d')});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0x55')],{'as':'SmsAccounts','through':_0x1e9b('0x13e')});db[_0x1e9b('0x12')][_0x1e9b('0x11d')](db[_0x1e9b('0xfa')],{'as':_0x1e9b('0x13f'),'through':_0x1e9b('0x140')});db[_0x1e9b('0x12')]['belongsToMany'](db[_0x1e9b('0xe0')],{'as':_0x1e9b('0x141'),'through':_0x1e9b('0x142')});db['VoiceChanSpy'][_0x1e9b('0x10e')](db[_0x1e9b('0x18')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x1e9b('0x143')][_0x1e9b('0x10e')](db[_0x1e9b('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0x1e9b('0x10e')](db[_0x1e9b('0x18')],{'as':'Applications','onDelete':_0x1e9b('0x10d')});db['VoiceMusicOnHold'][_0x1e9b('0x11d')](db[_0x1e9b('0x144')],{'as':'Sounds','through':_0x1e9b('0x145')});db['VoiceQueue'][_0x1e9b('0x10e')](db[_0x1e9b('0x2e')],{'as':_0x1e9b('0x146'),'foreignKey':'VoiceQueueId'});db[_0x1e9b('0x12c')][_0x1e9b('0x10e')](db[_0x1e9b('0x147')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x1e9b('0x12c')][_0x1e9b('0x10e')](db['CmHopperFinal'],{'as':_0x1e9b('0x148'),'foreignKey':'VoiceQueueId'});db[_0x1e9b('0x12c')][_0x1e9b('0x10e')](db[_0x1e9b('0x76')],{'as':_0x1e9b('0x149'),'foreignKey':'VoiceQueueId'});db[_0x1e9b('0x12c')]['hasMany'](db[_0x1e9b('0x14a')],{'as':_0x1e9b('0x14a'),'foreignKey':'VoiceQueueId'});db[_0x1e9b('0x12c')][_0x1e9b('0x10e')](db[_0x1e9b('0x73')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x1e9b('0x12c')]['hasMany'](db[_0x1e9b('0xd4')],{'as':'JscriptySessions','foreignKey':_0x1e9b('0x14b')});db[_0x1e9b('0x12c')][_0x1e9b('0x11b')](db[_0x1e9b('0x2a')],{'as':_0x1e9b('0x2a'),'foreignKey':_0x1e9b('0x14c')});db['VoiceQueue']['belongsTo'](db[_0x1e9b('0x2a')],{'as':_0x1e9b('0x14d'),'foreignKey':_0x1e9b('0x14e')});db['VoiceQueue'][_0x1e9b('0x11b')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0x1e9b('0x12c')][_0x1e9b('0x11b')](db[_0x1e9b('0x85')],{'as':_0x1e9b('0x14f'),'foreignKey':_0x1e9b('0x150')});db[_0x1e9b('0x12c')][_0x1e9b('0x11d')](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x122'),'through':_0x1e9b('0x151')});db['VoiceQueue']['belongsToMany'](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x30')});db[_0x1e9b('0x12c')][_0x1e9b('0x11d')](db['Team'],{'as':'Teams','through':_0x1e9b('0x153')});db[_0x1e9b('0x12c')][_0x1e9b('0x11d')](db[_0x1e9b('0xf4')],{'as':'BlackLists','through':_0x1e9b('0x154')});db[_0x1e9b('0x1b')][_0x1e9b('0x11b')](db['User'],{'as':_0x1e9b('0x12'),'foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x1d')][_0x1e9b('0x11b')](db['User'],{'as':'User','foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x1f')][_0x1e9b('0x10e')](db[_0x1e9b('0x21')],{'as':'Messages','onDelete':_0x1e9b('0x10d'),'foreignKey':'mailboxuser','sourceKey':_0x1e9b('0x155')});db[_0x1e9b('0x21')][_0x1e9b('0x11b')](db[_0x1e9b('0x1f')],{'foreignKey':_0x1e9b('0x156'),'targetKey':'mailbox'});db['VoiceCallReport'][_0x1e9b('0x10e')](db[_0x1e9b('0x27')],{'as':'QueueCalls','foreignKey':_0x1e9b('0x157'),'constraints':![]});db['VoiceCallReport'][_0x1e9b('0x10e')](db[_0x1e9b('0x25')],{'as':_0x1e9b('0x158'),'foreignKey':_0x1e9b('0x157'),'constraints':![]});db[_0x1e9b('0x159')][_0x1e9b('0x11b')](db['User'],{'as':_0x1e9b('0x12'),'foreignKey':_0x1e9b('0x10f')});db['VoiceCallReport']['belongsTo'](db[_0x1e9b('0x70')],{'as':'Contact','foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0x3a')][_0x1e9b('0x11b')](db[_0x1e9b('0x3d')],{'as':_0x1e9b('0x3d'),'foreignKey':_0x1e9b('0x15b')});db['MailServerIn'][_0x1e9b('0x11b')](db[_0x1e9b('0x104')],{'as':_0x1e9b('0x104'),'foreignKey':_0x1e9b('0x15c'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x3b')][_0x1e9b('0x11b')](db[_0x1e9b('0x3d')],{'as':_0x1e9b('0x3d'),'foreignKey':'MailAccountId'});db[_0x1e9b('0x3b')][_0x1e9b('0x11b')](db[_0x1e9b('0x104')],{'as':_0x1e9b('0x104'),'foreignKey':_0x1e9b('0x15c'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x3d')][_0x1e9b('0x10c')](db[_0x1e9b('0x3a')],{'as':_0x1e9b('0x15e'),'onDelete':'cascade'});db[_0x1e9b('0x3d')][_0x1e9b('0x10c')](db[_0x1e9b('0x3b')],{'as':_0x1e9b('0x15f'),'onDelete':_0x1e9b('0x10d')});db['MailAccount']['hasMany'](db[_0x1e9b('0x80')],{'as':_0x1e9b('0x160'),'foreignKey':_0x1e9b('0x15b'),'onDelete':_0x1e9b('0x10d')});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':_0x1e9b('0x161'),'foreignKey':_0x1e9b('0x15b')});db[_0x1e9b('0x3d')]['hasMany'](db[_0x1e9b('0x43')],{'as':_0x1e9b('0x162'),'foreignKey':'MailAccountId'});db[_0x1e9b('0x3d')][_0x1e9b('0x10e')](db[_0x1e9b('0x125')],{'as':'Interactions'});db['MailAccount'][_0x1e9b('0x10e')](db[_0x1e9b('0x45')],{'as':_0x1e9b('0x163')});db['MailAccount'][_0x1e9b('0x11b')](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0x3d')][_0x1e9b('0x11b')](db[_0x1e9b('0x166')],{'as':_0x1e9b('0x166'),'foreignKey':_0x1e9b('0x167')});db[_0x1e9b('0x3d')][_0x1e9b('0x11b')](db[_0x1e9b('0x85')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db['User'],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x168')});db['MailQueue']['belongsToMany'](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x33')});db['MailQueue'][_0x1e9b('0x11d')](db['Team'],{'through':'team_has_mail_queues','as':_0x1e9b('0x169')});db[_0x1e9b('0x125')][_0x1e9b('0x10e')](db[_0x1e9b('0x43')],{'as':_0x1e9b('0x162'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x16a')});db['MailInteraction'][_0x1e9b('0x11b')](db['MailAccount'],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x15b')});db[_0x1e9b('0x125')]['belongsTo'](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x16c'),'foreignKey':_0x1e9b('0x15a')});db['MailInteraction']['belongsTo'](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x16d'),'foreignKey':_0x1e9b('0x10f')});db['MailInteraction'][_0x1e9b('0x11d')](db['Tag'],{'through':_0x1e9b('0x16e'),'as':'Tags'});db[_0x1e9b('0x125')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':'mail_interaction_has_tags','as':_0x1e9b('0x16f')});db[_0x1e9b('0x125')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x170'),'through':_0x1e9b('0x126'),'foreignKey':_0x1e9b('0x16a')});db[_0x1e9b('0x43')][_0x1e9b('0x10e')](db['Attachment'],{'as':'Attachments','onDelete':_0x1e9b('0x10d')});db['MailMessage'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x12')});db[_0x1e9b('0x43')][_0x1e9b('0x11b')](db['CmContact'],{'onDelete':_0x1e9b('0x10d'),'as':'Contact'});db[_0x1e9b('0x43')][_0x1e9b('0x11b')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0x1e9b('0x16a')});db[_0x1e9b('0x43')][_0x1e9b('0x11b')](db[_0x1e9b('0x3d')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x15b')});db['MailMessage'][_0x1e9b('0x11b')](db[_0x1e9b('0x62')],{'as':_0x1e9b('0x62'),'foreignKey':'ChatWebsiteId'});db[_0x1e9b('0x43')][_0x1e9b('0x11b')](db['ChatOfflineMessage'],{'as':_0x1e9b('0x6a'),'foreignKey':_0x1e9b('0x171')});db[_0x1e9b('0x45')][_0x1e9b('0x11b')](db['User'],{'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x45')][_0x1e9b('0x11b')](db[_0x1e9b('0x3f')],{'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x45')][_0x1e9b('0x11b')](db[_0x1e9b('0x3d')],{'onDelete':_0x1e9b('0x15d')});db['MailApplication'][_0x1e9b('0x11b')](db[_0x1e9b('0x84')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':'IntervalId'});db[_0x1e9b('0x45')]['belongsTo'](db[_0x1e9b('0x8c')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db[_0x1e9b('0x3d')],{});db['MailQueueReport']['belongsTo'](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0x47')][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x16c'),'foreignKey':'ContactId'});db[_0x1e9b('0x47')]['belongsTo'](db[_0x1e9b('0x125')],{});db[_0x1e9b('0x47')]['belongsTo'](db['MailMessage'],{});db[_0x1e9b('0x47')]['belongsTo'](db[_0x1e9b('0x12')],{});db[_0x1e9b('0x47')]['belongsTo'](db[_0x1e9b('0x3f')],{});db[_0x1e9b('0x49')][_0x1e9b('0x10e')](db[_0x1e9b('0x4b')],{'as':_0x1e9b('0x172'),'onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x4d')][_0x1e9b('0x10e')](db[_0x1e9b('0x80')],{'as':_0x1e9b('0x160'),'foreignKey':_0x1e9b('0x173'),'onDelete':_0x1e9b('0x10d')});db['FaxAccount']['hasMany'](db[_0x1e9b('0x7e')],{'as':_0x1e9b('0x161'),'foreignKey':_0x1e9b('0x173')});db[_0x1e9b('0x4d')]['hasMany'](db['FaxInteraction'],{'as':_0x1e9b('0x174')});db[_0x1e9b('0x4d')]['hasMany'](db[_0x1e9b('0x175')],{'as':_0x1e9b('0x163')});db[_0x1e9b('0x4d')][_0x1e9b('0x10e')](db[_0x1e9b('0x18')],{'as':'Exntensions','onDelete':'cascade'});db[_0x1e9b('0x4d')][_0x1e9b('0x10e')](db[_0x1e9b('0x51')],{'as':'Messages'});db[_0x1e9b('0x4d')][_0x1e9b('0x11b')](db[_0x1e9b('0x2a')],{'as':_0x1e9b('0x2a')});db[_0x1e9b('0x4d')][_0x1e9b('0x11b')](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165')});db['FaxAccount'][_0x1e9b('0x11b')](db['Pause'],{'as':_0x1e9b('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x13a')});db[_0x1e9b('0x175')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0x1e9b('0x175')][_0x1e9b('0x11b')](db[_0x1e9b('0x53')],{'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x175')][_0x1e9b('0x11b')](db['FaxAccount'],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0x1e9b('0x8c')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':'TagId'});db['FaxInteraction'][_0x1e9b('0x10e')](db[_0x1e9b('0x51')],{'as':_0x1e9b('0x162'),'onDelete':_0x1e9b('0x10d'),'foreignKey':'FaxInteractionId'});db[_0x1e9b('0x4f')][_0x1e9b('0x11b')](db[_0x1e9b('0x4d')],{'as':'Account','foreignKey':_0x1e9b('0x173')});db[_0x1e9b('0x4f')][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x16c'),'foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0x4f')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x16d'),'foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x4f')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':_0x1e9b('0x176'),'as':'Tags'});db[_0x1e9b('0x4f')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':_0x1e9b('0x176'),'as':_0x1e9b('0x16f')});db[_0x1e9b('0x4f')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x170'),'through':_0x1e9b('0x128'),'foreignKey':_0x1e9b('0x177')});db[_0x1e9b('0x51')][_0x1e9b('0x11b')](db['User'],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x12')});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':_0x1e9b('0x178'),'foreignKey':_0x1e9b('0x177')});db[_0x1e9b('0x51')]['belongsTo'](db[_0x1e9b('0x70')],{'onDelete':_0x1e9b('0x10d'),'as':'Contact'});db['FaxMessage'][_0x1e9b('0x11b')](db['Attachment'],{'as':_0x1e9b('0xeb'),'foreignKey':'AttachmentId'});db[_0x1e9b('0x51')][_0x1e9b('0x11b')](db[_0x1e9b('0x4d')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x173')});db[_0x1e9b('0x53')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x132')});db[_0x1e9b('0x53')][_0x1e9b('0x11d')](db['Team'],{'through':_0x1e9b('0x179'),'as':_0x1e9b('0x169')});db['FaxQueueReport']['belongsTo'](db[_0x1e9b('0x4d')],{});db[_0x1e9b('0x54')][_0x1e9b('0x11b')](db['CmList'],{'as':_0x1e9b('0x164'),'foreignKey':'ListId'});db[_0x1e9b('0x54')][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x16c'),'foreignKey':'ContactId'});db[_0x1e9b('0x54')][_0x1e9b('0x11b')](db[_0x1e9b('0x4f')],{});db[_0x1e9b('0x54')]['belongsTo'](db['FaxMessage'],{});db[_0x1e9b('0x54')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{});db[_0x1e9b('0x54')]['belongsTo'](db['FaxQueue'],{});db[_0x1e9b('0x55')][_0x1e9b('0x10e')](db[_0x1e9b('0x80')],{'as':_0x1e9b('0x160'),'foreignKey':_0x1e9b('0x17a'),'onDelete':'cascade'});db[_0x1e9b('0x55')][_0x1e9b('0x10e')](db[_0x1e9b('0x7e')],{'as':_0x1e9b('0x161'),'foreignKey':_0x1e9b('0x17a')});db[_0x1e9b('0x55')][_0x1e9b('0x10e')](db[_0x1e9b('0x5a')],{'as':'Messages','foreignKey':_0x1e9b('0x17a')});db['SmsAccount']['hasMany'](db[_0x1e9b('0x58')],{'as':'Interactions'});db[_0x1e9b('0x55')][_0x1e9b('0x10e')](db[_0x1e9b('0x56')],{'as':_0x1e9b('0x163')});db[_0x1e9b('0x55')][_0x1e9b('0x11b')](db['CmList'],{'as':'List','foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0x55')][_0x1e9b('0x11b')](db['Pause'],{'as':_0x1e9b('0x14f'),'foreignKey':_0x1e9b('0x150')});db[_0x1e9b('0x55')][_0x1e9b('0x11d')](db['User'],{'as':'Agents','through':_0x1e9b('0x13e')});db[_0x1e9b('0x56')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x56')][_0x1e9b('0x11b')](db[_0x1e9b('0x133')],{'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x56')]['belongsTo'](db[_0x1e9b('0x55')],{'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x56')]['belongsTo'](db[_0x1e9b('0x84')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':_0x1e9b('0x17b')});db[_0x1e9b('0x56')]['belongsTo'](db[_0x1e9b('0x8c')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':'TagId'});db[_0x1e9b('0x58')]['hasMany'](db[_0x1e9b('0x5a')],{'as':_0x1e9b('0x162'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x17c')});db[_0x1e9b('0x58')][_0x1e9b('0x11b')](db[_0x1e9b('0x55')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x17a')});db[_0x1e9b('0x58')][_0x1e9b('0x11b')](db['CmContact'],{'as':_0x1e9b('0x16c'),'foreignKey':_0x1e9b('0x15a')});db['SmsInteraction'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x16d'),'foreignKey':_0x1e9b('0x10f')});db['SmsInteraction'][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':_0x1e9b('0x17d'),'as':'Tags'});db[_0x1e9b('0x58')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':_0x1e9b('0x17d'),'as':'ThroughTags'});db[_0x1e9b('0x58')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x170'),'through':_0x1e9b('0x129'),'foreignKey':_0x1e9b('0x17c')});db[_0x1e9b('0x5a')][_0x1e9b('0x11b')](db['User'],{'as':'User'});db[_0x1e9b('0x5a')][_0x1e9b('0x11b')](db['CmContact'],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x16c')});db[_0x1e9b('0x5a')][_0x1e9b('0x11b')](db[_0x1e9b('0x58')],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x178'),'foreignKey':_0x1e9b('0x17c')});db['SmsMessage'][_0x1e9b('0x11b')](db['SmsAccount'],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x17a')});db[_0x1e9b('0x133')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':'Agents','through':_0x1e9b('0x34'),'foreignKey':_0x1e9b('0x17e')});db[_0x1e9b('0x133')][_0x1e9b('0x11d')](db[_0x1e9b('0xe5')],{'through':_0x1e9b('0x17f'),'as':_0x1e9b('0x169')});db['OpenchannelAccount'][_0x1e9b('0x10e')](db['Disposition'],{'as':_0x1e9b('0x160'),'foreignKey':'OpenchannelAccountId','onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x5b')]['hasMany'](db['CannedAnswer'],{'as':_0x1e9b('0x161'),'foreignKey':_0x1e9b('0x180')});db[_0x1e9b('0x5b')]['hasMany'](db[_0x1e9b('0x5c')],{'as':_0x1e9b('0x174'),'foreignKey':_0x1e9b('0x180')});db['OpenchannelAccount'][_0x1e9b('0x10e')](db[_0x1e9b('0x5e')],{'as':_0x1e9b('0x162'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x1e9b('0x10e')](db[_0x1e9b('0x181')],{'as':_0x1e9b('0x163'),'foreignKey':_0x1e9b('0x180')});db['OpenchannelAccount'][_0x1e9b('0x11b')](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165')});db['OpenchannelAccount'][_0x1e9b('0x11b')](db[_0x1e9b('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0x1e9b('0x150')});db['OpenchannelAccount'][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x13d')});db[_0x1e9b('0x181')]['belongsTo'](db[_0x1e9b('0x12')],{'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x181')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x1e9b('0x15d'),'foreignKey':_0x1e9b('0x182')});db[_0x1e9b('0x181')][_0x1e9b('0x11b')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x1e9b('0x180')});db['OpenchannelApplication'][_0x1e9b('0x11b')](db[_0x1e9b('0x84')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':_0x1e9b('0x17b')});db['OpenchannelApplication'][_0x1e9b('0x11b')](db[_0x1e9b('0x8c')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':_0x1e9b('0x183')});db[_0x1e9b('0x5c')][_0x1e9b('0x10e')](db[_0x1e9b('0x5e')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1e9b('0x184')});db['OpenchannelInteraction'][_0x1e9b('0x11b')](db[_0x1e9b('0x5b')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x180')});db[_0x1e9b('0x5c')][_0x1e9b('0x11b')](db['CmContact'],{'as':_0x1e9b('0x16c'),'foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0x5c')]['belongsTo'](db['User'],{'as':_0x1e9b('0x16d'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':_0x1e9b('0x185'),'as':_0x1e9b('0x186')});db[_0x1e9b('0x5c')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0x1e9b('0x16f')});db[_0x1e9b('0x5c')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x170'),'through':_0x1e9b('0x12a'),'foreignKey':_0x1e9b('0x184')});db['OpenchannelMessage'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x12')});db[_0x1e9b('0x5e')][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x16c')});db[_0x1e9b('0x5e')][_0x1e9b('0x11b')](db[_0x1e9b('0x5c')],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x178'),'foreignKey':_0x1e9b('0x184')});db['OpenchannelMessage'][_0x1e9b('0x11b')](db[_0x1e9b('0xeb')],{'as':_0x1e9b('0xeb'),'foreignKey':_0x1e9b('0x187')});db['OpenchannelMessage'][_0x1e9b('0x11b')](db[_0x1e9b('0x5b')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x180')});db[_0x1e9b('0x60')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x36'),'foreignKey':_0x1e9b('0x182')});db['OpenchannelQueue'][_0x1e9b('0x11d')](db[_0x1e9b('0xe5')],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite']['hasMany'](db[_0x1e9b('0x80')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x62')][_0x1e9b('0x10e')](db[_0x1e9b('0x7e')],{'as':_0x1e9b('0x161'),'foreignKey':_0x1e9b('0x188')});db[_0x1e9b('0x62')]['hasMany'](db[_0x1e9b('0x6e')],{'as':_0x1e9b('0x189')});db[_0x1e9b('0x62')]['hasMany'](db[_0x1e9b('0x67')],{'as':_0x1e9b('0x174')});db['ChatWebsite']['hasMany'](db[_0x1e9b('0x66')],{'as':_0x1e9b('0x163')});db['ChatWebsite'][_0x1e9b('0x10e')](db['ChatMessage'],{'as':_0x1e9b('0x162')});db['ChatWebsite'][_0x1e9b('0x11b')](db['CmList'],{'as':'List','foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0x62')][_0x1e9b('0x11b')](db[_0x1e9b('0x84')],{'as':_0x1e9b('0x84'),'foreignKey':'IntervalId'});db[_0x1e9b('0x62')][_0x1e9b('0x11b')](db[_0x1e9b('0x3d')],{'as':'MailAccount','foreignKey':_0x1e9b('0x15b')});db[_0x1e9b('0x62')][_0x1e9b('0x11b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x1e9b('0x150')});db[_0x1e9b('0x62')]['belongsToMany'](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x138')});db['OpenchannelQueueReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x5b')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165')});db['OpenchannelQueueReport'][_0x1e9b('0x11b')](db['CmContact'],{'as':'Contact','foreignKey':_0x1e9b('0x15a')});db['OpenchannelQueueReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x5c')],{});db[_0x1e9b('0x64')][_0x1e9b('0x11b')](db['OpenchannelMessage'],{});db[_0x1e9b('0x64')]['belongsTo'](db[_0x1e9b('0x12')],{});db[_0x1e9b('0x64')]['belongsTo'](db[_0x1e9b('0x60')],{});db[_0x1e9b('0x66')]['belongsTo'](db[_0x1e9b('0x12')],{'as':'Agent','foreignKey':_0x1e9b('0x10f'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x66')][_0x1e9b('0x11b')](db[_0x1e9b('0x6c')],{'as':'Queue','foreignKey':_0x1e9b('0x18a'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x66')][_0x1e9b('0x11b')](db[_0x1e9b('0x62')],{'as':_0x1e9b('0x18b'),'foreignKey':_0x1e9b('0x188'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x66')]['belongsTo'](db[_0x1e9b('0x8c')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':'TagId'});db[_0x1e9b('0x67')][_0x1e9b('0x10e')](db[_0x1e9b('0x69')],{'as':_0x1e9b('0x162'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db['ChatInteraction'][_0x1e9b('0x11b')](db['ChatWebsite'],{'as':_0x1e9b('0x16b'),'foreignKey':'ChatWebsiteId'});db[_0x1e9b('0x67')][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'as':'Contact','foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0x67')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'as':'Owner','foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x67')]['belongsToMany'](db[_0x1e9b('0x8c')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction'][_0x1e9b('0x11d')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x1e9b('0x16f')});db[_0x1e9b('0x67')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x170'),'through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db[_0x1e9b('0x69')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x12')});db[_0x1e9b('0x69')]['belongsTo'](db[_0x1e9b('0x70')],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x16c'),'foreignKey':_0x1e9b('0x15a')});db['ChatMessage'][_0x1e9b('0x11b')](db[_0x1e9b('0x67')],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x178'),'foreignKey':_0x1e9b('0x18c')});db[_0x1e9b('0x69')][_0x1e9b('0x11b')](db['Attachment'],{'as':'Attachment','foreignKey':_0x1e9b('0x187')});db['ChatMessage'][_0x1e9b('0x11b')](db[_0x1e9b('0x62')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x188')});db[_0x1e9b('0x6a')][_0x1e9b('0x10e')](db[_0x1e9b('0xeb')],{'as':_0x1e9b('0x18d'),'foreignKey':_0x1e9b('0x171'),'onDelete':_0x1e9b('0x10d'),'hooks':!![]});db[_0x1e9b('0x6a')]['belongsTo'](db[_0x1e9b('0x70')],{'onDelete':_0x1e9b('0x10d'),'as':'Contact','foreignKey':'ContactId'});db[_0x1e9b('0x6a')][_0x1e9b('0x11b')](db[_0x1e9b('0x62')],{'as':_0x1e9b('0x16b'),'foreignKey':'ChatWebsiteId'});db[_0x1e9b('0x6c')][_0x1e9b('0x11d')](db['User'],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x31'),'hooks':!![]});db[_0x1e9b('0x6c')][_0x1e9b('0x11d')](db[_0x1e9b('0xe5')],{'through':_0x1e9b('0x18e'),'as':_0x1e9b('0x169')});db[_0x1e9b('0x6d')]['hasMany'](db[_0x1e9b('0xcf')],{'as':'Messages','foreignKey':_0x1e9b('0x18f'),'onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x6d')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x146'),'through':'chat_group_has_users'});db[_0x1e9b('0x6e')][_0x1e9b('0x11b')](db['ChatWebsite'],{'as':_0x1e9b('0x18b'),'foreignKey':_0x1e9b('0x188')});db['CmCompany'][_0x1e9b('0x10e')](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x120'),'foreignKey':'CompanyId'});db[_0x1e9b('0x70')][_0x1e9b('0x10e')](db[_0x1e9b('0x147')],{'as':'Hoppers','foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0x70')][_0x1e9b('0x10e')](db['CmHopperFinal'],{'as':_0x1e9b('0x148'),'foreignKey':_0x1e9b('0x15a')});db['CmContact'][_0x1e9b('0x10e')](db[_0x1e9b('0x76')],{'as':_0x1e9b('0x149'),'foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0x70')]['hasMany'](db[_0x1e9b('0x14a')],{'as':_0x1e9b('0x14a'),'foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0x70')][_0x1e9b('0x10e')](db[_0x1e9b('0xd4')],{'as':'JscriptySessions','foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0x70')][_0x1e9b('0x10e')](db[_0x1e9b('0x5c')],{'as':_0x1e9b('0x113'),'foreignKey':_0x1e9b('0x15a'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x70')][_0x1e9b('0x10e')](db[_0x1e9b('0x67')],{'as':_0x1e9b('0x114'),'foreignKey':_0x1e9b('0x15a'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x70')][_0x1e9b('0x10e')](db[_0x1e9b('0x58')],{'as':_0x1e9b('0x115'),'foreignKey':_0x1e9b('0x15a'),'onDelete':'restrict'});db['CmContact'][_0x1e9b('0x10e')](db[_0x1e9b('0x4f')],{'as':'FaxInteractions','foreignKey':_0x1e9b('0x15a'),'onDelete':'restrict'});db[_0x1e9b('0x70')][_0x1e9b('0x10e')](db[_0x1e9b('0x125')],{'as':_0x1e9b('0x116'),'foreignKey':_0x1e9b('0x15a'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x70')][_0x1e9b('0x11b')](db[_0x1e9b('0x6f')],{'as':_0x1e9b('0x190'),'foreignKey':_0x1e9b('0x191')});db[_0x1e9b('0x70')][_0x1e9b('0x11b')](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165'),'onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x70')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x170'),'through':_0x1e9b('0x121')});db['CmContact']['belongsToMany'](db[_0x1e9b('0x8c')],{'as':_0x1e9b('0x186'),'through':_0x1e9b('0x192')});db[_0x1e9b('0x70')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x1e9b('0x147')][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'as':'Contact','foreignKey':_0x1e9b('0x15a'),'onDelete':_0x1e9b('0x10d')});db['CmHopper']['belongsTo'](db[_0x1e9b('0xf4')],{'as':'List','foreignKey':'ListId','onDelete':_0x1e9b('0x10d')});db['CmHopper'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'as':'Agent','foreignKey':_0x1e9b('0x10f')});db['CmHopper'][_0x1e9b('0x11b')](db[_0x1e9b('0x12c')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper'][_0x1e9b('0x11b')](db[_0x1e9b('0xe7')],{'as':_0x1e9b('0xe7'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x1e9b('0x147')][_0x1e9b('0x11b')](db['User'],{'as':'Owner','foreignKey':_0x1e9b('0x193')});db[_0x1e9b('0x73')][_0x1e9b('0x11b')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x73')][_0x1e9b('0x11b')](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165'),'onDelete':'cascade'});db[_0x1e9b('0x73')][_0x1e9b('0x11b')](db[_0x1e9b('0x12c')],{'as':_0x1e9b('0x194'),'foreignKey':'VoiceQueueId','onDelete':_0x1e9b('0x10d')});db['CmHopperBlack'][_0x1e9b('0x11b')](db['Campaign'],{'as':_0x1e9b('0xe7'),'foreignKey':_0x1e9b('0x195'),'onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x7d')][_0x1e9b('0x10e')](db[_0x1e9b('0x82')],{'as':{'plural':'All','singular':_0x1e9b('0x196')},'foreignKey':_0x1e9b('0x197'),'onDelete':_0x1e9b('0x10d'),'hooks':!![]});db[_0x1e9b('0x7d')][_0x1e9b('0x10e')](db[_0x1e9b('0x82')],{'as':{'plural':_0x1e9b('0x198'),'singular':_0x1e9b('0x199')},'foreignKey':'AutomationAnyId','onDelete':_0x1e9b('0x10d'),'hooks':!![]});db[_0x1e9b('0x7d')][_0x1e9b('0x10e')](db[_0x1e9b('0x7b')],{'as':_0x1e9b('0x19a'),'foreignKey':_0x1e9b('0x19b'),'onDelete':'cascade','hooks':!![]});db[_0x1e9b('0x80')][_0x1e9b('0x10e')](db['Disposition'],{'as':_0x1e9b('0x160'),'foreignKey':_0x1e9b('0x19c'),'onDelete':'cascade'});db[_0x1e9b('0x84')][_0x1e9b('0x10e')](db[_0x1e9b('0x84')],{'as':_0x1e9b('0x19d'),'foreignKey':_0x1e9b('0x17b'),'onDelete':_0x1e9b('0x10d'),'hooks':!![],'required':![]});db[_0x1e9b('0x84')][_0x1e9b('0x10e')](db[_0x1e9b('0x18')],{'as':_0x1e9b('0x110'),'foreignKey':_0x1e9b('0x17b'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x84')][_0x1e9b('0x10e')](db[_0x1e9b('0x45')],{'as':'MailApplications','foreignKey':_0x1e9b('0x17b')});db[_0x1e9b('0x84')][_0x1e9b('0x10e')](db[_0x1e9b('0x66')],{'as':_0x1e9b('0x19e'),'foreignKey':_0x1e9b('0x17b')});db[_0x1e9b('0x84')]['hasMany'](db['FaxApplication'],{'as':_0x1e9b('0x19f'),'foreignKey':_0x1e9b('0x17b')});db[_0x1e9b('0x84')][_0x1e9b('0x10e')](db['SmsApplication'],{'as':_0x1e9b('0x1a0'),'foreignKey':'IntervalId'});db[_0x1e9b('0x8a')][_0x1e9b('0x11b')](db['MailAccount'],{});db[_0x1e9b('0x8a')][_0x1e9b('0x11b')](db['AnalyticDefaultReport'],{'foreignKey':_0x1e9b('0x1a1')});db[_0x1e9b('0x8a')][_0x1e9b('0x11b')](db[_0x1e9b('0x96')],{'foreignKey':_0x1e9b('0x1a2')});db[_0x1e9b('0x144')][_0x1e9b('0x11d')](db[_0x1e9b('0x1a')],{'as':_0x1e9b('0x1a3'),'through':_0x1e9b('0x145'),'onDelete':'restrict'});db['Tag'][_0x1e9b('0x11d')](db[_0x1e9b('0x70')],{'through':_0x1e9b('0x192')});db['Tag'][_0x1e9b('0x11d')](db[_0x1e9b('0x67')],{'through':'chat_interaction_has_tags'});db[_0x1e9b('0x8c')][_0x1e9b('0x11d')](db[_0x1e9b('0x125')],{'through':'mail_interaction_has_tags'});db[_0x1e9b('0x8c')]['belongsToMany'](db[_0x1e9b('0x58')],{'through':'sms_interaction_has_tags'});db[_0x1e9b('0x8c')][_0x1e9b('0x11d')](db[_0x1e9b('0x4f')],{'through':_0x1e9b('0x176')});db[_0x1e9b('0x8c')][_0x1e9b('0x11d')](db[_0x1e9b('0x5c')],{'through':_0x1e9b('0x185')});db[_0x1e9b('0x8c')][_0x1e9b('0x11d')](db[_0x1e9b('0x117')],{'through':_0x1e9b('0x1a4')});db[_0x1e9b('0x8e')]['hasMany'](db['Condition'],{'as':{'plural':_0x1e9b('0x1a5'),'singular':'AllCondition'},'foreignKey':_0x1e9b('0x1a6'),'onDelete':_0x1e9b('0x10d'),'hooks':!![]});db[_0x1e9b('0x8e')][_0x1e9b('0x10e')](db[_0x1e9b('0x82')],{'as':{'plural':_0x1e9b('0x1a7'),'singular':'AnyCondition'},'foreignKey':_0x1e9b('0x1a8'),'onDelete':_0x1e9b('0x10d'),'hooks':!![]});db['Trigger'][_0x1e9b('0x10e')](db[_0x1e9b('0x7b')],{'as':'Actions','foreignKey':_0x1e9b('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0x1e9b('0x96')]['hasMany'](db[_0x1e9b('0x9c')],{'as':_0x1e9b('0x1aa'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1a2'),'hooks':!![]});db[_0x1e9b('0x98')][_0x1e9b('0x10e')](db[_0x1e9b('0x9c')],{'as':_0x1e9b('0x1aa'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1a1')});db[_0x1e9b('0x9a')][_0x1e9b('0x10e')](db[_0x1e9b('0x9c')],{'as':_0x1e9b('0x1aa'),'onDelete':_0x1e9b('0x10d'),'foreignKey':'MetricId'});db[_0x1e9b('0x9c')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x1e9b('0x1ab')]['hasMany'](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0xa1')][_0x1e9b('0x10e')](db[_0x1e9b('0xa3')],{'as':_0x1e9b('0x1ad'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ae')});db['SalesforceConfiguration'][_0x1e9b('0x10e')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0xa1')]['hasMany'](db[_0x1e9b('0xa3')],{'as':_0x1e9b('0x1aa'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xa1')][_0x1e9b('0x11b')](db[_0x1e9b('0x1ab')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x1ac')});db['SalesforceField'][_0x1e9b('0x10e')](db[_0x1e9b('0xa3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x1e9b('0xa3')]['hasMany'](db['SalesforceField'],{'as':_0x1e9b('0x1b1'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0xa3')][_0x1e9b('0x10e')](db[_0x1e9b('0xa3')],{'as':_0x1e9b('0x1b2'),'foreignKey':_0x1e9b('0x1b0')});db['SalesforceField'][_0x1e9b('0x11b')](db[_0x1e9b('0x90')],{'as':_0x1e9b('0x90'),'foreignKey':_0x1e9b('0x1b3')});db['SugarcrmAccount'][_0x1e9b('0x10e')](db[_0x1e9b('0xa7')],{'as':_0x1e9b('0x1b4'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ac')});db['SugarcrmConfiguration'][_0x1e9b('0x10e')](db[_0x1e9b('0xa9')],{'as':_0x1e9b('0x1ad'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xa7')][_0x1e9b('0x10e')](db[_0x1e9b('0xa9')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x1e9b('0x1af')});db['SugarcrmConfiguration'][_0x1e9b('0x10e')](db[_0x1e9b('0xa9')],{'as':'Fields','onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xa7')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0xa9')][_0x1e9b('0x10e')](db['SugarcrmField'],{'as':_0x1e9b('0x1b5'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xa9')]['hasMany'](db[_0x1e9b('0xa9')],{'as':_0x1e9b('0x1b1'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0xa9')][_0x1e9b('0x10e')](db[_0x1e9b('0xa9')],{'as':_0x1e9b('0x1b2'),'foreignKey':_0x1e9b('0x1b0')});db['SugarcrmField'][_0x1e9b('0x11b')](db[_0x1e9b('0x90')],{'as':_0x1e9b('0x90'),'foreignKey':_0x1e9b('0x1b3')});db[_0x1e9b('0xab')]['hasMany'](db[_0x1e9b('0xad')],{'as':'Configurations','onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0xad')][_0x1e9b('0x10e')](db[_0x1e9b('0xaf')],{'as':_0x1e9b('0x1ad'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ae')});db['DeskConfiguration'][_0x1e9b('0x10e')](db[_0x1e9b('0xaf')],{'as':_0x1e9b('0x1b6'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0xad')][_0x1e9b('0x10e')](db[_0x1e9b('0xaf')],{'as':_0x1e9b('0x1aa'),'onDelete':'cascade','foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xad')]['belongsTo'](db[_0x1e9b('0xab')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0xad')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':'int_desk_configuration_has_tags'});db[_0x1e9b('0xaf')]['hasMany'](db[_0x1e9b('0xaf')],{'as':'Subject','foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xaf')][_0x1e9b('0x10e')](db['DeskField'],{'as':_0x1e9b('0x1b1'),'foreignKey':_0x1e9b('0x1af')});db['DeskField'][_0x1e9b('0x10e')](db['DeskField'],{'as':'Field','foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xaf')][_0x1e9b('0x11b')](db['Variable'],{'as':_0x1e9b('0x90'),'foreignKey':_0x1e9b('0x1b3')});db['ZohoAccount'][_0x1e9b('0x10e')](db[_0x1e9b('0xb2')],{'as':_0x1e9b('0x1b4'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0xb2')][_0x1e9b('0x10e')](db[_0x1e9b('0xb3')],{'as':_0x1e9b('0x1ad'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xb2')][_0x1e9b('0x10e')](db['ZohoField'],{'as':_0x1e9b('0x1b6'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0xb2')][_0x1e9b('0x10e')](db['ZohoField'],{'as':_0x1e9b('0x1aa'),'onDelete':_0x1e9b('0x10d'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0x1e9b('0x11b')](db['ZohoAccount'],{'as':_0x1e9b('0x16b'),'foreignKey':'AccountId'});db[_0x1e9b('0xb3')][_0x1e9b('0x10e')](db[_0x1e9b('0xb3')],{'as':_0x1e9b('0x1b5'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xb3')][_0x1e9b('0x10e')](db[_0x1e9b('0xb3')],{'as':_0x1e9b('0x1b1'),'foreignKey':'DescriptionId'});db[_0x1e9b('0xb3')][_0x1e9b('0x10e')](db[_0x1e9b('0xb3')],{'as':_0x1e9b('0x1b2'),'foreignKey':_0x1e9b('0x1b0')});db['ZohoField'][_0x1e9b('0x11b')](db[_0x1e9b('0x90')],{'as':'Variable','foreignKey':_0x1e9b('0x1b3')});db[_0x1e9b('0xb5')][_0x1e9b('0x10e')](db['ZendeskConfiguration'],{'as':_0x1e9b('0x1b4'),'onDelete':_0x1e9b('0x10d'),'foreignKey':'AccountId'});db[_0x1e9b('0x1b7')][_0x1e9b('0x10e')](db[_0x1e9b('0xb8')],{'as':_0x1e9b('0x1ad'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0x1b7')][_0x1e9b('0x10e')](db[_0x1e9b('0xb8')],{'as':_0x1e9b('0x1b6'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0x1b7')][_0x1e9b('0x10e')](db[_0x1e9b('0xb8')],{'as':_0x1e9b('0x1aa'),'foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0x1b7')][_0x1e9b('0x11b')](db[_0x1e9b('0xb5')],{'as':'Account','foreignKey':_0x1e9b('0x1ac')});db['ZendeskConfiguration'][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':_0x1e9b('0x1b8')});db['ZendeskField'][_0x1e9b('0x10e')](db[_0x1e9b('0xb8')],{'as':_0x1e9b('0x1b5'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xb8')][_0x1e9b('0x10e')](db['ZendeskField'],{'as':_0x1e9b('0x1b1'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0xb8')][_0x1e9b('0x10e')](db[_0x1e9b('0xb8')],{'as':'Field','foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xb8')]['belongsTo'](db[_0x1e9b('0x90')],{'as':_0x1e9b('0x90'),'foreignKey':_0x1e9b('0x1b3')});db[_0x1e9b('0x1b9')][_0x1e9b('0x10e')](db[_0x1e9b('0xba')],{'as':_0x1e9b('0x1b4'),'onDelete':_0x1e9b('0x10d'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x1e9b('0x10e')](db[_0x1e9b('0x1ba')],{'as':'Subjects','onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xba')]['hasMany'](db['FreshdeskField'],{'as':_0x1e9b('0x1b6'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x1e9b('0xba')][_0x1e9b('0x10e')](db[_0x1e9b('0x1ba')],{'as':_0x1e9b('0x1aa'),'onDelete':'cascade','foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xba')]['belongsTo'](db[_0x1e9b('0x1b9')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0xba')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x1e9b('0x10e')](db[_0x1e9b('0x1ba')],{'as':_0x1e9b('0x1b5'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0x1ba')][_0x1e9b('0x10e')](db[_0x1e9b('0x1ba')],{'as':_0x1e9b('0x1b1'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0x1e9b('0x10e')](db[_0x1e9b('0x1ba')],{'as':_0x1e9b('0x1b2'),'foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0x1ba')][_0x1e9b('0x11b')](db[_0x1e9b('0x90')],{'as':_0x1e9b('0x90'),'foreignKey':_0x1e9b('0x1b3')});db['VtigerAccount']['hasMany'](db[_0x1e9b('0x1bb')],{'as':'Configurations','onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0x1bb')][_0x1e9b('0x10e')](db[_0x1e9b('0x1bc')],{'as':_0x1e9b('0x1ad'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0x1bb')][_0x1e9b('0x10e')](db['VtigerField'],{'as':_0x1e9b('0x1b6'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0x1bb')][_0x1e9b('0x10e')](db[_0x1e9b('0x1bc')],{'as':_0x1e9b('0x1aa'),'foreignKey':_0x1e9b('0x1b0')});db['VtigerConfiguration'][_0x1e9b('0x11b')](db[_0x1e9b('0xbc')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0x1bc')][_0x1e9b('0x10e')](db[_0x1e9b('0x1bc')],{'as':_0x1e9b('0x1b5'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0x1bc')][_0x1e9b('0x10e')](db['VtigerField'],{'as':_0x1e9b('0x1b1'),'foreignKey':_0x1e9b('0x1af')});db['VtigerField'][_0x1e9b('0x10e')](db['VtigerField'],{'as':'Field','foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0x1bc')][_0x1e9b('0x11b')](db[_0x1e9b('0x90')],{'as':_0x1e9b('0x90'),'foreignKey':_0x1e9b('0x1b3')});db[_0x1e9b('0xbe')]['hasMany'](db[_0x1e9b('0xc0')],{'as':_0x1e9b('0x1b4'),'onDelete':_0x1e9b('0x10d'),'foreignKey':'AccountId'});db[_0x1e9b('0xc0')][_0x1e9b('0x10e')](db[_0x1e9b('0xc1')],{'as':_0x1e9b('0x1ad'),'foreignKey':_0x1e9b('0x1ae')});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0xc0')][_0x1e9b('0x10e')](db[_0x1e9b('0xc1')],{'as':'Fields','foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xc0')][_0x1e9b('0x11b')](db[_0x1e9b('0xbe')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0xc1')][_0x1e9b('0x10e')](db['ServicenowField'],{'as':_0x1e9b('0x1b5'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xc1')][_0x1e9b('0x10e')](db[_0x1e9b('0xc1')],{'as':_0x1e9b('0x1b1'),'foreignKey':'DescriptionId'});db[_0x1e9b('0xc1')][_0x1e9b('0x10e')](db['ServicenowField'],{'as':_0x1e9b('0x1b2'),'foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xc1')][_0x1e9b('0x11b')](db['Variable'],{'as':_0x1e9b('0x90'),'foreignKey':_0x1e9b('0x1b3')});db[_0x1e9b('0xc3')][_0x1e9b('0x10e')](db[_0x1e9b('0xc5')],{'as':_0x1e9b('0x1b4'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ac')});db[_0x1e9b('0xc3')]['belongsTo'](db['CloudProvider'],{'as':_0x1e9b('0x104'),'foreignKey':_0x1e9b('0x15c')});db[_0x1e9b('0xc5')][_0x1e9b('0x10e')](db[_0x1e9b('0xc7')],{'as':_0x1e9b('0x1ad'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0xc5')]['hasMany'](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1af')});db[_0x1e9b('0xc5')][_0x1e9b('0x10e')](db[_0x1e9b('0xc7')],{'as':_0x1e9b('0x1aa'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xc5')][_0x1e9b('0x11b')](db[_0x1e9b('0xc3')],{'as':'Account','foreignKey':_0x1e9b('0x1ac')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x1e9b('0xc7')]['hasMany'](db[_0x1e9b('0xc7')],{'as':_0x1e9b('0x1b1'),'foreignKey':_0x1e9b('0x1af')});db['Dynamics365Field'][_0x1e9b('0x10e')](db['Dynamics365Field'],{'as':_0x1e9b('0x1b2'),'foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xc7')]['belongsTo'](db[_0x1e9b('0x90')],{'as':'Variable','foreignKey':_0x1e9b('0x1b3')});db[_0x1e9b('0x1bd')][_0x1e9b('0x10e')](db[_0x1e9b('0x1be')],{'as':'Configurations','onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1ac')});db['FreshsalesConfiguration'][_0x1e9b('0x10e')](db[_0x1e9b('0xca')],{'as':_0x1e9b('0x1ad'),'foreignKey':_0x1e9b('0x1ae')});db[_0x1e9b('0x1be')]['hasMany'](db[_0x1e9b('0xca')],{'as':_0x1e9b('0x1b6'),'foreignKey':'DescriptionId'});db[_0x1e9b('0x1be')]['hasMany'](db['FreshsalesField'],{'as':_0x1e9b('0x1aa'),'foreignKey':_0x1e9b('0x1b0')});db['FreshsalesConfiguration'][_0x1e9b('0x11b')](db[_0x1e9b('0x1bd')],{'as':_0x1e9b('0x16b'),'foreignKey':'AccountId'});db[_0x1e9b('0xca')]['hasMany'](db[_0x1e9b('0xca')],{'as':_0x1e9b('0x1b5'),'foreignKey':_0x1e9b('0x1ae')});db['FreshsalesField'][_0x1e9b('0x10e')](db['FreshsalesField'],{'as':_0x1e9b('0x1b1'),'foreignKey':_0x1e9b('0x1af')});db['FreshsalesField'][_0x1e9b('0x10e')](db[_0x1e9b('0xca')],{'as':_0x1e9b('0x1b2'),'foreignKey':_0x1e9b('0x1b0')});db[_0x1e9b('0xca')][_0x1e9b('0x11b')](db[_0x1e9b('0x90')],{'as':_0x1e9b('0x90'),'foreignKey':_0x1e9b('0x1b3')});db[_0x1e9b('0xcd')]['belongsTo'](db['ChatWebsite'],{});db[_0x1e9b('0xcd')][_0x1e9b('0x11b')](db['CmList'],{'as':'List','foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0xcd')]['belongsTo'](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x16c'),'foreignKey':_0x1e9b('0x15a')});db[_0x1e9b('0xcd')][_0x1e9b('0x11b')](db[_0x1e9b('0x67')],{});db['ChatQueueReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x69')],{});db['ChatQueueReport']['belongsTo'](db[_0x1e9b('0x12')],{});db['ChatQueueReport']['belongsTo'](db['ChatQueue'],{});db['ChatInternalMessage'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1bf')});db[_0x1e9b('0xcf')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1c0')});db[_0x1e9b('0xd4')][_0x1e9b('0x10e')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0xd4')]['hasMany'](db[_0x1e9b('0xd1')],{'foreignKey':_0x1e9b('0x1c1'),'onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0xd6')][_0x1e9b('0x11b')](db[_0x1e9b('0x55')],{});db[_0x1e9b('0xd6')]['belongsTo'](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':'ListId'});db['SmsQueueReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x16c'),'foreignKey':_0x1e9b('0x15a')});db['SmsQueueReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x58')],{});db['SmsQueueReport']['belongsTo'](db[_0x1e9b('0x5a')],{});db['SmsQueueReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{});db[_0x1e9b('0xd6')][_0x1e9b('0x11b')](db[_0x1e9b('0x133')],{});db[_0x1e9b('0xdc')][_0x1e9b('0x10e')](db[_0x1e9b('0xd4')],{'foreignKey':_0x1e9b('0x1c2')});db[_0x1e9b('0xdc')][_0x1e9b('0x10e')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x1e9b('0xdc')][_0x1e9b('0x10e')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x1e9b('0xe0')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':'Users','through':'user_has_square_projects'});db['Team'][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':'user_has_teams'});db['Team']['belongsToMany'](db[_0x1e9b('0x12c')],{'through':_0x1e9b('0x153'),'as':_0x1e9b('0x12d')});db[_0x1e9b('0xe5')][_0x1e9b('0x11d')](db[_0x1e9b('0x3f')],{'through':_0x1e9b('0x1c3'),'as':_0x1e9b('0x130')});db[_0x1e9b('0xe5')][_0x1e9b('0x11d')](db['ChatQueue'],{'through':_0x1e9b('0x18e'),'as':_0x1e9b('0x131')});db['Team'][_0x1e9b('0x11d')](db[_0x1e9b('0x53')],{'through':_0x1e9b('0x179'),'as':'FaxQueues'});db[_0x1e9b('0xe5')][_0x1e9b('0x11d')](db['SmsQueue'],{'through':_0x1e9b('0x17f'),'as':_0x1e9b('0x134')});db[_0x1e9b('0xe5')][_0x1e9b('0x11d')](db[_0x1e9b('0x60')],{'through':'team_has_openchannel_queues','as':_0x1e9b('0x135')});db[_0x1e9b('0xe5')]['belongsToMany'](db[_0x1e9b('0x103')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x1e9b('0xe5')][_0x1e9b('0x11d')](db[_0x1e9b('0x12e')],{'through':_0x1e9b('0x107'),'as':_0x1e9b('0x12f')});db[_0x1e9b('0xe7')]['hasMany'](db[_0x1e9b('0x147')],{'as':_0x1e9b('0x1c4'),'foreignKey':_0x1e9b('0x195')});db['Campaign'][_0x1e9b('0x10e')](db[_0x1e9b('0x111')],{'as':'HopperFinals','foreignKey':_0x1e9b('0x195')});db[_0x1e9b('0xe7')]['hasMany'](db[_0x1e9b('0x76')],{'as':_0x1e9b('0x149'),'foreignKey':_0x1e9b('0x195')});db[_0x1e9b('0xe7')][_0x1e9b('0x10e')](db[_0x1e9b('0x73')],{'as':'HopperBlacks','foreignKey':_0x1e9b('0x195')});db[_0x1e9b('0xe7')][_0x1e9b('0x11b')](db['Trunk'],{'as':_0x1e9b('0x2a'),'foreignKey':_0x1e9b('0x14c')});db['Campaign'][_0x1e9b('0x11b')](db[_0x1e9b('0x2a')],{'as':_0x1e9b('0x14d'),'foreignKey':_0x1e9b('0x14e')});db[_0x1e9b('0xe7')][_0x1e9b('0x11b')](db[_0x1e9b('0x84')],{'as':_0x1e9b('0x84'),'foreignKey':_0x1e9b('0x17b')});db[_0x1e9b('0xe7')][_0x1e9b('0x11b')](db['SquareProject'],{'as':_0x1e9b('0xe0'),'foreignKey':_0x1e9b('0x1c5')});db['Campaign'][_0x1e9b('0x11d')](db['CmList'],{'as':_0x1e9b('0x122'),'through':_0x1e9b('0x1c6')});db['Campaign'][_0x1e9b('0x11d')](db['CmList'],{'as':_0x1e9b('0x1c7'),'through':_0x1e9b('0x1c8')});db[_0x1e9b('0xeb')][_0x1e9b('0x11b')](db['ChatOfflineMessage'],{'as':_0x1e9b('0x6a'),'foreignKey':_0x1e9b('0x171')});db['MailTransferReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x43')],{});db['MailTransferReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x125')],{});db[_0x1e9b('0x1c9')]['belongsTo'](db[_0x1e9b('0x3d')],{'foreignKey':_0x1e9b('0x1ca'),'as':_0x1e9b('0x1cb')});db[_0x1e9b('0x1c9')]['belongsTo'](db['User'],{'foreignKey':_0x1e9b('0x1cc'),'as':_0x1e9b('0x1cd')});db[_0x1e9b('0x1c9')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'foreignKey':_0x1e9b('0x1ce'),'as':_0x1e9b('0x1cf')});db['MailTransferReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x3f')],{'foreignKey':_0x1e9b('0x1d0'),'as':_0x1e9b('0x1d1')});db[_0x1e9b('0x1c9')]['belongsTo'](db[_0x1e9b('0x3d')],{'foreignKey':_0x1e9b('0x1d2'),'as':_0x1e9b('0x1d3')});db[_0x1e9b('0x1d4')][_0x1e9b('0x11b')](db['ChatMessage'],{});db[_0x1e9b('0x1d4')]['belongsTo'](db[_0x1e9b('0x67')],{});db[_0x1e9b('0x1d4')][_0x1e9b('0x11b')](db[_0x1e9b('0x62')],{'foreignKey':_0x1e9b('0x1d5'),'as':_0x1e9b('0x1cb')});db[_0x1e9b('0x1d4')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'foreignKey':_0x1e9b('0x1cc'),'as':_0x1e9b('0x1cd')});db['ChatTransferReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'foreignKey':_0x1e9b('0x1ce'),'as':_0x1e9b('0x1cf')});db[_0x1e9b('0x1d4')]['belongsTo'](db['ChatQueue'],{'foreignKey':_0x1e9b('0x1d6'),'as':_0x1e9b('0x1d1')});db['ChatTransferReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x62')],{'foreignKey':_0x1e9b('0x1d7'),'as':_0x1e9b('0x1d3')});db[_0x1e9b('0x1d8')][_0x1e9b('0x11b')](db[_0x1e9b('0x51')],{});db[_0x1e9b('0x1d8')][_0x1e9b('0x11b')](db[_0x1e9b('0x4f')],{});db[_0x1e9b('0x1d8')][_0x1e9b('0x11b')](db[_0x1e9b('0x4d')],{'foreignKey':'FromFaxAccountId','as':_0x1e9b('0x1cb')});db['FaxTransferReport']['belongsTo'](db[_0x1e9b('0x12')],{'foreignKey':_0x1e9b('0x1cc'),'as':_0x1e9b('0x1cd')});db[_0x1e9b('0x1d8')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'foreignKey':_0x1e9b('0x1ce'),'as':'ToAgent'});db[_0x1e9b('0x1d8')][_0x1e9b('0x11b')](db[_0x1e9b('0x53')],{'foreignKey':'ToFaxQueueId','as':_0x1e9b('0x1d1')});db['FaxTransferReport'][_0x1e9b('0x11b')](db['FaxAccount'],{'foreignKey':_0x1e9b('0x1d9'),'as':_0x1e9b('0x1d3')});db[_0x1e9b('0xf2')][_0x1e9b('0x11b')](db[_0x1e9b('0x5e')],{});db[_0x1e9b('0xf2')]['belongsTo'](db[_0x1e9b('0x5c')],{});db[_0x1e9b('0xf2')][_0x1e9b('0x11b')](db[_0x1e9b('0x5b')],{'foreignKey':_0x1e9b('0x1da'),'as':_0x1e9b('0x1cb')});db[_0x1e9b('0xf2')]['belongsTo'](db['User'],{'foreignKey':_0x1e9b('0x1cc'),'as':_0x1e9b('0x1cd')});db[_0x1e9b('0xf2')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'foreignKey':_0x1e9b('0x1ce'),'as':_0x1e9b('0x1cf')});db[_0x1e9b('0xf2')]['belongsTo'](db[_0x1e9b('0x60')],{'foreignKey':_0x1e9b('0x1db'),'as':_0x1e9b('0x1d1')});db[_0x1e9b('0xf2')][_0x1e9b('0x11b')](db[_0x1e9b('0x5b')],{'foreignKey':_0x1e9b('0x1dc'),'as':_0x1e9b('0x1d3')});db[_0x1e9b('0x1dd')][_0x1e9b('0x11b')](db['SmsMessage'],{});db[_0x1e9b('0x1dd')][_0x1e9b('0x11b')](db[_0x1e9b('0x58')],{});db[_0x1e9b('0x1dd')][_0x1e9b('0x11b')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x1e9b('0x1cb')});db[_0x1e9b('0x1dd')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'foreignKey':'FromUserId','as':_0x1e9b('0x1cd')});db[_0x1e9b('0x1dd')][_0x1e9b('0x11b')](db['User'],{'foreignKey':_0x1e9b('0x1ce'),'as':'ToAgent'});db[_0x1e9b('0x1dd')][_0x1e9b('0x11b')](db[_0x1e9b('0x133')],{'foreignKey':_0x1e9b('0x1de'),'as':'ToQueue'});db[_0x1e9b('0x1dd')][_0x1e9b('0x11b')](db[_0x1e9b('0x55')],{'foreignKey':_0x1e9b('0x1df'),'as':'ToAccount'});db[_0x1e9b('0xf4')][_0x1e9b('0x10e')](db['Disposition'],{'as':_0x1e9b('0x160'),'foreignKey':_0x1e9b('0x165'),'onDelete':'cascade'});db[_0x1e9b('0xf4')][_0x1e9b('0x10e')](db[_0x1e9b('0x79')],{'as':_0x1e9b('0x1e0'),'foreignKey':'ListId'});db[_0x1e9b('0xf4')][_0x1e9b('0x10e')](db[_0x1e9b('0x70')],{'as':_0x1e9b('0x120'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0xf4')][_0x1e9b('0x10e')](db['CmHopperFinal'],{'as':_0x1e9b('0x148'),'foreignKey':_0x1e9b('0x165')});db['CmList']['hasMany'](db[_0x1e9b('0x76')],{'as':_0x1e9b('0x112'),'foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0xf4')][_0x1e9b('0x10e')](db[_0x1e9b('0x14a')],{'as':'ReportAgentPreview','foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0xf4')][_0x1e9b('0x11d')](db['VoiceQueue'],{'as':_0x1e9b('0x1e1'),'through':_0x1e9b('0x151')});db['CmList'][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x123')});db[_0x1e9b('0x12e')][_0x1e9b('0x10e')](db[_0x1e9b('0x18')],{'as':_0x1e9b('0x110'),'onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x12e')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x109')});db['VoicePrefix'][_0x1e9b('0x11d')](db[_0x1e9b('0xe5')],{'through':_0x1e9b('0x107'),'as':_0x1e9b('0x169')});db[_0x1e9b('0x11c')][_0x1e9b('0x10e')](db[_0x1e9b('0x12')],{'as':'Users','foreignKey':_0x1e9b('0x1e2')});db[_0x1e9b('0x11c')]['hasMany'](db[_0x1e9b('0x1e3')],{'as':_0x1e9b('0x1e4'),'foreignKey':'userProfileId','onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0x1e3')][_0x1e9b('0x10e')](db['UserProfileResource'],{'as':_0x1e9b('0x1e5'),'foreignKey':_0x1e9b('0x1e6'),'onDelete':_0x1e9b('0x10d')});db[_0x1e9b('0xfa')]['hasMany'](db[_0x1e9b('0x80')],{'as':_0x1e9b('0x160'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0x1e9b('0xfa')]['hasMany'](db[_0x1e9b('0x7e')],{'as':_0x1e9b('0x161'),'foreignKey':_0x1e9b('0x1e7')});db[_0x1e9b('0xfa')][_0x1e9b('0x10e')](db['WhatsappMessage'],{'as':_0x1e9b('0x162'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount']['hasMany'](db['WhatsappInteraction'],{'as':_0x1e9b('0x174')});db[_0x1e9b('0xfa')][_0x1e9b('0x10e')](db[_0x1e9b('0xfb')],{'as':_0x1e9b('0x163')});db[_0x1e9b('0xfa')][_0x1e9b('0x11b')](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0xfa')]['belongsTo'](db['Pause'],{'as':_0x1e9b('0x14f'),'foreignKey':_0x1e9b('0x150')});db['WhatsappAccount'][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x140')});db[_0x1e9b('0xfb')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0xfb')]['belongsTo'](db[_0x1e9b('0x103')],{'onDelete':_0x1e9b('0x15d')});db['WhatsappApplication'][_0x1e9b('0x11b')](db[_0x1e9b('0xfa')],{'onDelete':_0x1e9b('0x15d')});db['WhatsappApplication']['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db['WhatsappApplication'][_0x1e9b('0x11b')](db[_0x1e9b('0x8c')],{'onDelete':_0x1e9b('0x15d'),'foreignKey':_0x1e9b('0x183')});db[_0x1e9b('0x117')]['hasMany'](db[_0x1e9b('0xfe')],{'as':_0x1e9b('0x162'),'onDelete':_0x1e9b('0x10d'),'foreignKey':_0x1e9b('0x1e8')});db['WhatsappInteraction'][_0x1e9b('0x11b')](db[_0x1e9b('0xfa')],{'as':'Account','foreignKey':_0x1e9b('0x1e7')});db['WhatsappInteraction'][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0x1e9b('0x117')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x16d'),'foreignKey':_0x1e9b('0x10f')});db[_0x1e9b('0x117')]['belongsToMany'](db[_0x1e9b('0x8c')],{'through':_0x1e9b('0x1a4'),'as':_0x1e9b('0x186')});db[_0x1e9b('0x117')][_0x1e9b('0x11d')](db[_0x1e9b('0x8c')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0x1e9b('0x117')][_0x1e9b('0x11d')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x170'),'through':'user_has_whatsapp_interactions','foreignKey':_0x1e9b('0x1e8')});db[_0x1e9b('0xfe')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'as':'User'});db[_0x1e9b('0xfe')][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'onDelete':_0x1e9b('0x10d'),'as':_0x1e9b('0x16c')});db[_0x1e9b('0xfe')][_0x1e9b('0x11b')](db[_0x1e9b('0x117')],{'onDelete':_0x1e9b('0x10d'),'as':'Interaction','foreignKey':_0x1e9b('0x1e8')});db[_0x1e9b('0xfe')]['belongsTo'](db[_0x1e9b('0xfa')],{'as':_0x1e9b('0x16b'),'foreignKey':_0x1e9b('0x1e7')});db[_0x1e9b('0xff')][_0x1e9b('0x11b')](db['WhatsappAccount'],{});db[_0x1e9b('0xff')][_0x1e9b('0x11b')](db[_0x1e9b('0xf4')],{'as':_0x1e9b('0x164'),'foreignKey':_0x1e9b('0x165')});db[_0x1e9b('0xff')][_0x1e9b('0x11b')](db[_0x1e9b('0x70')],{'as':'Contact','foreignKey':_0x1e9b('0x15a')});db['WhatsappQueueReport'][_0x1e9b('0x11b')](db['WhatsappInteraction'],{});db[_0x1e9b('0xff')][_0x1e9b('0x11b')](db[_0x1e9b('0x103')],{});db[_0x1e9b('0xff')][_0x1e9b('0x11b')](db[_0x1e9b('0xfe')],{});db['WhatsappQueueReport'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{});db[_0x1e9b('0x101')][_0x1e9b('0x11b')](db[_0x1e9b('0xfe')],{});db[_0x1e9b('0x101')][_0x1e9b('0x11b')](db[_0x1e9b('0x117')],{});db[_0x1e9b('0x101')]['belongsTo'](db[_0x1e9b('0xfa')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x1e9b('0x101')]['belongsTo'](db[_0x1e9b('0xfa')],{'foreignKey':_0x1e9b('0x1e9'),'as':'ToAccount'});db[_0x1e9b('0x101')][_0x1e9b('0x11b')](db[_0x1e9b('0x103')],{'foreignKey':_0x1e9b('0x1ea'),'as':_0x1e9b('0x1d1')});db['WhatsappTransferReport']['belongsTo'](db[_0x1e9b('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x1e9b('0x101')][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'foreignKey':'ToUserId','as':_0x1e9b('0x1cf')});db['WhatsappQueue']['belongsToMany'](db['User'],{'as':_0x1e9b('0x152'),'through':_0x1e9b('0x38'),'foreignKey':_0x1e9b('0x1eb')});db[_0x1e9b('0x103')]['belongsToMany'](db[_0x1e9b('0xe5')],{'through':'team_has_whatsapp_queues','as':_0x1e9b('0x169')});db['UserSetting'][_0x1e9b('0x11b')](db[_0x1e9b('0x12')],{'as':_0x1e9b('0x1ec'),'foreignKey':_0x1e9b('0x10f'),'onDelete':'cascade','hooks':!![]});db[_0x1e9b('0x104')][_0x1e9b('0x10c')](db['Dynamics365Account'],{'as':_0x1e9b('0xc3'),'onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x104')][_0x1e9b('0x10c')](db[_0x1e9b('0x3a')],{'as':'Imap','onDelete':_0x1e9b('0x15d')});db[_0x1e9b('0x104')]['hasOne'](db[_0x1e9b('0x3b')],{'as':_0x1e9b('0x15f'),'onDelete':'restrict'});module[_0x1e9b('0x1ed')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 79ef017..9430bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce05=['./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/cloudProviders','/api/realtime','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./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/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsMessage','./api/smsQueue','/api/openchannel/applications'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xce05,0xcf));var _0x5ce0=function(_0x3cbf00,_0x52b9e1){_0x3cbf00=_0x3cbf00-0x0;var _0x36c3dc=_0xce05[_0x3cbf00];return _0x36c3dc;};'use strict';var path=require(_0x5ce0('0x0'));var express=require('express');var errors=require('./errors');var config=require(_0x5ce0('0x1'));var setupLoggers=require('./utils/client-side-logger')[_0x5ce0('0x2')];var clientSideLogs=require(_0x5ce0('0x3'));exports[_0x5ce0('0x4')]=function(_0x595023){return setupLoggers(_0x595023)[_0x5ce0('0x5')](function(){_0x595023[_0x5ce0('0x6')](_0x5ce0('0x7'),require(_0x5ce0('0x8')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x9'),require(_0x5ce0('0xa')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xb'),require(_0x5ce0('0xc')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xd'),require(_0x5ce0('0xe')));_0x595023['use'](_0x5ce0('0xf'),require(_0x5ce0('0x10')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x11'),require(_0x5ce0('0x12')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x13'),require(_0x5ce0('0x14')));_0x595023[_0x5ce0('0x6')]('/api/screen/recordings',require(_0x5ce0('0x15')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x16'),require(_0x5ce0('0x17')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x18'),require(_0x5ce0('0x19')));_0x595023['use'](_0x5ce0('0x1a'),require(_0x5ce0('0x1b')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x1c'),require(_0x5ce0('0x1d')));_0x595023[_0x5ce0('0x6')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x1e'),require(_0x5ce0('0x1f')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x20'),require(_0x5ce0('0x21')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x22'),require(_0x5ce0('0x23')));_0x595023['use'](_0x5ce0('0x24'),require(_0x5ce0('0x25')));_0x595023['use'](_0x5ce0('0x26'),require('./api/mailServerOut'));_0x595023[_0x5ce0('0x6')]('/api/mail/accounts',require('./api/mailAccount'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x27'),require(_0x5ce0('0x28')));_0x595023[_0x5ce0('0x6')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x29'),require(_0x5ce0('0x2a')));_0x595023['use'](_0x5ce0('0x2b'),require(_0x5ce0('0x2c')));_0x595023['use'](_0x5ce0('0x2d'),require(_0x5ce0('0x2e')));_0x595023['use'](_0x5ce0('0x2f'),require('./api/mailQueueReport'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x30'),require(_0x5ce0('0x31')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x32'),require(_0x5ce0('0x33')));_0x595023['use'](_0x5ce0('0x34'),require(_0x5ce0('0x35')));_0x595023['use'](_0x5ce0('0x36'),require(_0x5ce0('0x37')));_0x595023['use'](_0x5ce0('0x38'),require(_0x5ce0('0x39')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x3a'),require(_0x5ce0('0x3b')));_0x595023['use'](_0x5ce0('0x3c'),require('./api/faxQueue'));_0x595023['use'](_0x5ce0('0x3d'),require(_0x5ce0('0x3e')));_0x595023[_0x5ce0('0x6')]('/api/sms/accounts',require(_0x5ce0('0x3f')));_0x595023['use'](_0x5ce0('0x40'),require('./api/smsApplication'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x41'),require('./api/smsInteraction'));_0x595023['use']('/api/sms/messages',require(_0x5ce0('0x42')));_0x595023['use']('/api/sms/queues',require(_0x5ce0('0x43')));_0x595023[_0x5ce0('0x6')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x595023['use'](_0x5ce0('0x44'),require('./api/openchannelApplication'));_0x595023['use']('/api/openchannel/interactions',require(_0x5ce0('0x45')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x46'),require('./api/openchannelMessage'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x47'),require(_0x5ce0('0x48')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x49'),require(_0x5ce0('0x4a')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x4b'),require(_0x5ce0('0x4c')));_0x595023[_0x5ce0('0x6')]('/api/chat/applications',require('./api/chatApplication'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x4d'),require('./api/chatInteraction'));_0x595023['use'](_0x5ce0('0x4e'),require(_0x5ce0('0x4f')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x50'),require('./api/chatOfflineMessage'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x51'),require(_0x5ce0('0x52')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x53'),require(_0x5ce0('0x54')));_0x595023['use'](_0x5ce0('0x55'),require(_0x5ce0('0x56')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x57'),require(_0x5ce0('0x58')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x59'),require(_0x5ce0('0x5a')));_0x595023['use']('/api/cm/hopper',require(_0x5ce0('0x5b')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x5c'),require(_0x5ce0('0x5d')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x5e'),require(_0x5ce0('0x5f')));_0x595023['use'](_0x5ce0('0x60'),require('./api/cmHopperHistory'));_0x595023['use'](_0x5ce0('0x61'),require(_0x5ce0('0x62')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x63'),require(_0x5ce0('0x64')));_0x595023['use'](_0x5ce0('0x65'),require(_0x5ce0('0x66')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x67'),require(_0x5ce0('0x68')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x69'),require('./api/disposition'));_0x595023['use'](_0x5ce0('0x6a'),require(_0x5ce0('0x6b')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x6c'),require('./api/interval'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x6d'),require(_0x5ce0('0x6e')));_0x595023['use'](_0x5ce0('0x6f'),require('./api/cdr'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x70'),require(_0x5ce0('0x71')));_0x595023[_0x5ce0('0x6')]('/api/schedules',require(_0x5ce0('0x72')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x73'),require('./api/sound'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x74'),require(_0x5ce0('0x75')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x76'),require('./api/contactItemType'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x77'),require(_0x5ce0('0x78')));_0x595023[_0x5ce0('0x6')]('/api/cm_hopper_additional_phones',require(_0x5ce0('0x79')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x7a'),require(_0x5ce0('0x7b')));_0x595023[_0x5ce0('0x6')]('/api/triggers',require(_0x5ce0('0x7c')));_0x595023['use'](_0x5ce0('0x7d'),require(_0x5ce0('0x7e')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x7f'),require(_0x5ce0('0x80')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x81'),require('./api/integrationReport'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x82'),require(_0x5ce0('0x83')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x84'),require(_0x5ce0('0x85')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x86'),require(_0x5ce0('0x87')));_0x595023[_0x5ce0('0x6')]('/api/analytics/metrics',require(_0x5ce0('0x88')));_0x595023['use']('/api/analytics/field_reports',require(_0x5ce0('0x89')));_0x595023['use']('/api/analytics/tree_reports',require(_0x5ce0('0x8a')));_0x595023[_0x5ce0('0x6')]('/api/integrations/salesforce/accounts',require(_0x5ce0('0x8b')));_0x595023[_0x5ce0('0x6')]('/api/integrations/salesforce/configurations',require(_0x5ce0('0x8c')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x8d'),require(_0x5ce0('0x8e')));_0x595023[_0x5ce0('0x6')]('/api/integrations/sugarcrm/accounts',require(_0x5ce0('0x8f')));_0x595023[_0x5ce0('0x6')]('/api/integrations/sugarcrm/configurations',require(_0x5ce0('0x90')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x91'),require(_0x5ce0('0x92')));_0x595023[_0x5ce0('0x6')]('/api/integrations/desk/accounts',require(_0x5ce0('0x93')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x94'),require(_0x5ce0('0x95')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x96'),require(_0x5ce0('0x97')));_0x595023['use'](_0x5ce0('0x98'),require(_0x5ce0('0x99')));_0x595023['use'](_0x5ce0('0x9a'),require('./api/intZohoConfiguration'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x9b'),require(_0x5ce0('0x9c')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x9d'),require(_0x5ce0('0x9e')));_0x595023[_0x5ce0('0x6')]('/api/integrations/zendesk/configurations',require(_0x5ce0('0x9f')));_0x595023[_0x5ce0('0x6')]('/api/integrations/zendesk/fields',require(_0x5ce0('0xa0')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xa1'),require('./api/intFreshdeskAccount'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xa2'),require('./api/intFreshdeskConfiguration'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xa3'),require('./api/intFreshdeskField'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xa4'),require(_0x5ce0('0xa5')));_0x595023[_0x5ce0('0x6')]('/api/integrations/vtiger/configurations',require(_0x5ce0('0xa6')));_0x595023[_0x5ce0('0x6')]('/api/integrations/vtiger/fields',require(_0x5ce0('0xa7')));_0x595023[_0x5ce0('0x6')]('/api/integrations/servicenow/accounts',require(_0x5ce0('0xa8')));_0x595023['use'](_0x5ce0('0xa9'),require(_0x5ce0('0xaa')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xab'),require(_0x5ce0('0xac')));_0x595023[_0x5ce0('0x6')]('/api/integrations/dynamics365/accounts',require(_0x5ce0('0xad')));_0x595023[_0x5ce0('0x6')]('/api/integrations/dynamics365/configurations',require(_0x5ce0('0xae')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xaf'),require(_0x5ce0('0xb0')));_0x595023['use'](_0x5ce0('0xb1'),require(_0x5ce0('0xb2')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xb3'),require('./api/intFreshsalesConfiguration'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xb4'),require(_0x5ce0('0xb5')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xb6'),require('./api/network'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xb7'),require(_0x5ce0('0xb8')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xb9'),require(_0x5ce0('0xba')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xbb'),require(_0x5ce0('0xbc')));_0x595023['use'](_0x5ce0('0xbd'),require(_0x5ce0('0xbe')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xbf'),require(_0x5ce0('0xc0')));_0x595023['use'](_0x5ce0('0xc1'),require(_0x5ce0('0xc2')));_0x595023['use'](_0x5ce0('0xc3'),require(_0x5ce0('0xc4')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xc5'),require('./api/squareReportDetail'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xc6'),require(_0x5ce0('0xc7')));_0x595023['use']('/api/settings',require(_0x5ce0('0xc8')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xc9'),require(_0x5ce0('0xca')));_0x595023['use'](_0x5ce0('0xcb'),require(_0x5ce0('0xcc')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xcd'),require('./api/squareRecording'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xce'),require('./api/squareMessage'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xcf'),require(_0x5ce0('0xd0')));_0x595023['use'](_0x5ce0('0xd1'),require('./api/license'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xd2'),require('./api/campaign'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xd3'),require(_0x5ce0('0xd4')));_0x595023[_0x5ce0('0x6')]('/api/attachments',require(_0x5ce0('0xd5')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xd6'),require(_0x5ce0('0xd7')));_0x595023[_0x5ce0('0x6')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xd8'),require(_0x5ce0('0xd9')));_0x595023[_0x5ce0('0x6')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xda'),require(_0x5ce0('0xdb')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xdc'),require(_0x5ce0('0xdd')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xde'),require(_0x5ce0('0xdf')));_0x595023[_0x5ce0('0x6')]('/api/voice/prefixes',require(_0x5ce0('0xe0')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xe1'),require(_0x5ce0('0xe2')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xe3'),require(_0x5ce0('0xe4')));_0x595023['use']('/api/userProfile/resources',require(_0x5ce0('0xe5')));_0x595023[_0x5ce0('0x6')]('/api/userNotifications',require(_0x5ce0('0xe6')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xe7'),require(_0x5ce0('0xe8')));_0x595023['use'](_0x5ce0('0xe9'),require(_0x5ce0('0xea')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xeb'),require(_0x5ce0('0xec')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xed'),require(_0x5ce0('0xee')));_0x595023['use'](_0x5ce0('0xef'),require(_0x5ce0('0xf0')));_0x595023[_0x5ce0('0x6')]('/api/whatsapp/reports/transfer',require(_0x5ce0('0xf1')));_0x595023['use']('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x595023['use'](_0x5ce0('0xf2'),require('./api/cloudProvider'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xf3'),require('./api/realtime'));_0x595023[_0x5ce0('0x6')]('/api/user-settings',require(_0x5ce0('0xf4')));_0x595023[_0x5ce0('0x6')]('/api/auth/local',require(_0x5ce0('0xf5')));_0x595023['use'](_0x5ce0('0xf6'),require(_0x5ce0('0xf7')));_0x595023['use'](_0x5ce0('0xf8'),require(_0x5ce0('0xf9')));_0x595023[_0x5ce0('0x6')]('/api/jira',require(_0x5ce0('0xfa')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xfb'),require(_0x5ce0('0xfc')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xfd'),require(_0x5ce0('0xfe')));_0x595023[_0x5ce0('0x6')]('/api/system',require('./api/system'));_0x595023[_0x5ce0('0x6')](_0x5ce0('0xff'),require(_0x5ce0('0x100')));_0x595023[_0x5ce0('0x6')]('/api/webbar',require(_0x5ce0('0x101')));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x102'),clientSideLogs);_0x595023['use'](_0x5ce0('0x103'),express[_0x5ce0('0x104')](path[_0x5ce0('0x105')](config[_0x5ce0('0x106')],_0x5ce0('0x103'))));_0x595023[_0x5ce0('0x6')]('/www',express[_0x5ce0('0x104')](path[_0x5ce0('0x105')](config[_0x5ce0('0x106')],_0x5ce0('0x107'))));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x108'),express[_0x5ce0('0x104')](path[_0x5ce0('0x105')](config[_0x5ce0('0x106')],_0x5ce0('0x108'))));_0x595023['use'](_0x5ce0('0x109'),express[_0x5ce0('0x104')](path[_0x5ce0('0x105')](config[_0x5ce0('0x106')],_0x5ce0('0x10a'),_0x5ce0('0x10b'))));_0x595023[_0x5ce0('0x6')](_0x5ce0('0x10c'),express[_0x5ce0('0x104')](path[_0x5ce0('0x105')](config[_0x5ce0('0x106')],'/server/files/plugins')));_0x595023[_0x5ce0('0x10d')](_0x5ce0('0x10e'))[_0x5ce0('0x10f')](errors[0x194]);_0x595023[_0x5ce0('0x10d')]('/*')[_0x5ce0('0x10f')](function(_0xe2fda0,_0x3d8de1){_0x3d8de1[_0x5ce0('0x110')](path[_0x5ce0('0x111')](_0x595023['get'](_0x5ce0('0x112'))+_0x5ce0('0x113')));});return _0x595023;});};
\ No newline at end of file
+var _0x55ca=['./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','get','sendFile','appPath','/index.html','path','express','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','./api/sound','./api/tag','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./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/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','/api/rpc','./api/rpc','/api/system'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x55ca,0x126));var _0xa55c=function(_0xd81b5b,_0x15f6a7){_0xd81b5b=_0xd81b5b-0x0;var _0x52ffd9=_0x55ca[_0xd81b5b];return _0x52ffd9;};'use strict';var path=require(_0xa55c('0x0'));var express=require(_0xa55c('0x1'));var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0xa55c('0x2')];var clientSideLogs=require(_0xa55c('0x3'));exports['default']=function(_0x3b478a){return setupLoggers(_0x3b478a)[_0xa55c('0x4')](function(){_0x3b478a[_0xa55c('0x5')](_0xa55c('0x6'),require(_0xa55c('0x7')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x8'),require('./api/voiceChanSpy'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x9'),require('./api/voiceContext'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xa'),require('./api/voiceExtension'));_0x3b478a['use'](_0xa55c('0xb'),require(_0xa55c('0xc')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xd'),require(_0xa55c('0xe')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xf'),require(_0xa55c('0x10')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x11'),require('./api/screenRecording'));_0x3b478a['use'](_0xa55c('0x12'),require('./api/voiceMail'));_0x3b478a['use']('/api/voice/mails/messages',require(_0xa55c('0x13')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x14'),require(_0xa55c('0x15')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x16'),require('./api/voiceDialReport'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x17'),require(_0xa55c('0x18')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x19'),require(_0xa55c('0x1a')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x1b'),require(_0xa55c('0x1c')));_0x3b478a['use'](_0xa55c('0x1d'),require(_0xa55c('0x1e')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x1f'),require(_0xa55c('0x20')));_0x3b478a[_0xa55c('0x5')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x21'),require(_0xa55c('0x22')));_0x3b478a['use'](_0xa55c('0x23'),require(_0xa55c('0x24')));_0x3b478a['use'](_0xa55c('0x25'),require(_0xa55c('0x26')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x27'),require(_0xa55c('0x28')));_0x3b478a['use'](_0xa55c('0x29'),require('./api/mailMessage'));_0x3b478a['use']('/api/mail/applications',require(_0xa55c('0x2a')));_0x3b478a['use'](_0xa55c('0x2b'),require(_0xa55c('0x2c')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x2d'),require(_0xa55c('0x2e')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x2f'),require(_0xa55c('0x30')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x31'),require(_0xa55c('0x32')));_0x3b478a['use'](_0xa55c('0x33'),require(_0xa55c('0x34')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x35'),require('./api/faxInteraction'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x36'),require(_0xa55c('0x37')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x38'),require(_0xa55c('0x39')));_0x3b478a['use'](_0xa55c('0x3a'),require('./api/faxQueueReport'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x3b'),require(_0xa55c('0x3c')));_0x3b478a[_0xa55c('0x5')]('/api/sms/applications',require(_0xa55c('0x3d')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x3e'),require(_0xa55c('0x3f')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x40'),require(_0xa55c('0x41')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x42'),require(_0xa55c('0x43')));_0x3b478a[_0xa55c('0x5')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x44'),require('./api/openchannelApplication'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x45'),require(_0xa55c('0x46')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x47'),require(_0xa55c('0x48')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x49'),require(_0xa55c('0x4a')));_0x3b478a['use']('/api/chat/websites',require('./api/chatWebsite'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x4b'),require(_0xa55c('0x4c')));_0x3b478a['use'](_0xa55c('0x4d'),require('./api/chatApplication'));_0x3b478a[_0xa55c('0x5')]('/api/chat/interactions',require(_0xa55c('0x4e')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x4f'),require('./api/chatMessage'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x50'),require('./api/chatOfflineMessage'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x51'),require('./api/chatQueue'));_0x3b478a['use'](_0xa55c('0x52'),require('./api/chatGroup'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x53'),require('./api/chatProactiveAction'));_0x3b478a['use']('/api/cm/companies',require('./api/cmCompany'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x54'),require(_0xa55c('0x55')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x56'),require('./api/cmHopper'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x57'),require(_0xa55c('0x58')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x59'),require(_0xa55c('0x5a')));_0x3b478a['use'](_0xa55c('0x5b'),require('./api/cmHopperHistory'));_0x3b478a['use'](_0xa55c('0x5c'),require(_0xa55c('0x5d')));_0x3b478a['use'](_0xa55c('0x5e'),require('./api/action'));_0x3b478a['use'](_0xa55c('0x5f'),require(_0xa55c('0x60')));_0x3b478a[_0xa55c('0x5')]('/api/canned_answers',require(_0xa55c('0x61')));_0x3b478a[_0xa55c('0x5')]('/api/dispositions',require(_0xa55c('0x62')));_0x3b478a['use'](_0xa55c('0x63'),require(_0xa55c('0x64')));_0x3b478a['use'](_0xa55c('0x65'),require(_0xa55c('0x66')));_0x3b478a['use'](_0xa55c('0x67'),require(_0xa55c('0x68')));_0x3b478a[_0xa55c('0x5')]('/api/cdr',require(_0xa55c('0x69')));_0x3b478a['use'](_0xa55c('0x6a'),require(_0xa55c('0x6b')));_0x3b478a[_0xa55c('0x5')]('/api/schedules',require(_0xa55c('0x6c')));_0x3b478a[_0xa55c('0x5')]('/api/sounds',require(_0xa55c('0x6d')));_0x3b478a[_0xa55c('0x5')]('/api/tags',require(_0xa55c('0x6e')));_0x3b478a[_0xa55c('0x5')]('/api/templates',require(_0xa55c('0x6f')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x70'),require(_0xa55c('0x71')));_0x3b478a['use'](_0xa55c('0x72'),require('./api/variable'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x73'),require(_0xa55c('0x74')));_0x3b478a['use'](_0xa55c('0x75'),require(_0xa55c('0x76')));_0x3b478a['use'](_0xa55c('0x77'),require(_0xa55c('0x78')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x79'),require(_0xa55c('0x7a')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x7b'),require(_0xa55c('0x7c')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x7d'),require('./api/analyticMetric'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x7e'),require(_0xa55c('0x7f')));_0x3b478a['use'](_0xa55c('0x80'),require(_0xa55c('0x81')));_0x3b478a['use'](_0xa55c('0x82'),require('./api/intSalesforceAccount'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x83'),require(_0xa55c('0x84')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x85'),require('./api/intSalesforceField'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x86'),require('./api/intSugarcrmAccount'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x87'),require(_0xa55c('0x88')));_0x3b478a[_0xa55c('0x5')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x89'),require(_0xa55c('0x8a')));_0x3b478a[_0xa55c('0x5')]('/api/integrations/desk/configurations',require(_0xa55c('0x8b')));_0x3b478a['use'](_0xa55c('0x8c'),require(_0xa55c('0x8d')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x8e'),require(_0xa55c('0x8f')));_0x3b478a['use'](_0xa55c('0x90'),require('./api/intZohoConfiguration'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x91'),require(_0xa55c('0x92')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x93'),require(_0xa55c('0x94')));_0x3b478a[_0xa55c('0x5')]('/api/integrations/zendesk/configurations',require(_0xa55c('0x95')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x96'),require(_0xa55c('0x97')));_0x3b478a[_0xa55c('0x5')]('/api/integrations/freshdesk/accounts',require(_0xa55c('0x98')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x99'),require(_0xa55c('0x9a')));_0x3b478a[_0xa55c('0x5')]('/api/integrations/freshdesk/fields',require(_0xa55c('0x9b')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x9c'),require(_0xa55c('0x9d')));_0x3b478a[_0xa55c('0x5')]('/api/integrations/vtiger/configurations',require(_0xa55c('0x9e')));_0x3b478a['use'](_0xa55c('0x9f'),require('./api/intVtigerField'));_0x3b478a[_0xa55c('0x5')]('/api/integrations/servicenow/accounts',require(_0xa55c('0xa0')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xa1'),require(_0xa55c('0xa2')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xa3'),require(_0xa55c('0xa4')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xa5'),require(_0xa55c('0xa6')));_0x3b478a['use'](_0xa55c('0xa7'),require(_0xa55c('0xa8')));_0x3b478a['use'](_0xa55c('0xa9'),require(_0xa55c('0xaa')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xab'),require(_0xa55c('0xac')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xad'),require(_0xa55c('0xae')));_0x3b478a['use'](_0xa55c('0xaf'),require(_0xa55c('0xb0')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xb1'),require(_0xa55c('0xb2')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xb3'),require(_0xa55c('0xb4')));_0x3b478a[_0xa55c('0x5')]('/api/chat/internal/messages',require(_0xa55c('0xb5')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xb6'),require(_0xa55c('0xb7')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xb8'),require(_0xa55c('0xb9')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xba'),require(_0xa55c('0xbb')));_0x3b478a[_0xa55c('0x5')]('/api/sms/reports/queue',require(_0xa55c('0xbc')));_0x3b478a['use'](_0xa55c('0xbd'),require(_0xa55c('0xbe')));_0x3b478a[_0xa55c('0x5')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xbf'),require(_0xa55c('0xc0')));_0x3b478a[_0xa55c('0x5')]('/api/settings',require(_0xa55c('0xc1')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xc2'),require(_0xa55c('0xc3')));_0x3b478a[_0xa55c('0x5')]('/api/square/projects',require('./api/squareProject'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xc4'),require(_0xa55c('0xc5')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xc6'),require('./api/squareMessage'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xc7'),require('./api/team'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xc8'),require(_0xa55c('0xc9')));_0x3b478a['use'](_0xa55c('0xca'),require(_0xa55c('0xcb')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xcc'),require(_0xa55c('0xcd')));_0x3b478a['use'](_0xa55c('0xce'),require(_0xa55c('0xcf')));_0x3b478a['use']('/api/plugins',require(_0xa55c('0xd0')));_0x3b478a['use'](_0xa55c('0xd1'),require(_0xa55c('0xd2')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xd3'),require(_0xa55c('0xd4')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xd5'),require(_0xa55c('0xd6')));_0x3b478a[_0xa55c('0x5')]('/api/openchannel/reports/transfer',require(_0xa55c('0xd7')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xd8'),require(_0xa55c('0xd9')));_0x3b478a['use'](_0xa55c('0xda'),require(_0xa55c('0xdb')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xdc'),require('./api/voicePrefix'));_0x3b478a['use'](_0xa55c('0xdd'),require(_0xa55c('0xde')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xdf'),require('./api/userProfileSection'));_0x3b478a['use'](_0xa55c('0xe0'),require(_0xa55c('0xe1')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xe2'),require(_0xa55c('0xe3')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xe4'),require('./api/whatsappAccount'));_0x3b478a[_0xa55c('0x5')]('/api/whatsapp/applications',require(_0xa55c('0xe5')));_0x3b478a['use'](_0xa55c('0xe6'),require(_0xa55c('0xe7')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xe8'),require(_0xa55c('0xe9')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xea'),require(_0xa55c('0xeb')));_0x3b478a['use']('/api/whatsapp/reports/transfer',require(_0xa55c('0xec')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xed'),require(_0xa55c('0xee')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xef'),require('./api/cloudProvider'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xf0'),require(_0xa55c('0xf1')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xf2'),require(_0xa55c('0xf3')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xf4'),require('./api/authLocal'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xf5'),require(_0xa55c('0xf6')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xf7'),require('./api/authActiveDirectory'));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xf8'),require('./api/jira'));_0x3b478a['use'](_0xa55c('0xf9'),require(_0xa55c('0xfa')));_0x3b478a['use']('/api/version',require('./api/version'));_0x3b478a['use'](_0xa55c('0xfb'),require(_0xa55c('0xfc')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0xfd'),require(_0xa55c('0xfe')));_0x3b478a[_0xa55c('0x5')]('/api/webbar',require(_0xa55c('0xff')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x100'),clientSideLogs);_0x3b478a[_0xa55c('0x5')]('/apidoc',express[_0xa55c('0x101')](path[_0xa55c('0x102')](config[_0xa55c('0x103')],'/apidoc')));_0x3b478a[_0xa55c('0x5')]('/www',express['static'](path[_0xa55c('0x102')](config[_0xa55c('0x103')],_0xa55c('0x104'))));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x105'),express[_0xa55c('0x101')](path[_0xa55c('0x102')](config['root'],'/demo')));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x106'),express[_0xa55c('0x101')](path[_0xa55c('0x102')](config[_0xa55c('0x103')],_0xa55c('0x107'),_0xa55c('0x108'))));_0x3b478a[_0xa55c('0x5')](_0xa55c('0x109'),express[_0xa55c('0x101')](path['join'](config[_0xa55c('0x103')],_0xa55c('0x10a'))));_0x3b478a['route'](_0xa55c('0x10b'))['get'](errors[0x194]);_0x3b478a[_0xa55c('0x10c')]('/*')[_0xa55c('0x10d')](function(_0x3fe34d,_0x314205){_0x314205[_0xa55c('0x10e')](path['resolve'](_0x3b478a[_0xa55c('0x10d')](_0xa55c('0x10f'))+_0xa55c('0x110')));});return _0x3b478a;});};
\ No newline at end of file
index e34d3d9..5ff9b10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda8b=['error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.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','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.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/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost'];(function(_0x21d9e9,_0x6a5d20){var _0x3341d9=function(_0x1d165f){while(--_0x1d165f){_0x21d9e9['push'](_0x21d9e9['shift']());}};_0x3341d9(++_0x6a5d20);}(_0xda8b,0x96));var _0xbda8=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xda8b[_0x2b5eae];return _0x5f3ac9;};'use strict';var jayson=require(_0xbda8('0x0'));var _=require(_0xbda8('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x20ded1,_0x43e090){var _0x1e2bb5={};_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x3')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/voiceExtension/voiceExtension.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x4')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x5')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x6')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x7')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x8')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x9')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0xa')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0xb')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0xc')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0xd')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0xe')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0xf')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/mailQueue/mailQueue.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x10')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/mailMessage/mailMessage.rpc'));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x11')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x12')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x13')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/faxApplication/faxApplication.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x14')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x15')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x16')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x17')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/smsAccount/smsAccount.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x18')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x19')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x1a')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x1b')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1e2bb5=_['merge'](_0x1e2bb5,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1e2bb5=_['merge'](_0x1e2bb5,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x1c')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x1d')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x1e')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x1f')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x20')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/cmHopper/cmHopper.rpc'));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x21')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1e2bb5=_['merge'](_0x1e2bb5,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x22')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x23')));_0x1e2bb5=_['merge'](_0x1e2bb5,require('../api/pause/pause.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x24')));_0x1e2bb5=_['merge'](_0x1e2bb5,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x25')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x26')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x27')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x28')));_0x1e2bb5=_['merge'](_0x1e2bb5,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x29')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x2a')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x2b')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x2c')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x2d')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x2e')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x2f')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x30')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x31')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/setting/setting.rpc'));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x32')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x33')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x34')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require('../api/squareMessage/squareMessage.rpc'));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x35')));_0x1e2bb5=_['merge'](_0x1e2bb5,require(_0xbda8('0x36')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x37')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x38')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x39')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x3a')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x3b')));_0x1e2bb5=_[_0xbda8('0x2')](_0x1e2bb5,require(_0xbda8('0x3c')));var _0x1c904f=jayson[_0xbda8('0x3d')](_0x1e2bb5)[_0xbda8('0x3e')]();var _0x31145b=config[_0xbda8('0x3f')][_0xbda8('0x40')]||config[_0xbda8('0x40')]+0x1;var _0x55e178=config[_0xbda8('0x3f')]['ip']||_0xbda8('0x41');_0x1c904f['on'](_0xbda8('0x42'),function(_0x3fabf6){return _0x43e090(_0x3fabf6);});_0x1c904f['listen'](_0x31145b,_0x55e178,function(){console[_0xbda8('0x43')](_0xbda8('0x44'),_0x55e178,_0x31145b);require(_0xbda8('0x45'))[_0xbda8('0x46')]();return _0x20ded1(_0xbda8('0x47')+_0x55e178+':'+_0x31145b);});});};
\ No newline at end of file
+var _0xbd39=['../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','log','../config/triggers','default','jayson/promise','lodash','listen','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.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/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc'];(function(_0x13c595,_0x3886fd){var _0x3b1006=function(_0x32029b){while(--_0x32029b){_0x13c595['push'](_0x13c595['shift']());}};_0x3b1006(++_0x3886fd);}(_0xbd39,0x17a));var _0x9bd3=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xbd39[_0x4fde08];return _0x12e725;};'use strict';var jayson=require(_0x9bd3('0x0'));var _=require(_0x9bd3('0x1'));var config=require('../config/environment');exports[_0x9bd3('0x2')]=function(){return new Promise(function(_0x4042cf,_0x5bfb02){var _0x927957={};_0x927957=_['merge'](_0x927957,require('../api/user/user.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/voiceExtension/voiceExtension.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x4')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x5')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x6')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x7')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x8')));_0x927957=_['merge'](_0x927957,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x9')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0xa')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0xb')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0xc')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0xd')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/mailAccount/mailAccount.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/mailQueue/mailQueue.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0xe')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0xf')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x10')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x11')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x12')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/faxApplication/faxApplication.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x13')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x14')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/faxQueue/faxQueue.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x15')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x16')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x17')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x18')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x19')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x1a')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x1b')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x1c')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x1d')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x1e')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x1f')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x20')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x21')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x22')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x23')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x24')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x25')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x26')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x27')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x28')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/trigger/trigger.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x29')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x2a')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x2b')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x2c')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x2d')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x2e')));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x2f')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x927957=_['merge'](_0x927957,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x30')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x31')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x32')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x33')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x34')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x35')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x36')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x37')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x38')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x39')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x3a')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x3b')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x3c')));_0x927957=_['merge'](_0x927957,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x927957=_['merge'](_0x927957,require(_0x9bd3('0x3d')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x3e')));_0x927957=_[_0x9bd3('0x3')](_0x927957,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x927957=_[_0x9bd3('0x3')](_0x927957,require(_0x9bd3('0x3f')));var _0x2594a5=jayson['server'](_0x927957)[_0x9bd3('0x40')]();var _0x2a07ea=config[_0x9bd3('0x41')][_0x9bd3('0x42')]||config['port']+0x1;var _0x14a768=config['rpc']['ip']||_0x9bd3('0x43');_0x2594a5['on'](_0x9bd3('0x44'),function(_0x307888){return _0x5bfb02(_0x307888);});_0x2594a5[_0x9bd3('0x2')](_0x2a07ea,_0x14a768,function(){console[_0x9bd3('0x45')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x14a768,_0x2a07ea);require(_0x9bd3('0x46'))[_0x9bd3('0x47')]();return _0x4042cf('RPC\x20listening\x20on\x20'+_0x14a768+':'+_0x2a07ea);});});};
\ No newline at end of file
index 7fb3c59..e1590b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe382=['sendRequest','sync','answer','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','format','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','call','setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','inherits','prototype'];(function(_0x261358,_0x5b5a93){var _0x442a11=function(_0x4bb9d7){while(--_0x4bb9d7){_0x261358['push'](_0x261358['shift']());}};_0x442a11(++_0x5b5a93);}(_0xe382,0x1b6));var _0x2e38=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0xe382[_0x3d78d7];return _0x4b6784;};'use strict';var util=require('util');var _=require(_0x2e38('0x0'));var EventEmitter=require(_0x2e38('0x1'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x3d38f1){var _0x597e9a=this,_0x2a7110=new AGIReply(),_0xc068f0=![],_0x5e69dc={};EventEmitter[_0x2e38('0x2')](_0x597e9a);_0x3d38f1['setEncoding']('utf8');_0x3d38f1[_0x2e38('0x3')](0x8*0x3c*0x3c*0x3e8);_0x2a7110['setEncoding'](_0x2e38('0x4'));_0x2a7110['on'](_0x2e38('0x5'),function(_0x5ca553){for(var _0x5a4664 in _0x5ca553){_0x597e9a[_0x5a4664]=_0x5ca553[_0x5a4664];}_0x597e9a[_0x2e38('0x6')](_0x2e38('0x7'));});_0x2a7110['on'](_0x2e38('0x8'),function(_0x58344c){if(_0x58344c[_0x2e38('0x9')]()==_0x2e38('0xa')){_0x597e9a[_0x2e38('0x6')](_0x2e38('0xa'));return;}if(_0x58344c[_0x2e38('0xb')](0x0,0xb)==_0x2e38('0xc')){_0xc068f0=!![];}if(_0xc068f0){_0x5e69dc['rx']+=_0x58344c+'\x0a';if(_0x58344c['search'](_0x2e38('0xd'))!=-0x1){_0xc068f0=![];}}else{_0x5e69dc['rx']=_0x58344c;}if(_0xc068f0){return;}if(typeof _0x5e69dc['cb']==_0x2e38('0xe')){var _0x298f44=_0x5e69dc['rx'][_0x2e38('0xb')](0x0,0x3),_0x1d1d96=null,_0xf7d743=null;_0x298f44=parseInt(_0x298f44);if(isNaN(_0x298f44)){_0x5e69dc['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2e38('0xf')});return;}if(_0x298f44!=0xc8){_0x5e69dc['cb'](null,{'code':_0x298f44,'result':-0x1,'extra':'KO'});return;}_0x1d1d96=_0x5e69dc['rx']['substring'](0x4)[_0x2e38('0x10')](_0x2e38('0x11'),'');if(_0x1d1d96[_0x2e38('0x12')]('\x20')!=-0x1){_0x1d1d96=_0x1d1d96[_0x2e38('0x13')](0x0,_0x1d1d96[_0x2e38('0x12')]('\x20'));}if(_[_0x2e38('0x14')](_0x1d1d96,'-1')){_0x1d1d96=parseInt(_0x1d1d96);}_0xf7d743=_0x5e69dc['rx'][_0x2e38('0x15')]('\x20');if(_0xf7d743['length']==0x3){_0xf7d743=_0xf7d743[0x2][_0x2e38('0xb')](0x1,_0xf7d743[0x2][_0x2e38('0x16')]-0x1);}else if(_0xf7d743[_0x2e38('0x16')]>0x3){var _0x359ac0=/\((.+)\)/;var _0x406857=_0x5e69dc['rx'][_0x2e38('0x17')](_0x359ac0);if(_0x406857){_0xf7d743=_0x406857[0x1];}else{_0xf7d743=null;}}else{_0xf7d743=null;}_0x5e69dc['cb'](null,{'code':_0x298f44,'result':_0x1d1d96,'extra':_0xf7d743});}});_0x3d38f1['on'](_0x2e38('0x18'),function(_0x3ba62d){_0x597e9a[_0x2e38('0x6')]('error',new AGIError(_0x2e38('0x19'),_0x3ba62d['code']));});_0x3d38f1['on'](_0x2e38('0x1a'),function(){_0x597e9a[_0x2e38('0x6')]('close',new AGIError(_0x2e38('0x1b')));});_0x3d38f1['on'](_0x2e38('0x1c'),function(){_0x597e9a[_0x2e38('0x6')]('timeout',new AGIError(_0x2e38('0x1d')));_0x3d38f1['destroy']();});_0x3d38f1[_0x2e38('0x1e')](_0x2a7110);this[_0x2e38('0x1f')]=function(_0x5a6e18,_0xd84d02){var _0x5a6e18=_0x5a6e18||'',_0xd84d02=typeof _0xd84d02=='function'?_0xd84d02:new Function();_0x5e69dc={'tx':_0x5a6e18,'rx':'','cb':_0xd84d02};_0x3d38f1[_0x2e38('0x20')](_0x5a6e18+'\x0a');},this[_0x2e38('0x1a')]=function(){_0x3d38f1[_0x2e38('0x21')]();};}util[_0x2e38('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x2e38('0x23')][_0x2e38('0x24')]=function(_0x297176){return this[_0x2e38('0x1f')][_0x2e38('0x25')](this,_0x297176);};AGIChannel[_0x2e38('0x23')][_0x2e38('0x26')]=function(){return this[_0x2e38('0x24')]('ANSWER');};AGIChannel[_0x2e38('0x23')][_0x2e38('0x27')]=function(_0x4b8289,_0x57c541,_0x4abd3e){_0x4b8289=_0x4b8289===undefined?'beep':_0x4b8289;_0x57c541=_0x57c541===undefined?'5':_0x57c541;_0x4abd3e=_0x4abd3e===undefined?'1':_0x4abd3e;return this[_0x2e38('0x24')](util['format'](_0x2e38('0x28'),_0x4b8289,_0x57c541*0x3e8,_0x4abd3e));};AGIChannel['prototype'][_0x2e38('0x29')]=function(_0x531feb){_0x531feb=_0x531feb||'NO\x20MESSAGE';return this['sendRequest'](util['format'](_0x2e38('0x2a'),_0x531feb));};AGIChannel[_0x2e38('0x23')]['exec']=function(_0x5abe21,_0x575243){if(_[_0x2e38('0x2b')](_0x575243)){return this[_0x2e38('0x24')](util['format'](_0x2e38('0x2c'),_0x5abe21,_0x575243['join'](',')));}return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x2c'),_0x5abe21,_0x575243));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x2e')]=function(_0xdaed2f){return this['sendRequest'](util[_0x2e38('0x2d')](_0x2e38('0x2f'),_0xdaed2f));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x30')]=function(_0xf852d2){return this[_0x2e38('0x24')](util['format'](_0x2e38('0x31'),_0xf852d2));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x32')]=function(_0x252cb3){return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x33'),_0x252cb3));};AGIChannel[_0x2e38('0x23')][_0x2e38('0xa')]=function(){return this['sendRequest'](_0x2e38('0x34'));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x35')]=function(_0xeed3e4,_0x5b090d){var _0x4f9cf7=_[_0x2e38('0x36')](_0x5b090d)||_[_0x2e38('0x37')](_0x5b090d)?_0x5b090d[_0x2e38('0x38')]():_0x5b090d;return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x39'),_0xeed3e4,_0x4f9cf7?_0x4f9cf7[_0x2e38('0x38')]()[_0x2e38('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x2e38('0x3a')]=function(_0x573050,_0x3c11b6){return this['sendRequest'](util['format'](_0x2e38('0x3b'),_0x573050,_0x3c11b6));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x3c')]=function(_0x320ce7,_0xaf06e6){return this[_0x2e38('0x24')](util[_0x2e38('0x2d')]('SAY\x20DIGITS\x20%s\x20%s',_0x320ce7,_0xaf06e6));};AGIChannel['prototype']['sayPhonetic']=function(_0x32361b,_0x30a871){return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x3d'),_0x32361b,_0x30a871));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x3e')]=function(_0x498f42,_0x24aeb3,_0x410226){_0x24aeb3=_0x24aeb3||this[_0x2e38('0x3f')];_0x410226=_0x410226||0x1;this[_0x2e38('0x2e')](_0x498f42);this['setExtension'](_0x24aeb3);this['setPriority'](_0x410226);return this['noop'](util[_0x2e38('0x2d')]('GOTO\x20%s\x20%s\x20%s',_0x498f42,_0x24aeb3,_0x410226));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x40')]=function(_0x2dd1f8){return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x41'),_0x2dd1f8));};AGIChannel[_0x2e38('0x23')]['recordFile']=function(_0x1b0187,_0x54087f,_0x251352,_0x5956e1,_0x331ffc,_0x4144e0){_0x54087f=_0x54087f||_0x2e38('0x42');_0x251352=_0x251352||'';_0x5956e1=_0x5956e1===undefined?-0x1:_0x5956e1==='-1'?-0x1:_0x5956e1*0x3e8;_0x331ffc=_0x331ffc===undefined?'':'s='+_0x331ffc;_0x4144e0=_0x4144e0?_0x2e38('0x43'):'';return this[_0x2e38('0x24')](util['format'](_0x2e38('0x44'),_0x1b0187,_0x54087f,_0x251352,_0x5956e1,_0x4144e0,_0x331ffc));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x45')]=function(_0x50abdc,_0x505a0e){_0x505a0e=_0x505a0e||'';return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x46'),_0x50abdc,_0x505a0e));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x47')]=function(_0x39f59d){return this[_0x2e38('0x48')](_0x2e38('0x49'),_0x39f59d);};AGIChannel[_0x2e38('0x23')][_0x2e38('0x4a')]=function(_0x3f4e1e){return this[_0x2e38('0x48')](_0x2e38('0x4b'),_0x3f4e1e);};AGIChannel['prototype']['error']=function(_0x5e2681,_0x53557){this[_0x2e38('0x29')](util[_0x2e38('0x2d')](_0x2e38('0x4c'),_0x5e2681['id'],_0x5e2681[_0x2e38('0x4d')],_0x53557));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2e38('0x4e')]=AGIChannel;
\ No newline at end of file
+var _0xe170=['split','length','error','E_AGI_SOCKET_ERROR','close','destroy','pipe','command','write','inherits','prototype','sync','answer','sendRequest','format','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','streamFile','exec','AGI','wait','WAIT','exports','util','lodash','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith'];(function(_0xb13a63,_0x539a89){var _0x18b8be=function(_0x1f2ef6){while(--_0x1f2ef6){_0xb13a63['push'](_0xb13a63['shift']());}};_0x18b8be(++_0x539a89);}(_0xe170,0x1b3));var _0x0e17=function(_0x184d73,_0x5869de){_0x184d73=_0x184d73-0x0;var _0x275f11=_0xe170[_0x184d73];return _0x275f11;};'use strict';var util=require(_0x0e17('0x0'));var _=require(_0x0e17('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x38ea49){var _0x8bba34=this,_0x22e4cc=new AGIReply(),_0x472070=![],_0x44c151={};EventEmitter[_0x0e17('0x2')](_0x8bba34);_0x38ea49[_0x0e17('0x3')](_0x0e17('0x4'));_0x38ea49[_0x0e17('0x5')](0x8*0x3c*0x3c*0x3e8);_0x22e4cc[_0x0e17('0x3')]('utf8');_0x22e4cc['on'](_0x0e17('0x6'),function(_0x298455){for(var _0x24b4a1 in _0x298455){_0x8bba34[_0x24b4a1]=_0x298455[_0x24b4a1];}_0x8bba34[_0x0e17('0x7')](_0x0e17('0x8'));});_0x22e4cc['on']('line',function(_0x14d164){if(_0x14d164[_0x0e17('0x9')]()==_0x0e17('0xa')){_0x8bba34[_0x0e17('0x7')](_0x0e17('0xa'));return;}if(_0x14d164[_0x0e17('0xb')](0x0,0xb)==_0x0e17('0xc')){_0x472070=!![];}if(_0x472070){_0x44c151['rx']+=_0x14d164+'\x0a';if(_0x14d164['search'](_0x0e17('0xd'))!=-0x1){_0x472070=![];}}else{_0x44c151['rx']=_0x14d164;}if(_0x472070){return;}if(typeof _0x44c151['cb']==_0x0e17('0xe')){var _0x9ef4fc=_0x44c151['rx'][_0x0e17('0xb')](0x0,0x3),_0x287217=null,_0x151355=null;_0x9ef4fc=parseInt(_0x9ef4fc);if(isNaN(_0x9ef4fc)){_0x44c151['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0e17('0xf')});return;}if(_0x9ef4fc!=0xc8){_0x44c151['cb'](null,{'code':_0x9ef4fc,'result':-0x1,'extra':'KO'});return;}_0x287217=_0x44c151['rx'][_0x0e17('0xb')](0x4)[_0x0e17('0x10')](_0x0e17('0x11'),'');if(_0x287217['indexOf']('\x20')!=-0x1){_0x287217=_0x287217['substr'](0x0,_0x287217[_0x0e17('0x12')]('\x20'));}if(_[_0x0e17('0x13')](_0x287217,'-1')){_0x287217=parseInt(_0x287217);}_0x151355=_0x44c151['rx'][_0x0e17('0x14')]('\x20');if(_0x151355[_0x0e17('0x15')]==0x3){_0x151355=_0x151355[0x2][_0x0e17('0xb')](0x1,_0x151355[0x2][_0x0e17('0x15')]-0x1);}else if(_0x151355[_0x0e17('0x15')]>0x3){var _0x16e10c=/\((.+)\)/;var _0x35083d=_0x44c151['rx']['match'](_0x16e10c);if(_0x35083d){_0x151355=_0x35083d[0x1];}else{_0x151355=null;}}else{_0x151355=null;}_0x44c151['cb'](null,{'code':_0x9ef4fc,'result':_0x287217,'extra':_0x151355});}});_0x38ea49['on'](_0x0e17('0x16'),function(_0x3c8341){_0x8bba34[_0x0e17('0x7')](_0x0e17('0x16'),new AGIError(_0x0e17('0x17'),_0x3c8341['code']));});_0x38ea49['on'](_0x0e17('0x18'),function(){_0x8bba34[_0x0e17('0x7')](_0x0e17('0x18'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x38ea49['on']('timeout',function(){_0x8bba34[_0x0e17('0x7')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x38ea49[_0x0e17('0x19')]();});_0x38ea49[_0x0e17('0x1a')](_0x22e4cc);this[_0x0e17('0x1b')]=function(_0x1bd40d,_0xe303f9){var _0x1bd40d=_0x1bd40d||'',_0xe303f9=typeof _0xe303f9==_0x0e17('0xe')?_0xe303f9:new Function();_0x44c151={'tx':_0x1bd40d,'rx':'','cb':_0xe303f9};_0x38ea49[_0x0e17('0x1c')](_0x1bd40d+'\x0a');},this[_0x0e17('0x18')]=function(){_0x38ea49[_0x0e17('0x19')]();};}util[_0x0e17('0x1d')](AGIChannel,EventEmitter);AGIChannel[_0x0e17('0x1e')]['sendRequest']=function(_0x193ab9){return this[_0x0e17('0x1b')][_0x0e17('0x1f')](this,_0x193ab9);};AGIChannel['prototype'][_0x0e17('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel['prototype']['getData']=function(_0xa1a29,_0x1f499f,_0x517277){_0xa1a29=_0xa1a29===undefined?'beep':_0xa1a29;_0x1f499f=_0x1f499f===undefined?'5':_0x1f499f;_0x517277=_0x517277===undefined?'1':_0x517277;return this[_0x0e17('0x21')](util[_0x0e17('0x22')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0xa1a29,_0x1f499f*0x3e8,_0x517277));};AGIChannel['prototype'][_0x0e17('0x23')]=function(_0x4c6b07){_0x4c6b07=_0x4c6b07||'NO\x20MESSAGE';return this[_0x0e17('0x21')](util[_0x0e17('0x22')](_0x0e17('0x24'),_0x4c6b07));};AGIChannel[_0x0e17('0x1e')]['exec']=function(_0x3b2976,_0x497a65){if(_[_0x0e17('0x25')](_0x497a65)){return this[_0x0e17('0x21')](util[_0x0e17('0x22')]('EXEC\x20%s\x20%s',_0x3b2976,_0x497a65['join'](',')));}return this[_0x0e17('0x21')](util['format'](_0x0e17('0x26'),_0x3b2976,_0x497a65));};AGIChannel['prototype'][_0x0e17('0x27')]=function(_0x405801){return this['sendRequest'](util['format'](_0x0e17('0x28'),_0x405801));};AGIChannel[_0x0e17('0x1e')][_0x0e17('0x29')]=function(_0xdf5b07){return this[_0x0e17('0x21')](util[_0x0e17('0x22')]('SET\x20EXTENSION\x20%s',_0xdf5b07));};AGIChannel['prototype'][_0x0e17('0x2a')]=function(_0x5bf19b){return this['sendRequest'](util[_0x0e17('0x22')](_0x0e17('0x2b'),_0x5bf19b));};AGIChannel['prototype'][_0x0e17('0xa')]=function(){return this[_0x0e17('0x21')](_0x0e17('0x2c'));};AGIChannel['prototype']['setVariable']=function(_0x2a1f1d,_0x1e63d2){var _0x3811ca=_[_0x0e17('0x2d')](_0x1e63d2)||_[_0x0e17('0x2e')](_0x1e63d2)?_0x1e63d2['toString']():_0x1e63d2;return this[_0x0e17('0x21')](util[_0x0e17('0x22')](_0x0e17('0x2f'),_0x2a1f1d,_0x3811ca?_0x3811ca[_0x0e17('0x30')]()[_0x0e17('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x4f0b49,_0x56e9ab){return this[_0x0e17('0x21')](util[_0x0e17('0x22')](_0x0e17('0x31'),_0x4f0b49,_0x56e9ab));};AGIChannel[_0x0e17('0x1e')][_0x0e17('0x32')]=function(_0x1aecdf,_0x14bbbc){return this[_0x0e17('0x21')](util[_0x0e17('0x22')](_0x0e17('0x33'),_0x1aecdf,_0x14bbbc));};AGIChannel['prototype'][_0x0e17('0x34')]=function(_0x3d72a0,_0x534b38){return this[_0x0e17('0x21')](util[_0x0e17('0x22')](_0x0e17('0x35'),_0x3d72a0,_0x534b38));};AGIChannel[_0x0e17('0x1e')][_0x0e17('0x36')]=function(_0x31c8de,_0x364a27,_0x2885c4){_0x364a27=_0x364a27||this['extension'];_0x2885c4=_0x2885c4||0x1;this[_0x0e17('0x27')](_0x31c8de);this[_0x0e17('0x29')](_0x364a27);this[_0x0e17('0x2a')](_0x2885c4);return this[_0x0e17('0x23')](util[_0x0e17('0x22')](_0x0e17('0x37'),_0x31c8de,_0x364a27,_0x2885c4));};AGIChannel['prototype']['getVariable']=function(_0x48e918){return this[_0x0e17('0x21')](util[_0x0e17('0x22')](_0x0e17('0x38'),_0x48e918));};AGIChannel['prototype'][_0x0e17('0x39')]=function(_0x117ee5,_0x22a8bf,_0x371a99,_0x55282a,_0x56ec2f,_0x19f883){_0x22a8bf=_0x22a8bf||_0x0e17('0x3a');_0x371a99=_0x371a99||'';_0x55282a=_0x55282a===undefined?-0x1:_0x55282a==='-1'?-0x1:_0x55282a*0x3e8;_0x56ec2f=_0x56ec2f===undefined?'':'s='+_0x56ec2f;_0x19f883=_0x19f883?'BEEP':'';return this[_0x0e17('0x21')](util[_0x0e17('0x22')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x117ee5,_0x22a8bf,_0x371a99,_0x55282a,_0x19f883,_0x56ec2f));};AGIChannel[_0x0e17('0x1e')][_0x0e17('0x3b')]=function(_0x222615,_0x5380d9){_0x5380d9=_0x5380d9||'';return this[_0x0e17('0x21')](util[_0x0e17('0x22')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x222615,_0x5380d9));};AGIChannel[_0x0e17('0x1e')]['agi']=function(_0x4f4a41){return this[_0x0e17('0x3c')](_0x0e17('0x3d'),_0x4f4a41);};AGIChannel[_0x0e17('0x1e')][_0x0e17('0x3e')]=function(_0x4eeb2f){return this[_0x0e17('0x3c')](_0x0e17('0x3f'),_0x4eeb2f);};AGIChannel[_0x0e17('0x1e')][_0x0e17('0x16')]=function(_0x4f1aec,_0x16b6aa){this[_0x0e17('0x23')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x4f1aec['id'],_0x4f1aec['label'],_0x16b6aa));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0e17('0x40')]=AGIChannel;
\ No newline at end of file
index f42bec7..68c3564 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03f2=['push','format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x4f45f2,_0x4ab5ba){var _0x161d9a=function(_0x56ecb4){while(--_0x56ecb4){_0x4f45f2['push'](_0x4f45f2['shift']());}};_0x161d9a(++_0x4ab5ba);}(_0x03f2,0xd1));var _0x203f=function(_0x3be87c,_0x4c2a94){_0x3be87c=_0x3be87c-0x0;var _0x45d41e=_0x03f2[_0x3be87c];return _0x45d41e;};'use strict';var util=require(_0x203f('0x0'));var error={'E_AGI_UNDEFINED':_0x203f('0x1'),'E_AGI_ARGUMENT_PORT':_0x203f('0x2'),'E_AGI_SERVER_ERROR':_0x203f('0x3'),'E_AGI_SERVER_CLOSE':_0x203f('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x203f('0x5'),'E_AGI_SOCKET_ERROR':_0x203f('0x6'),'E_AGI_SOCKET_CLOSE':_0x203f('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x203f('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x203f('0x9'),'E_AGI_IVR_ENTRY':_0x203f('0xa')};function AGIError(_0x38b314){var _0x38b314=_0x38b314||null,_0x47c611=_0x47c611||[],_0xbf8a5e=0x1,_0x4a102a='';if(!error[_0x38b314]){_0x38b314=_0x203f('0xb');}_0x47c611[_0x203f('0xc')](error[_0x38b314]);while(arguments[_0xbf8a5e]){_0x47c611[_0x203f('0xc')](arguments[_0xbf8a5e]);_0xbf8a5e++;}_0x4a102a=util[_0x203f('0xd')][_0x203f('0xe')](util,_0x47c611);this[_0x203f('0xf')]=_0x4a102a;this[_0x203f('0x10')]=_0x38b314;}module['exports']=AGIError;
\ No newline at end of file
+var _0x5ce0=['message','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\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','apply'];(function(_0x60bfe0,_0x5525e4){var _0x3d2e1f=function(_0x5bc176){while(--_0x5bc176){_0x60bfe0['push'](_0x60bfe0['shift']());}};_0x3d2e1f(++_0x5525e4);}(_0x5ce0,0x1c3));var _0x05ce=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0x5ce0[_0x2f0057];return _0x17f2c3;};'use strict';var util=require(_0x05ce('0x0'));var error={'E_AGI_UNDEFINED':_0x05ce('0x1'),'E_AGI_ARGUMENT_PORT':_0x05ce('0x2'),'E_AGI_SERVER_ERROR':_0x05ce('0x3'),'E_AGI_SERVER_CLOSE':_0x05ce('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x05ce('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x05ce('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x05ce('0x7'),'E_AGI_COMMAND_EMPTY':_0x05ce('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x05ce('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3744ab){var _0x3744ab=_0x3744ab||null,_0x4dfab4=_0x4dfab4||[],_0x3e06d5=0x1,_0x35ad49='';if(!error[_0x3744ab]){_0x3744ab=_0x05ce('0xa');}_0x4dfab4[_0x05ce('0xb')](error[_0x3744ab]);while(arguments[_0x3e06d5]){_0x4dfab4[_0x05ce('0xb')](arguments[_0x3e06d5]);_0x3e06d5++;}_0x35ad49=util['format'][_0x05ce('0xc')](util,_0x4dfab4);this[_0x05ce('0xd')]=_0x35ad49;this[_0x05ce('0xe')]=_0x3744ab;}module[_0x05ce('0xf')]=AGIError;
\ No newline at end of file
index 7e36f90..b6700cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd17c=['vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size','relations','info','no\x20vertex\x20found','length','condition','split','agicommand','vswitch','default','target','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu'];(function(_0xa3ccfc,_0x1748e7){var _0x5f20f6=function(_0x4dcc94){while(--_0x4dcc94){_0xa3ccfc['push'](_0xa3ccfc['shift']());}};_0x5f20f6(++_0x1748e7);}(_0xd17c,0x1c7));var _0xcd17=function(_0x1a0ada,_0x402e48){_0x1a0ada=_0x1a0ada-0x0;var _0x150f84=_0xd17c[_0x1a0ada];return _0x150f84;};'use strict';var _=require(_0xcd17('0x0'));var logger=require(_0xcd17('0x1'))(_0xcd17('0x2'));var verticesWithRetry=[_0xcd17('0x3'),'getdigits','getsecretdigits'];var Graph=function(){this[_0xcd17('0x4')]={};this[_0xcd17('0x5')]={};this[_0xcd17('0x6')]=0x0;};Graph[_0xcd17('0x7')][_0xcd17('0x8')]=function(_0x52acde){this[_0xcd17('0x4')][_0x52acde['id']]=_0x52acde;this[_0xcd17('0x5')][_0x52acde['id']]=[];};Graph[_0xcd17('0x7')][_0xcd17('0x9')]=function(_0x5ac1f6,_0x539cfa,_0x5d1853){this[_0xcd17('0x5')][_0x5ac1f6]['push']({'target':_0x539cfa,'condition':_0x5d1853});this[_0xcd17('0x6')]+=0x1;};Graph[_0xcd17('0x7')][_0xcd17('0xa')]=function(){return _[_0xcd17('0xa')](this[_0xcd17('0x4')]);};Graph[_0xcd17('0x7')][_0xcd17('0xb')]=function(){return this['numberOfEdges'];};Graph['prototype']['getVertex']=function(_0x429e5f){return this[_0xcd17('0x4')][_0x429e5f];};Graph['prototype']['traverseBFS']=function(_0xd47672,_0x38bbed){if(!this[_0xcd17('0x4')][_0xd47672]){return logger[_0xcd17('0xc')](_0xcd17('0xd'));}var _0x483477=_0x38bbed(this['vertices'][_0xd47672]);if(!_0x483477){return logger[_0xcd17('0xc')]('stop\x20traverse');}if(this['edges'][_0xd47672][_0xcd17('0xe')]===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x18c19e=0x0,_0x11cc6d=[],_0x581b2d=![];_0x18c19e<this[_0xcd17('0x5')][_0xd47672][_0xcd17('0xe')];_0x18c19e+=0x1){if(this['edges'][_0xd47672][_0x18c19e]['condition']){_0x11cc6d=this['edges'][_0xd47672][_0x18c19e][_0xcd17('0xf')][_0xcd17('0x10')](',');for(var _0xfd15e1=0x0;_0xfd15e1<_0x11cc6d[_0xcd17('0xe')];_0xfd15e1+=0x1){if(this[_0xcd17('0x4')][_0xd47672][_0xcd17('0x11')]===_0xcd17('0x12')&&_0x11cc6d[_0xfd15e1]==='-'){_0x581b2d=this['edges'][_0xd47672][_0x18c19e]['target'];logger[_0xcd17('0xc')](_0xcd17('0x13'),_0x11cc6d[_0xfd15e1],this['edges'][_0xd47672][_0x18c19e][_0xcd17('0x14')]);}else if(this['vertices'][_0xd47672][_0xcd17('0x11')]===_0xcd17('0x3')&&_0x11cc6d[_0xfd15e1]==='i'){_0x581b2d=this[_0xcd17('0x5')][_0xd47672][_0x18c19e][_0xcd17('0x14')];logger[_0xcd17('0xc')]('invalid',_0x11cc6d[_0xfd15e1],this[_0xcd17('0x5')][_0xd47672][_0x18c19e][_0xcd17('0x14')]);}if(_0x11cc6d[_0xfd15e1]===_0x483477){return this[_0xcd17('0x15')](this[_0xcd17('0x5')][_0xd47672][_0x18c19e][_0xcd17('0x14')],_0x38bbed);}}}else{return this['traverseBFS'](this['edges'][_0xd47672][_0x18c19e][_0xcd17('0x14')],_0x38bbed);}}if(_0x11cc6d[_0xcd17('0xe')]){if(this[_0xcd17('0x4')][_0xd47672][_0xcd17('0x11')]===_0xcd17('0x12')){if(_0x581b2d){return this[_0xcd17('0x15')](_0x581b2d,_0x38bbed);}return logger[_0xcd17('0xc')](_0xcd17('0x16'));}else if(_[_0xcd17('0x17')](verticesWithRetry,this[_0xcd17('0x4')][_0xd47672]['agicommand'])){if(_0x483477==='-'){return logger[_0xcd17('0xc')](_0xcd17('0x18'));}if(_0x581b2d&&_0x483477!=='t'){return this[_0xcd17('0x15')](_0x581b2d,_0x38bbed);}return this[_0xcd17('0x15')](_0xd47672,_0x38bbed);}return logger[_0xcd17('0xc')](_0xcd17('0x19'));}};module[_0xcd17('0x1a')]=Graph;
\ No newline at end of file
+var _0xb974=['default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','getsecretdigits','numberOfEdges','prototype','addVertex','vertices','edges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','vswitch','target','menu','invalid'];(function(_0x9f57ca,_0xede913){var _0x171560=function(_0x5e696c){while(--_0x5e696c){_0x9f57ca['push'](_0x9f57ca['shift']());}};_0x171560(++_0xede913);}(_0xb974,0xb3));var _0x4b97=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb974[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4b97('0x0'));var logger=require(_0x4b97('0x1'))('agi');var verticesWithRetry=['menu','getdigits',_0x4b97('0x2')];var Graph=function(){this['vertices']={};this['edges']={};this[_0x4b97('0x3')]=0x0;};Graph[_0x4b97('0x4')][_0x4b97('0x5')]=function(_0x5d14d7){this[_0x4b97('0x6')][_0x5d14d7['id']]=_0x5d14d7;this['edges'][_0x5d14d7['id']]=[];};Graph[_0x4b97('0x4')]['addEdge']=function(_0x4068e7,_0x2933cd,_0x3d9f3d){this[_0x4b97('0x7')][_0x4068e7]['push']({'target':_0x2933cd,'condition':_0x3d9f3d});this[_0x4b97('0x3')]+=0x1;};Graph[_0x4b97('0x4')]['size']=function(){return _[_0x4b97('0x8')](this['vertices']);};Graph[_0x4b97('0x4')][_0x4b97('0x9')]=function(){return this['numberOfEdges'];};Graph[_0x4b97('0x4')][_0x4b97('0xa')]=function(_0x5172b0){return this[_0x4b97('0x6')][_0x5172b0];};Graph[_0x4b97('0x4')][_0x4b97('0xb')]=function(_0x588423,_0x56924c){if(!this[_0x4b97('0x6')][_0x588423]){return logger[_0x4b97('0xc')](_0x4b97('0xd'));}var _0x114146=_0x56924c(this[_0x4b97('0x6')][_0x588423]);if(!_0x114146){return logger[_0x4b97('0xc')](_0x4b97('0xe'));}if(this[_0x4b97('0x7')][_0x588423]['length']===0x0){return logger[_0x4b97('0xc')](_0x4b97('0xf'));}for(var _0x104e78=0x0,_0x1837c5=[],_0x95f54=![];_0x104e78<this[_0x4b97('0x7')][_0x588423][_0x4b97('0x10')];_0x104e78+=0x1){if(this[_0x4b97('0x7')][_0x588423][_0x104e78]['condition']){_0x1837c5=this[_0x4b97('0x7')][_0x588423][_0x104e78][_0x4b97('0x11')][_0x4b97('0x12')](',');for(var _0x3e8b92=0x0;_0x3e8b92<_0x1837c5[_0x4b97('0x10')];_0x3e8b92+=0x1){if(this[_0x4b97('0x6')][_0x588423][_0x4b97('0x13')]===_0x4b97('0x14')&&_0x1837c5[_0x3e8b92]==='-'){_0x95f54=this['edges'][_0x588423][_0x104e78][_0x4b97('0x15')];logger['info']('default',_0x1837c5[_0x3e8b92],this['edges'][_0x588423][_0x104e78]['target']);}else if(this[_0x4b97('0x6')][_0x588423][_0x4b97('0x13')]===_0x4b97('0x16')&&_0x1837c5[_0x3e8b92]==='i'){_0x95f54=this['edges'][_0x588423][_0x104e78]['target'];logger[_0x4b97('0xc')](_0x4b97('0x17'),_0x1837c5[_0x3e8b92],this['edges'][_0x588423][_0x104e78]['target']);}if(_0x1837c5[_0x3e8b92]===_0x114146){return this['traverseBFS'](this['edges'][_0x588423][_0x104e78]['target'],_0x56924c);}}}else{return this[_0x4b97('0xb')](this['edges'][_0x588423][_0x104e78]['target'],_0x56924c);}}if(_0x1837c5[_0x4b97('0x10')]){if(this[_0x4b97('0x6')][_0x588423][_0x4b97('0x13')]===_0x4b97('0x14')){if(_0x95f54){return this['traverseBFS'](_0x95f54,_0x56924c);}return logger['info'](_0x4b97('0x18'));}else if(_[_0x4b97('0x19')](verticesWithRetry,this[_0x4b97('0x6')][_0x588423]['agicommand'])){if(_0x114146==='-'){return logger['info'](_0x4b97('0x1a'));}if(_0x95f54&&_0x114146!=='t'){return this[_0x4b97('0xb')](_0x95f54,_0x56924c);}return this[_0x4b97('0xb')](_0x588423,_0x56924c);}return logger[_0x4b97('0xc')](_0x4b97('0x1b'));}};module[_0x4b97('0x1c')]=Graph;
\ No newline at end of file
index 16a2910..81120dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c9a=['../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','format','[%s]\x20%s','message','[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','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','target','addEdge','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','production','start','stringify','joinAt','[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\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','finally','isUndefined','toString','[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','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','util','moment','../../config/environment'];(function(_0x57b0db,_0x1df1e5){var _0x135d7b=function(_0x2beda3){while(--_0x2beda3){_0x57b0db['push'](_0x57b0db['shift']());}};_0x135d7b(++_0x1df1e5);}(_0x1c9a,0x1c3));var _0xa1c9=function(_0xbbc473,_0x21f2e4){_0xbbc473=_0xbbc473-0x0;var _0x25a126=_0x1c9a[_0xbbc473];return _0x25a126;};'use strict';var parser=require(_0xa1c9('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0xa1c9('0x1'));var moment=require(_0xa1c9('0x2'));var config=require(_0xa1c9('0x3'));var logger=require(_0xa1c9('0x4'))(_0xa1c9('0x5'));var utilLicense=require(_0xa1c9('0x6'));var rpc=require(_0xa1c9('0x7'));var mailRpc=require(_0xa1c9('0x8'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xa1c9('0x5')]=_[_0xa1c9('0x9')](config[_0xa1c9('0x5')],{'ip':_0xa1c9('0xa'),'port':0x11dd});function connectionHandler(_0x1f9d68){process[_0xa1c9('0xb')](function(){syncho(function(){try{setChannelVariables(_0x1f9d68);agiHandler(_0x1f9d68);}catch(_0x353ece){logger[_0xa1c9('0xc')](_0x353ece[_0xa1c9('0xd')]);}});});}function listeningHandler(){console[_0xa1c9('0xe')](_0xa1c9('0xf'),config[_0xa1c9('0x5')][_0xa1c9('0x10')]);logger[_0xa1c9('0x11')](util['format'](_0xa1c9('0x12'),config[_0xa1c9('0x5')]['ip'],config['agi'][_0xa1c9('0x10')]));}function errorHandler(_0x3f6398){if(_0x3f6398&&_0x3f6398[_0xa1c9('0x13')]&&_0x3f6398['message']){logger[_0xa1c9('0xc')](util[_0xa1c9('0x14')](_0xa1c9('0x15'),_0x3f6398[_0xa1c9('0x13')],_0x3f6398[_0xa1c9('0x16')]));}else{logger[_0xa1c9('0xc')](util[_0xa1c9('0x14')](_0xa1c9('0x17'),_0x3f6398['stack']));}}function closeHandler(){logger[_0xa1c9('0x11')](util['format'](_0xa1c9('0x18'),this[_0xa1c9('0x19')],this[_0xa1c9('0x1a')],this[_0xa1c9('0x1b')],this['dnid'],this[_0xa1c9('0x1c')]));try{createSquareReport(this);}catch(_0xc3af65){logger[_0xa1c9('0xc')](_0xc3af65[_0xa1c9('0xd')]);}}function timeoutHandler(){logger[_0xa1c9('0x11')](util[_0xa1c9('0x14')](_0xa1c9('0x1d'),this['arg_1'],this[_0xa1c9('0x1a')],this[_0xa1c9('0x1b')],this[_0xa1c9('0x1e')],this[_0xa1c9('0x1c')]));}function hangupHandler(){logger['info'](util[_0xa1c9('0x14')](_0xa1c9('0x1f'),this[_0xa1c9('0x19')],this[_0xa1c9('0x1a')],this['callerid'],this['dnid'],this['uniqueid']));this[_0xa1c9('0x20')]=!![];}function getRoot(_0x34adbe){return parser[_0xa1c9('0x21')](_0x34adbe,{'object':!![]})['mxGraphModel'][_0xa1c9('0x22')];}function addVertex(_0x2da024,_0x129e5d,_0x5bf648){_0x129e5d[_0xa1c9('0x23')]=_0x5bf648;if(_0x129e5d[_0xa1c9('0x24')]('retry')){_0x129e5d[_0xa1c9('0x25')]=parseInt(_0x129e5d[_0xa1c9('0x26')],0xa);}_0x2da024[_0xa1c9('0x27')](_[_0xa1c9('0x28')](_0x129e5d,_0xa1c9('0x29')));}function initGraph(_0x5e9ef6,_0x482524){var _0x464eca=new Graph();for(var _0x3fa2dd in _0x5e9ef6){if(_0x5e9ef6[_0xa1c9('0x24')](_0x3fa2dd)){if(_[_0xa1c9('0x2a')](_0x5e9ef6[_0x3fa2dd])){for(var _0x16fba6=0x0;_0x16fba6<_0x5e9ef6[_0x3fa2dd][_0xa1c9('0x2b')];_0x16fba6+=0x1){addVertex(_0x464eca,_0x5e9ef6[_0x3fa2dd][_0x16fba6],_0x3fa2dd);}}else{addVertex(_0x464eca,_0x5e9ef6[_0x3fa2dd],_0x3fa2dd);}}}for(var _0x2150ac=0x0;_0x2150ac<_0x482524[_0xa1c9('0x2b')];_0x2150ac+=0x1){if(_0x482524[_0x2150ac]['source']&&_0x482524[_0x2150ac][_0xa1c9('0x2c')]){_0x464eca[_0xa1c9('0x2d')](_0x482524[_0x2150ac]['source'],_0x482524[_0x2150ac][_0xa1c9('0x2c')],_0x482524[_0x2150ac][_0xa1c9('0x2e')]);}}return _0x464eca;}function getSquareProject(_0x471911,_0x20769d){rpc[_0xa1c9('0x2f')](_0x471911)[_0xa1c9('0x30')](function(_0x44539c){_0x20769d(null,_0x44539c);})['catch'](function(_0x3eb9a5){_0x20769d(null,_0x3eb9a5);});}function createSquareReport(_0x103440,_0x9f7036){rpc[_0xa1c9('0x31')](_0x103440)[_0xa1c9('0x30')](function(_0x178e5b){if(_0x9f7036){_0x9f7036(null,_0x178e5b);}})[_0xa1c9('0x32')](function(_0x1a2547){if(_0x9f7036){_0x9f7036(null,_0x1a2547);}});}function setChannelVariables(_0x1a853d){for(var _0x50f00c in _0x1a853d){if(_0x1a853d[_0xa1c9('0x24')](_0x50f00c)){if(_0x50f00c[_0xa1c9('0x33')](_0xa1c9('0x34'))===0x0){_0x1a853d[_0x50f00c[_0xa1c9('0x35')](0x4)]=_0x1a853d[_0x50f00c];delete _0x1a853d[_0x50f00c];}}}}function getLogFromObject(_0x2edb45){return util[_0xa1c9('0x36')](_0x2edb45,{'showHidden':![],'depth':null});}function agiHandler(_0x3466b6){var _0x51a0f2,_0x761c20,_0x5cb668,_0x4b1412,_0x592eeb;logger[_0xa1c9('0x37')]('variables',JSON['stringify'](_0x3466b6,null,0x2));logger[_0xa1c9('0x11')](util[_0xa1c9('0x14')](_0xa1c9('0x38'),_0x3466b6['arg_1'],_0x3466b6[_0xa1c9('0x1a')],_0x3466b6[_0xa1c9('0x1b')],_0x3466b6[_0xa1c9('0x1e')],_0x3466b6[_0xa1c9('0x1c')]));_0x3466b6['on'](_0xa1c9('0xc'),errorHandler);_0x3466b6['on'](_0xa1c9('0x39'),closeHandler);_0x3466b6['on'](_0xa1c9('0x3a'),timeoutHandler);_0x3466b6[_0xa1c9('0x20')]=![];_0x3466b6['on']('hangup',hangupHandler);var _0x50dd04=getSquareProject['sync'](null,_0x3466b6[_0xa1c9('0x19')]);if(_0x50dd04){if(_0x50dd04[_0xa1c9('0x3b')]){_0x51a0f2=getRoot(_0x50dd04['production']);if(_0x51a0f2&&_0x51a0f2[_0xa1c9('0x3c')]){logger['debug']('root',JSON[_0xa1c9('0x3d')](_0x51a0f2,null,0x2));_0x3466b6[_0xa1c9('0x3e')]=moment()[_0xa1c9('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x761c20=initGraph(_['omit'](_0x51a0f2,_0xa1c9('0x29')),_0x51a0f2['mxCell']);_0x5cb668=new Vertices(_0x3466b6,rpc,mailRpc);logger[_0xa1c9('0x11')](util['format'](_0xa1c9('0x3f'),_0x3466b6[_0xa1c9('0x19')],_0x3466b6[_0xa1c9('0x1a')],_0x3466b6[_0xa1c9('0x1b')],_0x3466b6[_0xa1c9('0x1e')],_0x3466b6[_0xa1c9('0x1c')]));_0x761c20['traverseBFS'](_0x51a0f2['start']['id'],function(_0x4ef757){try{_0x4ef757=_0x5cb668[_0xa1c9('0x40')](_0x4ef757);logger[_0xa1c9('0x37')](_0xa1c9('0x41'),JSON[_0xa1c9('0x3d')](_0x4ef757,null,0x2));if(_0x4ef757[_0xa1c9('0x23')]===_0xa1c9('0x42')){logger[_0xa1c9('0x11')](_0xa1c9('0x43'));_0x3466b6[_0xa1c9('0x44')]=_0x4ef757[_0xa1c9('0x44')]||_0x3466b6['context'];_0x3466b6[_0xa1c9('0x45')]=_0x4ef757['extension'];_0x3466b6[_0xa1c9('0x46')]=_0x4ef757['priority']?_0x4ef757[_0xa1c9('0x46')]-0x1:0x1;return null;}else if(_0x4ef757&&_0x5cb668[_0x4ef757[_0xa1c9('0x23')]]){_0x592eeb=_0x5cb668[_0x4ef757[_0xa1c9('0x23')]](_0x4ef757);logger[_0xa1c9('0x11')](_0xa1c9('0x47'),JSON[_0xa1c9('0x3d')](_0x592eeb,null,0x2));if(_0x592eeb&&_0x592eeb[_0xa1c9('0x48')]===AGI_CODE_SUCCESS&&_0x592eeb[_0xa1c9('0x49')]!==AGI_RESULT_ERROR&&!_0x3466b6[_0xa1c9('0x20')]){logger[_0xa1c9('0x37')]('response',getLogFromObject(_0x592eeb));return _['isUndefined'](_0x592eeb[_0xa1c9('0x49')])?null:_0x592eeb[_0xa1c9('0x49')]['toString']();}else{logger['error']('response',getLogFromObject(_0x592eeb));return null;}}else{logger[_0xa1c9('0xc')](_0xa1c9('0x4a'));return null;}}catch(_0x555a8f){logger['error'](_0x555a8f['stack']);return null;}});if(_0x51a0f2['finally']){logger[_0xa1c9('0x11')](util['format'](_0xa1c9('0x4b'),_0x3466b6['arg_1'],_0x3466b6['calleridname'],_0x3466b6[_0xa1c9('0x1b')],_0x3466b6[_0xa1c9('0x1e')],_0x3466b6[_0xa1c9('0x1c')]));_0x761c20[_0xa1c9('0x4c')](_0x51a0f2[_0xa1c9('0x4d')]['id'],function(_0x2d2d4b){try{_0x2d2d4b=_0x5cb668[_0xa1c9('0x40')](_0x2d2d4b);logger[_0xa1c9('0x37')](_0xa1c9('0x41'),JSON[_0xa1c9('0x3d')](_0x2d2d4b,null,0x2));if(_0x2d2d4b&&_0x5cb668[_0x2d2d4b['agicommand']]){_0x592eeb=_0x5cb668[_0x2d2d4b[_0xa1c9('0x23')]](_0x2d2d4b);if(_0x592eeb){logger[_0xa1c9('0x37')](_0xa1c9('0x47'),getLogFromObject(_0x592eeb));return _[_0xa1c9('0x4e')](_0x592eeb[_0xa1c9('0x49')])?null:_0x592eeb[_0xa1c9('0x49')][_0xa1c9('0x4f')]();}else{logger[_0xa1c9('0xc')]('response',getLogFromObject(_0x592eeb));return null;}}else{logger['error'](_0xa1c9('0x4a'));return null;}}catch(_0x185e39){logger[_0xa1c9('0xc')](_0x185e39[_0xa1c9('0xd')]);return null;}});}logger[_0xa1c9('0x11')](util[_0xa1c9('0x14')](_0xa1c9('0x50'),_0x3466b6['arg_1'],_0x3466b6[_0xa1c9('0x1a')],_0x3466b6['callerid'],_0x3466b6['dnid'],_0x3466b6[_0xa1c9('0x1c')]));logger['info'](util[_0xa1c9('0x14')](_0xa1c9('0x51'),_0x3466b6[_0xa1c9('0x44')],_0x3466b6[_0xa1c9('0x45')],parseInt(_0x3466b6[_0xa1c9('0x46')],0xa)+0x1));_0x3466b6[_0xa1c9('0x52')](_0x3466b6[_0xa1c9('0x44')],_0x3466b6['extension'],parseInt(_0x3466b6['priority'],0xa)+0x1);_0x3466b6['close']();}}else{logger[_0xa1c9('0xc')](util[_0xa1c9('0x14')]('Project\x20%s\x20not\x20published',_0x3466b6[_0xa1c9('0x19')]));_0x3466b6['continueAt'](_0x3466b6[_0xa1c9('0x44')],_0x3466b6[_0xa1c9('0x45')],parseInt(_0x3466b6[_0xa1c9('0x46')],0xa)+0x1);_0x3466b6['close']();}}else{logger[_0xa1c9('0xc')](util[_0xa1c9('0x14')](_0xa1c9('0x53'),_0x3466b6['arg_1']));_0x3466b6[_0xa1c9('0x52')](_0x3466b6[_0xa1c9('0x44')],_0x3466b6[_0xa1c9('0x45')],parseInt(_0x3466b6[_0xa1c9('0x46')],0xa)+0x1);_0x3466b6[_0xa1c9('0x39')]();}}function main(){var _0x582e60;return utilLicense['getLicense']()[_0xa1c9('0x30')](function(_0x22ed99){if(_0x22ed99){if(_0x22ed99[_0xa1c9('0x54')]){if(_0x22ed99['callysquare']&&_0x22ed99['callysquare']>0x0){logger[_0xa1c9('0x11')](util[_0xa1c9('0x14')](_0xa1c9('0x55'),_0x22ed99['callysquare']));_0x582e60=_0x22ed99[_0xa1c9('0x56')];}else{logger[_0xa1c9('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0xa1c9('0x57'));_0x582e60=-0x1;}}})[_0xa1c9('0x32')](function(_0x247a60){logger[_0xa1c9('0xc')](_0xa1c9('0x58'),_0x247a60[_0xa1c9('0xd')]);})['finally'](function(){var _0x475ed6=require(_0xa1c9('0x59'))(config[_0xa1c9('0x5')][_0xa1c9('0x10')],config[_0xa1c9('0x5')]['ip'],_0x582e60);_0x475ed6['on']('error',errorHandler);_0x475ed6['on']('listening',listeningHandler);_0x475ed6['on'](_0xa1c9('0x5a'),connectionHandler);_0x475ed6['on'](_0xa1c9('0x39'),closeHandler);});}main();
\ No newline at end of file
+var _0x9acd=['sync','production','start','root','joinAt','mxCell','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand','response','code','result','isUndefined','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','finally','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','127.0.0.1','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','evtHangup','toJson','mxGraphModel','hasOwnProperty','retry','addVertex','isArray','length','source','addEdge','target','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x9acd,0x170));var _0xd9ac=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9acd[_0x618414];return _0x21c19a;};'use strict';var parser=require(_0xd9ac('0x0'));var _=require('lodash');var syncho=require(_0xd9ac('0x1'));var util=require(_0xd9ac('0x2'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0xd9ac('0x3'))(_0xd9ac('0x4'));var utilLicense=require(_0xd9ac('0x5'));var rpc=require(_0xd9ac('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0xd9ac('0x7'));var Vertices=require(_0xd9ac('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xd9ac('0x4')]=_['defaults'](config[_0xd9ac('0x4')],{'ip':_0xd9ac('0x9'),'port':0x11dd});function connectionHandler(_0x1177c4){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1177c4);agiHandler(_0x1177c4);}catch(_0x384cdc){logger[_0xd9ac('0xa')](_0x384cdc['stack']);}});});}function listeningHandler(){console[_0xd9ac('0xb')](_0xd9ac('0xc'),config['agi'][_0xd9ac('0xd')]);logger[_0xd9ac('0xe')](util[_0xd9ac('0xf')](_0xd9ac('0x10'),config['agi']['ip'],config[_0xd9ac('0x4')][_0xd9ac('0xd')]));}function errorHandler(_0x508f34){if(_0x508f34&&_0x508f34['name']&&_0x508f34[_0xd9ac('0x11')]){logger[_0xd9ac('0xa')](util[_0xd9ac('0xf')](_0xd9ac('0x12'),_0x508f34[_0xd9ac('0x13')],_0x508f34[_0xd9ac('0x11')]));}else{logger[_0xd9ac('0xa')](util['format']('[ERROR]\x20%s',_0x508f34[_0xd9ac('0x14')]));}}function closeHandler(){logger[_0xd9ac('0xe')](util[_0xd9ac('0xf')](_0xd9ac('0x15'),this[_0xd9ac('0x16')],this[_0xd9ac('0x17')],this[_0xd9ac('0x18')],this[_0xd9ac('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2c06db){logger[_0xd9ac('0xa')](_0x2c06db[_0xd9ac('0x14')]);}}function timeoutHandler(){logger[_0xd9ac('0xe')](util[_0xd9ac('0xf')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xd9ac('0x16')],this[_0xd9ac('0x17')],this[_0xd9ac('0x18')],this['dnid'],this[_0xd9ac('0x1a')]));}function hangupHandler(){logger[_0xd9ac('0xe')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xd9ac('0x16')],this[_0xd9ac('0x17')],this[_0xd9ac('0x18')],this[_0xd9ac('0x19')],this['uniqueid']));this[_0xd9ac('0x1b')]=!![];}function getRoot(_0x1ac194){return parser[_0xd9ac('0x1c')](_0x1ac194,{'object':!![]})[_0xd9ac('0x1d')]['root'];}function addVertex(_0xfe8637,_0x104d0e,_0x1b834b){_0x104d0e['agicommand']=_0x1b834b;if(_0x104d0e[_0xd9ac('0x1e')](_0xd9ac('0x1f'))){_0x104d0e['maxRetry']=parseInt(_0x104d0e['retry'],0xa);}_0xfe8637[_0xd9ac('0x20')](_['omit'](_0x104d0e,'mxCell'));}function initGraph(_0x3f6997,_0x1c6eac){var _0x509411=new Graph();for(var _0xbc3d4d in _0x3f6997){if(_0x3f6997[_0xd9ac('0x1e')](_0xbc3d4d)){if(_[_0xd9ac('0x21')](_0x3f6997[_0xbc3d4d])){for(var _0x36993c=0x0;_0x36993c<_0x3f6997[_0xbc3d4d][_0xd9ac('0x22')];_0x36993c+=0x1){addVertex(_0x509411,_0x3f6997[_0xbc3d4d][_0x36993c],_0xbc3d4d);}}else{addVertex(_0x509411,_0x3f6997[_0xbc3d4d],_0xbc3d4d);}}}for(var _0x25ab97=0x0;_0x25ab97<_0x1c6eac[_0xd9ac('0x22')];_0x25ab97+=0x1){if(_0x1c6eac[_0x25ab97][_0xd9ac('0x23')]&&_0x1c6eac[_0x25ab97]['target']){_0x509411[_0xd9ac('0x24')](_0x1c6eac[_0x25ab97]['source'],_0x1c6eac[_0x25ab97][_0xd9ac('0x25')],_0x1c6eac[_0x25ab97][_0xd9ac('0x26')]);}}return _0x509411;}function getSquareProject(_0x346c83,_0x366fc2){rpc[_0xd9ac('0x27')](_0x346c83)[_0xd9ac('0x28')](function(_0x58bc74){_0x366fc2(null,_0x58bc74);})[_0xd9ac('0x29')](function(_0xeecc18){_0x366fc2(null,_0xeecc18);});}function createSquareReport(_0x2b2feb,_0x4a16b6){rpc[_0xd9ac('0x2a')](_0x2b2feb)[_0xd9ac('0x28')](function(_0x135211){if(_0x4a16b6){_0x4a16b6(null,_0x135211);}})[_0xd9ac('0x29')](function(_0x185984){if(_0x4a16b6){_0x4a16b6(null,_0x185984);}});}function setChannelVariables(_0x36cb79){for(var _0x5b9c8d in _0x36cb79){if(_0x36cb79[_0xd9ac('0x1e')](_0x5b9c8d)){if(_0x5b9c8d[_0xd9ac('0x2b')]('agi_')===0x0){_0x36cb79[_0x5b9c8d[_0xd9ac('0x2c')](0x4)]=_0x36cb79[_0x5b9c8d];delete _0x36cb79[_0x5b9c8d];}}}}function getLogFromObject(_0x4dfdf3){return util[_0xd9ac('0x2d')](_0x4dfdf3,{'showHidden':![],'depth':null});}function agiHandler(_0x4f77a4){var _0x40c61c,_0x49f8c3,_0x4297c7,_0x1037bf,_0x15d649;logger[_0xd9ac('0x2e')](_0xd9ac('0x2f'),JSON[_0xd9ac('0x30')](_0x4f77a4,null,0x2));logger['info'](util[_0xd9ac('0xf')](_0xd9ac('0x31'),_0x4f77a4[_0xd9ac('0x16')],_0x4f77a4[_0xd9ac('0x17')],_0x4f77a4[_0xd9ac('0x18')],_0x4f77a4[_0xd9ac('0x19')],_0x4f77a4[_0xd9ac('0x1a')]));_0x4f77a4['on'](_0xd9ac('0xa'),errorHandler);_0x4f77a4['on'](_0xd9ac('0x32'),closeHandler);_0x4f77a4['on'](_0xd9ac('0x33'),timeoutHandler);_0x4f77a4[_0xd9ac('0x1b')]=![];_0x4f77a4['on']('hangup',hangupHandler);var _0x198d1c=getSquareProject[_0xd9ac('0x34')](null,_0x4f77a4[_0xd9ac('0x16')]);if(_0x198d1c){if(_0x198d1c[_0xd9ac('0x35')]){_0x40c61c=getRoot(_0x198d1c[_0xd9ac('0x35')]);if(_0x40c61c&&_0x40c61c[_0xd9ac('0x36')]){logger[_0xd9ac('0x2e')](_0xd9ac('0x37'),JSON[_0xd9ac('0x30')](_0x40c61c,null,0x2));_0x4f77a4[_0xd9ac('0x38')]=moment()[_0xd9ac('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x49f8c3=initGraph(_['omit'](_0x40c61c,'mxCell'),_0x40c61c[_0xd9ac('0x39')]);_0x4297c7=new Vertices(_0x4f77a4,rpc,mailRpc);logger['info'](util[_0xd9ac('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f77a4[_0xd9ac('0x16')],_0x4f77a4[_0xd9ac('0x17')],_0x4f77a4[_0xd9ac('0x18')],_0x4f77a4[_0xd9ac('0x19')],_0x4f77a4[_0xd9ac('0x1a')]));_0x49f8c3['traverseBFS'](_0x40c61c[_0xd9ac('0x36')]['id'],function(_0x41f82b){try{_0x41f82b=_0x4297c7[_0xd9ac('0x3a')](_0x41f82b);logger[_0xd9ac('0x2e')](_0xd9ac('0x3b'),JSON['stringify'](_0x41f82b,null,0x2));if(_0x41f82b['agicommand']===_0xd9ac('0x3c')){logger[_0xd9ac('0xe')](_0xd9ac('0x3d'));_0x4f77a4[_0xd9ac('0x3e')]=_0x41f82b['context']||_0x4f77a4[_0xd9ac('0x3e')];_0x4f77a4['extension']=_0x41f82b[_0xd9ac('0x3f')];_0x4f77a4[_0xd9ac('0x40')]=_0x41f82b[_0xd9ac('0x40')]?_0x41f82b[_0xd9ac('0x40')]-0x1:0x1;return null;}else if(_0x41f82b&&_0x4297c7[_0x41f82b[_0xd9ac('0x41')]]){_0x15d649=_0x4297c7[_0x41f82b[_0xd9ac('0x41')]](_0x41f82b);logger[_0xd9ac('0xe')](_0xd9ac('0x42'),JSON[_0xd9ac('0x30')](_0x15d649,null,0x2));if(_0x15d649&&_0x15d649[_0xd9ac('0x43')]===AGI_CODE_SUCCESS&&_0x15d649[_0xd9ac('0x44')]!==AGI_RESULT_ERROR&&!_0x4f77a4['evtHangup']){logger[_0xd9ac('0x2e')](_0xd9ac('0x42'),getLogFromObject(_0x15d649));return _[_0xd9ac('0x45')](_0x15d649[_0xd9ac('0x44')])?null:_0x15d649[_0xd9ac('0x44')][_0xd9ac('0x46')]();}else{logger['error'](_0xd9ac('0x42'),getLogFromObject(_0x15d649));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x27cda7){logger[_0xd9ac('0xa')](_0x27cda7['stack']);return null;}});if(_0x40c61c['finally']){logger[_0xd9ac('0xe')](util[_0xd9ac('0xf')](_0xd9ac('0x47'),_0x4f77a4[_0xd9ac('0x16')],_0x4f77a4['calleridname'],_0x4f77a4[_0xd9ac('0x18')],_0x4f77a4[_0xd9ac('0x19')],_0x4f77a4[_0xd9ac('0x1a')]));_0x49f8c3[_0xd9ac('0x48')](_0x40c61c[_0xd9ac('0x49')]['id'],function(_0xe4a5ee){try{_0xe4a5ee=_0x4297c7['clear'](_0xe4a5ee);logger[_0xd9ac('0x2e')](_0xd9ac('0x3b'),JSON[_0xd9ac('0x30')](_0xe4a5ee,null,0x2));if(_0xe4a5ee&&_0x4297c7[_0xe4a5ee[_0xd9ac('0x41')]]){_0x15d649=_0x4297c7[_0xe4a5ee[_0xd9ac('0x41')]](_0xe4a5ee);if(_0x15d649){logger[_0xd9ac('0x2e')](_0xd9ac('0x42'),getLogFromObject(_0x15d649));return _[_0xd9ac('0x45')](_0x15d649[_0xd9ac('0x44')])?null:_0x15d649[_0xd9ac('0x44')][_0xd9ac('0x46')]();}else{logger[_0xd9ac('0xa')](_0xd9ac('0x42'),getLogFromObject(_0x15d649));return null;}}else{logger[_0xd9ac('0xa')](_0xd9ac('0x4a'));return null;}}catch(_0x458f08){logger[_0xd9ac('0xa')](_0x458f08['stack']);return null;}});}logger['info'](util[_0xd9ac('0xf')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f77a4['arg_1'],_0x4f77a4['calleridname'],_0x4f77a4['callerid'],_0x4f77a4[_0xd9ac('0x19')],_0x4f77a4[_0xd9ac('0x1a')]));logger['info'](util['format'](_0xd9ac('0x4b'),_0x4f77a4[_0xd9ac('0x3e')],_0x4f77a4[_0xd9ac('0x3f')],parseInt(_0x4f77a4['priority'],0xa)+0x1));_0x4f77a4['continueAt'](_0x4f77a4[_0xd9ac('0x3e')],_0x4f77a4[_0xd9ac('0x3f')],parseInt(_0x4f77a4[_0xd9ac('0x40')],0xa)+0x1);_0x4f77a4[_0xd9ac('0x32')]();}}else{logger[_0xd9ac('0xa')](util[_0xd9ac('0xf')](_0xd9ac('0x4c'),_0x4f77a4['arg_1']));_0x4f77a4[_0xd9ac('0x4d')](_0x4f77a4[_0xd9ac('0x3e')],_0x4f77a4['extension'],parseInt(_0x4f77a4[_0xd9ac('0x40')],0xa)+0x1);_0x4f77a4[_0xd9ac('0x32')]();}}else{logger[_0xd9ac('0xa')](util[_0xd9ac('0xf')]('Project\x20%s\x20not\x20found',_0x4f77a4[_0xd9ac('0x16')]));_0x4f77a4[_0xd9ac('0x4d')](_0x4f77a4[_0xd9ac('0x3e')],_0x4f77a4[_0xd9ac('0x3f')],parseInt(_0x4f77a4[_0xd9ac('0x40')],0xa)+0x1);_0x4f77a4[_0xd9ac('0x32')]();}}function main(){var _0x605bdd;return utilLicense['getLicense']()['then'](function(_0x1d5ea7){if(_0x1d5ea7){if(_0x1d5ea7['voice']){if(_0x1d5ea7[_0xd9ac('0x4e')]&&_0x1d5ea7['callysquare']>0x0){logger[_0xd9ac('0xe')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x1d5ea7[_0xd9ac('0x4e')]));_0x605bdd=_0x1d5ea7[_0xd9ac('0x4e')];}else{logger[_0xd9ac('0xe')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xd9ac('0xe')](_0xd9ac('0x4f'));_0x605bdd=-0x1;}}})['catch'](function(_0x3476c7){logger[_0xd9ac('0xa')](_0xd9ac('0x50'),_0x3476c7[_0xd9ac('0x14')]);})[_0xd9ac('0x49')](function(){var _0x3ced87=require(_0xd9ac('0x51'))(config[_0xd9ac('0x4')]['port'],config[_0xd9ac('0x4')]['ip'],_0x605bdd);_0x3ced87['on']('error',errorHandler);_0x3ced87['on'](_0xd9ac('0x52'),listeningHandler);_0x3ced87['on'](_0xd9ac('0x53'),connectionHandler);_0x3ced87['on'](_0xd9ac('0x32'),closeHandler);});}main();
\ No newline at end of file
index 42198c8..f745b1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x241e=['jayson/promise','client','request','then','error','message','result','catch','bluebird'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x241e,0xd7));var _0xe241=function(_0xe31ac5,_0x2be1d4){_0xe31ac5=_0xe31ac5-0x0;var _0x52d196=_0x241e[_0xe31ac5];return _0x52d196;};'use strict';var BPromise=require(_0xe241('0x0'));var jayson=require(_0xe241('0x1'));var client=jayson[_0xe241('0x2')]['http']({'port':0x232b});function request(_0x8033fa,_0x4767d2){return new BPromise(function(_0x39f9af,_0x4dd484){return client[_0xe241('0x3')](_0x8033fa,_0x4767d2)[_0xe241('0x4')](function(_0x524d28){if(_0x524d28[_0xe241('0x5')]){return _0x4dd484(_0x524d28[_0xe241('0x5')][_0xe241('0x6')]);}else{return _0x39f9af(_0x524d28[_0xe241('0x7')]);}})[_0xe241('0x8')](function(_0x486426){return _0x4dd484(_0x486426);});});}exports['sendMailMessage']=function(_0x23e46b,_0x82eb5){return request('SendMail',{'account':_0x23e46b,'message':_0x82eb5});};
\ No newline at end of file
+var _0x33a4=['then','error','message','catch','sendMailMessage','SendMail','bluebird','client','http','request'];(function(_0x6ce516,_0x45661c){var _0x5cfcdb=function(_0x171484){while(--_0x171484){_0x6ce516['push'](_0x6ce516['shift']());}};_0x5cfcdb(++_0x45661c);}(_0x33a4,0x1aa));var _0x433a=function(_0x4b2694,_0xfb7da3){_0x4b2694=_0x4b2694-0x0;var _0x162d8c=_0x33a4[_0x4b2694];return _0x162d8c;};'use strict';var BPromise=require(_0x433a('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x433a('0x1')][_0x433a('0x2')]({'port':0x232b});function request(_0x506e11,_0x1c6691){return new BPromise(function(_0x8fc58b,_0x11f6b6){return client[_0x433a('0x3')](_0x506e11,_0x1c6691)[_0x433a('0x4')](function(_0x57c905){if(_0x57c905[_0x433a('0x5')]){return _0x11f6b6(_0x57c905[_0x433a('0x5')][_0x433a('0x6')]);}else{return _0x8fc58b(_0x57c905['result']);}})[_0x433a('0x7')](function(_0x5bea25){return _0x11f6b6(_0x5bea25);});});}exports[_0x433a('0x8')]=function(_0x447f6e,_0x95c802){return request(_0x433a('0x9'),{'account':_0x447f6e,'message':_0x95c802});};
\ No newline at end of file
index e4c9635..0d02f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceb5=['stream','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','split','slice','trim','emit','util'];(function(_0x4fcf7e,_0x4ffce6){var _0x4a003b=function(_0x39b4d3){while(--_0x39b4d3){_0x4fcf7e['push'](_0x4fcf7e['shift']());}};_0x4a003b(++_0x4ffce6);}(_0xceb5,0x81));var _0x5ceb=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0xceb5[_0x53c256];return _0x25feb6;};'use strict';var util=require(_0x5ceb('0x0'));var Transform=require(_0x5ceb('0x1'))['Transform'];function AGIReply(_0x50d7f9){Transform['call'](this,_0x50d7f9);this[_0x5ceb('0x2')]='';this[_0x5ceb('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x5ceb('0x4')]=function(_0x5b0e26,_0x5890a3,_0xa70c09){var _0x5cefc2='\x0a',_0x3c69d8=['\x0a\x0a',_0x5ceb('0x5')],_0x1dad3c=-0x1,_0x3cfdd1=-0x1,_0x328db3='',_0x221605=0x0,_0x5de6b9='',_0xd770d9='';this[_0x5ceb('0x2')]+=_0x5b0e26['toString']();_0x5de6b9=this['_localBuffer'];if(!this[_0x5ceb('0x3')]){_0x221605=0x0;while(_0x3c69d8[_0x221605]){while((_0x3cfdd1=_0x5de6b9[_0x5ceb('0x6')](_0x3c69d8[_0x221605]))!=-0x1){_0x328db3=_0x3c69d8[_0x221605];_0xd770d9=_0x5de6b9['substring'](0x0,_0x3cfdd1);_0x5de6b9=_0x5de6b9[_0x5ceb('0x7')](_0x3cfdd1+_0x328db3[_0x5ceb('0x8')]);var _0x1521e9=_0xd770d9[_0x5ceb('0x9')](_0x5cefc2),_0x41bb81=0x0,_0x2b087e={},_0x38ad1f='',_0x328f19='',_0x2c4044=-0x1;while(_0x1521e9[_0x41bb81]){_0x2c4044=_0x1521e9[_0x41bb81][_0x5ceb('0x6')](':');if(_0x2c4044!=-0x1){_0x38ad1f=_0x1521e9[_0x41bb81][_0x5ceb('0xa')](0x0,_0x2c4044)[_0x5ceb('0xb')]();_0x328f19=_0x1521e9[_0x41bb81][_0x5ceb('0xa')](_0x2c4044+0x1)[_0x5ceb('0xb')]();if(_0x38ad1f[_0x5ceb('0x8')]>0x0){_0x2b087e[_0x38ad1f]=_0x328f19;}}else{}_0x41bb81++;}this['emit']('headers',_0x2b087e);this['_inBody']=!![];}_0x221605++;}this[_0x5ceb('0x2')]=_0x5de6b9;}else{while((_0x1dad3c=_0x5de6b9['indexOf'](_0x5cefc2))!=-0x1){_0xd770d9=_0x5de6b9[_0x5ceb('0x7')](0x0,_0x1dad3c);this[_0x5ceb('0xc')]('line',_0xd770d9);_0x5de6b9=_0x5de6b9[_0x5ceb('0x7')](_0x1dad3c+_0x5cefc2[_0x5ceb('0x8')]);}this[_0x5ceb('0x2')]=_0x5de6b9;}_0xa70c09();};module['exports']=AGIReply;
\ No newline at end of file
+var _0x518c=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','split','trim','slice','length','headers','emit','exports','util','stream','_localBuffer','_inBody'];(function(_0x2554b6,_0x22e703){var _0x4b23b9=function(_0x1b025c){while(--_0x1b025c){_0x2554b6['push'](_0x2554b6['shift']());}};_0x4b23b9(++_0x22e703);}(_0x518c,0x150));var _0xc518=function(_0x4758ba,_0x3f6994){_0x4758ba=_0x4758ba-0x0;var _0x251e6f=_0x518c[_0x4758ba];return _0x251e6f;};'use strict';var util=require(_0xc518('0x0'));var Transform=require(_0xc518('0x1'))['Transform'];function AGIReply(_0x18062f){Transform['call'](this,_0x18062f);this[_0xc518('0x2')]='';this[_0xc518('0x3')]=![];}util[_0xc518('0x4')](AGIReply,Transform);AGIReply[_0xc518('0x5')][_0xc518('0x6')]=function(_0x1373b8,_0x1540d1,_0x5c4c5c){var _0xafab11='\x0a',_0x2f8b96=['\x0a\x0a',_0xc518('0x7')],_0x2cc1f0=-0x1,_0x715955=-0x1,_0x2b0ebf='',_0x363059=0x0,_0x25ad6f='',_0x3d8636='';this[_0xc518('0x2')]+=_0x1373b8['toString']();_0x25ad6f=this[_0xc518('0x2')];if(!this[_0xc518('0x3')]){_0x363059=0x0;while(_0x2f8b96[_0x363059]){while((_0x715955=_0x25ad6f[_0xc518('0x8')](_0x2f8b96[_0x363059]))!=-0x1){_0x2b0ebf=_0x2f8b96[_0x363059];_0x3d8636=_0x25ad6f[_0xc518('0x9')](0x0,_0x715955);_0x25ad6f=_0x25ad6f[_0xc518('0x9')](_0x715955+_0x2b0ebf['length']);var _0x464a27=_0x3d8636[_0xc518('0xa')](_0xafab11),_0x3ffd51=0x0,_0x3dae92={},_0x25aeb2='',_0x348fe4='',_0x47f003=-0x1;while(_0x464a27[_0x3ffd51]){_0x47f003=_0x464a27[_0x3ffd51]['indexOf'](':');if(_0x47f003!=-0x1){_0x25aeb2=_0x464a27[_0x3ffd51]['slice'](0x0,_0x47f003)[_0xc518('0xb')]();_0x348fe4=_0x464a27[_0x3ffd51][_0xc518('0xc')](_0x47f003+0x1)[_0xc518('0xb')]();if(_0x25aeb2[_0xc518('0xd')]>0x0){_0x3dae92[_0x25aeb2]=_0x348fe4;}}else{}_0x3ffd51++;}this['emit'](_0xc518('0xe'),_0x3dae92);this[_0xc518('0x3')]=!![];}_0x363059++;}this[_0xc518('0x2')]=_0x25ad6f;}else{while((_0x2cc1f0=_0x25ad6f[_0xc518('0x8')](_0xafab11))!=-0x1){_0x3d8636=_0x25ad6f[_0xc518('0x9')](0x0,_0x2cc1f0);this[_0xc518('0xf')]('line',_0x3d8636);_0x25ad6f=_0x25ad6f[_0xc518('0x9')](_0x2cc1f0+_0xafab11[_0xc518('0xd')]);}this['_localBuffer']=_0x25ad6f;}_0x5c4c5c();};module[_0xc518('0x10')]=AGIReply;
\ No newline at end of file
index ea46336..0d1e9a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbc5=['CreateSquareRecording','createSquareMessage','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','then','error','message','result','catch','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xbbc5,0x1bf));var _0x5bbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbc5[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x5bbc('0x0'));var moment=require(_0x5bbc('0x1'));var _=require(_0x5bbc('0x2'));var util=require(_0x5bbc('0x3'));var jayson=require(_0x5bbc('0x4'));var client=jayson['client']['http']({'port':0x2329});function request(_0x564045,_0x2d2a67){return new BPromise(function(_0x3d24c4,_0x51ca63){return client['request'](_0x564045,_0x2d2a67)[_0x5bbc('0x5')](function(_0xb30753){if(_0xb30753[_0x5bbc('0x6')]){return _0x51ca63(_0xb30753[_0x5bbc('0x6')][_0x5bbc('0x7')]);}else{return _0x3d24c4(_0xb30753[_0x5bbc('0x8')]);}})[_0x5bbc('0x9')](function(_0x41b11b){return _0x51ca63(_0x41b11b);});});}exports['getSquareProjects']=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x5bbc('0xa')]}});};exports[_0x5bbc('0xb')]=function(_0x5800b9){return request(_0x5bbc('0xc'),{'options':{'raw':![],'where':{'name':_0x5800b9},'attributes':[_0x5bbc('0xa')]}});};exports[_0x5bbc('0xd')]=function(_0x4e3883){return request(_0x5bbc('0xe'),{'options':{'raw':![],'where':{'id':_0x4e3883},'include':[{'model':_0x5bbc('0xf'),'as':_0x5bbc('0x10'),'include':[{'model':_0x5bbc('0x11'),'as':'CloudProvider'}]}],'attributes':['id',_0x5bbc('0x12'),_0x5bbc('0x13')],'smtp':!![]}});};exports[_0x5bbc('0x14')]=function(_0x5188ac){return request(_0x5bbc('0xc'),{'options':{'where':{'id':_0x5188ac},'attributes':[_0x5bbc('0x12')]}});};exports['getVoiceQueueById']=function(_0x3beb92){return request(_0x5bbc('0x15'),{'options':{'where':{'id':_0x3beb92},'attributes':['name']}});};exports[_0x5bbc('0x16')]=function(_0x2a437e){return request(_0x5bbc('0x17'),{'options':{'where':{'id':_0x2a437e},'attributes':[_0x5bbc('0x12')]}});};exports[_0x5bbc('0x18')]=function(_0x387fcf){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x387fcf},'attributes':[_0x5bbc('0x19')]}});};exports[_0x5bbc('0x1a')]=function(_0x221be6){return request(_0x5bbc('0x1b'),{'options':{'where':{'id':_0x221be6},'attributes':['name']}});};exports['getContactByPhone']=function(_0xd5725b){return request(_0x5bbc('0x1c'),{'options':{'where':{'phone':_0xd5725b[_0x5bbc('0x1d')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x388e24){return request(_0x5bbc('0x1e'),{'options':{'where':{'id':_0x388e24},'attributes':['name']}});};exports[_0x5bbc('0x1f')]=function(_0x2e2877){return request(_0x5bbc('0x20'),{'options':{'where':{'id':_0x2e2877},'attributes':['save_name']}});};exports[_0x5bbc('0x21')]=function(_0x191d94){return request(_0x5bbc('0x22'),{'options':{'raw':![],'where':{'id':_0x191d94},'include':[{'model':_0x5bbc('0x23'),'as':_0x5bbc('0x24')}]}});};exports[_0x5bbc('0x25')]=function(_0x4e5913){return request(_0x5bbc('0x26'),{'options':{'where':{'id':_0x4e5913},'attributes':['id',_0x5bbc('0x12')]}});};exports[_0x5bbc('0x27')]=function(_0xaa17ab){return request(_0x5bbc('0x28'),{'body':_0xaa17ab});};exports['createSquareDetailsReport']=function(_0x4e9c52){return request('CreateSquareDetailsReport',{'body':_0x4e9c52});};exports[_0x5bbc('0x29')]=function(_0x524163){return request(_0x5bbc('0x2a'),{'body':_[_0x5bbc('0x2b')](_0x524163,{'project_name':_0x524163[_0x5bbc('0x2c')],'prev_project_name':_0x524163[_0x5bbc('0x2d')]||'','is_subproject':_0x524163['arg_2']?!![]:![],'leaveAt':moment()[_0x5bbc('0x2e')](_0x5bbc('0x2f'))})});};exports[_0x5bbc('0x30')]=function(_0x351c3e){return request(_0x5bbc('0x31'),{'body':_0x351c3e});};exports[_0x5bbc('0x32')]=function(_0x417691){return request('CreateSquareMessage',{'body':_0x417691});};exports['createCmContact']=function(_0x1361ec){return request(_0x5bbc('0x33'),{'options':{'raw':![],'where':{'phone':_0x1361ec[_0x5bbc('0x1d')],'ListId':_0x1361ec['ListId']}}})[_0x5bbc('0x5')](function(_0x1a3ed8){if(_0x1a3ed8){return _0x1a3ed8;}return request(_0x5bbc('0x34'),{'body':_0x1361ec});});};exports[_0x5bbc('0x35')]=function(_0x2fa563){return request(_0x5bbc('0x36'),{'options':{'where':{'id':_0x2fa563},'attributes':[_0x5bbc('0x12')]}});};exports[_0x5bbc('0x37')]=function(_0x2f5c7f,_0xc5fa78){return request('LoginUser',{'body':{'interface':_0xc5fa78},'options':{'where':_0x2f5c7f}});};exports[_0x5bbc('0x38')]=function(_0x40bb2a,_0x160ef4,_0x31d690){return request(_0x5bbc('0x39'),{'body':{'type':_0x160ef4,'uniqueid':_0x31d690},'options':{'where':_0x40bb2a}});};exports[_0x5bbc('0x3a')]=function(_0x4d60dc){return request(_0x5bbc('0x3b'),{'body':{},'options':{'where':_0x4d60dc}});};exports[_0x5bbc('0x3c')]=function(_0x13709a){return request(_0x5bbc('0x3d'),{'body':{},'options':{'where':_0x13709a}});};
\ No newline at end of file
+var _0xedd1=['bluebird','moment','lodash','util','jayson/promise','client','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','ShowUser','GetContactByPhone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','agentPause','agentUnpause','agentLogout'];(function(_0x5528bc,_0x3fbeca){var _0x592eea=function(_0x3a2801){while(--_0x3a2801){_0x5528bc['push'](_0x5528bc['shift']());}};_0x592eea(++_0x3fbeca);}(_0xedd1,0x12c));var _0x1edd=function(_0x37dc21,_0x2bae86){_0x37dc21=_0x37dc21-0x0;var _0x34dc9e=_0xedd1[_0x37dc21];return _0x34dc9e;};'use strict';var BPromise=require(_0x1edd('0x0'));var moment=require(_0x1edd('0x1'));var _=require(_0x1edd('0x2'));var util=require(_0x1edd('0x3'));var jayson=require(_0x1edd('0x4'));var client=jayson[_0x1edd('0x5')]['http']({'port':0x2329});function request(_0x3f6508,_0x2d8991){return new BPromise(function(_0x523cfd,_0x7912ee){return client[_0x1edd('0x6')](_0x3f6508,_0x2d8991)[_0x1edd('0x7')](function(_0x2375bb){if(_0x2375bb[_0x1edd('0x8')]){return _0x7912ee(_0x2375bb[_0x1edd('0x8')][_0x1edd('0x9')]);}else{return _0x523cfd(_0x2375bb[_0x1edd('0xa')]);}})[_0x1edd('0xb')](function(_0x4f1fdd){return _0x7912ee(_0x4f1fdd);});});}exports[_0x1edd('0xc')]=function(){return request(_0x1edd('0xd'),{'options':{'raw':![],'attributes':['id',_0x1edd('0xe'),_0x1edd('0xf')]}});};exports['getSquareProject']=function(_0x4d31d9){return request(_0x1edd('0x10'),{'options':{'raw':![],'where':{'name':_0x4d31d9},'attributes':['production']}});};exports[_0x1edd('0x11')]=function(_0x145077){return request(_0x1edd('0x12'),{'options':{'raw':![],'where':{'id':_0x145077},'include':[{'model':_0x1edd('0x13'),'as':_0x1edd('0x14'),'include':[{'model':_0x1edd('0x15'),'as':_0x1edd('0x15')}]}],'attributes':['id',_0x1edd('0xe'),_0x1edd('0x16')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x22bb1b){return request(_0x1edd('0x10'),{'options':{'where':{'id':_0x22bb1b},'attributes':['name']}});};exports[_0x1edd('0x17')]=function(_0x1cb357){return request(_0x1edd('0x18'),{'options':{'where':{'id':_0x1cb357},'attributes':['name']}});};exports[_0x1edd('0x19')]=function(_0x26eff9){return request(_0x1edd('0x1a'),{'options':{'where':{'id':_0x26eff9},'attributes':[_0x1edd('0xe')]}});};exports[_0x1edd('0x1b')]=function(_0x59fcee){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x59fcee},'attributes':['dsn']}});};exports[_0x1edd('0x1c')]=function(_0xf31a4e){return request(_0x1edd('0x1d'),{'options':{'where':{'id':_0xf31a4e},'attributes':[_0x1edd('0xe')]}});};exports['getContactByPhone']=function(_0x350d4a){return request(_0x1edd('0x1e'),{'options':{'where':{'phone':_0x350d4a['phone']},'attributes':['id']}});};exports[_0x1edd('0x1f')]=function(_0x48ddf8){return request(_0x1edd('0x20'),{'options':{'where':{'id':_0x48ddf8},'attributes':[_0x1edd('0xe')]}});};exports['getSoundById']=function(_0x2e30d0){return request(_0x1edd('0x21'),{'options':{'where':{'id':_0x2e30d0},'attributes':[_0x1edd('0x22')]}});};exports[_0x1edd('0x23')]=function(_0x54fd67){return request(_0x1edd('0x24'),{'options':{'raw':![],'where':{'id':_0x54fd67},'include':[{'model':_0x1edd('0x25'),'as':_0x1edd('0x26')}]}});};exports['getSmsAccountById']=function(_0x1f4188){return request(_0x1edd('0x27'),{'options':{'where':{'id':_0x1f4188},'attributes':['id','name']}});};exports[_0x1edd('0x28')]=function(_0x65648b){return request(_0x1edd('0x29'),{'body':_0x65648b});};exports['createSquareDetailsReport']=function(_0x286931){return request(_0x1edd('0x2a'),{'body':_0x286931});};exports['createSquareReport']=function(_0x5c175e){return request(_0x1edd('0x2b'),{'body':_[_0x1edd('0x2c')](_0x5c175e,{'project_name':_0x5c175e['arg_1'],'prev_project_name':_0x5c175e[_0x1edd('0x2d')]||'','is_subproject':_0x5c175e[_0x1edd('0x2d')]?!![]:![],'leaveAt':moment()[_0x1edd('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x1edd('0x2f')]=function(_0x38e046){return request(_0x1edd('0x30'),{'body':_0x38e046});};exports[_0x1edd('0x31')]=function(_0x12b020){return request(_0x1edd('0x32'),{'body':_0x12b020});};exports[_0x1edd('0x33')]=function(_0x5a6f4c){return request(_0x1edd('0x34'),{'options':{'raw':![],'where':{'phone':_0x5a6f4c['phone'],'ListId':_0x5a6f4c[_0x1edd('0x35')]}}})[_0x1edd('0x7')](function(_0x1317f5){if(_0x1317f5){return _0x1317f5;}return request('CreateCmContact',{'body':_0x5a6f4c});});};exports[_0x1edd('0x36')]=function(_0x30dc97){return request(_0x1edd('0x37'),{'options':{'where':{'id':_0x30dc97},'attributes':[_0x1edd('0xe')]}});};exports[_0x1edd('0x38')]=function(_0x1598e2,_0x4f11d6){return request('LoginUser',{'body':{'interface':_0x4f11d6},'options':{'where':_0x1598e2}});};exports[_0x1edd('0x39')]=function(_0x24bb85,_0xacc91c,_0x339e29){return request('PauseUser',{'body':{'type':_0xacc91c,'uniqueid':_0x339e29},'options':{'where':_0x24bb85}});};exports[_0x1edd('0x3a')]=function(_0x495b5d){return request('UnpauseUser',{'body':{},'options':{'where':_0x495b5d}});};exports[_0x1edd('0x3b')]=function(_0x30efbc){return request('LogoutUser',{'body':{},'options':{'where':_0x30efbc}});};
\ No newline at end of file
index eecee69..71a4735 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5502=['./polly','./lex','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5502,0x69));var _0x2550=function(_0xf555be,_0xc9895e){_0xf555be=_0xf555be-0x0;var _0x2be994=_0x5502[_0xf555be];return _0x2be994;};var polly=require(_0x2550('0x0'));var lex=require(_0x2550('0x1'));module[_0x2550('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x5655=['./lex','exports','./polly'];(function(_0x56375d,_0x5401d7){var _0x5d9446=function(_0x7ea37a){while(--_0x7ea37a){_0x56375d['push'](_0x56375d['shift']());}};_0x5d9446(++_0x5401d7);}(_0x5655,0x15e));var _0x5565=function(_0x37950c,_0x213767){_0x37950c=_0x37950c-0x0;var _0xd0a2ed=_0x5655[_0x37950c];return _0xd0a2ed;};var polly=require(_0x5565('0x0'));var lex=require(_0x5565('0x1'));module[_0x5565('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 32ce91c..bccfc05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c00=['./lib/api','exports'];(function(_0x1578d9,_0x5e262b){var _0x3adcf3=function(_0x297a15){while(--_0x297a15){_0x1578d9['push'](_0x1578d9['shift']());}};_0x3adcf3(++_0x5e262b);}(_0x5c00,0x17e));var _0x05c0=function(_0x511a19,_0x417e36){_0x511a19=_0x511a19-0x0;var _0x499aa6=_0x5c00[_0x511a19];return _0x499aa6;};'use strict';var lex=require(_0x05c0('0x0'));module[_0x05c0('0x1')]=function(_0x1c3b79,_0x4e54ec,_0x1e76da,_0x5859bc,_0x41c4b4,_0x25c3a9){return lex(_0x1c3b79,_0x4e54ec,_0x1e76da,_0x5859bc,_0x41c4b4,_0x25c3a9);};
\ No newline at end of file
+var _0xf109=['./lib/api','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf109,0xce));var _0x9f10=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xf109[_0x580647];return _0x5f0792;};'use strict';var lex=require(_0x9f10('0x0'));module[_0x9f10('0x1')]=function(_0x44c4f2,_0x5d2950,_0x5b381d,_0x4cbc7a,_0x3659ce,_0x74f517){return lex(_0x44c4f2,_0x5d2950,_0x5b381d,_0x4cbc7a,_0x3659ce,_0x74f517);};
\ No newline at end of file
index a128479..7a06eea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x523b69,_0x363628){var _0x520c8c=function(_0x5bce){while(--_0x5bce){_0x523b69['push'](_0x523b69['shift']());}};_0x520c8c(++_0x363628);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x53083a,_0x587d9a){var _0x1a3c48=function(_0x57231b){while(--_0x57231b){_0x53083a['push'](_0x53083a['shift']());}};_0x1a3c48(++_0x587d9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 cfcd0a8..22d92af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc55f=['exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc55f,0x19d));var _0xfc55=function(_0x285480,_0x2d7268){_0x285480=_0x285480-0x0;var _0xe20094=_0xc55f[_0x285480];return _0xe20094;};'use strict';var polly=require('./lib/api');module[_0xfc55('0x0')]=function(_0x42ef95,_0xde6f96,_0x294106,_0x26ddfc,_0x5de24f,_0x220b78,_0x2f1860){return polly(_0x42ef95,_0xde6f96,_0x294106,_0x26ddfc,_0x5de24f,_0x220b78,_0x2f1860);};
\ No newline at end of file
+var _0x3ae5=['./lib/api','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3ae5,0x1bc));var _0x53ae=function(_0x54a9a1,_0x36da78){_0x54a9a1=_0x54a9a1-0x0;var _0x32bcee=_0x3ae5[_0x54a9a1];return _0x32bcee;};'use strict';var polly=require(_0x53ae('0x0'));module[_0x53ae('0x1')]=function(_0x53cd0b,_0x3639bf,_0x48c8c8,_0x5a0256,_0x3efdaf,_0x1d99d4,_0x2f1f4a){return polly(_0x53cd0b,_0x3639bf,_0x48c8c8,_0x5a0256,_0x3efdaf,_0x1d99d4,_0x2f1f4a);};
\ No newline at end of file
index 76a555a..b241871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa85e=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x1c8e23,_0x26885e){var _0x369ac8=function(_0x503578){while(--_0x503578){_0x1c8e23['push'](_0x1c8e23['shift']());}};_0x369ac8(++_0x26885e);}(_0xa85e,0x1ac));var _0xea85=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0xa85e[_0x37ae26];return _0x1b1902;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xea85('0x0'));var rs=require(_0xea85('0x1'));var AWS=require(_0xea85('0x2'));function pollyResult(_0x1e3731,_0x515102,_0x526300){return new BPromise(function(_0x32deb9,_0x2789e3){_0x1e3731[_0xea85('0x3')](_0x515102,function(_0xe7d8ed,_0x201d97){if(_0xe7d8ed){_0x2789e3(_0xe7d8ed);}else if(_0x201d97){if(_0x201d97[_0xea85('0x4')]instanceof Buffer){fs[_0xea85('0x5')](_0x526300,_0x201d97[_0xea85('0x4')],function(_0x1e8fed){if(_0x1e8fed){_0x2789e3(_0x1e8fed);}else{_0x32deb9();}});}else{_0x2789e3(new Error(_0xea85('0x6')));}}else{_0x2789e3(new Error(_0xea85('0x7')));}});});}module[_0xea85('0x8')]=function(_0x43394d,_0x2cc795,_0x1a52e2,_0x43ed2f,_0x21a5e2,_0x15d1a2,_0x2d2452){var _0x4e31a2=new AWS[(_0xea85('0x9'))]({'accessKeyId':_0x43394d,'secretAccessKey':_0x2cc795,'region':_0x1a52e2});var _0x265f97={'Text':_0x21a5e2,'TextType':_0x15d1a2||_0xea85('0xa'),'OutputFormat':_0xea85('0xb'),'VoiceId':_0x43ed2f};return pollyResult(_0x4e31a2,_0x265f97,_0x2d2452);};
\ No newline at end of file
+var _0xfc7d=['Polly','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfc7d,0x142));var _0xdfc7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfc7d[_0x2641f9];return _0x585741;};'use strict';var fs=require('fs');var path=require(_0xdfc7('0x0'));var BPromise=require(_0xdfc7('0x1'));var rs=require(_0xdfc7('0x2'));var AWS=require(_0xdfc7('0x3'));function pollyResult(_0x142f82,_0x8035b9,_0xf1e178){return new BPromise(function(_0x5ddb63,_0x269927){_0x142f82[_0xdfc7('0x4')](_0x8035b9,function(_0x167cef,_0x2813bb){if(_0x167cef){_0x269927(_0x167cef);}else if(_0x2813bb){if(_0x2813bb[_0xdfc7('0x5')]instanceof Buffer){fs['writeFile'](_0xf1e178,_0x2813bb[_0xdfc7('0x5')],function(_0x5c16ab){if(_0x5c16ab){_0x269927(_0x5c16ab);}else{_0x5ddb63();}});}else{_0x269927(new Error(_0xdfc7('0x6')));}}else{_0x269927(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xdfc7('0x7')]=function(_0x3923b0,_0x33bf90,_0xcf1fff,_0x4e655e,_0x237de4,_0xe02f9f,_0x39b4e7){var _0x54547c=new AWS[(_0xdfc7('0x8'))]({'accessKeyId':_0x3923b0,'secretAccessKey':_0x33bf90,'region':_0xcf1fff});var _0x2b1393={'Text':_0x237de4,'TextType':_0xe02f9f||_0xdfc7('0x9'),'OutputFormat':'mp3','VoiceId':_0x4e655e};return pollyResult(_0x54547c,_0x2b1393,_0x39b4e7);};
\ No newline at end of file
index 8de92b8..cf5a778 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6897=['exports','./lib/api'];(function(_0x277d83,_0x43e62e){var _0x32ab98=function(_0xfbdc06){while(--_0xfbdc06){_0x277d83['push'](_0x277d83['shift']());}};_0x32ab98(++_0x43e62e);}(_0x6897,0x163));var _0x7689=function(_0x1fbe8a,_0x5ea827){_0x1fbe8a=_0x1fbe8a-0x0;var _0x4adf2b=_0x6897[_0x1fbe8a];return _0x4adf2b;};'use strict';var asr=require(_0x7689('0x0'));module[_0x7689('0x1')]=function(_0x2f806f,_0x10db61,_0x2cd3d1,_0x11d54b){return asr(_0x2f806f,_0x10db61,_0x2cd3d1);};
\ No newline at end of file
+var _0x12d5=['exports','./lib/api'];(function(_0x4aee11,_0x19b845){var _0x39776e=function(_0x207729){while(--_0x207729){_0x4aee11['push'](_0x4aee11['shift']());}};_0x39776e(++_0x19b845);}(_0x12d5,0x1cb));var _0x512d=function(_0x58b657,_0x2df425){_0x58b657=_0x58b657-0x0;var _0x7c4fcd=_0x12d5[_0x58b657];return _0x7c4fcd;};'use strict';var asr=require(_0x512d('0x0'));module[_0x512d('0x1')]=function(_0x4481f9,_0x12269c,_0x5a94cd,_0xa7aac5){return asr(_0x4481f9,_0x12269c,_0x5a94cd);};
\ No newline at end of file
index 3fc37ce..7d83ef2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','8000','https://speech.googleapis.com'];(function(_0x300a0a,_0x1653d4){var _0x28b718=function(_0x1100ce){while(--_0x1100ce){_0x300a0a['push'](_0x300a0a['shift']());}};_0x28b718(++_0x1653d4);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x49c4('0x0');module[_0x49c4('0x1')]=function(_0x26844b,_0x1ba0bb,_0x455700){return new BPromise(function(_0x2ad237,_0x4e0313){var _0x4941f1;if(typeof _0x26844b!==_0x49c4('0x2')||_0x26844b['length']===0x0){return _0x4e0313(_0x49c4('0x3'));}if(typeof _0x1ba0bb!==_0x49c4('0x2')||_0x1ba0bb[_0x49c4('0x4')]===0x0){return _0x4e0313(_0x49c4('0x5'));}if(typeof _0x455700!==_0x49c4('0x6')&&(typeof _0x455700!=='string'||_0x455700[_0x49c4('0x4')]===0x0)){return _0x4e0313(_0x49c4('0x7'));}try{_0x4941f1=fs[_0x49c4('0x8')](_0x26844b)[_0x49c4('0x9')]('base64');}catch(_0x5ab4a3){return _0x4e0313(_0x5ab4a3);}return _0x2ad237({'method':_0x49c4('0xa'),'uri':host+_0x49c4('0xb')+_0x1ba0bb,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x49c4('0xc'),'languageCode':_0x455700},'audio':{'content':_0x4941f1}},'json':!![]});});};
\ No newline at end of file
+var _0x928c=['exports','length','filepath\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000','https://speech.googleapis.com'];(function(_0x15fa45,_0x132622){var _0x3e7413=function(_0xba8cb9){while(--_0xba8cb9){_0x15fa45['push'](_0x15fa45['shift']());}};_0x3e7413(++_0x132622);}(_0x928c,0x17f));var _0xc928=function(_0x3210da,_0x259c61){_0x3210da=_0x3210da-0x0;var _0x582658=_0x928c[_0x3210da];return _0x582658;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xc928('0x0');module[_0xc928('0x1')]=function(_0x597d43,_0x24354b,_0x29bd30){return new BPromise(function(_0x2b4ea2,_0x3e4e60){var _0x1dd54b;if(typeof _0x597d43!=='string'||_0x597d43[_0xc928('0x2')]===0x0){return _0x3e4e60(_0xc928('0x3'));}if(typeof _0x24354b!==_0xc928('0x4')||_0x24354b['length']===0x0){return _0x3e4e60('key\x20should\x20be\x20a\x20string');}if(typeof _0x29bd30!=='undefined'&&(typeof _0x29bd30!==_0xc928('0x4')||_0x29bd30[_0xc928('0x2')]===0x0)){return _0x3e4e60(_0xc928('0x5'));}try{_0x1dd54b=fs[_0xc928('0x6')](_0x597d43)[_0xc928('0x7')](_0xc928('0x8'));}catch(_0x29b39a){return _0x3e4e60(_0x29b39a);}return _0x2b4ea2({'method':_0xc928('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x24354b,'body':{'config':{'encoding':_0xc928('0xa'),'sampleRateHertz':_0xc928('0xb'),'languageCode':_0x29bd30},'audio':{'content':_0x1dd54b}},'json':!![]});});};
\ No newline at end of file
index aabf76e..3a39e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa417=['./asr','exports'];(function(_0x1fc7bb,_0x41a522){var _0x13d086=function(_0x13816c){while(--_0x13816c){_0x1fc7bb['push'](_0x1fc7bb['shift']());}};_0x13d086(++_0x41a522);}(_0xa417,0x1a8));var _0x7a41=function(_0x48760f,_0x32da3c){_0x48760f=_0x48760f-0x0;var _0x332f35=_0xa417[_0x48760f];return _0x332f35;};var asr=require(_0x7a41('0x0'));module[_0x7a41('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x66ce=['exports'];(function(_0x1cf748,_0x11ad2f){var _0x1e8b7b=function(_0x280ad0){while(--_0x280ad0){_0x1cf748['push'](_0x1cf748['shift']());}};_0x1e8b7b(++_0x11ad2f);}(_0x66ce,0x1ba));var _0xe66c=function(_0x506e30,_0x3cff7c){_0x506e30=_0x506e30-0x0;var _0xaad15e=_0x66ce[_0x506e30];return _0xaad15e;};var asr=require('./asr');module[_0xe66c('0x0')]={'asr':asr};
\ No newline at end of file
index dec432c..7d408a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd63b=['displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','http','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','util','./aws','./google','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','info','finish\x20download\x20file','close','download\x20error','pipe','end','get','data','transcode','error\x20convert','start','resolve','tmp','.wav','writeFileSync','base64','then','unlink','chmodSync','split','readFileSync','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','generate','.mp3','from','audioContent','writeFile','777','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','message','result','source','resolvedQuery','action','actionIncomplete','fulfillment','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name'];(function(_0x148321,_0x18db9f){var _0x51e6f2=function(_0x3036ef){while(--_0x3036ef){_0x148321['push'](_0x148321['shift']());}};_0x51e6f2(++_0x18db9f);}(_0xd63b,0x122));var _0xbd63=function(_0xbee361,_0x432722){_0xbee361=_0xbee361-0x0;var _0x205692=_0xd63b[_0xbee361];return _0x205692;};'use strict';var apiai=require(_0xbd63('0x0'));var BPromise=require(_0xbd63('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xbd63('0x2'));var https=require('https');var md5=require(_0xbd63('0x3'));var path=require(_0xbd63('0x4'));var querystring=require(_0xbd63('0x5'));var rp=require(_0xbd63('0x6'));var rs=require('randomstring');var sox=require(_0xbd63('0x7'));var tts=require(_0xbd63('0x8'));var urlParse=require(_0xbd63('0x9'))[_0xbd63('0xa')];var util=require(_0xbd63('0xb'));var aws=require(_0xbd63('0xc'));var google=require(_0xbd63('0xd'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0xbd63('0xe');function downloadFile(_0x288736,_0x48e8f3){return new BPromise(function(_0x13589c,_0x478a7c){var _0xea451a=urlParse(_0x288736);var _0x1bb963=_0xea451a[_0xbd63('0xf')]===_0xbd63('0x10')?https:http;var _0x381a04={'host':_0xea451a[_0xbd63('0x11')],'path':_0xea451a['path'],'headers':{'user-agent':_0xbd63('0x12')}};_0x1bb963['get'](_0x381a04,function(_0x5346b2){if(_0x5346b2['statusCode']!==0xc8){logger[_0xbd63('0x13')](_0xbd63('0x14')+_0x288736+_0xbd63('0x15')+_0x5346b2[_0xbd63('0x16')]+'\x20('+_0x5346b2[_0xbd63('0x17')]+')');_0x478a7c(new Error('request\x20to\x20'+_0x288736+_0xbd63('0x15')+_0x5346b2[_0xbd63('0x16')]+'\x20('+_0x5346b2[_0xbd63('0x17')]+')'));return;}var _0x8ab99d=fs[_0xbd63('0x18')](_0x48e8f3);_0x8ab99d['on']('finish',function(){logger[_0xbd63('0x19')](_0xbd63('0x1a'));_0x8ab99d[_0xbd63('0x1b')](_0x13589c);});_0x8ab99d['on'](_0xbd63('0x13'),function(_0x3e51df){fs['unlink'](_0x48e8f3);logger[_0xbd63('0x13')](_0xbd63('0x1c'),_0x3e51df);_0x478a7c(_0x3e51df);});_0x5346b2[_0xbd63('0x1d')](_0x8ab99d);})['on'](_0xbd63('0x13'),function(_0x23ae5c){logger[_0xbd63('0x13')](_0x23ae5c);_0x478a7c(_0x23ae5c);})[_0xbd63('0x1e')]();});}function uploadFile(_0xa41896){return new BPromise(function(_0x53191d,_0x328fca){var _0x2e01f5=urlParse(_0xa41896);var _0x61c3c0=_0x2e01f5['protocol']===_0xbd63('0x10')?https:http;var _0x28fac5={'host':_0x2e01f5[_0xbd63('0x11')],'path':_0x2e01f5[_0xbd63('0x4')],'headers':{'user-agent':_0xbd63('0x12')}};_0x61c3c0[_0xbd63('0x1f')](_0x28fac5,function(_0x2a939b){if(_0x2a939b[_0xbd63('0x16')]!==0xc8){_0x328fca(new Error(_0xbd63('0x14')+_0xa41896+_0xbd63('0x15')+_0x2a939b[_0xbd63('0x16')]+'\x20('+_0x2a939b['statusMessage']+')'));return;}var _0x598d75='';_0x2a939b['on'](_0xbd63('0x20'),function(_0x3d2d22){_0x598d75+=_0x3d2d22;});_0x2a939b['on'](_0xbd63('0x1e'),function(){_0x53191d(_0x598d75);});})['on'](_0xbd63('0x13'),function(_0xc18945){_0x328fca(_0xc18945);})[_0xbd63('0x1e')]();});}function convertFile(_0x4cbb6a,_0x2256f2){return new BPromise(function(_0x2a0c8e,_0x56ecc9){var _0x2f62bf=sox[_0xbd63('0x21')](_0x4cbb6a,_0x2256f2,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2f62bf['on'](_0xbd63('0x13'),function(_0x352e8d){logger[_0xbd63('0x13')](_0xbd63('0x22'),_0x352e8d);_0x56ecc9(_0x352e8d);});_0x2f62bf['on']('end',function(){logger[_0xbd63('0x19')]('finish\x20to\x20convert');_0x2a0c8e();});_0x2f62bf[_0xbd63('0x23')]();});}function base64Decode(_0x3537f3,_0x580d20){var _0x10f983=path[_0xbd63('0x24')](__dirname,_0xbd63('0x25'),rs['generate'](0x4)+_0xbd63('0x26'));fs[_0xbd63('0x27')](_0x10f983,_0x3537f3,_0xbd63('0x28'));return convertFile(_0x10f983,_0x580d20)[_0xbd63('0x29')](function(){try{fs[_0xbd63('0x2a')](_0x10f983);fs[_0xbd63('0x2b')](_0x580d20,'777');}catch(_0x638f59){logger[_0xbd63('0x13')](_0x638f59);}return _0x580d20[_0xbd63('0x2c')]('.')[0x0];});}function base64Encode(_0x5d1cb2){var _0x1a4dcf=fs[_0xbd63('0x2d')](_0x5d1cb2);return new Buffer(_0x1a4dcf)['toString']('base64');}exports[_0xbd63('0x2e')]=function(_0x3eee10,_0x4e33f8,_0x54ebc0,_0xe98b95,_0x1d2a4a,_0x3845ae){var _0x425677,_0x4eb73e;var _0x5c4e3f='https://texttospeech.googleapis.com/v1/';var _0x323ee3=_0xbd63('0x2f')+_0x3eee10;var _0x40254b={};if(_0x4e33f8===_0xbd63('0x30')){_0x40254b[_0xbd63('0x31')]={'ssml':_0x54ebc0};}else{_0x40254b[_0xbd63('0x31')]={'text':_0x54ebc0};};_0x40254b[_0xbd63('0x32')]={'languageCode':_0xe98b95,'ssmlGender':_0x1d2a4a};_0x40254b[_0xbd63('0x33')]={'audioEncoding':_0xbd63('0x34'),'sampleRateHertz':0x1f40};var _0x1f884a={'url':_0x5c4e3f+_0xbd63('0x35')+_0x323ee3,'method':'POST','json':!![],'body':_0x40254b};return rp(_0x1f884a)[_0xbd63('0x29')](function(_0x45693a){return new BPromise(function(_0x12d7f,_0x218582){_0x425677=path[_0xbd63('0x24')](__dirname,_0xbd63('0x25'),rs[_0xbd63('0x36')](0x4)+_0xbd63('0x37'));var _0x48cc91=Buffer[_0xbd63('0x38')](_0x45693a[_0xbd63('0x39')],_0xbd63('0x28'));return fs[_0xbd63('0x3a')](_0x425677,_0x48cc91,function(_0x2137d1){_0x218582(_0x2137d1);},function(_0x46ddda){fs[_0xbd63('0x2b')](_0x425677,_0xbd63('0x3b'));_0x12d7f(_0x46ddda);});});})[_0xbd63('0x29')](function(_0x21de63){_0x4eb73e=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x425677,_0x4eb73e);})[_0xbd63('0x29')](function(){try{fs[_0xbd63('0x2a')](_0x425677);fs['chmodSync'](_0x4eb73e,'777');}catch(_0x225158){logger[_0xbd63('0x13')](_0x225158);}logger[_0xbd63('0x19')]('googleCloudTTS\x20path',_0x4eb73e[_0xbd63('0x2c')]('.')[0x0]);return _0x4eb73e[_0xbd63('0x2c')]('.')[0x0];});};exports[_0xbd63('0x3c')]=function(_0xfca830,_0xd8e26c){var _0x517681=_0xbd63('0x3d');var _0x2c20e4,_0x4cd529;var _0x1b811a;var _0x3fdf06={'encoding':_0xbd63('0x3e'),'method':_0xbd63('0x3f'),'timeout':0x2710,'url':_0x517681,'headers':{'Content-Type':_0xbd63('0x40')},'body':_0xbd63('0x41')+encodeURIComponent(JSON[_0xbd63('0x42')]([[['jQ1olc',JSON['stringify']([_0xfca830,_0xd8e26c||'en',![],_0xbd63('0x43')]),null,'generic']]]))};return rp(_0x3fdf06)['then'](function(_0x2c0d47){try{_0x1b811a=eval(_0x2c0d47[_0xbd63('0x44')](0x5))[0x0][0x2];}catch(_0x508814){throw new Error(_0xbd63('0x45')+_0x2c0d47[_0xbd63('0x20')]);}if(!_0x1b811a){if(_0xfca830[_0xbd63('0x46')]>0xc8){throw new Error(_0xbd63('0x47'));}else{throw new Error(_0xbd63('0x48')+_0xd8e26c+'\x22\x20might\x20not\x20exist');}}try{_0x1b811a=eval(_0x1b811a)[0x0];}catch(_0x2a0ca4){throw new Error(_0xbd63('0x45')+res['data']);}const _0x3c39e9=_0x1b811a;_0x2c20e4=path[_0xbd63('0x24')](__dirname,'tmp',rs['generate'](0x4)+_0xbd63('0x37'));fs[_0xbd63('0x27')](_0x2c20e4,_0x1b811a,{'encoding':_0xbd63('0x28')});_0x4cd529=path[_0xbd63('0x24')](__dirname,_0xbd63('0x25'),rs[_0xbd63('0x36')](0x4)+_0xbd63('0x26'));return convertFile(_0x2c20e4,_0x4cd529);})[_0xbd63('0x29')](function(){try{fs['unlink'](_0x2c20e4);fs['chmodSync'](_0x4cd529,_0xbd63('0x3b'));}catch(_0x5dca0e){logger['error'](_0x5dca0e);}logger[_0xbd63('0x19')](_0xbd63('0x49'),_0x4cd529['split']('.')[0x0]);return _0x4cd529[_0xbd63('0x2c')]('.')[0x0];});};exports[_0xbd63('0x4a')]=function(_0x3c3f04,_0x441054,_0x12b57d){return google[_0xbd63('0x4b')](_0x3c3f04,_0x441054,_0x12b57d)['then'](function(_0x57e358){logger[_0xbd63('0x19')](_0x57e358[_0xbd63('0x4c')]);return rp(_0x57e358);})['then'](function(_0x2ffece){var _0x2c0aae='';var _0x61e44e=0x0;try{fs[_0xbd63('0x2a')](_0x3c3f04);}catch(_0x5344c1){logger[_0xbd63('0x13')](_0x5344c1);}if(_0x2ffece&&_0x2ffece[_0xbd63('0x4d')]){_0x2c0aae=_0x2ffece[_0xbd63('0x4d')][_0xbd63('0x4e')](function(_0x4e899a){return _0x4e899a&&_0x4e899a[_0xbd63('0x4f')][0x0]&&_0x4e899a[_0xbd63('0x4f')][0x0]['transcript']?_0x4e899a[_0xbd63('0x4f')][0x0]['transcript']:'';})[_0xbd63('0x50')]('\x0a');_0x61e44e=_0x2ffece[_0xbd63('0x4d')][_0xbd63('0x4e')](function(_0x4297e8){return _0x4297e8&&_0x4297e8[_0xbd63('0x4f')][0x0]&&_0x4297e8[_0xbd63('0x4f')][0x0][_0xbd63('0x51')]?_0x4297e8[_0xbd63('0x4f')][0x0][_0xbd63('0x51')]:0x0;})['join']('\x0a');}logger['info'](_0xbd63('0x52'),_0x2c0aae);logger['info']('googleASR\x20confidence',_0x61e44e);return{'transcript':_0x2c0aae,'confidence':_0x61e44e};})['catch'](function(_0x289778){logger[_0xbd63('0x13')](_0xbd63('0x53'),_0x289778[_0xbd63('0x16')],_0x289778['name'],_0x289778[_0xbd63('0x54')]);});};exports['googleDialogflow']=function(_0x56af47,_0xc72aa5,_0x20f5dd,_0x14092b){var _0x21b2c0=apiai(_0xc72aa5,{'language':_0x14092b||'en'});return _0x21b2c0['textRequest'](_0x20f5dd,{'sessionId':md5(_0x56af47)})['then'](function(_0x2689d5){logger['info'](JSON[_0xbd63('0x42')](_0x2689d5));return{'source':_0x2689d5[_0xbd63('0x55')][_0xbd63('0x56')],'resolvedQuery':_0x2689d5[_0xbd63('0x55')][_0xbd63('0x57')],'action':_0x2689d5[_0xbd63('0x55')][_0xbd63('0x58')],'actionIncomplete':_0x2689d5[_0xbd63('0x55')][_0xbd63('0x59')],'speech':_0x2689d5[_0xbd63('0x55')][_0xbd63('0x5a')]['speech'],'score':_0x2689d5[_0xbd63('0x55')]['score'],'statusCode':_0x2689d5['status']['code'],'endConversation':_0x2689d5['result'][_0xbd63('0x5b')]['endConversation']||![],'isFallbackIntent':_0x2689d5['result'][_0xbd63('0x5b')][_0xbd63('0x5c')]};});};exports[_0xbd63('0x5d')]=function(_0x1be058,_0x282bb1,_0x4dc988,_0x284385,_0x484674,_0x439da7){var _0x52ee1f=_0x284385[_0xbd63('0x5e')](/\\n/g,'\x0a');var _0x5974a8={'credentials':{'private_key':_0x52ee1f,'client_email':_0x4dc988}};var _0x11c724=new dialogflow[(_0xbd63('0x5f'))](_0x5974a8);var _0x4f11da=_0x11c724[_0xbd63('0x60')](_0x282bb1,md5(_0x1be058));var _0x46697b={'session':_0x4f11da,'queryInput':{'text':{'text':_0x484674,'languageCode':_0x439da7}}};return _0x11c724['detectIntent'](_0x46697b)[_0xbd63('0x29')](function(_0x2263ea){if(_0x2263ea&&_0x2263ea[_0xbd63('0x46')]){logger[_0xbd63('0x19')]('Dialogflow\x20V2\x20response:',JSON[_0xbd63('0x42')](_0x2263ea));var _0x394404=_0x2263ea[0x0];if(_0x394404){var _0x5e06c4={'action':_0x394404['queryResult']['action'],'allRequiredParamsPresent':_0x394404['queryResult'][_0xbd63('0x61')],'endConversation':_0x394404[_0xbd63('0x62')][_0xbd63('0x63')]&&_0x394404['queryResult']['diagnosticInfo'][_0xbd63('0x64')]?_0x394404['queryResult'][_0xbd63('0x63')][_0xbd63('0x64')][_0xbd63('0x65')][_0xbd63('0x66')]:![],'fulfillmentText':_0x394404['queryResult'][_0xbd63('0x67')],'intentName':_0x394404['queryResult'][_0xbd63('0x68')][_0xbd63('0x69')],'intentDisplayName':_0x394404[_0xbd63('0x62')][_0xbd63('0x68')][_0xbd63('0x6a')],'isFallbackIntent':_0x394404['queryResult']['intent']['isFallback'],'languageCode':_0x394404[_0xbd63('0x62')][_0xbd63('0x6b')],'queryText':_0x394404[_0xbd63('0x62')][_0xbd63('0x6c')],'responseId':_0x394404[_0xbd63('0x6d')],'score':_0x394404['queryResult'][_0xbd63('0x6e')],'speech':_0x394404[_0xbd63('0x62')][_0xbd63('0x67')],'providerResponse':JSON['stringify'](_0x2263ea)};return _0x5e06c4;}}});};exports[_0xbd63('0x6f')]=function(_0x3a19ea,_0x3859e4,_0x508031,_0x13b477){return tilde[_0xbd63('0x4b')](_0x3a19ea,_0x3859e4,_0x508031,_0x13b477)[_0xbd63('0x29')](function(_0x32cde0){try{fs[_0xbd63('0x2a')](_0x3a19ea);}catch(_0xb94705){logger[_0xbd63('0x13')](_0xb94705);}logger[_0xbd63('0x19')](_0xbd63('0x70'),_0x32cde0[_0xbd63('0x71')]);logger[_0xbd63('0x19')](_0xbd63('0x72'),_0x32cde0[_0xbd63('0x51')]);return _0x32cde0;});};exports['awsPolly']=function(_0x3f203a,_0x39480f,_0x2bb3e2,_0x2f6c12,_0x20be4d,_0x831884){var _0x3b88fd=path[_0xbd63('0x24')](__dirname,_0xbd63('0x25'),rs[_0xbd63('0x36')](0x4)+_0xbd63('0x37'));var _0x137bba;return aws[_0xbd63('0x73')](_0x3f203a,_0x39480f,_0x2bb3e2,_0x2f6c12,_0x20be4d,_0x831884,_0x3b88fd)[_0xbd63('0x29')](function(){_0x137bba=path[_0xbd63('0x24')](__dirname,_0xbd63('0x25'),rs[_0xbd63('0x36')](0x4)+'.wav');return convertFile(_0x3b88fd,_0x137bba);})['then'](function(){try{fs[_0xbd63('0x2a')](_0x3b88fd);fs[_0xbd63('0x2b')](_0x137bba,_0xbd63('0x3b'));}catch(_0x442d47){logger[_0xbd63('0x13')](_0x442d47);}return _0x137bba['split']('.')[0x0];});};exports[_0xbd63('0x74')]=function(_0x2480f7,_0x485150,_0x1c69c5,_0x3e722b,_0x264c9c,_0x4f4289){return aws[_0xbd63('0x75')](_0x2480f7,_0x485150,_0x1c69c5,_0x3e722b,_0x264c9c,_0x4f4289)['then'](function(_0x531bb8){logger[_0xbd63('0x19')](JSON[_0xbd63('0x42')](_0x531bb8));return _0x531bb8;});};exports[_0xbd63('0x76')]=function(_0x34129e,_0x46eb8c,_0x13eb4a,_0x3c1194){var _0x56fe54=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x34129e,encodeURIComponent(_0x46eb8c),_0x13eb4a,_0x3c1194);var _0x1955f7=path[_0xbd63('0x24')](__dirname,_0xbd63('0x25'),rs[_0xbd63('0x36')](0x4)+_0xbd63('0x37'));var _0x2683fe;return downloadFile(_0x56fe54,_0x1955f7)[_0xbd63('0x29')](function(){_0x2683fe=path['resolve'](__dirname,_0xbd63('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x1955f7,_0x2683fe);})['then'](function(){try{fs[_0xbd63('0x2a')](_0x1955f7);fs[_0xbd63('0x2b')](_0x2683fe,_0xbd63('0x3b'));}catch(_0x237e1c){logger['error'](_0x237e1c);}return _0x2683fe[_0xbd63('0x2c')]('.')[0x0];});};exports[_0xbd63('0x77')]=function(_0x59a78a,_0x4d3868,_0xe5b937,_0x3ce5c0){var _0x18f26a=util[_0xbd63('0x78')](_0xbd63('0x79'),ISPEECH_API,_0x4d3868,_0xe5b937,base64Encode(_0x59a78a),_0x3ce5c0?util['format'](_0xbd63('0x7a'),encodeURIComponent(_0x3ce5c0)):_0xbd63('0x7b'));return uploadFile(_0x18f26a)[_0xbd63('0x29')](function(_0x13fd79){return querystring['parse'](_0x13fd79);});};exports[_0xbd63('0x7c')]=function(_0x246053,_0xe2f7d5){return sestek[_0xbd63('0x7d')](_0x246053,_0xe2f7d5)[_0xbd63('0x29')](function(_0x260200){logger[_0xbd63('0x19')](JSON[_0xbd63('0x42')](_0x260200));var _0xe43c9f={'speech':_0x260200['text'],'action':_0x260200[_0xbd63('0x7e')]?_0x260200[_0xbd63('0x7e')][_0xbd63('0x7f')]:undefined,'actiondata':_0x260200['channelData']?_0x260200[_0xbd63('0x7e')][_0xbd63('0x80')]:undefined};if(_0x260200[_0xbd63('0x7e')]&&_0x260200[_0xbd63('0x7e')]['AudioFromTts']){return base64Decode(_0x260200[_0xbd63('0x7e')][_0xbd63('0x81')][_0xbd63('0x82')],path[_0xbd63('0x24')](__dirname,_0xbd63('0x25'),rs['generate'](0x4)+_0xbd63('0x26')))['then'](function(_0xf68dec){_0xe43c9f[_0xbd63('0x83')]=_0xf68dec;return _0xe43c9f;});}return _0xe43c9f;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
+var _0x93bf=['speech','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','dialogflow','http','https','path','querystring','sox','google-tts-api','url','parse','util','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','createWriteStream','finish','info','unlink','download\x20error','pipe','end','host','\x20failed,\x20status\x20code\x20=\x20','statusMessage','data','transcode','finish\x20to\x20convert','start','tmp','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','base64','ssml','input','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','resolve','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','textRequest','result','source','resolvedQuery','action','actionIncomplete'];(function(_0x3bb37f,_0x4f5102){var _0x3c2187=function(_0x202f67){while(--_0x202f67){_0x3bb37f['push'](_0x3bb37f['shift']());}};_0x3c2187(++_0x4f5102);}(_0x93bf,0x1c1));var _0xf93b=function(_0xc974ed,_0x387e2a){_0xc974ed=_0xc974ed-0x0;var _0x2522e3=_0x93bf[_0xc974ed];return _0x2522e3;};'use strict';var apiai=require(_0xf93b('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xf93b('0x1'));var fs=require('fs');var http=require(_0xf93b('0x2'));var https=require(_0xf93b('0x3'));var md5=require('md5');var path=require(_0xf93b('0x4'));var querystring=require(_0xf93b('0x5'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0xf93b('0x6'));var tts=require(_0xf93b('0x7'));var urlParse=require(_0xf93b('0x8'))[_0xf93b('0x9')];var util=require(_0xf93b('0xa'));var aws=require(_0xf93b('0xb'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0xf93b('0xc'));var logger=require(_0xf93b('0xd'))(_0xf93b('0xe'));var ISPEECH_API=_0xf93b('0xf');function downloadFile(_0x5e1a94,_0x3fb72b){return new BPromise(function(_0xd3c5e9,_0x50c31d){var _0x5777d0=urlParse(_0x5e1a94);var _0x437664=_0x5777d0[_0xf93b('0x10')]===_0xf93b('0x11')?https:http;var _0xbcc85e={'host':_0x5777d0['host'],'path':_0x5777d0['path'],'headers':{'user-agent':_0xf93b('0x12')}};_0x437664[_0xf93b('0x13')](_0xbcc85e,function(_0x1d69bf){if(_0x1d69bf[_0xf93b('0x14')]!==0xc8){logger[_0xf93b('0x15')](_0xf93b('0x16')+_0x5e1a94+'\x20failed,\x20status\x20code\x20=\x20'+_0x1d69bf[_0xf93b('0x14')]+'\x20('+_0x1d69bf['statusMessage']+')');_0x50c31d(new Error('request\x20to\x20'+_0x5e1a94+'\x20failed,\x20status\x20code\x20=\x20'+_0x1d69bf[_0xf93b('0x14')]+'\x20('+_0x1d69bf['statusMessage']+')'));return;}var _0x3a6697=fs[_0xf93b('0x17')](_0x3fb72b);_0x3a6697['on'](_0xf93b('0x18'),function(){logger[_0xf93b('0x19')]('finish\x20download\x20file');_0x3a6697['close'](_0xd3c5e9);});_0x3a6697['on'](_0xf93b('0x15'),function(_0x42a032){fs[_0xf93b('0x1a')](_0x3fb72b);logger[_0xf93b('0x15')](_0xf93b('0x1b'),_0x42a032);_0x50c31d(_0x42a032);});_0x1d69bf[_0xf93b('0x1c')](_0x3a6697);})['on']('error',function(_0x58237f){logger[_0xf93b('0x15')](_0x58237f);_0x50c31d(_0x58237f);})[_0xf93b('0x1d')]();});}function uploadFile(_0x55ffb4){return new BPromise(function(_0x4678e8,_0x269f94){var _0x251384=urlParse(_0x55ffb4);var _0x129871=_0x251384[_0xf93b('0x10')]==='https:'?https:http;var _0x50dc43={'host':_0x251384[_0xf93b('0x1e')],'path':_0x251384[_0xf93b('0x4')],'headers':{'user-agent':_0xf93b('0x12')}};_0x129871[_0xf93b('0x13')](_0x50dc43,function(_0x15c31c){if(_0x15c31c[_0xf93b('0x14')]!==0xc8){_0x269f94(new Error(_0xf93b('0x16')+_0x55ffb4+_0xf93b('0x1f')+_0x15c31c[_0xf93b('0x14')]+'\x20('+_0x15c31c[_0xf93b('0x20')]+')'));return;}var _0x1c8477='';_0x15c31c['on'](_0xf93b('0x21'),function(_0x2c4b21){_0x1c8477+=_0x2c4b21;});_0x15c31c['on'](_0xf93b('0x1d'),function(){_0x4678e8(_0x1c8477);});})['on']('error',function(_0x213042){_0x269f94(_0x213042);})[_0xf93b('0x1d')]();});}function convertFile(_0x5de578,_0x4a3b6f){return new BPromise(function(_0x308992,_0x251546){var _0xaa0c37=sox[_0xf93b('0x22')](_0x5de578,_0x4a3b6f,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xaa0c37['on']('error',function(_0x46dc8e){logger[_0xf93b('0x15')]('error\x20convert',_0x46dc8e);_0x251546(_0x46dc8e);});_0xaa0c37['on']('end',function(){logger[_0xf93b('0x19')](_0xf93b('0x23'));_0x308992();});_0xaa0c37[_0xf93b('0x24')]();});}function base64Decode(_0xdeb226,_0x3bc886){var _0x4c2639=path['resolve'](__dirname,_0xf93b('0x25'),rs['generate'](0x4)+_0xf93b('0x26'));fs[_0xf93b('0x27')](_0x4c2639,_0xdeb226,'base64');return convertFile(_0x4c2639,_0x3bc886)[_0xf93b('0x28')](function(){try{fs['unlink'](_0x4c2639);fs[_0xf93b('0x29')](_0x3bc886,_0xf93b('0x2a'));}catch(_0x4244eb){logger[_0xf93b('0x15')](_0x4244eb);}return _0x3bc886[_0xf93b('0x2b')]('.')[0x0];});}function base64Encode(_0x3e4a9e){var _0x4743d8=fs[_0xf93b('0x2c')](_0x3e4a9e);return new Buffer(_0x4743d8)[_0xf93b('0x2d')](_0xf93b('0x2e'));}exports['googleCloudTTS']=function(_0x2fb25c,_0x44f754,_0x2682c7,_0xae50b2,_0x3c861c,_0x3782ea){var _0x378cb0,_0x1389b3;var _0x4d1efd='https://texttospeech.googleapis.com/v1/';var _0x55d026='?key='+_0x2fb25c;var _0x18254a={};if(_0x44f754===_0xf93b('0x2f')){_0x18254a[_0xf93b('0x30')]={'ssml':_0x2682c7};}else{_0x18254a['input']={'text':_0x2682c7};};_0x18254a['voice']={'languageCode':_0xae50b2,'ssmlGender':_0x3c861c};_0x18254a['audioConfig']={'audioEncoding':_0xf93b('0x31'),'sampleRateHertz':0x1f40};var _0x2844c7={'url':_0x4d1efd+_0xf93b('0x32')+_0x55d026,'method':_0xf93b('0x33'),'json':!![],'body':_0x18254a};return rp(_0x2844c7)[_0xf93b('0x28')](function(_0x5db198){return new BPromise(function(_0x966817,_0x27482f){_0x378cb0=path['resolve'](__dirname,_0xf93b('0x25'),rs[_0xf93b('0x34')](0x4)+_0xf93b('0x35'));var _0x3778dc=Buffer[_0xf93b('0x36')](_0x5db198[_0xf93b('0x37')],'base64');return fs['writeFile'](_0x378cb0,_0x3778dc,function(_0x595ec9){_0x27482f(_0x595ec9);},function(_0x18bf1f){fs[_0xf93b('0x29')](_0x378cb0,_0xf93b('0x2a'));_0x966817(_0x18bf1f);});});})[_0xf93b('0x28')](function(_0x37b90e){_0x1389b3=path[_0xf93b('0x38')](__dirname,'tmp',rs[_0xf93b('0x34')](0x4)+_0xf93b('0x26'));return convertFile(_0x378cb0,_0x1389b3);})[_0xf93b('0x28')](function(){try{fs[_0xf93b('0x1a')](_0x378cb0);fs[_0xf93b('0x29')](_0x1389b3,_0xf93b('0x2a'));}catch(_0x36b004){logger['error'](_0x36b004);}logger[_0xf93b('0x19')](_0xf93b('0x39'),_0x1389b3[_0xf93b('0x2b')]('.')[0x0]);return _0x1389b3['split']('.')[0x0];});};exports[_0xf93b('0x3a')]=function(_0x4e2620,_0x373c51){var _0x2157a4=_0xf93b('0x3b');var _0x2db723,_0x3c9813;var _0x530f42;var _0x28c394={'encoding':_0xf93b('0x3c'),'method':_0xf93b('0x33'),'timeout':0x2710,'url':_0x2157a4,'headers':{'Content-Type':_0xf93b('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0xf93b('0x3e')]([[[_0xf93b('0x3f'),JSON[_0xf93b('0x3e')]([_0x4e2620,_0x373c51||'en',![],_0xf93b('0x40')]),null,_0xf93b('0x41')]]]))};return rp(_0x28c394)[_0xf93b('0x28')](function(_0x994ea2){try{_0x530f42=eval(_0x994ea2[_0xf93b('0x42')](0x5))[0x0][0x2];}catch(_0x44b646){throw new Error('parse\x20response\x20failed:\x0a'+_0x994ea2[_0xf93b('0x21')]);}if(!_0x530f42){if(_0x4e2620[_0xf93b('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xf93b('0x44')+_0x373c51+_0xf93b('0x45'));}}try{_0x530f42=eval(_0x530f42)[0x0];}catch(_0x826e5f){throw new Error(_0xf93b('0x46')+res[_0xf93b('0x21')]);}const _0x351495=_0x530f42;_0x2db723=path[_0xf93b('0x38')](__dirname,_0xf93b('0x25'),rs[_0xf93b('0x34')](0x4)+_0xf93b('0x35'));fs[_0xf93b('0x27')](_0x2db723,_0x530f42,{'encoding':'base64'});_0x3c9813=path['resolve'](__dirname,_0xf93b('0x25'),rs[_0xf93b('0x34')](0x4)+_0xf93b('0x26'));return convertFile(_0x2db723,_0x3c9813);})[_0xf93b('0x28')](function(){try{fs[_0xf93b('0x1a')](_0x2db723);fs['chmodSync'](_0x3c9813,_0xf93b('0x2a'));}catch(_0x330b1c){logger['error'](_0x330b1c);}logger['info'](_0xf93b('0x47'),_0x3c9813[_0xf93b('0x2b')]('.')[0x0]);return _0x3c9813[_0xf93b('0x2b')]('.')[0x0];});};exports['googleASR']=function(_0x55dd51,_0x34ac45,_0x4dade2){return google[_0xf93b('0x48')](_0x55dd51,_0x34ac45,_0x4dade2)[_0xf93b('0x28')](function(_0x5a98c2){logger[_0xf93b('0x19')](_0x5a98c2[_0xf93b('0x49')]);return rp(_0x5a98c2);})['then'](function(_0x3e9222){var _0x32682e='';var _0x2c03b3=0x0;try{fs['unlink'](_0x55dd51);}catch(_0x416f7c){logger[_0xf93b('0x15')](_0x416f7c);}if(_0x3e9222&&_0x3e9222[_0xf93b('0x4a')]){_0x32682e=_0x3e9222[_0xf93b('0x4a')]['map'](function(_0x442263){return _0x442263&&_0x442263['alternatives'][0x0]&&_0x442263[_0xf93b('0x4b')][0x0]['transcript']?_0x442263[_0xf93b('0x4b')][0x0][_0xf93b('0x4c')]:'';})[_0xf93b('0x4d')]('\x0a');_0x2c03b3=_0x3e9222[_0xf93b('0x4a')][_0xf93b('0x4e')](function(_0x373cd2){return _0x373cd2&&_0x373cd2[_0xf93b('0x4b')][0x0]&&_0x373cd2[_0xf93b('0x4b')][0x0][_0xf93b('0x4f')]?_0x373cd2[_0xf93b('0x4b')][0x0]['confidence']:0x0;})[_0xf93b('0x4d')]('\x0a');}logger['info'](_0xf93b('0x50'),_0x32682e);logger[_0xf93b('0x19')]('googleASR\x20confidence',_0x2c03b3);return{'transcript':_0x32682e,'confidence':_0x2c03b3};})[_0xf93b('0x51')](function(_0x180afd){logger['error'](_0xf93b('0x52'),_0x180afd['statusCode'],_0x180afd[_0xf93b('0x53')],_0x180afd[_0xf93b('0x54')]);});};exports['googleDialogflow']=function(_0x586e52,_0x53db86,_0x2d247d,_0x37508e){var _0x521626=apiai(_0x53db86,{'language':_0x37508e||'en'});return _0x521626[_0xf93b('0x55')](_0x2d247d,{'sessionId':md5(_0x586e52)})[_0xf93b('0x28')](function(_0x3d39ea){logger[_0xf93b('0x19')](JSON[_0xf93b('0x3e')](_0x3d39ea));return{'source':_0x3d39ea[_0xf93b('0x56')][_0xf93b('0x57')],'resolvedQuery':_0x3d39ea[_0xf93b('0x56')][_0xf93b('0x58')],'action':_0x3d39ea['result'][_0xf93b('0x59')],'actionIncomplete':_0x3d39ea[_0xf93b('0x56')][_0xf93b('0x5a')],'speech':_0x3d39ea[_0xf93b('0x56')]['fulfillment'][_0xf93b('0x5b')],'score':_0x3d39ea[_0xf93b('0x56')][_0xf93b('0x5c')],'statusCode':_0x3d39ea['status'][_0xf93b('0x5d')],'endConversation':_0x3d39ea['result'][_0xf93b('0x5e')][_0xf93b('0x5f')]||![],'isFallbackIntent':_0x3d39ea[_0xf93b('0x56')]['metadata'][_0xf93b('0x60')]};});};exports[_0xf93b('0x61')]=function(_0x250604,_0x236418,_0x5e819e,_0x219b1d,_0x24b33e,_0x4a6c33){var _0x4001db=_0x219b1d[_0xf93b('0x62')](/\\n/g,'\x0a');var _0x317f70={'credentials':{'private_key':_0x4001db,'client_email':_0x5e819e}};var _0x174b6c=new dialogflow[(_0xf93b('0x63'))](_0x317f70);var _0x2eadba=_0x174b6c[_0xf93b('0x64')](_0x236418,md5(_0x250604));var _0x458208={'session':_0x2eadba,'queryInput':{'text':{'text':_0x24b33e,'languageCode':_0x4a6c33}}};return _0x174b6c[_0xf93b('0x65')](_0x458208)[_0xf93b('0x28')](function(_0x511cfd){if(_0x511cfd&&_0x511cfd['length']){logger[_0xf93b('0x19')]('Dialogflow\x20V2\x20response:',JSON[_0xf93b('0x3e')](_0x511cfd));var _0x50a9c1=_0x511cfd[0x0];if(_0x50a9c1){var _0x5db862={'action':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x59')],'allRequiredParamsPresent':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x67')],'endConversation':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x68')]&&_0x50a9c1['queryResult']['diagnosticInfo'][_0xf93b('0x69')]?_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x68')][_0xf93b('0x69')]['end_conversation'][_0xf93b('0x6a')]:![],'fulfillmentText':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x6b')],'intentName':_0x50a9c1['queryResult'][_0xf93b('0x6c')][_0xf93b('0x53')],'intentDisplayName':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x6c')][_0xf93b('0x6d')],'isFallbackIntent':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x6c')][_0xf93b('0x6e')],'languageCode':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x6f')],'queryText':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x70')],'responseId':_0x50a9c1[_0xf93b('0x71')],'score':_0x50a9c1[_0xf93b('0x66')]['intentDetectionConfidence'],'speech':_0x50a9c1[_0xf93b('0x66')][_0xf93b('0x6b')],'providerResponse':JSON[_0xf93b('0x3e')](_0x511cfd)};return _0x5db862;}}});};exports[_0xf93b('0x72')]=function(_0x136dbe,_0x45fa5b,_0x38db84,_0x2ddd9b){return tilde[_0xf93b('0x48')](_0x136dbe,_0x45fa5b,_0x38db84,_0x2ddd9b)['then'](function(_0x5a7b3e){try{fs['unlink'](_0x136dbe);}catch(_0x4c44fc){logger[_0xf93b('0x15')](_0x4c44fc);}logger[_0xf93b('0x19')](_0xf93b('0x73'),_0x5a7b3e[_0xf93b('0x4c')]);logger['info'](_0xf93b('0x74'),_0x5a7b3e[_0xf93b('0x4f')]);return _0x5a7b3e;});};exports[_0xf93b('0x75')]=function(_0x5a8847,_0x400816,_0x4616d7,_0x5a31ae,_0x40f743,_0x59689c){var _0x214c71=path['resolve'](__dirname,'tmp',rs[_0xf93b('0x34')](0x4)+'.mp3');var _0x49da98;return aws[_0xf93b('0x76')](_0x5a8847,_0x400816,_0x4616d7,_0x5a31ae,_0x40f743,_0x59689c,_0x214c71)['then'](function(){_0x49da98=path[_0xf93b('0x38')](__dirname,_0xf93b('0x25'),rs['generate'](0x4)+_0xf93b('0x26'));return convertFile(_0x214c71,_0x49da98);})[_0xf93b('0x28')](function(){try{fs[_0xf93b('0x1a')](_0x214c71);fs['chmodSync'](_0x49da98,'777');}catch(_0x4cf2ed){logger['error'](_0x4cf2ed);}return _0x49da98[_0xf93b('0x2b')]('.')[0x0];});};exports[_0xf93b('0x77')]=function(_0x51e622,_0x9211d8,_0x5626b8,_0x1bf3b0,_0x56d586,_0x194cc0){return aws['lex'](_0x51e622,_0x9211d8,_0x5626b8,_0x1bf3b0,_0x56d586,_0x194cc0)[_0xf93b('0x28')](function(_0x3eccad){logger['info'](JSON[_0xf93b('0x3e')](_0x3eccad));return _0x3eccad;});};exports[_0xf93b('0x78')]=function(_0x1f6b8f,_0x5950aa,_0x37c214,_0x5394bf){var _0x4f5720=util[_0xf93b('0x79')](_0xf93b('0x7a'),ISPEECH_API,_0x1f6b8f,encodeURIComponent(_0x5950aa),_0x37c214,_0x5394bf);var _0x390698=path[_0xf93b('0x38')](__dirname,'tmp',rs[_0xf93b('0x34')](0x4)+_0xf93b('0x35'));var _0x32daaf;return downloadFile(_0x4f5720,_0x390698)[_0xf93b('0x28')](function(){_0x32daaf=path[_0xf93b('0x38')](__dirname,_0xf93b('0x25'),rs[_0xf93b('0x34')](0x4)+_0xf93b('0x26'));return convertFile(_0x390698,_0x32daaf);})[_0xf93b('0x28')](function(){try{fs[_0xf93b('0x1a')](_0x390698);fs[_0xf93b('0x29')](_0x32daaf,_0xf93b('0x2a'));}catch(_0x5a31f2){logger[_0xf93b('0x15')](_0x5a31f2);}return _0x32daaf[_0xf93b('0x2b')]('.')[0x0];});};exports[_0xf93b('0x7b')]=function(_0x3a5e10,_0x5af982,_0x2ccec8,_0x3ceea7){var _0x524a97=util[_0xf93b('0x79')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x5af982,_0x2ccec8,base64Encode(_0x3a5e10),_0x3ceea7?util['format'](_0xf93b('0x7c'),encodeURIComponent(_0x3ceea7)):_0xf93b('0x7d'));return uploadFile(_0x524a97)[_0xf93b('0x28')](function(_0x22fbfe){return querystring[_0xf93b('0x9')](_0x22fbfe);});};exports[_0xf93b('0x7e')]=function(_0x165257,_0x238f38){return sestek[_0xf93b('0x7f')](_0x165257,_0x238f38)['then'](function(_0x541d4f){logger[_0xf93b('0x19')](JSON[_0xf93b('0x3e')](_0x541d4f));var _0x56e7a0={'speech':_0x541d4f[_0xf93b('0x80')],'action':_0x541d4f[_0xf93b('0x81')]?_0x541d4f[_0xf93b('0x81')][_0xf93b('0x82')]:undefined,'actiondata':_0x541d4f[_0xf93b('0x81')]?_0x541d4f['channelData'][_0xf93b('0x83')]:undefined};if(_0x541d4f[_0xf93b('0x81')]&&_0x541d4f['channelData'][_0xf93b('0x84')]){return base64Decode(_0x541d4f[_0xf93b('0x81')]['AudioFromTts'][_0xf93b('0x85')],path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav'))[_0xf93b('0x28')](function(_0x269ad1){_0x56e7a0['audiofile']=_0x269ad1;return _0x56e7a0;});}return _0x56e7a0;});};exports[_0xf93b('0x86')]=function(){return __dirname;};
\ No newline at end of file
index 571d167..e2d3be4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd761=['./nda','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd761,0x88));var _0x1d76=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xd761[_0x4bacb6];return _0x58c029;};var nda=require(_0x1d76('0x0'));module[_0x1d76('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x5850=['exports'];(function(_0x272638,_0x42b993){var _0x19d027=function(_0x27ac44){while(--_0x27ac44){_0x272638['push'](_0x272638['shift']());}};_0x19d027(++_0x42b993);}(_0x5850,0x1dc));var _0x0585=function(_0x12f303,_0x5f4138){_0x12f303=_0x12f303-0x0;var _0x4cb533=_0x5850[_0x12f303];return _0x4cb533;};var nda=require('./nda');module[_0x0585('0x0')]={'nda':nda};
\ No newline at end of file
index 40685e9..0c34f80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39cb=['project','channelData','ProjectName','body','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token'];(function(_0x36ed2d,_0x2c03f4){var _0x4f9d86=function(_0x4d70be){while(--_0x4d70be){_0x36ed2d['push'](_0x36ed2d['shift']());}};_0x4f9d86(++_0x2c03f4);}(_0x39cb,0x1bd));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var rp=require('request-promise');var url=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('agi');module[_0xb39c('0x2')]=function(_0x3aacb4,_0x5bb582){var _0x412f1c={'method':_0xb39c('0x3'),'uri':url[_0xb39c('0x4')](_0x5bb582[_0xb39c('0x5')],_0xb39c('0x6')),'form':{'grant_type':'password','username':_0x5bb582[_0xb39c('0x7')],'password':_0x5bb582[_0xb39c('0x8')]},'json':!![]};return rp(_0x412f1c)[_0xb39c('0x9')](function(_0x3f2fbe){var _0x47d6d7={'method':'POST','uri':url[_0xb39c('0x4')](_0x5bb582[_0xb39c('0xa')],_0xb39c('0xb')),'body':{'type':_0x5bb582[_0xb39c('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x3aacb4['uniqueid']},'from':{'id':_0x3aacb4[_0xb39c('0xd')],'name':_0x3aacb4[_0xb39c('0xe')]},'recipient':{'id':_0x3aacb4[_0xb39c('0xf')],'name':_0x3aacb4[_0xb39c('0x10')]},'text':_0x5bb582[_0xb39c('0x11')],'channelData':{}},'headers':{'Authorization':_0xb39c('0x12')+_0x3f2fbe[_0xb39c('0x13')]},'json':!![]};if(_0x5bb582[_0xb39c('0x14')]){_0x47d6d7['body'][_0xb39c('0x15')][_0xb39c('0x16')]=_0x5bb582[_0xb39c('0x14')];}if(_0x5bb582['ndagenerate_audio']=='1'){_0x47d6d7[_0xb39c('0x17')][_0xb39c('0x15')][_0xb39c('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb39c('0x19')};}if(_0x5bb582[_0xb39c('0x1a')]){_0x47d6d7[_0xb39c('0x17')][_0xb39c('0x15')]['CustomAction']=_0x5bb582[_0xb39c('0x1a')];if(_0x5bb582[_0xb39c('0x1b')]){_0x47d6d7[_0xb39c('0x17')][_0xb39c('0x15')][_0xb39c('0x1c')]=_0x5bb582[_0xb39c('0x1b')];}}logger[_0xb39c('0x1d')](JSON[_0xb39c('0x1e')](_0x47d6d7));return rp(_0x47d6d7);});};
\ No newline at end of file
+var _0xe43c=['audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','dnid','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x29d849,_0x209ceb){var _0x30b104=function(_0x2a1669){while(--_0x2a1669){_0x29d849['push'](_0x29d849['shift']());}};_0x30b104(++_0x209ceb);}(_0xe43c,0x180));var _0xce43=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe43c[_0x199572];return _0x13cfa3;};'use strict';var rp=require(_0xce43('0x0'));var url=require(_0xce43('0x1'));var logger=require(_0xce43('0x2'))(_0xce43('0x3'));module[_0xce43('0x4')]=function(_0x357837,_0x5baedd){var _0x415941={'method':'POST','uri':url[_0xce43('0x5')](_0x5baedd[_0xce43('0x6')],_0xce43('0x7')),'form':{'grant_type':_0xce43('0x8'),'username':_0x5baedd['username'],'password':_0x5baedd[_0xce43('0x8')]},'json':!![]};return rp(_0x415941)['then'](function(_0x1cbd0b){var _0x5c4af2={'method':_0xce43('0x9'),'uri':url['resolve'](_0x5baedd['ndassistant_url'],_0xce43('0xa')),'body':{'type':_0x5baedd[_0xce43('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x357837['uniqueid']},'from':{'id':_0x357837[_0xce43('0xc')],'name':_0x357837['calleridname']},'recipient':{'id':_0x357837[_0xce43('0xd')],'name':_0x357837['extension']},'text':_0x5baedd[_0xce43('0xe')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1cbd0b[_0xce43('0xf')]},'json':!![]};if(_0x5baedd[_0xce43('0x10')]){_0x5c4af2[_0xce43('0x11')][_0xce43('0x12')][_0xce43('0x13')]=_0x5baedd[_0xce43('0x10')];}if(_0x5baedd[_0xce43('0x14')]=='1'){_0x5c4af2['body'][_0xce43('0x12')][_0xce43('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xce43('0x16')};}if(_0x5baedd[_0xce43('0x17')]){_0x5c4af2['body']['channelData'][_0xce43('0x18')]=_0x5baedd[_0xce43('0x17')];if(_0x5baedd[_0xce43('0x19')]){_0x5c4af2[_0xce43('0x11')][_0xce43('0x12')][_0xce43('0x1a')]=_0x5baedd['custom_action_data'];}}logger[_0xce43('0x1b')](JSON[_0xce43('0x1c')](_0x5c4af2));return rp(_0x5c4af2);});};
\ No newline at end of file
index 85b6431..0b6c30d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72e4=['./lib/api','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x72e4,0xae));var _0x472e=function(_0x4a65a7,_0x196d70){_0x4a65a7=_0x4a65a7-0x0;var _0x120e91=_0x72e4[_0x4a65a7];return _0x120e91;};'use strict';var asr=require(_0x472e('0x0'));module[_0x472e('0x1')]=function(_0x157971,_0x36a77a,_0x5ec72e,_0x1a438e){return asr(_0x157971,_0x36a77a,_0x5ec72e,_0x1a438e);};
\ No newline at end of file
+var _0x653b=['./lib/api','exports'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x653b,0x112));var _0xb653=function(_0x437abe,_0x3e33a8){_0x437abe=_0x437abe-0x0;var _0x51189b=_0x653b[_0x437abe];return _0x51189b;};'use strict';var asr=require(_0xb653('0x0'));module[_0xb653('0x1')]=function(_0x3d1947,_0x551daa,_0x598dea,_0x4f8159){return asr(_0x3d1947,_0x551daa,_0x598dea,_0x4f8159);};
\ No newline at end of file
index f76b2fc..c62dfa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e22=['stringify','createReadStream','data','close','EOS','error','terminate','status','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','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','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x0e22,0x1c3));var _0x20e2=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x0e22[_0x599e60];return _0x468e19;};'use strict';var BPromise=require(_0x20e2('0x0'));var _=require(_0x20e2('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x20e2('0x2'));var crypto=require(_0x20e2('0x3'));var logger=require(_0x20e2('0x4'))('agi');module[_0x20e2('0x5')]=function(_0x15eda1,_0x399059,_0x2b7b85,_0x58d04d){return new BPromise(function(_0x5dec18,_0x4ac155){logger['info'](_0x20e2('0x6'),_0x58d04d||_0x20e2('0x7'));var _0x3bd1da=new WebSocket(_0x58d04d||_0x20e2('0x7'),{'perMessageDeflate':![]});var _0x17f8d3='';var _0x2ed93b='0';var _0x41cebc='1';var _0x49025f=_0x20e2('0x8');function _0x30138e(_0x2acea2){var _0x1fe41c=crypto['createHash'](_0x20e2('0x9'));_0x1fe41c[_0x20e2('0xa')](_0x2acea2);return _0x1fe41c[_0x20e2('0xb')](_0x20e2('0xc'));}function _0x41face(){try{logger[_0x20e2('0xd')](_0x20e2('0xe'));var _0x372397=moment()[_0x20e2('0xf')]();var _0x5855b8=_0x30138e(_0x372397+_0x399059+_0x2b7b85);_0x3bd1da[_0x20e2('0x10')](JSON[_0x20e2('0x11')]({'appID':_0x399059,'timestamp':_0x372397,'appKey':_0x5855b8}));var _0x1d11dc=fs[_0x20e2('0x12')](_0x15eda1);_0x1d11dc['on'](_0x20e2('0x13'),function(_0x1cce58){_0x3bd1da[_0x20e2('0x10')](_0x1cce58);});_0x1d11dc['on'](_0x20e2('0x14'),function(){_0x3bd1da['send'](_0x20e2('0x15'));});}catch(_0x264f7e){logger[_0x20e2('0x16')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x264f7e));_0x3bd1da[_0x20e2('0x17')]();}}function _0x9ef5bb(_0x11dcf7){try{if(_0x11dcf7){var _0x4f336e=JSON['parse'](_0x11dcf7);switch(_0x4f336e[_0x20e2('0x18')]){case 0x0:if(_0x4f336e['result']){if(_0x4f336e['result']['final']){logger[_0x20e2('0xd')](_0x20e2('0x19'),JSON['stringify'](_0x4f336e[_0x20e2('0x1a')][_0x20e2('0x1b')]));_0x17f8d3=_0x4f336e['result'][_0x20e2('0x1b')][0x0][_0x20e2('0x1c')];_0x2ed93b=_0x4f336e[_0x20e2('0x1a')]['hypotheses'][0x0][_0x20e2('0x1d')];_0x41cebc='0';_0x49025f='Success.';_0x3bd1da[_0x20e2('0x17')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x41cebc='1';_0x49025f=_0x20e2('0x8');break;case 0x2:logger['info'](_0x20e2('0x1e'));_0x41cebc='2';_0x49025f=_0x20e2('0x1e');break;case 0x9:logger[_0x20e2('0xd')](_0x20e2('0x1f'));_0x41cebc='9';_0x49025f='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x20e2('0xd')]('Authentication\x20failed.');_0x41cebc='10';_0x49025f='Authentication\x20failed.';break;case 0xb:logger[_0x20e2('0xd')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x41cebc='11';_0x49025f=_0x20e2('0x20');}}}catch(_0xd8b7f9){logger['error'](_0x20e2('0x21'),JSON[_0x20e2('0x11')](_0xd8b7f9));_0x3bd1da[_0x20e2('0x17')]();}}function _0x4f1a7e(){logger['info'](_0x20e2('0x22'));_0x5dec18({'transcript':_0x17f8d3,'confidence':_0x2ed93b,'status':_0x41cebc,'status_message':_0x49025f});}function _0x456ab2(_0x48abc0){logger[_0x20e2('0x16')](_0x20e2('0x23'));if(!_['isNil'](_0x48abc0)){logger[_0x20e2('0x16')](_[_0x20e2('0x24')](_0x48abc0)?JSON['stringify'](_0x48abc0):_0x48abc0);}}_0x3bd1da['on'](_0x20e2('0x25'),_0x41face);_0x3bd1da['on'](_0x20e2('0x26'),_0x9ef5bb);_0x3bd1da['on'](_0x20e2('0x14'),_0x4f1a7e);_0x3bd1da['on']('error',_0x456ab2);});};
\ No newline at end of file
+var _0x5744=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','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','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x48643e,_0x2501e8){var _0x277c35=function(_0x528ac4){while(--_0x528ac4){_0x48643e['push'](_0x48643e['shift']());}};_0x277c35(++_0x2501e8);}(_0x5744,0x1b5));var _0x4574=function(_0x1dad23,_0x1e3735){_0x1dad23=_0x1dad23-0x0;var _0x340fb5=_0x5744[_0x1dad23];return _0x340fb5;};'use strict';var BPromise=require(_0x4574('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4574('0x1'));var crypto=require(_0x4574('0x2'));var logger=require(_0x4574('0x3'))(_0x4574('0x4'));module[_0x4574('0x5')]=function(_0x4efafd,_0x2338a9,_0x105086,_0x1ae07a){return new BPromise(function(_0x55bb56,_0x590fa6){logger[_0x4574('0x6')]('Tilde\x20URI',_0x1ae07a||_0x4574('0x7'));var _0x5b0167=new WebSocket(_0x1ae07a||_0x4574('0x7'),{'perMessageDeflate':![]});var _0x58bff2='';var _0x359c8a='0';var _0x409a70='1';var _0x43a417=_0x4574('0x8');function _0x347fa8(_0x14576){var _0x28bcde=crypto['createHash'](_0x4574('0x9'));_0x28bcde['update'](_0x14576);return _0x28bcde[_0x4574('0xa')](_0x4574('0xb'));}function _0x27cd00(){try{logger[_0x4574('0x6')](_0x4574('0xc'));var _0x2d3114=moment()[_0x4574('0xd')]();var _0x1052a4=_0x347fa8(_0x2d3114+_0x2338a9+_0x105086);_0x5b0167[_0x4574('0xe')](JSON[_0x4574('0xf')]({'appID':_0x2338a9,'timestamp':_0x2d3114,'appKey':_0x1052a4}));var _0x5aea1d=fs['createReadStream'](_0x4efafd);_0x5aea1d['on'](_0x4574('0x10'),function(_0x158a08){_0x5b0167[_0x4574('0xe')](_0x158a08);});_0x5aea1d['on'](_0x4574('0x11'),function(){_0x5b0167[_0x4574('0xe')]('EOS');});}catch(_0x10ca13){logger[_0x4574('0x12')](_0x4574('0x13'),JSON[_0x4574('0xf')](_0x10ca13));_0x5b0167[_0x4574('0x14')]();}}function _0x4e1917(_0x191e35){try{if(_0x191e35){var _0x336ef8=JSON[_0x4574('0x15')](_0x191e35);switch(_0x336ef8[_0x4574('0x16')]){case 0x0:if(_0x336ef8[_0x4574('0x17')]){if(_0x336ef8[_0x4574('0x17')][_0x4574('0x18')]){logger[_0x4574('0x6')](_0x4574('0x19'),JSON[_0x4574('0xf')](_0x336ef8['result'][_0x4574('0x1a')]));_0x58bff2=_0x336ef8[_0x4574('0x17')]['hypotheses'][0x0][_0x4574('0x1b')];_0x359c8a=_0x336ef8[_0x4574('0x17')][_0x4574('0x1a')][0x0]['likelihood'];_0x409a70='0';_0x43a417='Success.';_0x5b0167[_0x4574('0x14')]();}}break;case 0x1:logger[_0x4574('0x6')](_0x4574('0x8'));_0x409a70='1';_0x43a417=_0x4574('0x8');break;case 0x2:logger[_0x4574('0x6')](_0x4574('0x1c'));_0x409a70='2';_0x43a417=_0x4574('0x1c');break;case 0x9:logger[_0x4574('0x6')](_0x4574('0x1d'));_0x409a70='9';_0x43a417=_0x4574('0x1d');break;case 0xa:logger[_0x4574('0x6')](_0x4574('0x1e'));_0x409a70='10';_0x43a417=_0x4574('0x1e');break;case 0xb:logger[_0x4574('0x6')](_0x4574('0x1f'));_0x409a70='11';_0x43a417=_0x4574('0x1f');}}}catch(_0x74c83d){logger[_0x4574('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x4574('0xf')](_0x74c83d));_0x5b0167[_0x4574('0x14')]();}}function _0x8f08a7(){logger['info'](_0x4574('0x20'));_0x55bb56({'transcript':_0x58bff2,'confidence':_0x359c8a,'status':_0x409a70,'status_message':_0x43a417});}function _0x49ce6f(_0x5be217){logger[_0x4574('0x12')](_0x4574('0x21'));if(!_[_0x4574('0x22')](_0x5be217)){logger[_0x4574('0x12')](_['isObject'](_0x5be217)?JSON[_0x4574('0xf')](_0x5be217):_0x5be217);}}_0x5b0167['on'](_0x4574('0x23'),_0x27cd00);_0x5b0167['on']('message',_0x4e1917);_0x5b0167['on']('close',_0x8f08a7);_0x5b0167['on']('error',_0x49ce6f);});};
\ No newline at end of file
index e3f2b1c..e9acd51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7cd=['./asr'];(function(_0x68a64c,_0x4fa1e1){var _0x3acf1f=function(_0x1ae18e){while(--_0x1ae18e){_0x68a64c['push'](_0x68a64c['shift']());}};_0x3acf1f(++_0x4fa1e1);}(_0xf7cd,0x13b));var _0xdf7c=function(_0x5edaee,_0x21538a){_0x5edaee=_0x5edaee-0x0;var _0x432bc4=_0xf7cd[_0x5edaee];return _0x432bc4;};var asr=require(_0xdf7c('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0xfc06=['exports','./asr'];(function(_0x3609d1,_0x5ddcd7){var _0xc36caf=function(_0x1fceb0){while(--_0x1fceb0){_0x3609d1['push'](_0x3609d1['shift']());}};_0xc36caf(++_0x5ddcd7);}(_0xfc06,0x1b9));var _0x6fc0=function(_0x231928,_0x330ab7){_0x231928=_0x231928-0x0;var _0x2a777a=_0xfc06[_0x231928];return _0x2a777a;};var asr=require(_0x6fc0('0x0'));module[_0x6fc0('0x1')]={'asr':asr};
\ No newline at end of file
index 0132da4..324bb5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28ac=['destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','EventEmitter','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED'];(function(_0x4ad669,_0x4915e0){var _0x2c433b=function(_0x2130bd){while(--_0x2130bd){_0x4ad669['push'](_0x4ad669['shift']());}};_0x2c433b(++_0x4915e0);}(_0x28ac,0x1a0));var _0xc28a=function(_0x3f0743,_0xb3efb1){_0x3f0743=_0x3f0743-0x0;var _0x335a76=_0x28ac[_0x3f0743];return _0x335a76;};'use strict';var util=require(_0xc28a('0x0'));var net=require(_0xc28a('0x1'));var EventEmitter=require(_0xc28a('0x2'))[_0xc28a('0x3')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x5b923c,_0x571646,_0x1f7ef5){var _0x2d26bf=this,_0x5b923c=_0x5b923c||0x11dd,_0x571646=_0x571646||_0xc28a('0x4'),_0x528d4a=null,_0x9ec41b=0x0;EventEmitter[_0xc28a('0x5')](_0x2d26bf);function _0x4c16a4(){if(!_0x5b923c){_0x2d26bf[_0xc28a('0x6')]('error',new AGIError(_0xc28a('0x7')));return![];}_0x528d4a=net[_0xc28a('0x8')]();_0x528d4a[_0xc28a('0x9')](_0x5b923c,_0x571646);_0x528d4a['on'](_0xc28a('0xa'),function(){_0x2d26bf[_0xc28a('0x6')](_0xc28a('0xa'));});_0x528d4a['on'](_0xc28a('0xb'),function(_0x1381bc){_0x528d4a[_0xc28a('0xc')](function(_0x487607,_0x360d11){if(_0x487607){_0x2d26bf[_0xc28a('0x6')](_0xc28a('0xd'),new AGIError(_0xc28a('0xe'),_0x487607));}else if(_0x1f7ef5&&_0x1f7ef5<0x0){_0x2d26bf['emit'](_0xc28a('0xd'),new AGIError(_0xc28a('0xf')));_0x1381bc[_0xc28a('0x10')]();}else if(_0x1f7ef5&&_0x1f7ef5>0x0&&_0x1f7ef5<_0x360d11){_0x9ec41b+=0x1;_0x2d26bf[_0xc28a('0x6')]('error',new AGIError(_0xc28a('0x11'),_0x9ec41b));_0x1381bc[_0xc28a('0x10')]();}else{var _0x19d3dc=new AGIChannel(_0x1381bc);_0x19d3dc['on'](_0xc28a('0x12'),function(){_0x2d26bf[_0xc28a('0x6')](_0xc28a('0xb'),_0x19d3dc);});}});});_0x528d4a['on']('error',function(_0x2940e5){_0x2d26bf['emit'](_0xc28a('0xd'),new AGIError(_0xc28a('0xe'),_0x2940e5[_0xc28a('0x13')]));});_0x528d4a['on']('close',function(){_0x2d26bf[_0xc28a('0x6')](_0xc28a('0x14'),new AGIError(_0xc28a('0x15')));});}process['nextTick'](function(){_0x4c16a4();});};util[_0xc28a('0x16')](AGIServer,EventEmitter);module[_0xc28a('0x17')]=function(_0x28fc22,_0x26f835,_0x56f792){return new AGIServer(_0x28fc22,_0x26f835,_0x56f792);};
\ No newline at end of file
+var _0x70c8=['127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','EventEmitter','./channel'];(function(_0x185adc,_0x2ec27e){var _0x2a1516=function(_0x632166){while(--_0x632166){_0x185adc['push'](_0x185adc['shift']());}};_0x2a1516(++_0x2ec27e);}(_0x70c8,0x194));var _0x870c=function(_0x534dee,_0x24c2ad){_0x534dee=_0x534dee-0x0;var _0x13ff11=_0x70c8[_0x534dee];return _0x13ff11;};'use strict';var util=require(_0x870c('0x0'));var net=require('net');var EventEmitter=require(_0x870c('0x1'))[_0x870c('0x2')];var AGIError=require('./error');var AGIChannel=require(_0x870c('0x3'));var AGIServer=function(_0x35c10b,_0x1d1c41,_0x4ff57e){var _0x44d2d8=this,_0x35c10b=_0x35c10b||0x11dd,_0x1d1c41=_0x1d1c41||_0x870c('0x4'),_0x527cd3=null,_0x50a5bc=0x0;EventEmitter[_0x870c('0x5')](_0x44d2d8);function _0x5bb297(){if(!_0x35c10b){_0x44d2d8[_0x870c('0x6')](_0x870c('0x7'),new AGIError(_0x870c('0x8')));return![];}_0x527cd3=net[_0x870c('0x9')]();_0x527cd3[_0x870c('0xa')](_0x35c10b,_0x1d1c41);_0x527cd3['on'](_0x870c('0xb'),function(){_0x44d2d8[_0x870c('0x6')]('listening');});_0x527cd3['on'](_0x870c('0xc'),function(_0x3fa0a1){_0x527cd3[_0x870c('0xd')](function(_0x1d8372,_0x46985f){if(_0x1d8372){_0x44d2d8[_0x870c('0x6')](_0x870c('0x7'),new AGIError(_0x870c('0xe'),_0x1d8372));}else if(_0x4ff57e&&_0x4ff57e<0x0){_0x44d2d8[_0x870c('0x6')](_0x870c('0x7'),new AGIError(_0x870c('0xf')));_0x3fa0a1[_0x870c('0x10')]();}else if(_0x4ff57e&&_0x4ff57e>0x0&&_0x4ff57e<_0x46985f){_0x50a5bc+=0x1;_0x44d2d8[_0x870c('0x6')](_0x870c('0x7'),new AGIError(_0x870c('0x11'),_0x50a5bc));_0x3fa0a1[_0x870c('0x10')]();}else{var _0x246cd5=new AGIChannel(_0x3fa0a1);_0x246cd5['on']('ready',function(){_0x44d2d8[_0x870c('0x6')]('connection',_0x246cd5);});}});});_0x527cd3['on'](_0x870c('0x7'),function(_0x313047){_0x44d2d8['emit'](_0x870c('0x7'),new AGIError(_0x870c('0xe'),_0x313047[_0x870c('0x12')]));});_0x527cd3['on'](_0x870c('0x13'),function(){_0x44d2d8[_0x870c('0x6')]('close',new AGIError(_0x870c('0x14')));});}process[_0x870c('0x15')](function(){_0x5bb297();});};util[_0x870c('0x16')](AGIServer,EventEmitter);module[_0x870c('0x17')]=function(_0x3ab809,_0x54f018,_0x6b2534){return new AGIServer(_0x3ab809,_0x54f018,_0x6b2534);};
\ No newline at end of file
index 3f2cd0d..5300a5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d93=['keys','%s[%s][%s]','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogout','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','isArray','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','email','subject','template_id','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','unlink','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getTrunk','getSound','getSoundById','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','text','restAPI','url','method','timeout','number','POST','PUT','parse','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','render','stringify','body','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','appid','appsecret','clear','includes','agicommand','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','length','isString','replaceAllVariables','saveRestApiResult','format','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_INPUT()','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach'];(function(_0x5f21d5,_0x18caf4){var _0x5866ad=function(_0x21da19){while(--_0x21da19){_0x5f21d5['push'](_0x5f21d5['shift']());}};_0x5866ad(++_0x18caf4);}(_0x2d93,0xf3));var _0x32d9=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0x2d93[_0x4a5494];return _0x57cbb5;};'use strict';var fs=require('fs');var util=require(_0x32d9('0x0'));var _=require(_0x32d9('0x1'));var sh=require(_0x32d9('0x2'));var odbc=require(_0x32d9('0x3'))();var rs=require(_0x32d9('0x4'));var moment=require(_0x32d9('0x5'));var Mustache=require(_0x32d9('0x6'));var rp=require(_0x32d9('0x7'));var logger=require(_0x32d9('0x8'))(_0x32d9('0x9'));var config=require(_0x32d9('0xa'));var shared=require(_0x32d9('0xb'));var scripts=require(_0x32d9('0xc'));var FILES_PATH=_0x32d9('0xd');var recursiveMapAttributes=['rawHeaders',_0x32d9('0xe')];var verticesWithRetry=[_0x32d9('0xf'),_0x32d9('0x10'),_0x32d9('0x11')];var AGIVertices=function(_0x2b5cc7,_0x521d15,_0x21df58){this[_0x32d9('0x12')]=_0x2b5cc7;this[_0x32d9('0x13')]=_0x521d15;this[_0x32d9('0x14')]=_0x21df58;};AGIVertices[_0x32d9('0x15')][_0x32d9('0x16')]=function(_0x3475ee,_0x3383a8){this[_0x32d9('0x13')][_0x32d9('0x17')](_0x3475ee)[_0x32d9('0x18')](function(_0x5b7bab){_0x3383a8(null,_0x5b7bab?_0x5b7bab['name']:![]);})[_0x32d9('0x19')](function(_0x3ae057){_0x3383a8(_0x3ae057);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x1a')]=function(_0x460eb9,_0x3b1d99){this[_0x32d9('0x13')][_0x32d9('0x1b')](_0x460eb9)[_0x32d9('0x18')](function(_0x453e20){_0x3b1d99(null,_0x453e20?_0x453e20[_0x32d9('0x1c')]:![]);})[_0x32d9('0x19')](function(_0x5ebcab){_0x3b1d99(_0x5ebcab);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x1d')]=function(_0x558d64,_0x24ab70){this[_0x32d9('0x13')][_0x32d9('0x1e')](_0x558d64)[_0x32d9('0x18')](function(_0xd3e7a3){_0x24ab70(null,_0xd3e7a3?_0xd3e7a3[_0x32d9('0x1c')]:![]);})[_0x32d9('0x19')](function(_0x1f61f3){_0x24ab70(_0x1f61f3);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x1f')]=function(_0x543607,_0x599bdc){this[_0x32d9('0x13')][_0x32d9('0x20')](_0x543607)['then'](function(_0x13f8b0){_0x599bdc(null,_0x13f8b0?_0x13f8b0['dsn']:![]);})[_0x32d9('0x19')](function(_0x298cb6){_0x599bdc(_0x298cb6);});};AGIVertices['prototype']['getUser']=function(_0x3e2ef3,_0xcd2cec){this['rpc']['getUserById'](_0x3e2ef3)[_0x32d9('0x18')](function(_0x4162bc){_0xcd2cec(null,_0x4162bc?_0x4162bc[_0x32d9('0x1c')]:![]);})[_0x32d9('0x19')](function(_0x3cb824){_0xcd2cec(_0x3cb824);});};AGIVertices['prototype'][_0x32d9('0x21')]=function(_0x1c51a8,_0x19932f){this[_0x32d9('0x13')]['getTrunkById'](_0x1c51a8)[_0x32d9('0x18')](function(_0xbf0d48){_0x19932f(null,_0xbf0d48?_0xbf0d48[_0x32d9('0x1c')]:![]);})['catch'](function(_0x40644b){_0x19932f(_0x40644b);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x22')]=function(_0xca2f14,_0x5bd3f3){var _0xc5e7e8=this;this[_0x32d9('0x13')][_0x32d9('0x23')](_0xca2f14)[_0x32d9('0x18')](function(_0x5c3486){_0x5bd3f3(null,_0x5c3486?_0xc5e7e8['getSoundPath'](_0x5c3486['save_name']):![]);})[_0x32d9('0x19')](function(_0x174ee3){_0x5bd3f3(_0x174ee3);});};AGIVertices[_0x32d9('0x15')]['getMailAccount']=function(_0x272449,_0xda0f8f){this['rpc'][_0x32d9('0x24')](_0x272449)[_0x32d9('0x18')](function(_0x1b0dfb){_0xda0f8f(null,_0x1b0dfb?_0x1b0dfb:![]);})[_0x32d9('0x19')](function(_0x43faa1){_0xda0f8f(_0x43faa1);});};AGIVertices['prototype'][_0x32d9('0x25')]=function(_0xf73fc5,_0x28f5c6,_0x1dc799){this['mailRpc'][_0x32d9('0x25')](_0xf73fc5,_0x28f5c6)['then'](function(){_0x1dc799(null);})[_0x32d9('0x19')](function(_0x44f318){_0x1dc799(_0x44f318);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x26')]=function(_0x24a93e,_0x245787){this[_0x32d9('0x13')][_0x32d9('0x27')](_0x24a93e)[_0x32d9('0x18')](function(_0x4de7eb){if(_0x4de7eb){if(_0x4de7eb[_0x32d9('0x28')]){_0x245787(null,[_0x4de7eb[_0x32d9('0x29')]]);}else{_0x245787(null,_[_0x32d9('0x2a')](_0x4de7eb[_0x32d9('0x2b')],_0x32d9('0x29')));}}else{_0x245787(null,![]);}})[_0x32d9('0x19')](function(_0x14d21f){_0x245787(_0x14d21f);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x2c')]=function(_0x1f51d1){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x1f51d1);};AGIVertices[_0x32d9('0x15')][_0x32d9('0x2d')]=function(_0x27e7d8,_0x115911,_0x3844ef){odbc[_0x32d9('0x2e')](_0x27e7d8,function(_0x2b883f){if(_0x2b883f){logger[_0x32d9('0x2f')](_0x32d9('0x30'),_0x2b883f);_0x3844ef(_0x2b883f);}else{logger[_0x32d9('0x31')]('ODBC\x20connection\x20successfully');odbc[_0x32d9('0x32')](_0x115911,function(_0x484772,_0x5bd260){if(_0x484772){logger[_0x32d9('0x31')](_0x32d9('0x33'),_0x115911);_0x3844ef(_0x484772);}else{logger['info'](_0x32d9('0x34'),_0x115911);odbc['close'](function(_0x359727){if(_0x359727){logger[_0x32d9('0x2f')](_0x32d9('0x35'),_0x359727);}_0x3844ef(null,_0x5bd260);});}});}});};AGIVertices['prototype'][_0x32d9('0x36')]=function(_0x4175b5,_0x2649d8){this[_0x32d9('0x13')][_0x32d9('0x37')](_0x4175b5)[_0x32d9('0x18')](function(_0x5ee27f){_0x2649d8(null,_0x5ee27f?_0x5ee27f:![]);})[_0x32d9('0x19')](function(_0x5eabdb){_0x2649d8(_0x5eabdb);});};AGIVertices['prototype'][_0x32d9('0x38')]=function(_0x2bcec0,_0x4f2c56){this[_0x32d9('0x13')][_0x32d9('0x38')](_0x2bcec0)[_0x32d9('0x18')](function(_0x261c27){_0x4f2c56(null,_0x261c27);})['catch'](function(_0x4b1fea){_0x4f2c56(_0x4b1fea);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x39')]=function(_0x12c469,_0x389721,_0x3ec2fd){this[_0x32d9('0x13')][_0x32d9('0x39')]({'uniqueid':this[_0x32d9('0x12')][_0x32d9('0x3a')],'node':_0x12c469[_0x32d9('0x3b')],'application':_0x12c469['agicommand'],'data':_0x389721||null,'project_name':this[_0x32d9('0x12')]['arg_1'],'callerid':this[_0x32d9('0x12')][_0x32d9('0x3c')]})[_0x32d9('0x18')](function(_0x5698bd){if(_0x3ec2fd){_0x3ec2fd(null,_0x5698bd);}})['catch'](function(_0x4f6139){if(_0x3ec2fd){_0x3ec2fd(_0x4f6139);}});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x3d')]=function(_0x5676d1,_0x9b3211,_0x5e0484,_0x2443d4){this['rpc'][_0x32d9('0x3d')]({'uniqueid':this[_0x32d9('0x12')][_0x32d9('0x3a')],'callerid':this[_0x32d9('0x12')][_0x32d9('0x3c')],'calleridname':this['channel'][_0x32d9('0x3e')],'context':this[_0x32d9('0x12')][_0x32d9('0x3f')],'extension':this['channel'][_0x32d9('0x40')],'priority':this[_0x32d9('0x12')][_0x32d9('0x41')],'accountcode':this[_0x32d9('0x12')][_0x32d9('0x42')],'dnid':this['channel'][_0x32d9('0x43')],'projectName':this[_0x32d9('0x12')][_0x32d9('0x44')],'saveName':_0x9b3211,'filename':_0x5676d1[_0x32d9('0x45')]||_0x9b3211,'savePath':_0x5e0484})['then'](function(_0x506c22){_0x2443d4(null,_0x506c22);})[_0x32d9('0x19')](function(_0x9d223){_0x2443d4(_0x9d223);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x46')]=function(_0x26959d,_0x2af548,_0x474090,_0x32aa5d,_0x4d468e){this[_0x32d9('0x13')][_0x32d9('0x46')]({'uniqueid':this[_0x32d9('0x12')]['uniqueid'],'body':_0x26959d,'direction':_0x2af548,'providerName':_0x474090,'providerResponse':_0x32aa5d})['then'](function(_0x19bbbb){if(_0x4d468e){_0x4d468e(null,_0x19bbbb);}})[_0x32d9('0x19')](function(_0x3706b9){if(_0x4d468e){_0x4d468e(_0x3706b9);}});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x47')]=function(_0x452923,_0x5b1650){this['rpc'][_0x32d9('0x47')]({'firstName':_[_0x32d9('0x48')](_0x452923['name'])||_[_0x32d9('0x49')](_0x452923[_0x32d9('0x1c')])?'callback_'+Math[_0x32d9('0x4a')]():_0x452923[_0x32d9('0x1c')],'lastName':_[_0x32d9('0x48')](_0x452923[_0x32d9('0x4b')])||_[_0x32d9('0x49')](_0x452923[_0x32d9('0x4b')])?null:_0x452923['lastName'],'phone':_0x452923[_0x32d9('0x4c')],'ListId':_0x452923[_0x32d9('0x4d')],'scheduledat':_0x452923[_0x32d9('0x4e')],'callbackUniqueid':this[_0x32d9('0x12')][_0x32d9('0x3a')],'tags':'callback','description':_0x32d9('0x4f')+_0x452923[_0x32d9('0x4e')][_0x32d9('0x50')](),'priority':_0x452923[_0x32d9('0x51')]})[_0x32d9('0x18')](function(_0x238fca){_0x5b1650(null,_0x238fca);})[_0x32d9('0x19')](function(_0x5cdd9a){_0x5b1650(_0x5cdd9a);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x52')]=function(_0x38e76b,_0x32649a){this['rpc']['getPauseById'](_0x38e76b)[_0x32d9('0x18')](function(_0x18d580){_0x32649a(null,_0x18d580?_0x18d580[_0x32d9('0x1c')]:![]);})[_0x32d9('0x19')](function(_0x557506){_0x32649a(_0x557506);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x53')]=function(_0x5930dd,_0x116355,_0x55b2eb){var _0x5dfe71={'role':_0x32d9('0x54')};_0x5dfe71[_0x5930dd]=this[_0x32d9('0x12')][_0x32d9('0x3c')];this[_0x32d9('0x13')]['agentPause'](_0x5dfe71,_0x116355,this[_0x32d9('0x12')][_0x32d9('0x3a')])['then'](function(_0x543f06){_0x55b2eb(null,_[_0x32d9('0x49')](_0x543f06)?![]:!![]);})[_0x32d9('0x19')](function(_0x423f4d){logger['error'](_0x423f4d);_0x55b2eb(null,![]);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x55')]=function(_0x3be14a,_0x43dee9){var _0x306739={'role':_0x32d9('0x54')};_0x306739[_0x3be14a]=this['channel'][_0x32d9('0x3c')];this[_0x32d9('0x13')]['agentUnpause'](_0x306739)['then'](function(_0x303508){_0x43dee9(null,_[_0x32d9('0x49')](_0x303508)?![]:!![]);})[_0x32d9('0x19')](function(_0x87165a){logger[_0x32d9('0x2f')](_0x87165a);_0x43dee9(null,![]);});};AGIVertices[_0x32d9('0x15')]['agentLogout']=function(_0x437e19,_0x1baeff){var _0xdc3e50={'role':_0x32d9('0x54')};_0xdc3e50[_0x437e19]=this['channel'][_0x32d9('0x3c')];this[_0x32d9('0x13')]['agentLogout'](_0xdc3e50)['then'](function(_0x26081c){_0x1baeff(null,_[_0x32d9('0x49')](_0x26081c)?![]:!![]);})[_0x32d9('0x19')](function(_0x17f450){logger['error'](_0x17f450);_0x1baeff(null,![]);});};AGIVertices['prototype'][_0x32d9('0x56')]=function(_0xf0460b,_0x155e98){var _0x517d86={'role':_0x32d9('0x54')};_0x517d86[_0xf0460b]=this[_0x32d9('0x12')][_0x32d9('0x3c')];var _0x4848e4=_0xf0460b!=_0x32d9('0x57')?util['format'](_0x32d9('0x58'),_0x32d9('0x59'),this[_0x32d9('0x12')]['callerid']):undefined;this['rpc'][_0x32d9('0x56')](_0x517d86,_0x4848e4)[_0x32d9('0x18')](function(_0x571bb4){_0x155e98(null,_[_0x32d9('0x49')](_0x571bb4)?![]:!![]);})[_0x32d9('0x19')](function(_0x17e95e){logger['error'](_0x17e95e);_0x155e98(null,![]);});};AGIVertices[_0x32d9('0x15')]['shellCommand']=function(_0x250bea,_0x53113b){sh[_0x32d9('0x5a')](_[_0x32d9('0x5b')](_0x250bea),function(_0x53ca35,_0x510ffc){var _0x38dbb0=_0x510ffc[_0x32d9('0x5c')](/(\r\n|\n|\r)/gm,'');_0x53113b(null,_0x38dbb0);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x5d')]=function(_0x35abfd,_0x43098c){scripts[_0x32d9('0x5d')](_0x35abfd[_0x32d9('0x5e')],_0x35abfd[_0x32d9('0x5f')]||'text',_0x35abfd['text'],_0x35abfd[_0x32d9('0x60')]||_0x32d9('0x61'),_0x35abfd[_0x32d9('0x62')]||_0x32d9('0x63'),_0x35abfd[_0x32d9('0x64')]||_0x32d9('0x65'))[_0x32d9('0x18')](function(_0x539675){_0x43098c(null,_0x539675);})[_0x32d9('0x19')](function(_0x3c17b1){_0x43098c(_0x3c17b1);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x66')]=function(_0x44bc2e,_0x3e544b){scripts[_0x32d9('0x66')](_0x44bc2e[_0x32d9('0x67')],_0x44bc2e['google_tts_language']||'en',0x1)[_0x32d9('0x18')](function(_0x53a216){_0x3e544b(null,_0x53a216);})['catch'](function(_0x185a23){_0x3e544b(_0x185a23);});};AGIVertices['prototype'][_0x32d9('0x68')]=function(_0x44849d,_0x3ae27e){var _0x1381a6={'uri':_0x44849d[_0x32d9('0x69')],'method':_0x44849d[_0x32d9('0x6a')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x44849d[_0x32d9('0x6b')])===_0x32d9('0x6c')&&parseInt(_0x44849d['timeout'])>=0x1?parseInt(_0x44849d[_0x32d9('0x6b')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x32d9('0x6d'),_0x32d9('0x6e')],_0x1381a6['method']['toUpperCase']())){try{_0x1381a6['body']=_0x44849d[_0x32d9('0xe')]?JSON['parse'](_0x44849d[_0x32d9('0xe')]):{};}catch(_0x554a36){logger[_0x32d9('0x2f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x554a36);}}try{_0x1381a6['headers']=_0x44849d['rawHeaders']?JSON[_0x32d9('0x6f')](_0x44849d[_0x32d9('0x70')]):{};}catch(_0x5e99b5){logger[_0x32d9('0x2f')](_0x32d9('0x71'),_0x5e99b5);}if(_0x44849d['computedVariables']){try{var _0x25def4=require(_0x44849d[_0x32d9('0x72')])[_0x32d9('0x73')](this,_0x1381a6);_0x1381a6[_0x32d9('0x74')]=Mustache['render'](_0x44849d[_0x32d9('0x69')],_0x25def4,{},['$$','$$']);if(_0x1381a6[_0x32d9('0x75')]){_0x1381a6[_0x32d9('0x75')]=JSON[_0x32d9('0x6f')](Mustache[_0x32d9('0x76')](JSON[_0x32d9('0x77')](_0x1381a6[_0x32d9('0x75')]),_0x25def4,{},['$$','$$']));}if(_0x1381a6[_0x32d9('0x78')]){_0x1381a6['body']=JSON[_0x32d9('0x6f')](Mustache['render'](JSON['stringify'](_0x1381a6['body']),_0x25def4,{},['$$','$$']));}}catch(_0x4b341f){logger[_0x32d9('0x2f')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4b341f);}}rp(_0x1381a6)[_0x32d9('0x18')](function(_0x12b96a){var _0x23d2f2={'statusCode':_0x12b96a[_0x32d9('0x79')]||0xc8,'statusMessage':_0x12b96a[_0x32d9('0x7a')]||'OK','headers':_0x12b96a[_0x32d9('0x75')]||{},'body':_0x12b96a[_0x32d9('0x78')]||{}};_0x3ae27e(null,_0x23d2f2);})[_0x32d9('0x19')](function(_0x5cd2cb){var _0x4058e9={'statusCode':_0x5cd2cb['statusCode']||0x1f4,'statusMessage':_0x5cd2cb[_0x32d9('0x7b')]||_0x32d9('0x7c'),'headers':_0x5cd2cb[_0x32d9('0x7d')][_0x32d9('0x75')]||{},'body':_0x5cd2cb[_0x32d9('0x7d')]['body']||{}};_0x3ae27e(null,_0x4058e9);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x7e')]=function(_0x110a7d,_0x448285){scripts[_0x32d9('0x7e')](this[_0x32d9('0x12')][_0x32d9('0x3a')],_0x110a7d['key'],_0x110a7d[_0x32d9('0x67')],_0x110a7d[_0x32d9('0x7f')]||'en')[_0x32d9('0x18')](function(_0x3bbf8a){_0x448285(null,_0x3bbf8a);})[_0x32d9('0x19')](function(_0x37b109){_0x448285(_0x37b109);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x80')]=function(_0xb7595a,_0x286dbb){scripts[_0x32d9('0x80')](this[_0x32d9('0x12')][_0x32d9('0x3a')],_0xb7595a[_0x32d9('0x81')],_0xb7595a[_0x32d9('0x82')],_0xb7595a[_0x32d9('0x83')],_0xb7595a[_0x32d9('0x67')],_0xb7595a['dialogflowV2_language']||'en')[_0x32d9('0x18')](function(_0x2cb03b){_0x286dbb(null,_0x2cb03b);})[_0x32d9('0x19')](function(_0x9cee35){_0x286dbb(_0x9cee35);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x84')]=function(_0xf0979,_0x592f86){scripts[_0x32d9('0x84')](this['channel'],_0xf0979)[_0x32d9('0x18')](function(_0x78fcbf){_0x592f86(null,_0x78fcbf);})[_0x32d9('0x19')](function(_0x51fc9b){_0x592f86(_0x51fc9b);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x85')]=function(_0x4e3a23,_0x1bb3c8){scripts[_0x32d9('0x85')](_0x4e3a23[_0x32d9('0x86')],_0x4e3a23[_0x32d9('0x67')],_0x4e3a23[_0x32d9('0x87')]||_0x32d9('0x61'),_0x4e3a23[_0x32d9('0x88')])[_0x32d9('0x18')](function(_0x4678d8){_0x1bb3c8(null,_0x4678d8);})[_0x32d9('0x19')](function(_0xc713d3){_0x1bb3c8(_0xc713d3);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x89')]=function(_0x18160a,_0x293693,_0x529c1a){scripts[_0x32d9('0x89')](_0x293693,_0x18160a[_0x32d9('0x86')],_0x18160a[_0x32d9('0x8a')]||_0x32d9('0x61'),this['isConfigured'](_0x18160a[_0x32d9('0x8b')])?_0x18160a[_0x32d9('0x8b')]:undefined)[_0x32d9('0x18')](function(_0x3bf891){_0x529c1a(null,_0x3bf891);})[_0x32d9('0x19')](function(_0x4541ac){_0x529c1a(_0x4541ac);});};AGIVertices['prototype'][_0x32d9('0x8c')]=function(_0x15ef59,_0x5bdb90){scripts['awsPolly'](_0x15ef59[_0x32d9('0x8d')],_0x15ef59[_0x32d9('0x8e')],_0x15ef59[_0x32d9('0x8f')],_0x15ef59['aws_polly_voice']||_0x32d9('0x90'),_0x15ef59[_0x32d9('0x67')],_0x15ef59[_0x32d9('0x91')]||_0x32d9('0x67'))[_0x32d9('0x18')](function(_0x89c0e8){_0x5bdb90(null,_0x89c0e8);})[_0x32d9('0x19')](function(_0x4dda60){_0x5bdb90(_0x4dda60);});};AGIVertices[_0x32d9('0x15')]['awsLex']=function(_0x4c2e38,_0x18a3d3){scripts[_0x32d9('0x92')](this['channel']['uniqueid'],_0x4c2e38[_0x32d9('0x8d')],_0x4c2e38[_0x32d9('0x8e')],_0x4c2e38[_0x32d9('0x93')],_0x4c2e38['text'],_0x4c2e38[_0x32d9('0x94')])[_0x32d9('0x18')](function(_0x4262c0){_0x18a3d3(null,_0x4262c0);})[_0x32d9('0x19')](function(_0x32b011){_0x18a3d3(_0x32b011);});};AGIVertices[_0x32d9('0x15')]['googleASR']=function(_0xaa266f,_0x443a16,_0x1fa63b){scripts['googleASR'](_0x443a16,_0xaa266f[_0x32d9('0x86')],_0xaa266f[_0x32d9('0x95')]||'en-US')['then'](function(_0x11a2e7){_0x1fa63b(null,_0x11a2e7);})[_0x32d9('0x19')](function(_0x2940bf){_0x1fa63b(_0x2940bf);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x96')]=function(_0x461071,_0x22a102,_0x2d5e76){scripts[_0x32d9('0x96')](_0x22a102,_0x461071[_0x32d9('0x97')],_0x461071[_0x32d9('0x98')],_0x461071[_0x32d9('0x74')])[_0x32d9('0x18')](function(_0xaed866){_0x2d5e76(null,_0xaed866);})[_0x32d9('0x19')](function(_0xa2bf72){_0x2d5e76(_0xa2bf72);});};AGIVertices[_0x32d9('0x15')][_0x32d9('0x99')]=function(_0x184ba2){var _0x3add4b=_[_0x32d9('0x9a')](verticesWithRetry,_0x184ba2[_0x32d9('0x9b')])?_0x184ba2:_['clone'](_0x184ba2);for(var _0x460e82 in _0x3add4b){if(_0x3add4b[_0x32d9('0x9c')](_0x460e82)){if(_0x3add4b[_0x460e82]&&_['isString'](_0x3add4b[_0x460e82])){if(_[_0x32d9('0x9a')](recursiveMapAttributes,_0x460e82)){_0x3add4b[_0x460e82]=this[_0x32d9('0x9d')](_0x3add4b[_0x460e82]);}else{_0x3add4b[_0x460e82]=this['replaceAllVariables'](_0x3add4b[_0x460e82]);}}}}return _0x3add4b;};AGIVertices['prototype'][_0x32d9('0x9e')]=function(_0x1c3646){for(var _0x36d678 in _0x1c3646){if(_0x1c3646[_0x32d9('0x9c')](_0x36d678)){if(_['isPlainObject'](_0x1c3646[_0x36d678])){this['recursiveNodeIndex'](_0x1c3646[_0x36d678]);}else if(_['isArray'](_0x1c3646[_0x36d678])){for(var _0x43104e=0x0;_0x43104e<_0x1c3646[_0x36d678][_0x32d9('0x9f')];_0x43104e++){this['recursiveNodeIndex'](_0x1c3646[_0x36d678][_0x43104e]);}}else if(_[_0x32d9('0xa0')](_0x1c3646[_0x36d678])){_0x1c3646[_0x36d678]=this[_0x32d9('0xa1')](_0x1c3646[_0x36d678]);}}}};AGIVertices[_0x32d9('0x15')]['saveRestApiResult']=function(_0xbb663c,_0x5438d4){for(var _0x289908 in _0xbb663c){if(_0xbb663c[_0x32d9('0x9c')](_0x289908)){if(_['isPlainObject'](_0xbb663c[_0x289908])){if(!_['isEmpty'](_0xbb663c[_0x289908])){this[_0x32d9('0xa2')](_0xbb663c[_0x289908],util[_0x32d9('0xa3')](_0x32d9('0xa4'),_0x5438d4,_0x289908));}}else if(_['isArray'](_0xbb663c[_0x289908])){for(var _0x5f4ce1=0x0;_0x5f4ce1<_0xbb663c[_0x289908][_0x32d9('0x9f')];_0x5f4ce1++){this[_0x32d9('0xa2')](_0xbb663c[_0x289908][_0x5f4ce1],util[_0x32d9('0xa3')](_0x32d9('0xa4'),_0x5438d4,_0x289908+'['+_0x5f4ce1+']'));}}else{if(!_[_0x32d9('0x49')](_0xbb663c[_0x289908])){this[_0x32d9('0x12')][_0x32d9('0xa5')](util[_0x32d9('0xa3')](_0x32d9('0xa4'),_0x5438d4,_0x289908),_0xbb663c[_0x289908]);}}}}};AGIVertices[_0x32d9('0x15')][_0x32d9('0x9d')]=function(_0x120522){try{var _0x1609bf=JSON[_0x32d9('0x6f')](_0x120522);this[_0x32d9('0x9e')](_0x1609bf);return JSON[_0x32d9('0x77')](_0x1609bf);}catch(_0x2cc779){return this[_0x32d9('0xa1')](_0x120522);}};AGIVertices[_0x32d9('0x15')][_0x32d9('0xa1')]=function(_0x964910){var _0x51b008=_0x964910['split']('{');for(var _0x36da10=0x1;_0x36da10<_0x51b008[_0x32d9('0x9f')];_0x36da10+=0x1){var _0x1ebfe3=_0x51b008[_0x36da10][_0x32d9('0xa6')]('}');if(_0x1ebfe3['length']>0x1){_0x964910=_0x964910[_0x32d9('0xa7')]('{'+_0x1ebfe3[0x0]+'}',this['channel'][_0x32d9('0x16')](_0x1ebfe3[0x0])[_0x32d9('0xa8')]||_0x1ebfe3[0x0]);}}if(_0x51b008[_0x32d9('0x9f')]===0x1){return _0x964910['toString']();}return this[_0x32d9('0xa1')](_0x964910);};AGIVertices['prototype'][_0x32d9('0xa9')]=function(_0x527290,_0x38d93d){var _0x336548=this['channel'][_0x32d9('0x16')](_0x527290);if(_0x336548[_0x32d9('0xaa')]===-0x1){return _0x336548;}logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0xab'),_0x38d93d,_0x336548[_0x32d9('0xa8')]));return this[_0x32d9('0x12')][_0x32d9('0xa5')](_0x38d93d,_0x336548['extra']);};AGIVertices[_0x32d9('0x15')][_0x32d9('0xac')]=function(_0x5503cf){return _0x5503cf&&_0x5503cf!=='0'&&_0x5503cf!=='-1'&&_0x5503cf!=='';};AGIVertices['prototype'][_0x32d9('0xad')]=function(_0x491b24){this[_0x32d9('0x39')]['sync'](this,_0x491b24,'-');_0x491b24['retry']=_0x491b24[_0x32d9('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x32d9('0x15')][_0x32d9('0xae')]=function(_0x418e77){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0xaf'),_0x418e77[_0x32d9('0x3b')]));if(!this['isConfigured'](_0x418e77[_0x32d9('0x67')])){return this['channel'][_0x32d9('0xb0')](_0x32d9('0xb1'));}var _0x1f449d='\x22'+_0x418e77[_0x32d9('0x67')]+'\x22';if(this[_0x32d9('0xac')](_0x418e77[_0x32d9('0x7d')])){_0x1f449d+=','+_0x418e77[_0x32d9('0x7d')];}var _0x24997a=this[_0x32d9('0x12')][_0x32d9('0x5a')](_0x32d9('0xb2'),_0x1f449d);if(_0x24997a[_0x32d9('0xaa')]===-0x1){return _0x24997a;}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0xb3'),_0x1f449d));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xb4')]=function(_0x55150e){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0xb5'),_0x55150e[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x55150e[_0x32d9('0xb6')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xb7'));}var _0x1fd1f8=_0x55150e[_0x32d9('0xb6')];if(this['isConfigured'](_0x55150e[_0x32d9('0x7d')])){_0x1fd1f8+=','+_0x55150e['options'];}var _0x3460e8=this[_0x32d9('0x12')][_0x32d9('0x5a')](_0x32d9('0xb8'),_0x1fd1f8);if(_0x3460e8['result']===-0x1){return _0x3460e8;}var _0x3f870a=this['getAndSetVariable'](_0x32d9('0xb9'),_0x32d9('0xba'));if(_0x3f870a['result']===-0x1){return _0x3f870a;}var _0x346b71=this['getAndSetVariable']('RECOG_INPUT()',_0x32d9('0xbb'));if(_0x346b71['result']===-0x1){return _0x346b71;}var _0x1d343c=this[_0x32d9('0xa9')]('RECOG_INSTANCE()',_0x32d9('0xbc'));if(_0x1d343c[_0x32d9('0xaa')]===-0x1){return _0x1d343c;}return this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1fd1f8));};AGIVertices[_0x32d9('0x15')][_0x32d9('0x9')]=function(_0x103a3d){logger['info'](util[_0x32d9('0xa3')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x103a3d[_0x32d9('0x3b')]));return this[_0x32d9('0x12')][_0x32d9('0x9')]([_0x103a3d[_0x32d9('0xbd')],_0x103a3d[_0x32d9('0xbe')]]);};AGIVertices[_0x32d9('0x15')]['answer']=function(_0x3818af){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0xbf'),_0x3818af[_0x32d9('0x3b')]));if(this['isConfigured'](_0x3818af['timeout'])){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0xc0'),_0x3818af[_0x32d9('0x6b')]));var _0x5d7773=this[_0x32d9('0x12')][_0x32d9('0xc1')](_0x3818af[_0x32d9('0x6b')]);if(_0x5d7773[_0x32d9('0xaa')]===-0x1){return _0x5d7773;}}return this[_0x32d9('0x12')][_0x32d9('0xc2')]();};AGIVertices['prototype'][_0x32d9('0xc3')]=function(_0x39d4fe){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0xc4'),_0x39d4fe[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x39d4fe['list_id'])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x39d4fe,'no\x20list\x20selected');}_0x39d4fe['scheduledAt']=moment();if(this[_0x32d9('0xac')](_0x39d4fe['delay'])){_0x39d4fe[_0x32d9('0x4e')]=moment()['add'](_0x39d4fe[_0x32d9('0xc5')],'minutes');}if(!this['isConfigured'](_0x39d4fe[_0x32d9('0x51')])){_0x39d4fe[_0x32d9('0x51')]=0x2;}this[_0x32d9('0x47')][_0x32d9('0x73')](this,_0x39d4fe);return this[_0x32d9('0x12')][_0x32d9('0xb0')](util['format'](_0x32d9('0xc6'),_0x39d4fe['phone'],_0x39d4fe[_0x32d9('0x4d')],_0x39d4fe[_0x32d9('0x4e')]));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xc7')]=function(_0x48986b){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0xc8'),_0x48986b['label']));var _0x216f5c=this['channel'][_0x32d9('0x5a')](_0x48986b[_0x32d9('0xc9')],_0x48986b['options']);if(_0x216f5c['result']===-0x1){return _0x216f5c;}return this[_0x32d9('0x12')]['noop'](util['format'](_0x32d9('0xca'),_0x48986b['application'],_0x48986b[_0x32d9('0x7d')]));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xcb')]=function(_0x3bb690){logger['info'](util[_0x32d9('0xa3')](_0x32d9('0xcc'),_0x3bb690[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x3bb690['text'])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xb1'));}var _0x156ff8='\x22'+_0x3bb690[_0x32d9('0x67')]+'\x22';if(this[_0x32d9('0xac')](_0x3bb690[_0x32d9('0x7d')])){_0x156ff8+=','+_0x3bb690['options'];}var _0x439933=this['channel'][_0x32d9('0x5a')](_0x32d9('0xb2'),_0x156ff8);if(_0x439933[_0x32d9('0xaa')]===-0x1){return _0x439933;}return this[_0x32d9('0x12')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x156ff8));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xcd')]=function(_0x20f65b){logger[_0x32d9('0x31')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x20f65b['label']));if(!this[_0x32d9('0xac')](_0x20f65b[_0x32d9('0x67')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xb1'));}var _0x5f3b00='\x22'+_0x20f65b[_0x32d9('0x67')]+'\x22';if(this['isConfigured'](_0x20f65b[_0x32d9('0x7d')])){_0x5f3b00+=','+_0x20f65b[_0x32d9('0x7d')];}var _0x116fb3=this[_0x32d9('0x12')]['exec'](_0x32d9('0xb2'),_0x5f3b00);if(_0x116fb3[_0x32d9('0xaa')]===-0x1){return _0x116fb3;}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0xb3'),_0x5f3b00));};AGIVertices[_0x32d9('0x15')]['lumenvoxasr']=function(_0x19cb5a){logger['info'](util[_0x32d9('0xa3')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x19cb5a[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x19cb5a[_0x32d9('0xb6')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')]('no\x20grammar\x20configured');}var _0x9c1555=_0x19cb5a[_0x32d9('0xb6')];if(this[_0x32d9('0xac')](_0x19cb5a[_0x32d9('0x7d')])){_0x9c1555+=','+_0x19cb5a[_0x32d9('0x7d')];}var _0x4d5fbf=this[_0x32d9('0x12')][_0x32d9('0x5a')]('MRCPRecog',_0x9c1555);if(_0x4d5fbf[_0x32d9('0xaa')]===-0x1){return _0x4d5fbf;}var _0x57f2d5=this[_0x32d9('0xa9')](_0x32d9('0xb9'),_0x32d9('0xce'));if(_0x57f2d5['result']===-0x1){return _0x57f2d5;}var _0x17f3f2=this[_0x32d9('0xa9')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x17f3f2[_0x32d9('0xaa')]===-0x1){return _0x17f3f2;}var _0x48c006=this[_0x32d9('0xa9')](_0x32d9('0xcf'),_0x32d9('0xd0'));if(_0x48c006[_0x32d9('0xaa')]===-0x1){return _0x48c006;}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0xd1'),_0x9c1555));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xd2')]=function(_0x4dc463){logger['info'](util[_0x32d9('0xa3')](_0x32d9('0xd3'),_0x4dc463['label']));if(!this[_0x32d9('0xac')](_0x4dc463[_0x32d9('0xb6')])){return this[_0x32d9('0x12')]['noop'](_0x32d9('0xb7'));}var _0x1ba7fc=_0x4dc463[_0x32d9('0xb6')];if(this[_0x32d9('0xac')](_0x4dc463['options'])){_0x1ba7fc+=','+_0x4dc463[_0x32d9('0x7d')];}var _0x46dffc=this['channel'][_0x32d9('0x5a')](_0x32d9('0xb8'),_0x1ba7fc);if(_0x46dffc[_0x32d9('0xaa')]===-0x1){return _0x46dffc;}var _0x509293=this[_0x32d9('0xa9')](_0x32d9('0xb9'),'SESTEK_ASR_CONFIDENCE');if(_0x509293[_0x32d9('0xaa')]===-0x1){return _0x509293;}var _0x3bc9c2=this['getAndSetVariable'](_0x32d9('0xd4'),'SESTEK_ASR_TRANSCRIPT');if(_0x3bc9c2['result']===-0x1){return _0x3bc9c2;}var _0x4129b3=this[_0x32d9('0xa9')](_0x32d9('0xcf'),'SESTEK_ASR_INSTANCE');if(_0x4129b3[_0x32d9('0xaa')]===-0x1){return _0x4129b3;}return this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1ba7fc));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xd5')]=function(_0xfb35e8){logger['info'](util[_0x32d9('0xa3')](_0x32d9('0xd6'),_0xfb35e8[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0xfb35e8[_0x32d9('0xd7')])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0xfb35e8,_0x32d9('0xd8'));}var _0x387094=this['getSquareOdbc'][_0x32d9('0x73')](this,_0xfb35e8[_0x32d9('0xd7')]);if(!_0x387094){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0xfb35e8,'no\x20odbc\x20database\x20found');}if(!this[_0x32d9('0xac')](_0xfb35e8[_0x32d9('0x32')])){return this['channel'][_0x32d9('0x2f')](_0xfb35e8,_0x32d9('0xd9'));}var _0x358a1b=_0xfb35e8[_0x32d9('0x32')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format'](_0x32d9('0xda'),_0x358a1b));var _0x530fd8=this['getQueryOdbc'][_0x32d9('0x73')](this,_0x387094,_0x358a1b);this['createSquareDetailsReport'][_0x32d9('0x73')](this,_0xfb35e8,_0x358a1b);if(!this[_0x32d9('0xac')](_0xfb35e8[_0x32d9('0xdb')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xdc'));}var _0x1d39da=this['getVariable'][_0x32d9('0x73')](this,_0xfb35e8[_0x32d9('0xdb')]);if(!_0x1d39da){return this[_0x32d9('0x12')]['error'](_0xfb35e8,_0x32d9('0xdd'));}var _0x189020=this;_0x530fd8[_0x32d9('0xde')](function(_0x3c627b,_0x4ae314){Object[_0x32d9('0xdf')](_0x3c627b)[_0x32d9('0xde')](function(_0x51196a){_0x189020['channel'][_0x32d9('0xa5')](util[_0x32d9('0xa3')](_0x32d9('0xe0'),_0x1d39da,_0x4ae314,_0x51196a),_0x3c627b[_0x51196a]);});});this[_0x32d9('0x12')][_0x32d9('0xa5')](util[_0x32d9('0xa3')]('%s_ROWS_COUNT',_0x1d39da),_0x530fd8['length']);return this[_0x32d9('0x12')]['noop'](util[_0x32d9('0xa3')]('variable\x20%s\x20set',_0x1d39da));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xe1')]=function(_0x164db2){logger[_0x32d9('0xe2')](util[_0x32d9('0xa3')](_0x32d9('0xe3'),_0x164db2[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x164db2[_0x32d9('0xe4')])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x164db2,_0x32d9('0xe5'));}var _0x3aaf4a=this[_0x32d9('0xe6')][_0x32d9('0x73')](this,_0x164db2[_0x32d9('0xe4')]);if(!_0x3aaf4a){return this['channel'][_0x32d9('0x2f')](_0x164db2,_0x32d9('0xe7'));}var _0x1b3887=this['channel'][_0x32d9('0x5a')](_0x32d9('0xe8'),[util[_0x32d9('0xa3')](_0x32d9('0xe9'),_0x3aaf4a),_0x164db2[_0x32d9('0x6b')],_0x164db2[_0x32d9('0xea')],_0x164db2[_0x32d9('0x69')]]);if(_0x1b3887[_0x32d9('0xaa')]===-0x1){return _0x1b3887;}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0xeb'),_0x32d9('0xe8')));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xec')]=function(_0x192dc6){logger[_0x32d9('0x31')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x192dc6[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x192dc6[_0x32d9('0x86')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xed'));}if(!this['isConfigured'](_0x192dc6[_0x32d9('0x67')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')]('no\x20text\x20configured');}this[_0x32d9('0x12')][_0x32d9('0xee')]=!![];this[_0x32d9('0x39')](_0x192dc6);this['createSquareMessage'](_0x192dc6[_0x32d9('0x67')],'in','','');this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0xef'),_0x192dc6[_0x32d9('0x67')]));var _0x20f8ae=this[_0x32d9('0x7e')][_0x32d9('0x73')](this,_0x192dc6);if(_0x20f8ae){for(var _0x579ff9 in _0x20f8ae){if(_0x20f8ae['hasOwnProperty'](_0x579ff9)){this[_0x32d9('0x12')]['setVariable'](util['format'](_0x32d9('0xf0'),_0x579ff9[_0x32d9('0xf1')]()),_0x20f8ae[_0x579ff9]);}}this[_0x32d9('0x46')](_0x20f8ae[_0x32d9('0xf2')],'out',_0x32d9('0xec'),'');return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')]('Dialogflow\x20Result\x20%s',_0x20f8ae[_0x32d9('0xf2')]));}return this[_0x32d9('0x12')]['error'](_0x192dc6,_0x32d9('0xf3'));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xf4')]=function(_0x32521c){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0xf5'),_0x32521c[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x32521c[_0x32d9('0x81')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xf6'));}if(!this[_0x32d9('0xac')](_0x32521c[_0x32d9('0x82')])){return this['channel'][_0x32d9('0xb0')](_0x32d9('0xf7'));}if(!this['isConfigured'](_0x32521c[_0x32d9('0x83')])){return this[_0x32d9('0x12')]['noop'](_0x32d9('0xf8'));}if(!this[_0x32d9('0xac')](_0x32521c['dialogflowV2_language'])){return this['channel'][_0x32d9('0xb0')](_0x32d9('0xf9'));}if(!this[_0x32d9('0xac')](_0x32521c[_0x32d9('0x67')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x32d9('0x12')][_0x32d9('0xee')]=!![];this[_0x32d9('0x39')](_0x32521c);this[_0x32d9('0x46')](_0x32521c[_0x32d9('0x67')],'in','','');this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0xfa'),_0x32521c[_0x32d9('0x67')]));var _0x475591=this[_0x32d9('0x80')]['sync'](this,_0x32521c);if(_0x475591){for(var _0x307564 in _0x475591){if(_0x475591[_0x32d9('0x9c')](_0x307564)){if(_0x307564!==_0x32d9('0xfb')){this['channel'][_0x32d9('0xa5')](util[_0x32d9('0xa3')]('DIALOGFLOW_%s',_0x307564[_0x32d9('0xf1')]()),_0x475591[_0x307564]);}}}this[_0x32d9('0x46')](_0x475591[_0x32d9('0xf2')],_0x32d9('0xfc'),_0x32d9('0xf4'),_0x475591[_0x32d9('0xfb')]);return this[_0x32d9('0x12')][_0x32d9('0xb0')](util['format'](_0x32d9('0xfd'),_0x475591['speech']));}return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x32521c,_0x32d9('0xfe'));};AGIVertices[_0x32d9('0x15')][_0x32d9('0xff')]=function(_0x374550){logger['info'](util['format'](_0x32d9('0x100'),_0x374550['label']));if(!this[_0x32d9('0xac')](_0x374550[_0x32d9('0x101')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0x102'));}if(!this[_0x32d9('0xac')](_0x374550[_0x32d9('0x103')])){return this[_0x32d9('0x12')]['noop'](_0x32d9('0x104'));}if(!this[_0x32d9('0xac')](_0x374550[_0x32d9('0x105')])){return this['channel'][_0x32d9('0xb0')](_0x32d9('0x106'));}if(!this[_0x32d9('0xac')](_0x374550[_0x32d9('0x107')])){return this[_0x32d9('0x12')]['noop'](_0x32d9('0xb1'));}this['channel'][_0x32d9('0xee')]=!![];this[_0x32d9('0x39')](_0x374550);this[_0x32d9('0x46')](_0x374550[_0x32d9('0x67')],'in','','');this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x108'),_0x374550['text']));var _0x478181=this[_0x32d9('0x84')][_0x32d9('0x73')](this,_0x374550);if(_0x478181){for(var _0x27f6ab in _0x478181){if(_0x478181[_0x32d9('0x9c')](_0x27f6ab)){this['channel'][_0x32d9('0xa5')](util['format'](_0x32d9('0x109'),_0x27f6ab[_0x32d9('0xf1')]()),_0x478181[_0x27f6ab]);}}this[_0x32d9('0x46')](_0x478181[_0x32d9('0xf2')],_0x32d9('0xfc'),'sesteknda','');if(_0x478181[_0x32d9('0x10a')]){this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x478181[_0x32d9('0x10a')]));var _0x368ede=this[_0x32d9('0x12')][_0x32d9('0x10b')](_0x478181[_0x32d9('0x10a')]);try{fs['unlink'](_0x478181[_0x32d9('0x10a')]+'.wav');}catch(_0x53d31d){logger['error'](_0x53d31d);}return _0x368ede;}else{return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x10c'),_0x478181[_0x32d9('0xf2')]));}}return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x374550,_0x32d9('0x10d'));};AGIVertices['prototype']['end']=function(_0x1973ea){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')]('Enter\x20in\x20END\x20(%s)\x20block',_0x1973ea['label']));return this[_0x32d9('0x12')][_0x32d9('0xb0')]('end');};AGIVertices[_0x32d9('0x15')][_0x32d9('0x10e')]=function(_0xc24b1){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x10f'),_0xc24b1[_0x32d9('0x3b')]));var _0x2533ec='';if(_0xc24b1['trunk_id']){if(!this['isConfigured'](_0xc24b1[_0x32d9('0x110')])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0xc24b1,_0x32d9('0x111'));}else{var _0x56f406=parseInt(_0xc24b1['trunk_id'],0xa);if(isNaN(_0x56f406)){_0x2533ec=_0xc24b1[_0x32d9('0x110')];}else{_0x2533ec=this[_0x32d9('0x21')][_0x32d9('0x73')](this,_0xc24b1[_0x32d9('0x110')]);if(!_0x2533ec){return this['channel'][_0x32d9('0x2f')](_0xc24b1,_0x32d9('0x112'));}}}}else if(_0xc24b1['trunk_name']){_0x2533ec=_0xc24b1['trunk_name'];}else{return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0xc24b1,_0x32d9('0x111'));}var _0x4bb67c=this[_0x32d9('0x12')][_0x32d9('0x5a')]('DIAL',[util[_0x32d9('0xa3')](_0x32d9('0x113'),_0x2533ec,_0xc24b1[_0x32d9('0x4c')]),_0xc24b1[_0x32d9('0x6b')],_0xc24b1[_0x32d9('0xea')],_0xc24b1['url']]);if(_0x4bb67c['result']===-0x1){return _0x4bb67c;}return this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0xeb'),'DIAL'));};AGIVertices[_0x32d9('0x15')][_0x32d9('0x114')]=function(_0x15391e){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x115'),_0x15391e[_0x32d9('0x3b')]));return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0x114'));};AGIVertices[_0x32d9('0x15')][_0x32d9('0x10')]=function(_0x771191){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x116'),_0x771191[_0x32d9('0x3b')]));if(_0x771191[_0x32d9('0x117')]===0x0){return this['maxRetry'](_0x771191);}_0x771191[_0x32d9('0x117')]-=0x1;if(!this[_0x32d9('0xac')](_0x771191['file_id'])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x771191,_0x32d9('0x118'));}var _0x2d0683=this[_0x32d9('0x22')][_0x32d9('0x73')](this,_0x771191[_0x32d9('0x119')]);if(!_0x2d0683){return this['channel'][_0x32d9('0x2f')](_0x771191,'no\x20file\x20audio\x20found');}if(!this[_0x32d9('0xac')](_0x771191[_0x32d9('0xdb')])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x32d9('0xdc'));}var _0x2c6385=this[_0x32d9('0x12')][_0x32d9('0x11a')](_0x2d0683,_0x771191['response'],_0x771191[_0x32d9('0x11b')]);var _0xb080ce=_0x2c6385[_0x32d9('0xaa')]?_0x2c6385[_0x32d9('0xaa')]['toString']():'';logger['info'](_0x32d9('0x11c'),JSON['stringify'](_0x2c6385));if(_0x2c6385['result']===-0x1){this[_0x32d9('0x39')][_0x32d9('0x73')](this,_0x771191,_0xb080ce);return _0x2c6385;}else if(_0x2c6385[_0x32d9('0xa8')]===_0x32d9('0x6b')){_0x2c6385['result']=_0xb080ce[_0x32d9('0x9f')]>=parseInt(_0x771191['mindigit'])?'x':'i';}else{_0x2c6385[_0x32d9('0xaa')]=_0xb080ce[_0x32d9('0x9f')]>=parseInt(_0x771191[_0x32d9('0x11d')])&&_0xb080ce['length']<=parseInt(_0x771191[_0x32d9('0x11b')])?'x':'i';}var _0xf659e1=this['getVariable'][_0x32d9('0x73')](this,_0x771191['variable_id']);if(!_0xf659e1){return this[_0x32d9('0x12')]['error'](_0x771191,_0x32d9('0xdd'));}this[_0x32d9('0x12')][_0x32d9('0xa5')](_0xf659e1,_0xb080ce);if(this[_0x32d9('0xac')](_0x771191[_0x32d9('0x11e')])){var _0x5616c4=parseInt(_0x771191[_0x32d9('0x11e')],0xa);var _0x2ef14d=rs[_0x32d9('0x11f')]({'charset':'*','length':_0x5616c4});var _0x404f44=_0xb080ce[_0x32d9('0x9f')];if(_0x404f44>0x0){if(_0x404f44>_0x5616c4){this['createSquareDetailsReport']['sync'](this,_0x771191,_0x771191[_0x32d9('0x120')]===_0x32d9('0x121')?_0x2ef14d+_0xb080ce[_0x32d9('0x122')](_0x5616c4):_0xb080ce[_0x32d9('0x122')](0x0,_0x404f44-_0x5616c4)+_0x2ef14d);}else{this[_0x32d9('0x39')][_0x32d9('0x73')](this,_0x771191,rs[_0x32d9('0x11f')]({'charset':'*','length':_0x404f44}));}}else{this[_0x32d9('0x39')][_0x32d9('0x73')](this,_0x771191,'');}}else{this['createSquareDetailsReport'][_0x32d9('0x73')](this,_0x771191,_0xb080ce);}return _0x2c6385;};AGIVertices[_0x32d9('0x15')][_0x32d9('0x11')]=function(_0x53aa47){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x123'),_0x53aa47[_0x32d9('0x3b')]));return this[_0x32d9('0x10')](_0x53aa47);};AGIVertices[_0x32d9('0x15')]['goal']=function(_0x397327){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x397327['label']));this[_0x32d9('0x39')][_0x32d9('0x73')](this,_0x397327,_0x397327['goalname']);return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')]('GOAL\x20%s',_0x397327[_0x32d9('0x124')]));};AGIVertices[_0x32d9('0x15')][_0x32d9('0x125')]=function(_0x696474){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x126'),_0x696474['label']));if(!this['isConfigured'](_0x696474[_0x32d9('0x8d')])||!this[_0x32d9('0xac')](_0x696474[_0x32d9('0x8e')])){return this['channel'][_0x32d9('0xb0')](_0x32d9('0x127'));}if(!this[_0x32d9('0xac')](_0x696474['text'])){return this[_0x32d9('0x12')]['noop'](_0x32d9('0xb1'));}this['channel'][_0x32d9('0xb0')](util['format'](_0x32d9('0x128'),_0x696474[_0x32d9('0x67')]));var _0x51a216=this[_0x32d9('0x8c')][_0x32d9('0x73')](this,_0x696474);if(_0x51a216){this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x129'),_0x51a216));var _0x486854=this[_0x32d9('0x12')][_0x32d9('0x10b')](_0x51a216);try{fs['unlink'](_0x51a216+_0x32d9('0x12a'));}catch(_0xb74e3b){logger['error'](_0xb74e3b);}return _0x486854;}return this['channel']['error'](_0x696474,_0x32d9('0x12b'));};AGIVertices[_0x32d9('0x15')]['awslex']=function(_0x3ff0ff){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x12c'),_0x3ff0ff[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x3ff0ff[_0x32d9('0x8d')])||!this[_0x32d9('0xac')](_0x3ff0ff['aws_secret_access_key'])){return this[_0x32d9('0x12')]['noop'](_0x32d9('0x127'));}if(!this['isConfigured'](_0x3ff0ff[_0x32d9('0x94')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x3ff0ff[_0x32d9('0x67')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xb1'));}this[_0x32d9('0x12')][_0x32d9('0xee')]=!![];this[_0x32d9('0x39')](_0x3ff0ff);this['createSquareMessage'](_0x3ff0ff['text'],'in','','');this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x12d'),_0x3ff0ff['text']));var _0x3f9f9f=this[_0x32d9('0x92')]['sync'](this,_0x3ff0ff);if(_0x3f9f9f){for(var _0x2ba280 in _0x3f9f9f){if(_0x3f9f9f[_0x32d9('0x9c')](_0x2ba280)&&_['isString'](_0x3f9f9f[_0x2ba280])){this[_0x32d9('0x12')][_0x32d9('0xa5')](util['format'](_0x32d9('0x12e'),_0x2ba280[_0x32d9('0xf1')]()),_0x3f9f9f[_0x2ba280]);}}if(_['isNil'](_0x3f9f9f[_0x32d9('0x7b')])){return this[_0x32d9('0x12')]['noop'](_0x32d9('0x12f'));}else{this[_0x32d9('0x46')](_0x3f9f9f['message'],_0x32d9('0xfc'),_0x32d9('0x130'),'');return this[_0x32d9('0x12')]['noop'](util[_0x32d9('0xa3')](_0x32d9('0x131'),_0x3f9f9f[_0x32d9('0x7b')]));}}return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x3ff0ff,_0x32d9('0x132'));};AGIVertices[_0x32d9('0x15')]['googleasr']=function(_0x54183c){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x133'),_0x54183c['label'],_0x54183c['timeout']));if(!this['isConfigured'](_0x54183c[_0x32d9('0x86')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xed'));}var _0x18252f=_0x32d9('0x134');var _0x28e418=util['format'](_0x32d9('0x135'),FILES_PATH,rs[_0x32d9('0x11f')](0x4));var _0x272a3e=util[_0x32d9('0xa3')]('%s.%s',_0x28e418,_0x18252f);var _0x2785cb=!![];if(_0x54183c[_0x32d9('0x136')]===_0x32d9('0x137')){_0x2785cb=![];}var _0x362798=this[_0x32d9('0x12')][_0x32d9('0x138')](_0x28e418,_0x18252f,_0x54183c['intKey'],_0x54183c['timeout'],undefined,_0x2785cb);if(_0x362798['result']!==-0x1){this[_0x32d9('0x12')]['noop'](util[_0x32d9('0xa3')]('google\x20%s\x20file\x20created',_0x272a3e));var _0x2dd6db=this['googleASR'][_0x32d9('0x73')](this,_0x54183c,_0x272a3e);if(_0x2dd6db){for(var _0x15c7e2 in _0x2dd6db){if(_0x2dd6db[_0x32d9('0x9c')](_0x15c7e2)){this[_0x32d9('0x12')]['setVariable'](util['format'](_0x32d9('0x139'),_0x15c7e2[_0x32d9('0xf1')]()),_0x2dd6db[_0x15c7e2]);}}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x13a'),JSON[_0x32d9('0x77')](_0x2dd6db)));}}return _0x362798;};AGIVertices[_0x32d9('0x15')][_0x32d9('0x13b')]=function(_0x2734e6){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x2734e6[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x2734e6['appid'])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0x13c'));}if(!this[_0x32d9('0xac')](_0x2734e6[_0x32d9('0x98')])){return this[_0x32d9('0x12')]['noop'](_0x32d9('0x13d'));}var _0x208a16='wav';var _0x200d36=util[_0x32d9('0xa3')](_0x32d9('0x135'),FILES_PATH,rs[_0x32d9('0x11f')](0x4));var _0x54d89d=util['format'](_0x32d9('0xa4'),_0x200d36,_0x208a16);var _0x3f4b95=!![];if(_0x2734e6[_0x32d9('0x136')]===_0x32d9('0x137')){_0x3f4b95=![];}var _0x422bdc=this[_0x32d9('0x12')]['recordFile'](_0x200d36,_0x208a16,_0x2734e6['intKey'],_0x2734e6['timeout'],undefined,_0x3f4b95);if(_0x422bdc[_0x32d9('0xaa')]!==-0x1){this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x13e'),_0x54d89d));var _0x2795ca=this['tildeASR']['sync'](this,_0x2734e6,_0x54d89d);if(_0x2795ca){for(var _0x281131 in _0x2795ca){if(_0x2795ca[_0x32d9('0x9c')](_0x281131)){this[_0x32d9('0x12')][_0x32d9('0xa5')](util['format'](_0x32d9('0x13f'),_0x281131[_0x32d9('0xf1')]()),_0x2795ca[_0x281131]);}}return this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')]('TildeASR\x20Result\x20%s',JSON[_0x32d9('0x77')](_0x2795ca)));}}return _0x422bdc;};AGIVertices['prototype'][_0x32d9('0x140')]=function(_0x5ed0db){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5ed0db[_0x32d9('0x3b')]));return this[_0x32d9('0x12')]['continueAt'](_0x5ed0db['context'],_0x5ed0db[_0x32d9('0x40')],_0x5ed0db[_0x32d9('0x41')]);};AGIVertices['prototype'][_0x32d9('0x141')]=function(_0x3dc142){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x142'),_0x3dc142[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x3dc142['condition'])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x3dc142,'no\x20condition\x20configured');}try{var _0x1992cf=eval(_0x3dc142[_0x32d9('0x143')])?'true':_0x32d9('0x144');this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x145'),_0x3dc142[_0x32d9('0x143')],_0x1992cf));return{'code':0xc8,'result':_0x1992cf};}catch(_0x4e793b){return{'code':0xc8,'result':_0x32d9('0x144')};}};AGIVertices[_0x32d9('0x15')][_0x32d9('0x146')]=function(_0x295cab){logger[_0x32d9('0x31')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x295cab[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x295cab['interval_id'])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x295cab,_0x32d9('0x147'));}var _0x511101=this[_0x32d9('0x26')][_0x32d9('0x73')](this,_0x295cab[_0x32d9('0x148')]);if(!_0x511101){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x295cab,_0x32d9('0x149'));}for(var _0x276e81=0x0;_0x276e81<_0x511101[_0x32d9('0x9f')];_0x276e81+=0x1){var _0x12b01a=this[_0x32d9('0x12')][_0x32d9('0x16')](util[_0x32d9('0xa3')](_0x32d9('0x14a'),_0x511101[_0x276e81]));if(_0x12b01a['result']===-0x1){return _0x12b01a;}logger['info'](util[_0x32d9('0xa3')](_0x32d9('0x14b'),_0x511101[_0x276e81],_0x12b01a['extra']));if(_0x12b01a[_0x32d9('0xa8')]==='true'){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')]('IFTIME\x20%s\x20%s',_0x511101[_0x276e81],_0x32d9('0x14c')));this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x14b'),_0x511101[_0x276e81],_0x32d9('0x14c')));return{'code':0xc8,'result':'true'};}else{logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x14b'),_0x511101[_0x276e81],_0x32d9('0x144')));this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x14b'),_0x511101[_0x276e81],_0x32d9('0x144')));}}return{'code':0xc8,'result':_0x32d9('0x144')};};AGIVertices[_0x32d9('0x15')][_0x32d9('0x14d')]=function(_0x4ebba9){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x14e'),_0x4ebba9['label']));return this[_0x32d9('0x12')][_0x32d9('0x14d')]();};AGIVertices[_0x32d9('0x15')][_0x32d9('0x14f')]=function(_0x1a1a6c){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1a1a6c[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x1a1a6c[_0x32d9('0x86')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xed'));}var _0x13cc70=_0x32d9('0x134');var _0x2a141f=util[_0x32d9('0xa3')]('%s/recordings/%s',FILES_PATH,rs[_0x32d9('0x11f')](0x4));var _0x428033=util[_0x32d9('0xa3')](_0x32d9('0xa4'),_0x2a141f,_0x13cc70);var _0x4cc645=!![];if(_0x1a1a6c['beep']==='NOBEEP'){_0x4cc645=![];}var _0x54ea32=this['channel'][_0x32d9('0x138')](_0x2a141f,_0x13cc70,_0x1a1a6c[_0x32d9('0x150')],_0x1a1a6c[_0x32d9('0x6b')],undefined,_0x4cc645);if(_0x54ea32['result']!==-0x1){this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x151'),_0x428033));var _0x34a8f6=this['ispeechASR'][_0x32d9('0x73')](this,_0x1a1a6c,_0x428033);if(_0x34a8f6){for(var _0x1dbf69 in _0x34a8f6){if(_0x34a8f6[_0x32d9('0x9c')](_0x1dbf69)){this[_0x32d9('0x12')][_0x32d9('0xa5')](util[_0x32d9('0xa3')](_0x32d9('0x152'),_0x1dbf69[_0x32d9('0xf1')]()),_0x34a8f6[_0x1dbf69]);}}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x153'),JSON[_0x32d9('0x77')](_0x34a8f6)));}}return _0x54ea32;};AGIVertices[_0x32d9('0x15')][_0x32d9('0x154')]=function(_0x29ab78){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x155'),_0x29ab78[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x29ab78[_0x32d9('0x86')])){return this['channel'][_0x32d9('0xb0')]('no\x20key\x20configured');}if(!this[_0x32d9('0xac')](_0x29ab78[_0x32d9('0x67')])){return this['channel'][_0x32d9('0xb0')](_0x32d9('0xb1'));}this['channel']['noop'](util['format'](_0x32d9('0x156'),_0x29ab78[_0x32d9('0x67')]));var _0x51856a=this[_0x32d9('0x85')][_0x32d9('0x73')](this,_0x29ab78);if(_0x51856a){this['channel'][_0x32d9('0xb0')](util['format'](_0x32d9('0x151'),_0x51856a));var _0x54711b=this[_0x32d9('0x12')][_0x32d9('0x10b')](_0x51856a,_0x29ab78[_0x32d9('0x150')]);try{fs['unlink'](_0x51856a+_0x32d9('0x12a'));}catch(_0x33a514){logger[_0x32d9('0x2f')](_0x33a514);}return _0x54711b;}return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x29ab78,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x32d9('0x157')]=function(_0x5d5f99){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x158'),_0x5d5f99[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x5d5f99[_0x32d9('0x159')])){return this['channel'][_0x32d9('0x2f')](_0x5d5f99,_0x32d9('0x15a'));}logger[_0x32d9('0x31')](util[_0x32d9('0xa3')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x32d9('0x12')]['callerid'],_0x5d5f99['findBy']));var _0x489d4f=this[_0x32d9('0x56')][_0x32d9('0x73')](this,_0x5d5f99['findBy']);if(_0x489d4f){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x15b'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x5d5f99[_0x32d9('0x159')]));this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x15b'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x5d5f99[_0x32d9('0x159')]));return{'code':0xc8,'result':_0x32d9('0x15c')};}else{logger['info'](util[_0x32d9('0xa3')](_0x32d9('0x15d'),this[_0x32d9('0x12')]['callerid'],_0x5d5f99[_0x32d9('0x159')]));this['channel'][_0x32d9('0xb0')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x32d9('0x3c')],_0x5d5f99[_0x32d9('0x159')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x32d9('0x15')]['logout']=function(_0x1d959c){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x15e'),_0x1d959c[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x1d959c['findBy'])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x1d959c,_0x32d9('0x15a'));}logger[_0x32d9('0x31')](util['format'](_0x32d9('0x15f'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x1d959c['findBy']));var _0x38327f=this[_0x32d9('0x160')][_0x32d9('0x73')](this,_0x1d959c[_0x32d9('0x159')]);if(_0x38327f){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x15b'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x1d959c[_0x32d9('0x159')]));this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x15b'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x1d959c[_0x32d9('0x159')]));return{'code':0xc8,'result':'success'};}else{logger[_0x32d9('0x31')](util['format'](_0x32d9('0x15d'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x1d959c[_0x32d9('0x159')]));this['channel']['noop'](util[_0x32d9('0xa3')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x1d959c['findBy']));return{'code':0xc8,'result':_0x32d9('0x161')};}};AGIVertices[_0x32d9('0x15')][_0x32d9('0x162')]=function(_0x533228){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x163'),_0x533228[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x533228['operation'])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x533228,_0x32d9('0x164'));}this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x165'),_0x533228[_0x32d9('0x166')]));var _0x3aed0c=eval(_0x533228[_0x32d9('0x166')]);if(!this[_0x32d9('0xac')](_0x533228[_0x32d9('0xdb')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xdc'));}var _0x2477fb=this[_0x32d9('0x16')][_0x32d9('0x73')](this,_0x533228['variable_id']);if(!_0x2477fb){return this['channel'][_0x32d9('0x2f')](_0x533228,_0x32d9('0xdd'));}if(_[_0x32d9('0x167')](_0x3aed0c)){var _0x3ec490=this;_0x3aed0c[_0x32d9('0xde')](function(_0x39f841,_0x1812b6){_0x3ec490[_0x32d9('0x12')][_0x32d9('0xa5')](util[_0x32d9('0xa3')](_0x32d9('0x168'),_0x2477fb,_0x1812b6),_0x39f841);});return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')]('variable\x20%s[key]\x20set',_0x2477fb));}else{return this['channel'][_0x32d9('0xa5')](_0x2477fb,_0x3aed0c);}};AGIVertices[_0x32d9('0x15')][_0x32d9('0xf')]=function(_0x249d67){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x169'),_0x249d67[_0x32d9('0x3b')]));if(_0x249d67[_0x32d9('0x117')]===0x0){return this[_0x32d9('0xad')](_0x249d67);}_0x249d67[_0x32d9('0x117')]-=0x1;if(!this[_0x32d9('0xac')](_0x249d67[_0x32d9('0x119')])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x249d67,'no\x20file\x20audio\x20selected');}var _0x58534f=this[_0x32d9('0x22')][_0x32d9('0x73')](this,_0x249d67['file_id']);if(!_0x58534f){return this[_0x32d9('0x12')]['error'](_0x249d67,_0x32d9('0x16a'));}var _0x2a0cf8=this[_0x32d9('0x12')][_0x32d9('0x11a')](_0x58534f,_0x249d67['response'],_0x249d67[_0x32d9('0x16b')]);var _0x21c5a3=_0x2a0cf8[_0x32d9('0xaa')];if(_0x2a0cf8[_0x32d9('0xaa')]===-0x1){this[_0x32d9('0x39')]['sync'](this,_0x249d67,'-1');return _0x2a0cf8;}else if(_0x2a0cf8[_0x32d9('0xa8')]===_0x32d9('0x6b')){_0x2a0cf8[_0x32d9('0xaa')]=_0x2a0cf8['result']['length']>0x0?_0x2a0cf8['result']:'t';}else if(_['isEmpty'](_0x2a0cf8[_0x32d9('0xaa')])){_0x2a0cf8[_0x32d9('0xaa')]='#';_0x21c5a3='#';}if(!this[_0x32d9('0xac')](_0x249d67[_0x32d9('0xdb')])){this['channel'][_0x32d9('0xb0')](_0x32d9('0xdc'));}else{var _0x2ef1ad=this[_0x32d9('0x16')]['sync'](this,_0x249d67[_0x32d9('0xdb')]);if(!_0x2ef1ad){return this[_0x32d9('0x12')]['error'](_0x249d67,'no\x20variable\x20found');}this['channel'][_0x32d9('0xa5')](_0x2ef1ad,_0x21c5a3);}this[_0x32d9('0x39')][_0x32d9('0x73')](this,_0x249d67,_0x21c5a3);return _0x2a0cf8;};AGIVertices[_0x32d9('0x15')][_0x32d9('0xb0')]=function(_0x312623){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x16c'),_0x312623['label']));return this['channel'][_0x32d9('0xb0')](_0x312623[_0x32d9('0x16d')]||_0x312623['label']);};AGIVertices[_0x32d9('0x15')][_0x32d9('0x16e')]=function(_0x4ebafe){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x16f'),_0x4ebafe[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x4ebafe['findBy'])){return this['channel'][_0x32d9('0x2f')](_0x4ebafe,'no\x20find\x20by\x20configured');}logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x15f'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x4ebafe[_0x32d9('0x159')]));var _0x5588b5=this[_0x32d9('0x52')][_0x32d9('0x73')](this,_0x4ebafe[_0x32d9('0x170')]);var _0x255db5=this[_0x32d9('0x53')]['sync'](this,_0x4ebafe[_0x32d9('0x159')],_0x5588b5);if(_0x255db5){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x15b'),this[_0x32d9('0x12')]['callerid'],_0x4ebafe[_0x32d9('0x159')]));this['channel'][_0x32d9('0xb0')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x32d9('0x3c')],_0x4ebafe[_0x32d9('0x159')]));return{'code':0xc8,'result':_0x32d9('0x15c')};}else{logger[_0x32d9('0x31')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x4ebafe['findBy']));this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x15b'),this[_0x32d9('0x12')]['callerid'],_0x4ebafe[_0x32d9('0x159')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x32d9('0x15')][_0x32d9('0x171')]=function(_0x59329c){logger[_0x32d9('0x31')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x59329c[_0x32d9('0x3b')]));if(!this['isConfigured'](_0x59329c[_0x32d9('0x119')])){return this['channel'][_0x32d9('0x2f')](_0x59329c,'no\x20file\x20audio\x20selected');}var _0x2894cd=this[_0x32d9('0x22')][_0x32d9('0x73')](this,_0x59329c[_0x32d9('0x119')]);if(!_0x2894cd){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x59329c,_0x32d9('0x16a'));}var _0x1c5e91=this[_0x32d9('0x12')][_0x32d9('0x5a')](_0x32d9('0x172'),[_0x2894cd,_0x59329c[_0x32d9('0xea')]]);if(_0x1c5e91[_0x32d9('0xaa')]===-0x1){return _0x1c5e91;}return this[_0x32d9('0x12')]['noop'](util['format'](_0x32d9('0xca'),_0x32d9('0x172'),_0x2894cd));};AGIVertices[_0x32d9('0x15')][_0x32d9('0x173')]=function(_0x4493ad){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x174'),_0x4493ad[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x4493ad[_0x32d9('0x175')])){return this['channel'][_0x32d9('0x2f')](_0x4493ad,_0x32d9('0x176'));}var _0x54edbf='';var _0x5d044f=parseInt(_0x4493ad[_0x32d9('0x175')],0xa);if(isNaN(_0x5d044f)){_0x54edbf=_0x4493ad[_0x32d9('0x175')];}else{_0x54edbf=this['getVoiceQueue'][_0x32d9('0x73')](this,_0x4493ad[_0x32d9('0x175')]);if(!_0x54edbf){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x4493ad,_0x32d9('0x177'));}}var _0x2566fc='';if(this['isConfigured'](_0x4493ad[_0x32d9('0x119')])){var _0x3d51de=this[_0x32d9('0x22')]['sync'](this,_0x4493ad[_0x32d9('0x119')]);if(_0x3d51de){_0x2566fc=_0x3d51de;}}this[_0x32d9('0x39')][_0x32d9('0x73')](this,_0x4493ad,_0x54edbf);if(_0x4493ad[_0x32d9('0xea')][_0x32d9('0x178')]('x')<0x0){_0x4493ad[_0x32d9('0xea')]+='x';}if(_0x4493ad['opts'][_0x32d9('0x178')]('X')<0x0){_0x4493ad[_0x32d9('0xea')]+='X';}this[_0x32d9('0x12')][_0x32d9('0xa5')](_0x32d9('0x179'),_0x54edbf?_0x54edbf[_0x32d9('0x17a')]():'');var _0x5dd7ac=this[_0x32d9('0x12')][_0x32d9('0x5a')](_0x32d9('0x17b'),[_0x54edbf,_0x4493ad[_0x32d9('0xea')],_0x4493ad['url'],_0x2566fc,_0x4493ad[_0x32d9('0x6b')],_0x4493ad[_0x32d9('0x9')],_0x4493ad[_0x32d9('0x17c')],_0x4493ad['gosub'],'',_0x4493ad[_0x32d9('0x17d')]]);if(_0x5dd7ac['result']===-0x1){return _0x5dd7ac;}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util['format'](_0x32d9('0xca'),_0x32d9('0x17b'),_0x54edbf));};AGIVertices[_0x32d9('0x15')][_0x32d9('0x17e')]=function(_0x5080c4){logger['info'](util[_0x32d9('0xa3')](_0x32d9('0x17f'),_0x5080c4[_0x32d9('0x3b')]));var _0x1e9e11=_0x5080c4[_0x32d9('0x180')]||_0x32d9('0x134');var _0x21869c=util[_0x32d9('0xa3')](_0x32d9('0x181'),this[_0x32d9('0x12')][_0x32d9('0x3a')],rs['generate'](0x5));var _0x4f4c3b=util['format'](_0x32d9('0x182'),FILES_PATH,_0x21869c,_0x1e9e11);var _0x52d22d=util[_0x32d9('0xa3')](_0x32d9('0x135'),FILES_PATH,_0x21869c);this[_0x32d9('0x3d')][_0x32d9('0x73')](this,_0x5080c4,_0x21869c,_0x4f4c3b);this['channel'][_0x32d9('0xa5')](_0x32d9('0x183'),_0x21869c);logger['info'](_0x32d9('0x184'),_0x52d22d,_0x1e9e11,_0x5080c4[_0x32d9('0x185')],_0x5080c4[_0x32d9('0x6b')]);return this[_0x32d9('0x12')][_0x32d9('0x138')](_0x52d22d,_0x1e9e11,_0x5080c4[_0x32d9('0x185')],_0x5080c4[_0x32d9('0x6b')],undefined,!![]);};AGIVertices[_0x32d9('0x15')][_0x32d9('0x186')]=function(_0x1a2047){logger[_0x32d9('0x31')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1a2047[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x1a2047[_0x32d9('0x69')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0x187'));}var _0x52e59c=this[_0x32d9('0x68')]['sync'](this,_0x1a2047);logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x188'),util[_0x32d9('0x189')](_0x52e59c,{'showHidden':![],'depth':null})));if(!this[_0x32d9('0xac')](_0x1a2047[_0x32d9('0xdb')])){return this['channel'][_0x32d9('0xb0')](_0x32d9('0x18a'));}var _0x37a77f=this[_0x32d9('0x16')][_0x32d9('0x73')](this,_0x1a2047[_0x32d9('0xdb')]);if(!_0x37a77f){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x1a2047,_0x32d9('0xdd'));}this[_0x32d9('0x12')][_0x32d9('0xa5')](util[_0x32d9('0xa3')](_0x32d9('0x18b'),_0x37a77f),_0x52e59c[_0x32d9('0x79')]?_0x52e59c[_0x32d9('0x79')]:'200');this[_0x32d9('0x12')]['setVariable'](util['format'](_0x32d9('0x18c'),_0x37a77f),_0x52e59c['statusMessage']?_0x52e59c[_0x32d9('0x7a')]:'OK');if(_0x52e59c['body']){try{this[_0x32d9('0xa2')](_0x52e59c[_0x32d9('0x78')],_0x37a77f);}catch(_0x552c59){logger['error'](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x37a77f));}}return this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x18d'),_0x37a77f));};AGIVertices['prototype'][_0x32d9('0x18e')]=function(_0x5ab566){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x18f'),_0x5ab566[_0x32d9('0x3b')]));return this[_0x32d9('0x12')][_0x32d9('0x190')](_0x5ab566[_0x32d9('0x191')][_0x32d9('0x5c')](/\s+/g,''),_0x5ab566[_0x32d9('0x185')]);};AGIVertices['prototype'][_0x32d9('0x192')]=function(_0x4b837c){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x193'),_0x4b837c['label']));return this[_0x32d9('0x12')][_0x32d9('0x194')](_0x4b837c['number']['replace'](/\s+/g,''),_0x4b837c[_0x32d9('0x185')]);};AGIVertices[_0x32d9('0x15')][_0x32d9('0x195')]=function(_0x28c3c3){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x196'),_0x28c3c3[_0x32d9('0x3b')]));return this['channel']['sayPhonetic'](_0x28c3c3[_0x32d9('0x67')],_0x28c3c3['escape_digits']);};AGIVertices[_0x32d9('0x15')][_0x32d9('0x197')]=function(_0x48dfd3){logger['info'](util[_0x32d9('0xa3')](_0x32d9('0x198'),_0x48dfd3[_0x32d9('0x3b')]));if(!this['isConfigured'](_0x48dfd3['account_id'])){return this['channel']['noop'](_0x32d9('0x199'));}var _0x16c33c=this['getMailAccount'][_0x32d9('0x73')](this,_0x48dfd3[_0x32d9('0x19a')]);if(!_0x16c33c||!_0x16c33c[_0x32d9('0x19b')]){return this['channel'][_0x32d9('0x2f')](_0x48dfd3,_0x32d9('0x19c'));}var _0x53f9bf={'from':util[_0x32d9('0xa3')]('\x22%s\x22\x20<%s>',_0x16c33c[_0x32d9('0x1c')],_0x16c33c[_0x32d9('0x19d')]||_0x16c33c[_0x32d9('0x19b')]['user']),'to':_0x48dfd3['to']||'','cc':_0x48dfd3['cc']||'','bcc':_0x48dfd3['bcc']||'','subject':_0x48dfd3[_0x32d9('0x19e')],'html':_0x48dfd3[_0x32d9('0x67')],'text':_0x48dfd3[_0x32d9('0x67')]};if(this[_0x32d9('0xac')](_0x48dfd3[_0x32d9('0x19f')])){}logger[_0x32d9('0xe2')](_0x32d9('0x1a0'),JSON['stringify'](_0x53f9bf));this[_0x32d9('0x39')]['sync'](this,_0x48dfd3,_0x48dfd3[_0x32d9('0x19a')]);this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x16c33c['name']));this[_0x32d9('0x25')][_0x32d9('0x73')](this,_0x16c33c[_0x32d9('0x1a1')],_0x53f9bf);return this['channel'][_0x32d9('0xb0')](_0x32d9('0x1a2'));};AGIVertices['prototype'][_0x32d9('0x1a3')]=function(_0x1d66f7){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x1a4'),_0x1d66f7[_0x32d9('0x3b')]));return this[_0x32d9('0x12')][_0x32d9('0xb0')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x32d9('0x1a5')]=function(_0x3df3ab){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x1a6'),_0x3df3ab[_0x32d9('0x3b')]));if(!this['isConfigured'](_0x3df3ab['sms_account_id'])){return this['channel'][_0x32d9('0xb0')](_0x32d9('0x1a7'));}var _0xdb2513=this['getSmsAccount'][_0x32d9('0x73')](this,_0x3df3ab['sms_account_id']);if(!_0xdb2513){return this['channel'][_0x32d9('0x2f')](_0x3df3ab,'no\x20sms\x20account\x20found');}var _0x2218ec={'body':_0x3df3ab[_0x32d9('0x1a8')],'phone':_0x3df3ab['to']||'','SmsAccountId':_0xdb2513['id']};logger[_0x32d9('0xe2')](_0x32d9('0x1a9'),JSON[_0x32d9('0x77')](_0x2218ec));this[_0x32d9('0x39')][_0x32d9('0x73')](this,_0x3df3ab,_0x3df3ab[_0x32d9('0x1aa')]);this[_0x32d9('0x12')]['noop'](util[_0x32d9('0xa3')](_0x32d9('0x1ab'),_0xdb2513[_0x32d9('0x1c')]));this[_0x32d9('0x38')][_0x32d9('0x73')](this,_0x2218ec);return this[_0x32d9('0x12')]['noop'](_0x32d9('0x1ac'));};AGIVertices['prototype'][_0x32d9('0x1ad')]=function(_0x270a5b){logger['info'](util[_0x32d9('0xa3')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x270a5b[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x270a5b[_0x32d9('0xdb')])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x270a5b,_0x32d9('0x1ae'));}var _0x2b1c7a=this[_0x32d9('0x16')]['sync'](this,_0x270a5b['variable_id']);if(!_0x2b1c7a){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x270a5b,_0x32d9('0xdd'));}return this[_0x32d9('0x12')][_0x32d9('0xa5')](_0x2b1c7a,_0x270a5b[_0x32d9('0x1af')]);};AGIVertices[_0x32d9('0x15')]['start']=function(_0x12a1c6){logger['info'](util[_0x32d9('0xa3')](_0x32d9('0x1b0'),_0x12a1c6[_0x32d9('0x3b')]));this['channel'][_0x32d9('0xb0')](_0x32d9('0x1b1'));if(_0x12a1c6[_0x32d9('0xc2')]===_0x32d9('0x1b2')){this[_0x32d9('0x12')]['noop'](_0x32d9('0x1b3'));return this['channel'][_0x32d9('0xc2')]();}return this[_0x32d9('0x12')][_0x32d9('0xb0')]('Skipped\x20Answer');};AGIVertices['prototype'][_0x32d9('0x1b4')]=function(_0x320dfd){logger['info'](util[_0x32d9('0xa3')](_0x32d9('0x1b5'),_0x320dfd[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x320dfd['project_id'])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x320dfd,'no\x20subproject\x20selected');}var _0x49820a=this[_0x32d9('0x1d')][_0x32d9('0x73')](this,_0x320dfd[_0x32d9('0x1b6')]);if(!this[_0x32d9('0xac')](_0x49820a)){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x320dfd,util[_0x32d9('0xa3')](_0x32d9('0x1b7'),_0x320dfd[_0x32d9('0x1b6')]));}if(_0x49820a===this[_0x32d9('0x12')][_0x32d9('0x44')]){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x320dfd,_0x32d9('0x1b8'));}this['createSquareDetailsReport']['sync'](this,_0x320dfd,_0x49820a);var _0x372e74=this[_0x32d9('0x12')][_0x32d9('0x5a')](_0x32d9('0x1b9'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x32d9('0x9')][_0x32d9('0x1ba')]||'127.0.0.1',_0x49820a,this[_0x32d9('0x12')][_0x32d9('0x44')]));if(_0x372e74['result']===-0x1){return _0x372e74;}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0xca'),_0x32d9('0x1b9'),_0x49820a));};AGIVertices[_0x32d9('0x15')]['system']=function(_0x400560){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x1bb'),_0x400560[_0x32d9('0x3b')]));var _0x19e929=this[_0x32d9('0x1bc')][_0x32d9('0x73')](this,_0x400560[_0x32d9('0xbd')]);this[_0x32d9('0x39')][_0x32d9('0x73')](this,_0x400560,_0x400560['command']);if(this[_0x32d9('0xac')](_0x400560[_0x32d9('0xdb')])){var _0x7a9d59=this[_0x32d9('0x16')]['sync'](this,_0x400560['variable_id']);if(_0x7a9d59){this[_0x32d9('0x12')]['setVariable'](_0x7a9d59,_0x19e929);return this[_0x32d9('0x12')]['noop'](util['format'](_0x32d9('0x1bd'),_0x400560[_0x32d9('0xbd')],_0x7a9d59));}}return this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x1be'),_0x400560[_0x32d9('0xbd')]));};AGIVertices[_0x32d9('0x15')][_0x32d9('0x1bf')]=function(_0x4cb263){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x1c0'),_0x4cb263[_0x32d9('0x3b')]));_0x4cb263[_0x32d9('0x67')]=_0x4cb263[_0x32d9('0x67')][_0x32d9('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x32d9('0xac')](_0x4cb263[_0x32d9('0x5e')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0x1c1'));}if(!this[_0x32d9('0xac')](_0x4cb263[_0x32d9('0x67')])){return this[_0x32d9('0x12')][_0x32d9('0xb0')](_0x32d9('0xb1'));}this[_0x32d9('0x12')]['noop'](util[_0x32d9('0xa3')](_0x32d9('0x1c2'),_0x4cb263['text']));var _0x3abda4=this[_0x32d9('0x5d')][_0x32d9('0x73')](this,_0x4cb263);if(_0x3abda4){this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x1c3'),_0x3abda4));var _0x21cffb=this[_0x32d9('0x12')]['streamFile'](_0x3abda4);try{fs[_0x32d9('0x1c4')](_0x3abda4+'.wav');}catch(_0x630fa3){logger['error'](_0x630fa3);}return _0x21cffb;}return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x4cb263,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x32d9('0x15')][_0x32d9('0x1c5')]=function(_0xe3d852){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0xe3d852['label']));_0xe3d852[_0x32d9('0x67')]=_0xe3d852[_0x32d9('0x67')][_0x32d9('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0xe3d852[_0x32d9('0x67')])){return this['channel']['noop'](_0x32d9('0xb1'));}this[_0x32d9('0x12')][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x1c6'),_0xe3d852[_0x32d9('0x67')]));var _0x2d64ee=this['googleTTS'][_0x32d9('0x73')](this,_0xe3d852);if(_0x2d64ee){this[_0x32d9('0x12')]['noop'](util[_0x32d9('0xa3')](_0x32d9('0x1c7'),_0x2d64ee));var _0x47927c=this['channel']['streamFile'](_0x2d64ee);try{fs[_0x32d9('0x1c4')](_0x2d64ee+_0x32d9('0x12a'));}catch(_0xd38556){logger[_0x32d9('0x2f')](_0xd38556);}return _0x47927c;}return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0xe3d852,_0x32d9('0x1c8'));};AGIVertices['prototype'][_0x32d9('0x1c9')]=function(_0x5bbd7a){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x1ca'),_0x5bbd7a[_0x32d9('0x3b')]));if(!this['isConfigured'](_0x5bbd7a[_0x32d9('0x159')])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x5bbd7a,_0x32d9('0x15a'));}logger['info'](util[_0x32d9('0xa3')](_0x32d9('0x15f'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x5bbd7a[_0x32d9('0x159')]));var _0x4b9b97=this[_0x32d9('0x55')][_0x32d9('0x73')](this,_0x5bbd7a[_0x32d9('0x159')]);if(_0x4b9b97){logger['info'](util[_0x32d9('0xa3')](_0x32d9('0x15b'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x5bbd7a['findBy']));this[_0x32d9('0x12')]['noop'](util[_0x32d9('0xa3')](_0x32d9('0x15b'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x5bbd7a[_0x32d9('0x159')]));return{'code':0xc8,'result':_0x32d9('0x15c')};}else{logger['info'](util['format'](_0x32d9('0x15d'),this[_0x32d9('0x12')][_0x32d9('0x3c')],_0x5bbd7a[_0x32d9('0x159')]));this['channel'][_0x32d9('0xb0')](util[_0x32d9('0xa3')](_0x32d9('0x15d'),this[_0x32d9('0x12')]['callerid'],_0x5bbd7a[_0x32d9('0x159')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x32d9('0x1cb')]=function(_0x1a7724){logger[_0x32d9('0x31')](util[_0x32d9('0xa3')](_0x32d9('0x1cc'),_0x1a7724[_0x32d9('0x3b')]));var _0x3979b2=this['channel'][_0x32d9('0x5a')]('VOICEMAIL',[_0x1a7724[_0x32d9('0x1cd')],_0x1a7724[_0x32d9('0x7d')]]);if(_0x3979b2[_0x32d9('0xaa')]===-0x1){return _0x3979b2;}return this['channel']['noop'](util[_0x32d9('0xa3')](_0x32d9('0xca'),_0x32d9('0x1ce'),_0x1a7724['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x2fc92e){logger[_0x32d9('0x31')](util['format'](_0x32d9('0x1cf'),_0x2fc92e[_0x32d9('0x3b')]));if(!this[_0x32d9('0xac')](_0x2fc92e[_0x32d9('0xdb')])){return this[_0x32d9('0x12')][_0x32d9('0x2f')](_0x2fc92e,'no\x20variable\x20selected');}var _0x14e23b=this[_0x32d9('0x16')][_0x32d9('0x73')](this,_0x2fc92e['variable_id']);if(!_0x14e23b){return this[_0x32d9('0x12')]['error'](_0x2fc92e,_0x32d9('0xdd'));}var _0x424a20=this[_0x32d9('0x12')]['getVariable'](_0x14e23b);return{'code':0xc8,'result':_0x424a20[_0x32d9('0xa8')]?_0x424a20[_0x32d9('0xa8')]:'-'};};String[_0x32d9('0x15')][_0x32d9('0xa7')]=function(_0x3376c8,_0xbe2869){return this[_0x32d9('0xa6')](_0x3376c8)[_0x32d9('0x1d0')](_0xbe2869);};module[_0x32d9('0x1d1')]=AGIVertices;
\ No newline at end of file
+var _0x9434=['MALE','MP3','googleTTS','url','timeout','number','includes','POST','PUT','method','rawBody','headers','parse','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusMessage','body','statusCode','message','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','length','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','no\x20text\x20configured','exec','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','scheduledAt','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','variable\x20%s\x20set','debug','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','createSquareMessage','providerResponse','out','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','variable_id','hiddendigitsnum','hiddendigitspos','first','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','generate','beep','recordFile','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','NOBEEP','intKey','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','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','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareOdbc','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','open','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','callerid','createSquareRecording','uniqueid','calleridname','context','extension','accountcode','dnid','arg_1','isNil','random','isEmpty','lastName','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender'];(function(_0x5e2f36,_0x38841a){var _0x1c13b1=function(_0x4ccfc5){while(--_0x4ccfc5){_0x5e2f36['push'](_0x5e2f36['shift']());}};_0x1c13b1(++_0x38841a);}(_0x9434,0x168));var _0x4943=function(_0x513eb8,_0x183397){_0x513eb8=_0x513eb8-0x0;var _0x166b11=_0x9434[_0x513eb8];return _0x166b11;};'use strict';var fs=require('fs');var util=require(_0x4943('0x0'));var _=require(_0x4943('0x1'));var sh=require(_0x4943('0x2'));var odbc=require(_0x4943('0x3'))();var rs=require(_0x4943('0x4'));var moment=require(_0x4943('0x5'));var Mustache=require('mustache');var rp=require(_0x4943('0x6'));var logger=require(_0x4943('0x7'))('agi');var config=require(_0x4943('0x8'));var shared=require(_0x4943('0x9'));var scripts=require('./scripts');var FILES_PATH=_0x4943('0xa');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x4943('0xb'),_0x4943('0xc'),_0x4943('0xd')];var AGIVertices=function(_0x32f535,_0x439158,_0x553991){this['channel']=_0x32f535;this[_0x4943('0xe')]=_0x439158;this[_0x4943('0xf')]=_0x553991;};AGIVertices[_0x4943('0x10')]['getVariable']=function(_0xc7fda7,_0x35df90){this['rpc'][_0x4943('0x11')](_0xc7fda7)['then'](function(_0x590f41){_0x35df90(null,_0x590f41?_0x590f41[_0x4943('0x12')]:![]);})[_0x4943('0x13')](function(_0x33fd73){_0x35df90(_0x33fd73);});};AGIVertices[_0x4943('0x10')][_0x4943('0x14')]=function(_0x24bdd7,_0x4077f1){this['rpc'][_0x4943('0x15')](_0x24bdd7)[_0x4943('0x16')](function(_0x2ae9b5){_0x4077f1(null,_0x2ae9b5?_0x2ae9b5[_0x4943('0x12')]:![]);})[_0x4943('0x13')](function(_0x39b4e3){_0x4077f1(_0x39b4e3);});};AGIVertices['prototype'][_0x4943('0x17')]=function(_0x407485,_0xb08628){this['rpc']['getSquareProjectById'](_0x407485)[_0x4943('0x16')](function(_0x4cba96){_0xb08628(null,_0x4cba96?_0x4cba96[_0x4943('0x12')]:![]);})[_0x4943('0x13')](function(_0x51a416){_0xb08628(_0x51a416);});};AGIVertices[_0x4943('0x10')][_0x4943('0x18')]=function(_0x38749b,_0x494bef){this[_0x4943('0xe')]['getSquareOdbcById'](_0x38749b)[_0x4943('0x16')](function(_0x52fa3b){_0x494bef(null,_0x52fa3b?_0x52fa3b[_0x4943('0x19')]:![]);})[_0x4943('0x13')](function(_0x278569){_0x494bef(_0x278569);});};AGIVertices[_0x4943('0x10')]['getUser']=function(_0x1ceb6f,_0x205eb2){this[_0x4943('0xe')][_0x4943('0x1a')](_0x1ceb6f)[_0x4943('0x16')](function(_0xd88a73){_0x205eb2(null,_0xd88a73?_0xd88a73[_0x4943('0x12')]:![]);})[_0x4943('0x13')](function(_0x5dd061){_0x205eb2(_0x5dd061);});};AGIVertices['prototype'][_0x4943('0x1b')]=function(_0x127a53,_0x426543){this['rpc'][_0x4943('0x1c')](_0x127a53)[_0x4943('0x16')](function(_0x4a442e){_0x426543(null,_0x4a442e?_0x4a442e[_0x4943('0x12')]:![]);})[_0x4943('0x13')](function(_0x43cbfe){_0x426543(_0x43cbfe);});};AGIVertices[_0x4943('0x10')][_0x4943('0x1d')]=function(_0x16eba6,_0x307478){var _0x169ced=this;this[_0x4943('0xe')][_0x4943('0x1e')](_0x16eba6)[_0x4943('0x16')](function(_0x3b733f){_0x307478(null,_0x3b733f?_0x169ced[_0x4943('0x1f')](_0x3b733f[_0x4943('0x20')]):![]);})[_0x4943('0x13')](function(_0x1cbb1e){_0x307478(_0x1cbb1e);});};AGIVertices[_0x4943('0x10')][_0x4943('0x21')]=function(_0x5d792c,_0x43b11f){this['rpc'][_0x4943('0x22')](_0x5d792c)[_0x4943('0x16')](function(_0x2957d2){_0x43b11f(null,_0x2957d2?_0x2957d2:![]);})[_0x4943('0x13')](function(_0x3b7788){_0x43b11f(_0x3b7788);});};AGIVertices[_0x4943('0x10')][_0x4943('0x23')]=function(_0x315581,_0x571df7,_0x322a94){this[_0x4943('0xf')]['sendMailMessage'](_0x315581,_0x571df7)[_0x4943('0x16')](function(){_0x322a94(null);})[_0x4943('0x13')](function(_0x50b275){_0x322a94(_0x50b275);});};AGIVertices[_0x4943('0x10')][_0x4943('0x24')]=function(_0x2692a2,_0x4f0076){this[_0x4943('0xe')][_0x4943('0x25')](_0x2692a2)[_0x4943('0x16')](function(_0x1ac482){if(_0x1ac482){if(_0x1ac482[_0x4943('0x26')]){_0x4f0076(null,[_0x1ac482['interval']]);}else{_0x4f0076(null,_[_0x4943('0x27')](_0x1ac482[_0x4943('0x28')],_0x4943('0x29')));}}else{_0x4f0076(null,![]);}})[_0x4943('0x13')](function(_0x178cc9){_0x4f0076(_0x178cc9);});};AGIVertices[_0x4943('0x10')][_0x4943('0x1f')]=function(_0x33b12f){return util[_0x4943('0x2a')](_0x4943('0x2b'),FILES_PATH,_0x33b12f);};AGIVertices[_0x4943('0x10')]['getQueryOdbc']=function(_0x435ddd,_0x400bc8,_0xed2e1f){odbc[_0x4943('0x2c')](_0x435ddd,function(_0x3ca758){if(_0x3ca758){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x3ca758);_0xed2e1f(_0x3ca758);}else{logger['info'](_0x4943('0x2d'));odbc[_0x4943('0x2e')](_0x400bc8,function(_0x5876f6,_0xeb900e){if(_0x5876f6){logger['info'](_0x4943('0x2f'),_0x400bc8);_0xed2e1f(_0x5876f6);}else{logger[_0x4943('0x30')](_0x4943('0x31'),_0x400bc8);odbc[_0x4943('0x32')](function(_0x370202){if(_0x370202){logger[_0x4943('0x33')](_0x4943('0x34'),_0x370202);}_0xed2e1f(null,_0xeb900e);});}});}});};AGIVertices[_0x4943('0x10')][_0x4943('0x35')]=function(_0x2a831c,_0x25d36e){this[_0x4943('0xe')][_0x4943('0x36')](_0x2a831c)[_0x4943('0x16')](function(_0xcb6f7a){_0x25d36e(null,_0xcb6f7a?_0xcb6f7a:![]);})[_0x4943('0x13')](function(_0xbe0e00){_0x25d36e(_0xbe0e00);});};AGIVertices[_0x4943('0x10')][_0x4943('0x37')]=function(_0x1f0209,_0xb3b0f9){this[_0x4943('0xe')][_0x4943('0x37')](_0x1f0209)[_0x4943('0x16')](function(_0x32e4c1){_0xb3b0f9(null,_0x32e4c1);})[_0x4943('0x13')](function(_0xe27ab){_0xb3b0f9(_0xe27ab);});};AGIVertices['prototype'][_0x4943('0x38')]=function(_0x147179,_0x506ea2,_0x5a5bc9){this[_0x4943('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x4943('0x39')]['uniqueid'],'node':_0x147179[_0x4943('0x3a')],'application':_0x147179['agicommand'],'data':_0x506ea2||null,'project_name':this[_0x4943('0x39')]['arg_1'],'callerid':this[_0x4943('0x39')][_0x4943('0x3b')]})[_0x4943('0x16')](function(_0x542205){if(_0x5a5bc9){_0x5a5bc9(null,_0x542205);}})['catch'](function(_0xc7d961){if(_0x5a5bc9){_0x5a5bc9(_0xc7d961);}});};AGIVertices['prototype'][_0x4943('0x3c')]=function(_0x5c44c5,_0x1eac54,_0x380525,_0x37dc69){this[_0x4943('0xe')]['createSquareRecording']({'uniqueid':this['channel'][_0x4943('0x3d')],'callerid':this['channel']['callerid'],'calleridname':this[_0x4943('0x39')][_0x4943('0x3e')],'context':this[_0x4943('0x39')][_0x4943('0x3f')],'extension':this[_0x4943('0x39')][_0x4943('0x40')],'priority':this[_0x4943('0x39')]['priority'],'accountcode':this[_0x4943('0x39')][_0x4943('0x41')],'dnid':this['channel'][_0x4943('0x42')],'projectName':this[_0x4943('0x39')][_0x4943('0x43')],'saveName':_0x1eac54,'filename':_0x5c44c5['file']||_0x1eac54,'savePath':_0x380525})[_0x4943('0x16')](function(_0x31aa3c){_0x37dc69(null,_0x31aa3c);})['catch'](function(_0x354ca9){_0x37dc69(_0x354ca9);});};AGIVertices[_0x4943('0x10')]['createSquareMessage']=function(_0x445908,_0x346a6d,_0x289af4,_0x52f4a6,_0x21c392){this['rpc']['createSquareMessage']({'uniqueid':this[_0x4943('0x39')][_0x4943('0x3d')],'body':_0x445908,'direction':_0x346a6d,'providerName':_0x289af4,'providerResponse':_0x52f4a6})[_0x4943('0x16')](function(_0x5bca66){if(_0x21c392){_0x21c392(null,_0x5bca66);}})['catch'](function(_0x4d9968){if(_0x21c392){_0x21c392(_0x4d9968);}});};AGIVertices[_0x4943('0x10')]['createCmContact']=function(_0x5ca090,_0x88b338){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x5ca090[_0x4943('0x12')])||_[_0x4943('0x44')](_0x5ca090[_0x4943('0x12')])?'callback_'+Math[_0x4943('0x45')]():_0x5ca090[_0x4943('0x12')],'lastName':_[_0x4943('0x46')](_0x5ca090['lastName'])||_[_0x4943('0x44')](_0x5ca090[_0x4943('0x47')])?null:_0x5ca090['lastName'],'phone':_0x5ca090['phone'],'ListId':_0x5ca090['list_id'],'scheduledat':_0x5ca090['scheduledAt'],'callbackUniqueid':this[_0x4943('0x39')][_0x4943('0x3d')],'tags':_0x4943('0x48'),'description':_0x4943('0x49')+_0x5ca090['scheduledAt'][_0x4943('0x4a')](),'priority':_0x5ca090['callback_priority']})['then'](function(_0x22cda5){_0x88b338(null,_0x22cda5);})[_0x4943('0x13')](function(_0x3d91a1){_0x88b338(_0x3d91a1);});};AGIVertices['prototype'][_0x4943('0x4b')]=function(_0x1d3bb8,_0x2579b4){this[_0x4943('0xe')][_0x4943('0x4c')](_0x1d3bb8)['then'](function(_0x3abc4a){_0x2579b4(null,_0x3abc4a?_0x3abc4a[_0x4943('0x12')]:![]);})[_0x4943('0x13')](function(_0x342e62){_0x2579b4(_0x342e62);});};AGIVertices['prototype']['agentPause']=function(_0x273493,_0x1670c9,_0x199038){var _0x58333a={'role':_0x4943('0x4d')};_0x58333a[_0x273493]=this[_0x4943('0x39')][_0x4943('0x3b')];this[_0x4943('0xe')][_0x4943('0x4e')](_0x58333a,_0x1670c9,this[_0x4943('0x39')][_0x4943('0x3d')])[_0x4943('0x16')](function(_0x3bf6e2){_0x199038(null,_[_0x4943('0x44')](_0x3bf6e2)?![]:!![]);})[_0x4943('0x13')](function(_0x2c3614){logger[_0x4943('0x33')](_0x2c3614);_0x199038(null,![]);});};AGIVertices[_0x4943('0x10')][_0x4943('0x4f')]=function(_0x19bde1,_0x4b80d0){var _0x4990d6={'role':_0x4943('0x4d')};_0x4990d6[_0x19bde1]=this['channel'][_0x4943('0x3b')];this[_0x4943('0xe')]['agentUnpause'](_0x4990d6)[_0x4943('0x16')](function(_0x5b958f){_0x4b80d0(null,_['isNil'](_0x5b958f)?![]:!![]);})['catch'](function(_0x5337b3){logger[_0x4943('0x33')](_0x5337b3);_0x4b80d0(null,![]);});};AGIVertices[_0x4943('0x10')][_0x4943('0x50')]=function(_0x113bf4,_0x2b7583){var _0x3027d1={'role':_0x4943('0x4d')};_0x3027d1[_0x113bf4]=this[_0x4943('0x39')][_0x4943('0x3b')];this[_0x4943('0xe')][_0x4943('0x50')](_0x3027d1)[_0x4943('0x16')](function(_0x3ade87){_0x2b7583(null,_[_0x4943('0x44')](_0x3ade87)?![]:!![]);})[_0x4943('0x13')](function(_0xccf705){logger[_0x4943('0x33')](_0xccf705);_0x2b7583(null,![]);});};AGIVertices[_0x4943('0x10')][_0x4943('0x51')]=function(_0x5de4b9,_0x3bab94){var _0x2283bf={'role':_0x4943('0x4d')};_0x2283bf[_0x5de4b9]=this[_0x4943('0x39')][_0x4943('0x3b')];var _0x3ac03a=_0x5de4b9!='internal'?util['format'](_0x4943('0x52'),_0x4943('0x53'),this[_0x4943('0x39')][_0x4943('0x3b')]):undefined;this[_0x4943('0xe')][_0x4943('0x51')](_0x2283bf,_0x3ac03a)['then'](function(_0x2fdfed){_0x3bab94(null,_[_0x4943('0x44')](_0x2fdfed)?![]:!![]);})['catch'](function(_0xf8c1d8){logger[_0x4943('0x33')](_0xf8c1d8);_0x3bab94(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x2bad94,_0x1681d1){sh['exec'](_[_0x4943('0x54')](_0x2bad94),function(_0x5af4ae,_0x25ee2b){var _0x4259df=_0x25ee2b[_0x4943('0x55')](/(\r\n|\n|\r)/gm,'');_0x1681d1(null,_0x4259df);});};AGIVertices[_0x4943('0x10')][_0x4943('0x56')]=function(_0x4b1527,_0x171a67){scripts[_0x4943('0x56')](_0x4b1527[_0x4943('0x57')],_0x4b1527[_0x4943('0x58')]||'text',_0x4b1527[_0x4943('0x59')],_0x4b1527[_0x4943('0x5a')]||'en-US',_0x4b1527[_0x4943('0x5b')]||_0x4943('0x5c'),_0x4b1527['audioEncoding']||_0x4943('0x5d'))[_0x4943('0x16')](function(_0x538878){_0x171a67(null,_0x538878);})['catch'](function(_0x5f4b3b){_0x171a67(_0x5f4b3b);});};AGIVertices['prototype'][_0x4943('0x5e')]=function(_0x17d630,_0x3a593f){scripts['googleTTS'](_0x17d630[_0x4943('0x59')],_0x17d630['google_tts_language']||'en',0x1)[_0x4943('0x16')](function(_0x3f76ee){_0x3a593f(null,_0x3f76ee);})[_0x4943('0x13')](function(_0x5bd674){_0x3a593f(_0x5bd674);});};AGIVertices['prototype']['restAPI']=function(_0x258ee2,_0x2c9039){var _0x4e424a={'uri':_0x258ee2[_0x4943('0x5f')],'method':_0x258ee2['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x258ee2[_0x4943('0x60')])===_0x4943('0x61')&&parseInt(_0x258ee2[_0x4943('0x60')])>=0x1?parseInt(_0x258ee2['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x4943('0x62')]([_0x4943('0x63'),_0x4943('0x64')],_0x4e424a[_0x4943('0x65')]['toUpperCase']())){try{_0x4e424a['body']=_0x258ee2['rawBody']?JSON['parse'](_0x258ee2[_0x4943('0x66')]):{};}catch(_0x5fb75f){logger[_0x4943('0x33')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5fb75f);}}try{_0x4e424a[_0x4943('0x67')]=_0x258ee2['rawHeaders']?JSON[_0x4943('0x68')](_0x258ee2[_0x4943('0x69')]):{};}catch(_0x1b7241){logger[_0x4943('0x33')](_0x4943('0x6a'),_0x1b7241);}if(_0x258ee2[_0x4943('0x6b')]){try{var _0x2e3eeb=require(_0x258ee2['computedVariables'])[_0x4943('0x6c')](this,_0x4e424a);_0x4e424a[_0x4943('0x6d')]=Mustache[_0x4943('0x6e')](_0x258ee2[_0x4943('0x5f')],_0x2e3eeb,{},['$$','$$']);if(_0x4e424a[_0x4943('0x67')]){_0x4e424a[_0x4943('0x67')]=JSON[_0x4943('0x68')](Mustache[_0x4943('0x6e')](JSON[_0x4943('0x6f')](_0x4e424a['headers']),_0x2e3eeb,{},['$$','$$']));}if(_0x4e424a['body']){_0x4e424a['body']=JSON['parse'](Mustache[_0x4943('0x6e')](JSON['stringify'](_0x4e424a['body']),_0x2e3eeb,{},['$$','$$']));}}catch(_0x479593){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x479593);}}rp(_0x4e424a)[_0x4943('0x16')](function(_0x386244){var _0x27a1b8={'statusCode':_0x386244['statusCode']||0xc8,'statusMessage':_0x386244[_0x4943('0x70')]||'OK','headers':_0x386244[_0x4943('0x67')]||{},'body':_0x386244[_0x4943('0x71')]||{}};_0x2c9039(null,_0x27a1b8);})[_0x4943('0x13')](function(_0x52ddee){var _0x1c3d66={'statusCode':_0x52ddee[_0x4943('0x72')]||0x1f4,'statusMessage':_0x52ddee[_0x4943('0x73')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x52ddee[_0x4943('0x74')][_0x4943('0x67')]||{},'body':_0x52ddee[_0x4943('0x74')][_0x4943('0x71')]||{}};_0x2c9039(null,_0x1c3d66);});};AGIVertices[_0x4943('0x10')][_0x4943('0x75')]=function(_0x20a38f,_0x1a61d8){scripts['googleDialogflow'](this[_0x4943('0x39')][_0x4943('0x3d')],_0x20a38f['key'],_0x20a38f[_0x4943('0x59')],_0x20a38f['dialogflow_language']||'en')['then'](function(_0x5117d3){_0x1a61d8(null,_0x5117d3);})[_0x4943('0x13')](function(_0x5d6e4d){_0x1a61d8(_0x5d6e4d);});};AGIVertices[_0x4943('0x10')][_0x4943('0x76')]=function(_0x4fabf3,_0x3af815){scripts[_0x4943('0x76')](this[_0x4943('0x39')][_0x4943('0x3d')],_0x4fabf3[_0x4943('0x77')],_0x4fabf3[_0x4943('0x78')],_0x4fabf3[_0x4943('0x79')],_0x4fabf3[_0x4943('0x59')],_0x4fabf3[_0x4943('0x7a')]||'en')[_0x4943('0x16')](function(_0x59adaf){_0x3af815(null,_0x59adaf);})[_0x4943('0x13')](function(_0x4b3545){_0x3af815(_0x4b3545);});};AGIVertices[_0x4943('0x10')][_0x4943('0x7b')]=function(_0x1a5f51,_0x19c1fc){scripts[_0x4943('0x7b')](this[_0x4943('0x39')],_0x1a5f51)['then'](function(_0x140cee){_0x19c1fc(null,_0x140cee);})[_0x4943('0x13')](function(_0x12ff55){_0x19c1fc(_0x12ff55);});};AGIVertices[_0x4943('0x10')]['ispeechTTS']=function(_0x9728f8,_0x37fc13){scripts[_0x4943('0x7c')](_0x9728f8[_0x4943('0x7d')],_0x9728f8['text'],_0x9728f8[_0x4943('0x7e')]||_0x4943('0x7f'),_0x9728f8[_0x4943('0x80')])[_0x4943('0x16')](function(_0x2bc020){_0x37fc13(null,_0x2bc020);})[_0x4943('0x13')](function(_0x32dd60){_0x37fc13(_0x32dd60);});};AGIVertices[_0x4943('0x10')][_0x4943('0x81')]=function(_0x4880f9,_0x712cf3,_0x33c980){scripts[_0x4943('0x81')](_0x712cf3,_0x4880f9[_0x4943('0x7d')],_0x4880f9['ispeech_asr_language']||'en-US',this['isConfigured'](_0x4880f9[_0x4943('0x82')])?_0x4880f9[_0x4943('0x82')]:undefined)[_0x4943('0x16')](function(_0xc3c2fa){_0x33c980(null,_0xc3c2fa);})[_0x4943('0x13')](function(_0x12cc44){_0x33c980(_0x12cc44);});};AGIVertices[_0x4943('0x10')][_0x4943('0x83')]=function(_0x1cf8da,_0x48ba94){scripts['awsPolly'](_0x1cf8da[_0x4943('0x84')],_0x1cf8da['aws_secret_access_key'],_0x1cf8da[_0x4943('0x85')],_0x1cf8da[_0x4943('0x86')]||'Amy',_0x1cf8da[_0x4943('0x59')],_0x1cf8da[_0x4943('0x87')]||_0x4943('0x59'))[_0x4943('0x16')](function(_0x385bd8){_0x48ba94(null,_0x385bd8);})[_0x4943('0x13')](function(_0x3597d5){_0x48ba94(_0x3597d5);});};AGIVertices['prototype']['awsLex']=function(_0x3ef432,_0x5c2cff){scripts['awsLex'](this[_0x4943('0x39')][_0x4943('0x3d')],_0x3ef432[_0x4943('0x84')],_0x3ef432[_0x4943('0x88')],_0x3ef432[_0x4943('0x89')],_0x3ef432[_0x4943('0x59')],_0x3ef432[_0x4943('0x8a')])[_0x4943('0x16')](function(_0x31510b){_0x5c2cff(null,_0x31510b);})[_0x4943('0x13')](function(_0x4e771a){_0x5c2cff(_0x4e771a);});};AGIVertices[_0x4943('0x10')][_0x4943('0x8b')]=function(_0x50cec8,_0xe8d393,_0xb954a){scripts[_0x4943('0x8b')](_0xe8d393,_0x50cec8[_0x4943('0x7d')],_0x50cec8[_0x4943('0x8c')]||_0x4943('0x7f'))[_0x4943('0x16')](function(_0x16d455){_0xb954a(null,_0x16d455);})[_0x4943('0x13')](function(_0x5c12c8){_0xb954a(_0x5c12c8);});};AGIVertices[_0x4943('0x10')]['tildeASR']=function(_0x164c91,_0x460a82,_0x19e096){scripts[_0x4943('0x8d')](_0x460a82,_0x164c91[_0x4943('0x8e')],_0x164c91['appsecret'],_0x164c91[_0x4943('0x6d')])['then'](function(_0x55c16f){_0x19e096(null,_0x55c16f);})[_0x4943('0x13')](function(_0x34056b){_0x19e096(_0x34056b);});};AGIVertices[_0x4943('0x10')][_0x4943('0x8f')]=function(_0x2c9faa){var _0x564bad=_[_0x4943('0x62')](verticesWithRetry,_0x2c9faa['agicommand'])?_0x2c9faa:_[_0x4943('0x90')](_0x2c9faa);for(var _0x305689 in _0x564bad){if(_0x564bad[_0x4943('0x91')](_0x305689)){if(_0x564bad[_0x305689]&&_[_0x4943('0x92')](_0x564bad[_0x305689])){if(_['includes'](recursiveMapAttributes,_0x305689)){_0x564bad[_0x305689]=this[_0x4943('0x93')](_0x564bad[_0x305689]);}else{_0x564bad[_0x305689]=this[_0x4943('0x94')](_0x564bad[_0x305689]);}}}}return _0x564bad;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x1458dd){for(var _0x981f29 in _0x1458dd){if(_0x1458dd[_0x4943('0x91')](_0x981f29)){if(_[_0x4943('0x95')](_0x1458dd[_0x981f29])){this[_0x4943('0x96')](_0x1458dd[_0x981f29]);}else if(_[_0x4943('0x97')](_0x1458dd[_0x981f29])){for(var _0x5dec5f=0x0;_0x5dec5f<_0x1458dd[_0x981f29]['length'];_0x5dec5f++){this[_0x4943('0x96')](_0x1458dd[_0x981f29][_0x5dec5f]);}}else if(_[_0x4943('0x92')](_0x1458dd[_0x981f29])){_0x1458dd[_0x981f29]=this[_0x4943('0x94')](_0x1458dd[_0x981f29]);}}}};AGIVertices[_0x4943('0x10')]['saveRestApiResult']=function(_0x3153b9,_0x3ff44e){for(var _0x455796 in _0x3153b9){if(_0x3153b9[_0x4943('0x91')](_0x455796)){if(_[_0x4943('0x95')](_0x3153b9[_0x455796])){if(!_[_0x4943('0x46')](_0x3153b9[_0x455796])){this[_0x4943('0x98')](_0x3153b9[_0x455796],util['format'](_0x4943('0x99'),_0x3ff44e,_0x455796));}}else if(_[_0x4943('0x97')](_0x3153b9[_0x455796])){for(var _0x39f43c=0x0;_0x39f43c<_0x3153b9[_0x455796][_0x4943('0x9a')];_0x39f43c++){this[_0x4943('0x98')](_0x3153b9[_0x455796][_0x39f43c],util[_0x4943('0x2a')](_0x4943('0x99'),_0x3ff44e,_0x455796+'['+_0x39f43c+']'));}}else{if(!_[_0x4943('0x44')](_0x3153b9[_0x455796])){this[_0x4943('0x39')][_0x4943('0x9b')](util[_0x4943('0x2a')](_0x4943('0x99'),_0x3ff44e,_0x455796),_0x3153b9[_0x455796]);}}}}};AGIVertices[_0x4943('0x10')][_0x4943('0x93')]=function(_0x4e2264){try{var _0x2b52ce=JSON[_0x4943('0x68')](_0x4e2264);this[_0x4943('0x96')](_0x2b52ce);return JSON[_0x4943('0x6f')](_0x2b52ce);}catch(_0x381b61){return this[_0x4943('0x94')](_0x4e2264);}};AGIVertices['prototype'][_0x4943('0x94')]=function(_0x5cd7c5){var _0x273763=_0x5cd7c5[_0x4943('0x9c')]('{');for(var _0x4aa99b=0x1;_0x4aa99b<_0x273763['length'];_0x4aa99b+=0x1){var _0x50a241=_0x273763[_0x4aa99b][_0x4943('0x9c')]('}');if(_0x50a241[_0x4943('0x9a')]>0x1){_0x5cd7c5=_0x5cd7c5[_0x4943('0x9d')]('{'+_0x50a241[0x0]+'}',this[_0x4943('0x39')][_0x4943('0x9e')](_0x50a241[0x0])[_0x4943('0x9f')]||_0x50a241[0x0]);}}if(_0x273763['length']===0x1){return _0x5cd7c5[_0x4943('0x4a')]();}return this[_0x4943('0x94')](_0x5cd7c5);};AGIVertices[_0x4943('0x10')][_0x4943('0xa0')]=function(_0x5d1248,_0x2cf657){var _0x500ebb=this[_0x4943('0x39')][_0x4943('0x9e')](_0x5d1248);if(_0x500ebb[_0x4943('0xa1')]===-0x1){return _0x500ebb;}logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xa2'),_0x2cf657,_0x500ebb[_0x4943('0x9f')]));return this['channel']['setVariable'](_0x2cf657,_0x500ebb[_0x4943('0x9f')]);};AGIVertices[_0x4943('0x10')]['isConfigured']=function(_0x2c8f55){return _0x2c8f55&&_0x2c8f55!=='0'&&_0x2c8f55!=='-1'&&_0x2c8f55!=='';};AGIVertices[_0x4943('0x10')][_0x4943('0xa3')]=function(_0x429227){this['createSquareDetailsReport'][_0x4943('0x6c')](this,_0x429227,'-');_0x429227[_0x4943('0xa4')]=_0x429227['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4943('0x10')][_0x4943('0xa5')]=function(_0x533ef6){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xa6'),_0x533ef6[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x533ef6[_0x4943('0x59')])){return this['channel'][_0x4943('0xa8')](_0x4943('0xa9'));}var _0x6761be='\x22'+_0x533ef6[_0x4943('0x59')]+'\x22';if(this[_0x4943('0xa7')](_0x533ef6['options'])){_0x6761be+=','+_0x533ef6['options'];}var _0x4a0e4e=this[_0x4943('0x39')][_0x4943('0xaa')](_0x4943('0xab'),_0x6761be);if(_0x4a0e4e[_0x4943('0xa1')]===-0x1){return _0x4a0e4e;}return this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x6761be));};AGIVertices[_0x4943('0x10')][_0x4943('0xac')]=function(_0x44f4b7){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xad'),_0x44f4b7[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x44f4b7[_0x4943('0xae')])){return this[_0x4943('0x39')][_0x4943('0xa8')]('no\x20grammar\x20configured');}var _0x5eb25f=_0x44f4b7[_0x4943('0xae')];if(this['isConfigured'](_0x44f4b7[_0x4943('0x74')])){_0x5eb25f+=','+_0x44f4b7[_0x4943('0x74')];}var _0x409108=this[_0x4943('0x39')][_0x4943('0xaa')]('MRCPRecog',_0x5eb25f);if(_0x409108[_0x4943('0xa1')]===-0x1){return _0x409108;}var _0x3559d2=this[_0x4943('0xa0')](_0x4943('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0x3559d2[_0x4943('0xa1')]===-0x1){return _0x3559d2;}var _0x1f402d=this['getAndSetVariable'](_0x4943('0xb0'),_0x4943('0xb1'));if(_0x1f402d[_0x4943('0xa1')]===-0x1){return _0x1f402d;}var _0x302ad=this['getAndSetVariable']('RECOG_INSTANCE()',_0x4943('0xb2'));if(_0x302ad['result']===-0x1){return _0x302ad;}return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0xb3'),_0x5eb25f));};AGIVertices[_0x4943('0x10')][_0x4943('0xb4')]=function(_0x5f0b34){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xb5'),_0x5f0b34[_0x4943('0x3a')]));return this[_0x4943('0x39')][_0x4943('0xb4')]([_0x5f0b34['command'],_0x5f0b34[_0x4943('0xb6')]]);};AGIVertices[_0x4943('0x10')]['answer']=function(_0x51b82a){logger['info'](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x51b82a['label']));if(this['isConfigured'](_0x51b82a[_0x4943('0x60')])){logger['info'](util['format'](_0x4943('0xb7'),_0x51b82a[_0x4943('0x60')]));var _0x324f26=this[_0x4943('0x39')][_0x4943('0xb8')](_0x51b82a[_0x4943('0x60')]);if(_0x324f26['result']===-0x1){return _0x324f26;}}return this[_0x4943('0x39')][_0x4943('0xb9')]();};AGIVertices[_0x4943('0x10')][_0x4943('0x48')]=function(_0x25c9df){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xba'),_0x25c9df[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x25c9df[_0x4943('0xbb')])){return this['channel']['error'](_0x25c9df,_0x4943('0xbc'));}_0x25c9df[_0x4943('0xbd')]=moment();if(this[_0x4943('0xa7')](_0x25c9df[_0x4943('0xbe')])){_0x25c9df[_0x4943('0xbd')]=moment()['add'](_0x25c9df['delay'],_0x4943('0xbf'));}if(!this[_0x4943('0xa7')](_0x25c9df[_0x4943('0xc0')])){_0x25c9df['callback_priority']=0x2;}this['createCmContact'][_0x4943('0x6c')](this,_0x25c9df);return this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0xc1'),_0x25c9df[_0x4943('0xc2')],_0x25c9df[_0x4943('0xbb')],_0x25c9df['scheduledAt']));};AGIVertices[_0x4943('0x10')]['custom_app']=function(_0x12cd81){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xc3'),_0x12cd81[_0x4943('0x3a')]));var _0x32f9f8=this['channel']['exec'](_0x12cd81[_0x4943('0xc4')],_0x12cd81[_0x4943('0x74')]);if(_0x32f9f8[_0x4943('0xa1')]===-0x1){return _0x32f9f8;}return this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')]('Executed\x20command\x20%s\x20%s',_0x12cd81[_0x4943('0xc4')],_0x12cd81['options']));};AGIVertices[_0x4943('0x10')][_0x4943('0xc5')]=function(_0xc06031){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xc6'),_0xc06031[_0x4943('0x3a')]));if(!this['isConfigured'](_0xc06031[_0x4943('0x59')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xa9'));}var _0x518ec0='\x22'+_0xc06031[_0x4943('0x59')]+'\x22';if(this['isConfigured'](_0xc06031[_0x4943('0x74')])){_0x518ec0+=','+_0xc06031['options'];}var _0x4d119a=this[_0x4943('0x39')][_0x4943('0xaa')](_0x4943('0xab'),_0x518ec0);if(_0x4d119a[_0x4943('0xa1')]===-0x1){return _0x4d119a;}return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x518ec0));};AGIVertices['prototype'][_0x4943('0xc7')]=function(_0x4ab671){logger['info'](util[_0x4943('0x2a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x4ab671[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x4ab671[_0x4943('0x59')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xa9'));}var _0x7778f3='\x22'+_0x4ab671[_0x4943('0x59')]+'\x22';if(this[_0x4943('0xa7')](_0x4ab671[_0x4943('0x74')])){_0x7778f3+=','+_0x4ab671['options'];}var _0x509d8b=this[_0x4943('0x39')]['exec']('MRCPSynth',_0x7778f3);if(_0x509d8b['result']===-0x1){return _0x509d8b;}return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x7778f3));};AGIVertices[_0x4943('0x10')][_0x4943('0xc8')]=function(_0x12be7b){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xc9'),_0x12be7b[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x12be7b[_0x4943('0xae')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xca'));}var _0x55c67f=_0x12be7b[_0x4943('0xae')];if(this[_0x4943('0xa7')](_0x12be7b[_0x4943('0x74')])){_0x55c67f+=','+_0x12be7b[_0x4943('0x74')];}var _0x29e7b0=this[_0x4943('0x39')][_0x4943('0xaa')](_0x4943('0xcb'),_0x55c67f);if(_0x29e7b0[_0x4943('0xa1')]===-0x1){return _0x29e7b0;}var _0x472401=this[_0x4943('0xa0')](_0x4943('0xaf'),_0x4943('0xcc'));if(_0x472401[_0x4943('0xa1')]===-0x1){return _0x472401;}var _0x13922e=this[_0x4943('0xa0')](_0x4943('0xb0'),_0x4943('0xcd'));if(_0x13922e['result']===-0x1){return _0x13922e;}var _0x413c5f=this['getAndSetVariable'](_0x4943('0xce'),_0x4943('0xcf'));if(_0x413c5f[_0x4943('0xa1')]===-0x1){return _0x413c5f;}return this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0xb3'),_0x55c67f));};AGIVertices[_0x4943('0x10')]['sestekasr']=function(_0x983d3d){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x983d3d['label']));if(!this['isConfigured'](_0x983d3d['grammar'])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x153803=_0x983d3d[_0x4943('0xae')];if(this[_0x4943('0xa7')](_0x983d3d[_0x4943('0x74')])){_0x153803+=','+_0x983d3d['options'];}var _0xb50b31=this[_0x4943('0x39')][_0x4943('0xaa')](_0x4943('0xcb'),_0x153803);if(_0xb50b31[_0x4943('0xa1')]===-0x1){return _0xb50b31;}var _0x106ca2=this[_0x4943('0xa0')]('RECOG_CONFIDENCE()',_0x4943('0xd0'));if(_0x106ca2[_0x4943('0xa1')]===-0x1){return _0x106ca2;}var _0x5f519d=this[_0x4943('0xa0')](_0x4943('0xb0'),_0x4943('0xd1'));if(_0x5f519d['result']===-0x1){return _0x5f519d;}var _0x1d0dff=this[_0x4943('0xa0')](_0x4943('0xce'),_0x4943('0xd2'));if(_0x1d0dff[_0x4943('0xa1')]===-0x1){return _0x1d0dff;}return this[_0x4943('0x39')][_0x4943('0xa8')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x153803));};AGIVertices[_0x4943('0x10')][_0x4943('0xd3')]=function(_0x56efc9){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0xd4'),_0x56efc9[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x56efc9[_0x4943('0xd5')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x56efc9,'no\x20database\x20selected');}var _0x7199aa=this[_0x4943('0x18')][_0x4943('0x6c')](this,_0x56efc9['odbc_id']);if(!_0x7199aa){return this[_0x4943('0x39')]['error'](_0x56efc9,_0x4943('0xd6'));}if(!this[_0x4943('0xa7')](_0x56efc9[_0x4943('0x2e')])){return this['channel'][_0x4943('0x33')](_0x56efc9,_0x4943('0xd7'));}var _0x4a1927=_0x56efc9['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0xd8'),_0x4a1927));var _0x366291=this[_0x4943('0xd9')][_0x4943('0x6c')](this,_0x7199aa,_0x4a1927);this[_0x4943('0x38')][_0x4943('0x6c')](this,_0x56efc9,_0x4a1927);if(!this['isConfigured'](_0x56efc9['variable_id'])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xda'));}var _0x15c62d=this[_0x4943('0x9e')][_0x4943('0x6c')](this,_0x56efc9['variable_id']);if(!_0x15c62d){return this['channel'][_0x4943('0x33')](_0x56efc9,_0x4943('0xdb'));}var _0x2596e1=this;_0x366291[_0x4943('0xdc')](function(_0x4598d2,_0x3b50f6){Object['keys'](_0x4598d2)['forEach'](function(_0x5ded72){_0x2596e1[_0x4943('0x39')][_0x4943('0x9b')](util[_0x4943('0x2a')](_0x4943('0xdd'),_0x15c62d,_0x3b50f6,_0x5ded72),_0x4598d2[_0x5ded72]);});});this[_0x4943('0x39')][_0x4943('0x9b')](util[_0x4943('0x2a')]('%s_ROWS_COUNT',_0x15c62d),_0x366291[_0x4943('0x9a')]);return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0xde'),_0x15c62d));};AGIVertices[_0x4943('0x10')]['dial']=function(_0x5cb0c9){logger[_0x4943('0xdf')](util[_0x4943('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x5cb0c9[_0x4943('0x3a')]));if(!this['isConfigured'](_0x5cb0c9[_0x4943('0xe0')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x5cb0c9,_0x4943('0xe1'));}var _0x2cbc1e=this[_0x4943('0xe2')]['sync'](this,_0x5cb0c9[_0x4943('0xe0')]);if(!_0x2cbc1e){return this['channel'][_0x4943('0x33')](_0x5cb0c9,_0x4943('0xe3'));}var _0x33c0f9=this[_0x4943('0x39')][_0x4943('0xaa')](_0x4943('0xe4'),[util['format'](_0x4943('0xe5'),_0x2cbc1e),_0x5cb0c9[_0x4943('0x60')],_0x5cb0c9[_0x4943('0xe6')],_0x5cb0c9[_0x4943('0x5f')]]);if(_0x33c0f9['result']===-0x1){return _0x33c0f9;}return this[_0x4943('0x39')][_0x4943('0xa8')](util['format'](_0x4943('0xe7'),_0x4943('0xe4')));};AGIVertices[_0x4943('0x10')][_0x4943('0xe8')]=function(_0xa79f00){logger['info'](util[_0x4943('0x2a')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0xa79f00['label']));if(!this[_0x4943('0xa7')](_0xa79f00['key'])){return this[_0x4943('0x39')][_0x4943('0xa8')]('no\x20key\x20configured');}if(!this[_0x4943('0xa7')](_0xa79f00[_0x4943('0x59')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xa9'));}this[_0x4943('0x39')][_0x4943('0xe9')]=!![];this[_0x4943('0x38')](_0xa79f00);this['createSquareMessage'](_0xa79f00['text'],'in','','');this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')]('Trying\x20Dialogflow:\x20%s',_0xa79f00[_0x4943('0x59')]));var _0x323395=this[_0x4943('0x75')]['sync'](this,_0xa79f00);if(_0x323395){for(var _0x417193 in _0x323395){if(_0x323395[_0x4943('0x91')](_0x417193)){this[_0x4943('0x39')]['setVariable'](util['format'](_0x4943('0xea'),_0x417193[_0x4943('0xeb')]()),_0x323395[_0x417193]);}}this['createSquareMessage'](_0x323395[_0x4943('0xec')],'out',_0x4943('0xe8'),'');return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0xed'),_0x323395[_0x4943('0xec')]));}return this['channel'][_0x4943('0x33')](_0xa79f00,_0x4943('0xee'));};AGIVertices[_0x4943('0x10')]['dialogflowV2']=function(_0x58d52c){logger[_0x4943('0x30')](util['format'](_0x4943('0xef'),_0x58d52c['label']));if(!this[_0x4943('0xa7')](_0x58d52c[_0x4943('0x77')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xf0'));}if(!this['isConfigured'](_0x58d52c[_0x4943('0x78')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xf1'));}if(!this[_0x4943('0xa7')](_0x58d52c[_0x4943('0x79')])){return this[_0x4943('0x39')][_0x4943('0xa8')]('no\x20private_key\x20configured');}if(!this[_0x4943('0xa7')](_0x58d52c[_0x4943('0x7a')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xf2'));}if(!this['isConfigured'](_0x58d52c['text'])){return this[_0x4943('0x39')][_0x4943('0xa8')]('no\x20text\x20configured');}this[_0x4943('0x39')]['bot']=!![];this[_0x4943('0x38')](_0x58d52c);this[_0x4943('0xf3')](_0x58d52c['text'],'in','','');this[_0x4943('0x39')][_0x4943('0xa8')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x58d52c[_0x4943('0x59')]));var _0x13613c=this[_0x4943('0x76')][_0x4943('0x6c')](this,_0x58d52c);if(_0x13613c){for(var _0x3765f4 in _0x13613c){if(_0x13613c[_0x4943('0x91')](_0x3765f4)){if(_0x3765f4!==_0x4943('0xf4')){this[_0x4943('0x39')]['setVariable'](util[_0x4943('0x2a')](_0x4943('0xea'),_0x3765f4[_0x4943('0xeb')]()),_0x13613c[_0x3765f4]);}}}this['createSquareMessage'](_0x13613c[_0x4943('0xec')],_0x4943('0xf5'),_0x4943('0xf6'),_0x13613c['providerResponse']);return this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0xf7'),_0x13613c[_0x4943('0xec')]));}return this['channel']['error'](_0x58d52c,_0x4943('0xf8'));};AGIVertices[_0x4943('0x10')][_0x4943('0xf9')]=function(_0x3afe6c){logger['info'](util[_0x4943('0x2a')](_0x4943('0xfa'),_0x3afe6c[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x3afe6c[_0x4943('0xfb')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xfc'));}if(!this[_0x4943('0xa7')](_0x3afe6c['username'])){return this['channel']['noop']('no\x20username\x20configured');}if(!this[_0x4943('0xa7')](_0x3afe6c['password'])){return this[_0x4943('0x39')]['noop'](_0x4943('0xfd'));}if(!this['isConfigured'](_0x3afe6c[_0x4943('0xfe')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xa9'));}this[_0x4943('0x39')]['bot']=!![];this[_0x4943('0x38')](_0x3afe6c);this[_0x4943('0xf3')](_0x3afe6c[_0x4943('0x59')],'in','','');this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0xff'),_0x3afe6c[_0x4943('0x59')]));var _0x2e4c95=this[_0x4943('0x7b')][_0x4943('0x6c')](this,_0x3afe6c);if(_0x2e4c95){for(var _0x2942b3 in _0x2e4c95){if(_0x2e4c95[_0x4943('0x91')](_0x2942b3)){this['channel'][_0x4943('0x9b')](util['format'](_0x4943('0x100'),_0x2942b3[_0x4943('0xeb')]()),_0x2e4c95[_0x2942b3]);}}this[_0x4943('0xf3')](_0x2e4c95[_0x4943('0xec')],_0x4943('0xf5'),'sesteknda','');if(_0x2e4c95[_0x4943('0x101')]){this['channel']['noop'](util[_0x4943('0x2a')](_0x4943('0x102'),_0x2e4c95[_0x4943('0x101')]));var _0x5a6be0=this['channel'][_0x4943('0x103')](_0x2e4c95[_0x4943('0x101')]);try{fs[_0x4943('0x104')](_0x2e4c95['audiofile']+_0x4943('0x105'));}catch(_0x1720d1){logger[_0x4943('0x33')](_0x1720d1);}return _0x5a6be0;}else{return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x106'),_0x2e4c95[_0x4943('0xec')]));}}return this[_0x4943('0x39')][_0x4943('0x33')](_0x3afe6c,_0x4943('0x107'));};AGIVertices[_0x4943('0x10')]['end']=function(_0x51a373){logger['info'](util[_0x4943('0x2a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x51a373['label']));return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x108'));};AGIVertices[_0x4943('0x10')][_0x4943('0x109')]=function(_0x1e0bbb){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1e0bbb[_0x4943('0x3a')]));var _0x13a6ce='';if(_0x1e0bbb[_0x4943('0x10a')]){if(!this[_0x4943('0xa7')](_0x1e0bbb[_0x4943('0x10a')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x1e0bbb,_0x4943('0x10b'));}else{var _0x40b290=parseInt(_0x1e0bbb[_0x4943('0x10a')],0xa);if(isNaN(_0x40b290)){_0x13a6ce=_0x1e0bbb[_0x4943('0x10a')];}else{_0x13a6ce=this[_0x4943('0x1b')][_0x4943('0x6c')](this,_0x1e0bbb[_0x4943('0x10a')]);if(!_0x13a6ce){return this[_0x4943('0x39')][_0x4943('0x33')](_0x1e0bbb,'no\x20trunk\x20found');}}}}else if(_0x1e0bbb['trunk_name']){_0x13a6ce=_0x1e0bbb[_0x4943('0x10c')];}else{return this['channel'][_0x4943('0x33')](_0x1e0bbb,_0x4943('0x10b'));}var _0x596769=this['channel']['exec'](_0x4943('0xe4'),[util['format']('SIP/%s/%s',_0x13a6ce,_0x1e0bbb[_0x4943('0xc2')]),_0x1e0bbb['timeout'],_0x1e0bbb[_0x4943('0xe6')],_0x1e0bbb['url']]);if(_0x596769[_0x4943('0xa1')]===-0x1){return _0x596769;}return this[_0x4943('0x39')][_0x4943('0xa8')](util['format']('Executed\x20command\x20%s',_0x4943('0xe4')));};AGIVertices[_0x4943('0x10')][_0x4943('0x10d')]=function(_0x3c84f8){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x10e'),_0x3c84f8[_0x4943('0x3a')]));return this['channel']['noop'](_0x4943('0x10d'));};AGIVertices[_0x4943('0x10')]['getdigits']=function(_0x4c5f14){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4c5f14[_0x4943('0x3a')]));if(_0x4c5f14[_0x4943('0xa4')]===0x0){return this[_0x4943('0xa3')](_0x4c5f14);}_0x4c5f14[_0x4943('0xa4')]-=0x1;if(!this['isConfigured'](_0x4c5f14[_0x4943('0x10f')])){return this[_0x4943('0x39')]['error'](_0x4c5f14,_0x4943('0x110'));}var _0x38cdf2=this[_0x4943('0x1d')][_0x4943('0x6c')](this,_0x4c5f14[_0x4943('0x10f')]);if(!_0x38cdf2){return this[_0x4943('0x39')]['error'](_0x4c5f14,_0x4943('0x111'));}if(!this[_0x4943('0xa7')](_0x4c5f14['variable_id'])){return this['channel'][_0x4943('0x33')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1320fb=this['channel']['getData'](_0x38cdf2,_0x4c5f14[_0x4943('0x112')],_0x4c5f14[_0x4943('0x113')]);var _0x4bd66f=_0x1320fb[_0x4943('0xa1')]?_0x1320fb[_0x4943('0xa1')][_0x4943('0x4a')]():'';logger['info'](_0x4943('0x114'),JSON[_0x4943('0x6f')](_0x1320fb));if(_0x1320fb[_0x4943('0xa1')]===-0x1){this[_0x4943('0x38')][_0x4943('0x6c')](this,_0x4c5f14,_0x4bd66f);return _0x1320fb;}else if(_0x1320fb[_0x4943('0x9f')]===_0x4943('0x60')){_0x1320fb[_0x4943('0xa1')]=_0x4bd66f[_0x4943('0x9a')]>=parseInt(_0x4c5f14['mindigit'])?'x':'i';}else{_0x1320fb['result']=_0x4bd66f[_0x4943('0x9a')]>=parseInt(_0x4c5f14[_0x4943('0x115')])&&_0x4bd66f['length']<=parseInt(_0x4c5f14[_0x4943('0x113')])?'x':'i';}var _0x44ac4f=this[_0x4943('0x9e')]['sync'](this,_0x4c5f14[_0x4943('0x116')]);if(!_0x44ac4f){return this[_0x4943('0x39')]['error'](_0x4c5f14,_0x4943('0xdb'));}this[_0x4943('0x39')][_0x4943('0x9b')](_0x44ac4f,_0x4bd66f);if(this[_0x4943('0xa7')](_0x4c5f14[_0x4943('0x117')])){var _0x556cae=parseInt(_0x4c5f14[_0x4943('0x117')],0xa);var _0x23c003=rs['generate']({'charset':'*','length':_0x556cae});var _0x2e0e84=_0x4bd66f[_0x4943('0x9a')];if(_0x2e0e84>0x0){if(_0x2e0e84>_0x556cae){this[_0x4943('0x38')][_0x4943('0x6c')](this,_0x4c5f14,_0x4c5f14[_0x4943('0x118')]===_0x4943('0x119')?_0x23c003+_0x4bd66f[_0x4943('0x11a')](_0x556cae):_0x4bd66f[_0x4943('0x11a')](0x0,_0x2e0e84-_0x556cae)+_0x23c003);}else{this[_0x4943('0x38')][_0x4943('0x6c')](this,_0x4c5f14,rs['generate']({'charset':'*','length':_0x2e0e84}));}}else{this[_0x4943('0x38')]['sync'](this,_0x4c5f14,'');}}else{this['createSquareDetailsReport'][_0x4943('0x6c')](this,_0x4c5f14,_0x4bd66f);}return _0x1320fb;};AGIVertices[_0x4943('0x10')]['getsecretdigits']=function(_0x5525c5){logger['info'](util[_0x4943('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5525c5['label']));return this['getdigits'](_0x5525c5);};AGIVertices[_0x4943('0x10')]['goal']=function(_0x42f1f2){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x11b'),_0x42f1f2[_0x4943('0x3a')]));this[_0x4943('0x38')][_0x4943('0x6c')](this,_0x42f1f2,_0x42f1f2[_0x4943('0x11c')]);return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')]('GOAL\x20%s',_0x42f1f2[_0x4943('0x11c')]));};AGIVertices[_0x4943('0x10')][_0x4943('0x11d')]=function(_0x331d48){logger['info'](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x331d48[_0x4943('0x3a')]));if(!this['isConfigured'](_0x331d48[_0x4943('0x84')])||!this[_0x4943('0xa7')](_0x331d48[_0x4943('0x88')])){return this['channel'][_0x4943('0xa8')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4943('0xa7')](_0x331d48[_0x4943('0x59')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xa9'));}this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')](_0x4943('0x11e'),_0x331d48[_0x4943('0x59')]));var _0x1006ab=this[_0x4943('0x83')][_0x4943('0x6c')](this,_0x331d48);if(_0x1006ab){this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x11f'),_0x1006ab));var _0x3f4b5a=this[_0x4943('0x39')]['streamFile'](_0x1006ab);try{fs[_0x4943('0x104')](_0x1006ab+_0x4943('0x105'));}catch(_0x4f8d4a){logger[_0x4943('0x33')](_0x4f8d4a);}return _0x3f4b5a;}return this[_0x4943('0x39')]['error'](_0x331d48,_0x4943('0x120'));};AGIVertices['prototype'][_0x4943('0x121')]=function(_0x48a36e){logger[_0x4943('0x30')](util['format'](_0x4943('0x122'),_0x48a36e[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x48a36e['aws_access_key_id'])||!this[_0x4943('0xa7')](_0x48a36e[_0x4943('0x88')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x123'));}if(!this['isConfigured'](_0x48a36e[_0x4943('0x8a')])){return this[_0x4943('0x39')]['noop'](_0x4943('0x124'));}if(!this[_0x4943('0xa7')](_0x48a36e[_0x4943('0x59')])){return this['channel']['noop'](_0x4943('0xa9'));}this[_0x4943('0x39')][_0x4943('0xe9')]=!![];this[_0x4943('0x38')](_0x48a36e);this[_0x4943('0xf3')](_0x48a36e[_0x4943('0x59')],'in','','');this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x125'),_0x48a36e[_0x4943('0x59')]));var _0xd5bf10=this[_0x4943('0x126')][_0x4943('0x6c')](this,_0x48a36e);if(_0xd5bf10){for(var _0x1acdc1 in _0xd5bf10){if(_0xd5bf10['hasOwnProperty'](_0x1acdc1)&&_[_0x4943('0x92')](_0xd5bf10[_0x1acdc1])){this[_0x4943('0x39')][_0x4943('0x9b')](util['format'](_0x4943('0x127'),_0x1acdc1['toUpperCase']()),_0xd5bf10[_0x1acdc1]);}}if(_[_0x4943('0x44')](_0xd5bf10[_0x4943('0x73')])){return this['channel']['noop'](_0x4943('0x128'));}else{this[_0x4943('0xf3')](_0xd5bf10[_0x4943('0x73')],_0x4943('0xf5'),_0x4943('0x129'),'');return this[_0x4943('0x39')][_0x4943('0xa8')](util['format'](_0x4943('0x12a'),_0xd5bf10['message']));}}return this[_0x4943('0x39')][_0x4943('0x33')](_0x48a36e,_0x4943('0x12b'));};AGIVertices[_0x4943('0x10')][_0x4943('0x12c')]=function(_0xb36fc1){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0xb36fc1[_0x4943('0x3a')],_0xb36fc1[_0x4943('0x60')]));if(!this[_0x4943('0xa7')](_0xb36fc1[_0x4943('0x7d')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x12d'));}var _0x5d21a1=_0x4943('0x12e');var _0x381ee8=util[_0x4943('0x2a')](_0x4943('0x12f'),FILES_PATH,rs[_0x4943('0x130')](0x4));var _0x53966d=util[_0x4943('0x2a')](_0x4943('0x99'),_0x381ee8,_0x5d21a1);var _0x4ca081=!![];if(_0xb36fc1[_0x4943('0x131')]==='NOBEEP'){_0x4ca081=![];}var _0x491ca7=this[_0x4943('0x39')][_0x4943('0x132')](_0x381ee8,_0x5d21a1,_0xb36fc1['intKey'],_0xb36fc1[_0x4943('0x60')],undefined,_0x4ca081);if(_0x491ca7[_0x4943('0xa1')]!==-0x1){this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')]('google\x20%s\x20file\x20created',_0x53966d));var _0x401ae2=this[_0x4943('0x8b')]['sync'](this,_0xb36fc1,_0x53966d);if(_0x401ae2){for(var _0x51db3b in _0x401ae2){if(_0x401ae2[_0x4943('0x91')](_0x51db3b)){this[_0x4943('0x39')][_0x4943('0x9b')](util[_0x4943('0x2a')]('GOOGLE_ASR_%s',_0x51db3b[_0x4943('0xeb')]()),_0x401ae2[_0x51db3b]);}}return this[_0x4943('0x39')][_0x4943('0xa8')](util['format'](_0x4943('0x133'),JSON[_0x4943('0x6f')](_0x401ae2)));}}return _0x491ca7;};AGIVertices['prototype']['tildeasr']=function(_0x2b2847){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x134'),_0x2b2847[_0x4943('0x3a')]));if(!this['isConfigured'](_0x2b2847[_0x4943('0x8e')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x135'));}if(!this[_0x4943('0xa7')](_0x2b2847[_0x4943('0x136')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x137'));}var _0x765d48=_0x4943('0x12e');var _0x520798=util[_0x4943('0x2a')](_0x4943('0x12f'),FILES_PATH,rs[_0x4943('0x130')](0x4));var _0x1a199a=util[_0x4943('0x2a')](_0x4943('0x99'),_0x520798,_0x765d48);var _0xfaad8c=!![];if(_0x2b2847[_0x4943('0x131')]===_0x4943('0x138')){_0xfaad8c=![];}var _0x5bab12=this[_0x4943('0x39')]['recordFile'](_0x520798,_0x765d48,_0x2b2847[_0x4943('0x139')],_0x2b2847[_0x4943('0x60')],undefined,_0xfaad8c);if(_0x5bab12[_0x4943('0xa1')]!==-0x1){this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')]('tilde\x20%s\x20file\x20created',_0x1a199a));var _0x1bf9cd=this['tildeASR'][_0x4943('0x6c')](this,_0x2b2847,_0x1a199a);if(_0x1bf9cd){for(var _0x259547 in _0x1bf9cd){if(_0x1bf9cd['hasOwnProperty'](_0x259547)){this[_0x4943('0x39')][_0x4943('0x9b')](util['format'](_0x4943('0x13a'),_0x259547[_0x4943('0xeb')]()),_0x1bf9cd[_0x259547]);}}return this[_0x4943('0x39')]['noop'](util['format'](_0x4943('0x13b'),JSON['stringify'](_0x1bf9cd)));}}return _0x5bab12;};AGIVertices['prototype'][_0x4943('0x13c')]=function(_0x4566e0){logger[_0x4943('0x30')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4566e0[_0x4943('0x3a')]));return this[_0x4943('0x39')][_0x4943('0x13d')](_0x4566e0[_0x4943('0x3f')],_0x4566e0[_0x4943('0x40')],_0x4566e0[_0x4943('0x13e')]);};AGIVertices['prototype'][_0x4943('0x13f')]=function(_0x4cc9f7){logger[_0x4943('0x30')](util['format'](_0x4943('0x140'),_0x4cc9f7[_0x4943('0x3a')]));if(!this['isConfigured'](_0x4cc9f7[_0x4943('0x141')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x4cc9f7,'no\x20condition\x20configured');}try{var _0x408b03=eval(_0x4cc9f7[_0x4943('0x141')])?'true':'false';this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x142'),_0x4cc9f7[_0x4943('0x141')],_0x408b03));return{'code':0xc8,'result':_0x408b03};}catch(_0x3206ac){return{'code':0xc8,'result':_0x4943('0x143')};}};AGIVertices['prototype'][_0x4943('0x144')]=function(_0x3f457f){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x3f457f[_0x4943('0x3a')]));if(!this['isConfigured'](_0x3f457f[_0x4943('0x145')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x3f457f,_0x4943('0x146'));}var _0x223916=this[_0x4943('0x24')][_0x4943('0x6c')](this,_0x3f457f[_0x4943('0x145')]);if(!_0x223916){return this[_0x4943('0x39')][_0x4943('0x33')](_0x3f457f,'no\x20intervals\x20found');}for(var _0x4eaaff=0x0;_0x4eaaff<_0x223916[_0x4943('0x9a')];_0x4eaaff+=0x1){var _0x42af9c=this[_0x4943('0x39')][_0x4943('0x9e')](util[_0x4943('0x2a')]('IFTIME(%s?true:false)',_0x223916[_0x4eaaff]));if(_0x42af9c[_0x4943('0xa1')]===-0x1){return _0x42af9c;}logger['info'](util[_0x4943('0x2a')](_0x4943('0x147'),_0x223916[_0x4eaaff],_0x42af9c[_0x4943('0x9f')]));if(_0x42af9c[_0x4943('0x9f')]===_0x4943('0x148')){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x147'),_0x223916[_0x4eaaff],_0x4943('0x148')));this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x147'),_0x223916[_0x4eaaff],_0x4943('0x148')));return{'code':0xc8,'result':_0x4943('0x148')};}else{logger['info'](util[_0x4943('0x2a')](_0x4943('0x147'),_0x223916[_0x4eaaff],_0x4943('0x143')));this[_0x4943('0x39')][_0x4943('0xa8')](util['format'](_0x4943('0x147'),_0x223916[_0x4eaaff],_0x4943('0x143')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x4943('0x10')]['hangup']=function(_0x263aa7){logger['info'](util['format'](_0x4943('0x149'),_0x263aa7[_0x4943('0x3a')]));return this[_0x4943('0x39')]['hangup']();};AGIVertices[_0x4943('0x10')][_0x4943('0x14a')]=function(_0x58278c){logger['info'](util[_0x4943('0x2a')](_0x4943('0x14b'),_0x58278c['label']));if(!this['isConfigured'](_0x58278c[_0x4943('0x7d')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x12d'));}var _0x2528ae='wav';var _0x1ac894=util['format'](_0x4943('0x12f'),FILES_PATH,rs[_0x4943('0x130')](0x4));var _0x8fb21c=util[_0x4943('0x2a')](_0x4943('0x99'),_0x1ac894,_0x2528ae);var _0x1ce968=!![];if(_0x58278c[_0x4943('0x131')]===_0x4943('0x138')){_0x1ce968=![];}var _0x30a824=this[_0x4943('0x39')]['recordFile'](_0x1ac894,_0x2528ae,_0x58278c['intKey'],_0x58278c['timeout'],undefined,_0x1ce968);if(_0x30a824['result']!==-0x1){this['channel'][_0x4943('0xa8')](util[_0x4943('0x2a')]('ispeech\x20%s\x20file\x20created',_0x8fb21c));var _0x281c73=this[_0x4943('0x81')]['sync'](this,_0x58278c,_0x8fb21c);if(_0x281c73){for(var _0x4cc5ee in _0x281c73){if(_0x281c73['hasOwnProperty'](_0x4cc5ee)){this[_0x4943('0x39')][_0x4943('0x9b')](util['format'](_0x4943('0x14c'),_0x4cc5ee[_0x4943('0xeb')]()),_0x281c73[_0x4cc5ee]);}}return this[_0x4943('0x39')][_0x4943('0xa8')](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x281c73)));}}return _0x30a824;};AGIVertices[_0x4943('0x10')][_0x4943('0x14d')]=function(_0x52ed22){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x14e'),_0x52ed22[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x52ed22[_0x4943('0x7d')])){return this[_0x4943('0x39')][_0x4943('0xa8')]('no\x20key\x20configured');}if(!this[_0x4943('0xa7')](_0x52ed22[_0x4943('0x59')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xa9'));}this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x14f'),_0x52ed22[_0x4943('0x59')]));var _0x3b12a0=this[_0x4943('0x7c')]['sync'](this,_0x52ed22);if(_0x3b12a0){this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x150'),_0x3b12a0));var _0x570e65=this[_0x4943('0x39')]['streamFile'](_0x3b12a0,_0x52ed22['intKey']);try{fs['unlink'](_0x3b12a0+_0x4943('0x105'));}catch(_0xc64bc4){logger[_0x4943('0x33')](_0xc64bc4);}return _0x570e65;}return this[_0x4943('0x39')][_0x4943('0x33')](_0x52ed22,_0x4943('0x151'));};AGIVertices['prototype'][_0x4943('0x152')]=function(_0x51f289){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x153'),_0x51f289[_0x4943('0x3a')]));if(!this['isConfigured'](_0x51f289[_0x4943('0x154')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x51f289,_0x4943('0x155'));}logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x156'),this['channel'][_0x4943('0x3b')],_0x51f289[_0x4943('0x154')]));var _0x1b85b3=this['agentLogin'][_0x4943('0x6c')](this,_0x51f289[_0x4943('0x154')]);if(_0x1b85b3){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x157'),this['channel']['callerid'],_0x51f289[_0x4943('0x154')]));this[_0x4943('0x39')][_0x4943('0xa8')](util['format'](_0x4943('0x157'),this[_0x4943('0x39')]['callerid'],_0x51f289[_0x4943('0x154')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x158'),this[_0x4943('0x39')][_0x4943('0x3b')],_0x51f289[_0x4943('0x154')]));this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x158'),this[_0x4943('0x39')]['callerid'],_0x51f289['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x4943('0x159')]=function(_0x40a4d3){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x15a'),_0x40a4d3['label']));if(!this[_0x4943('0xa7')](_0x40a4d3[_0x4943('0x154')])){return this[_0x4943('0x39')]['error'](_0x40a4d3,_0x4943('0x155'));}logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x156'),this[_0x4943('0x39')][_0x4943('0x3b')],_0x40a4d3[_0x4943('0x154')]));var _0x1edc35=this[_0x4943('0x50')][_0x4943('0x6c')](this,_0x40a4d3['findBy']);if(_0x1edc35){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4943('0x39')][_0x4943('0x3b')],_0x40a4d3[_0x4943('0x154')]));this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')](_0x4943('0x157'),this[_0x4943('0x39')][_0x4943('0x3b')],_0x40a4d3[_0x4943('0x154')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4943('0x30')](util['format'](_0x4943('0x158'),this['channel'][_0x4943('0x3b')],_0x40a4d3[_0x4943('0x154')]));this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')](_0x4943('0x158'),this[_0x4943('0x39')][_0x4943('0x3b')],_0x40a4d3[_0x4943('0x154')]));return{'code':0xc8,'result':_0x4943('0x15b')};}};AGIVertices[_0x4943('0x10')]['math']=function(_0x4441ec){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x15c'),_0x4441ec[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x4441ec[_0x4943('0x15d')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x4441ec,_0x4943('0x15e'));}this['channel'][_0x4943('0xa8')](util['format'](_0x4943('0x15f'),_0x4441ec[_0x4943('0x15d')]));var _0x238358=eval(_0x4441ec[_0x4943('0x15d')]);if(!this[_0x4943('0xa7')](_0x4441ec['variable_id'])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xda'));}var _0x9896ea=this['getVariable'][_0x4943('0x6c')](this,_0x4441ec[_0x4943('0x116')]);if(!_0x9896ea){return this['channel'][_0x4943('0x33')](_0x4441ec,'no\x20variable\x20found');}if(_['isArray'](_0x238358)){var _0x14c02d=this;_0x238358['forEach'](function(_0x123337,_0x5f13bb){_0x14c02d[_0x4943('0x39')][_0x4943('0x9b')](util['format'](_0x4943('0x160'),_0x9896ea,_0x5f13bb),_0x123337);});return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')]('variable\x20%s[key]\x20set',_0x9896ea));}else{return this[_0x4943('0x39')][_0x4943('0x9b')](_0x9896ea,_0x238358);}};AGIVertices[_0x4943('0x10')][_0x4943('0xb')]=function(_0xb9227){logger[_0x4943('0x30')](util['format'](_0x4943('0x161'),_0xb9227[_0x4943('0x3a')]));if(_0xb9227[_0x4943('0xa4')]===0x0){return this[_0x4943('0xa3')](_0xb9227);}_0xb9227['retry']-=0x1;if(!this[_0x4943('0xa7')](_0xb9227[_0x4943('0x10f')])){return this['channel'][_0x4943('0x33')](_0xb9227,_0x4943('0x110'));}var _0x376014=this[_0x4943('0x1d')]['sync'](this,_0xb9227[_0x4943('0x10f')]);if(!_0x376014){return this['channel'][_0x4943('0x33')](_0xb9227,_0x4943('0x111'));}var _0x5e690d=this['channel'][_0x4943('0x162')](_0x376014,_0xb9227[_0x4943('0x112')],_0xb9227[_0x4943('0x163')]);var _0x57084b=_0x5e690d['result'];if(_0x5e690d[_0x4943('0xa1')]===-0x1){this[_0x4943('0x38')][_0x4943('0x6c')](this,_0xb9227,'-1');return _0x5e690d;}else if(_0x5e690d[_0x4943('0x9f')]==='timeout'){_0x5e690d['result']=_0x5e690d[_0x4943('0xa1')]['length']>0x0?_0x5e690d['result']:'t';}else if(_[_0x4943('0x46')](_0x5e690d[_0x4943('0xa1')])){_0x5e690d[_0x4943('0xa1')]='#';_0x57084b='#';}if(!this['isConfigured'](_0xb9227[_0x4943('0x116')])){this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0xda'));}else{var _0x13aae0=this['getVariable'][_0x4943('0x6c')](this,_0xb9227[_0x4943('0x116')]);if(!_0x13aae0){return this[_0x4943('0x39')][_0x4943('0x33')](_0xb9227,_0x4943('0xdb'));}this[_0x4943('0x39')]['setVariable'](_0x13aae0,_0x57084b);}this['createSquareDetailsReport'][_0x4943('0x6c')](this,_0xb9227,_0x57084b);return _0x5e690d;};AGIVertices['prototype'][_0x4943('0xa8')]=function(_0xf4c13a){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x164'),_0xf4c13a[_0x4943('0x3a')]));return this[_0x4943('0x39')][_0x4943('0xa8')](_0xf4c13a[_0x4943('0x165')]||_0xf4c13a[_0x4943('0x3a')]);};AGIVertices[_0x4943('0x10')][_0x4943('0x166')]=function(_0x444f10){logger[_0x4943('0x30')](util['format'](_0x4943('0x167'),_0x444f10[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x444f10[_0x4943('0x154')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x444f10,_0x4943('0x155'));}logger['info'](util['format'](_0x4943('0x156'),this[_0x4943('0x39')][_0x4943('0x3b')],_0x444f10[_0x4943('0x154')]));var _0x4cdf67=this[_0x4943('0x4b')][_0x4943('0x6c')](this,_0x444f10[_0x4943('0x168')]);var _0x3f5f6e=this['agentPause']['sync'](this,_0x444f10[_0x4943('0x154')],_0x4cdf67);if(_0x3f5f6e){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x157'),this[_0x4943('0x39')]['callerid'],_0x444f10['findBy']));this['channel'][_0x4943('0xa8')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4943('0x39')][_0x4943('0x3b')],_0x444f10['findBy']));return{'code':0xc8,'result':_0x4943('0x169')};}else{logger[_0x4943('0x30')](util['format'](_0x4943('0x158'),this[_0x4943('0x39')][_0x4943('0x3b')],_0x444f10[_0x4943('0x154')]));this[_0x4943('0x39')]['noop'](util['format'](_0x4943('0x157'),this[_0x4943('0x39')][_0x4943('0x3b')],_0x444f10[_0x4943('0x154')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4943('0x10')][_0x4943('0x16a')]=function(_0x3c69c0){logger['info'](util['format'](_0x4943('0x16b'),_0x3c69c0[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x3c69c0[_0x4943('0x10f')])){return this[_0x4943('0x39')]['error'](_0x3c69c0,_0x4943('0x110'));}var _0x4ec7df=this[_0x4943('0x1d')][_0x4943('0x6c')](this,_0x3c69c0['file_id']);if(!_0x4ec7df){return this[_0x4943('0x39')]['error'](_0x3c69c0,'no\x20file\x20audio\x20found');}var _0xfb10c4=this[_0x4943('0x39')][_0x4943('0xaa')](_0x4943('0x16c'),[_0x4ec7df,_0x3c69c0[_0x4943('0xe6')]]);if(_0xfb10c4[_0x4943('0xa1')]===-0x1){return _0xfb10c4;}return this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')](_0x4943('0x16d'),_0x4943('0x16c'),_0x4ec7df));};AGIVertices[_0x4943('0x10')][_0x4943('0x16e')]=function(_0xa3ccef){logger['info'](util[_0x4943('0x2a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0xa3ccef[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0xa3ccef[_0x4943('0x16f')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0xa3ccef,_0x4943('0x170'));}var _0x4fc5f7='';var _0xfb92e=parseInt(_0xa3ccef[_0x4943('0x16f')],0xa);if(isNaN(_0xfb92e)){_0x4fc5f7=_0xa3ccef['queue_id'];}else{_0x4fc5f7=this[_0x4943('0x14')][_0x4943('0x6c')](this,_0xa3ccef[_0x4943('0x16f')]);if(!_0x4fc5f7){return this[_0x4943('0x39')][_0x4943('0x33')](_0xa3ccef,_0x4943('0x171'));}}var _0x1661af='';if(this[_0x4943('0xa7')](_0xa3ccef[_0x4943('0x10f')])){var _0x160ce7=this[_0x4943('0x1d')][_0x4943('0x6c')](this,_0xa3ccef[_0x4943('0x10f')]);if(_0x160ce7){_0x1661af=_0x160ce7;}}this[_0x4943('0x38')][_0x4943('0x6c')](this,_0xa3ccef,_0x4fc5f7);if(_0xa3ccef[_0x4943('0xe6')][_0x4943('0x172')]('x')<0x0){_0xa3ccef[_0x4943('0xe6')]+='x';}if(_0xa3ccef[_0x4943('0xe6')][_0x4943('0x172')]('X')<0x0){_0xa3ccef[_0x4943('0xe6')]+='X';}this[_0x4943('0x39')]['setVariable'](_0x4943('0x173'),_0x4fc5f7?_0x4fc5f7[_0x4943('0x174')]():'');var _0x24688e=this[_0x4943('0x39')][_0x4943('0xaa')](_0x4943('0x175'),[_0x4fc5f7,_0xa3ccef[_0x4943('0xe6')],_0xa3ccef[_0x4943('0x5f')],_0x1661af,_0xa3ccef['timeout'],_0xa3ccef[_0x4943('0xb4')],_0xa3ccef['macro'],_0xa3ccef[_0x4943('0x176')],'',_0xa3ccef[_0x4943('0x177')]]);if(_0x24688e[_0x4943('0xa1')]===-0x1){return _0x24688e;}return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')]('Executed\x20command\x20%s\x20%s',_0x4943('0x175'),_0x4fc5f7));};AGIVertices[_0x4943('0x10')][_0x4943('0x178')]=function(_0x33c618){logger[_0x4943('0x30')](util['format'](_0x4943('0x179'),_0x33c618[_0x4943('0x3a')]));var _0x45a0f7=_0x33c618['recordingFormat']||'wav';var _0x10bd01=util[_0x4943('0x2a')](_0x4943('0x17a'),this[_0x4943('0x39')][_0x4943('0x3d')],rs[_0x4943('0x130')](0x5));var _0xc4ae9b=util[_0x4943('0x2a')](_0x4943('0x17b'),FILES_PATH,_0x10bd01,_0x45a0f7);var _0x1929c0=util[_0x4943('0x2a')](_0x4943('0x12f'),FILES_PATH,_0x10bd01);this[_0x4943('0x3c')][_0x4943('0x6c')](this,_0x33c618,_0x10bd01,_0xc4ae9b);this['channel'][_0x4943('0x9b')](_0x4943('0x17c'),_0x10bd01);logger['info'](_0x4943('0x17d'),_0x1929c0,_0x45a0f7,_0x33c618[_0x4943('0x17e')],_0x33c618[_0x4943('0x60')]);return this[_0x4943('0x39')][_0x4943('0x132')](_0x1929c0,_0x45a0f7,_0x33c618[_0x4943('0x17e')],_0x33c618[_0x4943('0x60')],undefined,!![]);};AGIVertices[_0x4943('0x10')][_0x4943('0x17f')]=function(_0x291595){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x180'),_0x291595['label']));if(!this[_0x4943('0xa7')](_0x291595[_0x4943('0x5f')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x181'));}var _0x4ccc78=this['restAPI'][_0x4943('0x6c')](this,_0x291595);logger['info'](util[_0x4943('0x2a')]('Response:',util['inspect'](_0x4ccc78,{'showHidden':![],'depth':null})));if(!this[_0x4943('0xa7')](_0x291595[_0x4943('0x116')])){return this[_0x4943('0x39')][_0x4943('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x94a5c6=this[_0x4943('0x9e')][_0x4943('0x6c')](this,_0x291595['variable_id']);if(!_0x94a5c6){return this['channel']['error'](_0x291595,'no\x20variable\x20found');}this['channel'][_0x4943('0x9b')](util[_0x4943('0x2a')]('%s_STATUS_CODE',_0x94a5c6),_0x4ccc78[_0x4943('0x72')]?_0x4ccc78[_0x4943('0x72')]:_0x4943('0x182'));this[_0x4943('0x39')][_0x4943('0x9b')](util[_0x4943('0x2a')](_0x4943('0x183'),_0x94a5c6),_0x4ccc78['statusMessage']?_0x4ccc78['statusMessage']:'OK');if(_0x4ccc78['body']){try{this[_0x4943('0x98')](_0x4ccc78[_0x4943('0x71')],_0x94a5c6);}catch(_0x4cafab){logger[_0x4943('0x33')](util['format'](_0x4943('0x184'),_0x94a5c6));}}return this['channel'][_0x4943('0xa8')](util['format'](_0x4943('0xde'),_0x94a5c6));};AGIVertices['prototype'][_0x4943('0x185')]=function(_0x53c477){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x53c477[_0x4943('0x3a')]));return this[_0x4943('0x39')]['sayDigits'](_0x53c477[_0x4943('0x186')]['replace'](/\s+/g,''),_0x53c477[_0x4943('0x17e')]);};AGIVertices[_0x4943('0x10')][_0x4943('0x187')]=function(_0x41a67b){logger[_0x4943('0x30')](util['format'](_0x4943('0x188'),_0x41a67b[_0x4943('0x3a')]));return this[_0x4943('0x39')][_0x4943('0x189')](_0x41a67b[_0x4943('0x61')]['replace'](/\s+/g,''),_0x41a67b[_0x4943('0x17e')]);};AGIVertices[_0x4943('0x10')][_0x4943('0x18a')]=function(_0x34dbbe){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x34dbbe[_0x4943('0x3a')]));return this['channel'][_0x4943('0x18b')](_0x34dbbe[_0x4943('0x59')],_0x34dbbe[_0x4943('0x17e')]);};AGIVertices[_0x4943('0x10')]['sendMail']=function(_0x173e53){logger['info'](util[_0x4943('0x2a')](_0x4943('0x18c'),_0x173e53[_0x4943('0x3a')]));if(!this['isConfigured'](_0x173e53['account_id'])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x18d'));}var _0x2a2224=this[_0x4943('0x21')]['sync'](this,_0x173e53[_0x4943('0x18e')]);if(!_0x2a2224||!_0x2a2224[_0x4943('0x18f')]){return this[_0x4943('0x39')][_0x4943('0x33')](_0x173e53,_0x4943('0x190'));}var _0x63e0c0={'from':util[_0x4943('0x2a')](_0x4943('0x191'),_0x2a2224[_0x4943('0x12')],_0x2a2224[_0x4943('0x192')]||_0x2a2224['Smtp'][_0x4943('0x193')]),'to':_0x173e53['to']||'','cc':_0x173e53['cc']||'','bcc':_0x173e53['bcc']||'','subject':_0x173e53[_0x4943('0x194')],'html':_0x173e53[_0x4943('0x59')],'text':_0x173e53['text']};if(this[_0x4943('0xa7')](_0x173e53['template_id'])){}logger[_0x4943('0xdf')](_0x4943('0x195'),JSON[_0x4943('0x6f')](_0x63e0c0));this[_0x4943('0x38')][_0x4943('0x6c')](this,_0x173e53,_0x173e53['account_id']);this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x196'),_0x2a2224['name']));this[_0x4943('0x23')][_0x4943('0x6c')](this,_0x2a2224[_0x4943('0x197')],_0x63e0c0);return this[_0x4943('0x39')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4943('0x10')][_0x4943('0x198')]=function(_0x47998c){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x47998c[_0x4943('0x3a')]));return this[_0x4943('0x39')]['noop'](_0x4943('0x199'));};AGIVertices[_0x4943('0x10')][_0x4943('0x19a')]=function(_0x3da575){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x19b'),_0x3da575['label']));if(!this[_0x4943('0xa7')](_0x3da575[_0x4943('0x19c')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x19d'));}var _0x1fe176=this[_0x4943('0x35')][_0x4943('0x6c')](this,_0x3da575['sms_account_id']);if(!_0x1fe176){return this[_0x4943('0x39')]['error'](_0x3da575,_0x4943('0x19e'));}var _0x2dedc0={'body':_0x3da575[_0x4943('0x19f')],'phone':_0x3da575['to']||'','SmsAccountId':_0x1fe176['id']};logger[_0x4943('0xdf')]('sendSMS\x20message',JSON[_0x4943('0x6f')](_0x2dedc0));this[_0x4943('0x38')]['sync'](this,_0x3da575,_0x3da575[_0x4943('0x19c')]);this[_0x4943('0x39')][_0x4943('0xa8')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x1fe176[_0x4943('0x12')]));this['createSmsMessage'][_0x4943('0x6c')](this,_0x2dedc0);return this[_0x4943('0x39')]['noop'](_0x4943('0x1a0'));};AGIVertices[_0x4943('0x10')]['set']=function(_0x5b6595){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x5b6595[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x5b6595[_0x4943('0x116')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x5b6595,_0x4943('0x1a1'));}var _0x546cf4=this[_0x4943('0x9e')][_0x4943('0x6c')](this,_0x5b6595[_0x4943('0x116')]);if(!_0x546cf4){return this[_0x4943('0x39')][_0x4943('0x33')](_0x5b6595,_0x4943('0xdb'));}return this[_0x4943('0x39')]['setVariable'](_0x546cf4,_0x5b6595[_0x4943('0x1a2')]);};AGIVertices[_0x4943('0x10')][_0x4943('0x1a3')]=function(_0x3b63f1){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3b63f1['label']));this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x1a4'));if(_0x3b63f1[_0x4943('0xb9')]===_0x4943('0x1a5')){this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x1a6'));return this[_0x4943('0x39')][_0x4943('0xb9')]();}return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x1a7'));};AGIVertices['prototype'][_0x4943('0x1a8')]=function(_0x364928){logger[_0x4943('0x30')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x364928['label']));if(!this[_0x4943('0xa7')](_0x364928[_0x4943('0x1a9')])){return this[_0x4943('0x39')][_0x4943('0x33')](_0x364928,_0x4943('0x1aa'));}var _0x5d1539=this[_0x4943('0x17')][_0x4943('0x6c')](this,_0x364928[_0x4943('0x1a9')]);if(!this['isConfigured'](_0x5d1539)){return this['channel'][_0x4943('0x33')](_0x364928,util[_0x4943('0x2a')](_0x4943('0x1ab'),_0x364928[_0x4943('0x1a9')]));}if(_0x5d1539===this[_0x4943('0x39')][_0x4943('0x43')]){return this['channel'][_0x4943('0x33')](_0x364928,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0x4943('0x6c')](this,_0x364928,_0x5d1539);var _0x2af953=this[_0x4943('0x39')][_0x4943('0xaa')](_0x4943('0x1ac'),util[_0x4943('0x2a')](_0x4943('0x1ad'),config[_0x4943('0xb4')][_0x4943('0x1ae')]||_0x4943('0x1af'),_0x5d1539,this[_0x4943('0x39')]['arg_1']));if(_0x2af953[_0x4943('0xa1')]===-0x1){return _0x2af953;}return this[_0x4943('0x39')][_0x4943('0xa8')](util['format'](_0x4943('0x16d'),'AGI',_0x5d1539));};AGIVertices['prototype'][_0x4943('0x1b0')]=function(_0x22854d){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x1b1'),_0x22854d[_0x4943('0x3a')]));var _0x399353=this[_0x4943('0x1b2')][_0x4943('0x6c')](this,_0x22854d[_0x4943('0x1b3')]);this[_0x4943('0x38')][_0x4943('0x6c')](this,_0x22854d,_0x22854d[_0x4943('0x1b3')]);if(this[_0x4943('0xa7')](_0x22854d[_0x4943('0x116')])){var _0x5aa381=this[_0x4943('0x9e')][_0x4943('0x6c')](this,_0x22854d['variable_id']);if(_0x5aa381){this[_0x4943('0x39')][_0x4943('0x9b')](_0x5aa381,_0x399353);return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x22854d[_0x4943('0x1b3')],_0x5aa381));}}return this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x1b4'),_0x22854d[_0x4943('0x1b3')]));};AGIVertices[_0x4943('0x10')][_0x4943('0x1b5')]=function(_0x25baf3){logger[_0x4943('0x30')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x25baf3[_0x4943('0x3a')]));_0x25baf3[_0x4943('0x59')]=_0x25baf3[_0x4943('0x59')][_0x4943('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x25baf3[_0x4943('0x57')])){return this[_0x4943('0x39')][_0x4943('0xa8')](_0x4943('0x1b6'));}if(!this[_0x4943('0xa7')](_0x25baf3[_0x4943('0x59')])){return this[_0x4943('0x39')]['noop'](_0x4943('0xa9'));}this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x25baf3['text']));var _0x1fcea7=this['googleCloudTTS'][_0x4943('0x6c')](this,_0x25baf3);if(_0x1fcea7){this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')](_0x4943('0x1b7'),_0x1fcea7));var _0x516dea=this['channel']['streamFile'](_0x1fcea7);try{fs[_0x4943('0x104')](_0x1fcea7+_0x4943('0x105'));}catch(_0x2e6c59){logger['error'](_0x2e6c59);}return _0x516dea;}return this['channel'][_0x4943('0x33')](_0x25baf3,_0x4943('0x1b8'));};AGIVertices[_0x4943('0x10')][_0x4943('0x1b9')]=function(_0x38f858){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x1ba'),_0x38f858['label']));_0x38f858[_0x4943('0x59')]=_0x38f858[_0x4943('0x59')][_0x4943('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4943('0xa7')](_0x38f858['text'])){return this['channel'][_0x4943('0xa8')](_0x4943('0xa9'));}this[_0x4943('0x39')]['noop'](util[_0x4943('0x2a')](_0x4943('0x1bb'),_0x38f858[_0x4943('0x59')]));var _0x45af3a=this['googleTTS'][_0x4943('0x6c')](this,_0x38f858);if(_0x45af3a){this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x1bc'),_0x45af3a));var _0x1bfa5a=this[_0x4943('0x39')][_0x4943('0x103')](_0x45af3a);try{fs[_0x4943('0x104')](_0x45af3a+_0x4943('0x105'));}catch(_0x321952){logger[_0x4943('0x33')](_0x321952);}return _0x1bfa5a;}return this['channel'][_0x4943('0x33')](_0x38f858,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x4943('0x10')]['unpause']=function(_0x5d8424){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x1bd'),_0x5d8424[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x5d8424[_0x4943('0x154')])){return this['channel'][_0x4943('0x33')](_0x5d8424,_0x4943('0x155'));}logger[_0x4943('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4943('0x39')][_0x4943('0x3b')],_0x5d8424[_0x4943('0x154')]));var _0x5dd139=this['agentUnpause'][_0x4943('0x6c')](this,_0x5d8424[_0x4943('0x154')]);if(_0x5dd139){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x157'),this[_0x4943('0x39')][_0x4943('0x3b')],_0x5d8424[_0x4943('0x154')]));this['channel']['noop'](util[_0x4943('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4943('0x39')]['callerid'],_0x5d8424[_0x4943('0x154')]));return{'code':0xc8,'result':_0x4943('0x169')};}else{logger['info'](util['format'](_0x4943('0x158'),this['channel']['callerid'],_0x5d8424[_0x4943('0x154')]));this[_0x4943('0x39')][_0x4943('0xa8')](util[_0x4943('0x2a')](_0x4943('0x158'),this['channel'][_0x4943('0x3b')],_0x5d8424[_0x4943('0x154')]));return{'code':0xc8,'result':_0x4943('0x15b')};}};AGIVertices[_0x4943('0x10')][_0x4943('0x1be')]=function(_0x444584){logger[_0x4943('0x30')](util[_0x4943('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x444584[_0x4943('0x3a')]));var _0x4a421d=this['channel'][_0x4943('0xaa')](_0x4943('0x1bf'),[_0x444584[_0x4943('0x1c0')],_0x444584[_0x4943('0x74')]]);if(_0x4a421d[_0x4943('0xa1')]===-0x1){return _0x4a421d;}return this['channel'][_0x4943('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0x4943('0x1bf'),_0x444584['mailbox']));};AGIVertices[_0x4943('0x10')][_0x4943('0x1c1')]=function(_0x3dae4e){logger[_0x4943('0x30')](util[_0x4943('0x2a')](_0x4943('0x1c2'),_0x3dae4e[_0x4943('0x3a')]));if(!this[_0x4943('0xa7')](_0x3dae4e[_0x4943('0x116')])){return this['channel'][_0x4943('0x33')](_0x3dae4e,_0x4943('0x1a1'));}var _0x4ed4e8=this[_0x4943('0x9e')][_0x4943('0x6c')](this,_0x3dae4e[_0x4943('0x116')]);if(!_0x4ed4e8){return this[_0x4943('0x39')]['error'](_0x3dae4e,_0x4943('0xdb'));}var _0x5700cc=this['channel'][_0x4943('0x9e')](_0x4ed4e8);return{'code':0xc8,'result':_0x5700cc[_0x4943('0x9f')]?_0x5700cc['extra']:'-'};};String[_0x4943('0x10')][_0x4943('0x9d')]=function(_0x55d7a2,_0x1a3660){return this[_0x4943('0x9c')](_0x55d7a2)[_0x4943('0x1c3')](_0x1a3660);};module['exports']=AGIVertices;
\ No newline at end of file
index d34615d..63c61f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x075d=['syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','prototype','startAcw','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','message','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer'];(function(_0x2fd57d,_0x99949a){var _0x3630ea=function(_0xd369fa){while(--_0xd369fa){_0x2fd57d['push'](_0x2fd57d['shift']());}};_0x3630ea(++_0x99949a);}(_0x075d,0xf5));var _0xd075=function(_0x5939dd,_0x1b656f){_0x5939dd=_0x5939dd-0x0;var _0x2c59f4=_0x075d[_0x5939dd];return _0x2c59f4;};'use strict';var util=require(_0xd075('0x0'));var _=require(_0xd075('0x1'));var moment=require(_0xd075('0x2'));var ami=require('../ami');var logger=require(_0xd075('0x3'))(_0xd075('0x4'));var RpcUser=require(_0xd075('0x5'));var RpcVoiceAgentReport=require(_0xd075('0x6'));function Acw(_0x281e43){this[_0xd075('0x7')]=_0x281e43['voiceQueues'];this[_0xd075('0x8')]=_0x281e43[_0xd075('0x8')];this[_0xd075('0x9')]=_0x281e43[_0xd075('0x9')];this['channels']={};ami['on']('agentconnect',this[_0xd075('0xa')][_0xd075('0xb')](this));ami['on'](_0xd075('0xc'),this['syncHangupRequest'][_0xd075('0xb')](this));ami['on'](_0xd075('0xd'),this[_0xd075('0xe')]['bind'](this));ami['on'](_0xd075('0xf'),this[_0xd075('0x10')][_0xd075('0xb')](this));ami['on'](_0xd075('0x11'),this[_0xd075('0x12')]['bind'](this));ami['on'](_0xd075('0x13'),this[_0xd075('0x14')][_0xd075('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xd075('0xb')](this));}function getDiff(_0x36e5ca){var _0x3ffe21=moment()['milliseconds'](0x0);var _0x2a4d15=moment(_0x36e5ca)[_0xd075('0x15')](0x0);return _0x3ffe21[_0xd075('0x16')](_0x2a4d15,'seconds');}Acw[_0xd075('0x17')][_0xd075('0x18')]=function(_0x149deb){try{var _0x1d3310=this;var _0x402d89=this['channels'][_0x149deb]['interface'];var _0x85f1fc=this[_0xd075('0x19')][_0x149deb][_0xd075('0x1a')];var _0x2b284a=this['voiceQueues'][_0x85f1fc];var _0x30ec63=![];var _0x3d7a55=_0xd075('0x1b');if(_0x2b284a[_0xd075('0x1c')]){if(_0x2b284a[_0xd075('0x1d')][_0xd075('0x1e')]){_0x30ec63=!![];_0x3d7a55=_0x2b284a[_0xd075('0x1d')][_0xd075('0x1e')];}}ami[_0xd075('0x1f')]({'action':_0xd075('0x20'),'interface':_0x402d89,'paused':!![],'reason':_0x3d7a55})['then'](function(_0x43f8e4){if(_0x1d3310['agents'][_0x402d89]){return RpcUser[_0xd075('0x21')](_0x1d3310[_0xd075('0x8')][_0x402d89]['id'])[_0xd075('0x22')](function(_0x27ffdb){if(_0x27ffdb&&!_0x27ffdb[_0xd075('0x23')]){logger[_0xd075('0x24')](_0xd075('0x25'),_0x149deb,_0x402d89,_0x85f1fc);var _0x30af80=_0x1d3310[_0xd075('0x19')][_0x149deb][_0xd075('0x26')]&&_0x1d3310[_0xd075('0x19')][_0x149deb][_0xd075('0x27')]?_0x1d3310[_0xd075('0x19')][_0x149deb][_0xd075('0x27')]:_0x149deb;return RpcUser[_0xd075('0x28')](_0x1d3310[_0xd075('0x8')][_0x402d89],_0x3d7a55,_0x30af80)[_0xd075('0x22')](function(_0x5c70e5){if(!_0x30ec63){_0x1d3310[_0xd075('0x9')][_0x402d89]={};logger[_0xd075('0x24')](_0xd075('0x29'),_0x149deb,_0x1d3310[_0xd075('0x7')][_0x85f1fc]['acwTimeout'],_0x402d89,_0x85f1fc);_0x1d3310[_0xd075('0x9')][_0x402d89][_0xd075('0x2a')]=setTimeout(_0x1d3310[_0xd075('0x2b')][_0xd075('0xb')](_0x1d3310,_0x402d89),_0x1d3310[_0xd075('0x7')][_0x85f1fc][_0xd075('0x2c')]*0x3e8);_0x1d3310[_0xd075('0x9')][_0x402d89]['lastPauseAt']=moment()[_0xd075('0x2d')](_0xd075('0x2e'));_0x1d3310['timers'][_0x402d89][_0xd075('0x2f')]=_0x149deb;_0x1d3310[_0xd075('0x9')][_0x402d89]['queue']=_0x85f1fc;_0x1d3310[_0xd075('0x9')][_0x402d89]['updateAcw']=function(){var _0x57ad5b=getDiff(_0x1d3310[_0xd075('0x9')][_0x402d89][_0xd075('0x30')]);clearTimeout(_0x1d3310[_0xd075('0x9')][_0x402d89][_0xd075('0x2a')]);_0x1d3310['timers'][_0x402d89]['timer']=![];RpcVoiceAgentReport[_0xd075('0x31')]({'acwtime':_0x57ad5b},_0x1d3310[_0xd075('0x9')][_0x402d89][_0xd075('0x2f')],_0x402d89)['then'](function(_0x228c8b){logger[_0xd075('0x24')](_0xd075('0x32'),_0x149deb,_0x57ad5b,_0x228c8b);})[_0xd075('0x33')](function(_0x11ea77){logger[_0xd075('0x34')](_0xd075('0x35'),_0x149deb,_0x11ea77);});delete _0x1d3310[_0xd075('0x9')][_0x402d89];};}});}else{logger[_0xd075('0x24')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x149deb,_0x402d89,_0x85f1fc);}});}})['catch'](function(_0x99d0d9){logger[_0xd075('0x34')](_0xd075('0x29'),_0x149deb,_0x1d3310[_0xd075('0x7')][_0x85f1fc][_0xd075('0x2c')],_0x402d89,_0x85f1fc);})[_0xd075('0x36')](function(){delete _0x1d3310[_0xd075('0x19')][_0x149deb];});}catch(_0x57d574){logger[_0xd075('0x34')](_0xd075('0x37'),_0x57d574['message']);}};Acw['prototype'][_0xd075('0x2b')]=function(_0x8d27e5){try{var _0x3e5520=this;if(_0x3e5520[_0xd075('0x9')][_0x8d27e5]){_0x3e5520['timers'][_0x8d27e5][_0xd075('0x2a')]=![];var _0x504ffe=_0x3e5520[_0xd075('0x9')][_0x8d27e5]['uniqueid'];var _0x224003=_0x3e5520[_0xd075('0x9')][_0x8d27e5][_0xd075('0x1a')];var _0x5288b2=_0x3e5520[_0xd075('0x7')][_0x224003][_0xd075('0x2c')];logger['info'](_0xd075('0x38'),_0x504ffe,_0x8d27e5);RpcUser['saveUnpause'](this[_0xd075('0x8')][_0x8d27e5]);RpcVoiceAgentReport[_0xd075('0x31')]({'acwtime':_0x5288b2,'agentacw':!![]},_0x504ffe,_0x8d27e5)[_0xd075('0x22')](function(_0x5695fe){logger[_0xd075('0x24')](_0xd075('0x32'),_0x504ffe,_0x5288b2,_0x5695fe);})[_0xd075('0x33')](function(_0x6e451a){logger[_0xd075('0x34')](_0xd075('0x35'),_0x504ffe,_0x6e451a);});}else{logger[_0xd075('0x34')](_0xd075('0x39'),_0x8d27e5);if(_0x3e5520[_0xd075('0x9')]){logger[_0xd075('0x24')](_0xd075('0x3a'),JSON[_0xd075('0x3b')](_0x3e5520[_0xd075('0x9')]));}}}catch(_0x27eca4){logger[_0xd075('0x34')](_0xd075('0x3c'),_0x27eca4['message']);}};Acw[_0xd075('0x17')]['syncAgentConnect']=function(_0x3f0cbd){try{if(this[_0xd075('0x7')][_0x3f0cbd[_0xd075('0x1a')]]&&(this['voiceQueues'][_0x3f0cbd['queue']][_0xd075('0x4')]||this['voiceQueues'][_0x3f0cbd['queue']][_0xd075('0x1c')])){if(this[_0xd075('0x8')][_0x3f0cbd[_0xd075('0x3d')]]){this[_0xd075('0x19')][_0x3f0cbd['uniqueid']]={'queue':_0x3f0cbd['queue'],'interface':_0x3f0cbd[_0xd075('0x3d')],'destlinkedid':_0x3f0cbd[_0xd075('0x27')]};}}}catch(_0x287249){logger[_0xd075('0x34')](_0xd075('0x3e'),_0x287249['message']);}};Acw[_0xd075('0x17')][_0xd075('0x3f')]=function(_0x3a92c1){try{if(this[_0xd075('0x7')][_0x3a92c1['queue']]&&(this[_0xd075('0x7')][_0x3a92c1[_0xd075('0x1a')]][_0xd075('0x4')]||this[_0xd075('0x7')][_0x3a92c1['queue']][_0xd075('0x1c')])){if(this['agents'][_0x3a92c1[_0xd075('0x3d')]]){this[_0xd075('0x19')][_0x3a92c1[_0xd075('0x2f')]]={'queue':_0x3a92c1[_0xd075('0x1a')],'interface':_0x3a92c1[_0xd075('0x3d')]};}}}catch(_0x3998bf){logger[_0xd075('0x34')](_0xd075('0x40'),_0x3998bf[_0xd075('0x41')]);}};Acw['prototype']['syncHangupRequest']=function(_0x5a96c3){try{if(this[_0xd075('0x19')][_0x5a96c3[_0xd075('0x2f')]]&&_[_0xd075('0x42')](this[_0xd075('0x19')][_0x5a96c3[_0xd075('0x2f')]][_0xd075('0x26')])){logger[_0xd075('0x24')](_0xd075('0x43'),_0x5a96c3[_0xd075('0x2f')]);this['startAcw'](_0x5a96c3[_0xd075('0x2f')]);}else if(this[_0xd075('0x19')][_0x5a96c3[_0xd075('0x44')]]&&_['isUndefined'](this[_0xd075('0x19')][_0x5a96c3[_0xd075('0x44')]]['attended'])){logger[_0xd075('0x24')]('[%s][HANGUP:LINKEDID]',_0x5a96c3[_0xd075('0x44')]);this[_0xd075('0x18')](_0x5a96c3[_0xd075('0x44')]);}}catch(_0x1766e3){logger['error'](_0xd075('0x45'),_0x1766e3[_0xd075('0x41')]);}};Acw[_0xd075('0x17')][_0xd075('0xe')]=function(_0x2f3258){try{if(this['channels'][_0x2f3258[_0xd075('0x2f')]]&&this['channels'][_0x2f3258[_0xd075('0x2f')]][_0xd075('0x26')]){logger[_0xd075('0x24')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x2f3258[_0xd075('0x2f')]);this[_0xd075('0x18')](_0x2f3258[_0xd075('0x2f')]);}else if(this[_0xd075('0x19')][_0x2f3258[_0xd075('0x44')]]&&this['channels'][_0x2f3258[_0xd075('0x44')]][_0xd075('0x26')]){logger[_0xd075('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2f3258['linkedid']);this['startAcw'](_0x2f3258['linkedid']);}}catch(_0x30d08c){logger[_0xd075('0x34')](_0xd075('0x46'),_0x30d08c[_0xd075('0x41')]);}};Acw[_0xd075('0x17')][_0xd075('0x12')]=function(_0x3ad673){try{if(!_['isNil'](this['channels'][_0x3ad673[_0xd075('0x47')]])){this['startAcw'](_0x3ad673[_0xd075('0x47')]);if(this['channels'][_0x3ad673[_0xd075('0x48')]]){this[_0xd075('0x19')][_0x3ad673[_0xd075('0x48')]][_0xd075('0x26')]=!![];this[_0xd075('0x19')][_0x3ad673[_0xd075('0x49')]]=this[_0xd075('0x19')][_0x3ad673[_0xd075('0x48')]];delete this[_0xd075('0x19')][_0x3ad673['secondtransfereruniqueid']];}}else if(!_[_0xd075('0x4a')](this[_0xd075('0x19')][_0x3ad673[_0xd075('0x49')]])){this['startAcw'](_0x3ad673[_0xd075('0x49')]);if(this[_0xd075('0x19')][_0x3ad673[_0xd075('0x4b')]]){this['channels'][_0x3ad673['origtransfereruniqueid']]['attended']=!![];this['channels'][_0x3ad673[_0xd075('0x47')]]=this[_0xd075('0x19')][_0x3ad673[_0xd075('0x4b')]];delete this['channels'][_0x3ad673[_0xd075('0x4b')]];}}}catch(_0x2628aa){logger[_0xd075('0x34')](_0xd075('0x4c'),_0x2628aa[_0xd075('0x41')]);}};Acw[_0xd075('0x17')][_0xd075('0x14')]=function(_0x4dff4e){try{if(this[_0xd075('0x19')][_0x4dff4e['transfereruniqueid']]){logger[_0xd075('0x24')](_0xd075('0x4d'),JSON[_0xd075('0x3b')](_0x4dff4e[_0xd075('0x4e')]));this[_0xd075('0x18')](_0x4dff4e[_0xd075('0x4e')]);}else if(this[_0xd075('0x19')][_0x4dff4e[_0xd075('0x4f')]]){logger[_0xd075('0x24')](_0xd075('0x50'),JSON[_0xd075('0x3b')](_0x4dff4e[_0xd075('0x4f')]));this['startAcw'](_0x4dff4e[_0xd075('0x4f')]);}}catch(_0x459735){logger[_0xd075('0x34')](_0xd075('0x51'),_0x459735[_0xd075('0x41')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x10a074){try{if(this['voiceQueues'][_0x10a074[_0xd075('0x1a')]]&&this[_0xd075('0x7')][_0x10a074[_0xd075('0x1a')]]['autopause']===_0xd075('0x52')){if(this['agents'][_0x10a074['interface']]){logger[_0xd075('0x24')](_0xd075('0x53'),_0x10a074[_0xd075('0x2f')],_0x10a074[_0xd075('0x3d')],_0x10a074[_0xd075('0x1a')]);return RpcUser[_0xd075('0x28')](this[_0xd075('0x8')][_0x10a074['interface']],_0xd075('0x54'),_0x10a074['uniqueid']);}}}catch(_0xad001e){logger['error'](_0xd075('0x55'),_0xad001e[_0xd075('0x41')]);}};module[_0xd075('0x56')]=Acw;
\ No newline at end of file
+var _0x67e1=['isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','voiceQueues','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','catch','finally','[ACW][START]\x20%s','stopAcw','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20%s','message','syncAgentConnect'];(function(_0x3bb712,_0x5d53cd){var _0xa9a203=function(_0x161663){while(--_0x161663){_0x3bb712['push'](_0x3bb712['shift']());}};_0xa9a203(++_0x5d53cd);}(_0x67e1,0xbe));var _0x167e=function(_0x199735,_0x13af6d){_0x199735=_0x199735-0x0;var _0x2fe47a=_0x67e1[_0x199735];return _0x2fe47a;};'use strict';var util=require(_0x167e('0x0'));var _=require(_0x167e('0x1'));var moment=require(_0x167e('0x2'));var ami=require(_0x167e('0x3'));var logger=require('../../../config/logger')(_0x167e('0x4'));var RpcUser=require(_0x167e('0x5'));var RpcVoiceAgentReport=require(_0x167e('0x6'));function Acw(_0x1e3ed2){this['voiceQueues']=_0x1e3ed2['voiceQueues'];this[_0x167e('0x7')]=_0x1e3ed2[_0x167e('0x7')];this[_0x167e('0x8')]=_0x1e3ed2[_0x167e('0x8')];this[_0x167e('0x9')]={};ami['on'](_0x167e('0xa'),this['syncAgentConnect'][_0x167e('0xb')](this));ami['on'](_0x167e('0xc'),this[_0x167e('0xd')][_0x167e('0xb')](this));ami['on'](_0x167e('0xe'),this[_0x167e('0xf')][_0x167e('0xb')](this));ami['on']('agentringnoanswer',this[_0x167e('0x10')][_0x167e('0xb')](this));ami['on'](_0x167e('0x11'),this['syncAttendedTransfer'][_0x167e('0xb')](this));ami['on'](_0x167e('0x12'),this[_0x167e('0x13')][_0x167e('0xb')](this));ami['on'](_0x167e('0x14'),this[_0x167e('0x15')][_0x167e('0xb')](this));}function getDiff(_0x58c603){var _0x5279b9=moment()[_0x167e('0x16')](0x0);var _0x454c78=moment(_0x58c603)[_0x167e('0x16')](0x0);return _0x5279b9[_0x167e('0x17')](_0x454c78,_0x167e('0x18'));}Acw[_0x167e('0x19')]['startAcw']=function(_0x351891){try{var _0x5d2713=this;var _0x360787=this[_0x167e('0x9')][_0x351891][_0x167e('0x1a')];var _0x2f394c=this[_0x167e('0x9')][_0x351891][_0x167e('0x1b')];var _0x47ea54=this[_0x167e('0x1c')][_0x2f394c];var _0x5b4206=![];var _0x5039df=_0x167e('0x1d');if(_0x47ea54[_0x167e('0x1e')]){if(_0x47ea54[_0x167e('0x1f')][_0x167e('0x20')]){_0x5b4206=!![];_0x5039df=_0x47ea54['mandatoryDispositionPause'][_0x167e('0x20')];}}ami[_0x167e('0x21')]({'action':_0x167e('0x22'),'interface':_0x360787,'paused':!![],'reason':_0x5039df})['then'](function(_0x227524){if(_0x5d2713[_0x167e('0x7')][_0x360787]){return RpcUser[_0x167e('0x23')](_0x5d2713[_0x167e('0x7')][_0x360787]['id'])[_0x167e('0x24')](function(_0x6c0bac){if(_0x6c0bac&&!_0x6c0bac[_0x167e('0x25')]){logger['info'](_0x167e('0x26'),_0x351891,_0x360787,_0x2f394c);var _0xf0b5e2=_0x5d2713[_0x167e('0x9')][_0x351891][_0x167e('0x27')]&&_0x5d2713[_0x167e('0x9')][_0x351891][_0x167e('0x28')]?_0x5d2713[_0x167e('0x9')][_0x351891][_0x167e('0x28')]:_0x351891;return RpcUser['savePause'](_0x5d2713[_0x167e('0x7')][_0x360787],_0x5039df,_0xf0b5e2)[_0x167e('0x24')](function(_0x249cd3){if(!_0x5b4206){_0x5d2713[_0x167e('0x8')][_0x360787]={};logger[_0x167e('0x29')](_0x167e('0x2a'),_0x351891,_0x5d2713[_0x167e('0x1c')][_0x2f394c][_0x167e('0x2b')],_0x360787,_0x2f394c);_0x5d2713[_0x167e('0x8')][_0x360787]['timer']=setTimeout(_0x5d2713['stopAcw'][_0x167e('0xb')](_0x5d2713,_0x360787),_0x5d2713[_0x167e('0x1c')][_0x2f394c][_0x167e('0x2b')]*0x3e8);_0x5d2713[_0x167e('0x8')][_0x360787][_0x167e('0x2c')]=moment()[_0x167e('0x2d')](_0x167e('0x2e'));_0x5d2713['timers'][_0x360787][_0x167e('0x2f')]=_0x351891;_0x5d2713['timers'][_0x360787][_0x167e('0x1b')]=_0x2f394c;_0x5d2713[_0x167e('0x8')][_0x360787][_0x167e('0x30')]=function(){var _0xd33b63=getDiff(_0x5d2713['timers'][_0x360787][_0x167e('0x2c')]);clearTimeout(_0x5d2713[_0x167e('0x8')][_0x360787]['timer']);_0x5d2713[_0x167e('0x8')][_0x360787][_0x167e('0x31')]=![];RpcVoiceAgentReport['update']({'acwtime':_0xd33b63},_0x5d2713['timers'][_0x360787][_0x167e('0x2f')],_0x360787)[_0x167e('0x24')](function(_0x19dbed){logger[_0x167e('0x29')](_0x167e('0x32'),_0x351891,_0xd33b63,_0x19dbed);})['catch'](function(_0x2bec7b){logger[_0x167e('0x33')](_0x167e('0x34'),_0x351891,_0x2bec7b);});delete _0x5d2713[_0x167e('0x8')][_0x360787];};}});}else{logger[_0x167e('0x29')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x351891,_0x360787,_0x2f394c);}});}})[_0x167e('0x35')](function(_0x3e5c5a){logger[_0x167e('0x33')](_0x167e('0x2a'),_0x351891,_0x5d2713[_0x167e('0x1c')][_0x2f394c][_0x167e('0x2b')],_0x360787,_0x2f394c);})[_0x167e('0x36')](function(){delete _0x5d2713['channels'][_0x351891];});}catch(_0x5ea6ab){logger[_0x167e('0x33')](_0x167e('0x37'),_0x5ea6ab['message']);}};Acw[_0x167e('0x19')][_0x167e('0x38')]=function(_0x58330e){try{var _0x436847=this;if(_0x436847[_0x167e('0x8')][_0x58330e]){_0x436847['timers'][_0x58330e][_0x167e('0x31')]=![];var _0x52e212=_0x436847['timers'][_0x58330e][_0x167e('0x2f')];var _0x2f0ffe=_0x436847[_0x167e('0x8')][_0x58330e]['queue'];var _0x142760=_0x436847[_0x167e('0x1c')][_0x2f0ffe][_0x167e('0x2b')];logger[_0x167e('0x29')](_0x167e('0x39'),_0x52e212,_0x58330e);RpcUser['saveUnpause'](this['agents'][_0x58330e]);RpcVoiceAgentReport[_0x167e('0x3a')]({'acwtime':_0x142760,'agentacw':!![]},_0x52e212,_0x58330e)[_0x167e('0x24')](function(_0x528a62){logger[_0x167e('0x29')](_0x167e('0x32'),_0x52e212,_0x142760,_0x528a62);})[_0x167e('0x35')](function(_0x2aa2d2){logger[_0x167e('0x33')](_0x167e('0x34'),_0x52e212,_0x2aa2d2);});}else{logger[_0x167e('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x58330e);if(_0x436847['timers']){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0x436847[_0x167e('0x8')]));}}}catch(_0x31877b){logger[_0x167e('0x33')](_0x167e('0x3b'),_0x31877b[_0x167e('0x3c')]);}};Acw[_0x167e('0x19')][_0x167e('0x3d')]=function(_0xdc6f21){try{if(this[_0x167e('0x1c')][_0xdc6f21[_0x167e('0x1b')]]&&(this[_0x167e('0x1c')][_0xdc6f21[_0x167e('0x1b')]][_0x167e('0x4')]||this[_0x167e('0x1c')][_0xdc6f21[_0x167e('0x1b')]][_0x167e('0x1e')])){if(this[_0x167e('0x7')][_0xdc6f21[_0x167e('0x1a')]]){this[_0x167e('0x9')][_0xdc6f21[_0x167e('0x2f')]]={'queue':_0xdc6f21[_0x167e('0x1b')],'interface':_0xdc6f21['interface'],'destlinkedid':_0xdc6f21['destlinkedid']};}}}catch(_0xca1bbf){logger['error']('[ACW][syncAgentConnect]\x20%s',_0xca1bbf[_0x167e('0x3c')]);}};Acw[_0x167e('0x19')]['syncAgentConnectPreview']=function(_0x30777d){try{if(this[_0x167e('0x1c')][_0x30777d['queue']]&&(this[_0x167e('0x1c')][_0x30777d[_0x167e('0x1b')]][_0x167e('0x4')]||this[_0x167e('0x1c')][_0x30777d['queue']]['mandatoryDisposition'])){if(this[_0x167e('0x7')][_0x30777d[_0x167e('0x1a')]]){this['channels'][_0x30777d[_0x167e('0x2f')]]={'queue':_0x30777d[_0x167e('0x1b')],'interface':_0x30777d['interface']};}}}catch(_0x1c9afd){logger[_0x167e('0x33')]('[ACW][syncAgentConnectPreview]\x20%s',_0x1c9afd[_0x167e('0x3c')]);}};Acw[_0x167e('0x19')][_0x167e('0xd')]=function(_0x413863){try{if(this[_0x167e('0x9')][_0x413863[_0x167e('0x2f')]]&&_[_0x167e('0x3e')](this[_0x167e('0x9')][_0x413863['uniqueid']][_0x167e('0x27')])){logger[_0x167e('0x29')](_0x167e('0x3f'),_0x413863['uniqueid']);this[_0x167e('0x40')](_0x413863[_0x167e('0x2f')]);}else if(this['channels'][_0x413863[_0x167e('0x41')]]&&_[_0x167e('0x3e')](this[_0x167e('0x9')][_0x413863[_0x167e('0x41')]]['attended'])){logger[_0x167e('0x29')]('[%s][HANGUP:LINKEDID]',_0x413863[_0x167e('0x41')]);this[_0x167e('0x40')](_0x413863[_0x167e('0x41')]);}}catch(_0x5abee7){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x5abee7[_0x167e('0x3c')]);}};Acw[_0x167e('0x19')][_0x167e('0xf')]=function(_0x38b673){try{if(this['channels'][_0x38b673[_0x167e('0x2f')]]&&this['channels'][_0x38b673[_0x167e('0x2f')]][_0x167e('0x27')]){logger[_0x167e('0x29')](_0x167e('0x42'),_0x38b673[_0x167e('0x2f')]);this['startAcw'](_0x38b673['uniqueid']);}else if(this['channels'][_0x38b673['linkedid']]&&this[_0x167e('0x9')][_0x38b673['linkedid']][_0x167e('0x27')]){logger[_0x167e('0x29')](_0x167e('0x43'),_0x38b673[_0x167e('0x41')]);this[_0x167e('0x40')](_0x38b673[_0x167e('0x41')]);}}catch(_0x2ceca4){logger[_0x167e('0x33')]('[ACW][syncHangup]\x20%s',_0x2ceca4['message']);}};Acw['prototype'][_0x167e('0x44')]=function(_0x986e98){try{if(!_[_0x167e('0x45')](this[_0x167e('0x9')][_0x986e98[_0x167e('0x46')]])){this[_0x167e('0x40')](_0x986e98[_0x167e('0x46')]);if(this[_0x167e('0x9')][_0x986e98[_0x167e('0x47')]]){this[_0x167e('0x9')][_0x986e98[_0x167e('0x47')]]['attended']=!![];this[_0x167e('0x9')][_0x986e98[_0x167e('0x48')]]=this[_0x167e('0x9')][_0x986e98[_0x167e('0x47')]];delete this[_0x167e('0x9')][_0x986e98[_0x167e('0x47')]];}}else if(!_[_0x167e('0x45')](this['channels'][_0x986e98[_0x167e('0x48')]])){this[_0x167e('0x40')](_0x986e98[_0x167e('0x48')]);if(this[_0x167e('0x9')][_0x986e98[_0x167e('0x49')]]){this[_0x167e('0x9')][_0x986e98[_0x167e('0x49')]]['attended']=!![];this[_0x167e('0x9')][_0x986e98[_0x167e('0x46')]]=this[_0x167e('0x9')][_0x986e98[_0x167e('0x49')]];delete this['channels'][_0x986e98[_0x167e('0x49')]];}}}catch(_0x404933){logger[_0x167e('0x33')]('[ACW][syncAttendedTransfer]\x20%s',_0x404933['message']);}};Acw['prototype'][_0x167e('0x13')]=function(_0x5bbfd7){try{if(this[_0x167e('0x9')][_0x5bbfd7[_0x167e('0x4a')]]){logger['info'](_0x167e('0x4b'),JSON[_0x167e('0x4c')](_0x5bbfd7['transfereruniqueid']));this[_0x167e('0x40')](_0x5bbfd7['transfereruniqueid']);}else if(this[_0x167e('0x9')][_0x5bbfd7[_0x167e('0x4d')]]){logger['info'](_0x167e('0x4e'),JSON[_0x167e('0x4c')](_0x5bbfd7[_0x167e('0x4d')]));this['startAcw'](_0x5bbfd7[_0x167e('0x4d')]);}}catch(_0x26aeaa){logger[_0x167e('0x33')](_0x167e('0x4f'),_0x26aeaa[_0x167e('0x3c')]);}};Acw[_0x167e('0x19')][_0x167e('0x10')]=function(_0x5657a9){try{if(this['voiceQueues'][_0x5657a9[_0x167e('0x1b')]]&&this[_0x167e('0x1c')][_0x5657a9['queue']]['autopause']==='all'){if(this[_0x167e('0x7')][_0x5657a9[_0x167e('0x1a')]]){logger[_0x167e('0x29')](_0x167e('0x50'),_0x5657a9[_0x167e('0x2f')],_0x5657a9['interface'],_0x5657a9[_0x167e('0x1b')]);return RpcUser[_0x167e('0x51')](this[_0x167e('0x7')][_0x5657a9[_0x167e('0x1a')]],'Auto-Pause',_0x5657a9[_0x167e('0x2f')]);}}}catch(_0x639ff8){logger[_0x167e('0x33')](_0x167e('0x52'),_0x639ff8[_0x167e('0x3c')]);}};module[_0x167e('0x53')]=Acw;
\ No newline at end of file
index 0df3aff..f6a68f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami;
\ No newline at end of file
+var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x2d7dce,_0x4374d9){_0x2d7dce=_0x2d7dce-0x0;var _0x35ebec=_0x2032[_0x2d7dce];return _0x35ebec;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami;
\ No newline at end of file
index ab523f8..b6ac4f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb7e7[_0x4ea69d];return _0x5318e0;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client;
\ No newline at end of file
+var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x4abd40,_0x31a0be){var _0xf3a361=function(_0x3b5a6a){while(--_0x3b5a6a){_0x4abd40['push'](_0x4abd40['shift']());}};_0xf3a361(++_0x31a0be);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2a05b0,_0x45eed9){_0x2a05b0=_0x2a05b0-0x0;var _0x36eb0a=_0xbdb7[_0x2a05b0];return _0x36eb0a;};'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
index a8773b6..bdd368d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da2=['ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','lodash','moment','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x7da2,0x1c4));var _0x27da=function(_0x2d63d1,_0x4e823a){_0x2d63d1=_0x2d63d1-0x0;var _0x4af4da=_0x7da2[_0x2d63d1];return _0x4af4da;};'use strict';var util=require(_0x27da('0x0'));var _=require(_0x27da('0x1'));var moment=require(_0x27da('0x2'));function checkNameSurname(_0x50bc29,_0x176767,_0x4c6f3d){var _0x3936cf='';if(!_['isNil'](_0x176767)&&_0x27da('0x3')===typeof _0x176767){_0x3936cf+=_0x176767;}if(!_['isNil'](_0x4c6f3d)&&_0x27da('0x3')===typeof _0x4c6f3d){_0x3936cf+='\x20'+_0x4c6f3d;}if(_0x3936cf!==''){return _0x3936cf;}return _0x50bc29;}function Action(_0x1ea393,_0x4b1f22,_0xa6af29){this[_0x27da('0x4')]=_0x1ea393;this[_0x27da('0x5')]=_0xa6af29||undefined;this[_0x27da('0x6')]=checkNameSurname(_0x4b1f22[_0x27da('0x7')][_0x27da('0x8')],_0x4b1f22[_0x27da('0x7')][_0x27da('0x9')],_0x4b1f22['Contact'][_0x27da('0xa')]);this[_0x27da('0xb')]=_0x4b1f22[_0x27da('0x8')];this[_0x27da('0xc')]=_0x1ea393[_0x27da('0x6')];this['active']=_0x4b1f22['active']||![];this[_0x27da('0xd')]=_0x1ea393[_0x27da('0xd')];this[_0x27da('0xe')]=_0x1ea393['dialQueueTimeout']||0x3;this['scheduledat']=_0x4b1f22['scheduledat'];this['countbusyretry']=_0x4b1f22[_0x27da('0xf')];this[_0x27da('0x10')]=_0x4b1f22[_0x27da('0x10')];this[_0x27da('0x11')]=_0x4b1f22[_0x27da('0x11')];this[_0x27da('0x12')]=_0x4b1f22[_0x27da('0x12')];this[_0x27da('0x13')]=_0x4b1f22[_0x27da('0x13')];this[_0x27da('0x14')]=_0x4b1f22[_0x27da('0x14')];this['countmachineretry']=_0x4b1f22[_0x27da('0x15')];this[_0x27da('0x16')]=_0x4b1f22[_0x27da('0x16')];this[_0x27da('0x17')]=_0x4b1f22['ContactId'];this[_0x27da('0x18')]=_0x4b1f22[_0x27da('0x18')];this['UserId']=_0x4b1f22['UserId'];this[_0x27da('0x19')]=_0x4b1f22[_0x27da('0x19')];this[_0x27da('0x1a')]=_0x4b1f22[_0x27da('0x1a')];this[_0x27da('0x1b')]=_0x4b1f22['id'];this[_0x27da('0x1c')]=_0x4b1f22['Contact']['firstName']||'';this[_0x27da('0x1d')]=moment()[_0x27da('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x4b1f22[_0x27da('0x1f')];this[_0x27da('0x20')]=_0x4b1f22[_0x27da('0x20')];this[_0x27da('0x21')]=_0x4b1f22[_0x27da('0x21')];this[_0x27da('0x22')]=_0x4b1f22[_0x27da('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x27da('0x23')]['getCaller']=function(){return util[_0x27da('0x1e')](_0x27da('0x24'),this[_0x27da('0x6')],this[_0x27da('0x4')][_0x27da('0x25')]>0x0?this[_0x27da('0xb')]['substring'](this[_0x27da('0x4')]['dialCutDigit']):this[_0x27da('0xb')]);};Action[_0x27da('0x23')][_0x27da('0x26')]=function(){return this[_0x27da('0xc')];};module[_0x27da('0x27')]=Action;
\ No newline at end of file
+var _0x208f=['uniqueid','phone','Contact','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','name','dialCutDigit','substring','number','getQueue','queue','exports','util','lodash','moment','isNil','string','voiceQueue'];(function(_0xd8751d,_0x62410a){var _0x36c142=function(_0x1b43b1){while(--_0x1b43b1){_0xd8751d['push'](_0xd8751d['shift']());}};_0x36c142(++_0x62410a);}(_0x208f,0xe5));var _0xf208=function(_0xf8856f,_0x196374){_0xf8856f=_0xf8856f-0x0;var _0x5922ae=_0x208f[_0xf8856f];return _0x5922ae;};'use strict';var util=require(_0xf208('0x0'));var _=require(_0xf208('0x1'));var moment=require(_0xf208('0x2'));function checkNameSurname(_0x4a77ac,_0x156bef,_0x278146){var _0x991bdb='';if(!_[_0xf208('0x3')](_0x156bef)&&'string'===typeof _0x156bef){_0x991bdb+=_0x156bef;}if(!_[_0xf208('0x3')](_0x278146)&&_0xf208('0x4')===typeof _0x278146){_0x991bdb+='\x20'+_0x278146;}if(_0x991bdb!==''){return _0x991bdb;}return _0x4a77ac;}function Action(_0x19d19c,_0x3e69db,_0x5f285c){this[_0xf208('0x5')]=_0x19d19c;this[_0xf208('0x6')]=_0x5f285c||undefined;this['name']=checkNameSurname(_0x3e69db['Contact'][_0xf208('0x7')],_0x3e69db[_0xf208('0x8')]['firstName'],_0x3e69db[_0xf208('0x8')][_0xf208('0x9')]);this['number']=_0x3e69db[_0xf208('0x8')][_0xf208('0x7')];this['queue']=_0x19d19c['name'];this[_0xf208('0xa')]=_0x3e69db[_0xf208('0xa')]||![];this['type']=_0x19d19c[_0xf208('0xb')];this[_0xf208('0xc')]=_0x19d19c[_0xf208('0xc')]||0x3;this[_0xf208('0xd')]=_0x3e69db[_0xf208('0xd')];this['countbusyretry']=_0x3e69db[_0xf208('0xe')];this['countcongestionretry']=_0x3e69db[_0xf208('0xf')];this['countnoanswerretry']=_0x3e69db[_0xf208('0x10')];this[_0xf208('0x11')]=_0x3e69db['countnosuchnumberretry'];this['countdropretry']=_0x3e69db[_0xf208('0x12')];this[_0xf208('0x13')]=_0x3e69db['countabandonedretry'];this[_0xf208('0x14')]=_0x3e69db[_0xf208('0x14')];this[_0xf208('0x15')]=_0x3e69db[_0xf208('0x15')];this[_0xf208('0x16')]=_0x3e69db[_0xf208('0x16')];this[_0xf208('0x17')]=_0x3e69db[_0xf208('0x17')];this[_0xf208('0x18')]=_0x3e69db[_0xf208('0x18')];this[_0xf208('0x19')]=_0x3e69db['VoiceQueueId'];this['CampaignId']=_0x3e69db[_0xf208('0x1a')];this[_0xf208('0x1b')]=_0x3e69db['id'];this[_0xf208('0x1c')]=_0x3e69db[_0xf208('0x8')][_0xf208('0x1d')]||'';this[_0xf208('0x1e')]=moment()[_0xf208('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x3e69db[_0xf208('0x20')];this[_0xf208('0x21')]=_0x3e69db[_0xf208('0x21')];this[_0xf208('0x22')]=_0x3e69db[_0xf208('0x22')];this[_0xf208('0x23')]=_0x3e69db[_0xf208('0x23')];this[_0xf208('0x24')]='';this[_0xf208('0x25')]='';}Action[_0xf208('0x26')]['getCaller']=function(){return util[_0xf208('0x1f')](_0xf208('0x27'),this[_0xf208('0x28')],this[_0xf208('0x5')][_0xf208('0x29')]>0x0?this['number'][_0xf208('0x2a')](this[_0xf208('0x5')][_0xf208('0x29')]):this[_0xf208('0x2b')]);};Action[_0xf208('0x26')][_0xf208('0x2c')]=function(){return this[_0xf208('0x2d')];};module[_0xf208('0x2e')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js
deleted file mode 100644 (file)
index 1d99590..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0x4668=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x52b19e,_0x231e9c){var _0x6a38fd=function(_0x18d3eb){while(--_0x18d3eb){_0x52b19e['push'](_0x52b19e['shift']());}};_0x6a38fd(++_0x231e9c);}(_0x4668,0xf5));var _0x8466=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4668[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x8466('0x0'));var _=require(_0x8466('0x1'));var moment=require(_0x8466('0x2'));function getSeconds(_0x3f36f4,_0x17dc8e){var _0x369249=moment(_0x3f36f4)[_0x8466('0x3')](0x0);var _0x51e36d=moment(_0x17dc8e)['milliseconds'](0x0);return _0x369249[_0x8466('0x4')](_0x51e36d,_0x8466('0x5'));}function AdditionalPhone(_0x473de5){this[_0x8466('0x6')]=_0x473de5[_0x8466('0x6')];this['scheduledat']=_0x473de5[_0x8466('0x7')]||undefined;this[_0x8466('0x8')]=_0x473de5['type'];this[_0x8466('0x9')]=_0x473de5[_0x8466('0x8')]===_0x8466('0xa')?_0x8466('0xb'):_0x473de5[_0x8466('0x8')];this[_0x8466('0xc')]=_0x473de5[_0x8466('0xc')];this[_0x8466('0xd')]=_0x473de5[_0x8466('0xd')];this[_0x8466('0xe')]=_0x473de5[_0x8466('0xe')];this[_0x8466('0xf')]=_0x473de5['countbusyretry']+_0x473de5[_0x8466('0xd')]+_0x473de5[_0x8466('0xe')]+_0x473de5[_0x8466('0x10')]+_0x473de5[_0x8466('0x11')]+_0x473de5['countabandonedretry']+_0x473de5['countmachineretry']+_0x473de5[_0x8466('0x12')];this['countnosuchnumberretry']=_0x473de5[_0x8466('0x10')];this[_0x8466('0x11')]=_0x473de5[_0x8466('0x11')];this[_0x8466('0x13')]=_0x473de5[_0x8466('0x13')];this[_0x8466('0x14')]=_0x473de5[_0x8466('0x14')];this['countagentrejectretry']=_0x473de5[_0x8466('0x12')];this['queue']=_0x473de5['queue'];this['calleridname']=_0x473de5[_0x8466('0x15')];this[_0x8466('0x16')]=_0x473de5[_0x8466('0x17')];this[_0x8466('0x18')]=_0x473de5['starttime'];this[_0x8466('0x19')]=_0x473de5[_0x8466('0x19')];this['endtime']=_0x473de5[_0x8466('0x19')];this[_0x8466('0x1a')]=getSeconds(_0x473de5[_0x8466('0x19')],_0x473de5[_0x8466('0x18')]);this[_0x8466('0x1b')]=0x0;this['talktime']=0x0;this[_0x8466('0x1c')]=_0x473de5[_0x8466('0x1c')];this[_0x8466('0x1d')]=_0x473de5['callbackuniqueid'];this[_0x8466('0x1e')]=_0x473de5['callbackat'];this[_0x8466('0x1f')]=_0x473de5[_0x8466('0x1f')];this[_0x8466('0x20')]=_0x473de5[_0x8466('0x20')];this[_0x8466('0x21')]=_0x473de5[_0x8466('0x21')];this[_0x8466('0x22')]=_0x473de5[_0x8466('0x22')];this[_0x8466('0x23')]=_0x473de5['VoiceQueueId'];this[_0x8466('0x24')]=_0x473de5[_0x8466('0x24')];this[_0x8466('0x25')]=_0x473de5[_0x8466('0x25')]||'';this['originatecalleridname']=_0x473de5[_0x8466('0x26')]||'';}module[_0x8466('0x27')]=History;
\ No newline at end of file
index ad337bb..820dc05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6be1=['holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x1af592,_0x3f0715){var _0x54e79a=function(_0x4139d6){while(--_0x4139d6){_0x1af592['push'](_0x1af592['shift']());}};_0x54e79a(++_0x3f0715);}(_0x6be1,0x16e));var _0x16be=function(_0x11e767,_0x1913b2){_0x11e767=_0x11e767-0x0;var _0x3659ac=_0x6be1[_0x11e767];return _0x3659ac;};'use strict';var util=require(_0x16be('0x0'));var _=require('lodash');var moment=require(_0x16be('0x1'));function getSeconds(_0x1a3a16,_0x576fb3){var _0x1674e6=moment(_0x1a3a16)[_0x16be('0x2')](0x0);var _0x298b97=moment(_0x576fb3)[_0x16be('0x2')](0x0);return _0x1674e6[_0x16be('0x3')](_0x298b97,_0x16be('0x4'));}function AgentComplete(_0x547ac4,_0x4d996b){this['state']=0x4;this['statedesc']=_0x16be('0x5');this[_0x16be('0x6')]=_0x547ac4['scheduledat'];this['type']=_0x547ac4[_0x16be('0x7')];this[_0x16be('0x8')]=_0x547ac4[_0x16be('0x7')]===_0x16be('0x9')?_0x16be('0xa'):_0x547ac4[_0x16be('0x7')];this['countbusyretry']=_0x547ac4[_0x16be('0xb')];this[_0x16be('0xc')]=_0x547ac4[_0x16be('0xc')];this[_0x16be('0xd')]=_0x547ac4[_0x16be('0xd')];this['countglobal']=_0x547ac4['countbusyretry']+_0x547ac4[_0x16be('0xc')]+_0x547ac4[_0x16be('0xd')]+_0x547ac4['countnosuchnumberretry']+_0x547ac4['countdropretry']+_0x547ac4[_0x16be('0xe')]+_0x547ac4['countmachineretry']+_0x547ac4[_0x16be('0xf')];this[_0x16be('0x10')]=_0x547ac4['countnosuchnumberretry'];this[_0x16be('0x11')]=_0x547ac4[_0x16be('0x11')];this['countabandonedretry']=_0x547ac4[_0x16be('0xe')];this[_0x16be('0x12')]=_0x547ac4[_0x16be('0x12')];this['countagentrejectretry']=_0x547ac4['countagentrejectretry'];this[_0x16be('0x13')]=_0x4d996b[_0x16be('0x13')];this[_0x16be('0x14')]=_0x547ac4[_0x16be('0x15')];this[_0x16be('0x16')]=_0x547ac4[_0x16be('0x17')];this[_0x16be('0x18')]=_0x547ac4['starttime'];this[_0x16be('0x19')]=_0x547ac4[_0x16be('0x19')];this[_0x16be('0x1a')]=_0x547ac4['answertime'];this[_0x16be('0x1b')]=moment()['format'](_0x16be('0x1c'));this[_0x16be('0x1d')]=getSeconds(_0x547ac4['responsetime'],_0x547ac4[_0x16be('0x18')]);this[_0x16be('0x1e')]=getSeconds(_0x547ac4['answertime'],_0x547ac4['responsetime']);this['talktime']=getSeconds(this[_0x16be('0x1b')],_0x547ac4[_0x16be('0x1a')]);this[_0x16be('0xa')]=_0x4d996b[_0x16be('0xa')];this[_0x16be('0x1f')]=_0x4d996b['membername'];this[_0x16be('0x20')]=_0x4d996b['reason'];this['callback']=_0x547ac4[_0x16be('0x21')];this[_0x16be('0x22')]=_0x547ac4[_0x16be('0x22')];this['callbackat']=_0x547ac4[_0x16be('0x23')];this[_0x16be('0x24')]=_0x547ac4[_0x16be('0x24')];this[_0x16be('0x25')]=_0x547ac4[_0x16be('0x25')];this[_0x16be('0x26')]=_0x547ac4[_0x16be('0x26')];this['UserId']=_0x547ac4['UserId'];this[_0x16be('0x27')]=_0x547ac4[_0x16be('0x27')];this[_0x16be('0x28')]=_0x547ac4[_0x16be('0x28')];this[_0x16be('0x29')]=_0x547ac4[_0x16be('0x29')]||'';this['originatecalleridname']=_0x547ac4[_0x16be('0x2a')]||'';}module[_0x16be('0x2b')]=AgentComplete;
\ No newline at end of file
+var _0x46e9=['holdtime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x46e9,0xf1));var _0x946e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x46e9[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x946e('0x0'));var _=require(_0x946e('0x1'));var moment=require('moment');function getSeconds(_0xe35408,_0x1b6de7){var _0xa6ef90=moment(_0xe35408)[_0x946e('0x2')](0x0);var _0x3af853=moment(_0x1b6de7)[_0x946e('0x2')](0x0);return _0xa6ef90[_0x946e('0x3')](_0x3af853,_0x946e('0x4'));}function AgentComplete(_0x305dd1,_0x2be8ba){this[_0x946e('0x5')]=0x4;this['statedesc']=_0x946e('0x6');this[_0x946e('0x7')]=_0x305dd1[_0x946e('0x7')];this[_0x946e('0x8')]=_0x305dd1['type'];this[_0x946e('0x9')]=_0x305dd1[_0x946e('0x8')]===_0x946e('0xa')?_0x946e('0xb'):_0x305dd1[_0x946e('0x8')];this[_0x946e('0xc')]=_0x305dd1[_0x946e('0xc')];this['countcongestionretry']=_0x305dd1[_0x946e('0xd')];this['countnoanswerretry']=_0x305dd1[_0x946e('0xe')];this[_0x946e('0xf')]=_0x305dd1[_0x946e('0xc')]+_0x305dd1[_0x946e('0xd')]+_0x305dd1['countnoanswerretry']+_0x305dd1['countnosuchnumberretry']+_0x305dd1[_0x946e('0x10')]+_0x305dd1[_0x946e('0x11')]+_0x305dd1[_0x946e('0x12')]+_0x305dd1[_0x946e('0x13')];this[_0x946e('0x14')]=_0x305dd1[_0x946e('0x14')];this[_0x946e('0x10')]=_0x305dd1[_0x946e('0x10')];this[_0x946e('0x11')]=_0x305dd1[_0x946e('0x11')];this['countmachineretry']=_0x305dd1[_0x946e('0x12')];this[_0x946e('0x13')]=_0x305dd1[_0x946e('0x13')];this['uniqueid']=_0x2be8ba[_0x946e('0x15')];this['calleridname']=_0x305dd1[_0x946e('0x16')];this['calleridnum']=_0x305dd1[_0x946e('0x17')];this[_0x946e('0x18')]=_0x305dd1[_0x946e('0x18')];this['responsetime']=_0x305dd1[_0x946e('0x19')];this[_0x946e('0x1a')]=_0x305dd1[_0x946e('0x1a')];this['endtime']=moment()['format'](_0x946e('0x1b'));this[_0x946e('0x1c')]=getSeconds(_0x305dd1[_0x946e('0x19')],_0x305dd1[_0x946e('0x18')]);this[_0x946e('0x1d')]=getSeconds(_0x305dd1[_0x946e('0x1a')],_0x305dd1['responsetime']);this['talktime']=getSeconds(this[_0x946e('0x1e')],_0x305dd1[_0x946e('0x1a')]);this[_0x946e('0xb')]=_0x2be8ba[_0x946e('0xb')];this[_0x946e('0x1f')]=_0x2be8ba[_0x946e('0x1f')];this['reason']=_0x2be8ba[_0x946e('0x20')];this['callback']=_0x305dd1[_0x946e('0x21')];this[_0x946e('0x22')]=_0x305dd1['callbackuniqueid'];this[_0x946e('0x23')]=_0x305dd1['callbackat'];this[_0x946e('0x24')]=_0x305dd1[_0x946e('0x24')];this[_0x946e('0x25')]=_0x305dd1[_0x946e('0x25')];this['ListId']=_0x305dd1[_0x946e('0x26')];this[_0x946e('0x27')]=_0x305dd1['UserId'];this[_0x946e('0x28')]=_0x305dd1[_0x946e('0x28')];this[_0x946e('0x29')]=_0x305dd1[_0x946e('0x29')];this[_0x946e('0x2a')]=_0x305dd1[_0x946e('0x2a')]||'';this[_0x946e('0x2b')]=_0x305dd1[_0x946e('0x2b')]||'';}module[_0x946e('0x2c')]=AgentComplete;
\ No newline at end of file
index c1c7029..cb28c53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc492=['calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue'];(function(_0x2d2a58,_0x1f8f4b){var _0x451dfb=function(_0x4a1780){while(--_0x4a1780){_0x2d2a58['push'](_0x2d2a58['shift']());}};_0x451dfb(++_0x1f8f4b);}(_0xc492,0xd7));var _0x2c49=function(_0x3b342a,_0x1c630a){_0x3b342a=_0x3b342a-0x0;var _0x5e9ab9=_0xc492[_0x3b342a];return _0x5e9ab9;};'use strict';var util=require(_0x2c49('0x0'));var _=require(_0x2c49('0x1'));var moment=require(_0x2c49('0x2'));function getSeconds(_0x5c2d08,_0x57cde2){var _0x37eda4=moment(_0x5c2d08)['milliseconds'](0x0);var _0x4c9b2d=moment(_0x57cde2)[_0x2c49('0x3')](0x0);return _0x37eda4[_0x2c49('0x4')](_0x4c9b2d,'seconds');}function Final(_0x1165e3){this['uniqueid']=_0x1165e3[_0x2c49('0x5')];this[_0x2c49('0x6')]=_0x1165e3['scheduledat'];this[_0x2c49('0x7')]=_0x1165e3[_0x2c49('0x7')];this[_0x2c49('0x8')]=_0x1165e3[_0x2c49('0x7')]===_0x2c49('0x9')?'queue':_0x1165e3[_0x2c49('0x7')];this['countbusyretry']=_0x1165e3['countbusyretry'];this['countcongestionretry']=_0x1165e3['countcongestionretry'];this[_0x2c49('0xa')]=_0x1165e3['countnoanswerretry'];this[_0x2c49('0xb')]=_0x1165e3[_0x2c49('0xc')]+_0x1165e3['countcongestionretry']+_0x1165e3[_0x2c49('0xa')]+_0x1165e3[_0x2c49('0xd')]+_0x1165e3[_0x2c49('0xe')]+_0x1165e3[_0x2c49('0xf')]+_0x1165e3[_0x2c49('0x10')]+_0x1165e3[_0x2c49('0x11')];this['countnosuchnumberretry']=_0x1165e3[_0x2c49('0xd')];this[_0x2c49('0xe')]=_0x1165e3[_0x2c49('0xe')];this[_0x2c49('0xf')]=_0x1165e3[_0x2c49('0xf')];this['countmachineretry']=_0x1165e3[_0x2c49('0x10')];this[_0x2c49('0x11')]=_0x1165e3[_0x2c49('0x11')];this[_0x2c49('0x12')]=_0x1165e3[_0x2c49('0x12')];this[_0x2c49('0x13')]=_0x1165e3[_0x2c49('0x13')];this[_0x2c49('0x14')]=_0x1165e3[_0x2c49('0x14')];this[_0x2c49('0x15')]=_0x1165e3['starttime'];this[_0x2c49('0x16')]=_0x1165e3[_0x2c49('0x16')];this[_0x2c49('0x17')]=_0x1165e3[_0x2c49('0x16')];this['ringtime']=_0x1165e3[_0x2c49('0x18')]||0x0;this['holdtime']=_0x1165e3[_0x2c49('0x19')]||0x0;this[_0x2c49('0x1a')]=_0x1165e3['talktime']||0x0;this['callback']=_0x1165e3[_0x2c49('0x1b')];this[_0x2c49('0x1c')]=_0x1165e3[_0x2c49('0x1c')];this[_0x2c49('0x1d')]=_0x1165e3[_0x2c49('0x1d')];this[_0x2c49('0x1e')]=_0x1165e3[_0x2c49('0x1e')];this[_0x2c49('0x1f')]=_0x1165e3[_0x2c49('0x1f')];this['ListId']=_0x1165e3[_0x2c49('0x20')];this[_0x2c49('0x21')]=_0x1165e3[_0x2c49('0x21')];this[_0x2c49('0x22')]=_0x1165e3['VoiceQueueId'];this[_0x2c49('0x23')]=_0x1165e3[_0x2c49('0x23')];this[_0x2c49('0x24')]=_0x1165e3[_0x2c49('0x24')]||'';this['originatecalleridname']=_0x1165e3[_0x2c49('0x25')]||'';}module[_0x2c49('0x26')]=Final;
\ No newline at end of file
+var _0x4300=['countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x4300,0x1a6));var _0x0430=function(_0x5accc9,_0x1f3ac0){_0x5accc9=_0x5accc9-0x0;var _0x574cc9=_0x4300[_0x5accc9];return _0x574cc9;};'use strict';var util=require(_0x0430('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x481e26,_0x54a4da){var _0x4388ad=moment(_0x481e26)[_0x0430('0x1')](0x0);var _0x1c139f=moment(_0x54a4da)[_0x0430('0x1')](0x0);return _0x4388ad[_0x0430('0x2')](_0x1c139f,'seconds');}function Final(_0x46b412){this['uniqueid']=_0x46b412[_0x0430('0x3')];this['scheduledat']=_0x46b412[_0x0430('0x4')];this[_0x0430('0x5')]=_0x46b412[_0x0430('0x5')];this[_0x0430('0x6')]=_0x46b412[_0x0430('0x5')]===_0x0430('0x7')?_0x0430('0x8'):_0x46b412[_0x0430('0x5')];this[_0x0430('0x9')]=_0x46b412['countbusyretry'];this[_0x0430('0xa')]=_0x46b412[_0x0430('0xa')];this[_0x0430('0xb')]=_0x46b412[_0x0430('0xb')];this[_0x0430('0xc')]=_0x46b412[_0x0430('0x9')]+_0x46b412[_0x0430('0xa')]+_0x46b412[_0x0430('0xb')]+_0x46b412['countnosuchnumberretry']+_0x46b412['countdropretry']+_0x46b412[_0x0430('0xd')]+_0x46b412[_0x0430('0xe')]+_0x46b412[_0x0430('0xf')];this[_0x0430('0x10')]=_0x46b412[_0x0430('0x10')];this[_0x0430('0x11')]=_0x46b412[_0x0430('0x11')];this['countabandonedretry']=_0x46b412[_0x0430('0xd')];this[_0x0430('0xe')]=_0x46b412[_0x0430('0xe')];this[_0x0430('0xf')]=_0x46b412['countagentrejectretry'];this['queue']=_0x46b412['queue'];this[_0x0430('0x12')]=_0x46b412['calleridname'];this['calleridnum']=_0x46b412[_0x0430('0x13')];this[_0x0430('0x14')]=_0x46b412[_0x0430('0x14')];this[_0x0430('0x15')]=_0x46b412[_0x0430('0x15')];this['endtime']=_0x46b412['responsetime'];this[_0x0430('0x16')]=_0x46b412[_0x0430('0x16')]||0x0;this[_0x0430('0x17')]=_0x46b412[_0x0430('0x17')]||0x0;this['talktime']=_0x46b412['talktime']||0x0;this[_0x0430('0x18')]=_0x46b412[_0x0430('0x18')];this[_0x0430('0x19')]=_0x46b412[_0x0430('0x19')];this[_0x0430('0x1a')]=_0x46b412[_0x0430('0x1a')];this['recallme']=_0x46b412[_0x0430('0x1b')];this[_0x0430('0x1c')]=_0x46b412[_0x0430('0x1c')];this[_0x0430('0x1d')]=_0x46b412['ListId'];this[_0x0430('0x1e')]=_0x46b412[_0x0430('0x1e')];this[_0x0430('0x1f')]=_0x46b412[_0x0430('0x1f')];this[_0x0430('0x20')]=_0x46b412[_0x0430('0x20')];this[_0x0430('0x21')]=_0x46b412[_0x0430('0x21')]||'';this[_0x0430('0x22')]=_0x46b412['originatecalleridname']||'';}module[_0x0430('0x23')]=Final;
\ No newline at end of file
index 5128dad..2f2b245 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8214=['countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry'];(function(_0x606fe8,_0x10b084){var _0x28b517=function(_0x5e90f4){while(--_0x5e90f4){_0x606fe8['push'](_0x606fe8['shift']());}};_0x28b517(++_0x10b084);}(_0x8214,0x1f0));var _0x4821=function(_0x2ca66c,_0x3099a8){_0x2ca66c=_0x2ca66c-0x0;var _0x4e1511=_0x8214[_0x2ca66c];return _0x4e1511;};'use strict';var util=require(_0x4821('0x0'));var _=require(_0x4821('0x1'));var moment=require(_0x4821('0x2'));function getSeconds(_0xf6787f,_0x5757a6){var _0x5cb92a=moment(_0xf6787f)[_0x4821('0x3')](0x0);var _0x3215e9=moment(_0x5757a6)[_0x4821('0x3')](0x0);return _0x5cb92a[_0x4821('0x4')](_0x3215e9,_0x4821('0x5'));}function Hangup(_0x85bb09,_0x4b4d76){this['state']=0x4;this[_0x4821('0x6')]=_0x4821('0x7');this[_0x4821('0x8')]=_0x85bb09[_0x4821('0x8')];this['type']=_0x85bb09[_0x4821('0x9')];this[_0x4821('0xa')]=_0x85bb09[_0x4821('0x9')]===_0x4821('0xb')?_0x4821('0xc'):_0x85bb09[_0x4821('0x9')];this[_0x4821('0xd')]=_0x85bb09[_0x4821('0xd')];this[_0x4821('0xe')]=_0x85bb09['countcongestionretry'];this[_0x4821('0xf')]=_0x85bb09['countnoanswerretry'];this[_0x4821('0x10')]=_0x85bb09[_0x4821('0xd')]+_0x85bb09[_0x4821('0xe')]+_0x85bb09['countnoanswerretry']+_0x85bb09['countnosuchnumberretry']+_0x85bb09['countdropretry']+_0x85bb09[_0x4821('0x11')]+_0x85bb09[_0x4821('0x12')]+_0x85bb09[_0x4821('0x13')];this['countnosuchnumberretry']=_0x85bb09[_0x4821('0x14')];this['countdropretry']=_0x85bb09[_0x4821('0x15')];this['countabandonedretry']=_0x85bb09['countabandonedretry'];this['countmachineretry']=_0x85bb09[_0x4821('0x12')];this[_0x4821('0x13')]=_0x85bb09[_0x4821('0x13')];this[_0x4821('0x16')]=_0x4b4d76[_0x4821('0x16')];this[_0x4821('0x17')]=_0x85bb09[_0x4821('0x18')];this[_0x4821('0x19')]=_0x85bb09[_0x4821('0x1a')];this[_0x4821('0x1b')]=_0x85bb09[_0x4821('0x1b')];this[_0x4821('0x1c')]=_0x85bb09[_0x4821('0x1c')];this[_0x4821('0x1d')]=moment()[_0x4821('0x1e')](_0x4821('0x1f'));this[_0x4821('0x20')]=getSeconds(_0x85bb09[_0x4821('0x1c')],_0x85bb09['starttime']);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0x4821('0x1d')],_0x85bb09[_0x4821('0x1c')]);this[_0x4821('0xc')]=_0x85bb09[_0x4821('0xc')];this[_0x4821('0x21')]=_0x4821('0x22');this[_0x4821('0x23')]=_0x4b4d76[_0x4821('0x24')];this['callback']=_0x85bb09[_0x4821('0x25')];this['callbackuniqueid']=_0x85bb09[_0x4821('0x26')];this[_0x4821('0x27')]=_0x85bb09['callbackat'];this[_0x4821('0x28')]=_0x85bb09[_0x4821('0x28')];this['ContactId']=_0x85bb09[_0x4821('0x29')];this[_0x4821('0x2a')]=_0x85bb09[_0x4821('0x2a')];this[_0x4821('0x2b')]=_0x85bb09[_0x4821('0x2b')];this['VoiceQueueId']=_0x85bb09[_0x4821('0x2c')];this[_0x4821('0x2d')]=_0x85bb09[_0x4821('0x2d')];}module[_0x4821('0x2e')]=Hangup;
\ No newline at end of file
+var _0xb1f3=['name','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname'];(function(_0x1a6533,_0x257b99){var _0x3fdc20=function(_0x2f153e){while(--_0x2f153e){_0x1a6533['push'](_0x1a6533['shift']());}};_0x3fdc20(++_0x257b99);}(_0xb1f3,0x17a));var _0x3b1f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1f3[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x3b1f('0x0'));var _=require(_0x3b1f('0x1'));var moment=require(_0x3b1f('0x2'));function getSeconds(_0x85cb2a,_0x4bcc9f){var _0x9b986b=moment(_0x85cb2a)[_0x3b1f('0x3')](0x0);var _0x29662a=moment(_0x4bcc9f)[_0x3b1f('0x3')](0x0);return _0x9b986b['diff'](_0x29662a,_0x3b1f('0x4'));}function Hangup(_0x32d7f8,_0x3ba125){this[_0x3b1f('0x5')]=0x4;this[_0x3b1f('0x6')]=_0x3b1f('0x7');this[_0x3b1f('0x8')]=_0x32d7f8[_0x3b1f('0x8')];this[_0x3b1f('0x9')]=_0x32d7f8[_0x3b1f('0x9')];this[_0x3b1f('0xa')]=_0x32d7f8[_0x3b1f('0x9')]===_0x3b1f('0xb')?_0x3b1f('0xc'):_0x32d7f8[_0x3b1f('0x9')];this[_0x3b1f('0xd')]=_0x32d7f8[_0x3b1f('0xd')];this[_0x3b1f('0xe')]=_0x32d7f8[_0x3b1f('0xe')];this[_0x3b1f('0xf')]=_0x32d7f8[_0x3b1f('0xf')];this['countglobal']=_0x32d7f8['countbusyretry']+_0x32d7f8['countcongestionretry']+_0x32d7f8[_0x3b1f('0xf')]+_0x32d7f8[_0x3b1f('0x10')]+_0x32d7f8['countdropretry']+_0x32d7f8[_0x3b1f('0x11')]+_0x32d7f8['countmachineretry']+_0x32d7f8[_0x3b1f('0x12')];this[_0x3b1f('0x10')]=_0x32d7f8[_0x3b1f('0x10')];this[_0x3b1f('0x13')]=_0x32d7f8['countdropretry'];this[_0x3b1f('0x11')]=_0x32d7f8['countabandonedretry'];this[_0x3b1f('0x14')]=_0x32d7f8[_0x3b1f('0x14')];this['countagentrejectretry']=_0x32d7f8[_0x3b1f('0x12')];this['uniqueid']=_0x3ba125['uniqueid'];this[_0x3b1f('0x15')]=_0x32d7f8[_0x3b1f('0x16')];this['calleridnum']=_0x32d7f8['number'];this['starttime']=_0x32d7f8[_0x3b1f('0x17')];this['responsetime']=_0x32d7f8[_0x3b1f('0x18')];this[_0x3b1f('0x19')]=moment()[_0x3b1f('0x1a')](_0x3b1f('0x1b'));this[_0x3b1f('0x1c')]=getSeconds(_0x32d7f8[_0x3b1f('0x18')],_0x32d7f8[_0x3b1f('0x17')]);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0x3b1f('0x19')],_0x32d7f8[_0x3b1f('0x18')]);this[_0x3b1f('0xc')]=_0x32d7f8['queue'];this['membername']='IVR';this[_0x3b1f('0x1d')]=_0x3ba125[_0x3b1f('0x1e')];this[_0x3b1f('0x1f')]=_0x32d7f8['callback'];this[_0x3b1f('0x20')]=_0x32d7f8['callbackuniqueid'];this['callbackat']=_0x32d7f8[_0x3b1f('0x21')];this[_0x3b1f('0x22')]=_0x32d7f8['recallme'];this[_0x3b1f('0x23')]=_0x32d7f8['ContactId'];this[_0x3b1f('0x24')]=_0x32d7f8['ListId'];this[_0x3b1f('0x25')]=_0x32d7f8[_0x3b1f('0x25')];this[_0x3b1f('0x26')]=_0x32d7f8[_0x3b1f('0x26')];this['CampaignId']=_0x32d7f8[_0x3b1f('0x27')];}module['exports']=Hangup;
\ No newline at end of file
index 6cc7ad2..0d6e182 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x045e=['calleridnum','number','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','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name'];(function(_0x10152a,_0x4524c8){var _0x541679=function(_0x516fe1){while(--_0x516fe1){_0x10152a['push'](_0x10152a['shift']());}};_0x541679(++_0x4524c8);}(_0x045e,0xdc));var _0xe045=function(_0x304320,_0x232a69){_0x304320=_0x304320-0x0;var _0xe607da=_0x045e[_0x304320];return _0xe607da;};'use strict';var util=require(_0xe045('0x0'));var _=require('lodash');var moment=require(_0xe045('0x1'));function getSeconds(_0x17fd96,_0x23d5f8){var _0x316936=moment(_0x17fd96)[_0xe045('0x2')](0x0);var _0x11d0a0=moment(_0x23d5f8)['milliseconds'](0x0);return _0x316936[_0xe045('0x3')](_0x11d0a0,_0xe045('0x4'));}function History(_0x3dcadd){this[_0xe045('0x5')]=_0x3dcadd['uniqueid'];this[_0xe045('0x6')]=_0x3dcadd['scheduledat']||undefined;this[_0xe045('0x7')]=_0x3dcadd['type'];this[_0xe045('0x8')]=_0x3dcadd['type']==='outbound'?'queue':_0x3dcadd[_0xe045('0x7')];this['countbusyretry']=_0x3dcadd[_0xe045('0x9')];this['countcongestionretry']=_0x3dcadd[_0xe045('0xa')];this[_0xe045('0xb')]=_0x3dcadd[_0xe045('0xb')];this[_0xe045('0xc')]=_0x3dcadd['countbusyretry']+_0x3dcadd[_0xe045('0xa')]+_0x3dcadd[_0xe045('0xb')]+_0x3dcadd[_0xe045('0xd')]+_0x3dcadd[_0xe045('0xe')]+_0x3dcadd[_0xe045('0xf')]+_0x3dcadd[_0xe045('0x10')]+_0x3dcadd['countagentrejectretry'];this[_0xe045('0xd')]=_0x3dcadd[_0xe045('0xd')];this[_0xe045('0xe')]=_0x3dcadd[_0xe045('0xe')];this[_0xe045('0xf')]=_0x3dcadd[_0xe045('0xf')];this[_0xe045('0x10')]=_0x3dcadd['countmachineretry'];this['countagentrejectretry']=_0x3dcadd[_0xe045('0x11')];this['queue']=_0x3dcadd[_0xe045('0x12')];this['calleridname']=_0x3dcadd[_0xe045('0x13')];this[_0xe045('0x14')]=_0x3dcadd[_0xe045('0x15')];this[_0xe045('0x16')]=_0x3dcadd[_0xe045('0x16')];this[_0xe045('0x17')]=_0x3dcadd[_0xe045('0x17')];this[_0xe045('0x18')]=_0x3dcadd[_0xe045('0x17')];this[_0xe045('0x19')]=getSeconds(_0x3dcadd[_0xe045('0x17')],_0x3dcadd[_0xe045('0x16')]);this[_0xe045('0x1a')]=0x0;this[_0xe045('0x1b')]=0x0;this[_0xe045('0x1c')]=_0x3dcadd['callback'];this[_0xe045('0x1d')]=_0x3dcadd['callbackuniqueid'];this[_0xe045('0x1e')]=_0x3dcadd[_0xe045('0x1e')];this[_0xe045('0x1f')]=_0x3dcadd['recallme'];this[_0xe045('0x20')]=_0x3dcadd['ContactId'];this[_0xe045('0x21')]=_0x3dcadd[_0xe045('0x21')];this[_0xe045('0x22')]=_0x3dcadd['UserId'];this[_0xe045('0x23')]=_0x3dcadd[_0xe045('0x23')];this['CampaignId']=_0x3dcadd[_0xe045('0x24')];this[_0xe045('0x25')]=_0x3dcadd[_0xe045('0x25')]||'';this[_0xe045('0x26')]=_0x3dcadd[_0xe045('0x26')]||'';}module[_0xe045('0x27')]=History;
\ No newline at end of file
+var _0x20d9=['countdropretry','countagentrejectretry','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x20d9,0xcc));var _0x920d=function(_0x5c5875,_0x3aca34){_0x5c5875=_0x5c5875-0x0;var _0x265eaa=_0x20d9[_0x5c5875];return _0x265eaa;};'use strict';var util=require('util');var _=require(_0x920d('0x0'));var moment=require(_0x920d('0x1'));function getSeconds(_0x3d0c6d,_0x13e798){var _0x25f9f4=moment(_0x3d0c6d)[_0x920d('0x2')](0x0);var _0x2d41d4=moment(_0x13e798)[_0x920d('0x2')](0x0);return _0x25f9f4[_0x920d('0x3')](_0x2d41d4,_0x920d('0x4'));}function History(_0x4b8173){this['uniqueid']=_0x4b8173[_0x920d('0x5')];this[_0x920d('0x6')]=_0x4b8173[_0x920d('0x6')]||undefined;this[_0x920d('0x7')]=_0x4b8173[_0x920d('0x7')];this[_0x920d('0x8')]=_0x4b8173['type']===_0x920d('0x9')?_0x920d('0xa'):_0x4b8173['type'];this[_0x920d('0xb')]=_0x4b8173[_0x920d('0xb')];this[_0x920d('0xc')]=_0x4b8173[_0x920d('0xc')];this[_0x920d('0xd')]=_0x4b8173['countnoanswerretry'];this[_0x920d('0xe')]=_0x4b8173[_0x920d('0xb')]+_0x4b8173[_0x920d('0xc')]+_0x4b8173['countnoanswerretry']+_0x4b8173[_0x920d('0xf')]+_0x4b8173['countdropretry']+_0x4b8173[_0x920d('0x10')]+_0x4b8173[_0x920d('0x11')]+_0x4b8173['countagentrejectretry'];this[_0x920d('0xf')]=_0x4b8173[_0x920d('0xf')];this['countdropretry']=_0x4b8173[_0x920d('0x12')];this['countabandonedretry']=_0x4b8173[_0x920d('0x10')];this[_0x920d('0x11')]=_0x4b8173['countmachineretry'];this[_0x920d('0x13')]=_0x4b8173[_0x920d('0x13')];this['queue']=_0x4b8173[_0x920d('0xa')];this['calleridname']=_0x4b8173[_0x920d('0x14')];this[_0x920d('0x15')]=_0x4b8173['number'];this[_0x920d('0x16')]=_0x4b8173[_0x920d('0x16')];this[_0x920d('0x17')]=_0x4b8173[_0x920d('0x17')];this[_0x920d('0x18')]=_0x4b8173['responsetime'];this[_0x920d('0x19')]=getSeconds(_0x4b8173[_0x920d('0x17')],_0x4b8173[_0x920d('0x16')]);this[_0x920d('0x1a')]=0x0;this[_0x920d('0x1b')]=0x0;this[_0x920d('0x1c')]=_0x4b8173[_0x920d('0x1c')];this[_0x920d('0x1d')]=_0x4b8173[_0x920d('0x1d')];this['callbackat']=_0x4b8173['callbackat'];this[_0x920d('0x1e')]=_0x4b8173[_0x920d('0x1e')];this[_0x920d('0x1f')]=_0x4b8173[_0x920d('0x1f')];this[_0x920d('0x20')]=_0x4b8173['ListId'];this['UserId']=_0x4b8173['UserId'];this[_0x920d('0x21')]=_0x4b8173[_0x920d('0x21')];this[_0x920d('0x22')]=_0x4b8173[_0x920d('0x22')];this['originatecalleridnum']=_0x4b8173['originatecalleridnum']||'';this[_0x920d('0x23')]=_0x4b8173[_0x920d('0x23')]||'';}module[_0x920d('0x24')]=History;
\ No newline at end of file
index 05a0db3..e5d4db1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd157=['erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','md5','format','voice:queue:%s','voice_queue:save','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\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','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','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','clearing\x20variable\x20start\x20predictive','handlePredictive','ivr','string','\x22%s\x22\x20<%s>','inspect','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','statedesc','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','No\x20such\x20channel','voiceQueues','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','resolve','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','state','HangupInAMD','AMD','emit','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','uniqueid','Machine','membername','countmachineretry','countglobal','custom:amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','rescheduleContact','add','minutes','ListId','[rescheduleContact][Machine]','dialMachineRetryFrequency','ContactId','[syncHangupIvr]','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','additional','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','paused','stateinterface','rrmemory','push','queueStatusComplete','[unlockQueueStatus][undefined]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','resetActiveCalls','checkIsTrunkReachable','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','isArray','iftime\x20%s,%s','indexOf','true','command','content','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','handlePower','power','predictive','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','launchHandleIvr','handleIvr','checkIfTime','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','checkPreviewRecallReminder','syncCampaigns','dialGlobalInterval','pow','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueOptions','ACTIVE','xcally-motion-dialer','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','[CatchErlangB]','agentBusyFactor','outboundQueuePauses','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[actionOriginate]\x20','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactBlack','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','uuid','ioredis','../preview/util/util','../../../config/logger','booked','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','./action','./final','./agentComplete','./queueCallerAbandon','XCALLY_IP_AGI','roundrobin','prototype','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','name','message','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated'];(function(_0x1a6a0e,_0x5d873c){var _0x45bd4f=function(_0x392090){while(--_0x392090){_0x1a6a0e['push'](_0x1a6a0e['shift']());}};_0x45bd4f(++_0x5d873c);}(_0xd157,0x19d));var _0x7d15=function(_0x46b5aa,_0x350638){_0x46b5aa=_0x46b5aa-0x0;var _0x495a84=_0xd157[_0x46b5aa];return _0x495a84;};'use strict';var util=require(_0x7d15('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x7d15('0x1'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x7d15('0x2'));var ut=require(_0x7d15('0x3'));var config=require('../../../config/environment/');var logger=require(_0x7d15('0x4'))('dialer');var loggerBooked=require(_0x7d15('0x4'))(_0x7d15('0x5'));var loggerPredictive=require(_0x7d15('0x4'))('predictive');var loggerPredictiveCalls=require(_0x7d15('0x4'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x7d15('0x4'))(_0x7d15('0x6'));var ami=require(_0x7d15('0x7'));config['redis']=_['defaults'](config[_0x7d15('0x8')],{'host':_0x7d15('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x7d15('0xa'));var cmHopperHistory=require(_0x7d15('0xb'));var cmHopperFinal=require(_0x7d15('0xc'));var cmHopperAdditionalPhone=require(_0x7d15('0xd'));var cmHopperBlack=require(_0x7d15('0xe'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0x7d15('0xf'));var History=require('./history');var Final=require(_0x7d15('0x10'));var AgentComplete=require(_0x7d15('0x11'));var QueueCallerAbandon=require(_0x7d15('0x12'));var Hangup=require('./hangup');var ipAgi=process['env'][_0x7d15('0x13')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x7d15('0x14')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x7d15('0x15')][_0x7d15('0x16')]=function(_0x405ff7){this[_0x7d15('0x17')]=this['tail']?this[_0x7d15('0x17')][_0x7d15('0x18')](_0x405ff7):_0x405ff7();};function Dialer(_0x5eef2a,_0x1640f5){this[_0x7d15('0x19')]=new Sequence();this[_0x7d15('0x1a')]=_0x1640f5;this['voiceQueues']=_0x5eef2a['voiceQueues'];this[_0x7d15('0x1b')]=_0x5eef2a[_0x7d15('0x1b')];this[_0x7d15('0x1c')]=_0x5eef2a[_0x7d15('0x1c')];this['trunks']=_0x5eef2a[_0x7d15('0x1d')];this[_0x7d15('0x1e')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x7d15('0x1f')]={};this[_0x7d15('0x20')]={};this[_0x7d15('0x21')]={};this[_0x7d15('0x22')]={};this['startPredictive']={};this[_0x7d15('0x23')]={};this[_0x7d15('0x24')]={};this[_0x7d15('0x25')]={};this[_0x7d15('0x26')]={};ami['on'](_0x7d15('0x27'),this['syncAgentConnect'][_0x7d15('0x28')](this));ami['on'](_0x7d15('0x29'),this['syncQueueCallerAbandon'][_0x7d15('0x28')](this));ami['on'](_0x7d15('0x2a'),this[_0x7d15('0x2b')][_0x7d15('0x28')](this));ami['on'](_0x7d15('0x2c'),this[_0x7d15('0x2d')][_0x7d15('0x28')](this));ami['on'](_0x7d15('0x2e'),this[_0x7d15('0x6')]['bind'](this));ami['on'](_0x7d15('0x2f'),this[_0x7d15('0x30')][_0x7d15('0x28')](this));ami['on'](_0x7d15('0x31'),this['syncNewExten'][_0x7d15('0x28')](this));ami['on'](_0x7d15('0x32'),this[_0x7d15('0x33')]['bind'](this));ami['on'](_0x7d15('0x34'),this[_0x7d15('0x35')][_0x7d15('0x28')](this));ami['on']('queuestatuscomplete',this[_0x7d15('0x36')]['bind'](this));this[_0x7d15('0x37')]();this[_0x7d15('0x38')]();RpcSetting[_0x7d15('0x39')]()[_0x7d15('0x3a')](function(_0x236528){previewRecallmeReminderInterval=_0x236528[_0x7d15('0x3b')];});}function isNotNull(_0x2a106b){return _0x2a106b!==null&&!_['isUndefined'](_0x2a106b);}function checkIsLoggedIn(_0x587b18,_0x4d8726){return function(){if(_0x4d8726<=0x0){_0x587b18['message']='AGENTS_NOT_LOGGED';throw _0x587b18[_0x7d15('0x3c')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x5895a9){return _0x5895a9;}function checkIsActive(_0x41a43c,_0x56d7bd){return function(){if(!isActive(_0x56d7bd)){_0x41a43c[_0x7d15('0x3d')]=_0x7d15('0x3e');throw _0x41a43c[_0x7d15('0x3c')]+'\x20NOT\x20Active';}};}function checkInterval(_0x171da){return function(){if(!isNotNull(_0x171da[_0x7d15('0x3f')])){_0x171da[_0x7d15('0x3d')]=_0x7d15('0x40');throw _0x171da[_0x7d15('0x3c')]+_0x7d15('0x41');}if(!isNotNull(_0x171da['Interval'][_0x7d15('0x42')])){_0x171da[_0x7d15('0x3d')]='INTERVAL_IS_NULL';throw _0x171da[_0x7d15('0x3c')]+_0x7d15('0x41');}if(!isNotNull(_['isEmpty'](_0x171da[_0x7d15('0x3f')][_0x7d15('0x42')]))){_0x171da[_0x7d15('0x3d')]=_0x7d15('0x40');throw _0x171da[_0x7d15('0x3c')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x54333e,_0x4e8187,_0x4e0d1b){return{'action':_0x54333e,'response':_0x4e8187,'message':_0x4e0d1b,'stack':_0x4e0d1b};}function myreject(_0xf5b718){return function(_0x36ec79){return _0xf5b718(msgResponse(_0x7d15('0x43'),_0x7d15('0x44'),JSON[_0x7d15('0x45')](_0x36ec79)));};}function getSeconds(_0x493c45,_0x228ebe){var _0x3d8d47=moment(_0x493c45)[_0x7d15('0x46')](0x0);var _0x13bf86=moment(_0x228ebe)[_0x7d15('0x46')](0x0);return _0x3d8d47[_0x7d15('0x47')](_0x13bf86,_0x7d15('0x48'));}function emit(_0x4a3c72,_0x2a478a,_0x10e196){io['to'](_0x4a3c72)['emit'](_0x2a478a,_0x10e196);}function emitVoiceQueueSummary(_0x2665e4){if(_0x2665e4[_0x7d15('0x49')]===_0x7d15('0x4a')){var _0xe13bbd={'id':_0x2665e4['id'],'name':_0x2665e4[_0x7d15('0x3c')],'strategy':_0x2665e4[_0x7d15('0x4b')],'answered':_0x2665e4['answered'],'available':_0x2665e4[_0x7d15('0x4c')],'loggedIn':_0x2665e4[_0x7d15('0x4d')],'pTalking':_0x2665e4[_0x7d15('0x4e')],'sumBillable':_0x2665e4['sumBillable'],'sumDuration':_0x2665e4[_0x7d15('0x4f')],'sumHoldTime':_0x2665e4[_0x7d15('0x50')]||0x0,'talking':_0x2665e4[_0x7d15('0x51')],'total':_0x2665e4[_0x7d15('0x52')],'type':_0x2665e4['type'],'unmanaged':_0x2665e4[_0x7d15('0x53')],'abandoned':_0x2665e4[_0x7d15('0x54')],'waiting':_0x2665e4[_0x7d15('0x55')],'loggedInDb':_0x2665e4[_0x7d15('0x56')],'dialActive':_0x2665e4[_0x7d15('0x57')],'dialMethod':_0x2665e4['dialMethod'],'dialOriginateCallerIdName':_0x2665e4[_0x7d15('0x58')],'dialOriginateCallerIdNumber':_0x2665e4[_0x7d15('0x59')],'dialOriginateTimeout':_0x2665e4[_0x7d15('0x5a')],'dialPrefix':_0x2665e4[_0x7d15('0x5b')],'outboundAnswerAgiCallsDay':_0x2665e4['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2665e4['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2665e4[_0x7d15('0x5c')],'outboundBusyCallsDay':_0x2665e4[_0x7d15('0x5d')],'outboundCongestionCallsDay':_0x2665e4['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2665e4[_0x7d15('0x5e')],'outboundDropCallsDayCallersExit':_0x2665e4[_0x7d15('0x5f')],'outboundDropCallsDayTimeout':_0x2665e4[_0x7d15('0x60')],'outboundNoAnswerCallsDay':_0x2665e4[_0x7d15('0x61')],'outboundNoSuchCallsDay':_0x2665e4[_0x7d15('0x62')],'outboundOriginateFailureCallsDay':_0x2665e4[_0x7d15('0x63')],'outboundReCallsDay':_0x2665e4[_0x7d15('0x64')],'outboundRejectCallsDay':_0x2665e4[_0x7d15('0x65')],'outboundUnknownCallsDay':_0x2665e4[_0x7d15('0x66')],'predictiveIntervalAnsweredCalls':_0x2665e4['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x2665e4[_0x7d15('0x67')],'predictiveIntervalAvgTalktime':_0x2665e4[_0x7d15('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x2665e4[_0x7d15('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x2665e4[_0x7d15('0x6a')],'predictiveIntervalErlangCalls':_0x2665e4[_0x7d15('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x2665e4[_0x7d15('0x6c')],'predictiveIntervalHitRate':_0x2665e4[_0x7d15('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x2665e4[_0x7d15('0x6e')],'predictiveIntervalPauses':_0x2665e4[_0x7d15('0x6f')],'predictiveIntervalAvailable':_0x2665e4[_0x7d15('0x70')],'predictiveIntervalTotalCalls':_0x2665e4[_0x7d15('0x71')],'message':_0x2665e4[_0x7d15('0x3d')],'originated':_0x2665e4[_0x7d15('0x72')],'erlangCalls':_0x2665e4[_0x7d15('0x73')],'erlangCallToSecond':_0x2665e4['erlangCallToSecond'],'erlangAbandonmentRate':_0x2665e4[_0x7d15('0x74')],'erlangBusyFactor':_0x2665e4[_0x7d15('0x75')],'startPredictive':_0x2665e4[_0x7d15('0x76')],'startProgressive':_0x2665e4[_0x7d15('0x23')]};if(_0x2665e4[_0x7d15('0x77')]){_0xe13bbd[_0x7d15('0x77')]={'id':_0x2665e4['Trunk']['id'],'name':_0x2665e4[_0x7d15('0x77')]['name'],'active':_0x2665e4[_0x7d15('0x77')]['active'],'callerid':_0x2665e4[_0x7d15('0x77')][_0x7d15('0x78')]};}if(_0x2665e4[_0x7d15('0x3f')]){_0xe13bbd[_0x7d15('0x3f')]={'id':_0x2665e4[_0x7d15('0x3f')]['id'],'name':_0x2665e4[_0x7d15('0x3f')]['name']};}var _0x5454a0=md5(JSON[_0x7d15('0x45')](_0xe13bbd));if(_0x2665e4[_0x7d15('0x79')]!==_0x5454a0){_0x2665e4[_0x7d15('0x79')]=_0x5454a0;emit(util[_0x7d15('0x7a')](_0x7d15('0x7b'),_0xe13bbd[_0x7d15('0x3c')]),_0x7d15('0x7c'),_0xe13bbd);}}}function emitCampaignSummary(_0x2355e8){if(_0x2355e8[_0x7d15('0x49')]==='ivr'){emit(util[_0x7d15('0x7a')]('campaign:ivr:%s',_0x2355e8[_0x7d15('0x3c')]),_0x7d15('0x7d'),_0x2355e8);}}function checkGetDataPredictive(_0x5ad316){if(isNotNull(_0x5ad316)&&!_[_0x7d15('0x7e')](_0x5ad316)){loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x80'));loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x81'),_0x5ad316[_0x7d15('0x71')]);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x82'),_0x5ad316[_0x7d15('0x83')]);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x84'),_0x5ad316[_0x7d15('0x6a')]);loggerPredictive[_0x7d15('0x7f')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ad316[_0x7d15('0x69')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ad316[_0x7d15('0x67')]);loggerPredictive[_0x7d15('0x7f')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ad316[_0x7d15('0x68')]);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x85'));if(_0x5ad316[_0x7d15('0x71')]>0x0){if(!_[_0x7d15('0x86')](_0x5ad316[_0x7d15('0x68')])&&_0x5ad316[_0x7d15('0x68')]>0x0){return!![];}loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x87'));if(!_[_0x7d15('0x86')](_0x5ad316[_0x7d15('0x67')])&&_0x5ad316['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x7d15('0x88'));}}else{loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x89'));}return![];}function mergeDataErlangB(_0x271d16){return function(_0x2d82a7){loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x8a'));loggerPredictive[_0x7d15('0x7f')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d82a7[_0x7d15('0x73')]);loggerPredictive[_0x7d15('0x7f')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d82a7[_0x7d15('0x8b')]);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x8c'),_0x2d82a7['erlangAbandonmentRate']);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x8d'),_0x2d82a7['erlangBusyFactor']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d82a7[_0x7d15('0x74')]);loggerPredictive[_0x7d15('0x7f')]('---------------------------');_[_0x7d15('0x8e')](_0x271d16,_0x2d82a7);};}function getDiff(_0x182277){var _0x114934=moment()['milliseconds'](0x0);var _0x467126=moment(_0x182277)[_0x7d15('0x46')](0x0);return _0x114934[_0x7d15('0x47')](_0x467126,_0x7d15('0x48'));}function ifInterval(_0x2e67aa,_0x4fd998){if(_[_0x7d15('0x86')](_0x4fd998)){return![];}return getDiff(_0x4fd998)<_0x2e67aa*0x3c;}function freeVariablesPredictive(_0x47b328){if(isNotNull(_0x47b328)){if(!_['isUndefined'](_0x47b328[_0x7d15('0x23')])){_0x47b328[_0x7d15('0x23')]=undefined;loggerPredictive['info'](_0x47b328[_0x7d15('0x3c')],_0x7d15('0x8f'));}if(!_['isUndefined'](_0x47b328[_0x7d15('0x76')])){_0x47b328['startPredictive']=undefined;loggerPredictive[_0x7d15('0x7f')](_0x47b328[_0x7d15('0x3c')],_0x7d15('0x90'));}if(!_[_0x7d15('0x86')](_0x47b328[_0x7d15('0x91')])){clearInterval(_0x47b328[_0x7d15('0x91')]);_0x47b328[_0x7d15('0x91')]=undefined;loggerPredictive['info'](_0x47b328[_0x7d15('0x3c')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0xa861c3,_0x1d8b41){if(_0x1d8b41===0x0){return 0x0;}var _0x14d6b0=0x1;for(var _0x4f9fb7=0x1;_0x4f9fb7<=_0x1d8b41;_0x4f9fb7+=0x1){_0x14d6b0=0x1+_0x14d6b0*_0x4f9fb7/_0xa861c3;}return 0x1/_0x14d6b0;}function isVoiceQueueOutbound(_0x4ce5a6){return _0x4ce5a6==='outbound';}function isNotPreview(_0x11d1e2){return _0x11d1e2!=='preview';}function isCampaignIvr(_0x5bfe9c){return _0x5bfe9c===_0x7d15('0x92');}function getCallerId(_0x1493ba,_0x581630,_0x264dd1){if(!_['isUndefined'](_0x264dd1)&&typeof _0x264dd1===_0x7d15('0x93')&&!_[_0x7d15('0x7e')](_0x264dd1)){if(!_[_0x7d15('0x86')](_0x581630)&&typeof _0x581630===_0x7d15('0x93')&&!_[_0x7d15('0x7e')](_0x581630)){return util[_0x7d15('0x7a')](_0x7d15('0x94'),_0x581630,_0x264dd1);}return util['format'](_0x7d15('0x94'),_0x264dd1,_0x264dd1);}if(!_[_0x7d15('0x86')](_0x1493ba)&&typeof _0x1493ba===_0x7d15('0x93')&&!_[_0x7d15('0x7e')](_0x1493ba)){return _0x1493ba;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x23cf2d,_0x3348de){return function(_0xb4ce1f){freeVariablesPredictive(_0x3348de);emitVoiceQueueSummary(_0x3348de);emitCampaignSummary(_0x3348de);loggerSyncQueueSummary['error'](_0x23cf2d,util[_0x7d15('0x95')](_0xb4ce1f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5bed1b,_0xc35db6){return function(_0x308bbc){loggerPredictive[_0x7d15('0x96')](_0xc35db6['name'],_0x5bed1b);loggerPredictive[_0x7d15('0x96')](_0x308bbc[_0x7d15('0x97')]);freeVariablesPredictive(_0xc35db6);};}function loggerCatch(_0x2afeac){return function(_0x229c1c){logger[_0x7d15('0x96')](_0x2afeac,util[_0x7d15('0x95')](_0x229c1c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xa73b47){return _0xa73b47&&!_['isUndefined'](_0xa73b47)&&_0xa73b47[_0x7d15('0x98')]>0x0;}function decremetOriginate(_0x3ee29c){if(!_['isUndefined'](_0x3ee29c)&&_0x3ee29c!==null){if(typeof _0x3ee29c['originated']!==_0x7d15('0x99')){if(_0x3ee29c[_0x7d15('0x72')]>0x0){_0x3ee29c['originated']-=0x1;}else{logger[_0x7d15('0x96')](_0x7d15('0x9a'));}}}else{logger[_0x7d15('0x96')](_0x7d15('0x9b'));}}function checkContactLowerLimitOriginate(_0x114698,_0xde2701,_0xe8b650){if(_0xde2701>_0xe8b650){for(var _0x2e8fd9=0x0;_0x2e8fd9<_0xde2701-_0xe8b650;_0x2e8fd9+=0x1){decremetOriginate(_0x114698);}}}function loggerGetContactDialer(_0x10474f,_0x538fdb,_0x2b4788){return function(_0x25108c){checkContactLowerLimitOriginate(_0x538fdb,_0x2b4788,0x0);logger[_0x7d15('0x96')](_0x10474f,util['inspect'](_0x25108c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3feddc){return function(_0x22f0a3){if(isNotNull(_0x22f0a3)&&isNotNull(_0x22f0a3[0x0])){if(_0x22f0a3[0x0][_0x7d15('0x9c')]>0x0){_0x3feddc[_0x7d15('0x3d')]='RESCHEDULED_CONTACTS';logger[_0x7d15('0x7f')](_0x7d15('0x9d')+_0x3feddc[_0x7d15('0x3c')],_0x22f0a3[0x0][_0x7d15('0x9c')],'contacts');}else{_0x3feddc[_0x7d15('0x3d')]=_0x7d15('0x9e');logger[_0x7d15('0x7f')](_0x7d15('0x9f')+_0x3feddc[_0x7d15('0x3c')]);}}};}function notSendMessagesQueue(_0x337b2a){if(_0x337b2a[_0x7d15('0xa0')]){freeVariablesPredictive(_0x337b2a);if(_0x337b2a[_0x7d15('0x72')]===0x0&&_0x337b2a[_0x7d15('0x51')]===0x0&&_0x337b2a['waiting']===0x0&&(_0x337b2a[_0x7d15('0x4e')]||0x0)===0x0){_0x337b2a[_0x7d15('0xa0')]=![];_0x337b2a[_0x7d15('0x4c')]=0x0;_0x337b2a[_0x7d15('0x3d')]=_0x7d15('0x3e');loggerSyncQueueSummary[_0x7d15('0x96')](_0x7d15('0xa1'),_0x337b2a[_0x7d15('0x3c')],_0x7d15('0xa2'));}else{_0x337b2a[_0x7d15('0x3d')]=_0x7d15('0xa3');loggerSyncQueueSummary[_0x7d15('0x96')](_0x7d15('0xa1'),_0x337b2a['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x337b2a);}}function notSendMessagesCampaign(_0x1b0451){if(_0x1b0451['sendMessageOneNotActive']){if(_0x1b0451[_0x7d15('0x72')]===0x0){_0x1b0451['sendMessageOneNotActive']=![];_0x1b0451[_0x7d15('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x7d15('0x96')](_0x7d15('0xa4'),_0x1b0451[_0x7d15('0x3c')],'is\x20not\x20active');}else{_0x1b0451[_0x7d15('0x3d')]=_0x7d15('0xa3');loggerSyncQueueSummary[_0x7d15('0x96')](_0x7d15('0xa4'),_0x1b0451[_0x7d15('0x3c')],_0x7d15('0xa5'));}emitCampaignSummary(_0x1b0451);}}function createObjHistory(_0x4e6511,_0x17feba,_0x7258b4,_0x4e7741,_0x453567){_0x4e6511[_0x7d15('0x3d')]=_0x7258b4;var _0x3e9bcc=new Action(_0x4e6511,_0x17feba);var _0x6a323a=new History(_0x3e9bcc);_0x6a323a['state']=_0x4e7741;_0x6a323a[_0x7d15('0xa6')]=_0x453567;_0x6a323a['endtime']=_0x3e9bcc[_0x7d15('0xa7')];return _0x6a323a;}Dialer[_0x7d15('0x15')][_0x7d15('0x38')]=function(){var _0x2a2a79=this;setInterval(function(){_0x2a2a79[_0x7d15('0xa8')](_0x2a2a79[_0x7d15('0x21')],_0x7d15('0xa9'));_0x2a2a79[_0x7d15('0xa8')](_0x2a2a79['actions'],_0x7d15('0xaa'));},0x32c8);};Dialer[_0x7d15('0x15')]['clearZombieChannels']=function(_0x201820,_0x557dc7){var _0x5f331d=this;for(var _0x3077d9 in _0x201820){if(typeof _0x201820[_0x3077d9]!==_0x7d15('0x99')){this[_0x7d15('0x19')][_0x7d15('0x16')](function(){if(!_[_0x7d15('0xab')](_0x201820[_0x3077d9])){return ami[_0x7d15('0xac')]({'action':_0x7d15('0xad'),'channel':_0x201820[_0x3077d9][_0x7d15('0xae')]})['catch'](function(_0x437976){if(_0x437976[_0x7d15('0x3d')]===_0x7d15('0xaf')){setTimeout(function(){if(_0x201820[_0x3077d9]&&_0x201820[_0x3077d9][_0x7d15('0x49')]!==_0x7d15('0x92')){_0x5f331d['updateOriginated'](_0x5f331d[_0x7d15('0xb0')][_0x201820[_0x3077d9][_0x7d15('0xb1')]]);logger[_0x7d15('0x96')](_0x7d15('0xb2'),_0x557dc7,_0x3077d9,_0x201820[_0x3077d9][_0x7d15('0xb1')]);delete _0x201820[_0x3077d9];}if(_0x201820[_0x3077d9]&&_0x201820[_0x3077d9][_0x7d15('0x49')]===_0x7d15('0x92')){_0x5f331d[_0x7d15('0xb3')](_0x5f331d['campaigns'][_0x201820[_0x3077d9][_0x7d15('0xb1')]]);logger[_0x7d15('0x96')](_0x7d15('0xb4'),_0x557dc7,_0x3077d9,_0x201820[_0x3077d9][_0x7d15('0xb1')]);delete _0x201820[_0x3077d9];}},0x2328);}});}});}}};Dialer[_0x7d15('0x15')]['countReScheduled']=function(_0x1541b9){return BPromise['resolve']()[_0x7d15('0x3a')](cmHopper['countReScheduled'](_0x1541b9))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xb6')));};Dialer[_0x7d15('0x15')][_0x7d15('0xb7')]=function(_0x4b8adc){return BPromise['resolve']()[_0x7d15('0x3a')](cmHopperBlack[_0x7d15('0xb7')](_0x4b8adc))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xb8')));};Dialer[_0x7d15('0x15')][_0x7d15('0xb9')]=function(_0x3a3da1,_0x4fa4ad,_0xf33873){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](cmHopperAdditionalPhone[_0x7d15('0xb9')](_0x3a3da1,_0x4fa4ad,_0xf33873))['catch'](loggerCatch(_0x7d15('0xbb')));};Dialer[_0x7d15('0x15')]['swapAdditionalPhones']=function(_0x57f3b6,_0x5263ca,_0x94538e){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](cmHopperAdditionalPhone[_0x7d15('0xbc')](_0x57f3b6,_0x5263ca,_0x94538e))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xbd')));};Dialer[_0x7d15('0x15')]['checkIsBlackListIvr']=function(_0x54c6b0){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](cmHopperBlack[_0x7d15('0xbe')](_0x54c6b0))['catch'](loggerCatch(_0x7d15('0xbf')));};Dialer[_0x7d15('0x15')][_0x7d15('0xc0')]=function(_0x40ad43){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](cmHopperHistory[_0x7d15('0xc1')](_0x40ad43))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xc2')));};Dialer[_0x7d15('0x15')]['rescheduleContact']=function(_0x103f7e){return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x103f7e))[_0x7d15('0xb5')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x7d15('0x15')][_0x7d15('0xc3')]=function(_0x18d593,_0x17e050,_0x4a4bfd){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](cmHopper[_0x7d15('0xc3')](_0x18d593,_0x17e050,_0x4a4bfd))[_0x7d15('0xb5')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x7d15('0x15')][_0x7d15('0xc4')]=function(_0x14683b,_0x5aee28,_0x403155,_0x525448,_0x346bd5){return BPromise['resolve']()['then'](cmHopper['getContactDialer'](_0x14683b,_0x5aee28,_0x403155,_0x525448))[_0x7d15('0xb5')](function(_0x17155d){_0x346bd5['temp']-=_0x403155;_0x346bd5['temp']=_0x346bd5['temp']>0x0?_0x346bd5[_0x7d15('0xc5')]:0x0;loggerCatch(_0x7d15('0xc6'))(_0x17155d);});};Dialer[_0x7d15('0x15')][_0x7d15('0xc7')]=function(_0x36d424,_0x48e787,_0x159097,_0x1eadcb){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](cmHopper[_0x7d15('0xc7')](_0x36d424,_0x48e787,_0x159097))[_0x7d15('0xb5')](function(_0x2c5110){_0x1eadcb['temp']-=_0x48e787;_0x1eadcb[_0x7d15('0xc5')]=_0x1eadcb[_0x7d15('0xc5')]>0x0?_0x1eadcb[_0x7d15('0xc5')]:0x0;loggerCatch(_0x7d15('0xc8'))(_0x2c5110);});};Dialer[_0x7d15('0x15')][_0x7d15('0xc9')]=function(_0x5164c9){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](voiceQueueRt[_0x7d15('0xc9')](_0x5164c9))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xca')));};Dialer[_0x7d15('0x15')][_0x7d15('0xcb')]=function(_0x4e7847){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](cmHopper[_0x7d15('0xcb')](_0x4e7847))['catch'](loggerCatch(_0x7d15('0xcc')));};Dialer['prototype'][_0x7d15('0xcd')]=function(_0x52622f){return BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](cmHopperHistory[_0x7d15('0xcd')](_0x52622f))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xce')));};Dialer['prototype']['updateOriginated']=function(_0x4c185b){if(!_[_0x7d15('0x86')](_0x4c185b)&&_0x4c185b!==null){if(typeof _0x4c185b['originated']!=='undefined'){if(_0x4c185b[_0x7d15('0x72')]>0x0){_0x4c185b[_0x7d15('0x72')]-=0x1;}else{logger['error'](_0x7d15('0xcf'));}}}else{logger[_0x7d15('0x96')](_0x7d15('0xd0'));}};Dialer[_0x7d15('0x15')][_0x7d15('0xd1')]=function(_0x14f02a,_0x2c880b){var _0x3d715e=this;return function(_0x1128e8){_0x3d715e[_0x7d15('0xb3')](_0x2c880b);logger[_0x7d15('0x96')](_0x14f02a,util[_0x7d15('0x95')](_0x1128e8,{'showHidden':![],'depth':null}));};};Dialer[_0x7d15('0x15')][_0x7d15('0xd2')]=function(_0x80b31f,_0x2c5af2,_0x2dd116){var _0x10245e={'state':0x19,'statedesc':'notFound'};this[_0x7d15('0xb3')](_0x2c5af2);this[_0x7d15('0xd3')](_[_0x7d15('0x8e')](_0x10245e,_[_0x7d15('0xd4')](_0x2dd116,['ContactId','ListId',_0x7d15('0xd5'),_0x7d15('0xd6'),_0x7d15('0xd7')])),_0x7d15('0xd8'),_0x7d15('0xd9'));logger['error'](_0x80b31f);};Dialer[_0x7d15('0x15')][_0x7d15('0xda')]=function(_0x1e4023){return _0x1e4023===_0x7d15('0xdb');};Dialer['prototype'][_0x7d15('0xdc')]=function(_0x49f14e){return!_[_0x7d15('0x86')](_0x49f14e)&&_0x49f14e&&!_[_0x7d15('0x86')](_0x49f14e['name'])&&!_[_0x7d15('0x86')](_0x49f14e[_0x7d15('0xdd')])&&_0x49f14e[_0x7d15('0xdd')]&&(this[_0x7d15('0x1d')][util[_0x7d15('0x7a')](_0x7d15('0xde'),_0x49f14e[_0x7d15('0x3c')])]['status']===_0x7d15('0xdf')||this[_0x7d15('0x1d')][util[_0x7d15('0x7a')](_0x7d15('0xde'),_0x49f14e[_0x7d15('0x3c')])]['status']===_0x7d15('0xe0'));};Dialer['prototype']['saveInDb']=function(_0x3801ac,_0xec588c,_0x2349f1){this[_0x7d15('0xcd')](_0x3801ac)[_0x7d15('0xb5')](loggerCatch(_0xec588c));this['moveContactManagedDialer'](_0x3801ac)[_0x7d15('0xb5')](loggerCatch(_0x2349f1));};Dialer[_0x7d15('0x15')][_0x7d15('0x33')]=function(_0x1544e4){var _0x474c5e=this[_0x7d15('0x21')][_0x1544e4['uniqueid']];var _0x3bd4d4;if(!_[_0x7d15('0xab')](_0x1544e4)&&!_[_0x7d15('0xab')](_0x1544e4['variable'])&&!_['isNil'](_0x1544e4['variable'][_0x7d15('0xe1')])&&_0x1544e4[_0x7d15('0xe2')]==='xcally-motion-dialer'&&_0x474c5e){if(_0x474c5e[_0x7d15('0x49')]!==_0x7d15('0x92')&&this[_0x7d15('0xb0')][_0x474c5e[_0x7d15('0xb1')]][_0x7d15('0xe3')]&&_0x1544e4[_0x7d15('0xe4')]===_0x7d15('0xe5')){delete this[_0x7d15('0x21')][_0x1544e4['uniqueid']];this['updateOriginated'](this[_0x7d15('0xb0')][_0x474c5e[_0x7d15('0xb1')]]);this[_0x7d15('0xb0')][_0x474c5e[_0x7d15('0xb1')]][_0x7d15('0xe6')]+=0x1;this[_0x7d15('0xb0')][_0x474c5e[_0x7d15('0xb1')]][_0x7d15('0xe7')]+=0x1;_0x3bd4d4=new Hangup(_0x474c5e,_0x1544e4);_0x3bd4d4[_0x7d15('0xe8')]=0x12;_0x3bd4d4[_0x7d15('0xa6')]=_0x7d15('0xe9');_0x3bd4d4['membername']=_0x7d15('0xea');ami[_0x7d15('0xeb')]('custom:amd',ut['buildObj'](_0x3bd4d4,_0x7d15('0xec')));this[_0x7d15('0xd3')](_0x3bd4d4,_0x7d15('0xed'),_0x7d15('0xee'));}if(_0x474c5e['type']!==_0x7d15('0x92')&&this[_0x7d15('0xb0')][_0x474c5e[_0x7d15('0xb1')]]['dialAMDActive']&&_0x1544e4[_0x7d15('0xe4')]===_0x7d15('0xef')){var _0x455c59=this;return new BPromise(function(_0x2101e9,_0x4103d1){delete _0x455c59[_0x7d15('0x21')][_0x1544e4[_0x7d15('0xf0')]];_0x455c59[_0x7d15('0xb3')](_0x455c59['voiceQueues'][_0x474c5e[_0x7d15('0xb1')]]);_0x455c59['voiceQueues'][_0x474c5e[_0x7d15('0xb1')]]['outboundAnswerCallsDay']+=0x1;_0x455c59[_0x7d15('0xb0')][_0x474c5e[_0x7d15('0xb1')]][_0x7d15('0xe7')]+=0x1;var _0x50e309=_0x455c59['voiceQueues'][_0x474c5e[_0x7d15('0xb1')]];var _0x534c49=new Hangup(_0x474c5e,_0x1544e4);_0x534c49['state']=0x13;_0x534c49[_0x7d15('0xa6')]=_0x7d15('0xf1');_0x534c49[_0x7d15('0xf2')]=_0x7d15('0xea');_0x534c49[_0x7d15('0xf3')]+=0x1;_0x534c49[_0x7d15('0xf4')]+=0x1;_0x534c49[_0x7d15('0xec')]=!![];ami[_0x7d15('0xeb')](_0x7d15('0xf5'),ut[_0x7d15('0xf6')](_0x534c49,_0x7d15('0xec')));_0x455c59['createHistory'](_0x534c49)['catch'](loggerCatch(_0x7d15('0xf7')));if(_0x534c49[_0x7d15('0xf8')]+_0x534c49[_0x7d15('0xf9')]+_0x534c49[_0x7d15('0xfa')]+_0x534c49[_0x7d15('0xfb')]+_0x534c49[_0x7d15('0xfc')]+_0x534c49['countabandonedretry']+_0x534c49['countmachineretry']+_0x534c49[_0x7d15('0xfd')]>=_0x50e309[_0x7d15('0xfe')]){_0x455c59[_0x7d15('0xff')](_0x534c49,_0x2101e9,_0x4103d1,_0x7d15('0x100'));}else{if(_0x534c49[_0x7d15('0xf3')]>=_0x50e309[_0x7d15('0x101')]){_0x455c59[_0x7d15('0x102')](_0x534c49,_0x2101e9,_0x4103d1,_0x7d15('0x103'));}else{_0x455c59[_0x7d15('0x104')]({'active':![],'countmachineretry':_0x534c49[_0x7d15('0xf3')],'scheduledat':moment()[_0x7d15('0x105')](_0x50e309['dialMachineRetryFrequency'],_0x7d15('0x106'))[_0x7d15('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x534c49['ContactId'],'ListId':_0x534c49[_0x7d15('0x107')],'VoiceQueueId':_0x534c49[_0x7d15('0xd6')]||undefined,'CampaignId':_0x534c49['CampaignId']||undefined})[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x108')));_0x2101e9({'reschedule':0x1});}}});}if(_0x474c5e[_0x7d15('0x49')]===_0x7d15('0x92')&&this[_0x7d15('0x1b')][_0x474c5e['queue']][_0x7d15('0xe3')]&&_0x1544e4[_0x7d15('0xe4')]==='HANGUP'){delete this[_0x7d15('0x21')][_0x1544e4[_0x7d15('0xf0')]];this[_0x7d15('0xb3')](this['campaigns'][_0x474c5e[_0x7d15('0xb1')]]);_0x3bd4d4=new Hangup(_0x474c5e,_0x1544e4);_0x3bd4d4[_0x7d15('0xe8')]=0x12;_0x3bd4d4[_0x7d15('0xa6')]='HangupInAMD';_0x3bd4d4['membername']='AMD';ami[_0x7d15('0xeb')](_0x7d15('0xf5'),ut[_0x7d15('0xf6')](_0x3bd4d4,'amd'));this[_0x7d15('0xd3')](_0x3bd4d4,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x474c5e[_0x7d15('0x49')]===_0x7d15('0x92')&&this[_0x7d15('0x1b')][_0x474c5e[_0x7d15('0xb1')]][_0x7d15('0xe3')]&&_0x1544e4[_0x7d15('0xe4')]===_0x7d15('0xef')){var _0x455c59=this;return new BPromise(function(_0x39dfee,_0x54b548){delete _0x455c59[_0x7d15('0x21')][_0x1544e4[_0x7d15('0xf0')]];_0x455c59[_0x7d15('0xb3')](_0x455c59[_0x7d15('0x1b')][_0x474c5e[_0x7d15('0xb1')]]);_0x455c59[_0x7d15('0x1b')][_0x474c5e[_0x7d15('0xb1')]][_0x7d15('0xe6')]+=0x1;_0x455c59[_0x7d15('0x1b')][_0x474c5e[_0x7d15('0xb1')]][_0x7d15('0xe7')]+=0x1;var _0x4eaa90=_0x455c59['campaigns'][_0x474c5e[_0x7d15('0xb1')]];var _0x45dfff=new Hangup(_0x474c5e,_0x1544e4);_0x45dfff['state']=0x13;_0x45dfff['statedesc']=_0x7d15('0xf1');_0x45dfff[_0x7d15('0xf2')]=_0x7d15('0xea');_0x45dfff[_0x7d15('0xf3')]+=0x1;_0x45dfff[_0x7d15('0xf4')]+=0x1;_0x45dfff[_0x7d15('0xec')]=!![];ami[_0x7d15('0xeb')](_0x7d15('0xf5'),ut[_0x7d15('0xf6')](_0x45dfff,_0x7d15('0xec')));_0x455c59[_0x7d15('0xcd')](_0x45dfff)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xf7')));if(_0x45dfff[_0x7d15('0xf8')]+_0x45dfff[_0x7d15('0xf9')]+_0x45dfff[_0x7d15('0xfa')]+_0x45dfff[_0x7d15('0xfb')]+_0x45dfff[_0x7d15('0xfc')]+_0x45dfff['countabandonedretry']+_0x45dfff[_0x7d15('0xf3')]+_0x45dfff['countagentrejectretry']>=_0x4eaa90[_0x7d15('0xfe')]){_0x455c59[_0x7d15('0xff')](_0x45dfff,_0x39dfee,_0x54b548,_0x7d15('0x100'));}else{if(_0x45dfff[_0x7d15('0xf3')]>=_0x4eaa90[_0x7d15('0x101')]){_0x455c59[_0x7d15('0x102')](_0x45dfff,_0x39dfee,_0x54b548,_0x7d15('0x103'));}else{_0x455c59['rescheduleContact']({'active':![],'countmachineretry':_0x45dfff[_0x7d15('0xf3')],'scheduledat':moment()[_0x7d15('0x105')](_0x4eaa90[_0x7d15('0x109')],_0x7d15('0x106'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45dfff[_0x7d15('0x10a')],'ListId':_0x45dfff[_0x7d15('0x107')],'VoiceQueueId':_0x45dfff[_0x7d15('0xd6')]||undefined,'CampaignId':_0x45dfff[_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x108')));_0x39dfee({'reschedule':0x1});}}});}}};Dialer[_0x7d15('0x15')]['syncHangup']=function(_0xf67558){var _0x29e49c=this[_0x7d15('0x21')][_0xf67558[_0x7d15('0xf0')]];var _0x577ec2=this;var _0x387e9c;if(_0x29e49c&&_0x29e49c[_0x7d15('0x49')]==='ivr'){delete this[_0x7d15('0x21')][_0xf67558[_0x7d15('0xf0')]];this[_0x7d15('0xb3')](this[_0x7d15('0x1b')][_0x29e49c[_0x7d15('0xb1')]]);this['campaigns'][_0x29e49c[_0x7d15('0xb1')]]['ivrAnswerCallsDay']+=0x1;_0x387e9c=new Hangup(_0x29e49c,_0xf67558);this[_0x7d15('0xcd')](_0x387e9c)[_0x7d15('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x387e9c)['catch'](loggerCatch(_0x7d15('0x10b')));}if(_0x29e49c&&_0x29e49c['type']!=='ivr'&&isNotNull(this[_0x7d15('0xb0')][_0x29e49c[_0x7d15('0xb1')]]['dialQueueProject'])){delete this[_0x7d15('0x21')][_0xf67558['uniqueid']];this['updateOriginated'](this[_0x7d15('0xb0')][_0x29e49c[_0x7d15('0xb1')]]);this[_0x7d15('0xb0')][_0x29e49c['queue']][_0x7d15('0xe6')]+=0x1;this['voiceQueues'][_0x29e49c[_0x7d15('0xb1')]][_0x7d15('0xe7')]+=0x1;_0x387e9c=new Hangup(_0x29e49c,_0xf67558);_0x387e9c[_0x7d15('0xe8')]=0x10;_0x387e9c['statedesc']='AnswerAGI';_0x387e9c[_0x7d15('0xf2')]=_0x7d15('0x10c');this[_0x7d15('0xcd')](_0x387e9c)['catch'](loggerCatch(_0x7d15('0x10d')));this['moveContactManagedDialer'](_0x387e9c)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x10b')));}if(_0x29e49c&&_0x29e49c[_0x7d15('0x49')]!==_0x7d15('0x92')&&!isNotNull(this[_0x7d15('0xb0')][_0x29e49c[_0x7d15('0xb1')]]['dialQueueProject'])){delete this[_0x7d15('0x21')][_0xf67558[_0x7d15('0xf0')]];this[_0x7d15('0xb3')](this[_0x7d15('0xb0')][_0x29e49c[_0x7d15('0xb1')]]);this['voiceQueues'][_0x29e49c[_0x7d15('0xb1')]][_0x7d15('0x66')]+=0x1;_0x387e9c=new Hangup(_0x29e49c,_0xf67558);_0x387e9c[_0x7d15('0xe8')]=0xc;_0x387e9c[_0x7d15('0xa6')]=_0xf67558[_0x7d15('0x10e')];_0x387e9c[_0x7d15('0xf2')]=_0x7d15('0x10f');this['createHistory'](_0x387e9c)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x10d')));this[_0x7d15('0xcb')](_0x387e9c)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x10b')));}};Dialer['prototype'][_0x7d15('0x2d')]=function(_0x1dc40f){var _0x1b0aef=this['uniqueId'][_0x1dc40f[_0x7d15('0xf0')]];var _0x25d482=this;if(this[_0x7d15('0xb0')][_0x1dc40f[_0x7d15('0xb1')]]){if(_0x1b0aef&&_0x1b0aef[_0x7d15('0x49')]!==_0x7d15('0x92')){delete this[_0x7d15('0x21')][_0x1dc40f[_0x7d15('0xf0')]];this['voiceQueues'][_0x1dc40f[_0x7d15('0xb1')]][_0x7d15('0xe6')]+=0x1;var _0x5be971=new AgentComplete(_0x1b0aef,_0x1dc40f);if(_0x1dc40f['reason']==='agent'){_0x5be971['agiafterat']=this['voiceQueues'][_0x1dc40f[_0x7d15('0xb1')]]['dialQueueProject2']&&this[_0x7d15('0xb0')][_0x1dc40f[_0x7d15('0xb1')]][_0x7d15('0x110')]?moment()['format'](_0x7d15('0x111')):undefined;}this['createHistory'](_0x5be971)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x112')));this['moveContactManagedDialer'](_0x5be971)[_0x7d15('0xb5')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x7d15('0x15')][_0x7d15('0x113')]=function(_0x2c3342){if(this[_0x7d15('0xb0')][_0x2c3342[_0x7d15('0xb1')]]){if(this[_0x7d15('0x21')][_0x2c3342[_0x7d15('0xf0')]]&&this['uniqueId'][_0x2c3342['uniqueid']][_0x7d15('0x49')]!==_0x7d15('0x92')){this[_0x7d15('0xb3')](this[_0x7d15('0xb0')][_0x2c3342[_0x7d15('0xb1')]]);this[_0x7d15('0x21')][_0x2c3342['uniqueid']][_0x7d15('0x114')]=moment()[_0x7d15('0x7a')](_0x7d15('0x111'));}}};Dialer[_0x7d15('0x15')][_0x7d15('0x115')]=function(_0x4e70b3,_0x4f4f6b){this[_0x7d15('0xcd')](_0x4e70b3)['catch'](loggerCatch(_0x7d15('0x112')));if(_0x4f4f6b==0x0){this['moveContactManagedDialer'](_0x4e70b3)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x116')));}};Dialer['prototype'][_0x7d15('0x117')]=function(_0x3801e6){var _0x15290e=this[_0x7d15('0x21')][_0x3801e6[_0x7d15('0xf0')]];var _0xd11446=this;var _0x5c7e7e=![];var _0x5eb532;var _0xe8e5a;if(this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]]){if(_0x15290e&&_0x15290e[_0x7d15('0x49')]!=='ivr'){delete this[_0x7d15('0x21')][_0x3801e6[_0x7d15('0xf0')]];this[_0x7d15('0xb3')](this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]]);_0x15290e[_0x7d15('0x118')]=moment()[_0x7d15('0x7a')](_0x7d15('0x111'));var _0x39486c=new QueueCallerAbandon(_0x15290e,_0x3801e6);if(getSeconds(_0x15290e[_0x7d15('0x118')],_0x15290e[_0x7d15('0x119')])>=_0x15290e[_0x7d15('0x11a')]){this['voiceQueues'][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x6a')]+=0x1;this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x60')]+=0x1;this[_0x7d15('0xb0')][_0x3801e6['queue']][_0x7d15('0x6c')]+=0x1;_0x39486c[_0x7d15('0xe8')]=0xa;_0x39486c[_0x7d15('0xa6')]=_0x7d15('0x11b');_0x39486c[_0x7d15('0x11c')]=_0x7d15('0x11d');_0x39486c[_0x7d15('0x11e')]=this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x11f')]?moment()[_0x7d15('0x7a')](_0x7d15('0x111')):undefined;_0x39486c[_0x7d15('0xfc')]+=0x1;_0x39486c['countglobal']+=0x1;_0x5eb532=this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x120')];_0xe8e5a=this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x121')];_0xd11446['verifyAdditionalPhones'](_0x39486c,_0x39486c['state'],_0x15290e[_0x7d15('0x122')])[_0x7d15('0x3a')](function(_0x589f07){_0x5c7e7e=_0x589f07['additional']==0x1;if(_0x39486c[_0x7d15('0xfc')]>=_0xd11446[_0x7d15('0xb0')][_0x3801e6['queue']][_0x7d15('0x123')]){_0xd11446[_0x7d15('0x115')](_0x39486c,_0x589f07['additional']);}else{_0xd11446['rescheduleContact']({'active':![],'countdropretry':_0x39486c['countdropretry'],'scheduledat':moment()[_0x7d15('0x105')](_0xd11446[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]]['dialDropRetryFrequency'],_0x7d15('0x106'))[_0x7d15('0x7a')](_0x7d15('0x111')),'ContactId':_0x15290e[_0x7d15('0x10a')],'ListId':_0x15290e[_0x7d15('0x107')],'VoiceQueueId':_0x15290e['VoiceQueueId']||undefined,'CampaignId':_0x15290e[_0x7d15('0xd7')]||undefined})['catch'](loggerCatch(_0x7d15('0x124')));var _0x9b42f6=new History(_0x39486c);_0x9b42f6[_0x7d15('0xe8')]=0xa;_0x9b42f6[_0x7d15('0xa6')]=_0x7d15('0x11b');_0x9b42f6[_0x7d15('0xa7')]=moment()[_0x7d15('0x7a')](_0x7d15('0x111'));_0x9b42f6['endtime']=_0x9b42f6[_0x7d15('0xa7')];_0x9b42f6[_0x7d15('0x125')]=_0x39486c[_0x7d15('0x125')];_0x9b42f6[_0x7d15('0x126')]=_0x39486c[_0x7d15('0x126')];_0xd11446['createHistory'](_0x9b42f6)[_0x7d15('0xb5')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x7d15('0x3a')](function(_0x2ffed2){if(_0x5c7e7e)_0xd11446[_0x7d15('0xbc')](_0x39486c,_0x5eb532,_0xe8e5a)[_0x7d15('0x3a')](function(_0x4b273a){return 0x1;});});}else{this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x69')]+=0x1;this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x5f')]+=0x1;_0x39486c[_0x7d15('0xe8')]=0xb;_0x39486c[_0x7d15('0xa6')]='Abandoned';_0x39486c['dropreason']=_0x7d15('0x127');_0x39486c[_0x7d15('0x128')]+=0x1;_0x39486c['countglobal']+=0x1;_0x5eb532=this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x129')];_0xe8e5a=this[_0x7d15('0xb0')][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x121')];_0xd11446[_0x7d15('0xb9')](_0x39486c,_0x39486c['state'],_0x15290e[_0x7d15('0x122')])[_0x7d15('0x3a')](function(_0x14d470){if(_0x39486c[_0x7d15('0x128')]>=_0xd11446['voiceQueues'][_0x3801e6['queue']][_0x7d15('0x12a')]){_0xd11446[_0x7d15('0x115')](_0x39486c,_0x14d470[_0x7d15('0x12b')]);}else{_0xd11446[_0x7d15('0x104')]({'active':![],'countabandonedretry':_0x39486c[_0x7d15('0x128')],'scheduledat':moment()['add'](_0xd11446['voiceQueues'][_0x3801e6[_0x7d15('0xb1')]][_0x7d15('0x129')],_0x7d15('0x106'))[_0x7d15('0x7a')](_0x7d15('0x111')),'ContactId':_0x15290e[_0x7d15('0x10a')],'ListId':_0x15290e[_0x7d15('0x107')],'VoiceQueueId':_0x15290e[_0x7d15('0xd6')]||undefined,'CampaignId':_0x15290e['CampaignId']||undefined})[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x12c')));var _0x5d2667=new History(_0x39486c);_0x5d2667['state']=0xb;_0x5d2667[_0x7d15('0xa6')]='Abandoned';_0x5d2667[_0x7d15('0xa7')]=moment()[_0x7d15('0x7a')](_0x7d15('0x111'));_0x5d2667['endtime']=_0x5d2667[_0x7d15('0xa7')];_0x5d2667[_0x7d15('0x125')]=_0x39486c[_0x7d15('0x125')];_0x5d2667[_0x7d15('0x126')]=_0x39486c[_0x7d15('0x126')];_0xd11446[_0x7d15('0xcd')](_0x5d2667)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x12d')));}})[_0x7d15('0x3a')](function(_0x16c78a){if(_0x5c7e7e)_0xd11446['swapAdditionalPhones'](_0x39486c,_0x5eb532,_0xe8e5a)[_0x7d15('0x3a')](function(_0x3b0ae9){return 0x1;});});}}}};Dialer[_0x7d15('0x15')][_0x7d15('0x12e')]=function(_0x45f8d7){if(this[_0x7d15('0x1f')][_0x45f8d7['uniqueid']]){this[_0x7d15('0x1f')][_0x45f8d7['uniqueid']][_0x7d15('0xae')]=_0x45f8d7['channel'];}if(this['uniqueId'][_0x45f8d7[_0x7d15('0xf0')]]){this['uniqueId'][_0x45f8d7[_0x7d15('0xf0')]][_0x7d15('0xae')]=_0x45f8d7[_0x7d15('0xae')];}};Dialer['prototype'][_0x7d15('0x35')]=function(_0x26e3b4){if(strategy[this[_0x7d15('0xb0')][this[_0x7d15('0x1f')][_0x26e3b4['actionid']][_0x7d15('0xb1')]]['strategy']]===_0x7d15('0x14')){if(this[_0x7d15('0x1f')][_0x26e3b4['actionid']]&&_[_0x7d15('0xab')](this['actions'][_0x26e3b4[_0x7d15('0x12f')]][_0x7d15('0x130')])&&_0x26e3b4[_0x7d15('0xad')]==='1'&&_0x26e3b4[_0x7d15('0x131')]==='0'){if(this[_0x7d15('0x1c')][_0x26e3b4[_0x7d15('0x132')]]){if(!this['agents'][_0x26e3b4['stateinterface']]['locked']){this['agents'][_0x26e3b4[_0x7d15('0x132')]][_0x7d15('0x130')]=!![];this[_0x7d15('0x1f')][_0x26e3b4[_0x7d15('0x12f')]][_0x7d15('0x130')]=!![];this[_0x7d15('0x1f')][_0x26e3b4[_0x7d15('0x12f')]][_0x7d15('0x132')]=_0x26e3b4[_0x7d15('0x132')];}}}}else if((strategy[this[_0x7d15('0xb0')][this[_0x7d15('0x1f')][_0x26e3b4[_0x7d15('0x12f')]][_0x7d15('0xb1')]]['strategy']]||_0x7d15('0x133'))==='rrmemory'){if(this['actions'][_0x26e3b4[_0x7d15('0x12f')]]){if(this['agents'][_0x26e3b4['stateinterface']]){this[_0x7d15('0x1f')][_0x26e3b4[_0x7d15('0x12f')]]['stateinterface']=_0x26e3b4[_0x7d15('0x132')];if(_[_0x7d15('0xab')](this['queueBooked'][this[_0x7d15('0x1f')][_0x26e3b4[_0x7d15('0x12f')]][_0x7d15('0xb1')]])){this[_0x7d15('0x25')][this[_0x7d15('0x1f')][_0x26e3b4[_0x7d15('0x12f')]][_0x7d15('0xb1')]]=[];}this[_0x7d15('0x25')][this[_0x7d15('0x1f')][_0x26e3b4[_0x7d15('0x12f')]][_0x7d15('0xb1')]][_0x7d15('0x134')](_['merge'](_[_0x7d15('0xd4')](this[_0x7d15('0x1f')][_0x26e3b4[_0x7d15('0x12f')]],['idHopper',_0x7d15('0x132')]),{'status':_0x26e3b4[_0x7d15('0xad')],'paused':_0x26e3b4['paused']}));}}}};function unlockQueueStatus(_0x4cf6a9,_0x1ef1da){setTimeout(function(){if(_['isUndefined'](_0x4cf6a9[_0x7d15('0x135')])){loggerBooked[_0x7d15('0x96')](_0x7d15('0x136'),_0x1ef1da);}_0x4cf6a9['queueStatusComplete']=!![];loggerBooked[_0x7d15('0x7f')]('[booked][unlockQueueStatus]',_0x1ef1da,JSON['stringify'](_[_0x7d15('0xd4')](_0x4cf6a9,[_0x7d15('0x3c'),_0x7d15('0x135')])));},0x1f3);}Dialer[_0x7d15('0x15')]['syncQueueStatusComplete']=function(_0x3e81ec){var _0x570151=this;var _0x4c4d98=_0x570151[_0x7d15('0xb0')][_0x570151[_0x7d15('0x1f')][_0x3e81ec['actionid']][_0x7d15('0xb1')]];if(strategy[this[_0x7d15('0xb0')][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]][_0x7d15('0x4b')]]===_0x7d15('0x14')){if(this['actions'][_0x3e81ec['actionid']]&&this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0x132')]){this[_0x7d15('0x1a')][_0x7d15('0x137')](this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0x138')],this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0x132')])[_0x7d15('0xb5')](function(_0x168629){logger[_0x7d15('0x96')](_0x7d15('0x139'),util['inspect'](_0x168629,{'showHidden':![],'depth':null}));})['finally'](function(){_0x570151[_0x7d15('0xb3')](_0x570151[_0x7d15('0xb0')][_0x570151[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]]['queue']]);_0x570151[_0x7d15('0x1c')][_0x570151[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0x132')]]['locked']=![];delete _0x570151[_0x7d15('0x1f')][_0x3e81ec['actionid']];unlockQueueStatus(_0x4c4d98);});}else{this[_0x7d15('0xb3')](this[_0x7d15('0xb0')][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]]);this[_0x7d15('0x104')]({'active':![],'ContactId':this['actions'][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0x10a')],'ListId':this[_0x7d15('0x1f')][_0x3e81ec['actionid']][_0x7d15('0x107')],'VoiceQueueId':this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xd6')]||undefined,'CampaignId':this[_0x7d15('0x1f')][_0x3e81ec['actionid']][_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x7d15('0x1f')][_0x3e81ec['actionid']];unlockQueueStatus(_0x4c4d98);}}else if((strategy[this[_0x7d15('0xb0')][this[_0x7d15('0x1f')][_0x3e81ec['actionid']]['queue']][_0x7d15('0x4b')]]||_0x7d15('0x133'))==='rrmemory'){var _0x374eca;if(this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]]&&!_['isEmpty'](this[_0x7d15('0x25')][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]])){if(this[_0x7d15('0x26')][_0x570151[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]]){this[_0x7d15('0x26')][_0x570151['actions'][_0x3e81ec['actionid']][_0x7d15('0xb1')]]=this[_0x7d15('0x26')][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]]?this[_0x7d15('0x26')][this['actions'][_0x3e81ec['actionid']][_0x7d15('0xb1')]]:this[_0x7d15('0x25')][this['actions'][_0x3e81ec['actionid']]['queue']]?this[_0x7d15('0x25')][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]][_0x7d15('0x13a')]||0x0:0x0;}this[_0x7d15('0x25')][this[_0x7d15('0x1f')][_0x3e81ec['actionid']][_0x7d15('0xb1')]][_0x7d15('0x13a')]=this[_0x7d15('0x26')][this[_0x7d15('0x1f')][_0x3e81ec['actionid']]['queue']];for(var _0x56175b=0x0;_0x56175b<this[_0x7d15('0x25')][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]][_0x7d15('0x98')];_0x56175b+=0x1){_0x374eca=rr(this[_0x7d15('0x25')][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]]['queue']]);this[_0x7d15('0x26')][_0x570151['actions'][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]]=this[_0x7d15('0x25')][this['actions'][_0x3e81ec['actionid']]['queue']][_0x7d15('0x13a')];if(_0x374eca[_0x7d15('0xad')]==='1'&&_0x374eca[_0x7d15('0x131')]==='0'){break;}}if(!_[_0x7d15('0xab')](_0x374eca)){this[_0x7d15('0x1c')][_0x374eca[_0x7d15('0x132')]][_0x7d15('0x13b')]=_[_0x7d15('0x86')](this[_0x7d15('0x1c')][_0x374eca['stateinterface']][_0x7d15('0x13b')])?!![]:this[_0x7d15('0x1c')][_0x374eca[_0x7d15('0x132')]][_0x7d15('0x13b')];}loggerBooked[_0x7d15('0x7f')](_0x7d15('0x13c'),_0x3e81ec['actionid'],_0x7d15('0x13d'),JSON[_0x7d15('0x45')](_[_0x7d15('0xd4')](this[_0x7d15('0x1c')][_0x374eca[_0x7d15('0x132')]],[_0x7d15('0x3c'),_0x7d15('0x13b')])),_0x7d15('0x13e'),JSON[_0x7d15('0x45')](_0x374eca[_0x7d15('0x138')]));if(!_[_0x7d15('0xab')](_0x374eca)&&_0x374eca[_0x7d15('0xad')]==='1'&&_0x374eca['paused']==='0'&&this[_0x7d15('0x1c')][_0x374eca[_0x7d15('0x132')]][_0x7d15('0x13b')]){this[_0x7d15('0x1c')][_0x374eca[_0x7d15('0x132')]][_0x7d15('0x13b')]=![];this[_0x7d15('0x25')][_0x570151[_0x7d15('0x1f')][_0x3e81ec['actionid']]['queue']]=[];this[_0x7d15('0x1a')][_0x7d15('0x137')](_0x374eca[_0x7d15('0x138')],_0x374eca[_0x7d15('0x132')])[_0x7d15('0xb5')](function(_0x3f4648){logger[_0x7d15('0x96')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x3f4648,{'showHidden':![],'depth':null}));})[_0x7d15('0x18')](function(){_0x570151['updateOriginated'](_0x570151[_0x7d15('0xb0')][_0x570151[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]]);setTimeout(function(){_0x570151[_0x7d15('0x1c')][_0x374eca[_0x7d15('0x132')]][_0x7d15('0x13b')]=!![];loggerBooked[_0x7d15('0x7f')](_0x7d15('0x13f'),_0x3e81ec[_0x7d15('0x12f')],'Agent:\x20',JSON[_0x7d15('0x45')](_['pick'](_0x570151[_0x7d15('0x1c')][_0x374eca[_0x7d15('0x132')]],[_0x7d15('0x3c'),_0x7d15('0x13b')])),_0x7d15('0x13e'),JSON[_0x7d15('0x45')](_0x374eca[_0x7d15('0x138')]));},0xc7);delete _0x570151[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]];unlockQueueStatus(_0x4c4d98,_0x3e81ec['actionid']);});}else{loggerBooked['info'](_0x7d15('0x140'));this[_0x7d15('0xb3')](this[_0x7d15('0xb0')][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]]);this[_0x7d15('0x104')]({'active':![],'ContactId':this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0x10a')],'ListId':this['actions'][_0x3e81ec['actionid']][_0x7d15('0x107')],'VoiceQueueId':this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xd6')]||undefined,'CampaignId':this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xd7')]||undefined})['catch'](loggerCatch(_0x7d15('0x141')));delete this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]];unlockQueueStatus(_0x4c4d98);}}else{loggerBooked[_0x7d15('0x7f')](_0x7d15('0x142'));this[_0x7d15('0xb3')](this['voiceQueues'][this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0x10a')],'ListId':this[_0x7d15('0x1f')][_0x3e81ec['actionid']][_0x7d15('0x107')],'VoiceQueueId':this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xd6')]||undefined,'CampaignId':this[_0x7d15('0x1f')][_0x3e81ec['actionid']]['CampaignId']||undefined})[_0x7d15('0xb5')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]];unlockQueueStatus(_0x4c4d98);}}else{loggerBooked[_0x7d15('0x7f')]('[booked][unlock3]');this[_0x7d15('0xb3')](this[_0x7d15('0xb0')][this[_0x7d15('0x1f')][_0x3e81ec['actionid']][_0x7d15('0xb1')]]);this[_0x7d15('0x104')]({'active':![],'ContactId':this[_0x7d15('0x1f')][_0x3e81ec['actionid']][_0x7d15('0x10a')],'ListId':this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0x107')],'VoiceQueueId':this['actions'][_0x3e81ec[_0x7d15('0x12f')]][_0x7d15('0xd6')]||undefined,'CampaignId':this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]]['CampaignId']||undefined})[_0x7d15('0xb5')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x7d15('0x1f')][_0x3e81ec[_0x7d15('0x12f')]];unlockQueueStatus(_0x4c4d98);}};Dialer[_0x7d15('0x15')][_0x7d15('0x37')]=function(){var _0x1648e2=this;return BPromise['resolve']()[_0x7d15('0x3a')](cmHopper[_0x7d15('0x143')]({}))[_0x7d15('0x3a')](function(){setInterval(function(){_0x1648e2['syncCampaigns']();},0x3e8);});};Dialer[_0x7d15('0x15')][_0x7d15('0x144')]=function(_0x3f0576){var _0x4140bc=this;return function(){if(!_0x4140bc[_0x7d15('0xdc')](_0x3f0576[_0x7d15('0x77')])){if(!_0x4140bc[_0x7d15('0xdc')](_0x3f0576['TrunkBackup'])){_0x3f0576[_0x7d15('0x3d')]='TRUNK_IS_NOT_REACHABLE';throw _0x3f0576[_0x7d15('0x3c')]+_0x7d15('0x145');}}};};Dialer[_0x7d15('0x15')]['checkIfTime']=function(_0xf2b1fd,_0x336878,_0x538ad6,_0x50ab8d){var _0x250df=this;return function(){var _0x2f9e59=!![];return _0x250df[_0x7d15('0x146')](_0xf2b1fd,_0x336878,_0x538ad6,_0x50ab8d,_0x2f9e59);};};Dialer['prototype'][_0x7d15('0x147')]=function(_0xd6b8db,_0x140962,_0x27e026,_0x45f503){var _0x5cf027=this;return function(){var _0x466da7=![];return _0x5cf027[_0x7d15('0x146')](_0xd6b8db['Intervals'],_0x140962,_0x27e026,_0x45f503,_0x466da7);};};Dialer[_0x7d15('0x15')][_0x7d15('0x146')]=function(_0x25780f,_0x2a2a9f,_0x47e5d3,_0x55fad3,_0x5b6450){var _0x36c985=[];return new BPromise(function(_0x4cabc1,_0xe8d627){if(!isNotNull(_0x25780f)){_0x55fad3['message']=_0x7d15('0x40');return _0xe8d627(msgResponse(_0x7d15('0x146'),_0x7d15('0x148'),_0x47e5d3+_0x7d15('0x149')));}if(_[_0x7d15('0x7e')](_0x25780f)){_0x55fad3[_0x7d15('0x3d')]=_0x7d15('0x14a');return _0xe8d627(msgResponse('ifTime',_0x7d15('0x148'),_0x47e5d3+'\x20Intervals\x20is\x20empty\x20'));}if(_0x2a2a9f&&_['isUndefined'](config[_0x7d15('0x14b')][_0x2a2a9f])){_0x55fad3['message']=_0x7d15('0x14c');return _0xe8d627(msgResponse(_0x7d15('0x146'),_0x7d15('0x148'),_0x47e5d3+'\x20Timezone\x20unknow\x20'+_0x2a2a9f));}if(_[_0x7d15('0x14d')](_0x25780f)){for(var _0x2e3d3d=0x0;_0x2e3d3d<_0x25780f[_0x7d15('0x98')];_0x2e3d3d+=0x1){_0x36c985[_0x7d15('0x134')](ami[_0x7d15('0xac')]({'action':'command','command':util['format'](_0x7d15('0x14e'),_0x25780f[_0x2e3d3d]['interval'],!_[_0x7d15('0x86')](config['timezones'][_0x2a2a9f])?_0x2a2a9f:'')})[_0x7d15('0x3a')](function(_0x2e94e4){return _0x2e94e4['content'][_0x7d15('0x14f')](_0x7d15('0x150'))>=0x0;})[_0x7d15('0xb5')](myreject(_0xe8d627)));}}else{_0x36c985['push'](ami[_0x7d15('0xac')]({'action':_0x7d15('0x151'),'command':util[_0x7d15('0x7a')](_0x7d15('0x14e'),_0x25780f,!_[_0x7d15('0x86')](config[_0x7d15('0x14b')][_0x2a2a9f])?_0x2a2a9f:'')})[_0x7d15('0x3a')](function(_0x43aab5){return _0x43aab5[_0x7d15('0x152')][_0x7d15('0x14f')](_0x7d15('0x150'))>=0x0;})[_0x7d15('0xb5')](myreject(_0xe8d627)));}BPromise[_0x7d15('0x153')](_0x36c985)[_0x7d15('0x3a')](function(_0x56499b){var _0x3254d5=_['some'](_0x56499b);if(_0x3254d5){return _0x4cabc1(_0x3254d5);}else{_0x55fad3[_0x7d15('0x3d')]=_0x5b6450?_0x7d15('0x154'):_0x7d15('0x155');return _0xe8d627(msgResponse('[ifTime][promiseAll]','Failure',_0x7d15('0x156')+_0x5b6450+'\x20'+_0x47e5d3+_0x7d15('0x157')+util[_0x7d15('0x95')](_0x25780f,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2a2a9f));}})['catch'](function(_0x33c0bb){return _0xe8d627(msgResponse(_0x7d15('0x146'),_0x7d15('0x148'),JSON['stringify'](_0x33c0bb)));});});};Dialer[_0x7d15('0x15')][_0x7d15('0x158')]=function(_0x1adf1b){var _0x49190e=this;return function(){switch(_0x1adf1b[_0x7d15('0x159')]){case'progressive':freeVariablesPredictive(_0x1adf1b);_0x49190e[_0x7d15('0x15a')](_0x1adf1b,0x1);break;case _0x7d15('0x15b'):freeVariablesPredictive(_0x1adf1b);_0x49190e[_0x7d15('0x15a')](_0x1adf1b,_0x1adf1b['dialPowerLevel']);break;case _0x7d15('0x15c'):_0x49190e[_0x7d15('0x15c')](_0x1adf1b);break;case'booked':freeVariablesPredictive(_0x1adf1b);_0x49190e['handlePower'](_0x1adf1b,0x1);break;default:freeVariablesPredictive(_0x1adf1b);logger[_0x7d15('0x96')](_0x7d15('0x15d'),_0x1adf1b[_0x7d15('0x3c')],_0x7d15('0x15e'));}};};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x7d1e29){return BPromise['resolve']()[_0x7d15('0x3a')](cmHopper[_0x7d15('0x15f')](_0x7d1e29['id'],previewRecallmeReminderInterval))[_0x7d15('0x3a')](function(_0x11d22e){for(var _0x36061c=0x0;_0x36061c<_0x11d22e[_0x7d15('0x98')];_0x36061c++){var _0x430153=_0x11d22e[_0x36061c][_0x7d15('0x160')]['name'];if(_0x430153)io['to'](util[_0x7d15('0x7a')]('user:%s',_0x430153))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x11d22e[_0x36061c]});}})[_0x7d15('0xb5')](function(_0xceb4bf){});};Dialer[_0x7d15('0x15')][_0x7d15('0x161')]=function(_0x1fe8ee){var _0x21a824=this;return function(){_0x21a824[_0x7d15('0x162')](_0x1fe8ee);};};Dialer[_0x7d15('0x15')][_0x7d15('0x6')]=function(_0x27830c){var _0x5e80c9=this;if(isNotPreview(_0x27830c[_0x7d15('0x159')])){if(isVoiceQueueOutbound(_0x27830c[_0x7d15('0x49')])&&isActive(_0x27830c[_0x7d15('0x57')])){_0x27830c[_0x7d15('0xa0')]=!![];BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](checkIsLoggedIn(_0x27830c,_0x27830c[_0x7d15('0x4d')]))[_0x7d15('0x3a')](checkIsActive(_0x27830c,_0x27830c[_0x7d15('0x57')]))['then'](checkInterval(_0x27830c))[_0x7d15('0x3a')](_0x5e80c9[_0x7d15('0x144')](_0x27830c))['then'](_0x5e80c9[_0x7d15('0x163')](_0x27830c['dialGlobalInterval'],_0x27830c[_0x7d15('0x164')],_0x27830c[_0x7d15('0x3c')],_0x27830c))['then'](_0x5e80c9[_0x7d15('0x147')](_0x27830c[_0x7d15('0x3f')],_0x27830c['dialTimezone'],_0x27830c[_0x7d15('0x3c')],_0x27830c))[_0x7d15('0x3a')](_0x5e80c9[_0x7d15('0x158')](_0x27830c))['catch'](loggerCatchQueueSummary(_0x7d15('0x165'),_0x27830c));}else{notSendMessagesQueue(_0x27830c);}}else{freeVariablesPredictive(_0x27830c);if(_0x27830c[_0x7d15('0x166')]){_0x5e80c9[_0x7d15('0x167')](_0x27830c);}}};Dialer['prototype'][_0x7d15('0x168')]=function(){var _0x4533b9=this;var _0x3bba9c;for(var _0x4e131d in this[_0x7d15('0x1b')]){if(typeof this[_0x7d15('0x1b')][_0x4e131d]!==_0x7d15('0x99')){_0x3bba9c=this['campaigns'][_0x4e131d];if(isCampaignIvr(_0x3bba9c[_0x7d15('0x49')])&&isActive(_0x3bba9c[_0x7d15('0xdd')])){_0x3bba9c[_0x7d15('0xa0')]=!![];BPromise[_0x7d15('0xba')]()[_0x7d15('0x3a')](checkIsActive(_0x3bba9c,_0x3bba9c[_0x7d15('0xdd')]))[_0x7d15('0x3a')](checkInterval(_0x3bba9c))['then'](_0x4533b9['checkIsTrunkReachable'](_0x3bba9c))[_0x7d15('0x3a')](_0x4533b9[_0x7d15('0x163')](_0x3bba9c[_0x7d15('0x169')],_0x3bba9c[_0x7d15('0x164')],_0x3bba9c[_0x7d15('0x3c')],_0x3bba9c))[_0x7d15('0x3a')](_0x4533b9[_0x7d15('0x147')](_0x3bba9c['Interval'],_0x3bba9c['dialTimezone'],_0x3bba9c['name'],_0x3bba9c))['then'](_0x4533b9[_0x7d15('0x161')](_0x3bba9c))[_0x7d15('0xb5')](loggerCatchQueueSummary('[syncCampaigns]',_0x3bba9c));}else{notSendMessagesCampaign(_0x3bba9c);}}}};function getCallerIdRandom(_0x5b4595,_0xa73187){var _0x54a9a3;var _0x3e085d;var _0x3afd98;if(_0xa73187<=0x0){_0xa73187=0x1;}_0x54a9a3=new RegExp('\x5cw{0,'+_0xa73187+'}$');_0x3e085d=Math[_0x7d15('0x16a')](0xa,_0xa73187-0x1);_0x3afd98=Math[_0x7d15('0x16a')](0xa,_0xa73187)-0x1;return util[_0x7d15('0x7a')]('%s',_['replace'](_0x5b4595,_0x54a9a3,_['random'](_0x3e085d,_0x3afd98)));}function extractCalleridName(_0x45ffd3){var _0x1b6c27=_0x45ffd3[_0x7d15('0x16b')](/"(.*?)"/);return _0x1b6c27?_0x1b6c27[0x1]:_0x45ffd3;}function extractCalleridNumber(_0x5a155f){var _0x425dca=_0x5a155f[_0x7d15('0x16b')](/<(.*?)>/);return _0x425dca?_0x425dca[0x1]:_0x5a155f;}Dialer[_0x7d15('0x15')][_0x7d15('0x16c')]=function(_0x5aed77,_0x4bff2e){var _0x2d91cd=this;var _0x1d4bea=uuid['v4']();this[_0x7d15('0x1f')][_0x1d4bea]=new Action(_0x5aed77,_0x4bff2e,_0x1d4bea);return new BPromise(function(_0x33a885,_0x48d6e3){if(_[_0x7d15('0x86')](_0x5aed77)&&typeof _0x5aed77!==_0x7d15('0x16d')){return _0x48d6e3(msgResponse(_0x7d15('0x16e'),'Failure',_0x7d15('0x16f')));}if(_[_0x7d15('0x86')](_0x4bff2e[_0x7d15('0x170')])||_0x4bff2e['phone']===null){return _0x48d6e3(msgResponse(_0x7d15('0x16e'),_0x7d15('0x148'),_0x7d15('0x171')));}var _0x5ab958={'XMD-CALLERID':_0x2d91cd[_0x7d15('0x1f')][_0x1d4bea][_0x7d15('0x172')](),'XMD-AGI':_0x5aed77['dialQueueProject']?util[_0x7d15('0x7a')](_0x7d15('0x173'),ipAgi,_0x5aed77[_0x7d15('0x174')]):_0x7d15('0x175'),'XMD-AGIAFTER':_0x5aed77[_0x7d15('0x11f')]?util[_0x7d15('0x7a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5aed77[_0x7d15('0x11f')]):'NONE','XMD-QUEUE':_0x5aed77[_0x7d15('0x49')]==='outbound'?util[_0x7d15('0x7a')]('\x22%s,%s%s,,,%s\x22',_0x5aed77[_0x7d15('0x3c')],_0x5aed77[_0x7d15('0x176')]||'',_0x5aed77[_0x7d15('0x110')]?'c':'',_0x5aed77[_0x7d15('0x11a')]||0x3):_0x7d15('0x175'),'XMD-CONTACTID':_0x4bff2e[_0x7d15('0x10a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d91cd[_0x7d15('0x1f')][_0x1d4bea]['getCaller'](),'XMD-AMD':_0x5aed77[_0x7d15('0xe3')]?_0x7d15('0x177'):_0x7d15('0x175'),'XMD-DESTINATION':_0x7d15('0x178')};if(_0x5aed77[_0x7d15('0xe3')]){_0x5ab958['XMD-AMDINITIALSILENCE']=_0x5aed77['dialAMDInitialSilence']||0x9c4;_0x5ab958['XMD-AMDGREETING']=_0x5aed77[_0x7d15('0x179')]||0x5dc;_0x5ab958[_0x7d15('0x17a')]=_0x5aed77['dialAMDAfterGreetingSilence']||0x320;_0x5ab958[_0x7d15('0x17b')]=_0x5aed77[_0x7d15('0x17c')]||0x1388;_0x5ab958[_0x7d15('0x17d')]=_0x5aed77['dialAMDMinWordLength']||0x64;_0x5ab958[_0x7d15('0x17e')]=_0x5aed77[_0x7d15('0x17f')]||0x32;_0x5ab958['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x5aed77['dialAMDMaximumNumberOfWords']||0x3;_0x5ab958['XMD-AMDSILENCETHRESHOLD']=_0x5aed77[_0x7d15('0x180')]||0x100;_0x5ab958[_0x7d15('0x181')]=_0x5aed77['dialAMDMaximumWordLength']||0x1388;}if(_0x5aed77['type']===_0x7d15('0x4a')){_0x5ab958['XMD-VOICEQUEUEID']=_0x4bff2e[_0x7d15('0xd6')];}else{_0x5ab958[_0x7d15('0x182')]=_0x4bff2e[_0x7d15('0xd7')];}for(var _0x2f2f81 in _0x4bff2e[_0x7d15('0x183')]){if(typeof _0x4bff2e[_0x7d15('0x183')][_0x2f2f81]!=='undefined'){if(isNotNull(_0x4bff2e[_0x7d15('0x183')][_0x2f2f81])&&_0x2f2f81!=='id'&&_0x2f2f81!=='tags'&&_0x2f2f81!==_0x7d15('0x184')&&_0x2f2f81!==_0x7d15('0x185')){_0x5ab958[util['format']('%s%s',_0x7d15('0x186'),_[_0x7d15('0x187')](_0x2f2f81))]=_0x4bff2e['Contact'][_0x2f2f81];}}}var _0x261ed5=_0x2d91cd[_0x7d15('0xdc')](_0x5aed77['Trunk'])?getCallerId(_0x5aed77['Trunk']['callerid'],_0x5aed77[_0x7d15('0x58')],_0x5aed77['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5aed77[_0x7d15('0x59')],_0x5aed77[_0x7d15('0x188')]):_0x5aed77[_0x7d15('0x59')]):getCallerId(_[_0x7d15('0xab')](_0x5aed77[_0x7d15('0x189')])?_0x5aed77[_0x7d15('0x77')]['callerid']:_0x5aed77[_0x7d15('0x189')][_0x7d15('0x78')],_0x5aed77['dialOriginateCallerIdName'],_0x5aed77[_0x7d15('0x188')]>0x0?getCallerIdRandom(_0x5aed77[_0x7d15('0x59')],_0x5aed77[_0x7d15('0x188')]):_0x5aed77[_0x7d15('0x59')]);if(_0x261ed5){_0x5ab958['XMD-ORIGINATECALLERIDNAME']=_0x2d91cd[_0x7d15('0x1f')][_0x1d4bea][_0x7d15('0x18a')]=extractCalleridName(_0x261ed5);_0x5ab958[_0x7d15('0x18b')]=_0x4bff2e[_0x7d15('0x170')];}return ami[_0x7d15('0xac')]({'actionid':_0x1d4bea,'action':_0x7d15('0x16e'),'channel':_0x2d91cd[_0x7d15('0xdc')](_0x5aed77[_0x7d15('0x77')])?util[_0x7d15('0x7a')](_0x7d15('0x18c'),_0x5aed77[_0x7d15('0x77')][_0x7d15('0x3c')],isNotNull(_0x5aed77[_0x7d15('0x5b')])?_0x5aed77[_0x7d15('0x5b')][_0x7d15('0x18d')]()||'':'',_0x5aed77[_0x7d15('0x18e')]>0x0?_0x4bff2e[_0x7d15('0x170')]['substring'](_0x5aed77[_0x7d15('0x18e')]):_0x4bff2e[_0x7d15('0x170')]):util['format']('SIP/%s/%s%s',_[_0x7d15('0xab')](_0x5aed77[_0x7d15('0x189')])?_0x5aed77[_0x7d15('0x77')][_0x7d15('0x3c')]:_0x5aed77[_0x7d15('0x189')][_0x7d15('0x3c')],isNotNull(_0x5aed77[_0x7d15('0x5b')])?_0x5aed77['dialPrefix']['trim']()||'':'',_0x5aed77['dialCutDigit']>0x0?_0x4bff2e['phone'][_0x7d15('0x18f')](_0x5aed77[_0x7d15('0x18e')]):_0x4bff2e['phone']),'callerid':_0x261ed5,'Exten':_0x7d15('0x178'),'Context':'from-sip','Priority':'1','variable':_0x5ab958,'timeout':(_0x5aed77[_0x7d15('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1d4bea})[_0x7d15('0x3a')](function(_0x17d765){return _0x33a885(_0x17d765);})[_0x7d15('0xb5')](function(_0x5c2b10){_0x5aed77['outboundOriginateFailureCallsDay']+=0x1;var _0x478d4e=new History(_0x2d91cd[_0x7d15('0x1f')][_0x1d4bea]);logger[_0x7d15('0x96')](util[_0x7d15('0x7a')]('[originateError]:\x20%s',JSON['stringify'](_0x5c2b10)));_0x478d4e[_0x7d15('0xe8')]=0xe;_0x478d4e['statedesc']=_0x7d15('0x190');_0x478d4e[_0x7d15('0xa7')]=moment()[_0x7d15('0x7a')](_0x7d15('0x111'));_0x478d4e['endtime']=_0x478d4e['starttime'];_0x2d91cd[_0x7d15('0xcd')](_0x478d4e)['catch'](loggerCatch(_0x7d15('0x191')));_0x2d91cd[_0x7d15('0xcb')](_0x478d4e)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x191')))['finally'](function(){delete _0x2d91cd[_0x7d15('0x1f')][_0x1d4bea];return _0x48d6e3(msgResponse(_0x7d15('0x16e'),'Error',_0x7d15('0x192')));});});});};Dialer[_0x7d15('0x15')]['syncOriginateResponse']=function(_0x5064ff){var _0x343c4f=this[_0x7d15('0x1f')][_0x5064ff[_0x7d15('0x12f')]];if(_0x343c4f){delete this[_0x7d15('0x1f')][_0x5064ff['actionid']];_0x343c4f['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x50cde9=_0x343c4f[_0x7d15('0x49')]===_0x7d15('0x92')?this['campaigns'][_0x343c4f[_0x7d15('0xb1')]]:this[_0x7d15('0xb0')][_0x343c4f[_0x7d15('0x193')]()];if(!this[_0x7d15('0xda')](_0x5064ff[_0x7d15('0x194')])){this[_0x7d15('0xb3')](_0x50cde9);return this[_0x7d15('0x195')](_0x343c4f,_0x50cde9,_0x5064ff)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x196')));}this['uniqueId'][_0x5064ff['uniqueid']]=_0x343c4f;}};Dialer[_0x7d15('0x15')][_0x7d15('0x197')]=function(_0x4770b8,_0x5a8a80,_0x5d8ab1){var _0x13b7bc=new History(_0x5a8a80);if(_0x13b7bc[_0x7d15('0xf8')]+_0x13b7bc[_0x7d15('0xf9')]+_0x13b7bc[_0x7d15('0xfa')]+_0x13b7bc[_0x7d15('0xfb')]+_0x13b7bc[_0x7d15('0xfc')]+_0x13b7bc['countabandonedretry']+_0x13b7bc[_0x7d15('0xf3')]+_0x13b7bc[_0x7d15('0xfd')]>=_0x5d8ab1[_0x7d15('0xfe')]-0x1){return!![];}switch(_0x4770b8){case 0x3:if(_0x13b7bc[_0x7d15('0xfa')]>=_0x5d8ab1[_0x7d15('0x198')]-0x1){return!![];}this[_0x7d15('0x104')]({'active':![],'countnoanswerretry':_0x13b7bc['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x7d15('0x105')](_0x5d8ab1[_0x7d15('0x199')],_0x7d15('0x106'))[_0x7d15('0x7a')](_0x7d15('0x111')),'ContactId':_0x13b7bc[_0x7d15('0x10a')],'ListId':_0x13b7bc[_0x7d15('0x107')],'VoiceQueueId':_0x13b7bc['VoiceQueueId']||undefined,'CampaignId':_0x13b7bc[_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x19a')));break;case 0x5:if(_0x13b7bc['countbusyretry']>=_0x5d8ab1[_0x7d15('0x19b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x13b7bc[_0x7d15('0xf8')]+=0x1,'scheduledat':moment()[_0x7d15('0x105')](_0x5d8ab1[_0x7d15('0x19c')],_0x7d15('0x106'))[_0x7d15('0x7a')](_0x7d15('0x111')),'ContactId':_0x13b7bc[_0x7d15('0x10a')],'ListId':_0x13b7bc['ListId'],'VoiceQueueId':_0x13b7bc[_0x7d15('0xd6')]||undefined,'CampaignId':_0x13b7bc[_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x19d')));break;case 0x8:if(_0x13b7bc[_0x7d15('0xf9')]>=_0x5d8ab1[_0x7d15('0x19e')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x13b7bc['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x5d8ab1[_0x7d15('0x19f')],_0x7d15('0x106'))[_0x7d15('0x7a')](_0x7d15('0x111')),'ContactId':_0x13b7bc[_0x7d15('0x10a')],'ListId':_0x13b7bc[_0x7d15('0x107')],'VoiceQueueId':_0x13b7bc[_0x7d15('0xd6')]||undefined,'CampaignId':_0x13b7bc[_0x7d15('0xd7')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x13b7bc[_0x7d15('0xfb')]>=_0x5d8ab1[_0x7d15('0x1a0')]-0x1){return!![];}else{this[_0x7d15('0x104')]({'active':![],'countnosuchnumberretry':_0x13b7bc['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x7d15('0x105')](_0x5d8ab1['dialNoSuchNumberRetryFrequency'],_0x7d15('0x106'))['format'](_0x7d15('0x111')),'ContactId':_0x13b7bc[_0x7d15('0x10a')],'ListId':_0x13b7bc[_0x7d15('0x107')],'VoiceQueueId':_0x13b7bc[_0x7d15('0xd6')]||undefined,'CampaignId':_0x13b7bc[_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x13b7bc['countdropretry']>=_0x5d8ab1[_0x7d15('0x123')]-0x1){return!![];}this[_0x7d15('0x104')]({'active':![],'countdropretry':_0x13b7bc[_0x7d15('0xfc')]+=0x1,'scheduledat':moment()[_0x7d15('0x105')](_0x5d8ab1['dialDropRetryFrequency'],_0x7d15('0x106'))['format'](_0x7d15('0x111')),'ContactId':_0x13b7bc[_0x7d15('0x10a')],'ListId':_0x13b7bc[_0x7d15('0x107')],'VoiceQueueId':_0x13b7bc[_0x7d15('0xd6')]||undefined,'CampaignId':_0x13b7bc[_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x13b7bc['countabandonedretry']>=_0x5d8ab1[_0x7d15('0x12a')]-0x1){return!![];}this[_0x7d15('0x104')]({'active':![],'countabandonedretry':_0x13b7bc['countabandonedretry']+=0x1,'scheduledat':moment()[_0x7d15('0x105')](_0x5d8ab1[_0x7d15('0x129')],_0x7d15('0x106'))[_0x7d15('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x13b7bc[_0x7d15('0x10a')],'ListId':_0x13b7bc[_0x7d15('0x107')],'VoiceQueueId':_0x13b7bc['VoiceQueueId']||undefined,'CampaignId':_0x13b7bc[_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x13b7bc[_0x7d15('0xf3')]>=_0x5d8ab1[_0x7d15('0x101')]-0x1){return!![];}this[_0x7d15('0x104')]({'active':![],'countmachineretry':_0x13b7bc['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x5d8ab1[_0x7d15('0x109')],_0x7d15('0x106'))[_0x7d15('0x7a')](_0x7d15('0x111')),'ContactId':_0x13b7bc[_0x7d15('0x10a')],'ListId':_0x13b7bc[_0x7d15('0x107')],'VoiceQueueId':_0x13b7bc['VoiceQueueId']||undefined,'CampaignId':_0x13b7bc[_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x13b7bc[_0x7d15('0xfd')]>=_0x5d8ab1[_0x7d15('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x13b7bc[_0x7d15('0xfd')]+=0x1,'scheduledat':moment()[_0x7d15('0x105')](_0x5d8ab1[_0x7d15('0x1a2')],'minutes')[_0x7d15('0x7a')](_0x7d15('0x111')),'ContactId':_0x13b7bc[_0x7d15('0x10a')],'ListId':_0x13b7bc[_0x7d15('0x107')],'VoiceQueueId':_0x13b7bc[_0x7d15('0xd6')]||undefined,'CampaignId':_0x13b7bc['CampaignId']||undefined})[_0x7d15('0xb5')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x7d15('0x15')]['callProgressDetecting']=function(_0x4e38d5,_0x2a3f93,_0xad3d47){var _0x4c8eee=this;var _0x6bacae=new History(_0x4e38d5);var _0xe37cc=![];var _0x139e13;var _0x412092;return new BPromise(function(_0x245e78,_0x5ed1f3){if(_[_0x7d15('0x86')](_0x2a3f93)&&typeof _0x2a3f93!==_0x7d15('0x16d')){return _0x5ed1f3(msgResponse(_0x7d15('0x1a3'),_0x7d15('0x148'),_0x7d15('0x1a4')));}if(_[_0x7d15('0x86')](_0xad3d47)&&typeof _0xad3d47!==_0x7d15('0x16d')){return _0x5ed1f3(msgResponse(_0x7d15('0x1a3'),'Failure',_0x7d15('0x1a5')));}_0x4c8eee[_0x7d15('0xb9')](_0x6bacae,_0xad3d47[_0x7d15('0x1a6')],_0x2a3f93)[_0x7d15('0x3a')](function(_0x2b6f23){if(_0x2b6f23[_0x7d15('0x12b')]==0x1)_0xe37cc=!![];switch(_0xad3d47['reason']){case'0':_0x2a3f93[_0x7d15('0x62')]+=0x1;_0x6bacae[_0x7d15('0xe8')]=0x0;_0x6bacae['statedesc']='NoSuchNumber';_0x6bacae['countnosuchnumberretry']+=0x1;_0x6bacae['countglobal']+=0x1;ami['emit'](_0x7d15('0x1a7'),ut[_0x7d15('0xf6')](_0x4e38d5,_0x7d15('0x1a8')));_0x139e13=_0x2a3f93[_0x7d15('0x1a9')];_0x412092=_0x2a3f93['callAdditionalPhoneAfterMin'];_0x4c8eee['createHistory'](_0x6bacae)['catch'](loggerCatch(_0x7d15('0xf7')));if(_0x4c8eee[_0x7d15('0x197')](0x0,_0x4e38d5,_0x2a3f93)&&!_0xe37cc){if(_0x6bacae[_0x7d15('0xfb')]>=_0x2a3f93[_0x7d15('0x1a0')]){_0x4c8eee['createStateFinal'](_0x6bacae,_0x245e78,_0x5ed1f3,_0x7d15('0x1aa'));}else{_0x4c8eee[_0x7d15('0xff')](_0x6bacae,_0x245e78,_0x5ed1f3,_0x7d15('0x1aa'));}}break;case'3':_0x2a3f93['outboundNoAnswerCallsDay']+=0x1;_0x6bacae[_0x7d15('0xe8')]=0x3;_0x6bacae[_0x7d15('0xa6')]='NoAnswer';_0x6bacae[_0x7d15('0xfa')]+=0x1;_0x6bacae[_0x7d15('0xf4')]+=0x1;ami[_0x7d15('0xeb')]('custom:agentnoanswer',ut['buildObj'](_0x4e38d5,_0x7d15('0x1ab')));_0x139e13=_0x2a3f93['dialNoAnswerRetryFrequency'];_0x412092=_0x2a3f93[_0x7d15('0x121')];_0x4c8eee[_0x7d15('0xcd')](_0x6bacae)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x1ac')));if(_0x4c8eee[_0x7d15('0x197')](0x3,_0x4e38d5,_0x2a3f93)&&!_0xe37cc){if(_0x6bacae[_0x7d15('0xfa')]>=_0x2a3f93['dialNoAnswerMaxRetry']){_0x4c8eee['createStateFinal'](_0x6bacae,_0x245e78,_0x5ed1f3,_0x7d15('0x1ad'));}else{_0x4c8eee[_0x7d15('0xff')](_0x6bacae,_0x245e78,_0x5ed1f3,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2a3f93[_0x7d15('0x5d')]+=0x1;_0x6bacae[_0x7d15('0xe8')]=0x5;_0x6bacae[_0x7d15('0xa6')]=_0x7d15('0x1ae');_0x6bacae[_0x7d15('0xf8')]+=0x1;_0x6bacae['countglobal']+=0x1;ami[_0x7d15('0xeb')](_0x7d15('0x1af'),ut[_0x7d15('0xf6')](_0x4e38d5,'busy'));_0x139e13=_0x2a3f93[_0x7d15('0x19c')];_0x412092=_0x2a3f93[_0x7d15('0x121')];_0x4c8eee[_0x7d15('0xcd')](_0x6bacae)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x1b0')));if(_0x4c8eee[_0x7d15('0x197')](0x5,_0x4e38d5,_0x2a3f93)&&!_0xe37cc){if(_0x6bacae[_0x7d15('0xf8')]>=_0x2a3f93[_0x7d15('0x19b')]){_0x4c8eee[_0x7d15('0x102')](_0x6bacae,_0x245e78,_0x5ed1f3,_0x7d15('0x1b1'));}else{_0x4c8eee[_0x7d15('0xff')](_0x6bacae,_0x245e78,_0x5ed1f3,_0x7d15('0x1b1'));}}break;case'8':_0x2a3f93[_0x7d15('0x1b2')]+=0x1;_0x6bacae[_0x7d15('0xe8')]=0x8;_0x6bacae[_0x7d15('0xa6')]=_0x7d15('0x1b3');_0x6bacae[_0x7d15('0xf9')]+=0x1;_0x6bacae[_0x7d15('0xf4')]+=0x1;_0x139e13=_0x2a3f93['dialCongestionRetryFrequency'];_0x412092=_0x2a3f93[_0x7d15('0x121')];ami[_0x7d15('0xeb')]('custom:agentcongestion',ut[_0x7d15('0xf6')](_0x4e38d5,'congestion'));_0x4c8eee[_0x7d15('0xcd')](_0x6bacae)['catch'](loggerCatch(_0x7d15('0x1b4')));if(_0x4c8eee[_0x7d15('0x197')](0x8,_0x4e38d5,_0x2a3f93)&&!_0xe37cc){if(_0x6bacae[_0x7d15('0xf9')]>=_0x2a3f93[_0x7d15('0x19e')]){_0x4c8eee[_0x7d15('0x102')](_0x6bacae,_0x245e78,_0x5ed1f3,_0x7d15('0x1b5'));}else{_0x4c8eee['stateGlobal'](_0x6bacae,_0x245e78,_0x5ed1f3,'reason\x208\x20congestion');}}break;case'11':_0x2a3f93[_0x7d15('0x1b6')]+=0x1;_0x6bacae['state']=0xb;_0x6bacae[_0x7d15('0xa6')]='Abandoned';_0x6bacae[_0x7d15('0x128')]+=0x1;_0x6bacae[_0x7d15('0xf4')]+=0x1;_0x139e13=_0x2a3f93[_0x7d15('0x129')];_0x412092=_0x2a3f93[_0x7d15('0x121')];_0x4c8eee[_0x7d15('0xcd')](_0x6bacae)['catch'](loggerCatch(_0x7d15('0x12d')));if(_0x4c8eee[_0x7d15('0x197')](0xb,_0x4e38d5,_0x2a3f93)&&!_0xe37cc){if(_0x6bacae[_0x7d15('0x128')]>=_0x2a3f93[_0x7d15('0x12a')]){_0x4c8eee[_0x7d15('0x102')](_0x6bacae,_0x245e78,_0x5ed1f3,_0x7d15('0x1b7'));}else{_0x4c8eee[_0x7d15('0xff')](_0x6bacae,_0x245e78,_0x5ed1f3,'reason\x2011\x20abandoned');}}break;case'20':_0x2a3f93[_0x7d15('0x65')]+=0x1;_0x6bacae['state']=0x14;_0x6bacae[_0x7d15('0xa6')]=_0x7d15('0x1b8');_0x6bacae[_0x7d15('0xfd')]+=0x1;_0x6bacae[_0x7d15('0xf4')]+=0x1;_0x139e13=_0x2a3f93[_0x7d15('0x1a2')];_0x412092=_0x2a3f93[_0x7d15('0x121')];ami[_0x7d15('0xeb')](_0x7d15('0x1b9'),ut['buildObj'](_0x4e38d5,'agentreject'));_0x4c8eee['createHistory'](_0x6bacae)[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x1ba')));if(_0x4c8eee[_0x7d15('0x197')](0x14,_0x4e38d5,_0x2a3f93)&&!_0xe37cc){if(_0x6bacae[_0x7d15('0xfd')]>=_0x2a3f93[_0x7d15('0x1a1')]){_0x4c8eee[_0x7d15('0x102')](_0x6bacae,_0x245e78,_0x5ed1f3,'reason\x2020\x20agentreject');}else{_0x4c8eee[_0x7d15('0xff')](_0x6bacae,_0x245e78,_0x5ed1f3,_0x7d15('0x1bb'));}}break;default:_0x2a3f93['outboundUnknownCallsDay']+=0x1;_0x6bacae[_0x7d15('0xe8')]=0xc;_0x6bacae['statedesc']=_0xad3d47[_0x7d15('0x1a6')];_0x139e13=_0x2a3f93[_0x7d15('0x1a2')];_0x412092=_0x2a3f93[_0x7d15('0x121')];_0x4c8eee[_0x7d15('0xcd')](_0x6bacae)['catch'](loggerCatch(_0x7d15('0x1bc')));if(_0x4c8eee[_0x7d15('0x197')](_0xad3d47[_0x7d15('0x1a6')],_0x4e38d5,_0x2a3f93)&&!_0xe37cc){if(_0x6bacae[_0x7d15('0xf8')]+_0x6bacae[_0x7d15('0xf9')]+_0x6bacae[_0x7d15('0xfa')]+_0x6bacae[_0x7d15('0xfb')]+_0x6bacae[_0x7d15('0xfc')]+_0x6bacae[_0x7d15('0x128')]+_0x6bacae[_0x7d15('0xf3')]+_0x6bacae[_0x7d15('0xfd')]>=_0x2a3f93[_0x7d15('0xfe')]){_0x4c8eee[_0x7d15('0xff')](_0x6bacae,_0x245e78,_0x5ed1f3,_0xad3d47[_0x7d15('0x1a6')]);}else{_0x4c8eee['createStateFinal'](_0x6bacae,_0x245e78,_0x5ed1f3,_0xad3d47['reason']);}}}})[_0x7d15('0x3a')](function(_0x47b005){if(_0xe37cc){_0x4c8eee[_0x7d15('0xbc')](_0x6bacae,_0x139e13,_0x412092)[_0x7d15('0x3a')](function(_0x12bc16){return _0x245e78(0x1);});}});});};Dialer[_0x7d15('0x15')]['stateGlobal']=function(_0x1bec3b,_0x17b4b2,_0x4b43b1,_0x599b15){var _0x499bd8=new Final(_0x1bec3b);_0x499bd8[_0x7d15('0xe8')]=0xf;_0x499bd8['statedesc']=_0x7d15('0x1bd');this['createStateFinal'](_0x499bd8,_0x17b4b2,_0x4b43b1,_0x599b15);};Dialer[_0x7d15('0x15')]['createStateFinal']=function(_0x28e185,_0x2782a3,_0x5bf4d6,_0x139818){this[_0x7d15('0xcb')](_0x28e185)[_0x7d15('0x3a')](function(){return _0x2782a3(msgResponse('[callProgressDetecting]',_0x7d15('0xdb'),_0x139818));})[_0x7d15('0xb5')](function(){return _0x5bf4d6(msgResponse(_0x7d15('0x1be'),_0x7d15('0x148'),_0x7d15('0x1bf')));});};Dialer[_0x7d15('0x15')]['predictive']=function(_0x89135d){var _0x1d4070=_0x89135d[_0x7d15('0x1c0')]/0x64;var _0x489476=_0x89135d['outboundDropCallsDayTimeout']/(_0x89135d[_0x7d15('0x60')]+_0x89135d['outboundAnswerCallsDay']);var _0x3899ed=Math[_0x7d15('0x1c1')](_0x89135d[_0x7d15('0x70')]*(_0x89135d['predictiveIntervalMaxThreshold']/0x64));var _0xa24196=Math['round'](_0x89135d[_0x7d15('0x70')]*(_0x89135d[_0x7d15('0x1c2')]/0x64));var _0xeb468b=_0x89135d[_0x7d15('0x4c')]+_0x89135d[_0x7d15('0x51')];var _0x1f95b8=Math[_0x7d15('0x1c3')](_0x89135d[_0x7d15('0x73')]*_0x89135d[_0x7d15('0x74')]*_0x89135d[_0x7d15('0x6d')]*_0x89135d[_0x7d15('0x6e')]);if(_[_0x7d15('0x86')](_0x89135d[_0x7d15('0x23')])){if(!_[_0x7d15('0x86')](_0x89135d[_0x7d15('0x76')])){_0x89135d[_0x7d15('0x76')]=undefined;loggerPredictive[_0x7d15('0x96')](_0x7d15('0x1c4'),_0x7d15('0x1c5'));}if(!_[_0x7d15('0x86')](_0x89135d[_0x7d15('0x91')])){loggerPredictive[_0x7d15('0x96')](_0x7d15('0x1c4'),_0x7d15('0x1c6'));clearInterval(_0x89135d[_0x7d15('0x91')]);_0x89135d[_0x7d15('0x91')]=undefined;}_0x89135d[_0x7d15('0x23')]=moment()[_0x7d15('0x7a')](_0x7d15('0x111'));loggerPredictive[_0x7d15('0x7f')](_0x89135d[_0x7d15('0x3c')],'collection\x20data\x20in\x20progressive\x20at',_0x89135d[_0x7d15('0x23')]);this[_0x7d15('0x15a')](_0x89135d,0x1);}else if(ifInterval(_0x89135d[_0x7d15('0x1c7')],_0x89135d[_0x7d15('0x23')])){this[_0x7d15('0x15a')](_0x89135d,0x1);loggerPredictiveCalls[_0x7d15('0x7f')](_0x7d15('0x1c8'),_0x89135d[_0x7d15('0x23')],_0x89135d['name']);_0x89135d['erlangCalls']=0x0;_0x89135d[_0x7d15('0x6c')]=0x0;}else if(_0x1d4070<_0x489476&&_0x89135d['dialPredictiveOptimization']===_0x7d15('0x1c9')){freeVariablesPredictive(_0x89135d);loggerPredictive[_0x7d15('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x7d15('0x1ca'),_0x489476,_0x7d15('0x23'),_0x89135d[_0x7d15('0x3c')]);}else if(_0x1f95b8<_0x89135d[_0x7d15('0x6c')]&&_0x89135d['dialPredictiveOptimization']===_0x7d15('0x1c9')){freeVariablesPredictive(_0x89135d);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x1cb'),'Max\x20Drop\x20',_0x1f95b8,_0x7d15('0x1cc'),_0x89135d['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x89135d['name']);}else if(!ifInterval(_0x89135d['dialPredictiveInterval'],_0x89135d['startProgressive'])&&_[_0x7d15('0x86')](_0x89135d[_0x7d15('0x76')])&&!_[_0x7d15('0x86')](_0x89135d[_0x7d15('0x23')])){_0x89135d['startPredictive']=moment()[_0x7d15('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x7d15('0x7f')](_0x89135d[_0x7d15('0x3c')],_0x7d15('0x1cd'),_0x89135d[_0x7d15('0x76')]);this[_0x7d15('0xc0')](_0x89135d['dialPredictiveInterval'])[_0x7d15('0x3a')](this[_0x7d15('0x1ce')](_0x89135d))[_0x7d15('0x3a')](mergeDataErlangB(_0x89135d))[_0x7d15('0x3a')](this[_0x7d15('0x1cf')](_0x89135d))['catch'](loggerCatchPredictive(_0x7d15('0x1d0'),_0x89135d));}else if(!ifInterval(_0x89135d['dialPredictiveInterval'],_0x89135d[_0x7d15('0x76')])){_0x89135d['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x89135d[_0x7d15('0x76')]=moment()[_0x7d15('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x89135d[_0x7d15('0x3c')],_0x7d15('0x1d1'),_0x89135d[_0x7d15('0x76')]);clearInterval(_0x89135d[_0x7d15('0x91')]);_0x89135d[_0x7d15('0x91')]=undefined;this[_0x7d15('0xc0')](_0x89135d['dialPredictiveInterval'])[_0x7d15('0x3a')](this[_0x7d15('0x1ce')](_0x89135d))[_0x7d15('0x3a')](mergeDataErlangB(_0x89135d))[_0x7d15('0x3a')](this[_0x7d15('0x1cf')](_0x89135d))['catch'](loggerCatchPredictive(_0x7d15('0x1d2'),_0x89135d));}else if(_0x89135d[_0x7d15('0x70')]&&_0xeb468b<_0x89135d['predictiveIntervalAvailable']-_0xa24196){freeVariablesPredictive(_0x89135d);loggerPredictive[_0x7d15('0x7f')](_0x89135d[_0x7d15('0x3c')],_0x7d15('0x1d3'),_0xeb468b,_0x7d15('0x1d4'),_0x89135d['predictiveIntervalAvailable'],'-',_0xa24196,'=',_0x89135d[_0x7d15('0x70')]-_0xa24196,')');}else if(_0x89135d[_0x7d15('0x70')]&&_0xeb468b>_0x89135d[_0x7d15('0x70')]+_0x3899ed){freeVariablesPredictive(_0x89135d);loggerPredictive[_0x7d15('0x7f')](_0x89135d['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xeb468b,_0x7d15('0x1d5'),_0x89135d['predictiveIntervalAvailable'],'+',_0x3899ed,'=',_0x89135d[_0x7d15('0x70')]+_0x3899ed,')');}};Dialer[_0x7d15('0x15')]['getDataPredictive']=function(_0x60d70c){var _0x2d87e4=this;return function(_0x773415){return new BPromise(function(_0x580df4,_0x22f543){_['merge'](_0x60d70c,_0x773415[0x0]);if(checkGetDataPredictive(_0x773415[0x0])){var _0x275b12=_0x60d70c[_0x7d15('0x70')]=_0x60d70c[_0x7d15('0x51')]+_0x60d70c[_0x7d15('0x4c')];var _0x41c4f9=_0x60d70c[_0x7d15('0x1c7')]*0x3c;var _0x2c3b6b=_0x773415[0x0][_0x7d15('0x68')]+_0x773415[0x0][_0x7d15('0x67')];var _0x314234=(_0x773415[0x0]['predictiveIntervalAnsweredCalls']+_0x773415[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x773415[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x773415[0x0][_0x7d15('0x71')];_0x60d70c['predictiveIntervalHitRate']=_0x314234>0x0?_0x314234:0x1;switch(_0x60d70c[_0x7d15('0x1d6')]){case _0x7d15('0x1c9'):var _0x11e3e5=_0x60d70c['dialPredictiveOptimizationPercentage']/0x64;return _0x2d87e4[_0x7d15('0x1d7')](_0x275b12,_0x41c4f9,_0x2c3b6b,_0x314234,_0x11e3e5)[_0x7d15('0x3a')](function(_0x17a607){return _0x580df4(_0x17a607);});case'agentBusyFactor':var _0x46949b=_0x60d70c['dialPredictiveOptimizationPercentage']/0x64;return _0x2d87e4[_0x7d15('0x1d8')](_0x275b12,_0x41c4f9,_0x2c3b6b,_0x314234,_0x46949b)[_0x7d15('0x3a')](function(_0x13aa2d){return _0x580df4(_0x13aa2d);});default:return _0x22f543(msgResponse(_0x7d15('0x1d9'),_0x7d15('0x148'),_0x7d15('0x1da')));}}else{return _0x22f543(msgResponse(_0x7d15('0x1d9'),_0x7d15('0x148'),_0x7d15('0x1db')));}});};};Dialer[_0x7d15('0x15')][_0x7d15('0x1dc')]=function(_0x31f8b0){var _0x5230cd=this;return function(_0x5aacfc){return new BPromise(function(_0x4679d9,_0x370e0f){_[_0x7d15('0x8e')](_0x31f8b0,_0x5aacfc[0x0]);if(checkGetDataPredictive(_0x5aacfc[0x0])){loggerPredictive[_0x7d15('0x7f')](JSON[_0x7d15('0x45')](_0x5aacfc[0x0]));if(_0x31f8b0[_0x7d15('0x1d6')]===_0x7d15('0x1c9')){return _0x5230cd[_0x7d15('0xc9')](_0x31f8b0['id'])[_0x7d15('0x3a')](function(_0x4eceac){var _0x31dc91=_0x31f8b0[_0x7d15('0x4d')]-_0x4eceac[0x0]['outboundQueuePauses'];var _0x30cd90=_0x31f8b0[_0x7d15('0x1c7')]*0x3c;var _0x588166=_0x5aacfc[0x0]['predictiveIntervalAvgTalktime']+_0x5aacfc[0x0][_0x7d15('0x67')];var _0x19b6b1=(_0x5aacfc[0x0]['predictiveIntervalAnsweredCalls']+_0x5aacfc[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5aacfc[0x0][_0x7d15('0x69')])/_0x5aacfc[0x0][_0x7d15('0x71')];var _0x1664e5=_0x31f8b0[_0x7d15('0x1c0')]/0x64;_0x31f8b0[_0x7d15('0x6f')]=_0x4eceac[0x0]['outboundQueuePauses']||0x0;_0x31f8b0['predictiveIntervalHitRate']=_0x19b6b1>0x0?_0x19b6b1:0x1;return _0x5230cd[_0x7d15('0x1d7')](_0x31dc91,_0x30cd90,_0x588166,_0x19b6b1,_0x1664e5);})['then'](function(_0x2c2594){return _0x4679d9(_0x2c2594);})[_0x7d15('0xb5')](function(_0x16b855){return _0x370e0f(msgResponse(_0x7d15('0x1dd'),_0x7d15('0x148'),JSON[_0x7d15('0x45')](_0x16b855)));});}if(_0x31f8b0[_0x7d15('0x1d6')]===_0x7d15('0x1de')){return _0x5230cd['getVoiceQueueRtPauses'](_0x31f8b0['id'])[_0x7d15('0x3a')](function(_0x4480ac){var _0x5e0d6c=_0x31f8b0[_0x7d15('0x4d')]-_0x4480ac[0x0][_0x7d15('0x1df')];var _0x41e278=_0x31f8b0[_0x7d15('0x1c7')]*0x3c;var _0x7cad70=_0x5aacfc[0x0][_0x7d15('0x68')]+_0x5aacfc[0x0][_0x7d15('0x67')];var _0x486b5b=(_0x5aacfc[0x0][_0x7d15('0x83')]+_0x5aacfc[0x0][_0x7d15('0x6a')]+_0x5aacfc[0x0][_0x7d15('0x69')])/_0x5aacfc[0x0][_0x7d15('0x71')];var _0xdc8222=_0x31f8b0[_0x7d15('0x1c0')]/0x64;_0x31f8b0['predictiveIntervalPauses']=_0x4480ac[0x0][_0x7d15('0x1df')]||0x0;_0x31f8b0[_0x7d15('0x6d')]=_0x486b5b>0x0?_0x486b5b:0x1;return _0x5230cd[_0x7d15('0x1d8')](_0x5e0d6c,_0x41e278,_0x7cad70,_0x486b5b,_0xdc8222);})[_0x7d15('0x3a')](function(_0x4b78ce){return _0x4679d9(_0x4b78ce);})[_0x7d15('0xb5')](function(_0x3a6bd9){return _0x370e0f(msgResponse(_0x7d15('0x1dd'),_0x7d15('0x148'),JSON[_0x7d15('0x45')](_0x3a6bd9)));});}}else{return _0x370e0f(msgResponse('[getDataPredictive]',_0x7d15('0x148'),_0x7d15('0x1db')));}});};};Dialer['prototype'][_0x7d15('0x1cf')]=function(_0x37aed3){var _0x280d04=this;return function(){var _0xda1f34=0x0;var _0x24c133=Math[_0x7d15('0x1c3')](_0x37aed3[_0x7d15('0x8b')]*0x3e8);if(_0x24c133>0x0){_0x24c133=_0x24c133<0x64?0x64:_0x24c133;loggerPredictive['info'](_0x37aed3[_0x7d15('0x3c')],_0x7d15('0x1e0'),_0x24c133,_0x7d15('0x46'));_0x37aed3[_0x7d15('0x91')]=setInterval(function(){_0x280d04[_0x7d15('0x91')](_0x37aed3);loggerPredictiveCalls[_0x7d15('0x7f')]('[handlePredictive]',_0xda1f34+=0x1);},_0x24c133);}else{loggerPredictive[_0x7d15('0x7f')](_0x37aed3['name'],_0x7d15('0x1e1'));}};};Dialer[_0x7d15('0x15')]['checkContactBlack']=function(_0x25b720,_0x304e7c){var _0x19180e=this;return function(_0x1a478a){if(_['isEmpty'](_0x1a478a)){if(_[_0x7d15('0xab')](_0x304e7c[_0x7d15('0xd5')])||!_0x304e7c['recallme']){if(_0x25b720[_0x7d15('0x159')]==='booked'){_0x25b720[_0x7d15('0x135')]=_[_0x7d15('0x86')](_0x25b720[_0x7d15('0x135')])?!![]:_0x25b720[_0x7d15('0x135')];var _0x516dbc=uuid['v4']();_0x19180e[_0x7d15('0x1f')][_0x516dbc]=new Action(_0x25b720,_0x304e7c,_0x516dbc);loggerBooked[_0x7d15('0x7f')](_0x7d15('0x1e2'),_0x516dbc,'queueStatusComplete:\x20',JSON[_0x7d15('0x45')](_0x25b720[_0x7d15('0x135')]),_0x7d15('0x1e3'),_0x25b720[_0x7d15('0x3c')]);if(_0x25b720[_0x7d15('0x135')]){_0x25b720[_0x7d15('0x135')]=![];_0x19180e['queueBooked'][_0x19180e[_0x7d15('0x1f')][_0x516dbc]['queue']]=[];ami['Action']({'actionid':_0x516dbc,'action':_0x7d15('0x1e4'),'queue':_0x25b720[_0x7d15('0x3c')]})[_0x7d15('0xb5')](function(){_0x19180e[_0x7d15('0xb3')](_0x25b720);_0x19180e[_0x7d15('0x104')]({'active':![],'ContactId':_0x19180e[_0x7d15('0x1f')][_0x516dbc][_0x7d15('0x10a')],'ListId':_0x19180e['actions'][_0x516dbc][_0x7d15('0x107')],'VoiceQueueId':_0x19180e[_0x7d15('0x1f')][_0x516dbc][_0x7d15('0xd6')]||undefined,'CampaignId':_0x19180e[_0x7d15('0x1f')][_0x516dbc][_0x7d15('0xd7')]||undefined})['catch'](loggerCatch(_0x7d15('0x1e5')));delete _0x19180e['actions'][_0x516dbc];});}else{loggerBooked[_0x7d15('0x7f')]('[booked][checkContactBlack][else]',JSON[_0x7d15('0x45')](_0x25b720[_0x7d15('0x135')]),_0x7d15('0x1e3'),_0x25b720[_0x7d15('0x3c')]);_0x19180e[_0x7d15('0xb3')](_0x25b720);_0x19180e[_0x7d15('0x104')]({'active':![],'ContactId':_0x19180e['actions'][_0x516dbc]['ContactId'],'ListId':_0x19180e[_0x7d15('0x1f')][_0x516dbc][_0x7d15('0x107')],'VoiceQueueId':_0x19180e[_0x7d15('0x1f')][_0x516dbc][_0x7d15('0xd6')]||undefined,'CampaignId':_0x19180e['actions'][_0x516dbc][_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x1e5')));delete _0x19180e[_0x7d15('0x1f')][_0x516dbc];}}else{return _0x19180e[_0x7d15('0x16c')](_0x25b720,_0x304e7c);}}else{if(getDiff(_0x304e7c[_0x7d15('0x1e6')])<_0x25b720['dialRecallMeTimeout']*0x3c){if(_0x304e7c[_0x7d15('0x160')]&&!_0x304e7c[_0x7d15('0x160')][_0x7d15('0x1e7')]){_0x19180e[_0x7d15('0x1a')][_0x7d15('0x137')](_0x304e7c['id'])[_0x7d15('0x18')](function(){_0x19180e[_0x7d15('0xb3')](_0x25b720);});}else{_0x19180e[_0x7d15('0xc3')]({'active':![]},_0x304e7c['id'],0x1)['finally'](function(){_0x19180e[_0x7d15('0xb3')](_0x25b720);});}}else{_0x25b720['outboundReCallsDay']+=0x1;_0x19180e[_0x7d15('0xb3')](_0x25b720);if(_0x25b720[_0x7d15('0x1e8')]){_0x19180e['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x304e7c[_0x7d15('0x10a')],'ListId':_0x304e7c['ListId'],'VoiceQueueId':_0x304e7c['VoiceQueueId']||undefined,'CampaignId':_0x304e7c[_0x7d15('0xd7')]||undefined})[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x1e9')));_0x19180e['createHistory'](createObjHistory(_0x25b720,_0x304e7c,_0x7d15('0x1ea'),0x17,'RecallInQueue'))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0x1eb')));}else{_0x19180e[_0x7d15('0xd3')](createObjHistory(_0x25b720,_0x304e7c,'RECALLFAILEDTIMEOUT',0x16,_0x7d15('0x1ec')),_0x7d15('0x1ed'),'[Originate][HistoryRecallClose]');}}}}else{_0x25b720[_0x7d15('0x5c')]+=0x1;_0x19180e[_0x7d15('0xd3')](createObjHistory(_0x25b720,_0x304e7c,'BLACKLIST',0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x7d15('0x1ee'));throw'inBlackList';}};};Dialer[_0x7d15('0x15')][_0x7d15('0x162')]=function(_0x20d7ed){var _0x1eed52=this;var _0x43def8=_0x20d7ed[_0x7d15('0x1ef')]-_0x20d7ed[_0x7d15('0x72')]-_0x20d7ed['temp'];emitCampaignSummary(_0x20d7ed);if(_0x43def8>0x0){if(_0x43def8>this[_0x7d15('0x1e')]){_0x43def8=this['maxNumberOriginate'];}_0x20d7ed[_0x7d15('0xc5')]+=_0x43def8;this[_0x7d15('0xc7')](_0x20d7ed['id'],_0x43def8,_0x20d7ed[_0x7d15('0x1f0')],_0x20d7ed)['then'](function(_0x18dc6e){_0x20d7ed[_0x7d15('0xc5')]-=_0x43def8;_0x20d7ed[_0x7d15('0xc5')]=_0x20d7ed[_0x7d15('0xc5')]>0x0?_0x20d7ed['temp']:0x0;if(!checkContactEmpty(_0x18dc6e)){_0x20d7ed['message']=_0x7d15('0x9e');logger[_0x7d15('0x7f')](_0x7d15('0x1f1')+_0x20d7ed['name']);}else{_0x20d7ed[_0x7d15('0x72')]+=_0x18dc6e[_0x7d15('0x98')];_0x20d7ed['message']=_0x7d15('0x1f2');for(var _0x4cbed5=0x0;_0x4cbed5<_0x18dc6e[_0x7d15('0x98')];_0x4cbed5+=0x1){_0x20d7ed[_0x7d15('0x1f3')]+=0x1;if(_['isNil'](_0x18dc6e[_0x4cbed5])||_[_0x7d15('0xab')](_0x18dc6e[_0x4cbed5][_0x7d15('0x183')])||_[_0x7d15('0xab')](_0x18dc6e[_0x4cbed5][_0x7d15('0x170')])){_0x1eed52[_0x7d15('0xd2')]('[actionOriginate]\x20',_0x20d7ed,_0x18dc6e[_0x4cbed5]);}else{_0x1eed52[_0x7d15('0xbe')](_[_0x7d15('0xd4')](_0x18dc6e[_0x4cbed5],[_0x7d15('0xd7'),'Contact.phone']))[_0x7d15('0x3a')](_0x1eed52['checkContactBlack'](_0x20d7ed,_0x18dc6e[_0x4cbed5]))[_0x7d15('0xb5')](_0x1eed52[_0x7d15('0xd1')]('[actionOriginateIvr]\x20',_0x20d7ed));}}}})[_0x7d15('0xb5')](loggerGetContactDialer(_0x7d15('0x1f4'),_0x20d7ed,_0x43def8));}};Dialer['prototype'][_0x7d15('0x15a')]=function(_0x17aef0,_0x4814d5){var _0x1007db=this;var _0x106e26=[];var _0x3164df=_0x4814d5>=0x1?_0x4814d5:0x1;if(_0x17aef0[_0x7d15('0x159')]===_0x7d15('0x5')){_0x3164df=0x1;}var _0x32c83a=Math['floor'](_0x17aef0[_0x7d15('0x4c')]*_0x3164df)-_0x17aef0[_0x7d15('0x72')]-_0x17aef0[_0x7d15('0xc5')];emitVoiceQueueSummary(_0x17aef0);if(_0x17aef0[_0x7d15('0x1f5')]>0x0){var _0x1db0ec=_0x17aef0[_0x7d15('0x1f5')]-_0x17aef0[_0x7d15('0x72')]-_0x17aef0[_0x7d15('0x51')]-_0x17aef0[_0x7d15('0xc5')]-_0x17aef0[_0x7d15('0x4e')];if(_0x32c83a>_0x1db0ec){_0x32c83a=_0x1db0ec;}}if(_0x32c83a>0x0){if(_0x17aef0[_0x7d15('0x159')]===_0x7d15('0x5')){_0x32c83a=0x1;}if(_0x32c83a>this['maxNumberOriginate']){_0x32c83a=this['maxNumberOriginate'];}_0x17aef0[_0x7d15('0xc5')]+=_0x32c83a;for(var _0x233c74 in this['agents']){if(typeof this[_0x7d15('0x1c')][_0x233c74]!==_0x7d15('0x99')){if(this['agents'][_0x233c74][_0x7d15('0xe8')]===_0x7d15('0x1f6')&&this[_0x7d15('0x1c')][_0x233c74][_0x7d15('0xad')]==='reachable'){_0x106e26[_0x7d15('0x134')](this[_0x7d15('0x1c')][_0x233c74]['id']);}}}this[_0x7d15('0xc4')](_0x17aef0['id'],_0x106e26,_0x32c83a,_0x17aef0['dialOrderByScheduledAt'],_0x17aef0)[_0x7d15('0x3a')](function(_0x2dd55c){_0x17aef0[_0x7d15('0xc5')]-=_0x32c83a;_0x17aef0[_0x7d15('0xc5')]=_0x17aef0['temp']>0x0?_0x17aef0[_0x7d15('0xc5')]:0x0;if(!checkContactEmpty(_0x2dd55c)){_0x1007db[_0x7d15('0x1f7')](_0x17aef0)['then'](sendMessageReschedule(_0x17aef0))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xb6')));}else{_0x17aef0[_0x7d15('0x72')]+=_0x2dd55c[_0x7d15('0x98')];_0x17aef0[_0x7d15('0x3d')]=_0x17aef0[_0x7d15('0x159')]===_0x7d15('0x5')?'ACTIVE':_0x7d15('0x1f2');for(var _0x3d27e3=0x0;_0x3d27e3<_0x2dd55c[_0x7d15('0x98')];_0x3d27e3+=0x1){if(_[_0x7d15('0xab')](_0x2dd55c[_0x3d27e3])||_[_0x7d15('0xab')](_0x2dd55c[_0x3d27e3][_0x7d15('0x183')])||_[_0x7d15('0xab')](_0x2dd55c[_0x3d27e3][_0x7d15('0x170')])){_0x1007db[_0x7d15('0xd2')](_0x7d15('0x1f8'),_0x17aef0,_0x2dd55c[_0x3d27e3]);}else{_0x1007db[_0x7d15('0xb7')](_['pick'](_0x2dd55c[_0x3d27e3],[_0x7d15('0xd6'),_0x7d15('0x1f9')]))['then'](_0x1007db['checkContactBlack'](_0x17aef0,_0x2dd55c[_0x3d27e3]))['catch'](_0x1007db['loggerHandler'](_0x7d15('0x1f8'),_0x17aef0));}}}})['catch'](loggerGetContactDialer(_0x7d15('0x1fa'),_0x17aef0,_0x32c83a));}};Dialer[_0x7d15('0x15')][_0x7d15('0x91')]=function(_0x517193){if(_0x517193['dialLimitQueue']>0x0){var _0x118ea4=_0x517193['dialLimitQueue']-_0x517193[_0x7d15('0x72')]-_0x517193[_0x7d15('0x51')];if(_0x118ea4>0x0){this[_0x7d15('0x1fb')](_0x517193);}else{loggerPredictiveCalls[_0x7d15('0x7f')](_0x7d15('0x1fc'));}}else{this[_0x7d15('0x1fb')](_0x517193);}};Dialer[_0x7d15('0x15')][_0x7d15('0x1fb')]=function(_0x288903){var _0x38c3ce=this;var _0xd2f7f9=[];_0x288903[_0x7d15('0x72')]+=0x1;for(var _0x141854 in this['agents']){if(typeof this[_0x7d15('0x1c')][_0x141854]!==_0x7d15('0x99')){if(this['agents'][_0x141854][_0x7d15('0xe8')]===_0x7d15('0x1f6')&&this['agents'][_0x141854]['status']===_0x7d15('0xdf')){_0xd2f7f9[_0x7d15('0x134')](this[_0x7d15('0x1c')][_0x141854]['id']);}}}this[_0x7d15('0xc4')](_0x288903['id'],_0xd2f7f9,0x1,_0x288903['dialOrderByScheduledAt'],_0x288903)['then'](function(_0x21fece){if(!checkContactEmpty(_0x21fece)){checkContactLowerLimitOriginate(_0x288903,0x1,0x0);_0x38c3ce['countReScheduled'](_0x288903)[_0x7d15('0x3a')](sendMessageReschedule(_0x288903))[_0x7d15('0xb5')](loggerCatch(_0x7d15('0xb6')));}else{_0x288903[_0x7d15('0x3d')]=_0x7d15('0x1f2');if(_[_0x7d15('0xab')](_0x21fece[0x0])||_[_0x7d15('0xab')](_0x21fece[0x0][_0x7d15('0x183')])||_[_0x7d15('0xab')](_0x21fece[0x0][_0x7d15('0x170')])){_0x38c3ce[_0x7d15('0xd2')](_0x7d15('0x1f8'),_0x288903,_0x21fece[0x0]);}else{_0x38c3ce[_0x7d15('0xb7')](_['pick'](_0x21fece[0x0],['VoiceQueueId',_0x7d15('0x1f9')]))[_0x7d15('0x3a')](_0x38c3ce[_0x7d15('0x1fd')](_0x288903,_0x21fece[0x0]))[_0x7d15('0xb5')](_0x38c3ce[_0x7d15('0xd1')](_0x7d15('0x1fe'),_0x288903));}}})[_0x7d15('0xb5')](loggerGetContactDialer(_0x7d15('0x1ff'),_0x288903,0x1));emitVoiceQueueSummary(_0x288903);};Dialer[_0x7d15('0x15')][_0x7d15('0x1d7')]=function(_0x27a5da,_0x131617,_0x12a209,_0x16e851,_0x2ed5af,_0x50ca9c){loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x200'));loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x201'),_0x27a5da);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x202'),_0x131617);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x203'),_0x12a209);loggerPredictive[_0x7d15('0x7f')]('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',_0x16e851);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x204'),_0x2ed5af);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x85'));return new BPromise(function(_0x5e2e4c,_0x1ba377){if(_0x27a5da<=0x0||isNaN(_0x27a5da)){return _0x1ba377(msgResponse(_0x7d15('0x205'),'Error','m\x20=\x20'+_0x27a5da));}if(_0x12a209<=0x0||isNaN(_0x12a209)){return _0x1ba377(msgResponse(_0x7d15('0x205'),_0x7d15('0x44'),'Ts\x20=\x20'+_0x12a209));}if(_0x16e851<=0x0||isNaN(_0x16e851)){return _0x1ba377(msgResponse('[abandonmentRate]',_0x7d15('0x44'),'p\x20=\x20'+_0x16e851));}if(_0x131617<=0x0||isNaN(_0x131617)){return _0x1ba377(msgResponse(_0x7d15('0x205'),_0x7d15('0x44'),'interval\x20=\x20'+_0x131617));}if(_0x2ed5af<=0x0||isNaN(_0x2ed5af)){return _0x1ba377(msgResponse('[abandonmentRate]',_0x7d15('0x44'),_0x7d15('0x206')+_0x2ed5af));}_0x50ca9c=_0x50ca9c||0x0;var _0x3dd183=0x1/_0x12a209;var _0x576242=0x0;var _0x2363d3=0x0;var _0x13fbef=0x0;var _0x4404d0=0x0;for(var _0x17c91f=0x0;_0x13fbef<_0x2ed5af;_0x17c91f+=0x1){_0x2363d3=_0x17c91f/_0x131617;_0x576242=(_0x16e851*_0x2363d3+_0x50ca9c)/_0x3dd183;_0x13fbef=erlangb(_0x576242,_0x27a5da);_0x4404d0=_0x576242/_0x27a5da*(0x1-erlangb(_0x576242,_0x27a5da));}return _0x5e2e4c({'erlangCalls':_0x17c91f,'erlangCallToSecond':_0x131617/_0x17c91f,'erlangAbandonmentRate':_0x13fbef,'erlangBusyFactor':_0x4404d0});});};Dialer[_0x7d15('0x15')][_0x7d15('0x1d8')]=function(_0x356d5a,_0x1fd35e,_0x3c90c3,_0x319e93,_0x299899,_0x5056ff){loggerPredictive['info'](_0x7d15('0x207'));loggerPredictive['info']('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',_0x356d5a);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x202'),_0x1fd35e);loggerPredictive[_0x7d15('0x7f')](_0x7d15('0x203'),_0x3c90c3);loggerPredictive['info'](_0x7d15('0x208'),_0x319e93);loggerPredictive[_0x7d15('0x7f')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x299899);loggerPredictive[_0x7d15('0x7f')]('---------------------------');return new BPromise(function(_0x47226d,_0x4b2802){if(_0x356d5a<=0x0||isNaN(_0x356d5a)){return _0x4b2802(msgResponse(_0x7d15('0x209'),'Error',_0x7d15('0x20a')+_0x356d5a));}if(_0x3c90c3<=0x0||isNaN(_0x3c90c3)){return _0x4b2802(msgResponse(_0x7d15('0x209'),_0x7d15('0x44'),_0x7d15('0x20b')+_0x3c90c3));}if(_0x319e93<=0x0||isNaN(_0x319e93)){return _0x4b2802(msgResponse('[busyFactor]',_0x7d15('0x44'),_0x7d15('0x20c')+_0x319e93));}if(_0x1fd35e<=0x0||isNaN(_0x1fd35e)){return _0x4b2802(msgResponse(_0x7d15('0x209'),_0x7d15('0x44'),_0x7d15('0x20d')+_0x1fd35e));}if(_0x299899<=0x0||isNaN(_0x299899)){return _0x4b2802(msgResponse('[busyFactor]','Error',_0x7d15('0x20e')+_0x299899));}_0x5056ff=_0x5056ff||0x0;var _0x10deb0=0x1/_0x3c90c3;var _0x5cfe48=0x0;var _0x46a013=0x0;var _0x1f8dbe=0x0;var _0x44a163=0x0;for(var _0x29cd7c=0x0;_0x44a163<_0x299899;_0x29cd7c+=0x1){_0x46a013=_0x29cd7c/_0x1fd35e;_0x5cfe48=(_0x319e93*_0x46a013+_0x5056ff)/_0x10deb0;_0x1f8dbe=erlangb(_0x5cfe48,_0x356d5a);_0x44a163=_0x5cfe48/_0x356d5a*(0x1-erlangb(_0x5cfe48,_0x356d5a));}return _0x47226d({'erlangCalls':_0x29cd7c,'erlangCallToSecond':_0x1fd35e/_0x29cd7c,'erlangAbandonmentRate':_0x1f8dbe,'erlangBusyFactor':_0x44a163});});};module[_0x7d15('0x20f')]=Dialer;
\ No newline at end of file
+var _0x37f9=['then','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','originated','erlangAbandonmentRate','startPredictive','Trunk','active','callerid','md5','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Answered\x20Calls:\x20\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','---------------------------','predictiveIntervalTotalCalls','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\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','erlangBusyFactor','merge','diff','clearing\x20variable\x20start\x20predictive','handlePredictive','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','error','stack','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','loopClearZombieChannels','clearZombieChannels','uniqueId','[actions]','isNil','Action','status','channel','catch','updateOriginated','[Dialer][checkChannel]','campaigns','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','dialAMDActive','value','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countbusyretry','countnosuchnumberretry','countdropretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','[rescheduleContact][Machine]','HANGUP','HangupInAMD','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','responsetime','dialQueueTimeout','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','roundrobin','locked','stateinterface','queueBooked','push','pick','paused','queueStatusComplete','[booked][unlockQueueStatus]','preview','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','handlePower','power','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','loggedIn','dialGlobalInterval','dialTimezone','dialPreviewRecallmeReminder','checkPreviewRecallReminder','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','xcally-motion-dialer','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-CAMPAIGNID','tags','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','custom:agentnosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','predictiveIntervalAnsweredCalls','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','erlangCallToSecond','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\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','Amax:\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','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','prototype','enqueue','tail','sequence','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns'];(function(_0x4c41d4,_0x3214e6){var _0x42dc73=function(_0x14ac51){while(--_0x14ac51){_0x4c41d4['push'](_0x4c41d4['shift']());}};_0x42dc73(++_0x3214e6);}(_0x37f9,0x1e8));var _0x937f=function(_0x57618a,_0x2ceb9a){_0x57618a=_0x57618a-0x0;var _0x9b4cbf=_0x37f9[_0x57618a];return _0x9b4cbf;};'use strict';var util=require(_0x937f('0x0'));var _=require(_0x937f('0x1'));var BPromise=require(_0x937f('0x2'));var uuid=require(_0x937f('0x3'));var moment=require(_0x937f('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x937f('0x5'));var ut=require('../preview/util/util');var config=require(_0x937f('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x937f('0x7'))(_0x937f('0x8'));var loggerPredictive=require(_0x937f('0x7'))(_0x937f('0x9'));var loggerPredictiveCalls=require(_0x937f('0x7'))(_0x937f('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require('../ami');config[_0x937f('0xb')]=_[_0x937f('0xc')](config[_0x937f('0xb')],{'host':_0x937f('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x937f('0xb')]));var cmHopper=require(_0x937f('0xe'));var cmHopperHistory=require(_0x937f('0xf'));var cmHopperBlack=require(_0x937f('0x10'));var voiceQueueRt=require(_0x937f('0x11'));var RpcSetting=require(_0x937f('0x12'));var Action=require('./action');var History=require(_0x937f('0x13'));var Final=require(_0x937f('0x14'));var AgentComplete=require(_0x937f('0x15'));var QueueCallerAbandon=require(_0x937f('0x16'));var Hangup=require(_0x937f('0x17'));var ipAgi=process[_0x937f('0x18')][_0x937f('0x19')]||'127.0.0.1';var strategy={'rrmemory':_0x937f('0x1a'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x937f('0x1b')][_0x937f('0x1c')]=function(_0x5730c8){this['tail']=this[_0x937f('0x1d')]?this[_0x937f('0x1d')]['finally'](_0x5730c8):_0x5730c8();};function Dialer(_0x30482e,_0x5495c7){this[_0x937f('0x1e')]=new Sequence();this['preview']=_0x5495c7;this[_0x937f('0x1f')]=_0x30482e[_0x937f('0x1f')];this['campaigns']=_0x30482e['campaigns'];this['agents']=_0x30482e[_0x937f('0x20')];this['trunks']=_0x30482e[_0x937f('0x21')];this[_0x937f('0x22')]=config[_0x937f('0x22')]||0x2;this[_0x937f('0x23')]={};this[_0x937f('0x24')]={};this['contactsId']={};this['uniqueId']={};this[_0x937f('0x25')]={};this['startPredictive']={};this[_0x937f('0x26')]={};this[_0x937f('0x27')]={};this['queueBooked']={};this[_0x937f('0x28')]={};ami['on'](_0x937f('0x29'),this[_0x937f('0x2a')][_0x937f('0x2b')](this));ami['on'](_0x937f('0x2c'),this[_0x937f('0x2d')][_0x937f('0x2b')](this));ami['on']('originateresponse',this[_0x937f('0x2e')]['bind'](this));ami['on'](_0x937f('0x2f'),this['syncAgentComplete']['bind'](this));ami['on'](_0x937f('0x30'),this[_0x937f('0x31')]['bind'](this));ami['on'](_0x937f('0x32'),this[_0x937f('0x33')][_0x937f('0x2b')](this));ami['on'](_0x937f('0x34'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0x937f('0x35')][_0x937f('0x2b')](this));ami['on'](_0x937f('0x36'),this[_0x937f('0x37')][_0x937f('0x2b')](this));ami['on'](_0x937f('0x38'),this[_0x937f('0x39')][_0x937f('0x2b')](this));this[_0x937f('0x3a')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0x937f('0x3b')](function(_0x541315){previewRecallmeReminderInterval=_0x541315['previewRecallmeReminderInterval'];});}function isNotNull(_0x22a91c){return _0x22a91c!==null&&!_[_0x937f('0x3c')](_0x22a91c);}function checkIsLoggedIn(_0x334155,_0xea9cf1){return function(){if(_0xea9cf1<=0x0){_0x334155[_0x937f('0x3d')]=_0x937f('0x3e');throw _0x334155[_0x937f('0x3f')]+_0x937f('0x40');}};}function isActive(_0x4680dc){return _0x4680dc;}function checkIsActive(_0x1b5f0b,_0x177a82){return function(){if(!isActive(_0x177a82)){_0x1b5f0b[_0x937f('0x3d')]=_0x937f('0x41');throw _0x1b5f0b['name']+'\x20NOT\x20Active';}};}function checkInterval(_0xf3e909){return function(){if(!isNotNull(_0xf3e909[_0x937f('0x42')])){_0xf3e909[_0x937f('0x3d')]=_0x937f('0x43');throw _0xf3e909[_0x937f('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xf3e909[_0x937f('0x42')]['Intervals'])){_0xf3e909[_0x937f('0x3d')]=_0x937f('0x43');throw _0xf3e909['name']+_0x937f('0x44');}if(!isNotNull(_['isEmpty'](_0xf3e909[_0x937f('0x42')][_0x937f('0x45')]))){_0xf3e909['message']=_0x937f('0x43');throw _0xf3e909['name']+_0x937f('0x44');}};}function msgResponse(_0x5ce4bb,_0x2914fe,_0x35ac2b){return{'action':_0x5ce4bb,'response':_0x2914fe,'message':_0x35ac2b,'stack':_0x35ac2b};}function myreject(_0x4b0317){return function(_0x505ea7){return _0x4b0317(msgResponse(_0x937f('0x46'),_0x937f('0x47'),JSON[_0x937f('0x48')](_0x505ea7)));};}function getSeconds(_0x118bea,_0x1987a2){var _0x568906=moment(_0x118bea)['milliseconds'](0x0);var _0x4fa48a=moment(_0x1987a2)[_0x937f('0x49')](0x0);return _0x568906['diff'](_0x4fa48a,_0x937f('0x4a'));}function emit(_0x11c896,_0x1b4d4c,_0x4928bf){io['to'](_0x11c896)[_0x937f('0x4b')](_0x1b4d4c,_0x4928bf);}function emitVoiceQueueSummary(_0x160732){if(_0x160732[_0x937f('0x4c')]===_0x937f('0x4d')){var _0x1f509e={'id':_0x160732['id'],'name':_0x160732[_0x937f('0x3f')],'strategy':_0x160732[_0x937f('0x4e')],'answered':_0x160732[_0x937f('0x4f')],'available':_0x160732[_0x937f('0x50')],'loggedIn':_0x160732['loggedIn'],'pTalking':_0x160732[_0x937f('0x51')],'sumBillable':_0x160732[_0x937f('0x52')],'sumDuration':_0x160732[_0x937f('0x53')],'sumHoldTime':_0x160732['sumHoldTime']||0x0,'talking':_0x160732[_0x937f('0x54')],'total':_0x160732[_0x937f('0x55')],'type':_0x160732['type'],'unmanaged':_0x160732[_0x937f('0x56')],'abandoned':_0x160732[_0x937f('0x57')],'waiting':_0x160732['waiting'],'loggedInDb':_0x160732[_0x937f('0x58')],'dialActive':_0x160732[_0x937f('0x59')],'dialMethod':_0x160732[_0x937f('0x5a')],'dialOriginateCallerIdName':_0x160732[_0x937f('0x5b')],'dialOriginateCallerIdNumber':_0x160732[_0x937f('0x5c')],'dialOriginateTimeout':_0x160732[_0x937f('0x5d')],'dialPrefix':_0x160732[_0x937f('0x5e')],'outboundAnswerAgiCallsDay':_0x160732[_0x937f('0x5f')],'outboundAnswerCallsDay':_0x160732[_0x937f('0x60')],'outboundBlacklistCallsDay':_0x160732[_0x937f('0x61')],'outboundBusyCallsDay':_0x160732[_0x937f('0x62')],'outboundCongestionCallsDay':_0x160732['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x160732['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x160732[_0x937f('0x63')],'outboundDropCallsDayTimeout':_0x160732[_0x937f('0x64')],'outboundNoAnswerCallsDay':_0x160732['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x160732['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x160732[_0x937f('0x65')],'outboundReCallsDay':_0x160732['outboundReCallsDay'],'outboundRejectCallsDay':_0x160732[_0x937f('0x66')],'outboundUnknownCallsDay':_0x160732[_0x937f('0x67')],'predictiveIntervalAnsweredCalls':_0x160732['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x160732[_0x937f('0x68')],'predictiveIntervalAvgTalktime':_0x160732[_0x937f('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x160732[_0x937f('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x160732[_0x937f('0x6b')],'predictiveIntervalErlangCalls':_0x160732[_0x937f('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x160732[_0x937f('0x6d')],'predictiveIntervalHitRate':_0x160732[_0x937f('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x160732['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x160732['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x160732[_0x937f('0x6f')],'predictiveIntervalTotalCalls':_0x160732['predictiveIntervalTotalCalls'],'message':_0x160732[_0x937f('0x3d')],'originated':_0x160732[_0x937f('0x70')],'erlangCalls':_0x160732['erlangCalls'],'erlangCallToSecond':_0x160732['erlangCallToSecond'],'erlangAbandonmentRate':_0x160732[_0x937f('0x71')],'erlangBusyFactor':_0x160732['erlangBusyFactor'],'startPredictive':_0x160732[_0x937f('0x72')],'startProgressive':_0x160732[_0x937f('0x26')]};if(_0x160732[_0x937f('0x73')]){_0x1f509e[_0x937f('0x73')]={'id':_0x160732[_0x937f('0x73')]['id'],'name':_0x160732[_0x937f('0x73')][_0x937f('0x3f')],'active':_0x160732[_0x937f('0x73')][_0x937f('0x74')],'callerid':_0x160732['Trunk'][_0x937f('0x75')]};}if(_0x160732[_0x937f('0x42')]){_0x1f509e[_0x937f('0x42')]={'id':_0x160732[_0x937f('0x42')]['id'],'name':_0x160732[_0x937f('0x42')][_0x937f('0x3f')]};}var _0x57918e=md5(JSON['stringify'](_0x1f509e));if(_0x160732[_0x937f('0x76')]!==_0x57918e){_0x160732['md5']=_0x57918e;emit(util[_0x937f('0x77')](_0x937f('0x78'),_0x1f509e[_0x937f('0x3f')]),'voice_queue:save',_0x1f509e);}}}function emitCampaignSummary(_0x39e3b5){if(_0x39e3b5['type']===_0x937f('0x79')){emit(util[_0x937f('0x77')](_0x937f('0x7a'),_0x39e3b5[_0x937f('0x3f')]),_0x937f('0x7b'),_0x39e3b5);}}function checkGetDataPredictive(_0x1752ed){if(isNotNull(_0x1752ed)&&!_['isEmpty'](_0x1752ed)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0x937f('0x7c'),_0x1752ed['predictiveIntervalTotalCalls']);loggerPredictive[_0x937f('0x7d')](_0x937f('0x7e'),_0x1752ed['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x937f('0x7d')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1752ed['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x937f('0x7d')](_0x937f('0x7f'),_0x1752ed['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x937f('0x7d')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1752ed[_0x937f('0x68')]);loggerPredictive[_0x937f('0x7d')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1752ed[_0x937f('0x69')]);loggerPredictive['info'](_0x937f('0x80'));if(_0x1752ed[_0x937f('0x81')]>0x0){if(!_[_0x937f('0x3c')](_0x1752ed[_0x937f('0x69')])&&_0x1752ed[_0x937f('0x69')]>0x0){return!![];}loggerPredictive[_0x937f('0x7d')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x937f('0x3c')](_0x1752ed['predictiveIntervalAvgHoldtime'])&&_0x1752ed['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x937f('0x7d')](_0x937f('0x82'));}else{loggerPredictive['info'](_0x937f('0x83'));}}else{loggerPredictive['info'](_0x937f('0x84'));}return![];}function mergeDataErlangB(_0x2c9cf7){return function(_0x2bb3b5){loggerPredictive[_0x937f('0x7d')](_0x937f('0x85'));loggerPredictive[_0x937f('0x7d')](_0x937f('0x86'),_0x2bb3b5[_0x937f('0x87')]);loggerPredictive[_0x937f('0x7d')](_0x937f('0x88'),_0x2bb3b5['erlangCallToSecond']);loggerPredictive[_0x937f('0x7d')](_0x937f('0x89'),_0x2bb3b5[_0x937f('0x71')]);loggerPredictive[_0x937f('0x7d')](_0x937f('0x8a'),_0x2bb3b5[_0x937f('0x8b')]);loggerPredictive[_0x937f('0x7d')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2bb3b5['erlangAbandonmentRate']);loggerPredictive[_0x937f('0x7d')](_0x937f('0x80'));_[_0x937f('0x8c')](_0x2c9cf7,_0x2bb3b5);};}function getDiff(_0x105253){var _0x21b933=moment()[_0x937f('0x49')](0x0);var _0x5ef089=moment(_0x105253)[_0x937f('0x49')](0x0);return _0x21b933[_0x937f('0x8d')](_0x5ef089,_0x937f('0x4a'));}function ifInterval(_0x15f3b7,_0x5d4abb){if(_[_0x937f('0x3c')](_0x5d4abb)){return![];}return getDiff(_0x5d4abb)<_0x15f3b7*0x3c;}function freeVariablesPredictive(_0x28b1c5){if(isNotNull(_0x28b1c5)){if(!_[_0x937f('0x3c')](_0x28b1c5['startProgressive'])){_0x28b1c5[_0x937f('0x26')]=undefined;loggerPredictive[_0x937f('0x7d')](_0x28b1c5['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x937f('0x3c')](_0x28b1c5['startPredictive'])){_0x28b1c5[_0x937f('0x72')]=undefined;loggerPredictive[_0x937f('0x7d')](_0x28b1c5[_0x937f('0x3f')],_0x937f('0x8e'));}if(!_[_0x937f('0x3c')](_0x28b1c5[_0x937f('0x8f')])){clearInterval(_0x28b1c5[_0x937f('0x8f')]);_0x28b1c5[_0x937f('0x8f')]=undefined;loggerPredictive[_0x937f('0x7d')](_0x28b1c5[_0x937f('0x3f')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x5cf5db,_0x56b9e6){if(_0x56b9e6===0x0){return 0x0;}var _0x117fd0=0x1;for(var _0x2e6a36=0x1;_0x2e6a36<=_0x56b9e6;_0x2e6a36+=0x1){_0x117fd0=0x1+_0x117fd0*_0x2e6a36/_0x5cf5db;}return 0x1/_0x117fd0;}function isVoiceQueueOutbound(_0x94df17){return _0x94df17===_0x937f('0x4d');}function isNotPreview(_0x12bcaf){return _0x12bcaf!=='preview';}function isCampaignIvr(_0x50d0d6){return _0x50d0d6==='ivr';}function getCallerId(_0x857d3b,_0xc73a03,_0x229fa6){if(!_[_0x937f('0x3c')](_0x229fa6)&&typeof _0x229fa6==='string'&&!_['isEmpty'](_0x229fa6)){if(!_[_0x937f('0x3c')](_0xc73a03)&&typeof _0xc73a03===_0x937f('0x90')&&!_[_0x937f('0x91')](_0xc73a03)){return util[_0x937f('0x77')](_0x937f('0x92'),_0xc73a03,_0x229fa6);}return util[_0x937f('0x77')]('\x22%s\x22\x20<%s>',_0x229fa6,_0x229fa6);}if(!_['isUndefined'](_0x857d3b)&&typeof _0x857d3b===_0x937f('0x90')&&!_[_0x937f('0x91')](_0x857d3b)){return _0x857d3b;}return _0x937f('0x93');}function loggerCatchQueueSummary(_0x311523,_0xc5efc1){return function(_0x1e77a6){freeVariablesPredictive(_0xc5efc1);emitVoiceQueueSummary(_0xc5efc1);emitCampaignSummary(_0xc5efc1);loggerSyncQueueSummary[_0x937f('0x94')](_0x311523,util['inspect'](_0x1e77a6,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x299e04,_0x4e206f){return function(_0x32cc7f){loggerPredictive[_0x937f('0x95')](_0x4e206f[_0x937f('0x3f')],_0x299e04);loggerPredictive[_0x937f('0x95')](_0x32cc7f[_0x937f('0x96')]);freeVariablesPredictive(_0x4e206f);};}function loggerCatch(_0x47ca89){return function(_0x54f07f){logger[_0x937f('0x95')](_0x47ca89,util[_0x937f('0x97')](_0x54f07f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x21a0cf){return _0x21a0cf&&!_[_0x937f('0x3c')](_0x21a0cf)&&_0x21a0cf[_0x937f('0x98')]>0x0;}function decremetOriginate(_0x41f21f){if(!_[_0x937f('0x3c')](_0x41f21f)&&_0x41f21f!==null){if(typeof _0x41f21f['originated']!==_0x937f('0x99')){if(_0x41f21f[_0x937f('0x70')]>0x0){_0x41f21f['originated']-=0x1;}else{logger[_0x937f('0x95')](_0x937f('0x9a'));}}}else{logger['error'](_0x937f('0x9b'));}}function checkContactLowerLimitOriginate(_0x4ac0b3,_0x19760e,_0x68f708){if(_0x19760e>_0x68f708){for(var _0x48ffbe=0x0;_0x48ffbe<_0x19760e-_0x68f708;_0x48ffbe+=0x1){decremetOriginate(_0x4ac0b3);}}}function loggerGetContactDialer(_0x1be94f,_0x23873e,_0x2d3f94){return function(_0x33125f){checkContactLowerLimitOriginate(_0x23873e,_0x2d3f94,0x0);logger[_0x937f('0x95')](_0x1be94f,util[_0x937f('0x97')](_0x33125f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3f3aea){return function(_0x559d40){if(isNotNull(_0x559d40)&&isNotNull(_0x559d40[0x0])){if(_0x559d40[0x0]['contactsRescheduled']>0x0){_0x3f3aea[_0x937f('0x3d')]=_0x937f('0x9c');logger[_0x937f('0x7d')]('[getContactDialer2][ReScheduled]'+_0x3f3aea[_0x937f('0x3f')],_0x559d40[0x0][_0x937f('0x9d')],_0x937f('0x9e'));}else{_0x3f3aea[_0x937f('0x3d')]=_0x937f('0x9f');logger[_0x937f('0x7d')]('[getContactDialer2][Empty]'+_0x3f3aea[_0x937f('0x3f')]);}}};}function notSendMessagesQueue(_0x121f38){if(_0x121f38[_0x937f('0xa0')]){freeVariablesPredictive(_0x121f38);if(_0x121f38['originated']===0x0&&_0x121f38[_0x937f('0x54')]===0x0&&_0x121f38[_0x937f('0xa1')]===0x0&&(_0x121f38[_0x937f('0x51')]||0x0)===0x0){_0x121f38[_0x937f('0xa0')]=![];_0x121f38[_0x937f('0x50')]=0x0;_0x121f38[_0x937f('0x3d')]=_0x937f('0x41');loggerSyncQueueSummary[_0x937f('0x94')](_0x937f('0xa2'),_0x121f38[_0x937f('0x3f')],_0x937f('0xa3'));}else{_0x121f38[_0x937f('0x3d')]=_0x937f('0xa4');loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x121f38[_0x937f('0x3f')],'is\x20disactive');}emitVoiceQueueSummary(_0x121f38);}}function notSendMessagesCampaign(_0x40733f){if(_0x40733f[_0x937f('0xa0')]){if(_0x40733f['originated']===0x0){_0x40733f[_0x937f('0xa0')]=![];_0x40733f['message']=_0x937f('0x41');loggerSyncQueueSummary['debug'](_0x937f('0xa5'),_0x40733f[_0x937f('0x3f')],_0x937f('0xa3'));}else{_0x40733f[_0x937f('0x3d')]=_0x937f('0xa4');loggerSyncQueueSummary['debug'](_0x937f('0xa5'),_0x40733f[_0x937f('0x3f')],_0x937f('0xa6'));}emitCampaignSummary(_0x40733f);}}function createObjHistory(_0x3ec8b9,_0x59f6e6,_0x3d8beb,_0x41ca97,_0x20f8f7){_0x3ec8b9[_0x937f('0x3d')]=_0x3d8beb;var _0x1374d8=new Action(_0x3ec8b9,_0x59f6e6);var _0x3fa1db=new History(_0x1374d8);_0x3fa1db[_0x937f('0xa7')]=_0x41ca97;_0x3fa1db[_0x937f('0xa8')]=_0x20f8f7;_0x3fa1db[_0x937f('0xa9')]=_0x1374d8[_0x937f('0xaa')];return _0x3fa1db;}Dialer['prototype'][_0x937f('0xab')]=function(){var _0x326b8b=this;setInterval(function(){_0x326b8b[_0x937f('0xac')](_0x326b8b[_0x937f('0xad')],'[uniqueid]');_0x326b8b[_0x937f('0xac')](_0x326b8b[_0x937f('0x24')],_0x937f('0xae'));},0x32c8);};Dialer[_0x937f('0x1b')][_0x937f('0xac')]=function(_0x3e3e3d,_0x280253){var _0x2ffbb9=this;for(var _0x56aa67 in _0x3e3e3d){if(typeof _0x3e3e3d[_0x56aa67]!==_0x937f('0x99')){this[_0x937f('0x1e')][_0x937f('0x1c')](function(){if(!_[_0x937f('0xaf')](_0x3e3e3d[_0x56aa67])){return ami[_0x937f('0xb0')]({'action':_0x937f('0xb1'),'channel':_0x3e3e3d[_0x56aa67][_0x937f('0xb2')]})[_0x937f('0xb3')](function(_0x492bfc){if(_0x492bfc[_0x937f('0x3d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3e3e3d[_0x56aa67]&&_0x3e3e3d[_0x56aa67]['type']!==_0x937f('0x79')){_0x2ffbb9[_0x937f('0xb4')](_0x2ffbb9[_0x937f('0x1f')][_0x3e3e3d[_0x56aa67]['queue']]);logger[_0x937f('0x95')](_0x937f('0xb5'),_0x280253,_0x56aa67,_0x3e3e3d[_0x56aa67]['queue']);delete _0x3e3e3d[_0x56aa67];}if(_0x3e3e3d[_0x56aa67]&&_0x3e3e3d[_0x56aa67][_0x937f('0x4c')]===_0x937f('0x79')){_0x2ffbb9[_0x937f('0xb4')](_0x2ffbb9[_0x937f('0xb6')][_0x3e3e3d[_0x56aa67][_0x937f('0xb7')]]);logger[_0x937f('0x95')](_0x937f('0xb8'),_0x280253,_0x56aa67,_0x3e3e3d[_0x56aa67]['queue']);delete _0x3e3e3d[_0x56aa67];}},0x2328);}});}});}}};Dialer[_0x937f('0x1b')][_0x937f('0xb9')]=function(_0x2d171d){return BPromise[_0x937f('0xba')]()[_0x937f('0x3b')](cmHopper[_0x937f('0xb9')](_0x2d171d))[_0x937f('0xb3')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x937f('0xbb')]=function(_0x29baa0){return BPromise[_0x937f('0xba')]()[_0x937f('0x3b')](cmHopperBlack[_0x937f('0xbb')](_0x29baa0))['catch'](loggerCatch(_0x937f('0xbc')));};Dialer[_0x937f('0x1b')][_0x937f('0xbd')]=function(_0xd7efa6){return BPromise[_0x937f('0xba')]()[_0x937f('0x3b')](cmHopperBlack[_0x937f('0xbd')](_0xd7efa6))[_0x937f('0xb3')](loggerCatch(_0x937f('0xbe')));};Dialer[_0x937f('0x1b')][_0x937f('0xbf')]=function(_0x15b472){return BPromise['resolve']()[_0x937f('0x3b')](cmHopperHistory[_0x937f('0xc0')](_0x15b472))[_0x937f('0xb3')](loggerCatch(_0x937f('0xc1')));};Dialer['prototype'][_0x937f('0xc2')]=function(_0x382730){return BPromise['resolve']()['then'](cmHopper[_0x937f('0xc2')](_0x382730))[_0x937f('0xb3')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0xc85a7a,_0x19f0eb,_0x1d2143){return BPromise['resolve']()[_0x937f('0x3b')](cmHopper[_0x937f('0xc3')](_0xc85a7a,_0x19f0eb,_0x1d2143))[_0x937f('0xb3')](loggerCatch(_0x937f('0xc4')));};Dialer[_0x937f('0x1b')][_0x937f('0xc5')]=function(_0x574628,_0x12bb95,_0x501340,_0x1209d5,_0x5684ae){return BPromise['resolve']()[_0x937f('0x3b')](cmHopper['getContactDialer'](_0x574628,_0x12bb95,_0x501340,_0x1209d5))['catch'](function(_0x5e9d40){_0x5684ae[_0x937f('0xc6')]-=_0x501340;_0x5684ae[_0x937f('0xc6')]=_0x5684ae[_0x937f('0xc6')]>0x0?_0x5684ae[_0x937f('0xc6')]:0x0;loggerCatch(_0x937f('0xc7'))(_0x5e9d40);});};Dialer[_0x937f('0x1b')]['getContactDialerIvr']=function(_0x23eb5f,_0x2fb2c9,_0x417845,_0x3640ff){return BPromise[_0x937f('0xba')]()[_0x937f('0x3b')](cmHopper[_0x937f('0xc8')](_0x23eb5f,_0x2fb2c9,_0x417845))[_0x937f('0xb3')](function(_0x29a9ef){_0x3640ff['temp']-=_0x2fb2c9;_0x3640ff[_0x937f('0xc6')]=_0x3640ff[_0x937f('0xc6')]>0x0?_0x3640ff[_0x937f('0xc6')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x29a9ef);});};Dialer[_0x937f('0x1b')][_0x937f('0xc9')]=function(_0x3edc04){return BPromise['resolve']()['then'](voiceQueueRt[_0x937f('0xc9')](_0x3edc04))[_0x937f('0xb3')](loggerCatch(_0x937f('0xca')));};Dialer[_0x937f('0x1b')][_0x937f('0xcb')]=function(_0x252521){return BPromise['resolve']()[_0x937f('0x3b')](cmHopper[_0x937f('0xcb')](_0x252521))[_0x937f('0xb3')](loggerCatch(_0x937f('0xcc')));};Dialer[_0x937f('0x1b')][_0x937f('0xcd')]=function(_0x18bc57){return BPromise[_0x937f('0xba')]()[_0x937f('0x3b')](cmHopperHistory[_0x937f('0xcd')](_0x18bc57))[_0x937f('0xb3')](loggerCatch(_0x937f('0xce')));};Dialer[_0x937f('0x1b')][_0x937f('0xb4')]=function(_0x5320a4){if(!_[_0x937f('0x3c')](_0x5320a4)&&_0x5320a4!==null){if(typeof _0x5320a4[_0x937f('0x70')]!==_0x937f('0x99')){if(_0x5320a4[_0x937f('0x70')]>0x0){_0x5320a4['originated']-=0x1;}else{logger[_0x937f('0x95')](_0x937f('0xcf'));}}}else{logger[_0x937f('0x95')](_0x937f('0xd0'));}};Dialer[_0x937f('0x1b')]['loggerHandler']=function(_0x1eeb88,_0x1489e3){var _0x56d7c7=this;return function(_0x36a9bc){_0x56d7c7[_0x937f('0xb4')](_0x1489e3);logger[_0x937f('0x95')](_0x1eeb88,util[_0x937f('0x97')](_0x36a9bc,{'showHidden':![],'depth':null}));};};Dialer[_0x937f('0x1b')][_0x937f('0xd1')]=function(_0x2407a5,_0xfacb69,_0x22bc07){var _0x4499ed={'state':0x19,'statedesc':_0x937f('0xd2')};this[_0x937f('0xb4')](_0xfacb69);this[_0x937f('0xd3')](_[_0x937f('0x8c')](_0x4499ed,_['pick'](_0x22bc07,[_0x937f('0xd4'),_0x937f('0xd5'),_0x937f('0xd6'),_0x937f('0xd7'),_0x937f('0xd8')])),_0x937f('0xd9'),_0x937f('0xda'));logger[_0x937f('0x95')](_0x2407a5);};Dialer['prototype'][_0x937f('0xdb')]=function(_0x438e48){return _0x438e48===_0x937f('0xdc');};Dialer[_0x937f('0x1b')][_0x937f('0xdd')]=function(_0x1ed10f){return!_['isUndefined'](_0x1ed10f)&&_0x1ed10f&&!_[_0x937f('0x3c')](_0x1ed10f[_0x937f('0x3f')])&&!_[_0x937f('0x3c')](_0x1ed10f[_0x937f('0x74')])&&_0x1ed10f[_0x937f('0x74')]&&(this[_0x937f('0x21')][util[_0x937f('0x77')](_0x937f('0xde'),_0x1ed10f[_0x937f('0x3f')])][_0x937f('0xb1')]===_0x937f('0xdf')||this[_0x937f('0x21')][util[_0x937f('0x77')]('SIP/%s',_0x1ed10f[_0x937f('0x3f')])][_0x937f('0xb1')]===_0x937f('0xe0'));};Dialer[_0x937f('0x1b')][_0x937f('0xd3')]=function(_0x13656e,_0x152781,_0x191d09){this[_0x937f('0xcd')](_0x13656e)['catch'](loggerCatch(_0x152781));this[_0x937f('0xcb')](_0x13656e)[_0x937f('0xb3')](loggerCatch(_0x191d09));};Dialer[_0x937f('0x1b')][_0x937f('0x35')]=function(_0x3febe3){var _0x531d71=this['uniqueId'][_0x3febe3[_0x937f('0xe1')]];var _0x4b8955;if(!_[_0x937f('0xaf')](_0x3febe3)&&!_[_0x937f('0xaf')](_0x3febe3[_0x937f('0xe2')])&&!_[_0x937f('0xaf')](_0x3febe3[_0x937f('0xe2')]['amdstatus'])&&_0x3febe3['exten']==='xcally-motion-dialer'&&_0x531d71){if(_0x531d71[_0x937f('0x4c')]!==_0x937f('0x79')&&this[_0x937f('0x1f')][_0x531d71[_0x937f('0xb7')]][_0x937f('0xe3')]&&_0x3febe3[_0x937f('0xe4')]==='HANGUP'){delete this[_0x937f('0xad')][_0x3febe3['uniqueid']];this['updateOriginated'](this[_0x937f('0x1f')][_0x531d71[_0x937f('0xb7')]]);this[_0x937f('0x1f')][_0x531d71[_0x937f('0xb7')]][_0x937f('0x60')]+=0x1;this['voiceQueues'][_0x531d71['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x4b8955=new Hangup(_0x531d71,_0x3febe3);_0x4b8955['state']=0x12;_0x4b8955[_0x937f('0xa8')]='HangupInAMD';_0x4b8955[_0x937f('0xe5')]=_0x937f('0xe6');ami['emit'](_0x937f('0xe7'),ut['buildObj'](_0x4b8955,_0x937f('0xe8')));this['saveInDb'](_0x4b8955,_0x937f('0xe9'),_0x937f('0xea'));}if(_0x531d71['type']!==_0x937f('0x79')&&this[_0x937f('0x1f')][_0x531d71[_0x937f('0xb7')]][_0x937f('0xe3')]&&_0x3febe3['value']===_0x937f('0xeb')){var _0x5dbd31=this;return new BPromise(function(_0x418a1f,_0xe768a4){delete _0x5dbd31[_0x937f('0xad')][_0x3febe3['uniqueid']];_0x5dbd31[_0x937f('0xb4')](_0x5dbd31[_0x937f('0x1f')][_0x531d71[_0x937f('0xb7')]]);_0x5dbd31[_0x937f('0x1f')][_0x531d71['queue']][_0x937f('0x60')]+=0x1;_0x5dbd31[_0x937f('0x1f')][_0x531d71['queue']][_0x937f('0x5f')]+=0x1;var _0x16ddef=_0x5dbd31['voiceQueues'][_0x531d71[_0x937f('0xb7')]];var _0x2a2390=new Hangup(_0x531d71,_0x3febe3);_0x2a2390[_0x937f('0xa7')]=0x13;_0x2a2390[_0x937f('0xa8')]=_0x937f('0xec');_0x2a2390['membername']='AMD';_0x2a2390[_0x937f('0xed')]+=0x1;_0x2a2390['countglobal']+=0x1;_0x2a2390[_0x937f('0xe8')]=!![];ami[_0x937f('0x4b')]('custom:amd',ut['buildObj'](_0x2a2390,_0x937f('0xe8')));_0x5dbd31[_0x937f('0xcd')](_0x2a2390)[_0x937f('0xb3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2a2390[_0x937f('0xee')]+_0x2a2390['countcongestionretry']+_0x2a2390['countnoanswerretry']+_0x2a2390[_0x937f('0xef')]+_0x2a2390[_0x937f('0xf0')]+_0x2a2390['countabandonedretry']+_0x2a2390[_0x937f('0xed')]+_0x2a2390[_0x937f('0xf1')]>=_0x16ddef['dialGlobalMaxRetry']){_0x5dbd31[_0x937f('0xf2')](_0x2a2390,_0x418a1f,_0xe768a4,_0x937f('0xf3'));}else{if(_0x2a2390['countmachineretry']>=_0x16ddef[_0x937f('0xf4')]){_0x5dbd31[_0x937f('0xf5')](_0x2a2390,_0x418a1f,_0xe768a4,_0x937f('0xf6'));}else{_0x5dbd31['rescheduleContact']({'active':![],'countmachineretry':_0x2a2390['countmachineretry'],'scheduledat':moment()[_0x937f('0xf7')](_0x16ddef['dialMachineRetryFrequency'],_0x937f('0xf8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a2390[_0x937f('0xd4')],'ListId':_0x2a2390[_0x937f('0xd5')],'VoiceQueueId':_0x2a2390[_0x937f('0xd7')]||undefined,'CampaignId':_0x2a2390[_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0xf9')));_0x418a1f({'reschedule':0x1});}}});}if(_0x531d71['type']==='ivr'&&this[_0x937f('0xb6')][_0x531d71[_0x937f('0xb7')]][_0x937f('0xe3')]&&_0x3febe3['value']===_0x937f('0xfa')){delete this[_0x937f('0xad')][_0x3febe3[_0x937f('0xe1')]];this[_0x937f('0xb4')](this['campaigns'][_0x531d71[_0x937f('0xb7')]]);_0x4b8955=new Hangup(_0x531d71,_0x3febe3);_0x4b8955[_0x937f('0xa7')]=0x12;_0x4b8955['statedesc']=_0x937f('0xfb');_0x4b8955[_0x937f('0xe5')]=_0x937f('0xe6');ami['emit'](_0x937f('0xe7'),ut[_0x937f('0xfc')](_0x4b8955,_0x937f('0xe8')));this[_0x937f('0xd3')](_0x4b8955,_0x937f('0xfd'),_0x937f('0xfe'));}if(_0x531d71[_0x937f('0x4c')]==='ivr'&&this['campaigns'][_0x531d71[_0x937f('0xb7')]][_0x937f('0xe3')]&&_0x3febe3['value']===_0x937f('0xeb')){var _0x5dbd31=this;return new BPromise(function(_0x2a8dcb,_0xc91c1c){delete _0x5dbd31[_0x937f('0xad')][_0x3febe3[_0x937f('0xe1')]];_0x5dbd31['updateOriginated'](_0x5dbd31[_0x937f('0xb6')][_0x531d71['queue']]);_0x5dbd31[_0x937f('0xb6')][_0x531d71['queue']][_0x937f('0x60')]+=0x1;_0x5dbd31[_0x937f('0xb6')][_0x531d71[_0x937f('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1af176=_0x5dbd31[_0x937f('0xb6')][_0x531d71[_0x937f('0xb7')]];var _0x8dac15=new Hangup(_0x531d71,_0x3febe3);_0x8dac15[_0x937f('0xa7')]=0x13;_0x8dac15[_0x937f('0xa8')]='Machine';_0x8dac15[_0x937f('0xe5')]='AMD';_0x8dac15[_0x937f('0xed')]+=0x1;_0x8dac15['countglobal']+=0x1;_0x8dac15[_0x937f('0xe8')]=!![];ami[_0x937f('0x4b')](_0x937f('0xe7'),ut[_0x937f('0xfc')](_0x8dac15,_0x937f('0xe8')));_0x5dbd31[_0x937f('0xcd')](_0x8dac15)['catch'](loggerCatch(_0x937f('0xff')));if(_0x8dac15[_0x937f('0xee')]+_0x8dac15[_0x937f('0x100')]+_0x8dac15[_0x937f('0x101')]+_0x8dac15['countnosuchnumberretry']+_0x8dac15['countdropretry']+_0x8dac15['countabandonedretry']+_0x8dac15[_0x937f('0xed')]+_0x8dac15[_0x937f('0xf1')]>=_0x1af176[_0x937f('0x102')]){_0x5dbd31[_0x937f('0xf2')](_0x8dac15,_0x2a8dcb,_0xc91c1c,_0x937f('0xf3'));}else{if(_0x8dac15[_0x937f('0xed')]>=_0x1af176['dialMachineMaxRetry']){_0x5dbd31[_0x937f('0xf5')](_0x8dac15,_0x2a8dcb,_0xc91c1c,_0x937f('0xf6'));}else{_0x5dbd31[_0x937f('0xc2')]({'active':![],'countmachineretry':_0x8dac15[_0x937f('0xed')],'scheduledat':moment()[_0x937f('0xf7')](_0x1af176[_0x937f('0x103')],'minutes')[_0x937f('0x77')](_0x937f('0x104')),'ContactId':_0x8dac15[_0x937f('0xd4')],'ListId':_0x8dac15['ListId'],'VoiceQueueId':_0x8dac15[_0x937f('0xd7')]||undefined,'CampaignId':_0x8dac15[_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0xf9')));_0x2a8dcb({'reschedule':0x1});}}});}}};Dialer[_0x937f('0x1b')]['syncHangup']=function(_0x22b14a){var _0x4ea736=this[_0x937f('0xad')][_0x22b14a[_0x937f('0xe1')]];var _0x25db40=this;var _0x313d9b;if(_0x4ea736&&_0x4ea736[_0x937f('0x4c')]===_0x937f('0x79')){delete this[_0x937f('0xad')][_0x22b14a[_0x937f('0xe1')]];this['updateOriginated'](this[_0x937f('0xb6')][_0x4ea736[_0x937f('0xb7')]]);this[_0x937f('0xb6')][_0x4ea736[_0x937f('0xb7')]][_0x937f('0x105')]+=0x1;_0x313d9b=new Hangup(_0x4ea736,_0x22b14a);this[_0x937f('0xcd')](_0x313d9b)['catch'](loggerCatch(_0x937f('0x106')));this['moveContactManagedDialer'](_0x313d9b)[_0x937f('0xb3')](loggerCatch(_0x937f('0x107')));}if(_0x4ea736&&_0x4ea736[_0x937f('0x4c')]!==_0x937f('0x79')&&isNotNull(this[_0x937f('0x1f')][_0x4ea736[_0x937f('0xb7')]][_0x937f('0x108')])){delete this[_0x937f('0xad')][_0x22b14a[_0x937f('0xe1')]];this[_0x937f('0xb4')](this[_0x937f('0x1f')][_0x4ea736[_0x937f('0xb7')]]);this['voiceQueues'][_0x4ea736[_0x937f('0xb7')]][_0x937f('0x60')]+=0x1;this['voiceQueues'][_0x4ea736['queue']][_0x937f('0x5f')]+=0x1;_0x313d9b=new Hangup(_0x4ea736,_0x22b14a);_0x313d9b['state']=0x10;_0x313d9b[_0x937f('0xa8')]=_0x937f('0x109');_0x313d9b[_0x937f('0xe5')]=_0x937f('0x10a');this['createHistory'](_0x313d9b)['catch'](loggerCatch(_0x937f('0x106')));this[_0x937f('0xcb')](_0x313d9b)['catch'](loggerCatch(_0x937f('0x107')));}if(_0x4ea736&&_0x4ea736[_0x937f('0x4c')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x4ea736[_0x937f('0xb7')]][_0x937f('0x108')])){delete this[_0x937f('0xad')][_0x22b14a['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x4ea736['queue']]);this[_0x937f('0x1f')][_0x4ea736[_0x937f('0xb7')]]['outboundUnknownCallsDay']+=0x1;_0x313d9b=new Hangup(_0x4ea736,_0x22b14a);_0x313d9b[_0x937f('0xa7')]=0xc;_0x313d9b[_0x937f('0xa8')]=_0x22b14a[_0x937f('0x10b')];_0x313d9b['membername']=_0x937f('0x10c');this[_0x937f('0xcd')](_0x313d9b)[_0x937f('0xb3')](loggerCatch(_0x937f('0x106')));this['moveContactManagedDialer'](_0x313d9b)[_0x937f('0xb3')](loggerCatch(_0x937f('0x107')));}};Dialer['prototype']['syncAgentComplete']=function(_0x54f445){var _0x359202=this[_0x937f('0xad')][_0x54f445[_0x937f('0xe1')]];var _0x4a49d3=this;if(this['voiceQueues'][_0x54f445['queue']]){if(_0x359202&&_0x359202[_0x937f('0x4c')]!==_0x937f('0x79')){delete this[_0x937f('0xad')][_0x54f445['uniqueid']];this[_0x937f('0x1f')][_0x54f445['queue']][_0x937f('0x60')]+=0x1;var _0x28c80b=new AgentComplete(_0x359202,_0x54f445);if(_0x54f445[_0x937f('0x10d')]==='agent'){_0x28c80b[_0x937f('0x10e')]=this[_0x937f('0x1f')][_0x54f445[_0x937f('0xb7')]][_0x937f('0x10f')]&&this[_0x937f('0x1f')][_0x54f445[_0x937f('0xb7')]][_0x937f('0x110')]?moment()['format'](_0x937f('0x104')):undefined;}this[_0x937f('0xcd')](_0x28c80b)[_0x937f('0xb3')](loggerCatch(_0x937f('0x111')));this[_0x937f('0xcb')](_0x28c80b)[_0x937f('0xb3')](loggerCatch(_0x937f('0x112')));}}};Dialer[_0x937f('0x1b')]['syncAgentConnect']=function(_0x1c05be){if(this['voiceQueues'][_0x1c05be[_0x937f('0xb7')]]){if(this[_0x937f('0xad')][_0x1c05be[_0x937f('0xe1')]]&&this[_0x937f('0xad')][_0x1c05be[_0x937f('0xe1')]]['type']!==_0x937f('0x79')){this[_0x937f('0xb4')](this[_0x937f('0x1f')][_0x1c05be[_0x937f('0xb7')]]);this['uniqueId'][_0x1c05be[_0x937f('0xe1')]][_0x937f('0x113')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x937f('0x1b')][_0x937f('0x114')]=function(_0xd40642){this[_0x937f('0xcd')](_0xd40642)[_0x937f('0xb3')](loggerCatch(_0x937f('0x111')));this[_0x937f('0xcb')](_0xd40642)['catch'](loggerCatch(_0x937f('0x115')));};Dialer['prototype'][_0x937f('0x2d')]=function(_0x439acd){var _0x31dae5=this[_0x937f('0xad')][_0x439acd[_0x937f('0xe1')]];var _0x42c277=this;if(this[_0x937f('0x1f')][_0x439acd[_0x937f('0xb7')]]){if(_0x31dae5&&_0x31dae5[_0x937f('0x4c')]!=='ivr'){delete this[_0x937f('0xad')][_0x439acd['uniqueid']];this['updateOriginated'](this[_0x937f('0x1f')][_0x439acd[_0x937f('0xb7')]]);_0x31dae5['droptime']=moment()[_0x937f('0x77')](_0x937f('0x104'));var _0x1f6f83=new QueueCallerAbandon(_0x31dae5,_0x439acd);if(getSeconds(_0x31dae5['droptime'],_0x31dae5[_0x937f('0x116')])>=_0x31dae5[_0x937f('0x117')]){this[_0x937f('0x1f')][_0x439acd['queue']][_0x937f('0x6b')]+=0x1;this[_0x937f('0x1f')][_0x439acd[_0x937f('0xb7')]][_0x937f('0x64')]+=0x1;this[_0x937f('0x1f')][_0x439acd['queue']][_0x937f('0x6d')]+=0x1;_0x1f6f83['state']=0xa;_0x1f6f83['statedesc']='Drop';_0x1f6f83[_0x937f('0x118')]='TIMEOUT';_0x1f6f83[_0x937f('0x10e')]=this[_0x937f('0x1f')][_0x439acd['queue']][_0x937f('0x10f')]?moment()[_0x937f('0x77')](_0x937f('0x104')):undefined;_0x1f6f83['countdropretry']+=0x1;_0x1f6f83['countglobal']+=0x1;if(_0x1f6f83[_0x937f('0xf0')]>=this[_0x937f('0x1f')][_0x439acd['queue']][_0x937f('0x119')]){this[_0x937f('0x114')](_0x1f6f83);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1f6f83['countdropretry'],'scheduledat':moment()[_0x937f('0xf7')](this['voiceQueues'][_0x439acd[_0x937f('0xb7')]][_0x937f('0x11a')],_0x937f('0xf8'))[_0x937f('0x77')](_0x937f('0x104')),'ContactId':_0x31dae5['ContactId'],'ListId':_0x31dae5[_0x937f('0xd5')],'VoiceQueueId':_0x31dae5[_0x937f('0xd7')]||undefined,'CampaignId':_0x31dae5['CampaignId']||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x11b')));var _0x4daf8e=new History(_0x1f6f83);_0x4daf8e[_0x937f('0xa7')]=0xa;_0x4daf8e['statedesc']='Drop';_0x4daf8e[_0x937f('0xaa')]=moment()['format'](_0x937f('0x104'));_0x4daf8e[_0x937f('0xa9')]=_0x4daf8e[_0x937f('0xaa')];_0x4daf8e[_0x937f('0x11c')]=_0x1f6f83['calleridname'];_0x4daf8e[_0x937f('0x11d')]=_0x1f6f83['calleridnum'];this[_0x937f('0xcd')](_0x4daf8e)[_0x937f('0xb3')](loggerCatch(_0x937f('0x11e')));}}else{this[_0x937f('0x1f')][_0x439acd[_0x937f('0xb7')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x937f('0x1f')][_0x439acd['queue']][_0x937f('0x63')]+=0x1;_0x1f6f83[_0x937f('0xa7')]=0xb;_0x1f6f83[_0x937f('0xa8')]=_0x937f('0x11f');_0x1f6f83['dropreason']=_0x937f('0x120');_0x1f6f83[_0x937f('0x121')]+=0x1;_0x1f6f83[_0x937f('0x122')]+=0x1;if(_0x1f6f83[_0x937f('0x121')]>=this[_0x937f('0x1f')][_0x439acd[_0x937f('0xb7')]][_0x937f('0x123')]){this[_0x937f('0x114')](_0x1f6f83);}else{this[_0x937f('0xc2')]({'active':![],'countabandonedretry':_0x1f6f83['countabandonedretry'],'scheduledat':moment()[_0x937f('0xf7')](this[_0x937f('0x1f')][_0x439acd[_0x937f('0xb7')]][_0x937f('0x124')],_0x937f('0xf8'))[_0x937f('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31dae5['ContactId'],'ListId':_0x31dae5[_0x937f('0xd5')],'VoiceQueueId':_0x31dae5[_0x937f('0xd7')]||undefined,'CampaignId':_0x31dae5[_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x125')));var _0x4daf8e=new History(_0x1f6f83);_0x4daf8e[_0x937f('0xa7')]=0xb;_0x4daf8e[_0x937f('0xa8')]='Abandoned';_0x4daf8e[_0x937f('0xaa')]=moment()['format'](_0x937f('0x104'));_0x4daf8e[_0x937f('0xa9')]=_0x4daf8e['starttime'];_0x4daf8e['calleridname']=_0x1f6f83[_0x937f('0x11c')];_0x4daf8e['calleridnum']=_0x1f6f83[_0x937f('0x11d')];this['createHistory'](_0x4daf8e)[_0x937f('0xb3')](loggerCatch(_0x937f('0x126')));}}}}};Dialer[_0x937f('0x1b')][_0x937f('0x127')]=function(_0x489fcd){if(this[_0x937f('0x24')][_0x489fcd[_0x937f('0xe1')]]){this['actions'][_0x489fcd['uniqueid']][_0x937f('0xb2')]=_0x489fcd[_0x937f('0xb2')];}if(this[_0x937f('0xad')][_0x489fcd[_0x937f('0xe1')]]){this[_0x937f('0xad')][_0x489fcd[_0x937f('0xe1')]][_0x937f('0xb2')]=_0x489fcd[_0x937f('0xb2')];}};Dialer['prototype'][_0x937f('0x37')]=function(_0x5a3478){if(strategy[this[_0x937f('0x1f')][this[_0x937f('0x24')][_0x5a3478[_0x937f('0x128')]]['queue']][_0x937f('0x4e')]]===_0x937f('0x129')){if(this['actions'][_0x5a3478[_0x937f('0x128')]]&&_[_0x937f('0xaf')](this['actions'][_0x5a3478[_0x937f('0x128')]][_0x937f('0x12a')])&&_0x5a3478[_0x937f('0xb1')]==='1'&&_0x5a3478['paused']==='0'){if(this[_0x937f('0x20')][_0x5a3478[_0x937f('0x12b')]]){if(!this[_0x937f('0x20')][_0x5a3478[_0x937f('0x12b')]]['locked']){this[_0x937f('0x20')][_0x5a3478['stateinterface']][_0x937f('0x12a')]=!![];this[_0x937f('0x24')][_0x5a3478[_0x937f('0x128')]]['locked']=!![];this[_0x937f('0x24')][_0x5a3478['actionid']][_0x937f('0x12b')]=_0x5a3478[_0x937f('0x12b')];}}}}else if((strategy[this[_0x937f('0x1f')][this['actions'][_0x5a3478[_0x937f('0x128')]]['queue']][_0x937f('0x4e')]]||'rrmemory')===_0x937f('0x1a')){if(this[_0x937f('0x24')][_0x5a3478['actionid']]){if(this[_0x937f('0x20')][_0x5a3478['stateinterface']]){this[_0x937f('0x24')][_0x5a3478[_0x937f('0x128')]]['stateinterface']=_0x5a3478[_0x937f('0x12b')];if(_[_0x937f('0xaf')](this[_0x937f('0x12c')][this['actions'][_0x5a3478[_0x937f('0x128')]][_0x937f('0xb7')]])){this['queueBooked'][this[_0x937f('0x24')][_0x5a3478[_0x937f('0x128')]][_0x937f('0xb7')]]=[];}this[_0x937f('0x12c')][this[_0x937f('0x24')][_0x5a3478[_0x937f('0x128')]]['queue']][_0x937f('0x12d')](_['merge'](_[_0x937f('0x12e')](this[_0x937f('0x24')][_0x5a3478[_0x937f('0x128')]],['idHopper','stateinterface']),{'status':_0x5a3478[_0x937f('0xb1')],'paused':_0x5a3478[_0x937f('0x12f')]}));}}}};function unlockQueueStatus(_0x38318a,_0x3c2424){setTimeout(function(){if(_[_0x937f('0x3c')](_0x38318a[_0x937f('0x130')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x3c2424);}_0x38318a[_0x937f('0x130')]=!![];loggerBooked['info'](_0x937f('0x131'),_0x3c2424,JSON[_0x937f('0x48')](_[_0x937f('0x12e')](_0x38318a,[_0x937f('0x3f'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x937f('0x1b')][_0x937f('0x39')]=function(_0x1ef4ce){var _0x106c09=this;var _0x208987=_0x106c09[_0x937f('0x1f')][_0x106c09[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]];if(strategy[this[_0x937f('0x1f')][this[_0x937f('0x24')][_0x1ef4ce['actionid']]['queue']][_0x937f('0x4e')]]===_0x937f('0x129')){if(this[_0x937f('0x24')][_0x1ef4ce['actionid']]&&this[_0x937f('0x24')][_0x1ef4ce['actionid']]['stateinterface']){this[_0x937f('0x132')][_0x937f('0x133')](this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0x134')],this['actions'][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0x12b')])[_0x937f('0xb3')](function(_0x165bfc){logger[_0x937f('0x95')](_0x937f('0x135'),util[_0x937f('0x97')](_0x165bfc,{'showHidden':![],'depth':null}));})[_0x937f('0x136')](function(){_0x106c09[_0x937f('0xb4')](_0x106c09[_0x937f('0x1f')][_0x106c09[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]);_0x106c09[_0x937f('0x20')][_0x106c09[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0x12b')]][_0x937f('0x12a')]=![];delete _0x106c09['actions'][_0x1ef4ce['actionid']];unlockQueueStatus(_0x208987);});}else{this[_0x937f('0xb4')](this['voiceQueues'][this['actions'][_0x1ef4ce[_0x937f('0x128')]]['queue']]);this[_0x937f('0xc2')]({'active':![],'ContactId':this[_0x937f('0x24')][_0x1ef4ce['actionid']][_0x937f('0xd4')],'ListId':this[_0x937f('0x24')][_0x1ef4ce['actionid']]['ListId'],'VoiceQueueId':this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xd7')]||undefined,'CampaignId':this['actions'][_0x1ef4ce['actionid']][_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x137')));delete this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]];unlockQueueStatus(_0x208987);}}else if((strategy[this[_0x937f('0x1f')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]['strategy']]||_0x937f('0x1a'))===_0x937f('0x1a')){var _0x940a4e;if(this['actions'][_0x1ef4ce['actionid']]&&!_[_0x937f('0x91')](this[_0x937f('0x12c')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]])){if(this['queueBookedRR'][_0x106c09[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]]['queue']]){this['queueBookedRR'][_0x106c09[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]=this[_0x937f('0x28')][this['actions'][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]?this[_0x937f('0x28')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]]['queue']]:this[_0x937f('0x12c')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]]['queue']]?this[_0x937f('0x12c')][this[_0x937f('0x24')][_0x1ef4ce['actionid']]['queue']][_0x937f('0x138')]||0x0:0x0;}this[_0x937f('0x12c')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]][_0x937f('0x138')]=this['queueBookedRR'][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]]['queue']];for(var _0x43fcf4=0x0;_0x43fcf4<this['queueBooked'][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]['length'];_0x43fcf4+=0x1){_0x940a4e=rr(this[_0x937f('0x12c')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]]['queue']]);this[_0x937f('0x28')][_0x106c09[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]=this[_0x937f('0x12c')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]][_0x937f('0x138')];if(_0x940a4e[_0x937f('0xb1')]==='1'&&_0x940a4e[_0x937f('0x12f')]==='0'){break;}}if(!_[_0x937f('0xaf')](_0x940a4e)){this['agents'][_0x940a4e['stateinterface']][_0x937f('0x139')]=_[_0x937f('0x3c')](this[_0x937f('0x20')][_0x940a4e[_0x937f('0x12b')]][_0x937f('0x139')])?!![]:this[_0x937f('0x20')][_0x940a4e['stateinterface']][_0x937f('0x139')];}loggerBooked[_0x937f('0x7d')](_0x937f('0x13a'),_0x1ef4ce['actionid'],_0x937f('0x13b'),JSON['stringify'](_['pick'](this['agents'][_0x940a4e[_0x937f('0x12b')]],[_0x937f('0x3f'),_0x937f('0x139')])),_0x937f('0x13c'),JSON['stringify'](_0x940a4e[_0x937f('0x134')]));if(!_[_0x937f('0xaf')](_0x940a4e)&&_0x940a4e[_0x937f('0xb1')]==='1'&&_0x940a4e[_0x937f('0x12f')]==='0'&&this[_0x937f('0x20')][_0x940a4e[_0x937f('0x12b')]][_0x937f('0x139')]){this[_0x937f('0x20')][_0x940a4e[_0x937f('0x12b')]][_0x937f('0x139')]=![];this[_0x937f('0x12c')][_0x106c09[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]=[];this[_0x937f('0x132')][_0x937f('0x133')](_0x940a4e[_0x937f('0x134')],_0x940a4e[_0x937f('0x12b')])[_0x937f('0xb3')](function(_0x192d41){logger['error'](_0x937f('0x135'),util['inspect'](_0x192d41,{'showHidden':![],'depth':null}));})['finally'](function(){_0x106c09[_0x937f('0xb4')](_0x106c09[_0x937f('0x1f')][_0x106c09[_0x937f('0x24')][_0x1ef4ce['actionid']][_0x937f('0xb7')]]);setTimeout(function(){_0x106c09[_0x937f('0x20')][_0x940a4e[_0x937f('0x12b')]]['unlockRR']=!![];loggerBooked[_0x937f('0x7d')](_0x937f('0x13d'),_0x1ef4ce[_0x937f('0x128')],'Agent:\x20',JSON['stringify'](_[_0x937f('0x12e')](_0x106c09['agents'][_0x940a4e[_0x937f('0x12b')]],[_0x937f('0x3f'),_0x937f('0x139')])),_0x937f('0x13c'),JSON['stringify'](_0x940a4e['idHopper']));},0xc7);delete _0x106c09[_0x937f('0x24')][_0x1ef4ce['actionid']];unlockQueueStatus(_0x208987,_0x1ef4ce[_0x937f('0x128')]);});}else{loggerBooked[_0x937f('0x7d')](_0x937f('0x13e'));this[_0x937f('0xb4')](this[_0x937f('0x1f')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]);this[_0x937f('0xc2')]({'active':![],'ContactId':this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xd4')],'ListId':this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]]['ListId'],'VoiceQueueId':this['actions'][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xd7')]||undefined,'CampaignId':this[_0x937f('0x24')][_0x1ef4ce['actionid']][_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x137')));delete this[_0x937f('0x24')][_0x1ef4ce['actionid']];unlockQueueStatus(_0x208987);}}else{loggerBooked[_0x937f('0x7d')]('[booked][unlock2]');this['updateOriginated'](this[_0x937f('0x1f')][this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xb7')]]);this[_0x937f('0xc2')]({'active':![],'ContactId':this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xd4')],'ListId':this[_0x937f('0x24')][_0x1ef4ce['actionid']]['ListId'],'VoiceQueueId':this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]];unlockQueueStatus(_0x208987);}}else{loggerBooked[_0x937f('0x7d')](_0x937f('0x13f'));this[_0x937f('0xb4')](this['voiceQueues'][this['actions'][_0x1ef4ce['actionid']][_0x937f('0xb7')]]);this[_0x937f('0xc2')]({'active':![],'ContactId':this['actions'][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xd4')],'ListId':this['actions'][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xd5')],'VoiceQueueId':this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]][_0x937f('0xd7')]||undefined,'CampaignId':this[_0x937f('0x24')][_0x1ef4ce['actionid']][_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x140')));delete this[_0x937f('0x24')][_0x1ef4ce[_0x937f('0x128')]];unlockQueueStatus(_0x208987);}};Dialer['prototype'][_0x937f('0x3a')]=function(){var _0x204057=this;return BPromise[_0x937f('0xba')]()[_0x937f('0x3b')](cmHopper[_0x937f('0x141')]({}))[_0x937f('0x3b')](function(){setInterval(function(){_0x204057[_0x937f('0x142')]();},0x3e8);});};Dialer[_0x937f('0x1b')][_0x937f('0x143')]=function(_0x5a41f0){var _0x587b62=this;return function(){if(!_0x587b62['isTrunkReachable'](_0x5a41f0[_0x937f('0x73')])){if(!_0x587b62[_0x937f('0xdd')](_0x5a41f0['TrunkBackup'])){_0x5a41f0[_0x937f('0x3d')]=_0x937f('0x144');throw _0x5a41f0['name']+_0x937f('0x145');}}};};Dialer[_0x937f('0x1b')][_0x937f('0x146')]=function(_0x5de255,_0x1b02f1,_0x41e930,_0x42c4f9){var _0x39d792=this;return function(){var _0x5db2fa=!![];return _0x39d792[_0x937f('0x147')](_0x5de255,_0x1b02f1,_0x41e930,_0x42c4f9,_0x5db2fa);};};Dialer['prototype'][_0x937f('0x148')]=function(_0x1de627,_0xc8926a,_0x1cc0eb,_0x2f2149){var _0x136f69=this;return function(){var _0x3d93c0=![];return _0x136f69['ifTime'](_0x1de627[_0x937f('0x45')],_0xc8926a,_0x1cc0eb,_0x2f2149,_0x3d93c0);};};Dialer[_0x937f('0x1b')][_0x937f('0x147')]=function(_0x203d16,_0x1c4d24,_0x5eb725,_0x12bcca,_0x3850f7){var _0x4e3e11=[];return new BPromise(function(_0x3e93a9,_0x3d9861){if(!isNotNull(_0x203d16)){_0x12bcca[_0x937f('0x3d')]=_0x937f('0x43');return _0x3d9861(msgResponse(_0x937f('0x147'),_0x937f('0x149'),_0x5eb725+_0x937f('0x14a')));}if(_[_0x937f('0x91')](_0x203d16)){_0x12bcca[_0x937f('0x3d')]=_0x937f('0x14b');return _0x3d9861(msgResponse(_0x937f('0x147'),_0x937f('0x149'),_0x5eb725+_0x937f('0x14c')));}if(_0x1c4d24&&_[_0x937f('0x3c')](config[_0x937f('0x14d')][_0x1c4d24])){_0x12bcca['message']=_0x937f('0x14e');return _0x3d9861(msgResponse('ifTime',_0x937f('0x149'),_0x5eb725+_0x937f('0x14f')+_0x1c4d24));}if(_['isArray'](_0x203d16)){for(var _0x3b2efc=0x0;_0x3b2efc<_0x203d16[_0x937f('0x98')];_0x3b2efc+=0x1){_0x4e3e11[_0x937f('0x12d')](ami[_0x937f('0xb0')]({'action':_0x937f('0x150'),'command':util[_0x937f('0x77')](_0x937f('0x151'),_0x203d16[_0x3b2efc]['interval'],!_[_0x937f('0x3c')](config['timezones'][_0x1c4d24])?_0x1c4d24:'')})[_0x937f('0x3b')](function(_0x161878){return _0x161878[_0x937f('0x152')][_0x937f('0x153')](_0x937f('0x154'))>=0x0;})[_0x937f('0xb3')](myreject(_0x3d9861)));}}else{_0x4e3e11[_0x937f('0x12d')](ami[_0x937f('0xb0')]({'action':_0x937f('0x150'),'command':util[_0x937f('0x77')](_0x937f('0x151'),_0x203d16,!_[_0x937f('0x3c')](config[_0x937f('0x14d')][_0x1c4d24])?_0x1c4d24:'')})[_0x937f('0x3b')](function(_0x40bfd3){return _0x40bfd3[_0x937f('0x152')]['indexOf']('true')>=0x0;})[_0x937f('0xb3')](myreject(_0x3d9861)));}BPromise[_0x937f('0x155')](_0x4e3e11)[_0x937f('0x3b')](function(_0x425a8e){var _0x147bdf=_[_0x937f('0x156')](_0x425a8e);if(_0x147bdf){return _0x3e93a9(_0x147bdf);}else{_0x12bcca[_0x937f('0x3d')]=_0x3850f7?'GLOBAL_INTERVAL_IS_OVERTIME':_0x937f('0x157');return _0x3d9861(msgResponse(_0x937f('0x158'),_0x937f('0x149'),_0x937f('0x159')+_0x3850f7+'\x20'+_0x5eb725+'\x20Interval\x20is\x20overtime:\x20'+util[_0x937f('0x97')](_0x203d16,{'showHidden':![],'depth':null})+_0x937f('0x15a')+_0x1c4d24));}})[_0x937f('0xb3')](function(_0x2f2071){return _0x3d9861(msgResponse('ifTime',_0x937f('0x149'),JSON['stringify'](_0x2f2071)));});});};Dialer['prototype'][_0x937f('0x15b')]=function(_0x3d99a8){var _0x412c90=this;return function(){switch(_0x3d99a8[_0x937f('0x5a')]){case'progressive':freeVariablesPredictive(_0x3d99a8);_0x412c90[_0x937f('0x15c')](_0x3d99a8,0x1);break;case _0x937f('0x15d'):freeVariablesPredictive(_0x3d99a8);_0x412c90[_0x937f('0x15c')](_0x3d99a8,_0x3d99a8['dialPowerLevel']);break;case _0x937f('0x9'):_0x412c90[_0x937f('0x9')](_0x3d99a8);break;case _0x937f('0x8'):freeVariablesPredictive(_0x3d99a8);_0x412c90['handlePower'](_0x3d99a8,0x1);break;default:freeVariablesPredictive(_0x3d99a8);logger['error'](_0x937f('0x15e'),_0x3d99a8[_0x937f('0x3f')],_0x937f('0x15f'));}};};Dialer[_0x937f('0x1b')]['checkPreviewRecallReminder']=function(_0x2b64d7){return BPromise[_0x937f('0xba')]()['then'](cmHopper[_0x937f('0x160')](_0x2b64d7['id'],previewRecallmeReminderInterval))[_0x937f('0x3b')](function(_0x32c584){for(var _0x2356bf=0x0;_0x2356bf<_0x32c584['length'];_0x2356bf++){var _0xe9b4e6=_0x32c584[_0x2356bf][_0x937f('0x161')][_0x937f('0x3f')];if(_0xe9b4e6)io['to'](util[_0x937f('0x77')](_0x937f('0x162'),_0xe9b4e6))[_0x937f('0x4b')](_0x937f('0x163'),{'hopper':_0x32c584[_0x2356bf]});}})[_0x937f('0xb3')](function(_0x2cccf4){});};Dialer[_0x937f('0x1b')][_0x937f('0x164')]=function(_0x5992fa){var _0x3ef74d=this;return function(){_0x3ef74d['handleIvr'](_0x5992fa);};};Dialer[_0x937f('0x1b')][_0x937f('0x31')]=function(_0x482ae1){var _0x5d847e=this;if(isNotPreview(_0x482ae1[_0x937f('0x5a')])){if(isVoiceQueueOutbound(_0x482ae1[_0x937f('0x4c')])&&isActive(_0x482ae1['dialActive'])){_0x482ae1[_0x937f('0xa0')]=!![];BPromise[_0x937f('0xba')]()[_0x937f('0x3b')](checkIsLoggedIn(_0x482ae1,_0x482ae1[_0x937f('0x165')]))['then'](checkIsActive(_0x482ae1,_0x482ae1[_0x937f('0x59')]))[_0x937f('0x3b')](checkInterval(_0x482ae1))['then'](_0x5d847e[_0x937f('0x143')](_0x482ae1))['then'](_0x5d847e[_0x937f('0x146')](_0x482ae1[_0x937f('0x166')],_0x482ae1[_0x937f('0x167')],_0x482ae1['name'],_0x482ae1))[_0x937f('0x3b')](_0x5d847e[_0x937f('0x148')](_0x482ae1[_0x937f('0x42')],_0x482ae1[_0x937f('0x167')],_0x482ae1[_0x937f('0x3f')],_0x482ae1))['then'](_0x5d847e[_0x937f('0x15b')](_0x482ae1))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x482ae1));}else{notSendMessagesQueue(_0x482ae1);}}else{freeVariablesPredictive(_0x482ae1);if(_0x482ae1[_0x937f('0x168')]){_0x5d847e[_0x937f('0x169')](_0x482ae1);}}};Dialer[_0x937f('0x1b')]['syncCampaigns']=function(){var _0x1d48ac=this;var _0x3bbbeb;for(var _0x3658f1 in this[_0x937f('0xb6')]){if(typeof this[_0x937f('0xb6')][_0x3658f1]!==_0x937f('0x99')){_0x3bbbeb=this[_0x937f('0xb6')][_0x3658f1];if(isCampaignIvr(_0x3bbbeb[_0x937f('0x4c')])&&isActive(_0x3bbbeb[_0x937f('0x74')])){_0x3bbbeb[_0x937f('0xa0')]=!![];BPromise[_0x937f('0xba')]()[_0x937f('0x3b')](checkIsActive(_0x3bbbeb,_0x3bbbeb[_0x937f('0x74')]))[_0x937f('0x3b')](checkInterval(_0x3bbbeb))[_0x937f('0x3b')](_0x1d48ac[_0x937f('0x143')](_0x3bbbeb))['then'](_0x1d48ac[_0x937f('0x146')](_0x3bbbeb[_0x937f('0x166')],_0x3bbbeb['dialTimezone'],_0x3bbbeb[_0x937f('0x3f')],_0x3bbbeb))[_0x937f('0x3b')](_0x1d48ac[_0x937f('0x148')](_0x3bbbeb[_0x937f('0x42')],_0x3bbbeb[_0x937f('0x167')],_0x3bbbeb['name'],_0x3bbbeb))[_0x937f('0x3b')](_0x1d48ac[_0x937f('0x164')](_0x3bbbeb))[_0x937f('0xb3')](loggerCatchQueueSummary(_0x937f('0x16a'),_0x3bbbeb));}else{notSendMessagesCampaign(_0x3bbbeb);}}}};function getCallerIdRandom(_0x230223,_0x5ef56c){var _0x2044e3;var _0x263ad1;var _0x59a896;if(_0x5ef56c<=0x0){_0x5ef56c=0x1;}_0x2044e3=new RegExp(_0x937f('0x16b')+_0x5ef56c+'}$');_0x263ad1=Math['pow'](0xa,_0x5ef56c-0x1);_0x59a896=Math[_0x937f('0x16c')](0xa,_0x5ef56c)-0x1;return util['format']('%s',_[_0x937f('0x16d')](_0x230223,_0x2044e3,_['random'](_0x263ad1,_0x59a896)));}function extractCalleridName(_0x18fead){var _0x8868d3=_0x18fead[_0x937f('0x16e')](/"(.*?)"/);return _0x8868d3?_0x8868d3[0x1]:_0x18fead;}function extractCalleridNumber(_0x4a7b65){var _0x37285b=_0x4a7b65['match'](/<(.*?)>/);return _0x37285b?_0x37285b[0x1]:_0x4a7b65;}Dialer[_0x937f('0x1b')][_0x937f('0x16f')]=function(_0x2142c8,_0x4d96ad){var _0x4f2d6f=this;var _0x2c5953=uuid['v4']();this[_0x937f('0x24')][_0x2c5953]=new Action(_0x2142c8,_0x4d96ad,_0x2c5953);return new BPromise(function(_0xfe333f,_0x34afcd){if(_[_0x937f('0x3c')](_0x2142c8)&&typeof _0x2142c8!=='object'){return _0x34afcd(msgResponse(_0x937f('0x170'),_0x937f('0x149'),_0x937f('0x171')));}if(_[_0x937f('0x3c')](_0x4d96ad[_0x937f('0x172')]['phone'])||_0x4d96ad[_0x937f('0x172')][_0x937f('0x173')]===null){return _0x34afcd(msgResponse(_0x937f('0x170'),_0x937f('0x149'),_0x937f('0x174')));}var _0x41a706={'XMD-CALLERID':_0x4f2d6f[_0x937f('0x24')][_0x2c5953][_0x937f('0x175')](),'XMD-AGI':_0x2142c8['dialQueueProject']?util['format'](_0x937f('0x176'),ipAgi,_0x2142c8[_0x937f('0x108')]):_0x937f('0x177'),'XMD-AGIAFTER':_0x2142c8[_0x937f('0x10f')]?util['format'](_0x937f('0x176'),ipAgi,_0x2142c8[_0x937f('0x10f')]):_0x937f('0x177'),'XMD-QUEUE':_0x2142c8[_0x937f('0x4c')]===_0x937f('0x4d')?util[_0x937f('0x77')](_0x937f('0x178'),_0x2142c8['name'],_0x2142c8[_0x937f('0x179')]||'',_0x2142c8['dialAgiAfterHangupAgent']?'c':'',_0x2142c8[_0x937f('0x117')]||0x3):_0x937f('0x177'),'XMD-CONTACTID':_0x4d96ad[_0x937f('0xd4')],'XMD-CDRTYPE':_0x937f('0x17a'),'CALLERID(all)':_0x4f2d6f[_0x937f('0x24')][_0x2c5953]['getCaller'](),'XMD-AMD':_0x2142c8[_0x937f('0xe3')]?'ACTIVE':_0x937f('0x177'),'XMD-DESTINATION':_0x937f('0x17b')};if(_0x2142c8[_0x937f('0xe3')]){_0x41a706['XMD-AMDINITIALSILENCE']=_0x2142c8[_0x937f('0x17c')]||0x9c4;_0x41a706['XMD-AMDGREETING']=_0x2142c8[_0x937f('0x17d')]||0x5dc;_0x41a706[_0x937f('0x17e')]=_0x2142c8[_0x937f('0x17f')]||0x320;_0x41a706[_0x937f('0x180')]=_0x2142c8[_0x937f('0x181')]||0x1388;_0x41a706[_0x937f('0x182')]=_0x2142c8[_0x937f('0x183')]||0x64;_0x41a706[_0x937f('0x184')]=_0x2142c8[_0x937f('0x185')]||0x32;_0x41a706[_0x937f('0x186')]=_0x2142c8[_0x937f('0x187')]||0x3;_0x41a706[_0x937f('0x188')]=_0x2142c8[_0x937f('0x189')]||0x100;_0x41a706['XMD-AMDMAXIMUMWORDLENGTH']=_0x2142c8['dialAMDMaximumWordLength']||0x1388;}if(_0x2142c8[_0x937f('0x4c')]===_0x937f('0x4d')){_0x41a706['XMD-VOICEQUEUEID']=_0x4d96ad['VoiceQueueId'];}else{_0x41a706[_0x937f('0x18a')]=_0x4d96ad[_0x937f('0xd8')];}for(var _0x347f26 in _0x4d96ad[_0x937f('0x172')]){if(typeof _0x4d96ad[_0x937f('0x172')][_0x347f26]!=='undefined'){if(isNotNull(_0x4d96ad[_0x937f('0x172')][_0x347f26])&&_0x347f26!=='id'&&_0x347f26!==_0x937f('0x18b')&&_0x347f26!=='createdAt'&&_0x347f26!==_0x937f('0x18c')){_0x41a706[util[_0x937f('0x77')]('%s%s',_0x937f('0x18d'),_[_0x937f('0x18e')](_0x347f26))]=_0x4d96ad['Contact'][_0x347f26];}}}var _0x47e8cd=_0x4f2d6f[_0x937f('0xdd')](_0x2142c8[_0x937f('0x73')])?getCallerId(_0x2142c8[_0x937f('0x73')][_0x937f('0x75')],_0x2142c8[_0x937f('0x5b')],_0x2142c8[_0x937f('0x18f')]>0x0?getCallerIdRandom(_0x2142c8[_0x937f('0x5c')],_0x2142c8['dialRandomLastDigitCallerIdNumber']):_0x2142c8[_0x937f('0x5c')]):getCallerId(_[_0x937f('0xaf')](_0x2142c8[_0x937f('0x190')])?_0x2142c8['Trunk']['callerid']:_0x2142c8[_0x937f('0x190')][_0x937f('0x75')],_0x2142c8[_0x937f('0x5b')],_0x2142c8[_0x937f('0x18f')]>0x0?getCallerIdRandom(_0x2142c8[_0x937f('0x5c')],_0x2142c8[_0x937f('0x18f')]):_0x2142c8['dialOriginateCallerIdNumber']);if(_0x47e8cd){_0x41a706[_0x937f('0x191')]=_0x4f2d6f[_0x937f('0x24')][_0x2c5953][_0x937f('0x192')]=extractCalleridName(_0x47e8cd);_0x41a706['XMD-ORIGINATECALLERIDNUM']=_0x4f2d6f[_0x937f('0x24')][_0x2c5953][_0x937f('0x193')]=extractCalleridNumber(_0x47e8cd);}return ami[_0x937f('0xb0')]({'actionid':_0x2c5953,'action':_0x937f('0x170'),'channel':_0x4f2d6f[_0x937f('0xdd')](_0x2142c8['Trunk'])?util[_0x937f('0x77')](_0x937f('0x194'),_0x2142c8[_0x937f('0x73')][_0x937f('0x3f')],isNotNull(_0x2142c8[_0x937f('0x5e')])?_0x2142c8[_0x937f('0x5e')][_0x937f('0x195')]()||'':'',_0x2142c8[_0x937f('0x196')]>0x0?_0x4d96ad[_0x937f('0x172')][_0x937f('0x173')][_0x937f('0x197')](_0x2142c8['dialCutDigit']):_0x4d96ad[_0x937f('0x172')][_0x937f('0x173')]):util[_0x937f('0x77')]('SIP/%s/%s%s',_[_0x937f('0xaf')](_0x2142c8[_0x937f('0x190')])?_0x2142c8[_0x937f('0x73')]['name']:_0x2142c8[_0x937f('0x190')][_0x937f('0x3f')],isNotNull(_0x2142c8[_0x937f('0x5e')])?_0x2142c8['dialPrefix'][_0x937f('0x195')]()||'':'',_0x2142c8[_0x937f('0x196')]>0x0?_0x4d96ad[_0x937f('0x172')]['phone'][_0x937f('0x197')](_0x2142c8[_0x937f('0x196')]):_0x4d96ad[_0x937f('0x172')][_0x937f('0x173')]),'callerid':_0x47e8cd,'Exten':_0x937f('0x17b'),'Context':_0x937f('0x198'),'Priority':'1','variable':_0x41a706,'timeout':(_0x2142c8['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2c5953})[_0x937f('0x3b')](function(_0x23adb9){return _0xfe333f(_0x23adb9);})[_0x937f('0xb3')](function(_0x19e3ed){_0x2142c8[_0x937f('0x65')]+=0x1;var _0x9c37ce=new History(_0x4f2d6f['actions'][_0x2c5953]);logger['error'](util[_0x937f('0x77')]('[originateError]:\x20%s',JSON[_0x937f('0x48')](_0x19e3ed)));_0x9c37ce[_0x937f('0xa7')]=0xe;_0x9c37ce['statedesc']=_0x937f('0x199');_0x9c37ce['starttime']=moment()[_0x937f('0x77')](_0x937f('0x104'));_0x9c37ce['endtime']=_0x9c37ce[_0x937f('0xaa')];_0x4f2d6f[_0x937f('0xcd')](_0x9c37ce)['catch'](loggerCatch('[originate][error]'));_0x4f2d6f[_0x937f('0xcb')](_0x9c37ce)[_0x937f('0xb3')](loggerCatch('[originate][error]'))[_0x937f('0x136')](function(){delete _0x4f2d6f[_0x937f('0x24')][_0x2c5953];return _0x34afcd(msgResponse(_0x937f('0x170'),_0x937f('0x47'),_0x937f('0x19a')));});});});};Dialer['prototype'][_0x937f('0x2e')]=function(_0x326deb){var _0x3a5d17=this['actions'][_0x326deb[_0x937f('0x128')]];if(_0x3a5d17){delete this[_0x937f('0x24')][_0x326deb[_0x937f('0x128')]];_0x3a5d17[_0x937f('0x116')]=moment()[_0x937f('0x77')](_0x937f('0x104'));var _0x25dd46=_0x3a5d17[_0x937f('0x4c')]==='ivr'?this[_0x937f('0xb6')][_0x3a5d17[_0x937f('0xb7')]]:this[_0x937f('0x1f')][_0x3a5d17[_0x937f('0x19b')]()];if(!this[_0x937f('0xdb')](_0x326deb[_0x937f('0x19c')])){this[_0x937f('0xb4')](_0x25dd46);return this[_0x937f('0x19d')](_0x3a5d17,_0x25dd46,_0x326deb)[_0x937f('0xb3')](loggerCatch(_0x937f('0x19e')));}this['uniqueId'][_0x326deb[_0x937f('0xe1')]]=_0x3a5d17;}};Dialer[_0x937f('0x1b')][_0x937f('0x19f')]=function(_0x4a7887,_0x4d29d9,_0x1e1bf7){var _0x3f6b33=new History(_0x4d29d9);if(_0x3f6b33[_0x937f('0xee')]+_0x3f6b33[_0x937f('0x100')]+_0x3f6b33[_0x937f('0x101')]+_0x3f6b33[_0x937f('0xef')]+_0x3f6b33[_0x937f('0xf0')]+_0x3f6b33[_0x937f('0x121')]+_0x3f6b33[_0x937f('0xed')]+_0x3f6b33[_0x937f('0xf1')]>=_0x1e1bf7[_0x937f('0x102')]-0x1){return!![];}switch(_0x4a7887){case 0x3:if(_0x3f6b33[_0x937f('0x101')]>=_0x1e1bf7[_0x937f('0x1a0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x3f6b33[_0x937f('0x101')]+=0x1,'scheduledat':moment()[_0x937f('0xf7')](_0x1e1bf7[_0x937f('0x1a1')],_0x937f('0xf8'))['format'](_0x937f('0x104')),'ContactId':_0x3f6b33['ContactId'],'ListId':_0x3f6b33[_0x937f('0xd5')],'VoiceQueueId':_0x3f6b33[_0x937f('0xd7')]||undefined,'CampaignId':_0x3f6b33['CampaignId']||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x1a2')));break;case 0x5:if(_0x3f6b33['countbusyretry']>=_0x1e1bf7[_0x937f('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x3f6b33[_0x937f('0xee')]+=0x1,'scheduledat':moment()[_0x937f('0xf7')](_0x1e1bf7[_0x937f('0x1a4')],_0x937f('0xf8'))[_0x937f('0x77')](_0x937f('0x104')),'ContactId':_0x3f6b33[_0x937f('0xd4')],'ListId':_0x3f6b33[_0x937f('0xd5')],'VoiceQueueId':_0x3f6b33[_0x937f('0xd7')]||undefined,'CampaignId':_0x3f6b33[_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x1a5')));break;case 0x8:if(_0x3f6b33[_0x937f('0x100')]>=_0x1e1bf7[_0x937f('0x1a6')]-0x1){return!![];}this[_0x937f('0xc2')]({'active':![],'countcongestionretry':_0x3f6b33[_0x937f('0x100')]+=0x1,'scheduledat':moment()[_0x937f('0xf7')](_0x1e1bf7[_0x937f('0x1a7')],'minutes')[_0x937f('0x77')](_0x937f('0x104')),'ContactId':_0x3f6b33['ContactId'],'ListId':_0x3f6b33['ListId'],'VoiceQueueId':_0x3f6b33['VoiceQueueId']||undefined,'CampaignId':_0x3f6b33[_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x1a8')));break;case 0x0:if(_0x3f6b33[_0x937f('0xef')]>=_0x1e1bf7['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x937f('0xc2')]({'active':![],'countnosuchnumberretry':_0x3f6b33['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x937f('0xf7')](_0x1e1bf7[_0x937f('0x1a9')],_0x937f('0xf8'))[_0x937f('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3f6b33[_0x937f('0xd4')],'ListId':_0x3f6b33[_0x937f('0xd5')],'VoiceQueueId':_0x3f6b33[_0x937f('0xd7')]||undefined,'CampaignId':_0x3f6b33[_0x937f('0xd8')]||undefined})['catch'](loggerCatch(_0x937f('0x1aa')));}break;case 0xa:if(_0x3f6b33['countdropretry']>=_0x1e1bf7[_0x937f('0x119')]-0x1){return!![];}this[_0x937f('0xc2')]({'active':![],'countdropretry':_0x3f6b33['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x1e1bf7[_0x937f('0x11a')],_0x937f('0xf8'))[_0x937f('0x77')](_0x937f('0x104')),'ContactId':_0x3f6b33[_0x937f('0xd4')],'ListId':_0x3f6b33[_0x937f('0xd5')],'VoiceQueueId':_0x3f6b33[_0x937f('0xd7')]||undefined,'CampaignId':_0x3f6b33[_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x11b')));break;case 0xb:if(_0x3f6b33[_0x937f('0x121')]>=_0x1e1bf7['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x3f6b33[_0x937f('0x121')]+=0x1,'scheduledat':moment()[_0x937f('0xf7')](_0x1e1bf7['dialAbandonedRetryFrequency'],'minutes')[_0x937f('0x77')](_0x937f('0x104')),'ContactId':_0x3f6b33[_0x937f('0xd4')],'ListId':_0x3f6b33['ListId'],'VoiceQueueId':_0x3f6b33[_0x937f('0xd7')]||undefined,'CampaignId':_0x3f6b33[_0x937f('0xd8')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3f6b33[_0x937f('0xed')]>=_0x1e1bf7['dialMachineMaxRetry']-0x1){return!![];}this[_0x937f('0xc2')]({'active':![],'countmachineretry':_0x3f6b33['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x1e1bf7[_0x937f('0x103')],_0x937f('0xf8'))[_0x937f('0x77')](_0x937f('0x104')),'ContactId':_0x3f6b33[_0x937f('0xd4')],'ListId':_0x3f6b33['ListId'],'VoiceQueueId':_0x3f6b33['VoiceQueueId']||undefined,'CampaignId':_0x3f6b33[_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0xf9')));break;case 0x14:if(_0x3f6b33[_0x937f('0xf1')]>=_0x1e1bf7[_0x937f('0x1ab')]-0x1){return!![];}this[_0x937f('0xc2')]({'active':![],'countagentrejectretry':_0x3f6b33['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x1e1bf7['dialAgentRejectRetryFrequency'],_0x937f('0xf8'))[_0x937f('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3f6b33[_0x937f('0xd4')],'ListId':_0x3f6b33['ListId'],'VoiceQueueId':_0x3f6b33[_0x937f('0xd7')]||undefined,'CampaignId':_0x3f6b33[_0x937f('0xd8')]||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x1ac')));break;default:return!![];}};Dialer[_0x937f('0x1b')][_0x937f('0x19d')]=function(_0x1b1e7b,_0x1732fd,_0x4cdd9d){var _0x11539c=this;var _0x3cee79=new History(_0x1b1e7b);return new BPromise(function(_0x12a6de,_0x25ff51){if(_[_0x937f('0x3c')](_0x1732fd)&&typeof _0x1732fd!==_0x937f('0x1ad')){return _0x25ff51(msgResponse(_0x937f('0x1ae'),_0x937f('0x149'),_0x937f('0x1af')));}if(_[_0x937f('0x3c')](_0x4cdd9d)&&typeof _0x4cdd9d!==_0x937f('0x1ad')){return _0x25ff51(msgResponse('[callProgressDetecting]',_0x937f('0x149'),'evt\x20is\x20undefine'));}switch(_0x4cdd9d[_0x937f('0x10d')]){case'0':_0x1732fd['outboundNoSuchCallsDay']+=0x1;_0x3cee79[_0x937f('0xa7')]=0x0;_0x3cee79[_0x937f('0xa8')]='NoSuchNumber';_0x3cee79[_0x937f('0xef')]+=0x1;_0x3cee79[_0x937f('0x122')]+=0x1;ami[_0x937f('0x4b')](_0x937f('0x1b0'),ut[_0x937f('0xfc')](_0x1b1e7b,'nosuchnumber'));_0x11539c[_0x937f('0xcd')](_0x3cee79)[_0x937f('0xb3')](loggerCatch(_0x937f('0xff')));if(_0x11539c[_0x937f('0x19f')](0x0,_0x1b1e7b,_0x1732fd)){if(_0x3cee79['countnosuchnumberretry']>=_0x1732fd[_0x937f('0x1b1')]){_0x11539c[_0x937f('0xf5')](_0x3cee79,_0x12a6de,_0x25ff51,_0x937f('0x1b2'));}else{_0x11539c['stateGlobal'](_0x3cee79,_0x12a6de,_0x25ff51,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x1732fd[_0x937f('0x1b3')]+=0x1;_0x3cee79[_0x937f('0xa7')]=0x3;_0x3cee79['statedesc']=_0x937f('0x1b4');_0x3cee79[_0x937f('0x101')]+=0x1;_0x3cee79[_0x937f('0x122')]+=0x1;ami[_0x937f('0x4b')](_0x937f('0x1b5'),ut[_0x937f('0xfc')](_0x1b1e7b,_0x937f('0x1b6')));_0x11539c[_0x937f('0xcd')](_0x3cee79)['catch'](loggerCatch(_0x937f('0x1b7')));if(_0x11539c[_0x937f('0x19f')](0x3,_0x1b1e7b,_0x1732fd)){if(_0x3cee79[_0x937f('0x101')]>=_0x1732fd['dialNoAnswerMaxRetry']){_0x11539c[_0x937f('0xf5')](_0x3cee79,_0x12a6de,_0x25ff51,'reason\x203\x20ringing\x20no\x20answer');}else{_0x11539c[_0x937f('0xf2')](_0x3cee79,_0x12a6de,_0x25ff51,_0x937f('0x1b8'));}}break;case'5':_0x1732fd[_0x937f('0x62')]+=0x1;_0x3cee79[_0x937f('0xa7')]=0x5;_0x3cee79[_0x937f('0xa8')]=_0x937f('0x1b9');_0x3cee79[_0x937f('0xee')]+=0x1;_0x3cee79[_0x937f('0x122')]+=0x1;ami['emit'](_0x937f('0x1ba'),ut[_0x937f('0xfc')](_0x1b1e7b,_0x937f('0x1bb')));_0x11539c['createHistory'](_0x3cee79)[_0x937f('0xb3')](loggerCatch(_0x937f('0x1bc')));if(_0x11539c[_0x937f('0x19f')](0x5,_0x1b1e7b,_0x1732fd)){if(_0x3cee79['countbusyretry']>=_0x1732fd['dialBusyMaxRetry']){_0x11539c[_0x937f('0xf5')](_0x3cee79,_0x12a6de,_0x25ff51,_0x937f('0x1bd'));}else{_0x11539c[_0x937f('0xf2')](_0x3cee79,_0x12a6de,_0x25ff51,_0x937f('0x1bd'));}}break;case'8':_0x1732fd[_0x937f('0x1be')]+=0x1;_0x3cee79['state']=0x8;_0x3cee79[_0x937f('0xa8')]=_0x937f('0x1bf');_0x3cee79[_0x937f('0x100')]+=0x1;_0x3cee79['countglobal']+=0x1;ami[_0x937f('0x4b')](_0x937f('0x1c0'),ut[_0x937f('0xfc')](_0x1b1e7b,_0x937f('0x1c1')));_0x11539c['createHistory'](_0x3cee79)[_0x937f('0xb3')](loggerCatch(_0x937f('0x1c2')));if(_0x11539c[_0x937f('0x19f')](0x8,_0x1b1e7b,_0x1732fd)){if(_0x3cee79['countcongestionretry']>=_0x1732fd[_0x937f('0x1a6')]){_0x11539c[_0x937f('0xf5')](_0x3cee79,_0x12a6de,_0x25ff51,_0x937f('0x1c3'));}else{_0x11539c['stateGlobal'](_0x3cee79,_0x12a6de,_0x25ff51,'reason\x208\x20congestion');}}break;case'11':_0x1732fd['outboundAbandonedCallsDay']+=0x1;_0x3cee79[_0x937f('0xa7')]=0xb;_0x3cee79[_0x937f('0xa8')]=_0x937f('0x11f');_0x3cee79[_0x937f('0x121')]+=0x1;_0x3cee79['countglobal']+=0x1;_0x11539c[_0x937f('0xcd')](_0x3cee79)['catch'](loggerCatch(_0x937f('0x126')));if(_0x11539c['checkRetriveMax'](0xb,_0x1b1e7b,_0x1732fd)){if(_0x3cee79['countabandonedretry']>=_0x1732fd['dialAbandonedMaxRetry']){_0x11539c[_0x937f('0xf5')](_0x3cee79,_0x12a6de,_0x25ff51,'reason\x2011\x20abandoned');}else{_0x11539c[_0x937f('0xf2')](_0x3cee79,_0x12a6de,_0x25ff51,_0x937f('0x1c4'));}}break;case'20':_0x1732fd[_0x937f('0x66')]+=0x1;_0x3cee79[_0x937f('0xa7')]=0x14;_0x3cee79['statedesc']=_0x937f('0x1c5');_0x3cee79[_0x937f('0xf1')]+=0x1;_0x3cee79[_0x937f('0x122')]+=0x1;ami[_0x937f('0x4b')](_0x937f('0x1c6'),ut[_0x937f('0xfc')](_0x1b1e7b,_0x937f('0x1c7')));_0x11539c[_0x937f('0xcd')](_0x3cee79)[_0x937f('0xb3')](loggerCatch(_0x937f('0x1c8')));if(_0x11539c['checkRetriveMax'](0x14,_0x1b1e7b,_0x1732fd)){if(_0x3cee79[_0x937f('0xf1')]>=_0x1732fd[_0x937f('0x1ab')]){_0x11539c[_0x937f('0xf5')](_0x3cee79,_0x12a6de,_0x25ff51,'reason\x2020\x20agentreject');}else{_0x11539c[_0x937f('0xf2')](_0x3cee79,_0x12a6de,_0x25ff51,_0x937f('0x1c9'));}}break;default:_0x1732fd[_0x937f('0x67')]+=0x1;_0x3cee79[_0x937f('0xa7')]=0xc;_0x3cee79[_0x937f('0xa8')]=_0x4cdd9d[_0x937f('0x10d')];_0x11539c['createHistory'](_0x3cee79)['catch'](loggerCatch(_0x937f('0x1ca')));if(_0x11539c[_0x937f('0x19f')](_0x4cdd9d[_0x937f('0x10d')],_0x1b1e7b,_0x1732fd)){if(_0x3cee79['countbusyretry']+_0x3cee79[_0x937f('0x100')]+_0x3cee79[_0x937f('0x101')]+_0x3cee79['countnosuchnumberretry']+_0x3cee79['countdropretry']+_0x3cee79[_0x937f('0x121')]+_0x3cee79[_0x937f('0xed')]+_0x3cee79[_0x937f('0xf1')]>=_0x1732fd[_0x937f('0x102')]){_0x11539c['stateGlobal'](_0x3cee79,_0x12a6de,_0x25ff51,_0x4cdd9d[_0x937f('0x10d')]);}else{_0x11539c[_0x937f('0xf5')](_0x3cee79,_0x12a6de,_0x25ff51,_0x4cdd9d[_0x937f('0x10d')]);}}}});};Dialer[_0x937f('0x1b')][_0x937f('0xf2')]=function(_0x1200e9,_0xbb0c81,_0x26076b,_0x3516b6){var _0x435652=new Final(_0x1200e9);_0x435652[_0x937f('0xa7')]=0xf;_0x435652['statedesc']=_0x937f('0x1cb');this[_0x937f('0xf5')](_0x435652,_0xbb0c81,_0x26076b,_0x3516b6);};Dialer[_0x937f('0x1b')][_0x937f('0xf5')]=function(_0x7bc470,_0x2e106a,_0x423a3a,_0x50a3fd){this[_0x937f('0xcb')](_0x7bc470)['then'](function(){return _0x2e106a(msgResponse(_0x937f('0x1ae'),_0x937f('0xdc'),_0x50a3fd));})[_0x937f('0xb3')](function(){return _0x423a3a(msgResponse(_0x937f('0x1cc'),_0x937f('0x149'),_0x937f('0x1cd')));});};Dialer[_0x937f('0x1b')][_0x937f('0x9')]=function(_0x42cdae){var _0x37e3eb=_0x42cdae[_0x937f('0x1ce')]/0x64;var _0x2f7fb6=_0x42cdae[_0x937f('0x64')]/(_0x42cdae['outboundDropCallsDayTimeout']+_0x42cdae[_0x937f('0x60')]);var _0x28f917=Math['round'](_0x42cdae['predictiveIntervalAvailable']*(_0x42cdae['predictiveIntervalMaxThreshold']/0x64));var _0x15f829=Math[_0x937f('0x1cf')](_0x42cdae[_0x937f('0x6f')]*(_0x42cdae[_0x937f('0x1d0')]/0x64));var _0x4430e5=_0x42cdae[_0x937f('0x50')]+_0x42cdae[_0x937f('0x54')];var _0x3f5907=Math[_0x937f('0x1d1')](_0x42cdae[_0x937f('0x87')]*_0x42cdae[_0x937f('0x71')]*_0x42cdae['predictiveIntervalHitRate']*_0x42cdae[_0x937f('0x1d2')]);if(_[_0x937f('0x3c')](_0x42cdae['startProgressive'])){if(!_[_0x937f('0x3c')](_0x42cdae[_0x937f('0x72')])){_0x42cdae[_0x937f('0x72')]=undefined;loggerPredictive[_0x937f('0x95')](_0x937f('0x1d3'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x937f('0x3c')](_0x42cdae['handlePredictive'])){loggerPredictive[_0x937f('0x95')](_0x937f('0x1d3'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x42cdae[_0x937f('0x8f')]);_0x42cdae[_0x937f('0x8f')]=undefined;}_0x42cdae['startProgressive']=moment()[_0x937f('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x42cdae['name'],_0x937f('0x1d4'),_0x42cdae[_0x937f('0x26')]);this[_0x937f('0x15c')](_0x42cdae,0x1);}else if(ifInterval(_0x42cdae['dialPredictiveInterval'],_0x42cdae[_0x937f('0x26')])){this[_0x937f('0x15c')](_0x42cdae,0x1);loggerPredictiveCalls[_0x937f('0x7d')](_0x937f('0x1d5'),_0x42cdae['startProgressive'],_0x42cdae[_0x937f('0x3f')]);_0x42cdae[_0x937f('0x87')]=0x0;_0x42cdae['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x37e3eb<_0x2f7fb6&&_0x42cdae[_0x937f('0x1d6')]==='dropRate'){freeVariablesPredictive(_0x42cdae);loggerPredictive[_0x937f('0x7d')](_0x937f('0x1d7'),_0x937f('0x1d8'),_0x2f7fb6,_0x937f('0x26'),_0x42cdae[_0x937f('0x3f')]);}else if(_0x3f5907<_0x42cdae[_0x937f('0x6d')]&&_0x42cdae['dialPredictiveOptimization']===_0x937f('0x1d9')){freeVariablesPredictive(_0x42cdae);loggerPredictive[_0x937f('0x7d')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x937f('0x1da'),_0x3f5907,_0x937f('0x1db'),_0x42cdae[_0x937f('0x6d')],_0x937f('0x26'),_0x42cdae[_0x937f('0x3f')]);}else if(!ifInterval(_0x42cdae[_0x937f('0x1dc')],_0x42cdae[_0x937f('0x26')])&&_[_0x937f('0x3c')](_0x42cdae[_0x937f('0x72')])&&!_['isUndefined'](_0x42cdae[_0x937f('0x26')])){_0x42cdae[_0x937f('0x72')]=moment()[_0x937f('0x77')](_0x937f('0x104'));loggerPredictive[_0x937f('0x7d')](_0x42cdae[_0x937f('0x3f')],_0x937f('0x1dd'),_0x42cdae[_0x937f('0x72')]);this[_0x937f('0xbf')](_0x42cdae[_0x937f('0x1dc')])['then'](this[_0x937f('0x1de')](_0x42cdae))[_0x937f('0x3b')](mergeDataErlangB(_0x42cdae))['then'](this['startMethodPredictive'](_0x42cdae))[_0x937f('0xb3')](loggerCatchPredictive(_0x937f('0x1df'),_0x42cdae));}else if(!ifInterval(_0x42cdae['dialPredictiveInterval'],_0x42cdae[_0x937f('0x72')])){_0x42cdae[_0x937f('0x6d')]=0x0;_0x42cdae[_0x937f('0x72')]=moment()[_0x937f('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x42cdae['name'],_0x937f('0x1e0'),_0x42cdae[_0x937f('0x72')]);clearInterval(_0x42cdae['handlePredictive']);_0x42cdae[_0x937f('0x8f')]=undefined;this[_0x937f('0xbf')](_0x42cdae['dialPredictiveInterval'])['then'](this[_0x937f('0x1de')](_0x42cdae))[_0x937f('0x3b')](mergeDataErlangB(_0x42cdae))['then'](this[_0x937f('0x1e1')](_0x42cdae))['catch'](loggerCatchPredictive(_0x937f('0x1e2'),_0x42cdae));}else if(_0x42cdae[_0x937f('0x6f')]&&_0x4430e5<_0x42cdae[_0x937f('0x6f')]-_0x15f829){freeVariablesPredictive(_0x42cdae);loggerPredictive[_0x937f('0x7d')](_0x42cdae[_0x937f('0x3f')],_0x937f('0x1e3'),_0x4430e5,_0x937f('0x1e4'),_0x42cdae[_0x937f('0x6f')],'-',_0x15f829,'=',_0x42cdae['predictiveIntervalAvailable']-_0x15f829,')');}else if(_0x42cdae[_0x937f('0x6f')]&&_0x4430e5>_0x42cdae[_0x937f('0x6f')]+_0x28f917){freeVariablesPredictive(_0x42cdae);loggerPredictive[_0x937f('0x7d')](_0x42cdae[_0x937f('0x3f')],_0x937f('0x1e3'),_0x4430e5,_0x937f('0x1e5'),_0x42cdae['predictiveIntervalAvailable'],'+',_0x28f917,'=',_0x42cdae['predictiveIntervalAvailable']+_0x28f917,')');}};Dialer['prototype'][_0x937f('0x1de')]=function(_0x20367f){var _0x4f4136=this;return function(_0x243a9f){return new BPromise(function(_0x1a9cc3,_0x5f0457){_[_0x937f('0x8c')](_0x20367f,_0x243a9f[0x0]);if(checkGetDataPredictive(_0x243a9f[0x0])){var _0x2bc610=_0x20367f['predictiveIntervalAvailable']=_0x20367f[_0x937f('0x54')]+_0x20367f[_0x937f('0x50')];var _0x34591f=_0x20367f[_0x937f('0x1dc')]*0x3c;var _0x164998=_0x243a9f[0x0][_0x937f('0x69')]+_0x243a9f[0x0][_0x937f('0x68')];var _0x7cd974=(_0x243a9f[0x0]['predictiveIntervalAnsweredCalls']+_0x243a9f[0x0][_0x937f('0x6b')]+_0x243a9f[0x0][_0x937f('0x6a')])/_0x243a9f[0x0]['predictiveIntervalTotalCalls'];_0x20367f['predictiveIntervalHitRate']=_0x7cd974>0x0?_0x7cd974:0x1;switch(_0x20367f[_0x937f('0x1d6')]){case'dropRate':var _0x3f22b4=_0x20367f[_0x937f('0x1ce')]/0x64;return _0x4f4136['abandonmentRate'](_0x2bc610,_0x34591f,_0x164998,_0x7cd974,_0x3f22b4)[_0x937f('0x3b')](function(_0x50ff8d){return _0x1a9cc3(_0x50ff8d);});case _0x937f('0x1e6'):var _0x367e84=_0x20367f['dialPredictiveOptimizationPercentage']/0x64;return _0x4f4136[_0x937f('0x1e7')](_0x2bc610,_0x34591f,_0x164998,_0x7cd974,_0x367e84)['then'](function(_0x1d2223){return _0x1a9cc3(_0x1d2223);});default:return _0x5f0457(msgResponse('[getDataPredictive]',_0x937f('0x149'),_0x937f('0x1e8')));}}else{return _0x5f0457(msgResponse(_0x937f('0x1e9'),'Failure',_0x937f('0x1ea')));}});};};Dialer['prototype'][_0x937f('0x1eb')]=function(_0x13531f){var _0x45e5b3=this;return function(_0x1c7ea2){return new BPromise(function(_0x2de24d,_0x1f4ae6){_[_0x937f('0x8c')](_0x13531f,_0x1c7ea2[0x0]);if(checkGetDataPredictive(_0x1c7ea2[0x0])){loggerPredictive[_0x937f('0x7d')](JSON[_0x937f('0x48')](_0x1c7ea2[0x0]));if(_0x13531f[_0x937f('0x1d6')]===_0x937f('0x1d9')){return _0x45e5b3[_0x937f('0xc9')](_0x13531f['id'])['then'](function(_0x4e7b31){var _0x653be7=_0x13531f[_0x937f('0x165')]-_0x4e7b31[0x0]['outboundQueuePauses'];var _0x5a24c6=_0x13531f[_0x937f('0x1dc')]*0x3c;var _0x212c42=_0x1c7ea2[0x0]['predictiveIntervalAvgTalktime']+_0x1c7ea2[0x0][_0x937f('0x68')];var _0x23bd5f=(_0x1c7ea2[0x0][_0x937f('0x1ec')]+_0x1c7ea2[0x0][_0x937f('0x6b')]+_0x1c7ea2[0x0][_0x937f('0x6a')])/_0x1c7ea2[0x0][_0x937f('0x81')];var _0x2a6490=_0x13531f[_0x937f('0x1ce')]/0x64;_0x13531f[_0x937f('0x1ed')]=_0x4e7b31[0x0][_0x937f('0x1ee')]||0x0;_0x13531f[_0x937f('0x6e')]=_0x23bd5f>0x0?_0x23bd5f:0x1;return _0x45e5b3[_0x937f('0x1ef')](_0x653be7,_0x5a24c6,_0x212c42,_0x23bd5f,_0x2a6490);})[_0x937f('0x3b')](function(_0x414857){return _0x2de24d(_0x414857);})['catch'](function(_0x36c44a){return _0x1f4ae6(msgResponse(_0x937f('0x1f0'),_0x937f('0x149'),JSON[_0x937f('0x48')](_0x36c44a)));});}if(_0x13531f[_0x937f('0x1d6')]===_0x937f('0x1e6')){return _0x45e5b3['getVoiceQueueRtPauses'](_0x13531f['id'])[_0x937f('0x3b')](function(_0x5ebd07){var _0x38131a=_0x13531f[_0x937f('0x165')]-_0x5ebd07[0x0][_0x937f('0x1ee')];var _0x523049=_0x13531f[_0x937f('0x1dc')]*0x3c;var _0xbad574=_0x1c7ea2[0x0][_0x937f('0x69')]+_0x1c7ea2[0x0][_0x937f('0x68')];var _0x432e27=(_0x1c7ea2[0x0][_0x937f('0x1ec')]+_0x1c7ea2[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1c7ea2[0x0][_0x937f('0x6a')])/_0x1c7ea2[0x0]['predictiveIntervalTotalCalls'];var _0x2d0eb3=_0x13531f[_0x937f('0x1ce')]/0x64;_0x13531f[_0x937f('0x1ed')]=_0x5ebd07[0x0]['outboundQueuePauses']||0x0;_0x13531f[_0x937f('0x6e')]=_0x432e27>0x0?_0x432e27:0x1;return _0x45e5b3[_0x937f('0x1e7')](_0x38131a,_0x523049,_0xbad574,_0x432e27,_0x2d0eb3);})[_0x937f('0x3b')](function(_0x328ded){return _0x2de24d(_0x328ded);})['catch'](function(_0x3be812){return _0x1f4ae6(msgResponse('[CatchErlangB]',_0x937f('0x149'),JSON[_0x937f('0x48')](_0x3be812)));});}}else{return _0x1f4ae6(msgResponse(_0x937f('0x1e9'),_0x937f('0x149'),_0x937f('0x1ea')));}});};};Dialer[_0x937f('0x1b')][_0x937f('0x1e1')]=function(_0x4c0b37){var _0x44dcc9=this;return function(){var _0x398635=0x0;var _0x4684d2=Math[_0x937f('0x1d1')](_0x4c0b37[_0x937f('0x1f1')]*0x3e8);if(_0x4684d2>0x0){_0x4684d2=_0x4684d2<0x64?0x64:_0x4684d2;loggerPredictive[_0x937f('0x7d')](_0x4c0b37[_0x937f('0x3f')],'one\x20call\x20every:',_0x4684d2,_0x937f('0x49'));_0x4c0b37[_0x937f('0x8f')]=setInterval(function(){_0x44dcc9[_0x937f('0x8f')](_0x4c0b37);loggerPredictiveCalls[_0x937f('0x7d')](_0x937f('0x1f2'),_0x398635+=0x1);},_0x4684d2);}else{loggerPredictive[_0x937f('0x7d')](_0x4c0b37['name'],_0x937f('0x1f3'));}};};Dialer['prototype'][_0x937f('0x1f4')]=function(_0x124760,_0x4a4700){var _0x5c60a6=this;return function(_0x21a005){if(_['isEmpty'](_0x21a005)){if(_['isNil'](_0x4a4700[_0x937f('0xd6')])||!_0x4a4700['recallme']){if(_0x124760[_0x937f('0x5a')]===_0x937f('0x8')){_0x124760[_0x937f('0x130')]=_['isUndefined'](_0x124760[_0x937f('0x130')])?!![]:_0x124760[_0x937f('0x130')];var _0x543273=uuid['v4']();_0x5c60a6[_0x937f('0x24')][_0x543273]=new Action(_0x124760,_0x4a4700,_0x543273);loggerBooked[_0x937f('0x7d')](_0x937f('0x1f5'),_0x543273,_0x937f('0x1f6'),JSON[_0x937f('0x48')](_0x124760[_0x937f('0x130')]),_0x937f('0x1f7'),_0x124760['name']);if(_0x124760[_0x937f('0x130')]){_0x124760[_0x937f('0x130')]=![];_0x5c60a6[_0x937f('0x12c')][_0x5c60a6['actions'][_0x543273]['queue']]=[];ami[_0x937f('0xb0')]({'actionid':_0x543273,'action':_0x937f('0x1f8'),'queue':_0x124760[_0x937f('0x3f')]})[_0x937f('0xb3')](function(){_0x5c60a6['updateOriginated'](_0x124760);_0x5c60a6[_0x937f('0xc2')]({'active':![],'ContactId':_0x5c60a6['actions'][_0x543273][_0x937f('0xd4')],'ListId':_0x5c60a6['actions'][_0x543273][_0x937f('0xd5')],'VoiceQueueId':_0x5c60a6[_0x937f('0x24')][_0x543273][_0x937f('0xd7')]||undefined,'CampaignId':_0x5c60a6[_0x937f('0x24')][_0x543273]['CampaignId']||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x1f9')));delete _0x5c60a6[_0x937f('0x24')][_0x543273];});}else{loggerBooked['info'](_0x937f('0x1fa'),JSON[_0x937f('0x48')](_0x124760[_0x937f('0x130')]),_0x937f('0x1f7'),_0x124760[_0x937f('0x3f')]);_0x5c60a6[_0x937f('0xb4')](_0x124760);_0x5c60a6[_0x937f('0xc2')]({'active':![],'ContactId':_0x5c60a6[_0x937f('0x24')][_0x543273][_0x937f('0xd4')],'ListId':_0x5c60a6['actions'][_0x543273][_0x937f('0xd5')],'VoiceQueueId':_0x5c60a6[_0x937f('0x24')][_0x543273][_0x937f('0xd7')]||undefined,'CampaignId':_0x5c60a6[_0x937f('0x24')][_0x543273]['CampaignId']||undefined})[_0x937f('0xb3')](loggerCatch(_0x937f('0x1f9')));delete _0x5c60a6[_0x937f('0x24')][_0x543273];}}else{return _0x5c60a6['actionOriginate'](_0x124760,_0x4a4700);}}else{if(getDiff(_0x4a4700[_0x937f('0x1fb')])<_0x124760['dialRecallMeTimeout']*0x3c){if(_0x4a4700[_0x937f('0x161')]&&!_0x4a4700[_0x937f('0x161')][_0x937f('0x1fc')]){_0x5c60a6[_0x937f('0x132')]['run'](_0x4a4700['id'])['finally'](function(){_0x5c60a6[_0x937f('0xb4')](_0x124760);});}else{_0x5c60a6[_0x937f('0xc3')]({'active':![]},_0x4a4700['id'],0x1)['finally'](function(){_0x5c60a6[_0x937f('0xb4')](_0x124760);});}}else{_0x124760['outboundReCallsDay']+=0x1;_0x5c60a6['updateOriginated'](_0x124760);if(_0x124760[_0x937f('0x1fd')]){_0x5c60a6[_0x937f('0xc2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a4700[_0x937f('0xd4')],'ListId':_0x4a4700[_0x937f('0xd5')],'VoiceQueueId':_0x4a4700['VoiceQueueId']||undefined,'CampaignId':_0x4a4700[_0x937f('0xd8')]||undefined})['catch'](loggerCatch(_0x937f('0x1fe')));_0x5c60a6[_0x937f('0xcd')](createObjHistory(_0x124760,_0x4a4700,_0x937f('0x1ff'),0x17,_0x937f('0x200')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5c60a6[_0x937f('0xd3')](createObjHistory(_0x124760,_0x4a4700,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x937f('0x201'));}}}}else{_0x124760['outboundBlacklistCallsDay']+=0x1;_0x5c60a6['saveInDb'](createObjHistory(_0x124760,_0x4a4700,_0x937f('0x202'),0xd,_0x937f('0x203')),_0x937f('0x204'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x937f('0x1b')][_0x937f('0x205')]=function(_0x2d0f5e){var _0x3f3d59=this;var _0x533af2=_0x2d0f5e[_0x937f('0x206')]-_0x2d0f5e['originated']-_0x2d0f5e[_0x937f('0xc6')];emitCampaignSummary(_0x2d0f5e);if(_0x533af2>0x0){if(_0x533af2>this[_0x937f('0x22')]){_0x533af2=this[_0x937f('0x22')];}_0x2d0f5e[_0x937f('0xc6')]+=_0x533af2;this[_0x937f('0xc8')](_0x2d0f5e['id'],_0x533af2,_0x2d0f5e[_0x937f('0x207')],_0x2d0f5e)['then'](function(_0x54f36d){_0x2d0f5e[_0x937f('0xc6')]-=_0x533af2;_0x2d0f5e[_0x937f('0xc6')]=_0x2d0f5e[_0x937f('0xc6')]>0x0?_0x2d0f5e[_0x937f('0xc6')]:0x0;if(!checkContactEmpty(_0x54f36d)){_0x2d0f5e['message']=_0x937f('0x9f');logger[_0x937f('0x7d')](_0x937f('0x208')+_0x2d0f5e[_0x937f('0x3f')]);}else{_0x2d0f5e[_0x937f('0x70')]+=_0x54f36d[_0x937f('0x98')];_0x2d0f5e[_0x937f('0x3d')]=_0x937f('0x209');for(var _0xbdf932=0x0;_0xbdf932<_0x54f36d[_0x937f('0x98')];_0xbdf932+=0x1){_0x2d0f5e[_0x937f('0x20a')]+=0x1;if(_[_0x937f('0xaf')](_0x54f36d[_0xbdf932])||_[_0x937f('0xaf')](_0x54f36d[_0xbdf932][_0x937f('0x172')])||_[_0x937f('0xaf')](_0x54f36d[_0xbdf932][_0x937f('0x172')][_0x937f('0x173')])){_0x3f3d59['emptyContact'](_0x937f('0x20b'),_0x2d0f5e,_0x54f36d[_0xbdf932]);}else{_0x3f3d59[_0x937f('0xbd')](_[_0x937f('0x12e')](_0x54f36d[_0xbdf932],[_0x937f('0xd8'),_0x937f('0x20c')]))[_0x937f('0x3b')](_0x3f3d59['checkContactBlack'](_0x2d0f5e,_0x54f36d[_0xbdf932]))[_0x937f('0xb3')](_0x3f3d59[_0x937f('0x20d')](_0x937f('0x20e'),_0x2d0f5e));}}}})[_0x937f('0xb3')](loggerGetContactDialer(_0x937f('0x20f'),_0x2d0f5e,_0x533af2));}};Dialer[_0x937f('0x1b')][_0x937f('0x15c')]=function(_0x667daf,_0x52045d){var _0x2e0135=this;var _0x21d252=[];var _0x44ce04=_0x52045d>=0x1?_0x52045d:0x1;if(_0x667daf[_0x937f('0x5a')]===_0x937f('0x8')){_0x44ce04=0x1;}var _0x541760=Math[_0x937f('0x1d1')](_0x667daf[_0x937f('0x50')]*_0x44ce04)-_0x667daf[_0x937f('0x70')]-_0x667daf['temp'];emitVoiceQueueSummary(_0x667daf);if(_0x667daf[_0x937f('0x210')]>0x0){var _0x31b227=_0x667daf[_0x937f('0x210')]-_0x667daf[_0x937f('0x70')]-_0x667daf['talking']-_0x667daf[_0x937f('0xc6')]-_0x667daf[_0x937f('0x51')];if(_0x541760>_0x31b227){_0x541760=_0x31b227;}}if(_0x541760>0x0){if(_0x667daf['dialMethod']===_0x937f('0x8')){_0x541760=0x1;}if(_0x541760>this[_0x937f('0x22')]){_0x541760=this[_0x937f('0x22')];}_0x667daf[_0x937f('0xc6')]+=_0x541760;for(var _0x1fba14 in this[_0x937f('0x20')]){if(typeof this[_0x937f('0x20')][_0x1fba14]!=='undefined'){if(this['agents'][_0x1fba14][_0x937f('0xa7')]===_0x937f('0x211')&&this[_0x937f('0x20')][_0x1fba14][_0x937f('0xb1')]===_0x937f('0xdf')){_0x21d252['push'](this[_0x937f('0x20')][_0x1fba14]['id']);}}}this[_0x937f('0xc5')](_0x667daf['id'],_0x21d252,_0x541760,_0x667daf[_0x937f('0x207')],_0x667daf)[_0x937f('0x3b')](function(_0x44ef6d){_0x667daf[_0x937f('0xc6')]-=_0x541760;_0x667daf[_0x937f('0xc6')]=_0x667daf[_0x937f('0xc6')]>0x0?_0x667daf[_0x937f('0xc6')]:0x0;if(!checkContactEmpty(_0x44ef6d)){_0x2e0135[_0x937f('0xb9')](_0x667daf)[_0x937f('0x3b')](sendMessageReschedule(_0x667daf))['catch'](loggerCatch(_0x937f('0x212')));}else{_0x667daf['originated']+=_0x44ef6d['length'];_0x667daf[_0x937f('0x3d')]=_0x667daf[_0x937f('0x5a')]===_0x937f('0x8')?'ACTIVE':_0x937f('0x209');for(var _0x330395=0x0;_0x330395<_0x44ef6d[_0x937f('0x98')];_0x330395+=0x1){if(_[_0x937f('0xaf')](_0x44ef6d[_0x330395])||_[_0x937f('0xaf')](_0x44ef6d[_0x330395][_0x937f('0x172')])||_[_0x937f('0xaf')](_0x44ef6d[_0x330395]['Contact'][_0x937f('0x173')])){_0x2e0135[_0x937f('0xd1')](_0x937f('0x20b'),_0x667daf,_0x44ef6d[_0x330395]);}else{_0x2e0135[_0x937f('0xbb')](_[_0x937f('0x12e')](_0x44ef6d[_0x330395],[_0x937f('0xd7'),_0x937f('0x20c')]))['then'](_0x2e0135['checkContactBlack'](_0x667daf,_0x44ef6d[_0x330395]))['catch'](_0x2e0135[_0x937f('0x20d')](_0x937f('0x20b'),_0x667daf));}}}})[_0x937f('0xb3')](loggerGetContactDialer(_0x937f('0x213'),_0x667daf,_0x541760));}};Dialer[_0x937f('0x1b')][_0x937f('0x8f')]=function(_0x312352){if(_0x312352[_0x937f('0x210')]>0x0){var _0x15a7ea=_0x312352[_0x937f('0x210')]-_0x312352[_0x937f('0x70')]-_0x312352['talking'];if(_0x15a7ea>0x0){this['tryOriginatePredictive'](_0x312352);}else{loggerPredictiveCalls[_0x937f('0x7d')]('[handlePredictive][limitChannel]');}}else{this[_0x937f('0x214')](_0x312352);}};Dialer[_0x937f('0x1b')]['tryOriginatePredictive']=function(_0x36f97a){var _0x275c2b=this;var _0x29e922=[];_0x36f97a[_0x937f('0x70')]+=0x1;for(var _0x47a950 in this[_0x937f('0x20')]){if(typeof this[_0x937f('0x20')][_0x47a950]!==_0x937f('0x99')){if(this[_0x937f('0x20')][_0x47a950]['state']==='not_inuse'&&this['agents'][_0x47a950][_0x937f('0xb1')]===_0x937f('0xdf')){_0x29e922[_0x937f('0x12d')](this[_0x937f('0x20')][_0x47a950]['id']);}}}this['getContactDialer'](_0x36f97a['id'],_0x29e922,0x1,_0x36f97a['dialOrderByScheduledAt'],_0x36f97a)[_0x937f('0x3b')](function(_0x1a962e){if(!checkContactEmpty(_0x1a962e)){checkContactLowerLimitOriginate(_0x36f97a,0x1,0x0);_0x275c2b[_0x937f('0xb9')](_0x36f97a)[_0x937f('0x3b')](sendMessageReschedule(_0x36f97a))[_0x937f('0xb3')](loggerCatch(_0x937f('0x212')));}else{_0x36f97a[_0x937f('0x3d')]='RUNNING';if(_[_0x937f('0xaf')](_0x1a962e[0x0])||_[_0x937f('0xaf')](_0x1a962e[0x0][_0x937f('0x172')])||_['isNil'](_0x1a962e[0x0][_0x937f('0x172')]['phone'])){_0x275c2b[_0x937f('0xd1')]('[actionOriginate]\x20',_0x36f97a,_0x1a962e[0x0]);}else{_0x275c2b[_0x937f('0xbb')](_[_0x937f('0x12e')](_0x1a962e[0x0],[_0x937f('0xd7'),'Contact.phone']))[_0x937f('0x3b')](_0x275c2b[_0x937f('0x1f4')](_0x36f97a,_0x1a962e[0x0]))[_0x937f('0xb3')](_0x275c2b[_0x937f('0x20d')](_0x937f('0x215'),_0x36f97a));}}})['catch'](loggerGetContactDialer(_0x937f('0x216'),_0x36f97a,0x1));emitVoiceQueueSummary(_0x36f97a);};Dialer['prototype'][_0x937f('0x1ef')]=function(_0x4a4c77,_0x295cd9,_0x23609b,_0x11bb4a,_0x10f9cd,_0x1c5d8c){loggerPredictive[_0x937f('0x7d')](_0x937f('0x217'));loggerPredictive['info'](_0x937f('0x218'),_0x4a4c77);loggerPredictive[_0x937f('0x7d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x295cd9);loggerPredictive[_0x937f('0x7d')]('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',_0x23609b);loggerPredictive['info']('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',_0x11bb4a);loggerPredictive[_0x937f('0x7d')](_0x937f('0x219'),_0x10f9cd);loggerPredictive[_0x937f('0x7d')](_0x937f('0x80'));return new BPromise(function(_0xda8082,_0x31448f){if(_0x4a4c77<=0x0||isNaN(_0x4a4c77)){return _0x31448f(msgResponse(_0x937f('0x21a'),_0x937f('0x47'),'m\x20=\x20'+_0x4a4c77));}if(_0x23609b<=0x0||isNaN(_0x23609b)){return _0x31448f(msgResponse(_0x937f('0x21a'),'Error','Ts\x20=\x20'+_0x23609b));}if(_0x11bb4a<=0x0||isNaN(_0x11bb4a)){return _0x31448f(msgResponse('[abandonmentRate]',_0x937f('0x47'),_0x937f('0x21b')+_0x11bb4a));}if(_0x295cd9<=0x0||isNaN(_0x295cd9)){return _0x31448f(msgResponse('[abandonmentRate]',_0x937f('0x47'),'interval\x20=\x20'+_0x295cd9));}if(_0x10f9cd<=0x0||isNaN(_0x10f9cd)){return _0x31448f(msgResponse(_0x937f('0x21a'),_0x937f('0x47'),'Amax\x20=\x20'+_0x10f9cd));}_0x1c5d8c=_0x1c5d8c||0x0;var _0x244894=0x1/_0x23609b;var _0x431616=0x0;var _0x4f9fc3=0x0;var _0x43725f=0x0;var _0x250262=0x0;for(var _0x301de9=0x0;_0x43725f<_0x10f9cd;_0x301de9+=0x1){_0x4f9fc3=_0x301de9/_0x295cd9;_0x431616=(_0x11bb4a*_0x4f9fc3+_0x1c5d8c)/_0x244894;_0x43725f=erlangb(_0x431616,_0x4a4c77);_0x250262=_0x431616/_0x4a4c77*(0x1-erlangb(_0x431616,_0x4a4c77));}return _0xda8082({'erlangCalls':_0x301de9,'erlangCallToSecond':_0x295cd9/_0x301de9,'erlangAbandonmentRate':_0x43725f,'erlangBusyFactor':_0x250262});});};Dialer['prototype'][_0x937f('0x1e7')]=function(_0x10eb23,_0x5318a3,_0x5f088a,_0x40b0fe,_0x4e238e,_0x158f94){loggerPredictive[_0x937f('0x7d')](_0x937f('0x21c'));loggerPredictive[_0x937f('0x7d')](_0x937f('0x218'),_0x10eb23);loggerPredictive[_0x937f('0x7d')](_0x937f('0x21d'),_0x5318a3);loggerPredictive['info'](_0x937f('0x21e'),_0x5f088a);loggerPredictive[_0x937f('0x7d')](_0x937f('0x21f'),_0x40b0fe);loggerPredictive[_0x937f('0x7d')](_0x937f('0x220'),_0x4e238e);loggerPredictive[_0x937f('0x7d')](_0x937f('0x80'));return new BPromise(function(_0x2c5ca2,_0x10a74e){if(_0x10eb23<=0x0||isNaN(_0x10eb23)){return _0x10a74e(msgResponse('[busyFactor]','Error','m\x20=\x20'+_0x10eb23));}if(_0x5f088a<=0x0||isNaN(_0x5f088a)){return _0x10a74e(msgResponse('[busyFactor]',_0x937f('0x47'),'Ts\x20=\x20'+_0x5f088a));}if(_0x40b0fe<=0x0||isNaN(_0x40b0fe)){return _0x10a74e(msgResponse('[busyFactor]',_0x937f('0x47'),_0x937f('0x21b')+_0x40b0fe));}if(_0x5318a3<=0x0||isNaN(_0x5318a3)){return _0x10a74e(msgResponse('[busyFactor]',_0x937f('0x47'),'interval\x20=\x20'+_0x5318a3));}if(_0x4e238e<=0x0||isNaN(_0x4e238e)){return _0x10a74e(msgResponse('[busyFactor]',_0x937f('0x47'),_0x937f('0x221')+_0x4e238e));}_0x158f94=_0x158f94||0x0;var _0xae52fe=0x1/_0x5f088a;var _0x3be8d3=0x0;var _0x345cec=0x0;var _0x18717f=0x0;var _0x4dacc5=0x0;for(var _0x51337c=0x0;_0x4dacc5<_0x4e238e;_0x51337c+=0x1){_0x345cec=_0x51337c/_0x5318a3;_0x3be8d3=(_0x40b0fe*_0x345cec+_0x158f94)/_0xae52fe;_0x18717f=erlangb(_0x3be8d3,_0x10eb23);_0x4dacc5=_0x3be8d3/_0x10eb23*(0x1-erlangb(_0x3be8d3,_0x10eb23));}return _0x2c5ca2({'erlangCalls':_0x51337c,'erlangCallToSecond':_0x5318a3/_0x51337c,'erlangAbandonmentRate':_0x18717f,'erlangBusyFactor':_0x4dacc5});});};module[_0x937f('0x222')]=Dialer;
\ No newline at end of file
index 71635a1..1e09945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2863=['util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x47dcb1,_0x2e7067){var _0x532b9f=function(_0x1f3fb5){while(--_0x1f3fb5){_0x47dcb1['push'](_0x47dcb1['shift']());}};_0x532b9f(++_0x2e7067);}(_0x2863,0xd2));var _0x3286=function(_0x3783f5,_0x2616a4){_0x3783f5=_0x3783f5-0x0;var _0xb06deb=_0x2863[_0x3783f5];return _0xb06deb;};'use strict';var util=require(_0x3286('0x0'));var _=require(_0x3286('0x1'));var moment=require(_0x3286('0x2'));function getSeconds(_0x1fcf4a,_0x6fb0d7){var _0x3d7d90=moment(_0x1fcf4a)[_0x3286('0x3')](0x0);var _0x52047c=moment(_0x6fb0d7)[_0x3286('0x3')](0x0);return _0x3d7d90[_0x3286('0x4')](_0x52047c,_0x3286('0x5'));}function QueueCallerAbandon(_0x5c49fd,_0x10d757){this[_0x3286('0x6')]=_0x5c49fd[_0x3286('0x6')];this['type']=_0x5c49fd[_0x3286('0x7')];this[_0x3286('0x8')]=_0x5c49fd[_0x3286('0x7')]==='outbound'?_0x3286('0x9'):_0x5c49fd[_0x3286('0x7')];this[_0x3286('0xa')]=_0x5c49fd[_0x3286('0xa')];this['countcongestionretry']=_0x5c49fd[_0x3286('0xb')];this[_0x3286('0xc')]=_0x5c49fd[_0x3286('0xc')];this[_0x3286('0xd')]=_0x5c49fd[_0x3286('0xa')]+_0x5c49fd[_0x3286('0xb')]+_0x5c49fd[_0x3286('0xc')]+_0x5c49fd['countnosuchnumberretry']+_0x5c49fd[_0x3286('0xe')]+_0x5c49fd[_0x3286('0xf')]+_0x5c49fd['countmachineretry']+_0x5c49fd[_0x3286('0x10')];this[_0x3286('0x11')]=_0x5c49fd['countnosuchnumberretry'];this[_0x3286('0xe')]=_0x5c49fd['countdropretry'];this[_0x3286('0xf')]=_0x5c49fd['countabandonedretry'];this['countmachineretry']=_0x5c49fd[_0x3286('0x12')];this['countagentrejectretry']=_0x5c49fd[_0x3286('0x10')];this[_0x3286('0x13')]=_0x10d757[_0x3286('0x13')];this[_0x3286('0x14')]=_0x5c49fd[_0x3286('0x15')];this['calleridnum']=_0x5c49fd['number'];this[_0x3286('0x16')]=_0x5c49fd['starttime'];this['responsetime']=_0x5c49fd[_0x3286('0x17')];this[_0x3286('0x18')]=_0x5c49fd[_0x3286('0x18')];this[_0x3286('0x19')]=this[_0x3286('0x18')];this[_0x3286('0x1a')]=getSeconds(_0x5c49fd['responsetime'],_0x5c49fd[_0x3286('0x16')]);this[_0x3286('0x1b')]=getSeconds(this[_0x3286('0x18')],_0x5c49fd['responsetime']);this[_0x3286('0x1c')]=0x0;this[_0x3286('0x9')]=_0x10d757[_0x3286('0x9')];this[_0x3286('0x1d')]=_0x10d757[_0x3286('0x1e')];this['reason']=_0x10d757[_0x3286('0x1f')];this[_0x3286('0x20')]=_0x5c49fd['callback'];this[_0x3286('0x21')]=_0x5c49fd['callbackuniqueid'];this['callbackat']=_0x5c49fd['callbackat'];this[_0x3286('0x22')]=_0x5c49fd[_0x3286('0x22')];this[_0x3286('0x23')]=_0x5c49fd[_0x3286('0x23')];this[_0x3286('0x24')]=_0x5c49fd[_0x3286('0x24')];this[_0x3286('0x25')]=_0x5c49fd[_0x3286('0x25')];this['VoiceQueueId']=_0x5c49fd[_0x3286('0x26')];this[_0x3286('0x27')]=_0x5c49fd[_0x3286('0x27')];this['originatecalleridnum']=_0x5c49fd[_0x3286('0x28')]||'';this['originatecalleridname']=_0x5c49fd[_0x3286('0x29')]||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
+var _0x7d10=['uniqueid','calleridname','name','number','starttime','responsetime','droptime','ringtime','talktime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x7d10,0x1ce));var _0x07d1=function(_0x272ad5,_0x42018d){_0x272ad5=_0x272ad5-0x0;var _0x7bf3b=_0x7d10[_0x272ad5];return _0x7bf3b;};'use strict';var util=require('util');var _=require(_0x07d1('0x0'));var moment=require(_0x07d1('0x1'));function getSeconds(_0x59ec6b,_0xd63e59){var _0x4f305c=moment(_0x59ec6b)['milliseconds'](0x0);var _0x2a808e=moment(_0xd63e59)[_0x07d1('0x2')](0x0);return _0x4f305c['diff'](_0x2a808e,_0x07d1('0x3'));}function QueueCallerAbandon(_0x3a3110,_0x1c8f3d){this[_0x07d1('0x4')]=_0x3a3110['scheduledat'];this[_0x07d1('0x5')]=_0x3a3110[_0x07d1('0x5')];this[_0x07d1('0x6')]=_0x3a3110[_0x07d1('0x5')]===_0x07d1('0x7')?_0x07d1('0x8'):_0x3a3110[_0x07d1('0x5')];this[_0x07d1('0x9')]=_0x3a3110[_0x07d1('0x9')];this[_0x07d1('0xa')]=_0x3a3110[_0x07d1('0xa')];this[_0x07d1('0xb')]=_0x3a3110[_0x07d1('0xb')];this[_0x07d1('0xc')]=_0x3a3110[_0x07d1('0x9')]+_0x3a3110['countcongestionretry']+_0x3a3110['countnoanswerretry']+_0x3a3110[_0x07d1('0xd')]+_0x3a3110[_0x07d1('0xe')]+_0x3a3110[_0x07d1('0xf')]+_0x3a3110[_0x07d1('0x10')]+_0x3a3110[_0x07d1('0x11')];this[_0x07d1('0xd')]=_0x3a3110[_0x07d1('0xd')];this[_0x07d1('0xe')]=_0x3a3110[_0x07d1('0xe')];this[_0x07d1('0xf')]=_0x3a3110['countabandonedretry'];this[_0x07d1('0x10')]=_0x3a3110[_0x07d1('0x10')];this[_0x07d1('0x11')]=_0x3a3110[_0x07d1('0x11')];this['uniqueid']=_0x1c8f3d[_0x07d1('0x12')];this[_0x07d1('0x13')]=_0x3a3110[_0x07d1('0x14')];this['calleridnum']=_0x3a3110[_0x07d1('0x15')];this[_0x07d1('0x16')]=_0x3a3110[_0x07d1('0x16')];this[_0x07d1('0x17')]=_0x3a3110[_0x07d1('0x17')];this[_0x07d1('0x18')]=_0x3a3110[_0x07d1('0x18')];this['endtime']=this['droptime'];this[_0x07d1('0x19')]=getSeconds(_0x3a3110['responsetime'],_0x3a3110[_0x07d1('0x16')]);this['holdtime']=getSeconds(this[_0x07d1('0x18')],_0x3a3110[_0x07d1('0x17')]);this[_0x07d1('0x1a')]=0x0;this[_0x07d1('0x8')]=_0x1c8f3d[_0x07d1('0x8')];this[_0x07d1('0x1b')]=_0x1c8f3d[_0x07d1('0x1c')];this[_0x07d1('0x1d')]=_0x1c8f3d[_0x07d1('0x1d')];this['callback']=_0x3a3110['callback'];this['callbackuniqueid']=_0x3a3110[_0x07d1('0x1e')];this['callbackat']=_0x3a3110[_0x07d1('0x1f')];this[_0x07d1('0x20')]=_0x3a3110[_0x07d1('0x20')];this[_0x07d1('0x21')]=_0x3a3110[_0x07d1('0x21')];this['ListId']=_0x3a3110[_0x07d1('0x22')];this[_0x07d1('0x23')]=_0x3a3110[_0x07d1('0x23')];this[_0x07d1('0x24')]=_0x3a3110[_0x07d1('0x24')];this['CampaignId']=_0x3a3110[_0x07d1('0x25')];this[_0x07d1('0x26')]=_0x3a3110[_0x07d1('0x26')]||'';this[_0x07d1('0x27')]=_0x3a3110[_0x07d1('0x27')]||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 354dd1f..415f511 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(_0x7ed7a0,_0x2113f7){var _0x52932b=function(_0x20839d){while(--_0x20839d){_0x7ed7a0['push'](_0x7ed7a0['shift']());}};_0x52932b(++_0x2113f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x5d3188,_0x11725d){var _0x162dd0=function(_0x53c0f7){while(--_0x53c0f7){_0x5d3188['push'](_0x5d3188['shift']());}};_0x162dd0(++_0x11725d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 939afe2..34c3ede 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087b=['\x20result\x20conversion\x20file\x20','message','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','then','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','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','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','context','hasOwnProperty','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum'];(function(_0x472c34,_0x3cd9be){var _0x3dfd7c=function(_0x49e2cc){while(--_0x49e2cc){_0x472c34['push'](_0x472c34['shift']());}};_0x3dfd7c(++_0x3cd9be);}(_0x087b,0x11a));var _0xb087=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x087b[_0x486f4a];return _0x135d99;};'use strict';var util=require(_0xb087('0x0'));var _=require(_0xb087('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xb087('0x2'));var path=require('path');var tiff2pdf=require(_0xb087('0x3'));var gs=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var ami=require(_0xb087('0x7'));var rpcDb=require(_0xb087('0x8'));var Channel=require(_0xb087('0x9'));var ut=require(_0xb087('0xa'));var Action=require(_0xb087('0xb'));var faxAccount=require(_0xb087('0xc'));var attachment=require(_0xb087('0xd'));var faxMessage=require(_0xb087('0xe'));function Fax(_0x1dbe9f){this[_0xb087('0xf')]={};this[_0xb087('0x10')]=_0x1dbe9f[_0xb087('0x10')];this[_0xb087('0x11')]=_0x1dbe9f['trunks'];this[_0xb087('0x12')]={};ami['on'](_0xb087('0x13'),this[_0xb087('0x14')][_0xb087('0x15')](this));ami['on'](_0xb087('0x16'),this[_0xb087('0x17')][_0xb087('0x15')](this));ami['on']('newstate',this[_0xb087('0x18')][_0xb087('0x15')](this));ami['on'](_0xb087('0x19'),this['syncNewExten'][_0xb087('0x15')](this));ami['on'](_0xb087('0x1a'),this[_0xb087('0x1b')][_0xb087('0x15')](this));ami['on'](_0xb087('0x1c'),this[_0xb087('0x1d')][_0xb087('0x15')](this));ami['on'](_0xb087('0x1e'),this[_0xb087('0x1f')][_0xb087('0x15')](this));ami['on']('originateresponse',this[_0xb087('0x20')][_0xb087('0x15')](this));}Fax['prototype'][_0xb087('0x14')]=function(_0x2b83b7){if(_0x2b83b7[_0xb087('0x21')]==='from-voip-provider'){for(var _0x330005 in this[_0xb087('0x10')]){if(this[_0xb087('0x10')][_0xb087('0x22')](_0x330005)){if(_0x2b83b7['exten']===this[_0xb087('0x10')][_0x330005][_0xb087('0x23')]){this[_0xb087('0xf')][_0x2b83b7[_0xb087('0x24')]]={};this['channels'][_0x2b83b7['uniqueid']]['channel']=_0x2b83b7['channel'];this[_0xb087('0xf')][_0x2b83b7[_0xb087('0x24')]]['id']=this[_0xb087('0x10')][_0x330005]['id'];this[_0xb087('0xf')][_0x2b83b7[_0xb087('0x24')]][_0xb087('0x25')]=this[_0xb087('0x10')][_0x330005]['name'];logger[_0xb087('0x26')](_0x2b83b7[_0xb087('0x24')],_0xb087('0x27'));}}}}if(this[_0xb087('0x12')][_0x2b83b7[_0xb087('0x24')]]){this['channels'][_0x2b83b7[_0xb087('0x24')]]={};this[_0xb087('0xf')][_0x2b83b7['uniqueid']]['channel']=_0x2b83b7['channel'];logger['info'](_0x2b83b7['uniqueid'],_0xb087('0x27'));}};Fax[_0xb087('0x28')][_0xb087('0x17')]=function(_0x3ca2df){if(this[_0xb087('0xf')][_0x3ca2df[_0xb087('0x24')]]){for(var _0xf3f41f in _0x3ca2df[_0xb087('0x29')]){if(_0x3ca2df[_0xb087('0x29')][_0xb087('0x22')](_0xf3f41f)){this[_0xb087('0xf')][_0x3ca2df[_0xb087('0x24')]][_0xf3f41f]=_0x3ca2df[_0xb087('0x2a')];}}}};Fax[_0xb087('0x28')]['syncNewState']=function(_0x37393a){if(this[_0xb087('0xf')][_0x37393a[_0xb087('0x24')]]){this[_0xb087('0xf')][_0x37393a[_0xb087('0x24')]][_0xb087('0x2b')]=_0x37393a[_0xb087('0x2b')];this[_0xb087('0xf')][_0x37393a['uniqueid']]['channelstatedesc']=_0x37393a[_0xb087('0x2c')];}};Fax[_0xb087('0x28')]['syncNewExten']=function(_0x60bfe2){if(this[_0xb087('0xf')][_0x60bfe2[_0xb087('0x24')]]){for(var _0x32b20d in _0x60bfe2[_0xb087('0x29')]){if(_0x60bfe2[_0xb087('0x29')][_0xb087('0x22')](_0x32b20d)){this[_0xb087('0xf')][_0x60bfe2[_0xb087('0x24')]][_0x32b20d]=_0x60bfe2[_0xb087('0x2a')];}}}};Fax[_0xb087('0x28')][_0xb087('0x1b')]=function(_0x57ae94){if(this[_0xb087('0xf')][_0x57ae94['uniqueid']]){this[_0xb087('0xf')][_0x57ae94[_0xb087('0x24')]][_0xb087('0x2d')]=_0x57ae94[_0xb087('0x2d')];this[_0xb087('0xf')][_0x57ae94[_0xb087('0x24')]][_0xb087('0x2e')]=_0x57ae94[_0xb087('0x2e')];this[_0xb087('0xf')][_0x57ae94['uniqueid']]['localstationid']=_0x57ae94[_0xb087('0x23')];this[_0xb087('0xf')][_0x57ae94[_0xb087('0x24')]][_0xb087('0x2f')]=_0x57ae94[_0xb087('0x2f')];logger['info'](_0x57ae94[_0xb087('0x24')],_0xb087('0x30'));}};Fax['prototype']['syncReceiveFax']=function(_0x1726c2){var _0x1c7d90=this;if(this[_0xb087('0xf')][_0x1726c2['uniqueid']]){var _0x25d8de=this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]]['id'];this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]]['remotestationid']=_0x1726c2[_0xb087('0x31')];this['channels'][_0x1726c2[_0xb087('0x24')]]['pagestransferred']=_0x1726c2[_0xb087('0x32')];this[_0xb087('0xf')][_0x1726c2['uniqueid']][_0xb087('0x23')]=_0x1726c2['localstationid'];this[_0xb087('0xf')][_0x1726c2['uniqueid']][_0xb087('0x33')]=_0x1726c2[_0xb087('0x33')];this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]][_0xb087('0x34')]=_0x1726c2[_0xb087('0x34')];this[_0xb087('0xf')][_0x1726c2['uniqueid']][_0xb087('0x2f')]=_0x1726c2['filename'];this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]]['calleridnum']=_0x1726c2[_0xb087('0x35')];if(this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x1726c2[_0xb087('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x2ff54e){logger[_0xb087('0x26')](_0x1726c2['uniqueid'],_0xb087('0x36'),_0x2ff54e[_0xb087('0x37')]);attachment['create']({'name':path[_0xb087('0x38')](_0x1726c2[_0xb087('0x2f')])['name'],'basename':path[_0xb087('0x38')](_0x1726c2[_0xb087('0x2f')])[_0xb087('0x25')]+_0xb087('0x39'),'type':'application/pdf'})['then'](function(_0x1a16d7){faxAccount[_0xb087('0x3a')](_0x25d8de,{'from':_0x1726c2[_0xb087('0x35')],'mapKey':_0xb087('0x6'),'body':path[_0xb087('0x38')](_0x1726c2[_0xb087('0x2f')])['name']+'.pdf','AttachmentId':_0x1a16d7['id']})[_0xb087('0x3b')](function(_0x520acc){logger[_0xb087('0x3c')](_0x1726c2[_0xb087('0x24')],_0xb087('0x3d'),JSON[_0xb087('0x3e')](_0x520acc));});})['catch'](function(_0x2be4f2){logger['error'](_0x1726c2[_0xb087('0x24')],_0xb087('0x3f'),JSON[_0xb087('0x3e')](_0x2be4f2));});});}logger[_0xb087('0x26')](_0x1726c2[_0xb087('0x24')],'\x20receiveFax\x20');}};Fax[_0xb087('0x28')][_0xb087('0x20')]=function(_0x588d96){if(this['actions'][_0x588d96[_0xb087('0x24')]]){_['merge'](this['channels'][_0x588d96[_0xb087('0x24')]],_[_0xb087('0x40')](_0x588d96,['response',_0xb087('0x41')]));}};function updateStatus(_0x2aa54c){if(_0x2aa54c[_0xb087('0x42')]){faxMessage['update'](_0x2aa54c['AttachmentId'],{'failMessage':_0xb087('0x43')})['then'](function(_0x5e40cb){ut[_0xb087('0x44')](_0xb087('0x45'),_0x5e40cb);})[_0xb087('0x3b')](function(_0x4067cf){ut[_0xb087('0x44')](_0xb087('0x46'),_0x4067cf);});}else{ut[_0xb087('0x44')](_0xb087('0x47'));}}Fax[_0xb087('0x28')][_0xb087('0x48')]=function(_0x47d47c,_0x2cfc44,_0x55e653){var _0x46d570=this;var _0x46548e={};if(_0x2cfc44){_0x46548e={'read':_0x2cfc44};}else{_0x46548e={'failMessage':_0x55e653};}if(this['actions'][_0x47d47c][_0xb087('0x42')]){faxMessage[_0xb087('0x49')](this[_0xb087('0x12')][_0x47d47c][_0xb087('0x42')],_0x46548e)[_0xb087('0x4a')](function(_0x3c85d1){ut[_0xb087('0x44')](_0xb087('0x4b'),_0x3c85d1);})[_0xb087('0x3b')](function(_0x357616){ut[_0xb087('0x44')]('[Fax][Message][NoUpdate1]',_0x357616);})[_0xb087('0x4c')](function(){delete _0x46d570['channels'][_0x47d47c];delete _0x46d570[_0xb087('0x12')][_0x47d47c];});}else{ut['logger'](_0xb087('0x4d'));delete this[_0xb087('0xf')][_0x47d47c];delete this[_0xb087('0x12')][_0x47d47c];}};Fax[_0xb087('0x28')][_0xb087('0x1f')]=function(_0x465ef6){var _0x383304=this;if(this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]]){if(this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]]){this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]]['id']=this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]]['id'];this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]][_0xb087('0x25')]=this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]][_0xb087('0x25')];}logger[_0xb087('0x26')](_0x465ef6['uniqueid'],this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]]?_0xb087('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0xb087('0x3e')](this[_0xb087('0xf')][_0x465ef6['uniqueid']]));if(this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]]){if(this[_0xb087('0xf')][_0x465ef6['uniqueid']][_0xb087('0x4f')]>0x0&&this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]][_0xb087('0x1a')]===_0xb087('0x50')){this[_0xb087('0x48')](_0x465ef6[_0xb087('0x24')],!![]);}else{this[_0xb087('0x48')](_0x465ef6['uniqueid'],![],this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]][_0xb087('0x51')]?'SENDING\x20FAILED:\x20'+this[_0xb087('0xf')][_0x465ef6['uniqueid']]['faxstatusstring']:_0xb087('0x52'));}}}};Fax[_0xb087('0x28')]['send']=function(_0x298fdb){var _0x524d18=this;return new BPromise(function(_0x52a263,_0x1a8237){_0x524d18['execOriginate'](_0x298fdb,_0x524d18['faxAccounts'][_0x298fdb[_0xb087('0x53')]])['then'](function(_0x5ede2e){ut[_0xb087('0x44')]('[Fax][execOriginate][success]',_0x5ede2e);_0x52a263(ut[_0xb087('0x37')]('Fax\x20received'));})[_0xb087('0x3b')](function(_0x132dd8){ut[_0xb087('0x44')](_0xb087('0x54'),_0x132dd8);updateStatus(_0x298fdb);_0x1a8237(ut[_0xb087('0x37')](_0xb087('0x55')));});});};Fax['prototype'][_0xb087('0x56')]=function(_0x4b8a79){var _0x22e010=this;return new BPromise(function(_0x245efb,_0x1060e1){var _0x59490f=_0x22e010[_0xb087('0x57')](_0x22e010['faxAccounts'][_0x4b8a79[_0xb087('0x53')]][_0xb087('0x58')],_0x4b8a79);if(_0x59490f[_0xb087('0x59')]){_0x245efb(ut[_0xb087('0x37')](_0xb087('0x5a')));}else{_0x1060e1(ut[_0xb087('0x37')](_0x59490f['message']));}});};function originate(_0x245d68,_0xd01a6b,_0x4bedbd){return new BPromise(function(_0x25a45f,_0x58de88){if(_0x4bedbd){var _0x19238d=util[_0xb087('0x5b')](_0xb087('0x5c'),path[_0xb087('0x38')](_0x245d68[_0xb087('0x5d')])[_0xb087('0x25')],_0x245d68[_0xb087('0x5d')]);gs[_0xb087('0x5e')](_0x19238d)['then'](function(){_0x245d68['path']=util['format'](_0xb087('0x5f'),path['parse'](_0x245d68[_0xb087('0x5d')])['dir'],path[_0xb087('0x38')](_0x245d68[_0xb087('0x5d')])[_0xb087('0x25')]);_0xd01a6b[_0xb087('0x60')]=_0x245d68['path'];ut[_0xb087('0x44')]('Convert\x20pdf\x20to\x20tif','');ami[_0xb087('0x61')](ut[_0xb087('0x62')](_0x245d68,_0xd01a6b))[_0xb087('0x4a')](function(_0x42f4a3){_0x25a45f(_0x42f4a3);})['catch'](function(_0x49d26a){_0x58de88(_0x49d26a);});})[_0xb087('0x3b')](function(_0x5a16bb){_0x58de88(_0x5a16bb);});}else{ami[_0xb087('0x61')](ut[_0xb087('0x62')](_0x245d68,_0xd01a6b))[_0xb087('0x4a')](function(_0x3a96ba){_0x25a45f(_0x3a96ba);})['catch'](function(_0x4bdd30){_0x58de88(_0x4bdd30);});}});}Fax[_0xb087('0x28')]['execOriginate']=function(_0x34e72c,_0x1c7cd7){var _0x445cb8=this;return new BPromise(function(_0x2f9631,_0x142b0f){var _0x581ad4=uuid['v4']();var _0x40af15=ut[_0xb087('0x63')](_0x34e72c,_0x1c7cd7);_0x445cb8['actions'][_0x581ad4]=new Action(_0x581ad4,_0x1c7cd7,_0x34e72c);var _0x544ee0=_0x445cb8['actions'][_0x581ad4];if(path[_0xb087('0x38')](_0x34e72c[_0xb087('0x5d')])[_0xb087('0x64')]===_0xb087('0x39')){originate(_0x544ee0,_0x40af15,!![])[_0xb087('0x4a')](function(_0x19d7ae){_0x2f9631(_0x19d7ae);})['catch'](function(_0xd1f58a){_0x142b0f(_0xd1f58a);});}else{originate(_0x544ee0,_0x40af15,![])[_0xb087('0x4a')](function(_0x1e01c5){_0x2f9631(_0x1e01c5);})[_0xb087('0x3b')](function(_0x42f6bd){_0x142b0f(_0x42f6bd);});}});};Fax[_0xb087('0x28')][_0xb087('0x65')]=function(_0x50454b){return!_[_0xb087('0x66')](_0x50454b)&&!_[_0xb087('0x66')](_0x50454b[_0xb087('0x25')])&&!_['isNil'](_0x50454b[_0xb087('0x67')])&&_0x50454b['active']&&!_[_0xb087('0x66')](this[_0xb087('0x11')][util[_0xb087('0x5b')](_0xb087('0x68'),_0x50454b[_0xb087('0x25')])])&&!_[_0xb087('0x66')](this['trunks'][util['format'](_0xb087('0x68'),_0x50454b[_0xb087('0x25')])]['status'])&&(this[_0xb087('0x11')][util[_0xb087('0x5b')](_0xb087('0x68'),_0x50454b[_0xb087('0x25')])][_0xb087('0x2e')]===_0xb087('0x69')||this['trunks'][util[_0xb087('0x5b')](_0xb087('0x68'),_0x50454b[_0xb087('0x25')])][_0xb087('0x2e')]===_0xb087('0x6a'));};Fax[_0xb087('0x28')][_0xb087('0x57')]=function(_0x1fc613,_0x1dc1ae){if(!this['isTrunkReachable'](_0x1fc613)){ut[_0xb087('0x44')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xb087('0x66')](_0x1fc613)?'':_0x1fc613[_0xb087('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xb087('0x6b')};}if(_[_0xb087('0x66')](_0x1dc1ae[_0xb087('0x6')])){ut[_0xb087('0x44')](_0xb087('0x6c'),JSON[_0xb087('0x3e')](_0x1dc1ae));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xb087('0x66')](_0x1dc1ae[_0xb087('0x5d')])){ut[_0xb087('0x44')](_0xb087('0x6d'),JSON[_0xb087('0x3e')](_0x1dc1ae));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xb087('0x6e')};};module[_0xb087('0x6f')]=Fax;
\ No newline at end of file
+var _0x4213=['Is\x20Valid','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','fax','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','pick','response','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','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','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','trunks','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]'];(function(_0x5efd61,_0x3e7214){var _0x2148d7=function(_0x180a25){while(--_0x180a25){_0x5efd61['push'](_0x5efd61['shift']());}};_0x2148d7(++_0x3e7214);}(_0x4213,0x77));var _0x3421=function(_0x1cf932,_0x3ce5ee){_0x1cf932=_0x1cf932-0x0;var _0x4cd0e0=_0x4213[_0x1cf932];return _0x4cd0e0;};'use strict';var util=require(_0x3421('0x0'));var _=require(_0x3421('0x1'));var BPromise=require(_0x3421('0x2'));var uuid=require(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var path=require(_0x3421('0x5'));var tiff2pdf=require(_0x3421('0x6'));var gs=require('./util/gs');var logger=require(_0x3421('0x7'))('fax');var ami=require(_0x3421('0x8'));var rpcDb=require(_0x3421('0x9'));var Channel=require(_0x3421('0xa'));var ut=require(_0x3421('0xb'));var Action=require('./action');var faxAccount=require(_0x3421('0xc'));var attachment=require(_0x3421('0xd'));var faxMessage=require(_0x3421('0xe'));function Fax(_0x1cf6a0){this[_0x3421('0xf')]={};this['faxAccounts']=_0x1cf6a0[_0x3421('0x10')];this['trunks']=_0x1cf6a0['trunks'];this[_0x3421('0x11')]={};ami['on']('newchannel',this[_0x3421('0x12')][_0x3421('0x13')](this));ami['on'](_0x3421('0x14'),this[_0x3421('0x15')][_0x3421('0x13')](this));ami['on'](_0x3421('0x16'),this[_0x3421('0x17')]['bind'](this));ami['on'](_0x3421('0x18'),this[_0x3421('0x19')][_0x3421('0x13')](this));ami['on'](_0x3421('0x1a'),this[_0x3421('0x1b')][_0x3421('0x13')](this));ami['on'](_0x3421('0x1c'),this['syncReceiveFax'][_0x3421('0x13')](this));ami['on']('hangup',this[_0x3421('0x1d')][_0x3421('0x13')](this));ami['on']('originateresponse',this[_0x3421('0x1e')]['bind'](this));}Fax[_0x3421('0x1f')][_0x3421('0x12')]=function(_0x52af2d){if(_0x52af2d[_0x3421('0x20')]===_0x3421('0x21')){for(var _0x130d3c in this[_0x3421('0x10')]){if(this[_0x3421('0x10')][_0x3421('0x22')](_0x130d3c)){if(_0x52af2d[_0x3421('0x23')]===this[_0x3421('0x10')][_0x130d3c][_0x3421('0x24')]){this[_0x3421('0xf')][_0x52af2d[_0x3421('0x25')]]={};this['channels'][_0x52af2d[_0x3421('0x25')]]['channel']=_0x52af2d['channel'];this['channels'][_0x52af2d[_0x3421('0x25')]]['id']=this[_0x3421('0x10')][_0x130d3c]['id'];this[_0x3421('0xf')][_0x52af2d[_0x3421('0x25')]][_0x3421('0x26')]=this[_0x3421('0x10')][_0x130d3c][_0x3421('0x26')];logger[_0x3421('0x27')](_0x52af2d[_0x3421('0x25')],_0x3421('0x28'));}}}}if(this['actions'][_0x52af2d['uniqueid']]){this['channels'][_0x52af2d[_0x3421('0x25')]]={};this[_0x3421('0xf')][_0x52af2d[_0x3421('0x25')]]['channel']=_0x52af2d['channel'];logger[_0x3421('0x27')](_0x52af2d['uniqueid'],_0x3421('0x28'));}};Fax['prototype'][_0x3421('0x15')]=function(_0x224796){if(this[_0x3421('0xf')][_0x224796[_0x3421('0x25')]]){for(var _0x186885 in _0x224796['variable']){if(_0x224796[_0x3421('0x29')]['hasOwnProperty'](_0x186885)){this['channels'][_0x224796[_0x3421('0x25')]][_0x186885]=_0x224796['value'];}}}};Fax['prototype'][_0x3421('0x17')]=function(_0x4ee4aa){if(this[_0x3421('0xf')][_0x4ee4aa['uniqueid']]){this[_0x3421('0xf')][_0x4ee4aa[_0x3421('0x25')]]['channelstate']=_0x4ee4aa[_0x3421('0x2a')];this[_0x3421('0xf')][_0x4ee4aa[_0x3421('0x25')]]['channelstatedesc']=_0x4ee4aa[_0x3421('0x2b')];}};Fax['prototype'][_0x3421('0x19')]=function(_0xf0039){if(this[_0x3421('0xf')][_0xf0039[_0x3421('0x25')]]){for(var _0x3875c6 in _0xf0039[_0x3421('0x29')]){if(_0xf0039[_0x3421('0x29')][_0x3421('0x22')](_0x3875c6)){this[_0x3421('0xf')][_0xf0039[_0x3421('0x25')]][_0x3875c6]=_0xf0039['value'];}}}};Fax['prototype'][_0x3421('0x1b')]=function(_0x1c21a8){if(this['channels'][_0x1c21a8[_0x3421('0x25')]]){this[_0x3421('0xf')][_0x1c21a8[_0x3421('0x25')]][_0x3421('0x2c')]=_0x1c21a8[_0x3421('0x2c')];this['channels'][_0x1c21a8[_0x3421('0x25')]][_0x3421('0x2d')]=_0x1c21a8[_0x3421('0x2d')];this['channels'][_0x1c21a8[_0x3421('0x25')]]['localstationid']=_0x1c21a8[_0x3421('0x24')];this[_0x3421('0xf')][_0x1c21a8[_0x3421('0x25')]][_0x3421('0x2e')]=_0x1c21a8[_0x3421('0x2e')];logger[_0x3421('0x27')](_0x1c21a8[_0x3421('0x25')],'\x20syncFaxStatus\x20');}};Fax['prototype']['syncReceiveFax']=function(_0x4696f3){var _0x4edf62=this;if(this['channels'][_0x4696f3[_0x3421('0x25')]]){var _0x4e76e0=this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]]['id'];this['channels'][_0x4696f3[_0x3421('0x25')]][_0x3421('0x2f')]=_0x4696f3[_0x3421('0x2f')];this[_0x3421('0xf')][_0x4696f3['uniqueid']][_0x3421('0x30')]=_0x4696f3[_0x3421('0x30')];this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]][_0x3421('0x24')]=_0x4696f3['localstationid'];this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]]['resolution']=_0x4696f3[_0x3421('0x31')];this['channels'][_0x4696f3['uniqueid']]['transferrate']=_0x4696f3[_0x3421('0x32')];this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]][_0x3421('0x2e')]=_0x4696f3[_0x3421('0x2e')];this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]][_0x3421('0x33')]=_0x4696f3[_0x3421('0x33')];if(this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]][_0x3421('0x30')]>0x0){tiff2pdf(_0x4696f3[_0x3421('0x2e')],_0x3421('0x34'),function(_0x50407f){logger[_0x3421('0x27')](_0x4696f3[_0x3421('0x25')],_0x3421('0x35'),_0x50407f[_0x3421('0x36')]);attachment['create']({'name':path[_0x3421('0x37')](_0x4696f3['filename'])[_0x3421('0x26')],'basename':path[_0x3421('0x37')](_0x4696f3[_0x3421('0x2e')])[_0x3421('0x26')]+_0x3421('0x38'),'type':_0x3421('0x39')})[_0x3421('0x3a')](function(_0x305951){faxAccount[_0x3421('0x3b')](_0x4e76e0,{'from':_0x4696f3[_0x3421('0x33')],'mapKey':_0x3421('0x3c'),'body':path[_0x3421('0x37')](_0x4696f3[_0x3421('0x2e')])['name']+_0x3421('0x38'),'AttachmentId':_0x305951['id']})['catch'](function(_0x1a029b){logger[_0x3421('0x3d')](_0x4696f3[_0x3421('0x25')],_0x3421('0x3e'),JSON[_0x3421('0x3f')](_0x1a029b));});})[_0x3421('0x40')](function(_0x2a11a3){logger[_0x3421('0x3d')](_0x4696f3[_0x3421('0x25')],_0x3421('0x41'),JSON['stringify'](_0x2a11a3));});});}logger[_0x3421('0x27')](_0x4696f3[_0x3421('0x25')],_0x3421('0x41'));}};Fax['prototype']['syncOriginateResponse']=function(_0x43a94f){if(this[_0x3421('0x11')][_0x43a94f[_0x3421('0x25')]]){_['merge'](this[_0x3421('0xf')][_0x43a94f[_0x3421('0x25')]],_[_0x3421('0x42')](_0x43a94f,[_0x3421('0x43'),'reason']));}};function updateStatus(_0x99523d){if(_0x99523d[_0x3421('0x44')]){faxMessage[_0x3421('0x45')](_0x99523d['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x37eb44){ut[_0x3421('0x46')]('[Fax][Message][Error][Updated]',_0x37eb44);})['catch'](function(_0x2a3bf5){ut[_0x3421('0x46')](_0x3421('0x47'),_0x2a3bf5);});}else{ut[_0x3421('0x46')](_0x3421('0x48'));}}Fax['prototype'][_0x3421('0x49')]=function(_0x2a81fa,_0x3e6e36,_0x2f9ce1){var _0x535934=this;var _0x1d243f={};if(_0x3e6e36){_0x1d243f={'read':_0x3e6e36};}else{_0x1d243f={'failMessage':_0x2f9ce1};}if(this[_0x3421('0x11')][_0x2a81fa][_0x3421('0x44')]){faxMessage['update'](this[_0x3421('0x11')][_0x2a81fa]['AttachmentId'],_0x1d243f)['then'](function(_0x11d30f){ut['logger'](_0x3421('0x4a'),_0x11d30f);})[_0x3421('0x40')](function(_0x12bd9a){ut['logger'](_0x3421('0x4b'),_0x12bd9a);})[_0x3421('0x4c')](function(){delete _0x535934[_0x3421('0xf')][_0x2a81fa];delete _0x535934[_0x3421('0x11')][_0x2a81fa];});}else{ut[_0x3421('0x46')](_0x3421('0x4d'));delete this[_0x3421('0xf')][_0x2a81fa];delete this[_0x3421('0x11')][_0x2a81fa];}};Fax[_0x3421('0x1f')]['syncHangup']=function(_0x1e4add){var _0x23ddd5=this;if(this['channels'][_0x1e4add[_0x3421('0x25')]]){if(this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]]){this['channels'][_0x1e4add[_0x3421('0x25')]]['id']=this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]]['id'];this[_0x3421('0xf')][_0x1e4add[_0x3421('0x25')]][_0x3421('0x26')]=this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]][_0x3421('0x26')];}logger[_0x3421('0x27')](_0x1e4add[_0x3421('0x25')],this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]]?_0x3421('0x4e'):_0x3421('0x4f'),JSON['stringify'](this[_0x3421('0xf')][_0x1e4add[_0x3421('0x25')]]));if(this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]]){if(this[_0x3421('0xf')][_0x1e4add[_0x3421('0x25')]][_0x3421('0x50')]>0x0&&this[_0x3421('0xf')][_0x1e4add['uniqueid']][_0x3421('0x1a')]==='SUCCESS'){this[_0x3421('0x49')](_0x1e4add[_0x3421('0x25')],!![]);}else{this[_0x3421('0x49')](_0x1e4add[_0x3421('0x25')],![],this['channels'][_0x1e4add[_0x3421('0x25')]][_0x3421('0x51')]?_0x3421('0x52')+this[_0x3421('0xf')][_0x1e4add[_0x3421('0x25')]][_0x3421('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0x3421('0x1f')][_0x3421('0x53')]=function(_0x1e9971){var _0x278bbf=this;return new BPromise(function(_0x443b0a,_0x1ba5e1){_0x278bbf[_0x3421('0x54')](_0x1e9971,_0x278bbf[_0x3421('0x10')][_0x1e9971['FaxAccountId']])[_0x3421('0x3a')](function(_0x46717b){ut[_0x3421('0x46')](_0x3421('0x55'),_0x46717b);_0x443b0a(ut[_0x3421('0x36')]('Fax\x20received'));})['catch'](function(_0x44fde6){ut[_0x3421('0x46')](_0x3421('0x56'),_0x44fde6);updateStatus(_0x1e9971);_0x1ba5e1(ut['message'](_0x3421('0x57')));});});};Fax['prototype'][_0x3421('0x58')]=function(_0x4d2747){var _0x4f23c5=this;return new BPromise(function(_0x520325,_0x5c1a53){var _0x4fd786=_0x4f23c5[_0x3421('0x59')](_0x4f23c5[_0x3421('0x10')][_0x4d2747[_0x3421('0x5a')]][_0x3421('0x5b')],_0x4d2747);if(_0x4fd786[_0x3421('0x5c')]){_0x520325(ut[_0x3421('0x36')](_0x3421('0x5d')));}else{_0x5c1a53(ut[_0x3421('0x36')](_0x4fd786[_0x3421('0x36')]));}});};function originate(_0x464226,_0x5c7a78,_0x297184){return new BPromise(function(_0x4dce60,_0x252b28){if(_0x297184){var _0x41e5f8=util[_0x3421('0x5e')](_0x3421('0x5f'),path[_0x3421('0x37')](_0x464226[_0x3421('0x5')])[_0x3421('0x26')],_0x464226[_0x3421('0x5')]);gs[_0x3421('0x60')](_0x41e5f8)['then'](function(){_0x464226[_0x3421('0x5')]=util[_0x3421('0x5e')](_0x3421('0x61'),path['parse'](_0x464226['path'])['dir'],path['parse'](_0x464226[_0x3421('0x5')])['name']);_0x5c7a78[_0x3421('0x62')]=_0x464226[_0x3421('0x5')];ut[_0x3421('0x46')](_0x3421('0x63'),'');ami['Action'](ut[_0x3421('0x64')](_0x464226,_0x5c7a78))[_0x3421('0x3a')](function(_0x120c99){_0x4dce60(_0x120c99);})[_0x3421('0x40')](function(_0x151eaf){_0x252b28(_0x151eaf);});})[_0x3421('0x40')](function(_0x5011ec){_0x252b28(_0x5011ec);});}else{ami[_0x3421('0x65')](ut[_0x3421('0x64')](_0x464226,_0x5c7a78))[_0x3421('0x3a')](function(_0x2af027){_0x4dce60(_0x2af027);})[_0x3421('0x40')](function(_0x180727){_0x252b28(_0x180727);});}});}Fax[_0x3421('0x1f')]['execOriginate']=function(_0x51f0ae,_0x45a6fb){var _0x1f6439=this;return new BPromise(function(_0x45d1ba,_0x5d04c6){var _0x2dac40=uuid['v4']();var _0x539c75=ut[_0x3421('0x66')](_0x51f0ae,_0x45a6fb);_0x1f6439['actions'][_0x2dac40]=new Action(_0x2dac40,_0x45a6fb,_0x51f0ae);var _0x402195=_0x1f6439[_0x3421('0x11')][_0x2dac40];if(path[_0x3421('0x37')](_0x51f0ae[_0x3421('0x5')])[_0x3421('0x67')]===_0x3421('0x38')){originate(_0x402195,_0x539c75,!![])[_0x3421('0x3a')](function(_0x17609c){_0x45d1ba(_0x17609c);})[_0x3421('0x40')](function(_0x37ca80){_0x5d04c6(_0x37ca80);});}else{originate(_0x402195,_0x539c75,![])[_0x3421('0x3a')](function(_0x257cc7){_0x45d1ba(_0x257cc7);})['catch'](function(_0x321335){_0x5d04c6(_0x321335);});}});};Fax[_0x3421('0x1f')][_0x3421('0x68')]=function(_0x387d09){return!_[_0x3421('0x69')](_0x387d09)&&!_[_0x3421('0x69')](_0x387d09[_0x3421('0x26')])&&!_[_0x3421('0x69')](_0x387d09['active'])&&_0x387d09[_0x3421('0x6a')]&&!_['isNil'](this['trunks'][util['format'](_0x3421('0x6b'),_0x387d09[_0x3421('0x26')])])&&!_[_0x3421('0x69')](this[_0x3421('0x6c')][util['format'](_0x3421('0x6b'),_0x387d09[_0x3421('0x26')])][_0x3421('0x2d')])&&(this[_0x3421('0x6c')][util[_0x3421('0x5e')](_0x3421('0x6b'),_0x387d09[_0x3421('0x26')])][_0x3421('0x2d')]===_0x3421('0x6d')||this[_0x3421('0x6c')][util[_0x3421('0x5e')](_0x3421('0x6b'),_0x387d09[_0x3421('0x26')])][_0x3421('0x2d')]===_0x3421('0x6e'));};Fax[_0x3421('0x1f')][_0x3421('0x59')]=function(_0x498f6e,_0x5afe2f){if(!this[_0x3421('0x68')](_0x498f6e)){ut['logger'](_0x3421('0x6f'),_[_0x3421('0x69')](_0x498f6e)?'':_0x498f6e['name']+_0x3421('0x70'));return{'isValid':![],'message':_0x3421('0x71')};}if(_[_0x3421('0x69')](_0x5afe2f[_0x3421('0x3c')])){ut[_0x3421('0x46')](_0x3421('0x72'),JSON[_0x3421('0x3f')](_0x5afe2f));return{'isValid':![],'message':_0x3421('0x73')};}if(_[_0x3421('0x69')](_0x5afe2f[_0x3421('0x5')])){ut[_0x3421('0x46')](_0x3421('0x74'),JSON[_0x3421('0x3f')](_0x5afe2f));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x3421('0x75')};};module['exports']=Fax;
\ No newline at end of file
index e3d1262..7f7263c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafcb=['preview','lodash','../rpc/faxAccount','inspect','notify','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x498b2e,_0x1841aa){var _0x1d0c24=function(_0xed66dc){while(--_0xed66dc){_0x498b2e['push'](_0x498b2e['shift']());}};_0x1d0c24(++_0x1841aa);}(_0xafcb,0xe7));var _0xbafc=function(_0x9beffc,_0x1fd90c){_0x9beffc=_0x9beffc-0x0;var _0xe29cef=_0xafcb[_0x9beffc];return _0xe29cef;};'use strict';var util=require(_0xbafc('0x0'));var BPromise=require(_0xbafc('0x1'));var logger=require(_0xbafc('0x2'))(_0xbafc('0x3'));var _=require(_0xbafc('0x4'));var faxAccount=require(_0xbafc('0x5'));function loggerCatch(_0x1dbbef){return function(_0x556dc9){logger['error'](_0x1dbbef,util[_0xbafc('0x6')](_0x556dc9,{'showHidden':![],'depth':null}));};}exports[_0xbafc('0x7')]=function(_0x24656f,_0x28c837){return BPromise['resolve']()['then'](faxAccount['notify'](_0x24656f,_0x28c837))['catch'](loggerCatch(_0xbafc('0x8')));};
\ No newline at end of file
+var _0xa94e=['resolve','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','error','notify'];(function(_0x1640df,_0x168c77){var _0x525553=function(_0x3cabc4){while(--_0x3cabc4){_0x1640df['push'](_0x1640df['shift']());}};_0x525553(++_0x168c77);}(_0xa94e,0xa3));var _0xea94=function(_0x3a8373,_0x29bf36){_0x3a8373=_0x3a8373-0x0;var _0x500a66=_0xa94e[_0x3a8373];return _0x500a66;};'use strict';var util=require(_0xea94('0x0'));var BPromise=require(_0xea94('0x1'));var logger=require(_0xea94('0x2'))(_0xea94('0x3'));var _=require(_0xea94('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5ea9fd){return function(_0x42be12){logger[_0xea94('0x5')](_0x5ea9fd,util['inspect'](_0x42be12,{'showHidden':![],'depth':null}));};}exports[_0xea94('0x6')]=function(_0x23de5f,_0x113ea1){return BPromise[_0xea94('0x7')]()['then'](faxAccount['notify'](_0x23de5f,_0x113ea1))[_0xea94('0x8')](loggerCatch(_0xea94('0x9')));};
\ No newline at end of file
index c5407f2..8572038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a2e=['util','../../../../config/logger','fax','bluebird','child_process','Exec\x20gs','\x20Error\x20:'];(function(_0x3a6346,_0x1a3ac7){var _0x1f469f=function(_0x544548){while(--_0x544548){_0x3a6346['push'](_0x3a6346['shift']());}};_0x1f469f(++_0x1a3ac7);}(_0x6a2e,0x1a4));var _0xe6a2=function(_0x1dcc51,_0x5db8b0){_0x1dcc51=_0x1dcc51-0x0;var _0x5cb4d7=_0x6a2e[_0x1dcc51];return _0x5cb4d7;};'use strict';var util=require(_0xe6a2('0x0'));var logger=require(_0xe6a2('0x1'))(_0xe6a2('0x2'));var BPromise=require(_0xe6a2('0x3'));var exec=require(_0xe6a2('0x4'))['exec'];exports['execute']=function(_0x42bfec){return new BPromise(function(_0x4861c4,_0x1d11c4){exec(_0x42bfec,function(_0x3654ae,_0x9cd3e6,_0x3bb0a1){logger['info']('Exec\x20gs',_0x9cd3e6);if(_0x3654ae){logger['info'](_0xe6a2('0x5'),_0xe6a2('0x6'),util['inspect'](_0x3654ae,{'showHidden':![],'depth':null}),_0x9cd3e6,_0x3bb0a1);_0x1d11c4(_0x3654ae);}_0x4861c4(_0x9cd3e6);});});};
\ No newline at end of file
+var _0xd74e=['bluebird','child_process','exec','execute','info','Exec\x20gs','inspect','util','../../../../config/logger'];(function(_0xc54543,_0x43f0a7){var _0x788a68=function(_0x3ec91b){while(--_0x3ec91b){_0xc54543['push'](_0xc54543['shift']());}};_0x788a68(++_0x43f0a7);}(_0xd74e,0x97));var _0xed74=function(_0x5553ab,_0x3c45e4){_0x5553ab=_0x5553ab-0x0;var _0x40533e=_0xd74e[_0x5553ab];return _0x40533e;};'use strict';var util=require(_0xed74('0x0'));var logger=require(_0xed74('0x1'))('fax');var BPromise=require(_0xed74('0x2'));var exec=require(_0xed74('0x3'))[_0xed74('0x4')];exports[_0xed74('0x5')]=function(_0x4d2ec6){return new BPromise(function(_0x4f088e,_0x1cca59){exec(_0x4d2ec6,function(_0x18877d,_0x1b2856,_0x4590b1){logger[_0xed74('0x6')](_0xed74('0x7'),_0x1b2856);if(_0x18877d){logger[_0xed74('0x6')](_0xed74('0x7'),'\x20Error\x20:',util[_0xed74('0x8')](_0x18877d,{'showHidden':![],'depth':null}),_0x1b2856,_0x4590b1);_0x1cca59(_0x18877d);}_0x4f088e(_0x1b2856);});});};
\ No newline at end of file
index 3f57308..90cdb7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c51=['logger','info','inspect','addVariables','headerinfo','maxrate','format','\x22%s\x22','modem','faxdetect','path','variablesAction','uniqueid','originate','channel','from-sip','util','lodash','moment','../../../../config/logger','message'];(function(_0x598130,_0x48dcb3){var _0x331cf6=function(_0x33ad9c){while(--_0x33ad9c){_0x598130['push'](_0x598130['shift']());}};_0x331cf6(++_0x48dcb3);}(_0x2c51,0x1c9));var _0x12c5=function(_0xcbe12a,_0x16e7c8){_0xcbe12a=_0xcbe12a-0x0;var _0x4a12fb=_0x2c51[_0xcbe12a];return _0x4a12fb;};'use strict';var util=require(_0x12c5('0x0'));var _=require(_0x12c5('0x1'));var moment=require(_0x12c5('0x2'));var logger=require(_0x12c5('0x3'))('fax');exports[_0x12c5('0x4')]=function(_0x2ce24f){return{'message':_0x2ce24f};};exports[_0x12c5('0x5')]=function(_0x386fc4,_0x188443){logger[_0x12c5('0x6')](_0x386fc4,util[_0x12c5('0x7')](_0x188443,{'showHidden':![],'depth':null}));};exports[_0x12c5('0x8')]=function(_0xec9f59,_0x2bb9f5){var _0x59e222={'XMF-ECM':_0x2bb9f5['ecm'],'XMF-HEADERINFO':_0x2bb9f5[_0x12c5('0x9')],'XMF-MINRATE':_0x2bb9f5['minrate'],'XMF-MAXRATE':_0x2bb9f5[_0x12c5('0xa')],'XMF-MODEM':util[_0x12c5('0xb')](_0x12c5('0xc'),_0x2bb9f5[_0x12c5('0xd')]),'XMF-GATEWAY':_0x2bb9f5['gateway'],'XMF-FAXDETECT':_0x2bb9f5[_0x12c5('0xe')],'XMF-T38TIMEOUT':_0x2bb9f5['t38timeout'],'XMF-LOCALSTATIONID':_0x2bb9f5['localstationid'],'XMF-PATH':_0xec9f59[_0x12c5('0xf')]};return _0x59e222;};exports[_0x12c5('0x10')]=function(_0x41326a,_0x2d9101){return{'actionid':_0x41326a[_0x12c5('0x11')],'action':_0x12c5('0x12'),'channel':_0x41326a[_0x12c5('0x13')],'Exten':'xcally-motion-fax','Context':_0x12c5('0x14'),'Priority':'1','callerid':util[_0x12c5('0xb')]('\x22%s\x22\x20<%s>',_0x41326a[_0x12c5('0x9')]?_0x41326a[_0x12c5('0x9')]:'',_0x41326a['localstationid']),'variable':_0x2d9101,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x41326a['uniqueid']};};
\ No newline at end of file
+var _0x4ec1=['lodash','../../../../config/logger','fax','message','info','addVariables','headerinfo','maxrate','format','\x22%s\x22','gateway','faxdetect','path','uniqueid','channel','from-sip','\x22%s\x22\x20<%s>','localstationid','util'];(function(_0x26e581,_0x51915f){var _0x489b0e=function(_0x1d4fe9){while(--_0x1d4fe9){_0x26e581['push'](_0x26e581['shift']());}};_0x489b0e(++_0x51915f);}(_0x4ec1,0x84));var _0x14ec=function(_0x4c584f,_0x1da234){_0x4c584f=_0x4c584f-0x0;var _0x161aad=_0x4ec1[_0x4c584f];return _0x161aad;};'use strict';var util=require(_0x14ec('0x0'));var _=require(_0x14ec('0x1'));var moment=require('moment');var logger=require(_0x14ec('0x2'))(_0x14ec('0x3'));exports[_0x14ec('0x4')]=function(_0x182cbb){return{'message':_0x182cbb};};exports['logger']=function(_0x8004c8,_0x596893){logger[_0x14ec('0x5')](_0x8004c8,util['inspect'](_0x596893,{'showHidden':![],'depth':null}));};exports[_0x14ec('0x6')]=function(_0x4b58db,_0x30d175){var _0x275b48={'XMF-ECM':_0x30d175['ecm'],'XMF-HEADERINFO':_0x30d175[_0x14ec('0x7')],'XMF-MINRATE':_0x30d175['minrate'],'XMF-MAXRATE':_0x30d175[_0x14ec('0x8')],'XMF-MODEM':util[_0x14ec('0x9')](_0x14ec('0xa'),_0x30d175['modem']),'XMF-GATEWAY':_0x30d175[_0x14ec('0xb')],'XMF-FAXDETECT':_0x30d175[_0x14ec('0xc')],'XMF-T38TIMEOUT':_0x30d175['t38timeout'],'XMF-LOCALSTATIONID':_0x30d175['localstationid'],'XMF-PATH':_0x4b58db[_0x14ec('0xd')]};return _0x275b48;};exports['variablesAction']=function(_0x57c316,_0x17584c){return{'actionid':_0x57c316[_0x14ec('0xe')],'action':'originate','channel':_0x57c316[_0x14ec('0xf')],'Exten':'xcally-motion-fax','Context':_0x14ec('0x10'),'Priority':'1','callerid':util['format'](_0x14ec('0x11'),_0x57c316[_0x14ec('0x7')]?_0x57c316[_0x14ec('0x7')]:'',_0x57c316[_0x14ec('0x12')]),'variable':_0x17584c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x57c316[_0x14ec('0xe')]};};
\ No newline at end of file
index 72bbcee..1e9ca0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2c8=['getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','bluebird','util','moment','./server','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','then','getAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues'];(function(_0x5a463e,_0x349478){var _0x58c804=function(_0x50ada4){while(--_0x50ada4){_0x5a463e['push'](_0x5a463e['shift']());}};_0x58c804(++_0x349478);}(_0xe2c8,0x129));var _0x8e2c=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xe2c8[_0x3d42d8];return _0x27fc41;};'use strict';var BPromise=require(_0x8e2c('0x0'));var util=require(_0x8e2c('0x1'));var moment=require(_0x8e2c('0x2'));var server=require(_0x8e2c('0x3'));var Realtime=require('./realtime');var Report=require(_0x8e2c('0x4'));var Acw=require(_0x8e2c('0x5'));var Trigger=require(_0x8e2c('0x6'));var Dialer=require(_0x8e2c('0x7'));var Preview=require('./preview');var Fax=require(_0x8e2c('0x8'));var user=require(_0x8e2c('0x9'));var voiceQueue=require(_0x8e2c('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x8e2c('0xb'));var trunk=require(_0x8e2c('0xc'));var trigger=require('./rpc/trigger');var template=require(_0x8e2c('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x8e2c('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x8e2c('0xf'));var zendesk=require(_0x8e2c('0x10'));var salesforce=require(_0x8e2c('0x11'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x8e2c('0x12'));var desk=require(_0x8e2c('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x8e2c('0x14'));var freshsales=require(_0x8e2c('0x15'));var servicenow=require(_0x8e2c('0x16'));var dynamics365=require(_0x8e2c('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(_0x8e2c('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8e2c('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8e2c('0x19')](_0x8e2c('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x8e2c('0x1b')](user[_0x8e2c('0x1c')]())[_0x8e2c('0x1b')](realtime['initAgents']())[_0x8e2c('0x1b')](user[_0x8e2c('0x1d')]())[_0x8e2c('0x1b')](realtime['initTelephones']())[_0x8e2c('0x1b')](trunk['getTrunks']())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x1e')]())[_0x8e2c('0x1b')](voiceQueue[_0x8e2c('0x1f')]())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x20')]())[_0x8e2c('0x1b')](trigger[_0x8e2c('0x21')]())['then'](realtime[_0x8e2c('0x22')]())[_0x8e2c('0x1b')](template['getTemplates']())[_0x8e2c('0x1b')](realtime['initTemplates']())[_0x8e2c('0x1b')](zendesk[_0x8e2c('0x23')]())['then'](realtime[_0x8e2c('0x24')]())[_0x8e2c('0x1b')](salesforce[_0x8e2c('0x25')]())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x26')]())[_0x8e2c('0x1b')](sugarcrm[_0x8e2c('0x27')]())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x28')]())[_0x8e2c('0x1b')](freshdesk[_0x8e2c('0x29')]())['then'](realtime[_0x8e2c('0x2a')]())['then'](desk[_0x8e2c('0x2b')]())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x2c')]())[_0x8e2c('0x1b')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0x8e2c('0x1b')](vtiger[_0x8e2c('0x2d')]())[_0x8e2c('0x1b')](realtime['initVtigerAccounts']())[_0x8e2c('0x1b')](freshsales['getFreshsalesAccounts']())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x2e')]())['then'](servicenow['getServicenowAccounts']())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x2f')]())[_0x8e2c('0x1b')](dynamics365[_0x8e2c('0x30')]())[_0x8e2c('0x1b')](realtime['initDynamics365Accounts']())[_0x8e2c('0x1b')](campaign['getCampaigns']())[_0x8e2c('0x1b')](realtime['initCampaigns']())['then'](voiceExtension[_0x8e2c('0x31')]())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x32')]())['then'](faxAccount['getFaxAccounts']())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x33')]())[_0x8e2c('0x1b')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x8e2c('0x1b')](voiceQueueReport[_0x8e2c('0x34')]())['then'](realtime[_0x8e2c('0x35')]())[_0x8e2c('0x1b')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x8e2c('0x36')]())[_0x8e2c('0x1b')](cmHopperHistory[_0x8e2c('0x37')]())[_0x8e2c('0x1b')](realtime[_0x8e2c('0x38')]())['then'](voiceCallReport[_0x8e2c('0x39')]())['then'](realtime[_0x8e2c('0x3a')]())[_0x8e2c('0x3b')](function(_0xe00cc4){logger['error'](_0x8e2c('0x3c'),util[_0x8e2c('0x3d')](_0xe00cc4,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8e2c('0x3e')](realtime,preview,fax)['then'](function(_0x3bda36){return initRealtime();})[_0x8e2c('0x1b')](function(){return initParams();})[_0x8e2c('0x1b')](function(){report[_0x8e2c('0x3f')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x36a682){logger[_0x8e2c('0x40')](_0x8e2c('0x41'),util[_0x8e2c('0x3d')](_0x36a682,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x8c9a=['./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','getVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','error','[index.js][initParams]','inspect','listen','[index.js][main]','util','moment','./realtime','./report','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/trigger','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c9a,0xb0));var _0xa8c9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8c9a[_0x3ab51d];return _0x29a04e;};'use strict';var BPromise=require('bluebird');var util=require(_0xa8c9('0x0'));var moment=require(_0xa8c9('0x1'));var server=require('./server');var Realtime=require(_0xa8c9('0x2'));var Report=require(_0xa8c9('0x3'));var Acw=require('./acw');var Trigger=require(_0xa8c9('0x4'));var Dialer=require(_0xa8c9('0x5'));var Preview=require(_0xa8c9('0x6'));var Fax=require('./fax');var user=require(_0xa8c9('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xa8c9('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0xa8c9('0x9'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0xa8c9('0xa'));var faxAccount=require(_0xa8c9('0xb'));var zendesk=require(_0xa8c9('0xc'));var salesforce=require(_0xa8c9('0xd'));var sugarcrm=require(_0xa8c9('0xe'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xa8c9('0xf'));var zoho=require(_0xa8c9('0x10'));var vtiger=require(_0xa8c9('0x11'));var freshsales=require(_0xa8c9('0x12'));var servicenow=require(_0xa8c9('0x13'));var dynamics365=require(_0xa8c9('0x14'));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(_0xa8c9('0x15'))(_0xa8c9('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa8c9('0x17')](_0xa8c9('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa8c9('0x17')](_0xa8c9('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xa8c9('0x19')]()[_0xa8c9('0x1a')](user[_0xa8c9('0x1b')]())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x1c')]())[_0xa8c9('0x1a')](user['getTelephones']())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x1d')]())[_0xa8c9('0x1a')](trunk[_0xa8c9('0x1e')]())[_0xa8c9('0x1a')](realtime['initTrunks']())[_0xa8c9('0x1a')](voiceQueue[_0xa8c9('0x1f')]())[_0xa8c9('0x1a')](realtime['initVoiceQueues']())[_0xa8c9('0x1a')](trigger[_0xa8c9('0x20')]())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x21')]())['then'](template['getTemplates']())['then'](realtime[_0xa8c9('0x22')]())[_0xa8c9('0x1a')](zendesk['getZendeskAccounts']())['then'](realtime[_0xa8c9('0x23')]())[_0xa8c9('0x1a')](salesforce['getSalesforceAccounts']())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x24')]())['then'](sugarcrm[_0xa8c9('0x25')]())['then'](realtime[_0xa8c9('0x26')]())[_0xa8c9('0x1a')](freshdesk[_0xa8c9('0x27')]())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x28')]())[_0xa8c9('0x1a')](desk['getDeskAccounts']())['then'](realtime[_0xa8c9('0x29')]())['then'](zoho[_0xa8c9('0x2a')]())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0xa8c9('0x2b')]())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x2c')]())[_0xa8c9('0x1a')](freshsales['getFreshsalesAccounts']())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x2d')]())[_0xa8c9('0x1a')](servicenow[_0xa8c9('0x2e')]())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x2f')]())[_0xa8c9('0x1a')](dynamics365[_0xa8c9('0x30')]())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x31')]())['then'](campaign[_0xa8c9('0x32')]())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x33')]())[_0xa8c9('0x1a')](voiceExtension[_0xa8c9('0x34')]())['then'](realtime[_0xa8c9('0x35')]())[_0xa8c9('0x1a')](faxAccount[_0xa8c9('0x36')]())[_0xa8c9('0x1a')](realtime[_0xa8c9('0x37')]())[_0xa8c9('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0xa8c9('0x19')]()[_0xa8c9('0x1a')](voiceQueueReport[_0xa8c9('0x38')]())['then'](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xa8c9('0x39')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xa8c9('0x1a')](cmHopperHistory[_0xa8c9('0x3a')]())[_0xa8c9('0x1a')](realtime['initCampaignHopperHistory']())[_0xa8c9('0x1a')](voiceCallReport['getVoiceCallReports']())[_0xa8c9('0x1a')](realtime['initVoiceCallReports']())['catch'](function(_0x260466){logger[_0xa8c9('0x3b')](_0xa8c9('0x3c'),util[_0xa8c9('0x3d')](_0x260466,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa8c9('0x3e')](realtime,preview,fax)[_0xa8c9('0x1a')](function(_0x32a1bd){return initRealtime();})[_0xa8c9('0x1a')](function(){return initParams();})[_0xa8c9('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x20de51){logger[_0xa8c9('0x3b')](_0xa8c9('0x3f'),util[_0xa8c9('0x3d')](_0x20de51,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index eaf4a6c..8701bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x55f3fa,_0x5f0a60){var _0x59fb7c=function(_0x20524a){while(--_0x20524a){_0x55f3fa['push'](_0x55f3fa['shift']());}};_0x59fb7c(++_0x5f0a60);}(_0x70e0,0x17b));var _0x070e=function(_0x9ee35c,_0x29ecd6){_0x9ee35c=_0x9ee35c-0x0;var _0x44a29d=_0x70e0[_0x9ee35c];return _0x44a29d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent;
\ No newline at end of file
+var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x36e2c8,_0x212917){var _0x21f9dd=function(_0x1dc8df){while(--_0x1dc8df){_0x36e2c8['push'](_0x36e2c8['shift']());}};_0x21f9dd(++_0x212917);}(_0x70e0,0x17b));var _0x070e=function(_0x421f3e,_0x276236){_0x421f3e=_0x421f3e-0x0;var _0xfb8342=_0x70e0[_0x421f3e];return _0xfb8342;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent;
\ No newline at end of file
index 018227c..e045ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd90=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbd90,0x113));var _0x0bd9=function(_0xb36ad9,_0x23d240){_0xb36ad9=_0xb36ad9-0x0;var _0x1d6853=_0xbd90[_0xb36ad9];return _0x1d6853;};'use strict';function Campaign(_0x5a2d9f){this['id']=_0x5a2d9f['id']||0x0;this['name']=_0x5a2d9f[_0x0bd9('0x0')]||'';this[_0x0bd9('0x1')]=_0x5a2d9f[_0x0bd9('0x1')]||_0x0bd9('0x2');this['originated']=0x0;this[_0x0bd9('0x3')]=0x0;this[_0x0bd9('0x4')]=0x0;this[_0x0bd9('0x5')]=0x0;this[_0x0bd9('0x6')]='';this[_0x0bd9('0x7')]=!![];this[_0x0bd9('0x8')]=_0x5a2d9f[_0x0bd9('0x8')];this[_0x0bd9('0x9')]=_0x5a2d9f[_0x0bd9('0x9')];this[_0x0bd9('0xa')]=_0x5a2d9f[_0x0bd9('0xa')]||null;this[_0x0bd9('0xb')]=_0x5a2d9f['dialGlobalInterval']?_0x5a2d9f[_0x0bd9('0xb')]:null;this[_0x0bd9('0xc')]=_0x5a2d9f[_0x0bd9('0xc')];this[_0x0bd9('0xd')]=_0x5a2d9f[_0x0bd9('0xd')];this['dialOriginateTimeout']=_0x5a2d9f[_0x0bd9('0xe')]||0x1e;this[_0x0bd9('0xf')]=_0x5a2d9f[_0x0bd9('0xf')];this['dialCongestionRetryFrequency']=_0x5a2d9f[_0x0bd9('0x10')];this[_0x0bd9('0x11')]=_0x5a2d9f[_0x0bd9('0x11')];this['dialBusyRetryFrequency']=_0x5a2d9f[_0x0bd9('0x12')];this[_0x0bd9('0x13')]=_0x5a2d9f[_0x0bd9('0x13')];this[_0x0bd9('0x14')]=_0x5a2d9f['dialNoAnswerRetryFrequency'];this[_0x0bd9('0x15')]=_0x5a2d9f[_0x0bd9('0x15')];this[_0x0bd9('0x16')]=_0x5a2d9f[_0x0bd9('0x16')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5a2d9f[_0x0bd9('0x17')]||0x96;this[_0x0bd9('0x18')]=_0x5a2d9f[_0x0bd9('0x18')]||0x3;this[_0x0bd9('0x19')]=_0x5a2d9f['dialDropRetryFrequency']||0x96;this[_0x0bd9('0x1a')]=_0x5a2d9f['dialAbandonedMaxRetry']||0x3;this[_0x0bd9('0x1b')]=_0x5a2d9f[_0x0bd9('0x1b')]||0x96;this[_0x0bd9('0x1c')]=_0x5a2d9f[_0x0bd9('0x1c')]||0x3;this[_0x0bd9('0x1d')]=_0x5a2d9f['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x5a2d9f[_0x0bd9('0x1e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5a2d9f[_0x0bd9('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x5a2d9f[_0x0bd9('0x20')]||'DESC';this[_0x0bd9('0x21')]=_0x5a2d9f['dialPrefix']||undefined;this[_0x0bd9('0x22')]=_0x5a2d9f[_0x0bd9('0x22')]||undefined;this['dialCutDigit']=_0x5a2d9f[_0x0bd9('0x23')]||undefined;this[_0x0bd9('0x24')]=_0x5a2d9f[_0x0bd9('0x24')]?_0x5a2d9f[_0x0bd9('0x24')]:undefined;this[_0x0bd9('0x25')]=_0x5a2d9f[_0x0bd9('0x25')]?_0x5a2d9f['Trunk']:undefined;this[_0x0bd9('0x26')]=_0x5a2d9f[_0x0bd9('0x26')]?_0x5a2d9f[_0x0bd9('0x26')]:undefined;this[_0x0bd9('0x27')]=_0x5a2d9f['SquareProject']?_0x5a2d9f[_0x0bd9('0x27')]:undefined;this[_0x0bd9('0x28')]=_0x5a2d9f[_0x0bd9('0x27')]?_0x5a2d9f['SquareProject'][_0x0bd9('0x0')]:undefined;this['dialAMDActive']=_0x5a2d9f['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x5a2d9f['dialAMDInitialSilence'];this[_0x0bd9('0x29')]=_0x5a2d9f[_0x0bd9('0x29')];this[_0x0bd9('0x2a')]=_0x5a2d9f[_0x0bd9('0x2a')];this['dialAMDTotalAnalysisTime']=_0x5a2d9f[_0x0bd9('0x2b')];this[_0x0bd9('0x2c')]=_0x5a2d9f[_0x0bd9('0x2c')];this['dialAMDBetweenWordsSilence']=_0x5a2d9f[_0x0bd9('0x2d')];this[_0x0bd9('0x2e')]=_0x5a2d9f[_0x0bd9('0x2e')];this[_0x0bd9('0x2f')]=_0x5a2d9f[_0x0bd9('0x2f')];this[_0x0bd9('0x30')]=_0x5a2d9f[_0x0bd9('0x30')];}module[_0x0bd9('0x31')]=Campaign;
\ No newline at end of file
+var _0x45e4=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','sendMessageOneNotActive','active','dialGlobalInterval'];(function(_0x14ed41,_0x3b4601){var _0x46b436=function(_0x2b5f3e){while(--_0x2b5f3e){_0x14ed41['push'](_0x14ed41['shift']());}};_0x46b436(++_0x3b4601);}(_0x45e4,0x10c));var _0x445e=function(_0x307375,_0x271e83){_0x307375=_0x307375-0x0;var _0x5adea6=_0x45e4[_0x307375];return _0x5adea6;};'use strict';function Campaign(_0x194d35){this['id']=_0x194d35['id']||0x0;this['name']=_0x194d35[_0x445e('0x0')]||'';this[_0x445e('0x1')]=_0x194d35['type']||_0x445e('0x2');this[_0x445e('0x3')]=0x0;this['temp']=0x0;this[_0x445e('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x445e('0x5')]=!![];this[_0x445e('0x6')]=_0x194d35[_0x445e('0x6')];this['limitCalls']=_0x194d35['limitCalls'];this['dialTimezone']=_0x194d35['dialTimezone']||null;this[_0x445e('0x7')]=_0x194d35[_0x445e('0x7')]?_0x194d35[_0x445e('0x7')]:null;this['dialOriginateCallerIdName']=_0x194d35[_0x445e('0x8')];this[_0x445e('0x9')]=_0x194d35[_0x445e('0x9')];this[_0x445e('0xa')]=_0x194d35[_0x445e('0xa')]||0x1e;this['dialCongestionMaxRetry']=_0x194d35[_0x445e('0xb')];this[_0x445e('0xc')]=_0x194d35[_0x445e('0xc')];this[_0x445e('0xd')]=_0x194d35[_0x445e('0xd')];this['dialBusyRetryFrequency']=_0x194d35[_0x445e('0xe')];this[_0x445e('0xf')]=_0x194d35['dialNoAnswerMaxRetry'];this[_0x445e('0x10')]=_0x194d35[_0x445e('0x10')];this[_0x445e('0x11')]=_0x194d35[_0x445e('0x11')];this[_0x445e('0x12')]=_0x194d35['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x194d35['dialNoSuchNumberRetryFrequency']||0x96;this[_0x445e('0x13')]=_0x194d35[_0x445e('0x13')]||0x3;this['dialDropRetryFrequency']=_0x194d35[_0x445e('0x14')]||0x96;this['dialAbandonedMaxRetry']=_0x194d35[_0x445e('0x15')]||0x3;this[_0x445e('0x16')]=_0x194d35['dialAbandonedRetryFrequency']||0x96;this[_0x445e('0x17')]=_0x194d35[_0x445e('0x17')]||0x3;this[_0x445e('0x18')]=_0x194d35[_0x445e('0x18')]||0x96;this[_0x445e('0x19')]=_0x194d35[_0x445e('0x19')]||0x3;this['dialAgentRejectRetryFrequency']=_0x194d35['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x194d35[_0x445e('0x1a')]||'DESC';this[_0x445e('0x1b')]=_0x194d35[_0x445e('0x1b')]||undefined;this[_0x445e('0x1c')]=_0x194d35[_0x445e('0x1c')]||undefined;this[_0x445e('0x1d')]=_0x194d35['dialCutDigit']||undefined;this[_0x445e('0x1e')]=_0x194d35[_0x445e('0x1e')]?_0x194d35[_0x445e('0x1e')]:undefined;this[_0x445e('0x1f')]=_0x194d35['Trunk']?_0x194d35[_0x445e('0x1f')]:undefined;this[_0x445e('0x20')]=_0x194d35[_0x445e('0x20')]?_0x194d35[_0x445e('0x20')]:undefined;this[_0x445e('0x21')]=_0x194d35[_0x445e('0x21')]?_0x194d35['SquareProject']:undefined;this[_0x445e('0x22')]=_0x194d35[_0x445e('0x21')]?_0x194d35[_0x445e('0x21')][_0x445e('0x0')]:undefined;this[_0x445e('0x23')]=_0x194d35['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x194d35[_0x445e('0x24')];this['dialAMDGreeting']=_0x194d35[_0x445e('0x25')];this[_0x445e('0x26')]=_0x194d35[_0x445e('0x26')];this[_0x445e('0x27')]=_0x194d35['dialAMDTotalAnalysisTime'];this[_0x445e('0x28')]=_0x194d35[_0x445e('0x28')];this[_0x445e('0x29')]=_0x194d35[_0x445e('0x29')];this[_0x445e('0x2a')]=_0x194d35['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x194d35[_0x445e('0x2b')];this['dialAMDMaximumWordLength']=_0x194d35[_0x445e('0x2c')];}module[_0x445e('0x2d')]=Campaign;
\ No newline at end of file
index 7d2f767..bbd3b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c01=['tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','context','uniqueid','linkedid','exten','answered','endtime','abandoned','lastdata','billableseconds'];(function(_0x3b6433,_0x4a203e){var _0xf7c7b3=function(_0x1f9b7f){while(--_0x1f9b7f){_0x3b6433['push'](_0x3b6433['shift']());}};_0xf7c7b3(++_0x4a203e);}(_0x1c01,0x190));var _0x11c0=function(_0x1d40a6,_0x45d654){_0x1d40a6=_0x1d40a6-0x0;var _0x27c7d6=_0x1c01[_0x1d40a6];return _0x27c7d6;};'use strict';function Channel(){this[_0x11c0('0x0')]=null;this[_0x11c0('0x1')]='';this[_0x11c0('0x2')]='';this[_0x11c0('0x3')]=0x0;this['calleridname']='';this[_0x11c0('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x11c0('0x5')]='';this[_0x11c0('0x6')]=0x0;this[_0x11c0('0x7')]=0x0;this[_0x11c0('0x8')]=0x0;this[_0x11c0('0x9')]=![];this['answertime']=null;this[_0x11c0('0xa')]=null;this['unmanaged']=![];this[_0x11c0('0xb')]=![];this['lastapplication']='';this[_0x11c0('0xc')]='';this['duration']=0x0;this[_0x11c0('0xd')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0x11c0('0xe')]=null;this['disposition']=null;this[_0x11c0('0xf')]=![];this[_0x11c0('0x10')]=null;this[_0x11c0('0x11')]=null;this[_0x11c0('0x12')]=[];this[_0x11c0('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x11c0('0x14')]=undefined;this[_0x11c0('0x15')]=0x0;}module[_0x11c0('0x16')]=Channel;
\ No newline at end of file
+var _0x7e22=['lastdata','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','exten','answered','answertime','endtime','abandoned','lastapplication'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x7e22,0x1d8));var _0x27e2=function(_0x2e16b0,_0x489492){_0x2e16b0=_0x2e16b0-0x0;var _0x66b89b=_0x7e22[_0x2e16b0];return _0x66b89b;};'use strict';function Channel(){this[_0x27e2('0x0')]=null;this['channel']='';this[_0x27e2('0x1')]='';this[_0x27e2('0x2')]=0x0;this[_0x27e2('0x3')]='';this[_0x27e2('0x4')]=undefined;this[_0x27e2('0x5')]=undefined;this[_0x27e2('0x6')]=0x0;this['context']='';this[_0x27e2('0x7')]=0x0;this['linkedid']=0x0;this[_0x27e2('0x8')]=0x0;this[_0x27e2('0x9')]=![];this[_0x27e2('0xa')]=null;this[_0x27e2('0xb')]=null;this['unmanaged']=![];this[_0x27e2('0xc')]=![];this[_0x27e2('0xd')]='';this[_0x27e2('0xe')]='';this[_0x27e2('0xf')]=0x0;this[_0x27e2('0x10')]=0x0;this[_0x27e2('0x11')]=0x0;this[_0x27e2('0x12')]=null;this[_0x27e2('0x13')]=null;this['disposition']=null;this[_0x27e2('0x14')]=![];this[_0x27e2('0x15')]=null;this['queue']=null;this[_0x27e2('0x16')]=[];this[_0x27e2('0x17')]=undefined;this[_0x27e2('0x18')]=undefined;this[_0x27e2('0x19')]=undefined;this['mohtime']=0x0;}module[_0x27e2('0x1a')]=Channel;
\ No newline at end of file
index ed8763b..435e491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ac=['type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x42ac,0xdc));var _0xc42a=function(_0x28eda1,_0x4dd551){_0x28eda1=_0x28eda1-0x0;var _0x18bafb=_0x42ac[_0x28eda1];return _0x18bafb;};'use strict';function DeskAccount(_0x34d054){this['id']=_0x34d054['id']||0x0;this['name']=_0x34d054['name']||'';this[_0xc42a('0x0')]=_0x34d054[_0xc42a('0x0')]||'';this[_0xc42a('0x1')]=_0x34d054[_0xc42a('0x1')]||'';this[_0xc42a('0x2')]=_0x34d054['authType']||'';this[_0xc42a('0x3')]=_0x34d054[_0xc42a('0x3')]||'';this[_0xc42a('0x4')]=_0x34d054[_0xc42a('0x4')]||'';this[_0xc42a('0x5')]=_0x34d054[_0xc42a('0x5')]||'';this[_0xc42a('0x6')]=_0x34d054[_0xc42a('0x6')]||'';this[_0xc42a('0x7')]=_0x34d054['tokenSecret']||'';this[_0xc42a('0x8')]=_0x34d054[_0xc42a('0x8')]||'';this[_0xc42a('0x9')]=_0x34d054['serverUrl']||'';this[_0xc42a('0xa')]=_0x34d054[_0xc42a('0xa')]||{};}module[_0xc42a('0xb')]=DeskAccount;
\ No newline at end of file
+var _0x5781=['Configurations','name','username','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x5781,0x182));var _0x1578=function(_0x228b14,_0x9d65fc){_0x228b14=_0x228b14-0x0;var _0x2ebd10=_0x5781[_0x228b14];return _0x2ebd10;};'use strict';function DeskAccount(_0x4b7a8f){this['id']=_0x4b7a8f['id']||0x0;this[_0x1578('0x0')]=_0x4b7a8f['name']||'';this[_0x1578('0x1')]=_0x4b7a8f[_0x1578('0x1')]||'';this[_0x1578('0x2')]=_0x4b7a8f[_0x1578('0x2')]||'';this[_0x1578('0x3')]=_0x4b7a8f[_0x1578('0x3')]||'';this['password']=_0x4b7a8f['password']||'';this[_0x1578('0x4')]=_0x4b7a8f['consumerKey']||'';this[_0x1578('0x5')]=_0x4b7a8f['consumerSecret']||'';this[_0x1578('0x6')]=_0x4b7a8f['token']||'';this[_0x1578('0x7')]=_0x4b7a8f[_0x1578('0x7')]||'';this[_0x1578('0x8')]=_0x4b7a8f[_0x1578('0x8')]||'';this[_0x1578('0x9')]=_0x4b7a8f['serverUrl']||'';this['Configurations']=_0x4b7a8f[_0x1578('0xa')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
index 128822b..461c1f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8f4=['modernAuthentication','Configurations','CloudProvider','exports','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb8f4,0xca));var _0x4b8f=function(_0x426904,_0xf45a16){_0x426904=_0x426904-0x0;var _0x1a7def=_0xb8f4[_0x426904];return _0x1a7def;};'use strict';function Dynamics365Account(_0x35142a){this['id']=_0x35142a['id']||0x0;this['name']=_0x35142a['name']||'';this[_0x4b8f('0x0')]=_0x35142a[_0x4b8f('0x0')]||'';this[_0x4b8f('0x1')]=_0x35142a['password']||'';this['remoteUri']=_0x35142a[_0x4b8f('0x2')]||'';this[_0x4b8f('0x3')]=_0x35142a[_0x4b8f('0x3')]||'';this['clientId']=_0x35142a[_0x4b8f('0x4')]||'';this[_0x4b8f('0x5')]=_0x35142a[_0x4b8f('0x5')]||{};this[_0x4b8f('0x6')]=_0x35142a[_0x4b8f('0x6')]||'';this[_0x4b8f('0x7')]=_0x35142a[_0x4b8f('0x7')]||![];this[_0x4b8f('0x8')]=_0x35142a[_0x4b8f('0x8')]||{};this['CloudProvider']=_0x35142a[_0x4b8f('0x9')]||{};}module[_0x4b8f('0xa')]=Dynamics365Account;
\ No newline at end of file
+var _0x985b=['tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x985b,0x1f4));var _0xb985=function(_0x29baba,_0x42c4ae){_0x29baba=_0x29baba-0x0;var _0x5369c3=_0x985b[_0x29baba];return _0x5369c3;};'use strict';function Dynamics365Account(_0x1819be){this['id']=_0x1819be['id']||0x0;this[_0xb985('0x0')]=_0x1819be[_0xb985('0x0')]||'';this[_0xb985('0x1')]=_0x1819be[_0xb985('0x1')]||'';this[_0xb985('0x2')]=_0x1819be['password']||'';this[_0xb985('0x3')]=_0x1819be[_0xb985('0x3')]||'';this[_0xb985('0x4')]=_0x1819be['tenantId']||'';this[_0xb985('0x5')]=_0x1819be['clientId']||'';this[_0xb985('0x6')]=_0x1819be[_0xb985('0x6')]||{};this[_0xb985('0x7')]=_0x1819be[_0xb985('0x7')]||'';this[_0xb985('0x8')]=_0x1819be[_0xb985('0x8')]||![];this[_0xb985('0x9')]=_0x1819be[_0xb985('0x9')]||{};this[_0xb985('0xa')]=_0x1819be[_0xb985('0xa')]||{};}module[_0xb985('0xb')]=Dynamics365Account;
\ No newline at end of file
index e1d3cc1..8cedbd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb65=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x536171,_0xa8543d){var _0x3149c9=function(_0x2714ca){while(--_0x2714ca){_0x536171['push'](_0x536171['shift']());}};_0x3149c9(++_0xa8543d);}(_0xfb65,0xb7));var _0x5fb6=function(_0x51a8b3,_0x35a867){_0x51a8b3=_0x51a8b3-0x0;var _0x370673=_0xfb65[_0x51a8b3];return _0x370673;};'use strict';function FaxAccount(_0x3a7f22){this['id']=_0x3a7f22['id']||0x0;this[_0x5fb6('0x0')]=_0x3a7f22[_0x5fb6('0x0')]||'';this[_0x5fb6('0x1')]=_0x3a7f22['description'];this[_0x5fb6('0x2')]=_0x3a7f22[_0x5fb6('0x2')];this['headerinfo']=_0x3a7f22[_0x5fb6('0x3')];this[_0x5fb6('0x4')]=_0x3a7f22[_0x5fb6('0x4')];this[_0x5fb6('0x5')]=_0x3a7f22[_0x5fb6('0x5')]||0x960;this[_0x5fb6('0x6')]=_0x3a7f22[_0x5fb6('0x6')]||0x3840;this[_0x5fb6('0x7')]=_0x3a7f22['modem']||_0x5fb6('0x8');this['gateway']=_0x3a7f22[_0x5fb6('0x9')]||'no';this['faxdetect']=_0x3a7f22[_0x5fb6('0xa')]||'no';this[_0x5fb6('0xb')]=_0x3a7f22['t38timeout']||0x1388;this['tech']=_0x3a7f22[_0x5fb6('0xc')]||'SIP';this[_0x5fb6('0xd')]=_0x3a7f22[_0x5fb6('0xd')]?_0x3a7f22['Trunk']:undefined;this['ListId']=_0x3a7f22[_0x5fb6('0xe')];this[_0x5fb6('0xf')]=_0x3a7f22[_0x5fb6('0xf')];}module[_0x5fb6('0x10')]=FaxAccount;
\ No newline at end of file
+var _0x357f=['key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x357f,0x9a));var _0xf357=function(_0x312432,_0x21df30){_0x312432=_0x312432-0x0;var _0x5b2a6e=_0x357f[_0x312432];return _0x5b2a6e;};'use strict';function FaxAccount(_0x401747){this['id']=_0x401747['id']||0x0;this[_0xf357('0x0')]=_0x401747[_0xf357('0x0')]||'';this[_0xf357('0x1')]=_0x401747[_0xf357('0x1')];this['ecm']=_0x401747[_0xf357('0x2')];this['headerinfo']=_0x401747[_0xf357('0x3')];this['localstationid']=_0x401747[_0xf357('0x4')];this[_0xf357('0x5')]=_0x401747['minrate']||0x960;this[_0xf357('0x6')]=_0x401747[_0xf357('0x6')]||0x3840;this[_0xf357('0x7')]=_0x401747[_0xf357('0x7')]||_0xf357('0x8');this[_0xf357('0x9')]=_0x401747[_0xf357('0x9')]||'no';this[_0xf357('0xa')]=_0x401747[_0xf357('0xa')]||'no';this['t38timeout']=_0x401747[_0xf357('0xb')]||0x1388;this[_0xf357('0xc')]=_0x401747[_0xf357('0xc')]||_0xf357('0xd');this[_0xf357('0xe')]=_0x401747[_0xf357('0xe')]?_0x401747[_0xf357('0xe')]:undefined;this['ListId']=_0x401747[_0xf357('0xf')];this[_0xf357('0x10')]=_0x401747[_0xf357('0x10')];}module['exports']=FaxAccount;
\ No newline at end of file
index 6ad3e30..a74d6b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf606=['exports','name','username','apiKey','token','remoteUri','Configurations'];(function(_0x36b078,_0x3da56f){var _0x330323=function(_0x43f2db){while(--_0x43f2db){_0x36b078['push'](_0x36b078['shift']());}};_0x330323(++_0x3da56f);}(_0xf606,0x14a));var _0x6f60=function(_0x35a0fc,_0x51e24b){_0x35a0fc=_0x35a0fc-0x0;var _0x590da3=_0xf606[_0x35a0fc];return _0x590da3;};'use strict';function FreshdeskAccount(_0x44e93f){this['id']=_0x44e93f['id']||0x0;this[_0x6f60('0x0')]=_0x44e93f[_0x6f60('0x0')]||'';this[_0x6f60('0x1')]=_0x44e93f['username']||'';this[_0x6f60('0x2')]=_0x44e93f[_0x6f60('0x3')]||'';this[_0x6f60('0x4')]=_0x44e93f['remoteUri']||'';this['serverUrl']=_0x44e93f['serverUrl']||'';this[_0x6f60('0x5')]=_0x44e93f[_0x6f60('0x5')]||{};}module[_0x6f60('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0x60a9=['token','remoteUri','serverUrl','Configurations','exports','username','apiKey'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x60a9,0x116));var _0x960a=function(_0x47e4d6,_0x43d100){_0x47e4d6=_0x47e4d6-0x0;var _0x37105b=_0x60a9[_0x47e4d6];return _0x37105b;};'use strict';function FreshdeskAccount(_0x12b62d){this['id']=_0x12b62d['id']||0x0;this['name']=_0x12b62d['name']||'';this[_0x960a('0x0')]=_0x12b62d[_0x960a('0x0')]||'';this[_0x960a('0x1')]=_0x12b62d[_0x960a('0x2')]||'';this[_0x960a('0x3')]=_0x12b62d[_0x960a('0x3')]||'';this[_0x960a('0x4')]=_0x12b62d[_0x960a('0x4')]||'';this[_0x960a('0x5')]=_0x12b62d[_0x960a('0x5')]||{};}module[_0x960a('0x6')]=FreshdeskAccount;
\ No newline at end of file
index 0342da6..0a2ddf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b7f=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x2460c2,_0x20691b){var _0x2e50dc=function(_0x1d9d39){while(--_0x1d9d39){_0x2460c2['push'](_0x2460c2['shift']());}};_0x2e50dc(++_0x20691b);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x24f284,_0x1bbb76){_0x24f284=_0x24f284-0x0;var _0x1380d8=_0x5b7f[_0x24f284];return _0x1380d8;};'use strict';function FreshsalesAccount(_0x3e2d40){this['id']=_0x3e2d40['id']||0x0;this[_0xf5b7('0x0')]=_0x3e2d40[_0xf5b7('0x0')]||'';this[_0xf5b7('0x1')]=_0x3e2d40[_0xf5b7('0x1')]||'';this[_0xf5b7('0x2')]=_0x3e2d40[_0xf5b7('0x3')]||'';this[_0xf5b7('0x4')]=_0x3e2d40[_0xf5b7('0x4')]||'';this[_0xf5b7('0x5')]=_0x3e2d40[_0xf5b7('0x5')]||'';this[_0xf5b7('0x6')]=_0x3e2d40[_0xf5b7('0x6')]||{};}module[_0xf5b7('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0x33c5=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x33c5,0xe6));var _0x533c=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x33c5[_0x313df3];return _0x241d59;};'use strict';function FreshsalesAccount(_0x3e6081){this['id']=_0x3e6081['id']||0x0;this[_0x533c('0x0')]=_0x3e6081[_0x533c('0x0')]||'';this['username']=_0x3e6081[_0x533c('0x1')]||'';this[_0x533c('0x2')]=_0x3e6081[_0x533c('0x3')]||'';this[_0x533c('0x4')]=_0x3e6081[_0x533c('0x4')]||'';this['serverUrl']=_0x3e6081[_0x533c('0x5')]||'';this[_0x533c('0x6')]=_0x3e6081[_0x533c('0x6')]||{};}module[_0x533c('0x7')]=FreshsalesAccount;
\ No newline at end of file
index bb9c2a0..d264973 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f5a=['mohtime','variables','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','accountcode','exten','priority','assigned','voice'];(function(_0x34e747,_0x173163){var _0x200a90=function(_0x2cfb42){while(--_0x2cfb42){_0x34e747['push'](_0x34e747['shift']());}};_0x200a90(++_0x173163);}(_0x8f5a,0x9c));var _0xa8f5=function(_0x4f415c,_0x9a201f){_0x4f415c=_0x4f415c-0x0;var _0x2b984a=_0x8f5a[_0x4f415c];return _0x2b984a;};'use strict';function QueueReport(){this[_0xa8f5('0x0')]=_0xa8f5('0x1');this['uniqueid']='';this[_0xa8f5('0x2')]='';this[_0xa8f5('0x3')]='';this['queue']='';this[_0xa8f5('0x4')]=null;this[_0xa8f5('0x5')]=null;this[_0xa8f5('0x6')]=0x1;this['count']=0x1;this[_0xa8f5('0x7')]=![];this[_0xa8f5('0x8')]=null;this[_0xa8f5('0x9')]=![];this[_0xa8f5('0xa')]=null;this[_0xa8f5('0xb')]=![];this['queuecallerexitAt']=null;this[_0xa8f5('0xc')]=0x1;this[_0xa8f5('0xd')]='';this[_0xa8f5('0xe')]='';this['connectedlinename']='';this[_0xa8f5('0xf')]='';this['context']='';this[_0xa8f5('0x10')]='';this[_0xa8f5('0x11')]='';this['holdtime']=0x0;this[_0xa8f5('0x12')]=![];this['lastAssignedTo']='';this['motionChannel']=_0xa8f5('0x13');this[_0xa8f5('0x14')]=0x0;this[_0xa8f5('0x15')]={};}module['exports']=QueueReport;
\ No newline at end of file
+var _0x84a1=['variables','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x84a1,0x188));var _0x184a=function(_0x32e62d,_0x4fa924){_0x32e62d=_0x32e62d-0x0;var _0x1be8c6=_0x84a1[_0x32e62d];return _0x1be8c6;};'use strict';function QueueReport(){this['type']='inbound';this[_0x184a('0x0')]='';this[_0x184a('0x1')]='';this[_0x184a('0x2')]='';this['queue']='';this[_0x184a('0x3')]=null;this[_0x184a('0x4')]=null;this[_0x184a('0x5')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x184a('0x6')]=null;this[_0x184a('0x7')]=![];this['queuecallercompleteAt']=null;this[_0x184a('0x8')]=![];this[_0x184a('0x9')]=null;this[_0x184a('0xa')]=0x1;this[_0x184a('0xb')]='';this[_0x184a('0xc')]='';this[_0x184a('0xd')]='';this['accountcode']='';this[_0x184a('0xe')]='';this['exten']='';this[_0x184a('0xf')]='';this[_0x184a('0x10')]=0x0;this[_0x184a('0x11')]=![];this[_0x184a('0x12')]='';this[_0x184a('0x13')]=_0x184a('0x14');this[_0x184a('0x15')]=0x0;this[_0x184a('0x16')]={};}module['exports']=QueueReport;
\ No newline at end of file
index 0cf307f..ad41b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dca=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','Configurations','exports','name'];(function(_0x5e622e,_0xd48e07){var _0x29af52=function(_0x14513c){while(--_0x14513c){_0x5e622e['push'](_0x5e622e['shift']());}};_0x29af52(++_0xd48e07);}(_0x2dca,0xdb));var _0xa2dc=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x2dca[_0x5cc51f];return _0x315a2f;};'use strict';function SalesforceAccount(_0x21907f){this['id']=_0x21907f['id']||0x0;this[_0xa2dc('0x0')]=_0x21907f[_0xa2dc('0x0')]||'';this['username']=_0x21907f[_0xa2dc('0x1')]||'';this[_0xa2dc('0x2')]=_0x21907f[_0xa2dc('0x2')]||'';this[_0xa2dc('0x3')]=_0x21907f['password']||'';this[_0xa2dc('0x4')]=_0x21907f[_0xa2dc('0x4')]||'';this[_0xa2dc('0x5')]=_0x21907f['clientSecret']||'';this[_0xa2dc('0x6')]=_0x21907f[_0xa2dc('0x6')]||'';this[_0xa2dc('0x7')]=_0x21907f[_0xa2dc('0x7')]||_0xa2dc('0x8');this['serverUrl']=_0x21907f['serverUrl']||'';this['Configurations']=_0x21907f[_0xa2dc('0x9')]||{};}module[_0xa2dc('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0x536e=['exports','name','remoteUri','password','clientId','clientSecret','securityToken','serverUrl'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x536e,0x111));var _0xe536=function(_0x4b1bb0,_0x7dc32b){_0x4b1bb0=_0x4b1bb0-0x0;var _0x549407=_0x536e[_0x4b1bb0];return _0x549407;};'use strict';function SalesforceAccount(_0x54f670){this['id']=_0x54f670['id']||0x0;this[_0xe536('0x0')]=_0x54f670[_0xe536('0x0')]||'';this['username']=_0x54f670['username']||'';this[_0xe536('0x1')]=_0x54f670[_0xe536('0x1')]||'';this[_0xe536('0x2')]=_0x54f670[_0xe536('0x2')]||'';this[_0xe536('0x3')]=_0x54f670['clientId']||'';this['clientSecret']=_0x54f670[_0xe536('0x4')]||'';this['securityToken']=_0x54f670[_0xe536('0x5')]||'';this['type']=_0x54f670['type']||'integrationTab';this[_0xe536('0x6')]=_0x54f670[_0xe536('0x6')]||'';this['Configurations']=_0x54f670['Configurations']||{};}module[_0xe536('0x7')]=SalesforceAccount;
\ No newline at end of file
index 03f25a2..c427db2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bb6=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x589d2f,_0xc49372){var _0x1db27c=function(_0x25d0d3){while(--_0x25d0d3){_0x589d2f['push'](_0x589d2f['shift']());}};_0x1db27c(++_0xc49372);}(_0x9bb6,0x1bc));var _0x69bb=function(_0x455aed,_0x1eefd2){_0x455aed=_0x455aed-0x0;var _0xfc3a2a=_0x9bb6[_0x455aed];return _0xfc3a2a;};'use strict';function ServicenowAccount(_0x5b6251){this['id']=_0x5b6251['id']||0x0;this['name']=_0x5b6251[_0x69bb('0x0')]||'';this[_0x69bb('0x1')]=_0x5b6251[_0x69bb('0x1')]||'';this[_0x69bb('0x2')]=_0x5b6251[_0x69bb('0x2')]||'';this['remoteUri']=_0x5b6251[_0x69bb('0x3')]||'';this[_0x69bb('0x4')]=_0x5b6251['serverUrl']||'';this[_0x69bb('0x5')]=_0x5b6251['Configurations']||{};}module[_0x69bb('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x4c03=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x34675d,_0x5a454f){var _0x5a8d33=function(_0xefa18f){while(--_0xefa18f){_0x34675d['push'](_0x34675d['shift']());}};_0x5a8d33(++_0x5a454f);}(_0x4c03,0xc0));var _0x34c0=function(_0x1d426d,_0x4fcf05){_0x1d426d=_0x1d426d-0x0;var _0x56b920=_0x4c03[_0x1d426d];return _0x56b920;};'use strict';function ServicenowAccount(_0x166055){this['id']=_0x166055['id']||0x0;this[_0x34c0('0x0')]=_0x166055[_0x34c0('0x0')]||'';this[_0x34c0('0x1')]=_0x166055['username']||'';this[_0x34c0('0x2')]=_0x166055[_0x34c0('0x2')]||'';this[_0x34c0('0x3')]=_0x166055['remoteUri']||'';this[_0x34c0('0x4')]=_0x166055['serverUrl']||'';this[_0x34c0('0x5')]=_0x166055['Configurations']||{};}module[_0x34c0('0x6')]=ServicenowAccount;
\ No newline at end of file
index aeb5eb8..676afa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaed6=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xaed6,0x71));var _0x6aed=function(_0x4c14e6,_0x341327){_0x4c14e6=_0x4c14e6-0x0;var _0x2dba21=_0xaed6[_0x4c14e6];return _0x2dba21;};'use strict';function SugarcrmAccount(_0x774ad6){this['id']=_0x774ad6['id']||0x0;this[_0x6aed('0x0')]=_0x774ad6[_0x6aed('0x0')]||'';this[_0x6aed('0x1')]=_0x774ad6['username']||'';this[_0x6aed('0x2')]=_0x774ad6[_0x6aed('0x2')]||'';this['remoteUri']=_0x774ad6[_0x6aed('0x3')]||'';this[_0x6aed('0x4')]=_0x774ad6[_0x6aed('0x4')]||'';this[_0x6aed('0x5')]=_0x774ad6['Configurations']||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
+var _0xb6d1=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3b5c46,_0x272b84){var _0x20e1c0=function(_0x4ca29d){while(--_0x4ca29d){_0x3b5c46['push'](_0x3b5c46['shift']());}};_0x20e1c0(++_0x272b84);}(_0xb6d1,0x15c));var _0x1b6d=function(_0x1989cd,_0x49a8b6){_0x1989cd=_0x1989cd-0x0;var _0x5355bc=_0xb6d1[_0x1989cd];return _0x5355bc;};'use strict';function SugarcrmAccount(_0x5c4d83){this['id']=_0x5c4d83['id']||0x0;this[_0x1b6d('0x0')]=_0x5c4d83['name']||'';this[_0x1b6d('0x1')]=_0x5c4d83[_0x1b6d('0x1')]||'';this[_0x1b6d('0x2')]=_0x5c4d83[_0x1b6d('0x2')]||'';this[_0x1b6d('0x3')]=_0x5c4d83['remoteUri']||'';this[_0x1b6d('0x4')]=_0x5c4d83[_0x1b6d('0x4')]||'';this[_0x1b6d('0x5')]=_0x5c4d83[_0x1b6d('0x5')]||{};}module[_0x1b6d('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 50e10ae..5b818ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4de=['status','address','name','accountcode','state','unknown','stateTime'];(function(_0x564efd,_0x28dd81){var _0x59d385=function(_0x2536a8){while(--_0x2536a8){_0x564efd['push'](_0x564efd['shift']());}};_0x59d385(++_0x28dd81);}(_0xe4de,0x16e));var _0xee4d=function(_0xdada88,_0x34118d){_0xdada88=_0xdada88-0x0;var _0x46b729=_0xe4de[_0xdada88];return _0x46b729;};'use strict';function Telephone(_0x1692ea){this['id']=_0x1692ea['id']||0x0;this[_0xee4d('0x0')]=_0x1692ea[_0xee4d('0x0')]||'';this[_0xee4d('0x1')]=_0x1692ea['accountcode']||'';this[_0xee4d('0x2')]=_0xee4d('0x3');this[_0xee4d('0x4')]=0x0;this[_0xee4d('0x5')]=_0xee4d('0x3');this[_0xee4d('0x6')]='';}module['exports']=Telephone;
\ No newline at end of file
+var _0xf5fd=['unknown','exports','name','accountcode','state','stateTime'];(function(_0x380f4d,_0xeb0b1b){var _0x3d8021=function(_0x3fc2df){while(--_0x3fc2df){_0x380f4d['push'](_0x380f4d['shift']());}};_0x3d8021(++_0xeb0b1b);}(_0xf5fd,0xe0));var _0xdf5f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xf5fd[_0x4792c8];return _0x35edb1;};'use strict';function Telephone(_0x2b26c1){this['id']=_0x2b26c1['id']||0x0;this['name']=_0x2b26c1[_0xdf5f('0x0')]||'';this['accountcode']=_0x2b26c1[_0xdf5f('0x1')]||'';this[_0xdf5f('0x2')]='unknown';this[_0xdf5f('0x3')]=0x0;this['status']=_0xdf5f('0x4');this['address']='';}module[_0xdf5f('0x5')]=Telephone;
\ No newline at end of file
index 5e8897c..31c6390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','html'];(function(_0x397cad,_0x1144db){var _0x16bfd7=function(_0x3f08d8){while(--_0x3f08d8){_0x397cad['push'](_0x397cad['shift']());}};_0x16bfd7(++_0x1144db);}(_0xb10b,0x12a));var _0xbb10=function(_0x33f9c6,_0x24cc4f){_0x33f9c6=_0x33f9c6-0x0;var _0x1edc0d=_0xb10b[_0x33f9c6];return _0x1edc0d;};'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(_0x196dc7,_0x57405b){var _0x4ace1c=function(_0x204da1){while(--_0x204da1){_0x196dc7['push'](_0x196dc7['shift']());}};_0x4ace1c(++_0x57405b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 9f8f5de..ffecf0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x191505,_0x222564){var _0xae3561=function(_0xcd0f6e){while(--_0xcd0f6e){_0x191505['push'](_0x191505['shift']());}};_0xae3561(++_0x222564);}(_0x2032,0xd9));var _0x2203=function(_0x2e5777,_0xc873ee){_0x2e5777=_0x2e5777-0x0;var _0x1cc87c=_0x2032[_0x2e5777];return _0x1cc87c;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger;
\ No newline at end of file
+var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x3dd9a5,_0x5b831f){var _0x5896a1=function(_0x16c86a){while(--_0x16c86a){_0x3dd9a5['push'](_0x3dd9a5['shift']());}};_0x5896a1(++_0x5b831f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x651d44,_0x151f9a){_0x651d44=_0x651d44-0x0;var _0x30b818=_0x9ffd[_0x651d44];return _0x30b818;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger;
\ No newline at end of file
index 340679e..97887d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fcf=['stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','split','host','port','domainport','refresh'];(function(_0x3f91d3,_0x235190){var _0x142ccd=function(_0x562dd3){while(--_0x562dd3){_0x3f91d3['push'](_0x3f91d3['shift']());}};_0x142ccd(++_0x235190);}(_0x8fcf,0x18c));var _0xf8fc=function(_0x250a51,_0x416576){_0x250a51=_0x250a51-0x0;var _0x289824=_0x8fcf[_0x250a51];return _0x289824;};'use strict';function Trunk(_0x5c6ea2){this['id']=_0x5c6ea2['id']||0x0;this[_0xf8fc('0x0')]=_0x5c6ea2[_0xf8fc('0x0')]||![];this[_0xf8fc('0x1')]=_0x5c6ea2['name']||'';this[_0xf8fc('0x2')]=_0xf8fc('0x3');this[_0xf8fc('0x4')]=0x0;this[_0xf8fc('0x5')]='unknown';this['registry']=_0x5c6ea2[_0xf8fc('0x6')]&&_0x5c6ea2[_0xf8fc('0x6')]['indexOf'](':')?_0x5c6ea2['registry'][_0xf8fc('0x7')](':')[0x0]:'';this[_0xf8fc('0x8')]='';this[_0xf8fc('0x9')]='';this['domain']='';this[_0xf8fc('0xa')]='';this[_0xf8fc('0xb')]='';this[_0xf8fc('0xc')]=_0xf8fc('0x3');this[_0xf8fc('0xd')]='';this[_0xf8fc('0xe')]='';this[_0xf8fc('0xf')]=_0x5c6ea2[_0xf8fc('0xf')]||'';}module[_0xf8fc('0x10')]=Trunk;
\ No newline at end of file
+var _0xb4c1=['active','name','state','unknown','stateTime','registry','indexOf','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb4c1,0x120));var _0x1b4c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb4c1[_0x321bb2];return _0x9c12ed;};'use strict';function Trunk(_0x27cbd8){this['id']=_0x27cbd8['id']||0x0;this[_0x1b4c('0x0')]=_0x27cbd8['active']||![];this[_0x1b4c('0x1')]=_0x27cbd8[_0x1b4c('0x1')]||'';this[_0x1b4c('0x2')]=_0x1b4c('0x3');this[_0x1b4c('0x4')]=0x0;this['status']='unknown';this[_0x1b4c('0x5')]=_0x27cbd8[_0x1b4c('0x5')]&&_0x27cbd8[_0x1b4c('0x5')][_0x1b4c('0x6')](':')?_0x27cbd8[_0x1b4c('0x5')]['split'](':')[0x0]:'';this[_0x1b4c('0x7')]='';this[_0x1b4c('0x8')]='';this[_0x1b4c('0x9')]='';this[_0x1b4c('0xa')]='';this[_0x1b4c('0xb')]='';this[_0x1b4c('0xc')]=_0x1b4c('0x3');this[_0x1b4c('0xd')]='';this[_0x1b4c('0xe')]='';this[_0x1b4c('0xf')]=_0x27cbd8[_0x1b4c('0xf')]||'';}module['exports']=Trunk;
\ No newline at end of file
index e4acd27..4298290 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb904=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb904,0x84));var _0x4b90=function(_0x526971,_0x15cf36){_0x526971=_0x526971-0x0;var _0x61cce4=_0xb904[_0x526971];return _0x61cce4;};'use strict';function voiceExtension(_0x4bf7b7){this['id']=_0x4bf7b7['id']||0x0;this[_0x4b90('0x0')]=_0x4bf7b7['exten']||'';this['recordingFormat']=_0x4bf7b7[_0x4b90('0x1')]||_0x4b90('0x2');this[_0x4b90('0x3')]=_0x4bf7b7['mandatoryDisposition']||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0xb9af=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb9af,0x1d0));var _0xfb9a=function(_0x78c20,_0x3ed102){_0x78c20=_0x78c20-0x0;var _0x3f57c=_0xb9af[_0x78c20];return _0x3f57c;};'use strict';function voiceExtension(_0x4f3be1){this['id']=_0x4f3be1['id']||0x0;this[_0xfb9a('0x0')]=_0x4f3be1['exten']||'';this[_0xfb9a('0x1')]=_0x4f3be1[_0xfb9a('0x1')]||_0xfb9a('0x2');this[_0xfb9a('0x3')]=_0x4f3be1[_0xfb9a('0x3')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
index 3af657d..a17d2de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda9=['abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','talking','total','sumDuration','sumBillable','unmanaged'];(function(_0x50d5b1,_0x3716b4){var _0x96ec42=function(_0x46b16e){while(--_0x46b16e){_0x50d5b1['push'](_0x50d5b1['shift']());}};_0x96ec42(++_0x3716b4);}(_0xeda9,0x6a));var _0x9eda=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xeda9[_0x4e9d3c];return _0x2d0825;};'use strict';var statusDesc=[_0x9eda('0x0'),_0x9eda('0x1'),_0x9eda('0x2'),'busy',_0x9eda('0x3'),'unavailable',_0x9eda('0x4'),_0x9eda('0x5'),_0x9eda('0x6')];var monitorFormat={'wav':_0x9eda('0x7'),'wav49':_0x9eda('0x8'),'gsm':_0x9eda('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x9eda('0xa')};function VoiceQueue(_0x466e17){this['id']=_0x466e17['id']||0x0;this[_0x9eda('0xb')]=_0x466e17[_0x9eda('0xb')]||'';this[_0x9eda('0xc')]=_0x466e17[_0x9eda('0xc')]||'';this['type']=_0x466e17[_0x9eda('0xd')]||_0x9eda('0xe');this['waiting']=0x0;this[_0x9eda('0xf')]=0x0;this[_0x9eda('0x10')]=0x0;this['answered']=0x0;this[_0x9eda('0x11')]=0x0;this['sumHoldTime']=0x0;this[_0x9eda('0x12')]=0x0;this[_0x9eda('0x13')]=0x0;this[_0x9eda('0x14')]=0x0;this[_0x9eda('0x15')]=0x0;this['available']=0x0;this['acw']=_0x466e17[_0x9eda('0x16')]||![];this['acwTimeout']=_0x466e17[_0x9eda('0x17')]||0xa;this[_0x9eda('0x18')]=_0x466e17[_0x9eda('0x18')]||'no';this[_0x9eda('0x19')]=!![];this[_0x9eda('0x1a')]='';this[_0x9eda('0x1b')]=0x0;this[_0x9eda('0x1c')]=0x0;this[_0x9eda('0x1d')]=_0x466e17[_0x9eda('0x1d')]||null;this[_0x9eda('0x1e')]=_0x466e17['dialGlobalInterval']?_0x466e17[_0x9eda('0x1e')]:null;this[_0x9eda('0x1f')]=_0x466e17[_0x9eda('0x1f')];this[_0x9eda('0x20')]=_0x466e17['dialMethod']||_0x9eda('0x21');this[_0x9eda('0x22')]=_0x466e17['dialLimitChannel']||0x0;this[_0x9eda('0x23')]=_0x466e17[_0x9eda('0x23')]||0x0;this[_0x9eda('0x24')]=_0x466e17[_0x9eda('0x24')]||0x1;this[_0x9eda('0x25')]=_0x466e17[_0x9eda('0x25')]||'dropRate';this[_0x9eda('0x26')]=_0x466e17['dialPredictiveOptimizationPercentage']||0.03;this[_0x9eda('0x27')]=_0x466e17['dialPredictiveInterval']||0x258;this[_0x9eda('0x28')]=_0x466e17[_0x9eda('0x28')]||'anonymous';this[_0x9eda('0x29')]=_0x466e17[_0x9eda('0x29')]||_0x9eda('0x2a');this[_0x9eda('0x2b')]=_0x466e17[_0x9eda('0x2b')]||0x1e;this[_0x9eda('0x2c')]=_0x466e17[_0x9eda('0x2c')]||_0x9eda('0x2d');this[_0x9eda('0x2e')]=_0x466e17[_0x9eda('0x2e')]||0x3;this[_0x9eda('0x2f')]=_0x466e17[_0x9eda('0x2f')]||undefined;this[_0x9eda('0x30')]=_0x466e17['dialCongestionMaxRetry']||0x3;this[_0x9eda('0x31')]=_0x466e17[_0x9eda('0x31')]||0x96;this[_0x9eda('0x32')]=_0x466e17[_0x9eda('0x32')]||0x3;this[_0x9eda('0x33')]=_0x466e17[_0x9eda('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x466e17[_0x9eda('0x34')]||0x3;this[_0x9eda('0x35')]=_0x466e17[_0x9eda('0x35')]||0x96;this[_0x9eda('0x36')]=_0x466e17[_0x9eda('0x36')]||0x3;this[_0x9eda('0x37')]=_0x466e17[_0x9eda('0x37')]||0x96;this['dialDropMaxRetry']=_0x466e17[_0x9eda('0x38')]||0x3;this[_0x9eda('0x39')]=_0x466e17['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x466e17[_0x9eda('0x3a')]||0x3;this[_0x9eda('0x3b')]=_0x466e17[_0x9eda('0x3b')]||0x96;this[_0x9eda('0x3c')]=_0x466e17[_0x9eda('0x3c')]||0x3;this[_0x9eda('0x3d')]=_0x466e17['dialMachineRetryFrequency']||0x96;this[_0x9eda('0x3e')]=_0x466e17[_0x9eda('0x3e')]||0x3;this[_0x9eda('0x3f')]=_0x466e17[_0x9eda('0x3f')]||0x96;this[_0x9eda('0x40')]=_0x466e17[_0x9eda('0x40')]||0x3;this['dialGlobalMaxRetry']=_0x466e17[_0x9eda('0x41')]||0x4;this['Trunk']=_0x466e17[_0x9eda('0x42')]?_0x466e17[_0x9eda('0x42')]:undefined;this['TrunkBackup']=_0x466e17[_0x9eda('0x43')]?_0x466e17[_0x9eda('0x43')]:undefined;this[_0x9eda('0x44')]=_0x466e17['dialPrefix']||undefined;this[_0x9eda('0x45')]=_0x466e17['Interval']?_0x466e17[_0x9eda('0x45')]:undefined;this[_0x9eda('0x46')]=_0x466e17[_0x9eda('0x46')]||_0x9eda('0x47');this[_0x9eda('0x48')]=_0x466e17[_0x9eda('0x48')]||undefined;this[_0x9eda('0x49')]=_0x466e17[_0x9eda('0x49')]||undefined;this[_0x9eda('0x4a')]=strategy[_0x466e17[_0x9eda('0x4a')]]||_0x9eda('0x4b');this[_0x9eda('0x4c')]=!![];this['dialAMDActive']=_0x466e17['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x466e17[_0x9eda('0x4d')];this['dialAMDGreeting']=_0x466e17[_0x9eda('0x4e')];this[_0x9eda('0x4f')]=_0x466e17[_0x9eda('0x4f')];this[_0x9eda('0x50')]=_0x466e17[_0x9eda('0x50')];this[_0x9eda('0x51')]=_0x466e17[_0x9eda('0x51')];this[_0x9eda('0x52')]=_0x466e17['dialAMDBetweenWordsSilence'];this[_0x9eda('0x53')]=_0x466e17[_0x9eda('0x53')];this[_0x9eda('0x54')]=_0x466e17[_0x9eda('0x54')];this[_0x9eda('0x55')]=_0x466e17[_0x9eda('0x55')];this[_0x9eda('0x56')]=0x0;this[_0x9eda('0x57')]=0x0;this[_0x9eda('0x58')]=_0x466e17[_0x9eda('0x58')];this[_0x9eda('0x59')]=0x0;this[_0x9eda('0x5a')]=0x0;this[_0x9eda('0x5b')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x9eda('0x5c')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x9eda('0x5d')]=0x0;this[_0x9eda('0x5e')]=0x0;this[_0x9eda('0x5f')]=0x0;this[_0x9eda('0x60')]=0x0;this[_0x9eda('0x61')]=0x0;this[_0x9eda('0x62')]=0x0;this[_0x9eda('0x63')]=0x0;this[_0x9eda('0x64')]=0x0;this[_0x9eda('0x65')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x9eda('0x66')]=0x0;this[_0x9eda('0x67')]=0x0;this[_0x9eda('0x68')]=0x0;this[_0x9eda('0x69')]=0x0;this[_0x9eda('0x6a')]=0x0;this[_0x9eda('0x6b')]=0x0;this[_0x9eda('0x6c')]=0x0;this[_0x9eda('0x6d')]=0x0;this['predictiveIntervalMaxThreshold']=_0x466e17['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x9eda('0x6e')]=_0x466e17[_0x9eda('0x6f')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x9eda('0x70')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x9eda('0x71')]=0x0;this[_0x9eda('0x72')]=0x0;this[_0x9eda('0x73')]=0x0;this['erlangBusyFactor']=0x0;this[_0x9eda('0x74')]=_0x466e17[_0x9eda('0x74')]||0x1e;this[_0x9eda('0x75')]=_0x466e17[_0x9eda('0x75')]||![];this[_0x9eda('0x76')]=!!_0x466e17[_0x9eda('0x76')]||![];this['dialPreviewRecallmeReminder']=!!_0x466e17[_0x9eda('0x77')]||![];this[_0x9eda('0x78')]=_0x466e17[_0x9eda('0x78')]||undefined;this[_0x9eda('0x79')]=_0x466e17['dialAgiAfterHangupClient']||![];this[_0x9eda('0x7a')]=_0x466e17[_0x9eda('0x7a')]||![];this['monitor_format']=monitorFormat[_0x466e17[_0x9eda('0xc')]]?monitorFormat[_0x466e17[_0x9eda('0xc')]]:undefined;this[_0x9eda('0x7b')]=_0x466e17[_0x9eda('0x7b')]||![];this[_0x9eda('0x7c')]=_0x466e17['mandatoryDispositionPause']?_0x466e17[_0x9eda('0x7c')]:undefined;}module[_0x9eda('0x7d')]=VoiceQueue;
\ No newline at end of file
+var _0xdc99=['dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX'];(function(_0x58da9c,_0x109e4c){var _0x3916c7=function(_0xb1342){while(--_0xb1342){_0x58da9c['push'](_0x58da9c['shift']());}};_0x3916c7(++_0x109e4c);}(_0xdc99,0x19f));var _0x9dc9=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0xdc99[_0x1a595a];return _0x33f008;};'use strict';var statusDesc=[_0x9dc9('0x0'),'not_inuse','inuse',_0x9dc9('0x1'),_0x9dc9('0x2'),_0x9dc9('0x3'),_0x9dc9('0x4'),_0x9dc9('0x5'),_0x9dc9('0x6')];var monitorFormat={'wav':_0x9dc9('0x7'),'wav49':_0x9dc9('0x8'),'gsm':_0x9dc9('0x9')};var strategy={'rrmemory':_0x9dc9('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x2b4b74){this['id']=_0x2b4b74['id']||0x0;this[_0x9dc9('0xb')]=_0x2b4b74[_0x9dc9('0xb')]||'';this['monitor_format']=_0x2b4b74[_0x9dc9('0xc')]||'';this['type']=_0x2b4b74[_0x9dc9('0xd')]||_0x9dc9('0xe');this[_0x9dc9('0xf')]=0x0;this[_0x9dc9('0x10')]=0x0;this[_0x9dc9('0x11')]=0x0;this[_0x9dc9('0x12')]=0x0;this['sumDuration']=0x0;this[_0x9dc9('0x13')]=0x0;this['sumBillable']=0x0;this[_0x9dc9('0x14')]=0x0;this[_0x9dc9('0x15')]=0x0;this[_0x9dc9('0x16')]=0x0;this[_0x9dc9('0x17')]=0x0;this[_0x9dc9('0x18')]=_0x2b4b74[_0x9dc9('0x18')]||![];this['acwTimeout']=_0x2b4b74[_0x9dc9('0x19')]||0xa;this[_0x9dc9('0x1a')]=_0x2b4b74['autopause']||'no';this[_0x9dc9('0x1b')]=!![];this[_0x9dc9('0x1c')]='';this[_0x9dc9('0x1d')]=0x0;this[_0x9dc9('0x1e')]=0x0;this[_0x9dc9('0x1f')]=_0x2b4b74['dialTimezone']||null;this[_0x9dc9('0x20')]=_0x2b4b74['dialGlobalInterval']?_0x2b4b74[_0x9dc9('0x20')]:null;this[_0x9dc9('0x21')]=_0x2b4b74['dialActive'];this['dialMethod']=_0x2b4b74[_0x9dc9('0x22')]||_0x9dc9('0x23');this[_0x9dc9('0x24')]=_0x2b4b74[_0x9dc9('0x24')]||0x0;this[_0x9dc9('0x25')]=_0x2b4b74[_0x9dc9('0x25')]||0x0;this['dialPowerLevel']=_0x2b4b74[_0x9dc9('0x26')]||0x1;this[_0x9dc9('0x27')]=_0x2b4b74['dialPredictiveOptimization']||_0x9dc9('0x28');this['dialPredictiveOptimizationPercentage']=_0x2b4b74[_0x9dc9('0x29')]||0.03;this[_0x9dc9('0x2a')]=_0x2b4b74['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x2b4b74[_0x9dc9('0x2b')]||_0x9dc9('0x2c');this['dialOriginateCallerIdNumber']=_0x2b4b74[_0x9dc9('0x2d')]||'anonymous';this[_0x9dc9('0x2e')]=_0x2b4b74['dialOriginateTimeout']||0x1e;this[_0x9dc9('0x2f')]=_0x2b4b74[_0x9dc9('0x2f')]||_0x9dc9('0x30');this[_0x9dc9('0x31')]=_0x2b4b74[_0x9dc9('0x31')]||0x3;this['dialQueueProject']=_0x2b4b74['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x2b4b74[_0x9dc9('0x32')]||0x3;this['dialCongestionRetryFrequency']=_0x2b4b74[_0x9dc9('0x33')]||0x96;this['dialBusyMaxRetry']=_0x2b4b74[_0x9dc9('0x34')]||0x3;this['dialBusyRetryFrequency']=_0x2b4b74[_0x9dc9('0x35')]||0x96;this[_0x9dc9('0x36')]=_0x2b4b74['dialNoAnswerMaxRetry']||0x3;this[_0x9dc9('0x37')]=_0x2b4b74[_0x9dc9('0x37')]||0x96;this[_0x9dc9('0x38')]=_0x2b4b74[_0x9dc9('0x38')]||0x3;this[_0x9dc9('0x39')]=_0x2b4b74[_0x9dc9('0x39')]||0x96;this['dialDropMaxRetry']=_0x2b4b74[_0x9dc9('0x3a')]||0x3;this[_0x9dc9('0x3b')]=_0x2b4b74[_0x9dc9('0x3b')]||0x96;this['dialAbandonedMaxRetry']=_0x2b4b74[_0x9dc9('0x3c')]||0x3;this['dialAbandonedRetryFrequency']=_0x2b4b74[_0x9dc9('0x3d')]||0x96;this['dialMachineMaxRetry']=_0x2b4b74[_0x9dc9('0x3e')]||0x3;this[_0x9dc9('0x3f')]=_0x2b4b74[_0x9dc9('0x3f')]||0x96;this['dialAgentRejectMaxRetry']=_0x2b4b74[_0x9dc9('0x40')]||0x3;this[_0x9dc9('0x41')]=_0x2b4b74[_0x9dc9('0x41')]||0x96;this[_0x9dc9('0x42')]=_0x2b4b74['dialGlobalMaxRetry']||0x4;this[_0x9dc9('0x43')]=_0x2b4b74[_0x9dc9('0x43')]?_0x2b4b74[_0x9dc9('0x43')]:undefined;this[_0x9dc9('0x44')]=_0x2b4b74[_0x9dc9('0x44')]?_0x2b4b74[_0x9dc9('0x44')]:undefined;this[_0x9dc9('0x45')]=_0x2b4b74['dialPrefix']||undefined;this[_0x9dc9('0x46')]=_0x2b4b74[_0x9dc9('0x46')]?_0x2b4b74[_0x9dc9('0x46')]:undefined;this[_0x9dc9('0x47')]=_0x2b4b74['dialOrderByScheduledAt']||_0x9dc9('0x48');this[_0x9dc9('0x49')]=_0x2b4b74[_0x9dc9('0x49')]||undefined;this[_0x9dc9('0x4a')]=_0x2b4b74[_0x9dc9('0x4a')]||undefined;this[_0x9dc9('0x4b')]=strategy[_0x2b4b74[_0x9dc9('0x4b')]]||'rrmemory';this[_0x9dc9('0x4c')]=!![];this['dialAMDActive']=_0x2b4b74[_0x9dc9('0x4d')]||![];this['dialAMDInitialSilence']=_0x2b4b74['dialAMDInitialSilence'];this[_0x9dc9('0x4e')]=_0x2b4b74[_0x9dc9('0x4e')];this['dialAMDAfterGreetingSilence']=_0x2b4b74[_0x9dc9('0x4f')];this[_0x9dc9('0x50')]=_0x2b4b74[_0x9dc9('0x50')];this[_0x9dc9('0x51')]=_0x2b4b74['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x2b4b74[_0x9dc9('0x52')];this[_0x9dc9('0x53')]=_0x2b4b74['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x2b4b74['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x2b4b74[_0x9dc9('0x54')];this['outboundRejectCallsDay']=0x0;this[_0x9dc9('0x55')]=0x0;this[_0x9dc9('0x56')]=_0x2b4b74[_0x9dc9('0x56')];this[_0x9dc9('0x57')]=0x0;this[_0x9dc9('0x58')]=0x0;this[_0x9dc9('0x59')]=0x0;this[_0x9dc9('0x5a')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x9dc9('0x5b')]=0x0;this[_0x9dc9('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x9dc9('0x5d')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x9dc9('0x5e')]=0x0;this['startProgressive']=undefined;this[_0x9dc9('0x5f')]=undefined;this[_0x9dc9('0x60')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x9dc9('0x61')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x9dc9('0x62')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x9dc9('0x63')]=0x0;this[_0x9dc9('0x64')]=0x0;this[_0x9dc9('0x65')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2b4b74[_0x9dc9('0x66')]||0x14;this['predictiveIntervalMinThreshold']=_0x2b4b74[_0x9dc9('0x66')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x9dc9('0x67')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x9dc9('0x68')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x9dc9('0x69')]=0x0;this[_0x9dc9('0x6a')]=_0x2b4b74[_0x9dc9('0x6a')]||0x1e;this[_0x9dc9('0x6b')]=_0x2b4b74[_0x9dc9('0x6b')]||![];this[_0x9dc9('0x6c')]=!!_0x2b4b74['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x2b4b74[_0x9dc9('0x6d')]||![];this[_0x9dc9('0x6e')]=_0x2b4b74[_0x9dc9('0x6e')]||undefined;this[_0x9dc9('0x6f')]=_0x2b4b74[_0x9dc9('0x6f')]||![];this[_0x9dc9('0x70')]=_0x2b4b74[_0x9dc9('0x70')]||![];this[_0x9dc9('0xc')]=monitorFormat[_0x2b4b74[_0x9dc9('0xc')]]?monitorFormat[_0x2b4b74[_0x9dc9('0xc')]]:undefined;this[_0x9dc9('0x71')]=_0x2b4b74[_0x9dc9('0x71')]||![];this[_0x9dc9('0x72')]=_0x2b4b74[_0x9dc9('0x72')]?_0x2b4b74[_0x9dc9('0x72')]:undefined;}module[_0x9dc9('0x73')]=VoiceQueue;
\ No newline at end of file
index b4555d7..d0cb26f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f5c=['serverUrl','Configurations','exports','username','accessKey','remoteUri'];(function(_0x468bc5,_0x59056b){var _0xcc3657=function(_0x398846){while(--_0x398846){_0x468bc5['push'](_0x468bc5['shift']());}};_0xcc3657(++_0x59056b);}(_0x8f5c,0x177));var _0xc8f5=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x8f5c[_0x599e60];return _0x468e19;};'use strict';function VtigerAccount(_0x5144fc){this['id']=_0x5144fc['id']||0x0;this['name']=_0x5144fc['name']||'';this['username']=_0x5144fc[_0xc8f5('0x0')]||'';this[_0xc8f5('0x1')]=_0x5144fc['accessKey']||'';this[_0xc8f5('0x2')]=_0x5144fc[_0xc8f5('0x2')]||'';this[_0xc8f5('0x3')]=_0x5144fc[_0xc8f5('0x3')]||'';this['Configurations']=_0x5144fc[_0xc8f5('0x4')]||{};}module[_0xc8f5('0x5')]=VtigerAccount;
\ No newline at end of file
+var _0xd5fc=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x5b5062,_0x38c59b){var _0x13e43c=function(_0x3e591a){while(--_0x3e591a){_0x5b5062['push'](_0x5b5062['shift']());}};_0x13e43c(++_0x38c59b);}(_0xd5fc,0x11a));var _0xcd5f=function(_0x2c86c0,_0x249252){_0x2c86c0=_0x2c86c0-0x0;var _0x321381=_0xd5fc[_0x2c86c0];return _0x321381;};'use strict';function VtigerAccount(_0x336c16){this['id']=_0x336c16['id']||0x0;this[_0xcd5f('0x0')]=_0x336c16['name']||'';this[_0xcd5f('0x1')]=_0x336c16[_0xcd5f('0x1')]||'';this[_0xcd5f('0x2')]=_0x336c16['accessKey']||'';this[_0xcd5f('0x3')]=_0x336c16[_0xcd5f('0x3')]||'';this['serverUrl']=_0x336c16[_0xcd5f('0x4')]||'';this[_0xcd5f('0x5')]=_0x336c16[_0xcd5f('0x5')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
index e214808..cfd487c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50ae=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x50ae,0xa0));var _0xe50a=function(_0x2a9146,_0x5387da){_0x2a9146=_0x2a9146-0x0;var _0x3816d3=_0x50ae[_0x2a9146];return _0x3816d3;};'use strict';function ZendeskAccount(_0x4c5c93){this['id']=_0x4c5c93['id']||0x0;this['name']=_0x4c5c93[_0xe50a('0x0')]||'';this[_0xe50a('0x1')]=_0x4c5c93[_0xe50a('0x1')]||'';this['password']=_0x4c5c93[_0xe50a('0x2')]||'';this[_0xe50a('0x3')]=_0x4c5c93[_0xe50a('0x3')]||'';this[_0xe50a('0x4')]=_0x4c5c93['remoteUri']||'';this[_0xe50a('0x5')]=_0x4c5c93['authType']||'';this['type']=_0x4c5c93[_0xe50a('0x6')]||_0xe50a('0x7');this[_0xe50a('0x8')]=_0x4c5c93[_0xe50a('0x8')]||'';this['Configurations']=_0x4c5c93[_0xe50a('0x9')]||{};}module[_0xe50a('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x2274=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x2274,0xbf));var _0x4227=function(_0x87dbf2,_0x565e93){_0x87dbf2=_0x87dbf2-0x0;var _0x4a76e7=_0x2274[_0x87dbf2];return _0x4a76e7;};'use strict';function ZendeskAccount(_0x4f7b7a){this['id']=_0x4f7b7a['id']||0x0;this['name']=_0x4f7b7a[_0x4227('0x0')]||'';this['username']=_0x4f7b7a[_0x4227('0x1')]||'';this[_0x4227('0x2')]=_0x4f7b7a[_0x4227('0x2')]||'';this[_0x4227('0x3')]=_0x4f7b7a[_0x4227('0x3')]||'';this[_0x4227('0x4')]=_0x4f7b7a[_0x4227('0x4')]||'';this[_0x4227('0x5')]=_0x4f7b7a['authType']||'';this[_0x4227('0x6')]=_0x4f7b7a[_0x4227('0x6')]||_0x4227('0x7');this['serverUrl']=_0x4f7b7a[_0x4227('0x8')]||'';this[_0x4227('0x9')]=_0x4f7b7a[_0x4227('0x9')]||{};}module[_0x4227('0xa')]=ZendeskAccount;
\ No newline at end of file
index 349244d..7d8a5bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b5c=['zone','clientSecret','serverUrl','code','refreshToken','name','description','host'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x2b5c,0x1bd));var _0xc2b5=function(_0x3460c9,_0x565510){_0x3460c9=_0x3460c9-0x0;var _0x1d8283=_0x2b5c[_0x3460c9];return _0x1d8283;};'use strict';function ZohoAccount(_0x4c9c9e){this['id']=_0x4c9c9e['id']||0x0;this[_0xc2b5('0x0')]=_0x4c9c9e['name']||'';this[_0xc2b5('0x1')]=_0x4c9c9e[_0xc2b5('0x1')]||'';this[_0xc2b5('0x2')]=_0x4c9c9e[_0xc2b5('0x2')]||'';this[_0xc2b5('0x3')]=_0x4c9c9e[_0xc2b5('0x3')]||'';this['clientId']=_0x4c9c9e['clientId']||'';this[_0xc2b5('0x4')]=_0x4c9c9e['clientSecret']||'';this[_0xc2b5('0x5')]=_0x4c9c9e[_0xc2b5('0x5')]||'';this[_0xc2b5('0x6')]=_0x4c9c9e[_0xc2b5('0x6')]||'';this[_0xc2b5('0x7')]=_0x4c9c9e['refreshToken']||'';this['Configurations']=_0x4c9c9e['Configurations']||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0xe301=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x306e25,_0x3a7315){var _0x1f0d5f=function(_0x14cb7f){while(--_0x14cb7f){_0x306e25['push'](_0x306e25['shift']());}};_0x1f0d5f(++_0x3a7315);}(_0xe301,0x13c));var _0x1e30=function(_0x50cf34,_0xa98934){_0x50cf34=_0x50cf34-0x0;var _0x4de0bb=_0xe301[_0x50cf34];return _0x4de0bb;};'use strict';function ZohoAccount(_0x546bc2){this['id']=_0x546bc2['id']||0x0;this[_0x1e30('0x0')]=_0x546bc2[_0x1e30('0x0')]||'';this['description']=_0x546bc2[_0x1e30('0x1')]||'';this[_0x1e30('0x2')]=_0x546bc2[_0x1e30('0x2')]||'';this['zone']=_0x546bc2[_0x1e30('0x3')]||'';this[_0x1e30('0x4')]=_0x546bc2['clientId']||'';this[_0x1e30('0x5')]=_0x546bc2['clientSecret']||'';this[_0x1e30('0x6')]=_0x546bc2[_0x1e30('0x6')]||'';this[_0x1e30('0x7')]=_0x546bc2['code']||'';this[_0x1e30('0x8')]=_0x546bc2[_0x1e30('0x8')]||'';this[_0x1e30('0x9')]=_0x546bc2['Configurations']||{};}module[_0x1e30('0xa')]=ZohoAccount;
\ No newline at end of file
index 4ddec0e..ac6c506 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','calleridname','number','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','phone'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x2f31b1,_0x17daa8){_0x2f31b1=_0x2f31b1-0x0;var _0x448988=_0xeb3b[_0x2f31b1];return _0x448988;};'use strict';var util=require(_0xbeb3('0x0'));var _=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));function checkNameSurname(_0x33e049,_0xba125a,_0x565c41){var _0x5df0cb='';if(!_[_0xbeb3('0x3')](_0xba125a)&&'string'===typeof _0xba125a){_0x5df0cb+=_0xba125a;}if(!_[_0xbeb3('0x3')](_0x565c41)&&'string'===typeof _0x565c41){_0x5df0cb+='\x20'+_0x565c41;}if(_0x5df0cb!==''){return _0x5df0cb;}return _0x33e049;}function Action(_0x2e8a69,_0x5ae6f9,_0x8d8cce,_0x294cc9,_0x406927){this[_0xbeb3('0x4')]=_0x8d8cce||undefined;this['idContact']=_0x2e8a69['id'];this[_0xbeb3('0x5')]=_0x5ae6f9[_0xbeb3('0x6')];this[_0xbeb3('0x7')]=_0x5ae6f9[_0xbeb3('0x7')];this[_0xbeb3('0x8')]=_0xbeb3('0x5');this[_0xbeb3('0x9')]=![];this['membername']=_[_0xbeb3('0x3')](_0x2e8a69[_0xbeb3('0xa')])?undefined:_0x2e8a69['Agent'][_0xbeb3('0x6')];this[_0xbeb3('0xb')]=this[_0xbeb3('0xc')]?util[_0xbeb3('0xd')](_0xbeb3('0xe'),this[_0xbeb3('0xc')]):_0x294cc9||undefined;this['calleridname']=checkNameSurname(_0x2e8a69['Contact'][_0xbeb3('0xf')],_0x2e8a69[_0xbeb3('0x10')]['firstName'],_0x2e8a69['Contact'][_0xbeb3('0x11')]);this[_0xbeb3('0x12')]=_0x2e8a69[_0xbeb3('0x12')]||![];this[_0xbeb3('0x13')]=_0x2e8a69[_0xbeb3('0xf')];this['scheduledat']=_0x2e8a69[_0xbeb3('0x14')];this['countbusyretry']=_0x2e8a69[_0xbeb3('0x15')]||0x0;this['countcongestionretry']=_0x2e8a69['countcongestionretry']||0x0;this['countnoanswerretry']=_0x2e8a69[_0xbeb3('0x16')]||0x0;this[_0xbeb3('0x17')]=(_0x2e8a69[_0xbeb3('0x15')]||0x0)+(_0x2e8a69[_0xbeb3('0x18')]||0x0)+(_0x2e8a69['countnoanswerretry']||0x0)+(_0x2e8a69[_0xbeb3('0x19')]||0x0)+(_0x2e8a69[_0xbeb3('0x1a')]||0x0)+(_0x2e8a69[_0xbeb3('0x1b')]||0x0)+(_0x2e8a69['countmachineretry']||0x0)+(_0x2e8a69['countagentrejectretry']||0x0);this[_0xbeb3('0x19')]=_0x2e8a69['countnosuchnumberretry']||0x0;this[_0xbeb3('0x1a')]=_0x2e8a69['countdropretry']||0x0;this['countabandonedretry']=_0x2e8a69[_0xbeb3('0x1b')]||0x0;this[_0xbeb3('0x1c')]=_0x2e8a69[_0xbeb3('0x1c')]||0x0;this['countagentrejectretry']=_0x2e8a69[_0xbeb3('0x1d')]||0x0;this[_0xbeb3('0x1e')]=_0x2e8a69['callback'];this[_0xbeb3('0x1f')]=_0x2e8a69[_0xbeb3('0x1f')];this['callbackat']=_0x2e8a69[_0xbeb3('0x20')];this[_0xbeb3('0x21')]=_0x2e8a69[_0xbeb3('0x21')];this[_0xbeb3('0x22')]=_0x2e8a69[_0xbeb3('0x22')];this[_0xbeb3('0x23')]=_0x2e8a69[_0xbeb3('0x23')];this[_0xbeb3('0x24')]=_[_0xbeb3('0x3')](_0x2e8a69['Agent'])?_0x2e8a69['UserId']:_0x2e8a69[_0xbeb3('0xa')]['id'];this['VoiceQueueId']=_0x2e8a69[_0xbeb3('0x25')];this[_0xbeb3('0x26')]='';this[_0xbeb3('0x27')]='';}Action[_0xbeb3('0x28')]['getCaller']=function(){return util[_0xbeb3('0xd')]('\x22%s\x22\x20<%s>',this[_0xbeb3('0x29')],this[_0xbeb3('0x2a')]);};module['exports']=Action;
\ No newline at end of file
+var _0xf6f7=['isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','format','calleridname','number','exports','util','lodash','moment'];(function(_0x3b43d4,_0x162054){var _0x40f9ea=function(_0x5dc310){while(--_0x5dc310){_0x3b43d4['push'](_0x3b43d4['shift']());}};_0x40f9ea(++_0x162054);}(_0xf6f7,0xe3));var _0x7f6f=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xf6f7[_0x2b91c5];return _0xbd5531;};'use strict';var util=require(_0x7f6f('0x0'));var _=require(_0x7f6f('0x1'));var moment=require(_0x7f6f('0x2'));function checkNameSurname(_0x3081f7,_0xdc81f2,_0x51f2c6){var _0x112613='';if(!_[_0x7f6f('0x3')](_0xdc81f2)&&_0x7f6f('0x4')===typeof _0xdc81f2){_0x112613+=_0xdc81f2;}if(!_['isNil'](_0x51f2c6)&&_0x7f6f('0x4')===typeof _0x51f2c6){_0x112613+='\x20'+_0x51f2c6;}if(_0x112613!==''){return _0x112613;}return _0x3081f7;}function Action(_0x2e3c94,_0x136141,_0x364d4d,_0x158dc2,_0x4bb522){this[_0x7f6f('0x5')]=_0x364d4d||undefined;this[_0x7f6f('0x6')]=_0x2e3c94['id'];this[_0x7f6f('0x7')]=_0x136141[_0x7f6f('0x8')];this[_0x7f6f('0x9')]=_0x136141['type'];this[_0x7f6f('0xa')]='queue';this[_0x7f6f('0xb')]=![];this[_0x7f6f('0xc')]=_['isNil'](_0x2e3c94[_0x7f6f('0xd')])?undefined:_0x2e3c94[_0x7f6f('0xd')][_0x7f6f('0x8')];this[_0x7f6f('0xe')]=this[_0x7f6f('0xc')]?util['format'](_0x7f6f('0xf'),this['membername']):_0x158dc2||undefined;this['calleridname']=checkNameSurname(_0x2e3c94[_0x7f6f('0x10')]['phone'],_0x2e3c94[_0x7f6f('0x10')][_0x7f6f('0x11')],_0x2e3c94[_0x7f6f('0x10')][_0x7f6f('0x12')]);this['active']=_0x2e3c94[_0x7f6f('0x13')]||![];this[_0x7f6f('0x14')]=_0x2e3c94[_0x7f6f('0x10')][_0x7f6f('0x15')];this[_0x7f6f('0x16')]=_0x2e3c94[_0x7f6f('0x16')];this['countbusyretry']=_0x2e3c94[_0x7f6f('0x17')]||0x0;this['countcongestionretry']=_0x2e3c94['countcongestionretry']||0x0;this[_0x7f6f('0x18')]=_0x2e3c94[_0x7f6f('0x18')]||0x0;this[_0x7f6f('0x19')]=(_0x2e3c94[_0x7f6f('0x17')]||0x0)+(_0x2e3c94['countcongestionretry']||0x0)+(_0x2e3c94[_0x7f6f('0x18')]||0x0)+(_0x2e3c94[_0x7f6f('0x1a')]||0x0)+(_0x2e3c94[_0x7f6f('0x1b')]||0x0)+(_0x2e3c94[_0x7f6f('0x1c')]||0x0)+(_0x2e3c94[_0x7f6f('0x1d')]||0x0)+(_0x2e3c94['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x2e3c94[_0x7f6f('0x1a')]||0x0;this[_0x7f6f('0x1b')]=_0x2e3c94[_0x7f6f('0x1b')]||0x0;this['countabandonedretry']=_0x2e3c94[_0x7f6f('0x1c')]||0x0;this[_0x7f6f('0x1d')]=_0x2e3c94['countmachineretry']||0x0;this['countagentrejectretry']=_0x2e3c94[_0x7f6f('0x1e')]||0x0;this['callback']=_0x2e3c94[_0x7f6f('0x1f')];this[_0x7f6f('0x20')]=_0x2e3c94['callbackuniqueid'];this[_0x7f6f('0x21')]=_0x2e3c94[_0x7f6f('0x21')];this[_0x7f6f('0x22')]=_0x2e3c94[_0x7f6f('0x22')];this['ContactId']=_0x2e3c94[_0x7f6f('0x23')];this[_0x7f6f('0x24')]=_0x2e3c94[_0x7f6f('0x24')];this[_0x7f6f('0x25')]=_['isNil'](_0x2e3c94['Agent'])?_0x2e3c94[_0x7f6f('0x25')]:_0x2e3c94[_0x7f6f('0xd')]['id'];this[_0x7f6f('0x26')]=_0x2e3c94[_0x7f6f('0x26')];this[_0x7f6f('0x27')]='';this[_0x7f6f('0x28')]='';}Action['prototype'][_0x7f6f('0x29')]=function(){return util[_0x7f6f('0x2a')]('\x22%s\x22\x20<%s>',this[_0x7f6f('0x2b')],this[_0x7f6f('0x2c')]);};module[_0x7f6f('0x2d')]=Action;
\ No newline at end of file
index 2cceed1..92c3981 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','countbusyretry','dialBusyMaxRetry','scheduledAt','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','status','SIP/%s','execRun','recallme','validateContact','isValid','phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','defaults','socket.io-emitter','redis','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require(_0x0a9e('0x9'));var Action=require(_0x0a9e('0xa'));var ut=require('./util/util');config['redis']=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0xc'))(new Redis(config[_0x0a9e('0xd')]));var Sequence=function(){};Sequence[_0x0a9e('0xe')][_0x0a9e('0xf')]=function(_0xfeb75b){this[_0x0a9e('0x10')]=this['tail']?this['tail']['finally'](_0xfeb75b):_0xfeb75b();};function Preview(_0x4cfe67){this[_0x0a9e('0x11')]=new Sequence();this[_0x0a9e('0x12')]=_0x4cfe67[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x4cfe67[_0x0a9e('0x14')];this[_0x0a9e('0x15')]={};this['agents']=_0x4cfe67[_0x0a9e('0x16')];this[_0x0a9e('0x17')]=0x0;ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x1b'),this['syncHangup'][_0x0a9e('0x1a')](this));ami['on']('hanguprequest',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')]['bind'](this));ami['on'](_0x0a9e('0x1f'),this['syncNewExten'][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x24'),this[_0x0a9e('0x25')][_0x0a9e('0x1a')](this));this[_0x0a9e('0x26')](this[_0x0a9e('0x12')]);}function emit(_0x4bb1e3,_0x2c3407,_0x155cce){io['to'](_0x4bb1e3)['emit'](_0x2c3407,_0x155cce);}function emitCampaignPreview(_0x20f109){if(_0x20f109['type']==='outbound'){var _0x3a02e1={'id':_0x20f109['id'],'name':_0x20f109[_0x0a9e('0x27')],'strategy':_0x20f109[_0x0a9e('0x28')],'answered':_0x20f109[_0x0a9e('0x29')],'available':_0x20f109['available'],'loggedIn':_0x20f109[_0x0a9e('0x2a')],'pTalking':_0x20f109[_0x0a9e('0x2b')],'sumBillable':_0x20f109[_0x0a9e('0x2c')],'sumDuration':_0x20f109[_0x0a9e('0x2d')],'sumHoldTime':_0x20f109[_0x0a9e('0x2e')]||0x0,'talking':_0x20f109[_0x0a9e('0x2f')],'total':_0x20f109[_0x0a9e('0x30')],'type':_0x20f109['type'],'unmanaged':_0x20f109['unmanaged'],'abandoned':_0x20f109[_0x0a9e('0x31')],'waiting':_0x20f109[_0x0a9e('0x32')],'loggedInDb':_0x20f109[_0x0a9e('0x33')],'dialActive':_0x20f109[_0x0a9e('0x34')],'dialMethod':_0x20f109['dialMethod'],'dialOriginateCallerIdName':_0x20f109[_0x0a9e('0x35')],'dialOriginateCallerIdNumber':_0x20f109['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x20f109[_0x0a9e('0x36')],'dialPrefix':_0x20f109['dialPrefix'],'outboundAnswerAgiCallsDay':_0x20f109[_0x0a9e('0x37')],'outboundAnswerCallsDay':_0x20f109[_0x0a9e('0x38')],'outboundBlacklistCallsDay':_0x20f109[_0x0a9e('0x39')],'outboundBusyCallsDay':_0x20f109[_0x0a9e('0x3a')],'outboundCongestionCallsDay':_0x20f109[_0x0a9e('0x3b')],'outboundDropCallsDayACS':_0x20f109[_0x0a9e('0x3c')],'outboundDropCallsDayCallersExit':_0x20f109[_0x0a9e('0x3d')],'outboundDropCallsDayTimeout':_0x20f109[_0x0a9e('0x3e')],'outboundNoAnswerCallsDay':_0x20f109['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x20f109[_0x0a9e('0x3f')],'outboundOriginateFailureCallsDay':_0x20f109[_0x0a9e('0x40')],'outboundReCallsDay':_0x20f109[_0x0a9e('0x41')],'outboundRejectCallsDay':_0x20f109[_0x0a9e('0x42')],'outboundUnknownCallsDay':_0x20f109['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x20f109[_0x0a9e('0x43')],'predictiveIntervalAnsweredCalls':_0x20f109[_0x0a9e('0x44')],'predictiveIntervalAvgHoldtime':_0x20f109[_0x0a9e('0x45')],'predictiveIntervalAvgTalktime':_0x20f109[_0x0a9e('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x20f109[_0x0a9e('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x20f109[_0x0a9e('0x48')],'predictiveIntervalErlangCalls':_0x20f109[_0x0a9e('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x20f109[_0x0a9e('0x4a')],'predictiveIntervalHitRate':_0x20f109[_0x0a9e('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x20f109['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x20f109[_0x0a9e('0x4c')],'predictiveIntervalAvailable':_0x20f109['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x20f109[_0x0a9e('0x4d')],'message':_0x20f109[_0x0a9e('0x4e')],'originated':_0x20f109[_0x0a9e('0x4f')],'erlangCalls':_0x20f109[_0x0a9e('0x50')],'erlangCallToSecond':_0x20f109[_0x0a9e('0x51')],'erlangAbandonmentRate':_0x20f109['erlangAbandonmentRate'],'erlangBusyFactor':_0x20f109[_0x0a9e('0x52')],'startPredictive':_0x20f109[_0x0a9e('0x53')],'startProgressive':_0x20f109[_0x0a9e('0x54')]};if(_0x20f109[_0x0a9e('0x55')]){_0x3a02e1[_0x0a9e('0x55')]={'id':_0x20f109[_0x0a9e('0x55')]['id'],'name':_0x20f109[_0x0a9e('0x55')][_0x0a9e('0x27')],'active':_0x20f109['Trunk'][_0x0a9e('0x56')],'callerid':_0x20f109['Trunk'][_0x0a9e('0x57')]};}if(_0x20f109[_0x0a9e('0x58')]){_0x3a02e1[_0x0a9e('0x58')]={'id':_0x20f109[_0x0a9e('0x58')]['id'],'name':_0x20f109['Interval'][_0x0a9e('0x27')]};}var _0xd1836d=md5(JSON[_0x0a9e('0x59')](_0x3a02e1));if(_0x20f109[_0x0a9e('0x3')]!==_0xd1836d){_0x20f109['md5']=_0xd1836d;emit(util['format'](_0x0a9e('0x5a'),_0x3a02e1['name']),_0x0a9e('0x5b'),_0x3a02e1);}}}function emitVoiceQueueChannelRemove(_0x3d9717){logger[_0x0a9e('0x5c')](_0x0a9e('0x5d'),JSON['stringify'](_0x3d9717));emit(util[_0x0a9e('0x5e')](_0x0a9e('0x5a'),_0x3d9717[_0x0a9e('0x27')]),'voice_queue_channel:remove',_0x3d9717);io[_0x0a9e('0x5f')](_0x0a9e('0x60'),_0x3d9717);}function notSendMessagesQueue(_0x289467){if(_0x289467['sendMessageOneNotActive']){if(_0x289467['originated']===0x0&&_0x289467[_0x0a9e('0x2b')]===0x0){_0x289467[_0x0a9e('0x61')]=![];_0x289467['available']=0x0;_0x289467[_0x0a9e('0x62')]=0x0;_0x289467[_0x0a9e('0x4e')]=_0x0a9e('0x63');ut[_0x0a9e('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x289467['name']+_0x0a9e('0x65'));}else{_0x289467[_0x0a9e('0x4e')]='IS_DISACTIVED';ut[_0x0a9e('0x64')](_0x0a9e('0x66'),_0x289467[_0x0a9e('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x289467);}}Preview[_0x0a9e('0xe')][_0x0a9e('0x26')]=function(){var _0x274e8e=this;setInterval(function(){_0x274e8e[_0x0a9e('0x67')]();},0x7cf);};Preview[_0x0a9e('0xe')][_0x0a9e('0x67')]=function(){var _0x2881b3=this[_0x0a9e('0x12')];this[_0x0a9e('0x17')]+=0x1;for(var _0x3da2cd in _0x2881b3){if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&(_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')||_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6a'))&&_0x2881b3[_0x3da2cd]['type']==='outbound'){if(this[_0x0a9e('0x17')]>0x7){this[_0x0a9e('0x17')]=0x0;this[_0x0a9e('0x6b')]();}}if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')&&_0x2881b3[_0x3da2cd][_0x0a9e('0x6c')]===_0x0a9e('0x6d')){if(_0x2881b3[_0x3da2cd][_0x0a9e('0x34')]){this[_0x0a9e('0x6e')](_0x2881b3[_0x3da2cd]);if(_0x2881b3[_0x3da2cd][_0x0a9e('0x6f')])this[_0x0a9e('0x70')](_0x2881b3[_0x3da2cd]);}else{notSendMessagesQueue(_0x2881b3[_0x3da2cd]);}}}};Preview['prototype'][_0x0a9e('0x71')]=function(_0x138b8b){var _0xdd268f=this;this[_0x0a9e('0x11')][_0x0a9e('0xf')](function(){if(!_[_0x0a9e('0x72')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b])){loggerAction[_0x0a9e('0x5c')]('[clearZombieChannels][talking]',_0x138b8b,_0x0a9e('0x73'),_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')],_0x0a9e('0x75'),JSON[_0x0a9e('0x59')](_0xdd268f['campaignsPreview'][_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]][_0x0a9e('0x4f')]),_0x0a9e('0x76'),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']][_0x0a9e('0x2b')]),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x77')]),JSON[_0x0a9e('0x59')](_[_0x0a9e('0x78')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b],[_0x0a9e('0x79'),_0x0a9e('0x7a'),'VoiceQueueId',_0x0a9e('0x7b')])));return ami[_0x0a9e('0x7c')]({'action':'status','channel':_0xdd268f['actions'][_0x138b8b]['channel']})[_0x0a9e('0x7d')](function(_0x4317e3){if(_0x4317e3[_0x0a9e('0x4e')]===_0x0a9e('0x7e')){setTimeout(function(){if(_0xdd268f[_0x0a9e('0x15')][_0x138b8b]){ut[_0x0a9e('0x7f')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']],'[clearZombieChannel]');if(_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x77')]===!![]){ut[_0x0a9e('0x80')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')]],_0x0a9e('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']);}ut[_0x0a9e('0x82')]('[Dialer][checkChannel][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]);delete _0xdd268f[_0x0a9e('0x15')][_0x138b8b];}},0x2328);}});}});};Preview['prototype'][_0x0a9e('0x6b')]=function(){var _0x1bf38a=this;loggerAction['info']('[action]',_[_0x0a9e('0x83')](this[_0x0a9e('0x15')]));for(var _0x49c095 in this[_0x0a9e('0x15')]){if(_0x1bf38a['actions'][_0x0a9e('0x68')](_0x49c095)){_0x1bf38a['clearZombieChannel'](_0x49c095);}}};Preview[_0x0a9e('0xe')]['recallMe']=function(_0x5da27d){var _0x5df0ad=this;rpcDb[_0x0a9e('0x84')](_0x5da27d['id'],ut['agentReadyId'](this[_0x0a9e('0x16')]))[_0x0a9e('0x85')](function(_0x3cfd00){if(!_[_0x0a9e('0x72')](_0x3cfd00)){for(var _0x232830=0x0;_0x232830<_0x3cfd00[_0x0a9e('0x86')];_0x232830+=0x1){if(ut[_0x0a9e('0x87')](_0x3cfd00[_0x232830][_0x0a9e('0x88')])<_0x5da27d['dialRecallMeTimeout']*0x3c){if(_0x3cfd00[_0x232830][_0x0a9e('0x89')]&&!_0x3cfd00[_0x232830][_0x0a9e('0x89')][_0x0a9e('0x8a')]){_0x5df0ad[_0x0a9e('0x8b')](_0x3cfd00[_0x232830]['id'])[_0x0a9e('0x85')](ut[_0x0a9e('0x8c')]('[RecallMe]'))[_0x0a9e('0x7d')](ut[_0x0a9e('0x8c')]('[RecallMe]'));}else{rpcDb[_0x0a9e('0x8d')](_0x3cfd00[_0x232830]['id']);}}else{var _0x5cc8fb=new Action(_0x3cfd00[_0x232830],_0x5da27d);_0x5cc8fb[_0x0a9e('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5da27d['outboundReCallsDay']+=0x1;ut[_0x0a9e('0x8f')](_0x5cc8fb,0x17,'RecallInQueue');if(_0x5da27d[_0x0a9e('0x90')]){rpcDb[_0x0a9e('0x91')](ut[_0x0a9e('0x92')](_0x3cfd00[_0x232830]));rpcDb[_0x0a9e('0x93')](_0x5cc8fb,_0x0a9e('0x94'));}else{ut[_0x0a9e('0x8f')](_0x5cc8fb,0x16,'RecallFailedTimeout');rpcDb[_0x0a9e('0x93')](_0x5cc8fb,'[HistoryRecallClose]');rpcDb[_0x0a9e('0x95')](_0x5cc8fb,_0x0a9e('0x96'));}}}}})[_0x0a9e('0x7d')](ut['logger2'](_0x0a9e('0x97')));};Preview[_0x0a9e('0xe')][_0x0a9e('0x6e')]=function(_0x32e134){_0x32e134['sendMessageOneNotActive']=!![];if(ut[_0x0a9e('0x98')](_0x32e134[_0x0a9e('0x2a')])){_0x32e134['message']=_0x0a9e('0x99');}else if(!ut[_0x0a9e('0x9a')](_0x32e134[_0x0a9e('0x34')])){_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x63');}else if(!this['isTrunkReachable'](_0x32e134[_0x0a9e('0x55')])){if(!this[_0x0a9e('0x9b')](_0x32e134[_0x0a9e('0x9c')])){_0x32e134['message']=_0x0a9e('0x9d');}else{_0x32e134['message']='ACTIVE';}}else{_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x9e');}emitCampaignPreview(_0x32e134);};Preview[_0x0a9e('0xe')][_0x0a9e('0x9f')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d=this;var _0x2d7205=this[_0x0a9e('0x15')][_0xc8c264];var _0x2e89b7=this[_0x0a9e('0x12')][_0x2d7205[_0x0a9e('0x74')]];var _0x2b8192;var _0x320898=![];var _0x412a72=0x2;var _0x2a28c0=0x3;if(_0x2e89b7){switch(_0x387489){case'1':_0x2e89b7[_0x0a9e('0x3f')]+=0x1;_0x2d7205['countnosuchnumberretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x0,'NoSuchNumber');ami[_0x0a9e('0x5f')](_0x0a9e('0xa2'),ut['buildObj'](_0x2d7205,_0x0a9e('0xa3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xa4'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'0',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a43a8){_0x320898=_0x4a43a8['additional']==0x1;_0x412a72=_0x2e89b7['dialNoSuchNumberRetryFrequency'];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xaa'));}else{if(_0x2d7205[_0x0a9e('0xab')]>=_0x2e89b7['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xaa'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xab'),_0x2e89b7['dialNoSuchNumberRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];}else{_0x2d7205[_0x0a9e('0xab')]++;logger[_0x0a9e('0x5c')](_0x0a9e('0xb0'),_0x2d7205['countnosuchnumberretry']);logger[_0x0a9e('0x5c')]('id',_0x2d7205[_0x0a9e('0xb1')]);_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnosuchnumberretry':_0x2d7205['countnosuchnumberretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xb4'):var _0x4abc8f=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));_0x2d7205[_0x0a9e('0xb6')]=_0x4abc8f;_0x2d7205[_0x0a9e('0xb7')]=_0x4abc8f;_0x2d7205[_0x0a9e('0x77')]=!![];_0x2e89b7[_0x0a9e('0x2b')]+=0x1;logger[_0x0a9e('0x5c')](_0x0a9e('0xb8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7[_0x0a9e('0x2b')]);ami[_0x0a9e('0x5f')]('custom:agentconnect',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xbc'),this[_0x0a9e('0x12')][_0x2d7205['queue']]));if(_0x2e89b7[_0x0a9e('0xbd')]){ami[_0x0a9e('0x5f')](_0x0a9e('0xbe'),ut[_0x0a9e('0xbf')](_0x2d7205));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc0'),this['campaignsPreview'][_0x2d7205[_0x0a9e('0x74')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d7205,_0x0a9e('0xc0')));_0x2e89b7[_0x0a9e('0x38')]+=0x1;_0x2e89b7['total']+=0x1;_0x2e89b7[_0x0a9e('0x29')]+=0x1;ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xc1'));_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x4,_0x0a9e('0xc2'));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xc3'));rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xc5')](_0x2d7205);_0x2e89b7['sumDuration']+=_0x2d7205[_0x0a9e('0xc6')];_0x2e89b7[_0x0a9e('0x2c')]+=_0x2d7205['talktime'];logger[_0x0a9e('0x5c')]('[syncHangup][talking][decrement]',_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7['pTalking']);delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;case _0x0a9e('0xc7'):_0x2e89b7[_0x0a9e('0x3a')]+=0x1;_0x2d7205['countbusyretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x5,'Busy');_0x412a72=_0x2e89b7[_0x0a9e('0xc8')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc9')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xca'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'5',_0x2e89b7)[_0x0a9e('0x85')](function(_0x5a8854){_0x320898=_0x5a8854[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut['totalGlobal'](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2d7205[_0x0a9e('0xcc')]>=_0x2e89b7[_0x0a9e('0xcd')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xcc'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xcc')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countbusyretry':_0x2d7205[_0x0a9e('0xcc')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xcf'):_0x2e89b7[_0x0a9e('0xd0')]+=0x1;_0x2d7205['countnoanswerretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x3,_0x0a9e('0xd1'));_0x412a72=_0x2e89b7[_0x0a9e('0xd2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')](_0x0a9e('0xd3'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xd4')));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xd5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'3',_0x2e89b7)[_0x0a9e('0x85')](function(_0x30ef6e){_0x320898=_0x30ef6e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xd6'));}else{if(_0x2d7205[_0x0a9e('0xd7')]>=_0x2e89b7[_0x0a9e('0xd8')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xd5'));}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xd7'),_0x2e89b7[_0x0a9e('0xd2')]),_0x2d7205['unlockAgent'],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205['countnoanswerretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xd9'):_0x2e89b7['outboundCongestionCallsDay']+=0x1;_0x2d7205[_0x0a9e('0xda')]+=0x1;_0x2d7205['countglobal']=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x8,'Congestion');_0x412a72=_0x2e89b7[_0x0a9e('0xdb')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')]('custom:agentcongestion',ut['buildObj'](_0x2d7205,_0x0a9e('0xdc')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xdd'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'8',_0x2e89b7)[_0x0a9e('0x85')](function(_0x2450a8){_0x320898=_0x2450a8[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut['cloneAction'](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb['createCustomerFinal'](_0x2b8192,_0x0a9e('0xde'));}else{if(_0x2d7205[_0x0a9e('0xda')]>=_0x2e89b7[_0x0a9e('0xdf')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xda'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205['countcongestionretry']++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countcongestionretry':_0x2d7205['countcongestionretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xe0'):_0x2e89b7[_0x0a9e('0x42')]+=0x1;_0x2d7205[_0x0a9e('0xe1')]+=0x1;_0x2d7205['countglobal']=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x14,'AgentReject');_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami[_0x0a9e('0x5f')]('custom:agentreject',ut['buildObj'](_0x2d7205,_0x0a9e('0xe3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,'[syncHangupRequest][logAgentReject]');_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x15c6b9){_0x320898=_0x15c6b9[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut['cloneAction'](_0x2d7205,0x14,_0x0a9e('0xe4'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xe5'));}else{if(_0x2d7205[_0x0a9e('0xe1')]>=_0x2e89b7[_0x0a9e('0xe6')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xe5'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe1'),_0x2e89b7[_0x0a9e('0xe2')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});break;case _0x0a9e('0xe7'):_0x2e89b7[_0x0a9e('0x43')]+=0x1;_0x2d7205[_0x0a9e('0xe8')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0xb,'Abandoned');rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xe9'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'11',_0x2e89b7)[_0x0a9e('0x85')](function(_0x34f7b5){_0x320898=_0x34f7b5['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d7205[_0x0a9e('0xea')]>=_0x2e89b7['dialAbandonedMaxRety']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xe9'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe8'),_0x2e89b7['dialAbandonedRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case'18':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xec')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x12,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit']('custom:amd',ut[_0x0a9e('0xbb')](_0x2d7205,'amd'));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xef'));_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0xe2b083){_0x320898=_0xe2b083[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0x12,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xef'));}else{rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xef'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];break;case'19':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x13,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit'](_0x0a9e('0xf0'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xf1')));rpcDb['createCustomerHistory'](_0x2d7205,'[callProgressDetectingCustomer][machine]');_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a70ce){_0x320898=_0x4a70ce['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf2'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf2'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;default:if(_0x2d7205[_0x0a9e('0x77')]){ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xf3'));ut[_0x0a9e('0x82')](_0x0a9e('0xf4')+_0x2e89b7['name'],_0x186f39);}_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0xc,_0x186f39['cause-txt']||_0x186f39[_0x0a9e('0xee')]);_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xf5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x25931e){_0x320898=_0x25931e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf6'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf6'));}delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];}else{_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(_0xd2391){});}});}if(!(_0x2d7205[_0x0a9e('0x77')]&&_0x387489==='16')){ut['updateOriginated'](_0x2e89b7,_0x0a9e('0xf7'));logger[_0x0a9e('0x5c')](_0x0a9e('0xf8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x2e89b7[_0x0a9e('0x4f')]);}if(_0x387489!==_0x0a9e('0xb4')){delete this[_0x0a9e('0x15')][_0x186f39['linkedid']];delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xf9')]];}}};Preview[_0x0a9e('0xe')][_0x0a9e('0xfa')]=function(_0x2b624e,_0x3942fd,_0x5cb48d){if(_[_0x0a9e('0xfb')](_0x3942fd)&&'object'!==typeof _0x3942fd){return;}if(_['isUndefined'](_0x5cb48d)&&'object'!==typeof _0x5cb48d){return;}switch(_0x5cb48d[_0x0a9e('0xfc')]){case'0':ut[_0x0a9e('0xfd')](_0x2b624e,0x0,_0x0a9e('0xfe'));rpcDb[_0x0a9e('0xff')](_0x2b624e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0a9e('0xfd')](_0x2b624e,0x3,_0x0a9e('0xd1'));rpcDb[_0x0a9e('0xff')](_0x2b624e,_0x0a9e('0x100'));break;case'5':ut[_0x0a9e('0xfd')](_0x2b624e,0x5,'Busy');rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x101'));break;case'8':ut[_0x0a9e('0xfd')](_0x2b624e,0x8,_0x0a9e('0x102'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));break;case'22':ut[_0x0a9e('0xfd')](_0x2b624e,0x16,_0x0a9e('0x104'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x105'));break;default:ut[_0x0a9e('0xfd')](_0x2b624e,0xc,_0x5cb48d[_0x0a9e('0xfc')]);rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));}ut[_0x0a9e('0x7f')](_0x3942fd,_0x0a9e('0x106'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x2b624e['uniqueid'],_0x0a9e('0xba'),_0x3942fd[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x3942fd[_0x0a9e('0x4f')]);delete this['actions'][_0x2b624e[_0x0a9e('0xb9')]];};Preview['prototype'][_0x0a9e('0xa5')]=function(_0x2ff2ab,_0x242f23,_0x57f673){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xa5')](_0x2ff2ab,_0x242f23,_0x57f673))['catch'](logger[_0x0a9e('0x5c')]('[verifyAdditionalPhone]\x20'));};Preview[_0x0a9e('0xe')]['swapAdditionalPhones']=function(_0x41b90a,_0x57b7d4,_0xb14971){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb3')](_0x41b90a,_0x57b7d4,_0xb14971))[_0x0a9e('0x7d')](logger[_0x0a9e('0x5c')](_0x0a9e('0x108')));};Preview['prototype'][_0x0a9e('0xb2')]=function(_0x1c9ea2){return BPromise['resolve']()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb2')](_0x1c9ea2))['catch'](logger[_0x0a9e('0x5c')](_0x0a9e('0x109')));};Preview[_0x0a9e('0xe')]['checkInBlack']=function(_0x3766d7,_0xf49ed4,_0xdeb5e4,_0x3f0d64,_0x2003bc){var _0x29fdfe=this;return new BPromise(function(_0x3ba897,_0x74d9b8){if(_[_0x0a9e('0x72')](_0xf49ed4)||_[_0x0a9e('0x72')](_0xf49ed4['Contact'])||_[_0x0a9e('0x72')](_0xf49ed4['phone'])||_[_0x0a9e('0x72')](_0xf49ed4[_0x0a9e('0x10a')])){_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x10b'),_0x3f0d64,_0x2003bc));return;}var _0x5d577b=uuid['v4']();var _0x2d45db=_0x29fdfe['campaignsPreview'][_0xf49ed4[_0x0a9e('0x73')][_0x0a9e('0x27')]];var _0x2977a7=_0xdeb5e4?_0x29fdfe['agents'][_0xdeb5e4]['id']:undefined;_0x29fdfe[_0x0a9e('0x15')][_0x5d577b]=new Action(_0xf49ed4,_0x2d45db,_0x5d577b,_0xdeb5e4,_0x2977a7);var _0x402544=_0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x402544[_0x0a9e('0xad')]=_0x3f0d64;_0x402544[_0x0a9e('0xae')]=_0x2003bc;_0x402544[_0x0a9e('0x10c')]=_0xdeb5e4;if(_[_0x0a9e('0x10d')](_0x3766d7)){_0x29fdfe['execCall'](_0x402544,_0x2d45db,_0xf49ed4,_0xdeb5e4)[_0x0a9e('0x85')](function(_0x228c10){logger[_0x0a9e('0x5c')](_0x0a9e('0x10e'),_0x0a9e('0x10f')+_0x402544[_0x0a9e('0x74')]+_0x0a9e('0x110')+_0x402544['idContact'],JSON['stringify'](_0x228c10));ami[_0x0a9e('0x5f')](_0x0a9e('0x111'),ut[_0x0a9e('0xbb')](_0x402544,_0x0a9e('0x112'),_0x29fdfe[_0x0a9e('0x12')][_0x402544[_0x0a9e('0x74')]]));_0x3ba897(ut[_0x0a9e('0x4e')]('Calling'));})[_0x0a9e('0x7d')](function(_0x1d7fc4){ut[_0x0a9e('0x64')](_0x0a9e('0x113'),_0x1d7fc4);_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x114'),_0x3f0d64,_0x2003bc));});}else{_0x2d45db[_0x0a9e('0x39')]+=0x1;ut['logBlacklist'](_0x402544);rpcDb[_0x0a9e('0x115')](_0x402544,_0x0a9e('0x116'));delete _0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x74d9b8(ut['message'](_0x0a9e('0x117'),_0x3f0d64,_0x2003bc));}});};Preview[_0x0a9e('0xe')][_0x0a9e('0x9b')]=function(_0x292f02){return!_['isNil'](_0x292f02)&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x27')])&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x56')])&&_0x292f02[_0x0a9e('0x56')]&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])])&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02['name'])][_0x0a9e('0x118')])&&(this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])][_0x0a9e('0x118')]==='reachable'||this[_0x0a9e('0x14')][util['format'](_0x0a9e('0x119'),_0x292f02['name'])]['status']==='unmonitored');};Preview[_0x0a9e('0xe')][_0x0a9e('0x8b')]=function(_0x19f800,_0x20007e){var _0x7d59a9=this;return new BPromise(function(_0xe17af8,_0x48fbef){_0x7d59a9[_0x0a9e('0x11a')](_0x19f800,_0x20007e)[_0x0a9e('0x85')](function(_0x1713a7){_0xe17af8(_[_0x0a9e('0x78')](_0x1713a7,[_0x0a9e('0x4e')]));})[_0x0a9e('0x7d')](function(_0x31c937){if(_0x31c937['unlock']){rpcDb['unlockContact'](_0x19f800);}if(_0x31c937[_0x0a9e('0x56')]){rpcDb['disableContact'](_0x19f800);}_0x48fbef(_[_0x0a9e('0x78')](_0x31c937,[_0x0a9e('0x4e')]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11a')]=function(_0x37a448,_0x383dd8){var _0x594f25=this;return new BPromise(function(_0x4716d1,_0x59b872){var _0x50e32a,_0x504403;rpcDb['getContactPreview'](_0x37a448)[_0x0a9e('0x85')](function(_0x5dc978){if(!_['isNil'](_0x5dc978[0x0])){_0x504403=_0x5dc978[0x0][_0x0a9e('0x11b')]?![]:!![];_0x50e32a=_0x5dc978[0x0]['recallme']?!![]:![];_0x50e32a=_0x383dd8?!![]:_0x50e32a;}var _0x24470a=_0x594f25[_0x0a9e('0x11c')](_0x5dc978);if(_0x24470a[_0x0a9e('0x11d')]){rpcDb['checkIsBlackList'](_[_0x0a9e('0x78')](_0x5dc978[0x0],[_0x0a9e('0x10a'),_0x0a9e('0x11e')]))['then'](function(_0x5236c9){_0x594f25[_0x0a9e('0x11f')](_0x5236c9,_0x5dc978[0x0],_0x383dd8,_0x504403,_0x50e32a)[_0x0a9e('0x85')](function(_0x89d2cb){_0x4716d1(_0x89d2cb);})[_0x0a9e('0x7d')](function(_0x3b0db2){_0x59b872(_0x3b0db2);});})[_0x0a9e('0x7d')](function(_0x247a6c){ut[_0x0a9e('0x64')](_0x0a9e('0x120'),_0x247a6c);_0x59b872(ut[_0x0a9e('0x4e')]('Call\x20unsuccessful',_0x504403,_0x50e32a));});}else{_0x59b872(ut['message'](_0x24470a['message'],_0x504403,_0x50e32a));}})[_0x0a9e('0x7d')](function(_0x19dcc2){ut[_0x0a9e('0x64')](_0x0a9e('0x121'),_0x19dcc2);_0x59b872(ut[_0x0a9e('0x4e')](_0x0a9e('0x122'),![],!![]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11c')]=function(_0x5d74e9){if(_['isNil'](_0x5d74e9)||_[_0x0a9e('0x10d')](_0x5d74e9)||!_[_0x0a9e('0x72')](_0x5d74e9[0x0]['Agent'])&&_[_0x0a9e('0x72')](_0x5d74e9[0x0][_0x0a9e('0x89')][_0x0a9e('0x27')])){ut[_0x0a9e('0x64')](_0x0a9e('0x123'),_0x5d74e9);return{'isValid':![],'message':_0x0a9e('0x124')};}var _0x167196=this[_0x0a9e('0x12')][_0x5d74e9[0x0][_0x0a9e('0x73')][_0x0a9e('0x27')]];_0x167196[_0x0a9e('0x4e')]=_0x0a9e('0x9e');if(_['isNil'](_0x167196)){ut[_0x0a9e('0x64')](_0x0a9e('0x125'),_0x167196);return{'isValid':![],'message':_0x0a9e('0x126')};}if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x55')])){ut[_0x0a9e('0x64')](_0x0a9e('0x127'),_0x0a9e('0x128')+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x129'));if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x9c')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12a'));return{'isValid':![],'message':_0x0a9e('0x12b')};}}if(!ut[_0x0a9e('0x9a')](_0x167196[_0x0a9e('0x34')])){ut[_0x0a9e('0x64')](_0x0a9e('0x12c'),_0x167196['name']+_0x0a9e('0x12d'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12d')};}return{'isValid':!![],'message':_0x0a9e('0x12e')};};Preview[_0x0a9e('0xe')][_0x0a9e('0x12f')]=function(_0x358f74,_0x465003,_0x261eca,_0xa7a754){var _0x32a199=this;return new BPromise(function(_0x39d367,_0x8231e5){var _0x43111e=_0x358f74[_0x0a9e('0xb9')];var _0x3c8a9a=_0x32a199[_0x0a9e('0x9b')](_0x465003['Trunk'])?util['format'](_0x0a9e('0x130'),_0x465003[_0x0a9e('0x55')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003['dialCutDigit']>0x0?_0x261eca[_0x0a9e('0x11e')]['substring'](_0x465003[_0x0a9e('0x133')]):_0x261eca['phone']):util[_0x0a9e('0x5e')]('SIP/%s/%s%s',_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['name']:_0x465003[_0x0a9e('0x9c')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003[_0x0a9e('0x133')]>0x0?_0x261eca[_0x0a9e('0x11e')][_0x0a9e('0x134')](_0x465003[_0x0a9e('0x133')]):_0x261eca[_0x0a9e('0x11e')]);var _0x1a3143=_0x32a199[_0x0a9e('0x9b')](_0x465003[_0x0a9e('0x55')])?ut[_0x0a9e('0x135')](_0x465003[_0x0a9e('0x55')][_0x0a9e('0x57')],_0x465003[_0x0a9e('0x35')],_0x465003[_0x0a9e('0x136')]>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003['dialOriginateCallerIdNumber']):ut[_0x0a9e('0x135')](_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['callerid']:_0x465003['TrunkBackup']['callerid'],_0x465003[_0x0a9e('0x35')],_0x465003['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003[_0x0a9e('0x138')]);if(_0x1a3143){_0x358f74[_0x0a9e('0x139')]=ut[_0x0a9e('0x13a')](_0x1a3143);_0x358f74[_0x0a9e('0x13b')]=ut[_0x0a9e('0x13c')](_0x1a3143);}var _0x2154d8=ut[_0x0a9e('0x13d')](_0x465003,_0x261eca,_0x3c8a9a,_0x1a3143,_0x43111e,_0x358f74);_['merge'](_0x358f74,ut[_0x0a9e('0x13e')](_0x2154d8));_0x358f74['starttime']=moment()[_0x0a9e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x0a9e('0x7c')](ut[_0x0a9e('0x13f')](_0x358f74,_0x465003,_0x2154d8,_0x358f74[_0x0a9e('0xae')],_0xa7a754))['then'](function(_0x920ad8){_0x465003[_0x0a9e('0x4f')]+=0x1;logger['info']('[originated][increment]',_0x43111e,_0x0a9e('0xba'),_0x465003[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x465003['originated']);_0x39d367(_0x920ad8);})['catch'](function(_0x4869c1){ut[_0x0a9e('0xfd')](_0x358f74,0xe,_0x0a9e('0x140'));rpcDb[_0x0a9e('0xff')](_0x358f74,_0x0a9e('0x141'));_0x8231e5(_0x4869c1);});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x142')]=function(_0x183b9b){if(this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]]){this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]][_0x0a9e('0x143')]=_0x183b9b[_0x0a9e('0x143')];}};Preview[_0x0a9e('0xe')][_0x0a9e('0x19')]=function(_0x1a74c4){var _0x94e69b=this;var _0x320367=this['actions'][_0x1a74c4[_0x0a9e('0x144')]];if(_0x320367){if(_0x320367[_0x0a9e('0x10c')]&&this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]){ut[_0x0a9e('0x145')](_0x320367,this[_0x0a9e('0x16')][_0x320367['lookAgent']][_0x0a9e('0x27')],this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]['id']);}var _0x1109de=_[_0x0a9e('0x146')](_0x320367);_0x1109de[_0x0a9e('0xb6')]=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));var _0x4175a6=_0x94e69b['campaignsPreview'][_0x320367['queue']];if(ut[_0x0a9e('0x147')](_0x1a74c4[_0x0a9e('0x148')])){if(_0x320367['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x320367[_0x0a9e('0xb1')]);}if(_0x320367['activeContact']){rpcDb[_0x0a9e('0x8d')](_0x320367['idContact']);}ami[_0x0a9e('0x5f')](_0x0a9e('0x14a'),ut['buildObj'](_0x320367,_0x0a9e('0x14b'),this[_0x0a9e('0x12')][_0x320367['queue']]));this[_0x0a9e('0xfa')](_0x1109de,_0x4175a6,_0x1a74c4);}else{_0x320367[_0x0a9e('0x8e')]=moment()['format'](_0x0a9e('0xb5'));ut[_0x0a9e('0xfd')](_0x1109de,0x4,_0x0a9e('0xc2'));rpcDb[_0x0a9e('0xff')](_0x1109de,_0x0a9e('0x14c'));}}};Preview[_0x0a9e('0xe')]['syncHangup']=function(_0x1e5b09){var _0x36dc4f=this;var _0x51e697=this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]];var _0x22c390;if(_0x51e697){_0x22c390=this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x74')]];logger[_0x0a9e('0x5c')](_0x0a9e('0x14d'),_0x1e5b09['linkedid'],'\x20Queue',_0x22c390['name'],'pTalking:\x20',_0x22c390['pTalking']);}if(this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]]&&_0x1e5b09['linkedid']!==_0x1e5b09['uniqueid']){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this[_0x0a9e('0x15')][_0x1e5b09['linkedid']][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')]('[syncHangup][talking][cause]',_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390[_0x0a9e('0x2b')]);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09['linkedid'],_0x1e5b09[_0x0a9e('0x14e')]);}}else if(_0x51e697&&_['isNil'](_0x51e697[_0x0a9e('0x14f')])&&_0x22c390[_0x0a9e('0x150')]&&_0x1e5b09['linkedid']===_0x1e5b09[_0x0a9e('0xb9')]&&_[_0x0a9e('0x72')](_0x1e5b09['reason'])&&_0x1e5b09[_0x0a9e('0x14e')]==='16'&&_0x1e5b09['channelstate']==='6'&&_[_0x0a9e('0xfb')](_0x51e697[_0x0a9e('0x151')])){if(_0x51e697['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x51e697['idContact']);}if(_0x51e697[_0x0a9e('0xae')]){rpcDb[_0x0a9e('0x8d')](_0x51e697[_0x0a9e('0xb1')]);}_0x1e5b09[_0x0a9e('0xfc')]='22';this[_0x0a9e('0xfa')](_0x51e697,_0x22c390,_0x1e5b09);}else if(_0x51e697&&_0x51e697[_0x0a9e('0x151')]){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x152'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09['cause'],_0x0a9e('0xba'),_0x22c390['name'],'pTalking:\x20',_0x22c390[_0x0a9e('0x2b')]);this['callProgressDetectingCustomer'](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x153'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390['pTalking']);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')]['syncDialEnd']=function(_0x38d95a){if(this[_0x0a9e('0x15')][_0x38d95a[_0x0a9e('0xf9')]]&&_0x38d95a['destlinkedid']!==_0x38d95a[_0x0a9e('0x154')]){this[_0x0a9e('0x9f')](_0x38d95a,_0x38d95a[_0x0a9e('0xf9')],_0x38d95a['dialstatus']);}};Preview[_0x0a9e('0xe')]['syncHangupRequest']=function(_0x2394f2){if(this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]&&_0x2394f2[_0x0a9e('0xaf')]!==_0x2394f2[_0x0a9e('0xb9')]&&!this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]['dialAnswer']){if(_0x2394f2[_0x0a9e('0x14e')]==='1'){this[_0x0a9e('0x9f')](_0x2394f2,_0x2394f2[_0x0a9e('0xaf')],_0x2394f2[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')][_0x0a9e('0x155')]=function(_0x3a4def,_0x2670f5,_0x2310ca){if(this[_0x0a9e('0x15')][_0x3a4def]){if(_[_0x0a9e('0x72')](this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')])){this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')]={};}this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')][_0x2670f5]=_0x2310ca;}};Preview[_0x0a9e('0xe')][_0x0a9e('0x21')]=function(_0x611e46){try{if(!_[_0x0a9e('0x72')](_0x611e46)){if(ut[_0x0a9e('0x157')](_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0])){this[_0x0a9e('0x155')](_0x611e46[_0x0a9e('0xb9')],_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0],_0x611e46[_0x0a9e('0x159')]);}}}catch(_0x4c925e){logger[_0x0a9e('0x15a')](_0x0a9e('0x15b'),util[_0x0a9e('0x15c')](_0x4c925e,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xe')][_0x0a9e('0x23')]=function(_0xb09ef6){if(_0xb09ef6){if(this[_0x0a9e('0x15')][_0xb09ef6[_0x0a9e('0x15d')]]){this['actions'][_0xb09ef6[_0x0a9e('0x15d')]][_0x0a9e('0x151')]=!![];}}};Preview['prototype'][_0x0a9e('0x25')]=function(_0x2db8fe){if(_0x2db8fe){if(this[_0x0a9e('0x15')][_0x2db8fe['transfererlinkedid']]){this[_0x0a9e('0x15')][_0x2db8fe[_0x0a9e('0x15e')]][_0x0a9e('0x151')]=!![];}}};module[_0x0a9e('0x15f')]=Preview;
\ No newline at end of file
+var _0xc978=['No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','clearZombieChannel','getContactRecallMe','agentReadyId','then','getDiff','Agent','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','dialActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','buildAcw','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','scheduledAt','unlockAgent','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','run','execRun','unlock','disableContact','getContactPreview','recallme','validateContact','checkInBlack','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','phone','trim','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','clone','isFailure','response','unlockContact','custom:agentringnoanswer','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','variables','filterKey','keys','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','originateresponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','dialMethod','booked','clockClearZombieChannels','clearZombieChannels','setMessage','recallMe','isNil','actions','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','channel','catch'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x8c97('0x0'));var _=require(_0x8c97('0x1'));var BPromise=require(_0x8c97('0x2'));var uuid=require(_0x8c97('0x3'));var moment=require(_0x8c97('0x4'));var md5=require(_0x8c97('0x5'));var Redis=require('ioredis');var config=require(_0x8c97('0x6'));var logger=require(_0x8c97('0x7'))(_0x8c97('0x8'));var loggerAction=require(_0x8c97('0x7'))(_0x8c97('0x9'));var ami=require(_0x8c97('0xa'));var rpcDb=require(_0x8c97('0xb'));var Action=require('./action');var ut=require(_0x8c97('0xc'));config[_0x8c97('0xd')]=_[_0x8c97('0xe')](config[_0x8c97('0xd')],{'host':_0x8c97('0xf'),'port':0x18eb});var io=require(_0x8c97('0x10'))(new Redis(config[_0x8c97('0xd')]));var Sequence=function(){};Sequence['prototype'][_0x8c97('0x11')]=function(_0x1234d4){this[_0x8c97('0x12')]=this[_0x8c97('0x12')]?this[_0x8c97('0x12')][_0x8c97('0x13')](_0x1234d4):_0x1234d4();};function Preview(_0x1e8182){this[_0x8c97('0x14')]=new Sequence();this[_0x8c97('0x15')]=_0x1e8182['voiceQueues'];this[_0x8c97('0x16')]=_0x1e8182[_0x8c97('0x16')];this['actions']={};this[_0x8c97('0x17')]=_0x1e8182[_0x8c97('0x17')];this['clockClearZombieChannels']=0x0;ami['on'](_0x8c97('0x18'),this['syncOriginateResponse']['bind'](this));ami['on']('hangup',this[_0x8c97('0x19')][_0x8c97('0x1a')](this));ami['on'](_0x8c97('0x1b'),this[_0x8c97('0x1c')][_0x8c97('0x1a')](this));ami['on'](_0x8c97('0x1d'),this[_0x8c97('0x1e')][_0x8c97('0x1a')](this));ami['on'](_0x8c97('0x1f'),this['syncNewExten'][_0x8c97('0x1a')](this));ami['on'](_0x8c97('0x20'),this[_0x8c97('0x21')][_0x8c97('0x1a')](this));ami['on'](_0x8c97('0x22'),this[_0x8c97('0x23')][_0x8c97('0x1a')](this));ami['on'](_0x8c97('0x24'),this[_0x8c97('0x25')][_0x8c97('0x1a')](this));this[_0x8c97('0x26')](this[_0x8c97('0x15')]);}function emit(_0x292ab2,_0x16e3c4,_0x3ea5a3){io['to'](_0x292ab2)[_0x8c97('0x27')](_0x16e3c4,_0x3ea5a3);}function emitCampaignPreview(_0x57a266){if(_0x57a266[_0x8c97('0x28')]===_0x8c97('0x29')){var _0x3957d0={'id':_0x57a266['id'],'name':_0x57a266['name'],'strategy':_0x57a266['strategy'],'answered':_0x57a266[_0x8c97('0x2a')],'available':_0x57a266['available'],'loggedIn':_0x57a266[_0x8c97('0x2b')],'pTalking':_0x57a266[_0x8c97('0x2c')],'sumBillable':_0x57a266[_0x8c97('0x2d')],'sumDuration':_0x57a266[_0x8c97('0x2e')],'sumHoldTime':_0x57a266[_0x8c97('0x2f')]||0x0,'talking':_0x57a266[_0x8c97('0x30')],'total':_0x57a266[_0x8c97('0x31')],'type':_0x57a266['type'],'unmanaged':_0x57a266['unmanaged'],'abandoned':_0x57a266[_0x8c97('0x32')],'waiting':_0x57a266[_0x8c97('0x33')],'loggedInDb':_0x57a266[_0x8c97('0x34')],'dialActive':_0x57a266['dialActive'],'dialMethod':_0x57a266['dialMethod'],'dialOriginateCallerIdName':_0x57a266[_0x8c97('0x35')],'dialOriginateCallerIdNumber':_0x57a266[_0x8c97('0x36')],'dialOriginateTimeout':_0x57a266[_0x8c97('0x37')],'dialPrefix':_0x57a266[_0x8c97('0x38')],'outboundAnswerAgiCallsDay':_0x57a266[_0x8c97('0x39')],'outboundAnswerCallsDay':_0x57a266[_0x8c97('0x3a')],'outboundBlacklistCallsDay':_0x57a266['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x57a266[_0x8c97('0x3b')],'outboundCongestionCallsDay':_0x57a266['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x57a266[_0x8c97('0x3c')],'outboundDropCallsDayCallersExit':_0x57a266['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x57a266[_0x8c97('0x3d')],'outboundNoAnswerCallsDay':_0x57a266[_0x8c97('0x3e')],'outboundNoSuchCallsDay':_0x57a266['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x57a266[_0x8c97('0x3f')],'outboundReCallsDay':_0x57a266['outboundReCallsDay'],'outboundRejectCallsDay':_0x57a266[_0x8c97('0x40')],'outboundUnknownCallsDay':_0x57a266[_0x8c97('0x41')],'outboundAbandonedCallsDay':_0x57a266[_0x8c97('0x42')],'predictiveIntervalAnsweredCalls':_0x57a266[_0x8c97('0x43')],'predictiveIntervalAvgHoldtime':_0x57a266[_0x8c97('0x44')],'predictiveIntervalAvgTalktime':_0x57a266[_0x8c97('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x57a266['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x57a266['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x57a266[_0x8c97('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x57a266[_0x8c97('0x47')],'predictiveIntervalHitRate':_0x57a266[_0x8c97('0x48')],'predictiveIntervalMultiplicativeFactor':_0x57a266['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x57a266[_0x8c97('0x49')],'predictiveIntervalAvailable':_0x57a266['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x57a266['predictiveIntervalTotalCalls'],'message':_0x57a266[_0x8c97('0x4a')],'originated':_0x57a266[_0x8c97('0x4b')],'erlangCalls':_0x57a266[_0x8c97('0x4c')],'erlangCallToSecond':_0x57a266[_0x8c97('0x4d')],'erlangAbandonmentRate':_0x57a266[_0x8c97('0x4e')],'erlangBusyFactor':_0x57a266[_0x8c97('0x4f')],'startPredictive':_0x57a266['startPredictive'],'startProgressive':_0x57a266[_0x8c97('0x50')]};if(_0x57a266[_0x8c97('0x51')]){_0x3957d0[_0x8c97('0x51')]={'id':_0x57a266[_0x8c97('0x51')]['id'],'name':_0x57a266[_0x8c97('0x51')][_0x8c97('0x52')],'active':_0x57a266[_0x8c97('0x51')][_0x8c97('0x53')],'callerid':_0x57a266['Trunk'][_0x8c97('0x54')]};}if(_0x57a266[_0x8c97('0x55')]){_0x3957d0[_0x8c97('0x55')]={'id':_0x57a266[_0x8c97('0x55')]['id'],'name':_0x57a266[_0x8c97('0x55')][_0x8c97('0x52')]};}var _0x5946d7=md5(JSON[_0x8c97('0x56')](_0x3957d0));if(_0x57a266[_0x8c97('0x5')]!==_0x5946d7){_0x57a266[_0x8c97('0x5')]=_0x5946d7;emit(util[_0x8c97('0x57')](_0x8c97('0x58'),_0x3957d0[_0x8c97('0x52')]),_0x8c97('0x59'),_0x3957d0);}}}function emitVoiceQueueChannelRemove(_0x4639e2){logger[_0x8c97('0x5a')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x8c97('0x56')](_0x4639e2));emit(util[_0x8c97('0x57')](_0x8c97('0x58'),_0x4639e2[_0x8c97('0x52')]),_0x8c97('0x5b'),_0x4639e2);io[_0x8c97('0x27')]('voice_queue_presence:remove',_0x4639e2);}function notSendMessagesQueue(_0x20b9c3){if(_0x20b9c3[_0x8c97('0x5c')]){if(_0x20b9c3[_0x8c97('0x4b')]===0x0&&_0x20b9c3[_0x8c97('0x2c')]===0x0){_0x20b9c3[_0x8c97('0x5c')]=![];_0x20b9c3[_0x8c97('0x5d')]=0x0;_0x20b9c3[_0x8c97('0x5e')]=0x0;_0x20b9c3[_0x8c97('0x4a')]=_0x8c97('0x5f');ut[_0x8c97('0x60')](_0x8c97('0x61'),_0x20b9c3[_0x8c97('0x52')]+_0x8c97('0x62'));}else{_0x20b9c3[_0x8c97('0x4a')]=_0x8c97('0x63');ut[_0x8c97('0x60')](_0x8c97('0x61'),_0x20b9c3[_0x8c97('0x52')]+_0x8c97('0x64'));}emitCampaignPreview(_0x20b9c3);}}Preview[_0x8c97('0x65')]['loopCampaigns']=function(){var _0x111e5b=this;setInterval(function(){_0x111e5b[_0x8c97('0x66')]();},0x7cf);};Preview[_0x8c97('0x65')][_0x8c97('0x66')]=function(){var _0x35a230=this[_0x8c97('0x15')];this['clockClearZombieChannels']+=0x1;for(var _0x7c7c55 in _0x35a230){if(_0x35a230[_0x8c97('0x67')](_0x7c7c55)&&(_0x35a230[_0x7c7c55][_0x8c97('0x68')]===_0x8c97('0x8')||_0x35a230[_0x7c7c55][_0x8c97('0x68')]===_0x8c97('0x69'))&&_0x35a230[_0x7c7c55][_0x8c97('0x28')]===_0x8c97('0x29')){if(this[_0x8c97('0x6a')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x8c97('0x6b')]();}}if(_0x35a230[_0x8c97('0x67')](_0x7c7c55)&&_0x35a230[_0x7c7c55][_0x8c97('0x68')]===_0x8c97('0x8')&&_0x35a230[_0x7c7c55][_0x8c97('0x28')]==='outbound'){if(_0x35a230[_0x7c7c55]['dialActive']){this[_0x8c97('0x6c')](_0x35a230[_0x7c7c55]);if(_0x35a230[_0x7c7c55]['dialPreviewAutoRecallMe'])this[_0x8c97('0x6d')](_0x35a230[_0x7c7c55]);}else{notSendMessagesQueue(_0x35a230[_0x7c7c55]);}}}};Preview[_0x8c97('0x65')]['clearZombieChannel']=function(_0x43888a){var _0x2d287b=this;this['sequence']['enqueue'](function(){if(!_[_0x8c97('0x6e')](_0x2d287b[_0x8c97('0x6f')][_0x43888a])){loggerAction['info']('[clearZombieChannels][talking]',_0x43888a,'Queue',_0x2d287b[_0x8c97('0x6f')][_0x43888a]['queue'],'originated:\x20',JSON[_0x8c97('0x56')](_0x2d287b[_0x8c97('0x15')][_0x2d287b[_0x8c97('0x6f')][_0x43888a][_0x8c97('0x70')]][_0x8c97('0x4b')]),_0x8c97('0x71'),JSON['stringify'](_0x2d287b[_0x8c97('0x15')][_0x2d287b[_0x8c97('0x6f')][_0x43888a][_0x8c97('0x70')]][_0x8c97('0x2c')]),JSON[_0x8c97('0x56')](_0x2d287b[_0x8c97('0x6f')][_0x43888a][_0x8c97('0x72')]),JSON[_0x8c97('0x56')](_[_0x8c97('0x73')](_0x2d287b[_0x8c97('0x6f')][_0x43888a],[_0x8c97('0x74'),_0x8c97('0x75'),_0x8c97('0x76'),'ListId'])));return ami[_0x8c97('0x77')]({'action':_0x8c97('0x78'),'channel':_0x2d287b[_0x8c97('0x6f')][_0x43888a][_0x8c97('0x79')]})[_0x8c97('0x7a')](function(_0xa489fc){if(_0xa489fc[_0x8c97('0x4a')]===_0x8c97('0x7b')){setTimeout(function(){if(_0x2d287b[_0x8c97('0x6f')][_0x43888a]){ut[_0x8c97('0x7c')](_0x2d287b[_0x8c97('0x15')][_0x2d287b[_0x8c97('0x6f')][_0x43888a]['queue']],_0x8c97('0x7d'));if(_0x2d287b[_0x8c97('0x6f')][_0x43888a][_0x8c97('0x72')]===!![]){ut['decrementTalkink'](_0x2d287b['campaignsPreview'][_0x2d287b[_0x8c97('0x6f')][_0x43888a]['queue']],_0x8c97('0x7d'));ut[_0x8c97('0x7e')](_0x8c97('0x7f')+_0x43888a,_0x2d287b[_0x8c97('0x6f')][_0x43888a][_0x8c97('0x70')]);}ut[_0x8c97('0x7e')](_0x8c97('0x80')+_0x43888a,_0x2d287b[_0x8c97('0x6f')][_0x43888a]['queue']);delete _0x2d287b[_0x8c97('0x6f')][_0x43888a];}},0x2328);}});}});};Preview[_0x8c97('0x65')][_0x8c97('0x6b')]=function(){var _0x3326f0=this;loggerAction['info'](_0x8c97('0x81'),_['size'](this['actions']));for(var _0x4eaddc in this[_0x8c97('0x6f')]){if(_0x3326f0['actions'][_0x8c97('0x67')](_0x4eaddc)){_0x3326f0[_0x8c97('0x82')](_0x4eaddc);}}};Preview[_0x8c97('0x65')][_0x8c97('0x6d')]=function(_0x30ff13){var _0x676770=this;rpcDb[_0x8c97('0x83')](_0x30ff13['id'],ut[_0x8c97('0x84')](this[_0x8c97('0x17')]))[_0x8c97('0x85')](function(_0x4ad6bd){if(!_['isNil'](_0x4ad6bd)){for(var _0x3e5186=0x0;_0x3e5186<_0x4ad6bd['length'];_0x3e5186+=0x1){if(ut[_0x8c97('0x86')](_0x4ad6bd[_0x3e5186]['scheduledat'])<_0x30ff13['dialRecallMeTimeout']*0x3c){if(_0x4ad6bd[_0x3e5186][_0x8c97('0x87')]&&!_0x4ad6bd[_0x3e5186][_0x8c97('0x87')]['voicePause']){_0x676770['run'](_0x4ad6bd[_0x3e5186]['id'])[_0x8c97('0x85')](ut[_0x8c97('0x88')](_0x8c97('0x89')))[_0x8c97('0x7a')](ut['logger2'](_0x8c97('0x89')));}else{rpcDb['disableContact'](_0x4ad6bd[_0x3e5186]['id']);}}else{var _0x4e1dbf=new Action(_0x4ad6bd[_0x3e5186],_0x30ff13);_0x4e1dbf[_0x8c97('0x8a')]=moment()['format'](_0x8c97('0x8b'));_0x30ff13[_0x8c97('0x8c')]+=0x1;ut[_0x8c97('0x8d')](_0x4e1dbf,0x17,_0x8c97('0x8e'));if(_0x30ff13[_0x8c97('0x8f')]){rpcDb['rescheduleContactInQueue'](ut[_0x8c97('0x90')](_0x4ad6bd[_0x3e5186]));rpcDb[_0x8c97('0x91')](_0x4e1dbf,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x8c97('0x8d')](_0x4e1dbf,0x16,_0x8c97('0x92'));rpcDb['createCustomerHistory'](_0x4e1dbf,_0x8c97('0x93'));rpcDb[_0x8c97('0x94')](_0x4e1dbf,_0x8c97('0x93'));}}}}})[_0x8c97('0x7a')](ut[_0x8c97('0x88')]('[getContactRecallMe]'));};Preview[_0x8c97('0x65')]['setMessage']=function(_0x14e426){_0x14e426['sendMessageOneNotActive']=!![];if(ut[_0x8c97('0x95')](_0x14e426[_0x8c97('0x2b')])){_0x14e426[_0x8c97('0x4a')]=_0x8c97('0x96');}else if(!ut[_0x8c97('0x97')](_0x14e426[_0x8c97('0x98')])){_0x14e426[_0x8c97('0x4a')]=_0x8c97('0x5f');}else if(!this[_0x8c97('0x99')](_0x14e426['Trunk'])){if(!this[_0x8c97('0x99')](_0x14e426[_0x8c97('0x9a')])){_0x14e426[_0x8c97('0x4a')]=_0x8c97('0x9b');}else{_0x14e426[_0x8c97('0x4a')]=_0x8c97('0x9c');}}else{_0x14e426[_0x8c97('0x4a')]='ACTIVE';}emitCampaignPreview(_0x14e426);};Preview['prototype'][_0x8c97('0x9d')]=function(_0x35e2a5,_0x2346c4,_0x581f2e){var _0x5e050d=this;var _0x43e81a=this['actions'][_0x2346c4];var _0x31a4f3=this[_0x8c97('0x15')][_0x43e81a[_0x8c97('0x70')]];var _0x27fef3;if(_0x31a4f3){switch(_0x581f2e){case'1':_0x31a4f3[_0x8c97('0x9e')]+=0x1;_0x43e81a[_0x8c97('0x9f')]+=0x1;_0x43e81a[_0x8c97('0xa0')]=ut[_0x8c97('0xa1')](_0x43e81a);ut[_0x8c97('0x8d')](_0x43e81a,0x0,'NoSuchNumber');ami[_0x8c97('0x27')](_0x8c97('0xa2'),ut[_0x8c97('0xa3')](_0x43e81a,_0x8c97('0xa4')));rpcDb[_0x8c97('0x91')](_0x43e81a,_0x8c97('0xa5'));if(ut['totalGlobal'](_0x43e81a)>=_0x31a4f3[_0x8c97('0xa6')]){_0x27fef3=ut['cloneAction'](_0x43e81a,0xf,_0x8c97('0xa7'));rpcDb['createCustomerFinal'](_0x27fef3,_0x8c97('0xa8'));}else{if(_0x43e81a[_0x8c97('0x9f')]>=_0x31a4f3[_0x8c97('0xa9')]){rpcDb[_0x8c97('0x94')](_0x43e81a,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x8c97('0xaa')](ut['scheduledAt'](_0x43e81a,'countnosuchnumberretry',_0x31a4f3['dialNoSuchNumberRetryFrequency']),_0x43e81a['unlockAgent'],_0x43e81a[_0x8c97('0xab')]);}}delete this[_0x8c97('0x6f')][_0x35e2a5[_0x8c97('0xac')]];break;case _0x8c97('0xad'):var _0x1804ce=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x43e81a[_0x8c97('0xae')]=_0x1804ce;_0x43e81a[_0x8c97('0xaf')]=_0x1804ce;_0x43e81a[_0x8c97('0x72')]=!![];_0x31a4f3[_0x8c97('0x2c')]+=0x1;logger[_0x8c97('0x5a')](_0x8c97('0xb0'),_0x43e81a[_0x8c97('0xb1')],_0x8c97('0xb2'),_0x31a4f3['name'],'pTalking:\x20',_0x31a4f3['pTalking']);ami[_0x8c97('0x27')](_0x8c97('0xb3'),ut[_0x8c97('0xa3')](_0x43e81a,_0x8c97('0xb4'),this['campaignsPreview'][_0x43e81a[_0x8c97('0x70')]]));if(_0x31a4f3['acw']){ami[_0x8c97('0x27')]('custom:agentConnectPreview',ut[_0x8c97('0xb5')](_0x43e81a));}break;case'16':ami[_0x8c97('0x27')]('custom:agentcomplete',ut[_0x8c97('0xa3')](_0x43e81a,_0x8c97('0xb6'),this[_0x8c97('0x15')][_0x43e81a[_0x8c97('0x70')]]));emitVoiceQueueChannelRemove(ut[_0x8c97('0xa3')](_0x43e81a,_0x8c97('0xb6')));_0x31a4f3[_0x8c97('0x3a')]+=0x1;_0x31a4f3['total']+=0x1;_0x31a4f3[_0x8c97('0x2a')]+=0x1;ut[_0x8c97('0xb7')](_0x31a4f3,_0x8c97('0xb8'));_0x43e81a['countglobal']=ut[_0x8c97('0xa1')](_0x43e81a);ut[_0x8c97('0x8d')](_0x43e81a,0x4,_0x8c97('0xb9'));rpcDb[_0x8c97('0x91')](_0x43e81a,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x8c97('0x94')](_0x43e81a,_0x8c97('0xba'));rpcDb[_0x8c97('0xbb')](_0x43e81a);_0x31a4f3['sumDuration']+=_0x43e81a['talktime'];_0x31a4f3[_0x8c97('0x2d')]+=_0x43e81a[_0x8c97('0xbc')];logger[_0x8c97('0x5a')](_0x8c97('0xbd'),_0x43e81a[_0x8c97('0xb1')],_0x8c97('0xb2'),_0x31a4f3[_0x8c97('0x52')],_0x8c97('0x71'),_0x31a4f3['pTalking']);delete this['actions'][_0x35e2a5[_0x8c97('0xac')]];break;case _0x8c97('0xbe'):_0x31a4f3['outboundBusyCallsDay']+=0x1;_0x43e81a[_0x8c97('0xbf')]+=0x1;_0x43e81a[_0x8c97('0xa0')]=ut[_0x8c97('0xa1')](_0x43e81a);ut['logCustomer'](_0x43e81a,0x5,'Busy');ami[_0x8c97('0x27')](_0x8c97('0xc0'),ut['buildObj'](_0x43e81a,_0x8c97('0xc1')));rpcDb[_0x8c97('0x91')](_0x43e81a,_0x8c97('0xc2'));if(ut[_0x8c97('0xa1')](_0x43e81a)>=_0x31a4f3[_0x8c97('0xa6')]){_0x27fef3=ut[_0x8c97('0xc3')](_0x43e81a,0xf,'Global');rpcDb[_0x8c97('0x94')](_0x27fef3,_0x8c97('0xc4'));}else{if(_0x43e81a[_0x8c97('0xbf')]>=_0x31a4f3['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x43e81a,_0x8c97('0xc2'));}else{rpcDb[_0x8c97('0xaa')](ut[_0x8c97('0xc5')](_0x43e81a,'countbusyretry',_0x31a4f3['dialBusyRetryFrequency']),_0x43e81a[_0x8c97('0xc6')],_0x43e81a[_0x8c97('0xab')]);}}break;case _0x8c97('0xc7'):_0x31a4f3['outboundNoAnswerCallsDay']+=0x1;_0x43e81a[_0x8c97('0xc8')]+=0x1;_0x43e81a['countglobal']=ut[_0x8c97('0xa1')](_0x43e81a);ut['logCustomer'](_0x43e81a,0x3,'NoAnswer');ami[_0x8c97('0x27')](_0x8c97('0xc9'),ut[_0x8c97('0xa3')](_0x43e81a,_0x8c97('0xca')));rpcDb[_0x8c97('0x91')](_0x43e81a,_0x8c97('0xcb'));if(ut[_0x8c97('0xa1')](_0x43e81a)>=_0x31a4f3[_0x8c97('0xa6')]){_0x27fef3=ut[_0x8c97('0xc3')](_0x43e81a,0xf,_0x8c97('0xa7'));rpcDb[_0x8c97('0x94')](_0x27fef3,_0x8c97('0xcc'));}else{if(_0x43e81a['countnoanswerretry']>=_0x31a4f3['dialNoAnswerMaxRetry']){rpcDb[_0x8c97('0x94')](_0x43e81a,_0x8c97('0xcb'));}else{rpcDb[_0x8c97('0xaa')](ut[_0x8c97('0xc5')](_0x43e81a,_0x8c97('0xc8'),_0x31a4f3[_0x8c97('0xcd')]),_0x43e81a[_0x8c97('0xc6')],_0x43e81a[_0x8c97('0xab')]);}}break;case _0x8c97('0xce'):_0x31a4f3[_0x8c97('0xcf')]+=0x1;_0x43e81a[_0x8c97('0xd0')]+=0x1;_0x43e81a[_0x8c97('0xa0')]=ut['totalGlobal'](_0x43e81a);ut[_0x8c97('0x8d')](_0x43e81a,0x8,_0x8c97('0xd1'));ami[_0x8c97('0x27')](_0x8c97('0xd2'),ut[_0x8c97('0xa3')](_0x43e81a,_0x8c97('0xd3')));rpcDb[_0x8c97('0x91')](_0x43e81a,_0x8c97('0xd4'));if(ut['totalGlobal'](_0x43e81a)>=_0x31a4f3['dialGlobalMaxRetry']){_0x27fef3=ut[_0x8c97('0xc3')](_0x43e81a,0xf,_0x8c97('0xa7'));rpcDb['createCustomerFinal'](_0x27fef3,_0x8c97('0xd5'));}else{if(_0x43e81a[_0x8c97('0xd0')]>=_0x31a4f3[_0x8c97('0xd6')]){rpcDb[_0x8c97('0x94')](_0x43e81a,_0x8c97('0xd4'));}else{rpcDb[_0x8c97('0xaa')](ut[_0x8c97('0xc5')](_0x43e81a,_0x8c97('0xd0'),_0x31a4f3[_0x8c97('0xd7')]),_0x43e81a[_0x8c97('0xc6')],_0x43e81a[_0x8c97('0xab')]);}}break;case _0x8c97('0xd8'):_0x31a4f3[_0x8c97('0x40')]+=0x1;_0x43e81a[_0x8c97('0xd9')]+=0x1;_0x43e81a[_0x8c97('0xa0')]=ut[_0x8c97('0xa1')](_0x43e81a);ut[_0x8c97('0x8d')](_0x43e81a,0x14,_0x8c97('0xda'));ami[_0x8c97('0x27')]('custom:agentreject',ut[_0x8c97('0xa3')](_0x43e81a,'agentreject'));rpcDb['createCustomerHistory'](_0x43e81a,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0x43e81a)>=_0x31a4f3[_0x8c97('0xa6')]){_0x27fef3=ut[_0x8c97('0xc3')](_0x43e81a,0x14,_0x8c97('0xda'));rpcDb['createCustomerFinal'](_0x27fef3,_0x8c97('0xdb'));}else{if(_0x43e81a[_0x8c97('0xd9')]>=_0x31a4f3[_0x8c97('0xdc')]){rpcDb['createCustomerFinal'](_0x43e81a,_0x8c97('0xdb'));}else{rpcDb[_0x8c97('0xaa')](ut[_0x8c97('0xc5')](_0x43e81a,_0x8c97('0xd9'),_0x31a4f3[_0x8c97('0xdd')]),_0x43e81a[_0x8c97('0xc6')],_0x43e81a[_0x8c97('0xab')]);}}break;case _0x8c97('0xde'):_0x31a4f3[_0x8c97('0x42')]+=0x1;_0x43e81a[_0x8c97('0xdf')]+=0x1;_0x43e81a['countglobal']=ut[_0x8c97('0xa1')](_0x43e81a);ut[_0x8c97('0x8d')](_0x43e81a,0xb,'Abandoned');rpcDb[_0x8c97('0x91')](_0x43e81a,_0x8c97('0xe0'));if(ut[_0x8c97('0xa1')](_0x43e81a)>=_0x31a4f3['dialGlobalMaxRetry']){_0x27fef3=ut[_0x8c97('0xc3')](_0x43e81a,0xf,'Global');rpcDb[_0x8c97('0x94')](_0x27fef3,_0x8c97('0xe0'));}else{if(_0x43e81a[_0x8c97('0xe1')]>=_0x31a4f3[_0x8c97('0xe2')]){rpcDb[_0x8c97('0x94')](_0x43e81a,_0x8c97('0xe0'));}else{rpcDb[_0x8c97('0xaa')](ut[_0x8c97('0xc5')](_0x43e81a,'countabandonedretry',_0x31a4f3[_0x8c97('0xe3')]),_0x43e81a[_0x8c97('0xc6')],_0x43e81a[_0x8c97('0xab')]);}}break;case'18':_0x31a4f3[_0x8c97('0x41')]+=0x1;_0x43e81a[_0x8c97('0xe4')]+=0x1;_0x43e81a[_0x8c97('0xa0')]=ut['totalGlobal'](_0x43e81a);ut['logCustomer'](_0x43e81a,0x12,_0x35e2a5[_0x8c97('0xe5')]||_0x35e2a5[_0x8c97('0xe6')]);ami[_0x8c97('0x27')]('custom:amd',ut[_0x8c97('0xa3')](_0x43e81a,'amd'));rpcDb[_0x8c97('0x91')](_0x43e81a,'[callProgressDetectingCustomer][hangupInAMD]');if(ut['totalGlobal'](_0x43e81a)>=_0x31a4f3['dialGlobalMaxRetry']){_0x27fef3=ut[_0x8c97('0xc3')](_0x43e81a,0xf,'Global');rpcDb[_0x8c97('0x94')](_0x27fef3,_0x8c97('0xe7'));}else{rpcDb[_0x8c97('0x94')](_0x43e81a,_0x8c97('0xe7'));}delete this[_0x8c97('0x6f')][_0x35e2a5['linkedid']];break;case'19':_0x31a4f3[_0x8c97('0x41')]+=0x1;_0x43e81a[_0x8c97('0xa0')]=ut[_0x8c97('0xa1')](_0x43e81a);ut[_0x8c97('0x8d')](_0x43e81a,0x13,_0x35e2a5['cause-txt']||_0x35e2a5[_0x8c97('0xe6')]);ami[_0x8c97('0x27')]('custom:amd',ut[_0x8c97('0xa3')](_0x43e81a,_0x8c97('0xe8')));rpcDb[_0x8c97('0x91')](_0x43e81a,_0x8c97('0xe9'));if(ut[_0x8c97('0xa1')](_0x43e81a)>=_0x31a4f3['dialGlobalMaxRetry']){_0x27fef3=ut[_0x8c97('0xc3')](_0x43e81a,0xf,'Global');rpcDb[_0x8c97('0x94')](_0x27fef3,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x8c97('0x94')](_0x43e81a,_0x8c97('0xe9'));}delete this[_0x8c97('0x6f')][_0x35e2a5[_0x8c97('0xac')]];break;default:if(_0x43e81a[_0x8c97('0x72')]){ut[_0x8c97('0xb7')](_0x31a4f3,'[default]');ut[_0x8c97('0x7e')](_0x8c97('0xea')+_0x31a4f3['name'],_0x35e2a5);}_0x31a4f3[_0x8c97('0x41')]+=0x1;_0x43e81a[_0x8c97('0xa0')]=ut['totalGlobal'](_0x43e81a);ut[_0x8c97('0x8d')](_0x43e81a,0xc,_0x35e2a5['cause-txt']||_0x35e2a5[_0x8c97('0xe6')]);rpcDb['createCustomerHistory'](_0x43e81a,_0x8c97('0xeb'));if(ut['totalGlobal'](_0x43e81a)>=_0x31a4f3['dialGlobalMaxRetry']){_0x27fef3=ut[_0x8c97('0xc3')](_0x43e81a,0xf,'Global');rpcDb[_0x8c97('0x94')](_0x27fef3,_0x8c97('0xec'));}else{rpcDb['createCustomerFinal'](_0x43e81a,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x8c97('0x6f')][_0x35e2a5['linkedid']];}if(!(_0x43e81a[_0x8c97('0x72')]&&_0x581f2e==='16')){ut[_0x8c97('0x7c')](_0x31a4f3,'[callProgressDetectingCustomer]');logger[_0x8c97('0x5a')]('[originated][decrement][callProgressDetectingCustomer]',_0x43e81a['uniqueid'],_0x8c97('0xb2'),_0x31a4f3['name'],_0x8c97('0xed'),_0x31a4f3[_0x8c97('0x4b')]);}if(_0x581f2e!=='ANSWER'){delete this[_0x8c97('0x6f')][_0x35e2a5[_0x8c97('0xac')]];delete this[_0x8c97('0x6f')][_0x35e2a5[_0x8c97('0xee')]];}}};Preview[_0x8c97('0x65')][_0x8c97('0xef')]=function(_0x1e730c,_0x33d1d7,_0x46fe31){if(_[_0x8c97('0xf0')](_0x33d1d7)&&_0x8c97('0xf1')!==typeof _0x33d1d7){return;}if(_[_0x8c97('0xf0')](_0x46fe31)&&_0x8c97('0xf1')!==typeof _0x46fe31){return;}switch(_0x46fe31[_0x8c97('0xf2')]){case'0':ut[_0x8c97('0xf3')](_0x1e730c,0x0,'NoSuchNumber');rpcDb[_0x8c97('0xf4')](_0x1e730c,_0x8c97('0xf5'));break;case'3':ut['logAgent'](_0x1e730c,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x1e730c,_0x8c97('0xf6'));break;case'5':ut[_0x8c97('0xf3')](_0x1e730c,0x5,_0x8c97('0xf7'));rpcDb['createAgentHistory'](_0x1e730c,_0x8c97('0xf8'));break;case'8':ut[_0x8c97('0xf3')](_0x1e730c,0x8,_0x8c97('0xd1'));rpcDb[_0x8c97('0xf4')](_0x1e730c,_0x8c97('0xf9'));break;case'22':ut['logAgent'](_0x1e730c,0x16,_0x8c97('0xfa'));rpcDb[_0x8c97('0xf4')](_0x1e730c,_0x8c97('0xfb'));break;default:ut[_0x8c97('0xf3')](_0x1e730c,0xc,_0x46fe31[_0x8c97('0xf2')]);rpcDb['createAgentHistory'](_0x1e730c,_0x8c97('0xf9'));}ut[_0x8c97('0x7c')](_0x33d1d7,_0x8c97('0xfc'));logger[_0x8c97('0x5a')]('[originated][decrement][callProgressDetectingAgent]',_0x1e730c[_0x8c97('0xb1')],_0x8c97('0xb2'),_0x33d1d7[_0x8c97('0x52')],_0x8c97('0xed'),_0x33d1d7[_0x8c97('0x4b')]);delete this[_0x8c97('0x6f')][_0x1e730c['uniqueid']];};Preview[_0x8c97('0x65')]['checkInBlack']=function(_0x6b0af1,_0x9c8f21,_0x158dd9,_0x2f9dd1,_0x4624ae){var _0x2aec6f=this;return new BPromise(function(_0x308585,_0x549207){if(_[_0x8c97('0x6e')](_0x9c8f21)||_['isNil'](_0x9c8f21[_0x8c97('0xfd')])||_[_0x8c97('0x6e')](_0x9c8f21['Contact']['phone'])||_['isNil'](_0x9c8f21[_0x8c97('0x76')])){_0x549207(ut['message'](_0x8c97('0xfe'),_0x2f9dd1,_0x4624ae));return;}var _0x1d40ce=uuid['v4']();var _0x4bc6f4=_0x2aec6f['campaignsPreview'][_0x9c8f21[_0x8c97('0xff')][_0x8c97('0x52')]];var _0x457a83=_0x158dd9?_0x2aec6f[_0x8c97('0x17')][_0x158dd9]['id']:undefined;_0x2aec6f[_0x8c97('0x6f')][_0x1d40ce]=new Action(_0x9c8f21,_0x4bc6f4,_0x1d40ce,_0x158dd9,_0x457a83);var _0x2b7a99=_0x2aec6f[_0x8c97('0x6f')][_0x1d40ce];_0x2b7a99[_0x8c97('0xc6')]=_0x2f9dd1;_0x2b7a99[_0x8c97('0xab')]=_0x4624ae;_0x2b7a99[_0x8c97('0x100')]=_0x158dd9;if(_[_0x8c97('0x101')](_0x6b0af1)){_0x2aec6f[_0x8c97('0x102')](_0x2b7a99,_0x4bc6f4,_0x9c8f21,_0x158dd9)[_0x8c97('0x85')](function(_0x456d4b){logger[_0x8c97('0x5a')](_0x8c97('0x103'),_0x8c97('0x104')+_0x2b7a99[_0x8c97('0x70')]+_0x8c97('0x105')+_0x2b7a99[_0x8c97('0x106')],JSON[_0x8c97('0x56')](_0x456d4b));ami[_0x8c97('0x27')]('custom:agentcalled',ut['buildObj'](_0x2b7a99,'called',_0x2aec6f[_0x8c97('0x15')][_0x2b7a99[_0x8c97('0x70')]]));_0x308585(ut[_0x8c97('0x4a')](_0x8c97('0x107')));})['catch'](function(_0x3cc3b7){ut[_0x8c97('0x60')]('[Preview][execCall][failure]',_0x3cc3b7);_0x549207(ut[_0x8c97('0x4a')](_0x8c97('0x108'),_0x2f9dd1,_0x4624ae));});}else{_0x4bc6f4['outboundBlacklistCallsDay']+=0x1;ut[_0x8c97('0x109')](_0x2b7a99);rpcDb[_0x8c97('0x10a')](_0x2b7a99,_0x8c97('0x10b'));delete _0x2aec6f[_0x8c97('0x6f')][_0x1d40ce];_0x549207(ut['message'](_0x8c97('0x10c'),_0x2f9dd1,_0x4624ae));}});};Preview[_0x8c97('0x65')][_0x8c97('0x99')]=function(_0xddd9fe){return!_[_0x8c97('0x6e')](_0xddd9fe)&&!_[_0x8c97('0x6e')](_0xddd9fe[_0x8c97('0x52')])&&!_[_0x8c97('0x6e')](_0xddd9fe[_0x8c97('0x53')])&&_0xddd9fe[_0x8c97('0x53')]&&!_['isNil'](this[_0x8c97('0x16')][util[_0x8c97('0x57')](_0x8c97('0x10d'),_0xddd9fe[_0x8c97('0x52')])])&&!_['isNil'](this[_0x8c97('0x16')][util['format'](_0x8c97('0x10d'),_0xddd9fe[_0x8c97('0x52')])][_0x8c97('0x78')])&&(this[_0x8c97('0x16')][util[_0x8c97('0x57')](_0x8c97('0x10d'),_0xddd9fe['name'])][_0x8c97('0x78')]===_0x8c97('0x10e')||this[_0x8c97('0x16')][util[_0x8c97('0x57')](_0x8c97('0x10d'),_0xddd9fe[_0x8c97('0x52')])]['status']==='unmonitored');};Preview[_0x8c97('0x65')][_0x8c97('0x10f')]=function(_0x52abb8,_0x4098b8){var _0x23a55b=this;return new BPromise(function(_0x2c4f87,_0x563b9a){_0x23a55b[_0x8c97('0x110')](_0x52abb8,_0x4098b8)[_0x8c97('0x85')](function(_0x5b300f){_0x2c4f87(_[_0x8c97('0x73')](_0x5b300f,[_0x8c97('0x4a')]));})[_0x8c97('0x7a')](function(_0x437cef){if(_0x437cef[_0x8c97('0x111')]){rpcDb['unlockContact'](_0x52abb8);}if(_0x437cef[_0x8c97('0x53')]){rpcDb[_0x8c97('0x112')](_0x52abb8);}_0x563b9a(_['pick'](_0x437cef,[_0x8c97('0x4a')]));});});};Preview[_0x8c97('0x65')]['execRun']=function(_0xafbbb7,_0x2daffd){var _0x1d2747=this;return new BPromise(function(_0xa8abd5,_0x370865){var _0x28be0f,_0x52b010;rpcDb[_0x8c97('0x113')](_0xafbbb7)['then'](function(_0x4ffd16){if(!_[_0x8c97('0x6e')](_0x4ffd16[0x0])){_0x52b010=_0x4ffd16[0x0][_0x8c97('0x114')]?![]:!![];_0x28be0f=_0x4ffd16[0x0][_0x8c97('0x114')]?!![]:![];_0x28be0f=_0x2daffd?!![]:_0x28be0f;}var _0x459ba3=_0x1d2747[_0x8c97('0x115')](_0x4ffd16);if(_0x459ba3['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x4ffd16[0x0],[_0x8c97('0x76'),'Contact.phone']))[_0x8c97('0x85')](function(_0x48bceb){_0x1d2747[_0x8c97('0x116')](_0x48bceb,_0x4ffd16[0x0],_0x2daffd,_0x52b010,_0x28be0f)[_0x8c97('0x85')](function(_0x514a0e){_0xa8abd5(_0x514a0e);})[_0x8c97('0x7a')](function(_0x3d37e6){_0x370865(_0x3d37e6);});})[_0x8c97('0x7a')](function(_0x2e7a58){ut[_0x8c97('0x60')]('[Preview][checkIsBlackList]',_0x2e7a58);_0x370865(ut[_0x8c97('0x4a')]('Call\x20unsuccessful',_0x52b010,_0x28be0f));});}else{_0x370865(ut[_0x8c97('0x4a')](_0x459ba3[_0x8c97('0x4a')],_0x52b010,_0x28be0f));}})[_0x8c97('0x7a')](function(_0x30c128){ut['logger'](_0x8c97('0x117'),_0x30c128);_0x370865(ut['message'](_0x8c97('0x118'),![],!![]));});});};Preview[_0x8c97('0x65')][_0x8c97('0x115')]=function(_0x3c523d){if(_[_0x8c97('0x6e')](_0x3c523d)||_[_0x8c97('0x101')](_0x3c523d)||!_[_0x8c97('0x6e')](_0x3c523d[0x0][_0x8c97('0x87')])&&_['isNil'](_0x3c523d[0x0][_0x8c97('0x87')]['name'])){ut[_0x8c97('0x60')](_0x8c97('0x119'),_0x3c523d);return{'isValid':![],'message':_0x8c97('0x11a')};}var _0x34ed84=this[_0x8c97('0x15')][_0x3c523d[0x0][_0x8c97('0xff')][_0x8c97('0x52')]];_0x34ed84[_0x8c97('0x4a')]=_0x8c97('0x9c');if(_['isNil'](_0x34ed84)){ut[_0x8c97('0x60')]('[Preview][validateContact][Empty\x20Campaign]',_0x34ed84);return{'isValid':![],'message':_0x8c97('0x11b')};}if(!this[_0x8c97('0x99')](_0x34ed84[_0x8c97('0x51')])){ut[_0x8c97('0x60')](_0x8c97('0x11c'),'campaign\x20Name:\x20'+_0x34ed84[_0x8c97('0x52')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x8c97('0x99')](_0x34ed84[_0x8c97('0x9a')])){ut[_0x8c97('0x60')](_0x8c97('0x11c'),_0x34ed84[_0x8c97('0x52')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x34ed84['dialActive'])){ut[_0x8c97('0x60')]('[Preview][validateContact][Campaign\x20Active]',_0x34ed84['name']+_0x8c97('0x11d'));return{'isValid':![],'message':_0x8c97('0x11e')+_0x34ed84['name']+_0x8c97('0x11d')};}return{'isValid':!![],'message':_0x8c97('0x11f')};};Preview[_0x8c97('0x65')]['execCall']=function(_0x10b251,_0x59878c,_0x350dd7,_0x47cadc){var _0x5362dd=this;return new BPromise(function(_0xe38160,_0x21269b){var _0x331945=_0x10b251[_0x8c97('0xb1')];var _0x2f2d8b=_0x5362dd['isTrunkReachable'](_0x59878c[_0x8c97('0x51')])?util[_0x8c97('0x57')](_0x8c97('0x120'),_0x59878c[_0x8c97('0x51')]['name'],_[_0x8c97('0x6e')](_0x59878c[_0x8c97('0x38')])?'':_0x59878c[_0x8c97('0x38')]['trim']()||'',_0x59878c[_0x8c97('0x121')]>0x0?_0x350dd7['Contact'][_0x8c97('0x122')]['substring'](_0x59878c['dialCutDigit']):_0x350dd7[_0x8c97('0xfd')][_0x8c97('0x122')]):util['format'](_0x8c97('0x120'),_[_0x8c97('0x6e')](_0x59878c[_0x8c97('0x9a')])?_0x59878c[_0x8c97('0x51')][_0x8c97('0x52')]:_0x59878c[_0x8c97('0x9a')][_0x8c97('0x52')],_[_0x8c97('0x6e')](_0x59878c['dialPrefix'])?'':_0x59878c[_0x8c97('0x38')][_0x8c97('0x123')]()||'',_0x59878c[_0x8c97('0x121')]>0x0?_0x350dd7[_0x8c97('0xfd')]['phone'][_0x8c97('0x124')](_0x59878c['dialCutDigit']):_0x350dd7[_0x8c97('0xfd')]['phone']);var _0x4b6718=_0x5362dd[_0x8c97('0x99')](_0x59878c[_0x8c97('0x51')])?ut[_0x8c97('0x125')](_0x59878c[_0x8c97('0x51')][_0x8c97('0x54')],_0x59878c[_0x8c97('0x35')],_0x59878c[_0x8c97('0x126')]>0x0?ut[_0x8c97('0x127')](_0x59878c[_0x8c97('0x36')],_0x59878c[_0x8c97('0x126')]):_0x59878c[_0x8c97('0x36')]):ut[_0x8c97('0x125')](_[_0x8c97('0x6e')](_0x59878c['TrunkBackup'])?_0x59878c['Trunk'][_0x8c97('0x54')]:_0x59878c[_0x8c97('0x9a')][_0x8c97('0x54')],_0x59878c[_0x8c97('0x35')],_0x59878c[_0x8c97('0x126')]>0x0?ut[_0x8c97('0x127')](_0x59878c[_0x8c97('0x36')],_0x59878c[_0x8c97('0x126')]):_0x59878c[_0x8c97('0x36')]);if(_0x4b6718){_0x10b251[_0x8c97('0x128')]=ut[_0x8c97('0x129')](_0x4b6718);_0x10b251[_0x8c97('0x12a')]=ut['extractCalleridNumber'](_0x4b6718);}var _0x219bc4=ut[_0x8c97('0x12b')](_0x59878c,_0x350dd7,_0x2f2d8b,_0x4b6718,_0x331945,_0x10b251);_['merge'](_0x10b251,ut[_0x8c97('0x12c')](_0x219bc4));_0x10b251[_0x8c97('0x8a')]=moment()[_0x8c97('0x57')](_0x8c97('0x8b'));ami[_0x8c97('0x77')](ut[_0x8c97('0x12d')](_0x10b251,_0x59878c,_0x219bc4,_0x10b251['activeContact'],_0x47cadc))['then'](function(_0x5d9c32){_0x59878c[_0x8c97('0x4b')]+=0x1;logger[_0x8c97('0x5a')](_0x8c97('0x12e'),_0x331945,_0x8c97('0xb2'),_0x59878c[_0x8c97('0x52')],_0x8c97('0xed'),_0x59878c[_0x8c97('0x4b')]);_0xe38160(_0x5d9c32);})[_0x8c97('0x7a')](function(_0x248551){ut[_0x8c97('0xf3')](_0x10b251,0xe,_0x8c97('0x12f'));rpcDb[_0x8c97('0xf4')](_0x10b251,_0x8c97('0x130'));_0x21269b(_0x248551);});});};Preview[_0x8c97('0x65')][_0x8c97('0x131')]=function(_0x494d42){if(this['actions'][_0x494d42[_0x8c97('0xac')]]){this[_0x8c97('0x6f')][_0x494d42[_0x8c97('0xac')]][_0x8c97('0x79')]=_0x494d42[_0x8c97('0x79')];}};Preview[_0x8c97('0x65')]['syncOriginateResponse']=function(_0x5d9953){var _0x4ba439=this;var _0xd3b19f=this[_0x8c97('0x6f')][_0x5d9953['actionid']];if(_0xd3b19f){if(_0xd3b19f[_0x8c97('0x100')]&&this['agents'][_0xd3b19f[_0x8c97('0x100')]]){ut['logLookAgent'](_0xd3b19f,this[_0x8c97('0x17')][_0xd3b19f['lookAgent']]['name'],this[_0x8c97('0x17')][_0xd3b19f[_0x8c97('0x100')]]['id']);}var _0x22f4f7=_[_0x8c97('0x132')](_0xd3b19f);_0x22f4f7[_0x8c97('0xae')]=moment()[_0x8c97('0x57')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1bb814=_0x4ba439[_0x8c97('0x15')][_0xd3b19f['queue']];if(ut[_0x8c97('0x133')](_0x5d9953[_0x8c97('0x134')])){if(_0xd3b19f[_0x8c97('0xc6')]){rpcDb[_0x8c97('0x135')](_0xd3b19f[_0x8c97('0x106')]);}if(_0xd3b19f['activeContact']){rpcDb[_0x8c97('0x112')](_0xd3b19f[_0x8c97('0x106')]);}ami[_0x8c97('0x27')](_0x8c97('0x136'),ut[_0x8c97('0xa3')](_0xd3b19f,'rejected',this[_0x8c97('0x15')][_0xd3b19f['queue']]));this[_0x8c97('0xef')](_0x22f4f7,_0x1bb814,_0x5d9953);}else{_0xd3b19f['starttime']=moment()['format'](_0x8c97('0x8b'));ut[_0x8c97('0xf3')](_0x22f4f7,0x4,_0x8c97('0xb9'));rpcDb['createAgentHistory'](_0x22f4f7,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x8c97('0x65')]['syncHangup']=function(_0x52eaf1){var _0xf7e850=this;var _0x525857=this['actions'][_0x52eaf1[_0x8c97('0xac')]];var _0x3f9acd;if(_0x525857){_0x3f9acd=this[_0x8c97('0x15')][_0x525857[_0x8c97('0x70')]];logger[_0x8c97('0x5a')](_0x8c97('0x137'),_0x52eaf1[_0x8c97('0xac')],_0x8c97('0xb2'),_0x3f9acd[_0x8c97('0x52')],_0x8c97('0x71'),_0x3f9acd['pTalking']);}if(this[_0x8c97('0x6f')][_0x52eaf1['linkedid']]&&_0x52eaf1[_0x8c97('0xac')]!==_0x52eaf1[_0x8c97('0xb1')]){if(_0x52eaf1[_0x8c97('0x138')]==='16'&&this[_0x8c97('0x6f')][_0x52eaf1[_0x8c97('0xac')]][_0x8c97('0x72')]){this[_0x8c97('0x9d')](_0x52eaf1,_0x52eaf1[_0x8c97('0xac')],_0x52eaf1[_0x8c97('0x138')]);}else if(this[_0x8c97('0x6f')][_0x52eaf1[_0x8c97('0xac')]][_0x8c97('0x72')]){logger['info']('[syncHangup][talking][cause]',_0x52eaf1[_0x8c97('0xac')],_0x52eaf1[_0x8c97('0x138')],_0x8c97('0xb2'),_0x3f9acd['name'],'pTalking:\x20',_0x3f9acd[_0x8c97('0x2c')]);this[_0x8c97('0x9d')](_0x52eaf1,_0x52eaf1[_0x8c97('0xac')],_0x52eaf1['cause']);}}else if(_0x525857&&_['isNil'](_0x525857[_0x8c97('0x139')])&&_0x3f9acd[_0x8c97('0x13a')]&&_0x52eaf1[_0x8c97('0xac')]===_0x52eaf1[_0x8c97('0xb1')]&&_[_0x8c97('0x6e')](_0x52eaf1[_0x8c97('0xf2')])&&_0x52eaf1[_0x8c97('0x138')]==='16'&&_0x52eaf1['channelstate']==='6'&&_[_0x8c97('0xf0')](_0x525857[_0x8c97('0x13b')])){if(_0x525857[_0x8c97('0xc6')]){rpcDb[_0x8c97('0x135')](_0x525857[_0x8c97('0x106')]);}if(_0x525857[_0x8c97('0xab')]){rpcDb[_0x8c97('0x112')](_0x525857[_0x8c97('0x106')]);}_0x52eaf1[_0x8c97('0xf2')]='22';this['callProgressDetectingAgent'](_0x525857,_0x3f9acd,_0x52eaf1);}else if(_0x525857&&_0x525857[_0x8c97('0x13b')]){if(_0x52eaf1[_0x8c97('0x138')]==='16'&&this['actions'][_0x52eaf1[_0x8c97('0xac')]][_0x8c97('0x72')]){logger['info'](_0x8c97('0x13c'),_0x52eaf1[_0x8c97('0xac')],_0x52eaf1[_0x8c97('0x138')],_0x8c97('0xb2'),_0x3f9acd[_0x8c97('0x52')],'pTalking:\x20',_0x3f9acd[_0x8c97('0x2c')]);this['callProgressDetectingCustomer'](_0x52eaf1,_0x52eaf1[_0x8c97('0xac')],_0x52eaf1['cause']);}else if(this[_0x8c97('0x6f')][_0x52eaf1[_0x8c97('0xac')]]['dialAnswer']){logger[_0x8c97('0x5a')](_0x8c97('0x13d'),_0x52eaf1['linkedid'],_0x52eaf1[_0x8c97('0x138')],_0x8c97('0xb2'),_0x3f9acd[_0x8c97('0x52')],'pTalking:\x20',_0x3f9acd['pTalking']);this[_0x8c97('0x9d')](_0x52eaf1,_0x52eaf1[_0x8c97('0xac')],_0x52eaf1[_0x8c97('0x138')]);}}};Preview[_0x8c97('0x65')][_0x8c97('0x1e')]=function(_0xe8acb5){if(this[_0x8c97('0x6f')][_0xe8acb5[_0x8c97('0xee')]]&&_0xe8acb5['destlinkedid']!==_0xe8acb5['destuniqueid']){this[_0x8c97('0x9d')](_0xe8acb5,_0xe8acb5[_0x8c97('0xee')],_0xe8acb5[_0x8c97('0xe6')]);}};Preview[_0x8c97('0x65')][_0x8c97('0x1c')]=function(_0x194193){if(this[_0x8c97('0x6f')][_0x194193[_0x8c97('0xac')]]&&_0x194193[_0x8c97('0xac')]!==_0x194193[_0x8c97('0xb1')]&&!this[_0x8c97('0x6f')][_0x194193[_0x8c97('0xac')]][_0x8c97('0x72')]){if(_0x194193[_0x8c97('0x138')]==='1'){this[_0x8c97('0x9d')](_0x194193,_0x194193[_0x8c97('0xac')],_0x194193['cause']);}}};Preview[_0x8c97('0x65')][_0x8c97('0x13e')]=function(_0x28a17e,_0xfe062f,_0x573310){if(this[_0x8c97('0x6f')][_0x28a17e]){if(_['isNil'](this[_0x8c97('0x6f')][_0x28a17e]['variables'])){this[_0x8c97('0x6f')][_0x28a17e][_0x8c97('0x13f')]={};}this[_0x8c97('0x6f')][_0x28a17e][_0x8c97('0x13f')][_0xfe062f]=_0x573310;}};Preview[_0x8c97('0x65')][_0x8c97('0x21')]=function(_0x2b9991){try{if(!_[_0x8c97('0x6e')](_0x2b9991)){if(ut[_0x8c97('0x140')](_[_0x8c97('0x141')](_0x2b9991[_0x8c97('0x142')])[0x0])){this[_0x8c97('0x13e')](_0x2b9991[_0x8c97('0xb1')],_[_0x8c97('0x141')](_0x2b9991[_0x8c97('0x142')])[0x0],_0x2b9991[_0x8c97('0x143')]);}}}catch(_0x3358a5){logger[_0x8c97('0x144')]('[syncVarSet][Preview]',util[_0x8c97('0x145')](_0x3358a5,{'showHidden':![],'depth':null}));}};Preview[_0x8c97('0x65')]['syncAttendedTransfer']=function(_0x33335b){if(_0x33335b){if(this['actions'][_0x33335b[_0x8c97('0x146')]]){this['actions'][_0x33335b['transfertargetlinkedid']][_0x8c97('0x13b')]=!![];}}};Preview[_0x8c97('0x65')][_0x8c97('0x25')]=function(_0x68d63){if(_0x68d63){if(this[_0x8c97('0x6f')][_0x68d63[_0x8c97('0x147')]]){this[_0x8c97('0x6f')][_0x68d63[_0x8c97('0x147')]][_0x8c97('0x13b')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index fc02558..f245485 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fd5=['createHistory','catch','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','then'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0fd5,0x65));var _0x50fd=function(_0x1faa67,_0x306e21){_0x1faa67=_0x1faa67-0x0;var _0x306fae=_0x0fd5[_0x1faa67];return _0x306fae;};'use strict';var util=require('util');var BPromise=require(_0x50fd('0x0'));var logger=require('../../../config/logger')(_0x50fd('0x1'));var _=require(_0x50fd('0x2'));var cmHopper=require(_0x50fd('0x3'));var cmHopperFinal=require(_0x50fd('0x4'));var cmHopperHistory=require(_0x50fd('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x50fd('0x6'));var agentReportPreview=require(_0x50fd('0x7'));var voiceQueueReport=require(_0x50fd('0x8'));function loggerCatch(_0x46b1f6){return function(_0x24f698){logger['error'](_0x46b1f6,util[_0x50fd('0x9')](_0x24f698,{'showHidden':![],'depth':null}));};}function create(_0x402ab9){return BPromise['resolve']()[_0x50fd('0xa')](cmHopperHistory[_0x50fd('0xb')](_0x402ab9))[_0x50fd('0xc')](loggerCatch('[createHistory]\x20'));}function createAgent(_0xfbbdff){return BPromise[_0x50fd('0xd')]()[_0x50fd('0xa')](agentReportPreview[_0x50fd('0xb')](_0xfbbdff))[_0x50fd('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3b967c){return BPromise[_0x50fd('0xd')]()[_0x50fd('0xa')](cmHopper[_0x50fd('0xe')](_0x3b967c,!![]))[_0x50fd('0xc')](loggerCatch(_0x50fd('0xf')));}exports[_0x50fd('0x10')]=function(_0x2959c5){return BPromise['resolve']()[_0x50fd('0xa')](cmHopperBlack['checkIsBlackList'](_0x2959c5))['catch'](loggerCatch(_0x50fd('0x11')));};exports[_0x50fd('0x12')]=function(_0x11c248){return BPromise[_0x50fd('0xd')]()[_0x50fd('0xa')](cmHopper['getContactPreview'](_0x11c248))[_0x50fd('0xc')](loggerCatch(_0x50fd('0x13')));};exports[_0x50fd('0xb')]=function(_0x4caa9c,_0x177f6b){create(_0x4caa9c)[_0x50fd('0xc')](loggerCatch(_0x177f6b));moveContact(_0x4caa9c)[_0x50fd('0xc')](loggerCatch(_0x177f6b));};exports[_0x50fd('0x14')]=function(_0x1c2e83,_0x2d7145){createAgent(_0x1c2e83)[_0x50fd('0xc')](loggerCatch(_0x2d7145));};exports[_0x50fd('0x15')]=function(_0x104f25,_0x4358eb){create(_0x104f25)[_0x50fd('0xc')](loggerCatch(_0x4358eb));};exports['createCustomerFinal']=function(_0x5ca9b2,_0x17b32b){moveContact(_0x5ca9b2)['catch'](loggerCatch(_0x17b32b));};exports[_0x50fd('0x16')]=function(_0x1ec264,_0x233a4e,_0x3d5fa4){if(_0x233a4e){_0x1ec264[_0x50fd('0x17')]=null;}if(_0x3d5fa4){_0x1ec264[_0x50fd('0x18')]=![];}return BPromise[_0x50fd('0xd')]()[_0x50fd('0xa')](cmHopper['rescheduleContact'](_0x1ec264))[_0x50fd('0xc')](loggerCatch(_0x50fd('0x19')));};exports[_0x50fd('0x1a')]=function(_0x970b8c){return BPromise[_0x50fd('0xd')]()['then'](cmHopper[_0x50fd('0x1a')](_0x970b8c))[_0x50fd('0xc')](loggerCatch(_0x50fd('0x1b')));};exports[_0x50fd('0x1c')]=function(_0x286d66){return BPromise[_0x50fd('0xd')]()[_0x50fd('0xa')](cmHopper['unlockContact']({'UserId':null},_0x286d66,0x1))[_0x50fd('0xc')](loggerCatch(_0x50fd('0x1d')));};exports['disableContact']=function(_0x21b513){return BPromise['resolve']()['then'](cmHopper[_0x50fd('0x1c')]({'active':![]},_0x21b513,0x1))['catch'](loggerCatch(_0x50fd('0x1e')));};exports[_0x50fd('0x1f')]=function(_0x51d148){var _0x3753da={};_0x3753da['type']=_0x51d148[_0x50fd('0x20')];_0x3753da[_0x50fd('0x21')]=_0x51d148[_0x50fd('0x21')];_0x3753da[_0x50fd('0x22')]=_0x51d148[_0x50fd('0x22')];_0x3753da['calleridname']=_0x51d148[_0x50fd('0x23')];_0x3753da[_0x50fd('0x24')]=_0x51d148['queue'];_0x3753da[_0x50fd('0x25')]=_0x51d148[_0x50fd('0x26')];_0x3753da['queuecallerleaveAt']=_0x51d148[_0x50fd('0x26')];_0x3753da[_0x50fd('0x27')]=0x1;_0x3753da[_0x50fd('0x28')]=_0x51d148[_0x50fd('0x29')];_0x3753da[_0x50fd('0x2a')]=_0x51d148[_0x50fd('0x2b')];_0x3753da[_0x50fd('0x2c')]=_0x50fd('0x2d');_0x3753da['exten']=_0x50fd('0x2e');_0x3753da[_0x50fd('0x2f')]=0x0;_0x3753da['assigned']=0x1;_0x3753da[_0x50fd('0x30')]=_0x51d148['membername'];_0x3753da[_0x50fd('0x31')]=_0x50fd('0x32');return BPromise['resolve']()['then'](voiceQueueReport[_0x50fd('0x33')](_0x3753da))[_0x50fd('0xc')](loggerCatch(_0x50fd('0x34')));};exports[_0x50fd('0x35')]=function(_0x57866f,_0x22ae9a){return BPromise[_0x50fd('0xd')]()[_0x50fd('0xa')](cmHopper['getContactRecallMe'](_0x57866f,_0x22ae9a))[_0x50fd('0xc')](loggerCatch(_0x50fd('0x36')));};exports['rescheduleContactInQueue']=function(_0x4fabe3){return BPromise['resolve']()[_0x50fd('0xa')](cmHopper[_0x50fd('0x16')](_0x4fabe3,!![],!![]))[_0x50fd('0xc')](loggerCatch(_0x50fd('0x37')));};
\ No newline at end of file
+var _0xf8f8=['[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','endtime','connectedlinename','context','from-sip','exten','assigned','membername','queuecallerexitreason','create','getContactRecallMe','rescheduleContactInQueue'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xf8f8,0xa3));var _0x8f8f=function(_0x468f44,_0x3933ac){_0x468f44=_0x468f44-0x0;var _0x46a525=_0xf8f8[_0x468f44];return _0x46a525;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x8f8f('0x0'))(_0x8f8f('0x1'));var _=require('lodash');var cmHopper=require(_0x8f8f('0x2'));var cmHopperFinal=require(_0x8f8f('0x3'));var cmHopperHistory=require(_0x8f8f('0x4'));var cmHopperBlack=require(_0x8f8f('0x5'));var voiceQueueRt=require(_0x8f8f('0x6'));var agentReportPreview=require(_0x8f8f('0x7'));var voiceQueueReport=require(_0x8f8f('0x8'));function loggerCatch(_0xe754e7){return function(_0x2d2b8f){logger[_0x8f8f('0x9')](_0xe754e7,util[_0x8f8f('0xa')](_0x2d2b8f,{'showHidden':![],'depth':null}));};}function create(_0x7f7446){return BPromise[_0x8f8f('0xb')]()['then'](cmHopperHistory['createHistory'](_0x7f7446))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0xd')));}function createAgent(_0x256db9){return BPromise['resolve']()[_0x8f8f('0xe')](agentReportPreview['createHistory'](_0x256db9))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0xd')));}function moveContact(_0x26c4f4){return BPromise[_0x8f8f('0xb')]()[_0x8f8f('0xe')](cmHopper[_0x8f8f('0xf')](_0x26c4f4,!![]))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0x10')));}exports['checkIsBlackList']=function(_0xca18ac){return BPromise['resolve']()[_0x8f8f('0xe')](cmHopperBlack[_0x8f8f('0x11')](_0xca18ac))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0x12')));};exports[_0x8f8f('0x13')]=function(_0x417e64){return BPromise[_0x8f8f('0xb')]()[_0x8f8f('0xe')](cmHopper[_0x8f8f('0x13')](_0x417e64))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0x14')));};exports['createHistory']=function(_0x194608,_0x4d3008){create(_0x194608)['catch'](loggerCatch(_0x4d3008));moveContact(_0x194608)[_0x8f8f('0xc')](loggerCatch(_0x4d3008));};exports[_0x8f8f('0x15')]=function(_0x33d30b,_0x3c8871){createAgent(_0x33d30b)[_0x8f8f('0xc')](loggerCatch(_0x3c8871));};exports[_0x8f8f('0x16')]=function(_0x2e9ac0,_0x540fe6){create(_0x2e9ac0)[_0x8f8f('0xc')](loggerCatch(_0x540fe6));};exports[_0x8f8f('0x17')]=function(_0x259518,_0x4501e0){moveContact(_0x259518)[_0x8f8f('0xc')](loggerCatch(_0x4501e0));};exports['rescheduleContact']=function(_0x5af20f,_0x2dfdb6,_0x2884ab){if(_0x2dfdb6){_0x5af20f['UserId']=null;}if(_0x2884ab){_0x5af20f[_0x8f8f('0x18')]=![];}return BPromise[_0x8f8f('0xb')]()[_0x8f8f('0xe')](cmHopper[_0x8f8f('0x19')](_0x5af20f))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0x1a')));};exports[_0x8f8f('0x1b')]=function(_0x3da367){return BPromise[_0x8f8f('0xb')]()[_0x8f8f('0xe')](cmHopper['countReScheduled'](_0x3da367))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0x1c')));};exports[_0x8f8f('0x1d')]=function(_0x46bac2){return BPromise['resolve']()[_0x8f8f('0xe')](cmHopper['unlockContact']({'UserId':null},_0x46bac2,0x1))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0x1e')));};exports[_0x8f8f('0x1f')]=function(_0x42fe51){return BPromise[_0x8f8f('0xb')]()[_0x8f8f('0xe')](cmHopper[_0x8f8f('0x1d')]({'active':![]},_0x42fe51,0x1))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0x20')));};exports[_0x8f8f('0x21')]=function(_0x587065){var _0x51e42e={};_0x51e42e[_0x8f8f('0x22')]=_0x587065[_0x8f8f('0x22')];_0x51e42e['uniqueid']=_0x587065[_0x8f8f('0x23')];_0x51e42e[_0x8f8f('0x24')]=_0x587065[_0x8f8f('0x24')];_0x51e42e[_0x8f8f('0x25')]=_0x587065['calleridname'];_0x51e42e[_0x8f8f('0x26')]=_0x587065[_0x8f8f('0x26')];_0x51e42e[_0x8f8f('0x27')]=_0x587065[_0x8f8f('0x28')];_0x51e42e[_0x8f8f('0x29')]=_0x587065['answertime'];_0x51e42e['queuecallercomplete']=0x1;_0x51e42e['queuecallercompleteAt']=_0x587065[_0x8f8f('0x2a')];_0x51e42e[_0x8f8f('0x2b')]=_0x587065['membername'];_0x51e42e[_0x8f8f('0x2c')]=_0x8f8f('0x2d');_0x51e42e[_0x8f8f('0x2e')]='xcally-motion-preview';_0x51e42e['holdtime']=0x0;_0x51e42e[_0x8f8f('0x2f')]=0x1;_0x51e42e['lastAssignedTo']=_0x587065[_0x8f8f('0x30')];_0x51e42e[_0x8f8f('0x31')]='COMPLETED';return BPromise['resolve']()[_0x8f8f('0xe')](voiceQueueReport[_0x8f8f('0x32')](_0x51e42e))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x2d56fa,_0x473b3f){return BPromise[_0x8f8f('0xb')]()[_0x8f8f('0xe')](cmHopper[_0x8f8f('0x33')](_0x2d56fa,_0x473b3f))[_0x8f8f('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x8f8f('0x34')]=function(_0x4214e4){return BPromise['resolve']()[_0x8f8f('0xe')](cmHopper['rescheduleContact'](_0x4214e4,!![],!![]))[_0x8f8f('0xc')](loggerCatch(_0x8f8f('0x35')));};
\ No newline at end of file
index c99794f..4ec633d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x686d=['motionChannel','voice','mandatoryDisposition','not_inuse','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','random','extractCalleridName','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','loggerError','error','message','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','statedesc','Blacklist','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','ringtime','logLookAgent','membername','UserId','starttime','answertime','isFailure','Failure','RECALL','calleridname','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','buildObj','lastevent','queue','interface'];(function(_0x44928e,_0x28d988){var _0x412386=function(_0x17da20){while(--_0x17da20){_0x44928e['push'](_0x44928e['shift']());}};_0x412386(++_0x28d988);}(_0x686d,0x1c9));var _0xd686=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x686d[_0x324012];return _0x435cf2;};'use strict';var util=require(_0xd686('0x0'));var _=require(_0xd686('0x1'));var moment=require(_0xd686('0x2'));var logger=require(_0xd686('0x3'))(_0xd686('0x4'));var ipAgi=process[_0xd686('0x5')][_0xd686('0x6')]||'127.0.0.1';function getSeconds(_0x5f063a,_0x20c301){var _0xae0067=moment(_0x5f063a)[_0xd686('0x7')](0x0);var _0x9a0602=moment(_0x20c301)['milliseconds'](0x0);return _0xae0067[_0xd686('0x8')](_0x9a0602,_0xd686('0x9'));}exports[_0xd686('0xa')]=function(_0x56dcf0){return function(_0x2c0888){logger['error'](_0x56dcf0,util[_0xd686('0xb')](_0x2c0888,{'showHidden':![],'depth':null}));};};exports[_0xd686('0xc')]=function(_0x571be7,_0xa5604){logger[_0xd686('0xd')](_0x571be7,util[_0xd686('0xb')](_0xa5604,{'showHidden':![],'depth':null}));};exports[_0xd686('0xe')]=function(_0x58a20f,_0x329b56){logger[_0xd686('0xf')](_0x58a20f,util[_0xd686('0xb')](_0x329b56,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x410441){return function(_0x5cdb52){logger[_0xd686('0xd')](_0x410441,util[_0xd686('0xb')](_0x5cdb52,{'showHidden':![],'depth':null}));};};exports[_0xd686('0x10')]=function(_0x407878,_0x12e78e,_0x3dc666){return{'message':_0x407878,'unlock':_0x12e78e,'active':_0x3dc666};};exports[_0xd686('0x11')]=function(_0x25d3b7,_0x33c276,_0x240085){if(!_[_0xd686('0x12')](_0x240085)&&_0xd686('0x13')===typeof _0x240085&&!_['isEmpty'](_0x240085)){if(!_[_0xd686('0x12')](_0x33c276)&&_0xd686('0x13')===typeof _0x33c276&&!_['isEmpty'](_0x33c276)){return util[_0xd686('0x14')](_0xd686('0x15'),_0x33c276,_0x240085);}return util[_0xd686('0x14')](_0xd686('0x15'),_0x240085,_0x240085);}if(!_[_0xd686('0x12')](_0x25d3b7)&&_0xd686('0x13')===typeof _0x25d3b7&&!_[_0xd686('0x16')](_0x25d3b7)){return _0x25d3b7;}return _0xd686('0x17');};exports['isActive']=function(_0x2f6f67){if(_['isNil'](_0x2f6f67)){return![];}return _0x2f6f67;};exports[_0xd686('0x18')]=function(_0x56a82f,_0x165ae4,_0x53f35e,_0x22474f,_0x375696,_0x30aeb3){var _0x672fe9={'XMD-QUEUE':_0x165ae4[_0xd686('0x19')]?_0x165ae4[_0xd686('0x19')]['name']:'','XMD-CALLERID':_0x22474f,'XMD-CALLERID-PREVIEW':_0x30aeb3?util[_0xd686('0x14')](_0xd686('0x15'),_0x30aeb3['calleridname'],_0x30aeb3[_0xd686('0x1a')]):_0x22474f,'XMD-DIALID':_0x375696,'XMD-CONTACTID':_0x165ae4[_0xd686('0x1b')],'XMD-CDRTYPE':_0xd686('0x1c'),'CALLERID(all)':_0x22474f,'XMD-VOICEQUEUEID':_0x165ae4[_0xd686('0x1d')],'XMD-DIALCHANNEL':_0x53f35e,'XMD-DIALTIMEOUT':_0x56a82f[_0xd686('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xd686('0x14')](_0xd686('0x1f'),_0x56a82f[_0xd686('0x20')]?'g':'',_[_0xd686('0x16')](_0x56a82f[_0xd686('0x21')])?'':_0xd686('0x22')),'XMD-DIALURL':_0x56a82f[_0xd686('0x23')]||'','XMD-AGI':_0x56a82f[_0xd686('0x24')]?util[_0xd686('0x14')](_0xd686('0x25'),ipAgi,_0x56a82f[_0xd686('0x24')]):_0xd686('0x26'),'XMD-AGIAFTER':_0x56a82f[_0xd686('0x20')]?util[_0xd686('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x56a82f['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x30aeb3?_0x30aeb3[_0xd686('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x30aeb3?_0x30aeb3['originatecalleridname']:'','XMD-DESTINATION':_0xd686('0x28'),'SIPADDHEADER':_0xd686('0x29')};if(!_[_0xd686('0x16')](_0x56a82f[_0xd686('0x21')])){_0x672fe9[util[_0xd686('0x14')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x56a82f[_0xd686('0x21')];_0x672fe9[util[_0xd686('0x14')]('%s',_0xd686('0x2a'))]=_0x375696;}if(_0x165ae4&&_0x165ae4[_0xd686('0x2b')]){for(var _0x2fabcd in _0x165ae4['Contact']){if(_0x165ae4[_0xd686('0x2b')][_0xd686('0x2c')](_0x2fabcd)){if(!_[_0xd686('0x2d')](_0x165ae4[_0xd686('0x2b')][_0x2fabcd])&&_0x2fabcd!=='id'&&_0x2fabcd!==_0xd686('0x2e')&&_0x2fabcd!==_0xd686('0x2f')&&_0x2fabcd!==_0xd686('0x30')){_0x672fe9[util[_0xd686('0x14')](_0xd686('0x31'),'XMD-',_[_0xd686('0x32')](_0x2fabcd))]=_0x165ae4['Contact'][_0x2fabcd];}}}}return _0x672fe9;};exports['toLowerVariables']=function(_0x5e096f){var _0x2aeb9f={};for(var _0x2f0fe7 in _0x5e096f){if(_0x5e096f[_0xd686('0x2c')](_0x2f0fe7)){_0x2aeb9f[util[_0xd686('0x14')]('%s',_['toLower'](_0x2f0fe7))]=_0x5e096f[_0x2f0fe7];}}return{'variables':_0x2aeb9f};};exports[_0xd686('0x33')]=function(_0x502427,_0x2daccf){if(!_[_0xd686('0x2d')](_0x502427)){if(_0x502427[_0xd686('0x2c')]('originated')){if(_0x502427[_0xd686('0x34')]>0x0){_0x502427[_0xd686('0x34')]-=0x1;}else{logger['error'](_0xd686('0x35'),_0x2daccf);}}}else{logger[_0xd686('0xf')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2daccf);}};exports[_0xd686('0x36')]=function(_0x26d225){var _0x17c7e4=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x26d225['state']=0xd;_0x26d225[_0xd686('0x37')]=_0xd686('0x38');_0x26d225['starttime']=_0x17c7e4;_0x26d225[_0xd686('0x39')]=_0x17c7e4;_0x26d225[_0xd686('0x3a')]=_0x17c7e4;};exports[_0xd686('0x3b')]=function(_0x4fd6e9,_0x31e9bf,_0x54d69b){var _0x208b3b=moment()[_0xd686('0x14')](_0xd686('0x3c'));_0x4fd6e9[_0xd686('0x3d')]=_0x31e9bf;_0x4fd6e9[_0xd686('0x37')]=_0x54d69b;_0x4fd6e9[_0xd686('0x39')]=_0x208b3b;_0x4fd6e9[_0xd686('0x3e')]=getSeconds(_0x4fd6e9[_0xd686('0x39')],_0x4fd6e9['starttime']);};exports[_0xd686('0x3f')]=function(_0x1ef84a,_0x1c5405,_0x119d40){_0x1ef84a[_0xd686('0x40')]=_0x1c5405;_0x1ef84a[_0xd686('0x41')]=_0x119d40;};exports['logCustomer']=function(_0x2302fe,_0x2a9da6,_0x2bf9c7){var _0xd19cfd=moment()[_0xd686('0x14')](_0xd686('0x3c'));_0x2302fe[_0xd686('0x3d')]=_0x2a9da6;_0x2302fe[_0xd686('0x37')]=_0x2bf9c7;_0x2302fe['responsetime']=_0x2302fe[_0xd686('0x39')]?_0x2302fe[_0xd686('0x39')]:_0xd19cfd;_0x2302fe[_0xd686('0x3a')]=_0x2302fe[_0xd686('0x3a')]?_0x2302fe[_0xd686('0x3a')]:_0xd19cfd;_0x2302fe['ringtime']=getSeconds(_0x2302fe[_0xd686('0x39')]||0x0,_0x2302fe[_0xd686('0x42')]||0x0);_0x2302fe['talktime']=_0x2302fe[_0xd686('0x43')]?getSeconds(_0x2302fe[_0xd686('0x3a')],_0x2302fe[_0xd686('0x43')]):0x0;};exports[_0xd686('0x44')]=function(_0x570c27){return _0x570c27===_0xd686('0x45');};exports['variablesAction']=function(_0xefbb75,_0x338692,_0x273b9e,_0x1be918,_0x159d1b){var _0xd0ae7b=_0x1be918?_0xd686('0x46'):_0xefbb75[_0xd686('0x47')];_0xd0ae7b=_0x159d1b?'BOOKED':_0xd0ae7b;return{'actionid':_0xefbb75[_0xd686('0x48')],'action':_0xd686('0x49'),'channel':_0xefbb75[_0xd686('0x4a')],'callerid':util[_0xd686('0x14')](_0xd686('0x15'),_0xd0ae7b,_0xefbb75[_0xd686('0x1a')]),'Exten':_0xd686('0x28'),'Context':'from-sip','Priority':'1','variable':_0x273b9e,'timeout':(_0x338692[_0xd686('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0xefbb75[_0xd686('0x48')]};};exports[_0xd686('0x4c')]=function(_0x4d3fd5){return _0x4d3fd5[_0xd686('0x4d')]+_0x4d3fd5[_0xd686('0x4e')]+_0x4d3fd5[_0xd686('0x4f')]+_0x4d3fd5[_0xd686('0x50')]+_0x4d3fd5[_0xd686('0x51')];};exports[_0xd686('0x52')]=function(_0x432710){var _0x39ef65=_['clone'](_0x432710);_0x39ef65[_0xd686('0x3d')]=0xf;_0x39ef65['statedesc']=_0xd686('0x53');return _0x39ef65;};exports['scheduledAt']=function(_0x28e84f,_0x1db3d4,_0x1d727c){var _0x103fe8={};_0x103fe8[_0x1db3d4]=_0x28e84f[_0x1db3d4];_0x103fe8[_0xd686('0x54')]=![];_0x103fe8[_0xd686('0x55')]=moment()[_0xd686('0x56')](_0x1d727c,_0xd686('0x57'))[_0xd686('0x14')](_0xd686('0x3c'));_0x103fe8[_0xd686('0x1b')]=_0x28e84f[_0xd686('0x1b')];_0x103fe8[_0xd686('0x58')]=_0x28e84f[_0xd686('0x58')];_0x103fe8['VoiceQueueId']=_0x28e84f['VoiceQueueId']||undefined;return _0x103fe8;};exports[_0xd686('0x59')]=function(_0x4f6733,_0xe6afd2){if(!_['isNil'](_0x4f6733)){if(_0x4f6733[_0xd686('0x5a')]>0x0){_0x4f6733['pTalking']-=0x1;}else{logger[_0xd686('0xf')](_0xe6afd2,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xd686('0xf')](_0xe6afd2,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x4d1210){if(_0x4d1210<=0x0){return!![];}return![];};exports[_0xd686('0x5b')]=function(_0x3ef9c0,_0x16a7c6,_0x188415){_0x3ef9c0[_0xd686('0x5c')]=_0x16a7c6;_0x3ef9c0['name']=_0x3ef9c0[_0xd686('0x5d')];_0x3ef9c0[_0xd686('0x5e')]=_0x3ef9c0[_0xd686('0x4a')];_0x3ef9c0[_0xd686('0x5f')]=_0xd686('0x60');if(_0x188415){_0x3ef9c0[_0xd686('0x61')]=_0x188415['mandatoryDisposition'];}return _0x3ef9c0;};exports['buildAcw']=function(_0x153e53){var _0x3ec84f={};_0x3ec84f[_0xd686('0x5d')]=_0x153e53[_0xd686('0x5d')];_0x3ec84f['interface']=_0x153e53['channelAgent'];_0x3ec84f[_0xd686('0x48')]=_0x153e53[_0xd686('0x48')];return _0x3ec84f;};exports['agentReadyId']=function(_0x5025fe){var _0xb3a94=[];for(var _0x39fbf8 in _0x5025fe){if(_0x5025fe[_0xd686('0x2c')](_0x39fbf8)){if(!_['isNil'](_0x5025fe[_0x39fbf8])&&_0x5025fe[_0x39fbf8][_0xd686('0x3d')]===_0xd686('0x62')&&_0x5025fe[_0x39fbf8]['status']===_0xd686('0x63')){_0xb3a94[_0xd686('0x64')](_0x5025fe[_0x39fbf8]['id']);}}}return _0xb3a94;};exports[_0xd686('0x65')]=function(_0xda14){var _0x1cf6c6=moment()[_0xd686('0x7')](0x0);var _0x10bc47=moment(_0xda14)[_0xd686('0x7')](0x0);return _0x1cf6c6[_0xd686('0x8')](_0x10bc47,'seconds');};exports[_0xd686('0x66')]=function(_0x1d91ae){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1d91ae[_0xd686('0x1b')],'ListId':_0x1d91ae['ListId'],'VoiceQueueId':_0x1d91ae[_0xd686('0x1d')]||undefined,'CampaignId':_0x1d91ae[_0xd686('0x67')]||undefined};};exports[_0xd686('0x68')]=function(_0x4b3a2f){if(_0x4b3a2f===_0xd686('0x48')||_0x4b3a2f===_0xd686('0x69')||_0x4b3a2f===_0xd686('0x5d')||_0x4b3a2f===_0xd686('0x6a')||_0x4b3a2f===_0xd686('0x6b')||_0x4b3a2f===_0xd686('0x6c')||_0x4b3a2f===_0xd686('0x40')||_0x4b3a2f===_0xd686('0x4a')||_0x4b3a2f==='calleridname'||_0x4b3a2f===_0xd686('0x54')||_0x4b3a2f===_0xd686('0x1a')||_0x4b3a2f==='scheduledat'||_0x4b3a2f===_0xd686('0x4d')||_0x4b3a2f===_0xd686('0x4e')||_0x4b3a2f===_0xd686('0x4f')||_0x4b3a2f===_0xd686('0x6d')||_0x4b3a2f==='callback'||_0x4b3a2f==='callbackuniqueid'||_0x4b3a2f==='callbackat'||_0x4b3a2f===_0xd686('0x6e')||_0x4b3a2f===_0xd686('0x1b')||_0x4b3a2f===_0xd686('0x58')||_0x4b3a2f===_0xd686('0x41')||_0x4b3a2f===_0xd686('0x1d')||_0x4b3a2f==='sipcallid'||_0x4b3a2f===_0xd686('0x6f')||_0x4b3a2f===_0xd686('0x70')||_0x4b3a2f===_0xd686('0x71')||_0x4b3a2f==='xmd-listid'||_0x4b3a2f===_0xd686('0x72')||_0x4b3a2f==='xmd-dialtimeout'||_0x4b3a2f===_0xd686('0x73')||_0x4b3a2f===_0xd686('0x74')||_0x4b3a2f===_0xd686('0x75')||_0x4b3a2f===_0xd686('0x76')||_0x4b3a2f===_0xd686('0x77')||_0x4b3a2f===_0xd686('0x78')||_0x4b3a2f===_0xd686('0x79')||_0x4b3a2f===_0xd686('0x7a')||_0x4b3a2f===_0xd686('0x7b')||_0x4b3a2f===_0xd686('0x7c')||_0x4b3a2f==='rtpaudioqosjitter'||_0x4b3a2f===_0xd686('0x7d')||_0x4b3a2f==='rtpaudioqosloss'||_0x4b3a2f===_0xd686('0x7e')||_0x4b3a2f==='rtpaudioqosrtt'||_0x4b3a2f===_0xd686('0x7f')||_0x4b3a2f===_0xd686('0x7b')||_0x4b3a2f==='rtpaudioqosbridged'||_0x4b3a2f==='rtpaudioqosjitter'||_0x4b3a2f==='rtpaudioqosjitterbridged'||_0x4b3a2f===_0xd686('0x80')||_0x4b3a2f===_0xd686('0x7e')||_0x4b3a2f===_0xd686('0x81')||_0x4b3a2f==='rtpaudioqosrttbridged'||_0x4b3a2f===_0xd686('0x82')||_0x4b3a2f===_0xd686('0x83')||_0x4b3a2f===_0xd686('0x3d')||_0x4b3a2f===_0xd686('0x37')){return![];}return!![];};exports[_0xd686('0x84')]=function(_0x4747d9,_0x24a4d5){var _0x367ec3,_0x479a89,_0x4eae73;if(_0x24a4d5<=0x0){_0x24a4d5=0x1;}_0x367ec3=new RegExp(_0xd686('0x85')+_0x24a4d5+'}$');_0x479a89=Math['pow'](0xa,_0x24a4d5-0x1);_0x4eae73=Math['pow'](0xa,_0x24a4d5)-0x1;return util[_0xd686('0x14')]('%s',_[_0xd686('0x86')](_0x4747d9,_0x367ec3,_[_0xd686('0x87')](_0x479a89,_0x4eae73)));};exports[_0xd686('0x88')]=function(_0x4cb153){var _0x5d876d=_0x4cb153['match'](/"(.*?)"/);return _0x5d876d?_0x5d876d[0x1]:_0x4cb153;};exports[_0xd686('0x89')]=function(_0x4533ea){var _0x3b83c9=_0x4533ea['match'](/<(.*?)>/);return _0x3b83c9?_0x3b83c9[0x1]:_0x4533ea;};
\ No newline at end of file
+var _0x6bf3=['xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','loggerError','logger2','info','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','active','scheduledat','add','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','push','getDiff','createBody','CampaignId','filterKey','idContact','type','dialAnswer','membername','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid'];(function(_0x2adf4,_0x5df6de){var _0x45d47d=function(_0x903910){while(--_0x903910){_0x2adf4['push'](_0x2adf4['shift']());}};_0x45d47d(++_0x5df6de);}(_0x6bf3,0xa4));var _0x36bf=function(_0x2bdcf0,_0x141a1a){_0x2bdcf0=_0x2bdcf0-0x0;var _0x2a9d3f=_0x6bf3[_0x2bdcf0];return _0x2a9d3f;};'use strict';var util=require(_0x36bf('0x0'));var _=require(_0x36bf('0x1'));var moment=require(_0x36bf('0x2'));var logger=require(_0x36bf('0x3'))(_0x36bf('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x36bf('0x5');function getSeconds(_0x53f28b,_0x376e66){var _0x50bf87=moment(_0x53f28b)[_0x36bf('0x6')](0x0);var _0x1686be=moment(_0x376e66)[_0x36bf('0x6')](0x0);return _0x50bf87[_0x36bf('0x7')](_0x1686be,_0x36bf('0x8'));}exports[_0x36bf('0x9')]=function(_0x639223){return function(_0x13dbff){logger[_0x36bf('0xa')](_0x639223,util['inspect'](_0x13dbff,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x155fa1,_0x1e81bd){logger['info'](_0x155fa1,util[_0x36bf('0xb')](_0x1e81bd,{'showHidden':![],'depth':null}));};exports[_0x36bf('0xc')]=function(_0x672fda,_0x365016){logger['error'](_0x672fda,util[_0x36bf('0xb')](_0x365016,{'showHidden':![],'depth':null}));};exports[_0x36bf('0xd')]=function(_0x137f33){return function(_0x4a90b0){logger[_0x36bf('0xe')](_0x137f33,util[_0x36bf('0xb')](_0x4a90b0,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xcd10a2,_0x2db981,_0x51ddc7){return{'message':_0xcd10a2,'unlock':_0x2db981,'active':_0x51ddc7};};exports[_0x36bf('0xf')]=function(_0x3629c5,_0x5064f6,_0x37490a){if(!_['isUndefined'](_0x37490a)&&_0x36bf('0x10')===typeof _0x37490a&&!_[_0x36bf('0x11')](_0x37490a)){if(!_[_0x36bf('0x12')](_0x5064f6)&&'string'===typeof _0x5064f6&&!_[_0x36bf('0x11')](_0x5064f6)){return util['format'](_0x36bf('0x13'),_0x5064f6,_0x37490a);}return util[_0x36bf('0x14')](_0x36bf('0x13'),_0x37490a,_0x37490a);}if(!_[_0x36bf('0x12')](_0x3629c5)&&_0x36bf('0x10')===typeof _0x3629c5&&!_[_0x36bf('0x11')](_0x3629c5)){return _0x3629c5;}return _0x36bf('0x15');};exports[_0x36bf('0x16')]=function(_0x2dbcd5){if(_[_0x36bf('0x17')](_0x2dbcd5)){return![];}return _0x2dbcd5;};exports[_0x36bf('0x18')]=function(_0x294c79,_0x1441a1,_0xe8783b,_0x3916ee,_0x2a0acb,_0x298bab){var _0x28ba62={'XMD-QUEUE':_0x1441a1[_0x36bf('0x19')]?_0x1441a1['Queue']['name']:'','XMD-CALLERID':_0x3916ee,'XMD-CALLERID-PREVIEW':_0x298bab?util[_0x36bf('0x14')](_0x36bf('0x13'),_0x298bab[_0x36bf('0x1a')],_0x298bab[_0x36bf('0x1b')]):_0x3916ee,'XMD-DIALID':_0x2a0acb,'XMD-CONTACTID':_0x1441a1[_0x36bf('0x1c')],'XMD-CDRTYPE':_0x36bf('0x1d'),'CALLERID(all)':_0x3916ee,'XMD-VOICEQUEUEID':_0x1441a1[_0x36bf('0x1e')],'XMD-DIALCHANNEL':_0xe8783b,'XMD-DIALTIMEOUT':_0x294c79[_0x36bf('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x36bf('0x14')](_0x36bf('0x20'),_0x294c79[_0x36bf('0x21')]?'g':'',_[_0x36bf('0x11')](_0x294c79['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x294c79[_0x36bf('0x22')]||'','XMD-AGI':_0x294c79['dialQueueProject']?util['format'](_0x36bf('0x23'),ipAgi,_0x294c79[_0x36bf('0x24')]):_0x36bf('0x25'),'XMD-AGIAFTER':_0x294c79[_0x36bf('0x21')]?util[_0x36bf('0x14')](_0x36bf('0x23'),ipAgi,_0x294c79['dialQueueProject2']):_0x36bf('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x298bab?_0x298bab['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x298bab?_0x298bab[_0x36bf('0x26')]:'','XMD-DESTINATION':_0x36bf('0x27'),'SIPADDHEADER':_0x36bf('0x28')};if(!_['isEmpty'](_0x294c79['monitor_format'])){_0x28ba62[util[_0x36bf('0x14')]('%s',_0x36bf('0x29'))]=_0x294c79[_0x36bf('0x2a')];_0x28ba62[util[_0x36bf('0x14')]('%s',_0x36bf('0x2b'))]=_0x2a0acb;}if(_0x1441a1&&_0x1441a1[_0x36bf('0x2c')]){for(var _0x248036 in _0x1441a1['Contact']){if(_0x1441a1['Contact'][_0x36bf('0x2d')](_0x248036)){if(!_['isNil'](_0x1441a1['Contact'][_0x248036])&&_0x248036!=='id'&&_0x248036!==_0x36bf('0x2e')&&_0x248036!==_0x36bf('0x2f')&&_0x248036!==_0x36bf('0x30')){_0x28ba62[util[_0x36bf('0x14')](_0x36bf('0x31'),_0x36bf('0x32'),_[_0x36bf('0x33')](_0x248036))]=_0x1441a1[_0x36bf('0x2c')][_0x248036];}}}}return _0x28ba62;};exports[_0x36bf('0x34')]=function(_0x56763b){var _0x51c3df={};for(var _0x1d557c in _0x56763b){if(_0x56763b['hasOwnProperty'](_0x1d557c)){_0x51c3df[util[_0x36bf('0x14')]('%s',_[_0x36bf('0x35')](_0x1d557c))]=_0x56763b[_0x1d557c];}}return{'variables':_0x51c3df};};exports[_0x36bf('0x36')]=function(_0x1dc39b,_0x66e246){if(!_[_0x36bf('0x17')](_0x1dc39b)){if(_0x1dc39b[_0x36bf('0x2d')](_0x36bf('0x37'))){if(_0x1dc39b[_0x36bf('0x37')]>0x0){_0x1dc39b[_0x36bf('0x37')]-=0x1;}else{logger['error'](_0x36bf('0x38'),_0x66e246);}}}else{logger[_0x36bf('0xa')](_0x36bf('0x39'),_0x66e246);}};exports[_0x36bf('0x3a')]=function(_0x59c61e){var _0x269252=moment()[_0x36bf('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x59c61e[_0x36bf('0x3b')]=0xd;_0x59c61e[_0x36bf('0x3c')]=_0x36bf('0x3d');_0x59c61e[_0x36bf('0x3e')]=_0x269252;_0x59c61e[_0x36bf('0x3f')]=_0x269252;_0x59c61e[_0x36bf('0x40')]=_0x269252;};exports[_0x36bf('0x41')]=function(_0x4537f3,_0x58cf17,_0x569a9e){var _0xf27b5f=moment()[_0x36bf('0x14')](_0x36bf('0x42'));_0x4537f3[_0x36bf('0x3b')]=_0x58cf17;_0x4537f3[_0x36bf('0x3c')]=_0x569a9e;_0x4537f3[_0x36bf('0x3f')]=_0xf27b5f;_0x4537f3[_0x36bf('0x43')]=getSeconds(_0x4537f3['responsetime'],_0x4537f3[_0x36bf('0x3e')]);};exports[_0x36bf('0x44')]=function(_0x25334d,_0x54f05a,_0x20c8f2){_0x25334d['membername']=_0x54f05a;_0x25334d[_0x36bf('0x45')]=_0x20c8f2;};exports['logCustomer']=function(_0xa59609,_0x409350,_0x13f12b){var _0x4b8bf0=moment()[_0x36bf('0x14')](_0x36bf('0x42'));_0xa59609[_0x36bf('0x3b')]=_0x409350;_0xa59609['statedesc']=_0x13f12b;_0xa59609[_0x36bf('0x3f')]=_0xa59609['responsetime']?_0xa59609[_0x36bf('0x3f')]:_0x4b8bf0;_0xa59609[_0x36bf('0x40')]=_0xa59609[_0x36bf('0x40')]?_0xa59609[_0x36bf('0x40')]:_0x4b8bf0;_0xa59609[_0x36bf('0x43')]=getSeconds(_0xa59609['responsetime']||0x0,_0xa59609[_0x36bf('0x3e')]||0x0);_0xa59609[_0x36bf('0x46')]=_0xa59609[_0x36bf('0x47')]?getSeconds(_0xa59609[_0x36bf('0x40')],_0xa59609[_0x36bf('0x47')]):0x0;};exports[_0x36bf('0x48')]=function(_0x162ca4){return _0x162ca4===_0x36bf('0x49');};exports[_0x36bf('0x4a')]=function(_0x28be30,_0x47d62d,_0x34b55e,_0x33ddbc,_0x2c50a5){var _0x531ba0=_0x33ddbc?_0x36bf('0x4b'):_0x28be30[_0x36bf('0x1a')];_0x531ba0=_0x2c50a5?'BOOKED':_0x531ba0;return{'actionid':_0x28be30[_0x36bf('0x4c')],'action':_0x36bf('0x4d'),'channel':_0x28be30[_0x36bf('0x4e')],'callerid':util[_0x36bf('0x14')](_0x36bf('0x13'),_0x531ba0,_0x28be30[_0x36bf('0x1b')]),'Exten':_0x36bf('0x27'),'Context':_0x36bf('0x4f'),'Priority':'1','variable':_0x34b55e,'timeout':(_0x47d62d[_0x36bf('0x50')]||0x1e)*0x3e8,'async':!![],'channelid':_0x28be30[_0x36bf('0x4c')]};};exports['totalGlobal']=function(_0x1fc74e){return _0x1fc74e['countbusyretry']+_0x1fc74e['countcongestionretry']+_0x1fc74e[_0x36bf('0x51')]+_0x1fc74e[_0x36bf('0x52')]+_0x1fc74e['countnosuchnumberretry'];};exports[_0x36bf('0x53')]=function(_0x5248eb){var _0x5edda4=_[_0x36bf('0x54')](_0x5248eb);_0x5edda4[_0x36bf('0x3b')]=0xf;_0x5edda4[_0x36bf('0x3c')]=_0x36bf('0x55');return _0x5edda4;};exports['scheduledAt']=function(_0x410abe,_0x52ec96,_0x1eceff){var _0x220982={};_0x220982[_0x52ec96]=_0x410abe[_0x52ec96];_0x220982[_0x36bf('0x56')]=![];_0x220982[_0x36bf('0x57')]=moment()[_0x36bf('0x58')](_0x1eceff,'minutes')[_0x36bf('0x14')](_0x36bf('0x42'));_0x220982['ContactId']=_0x410abe[_0x36bf('0x1c')];_0x220982[_0x36bf('0x59')]=_0x410abe['ListId'];_0x220982[_0x36bf('0x1e')]=_0x410abe[_0x36bf('0x1e')]||undefined;return _0x220982;};exports[_0x36bf('0x5a')]=function(_0x1dc8c9,_0x5c8329){if(!_[_0x36bf('0x17')](_0x1dc8c9)){if(_0x1dc8c9['pTalking']>0x0){_0x1dc8c9['pTalking']-=0x1;}else{logger[_0x36bf('0xa')](_0x5c8329,_0x36bf('0x5b'));}}else{logger[_0x36bf('0xa')](_0x5c8329,_0x36bf('0x5c'));}};exports[_0x36bf('0x5d')]=function(_0x378922){if(_0x378922<=0x0){return!![];}return![];};exports[_0x36bf('0x5e')]=function(_0x38d867,_0x4eb09f,_0x3a2f8b){_0x38d867[_0x36bf('0x5f')]=_0x4eb09f;_0x38d867['name']=_0x38d867[_0x36bf('0x60')];_0x38d867[_0x36bf('0x61')]=_0x38d867['channelAgent'];_0x38d867['motionChannel']=_0x36bf('0x62');if(_0x3a2f8b){_0x38d867['mandatoryDisposition']=_0x3a2f8b[_0x36bf('0x63')];}return _0x38d867;};exports[_0x36bf('0x64')]=function(_0x224e97){var _0x2dde8e={};_0x2dde8e[_0x36bf('0x60')]=_0x224e97[_0x36bf('0x60')];_0x2dde8e['interface']=_0x224e97[_0x36bf('0x4e')];_0x2dde8e[_0x36bf('0x4c')]=_0x224e97['uniqueid'];return _0x2dde8e;};exports[_0x36bf('0x65')]=function(_0x41a94f){var _0x208277=[];for(var _0x52ac9d in _0x41a94f){if(_0x41a94f['hasOwnProperty'](_0x52ac9d)){if(!_['isNil'](_0x41a94f[_0x52ac9d])&&_0x41a94f[_0x52ac9d][_0x36bf('0x3b')]===_0x36bf('0x66')&&_0x41a94f[_0x52ac9d][_0x36bf('0x67')]==='reachable'){_0x208277[_0x36bf('0x68')](_0x41a94f[_0x52ac9d]['id']);}}}return _0x208277;};exports[_0x36bf('0x69')]=function(_0x814546){var _0x10b32c=moment()[_0x36bf('0x6')](0x0);var _0x132ba1=moment(_0x814546)[_0x36bf('0x6')](0x0);return _0x10b32c[_0x36bf('0x7')](_0x132ba1,_0x36bf('0x8'));};exports[_0x36bf('0x6a')]=function(_0x40d210){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x40d210[_0x36bf('0x1c')],'ListId':_0x40d210[_0x36bf('0x59')],'VoiceQueueId':_0x40d210['VoiceQueueId']||undefined,'CampaignId':_0x40d210[_0x36bf('0x6b')]||undefined};};exports[_0x36bf('0x6c')]=function(_0x50f1cb){if(_0x50f1cb==='uniqueid'||_0x50f1cb===_0x36bf('0x6d')||_0x50f1cb==='queue'||_0x50f1cb===_0x36bf('0x6e')||_0x50f1cb==='campaigntype'||_0x50f1cb===_0x36bf('0x6f')||_0x50f1cb===_0x36bf('0x70')||_0x50f1cb===_0x36bf('0x4e')||_0x50f1cb===_0x36bf('0x1a')||_0x50f1cb===_0x36bf('0x56')||_0x50f1cb===_0x36bf('0x1b')||_0x50f1cb===_0x36bf('0x57')||_0x50f1cb==='countbusyretry'||_0x50f1cb==='countcongestionretry'||_0x50f1cb===_0x36bf('0x51')||_0x50f1cb==='countglobal'||_0x50f1cb===_0x36bf('0x71')||_0x50f1cb==='callbackuniqueid'||_0x50f1cb===_0x36bf('0x72')||_0x50f1cb===_0x36bf('0x73')||_0x50f1cb===_0x36bf('0x1c')||_0x50f1cb===_0x36bf('0x59')||_0x50f1cb===_0x36bf('0x45')||_0x50f1cb===_0x36bf('0x1e')||_0x50f1cb===_0x36bf('0x74')||_0x50f1cb===_0x36bf('0x75')||_0x50f1cb===_0x36bf('0x76')||_0x50f1cb===_0x36bf('0x77')||_0x50f1cb===_0x36bf('0x78')||_0x50f1cb===_0x36bf('0x79')||_0x50f1cb===_0x36bf('0x7a')||_0x50f1cb==='xmd-dialoptions'||_0x50f1cb===_0x36bf('0x7b')||_0x50f1cb===_0x36bf('0x7c')||_0x50f1cb===_0x36bf('0x7d')||_0x50f1cb===_0x36bf('0x7e')||_0x50f1cb===_0x36bf('0x7f')||_0x50f1cb===_0x36bf('0x80')||_0x50f1cb===_0x36bf('0x81')||_0x50f1cb===_0x36bf('0x82')||_0x50f1cb===_0x36bf('0x83')||_0x50f1cb===_0x36bf('0x84')||_0x50f1cb==='rtpaudioqosjitterbridged'||_0x50f1cb===_0x36bf('0x85')||_0x50f1cb===_0x36bf('0x86')||_0x50f1cb===_0x36bf('0x87')||_0x50f1cb===_0x36bf('0x88')||_0x50f1cb===_0x36bf('0x82')||_0x50f1cb===_0x36bf('0x83')||_0x50f1cb===_0x36bf('0x84')||_0x50f1cb===_0x36bf('0x89')||_0x50f1cb===_0x36bf('0x85')||_0x50f1cb===_0x36bf('0x86')||_0x50f1cb===_0x36bf('0x87')||_0x50f1cb===_0x36bf('0x88')||_0x50f1cb===_0x36bf('0x8a')||_0x50f1cb==='bridgepvtcallid'||_0x50f1cb===_0x36bf('0x3b')||_0x50f1cb===_0x36bf('0x3c')){return![];}return!![];};exports[_0x36bf('0x8b')]=function(_0x59556d,_0x596d44){var _0x472bc8,_0x3554b0,_0x39ad52;if(_0x596d44<=0x0){_0x596d44=0x1;}_0x472bc8=new RegExp(_0x36bf('0x8c')+_0x596d44+'}$');_0x3554b0=Math[_0x36bf('0x8d')](0xa,_0x596d44-0x1);_0x39ad52=Math['pow'](0xa,_0x596d44)-0x1;return util['format']('%s',_[_0x36bf('0x8e')](_0x59556d,_0x472bc8,_['random'](_0x3554b0,_0x39ad52)));};exports[_0x36bf('0x8f')]=function(_0xd7d232){var _0x2b76fe=_0xd7d232['match'](/"(.*?)"/);return _0x2b76fe?_0x2b76fe[0x1]:_0xd7d232;};exports[_0x36bf('0x90')]=function(_0x5f2527){var _0x40ecdd=_0x5f2527['match'](/<(.*?)>/);return _0x40ecdd?_0x40ecdd[0x1]:_0x5f2527;};
\ No newline at end of file
index c985e9b..d83fcca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x426d=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','reload','voicechannel'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x426d,0xa9));var _0xd426=function(_0x2efd96,_0x55259f){_0x2efd96=_0x2efd96-0x0;var _0x18e023=_0x426d[_0x2efd96];return _0x18e023;};'use strict';exports[_0xd426('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xd426('0x1'),'required':!![]},'membername':{'type':_0xd426('0x1'),'required':!![]},'penalty':{'type':_0xd426('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xd426('0x3')]={'queue':{'type':_0xd426('0x1'),'required':!![]},'interface':{'type':_0xd426('0x1'),'required':!![]}};exports[_0xd426('0x4')]={'interface':{'type':_0xd426('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0xd426('0x5')]={'module':{'type':_0xd426('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xd426('0x1'),'required':!![]}};exports[_0xd426('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd426('0x1')},'format':{'type':_0xd426('0x1')},'mixmonitorid':{'type':_0xd426('0x1')}};exports[_0xd426('0x7')]={'uniqueid':{'type':_0xd426('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xd426('0x1'),'required':!![]},'exten':{'type':_0xd426('0x1'),'required':!![]},'context':{'type':_0xd426('0x1')}};
\ No newline at end of file
+var _0x2c59=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c59,0x142));var _0x92c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c59[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0x92c5('0x0')]={'queue':{'type':_0x92c5('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x92c5('0x1'),'required':!![]},'penalty':{'type':_0x92c5('0x2'),'required':![]},'paused':{'type':_0x92c5('0x3'),'required':![]}};exports[_0x92c5('0x4')]={'queue':{'type':_0x92c5('0x1'),'required':!![]},'interface':{'type':_0x92c5('0x1'),'required':!![]}};exports[_0x92c5('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x92c5('0x1'),'required':![]}};exports[_0x92c5('0x6')]={'module':{'type':_0x92c5('0x1'),'required':![]}};exports[_0x92c5('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x92c5('0x8')]={'uniqueid':{'type':_0x92c5('0x1'),'required':!![]},'filename':{'type':_0x92c5('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x92c5('0x1')}};exports[_0x92c5('0x9')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x92c5('0xa')]={'uniqueid':{'type':_0x92c5('0x1'),'required':!![]},'exten':{'type':_0x92c5('0x1'),'required':!![]},'context':{'type':_0x92c5('0x1')}};
\ No newline at end of file
index f7769bc..5190ce5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x648e=['queueStatusComplete','mergeFromDatabase','prototype','initAgents','name','initTelephones','telephones','length','isUndefined','initTrunks','initTriggers','initTemplates','templates','initZendeskAccounts','salesforceAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','deskAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','total','queuecallercompleteAt','initVoiceCallReports','outbound','duration','ANSWERED','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay'];(function(_0x3d870c,_0x479b79){var _0x129f08=function(_0x2165d4){while(--_0x2165d4){_0x3d870c['push'](_0x3d870c['shift']());}};_0x129f08(++_0x479b79);}(_0x648e,0x1ce));var _0xe648=function(_0xc7eef0,_0x506a49){_0xc7eef0=_0xc7eef0-0x0;var _0x5590cb=_0x648e[_0xc7eef0];return _0x5590cb;};'use strict';var BPromise=require('bluebird');var util=require(_0xe648('0x0'));var _=require(_0xe648('0x1'));var moment=require(_0xe648('0x2'));var Agent=require(_0xe648('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xe648('0x4'));var VoiceQueue=require(_0xe648('0x5'));var Trigger=require(_0xe648('0x6'));var Template=require(_0xe648('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xe648('0x8'));var ZendeskAccount=require(_0xe648('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xe648('0xa'));var SugarcrmAccount=require(_0xe648('0xb'));var ZohoAccount=require(_0xe648('0xc'));var DeskAccount=require(_0xe648('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xe648('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xe648('0xf'));var Realtime=function(){this[_0xe648('0x10')]={};this['telephones']={};this[_0xe648('0x11')]={};this[_0xe648('0x12')]={};this[_0xe648('0x13')]={};this[_0xe648('0x14')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe648('0x15')]={};this[_0xe648('0x16')]={};this[_0xe648('0x17')]={};this[_0xe648('0x18')]={};this[_0xe648('0x19')]={};this[_0xe648('0x1a')]={};this[_0xe648('0x1b')]={};this['salesforceAccounts']={};this[_0xe648('0x1c')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this['deskAccounts']={};this[_0xe648('0x1d')]={};this[_0xe648('0x1e')]={};this['dynamics365Accounts']={};this[_0xe648('0x1f')]={};this[_0xe648('0x20')]={};};function freeIsNotKey(_0x213174,_0x8969b5,_0x562387){var _0x5ae396=_[_0xe648('0x21')](_0x213174,function(_0x157a5f,_0x44b6a7){return _0x157a5f[_0x562387];});for(var _0x3688e7 in _0x8969b5){if(_0x8969b5[_0xe648('0x22')](_0x3688e7)){if(!_0x5ae396[_0x3688e7]){delete _0x8969b5[_0x3688e7];}}}}function freeIsNotKeySip(_0x29365e,_0x2e2bb3){var _0x420026=_['mapKeys'](_0x29365e,function(_0x4aefd8,_0x1b4e08){return util[_0xe648('0x23')](_0xe648('0x24'),_0x4aefd8['name']);});for(var _0x14f73f in _0x2e2bb3){if(_0x2e2bb3[_0xe648('0x22')](_0x14f73f)){if(!_0x420026[_0x14f73f]){delete _0x2e2bb3[_0x14f73f];}}}}function freeIsNotKeyAgent(_0x30312c,_0x3f636e){var _0x4c12a0=_[_0xe648('0x21')](_0x30312c,function(_0x4191da,_0x35d060){var _0x30164a=_[_0xe648('0x25')](_0x4191da[_0xe648('0x26')])?util['format'](_0xe648('0x24'),_0x4191da['name']):_0x4191da['interface'];return _0x30164a;});for(var _0x354693 in _0x3f636e){if(_0x3f636e['hasOwnProperty'](_0x354693)){if(!_0x4c12a0[_0x354693]){delete _0x3f636e[_0x354693];}}}}function clearVoiceCallReports(_0x566836){_0x566836['total']=0x0;_0x566836[_0xe648('0x27')]=0x0;_0x566836[_0xe648('0x28')]=0x0;_0x566836[_0xe648('0x29')]=0x0;_0x566836[_0xe648('0x2a')]=0x0;}function clearCampaigns(_0x1644e9){if(!_[_0xe648('0x2b')](_0x1644e9)){for(var _0x3b66e4 in _0x1644e9){if(_0x1644e9[_0xe648('0x22')](_0x3b66e4)){_0x1644e9[_0x3b66e4][_0xe648('0x2c')]=0x0;_0x1644e9[_0x3b66e4]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x59fdb8){if(!_[_0xe648('0x2b')](_0x59fdb8)){for(var _0x2437cf in _0x59fdb8){if(_0x59fdb8[_0xe648('0x22')](_0x2437cf)){_0x59fdb8[_0x2437cf]['total']=0x0;_0x59fdb8[_0x2437cf]['answered']=0x0;_0x59fdb8[_0x2437cf]['unmanaged']=0x0;_0x59fdb8[_0x2437cf]['abandoned']=0x0;_0x59fdb8[_0x2437cf]['sumHoldTime']=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x29')]=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x2a')]=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x2d')]=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x2e')]=0x0;_0x59fdb8[_0x2437cf]['outboundBusyCallsDay']=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x2f')]=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x30')]=0x0;_0x59fdb8[_0x2437cf]['outboundUnknownCallsDay']=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x31')]=0x0;_0x59fdb8[_0x2437cf]['outboundDropCallsDayCallersExit']=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x32')]=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x33')]=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x34')]=0x0;_0x59fdb8[_0x2437cf]['outboundReCallsDay']=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x2d')]=0x0;_0x59fdb8[_0x2437cf]['outboundAnswerCallsDay']=0x0;_0x59fdb8[_0x2437cf][_0xe648('0x35')]=!![];}}}}Realtime['prototype'][_0xe648('0x36')]=function(_0x2c1384,_0x202795){for(var _0x4bfafb in _0x202795){if(_0x2c1384[_0xe648('0x22')](_0x4bfafb)){_0x2c1384[_0x4bfafb]=_0x202795[_0x4bfafb];}}};Realtime[_0xe648('0x37')][_0xe648('0x38')]=function(){var _0x5882cd=this;return function(_0x283d7c){if(_0x283d7c){freeIsNotKeyAgent(_0x283d7c,_0x5882cd[_0xe648('0x10')]);for(var _0x27d168=0x0,_0x45727d={},_0x295b8c={};_0x27d168<_0x283d7c['length'];_0x27d168+=0x1){_0x45727d=_0x283d7c[_0x27d168];var _0x5616b9=_[_0xe648('0x25')](_0x45727d[_0xe648('0x26')])?util[_0xe648('0x23')]('SIP/%s',_0x45727d[_0xe648('0x39')]):_0x45727d[_0xe648('0x26')];if(_['isUndefined'](_0x5882cd[_0xe648('0x10')][_0x5616b9])){_0x5882cd[_0xe648('0x10')][_0x5616b9]=new Agent(_0x45727d);}else{_0x5882cd[_0xe648('0x36')](_0x5882cd[_0xe648('0x10')][_0x5616b9],_0x45727d);}}}return _0x5882cd[_0xe648('0x10')];};};Realtime[_0xe648('0x37')][_0xe648('0x3a')]=function(){var _0x22ec4b=this;return function(_0x4a265a){if(_0x4a265a){freeIsNotKeySip(_0x4a265a,_0x22ec4b[_0xe648('0x3b')]);for(var _0x4c91c3=0x0,_0x2b7af3={},_0x5f50e4={};_0x4c91c3<_0x4a265a[_0xe648('0x3c')];_0x4c91c3+=0x1){_0x2b7af3=_0x4a265a[_0x4c91c3];if(_[_0xe648('0x3d')](_0x22ec4b[_0xe648('0x3b')][util[_0xe648('0x23')]('SIP/%s',_0x2b7af3[_0xe648('0x39')])])){_0x22ec4b[_0xe648('0x3b')][util[_0xe648('0x23')](_0xe648('0x24'),_0x2b7af3[_0xe648('0x39')])]=new Telephone(_0x2b7af3);}else{_0x22ec4b[_0xe648('0x36')](_0x22ec4b['telephones'][util[_0xe648('0x23')]('SIP/%s',_0x2b7af3[_0xe648('0x39')])],_0x2b7af3);}}}return _0x22ec4b[_0xe648('0x3b')];};};Realtime[_0xe648('0x37')][_0xe648('0x3e')]=function(){var _0x129899=this;return function(_0x29b4f7){if(_0x29b4f7){freeIsNotKeySip(_0x29b4f7,_0x129899['trunks']);for(var _0x23ded3=0x0,_0x4892f7={},_0x41af18={};_0x23ded3<_0x29b4f7['length'];_0x23ded3+=0x1){_0x4892f7=_0x29b4f7[_0x23ded3];if(_[_0xe648('0x3d')](_0x129899[_0xe648('0x11')][util['format'](_0xe648('0x24'),_0x4892f7[_0xe648('0x39')])])){_0x129899[_0xe648('0x11')][util['format'](_0xe648('0x24'),_0x4892f7['name'])]=new Trunk(_0x4892f7);}else{_0x129899[_0xe648('0x36')](_0x129899[_0xe648('0x11')][util['format'](_0xe648('0x24'),_0x4892f7[_0xe648('0x39')])],_0x4892f7);}}}return _0x129899[_0xe648('0x11')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x24792a=this;return function(_0x14399d){if(_0x14399d){freeIsNotKey(_0x14399d,_0x24792a['voiceQueues'],_0xe648('0x39'));for(var _0x48d0e2=0x0,_0x21b7a5={},_0x546d8f={};_0x48d0e2<_0x14399d[_0xe648('0x3c')];_0x48d0e2+=0x1){_0x21b7a5=_0x14399d[_0x48d0e2];if(_[_0xe648('0x3d')](_0x24792a[_0xe648('0x12')][_0x21b7a5[_0xe648('0x39')]])){_0x24792a['voiceQueues'][_0x21b7a5[_0xe648('0x39')]]=new VoiceQueue(_0x21b7a5);}else{_0x24792a['mergeFromDatabase'](_0x24792a['voiceQueues'][_0x21b7a5['name']],_0x21b7a5);}}}return _0x24792a['voiceQueues'];};};Realtime[_0xe648('0x37')][_0xe648('0x3f')]=function(){var _0x2e6b20=this;return function(_0x2d93af){if(_0x2d93af){freeIsNotKey(_0x2d93af,_0x2e6b20[_0xe648('0x13')],'id');for(var _0x269723=0x0,_0x4e58eb={},_0x349321={};_0x269723<_0x2d93af[_0xe648('0x3c')];_0x269723+=0x1){_0x4e58eb=_0x2d93af[_0x269723];if(_[_0xe648('0x3d')](_0x2e6b20['triggers'][_0x4e58eb['id']])){_0x2e6b20[_0xe648('0x13')][_0x4e58eb['id']]=new Trigger(_0x4e58eb);}else{_0x2e6b20[_0xe648('0x36')](_0x2e6b20['triggers'][_0x4e58eb['id']],_0x4e58eb);}}}return _0x2e6b20[_0xe648('0x13')];};};Realtime[_0xe648('0x37')][_0xe648('0x40')]=function(){var _0x38a59c=this;return function(_0x1d7e33){if(_0x1d7e33){freeIsNotKey(_0x1d7e33,_0x38a59c[_0xe648('0x41')],'id');for(var _0x5d8a2f=0x0,_0x172d48={},_0x28165b={};_0x5d8a2f<_0x1d7e33['length'];_0x5d8a2f+=0x1){_0x172d48=_0x1d7e33[_0x5d8a2f];if(_[_0xe648('0x3d')](_0x38a59c[_0xe648('0x41')][_0x172d48['id']])){_0x38a59c[_0xe648('0x41')][_0x172d48['id']]=new Template(_0x172d48);}else{_0x38a59c['mergeFromDatabase'](_0x38a59c[_0xe648('0x41')][_0x172d48['id']],_0x172d48);}}}return _0x38a59c[_0xe648('0x41')];};};Realtime[_0xe648('0x37')][_0xe648('0x42')]=function(){var _0x213638=this;return function(_0x258a75){if(_0x258a75){freeIsNotKey(_0x258a75,_0x213638[_0xe648('0x1b')],'id');for(var _0x363cd8=0x0,_0x10a722={},_0x4ed21a={};_0x363cd8<_0x258a75['length'];_0x363cd8+=0x1){_0x10a722=_0x258a75[_0x363cd8];if(_[_0xe648('0x3d')](_0x213638[_0xe648('0x1b')][_0x10a722['id']])){_0x213638[_0xe648('0x1b')][_0x10a722['id']]=new ZendeskAccount(_0x10a722);}else{_0x213638[_0xe648('0x36')](_0x213638[_0xe648('0x1b')][_0x10a722['id']],_0x10a722);}}}return _0x213638[_0xe648('0x1b')];};};Realtime[_0xe648('0x37')]['initSalesforceAccounts']=function(){var _0x1584ba=this;return function(_0x4f99e4){if(_0x4f99e4){freeIsNotKey(_0x4f99e4,_0x1584ba[_0xe648('0x43')],'id');for(var _0xe3470c=0x0,_0x5e3e66={},_0x499c4c={};_0xe3470c<_0x4f99e4[_0xe648('0x3c')];_0xe3470c+=0x1){_0x5e3e66=_0x4f99e4[_0xe3470c];if(_['isUndefined'](_0x1584ba['salesforceAccounts'][_0x5e3e66['id']])){_0x1584ba[_0xe648('0x43')][_0x5e3e66['id']]=new SalesforceAccount(_0x5e3e66);}else{_0x1584ba[_0xe648('0x36')](_0x1584ba['salesforceAccounts'][_0x5e3e66['id']],_0x5e3e66);}}}return _0x1584ba[_0xe648('0x43')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x43d97f=this;return function(_0x50cea3){if(_0x50cea3){freeIsNotKey(_0x50cea3,_0x43d97f[_0xe648('0x44')],'id');for(var _0x3ef23e=0x0,_0xf294e9={},_0x143d8c={};_0x3ef23e<_0x50cea3['length'];_0x3ef23e+=0x1){_0xf294e9=_0x50cea3[_0x3ef23e];if(_[_0xe648('0x3d')](_0x43d97f[_0xe648('0x44')][_0xf294e9['id']])){_0x43d97f[_0xe648('0x44')][_0xf294e9['id']]=new FreshdeskAccount(_0xf294e9);}else{_0x43d97f[_0xe648('0x36')](_0x43d97f[_0xe648('0x44')][_0xf294e9['id']],_0xf294e9);}}}return _0x43d97f[_0xe648('0x44')];};};Realtime[_0xe648('0x37')][_0xe648('0x45')]=function(){var _0x2663bf=this;return function(_0x480aaf){if(_0x480aaf){freeIsNotKey(_0x480aaf,_0x2663bf['zohoAccounts'],'id');for(var _0x49ca20=0x0,_0xd17073={},_0x2a0369={};_0x49ca20<_0x480aaf[_0xe648('0x3c')];_0x49ca20+=0x1){_0xd17073=_0x480aaf[_0x49ca20];if(_[_0xe648('0x3d')](_0x2663bf[_0xe648('0x46')][_0xd17073['id']])){_0x2663bf['zohoAccounts'][_0xd17073['id']]=new ZohoAccount(_0xd17073);}else{_0x2663bf[_0xe648('0x36')](_0x2663bf[_0xe648('0x46')][_0xd17073['id']],_0xd17073);}}}return _0x2663bf[_0xe648('0x46')];};};Realtime[_0xe648('0x37')]['initDeskAccounts']=function(){var _0x32c076=this;return function(_0xa491d){if(_0xa491d){freeIsNotKey(_0xa491d,_0x32c076[_0xe648('0x47')],'id');for(var _0x4d665=0x0,_0x38fcf2={},_0x16565e={};_0x4d665<_0xa491d[_0xe648('0x3c')];_0x4d665+=0x1){_0x38fcf2=_0xa491d[_0x4d665];if(_[_0xe648('0x3d')](_0x32c076[_0xe648('0x47')][_0x38fcf2['id']])){_0x32c076[_0xe648('0x47')][_0x38fcf2['id']]=new DeskAccount(_0x38fcf2);}else{_0x32c076['mergeFromDatabase'](_0x32c076[_0xe648('0x47')][_0x38fcf2['id']],_0x38fcf2);}}}return _0x32c076[_0xe648('0x47')];};};Realtime[_0xe648('0x37')]['initSugarcrmAccounts']=function(){var _0x4f1869=this;return function(_0xc3f032){if(_0xc3f032){freeIsNotKey(_0xc3f032,_0x4f1869[_0xe648('0x1c')],'id');for(var _0x5e431a=0x0,_0xd37540={},_0x542cf1={};_0x5e431a<_0xc3f032[_0xe648('0x3c')];_0x5e431a+=0x1){_0xd37540=_0xc3f032[_0x5e431a];if(_[_0xe648('0x3d')](_0x4f1869[_0xe648('0x1c')][_0xd37540['id']])){_0x4f1869[_0xe648('0x1c')][_0xd37540['id']]=new SugarcrmAccount(_0xd37540);}else{_0x4f1869[_0xe648('0x36')](_0x4f1869[_0xe648('0x1c')][_0xd37540['id']],_0xd37540);}}}return _0x4f1869['sugarcrmAccounts'];};};Realtime[_0xe648('0x37')]['initVtigerAccounts']=function(){var _0x4555e4=this;return function(_0x22796d){if(_0x22796d){freeIsNotKey(_0x22796d,_0x4555e4[_0xe648('0x1d')],'id');for(var _0x180196=0x0,_0x271908={},_0x55c4e5={};_0x180196<_0x22796d[_0xe648('0x3c')];_0x180196+=0x1){_0x271908=_0x22796d[_0x180196];if(_[_0xe648('0x3d')](_0x4555e4[_0xe648('0x1d')][_0x271908['id']])){_0x4555e4[_0xe648('0x1d')][_0x271908['id']]=new VtigerAccount(_0x271908);}else{_0x4555e4[_0xe648('0x36')](_0x4555e4['vtigerAccounts'][_0x271908['id']],_0x271908);}}}return _0x4555e4[_0xe648('0x1d')];};};Realtime[_0xe648('0x37')][_0xe648('0x48')]=function(){var _0x1226eb=this;return function(_0xa907be){if(_0xa907be){freeIsNotKey(_0xa907be,_0x1226eb['servicenowAccounts'],'id');for(var _0xa96eac=0x0,_0x3815bc={},_0x367902={};_0xa96eac<_0xa907be[_0xe648('0x3c')];_0xa96eac+=0x1){_0x3815bc=_0xa907be[_0xa96eac];if(_[_0xe648('0x3d')](_0x1226eb[_0xe648('0x1e')][_0x3815bc['id']])){_0x1226eb['servicenowAccounts'][_0x3815bc['id']]=new ServicenowAccount(_0x3815bc);}else{_0x1226eb[_0xe648('0x36')](_0x1226eb[_0xe648('0x1e')][_0x3815bc['id']],_0x3815bc);}}}return _0x1226eb[_0xe648('0x1e')];};};Realtime[_0xe648('0x37')][_0xe648('0x49')]=function(){var _0x21f7de=this;return function(_0x4bc00c){if(_0x4bc00c){freeIsNotKey(_0x4bc00c,_0x21f7de['dynamics365Accounts'],'id');for(var _0x511dc0=0x0,_0x139ae0={},_0x212f41={};_0x511dc0<_0x4bc00c['length'];_0x511dc0+=0x1){_0x139ae0=_0x4bc00c[_0x511dc0];if(_[_0xe648('0x3d')](_0x21f7de['dynamics365Accounts'][_0x139ae0['id']])){_0x21f7de['dynamics365Accounts'][_0x139ae0['id']]=new Dynamics365Account(_0x139ae0);}else{_0x21f7de['mergeFromDatabase'](_0x21f7de[_0xe648('0x4a')][_0x139ae0['id']],_0x139ae0);}}}return _0x21f7de[_0xe648('0x4a')];};};Realtime[_0xe648('0x37')][_0xe648('0x4b')]=function(){var _0x2fa6cf=this;return function(_0x2d0789){if(_0x2d0789){freeIsNotKey(_0x2d0789,_0x2fa6cf[_0xe648('0x1f')],'id');for(var _0x8b5596=0x0,_0x342742={},_0x273a9e={};_0x8b5596<_0x2d0789[_0xe648('0x3c')];_0x8b5596+=0x1){_0x342742=_0x2d0789[_0x8b5596];if(_['isUndefined'](_0x2fa6cf['freshsalesAccounts'][_0x342742['id']])){_0x2fa6cf[_0xe648('0x1f')][_0x342742['id']]=new FreshsalesAccount(_0x342742);}else{_0x2fa6cf['mergeFromDatabase'](_0x2fa6cf['freshsalesAccounts'][_0x342742['id']],_0x342742);}}}return _0x2fa6cf[_0xe648('0x1f')];};};Realtime[_0xe648('0x37')][_0xe648('0x4c')]=function(){var _0xb27145=this;return function(_0x4a488b){for(var _0x490c18=0x0;_0x490c18<_0x4a488b[_0xe648('0x3c')];_0x490c18+=0x1){_[_0xe648('0x4d')](_0xb27145['voiceQueues'][_0x4a488b[_0x490c18][_0xe648('0x39')]],_0x4a488b[_0x490c18]);}return _0xb27145['voiceQueues'];};};Realtime[_0xe648('0x37')][_0xe648('0x4e')]=function(){var _0x6ebb3b=this;return function(_0x5b1e09){clearVoiceQueues(_0x6ebb3b['voiceQueues']);if(_0x5b1e09){_0x5b1e09=_[_0xe648('0x4f')](_0x5b1e09,_0xe648('0x50'));for(var _0x58d02f in _0x5b1e09){if(_0x5b1e09[_0xe648('0x22')](_0x58d02f)){var _0xdce30={};for(var _0x1c0335=0x0;_0x1c0335<_0x5b1e09[_0x58d02f]['length'];_0x1c0335+=0x1){var _0x5edd26=_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x51')];if(_0x6ebb3b[_0xe648('0x12')][_0x5edd26]){if(_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x52')]){_0x6ebb3b[_0xe648('0x12')][_0x5edd26][_0xe648('0x53')]+=0x1;}if(_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x54')]){_0x6ebb3b['voiceQueues'][_0x5edd26]['abandoned']+=0x1;}_0x6ebb3b[_0xe648('0x12')][_0x5edd26]['sumHoldTime']+=moment(_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x55')])[_0xe648('0x56')](moment(_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x57')]),_0xe648('0x58'))||0x0;if(_0x1c0335===_0x5b1e09[_0x58d02f]['length']-0x1){_0x6ebb3b[_0xe648('0x12')][_0x5edd26][_0xe648('0x29')]+=moment(_0x5b1e09[_0x58d02f][_0x1c0335]['queuecallercompleteAt']||_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x59')]||_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x5a')])[_0xe648('0x56')](moment(_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x57')]),_0xe648('0x58'))||0x0;_0x6ebb3b['voiceQueues'][_0x5edd26][_0xe648('0x5b')]+=0x1;if(_0x5b1e09[_0x58d02f][_0x1c0335]['queuecallercomplete']){_0x6ebb3b[_0xe648('0x12')][_0x5edd26][_0xe648('0x27')]+=0x1;_0x6ebb3b[_0xe648('0x12')][_0x5edd26][_0xe648('0x2a')]+=moment(_0x5b1e09[_0x58d02f][_0x1c0335][_0xe648('0x5c')])[_0xe648('0x56')](moment(_0x5b1e09[_0x58d02f][_0x1c0335]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x6ebb3b['voiceQueues'][_0x5edd26][_0xe648('0x29')]+=_0x6ebb3b[_0xe648('0x12')][_0x5edd26][_0xe648('0x28')]||0x0;}}}}}}return _0x6ebb3b[_0xe648('0x12')];};};Realtime[_0xe648('0x37')][_0xe648('0x5d')]=function(){var _0x4ac168=this;return function(_0x116784){clearVoiceCallReports(_0x4ac168['outbound']);if(_0x116784){for(var _0x2e9dfc=0x0;_0x2e9dfc<_0x116784['length'];_0x2e9dfc+=0x1){_0x4ac168[_0xe648('0x5e')]['total']+=0x1;_0x4ac168[_0xe648('0x5e')][_0xe648('0x29')]+=_0x116784[_0x2e9dfc][_0xe648('0x5f')];if(_0x116784[_0x2e9dfc]['disposition']===_0xe648('0x60')){_0x4ac168[_0xe648('0x5e')]['answered']+=0x1;_0x4ac168[_0xe648('0x5e')][_0xe648('0x28')]+=_0x116784[_0x2e9dfc][_0xe648('0x5f')]-_0x116784[_0x2e9dfc]['billableseconds']||0x0;_0x4ac168[_0xe648('0x5e')][_0xe648('0x2a')]+=_0x116784[_0x2e9dfc][_0xe648('0x61')];}}}return _0x4ac168[_0xe648('0x5e')];};};Realtime[_0xe648('0x37')]['initCampaigns']=function(){var _0x309976=this;return function(_0x32e7d4){if(_0x32e7d4){freeIsNotKey(_0x32e7d4,_0x309976[_0xe648('0x14')],_0xe648('0x39'));for(var _0x39a4f5=0x0,_0x55b8ca={};_0x39a4f5<_0x32e7d4[_0xe648('0x3c')];_0x39a4f5+=0x1){_0x55b8ca=_0x32e7d4[_0x39a4f5];if(_['isUndefined'](_0x309976['campaigns'][_0x55b8ca[_0xe648('0x39')]])){_0x309976['campaigns'][_0x55b8ca[_0xe648('0x39')]]=new Campaign(_0x55b8ca);}else{_0x309976[_0xe648('0x36')](_0x309976[_0xe648('0x14')][_0x55b8ca[_0xe648('0x39')]],_0x55b8ca);_0x309976[_0xe648('0x14')][_0x55b8ca[_0xe648('0x39')]][_0xe648('0x62')]=_0x55b8ca['SquareProject']?_0x55b8ca[_0xe648('0x63')]['name']:undefined;}}}return _0x309976['campaigns'];};};Realtime['prototype'][_0xe648('0x64')]=function(){var _0x4ac1a6=this;return function(_0x1807b3){if(_0x1807b3){freeIsNotKey(_0x1807b3,_0x4ac1a6[_0xe648('0x15')],'id');for(var _0x1c86e0=0x0,_0x1e13c9={};_0x1c86e0<_0x1807b3[_0xe648('0x3c')];_0x1c86e0+=0x1){_0x1e13c9=_0x1807b3[_0x1c86e0];if(_[_0xe648('0x3d')](_0x4ac1a6[_0xe648('0x15')][_0x1e13c9['id']])){_0x4ac1a6[_0xe648('0x15')][_0x1e13c9['id']]=new VoiceExtension(_0x1e13c9);}else{_0x4ac1a6[_0xe648('0x36')](_0x4ac1a6[_0xe648('0x15')][_0x1e13c9['id']],_0x1e13c9);}}}return _0x4ac1a6[_0xe648('0x15')];};};Realtime[_0xe648('0x37')]['initCampaignHopperHistory']=function(){var _0x5c6807=this;return function(_0x261264){clearCampaigns(_0x5c6807[_0xe648('0x14')]);for(var _0x24f073=0x0;_0x24f073<_0x261264[_0xe648('0x3c')];_0x24f073+=0x1){_[_0xe648('0x4d')](_0x5c6807[_0xe648('0x14')][_0x261264[_0x24f073][_0xe648('0x39')]],_0x261264[_0x24f073]);}return _0x5c6807[_0xe648('0x14')];};};Realtime[_0xe648('0x37')][_0xe648('0x65')]=function(){var _0x377426=this;return function(_0x6cb5f3){if(_0x6cb5f3){freeIsNotKey(_0x6cb5f3,_0x377426[_0xe648('0x20')],'id');for(var _0x1b872c=0x0,_0x3794f8={},_0x5da882={};_0x1b872c<_0x6cb5f3[_0xe648('0x3c')];_0x1b872c+=0x1){_0x3794f8=_0x6cb5f3[_0x1b872c];if(_[_0xe648('0x3d')](_0x377426[_0xe648('0x20')][_0x3794f8['id']])){_0x377426[_0xe648('0x20')][_0x3794f8['id']]=new FaxAccount(_0x3794f8);}else{_0x377426[_0xe648('0x36')](_0x377426[_0xe648('0x20')][_0x3794f8['id']],_0x3794f8);}}}return _0x377426['faxAccounts'];};};module[_0xe648('0x66')]=Realtime;
\ No newline at end of file
+var _0x75ea=['../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','templates','voiceExtensions','channels','queueChannels','outboundChannels','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','total','sumDuration','sumBillable','ivrAnswerCallsDay','isEmpty','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','name','telephones','isUndefined','initTriggers','triggers','initTemplates','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','sumHoldTime','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerleaveAt','seconds','initVoiceCallReports','outbound','duration','disposition','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','faxAccounts','exports','bluebird','util','../model/agent','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/vtigerAccount'];(function(_0x2aa081,_0x186871){var _0x3f992b=function(_0x28b72b){while(--_0x28b72b){_0x2aa081['push'](_0x2aa081['shift']());}};_0x3f992b(++_0x186871);}(_0x75ea,0xbd));var _0xa75e=function(_0x284137,_0x581e81){_0x284137=_0x284137-0x0;var _0x24ea62=_0x75ea[_0x284137];return _0x24ea62;};'use strict';var BPromise=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0xa75e('0x2'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xa75e('0x3'));var Template=require(_0xa75e('0x4'));var Campaign=require(_0xa75e('0x5'));var VoiceExtension=require(_0xa75e('0x6'));var ZendeskAccount=require(_0xa75e('0x7'));var SalesforceAccount=require(_0xa75e('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xa75e('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xa75e('0xa'));var ServicenowAccount=require(_0xa75e('0xb'));var Dynamics365Account=require(_0xa75e('0xc'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xa75e('0xd'));var Realtime=function(){this[_0xa75e('0xe')]={};this['telephones']={};this[_0xa75e('0xf')]={};this[_0xa75e('0x10')]={};this['triggers']={};this['campaigns']={};this[_0xa75e('0x11')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xa75e('0x12')]={};this[_0xa75e('0x13')]={};this[_0xa75e('0x14')]={};this[_0xa75e('0x15')]={};this['timers']={};this[_0xa75e('0x16')]={};this['zendeskAccounts']={};this[_0xa75e('0x17')]={};this[_0xa75e('0x18')]={};this[_0xa75e('0x19')]={};this[_0xa75e('0x1a')]={};this[_0xa75e('0x1b')]={};this[_0xa75e('0x1c')]={};this[_0xa75e('0x1d')]={};this[_0xa75e('0x1e')]={};this[_0xa75e('0x1f')]={};this['faxAccounts']={};};function freeIsNotKey(_0x24aba6,_0x4ecc32,_0x1f1a9c){var _0x97e5b5=_[_0xa75e('0x20')](_0x24aba6,function(_0x2d9482,_0x5e4fc7){return _0x2d9482[_0x1f1a9c];});for(var _0x3c4d16 in _0x4ecc32){if(_0x4ecc32[_0xa75e('0x21')](_0x3c4d16)){if(!_0x97e5b5[_0x3c4d16]){delete _0x4ecc32[_0x3c4d16];}}}}function freeIsNotKeySip(_0x3a613a,_0x357980){var _0x2447c4=_['mapKeys'](_0x3a613a,function(_0x332e8d,_0x143bae){return util[_0xa75e('0x22')](_0xa75e('0x23'),_0x332e8d['name']);});for(var _0x4b5d01 in _0x357980){if(_0x357980['hasOwnProperty'](_0x4b5d01)){if(!_0x2447c4[_0x4b5d01]){delete _0x357980[_0x4b5d01];}}}}function freeIsNotKeyAgent(_0x4eff11,_0x416379){var _0x187041=_['mapKeys'](_0x4eff11,function(_0x5cb9f3,_0x10f1b7){var _0x590add=_[_0xa75e('0x24')](_0x5cb9f3[_0xa75e('0x25')])?util['format'](_0xa75e('0x23'),_0x5cb9f3['name']):_0x5cb9f3[_0xa75e('0x25')];return _0x590add;});for(var _0x3bf7e7 in _0x416379){if(_0x416379[_0xa75e('0x21')](_0x3bf7e7)){if(!_0x187041[_0x3bf7e7]){delete _0x416379[_0x3bf7e7];}}}}function clearVoiceCallReports(_0x5c3adf){_0x5c3adf[_0xa75e('0x26')]=0x0;_0x5c3adf['answered']=0x0;_0x5c3adf['sumHoldTime']=0x0;_0x5c3adf[_0xa75e('0x27')]=0x0;_0x5c3adf[_0xa75e('0x28')]=0x0;}function clearCampaigns(_0x293846){if(!_['isEmpty'](_0x293846)){for(var _0x1099fe in _0x293846){if(_0x293846[_0xa75e('0x21')](_0x1099fe)){_0x293846[_0x1099fe]['ivrTotalCallsDays']=0x0;_0x293846[_0x1099fe][_0xa75e('0x29')]=0x0;}}}}function clearVoiceQueues(_0x577740){if(!_[_0xa75e('0x2a')](_0x577740)){for(var _0x3b797c in _0x577740){if(_0x577740['hasOwnProperty'](_0x3b797c)){_0x577740[_0x3b797c][_0xa75e('0x26')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x2b')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x2c')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x2d')]=0x0;_0x577740[_0x3b797c]['sumHoldTime']=0x0;_0x577740[_0x3b797c][_0xa75e('0x27')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x28')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x2e')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x2f')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x30')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x31')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x32')]=0x0;_0x577740[_0x3b797c]['outboundUnknownCallsDay']=0x0;_0x577740[_0x3b797c]['outboundDropCallsDayTimeout']=0x0;_0x577740[_0x3b797c][_0xa75e('0x33')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x34')]=0x0;_0x577740[_0x3b797c]['outboundOriginateFailureCallsDay']=0x0;_0x577740[_0x3b797c][_0xa75e('0x35')]=0x0;_0x577740[_0x3b797c]['outboundReCallsDay']=0x0;_0x577740[_0x3b797c][_0xa75e('0x2e')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x36')]=0x0;_0x577740[_0x3b797c][_0xa75e('0x37')]=!![];}}}}Realtime[_0xa75e('0x38')][_0xa75e('0x39')]=function(_0x24ade0,_0x2b4f45){for(var _0x511175 in _0x2b4f45){if(_0x24ade0[_0xa75e('0x21')](_0x511175)){_0x24ade0[_0x511175]=_0x2b4f45[_0x511175];}}};Realtime['prototype'][_0xa75e('0x3a')]=function(){var _0x3665a3=this;return function(_0x30da4f){if(_0x30da4f){freeIsNotKeyAgent(_0x30da4f,_0x3665a3[_0xa75e('0xe')]);for(var _0xbd1bc7=0x0,_0x11ca10={},_0x599061={};_0xbd1bc7<_0x30da4f[_0xa75e('0x3b')];_0xbd1bc7+=0x1){_0x11ca10=_0x30da4f[_0xbd1bc7];var _0x1a2929=_[_0xa75e('0x24')](_0x11ca10[_0xa75e('0x25')])?util[_0xa75e('0x22')](_0xa75e('0x23'),_0x11ca10[_0xa75e('0x3c')]):_0x11ca10[_0xa75e('0x25')];if(_['isUndefined'](_0x3665a3[_0xa75e('0xe')][_0x1a2929])){_0x3665a3[_0xa75e('0xe')][_0x1a2929]=new Agent(_0x11ca10);}else{_0x3665a3['mergeFromDatabase'](_0x3665a3[_0xa75e('0xe')][_0x1a2929],_0x11ca10);}}}return _0x3665a3['agents'];};};Realtime[_0xa75e('0x38')]['initTelephones']=function(){var _0x5bb942=this;return function(_0x1dbca1){if(_0x1dbca1){freeIsNotKeySip(_0x1dbca1,_0x5bb942[_0xa75e('0x3d')]);for(var _0x59cb9c=0x0,_0x45988a={},_0x3637b7={};_0x59cb9c<_0x1dbca1[_0xa75e('0x3b')];_0x59cb9c+=0x1){_0x45988a=_0x1dbca1[_0x59cb9c];if(_[_0xa75e('0x3e')](_0x5bb942[_0xa75e('0x3d')][util[_0xa75e('0x22')]('SIP/%s',_0x45988a[_0xa75e('0x3c')])])){_0x5bb942[_0xa75e('0x3d')][util['format'](_0xa75e('0x23'),_0x45988a['name'])]=new Telephone(_0x45988a);}else{_0x5bb942[_0xa75e('0x39')](_0x5bb942['telephones'][util[_0xa75e('0x22')](_0xa75e('0x23'),_0x45988a[_0xa75e('0x3c')])],_0x45988a);}}}return _0x5bb942[_0xa75e('0x3d')];};};Realtime[_0xa75e('0x38')]['initTrunks']=function(){var _0x1f599d=this;return function(_0x5aa6b7){if(_0x5aa6b7){freeIsNotKeySip(_0x5aa6b7,_0x1f599d[_0xa75e('0xf')]);for(var _0x1641dd=0x0,_0x259fae={},_0x48d400={};_0x1641dd<_0x5aa6b7['length'];_0x1641dd+=0x1){_0x259fae=_0x5aa6b7[_0x1641dd];if(_[_0xa75e('0x3e')](_0x1f599d[_0xa75e('0xf')][util[_0xa75e('0x22')](_0xa75e('0x23'),_0x259fae[_0xa75e('0x3c')])])){_0x1f599d[_0xa75e('0xf')][util['format'](_0xa75e('0x23'),_0x259fae[_0xa75e('0x3c')])]=new Trunk(_0x259fae);}else{_0x1f599d[_0xa75e('0x39')](_0x1f599d['trunks'][util['format'](_0xa75e('0x23'),_0x259fae[_0xa75e('0x3c')])],_0x259fae);}}}return _0x1f599d['trunks'];};};Realtime[_0xa75e('0x38')]['initVoiceQueues']=function(){var _0x259d33=this;return function(_0x5516da){if(_0x5516da){freeIsNotKey(_0x5516da,_0x259d33['voiceQueues'],'name');for(var _0x30e32e=0x0,_0x51511e={},_0x5199f0={};_0x30e32e<_0x5516da[_0xa75e('0x3b')];_0x30e32e+=0x1){_0x51511e=_0x5516da[_0x30e32e];if(_[_0xa75e('0x3e')](_0x259d33[_0xa75e('0x10')][_0x51511e[_0xa75e('0x3c')]])){_0x259d33[_0xa75e('0x10')][_0x51511e[_0xa75e('0x3c')]]=new VoiceQueue(_0x51511e);}else{_0x259d33['mergeFromDatabase'](_0x259d33['voiceQueues'][_0x51511e[_0xa75e('0x3c')]],_0x51511e);}}}return _0x259d33[_0xa75e('0x10')];};};Realtime[_0xa75e('0x38')][_0xa75e('0x3f')]=function(){var _0x5397f1=this;return function(_0x5d582e){if(_0x5d582e){freeIsNotKey(_0x5d582e,_0x5397f1[_0xa75e('0x40')],'id');for(var _0x253f5c=0x0,_0x4d1445={},_0x2dfbd9={};_0x253f5c<_0x5d582e['length'];_0x253f5c+=0x1){_0x4d1445=_0x5d582e[_0x253f5c];if(_[_0xa75e('0x3e')](_0x5397f1['triggers'][_0x4d1445['id']])){_0x5397f1['triggers'][_0x4d1445['id']]=new Trigger(_0x4d1445);}else{_0x5397f1[_0xa75e('0x39')](_0x5397f1[_0xa75e('0x40')][_0x4d1445['id']],_0x4d1445);}}}return _0x5397f1[_0xa75e('0x40')];};};Realtime[_0xa75e('0x38')][_0xa75e('0x41')]=function(){var _0x5a3e55=this;return function(_0x8e2a6c){if(_0x8e2a6c){freeIsNotKey(_0x8e2a6c,_0x5a3e55['templates'],'id');for(var _0x5aca15=0x0,_0x11785f={},_0x5d0928={};_0x5aca15<_0x8e2a6c[_0xa75e('0x3b')];_0x5aca15+=0x1){_0x11785f=_0x8e2a6c[_0x5aca15];if(_['isUndefined'](_0x5a3e55[_0xa75e('0x11')][_0x11785f['id']])){_0x5a3e55[_0xa75e('0x11')][_0x11785f['id']]=new Template(_0x11785f);}else{_0x5a3e55[_0xa75e('0x39')](_0x5a3e55[_0xa75e('0x11')][_0x11785f['id']],_0x11785f);}}}return _0x5a3e55[_0xa75e('0x11')];};};Realtime[_0xa75e('0x38')]['initZendeskAccounts']=function(){var _0x57dbe5=this;return function(_0x3b071e){if(_0x3b071e){freeIsNotKey(_0x3b071e,_0x57dbe5[_0xa75e('0x42')],'id');for(var _0x1d7ce1=0x0,_0x5580cc={},_0x349c8f={};_0x1d7ce1<_0x3b071e['length'];_0x1d7ce1+=0x1){_0x5580cc=_0x3b071e[_0x1d7ce1];if(_[_0xa75e('0x3e')](_0x57dbe5[_0xa75e('0x42')][_0x5580cc['id']])){_0x57dbe5['zendeskAccounts'][_0x5580cc['id']]=new ZendeskAccount(_0x5580cc);}else{_0x57dbe5[_0xa75e('0x39')](_0x57dbe5[_0xa75e('0x42')][_0x5580cc['id']],_0x5580cc);}}}return _0x57dbe5[_0xa75e('0x42')];};};Realtime[_0xa75e('0x38')]['initSalesforceAccounts']=function(){var _0x226f8c=this;return function(_0xedbad5){if(_0xedbad5){freeIsNotKey(_0xedbad5,_0x226f8c['salesforceAccounts'],'id');for(var _0x3a37a8=0x0,_0x5f5c01={},_0x3efbd6={};_0x3a37a8<_0xedbad5[_0xa75e('0x3b')];_0x3a37a8+=0x1){_0x5f5c01=_0xedbad5[_0x3a37a8];if(_[_0xa75e('0x3e')](_0x226f8c[_0xa75e('0x17')][_0x5f5c01['id']])){_0x226f8c[_0xa75e('0x17')][_0x5f5c01['id']]=new SalesforceAccount(_0x5f5c01);}else{_0x226f8c['mergeFromDatabase'](_0x226f8c[_0xa75e('0x17')][_0x5f5c01['id']],_0x5f5c01);}}}return _0x226f8c[_0xa75e('0x17')];};};Realtime[_0xa75e('0x38')][_0xa75e('0x43')]=function(){var _0x32166e=this;return function(_0x5c394d){if(_0x5c394d){freeIsNotKey(_0x5c394d,_0x32166e[_0xa75e('0x19')],'id');for(var _0x169c85=0x0,_0x1309b9={},_0x4510d1={};_0x169c85<_0x5c394d[_0xa75e('0x3b')];_0x169c85+=0x1){_0x1309b9=_0x5c394d[_0x169c85];if(_[_0xa75e('0x3e')](_0x32166e[_0xa75e('0x19')][_0x1309b9['id']])){_0x32166e['freshdeskAccounts'][_0x1309b9['id']]=new FreshdeskAccount(_0x1309b9);}else{_0x32166e[_0xa75e('0x39')](_0x32166e[_0xa75e('0x19')][_0x1309b9['id']],_0x1309b9);}}}return _0x32166e[_0xa75e('0x19')];};};Realtime[_0xa75e('0x38')][_0xa75e('0x44')]=function(){var _0xdf4834=this;return function(_0x2bb31d){if(_0x2bb31d){freeIsNotKey(_0x2bb31d,_0xdf4834[_0xa75e('0x1a')],'id');for(var _0x4c33af=0x0,_0x4ef6c8={},_0x6fb971={};_0x4c33af<_0x2bb31d[_0xa75e('0x3b')];_0x4c33af+=0x1){_0x4ef6c8=_0x2bb31d[_0x4c33af];if(_['isUndefined'](_0xdf4834[_0xa75e('0x1a')][_0x4ef6c8['id']])){_0xdf4834[_0xa75e('0x1a')][_0x4ef6c8['id']]=new ZohoAccount(_0x4ef6c8);}else{_0xdf4834['mergeFromDatabase'](_0xdf4834[_0xa75e('0x1a')][_0x4ef6c8['id']],_0x4ef6c8);}}}return _0xdf4834[_0xa75e('0x1a')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0xfa3cae=this;return function(_0x59d4bf){if(_0x59d4bf){freeIsNotKey(_0x59d4bf,_0xfa3cae[_0xa75e('0x1b')],'id');for(var _0x58e20e=0x0,_0x393700={},_0x48171e={};_0x58e20e<_0x59d4bf[_0xa75e('0x3b')];_0x58e20e+=0x1){_0x393700=_0x59d4bf[_0x58e20e];if(_['isUndefined'](_0xfa3cae[_0xa75e('0x1b')][_0x393700['id']])){_0xfa3cae[_0xa75e('0x1b')][_0x393700['id']]=new DeskAccount(_0x393700);}else{_0xfa3cae['mergeFromDatabase'](_0xfa3cae[_0xa75e('0x1b')][_0x393700['id']],_0x393700);}}}return _0xfa3cae[_0xa75e('0x1b')];};};Realtime[_0xa75e('0x38')][_0xa75e('0x45')]=function(){var _0x3aa984=this;return function(_0x8bcda7){if(_0x8bcda7){freeIsNotKey(_0x8bcda7,_0x3aa984[_0xa75e('0x18')],'id');for(var _0x5e41c9=0x0,_0x1befd7={},_0x5efc78={};_0x5e41c9<_0x8bcda7[_0xa75e('0x3b')];_0x5e41c9+=0x1){_0x1befd7=_0x8bcda7[_0x5e41c9];if(_[_0xa75e('0x3e')](_0x3aa984[_0xa75e('0x18')][_0x1befd7['id']])){_0x3aa984['sugarcrmAccounts'][_0x1befd7['id']]=new SugarcrmAccount(_0x1befd7);}else{_0x3aa984[_0xa75e('0x39')](_0x3aa984['sugarcrmAccounts'][_0x1befd7['id']],_0x1befd7);}}}return _0x3aa984[_0xa75e('0x18')];};};Realtime[_0xa75e('0x38')][_0xa75e('0x46')]=function(){var _0x33690d=this;return function(_0x15113c){if(_0x15113c){freeIsNotKey(_0x15113c,_0x33690d['vtigerAccounts'],'id');for(var _0xb3c61=0x0,_0x5f5785={},_0xc14514={};_0xb3c61<_0x15113c['length'];_0xb3c61+=0x1){_0x5f5785=_0x15113c[_0xb3c61];if(_[_0xa75e('0x3e')](_0x33690d[_0xa75e('0x1c')][_0x5f5785['id']])){_0x33690d[_0xa75e('0x1c')][_0x5f5785['id']]=new VtigerAccount(_0x5f5785);}else{_0x33690d[_0xa75e('0x39')](_0x33690d[_0xa75e('0x1c')][_0x5f5785['id']],_0x5f5785);}}}return _0x33690d[_0xa75e('0x1c')];};};Realtime[_0xa75e('0x38')]['initServicenowAccounts']=function(){var _0x2a54e7=this;return function(_0x4b9609){if(_0x4b9609){freeIsNotKey(_0x4b9609,_0x2a54e7[_0xa75e('0x1d')],'id');for(var _0x2ef4ae=0x0,_0x511e01={},_0x19d702={};_0x2ef4ae<_0x4b9609[_0xa75e('0x3b')];_0x2ef4ae+=0x1){_0x511e01=_0x4b9609[_0x2ef4ae];if(_['isUndefined'](_0x2a54e7[_0xa75e('0x1d')][_0x511e01['id']])){_0x2a54e7[_0xa75e('0x1d')][_0x511e01['id']]=new ServicenowAccount(_0x511e01);}else{_0x2a54e7[_0xa75e('0x39')](_0x2a54e7[_0xa75e('0x1d')][_0x511e01['id']],_0x511e01);}}}return _0x2a54e7[_0xa75e('0x1d')];};};Realtime['prototype'][_0xa75e('0x47')]=function(){var _0x5605b0=this;return function(_0x2ce6b0){if(_0x2ce6b0){freeIsNotKey(_0x2ce6b0,_0x5605b0[_0xa75e('0x1e')],'id');for(var _0x202879=0x0,_0x548927={},_0x5574f7={};_0x202879<_0x2ce6b0[_0xa75e('0x3b')];_0x202879+=0x1){_0x548927=_0x2ce6b0[_0x202879];if(_[_0xa75e('0x3e')](_0x5605b0[_0xa75e('0x1e')][_0x548927['id']])){_0x5605b0[_0xa75e('0x1e')][_0x548927['id']]=new Dynamics365Account(_0x548927);}else{_0x5605b0[_0xa75e('0x39')](_0x5605b0['dynamics365Accounts'][_0x548927['id']],_0x548927);}}}return _0x5605b0['dynamics365Accounts'];};};Realtime[_0xa75e('0x38')][_0xa75e('0x48')]=function(){var _0x6d0e7a=this;return function(_0x2b4eb9){if(_0x2b4eb9){freeIsNotKey(_0x2b4eb9,_0x6d0e7a[_0xa75e('0x1f')],'id');for(var _0x230f2b=0x0,_0x5d7c3d={},_0x52ae4d={};_0x230f2b<_0x2b4eb9[_0xa75e('0x3b')];_0x230f2b+=0x1){_0x5d7c3d=_0x2b4eb9[_0x230f2b];if(_[_0xa75e('0x3e')](_0x6d0e7a[_0xa75e('0x1f')][_0x5d7c3d['id']])){_0x6d0e7a[_0xa75e('0x1f')][_0x5d7c3d['id']]=new FreshsalesAccount(_0x5d7c3d);}else{_0x6d0e7a[_0xa75e('0x39')](_0x6d0e7a['freshsalesAccounts'][_0x5d7c3d['id']],_0x5d7c3d);}}}return _0x6d0e7a[_0xa75e('0x1f')];};};Realtime[_0xa75e('0x38')]['initVoiceQueueHopperHistory']=function(){var _0x5ea2a6=this;return function(_0xb21a82){for(var _0x41c315=0x0;_0x41c315<_0xb21a82[_0xa75e('0x3b')];_0x41c315+=0x1){_['merge'](_0x5ea2a6['voiceQueues'][_0xb21a82[_0x41c315][_0xa75e('0x3c')]],_0xb21a82[_0x41c315]);}return _0x5ea2a6[_0xa75e('0x10')];};};Realtime['prototype'][_0xa75e('0x49')]=function(){var _0x3dc1f8=this;return function(_0x55a2ba){clearVoiceQueues(_0x3dc1f8[_0xa75e('0x10')]);if(_0x55a2ba){_0x55a2ba=_[_0xa75e('0x4a')](_0x55a2ba,'uniqueid');for(var _0xf33dcf in _0x55a2ba){if(_0x55a2ba[_0xa75e('0x21')](_0xf33dcf)){var _0x121b35={};for(var _0x4faee5=0x0;_0x4faee5<_0x55a2ba[_0xf33dcf][_0xa75e('0x3b')];_0x4faee5+=0x1){var _0x231673=_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x4b')];if(_0x3dc1f8['voiceQueues'][_0x231673]){if(_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x4c')]){_0x3dc1f8['voiceQueues'][_0x231673][_0xa75e('0x2c')]+=0x1;}if(_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x4d')]){_0x3dc1f8['voiceQueues'][_0x231673][_0xa75e('0x2d')]+=0x1;}_0x3dc1f8[_0xa75e('0x10')][_0x231673][_0xa75e('0x4e')]+=moment(_0x55a2ba[_0xf33dcf][_0x4faee5]['queuecallerleaveAt'])[_0xa75e('0x4f')](moment(_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x50')]),'seconds')||0x0;if(_0x4faee5===_0x55a2ba[_0xf33dcf][_0xa75e('0x3b')]-0x1){_0x3dc1f8['voiceQueues'][_0x231673][_0xa75e('0x27')]+=moment(_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x51')]||_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x52')]||_0x55a2ba[_0xf33dcf][_0x4faee5]['queuecallerexitAt'])[_0xa75e('0x4f')](moment(_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x50')]),'seconds')||0x0;_0x3dc1f8[_0xa75e('0x10')][_0x231673][_0xa75e('0x26')]+=0x1;if(_0x55a2ba[_0xf33dcf][_0x4faee5]['queuecallercomplete']){_0x3dc1f8[_0xa75e('0x10')][_0x231673]['answered']+=0x1;_0x3dc1f8[_0xa75e('0x10')][_0x231673][_0xa75e('0x28')]+=moment(_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x51')])[_0xa75e('0x4f')](moment(_0x55a2ba[_0xf33dcf][_0x4faee5][_0xa75e('0x53')]),_0xa75e('0x54'))||0x0;}}else{_0x3dc1f8[_0xa75e('0x10')][_0x231673]['sumDuration']+=_0x3dc1f8[_0xa75e('0x10')][_0x231673][_0xa75e('0x4e')]||0x0;}}}}}}return _0x3dc1f8['voiceQueues'];};};Realtime[_0xa75e('0x38')][_0xa75e('0x55')]=function(){var _0x5e5bbd=this;return function(_0x1afaa9){clearVoiceCallReports(_0x5e5bbd[_0xa75e('0x56')]);if(_0x1afaa9){for(var _0x118c37=0x0;_0x118c37<_0x1afaa9[_0xa75e('0x3b')];_0x118c37+=0x1){_0x5e5bbd[_0xa75e('0x56')][_0xa75e('0x26')]+=0x1;_0x5e5bbd['outbound'][_0xa75e('0x27')]+=_0x1afaa9[_0x118c37][_0xa75e('0x57')];if(_0x1afaa9[_0x118c37][_0xa75e('0x58')]==='ANSWERED'){_0x5e5bbd[_0xa75e('0x56')][_0xa75e('0x2b')]+=0x1;_0x5e5bbd[_0xa75e('0x56')][_0xa75e('0x4e')]+=_0x1afaa9[_0x118c37][_0xa75e('0x57')]-_0x1afaa9[_0x118c37][_0xa75e('0x59')]||0x0;_0x5e5bbd[_0xa75e('0x56')]['sumBillable']+=_0x1afaa9[_0x118c37]['billableseconds'];}}}return _0x5e5bbd['outbound'];};};Realtime[_0xa75e('0x38')][_0xa75e('0x5a')]=function(){var _0xfdebc5=this;return function(_0x35b32d){if(_0x35b32d){freeIsNotKey(_0x35b32d,_0xfdebc5['campaigns'],_0xa75e('0x3c'));for(var _0x4950db=0x0,_0x5063f6={};_0x4950db<_0x35b32d[_0xa75e('0x3b')];_0x4950db+=0x1){_0x5063f6=_0x35b32d[_0x4950db];if(_['isUndefined'](_0xfdebc5['campaigns'][_0x5063f6[_0xa75e('0x3c')]])){_0xfdebc5[_0xa75e('0x5b')][_0x5063f6['name']]=new Campaign(_0x5063f6);}else{_0xfdebc5[_0xa75e('0x39')](_0xfdebc5['campaigns'][_0x5063f6[_0xa75e('0x3c')]],_0x5063f6);_0xfdebc5[_0xa75e('0x5b')][_0x5063f6['name']][_0xa75e('0x5c')]=_0x5063f6[_0xa75e('0x5d')]?_0x5063f6['SquareProject'][_0xa75e('0x3c')]:undefined;}}}return _0xfdebc5[_0xa75e('0x5b')];};};Realtime[_0xa75e('0x38')][_0xa75e('0x5e')]=function(){var _0x2e3103=this;return function(_0x5de0a4){if(_0x5de0a4){freeIsNotKey(_0x5de0a4,_0x2e3103['voiceExtensions'],'id');for(var _0x1f0d11=0x0,_0x1632c5={};_0x1f0d11<_0x5de0a4[_0xa75e('0x3b')];_0x1f0d11+=0x1){_0x1632c5=_0x5de0a4[_0x1f0d11];if(_[_0xa75e('0x3e')](_0x2e3103[_0xa75e('0x12')][_0x1632c5['id']])){_0x2e3103[_0xa75e('0x12')][_0x1632c5['id']]=new VoiceExtension(_0x1632c5);}else{_0x2e3103[_0xa75e('0x39')](_0x2e3103['voiceExtensions'][_0x1632c5['id']],_0x1632c5);}}}return _0x2e3103[_0xa75e('0x12')];};};Realtime['prototype'][_0xa75e('0x5f')]=function(){var _0x5262a2=this;return function(_0x2422dc){clearCampaigns(_0x5262a2[_0xa75e('0x5b')]);for(var _0x461020=0x0;_0x461020<_0x2422dc['length'];_0x461020+=0x1){_[_0xa75e('0x60')](_0x5262a2[_0xa75e('0x5b')][_0x2422dc[_0x461020][_0xa75e('0x3c')]],_0x2422dc[_0x461020]);}return _0x5262a2[_0xa75e('0x5b')];};};Realtime[_0xa75e('0x38')][_0xa75e('0x61')]=function(){var _0x60fe32=this;return function(_0x549af9){if(_0x549af9){freeIsNotKey(_0x549af9,_0x60fe32[_0xa75e('0x62')],'id');for(var _0x45d78c=0x0,_0x42966c={},_0xfa9552={};_0x45d78c<_0x549af9[_0xa75e('0x3b')];_0x45d78c+=0x1){_0x42966c=_0x549af9[_0x45d78c];if(_['isUndefined'](_0x60fe32[_0xa75e('0x62')][_0x42966c['id']])){_0x60fe32[_0xa75e('0x62')][_0x42966c['id']]=new FaxAccount(_0x42966c);}else{_0x60fe32[_0xa75e('0x39')](_0x60fe32['faxAccounts'][_0x42966c['id']],_0x42966c);}}}return _0x60fe32['faxAccounts'];};};module[_0xa75e('0x63')]=Realtime;
\ No newline at end of file
index be551d7..b49ea3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dbe=['isArray','startsWith','Local','substring','indexOf','phone','lastIndexOf','findAgent','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','split','calleridnum','outbound','voiceCallReport','destination','exten','type','lastapplication','lastdata','context','from-voip-provider','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','ANSWERED','callerid','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','UserId','membername','monitor','monitors','monitorFilename','createdAt','calleridname','connectedlinename','xcally-motion-dialer'];(function(_0x11a56f,_0x8aa183){var _0x4ccf29=function(_0x48abd5){while(--_0x48abd5){_0x11a56f['push'](_0x11a56f['shift']());}};_0x4ccf29(++_0x8aa183);}(_0x2dbe,0x171));var _0xe2db=function(_0x3cbaaa,_0x9ce5a5){_0x3cbaaa=_0x3cbaaa-0x0;var _0x13e763=_0x2dbe[_0x3cbaaa];return _0x13e763;};'use strict';var _=require(_0xe2db('0x0'));var moment=require('moment');var util=require(_0xe2db('0x1'));var config=require(_0xe2db('0x2'));var ami=require(_0xe2db('0x3'));var RpcVoiceAgentReport=require(_0xe2db('0x4'));var RpcVoiceCallReport=require(_0xe2db('0x5'));var RpcVoiceDialReport=require(_0xe2db('0x6'));var RpcMemberReport=require(_0xe2db('0x7'));var RpcVoiceQueueReport=require(_0xe2db('0x8'));var RpcVoiceRecording=require(_0xe2db('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xe2db('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xe2db('0xb'));var VoiceDialReport=require(_0xe2db('0xc'));var UserReport=require(_0xe2db('0xd'));function Report(_0x254ff4){this[_0xe2db('0xe')]=_0x254ff4;this[_0xe2db('0xf')]=_0x254ff4[_0xe2db('0xf')];this[_0xe2db('0x10')]=_0x254ff4[_0xe2db('0x10')];}Report[_0xe2db('0x11')][_0xe2db('0x12')]=function(_0x12fd58){var _0x22225c=new VoiceQueueReport(this['realtime']);var _0x67aee6=new VoiceAgentReport(this[_0xe2db('0xe')]);var _0x1d1f13=new VoiceDialReport(this[_0xe2db('0xe')]);var _0x21d93c=new VoiceCallReport(this['realtime']);var _0x17f7bb=new UserReport(this[_0xe2db('0xe')]);if(config[_0xe2db('0x13')]&&config[_0xe2db('0x13')]['disabled']){ami['on'](_0xe2db('0x14'),this[_0xe2db('0x15')][_0xe2db('0x16')](this));ami['on'](_0xe2db('0x17'),this['voiceCallReport']['bind'](this));ami['on'](_0xe2db('0x18'),this[_0xe2db('0x19')][_0xe2db('0x16')](this));ami['on']('custom:voiceDialReport',this[_0xe2db('0x1a')][_0xe2db('0x16')](this));ami['on']('blindtransfer',this[_0xe2db('0x1b')][_0xe2db('0x16')](this));ami['on'](_0xe2db('0x1c'),this[_0xe2db('0x1d')][_0xe2db('0x16')](this));}};Report['prototype']['findAgent']=function(_0x24389c){var _0x277656;_0x277656=_[_0xe2db('0x1e')](this['agents'],function(_0x588352){return _0x588352[_0xe2db('0x1f')]==_0x24389c||_0x588352[_0xe2db('0x20')]==_0x24389c;});if(_['isNil'](_0x277656)){var _0x44e379=_[_0xe2db('0x1e')](this[_0xe2db('0x10')],function(_0x158f3a){return _0x158f3a[_0xe2db('0x1f')]==_0x24389c||_0x158f3a[_0xe2db('0x20')]==_0x24389c;});if(_0x44e379){_0x277656=_[_0xe2db('0x1e')](this[_0xe2db('0xf')],function(_0x1275d6){return _0x1275d6[_0xe2db('0x21')]==util[_0xe2db('0x22')](_0xe2db('0x23'),_0x44e379[_0xe2db('0x20')]);});}}return _0x277656;};Report[_0xe2db('0x11')][_0xe2db('0x15')]=function(_0x5b5f94){for(var _0x2bc569=0x0;_0x2bc569<_0x5b5f94[_0xe2db('0x24')];_0x2bc569+=0x1){var _0x36b19a=this['findAgent'](_0x5b5f94[_0x2bc569][_0xe2db('0x25')]);if(_0x36b19a){_0x5b5f94[_0x2bc569][_0xe2db('0x1f')]=_0x36b19a[_0xe2db('0x1f')];_0x5b5f94[_0x2bc569][_0xe2db('0x26')]=!![];_0x5b5f94[_0x2bc569][_0xe2db('0x27')]=_0x36b19a['name'];_0x5b5f94[_0x2bc569][_0xe2db('0x21')]=_[_0xe2db('0x28')](_0x36b19a[_0xe2db('0x21')])?util[_0xe2db('0x22')](_0xe2db('0x23'),_0x36b19a[_0xe2db('0x20')]):_0x36b19a[_0xe2db('0x21')];if(_0x5b5f94[_0x2bc569][_0xe2db('0x29')]){_0x5b5f94[_0x2bc569]['queuecallercompleteAt']=moment()[_0xe2db('0x22')](_0xe2db('0x2a'));}if(_0x5b5f94[_0x2bc569][_0xe2db('0x2b')]){_0x5b5f94[_0x2bc569][_0xe2db('0x2c')]=moment()[_0xe2db('0x22')](_0xe2db('0x2a'));}RpcMemberReport['voiceQueueReport'](_0x5b5f94[_0x2bc569]);}RpcVoiceQueueReport[_0xe2db('0x2d')](_0x5b5f94[_0x2bc569]);}};function extractCalleridNumber(_0x583ad8){var _0x1a1b45=_0x583ad8[_0xe2db('0x2e')](/<(.*?)>/);return _0x1a1b45?_0x1a1b45[0x1]:_0x583ad8;}Report[_0xe2db('0x11')][_0xe2db('0x2f')]=function(_0x45ba40){for(var _0x356c7a=0x0;_0x356c7a<Object[_0xe2db('0x30')](this['agents'])[_0xe2db('0x24')];_0x356c7a++){var _0x45106c=Object[_0xe2db('0x30')](this[_0xe2db('0xf')])[_0x356c7a];var _0x37f106=this[_0xe2db('0xf')][_0x45106c];if(_0x37f106[_0xe2db('0x1f')]===Number(_0x45ba40))return _0x37f106;}return null;};Report[_0xe2db('0x11')][_0xe2db('0x31')]=function(_0x4c60f5){var _0x1391f7=_0x4c60f5['channel'][_0xe2db('0x32')]('-')[0x0];var _0xca65a=this['agents'][_0x1391f7];if(!_0xca65a)_0xca65a=this[_0xe2db('0x2f')](_0x4c60f5[_0xe2db('0x33')]);return!_0xca65a?_0xe2db('0x34'):'internal';};Report[_0xe2db('0x11')][_0xe2db('0x35')]=function(_0x3311d6){_0x3311d6[_0xe2db('0x36')]=_0x3311d6[_0xe2db('0x36')]||_0x3311d6[_0xe2db('0x37')];if(_0x3311d6[_0xe2db('0x38')]=='dialer'){_0x3311d6[_0xe2db('0x39')]='queue';_0x3311d6[_0xe2db('0x3a')]=_0x3311d6['queue'];if(_0x3311d6[_0xe2db('0x3b')]==_0xe2db('0x3c')){_0x3311d6[_0xe2db('0x1f')]='';_0x3311d6[_0xe2db('0x36')]=extractCalleridNumber(_0x3311d6['callerid']);}else if(_0x3311d6['context']=='from-sip'){if(_0x3311d6[_0xe2db('0x36')]==_0xe2db('0x3d')){_0x3311d6['destination']=extractCalleridNumber(_0x3311d6[_0xe2db('0x3e')]);_0x3311d6[_0xe2db('0x33')]=_0x3311d6[_0xe2db('0x3f')];_0x3311d6[_0xe2db('0x40')]=[_0x3311d6[_0xe2db('0x41')],_0x3311d6[_0xe2db('0x41')]=_0x3311d6[_0xe2db('0x40')]][0x0];_0x3311d6['callerid']=_0x3311d6[_0xe2db('0x3e')];}else{_0x3311d6[_0xe2db('0x36')]=_0x3311d6['calleridnum'];_0x3311d6['calleridnum']=_0x3311d6[_0xe2db('0x3f')];if(_0x3311d6['disposition']==_0xe2db('0x42')){_0x3311d6[_0xe2db('0x1f')]=_0x3311d6[_0xe2db('0x25')];}else{_0x3311d6[_0xe2db('0x1f')]='';}}}}else{_0x3311d6[_0xe2db('0x43')]=util['format'](_0xe2db('0x44'),_0x3311d6['calleridname'],_0x3311d6[_0xe2db('0x33')]);}if(RpcVoiceTransferReport[_0xe2db('0x45')][_0x3311d6[_0xe2db('0x46')]]){var _0x3882e8=RpcVoiceTransferReport['transfers'][_0x3311d6[_0xe2db('0x46')]];_0x3882e8[_0xe2db('0x47')]=_0x3311d6['uniqueid'];RpcVoiceTransferReport['blindTransfer'](_0x3882e8);delete RpcVoiceTransferReport[_0xe2db('0x45')][_0x3311d6[_0xe2db('0x46')]];}if(_[_0xe2db('0x28')](_0x3311d6['type'])){_0x3311d6['type']=this[_0xe2db('0x31')](_0x3311d6);}if(_[_0xe2db('0x28')](_0x3311d6[_0xe2db('0x48')])){var _0x2d4e76=_0x3311d6[_0xe2db('0x41')][_0xe2db('0x32')]('-')[0x0];var _0x28897b=this['agents'][_0x2d4e76];if(!_0x28897b)_0x28897b=this['getAgentByInternal'](_0x3311d6[_0xe2db('0x1f')]);if(_0x28897b){_0x3311d6[_0xe2db('0x48')]=_0x28897b['id'];_0x3311d6[_0xe2db('0x49')]=_0x28897b[_0xe2db('0x20')];}}RpcVoiceCallReport['create'](_0x3311d6);if(_0x3311d6[_0xe2db('0x4a')]){for(var _0x4b006c=0x0;_0x4b006c<_0x3311d6[_0xe2db('0x4b')][_0xe2db('0x24')];_0x4b006c+=0x1){_0x3311d6[_0xe2db('0x4c')]=_0x3311d6['monitors'][_0x4b006c]['filename'];_0x3311d6[_0xe2db('0x4d')]=_0x3311d6[_0xe2db('0x4b')][_0x4b006c][_0xe2db('0x4d')];if(_0x3311d6[_0xe2db('0x37')]==_0xe2db('0x3d')){_0x3311d6[_0xe2db('0x33')]=_0x3311d6[_0xe2db('0x25')];_0x3311d6[_0xe2db('0x4e')]=_0x3311d6[_0xe2db('0x4f')];_0x3311d6[_0xe2db('0x25')]=_0x3311d6[_0xe2db('0x1f')];_0x3311d6[_0xe2db('0x4f')]=_0x3311d6['membername'];_0x3311d6[_0xe2db('0x37')]=_0x3311d6[_0xe2db('0x3f')];}else if(_0x3311d6[_0xe2db('0x37')]==_0xe2db('0x50')){_0x3311d6['calleridnum']=_0x3311d6[_0xe2db('0x36')];_0x3311d6[_0xe2db('0x37')]=_0x3311d6[_0xe2db('0x3f')];}RpcVoiceRecording[_0xe2db('0x2d')](_0x3311d6);}}};Report[_0xe2db('0x11')][_0xe2db('0x19')]=function(_0x1eb785){if(_[_0xe2db('0x51')](_0x1eb785)){_0x1eb785['forEach'](function(_0x33ec28){RpcVoiceAgentReport[_0xe2db('0x2d')](_0x33ec28);});}else{RpcVoiceAgentReport[_0xe2db('0x2d')](_0x1eb785);}};Report[_0xe2db('0x11')][_0xe2db('0x1a')]=function(_0x27696f){RpcVoiceDialReport['create'](_0x27696f);var _0x4d8c87;var _0x4c50f7;var _0x1b676b=_0x27696f['channel'];if(_[_0xe2db('0x52')](_0x1b676b,_0xe2db('0x53'))){_0x4c50f7=_0x1b676b[_0xe2db('0x54')](_0x1b676b[_0xe2db('0x55')]('/')+0x1,_0x1b676b[_0xe2db('0x55')]('@'));_0x4d8c87=_['find'](this[_0xe2db('0xf')],function(_0x36a7bc){return _0x36a7bc['mobile']==_0x4c50f7||_0x36a7bc[_0xe2db('0x56')]==_0x4c50f7||_0x36a7bc[_0xe2db('0x1f')]==_0x4c50f7;});}else{_0x4c50f7=_0x1b676b[_0xe2db('0x54')](_0x1b676b['indexOf']('/')+0x1,_0x1b676b[_0xe2db('0x57')]('-'));_0x4d8c87=this[_0xe2db('0x58')](_0x4c50f7);}if(_0x4d8c87){_0x27696f[_0xe2db('0x21')]=_[_0xe2db('0x28')](_0x4d8c87['interface'])?util[_0xe2db('0x22')](_0xe2db('0x23'),_0x4d8c87['name']):_0x4d8c87[_0xe2db('0x21')];_0x27696f[_0xe2db('0x49')]=_0x4d8c87['name'];_0x27696f[_0xe2db('0x1f')]=_0x4d8c87['accountcode'];RpcMemberReport[_0xe2db('0x1a')](_0x27696f);}};Report[_0xe2db('0x11')][_0xe2db('0x1b')]=function(_0xa10207){RpcVoiceTransferReport['transfers'][_0xa10207['transfererlinkedid']]=_0xa10207;};Report[_0xe2db('0x11')][_0xe2db('0x1d')]=function(_0x1dcf91){RpcVoiceTransferReport[_0xe2db('0x1d')](_0x1dcf91);};module[_0xe2db('0x59')]=Report;
\ No newline at end of file
+var _0xc145=['phone','lastIndexOf','SIP/%s','transfererlinkedid','exports','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedTransfer','findAgent','find','isNil','accountcode','name','interface','format','length','connectedlinenum','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','destination','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','type','UserId','split','membername','monitor','monitors','filename','createdAt','exten','connectedlinename','isArray','startsWith','substring','indexOf'];(function(_0x17d163,_0x54f02b){var _0x5de506=function(_0x19e98f){while(--_0x19e98f){_0x17d163['push'](_0x17d163['shift']());}};_0x5de506(++_0x54f02b);}(_0xc145,0x1bd));var _0x5c14=function(_0x3bff57,_0x4c34c6){_0x3bff57=_0x3bff57-0x0;var _0x48af03=_0xc145[_0x3bff57];return _0x48af03;};'use strict';var _=require('lodash');var moment=require(_0x5c14('0x0'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0x5c14('0x1'));var RpcVoiceAgentReport=require(_0x5c14('0x2'));var RpcVoiceCallReport=require(_0x5c14('0x3'));var RpcVoiceDialReport=require(_0x5c14('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x5c14('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x5c14('0x6'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x5c14('0x7'));var VoiceDialReport=require(_0x5c14('0x8'));var UserReport=require(_0x5c14('0x9'));function Report(_0x208b0a){this['realtime']=_0x208b0a;this['agents']=_0x208b0a[_0x5c14('0xa')];this[_0x5c14('0xb')]=_0x208b0a[_0x5c14('0xb')];}Report[_0x5c14('0xc')][_0x5c14('0xd')]=function(_0x5e0e81){var _0x56f355=new VoiceQueueReport(this['realtime']);var _0x97dcbd=new VoiceAgentReport(this['realtime']);var _0x37028c=new VoiceDialReport(this[_0x5c14('0xe')]);var _0x2a82e1=new VoiceCallReport(this[_0x5c14('0xe')]);var _0xda9f6b=new UserReport(this['realtime']);if(config[_0x5c14('0xf')]&&config[_0x5c14('0xf')][_0x5c14('0x10')]){ami['on'](_0x5c14('0x11'),this[_0x5c14('0x12')]['bind'](this));ami['on'](_0x5c14('0x13'),this[_0x5c14('0x14')][_0x5c14('0x15')](this));ami['on'](_0x5c14('0x16'),this[_0x5c14('0x17')][_0x5c14('0x15')](this));ami['on'](_0x5c14('0x18'),this[_0x5c14('0x19')][_0x5c14('0x15')](this));ami['on']('blindtransfer',this[_0x5c14('0x1a')][_0x5c14('0x15')](this));ami['on']('attendedtransfer',this[_0x5c14('0x1b')]['bind'](this));}};Report[_0x5c14('0xc')][_0x5c14('0x1c')]=function(_0x34db63){var _0x4688d2;_0x4688d2=_[_0x5c14('0x1d')](this['agents'],function(_0x4fb709){return _0x4fb709['accountcode']==_0x34db63||_0x4fb709['name']==_0x34db63;});if(_[_0x5c14('0x1e')](_0x4688d2)){var _0x1a63aa=_[_0x5c14('0x1d')](this[_0x5c14('0xb')],function(_0x494332){return _0x494332[_0x5c14('0x1f')]==_0x34db63||_0x494332[_0x5c14('0x20')]==_0x34db63;});if(_0x1a63aa){_0x4688d2=_[_0x5c14('0x1d')](this[_0x5c14('0xa')],function(_0x1ad398){return _0x1ad398[_0x5c14('0x21')]==util[_0x5c14('0x22')]('SIP/%s',_0x1a63aa[_0x5c14('0x20')]);});}}return _0x4688d2;};Report[_0x5c14('0xc')][_0x5c14('0x12')]=function(_0x1d7c4d){for(var _0x2ea695=0x0;_0x2ea695<_0x1d7c4d[_0x5c14('0x23')];_0x2ea695+=0x1){var _0x580f38=this[_0x5c14('0x1c')](_0x1d7c4d[_0x2ea695][_0x5c14('0x24')]);if(_0x580f38){_0x1d7c4d[_0x2ea695][_0x5c14('0x1f')]=_0x580f38[_0x5c14('0x1f')];_0x1d7c4d[_0x2ea695]['assigned']=!![];_0x1d7c4d[_0x2ea695][_0x5c14('0x25')]=_0x580f38[_0x5c14('0x20')];_0x1d7c4d[_0x2ea695][_0x5c14('0x21')]=_['isNil'](_0x580f38['interface'])?util[_0x5c14('0x22')]('SIP/%s',_0x580f38[_0x5c14('0x20')]):_0x580f38[_0x5c14('0x21')];if(_0x1d7c4d[_0x2ea695]['queuecallercomplete']){_0x1d7c4d[_0x2ea695][_0x5c14('0x26')]=moment()[_0x5c14('0x22')](_0x5c14('0x27'));}if(_0x1d7c4d[_0x2ea695][_0x5c14('0x28')]){_0x1d7c4d[_0x2ea695][_0x5c14('0x29')]=moment()[_0x5c14('0x22')](_0x5c14('0x27'));}RpcMemberReport[_0x5c14('0x12')](_0x1d7c4d[_0x2ea695]);}RpcVoiceQueueReport[_0x5c14('0x2a')](_0x1d7c4d[_0x2ea695]);}};function extractCalleridNumber(_0x10317c){var _0x59245d=_0x10317c[_0x5c14('0x2b')](/<(.*?)>/);return _0x59245d?_0x59245d[0x1]:_0x10317c;}Report['prototype'][_0x5c14('0x2c')]=function(_0x58b74b){for(var _0xf17ac6=0x0;_0xf17ac6<Object[_0x5c14('0x2d')](this[_0x5c14('0xa')])[_0x5c14('0x23')];_0xf17ac6++){var _0xe24899=Object[_0x5c14('0x2d')](this['agents'])[_0xf17ac6];var _0x4d9a22=this[_0x5c14('0xa')][_0xe24899];if(_0x4d9a22[_0x5c14('0x1f')]===Number(_0x58b74b))return _0x4d9a22;}return null;};Report['prototype'][_0x5c14('0x2e')]=function(_0xd7f29c){var _0x21ac9a=_0xd7f29c[_0x5c14('0x2f')]['split']('-')[0x0];var _0x5e0f5f=this[_0x5c14('0xa')][_0x21ac9a];if(!_0x5e0f5f)_0x5e0f5f=this['getAgentByInternal'](_0xd7f29c[_0x5c14('0x30')]);return!_0x5e0f5f?'outbound':'internal';};Report[_0x5c14('0xc')][_0x5c14('0x14')]=function(_0x3c6937){_0x3c6937[_0x5c14('0x31')]=_0x3c6937[_0x5c14('0x31')]||_0x3c6937['exten'];if(_0x3c6937['type']==_0x5c14('0x32')){_0x3c6937[_0x5c14('0x33')]=_0x5c14('0x34');_0x3c6937[_0x5c14('0x35')]=_0x3c6937[_0x5c14('0x34')];if(_0x3c6937[_0x5c14('0x36')]==_0x5c14('0x37')){_0x3c6937[_0x5c14('0x1f')]='';_0x3c6937[_0x5c14('0x31')]=extractCalleridNumber(_0x3c6937[_0x5c14('0x38')]);}else if(_0x3c6937[_0x5c14('0x36')]==_0x5c14('0x39')){if(_0x3c6937[_0x5c14('0x31')]==_0x5c14('0x3a')){_0x3c6937[_0x5c14('0x31')]=extractCalleridNumber(_0x3c6937[_0x5c14('0x3b')]);_0x3c6937['calleridnum']=_0x3c6937['originatecalleridnum'];_0x3c6937[_0x5c14('0x3c')]=[_0x3c6937[_0x5c14('0x2f')],_0x3c6937[_0x5c14('0x2f')]=_0x3c6937[_0x5c14('0x3c')]][0x0];_0x3c6937[_0x5c14('0x38')]=_0x3c6937[_0x5c14('0x3b')];}else{_0x3c6937[_0x5c14('0x31')]=_0x3c6937[_0x5c14('0x30')];_0x3c6937['calleridnum']=_0x3c6937[_0x5c14('0x3d')];if(_0x3c6937['disposition']==_0x5c14('0x3e')){_0x3c6937['accountcode']=_0x3c6937[_0x5c14('0x24')];}else{_0x3c6937[_0x5c14('0x1f')]='';}}}}else{_0x3c6937[_0x5c14('0x38')]=util['format'](_0x5c14('0x3f'),_0x3c6937[_0x5c14('0x40')],_0x3c6937[_0x5c14('0x30')]);}if(RpcVoiceTransferReport['transfers'][_0x3c6937[_0x5c14('0x41')]]){var _0x181227=RpcVoiceTransferReport[_0x5c14('0x42')][_0x3c6937['linkedid']];_0x181227[_0x5c14('0x43')]=_0x3c6937[_0x5c14('0x44')];RpcVoiceTransferReport[_0x5c14('0x1a')](_0x181227);delete RpcVoiceTransferReport[_0x5c14('0x42')][_0x3c6937['linkedid']];}if(_[_0x5c14('0x1e')](_0x3c6937[_0x5c14('0x45')])){_0x3c6937[_0x5c14('0x45')]=this[_0x5c14('0x2e')](_0x3c6937);}if(_[_0x5c14('0x1e')](_0x3c6937[_0x5c14('0x46')])){var _0x4d4bf5=_0x3c6937[_0x5c14('0x2f')][_0x5c14('0x47')]('-')[0x0];var _0x59a139=this[_0x5c14('0xa')][_0x4d4bf5];if(!_0x59a139)_0x59a139=this[_0x5c14('0x2c')](_0x3c6937[_0x5c14('0x1f')]);if(_0x59a139){_0x3c6937[_0x5c14('0x46')]=_0x59a139['id'];_0x3c6937[_0x5c14('0x48')]=_0x59a139[_0x5c14('0x20')];}}RpcVoiceCallReport[_0x5c14('0x2a')](_0x3c6937);if(_0x3c6937[_0x5c14('0x49')]){for(var _0xf6364e=0x0;_0xf6364e<_0x3c6937[_0x5c14('0x4a')][_0x5c14('0x23')];_0xf6364e+=0x1){_0x3c6937['monitorFilename']=_0x3c6937[_0x5c14('0x4a')][_0xf6364e][_0x5c14('0x4b')];_0x3c6937[_0x5c14('0x4c')]=_0x3c6937[_0x5c14('0x4a')][_0xf6364e][_0x5c14('0x4c')];if(_0x3c6937[_0x5c14('0x4d')]==_0x5c14('0x3a')){_0x3c6937[_0x5c14('0x30')]=_0x3c6937[_0x5c14('0x24')];_0x3c6937[_0x5c14('0x40')]=_0x3c6937['connectedlinename'];_0x3c6937[_0x5c14('0x24')]=_0x3c6937[_0x5c14('0x1f')];_0x3c6937[_0x5c14('0x4e')]=_0x3c6937[_0x5c14('0x48')];_0x3c6937[_0x5c14('0x4d')]=_0x3c6937['originatecalleridnum'];}else if(_0x3c6937[_0x5c14('0x4d')]=='xcally-motion-dialer'){_0x3c6937['calleridnum']=_0x3c6937[_0x5c14('0x31')];_0x3c6937[_0x5c14('0x4d')]=_0x3c6937[_0x5c14('0x3d')];}RpcVoiceRecording[_0x5c14('0x2a')](_0x3c6937);}}};Report['prototype'][_0x5c14('0x17')]=function(_0x341e0b){if(_[_0x5c14('0x4f')](_0x341e0b)){_0x341e0b['forEach'](function(_0xcc9877){RpcVoiceAgentReport[_0x5c14('0x2a')](_0xcc9877);});}else{RpcVoiceAgentReport['create'](_0x341e0b);}};Report[_0x5c14('0xc')]['voiceDialReport']=function(_0x5cd299){RpcVoiceDialReport[_0x5c14('0x2a')](_0x5cd299);var _0x70f82d;var _0x2c8f57;var _0x416e5f=_0x5cd299['channel'];if(_[_0x5c14('0x50')](_0x416e5f,'Local')){_0x2c8f57=_0x416e5f[_0x5c14('0x51')](_0x416e5f[_0x5c14('0x52')]('/')+0x1,_0x416e5f[_0x5c14('0x52')]('@'));_0x70f82d=_[_0x5c14('0x1d')](this[_0x5c14('0xa')],function(_0x4926e2){return _0x4926e2['mobile']==_0x2c8f57||_0x4926e2[_0x5c14('0x53')]==_0x2c8f57||_0x4926e2[_0x5c14('0x1f')]==_0x2c8f57;});}else{_0x2c8f57=_0x416e5f[_0x5c14('0x51')](_0x416e5f['indexOf']('/')+0x1,_0x416e5f[_0x5c14('0x54')]('-'));_0x70f82d=this['findAgent'](_0x2c8f57);}if(_0x70f82d){_0x5cd299[_0x5c14('0x21')]=_[_0x5c14('0x1e')](_0x70f82d[_0x5c14('0x21')])?util['format'](_0x5c14('0x55'),_0x70f82d[_0x5c14('0x20')]):_0x70f82d[_0x5c14('0x21')];_0x5cd299[_0x5c14('0x48')]=_0x70f82d[_0x5c14('0x20')];_0x5cd299['accountcode']=_0x70f82d[_0x5c14('0x1f')];RpcMemberReport['voiceDialReport'](_0x5cd299);}};Report[_0x5c14('0xc')][_0x5c14('0x1a')]=function(_0x52873){RpcVoiceTransferReport[_0x5c14('0x42')][_0x52873[_0x5c14('0x56')]]=_0x52873;};Report['prototype'][_0x5c14('0x1b')]=function(_0x58cddb){RpcVoiceTransferReport[_0x5c14('0x1b')](_0x58cddb);};module[_0x5c14('0x57')]=Report;
\ No newline at end of file
index cfa191c..6b8670e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c50=['device','local','inuse','toLowerCase','stateTime','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','name','toNumber','startsWith','indexOf','find','phone','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','status','lodash','moment','util','bluebird','../../../config/environment','../../../config/logger','ami','../ami','defaults','localhost','socket.io-emitter','trunks','agents','telephones','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','catch','[userReport][sipshowregistry]','actionDeviceStateList','inspect','error','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','syncRegistry','info','username','state','debug','[userReport][registry]','merge','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s'];(function(_0x5933bb,_0x546730){var _0x193a96=function(_0x3b3ee4){while(--_0x3b3ee4){_0x5933bb['push'](_0x5933bb['shift']());}};_0x193a96(++_0x546730);}(_0x4c50,0x9c));var _0x04c5=function(_0x21ce6e,_0x5cf3a3){_0x21ce6e=_0x21ce6e-0x0;var _0x4e164f=_0x4c50[_0x21ce6e];return _0x4e164f;};'use strict';var _=require(_0x04c5('0x0'));var moment=require(_0x04c5('0x1'));var util=require(_0x04c5('0x2'));var Redis=require('ioredis');var BPromise=require(_0x04c5('0x3'));var config=require(_0x04c5('0x4'));var logger=require(_0x04c5('0x5'))(_0x04c5('0x6'));var ami=require(_0x04c5('0x7'));config['redis']=_[_0x04c5('0x8')](config['redis'],{'host':_0x04c5('0x9'),'port':0x18eb});var io=require(_0x04c5('0xa'))(new Redis(config['redis']));function UserReport(_0x2b43b8){this[_0x04c5('0xb')]=_0x2b43b8[_0x04c5('0xb')];this['agents']=_0x2b43b8[_0x04c5('0xc')];this[_0x04c5('0xd')]=_0x2b43b8['telephones'];ami['on']('registryentry',this['syncRegistry'][_0x04c5('0xe')](this));ami['on'](_0x04c5('0xf'),this['syncRegistry']['bind'](this));ami['on']('devicestatechange',this[_0x04c5('0x10')]['bind'](this));ami['on'](_0x04c5('0x11'),this[_0x04c5('0x12')][_0x04c5('0xe')](this));return this[_0x04c5('0x13')]();}function showSipRegistrations(){Promise[_0x04c5('0x14')]()[_0x04c5('0x15')](ami['actionSipShowRegistry']())[_0x04c5('0x16')](function(_0x3ae88b){logger['error'](_0x04c5('0x17'),util['inspect'](_0x3ae88b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x04c5('0x14')]()[_0x04c5('0x15')](ami[_0x04c5('0x18')]())[_0x04c5('0x16')](function(_0x131888){logger['error']('[userReport][devicestatelist]',util[_0x04c5('0x19')](_0x131888,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x04c5('0x14')]()[_0x04c5('0x15')](ami['actionSipPeerStatus']())[_0x04c5('0x16')](function(_0x412bb7){logger[_0x04c5('0x1a')](_0x04c5('0x1b'),util['inspect'](_0x412bb7,{'showHidden':![],'depth':null}));});}UserReport[_0x04c5('0x1c')][_0x04c5('0x13')]=function(){setInterval(function(){BPromise[_0x04c5('0x14')]()[_0x04c5('0x15')](showSipRegistrations())[_0x04c5('0x15')](listDeviceStates())[_0x04c5('0x15')](showPeersStatus());},0x32c8);};UserReport[_0x04c5('0x1c')][_0x04c5('0x1d')]=function(_0x1e8c8c){return _0x1e8c8c!==null&&!_[_0x04c5('0x1e')](_0x1e8c8c);};UserReport[_0x04c5('0x1c')][_0x04c5('0x1f')]=function(_0x1b7419,_0x5b269e,_0x54cc3d){io['to'](_0x1b7419)[_0x04c5('0x1f')](_0x5b269e,_0x54cc3d);};UserReport[_0x04c5('0x1c')][_0x04c5('0x20')]=function(_0x5a8faf){try{if(this[_0x04c5('0x1d')](_0x5a8faf)){logger[_0x04c5('0x21')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x5a8faf[_0x04c5('0x22')],_0x5a8faf[_0x04c5('0x23')]);logger[_0x04c5('0x24')](_0x04c5('0x25'),util['inspect'](_0x5a8faf,{'showHidden':![],'depth':null}));var _0x216c79=_['find'](this[_0x04c5('0xb')],{'defaultuser':_0x5a8faf[_0x04c5('0x22')]});if(_0x216c79){_0x5a8faf['stateRegistry']=_0x5a8faf[_0x04c5('0x23')];_[_0x04c5('0x26')](_0x216c79,_['omit'](_0x5a8faf,[_0x04c5('0x27'),'actionid','username',_0x04c5('0x23')]));logger['debug'](_0x04c5('0x28'),util[_0x04c5('0x19')](_0x216c79,{'showHidden':![],'depth':null}));this[_0x04c5('0x1f')](util[_0x04c5('0x29')](_0x04c5('0x2a'),_0x216c79['name']),_0x04c5('0x2b'),_0x216c79);}}}catch(_0x456d1f){logger[_0x04c5('0x1a')](_0x04c5('0x25'),util['inspect'](_0x456d1f,{'showHidden':![],'depth':null}));}};UserReport[_0x04c5('0x1c')][_0x04c5('0x10')]=function(_0x15596f){try{if(this[_0x04c5('0x1d')](_0x15596f)){logger[_0x04c5('0x21')](_0x04c5('0x2c'),_0x15596f[_0x04c5('0x2d')],_0x15596f[_0x04c5('0x23')]);logger['debug']('[userReport][devicestatechange]',util[_0x04c5('0x19')](_0x15596f,{'showHidden':![],'depth':null}));if(this['agents'][_0x15596f[_0x04c5('0x2d')]]){if(!this[_0x04c5('0xc')][_0x15596f['device']][_0x04c5('0x2e')]||_0x15596f['state']['toLowerCase']()==_0x04c5('0x2f')){this[_0x04c5('0xc')][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x2e')]=![];if(this[_0x04c5('0xc')][_0x15596f[_0x04c5('0x2d')]]['state']!==_0x15596f[_0x04c5('0x23')][_0x04c5('0x30')]()){this['agents'][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x31')]=_['toNumber'](moment()[_0x04c5('0x29')]('x'));}this[_0x04c5('0xc')][_0x15596f['device']]['state']=_0x15596f[_0x04c5('0x23')][_0x04c5('0x30')]();this[_0x04c5('0xc')][_0x15596f['device']][_0x04c5('0x32')](_0x15596f);}}else if(this[_0x04c5('0xd')][_0x15596f[_0x04c5('0x2d')]]){if(this[_0x04c5('0xd')][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x23')]!==_0x15596f['state'][_0x04c5('0x30')]()){this[_0x04c5('0xd')][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x31')]=_['toNumber'](moment()[_0x04c5('0x29')]('x'));}this[_0x04c5('0xd')][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x23')]=_0x15596f[_0x04c5('0x23')]['toLowerCase']();logger[_0x04c5('0x24')](_0x04c5('0x33'),util['inspect'](this[_0x04c5('0xd')][_0x15596f[_0x04c5('0x2d')]],{'showHidden':![],'depth':null}));this[_0x04c5('0x1f')](util[_0x04c5('0x29')]('telephone:%s',this['telephones'][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x34')]),'telephone:save',this['telephones'][_0x15596f[_0x04c5('0x2d')]]);}else if(this[_0x04c5('0xb')][_0x15596f['device']]){if(this['trunks'][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x23')]!==_0x15596f[_0x04c5('0x23')]['toLowerCase']()){this[_0x04c5('0xb')][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x31')]=_[_0x04c5('0x35')](moment()[_0x04c5('0x29')]('x'));}this['trunks'][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x23')]=_0x15596f[_0x04c5('0x23')]['toLowerCase']();logger[_0x04c5('0x24')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x04c5('0x19')](this['trunks'][_0x15596f[_0x04c5('0x2d')]],{'showHidden':![],'depth':null}));this[_0x04c5('0x1f')](util[_0x04c5('0x29')](_0x04c5('0x2a'),this[_0x04c5('0xb')][_0x15596f[_0x04c5('0x2d')]][_0x04c5('0x34')]),_0x04c5('0x2b'),this[_0x04c5('0xb')][_0x15596f[_0x04c5('0x2d')]]);}else if(_[_0x04c5('0x36')](_0x15596f[_0x04c5('0x2d')],'Local')){var _0x3cf838=_0x15596f[_0x04c5('0x2d')];var _0x2bc3ca=_0x3cf838['substring'](_0x3cf838[_0x04c5('0x37')]('/')+0x1,_0x3cf838[_0x04c5('0x37')]('@'));var _0x529b3a=_[_0x04c5('0x38')](this[_0x04c5('0xc')],function(_0x404931){return _0x404931['mobile']==_0x2bc3ca||_0x404931[_0x04c5('0x39')]==_0x2bc3ca||_0x404931[_0x04c5('0x3a')]==_0x2bc3ca;});if(_0x529b3a){if(_0x529b3a['state']!==_0x15596f['state'][_0x04c5('0x30')]()){_0x529b3a[_0x04c5('0x31')]=_[_0x04c5('0x35')](moment()[_0x04c5('0x29')]('x'));}_0x529b3a[_0x04c5('0x23')]=_0x15596f[_0x04c5('0x23')][_0x04c5('0x30')]();_0x529b3a[_0x04c5('0x2e')]=!![];_0x529b3a['updateStatusRealtime'](_0x15596f);}}}}catch(_0x207784){logger[_0x04c5('0x1a')](_0x04c5('0x3b'),util['inspect'](_0x207784,{'showHidden':![],'depth':null}));}};UserReport[_0x04c5('0x1c')][_0x04c5('0x12')]=function(_0x27f830){try{if(this[_0x04c5('0x1d')](_0x27f830)&&this[_0x04c5('0x1d')](_0x27f830[_0x04c5('0x11')])){logger['info'](_0x04c5('0x3c'),_0x27f830['peer'],_0x27f830[_0x04c5('0x3d')],_0x27f830[_0x04c5('0x11')]);logger['debug'](_0x04c5('0x3e'),util[_0x04c5('0x19')](_0x27f830,{'showHidden':![],'depth':null}));if(this[_0x04c5('0xc')][_0x27f830['peer']]){if(!this[_0x04c5('0xc')][_0x27f830['peer']][_0x04c5('0x2e')]||_0x27f830[_0x04c5('0x11')][_0x04c5('0x30')]()=='registered'){this[_0x04c5('0xc')][_0x27f830[_0x04c5('0x3f')]]['local']=![];this[_0x04c5('0xc')][_0x27f830[_0x04c5('0x3f')]]['status']=_0x27f830[_0x04c5('0x11')][_0x04c5('0x30')]();this[_0x04c5('0xc')][_0x27f830['peer']][_0x04c5('0x3d')]=_0x27f830['address'];this[_0x04c5('0xc')][_0x27f830['peer']][_0x04c5('0x32')](_0x27f830);}}else if(this[_0x04c5('0xd')][_0x27f830['peer']]){this[_0x04c5('0xd')][_0x27f830[_0x04c5('0x3f')]]['status']=_0x27f830[_0x04c5('0x11')][_0x04c5('0x30')]();this[_0x04c5('0xd')][_0x27f830[_0x04c5('0x3f')]]['address']=_0x27f830[_0x04c5('0x3d')];logger[_0x04c5('0x24')](_0x04c5('0x40'),util[_0x04c5('0x19')](this['telephones'][_0x27f830[_0x04c5('0x3f')]],{'showHidden':![],'depth':null}));this[_0x04c5('0x1f')](util['format'](_0x04c5('0x41'),this[_0x04c5('0xd')][_0x27f830[_0x04c5('0x3f')]][_0x04c5('0x34')]),'telephone:save',this[_0x04c5('0xd')][_0x27f830[_0x04c5('0x3f')]]);}else if(this[_0x04c5('0xb')][_0x27f830[_0x04c5('0x3f')]]){this[_0x04c5('0xb')][_0x27f830['peer']][_0x04c5('0x42')]=_0x27f830['peerstatus'][_0x04c5('0x30')]();this[_0x04c5('0xb')][_0x27f830[_0x04c5('0x3f')]][_0x04c5('0x3d')]=_0x27f830[_0x04c5('0x3d')];logger[_0x04c5('0x24')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x04c5('0x19')](this[_0x04c5('0xb')][_0x27f830['peer']],{'showHidden':![],'depth':null}));this[_0x04c5('0x1f')](util['format'](_0x04c5('0x2a'),this[_0x04c5('0xb')][_0x27f830[_0x04c5('0x3f')]][_0x04c5('0x34')]),_0x04c5('0x2b'),this['trunks'][_0x27f830[_0x04c5('0x3f')]]);}}}catch(_0x3b3858){logger['error']('[userReport][peerstatus]',util[_0x04c5('0x19')](_0x3b3858,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
+var _0x371a=['status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','syncRegistry','registry','bind','devicestatechange','syncRealtimeShow','resolve','then','error','[userReport][sipshowregistry]','inspect','[userReport][devicestatelist]','actionSipPeerStatus','catch','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','merge','omit','event','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','toLowerCase','inuse','local','toNumber','telephones','telephone:%s','telephone:save','stateTime','name','startsWith','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','[userReport][devicestatechange]','syncPeerStatus','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address'];(function(_0x17e174,_0x4991f8){var _0x3f26f1=function(_0x169012){while(--_0x169012){_0x17e174['push'](_0x17e174['shift']());}};_0x3f26f1(++_0x4991f8);}(_0x371a,0x12c));var _0xa371=function(_0x1c3723,_0x628348){_0x1c3723=_0x1c3723-0x0;var _0x539e45=_0x371a[_0x1c3723];return _0x539e45;};'use strict';var _=require(_0xa371('0x0'));var moment=require(_0xa371('0x1'));var util=require(_0xa371('0x2'));var Redis=require('ioredis');var BPromise=require(_0xa371('0x3'));var config=require(_0xa371('0x4'));var logger=require(_0xa371('0x5'))(_0xa371('0x6'));var ami=require(_0xa371('0x7'));config[_0xa371('0x8')]=_[_0xa371('0x9')](config[_0xa371('0x8')],{'host':_0xa371('0xa'),'port':0x18eb});var io=require(_0xa371('0xb'))(new Redis(config[_0xa371('0x8')]));function UserReport(_0xabc10b){this[_0xa371('0xc')]=_0xabc10b[_0xa371('0xc')];this[_0xa371('0xd')]=_0xabc10b[_0xa371('0xd')];this['telephones']=_0xabc10b['telephones'];ami['on']('registryentry',this[_0xa371('0xe')]['bind'](this));ami['on'](_0xa371('0xf'),this[_0xa371('0xe')][_0xa371('0x10')](this));ami['on'](_0xa371('0x11'),this['syncDeviceState'][_0xa371('0x10')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0xa371('0x10')](this));return this[_0xa371('0x12')]();}function showSipRegistrations(){Promise[_0xa371('0x13')]()[_0xa371('0x14')](ami['actionSipShowRegistry']())['catch'](function(_0x2ed96b){logger[_0xa371('0x15')](_0xa371('0x16'),util[_0xa371('0x17')](_0x2ed96b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xa371('0x13')]()[_0xa371('0x14')](ami['actionDeviceStateList']())['catch'](function(_0xd67a2d){logger[_0xa371('0x15')](_0xa371('0x18'),util[_0xa371('0x17')](_0xd67a2d,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xa371('0x13')]()['then'](ami[_0xa371('0x19')]())[_0xa371('0x1a')](function(_0x4a18d3){logger[_0xa371('0x15')]('[userReport][sippeerstatus]',util[_0xa371('0x17')](_0x4a18d3,{'showHidden':![],'depth':null}));});}UserReport[_0xa371('0x1b')][_0xa371('0x12')]=function(){setInterval(function(){BPromise[_0xa371('0x13')]()['then'](showSipRegistrations())[_0xa371('0x14')](listDeviceStates())[_0xa371('0x14')](showPeersStatus());},0x32c8);};UserReport[_0xa371('0x1b')]['isNotNull']=function(_0x28b1c2){return _0x28b1c2!==null&&!_[_0xa371('0x1c')](_0x28b1c2);};UserReport[_0xa371('0x1b')][_0xa371('0x1d')]=function(_0x57ece4,_0x50d503,_0x4fa3ca){io['to'](_0x57ece4)[_0xa371('0x1d')](_0x50d503,_0x4fa3ca);};UserReport[_0xa371('0x1b')][_0xa371('0xe')]=function(_0x6b92b7){try{if(this[_0xa371('0x1e')](_0x6b92b7)){logger[_0xa371('0x1f')](_0xa371('0x20'),_0x6b92b7[_0xa371('0x21')],_0x6b92b7[_0xa371('0x22')]);logger['debug'](_0xa371('0x23'),util[_0xa371('0x17')](_0x6b92b7,{'showHidden':![],'depth':null}));var _0x547ed4=_[_0xa371('0x24')](this[_0xa371('0xc')],{'defaultuser':_0x6b92b7['username']});if(_0x547ed4){_0x6b92b7['stateRegistry']=_0x6b92b7['state'];_[_0xa371('0x25')](_0x547ed4,_[_0xa371('0x26')](_0x6b92b7,[_0xa371('0x27'),'actionid',_0xa371('0x21'),_0xa371('0x22')]));logger[_0xa371('0x28')](_0xa371('0x29'),util[_0xa371('0x17')](_0x547ed4,{'showHidden':![],'depth':null}));this[_0xa371('0x1d')](util[_0xa371('0x2a')](_0xa371('0x2b'),_0x547ed4['name']),_0xa371('0x2c'),_0x547ed4);}}}catch(_0x389d78){logger['error'](_0xa371('0x23'),util['inspect'](_0x389d78,{'showHidden':![],'depth':null}));}};UserReport[_0xa371('0x1b')]['syncDeviceState']=function(_0x1874ae){try{if(this[_0xa371('0x1e')](_0x1874ae)){logger[_0xa371('0x1f')](_0xa371('0x2d'),_0x1874ae[_0xa371('0x2e')],_0x1874ae[_0xa371('0x22')]);logger['debug']('[userReport][devicestatechange]',util[_0xa371('0x17')](_0x1874ae,{'showHidden':![],'depth':null}));if(this[_0xa371('0xd')][_0x1874ae[_0xa371('0x2e')]]){if(!this[_0xa371('0xd')][_0x1874ae['device']]['local']||_0x1874ae[_0xa371('0x22')][_0xa371('0x2f')]()==_0xa371('0x30')){this['agents'][_0x1874ae[_0xa371('0x2e')]][_0xa371('0x31')]=![];if(this[_0xa371('0xd')][_0x1874ae[_0xa371('0x2e')]][_0xa371('0x22')]!==_0x1874ae['state'][_0xa371('0x2f')]()){this['agents'][_0x1874ae['device']]['stateTime']=_[_0xa371('0x32')](moment()[_0xa371('0x2a')]('x'));}this['agents'][_0x1874ae['device']]['state']=_0x1874ae[_0xa371('0x22')][_0xa371('0x2f')]();this['agents'][_0x1874ae[_0xa371('0x2e')]]['updateStatusRealtime'](_0x1874ae);}}else if(this[_0xa371('0x33')][_0x1874ae[_0xa371('0x2e')]]){if(this[_0xa371('0x33')][_0x1874ae[_0xa371('0x2e')]][_0xa371('0x22')]!==_0x1874ae[_0xa371('0x22')][_0xa371('0x2f')]()){this[_0xa371('0x33')][_0x1874ae[_0xa371('0x2e')]]['stateTime']=_[_0xa371('0x32')](moment()[_0xa371('0x2a')]('x'));}this[_0xa371('0x33')][_0x1874ae[_0xa371('0x2e')]][_0xa371('0x22')]=_0x1874ae[_0xa371('0x22')][_0xa371('0x2f')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this['telephones'][_0x1874ae[_0xa371('0x2e')]],{'showHidden':![],'depth':null}));this[_0xa371('0x1d')](util[_0xa371('0x2a')](_0xa371('0x34'),this['telephones'][_0x1874ae[_0xa371('0x2e')]]['name']),_0xa371('0x35'),this[_0xa371('0x33')][_0x1874ae[_0xa371('0x2e')]]);}else if(this['trunks'][_0x1874ae[_0xa371('0x2e')]]){if(this['trunks'][_0x1874ae[_0xa371('0x2e')]]['state']!==_0x1874ae[_0xa371('0x22')][_0xa371('0x2f')]()){this[_0xa371('0xc')][_0x1874ae[_0xa371('0x2e')]][_0xa371('0x36')]=_[_0xa371('0x32')](moment()['format']('x'));}this[_0xa371('0xc')][_0x1874ae['device']][_0xa371('0x22')]=_0x1874ae[_0xa371('0x22')][_0xa371('0x2f')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xa371('0x17')](this[_0xa371('0xc')][_0x1874ae[_0xa371('0x2e')]],{'showHidden':![],'depth':null}));this[_0xa371('0x1d')](util[_0xa371('0x2a')]('trunk:%s',this['trunks'][_0x1874ae[_0xa371('0x2e')]][_0xa371('0x37')]),'trunk:save',this[_0xa371('0xc')][_0x1874ae['device']]);}else if(_[_0xa371('0x38')](_0x1874ae[_0xa371('0x2e')],_0xa371('0x39'))){var _0x2ed08f=_0x1874ae[_0xa371('0x2e')];var _0x1d0283=_0x2ed08f[_0xa371('0x3a')](_0x2ed08f['indexOf']('/')+0x1,_0x2ed08f[_0xa371('0x3b')]('@'));var _0x53cb62=_['find'](this[_0xa371('0xd')],function(_0x4f5eb7){return _0x4f5eb7[_0xa371('0x3c')]==_0x1d0283||_0x4f5eb7[_0xa371('0x3d')]==_0x1d0283||_0x4f5eb7[_0xa371('0x3e')]==_0x1d0283;});if(_0x53cb62){if(_0x53cb62[_0xa371('0x22')]!==_0x1874ae[_0xa371('0x22')]['toLowerCase']()){_0x53cb62[_0xa371('0x36')]=_[_0xa371('0x32')](moment()['format']('x'));}_0x53cb62['state']=_0x1874ae['state'][_0xa371('0x2f')]();_0x53cb62[_0xa371('0x31')]=!![];_0x53cb62[_0xa371('0x3f')](_0x1874ae);}}}}catch(_0x25a294){logger[_0xa371('0x15')](_0xa371('0x40'),util[_0xa371('0x17')](_0x25a294,{'showHidden':![],'depth':null}));}};UserReport[_0xa371('0x1b')][_0xa371('0x41')]=function(_0x54c5aa){try{if(this[_0xa371('0x1e')](_0x54c5aa)&&this[_0xa371('0x1e')](_0x54c5aa[_0xa371('0x42')])){logger[_0xa371('0x1f')](_0xa371('0x43'),_0x54c5aa[_0xa371('0x44')],_0x54c5aa[_0xa371('0x45')],_0x54c5aa[_0xa371('0x42')]);logger['debug']('[userReport][peerstatus]',util[_0xa371('0x17')](_0x54c5aa,{'showHidden':![],'depth':null}));if(this['agents'][_0x54c5aa['peer']]){if(!this['agents'][_0x54c5aa[_0xa371('0x44')]][_0xa371('0x31')]||_0x54c5aa[_0xa371('0x42')][_0xa371('0x2f')]()=='registered'){this[_0xa371('0xd')][_0x54c5aa[_0xa371('0x44')]]['local']=![];this[_0xa371('0xd')][_0x54c5aa[_0xa371('0x44')]]['status']=_0x54c5aa[_0xa371('0x42')]['toLowerCase']();this[_0xa371('0xd')][_0x54c5aa['peer']][_0xa371('0x45')]=_0x54c5aa['address'];this[_0xa371('0xd')][_0x54c5aa[_0xa371('0x44')]][_0xa371('0x3f')](_0x54c5aa);}}else if(this[_0xa371('0x33')][_0x54c5aa[_0xa371('0x44')]]){this[_0xa371('0x33')][_0x54c5aa[_0xa371('0x44')]][_0xa371('0x46')]=_0x54c5aa[_0xa371('0x42')][_0xa371('0x2f')]();this[_0xa371('0x33')][_0x54c5aa[_0xa371('0x44')]][_0xa371('0x45')]=_0x54c5aa[_0xa371('0x45')];logger[_0xa371('0x28')](_0xa371('0x47'),util[_0xa371('0x17')](this['telephones'][_0x54c5aa['peer']],{'showHidden':![],'depth':null}));this[_0xa371('0x1d')](util[_0xa371('0x2a')](_0xa371('0x34'),this[_0xa371('0x33')][_0x54c5aa[_0xa371('0x44')]][_0xa371('0x37')]),_0xa371('0x35'),this[_0xa371('0x33')][_0x54c5aa[_0xa371('0x44')]]);}else if(this[_0xa371('0xc')][_0x54c5aa['peer']]){this['trunks'][_0x54c5aa[_0xa371('0x44')]][_0xa371('0x46')]=_0x54c5aa['peerstatus'][_0xa371('0x2f')]();this[_0xa371('0xc')][_0x54c5aa['peer']][_0xa371('0x45')]=_0x54c5aa[_0xa371('0x45')];logger[_0xa371('0x28')](_0xa371('0x48'),util['inspect'](this[_0xa371('0xc')][_0x54c5aa['peer']],{'showHidden':![],'depth':null}));this[_0xa371('0x1d')](util[_0xa371('0x2a')](_0xa371('0x2b'),this[_0xa371('0xc')][_0x54c5aa['peer']]['name']),_0xa371('0x2c'),this[_0xa371('0xc')][_0x54c5aa[_0xa371('0x44')]]);}}}catch(_0x4ed4d8){logger[_0xa371('0x15')]('[userReport][peerstatus]',util[_0xa371('0x17')](_0x4ed4d8,{'showHidden':![],'depth':null}));}};module[_0xa371('0x49')]=UserReport;
\ No newline at end of file
index fd37190..d6da977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a19=['agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','hangup','syncHangup','musiconholdstart','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','syncAgentCalled','info','uniqueid','membername','destuniqueid','debug','inspect','isUndefined','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','inbound','voice','merge','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%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][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','agent','talktime','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','channel','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','bind','agentconnect','syncAgentConnect'];(function(_0x569c7d,_0x3f0e51){var _0x47f36c=function(_0x40623b){while(--_0x40623b){_0x569c7d['push'](_0x569c7d['shift']());}};_0x47f36c(++_0x3f0e51);}(_0x6a19,0x84));var _0x96a1=function(_0x1951de,_0x173387){_0x1951de=_0x1951de-0x0;var _0x418584=_0x6a19[_0x1951de];return _0x418584;};'use strict';var _=require(_0x96a1('0x0'));var moment=require('moment');var util=require(_0x96a1('0x1'));var Redis=require(_0x96a1('0x2'));var config=require('../../../config/environment');var logger=require(_0x96a1('0x3'))(_0x96a1('0x4'));var ami=require('../ami');config[_0x96a1('0x5')]=_[_0x96a1('0x6')](config[_0x96a1('0x5')],{'host':_0x96a1('0x7'),'port':0x18eb});var io=require(_0x96a1('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x44d0a9){this[_0x96a1('0x9')]={};this['voiceChannels']=_0x44d0a9['channels'];this[_0x96a1('0xa')]=_0x44d0a9[_0x96a1('0xa')];this[_0x96a1('0xb')]=_0x44d0a9[_0x96a1('0xb')];this[_0x96a1('0xc')]={};ami['on']('agentcalled',this['syncAgentCalled'][_0x96a1('0xd')](this));ami['on'](_0x96a1('0xe'),this[_0x96a1('0xf')][_0x96a1('0xd')](this));ami['on'](_0x96a1('0x10'),this['syncAgentRingNoAnswer'][_0x96a1('0xd')](this));ami['on'](_0x96a1('0x11'),this[_0x96a1('0x12')]['bind'](this));ami['on'](_0x96a1('0x13'),this[_0x96a1('0x14')][_0x96a1('0xd')](this));ami['on']('varset',this['syncVarSet'][_0x96a1('0xd')](this));ami['on'](_0x96a1('0x15'),this[_0x96a1('0x16')][_0x96a1('0xd')](this));ami['on'](_0x96a1('0x17'),this['syncMusicOnHoldStart'][_0x96a1('0xd')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x96a1('0xd')](this));ami['on'](_0x96a1('0x18'),this[_0x96a1('0x19')][_0x96a1('0xd')](this));ami['on']('blindtransfer',this[_0x96a1('0x1a')][_0x96a1('0xd')](this));}VoiceAgentReport[_0x96a1('0x1b')][_0x96a1('0x1c')]=function(_0x2880e8,_0x28789f,_0x2ecd3f){io['to'](_0x2880e8)['emit'](_0x28789f,_0x2ecd3f);};VoiceAgentReport[_0x96a1('0x1b')][_0x96a1('0x1d')]=function(_0x52508e){return _0x52508e!==null&&!_['isUndefined'](_0x52508e);};VoiceAgentReport[_0x96a1('0x1b')][_0x96a1('0x1e')]=function(_0x12c133){try{if(this[_0x96a1('0x1d')](_0x12c133)){logger[_0x96a1('0x1f')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x12c133[_0x96a1('0x20')],_0x12c133[_0x96a1('0x21')],_0x12c133[_0x96a1('0x22')]);logger[_0x96a1('0x23')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x12c133[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x12c133,{'showHidden':![],'depth':null}));if(_[_0x96a1('0x25')](this[_0x96a1('0x9')][_0x12c133['uniqueid']])){this['channels'][_0x12c133[_0x96a1('0x20')]]={};}if(_[_0x96a1('0x25')](this[_0x96a1('0x9')][_0x12c133[_0x96a1('0x20')]][_0x12c133[_0x96a1('0x22')]])){this[_0x96a1('0x9')][_0x12c133['uniqueid']][_0x12c133[_0x96a1('0x22')]]={'agentcalledAt':moment()[_0x96a1('0x26')](_0x96a1('0x27')),'lastevent':_0x96a1('0x28'),'mandatoryDisposition':this[_0x96a1('0xa')][_0x12c133[_0x96a1('0x29')]]?this[_0x96a1('0xa')][_0x12c133[_0x96a1('0x29')]][_0x96a1('0x2a')]||![]:![],'type':this[_0x96a1('0xa')][_0x12c133[_0x96a1('0x29')]]?this[_0x96a1('0xa')][_0x12c133[_0x96a1('0x29')]]['type']||_0x96a1('0x2b'):_0x96a1('0x2b'),'variables':this['variables'][_0x12c133[_0x96a1('0x20')]],'motionChannel':_0x96a1('0x2c')};}_[_0x96a1('0x2d')](this[_0x96a1('0x9')][_0x12c133[_0x96a1('0x20')]][_0x12c133[_0x96a1('0x22')]],_[_0x96a1('0x2e')](_0x12c133,[_0x96a1('0x2f'),'privilege']));logger['debug'](_0x96a1('0x30'),_0x12c133[_0x96a1('0x20')],util['inspect'](this[_0x96a1('0x9')][_0x12c133[_0x96a1('0x20')]][_0x12c133['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x96a1('0x1c')](_0x96a1('0x31'),this[_0x96a1('0x9')][_0x12c133[_0x96a1('0x20')]][_0x12c133[_0x96a1('0x22')]]);var _0xb3f869={'id':this[_0x96a1('0xb')][_0x12c133[_0x96a1('0x32')]]['id'],'calleridnum':this['channels'][_0x12c133[_0x96a1('0x20')]][_0x12c133[_0x96a1('0x22')]]['calleridnum'],'queue':this[_0x96a1('0x9')][_0x12c133[_0x96a1('0x20')]][_0x12c133[_0x96a1('0x22')]]['queue'],'variables':this[_0x96a1('0x9')][_0x12c133[_0x96a1('0x20')]][_0x12c133[_0x96a1('0x22')]]['variables']};logger[_0x96a1('0x23')](_0x96a1('0x33'),_0x12c133[_0x96a1('0x20')],util[_0x96a1('0x24')](_0xb3f869,{'showHidden':![],'depth':null}));this[_0x96a1('0x1c')](util[_0x96a1('0x26')](_0x96a1('0x34'),_0x12c133[_0x96a1('0x21')]),_0x96a1('0x35'),_0xb3f869);}}catch(_0x56187a){logger[_0x96a1('0x36')](_0x96a1('0x37'),_0x12c133[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x56187a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x96a1('0xf')]=function(_0x5ed36d){try{if(this[_0x96a1('0x1d')](_0x5ed36d)){if(this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]]){logger[_0x96a1('0x23')](_0x96a1('0x38'),_0x5ed36d['uniqueid'],util[_0x96a1('0x24')](_0x5ed36d,{'showHidden':![],'depth':null}));for(var _0x3ec692 in this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]]){if(this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]]['hasOwnProperty'](_0x3ec692)){if(_0x5ed36d[_0x96a1('0x22')]===_0x3ec692){logger[_0x96a1('0x1f')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5ed36d[_0x96a1('0x20')],_0x5ed36d[_0x96a1('0x21')],_0x5ed36d[_0x96a1('0x22')]);this[_0x96a1('0x9')][_0x5ed36d['uniqueid']][_0x3ec692]['agentconnectAt']=moment()['format'](_0x96a1('0x27'));this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692]['connectedlinename']=_0x5ed36d['connectedlinename'];this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x39')]=_0x5ed36d[_0x96a1('0x39')];this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692]['destchannelstate']=_0x5ed36d[_0x96a1('0x3a')];this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692]['destchannelstatedesc']=_0x5ed36d[_0x96a1('0x3b')];this[_0x96a1('0x9')][_0x5ed36d['uniqueid']][_0x3ec692][_0x96a1('0x3c')]=_0x5ed36d[_0x96a1('0x3c')];this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x3d')]=_0x96a1('0x3e');if(this[_0x96a1('0x3f')][this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x20')]]){var _0xcac238=this[_0x96a1('0x3f')][this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x20')]][_0x96a1('0x40')];this['channels'][_0x5ed36d['uniqueid']][_0x3ec692][_0x96a1('0x40')]=_0xcac238;_0x5ed36d[_0x96a1('0x40')]=_0xcac238;}_[_0x96a1('0x2d')](this[_0x96a1('0xb')][_0x5ed36d[_0x96a1('0x32')]],_[_0x96a1('0x41')](_0x5ed36d,[_0x96a1('0x29'),'destconnectedlinenum',_0x96a1('0x40')]));logger['debug'](_0x96a1('0x42'),_0x5ed36d[_0x96a1('0x20')],util['inspect'](this[_0x96a1('0x9')][_0x5ed36d['uniqueid']][_0x5ed36d[_0x96a1('0x22')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x5ed36d[_0x96a1('0x22')]]);logger[_0x96a1('0x23')](_0x96a1('0x43'),_0x5ed36d['uniqueid'],util['inspect'](this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x5ed36d[_0x96a1('0x22')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x96a1('0x26')](_0x96a1('0x34'),_0x5ed36d[_0x96a1('0x21')]),_0x96a1('0x44'),this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x5ed36d['destuniqueid']]);}else if(!this['channels'][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x10')]&&!this[_0x96a1('0x9')][_0x5ed36d['uniqueid']][_0x3ec692][_0x96a1('0x13')]){logger[_0x96a1('0x1f')](_0x96a1('0x45'),_0x5ed36d['uniqueid'],this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x21')],_0x3ec692);this['channels'][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x10')]=!![];this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x46')]=moment()[_0x96a1('0x26')](_0x96a1('0x27'));this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x47')]=_0x5ed36d['destuniqueid'];this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x48')]=_0x5ed36d[_0x96a1('0x21')];this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692]['lastevent']='answered_elsewhere';this[_0x96a1('0x9')][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692][_0x96a1('0x49')]=_0x96a1('0x4a');logger['debug'](_0x96a1('0x4b'),_0x5ed36d[_0x96a1('0x20')],util[_0x96a1('0x24')](this['channels'][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692],{'showHidden':![],'depth':null}));ami[_0x96a1('0x1c')](_0x96a1('0x4c'),this['channels'][_0x5ed36d[_0x96a1('0x20')]][_0x3ec692]);}}}}}}catch(_0x489130){logger[_0x96a1('0x36')]('[%s][voiceAgentReport][agentconnect]',_0x5ed36d[_0x96a1('0x20')],util['inspect'](_0x489130,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x96a1('0x4d')]=function(_0x47048b){try{if(this[_0x96a1('0x1d')](_0x47048b)){logger['debug'](_0x96a1('0x4e'),_0x47048b['uniqueid'],util[_0x96a1('0x24')](_0x47048b,{'showHidden':![],'depth':null}));if(this[_0x96a1('0x9')][_0x47048b[_0x96a1('0x20')]]&&this[_0x96a1('0x9')][_0x47048b[_0x96a1('0x20')]][_0x47048b[_0x96a1('0x22')]]){logger['info'](_0x96a1('0x4f'),_0x47048b[_0x96a1('0x20')],_0x47048b[_0x96a1('0x21')],_0x47048b[_0x96a1('0x22')]);this['channels'][_0x47048b[_0x96a1('0x20')]][_0x47048b['destuniqueid']][_0x96a1('0x10')]=!![];this['channels'][_0x47048b[_0x96a1('0x20')]][_0x47048b[_0x96a1('0x22')]][_0x96a1('0x46')]=moment()[_0x96a1('0x26')](_0x96a1('0x27'));this[_0x96a1('0x9')][_0x47048b['uniqueid']][_0x47048b[_0x96a1('0x22')]]['lastevent']=_0x96a1('0x50');this[_0x96a1('0x9')][_0x47048b['uniqueid']][_0x47048b[_0x96a1('0x22')]][_0x96a1('0x49')]=_0x96a1('0x50');logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x47048b[_0x96a1('0x20')],util[_0x96a1('0x24')](this[_0x96a1('0x9')][_0x47048b[_0x96a1('0x20')]][_0x47048b['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x96a1('0x1c')]('custom:agentringnoanswer',this[_0x96a1('0x9')][_0x47048b[_0x96a1('0x20')]][_0x47048b[_0x96a1('0x22')]]);}}}catch(_0x47298c){logger[_0x96a1('0x36')]('[%s][voiceAgentReport][agentringnoanswer]',_0x47048b['uniqueid'],util['inspect'](_0x47298c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x96a1('0x1b')][_0x96a1('0x12')]=function(_0x14e4e8){try{if(this[_0x96a1('0x1d')](_0x14e4e8)){logger[_0x96a1('0x23')](_0x96a1('0x51'),_0x14e4e8[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x14e4e8,{'showHidden':![],'depth':null}));if(this[_0x96a1('0x9')][_0x14e4e8[_0x96a1('0x20')]]){for(var _0xfbde3a in this[_0x96a1('0x9')][_0x14e4e8[_0x96a1('0x20')]]){if(this[_0x96a1('0x9')][_0x14e4e8[_0x96a1('0x20')]][_0x96a1('0x52')](_0xfbde3a)&&!this[_0x96a1('0x9')][_0x14e4e8[_0x96a1('0x20')]][_0xfbde3a]['agentringnoanswer']&&!this['channels'][_0x14e4e8['uniqueid']][_0xfbde3a][_0x96a1('0x13')]){logger[_0x96a1('0x1f')](_0x96a1('0x53'),_0x14e4e8[_0x96a1('0x20')],this[_0x96a1('0x9')][_0x14e4e8[_0x96a1('0x20')]][_0xfbde3a][_0x96a1('0x21')],_0xfbde3a);this['channels'][_0x14e4e8[_0x96a1('0x20')]][_0xfbde3a][_0x96a1('0x10')]=!![];this[_0x96a1('0x9')][_0x14e4e8[_0x96a1('0x20')]][_0xfbde3a]['agentringnoanswerAt']=moment()[_0x96a1('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x96a1('0x9')][_0x14e4e8['uniqueid']][_0xfbde3a][_0x96a1('0x3d')]=_0x96a1('0x54');this['channels'][_0x14e4e8[_0x96a1('0x20')]][_0xfbde3a]['reason']=_0x96a1('0x54');logger[_0x96a1('0x23')](_0x96a1('0x55'),_0x14e4e8['uniqueid'],util[_0x96a1('0x24')](this['channels'][_0x14e4e8[_0x96a1('0x20')]][_0xfbde3a],{'showHidden':![],'depth':null}));ami[_0x96a1('0x1c')](_0x96a1('0x56'),this[_0x96a1('0x9')][_0x14e4e8[_0x96a1('0x20')]][_0xfbde3a]);}}}}}catch(_0x413f85){logger[_0x96a1('0x36')]('[%s][voiceAgentReport][queuecallerabandon]',_0x14e4e8[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x413f85,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x96a1('0x1b')][_0x96a1('0x14')]=function(_0x59c7c3){try{if(this[_0x96a1('0x1d')](_0x59c7c3)){logger[_0x96a1('0x23')](_0x96a1('0x57'),_0x59c7c3[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x59c7c3,{'showHidden':![],'depth':null}));if(this['channels'][_0x59c7c3[_0x96a1('0x20')]]){for(var _0x13ecad in this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]]){if(this['channels'][_0x59c7c3['uniqueid']][_0x96a1('0x52')](_0x13ecad)){if(this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad][_0x96a1('0x58')]&&!this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad]['agentcomplete']){logger['info'](_0x96a1('0x59'),_0x59c7c3[_0x96a1('0x20')],this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad]['membername'],_0x13ecad);this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad]['agentcomplete']=!![];this['channels'][_0x59c7c3['uniqueid']][_0x13ecad][_0x96a1('0x5a')]=moment()[_0x96a1('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad][_0x96a1('0x3d')]='complete';this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad][_0x96a1('0x49')]=_0x59c7c3[_0x96a1('0x49')]=='transfer'?_0x96a1('0x5b'):_0x59c7c3['reason'];this[_0x96a1('0x9')][_0x59c7c3['uniqueid']][_0x13ecad]['talktime']=_0x59c7c3[_0x96a1('0x5c')];if(this[_0x96a1('0xa')][_0x59c7c3[_0x96a1('0x29')]]&&this[_0x96a1('0xa')][_0x59c7c3[_0x96a1('0x29')]]['acw']){this['channels'][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad][_0x96a1('0x5d')]=this[_0x96a1('0xa')][_0x59c7c3[_0x96a1('0x29')]]['acwTimeout'];this['channels'][_0x59c7c3['uniqueid']][_0x13ecad][_0x96a1('0x5e')]=!![];}this[_0x96a1('0xb')][_0x59c7c3[_0x96a1('0x32')]]=_[_0x96a1('0x2e')](this[_0x96a1('0xb')][_0x59c7c3['interface']],[_0x96a1('0x29'),'destconnectedlinenum']);logger[_0x96a1('0x23')](_0x96a1('0x5f'),_0x59c7c3['uniqueid'],util[_0x96a1('0x24')](this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad],{'showHidden':![],'depth':null}));ami[_0x96a1('0x1c')](_0x96a1('0x60'),this[_0x96a1('0x9')][_0x59c7c3[_0x96a1('0x20')]][_0x13ecad]);logger[_0x96a1('0x23')](_0x96a1('0x61'),_0x59c7c3[_0x96a1('0x20')],util[_0x96a1('0x24')]({'id':this[_0x96a1('0xb')][_0x59c7c3[_0x96a1('0x32')]]['id'],'destaccountcode':_0x59c7c3[_0x96a1('0x62')]},{'showHidden':![],'depth':null}));this[_0x96a1('0x1c')](util['format'](_0x96a1('0x34'),_0x59c7c3[_0x96a1('0x21')]),'user:agentcomplete',{'id':this[_0x96a1('0xb')][_0x59c7c3[_0x96a1('0x32')]]['id'],'destaccountcode':_0x59c7c3[_0x96a1('0x62')]});}}}}}}catch(_0x46a72f){logger[_0x96a1('0x36')](_0x96a1('0x63'),_0x59c7c3[_0x96a1('0x20')],util['inspect'](_0x46a72f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x2aa8b8){try{if(this[_0x96a1('0x1d')](_0x2aa8b8)){logger[_0x96a1('0x23')](_0x96a1('0x64'),_0x2aa8b8[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x2aa8b8,{'showHidden':![],'depth':null}));this[_0x96a1('0x65')](_0x2aa8b8[_0x96a1('0x20')],_[_0x96a1('0x66')](_0x2aa8b8[_0x96a1('0x67')])[0x0],_0x2aa8b8[_0x96a1('0x68')]);if(this[_0x96a1('0x9')][_0x2aa8b8[_0x96a1('0x20')]]){for(var _0x3a2e11 in this[_0x96a1('0x9')][_0x2aa8b8[_0x96a1('0x20')]]){if(this[_0x96a1('0x9')][_0x2aa8b8[_0x96a1('0x20')]][_0x96a1('0x52')](_0x3a2e11)){logger[_0x96a1('0x1f')](_0x96a1('0x69'),_0x2aa8b8[_0x96a1('0x20')],_0x3a2e11,_[_0x96a1('0x66')](_0x2aa8b8[_0x96a1('0x67')])[0x0],_0x2aa8b8[_0x96a1('0x68')]);if(_['isUndefined'](this[_0x96a1('0x9')][_0x2aa8b8[_0x96a1('0x20')]][_0x3a2e11][_0x96a1('0xc')])){this[_0x96a1('0x9')][_0x2aa8b8[_0x96a1('0x20')]][_0x3a2e11][_0x96a1('0xc')]={};}this['channels'][_0x2aa8b8['uniqueid']][_0x3a2e11]['variables']=this[_0x96a1('0xc')][_0x2aa8b8[_0x96a1('0x20')]];}}}}}catch(_0x283ced){logger[_0x96a1('0x36')]('[%s][voiceAgentReport][varset]',_0x2aa8b8['uniqueid'],util[_0x96a1('0x24')](_0x283ced,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x96a1('0x1b')][_0x96a1('0x65')]=function(_0x509a00,_0x8968b8,_0x18aefa){var _0x158833=[_0x96a1('0x6a'),_0x96a1('0x6b'),_0x96a1('0x6c'),_0x96a1('0x6d'),_0x96a1('0x6e'),_0x96a1('0x6f'),_0x96a1('0x70'),_0x96a1('0x71'),_0x96a1('0x72'),_0x96a1('0x73'),_0x96a1('0x74'),_0x96a1('0x75'),_0x96a1('0x76'),'memberdynamic','memberinterface',_0x96a1('0x77'),'membername',_0x96a1('0x78'),_0x96a1('0x79')];if(!_[_0x96a1('0x7a')](_0x8968b8)&&!_['includes'](_0x158833,_0x8968b8)){if(_[_0x96a1('0x25')](this['variables'][_0x509a00])){this[_0x96a1('0xc')][_0x509a00]={};}this[_0x96a1('0xc')][_0x509a00][_0x8968b8]=_0x18aefa;}};VoiceAgentReport[_0x96a1('0x1b')]['syncHangup']=function(_0x5bd659){try{if(this[_0x96a1('0x1d')](_0x5bd659)){logger['debug'](_0x96a1('0x7b'),_0x5bd659['uniqueid'],util[_0x96a1('0x24')](_0x5bd659,{'showHidden':![],'depth':null}));if(this[_0x96a1('0x9')][_0x5bd659[_0x96a1('0x20')]]){for(var _0x1f38ac in this[_0x96a1('0x9')][_0x5bd659[_0x96a1('0x20')]]){if(this[_0x96a1('0x9')][_0x5bd659[_0x96a1('0x20')]][_0x96a1('0x52')](_0x1f38ac)){if(this['channels'][_0x5bd659[_0x96a1('0x20')]][_0x1f38ac]['reason']==_0x96a1('0x7c')&&this[_0x96a1('0x9')][_0x5bd659['uniqueid']][_0x1f38ac]['agentcomplete']){logger[_0x96a1('0x1f')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x5bd659['uniqueid'],_0x1f38ac);this[_0x96a1('0x9')][_0x5bd659['uniqueid']][_0x1f38ac][_0x96a1('0x5a')]=moment()[_0x96a1('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x96a1('0x23')](_0x96a1('0x7d'),_0x5bd659['uniqueid'],util[_0x96a1('0x24')](_['values'](this[_0x96a1('0x9')][_0x5bd659[_0x96a1('0x20')]]),{'showHidden':![],'depth':null}));ami[_0x96a1('0x1c')](_0x96a1('0x7e'),_['values'](this[_0x96a1('0x9')][_0x5bd659['uniqueid']]));delete this['channels'][_0x5bd659[_0x96a1('0x20')]];}if(this[_0x96a1('0xc')][_0x5bd659['uniqueid']]){delete this[_0x96a1('0xc')][_0x5bd659[_0x96a1('0x20')]];}}}catch(_0x12fa48){logger[_0x96a1('0x36')](_0x96a1('0x7f'),_0x5bd659[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x12fa48,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x96a1('0x1b')]['syncAttendedTransfer']=function(_0x3e6f7b){try{if(this[_0x96a1('0x1d')](_0x3e6f7b)){logger['debug'](_0x96a1('0x80'),_0x3e6f7b['uniqueid'],util[_0x96a1('0x24')](_0x3e6f7b,{'showHidden':![],'depth':null}));if(this['channels'][_0x3e6f7b[_0x96a1('0x81')]]){for(var _0x44cf33 in this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x81')]]){if(this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x81')]]['hasOwnProperty'](_0x44cf33)){if(_0x3e6f7b[_0x96a1('0x82')]===_0x44cf33){logger['info'](_0x96a1('0x83'),_0x3e6f7b[_0x96a1('0x20')],this[_0x96a1('0x9')][_0x3e6f7b['transfereeuniqueid']][_0x44cf33][_0x96a1('0x21')],_0x44cf33);var _0x550150=moment();this[_0x96a1('0x9')][_0x3e6f7b['transfereeuniqueid']][_0x44cf33][_0x96a1('0x13')]=!![];this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x81')]][_0x44cf33][_0x96a1('0x5a')]=moment()[_0x96a1('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x81')]][_0x44cf33][_0x96a1('0x3d')]=_0x96a1('0x84');this[_0x96a1('0x9')][_0x3e6f7b['transfereeuniqueid']][_0x44cf33][_0x96a1('0x49')]='transfer';this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x81')]][_0x44cf33][_0x96a1('0x5c')]=_0x550150[_0x96a1('0x85')](this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x81')]][_0x44cf33]['agentconnectAt'],_0x96a1('0x86'));}}}}if(this[_0x96a1('0x9')][_0x3e6f7b['secondtransfereruniqueid']]){var _0x328876=this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x87')]];this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x87')]]=this[_0x96a1('0x9')][_0x3e6f7b[_0x96a1('0x81')]];this[_0x96a1('0x9')][_0x3e6f7b['transfereeuniqueid']]=_0x328876;}}}catch(_0x1836f5){logger[_0x96a1('0x36')]('[%s][voiceAgentReport][attendedtransfer]',_0x3e6f7b[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x1836f5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x96a1('0x1b')]['syncBlindTransfer']=function(_0x59da0b){try{if(this[_0x96a1('0x1d')](_0x59da0b)){logger[_0x96a1('0x23')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x59da0b['uniqueid'],util['inspect'](_0x59da0b,{'showHidden':![],'depth':null}));if(this['channels'][_0x59da0b['transfereeuniqueid']]){for(var _0xc8cc39 in this['channels'][_0x59da0b[_0x96a1('0x81')]]){if(this[_0x96a1('0x9')][_0x59da0b['transfereeuniqueid']]['hasOwnProperty'](_0xc8cc39)){if(_0x59da0b['transfereruniqueid']===_0xc8cc39){logger[_0x96a1('0x1f')](_0x96a1('0x88'),_0x59da0b[_0x96a1('0x20')],this[_0x96a1('0x9')][_0x59da0b[_0x96a1('0x81')]][_0xc8cc39][_0x96a1('0x21')],_0xc8cc39);var _0x2991da=moment();this[_0x96a1('0x9')][_0x59da0b['transfereeuniqueid']][_0xc8cc39][_0x96a1('0x13')]=!![];this[_0x96a1('0x9')][_0x59da0b[_0x96a1('0x81')]][_0xc8cc39]['agentcompleteAt']=_0x2991da;this['channels'][_0x59da0b[_0x96a1('0x81')]][_0xc8cc39]['lastevent']=_0x96a1('0x84');this[_0x96a1('0x9')][_0x59da0b[_0x96a1('0x81')]][_0xc8cc39][_0x96a1('0x49')]=_0x96a1('0x7c');this[_0x96a1('0x9')][_0x59da0b['transfereeuniqueid']][_0xc8cc39]['talktime']=_0x2991da[_0x96a1('0x85')](this[_0x96a1('0x9')][_0x59da0b['transfereeuniqueid']][_0xc8cc39][_0x96a1('0x58')],_0x96a1('0x86'));}}}}}}catch(_0x11ec63){logger[_0x96a1('0x36')](_0x96a1('0x89'),_0x59da0b['uniqueid'],util[_0x96a1('0x24')](_0x11ec63,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x96a1('0x8a')]=function(_0x338df3){var _0x2ede2c='';try{if(this[_0x96a1('0x1d')](_0x338df3)){logger[_0x96a1('0x23')](_0x96a1('0x8b'),_0x338df3[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x338df3,{'showHidden':![],'depth':null}));if(_0x338df3['channel']){_0x2ede2c=_0x338df3['channel'][_0x96a1('0x8c')](0x0,_0x338df3[_0x96a1('0x8d')]['lastIndexOf']('-'));if(this[_0x96a1('0xb')][_0x2ede2c]){logger[_0x96a1('0x1f')](_0x96a1('0x8e'),_0x338df3[_0x96a1('0x20')],_0x2ede2c);this[_0x96a1('0xb')][_0x2ede2c][_0x96a1('0x8f')]=!![];}}}}catch(_0x47d55e){logger[_0x96a1('0x36')]('[%s][voiceAgentReport][musiconholdstart]',_0x338df3['uniqueid'],util[_0x96a1('0x24')](_0x47d55e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x96a1('0x1b')][_0x96a1('0x90')]=function(_0x3a525c){var _0x18e20c='';try{if(this[_0x96a1('0x1d')](_0x3a525c)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x3a525c[_0x96a1('0x20')],util[_0x96a1('0x24')](_0x3a525c,{'showHidden':![],'depth':null}));if(_0x3a525c[_0x96a1('0x8d')]){_0x18e20c=_0x3a525c[_0x96a1('0x8d')][_0x96a1('0x8c')](0x0,_0x3a525c[_0x96a1('0x8d')][_0x96a1('0x91')]('-'));if(this[_0x96a1('0xb')][_0x18e20c]){logger[_0x96a1('0x1f')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3a525c['uniqueid'],_0x18e20c);this['agents'][_0x18e20c][_0x96a1('0x8f')]=![];}}}}catch(_0x31ab05){logger[_0x96a1('0x36')](_0x96a1('0x92'),_0x3a525c[_0x96a1('0x20')],util['inspect'](_0x31ab05,{'showHidden':![],'depth':null}));}};module[_0x96a1('0x93')]=VoiceAgentReport;
\ No newline at end of file
+var _0xc8bb=['emit','isUndefined','prototype','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','uniqueid','inspect','channels','format','called','queue','type','inbound','voice','merge','omit','privilege','custom:agentcalled','interface','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','lastevent','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer'];(function(_0x308dcc,_0x2d1178){var _0x361717=function(_0x618aae){while(--_0x618aae){_0x308dcc['push'](_0x308dcc['shift']());}};_0x361717(++_0x2d1178);}(_0xc8bb,0x1c6));var _0xbc8b=function(_0x5289b3,_0x40f0f7){_0x5289b3=_0x5289b3-0x0;var _0x40c79c=_0xc8bb[_0x5289b3];return _0x40c79c;};'use strict';var _=require(_0xbc8b('0x0'));var moment=require('moment');var util=require(_0xbc8b('0x1'));var Redis=require(_0xbc8b('0x2'));var config=require(_0xbc8b('0x3'));var logger=require('../../../config/logger')(_0xbc8b('0x4'));var ami=require(_0xbc8b('0x5'));config[_0xbc8b('0x6')]=_[_0xbc8b('0x7')](config[_0xbc8b('0x6')],{'host':_0xbc8b('0x8'),'port':0x18eb});var io=require(_0xbc8b('0x9'))(new Redis(config[_0xbc8b('0x6')]));function VoiceAgentReport(_0x2debbb){this['channels']={};this[_0xbc8b('0xa')]=_0x2debbb['channels'];this[_0xbc8b('0xb')]=_0x2debbb['voiceQueues'];this['agents']=_0x2debbb[_0xbc8b('0xc')];this[_0xbc8b('0xd')]={};ami['on']('agentcalled',this[_0xbc8b('0xe')][_0xbc8b('0xf')](this));ami['on'](_0xbc8b('0x10'),this[_0xbc8b('0x11')][_0xbc8b('0xf')](this));ami['on']('agentringnoanswer',this[_0xbc8b('0x12')][_0xbc8b('0xf')](this));ami['on'](_0xbc8b('0x13'),this['syncQueueCallerAbandon'][_0xbc8b('0xf')](this));ami['on'](_0xbc8b('0x14'),this[_0xbc8b('0x15')]['bind'](this));ami['on'](_0xbc8b('0x16'),this[_0xbc8b('0x17')][_0xbc8b('0xf')](this));ami['on'](_0xbc8b('0x18'),this[_0xbc8b('0x19')][_0xbc8b('0xf')](this));ami['on']('musiconholdstart',this[_0xbc8b('0x1a')][_0xbc8b('0xf')](this));ami['on'](_0xbc8b('0x1b'),this[_0xbc8b('0x1c')][_0xbc8b('0xf')](this));ami['on'](_0xbc8b('0x1d'),this[_0xbc8b('0x1e')][_0xbc8b('0xf')](this));ami['on'](_0xbc8b('0x1f'),this['syncBlindTransfer'][_0xbc8b('0xf')](this));}VoiceAgentReport['prototype'][_0xbc8b('0x20')]=function(_0x585e2b,_0x410e1a,_0x4f7440){io['to'](_0x585e2b)[_0xbc8b('0x20')](_0x410e1a,_0x4f7440);};VoiceAgentReport['prototype']['isNotNull']=function(_0x52b2a3){return _0x52b2a3!==null&&!_[_0xbc8b('0x21')](_0x52b2a3);};VoiceAgentReport[_0xbc8b('0x22')][_0xbc8b('0xe')]=function(_0x59c201){try{if(this[_0xbc8b('0x23')](_0x59c201)){logger[_0xbc8b('0x24')](_0xbc8b('0x25'),_0x59c201['uniqueid'],_0x59c201[_0xbc8b('0x26')],_0x59c201[_0xbc8b('0x27')]);logger[_0xbc8b('0x28')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x59c201[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x59c201,{'showHidden':![],'depth':null}));if(_[_0xbc8b('0x21')](this[_0xbc8b('0x2b')][_0x59c201['uniqueid']])){this[_0xbc8b('0x2b')][_0x59c201[_0xbc8b('0x29')]]={};}if(_[_0xbc8b('0x21')](this[_0xbc8b('0x2b')][_0x59c201['uniqueid']][_0x59c201[_0xbc8b('0x27')]])){this['channels'][_0x59c201[_0xbc8b('0x29')]][_0x59c201['destuniqueid']]={'agentcalledAt':moment()[_0xbc8b('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xbc8b('0x2d'),'mandatoryDisposition':this[_0xbc8b('0xb')][_0x59c201[_0xbc8b('0x2e')]]?this[_0xbc8b('0xb')][_0x59c201[_0xbc8b('0x2e')]]['mandatoryDisposition']||![]:![],'type':this[_0xbc8b('0xb')][_0x59c201[_0xbc8b('0x2e')]]?this['voiceQueues'][_0x59c201['queue']][_0xbc8b('0x2f')]||_0xbc8b('0x30'):_0xbc8b('0x30'),'variables':this['variables'][_0x59c201[_0xbc8b('0x29')]],'motionChannel':_0xbc8b('0x31')};}_[_0xbc8b('0x32')](this[_0xbc8b('0x2b')][_0x59c201[_0xbc8b('0x29')]][_0x59c201[_0xbc8b('0x27')]],_[_0xbc8b('0x33')](_0x59c201,['event',_0xbc8b('0x34')]));logger[_0xbc8b('0x28')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x59c201['uniqueid'],util['inspect'](this['channels'][_0x59c201[_0xbc8b('0x29')]][_0x59c201[_0xbc8b('0x27')]],{'showHidden':![],'depth':null}));ami['emit'](_0xbc8b('0x35'),this[_0xbc8b('0x2b')][_0x59c201[_0xbc8b('0x29')]][_0x59c201[_0xbc8b('0x27')]]);var _0x28433c={'id':this[_0xbc8b('0xc')][_0x59c201[_0xbc8b('0x36')]]['id'],'calleridnum':this[_0xbc8b('0x2b')][_0x59c201[_0xbc8b('0x29')]][_0x59c201['destuniqueid']][_0xbc8b('0x37')],'queue':this['channels'][_0x59c201['uniqueid']][_0x59c201[_0xbc8b('0x27')]][_0xbc8b('0x2e')],'variables':this[_0xbc8b('0x2b')][_0x59c201['uniqueid']][_0x59c201[_0xbc8b('0x27')]][_0xbc8b('0xd')]};logger['debug'](_0xbc8b('0x38'),_0x59c201['uniqueid'],util[_0xbc8b('0x2a')](_0x28433c,{'showHidden':![],'depth':null}));this[_0xbc8b('0x20')](util['format'](_0xbc8b('0x39'),_0x59c201[_0xbc8b('0x26')]),_0xbc8b('0x3a'),_0x28433c);}}catch(_0x40e3a7){logger['error'](_0xbc8b('0x3b'),_0x59c201[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x40e3a7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbc8b('0x22')][_0xbc8b('0x11')]=function(_0xe4310e){try{if(this[_0xbc8b('0x23')](_0xe4310e)){if(this[_0xbc8b('0x2b')][_0xe4310e['uniqueid']]){logger[_0xbc8b('0x28')](_0xbc8b('0x3c'),_0xe4310e[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0xe4310e,{'showHidden':![],'depth':null}));for(var _0x450019 in this[_0xbc8b('0x2b')][_0xe4310e['uniqueid']]){if(this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0xbc8b('0x3d')](_0x450019)){if(_0xe4310e['destuniqueid']===_0x450019){logger[_0xbc8b('0x24')](_0xbc8b('0x3e'),_0xe4310e[_0xbc8b('0x29')],_0xe4310e[_0xbc8b('0x26')],_0xe4310e[_0xbc8b('0x27')]);this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x3f')]=moment()[_0xbc8b('0x2c')](_0xbc8b('0x40'));this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x41')]=_0xe4310e['connectedlinename'];this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x42')]=_0xe4310e[_0xbc8b('0x42')];this[_0xbc8b('0x2b')][_0xe4310e['uniqueid']][_0x450019][_0xbc8b('0x43')]=_0xe4310e[_0xbc8b('0x43')];this[_0xbc8b('0x2b')][_0xe4310e['uniqueid']][_0x450019][_0xbc8b('0x44')]=_0xe4310e['destchannelstatedesc'];this[_0xbc8b('0x2b')][_0xe4310e['uniqueid']][_0x450019][_0xbc8b('0x45')]=_0xe4310e['holdtime'];this[_0xbc8b('0x2b')][_0xe4310e['uniqueid']][_0x450019]['lastevent']=_0xbc8b('0x46');if(this['voiceChannels'][this[_0xbc8b('0x2b')][_0xe4310e['uniqueid']][_0x450019][_0xbc8b('0x29')]]){var _0x8e41a1=this[_0xbc8b('0xa')][this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x29')]]['routealias'];this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x47')]=_0x8e41a1;_0xe4310e[_0xbc8b('0x47')]=_0x8e41a1;}_['merge'](this[_0xbc8b('0xc')][_0xe4310e['interface']],_['pick'](_0xe4310e,[_0xbc8b('0x2e'),_0xbc8b('0x48'),'routealias']));logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0xe4310e[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0xe4310e['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xbc8b('0x49'),this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0xe4310e[_0xbc8b('0x27')]]);logger['debug'](_0xbc8b('0x4a'),_0xe4310e[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0xe4310e[_0xbc8b('0x27')]],{'showHidden':![],'depth':null}));this[_0xbc8b('0x20')](util[_0xbc8b('0x2c')](_0xbc8b('0x39'),_0xe4310e[_0xbc8b('0x26')]),_0xbc8b('0x4b'),this['channels'][_0xe4310e[_0xbc8b('0x29')]][_0xe4310e['destuniqueid']]);}else if(!this['channels'][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x4c')]&&!this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019]['agentcomplete']){logger['info'](_0xbc8b('0x4d'),_0xe4310e['uniqueid'],this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019]['membername'],_0x450019);this['channels'][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x4c')]=!![];this['channels'][_0xe4310e['uniqueid']][_0x450019]['agentringnoanswerAt']=moment()['format'](_0xbc8b('0x40'));this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x4e')]=_0xe4310e['destuniqueid'];this['channels'][_0xe4310e[_0xbc8b('0x29')]][_0x450019]['answeredelsewheremembername']=_0xe4310e[_0xbc8b('0x26')];this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x4f')]=_0xbc8b('0x50');this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019][_0xbc8b('0x51')]=_0xbc8b('0x50');logger[_0xbc8b('0x28')](_0xbc8b('0x52'),_0xe4310e[_0xbc8b('0x29')],util['inspect'](this[_0xbc8b('0x2b')][_0xe4310e['uniqueid']][_0x450019],{'showHidden':![],'depth':null}));ami[_0xbc8b('0x20')](_0xbc8b('0x53'),this[_0xbc8b('0x2b')][_0xe4310e[_0xbc8b('0x29')]][_0x450019]);}}}}}}catch(_0x4eee7){logger[_0xbc8b('0x54')](_0xbc8b('0x55'),_0xe4310e[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x4eee7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentRingNoAnswer']=function(_0x1f996c){try{if(this[_0xbc8b('0x23')](_0x1f996c)){logger['debug'](_0xbc8b('0x56'),_0x1f996c[_0xbc8b('0x29')],util['inspect'](_0x1f996c,{'showHidden':![],'depth':null}));if(this[_0xbc8b('0x2b')][_0x1f996c[_0xbc8b('0x29')]]&&this[_0xbc8b('0x2b')][_0x1f996c[_0xbc8b('0x29')]][_0x1f996c['destuniqueid']]){logger['info'](_0xbc8b('0x57'),_0x1f996c['uniqueid'],_0x1f996c[_0xbc8b('0x26')],_0x1f996c[_0xbc8b('0x27')]);this['channels'][_0x1f996c[_0xbc8b('0x29')]][_0x1f996c[_0xbc8b('0x27')]][_0xbc8b('0x4c')]=!![];this[_0xbc8b('0x2b')][_0x1f996c[_0xbc8b('0x29')]][_0x1f996c[_0xbc8b('0x27')]][_0xbc8b('0x58')]=moment()['format'](_0xbc8b('0x40'));this[_0xbc8b('0x2b')][_0x1f996c[_0xbc8b('0x29')]][_0x1f996c[_0xbc8b('0x27')]][_0xbc8b('0x4f')]=_0xbc8b('0x59');this[_0xbc8b('0x2b')][_0x1f996c['uniqueid']][_0x1f996c[_0xbc8b('0x27')]][_0xbc8b('0x51')]='rejected';logger[_0xbc8b('0x28')](_0xbc8b('0x5a'),_0x1f996c[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](this['channels'][_0x1f996c['uniqueid']][_0x1f996c['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xbc8b('0x20')](_0xbc8b('0x5b'),this['channels'][_0x1f996c[_0xbc8b('0x29')]][_0x1f996c[_0xbc8b('0x27')]]);}}}catch(_0x2ed837){logger[_0xbc8b('0x54')](_0xbc8b('0x5c'),_0x1f996c[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x2ed837,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x41ad9f){try{if(this['isNotNull'](_0x41ad9f)){logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x41ad9f[_0xbc8b('0x29')],util['inspect'](_0x41ad9f,{'showHidden':![],'depth':null}));if(this[_0xbc8b('0x2b')][_0x41ad9f['uniqueid']]){for(var _0x1a7d40 in this[_0xbc8b('0x2b')][_0x41ad9f[_0xbc8b('0x29')]]){if(this[_0xbc8b('0x2b')][_0x41ad9f['uniqueid']][_0xbc8b('0x3d')](_0x1a7d40)&&!this[_0xbc8b('0x2b')][_0x41ad9f[_0xbc8b('0x29')]][_0x1a7d40][_0xbc8b('0x4c')]&&!this['channels'][_0x41ad9f[_0xbc8b('0x29')]][_0x1a7d40][_0xbc8b('0x14')]){logger['info'](_0xbc8b('0x5d'),_0x41ad9f['uniqueid'],this[_0xbc8b('0x2b')][_0x41ad9f[_0xbc8b('0x29')]][_0x1a7d40][_0xbc8b('0x26')],_0x1a7d40);this[_0xbc8b('0x2b')][_0x41ad9f[_0xbc8b('0x29')]][_0x1a7d40][_0xbc8b('0x4c')]=!![];this[_0xbc8b('0x2b')][_0x41ad9f[_0xbc8b('0x29')]][_0x1a7d40][_0xbc8b('0x58')]=moment()['format'](_0xbc8b('0x40'));this[_0xbc8b('0x2b')][_0x41ad9f[_0xbc8b('0x29')]][_0x1a7d40]['lastevent']=_0xbc8b('0x5e');this[_0xbc8b('0x2b')][_0x41ad9f[_0xbc8b('0x29')]][_0x1a7d40]['reason']=_0xbc8b('0x5e');logger['debug'](_0xbc8b('0x5f'),_0x41ad9f[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](this[_0xbc8b('0x2b')][_0x41ad9f['uniqueid']][_0x1a7d40],{'showHidden':![],'depth':null}));ami[_0xbc8b('0x20')](_0xbc8b('0x60'),this[_0xbc8b('0x2b')][_0x41ad9f['uniqueid']][_0x1a7d40]);}}}}}catch(_0x4997b3){logger[_0xbc8b('0x54')]('[%s][voiceAgentReport][queuecallerabandon]',_0x41ad9f[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x4997b3,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xbc8b('0x15')]=function(_0x383973){try{if(this['isNotNull'](_0x383973)){logger[_0xbc8b('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x383973[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x383973,{'showHidden':![],'depth':null}));if(this[_0xbc8b('0x2b')][_0x383973[_0xbc8b('0x29')]]){for(var _0x2ef83f in this[_0xbc8b('0x2b')][_0x383973[_0xbc8b('0x29')]]){if(this['channels'][_0x383973[_0xbc8b('0x29')]][_0xbc8b('0x3d')](_0x2ef83f)){if(this[_0xbc8b('0x2b')][_0x383973[_0xbc8b('0x29')]][_0x2ef83f][_0xbc8b('0x3f')]&&!this[_0xbc8b('0x2b')][_0x383973['uniqueid']][_0x2ef83f][_0xbc8b('0x14')]){logger['info'](_0xbc8b('0x61'),_0x383973[_0xbc8b('0x29')],this[_0xbc8b('0x2b')][_0x383973[_0xbc8b('0x29')]][_0x2ef83f][_0xbc8b('0x26')],_0x2ef83f);this['channels'][_0x383973['uniqueid']][_0x2ef83f][_0xbc8b('0x14')]=!![];this[_0xbc8b('0x2b')][_0x383973['uniqueid']][_0x2ef83f][_0xbc8b('0x62')]=moment()[_0xbc8b('0x2c')](_0xbc8b('0x40'));this[_0xbc8b('0x2b')][_0x383973['uniqueid']][_0x2ef83f]['lastevent']=_0xbc8b('0x63');this[_0xbc8b('0x2b')][_0x383973[_0xbc8b('0x29')]][_0x2ef83f][_0xbc8b('0x51')]=_0x383973[_0xbc8b('0x51')]==_0xbc8b('0x64')?_0xbc8b('0x65'):_0x383973['reason'];this[_0xbc8b('0x2b')][_0x383973[_0xbc8b('0x29')]][_0x2ef83f][_0xbc8b('0x66')]=_0x383973[_0xbc8b('0x66')];if(this[_0xbc8b('0xb')][_0x383973['queue']]&&this[_0xbc8b('0xb')][_0x383973['queue']][_0xbc8b('0x67')]){this[_0xbc8b('0x2b')][_0x383973[_0xbc8b('0x29')]][_0x2ef83f][_0xbc8b('0x68')]=this[_0xbc8b('0xb')][_0x383973[_0xbc8b('0x2e')]]['acwTimeout'];this[_0xbc8b('0x2b')][_0x383973[_0xbc8b('0x29')]][_0x2ef83f][_0xbc8b('0x69')]=!![];}this[_0xbc8b('0xc')][_0x383973[_0xbc8b('0x36')]]=_[_0xbc8b('0x33')](this['agents'][_0x383973[_0xbc8b('0x36')]],[_0xbc8b('0x2e'),_0xbc8b('0x48')]);logger[_0xbc8b('0x28')](_0xbc8b('0x6a'),_0x383973['uniqueid'],util[_0xbc8b('0x2a')](this['channels'][_0x383973[_0xbc8b('0x29')]][_0x2ef83f],{'showHidden':![],'depth':null}));ami[_0xbc8b('0x20')](_0xbc8b('0x6b'),this['channels'][_0x383973['uniqueid']][_0x2ef83f]);logger['debug'](_0xbc8b('0x6c'),_0x383973[_0xbc8b('0x29')],util[_0xbc8b('0x2a')]({'id':this['agents'][_0x383973['interface']]['id'],'destaccountcode':_0x383973['destaccountcode']},{'showHidden':![],'depth':null}));this[_0xbc8b('0x20')](util['format'](_0xbc8b('0x39'),_0x383973[_0xbc8b('0x26')]),_0xbc8b('0x6d'),{'id':this[_0xbc8b('0xc')][_0x383973['interface']]['id'],'destaccountcode':_0x383973[_0xbc8b('0x6e')]});}}}}}}catch(_0x954e5c){logger[_0xbc8b('0x54')](_0xbc8b('0x6f'),_0x383973[_0xbc8b('0x29')],util['inspect'](_0x954e5c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbc8b('0x22')][_0xbc8b('0x17')]=function(_0x3469c7){try{if(this['isNotNull'](_0x3469c7)){logger[_0xbc8b('0x28')](_0xbc8b('0x70'),_0x3469c7[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x3469c7,{'showHidden':![],'depth':null}));this[_0xbc8b('0x71')](_0x3469c7[_0xbc8b('0x29')],_[_0xbc8b('0x72')](_0x3469c7[_0xbc8b('0x73')])[0x0],_0x3469c7['value']);if(this[_0xbc8b('0x2b')][_0x3469c7['uniqueid']]){for(var _0x2856ff in this[_0xbc8b('0x2b')][_0x3469c7['uniqueid']]){if(this[_0xbc8b('0x2b')][_0x3469c7[_0xbc8b('0x29')]]['hasOwnProperty'](_0x2856ff)){logger[_0xbc8b('0x24')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x3469c7[_0xbc8b('0x29')],_0x2856ff,_['keys'](_0x3469c7[_0xbc8b('0x73')])[0x0],_0x3469c7['value']);if(_['isUndefined'](this[_0xbc8b('0x2b')][_0x3469c7[_0xbc8b('0x29')]][_0x2856ff][_0xbc8b('0xd')])){this[_0xbc8b('0x2b')][_0x3469c7[_0xbc8b('0x29')]][_0x2856ff][_0xbc8b('0xd')]={};}this[_0xbc8b('0x2b')][_0x3469c7[_0xbc8b('0x29')]][_0x2856ff][_0xbc8b('0xd')]=this[_0xbc8b('0xd')][_0x3469c7[_0xbc8b('0x29')]];}}}}}catch(_0x5c6a2f){logger[_0xbc8b('0x54')](_0xbc8b('0x74'),_0x3469c7[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x5c6a2f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xbc8b('0x71')]=function(_0x2fceca,_0x48e4c4,_0x51d9a6){var _0xd6f969=[_0xbc8b('0x75'),_0xbc8b('0x76'),_0xbc8b('0x77'),_0xbc8b('0x78'),_0xbc8b('0x79'),_0xbc8b('0x7a'),_0xbc8b('0x7b'),_0xbc8b('0x7c'),_0xbc8b('0x7d'),_0xbc8b('0x7e'),_0xbc8b('0x7f'),_0xbc8b('0x80'),'membercalls','memberdynamic',_0xbc8b('0x81'),_0xbc8b('0x82'),_0xbc8b('0x26'),_0xbc8b('0x83'),_0xbc8b('0x84')];if(!_[_0xbc8b('0x85')](_0x48e4c4)&&!_[_0xbc8b('0x86')](_0xd6f969,_0x48e4c4)){if(_['isUndefined'](this[_0xbc8b('0xd')][_0x2fceca])){this['variables'][_0x2fceca]={};}this[_0xbc8b('0xd')][_0x2fceca][_0x48e4c4]=_0x51d9a6;}};VoiceAgentReport['prototype'][_0xbc8b('0x19')]=function(_0x43eb72){try{if(this[_0xbc8b('0x23')](_0x43eb72)){logger[_0xbc8b('0x28')](_0xbc8b('0x87'),_0x43eb72['uniqueid'],util[_0xbc8b('0x2a')](_0x43eb72,{'showHidden':![],'depth':null}));if(this[_0xbc8b('0x2b')][_0x43eb72['uniqueid']]){for(var _0x5cb911 in this[_0xbc8b('0x2b')][_0x43eb72['uniqueid']]){if(this['channels'][_0x43eb72[_0xbc8b('0x29')]][_0xbc8b('0x3d')](_0x5cb911)){if(this['channels'][_0x43eb72[_0xbc8b('0x29')]][_0x5cb911][_0xbc8b('0x51')]==_0xbc8b('0x64')&&this[_0xbc8b('0x2b')][_0x43eb72[_0xbc8b('0x29')]][_0x5cb911][_0xbc8b('0x14')]){logger[_0xbc8b('0x24')](_0xbc8b('0x88'),_0x43eb72['uniqueid'],_0x5cb911);this[_0xbc8b('0x2b')][_0x43eb72['uniqueid']][_0x5cb911][_0xbc8b('0x62')]=moment()['format'](_0xbc8b('0x40'));}}}logger['debug'](_0xbc8b('0x89'),_0x43eb72[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_[_0xbc8b('0x8a')](this[_0xbc8b('0x2b')][_0x43eb72[_0xbc8b('0x29')]]),{'showHidden':![],'depth':null}));ami[_0xbc8b('0x20')](_0xbc8b('0x8b'),_[_0xbc8b('0x8a')](this[_0xbc8b('0x2b')][_0x43eb72['uniqueid']]));delete this[_0xbc8b('0x2b')][_0x43eb72['uniqueid']];}if(this[_0xbc8b('0xd')][_0x43eb72['uniqueid']]){delete this['variables'][_0x43eb72[_0xbc8b('0x29')]];}}}catch(_0x3b60c8){logger[_0xbc8b('0x54')](_0xbc8b('0x8c'),_0x43eb72[_0xbc8b('0x29')],util['inspect'](_0x3b60c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xbc8b('0x1e')]=function(_0x10fa00){try{if(this[_0xbc8b('0x23')](_0x10fa00)){logger[_0xbc8b('0x28')](_0xbc8b('0x8d'),_0x10fa00['uniqueid'],util['inspect'](_0x10fa00,{'showHidden':![],'depth':null}));if(this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x8e')]]){for(var _0x2934d7 in this[_0xbc8b('0x2b')][_0x10fa00['transfereeuniqueid']]){if(this['channels'][_0x10fa00[_0xbc8b('0x8e')]][_0xbc8b('0x3d')](_0x2934d7)){if(_0x10fa00['origtransfereruniqueid']===_0x2934d7){logger[_0xbc8b('0x24')](_0xbc8b('0x8f'),_0x10fa00[_0xbc8b('0x29')],this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x8e')]][_0x2934d7]['membername'],_0x2934d7);var _0x57f5b3=moment();this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x8e')]][_0x2934d7][_0xbc8b('0x14')]=!![];this[_0xbc8b('0x2b')][_0x10fa00['transfereeuniqueid']][_0x2934d7][_0xbc8b('0x62')]=moment()['format'](_0xbc8b('0x40'));this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x8e')]][_0x2934d7][_0xbc8b('0x4f')]=_0xbc8b('0x63');this[_0xbc8b('0x2b')][_0x10fa00['transfereeuniqueid']][_0x2934d7]['reason']=_0xbc8b('0x64');this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x8e')]][_0x2934d7][_0xbc8b('0x66')]=_0x57f5b3['diff'](this[_0xbc8b('0x2b')][_0x10fa00['transfereeuniqueid']][_0x2934d7]['agentconnectAt'],_0xbc8b('0x90'));}}}}if(this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x91')]]){var _0x7814b=this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x91')]];this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x91')]]=this['channels'][_0x10fa00[_0xbc8b('0x8e')]];this[_0xbc8b('0x2b')][_0x10fa00[_0xbc8b('0x8e')]]=_0x7814b;}}}catch(_0x552f7d){logger[_0xbc8b('0x54')]('[%s][voiceAgentReport][attendedtransfer]',_0x10fa00[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x552f7d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbc8b('0x22')][_0xbc8b('0x92')]=function(_0x180432){try{if(this['isNotNull'](_0x180432)){logger['debug'](_0xbc8b('0x93'),_0x180432['uniqueid'],util[_0xbc8b('0x2a')](_0x180432,{'showHidden':![],'depth':null}));if(this[_0xbc8b('0x2b')][_0x180432[_0xbc8b('0x8e')]]){for(var _0x4c4c01 in this['channels'][_0x180432[_0xbc8b('0x8e')]]){if(this[_0xbc8b('0x2b')][_0x180432[_0xbc8b('0x8e')]][_0xbc8b('0x3d')](_0x4c4c01)){if(_0x180432[_0xbc8b('0x94')]===_0x4c4c01){logger[_0xbc8b('0x24')](_0xbc8b('0x95'),_0x180432[_0xbc8b('0x29')],this[_0xbc8b('0x2b')][_0x180432[_0xbc8b('0x8e')]][_0x4c4c01][_0xbc8b('0x26')],_0x4c4c01);var _0x3f2130=moment();this[_0xbc8b('0x2b')][_0x180432[_0xbc8b('0x8e')]][_0x4c4c01][_0xbc8b('0x14')]=!![];this[_0xbc8b('0x2b')][_0x180432[_0xbc8b('0x8e')]][_0x4c4c01]['agentcompleteAt']=_0x3f2130;this[_0xbc8b('0x2b')][_0x180432[_0xbc8b('0x8e')]][_0x4c4c01][_0xbc8b('0x4f')]=_0xbc8b('0x63');this[_0xbc8b('0x2b')][_0x180432[_0xbc8b('0x8e')]][_0x4c4c01][_0xbc8b('0x51')]=_0xbc8b('0x64');this[_0xbc8b('0x2b')][_0x180432[_0xbc8b('0x8e')]][_0x4c4c01][_0xbc8b('0x66')]=_0x3f2130[_0xbc8b('0x96')](this['channels'][_0x180432[_0xbc8b('0x8e')]][_0x4c4c01]['agentconnectAt'],_0xbc8b('0x90'));}}}}}}catch(_0x1b6f9b){logger[_0xbc8b('0x54')](_0xbc8b('0x97'),_0x180432[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x1b6f9b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbc8b('0x22')][_0xbc8b('0x1a')]=function(_0x5adcaa){var _0xbdf33b='';try{if(this[_0xbc8b('0x23')](_0x5adcaa)){logger[_0xbc8b('0x28')](_0xbc8b('0x98'),_0x5adcaa[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x5adcaa,{'showHidden':![],'depth':null}));if(_0x5adcaa['channel']){_0xbdf33b=_0x5adcaa[_0xbc8b('0x99')][_0xbc8b('0x9a')](0x0,_0x5adcaa['channel'][_0xbc8b('0x9b')]('-'));if(this[_0xbc8b('0xc')][_0xbdf33b]){logger[_0xbc8b('0x24')](_0xbc8b('0x9c'),_0x5adcaa[_0xbc8b('0x29')],_0xbdf33b);this[_0xbc8b('0xc')][_0xbdf33b][_0xbc8b('0x9d')]=!![];}}}}catch(_0x123f1d){logger[_0xbc8b('0x54')](_0xbc8b('0x9e'),_0x5adcaa['uniqueid'],util['inspect'](_0x123f1d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xbc8b('0x22')]['syncMusicOnHoldStop']=function(_0x3c1043){var _0x29ac69='';try{if(this[_0xbc8b('0x23')](_0x3c1043)){logger[_0xbc8b('0x28')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x3c1043[_0xbc8b('0x29')],util['inspect'](_0x3c1043,{'showHidden':![],'depth':null}));if(_0x3c1043['channel']){_0x29ac69=_0x3c1043[_0xbc8b('0x99')][_0xbc8b('0x9a')](0x0,_0x3c1043[_0xbc8b('0x99')][_0xbc8b('0x9b')]('-'));if(this['agents'][_0x29ac69]){logger[_0xbc8b('0x24')](_0xbc8b('0x9f'),_0x3c1043[_0xbc8b('0x29')],_0x29ac69);this[_0xbc8b('0xc')][_0x29ac69][_0xbc8b('0x9d')]=![];}}}}catch(_0x4b7cb2){logger[_0xbc8b('0x54')](_0xbc8b('0xa0'),_0x3c1043[_0xbc8b('0x29')],util[_0xbc8b('0x2a')](_0x4b7cb2,{'showHidden':![],'depth':null}));}};module[_0xbc8b('0xa1')]=VoiceAgentReport;
\ No newline at end of file
index 829335a..ecc0c44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bc3=['NO\x20ANSWER','FAILED','defaults','localhost','socket.io-emitter','redis','channels','agents','blindTransfers','bind','syncNewExten','newchannel','syncNewChannel','newstate','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','keys','context','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','linkedid','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','from-sip','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','CDR(routeAlias)','applicationdata','duration','subtract','seconds','pick','includes','lastapplication','lastdata','startsWith','cdr(','match','isNil','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','monitorFilename','monitors','push','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','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','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','user:agentcomplete','transferType','isEmpty','stopRecordingOnTransfer','resolve','then','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','path','ioredis','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','dial'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x4bc3,0x16e));var _0x34bc=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x4bc3[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x34bc('0x0'));var moment=require(_0x34bc('0x1'));var util=require('util');var path=require(_0x34bc('0x2'));var Redis=require(_0x34bc('0x3'));var config=require('../../../config/environment');var logger=require(_0x34bc('0x4'))(_0x34bc('0x5'));var ami=require(_0x34bc('0x6'));var Channel=require(_0x34bc('0x7'));var RpcSetting=require(_0x34bc('0x8'));var applications=[_0x34bc('0x9'),_0x34bc('0xa'),'agi',_0x34bc('0xb'),'playback','voicemail'];var dispositions=[_0x34bc('0xc'),_0x34bc('0xd'),_0x34bc('0xd'),_0x34bc('0xc'),_0x34bc('0xc'),_0x34bc('0xc'),'ANSWERED','BUSY',_0x34bc('0xd'),_0x34bc('0xd'),_0x34bc('0xd')];config['redis']=_[_0x34bc('0xe')](config['redis'],{'host':_0x34bc('0xf'),'port':0x18eb});var io=require(_0x34bc('0x10'))(new Redis(config[_0x34bc('0x11')]));function VoiceCallReport(_0x536ebd){this[_0x34bc('0x12')]=_0x536ebd['channels'];this[_0x34bc('0x13')]=_0x536ebd[_0x34bc('0x13')];this[_0x34bc('0x14')]={};ami['on']('coreshowchannel',this['syncNewExten'][_0x34bc('0x15')](this));ami['on']('newexten',this[_0x34bc('0x16')][_0x34bc('0x15')](this));ami['on'](_0x34bc('0x17'),this[_0x34bc('0x18')][_0x34bc('0x15')](this));ami['on'](_0x34bc('0x19'),this['syncNewState']['bind'](this));ami['on']('varset',this[_0x34bc('0x1a')][_0x34bc('0x15')](this));ami['on'](_0x34bc('0x1b'),this[_0x34bc('0x1c')]['bind'](this));ami['on'](_0x34bc('0x1d'),this[_0x34bc('0x1e')]['bind'](this));ami['on'](_0x34bc('0x1f'),this[_0x34bc('0x20')]['bind'](this));ami['on'](_0x34bc('0x21'),this[_0x34bc('0x22')][_0x34bc('0x15')](this));ami['on'](_0x34bc('0x23'),this[_0x34bc('0x24')][_0x34bc('0x15')](this));ami['on']('musiconholdstop',this[_0x34bc('0x25')][_0x34bc('0x15')](this));try{logger[_0x34bc('0x26')]('[voiceCallReport][coreshowchannels]\x20started');ami['actionCoreShowChannels']();}catch(_0x358d51){logger[_0x34bc('0x27')](_0x34bc('0x28'),util[_0x34bc('0x29')](_0x358d51,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x34bc('0x2a')][_0x34bc('0x2b')]=function(_0x3f3653){return _0x3f3653!==null&&!_[_0x34bc('0x2c')](_0x3f3653);};VoiceCallReport[_0x34bc('0x2a')][_0x34bc('0x2d')]=function(_0x2de017,_0x1edcb0,_0x4fd589){io['to'](_0x2de017)[_0x34bc('0x2d')](_0x1edcb0,_0x4fd589);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x3da96b){try{if(this['isNotNull'](_0x3da96b)){logger[_0x34bc('0x26')](_0x34bc('0x2e'),_0x3da96b[_0x34bc('0x2f')],_0x3da96b['calleridname'],_0x3da96b[_0x34bc('0x30')]);logger[_0x34bc('0x31')](_0x34bc('0x32'),_0x3da96b[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x3da96b,{'showHidden':![],'depth':null}));if(_0x3da96b[_0x34bc('0x2f')]===_0x3da96b['linkedid']){if(!_[_0x34bc('0x2c')](this[_0x34bc('0x12')][_0x3da96b[_0x34bc('0x2f')]])){_[_0x34bc('0x33')](this[_0x34bc('0x12')][_0x3da96b[_0x34bc('0x2f')]],_['pick'](_0x3da96b,_[_0x34bc('0x34')](this['channels'][_0x3da96b['uniqueid']])));}}if(_0x3da96b[_0x34bc('0x35')]==='from-sip'){if(this[_0x34bc('0x13')][_0x3da96b[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]){if(_0x3da96b[_0x34bc('0x38')]==_0x34bc('0x39')){this[_0x34bc('0x13')][_0x3da96b[_0x34bc('0x36')]['split']('-')[0x0]][_0x34bc('0x3a')]=_0x3da96b[_0x34bc('0x3b')];this[_0x34bc('0x2d')](util[_0x34bc('0x3c')](_0x34bc('0x3d'),this['agents'][_0x3da96b[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x3e')]),_0x34bc('0x3f'),{'destaccountcode':this[_0x34bc('0x13')][_0x3da96b['channel']['split']('-')[0x0]][_0x34bc('0x40')],'destconnectedlinenum':_0x3da96b[_0x34bc('0x3b')]});}}}}}catch(_0xf9453c){logger[_0x34bc('0x27')]('[%s][voiceCallReport][newcallerid]',_0x3da96b[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0xf9453c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34bc('0x2a')]['syncNewChannel']=function(_0x37cd30){try{if(this[_0x34bc('0x2b')](_0x37cd30)){logger[_0x34bc('0x31')](_0x34bc('0x41'),_0x37cd30['uniqueid'],util[_0x34bc('0x29')](_0x37cd30,{'showHidden':![],'depth':null}));if(this[_0x34bc('0x12')][_0x37cd30[_0x34bc('0x2f')]])return;if(_0x37cd30['channel']===_0x34bc('0x42'))return;if(_0x37cd30[_0x34bc('0x2f')]!==_0x37cd30[_0x34bc('0x43')]&&!this[_0x34bc('0x14')][_0x37cd30[_0x34bc('0x43')]])return;logger['info'](_0x34bc('0x44'),_0x37cd30[_0x34bc('0x2f')],_0x37cd30[_0x34bc('0x35')],_0x37cd30[_0x34bc('0x38')]);this[_0x34bc('0x12')][_0x37cd30['uniqueid']]=new Channel();this[_0x34bc('0x12')][_0x37cd30['uniqueid']][_0x34bc('0x45')]=moment()[_0x34bc('0x3c')](_0x34bc('0x46'));this[_0x34bc('0x12')][_0x37cd30['uniqueid']][_0x34bc('0x47')]=dispositions[_[_0x34bc('0x48')](_0x37cd30['channelstate'])];_[_0x34bc('0x33')](this[_0x34bc('0x12')][_0x37cd30[_0x34bc('0x2f')]],_['pick'](_0x37cd30,_[_0x34bc('0x34')](this[_0x34bc('0x12')][_0x37cd30[_0x34bc('0x2f')]])));if(_0x37cd30[_0x34bc('0x35')]===_0x34bc('0x49')){if(this[_0x34bc('0x13')][_0x37cd30[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]){if(_[_0x34bc('0x2c')](this[_0x34bc('0x13')][_0x37cd30[_0x34bc('0x36')]['split']('-')[0x0]]['destconnectedlinenum'])){this[_0x34bc('0x13')][_0x37cd30[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x3a')]=_0x37cd30[_0x34bc('0x38')];logger[_0x34bc('0x31')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x37cd30[_0x34bc('0x2f')],util['inspect']({'id':this[_0x34bc('0x13')][_0x37cd30[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x37cd30[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x40')],'destconnectedlinenum':_0x37cd30[_0x34bc('0x38')]},{'showHidden':![],'depth':null}));this[_0x34bc('0x2d')](util[_0x34bc('0x3c')](_0x34bc('0x3d'),this[_0x34bc('0x13')][_0x37cd30[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x3e')]),_0x34bc('0x3f'),{'id':this['agents'][_0x37cd30['channel'][_0x34bc('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0x34bc('0x13')][_0x37cd30[_0x34bc('0x36')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x37cd30[_0x34bc('0x38')]});}}}}}catch(_0x335891){logger[_0x34bc('0x27')]('[%s][voiceCallReport][newchannel]',_0x37cd30[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x335891,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x34bc('0x16')]=function(_0x4d0f03){try{if(this[_0x34bc('0x2b')](_0x4d0f03)){logger['debug'](_0x34bc('0x4a'),_0x4d0f03[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x4d0f03,{'showHidden':![],'depth':null}));if(_0x4d0f03[_0x34bc('0x36')]==='OutgoingSpoolFailed'||_0x4d0f03[_0x34bc('0x38')]==='h')return;if(_0x4d0f03[_0x34bc('0x2f')]===_0x4d0f03[_0x34bc('0x43')]||this[_0x34bc('0x14')][_0x4d0f03[_0x34bc('0x43')]]){_0x4d0f03[_0x34bc('0x4b')]=_0x4d0f03[_0x34bc('0x4b')][_0x34bc('0x4c')]();_0x4d0f03['applicationdata']=_0x4d0f03['appdata']||_0x4d0f03['applicationdata'];if(_0x4d0f03[_0x34bc('0x4d')]&&!_0x4d0f03[_0x34bc('0x4d')]['startsWith'](_0x34bc('0x4e'))&&_0x4d0f03[_0x34bc('0x4b')]!==_0x34bc('0xa')){_0x4d0f03[_0x34bc('0x4f')]=_0x4d0f03[_0x34bc('0x4f')]['toLowerCase']();}logger['info']('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x4d0f03[_0x34bc('0x2f')],_0x4d0f03[_0x34bc('0x4b')],_0x4d0f03[_0x34bc('0x4f')]);if(_[_0x34bc('0x2c')](this[_0x34bc('0x12')][_0x4d0f03['uniqueid']])){this[_0x34bc('0x12')][_0x4d0f03[_0x34bc('0x2f')]]=new Channel();this[_0x34bc('0x12')][_0x4d0f03[_0x34bc('0x2f')]]['starttime']=_0x4d0f03[_0x34bc('0x50')]?moment()[_0x34bc('0x51')](moment[_0x34bc('0x50')](_0x4d0f03[_0x34bc('0x50')])[_0x34bc('0x52')](),_0x34bc('0x52'))[_0x34bc('0x3c')](_0x34bc('0x46')):moment()[_0x34bc('0x3c')](_0x34bc('0x46'));this[_0x34bc('0x12')][_0x4d0f03[_0x34bc('0x2f')]][_0x34bc('0x47')]='NO\x20ANSWER';}_[_0x34bc('0x33')](this[_0x34bc('0x12')][_0x4d0f03[_0x34bc('0x2f')]],_[_0x34bc('0x53')](_0x4d0f03,_[_0x34bc('0x34')](this[_0x34bc('0x12')][_0x4d0f03[_0x34bc('0x2f')]])));if(_[_0x34bc('0x54')](applications,_0x4d0f03[_0x34bc('0x4b')])){this[_0x34bc('0x12')][_0x4d0f03[_0x34bc('0x2f')]][_0x34bc('0x55')]=_0x4d0f03[_0x34bc('0x4b')];this[_0x34bc('0x12')][_0x4d0f03['uniqueid']][_0x34bc('0x56')]=_0x4d0f03[_0x34bc('0x4f')];if(_0x4d0f03[_0x34bc('0x4b')]===_0x34bc('0x9')&&_[_0x34bc('0x57')](_0x4d0f03[_0x34bc('0x4f')][_0x34bc('0x4c')](),_0x34bc('0x58'))){var _0x47068c=_0x4d0f03[_0x34bc('0x4f')]['split']('=');var _0x837259=_0x47068c[0x0][_0x34bc('0x4c')]()[_0x34bc('0x59')](/cdr\((.*)\)/);if(_0x837259){if(_0x837259[0x1]==='type'&&!_[_0x34bc('0x5a')](this[_0x34bc('0x12')][_0x4d0f03[_0x34bc('0x2f')]][_0x837259[0x1]]))return;this[_0x34bc('0x12')][_0x4d0f03['uniqueid']][_0x837259[0x1]]=_0x47068c[0x1];}}else if(_0x4d0f03[_0x34bc('0x4b')]===_0x34bc('0xa')){this[_0x34bc('0x12')][_0x4d0f03[_0x34bc('0x2f')]][_0x34bc('0xa')]=_0x4d0f03[_0x34bc('0x4f')][_0x34bc('0x37')](',')[0x0];}}}}}catch(_0x3b8f72){logger['error']('[%s][voiceCallReport][newexten]',_0x4d0f03[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x3b8f72,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34bc('0x2a')][_0x34bc('0x5b')]=function(_0x1108c5){try{if(this[_0x34bc('0x2b')](_0x1108c5)){logger[_0x34bc('0x26')](_0x34bc('0x5c'),_0x1108c5[_0x34bc('0x2f')],_0x1108c5[_0x34bc('0x43')],_0x1108c5[_0x34bc('0x5d')],_0x1108c5[_0x34bc('0x30')]);logger[_0x34bc('0x31')](_0x34bc('0x5e'),_0x1108c5['uniqueid'],util[_0x34bc('0x29')](_0x1108c5,{'showHidden':![],'depth':null}));if(_0x1108c5[_0x34bc('0x5f')]!=='6')return;if(_0x1108c5[_0x34bc('0x2f')]!==_0x1108c5['linkedid']){var _0x3b602a=moment();if(this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]]){if(!this[_0x34bc('0x12')][_0x1108c5['linkedid']][_0x34bc('0x60')]){this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]][_0x34bc('0x60')]=!![];this[_0x34bc('0x12')][_0x1108c5['linkedid']][_0x34bc('0x61')]=_0x3b602a[_0x34bc('0x3c')](_0x34bc('0x46'));if(this[_0x34bc('0x12')][_0x1108c5['linkedid']][_0x34bc('0x45')]){this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]][_0x34bc('0x62')]=_0x3b602a[_0x34bc('0x63')](this[_0x34bc('0x12')][_0x1108c5['linkedid']]['starttime'],_0x34bc('0x52'));}}this[_0x34bc('0x12')][_0x1108c5['linkedid']][_0x34bc('0x43')]=_0x1108c5[_0x34bc('0x2f')];if(_0x1108c5[_0x34bc('0x30')]!==_0x34bc('0x39')){this['channels'][_0x1108c5['linkedid']][_0x34bc('0x3b')]=_0x1108c5[_0x34bc('0x30')];}this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]][_0x34bc('0x64')]=_0x1108c5[_0x34bc('0x5d')];this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]][_0x34bc('0x65')]=_0x1108c5[_0x34bc('0x36')];this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]][_0x34bc('0x47')]=dispositions[_[_0x34bc('0x48')](_0x1108c5[_0x34bc('0x5f')])];if(this[_0x34bc('0x13')][_0x1108c5['channel'][_0x34bc('0x37')]('-')[0x0]]){this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]][_0x34bc('0x66')]=this[_0x34bc('0x13')][_0x1108c5['channel'][_0x34bc('0x37')]('-')[0x0]]['id'];this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]][_0x34bc('0x67')]=this[_0x34bc('0x13')][_0x1108c5['channel'][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x3e')];}}if(this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]]){if(!this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]]['answered']){this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]]['answered']=!![];this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x61')]=_0x3b602a['format']('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x34bc('0x12')][_0x1108c5['uniqueid']]['starttime']){this['channels'][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x62')]=_0x3b602a[_0x34bc('0x63')](this['channels'][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x45')],_0x34bc('0x52'));}}if(_0x1108c5[_0x34bc('0x30')]!==_0x34bc('0x39')){this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x3b')]=_0x1108c5[_0x34bc('0x30')];}this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x64')]=_0x1108c5['calleridname'];this['channels'][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x65')]=_0x1108c5[_0x34bc('0x36')];this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x47')]=dispositions[_[_0x34bc('0x48')](_0x1108c5[_0x34bc('0x5f')])];}}else{if(this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]]){if(this['agents'][_0x1108c5[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]){this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x66')]=this[_0x34bc('0x13')][_0x1108c5[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]['id'];this[_0x34bc('0x12')][_0x1108c5['uniqueid']][_0x34bc('0x67')]=this['agents'][_0x1108c5['channel'][_0x34bc('0x37')]('-')[0x0]]['name'];}}}if(_0x1108c5['context']===_0x34bc('0x49')){if(this[_0x34bc('0x13')][_0x1108c5['channel'][_0x34bc('0x37')]('-')[0x0]]){this[_0x34bc('0x13')][_0x1108c5[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]['destconnectedlinenum']=_0x1108c5[_0x34bc('0x38')];var _0x35974b,_0x5e1b4d;if(this['channels'][_0x1108c5['uniqueid']]){_0x35974b=this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0x68')];_0x5e1b4d=this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x2f')]][_0x34bc('0xa')];}else if(this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]]){_0x35974b=this[_0x34bc('0x12')][_0x1108c5['linkedid']][_0x34bc('0x68')];_0x5e1b4d=this[_0x34bc('0x12')][_0x1108c5[_0x34bc('0x43')]][_0x34bc('0xa')];}logger[_0x34bc('0x31')](_0x34bc('0x69'),_0x1108c5['uniqueid'],util[_0x34bc('0x29')]({'id':this[_0x34bc('0x13')][_0x1108c5[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0x34bc('0x13')][_0x1108c5[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x40')],'destconnectedlinenum':_0x1108c5['exten'],'routealias':_0x35974b,'queue':_0x5e1b4d||undefined},{'showHidden':![],'depth':null}));this[_0x34bc('0x2d')](util[_0x34bc('0x3c')](_0x34bc('0x3d'),this['agents'][_0x1108c5['channel'][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x3e')]),_0x34bc('0x3f'),{'id':this[_0x34bc('0x13')][_0x1108c5['channel'][_0x34bc('0x37')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x34bc('0x13')][_0x1108c5[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1108c5[_0x34bc('0x38')],'routealias':_0x35974b,'queue':_0x5e1b4d||undefined});}}}}catch(_0x29cd84){logger[_0x34bc('0x27')](_0x34bc('0x6a'),_0x1108c5[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x29cd84,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x34bc('0x6b')]=function(_0x11024a,_0x4094e4){try{if(this[_0x34bc('0x12')][_0x11024a]){logger['info'](_0x34bc('0x6c'),_0x11024a,_0x4094e4);this[_0x34bc('0x12')][_0x11024a][_0x34bc('0x6d')]=!![];if(_['endsWith'](_0x4094e4,_0x34bc('0x6e'))){_0x4094e4=_0x4094e4[_0x34bc('0x6f')](_0x34bc('0x6e'),_0x34bc('0x70'));}this['channels'][_0x11024a][_0x34bc('0x71')]=_0x4094e4;var _0x58e8cb=_['find'](this[_0x34bc('0x12')][_0x11024a]['monitors'],{'filename':_0x4094e4});if(_[_0x34bc('0x5a')](_0x58e8cb)){this[_0x34bc('0x12')][_0x11024a][_0x34bc('0x72')][_0x34bc('0x73')]({'filename':_0x4094e4,'createdAt':moment()['format'](_0x34bc('0x46')),'mixmonitorid':'','status':'rec'});}}}catch(_0x3dc7a2){logger[_0x34bc('0x27')]('[%s][voiceCallReport][mixMonitorFilename]',_0x11024a,util[_0x34bc('0x29')](_0x3dc7a2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34bc('0x2a')][_0x34bc('0x1a')]=function(_0x5daeb9){try{if(this['isNotNull'](_0x5daeb9)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x5daeb9['uniqueid'],util[_0x34bc('0x29')](_0x5daeb9,{'showHidden':![],'depth':null}));if(this[_0x34bc('0x12')][_0x5daeb9[_0x34bc('0x2f')]]&&_0x5daeb9[_0x34bc('0x36')]!='OutgoingSpoolFailed'){if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')])){if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')][_0x34bc('0x75')])){logger[_0x34bc('0x26')](_0x34bc('0x76'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);this[_0x34bc('0x6b')](_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);}else if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')][_0x34bc('0x78')])){logger[_0x34bc('0x26')](_0x34bc('0x79'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9['value']);this['channels'][_0x5daeb9['uniqueid']][_0x34bc('0x30')]=_0x5daeb9[_0x34bc('0x77')];}else if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')]['xmd-callerid'])){logger[_0x34bc('0x26')](_0x34bc('0x7a'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);this['channels'][_0x5daeb9[_0x34bc('0x2f')]]['callerid']=_0x5daeb9[_0x34bc('0x77')];}else if(this[_0x34bc('0x2b')](_0x5daeb9['variable'][_0x34bc('0x7b')])){logger['info'](_0x34bc('0x7c'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);this[_0x34bc('0x12')][_0x5daeb9['uniqueid']][_0x34bc('0x7d')]=_0x5daeb9[_0x34bc('0x77')];}else if(this[_0x34bc('0x2b')](_0x5daeb9['variable'][_0x34bc('0x7e')])){logger[_0x34bc('0x26')](_0x34bc('0x7f'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')][_0x34bc('0x37')](',')[0x0]);this[_0x34bc('0x12')][_0x5daeb9[_0x34bc('0x2f')]][_0x34bc('0xa')]=_0x5daeb9[_0x34bc('0x77')]['split'](',')[0x0];}else if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')][_0x34bc('0x80')])){logger[_0x34bc('0x26')](_0x34bc('0x81'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);this[_0x34bc('0x12')][_0x5daeb9[_0x34bc('0x2f')]][_0x34bc('0x82')]=_0x5daeb9['value'];}else if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')][_0x34bc('0x83')])){logger[_0x34bc('0x26')](_0x34bc('0x84'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);this[_0x34bc('0x12')][_0x5daeb9[_0x34bc('0x2f')]][_0x34bc('0x85')]=_0x5daeb9[_0x34bc('0x77')];}else if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')][_0x34bc('0x86')])){logger['info'](_0x34bc('0x87'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);this['channels'][_0x5daeb9['uniqueid']]['calleridpreview']=_0x5daeb9[_0x34bc('0x77')];}else if(this['isNotNull'](_0x5daeb9[_0x34bc('0x74')][_0x34bc('0x88')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);this['channels'][_0x5daeb9[_0x34bc('0x2f')]]['queue']=_0x5daeb9[_0x34bc('0x77')];}else if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')][_0x34bc('0x89')])){logger['info'](_0x34bc('0x8a'),_0x5daeb9[_0x34bc('0x2f')],_0x5daeb9[_0x34bc('0x77')]);this[_0x34bc('0x12')][_0x5daeb9[_0x34bc('0x2f')]][_0x34bc('0x8b')]=_0x5daeb9[_0x34bc('0x77')];}}}else if(this['isNotNull'](_0x5daeb9['variable'][_0x34bc('0x75')])){if(_0x5daeb9[_0x34bc('0x77')]){var _0x133070=path['parse'](_0x5daeb9[_0x34bc('0x77')])[_0x34bc('0x3e')];logger[_0x34bc('0x26')](_0x34bc('0x76'),_0x133070,_0x5daeb9['value']);this[_0x34bc('0x6b')](_0x133070,_0x5daeb9[_0x34bc('0x77')]);}}else if(this[_0x34bc('0x12')][_0x5daeb9[_0x34bc('0x43')]]){if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')])){if(this[_0x34bc('0x2b')](_0x5daeb9[_0x34bc('0x74')][_0x34bc('0x89')])){logger[_0x34bc('0x26')](_0x34bc('0x8a'),_0x5daeb9[_0x34bc('0x43')],_0x5daeb9[_0x34bc('0x77')]);this[_0x34bc('0x12')][_0x5daeb9['linkedid']][_0x34bc('0x8c')]=_0x5daeb9[_0x34bc('0x77')];}}}}}catch(_0x5362ed){logger[_0x34bc('0x27')](_0x34bc('0x8d'),_0x5daeb9[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x5362ed,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34bc('0x2a')][_0x34bc('0x1c')]=function(_0x5b7c41){try{if(this[_0x34bc('0x2b')](_0x5b7c41)){logger['debug'](_0x34bc('0x8e'),_0x5b7c41['uniqueid'],util[_0x34bc('0x29')](_0x5b7c41,{'showHidden':![],'depth':null}));if(this[_0x34bc('0x14')][_0x5b7c41['linkedid']]){if(this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]]['linkedid']]){this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x43')]][_0x34bc('0x2f')]=_0x5b7c41[_0x34bc('0x2f')];this['channels'][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]]['linkedid']][_0x34bc('0x60')]=this[_0x34bc('0x12')][_0x5b7c41['uniqueid']][_0x34bc('0x60')];this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41['linkedid']][_0x34bc('0x43')]]['answertime']=this['channels'][_0x5b7c41['uniqueid']][_0x34bc('0x61')];this['channels'][this[_0x34bc('0x14')][_0x5b7c41['linkedid']]['linkedid']][_0x34bc('0x65')]=this['channels'][this['blindTransfers'][_0x5b7c41[_0x34bc('0x43')]]['linkedid']][_0x34bc('0x36')];this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]]['linkedid']][_0x34bc('0x47')]=this[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x47')];this['channels'][_0x5b7c41[_0x34bc('0x2f')]]=this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x43')]];delete this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x43')]];}else if(this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41['linkedid']]['uniqueid']]){this['channels'][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]]['uniqueid']][_0x34bc('0x2f')]=[this[_0x34bc('0x12')][this['blindTransfers'][_0x5b7c41['linkedid']][_0x34bc('0x2f')]][_0x34bc('0x43')],this['channels'][this['blindTransfers'][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x2f')]][_0x34bc('0x43')]=this['channels'][this['blindTransfers'][_0x5b7c41['linkedid']][_0x34bc('0x2f')]]['uniqueid']][0x0];this[_0x34bc('0x12')][this['blindTransfers'][_0x5b7c41['linkedid']][_0x34bc('0x2f')]][_0x34bc('0x60')]=this[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x60')];this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x2f')]][_0x34bc('0x61')]=this[_0x34bc('0x12')][_0x5b7c41['uniqueid']][_0x34bc('0x61')];this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x2f')]]['destinationchannel']=this[_0x34bc('0x12')][this['blindTransfers'][_0x5b7c41[_0x34bc('0x43')]]['uniqueid']]['channel'];this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x2f')]][_0x34bc('0x47')]=this['channels'][_0x5b7c41['uniqueid']][_0x34bc('0x47')];this[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]]=this[_0x34bc('0x12')][this[_0x34bc('0x14')][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x2f')]];delete this['channels'][this['blindTransfers'][_0x5b7c41[_0x34bc('0x43')]][_0x34bc('0x2f')]];}}if(this['channels'][_0x5b7c41[_0x34bc('0x2f')]]){logger[_0x34bc('0x26')](_0x34bc('0x8f'),_0x5b7c41[_0x34bc('0x2f')],_0x5b7c41['cause-txt']);var _0x3b45e8=moment();this[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x90')]=_0x3b45e8[_0x34bc('0x3c')](_0x34bc('0x46'));this['channels'][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x50')]=_0x3b45e8[_0x34bc('0x63')](this['channels'][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x45')],_0x34bc('0x52'));if(this[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x60')]){this[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]]['billableseconds']=_0x3b45e8[_0x34bc('0x63')](this[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]]['answertime'],_0x34bc('0x52'));this['channels'][_0x5b7c41['uniqueid']]['holdtime']=this[_0x34bc('0x12')][_0x5b7c41['uniqueid']]['duration']-this['channels'][_0x5b7c41['uniqueid']][_0x34bc('0x91')];}if(_0x5b7c41[_0x34bc('0x35')]===_0x34bc('0x49')){if(this[_0x34bc('0x13')][_0x5b7c41[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]){this[_0x34bc('0x13')][_0x5b7c41[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]=_['omit'](this[_0x34bc('0x13')][_0x5b7c41[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]],[_0x34bc('0x3a')]);logger[_0x34bc('0x31')](_0x34bc('0x92'),_0x5b7c41[_0x34bc('0x2f')],util[_0x34bc('0x29')]({'id':this[_0x34bc('0x13')][_0x5b7c41['channel'][_0x34bc('0x37')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x5b7c41['channel'][_0x34bc('0x37')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x34bc('0x2d')](util[_0x34bc('0x3c')]('user:%s',this[_0x34bc('0x13')][_0x5b7c41['channel'][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x3e')]),'user:agentcomplete',{'id':this[_0x34bc('0x13')][_0x5b7c41[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0x34bc('0x13')][_0x5b7c41[_0x34bc('0x36')][_0x34bc('0x37')]('-')[0x0]][_0x34bc('0x40')]});for(var _0x23542f=0x0;_0x23542f<Object[_0x34bc('0x34')](this[_0x34bc('0x13')])[_0x34bc('0x93')];_0x23542f++){var _0x23e590=Object[_0x34bc('0x34')](this['agents'])[_0x23542f];var _0x7f2aaf=this[_0x34bc('0x13')][_0x23e590];if(_0x7f2aaf[_0x34bc('0x40')]===Number(_0x5b7c41[_0x34bc('0x3b')])){this[_0x34bc('0x2d')](util[_0x34bc('0x3c')](_0x34bc('0x3d'),_0x7f2aaf['name']),_0x34bc('0x94'),{'id':_0x7f2aaf['id'],'destaccountcode':_0x7f2aaf[_0x34bc('0x40')],'transfer':this[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x95')]});break;}}}}var _0x51c712=this;Promise['resolve']()['then'](function(){var _0x2a0076=_0x51c712[_0x34bc('0x12')][_0x5b7c41['uniqueid']];if(typeof _0x2a0076[_0x34bc('0x95')]==='undefined')return;if(_[_0x34bc('0x96')](_0x2a0076['monitors']))return;return RpcSetting['getSettings']()['then'](function(_0x3bb206){if(!_0x3bb206[_0x34bc('0x97')])return;return Promise[_0x34bc('0x98')]()[_0x34bc('0x99')](function(){return ami[_0x34bc('0x9a')]({'action':_0x34bc('0x9b'),'channel':_0x2a0076['channel']})[_0x34bc('0x9c')](function(){});})[_0x34bc('0x99')](function(){return ami[_0x34bc('0x9a')]({'action':_0x34bc('0x9b'),'channel':_0x2a0076[_0x34bc('0x65')]})[_0x34bc('0x9c')](function(){})['finally'](function(){var _0x3622c2=_0x51c712[_0x34bc('0x13')][_0x2a0076[_0x34bc('0x65')][_0x34bc('0x37')]('-')[0x0]];if(!_0x3622c2)return;io[_0x34bc('0x2d')](_0x34bc('0x9d'),{'agentId':_0x3622c2['id'],'uniqueid':_0x2a0076[_0x34bc('0x2f')]});});});});})[_0x34bc('0x99')](function(){if(_0x5b7c41[_0x34bc('0x9e')]===_0x34bc('0x9f')){_0x51c712['blindTransfers'][_0x5b7c41['uniqueid']]=_0x5b7c41;}else{if(_0x51c712[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x7d')]==='outbound'&&_0x51c712[_0x34bc('0x14')][_0x5b7c41['uniqueid']]){_0x51c712[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x2f')]=[_0x51c712[_0x34bc('0x12')][_0x5b7c41['uniqueid']][_0x34bc('0x43')],_0x51c712['channels'][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x43')]=_0x51c712['channels'][_0x5b7c41[_0x34bc('0x2f')]][_0x34bc('0x2f')]][0x0];delete _0x51c712['blindTransfers'][_0x5b7c41['uniqueid']];}}logger[_0x34bc('0x31')](_0x34bc('0xa0'),_0x5b7c41['uniqueid'],util['inspect'](_0x51c712[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]],{'showHidden':![],'depth':null}));ami[_0x34bc('0x2d')]('custom:voiceCallReport',_0x51c712[_0x34bc('0x12')][_0x5b7c41[_0x34bc('0x2f')]]);delete _0x51c712['channels'][_0x5b7c41[_0x34bc('0x2f')]];});}}}catch(_0x4c2aed){logger[_0x34bc('0x27')](_0x34bc('0xa1'),_0x5b7c41[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x4c2aed,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34bc('0x2a')][_0x34bc('0x20')]=function(_0x55d529){try{if(this['isNotNull'](_0x55d529)){logger[_0x34bc('0x26')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x55d529[_0x34bc('0x2f')],_0x55d529[_0x34bc('0xa2')],_0x55d529['transfertargetcalleridnum']);logger[_0x34bc('0x31')](_0x34bc('0xa3'),_0x55d529[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x55d529,{'showHidden':![],'depth':null}));var _0x11d0bc;if(this['channels'][_0x55d529[_0x34bc('0xa4')]]){this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa4')]][_0x34bc('0xa5')]=_0x55d529[_0x34bc('0xa2')];this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa4')]]['transferconnectedlinenum']=_0x55d529[_0x34bc('0xa6')];if(this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa7')]]){_0x11d0bc=this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa7')]];this[_0x34bc('0x12')][_0x55d529['secondtransfereruniqueid']]=this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa4')]];this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa4')]]=_0x11d0bc;}this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa7')]]['transferType']=_0x34bc('0xa8');}else if(this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa9')]]){this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa9')]][_0x34bc('0xa5')]=_0x55d529[_0x34bc('0xa2')];this['channels'][_0x55d529['transfertargetuniqueid']][_0x34bc('0xaa')]=_0x55d529[_0x34bc('0xa6')];if(this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xab')]]){_0x11d0bc=this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xab')]];this['channels'][_0x55d529[_0x34bc('0xab')]]=this[_0x34bc('0x12')][_0x55d529['transfertargetuniqueid']];this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa9')]]=_0x11d0bc;}this['channels'][_0x55d529['transfertargetuniqueid']][_0x34bc('0x95')]=_0x34bc('0xa8');}if((this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xab')]]||this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xac')]])&&this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa7')]]){var _0x3f3c4b=_[_0x34bc('0xad')]([this[_0x34bc('0x12')][_0x55d529['origtransfereruniqueid']],this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xac')]],this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa7')]]],function(_0x80b623){return _0x80b623&&_0x80b623[_0x34bc('0x7d')]==='outbound'&&_0x80b623[_0x34bc('0xae')];});if(_0x3f3c4b){if(this['channels'][_0x55d529[_0x34bc('0xab')]])this['channels'][_0x55d529['origtransfereruniqueid']][_0x34bc('0x95')]=_0x34bc('0xa8');if(this[_0x34bc('0x12')][_0x55d529['origtransfererlinkedid']])this[_0x34bc('0x12')][_0x55d529['origtransfererlinkedid']][_0x34bc('0x95')]='ATTENDED';this[_0x34bc('0x12')][_0x55d529[_0x34bc('0xa7')]][_0x34bc('0x95')]='ATTENDED';}}}}catch(_0x57abf4){logger[_0x34bc('0x27')]('[%s][voiceCallReport][attendedtransfer]',_0x55d529['uniqueid'],util[_0x34bc('0x29')](_0x57abf4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34bc('0x2a')][_0x34bc('0x22')]=function(_0x7a8a22){try{if(this[_0x34bc('0x2b')](_0x7a8a22)){logger[_0x34bc('0x26')](_0x34bc('0xaf'),_0x7a8a22['uniqueid'],_0x7a8a22['transfereecalleridnum'],_0x7a8a22[_0x34bc('0xb0')]);logger[_0x34bc('0x31')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x7a8a22[_0x34bc('0x2f')],util['inspect'](_0x7a8a22,{'showHidden':![],'depth':null}));if(this[_0x34bc('0x12')][_0x7a8a22[_0x34bc('0xa4')]]){this[_0x34bc('0x12')][_0x7a8a22[_0x34bc('0xa4')]][_0x34bc('0xa5')]=_0x7a8a22[_0x34bc('0xb1')];this['channels'][_0x7a8a22['transfereeuniqueid']][_0x34bc('0xaa')]=_0x7a8a22[_0x34bc('0xb0')];this[_0x34bc('0x12')][_0x7a8a22['transfereeuniqueid']]['transferType']=_0x34bc('0xb2');this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x7a8a22[_0x34bc('0xa4')],'linkedid':_0x7a8a22[_0x34bc('0xb3')],'context':_0x7a8a22[_0x34bc('0x35')],'channel':_0x7a8a22[_0x34bc('0xb4')]});}else{this[_0x34bc('0x12')][_0x7a8a22[_0x34bc('0xb3')]][_0x34bc('0x95')]='BLIND';this[_0x34bc('0x1c')]({'event':'BlindTransfer','uniqueid':_0x7a8a22[_0x34bc('0xb3')],'linkedid':_0x7a8a22[_0x34bc('0xa4')],'context':_0x7a8a22['context'],'channel':_0x7a8a22[_0x34bc('0xb4')]});}}}catch(_0x5f4598){logger[_0x34bc('0x27')]('[%s][voiceCallReport][blindtransfer]',_0x7a8a22['uniqueid'],util[_0x34bc('0x29')](_0x5f4598,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x34bc('0x2a')]['syncMusicOnHoldStart']=function(_0x5158bf){try{if(this[_0x34bc('0x2b')](_0x5158bf)){logger['debug']('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x5158bf[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x5158bf,{'showHidden':![],'depth':null}));if(this[_0x34bc('0x12')][_0x5158bf['uniqueid']]){if(!_[_0x34bc('0x5a')](this[_0x34bc('0x12')][_0x5158bf['uniqueid']][_0x34bc('0x61')])){this[_0x34bc('0x12')][_0x5158bf['uniqueid']][_0x34bc('0xb5')]=moment()['format'](_0x34bc('0x46'));logger[_0x34bc('0x26')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x5158bf['uniqueid'],this[_0x34bc('0x12')][_0x5158bf['uniqueid']][_0x34bc('0xb5')]);}}}}catch(_0x4181e0){logger['error'](_0x34bc('0xb6'),_0x5158bf[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x4181e0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x34bc('0x25')]=function(_0xdcc0c4){try{if(this[_0x34bc('0x2b')](_0xdcc0c4)){logger[_0x34bc('0x31')](_0x34bc('0xb7'),_0xdcc0c4[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0xdcc0c4,{'showHidden':![],'depth':null}));if(this[_0x34bc('0x12')][_0xdcc0c4[_0x34bc('0x2f')]]){if(!_['isNil'](this[_0x34bc('0x12')][_0xdcc0c4[_0x34bc('0x2f')]][_0x34bc('0xb5')])){this[_0x34bc('0x12')][_0xdcc0c4[_0x34bc('0x2f')]][_0x34bc('0xb8')]+=moment()[_0x34bc('0xb9')](0x0)[_0x34bc('0x63')](this[_0x34bc('0x12')][_0xdcc0c4[_0x34bc('0x2f')]]['mohstarttime'],'seconds');logger['info'](_0x34bc('0xba'),_0xdcc0c4[_0x34bc('0x2f')],this[_0x34bc('0x12')][_0xdcc0c4[_0x34bc('0x2f')]][_0x34bc('0xb8')]);delete this[_0x34bc('0x12')][_0xdcc0c4[_0x34bc('0x2f')]][_0x34bc('0xb5')];}}}}catch(_0x250ac2){logger['error'](_0x34bc('0xbb'),_0xdcc0c4[_0x34bc('0x2f')],util[_0x34bc('0x29')](_0x250ac2,{'showHidden':![],'depth':null}));}};module[_0x34bc('0xbc')]=VoiceCallReport;
\ No newline at end of file
+var _0x7a2c=['voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncVarSet','hangup','syncHangup','syncNewCallerId','blindtransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','exten','channel','destconnectedlinenum','format','user:%s','split','name','user:agentconnect','accountcode','connectedlinenum','error','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','disposition','includes','lastapplication','lastdata','match','type','isNil','syncNewState','calleridnum','answered','answertime','diff','xcally-motion-preview','connectedlinename','destinationchannel','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.wav49','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','transferType','resolve','then','isEmpty','stopRecordingOnTransfer','Action','StopMixMonitor','finally','webbar:stopmonitors','BlindTransfer','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','transferconnectedlinenum','origtransfereruniqueid','some','origtransfererlinkedid','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','transfereruniqueid','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','set','queue'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x4d9607,_0x1a3597){_0x4d9607=_0x4d9607-0x0;var _0x455917=_0x7a2c[_0x4d9607];return _0x455917;};'use strict';var _=require(_0xc7a2('0x0'));var moment=require('moment');var util=require(_0xc7a2('0x1'));var path=require(_0xc7a2('0x2'));var Redis=require(_0xc7a2('0x3'));var config=require(_0xc7a2('0x4'));var logger=require(_0xc7a2('0x5'))(_0xc7a2('0x6'));var ami=require(_0xc7a2('0x7'));var Channel=require(_0xc7a2('0x8'));var RpcSetting=require('../rpc/setting');var applications=[_0xc7a2('0x9'),_0xc7a2('0xa'),'agi','dial','playback',_0xc7a2('0xb')];var dispositions=[_0xc7a2('0xc'),_0xc7a2('0xd'),_0xc7a2('0xd'),'NO\x20ANSWER',_0xc7a2('0xc'),_0xc7a2('0xc'),_0xc7a2('0xe'),'BUSY',_0xc7a2('0xd'),'FAILED',_0xc7a2('0xd')];config[_0xc7a2('0xf')]=_[_0xc7a2('0x10')](config['redis'],{'host':_0xc7a2('0x11'),'port':0x18eb});var io=require(_0xc7a2('0x12'))(new Redis(config[_0xc7a2('0xf')]));function VoiceCallReport(_0x5871c3){this[_0xc7a2('0x13')]=_0x5871c3[_0xc7a2('0x13')];this[_0xc7a2('0x14')]=_0x5871c3[_0xc7a2('0x14')];this[_0xc7a2('0x15')]={};ami['on'](_0xc7a2('0x16'),this[_0xc7a2('0x17')][_0xc7a2('0x18')](this));ami['on'](_0xc7a2('0x19'),this[_0xc7a2('0x17')][_0xc7a2('0x18')](this));ami['on'](_0xc7a2('0x1a'),this[_0xc7a2('0x1b')][_0xc7a2('0x18')](this));ami['on'](_0xc7a2('0x1c'),this['syncNewState'][_0xc7a2('0x18')](this));ami['on']('varset',this[_0xc7a2('0x1d')][_0xc7a2('0x18')](this));ami['on'](_0xc7a2('0x1e'),this[_0xc7a2('0x1f')]['bind'](this));ami['on']('newcallerid',this[_0xc7a2('0x20')][_0xc7a2('0x18')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0xc7a2('0x21'),this['syncBlindTransfer'][_0xc7a2('0x18')](this));ami['on'](_0xc7a2('0x22'),this['syncMusicOnHoldStart'][_0xc7a2('0x18')](this));ami['on'](_0xc7a2('0x23'),this[_0xc7a2('0x24')][_0xc7a2('0x18')](this));try{logger[_0xc7a2('0x25')](_0xc7a2('0x26'));ami[_0xc7a2('0x27')]();}catch(_0x4a05e1){logger['error'](_0xc7a2('0x28'),util[_0xc7a2('0x29')](_0x4a05e1,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xc7a2('0x2a')]=function(_0x3cad61){return _0x3cad61!==null&&!_[_0xc7a2('0x2b')](_0x3cad61);};VoiceCallReport[_0xc7a2('0x2c')][_0xc7a2('0x2d')]=function(_0x35584a,_0x1beecd,_0x429b05){io['to'](_0x35584a)['emit'](_0x1beecd,_0x429b05);};VoiceCallReport[_0xc7a2('0x2c')]['syncNewCallerId']=function(_0x206eb7){try{if(this['isNotNull'](_0x206eb7)){logger[_0xc7a2('0x25')](_0xc7a2('0x2e'),_0x206eb7[_0xc7a2('0x2f')],_0x206eb7[_0xc7a2('0x30')],_0x206eb7['calleridnum']);logger['debug'](_0xc7a2('0x31'),_0x206eb7[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x206eb7,{'showHidden':![],'depth':null}));if(_0x206eb7[_0xc7a2('0x2f')]===_0x206eb7[_0xc7a2('0x32')]){if(!_[_0xc7a2('0x2b')](this[_0xc7a2('0x13')][_0x206eb7['uniqueid']])){_[_0xc7a2('0x33')](this[_0xc7a2('0x13')][_0x206eb7['uniqueid']],_[_0xc7a2('0x34')](_0x206eb7,_[_0xc7a2('0x35')](this[_0xc7a2('0x13')][_0x206eb7['uniqueid']])));}}if(_0x206eb7[_0xc7a2('0x36')]==='from-sip'){if(this[_0xc7a2('0x14')][_0x206eb7['channel']['split']('-')[0x0]]){if(_0x206eb7[_0xc7a2('0x37')]=='xcally-motion-preview'){this['agents'][_0x206eb7[_0xc7a2('0x38')]['split']('-')[0x0]][_0xc7a2('0x39')]=_0x206eb7['connectedlinenum'];this[_0xc7a2('0x2d')](util[_0xc7a2('0x3a')](_0xc7a2('0x3b'),this[_0xc7a2('0x14')][_0x206eb7[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]][_0xc7a2('0x3d')]),_0xc7a2('0x3e'),{'destaccountcode':this[_0xc7a2('0x14')][_0x206eb7[_0xc7a2('0x38')]['split']('-')[0x0]][_0xc7a2('0x3f')],'destconnectedlinenum':_0x206eb7[_0xc7a2('0x40')]});}}}}}catch(_0x49768d){logger[_0xc7a2('0x41')](_0xc7a2('0x42'),_0x206eb7[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x49768d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc7a2('0x2c')][_0xc7a2('0x1b')]=function(_0x3a7845){try{if(this['isNotNull'](_0x3a7845)){logger[_0xc7a2('0x43')](_0xc7a2('0x44'),_0x3a7845[_0xc7a2('0x2f')],util['inspect'](_0x3a7845,{'showHidden':![],'depth':null}));if(this[_0xc7a2('0x13')][_0x3a7845[_0xc7a2('0x2f')]])return;if(_0x3a7845['channel']===_0xc7a2('0x45'))return;if(_0x3a7845[_0xc7a2('0x2f')]!==_0x3a7845[_0xc7a2('0x32')]&&!this[_0xc7a2('0x15')][_0x3a7845[_0xc7a2('0x32')]])return;logger[_0xc7a2('0x25')](_0xc7a2('0x46'),_0x3a7845[_0xc7a2('0x2f')],_0x3a7845['context'],_0x3a7845[_0xc7a2('0x37')]);this['channels'][_0x3a7845[_0xc7a2('0x2f')]]=new Channel();this[_0xc7a2('0x13')][_0x3a7845[_0xc7a2('0x2f')]][_0xc7a2('0x47')]=moment()[_0xc7a2('0x3a')](_0xc7a2('0x48'));this[_0xc7a2('0x13')][_0x3a7845[_0xc7a2('0x2f')]]['disposition']=dispositions[_[_0xc7a2('0x49')](_0x3a7845[_0xc7a2('0x4a')])];_[_0xc7a2('0x33')](this[_0xc7a2('0x13')][_0x3a7845[_0xc7a2('0x2f')]],_[_0xc7a2('0x34')](_0x3a7845,_['keys'](this['channels'][_0x3a7845['uniqueid']])));if(_0x3a7845[_0xc7a2('0x36')]===_0xc7a2('0x4b')){if(this[_0xc7a2('0x14')][_0x3a7845[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]){if(_[_0xc7a2('0x2b')](this[_0xc7a2('0x14')][_0x3a7845[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]['destconnectedlinenum'])){this['agents'][_0x3a7845['channel'][_0xc7a2('0x3c')]('-')[0x0]][_0xc7a2('0x39')]=_0x3a7845['exten'];logger[_0xc7a2('0x43')](_0xc7a2('0x4c'),_0x3a7845[_0xc7a2('0x2f')],util['inspect']({'id':this[_0xc7a2('0x14')][_0x3a7845['channel'][_0xc7a2('0x3c')]('-')[0x0]]['id'],'destaccountcode':this[_0xc7a2('0x14')][_0x3a7845['channel']['split']('-')[0x0]][_0xc7a2('0x3f')],'destconnectedlinenum':_0x3a7845[_0xc7a2('0x37')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xc7a2('0x3a')](_0xc7a2('0x3b'),this[_0xc7a2('0x14')][_0x3a7845[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]][_0xc7a2('0x3d')]),'user:agentconnect',{'id':this[_0xc7a2('0x14')][_0x3a7845[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]['id'],'destaccountcode':this[_0xc7a2('0x14')][_0x3a7845['channel'][_0xc7a2('0x3c')]('-')[0x0]][_0xc7a2('0x3f')],'destconnectedlinenum':_0x3a7845[_0xc7a2('0x37')]});}}}}}catch(_0x12dd4e){logger[_0xc7a2('0x41')](_0xc7a2('0x4d'),_0x3a7845[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x12dd4e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc7a2('0x17')]=function(_0x45141b){try{if(this[_0xc7a2('0x2a')](_0x45141b)){logger[_0xc7a2('0x43')]('[%s][voiceCallReport][newexten]\x20event:',_0x45141b[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x45141b,{'showHidden':![],'depth':null}));if(_0x45141b['channel']===_0xc7a2('0x45')||_0x45141b[_0xc7a2('0x37')]==='h')return;if(_0x45141b[_0xc7a2('0x2f')]===_0x45141b[_0xc7a2('0x32')]||this[_0xc7a2('0x15')][_0x45141b['linkedid']]){_0x45141b[_0xc7a2('0x4e')]=_0x45141b[_0xc7a2('0x4e')][_0xc7a2('0x4f')]();_0x45141b['applicationdata']=_0x45141b['appdata']||_0x45141b[_0xc7a2('0x50')];if(_0x45141b['appdata']&&!_0x45141b['appdata'][_0xc7a2('0x51')](_0xc7a2('0x52'))&&_0x45141b['application']!=='queue'){_0x45141b[_0xc7a2('0x50')]=_0x45141b[_0xc7a2('0x50')][_0xc7a2('0x4f')]();}logger[_0xc7a2('0x25')](_0xc7a2('0x53'),_0x45141b['uniqueid'],_0x45141b[_0xc7a2('0x4e')],_0x45141b[_0xc7a2('0x50')]);if(_['isUndefined'](this[_0xc7a2('0x13')][_0x45141b[_0xc7a2('0x2f')]])){this[_0xc7a2('0x13')][_0x45141b[_0xc7a2('0x2f')]]=new Channel();this[_0xc7a2('0x13')][_0x45141b['uniqueid']][_0xc7a2('0x47')]=_0x45141b[_0xc7a2('0x54')]?moment()[_0xc7a2('0x55')](moment['duration'](_0x45141b[_0xc7a2('0x54')])[_0xc7a2('0x56')](),_0xc7a2('0x56'))[_0xc7a2('0x3a')](_0xc7a2('0x48')):moment()[_0xc7a2('0x3a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc7a2('0x13')][_0x45141b[_0xc7a2('0x2f')]][_0xc7a2('0x57')]=_0xc7a2('0xc');}_[_0xc7a2('0x33')](this[_0xc7a2('0x13')][_0x45141b[_0xc7a2('0x2f')]],_['pick'](_0x45141b,_[_0xc7a2('0x35')](this['channels'][_0x45141b['uniqueid']])));if(_[_0xc7a2('0x58')](applications,_0x45141b[_0xc7a2('0x4e')])){this[_0xc7a2('0x13')][_0x45141b['uniqueid']][_0xc7a2('0x59')]=_0x45141b['application'];this['channels'][_0x45141b[_0xc7a2('0x2f')]][_0xc7a2('0x5a')]=_0x45141b[_0xc7a2('0x50')];if(_0x45141b[_0xc7a2('0x4e')]===_0xc7a2('0x9')&&_[_0xc7a2('0x51')](_0x45141b['applicationdata']['toLowerCase'](),'cdr(')){var _0x429ab3=_0x45141b['applicationdata']['split']('=');var _0x556a94=_0x429ab3[0x0]['toLowerCase']()[_0xc7a2('0x5b')](/cdr\((.*)\)/);if(_0x556a94){if(_0x556a94[0x1]===_0xc7a2('0x5c')&&!_[_0xc7a2('0x5d')](this[_0xc7a2('0x13')][_0x45141b['uniqueid']][_0x556a94[0x1]]))return;this[_0xc7a2('0x13')][_0x45141b[_0xc7a2('0x2f')]][_0x556a94[0x1]]=_0x429ab3[0x1];}}else if(_0x45141b[_0xc7a2('0x4e')]===_0xc7a2('0xa')){this[_0xc7a2('0x13')][_0x45141b[_0xc7a2('0x2f')]][_0xc7a2('0xa')]=_0x45141b[_0xc7a2('0x50')][_0xc7a2('0x3c')](',')[0x0];}}}}}catch(_0x41f9c3){logger[_0xc7a2('0x41')]('[%s][voiceCallReport][newexten]',_0x45141b['uniqueid'],util[_0xc7a2('0x29')](_0x41f9c3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc7a2('0x5e')]=function(_0xe09b54){try{if(this[_0xc7a2('0x2a')](_0xe09b54)){logger[_0xc7a2('0x25')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0xe09b54[_0xc7a2('0x2f')],_0xe09b54[_0xc7a2('0x32')],_0xe09b54[_0xc7a2('0x30')],_0xe09b54[_0xc7a2('0x5f')]);logger[_0xc7a2('0x43')]('[%s][voiceCallReport][newstate]\x20event:',_0xe09b54[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0xe09b54,{'showHidden':![],'depth':null}));if(_0xe09b54[_0xc7a2('0x4a')]!=='6')return;if(_0xe09b54[_0xc7a2('0x2f')]!==_0xe09b54[_0xc7a2('0x32')]){var _0x487482=moment();if(this[_0xc7a2('0x13')][_0xe09b54['linkedid']]){if(!this['channels'][_0xe09b54[_0xc7a2('0x32')]][_0xc7a2('0x60')]){this[_0xc7a2('0x13')][_0xe09b54['linkedid']][_0xc7a2('0x60')]=!![];this[_0xc7a2('0x13')][_0xe09b54['linkedid']][_0xc7a2('0x61')]=_0x487482[_0xc7a2('0x3a')](_0xc7a2('0x48'));if(this['channels'][_0xe09b54['linkedid']]['starttime']){this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x32')]]['holdtime']=_0x487482[_0xc7a2('0x62')](this[_0xc7a2('0x13')][_0xe09b54['linkedid']][_0xc7a2('0x47')],'seconds');}}this[_0xc7a2('0x13')][_0xe09b54['linkedid']][_0xc7a2('0x32')]=_0xe09b54[_0xc7a2('0x2f')];if(_0xe09b54['calleridnum']!==_0xc7a2('0x63')){this['channels'][_0xe09b54[_0xc7a2('0x32')]][_0xc7a2('0x40')]=_0xe09b54[_0xc7a2('0x5f')];}this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x32')]][_0xc7a2('0x64')]=_0xe09b54['calleridname'];this['channels'][_0xe09b54['linkedid']][_0xc7a2('0x65')]=_0xe09b54[_0xc7a2('0x38')];this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x32')]][_0xc7a2('0x57')]=dispositions[_['toNumber'](_0xe09b54['channelstate'])];if(this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]){this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x32')]][_0xc7a2('0x66')]=this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]['id'];this[_0xc7a2('0x13')][_0xe09b54['linkedid']]['membername']=this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')]['split']('-')[0x0]][_0xc7a2('0x3d')];}}if(this['channels'][_0xe09b54[_0xc7a2('0x2f')]]){if(!this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0x60')]){this['channels'][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0x60')]=!![];this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]]['answertime']=_0x487482[_0xc7a2('0x3a')](_0xc7a2('0x48'));if(this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]]['starttime']){this[_0xc7a2('0x13')][_0xe09b54['uniqueid']]['holdtime']=_0x487482['diff'](this[_0xc7a2('0x13')][_0xe09b54['uniqueid']][_0xc7a2('0x47')],'seconds');}}if(_0xe09b54[_0xc7a2('0x5f')]!==_0xc7a2('0x63')){this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0x40')]=_0xe09b54[_0xc7a2('0x5f')];}this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0x64')]=_0xe09b54['calleridname'];this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0x65')]=_0xe09b54[_0xc7a2('0x38')];this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0x57')]=dispositions[_[_0xc7a2('0x49')](_0xe09b54[_0xc7a2('0x4a')])];}}else{if(this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]]){if(this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]){this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0x66')]=this[_0xc7a2('0x14')][_0xe09b54['channel']['split']('-')[0x0]]['id'];this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]]['membername']=this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')]['split']('-')[0x0]]['name'];}}}if(_0xe09b54[_0xc7a2('0x36')]===_0xc7a2('0x4b')){if(this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]){this[_0xc7a2('0x14')][_0xe09b54['channel'][_0xc7a2('0x3c')]('-')[0x0]]['destconnectedlinenum']=_0xe09b54[_0xc7a2('0x37')];var _0x4ad1cb,_0x748d37;if(this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]]){_0x4ad1cb=this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0x67')];_0x748d37=this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x2f')]][_0xc7a2('0xa')];}else if(this['channels'][_0xe09b54['linkedid']]){_0x4ad1cb=this['channels'][_0xe09b54[_0xc7a2('0x32')]][_0xc7a2('0x67')];_0x748d37=this[_0xc7a2('0x13')][_0xe09b54[_0xc7a2('0x32')]][_0xc7a2('0xa')];}logger[_0xc7a2('0x43')](_0xc7a2('0x68'),_0xe09b54[_0xc7a2('0x2f')],util[_0xc7a2('0x29')]({'id':this[_0xc7a2('0x14')][_0xe09b54['channel'][_0xc7a2('0x3c')]('-')[0x0]]['id'],'destaccountcode':this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')]['split']('-')[0x0]][_0xc7a2('0x3f')],'destconnectedlinenum':_0xe09b54[_0xc7a2('0x37')],'routealias':_0x4ad1cb,'queue':_0x748d37||undefined},{'showHidden':![],'depth':null}));this[_0xc7a2('0x2d')](util['format'](_0xc7a2('0x3b'),this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]['name']),'user:agentconnect',{'id':this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xc7a2('0x14')][_0xe09b54[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]][_0xc7a2('0x3f')],'destconnectedlinenum':_0xe09b54[_0xc7a2('0x37')],'routealias':_0x4ad1cb,'queue':_0x748d37||undefined});}}}}catch(_0x1fd622){logger['error'](_0xc7a2('0x69'),_0xe09b54[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x1fd622,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc7a2('0x2c')]['syncMixMonitorFilename']=function(_0x3df79f,_0x3020e0){try{if(this[_0xc7a2('0x13')][_0x3df79f]){logger['info'](_0xc7a2('0x6a'),_0x3df79f,_0x3020e0);this[_0xc7a2('0x13')][_0x3df79f][_0xc7a2('0x6b')]=!![];if(_[_0xc7a2('0x6c')](_0x3020e0,'.wav49')){_0x3020e0=_0x3020e0[_0xc7a2('0x6d')](_0xc7a2('0x6e'),'.WAV');}this[_0xc7a2('0x13')][_0x3df79f][_0xc7a2('0x6f')]=_0x3020e0;var _0x2c9c68=_[_0xc7a2('0x70')](this[_0xc7a2('0x13')][_0x3df79f][_0xc7a2('0x71')],{'filename':_0x3020e0});if(_[_0xc7a2('0x5d')](_0x2c9c68)){this[_0xc7a2('0x13')][_0x3df79f][_0xc7a2('0x71')][_0xc7a2('0x72')]({'filename':_0x3020e0,'createdAt':moment()['format'](_0xc7a2('0x48')),'mixmonitorid':'','status':_0xc7a2('0x73')});}}}catch(_0x4d9267){logger[_0xc7a2('0x41')](_0xc7a2('0x74'),_0x3df79f,util[_0xc7a2('0x29')](_0x4d9267,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc7a2('0x2c')][_0xc7a2('0x1d')]=function(_0x2059fa){try{if(this[_0xc7a2('0x2a')](_0x2059fa)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x2059fa['uniqueid'],util[_0xc7a2('0x29')](_0x2059fa,{'showHidden':![],'depth':null}));if(this[_0xc7a2('0x13')][_0x2059fa[_0xc7a2('0x2f')]]&&_0x2059fa[_0xc7a2('0x38')]!='OutgoingSpoolFailed'){if(this[_0xc7a2('0x2a')](_0x2059fa[_0xc7a2('0x75')])){if(this[_0xc7a2('0x2a')](_0x2059fa[_0xc7a2('0x75')]['mixmonitor_filename'])){logger[_0xc7a2('0x25')](_0xc7a2('0x76'),_0x2059fa['uniqueid'],_0x2059fa[_0xc7a2('0x77')]);this[_0xc7a2('0x78')](_0x2059fa[_0xc7a2('0x2f')],_0x2059fa[_0xc7a2('0x77')]);}else if(this['isNotNull'](_0x2059fa[_0xc7a2('0x75')]['xmd-phone'])){logger[_0xc7a2('0x25')](_0xc7a2('0x79'),_0x2059fa[_0xc7a2('0x2f')],_0x2059fa['value']);this['channels'][_0x2059fa['uniqueid']][_0xc7a2('0x5f')]=_0x2059fa[_0xc7a2('0x77')];}else if(this['isNotNull'](_0x2059fa[_0xc7a2('0x75')]['xmd-callerid'])){logger[_0xc7a2('0x25')](_0xc7a2('0x7a'),_0x2059fa['uniqueid'],_0x2059fa[_0xc7a2('0x77')]);this['channels'][_0x2059fa['uniqueid']][_0xc7a2('0x7b')]=_0x2059fa[_0xc7a2('0x77')];}else if(this[_0xc7a2('0x2a')](_0x2059fa[_0xc7a2('0x75')][_0xc7a2('0x7c')])){logger['info'](_0xc7a2('0x7d'),_0x2059fa[_0xc7a2('0x2f')],_0x2059fa[_0xc7a2('0x77')]);this[_0xc7a2('0x13')][_0x2059fa['uniqueid']][_0xc7a2('0x5c')]=_0x2059fa[_0xc7a2('0x77')];}else if(this[_0xc7a2('0x2a')](_0x2059fa[_0xc7a2('0x75')][_0xc7a2('0x7e')])){logger[_0xc7a2('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x2059fa[_0xc7a2('0x2f')],_0x2059fa[_0xc7a2('0x77')]['split'](',')[0x0]);this[_0xc7a2('0x13')][_0x2059fa[_0xc7a2('0x2f')]][_0xc7a2('0xa')]=_0x2059fa[_0xc7a2('0x77')][_0xc7a2('0x3c')](',')[0x0];}else if(this['isNotNull'](_0x2059fa[_0xc7a2('0x75')][_0xc7a2('0x7f')])){logger[_0xc7a2('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2059fa[_0xc7a2('0x2f')],_0x2059fa['value']);this['channels'][_0x2059fa[_0xc7a2('0x2f')]][_0xc7a2('0x80')]=_0x2059fa[_0xc7a2('0x77')];}else if(this[_0xc7a2('0x2a')](_0x2059fa[_0xc7a2('0x75')]['xmd-destination'])){logger[_0xc7a2('0x25')](_0xc7a2('0x81'),_0x2059fa[_0xc7a2('0x2f')],_0x2059fa[_0xc7a2('0x77')]);this[_0xc7a2('0x13')][_0x2059fa[_0xc7a2('0x2f')]][_0xc7a2('0x82')]=_0x2059fa[_0xc7a2('0x77')];}else if(this['isNotNull'](_0x2059fa[_0xc7a2('0x75')][_0xc7a2('0x83')])){logger['info'](_0xc7a2('0x84'),_0x2059fa[_0xc7a2('0x2f')],_0x2059fa['value']);this[_0xc7a2('0x13')][_0x2059fa[_0xc7a2('0x2f')]][_0xc7a2('0x85')]=_0x2059fa[_0xc7a2('0x77')];}else if(this['isNotNull'](_0x2059fa[_0xc7a2('0x75')][_0xc7a2('0x86')])){logger[_0xc7a2('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x2059fa['uniqueid'],_0x2059fa['value']);this['channels'][_0x2059fa[_0xc7a2('0x2f')]][_0xc7a2('0xa')]=_0x2059fa[_0xc7a2('0x77')];}else if(this[_0xc7a2('0x2a')](_0x2059fa[_0xc7a2('0x75')][_0xc7a2('0x87')])){logger[_0xc7a2('0x25')](_0xc7a2('0x88'),_0x2059fa['uniqueid'],_0x2059fa[_0xc7a2('0x77')]);this['channels'][_0x2059fa[_0xc7a2('0x2f')]][_0xc7a2('0x89')]=_0x2059fa[_0xc7a2('0x77')];}}}else if(this[_0xc7a2('0x2a')](_0x2059fa['variable'][_0xc7a2('0x8a')])){if(_0x2059fa[_0xc7a2('0x77')]){var _0x474476=path[_0xc7a2('0x8b')](_0x2059fa[_0xc7a2('0x77')])[_0xc7a2('0x3d')];logger[_0xc7a2('0x25')](_0xc7a2('0x76'),_0x474476,_0x2059fa[_0xc7a2('0x77')]);this[_0xc7a2('0x78')](_0x474476,_0x2059fa[_0xc7a2('0x77')]);}}else if(this[_0xc7a2('0x13')][_0x2059fa['linkedid']]){if(this[_0xc7a2('0x2a')](_0x2059fa[_0xc7a2('0x75')])){if(this[_0xc7a2('0x2a')](_0x2059fa[_0xc7a2('0x75')][_0xc7a2('0x87')])){logger[_0xc7a2('0x25')](_0xc7a2('0x88'),_0x2059fa['linkedid'],_0x2059fa['value']);this['channels'][_0x2059fa[_0xc7a2('0x32')]][_0xc7a2('0x8c')]=_0x2059fa[_0xc7a2('0x77')];}}}}}catch(_0x106c2b){logger[_0xc7a2('0x41')]('[%s][voiceCallReport][varset]',_0x2059fa['uniqueid'],util[_0xc7a2('0x29')](_0x106c2b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc7a2('0x2c')][_0xc7a2('0x1f')]=function(_0x113470){try{if(this[_0xc7a2('0x2a')](_0x113470)){logger['debug'](_0xc7a2('0x8d'),_0x113470['uniqueid'],util[_0xc7a2('0x29')](_0x113470,{'showHidden':![],'depth':null}));if(this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]]){if(this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x32')]]){this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x32')]][_0xc7a2('0x2f')]=_0x113470[_0xc7a2('0x2f')];this[_0xc7a2('0x13')][this['blindTransfers'][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x32')]][_0xc7a2('0x60')]=this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x60')];this['channels'][this['blindTransfers'][_0x113470[_0xc7a2('0x32')]]['linkedid']]['answertime']=this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x61')];this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x32')]]['destinationchannel']=this[_0xc7a2('0x13')][this['blindTransfers'][_0x113470['linkedid']][_0xc7a2('0x32')]][_0xc7a2('0x38')];this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]]['linkedid']]['disposition']=this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x57')];this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]]=this['channels'][this[_0xc7a2('0x15')][_0x113470['linkedid']]['linkedid']];delete this['channels'][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x32')]];}else if(this['channels'][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]]['uniqueid']]){this['channels'][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x2f')]][_0xc7a2('0x2f')]=[this[_0xc7a2('0x13')][this['blindTransfers'][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x2f')]][_0xc7a2('0x32')],this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470['linkedid']][_0xc7a2('0x2f')]]['linkedid']=this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x2f')]][_0xc7a2('0x2f')]][0x0];this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x2f')]]['answered']=this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]]['answered'];this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x2f')]][_0xc7a2('0x61')]=this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x61')];this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x2f')]]['destinationchannel']=this['channels'][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x2f')]][_0xc7a2('0x38')];this[_0xc7a2('0x13')][this[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x32')]]['uniqueid']][_0xc7a2('0x57')]=this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x57')];this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]]=this['channels'][this['blindTransfers'][_0x113470[_0xc7a2('0x32')]][_0xc7a2('0x2f')]];delete this[_0xc7a2('0x13')][this['blindTransfers'][_0x113470['linkedid']]['uniqueid']];}}if(this['channels'][_0x113470[_0xc7a2('0x2f')]]){logger[_0xc7a2('0x25')](_0xc7a2('0x8e'),_0x113470[_0xc7a2('0x2f')],_0x113470[_0xc7a2('0x8f')]);var _0x269bc0=moment();this[_0xc7a2('0x13')][_0x113470['uniqueid']][_0xc7a2('0x90')]=_0x269bc0[_0xc7a2('0x3a')](_0xc7a2('0x48'));this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x54')]=_0x269bc0[_0xc7a2('0x62')](this[_0xc7a2('0x13')][_0x113470['uniqueid']][_0xc7a2('0x47')],'seconds');if(this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x60')]){this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x91')]=_0x269bc0['diff'](this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x61')],_0xc7a2('0x56'));this['channels'][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x92')]=this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x54')]-this[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x91')];}if(_0x113470['context']==='from-sip'){if(this[_0xc7a2('0x14')][_0x113470['channel']['split']('-')[0x0]]){this['agents'][_0x113470[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]=_[_0xc7a2('0x93')](this[_0xc7a2('0x14')][_0x113470[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]],[_0xc7a2('0x39')]);logger['debug'](_0xc7a2('0x94'),_0x113470['uniqueid'],util['inspect']({'id':this['agents'][_0x113470['channel'][_0xc7a2('0x3c')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x113470[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]][_0xc7a2('0x3f')]},{'showHidden':![],'depth':null}));this[_0xc7a2('0x2d')](util[_0xc7a2('0x3a')]('user:%s',this[_0xc7a2('0x14')][_0x113470[_0xc7a2('0x38')][_0xc7a2('0x3c')]('-')[0x0]]['name']),'user:agentcomplete',{'id':this[_0xc7a2('0x14')][_0x113470['channel'][_0xc7a2('0x3c')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x113470['channel']['split']('-')[0x0]][_0xc7a2('0x3f')]});for(var _0x2e8f91=0x0;_0x2e8f91<Object['keys'](this[_0xc7a2('0x14')])['length'];_0x2e8f91++){var _0x198579=Object[_0xc7a2('0x35')](this[_0xc7a2('0x14')])[_0x2e8f91];var _0x523c86=this[_0xc7a2('0x14')][_0x198579];if(_0x523c86['accountcode']===Number(_0x113470[_0xc7a2('0x40')])){this[_0xc7a2('0x2d')](util[_0xc7a2('0x3a')](_0xc7a2('0x3b'),_0x523c86[_0xc7a2('0x3d')]),_0xc7a2('0x95'),{'id':_0x523c86['id'],'destaccountcode':_0x523c86[_0xc7a2('0x3f')],'transfer':this[_0xc7a2('0x13')][_0x113470['uniqueid']][_0xc7a2('0x96')]});break;}}}}var _0x59ca85=this;Promise[_0xc7a2('0x97')]()[_0xc7a2('0x98')](function(){var _0x1829a2=_0x59ca85[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]];if(typeof _0x1829a2[_0xc7a2('0x96')]==='undefined')return;if(_[_0xc7a2('0x99')](_0x1829a2['monitors']))return;return RpcSetting['getSettings']()['then'](function(_0x3bacf2){if(!_0x3bacf2[_0xc7a2('0x9a')])return;return Promise['resolve']()['then'](function(){return ami[_0xc7a2('0x9b')]({'action':_0xc7a2('0x9c'),'channel':_0x1829a2[_0xc7a2('0x38')]})['catch'](function(){});})['then'](function(){return ami['Action']({'action':_0xc7a2('0x9c'),'channel':_0x1829a2[_0xc7a2('0x65')]})['catch'](function(){})[_0xc7a2('0x9d')](function(){var _0x4bd757=_0x59ca85[_0xc7a2('0x14')][_0x1829a2[_0xc7a2('0x65')][_0xc7a2('0x3c')]('-')[0x0]];if(!_0x4bd757)return;io[_0xc7a2('0x2d')](_0xc7a2('0x9e'),{'agentId':_0x4bd757['id'],'uniqueid':_0x1829a2['uniqueid']});});});});})['then'](function(){if(_0x113470['event']===_0xc7a2('0x9f')){_0x59ca85[_0xc7a2('0x15')][_0x113470[_0xc7a2('0x2f')]]=_0x113470;}else{if(_0x59ca85['channels'][_0x113470['uniqueid']][_0xc7a2('0x5c')]===_0xc7a2('0xa0')&&_0x59ca85[_0xc7a2('0x15')][_0x113470['uniqueid']]){_0x59ca85['channels'][_0x113470[_0xc7a2('0x2f')]]['uniqueid']=[_0x59ca85[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x32')],_0x59ca85[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x32')]=_0x59ca85[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]][_0xc7a2('0x2f')]][0x0];delete _0x59ca85['blindTransfers'][_0x113470[_0xc7a2('0x2f')]];}}logger[_0xc7a2('0x43')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x113470['uniqueid'],util['inspect'](_0x59ca85[_0xc7a2('0x13')][_0x113470['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xc7a2('0xa1'),_0x59ca85[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]]);delete _0x59ca85[_0xc7a2('0x13')][_0x113470[_0xc7a2('0x2f')]];});}}}catch(_0x391002){logger[_0xc7a2('0x41')](_0xc7a2('0xa2'),_0x113470[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x391002,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc7a2('0x2c')][_0xc7a2('0xa3')]=function(_0x58f2d4){try{if(this[_0xc7a2('0x2a')](_0x58f2d4)){logger[_0xc7a2('0x25')](_0xc7a2('0xa4'),_0x58f2d4[_0xc7a2('0x2f')],_0x58f2d4[_0xc7a2('0xa5')],_0x58f2d4[_0xc7a2('0xa6')]);logger['debug'](_0xc7a2('0xa7'),_0x58f2d4['uniqueid'],util['inspect'](_0x58f2d4,{'showHidden':![],'depth':null}));var _0x5d1fa4;if(this[_0xc7a2('0x13')][_0x58f2d4['transfereeuniqueid']]){this['channels'][_0x58f2d4[_0xc7a2('0xa8')]]['transfercalleridnum']=_0x58f2d4[_0xc7a2('0xa5')];this['channels'][_0x58f2d4[_0xc7a2('0xa8')]]['transferconnectedlinenum']=_0x58f2d4[_0xc7a2('0xa6')];if(this['channels'][_0x58f2d4['secondtransfereruniqueid']]){_0x5d1fa4=this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xa9')]];this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xa9')]]=this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xa8')]];this['channels'][_0x58f2d4[_0xc7a2('0xa8')]]=_0x5d1fa4;}this['channels'][_0x58f2d4['secondtransfereruniqueid']][_0xc7a2('0x96')]=_0xc7a2('0xaa');}else if(this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xab')]]){this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xab')]][_0xc7a2('0xac')]=_0x58f2d4[_0xc7a2('0xa5')];this['channels'][_0x58f2d4[_0xc7a2('0xab')]][_0xc7a2('0xad')]=_0x58f2d4[_0xc7a2('0xa6')];if(this[_0xc7a2('0x13')][_0x58f2d4['origtransfereruniqueid']]){_0x5d1fa4=this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xae')]];this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xae')]]=this['channels'][_0x58f2d4[_0xc7a2('0xab')]];this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xab')]]=_0x5d1fa4;}this[_0xc7a2('0x13')][_0x58f2d4['transfertargetuniqueid']][_0xc7a2('0x96')]='ATTENDED';}if((this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xae')]]||this['channels'][_0x58f2d4['origtransfererlinkedid']])&&this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xa9')]]){var _0x40ae6e=_[_0xc7a2('0xaf')]([this[_0xc7a2('0x13')][_0x58f2d4['origtransfereruniqueid']],this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xb0')]],this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xa9')]]],function(_0x1fa3a2){return _0x1fa3a2&&_0x1fa3a2[_0xc7a2('0x5c')]===_0xc7a2('0xa0')&&_0x1fa3a2['routeid'];});if(_0x40ae6e){if(this[_0xc7a2('0x13')][_0x58f2d4['origtransfereruniqueid']])this['channels'][_0x58f2d4['origtransfereruniqueid']][_0xc7a2('0x96')]='ATTENDED';if(this[_0xc7a2('0x13')][_0x58f2d4['origtransfererlinkedid']])this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xb0')]][_0xc7a2('0x96')]=_0xc7a2('0xaa');this[_0xc7a2('0x13')][_0x58f2d4[_0xc7a2('0xa9')]][_0xc7a2('0x96')]=_0xc7a2('0xaa');}}}}catch(_0x15576d){logger[_0xc7a2('0x41')](_0xc7a2('0xb1'),_0x58f2d4['uniqueid'],util['inspect'](_0x15576d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc7a2('0x2c')][_0xc7a2('0xb2')]=function(_0x9f12cd){try{if(this[_0xc7a2('0x2a')](_0x9f12cd)){logger[_0xc7a2('0x25')](_0xc7a2('0xb3'),_0x9f12cd[_0xc7a2('0x2f')],_0x9f12cd[_0xc7a2('0xb4')],_0x9f12cd[_0xc7a2('0xb5')]);logger['debug']('[%s][voiceCallReport][blindtransfer]\x20event:',_0x9f12cd[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x9f12cd,{'showHidden':![],'depth':null}));if(this[_0xc7a2('0x13')][_0x9f12cd[_0xc7a2('0xa8')]]){this[_0xc7a2('0x13')][_0x9f12cd[_0xc7a2('0xa8')]][_0xc7a2('0xac')]=_0x9f12cd['transfereecalleridnum'];this[_0xc7a2('0x13')][_0x9f12cd[_0xc7a2('0xa8')]][_0xc7a2('0xad')]=_0x9f12cd[_0xc7a2('0xb5')];this[_0xc7a2('0x13')][_0x9f12cd[_0xc7a2('0xa8')]][_0xc7a2('0x96')]='BLIND';this['syncHangup']({'event':_0xc7a2('0x9f'),'uniqueid':_0x9f12cd[_0xc7a2('0xa8')],'linkedid':_0x9f12cd[_0xc7a2('0xb6')],'context':_0x9f12cd[_0xc7a2('0x36')],'channel':_0x9f12cd[_0xc7a2('0xb7')]});}else{this[_0xc7a2('0x13')][_0x9f12cd['transfereruniqueid']]['transferType']=_0xc7a2('0xb8');this[_0xc7a2('0x1f')]({'event':_0xc7a2('0x9f'),'uniqueid':_0x9f12cd[_0xc7a2('0xb6')],'linkedid':_0x9f12cd[_0xc7a2('0xa8')],'context':_0x9f12cd[_0xc7a2('0x36')],'channel':_0x9f12cd['transfererchannel']});}}}catch(_0x34e5e0){logger[_0xc7a2('0x41')](_0xc7a2('0xb9'),_0x9f12cd[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x34e5e0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc7a2('0x2c')][_0xc7a2('0xba')]=function(_0x3d5afa){try{if(this[_0xc7a2('0x2a')](_0x3d5afa)){logger[_0xc7a2('0x43')](_0xc7a2('0xbb'),_0x3d5afa[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x3d5afa,{'showHidden':![],'depth':null}));if(this[_0xc7a2('0x13')][_0x3d5afa['uniqueid']]){if(!_[_0xc7a2('0x5d')](this[_0xc7a2('0x13')][_0x3d5afa[_0xc7a2('0x2f')]]['answertime'])){this['channels'][_0x3d5afa[_0xc7a2('0x2f')]]['mohstarttime']=moment()[_0xc7a2('0x3a')](_0xc7a2('0x48'));logger[_0xc7a2('0x25')](_0xc7a2('0xbc'),_0x3d5afa['uniqueid'],this[_0xc7a2('0x13')][_0x3d5afa[_0xc7a2('0x2f')]][_0xc7a2('0xbd')]);}}}}catch(_0x422269){logger['error'](_0xc7a2('0xbe'),_0x3d5afa['uniqueid'],util['inspect'](_0x422269,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc7a2('0x2c')][_0xc7a2('0x24')]=function(_0x37b335){try{if(this[_0xc7a2('0x2a')](_0x37b335)){logger[_0xc7a2('0x43')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x37b335[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x37b335,{'showHidden':![],'depth':null}));if(this['channels'][_0x37b335[_0xc7a2('0x2f')]]){if(!_[_0xc7a2('0x5d')](this['channels'][_0x37b335[_0xc7a2('0x2f')]]['mohstarttime'])){this[_0xc7a2('0x13')][_0x37b335['uniqueid']]['mohtime']+=moment()[_0xc7a2('0xbf')](0x0)['diff'](this['channels'][_0x37b335[_0xc7a2('0x2f')]][_0xc7a2('0xbd')],_0xc7a2('0x56'));logger['info'](_0xc7a2('0xc0'),_0x37b335[_0xc7a2('0x2f')],this['channels'][_0x37b335['uniqueid']][_0xc7a2('0xc1')]);delete this[_0xc7a2('0x13')][_0x37b335[_0xc7a2('0x2f')]][_0xc7a2('0xbd')];}}}}catch(_0x3c1388){logger[_0xc7a2('0x41')](_0xc7a2('0xc2'),_0x37b335[_0xc7a2('0x2f')],util[_0xc7a2('0x29')](_0x3c1388,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 85b5519..ea195f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','duration','endtime','starttime','complete','total','answered','holdtime','seconds','billableseconds','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','appdata','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','event','privilege','info','channels','membername','interface','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','outboundrouteid','voice','value','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged'];(function(_0x2ed4d0,_0x15a4b5){var _0x1dfde6=function(_0x45b79c){while(--_0x45b79c){_0x2ed4d0['push'](_0x2ed4d0['shift']());}};_0x1dfde6(++_0x15a4b5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0x5fc3[_0x3e2489];return _0x2254ce;};'use strict';var _=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var ami=require(_0x35fc('0x6'));config['redis']=_[_0x35fc('0x7')](config[_0x35fc('0x8')],{'host':_0x35fc('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x19a0d1){this['channels']=_0x19a0d1[_0x35fc('0xa')];this[_0x35fc('0xb')]=_0x19a0d1[_0x35fc('0xb')];this[_0x35fc('0xc')]={};this[_0x35fc('0xd')]={};ami['on'](_0x35fc('0xe'),this[_0x35fc('0xf')]['bind'](this));ami['on'](_0x35fc('0x10'),this[_0x35fc('0x11')]['bind'](this));ami['on'](_0x35fc('0x12'),this[_0x35fc('0x13')]['bind'](this));ami['on'](_0x35fc('0x14'),this[_0x35fc('0x15')]['bind'](this));}VoiceDialReport['prototype'][_0x35fc('0x16')]=function(_0x5d462a){return _0x5d462a!==null&&!_[_0x35fc('0x17')](_0x5d462a);};VoiceDialReport[_0x35fc('0x18')][_0x35fc('0x19')]=function(_0x29730f,_0x38d9f2,_0x5cfe94){io['to'](_0x29730f)['emit'](_0x38d9f2,_0x5cfe94);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x398b67){try{if(this[_0x35fc('0x16')](_0x398b67)){logger[_0x35fc('0x1a')](_0x35fc('0x1b'),_0x398b67[_0x35fc('0x1c')],util[_0x35fc('0x1d')](_0x398b67,{'showHidden':![],'depth':null}));if(this['channels'][_0x398b67[_0x35fc('0x1c')]]){_[_0x35fc('0x1e')](this['channels'][_0x398b67[_0x35fc('0x1c')]],{'starttime':moment()[_0x35fc('0x1f')](_0x35fc('0x20')),'lastevent':'called','interface':_0x398b67[_0x35fc('0x21')][_0x35fc('0x22')](0x0,_0x398b67[_0x35fc('0x21')]['lastIndexOf']('-')),'membername':_0x398b67[_0x35fc('0x21')][_0x35fc('0x22')](_0x398b67[_0x35fc('0x21')][_0x35fc('0x23')]('/')+0x1,_0x398b67[_0x35fc('0x21')][_0x35fc('0x23')]('-'))},_[_0x35fc('0x24')](_0x398b67,[_0x35fc('0x25'),_0x35fc('0x26')]));logger[_0x35fc('0x27')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x398b67[_0x35fc('0x1c')],this[_0x35fc('0x28')][_0x398b67[_0x35fc('0x1c')]][_0x35fc('0x29')],this[_0x35fc('0x28')][_0x398b67['uniqueid']][_0x35fc('0x2a')]);logger[_0x35fc('0x1a')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x398b67[_0x35fc('0x1c')],util[_0x35fc('0x1d')](this[_0x35fc('0x28')][_0x398b67['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x35fc('0xc')][_0x398b67['uniqueid']])_[_0x35fc('0x1e')](this[_0x35fc('0x28')][_0x398b67['uniqueid']],this['applications'][_0x398b67[_0x35fc('0x1c')]]);this['emit'](_0x35fc('0x2b'),_0x35fc('0x2c'),this['channels'][_0x398b67[_0x35fc('0x1c')]]);logger[_0x35fc('0x1a')](_0x35fc('0x2d'),_0x398b67[_0x35fc('0x1c')],util[_0x35fc('0x1d')](this[_0x35fc('0x28')][_0x398b67[_0x35fc('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x35fc('0x19')]('custom:dialbegin',this[_0x35fc('0x28')][_0x398b67[_0x35fc('0x1c')]]);}}}catch(_0x22af18){logger['error'](_0x35fc('0x2e'),_0x398b67[_0x35fc('0x1c')],util[_0x35fc('0x1d')](_0x22af18,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x35fc('0x18')][_0x35fc('0x11')]=function(_0x103181){try{if(this[_0x35fc('0x16')](_0x103181)){logger[_0x35fc('0x1a')](_0x35fc('0x2f'),_0x103181[_0x35fc('0x1c')],util['inspect'](_0x103181,{'showHidden':![],'depth':null}));if(this['channels'][_0x103181[_0x35fc('0x1c')]]){this['channels'][_0x103181[_0x35fc('0x1c')]][_0x35fc('0x30')]=_0x103181[_0x35fc('0x30')];if(_0x103181[_0x35fc('0x30')]===_0x35fc('0x31')){this[_0x35fc('0x28')][_0x103181['uniqueid']][_0x35fc('0x32')]=_0x103181[_0x35fc('0x32')];this[_0x35fc('0x28')][_0x103181[_0x35fc('0x1c')]][_0x35fc('0x33')]=_0x103181[_0x35fc('0x33')];this['channels'][_0x103181[_0x35fc('0x1c')]][_0x35fc('0x34')]=moment()[_0x35fc('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x35fc('0x28')][_0x103181['uniqueid']][_0x35fc('0x35')]=_0x35fc('0x36');logger[_0x35fc('0x27')](_0x35fc('0x37'),_0x103181['uniqueid'],_0x103181['channel']['substring'](_0x103181[_0x35fc('0x21')]['lastIndexOf']('/')+0x1,_0x103181[_0x35fc('0x21')]['lastIndexOf']('-')));logger[_0x35fc('0x1a')](_0x35fc('0x38'),_0x103181[_0x35fc('0x1c')],util[_0x35fc('0x1d')](this[_0x35fc('0x28')][_0x103181[_0x35fc('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x35fc('0x19')]('custom:dialconnect',this[_0x35fc('0x28')][_0x103181[_0x35fc('0x1c')]]);}logger['debug'](_0x35fc('0x39'),_0x103181[_0x35fc('0x1c')],util[_0x35fc('0x1d')](this[_0x35fc('0x28')][_0x103181[_0x35fc('0x1c')]],{'showHidden':![],'depth':null}));this[_0x35fc('0x19')]('voice:outbound',_0x35fc('0x2c'),this[_0x35fc('0x28')][_0x103181[_0x35fc('0x1c')]]);}}}catch(_0x52543b){logger[_0x35fc('0x3a')](_0x35fc('0x3b'),_0x103181['uniqueid'],util[_0x35fc('0x1d')](_0x52543b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x35fc('0x18')][_0x35fc('0x13')]=function(_0x41e199){try{if(this[_0x35fc('0x16')](_0x41e199)){logger[_0x35fc('0x1a')](_0x35fc('0x3c'),_0x41e199[_0x35fc('0x1c')],util['inspect'](_0x41e199,{'showHidden':![],'depth':null}));this['addVariable'](_0x41e199[_0x35fc('0x1c')],_[_0x35fc('0x3d')](_0x41e199['variable'])[0x0],_0x41e199['value']);if(this['isNotNull'](_0x41e199[_0x35fc('0x3e')])&&this[_0x35fc('0x16')](_0x41e199['variable'][_0x35fc('0x3f')])){if(_[_0x35fc('0x17')](this[_0x35fc('0x28')][_0x41e199[_0x35fc('0x1c')]])){this['channels'][_0x41e199['uniqueid']]={'routeId':_0x41e199['value'],'variables':this['variables'][_0x41e199['uniqueid']],'motionChannel':_0x35fc('0x40')};logger[_0x35fc('0x27')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x41e199[_0x35fc('0x1c')],_0x41e199['variable'][_0x35fc('0x3f')],_[_0x35fc('0x3d')](_0x41e199[_0x35fc('0x3e')])[0x0],_0x41e199[_0x35fc('0x41')]);logger[_0x35fc('0x1a')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x41e199[_0x35fc('0x1c')],util[_0x35fc('0x1d')](this['channels'][_0x41e199[_0x35fc('0x1c')]],{'showHidden':![],'depth':null}));this[_0x35fc('0x19')](_0x35fc('0x2b'),_0x35fc('0x2c'),this['channels'][_0x41e199[_0x35fc('0x1c')]]);}}}}catch(_0x4c82d8){logger['error'](_0x35fc('0x42'),_0x41e199[_0x35fc('0x1c')],util[_0x35fc('0x1d')](_0x4c82d8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x35fc('0x18')][_0x35fc('0x43')]=function(_0x302a7b,_0x405320,_0x16afa6){var _0x4f555f=[_0x35fc('0x44'),_0x35fc('0x45'),_0x35fc('0x46'),_0x35fc('0x47'),_0x35fc('0x48'),_0x35fc('0x49'),_0x35fc('0x4a'),_0x35fc('0x4b'),_0x35fc('0x4c'),_0x35fc('0x4d'),_0x35fc('0x4e'),_0x35fc('0x4f'),_0x35fc('0x50'),_0x35fc('0x51'),'memberinterface','memberlastcall',_0x35fc('0x29'),_0x35fc('0x52'),_0x35fc('0x53')];if(!_[_0x35fc('0x54')](_0x405320)&&!_[_0x35fc('0x55')](_0x4f555f,_0x405320)){if(_[_0x35fc('0x17')](this['variables'][_0x302a7b])){this['variables'][_0x302a7b]={};}this[_0x35fc('0xd')][_0x302a7b][_0x405320]=_0x16afa6;}};VoiceDialReport[_0x35fc('0x18')][_0x35fc('0x15')]=function(_0x38bc78){try{if(this['isNotNull'](_0x38bc78)){logger[_0x35fc('0x1a')](_0x35fc('0x56'),_0x38bc78['uniqueid'],util[_0x35fc('0x1d')](_0x38bc78,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x28')][_0x38bc78['uniqueid']]){logger[_0x35fc('0x27')](_0x35fc('0x57'),_0x38bc78[_0x35fc('0x1c')],_0x38bc78[_0x35fc('0x58')]);this['channels'][_0x38bc78['uniqueid']]['endtime']=moment()[_0x35fc('0x1f')](_0x35fc('0x20'));this['channels'][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x59')]=moment(this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x5a')])['diff'](this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x5b')],'seconds');this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]]['lastevent']=_0x35fc('0x5c');this[_0x35fc('0xb')][_0x35fc('0x5d')]+=0x1;if(this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x34')]){this[_0x35fc('0xb')][_0x35fc('0x5e')]+=0x1;this['channels'][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x5f')]=moment(this[_0x35fc('0x28')][_0x38bc78['uniqueid']][_0x35fc('0x34')])['diff'](this['channels'][_0x38bc78['uniqueid']][_0x35fc('0x5b')],_0x35fc('0x60'));this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x61')]=moment(this['channels'][_0x38bc78['uniqueid']]['endtime'])['diff'](this['channels'][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x34')],_0x35fc('0x60'));this[_0x35fc('0xb')]['sumHoldTime']+=this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x5f')]||0x0;this[_0x35fc('0xb')][_0x35fc('0x62')]+=this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]][_0x35fc('0x61')];}this[_0x35fc('0xb')]['sumDuration']+=this[_0x35fc('0x28')][_0x38bc78['uniqueid']][_0x35fc('0x59')];logger[_0x35fc('0x1a')](_0x35fc('0x63'),_0x38bc78[_0x35fc('0x1c')],util['inspect'](this[_0x35fc('0x28')][_0x38bc78['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this[_0x35fc('0x28')][_0x38bc78['uniqueid']]);logger[_0x35fc('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x38bc78[_0x35fc('0x1c')],util['inspect'](this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x35fc('0x19')](_0x35fc('0x64'),this['channels'][_0x38bc78[_0x35fc('0x1c')]]);logger[_0x35fc('0x1a')](_0x35fc('0x65'),_0x38bc78['uniqueid'],util[_0x35fc('0x1d')](this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]],{'showHidden':![],'depth':null}));this[_0x35fc('0x19')](_0x35fc('0x2b'),_0x35fc('0x66'),this[_0x35fc('0xb')]);logger[_0x35fc('0x27')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x35fc('0x67')](this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]]));logger['debug'](_0x35fc('0x68'),_0x38bc78[_0x35fc('0x1c')],util['inspect'](this['channels'][_0x38bc78[_0x35fc('0x1c')]],{'showHidden':![],'depth':null}));this['emit'](_0x35fc('0x2b'),_0x35fc('0x69'),this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]]);delete this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x1c')]];}else if(this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x6a')]]){this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x6a')]][_0x35fc('0x1c')]=this[_0x35fc('0x28')][_0x38bc78[_0x35fc('0x6a')]][_0x35fc('0x6b')];}if(this[_0x35fc('0xd')][_0x38bc78[_0x35fc('0x1c')]]){delete this[_0x35fc('0xd')][_0x38bc78[_0x35fc('0x1c')]];}}}catch(_0x3b2160){logger[_0x35fc('0x3a')]('[%s][voiceDialReport][hangup]',_0x38bc78[_0x35fc('0x1c')],util['inspect'](_0x3b2160,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x35fc('0x18')][_0x35fc('0x6c')]=function(_0x2185ce){try{if(this[_0x35fc('0x16')](_0x2185ce)){logger[_0x35fc('0x1a')](_0x35fc('0x6d'),_0x2185ce[_0x35fc('0x1c')],util[_0x35fc('0x1d')](_0x2185ce,{'showHidden':![],'depth':null}));if(_0x2185ce[_0x35fc('0x6e')][_0x35fc('0x6f')]()===_0x35fc('0x70')){_0x2185ce['applicationdata']=(_0x2185ce[_0x35fc('0x71')]||_0x2185ce[_0x35fc('0x72')])[_0x35fc('0x6f')]();if(_[_0x35fc('0x73')](_0x2185ce[_0x35fc('0x72')],_0x35fc('0x74'))){if(_['isUndefined'](this[_0x35fc('0xc')][_0x2185ce[_0x35fc('0x1c')]]))this[_0x35fc('0xc')][_0x2185ce[_0x35fc('0x1c')]]={};logger[_0x35fc('0x27')](_0x35fc('0x75'),_0x2185ce[_0x35fc('0x1c')],_0x2185ce[_0x35fc('0x6e')],_0x2185ce[_0x35fc('0x72')]);var _0x5f23d8=_0x2185ce[_0x35fc('0x72')]['split']('=');var _0x1c7d01=_0x5f23d8[0x0][_0x35fc('0x76')](/cdr\((.*)\)/);if(_0x1c7d01)this['applications'][_0x2185ce[_0x35fc('0x1c')]][_0x1c7d01[0x1]]=_0x5f23d8[0x1];}}}}catch(_0x41002a){logger[_0x35fc('0x3a')](_0x35fc('0x77'),_0x2185ce[_0x35fc('0x1c')],util[_0x35fc('0x1d')](_0x41002a,{'showHidden':![],'depth':null}));}};module[_0x35fc('0x78')]=VoiceDialReport;
\ No newline at end of file
+var _0xae24=['[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberinterface','membername','memberpenalty','memberrealtime','isNil','includes','variables','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','answered','sumHoldTime','holdtime','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','applicationdata','appdata','toLowerCase','startsWith','split','[%s][voiceDialReport][newexten]','exports','lodash','util','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','channels','outbound','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','substring','channel','lastIndexOf','omit','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','[%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]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xae24,0x182));var _0x4ae2=function(_0x583c07,_0x1d57ce){_0x583c07=_0x583c07-0x0;var _0x41dfac=_0xae24[_0x583c07];return _0x41dfac;};'use strict';var _=require(_0x4ae2('0x0'));var moment=require('moment');var util=require(_0x4ae2('0x1'));var Redis=require('ioredis');var config=require(_0x4ae2('0x2'));var logger=require(_0x4ae2('0x3'))('ami');var ami=require('../ami');config[_0x4ae2('0x4')]=_['defaults'](config[_0x4ae2('0x4')],{'host':_0x4ae2('0x5'),'port':0x18eb});var io=require(_0x4ae2('0x6'))(new Redis(config[_0x4ae2('0x4')]));function VoiceDialReport(_0x428054){this[_0x4ae2('0x7')]=_0x428054['outboundChannels'];this['outbound']=_0x428054[_0x4ae2('0x8')];this['applications']={};this['variables']={};ami['on'](_0x4ae2('0x9'),this[_0x4ae2('0xa')]['bind'](this));ami['on'](_0x4ae2('0xb'),this[_0x4ae2('0xc')][_0x4ae2('0xd')](this));ami['on'](_0x4ae2('0xe'),this['syncVarSet'][_0x4ae2('0xd')](this));ami['on'](_0x4ae2('0xf'),this[_0x4ae2('0x10')]['bind'](this));}VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0x12')]=function(_0x30d6c4){return _0x30d6c4!==null&&!_[_0x4ae2('0x13')](_0x30d6c4);};VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0x14')]=function(_0x145287,_0x3cabc9,_0xd527a0){io['to'](_0x145287)['emit'](_0x3cabc9,_0xd527a0);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x2f3936){try{if(this[_0x4ae2('0x12')](_0x2f3936)){logger['debug'](_0x4ae2('0x15'),_0x2f3936[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x2f3936,{'showHidden':![],'depth':null}));if(this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]]){_[_0x4ae2('0x18')](this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]],{'starttime':moment()[_0x4ae2('0x19')](_0x4ae2('0x1a')),'lastevent':'called','interface':_0x2f3936['channel'][_0x4ae2('0x1b')](0x0,_0x2f3936[_0x4ae2('0x1c')]['lastIndexOf']('-')),'membername':_0x2f3936[_0x4ae2('0x1c')][_0x4ae2('0x1b')](_0x2f3936[_0x4ae2('0x1c')][_0x4ae2('0x1d')]('/')+0x1,_0x2f3936[_0x4ae2('0x1c')]['lastIndexOf']('-'))},_[_0x4ae2('0x1e')](_0x2f3936,['event','privilege']));logger[_0x4ae2('0x1f')](_0x4ae2('0x20'),_0x2f3936[_0x4ae2('0x16')],this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]]['membername'],this[_0x4ae2('0x7')][_0x2f3936['uniqueid']][_0x4ae2('0x21')]);logger[_0x4ae2('0x22')](_0x4ae2('0x23'),_0x2f3936['uniqueid'],util[_0x4ae2('0x17')](this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));if(this[_0x4ae2('0x24')][_0x2f3936[_0x4ae2('0x16')]])_[_0x4ae2('0x18')](this['channels'][_0x2f3936['uniqueid']],this[_0x4ae2('0x24')][_0x2f3936[_0x4ae2('0x16')]]);this[_0x4ae2('0x14')](_0x4ae2('0x25'),_0x4ae2('0x26'),this[_0x4ae2('0x7')][_0x2f3936['uniqueid']]);logger['debug'](_0x4ae2('0x27'),_0x2f3936['uniqueid'],util['inspect'](this['channels'][_0x2f3936[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));ami[_0x4ae2('0x14')]('custom:dialbegin',this[_0x4ae2('0x7')][_0x2f3936[_0x4ae2('0x16')]]);}}}catch(_0x3d56ea){logger[_0x4ae2('0x28')](_0x4ae2('0x29'),_0x2f3936[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x3d56ea,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0xc')]=function(_0x3542df){try{if(this[_0x4ae2('0x12')](_0x3542df)){logger[_0x4ae2('0x22')](_0x4ae2('0x2a'),_0x3542df[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x3542df,{'showHidden':![],'depth':null}));if(this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]]){this['channels'][_0x3542df[_0x4ae2('0x16')]]['dialstatus']=_0x3542df[_0x4ae2('0x2b')];if(_0x3542df[_0x4ae2('0x2b')]==='ANSWER'){this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]][_0x4ae2('0x2c')]=_0x3542df[_0x4ae2('0x2c')];this['channels'][_0x3542df[_0x4ae2('0x16')]][_0x4ae2('0x2d')]=_0x3542df[_0x4ae2('0x2d')];this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]][_0x4ae2('0x2e')]=moment()[_0x4ae2('0x19')](_0x4ae2('0x1a'));this[_0x4ae2('0x7')][_0x3542df['uniqueid']][_0x4ae2('0x2f')]='connect';logger[_0x4ae2('0x1f')](_0x4ae2('0x30'),_0x3542df[_0x4ae2('0x16')],_0x3542df[_0x4ae2('0x1c')][_0x4ae2('0x1b')](_0x3542df[_0x4ae2('0x1c')]['lastIndexOf']('/')+0x1,_0x3542df[_0x4ae2('0x1c')][_0x4ae2('0x1d')]('-')));logger[_0x4ae2('0x22')](_0x4ae2('0x31'),_0x3542df['uniqueid'],util[_0x4ae2('0x17')](this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));ami[_0x4ae2('0x14')](_0x4ae2('0x32'),this[_0x4ae2('0x7')][_0x3542df[_0x4ae2('0x16')]]);}logger[_0x4ae2('0x22')](_0x4ae2('0x33'),_0x3542df[_0x4ae2('0x16')],util[_0x4ae2('0x17')](this['channels'][_0x3542df[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));this[_0x4ae2('0x14')](_0x4ae2('0x25'),_0x4ae2('0x26'),this['channels'][_0x3542df['uniqueid']]);}}}catch(_0xd46eed){logger[_0x4ae2('0x28')](_0x4ae2('0x34'),_0x3542df[_0x4ae2('0x16')],util['inspect'](_0xd46eed,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0x35')]=function(_0x5ca188){try{if(this[_0x4ae2('0x12')](_0x5ca188)){logger[_0x4ae2('0x22')](_0x4ae2('0x36'),_0x5ca188['uniqueid'],util[_0x4ae2('0x17')](_0x5ca188,{'showHidden':![],'depth':null}));this[_0x4ae2('0x37')](_0x5ca188[_0x4ae2('0x16')],_[_0x4ae2('0x38')](_0x5ca188[_0x4ae2('0x39')])[0x0],_0x5ca188[_0x4ae2('0x3a')]);if(this[_0x4ae2('0x12')](_0x5ca188[_0x4ae2('0x39')])&&this['isNotNull'](_0x5ca188[_0x4ae2('0x39')][_0x4ae2('0x3b')])){if(_['isUndefined'](this[_0x4ae2('0x7')][_0x5ca188[_0x4ae2('0x16')]])){this['channels'][_0x5ca188[_0x4ae2('0x16')]]={'routeId':_0x5ca188[_0x4ae2('0x3a')],'variables':this['variables'][_0x5ca188[_0x4ae2('0x16')]],'motionChannel':_0x4ae2('0x3c')};logger[_0x4ae2('0x1f')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x5ca188['uniqueid'],_0x5ca188[_0x4ae2('0x39')][_0x4ae2('0x3b')],_[_0x4ae2('0x38')](_0x5ca188[_0x4ae2('0x39')])[0x0],_0x5ca188['value']);logger[_0x4ae2('0x22')](_0x4ae2('0x3d'),_0x5ca188[_0x4ae2('0x16')],util['inspect'](this[_0x4ae2('0x7')][_0x5ca188[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));this[_0x4ae2('0x14')]('voice:outbound',_0x4ae2('0x26'),this[_0x4ae2('0x7')][_0x5ca188[_0x4ae2('0x16')]]);}}}}catch(_0x39d365){logger[_0x4ae2('0x28')](_0x4ae2('0x3e'),_0x5ca188[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x39d365,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4ae2('0x11')][_0x4ae2('0x37')]=function(_0x48afbb,_0x3db48e,_0x4a70c6){var _0x10db30=[_0x4ae2('0x3f'),_0x4ae2('0x40'),_0x4ae2('0x41'),_0x4ae2('0x42'),_0x4ae2('0x43'),'rtpaudioqoslossbridged',_0x4ae2('0x44'),_0x4ae2('0x45'),'sipcallid',_0x4ae2('0x46'),_0x4ae2('0x47'),'bridgepvtcallid',_0x4ae2('0x48'),'memberdynamic',_0x4ae2('0x49'),'memberlastcall',_0x4ae2('0x4a'),_0x4ae2('0x4b'),_0x4ae2('0x4c')];if(!_[_0x4ae2('0x4d')](_0x3db48e)&&!_[_0x4ae2('0x4e')](_0x10db30,_0x3db48e)){if(_[_0x4ae2('0x13')](this[_0x4ae2('0x4f')][_0x48afbb])){this[_0x4ae2('0x4f')][_0x48afbb]={};}this[_0x4ae2('0x4f')][_0x48afbb][_0x3db48e]=_0x4a70c6;}};VoiceDialReport['prototype'][_0x4ae2('0x10')]=function(_0x4284b4){try{if(this[_0x4ae2('0x12')](_0x4284b4)){logger[_0x4ae2('0x22')]('[%s][voiceDialReport][hangup]\x20event:',_0x4284b4[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x4284b4,{'showHidden':![],'depth':null}));if(this[_0x4ae2('0x7')][_0x4284b4['uniqueid']]){logger['info'](_0x4ae2('0x50'),_0x4284b4[_0x4ae2('0x16')],_0x4284b4[_0x4ae2('0x51')]);this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]][_0x4ae2('0x52')]=moment()[_0x4ae2('0x19')](_0x4ae2('0x1a'));this[_0x4ae2('0x7')][_0x4284b4['uniqueid']][_0x4ae2('0x53')]=moment(this['channels'][_0x4284b4[_0x4ae2('0x16')]][_0x4ae2('0x52')])[_0x4ae2('0x54')](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]][_0x4ae2('0x55')],_0x4ae2('0x56'));this[_0x4ae2('0x7')][_0x4284b4['uniqueid']]['lastevent']=_0x4ae2('0x57');this[_0x4ae2('0x8')][_0x4ae2('0x58')]+=0x1;if(this['channels'][_0x4284b4['uniqueid']][_0x4ae2('0x2e')]){this[_0x4ae2('0x8')][_0x4ae2('0x59')]+=0x1;this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]['holdtime']=moment(this['channels'][_0x4284b4['uniqueid']][_0x4ae2('0x2e')])['diff'](this['channels'][_0x4284b4[_0x4ae2('0x16')]]['starttime'],_0x4ae2('0x56'));this['channels'][_0x4284b4[_0x4ae2('0x16')]]['billableseconds']=moment(this[_0x4ae2('0x7')][_0x4284b4['uniqueid']][_0x4ae2('0x52')])[_0x4ae2('0x54')](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]][_0x4ae2('0x2e')],'seconds');this['outbound'][_0x4ae2('0x5a')]+=this[_0x4ae2('0x7')][_0x4284b4['uniqueid']][_0x4ae2('0x5b')]||0x0;this[_0x4ae2('0x8')]['sumBillable']+=this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]['billableseconds'];}this['outbound'][_0x4ae2('0x5c')]+=this[_0x4ae2('0x7')][_0x4284b4['uniqueid']][_0x4ae2('0x53')];logger[_0x4ae2('0x22')](_0x4ae2('0x5d'),_0x4284b4[_0x4ae2('0x16')],util['inspect'](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));ami['emit'](_0x4ae2('0x5e'),this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x4284b4[_0x4ae2('0x16')],util['inspect'](this[_0x4ae2('0x7')][_0x4284b4['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x4ae2('0x14')]('custom:dialend',this[_0x4ae2('0x7')][_0x4284b4['uniqueid']]);logger[_0x4ae2('0x22')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x4284b4['uniqueid'],util[_0x4ae2('0x17')](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]],{'showHidden':![],'depth':null}));this[_0x4ae2('0x14')](_0x4ae2('0x25'),_0x4ae2('0x5f'),this[_0x4ae2('0x8')]);logger[_0x4ae2('0x1f')](_0x4ae2('0x60'),JSON[_0x4ae2('0x61')](this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]));logger['debug'](_0x4ae2('0x62'),_0x4284b4[_0x4ae2('0x16')],util[_0x4ae2('0x17')](this[_0x4ae2('0x7')][_0x4284b4['uniqueid']],{'showHidden':![],'depth':null}));this[_0x4ae2('0x14')]('voice:outbound',_0x4ae2('0x63'),this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]]);delete this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x16')]];}else if(this[_0x4ae2('0x7')][_0x4284b4['linkedid']]){this[_0x4ae2('0x7')][_0x4284b4[_0x4ae2('0x64')]][_0x4ae2('0x16')]=this['channels'][_0x4284b4[_0x4ae2('0x64')]][_0x4ae2('0x65')];}if(this[_0x4ae2('0x4f')][_0x4284b4['uniqueid']]){delete this[_0x4ae2('0x4f')][_0x4284b4[_0x4ae2('0x16')]];}}}catch(_0x209f6c){logger['error'](_0x4ae2('0x66'),_0x4284b4[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x209f6c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4ae2('0x11')]['syncNewExten']=function(_0x390c71){try{if(this[_0x4ae2('0x12')](_0x390c71)){logger[_0x4ae2('0x22')](_0x4ae2('0x67'),_0x390c71[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x390c71,{'showHidden':![],'depth':null}));if(_0x390c71[_0x4ae2('0x68')]['toLowerCase']()==='set'){_0x390c71[_0x4ae2('0x69')]=(_0x390c71[_0x4ae2('0x6a')]||_0x390c71[_0x4ae2('0x69')])[_0x4ae2('0x6b')]();if(_[_0x4ae2('0x6c')](_0x390c71[_0x4ae2('0x69')],'cdr(')){if(_[_0x4ae2('0x13')](this[_0x4ae2('0x24')][_0x390c71[_0x4ae2('0x16')]]))this[_0x4ae2('0x24')][_0x390c71[_0x4ae2('0x16')]]={};logger[_0x4ae2('0x1f')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x390c71[_0x4ae2('0x16')],_0x390c71[_0x4ae2('0x68')],_0x390c71[_0x4ae2('0x69')]);var _0x3a84d7=_0x390c71[_0x4ae2('0x69')][_0x4ae2('0x6d')]('=');var _0x5efbe9=_0x3a84d7[0x0]['match'](/cdr\((.*)\)/);if(_0x5efbe9)this[_0x4ae2('0x24')][_0x390c71[_0x4ae2('0x16')]][_0x5efbe9[0x1]]=_0x3a84d7[0x1];}}}}catch(_0x517ecb){logger[_0x4ae2('0x28')](_0x4ae2('0x6e'),_0x390c71[_0x4ae2('0x16')],util[_0x4ae2('0x17')](_0x517ecb,{'showHidden':![],'depth':null}));}};module[_0x4ae2('0x6f')]=VoiceDialReport;
\ No newline at end of file
index c016b71..68af308 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfb4=['voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','loggedIn','pTalking','sumBillable','talking','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isNotNull','isUndefined','queues','loopQueueSummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20event:','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','type','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','queuecallerexit','queuecallerexitAt','transfer','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','destexten','transferuniqueid','COMPLETEDBY','reason','toUpperCase','[%s][voiceQueueReport][varset]','variable','value','CONTINUE','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','length','diff','sumDuration','queuecallercompleteAt','lastevent','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','handleHangup','cause-txt','cause','transferid','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','transfertype','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','prototype','tail','queueReports','agents','channels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','syncMusicOnHoldStart','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','waiting','queueStatusComplete','unlockRR','clearZombieChannels','sequence','enqueue','Action','status','channel','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','error','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','ATTENDEDTRANSFER'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0xbfb4,0x9f));var _0x4bfb=function(_0x434457,_0x3c9127){_0x434457=_0x434457-0x0;var _0x105a41=_0xbfb4[_0x434457];return _0x105a41;};'use strict';var _=require(_0x4bfb('0x0'));var moment=require(_0x4bfb('0x1'));var util=require(_0x4bfb('0x2'));var md5=require(_0x4bfb('0x3'));var Redis=require(_0x4bfb('0x4'));var config=require(_0x4bfb('0x5'));var logger=require(_0x4bfb('0x6'))(_0x4bfb('0x7'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0x4bfb('0x8')]=_[_0x4bfb('0x9')](config[_0x4bfb('0x8')],{'host':_0x4bfb('0xa'),'port':0x18eb});var io=require(_0x4bfb('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x4bfb('0xc')]['enqueue']=function(_0xbc7b2d){this[_0x4bfb('0xd')]=this[_0x4bfb('0xd')]?this[_0x4bfb('0xd')]['finally'](_0xbc7b2d):_0xbc7b2d();};function VoiceQueueReport(_0x3547cf){this['sequence']=new Sequence();this[_0x4bfb('0xe')]={};this[_0x4bfb('0xf')]=_0x3547cf[_0x4bfb('0xf')];this[_0x4bfb('0x10')]=_0x3547cf['queueChannels'];this[_0x4bfb('0x11')]=_0x3547cf['voiceQueues'];this[_0x4bfb('0x12')]=!![];this[_0x4bfb('0x13')]=_0x3547cf[_0x4bfb('0x13')];this[_0x4bfb('0x14')]={};ami['on'](_0x4bfb('0x15'),this[_0x4bfb('0x16')][_0x4bfb('0x17')](this));ami['on'](_0x4bfb('0x18'),this['syncQueueSummaryComplete'][_0x4bfb('0x17')](this));ami['on'](_0x4bfb('0x19'),this[_0x4bfb('0x1a')][_0x4bfb('0x17')](this));ami['on'](_0x4bfb('0x1b'),this[_0x4bfb('0x1c')]['bind'](this));ami['on'](_0x4bfb('0x1d'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0x4bfb('0x1e'),this[_0x4bfb('0x1f')][_0x4bfb('0x17')](this));ami['on'](_0x4bfb('0x20'),this[_0x4bfb('0x21')][_0x4bfb('0x17')](this));ami['on'](_0x4bfb('0x22'),this['syncVarSet'][_0x4bfb('0x17')](this));ami['on'](_0x4bfb('0x23'),this[_0x4bfb('0x24')]['bind'](this));ami['on']('fullybooted',this['syncFullyBooted']['bind'](this));ami['on']('musiconholdstart',this[_0x4bfb('0x25')][_0x4bfb('0x17')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0x4bfb('0x26'),this['syncAttendedTransfer'][_0x4bfb('0x17')](this));ami['on'](_0x4bfb('0x27'),this[_0x4bfb('0x28')][_0x4bfb('0x17')](this));this['loopQueueSummary']();this[_0x4bfb('0x29')]();}function clearChannels(_0x100176){if(!_[_0x4bfb('0x2a')](_0x100176)){for(var _0x5bd5a2 in _0x100176){if(_0x100176[_0x4bfb('0x2b')](_0x5bd5a2)){delete _0x100176[_0x5bd5a2];}}}}function clearCampaigns(_0x5803dc){if(!_[_0x4bfb('0x2a')](_0x5803dc)){for(var _0x1ffd48 in _0x5803dc){if(_0x5803dc[_0x4bfb('0x2b')](_0x1ffd48)){_0x5803dc[_0x1ffd48][_0x4bfb('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x140bcb){if(!_[_0x4bfb('0x2a')](_0x140bcb)){for(var _0x2f7fba in _0x140bcb){if(_0x140bcb[_0x4bfb('0x2b')](_0x2f7fba)){_0x140bcb[_0x2f7fba][_0x4bfb('0x2c')]=0x0;_0x140bcb[_0x2f7fba]['talking']=0x0;_0x140bcb[_0x2f7fba]['pTalking']=0x0;_0x140bcb[_0x2f7fba][_0x4bfb('0x2d')]=0x0;_0x140bcb[_0x2f7fba][_0x4bfb('0x2e')]=!![];}}}}function clearAgentBooked(_0x36e686){if(!_['isEmpty'](_0x36e686)){for(var _0x468b7b in _0x36e686){if(_0x36e686[_0x4bfb('0x2b')](_0x468b7b)){_0x36e686[_0x468b7b][_0x4bfb('0x2f')]=!![];}}}}VoiceQueueReport['prototype'][_0x4bfb('0x30')]=function(){var _0x499512=this;for(var _0x446e1e in this[_0x4bfb('0x10')]){if(this[_0x4bfb('0x10')][_0x4bfb('0x2b')](_0x446e1e)&&!this[_0x4bfb('0x10')][_0x446e1e]['switch']){this[_0x4bfb('0x31')][_0x4bfb('0x32')](function(){if(!_['isNil'](_0x499512[_0x4bfb('0x10')][_0x446e1e])){return ami[_0x4bfb('0x33')]({'action':_0x4bfb('0x34'),'channel':_0x499512[_0x4bfb('0x10')][_0x446e1e][_0x4bfb('0x35')]})[_0x4bfb('0x36')](function(_0x5a7a13){if(_0x5a7a13[_0x4bfb('0x37')]===_0x4bfb('0x38')){setTimeout(function(){if(_0x499512['channels'][_0x446e1e]){delete _0x499512[_0x4bfb('0x10')][_0x446e1e];logger['error'](_0x4bfb('0x39'),_0x446e1e,util[_0x4bfb('0x3a')](_0x5a7a13,{'showHidden':![],'depth':null}));}if(_0x499512['queueReports'][_0x446e1e]){delete _0x499512[_0x4bfb('0xe')][_0x446e1e];logger['error'](_0x4bfb('0x3b'),_0x446e1e,util[_0x4bfb('0x3a')](_0x5a7a13,{'showHidden':![],'depth':null}));}if(_0x499512['variables'][_0x446e1e]){delete _0x499512[_0x4bfb('0x14')][_0x446e1e];logger[_0x4bfb('0x3c')](_0x4bfb('0x3d'),_0x446e1e,util[_0x4bfb('0x3a')](_0x5a7a13,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x4bfb('0xc')][_0x4bfb('0x3e')]=function(){logger[_0x4bfb('0x3c')](_0x4bfb('0x3f'));clearChannels(this['channels']);this['clearQueueReport'](this[_0x4bfb('0xe')]);clearAgentBooked(this[_0x4bfb('0xf')]);clearVoiceQueues(this[_0x4bfb('0x11')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x4bfb('0xc')][_0x4bfb('0x40')]=function(_0x4ef934){var _0x171c78=this;if(!_['isEmpty'](_0x4ef934)){for(var _0xf5925c in _0x4ef934){if(_0x4ef934[_0x4bfb('0x2b')](_0xf5925c)){_0x171c78[_0x4bfb('0x41')](_0x4ef934[_0xf5925c],'clearqueuereport');delete _0x4ef934[_0xf5925c];}}}};VoiceQueueReport['prototype'][_0x4bfb('0x42')]=function(_0x5bc73e,_0x321856,_0x56f5c1){io['to'](_0x5bc73e)['emit'](_0x321856,_0x56f5c1);};VoiceQueueReport['prototype'][_0x4bfb('0x43')]=function(_0x8043e2,_0xf201d2){logger[_0x4bfb('0x44')](_0x4bfb('0x45')+_0xf201d2+_0x4bfb('0x46'),_0x8043e2['uniqueid'],util['inspect'](_0x8043e2,{'showHidden':![],'depth':null}));this[_0x4bfb('0x42')](util[_0x4bfb('0x47')]('voice:queue:%s',_0x8043e2[_0x4bfb('0x48')]),_0x4bfb('0x49'),_0x8043e2);io[_0x4bfb('0x42')](_0x4bfb('0x4a'),_0x8043e2);};VoiceQueueReport['prototype'][_0x4bfb('0x41')]=function(_0x31b69d,_0x2ec4d4){logger[_0x4bfb('0x44')](_0x4bfb('0x45')+_0x2ec4d4+_0x4bfb('0x4b'),_0x31b69d[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x31b69d,{'showHidden':![],'depth':null}));if(_0x31b69d['queuecallerexitreason']===_0x4bfb('0x4d'))return;this[_0x4bfb('0x42')](util[_0x4bfb('0x47')](_0x4bfb('0x4e'),_0x31b69d['name']),_0x4bfb('0x4f'),_0x31b69d);io[_0x4bfb('0x42')](_0x4bfb('0x50'),_0x31b69d);};VoiceQueueReport['prototype'][_0x4bfb('0x51')]=function(_0x45dc9c,_0xeccb0){if(_0x45dc9c['type']===_0x4bfb('0x52')){var _0xc23c49={'id':_0x45dc9c['id'],'name':_0x45dc9c[_0x4bfb('0x48')],'strategy':_0x45dc9c[_0x4bfb('0x53')],'answered':_0x45dc9c[_0x4bfb('0x54')],'available':_0x45dc9c['available'],'loggedIn':_0x45dc9c[_0x4bfb('0x55')],'pTalking':_0x45dc9c[_0x4bfb('0x56')],'sumBillable':_0x45dc9c[_0x4bfb('0x57')],'sumDuration':_0x45dc9c['sumDuration'],'sumHoldTime':_0x45dc9c['sumHoldTime']||0x0,'talking':_0x45dc9c[_0x4bfb('0x58')],'total':_0x45dc9c[_0x4bfb('0x59')],'type':_0x45dc9c['type'],'unmanaged':_0x45dc9c[_0x4bfb('0x5a')],'abandoned':_0x45dc9c[_0x4bfb('0x5b')],'waiting':_0x45dc9c[_0x4bfb('0x2d')]};if(_0x45dc9c['Trunk']){_0xc23c49[_0x4bfb('0x5c')]={'id':_0x45dc9c[_0x4bfb('0x5c')]['id'],'name':_0x45dc9c[_0x4bfb('0x5c')][_0x4bfb('0x48')],'active':_0x45dc9c[_0x4bfb('0x5c')][_0x4bfb('0x5d')],'callerid':_0x45dc9c['Trunk'][_0x4bfb('0x5e')]};}if(_0x45dc9c[_0x4bfb('0x5f')]){_0xc23c49[_0x4bfb('0x5f')]={'id':_0x45dc9c[_0x4bfb('0x5f')]['id'],'name':_0x45dc9c['Interval'][_0x4bfb('0x48')]};}var _0x5e800f=md5(JSON[_0x4bfb('0x60')](_0xc23c49));if(_0x45dc9c['md5']!==_0x5e800f){_0x45dc9c['md5']=_0x5e800f;logger['debug'](_0x4bfb('0x61')+_0xeccb0+_0x4bfb('0x62'),util[_0x4bfb('0x3a')](_0xc23c49,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x4bfb('0x4e'),_0xc23c49[_0x4bfb('0x48')]),'voice_queue:save',_0xc23c49);}}};VoiceQueueReport['prototype'][_0x4bfb('0x63')]=function(_0x8786f9){return _0x8786f9!==null&&!_[_0x4bfb('0x64')](_0x8786f9);};VoiceQueueReport[_0x4bfb('0xc')][_0x4bfb('0x29')]=function(){var _0x294e49=this;setInterval(function(){_0x294e49[_0x4bfb('0x30')]();ami[_0x4bfb('0x33')]({'action':_0x4bfb('0x65')})[_0x4bfb('0x36')](function(_0x42badd){logger['error']('[voiceQueueReport][queues]',util[_0x4bfb('0x3a')](_0x42badd,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x4bfb('0xc')][_0x4bfb('0x66')]=function(){var _0x39b962=this;setInterval(function(){if(_0x39b962[_0x4bfb('0x12')]){return ami[_0x4bfb('0x33')]({'action':_0x4bfb('0x15')})['then'](function(){_0x39b962['flagQueueSummary']=![];})[_0x4bfb('0x36')](function(_0x27eb7f){logger[_0x4bfb('0x3c')](_0x4bfb('0x67'),util[_0x4bfb('0x3a')](_0x27eb7f,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x4bfb('0xc')]['syncQueueSummary']=function(_0x4ba3f1){try{if(this[_0x4bfb('0x63')](_0x4ba3f1)&&this[_0x4bfb('0x63')](_0x4ba3f1['queue'])){logger[_0x4bfb('0x44')](_0x4bfb('0x68'),util[_0x4bfb('0x3a')](_0x4ba3f1,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x4ba3f1[_0x4bfb('0x69')]]){logger[_0x4bfb('0x6a')](_0x4bfb('0x6b'),_0x4ba3f1['queue']);var _0x498d10=_[_0x4bfb('0x6c')](this['channels'],_0x4bfb('0x69'))[_0x4ba3f1[_0x4bfb('0x69')]]||0x0;var _0x220773=_0x498d10-_0x4ba3f1[_0x4bfb('0x6d')];if(this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]]['waiting']!==_[_0x4bfb('0x6e')](_0x4ba3f1[_0x4bfb('0x6d')])||this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]]['loggedIn']!==_[_0x4bfb('0x6e')](_0x4ba3f1[_0x4bfb('0x6f')])||this['voiceQueues'][_0x4ba3f1[_0x4bfb('0x69')]][_0x4bfb('0x70')]!==_['toNumber'](_0x4ba3f1[_0x4bfb('0x70')])||this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]][_0x4bfb('0x58')]!==_0x220773){this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]][_0x4bfb('0x2d')]=_[_0x4bfb('0x6e')](_0x4ba3f1[_0x4bfb('0x6d')]);this['voiceQueues'][_0x4ba3f1[_0x4bfb('0x69')]][_0x4bfb('0x55')]=_[_0x4bfb('0x6e')](_0x4ba3f1[_0x4bfb('0x6f')]);this['voiceQueues'][_0x4ba3f1[_0x4bfb('0x69')]][_0x4bfb('0x70')]=_[_0x4bfb('0x6e')](_0x4ba3f1[_0x4bfb('0x70')]);this[_0x4bfb('0x11')][_0x4ba3f1['queue']][_0x4bfb('0x58')]=_0x220773>0x0?_0x220773:0x0;this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]][_0x4bfb('0x58')]=this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]][_0x4bfb('0x58')]>_[_0x4bfb('0x6e')](_0x4ba3f1[_0x4bfb('0x6f')])?_[_0x4bfb('0x6e')](_0x4ba3f1['loggedin']):this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]][_0x4bfb('0x58')];this[_0x4bfb('0x51')](this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]],'queuesummary');}logger[_0x4bfb('0x44')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0x4bfb('0x11')][_0x4ba3f1['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x4bfb('0x71'),this[_0x4bfb('0x11')][_0x4ba3f1[_0x4bfb('0x69')]]);}}}catch(_0x14615c){logger[_0x4bfb('0x3c')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x14615c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4bfb('0x72')]=function(_0x436485){logger[_0x4bfb('0x44')](_0x4bfb('0x73'),util['inspect'](_0x436485,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x4bfb('0xc')][_0x4bfb('0x1a')]=function(_0x44e4b0){try{if(this[_0x4bfb('0x63')](_0x44e4b0)){logger[_0x4bfb('0x44')](_0x4bfb('0x74'),_0x44e4b0['uniqueid'],util[_0x4bfb('0x3a')](_0x44e4b0,{'showHidden':![],'depth':null}));if(_[_0x4bfb('0x64')](this[_0x4bfb('0xe')][_0x44e4b0[_0x4bfb('0x4c')]]))this['queueReports'][_0x44e4b0[_0x4bfb('0x4c')]]=[];if(_[_0x4bfb('0x64')](this[_0x4bfb('0x10')][_0x44e4b0[_0x4bfb('0x4c')]]))this[_0x4bfb('0x10')][_0x44e4b0['uniqueid']]={};var _0x4d1358=new QueueReport();_0x4d1358[_0x4bfb('0x48')]=_0x44e4b0[_0x4bfb('0x69')];_0x4d1358[_0x4bfb('0x75')]=this[_0x4bfb('0x11')][_0x4d1358['name']]&&this[_0x4bfb('0x11')][_0x4d1358[_0x4bfb('0x48')]][_0x4bfb('0x75')]?this[_0x4bfb('0x11')][_0x4d1358[_0x4bfb('0x48')]]['type']||_0x4bfb('0x52'):_0x4bfb('0x52');_0x4d1358[_0x4bfb('0x69')]=_0x44e4b0['queue'];_0x4d1358[_0x4bfb('0x76')]=moment()[_0x4bfb('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d1358['position']=_0x44e4b0[_0x4bfb('0x77')];_0x4d1358[_0x4bfb('0x78')]=_0x44e4b0[_0x4bfb('0x78')];_0x4d1358[_0x4bfb('0x4c')]=_0x44e4b0[_0x4bfb('0x4c')];_0x4d1358['routealias']=this[_0x4bfb('0x10')][_0x44e4b0[_0x4bfb('0x4c')]][_0x4bfb('0x79')];logger[_0x4bfb('0x6a')](_0x4bfb('0x7a'),_0x4d1358[_0x4bfb('0x48')],_0x4d1358[_0x4bfb('0x75')]);_[_0x4bfb('0x7b')](_0x4d1358,_[_0x4bfb('0x7c')](_0x44e4b0,_[_0x4bfb('0x7d')](_0x4d1358)));this['queueReports'][_0x44e4b0[_0x4bfb('0x4c')]][_0x4bfb('0x7e')](_0x4d1358);this[_0x4bfb('0x10')][_0x44e4b0[_0x4bfb('0x4c')]]=_0x4d1358;this[_0x4bfb('0x43')](_0x4d1358,'queuecallerjoin');}}catch(_0x4a9fe7){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x44e4b0[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x4a9fe7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bfb('0xc')]['syncQueueCallerAbandon']=function(_0x3613cc){try{if(this['isNotNull'](_0x3613cc)){logger['debug'](_0x4bfb('0x7f'),_0x3613cc[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x3613cc,{'showHidden':![],'depth':null}));if(this[_0x4bfb('0xe')][_0x3613cc[_0x4bfb('0x4c')]]){var _0x4a34ec=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x3613cc[_0x4bfb('0x4c')]]);_0x4a34ec[_0x4bfb('0x81')]=![];_0x4a34ec['queuecallercompleteAt']=null;_0x4a34ec[_0x4bfb('0x82')]=_0x3613cc[_0x4bfb('0x82')];_0x4a34ec[_0x4bfb('0x83')]=_0x3613cc[_0x4bfb('0x83')];_0x4a34ec[_0x4bfb('0x1b')]=!![];_0x4a34ec[_0x4bfb('0x84')]=moment()[_0x4bfb('0x47')](_0x4bfb('0x85'));_0x4a34ec[_0x4bfb('0x86')]='ABANDONED';_0x4a34ec[_0x4bfb('0x87')]=null;logger[_0x4bfb('0x6a')](_0x4bfb('0x88'),_0x4a34ec[_0x4bfb('0x48')],_0x4a34ec['type']);this[_0x4bfb('0x10')][_0x3613cc['uniqueid']]=_0x4a34ec;this[_0x4bfb('0x41')](_0x4a34ec,_0x4bfb('0x1b'));}}}catch(_0x196cc3){logger[_0x4bfb('0x3c')](_0x4bfb('0x7f'),_0x3613cc[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x196cc3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4bfb('0x89')]=function(_0x38bbf5){try{if(this[_0x4bfb('0x63')](_0x38bbf5)){logger[_0x4bfb('0x44')](_0x4bfb('0x8a'),_0x38bbf5[_0x4bfb('0x4c')],util['inspect'](_0x38bbf5,{'showHidden':![],'depth':null}));if(this[_0x4bfb('0xe')][_0x38bbf5[_0x4bfb('0x4c')]]){var _0x344979=_[_0x4bfb('0x80')](this['queueReports'][_0x38bbf5[_0x4bfb('0x4c')]]);_0x344979[_0x4bfb('0x8b')]=moment()[_0x4bfb('0x47')](_0x4bfb('0x85'));_0x344979[_0x4bfb('0x8c')]=_0x38bbf5['connectedlinenum'];_0x344979[_0x4bfb('0x8d')]=_0x38bbf5['connectedlinename'];logger[_0x4bfb('0x6a')](_0x4bfb('0x8e'),_0x344979[_0x4bfb('0x48')],_0x344979['type'],_0x38bbf5[_0x4bfb('0x8c')],_0x38bbf5[_0x4bfb('0x8d')]);this[_0x4bfb('0x10')][_0x38bbf5[_0x4bfb('0x4c')]]=_0x344979;this['emitVoiceQueueChannelSave'](_0x344979,_0x4bfb('0x1d'));}}}catch(_0x285a98){logger[_0x4bfb('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0x38bbf5[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x285a98,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bfb('0xc')]['syncAgentConnect']=function(_0x5156db){try{if(this['isNotNull'](_0x5156db)){logger[_0x4bfb('0x44')]('[%s][voiceQueueReport][agentconnect]',_0x5156db[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x5156db,{'showHidden':![],'depth':null}));if(this[_0x4bfb('0xe')][_0x5156db['uniqueid']]){var _0x5bbe86=_[_0x4bfb('0x80')](this['queueReports'][_0x5156db[_0x4bfb('0x4c')]]);_0x5bbe86[_0x4bfb('0x81')]=!![];_0x5bbe86[_0x4bfb('0x86')]=_0x4bfb('0x8f');logger[_0x4bfb('0x6a')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5bbe86[_0x4bfb('0x48')],_0x5bbe86[_0x4bfb('0x75')]);}}}catch(_0xc2a537){logger[_0x4bfb('0x3c')](_0x4bfb('0x90'),_0x5156db[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0xc2a537,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bfb('0xc')][_0x4bfb('0x1f')]=function(_0x14fcf0){try{if(this['isNotNull'](_0x14fcf0)){logger[_0x4bfb('0x44')](_0x4bfb('0x91'),_0x14fcf0[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x14fcf0,{'showHidden':![],'depth':null}));if(this[_0x4bfb('0xe')][_0x14fcf0['uniqueid']]){var _0x2815d1=_[_0x4bfb('0x80')](this['queueReports'][_0x14fcf0[_0x4bfb('0x4c')]]);_0x2815d1['queuecallerabandon']=![];_0x2815d1[_0x4bfb('0x84')]=null;_0x2815d1[_0x4bfb('0x92')]=!![];_0x2815d1[_0x4bfb('0x87')]=_0x14fcf0['membername'];_0x2815d1[_0x4bfb('0x82')]=_0x14fcf0[_0x4bfb('0x82')];_0x2815d1[_0x4bfb('0x81')]=!![];_0x2815d1[_0x4bfb('0x93')]=![];_0x2815d1[_0x4bfb('0x94')]=null;if(!_0x2815d1[_0x4bfb('0x95')]){if(_0x14fcf0['reason']==_0x4bfb('0x95')){_0x2815d1[_0x4bfb('0x86')]='COMPLETED';logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2815d1['name'],_0x2815d1[_0x4bfb('0x75')]);}else{if(_[_0x4bfb('0x96')](_0x14fcf0[_0x4bfb('0x35')][_0x4bfb('0x97')](),_0x4bfb('0x98'))){if(this['queueReports'][_0x14fcf0[_0x4bfb('0x99')]]){var _0x2ba7ec=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x14fcf0[_0x4bfb('0x99')]]);_0x2ba7ec[_0x4bfb('0x81')]=![];_0x2ba7ec[_0x4bfb('0x93')]=!![];_0x2ba7ec[_0x4bfb('0x94')]=moment(_0x2815d1[_0x4bfb('0x76')])[_0x4bfb('0x9a')](_0x14fcf0['holdtime'],_0x4bfb('0x9b'))[_0x4bfb('0x47')](_0x4bfb('0x85'));_0x2ba7ec[_0x4bfb('0x86')]=_0x4bfb('0x9c');_0x2ba7ec[_0x4bfb('0x95')]=!![];_0x2ba7ec['transfertype']='FORWARD';_0x2ba7ec['transferexten']=_0x14fcf0[_0x4bfb('0x9d')];_0x2ba7ec[_0x4bfb('0x9e')]=_0x14fcf0['uniqueid'];logger[_0x4bfb('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x2ba7ec[_0x4bfb('0x48')],_0x2ba7ec[_0x4bfb('0x75')]);var _0x5ad48e=this[_0x4bfb('0xe')][_0x14fcf0[_0x4bfb('0x99')]];this[_0x4bfb('0xe')][_0x14fcf0[_0x4bfb('0x99')]]=this['queueReports'][_0x14fcf0[_0x4bfb('0x4c')]];this[_0x4bfb('0xe')][_0x14fcf0[_0x4bfb('0x4c')]]=_0x5ad48e;}}else{_0x2815d1[_0x4bfb('0x86')]=_0x4bfb('0x9f')+_0x14fcf0[_0x4bfb('0xa0')][_0x4bfb('0xa1')]();logger[_0x4bfb('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x2815d1[_0x4bfb('0x48')],_0x2815d1['type'],_0x2815d1['queuecallerexitreason']);}}}this[_0x4bfb('0x10')][_0x14fcf0[_0x4bfb('0x4c')]]=_0x2815d1;this[_0x4bfb('0x41')](_0x2815d1,'agentcomplete');}}}catch(_0x43e9ca){logger['error'](_0x4bfb('0x91'),_0x14fcf0['uniqueid'],util[_0x4bfb('0x3a')](_0x43e9ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bfb('0xc')]['syncVarSet']=function(_0x4b5e01){try{if(this['isNotNull'](_0x4b5e01)){logger[_0x4bfb('0x44')](_0x4bfb('0xa2'),_0x4b5e01[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x4b5e01,{'showHidden':![],'depth':null}));this['addVariable'](_0x4b5e01[_0x4bfb('0x4c')],_[_0x4bfb('0x7d')](_0x4b5e01[_0x4bfb('0xa3')])[0x0],_0x4b5e01[_0x4bfb('0xa4')]);if(this[_0x4bfb('0xe')][_0x4b5e01[_0x4bfb('0x4c')]]){var _0x97998c=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x4b5e01['uniqueid']]);if(_0x97998c){if(this[_0x4bfb('0x63')](_0x4b5e01[_0x4bfb('0xa3')])&&this[_0x4bfb('0x63')](_0x4b5e01[_0x4bfb('0xa3')]['queuestatus'])){switch(_0x4b5e01['value']){case _0x4bfb('0xa5'):_0x97998c['queuecallerexit']=![];_0x97998c[_0x4bfb('0x94')]=null;break;case _0x4bfb('0xa6'):_0x97998c['lastevent']=_0x4bfb('0xa7');_0x97998c[_0x4bfb('0x93')]=!![];_0x97998c['queuecallerexitAt']=moment()[_0x4bfb('0x47')](_0x4bfb('0x85'));_0x97998c['queuecallerleaveAt']=moment()[_0x4bfb('0x47')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x4bfb('0x44')](_0x4bfb('0xa8'),_0x4b5e01[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x97998c,{'showHidden':![],'depth':null}));ami[_0x4bfb('0x42')](_0x4bfb('0xa9'),_0x97998c);break;default:_0x97998c['queuecallerexit']=!![];_0x97998c[_0x4bfb('0x94')]=moment()[_0x4bfb('0x47')](_0x4bfb('0x85'));_0x97998c[_0x4bfb('0x8b')]=moment()[_0x4bfb('0x47')](_0x4bfb('0x85'));}_0x97998c[_0x4bfb('0x1b')]=![];_0x97998c['queuecallerabandonAt']=null;_0x97998c['queuecallerexitreason']=_0x4b5e01['value'];this[_0x4bfb('0x10')][_0x4b5e01[_0x4bfb('0x4c')]]=_0x97998c;this[_0x4bfb('0x41')](_0x97998c,_0x4bfb('0x22'));}else if(this[_0x4bfb('0x63')](_0x4b5e01[_0x4bfb('0xa3')])&&this[_0x4bfb('0x63')](_0x4b5e01['variable'][_0x4bfb('0xaa')])){if(!_0x97998c[_0x4bfb('0x1b')]){_0x97998c['queuecallerexit']=!![];_0x97998c[_0x4bfb('0x94')]=moment()[_0x4bfb('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x97998c[_0x4bfb('0x86')]=_0x4bfb('0xab');_0x97998c['queuecallerleaveAt']=moment()['format'](_0x4bfb('0x85'));this['channels'][_0x4b5e01[_0x4bfb('0x4c')]]=_0x97998c;}}logger[_0x4bfb('0x6a')](_0x4bfb('0xac'),_0x4b5e01['uniqueid'],_0x97998c['name'],_0x97998c['type'],_[_0x4bfb('0x7d')](_0x4b5e01[_0x4bfb('0xa3')])[0x0],_0x4b5e01[_0x4bfb('0xa4')]);_0x97998c[_0x4bfb('0x14')]=this['variables'][_0x4b5e01[_0x4bfb('0x4c')]];}}}}catch(_0x1ecf40){logger[_0x4bfb('0x3c')](_0x4bfb('0xa2'),_0x4b5e01[_0x4bfb('0x4c')],util['inspect'](_0x1ecf40,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bfb('0xc')][_0x4bfb('0xad')]=function(_0x1d5d6a,_0x1628df,_0x23392a){var _0x46b745=['rtpaudioqos',_0x4bfb('0xae'),_0x4bfb('0xaf'),_0x4bfb('0xb0'),'rtpaudioqosloss',_0x4bfb('0xb1'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x4bfb('0xb2'),_0x4bfb('0xb3'),_0x4bfb('0xb4'),_0x4bfb('0xb5'),_0x4bfb('0xb6'),_0x4bfb('0xb7'),'memberinterface',_0x4bfb('0xb8'),_0x4bfb('0xb9'),_0x4bfb('0xba'),_0x4bfb('0xbb')];if(!_[_0x4bfb('0xbc')](_0x1628df)&&!_['includes'](_0x46b745,_0x1628df)){if(_['isUndefined'](this['variables'][_0x1d5d6a])){this[_0x4bfb('0x14')][_0x1d5d6a]={};}this['variables'][_0x1d5d6a][_0x1628df]=_0x23392a;}};VoiceQueueReport[_0x4bfb('0xc')]['handleHangup']=function(_0x390c8c,_0x4e2134,_0x3175a7){var _0xfea9c2={};for(var _0x5758b9=0x0;_0x5758b9<this[_0x4bfb('0xe')][_0x390c8c][_0x4bfb('0xbd')];_0x5758b9+=0x1){_0xfea9c2=this[_0x4bfb('0xe')][_0x390c8c][_0x5758b9];if(this[_0x4bfb('0x11')][_0xfea9c2['queue']]){if(_0xfea9c2['queuecallerexit']&&_0xfea9c2[_0x4bfb('0x95')]!=!![]){this[_0x4bfb('0x11')][_0xfea9c2[_0x4bfb('0x69')]][_0x4bfb('0x5a')]+=0x1;}if(_0xfea9c2[_0x4bfb('0x1b')]){this[_0x4bfb('0x11')][_0xfea9c2[_0x4bfb('0x69')]][_0x4bfb('0x5b')]+=0x1;}this['voiceQueues'][_0xfea9c2[_0x4bfb('0x69')]]['sumHoldTime']+=moment(_0xfea9c2[_0x4bfb('0x8b')])[_0x4bfb('0xbe')](_0xfea9c2['queuecallerjoinAt'],_0x4bfb('0x9b'))||0x0;if(_0x5758b9===this[_0x4bfb('0xe')][_0x390c8c][_0x4bfb('0xbd')]-0x1){this[_0x4bfb('0x11')][_0xfea9c2['queue']][_0x4bfb('0xbf')]+=moment()['milliseconds'](0x0)[_0x4bfb('0xbe')](_0xfea9c2['queuecallerjoinAt'],_0x4bfb('0x9b'));this['voiceQueues'][_0xfea9c2[_0x4bfb('0x69')]][_0x4bfb('0x59')]+=0x1;if(_0xfea9c2[_0x4bfb('0x81')]){this[_0x4bfb('0x11')][_0xfea9c2['queue']]['answered']+=0x1;this[_0x4bfb('0x11')][_0xfea9c2['queue']][_0x4bfb('0x57')]+=moment()['milliseconds'](0x0)[_0x4bfb('0xbe')](_0xfea9c2[_0x4bfb('0x8b')],_0x4bfb('0x9b'));_0xfea9c2[_0x4bfb('0xc0')]=moment()[_0x4bfb('0x47')](_0x4bfb('0x85'));_0xfea9c2['queuecallerexit']=![];_0xfea9c2[_0x4bfb('0x94')]=null;}if(_0xfea9c2[_0x4bfb('0x93')]&&_0xfea9c2[_0x4bfb('0x95')]!=!![]){_0xfea9c2[_0x4bfb('0xc1')]=_0x4bfb('0x5a');logger[_0x4bfb('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x390c8c,util['inspect'](_0xfea9c2,{'showHidden':![],'depth':null}));ami[_0x4bfb('0x42')](_0x4bfb('0xc2'),_0xfea9c2);}if(_0xfea9c2['queuecallerabandon']){_0xfea9c2['lastevent']=_0x4bfb('0x5b');logger[_0x4bfb('0x44')](_0x4bfb('0xc3'),_0x390c8c,util[_0x4bfb('0x3a')](_0xfea9c2,{'showHidden':![],'depth':null}));ami[_0x4bfb('0x42')](_0x4bfb('0xc4'),_0xfea9c2);}}else{this['voiceQueues'][_0xfea9c2[_0x4bfb('0x69')]][_0x4bfb('0xbf')]+=this[_0x4bfb('0x11')][_0xfea9c2[_0x4bfb('0x69')]]['sumHoldTime'];}logger['info']('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x390c8c,_0xfea9c2[_0x4bfb('0x48')],_0xfea9c2['type'],_0x4e2134);if(_0x3175a7&&_0xfea9c2[_0x4bfb('0x86')]===_0x4bfb('0x4d')){_0xfea9c2['queuecallerexitreason']=_0x4bfb('0x8f');}this[_0x4bfb('0x10')][_0x390c8c]=_0xfea9c2;this[_0x4bfb('0x41')](_0xfea9c2,_0x4bfb('0x23'));this[_0x4bfb('0x51')](this[_0x4bfb('0x11')][_0xfea9c2[_0x4bfb('0x69')]],_0x4bfb('0x23'));}}logger[_0x4bfb('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x390c8c,util['inspect'](this['queueReports'][_0x390c8c],{'showHidden':![],'depth':null}));ami[_0x4bfb('0x42')]('custom:voiceQueueReport',this[_0x4bfb('0xe')][_0x390c8c]);if(_0xfea9c2['queuecallerexitreason']===_0x4bfb('0x4d'))return;delete this[_0x4bfb('0xe')][_0x390c8c];delete this[_0x4bfb('0x10')][_0x390c8c];if(this[_0x4bfb('0x14')][_0x390c8c]){delete this[_0x4bfb('0x14')][_0x390c8c];}};VoiceQueueReport[_0x4bfb('0xc')]['syncHangup']=function(_0x167702){try{if(this[_0x4bfb('0x63')](_0x167702)){logger[_0x4bfb('0x44')]('[%s][voiceQueueReport][hangup]',_0x167702[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x167702,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x167702[_0x4bfb('0x4c')]]){return this[_0x4bfb('0xc5')](_0x167702[_0x4bfb('0x4c')],_0x167702[_0x4bfb('0xc6')]);}if(this[_0x4bfb('0xe')][_0x167702[_0x4bfb('0x99')]]){if(_0x167702[_0x4bfb('0xc7')]==='21'){return;}return this[_0x4bfb('0xc5')](_0x167702[_0x4bfb('0x99')],_0x167702[_0x4bfb('0xc6')],!![]);}var _0x16d8ab=Object[_0x4bfb('0x7d')](this[_0x4bfb('0xe')]);for(var _0x3cf657=0x0;_0x3cf657<_0x16d8ab['length'];_0x3cf657++){var _0x52dfe6=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x16d8ab[_0x3cf657]]);if(_0x52dfe6&&_0x52dfe6[_0x4bfb('0xc8')]===_0x167702['uniqueid']){return this[_0x4bfb('0xc5')](_0x52dfe6[_0x4bfb('0x4c')],_0x167702[_0x4bfb('0xc6')],!![]);}}}}catch(_0x40c127){logger[_0x4bfb('0x3c')](_0x4bfb('0xc9'),_0x167702[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x40c127,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bfb('0xc')]['syncAttendedTransfer']=function(_0x3a7bca){try{if(this['isNotNull'](_0x3a7bca)){logger['debug'](_0x4bfb('0xca'),_0x3a7bca[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x3a7bca,{'showHidden':![],'depth':null}));var _0x11b693;var _0x166cd2;var _0x27e39a;if(this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xcb')]]){_0x11b693=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xcb')]]);_0x11b693[_0x4bfb('0xcc')]=_0x3a7bca[_0x4bfb('0xcd')];_0x11b693['transferuniqueid']=_0x3a7bca[_0x4bfb('0xce')];_0x11b693[_0x4bfb('0x86')]=_0x4bfb('0x4d');_0x11b693['transfer']=!![];_0x11b693[_0x4bfb('0xcf')]=_0x4bfb('0xd0');if(this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xce')]]){_0x27e39a=this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xce')]];this['queueReports'][_0x3a7bca[_0x4bfb('0xce')]]=this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xcb')]];this['queueReports'][_0x3a7bca[_0x4bfb('0xcb')]]=_0x27e39a;_0x166cd2=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xcb')]]);_0x166cd2[_0x4bfb('0xd1')]=!![];}logger['info'](_0x4bfb('0xd2'),_0x3a7bca[_0x4bfb('0x4c')],_0x11b693[_0x4bfb('0x48')],_0x11b693[_0x4bfb('0x75')],_0x11b693[_0x4bfb('0xcc')],_0x11b693[_0x4bfb('0x9e')]);}else if(this['queueReports'][_0x3a7bca[_0x4bfb('0xd3')]]){_0x11b693=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xd3')]]);_0x11b693['transferexten']=_0x3a7bca['origtransfererexten'];_0x11b693[_0x4bfb('0x9e')]=_0x3a7bca[_0x4bfb('0xd4')];_0x11b693[_0x4bfb('0x86')]='ATTENDEDTRANSFER';_0x11b693[_0x4bfb('0x95')]=!![];_0x11b693[_0x4bfb('0xcf')]='ATTENDED';if(this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xd4')]]){_0x27e39a=this[_0x4bfb('0xe')][_0x3a7bca['origtransfereruniqueid']];this[_0x4bfb('0xe')][_0x3a7bca['origtransfereruniqueid']]=this[_0x4bfb('0xe')][_0x3a7bca['transfertargetuniqueid']];this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xd3')]]=_0x27e39a;_0x166cd2=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xd3')]]);_0x166cd2['switch']=!![];}logger[_0x4bfb('0x6a')](_0x4bfb('0xd2'),_0x3a7bca[_0x4bfb('0x4c')],_0x11b693['name'],_0x11b693['type'],_0x11b693[_0x4bfb('0xcc')],_0x11b693[_0x4bfb('0x9e')]);}else if(this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xd4')]]){_0x11b693=_[_0x4bfb('0x80')](this['queueReports'][_0x3a7bca[_0x4bfb('0xd4')]]);_0x11b693[_0x4bfb('0xcc')]=_0x3a7bca['origtransfererexten'];_0x11b693['transferuniqueid']=_0x3a7bca['origtransfereruniqueid'];_0x11b693[_0x4bfb('0x86')]=_0x4bfb('0x4d');_0x11b693['transfer']=!![];_0x11b693[_0x4bfb('0xcf')]=_0x4bfb('0xd0');_0x11b693[_0x4bfb('0xd1')]=!![];_0x11b693[_0x4bfb('0xc8')]=_0x3a7bca['transfereeuniqueid'];}else if(this['queueReports'][_0x3a7bca[_0x4bfb('0xce')]]){_0x11b693=_['last'](this[_0x4bfb('0xe')][_0x3a7bca[_0x4bfb('0xce')]]);_0x11b693[_0x4bfb('0xcc')]=_0x3a7bca[_0x4bfb('0xcd')];_0x11b693['transferuniqueid']=_0x3a7bca['secondtransfereruniqueid'];_0x11b693[_0x4bfb('0x86')]='ATTENDEDTRANSFER';_0x11b693[_0x4bfb('0x95')]=!![];_0x11b693[_0x4bfb('0xcf')]=_0x4bfb('0xd0');_0x11b693[_0x4bfb('0xd1')]=!![];_0x11b693[_0x4bfb('0xc8')]=_0x3a7bca['transfertargetuniqueid'];}}}catch(_0x53cc5c){logger[_0x4bfb('0x3c')](_0x4bfb('0xca'),_0x3a7bca[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x53cc5c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bfb('0xc')][_0x4bfb('0x28')]=function(_0x43d24b){try{if(this[_0x4bfb('0x63')](_0x43d24b)){logger[_0x4bfb('0x44')]('[%s][voiceQueueReport][blindtransfer]',_0x43d24b[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x43d24b,{'showHidden':![],'depth':null}));if(this[_0x4bfb('0xe')][_0x43d24b['transfereeuniqueid']]){var _0x5805da=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x43d24b[_0x4bfb('0xcb')]]);_0x5805da[_0x4bfb('0x86')]='BLINDTRANSFER';_0x5805da[_0x4bfb('0x95')]=!![];_0x5805da[_0x4bfb('0xcf')]=_0x4bfb('0xd5');_0x5805da['transferexten']=_0x43d24b[_0x4bfb('0xd6')];_0x5805da[_0x4bfb('0x9e')]=_0x43d24b[_0x4bfb('0xcb')];logger[_0x4bfb('0x6a')](_0x4bfb('0xd7'),_0x43d24b[_0x4bfb('0x4c')],_0x5805da[_0x4bfb('0x48')],_0x5805da['type'],_0x5805da['transferexten'],_0x5805da[_0x4bfb('0x9e')]);this[_0x4bfb('0x24')]({'event':_0x4bfb('0xd8'),'uniqueid':_0x43d24b['transfereeuniqueid'],'context':_0x43d24b[_0x4bfb('0xd9')],'channel':_0x43d24b[_0x4bfb('0xda')]});}}}catch(_0x4b640a){logger[_0x4bfb('0x3c')](_0x4bfb('0xdb'),_0x43d24b[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x4b640a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4bfb('0x25')]=function(_0x32571b){try{if(this[_0x4bfb('0x63')](_0x32571b)){logger[_0x4bfb('0x44')]('[%s][voiceQueueReport][musiconholdstart]',_0x32571b[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x32571b,{'showHidden':![],'depth':null}));if(this[_0x4bfb('0xe')][_0x32571b[_0x4bfb('0x4c')]]){var _0x59eba3=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x32571b['uniqueid']]);if(!_[_0x4bfb('0xbc')](_0x59eba3[_0x4bfb('0x8b')])){_0x59eba3[_0x4bfb('0xdc')]=moment()['format'](_0x4bfb('0x85'));logger[_0x4bfb('0x6a')](_0x4bfb('0xdd'),_0x32571b[_0x4bfb('0x4c')],_0x59eba3[_0x4bfb('0xdc')]);}}}}catch(_0x315ae3){logger[_0x4bfb('0x3c')]('[%s][voiceQueueReport][musiconholdstart]',_0x32571b['uniqueid'],util[_0x4bfb('0x3a')](_0x315ae3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4bfb('0xde')]=function(_0x3d21e8){try{if(this[_0x4bfb('0x63')](_0x3d21e8)){logger[_0x4bfb('0x44')](_0x4bfb('0xdf'),_0x3d21e8[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x3d21e8,{'showHidden':![],'depth':null}));if(this[_0x4bfb('0xe')][_0x3d21e8[_0x4bfb('0x4c')]]){var _0xa72e15=_[_0x4bfb('0x80')](this[_0x4bfb('0xe')][_0x3d21e8[_0x4bfb('0x4c')]]);if(!_[_0x4bfb('0xbc')](_0xa72e15[_0x4bfb('0xdc')])){_0xa72e15[_0x4bfb('0xe0')]+=moment()['milliseconds'](0x0)[_0x4bfb('0xbe')](_0xa72e15['mohstarttime'],_0x4bfb('0x9b'));logger['info'](_0x4bfb('0xe1'),_0x3d21e8['uniqueid'],_0xa72e15[_0x4bfb('0xe0')]);delete _0xa72e15[_0x4bfb('0xdc')];}}}}catch(_0x600e98){logger[_0x4bfb('0x3c')]('[%s][voiceQueueReport][musiconholdstop]',_0x3d21e8[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x600e98,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bfb('0xc')]['syncNewExten']=function(_0x3a699e){try{if(this[_0x4bfb('0x63')](_0x3a699e)){logger[_0x4bfb('0x44')](_0x4bfb('0xe2'),_0x3a699e[_0x4bfb('0x4c')],util[_0x4bfb('0x3a')](_0x3a699e,{'showHidden':![],'depth':null}));if(_0x3a699e['application'][_0x4bfb('0x97')]()===_0x4bfb('0xe3')){_0x3a699e[_0x4bfb('0xe4')]=_0x3a699e[_0x4bfb('0xe5')]&&_0x3a699e['appdata'][_0x4bfb('0x96')](_0x4bfb('0xe6'))?_0x3a699e[_0x4bfb('0xe5')]:(_0x3a699e[_0x4bfb('0xe5')]||_0x3a699e['applicationdata'])['toLowerCase']();if(_[_0x4bfb('0x96')](_0x3a699e[_0x4bfb('0xe4')][_0x4bfb('0x97')](),_0x4bfb('0xe7'))){logger[_0x4bfb('0x6a')](_0x4bfb('0xe8'),_0x3a699e[_0x4bfb('0x4c')],_0x3a699e['application'],_0x3a699e[_0x4bfb('0xe4')]);if(_[_0x4bfb('0x64')](this[_0x4bfb('0x10')][_0x3a699e[_0x4bfb('0x4c')]]))this['channels'][_0x3a699e['uniqueid']]={};var _0x3ce2c7=_0x3a699e[_0x4bfb('0xe4')][_0x4bfb('0xe9')]('=');var _0x40aa09=_0x3ce2c7[0x0][_0x4bfb('0x97')]()[_0x4bfb('0xea')](/cdr\((.*)\)/);if(_0x40aa09)this[_0x4bfb('0x10')][_0x3a699e[_0x4bfb('0x4c')]][_0x40aa09[0x1]]=_0x3ce2c7[0x1];}}}}catch(_0x317fa1){logger[_0x4bfb('0x3c')](_0x4bfb('0xeb'),_0x3a699e[_0x4bfb('0x4c')],util['inspect'](_0x317fa1,{'showHidden':![],'depth':null}));}};module[_0x4bfb('0xec')]=VoiceQueueReport;
\ No newline at end of file
+var _0xf42a=['isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','uniqueid','emit','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','emitVoiceQueueSummary','inbound','strategy','available','loggedIn','sumDuration','sumHoldTime','type','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','info','merge','pick','keys','push','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','reason','transfer','COMPLETED','startsWith','local/','linkedid','last','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','addVariable','variable','value','queuestatus','CONTINUE','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','milliseconds','diff','total','answered','sumBillable','queuecallercompleteAt','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','ATTENDEDTRANSFER','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','set','appdata','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','exports','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','agents','channels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary'];(function(_0x4d650d,_0x122edd){var _0x2e0e0e=function(_0x15839b){while(--_0x15839b){_0x4d650d['push'](_0x4d650d['shift']());}};_0x2e0e0e(++_0x122edd);}(_0xf42a,0x1b1));var _0xaf42=function(_0x50d8db,_0x4b8b44){_0x50d8db=_0x50d8db-0x0;var _0x55fbe9=_0xf42a[_0x50d8db];return _0x55fbe9;};'use strict';var _=require('lodash');var moment=require(_0xaf42('0x0'));var util=require(_0xaf42('0x1'));var md5=require(_0xaf42('0x2'));var Redis=require(_0xaf42('0x3'));var config=require(_0xaf42('0x4'));var logger=require(_0xaf42('0x5'))(_0xaf42('0x6'));var ami=require('../ami');var QueueReport=require(_0xaf42('0x7'));config['redis']=_['defaults'](config[_0xaf42('0x8')],{'host':_0xaf42('0x9'),'port':0x18eb});var io=require(_0xaf42('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xaf42('0xb')][_0xaf42('0xc')]=function(_0x1dae81){this[_0xaf42('0xd')]=this[_0xaf42('0xd')]?this[_0xaf42('0xd')]['finally'](_0x1dae81):_0x1dae81();};function VoiceQueueReport(_0x207206){this[_0xaf42('0xe')]=new Sequence();this[_0xaf42('0xf')]={};this['agents']=_0x207206[_0xaf42('0x10')];this[_0xaf42('0x11')]=_0x207206['queueChannels'];this[_0xaf42('0x12')]=_0x207206[_0xaf42('0x12')];this[_0xaf42('0x13')]=!![];this['campaigns']=_0x207206[_0xaf42('0x14')];this[_0xaf42('0x15')]={};ami['on'](_0xaf42('0x16'),this[_0xaf42('0x17')]['bind'](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0xaf42('0x18')](this));ami['on']('queuecallerjoin',this[_0xaf42('0x19')][_0xaf42('0x18')](this));ami['on'](_0xaf42('0x1a'),this[_0xaf42('0x1b')]['bind'](this));ami['on'](_0xaf42('0x1c'),this[_0xaf42('0x1d')][_0xaf42('0x18')](this));ami['on'](_0xaf42('0x1e'),this[_0xaf42('0x1f')]['bind'](this));ami['on']('agentconnect',this[_0xaf42('0x20')][_0xaf42('0x18')](this));ami['on'](_0xaf42('0x21'),this[_0xaf42('0x22')][_0xaf42('0x18')](this));ami['on'](_0xaf42('0x23'),this[_0xaf42('0x24')][_0xaf42('0x18')](this));ami['on']('fullybooted',this['syncFullyBooted']['bind'](this));ami['on'](_0xaf42('0x25'),this['syncMusicOnHoldStart'][_0xaf42('0x18')](this));ami['on'](_0xaf42('0x26'),this[_0xaf42('0x27')][_0xaf42('0x18')](this));ami['on'](_0xaf42('0x28'),this[_0xaf42('0x29')]['bind'](this));ami['on'](_0xaf42('0x2a'),this[_0xaf42('0x2b')][_0xaf42('0x18')](this));this[_0xaf42('0x2c')]();this['loopQueueShow']();}function clearChannels(_0x17c06d){if(!_[_0xaf42('0x2d')](_0x17c06d)){for(var _0x1b2905 in _0x17c06d){if(_0x17c06d[_0xaf42('0x2e')](_0x1b2905)){delete _0x17c06d[_0x1b2905];}}}}function clearCampaigns(_0x5e02d2){if(!_[_0xaf42('0x2d')](_0x5e02d2)){for(var _0x5ab6de in _0x5e02d2){if(_0x5e02d2['hasOwnProperty'](_0x5ab6de)){_0x5e02d2[_0x5ab6de]['originated']=0x0;}}}}function clearVoiceQueues(_0x5802b8){if(!_[_0xaf42('0x2d')](_0x5802b8)){for(var _0xc134eb in _0x5802b8){if(_0x5802b8[_0xaf42('0x2e')](_0xc134eb)){_0x5802b8[_0xc134eb][_0xaf42('0x2f')]=0x0;_0x5802b8[_0xc134eb][_0xaf42('0x30')]=0x0;_0x5802b8[_0xc134eb][_0xaf42('0x31')]=0x0;_0x5802b8[_0xc134eb][_0xaf42('0x32')]=0x0;_0x5802b8[_0xc134eb]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x25169c){if(!_['isEmpty'](_0x25169c)){for(var _0x565b79 in _0x25169c){if(_0x25169c['hasOwnProperty'](_0x565b79)){_0x25169c[_0x565b79][_0xaf42('0x33')]=!![];}}}}VoiceQueueReport[_0xaf42('0xb')][_0xaf42('0x34')]=function(){var _0x13c875=this;for(var _0x155049 in this[_0xaf42('0x11')]){if(this[_0xaf42('0x11')][_0xaf42('0x2e')](_0x155049)&&!this['channels'][_0x155049][_0xaf42('0x35')]){this[_0xaf42('0xe')]['enqueue'](function(){if(!_[_0xaf42('0x36')](_0x13c875[_0xaf42('0x11')][_0x155049])){return ami[_0xaf42('0x37')]({'action':_0xaf42('0x38'),'channel':_0x13c875['channels'][_0x155049][_0xaf42('0x39')]})[_0xaf42('0x3a')](function(_0x464e38){if(_0x464e38[_0xaf42('0x3b')]===_0xaf42('0x3c')){setTimeout(function(){if(_0x13c875[_0xaf42('0x11')][_0x155049]){delete _0x13c875[_0xaf42('0x11')][_0x155049];logger[_0xaf42('0x3d')](_0xaf42('0x3e'),_0x155049,util[_0xaf42('0x3f')](_0x464e38,{'showHidden':![],'depth':null}));}if(_0x13c875['queueReports'][_0x155049]){delete _0x13c875[_0xaf42('0xf')][_0x155049];logger['error'](_0xaf42('0x40'),_0x155049,util[_0xaf42('0x3f')](_0x464e38,{'showHidden':![],'depth':null}));}if(_0x13c875[_0xaf42('0x15')][_0x155049]){delete _0x13c875['variables'][_0x155049];logger[_0xaf42('0x3d')](_0xaf42('0x41'),_0x155049,util[_0xaf42('0x3f')](_0x464e38,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger[_0xaf42('0x3d')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this['channels']);this[_0xaf42('0x42')](this['queueReports']);clearAgentBooked(this[_0xaf42('0x10')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xaf42('0x14')]);};VoiceQueueReport[_0xaf42('0xb')][_0xaf42('0x42')]=function(_0x4d4b90){var _0x4944b4=this;if(!_[_0xaf42('0x2d')](_0x4d4b90)){for(var _0x12e262 in _0x4d4b90){if(_0x4d4b90['hasOwnProperty'](_0x12e262)){_0x4944b4[_0xaf42('0x43')](_0x4d4b90[_0x12e262],_0xaf42('0x44'));delete _0x4d4b90[_0x12e262];}}}};VoiceQueueReport[_0xaf42('0xb')]['emit']=function(_0xd986ad,_0x5589b5,_0x5451ad){io['to'](_0xd986ad)['emit'](_0x5589b5,_0x5451ad);};VoiceQueueReport['prototype'][_0xaf42('0x45')]=function(_0x651269,_0x28fbfb){logger[_0xaf42('0x46')](_0xaf42('0x47')+_0x28fbfb+']\x20sending\x20voice_queue_channel:save\x20event:',_0x651269[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x651269,{'showHidden':![],'depth':null}));this[_0xaf42('0x49')](util[_0xaf42('0x4a')](_0xaf42('0x4b'),_0x651269[_0xaf42('0x4c')]),_0xaf42('0x4d'),_0x651269);io[_0xaf42('0x49')](_0xaf42('0x4e'),_0x651269);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x4c0590,_0xd02893){logger['debug'](_0xaf42('0x47')+_0xd02893+_0xaf42('0x4f'),_0x4c0590[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x4c0590,{'showHidden':![],'depth':null}));if(_0x4c0590['queuecallerexitreason']==='ATTENDEDTRANSFER')return;this['emit'](util['format'](_0xaf42('0x4b'),_0x4c0590['name']),'voice_queue_channel:remove',_0x4c0590);io[_0xaf42('0x49')]('voice_queue_presence:remove',_0x4c0590);};VoiceQueueReport['prototype'][_0xaf42('0x50')]=function(_0x46bdb2,_0x32bdc7){if(_0x46bdb2['type']===_0xaf42('0x51')){var _0x14faf6={'id':_0x46bdb2['id'],'name':_0x46bdb2[_0xaf42('0x4c')],'strategy':_0x46bdb2[_0xaf42('0x52')],'answered':_0x46bdb2['answered'],'available':_0x46bdb2[_0xaf42('0x53')],'loggedIn':_0x46bdb2[_0xaf42('0x54')],'pTalking':_0x46bdb2[_0xaf42('0x31')],'sumBillable':_0x46bdb2['sumBillable'],'sumDuration':_0x46bdb2[_0xaf42('0x55')],'sumHoldTime':_0x46bdb2[_0xaf42('0x56')]||0x0,'talking':_0x46bdb2[_0xaf42('0x30')],'total':_0x46bdb2['total'],'type':_0x46bdb2[_0xaf42('0x57')],'unmanaged':_0x46bdb2[_0xaf42('0x58')],'abandoned':_0x46bdb2[_0xaf42('0x59')],'waiting':_0x46bdb2[_0xaf42('0x32')]};if(_0x46bdb2[_0xaf42('0x5a')]){_0x14faf6[_0xaf42('0x5a')]={'id':_0x46bdb2[_0xaf42('0x5a')]['id'],'name':_0x46bdb2[_0xaf42('0x5a')][_0xaf42('0x4c')],'active':_0x46bdb2[_0xaf42('0x5a')][_0xaf42('0x5b')],'callerid':_0x46bdb2[_0xaf42('0x5a')][_0xaf42('0x5c')]};}if(_0x46bdb2[_0xaf42('0x5d')]){_0x14faf6[_0xaf42('0x5d')]={'id':_0x46bdb2['Interval']['id'],'name':_0x46bdb2[_0xaf42('0x5d')]['name']};}var _0x2388bf=md5(JSON[_0xaf42('0x5e')](_0x14faf6));if(_0x46bdb2['md5']!==_0x2388bf){_0x46bdb2[_0xaf42('0x2')]=_0x2388bf;logger[_0xaf42('0x46')](_0xaf42('0x5f')+_0x32bdc7+_0xaf42('0x60'),util['inspect'](_0x14faf6,{'showHidden':![],'depth':null}));this['emit'](util[_0xaf42('0x4a')](_0xaf42('0x4b'),_0x14faf6[_0xaf42('0x4c')]),_0xaf42('0x61'),_0x14faf6);}}};VoiceQueueReport['prototype'][_0xaf42('0x62')]=function(_0x578421){return _0x578421!==null&&!_[_0xaf42('0x63')](_0x578421);};VoiceQueueReport[_0xaf42('0xb')]['loopQueueShow']=function(){var _0x311987=this;setInterval(function(){_0x311987[_0xaf42('0x34')]();ami[_0xaf42('0x37')]({'action':_0xaf42('0x64')})[_0xaf42('0x3a')](function(_0x5070e0){logger[_0xaf42('0x3d')]('[voiceQueueReport][queues]',util['inspect'](_0x5070e0,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xaf42('0xb')]['loopQueueSummary']=function(){var _0xa76cd=this;setInterval(function(){if(_0xa76cd[_0xaf42('0x13')]){return ami[_0xaf42('0x37')]({'action':_0xaf42('0x16')})['then'](function(){_0xa76cd[_0xaf42('0x13')]=![];})[_0xaf42('0x3a')](function(_0x156298){logger['error'](_0xaf42('0x65'),util['inspect'](_0x156298,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xaf42('0xb')][_0xaf42('0x17')]=function(_0x546d17){try{if(this[_0xaf42('0x62')](_0x546d17)&&this[_0xaf42('0x62')](_0x546d17[_0xaf42('0x66')])){logger[_0xaf42('0x46')](_0xaf42('0x67'),util['inspect'](_0x546d17,{'showHidden':![],'depth':null}));if(this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]]){logger['info'](_0xaf42('0x68'),_0x546d17['queue']);var _0x34f92d=_[_0xaf42('0x69')](this['channels'],_0xaf42('0x66'))[_0x546d17[_0xaf42('0x66')]]||0x0;var _0x1d3c95=_0x34f92d-_0x546d17[_0xaf42('0x6a')];if(this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]][_0xaf42('0x32')]!==_[_0xaf42('0x6b')](_0x546d17[_0xaf42('0x6a')])||this[_0xaf42('0x12')][_0x546d17['queue']][_0xaf42('0x54')]!==_[_0xaf42('0x6b')](_0x546d17[_0xaf42('0x6c')])||this['voiceQueues'][_0x546d17[_0xaf42('0x66')]][_0xaf42('0x53')]!==_['toNumber'](_0x546d17[_0xaf42('0x53')])||this['voiceQueues'][_0x546d17[_0xaf42('0x66')]][_0xaf42('0x30')]!==_0x1d3c95){this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]][_0xaf42('0x32')]=_[_0xaf42('0x6b')](_0x546d17['callers']);this['voiceQueues'][_0x546d17['queue']]['loggedIn']=_[_0xaf42('0x6b')](_0x546d17[_0xaf42('0x6c')]);this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]][_0xaf42('0x53')]=_[_0xaf42('0x6b')](_0x546d17[_0xaf42('0x53')]);this[_0xaf42('0x12')][_0x546d17['queue']][_0xaf42('0x30')]=_0x1d3c95>0x0?_0x1d3c95:0x0;this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]][_0xaf42('0x30')]=this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]][_0xaf42('0x30')]>_['toNumber'](_0x546d17[_0xaf42('0x6c')])?_[_0xaf42('0x6b')](_0x546d17[_0xaf42('0x6c')]):this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]][_0xaf42('0x30')];this['emitVoiceQueueSummary'](this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]],'queuesummary');}logger[_0xaf42('0x46')](_0xaf42('0x6d'),util[_0xaf42('0x3f')](this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]],{'showHidden':![],'depth':null}));ami[_0xaf42('0x49')](_0xaf42('0x6e'),this[_0xaf42('0x12')][_0x546d17[_0xaf42('0x66')]]);}}}catch(_0x2270b6){logger['error'](_0xaf42('0x65'),util['inspect'](_0x2270b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaf42('0x6f')]=function(_0x3bdd83){logger[_0xaf42('0x46')](_0xaf42('0x70'),util['inspect'](_0x3bdd83,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xaf42('0x19')]=function(_0x4c3f17){try{if(this[_0xaf42('0x62')](_0x4c3f17)){logger[_0xaf42('0x46')](_0xaf42('0x71'),_0x4c3f17[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x4c3f17,{'showHidden':![],'depth':null}));if(_[_0xaf42('0x63')](this[_0xaf42('0xf')][_0x4c3f17[_0xaf42('0x48')]]))this['queueReports'][_0x4c3f17[_0xaf42('0x48')]]=[];if(_[_0xaf42('0x63')](this[_0xaf42('0x11')][_0x4c3f17[_0xaf42('0x48')]]))this['channels'][_0x4c3f17[_0xaf42('0x48')]]={};var _0x30d6e3=new QueueReport();_0x30d6e3[_0xaf42('0x4c')]=_0x4c3f17[_0xaf42('0x66')];_0x30d6e3[_0xaf42('0x57')]=this[_0xaf42('0x12')][_0x30d6e3['name']]&&this[_0xaf42('0x12')][_0x30d6e3[_0xaf42('0x4c')]][_0xaf42('0x57')]?this[_0xaf42('0x12')][_0x30d6e3['name']][_0xaf42('0x57')]||_0xaf42('0x51'):_0xaf42('0x51');_0x30d6e3[_0xaf42('0x66')]=_0x4c3f17[_0xaf42('0x66')];_0x30d6e3[_0xaf42('0x72')]=moment()[_0xaf42('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x30d6e3[_0xaf42('0x73')]=_0x4c3f17['position'];_0x30d6e3[_0xaf42('0x74')]=_0x4c3f17['count'];_0x30d6e3[_0xaf42('0x48')]=_0x4c3f17[_0xaf42('0x48')];_0x30d6e3[_0xaf42('0x75')]=this[_0xaf42('0x11')][_0x4c3f17[_0xaf42('0x48')]]['routealias'];logger[_0xaf42('0x76')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x30d6e3['name'],_0x30d6e3[_0xaf42('0x57')]);_[_0xaf42('0x77')](_0x30d6e3,_[_0xaf42('0x78')](_0x4c3f17,_[_0xaf42('0x79')](_0x30d6e3)));this['queueReports'][_0x4c3f17[_0xaf42('0x48')]][_0xaf42('0x7a')](_0x30d6e3);this[_0xaf42('0x11')][_0x4c3f17[_0xaf42('0x48')]]=_0x30d6e3;this[_0xaf42('0x45')](_0x30d6e3,_0xaf42('0x7b'));}}catch(_0x2a90dc){logger['error'](_0xaf42('0x71'),_0x4c3f17['uniqueid'],util[_0xaf42('0x3f')](_0x2a90dc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaf42('0xb')][_0xaf42('0x1b')]=function(_0x5e94ef){try{if(this[_0xaf42('0x62')](_0x5e94ef)){logger['debug'](_0xaf42('0x7c'),_0x5e94ef[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x5e94ef,{'showHidden':![],'depth':null}));if(this[_0xaf42('0xf')][_0x5e94ef[_0xaf42('0x48')]]){var _0x2f2aa8=_['last'](this[_0xaf42('0xf')][_0x5e94ef['uniqueid']]);_0x2f2aa8[_0xaf42('0x7d')]=![];_0x2f2aa8['queuecallercompleteAt']=null;_0x2f2aa8[_0xaf42('0x7e')]=_0x5e94ef[_0xaf42('0x7e')];_0x2f2aa8[_0xaf42('0x7f')]=_0x5e94ef[_0xaf42('0x7f')];_0x2f2aa8[_0xaf42('0x1a')]=!![];_0x2f2aa8[_0xaf42('0x80')]=moment()[_0xaf42('0x4a')](_0xaf42('0x81'));_0x2f2aa8[_0xaf42('0x82')]=_0xaf42('0x83');_0x2f2aa8[_0xaf42('0x84')]=null;logger['info'](_0xaf42('0x85'),_0x2f2aa8['name'],_0x2f2aa8[_0xaf42('0x57')]);this[_0xaf42('0x11')][_0x5e94ef[_0xaf42('0x48')]]=_0x2f2aa8;this[_0xaf42('0x43')](_0x2f2aa8,_0xaf42('0x1a'));}}}catch(_0x4fa7f0){logger[_0xaf42('0x3d')](_0xaf42('0x7c'),_0x5e94ef[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x4fa7f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaf42('0xb')]['syncQueueCallerLeave']=function(_0x3de290){try{if(this[_0xaf42('0x62')](_0x3de290)){logger[_0xaf42('0x46')](_0xaf42('0x86'),_0x3de290['uniqueid'],util['inspect'](_0x3de290,{'showHidden':![],'depth':null}));if(this[_0xaf42('0xf')][_0x3de290[_0xaf42('0x48')]]){var _0x36cfa2=_['last'](this[_0xaf42('0xf')][_0x3de290[_0xaf42('0x48')]]);_0x36cfa2[_0xaf42('0x87')]=moment()[_0xaf42('0x4a')](_0xaf42('0x81'));_0x36cfa2[_0xaf42('0x88')]=_0x3de290[_0xaf42('0x88')];_0x36cfa2[_0xaf42('0x89')]=_0x3de290[_0xaf42('0x89')];logger[_0xaf42('0x76')](_0xaf42('0x8a'),_0x36cfa2[_0xaf42('0x4c')],_0x36cfa2['type'],_0x3de290[_0xaf42('0x88')],_0x3de290[_0xaf42('0x89')]);this['channels'][_0x3de290[_0xaf42('0x48')]]=_0x36cfa2;this[_0xaf42('0x45')](_0x36cfa2,'queuecallerleave');}}}catch(_0x40a3f5){logger[_0xaf42('0x3d')](_0xaf42('0x86'),_0x3de290[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x40a3f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaf42('0xb')][_0xaf42('0x20')]=function(_0x213648){try{if(this['isNotNull'](_0x213648)){logger[_0xaf42('0x46')](_0xaf42('0x8b'),_0x213648[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x213648,{'showHidden':![],'depth':null}));if(this[_0xaf42('0xf')][_0x213648['uniqueid']]){var _0x4621de=_['last'](this[_0xaf42('0xf')][_0x213648[_0xaf42('0x48')]]);_0x4621de[_0xaf42('0x7d')]=!![];_0x4621de[_0xaf42('0x82')]=_0xaf42('0x8c');logger[_0xaf42('0x76')](_0xaf42('0x8d'),_0x4621de[_0xaf42('0x4c')],_0x4621de[_0xaf42('0x57')]);}}}catch(_0x40e31c){logger['error'](_0xaf42('0x8b'),_0x213648[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x40e31c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaf42('0xb')]['syncAgentComplete']=function(_0x52ec39){try{if(this[_0xaf42('0x62')](_0x52ec39)){logger[_0xaf42('0x46')](_0xaf42('0x8e'),_0x52ec39['uniqueid'],util[_0xaf42('0x3f')](_0x52ec39,{'showHidden':![],'depth':null}));if(this[_0xaf42('0xf')][_0x52ec39['uniqueid']]){var _0x3fe86d=_['last'](this['queueReports'][_0x52ec39['uniqueid']]);_0x3fe86d[_0xaf42('0x1a')]=![];_0x3fe86d[_0xaf42('0x80')]=null;_0x3fe86d[_0xaf42('0x8f')]=!![];_0x3fe86d[_0xaf42('0x84')]=_0x52ec39[_0xaf42('0x90')];_0x3fe86d[_0xaf42('0x7e')]=_0x52ec39[_0xaf42('0x7e')];_0x3fe86d[_0xaf42('0x7d')]=!![];_0x3fe86d[_0xaf42('0x91')]=![];_0x3fe86d[_0xaf42('0x92')]=null;if(!_0x3fe86d['transfer']){if(_0x52ec39[_0xaf42('0x93')]==_0xaf42('0x94')){_0x3fe86d['queuecallerexitreason']=_0xaf42('0x95');logger[_0xaf42('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3fe86d[_0xaf42('0x4c')],_0x3fe86d['type']);}else{if(_[_0xaf42('0x96')](_0x52ec39['channel']['toLowerCase'](),_0xaf42('0x97'))){if(this[_0xaf42('0xf')][_0x52ec39[_0xaf42('0x98')]]){var _0x3c3d25=_[_0xaf42('0x99')](this[_0xaf42('0xf')][_0x52ec39['linkedid']]);_0x3c3d25[_0xaf42('0x7d')]=![];_0x3c3d25['queuecallerexit']=!![];_0x3c3d25[_0xaf42('0x92')]=moment(_0x3fe86d[_0xaf42('0x72')])[_0xaf42('0x9a')](_0x52ec39[_0xaf42('0x7e')],_0xaf42('0x9b'))['format'](_0xaf42('0x81'));_0x3c3d25[_0xaf42('0x82')]=_0xaf42('0x9c');_0x3c3d25[_0xaf42('0x94')]=!![];_0x3c3d25[_0xaf42('0x9d')]=_0xaf42('0x9e');_0x3c3d25[_0xaf42('0x9f')]=_0x52ec39[_0xaf42('0xa0')];_0x3c3d25['transferuniqueid']=_0x52ec39[_0xaf42('0x48')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3c3d25[_0xaf42('0x4c')],_0x3c3d25[_0xaf42('0x57')]);var _0x3b6795=this[_0xaf42('0xf')][_0x52ec39[_0xaf42('0x98')]];this[_0xaf42('0xf')][_0x52ec39['linkedid']]=this[_0xaf42('0xf')][_0x52ec39[_0xaf42('0x48')]];this[_0xaf42('0xf')][_0x52ec39['uniqueid']]=_0x3b6795;}}else{_0x3fe86d[_0xaf42('0x82')]=_0xaf42('0xa1')+_0x52ec39['reason']['toUpperCase']();logger[_0xaf42('0x76')](_0xaf42('0xa2'),_0x3fe86d[_0xaf42('0x4c')],_0x3fe86d[_0xaf42('0x57')],_0x3fe86d[_0xaf42('0x82')]);}}}this[_0xaf42('0x11')][_0x52ec39[_0xaf42('0x48')]]=_0x3fe86d;this['emitVoiceQueueChannelRemove'](_0x3fe86d,_0xaf42('0x1e'));}}}catch(_0x94cba6){logger[_0xaf42('0x3d')](_0xaf42('0x8e'),_0x52ec39[_0xaf42('0x48')],util['inspect'](_0x94cba6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaf42('0x22')]=function(_0x3d42af){try{if(this[_0xaf42('0x62')](_0x3d42af)){logger['debug']('[%s][voiceQueueReport][varset]',_0x3d42af['uniqueid'],util[_0xaf42('0x3f')](_0x3d42af,{'showHidden':![],'depth':null}));this[_0xaf42('0xa3')](_0x3d42af[_0xaf42('0x48')],_[_0xaf42('0x79')](_0x3d42af[_0xaf42('0xa4')])[0x0],_0x3d42af[_0xaf42('0xa5')]);if(this['queueReports'][_0x3d42af[_0xaf42('0x48')]]){var _0x1875aa=_[_0xaf42('0x99')](this[_0xaf42('0xf')][_0x3d42af[_0xaf42('0x48')]]);if(_0x1875aa){if(this['isNotNull'](_0x3d42af[_0xaf42('0xa4')])&&this[_0xaf42('0x62')](_0x3d42af[_0xaf42('0xa4')][_0xaf42('0xa6')])){switch(_0x3d42af[_0xaf42('0xa5')]){case _0xaf42('0xa7'):_0x1875aa['queuecallerexit']=![];_0x1875aa['queuecallerexitAt']=null;break;case'TIMEOUT':_0x1875aa['lastevent']=_0xaf42('0xa8');_0x1875aa['queuecallerexit']=!![];_0x1875aa[_0xaf42('0x92')]=moment()['format'](_0xaf42('0x81'));_0x1875aa[_0xaf42('0x87')]=moment()[_0xaf42('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xaf42('0x46')](_0xaf42('0xa9'),_0x3d42af[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x1875aa,{'showHidden':![],'depth':null}));ami[_0xaf42('0x49')](_0xaf42('0xaa'),_0x1875aa);break;default:_0x1875aa[_0xaf42('0x91')]=!![];_0x1875aa['queuecallerexitAt']=moment()[_0xaf42('0x4a')](_0xaf42('0x81'));_0x1875aa[_0xaf42('0x87')]=moment()['format'](_0xaf42('0x81'));}_0x1875aa[_0xaf42('0x1a')]=![];_0x1875aa[_0xaf42('0x80')]=null;_0x1875aa['queuecallerexitreason']=_0x3d42af[_0xaf42('0xa5')];this[_0xaf42('0x11')][_0x3d42af[_0xaf42('0x48')]]=_0x1875aa;this[_0xaf42('0x43')](_0x1875aa,_0xaf42('0x21'));}else if(this['isNotNull'](_0x3d42af['variable'])&&this[_0xaf42('0x62')](_0x3d42af['variable'][_0xaf42('0xab')])){if(!_0x1875aa[_0xaf42('0x1a')]){_0x1875aa[_0xaf42('0x91')]=!![];_0x1875aa[_0xaf42('0x92')]=moment()[_0xaf42('0x4a')](_0xaf42('0x81'));_0x1875aa[_0xaf42('0x82')]=_0xaf42('0xac');_0x1875aa[_0xaf42('0x87')]=moment()[_0xaf42('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3d42af[_0xaf42('0x48')]]=_0x1875aa;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3d42af[_0xaf42('0x48')],_0x1875aa['name'],_0x1875aa['type'],_[_0xaf42('0x79')](_0x3d42af[_0xaf42('0xa4')])[0x0],_0x3d42af[_0xaf42('0xa5')]);_0x1875aa[_0xaf42('0x15')]=this[_0xaf42('0x15')][_0x3d42af[_0xaf42('0x48')]];}}}}catch(_0x193811){logger[_0xaf42('0x3d')](_0xaf42('0xad'),_0x3d42af[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x193811,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaf42('0xa3')]=function(_0x99efc9,_0x4811a9,_0x342545){var _0x3cbe52=[_0xaf42('0xae'),_0xaf42('0xaf'),_0xaf42('0xb0'),_0xaf42('0xb1'),'rtpaudioqosloss',_0xaf42('0xb2'),_0xaf42('0xb3'),_0xaf42('0xb4'),_0xaf42('0xb5'),_0xaf42('0xb6'),_0xaf42('0xb7'),_0xaf42('0xb8'),'membercalls',_0xaf42('0xb9'),_0xaf42('0xba'),_0xaf42('0xbb'),_0xaf42('0x90'),_0xaf42('0xbc'),_0xaf42('0xbd')];if(!_[_0xaf42('0x36')](_0x4811a9)&&!_[_0xaf42('0xbe')](_0x3cbe52,_0x4811a9)){if(_[_0xaf42('0x63')](this[_0xaf42('0x15')][_0x99efc9])){this[_0xaf42('0x15')][_0x99efc9]={};}this[_0xaf42('0x15')][_0x99efc9][_0x4811a9]=_0x342545;}};VoiceQueueReport[_0xaf42('0xb')][_0xaf42('0x24')]=function(_0x50074d){try{if(this['isNotNull'](_0x50074d)){logger[_0xaf42('0x46')](_0xaf42('0xbf'),_0x50074d[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x50074d,{'showHidden':![],'depth':null}));if(this[_0xaf42('0xf')][_0x50074d[_0xaf42('0x48')]]){for(var _0xf0c2b5=0x0,_0x22e8c9={};_0xf0c2b5<this[_0xaf42('0xf')][_0x50074d[_0xaf42('0x48')]][_0xaf42('0xc0')];_0xf0c2b5+=0x1){_0x22e8c9=this[_0xaf42('0xf')][_0x50074d[_0xaf42('0x48')]][_0xf0c2b5];if(this[_0xaf42('0x12')][_0x22e8c9[_0xaf42('0x66')]]){if(_0x22e8c9[_0xaf42('0x91')]&&_0x22e8c9[_0xaf42('0x94')]!=!![]){this[_0xaf42('0x12')][_0x22e8c9[_0xaf42('0x66')]]['unmanaged']+=0x1;}if(_0x22e8c9[_0xaf42('0x1a')]){this[_0xaf42('0x12')][_0x22e8c9[_0xaf42('0x66')]][_0xaf42('0x59')]+=0x1;}this['voiceQueues'][_0x22e8c9[_0xaf42('0x66')]][_0xaf42('0x56')]+=moment(_0x22e8c9[_0xaf42('0x87')])['diff'](_0x22e8c9['queuecallerjoinAt'],_0xaf42('0x9b'))||0x0;if(_0xf0c2b5===this['queueReports'][_0x50074d['uniqueid']][_0xaf42('0xc0')]-0x1){this[_0xaf42('0x12')][_0x22e8c9[_0xaf42('0x66')]][_0xaf42('0x55')]+=moment()[_0xaf42('0xc1')](0x0)[_0xaf42('0xc2')](_0x22e8c9['queuecallerjoinAt'],_0xaf42('0x9b'));this[_0xaf42('0x12')][_0x22e8c9[_0xaf42('0x66')]][_0xaf42('0xc3')]+=0x1;if(_0x22e8c9[_0xaf42('0x7d')]){this[_0xaf42('0x12')][_0x22e8c9[_0xaf42('0x66')]][_0xaf42('0xc4')]+=0x1;this[_0xaf42('0x12')][_0x22e8c9[_0xaf42('0x66')]][_0xaf42('0xc5')]+=moment()['milliseconds'](0x0)[_0xaf42('0xc2')](_0x22e8c9[_0xaf42('0x87')],_0xaf42('0x9b'));_0x22e8c9[_0xaf42('0xc6')]=moment()[_0xaf42('0x4a')](_0xaf42('0x81'));_0x22e8c9[_0xaf42('0x91')]=![];_0x22e8c9[_0xaf42('0x92')]=null;}if(_0x22e8c9[_0xaf42('0x91')]&&_0x22e8c9['transfer']!=!![]){_0x22e8c9[_0xaf42('0xc7')]=_0xaf42('0x58');logger[_0xaf42('0x46')](_0xaf42('0xc8'),_0x50074d[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x22e8c9,{'showHidden':![],'depth':null}));ami[_0xaf42('0x49')]('custom:queuecallerunmanaged',_0x22e8c9);}if(_0x22e8c9['queuecallerabandon']){_0x22e8c9[_0xaf42('0xc7')]=_0xaf42('0x59');logger[_0xaf42('0x46')](_0xaf42('0xc9'),_0x50074d['uniqueid'],util[_0xaf42('0x3f')](_0x22e8c9,{'showHidden':![],'depth':null}));ami[_0xaf42('0x49')]('custom:queuecallerabandon',_0x22e8c9);}}else{this[_0xaf42('0x12')][_0x22e8c9['queue']][_0xaf42('0x55')]+=this['voiceQueues'][_0x22e8c9[_0xaf42('0x66')]][_0xaf42('0x56')];}logger[_0xaf42('0x76')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x50074d['uniqueid'],_0x22e8c9[_0xaf42('0x4c')],_0x22e8c9['type'],_0x50074d['cause-txt']);this[_0xaf42('0x11')][_0x50074d[_0xaf42('0x48')]]=_0x22e8c9;this['emitVoiceQueueChannelRemove'](_0x22e8c9,'hangup');this[_0xaf42('0x50')](this[_0xaf42('0x12')][_0x22e8c9[_0xaf42('0x66')]],_0xaf42('0x23'));}}logger['debug'](_0xaf42('0xca'),_0x50074d[_0xaf42('0x48')],util[_0xaf42('0x3f')](this['queueReports'][_0x50074d['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xaf42('0x49')]('custom:voiceQueueReport',this[_0xaf42('0xf')][_0x50074d[_0xaf42('0x48')]]);if(_0x22e8c9['queuecallerexitreason']===_0xaf42('0xcb'))return;delete this[_0xaf42('0xf')][_0x50074d[_0xaf42('0x48')]];delete this[_0xaf42('0x11')][_0x50074d['uniqueid']];}if(this[_0xaf42('0x15')][_0x50074d['uniqueid']]){delete this['variables'][_0x50074d['uniqueid']];}}}catch(_0x55f23f){logger['error']('[%s][voiceQueueReport][hangup]',_0x50074d[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x55f23f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaf42('0x29')]=function(_0x59f61f){try{if(this['isNotNull'](_0x59f61f)){logger[_0xaf42('0x46')](_0xaf42('0xcc'),_0x59f61f['uniqueid'],util[_0xaf42('0x3f')](_0x59f61f,{'showHidden':![],'depth':null}));var _0x5132ae;var _0x495bb0;var _0x1de1f3;if(this['queueReports'][_0x59f61f['transfereeuniqueid']]){_0x5132ae=_[_0xaf42('0x99')](this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xcd')]]);_0x5132ae[_0xaf42('0x9f')]=_0x59f61f[_0xaf42('0xce')];_0x5132ae[_0xaf42('0xcf')]=_0x59f61f[_0xaf42('0xd0')];_0x5132ae[_0xaf42('0x82')]='ATTENDEDTRANSFER';_0x5132ae[_0xaf42('0x94')]=!![];_0x5132ae[_0xaf42('0x9d')]=_0xaf42('0xd1');if(this['queueReports'][_0x59f61f[_0xaf42('0xd0')]]){_0x1de1f3=this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd0')]];this['queueReports'][_0x59f61f[_0xaf42('0xd0')]]=this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xcd')]];this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xcd')]]=_0x1de1f3;_0x495bb0=_['last'](this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xcd')]]);_0x495bb0[_0xaf42('0x35')]=!![];}logger[_0xaf42('0x76')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x59f61f[_0xaf42('0x48')],_0x5132ae['name'],_0x5132ae[_0xaf42('0x57')],_0x5132ae[_0xaf42('0x9f')],_0x5132ae[_0xaf42('0xcf')]);}else if(this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd2')]]){_0x5132ae=_[_0xaf42('0x99')](this[_0xaf42('0xf')][_0x59f61f['transfertargetuniqueid']]);_0x5132ae[_0xaf42('0x9f')]=_0x59f61f[_0xaf42('0xd3')];_0x5132ae['transferuniqueid']=_0x59f61f[_0xaf42('0xd4')];_0x5132ae[_0xaf42('0x82')]=_0xaf42('0xcb');_0x5132ae[_0xaf42('0x94')]=!![];_0x5132ae[_0xaf42('0x9d')]=_0xaf42('0xd1');if(this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd4')]]){_0x1de1f3=this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd4')]];this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd4')]]=this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd2')]];this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd2')]]=_0x1de1f3;_0x495bb0=_['last'](this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd2')]]);_0x495bb0[_0xaf42('0x35')]=!![];}logger[_0xaf42('0x76')](_0xaf42('0xd5'),_0x59f61f['uniqueid'],_0x5132ae[_0xaf42('0x4c')],_0x5132ae[_0xaf42('0x57')],_0x5132ae[_0xaf42('0x9f')],_0x5132ae[_0xaf42('0xcf')]);}else if(this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd4')]]){_0x5132ae=_[_0xaf42('0x99')](this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd4')]]);_0x5132ae[_0xaf42('0x9f')]=_0x59f61f[_0xaf42('0xd3')];_0x5132ae[_0xaf42('0xcf')]=_0x59f61f[_0xaf42('0xd4')];_0x5132ae['queuecallerexitreason']=_0xaf42('0xcb');_0x5132ae['transfer']=!![];_0x5132ae[_0xaf42('0x9d')]=_0xaf42('0xd1');}else if(this['queueReports'][_0x59f61f[_0xaf42('0xd0')]]){_0x5132ae=_[_0xaf42('0x99')](this[_0xaf42('0xf')][_0x59f61f[_0xaf42('0xd0')]]);_0x5132ae[_0xaf42('0x9f')]=_0x59f61f['secondtransfererexten'];_0x5132ae[_0xaf42('0xcf')]=_0x59f61f[_0xaf42('0xd0')];_0x5132ae['queuecallerexitreason']=_0xaf42('0xcb');_0x5132ae['transfer']=!![];_0x5132ae[_0xaf42('0x9d')]=_0xaf42('0xd1');}}}catch(_0xc8740a){logger[_0xaf42('0x3d')]('[%s][voiceQueueReport][attendedtransfer]',_0x59f61f['uniqueid'],util[_0xaf42('0x3f')](_0xc8740a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaf42('0xb')][_0xaf42('0x2b')]=function(_0xb0a77b){try{if(this[_0xaf42('0x62')](_0xb0a77b)){logger[_0xaf42('0x46')]('[%s][voiceQueueReport][blindtransfer]',_0xb0a77b[_0xaf42('0x48')],util['inspect'](_0xb0a77b,{'showHidden':![],'depth':null}));if(this[_0xaf42('0xf')][_0xb0a77b[_0xaf42('0xcd')]]){var _0x2f5870=_['last'](this[_0xaf42('0xf')][_0xb0a77b['transfereeuniqueid']]);_0x2f5870[_0xaf42('0x82')]=_0xaf42('0xd6');_0x2f5870[_0xaf42('0x94')]=!![];_0x2f5870[_0xaf42('0x9d')]=_0xaf42('0xd7');_0x2f5870[_0xaf42('0x9f')]=_0xb0a77b[_0xaf42('0xd8')];_0x2f5870[_0xaf42('0xcf')]=_0xb0a77b['transfereeuniqueid'];logger['info']('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0xb0a77b['uniqueid'],_0x2f5870[_0xaf42('0x4c')],_0x2f5870[_0xaf42('0x57')],_0x2f5870[_0xaf42('0x9f')],_0x2f5870['transferuniqueid']);this[_0xaf42('0x24')]({'event':_0xaf42('0xd9'),'uniqueid':_0xb0a77b['transfereeuniqueid'],'context':_0xb0a77b[_0xaf42('0xda')],'channel':_0xb0a77b[_0xaf42('0xdb')]});}}}catch(_0x154e5b){logger['error'](_0xaf42('0xdc'),_0xb0a77b[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x154e5b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaf42('0xb')][_0xaf42('0xdd')]=function(_0x5b04c8){try{if(this[_0xaf42('0x62')](_0x5b04c8)){logger['debug'](_0xaf42('0xde'),_0x5b04c8[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x5b04c8,{'showHidden':![],'depth':null}));if(this[_0xaf42('0xf')][_0x5b04c8['uniqueid']]){var _0x4a9643=_[_0xaf42('0x99')](this[_0xaf42('0xf')][_0x5b04c8['uniqueid']]);if(!_[_0xaf42('0x36')](_0x4a9643['queuecallerleaveAt'])){_0x4a9643[_0xaf42('0xdf')]=moment()['format'](_0xaf42('0x81'));logger[_0xaf42('0x76')](_0xaf42('0xe0'),_0x5b04c8[_0xaf42('0x48')],_0x4a9643[_0xaf42('0xdf')]);}}}}catch(_0x444527){logger[_0xaf42('0x3d')](_0xaf42('0xde'),_0x5b04c8['uniqueid'],util[_0xaf42('0x3f')](_0x444527,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaf42('0x27')]=function(_0x8e1ceb){try{if(this[_0xaf42('0x62')](_0x8e1ceb)){logger[_0xaf42('0x46')]('[%s][voiceQueueReport][musiconholdstop]',_0x8e1ceb[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x8e1ceb,{'showHidden':![],'depth':null}));if(this[_0xaf42('0xf')][_0x8e1ceb[_0xaf42('0x48')]]){var _0x146134=_[_0xaf42('0x99')](this[_0xaf42('0xf')][_0x8e1ceb[_0xaf42('0x48')]]);if(!_[_0xaf42('0x36')](_0x146134[_0xaf42('0xdf')])){_0x146134[_0xaf42('0xe1')]+=moment()[_0xaf42('0xc1')](0x0)['diff'](_0x146134[_0xaf42('0xdf')],_0xaf42('0x9b'));logger[_0xaf42('0x76')](_0xaf42('0xe2'),_0x8e1ceb[_0xaf42('0x48')],_0x146134[_0xaf42('0xe1')]);delete _0x146134[_0xaf42('0xdf')];}}}}catch(_0x2078c4){logger[_0xaf42('0x3d')](_0xaf42('0xe3'),_0x8e1ceb[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x2078c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaf42('0xb')]['syncNewExten']=function(_0x53c3fb){try{if(this['isNotNull'](_0x53c3fb)){logger[_0xaf42('0x46')](_0xaf42('0xe4'),_0x53c3fb[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x53c3fb,{'showHidden':![],'depth':null}));if(_0x53c3fb[_0xaf42('0xe5')][_0xaf42('0xe6')]()===_0xaf42('0xe7')){_0x53c3fb['applicationdata']=_0x53c3fb[_0xaf42('0xe8')]&&_0x53c3fb['appdata']['startsWith'](_0xaf42('0xe9'))?_0x53c3fb[_0xaf42('0xe8')]:(_0x53c3fb['appdata']||_0x53c3fb[_0xaf42('0xea')])[_0xaf42('0xe6')]();if(_['startsWith'](_0x53c3fb[_0xaf42('0xea')]['toLowerCase'](),_0xaf42('0xeb'))){logger[_0xaf42('0x76')](_0xaf42('0xec'),_0x53c3fb[_0xaf42('0x48')],_0x53c3fb[_0xaf42('0xe5')],_0x53c3fb['applicationdata']);if(_[_0xaf42('0x63')](this[_0xaf42('0x11')][_0x53c3fb[_0xaf42('0x48')]]))this[_0xaf42('0x11')][_0x53c3fb[_0xaf42('0x48')]]={};var _0x155269=_0x53c3fb[_0xaf42('0xea')]['split']('=');var _0x359cc4=_0x155269[0x0]['toLowerCase']()[_0xaf42('0xed')](/cdr\((.*)\)/);if(_0x359cc4)this['channels'][_0x53c3fb[_0xaf42('0x48')]][_0x359cc4[0x1]]=_0x155269[0x1];}}}}catch(_0x1907ba){logger[_0xaf42('0x3d')]('[%s][voiceQueueReport][newexten]',_0x53c3fb[_0xaf42('0x48')],util[_0xaf42('0x3f')](_0x1907ba,{'showHidden':![],'depth':null}));}};module[_0xaf42('0xee')]=VoiceQueueReport;
\ No newline at end of file
index ad7b4b9..8c38463 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dff=['Request','CreateReportAgentPreview','createHistory','campaign','queue'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x1dff,0x1b0));var _0xf1df=function(_0xa7efd7,_0x45c885){_0xa7efd7=_0xa7efd7-0x0;var _0x572019=_0x1dff[_0xa7efd7];return _0x572019;};'use strict';var client=require('../client');exports[_0xf1df('0x0')]=function(_0x435de1){return function(){_0x435de1[_0xf1df('0x1')]=_0x435de1[_0xf1df('0x2')];return client[_0xf1df('0x3')](_0xf1df('0x4'),{'body':_0x435de1,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
+var _0xfd48=['createHistory','Request','CreateReportAgentPreview','../client'];(function(_0xc2edfc,_0x3c9fc4){var _0x18ddd7=function(_0x38db2e){while(--_0x38db2e){_0xc2edfc['push'](_0xc2edfc['shift']());}};_0x18ddd7(++_0x3c9fc4);}(_0xfd48,0x97));var _0x8fd4=function(_0x12b09d,_0x59f40c){_0x12b09d=_0x12b09d-0x0;var _0xa18dc2=_0xfd48[_0x12b09d];return _0xa18dc2;};'use strict';var client=require(_0x8fd4('0x0'));exports[_0x8fd4('0x1')]=function(_0x3c53a2){return function(){_0x3c53a2['campaign']=_0x3c53a2['queue'];return client[_0x8fd4('0x2')](_0x8fd4('0x3'),{'body':_0x3c53a2,'log':_0x8fd4('0x3')});};};
\ No newline at end of file
index 69814d4..37163f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b35=['create','Request'];(function(_0x27372f,_0x1adb33){var _0x3548df=function(_0x581439){while(--_0x581439){_0x27372f['push'](_0x27372f['shift']());}};_0x3548df(++_0x1adb33);}(_0x6b35,0x6e));var _0x56b3=function(_0x186bba,_0x51078e){_0x186bba=_0x186bba-0x0;var _0x58f3f3=_0x6b35[_0x186bba];return _0x58f3f3;};'use strict';var client=require('../client');exports[_0x56b3('0x0')]=function(_0x1740dc){return client[_0x56b3('0x1')]('CreateAttachment',{'body':_0x1740dc,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0x6002=['Request','CreateAttachment','../client','create'];(function(_0x3db27a,_0xb8a86d){var _0xb9de5b=function(_0x5cccd3){while(--_0x5cccd3){_0x3db27a['push'](_0x3db27a['shift']());}};_0xb9de5b(++_0xb8a86d);}(_0x6002,0xfe));var _0x2600=function(_0x3e3724,_0x56eccf){_0x3e3724=_0x3e3724-0x0;var _0x4de33e=_0x6002[_0x3e3724];return _0x4de33e;};'use strict';var client=require(_0x2600('0x0'));exports[_0x2600('0x1')]=function(_0x434055){return client[_0x2600('0x2')](_0x2600('0x3'),{'body':_0x434055,'log':'CreateAttachment'});};
\ No newline at end of file
index e84fa17..9e26dd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','active','TrunkBackup','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x2ef3,0xba));var _0x32ef=function(_0x11faac,_0x337d90){_0x11faac=_0x11faac-0x0;var _0xa227e6=_0x2ef3[_0x11faac];return _0xa227e6;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),_0x32ef('0x5'),'active',_0x32ef('0x6'),_0x32ef('0x7'),'dialOriginateCallerIdNumber',_0x32ef('0x8'),_0x32ef('0x9'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'dialAMDActive',_0x32ef('0x18'),'dialAMDGreeting',_0x32ef('0x19'),'dialAMDTotalAnalysisTime',_0x32ef('0x1a'),_0x32ef('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x32ef('0x1c'),'dialOrderByScheduledAt',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f')],'include':[{'model':_0x32ef('0x20'),'as':'Trunk','attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x20'),'as':_0x32ef('0x22'),'attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x23'),'as':_0x32ef('0x23'),'attributes':['id','name'],'include':[{'model':_0x32ef('0x23'),'as':_0x32ef('0x24'),'attributes':['id','name',_0x32ef('0x25')]}]},{'model':_0x32ef('0x26'),'as':_0x32ef('0x26'),'attributes':['id',_0x32ef('0x4')]}]},'log':_0x32ef('0x27')});};};
\ No newline at end of file
+var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x5b3419,_0xf30ac){var _0x409e35=function(_0x4621d7){while(--_0x4621d7){_0x5b3419['push'](_0x5b3419['shift']());}};_0x409e35(++_0xf30ac);}(_0x326f,0xd1));var _0xf326=function(_0x1b9d2a,_0x48817a){_0x1b9d2a=_0x1b9d2a-0x0;var _0x221108=_0x326f[_0x1b9d2a];return _0x221108;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};};
\ No newline at end of file
index d49fe5f..d50c1da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x989f=['getContacts','GetCmContact','createContact','Request'];(function(_0x481af3,_0x483fac){var _0x3354ea=function(_0x2e3de5){while(--_0x2e3de5){_0x481af3['push'](_0x481af3['shift']());}};_0x3354ea(++_0x483fac);}(_0x989f,0x1a6));var _0xf989=function(_0x1436da,_0x5a1663){_0x1436da=_0x1436da-0x0;var _0x570860=_0x989f[_0x1436da];return _0x570860;};'use strict';var client=require('../client');exports[_0xf989('0x0')]=function(_0x2e7a43){return function(){return client[_0xf989('0x1')]('CreateCmContact',{'body':_0x2e7a43,'log':'CreateCmContact'});};};exports[_0xf989('0x2')]=function(_0x31e85d){return function(){return client[_0xf989('0x1')](_0xf989('0x3'),{'options':_0x31e85d,'log':_0xf989('0x3')});};};
\ No newline at end of file
+var _0xfd9c=['GetCmContact','../client','Request','CreateCmContact','getContacts'];(function(_0x5227d8,_0x238d81){var _0x202480=function(_0x50bb27){while(--_0x50bb27){_0x5227d8['push'](_0x5227d8['shift']());}};_0x202480(++_0x238d81);}(_0xfd9c,0x79));var _0xcfd9=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xfd9c[_0x3ed054];return _0x16dd95;};'use strict';var client=require(_0xcfd9('0x0'));exports['createContact']=function(_0x58b909){return function(){return client[_0xcfd9('0x1')]('CreateCmContact',{'body':_0x58b909,'log':_0xcfd9('0x2')});};};exports[_0xcfd9('0x3')]=function(_0x59abe1){return function(){return client['Request'](_0xcfd9('0x4'),{'options':_0x59abe1,'log':_0xcfd9('0x4')});};};
\ No newline at end of file
index 5b2b2bd..226f673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1b4=['destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat','getContactDialerIvr','ASC','moveContactManagedDialer','campaign','MoveContactManagedDialer','countReScheduled','getContactPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','voicePause','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','Request','GetCmHopper','CmContact','Contact','updateContacts','UpdateCmHopper','format','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0xa1b4,0x111));var _0x4a1b=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0xa1b4[_0x37e886];return _0x57c5cd;};'use strict';var client=require(_0x4a1b('0x0'));var moment=require(_0x4a1b('0x1'));var _=require('lodash');exports['getContacts']=function(_0x2689b8,_0x4fdad3){return function(){return client[_0x4a1b('0x2')](_0x4a1b('0x3'),{'options':{'where':{'VoiceQueueId':_0x2689b8},'include':[{'model':_0x4a1b('0x4'),'as':_0x4a1b('0x5')}],'limit':_0x4fdad3,'raw':![]},'log':'getCmHopper'});};};exports[_0x4a1b('0x6')]=function(_0x4d2a17,_0x40ef1,_0x46b113){return function(){return client[_0x4a1b('0x2')](_0x4a1b('0x7'),{'body':_0x4d2a17,'options':{'where':{'VoiceQueueId':_0x40ef1,'scheduledat':{'$lte':moment()[_0x4a1b('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x46b113},'log':'UpdateCmHopper'});};};exports[_0x4a1b('0x9')]=function(_0x19057f){return function(){return client['Request'](_0x4a1b('0x7'),{'body':_0x19057f,'options':{'where':{'ContactId':_0x19057f[_0x4a1b('0xa')],'ListId':_0x19057f[_0x4a1b('0xb')],'VoiceQueueId':_0x19057f[_0x4a1b('0xc')],'CampaignId':_0x19057f[_0x4a1b('0xd')]}},'log':_0x4a1b('0x9')});};};exports[_0x4a1b('0xe')]=function(_0xb8845,_0x891d3a,_0x43abc7){return function(){return client[_0x4a1b('0x2')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0xb8845,'ListId':_0x891d3a,'ContactId':_0x43abc7}},'log':_0x4a1b('0xf')});};};exports[_0x4a1b('0x10')]=function(_0x52c6cf,_0x55cca1,_0x45dc64,_0x56d343){return function(){return client['Request'](_0x4a1b('0x11'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x52c6cf,'active':![],'scheduledat':{'$lte':moment()[_0x4a1b('0x8')](_0x4a1b('0x12'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x55cca1}}]},'order':[[_0x4a1b('0x13'),_0x4a1b('0x14')],[_0x4a1b('0x15'),_0x56d343],['id','ASC']],'raw':!![],'limit':_0x45dc64},'log':'GetContactDialer'});};};exports[_0x4a1b('0x16')]=function(_0x1f88ca,_0x11e896,_0x2d1553){return function(){return client[_0x4a1b('0x2')](_0x4a1b('0x11'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x1f88ca,'active':![],'scheduledat':{'$lte':moment()[_0x4a1b('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x4a1b('0x4'),'as':_0x4a1b('0x5')}],'order':[[_0x4a1b('0x13'),_0x4a1b('0x14')],[_0x4a1b('0x15'),_0x2d1553],['id',_0x4a1b('0x17')]],'raw':!![],'limit':_0x11e896},'log':'GetContactDialerIvr'});};};exports[_0x4a1b('0x18')]=function(_0x4898bd,_0x3b5bc6){return function(){_0x4898bd[_0x4a1b('0x19')]=_0x4898bd['queue'];return client[_0x4a1b('0x2')](_0x4a1b('0x1a'),{'body':_0x4898bd,'options':{'where':{'ContactId':_0x4898bd[_0x4a1b('0xa')],'ListId':_0x4898bd[_0x4a1b('0xb')],'VoiceQueueId':_0x4898bd[_0x4a1b('0xc')],'CampaignId':_0x4898bd[_0x4a1b('0xd')],'active':_0x3b5bc6?undefined:!![]}},'log':_0x4a1b('0x1a')});};};exports[_0x4a1b('0x1b')]=function(_0x253b7b){return function(){return client['Request']('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x253b7b['id']?_0x253b7b['id']||null:null}},'log':_0x4a1b('0x1b')});};};exports[_0x4a1b('0x1c')]=function(_0x56ef42){return function(){return client['Request']('GetCmHopperPreview',{'options':{'where':{'id':_0x56ef42},'include':[{'model':_0x4a1b('0x4'),'as':_0x4a1b('0x5')},{'model':_0x4a1b('0x1d'),'as':_0x4a1b('0x1e'),'attributes':['id',_0x4a1b('0x1f')]},{'model':_0x4a1b('0x20'),'as':_0x4a1b('0x21'),'attributes':['id',_0x4a1b('0x1f')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x4a1b('0x22')]=function(_0x505149,_0x4e321a,_0x3e6da6){return function(){return client[_0x4a1b('0x2')](_0x4a1b('0x7'),{'body':_0x505149,'options':{'where':{'id':_0x4e321a},'limit':_0x3e6da6},'log':'UpdateCmHopper'});};};exports[_0x4a1b('0x23')]=function(_0x2de3bb,_0x3c983c){return function(){return client[_0x4a1b('0x2')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x2de3bb,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x3c983c}},'order':[[_0x4a1b('0x13'),_0x4a1b('0x14')],[_0x4a1b('0x15'),'DESC'],['id',_0x4a1b('0x17')]],'include':[{'model':_0x4a1b('0x4'),'as':_0x4a1b('0x5')},{'model':_0x4a1b('0x1d'),'as':_0x4a1b('0x1e'),'attributes':['id',_0x4a1b('0x1f'),_0x4a1b('0x24')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x4a1b('0x11')});};};exports[_0x4a1b('0x25')]=function(_0xde3fb){return function(){return client[_0x4a1b('0x2')](_0x4a1b('0x26'),{'body':_0xde3fb,'options':{},'log':_0x4a1b('0x26')});};};exports[_0x4a1b('0x27')]=function(_0x403381,_0x5eb53f){return function(){return client[_0x4a1b('0x2')](_0x4a1b('0x28'),{'body':{'where':{'voiceQueueId':_0x403381,'interval':_0x5eb53f}},'log':_0x4a1b('0x27')});};};
\ No newline at end of file
+var _0x1804=['moment','lodash','getContacts','Request','GetCmHopper','CmContact','getCmHopper','updateContacts','UpdateCmHopper','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','format','YYYY-MM-DD\x20HH:mm:ss','DESC','scheduledat','ASC','getContactDialerIvr','Contact','priority','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','voicePause','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client'];(function(_0x2491b1,_0x28a48d){var _0x4d2c43=function(_0x5568cb){while(--_0x5568cb){_0x2491b1['push'](_0x2491b1['shift']());}};_0x4d2c43(++_0x28a48d);}(_0x1804,0x125));var _0x4180=function(_0x58476c,_0x4d89ba){_0x58476c=_0x58476c-0x0;var _0x166769=_0x1804[_0x58476c];return _0x166769;};'use strict';var client=require(_0x4180('0x0'));var moment=require(_0x4180('0x1'));var _=require(_0x4180('0x2'));exports[_0x4180('0x3')]=function(_0x542bc6,_0x3b9528){return function(){return client[_0x4180('0x4')](_0x4180('0x5'),{'options':{'where':{'VoiceQueueId':_0x542bc6},'include':[{'model':_0x4180('0x6'),'as':'Contact'}],'limit':_0x3b9528,'raw':![]},'log':_0x4180('0x7')});};};exports[_0x4180('0x8')]=function(_0x17759d,_0x45e58c,_0x409e35){return function(){return client[_0x4180('0x4')](_0x4180('0x9'),{'body':_0x17759d,'options':{'where':{'VoiceQueueId':_0x45e58c,'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x409e35},'log':_0x4180('0x9')});};};exports[_0x4180('0xa')]=function(_0x5dfe27){return function(){return client[_0x4180('0x4')](_0x4180('0x9'),{'body':_0x5dfe27,'options':{'where':{'ContactId':_0x5dfe27[_0x4180('0xb')],'ListId':_0x5dfe27[_0x4180('0xc')],'VoiceQueueId':_0x5dfe27[_0x4180('0xd')],'CampaignId':_0x5dfe27[_0x4180('0xe')]}},'log':'rescheduleContact'});};};exports[_0x4180('0xf')]=function(_0x119534,_0x318f08,_0x8026c5){return function(){return client[_0x4180('0x4')](_0x4180('0x10'),{'options':{'where':{'VoiceQueueId':_0x119534,'ListId':_0x318f08,'ContactId':_0x8026c5}},'log':_0x4180('0x10')});};};exports[_0x4180('0x11')]=function(_0x138769,_0x274576,_0x2fa8a5,_0x3e479a){return function(){return client[_0x4180('0x4')](_0x4180('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x138769,'active':![],'scheduledat':{'$lte':moment()[_0x4180('0x13')](_0x4180('0x14'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x274576}}]},'order':[['priority',_0x4180('0x15')],[_0x4180('0x16'),_0x3e479a],['id',_0x4180('0x17')]],'raw':!![],'limit':_0x2fa8a5},'log':_0x4180('0x12')});};};exports[_0x4180('0x18')]=function(_0x3c8427,_0x4b32a4,_0x8fa773){return function(){return client[_0x4180('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x3c8427,'active':![],'scheduledat':{'$lte':moment()[_0x4180('0x13')](_0x4180('0x14'))}},'include':[{'model':'CmContact','as':_0x4180('0x19')}],'order':[[_0x4180('0x1a'),_0x4180('0x15')],[_0x4180('0x16'),_0x8fa773],['id',_0x4180('0x17')]],'raw':!![],'limit':_0x4b32a4},'log':_0x4180('0x1b')});};};exports[_0x4180('0x1c')]=function(_0xf77db9,_0x2d3d49){return function(){_0xf77db9[_0x4180('0x1d')]=_0xf77db9[_0x4180('0x1e')];return client[_0x4180('0x4')]('MoveContactManagedDialer',{'body':_0xf77db9,'options':{'where':{'ContactId':_0xf77db9[_0x4180('0xb')],'ListId':_0xf77db9[_0x4180('0xc')],'VoiceQueueId':_0xf77db9[_0x4180('0xd')],'CampaignId':_0xf77db9['CampaignId'],'active':_0x2d3d49?undefined:!![]}},'log':_0x4180('0x1f')});};};exports[_0x4180('0x20')]=function(_0x51ea7f){return function(){return client[_0x4180('0x4')](_0x4180('0x21'),{'options':{'where':{'VoiceQueueId':_0x51ea7f['id']?_0x51ea7f['id']||null:null}},'log':_0x4180('0x20')});};};exports[_0x4180('0x22')]=function(_0x5acc12){return function(){return client[_0x4180('0x4')](_0x4180('0x23'),{'options':{'where':{'id':_0x5acc12},'include':[{'model':_0x4180('0x6'),'as':'Contact'},{'model':_0x4180('0x24'),'as':_0x4180('0x25'),'attributes':['id',_0x4180('0x26')]},{'model':_0x4180('0x27'),'as':_0x4180('0x28'),'attributes':['id','name']}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x4180('0x29')]=function(_0x72517,_0x1da70a,_0x37545){return function(){return client[_0x4180('0x4')](_0x4180('0x9'),{'body':_0x72517,'options':{'where':{'id':_0x1da70a},'limit':_0x37545},'log':'UpdateCmHopper'});};};exports[_0x4180('0x2a')]=function(_0x1f76b3,_0x5da194){return function(){return client[_0x4180('0x4')](_0x4180('0x2b'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1f76b3,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x4180('0x13')](_0x4180('0x14'))},'UserId':{'$in':_0x5da194}},'order':[['priority','DESC'],[_0x4180('0x16'),_0x4180('0x15')],['id',_0x4180('0x17')]],'include':[{'model':_0x4180('0x6'),'as':'Contact'},{'model':_0x4180('0x24'),'as':_0x4180('0x25'),'attributes':['id',_0x4180('0x26'),_0x4180('0x2c')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x4180('0x12')});};};exports[_0x4180('0x2d')]=function(_0x49ec02){return function(){return client['Request'](_0x4180('0x2e'),{'body':_0x49ec02,'options':{},'log':_0x4180('0x2e')});};};exports[_0x4180('0x2f')]=function(_0x578766,_0x27d915){return function(){return client[_0x4180('0x4')](_0x4180('0x30'),{'body':{'where':{'voiceQueueId':_0x578766,'interval':_0x27d915}},'log':_0x4180('0x2f')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/cmHopperAdditionalPhone.js b/server/services/ami/rpc/cmHopperAdditionalPhone.js
deleted file mode 100644 (file)
index a45a07d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// *************************************************************************
-// *                                                                       *
-// * xCALLY Motion -  The Omnichannel Contact Center                       *
-// * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * Email: info@xcally.com                                                *
-// * Website: https://www.xcally.com                                       *
-// *                                                                       *
-// *************************************************************************
-// *                                                                       *
-// * The SOFTWARE PRODUCT is protected by copyright laws and international *
-// * copyright treaties, as well as other intellectual property laws and   *
-// * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
-// *                                                                       *
-// *************************************************************************
-var _0x5bdd=['SwapAdditionalPhones','IncrementPreviewCounters','../client','verifyAdditionalPhones','Request'];(function(_0x4cd61c,_0x5f2a2e){var _0x563619=function(_0x1add76){while(--_0x1add76){_0x4cd61c['push'](_0x4cd61c['shift']());}};_0x563619(++_0x5f2a2e);}(_0x5bdd,0x151));var _0xd5bd=function(_0x5b8495,_0x612384){_0x5b8495=_0x5b8495-0x0;var _0x4a280c=_0x5bdd[_0x5b8495];return _0x4a280c;};'use strict';var client=require(_0xd5bd('0x0'));var moment=require('moment');exports[_0xd5bd('0x1')]=function(_0x4d4a66,_0x454d8a,_0x97ade1){return function(){return client[_0xd5bd('0x2')]('VerifyAdditionalPhones',{'body':_0x4d4a66,'reason':_0x454d8a,'entity':_0x97ade1,'log':'VerifyAdditionalPhones'});};};exports['swapAdditionalPhones']=function(_0x5035df,_0x118137,_0x48ad9a){return function(){return client['Request'](_0xd5bd('0x3'),{'body':_0x5035df,'duration':_0x118137,'waitTime':_0x48ad9a,'log':_0xd5bd('0x3')});};};exports['incrementPreviewCounters']=function(_0x2b4d6e){return function(){return client[_0xd5bd('0x2')](_0xd5bd('0x4'),{'body':_0x2b4d6e,'log':_0xd5bd('0x4')});};};
\ No newline at end of file
index cba242e..8a1f3d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9f5=['../client','checkIsBlackList','Request','GetCmHopperBlack','VoiceQueueId','phone','checkIsBlackListIvr','GetCmHopperBlackIvr'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xe9f5,0x80));var _0x5e9f=function(_0x198bdd,_0x537bf5){_0x198bdd=_0x198bdd-0x0;var _0x112b96=_0xe9f5[_0x198bdd];return _0x112b96;};'use strict';var client=require(_0x5e9f('0x0'));exports[_0x5e9f('0x1')]=function(_0x3c799d){return function(){return client[_0x5e9f('0x2')](_0x5e9f('0x3'),{'options':{'where':{'VoiceQueueId':_0x3c799d[_0x5e9f('0x4')],'phone':_0x3c799d[_0x5e9f('0x5')]},'raw':![]},'log':_0x5e9f('0x3')});};};exports[_0x5e9f('0x6')]=function(_0xbf01ae){return function(){return client[_0x5e9f('0x2')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0xbf01ae['CampaignId'],'phone':_0xbf01ae[_0x5e9f('0x5')]},'raw':![]},'log':_0x5e9f('0x7')});};};
\ No newline at end of file
+var _0x9354=['Contact','phone','checkIsBlackListIvr','Request','CampaignId','GetCmHopperBlackIvr','checkIsBlackList','GetCmHopperBlack','VoiceQueueId'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0x9354,0x96));var _0x4935=function(_0x179c89,_0x3a69b2){_0x179c89=_0x179c89-0x0;var _0x4b87e5=_0x9354[_0x179c89];return _0x4b87e5;};'use strict';var client=require('../client');exports[_0x4935('0x0')]=function(_0xc3c1f3){return function(){return client['Request'](_0x4935('0x1'),{'options':{'where':{'VoiceQueueId':_0xc3c1f3[_0x4935('0x2')],'phone':_0xc3c1f3[_0x4935('0x3')][_0x4935('0x4')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x4935('0x5')]=function(_0x2d509b){return function(){return client[_0x4935('0x6')](_0x4935('0x1'),{'options':{'where':{'CampaignId':_0x2d509b[_0x4935('0x7')],'phone':_0x2d509b[_0x4935('0x3')][_0x4935('0x4')]},'raw':![]},'log':_0x4935('0x8')});};};
\ No newline at end of file
index 69ea847..ed9466f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc24c=['CreateCmHopperFinal','createContact','campaign'];(function(_0x595d29,_0x3cab2a){var _0x254cdf=function(_0x2f3b9c){while(--_0x2f3b9c){_0x595d29['push'](_0x595d29['shift']());}};_0x254cdf(++_0x3cab2a);}(_0xc24c,0x13f));var _0xcc24=function(_0x2cb8c8,_0x2a9708){_0x2cb8c8=_0x2cb8c8-0x0;var _0x312cf3=_0xc24c[_0x2cb8c8];return _0x312cf3;};'use strict';var client=require('../client');exports[_0xcc24('0x0')]=function(_0x8f6d48){return function(){_0x8f6d48[_0xcc24('0x1')]=_0x8f6d48['queue'];return client['Request'](_0xcc24('0x2'),{'body':_0x8f6d48,'log':_0xcc24('0x2')});};};
\ No newline at end of file
+var _0x0048=['createContact','campaign','Request','CreateCmHopperFinal','../client'];(function(_0x396ca,_0x163f6b){var _0x10579c=function(_0x3f9980){while(--_0x3f9980){_0x396ca['push'](_0x396ca['shift']());}};_0x10579c(++_0x163f6b);}(_0x0048,0xc7));var _0x8004=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x0048[_0x5d80de];return _0x1c7556;};'use strict';var client=require(_0x8004('0x0'));exports[_0x8004('0x1')]=function(_0x25a865){return function(){_0x25a865[_0x8004('0x2')]=_0x25a865['queue'];return client[_0x8004('0x3')]('CreateCmHopperFinal',{'body':_0x25a865,'log':_0x8004('0x4')});};};
\ No newline at end of file
index b92bc92..2a2b99d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb987=['day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf'];(function(_0xf9f45e,_0x42fa3b){var _0x4ffaf9=function(_0x5e5d91){while(--_0x5e5d91){_0xf9f45e['push'](_0xf9f45e['shift']());}};_0x4ffaf9(++_0x42fa3b);}(_0xb987,0x17e));var _0x7b98=function(_0x477cc9,_0x46975b){_0x477cc9=_0x477cc9-0x0;var _0x432f4a=_0xb987[_0x477cc9];return _0x432f4a;};'use strict';var client=require('../client');var moment=require('moment');exports[_0x7b98('0x0')]=function(_0x1ec722){return function(){_0x1ec722[_0x7b98('0x1')]=_0x1ec722[_0x7b98('0x2')];return client[_0x7b98('0x3')](_0x7b98('0x4'),{'body':_0x1ec722,'log':'CreateCmHopperHistory'});};};exports[_0x7b98('0x5')]=function(_0x5661ce){return function(){return client['Request']('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0x7b98('0x6')](_0x5661ce,_0x7b98('0x7'))[_0x7b98('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0x7b98('0x9'))]}},'raw':![]},'log':_0x7b98('0xa')});};};exports[_0x7b98('0xb')]=function(_0x2d6146){return function(){return client[_0x7b98('0x3')](_0x7b98('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x7b98('0xd')](_0x7b98('0xe'))[_0x7b98('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x7b98('0xf')](_0x7b98('0xe'))[_0x7b98('0x8')](_0x7b98('0x9'))]},'campaigntype':_0x7b98('0x2')},'raw':![]},'log':_0x7b98('0xc')});};};exports[_0x7b98('0x10')]=function(_0x4793d2){return function(){return client[_0x7b98('0x3')](_0x7b98('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x7b98('0xd')](_0x7b98('0xe'))[_0x7b98('0x8')](_0x7b98('0x9')),moment()[_0x7b98('0xf')](_0x7b98('0xe'))['format'](_0x7b98('0x9'))]},'campaigntype':'ivr'},'raw':![]},'log':_0x7b98('0x11')});};};
\ No newline at end of file
+var _0x9c29=['getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','ivr','GetCampaignHopperHistory','moment','createHistory','campaign','queue','Request','avgHandleTime','AvgHandleTime','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory'];(function(_0x32a2ed,_0x458944){var _0x5a2e8f=function(_0x495587){while(--_0x495587){_0x32a2ed['push'](_0x32a2ed['shift']());}};_0x5a2e8f(++_0x458944);}(_0x9c29,0x128));var _0x99c2=function(_0x5886d9,_0x4a7063){_0x5886d9=_0x5886d9-0x0;var _0xd4678f=_0x9c29[_0x5886d9];return _0xd4678f;};'use strict';var client=require('../client');var moment=require(_0x99c2('0x0'));exports[_0x99c2('0x1')]=function(_0x444330){return function(){_0x444330[_0x99c2('0x2')]=_0x444330[_0x99c2('0x3')];return client[_0x99c2('0x4')]('CreateCmHopperHistory',{'body':_0x444330,'log':'CreateCmHopperHistory'});};};exports[_0x99c2('0x5')]=function(_0x3d50f2){return function(){return client[_0x99c2('0x4')](_0x99c2('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x3d50f2,'minutes')[_0x99c2('0x7')](_0x99c2('0x8')),moment()['format'](_0x99c2('0x8'))]}},'raw':![]},'log':_0x99c2('0x9')});};};exports[_0x99c2('0xa')]=function(_0x5dd060){return function(){return client['Request'](_0x99c2('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x99c2('0xc')](_0x99c2('0xd'))[_0x99c2('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x99c2('0xe')](_0x99c2('0xd'))[_0x99c2('0x7')](_0x99c2('0x8'))]},'campaigntype':_0x99c2('0x3')},'raw':![]},'log':_0x99c2('0xb')});};};exports[_0x99c2('0xf')]=function(_0x1effec){return function(){return client['Request']('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x99c2('0xc')](_0x99c2('0xd'))[_0x99c2('0x7')](_0x99c2('0x8')),moment()[_0x99c2('0xe')](_0x99c2('0xd'))['format'](_0x99c2('0x8'))]},'campaigntype':_0x99c2('0x10')},'raw':![]},'log':_0x99c2('0x11')});};};
\ No newline at end of file
index 0555faf..f312061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc17d=['Request','GetFaxAccount','description','ecm','headerinfo','localstationid','maxrate','faxdetect','tech','TrunkId','Trunk','name','callerid','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts'];(function(_0x44a274,_0x17b558){var _0x582fdc=function(_0x2f006a){while(--_0x2f006a){_0x44a274['push'](_0x44a274['shift']());}};_0x582fdc(++_0x17b558);}(_0xc17d,0x96));var _0xdc17=function(_0xb3d90f,_0x21a74e){_0xb3d90f=_0xb3d90f-0x0;var _0x3ad53a=_0xc17d[_0xb3d90f];return _0x3ad53a;};'use strict';var client=require(_0xdc17('0x0'));exports[_0xdc17('0x1')]=function(){return function(){return client[_0xdc17('0x2')](_0xdc17('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdc17('0x4'),_0xdc17('0x5'),_0xdc17('0x6'),_0xdc17('0x7'),'minrate',_0xdc17('0x8'),'modem','gateway',_0xdc17('0x9'),'t38timeout',_0xdc17('0xa'),_0xdc17('0xb'),'ListId','key'],'include':[{'model':_0xdc17('0xc'),'as':_0xdc17('0xc'),'attributes':['id',_0xdc17('0xd'),_0xdc17('0xe'),_0xdc17('0xf')]}]},'log':_0xdc17('0x10')});};};exports[_0xdc17('0x11')]=function(_0x33340c,_0x5c20b3){return client[_0xdc17('0x2')](_0xdc17('0x12'),{'account':{'id':_0x33340c},'body':_0x5c20b3,'log':_0xdc17('0x12')});};
\ No newline at end of file
+var _0x87d9=['../client','Request','GetFaxAccount','name','description','ecm','localstationid','maxrate','modem','faxdetect','t38timeout','TrunkId','ListId','key','Trunk','callerid','getFaxAccount','notify','NotifyFaxAccount'];(function(_0x59f212,_0x1aa4b1){var _0x424721=function(_0x8e52d1){while(--_0x8e52d1){_0x59f212['push'](_0x59f212['shift']());}};_0x424721(++_0x1aa4b1);}(_0x87d9,0x143));var _0x987d=function(_0x2ea9bb,_0x41a73f){_0x2ea9bb=_0x2ea9bb-0x0;var _0x3f0084=_0x87d9[_0x2ea9bb];return _0x3f0084;};'use strict';var client=require(_0x987d('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x987d('0x1')](_0x987d('0x2'),{'options':{'raw':![],'attributes':['id',_0x987d('0x3'),_0x987d('0x4'),_0x987d('0x5'),'headerinfo',_0x987d('0x6'),'minrate',_0x987d('0x7'),_0x987d('0x8'),'gateway',_0x987d('0x9'),_0x987d('0xa'),'tech',_0x987d('0xb'),_0x987d('0xc'),_0x987d('0xd')],'include':[{'model':_0x987d('0xe'),'as':_0x987d('0xe'),'attributes':['id',_0x987d('0x3'),_0x987d('0xf'),'active']}]},'log':_0x987d('0x10')});};};exports[_0x987d('0x11')]=function(_0x10f8be,_0x2c01ac){return client['Request'](_0x987d('0x12'),{'account':{'id':_0x10f8be},'body':_0x2c01ac,'log':_0x987d('0x12')});};
\ No newline at end of file
index 0061166..adc068f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3df8=['../client','update','Request','UpdateFaxMessage'];(function(_0x594f19,_0x2cf02a){var _0x4e7638=function(_0x56f316){while(--_0x56f316){_0x594f19['push'](_0x594f19['shift']());}};_0x4e7638(++_0x2cf02a);}(_0x3df8,0x15c));var _0x83df=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0x3df8[_0x102b0c];return _0x9b15ca;};'use strict';var client=require(_0x83df('0x0'));exports[_0x83df('0x1')]=function(_0x208b4e,_0x5adacc){return client[_0x83df('0x2')]('UpdateFaxMessage',{'body':_0x5adacc,'options':{'where':{'AttachmentId':_0x208b4e}},'log':_0x83df('0x3')});};
\ No newline at end of file
+var _0x8b3b=['Request','UpdateFaxMessage','../client','update'];(function(_0x5b1097,_0x3ed62f){var _0x57979c=function(_0x512f68){while(--_0x512f68){_0x5b1097['push'](_0x5b1097['shift']());}};_0x57979c(++_0x3ed62f);}(_0x8b3b,0xe2));var _0xb8b3=function(_0x4ed17b,_0x2b1745){_0x4ed17b=_0x4ed17b-0x0;var _0x24b248=_0x8b3b[_0x4ed17b];return _0x24b248;};'use strict';var client=require(_0xb8b3('0x0'));exports[_0xb8b3('0x1')]=function(_0xbe81e3,_0x218b58){return client[_0xb8b3('0x2')](_0xb8b3('0x3'),{'body':_0x218b58,'options':{'where':{'AttachmentId':_0xbe81e3}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index 752352c..bbbde98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06e7=['content','variableName','Variable','Descriptions','key','keyContent','idField','nameField','customField','Tags','GetDeskAccount','../../client','getDeskAccounts','name','username','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField'];(function(_0xa270f3,_0x293fd){var _0x48767f=function(_0x2db048){while(--_0x2db048){_0xa270f3['push'](_0xa270f3['shift']());}};_0x48767f(++_0x293fd);}(_0x06e7,0x11c));var _0x706e=function(_0x654d5c,_0x18f75f){_0x654d5c=_0x654d5c-0x0;var _0x53d1ad=_0x06e7[_0x654d5c];return _0x53d1ad;};'use strict';var client=require(_0x706e('0x0'));exports[_0x706e('0x1')]=function(){return function(_0x4b70a6){return client['Request']('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x706e('0x2'),'description',_0x706e('0x3'),'password','remoteUri',_0x706e('0x4'),_0x706e('0x5'),_0x706e('0x6')],'include':[{'model':_0x706e('0x7'),'as':_0x706e('0x8'),'attributes':['id','name'],'include':[{'model':_0x706e('0x9'),'as':'Subjects','attributes':['id',_0x706e('0x5'),_0x706e('0xa'),_0x706e('0xb')],'include':[{'model':_0x706e('0xc'),'as':_0x706e('0xc'),'attributes':['id',_0x706e('0x2')]}]},{'model':_0x706e('0x9'),'as':_0x706e('0xd'),'attributes':['id',_0x706e('0x5'),_0x706e('0xa'),_0x706e('0xe'),'keyType',_0x706e('0xf'),_0x706e('0xb')],'include':[{'model':_0x706e('0xc'),'as':_0x706e('0xc'),'attributes':['id',_0x706e('0x2')]}]},{'model':_0x706e('0x9'),'as':'Fields','attributes':['id',_0x706e('0x5'),_0x706e('0xa'),_0x706e('0x10'),_0x706e('0x11'),_0x706e('0x12'),_0x706e('0xb')],'include':[{'model':_0x706e('0xc'),'as':'Variable','attributes':['id',_0x706e('0x2')]}]},{'model':'Tag','as':_0x706e('0x13'),'attributes':['id','name']}]}]},'log':_0x706e('0x14')});};};
\ No newline at end of file
+var _0x9be5=['Tag','Tags','getDeskAccounts','Request','username','password','remoteUri','authType','serverUrl','type','content','variableName','DeskField','Descriptions','keyType','Variable','name','Fields','idField','nameField','customField'];(function(_0x47f05c,_0x4dabef){var _0x5d89f5=function(_0x320612){while(--_0x320612){_0x47f05c['push'](_0x47f05c['shift']());}};_0x5d89f5(++_0x4dabef);}(_0x9be5,0xd4));var _0x59be=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x9be5[_0x2555d0];return _0x3bb486;};'use strict';var client=require('../../client');exports[_0x59be('0x0')]=function(){return function(_0x2de5d4){return client[_0x59be('0x1')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id','name','description',_0x59be('0x2'),_0x59be('0x3'),_0x59be('0x4'),_0x59be('0x5'),'type',_0x59be('0x6')],'include':[{'model':'DeskConfiguration','as':'Configurations','attributes':['id','name'],'include':[{'model':'DeskField','as':'Subjects','attributes':['id',_0x59be('0x7'),_0x59be('0x8'),_0x59be('0x9')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x59be('0xa'),'as':_0x59be('0xb'),'attributes':['id',_0x59be('0x7'),_0x59be('0x8'),'key',_0x59be('0xc'),'keyContent',_0x59be('0x9')],'include':[{'model':_0x59be('0xd'),'as':'Variable','attributes':['id',_0x59be('0xe')]}]},{'model':_0x59be('0xa'),'as':_0x59be('0xf'),'attributes':['id',_0x59be('0x7'),_0x59be('0x8'),_0x59be('0x10'),_0x59be('0x11'),_0x59be('0x12'),_0x59be('0x9')],'include':[{'model':_0x59be('0xd'),'as':_0x59be('0xd'),'attributes':['id','name']}]},{'model':_0x59be('0x13'),'as':_0x59be('0x14'),'attributes':['id',_0x59be('0xe')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
index 515243b..71e6870 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ccc=['additionalSearchContact','Dynamics365Field','Subjects','variableName','Variable','Descriptions','type','content','key','keyType','keyContent','idField','nameField','CloudProvider','Request','GetDynamics365Account','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Dynamics365Configuration','Configurations','ticketType','moduleCreate'];(function(_0x58d61f,_0x4541e2){var _0x44cec8=function(_0x21a2d2){while(--_0x21a2d2){_0x58d61f['push'](_0x58d61f['shift']());}};_0x44cec8(++_0x4541e2);}(_0x6ccc,0xbc));var _0xc6cc=function(_0x3cdfdb,_0x40545d){_0x3cdfdb=_0x3cdfdb-0x0;var _0x57d4d8=_0x6ccc[_0x3cdfdb];return _0x57d4d8;};'use strict';var client=require('../../client');exports['getDynamics365Accounts']=function(){return function(_0x14fc67){return client[_0xc6cc('0x0')](_0xc6cc('0x1'),{'options':{'raw':![],'attributes':['id',_0xc6cc('0x2'),_0xc6cc('0x3'),_0xc6cc('0x4'),_0xc6cc('0x5'),_0xc6cc('0x6'),_0xc6cc('0x7'),_0xc6cc('0x8'),_0xc6cc('0x9'),'description',_0xc6cc('0xa')],'include':[{'model':_0xc6cc('0xb'),'as':_0xc6cc('0xc'),'attributes':['id',_0xc6cc('0x2'),_0xc6cc('0xd'),_0xc6cc('0xe'),_0xc6cc('0xf')],'include':[{'model':_0xc6cc('0x10'),'as':_0xc6cc('0x11'),'attributes':['id','type','content',_0xc6cc('0x12')],'include':[{'model':_0xc6cc('0x13'),'as':_0xc6cc('0x13'),'attributes':['id','name']}]},{'model':'Dynamics365Field','as':_0xc6cc('0x14'),'attributes':['id',_0xc6cc('0x15'),_0xc6cc('0x16'),_0xc6cc('0x17'),_0xc6cc('0x18'),_0xc6cc('0x19'),_0xc6cc('0x12')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xc6cc('0x2')]}]},{'model':_0xc6cc('0x10'),'as':'Fields','attributes':['id',_0xc6cc('0x15'),_0xc6cc('0x16'),_0xc6cc('0x1a'),_0xc6cc('0x1b'),'customField',_0xc6cc('0x12')],'include':[{'model':_0xc6cc('0x13'),'as':'Variable','attributes':['id',_0xc6cc('0x2')]}]}]},{'model':'CloudProvider','as':_0xc6cc('0x1c'),'attributes':['id','data2','data5','data7']}]},'log':_0xc6cc('0x1')});};};
\ No newline at end of file
+var _0x4483=['Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','nameField','customField','CloudProvider','data2','data5','data7','../../client','getDynamics365Accounts','GetDynamics365Account','name','username','password','remoteUri','clientId','clientSecret','serverUrl','description','modernAuthentication','Dynamics365Configuration','Configurations','Dynamics365Field'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4483,0x1a3));var _0x3448=function(_0x183862,_0x459569){_0x183862=_0x183862-0x0;var _0x16a8a7=_0x4483[_0x183862];return _0x16a8a7;};'use strict';var client=require(_0x3448('0x0'));exports[_0x3448('0x1')]=function(){return function(_0x229c0c){return client['Request'](_0x3448('0x2'),{'options':{'raw':![],'attributes':['id',_0x3448('0x3'),_0x3448('0x4'),_0x3448('0x5'),_0x3448('0x6'),'tenantId',_0x3448('0x7'),_0x3448('0x8'),_0x3448('0x9'),_0x3448('0xa'),_0x3448('0xb')],'include':[{'model':_0x3448('0xc'),'as':_0x3448('0xd'),'attributes':['id',_0x3448('0x3'),'ticketType','moduleCreate'],'include':[{'model':_0x3448('0xe'),'as':_0x3448('0xf'),'attributes':['id',_0x3448('0x10'),_0x3448('0x11'),_0x3448('0x12')],'include':[{'model':_0x3448('0x13'),'as':_0x3448('0x13'),'attributes':['id',_0x3448('0x3')]}]},{'model':_0x3448('0xe'),'as':_0x3448('0x14'),'attributes':['id',_0x3448('0x10'),'content','key',_0x3448('0x15'),_0x3448('0x16'),'variableName'],'include':[{'model':_0x3448('0x13'),'as':_0x3448('0x13'),'attributes':['id',_0x3448('0x3')]}]},{'model':'Dynamics365Field','as':_0x3448('0x17'),'attributes':['id',_0x3448('0x10'),'content',_0x3448('0x18'),_0x3448('0x19'),_0x3448('0x1a'),'variableName'],'include':[{'model':_0x3448('0x13'),'as':_0x3448('0x13'),'attributes':['id',_0x3448('0x3')]}]}]},{'model':_0x3448('0x1b'),'as':_0x3448('0x1b'),'attributes':['id',_0x3448('0x1c'),_0x3448('0x1d'),_0x3448('0x1e')]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
index f5d5f0e..46da19e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x851a=['serverUrl','Configurations','Tag','FreshdeskField','type','content','variableName','Variable','key','keyType','keyContent','Fields','idField','nameField','customField','../../client','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri'];(function(_0x4c4ed7,_0xd98c95){var _0x5dde9a=function(_0x6d7d65){while(--_0x6d7d65){_0x4c4ed7['push'](_0x4c4ed7['shift']());}};_0x5dde9a(++_0xd98c95);}(_0x851a,0x19b));var _0xa851=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x851a[_0x243b59];return _0x3e1676;};'use strict';var client=require(_0xa851('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x3f8346){return client[_0xa851('0x1')](_0xa851('0x2'),{'options':{'raw':![],'attributes':['id',_0xa851('0x3'),_0xa851('0x4'),_0xa851('0x5'),_0xa851('0x6'),_0xa851('0x7')],'include':[{'model':'FreshdeskConfiguration','as':_0xa851('0x8'),'attributes':['id','name'],'include':[{'model':_0xa851('0x9'),'attributes':['id',_0xa851('0x3')]},{'model':_0xa851('0xa'),'as':'Subjects','attributes':['id',_0xa851('0xb'),_0xa851('0xc'),_0xa851('0xd')],'include':[{'model':_0xa851('0xe'),'as':'Variable','attributes':['id',_0xa851('0x3')]}]},{'model':_0xa851('0xa'),'as':'Descriptions','attributes':['id',_0xa851('0xb'),_0xa851('0xc'),_0xa851('0xf'),_0xa851('0x10'),_0xa851('0x11'),_0xa851('0xd')],'include':[{'model':_0xa851('0xe'),'as':_0xa851('0xe'),'attributes':['id',_0xa851('0x3')]}]},{'model':_0xa851('0xa'),'as':_0xa851('0x12'),'attributes':['id',_0xa851('0xb'),_0xa851('0xc'),_0xa851('0x13'),_0xa851('0x14'),_0xa851('0x15'),_0xa851('0xd')],'include':[{'model':_0xa851('0xe'),'as':'Variable','attributes':['id',_0xa851('0x3')]}]}]}]},'log':_0xa851('0x2')});};};
\ No newline at end of file
+var _0xb12d=['FreshdeskConfiguration','Configurations','Tag','name','FreshdeskField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','nameField','../../client','getFreshdeskAccounts','GetFreshdeskAccount','username','apiKey','remoteUri','serverUrl'];(function(_0x38c0b2,_0x6a67a5){var _0x283c00=function(_0x259f03){while(--_0x259f03){_0x38c0b2['push'](_0x38c0b2['shift']());}};_0x283c00(++_0x6a67a5);}(_0xb12d,0x124));var _0xdb12=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xb12d[_0x1e393b];return _0x3d0bfe;};'use strict';var client=require(_0xdb12('0x0'));exports[_0xdb12('0x1')]=function(){return function(_0x6a951d){return client['Request'](_0xdb12('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xdb12('0x3'),_0xdb12('0x4'),_0xdb12('0x5'),_0xdb12('0x6')],'include':[{'model':_0xdb12('0x7'),'as':_0xdb12('0x8'),'attributes':['id','name'],'include':[{'model':_0xdb12('0x9'),'attributes':['id',_0xdb12('0xa')]},{'model':_0xdb12('0xb'),'as':_0xdb12('0xc'),'attributes':['id',_0xdb12('0xd'),_0xdb12('0xe'),_0xdb12('0xf')],'include':[{'model':_0xdb12('0x10'),'as':'Variable','attributes':['id',_0xdb12('0xa')]}]},{'model':'FreshdeskField','as':_0xdb12('0x11'),'attributes':['id',_0xdb12('0xd'),_0xdb12('0xe'),'key',_0xdb12('0x12'),_0xdb12('0x13'),_0xdb12('0xf')],'include':[{'model':'Variable','as':_0xdb12('0x10'),'attributes':['id','name']}]},{'model':_0xdb12('0xb'),'as':_0xdb12('0x14'),'attributes':['id',_0xdb12('0xd'),'content',_0xdb12('0x15'),_0xdb12('0x16'),'customField',_0xdb12('0xf')],'include':[{'model':'Variable','as':_0xdb12('0x10'),'attributes':['id',_0xdb12('0xa')]}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
index 8528b88..d2516e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['variableName','Variable','FreshsalesField','Descriptions','key','keyContent','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','apiKey','serverUrl','FreshsalesConfiguration','Configurations','Subjects','content'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x5fc3,0xa8));var _0x35fc=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0x5fc3[_0x28edda];return _0x21f4a4;};'use strict';var client=require(_0x35fc('0x0'));exports[_0x35fc('0x1')]=function(){return function(_0x5a8343){return client[_0x35fc('0x2')](_0x35fc('0x3'),{'options':{'raw':![],'attributes':['id',_0x35fc('0x4'),_0x35fc('0x5'),_0x35fc('0x6'),'remoteUri',_0x35fc('0x7')],'include':[{'model':_0x35fc('0x8'),'as':_0x35fc('0x9'),'attributes':['id','name'],'include':[{'model':'FreshsalesField','as':_0x35fc('0xa'),'attributes':['id','type',_0x35fc('0xb'),_0x35fc('0xc')],'include':[{'model':_0x35fc('0xd'),'as':_0x35fc('0xd'),'attributes':['id',_0x35fc('0x4')]}]},{'model':_0x35fc('0xe'),'as':_0x35fc('0xf'),'attributes':['id','type',_0x35fc('0xb'),_0x35fc('0x10'),'keyType',_0x35fc('0x11'),_0x35fc('0xc')],'include':[{'model':'Variable','as':_0x35fc('0xd'),'attributes':['id',_0x35fc('0x4')]}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
+var _0xd046=['remoteUri','FreshsalesConfiguration','FreshsalesField','Subjects','variableName','Variable','type','keyContent','GetFreshsalesccount','getFreshsalesAccounts','Request','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd046,0x129));var _0x6d04=function(_0x394614,_0x263475){_0x394614=_0x394614-0x0;var _0x257d88=_0xd046[_0x394614];return _0x257d88;};'use strict';var client=require('../../client');exports[_0x6d04('0x0')]=function(){return function(_0x1a46d8){return client[_0x6d04('0x1')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x6d04('0x2'),'username','apiKey',_0x6d04('0x3'),'serverUrl'],'include':[{'model':_0x6d04('0x4'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0x6d04('0x5'),'as':_0x6d04('0x6'),'attributes':['id','type','content',_0x6d04('0x7')],'include':[{'model':_0x6d04('0x8'),'as':'Variable','attributes':['id','name']}]},{'model':_0x6d04('0x5'),'as':'Descriptions','attributes':['id',_0x6d04('0x9'),'content','key','keyType',_0x6d04('0xa'),_0x6d04('0x7')],'include':[{'model':_0x6d04('0x8'),'as':_0x6d04('0x8'),'attributes':['id','name']}]}]}]},'log':_0x6d04('0xb')});};};
\ No newline at end of file
index abc70f1..b47f119 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1ef=['Descriptions','GetSalesforceAccount','../../client','Request','name','password','remoteUri','clientSecret','serverUrl','Configurations','moduleSearch','ticketType','leadId','additionalSearchAccount','additionalSearchLead','Subjects','Variable','SalesforceField'];(function(_0x2e6a25,_0x44d155){var _0x74dbd3=function(_0x1eb571){while(--_0x1eb571){_0x2e6a25['push'](_0x2e6a25['shift']());}};_0x74dbd3(++_0x44d155);}(_0xb1ef,0x146));var _0xfb1e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1ef[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xfb1e('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x53a58c){return client[_0xfb1e('0x1')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0xfb1e('0x2'),'username',_0xfb1e('0x3'),_0xfb1e('0x4'),'clientId',_0xfb1e('0x5'),'securityToken',_0xfb1e('0x6'),'type'],'include':[{'model':'SalesforceConfiguration','as':_0xfb1e('0x7'),'attributes':['id',_0xfb1e('0x2'),_0xfb1e('0x8'),'moduleCreate',_0xfb1e('0x9'),_0xfb1e('0xa'),_0xfb1e('0xb'),'additionalSearchContact',_0xfb1e('0xc')],'include':[{'model':'SalesforceField','as':_0xfb1e('0xd'),'include':[{'model':_0xfb1e('0xe'),'as':'Variable','attributes':['id',_0xfb1e('0x2')]}]},{'model':_0xfb1e('0xf'),'as':_0xfb1e('0x10'),'include':[{'model':_0xfb1e('0xe'),'as':_0xfb1e('0xe'),'attributes':['id',_0xfb1e('0x2')]}]},{'model':_0xfb1e('0xf'),'as':'Fields','include':[{'model':_0xfb1e('0xe'),'as':_0xfb1e('0xe'),'attributes':['id',_0xfb1e('0x2')]}]}]}]},'log':_0xfb1e('0x11')});};};
\ No newline at end of file
+var _0xfd7b=['../../client','getSalesforceAccounts','GetSalesforceAccount','name','username','remoteUri','clientId','clientSecret','serverUrl','type','Configurations','moduleSearch','ticketType','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Fields'];(function(_0x10c79c,_0x5bdc37){var _0x42c13b=function(_0x566b67){while(--_0x566b67){_0x10c79c['push'](_0x10c79c['shift']());}};_0x42c13b(++_0x5bdc37);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xfd7b[_0x468b0f];return _0x3e74d9;};'use strict';var client=require(_0xbfd7('0x0'));exports[_0xbfd7('0x1')]=function(){return function(_0x3392ef){return client['Request'](_0xbfd7('0x2'),{'options':{'raw':![],'attributes':['id',_0xbfd7('0x3'),_0xbfd7('0x4'),'password',_0xbfd7('0x5'),_0xbfd7('0x6'),_0xbfd7('0x7'),'securityToken',_0xbfd7('0x8'),_0xbfd7('0x9')],'include':[{'model':'SalesforceConfiguration','as':_0xbfd7('0xa'),'attributes':['id',_0xbfd7('0x3'),_0xbfd7('0xb'),'moduleCreate',_0xbfd7('0xc'),'leadId','additionalSearchAccount',_0xbfd7('0xd'),_0xbfd7('0xe')],'include':[{'model':_0xbfd7('0xf'),'as':_0xbfd7('0x10'),'include':[{'model':'Variable','as':_0xbfd7('0x11'),'attributes':['id',_0xbfd7('0x3')]}]},{'model':_0xbfd7('0xf'),'as':'Descriptions','include':[{'model':_0xbfd7('0x11'),'as':_0xbfd7('0x11'),'attributes':['id','name']}]},{'model':_0xbfd7('0xf'),'as':_0xbfd7('0x12'),'include':[{'model':'Variable','as':_0xbfd7('0x11'),'attributes':['id',_0xbfd7('0x3')]}]}]}]},'log':_0xbfd7('0x2')});};};
\ No newline at end of file
index bead667..a94a83f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['keyContent','Fields','content','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','variableName','Variable','Descriptions','type','key'];(function(_0x38ed87,_0x4e209c){var _0x9c31f5=function(_0x5dcae2){while(--_0x5dcae2){_0x38ed87['push'](_0x38ed87['shift']());}};_0x9c31f5(++_0x4e209c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(_0x40a0d0){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),'description','username','password',_0xac4a('0x5'),_0xac4a('0x6'),_0xac4a('0x7')],'include':[{'model':_0xac4a('0x8'),'as':_0xac4a('0x9'),'attributes':['id',_0xac4a('0x4')],'include':[{'model':_0xac4a('0xa'),'as':_0xac4a('0xb'),'attributes':['id','type','content',_0xac4a('0xc')],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id','name']}]},{'model':_0xac4a('0xa'),'as':_0xac4a('0xe'),'attributes':['id',_0xac4a('0xf'),'content',_0xac4a('0x10'),'keyType',_0xac4a('0x11'),'variableName'],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id',_0xac4a('0x4')]}]},{'model':'ServicenowField','as':_0xac4a('0x12'),'attributes':['id',_0xac4a('0xf'),_0xac4a('0x13'),_0xac4a('0x14'),_0xac4a('0x15'),_0xac4a('0x16'),_0xac4a('0xc')],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id',_0xac4a('0x4')]}]}]}]},'log':_0xac4a('0x17')});};};
\ No newline at end of file
+var _0xda19=['ServicenowConfiguration','Configurations','name','ServicenowField','Subjects','type','Variable','Descriptions','content','key','keyType','keyContent','Fields','nameField','GetServicenowkAccount','getServicenowAccounts','GetServicenowAccount','description','password','email','remoteUri','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x38108d,_0x1cd2f3){_0x38108d=_0x38108d-0x0;var _0x1b2c70=_0xda19[_0x38108d];return _0x1b2c70;};'use strict';var client=require('../../client');exports[_0x9da1('0x0')]=function(){return function(_0x430d39){return client['Request'](_0x9da1('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x9da1('0x2'),'username',_0x9da1('0x3'),_0x9da1('0x4'),_0x9da1('0x5'),_0x9da1('0x6')],'include':[{'model':_0x9da1('0x7'),'as':_0x9da1('0x8'),'attributes':['id',_0x9da1('0x9')],'include':[{'model':_0x9da1('0xa'),'as':_0x9da1('0xb'),'attributes':['id',_0x9da1('0xc'),'content','variableName'],'include':[{'model':'Variable','as':_0x9da1('0xd'),'attributes':['id','name']}]},{'model':_0x9da1('0xa'),'as':_0x9da1('0xe'),'attributes':['id',_0x9da1('0xc'),_0x9da1('0xf'),_0x9da1('0x10'),_0x9da1('0x11'),_0x9da1('0x12'),'variableName'],'include':[{'model':'Variable','as':_0x9da1('0xd'),'attributes':['id','name']}]},{'model':_0x9da1('0xa'),'as':_0x9da1('0x13'),'attributes':['id',_0x9da1('0xc'),_0x9da1('0xf'),'idField',_0x9da1('0x14'),'customField','variableName'],'include':[{'model':_0x9da1('0xd'),'as':'Variable','attributes':['id',_0x9da1('0x9')]}]}]}]},'log':_0x9da1('0x15')});};};
\ No newline at end of file
index 4e59028..66a7f28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['serverUrl','Configurations','SugarcrmField','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','name','Fields','idField','nameField','Request','GetSugarcrmAccount','password','remoteUri'];(function(_0x4f05b4,_0x571783){var _0xb965e9=function(_0x5cc78e){while(--_0x5cc78e){_0x4f05b4['push'](_0x4f05b4['shift']());}};_0xb965e9(++_0x571783);}(_0x1a85,0x178));var _0x51a8=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x1a85[_0x258b93];return _0x35484b;};'use strict';var client=require('../../client');exports['getSugarcrmAccounts']=function(){return function(_0x305f18){return client[_0x51a8('0x0')](_0x51a8('0x1'),{'options':{'raw':![],'attributes':['id','name','username',_0x51a8('0x2'),_0x51a8('0x3'),_0x51a8('0x4')],'include':[{'model':'SugarcrmConfiguration','as':_0x51a8('0x5'),'attributes':['id','name'],'include':[{'model':_0x51a8('0x6'),'as':'Subjects','attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),'variableName'],'include':[{'model':_0x51a8('0x9'),'as':'Variable','attributes':['id','name']}]},{'model':_0x51a8('0x6'),'as':_0x51a8('0xa'),'attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe')],'include':[{'model':_0x51a8('0x9'),'as':_0x51a8('0x9'),'attributes':['id',_0x51a8('0xf')]}]},{'model':_0x51a8('0x6'),'as':_0x51a8('0x10'),'attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),_0x51a8('0x11'),_0x51a8('0x12'),'customField',_0x51a8('0xe')],'include':[{'model':_0x51a8('0x9'),'as':_0x51a8('0x9'),'attributes':['id','name']}]}]}]},'log':_0x51a8('0x1')});};};
\ 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(_0x53c364,_0x25afb7){var _0x3ef64e=function(_0x5aa2c6){while(--_0x5aa2c6){_0x53c364['push'](_0x53c364['shift']());}};_0x3ef64e(++_0x25afb7);}(_0x2ef3,0xba));var _0x32ef=function(_0x976f1e,_0x1fef1b){_0x976f1e=_0x976f1e-0x0;var _0x11f6c1=_0x2ef3[_0x976f1e];return _0x11f6c1;};'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 505ac29..9d70069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03b3=['accessKey','remoteUri','VtigerConfiguration','Configurations','name','type','content','variableName','Variable','VtigerField','Descriptions','key','keyType','keyContent','Fields','idField','customField','../../client','getVtigerAccounts','Request','GetVtigerAccount','description','username'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x03b3,0xf7));var _0x303b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03b3[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x303b('0x0'));exports[_0x303b('0x1')]=function(){return function(_0xc5f392){return client[_0x303b('0x2')](_0x303b('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x303b('0x4'),_0x303b('0x5'),_0x303b('0x6'),_0x303b('0x7'),'serverUrl'],'include':[{'model':_0x303b('0x8'),'as':_0x303b('0x9'),'attributes':['id',_0x303b('0xa')],'include':[{'model':'VtigerField','as':'Subjects','attributes':['id',_0x303b('0xb'),_0x303b('0xc'),_0x303b('0xd')],'include':[{'model':'Variable','as':_0x303b('0xe'),'attributes':['id',_0x303b('0xa')]}]},{'model':_0x303b('0xf'),'as':_0x303b('0x10'),'attributes':['id',_0x303b('0xb'),'content',_0x303b('0x11'),_0x303b('0x12'),_0x303b('0x13'),'variableName'],'include':[{'model':_0x303b('0xe'),'as':_0x303b('0xe'),'attributes':['id',_0x303b('0xa')]}]},{'model':_0x303b('0xf'),'as':_0x303b('0x14'),'attributes':['id',_0x303b('0xb'),'content',_0x303b('0x15'),'nameField',_0x303b('0x16'),_0x303b('0xd')],'include':[{'model':_0x303b('0xe'),'as':'Variable','attributes':['id',_0x303b('0xa')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
+var _0x5550=['Subjects','type','content','variableName','Variable','name','VtigerField','key','idField','nameField','../../client','GetVtigerAccount','description','username','remoteUri','serverUrl','Configurations'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5550,0xb4));var _0x0555=function(_0x231108,_0x33a823){_0x231108=_0x231108-0x0;var _0x1ab48d=_0x5550[_0x231108];return _0x1ab48d;};'use strict';var client=require(_0x0555('0x0'));exports['getVtigerAccounts']=function(){return function(_0xaf13b5){return client['Request'](_0x0555('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x0555('0x2'),_0x0555('0x3'),'accessKey',_0x0555('0x4'),_0x0555('0x5')],'include':[{'model':'VtigerConfiguration','as':_0x0555('0x6'),'attributes':['id','name'],'include':[{'model':'VtigerField','as':_0x0555('0x7'),'attributes':['id',_0x0555('0x8'),_0x0555('0x9'),_0x0555('0xa')],'include':[{'model':'Variable','as':_0x0555('0xb'),'attributes':['id',_0x0555('0xc')]}]},{'model':_0x0555('0xd'),'as':'Descriptions','attributes':['id',_0x0555('0x8'),_0x0555('0x9'),_0x0555('0xe'),'keyType','keyContent','variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x0555('0xc')]}]},{'model':_0x0555('0xd'),'as':'Fields','attributes':['id','type','content',_0x0555('0xf'),_0x0555('0x10'),'customField',_0x0555('0xa')],'include':[{'model':_0x0555('0xb'),'as':'Variable','attributes':['id',_0x0555('0xc')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
index 940aa47..562f3e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aee=['token','remoteUri','serverUrl','type','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','content','variableName','Variable','Descriptions','key','keyContent','Fields','idField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x2aee,0xf3));var _0xe2ae=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x2aee[_0x35d4e9];return _0x5c2770;};'use strict';var client=require(_0xe2ae('0x0'));exports[_0xe2ae('0x1')]=function(){return function(_0x46a4c0){return client[_0xe2ae('0x2')](_0xe2ae('0x3'),{'options':{'raw':![],'attributes':['id',_0xe2ae('0x4'),_0xe2ae('0x5'),_0xe2ae('0x6'),_0xe2ae('0x7'),_0xe2ae('0x8'),'authType',_0xe2ae('0x9'),_0xe2ae('0xa')],'include':[{'model':_0xe2ae('0xb'),'as':_0xe2ae('0xc'),'attributes':['id',_0xe2ae('0x4')],'include':[{'model':_0xe2ae('0xd'),'attributes':['id',_0xe2ae('0x4')]},{'model':_0xe2ae('0xe'),'as':_0xe2ae('0xf'),'attributes':['id',_0xe2ae('0xa'),_0xe2ae('0x10'),_0xe2ae('0x11')],'include':[{'model':_0xe2ae('0x12'),'as':_0xe2ae('0x12'),'attributes':['id',_0xe2ae('0x4')]}]},{'model':_0xe2ae('0xe'),'as':_0xe2ae('0x13'),'attributes':['id',_0xe2ae('0xa'),'content',_0xe2ae('0x14'),'keyType',_0xe2ae('0x15'),_0xe2ae('0x11')],'include':[{'model':_0xe2ae('0x12'),'as':'Variable','attributes':['id','name']}]},{'model':_0xe2ae('0xe'),'as':_0xe2ae('0x16'),'attributes':['id',_0xe2ae('0xa'),'content',_0xe2ae('0x17'),'nameField',_0xe2ae('0x18'),_0xe2ae('0x11')],'include':[{'model':'Variable','as':_0xe2ae('0x12'),'attributes':['id',_0xe2ae('0x4')]}]}]}]},'log':_0xe2ae('0x3')});};};
\ No newline at end of file
+var _0x7752=['password','token','authType','serverUrl','type','Configurations','Tag','ZendeskField','Subjects','Variable','Descriptions','content','key','keyType','keyContent','variableName','nameField','customField','getZendeskAccounts','Request','name'];(function(_0x137556,_0x253216){var _0x41dc31=function(_0x11cf86){while(--_0x11cf86){_0x137556['push'](_0x137556['shift']());}};_0x41dc31(++_0x253216);}(_0x7752,0xa5));var _0x2775=function(_0x390bfd,_0x39578c){_0x390bfd=_0x390bfd-0x0;var _0x5eebfa=_0x7752[_0x390bfd];return _0x5eebfa;};'use strict';var client=require('../../client');exports[_0x2775('0x0')]=function(){return function(_0x47eb18){return client[_0x2775('0x1')]('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0x2775('0x2'),'username',_0x2775('0x3'),_0x2775('0x4'),'remoteUri',_0x2775('0x5'),_0x2775('0x6'),_0x2775('0x7')],'include':[{'model':'ZendeskConfiguration','as':_0x2775('0x8'),'attributes':['id',_0x2775('0x2')],'include':[{'model':_0x2775('0x9'),'attributes':['id',_0x2775('0x2')]},{'model':_0x2775('0xa'),'as':_0x2775('0xb'),'attributes':['id',_0x2775('0x7'),'content','variableName'],'include':[{'model':_0x2775('0xc'),'as':_0x2775('0xc'),'attributes':['id',_0x2775('0x2')]}]},{'model':_0x2775('0xa'),'as':_0x2775('0xd'),'attributes':['id',_0x2775('0x7'),_0x2775('0xe'),_0x2775('0xf'),_0x2775('0x10'),_0x2775('0x11'),_0x2775('0x12')],'include':[{'model':_0x2775('0xc'),'as':_0x2775('0xc'),'attributes':['id',_0x2775('0x2')]}]},{'model':_0x2775('0xa'),'as':'Fields','attributes':['id','type','content','idField',_0x2775('0x13'),_0x2775('0x14'),_0x2775('0x12')],'include':[{'model':_0x2775('0xc'),'as':'Variable','attributes':['id',_0x2775('0x2')]}]}]}]},'log':'GetZendeskAccount'});};};
\ No newline at end of file
index 185f250..4d5161a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7084=['name','description','host','zone','clientId','clientSecret','code','refreshToken','Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','variableName','Variable','Descriptions','type','key','keyType','keyContent','content','idField','nameField','getZohoAccounts','Request','GetZohoAccount'];(function(_0x44bc99,_0x411adf){var _0x2e012e=function(_0x2eef3d){while(--_0x2eef3d){_0x44bc99['push'](_0x44bc99['shift']());}};_0x2e012e(++_0x411adf);}(_0x7084,0x169));var _0x4708=function(_0x39ee02,_0x3f1662){_0x39ee02=_0x39ee02-0x0;var _0xb5b956=_0x7084[_0x39ee02];return _0xb5b956;};'use strict';var client=require('../../client');exports[_0x4708('0x0')]=function(){return function(_0x3b1097){return client[_0x4708('0x1')](_0x4708('0x2'),{'options':{'raw':![],'attributes':['id',_0x4708('0x3'),_0x4708('0x4'),_0x4708('0x5'),_0x4708('0x6'),_0x4708('0x7'),_0x4708('0x8'),'serverUrl',_0x4708('0x9'),_0x4708('0xa')],'include':[{'model':'ZohoConfiguration','as':_0x4708('0xb'),'attributes':['id',_0x4708('0x3'),_0x4708('0xc'),_0x4708('0xd'),_0x4708('0x4')],'include':[{'model':_0x4708('0xe'),'as':_0x4708('0xf'),'attributes':['id','type','content',_0x4708('0x10')],'include':[{'model':_0x4708('0x11'),'as':_0x4708('0x11'),'attributes':['id',_0x4708('0x3')]}]},{'model':'ZohoField','as':_0x4708('0x12'),'attributes':['id',_0x4708('0x13'),'content',_0x4708('0x14'),_0x4708('0x15'),_0x4708('0x16'),_0x4708('0x10')],'include':[{'model':_0x4708('0x11'),'as':_0x4708('0x11'),'attributes':['id',_0x4708('0x3')]}]},{'model':'ZohoField','as':'Fields','attributes':['id',_0x4708('0x13'),_0x4708('0x17'),_0x4708('0x18'),_0x4708('0x19'),'customField','variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x4708('0x3')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
+var _0x4855=['Descriptions','key','keyContent','Fields','idField','nameField','customField','getZohoAccounts','Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','ZohoField','Subjects','type','content','variableName','Variable'];(function(_0x307b9b,_0x517387){var _0x15b860=function(_0x38b625){while(--_0x38b625){_0x307b9b['push'](_0x307b9b['shift']());}};_0x15b860(++_0x517387);}(_0x4855,0x181));var _0x5485=function(_0x2ef644,_0x2ab0ff){_0x2ef644=_0x2ef644-0x0;var _0x11f00e=_0x4855[_0x2ef644];return _0x11f00e;};'use strict';var client=require('../../client');exports[_0x5485('0x0')]=function(){return function(_0x5a10ef){return client[_0x5485('0x1')](_0x5485('0x2'),{'options':{'raw':![],'attributes':['id',_0x5485('0x3'),_0x5485('0x4'),_0x5485('0x5'),_0x5485('0x6'),_0x5485('0x7'),_0x5485('0x8'),'serverUrl',_0x5485('0x9'),_0x5485('0xa')],'include':[{'model':_0x5485('0xb'),'as':_0x5485('0xc'),'attributes':['id',_0x5485('0x3'),_0x5485('0xd'),'moduleSearch','description'],'include':[{'model':_0x5485('0xe'),'as':_0x5485('0xf'),'attributes':['id',_0x5485('0x10'),_0x5485('0x11'),_0x5485('0x12')],'include':[{'model':_0x5485('0x13'),'as':_0x5485('0x13'),'attributes':['id',_0x5485('0x3')]}]},{'model':_0x5485('0xe'),'as':_0x5485('0x14'),'attributes':['id',_0x5485('0x10'),_0x5485('0x11'),_0x5485('0x15'),'keyType',_0x5485('0x16'),_0x5485('0x12')],'include':[{'model':_0x5485('0x13'),'as':'Variable','attributes':['id','name']}]},{'model':'ZohoField','as':_0x5485('0x17'),'attributes':['id',_0x5485('0x10'),_0x5485('0x11'),_0x5485('0x18'),_0x5485('0x19'),_0x5485('0x1a'),_0x5485('0x12')],'include':[{'model':'Variable','as':_0x5485('0x13'),'attributes':['id',_0x5485('0x3')]}]}]}]},'log':_0x5485('0x2')});};};
\ No newline at end of file
index b4c5f53..2185578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba7a=['CreateMemberReport','voiceDialReport','membername','interface','starttime','endtime','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','format','SIP/%s','TALKING','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid'];(function(_0x35e4af,_0x28237a){var _0x15411e=function(_0x2edda4){while(--_0x2edda4){_0x35e4af['push'](_0x35e4af['shift']());}};_0x15411e(++_0x28237a);}(_0xba7a,0x1d6));var _0xaba7=function(_0x4b02c3,_0x3b763c){_0x4b02c3=_0x4b02c3-0x0;var _0x28c43c=_0xba7a[_0x4b02c3];return _0x28c43c;};'use strict';var moment=require('moment');var _=require(_0xaba7('0x0'));var util=require(_0xaba7('0x1'));var client=require(_0xaba7('0x2'));exports[_0xaba7('0x3')]=function(_0x86e14d){var _0x41eb5c=_0x86e14d[_0xaba7('0x4')]||_0x86e14d[_0xaba7('0x5')];return client[_0xaba7('0x6')]('CreateMemberReport',{'body':{'channel':_0xaba7('0x7'),'membername':_0x86e14d[_0xaba7('0x8')],'interface':_[_0xaba7('0x9')](_0x86e14d['interface'])?util[_0xaba7('0xa')](_0xaba7('0xb'),_0x86e14d[_0xaba7('0x8')]):_0x86e14d['interface'],'type':_0xaba7('0xc'),'enterAt':_0x86e14d['queuecallerleaveAt'],'exitAt':_0x41eb5c,'duration':moment(_0x41eb5c)[_0xaba7('0xd')](_0x86e14d['queuecallerleaveAt'],_0xaba7('0xe')),'data1':_0xaba7('0xf'),'data2':_0x86e14d[_0xaba7('0x10')],'data3':_0x86e14d[_0xaba7('0x11')],'data4':null,'data5':_0x86e14d[_0xaba7('0x12')],'role':_0xaba7('0x13'),'internal':_0x86e14d[_0xaba7('0x14')]?_[_0xaba7('0x15')](_0x86e14d[_0xaba7('0x14')]):undefined,'uniqueid':_0x86e14d[_0xaba7('0x16')]},'log':_0xaba7('0x17')});};exports[_0xaba7('0x18')]=function(_0x5083f4){return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x5083f4[_0xaba7('0x19')],'interface':_0x5083f4[_0xaba7('0x1a')],'type':_0xaba7('0xc'),'enterAt':_0x5083f4[_0xaba7('0x1b')],'exitAt':_0x5083f4['endtime'],'duration':moment(_0x5083f4[_0xaba7('0x1c')])['diff'](_0x5083f4[_0xaba7('0x1b')],_0xaba7('0xe'))>=0x0?moment(_0x5083f4[_0xaba7('0x1c')])[_0xaba7('0xd')](_0x5083f4[_0xaba7('0x1b')],_0xaba7('0xe')):null,'data1':'outbound','data2':_0x5083f4[_0xaba7('0x14')],'data3':_0x5083f4['exten'],'data4':_0x5083f4['dialstring']||null,'role':_0xaba7('0x13'),'internal':_0x5083f4[_0xaba7('0x14')]?_[_0xaba7('0x15')](_0x5083f4['accountcode']):undefined,'uniqueid':_0x5083f4[_0xaba7('0x16')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0x5dcd=['voice','membername','starttime','endtime','outbound','exten','toNumber','moment','lodash','util','../client','queuecallerexitAt','CreateMemberReport','isNil','interface','SIP/%s','lastAssignedTo','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','queue','agent','accountcode','uniqueid','voiceDialReport'];(function(_0x1fc772,_0x376734){var _0x725ba3=function(_0x58f195){while(--_0x58f195){_0x1fc772['push'](_0x1fc772['shift']());}};_0x725ba3(++_0x376734);}(_0x5dcd,0x1e3));var _0xd5dc=function(_0x58f474,_0x28ce9e){_0x58f474=_0x58f474-0x0;var _0xf120f8=_0x5dcd[_0x58f474];return _0xf120f8;};'use strict';var moment=require(_0xd5dc('0x0'));var _=require(_0xd5dc('0x1'));var util=require(_0xd5dc('0x2'));var client=require(_0xd5dc('0x3'));exports['voiceQueueReport']=function(_0x3b90f0){var _0x2a9bbe=_0x3b90f0['queuecallercompleteAt']||_0x3b90f0[_0xd5dc('0x4')];return client['Request'](_0xd5dc('0x5'),{'body':{'channel':'voice','membername':_0x3b90f0['lastAssignedTo'],'interface':_[_0xd5dc('0x6')](_0x3b90f0[_0xd5dc('0x7')])?util['format'](_0xd5dc('0x8'),_0x3b90f0[_0xd5dc('0x9')]):_0x3b90f0[_0xd5dc('0x7')],'type':_0xd5dc('0xa'),'enterAt':_0x3b90f0['queuecallerleaveAt'],'exitAt':_0x2a9bbe,'duration':moment(_0x2a9bbe)[_0xd5dc('0xb')](_0x3b90f0[_0xd5dc('0xc')],_0xd5dc('0xd')),'data1':_0xd5dc('0xe'),'data2':_0x3b90f0[_0xd5dc('0xf')],'data3':_0x3b90f0['exten'],'data4':null,'data5':_0x3b90f0[_0xd5dc('0x10')],'role':_0xd5dc('0x11'),'internal':_0x3b90f0[_0xd5dc('0x12')]?_['toNumber'](_0x3b90f0['accountcode']):undefined,'uniqueid':_0x3b90f0[_0xd5dc('0x13')]},'log':'CreateMemberReport'});};exports[_0xd5dc('0x14')]=function(_0x40e5ff){return client['Request']('CreateMemberReport',{'body':{'channel':_0xd5dc('0x15'),'membername':_0x40e5ff[_0xd5dc('0x16')],'interface':_0x40e5ff[_0xd5dc('0x7')],'type':_0xd5dc('0xa'),'enterAt':_0x40e5ff[_0xd5dc('0x17')],'exitAt':_0x40e5ff[_0xd5dc('0x18')],'duration':moment(_0x40e5ff[_0xd5dc('0x18')])[_0xd5dc('0xb')](_0x40e5ff[_0xd5dc('0x17')],_0xd5dc('0xd'))>=0x0?moment(_0x40e5ff[_0xd5dc('0x18')])[_0xd5dc('0xb')](_0x40e5ff[_0xd5dc('0x17')],_0xd5dc('0xd')):null,'data1':_0xd5dc('0x19'),'data2':_0x40e5ff[_0xd5dc('0x12')],'data3':_0x40e5ff[_0xd5dc('0x1a')],'data4':_0x40e5ff['dialstring']||null,'role':_0xd5dc('0x11'),'internal':_0x40e5ff['accountcode']?_[_0xd5dc('0x1b')](_0x40e5ff[_0xd5dc('0x12')]):undefined,'uniqueid':_0x40e5ff[_0xd5dc('0x13')]},'log':_0xd5dc('0x5')});};
\ No newline at end of file
index c7ac51e..295a284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d62=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x9d62,0xaf));var _0x29d6=function(_0x50cd25,_0x515a0b){_0x50cd25=_0x50cd25-0x0;var _0x293f1c=_0x9d62[_0x50cd25];return _0x293f1c;};'use strict';var client=require(_0x29d6('0x0'));exports[_0x29d6('0x1')]=function(){return client[_0x29d6('0x2')](_0x29d6('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x29d6('0x4'),'previewRecallmeReminderInterval']},'log':_0x29d6('0x5')});};
\ No newline at end of file
+var _0x11e3=['ShowSetting','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x5ec874,_0x2b7b76){var _0x433441=function(_0x3377ee){while(--_0x3377ee){_0x5ec874['push'](_0x5ec874['shift']());}};_0x433441(++_0x2b7b76);}(_0x11e3,0x6f));var _0x311e=function(_0x21ffd4,_0x3cc9b5){_0x21ffd4=_0x21ffd4-0x0;var _0x180390=_0x11e3[_0x21ffd4];return _0x180390;};'use strict';var client=require(_0x311e('0x0'));exports[_0x311e('0x1')]=function(){return client[_0x311e('0x2')](_0x311e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x311e('0x4')]},'log':_0x311e('0x5')});};
\ No newline at end of file
index 895e342..d52fb85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b7=['getTemplates','Request','GetTemplate','name','html'];(function(_0x2efcca,_0x2c69b5){var _0x406d96=function(_0x155cfe){while(--_0x155cfe){_0x2efcca['push'](_0x2efcca['shift']());}};_0x406d96(++_0x2c69b5);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x34104c,_0x11f25c){_0x34104c=_0x34104c-0x0;var _0x3df373=_0xc3b7[_0x34104c];return _0x3df373;};'use strict';var client=require('../client');exports[_0x7c3b('0x0')]=function(_0x2d6014){return function(_0x2500f7){return client[_0x7c3b('0x1')](_0x7c3b('0x2'),{'options':{'raw':!![],'attributes':['id',_0x7c3b('0x3'),_0x7c3b('0x4')]},'log':_0x7c3b('0x2')});};};
\ No newline at end of file
+var _0x36b1=['../client','getTemplates','html'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x36b1,0x1aa));var _0x136b=function(_0x4613be,_0x2dfbdd){_0x4613be=_0x4613be-0x0;var _0x223b82=_0x36b1[_0x4613be];return _0x223b82;};'use strict';var client=require(_0x136b('0x0'));exports[_0x136b('0x1')]=function(_0x46dfb2){return function(_0x5ddf6d){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x136b('0x2')]},'log':'GetTemplate'});};};
\ No newline at end of file
index 32bc59a..aabbdd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0089=['data2','data5','data6','data7','../client','Request','GetTrigger','name','status','Condition','AllConditions','operator','field','Action','action','data1'];(function(_0x5ae87f,_0x174e97){var _0x3d3dea=function(_0x37e38f){while(--_0x37e38f){_0x5ae87f['push'](_0x5ae87f['shift']());}};_0x3d3dea(++_0x174e97);}(_0x0089,0x154));var _0x9008=function(_0x3eda2d,_0x21b0c0){_0x3eda2d=_0x3eda2d-0x0;var _0x3a3f07=_0x0089[_0x3eda2d];return _0x3a3f07;};'use strict';var client=require(_0x9008('0x0'));exports['getTriggers']=function(_0x475ac3){return function(_0x4d3b58){return client[_0x9008('0x1')](_0x9008('0x2'),{'options':{'raw':![],'attributes':['id',_0x9008('0x3'),'channel',_0x9008('0x4')],'include':[{'model':_0x9008('0x5'),'as':_0x9008('0x6'),'attributes':['id','field',_0x9008('0x7'),'value']},{'model':_0x9008('0x5'),'as':'AnyConditions','attributes':['id',_0x9008('0x8'),_0x9008('0x7'),'value']},{'model':_0x9008('0x9'),'as':'Actions','attributes':['id',_0x9008('0xa'),_0x9008('0xb'),_0x9008('0xc'),'data3','data4',_0x9008('0xd'),_0x9008('0xe'),_0x9008('0xf')]}]},'log':_0x9008('0x2')});};};
\ No newline at end of file
+var _0x8bb1=['field','operator','AnyConditions','value','action','data1','data2','data3','data6','data7','../client','getTriggers','Request','GetTrigger','channel','AllConditions'];(function(_0x1612e9,_0x272ff8){var _0x5a39fd=function(_0x358eb9){while(--_0x358eb9){_0x1612e9['push'](_0x1612e9['shift']());}};_0x5a39fd(++_0x272ff8);}(_0x8bb1,0xea));var _0x18bb=function(_0x17a9c7,_0x4f33f3){_0x17a9c7=_0x17a9c7-0x0;var _0x32831e=_0x8bb1[_0x17a9c7];return _0x32831e;};'use strict';var client=require(_0x18bb('0x0'));exports[_0x18bb('0x1')]=function(_0xf3b11a){return function(_0x32a0e7){return client[_0x18bb('0x2')](_0x18bb('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x18bb('0x4'),'status'],'include':[{'model':'Condition','as':_0x18bb('0x5'),'attributes':['id',_0x18bb('0x6'),_0x18bb('0x7'),'value']},{'model':'Condition','as':_0x18bb('0x8'),'attributes':['id','field',_0x18bb('0x7'),_0x18bb('0x9')]},{'model':'Action','as':'Actions','attributes':['id',_0x18bb('0xa'),_0x18bb('0xb'),_0x18bb('0xc'),_0x18bb('0xd'),'data4','data5',_0x18bb('0xe'),_0x18bb('0xf')]}]},'log':_0x18bb('0x3')});};};
\ No newline at end of file
index 9847b38..761ac67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6684=['name','registry','defaultuser','GetTrunk','../client','Request'];(function(_0x1e433a,_0x7af30e){var _0x1bdd40=function(_0x1ee1e2){while(--_0x1ee1e2){_0x1e433a['push'](_0x1e433a['shift']());}};_0x1bdd40(++_0x7af30e);}(_0x6684,0x196));var _0x4668=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x6684[_0x1abeb2];return _0x48da20;};'use strict';var client=require(_0x4668('0x0'));exports['getTrunks']=function(_0x5a7542){return function(_0x3db05c){return client[_0x4668('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4668('0x2'),_0x4668('0x3'),_0x4668('0x4')]},'log':_0x4668('0x5')});};};
\ No newline at end of file
+var _0x7ec0=['name','registry','defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x26c179,_0x20227a){var _0x2c51ee=function(_0x20d7d0){while(--_0x20d7d0){_0x26c179['push'](_0x26c179['shift']());}};_0x2c51ee(++_0x20227a);}(_0x7ec0,0x129));var _0x07ec=function(_0x317483,_0x5bd30e){_0x317483=_0x317483-0x0;var _0x278d4e=_0x7ec0[_0x317483];return _0x278d4e;};'use strict';var client=require(_0x07ec('0x0'));exports[_0x07ec('0x1')]=function(_0x2b5adb){return function(_0x59324a){return client[_0x07ec('0x2')](_0x07ec('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x07ec('0x4'),_0x07ec('0x5'),_0x07ec('0x6')]},'log':'GetTrunk'});};};
\ No newline at end of file
index 778853d..a89ec0c 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(_0x460698,_0x33c416){var _0x4c3884=function(_0x11ba88){while(--_0x11ba88){_0x460698['push'](_0x460698['shift']());}};_0x4c3884(++_0x33c416);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
index 2f963f1..e7cfb52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93a2=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x93a2,0x7e));var _0x293a=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0x93a2[_0x5e9d35];return _0x3beb2e;};'use strict';var client=require(_0x293a('0x0'));exports['create']=function(_0x142564){return client[_0x293a('0x1')](_0x293a('0x2'),{'body':_0x142564,'log':'CreateVoiceAgentReport'});};exports[_0x293a('0x3')]=function(_0x2e2e17,_0x2f25e6,_0x4c73b6){return client[_0x293a('0x1')](_0x293a('0x4'),{'body':_0x2e2e17,'options':{'where':{'uniqueid':_0x2f25e6,'interface':_0x4c73b6,'agentcomplete':!![]}},'log':_0x293a('0x4')});};
\ No newline at end of file
+var _0x61c2=['../client','create','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x3513e2,_0x26f645){var _0x186e8f=function(_0xe8147b){while(--_0xe8147b){_0x3513e2['push'](_0x3513e2['shift']());}};_0x186e8f(++_0x26f645);}(_0x61c2,0x131));var _0x261c=function(_0x90add7,_0x5ef337){_0x90add7=_0x90add7-0x0;var _0x3db467=_0x61c2[_0x90add7];return _0x3db467;};'use strict';var client=require(_0x261c('0x0'));exports[_0x261c('0x1')]=function(_0x1c274d){return client['Request'](_0x261c('0x2'),{'body':_0x1c274d,'log':_0x261c('0x2')});};exports[_0x261c('0x3')]=function(_0x2b073e,_0x55b03c,_0x319a1d){return client['Request'](_0x261c('0x4'),{'body':_0x2b073e,'options':{'where':{'uniqueid':_0x55b03c,'interface':_0x319a1d,'agentcomplete':!![]}},'log':_0x261c('0x4')});};
\ No newline at end of file
index 94804b6..f925dc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7617=['GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','Request'];(function(_0x2a7f81,_0x401d9e){var _0x1bba5c=function(_0x4883bc){while(--_0x4883bc){_0x2a7f81['push'](_0x2a7f81['shift']());}};_0x1bba5c(++_0x401d9e);}(_0x7617,0x1d8));var _0x7761=function(_0x44776a,_0x1d69f0){_0x44776a=_0x44776a-0x0;var _0x52dfb1=_0x7617[_0x44776a];return _0x52dfb1;};'use strict';var moment=require(_0x7761('0x0'));var util=require(_0x7761('0x1'));var _=require(_0x7761('0x2'));var client=require(_0x7761('0x3'));exports[_0x7761('0x4')]=function(_0x4e013b){return client['Request'](_0x7761('0x5'),{'body':_[_0x7761('0x6')](_0x4e013b,{'source':_0x4e013b['calleridnum'],'destinationcontext':_0x4e013b[_0x7761('0x7')],'callerid':_0x4e013b[_0x7761('0x8')],'amaflags':_0x7761('0x9')}),'log':_0x7761('0x5')});};exports[_0x7761('0xa')]=function(){return function(){return client[_0x7761('0xb')](_0x7761('0xc'),{'options':{'where':{'type':[_0x7761('0xd')],'createdAt':{'$between':[moment()[_0x7761('0xe')](_0x7761('0xf'))['format'](_0x7761('0x10')),moment()[_0x7761('0x11')]('day')['format'](_0x7761('0x10'))]}},'attributes':[_0x7761('0x12'),'disposition',_0x7761('0x13'),_0x7761('0x14')]},'log':_0x7761('0x15')});};};
\ No newline at end of file
+var _0xf6e0=['moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration'];(function(_0x4698c6,_0xe7bdb8){var _0x387b5b=function(_0x1244b3){while(--_0x1244b3){_0x4698c6['push'](_0x4698c6['shift']());}};_0x387b5b(++_0xe7bdb8);}(_0xf6e0,0x11d));var _0x0f6e=function(_0x31c995,_0x4896cb){_0x31c995=_0x31c995-0x0;var _0x5a7907=_0xf6e0[_0x31c995];return _0x5a7907;};'use strict';var moment=require(_0x0f6e('0x0'));var util=require('util');var _=require(_0x0f6e('0x1'));var client=require(_0x0f6e('0x2'));exports[_0x0f6e('0x3')]=function(_0x47aa8f){return client[_0x0f6e('0x4')](_0x0f6e('0x5'),{'body':_[_0x0f6e('0x6')](_0x47aa8f,{'source':_0x47aa8f[_0x0f6e('0x7')],'destinationcontext':_0x47aa8f[_0x0f6e('0x8')],'callerid':_0x47aa8f[_0x0f6e('0x9')],'amaflags':_0x0f6e('0xa')}),'log':_0x0f6e('0x5')});};exports[_0x0f6e('0xb')]=function(){return function(){return client[_0x0f6e('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x0f6e('0xc')](_0x0f6e('0xd'))[_0x0f6e('0xe')](_0x0f6e('0xf')),moment()[_0x0f6e('0x10')](_0x0f6e('0xd'))[_0x0f6e('0xe')](_0x0f6e('0xf'))]}},'attributes':[_0x0f6e('0x11'),'disposition',_0x0f6e('0x12'),'billableseconds']},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index 3f49974..9def97c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa37=['create','CreateVoiceDialReport'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0xaa37,0x17c));var _0x7aa3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xaa37[_0x1d1779];return _0x2377e9;};'use strict';var client=require('../client');exports[_0x7aa3('0x0')]=function(_0x50f0a1){return client['Request'](_0x7aa3('0x1'),{'body':_0x50f0a1,'log':_0x7aa3('0x1')});};
\ No newline at end of file
+var _0x3c4f=['create','Request','CreateVoiceDialReport','../client'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x3c4f,0x1ab));var _0xf3c4=function(_0x318065,_0x475ecc){_0x318065=_0x318065-0x0;var _0x1bc4ab=_0x3c4f[_0x318065];return _0x1bc4ab;};'use strict';var client=require(_0xf3c4('0x0'));exports[_0xf3c4('0x1')]=function(_0x5a9a15){return client[_0xf3c4('0x2')](_0xf3c4('0x3'),{'body':_0x5a9a15,'log':_0xf3c4('0x3')});};
\ No newline at end of file
index 84c24ef..61cc05a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f69=['exten','recordingFormat','Request'];(function(_0x232d09,_0x30a518){var _0x454385=function(_0x3a5fdd){while(--_0x3a5fdd){_0x232d09['push'](_0x232d09['shift']());}};_0x454385(++_0x30a518);}(_0x0f69,0x173));var _0x90f6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0f69[_0x4b055c];return _0x4b62bb;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x90f6('0x0')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x90f6('0x1'),_0x90f6('0x2')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
+var _0xee4e=['../client','getVoiceExtensions','Request','exten','recordingFormat'];(function(_0x35ef24,_0x253c9c){var _0x13b0f4=function(_0x2ad14f){while(--_0x2ad14f){_0x35ef24['push'](_0x35ef24['shift']());}};_0x13b0f4(++_0x253c9c);}(_0xee4e,0x122));var _0xeee4=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xee4e[_0x4b2863];return _0x567d67;};'use strict';var client=require(_0xeee4('0x0'));exports[_0xeee4('0x1')]=function(){return function(){return client[_0xeee4('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xeee4('0x3'),_0xeee4('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xeee4('0x1')});};};
\ No newline at end of file
index 928bbc6..983fe60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ce4=['dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callerid','active','Pause','mandatoryDispositionPause','Interval','interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdNumber'];(function(_0x220dc4,_0x190587){var _0x56c3b2=function(_0x21903d){while(--_0x21903d){_0x220dc4['push'](_0x220dc4['shift']());}};_0x56c3b2(++_0x190587);}(_0x2ce4,0x1da));var _0x42ce=function(_0x4151a8,_0x523211){_0x4151a8=_0x4151a8-0x0;var _0x3269a7=_0x2ce4[_0x4151a8];return _0x3269a7;};'use strict';var client=require(_0x42ce('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x42ce('0x1'),{'options':{'raw':![],'attributes':['id',_0x42ce('0x2'),_0x42ce('0x3'),_0x42ce('0x4'),'autopause',_0x42ce('0x5'),_0x42ce('0x6'),_0x42ce('0x7'),_0x42ce('0x8'),_0x42ce('0x9'),_0x42ce('0xa'),_0x42ce('0xb'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x42ce('0xc'),'dialOriginateCallerIdName',_0x42ce('0xd'),_0x42ce('0xe'),_0x42ce('0xf'),'dialQueueTimeout',_0x42ce('0x10'),_0x42ce('0x11'),_0x42ce('0x12'),_0x42ce('0x13'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x42ce('0x14'),_0x42ce('0x15'),_0x42ce('0x16'),_0x42ce('0x17'),_0x42ce('0x18'),_0x42ce('0x19'),_0x42ce('0x1a'),_0x42ce('0x1b'),_0x42ce('0x1c'),_0x42ce('0x1d'),_0x42ce('0x1e'),_0x42ce('0x1f'),_0x42ce('0x20'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x42ce('0x21'),_0x42ce('0x22'),_0x42ce('0x23'),_0x42ce('0x24'),_0x42ce('0x25'),_0x42ce('0x26'),_0x42ce('0x27'),_0x42ce('0x28'),'monitor_format',_0x42ce('0x29'),_0x42ce('0x2a'),_0x42ce('0x2b'),_0x42ce('0x2c'),_0x42ce('0x2d'),_0x42ce('0x2e'),'dialDropRetryFrequency',_0x42ce('0x2f'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x42ce('0x30'),_0x42ce('0x31'),_0x42ce('0x32'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x42ce('0x33'),_0x42ce('0x34'),_0x42ce('0x35'),'callAdditionalPhoneAfterMin'],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x42ce('0x2'),_0x42ce('0x36'),_0x42ce('0x37')]},{'model':_0x42ce('0x38'),'as':_0x42ce('0x39'),'attributes':['id',_0x42ce('0x2')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x42ce('0x2'),_0x42ce('0x36'),_0x42ce('0x37')]},{'model':_0x42ce('0x3a'),'as':_0x42ce('0x3a'),'attributes':['id',_0x42ce('0x2')],'include':[{'model':_0x42ce('0x3a'),'as':'Intervals','attributes':['id',_0x42ce('0x2'),_0x42ce('0x3b')]}]}]},'log':_0x42ce('0x3c')});};};
\ No newline at end of file
+var _0xe74f=['dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialPredictiveOptimization','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry'];(function(_0x49655d,_0x5b9f81){var _0x2a9689=function(_0x15a58d){while(--_0x15a58d){_0x49655d['push'](_0x49655d['shift']());}};_0x2a9689(++_0x5b9f81);}(_0xe74f,0x9f));var _0xfe74=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0xe74f[_0x21c2c8];return _0x4dd745;};'use strict';var client=require(_0xfe74('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xfe74('0x1')](_0xfe74('0x2'),{'options':{'raw':![],'attributes':['id',_0xfe74('0x3'),_0xfe74('0x4'),_0xfe74('0x5'),_0xfe74('0x6'),_0xfe74('0x7'),_0xfe74('0x8'),_0xfe74('0x9'),'dialMethod',_0xfe74('0xa'),'dialLimitQueue','dialPowerLevel',_0xfe74('0xb'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName',_0xfe74('0xc'),'dialOriginateTimeout',_0xfe74('0xd'),_0xfe74('0xe'),_0xfe74('0xf'),_0xfe74('0x10'),_0xfe74('0x11'),'dialBusyMaxRetry',_0xfe74('0x12'),_0xfe74('0x13'),'dialNoAnswerRetryFrequency',_0xfe74('0x14'),_0xfe74('0x15'),_0xfe74('0x16'),_0xfe74('0x17'),_0xfe74('0x18'),_0xfe74('0x19'),_0xfe74('0x1a'),_0xfe74('0x1b'),_0xfe74('0x1c'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0xfe74('0x1d'),_0xfe74('0x1e'),_0xfe74('0x1f'),_0xfe74('0x20'),_0xfe74('0x21'),_0xfe74('0x22'),_0xfe74('0x23'),_0xfe74('0x24'),'dialQueueProject2',_0xfe74('0x7'),'strategy','dialRandomLastDigitCallerIdNumber',_0xfe74('0x25'),_0xfe74('0x26'),_0xfe74('0x27'),_0xfe74('0x28'),_0xfe74('0x29'),_0xfe74('0x2a'),'dialAbandonedRetryFrequency',_0xfe74('0x2b'),_0xfe74('0x2c'),_0xfe74('0x2d'),_0xfe74('0x2e'),_0xfe74('0x2f'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xfe74('0x30'),_0xfe74('0x31')],'include':[{'model':_0xfe74('0x32'),'as':'Trunk','attributes':['id',_0xfe74('0x3'),'callerid',_0xfe74('0x33')]},{'model':_0xfe74('0x34'),'as':_0xfe74('0x35'),'attributes':['id',_0xfe74('0x3')]},{'model':_0xfe74('0x32'),'as':_0xfe74('0x36'),'attributes':['id',_0xfe74('0x3'),_0xfe74('0x37'),_0xfe74('0x33')]},{'model':_0xfe74('0x38'),'as':_0xfe74('0x38'),'attributes':['id','name'],'include':[{'model':_0xfe74('0x38'),'as':_0xfe74('0x39'),'attributes':['id',_0xfe74('0x3'),_0xfe74('0x3a')]}]}]},'log':_0xfe74('0x3b')});};};
\ No newline at end of file
index 0cfbbad..d7ebde0 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(_0x2e3eda,_0x57b049){var _0x105bf5=function(_0x4f460c){while(--_0x4f460c){_0x2e3eda['push'](_0x2e3eda['shift']());}};_0x105bf5(++_0x57b049);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x5ae183,_0x30b294){var _0x32517a=function(_0x448dda){while(--_0x448dda){_0x5ae183['push'](_0x5ae183['shift']());}};_0x32517a(++_0x30b294);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 a1e8fac..65e1602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3815=['getVoiceQueueRtPauses','Request','../client'];(function(_0x18593c,_0x448b00){var _0x4f7799=function(_0x16515a){while(--_0x16515a){_0x18593c['push'](_0x18593c['shift']());}};_0x4f7799(++_0x448b00);}(_0x3815,0x7a));var _0x5381=function(_0x2acfdf,_0x44599a){_0x2acfdf=_0x2acfdf-0x0;var _0x4b3fa9=_0x3815[_0x2acfdf];return _0x4b3fa9;};'use strict';var client=require(_0x5381('0x0'));exports[_0x5381('0x1')]=function(_0x46e9cd){return function(){return client[_0x5381('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x46e9cd,'paused':!![]},'raw':!![]},'log':_0x5381('0x1')});};};
\ No newline at end of file
+var _0xdaf9=['getVoiceQueueRtPauses','../client','Request','GetVoiceQueueRtPauses'];(function(_0x150c65,_0x303f38){var _0x4ca489=function(_0x2c2e26){while(--_0x2c2e26){_0x150c65['push'](_0x150c65['shift']());}};_0x4ca489(++_0x303f38);}(_0xdaf9,0x169));var _0x9daf=function(_0x19f5bf,_0x737b09){_0x19f5bf=_0x19f5bf-0x0;var _0x22271d=_0xdaf9[_0x19f5bf];return _0x22271d;};'use strict';var client=require(_0x9daf('0x0'));exports['getVoiceQueueRtPauses']=function(_0x369d42){return function(){return client[_0x9daf('0x1')](_0x9daf('0x2'),{'options':{'where':{'VoiceQueueId':_0x369d42,'paused':!![]},'raw':!![]},'log':_0x9daf('0x3')});};};
\ No newline at end of file
index 16eb900..09091fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x42de65,_0x189074){var _0x24b0f0=function(_0x220e6b){while(--_0x220e6b){_0x42de65['push'](_0x42de65['shift']());}};_0x24b0f0(++_0x189074);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x50eeb2,_0x1e5553){var _0x201b67=function(_0x1ae0b3){while(--_0x1ae0b3){_0x50eeb2['push'](_0x50eeb2['shift']());}};_0x201b67(++_0x1e5553);}(_0x7a54,0x106));var _0x47a5=function(_0x546b46,_0xe7b11e){_0x546b46=_0x546b46-0x0;var _0x53a3ef=_0x7a54[_0x546b46];return _0x53a3ef;};'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
index 988ac6d..94486ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27f6=['transfereeexten','isexternal','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','origtransferercontext','origtransfererexten','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext'];(function(_0x54afc5,_0x324ac9){var _0x440c37=function(_0x3502a5){while(--_0x3502a5){_0x54afc5['push'](_0x54afc5['shift']());}};_0x440c37(++_0x324ac9);}(_0x27f6,0x101));var _0x627f=function(_0x1e5294,_0x54abfc){_0x1e5294=_0x1e5294-0x0;var _0x366ada=_0x27f6[_0x1e5294];return _0x366ada;};'use strict';var client=require('../client');exports['transfers']={};exports[_0x627f('0x0')]=function(_0x1798ff){return client[_0x627f('0x1')](_0x627f('0x2'),{'body':{'result':_0x1798ff['result'],'transfererchannel':_0x1798ff[_0x627f('0x3')],'transferercalleridnum':_0x1798ff[_0x627f('0x4')],'transferercalleridname':_0x1798ff[_0x627f('0x5')],'transfererconnectedlinenum':_0x1798ff[_0x627f('0x6')],'transfererconnectedlinename':_0x1798ff['transfererconnectedlinename'],'transfereraccountcode':_0x1798ff['transfereraccountcode'],'transferercontext':_0x1798ff[_0x627f('0x7')],'transfererexten':_0x1798ff[_0x627f('0x8')],'transfererlinkedid':_0x1798ff['transfererlinkedid'],'transfereechannel':_0x1798ff[_0x627f('0x9')],'transfereecalleridnum':_0x1798ff[_0x627f('0xa')],'transfereecalleridname':_0x1798ff['transfereecalleridname'],'transfereeconnectedlinenum':_0x1798ff[_0x627f('0xb')],'transfereeconnectedlinename':_0x1798ff[_0x627f('0xc')],'transfereeaccountcode':_0x1798ff[_0x627f('0xd')],'transfereecontext':_0x1798ff[_0x627f('0xe')],'transfereeexten':_0x1798ff[_0x627f('0xf')],'transfereelinkedid':_0x1798ff['transfereelinkedid'],'isexternal':_0x1798ff[_0x627f('0x10')],'context':_0x1798ff['context'],'extension':_0x1798ff[_0x627f('0x11')],'type':_0x627f('0x12')},'log':_0x627f('0x2')});};exports[_0x627f('0x13')]=function(_0x4c94ce){return client[_0x627f('0x1')](_0x627f('0x2'),{'body':{'result':_0x4c94ce[_0x627f('0x14')],'transfererchannel':_0x4c94ce[_0x627f('0x15')],'transferercalleridnum':_0x4c94ce[_0x627f('0x16')],'transferercalleridname':_0x4c94ce[_0x627f('0x17')],'transfererconnectedlinenum':_0x4c94ce[_0x627f('0x18')],'transfererconnectedlinename':_0x4c94ce['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4c94ce[_0x627f('0x19')],'transferercontext':_0x4c94ce[_0x627f('0x1a')],'transfererexten':_0x4c94ce[_0x627f('0x1b')],'transfererlinkedid':_0x4c94ce[_0x627f('0x1c')],'transfereechannel':_0x4c94ce['transfertargetchannel'],'transfereecalleridnum':_0x4c94ce[_0x627f('0x1d')],'transfereecalleridname':_0x4c94ce[_0x627f('0x1e')],'transfereeconnectedlinenum':_0x4c94ce[_0x627f('0x1f')],'transfereeconnectedlinename':_0x4c94ce['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4c94ce['transfertargetaccountcode'],'transfereecontext':_0x4c94ce['transfertargetcontext'],'transfereeexten':_0x4c94ce['transfertargetexten'],'transfereelinkedid':_0x4c94ce['transfertargetlinkedid'],'isexternal':_0x4c94ce[_0x627f('0x10')],'context':_0x4c94ce[_0x627f('0x20')],'extension':_0x4c94ce[_0x627f('0x21')],'type':'attended'},'log':_0x627f('0x2')});};
\ No newline at end of file
+var _0x3efc=['attended','../client','blindTransfer','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','CreateVoiceTransferReport','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3efc,0x19b));var _0xc3ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3efc[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xc3ef('0x0'));exports['transfers']={};exports[_0xc3ef('0x1')]=function(_0x15fab9){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x15fab9[_0xc3ef('0x2')],'transfererchannel':_0x15fab9[_0xc3ef('0x3')],'transferercalleridnum':_0x15fab9[_0xc3ef('0x4')],'transferercalleridname':_0x15fab9[_0xc3ef('0x5')],'transfererconnectedlinenum':_0x15fab9[_0xc3ef('0x6')],'transfererconnectedlinename':_0x15fab9[_0xc3ef('0x7')],'transfereraccountcode':_0x15fab9[_0xc3ef('0x8')],'transferercontext':_0x15fab9[_0xc3ef('0x9')],'transfererexten':_0x15fab9[_0xc3ef('0xa')],'transfererlinkedid':_0x15fab9['transfererlinkedid'],'transfereechannel':_0x15fab9[_0xc3ef('0xb')],'transfereecalleridnum':_0x15fab9[_0xc3ef('0xc')],'transfereecalleridname':_0x15fab9[_0xc3ef('0xd')],'transfereeconnectedlinenum':_0x15fab9['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x15fab9[_0xc3ef('0xe')],'transfereeaccountcode':_0x15fab9[_0xc3ef('0xf')],'transfereecontext':_0x15fab9[_0xc3ef('0x10')],'transfereeexten':_0x15fab9[_0xc3ef('0x11')],'transfereelinkedid':_0x15fab9[_0xc3ef('0x12')],'isexternal':_0x15fab9[_0xc3ef('0x13')],'context':_0x15fab9['context'],'extension':_0x15fab9[_0xc3ef('0x14')],'type':'blind'},'log':_0xc3ef('0x15')});};exports[_0xc3ef('0x16')]=function(_0x3a2820){return client[_0xc3ef('0x17')](_0xc3ef('0x15'),{'body':{'result':_0x3a2820['result'],'transfererchannel':_0x3a2820[_0xc3ef('0x18')],'transferercalleridnum':_0x3a2820[_0xc3ef('0x19')],'transferercalleridname':_0x3a2820[_0xc3ef('0x1a')],'transfererconnectedlinenum':_0x3a2820[_0xc3ef('0x1b')],'transfererconnectedlinename':_0x3a2820[_0xc3ef('0x1c')],'transfereraccountcode':_0x3a2820[_0xc3ef('0x1d')],'transferercontext':_0x3a2820[_0xc3ef('0x1e')],'transfererexten':_0x3a2820[_0xc3ef('0x1f')],'transfererlinkedid':_0x3a2820[_0xc3ef('0x20')],'transfereechannel':_0x3a2820[_0xc3ef('0x21')],'transfereecalleridnum':_0x3a2820['transfertargetcalleridnum'],'transfereecalleridname':_0x3a2820[_0xc3ef('0x22')],'transfereeconnectedlinenum':_0x3a2820['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3a2820['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3a2820[_0xc3ef('0x23')],'transfereecontext':_0x3a2820[_0xc3ef('0x24')],'transfereeexten':_0x3a2820['transfertargetexten'],'transfereelinkedid':_0x3a2820[_0xc3ef('0x25')],'isexternal':_0x3a2820[_0xc3ef('0x13')],'context':_0x3a2820[_0xc3ef('0x26')],'extension':_0x3a2820[_0xc3ef('0x27')],'type':_0xc3ef('0x28')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index 2b12a12..b195e8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf55=['util','validate','bluebird','../../../config/environment','../properties','../ami','format','%s/%s','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','then','message','catch','error','command','Action','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','sumBillable','sumHoldTime','total','unmanaged','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','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','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','push','length','omit','undefined','map','channels','channel','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','find','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','Channel\x20doesn\x27t\x20exist','values','voicequeuechannel','queueChannels','Redirect','exten','telephones','trunks','outboundChannels','outbound','campaigns','run','Event\x20name\x20mandatory','emit','event','checkAfterSend','http','listen','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xdf55,0x83));var _0x5df5=function(_0x1e9bf5,_0x2b8466){_0x1e9bf5=_0x1e9bf5-0x0;var _0x3e43a0=_0xdf55[_0x1e9bf5];return _0x3e43a0;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var jayson=require('jayson/promise');var schema=require(_0x5df5('0x2'));var BPromise=require(_0x5df5('0x3'));var moment=require('moment');var config=require(_0x5df5('0x4'));var properties=require(_0x5df5('0x5'));var ami=require(_0x5df5('0x6'));exports['listen']=function(_0x289af4,_0x417341,_0x27ec86){return new BPromise(function(_0x476e21,_0x9b8756){var _0x2b7ed9={'QueuePause':function(_0x4722a2){return new Promise(function(_0x3743f3,_0x4d43a3){var _0x338f2b=util[_0x5df5('0x7')](_0x5df5('0x8'),'SIP',_0x4722a2['name']);if(_0x289af4[_0x5df5('0x9')]&&_0x289af4['timers'][_0x338f2b]&&_0x289af4[_0x5df5('0x9')][_0x338f2b][_0x5df5('0xa')]){_0x289af4['timers'][_0x338f2b]['updateAcw']();}if(_0x289af4[_0x5df5('0xb')][_0x338f2b]){_0x289af4[_0x5df5('0xb')][_0x338f2b][_0x5df5('0xc')]({'statePause':_0x4722a2[_0x5df5('0xd')]?!![]:![]});}_0x3743f3({'code':0xc8,'message':_0x5df5('0xe')});});},'Reload':function(_0xb4a4fe){var _0x37a747=this;return new Promise(function(_0x463990,_0x52bf75){if(ami[_0x5df5('0xf')]()==![]){return _0x52bf75(_0x37a747['error'](0x1f4,[config[_0x5df5('0x10')]['ip'],config['asterisk'][_0x5df5('0x11')],_0x5df5('0x12')][_0x5df5('0x13')]('\x20')));}_0xb4a4fe=_[_0x5df5('0x14')](_0xb4a4fe,_[_0x5df5('0x15')](properties['module']));_0xb4a4fe[_0x5df5('0x16')]=_0x5df5('0x17');return ami['Action'](_0xb4a4fe)[_0x5df5('0x18')](function(_0x45813f){_0x463990({'code':0xc8,'message':_0x45813f[_0x5df5('0x19')]});})[_0x5df5('0x1a')](function(_0x215d59){_0x52bf75(_0x37a747['error'](0x1f5,_0x215d59['message']));});});},'Command':function(_0x48c824){var _0x5d8dfd=this;return new Promise(function(_0x58152a,_0x40a8f5){if(ami[_0x5df5('0xf')]()==![]){return _0x40a8f5(_0x5d8dfd[_0x5df5('0x1b')](0x1f4,[config[_0x5df5('0x10')]['ip'],config['asterisk'][_0x5df5('0x11')],_0x5df5('0x12')][_0x5df5('0x13')]('\x20')));}_0x48c824=_[_0x5df5('0x14')](_0x48c824,_0x5df5('0x1c'));_0x48c824[_0x5df5('0x16')]='Command';return ami[_0x5df5('0x1d')](_0x48c824)[_0x5df5('0x18')](function(_0x8742a7){_0x58152a({'code':0xc8,'message':_0x8742a7[_0x5df5('0x1e')]});})['catch'](function(_0x4358ba){_0x40a8f5(_0x5d8dfd[_0x5df5('0x1b')](0x1f5,_0x4358ba[_0x5df5('0x19')]));});});},'VoiceQueues':function(_0x4a544b){return new Promise(function(_0x52206d,_0x532923){var _0x357fb0=[];for(var _0x3ff82e in _0x289af4[_0x5df5('0x1f')]){if(_0x289af4[_0x5df5('0x1f')][_0x5df5('0x20')](_0x3ff82e)){var _0x1fd83c=_0x289af4[_0x5df5('0x1f')][_0x3ff82e];var _0x28723e={'id':_0x1fd83c['id'],'name':_0x1fd83c['name'],'strategy':_0x1fd83c[_0x5df5('0x21')],'answered':_0x1fd83c['answered'],'available':_0x1fd83c[_0x5df5('0x22')],'loggedIn':_0x1fd83c[_0x5df5('0x23')],'pTalking':_0x1fd83c['pTalking'],'sumBillable':_0x1fd83c[_0x5df5('0x24')],'sumDuration':_0x1fd83c['sumDuration'],'sumHoldTime':_0x1fd83c[_0x5df5('0x25')]||0x0,'talking':_0x1fd83c['talking'],'total':_0x1fd83c[_0x5df5('0x26')],'type':_0x1fd83c['type'],'unmanaged':_0x1fd83c[_0x5df5('0x27')],'abandoned':_0x1fd83c['abandoned'],'waiting':_0x1fd83c[_0x5df5('0x28')],'loggedInDb':_0x1fd83c[_0x5df5('0x29')]};if(_0x1fd83c[_0x5df5('0x2a')]==='outbound'){_0x28723e[_0x5df5('0x2b')]=_0x1fd83c[_0x5df5('0x2b')];_0x28723e[_0x5df5('0x2c')]=_0x1fd83c[_0x5df5('0x2c')];_0x28723e[_0x5df5('0x2d')]=_0x1fd83c[_0x5df5('0x2d')];_0x28723e[_0x5df5('0x2e')]=_0x1fd83c['dialOriginateCallerIdNumber'];_0x28723e['dialOriginateTimeout']=_0x1fd83c[_0x5df5('0x2f')];_0x28723e[_0x5df5('0x30')]=_0x1fd83c[_0x5df5('0x30')];_0x28723e[_0x5df5('0x31')]=_0x1fd83c[_0x5df5('0x31')];_0x28723e[_0x5df5('0x32')]=_0x1fd83c['outboundAnswerAgiCallsDay'];_0x28723e[_0x5df5('0x33')]=_0x1fd83c[_0x5df5('0x33')];_0x28723e[_0x5df5('0x34')]=_0x1fd83c[_0x5df5('0x34')];_0x28723e['outboundBusyCallsDay']=_0x1fd83c[_0x5df5('0x35')];_0x28723e['outboundCongestionCallsDay']=_0x1fd83c[_0x5df5('0x36')];_0x28723e[_0x5df5('0x37')]=_0x1fd83c['outboundDropCallsDayACS'];_0x28723e[_0x5df5('0x38')]=_0x1fd83c['outboundDropCallsDayCallersExit'];_0x28723e[_0x5df5('0x39')]=_0x1fd83c[_0x5df5('0x39')];_0x28723e[_0x5df5('0x3a')]=_0x1fd83c[_0x5df5('0x3a')];_0x28723e['outboundNoSuchCallsDay']=_0x1fd83c[_0x5df5('0x3b')];_0x28723e[_0x5df5('0x3c')]=_0x1fd83c[_0x5df5('0x3c')];_0x28723e[_0x5df5('0x3d')]=_0x1fd83c['outboundReCallsDay'];_0x28723e[_0x5df5('0x3e')]=_0x1fd83c[_0x5df5('0x3e')];_0x28723e[_0x5df5('0x3f')]=_0x1fd83c[_0x5df5('0x3f')];_0x28723e[_0x5df5('0x40')]=_0x1fd83c[_0x5df5('0x40')];_0x28723e[_0x5df5('0x41')]=_0x1fd83c['predictiveIntervalAvgHoldtime'];_0x28723e[_0x5df5('0x42')]=_0x1fd83c[_0x5df5('0x42')];_0x28723e['predictiveIntervalDroppedCallsCallersExit']=_0x1fd83c[_0x5df5('0x43')];_0x28723e[_0x5df5('0x44')]=_0x1fd83c['predictiveIntervalDroppedCallsTimeout'];_0x28723e[_0x5df5('0x45')]=_0x1fd83c[_0x5df5('0x45')];_0x28723e[_0x5df5('0x46')]=_0x1fd83c[_0x5df5('0x46')];_0x28723e[_0x5df5('0x47')]=_0x1fd83c[_0x5df5('0x47')];_0x28723e[_0x5df5('0x48')]=_0x1fd83c[_0x5df5('0x48')];_0x28723e['predictiveIntervalPauses']=_0x1fd83c['predictiveIntervalPauses'];_0x28723e[_0x5df5('0x49')]=_0x1fd83c['predictiveIntervalAvailable'];_0x28723e[_0x5df5('0x4a')]=_0x1fd83c[_0x5df5('0x4a')];_0x28723e['message']=_0x1fd83c[_0x5df5('0x19')];_0x28723e[_0x5df5('0x4b')]=_0x1fd83c[_0x5df5('0x4b')];_0x28723e[_0x5df5('0x4c')]=_0x1fd83c[_0x5df5('0x4c')];_0x28723e[_0x5df5('0x4d')]=_0x1fd83c[_0x5df5('0x4d')];_0x28723e[_0x5df5('0x4e')]=_0x1fd83c['erlangAbandonmentRate'];_0x28723e[_0x5df5('0x4f')]=_0x1fd83c['erlangBusyFactor'];_0x28723e[_0x5df5('0x50')]=_0x1fd83c[_0x5df5('0x50')];_0x28723e[_0x5df5('0x51')]=_0x1fd83c[_0x5df5('0x51')];}if(_0x1fd83c[_0x5df5('0x52')]){_0x28723e['Trunk']={'id':_0x1fd83c[_0x5df5('0x52')]['id'],'name':_0x1fd83c[_0x5df5('0x52')][_0x5df5('0x53')],'active':_0x1fd83c['Trunk'][_0x5df5('0x54')],'callerid':_0x1fd83c[_0x5df5('0x52')]['callerid']};}if(_0x1fd83c[_0x5df5('0x55')]){_0x28723e[_0x5df5('0x55')]={'id':_0x1fd83c[_0x5df5('0x55')]['id'],'name':_0x1fd83c[_0x5df5('0x55')]['name']};}_0x357fb0[_0x5df5('0x56')](_0x28723e);}}_0x52206d({'count':_0x357fb0[_0x5df5('0x57')],'rows':_0x357fb0});});},'UpdateVoiceQueue':function(_0x514fd8){return new Promise(function(_0x18d22c,_0xaf1598){var _0x35927b=_['find'](_0x289af4[_0x5df5('0x1f')],{'id':parseInt(_0x514fd8['id'])});var _0x3842d0=_[_0x5df5('0x58')](_0x514fd8,['id']);if(_0x35927b){for(var _0x2724e3 in _0x3842d0){if(typeof _0x3842d0[_0x2724e3]!=='undefined'&&typeof _0x35927b[_0x2724e3]!==_0x5df5('0x59')){_0x35927b[_0x2724e3]=_0x3842d0[_0x2724e3];}}_0x18d22c(_0x35927b);}else{_0xaf1598();}});},'VoiceChannels':function(_0xcdf101){return new Promise(function(_0x2eb30e,_0x3bbb73){var _0x14f9ca=_['values'](_0x289af4['channels']);_0x2eb30e({'count':_0x14f9ca[_0x5df5('0x57')],'rows':_0x14f9ca});});},'VoiceChannelMixMonitor':function(_0x5b12f1){var _0x35ad9d=this;return new Promise(function(_0x207498,_0x2f43bf){if(ami[_0x5df5('0xf')]()==![]){return _0x2f43bf(_0x35ad9d['error'](0x1f4,[config[_0x5df5('0x10')]['ip'],config[_0x5df5('0x10')][_0x5df5('0x11')],_0x5df5('0x12')][_0x5df5('0x13')]('\x20')));}var _0x2a25fe=schema(properties['voicechannel'])[_0x5df5('0x2')](_0x5b12f1);if(_0x2a25fe['length']>0x0){return _0x2f43bf(_0x35ad9d[_0x5df5('0x1b')](0x1f4,_[_0x5df5('0x5a')](_0x2a25fe,_0x5df5('0x19'))['join'](',\x20')));}var _0x8622f4=_['find'](_0x289af4[_0x5df5('0x5b')],{'uniqueid':_0x5b12f1['uniqueid']});if(_0x8622f4&&_0x8622f4[_0x5df5('0x5c')]){var _0x2e9b93=util[_0x5df5('0x7')]('%s.%s',_0x5b12f1[_0x5df5('0x5d')]||_0x5b12f1[_0x5df5('0x5e')],_0x5b12f1['format']||_0x5df5('0x5f'));return ami[_0x5df5('0x1d')]({'action':_0x5df5('0x60'),'channel':_0x8622f4[_0x5df5('0x5c')],'file':_0x2e9b93,'options':_0x5df5('0x61')})[_0x5df5('0x18')](function(_0x16fc86){var _0x48087d=_[_0x5df5('0x62')](_0x8622f4['monitors'],{'filename':_0x5df5('0x63')+_0x2e9b93[_0x5df5('0x64')]()});if(_[_0x5df5('0x65')](_0x48087d)){_0x8622f4[_0x5df5('0x66')][_0x5df5('0x56')]({'filename':_0x5df5('0x63')+_0x2e9b93[_0x5df5('0x64')](),'createdAt':moment()[_0x5df5('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x16fc86[_0x5df5('0x67')],'status':_0x5df5('0x68')});}else{_0x48087d[_0x5df5('0x67')]=_0x16fc86[_0x5df5('0x67')];_0x48087d[_0x5df5('0x69')]='rec';}_0x207498({'code':0xc8,'message':[_0x5b12f1[_0x5df5('0x5e')],'MixMonitor\x20Success',_0x16fc86['mixmonitorid']][_0x5df5('0x13')]('\x20'),'mixmonitorid':_0x16fc86[_0x5df5('0x67')]});})[_0x5df5('0x1a')](function(_0x210ad2){_0x2f43bf(_0x35ad9d[_0x5df5('0x1b')](0x1f5,[_0x5b12f1[_0x5df5('0x5e')],_0x210ad2['message'][_0x5df5('0x64')]()][_0x5df5('0x13')]('\x20')));});}else{return _0x2f43bf(_0x35ad9d['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x7fdce7){var _0x2e6d4d=this;return new Promise(function(_0x9a168c,_0x4672c5){if(ami[_0x5df5('0xf')]()==![]){return _0x4672c5(_0x2e6d4d[_0x5df5('0x1b')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x5df5('0x12')][_0x5df5('0x13')]('\x20')));}var _0x57e3ea=schema(properties[_0x5df5('0x6a')])[_0x5df5('0x2')](_0x7fdce7);if(_0x57e3ea[_0x5df5('0x57')]>0x0){return _0x4672c5(_0x2e6d4d[_0x5df5('0x1b')](0x1f4,_[_0x5df5('0x5a')](_0x57e3ea,_0x5df5('0x19'))[_0x5df5('0x13')](',\x20')));}var _0x95e12=_[_0x5df5('0x62')](_0x289af4['channels'],{'uniqueid':_0x7fdce7[_0x5df5('0x5e')]});if(_0x95e12){return BPromise[_0x5df5('0x6b')]()[_0x5df5('0x18')](function(){if(_0x95e12[_0x5df5('0x5c')]){return ami[_0x5df5('0x1d')]({'action':_0x5df5('0x6c'),'channel':_0x95e12[_0x5df5('0x5c')],'mixmonitorid':_0x7fdce7[_0x5df5('0x67')]})[_0x5df5('0x1a')](function(_0xf3e0ac){});}})[_0x5df5('0x18')](function(){if(_0x95e12[_0x5df5('0x6d')]){return ami['Action']({'action':_0x5df5('0x6c'),'channel':_0x95e12[_0x5df5('0x6d')],'mixmonitorid':_0x7fdce7['mixmonitorid']})[_0x5df5('0x1a')](function(_0x24702a){});}})[_0x5df5('0x18')](function(_0x26e2aa){var _0x5137fb=_[_0x5df5('0x62')](_0x95e12[_0x5df5('0x66')],{'mixmonitorid':_0x7fdce7['mixmonitorid']});if(_0x5137fb){_0x5137fb['status']=_0x5df5('0x6e');}})[_0x5df5('0x18')](function(){var _0x9e61ef=util['format']('%s.%s',_0x7fdce7[_0x5df5('0x5d')]||_0x7fdce7[_0x5df5('0x5e')],_0x7fdce7['format']||_0x5df5('0x5f'));var _0x1b3785=_[_0x5df5('0x62')](_0x95e12[_0x5df5('0x66')],{'filename':_0x5df5('0x63')+_0x9e61ef['toLowerCase']()});if(_0x1b3785){_0x1b3785[_0x5df5('0x69')]=_0x5df5('0x6e');}})[_0x5df5('0x18')](function(){_0x9a168c({'code':0xc8,'message':[_0x7fdce7[_0x5df5('0x5e')],'StopMixMonitor\x20Success'][_0x5df5('0x13')]('\x20')});})['catch'](function(_0x10f893){_0x4672c5(_0x2e6d4d[_0x5df5('0x1b')](0x1f5,[_0x7fdce7['uniqueid'],_0x10f893[_0x5df5('0x19')]['toLowerCase']()][_0x5df5('0x13')]('\x20')));});}else{return _0x4672c5(_0x2e6d4d['error'](0x1f5,_0x5df5('0x6f')));}});},'VoiceQueuesChannels':function(_0x3b8aaf){return new Promise(function(_0x37a40c,_0x21332d){var _0x2a90aa=_[_0x5df5('0x70')](_0x289af4['queueChannels']);_0x37a40c({'count':_0x2a90aa[_0x5df5('0x57')],'rows':_0x2a90aa});});},'VoiceQueuesChannel':function(_0x643ee9){var _0x30a019=this;return new Promise(function(_0x554de4,_0x33c7d7){var _0x32114d=schema(properties[_0x5df5('0x71')])[_0x5df5('0x2')](_0x643ee9);if(_0x32114d[_0x5df5('0x57')]>0x0){return _0x33c7d7(_0x30a019[_0x5df5('0x1b')](0x1f4,_['map'](_0x32114d,'message')[_0x5df5('0x13')](',\x20')));}var _0x23159c=_[_0x5df5('0x62')](_0x289af4[_0x5df5('0x72')],{'uniqueid':_0x643ee9[_0x5df5('0x5e')]});if(_0x23159c){_0x554de4(_0x23159c);}else{return _0x33c7d7(_0x30a019['error'](0x1f5,_0x5df5('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x2cf2d1){var _0x14e068=this;return new Promise(function(_0x54e5e0,_0x247022){if(ami[_0x5df5('0xf')]()==![]){return _0x247022(_0x14e068[_0x5df5('0x1b')](0x1f4,[config[_0x5df5('0x10')]['ip'],config[_0x5df5('0x10')][_0x5df5('0x11')],_0x5df5('0x12')][_0x5df5('0x13')]('\x20')));}var _0x2675cc=schema(properties['voicequeuechannelhangup'])[_0x5df5('0x2')](_0x2cf2d1);if(_0x2675cc[_0x5df5('0x57')]>0x0){return _0x247022(_0x14e068[_0x5df5('0x1b')](0x1f4,_['map'](_0x2675cc,_0x5df5('0x19'))[_0x5df5('0x13')](',\x20')));}var _0x49f2da=_[_0x5df5('0x62')](_0x289af4[_0x5df5('0x72')],{'uniqueid':_0x2cf2d1[_0x5df5('0x5e')]});if(_0x49f2da&&_0x49f2da['channel']){return ami[_0x5df5('0x1d')]({'action':'Hangup','channel':_0x49f2da[_0x5df5('0x5c')]})[_0x5df5('0x18')](function(_0x17c836){_0x54e5e0({'code':0xc8,'message':[_0x2cf2d1[_0x5df5('0x5e')],_0x17c836[_0x5df5('0x19')][_0x5df5('0x64')]()]['join']('\x20')});})[_0x5df5('0x1a')](function(_0x7b85c6){_0x247022(_0x14e068['error'](0x1f5,[_0x2cf2d1[_0x5df5('0x5e')],_0x7b85c6['message']['toLowerCase']()][_0x5df5('0x13')]('\x20')));});}else{return _0x247022(_0x14e068['error'](0x1f5,_0x5df5('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x19c839){var _0x311dc0=this;return new Promise(function(_0x1f3f81,_0x453238){if(ami[_0x5df5('0xf')]()==![]){return _0x453238(_0x311dc0['error'](0x1f4,[config[_0x5df5('0x10')]['ip'],config[_0x5df5('0x10')][_0x5df5('0x11')],'ami\x20disconnected'][_0x5df5('0x13')]('\x20')));}var _0x2d065b=schema(properties['voicequeuechannelredirect'])[_0x5df5('0x2')](_0x19c839);if(_0x2d065b[_0x5df5('0x57')]>0x0){return _0x453238(_0x311dc0[_0x5df5('0x1b')](0x1f4,_[_0x5df5('0x5a')](_0x2d065b,_0x5df5('0x19'))['join'](',\x20')));}var _0x2e2830=_['find'](_0x289af4[_0x5df5('0x72')],{'uniqueid':_0x19c839['uniqueid']});if(_0x2e2830&&_0x2e2830[_0x5df5('0x5c')]){return ami[_0x5df5('0x1d')]({'action':_0x5df5('0x73'),'channel':_0x2e2830[_0x5df5('0x5c')],'exten':_0x19c839[_0x5df5('0x74')],'context':_0x19c839['context']||_0x2e2830['context'],'priority':0x1})[_0x5df5('0x18')](function(_0x179b78){_0x1f3f81({'code':0xc8,'message':[_0x19c839[_0x5df5('0x5e')],_0x179b78[_0x5df5('0x19')][_0x5df5('0x64')]()]['join']('\x20')});})[_0x5df5('0x1a')](function(_0xdceef4){_0x453238(_0x311dc0[_0x5df5('0x1b')](0x1f5,[_0x19c839[_0x5df5('0x5e')],_0xdceef4[_0x5df5('0x19')][_0x5df5('0x64')]()][_0x5df5('0x13')]('\x20')));});}else{return _0x453238(_0x311dc0[_0x5df5('0x1b')](0x1f5,_0x5df5('0x6f')));}});},'Agents':function(_0x285281){return new Promise(function(_0x1bff6c,_0x535fee){var _0x581a59=_['values'](_0x289af4[_0x5df5('0xb')]);_0x1bff6c({'count':_0x581a59[_0x5df5('0x57')],'rows':_0x581a59});});},'Telephones':function(_0x496790){return new Promise(function(_0x1bb992,_0x11bb45){var _0x1e1d34=_[_0x5df5('0x70')](_0x289af4[_0x5df5('0x75')]);_0x1bb992({'count':_0x1e1d34[_0x5df5('0x57')],'rows':_0x1e1d34});});},'Trunks':function(_0x36d8ee){return new Promise(function(_0x4f8f84,_0x331afb){var _0x36c355=_[_0x5df5('0x70')](_0x289af4[_0x5df5('0x76')]);_0x4f8f84({'count':_0x36c355[_0x5df5('0x57')],'rows':_0x36c355});});},'OutboundChannels':function(_0x259f6a){return new Promise(function(_0x3d8c32,_0x535fe6){var _0x34dd22=_[_0x5df5('0x70')](_0x289af4[_0x5df5('0x77')]);_0x3d8c32({'count':_0x34dd22[_0x5df5('0x57')],'rows':_0x34dd22});});},'Outbound':function(_0x24b27c){return new Promise(function(_0x41110a,_0x226636){_0x41110a(_0x289af4[_0x5df5('0x78')]);});},'Campaigns':function(_0x523a89){return new Promise(function(_0x4594d2,_0x2a1916){var _0x508bc6=_[_0x5df5('0x70')](_0x289af4[_0x5df5('0x79')]);_0x4594d2({'count':_0x508bc6[_0x5df5('0x57')],'rows':_0x508bc6});});},'VoiceQueuesPreview':function(_0x25229d){var _0x177b00=this;return new Promise(function(_0x5907b8,_0x19d854){_0x417341[_0x5df5('0x7a')](_0x25229d['id'])[_0x5df5('0x18')](function(_0x4cb7d9){_0x5907b8({'code':0xc8,'message':_0x4cb7d9['message']});})[_0x5df5('0x1a')](function(_0x3f0579){_0x19d854(_0x177b00[_0x5df5('0x1b')](0x1f4,_0x3f0579[_0x5df5('0x19')]));});});},'EventManager':function(_0x19d901){var _0x2a4fef=this;return new Promise(function(_0x584a16,_0x53217e){if(!_0x19d901['event']){return _0x53217e(_0x2a4fef[_0x5df5('0x1b')](0x1f4,_0x5df5('0x7b')));}ami[_0x5df5('0x7c')]('custom:'+_0x19d901[_0x5df5('0x7d')],_0x19d901['message']);_0x584a16({'code':0xc8,'message':_0x19d901});});},'FaxAccounts':function(_0xc53f8d){return new Promise(function(_0x172f01,_0x530de6){var _0x18281b=_[_0x5df5('0x70')](_0x289af4['faxAccounts']);_0x172f01({'count':_0x18281b[_0x5df5('0x57')],'rows':_0x18281b});});},'SendFax':function(_0x19a281){var _0x4367f5=this;return new Promise(function(_0x9fffdb,_0x5372c8){_0x27ec86['send'](_0x19a281)[_0x5df5('0x18')](function(_0x2484ee){_0x9fffdb({'code':0xc8,'message':_0x2484ee[_0x5df5('0x19')]});})['catch'](function(_0x30231a){_0x5372c8(_0x4367f5[_0x5df5('0x1b')](0x1f4,_0x30231a[_0x5df5('0x19')]));});});},'CheckAfterSend':function(_0xfa3cde){var _0x8be225=this;return new Promise(function(_0x5857a1,_0x6b6ddb){_0x27ec86[_0x5df5('0x7e')](_0xfa3cde)[_0x5df5('0x18')](function(_0x10a013){_0x5857a1({'code':0xc8,'message':_0x10a013[_0x5df5('0x19')]});})[_0x5df5('0x1a')](function(_0x2683ec){_0x6b6ddb(_0x8be225[_0x5df5('0x1b')](0x1f4,_0x2683ec[_0x5df5('0x19')]));});});}};var _0x3eb955=jayson['server'](_0x2b7ed9)[_0x5df5('0x7f')]();_0x3eb955['on'](_0x5df5('0x1b'),function(_0x4efacf){return _0x9b8756(_0x4efacf);});_0x3eb955[_0x5df5('0x80')](0x232a,_0x5df5('0x81'),function(){console['log'](_0x5df5('0x82'),0x232a);return _0x476e21(_0x5df5('0x83')+0x232a);});});};
\ No newline at end of file
+var _0xb46f=['channels','voicechannel','length','uniqueid','format','filename','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','map','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','Channel\x20doesn\x27t\x20exist','voicequeuechannelredirect','Redirect','context','telephones','trunks','campaigns','emit','custom:','event','send','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','listen','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Action','then','catch','message','pick','command','Command','voiceQueues','hasOwnProperty','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','find','omit','undefined','values'];(function(_0x4dffcb,_0x4b1a00){var _0x1e059f=function(_0x38414e){while(--_0x38414e){_0x4dffcb['push'](_0x4dffcb['shift']());}};_0x1e059f(++_0x4b1a00);}(_0xb46f,0xb6));var _0xfb46=function(_0x216a87,_0x4ecb85){_0x216a87=_0x216a87-0x0;var _0x405e43=_0xb46f[_0x216a87];return _0x405e43;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var jayson=require('jayson/promise');var schema=require(_0xfb46('0x2'));var BPromise=require(_0xfb46('0x3'));var moment=require(_0xfb46('0x4'));var config=require(_0xfb46('0x5'));var properties=require(_0xfb46('0x6'));var ami=require('../ami');exports[_0xfb46('0x7')]=function(_0x544ae9,_0x299dba,_0x3a5255){return new BPromise(function(_0x186da6,_0x1efd40){var _0x35103d={'QueuePause':function(_0x47c1a2){return new Promise(function(_0x9871f5,_0x298a84){var _0x4b1a94=util['format']('%s/%s','SIP',_0x47c1a2[_0xfb46('0x8')]);if(_0x544ae9['timers']&&_0x544ae9[_0xfb46('0x9')][_0x4b1a94]&&_0x544ae9[_0xfb46('0x9')][_0x4b1a94][_0xfb46('0xa')]){_0x544ae9[_0xfb46('0x9')][_0x4b1a94][_0xfb46('0xb')]();}if(_0x544ae9[_0xfb46('0xc')][_0x4b1a94]){_0x544ae9[_0xfb46('0xc')][_0x4b1a94][_0xfb46('0xd')]({'statePause':_0x47c1a2[_0xfb46('0xe')]?!![]:![]});}_0x9871f5({'code':0xc8,'message':_0xfb46('0xf')});});},'Reload':function(_0x57c68b){var _0x480229=this;return new Promise(function(_0x133a1c,_0x50ec54){if(ami[_0xfb46('0x10')]()==![]){return _0x50ec54(_0x480229[_0xfb46('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xfb46('0x12')][_0xfb46('0x13')],_0xfb46('0x14')][_0xfb46('0x15')]('\x20')));}_0x57c68b=_['pick'](_0x57c68b,_[_0xfb46('0x16')](properties[_0xfb46('0x17')]));_0x57c68b[_0xfb46('0x18')]='Reload';return ami[_0xfb46('0x19')](_0x57c68b)[_0xfb46('0x1a')](function(_0x47959d){_0x133a1c({'code':0xc8,'message':_0x47959d['message']});})[_0xfb46('0x1b')](function(_0x473136){_0x50ec54(_0x480229[_0xfb46('0x11')](0x1f5,_0x473136[_0xfb46('0x1c')]));});});},'Command':function(_0x2521d0){var _0x23c6ee=this;return new Promise(function(_0x9f8bd7,_0x3b9872){if(ami[_0xfb46('0x10')]()==![]){return _0x3b9872(_0x23c6ee[_0xfb46('0x11')](0x1f4,[config[_0xfb46('0x12')]['ip'],config[_0xfb46('0x12')]['username'],_0xfb46('0x14')][_0xfb46('0x15')]('\x20')));}_0x2521d0=_[_0xfb46('0x1d')](_0x2521d0,_0xfb46('0x1e'));_0x2521d0[_0xfb46('0x18')]=_0xfb46('0x1f');return ami[_0xfb46('0x19')](_0x2521d0)[_0xfb46('0x1a')](function(_0x1010e0){_0x9f8bd7({'code':0xc8,'message':_0x1010e0['content']});})[_0xfb46('0x1b')](function(_0x5a8dde){_0x3b9872(_0x23c6ee[_0xfb46('0x11')](0x1f5,_0x5a8dde[_0xfb46('0x1c')]));});});},'VoiceQueues':function(_0x2cad2b){return new Promise(function(_0x8c83bb,_0xf9bbd1){var _0x3359fb=[];for(var _0x254f6c in _0x544ae9['voiceQueues']){if(_0x544ae9[_0xfb46('0x20')][_0xfb46('0x21')](_0x254f6c)){var _0x309c7f=_0x544ae9[_0xfb46('0x20')][_0x254f6c];var _0x22d795={'id':_0x309c7f['id'],'name':_0x309c7f[_0xfb46('0x8')],'strategy':_0x309c7f[_0xfb46('0x22')],'answered':_0x309c7f[_0xfb46('0x23')],'available':_0x309c7f[_0xfb46('0x24')],'loggedIn':_0x309c7f['loggedIn'],'pTalking':_0x309c7f[_0xfb46('0x25')],'sumBillable':_0x309c7f[_0xfb46('0x26')],'sumDuration':_0x309c7f[_0xfb46('0x27')],'sumHoldTime':_0x309c7f[_0xfb46('0x28')]||0x0,'talking':_0x309c7f['talking'],'total':_0x309c7f[_0xfb46('0x29')],'type':_0x309c7f[_0xfb46('0x2a')],'unmanaged':_0x309c7f[_0xfb46('0x2b')],'abandoned':_0x309c7f[_0xfb46('0x2c')],'waiting':_0x309c7f[_0xfb46('0x2d')],'loggedInDb':_0x309c7f['loggedInDb']};if(_0x309c7f[_0xfb46('0x2a')]===_0xfb46('0x2e')){_0x22d795['dialActive']=_0x309c7f[_0xfb46('0x2f')];_0x22d795['dialMethod']=_0x309c7f[_0xfb46('0x30')];_0x22d795['dialOriginateCallerIdName']=_0x309c7f[_0xfb46('0x31')];_0x22d795['dialOriginateCallerIdNumber']=_0x309c7f[_0xfb46('0x32')];_0x22d795[_0xfb46('0x33')]=_0x309c7f['dialOriginateTimeout'];_0x22d795[_0xfb46('0x34')]=_0x309c7f[_0xfb46('0x34')];_0x22d795['temp']=_0x309c7f[_0xfb46('0x35')];_0x22d795[_0xfb46('0x36')]=_0x309c7f['outboundAnswerAgiCallsDay'];_0x22d795['outboundAnswerCallsDay']=_0x309c7f[_0xfb46('0x37')];_0x22d795[_0xfb46('0x38')]=_0x309c7f[_0xfb46('0x38')];_0x22d795[_0xfb46('0x39')]=_0x309c7f[_0xfb46('0x39')];_0x22d795[_0xfb46('0x3a')]=_0x309c7f[_0xfb46('0x3a')];_0x22d795[_0xfb46('0x3b')]=_0x309c7f[_0xfb46('0x3b')];_0x22d795['outboundDropCallsDayCallersExit']=_0x309c7f[_0xfb46('0x3c')];_0x22d795['outboundDropCallsDayTimeout']=_0x309c7f['outboundDropCallsDayTimeout'];_0x22d795[_0xfb46('0x3d')]=_0x309c7f[_0xfb46('0x3d')];_0x22d795[_0xfb46('0x3e')]=_0x309c7f[_0xfb46('0x3e')];_0x22d795[_0xfb46('0x3f')]=_0x309c7f[_0xfb46('0x3f')];_0x22d795[_0xfb46('0x40')]=_0x309c7f[_0xfb46('0x40')];_0x22d795['outboundRejectCallsDay']=_0x309c7f[_0xfb46('0x41')];_0x22d795[_0xfb46('0x42')]=_0x309c7f[_0xfb46('0x42')];_0x22d795[_0xfb46('0x43')]=_0x309c7f['predictiveIntervalAnsweredCalls'];_0x22d795[_0xfb46('0x44')]=_0x309c7f[_0xfb46('0x44')];_0x22d795[_0xfb46('0x45')]=_0x309c7f[_0xfb46('0x45')];_0x22d795[_0xfb46('0x46')]=_0x309c7f[_0xfb46('0x46')];_0x22d795[_0xfb46('0x47')]=_0x309c7f[_0xfb46('0x47')];_0x22d795['predictiveIntervalErlangCalls']=_0x309c7f[_0xfb46('0x48')];_0x22d795[_0xfb46('0x49')]=_0x309c7f[_0xfb46('0x49')];_0x22d795['predictiveIntervalHitRate']=_0x309c7f[_0xfb46('0x4a')];_0x22d795[_0xfb46('0x4b')]=_0x309c7f[_0xfb46('0x4b')];_0x22d795['predictiveIntervalPauses']=_0x309c7f[_0xfb46('0x4c')];_0x22d795['predictiveIntervalAvailable']=_0x309c7f['predictiveIntervalAvailable'];_0x22d795[_0xfb46('0x4d')]=_0x309c7f[_0xfb46('0x4d')];_0x22d795[_0xfb46('0x1c')]=_0x309c7f[_0xfb46('0x1c')];_0x22d795[_0xfb46('0x4e')]=_0x309c7f[_0xfb46('0x4e')];_0x22d795[_0xfb46('0x4f')]=_0x309c7f[_0xfb46('0x4f')];_0x22d795[_0xfb46('0x50')]=_0x309c7f[_0xfb46('0x50')];_0x22d795['erlangAbandonmentRate']=_0x309c7f[_0xfb46('0x51')];_0x22d795[_0xfb46('0x52')]=_0x309c7f[_0xfb46('0x52')];_0x22d795[_0xfb46('0x53')]=_0x309c7f[_0xfb46('0x53')];_0x22d795[_0xfb46('0x54')]=_0x309c7f['startProgressive'];}if(_0x309c7f['Trunk']){_0x22d795[_0xfb46('0x55')]={'id':_0x309c7f[_0xfb46('0x55')]['id'],'name':_0x309c7f[_0xfb46('0x55')][_0xfb46('0x8')],'active':_0x309c7f[_0xfb46('0x55')]['active'],'callerid':_0x309c7f['Trunk']['callerid']};}if(_0x309c7f[_0xfb46('0x56')]){_0x22d795['Interval']={'id':_0x309c7f['Interval']['id'],'name':_0x309c7f[_0xfb46('0x56')][_0xfb46('0x8')]};}_0x3359fb[_0xfb46('0x57')](_0x22d795);}}_0x8c83bb({'count':_0x3359fb['length'],'rows':_0x3359fb});});},'UpdateVoiceQueue':function(_0x3c5f7a){return new Promise(function(_0x5f38d9,_0x19883a){var _0x3eede1=_[_0xfb46('0x58')](_0x544ae9[_0xfb46('0x20')],{'id':parseInt(_0x3c5f7a['id'])});var _0x423c8c=_[_0xfb46('0x59')](_0x3c5f7a,['id']);if(_0x3eede1){for(var _0x45dec0 in _0x423c8c){if(typeof _0x423c8c[_0x45dec0]!==_0xfb46('0x5a')&&typeof _0x3eede1[_0x45dec0]!==_0xfb46('0x5a')){_0x3eede1[_0x45dec0]=_0x423c8c[_0x45dec0];}}_0x5f38d9(_0x3eede1);}else{_0x19883a();}});},'VoiceChannels':function(_0x325d65){return new Promise(function(_0x370438,_0x281024){var _0x32aaed=_[_0xfb46('0x5b')](_0x544ae9[_0xfb46('0x5c')]);_0x370438({'count':_0x32aaed['length'],'rows':_0x32aaed});});},'VoiceChannelMixMonitor':function(_0x1071cb){var _0x2ae5d2=this;return new Promise(function(_0xf1042f,_0x3e6d4e){if(ami[_0xfb46('0x10')]()==![]){return _0x3e6d4e(_0x2ae5d2['error'](0x1f4,[config[_0xfb46('0x12')]['ip'],config[_0xfb46('0x12')][_0xfb46('0x13')],_0xfb46('0x14')][_0xfb46('0x15')]('\x20')));}var _0x1ddc8e=schema(properties[_0xfb46('0x5d')])[_0xfb46('0x2')](_0x1071cb);if(_0x1ddc8e[_0xfb46('0x5e')]>0x0){return _0x3e6d4e(_0x2ae5d2[_0xfb46('0x11')](0x1f4,_['map'](_0x1ddc8e,'message')[_0xfb46('0x15')](',\x20')));}var _0x3372c5=_[_0xfb46('0x58')](_0x544ae9[_0xfb46('0x5c')],{'uniqueid':_0x1071cb[_0xfb46('0x5f')]});if(_0x3372c5&&_0x3372c5['channel']){var _0x27bdac=util[_0xfb46('0x60')]('%s.%s',_0x1071cb[_0xfb46('0x61')]||_0x1071cb['uniqueid'],_0x1071cb[_0xfb46('0x60')]||'wav');return ami['Action']({'action':_0xfb46('0x62'),'channel':_0x3372c5[_0xfb46('0x63')],'file':_0x27bdac,'options':_0xfb46('0x64')})[_0xfb46('0x1a')](function(_0x20ad43){var _0x2d431b=_[_0xfb46('0x58')](_0x3372c5[_0xfb46('0x65')],{'filename':_0xfb46('0x66')+_0x27bdac[_0xfb46('0x67')]()});if(_[_0xfb46('0x68')](_0x2d431b)){_0x3372c5['monitors']['push']({'filename':'/var/spool/asterisk/monitor/'+_0x27bdac['toLowerCase'](),'createdAt':moment()['format'](_0xfb46('0x69')),'mixmonitorid':_0x20ad43['mixmonitorid'],'status':_0xfb46('0x6a')});}else{_0x2d431b['mixmonitorid']=_0x20ad43[_0xfb46('0x6b')];_0x2d431b[_0xfb46('0x6c')]='rec';}_0xf1042f({'code':0xc8,'message':[_0x1071cb[_0xfb46('0x5f')],_0xfb46('0x6d'),_0x20ad43[_0xfb46('0x6b')]][_0xfb46('0x15')]('\x20'),'mixmonitorid':_0x20ad43[_0xfb46('0x6b')]});})[_0xfb46('0x1b')](function(_0x219ef2){_0x3e6d4e(_0x2ae5d2[_0xfb46('0x11')](0x1f5,[_0x1071cb[_0xfb46('0x5f')],_0x219ef2['message'][_0xfb46('0x67')]()]['join']('\x20')));});}else{return _0x3e6d4e(_0x2ae5d2[_0xfb46('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0xfa5fd8){var _0x2ebaa1=this;return new Promise(function(_0x4c4ace,_0x5cf87e){if(ami[_0xfb46('0x10')]()==![]){return _0x5cf87e(_0x2ebaa1['error'](0x1f4,[config[_0xfb46('0x12')]['ip'],config['asterisk'][_0xfb46('0x13')],'ami\x20disconnected'][_0xfb46('0x15')]('\x20')));}var _0x2019ea=schema(properties['voicechannel'])[_0xfb46('0x2')](_0xfa5fd8);if(_0x2019ea[_0xfb46('0x5e')]>0x0){return _0x5cf87e(_0x2ebaa1[_0xfb46('0x11')](0x1f4,_[_0xfb46('0x6e')](_0x2019ea,'message')[_0xfb46('0x15')](',\x20')));}var _0x130046=_['find'](_0x544ae9[_0xfb46('0x5c')],{'uniqueid':_0xfa5fd8[_0xfb46('0x5f')]});if(_0x130046){return BPromise[_0xfb46('0x6f')]()[_0xfb46('0x1a')](function(){if(_0x130046['channel']){return ami[_0xfb46('0x19')]({'action':_0xfb46('0x70'),'channel':_0x130046[_0xfb46('0x63')],'mixmonitorid':_0xfa5fd8[_0xfb46('0x6b')]})[_0xfb46('0x1b')](function(_0x4f19f4){});}})[_0xfb46('0x1a')](function(){if(_0x130046[_0xfb46('0x71')]){return ami[_0xfb46('0x19')]({'action':_0xfb46('0x70'),'channel':_0x130046[_0xfb46('0x71')],'mixmonitorid':_0xfa5fd8[_0xfb46('0x6b')]})[_0xfb46('0x1b')](function(_0x189c94){});}})[_0xfb46('0x1a')](function(_0x2b55fc){var _0x5628c3=_['find'](_0x130046['monitors'],{'mixmonitorid':_0xfa5fd8['mixmonitorid']});if(_0x5628c3){_0x5628c3[_0xfb46('0x6c')]=_0xfb46('0x72');}})[_0xfb46('0x1a')](function(){var _0x524246=util[_0xfb46('0x60')](_0xfb46('0x73'),_0xfa5fd8[_0xfb46('0x61')]||_0xfa5fd8[_0xfb46('0x5f')],_0xfa5fd8[_0xfb46('0x60')]||_0xfb46('0x74'));var _0x33559b=_['find'](_0x130046[_0xfb46('0x65')],{'filename':_0xfb46('0x66')+_0x524246[_0xfb46('0x67')]()});if(_0x33559b){_0x33559b[_0xfb46('0x6c')]='stop';}})[_0xfb46('0x1a')](function(){_0x4c4ace({'code':0xc8,'message':[_0xfa5fd8[_0xfb46('0x5f')],_0xfb46('0x75')][_0xfb46('0x15')]('\x20')});})[_0xfb46('0x1b')](function(_0x1c5d6e){_0x5cf87e(_0x2ebaa1[_0xfb46('0x11')](0x1f5,[_0xfa5fd8[_0xfb46('0x5f')],_0x1c5d6e['message'][_0xfb46('0x67')]()]['join']('\x20')));});}else{return _0x5cf87e(_0x2ebaa1['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x425fb7){return new Promise(function(_0x489a0e,_0x54a8b6){var _0xfed506=_[_0xfb46('0x5b')](_0x544ae9[_0xfb46('0x76')]);_0x489a0e({'count':_0xfed506[_0xfb46('0x5e')],'rows':_0xfed506});});},'VoiceQueuesChannel':function(_0x22a683){var _0x291425=this;return new Promise(function(_0x2bb077,_0x462b51){var _0x1db31a=schema(properties['voicequeuechannel'])[_0xfb46('0x2')](_0x22a683);if(_0x1db31a[_0xfb46('0x5e')]>0x0){return _0x462b51(_0x291425[_0xfb46('0x11')](0x1f4,_['map'](_0x1db31a,'message')['join'](',\x20')));}var _0x18545b=_[_0xfb46('0x58')](_0x544ae9[_0xfb46('0x76')],{'uniqueid':_0x22a683[_0xfb46('0x5f')]});if(_0x18545b){_0x2bb077(_0x18545b);}else{return _0x462b51(_0x291425['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x390003){var _0x93e8c8=this;return new Promise(function(_0x3e2679,_0x5523e1){if(ami['isConnected']()==![]){return _0x5523e1(_0x93e8c8[_0xfb46('0x11')](0x1f4,[config[_0xfb46('0x12')]['ip'],config[_0xfb46('0x12')][_0xfb46('0x13')],_0xfb46('0x14')][_0xfb46('0x15')]('\x20')));}var _0x56f3f2=schema(properties[_0xfb46('0x77')])[_0xfb46('0x2')](_0x390003);if(_0x56f3f2[_0xfb46('0x5e')]>0x0){return _0x5523e1(_0x93e8c8['error'](0x1f4,_[_0xfb46('0x6e')](_0x56f3f2,'message')['join'](',\x20')));}var _0x46cca6=_[_0xfb46('0x58')](_0x544ae9[_0xfb46('0x76')],{'uniqueid':_0x390003[_0xfb46('0x5f')]});if(_0x46cca6&&_0x46cca6[_0xfb46('0x63')]){return ami[_0xfb46('0x19')]({'action':_0xfb46('0x78'),'channel':_0x46cca6[_0xfb46('0x63')]})[_0xfb46('0x1a')](function(_0x5a5bce){_0x3e2679({'code':0xc8,'message':[_0x390003[_0xfb46('0x5f')],_0x5a5bce[_0xfb46('0x1c')][_0xfb46('0x67')]()]['join']('\x20')});})[_0xfb46('0x1b')](function(_0x1932ac){_0x5523e1(_0x93e8c8[_0xfb46('0x11')](0x1f5,[_0x390003[_0xfb46('0x5f')],_0x1932ac[_0xfb46('0x1c')][_0xfb46('0x67')]()]['join']('\x20')));});}else{return _0x5523e1(_0x93e8c8[_0xfb46('0x11')](0x1f5,_0xfb46('0x79')));}});},'VoiceQueuesChannelRedirect':function(_0x2cecd7){var _0x5ccdfc=this;return new Promise(function(_0x162a6e,_0x4f64ad){if(ami[_0xfb46('0x10')]()==![]){return _0x4f64ad(_0x5ccdfc[_0xfb46('0x11')](0x1f4,[config[_0xfb46('0x12')]['ip'],config[_0xfb46('0x12')][_0xfb46('0x13')],'ami\x20disconnected'][_0xfb46('0x15')]('\x20')));}var _0x2de077=schema(properties[_0xfb46('0x7a')])['validate'](_0x2cecd7);if(_0x2de077['length']>0x0){return _0x4f64ad(_0x5ccdfc[_0xfb46('0x11')](0x1f4,_['map'](_0x2de077,_0xfb46('0x1c'))[_0xfb46('0x15')](',\x20')));}var _0x416f4c=_[_0xfb46('0x58')](_0x544ae9[_0xfb46('0x76')],{'uniqueid':_0x2cecd7[_0xfb46('0x5f')]});if(_0x416f4c&&_0x416f4c[_0xfb46('0x63')]){return ami[_0xfb46('0x19')]({'action':_0xfb46('0x7b'),'channel':_0x416f4c['channel'],'exten':_0x2cecd7['exten'],'context':_0x2cecd7[_0xfb46('0x7c')]||_0x416f4c[_0xfb46('0x7c')],'priority':0x1})[_0xfb46('0x1a')](function(_0x2cbcb1){_0x162a6e({'code':0xc8,'message':[_0x2cecd7[_0xfb46('0x5f')],_0x2cbcb1['message'][_0xfb46('0x67')]()][_0xfb46('0x15')]('\x20')});})[_0xfb46('0x1b')](function(_0x5efc53){_0x4f64ad(_0x5ccdfc[_0xfb46('0x11')](0x1f5,[_0x2cecd7[_0xfb46('0x5f')],_0x5efc53['message'][_0xfb46('0x67')]()][_0xfb46('0x15')]('\x20')));});}else{return _0x4f64ad(_0x5ccdfc['error'](0x1f5,_0xfb46('0x79')));}});},'Agents':function(_0x36403a){return new Promise(function(_0x57faa4,_0x30831f){var _0x50388b=_[_0xfb46('0x5b')](_0x544ae9[_0xfb46('0xc')]);_0x57faa4({'count':_0x50388b[_0xfb46('0x5e')],'rows':_0x50388b});});},'Telephones':function(_0x875647){return new Promise(function(_0x2093af,_0x2d2710){var _0x2591ae=_[_0xfb46('0x5b')](_0x544ae9[_0xfb46('0x7d')]);_0x2093af({'count':_0x2591ae[_0xfb46('0x5e')],'rows':_0x2591ae});});},'Trunks':function(_0x4ee492){return new Promise(function(_0x146160,_0x54ea61){var _0x1020db=_[_0xfb46('0x5b')](_0x544ae9[_0xfb46('0x7e')]);_0x146160({'count':_0x1020db[_0xfb46('0x5e')],'rows':_0x1020db});});},'OutboundChannels':function(_0x179a67){return new Promise(function(_0x271b2c,_0xbb14ec){var _0x31239d=_[_0xfb46('0x5b')](_0x544ae9['outboundChannels']);_0x271b2c({'count':_0x31239d[_0xfb46('0x5e')],'rows':_0x31239d});});},'Outbound':function(_0x5dc1b5){return new Promise(function(_0x4374e5,_0x5b1521){_0x4374e5(_0x544ae9[_0xfb46('0x2e')]);});},'Campaigns':function(_0x4233a0){return new Promise(function(_0x131c68,_0x3e9976){var _0x5690e8=_[_0xfb46('0x5b')](_0x544ae9[_0xfb46('0x7f')]);_0x131c68({'count':_0x5690e8[_0xfb46('0x5e')],'rows':_0x5690e8});});},'VoiceQueuesPreview':function(_0x39a431){var _0x206eb9=this;return new Promise(function(_0x4bbc45,_0x57f2dc){_0x299dba['run'](_0x39a431['id'])[_0xfb46('0x1a')](function(_0x52a41b){_0x4bbc45({'code':0xc8,'message':_0x52a41b['message']});})['catch'](function(_0x234a9a){_0x57f2dc(_0x206eb9[_0xfb46('0x11')](0x1f4,_0x234a9a[_0xfb46('0x1c')]));});});},'EventManager':function(_0x19a7ee){var _0x32e9d5=this;return new Promise(function(_0x3dbf01,_0x59b27c){if(!_0x19a7ee['event']){return _0x59b27c(_0x32e9d5[_0xfb46('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xfb46('0x80')](_0xfb46('0x81')+_0x19a7ee[_0xfb46('0x82')],_0x19a7ee[_0xfb46('0x1c')]);_0x3dbf01({'code':0xc8,'message':_0x19a7ee});});},'FaxAccounts':function(_0x1b426a){return new Promise(function(_0xa921b7,_0x4c63e4){var _0xa2f96a=_[_0xfb46('0x5b')](_0x544ae9['faxAccounts']);_0xa921b7({'count':_0xa2f96a[_0xfb46('0x5e')],'rows':_0xa2f96a});});},'SendFax':function(_0x42bd9c){var _0x53392a=this;return new Promise(function(_0x8281e1,_0x1d6f52){_0x3a5255[_0xfb46('0x83')](_0x42bd9c)[_0xfb46('0x1a')](function(_0x2248e2){_0x8281e1({'code':0xc8,'message':_0x2248e2[_0xfb46('0x1c')]});})['catch'](function(_0x510c81){_0x1d6f52(_0x53392a[_0xfb46('0x11')](0x1f4,_0x510c81[_0xfb46('0x1c')]));});});},'CheckAfterSend':function(_0x9c7418){var _0x836bba=this;return new Promise(function(_0x2d2d9b,_0x148e09){_0x3a5255[_0xfb46('0x84')](_0x9c7418)['then'](function(_0x1f1bb8){_0x2d2d9b({'code':0xc8,'message':_0x1f1bb8[_0xfb46('0x1c')]});})[_0xfb46('0x1b')](function(_0x76b967){_0x148e09(_0x836bba[_0xfb46('0x11')](0x1f4,_0x76b967[_0xfb46('0x1c')]));});});}};var _0x20b5d7=jayson[_0xfb46('0x85')](_0x35103d)['http']();_0x20b5d7['on'](_0xfb46('0x11'),function(_0x58318c){return _0x1efd40(_0x58318c);});_0x20b5d7[_0xfb46('0x7')](0x232a,_0xfb46('0x86'),function(){console['log'](_0xfb46('0x87'),0x232a);return _0x186da6(_0xfb46('0x88')+0x232a);});});};
\ No newline at end of file
index 503e07e..c5faf44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd935=['length','info','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','<unknown>','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','phone','map','destcalleridnum','calleridnum','routeId','firstName','lastName','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xd935,0xc6));var _0x5d93=function(_0x495d03,_0x2766ce){_0x495d03=_0x495d03-0x0;var _0x4e849b=_0xd935[_0x495d03];return _0x4e849b;};'use strict';var _=require(_0x5d93('0x0'));var BPromise=require(_0x5d93('0x1'));var Redis=require(_0x5d93('0x2'));var util=require(_0x5d93('0x3'));var config=require(_0x5d93('0x4'));var logger=require('../../../../config/logger')(_0x5d93('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0x5d93('0x6')]=_[_0x5d93('0x7')](config[_0x5d93('0x6')],{'host':_0x5d93('0x8'),'port':0x18eb});var io=require(_0x5d93('0x9'))(new Redis(config[_0x5d93('0x6')]));function emit(_0x252e8a,_0x7f35c2,_0x1dd9fc,_0x1aa13c,_0x1f927b){logger['info'](_0x5d93('0xa'),_0x252e8a,_0x7f35c2['id'],_0x1dd9fc,_0x1aa13c,JSON['stringify'](_0x1f927b));io['to'](_0x1dd9fc)[_0x5d93('0xb')](_0x1aa13c,_0x1f927b);}exports[_0x5d93('0xc')]=function(_0x169000,_0x1d4cee,_0x406133,_0x77e3e0){var _0x3119cd,_0xd1556b;var _0xd0e86f={};var _0x128024;var _0x558693=Number(_0x406133[_0x5d93('0xd')]);var _0x2569c9=_0x406133['data2']?Boolean(Number(_0x406133[_0x5d93('0xe')])):![];var _0x507d36;var _0x3b27e9=![];if(!_['isNil'](_0x406133[_0x5d93('0xf')])){if(_0x406133[_0x5d93('0xf')]=='1')_0x3b27e9=!![];}if(!_0x3b27e9){if(_0x77e3e0[_0x5d93('0x10')]){_0xd0e86f['id']=_0x77e3e0[_0x5d93('0x10')];}}if(!_0xd0e86f['id']){_0xd0e86f[_0x5d93('0x11')]=_0x558693;_0x507d36=_0x406133[_0x5d93('0x12')]&&_0x406133[_0x5d93('0x12')]!=='0'?_0x406133[_0x5d93('0x12')]['split'](','):[_0x5d93('0x13')];_0xd0e86f['$or']=_[_0x5d93('0x14')](_0x507d36,function(_0xfba5d7){var _0x3a5573={};_0x3a5573[_0xfba5d7]=_0x77e3e0['routeId']?_0x77e3e0[_0x5d93('0x15')]:_0x77e3e0[_0x5d93('0x16')];return _0x3a5573;});_0x128024=_0x77e3e0[_0x5d93('0x17')]?_0x77e3e0[_0x5d93('0x15')]:_0x77e3e0[_0x5d93('0x16')];}var _0x5c5ad4=['id',_0x5d93('0x18'),_0x5d93('0x19'),_0x5d93('0x13'),'mobile',_0x5d93('0x1a'),_0x5d93('0x11'),_0x5d93('0x1b'),_0x5d93('0x1c'),'updatedAt'];var _0x4f5901=_[_0x5d93('0x1d')](_0x5c5ad4,_0x507d36);BPromise[_0x5d93('0x1e')]()[_0x5d93('0x1f')](cmContactRpc[_0x5d93('0x20')]({'attributes':_0x4f5901,'where':_0xd0e86f,'phone':_0x128024}))[_0x5d93('0x1f')](function(_0x13bc4a){_0xd1556b=_0x13bc4a;if(!_[_0x5d93('0x21')](_0xd1556b)){if(_0xd1556b[_0x5d93('0x22')]===0x1){_0x3119cd=_0xd1556b[0x0];logger[_0x5d93('0x23')](_0x5d93('0x24'),_0x77e3e0['uniqueid'],_0x1d4cee['id'],_0x3119cd['id']);}else{logger[_0x5d93('0x23')](_0x5d93('0x25'),_0x77e3e0[_0x5d93('0x26')],_0x1d4cee['id'],_[_0x5d93('0x14')](_0xd1556b,'id')[_0x5d93('0x27')](','));}return;}else{logger[_0x5d93('0x23')](_0x5d93('0x28'),_0x77e3e0[_0x5d93('0x26')],_0x1d4cee['id']);var _0x28a151={'ListId':_0x558693};var _0xeca840=_0x406133[_0x5d93('0x29')]&&_0x406133[_0x5d93('0x29')]!=='0'?_0x406133[_0x5d93('0x29')]:'phone';if(_0x2569c9){logger[_0x5d93('0x23')](_0x5d93('0x2a'),_0x77e3e0['uniqueid'],_0x1d4cee['id']);_0x28a151[_0xeca840]=_[_0x5d93('0x2b')](_0x77e3e0['routeId'])?_0x77e3e0[_0x5d93('0x16')]:_0x77e3e0[_0x5d93('0x15')];if(_[_0x5d93('0x2b')](_0x77e3e0[_0x5d93('0x17')])){_0x28a151[_0x5d93('0x18')]=_0x77e3e0[_0x5d93('0x2c')]&&_0x77e3e0[_0x5d93('0x2c')]!=='<unknown>'?_0x77e3e0[_0x5d93('0x2c')]:_0x5d93('0x2d');}else{_0x28a151[_0x5d93('0x18')]=_0x77e3e0[_0x5d93('0x2e')]&&_0x77e3e0[_0x5d93('0x2e')]!=='<unknown>'?_0x77e3e0[_0x5d93('0x2e')]:'Unknown';}return BPromise[_0x5d93('0x1e')]()['then'](cmContactRpc[_0x5d93('0x2f')](_0x28a151))[_0x5d93('0x1f')](function(_0x48edf8){_0x3119cd=_0x48edf8;_0xd1556b[_0x5d93('0x30')](_0x48edf8);if(_0x3119cd){logger[_0x5d93('0x23')](_0x5d93('0x31'),_0x77e3e0[_0x5d93('0x26')],_0x1d4cee['id'],_0x3119cd['id']);}return;});}else{logger[_0x5d93('0x23')](_0x5d93('0x32'),_0x77e3e0[_0x5d93('0x26')],_0x1d4cee['id']);_0x28a151[_0xeca840]=_[_0x5d93('0x2b')](_0x77e3e0['routeId'])?_0x77e3e0['calleridnum']:_0x77e3e0['destcalleridnum'];if(_[_0x5d93('0x2b')](_0x77e3e0['routeId'])){_0x28a151[_0x5d93('0x18')]=_0x77e3e0[_0x5d93('0x2c')]&&_0x77e3e0[_0x5d93('0x2c')]!==_0x5d93('0x33')?_0x77e3e0[_0x5d93('0x2c')]:_0x5d93('0x2d');}else{_0x28a151[_0x5d93('0x18')]=_0x77e3e0[_0x5d93('0x2e')]&&_0x77e3e0[_0x5d93('0x2e')]!==_0x5d93('0x33')?_0x77e3e0['destcalleridname']:'Unknown';}_0x3119cd=_0x28a151;_0xd1556b[_0x5d93('0x30')](_0x28a151);return;}}})[_0x5d93('0x1f')](function(){if(_0x169000){emit(_0x77e3e0[_0x5d93('0x26')],_0x1d4cee,util[_0x5d93('0x34')]('user:%s',_0x169000[_0x5d93('0x35')]),util[_0x5d93('0x34')](_0x5d93('0x36'),_0x406133[_0x5d93('0x37')][_0x5d93('0x38')]()),{'evt':_[_0x5d93('0x39')](_0x77e3e0,{'autoCreate':_0x2569c9}),'contact':_0x3119cd===undefined?{}:_0x3119cd,'contacts':_0xd1556b[_0x5d93('0x22')]===0x0?undefined:_0xd1556b});}});};
\ No newline at end of file
+var _0x5636=['data3','split','phone','$or','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','length','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','destcalleridnum','isNil','routeId','firstName','calleridname','Unknown','destcalleridname','<unknown>','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','toLowerCase','merge','lodash','bluebird','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','data5','xmd-contactid','ListId'];(function(_0x31444b,_0x27644b){var _0x295b3f=function(_0x39b982){while(--_0x39b982){_0x31444b['push'](_0x31444b['shift']());}};_0x295b3f(++_0x27644b);}(_0x5636,0x102));var _0x6563=function(_0x175b10,_0x5af057){_0x175b10=_0x175b10-0x0;var _0xabcb2d=_0x5636[_0x175b10];return _0xabcb2d;};'use strict';var _=require(_0x6563('0x0'));var BPromise=require(_0x6563('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x6563('0x2'))(_0x6563('0x3'));var cmContactRpc=require(_0x6563('0x4'));config['redis']=_[_0x6563('0x5')](config[_0x6563('0x6')],{'host':_0x6563('0x7'),'port':0x18eb});var io=require(_0x6563('0x8'))(new Redis(config[_0x6563('0x6')]));function emit(_0x193942,_0x9884a9,_0x2d57d5,_0x2d0d5b,_0x98fcd4){logger[_0x6563('0x9')](_0x6563('0xa'),_0x193942,_0x9884a9['id'],_0x2d57d5,_0x2d0d5b,JSON[_0x6563('0xb')](_0x98fcd4));io['to'](_0x2d57d5)['emit'](_0x2d0d5b,_0x98fcd4);}exports['exec']=function(_0x2946f3,_0x129fa3,_0x490a56,_0x506ee9){var _0x5da960,_0x1ef002;var _0x111d38={};var _0x35936d=Number(_0x490a56[_0x6563('0xc')]);var _0x33816e=_0x490a56[_0x6563('0xd')]?Boolean(Number(_0x490a56[_0x6563('0xd')])):![];var _0xbbae72;var _0x447f9a=![];if(!_['isNil'](_0x490a56[_0x6563('0xe')])){if(_0x490a56['data5']=='1')_0x447f9a=!![];}if(!_0x447f9a){if(_0x506ee9[_0x6563('0xf')]){_0x111d38['id']=_0x506ee9[_0x6563('0xf')];}}if(!_0x111d38['id']){_0x111d38[_0x6563('0x10')]=_0x35936d;_0xbbae72=_0x490a56[_0x6563('0x11')]&&_0x490a56['data3']!=='0'?_0x490a56[_0x6563('0x11')][_0x6563('0x12')](','):[_0x6563('0x13')];_0x111d38[_0x6563('0x14')]=_['map'](_0xbbae72,function(_0x3563fd){var _0x589632={};_0x589632[_0x3563fd]=_0x506ee9['routeId']?_0x506ee9['destcalleridnum']:_0x506ee9[_0x6563('0x15')];return _0x589632;});}var _0x4f5609=['id','firstName',_0x6563('0x16'),_0x6563('0x13'),_0x6563('0x17'),_0x6563('0x18'),_0x6563('0x10'),_0x6563('0x19'),_0x6563('0x1a'),_0x6563('0x1b')];var _0x2a70f0=_['union'](_0x4f5609,_0xbbae72);BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x1e')]({'attributes':_0x2a70f0,'where':_0x111d38}))['then'](function(_0x293db2){_0x1ef002=_0x293db2;if(!_['isEmpty'](_0x1ef002)){if(_0x1ef002[_0x6563('0x1f')]===0x1){_0x5da960=_0x1ef002[0x0];logger[_0x6563('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x506ee9['uniqueid'],_0x129fa3['id'],_0x5da960['id']);}else{logger[_0x6563('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_[_0x6563('0x21')](_0x1ef002,'id')[_0x6563('0x22')](','));}return;}else{logger['info'](_0x6563('0x23'),_0x506ee9['uniqueid'],_0x129fa3['id']);var _0x7ea857={'ListId':_0x35936d};var _0x1590e6=_0x490a56['data4']&&_0x490a56[_0x6563('0x24')]!=='0'?_0x490a56[_0x6563('0x24')]:'phone';if(_0x33816e){logger[_0x6563('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x506ee9[_0x6563('0x20')],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_['isNil'](_0x506ee9['routeId'])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857[_0x6563('0x28')]=_0x506ee9['calleridname']&&_0x506ee9[_0x6563('0x29')]!=='<unknown>'?_0x506ee9['calleridname']:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9[_0x6563('0x2b')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:_0x6563('0x2a');}return BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x2d')](_0x7ea857))['then'](function(_0x9b3d86){_0x5da960=_0x9b3d86;_0x1ef002[_0x6563('0x2e')](_0x9b3d86);if(_0x5da960){logger[_0x6563('0x9')](_0x6563('0x2f'),_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_0x5da960['id']);}return;});}else{logger[_0x6563('0x9')](_0x6563('0x30'),_0x506ee9['uniqueid'],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857['firstName']=_0x506ee9[_0x6563('0x29')]&&_0x506ee9[_0x6563('0x29')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x29')]:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9['destcalleridname']!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:'Unknown';}_0x5da960=_0x7ea857;_0x1ef002[_0x6563('0x2e')](_0x7ea857);return;}}})[_0x6563('0x1d')](function(){if(_0x2946f3){emit(_0x506ee9['uniqueid'],_0x129fa3,util['format'](_0x6563('0x31'),_0x2946f3[_0x6563('0x32')]),util[_0x6563('0x33')](_0x6563('0x34'),_0x490a56['action'][_0x6563('0x35')]()),{'evt':_[_0x6563('0x36')](_0x506ee9,{'autoCreate':_0x33816e}),'contact':_0x5da960===undefined?{}:_0x5da960,'contacts':_0x1ef002['length']===0x0?undefined:_0x1ef002});}});};
\ No newline at end of file
index 7cc9481..4f877ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab54=['chat','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','lodash','url','mustache','ioredis','./urlforward','./cmContact','trigger','../ami','defaults','localhost','socket.io-emitter','redis','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','deskAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','prototype','clone','motionChannel','undefined','voice','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','length','Actions','interface','action','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','data3','isNil','uriLocation','data4','800','data5','600','data6','winapp','winApplication','winArguments','user:%s','name','trigger:%s:%s','jscripty','format','trigger:%s','exec','accounts','queue','routeId','urlforward','script','parse','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','account'];(function(_0x135577,_0x920f8b){var _0x233570=function(_0x4850f8){while(--_0x4850f8){_0x135577['push'](_0x135577['shift']());}};_0x233570(++_0x920f8b);}(_0xab54,0x115));var _0x4ab5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab54[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var _=require(_0x4ab5('0x0'));var url=require(_0x4ab5('0x1'));var Mustache=require(_0x4ab5('0x2'));var Redis=require(_0x4ab5('0x3'));var urlforward=require(_0x4ab5('0x4'));var integration=require('./integration');var cmContact=require(_0x4ab5('0x5'));var script=require('./script');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x4ab5('0x6'));var ami=require(_0x4ab5('0x7'));config['redis']=_[_0x4ab5('0x8')](config['redis'],{'host':_0x4ab5('0x9'),'port':0x18eb});var io=require(_0x4ab5('0xa'))(new Redis(config[_0x4ab5('0xb')]));var operators={'equals':function(_0x3aef7c,_0x5bf7f6){return _0x3aef7c==_0x5bf7f6;},'not_equals':function(_0x58e6a7,_0x5f5209){return _0x58e6a7!=_0x5f5209;}};var barAndWebActions=[_0x4ab5('0xc'),_0x4ab5('0x1'),'winapp'];function Trigger(_0x32a206){this[_0x4ab5('0xd')]=_0x32a206['triggers'];this[_0x4ab5('0xe')]=_0x32a206[_0x4ab5('0xe')];this[_0x4ab5('0xf')]=_0x32a206[_0x4ab5('0xf')];this[_0x4ab5('0x10')]=_0x32a206[_0x4ab5('0x10')];this[_0x4ab5('0x11')]=_0x32a206[_0x4ab5('0x11')];this[_0x4ab5('0x12')]=_0x32a206[_0x4ab5('0x12')];this[_0x4ab5('0x13')]=_0x32a206[_0x4ab5('0x13')];this[_0x4ab5('0x14')]=_0x32a206[_0x4ab5('0x14')];this['sugarcrmAccounts']=_0x32a206[_0x4ab5('0x15')];this['zohoAccounts']=_0x32a206[_0x4ab5('0x16')];this['deskAccounts']=_0x32a206['deskAccounts'];this[_0x4ab5('0x17')]=_0x32a206[_0x4ab5('0x17')];this[_0x4ab5('0x18')]=_0x32a206[_0x4ab5('0x18')];this['dynamics365Accounts']=_0x32a206[_0x4ab5('0x19')];this[_0x4ab5('0x1a')]=_0x32a206['freshsalesAccounts'];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x4ab5('0x14')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x4ab5('0x16')],'desk':this[_0x4ab5('0x1b')],'vtiger':this[_0x4ab5('0x17')],'dynamics365':this[_0x4ab5('0x19')],'freshsales':this[_0x4ab5('0x1a')],'servicenow':this[_0x4ab5('0x18')]};ami['on'](_0x4ab5('0x1c'),this['syncCustomEvent'][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x1e'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x20'),this[_0x4ab5('0x1f')]['bind'](this));ami['on'](_0x4ab5('0x21'),this['syncCustomEvent'][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x22'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x23'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x24'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on']('custom:agentcongestion',this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x25'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x26'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x27'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x28'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on']('custom:dialbegin',this[_0x4ab5('0x29')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x2a'),this['syncAgentDial']['bind'](this));ami['on'](_0x4ab5('0x2b'),this[_0x4ab5('0x29')][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x2c'),this['syncCustomEvent'][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x2d'),this['syncCustomEvent'][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x2e'),this[_0x4ab5('0x1f')]['bind'](this));ami['on'](_0x4ab5('0x2f'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on']('custom:outgoingmessage',this[_0x4ab5('0x1f')]['bind'](this));ami['on'](_0x4ab5('0x30'),this['syncCustomEvent'][_0x4ab5('0x1d')](this));ami['on'](_0x4ab5('0x31'),this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));ami['on']('custom:offlineMessage',this[_0x4ab5('0x1f')][_0x4ab5('0x1d')](this));}Trigger['prototype'][_0x4ab5('0x32')]=function(_0x387f42,_0x2897f1,_0x1172e5){logger[_0x4ab5('0x33')](_0x387f42,_0x2897f1,JSON[_0x4ab5('0x34')](_0x1172e5));io['to'](_0x387f42)['emit'](_0x2897f1,_0x1172e5);};Trigger[_0x4ab5('0x35')][_0x4ab5('0x1f')]=function(_0x2c11a2){var _0x50e9d1=_[_0x4ab5('0x36')](_0x2c11a2);if(typeof _0x50e9d1[_0x4ab5('0x37')]===_0x4ab5('0x38')){_0x50e9d1[_0x4ab5('0x37')]=_0x4ab5('0x39');}this[_0x4ab5('0x3a')](_0x50e9d1);};Trigger[_0x4ab5('0x35')][_0x4ab5('0x29')]=function(_0x54d2ab){if(this[_0x4ab5('0xe')][_0x54d2ab['interface']]){this[_0x4ab5('0x1f')](_0x54d2ab);}};Trigger[_0x4ab5('0x35')][_0x4ab5('0x3a')]=function(_0x226abe){var _0x1f76ed;for(var _0x1bbf05 in this[_0x4ab5('0xd')]){if(this[_0x4ab5('0xd')][_0x4ab5('0x3b')](_0x1bbf05)){if(this['triggers'][_0x1bbf05][_0x4ab5('0x3c')]){_0x1f76ed=this[_0x4ab5('0x3d')](this['triggers'][_0x1bbf05],_0x226abe);if(_0x1f76ed){_[_0x4ab5('0x3e')](_0x226abe,_0x226abe[_0x4ab5('0x3f')]);for(var _0x1c7c42=0x0,_0x7c62e3,_0x337372,_0x368ee0;_0x1c7c42<this[_0x4ab5('0xd')][_0x1bbf05]['Actions'][_0x4ab5('0x40')];_0x1c7c42+=0x1){_0x7c62e3=this[_0x4ab5('0xd')][_0x1bbf05][_0x4ab5('0x41')][_0x1c7c42];if(this[_0x4ab5('0xe')][_0x226abe[_0x4ab5('0x42')]]){switch(_0x7c62e3[_0x4ab5('0x43')][_0x4ab5('0x44')]()){case _0x4ab5('0x45'):break;case'motionbar':case _0x4ab5('0x46'):var _0x124d69={};switch(barAndWebActions[_0x7c62e3[_0x4ab5('0x47')]]){case _0x4ab5('0xc'):_0x124d69[_0x4ab5('0x48')]=_0x7c62e3[_0x4ab5('0x49')];_0x124d69[_0x4ab5('0x4a')]=this[_0x4ab5('0x10')][_0x7c62e3['data2']]?Mustache[_0x4ab5('0x4b')](this['templates'][_0x7c62e3[_0x4ab5('0x49')]][_0x4ab5('0x4a')],_0x226abe):_0x4ab5('0x4c');break;case'url':_0x124d69[_0x4ab5('0x4d')]=this[_0x4ab5('0x4e')](_0x7c62e3[_0x4ab5('0x49')],_0x226abe,_['isNil'](_0x7c62e3['data3'])?!![]:parseInt(_0x7c62e3[_0x4ab5('0x4f')],0xa));if(_[_0x4ab5('0x50')](_0x7c62e3['data4'])){_0x124d69['location']='0';}else{_0x124d69[_0x4ab5('0x51')]=_0x7c62e3[_0x4ab5('0x52')];_0x124d69['windowWidth']=_['isNil'](_0x7c62e3['data5'])?_0x4ab5('0x53'):_0x7c62e3[_0x4ab5('0x54')];_0x124d69['windowHeight']=_[_0x4ab5('0x50')](_0x7c62e3['data6'])?_0x4ab5('0x55'):_0x7c62e3[_0x4ab5('0x56')];}break;case _0x4ab5('0x57'):_0x124d69[_0x4ab5('0x58')]=_0x7c62e3[_0x4ab5('0x49')]?Mustache[_0x4ab5('0x4b')](_0x7c62e3[_0x4ab5('0x49')],_0x226abe):'';_0x124d69[_0x4ab5('0x59')]=_0x7c62e3['data3']?Mustache[_0x4ab5('0x4b')](_0x7c62e3[_0x4ab5('0x4f')],_0x226abe):'';break;}this['emit'](util['format'](_0x4ab5('0x5a'),this[_0x4ab5('0xe')][_0x226abe['interface']][_0x4ab5('0x5b')]),util['format'](_0x4ab5('0x5c'),_0x7c62e3['action'][_0x4ab5('0x44')](),barAndWebActions[_0x7c62e3['data1']]),_['merge'](_0x124d69,_0x226abe));break;case _0x4ab5('0x5d'):this['emit'](util[_0x4ab5('0x5e')](_0x4ab5('0x5a'),this['agents'][_0x226abe[_0x4ab5('0x42')]][_0x4ab5('0x5b')]),util[_0x4ab5('0x5e')](_0x4ab5('0x5f'),_0x7c62e3[_0x4ab5('0x43')][_0x4ab5('0x44')]()),_[_0x4ab5('0x3e')]({'ProjectId':parseInt(_0x7c62e3[_0x4ab5('0x47')],0xa)},_0x226abe));break;default:this[_0x4ab5('0x32')](util['format'](_0x4ab5('0x5a'),this[_0x4ab5('0xe')][_0x226abe['interface']]['name']),util[_0x4ab5('0x5e')](_0x4ab5('0x5f'),_0x7c62e3[_0x4ab5('0x43')][_0x4ab5('0x44')]()),_[_0x4ab5('0x3e')]({},_0x7c62e3,_0x226abe));}}switch(_0x7c62e3[_0x4ab5('0x43')][_0x4ab5('0x44')]()){case _0x4ab5('0x45'):cmContact['exec'](this[_0x4ab5('0xe')][_0x226abe[_0x4ab5('0x42')]],this[_0x4ab5('0xd')][_0x1bbf05],_0x7c62e3,_0x226abe);break;case'integration':integration[_0x4ab5('0x60')](_0x7c62e3,_0x226abe,this[_0x4ab5('0x61')],this['agents'][_0x226abe[_0x4ab5('0x42')]],this[_0x4ab5('0xf')][_0x226abe[_0x4ab5('0x62')]],this[_0x4ab5('0x11')][_0x226abe[_0x4ab5('0x63')]]);break;case _0x4ab5('0x64'):urlforward[_0x4ab5('0x60')](_0x7c62e3,_0x226abe);break;case _0x4ab5('0x65'):script[_0x4ab5('0x60')](_0x7c62e3,_0x226abe);break;}}}}}}};Trigger[_0x4ab5('0x35')][_0x4ab5('0x4e')]=function(_0x393486,_0x1385e,_0x4ccf8b){var _0x4b6586=url[_0x4ab5('0x66')](Mustache[_0x4ab5('0x4b')](_0x393486,_0x1385e),!![]);if(_0x4ccf8b){_[_0x4ab5('0x3e')](_0x4b6586['query'],_0x1385e);}delete _0x4b6586[_0x4ab5('0x67')];var _0x2ad28c=url[_0x4ab5('0x5e')](_0x4b6586);_0x2ad28c=_0x2ad28c[_0x4ab5('0x68')](/\/\?/g,'?');return _0x2ad28c;};Trigger[_0x4ab5('0x35')][_0x4ab5('0x3d')]=function(_0x3b2544,_0x415b01){var _0x315238=!![];var _0x438421=!![];var _0x31eea4=![];if(_0x3b2544[_0x4ab5('0x69')]===_0x415b01[_0x4ab5('0x37')]){_0x31eea4=!![];}if(_0x3b2544[_0x4ab5('0x6a')][_0x4ab5('0x40')]){_0x315238=_[_0x4ab5('0x6b')](_0x3b2544['AllConditions'],this[_0x4ab5('0x6c')](_0x415b01,_0x3b2544['channel']));}if(_0x3b2544[_0x4ab5('0x6d')][_0x4ab5('0x40')]){_0x438421=_[_0x4ab5('0x6e')](_0x3b2544[_0x4ab5('0x6d')],this[_0x4ab5('0x6c')](_0x415b01,_0x3b2544['channel']));}return _0x31eea4&&_0x315238&&_0x438421;};Trigger['prototype'][_0x4ab5('0x6c')]=function(_0x36b063,_0x295811){return function(_0x4b62d5){switch(_0x4b62d5[_0x4ab5('0x6f')]){case _0x4ab5('0x70'):if(_0x36b063['channel']===_0x295811){if(_0x295811===_0x4ab5('0x71')){return _0x36b063[_0x4ab5('0x72')]?operators[_0x4b62d5[_0x4ab5('0x73')]](Number(_0x4b62d5['value']),_0x36b063[_0x4ab5('0x72')]):![];}else{return _0x36b063[_[_0x4ab5('0x74')](_0x295811)+_0x4ab5('0x75')]?operators[_0x4b62d5[_0x4ab5('0x73')]](Number(_0x4b62d5[_0x4ab5('0x76')]),_0x36b063[_['upperFirst'](_0x295811)+_0x4ab5('0x75')]):![];}}break;case _0x4ab5('0x77'):case _0x4ab5('0x78'):if(_0x36b063['channel']===_0x295811){return _0x36b063[_0x4ab5('0x79')]?operators[_0x4b62d5[_0x4ab5('0x73')]](_0x4b62d5[_0x4ab5('0x76')],_0x36b063[_0x4ab5('0x79')]):![];}break;case _0x4ab5('0x62'):return _0x36b063[_0x4ab5('0x62')]?operators[_0x4b62d5[_0x4ab5('0x73')]](_0x4b62d5['value'],_0x36b063[_0x4ab5('0x62')]):![];case _0x4ab5('0x7a'):return _0x36b063[_0x4ab5('0x7b')]?operators[_0x4b62d5['operator']](_0x4b62d5['value'],_0x36b063[_0x4ab5('0x7b')]):![];case _0x4ab5('0x7c'):return _0x36b063[_0x4ab5('0x7c')]?operators[_0x4b62d5[_0x4ab5('0x73')]](_0x4b62d5[_0x4ab5('0x76')],_0x36b063[_0x4ab5('0x7c')]):![];case _0x4ab5('0x63'):return _0x36b063[_0x4ab5('0x63')]?operators[_0x4b62d5[_0x4ab5('0x73')]](_0x4b62d5['value'],_0x36b063[_0x4ab5('0x63')]):![];case _0x4ab5('0x7d'):if(_0x4b62d5['value']===_0x4ab5('0x7e'))_0x4b62d5['value']=null;return typeof _0x36b063[_0x4ab5('0x7f')]!==_0x4ab5('0x38')?operators[_0x4b62d5[_0x4ab5('0x73')]](_0x4b62d5[_0x4ab5('0x76')],_0x36b063['substatus']):![];case _0x4ab5('0x80'):if(_0x36b063[_0x4ab5('0x69')]===_0x295811){return _0x4b62d5[_0x4ab5('0x76')]===_0x4ab5('0x81')&&_0x4b62d5[_0x4ab5('0x73')]==='equals'?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0xee4a=['exec','routeId','script','parse','query','replace','channel','motionChannel','AllConditions','checkConditions','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','mailSubstatus','null','offlineMessage','created','equals','exports','util','url','mustache','ioredis','./integration','./script','../../../config/logger','../ami','defaults','redis','localhost','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','accounts','freshdeskAccounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','bind','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','undefined','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','length','Actions','toLowerCase','contactmanager','motionbar','html','render','template\x20not\x20found','uri','buildUri','data2','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s','name','data1','trigger:%s','action'];(function(_0xa9e991,_0x4453a2){var _0x1c37c5=function(_0x3c7250){while(--_0x3c7250){_0xa9e991['push'](_0xa9e991['shift']());}};_0x1c37c5(++_0x4453a2);}(_0xee4a,0x9e));var _0xaee4=function(_0x38fd3d,_0x15b5de){_0x38fd3d=_0x38fd3d-0x0;var _0x1e692c=_0xee4a[_0x38fd3d];return _0x1e692c;};'use strict';var util=require(_0xaee4('0x0'));var _=require('lodash');var url=require(_0xaee4('0x1'));var Mustache=require(_0xaee4('0x2'));var Redis=require(_0xaee4('0x3'));var urlforward=require('./urlforward');var integration=require(_0xaee4('0x4'));var cmContact=require('./cmContact');var script=require(_0xaee4('0x5'));var config=require('../../../config/environment');var logger=require(_0xaee4('0x6'))('trigger');var ami=require(_0xaee4('0x7'));config['redis']=_[_0xaee4('0x8')](config[_0xaee4('0x9')],{'host':_0xaee4('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaee4('0x9')]));var operators={'equals':function(_0x6de436,_0x565bad){return _0x6de436==_0x565bad;},'not_equals':function(_0x117da5,_0x16517e){return _0x117da5!=_0x16517e;}};var barAndWebActions=[_0xaee4('0xb'),_0xaee4('0x1'),'winapp'];function Trigger(_0x4c8837){this['triggers']=_0x4c8837[_0xaee4('0xc')];this[_0xaee4('0xd')]=_0x4c8837[_0xaee4('0xd')];this[_0xaee4('0xe')]=_0x4c8837[_0xaee4('0xe')];this[_0xaee4('0xf')]=_0x4c8837[_0xaee4('0xf')];this[_0xaee4('0x10')]=_0x4c8837['voiceExtensions'];this['zendeskAccounts']=_0x4c8837[_0xaee4('0x11')];this['freshdeskAccounts']=_0x4c8837['freshdeskAccounts'];this[_0xaee4('0x12')]=_0x4c8837[_0xaee4('0x12')];this[_0xaee4('0x13')]=_0x4c8837[_0xaee4('0x13')];this[_0xaee4('0x14')]=_0x4c8837[_0xaee4('0x14')];this[_0xaee4('0x15')]=_0x4c8837[_0xaee4('0x15')];this['vtigerAccounts']=_0x4c8837[_0xaee4('0x16')];this['servicenowAccounts']=_0x4c8837['servicenowAccounts'];this[_0xaee4('0x17')]=_0x4c8837[_0xaee4('0x17')];this[_0xaee4('0x18')]=_0x4c8837[_0xaee4('0x18')];this[_0xaee4('0x19')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xaee4('0x12')],'freshdesk':this[_0xaee4('0x1a')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xaee4('0x14')],'desk':this[_0xaee4('0x15')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xaee4('0x17')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xaee4('0x1b')]};ami['on'](_0xaee4('0x1c'),this[_0xaee4('0x1d')]['bind'](this));ami['on']('custom:agentconnect',this[_0xaee4('0x1d')]['bind'](this));ami['on'](_0xaee4('0x1e'),this[_0xaee4('0x1d')]['bind'](this));ami['on'](_0xaee4('0x1f'),this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x21'),this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x22'),this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x23'),this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x24'),this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on']('custom:agentreject',this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x25'),this['syncCustomEvent'][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x26'),this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x27'),this[_0xaee4('0x1d')]['bind'](this));ami['on']('custom:dialbegin',this[_0xaee4('0x28')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x29'),this[_0xaee4('0x28')][_0xaee4('0x20')](this));ami['on']('custom:dialend',this[_0xaee4('0x28')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x2a'),this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x2b'),this[_0xaee4('0x1d')]['bind'](this));ami['on'](_0xaee4('0x2c'),this[_0xaee4('0x1d')]['bind'](this));ami['on'](_0xaee4('0x2d'),this['syncCustomEvent'][_0xaee4('0x20')](this));ami['on']('custom:outgoingmessage',this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x2e'),this[_0xaee4('0x1d')]['bind'](this));ami['on'](_0xaee4('0x2f'),this[_0xaee4('0x1d')][_0xaee4('0x20')](this));ami['on'](_0xaee4('0x30'),this[_0xaee4('0x1d')]['bind'](this));}Trigger[_0xaee4('0x31')][_0xaee4('0x32')]=function(_0x2bb6d3,_0x89c32e,_0xf42d4){logger['info'](_0x2bb6d3,_0x89c32e,JSON[_0xaee4('0x33')](_0xf42d4));io['to'](_0x2bb6d3)[_0xaee4('0x32')](_0x89c32e,_0xf42d4);};Trigger[_0xaee4('0x31')]['syncCustomEvent']=function(_0x1f076b){var _0x88a125=_[_0xaee4('0x34')](_0x1f076b);if(typeof _0x88a125['motionChannel']===_0xaee4('0x35')){_0x88a125['motionChannel']=_0xaee4('0x36');}this[_0xaee4('0x37')](_0x88a125);};Trigger[_0xaee4('0x31')]['syncAgentDial']=function(_0x28f99b){if(this[_0xaee4('0xd')][_0x28f99b[_0xaee4('0x38')]]){this[_0xaee4('0x1d')](_0x28f99b);}};Trigger[_0xaee4('0x31')][_0xaee4('0x37')]=function(_0x49131d){var _0x52c751;for(var _0x4ae28a in this[_0xaee4('0xc')]){if(this[_0xaee4('0xc')][_0xaee4('0x39')](_0x4ae28a)){if(this['triggers'][_0x4ae28a][_0xaee4('0x3a')]){_0x52c751=this[_0xaee4('0x3b')](this[_0xaee4('0xc')][_0x4ae28a],_0x49131d);if(_0x52c751){_[_0xaee4('0x3c')](_0x49131d,_0x49131d['variables']);for(var _0x1d727a=0x0,_0x1643df,_0x5a9812,_0x74a7d4;_0x1d727a<this[_0xaee4('0xc')][_0x4ae28a]['Actions'][_0xaee4('0x3d')];_0x1d727a+=0x1){_0x1643df=this['triggers'][_0x4ae28a][_0xaee4('0x3e')][_0x1d727a];if(this[_0xaee4('0xd')][_0x49131d[_0xaee4('0x38')]]){switch(_0x1643df['action'][_0xaee4('0x3f')]()){case _0xaee4('0x40'):break;case _0xaee4('0x41'):case'browser':var _0x42e241={};switch(barAndWebActions[_0x1643df['data1']]){case _0xaee4('0xb'):_0x42e241['TemplateId']=_0x1643df['data2'];_0x42e241[_0xaee4('0x42')]=this['templates'][_0x1643df['data2']]?Mustache[_0xaee4('0x43')](this[_0xaee4('0xf')][_0x1643df['data2']][_0xaee4('0x42')],_0x49131d):_0xaee4('0x44');break;case _0xaee4('0x1'):_0x42e241[_0xaee4('0x45')]=this[_0xaee4('0x46')](_0x1643df[_0xaee4('0x47')],_0x49131d,_[_0xaee4('0x48')](_0x1643df[_0xaee4('0x49')])?!![]:parseInt(_0x1643df[_0xaee4('0x49')],0xa));if(_[_0xaee4('0x48')](_0x1643df['data4'])){_0x42e241[_0xaee4('0x4a')]='0';}else{_0x42e241[_0xaee4('0x4b')]=_0x1643df[_0xaee4('0x4c')];_0x42e241[_0xaee4('0x4d')]=_[_0xaee4('0x48')](_0x1643df[_0xaee4('0x4e')])?_0xaee4('0x4f'):_0x1643df[_0xaee4('0x4e')];_0x42e241[_0xaee4('0x50')]=_[_0xaee4('0x48')](_0x1643df[_0xaee4('0x51')])?_0xaee4('0x52'):_0x1643df['data6'];}break;case _0xaee4('0x53'):_0x42e241[_0xaee4('0x54')]=_0x1643df[_0xaee4('0x47')]?Mustache[_0xaee4('0x43')](_0x1643df[_0xaee4('0x47')],_0x49131d):'';_0x42e241[_0xaee4('0x55')]=_0x1643df[_0xaee4('0x49')]?Mustache['render'](_0x1643df[_0xaee4('0x49')],_0x49131d):'';break;}this[_0xaee4('0x32')](util[_0xaee4('0x56')](_0xaee4('0x57'),this['agents'][_0x49131d[_0xaee4('0x38')]][_0xaee4('0x58')]),util[_0xaee4('0x56')]('trigger:%s:%s',_0x1643df['action'][_0xaee4('0x3f')](),barAndWebActions[_0x1643df[_0xaee4('0x59')]]),_[_0xaee4('0x3c')](_0x42e241,_0x49131d));break;case'jscripty':this['emit'](util[_0xaee4('0x56')](_0xaee4('0x57'),this['agents'][_0x49131d[_0xaee4('0x38')]]['name']),util['format'](_0xaee4('0x5a'),_0x1643df[_0xaee4('0x5b')][_0xaee4('0x3f')]()),_[_0xaee4('0x3c')]({'ProjectId':parseInt(_0x1643df[_0xaee4('0x59')],0xa)},_0x49131d));break;default:this[_0xaee4('0x32')](util[_0xaee4('0x56')](_0xaee4('0x57'),this[_0xaee4('0xd')][_0x49131d[_0xaee4('0x38')]]['name']),util[_0xaee4('0x56')](_0xaee4('0x5a'),_0x1643df[_0xaee4('0x5b')][_0xaee4('0x3f')]()),_['merge']({},_0x1643df,_0x49131d));}}switch(_0x1643df['action'][_0xaee4('0x3f')]()){case _0xaee4('0x40'):cmContact['exec'](this['agents'][_0x49131d[_0xaee4('0x38')]],this[_0xaee4('0xc')][_0x4ae28a],_0x1643df,_0x49131d);break;case'integration':integration[_0xaee4('0x5c')](_0x1643df,_0x49131d,this['accounts'],this['agents'][_0x49131d[_0xaee4('0x38')]],this['voiceQueues'][_0x49131d['queue']],this[_0xaee4('0x10')][_0x49131d[_0xaee4('0x5d')]]);break;case'urlforward':urlforward[_0xaee4('0x5c')](_0x1643df,_0x49131d);break;case _0xaee4('0x5e'):script['exec'](_0x1643df,_0x49131d);break;}}}}}}};Trigger[_0xaee4('0x31')][_0xaee4('0x46')]=function(_0x102dbf,_0x19533a,_0x305c98){var _0x4e9403=url[_0xaee4('0x5f')](Mustache[_0xaee4('0x43')](_0x102dbf,_0x19533a),!![]);if(_0x305c98){_['merge'](_0x4e9403[_0xaee4('0x60')],_0x19533a);}delete _0x4e9403['search'];var _0x14bea6=url[_0xaee4('0x56')](_0x4e9403);_0x14bea6=_0x14bea6[_0xaee4('0x61')](/\/\?/g,'?');return _0x14bea6;};Trigger['prototype'][_0xaee4('0x3b')]=function(_0x45e2e1,_0x147212){var _0x4022f1=!![];var _0x4abdb2=!![];var _0x1e718f=![];if(_0x45e2e1[_0xaee4('0x62')]===_0x147212[_0xaee4('0x63')]){_0x1e718f=!![];}if(_0x45e2e1[_0xaee4('0x64')][_0xaee4('0x3d')]){_0x4022f1=_['every'](_0x45e2e1[_0xaee4('0x64')],this[_0xaee4('0x65')](_0x147212,_0x45e2e1[_0xaee4('0x62')]));}if(_0x45e2e1[_0xaee4('0x66')][_0xaee4('0x3d')]){_0x4abdb2=_[_0xaee4('0x67')](_0x45e2e1[_0xaee4('0x66')],this[_0xaee4('0x65')](_0x147212,_0x45e2e1[_0xaee4('0x62')]));}return _0x1e718f&&_0x4022f1&&_0x4abdb2;};Trigger['prototype'][_0xaee4('0x65')]=function(_0x299d35,_0x532c5e){return function(_0x3a0eb5){switch(_0x3a0eb5[_0xaee4('0x68')]){case _0xaee4('0x69'):if(_0x299d35['channel']===_0x532c5e){if(_0x532c5e===_0xaee4('0x6a')){return _0x299d35[_0xaee4('0x6b')]?operators[_0x3a0eb5[_0xaee4('0x6c')]](Number(_0x3a0eb5[_0xaee4('0x6d')]),_0x299d35[_0xaee4('0x6b')]):![];}else{return _0x299d35[_[_0xaee4('0x6e')](_0x532c5e)+_0xaee4('0x6f')]?operators[_0x3a0eb5['operator']](Number(_0x3a0eb5[_0xaee4('0x6d')]),_0x299d35[_['upperFirst'](_0x532c5e)+_0xaee4('0x6f')]):![];}}break;case _0xaee4('0x70'):case _0xaee4('0x71'):if(_0x299d35[_0xaee4('0x62')]===_0x532c5e){return _0x299d35['event']?operators[_0x3a0eb5[_0xaee4('0x6c')]](_0x3a0eb5['value'],_0x299d35[_0xaee4('0x72')]):![];}break;case'queue':return _0x299d35[_0xaee4('0x73')]?operators[_0x3a0eb5[_0xaee4('0x6c')]](_0x3a0eb5[_0xaee4('0x6d')],_0x299d35['queue']):![];case _0xaee4('0x74'):return _0x299d35[_0xaee4('0x75')]?operators[_0x3a0eb5[_0xaee4('0x6c')]](_0x3a0eb5[_0xaee4('0x6d')],_0x299d35['membername']):![];case _0xaee4('0x76'):return _0x299d35[_0xaee4('0x76')]?operators[_0x3a0eb5[_0xaee4('0x6c')]](_0x3a0eb5[_0xaee4('0x6d')],_0x299d35[_0xaee4('0x76')]):![];case _0xaee4('0x5d'):return _0x299d35[_0xaee4('0x5d')]?operators[_0x3a0eb5['operator']](_0x3a0eb5['value'],_0x299d35['routeId']):![];case _0xaee4('0x77'):if(_0x3a0eb5[_0xaee4('0x6d')]===_0xaee4('0x78'))_0x3a0eb5['value']=null;return typeof _0x299d35['substatus']!==_0xaee4('0x35')?operators[_0x3a0eb5[_0xaee4('0x6c')]](_0x3a0eb5[_0xaee4('0x6d')],_0x299d35['substatus']):![];case _0xaee4('0x79'):if(_0x299d35[_0xaee4('0x62')]===_0x532c5e){return _0x3a0eb5[_0xaee4('0x6d')]===_0xaee4('0x7a')&&_0x3a0eb5['operator']===_0xaee4('0x7b')?!![]:![];}break;}return![];};};module[_0xaee4('0x7c')]=Trigger;
\ No newline at end of file
index 76062e0..6152006 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x29bdff,_0x44bb3d){var _0x58db21=function(_0x3da4d4){while(--_0x3da4d4){_0x29bdff['push'](_0x29bdff['shift']());}};_0x58db21(++_0x44bb3d);}(_0x55ca,0x126));var _0xa55c=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x55ca[_0xa60623];return _0x4a6487;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});};
\ 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(_0x2ca681,_0x41cbbe){_0x2ca681=_0x2ca681-0x0;var _0x30c787=_0xe14b[_0x2ca681];return _0x30c787;};'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 02897e1..d203fde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9f3=['[OUTBOUND]','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/environment','defaults','redis','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','password','clientSecret','then','catch','error','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','length','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','4.0','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','picklist','nameField','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','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','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xb9f3,0xdf));var _0x3b9f=function(_0x1ae4ab,_0x1c8ba2){_0x1ae4ab=_0x1ae4ab-0x0;var _0x9d2640=_0xb9f3[_0x1ae4ab];return _0x9d2640;};'use strict';var _=require(_0x3b9f('0x0'));var rp=require(_0x3b9f('0x1'));var util=require(_0x3b9f('0x2'));var intUtil=require('./util');var md5=require(_0x3b9f('0x3'));var Redis=require(_0x3b9f('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x3b9f('0x5'));config['redis']=_[_0x3b9f('0x6')](config[_0x3b9f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3b9f('0x8'))(new Redis(config[_0x3b9f('0x7')]));function getAuthToken(_0x40c88c,_0x196b2a,_0x5f1e71){if(_0x40c88c['modernAuthentication']){_0x40c88c[_0x3b9f('0x9')]=_0x40c88c[_0x3b9f('0xa')][_0x3b9f('0xb')];_0x40c88c[_0x3b9f('0xc')]=_0x40c88c[_0x3b9f('0xa')]['data2'];return Promise[_0x3b9f('0xd')](_0x40c88c[_0x3b9f('0xa')][_0x3b9f('0xe')]);}var _0x28bf49={'method':_0x3b9f('0xf'),'uri':_0x196b2a,'form':{'client_id':_0x40c88c[_0x3b9f('0x10')],'resource':_0x40c88c[_0x3b9f('0x9')],'username':_0x40c88c['username'],'password':_0x40c88c[_0x3b9f('0x11')],'grant_type':_0x3b9f('0x11'),'client_secret':_0x40c88c[_0x3b9f('0x12')]},'json':!![]};return rp(_0x28bf49)[_0x3b9f('0x13')](function(_0x324956){return _0x324956['access_token'];})[_0x3b9f('0x14')](function(_0x494365){logger[_0x3b9f('0x15')]('['+[_0x5f1e71['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x494365[_0x3b9f('0x16')];});}function getUser(_0x29069a,_0x3fdb36,_0x43acdb,_0x1819e0,_0x586ec8,_0x1c922f){return new Promise(function(_0x4e88b5,_0x3ecf7a){return getAuthToken(_0x3fdb36,_0x1819e0,_0x1c922f)[_0x3b9f('0x13')](function(_0x11a8c7){var _0x49293e={'method':_0x3b9f('0x17'),'uri':_0x586ec8+_0x3b9f('0x18'),'headers':{'Authorization':_0x3b9f('0x19')+_0x11a8c7,'OData-Version':'4.0'},'json':!![]};return rp(_0x49293e);})[_0x3b9f('0x13')](function(_0x15fa65){var _0x3e6dd3=_0x15fa65[_0x3b9f('0x1a')];var _0x4e84ce=![];var _0x19c29b=null;if(!_[_0x3b9f('0x1b')](_0x43acdb)){if(intUtil['validateEmail'](_0x43acdb[_0x3b9f('0x1c')])){_0x29069a['userEmail']=_0x43acdb[_0x3b9f('0x1c')];for(_0x19c29b=0x0;_0x19c29b<_0x3e6dd3[_0x3b9f('0x1d')];_0x19c29b++){if(_0x3e6dd3[_0x19c29b]['internalemailaddress']===_0x43acdb[_0x3b9f('0x1c')]&&!_0x3e6dd3[_0x19c29b][_0x3b9f('0x1e')]){_0x4e84ce=!![];logger[_0x3b9f('0x1f')]('['+[_0x1c922f[_0x3b9f('0x20')]()]+_0x3b9f('0x21')+_0x3e6dd3[_0x19c29b][_0x3b9f('0x22')]+'!');_0x29069a[_0x3b9f('0x23')]=_0x3e6dd3[_0x19c29b][_0x3b9f('0x22')];}}}}if(!_0x4e84ce){logger['info']('['+[_0x1c922f['toUpperCase']()]+_0x3b9f('0x24'));_0x29069a[_0x3b9f('0x25')]=_0x3fdb36[_0x3b9f('0x26')];for(_0x19c29b=0x0;_0x19c29b<_0x3e6dd3[_0x3b9f('0x1d')];_0x19c29b++){if(_0x3e6dd3[_0x19c29b][_0x3b9f('0x27')]===_0x3fdb36['username']){_0x29069a[_0x3b9f('0x23')]=_0x3e6dd3[_0x19c29b]['systemuserid'];}}}_0x4e88b5(_0x29069a);})['catch'](function(_0x2ab698){_0x3ecf7a(_0x2ab698[_0x3b9f('0x16')]);});});}function createEndUser(_0x4951b7,_0x2ef44f,_0x4c95d5,_0x258bf1,_0x941d28,_0x711ed8,_0x1010f3){return new Promise(function(_0x5a7b43,_0x3ce5a3){return getAuthToken(_0x2ef44f,_0x4c95d5,_0x711ed8)[_0x3b9f('0x13')](function(_0x30141b){var _0x19eedc=_0x711ed8[_0x3b9f('0x28')]()===_0x3b9f('0x29')?_0x941d28[_0x3b9f('0x2a')]:_0x941d28[_0x3b9f('0x2b')];var _0x535ed9={'method':_0x3b9f('0xf'),'uri':_0x258bf1+'contacts','body':{'fullname':_0x19eedc,'firstname':_0x19eedc,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3b9f('0x2c')+_0x4951b7[_0x3b9f('0x23')]+')'},'headers':{'Authorization':_0x3b9f('0x19')+_0x30141b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x535ed9[_0x3b9f('0x2d')][_0x1010f3]=_0x19eedc;return rp(_0x535ed9);})[_0x3b9f('0x13')](function(_0x2d8bd8){var _0x56c368=_0x2d8bd8[_0x3b9f('0x2e')][_0x3b9f('0x2f')];var _0x11f3f8=_0x56c368[_0x3b9f('0x30')](_0x56c368[_0x3b9f('0x31')]('(')+0x1,_0x56c368[_0x3b9f('0x31')](')'));_0x4951b7['enduserId']=_0x11f3f8;_0x5a7b43(_0x4951b7);})[_0x3b9f('0x14')](function(_0xedc2ae){_0x3ce5a3(_0xedc2ae[_0x3b9f('0x16')]);});});}function getEndUser(_0x94de2c,_0x30cdb3,_0xa953f,_0x1df76f,_0x198a11,_0x46e304,_0xde1e41,_0x7aad7a){var _0x15468d=_0x46e304[_0x3b9f('0x28')]()===_0x3b9f('0x29')?_0x198a11[_0x3b9f('0x2a')]:_0x198a11[_0x3b9f('0x2b')];return getAuthToken(_0x30cdb3,_0xa953f,_0x46e304)[_0x3b9f('0x13')](function(_0x1923d2){_0x7aad7a=_0x7aad7a?_0x7aad7a:_0x3b9f('0x32');var _0x5056a3={'method':_0x3b9f('0x17'),'uri':_0x1df76f+_0x3b9f('0x33')+_0x7aad7a+_0x3b9f('0x34')+_0x7aad7a+_0x3b9f('0x35')+_0x15468d['replace']('+',_0x3b9f('0x36'))+'\x27','headers':{'Authorization':_0x3b9f('0x19')+_0x1923d2,'If-None-Match':null,'OData-Version':_0x3b9f('0x37')},'json':!![]};return rp(_0x5056a3);})[_0x3b9f('0x13')](function(_0x6bea2b){var _0x1b9bd2=![];if(!_0x6bea2b)return _0x1b9bd2;var _0x13a44d=_0x6bea2b['value'];for(var _0x3e6f2e=0x0;_0x3e6f2e<_0x13a44d[_0x3b9f('0x1d')];_0x3e6f2e++){if(_0x13a44d[_0x3e6f2e][_0x7aad7a]===_0x15468d){_0x1b9bd2=!![];_0x94de2c[_0x3b9f('0x38')]=_0x13a44d[_0x3e6f2e][_0x3b9f('0x39')];}}return _0x1b9bd2;})[_0x3b9f('0x13')](function(_0x29b146){if(_0x29b146)return _0x94de2c;if(_0xde1e41===_0x3b9f('0x3a')){logger[_0x3b9f('0x1f')]('['+[_0x46e304['toUpperCase']()]+_0x3b9f('0x3b'));return _0x94de2c;}return createEndUser(_0x94de2c,_0x30cdb3,_0xa953f,_0x1df76f,_0x198a11,_0x46e304,_0x7aad7a)[_0x3b9f('0x13')](function(_0x998119){logger['info']('['+[_0x46e304[_0x3b9f('0x20')]()]+_0x3b9f('0x3c'),_0x998119[_0x3b9f('0x38')]);return _0x998119;});});}function getCustomFields(_0x1b32e1,_0x719e06,_0x53c586){var _0x13375e={};if(_0x1b32e1[_0x3b9f('0x1d')]>0x0){_['forEach'](_0x1b32e1,function(_0x250e71){if(_[_0x3b9f('0x3d')](['string',_0x3b9f('0x3e')],_0x250e71['type'])&&_0x250e71[_0x3b9f('0x3f')]&&!_0x250e71[_0x3b9f('0x40')]){var _0x5c16a7=_0x250e71[_0x3b9f('0x41')][_0x3b9f('0x28')]();var _0x3a0293=_0x5c16a7[_0x3b9f('0x30')](0x0,_0x5c16a7['indexOf']('_'));var _0x40edff=_0x5c16a7[_0x3b9f('0x30')](_0x5c16a7[_0x3b9f('0x42')]('_')+0x1);if(_0x3a0293===_0x53c586){_0x13375e[_0x40edff]=_0x250e71['content'];}}});}return _0x13375e;}function getTicket(_0x536de6,_0x3b5a3c,_0x56c171,_0x2ed6d5,_0x5c8dea,_0x4898d7,_0x32fff3){return new Promise(function(_0x347710,_0x2bcd94){var _0x26794a;return getAuthToken(_0x3b5a3c,_0x56c171,_0x32fff3)['then'](function(_0x18828c){if(_0x4898d7[_0x3b9f('0x43')]===_0x3b9f('0x44')){_0x26794a={'method':'POST','uri':_0x2ed6d5+_0x3b9f('0x45'),'body':Object[_0x3b9f('0x46')]({},{'title':intUtil[_0x3b9f('0x47')](_0x4898d7[_0x3b9f('0x48')],_0x5c8dea,'\x20'),'description':intUtil[_0x3b9f('0x47')](_0x4898d7[_0x3b9f('0x49')],_0x5c8dea,'\x0a'),'customerid_contact@odata.bind':_0x536de6[_0x3b9f('0x38')]?_0x3b9f('0x4a')+_0x536de6[_0x3b9f('0x38')]+')':undefined,'ownerid@odata.bind':_0x3b9f('0x2c')+_0x536de6[_0x3b9f('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x4898d7[_0x3b9f('0x4b')],_0x5c8dea,_0x4898d7[_0x3b9f('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x18828c,'OData-Version':_0x3b9f('0x37')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4898d7[_0x3b9f('0x43')]==='phonecall'){var _0x2d2720=_0x536de6[_0x3b9f('0x38')]?[{'partyid_systemuser@odata.bind':_0x3b9f('0x2c')+_0x536de6[_0x3b9f('0x23')]+')','participationtypemask':_0x536de6[_0x3b9f('0x4c')]===_0x3b9f('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x3b9f('0x4a')+_0x536de6[_0x3b9f('0x38')]+')','participationtypemask':_0x536de6[_0x3b9f('0x4c')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x536de6['userId']+')','participationtypemask':_0x536de6['callDirection']===_0x3b9f('0x4d')?0x2:0x1}];_0x26794a={'method':_0x3b9f('0xf'),'uri':_0x2ed6d5+_0x3b9f('0x4e'),'body':Object[_0x3b9f('0x46')]({},{'subject':intUtil[_0x3b9f('0x47')](_0x4898d7[_0x3b9f('0x48')],_0x5c8dea,'\x20'),'phonenumber':String(_0x5c8dea[_0x3b9f('0x2b')]),'description':intUtil['getString'](_0x4898d7[_0x3b9f('0x49')],_0x5c8dea,'\x0a'),'regardingobjectid_contact@odata.bind':_0x536de6[_0x3b9f('0x38')]?_0x3b9f('0x4a')+_0x536de6[_0x3b9f('0x38')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x536de6[_0x3b9f('0x23')]+')','directioncode':_0x536de6[_0x3b9f('0x4c')]===_0x3b9f('0x4d')?![]:!![],'phonecall_activity_parties':_0x2d2720},getCustomFields(_0x4898d7[_0x3b9f('0x4b')],_0x5c8dea,_0x4898d7[_0x3b9f('0x43')])),'headers':{'Authorization':_0x3b9f('0x19')+_0x18828c,'OData-Version':_0x3b9f('0x37')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x26794a);})[_0x3b9f('0x13')](function(_0x5ba0b7){var _0x5954ba=_0x5ba0b7[_0x3b9f('0x2e')]['odata-entityid'];var _0x2bf68f=_0x5954ba[_0x3b9f('0x30')](_0x5954ba[_0x3b9f('0x31')]('(')+0x1,_0x5954ba['lastIndexOf'](')'));_0x536de6[_0x3b9f('0x4f')]=_0x2bf68f;_0x347710(_0x536de6);})[_0x3b9f('0x14')](function(_0xc73393){_0x2bcd94(_0xc73393['message']);});});}function emit(_0xb198de,_0x40ac51,_0x53950a,_0x549de5){var _0x230fe1={'uri':util[_0x3b9f('0x50')](_0x3b9f('0x51'),_0xb198de,_0x53950a,_0x549de5)};io['to'](util[_0x3b9f('0x50')](_0x3b9f('0x52'),_0x40ac51))[_0x3b9f('0x53')](_0x3b9f('0x54'),_0x230fe1);}exports['cs']=function(_0xbeb089,_0x1c0075,_0x551bc4,_0x4ab40e,_0x3fa3b1,_0x14240d,_0xe1e6ed,_0x32b51c){var _0x43e820={};_0x14240d[_0x3b9f('0x9')]=_0x14240d[_0x3b9f('0x55')]?intUtil['stripTrailingSlash'](_0x14240d[_0x3b9f('0xa')]['data7']):intUtil[_0x3b9f('0x56')](_0x14240d[_0x3b9f('0x9')]);_0x14240d[_0x3b9f('0x57')]=intUtil[_0x3b9f('0x56')](_0x14240d[_0x3b9f('0x57')]);_0x43e820['callDirection']=_0x32b51c==='queue'||_0x32b51c===_0x3b9f('0x58')?_0x3b9f('0x4d'):_0x3b9f('0x29');var _0x42ec32=_0x14240d[_0x3b9f('0x55')]?util['format'](_0x3b9f('0x59'),_0x14240d[_0x3b9f('0xa')][_0x3b9f('0xb')]):util[_0x3b9f('0x50')]('%s/api/data/v9.0/',_0x14240d[_0x3b9f('0x9')]);var _0x1a4dc0=util[_0x3b9f('0x50')](_0x3b9f('0x5a'),_0x14240d[_0x3b9f('0xc')]);var _0x9deeac=util[_0x3b9f('0x50')](_0x3b9f('0x5b'),_0x14240d[_0x3b9f('0x57')],_0x1c0075['uniqueid'],md5(_0x1c0075[_0x3b9f('0x5c')]));if(_0x3fa3b1&&_0x3fa3b1[_0x3b9f('0x5d')]){logger[_0x3b9f('0x1f')]('[QUEUE]',_0x3b9f('0x5e'));_0x1c0075[_0x3b9f('0x5f')]=_0x9deeac;}else if(_0xe1e6ed&&_0xe1e6ed[_0x3b9f('0x60')]&&_0xe1e6ed[_0x3b9f('0x60')]!==_0x3b9f('0x61')){logger[_0x3b9f('0x1f')](_0x3b9f('0x62'),_0x3b9f('0x5e'));_0x1c0075[_0x3b9f('0x5f')]=_0x9deeac;}else{_0x1c0075[_0x3b9f('0x5f')]='';}return getUser(_0x43e820,_0x14240d,_0x4ab40e,_0x1a4dc0,_0x42ec32,_0x32b51c)['then'](function(_0x4d8712){logger[_0x3b9f('0x1f')]('['+_0x32b51c[_0x3b9f('0x20')]()+']\x20The\x20User\x20ID\x20is:',_0x4d8712[_0x3b9f('0x23')]);logger[_0x3b9f('0x1f')]('['+_0x32b51c[_0x3b9f('0x20')]()+']\x20The\x20User\x20email\x20is:',_0x4d8712['userEmail']);return getEndUser(_0x4d8712,_0x14240d,_0x1a4dc0,_0x42ec32,_0x1c0075,_0x32b51c,_0x551bc4[_0x3b9f('0x63')],_0x551bc4[_0x3b9f('0x64')]);})[_0x3b9f('0x13')](function(_0x5d9833){logger[_0x3b9f('0x1f')]('['+_0x32b51c['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x5d9833[_0x3b9f('0x38')]);logger[_0x3b9f('0x1f')]('['+_0x32b51c[_0x3b9f('0x20')]()+_0x3b9f('0x65'),_0x1c0075[_0x3b9f('0x2b')]);return getTicket(_0x5d9833,_0x14240d,_0x1a4dc0,_0x42ec32,_0x1c0075,_0x551bc4,_0x32b51c);})[_0x3b9f('0x13')](function(_0x28b9e9){logger['info'](util[_0x3b9f('0x50')]('['+_0x32b51c[_0x3b9f('0x20')]()+_0x3b9f('0x66'),_0x551bc4[_0x3b9f('0x43')],_0x28b9e9[_0x3b9f('0x4f')]));logger[_0x3b9f('0x1f')](util[_0x3b9f('0x50')]('['+_0x32b51c[_0x3b9f('0x20')]()+_0x3b9f('0x67'),_0x32b51c));if(_0x32b51c!==_0x3b9f('0x58')){logger[_0x3b9f('0x1f')]('['+_0x32b51c[_0x3b9f('0x20')]()+']',_0x3b9f('0x68'));emit(_0x14240d['remoteUri'],_0x4ab40e[_0x3b9f('0x69')],_0x551bc4[_0x3b9f('0x43')],_0x28b9e9[_0x3b9f('0x4f')]);}})[_0x3b9f('0x14')](function(_0x420463){logger['error']('['+_0x32b51c[_0x3b9f('0x20')]()+_0x3b9f('0x6a'),_0x420463[_0x3b9f('0x16')]);});};
\ No newline at end of file
+var _0x17c2=['Subjects','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','socket.io-emitter','modernAuthentication','remoteUri','data7','tenantId','data2','resolve','CloudProvider','data5','POST','clientId','password','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','outbound','destcalleridnum','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','toLowerCase','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid','nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','nameField','customField','idField','substring','indexOf','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','phonecall','callDirection','queue'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x17c2,0x81));var _0x217c=function(_0x15b6d2,_0x3bf4be){_0x15b6d2=_0x15b6d2-0x0;var _0x36a1e2=_0x17c2[_0x15b6d2];return _0x36a1e2;};'use strict';var _=require(_0x217c('0x0'));var rp=require(_0x217c('0x1'));var util=require(_0x217c('0x2'));var intUtil=require('./util');var md5=require(_0x217c('0x3'));var Redis=require(_0x217c('0x4'));var logger=require(_0x217c('0x5'))('dynamics365');var config=require(_0x217c('0x6'));config[_0x217c('0x7')]=_['defaults'](config[_0x217c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x217c('0x8'))(new Redis(config[_0x217c('0x7')]));function getAuthToken(_0x5f55e5,_0x4f7cfd,_0x2602ca){if(_0x5f55e5[_0x217c('0x9')]){_0x5f55e5[_0x217c('0xa')]=_0x5f55e5['CloudProvider'][_0x217c('0xb')];_0x5f55e5[_0x217c('0xc')]=_0x5f55e5['CloudProvider'][_0x217c('0xd')];return Promise[_0x217c('0xe')](_0x5f55e5[_0x217c('0xf')][_0x217c('0x10')]);}var _0x3e61db={'method':_0x217c('0x11'),'uri':_0x4f7cfd,'form':{'client_id':_0x5f55e5[_0x217c('0x12')],'resource':_0x5f55e5[_0x217c('0xa')],'username':_0x5f55e5['username'],'password':_0x5f55e5['password'],'grant_type':_0x217c('0x13'),'client_secret':_0x5f55e5['clientSecret']},'json':!![]};return rp(_0x3e61db)[_0x217c('0x14')](function(_0x11863d){return _0x11863d['access_token'];})[_0x217c('0x15')](function(_0x4c2b28){logger[_0x217c('0x16')]('['+[_0x2602ca[_0x217c('0x17')]()]+_0x217c('0x18'));return _0x4c2b28[_0x217c('0x19')];});}function getUser(_0x256808,_0x5bec69,_0x19a55e,_0x498881,_0x3482df,_0x356647){return new Promise(function(_0x41d955,_0x5acb6c){return getAuthToken(_0x5bec69,_0x498881,_0x356647)[_0x217c('0x14')](function(_0x453cb9){var _0x2a4baa={'method':_0x217c('0x1a'),'uri':_0x3482df+_0x217c('0x1b'),'headers':{'Authorization':_0x217c('0x1c')+_0x453cb9,'OData-Version':_0x217c('0x1d')},'json':!![]};return rp(_0x2a4baa);})[_0x217c('0x14')](function(_0x62d7ec){var _0xf59a56=_0x62d7ec[_0x217c('0x1e')];var _0x562532=![];var _0x1faa26=null;if(!_[_0x217c('0x1f')](_0x19a55e)){if(intUtil[_0x217c('0x20')](_0x19a55e['email'])){_0x256808[_0x217c('0x21')]=_0x19a55e[_0x217c('0x22')];for(_0x1faa26=0x0;_0x1faa26<_0xf59a56[_0x217c('0x23')];_0x1faa26++){if(_0xf59a56[_0x1faa26][_0x217c('0x24')]===_0x19a55e['email']&&!_0xf59a56[_0x1faa26][_0x217c('0x25')]){_0x562532=!![];logger[_0x217c('0x26')]('['+[_0x356647[_0x217c('0x17')]()]+']\x20Agent\x20found\x20'+_0xf59a56[_0x1faa26][_0x217c('0x27')]+'!');_0x256808[_0x217c('0x28')]=_0xf59a56[_0x1faa26][_0x217c('0x27')];}}}}if(!_0x562532){logger['info']('['+[_0x356647['toUpperCase']()]+_0x217c('0x29'));_0x256808['userEmail']=_0x5bec69[_0x217c('0x2a')];for(_0x1faa26=0x0;_0x1faa26<_0xf59a56[_0x217c('0x23')];_0x1faa26++){if(_0xf59a56[_0x1faa26][_0x217c('0x24')]===_0x5bec69[_0x217c('0x2a')]){_0x256808['userId']=_0xf59a56[_0x1faa26][_0x217c('0x27')];}}}_0x41d955(_0x256808);})[_0x217c('0x15')](function(_0x3d9e6a){_0x5acb6c(_0x3d9e6a[_0x217c('0x19')]);});});}function createEndUser(_0x38d812,_0x4a689c,_0x848f18,_0x3453a2,_0x26d97f,_0x4ccd15){return new Promise(function(_0x3b38ce,_0xf68ff){return getAuthToken(_0x4a689c,_0x848f18,_0x4ccd15)['then'](function(_0x36fad1){var _0x35ca22=_0x4ccd15['toLowerCase']()===_0x217c('0x2b')?_0x26d97f[_0x217c('0x2c')]:_0x26d97f['calleridnum'];var _0x15d2e7={'method':'POST','uri':_0x3453a2+'contacts','body':{'telephone1':_0x35ca22,'fullname':_0x35ca22,'firstname':_0x35ca22,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x217c('0x2d')+_0x38d812[_0x217c('0x28')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x36fad1,'OData-Version':_0x217c('0x1d')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x15d2e7);})[_0x217c('0x14')](function(_0x12871a){var _0x19efe4=_0x12871a[_0x217c('0x2e')][_0x217c('0x2f')];var _0xc6aed0=_0x19efe4['substring'](_0x19efe4[_0x217c('0x30')]('(')+0x1,_0x19efe4[_0x217c('0x30')](')'));_0x38d812[_0x217c('0x31')]=_0xc6aed0;_0x3b38ce(_0x38d812);})['catch'](function(_0x1a2794){_0xf68ff(_0x1a2794[_0x217c('0x19')]);});});}function getEndUser(_0x5317ff,_0x45e145,_0x533fad,_0x4dfe4f,_0x491aa6,_0x59df57,_0x260ffb){var _0xcb3ab1=_0x59df57[_0x217c('0x32')]()===_0x217c('0x2b')?_0x491aa6[_0x217c('0x2c')]:_0x491aa6[_0x217c('0x33')];return getAuthToken(_0x45e145,_0x533fad,_0x59df57)[_0x217c('0x14')](function(_0x1c7573){var _0x3d0fb5={'method':'GET','uri':_0x4dfe4f+_0x217c('0x34')+_0xcb3ab1['replace']('+',_0x217c('0x35'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1c7573,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3d0fb5);})[_0x217c('0x14')](function(_0x4e2699){var _0xe9beb6=![];if(!_0x4e2699)return _0xe9beb6;var _0x1ce768=_0x4e2699[_0x217c('0x1e')];for(var _0x54a753=0x0;_0x54a753<_0x1ce768[_0x217c('0x23')];_0x54a753++){if(_0x1ce768[_0x54a753][_0x217c('0x36')]===_0xcb3ab1){_0xe9beb6=!![];_0x5317ff[_0x217c('0x31')]=_0x1ce768[_0x54a753][_0x217c('0x37')];}}return _0xe9beb6;})['then'](function(_0x2690bc){if(_0x2690bc)return _0x5317ff;if(_0x260ffb===_0x217c('0x38')){logger[_0x217c('0x26')]('['+[_0x59df57[_0x217c('0x17')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x5317ff;}return createEndUser(_0x5317ff,_0x45e145,_0x533fad,_0x4dfe4f,_0x491aa6,_0x59df57)[_0x217c('0x14')](function(_0x5b4844){logger[_0x217c('0x26')]('['+[_0x59df57[_0x217c('0x17')]()]+_0x217c('0x39'),_0x5b4844[_0x217c('0x31')]);return _0x5b4844;});});}function getCustomFields(_0x1ca29b,_0xaa9e08,_0x18ff9d){var _0x36d9f4={};if(_0x1ca29b[_0x217c('0x23')]>0x0){_[_0x217c('0x3a')](_0x1ca29b,function(_0x5c15e9){if(_[_0x217c('0x3b')]([_0x217c('0x3c'),_0x217c('0x3d')],_0x5c15e9['type'])&&_0x5c15e9[_0x217c('0x3e')]&&!_0x5c15e9[_0x217c('0x3f')]){var _0x4fade2=_0x5c15e9[_0x217c('0x40')]['toLowerCase']();var _0x295f5e=_0x4fade2[_0x217c('0x41')](0x0,_0x4fade2[_0x217c('0x42')]('_'));var _0x2a1fb0=_0x4fade2['substring'](_0x4fade2[_0x217c('0x42')]('_')+0x1);if(_0x295f5e===_0x18ff9d){_0x36d9f4[_0x2a1fb0]=_0x5c15e9['content'];}}});}return _0x36d9f4;}function getTicket(_0x5176dd,_0x128e10,_0x135f2f,_0x571392,_0x428153,_0x5643f5,_0x262ffb){return new Promise(function(_0xccdf79,_0x5c248f){var _0x1dcb3e;return getAuthToken(_0x128e10,_0x135f2f,_0x262ffb)['then'](function(_0x56361d){if(_0x5643f5[_0x217c('0x43')]===_0x217c('0x44')){_0x1dcb3e={'method':_0x217c('0x11'),'uri':_0x571392+_0x217c('0x45'),'body':Object[_0x217c('0x46')]({},{'title':intUtil['getString'](_0x5643f5['Subjects'],_0x428153,'\x20'),'description':intUtil[_0x217c('0x47')](_0x5643f5[_0x217c('0x48')],_0x428153,'\x0a'),'customerid_contact@odata.bind':_0x5176dd[_0x217c('0x31')]?_0x217c('0x49')+_0x5176dd[_0x217c('0x31')]+')':undefined,'ownerid@odata.bind':_0x217c('0x2d')+_0x5176dd['userId']+')','caseorigincode':'1'},getCustomFields(_0x5643f5['Fields'],_0x428153,_0x5643f5[_0x217c('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x56361d,'OData-Version':_0x217c('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5643f5[_0x217c('0x43')]===_0x217c('0x4a')){var _0x3069aa=_0x5176dd['enduserId']?[{'partyid_systemuser@odata.bind':_0x217c('0x2d')+_0x5176dd[_0x217c('0x28')]+')','participationtypemask':_0x5176dd[_0x217c('0x4b')]===_0x217c('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x5176dd[_0x217c('0x31')]+')','participationtypemask':_0x5176dd['callDirection']===_0x217c('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x217c('0x2d')+_0x5176dd['userId']+')','participationtypemask':_0x5176dd[_0x217c('0x4b')]===_0x217c('0x4c')?0x2:0x1}];_0x1dcb3e={'method':_0x217c('0x11'),'uri':_0x571392+'phonecalls','body':Object[_0x217c('0x46')]({},{'subject':intUtil['getString'](_0x5643f5[_0x217c('0x4d')],_0x428153,'\x20'),'phonenumber':String(_0x428153['calleridnum']),'description':intUtil['getString'](_0x5643f5['Descriptions'],_0x428153,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5176dd['enduserId']?_0x217c('0x49')+_0x5176dd[_0x217c('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x5176dd['userId']+')','directioncode':_0x5176dd[_0x217c('0x4b')]===_0x217c('0x4c')?![]:!![],'phonecall_activity_parties':_0x3069aa},getCustomFields(_0x5643f5[_0x217c('0x4e')],_0x428153,_0x5643f5[_0x217c('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x56361d,'OData-Version':_0x217c('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1dcb3e);})[_0x217c('0x14')](function(_0x48017c){var _0x5b6250=_0x48017c[_0x217c('0x2e')]['odata-entityid'];var _0x238b0e=_0x5b6250[_0x217c('0x41')](_0x5b6250['lastIndexOf']('(')+0x1,_0x5b6250['lastIndexOf'](')'));_0x5176dd[_0x217c('0x4f')]=_0x238b0e;_0xccdf79(_0x5176dd);})[_0x217c('0x15')](function(_0x1ca752){_0x5c248f(_0x1ca752[_0x217c('0x19')]);});});}function emit(_0x164c86,_0x378ca5,_0x4dfea9,_0x340880){var _0x55038e={'uri':util[_0x217c('0x50')](_0x217c('0x51'),_0x164c86,_0x4dfea9,_0x340880)};io['to'](util[_0x217c('0x50')](_0x217c('0x52'),_0x378ca5))[_0x217c('0x53')]('trigger:browser:url',_0x55038e);}exports['cs']=function(_0x482348,_0x5c3f25,_0x2138ed,_0x1498e1,_0x4134e3,_0x578fc2,_0x856e7c,_0x3b0bc6){var _0x4c83be={};_0x578fc2[_0x217c('0xa')]=_0x578fc2[_0x217c('0x9')]?intUtil['stripTrailingSlash'](_0x578fc2[_0x217c('0xf')][_0x217c('0xb')]):intUtil['stripTrailingSlash'](_0x578fc2[_0x217c('0xa')]);_0x578fc2['serverUrl']=intUtil[_0x217c('0x54')](_0x578fc2[_0x217c('0x55')]);_0x4c83be['callDirection']=_0x3b0bc6===_0x217c('0x4c')||_0x3b0bc6===_0x217c('0x56')?_0x217c('0x4c'):'outbound';var _0x195808=_0x578fc2['modernAuthentication']?util[_0x217c('0x50')](_0x217c('0x57'),_0x578fc2[_0x217c('0xf')]['data7']):util[_0x217c('0x50')](_0x217c('0x57'),_0x578fc2[_0x217c('0xa')]);var _0x12b1cc=util[_0x217c('0x50')]('https://login.microsoftonline.com/%s/oauth2/token',_0x578fc2[_0x217c('0xc')]);var _0x3ef186=util[_0x217c('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x578fc2[_0x217c('0x55')],_0x5c3f25[_0x217c('0x58')],md5(_0x5c3f25['uniqueid']));if(_0x4134e3&&_0x4134e3[_0x217c('0x59')]){logger[_0x217c('0x26')](_0x217c('0x5a'),_0x217c('0x5b'));_0x5c3f25['recordingURL']=_0x3ef186;}else if(_0x856e7c&&_0x856e7c[_0x217c('0x5c')]&&_0x856e7c[_0x217c('0x5c')]!==_0x217c('0x5d')){logger['info'](_0x217c('0x5e'),_0x217c('0x5b'));_0x5c3f25[_0x217c('0x5f')]=_0x3ef186;}else{_0x5c3f25[_0x217c('0x5f')]='';}return getUser(_0x4c83be,_0x578fc2,_0x1498e1,_0x12b1cc,_0x195808,_0x3b0bc6)[_0x217c('0x14')](function(_0x57db90){logger[_0x217c('0x26')]('['+_0x3b0bc6[_0x217c('0x17')]()+_0x217c('0x60'),_0x57db90['userId']);logger[_0x217c('0x26')]('['+_0x3b0bc6[_0x217c('0x17')]()+_0x217c('0x61'),_0x57db90[_0x217c('0x21')]);return getEndUser(_0x57db90,_0x578fc2,_0x12b1cc,_0x195808,_0x5c3f25,_0x3b0bc6,_0x2138ed['moduleCreate']);})[_0x217c('0x14')](function(_0x2dcef8){logger[_0x217c('0x26')]('['+_0x3b0bc6[_0x217c('0x17')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x2dcef8[_0x217c('0x31')]);logger[_0x217c('0x26')]('['+_0x3b0bc6[_0x217c('0x17')]()+_0x217c('0x62'),_0x5c3f25[_0x217c('0x33')]);return getTicket(_0x2dcef8,_0x578fc2,_0x12b1cc,_0x195808,_0x5c3f25,_0x2138ed,_0x3b0bc6);})['then'](function(_0x45f91b){logger[_0x217c('0x26')](util[_0x217c('0x50')]('['+_0x3b0bc6['toUpperCase']()+_0x217c('0x63'),_0x2138ed['ticketType'],_0x45f91b[_0x217c('0x4f')]));logger[_0x217c('0x26')](util[_0x217c('0x50')]('['+_0x3b0bc6['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x3b0bc6));if(_0x3b0bc6!==_0x217c('0x56')){logger[_0x217c('0x26')]('['+_0x3b0bc6[_0x217c('0x17')]()+']',_0x217c('0x64'));emit(_0x578fc2[_0x217c('0xa')],_0x1498e1[_0x217c('0x65')],_0x2138ed['ticketType'],_0x45f91b[_0x217c('0x4f')]);}})[_0x217c('0x15')](function(_0x35156e){logger[_0x217c('0x16')]('['+_0x3b0bc6[_0x217c('0x17')]()+_0x217c('0x66'),_0x35156e['message']);});};
\ No newline at end of file
index 572de2d..0486249 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34a5=['merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','<br>','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','Ticket\x20created!','validateEmail','remoteUri','then','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','destcalleridnum','catch','unmanaged','lastevent','toUpperCase','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','application/json','info','Creating\x20new\x20ticket...'];(function(_0x26718b,_0xb4ca16){var _0x124a7e=function(_0x15ac94){while(--_0x15ac94){_0x26718b['push'](_0x26718b['shift']());}};_0x124a7e(++_0xb4ca16);}(_0x34a5,0x105));var _0x534a=function(_0x1d1d44,_0x24c5ac){_0x1d1d44=_0x1d1d44-0x0;var _0x3b3d3e=_0x34a5[_0x1d1d44];return _0x3b3d3e;};'use strict';var _=require('lodash');var rp=require(_0x534a('0x0'));var md5=require('md5');var util=require(_0x534a('0x1'));var Redis=require(_0x534a('0x2'));var intUtil=require('./util');var config=require(_0x534a('0x3'));var logger=require(_0x534a('0x4'))(_0x534a('0x5'));config['redis']=_[_0x534a('0x6')](config[_0x534a('0x7')],{'host':_0x534a('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x534a('0x7')]));var headers={'Content-Type':_0x534a('0x9'),'Accept':_0x534a('0x9')};function emit(_0xb431ca,_0x2a727c,_0x380118){io['to'](_0xb431ca)['emit'](_0x2a727c,_0x380118);}function getTicket(_0x323e69,_0xf93136,_0x25c3e6,_0x2618ec,_0x27a9a6){logger[_0x534a('0xa')](_0x534a('0xb'));var _0x3b904c=_[_0x534a('0xc')]({'responder_id':_0xf93136['id'],'requester_id':_0x25c3e6['id'],'name':util[_0x534a('0xd')](_0x534a('0xe'),_0x27a9a6[_0x534a('0xf')]),'phone':_0x27a9a6[_0x534a('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2618ec['Subjects'],_0x27a9a6,'\x20'),'description':intUtil[_0x534a('0x11')](_0x2618ec[_0x534a('0x12')],_0x27a9a6,_0x534a('0x13')),'tags':getTags(_0x2618ec[_0x534a('0x14')],_0x534a('0x15'))},getCustomFields(_0x2618ec[_0x534a('0x16')],_0x27a9a6));_0x3b904c[_0x534a('0x17')]=_[_0x534a('0x18')](_[_0x534a('0x19')](_0x3b904c[_0x534a('0x17')],'id'),_0x534a('0x1a'));return request({'uri':util[_0x534a('0xd')](_0x534a('0x1b'),_0x323e69['remoteUri']),'method':_0x534a('0x1c'),'body':_0x3b904c})['then'](function(_0x4663b4){logger['info'](_0x534a('0x1d'));return _0x4663b4;});}function getUser(_0x177f36,_0xbb61eb){if(intUtil[_0x534a('0x1e')](_0xbb61eb)){return request({'uri':util[_0x534a('0xd')]('%s/api/v2/agents',_0x177f36[_0x534a('0x1f')]),'qs':{'email':_0xbb61eb}})[_0x534a('0x20')](function(_0x57ac78){if(_0x57ac78['length']){logger['info']('Agent\x20found!');return _[_0x534a('0x21')](_0x57ac78,function(_0x3a2d49){return _0x3a2d49[_0x534a('0x22')]['email']===_0xbb61eb;});}else{logger[_0x534a('0xa')](_0x534a('0x23'));return request({'uri':util[_0x534a('0xd')](_0x534a('0x24'),_0x177f36[_0x534a('0x1f')])})[_0x534a('0x20')](function(_0x4473ff){logger[_0x534a('0xa')](_0x534a('0x25'));return _0x4473ff;});}});}else{logger[_0x534a('0xa')](_0x534a('0x26'));return request({'uri':util['format'](_0x534a('0x24'),_0x177f36[_0x534a('0x1f')])})[_0x534a('0x20')](function(_0x4da958){logger[_0x534a('0xa')]('Admin\x20account\x20selected.');return _0x4da958;});}}function getEndUser(_0x56ea09,_0x3bec6d,_0x2314ab){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2314ab);return request({'uri':util[_0x534a('0xd')]('%s/api/v2/contacts',_0x56ea09['remoteUri']),'qs':{'phone':_0x2314ab}})[_0x534a('0x20')](function(_0x261255){if(_0x261255[_0x534a('0x27')]){logger[_0x534a('0xa')]('Enduser\x20found!');return _[_0x534a('0x21')](_0x261255,{'phone':_0x2314ab});}else{logger[_0x534a('0xa')](_0x534a('0x28'));return request({'uri':util['format']('%s/api/v2/contacts',_0x56ea09[_0x534a('0x1f')]),'method':'POST','body':{'name':_0x3bec6d,'phone':_0x2314ab}})['then'](function(_0x376f14){logger[_0x534a('0xa')](_0x534a('0x29'));return _0x376f14;});}});}function getAuth(_0x58a307){return util[_0x534a('0xd')](_0x534a('0x2a'),new Buffer(_0x58a307[_0x534a('0x2b')]+':X')[_0x534a('0x2c')](_0x534a('0x2d')));}function request(_0x2090f9){logger['debug'](_0x534a('0x2e'),JSON[_0x534a('0x2f')](_0x2090f9));return rp(_['defaults'](_0x2090f9,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4fa6ae,_0x278cb9){var _0x1b80f3=[];if(_0x4fa6ae&&_0x4fa6ae['length']>0x0){_0x1b80f3=_[_0x534a('0x30')](_0x4fa6ae,_0x278cb9);}return _0x1b80f3;}function getCustomFields(_0x4899ad,_0x4e5659){var _0x353f45=[];var _0x198d71={'custom_fields':[]};if(_0x4899ad[_0x534a('0x27')]>0x0){_[_0x534a('0x31')](_0x4899ad,function(_0x17ece7){if(_[_0x534a('0x32')]([_0x534a('0x33'),_0x534a('0x34')],_0x17ece7[_0x534a('0x35')])&&_0x17ece7[_0x534a('0x36')]&&!_0x17ece7[_0x534a('0x37')]){_0x198d71[_0x17ece7['nameField'][_0x534a('0x38')]()]=_0x17ece7[_0x534a('0x39')][_0x534a('0x2c')]();}else if(_['includes']([_0x534a('0x33'),_0x534a('0x34')],_0x17ece7['type'])&&_0x17ece7[_0x534a('0x3a')]&&_0x17ece7[_0x534a('0x37')]){_0x198d71[_0x534a('0x17')]['push']({'id':_0x17ece7[_0x534a('0x3a')],'value':_0x17ece7['content'][_0x534a('0x2c')]()});}else if(_0x17ece7['type']===_0x534a('0x3b')&&_0x17ece7['variableName']&&_0x17ece7[_0x534a('0x3a')]&&_0x17ece7[_0x534a('0x37')]){_0x4e5659[_0x17ece7[_0x534a('0x3c')]]&&_0x198d71[_0x534a('0x17')]['push']({'id':_0x17ece7['idField'],'value':_0x4e5659[_0x17ece7[_0x534a('0x3c')]][_0x534a('0x2c')]()});}else if(_0x17ece7[_0x534a('0x35')]===_0x534a('0x3d')&&_0x17ece7[_0x534a('0x3e')]&&_0x17ece7['Variable'][_0x534a('0x15')]&&_0x17ece7[_0x534a('0x3a')]&&_0x17ece7[_0x534a('0x37')]){_0x4e5659[_0x17ece7[_0x534a('0x3e')][_0x534a('0x15')][_0x534a('0x38')]()]&&_0x198d71[_0x534a('0x17')][_0x534a('0x3f')]({'id':_0x17ece7[_0x534a('0x3a')],'value':_0x4e5659[_0x17ece7[_0x534a('0x3e')][_0x534a('0x15')]['toLowerCase']()][_0x534a('0x2c')]()});}});}return _0x198d71;}exports[_0x534a('0x40')]=function(_0x19c392,_0x19c4d0,_0x19c67f,_0x560265,_0x500382,_0x16b8cf){var _0x8f3c62,_0x319b45;_0x16b8cf[_0x534a('0x1f')]=intUtil[_0x534a('0x41')](_0x16b8cf[_0x534a('0x1f')]);_0x16b8cf[_0x534a('0x42')]=intUtil[_0x534a('0x41')](_0x16b8cf[_0x534a('0x42')]);if(_0x500382&&_0x500382[_0x534a('0x43')]){logger['info'](_0x534a('0x44'),_0x534a('0x45'));_0x19c4d0[_0x534a('0x46')]=util['format'](_0x534a('0x47'),_0x16b8cf[_0x534a('0x42')],_0x19c4d0[_0x534a('0x48')],md5(_0x19c4d0[_0x534a('0x48')]));}else{_0x19c4d0[_0x534a('0x46')]='';}headers[_0x534a('0x49')]=getAuth(_0x16b8cf);return getUser(_0x16b8cf,_0x560265[_0x534a('0x4a')])['then'](function(_0xbfd063){_0x8f3c62=_0xbfd063;logger[_0x534a('0xa')](_0x534a('0x4b'),_0x8f3c62['id']);return getEndUser(_0x16b8cf,_0x19c4d0[_0x534a('0xf')],_0x19c4d0[_0x534a('0x10')]);})[_0x534a('0x20')](function(_0x4898e0){_0x319b45=_0x4898e0;logger[_0x534a('0xa')](_0x534a('0x4c'),_0x319b45['id']);return getTicket(_0x16b8cf,_0x8f3c62,_0x319b45,_0x19c67f,_0x19c4d0);})[_0x534a('0x20')](function(_0x50616d){if(_0x50616d&&_0x50616d['id']){logger[_0x534a('0xa')](_0x534a('0x1d'));logger[_0x534a('0xa')](_0x534a('0x4d'),_0x50616d['id']);logger[_0x534a('0xa')](_0x534a('0x44'),_0x534a('0x4e'));emit(util[_0x534a('0xd')](_0x534a('0x4f'),_0x560265[_0x534a('0x15')]),_0x534a('0x50'),{'uri':util['format'](_0x534a('0x51'),_0x16b8cf[_0x534a('0x1f')],_0x50616d['id'])});}})['catch'](function(_0x1986b9){logger[_0x534a('0x52')](_0x534a('0x44'),JSON[_0x534a('0x2f')](_0x1986b9));});};exports['outbound']=function(_0x49d77e,_0x59ec22,_0x2787f1,_0xf2676a,_0x351cfe,_0x2d52df,_0x16ac3c){var _0x5d2144,_0x3f96eb;_0x2d52df[_0x534a('0x1f')]=intUtil[_0x534a('0x41')](_0x2d52df['remoteUri']);_0x2d52df[_0x534a('0x42')]=intUtil['stripTrailingSlash'](_0x2d52df[_0x534a('0x42')]);if(_0x16ac3c&&_0x16ac3c[_0x534a('0x53')]&&_0x16ac3c['recordingFormat']!==_0x534a('0x54')){logger['info'](_0x534a('0x55'),'Recording\x20is\x20enabled!');_0x59ec22[_0x534a('0x46')]=util[_0x534a('0xd')](_0x534a('0x47'),_0x2d52df[_0x534a('0x42')],_0x59ec22[_0x534a('0x48')],md5(_0x59ec22['uniqueid']));}headers['Authorization']=getAuth(_0x2d52df);return getUser(_0x2d52df,_0xf2676a[_0x534a('0x4a')])[_0x534a('0x20')](function(_0x4b0cec){_0x5d2144=_0x4b0cec;logger['info'](_0x534a('0x4b'),_0x5d2144['id']);return getEndUser(_0x2d52df,_0x59ec22['destcalleridname'],_0x59ec22[_0x534a('0x56')]);})[_0x534a('0x20')](function(_0x22048c){_0x3f96eb=_0x22048c;logger[_0x534a('0xa')](_0x534a('0x4c'),_0x3f96eb['id']);return getTicket(_0x2d52df,_0x5d2144,_0x3f96eb,_0x2787f1,_0x59ec22);})[_0x534a('0x20')](function(_0x56d77a){if(_0x56d77a&&_0x56d77a['id']){logger[_0x534a('0xa')](_0x534a('0x1d'));logger[_0x534a('0xa')](_0x534a('0x4d'),_0x56d77a['id']);logger[_0x534a('0xa')](_0x534a('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x534a('0xd')]('user:%s',_0xf2676a[_0x534a('0x15')]),_0x534a('0x50'),{'uri':util[_0x534a('0xd')]('%s/helpdesk/tickets/%d',_0x2d52df[_0x534a('0x1f')],_0x56d77a['id'])});}})[_0x534a('0x57')](function(_0x3172c6){logger[_0x534a('0x52')](_0x534a('0x55'),JSON[_0x534a('0x2f')](_0x3172c6));});};exports[_0x534a('0x58')]=function(_0x157517,_0x12f76f,_0x467cb5,_0x82d90e,_0x290f73,_0x113c6d){var _0x3c1c29,_0x5edb98;_0x113c6d[_0x534a('0x1f')]=intUtil[_0x534a('0x41')](_0x113c6d[_0x534a('0x1f')]);_0x113c6d['serverUrl']=intUtil['stripTrailingSlash'](_0x113c6d[_0x534a('0x42')]);if(_0x290f73&&_0x290f73[_0x534a('0x43')]){logger[_0x534a('0xa')]('['+_0x12f76f[_0x534a('0x59')][_0x534a('0x5a')]()+']','Recording\x20is\x20enabled!');_0x12f76f['recordingURL']=util['format'](_0x534a('0x47'),_0x113c6d[_0x534a('0x42')],_0x12f76f[_0x534a('0x48')],md5(_0x12f76f['uniqueid']));}else{_0x12f76f['recordingURL']='';}headers[_0x534a('0x49')]=getAuth(_0x113c6d);return getUser(_0x113c6d,'')[_0x534a('0x20')](function(_0x25906d){_0x3c1c29=_0x25906d;logger['info'](_0x534a('0x4b'),_0x3c1c29['id']);return getEndUser(_0x113c6d,_0x12f76f[_0x534a('0xf')],_0x12f76f[_0x534a('0x10')]);})[_0x534a('0x20')](function(_0x13c8de){_0x5edb98=_0x13c8de;logger['info'](_0x534a('0x4c'),_0x5edb98['id']);return getTicket(_0x113c6d,_0x3c1c29,_0x5edb98,_0x467cb5,_0x12f76f);})[_0x534a('0x20')](function(_0x24ea6f){if(_0x24ea6f){logger['info'](_0x534a('0x1d'));logger['info'](_0x534a('0x4d'),_0x24ea6f['id']);}})[_0x534a('0x57')](function(_0x179b7c){logger[_0x534a('0x52')]('['+_0x12f76f[_0x534a('0x59')]['toUpperCase']()+']',JSON['stringify'](_0x179b7c));});};
\ No newline at end of file
+var _0x5937=['GET','map','forEach','includes','type','customField','nameField','content','string','picklist','idField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','../../../../config/logger','freshdesk','defaults','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','<br>','Tags','name','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]'];(function(_0x5e7361,_0x31140d){var _0x248a05=function(_0x292e2c){while(--_0x292e2c){_0x5e7361['push'](_0x5e7361['shift']());}};_0x248a05(++_0x31140d);}(_0x5937,0x132));var _0x7593=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5937[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x7593('0x0'));var rp=require(_0x7593('0x1'));var md5=require(_0x7593('0x2'));var util=require(_0x7593('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x7593('0x4'))(_0x7593('0x5'));config['redis']=_[_0x7593('0x6')](config[_0x7593('0x7')],{'host':_0x7593('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7593('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x7593('0x9')};function emit(_0x499e93,_0x362ddb,_0x17f098){io['to'](_0x499e93)[_0x7593('0xa')](_0x362ddb,_0x17f098);}function getTicket(_0x191a32,_0x4ed2d5,_0x38e723,_0xdcc1a5,_0xd7300e){logger[_0x7593('0xb')](_0x7593('0xc'));var _0x4ba9d3=_[_0x7593('0xd')]({'responder_id':_0x4ed2d5['id'],'requester_id':_0x38e723['id'],'name':util[_0x7593('0xe')](_0x7593('0xf'),_0xd7300e[_0x7593('0x10')]),'phone':_0xd7300e[_0x7593('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7593('0x12')](_0xdcc1a5['Subjects'],_0xd7300e,'\x20'),'description':intUtil['getString'](_0xdcc1a5[_0x7593('0x13')],_0xd7300e,_0x7593('0x14')),'tags':getTags(_0xdcc1a5[_0x7593('0x15')],_0x7593('0x16'))},getCustomFields(_0xdcc1a5['Fields'],_0xd7300e));_0x4ba9d3[_0x7593('0x17')]=_['mapValues'](_[_0x7593('0x18')](_0x4ba9d3[_0x7593('0x17')],'id'),_0x7593('0x19'));return request({'uri':util[_0x7593('0xe')](_0x7593('0x1a'),_0x191a32[_0x7593('0x1b')]),'method':_0x7593('0x1c'),'body':_0x4ba9d3})[_0x7593('0x1d')](function(_0xf0235f){logger[_0x7593('0xb')](_0x7593('0x1e'));return _0xf0235f;});}function getUser(_0x5120ec,_0x1c8e9e){if(intUtil[_0x7593('0x1f')](_0x1c8e9e)){return request({'uri':util[_0x7593('0xe')](_0x7593('0x20'),_0x5120ec[_0x7593('0x1b')]),'qs':{'email':_0x1c8e9e}})[_0x7593('0x1d')](function(_0x48dfae){if(_0x48dfae[_0x7593('0x21')]){logger[_0x7593('0xb')]('Agent\x20found!');return _['find'](_0x48dfae,function(_0x484bdb){return _0x484bdb['contact'][_0x7593('0x22')]===_0x1c8e9e;});}else{logger[_0x7593('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7593('0xe')](_0x7593('0x23'),_0x5120ec[_0x7593('0x1b')])})[_0x7593('0x1d')](function(_0x17b9b8){logger[_0x7593('0xb')](_0x7593('0x24'));return _0x17b9b8;});}});}else{logger['info'](_0x7593('0x25'));return request({'uri':util[_0x7593('0xe')](_0x7593('0x23'),_0x5120ec[_0x7593('0x1b')])})[_0x7593('0x1d')](function(_0x38abff){logger[_0x7593('0xb')](_0x7593('0x24'));return _0x38abff;});}}function getEndUser(_0x5936a0,_0x3c3f6f,_0x5e2ed9){logger['info']('Searching\x20enduser\x20with\x20phone',_0x5e2ed9);return request({'uri':util[_0x7593('0xe')](_0x7593('0x26'),_0x5936a0[_0x7593('0x1b')]),'qs':{'phone':_0x5e2ed9}})['then'](function(_0x5887d8){if(_0x5887d8[_0x7593('0x21')]){logger[_0x7593('0xb')](_0x7593('0x27'));return _['find'](_0x5887d8,{'phone':_0x5e2ed9});}else{logger[_0x7593('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x7593('0xe')]('%s/api/v2/contacts',_0x5936a0[_0x7593('0x1b')]),'method':_0x7593('0x1c'),'body':{'name':_0x3c3f6f,'phone':_0x5e2ed9}})[_0x7593('0x1d')](function(_0x343e06){logger[_0x7593('0xb')](_0x7593('0x28'));return _0x343e06;});}});}function getAuth(_0x4dd6b8){return util['format'](_0x7593('0x29'),new Buffer(_0x4dd6b8[_0x7593('0x2a')]+':X')[_0x7593('0x2b')]('base64'));}function request(_0x16d8e0){logger[_0x7593('0x2c')](_0x7593('0x2d'),JSON['stringify'](_0x16d8e0));return rp(_['defaults'](_0x16d8e0,{'method':_0x7593('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x3d43c9,_0x38d2bc){var _0xe97c27=[];if(_0x3d43c9&&_0x3d43c9[_0x7593('0x21')]>0x0){_0xe97c27=_[_0x7593('0x2f')](_0x3d43c9,_0x38d2bc);}return _0xe97c27;}function getCustomFields(_0x3663e8,_0x2ef507){var _0x27bcb8=[];var _0xd677f={'custom_fields':[]};if(_0x3663e8[_0x7593('0x21')]>0x0){_[_0x7593('0x30')](_0x3663e8,function(_0x335c2a){if(_[_0x7593('0x31')](['string','picklist'],_0x335c2a[_0x7593('0x32')])&&_0x335c2a['nameField']&&!_0x335c2a[_0x7593('0x33')]){_0xd677f[_0x335c2a[_0x7593('0x34')]['toLowerCase']()]=_0x335c2a[_0x7593('0x35')]['toString']();}else if(_[_0x7593('0x31')]([_0x7593('0x36'),_0x7593('0x37')],_0x335c2a[_0x7593('0x32')])&&_0x335c2a[_0x7593('0x38')]&&_0x335c2a[_0x7593('0x33')]){_0xd677f['custom_fields']['push']({'id':_0x335c2a[_0x7593('0x38')],'value':_0x335c2a['content'][_0x7593('0x2b')]()});}else if(_0x335c2a[_0x7593('0x32')]===_0x7593('0x39')&&_0x335c2a[_0x7593('0x3a')]&&_0x335c2a['idField']&&_0x335c2a[_0x7593('0x33')]){_0x2ef507[_0x335c2a['variableName']]&&_0xd677f[_0x7593('0x17')][_0x7593('0x3b')]({'id':_0x335c2a[_0x7593('0x38')],'value':_0x2ef507[_0x335c2a['variableName']][_0x7593('0x2b')]()});}else if(_0x335c2a[_0x7593('0x32')]===_0x7593('0x3c')&&_0x335c2a[_0x7593('0x3d')]&&_0x335c2a['Variable'][_0x7593('0x16')]&&_0x335c2a[_0x7593('0x38')]&&_0x335c2a['customField']){_0x2ef507[_0x335c2a[_0x7593('0x3d')]['name']['toLowerCase']()]&&_0xd677f[_0x7593('0x17')][_0x7593('0x3b')]({'id':_0x335c2a[_0x7593('0x38')],'value':_0x2ef507[_0x335c2a['Variable']['name']['toLowerCase']()][_0x7593('0x2b')]()});}});}return _0xd677f;}exports[_0x7593('0x3e')]=function(_0x1e7a34,_0x1475e6,_0x4aa853,_0x51a49f,_0x51c1f,_0x48e68e){var _0x1895e3,_0x1405df;_0x48e68e['remoteUri']=intUtil[_0x7593('0x3f')](_0x48e68e[_0x7593('0x1b')]);_0x48e68e[_0x7593('0x40')]=intUtil['stripTrailingSlash'](_0x48e68e[_0x7593('0x40')]);if(_0x51c1f&&_0x51c1f[_0x7593('0x41')]){logger[_0x7593('0xb')](_0x7593('0x42'),_0x7593('0x43'));_0x1475e6[_0x7593('0x44')]=util[_0x7593('0xe')](_0x7593('0x45'),_0x48e68e[_0x7593('0x40')],_0x1475e6[_0x7593('0x46')],md5(_0x1475e6[_0x7593('0x46')]));}else{_0x1475e6[_0x7593('0x44')]='';}headers[_0x7593('0x47')]=getAuth(_0x48e68e);return getUser(_0x48e68e,_0x51a49f[_0x7593('0x22')])[_0x7593('0x1d')](function(_0x10937f){_0x1895e3=_0x10937f;logger[_0x7593('0xb')](_0x7593('0x48'),_0x1895e3['id']);return getEndUser(_0x48e68e,_0x1475e6[_0x7593('0x10')],_0x1475e6[_0x7593('0x11')]);})[_0x7593('0x1d')](function(_0x1f5612){_0x1405df=_0x1f5612;logger[_0x7593('0xb')](_0x7593('0x49'),_0x1405df['id']);return getTicket(_0x48e68e,_0x1895e3,_0x1405df,_0x4aa853,_0x1475e6);})['then'](function(_0x1ff332){if(_0x1ff332&&_0x1ff332['id']){logger[_0x7593('0xb')](_0x7593('0x1e'));logger['info'](_0x7593('0x4a'),_0x1ff332['id']);logger['info']('[QUEUE]',_0x7593('0x4b'));emit(util[_0x7593('0xe')](_0x7593('0x4c'),_0x51a49f['name']),'trigger:browser:url',{'uri':util[_0x7593('0xe')]('%s/helpdesk/tickets/%d',_0x48e68e[_0x7593('0x1b')],_0x1ff332['id'])});}})[_0x7593('0x4d')](function(_0x54cc81){logger[_0x7593('0x4e')](_0x7593('0x42'),JSON[_0x7593('0x4f')](_0x54cc81));});};exports[_0x7593('0x50')]=function(_0x3e363c,_0x54306e,_0x3c8144,_0x35bacb,_0x3948cb,_0x5a8610,_0x53fd3e){var _0x549724,_0x140fc4;_0x5a8610['remoteUri']=intUtil[_0x7593('0x3f')](_0x5a8610['remoteUri']);_0x5a8610[_0x7593('0x40')]=intUtil[_0x7593('0x3f')](_0x5a8610[_0x7593('0x40')]);if(_0x53fd3e&&_0x53fd3e[_0x7593('0x51')]&&_0x53fd3e[_0x7593('0x51')]!=='none'){logger['info'](_0x7593('0x52'),_0x7593('0x43'));_0x54306e[_0x7593('0x44')]=util['format'](_0x7593('0x45'),_0x5a8610['serverUrl'],_0x54306e['uniqueid'],md5(_0x54306e[_0x7593('0x46')]));}headers[_0x7593('0x47')]=getAuth(_0x5a8610);return getUser(_0x5a8610,_0x35bacb[_0x7593('0x22')])[_0x7593('0x1d')](function(_0x32ff32){_0x549724=_0x32ff32;logger[_0x7593('0xb')](_0x7593('0x48'),_0x549724['id']);return getEndUser(_0x5a8610,_0x54306e['destcalleridname'],_0x54306e[_0x7593('0x53')]);})['then'](function(_0x2d115c){_0x140fc4=_0x2d115c;logger[_0x7593('0xb')]('The\x20Enduser\x20ID\x20is:',_0x140fc4['id']);return getTicket(_0x5a8610,_0x549724,_0x140fc4,_0x3c8144,_0x54306e);})[_0x7593('0x1d')](function(_0x42d130){if(_0x42d130&&_0x42d130['id']){logger['info']('Ticket\x20created!');logger[_0x7593('0xb')](_0x7593('0x4a'),_0x42d130['id']);logger['info'](_0x7593('0x52'),_0x7593('0x4b'));emit(util[_0x7593('0xe')](_0x7593('0x4c'),_0x35bacb['name']),_0x7593('0x54'),{'uri':util[_0x7593('0xe')]('%s/helpdesk/tickets/%d',_0x5a8610['remoteUri'],_0x42d130['id'])});}})[_0x7593('0x4d')](function(_0x4b5409){logger[_0x7593('0x4e')](_0x7593('0x52'),JSON[_0x7593('0x4f')](_0x4b5409));});};exports[_0x7593('0x55')]=function(_0x504b79,_0x510a20,_0x579131,_0x3c416c,_0x1e1dc6,_0x464b91){var _0x5e2b60,_0x55eefc;_0x464b91[_0x7593('0x1b')]=intUtil['stripTrailingSlash'](_0x464b91['remoteUri']);_0x464b91[_0x7593('0x40')]=intUtil['stripTrailingSlash'](_0x464b91[_0x7593('0x40')]);if(_0x1e1dc6&&_0x1e1dc6[_0x7593('0x41')]){logger[_0x7593('0xb')]('['+_0x510a20[_0x7593('0x56')][_0x7593('0x57')]()+']',_0x7593('0x43'));_0x510a20[_0x7593('0x44')]=util[_0x7593('0xe')](_0x7593('0x45'),_0x464b91[_0x7593('0x40')],_0x510a20[_0x7593('0x46')],md5(_0x510a20['uniqueid']));}else{_0x510a20['recordingURL']='';}headers[_0x7593('0x47')]=getAuth(_0x464b91);return getUser(_0x464b91,'')[_0x7593('0x1d')](function(_0x4142d4){_0x5e2b60=_0x4142d4;logger[_0x7593('0xb')](_0x7593('0x48'),_0x5e2b60['id']);return getEndUser(_0x464b91,_0x510a20[_0x7593('0x10')],_0x510a20[_0x7593('0x11')]);})[_0x7593('0x1d')](function(_0x28f778){_0x55eefc=_0x28f778;logger[_0x7593('0xb')](_0x7593('0x49'),_0x55eefc['id']);return getTicket(_0x464b91,_0x5e2b60,_0x55eefc,_0x579131,_0x510a20);})[_0x7593('0x1d')](function(_0x4bc3df){if(_0x4bc3df){logger[_0x7593('0xb')](_0x7593('0x1e'));logger[_0x7593('0xb')]('The\x20Ticket\x20ID\x20is:',_0x4bc3df['id']);}})[_0x7593('0x4d')](function(_0x4a3351){logger[_0x7593('0x4e')]('['+_0x510a20[_0x7593('0x56')][_0x7593('0x57')]()+']',JSON['stringify'](_0x4a3351));});};
\ No newline at end of file
index db3e01a..f9e8a50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf21=['./util','../../../../config/logger','freshsales','defaults','localhost','socket.io-emitter','redis','GET','/api/selector/owners','headers','info','then','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','agentEmail','userEmail','userId','error','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','add','task','ticketId','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbf21,0x1ec));var _0x1bf2=function(_0x13fc46,_0x4aec91){_0x13fc46=_0x13fc46-0x0;var _0x316cb9=_0xbf21[_0x13fc46];return _0x316cb9;};'use strict';var _=require(_0x1bf2('0x0'));var rp=require(_0x1bf2('0x1'));var md5=require(_0x1bf2('0x2'));var util=require(_0x1bf2('0x3'));var moment=require(_0x1bf2('0x4'));var Promise=require(_0x1bf2('0x5'));var Redis=require('ioredis');var intUtil=require(_0x1bf2('0x6'));var config=require('../../../../config/environment');var logger=require(_0x1bf2('0x7'))(_0x1bf2('0x8'));config['redis']=_[_0x1bf2('0x9')](config['redis'],{'host':_0x1bf2('0xa'),'port':0x18eb});var io=require(_0x1bf2('0xb'))(new Redis(config[_0x1bf2('0xc')]));function getAdminId(_0x48a3d9,_0x44b02b,_0xbd46a9,_0x639ac0){return new Promise(function(_0xf52936,_0x3926d0){var _0x22bf2b=![];var _0x59a960={'method':_0x1bf2('0xd'),'uri':_0x639ac0+_0x1bf2('0xe'),'json':!![]};_0x59a960[_0x1bf2('0xf')]=_0xbd46a9;logger[_0x1bf2('0x10')]('Getting\x20admin\x20information');return rp(_0x59a960)[_0x1bf2('0x11')](function(_0x398c9a){if(_0x398c9a){var _0x524883=_0x398c9a[_0x1bf2('0x12')];var _0xa234c3=null;for(_0xa234c3=0x0;_0xa234c3<_0x524883[_0x1bf2('0x13')];_0xa234c3++){if(_0x524883[_0xa234c3][_0x1bf2('0x14')]===_0x48a3d9[_0x1bf2('0x15')]){_0x48a3d9['adminId']=_0x524883[_0xa234c3]['id'];_0x22bf2b=!![];}}if(_0x22bf2b){logger[_0x1bf2('0x10')](_0x1bf2('0x16'),_0x48a3d9[_0x1bf2('0x17')]);_0xf52936(_0x48a3d9);}else{_0x3926d0({'statusCode':0x194,'message':_0x1bf2('0x18')});}}else{_0x3926d0({'statusCode':0x194,'message':_0x1bf2('0x18')});}})[_0x1bf2('0x19')](function(_0x439d64){logger['error']('['+[_0x44b02b[_0x1bf2('0x1a')]()]+']',_0x439d64[_0x1bf2('0x1b')]);_0x3926d0(_0x439d64);});});}function getUser(_0x5eb3d4,_0x582b45,_0x3a381d){return function(_0x1cf32b){return new Promise(function(_0x5b1cc8,_0x2ea676){var _0x20f738={'method':'GET','uri':_0x3a381d+_0x1bf2('0xe'),'json':!![]};_0x20f738[_0x1bf2('0xf')]=_0x582b45;logger[_0x1bf2('0x10')]('Getting\x20user\x20list');return rp(_0x20f738)[_0x1bf2('0x11')](function(_0x341c7f){if(_0x341c7f){var _0x12dcc6=_0x341c7f[_0x1bf2('0x12')];var _0x4feccd=![];var _0x1141f4=null;if(_0x1cf32b[_0x1bf2('0x1c')]!==null){logger[_0x1bf2('0x10')]('Getting\x20user\x20with\x20email',_0x1cf32b[_0x1bf2('0x1c')]);_0x1cf32b[_0x1bf2('0x1d')]=_0x1cf32b['agentEmail'];for(_0x1141f4=0x0;_0x1141f4<_0x12dcc6[_0x1bf2('0x13')];_0x1141f4++){if(_0x12dcc6[_0x1141f4][_0x1bf2('0x14')]===_0x1cf32b['agentEmail']){_0x4feccd=!![];_0x1cf32b[_0x1bf2('0x1e')]=_0x12dcc6[_0x1141f4]['id'];logger[_0x1bf2('0x10')]('User\x20found:',_0x1cf32b['userId']);}}}if(!_0x4feccd){logger[_0x1bf2('0x10')]('Admin\x20selected');_0x1cf32b[_0x1bf2('0x1d')]=_0x1cf32b[_0x1bf2('0x15')];_0x1cf32b[_0x1bf2('0x1e')]=_0x1cf32b['adminId'];_0x4feccd=!![];}if(_0x4feccd){_0x5b1cc8(_0x1cf32b);}else{_0x2ea676({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2ea676({'statusCode':0x194,'message':_0x1bf2('0x18')});}})[_0x1bf2('0x19')](function(_0x431b4a){logger[_0x1bf2('0x1f')]('['+[_0x5eb3d4[_0x1bf2('0x1a')]()]+']',_0x431b4a['message']);_0x2ea676(_0x431b4a);});});};}function searchContact(_0x7fc988,_0xde590,_0x5297b9,_0x4f3d2b){return new Promise(function(_0xfb3bde,_0x1fbeb3){var _0x4a51de={'method':'GET','headers':_0xde590,'uri':_0x7fc988+'/api/lookup?q='+_0x4f3d2b+'&f='+_0x5297b9+_0x1bf2('0x20'),'json':!![]};rp(_0x4a51de)[_0x1bf2('0x11')](function(_0x61ee45){var _0x182c2a=_[_0x1bf2('0x21')](_0x61ee45[_0x1bf2('0x22')][_0x1bf2('0x22')],[_0x5297b9,_0x4f3d2b]);_0xfb3bde(_0x182c2a);})['catch'](function(_0x1a1243){_0x1fbeb3(_0x1a1243);});});}function getEndUser(_0x2e4ccb,_0x17211d,_0x522a52){return function(_0x132fc6){return new Promise(function(_0x5ea16d,_0x12a4c0){logger[_0x1bf2('0x10')](util[_0x1bf2('0x23')](_0x1bf2('0x24'),_0x132fc6[_0x1bf2('0x25')]));searchContact(_0x522a52,_0x17211d,_0x1bf2('0x26'),_0x132fc6[_0x1bf2('0x25')])['then'](function(_0x5f3c8d){if(_0x5f3c8d){_0x132fc6[_0x1bf2('0x27')]=_0x5f3c8d['id'];logger['info'](_0x1bf2('0x28'),_0x132fc6[_0x1bf2('0x27')]);return _0x5ea16d(_0x132fc6);}searchContact(_0x522a52,_0x17211d,_0x1bf2('0x29'),_0x132fc6[_0x1bf2('0x25')])[_0x1bf2('0x11')](function(_0x2f9ba3){if(_0x2f9ba3){_0x132fc6[_0x1bf2('0x27')]=_0x2f9ba3['id'];logger[_0x1bf2('0x10')]('Contact\x20found\x20work_number:',_0x132fc6[_0x1bf2('0x27')]);return _0x5ea16d(_0x132fc6);}createEndUser(_0x132fc6,_0x2e4ccb,_0x17211d,_0x522a52)[_0x1bf2('0x11')](function(_0x4f214a){logger[_0x1bf2('0x10')](_0x1bf2('0x2a'),_0x4f214a[_0x1bf2('0x27')]);return _0x5ea16d(_0x4f214a);});});})[_0x1bf2('0x19')](function(_0xd4b1b8){_0x12a4c0(_0xd4b1b8);});});};}function createEndUser(_0x5c16a2,_0x47ee29,_0xed80e0,_0x502142){return new Promise(function(_0x391e33,_0xd17d29){var _0x297c30=moment();var _0x33644b={'method':'POST','uri':_0x502142+_0x1bf2('0x2b'),'body':{'contact':{'last_name':_0x5c16a2[_0x1bf2('0x25')],'work_number':_0x5c16a2[_0x1bf2('0x25')],'mobile_number':_0x5c16a2[_0x1bf2('0x25')],'owner_id':_0x5c16a2[_0x1bf2('0x1e')],'created_at':_0x297c30['format'](_0x1bf2('0x2c'))}},'json':!![]};_0x33644b[_0x1bf2('0xf')]=_0xed80e0;logger[_0x1bf2('0x10')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x33644b)[_0x1bf2('0x11')](function(_0x36a619){_0x5c16a2[_0x1bf2('0x27')]=_0x36a619[_0x1bf2('0x2d')]['id'];_0x391e33(_0x5c16a2);})[_0x1bf2('0x19')](function(_0x604e79){logger[_0x1bf2('0x1f')]('['+[_0x47ee29[_0x1bf2('0x1a')]()]+']',_0x604e79[_0x1bf2('0x1b')]);_0xd17d29(_0x604e79[_0x1bf2('0x1b')]);});});}function getTicket(_0x439f42,_0xe15e28,_0x52abed,_0x5c5160,_0x2c5b73){return function(_0x43c086){logger[_0x1bf2('0x10')](_0x1bf2('0x2e'));return new Promise(function(_0x38e110,_0x2e61ba){var _0x23e21a=moment();var _0x262756={'method':_0x1bf2('0x2f'),'uri':_0x52abed+_0x1bf2('0x30'),'body':{'title':intUtil[_0x1bf2('0x31')](_0x5c5160[_0x1bf2('0x32')],_0x2c5b73,'\x20'),'description':intUtil[_0x1bf2('0x31')](_0x5c5160[_0x1bf2('0x33')],_0x2c5b73,'\x0a'),'owner_id':_0x43c086['userId'],'creater_id':_0x43c086['adminId'],'targetable_id':_0x43c086[_0x1bf2('0x27')],'targetable_type':_0x1bf2('0x34'),'created_at':_0x23e21a['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x23e21a[_0x1bf2('0x35')](0x1e,'m')[_0x1bf2('0x23')](_0x1bf2('0x2c'))},'json':!![]};_0x262756[_0x1bf2('0xf')]=_0xe15e28;return rp(_0x262756)['then'](function(_0x433604){_0x43c086['ticketId']=_0x433604[_0x1bf2('0x36')]['id'];logger[_0x1bf2('0x10')]('Task\x20created:',_0x43c086[_0x1bf2('0x37')]);_0x38e110(_0x43c086);})['catch'](function(_0x5c4a4b){logger[_0x1bf2('0x1f')]('['+[_0x439f42[_0x1bf2('0x1a')]()]+']',_0x5c4a4b[_0x1bf2('0x1b')]);_0x2e61ba(_0x5c4a4b['message']);});});};}function emit(_0x21997e,_0x44dfd6,_0x357136){var _0x4ae2f2={'uri':_0x21997e+_0x1bf2('0x38')+_0x357136};io['to'](util[_0x1bf2('0x23')](_0x1bf2('0x39'),_0x44dfd6))[_0x1bf2('0x3a')](_0x1bf2('0x3b'),_0x4ae2f2);}exports['cs']=function(_0x5d8d0b,_0x59a2d9,_0x2f12a9,_0x34fdbe,_0x4dcf63,_0x41f362,_0x2f3057,_0x2fb8a8){var _0x558aff={};var _0x4c04ab={'Authorization':'Token\x20token='+_0x41f362[_0x1bf2('0x3c')]};_0x41f362[_0x1bf2('0x3d')]=intUtil[_0x1bf2('0x3e')](_0x41f362['remoteUri']);_0x41f362['serverUrl']=intUtil['stripTrailingSlash'](_0x41f362[_0x1bf2('0x3f')]);var _0x759c99=_0x41f362[_0x1bf2('0x3d')];_0x558aff[_0x1bf2('0x15')]=_0x41f362[_0x1bf2('0x40')];_0x558aff['contactNumber']=_0x2fb8a8[_0x1bf2('0x41')]()===_0x1bf2('0x42')?_0x59a2d9['destcalleridnum']:_0x59a2d9[_0x1bf2('0x43')];_0x558aff[_0x1bf2('0x44')]=_0x2fb8a8===_0x1bf2('0x45')||_0x2fb8a8==='unmanaged'?_0x1bf2('0x45'):_0x1bf2('0x42');if(_0x34fdbe){_0x558aff['agentEmail']=_0x34fdbe[_0x1bf2('0x14')];}var _0x58e645=util[_0x1bf2('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41f362[_0x1bf2('0x3f')],_0x59a2d9[_0x1bf2('0x46')],md5(_0x59a2d9[_0x1bf2('0x46')]));if(_0x4dcf63&&_0x4dcf63['monitor_format']){logger['info'](_0x1bf2('0x47'),_0x1bf2('0x48'));_0x59a2d9[_0x1bf2('0x49')]=_0x58e645;}else if(_0x2f3057&&_0x2f3057[_0x1bf2('0x4a')]&&_0x2f3057[_0x1bf2('0x4a')]!==_0x1bf2('0x4b')){logger[_0x1bf2('0x10')](_0x1bf2('0x4c'),_0x1bf2('0x48'));_0x59a2d9[_0x1bf2('0x49')]=_0x58e645;}else{_0x59a2d9[_0x1bf2('0x49')]='';}return getAdminId(_0x558aff,_0x2fb8a8,_0x4c04ab,_0x759c99)[_0x1bf2('0x11')](getUser(_0x2fb8a8,_0x4c04ab,_0x759c99))[_0x1bf2('0x11')](getEndUser(_0x2fb8a8,_0x4c04ab,_0x759c99))[_0x1bf2('0x11')](getTicket(_0x2fb8a8,_0x4c04ab,_0x759c99,_0x2f12a9,_0x59a2d9))['then'](function(_0x17e461){logger[_0x1bf2('0x10')](util[_0x1bf2('0x23')](_0x1bf2('0x4d'),_0x17e461['ticketId']));if(_0x2fb8a8!==_0x1bf2('0x4e')){logger[_0x1bf2('0x10')]('['+[_0x2fb8a8[_0x1bf2('0x1a')]()]+']',_0x1bf2('0x4f'));emit(_0x759c99,_0x34fdbe[_0x1bf2('0x50')],_0x17e461[_0x1bf2('0x27')]);}})['catch'](function(_0x58c9bd){logger[_0x1bf2('0x1f')]('['+[_0x2fb8a8[_0x1bf2('0x1a')]()]+_0x1bf2('0x51'),util[_0x1bf2('0x52')](_0x58c9bd,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x32cf=['headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20with\x20email','agentEmail','User\x20found:','userId','userEmail','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','work_number','Contact\x20created:','POST','/api/contacts','contact','/api/tasks','Subjects','getString','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners'];(function(_0x46660d,_0x2a96f9){var _0x17017e=function(_0x1e0898){while(--_0x1e0898){_0x46660d['push'](_0x46660d['shift']());}};_0x17017e(++_0x2a96f9);}(_0x32cf,0x1c5));var _0xf32c=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x32cf[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0xf32c('0x0'));var rp=require(_0xf32c('0x1'));var md5=require(_0xf32c('0x2'));var util=require(_0xf32c('0x3'));var moment=require(_0xf32c('0x4'));var Promise=require(_0xf32c('0x5'));var Redis=require('ioredis');var intUtil=require(_0xf32c('0x6'));var config=require(_0xf32c('0x7'));var logger=require(_0xf32c('0x8'))(_0xf32c('0x9'));config[_0xf32c('0xa')]=_[_0xf32c('0xb')](config[_0xf32c('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xf32c('0xc'))(new Redis(config[_0xf32c('0xa')]));function getAdminId(_0x2452a8,_0x52c782,_0x541195,_0x3201ac){return new Promise(function(_0xe0efde,_0x331e21){var _0x4a8848=![];var _0x393480={'method':_0xf32c('0xd'),'uri':_0x3201ac+_0xf32c('0xe'),'json':!![]};_0x393480[_0xf32c('0xf')]=_0x541195;logger[_0xf32c('0x10')](_0xf32c('0x11'));return rp(_0x393480)[_0xf32c('0x12')](function(_0xcbb449){if(_0xcbb449){var _0x4499ab=_0xcbb449[_0xf32c('0x13')];var _0x19d4f7=null;for(_0x19d4f7=0x0;_0x19d4f7<_0x4499ab[_0xf32c('0x14')];_0x19d4f7++){if(_0x4499ab[_0x19d4f7]['email']===_0x2452a8[_0xf32c('0x15')]){_0x2452a8[_0xf32c('0x16')]=_0x4499ab[_0x19d4f7]['id'];_0x4a8848=!![];}}if(_0x4a8848){logger[_0xf32c('0x10')](_0xf32c('0x17'),_0x2452a8[_0xf32c('0x16')]);_0xe0efde(_0x2452a8);}else{_0x331e21({'statusCode':0x194,'message':_0xf32c('0x18')});}}else{_0x331e21({'statusCode':0x194,'message':_0xf32c('0x18')});}})[_0xf32c('0x19')](function(_0x883f1d){logger[_0xf32c('0x1a')]('['+[_0x52c782[_0xf32c('0x1b')]()]+']',_0x883f1d[_0xf32c('0x1c')]);_0x331e21(_0x883f1d);});});}function getUser(_0x1d31b1,_0x10225a,_0x481745){return function(_0x307742){return new Promise(function(_0x1b0762,_0xccddca){var _0x4fee62={'method':_0xf32c('0xd'),'uri':_0x481745+_0xf32c('0xe'),'json':!![]};_0x4fee62['headers']=_0x10225a;logger[_0xf32c('0x10')]('Getting\x20user\x20list');return rp(_0x4fee62)[_0xf32c('0x12')](function(_0x52c61c){if(_0x52c61c){var _0x2f7a02=_0x52c61c[_0xf32c('0x13')];var _0x58c569=![];var _0x39707a=null;if(_0x307742['agentEmail']!==null){logger['info'](_0xf32c('0x1d'),_0x307742[_0xf32c('0x1e')]);_0x307742['userEmail']=_0x307742['agentEmail'];for(_0x39707a=0x0;_0x39707a<_0x2f7a02[_0xf32c('0x14')];_0x39707a++){if(_0x2f7a02[_0x39707a]['email']===_0x307742[_0xf32c('0x1e')]){_0x58c569=!![];_0x307742['userId']=_0x2f7a02[_0x39707a]['id'];logger['info'](_0xf32c('0x1f'),_0x307742[_0xf32c('0x20')]);}}}if(!_0x58c569){logger[_0xf32c('0x10')]('Admin\x20selected');_0x307742[_0xf32c('0x21')]=_0x307742['adminEmail'];_0x307742[_0xf32c('0x20')]=_0x307742[_0xf32c('0x16')];_0x58c569=!![];}if(_0x58c569){_0x1b0762(_0x307742);}else{_0xccddca({'statusCode':0x194,'message':_0xf32c('0x18')});}}else{_0xccddca({'statusCode':0x194,'message':_0xf32c('0x18')});}})[_0xf32c('0x19')](function(_0x34aa1d){logger[_0xf32c('0x1a')]('['+[_0x1d31b1['toUpperCase']()]+']',_0x34aa1d[_0xf32c('0x1c')]);_0xccddca(_0x34aa1d);});});};}function searchContact(_0x569a1e,_0x400f90,_0x2b33f5,_0x6d2022){return new Promise(function(_0x3e79de,_0x3363da){var _0x298a7b={'method':_0xf32c('0xd'),'headers':_0x400f90,'uri':_0x569a1e+'/api/lookup?q='+_0x6d2022+_0xf32c('0x22')+_0x2b33f5+_0xf32c('0x23'),'json':!![]};rp(_0x298a7b)[_0xf32c('0x12')](function(_0x5165df){var _0x192e7b=_[_0xf32c('0x24')](_0x5165df[_0xf32c('0x25')][_0xf32c('0x25')],[_0x2b33f5,_0x6d2022]);_0x3e79de(_0x192e7b);})[_0xf32c('0x19')](function(_0x124653){_0x3363da(_0x124653);});});}function getEndUser(_0x53cae1,_0x6ba07,_0x31993e){return function(_0x1f1024){return new Promise(function(_0x1eba35,_0x30d58e){logger[_0xf32c('0x10')](util[_0xf32c('0x26')](_0xf32c('0x27'),_0x1f1024[_0xf32c('0x28')]));searchContact(_0x31993e,_0x6ba07,'mobile_number',_0x1f1024[_0xf32c('0x28')])[_0xf32c('0x12')](function(_0x65ecdd){if(_0x65ecdd){_0x1f1024[_0xf32c('0x29')]=_0x65ecdd['id'];logger[_0xf32c('0x10')]('Contact\x20found\x20mobile_number:',_0x1f1024[_0xf32c('0x29')]);return _0x1eba35(_0x1f1024);}searchContact(_0x31993e,_0x6ba07,_0xf32c('0x2a'),_0x1f1024[_0xf32c('0x28')])[_0xf32c('0x12')](function(_0x5479f4){if(_0x5479f4){_0x1f1024[_0xf32c('0x29')]=_0x5479f4['id'];logger['info']('Contact\x20found\x20work_number:',_0x1f1024['endUserId']);return _0x1eba35(_0x1f1024);}createEndUser(_0x1f1024,_0x53cae1,_0x6ba07,_0x31993e)[_0xf32c('0x12')](function(_0xfcc10c){logger['info'](_0xf32c('0x2b'),_0xfcc10c[_0xf32c('0x29')]);return _0x1eba35(_0xfcc10c);});});})['catch'](function(_0x257809){_0x30d58e(_0x257809);});});};}function createEndUser(_0x148e30,_0x2292ae,_0x2396c4,_0x3afbe9){return new Promise(function(_0x1feb52,_0x575796){var _0x46ffc1=moment();var _0x28c331={'method':_0xf32c('0x2c'),'uri':_0x3afbe9+_0xf32c('0x2d'),'body':{'contact':{'last_name':_0x148e30[_0xf32c('0x28')],'work_number':_0x148e30[_0xf32c('0x28')],'mobile_number':_0x148e30[_0xf32c('0x28')],'owner_id':_0x148e30[_0xf32c('0x20')],'created_at':_0x46ffc1[_0xf32c('0x26')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x28c331['headers']=_0x2396c4;logger[_0xf32c('0x10')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x28c331)['then'](function(_0x5704c5){_0x148e30[_0xf32c('0x29')]=_0x5704c5[_0xf32c('0x2e')]['id'];_0x1feb52(_0x148e30);})[_0xf32c('0x19')](function(_0x371bc0){logger[_0xf32c('0x1a')]('['+[_0x2292ae[_0xf32c('0x1b')]()]+']',_0x371bc0[_0xf32c('0x1c')]);_0x575796(_0x371bc0[_0xf32c('0x1c')]);});});}function getTicket(_0x5e29f4,_0x58bc68,_0x215212,_0x7b504d,_0x49a204){return function(_0x150691){logger[_0xf32c('0x10')]('Creating\x20new\x20task');return new Promise(function(_0x7cbe1e,_0x18e3bc){var _0xf87282=moment();var _0x59e808={'method':'POST','uri':_0x215212+_0xf32c('0x2f'),'body':{'title':intUtil['getString'](_0x7b504d[_0xf32c('0x30')],_0x49a204,'\x20'),'description':intUtil[_0xf32c('0x31')](_0x7b504d['Descriptions'],_0x49a204,'\x0a'),'owner_id':_0x150691[_0xf32c('0x20')],'creater_id':_0x150691[_0xf32c('0x16')],'targetable_id':_0x150691[_0xf32c('0x29')],'targetable_type':_0xf32c('0x32'),'created_at':_0xf87282[_0xf32c('0x26')](_0xf32c('0x33')),'due_date':_0xf87282[_0xf32c('0x34')](0x1e,'m')['format'](_0xf32c('0x33'))},'json':!![]};_0x59e808[_0xf32c('0xf')]=_0x58bc68;return rp(_0x59e808)['then'](function(_0x4c0621){_0x150691['ticketId']=_0x4c0621[_0xf32c('0x35')]['id'];logger[_0xf32c('0x10')](_0xf32c('0x36'),_0x150691['ticketId']);_0x7cbe1e(_0x150691);})[_0xf32c('0x19')](function(_0x3c1448){logger[_0xf32c('0x1a')]('['+[_0x5e29f4[_0xf32c('0x1b')]()]+']',_0x3c1448[_0xf32c('0x1c')]);_0x18e3bc(_0x3c1448[_0xf32c('0x1c')]);});});};}function emit(_0x58ca80,_0x734c14,_0xebb8e3){var _0x42e737={'uri':_0x58ca80+'/contacts/'+_0xebb8e3};io['to'](util[_0xf32c('0x26')](_0xf32c('0x37'),_0x734c14))[_0xf32c('0x38')](_0xf32c('0x39'),_0x42e737);}exports['cs']=function(_0x1cdaf9,_0x159a3e,_0x433941,_0x21ccf7,_0x1d02db,_0xd98568,_0x21694d,_0x473e38){var _0x10d9de={};var _0xb5d1bd={'Authorization':_0xf32c('0x3a')+_0xd98568['apiKey']};_0xd98568[_0xf32c('0x3b')]=intUtil[_0xf32c('0x3c')](_0xd98568[_0xf32c('0x3b')]);_0xd98568[_0xf32c('0x3d')]=intUtil[_0xf32c('0x3c')](_0xd98568[_0xf32c('0x3d')]);var _0x17e6cb=_0xd98568[_0xf32c('0x3b')];_0x10d9de[_0xf32c('0x15')]=_0xd98568[_0xf32c('0x3e')];_0x10d9de[_0xf32c('0x28')]=_0x473e38[_0xf32c('0x3f')]()===_0xf32c('0x40')?_0x159a3e[_0xf32c('0x41')]:_0x159a3e[_0xf32c('0x42')];_0x10d9de[_0xf32c('0x43')]=_0x473e38==='queue'||_0x473e38===_0xf32c('0x44')?'queue':_0xf32c('0x40');if(_0x21ccf7){_0x10d9de['agentEmail']=_0x21ccf7['email'];}var _0x549717=util[_0xf32c('0x26')](_0xf32c('0x45'),_0xd98568[_0xf32c('0x3d')],_0x159a3e[_0xf32c('0x46')],md5(_0x159a3e[_0xf32c('0x46')]));if(_0x1d02db&&_0x1d02db[_0xf32c('0x47')]){logger[_0xf32c('0x10')](_0xf32c('0x48'),_0xf32c('0x49'));_0x159a3e[_0xf32c('0x4a')]=_0x549717;}else if(_0x21694d&&_0x21694d['recordingFormat']&&_0x21694d['recordingFormat']!=='none'){logger[_0xf32c('0x10')](_0xf32c('0x4b'),_0xf32c('0x49'));_0x159a3e[_0xf32c('0x4a')]=_0x549717;}else{_0x159a3e[_0xf32c('0x4a')]='';}return getAdminId(_0x10d9de,_0x473e38,_0xb5d1bd,_0x17e6cb)['then'](getUser(_0x473e38,_0xb5d1bd,_0x17e6cb))[_0xf32c('0x12')](getEndUser(_0x473e38,_0xb5d1bd,_0x17e6cb))[_0xf32c('0x12')](getTicket(_0x473e38,_0xb5d1bd,_0x17e6cb,_0x433941,_0x159a3e))[_0xf32c('0x12')](function(_0x527645){logger[_0xf32c('0x10')](util[_0xf32c('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x527645['ticketId']));if(_0x473e38!==_0xf32c('0x44')){logger['info']('['+[_0x473e38['toUpperCase']()]+']',_0xf32c('0x4c'));emit(_0x17e6cb,_0x21ccf7['name'],_0x527645['endUserId']);}})[_0xf32c('0x19')](function(_0x2dd44a){logger[_0xf32c('0x1a')]('['+[_0x473e38[_0xf32c('0x1b')]()]+_0xf32c('0x4d'),util['inspect'](_0x2dd44a,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index b704d09..540736f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9352=['format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger','../../../../config/logger','error','[EXEC]'];(function(_0x24e23d,_0x26684a){var _0x14db43=function(_0x23ff5a){while(--_0x23ff5a){_0x24e23d['push'](_0x24e23d['shift']());}};_0x14db43(++_0x26684a);}(_0x9352,0x1ca));var _0x2935=function(_0x4308b7,_0x57bf55){_0x4308b7=_0x4308b7-0x0;var _0xae5193=_0x9352[_0x4308b7];return _0xae5193;};'use strict';var _=require(_0x2935('0x0'));var util=require(_0x2935('0x1'));var zendesk=require(_0x2935('0x2'));var salesforce=require(_0x2935('0x3'));var sugarcrm=require(_0x2935('0x4'));var freshdesk=require(_0x2935('0x5'));var zoho=require(_0x2935('0x6'));var desk=require(_0x2935('0x7'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x2935('0x8'));var integrations=[_0x2935('0x9'),_0x2935('0xa'),_0x2935('0xb'),_0x2935('0xc'),_0x2935('0xd'),_0x2935('0xe'),'vtiger',_0x2935('0xf'),_0x2935('0x10'),_0x2935('0x11')];exports[_0x2935('0x12')]=function(_0x4565cb,_0x130173,_0x11891c,_0x2e683c,_0x5de143,_0x2a8b39){if(_0x11891c){if(_[_0x2935('0x13')](integrations,_0x4565cb[_0x2935('0x14')][_0x2935('0x15')]())){try{var _0x42f116=null;var _0x132587='';var _0x116b19=_0x11891c[_0x4565cb[_0x2935('0x14')]['toLowerCase']()];if(_0x116b19){var _0x260615=_0x116b19[_0x4565cb[_0x2935('0x16')]];if(_0x260615){var _0x3743f7=_[_0x2935('0x17')](_0x260615[_0x2935('0x18')],{'id':parseInt(_0x4565cb[_0x2935('0x19')],0xa)});if(_0x3743f7){if(_0x2e683c){if(_0x5de143&&_0x130173['queue']){_0x132587=_0x2935('0x1a');}else if(_0x130173[_0x2935('0x1b')]){_0x132587=_0x2935('0x1c');}else{console[_0x2935('0x1d')](_0x2935('0x1e'),_0x130173);}}else{_0x132587=_0x2935('0x1f');}switch(_0x4565cb[_0x2935('0x14')][_0x2935('0x15')]()){case _0x2935('0x9'):zendesk[_0x132587](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39);break;case _0x2935('0xa'):salesforce[_0x132587](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39);break;case _0x2935('0xb'):sugarcrm[_0x132587](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39);break;case _0x2935('0xc'):freshdesk[_0x132587](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39);break;case _0x2935('0xd'):zoho[_0x132587](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39);break;case _0x2935('0xe'):desk[_0x132587](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39);break;case _0x2935('0x20'):vtiger[_0x132587](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39);break;case'freshsales':freshsales['cs'](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39,_0x132587);break;case _0x2935('0x11'):servicenow['cs'](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39,_0x132587);break;case _0x2935('0xf'):dynamics365['cs'](_0x4565cb,_0x130173,_0x3743f7,_0x2e683c,_0x5de143,_0x260615,_0x2a8b39,_0x132587);break;default:console[_0x2935('0x1d')]('unknown\x20integration');}}else{_0x42f116=require(_0x2935('0x21'))(_0x4565cb[_0x2935('0x14')][_0x2935('0x15')]());_0x42f116[_0x2935('0x22')](_0x2935('0x23'),util[_0x2935('0x24')](_0x2935('0x25'),_0x4565cb[_0x2935('0x14')][_0x2935('0x15')](),_0x4565cb[_0x2935('0x19')]));}}else{_0x42f116=require(_0x2935('0x21'))(_0x4565cb[_0x2935('0x14')][_0x2935('0x15')]());_0x42f116['error']('[EXEC]',util[_0x2935('0x24')]('%s\x20account\x20#%s\x20not\x20found',_0x4565cb['data1'][_0x2935('0x15')](),_0x4565cb['data2']));}}else{}}catch(_0x1512a7){console[_0x2935('0x22')](_0x1512a7);}}}};
\ No newline at end of file
+var _0xa055=['toLowerCase','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','zendesk','vtiger','error','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','[EXEC]','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales','exec','includes','data1'];(function(_0x458636,_0x2b4ff2){var _0x1a9094=function(_0x6dc106){while(--_0x6dc106){_0x458636['push'](_0x458636['shift']());}};_0x1a9094(++_0x2b4ff2);}(_0xa055,0x15d));var _0x5a05=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0xa055[_0x3d27ba];return _0xf01885;};'use strict';var _=require('lodash');var util=require(_0x5a05('0x0'));var zendesk=require(_0x5a05('0x1'));var salesforce=require(_0x5a05('0x2'));var sugarcrm=require(_0x5a05('0x3'));var freshdesk=require(_0x5a05('0x4'));var zoho=require(_0x5a05('0x5'));var desk=require(_0x5a05('0x6'));var vtiger=require(_0x5a05('0x7'));var servicenow=require(_0x5a05('0x8'));var dynamics365=require(_0x5a05('0x9'));var freshsales=require(_0x5a05('0xa'));var integrations=['zendesk',_0x5a05('0xb'),_0x5a05('0xc'),_0x5a05('0xd'),_0x5a05('0xe'),_0x5a05('0xf'),'vtiger',_0x5a05('0x10'),_0x5a05('0x11'),'servicenow'];exports[_0x5a05('0x12')]=function(_0x403a6f,_0x328ca2,_0x178658,_0x4c7ff3,_0x1bfe42,_0x5fe8c6){if(_0x178658){if(_[_0x5a05('0x13')](integrations,_0x403a6f[_0x5a05('0x14')][_0x5a05('0x15')]())){try{var _0x2e31de=null;var _0x5be92a='';var _0x285f73=_0x178658[_0x403a6f[_0x5a05('0x14')][_0x5a05('0x15')]()];if(_0x285f73){var _0x25aa09=_0x285f73[_0x403a6f['data2']];if(_0x25aa09){var _0x37660e=_['find'](_0x25aa09['Configurations'],{'id':parseInt(_0x403a6f[_0x5a05('0x16')],0xa)});if(_0x37660e){if(_0x4c7ff3){if(_0x1bfe42&&_0x328ca2[_0x5a05('0x17')]){_0x5be92a=_0x5a05('0x17');}else if(_0x328ca2[_0x5a05('0x18')]){_0x5be92a=_0x5a05('0x19');}else{console[_0x5a05('0x1a')](_0x5a05('0x1b'),_0x328ca2);}}else{_0x5be92a='unmanaged';}switch(_0x403a6f[_0x5a05('0x14')][_0x5a05('0x15')]()){case _0x5a05('0x1c'):zendesk[_0x5be92a](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6);break;case'salesforce':salesforce[_0x5be92a](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6);break;case'sugarcrm':sugarcrm[_0x5be92a](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6);break;case _0x5a05('0xd'):freshdesk[_0x5be92a](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6);break;case _0x5a05('0xe'):zoho[_0x5be92a](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6);break;case _0x5a05('0xf'):desk[_0x5be92a](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6);break;case _0x5a05('0x1d'):vtiger[_0x5be92a](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6);break;case'freshsales':freshsales['cs'](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6,_0x5be92a);break;case'servicenow':servicenow['cs'](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6,_0x5be92a);break;case _0x5a05('0x10'):dynamics365['cs'](_0x403a6f,_0x328ca2,_0x37660e,_0x4c7ff3,_0x1bfe42,_0x25aa09,_0x5fe8c6,_0x5be92a);break;default:console['log']('unknown\x20integration');}}else{_0x2e31de=require('../../../../config/logger')(_0x403a6f[_0x5a05('0x14')][_0x5a05('0x15')]());_0x2e31de[_0x5a05('0x1e')]('[EXEC]',util[_0x5a05('0x1f')](_0x5a05('0x20'),_0x403a6f[_0x5a05('0x14')][_0x5a05('0x15')](),_0x403a6f['data3']));}}else{_0x2e31de=require(_0x5a05('0x21'))(_0x403a6f[_0x5a05('0x14')][_0x5a05('0x15')]());_0x2e31de[_0x5a05('0x1e')](_0x5a05('0x22'),util[_0x5a05('0x1f')](_0x5a05('0x23'),_0x403a6f[_0x5a05('0x14')]['toLowerCase'](),_0x403a6f[_0x5a05('0x24')]));}}else{}}catch(_0x42d99c){console[_0x5a05('0x1e')](_0x42d99c);}}}};
\ No newline at end of file
index 2880594..2568385 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa883=['Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','User','find','then','length','Email','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','cloneDeep','additionalSearchContact','Contact','additionalSearchLead','merge','$or','Lead','account_contact_lead','additionalSearchAccount','Account','execute','Phone','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','destcalleridname','trigger:browser:url','%s/%s/e','[OUTBOUND]','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','Subjects','Descriptions','ticketType','Task','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','leadId','info'];(function(_0x2be159,_0xd2efb7){var _0xd66f45=function(_0x46be39){while(--_0x46be39){_0x2be159['push'](_0x2be159['shift']());}};_0xd66f45(++_0xd2efb7);}(_0xa883,0x144));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0x3a88('0x0'));var moment=require(_0x3a88('0x1'));var BPromise=require('bluebird');var md5=require(_0x3a88('0x2'));var jsforce=require(_0x3a88('0x3'));var util=require('util');var Redis=require(_0x3a88('0x4'));var intUtil=require(_0x3a88('0x5'));var config=require(_0x3a88('0x6'));var logger=require(_0x3a88('0x7'))(_0x3a88('0x8'));config[_0x3a88('0x9')]=_[_0x3a88('0xa')](config[_0x3a88('0x9')],{'host':_0x3a88('0xb'),'port':0x18eb});var io=require(_0x3a88('0xc'))(new Redis(config[_0x3a88('0x9')]));function emit(_0x52cf29,_0x580c83,_0x4ba144){io['to'](_0x52cf29)[_0x3a88('0xd')](_0x580c83,_0x4ba144);}function getTicket(_0x484e07,_0x3327db,_0x17b298,_0x4d4653,_0x1783f9,_0x9c7fc3,_0x49f9b2,_0x59abb4){var _0xbc1000=Object['assign']({},{'OwnerId':_0x3327db['id'],'Subject':intUtil['getString'](_0x4d4653[_0x3a88('0xe')],_0x1783f9,'\x20'),'Description':intUtil['getString'](_0x4d4653[_0x3a88('0xf')],_0x1783f9,'\x0a')},getCustomFields(_0x9c7fc3,_0x1783f9));if(_0x17b298){if(_0x4d4653[_0x3a88('0x10')]===_0x3a88('0x11')){_0xbc1000['ActivityDate']=moment[_0x3a88('0x12')]();_0xbc1000['IsReminderSet']=![];_0xbc1000[_0x3a88('0x13')]=![];if(_0x17b298[_0x3a88('0x14')]===_0x3a88('0x15')||_0x17b298['endUserType']===_0x3a88('0x16')){_0xbc1000[_0x3a88('0x17')]=_0x17b298['id'];}else if(_0x17b298[_0x3a88('0x14')]===_0x3a88('0x18')){_0xbc1000[_0x3a88('0x19')]=_0x17b298['id'];}}else if(_0x4d4653[_0x3a88('0x10')]===_0x3a88('0x1a')){if(_0x17b298[_0x3a88('0x14')]===_0x3a88('0x15')){_0xbc1000[_0x3a88('0x1b')]=_0x17b298['id'];}else if(_0x17b298[_0x3a88('0x14')]===_0x3a88('0x18')){_0xbc1000['AccountId']=_0x17b298['id'];}else if(_0x17b298[_0x3a88('0x14')]==='lead'&&_0x4d4653[_0x3a88('0x1c')]){_0xbc1000[_0x4d4653[_0x3a88('0x1c')]]=_0x17b298['id'];}else{logger[_0x3a88('0x1d')](_0x3a88('0x1e'));}}}return _0x49f9b2[_0x3a88('0x1f')](_0x4d4653[_0x3a88('0x10')])['create'](_0xbc1000);}function getUser(_0xbd7180,_0x5eb164,_0x1eca39){if(!_[_0x3a88('0x20')](_0x5eb164)&&intUtil['validateEmail'](_0x5eb164)){var _0x139e1b={'Email':_0x5eb164};var _0x3aeb79={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1eca39[_0x3a88('0x1f')](_0x3a88('0x21'))[_0x3a88('0x22')](_0x139e1b,_0x3aeb79)['execute']()[_0x3a88('0x23')](function(_0x4320e0){if(_0x4320e0[_0x3a88('0x24')]){var _0x272c2a=_[_0x3a88('0x22')](_0x4320e0,function(_0x40f7d0){return _0x40f7d0[_0x3a88('0x25')]===_0x5eb164;});if(_0x272c2a){logger[_0x3a88('0x1d')]('Agent\x20%s\x20found.',_0x5eb164);return BPromise[_0x3a88('0x26')]({'id':_0x272c2a['Id'],'name':_0x272c2a[_0x3a88('0x27')]});}}else{logger[_0x3a88('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5eb164);return _0x1eca39[_0x3a88('0x28')]()[_0x3a88('0x23')](function(_0x5c0ef1){return BPromise[_0x3a88('0x26')]({'id':_0x5c0ef1[_0x3a88('0x29')],'name':_0x5c0ef1[_0x3a88('0x2a')]});});}});}else{logger[_0x3a88('0x1d')](_0x3a88('0x2b'),_0x5eb164);return _0x1eca39[_0x3a88('0x28')]()[_0x3a88('0x23')](function(_0x41614e){return BPromise[_0x3a88('0x26')]({'id':_0x41614e['user_id'],'name':_0x41614e[_0x3a88('0x2a')]});});}}function getEndUser(_0x373687,_0x2f8895,_0x557dd0,_0x282fd9,_0x4940c4){var _0x532825={'$or':{'Phone':_0x282fd9}};var _0x33482c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3a88('0x26')]()[_0x3a88('0x23')](function(){logger[_0x3a88('0x1d')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x282fd9,_0x2f8895[_0x3a88('0x2c')]);switch(_0x2f8895[_0x3a88('0x2c')]){case'contact_lead':var _0x19b41c=_[_0x3a88('0x2d')](_0x532825);if(_0x2f8895[_0x3a88('0x2e')]){var _0x55a91d={};_0x55a91d[_0x2f8895[_0x3a88('0x2e')]]=_0x282fd9;_['merge'](_0x19b41c['$or'],_0x55a91d);}return _0x4940c4[_0x3a88('0x1f')](_0x3a88('0x2f'))[_0x3a88('0x22')](_0x19b41c,_0x33482c)['execute']()['then'](function(_0x41a76c){if(_0x41a76c&&_0x41a76c['length']){return _0x41a76c;}else{var _0x3291fd=_[_0x3a88('0x2d')](_0x532825);if(_0x2f8895[_0x3a88('0x30')]){var _0x2b4072={};_0x2b4072[_0x2f8895[_0x3a88('0x30')]]=_0x282fd9;_[_0x3a88('0x31')](_0x3291fd[_0x3a88('0x32')],_0x2b4072);}return _0x4940c4['sobject'](_0x3a88('0x33'))[_0x3a88('0x22')](_0x3291fd,_0x33482c);}});case _0x3a88('0x34'):var _0x3b3d7e=_[_0x3a88('0x2d')](_0x532825);if(_0x2f8895[_0x3a88('0x35')]){var _0x55a91d={};_0x55a91d[_0x2f8895[_0x3a88('0x35')]]=_0x282fd9;_['merge'](_0x3b3d7e[_0x3a88('0x32')],_0x55a91d);}return _0x4940c4[_0x3a88('0x1f')](_0x3a88('0x36'))[_0x3a88('0x22')](_0x3b3d7e,_0x33482c)[_0x3a88('0x37')]()['then'](function(_0x5ff399){if(_0x5ff399&&_0x5ff399['length']){return _0x5ff399;}else{var _0x326aea=_['cloneDeep'](_0x532825);if(_0x2f8895[_0x3a88('0x2e')]){var _0x3f81f6={};_0x3f81f6[_0x2f8895[_0x3a88('0x2e')]]=_0x282fd9;_['merge'](_0x326aea['$or'],_0x3f81f6);}return _0x4940c4[_0x3a88('0x1f')](_0x3a88('0x2f'))['find'](_0x326aea,_0x33482c)['then'](function(_0x9057f0){if(_0x9057f0&&_0x9057f0['length']){return _0x9057f0;}else{var _0x26af13=_['cloneDeep'](_0x532825);if(_0x2f8895[_0x3a88('0x30')]){var _0x3bd0bd={};_0x3bd0bd[_0x2f8895[_0x3a88('0x30')]]=_0x282fd9;_[_0x3a88('0x31')](_0x26af13[_0x3a88('0x32')],_0x3bd0bd);}return _0x4940c4[_0x3a88('0x1f')](_0x3a88('0x33'))[_0x3a88('0x22')](_0x26af13,_0x33482c);}});}});case _0x3a88('0x15'):var _0x19b41c=_[_0x3a88('0x2d')](_0x532825);if(_0x2f8895[_0x3a88('0x2e')]){var _0x55a91d={};_0x55a91d[_0x2f8895[_0x3a88('0x2e')]]=_0x282fd9;_[_0x3a88('0x31')](_0x19b41c['$or'],_0x55a91d);}return _0x4940c4[_0x3a88('0x1f')](_0x3a88('0x2f'))['find'](_0x19b41c,_0x33482c)[_0x3a88('0x37')]();case _0x3a88('0x16'):var _0x3552c3=_[_0x3a88('0x2d')](_0x532825);if(_0x2f8895['additionalSearchLead']){var _0x55a91d={};_0x55a91d[_0x2f8895[_0x3a88('0x30')]]=_0x282fd9;_['merge'](_0x3552c3[_0x3a88('0x32')],_0x55a91d);}return _0x4940c4['sobject']('Lead')[_0x3a88('0x22')](_0x3552c3,_0x33482c);case'account':var _0x3b3d7e=_[_0x3a88('0x2d')](_0x532825);if(_0x2f8895['additionalSearchAccount']){var _0x55a91d={};_0x55a91d[_0x2f8895[_0x3a88('0x35')]]=_0x282fd9;_['merge'](_0x3b3d7e[_0x3a88('0x32')],_0x55a91d);}return _0x4940c4[_0x3a88('0x1f')](_0x3a88('0x36'))[_0x3a88('0x22')](_0x3b3d7e,_0x33482c);default:return null;}})[_0x3a88('0x23')](function(_0x10b1d5){if(_0x10b1d5&&_0x10b1d5[_0x3a88('0x24')]){var _0x42c5cb=_['first'](_0x10b1d5);if(_0x42c5cb){return BPromise[_0x3a88('0x26')]({'id':_0x42c5cb['Id'],'name':_0x42c5cb['Name'],'phone':_0x42c5cb[_0x3a88('0x38')],'endUserType':_0x42c5cb['attributes'][_0x3a88('0x39')][_0x3a88('0x3a')]()});}}})[_0x3a88('0x23')](function(_0x4a481d){if(_0x4a481d){logger[_0x3a88('0x1d')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x4a481d[_0x3a88('0x14')],_0x282fd9);return BPromise[_0x3a88('0x26')](_0x4a481d);}else{logger['info'](_0x3a88('0x3b'),_0x282fd9);var _0x2b0433={'Phone':_0x282fd9};if(_0x2f8895[_0x3a88('0x3c')]){if(_0x2f8895[_0x3a88('0x3c')]===_0x3a88('0x15')){logger['info'](_0x3a88('0x3d'),_0x282fd9,_0x2f8895[_0x3a88('0x3c')]);_0x2b0433[_0x3a88('0x3e')]=_0x557dd0!==_0x3a88('0x3f')?_0x557dd0:util['format'](_0x3a88('0x40'),_0x282fd9);}else if(_0x2f8895[_0x3a88('0x3c')]===_0x3a88('0x16')){logger[_0x3a88('0x1d')](_0x3a88('0x3d'),_0x282fd9,_0x2f8895[_0x3a88('0x3c')]);_0x2b0433[_0x3a88('0x3e')]=_0x557dd0!==_0x3a88('0x3f')?_0x557dd0:util['format']('Caller\x20-\x20%s',_0x282fd9);_0x2b0433[_0x3a88('0x41')]=_0x3a88('0x42');}else if(_0x2f8895[_0x3a88('0x3c')]===_0x3a88('0x18')){logger[_0x3a88('0x1d')](_0x3a88('0x3d'),_0x282fd9,_0x2f8895[_0x3a88('0x3c')]);_0x2b0433[_0x3a88('0x27')]=_0x557dd0!=='<unknown>'?_0x557dd0:util['format']('Caller\x20-\x20%s',_0x282fd9);}else{return null;}}return _0x4940c4[_0x3a88('0x1f')](_[_0x3a88('0x43')](_0x2f8895['moduleCreate']))['create'](_0x2b0433)[_0x3a88('0x23')](function(_0x4c797b){return BPromise[_0x3a88('0x26')]({'id':_0x4c797b['id'],'endUserType':_0x2f8895[_0x3a88('0x3c')]});});}});}function getCustomFields(_0x41817d,_0x47d5a9){var _0x2a8f08={};if(_0x41817d['length']>0x0){_['forEach'](_0x41817d,function(_0x377531){if(_[_0x3a88('0x44')]([_0x3a88('0x45'),_0x3a88('0x46')],_0x377531[_0x3a88('0x39')])&&_0x377531[_0x3a88('0x47')]){_0x2a8f08[_0x377531[_0x3a88('0x47')]]=_0x377531[_0x3a88('0x48')][_0x3a88('0x49')]();}else if(_0x377531[_0x3a88('0x39')]===_0x3a88('0x4a')&&_0x377531[_0x3a88('0x4b')]&&_0x377531[_0x3a88('0x47')]){_0x47d5a9[_0x377531['variableName']]&&(_0x2a8f08[_0x377531[_0x3a88('0x47')]]=_0x47d5a9[_0x377531[_0x3a88('0x4b')]][_0x3a88('0x49')]());}else if(_0x377531[_0x3a88('0x39')]==='customVariable'&&_0x377531[_0x3a88('0x4c')]&&_0x377531[_0x3a88('0x4c')][_0x3a88('0x4d')]&&_0x377531['idField']){_0x47d5a9[_0x377531[_0x3a88('0x4c')]['name'][_0x3a88('0x3a')]()]&&(_0x2a8f08[_0x377531[_0x3a88('0x47')]]=_0x47d5a9[_0x377531[_0x3a88('0x4c')]['name'][_0x3a88('0x3a')]()][_0x3a88('0x49')]());}});}return _0x2a8f08;}function getConnection(_0x3f6a45){var _0x1b890c=_0x3f6a45['password'][_0x3a88('0x4e')](_0x3f6a45[_0x3a88('0x4f')]);var _0x31e38f=new jsforce[(_0x3a88('0x50'))]({'oauth2':{'loginUrl':_0x3f6a45[_0x3a88('0x51')]||_0x3a88('0x52'),'clientId':_0x3f6a45['clientId'],'clientSecret':_0x3f6a45[_0x3a88('0x53')]}});return _0x31e38f[_0x3a88('0x54')](_0x3f6a45['username'],_0x1b890c)[_0x3a88('0x23')](function(){logger[_0x3a88('0x1d')]('Connection\x20established.');return _0x31e38f;});}exports['queue']=function(_0x42b06c,_0x8b0b1b,_0x268138,_0x4bbc9d,_0x31937c,_0x392cfd){var _0x250f47,_0x55ff28,_0x2fe4ba,_0x12b448;_0x392cfd[_0x3a88('0x55')]=intUtil[_0x3a88('0x56')](_0x392cfd[_0x3a88('0x55')]);_0x392cfd[_0x3a88('0x51')]=intUtil[_0x3a88('0x56')](_0x392cfd[_0x3a88('0x51')]);if(_0x31937c&&_0x31937c[_0x3a88('0x57')]){logger[_0x3a88('0x1d')]('[QUEUE]',_0x3a88('0x58'));_0x8b0b1b[_0x3a88('0x59')]=util[_0x3a88('0x5a')](_0x3a88('0x5b'),_0x392cfd['serverUrl'],_0x8b0b1b[_0x3a88('0x5c')],md5(_0x8b0b1b[_0x3a88('0x5c')]));}else{_0x8b0b1b[_0x3a88('0x59')]='';}return getConnection(_0x392cfd)['then'](function(_0x4421d8){_0x12b448=_0x4421d8;return getUser(_0x392cfd,_0x4bbc9d[_0x3a88('0x5d')],_0x12b448);})[_0x3a88('0x23')](function(_0x407014){_0x250f47=_0x407014;return getEndUser(_0x392cfd,_0x268138,_0x8b0b1b[_0x3a88('0x5e')],_0x8b0b1b['calleridnum'],_0x12b448);})[_0x3a88('0x23')](function(_0x15310d){_0x55ff28=_0x15310d;return getTicket(_0x392cfd,_0x250f47,_0x55ff28,_0x268138,_0x8b0b1b,_0x268138[_0x3a88('0x5f')],_0x12b448,'queue');})[_0x3a88('0x23')](function(_0x145a8e){_0x2fe4ba=_0x145a8e;logger['info'](_0x3a88('0x60'),_0x2fe4ba['id']);logger['info'](_0x3a88('0x61'),_0x2fe4ba['id'],_0x4bbc9d[_0x3a88('0x4d')],_0x392cfd[_0x3a88('0x39')]);switch(_0x392cfd[_0x3a88('0x39')]){case _0x3a88('0x62'):emit(util[_0x3a88('0x5a')](_0x3a88('0x63'),_0x4bbc9d[_0x3a88('0x4d')]),_0x3a88('0x64'),{'recordId':_0x2fe4ba['id']});break;case _0x3a88('0x65'):emit(util['format'](_0x3a88('0x63'),_0x4bbc9d[_0x3a88('0x4d')]),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0x12b448[_0x3a88('0x66')],_0x2fe4ba['id'])});break;default:logger[_0x3a88('0x67')](_0x3a88('0x68'));}})[_0x3a88('0x69')](function(_0x3b44cf){logger[_0x3a88('0x67')](_0x3a88('0x6a'),_0x3b44cf);});};exports[_0x3a88('0x6b')]=function(_0x3865f2,_0x8b2cdb,_0x11af05,_0x322c7f,_0x1d60e3,_0x4fcea7,_0x31d3f2){var _0x32b942,_0x1c95e4,_0x194188,_0x4e20a8;_0x4fcea7[_0x3a88('0x55')]=intUtil[_0x3a88('0x56')](_0x4fcea7[_0x3a88('0x55')]);_0x4fcea7[_0x3a88('0x51')]=intUtil[_0x3a88('0x56')](_0x4fcea7[_0x3a88('0x51')]);if(_0x31d3f2&&_0x31d3f2[_0x3a88('0x6c')]&&_0x31d3f2[_0x3a88('0x6c')]!==_0x3a88('0x6d')){logger[_0x3a88('0x1d')]('[OUTBOUND]',_0x3a88('0x58'));_0x8b2cdb[_0x3a88('0x59')]=util[_0x3a88('0x5a')](_0x3a88('0x5b'),_0x4fcea7[_0x3a88('0x55')],_0x8b2cdb['uniqueid'],md5(_0x8b2cdb[_0x3a88('0x5c')]));}return getConnection(_0x4fcea7)[_0x3a88('0x23')](function(_0x387038){_0x4e20a8=_0x387038;return getUser(_0x4fcea7,_0x322c7f[_0x3a88('0x5d')],_0x4e20a8);})[_0x3a88('0x23')](function(_0x3b9fc7){_0x32b942=_0x3b9fc7;return getEndUser(_0x4fcea7,_0x11af05,_0x8b2cdb[_0x3a88('0x6e')],_0x8b2cdb['destcalleridnum'],_0x4e20a8);})[_0x3a88('0x23')](function(_0x46abef){_0x1c95e4=_0x46abef;return getTicket(_0x4fcea7,_0x32b942,_0x1c95e4,_0x11af05,_0x8b2cdb,_0x11af05[_0x3a88('0x5f')],_0x4e20a8,_0x3a88('0x6b'));})[_0x3a88('0x23')](function(_0x29d841){_0x194188=_0x29d841;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x194188['id']);logger[_0x3a88('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x194188['id'],_0x322c7f[_0x3a88('0x4d')],_0x4fcea7[_0x3a88('0x39')]);switch(_0x4fcea7[_0x3a88('0x39')]){case _0x3a88('0x62'):emit(util[_0x3a88('0x5a')](_0x3a88('0x63'),_0x322c7f[_0x3a88('0x4d')]),_0x3a88('0x64'),{'recordId':_0x194188['id']});break;case _0x3a88('0x65'):emit(util[_0x3a88('0x5a')](_0x3a88('0x63'),_0x322c7f[_0x3a88('0x4d')]),_0x3a88('0x6f'),{'uri':util[_0x3a88('0x5a')](_0x3a88('0x70'),_0x4e20a8[_0x3a88('0x66')],_0x194188['id'])});break;default:logger[_0x3a88('0x67')](_0x3a88('0x71'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x3a88('0x69')](function(_0x7fc74c){logger['error'](_0x3a88('0x71'),_0x7fc74c);});};exports['unmanaged']=function(_0x5416fd,_0x4f17c9,_0x5f1b60,_0x1833af,_0x4b3541,_0x55f424){var _0x1de04d,_0x454b3b,_0x4b21f9,_0x14783f;_0x55f424[_0x3a88('0x55')]=intUtil[_0x3a88('0x56')](_0x55f424['serverUrl']);_0x55f424[_0x3a88('0x51')]=intUtil[_0x3a88('0x56')](_0x55f424['remoteUri']);if(_0x4b3541&&_0x4b3541[_0x3a88('0x57')]){logger[_0x3a88('0x1d')]('['+_0x4f17c9['lastevent'][_0x3a88('0x72')]()+']',_0x3a88('0x58'));_0x4f17c9['recordingURL']=util[_0x3a88('0x5a')](_0x3a88('0x5b'),_0x55f424[_0x3a88('0x55')],_0x4f17c9[_0x3a88('0x5c')],md5(_0x4f17c9[_0x3a88('0x5c')]));}else{_0x4f17c9[_0x3a88('0x59')]='';}return getConnection(_0x55f424)[_0x3a88('0x23')](function(_0x52ea0a){_0x14783f=_0x52ea0a;if(!_[_0x3a88('0x20')](_0x1833af)){return getUser(_0x55f424,_0x1833af[_0x3a88('0x4d')],_0x14783f);}else{return getUser(_0x55f424,null,_0x14783f);}})[_0x3a88('0x23')](function(_0x36c242){_0x1de04d=_0x36c242;return getEndUser(_0x55f424,_0x5f1b60,_0x4f17c9[_0x3a88('0x5e')],_0x4f17c9['calleridnum'],_0x14783f);})['then'](function(_0x1555be){_0x454b3b=_0x1555be;return getTicket(_0x55f424,_0x1de04d,_0x454b3b,_0x5f1b60,_0x4f17c9,_0x5f1b60['Fields'],_0x14783f);})[_0x3a88('0x23')](function(_0x2150e0){_0x4b21f9=_0x2150e0;logger[_0x3a88('0x1d')]('['+_0x4f17c9[_0x3a88('0x73')][_0x3a88('0x72')]()+_0x3a88('0x74'),_0x4b21f9['id']);logger[_0x3a88('0x1d')]('['+_0x4f17c9[_0x3a88('0x73')][_0x3a88('0x72')]()+_0x3a88('0x75'),_0x55f424['type']);})[_0x3a88('0x69')](function(_0x5f45ef){logger[_0x3a88('0x67')]('['+_0x4f17c9[_0x3a88('0x73')][_0x3a88('0x72')]()+']',_0x5f45ef);});};
\ No newline at end of file
+var _0x3f55=['user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','additionalSearchLead','merge','$or','account_contact_lead','cloneDeep','additionalSearchAccount','sobject','Contact','Lead','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','No\x20Company','<unknown>','upperFirst','includes','idField','content','variableName','customVariable','Variable','name','toString','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','trigger:browser:url','%s/%s/e','monitor_format','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/logger','salesforce','redis','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name'];(function(_0x39bb18,_0x4a7e50){var _0x41bba8=function(_0x4afe95){while(--_0x4afe95){_0x39bb18['push'](_0x39bb18['shift']());}};_0x41bba8(++_0x4a7e50);}(_0x3f55,0x1d5));var _0x53f5=function(_0x122633,_0x22057b){_0x122633=_0x122633-0x0;var _0x2d02e5=_0x3f55[_0x122633];return _0x2d02e5;};'use strict';var _=require(_0x53f5('0x0'));var rp=require(_0x53f5('0x1'));var moment=require(_0x53f5('0x2'));var BPromise=require(_0x53f5('0x3'));var md5=require(_0x53f5('0x4'));var jsforce=require('jsforce');var util=require(_0x53f5('0x5'));var Redis=require(_0x53f5('0x6'));var intUtil=require(_0x53f5('0x7'));var config=require('../../../../config/environment');var logger=require(_0x53f5('0x8'))(_0x53f5('0x9'));config[_0x53f5('0xa')]=_['defaults'](config[_0x53f5('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x53f5('0xb'))(new Redis(config['redis']));function emit(_0x45bbfd,_0x4a7aaf,_0x5566f8){io['to'](_0x45bbfd)[_0x53f5('0xc')](_0x4a7aaf,_0x5566f8);}function getTicket(_0x4714e2,_0x4d105d,_0x2c0342,_0x1f1c87,_0x5541e8,_0x189fc0,_0x19d739,_0x1b4256){var _0x4ea21d=Object[_0x53f5('0xd')]({},{'OwnerId':_0x4d105d['id'],'Subject':intUtil[_0x53f5('0xe')](_0x1f1c87[_0x53f5('0xf')],_0x5541e8,'\x20'),'Description':intUtil[_0x53f5('0xe')](_0x1f1c87[_0x53f5('0x10')],_0x5541e8,'\x0a')},getCustomFields(_0x189fc0,_0x5541e8));if(_0x2c0342){if(_0x1f1c87[_0x53f5('0x11')]===_0x53f5('0x12')){_0x4ea21d[_0x53f5('0x13')]=moment[_0x53f5('0x14')]();_0x4ea21d['IsReminderSet']=![];_0x4ea21d[_0x53f5('0x15')]=![];if(_0x2c0342[_0x53f5('0x16')]===_0x53f5('0x17')||_0x2c0342['endUserType']===_0x53f5('0x18')){_0x4ea21d[_0x53f5('0x19')]=_0x2c0342['id'];}else if(_0x2c0342[_0x53f5('0x16')]===_0x53f5('0x1a')){_0x4ea21d['WhatId']=_0x2c0342['id'];}}else if(_0x1f1c87['ticketType']===_0x53f5('0x1b')){if(_0x2c0342[_0x53f5('0x16')]===_0x53f5('0x17')){_0x4ea21d[_0x53f5('0x1c')]=_0x2c0342['id'];}else if(_0x2c0342[_0x53f5('0x16')]===_0x53f5('0x1a')){_0x4ea21d[_0x53f5('0x1d')]=_0x2c0342['id'];}else if(_0x2c0342['endUserType']===_0x53f5('0x18')&&_0x1f1c87['leadId']){_0x4ea21d[_0x1f1c87[_0x53f5('0x1e')]]=_0x2c0342['id'];}else{logger[_0x53f5('0x1f')](_0x53f5('0x20'));}}}return _0x19d739['sobject'](_0x1f1c87[_0x53f5('0x11')])[_0x53f5('0x21')](_0x4ea21d);}function getUser(_0x3b6dff,_0x14c397,_0x5ab224){if(!_[_0x53f5('0x22')](_0x14c397)&&intUtil['validateEmail'](_0x14c397)){var _0x148213={'Email':_0x14c397};var _0x1f8a79={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5ab224['sobject'](_0x53f5('0x23'))[_0x53f5('0x24')](_0x148213,_0x1f8a79)[_0x53f5('0x25')]()[_0x53f5('0x26')](function(_0x2595dd){if(_0x2595dd[_0x53f5('0x27')]){var _0x5c5bbc=_['find'](_0x2595dd,function(_0x24f04a){return _0x24f04a[_0x53f5('0x28')]===_0x14c397;});if(_0x5c5bbc){logger[_0x53f5('0x1f')](_0x53f5('0x29'),_0x14c397);return BPromise[_0x53f5('0x2a')]({'id':_0x5c5bbc['Id'],'name':_0x5c5bbc[_0x53f5('0x2b')]});}}else{logger[_0x53f5('0x1f')](_0x53f5('0x2c'),_0x14c397);return _0x5ab224[_0x53f5('0x2d')]()[_0x53f5('0x26')](function(_0x332b06){return BPromise[_0x53f5('0x2a')]({'id':_0x332b06['user_id'],'name':_0x332b06[_0x53f5('0x2e')]});});}});}else{logger[_0x53f5('0x1f')](_0x53f5('0x2c'),_0x14c397);return _0x5ab224[_0x53f5('0x2d')]()[_0x53f5('0x26')](function(_0x4789bd){return BPromise[_0x53f5('0x2a')]({'id':_0x4789bd[_0x53f5('0x2f')],'name':_0x4789bd['display_name']});});}}function getEndUser(_0x162915,_0x12d332,_0xfbac49,_0x42cf17,_0x279508){var _0x34f248={'$or':{'Phone':_0x42cf17}};var _0x2649ad={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x53f5('0x2a')]()['then'](function(){logger[_0x53f5('0x1f')](_0x53f5('0x30'),_0x42cf17,_0x12d332[_0x53f5('0x31')]);switch(_0x12d332[_0x53f5('0x31')]){case _0x53f5('0x32'):var _0x51b582=_['cloneDeep'](_0x34f248);if(_0x12d332[_0x53f5('0x33')]){var _0xa3769d={};_0xa3769d[_0x12d332['additionalSearchContact']]=_0x42cf17;_['merge'](_0x51b582['$or'],_0xa3769d);}return _0x279508['sobject']('Contact')['find'](_0x51b582,_0x2649ad)[_0x53f5('0x25')]()[_0x53f5('0x26')](function(_0x3f3993){if(_0x3f3993&&_0x3f3993[_0x53f5('0x27')]){return _0x3f3993;}else{var _0x4a1220=_['cloneDeep'](_0x34f248);if(_0x12d332[_0x53f5('0x34')]){var _0x229906={};_0x229906[_0x12d332[_0x53f5('0x34')]]=_0x42cf17;_[_0x53f5('0x35')](_0x4a1220[_0x53f5('0x36')],_0x229906);}return _0x279508['sobject']('Lead')[_0x53f5('0x24')](_0x4a1220,_0x2649ad);}});case _0x53f5('0x37'):var _0x377eb7=_[_0x53f5('0x38')](_0x34f248);if(_0x12d332['additionalSearchAccount']){var _0xa3769d={};_0xa3769d[_0x12d332[_0x53f5('0x39')]]=_0x42cf17;_[_0x53f5('0x35')](_0x377eb7['$or'],_0xa3769d);}return _0x279508['sobject']('Account')[_0x53f5('0x24')](_0x377eb7,_0x2649ad)[_0x53f5('0x25')]()[_0x53f5('0x26')](function(_0x18b878){if(_0x18b878&&_0x18b878[_0x53f5('0x27')]){return _0x18b878;}else{var _0x4d4e0e=_[_0x53f5('0x38')](_0x34f248);if(_0x12d332[_0x53f5('0x33')]){var _0xb787b1={};_0xb787b1[_0x12d332[_0x53f5('0x33')]]=_0x42cf17;_[_0x53f5('0x35')](_0x4d4e0e[_0x53f5('0x36')],_0xb787b1);}return _0x279508[_0x53f5('0x3a')](_0x53f5('0x3b'))['find'](_0x4d4e0e,_0x2649ad)[_0x53f5('0x26')](function(_0x4f7f02){if(_0x4f7f02&&_0x4f7f02[_0x53f5('0x27')]){return _0x4f7f02;}else{var _0x412cb7=_['cloneDeep'](_0x34f248);if(_0x12d332[_0x53f5('0x34')]){var _0x5b0293={};_0x5b0293[_0x12d332[_0x53f5('0x34')]]=_0x42cf17;_[_0x53f5('0x35')](_0x412cb7['$or'],_0x5b0293);}return _0x279508[_0x53f5('0x3a')](_0x53f5('0x3c'))['find'](_0x412cb7,_0x2649ad);}});}});case _0x53f5('0x17'):var _0x51b582=_[_0x53f5('0x38')](_0x34f248);if(_0x12d332['additionalSearchContact']){var _0xa3769d={};_0xa3769d[_0x12d332[_0x53f5('0x33')]]=_0x42cf17;_['merge'](_0x51b582['$or'],_0xa3769d);}return _0x279508[_0x53f5('0x3a')](_0x53f5('0x3b'))['find'](_0x51b582,_0x2649ad)[_0x53f5('0x25')]();case _0x53f5('0x18'):var _0xab6624=_[_0x53f5('0x38')](_0x34f248);if(_0x12d332['additionalSearchLead']){var _0xa3769d={};_0xa3769d[_0x12d332[_0x53f5('0x34')]]=_0x42cf17;_[_0x53f5('0x35')](_0xab6624[_0x53f5('0x36')],_0xa3769d);}return _0x279508['sobject'](_0x53f5('0x3c'))[_0x53f5('0x24')](_0xab6624,_0x2649ad);case'account':var _0x377eb7=_['cloneDeep'](_0x34f248);if(_0x12d332['additionalSearchAccount']){var _0xa3769d={};_0xa3769d[_0x12d332[_0x53f5('0x39')]]=_0x42cf17;_['merge'](_0x377eb7[_0x53f5('0x36')],_0xa3769d);}return _0x279508[_0x53f5('0x3a')](_0x53f5('0x3d'))[_0x53f5('0x24')](_0x377eb7,_0x2649ad);default:return null;}})[_0x53f5('0x26')](function(_0x46067d){if(_0x46067d&&_0x46067d[_0x53f5('0x27')]){var _0x130fb3=_[_0x53f5('0x3e')](_0x46067d);if(_0x130fb3){return BPromise[_0x53f5('0x2a')]({'id':_0x130fb3['Id'],'name':_0x130fb3[_0x53f5('0x2b')],'phone':_0x130fb3[_0x53f5('0x3f')],'endUserType':_0x130fb3[_0x53f5('0x40')][_0x53f5('0x41')][_0x53f5('0x42')]()});}}})['then'](function(_0x110e73){if(_0x110e73){logger[_0x53f5('0x1f')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x110e73[_0x53f5('0x16')],_0x42cf17);return BPromise[_0x53f5('0x2a')](_0x110e73);}else{logger[_0x53f5('0x1f')](_0x53f5('0x43'),_0x42cf17);var _0x1abf32={'Phone':_0x42cf17};if(_0x12d332[_0x53f5('0x44')]){if(_0x12d332[_0x53f5('0x44')]==='contact'){logger[_0x53f5('0x1f')](_0x53f5('0x45'),_0x42cf17,_0x12d332[_0x53f5('0x44')]);_0x1abf32[_0x53f5('0x46')]=_0xfbac49!=='<unknown>'?_0xfbac49:util[_0x53f5('0x47')](_0x53f5('0x48'),_0x42cf17);}else if(_0x12d332['moduleCreate']==='lead'){logger[_0x53f5('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x42cf17,_0x12d332[_0x53f5('0x44')]);_0x1abf32['LastName']=_0xfbac49!=='<unknown>'?_0xfbac49:util['format'](_0x53f5('0x48'),_0x42cf17);_0x1abf32['Company']=_0x53f5('0x49');}else if(_0x12d332[_0x53f5('0x44')]===_0x53f5('0x1a')){logger[_0x53f5('0x1f')](_0x53f5('0x45'),_0x42cf17,_0x12d332[_0x53f5('0x44')]);_0x1abf32[_0x53f5('0x2b')]=_0xfbac49!==_0x53f5('0x4a')?_0xfbac49:util['format'](_0x53f5('0x48'),_0x42cf17);}else{return null;}}return _0x279508['sobject'](_[_0x53f5('0x4b')](_0x12d332['moduleCreate']))['create'](_0x1abf32)[_0x53f5('0x26')](function(_0xda6987){return BPromise['resolve']({'id':_0xda6987['id'],'endUserType':_0x12d332[_0x53f5('0x44')]});});}});}function getCustomFields(_0x5b178d,_0x24c142){var _0x10098b={};if(_0x5b178d[_0x53f5('0x27')]>0x0){_['forEach'](_0x5b178d,function(_0x21c8be){if(_[_0x53f5('0x4c')](['string','picklist'],_0x21c8be['type'])&&_0x21c8be['idField']){_0x10098b[_0x21c8be[_0x53f5('0x4d')]]=_0x21c8be[_0x53f5('0x4e')]['toString']();}else if(_0x21c8be['type']==='variable'&&_0x21c8be[_0x53f5('0x4f')]&&_0x21c8be['idField']){_0x24c142[_0x21c8be[_0x53f5('0x4f')]]&&(_0x10098b[_0x21c8be[_0x53f5('0x4d')]]=_0x24c142[_0x21c8be[_0x53f5('0x4f')]]['toString']());}else if(_0x21c8be[_0x53f5('0x41')]===_0x53f5('0x50')&&_0x21c8be[_0x53f5('0x51')]&&_0x21c8be[_0x53f5('0x51')][_0x53f5('0x52')]&&_0x21c8be[_0x53f5('0x4d')]){_0x24c142[_0x21c8be[_0x53f5('0x51')][_0x53f5('0x52')][_0x53f5('0x42')]()]&&(_0x10098b[_0x21c8be[_0x53f5('0x4d')]]=_0x24c142[_0x21c8be[_0x53f5('0x51')][_0x53f5('0x52')][_0x53f5('0x42')]()][_0x53f5('0x53')]());}});}return _0x10098b;}function getConnection(_0x3f867c){var _0x5691fe=_0x3f867c['password'][_0x53f5('0x54')](_0x3f867c[_0x53f5('0x55')]);var _0x1d835d=new jsforce[(_0x53f5('0x56'))]({'oauth2':{'loginUrl':_0x3f867c[_0x53f5('0x57')]||_0x53f5('0x58'),'clientId':_0x3f867c[_0x53f5('0x59')],'clientSecret':_0x3f867c[_0x53f5('0x5a')]}});return _0x1d835d['login'](_0x3f867c[_0x53f5('0x5b')],_0x5691fe)[_0x53f5('0x26')](function(){logger[_0x53f5('0x1f')](_0x53f5('0x5c'));return _0x1d835d;});}exports[_0x53f5('0x5d')]=function(_0x579bfa,_0x470d19,_0x4a2400,_0x32c83d,_0x3fa5e8,_0xd4418e){var _0x5e11c2,_0x3c2b88,_0x245da5,_0x20e087;_0xd4418e[_0x53f5('0x5e')]=intUtil[_0x53f5('0x5f')](_0xd4418e[_0x53f5('0x5e')]);_0xd4418e['remoteUri']=intUtil[_0x53f5('0x5f')](_0xd4418e[_0x53f5('0x57')]);if(_0x3fa5e8&&_0x3fa5e8['monitor_format']){logger['info']('[QUEUE]',_0x53f5('0x60'));_0x470d19[_0x53f5('0x61')]=util[_0x53f5('0x47')](_0x53f5('0x62'),_0xd4418e['serverUrl'],_0x470d19[_0x53f5('0x63')],md5(_0x470d19['uniqueid']));}else{_0x470d19['recordingURL']='';}return getConnection(_0xd4418e)[_0x53f5('0x26')](function(_0x2f456f){_0x20e087=_0x2f456f;return getUser(_0xd4418e,_0x32c83d[_0x53f5('0x64')],_0x20e087);})[_0x53f5('0x26')](function(_0x405b79){_0x5e11c2=_0x405b79;return getEndUser(_0xd4418e,_0x4a2400,_0x470d19[_0x53f5('0x65')],_0x470d19[_0x53f5('0x66')],_0x20e087);})[_0x53f5('0x26')](function(_0x314f49){_0x3c2b88=_0x314f49;return getTicket(_0xd4418e,_0x5e11c2,_0x3c2b88,_0x4a2400,_0x470d19,_0x4a2400[_0x53f5('0x67')],_0x20e087,_0x53f5('0x5d'));})[_0x53f5('0x26')](function(_0x4d98d6){_0x245da5=_0x4d98d6;logger[_0x53f5('0x1f')](_0x53f5('0x68'),_0x245da5['id']);logger[_0x53f5('0x1f')](_0x53f5('0x69'),_0x245da5['id'],_0x32c83d[_0x53f5('0x52')],_0xd4418e[_0x53f5('0x41')]);switch(_0xd4418e[_0x53f5('0x41')]){case'integrationTab':emit(util[_0x53f5('0x47')](_0x53f5('0x6a'),_0x32c83d['name']),'trigger:salesforce:display',{'recordId':_0x245da5['id']});break;case _0x53f5('0x6b'):emit(util[_0x53f5('0x47')](_0x53f5('0x6a'),_0x32c83d[_0x53f5('0x52')]),'trigger:browser:url',{'uri':util[_0x53f5('0x47')]('%s/%s/e',_0x20e087[_0x53f5('0x6c')],_0x245da5['id'])});break;default:logger[_0x53f5('0x6d')](_0x53f5('0x6e'));}})[_0x53f5('0x6f')](function(_0x326138){logger[_0x53f5('0x6d')](_0x53f5('0x70'),_0x326138);});};exports[_0x53f5('0x71')]=function(_0x49f8d2,_0x43913c,_0x2ab98d,_0x432dc9,_0x391ed1,_0x104c8d,_0xf1c945){var _0x209663,_0x11179c,_0x4befdd,_0x255dd2;_0x104c8d['serverUrl']=intUtil[_0x53f5('0x5f')](_0x104c8d[_0x53f5('0x5e')]);_0x104c8d[_0x53f5('0x57')]=intUtil['stripTrailingSlash'](_0x104c8d['remoteUri']);if(_0xf1c945&&_0xf1c945[_0x53f5('0x72')]&&_0xf1c945['recordingFormat']!==_0x53f5('0x73')){logger[_0x53f5('0x1f')](_0x53f5('0x74'),_0x53f5('0x60'));_0x43913c[_0x53f5('0x61')]=util['format'](_0x53f5('0x62'),_0x104c8d[_0x53f5('0x5e')],_0x43913c[_0x53f5('0x63')],md5(_0x43913c[_0x53f5('0x63')]));}return getConnection(_0x104c8d)[_0x53f5('0x26')](function(_0x1f01a3){_0x255dd2=_0x1f01a3;return getUser(_0x104c8d,_0x432dc9[_0x53f5('0x64')],_0x255dd2);})['then'](function(_0x17817c){_0x209663=_0x17817c;return getEndUser(_0x104c8d,_0x2ab98d,_0x43913c[_0x53f5('0x75')],_0x43913c[_0x53f5('0x76')],_0x255dd2);})[_0x53f5('0x26')](function(_0x426ac3){_0x11179c=_0x426ac3;return getTicket(_0x104c8d,_0x209663,_0x11179c,_0x2ab98d,_0x43913c,_0x2ab98d['Fields'],_0x255dd2,_0x53f5('0x71'));})[_0x53f5('0x26')](function(_0x28238f){_0x4befdd=_0x28238f;logger[_0x53f5('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x4befdd['id']);logger[_0x53f5('0x1f')](_0x53f5('0x77'),_0x4befdd['id'],_0x432dc9[_0x53f5('0x52')],_0x104c8d[_0x53f5('0x41')]);switch(_0x104c8d[_0x53f5('0x41')]){case _0x53f5('0x78'):emit(util[_0x53f5('0x47')](_0x53f5('0x6a'),_0x432dc9['name']),_0x53f5('0x79'),{'recordId':_0x4befdd['id']});break;case _0x53f5('0x6b'):emit(util[_0x53f5('0x47')]('user:%s',_0x432dc9[_0x53f5('0x52')]),_0x53f5('0x7a'),{'uri':util[_0x53f5('0x47')](_0x53f5('0x7b'),_0x255dd2[_0x53f5('0x6c')],_0x4befdd['id'])});break;default:logger[_0x53f5('0x6d')](_0x53f5('0x74'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x53f5('0x6f')](function(_0x4a9d9a){logger[_0x53f5('0x6d')](_0x53f5('0x74'),_0x4a9d9a);});};exports['unmanaged']=function(_0x3c6ecc,_0x4d6225,_0x2d8192,_0x315318,_0x45b39d,_0x5c157c){var _0x30cbb4,_0x49d813,_0x529a55,_0x8cdefa;_0x5c157c[_0x53f5('0x5e')]=intUtil[_0x53f5('0x5f')](_0x5c157c[_0x53f5('0x5e')]);_0x5c157c[_0x53f5('0x57')]=intUtil[_0x53f5('0x5f')](_0x5c157c[_0x53f5('0x57')]);if(_0x45b39d&&_0x45b39d[_0x53f5('0x7c')]){logger['info']('['+_0x4d6225['lastevent']['toUpperCase']()+']',_0x53f5('0x60'));_0x4d6225[_0x53f5('0x61')]=util[_0x53f5('0x47')](_0x53f5('0x62'),_0x5c157c[_0x53f5('0x5e')],_0x4d6225[_0x53f5('0x63')],md5(_0x4d6225['uniqueid']));}else{_0x4d6225[_0x53f5('0x61')]='';}return getConnection(_0x5c157c)[_0x53f5('0x26')](function(_0x5bc9d9){_0x8cdefa=_0x5bc9d9;if(!_[_0x53f5('0x22')](_0x315318)){return getUser(_0x5c157c,_0x315318[_0x53f5('0x52')],_0x8cdefa);}else{return getUser(_0x5c157c,null,_0x8cdefa);}})['then'](function(_0x43629a){_0x30cbb4=_0x43629a;return getEndUser(_0x5c157c,_0x2d8192,_0x4d6225[_0x53f5('0x65')],_0x4d6225[_0x53f5('0x66')],_0x8cdefa);})['then'](function(_0x2497cf){_0x49d813=_0x2497cf;return getTicket(_0x5c157c,_0x30cbb4,_0x49d813,_0x2d8192,_0x4d6225,_0x2d8192[_0x53f5('0x67')],_0x8cdefa);})['then'](function(_0x35273f){_0x529a55=_0x35273f;logger[_0x53f5('0x1f')]('['+_0x4d6225[_0x53f5('0x7d')]['toUpperCase']()+_0x53f5('0x7e'),_0x529a55['id']);logger[_0x53f5('0x1f')]('['+_0x4d6225[_0x53f5('0x7d')][_0x53f5('0x7f')]()+_0x53f5('0x80'),_0x5c157c[_0x53f5('0x41')]);})[_0x53f5('0x6f')](function(_0x1a5b56){logger['error']('['+_0x4d6225[_0x53f5('0x7d')]['toUpperCase']()+']',_0x1a5b56);});};
\ No newline at end of file
index 8f5072e..425efa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9417=[']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','length','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminId','],\x20createEndUser\x20input\x20crm','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','idField','variable','variableName','customVariable','Variable','name','POST','assign','getString','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','ticketNumber','push','all','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','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x5580a6,_0x4b61bd){var _0xa0de3a=function(_0x54912f){while(--_0x54912f){_0x5580a6['push'](_0x5580a6['shift']());}};_0xa0de3a(++_0x4b61bd);}(_0x9417,0x139));var _0x7941=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0x9417[_0x1e081a];return _0x428209;};'use strict';var _=require(_0x7941('0x0'));var Promise=require(_0x7941('0x1'));var rp=require(_0x7941('0x2'));var util=require(_0x7941('0x3'));var md5=require('md5');var Redis=require(_0x7941('0x4'));var intUtil=require('./util');var config=require(_0x7941('0x5'));var logger=require(_0x7941('0x6'))('servicenow');config[_0x7941('0x7')]=_[_0x7941('0x8')](config[_0x7941('0x7')],{'host':_0x7941('0x9'),'port':0x18eb});var io=require(_0x7941('0xa'))(new Redis(config[_0x7941('0x7')]));function getAdminUser(_0x878afb,_0x276aed,_0x49483b,_0x3c6d40,_0x5de0e4,_0x3c065c){return new Promise(function(_0x126805,_0x1a9ce0){var _0x1d03ee={'method':_0x7941('0xb'),'uri':_0x3c6d40+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5de0e4+'&'+_0x3c065c,'auth':_0x276aed,'json':!![]};return rp(_0x1d03ee)['then'](function(_0x5db922){if(_0x5db922['result']['length']>0x0){_0x49483b['adminId']=_0x5db922[_0x7941('0xc')][0x0][_0x7941('0xd')];}logger[_0x7941('0xe')]('['+[_0x878afb[_0x7941('0xf')]()]+_0x7941('0x10'),_0x49483b);_0x126805(_0x49483b);})[_0x7941('0x11')](function(_0x968f3a){logger[_0x7941('0x12')]('['+[_0x878afb[_0x7941('0xf')]()]+']',_0x968f3a[_0x7941('0x13')]);_0x1a9ce0(_0x968f3a[_0x7941('0x13')]);});});}function getUser(_0x39619a,_0x3d967c,_0xb327ba,_0x4457aa,_0x20c7de){return function(_0x490fff){logger[_0x7941('0xe')]('['+[_0x39619a[_0x7941('0xf')]()]+_0x7941('0x14'),_0x490fff);return new Promise(function(_0xb00f38,_0x3a88d9){if(intUtil[_0x7941('0x15')](_0x490fff[_0x7941('0x16')])){var _0x3512b6={'method':_0x7941('0xb'),'uri':_0xb327ba+_0x7941('0x17')+_0x490fff[_0x7941('0x16')]+'&'+_0x4457aa+'&'+_0x20c7de,'auth':_0x3d967c,'json':!![]};logger['info']('['+[_0x39619a[_0x7941('0xf')]()]+_0x7941('0x18'),_0x3512b6);return rp(_0x3512b6)[_0x7941('0x19')](function(_0x34787c){logger[_0x7941('0xe')]('['+[_0x39619a['toUpperCase']()]+'],\x20getUser\x20entity',_0x34787c);if(_0x34787c[_0x7941('0xc')][_0x7941('0x1a')]>0x0&&String(_0x34787c[_0x7941('0xc')][0x0][_0x7941('0x1b')])===_0x7941('0x1c')){_0x490fff[_0x7941('0x1d')]=_0x34787c[_0x7941('0xc')][0x0][_0x7941('0xd')];}else{_0x490fff['userId']=_0x490fff['adminId'];_0x490fff[_0x7941('0x16')]=_0x490fff[_0x7941('0x1e')];}logger[_0x7941('0xe')]('['+[_0x39619a[_0x7941('0xf')]()]+_0x7941('0x1f'),_0x490fff);_0xb00f38(_0x490fff);})[_0x7941('0x11')](function(_0x441691){logger[_0x7941('0x12')]('['+[_0x39619a[_0x7941('0xf')]()]+']',_0x441691[_0x7941('0x13')]);_0x3a88d9(_0x441691[_0x7941('0x13')]);});}else{logger[_0x7941('0xe')]('['+[_0x39619a[_0x7941('0xf')]()]+_0x7941('0x20'));_0x490fff['userId']=_0x490fff[_0x7941('0x21')];_0x490fff[_0x7941('0x16')]=_0x490fff[_0x7941('0x1e')];_0xb00f38(_0x490fff);}});};}function createEndUser(_0x4903bb,_0x2c1b4d,_0x13462a,_0x280f18,_0x3c56c6){logger[_0x7941('0xe')]('['+[_0x4903bb['toUpperCase']()]+_0x7941('0x22'),_0x13462a);return new Promise(function(_0x4b4420,_0x8f285){var _0x5eccbb={'method':'POST','uri':_0x280f18+'sys_user?'+_0x3c56c6,'body':{'user_name':_0x13462a[_0x7941('0x23')],'roles':'user','first_name':_0x13462a['endUserNumber'],'active':_0x7941('0x1c'),'date_format':_0x7941('0x24'),'phone':_0x13462a['endUserNumber']},'auth':_0x2c1b4d,'json':!![]};return rp(_0x5eccbb)[_0x7941('0x19')](function(_0x2900d9){logger['info']('['+[_0x4903bb[_0x7941('0xf')]()]+_0x7941('0x25'),_0x2900d9[_0x7941('0xc')]);_0x13462a['endUserId']=_0x2900d9[_0x7941('0xc')][_0x7941('0xd')];_0x4b4420(_0x13462a);})['catch'](function(_0x834565){logger['error']('['+[_0x4903bb[_0x7941('0xf')]()]+']',_0x834565['message']);_0x8f285(_0x834565['message']);});});}function getEndUser(_0x5534cd,_0x2c5935,_0x4afd34,_0x4ff8e5,_0x5c726a){return function(_0xf8c7b6){logger[_0x7941('0xe')]('['+[_0x5534cd['toUpperCase']()]+_0x7941('0x26'),_0xf8c7b6);return new Promise(function(_0x44a446,_0x5257ae){var _0x4fe836={'method':'GET','uri':_0x4afd34+_0x7941('0x27')+_0xf8c7b6['endUserNumber']+'&'+_0x4ff8e5+'&'+_0x5c726a,'auth':_0x2c5935,'json':!![]};return rp(_0x4fe836)[_0x7941('0x19')](function(_0x5dec77){if(_0x5dec77['result'][_0x7941('0x1a')]>0x0){_0xf8c7b6[_0x7941('0x28')]=_0x5dec77[_0x7941('0xc')][0x0][_0x7941('0xd')];logger['info']('['+[_0x5534cd['toUpperCase']()]+_0x7941('0x29'),_0xf8c7b6);_0x44a446(_0xf8c7b6);}else{return createEndUser(_0x5534cd,_0x2c5935,_0xf8c7b6,_0x4afd34,_0x4ff8e5)[_0x7941('0x19')](function(_0x3102ff){logger[_0x7941('0xe')]('['+[_0x5534cd[_0x7941('0xf')]()]+_0x7941('0x2a'),_0x3102ff);_0x44a446(_0x3102ff);});}})[_0x7941('0x11')](function(_0x55acf4){logger[_0x7941('0x12')]('['+[_0x5534cd['toUpperCase']()]+']',_0x55acf4['message']);_0x5257ae(_0x55acf4[_0x7941('0x13')]);});});};}function getCustomFields(_0x273bf7,_0x56f1aa){var _0x279166={};if(_0x273bf7[_0x7941('0x1a')]>0x0){_[_0x7941('0x2b')](_0x273bf7,function(_0x2bfc9f){if(_['includes']([_0x7941('0x2c'),_0x7941('0x2d')],_0x2bfc9f[_0x7941('0x2e')])&&_0x2bfc9f[_0x7941('0x2f')]&&!_0x2bfc9f[_0x7941('0x30')]){_0x279166[_0x2bfc9f[_0x7941('0x2f')][_0x7941('0x31')]()]=_0x2bfc9f[_0x7941('0x32')][_0x7941('0x33')]();}else if(_[_0x7941('0x34')](['string',_0x7941('0x2d')],_0x2bfc9f[_0x7941('0x2e')])&&_0x2bfc9f['idField']&&_0x2bfc9f[_0x7941('0x30')]){_0x279166[_0x2bfc9f[_0x7941('0x35')][_0x7941('0x31')]()]=_0x2bfc9f[_0x7941('0x32')][_0x7941('0x33')]();}else if(_0x2bfc9f[_0x7941('0x2e')]===_0x7941('0x36')&&_0x2bfc9f[_0x7941('0x37')]&&_0x2bfc9f[_0x7941('0x35')]&&_0x2bfc9f[_0x7941('0x30')]){_0x279166[_0x2bfc9f['idField'][_0x7941('0x31')]()]=_0x56f1aa[_0x2bfc9f[_0x7941('0x37')]]['toString']();}else if(_0x2bfc9f[_0x7941('0x2e')]===_0x7941('0x38')&&_0x2bfc9f[_0x7941('0x39')]&&_0x2bfc9f[_0x7941('0x39')]['name']&&_0x2bfc9f[_0x7941('0x35')]&&_0x2bfc9f[_0x7941('0x30')]){_0x279166[_0x2bfc9f['idField'][_0x7941('0x31')]()]=_0x56f1aa[_0x2bfc9f['Variable'][_0x7941('0x3a')][_0x7941('0x31')]()][_0x7941('0x33')]();}});}return _0x279166;}function getTicket(_0x4a15b0,_0x1de6be,_0x4aacae,_0x298bf8,_0x4998b3,_0x5a3f18){return function(_0x1762ee){logger['info']('['+[_0x4a15b0['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x1762ee);return new Promise(function(_0x487e27,_0x56561f){var _0xf52038=_0x4a15b0[_0x7941('0x31')]()==='outbound'?_0x1762ee[_0x7941('0x1d')]:_0x1762ee[_0x7941('0x28')];var _0x189681={'method':_0x7941('0x3b'),'uri':_0x4aacae+'incident'+'?'+_0x5a3f18,'body':Object[_0x7941('0x3c')]({},{'active':_0x7941('0x1c'),'caller_id':_0xf52038,'assigned_to':_0x1762ee[_0x7941('0x1d')],'short_description':intUtil[_0x7941('0x3d')](_0x298bf8['Subjects'],_0x4998b3,'\x20'),'description':intUtil[_0x7941('0x3d')](_0x298bf8['Descriptions'],_0x4998b3,'\x0a')},getCustomFields(_0x298bf8['Fields'],_0x4998b3)),'auth':_0x1de6be,'json':!![]};return rp(_0x189681)[_0x7941('0x19')](function(_0x1f6234){logger[_0x7941('0xe')]('['+[_0x4a15b0['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x1f6234[_0x7941('0xc')]);_0x1762ee[_0x7941('0x3e')]=_0x1f6234[_0x7941('0xc')]['sys_id'];_0x1762ee['ticketNumber']=_0x1f6234[_0x7941('0xc')][_0x7941('0x3f')];logger['info']('['+[_0x4a15b0[_0x7941('0xf')]()]+_0x7941('0x40'),_0x1762ee);_0x487e27(_0x1762ee);})[_0x7941('0x11')](function(_0x2058f4){logger[_0x7941('0x12')]('['+[_0x4a15b0[_0x7941('0xf')]()]+']',_0x2058f4[_0x7941('0x13')]);_0x56561f(_0x2058f4[_0x7941('0x13')]);});});};}function createRemoteTag(_0x47b2e2,_0x37b258,_0x586466,_0x441724){return new Promise(function(_0x349ba6,_0x49a49c){var _0x1da9bc={'method':_0x7941('0x3b'),'uri':_0x586466+_0x7941('0x41')+'?'+_0x441724,'body':{'short_description':_0x47b2e2,'global':!![],'active':!![],'name':_0x47b2e2},'auth':_0x37b258,'json':!![]};return rp(_0x1da9bc)[_0x7941('0x19')](function(_0x2abc42){var _0x5d5fc6=_0x2abc42[_0x7941('0xc')][_0x7941('0xd')];_0x349ba6(_0x5d5fc6);});});}function getRemoteTag(_0x26d48d,_0x5d60ea,_0x52d8c8,_0x3f83a3,_0x142e29){return new Promise(function(_0xf45983,_0x49534e){var _0x52999f={'method':_0x7941('0xb'),'uri':_0x52d8c8+_0x7941('0x41')+_0x7941('0x42')+_0x26d48d+'&'+_0x3f83a3,'auth':_0x5d60ea,'json':!![]};return rp(_0x52999f)[_0x7941('0x19')](function(_0xc04966){if(_0xc04966[_0x7941('0xc')][_0x7941('0x1a')]>0x0){var _0x4f202e=_0xc04966[_0x7941('0xc')][0x0]['sys_id'];_0xf45983(_0x4f202e);}else{return createRemoteTag(_0x26d48d,_0x5d60ea,_0x52d8c8,_0x3f83a3)[_0x7941('0x19')](function(_0x48a2cc){_0xf45983(_0x48a2cc);});}});});}function assignTagToIncident(_0xeeaba8,_0x47a27f,_0x2def3f,_0x1a64da,_0x46f192){return new Promise(function(_0x46f9c3,_0x3eed0c){var _0x412f7a={'method':_0x7941('0x3b'),'uri':_0x2def3f+_0x7941('0x43')+'?'+_0x46f192,'body':{'label':_0xeeaba8,'table':_0x7941('0x44'),'id_type':_0x7941('0x45'),'table_key':_0x1a64da[_0x7941('0x3e')],'title':_0x7941('0x46')+_0x1a64da[_0x7941('0x47')],'id_display':_0x1a64da[_0x7941('0x47')]},'auth':_0x47a27f,'json':!![]};return rp(_0x412f7a)[_0x7941('0x19')](function(_0x3a1c19){_0x46f9c3();})[_0x7941('0x11')](function(){_0x46f9c3();});});}function manageTags(_0x4047ce,_0x425ef0,_0x13ee22,_0x5f346b,_0x394249,_0x4492fc,_0x4fa8c7){return new Promise(function(_0x2d4021,_0x4e0f5f){var _0x1556ed=[];_0x425ef0[_0x7941('0x2b')](function(_0x4d3183){_0x1556ed[_0x7941('0x48')](getRemoteTag(_0x4d3183,_0x13ee22,_0x5f346b,_0x4492fc,_0x4fa8c7));});return Promise['all'](_0x1556ed)[_0x7941('0x19')](function(_0x7fd88f){if(_0x7fd88f[_0x7941('0x1a')]){logger[_0x7941('0xe')]('['+[_0x4047ce[_0x7941('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x7fd88f);var _0x50d88f=[];_0x7fd88f['forEach'](function(_0x29a506){_0x50d88f[_0x7941('0x48')](assignTagToIncident(_0x29a506,_0x13ee22,_0x5f346b,_0x394249,_0x4492fc));});return Promise[_0x7941('0x49')](_0x50d88f)[_0x7941('0x19')](function(){_0x2d4021();})[_0x7941('0x11')](function(){_0x2d4021();});}else{_0x2d4021();}});});}function getTags(_0x17baa2,_0x59a3a1,_0x1c18c9,_0x3e365e,_0x31c400,_0x1f6ff4){return function(_0x3b618e){return new Promise(function(_0x7fba98,_0x528bc2){var _0x2e643c=[];var _0x80cb3d=_0x3e365e[_0x7941('0x4a')];if(_0x80cb3d&&_0x80cb3d['length']>0x0){_0x2e643c=_['map'](_0x80cb3d,'name');}if(_0x2e643c['length']>0x0){return manageTags(_0x17baa2,_0x2e643c,_0x59a3a1,_0x1c18c9,_0x3b618e,_0x31c400,_0x1f6ff4)[_0x7941('0x19')](function(){_0x7fba98(_0x3b618e);});}else{_0x7fba98(_0x3b618e);}});};}function emit(_0x11cd4e,_0x3379cb,_0x2a2830){var _0xd3a811='%26sysparm_record_target%3Dincident'+_0x7941('0x4b')+_0x7941('0x4c')+'%255EORDERBYDESCnumber';var _0xb61845={'uri':_0x11cd4e+_0x7941('0x4d')+_0x2a2830+_0xd3a811};io['to'](util[_0x7941('0x4e')]('user:%s',_0x3379cb))[_0x7941('0x4f')]('trigger:browser:url',_0xb61845);}exports['cs']=function(_0x5f5852,_0x1d196c,_0x4d471b,_0x591de6,_0x1f69a0,_0x35f525,_0x4419d2,_0x46b779){var _0x4176f5={};var _0x224467={'user':_0x35f525['username'],'pass':_0x35f525[_0x7941('0x50')]};var _0xe5f0fb=_0x7941('0x51');var _0x45adcb='sysparm_display_value=true';_0x35f525[_0x7941('0x52')]=intUtil['stripTrailingSlash'](_0x35f525[_0x7941('0x52')]);_0x35f525['serverUrl']=intUtil[_0x7941('0x53')](_0x35f525[_0x7941('0x54')]);var _0x8d3c4f=util[_0x7941('0x4e')](_0x7941('0x55'),_0x35f525['remoteUri']);_0x4176f5['userEmail']=!_[_0x7941('0x56')](_0x591de6)?_0x591de6['email']:null;_0x4176f5[_0x7941('0x1e')]=_0x35f525[_0x7941('0x57')];_0x4176f5[_0x7941('0x23')]=_0x46b779[_0x7941('0x31')]()===_0x7941('0x58')?_0x1d196c[_0x7941('0x59')]:_0x1d196c[_0x7941('0x5a')];_0x4176f5['callDirection']=_0x46b779===_0x7941('0x5b')||_0x46b779===_0x7941('0x5c')?'queue':'outbound';var _0x5e3b3f=util[_0x7941('0x4e')](_0x7941('0x5d'),_0x35f525['serverUrl'],_0x1d196c['uniqueid'],md5(_0x1d196c['uniqueid']));if(_0x1f69a0&&_0x1f69a0[_0x7941('0x5e')]){logger[_0x7941('0xe')](_0x7941('0x5f'),_0x7941('0x60'));_0x1d196c[_0x7941('0x61')]=_0x5e3b3f;}else if(_0x4419d2&&_0x4419d2['recordingFormat']&&_0x4419d2[_0x7941('0x62')]!==_0x7941('0x63')){logger[_0x7941('0xe')](_0x7941('0x64'),_0x7941('0x60'));_0x1d196c[_0x7941('0x61')]=_0x5e3b3f;}else{_0x1d196c[_0x7941('0x61')]='';}return getAdminUser(_0x46b779,_0x224467,_0x4176f5,_0x8d3c4f,_0x45adcb,_0xe5f0fb)['then'](getUser(_0x46b779,_0x224467,_0x8d3c4f,_0x45adcb,_0xe5f0fb))[_0x7941('0x19')](getEndUser(_0x46b779,_0x224467,_0x8d3c4f,_0x45adcb,_0xe5f0fb))[_0x7941('0x19')](getTicket(_0x46b779,_0x224467,_0x8d3c4f,_0x4d471b,_0x1d196c,_0x45adcb))[_0x7941('0x19')](function(_0x3074d1){logger['info'](util[_0x7941('0x4e')](_0x7941('0x65'),_0x3074d1[_0x7941('0x3e')]));logger[_0x7941('0xe')](util[_0x7941('0x4e')]('call\x20direction:\x20%s',_0x46b779));if(_0x46b779!==_0x7941('0x5c')){logger[_0x7941('0xe')]('['+[_0x46b779[_0x7941('0xf')]()]+']',_0x7941('0x66'));emit(_0x35f525['remoteUri'],_0x591de6['name'],_0x3074d1[_0x7941('0x3e')]);}})[_0x7941('0x11')](function(_0x57ab65){logger[_0x7941('0x12')]('['+[_0x46b779[_0x7941('0xf')]()]+_0x7941('0x67'),util['inspect'](_0x57ab65,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xcc6c=['],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','forEach','picklist','type','nameField','customField','content','toString','string','idField','toLowerCase','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','GET','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','name','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId'];(function(_0x1f3d3a,_0x11f8f1){var _0x1eac73=function(_0x17af56){while(--_0x17af56){_0x1f3d3a['push'](_0x1f3d3a['shift']());}};_0x1eac73(++_0x11f8f1);}(_0xcc6c,0x188));var _0xccc6=function(_0x47d14c,_0x171a3e){_0x47d14c=_0x47d14c-0x0;var _0x46193d=_0xcc6c[_0x47d14c];return _0x46193d;};'use strict';var _=require(_0xccc6('0x0'));var Promise=require(_0xccc6('0x1'));var rp=require(_0xccc6('0x2'));var util=require('util');var md5=require(_0xccc6('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xccc6('0x4'));var logger=require(_0xccc6('0x5'))(_0xccc6('0x6'));config[_0xccc6('0x7')]=_[_0xccc6('0x8')](config[_0xccc6('0x7')],{'host':_0xccc6('0x9'),'port':0x18eb});var io=require(_0xccc6('0xa'))(new Redis(config[_0xccc6('0x7')]));function getAdminUser(_0x1755ad,_0x52df20,_0x309c22,_0x581e92,_0x547f13,_0x1d20ab){return new Promise(function(_0x306c31,_0x2dd80e){var _0x1bc4dd={'method':'GET','uri':_0x581e92+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x547f13+'&'+_0x1d20ab,'auth':_0x52df20,'json':!![]};return rp(_0x1bc4dd)[_0xccc6('0xb')](function(_0x57abe3){if(_0x57abe3['result'][_0xccc6('0xc')]>0x0){_0x309c22[_0xccc6('0xd')]=_0x57abe3[_0xccc6('0xe')][0x0][_0xccc6('0xf')];}logger[_0xccc6('0x10')]('['+[_0x1755ad[_0xccc6('0x11')]()]+_0xccc6('0x12'),_0x309c22);_0x306c31(_0x309c22);})['catch'](function(_0xe6be2e){logger[_0xccc6('0x13')]('['+[_0x1755ad[_0xccc6('0x11')]()]+']',_0xe6be2e[_0xccc6('0x14')]);_0x2dd80e(_0xe6be2e[_0xccc6('0x14')]);});});}function getUser(_0x174d7d,_0x2a430f,_0x29a785,_0x55032f,_0x488014){return function(_0xed5170){logger['info']('['+[_0x174d7d[_0xccc6('0x11')]()]+_0xccc6('0x15'),_0xed5170);return new Promise(function(_0x3278de,_0x52e3f9){if(intUtil[_0xccc6('0x16')](_0xed5170[_0xccc6('0x17')])){var _0x2edee8={'method':'GET','uri':_0x29a785+'sys_user?sysparm_query=email%3D'+_0xed5170[_0xccc6('0x17')]+'&'+_0x55032f+'&'+_0x488014,'auth':_0x2a430f,'json':!![]};logger[_0xccc6('0x10')]('['+[_0x174d7d[_0xccc6('0x11')]()]+_0xccc6('0x18'),_0x2edee8);return rp(_0x2edee8)[_0xccc6('0xb')](function(_0x5b8b05){logger['info']('['+[_0x174d7d[_0xccc6('0x11')]()]+_0xccc6('0x19'),_0x5b8b05);if(_0x5b8b05[_0xccc6('0xe')][_0xccc6('0xc')]>0x0&&String(_0x5b8b05[_0xccc6('0xe')][0x0][_0xccc6('0x1a')])===_0xccc6('0x1b')){_0xed5170[_0xccc6('0x1c')]=_0x5b8b05[_0xccc6('0xe')][0x0][_0xccc6('0xf')];}else{_0xed5170[_0xccc6('0x1c')]=_0xed5170[_0xccc6('0xd')];_0xed5170[_0xccc6('0x17')]=_0xed5170[_0xccc6('0x1d')];}logger[_0xccc6('0x10')]('['+[_0x174d7d[_0xccc6('0x11')]()]+_0xccc6('0x1e'),_0xed5170);_0x3278de(_0xed5170);})[_0xccc6('0x1f')](function(_0x10c0d5){logger[_0xccc6('0x13')]('['+[_0x174d7d['toUpperCase']()]+']',_0x10c0d5['message']);_0x52e3f9(_0x10c0d5[_0xccc6('0x14')]);});}else{logger[_0xccc6('0x10')]('['+[_0x174d7d[_0xccc6('0x11')]()]+_0xccc6('0x20'));_0xed5170[_0xccc6('0x1c')]=_0xed5170[_0xccc6('0xd')];_0xed5170[_0xccc6('0x17')]=_0xed5170[_0xccc6('0x1d')];_0x3278de(_0xed5170);}});};}function createEndUser(_0x593b43,_0x184315,_0x572a4,_0x5946fe,_0xf89dcf){logger[_0xccc6('0x10')]('['+[_0x593b43[_0xccc6('0x11')]()]+_0xccc6('0x21'),_0x572a4);return new Promise(function(_0x457eff,_0x480ab5){var _0x4512bc={'method':'POST','uri':_0x5946fe+_0xccc6('0x22')+_0xf89dcf,'body':{'user_name':_0x572a4['endUserNumber'],'roles':_0xccc6('0x23'),'first_name':_0x572a4[_0xccc6('0x24')],'active':'true','date_format':_0xccc6('0x25'),'phone':_0x572a4['endUserNumber']},'auth':_0x184315,'json':!![]};return rp(_0x4512bc)[_0xccc6('0xb')](function(_0x24e283){logger[_0xccc6('0x10')]('['+[_0x593b43[_0xccc6('0x11')]()]+_0xccc6('0x26'),_0x24e283[_0xccc6('0xe')]);_0x572a4[_0xccc6('0x27')]=_0x24e283[_0xccc6('0xe')][_0xccc6('0xf')];_0x457eff(_0x572a4);})[_0xccc6('0x1f')](function(_0x11e35a){logger['error']('['+[_0x593b43[_0xccc6('0x11')]()]+']',_0x11e35a['message']);_0x480ab5(_0x11e35a[_0xccc6('0x14')]);});});}function getEndUser(_0x51c4ac,_0x14e543,_0x14d334,_0x4c3891,_0x490deb){return function(_0x34ebad){logger[_0xccc6('0x10')]('['+[_0x51c4ac[_0xccc6('0x11')]()]+_0xccc6('0x28'),_0x34ebad);return new Promise(function(_0x70d1c9,_0x4de5d4){var _0x53d889={'method':'GET','uri':_0x14d334+'sys_user?sysparm_query=phone%3D'+_0x34ebad[_0xccc6('0x24')]+'&'+_0x4c3891+'&'+_0x490deb,'auth':_0x14e543,'json':!![]};return rp(_0x53d889)['then'](function(_0x57bc11){if(_0x57bc11[_0xccc6('0xe')]['length']>0x0){_0x34ebad[_0xccc6('0x27')]=_0x57bc11['result'][0x0][_0xccc6('0xf')];logger[_0xccc6('0x10')]('['+[_0x51c4ac[_0xccc6('0x11')]()]+_0xccc6('0x29'),_0x34ebad);_0x70d1c9(_0x34ebad);}else{return createEndUser(_0x51c4ac,_0x14e543,_0x34ebad,_0x14d334,_0x4c3891)[_0xccc6('0xb')](function(_0xf2547d){logger[_0xccc6('0x10')]('['+[_0x51c4ac['toUpperCase']()]+'],\x20createEndUser\x20crm',_0xf2547d);_0x70d1c9(_0xf2547d);});}})[_0xccc6('0x1f')](function(_0x365d43){logger['error']('['+[_0x51c4ac[_0xccc6('0x11')]()]+']',_0x365d43[_0xccc6('0x14')]);_0x4de5d4(_0x365d43[_0xccc6('0x14')]);});});};}function getCustomFields(_0x42f18f,_0x36962e){var _0x2cc9d9={};if(_0x42f18f[_0xccc6('0xc')]>0x0){_[_0xccc6('0x2a')](_0x42f18f,function(_0x1d020f){if(_['includes'](['string',_0xccc6('0x2b')],_0x1d020f[_0xccc6('0x2c')])&&_0x1d020f[_0xccc6('0x2d')]&&!_0x1d020f[_0xccc6('0x2e')]){_0x2cc9d9[_0x1d020f[_0xccc6('0x2d')]['toLowerCase']()]=_0x1d020f[_0xccc6('0x2f')][_0xccc6('0x30')]();}else if(_['includes']([_0xccc6('0x31'),_0xccc6('0x2b')],_0x1d020f[_0xccc6('0x2c')])&&_0x1d020f[_0xccc6('0x32')]&&_0x1d020f[_0xccc6('0x2e')]){_0x2cc9d9[_0x1d020f[_0xccc6('0x32')][_0xccc6('0x33')]()]=_0x1d020f[_0xccc6('0x2f')][_0xccc6('0x30')]();}else if(_0x1d020f['type']==='variable'&&_0x1d020f[_0xccc6('0x34')]&&_0x1d020f[_0xccc6('0x32')]&&_0x1d020f['customField']){_0x2cc9d9[_0x1d020f[_0xccc6('0x32')][_0xccc6('0x33')]()]=_0x36962e[_0x1d020f[_0xccc6('0x34')]][_0xccc6('0x30')]();}else if(_0x1d020f[_0xccc6('0x2c')]===_0xccc6('0x35')&&_0x1d020f[_0xccc6('0x36')]&&_0x1d020f['Variable']['name']&&_0x1d020f[_0xccc6('0x32')]&&_0x1d020f[_0xccc6('0x2e')]){_0x2cc9d9[_0x1d020f['idField']['toLowerCase']()]=_0x36962e[_0x1d020f[_0xccc6('0x36')]['name'][_0xccc6('0x33')]()][_0xccc6('0x30')]();}});}return _0x2cc9d9;}function getTicket(_0x2377d9,_0x69416e,_0x3b56c6,_0x1506f5,_0x4ccb37,_0x3a8fa9){return function(_0x45e3a7){logger[_0xccc6('0x10')]('['+[_0x2377d9[_0xccc6('0x11')]()]+_0xccc6('0x37'),_0x45e3a7);return new Promise(function(_0x119ea6,_0xc260a3){var _0x4db208=_0x2377d9['toLowerCase']()===_0xccc6('0x38')?_0x45e3a7[_0xccc6('0x1c')]:_0x45e3a7['endUserId'];var _0x19a061={'method':_0xccc6('0x39'),'uri':_0x3b56c6+_0xccc6('0x3a')+'?'+_0x3a8fa9,'body':Object[_0xccc6('0x3b')]({},{'active':_0xccc6('0x1b'),'caller_id':_0x4db208,'assigned_to':_0x45e3a7[_0xccc6('0x1c')],'short_description':intUtil[_0xccc6('0x3c')](_0x1506f5[_0xccc6('0x3d')],_0x4ccb37,'\x20'),'description':intUtil[_0xccc6('0x3c')](_0x1506f5[_0xccc6('0x3e')],_0x4ccb37,'\x0a')},getCustomFields(_0x1506f5['Fields'],_0x4ccb37)),'auth':_0x69416e,'json':!![]};return rp(_0x19a061)[_0xccc6('0xb')](function(_0x5117e6){logger[_0xccc6('0x10')]('['+[_0x2377d9['toUpperCase']()]+_0xccc6('0x3f'),_0x5117e6['result']);_0x45e3a7['ticketId']=_0x5117e6[_0xccc6('0xe')][_0xccc6('0xf')];_0x45e3a7[_0xccc6('0x40')]=_0x5117e6[_0xccc6('0xe')][_0xccc6('0x41')];logger[_0xccc6('0x10')]('['+[_0x2377d9[_0xccc6('0x11')]()]+_0xccc6('0x42'),_0x45e3a7);_0x119ea6(_0x45e3a7);})['catch'](function(_0x515de6){logger['error']('['+[_0x2377d9[_0xccc6('0x11')]()]+']',_0x515de6[_0xccc6('0x14')]);_0xc260a3(_0x515de6[_0xccc6('0x14')]);});});};}function createRemoteTag(_0x3a08de,_0x3bb6f3,_0x14d5ae,_0x250243){return new Promise(function(_0x2205e0,_0x222e8d){var _0x580b46={'method':_0xccc6('0x39'),'uri':_0x14d5ae+'label'+'?'+_0x250243,'body':{'short_description':_0x3a08de,'global':!![],'active':!![],'name':_0x3a08de},'auth':_0x3bb6f3,'json':!![]};return rp(_0x580b46)[_0xccc6('0xb')](function(_0x54198c){var _0x455cdf=_0x54198c[_0xccc6('0xe')]['sys_id'];_0x2205e0(_0x455cdf);});});}function getRemoteTag(_0x3d303d,_0x5c21de,_0x119497,_0xe1c321,_0x596b66){return new Promise(function(_0x2ac39c,_0x18efa3){var _0x581846={'method':_0xccc6('0x43'),'uri':_0x119497+_0xccc6('0x44')+_0xccc6('0x45')+_0x3d303d+'&'+_0xe1c321,'auth':_0x5c21de,'json':!![]};return rp(_0x581846)['then'](function(_0x37f73d){if(_0x37f73d['result'][_0xccc6('0xc')]>0x0){var _0x93383e=_0x37f73d[_0xccc6('0xe')][0x0][_0xccc6('0xf')];_0x2ac39c(_0x93383e);}else{return createRemoteTag(_0x3d303d,_0x5c21de,_0x119497,_0xe1c321)[_0xccc6('0xb')](function(_0x3c7976){_0x2ac39c(_0x3c7976);});}});});}function assignTagToIncident(_0x163ff1,_0x30540a,_0x540e83,_0x3c3949,_0x74983c){return new Promise(function(_0x55c570,_0x5e4658){var _0x3af22f={'method':_0xccc6('0x39'),'uri':_0x540e83+_0xccc6('0x46')+'?'+_0x74983c,'body':{'label':_0x163ff1,'table':_0xccc6('0x3a'),'id_type':_0xccc6('0x47'),'table_key':_0x3c3949['ticketId'],'title':_0xccc6('0x48')+_0x3c3949[_0xccc6('0x40')],'id_display':_0x3c3949['ticketNumber']},'auth':_0x30540a,'json':!![]};return rp(_0x3af22f)[_0xccc6('0xb')](function(_0x1a433f){_0x55c570();})['catch'](function(){_0x55c570();});});}function manageTags(_0x5e489b,_0x52e79a,_0x2f60a5,_0x3a88fd,_0x562819,_0x12b162,_0x15fa3e){return new Promise(function(_0x4dc5c5,_0x17be0b){var _0x4613de=[];_0x52e79a[_0xccc6('0x2a')](function(_0x404d4d){_0x4613de[_0xccc6('0x49')](getRemoteTag(_0x404d4d,_0x2f60a5,_0x3a88fd,_0x12b162,_0x15fa3e));});return Promise[_0xccc6('0x4a')](_0x4613de)[_0xccc6('0xb')](function(_0x3b526b){if(_0x3b526b[_0xccc6('0xc')]){logger['info']('['+[_0x5e489b[_0xccc6('0x11')]()]+_0xccc6('0x4b'),_0x3b526b);var _0x2f25de=[];_0x3b526b['forEach'](function(_0x1fc7c4){_0x2f25de[_0xccc6('0x49')](assignTagToIncident(_0x1fc7c4,_0x2f60a5,_0x3a88fd,_0x562819,_0x12b162));});return Promise[_0xccc6('0x4a')](_0x2f25de)['then'](function(){_0x4dc5c5();})[_0xccc6('0x1f')](function(){_0x4dc5c5();});}else{_0x4dc5c5();}});});}function getTags(_0x4cba33,_0x265992,_0x15f312,_0x3d3521,_0x258ed2,_0x10f8f6){return function(_0x4be8f5){return new Promise(function(_0x307331,_0xdeeedb){var _0x1d848a=[];var _0x37c252=_0x3d3521['Tags'];if(_0x37c252&&_0x37c252[_0xccc6('0xc')]>0x0){_0x1d848a=_['map'](_0x37c252,_0xccc6('0x4c'));}if(_0x1d848a[_0xccc6('0xc')]>0x0){return manageTags(_0x4cba33,_0x1d848a,_0x265992,_0x15f312,_0x4be8f5,_0x258ed2,_0x10f8f6)[_0xccc6('0xb')](function(){_0x307331(_0x4be8f5);});}else{_0x307331(_0x4be8f5);}});};}function emit(_0x18e4ea,_0xf1f0b1,_0x586977){var _0x359d6c='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x4b3ffc={'uri':_0x18e4ea+_0xccc6('0x4d')+_0x586977+_0x359d6c};io['to'](util[_0xccc6('0x4e')]('user:%s',_0xf1f0b1))[_0xccc6('0x4f')](_0xccc6('0x50'),_0x4b3ffc);}exports['cs']=function(_0x3b2051,_0x26f3a7,_0x4e0474,_0x237251,_0x22cb79,_0x19ae6c,_0x88a79e,_0x5259f8){var _0x53f808={};var _0x37b495={'user':_0x19ae6c[_0xccc6('0x51')],'pass':_0x19ae6c[_0xccc6('0x52')]};var _0x3e675e=_0xccc6('0x53');var _0xda1dc9=_0xccc6('0x54');_0x19ae6c[_0xccc6('0x55')]=intUtil['stripTrailingSlash'](_0x19ae6c[_0xccc6('0x55')]);_0x19ae6c[_0xccc6('0x56')]=intUtil[_0xccc6('0x57')](_0x19ae6c[_0xccc6('0x56')]);var _0xafe207=util['format'](_0xccc6('0x58'),_0x19ae6c[_0xccc6('0x55')]);_0x53f808[_0xccc6('0x17')]=!_['isNil'](_0x237251)?_0x237251[_0xccc6('0x59')]:null;_0x53f808[_0xccc6('0x1d')]=_0x19ae6c[_0xccc6('0x59')];_0x53f808[_0xccc6('0x24')]=_0x5259f8[_0xccc6('0x33')]()===_0xccc6('0x38')?_0x26f3a7[_0xccc6('0x5a')]:_0x26f3a7[_0xccc6('0x5b')];_0x53f808[_0xccc6('0x5c')]=_0x5259f8===_0xccc6('0x5d')||_0x5259f8===_0xccc6('0x5e')?_0xccc6('0x5d'):_0xccc6('0x38');var _0x3bae3f=util[_0xccc6('0x4e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x19ae6c[_0xccc6('0x56')],_0x26f3a7['uniqueid'],md5(_0x26f3a7['uniqueid']));if(_0x22cb79&&_0x22cb79[_0xccc6('0x5f')]){logger[_0xccc6('0x10')](_0xccc6('0x60'),_0xccc6('0x61'));_0x26f3a7['recordingURL']=_0x3bae3f;}else if(_0x88a79e&&_0x88a79e['recordingFormat']&&_0x88a79e[_0xccc6('0x62')]!==_0xccc6('0x63')){logger[_0xccc6('0x10')](_0xccc6('0x64'),'Recording\x20is\x20enabled!');_0x26f3a7[_0xccc6('0x65')]=_0x3bae3f;}else{_0x26f3a7['recordingURL']='';}return getAdminUser(_0x5259f8,_0x37b495,_0x53f808,_0xafe207,_0xda1dc9,_0x3e675e)[_0xccc6('0xb')](getUser(_0x5259f8,_0x37b495,_0xafe207,_0xda1dc9,_0x3e675e))[_0xccc6('0xb')](getEndUser(_0x5259f8,_0x37b495,_0xafe207,_0xda1dc9,_0x3e675e))[_0xccc6('0xb')](getTicket(_0x5259f8,_0x37b495,_0xafe207,_0x4e0474,_0x26f3a7,_0xda1dc9))[_0xccc6('0xb')](function(_0x2dadac){logger[_0xccc6('0x10')](util[_0xccc6('0x4e')](_0xccc6('0x66'),_0x2dadac[_0xccc6('0x67')]));logger['info'](util['format'](_0xccc6('0x68'),_0x5259f8));if(_0x5259f8!==_0xccc6('0x5e')){logger['info']('['+[_0x5259f8[_0xccc6('0x11')]()]+']',_0xccc6('0x69'));emit(_0x19ae6c['remoteUri'],_0x237251[_0xccc6('0x4c')],_0x2dadac[_0xccc6('0x67')]);}})[_0xccc6('0x1f')](function(_0x220180){logger['error']('['+[_0x5259f8[_0xccc6('0x11')]()]+_0xccc6('0x6a'),util[_0xccc6('0x6b')](_0x220180,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 7f6d7b0..c617ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0ad=['entry_list','name_value_list','value','Agent\x20found!','resolve','name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','string','nameField','toLowerCase','content','toString','customField','custom_fields','variableName','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','contacts','user:%s','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','Inbound','users','request-promise','bluebird','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_hours','duration_minutes','Contacts','parent_name','direction','length','forEach','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','find'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0xd0ad,0xc8));var _0xdd0a=function(_0x4716bf,_0x38a5c2){_0x4716bf=_0x4716bf-0x0;var _0x3abd0c=_0xd0ad[_0x4716bf];return _0x3abd0c;};'use strict';var _=require('lodash');var rp=require(_0xdd0a('0x0'));var BPromise=require(_0xdd0a('0x1'));var md5=require('md5');var util=require(_0xdd0a('0x2'));var Redis=require(_0xdd0a('0x3'));var intUtil=require(_0xdd0a('0x4'));var config=require('../../../../config/environment');var logger=require(_0xdd0a('0x5'))(_0xdd0a('0x6'));config[_0xdd0a('0x7')]=_[_0xdd0a('0x8')](config['redis'],{'host':_0xdd0a('0x9'),'port':0x18eb});var io=require(_0xdd0a('0xa'))(new Redis(config['redis']));var def={'method':_0xdd0a('0xb'),'json':!![]};function emit(_0x39c91d,_0x954fa9,_0x515697){io['to'](_0x39c91d)[_0xdd0a('0xc')](_0x954fa9,_0x515697);}function getTicket(_0x12ddc5,_0x5c04ba,_0x5e011d,_0x2d95a9,_0x99ca7a,_0x464840,_0x5c049d,_0x8125ec){logger['info'](_0xdd0a('0xd'));var _0x830cf7=new Date();var _0x2944e3=[{'name':'name','value':intUtil[_0xdd0a('0xe')](_0x2d95a9[_0xdd0a('0xf')],_0x99ca7a,'\x20')},{'name':_0xdd0a('0x10'),'value':_0x5c04ba['id']},{'name':_0xdd0a('0x11'),'value':_0x5c04ba['id']},{'name':_0xdd0a('0x12'),'value':intUtil['getString'](_0x2d95a9['Descriptions'],_0x99ca7a,'\x0a')},{'name':_0xdd0a('0x13'),'value':_0x830cf7[_0xdd0a('0x14')]()[_0xdd0a('0x15')](0x0,0x13)[_0xdd0a('0x16')]('T','\x20')},{'name':_0xdd0a('0x17'),'value':'0'},{'name':_0xdd0a('0x18'),'value':'15'},{'name':'parent_id','value':_0x5e011d['id']},{'name':'parent_type','value':_0xdd0a('0x19')},{'name':_0xdd0a('0x1a'),'value':_0x5e011d['name']},{'name':_0xdd0a('0x1b'),'value':_0x8125ec}];if(_0x464840[_0xdd0a('0x1c')]){_[_0xdd0a('0x1d')](_0x464840,function(_0x5e58d7){if(_0x99ca7a[_0x5e58d7['variableName']]){_0x2944e3[_0xdd0a('0x1e')]({'name':_0x5e58d7[_0xdd0a('0x1f')],'value':_0x99ca7a[_0x5e58d7['variableName']]});}});}return request({'form':{'method':_0xdd0a('0x20'),'input_type':_0xdd0a('0x21'),'response_type':_0xdd0a('0x21'),'rest_data':JSON[_0xdd0a('0x22')]({'session':_0x5c049d['id'],'module_name':'Calls','name_value_list':_0x2944e3})}});}function getAuth(_0x1efa96){return util[_0xdd0a('0x23')](_0xdd0a('0x24'),new Buffer(_0x1efa96['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0xa6d48a){return request({'form':{'method':_0xdd0a('0x25'),'input_type':'JSON','response_type':_0xdd0a('0x21'),'rest_data':JSON['stringify']({'session':_0xa6d48a['id']})}});}function getUser(_0x29e668,_0x295c12,_0x4a73ac){if(!_[_0xdd0a('0x26')](_0x295c12)){logger[_0xdd0a('0x27')](_0xdd0a('0x28'),_0x295c12);return request({'form':{'method':_0xdd0a('0x29'),'input_type':_0xdd0a('0x21'),'response_type':_0xdd0a('0x21'),'rest_data':JSON[_0xdd0a('0x22')]({'session':_0x4a73ac['id'],'module_name':_0xdd0a('0x2a'),'query':util[_0xdd0a('0x23')](_0xdd0a('0x2b'),_0x295c12),'order_by':'','offset':'0','select_fields':['id','name',_0xdd0a('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x88e041){if(_0x88e041['entry_list'][_0xdd0a('0x1c')]){var _0x15f6f4=_[_0xdd0a('0x2d')](_0x88e041[_0xdd0a('0x2e')],function(_0x5b28d6){return _0x5b28d6[_0xdd0a('0x2f')][_0xdd0a('0x2c')][_0xdd0a('0x30')]===_0x295c12;});if(_0x15f6f4){logger[_0xdd0a('0x27')](_0xdd0a('0x31'));return BPromise[_0xdd0a('0x32')]({'id':_0x15f6f4[_0xdd0a('0x2f')]['id']['value'],'name':_0x15f6f4['name_value_list'][_0xdd0a('0x33')][_0xdd0a('0x30')]});}}logger['info'](_0xdd0a('0x34'));return BPromise[_0xdd0a('0x32')]({'id':_0x4a73ac[_0xdd0a('0x2f')]['user_id'][_0xdd0a('0x30')],'name':_0x4a73ac[_0xdd0a('0x2f')]['user_name'][_0xdd0a('0x30')]});});}else{logger[_0xdd0a('0x27')](_0xdd0a('0x35'));return BPromise[_0xdd0a('0x32')]({'id':_0x4a73ac[_0xdd0a('0x2f')][_0xdd0a('0x36')]['value'],'name':_0x4a73ac[_0xdd0a('0x2f')][_0xdd0a('0x2c')][_0xdd0a('0x30')]});}}function getEndUser(_0x2c4f15,_0x282b91,_0x13da5b,_0x4903c0){logger[_0xdd0a('0x27')]('Searching\x20enduser\x20with\x20phone',_0x13da5b);return request({'form':{'method':_0xdd0a('0x29'),'input_type':_0xdd0a('0x21'),'response_type':_0xdd0a('0x21'),'rest_data':JSON['stringify']({'session':_0x4903c0['id'],'module_name':_0xdd0a('0x19'),'query':util[_0xdd0a('0x23')](_0xdd0a('0x37'),_0x13da5b),'order_by':'','offset':'0','select_fields':['id','name',_0xdd0a('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xdd0a('0x39')](function(_0x212565){if(_0x212565[_0xdd0a('0x2e')][_0xdd0a('0x1c')]){var _0x2cbcd6=_[_0xdd0a('0x2d')](_0x212565[_0xdd0a('0x2e')],function(_0x1731c7){return _0x1731c7[_0xdd0a('0x2f')][_0xdd0a('0x38')]['value']===_0x13da5b;});if(_0x2cbcd6){logger[_0xdd0a('0x27')]('Enduser\x20found!');return BPromise[_0xdd0a('0x32')]({'id':_0x2cbcd6[_0xdd0a('0x2f')]['id'][_0xdd0a('0x30')],'name':_0x2cbcd6[_0xdd0a('0x2f')]['name'][_0xdd0a('0x30')],'phone':_0x2cbcd6[_0xdd0a('0x2f')][_0xdd0a('0x38')][_0xdd0a('0x30')]});}}else{logger['info'](_0xdd0a('0x3a'));return request({'form':{'method':_0xdd0a('0x20'),'input_type':_0xdd0a('0x21'),'response_type':_0xdd0a('0x21'),'rest_data':JSON[_0xdd0a('0x22')]({'session':_0x4903c0['id'],'module_name':_0xdd0a('0x19'),'name_value_list':[{'name':_0xdd0a('0x3b'),'value':_0x282b91!=='<unknown>'?_0x282b91:util[_0xdd0a('0x23')](_0xdd0a('0x3c'),_0x13da5b)},{'name':_0xdd0a('0x38'),'value':_0x13da5b}]})}})[_0xdd0a('0x39')](function(_0x1dac14){logger[_0xdd0a('0x27')](_0xdd0a('0x3d'));return BPromise[_0xdd0a('0x32')]({'id':_0x1dac14['id'],'name':_0x1dac14['entry_list']['first_name'][_0xdd0a('0x30')],'phone':_0x1dac14[_0xdd0a('0x2e')][_0xdd0a('0x38')][_0xdd0a('0x30')]});});}});}function request(_0x3c1baa){logger[_0xdd0a('0x3e')](_0xdd0a('0x3f'),JSON[_0xdd0a('0x22')](_0x3c1baa));return rp(_[_0xdd0a('0x40')](def,_0x3c1baa));}function getTags(_0x5c50f8,_0x1bffb6){var _0x3afee7=[];if(_0x5c50f8&&_0x5c50f8[_0xdd0a('0x1c')]>0x0){_0x3afee7=_['map'](_0x5c50f8,_0x1bffb6);}return _0x3afee7;}function getCustomFields(_0x5f236d,_0x54fae9){var _0x1de4df=[];var _0x1f15ea={'custom_fields':[]};if(_0x5f236d[_0xdd0a('0x1c')]>0x0){_['forEach'](_0x5f236d,function(_0x2a5514){if(_0x2a5514[_0xdd0a('0x41')]===_0xdd0a('0x42')&&_0x2a5514[_0xdd0a('0x43')]&&!_0x2a5514['customField']){_0x1f15ea[_0x2a5514[_0xdd0a('0x43')][_0xdd0a('0x44')]()]=_0x2a5514[_0xdd0a('0x45')][_0xdd0a('0x46')]();}else if(_0x2a5514[_0xdd0a('0x41')]===_0xdd0a('0x42')&&_0x2a5514[_0xdd0a('0x1f')]&&_0x2a5514[_0xdd0a('0x47')]){_0x1f15ea[_0xdd0a('0x48')]['push']({'id':_0x2a5514['idField'],'value':_0x2a5514[_0xdd0a('0x45')][_0xdd0a('0x46')]()});}else if(_0x2a5514[_0xdd0a('0x41')]==='variable'&&_0x2a5514[_0xdd0a('0x49')]&&_0x2a5514[_0xdd0a('0x1f')]&&_0x2a5514[_0xdd0a('0x47')]){_0x54fae9[_0x2a5514[_0xdd0a('0x49')]]&&_0x1f15ea[_0xdd0a('0x48')][_0xdd0a('0x1e')]({'id':_0x2a5514['idField'],'value':_0x54fae9[_0x2a5514[_0xdd0a('0x49')]][_0xdd0a('0x46')]()});}else if(_0x2a5514[_0xdd0a('0x41')]===_0xdd0a('0x4a')&&_0x2a5514[_0xdd0a('0x4b')]&&_0x2a5514[_0xdd0a('0x4b')]['name']&&_0x2a5514[_0xdd0a('0x1f')]&&_0x2a5514['customField']){_0x54fae9[_0x2a5514['Variable'][_0xdd0a('0x33')][_0xdd0a('0x44')]()]&&_0x1f15ea[_0xdd0a('0x48')]['push']({'id':_0x2a5514[_0xdd0a('0x1f')],'value':_0x54fae9[_0x2a5514[_0xdd0a('0x4b')][_0xdd0a('0x33')][_0xdd0a('0x44')]()][_0xdd0a('0x46')]()});}});}return _0x1f15ea;}function getConnection(_0x3f7277){return request({'method':_0xdd0a('0xb'),'form':{'method':_0xdd0a('0x4c'),'input_type':_0xdd0a('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3f7277[_0xdd0a('0x4d')],'password':_0x3f7277[_0xdd0a('0x4e')],'encryption':_0xdd0a('0x4f')},'application':_0xdd0a('0x50')})}})['then'](function(_0x108b42){var _0x3f1a9c=_0x108b42;if(_0x3f1a9c['id']){def['sessionID']=_0x3f1a9c['id'];return BPromise[_0xdd0a('0x32')](_0x3f1a9c);}else{throw new Error(util[_0xdd0a('0x23')](_0xdd0a('0x51'),_0x3f7277['id']));}});}function setRelationship(_0x582535,_0x161875,_0x2284da,_0x2ba7fa){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0xdd0a('0x21'),'rest_data':JSON[_0xdd0a('0x22')]({'session':_0x582535['id'],'module_name':_0xdd0a('0x52'),'module_id':_0x2284da['id'],'link_field_name':_0x2ba7fa,'related_ids':[_0x161875['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xdd0a('0x53')]=function(_0x5db360,_0x11669b,_0x5d6f90,_0x4ff379,_0x1266b6,_0x5672fd){var _0x5c7e16,_0x525b34,_0x443316,_0x2af10b;_0x5672fd[_0xdd0a('0x54')]=intUtil['stripTrailingSlash'](_0x5672fd[_0xdd0a('0x54')]);_0x5672fd['serverUrl']=intUtil['stripTrailingSlash'](_0x5672fd['serverUrl']);def[_0xdd0a('0x55')]=util[_0xdd0a('0x23')](_0xdd0a('0x56'),_0x5672fd[_0xdd0a('0x54')]);if(_0x1266b6&&_0x1266b6['monitor_format']){logger[_0xdd0a('0x27')](_0xdd0a('0x57'),_0xdd0a('0x58'));_0x11669b[_0xdd0a('0x59')]=util[_0xdd0a('0x23')](_0xdd0a('0x5a'),_0x5672fd[_0xdd0a('0x5b')],_0x11669b[_0xdd0a('0x5c')],md5(_0x11669b[_0xdd0a('0x5c')]));}else{_0x11669b[_0xdd0a('0x59')]='';}return getConnection(_0x5672fd)[_0xdd0a('0x39')](function(_0x26a343){_0x2af10b=_0x26a343;return getUser(_0x5672fd,_0x4ff379[_0xdd0a('0x33')],_0x2af10b);})[_0xdd0a('0x39')](function(_0xf53367){_0x5c7e16=_0xf53367;logger[_0xdd0a('0x27')](_0xdd0a('0x5d'),_0x5c7e16['id']);return getEndUser(_0x5672fd,_0x11669b['calleridname'],_0x11669b[_0xdd0a('0x5e')],_0x2af10b);})['then'](function(_0x2bd692){_0x525b34=_0x2bd692;logger['info'](_0xdd0a('0x5f'),_0x525b34['id']);return getTicket(_0x5672fd,_0x5c7e16,_0x525b34,_0x5d6f90,_0x11669b,_0x5d6f90[_0xdd0a('0x60')],_0x2af10b,'Inbound');})[_0xdd0a('0x39')](function(_0x53af26){_0x443316=_0x53af26;logger[_0xdd0a('0x27')]('Ticket\x20created!');logger[_0xdd0a('0x27')](_0xdd0a('0x61'),_0x443316['id']);return setRelationship(_0x2af10b,_0x5c7e16,_0x443316,'users');})[_0xdd0a('0x39')](function(){return setRelationship(_0x2af10b,_0x525b34,_0x443316,'contacts');})[_0xdd0a('0x39')](function(){return getServerInfo(_0x2af10b);})['then'](function(_0x1cafef){var _0x4be48e=parseInt(_0x1cafef[_0xdd0a('0x62')][_0xdd0a('0x63')](0x0));var _0x4e6330=util[_0xdd0a('0x23')](_0xdd0a('0x64'),_0x5672fd[_0xdd0a('0x54')],_0x443316['id']);if(_0x4be48e>0x6){_0x4e6330=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5672fd[_0xdd0a('0x54')],_0x443316['id']);}logger['info'](_0xdd0a('0x57'),_0xdd0a('0x65'));emit(util['format']('user:%s',_0x4ff379[_0xdd0a('0x33')]),_0xdd0a('0x66'),{'uri':_0x4e6330});})[_0xdd0a('0x67')](function(_0x3e8052){logger[_0xdd0a('0x68')](_0xdd0a('0x57'),JSON[_0xdd0a('0x22')](_0x3e8052));});};exports[_0xdd0a('0x69')]=function(_0x5ed38a,_0x1c2fad,_0x39afff,_0x441f2e,_0x48328d,_0x43e59a,_0x186339){var _0x274ea0,_0x4401bd,_0x1e7ce2,_0x408b20;_0x43e59a[_0xdd0a('0x54')]=intUtil[_0xdd0a('0x6a')](_0x43e59a['remoteUri']);_0x43e59a[_0xdd0a('0x5b')]=intUtil[_0xdd0a('0x6a')](_0x43e59a[_0xdd0a('0x5b')]);def[_0xdd0a('0x55')]=util['format'](_0xdd0a('0x56'),_0x43e59a[_0xdd0a('0x54')]);if(_0x186339&&_0x186339[_0xdd0a('0x6b')]&&_0x186339['recordingFormat']!==_0xdd0a('0x6c')){logger[_0xdd0a('0x27')](_0xdd0a('0x6d'),_0xdd0a('0x58'));_0x1c2fad[_0xdd0a('0x59')]=util[_0xdd0a('0x23')](_0xdd0a('0x5a'),_0x43e59a[_0xdd0a('0x5b')],_0x1c2fad[_0xdd0a('0x5c')],md5(_0x1c2fad[_0xdd0a('0x5c')]));}return getConnection(_0x43e59a)[_0xdd0a('0x39')](function(_0x10848f){_0x408b20=_0x10848f;return getUser(_0x43e59a,_0x441f2e[_0xdd0a('0x33')],_0x408b20);})[_0xdd0a('0x39')](function(_0x29c67a){_0x274ea0=_0x29c67a;logger[_0xdd0a('0x27')](_0xdd0a('0x5d'),_0x274ea0['id']);return getEndUser(_0x43e59a,_0x1c2fad[_0xdd0a('0x6e')],_0x1c2fad[_0xdd0a('0x6f')],_0x408b20);})[_0xdd0a('0x39')](function(_0x42a769){_0x4401bd=_0x42a769;logger['info'](_0xdd0a('0x5f'),_0x4401bd['id']);return getTicket(_0x43e59a,_0x274ea0,_0x4401bd,_0x39afff,_0x1c2fad,_0x39afff[_0xdd0a('0x60')],_0x408b20,_0xdd0a('0x70'));})[_0xdd0a('0x39')](function(_0x2771bb){_0x1e7ce2=_0x2771bb;logger['info'](_0xdd0a('0x71'));logger[_0xdd0a('0x27')](_0xdd0a('0x61'),_0x1e7ce2['id']);return setRelationship(_0x408b20,_0x274ea0,_0x1e7ce2,'users');})[_0xdd0a('0x39')](function(){return setRelationship(_0x408b20,_0x4401bd,_0x1e7ce2,_0xdd0a('0x72'));})[_0xdd0a('0x39')](function(){return getServerInfo(_0x408b20);})[_0xdd0a('0x39')](function(_0x237673){var _0x2f88f9=parseInt(_0x237673[_0xdd0a('0x62')][_0xdd0a('0x63')](0x0));var _0x47fa63=util['format'](_0xdd0a('0x64'),_0x43e59a[_0xdd0a('0x54')],_0x1e7ce2['id']);if(_0x2f88f9>0x6){_0x47fa63=util[_0xdd0a('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x43e59a['remoteUri'],_0x1e7ce2['id']);}logger[_0xdd0a('0x27')](_0xdd0a('0x6d'),_0xdd0a('0x65'));emit(util[_0xdd0a('0x23')](_0xdd0a('0x73'),_0x441f2e[_0xdd0a('0x33')]),_0xdd0a('0x66'),{'uri':_0x47fa63});})[_0xdd0a('0x67')](function(_0x5bb7db){logger[_0xdd0a('0x68')](_0xdd0a('0x6d'),JSON[_0xdd0a('0x22')](_0x5bb7db));});};exports[_0xdd0a('0x74')]=function(_0x27cfac,_0x301c7e,_0x2cc976,_0x52bd25,_0x4ac733,_0x3eef69){var _0x37a862,_0x12a098,_0x112b99,_0x33d5fb;_0x3eef69[_0xdd0a('0x54')]=intUtil[_0xdd0a('0x6a')](_0x3eef69[_0xdd0a('0x54')]);_0x3eef69['serverUrl']=intUtil[_0xdd0a('0x6a')](_0x3eef69[_0xdd0a('0x5b')]);def[_0xdd0a('0x55')]=util['format'](_0xdd0a('0x56'),_0x3eef69[_0xdd0a('0x54')]);if(_0x4ac733&&_0x4ac733[_0xdd0a('0x75')]){logger[_0xdd0a('0x27')]('['+_0x301c7e[_0xdd0a('0x76')][_0xdd0a('0x77')]()+']',_0xdd0a('0x58'));_0x301c7e['recordingURL']=util[_0xdd0a('0x23')](_0xdd0a('0x5a'),_0x3eef69[_0xdd0a('0x5b')],_0x301c7e['uniqueid'],md5(_0x301c7e['uniqueid']));}else{_0x301c7e[_0xdd0a('0x59')]='';}return getConnection(_0x3eef69)[_0xdd0a('0x39')](function(_0x3059c7){_0x33d5fb=_0x3059c7;if(!_[_0xdd0a('0x26')](_0x52bd25)){return getUser(_0x3eef69,_0x52bd25[_0xdd0a('0x33')],_0x33d5fb);}else{return getUser(_0x3eef69,null,_0x33d5fb);}})[_0xdd0a('0x39')](function(_0x400bd6){_0x37a862=_0x400bd6;logger[_0xdd0a('0x27')](_0xdd0a('0x5d'),_0x37a862['id']);return getEndUser(_0x3eef69,_0x301c7e[_0xdd0a('0x78')],_0x301c7e['calleridnum'],_0x33d5fb);})[_0xdd0a('0x39')](function(_0x525f95){_0x12a098=_0x525f95;logger[_0xdd0a('0x27')](_0xdd0a('0x5f'),_0x12a098['id']);return getTicket(_0x3eef69,_0x37a862,_0x12a098,_0x2cc976,_0x301c7e,_0x2cc976[_0xdd0a('0x60')],_0x33d5fb,_0xdd0a('0x79'));})[_0xdd0a('0x39')](function(_0xe99295){_0x112b99=_0xe99295;logger[_0xdd0a('0x27')](_0xdd0a('0x71'));logger[_0xdd0a('0x27')](_0xdd0a('0x61'),_0x112b99['id']);return setRelationship(_0x33d5fb,_0x37a862,_0x112b99,_0xdd0a('0x7a'));})['then'](function(){return setRelationship(_0x33d5fb,_0x12a098,_0x112b99,'contacts');})['then'](function(){return getServerInfo(_0x33d5fb);})['catch'](function(_0x5336b6){logger[_0xdd0a('0x68')]('['+_0x301c7e['lastevent'][_0xdd0a('0x77')]()+']',JSON[_0xdd0a('0x22')](_0x5336b6));});};
\ No newline at end of file
+var _0x68eb=['lastevent','toUpperCase','calleridnum','lodash','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','info','name','getString','Subjects','assigned_user_id','description','date_start','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','variableName','push','set_entry','JSON','stringify','Calls','Basic\x20%s','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','length','find','entry_list','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','map','forEach','type','string','customField','nameField','toLowerCase','content','idField','custom_fields','customVariable','Variable','login','username','password','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','unmanaged'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x68eb,0xe9));var _0xb68e=function(_0x45f111,_0x3a1a4a){_0x45f111=_0x45f111-0x0;var _0x483508=_0x68eb[_0x45f111];return _0x483508;};'use strict';var _=require(_0xb68e('0x0'));var rp=require('request-promise');var BPromise=require(_0xb68e('0x1'));var md5=require(_0xb68e('0x2'));var util=require(_0xb68e('0x3'));var Redis=require('ioredis');var intUtil=require(_0xb68e('0x4'));var config=require(_0xb68e('0x5'));var logger=require(_0xb68e('0x6'))(_0xb68e('0x7'));config[_0xb68e('0x8')]=_[_0xb68e('0x9')](config[_0xb68e('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb68e('0xa'))(new Redis(config['redis']));var def={'method':_0xb68e('0xb'),'json':!![]};function emit(_0x47e60e,_0xc9da16,_0xb7c3b9){io['to'](_0x47e60e)['emit'](_0xc9da16,_0xb7c3b9);}function getTicket(_0x37263e,_0x147dc0,_0x13e67d,_0x184430,_0x30bdce,_0x267074,_0x157c7e,_0x4e395d){logger[_0xb68e('0xc')]('Creating\x20new\x20ticket...');var _0x307c43=new Date();var _0x1563a3=[{'name':_0xb68e('0xd'),'value':intUtil[_0xb68e('0xe')](_0x184430[_0xb68e('0xf')],_0x30bdce,'\x20')},{'name':_0xb68e('0x10'),'value':_0x147dc0['id']},{'name':'created_by','value':_0x147dc0['id']},{'name':_0xb68e('0x11'),'value':intUtil[_0xb68e('0xe')](_0x184430['Descriptions'],_0x30bdce,'\x0a')},{'name':_0xb68e('0x12'),'value':_0x307c43['toISOString']()[_0xb68e('0x13')](0x0,0x13)[_0xb68e('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xb68e('0x15'),'value':'15'},{'name':_0xb68e('0x16'),'value':_0x13e67d['id']},{'name':_0xb68e('0x17'),'value':_0xb68e('0x18')},{'name':_0xb68e('0x19'),'value':_0x13e67d[_0xb68e('0xd')]},{'name':'direction','value':_0x4e395d}];if(_0x267074['length']){_['forEach'](_0x267074,function(_0x2e6ba0){if(_0x30bdce[_0x2e6ba0[_0xb68e('0x1a')]]){_0x1563a3[_0xb68e('0x1b')]({'name':_0x2e6ba0['idField'],'value':_0x30bdce[_0x2e6ba0[_0xb68e('0x1a')]]});}});}return request({'form':{'method':_0xb68e('0x1c'),'input_type':_0xb68e('0x1d'),'response_type':_0xb68e('0x1d'),'rest_data':JSON[_0xb68e('0x1e')]({'session':_0x157c7e['id'],'module_name':_0xb68e('0x1f'),'name_value_list':_0x1563a3})}});}function getAuth(_0x293136){return util['format'](_0xb68e('0x20'),new Buffer(_0x293136['apiKey']+':X')[_0xb68e('0x21')](_0xb68e('0x22')));}function getServerInfo(_0x614711){return request({'form':{'method':_0xb68e('0x23'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb68e('0x1e')]({'session':_0x614711['id']})}});}function getUser(_0x545fe9,_0x4fd903,_0x429e65){if(!_[_0xb68e('0x24')](_0x4fd903)){logger[_0xb68e('0xc')](_0xb68e('0x25'),_0x4fd903);return request({'form':{'method':'get_entry_list','input_type':_0xb68e('0x1d'),'response_type':'JSON','rest_data':JSON[_0xb68e('0x1e')]({'session':_0x429e65['id'],'module_name':'Employees','query':util[_0xb68e('0x26')](_0xb68e('0x27'),_0x4fd903),'order_by':'','offset':'0','select_fields':['id',_0xb68e('0xd'),_0xb68e('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb68e('0x29')](function(_0x1cc02c){if(_0x1cc02c['entry_list'][_0xb68e('0x2a')]){var _0x8451ee=_[_0xb68e('0x2b')](_0x1cc02c[_0xb68e('0x2c')],function(_0x52900a){return _0x52900a[_0xb68e('0x2d')][_0xb68e('0x28')]['value']===_0x4fd903;});if(_0x8451ee){logger['info'](_0xb68e('0x2e'));return BPromise['resolve']({'id':_0x8451ee[_0xb68e('0x2d')]['id']['value'],'name':_0x8451ee[_0xb68e('0x2d')][_0xb68e('0xd')][_0xb68e('0x2f')]});}}logger[_0xb68e('0xc')](_0xb68e('0x30'));return BPromise['resolve']({'id':_0x429e65[_0xb68e('0x2d')]['user_id'][_0xb68e('0x2f')],'name':_0x429e65['name_value_list'][_0xb68e('0x28')][_0xb68e('0x2f')]});});}else{logger[_0xb68e('0xc')](_0xb68e('0x31'));return BPromise[_0xb68e('0x32')]({'id':_0x429e65[_0xb68e('0x2d')]['user_id'][_0xb68e('0x2f')],'name':_0x429e65[_0xb68e('0x2d')][_0xb68e('0x28')][_0xb68e('0x2f')]});}}function getEndUser(_0x458417,_0x332b62,_0x225613,_0x30861a){logger[_0xb68e('0xc')](_0xb68e('0x33'),_0x225613);return request({'form':{'method':_0xb68e('0x34'),'input_type':_0xb68e('0x1d'),'response_type':_0xb68e('0x1d'),'rest_data':JSON[_0xb68e('0x1e')]({'session':_0x30861a['id'],'module_name':_0xb68e('0x18'),'query':util[_0xb68e('0x26')](_0xb68e('0x35'),_0x225613),'order_by':'','offset':'0','select_fields':['id',_0xb68e('0xd'),_0xb68e('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb68e('0x29')](function(_0x486715){if(_0x486715[_0xb68e('0x2c')][_0xb68e('0x2a')]){var _0x2f2476=_['find'](_0x486715[_0xb68e('0x2c')],function(_0x52be23){return _0x52be23['name_value_list'][_0xb68e('0x36')]['value']===_0x225613;});if(_0x2f2476){logger['info'](_0xb68e('0x37'));return BPromise[_0xb68e('0x32')]({'id':_0x2f2476['name_value_list']['id'][_0xb68e('0x2f')],'name':_0x2f2476[_0xb68e('0x2d')][_0xb68e('0xd')][_0xb68e('0x2f')],'phone':_0x2f2476[_0xb68e('0x2d')][_0xb68e('0x36')]['value']});}}else{logger[_0xb68e('0xc')](_0xb68e('0x38'));return request({'form':{'method':'set_entry','input_type':_0xb68e('0x1d'),'response_type':_0xb68e('0x1d'),'rest_data':JSON['stringify']({'session':_0x30861a['id'],'module_name':'Contacts','name_value_list':[{'name':_0xb68e('0x39'),'value':_0x332b62!==_0xb68e('0x3a')?_0x332b62:util[_0xb68e('0x26')](_0xb68e('0x3b'),_0x225613)},{'name':'phone_home','value':_0x225613}]})}})['then'](function(_0x1de268){logger[_0xb68e('0xc')](_0xb68e('0x3c'));return BPromise[_0xb68e('0x32')]({'id':_0x1de268['id'],'name':_0x1de268[_0xb68e('0x2c')][_0xb68e('0x39')]['value'],'phone':_0x1de268[_0xb68e('0x2c')][_0xb68e('0x36')]['value']});});}});}function request(_0x182f66){logger['debug']('[HTTP]',JSON[_0xb68e('0x1e')](_0x182f66));return rp(_['merge'](def,_0x182f66));}function getTags(_0x599f7b,_0x687435){var _0xde5cd=[];if(_0x599f7b&&_0x599f7b['length']>0x0){_0xde5cd=_[_0xb68e('0x3d')](_0x599f7b,_0x687435);}return _0xde5cd;}function getCustomFields(_0x33882f,_0x4b37a5){var _0x4ecffc=[];var _0x3a6619={'custom_fields':[]};if(_0x33882f[_0xb68e('0x2a')]>0x0){_[_0xb68e('0x3e')](_0x33882f,function(_0x3dad97){if(_0x3dad97[_0xb68e('0x3f')]===_0xb68e('0x40')&&_0x3dad97['nameField']&&!_0x3dad97[_0xb68e('0x41')]){_0x3a6619[_0x3dad97[_0xb68e('0x42')][_0xb68e('0x43')]()]=_0x3dad97[_0xb68e('0x44')]['toString']();}else if(_0x3dad97[_0xb68e('0x3f')]===_0xb68e('0x40')&&_0x3dad97[_0xb68e('0x45')]&&_0x3dad97[_0xb68e('0x41')]){_0x3a6619[_0xb68e('0x46')]['push']({'id':_0x3dad97['idField'],'value':_0x3dad97[_0xb68e('0x44')][_0xb68e('0x21')]()});}else if(_0x3dad97[_0xb68e('0x3f')]==='variable'&&_0x3dad97['variableName']&&_0x3dad97[_0xb68e('0x45')]&&_0x3dad97[_0xb68e('0x41')]){_0x4b37a5[_0x3dad97[_0xb68e('0x1a')]]&&_0x3a6619['custom_fields'][_0xb68e('0x1b')]({'id':_0x3dad97[_0xb68e('0x45')],'value':_0x4b37a5[_0x3dad97['variableName']]['toString']()});}else if(_0x3dad97[_0xb68e('0x3f')]===_0xb68e('0x47')&&_0x3dad97[_0xb68e('0x48')]&&_0x3dad97[_0xb68e('0x48')]['name']&&_0x3dad97[_0xb68e('0x45')]&&_0x3dad97[_0xb68e('0x41')]){_0x4b37a5[_0x3dad97['Variable'][_0xb68e('0xd')]['toLowerCase']()]&&_0x3a6619[_0xb68e('0x46')][_0xb68e('0x1b')]({'id':_0x3dad97[_0xb68e('0x45')],'value':_0x4b37a5[_0x3dad97['Variable']['name']['toLowerCase']()][_0xb68e('0x21')]()});}});}return _0x3a6619;}function getConnection(_0x12c85c){return request({'method':'POST','form':{'method':_0xb68e('0x49'),'input_type':'JSON','response_type':_0xb68e('0x1d'),'rest_data':JSON[_0xb68e('0x1e')]({'user_auth':{'user_name':_0x12c85c[_0xb68e('0x4a')],'password':_0x12c85c[_0xb68e('0x4b')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x121833){var _0x32ab1b=_0x121833;if(_0x32ab1b['id']){def['sessionID']=_0x32ab1b['id'];return BPromise['resolve'](_0x32ab1b);}else{throw new Error(util['format'](_0xb68e('0x4c'),_0x12c85c['id']));}});}function setRelationship(_0x3a445a,_0x2cc1e6,_0x322162,_0xce4091){return request({'form':{'method':_0xb68e('0x4d'),'input_type':'JSON','response_type':_0xb68e('0x1d'),'rest_data':JSON[_0xb68e('0x1e')]({'session':_0x3a445a['id'],'module_name':_0xb68e('0x1f'),'module_id':_0x322162['id'],'link_field_name':_0xce4091,'related_ids':[_0x2cc1e6['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb68e('0x4e')]=function(_0x419ce3,_0x3a22b1,_0x5dc887,_0x22ca35,_0x2f80ce,_0x3699ac){var _0x4a611b,_0x54ab49,_0x1be648,_0x2fda06;_0x3699ac['remoteUri']=intUtil['stripTrailingSlash'](_0x3699ac[_0xb68e('0x4f')]);_0x3699ac[_0xb68e('0x50')]=intUtil[_0xb68e('0x51')](_0x3699ac[_0xb68e('0x50')]);def[_0xb68e('0x52')]=util[_0xb68e('0x26')](_0xb68e('0x53'),_0x3699ac[_0xb68e('0x4f')]);if(_0x2f80ce&&_0x2f80ce[_0xb68e('0x54')]){logger[_0xb68e('0xc')]('[QUEUE]',_0xb68e('0x55'));_0x3a22b1[_0xb68e('0x56')]=util[_0xb68e('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3699ac['serverUrl'],_0x3a22b1[_0xb68e('0x57')],md5(_0x3a22b1[_0xb68e('0x57')]));}else{_0x3a22b1[_0xb68e('0x56')]='';}return getConnection(_0x3699ac)[_0xb68e('0x29')](function(_0x535218){_0x2fda06=_0x535218;return getUser(_0x3699ac,_0x22ca35[_0xb68e('0xd')],_0x2fda06);})['then'](function(_0xcf0631){_0x4a611b=_0xcf0631;logger[_0xb68e('0xc')](_0xb68e('0x58'),_0x4a611b['id']);return getEndUser(_0x3699ac,_0x3a22b1[_0xb68e('0x59')],_0x3a22b1['calleridnum'],_0x2fda06);})[_0xb68e('0x29')](function(_0x1c8953){_0x54ab49=_0x1c8953;logger['info'](_0xb68e('0x5a'),_0x54ab49['id']);return getTicket(_0x3699ac,_0x4a611b,_0x54ab49,_0x5dc887,_0x3a22b1,_0x5dc887[_0xb68e('0x5b')],_0x2fda06,'Inbound');})[_0xb68e('0x29')](function(_0x16e676){_0x1be648=_0x16e676;logger[_0xb68e('0xc')](_0xb68e('0x5c'));logger[_0xb68e('0xc')]('The\x20Ticket\x20ID\x20is:',_0x1be648['id']);return setRelationship(_0x2fda06,_0x4a611b,_0x1be648,_0xb68e('0x5d'));})['then'](function(){return setRelationship(_0x2fda06,_0x54ab49,_0x1be648,_0xb68e('0x5e'));})[_0xb68e('0x29')](function(){return getServerInfo(_0x2fda06);})[_0xb68e('0x29')](function(_0x186026){var _0x9ad590=parseInt(_0x186026[_0xb68e('0x5f')][_0xb68e('0x60')](0x0));var _0x436a0b=util[_0xb68e('0x26')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3699ac[_0xb68e('0x4f')],_0x1be648['id']);if(_0x9ad590>0x6){_0x436a0b=util[_0xb68e('0x26')](_0xb68e('0x61'),_0x3699ac[_0xb68e('0x4f')],_0x1be648['id']);}logger['info'](_0xb68e('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb68e('0x26')]('user:%s',_0x22ca35[_0xb68e('0xd')]),_0xb68e('0x63'),{'uri':_0x436a0b});})[_0xb68e('0x64')](function(_0x405080){logger[_0xb68e('0x65')](_0xb68e('0x62'),JSON['stringify'](_0x405080));});};exports['outbound']=function(_0x31bd8b,_0x192db5,_0x2b9f49,_0x14e317,_0x12178b,_0x20710d,_0x308094){var _0xefe326,_0x4a7154,_0x440e9b,_0x3d36a4;_0x20710d[_0xb68e('0x4f')]=intUtil['stripTrailingSlash'](_0x20710d[_0xb68e('0x4f')]);_0x20710d[_0xb68e('0x50')]=intUtil[_0xb68e('0x51')](_0x20710d[_0xb68e('0x50')]);def[_0xb68e('0x52')]=util[_0xb68e('0x26')](_0xb68e('0x53'),_0x20710d[_0xb68e('0x4f')]);if(_0x308094&&_0x308094[_0xb68e('0x66')]&&_0x308094['recordingFormat']!==_0xb68e('0x67')){logger['info'](_0xb68e('0x68'),_0xb68e('0x55'));_0x192db5[_0xb68e('0x56')]=util[_0xb68e('0x26')](_0xb68e('0x69'),_0x20710d['serverUrl'],_0x192db5[_0xb68e('0x57')],md5(_0x192db5[_0xb68e('0x57')]));}return getConnection(_0x20710d)['then'](function(_0x94d9da){_0x3d36a4=_0x94d9da;return getUser(_0x20710d,_0x14e317['name'],_0x3d36a4);})['then'](function(_0x4f391f){_0xefe326=_0x4f391f;logger[_0xb68e('0xc')](_0xb68e('0x58'),_0xefe326['id']);return getEndUser(_0x20710d,_0x192db5[_0xb68e('0x6a')],_0x192db5[_0xb68e('0x6b')],_0x3d36a4);})[_0xb68e('0x29')](function(_0x2906e2){_0x4a7154=_0x2906e2;logger[_0xb68e('0xc')]('The\x20Enduser\x20ID\x20is:',_0x4a7154['id']);return getTicket(_0x20710d,_0xefe326,_0x4a7154,_0x2b9f49,_0x192db5,_0x2b9f49[_0xb68e('0x5b')],_0x3d36a4,_0xb68e('0x6c'));})['then'](function(_0x47057e){_0x440e9b=_0x47057e;logger[_0xb68e('0xc')](_0xb68e('0x5c'));logger[_0xb68e('0xc')]('The\x20Ticket\x20ID\x20is:',_0x440e9b['id']);return setRelationship(_0x3d36a4,_0xefe326,_0x440e9b,_0xb68e('0x5d'));})[_0xb68e('0x29')](function(){return setRelationship(_0x3d36a4,_0x4a7154,_0x440e9b,_0xb68e('0x5e'));})['then'](function(){return getServerInfo(_0x3d36a4);})['then'](function(_0x4159b8){var _0x28189e=parseInt(_0x4159b8[_0xb68e('0x5f')][_0xb68e('0x60')](0x0));var _0x29880a=util[_0xb68e('0x26')](_0xb68e('0x6d'),_0x20710d[_0xb68e('0x4f')],_0x440e9b['id']);if(_0x28189e>0x6){_0x29880a=util['format'](_0xb68e('0x61'),_0x20710d[_0xb68e('0x4f')],_0x440e9b['id']);}logger[_0xb68e('0xc')](_0xb68e('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb68e('0x6e'),_0x14e317[_0xb68e('0xd')]),_0xb68e('0x63'),{'uri':_0x29880a});})[_0xb68e('0x64')](function(_0x21cd02){logger[_0xb68e('0x65')](_0xb68e('0x68'),JSON[_0xb68e('0x1e')](_0x21cd02));});};exports[_0xb68e('0x6f')]=function(_0x432f7b,_0x513589,_0x49a42f,_0x494ebc,_0x18bdb6,_0x768e0f){var _0x16cddd,_0x225ee5,_0x4118a5,_0x22ccd6;_0x768e0f[_0xb68e('0x4f')]=intUtil[_0xb68e('0x51')](_0x768e0f[_0xb68e('0x4f')]);_0x768e0f[_0xb68e('0x50')]=intUtil[_0xb68e('0x51')](_0x768e0f[_0xb68e('0x50')]);def[_0xb68e('0x52')]=util[_0xb68e('0x26')](_0xb68e('0x53'),_0x768e0f['remoteUri']);if(_0x18bdb6&&_0x18bdb6[_0xb68e('0x54')]){logger[_0xb68e('0xc')]('['+_0x513589[_0xb68e('0x70')][_0xb68e('0x71')]()+']',_0xb68e('0x55'));_0x513589[_0xb68e('0x56')]=util[_0xb68e('0x26')](_0xb68e('0x69'),_0x768e0f['serverUrl'],_0x513589[_0xb68e('0x57')],md5(_0x513589[_0xb68e('0x57')]));}else{_0x513589[_0xb68e('0x56')]='';}return getConnection(_0x768e0f)[_0xb68e('0x29')](function(_0x54bbae){_0x22ccd6=_0x54bbae;if(!_['isNil'](_0x494ebc)){return getUser(_0x768e0f,_0x494ebc[_0xb68e('0xd')],_0x22ccd6);}else{return getUser(_0x768e0f,null,_0x22ccd6);}})[_0xb68e('0x29')](function(_0x26160b){_0x16cddd=_0x26160b;logger[_0xb68e('0xc')]('The\x20User\x20ID\x20is:',_0x16cddd['id']);return getEndUser(_0x768e0f,_0x513589[_0xb68e('0x59')],_0x513589[_0xb68e('0x72')],_0x22ccd6);})[_0xb68e('0x29')](function(_0xba07d0){_0x225ee5=_0xba07d0;logger[_0xb68e('0xc')](_0xb68e('0x5a'),_0x225ee5['id']);return getTicket(_0x768e0f,_0x16cddd,_0x225ee5,_0x49a42f,_0x513589,_0x49a42f['Fields'],_0x22ccd6,'Inbound');})['then'](function(_0x18974f){_0x4118a5=_0x18974f;logger['info']('Ticket\x20created!');logger[_0xb68e('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4118a5['id']);return setRelationship(_0x22ccd6,_0x16cddd,_0x4118a5,'users');})[_0xb68e('0x29')](function(){return setRelationship(_0x22ccd6,_0x225ee5,_0x4118a5,'contacts');})[_0xb68e('0x29')](function(){return getServerInfo(_0x22ccd6);})[_0xb68e('0x64')](function(_0x4a9206){logger[_0xb68e('0x65')]('['+_0x513589[_0xb68e('0x70')][_0xb68e('0x71')]()+']',JSON[_0xb68e('0x1e')](_0x4a9206));});};
\ No newline at end of file
index 073667d..b08ebec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2900=['variable','variableName','toString','type','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','push','content'];(function(_0x54ba04,_0x8f8b5b){var _0x40a3e1=function(_0x48bbe9){while(--_0x48bbe9){_0x54ba04['push'](_0x54ba04['shift']());}};_0x40a3e1(++_0x8f8b5b);}(_0x2900,0xa6));var _0x0290=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0x2900[_0x585d09];return _0x7d9a14;};'use strict';var _=require(_0x0290('0x0'));var util=require(_0x0290('0x1'));exports[_0x0290('0x2')]=function(_0x22126b,_0x236642,_0x44fb9b){var _0x5389e2=[];if(_0x22126b[_0x0290('0x3')]>0x0){var _0x362d5e=_[_0x0290('0x4')](_0x22126b,['id']);for(var _0x50cf9f=0x0;_0x50cf9f<_0x362d5e[_0x0290('0x3')];_0x50cf9f++){var _0xb59be5=_0x362d5e[_0x50cf9f];if(_0xb59be5['type']===_0x0290('0x5')){_0x5389e2[_0x0290('0x6')](_0xb59be5[_0x0290('0x7')]);}else if(_0xb59be5['type']===_0x0290('0x8')&&_0xb59be5[_0x0290('0x9')]){_0x236642[_0xb59be5[_0x0290('0x9')]]&&_0x5389e2[_0x0290('0x6')](_0x236642[_0xb59be5[_0x0290('0x9')]][_0x0290('0xa')]());}else if(_0xb59be5[_0x0290('0xb')]===_0x0290('0xc')&&_0xb59be5['Variable']&&_0xb59be5[_0x0290('0xd')][_0x0290('0xe')]){_0x236642[_0xb59be5['Variable'][_0x0290('0xe')][_0x0290('0xf')]()]&&_0x5389e2['push'](_0x236642[_0xb59be5[_0x0290('0xd')][_0x0290('0xe')][_0x0290('0xf')]()][_0x0290('0xa')]());}else if(_0xb59be5[_0x0290('0xb')]===_0x0290('0x10')){if(_0xb59be5[_0x0290('0x11')]===_0x0290('0x5')&&_0xb59be5[_0x0290('0x12')]){_0x5389e2[_0x0290('0x6')](util[_0x0290('0x13')](_0x0290('0x14'),_0xb59be5[_0x0290('0x12')],_0xb59be5['keyContent']));}else if(_0xb59be5['keyType']===_0x0290('0x8')&&_0xb59be5[_0x0290('0x9')]&&_0xb59be5[_0x0290('0x12')]){_0x236642[_0xb59be5[_0x0290('0x9')]]&&_0x5389e2[_0x0290('0x6')](util[_0x0290('0x13')](_0x0290('0x14'),_0xb59be5['key'],_0x236642[_0xb59be5[_0x0290('0x9')]]));}else if(_0xb59be5['keyType']===_0x0290('0xc')&&_0xb59be5['Variable']&&_0xb59be5[_0x0290('0xd')][_0x0290('0xe')]&&_0xb59be5[_0x0290('0x12')]){_0x236642[_0xb59be5['Variable'][_0x0290('0xe')][_0x0290('0xf')]()]&&_0x5389e2[_0x0290('0x6')](util[_0x0290('0x13')](_0x0290('0x14'),_0xb59be5['key'],_0x236642[_0xb59be5[_0x0290('0xd')]['name'][_0x0290('0xf')]()]));}}}}return _0x5389e2[_0x0290('0x15')](_0x44fb9b);};exports[_0x0290('0x16')]=function(_0xd57b1e){var _0x1e5a5d=_0xd57b1e[_0x0290('0x17')](-0x1);if(_0x1e5a5d==='/'){_0xd57b1e=_0xd57b1e[_0x0290('0x18')](0x0,_0xd57b1e[_0x0290('0x19')](_0x1e5a5d));}return _0xd57b1e;};exports[_0x0290('0x1a')]=function(_0x395e4e){if(!_[_0x0290('0x1b')](_0x395e4e)&&_0x395e4e!==''){var _0x2c5b8a=/^(([^<>()\[\]\\.,;:\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 _0x2c5b8a[_0x0290('0x1c')](String(_0x395e4e)[_0x0290('0xf')]());}else{return![];}};
\ No newline at end of file
+var _0x06c5=['validateEmail','isNil','getString','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent','stripTrailingSlash','slice','substring','lastIndexOf'];(function(_0xcdefdc,_0x435194){var _0x45f1d0=function(_0x138d80){while(--_0x138d80){_0xcdefdc['push'](_0xcdefdc['shift']());}};_0x45f1d0(++_0x435194);}(_0x06c5,0xb8));var _0x506c=function(_0x575773,_0xdb6c6c){_0x575773=_0x575773-0x0;var _0x4d9aff=_0x06c5[_0x575773];return _0x4d9aff;};'use strict';var _=require('lodash');var util=require('util');exports[_0x506c('0x0')]=function(_0x563acf,_0x29d8a2,_0x5970e1){var _0x3717f1=[];if(_0x563acf[_0x506c('0x1')]>0x0){var _0x3f4e99=_[_0x506c('0x2')](_0x563acf,['id']);for(var _0x6ce9f1=0x0;_0x6ce9f1<_0x3f4e99['length'];_0x6ce9f1++){var _0x454353=_0x3f4e99[_0x6ce9f1];if(_0x454353['type']===_0x506c('0x3')){_0x3717f1[_0x506c('0x4')](_0x454353[_0x506c('0x5')]);}else if(_0x454353[_0x506c('0x6')]===_0x506c('0x7')&&_0x454353['variableName']){_0x29d8a2[_0x454353[_0x506c('0x8')]]&&_0x3717f1[_0x506c('0x4')](_0x29d8a2[_0x454353['variableName']][_0x506c('0x9')]());}else if(_0x454353['type']===_0x506c('0xa')&&_0x454353['Variable']&&_0x454353[_0x506c('0xb')]['name']){_0x29d8a2[_0x454353[_0x506c('0xb')][_0x506c('0xc')][_0x506c('0xd')]()]&&_0x3717f1[_0x506c('0x4')](_0x29d8a2[_0x454353['Variable']['name'][_0x506c('0xd')]()][_0x506c('0x9')]());}else if(_0x454353[_0x506c('0x6')]===_0x506c('0xe')){if(_0x454353[_0x506c('0xf')]===_0x506c('0x3')&&_0x454353['key']){_0x3717f1[_0x506c('0x4')](util[_0x506c('0x10')](_0x506c('0x11'),_0x454353[_0x506c('0x12')],_0x454353[_0x506c('0x13')]));}else if(_0x454353[_0x506c('0xf')]===_0x506c('0x7')&&_0x454353[_0x506c('0x8')]&&_0x454353['key']){_0x29d8a2[_0x454353[_0x506c('0x8')]]&&_0x3717f1['push'](util[_0x506c('0x10')](_0x506c('0x11'),_0x454353['key'],_0x29d8a2[_0x454353[_0x506c('0x8')]]));}else if(_0x454353[_0x506c('0xf')]===_0x506c('0xa')&&_0x454353['Variable']&&_0x454353[_0x506c('0xb')]['name']&&_0x454353[_0x506c('0x12')]){_0x29d8a2[_0x454353[_0x506c('0xb')][_0x506c('0xc')][_0x506c('0xd')]()]&&_0x3717f1[_0x506c('0x4')](util[_0x506c('0x10')](_0x506c('0x11'),_0x454353[_0x506c('0x12')],_0x29d8a2[_0x454353[_0x506c('0xb')][_0x506c('0xc')][_0x506c('0xd')]()]));}}}}return _0x3717f1['join'](_0x5970e1);};exports[_0x506c('0x14')]=function(_0x59a1b3){var _0x1c1670=_0x59a1b3[_0x506c('0x15')](-0x1);if(_0x1c1670==='/'){_0x59a1b3=_0x59a1b3[_0x506c('0x16')](0x0,_0x59a1b3[_0x506c('0x17')](_0x1c1670));}return _0x59a1b3;};exports[_0x506c('0x18')]=function(_0x500dce){if(!_[_0x506c('0x19')](_0x500dce)&&_0x500dce!==''){var _0x342baf=/^(([^<>()\[\]\\.,;:\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 _0x342baf['test'](String(_0x500dce)['toLowerCase']());}else{return![];}};
\ No newline at end of file
index 07f7506..b4dc144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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
+var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','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','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x225936,_0x5387c7){var _0x1b0dd5=function(_0x4dd68d){while(--_0x4dd68d){_0x225936['push'](_0x225936['shift']());}};_0x1b0dd5(++_0x5387c7);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
index 3639b38..2157f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6190=['The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','./util','../../../../config/logger','zendesk','defaults','socket.io-emitter','redis','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','map','string','picklist','type','nameField','customField','content','idField','custom_fields','push','variableName','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x11b20f,_0x346adb){var _0x50be8a=function(_0x144c7b){while(--_0x144c7b){_0x11b20f['push'](_0x11b20f['shift']());}};_0x50be8a(++_0x346adb);}(_0x6190,0x1c6));var _0x0619=function(_0x55cf4e,_0x2b825d){_0x55cf4e=_0x55cf4e-0x0;var _0x2bb6b8=_0x6190[_0x55cf4e];return _0x2bb6b8;};'use strict';var _=require(_0x0619('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x0619('0x1'));var Redis=require('ioredis');var intUtil=require(_0x0619('0x2'));var config=require('../../../../config/environment');var logger=require(_0x0619('0x3'))(_0x0619('0x4'));config['redis']=_[_0x0619('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0619('0x6'))(new Redis(config[_0x0619('0x7')]));function emit(_0x4d1a89,_0x155ba1,_0x21ca4f){io['to'](_0x4d1a89)[_0x0619('0x8')](_0x155ba1,_0x21ca4f);}var headers={'Content-Type':'application/json','Accept':_0x0619('0x9')};function getTicket(_0x104ddc,_0x261d51,_0x53e50d,_0x1f740f,_0x2e1187){logger[_0x0619('0xa')](_0x0619('0xb'));return request({'uri':util[_0x0619('0xc')]('%s/tickets.json',_0x104ddc[_0x0619('0xd')]),'method':_0x0619('0xe'),'body':{'ticket':_[_0x0619('0xf')]({'requester_id':_0x53e50d['id'],'submitter_id':_0x261d51?_0x261d51['id']:undefined,'assignee_id':_0x261d51?_0x261d51['id']:undefined,'tags':getTags(_0x1f740f[_0x0619('0x10')],_0x0619('0x11')),'subject':intUtil[_0x0619('0x12')](_0x1f740f[_0x0619('0x13')],_0x2e1187,'\x20'),'description':intUtil[_0x0619('0x12')](_0x1f740f[_0x0619('0x14')],_0x2e1187,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0619('0x12')](_0x1f740f['Descriptions'],_0x2e1187,'\x0a')}},getCustomFields(_0x1f740f[_0x0619('0x15')],_0x2e1187))}})[_0x0619('0x16')](function(_0x2101d6){logger['info'](_0x0619('0x17'));return _0x2101d6['ticket'];});}function getUser(_0x24e090,_0x238d9b){if(intUtil[_0x0619('0x18')](_0x238d9b)){logger[_0x0619('0xa')](_0x0619('0x19'),_0x238d9b);return request({'uri':util[_0x0619('0xc')]('%s/search.json',_0x24e090[_0x0619('0xd')]),'qs':{'query':util[_0x0619('0xc')](_0x0619('0x1a'),_0x238d9b)}})['then'](function(_0x3a6eb3){if(_0x3a6eb3[_0x0619('0x1b')]){logger[_0x0619('0xa')](_0x0619('0x1c'));return _[_0x0619('0x1d')](_0x3a6eb3[_0x0619('0x1e')],{'email':_0x238d9b,'role':'agent'});}else{logger[_0x0619('0xa')](_0x0619('0x1f'));return request({'uri':util['format'](_0x0619('0x20'),_0x24e090[_0x0619('0xd')])})[_0x0619('0x16')](function(_0x1d258b){logger[_0x0619('0xa')](_0x0619('0x21'));return _0x1d258b[_0x0619('0x22')];});}});}else{logger[_0x0619('0xa')](_0x0619('0x1f'));return request({'uri':util['format'](_0x0619('0x20'),_0x24e090['remoteUri'])})[_0x0619('0x16')](function(_0xf3a9a1){logger['info']('Admin\x20account\x20selected.');return _0xf3a9a1[_0x0619('0x22')];});}}function getEndUser(_0x5a612b,_0x2cdc70,_0x4d6339){logger[_0x0619('0xa')](_0x0619('0x23'),_0x4d6339);return request({'uri':util[_0x0619('0xc')](_0x0619('0x24'),_0x5a612b[_0x0619('0xd')]),'qs':{'query':util[_0x0619('0xc')](_0x0619('0x25'),_0x4d6339)}})[_0x0619('0x16')](function(_0x5a2c05){var _0x19cce2;if(_0x5a2c05[_0x0619('0x1e')]['length']){_0x5a2c05[_0x0619('0x1e')]=_['filter'](_0x5a2c05[_0x0619('0x1e')],{'suspended':![],'role':_0x0619('0x26')});if(_0x5a2c05[_0x0619('0x1e')][_0x0619('0x27')]){_0x19cce2=_['first'](_0x5a2c05['results']);}}if(_0x19cce2){logger['info'](_0x0619('0x28'));return _0x19cce2;}else{logger['info'](_0x0619('0x29'));return request({'uri':util[_0x0619('0xc')](_0x0619('0x2a'),_0x5a612b[_0x0619('0xd')]),'method':_0x0619('0xe'),'body':{'user':{'role':_0x0619('0x26'),'name':util[_0x0619('0xc')](_0x0619('0x2b'),_0x2cdc70||_0x4d6339),'phone':_0x4d6339}}})[_0x0619('0x16')](function(_0x2e4e01){logger[_0x0619('0xa')](_0x0619('0x2c'));return _0x2e4e01[_0x0619('0x22')];});}});}function getAuth(_0x3f789f){var _0xed2507;if(_0x3f789f[_0x0619('0x2d')]==='password'){_0xed2507=util[_0x0619('0xc')](_0x0619('0x2e'),_0x3f789f[_0x0619('0x2f')],_0x3f789f[_0x0619('0x30')]);}else if(_0x3f789f[_0x0619('0x2d')]===_0x0619('0x31')){_0xed2507=util['format'](_0x0619('0x32'),_0x3f789f[_0x0619('0x2f')],_0x3f789f[_0x0619('0x31')]);}return util[_0x0619('0xc')](_0x0619('0x33'),new Buffer(_0xed2507)[_0x0619('0x34')](_0x0619('0x35')));}function request(_0x1b0996){logger['debug'](_0x0619('0x36'),JSON[_0x0619('0x37')](_0x1b0996));return rp(_[_0x0619('0x5')](_0x1b0996,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x39992e,_0x20dfc6){var _0x25694d=[];if(_0x39992e&&_0x39992e['length']>0x0){_0x25694d=_[_0x0619('0x38')](_0x39992e,_0x20dfc6);}return _0x25694d;}function getCustomFields(_0x2efbf3,_0xd5a401){var _0x2b3eeb=[];var _0x188fa3={'custom_fields':[]};if(_0x2efbf3['length']>0x0){_['forEach'](_0x2efbf3,function(_0x12f523){if(_['includes']([_0x0619('0x39'),_0x0619('0x3a')],_0x12f523[_0x0619('0x3b')])&&_0x12f523[_0x0619('0x3c')]&&!_0x12f523[_0x0619('0x3d')]){_0x188fa3[_0x12f523[_0x0619('0x3c')]['toLowerCase']()]=_0x12f523[_0x0619('0x3e')][_0x0619('0x34')]();}else if(_['includes']([_0x0619('0x39'),_0x0619('0x3a')],_0x12f523[_0x0619('0x3b')])&&_0x12f523[_0x0619('0x3f')]&&_0x12f523[_0x0619('0x3d')]){_0x188fa3[_0x0619('0x40')][_0x0619('0x41')]({'id':_0x12f523[_0x0619('0x3f')],'value':_0x12f523[_0x0619('0x3e')][_0x0619('0x34')]()});}else if(_0x12f523[_0x0619('0x3b')]==='variable'&&_0x12f523[_0x0619('0x42')]&&_0x12f523[_0x0619('0x3f')]&&_0x12f523[_0x0619('0x3d')]){_0xd5a401[_0x12f523[_0x0619('0x42')]]&&_0x188fa3['custom_fields'][_0x0619('0x41')]({'id':_0x12f523[_0x0619('0x3f')],'value':_0xd5a401[_0x12f523[_0x0619('0x42')]][_0x0619('0x34')]()});}else if(_0x12f523[_0x0619('0x3b')]==='customVariable'&&_0x12f523[_0x0619('0x43')]&&_0x12f523['Variable']['name']&&_0x12f523[_0x0619('0x3f')]&&_0x12f523[_0x0619('0x3d')]){_0xd5a401[_0x12f523[_0x0619('0x43')][_0x0619('0x11')][_0x0619('0x44')]()]&&_0x188fa3[_0x0619('0x40')]['push']({'id':_0x12f523[_0x0619('0x3f')],'value':_0xd5a401[_0x12f523[_0x0619('0x43')][_0x0619('0x11')][_0x0619('0x44')]()][_0x0619('0x34')]()});}});}return _0x188fa3;}exports['queue']=function(_0x2445eb,_0x164995,_0x2a32ab,_0x24b113,_0x309856,_0x4a7858){var _0x15588a,_0x467394;_0x4a7858['remoteUri']=intUtil[_0x0619('0x45')](_0x4a7858[_0x0619('0xd')]);_0x4a7858[_0x0619('0x46')]=intUtil[_0x0619('0x45')](_0x4a7858[_0x0619('0x46')]);if(_0x309856&&_0x309856[_0x0619('0x47')]){logger[_0x0619('0xa')]('[QUEUE]',_0x0619('0x48'));_0x164995[_0x0619('0x49')]=util[_0x0619('0xc')](_0x0619('0x4a'),_0x4a7858['serverUrl'],_0x164995[_0x0619('0x4b')],md5(_0x164995['uniqueid']));}else{_0x164995[_0x0619('0x49')]='';}headers[_0x0619('0x4c')]=getAuth(_0x4a7858);return getUser(_0x4a7858,_0x24b113['email'])[_0x0619('0x16')](function(_0x4d76e5){_0x15588a=_0x4d76e5;logger['info'](_0x0619('0x4d'),_0x15588a['id']);return getEndUser(_0x4a7858,_0x164995[_0x0619('0x4e')],_0x164995[_0x0619('0x4f')]);})[_0x0619('0x16')](function(_0xe364c4){_0x467394=_0xe364c4;logger['info'](_0x0619('0x50'),_0x467394['id']);return getTicket(_0x4a7858,_0x15588a,_0x467394,_0x2a32ab,_0x164995);})[_0x0619('0x16')](function(_0x217326){if(_0x217326){logger[_0x0619('0xa')](_0x0619('0x51'),_0x217326['id']);switch(_0x4a7858[_0x0619('0x3b')]){case _0x0619('0x52'):logger[_0x0619('0xa')](_0x0619('0x53'),_0x0619('0x54'));return request({'uri':util[_0x0619('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4a7858[_0x0619('0xd')],_0x15588a['id'],_0x217326['id']),'method':'POST'});case _0x0619('0x55'):logger[_0x0619('0xa')](_0x0619('0x53'),_0x0619('0x56'));emit(util[_0x0619('0xc')](_0x0619('0x57'),_0x24b113[_0x0619('0x11')]),_0x0619('0x58'),{'uri':util[_0x0619('0xc')](_0x0619('0x59'),_0x4a7858[_0x0619('0xd')][_0x0619('0x5a')](_0x0619('0x5b'),''),_0x217326['id'])});break;default:logger['error'](_0x0619('0x53'),_0x0619('0x5c'));}}})[_0x0619('0x5d')](function(_0x5b6b26){logger[_0x0619('0x5e')](_0x0619('0x5f'),util[_0x0619('0x60')](_0x5b6b26,{'showHidden':!![],'depth':null}));});};exports[_0x0619('0x61')]=function(_0x1524b7,_0xfe219b,_0x220452,_0x143dcc,_0x288721,_0x13f346,_0x4aa185){var _0x17ea54,_0x18c756;_0x13f346['remoteUri']=intUtil['stripTrailingSlash'](_0x13f346['remoteUri']);_0x13f346[_0x0619('0x46')]=intUtil[_0x0619('0x45')](_0x13f346[_0x0619('0x46')]);if(_0x4aa185&&_0x4aa185[_0x0619('0x62')]&&_0x4aa185[_0x0619('0x62')]!=='none'){logger[_0x0619('0xa')](_0x0619('0x63'),_0x0619('0x48'));_0xfe219b[_0x0619('0x49')]=util[_0x0619('0xc')](_0x0619('0x4a'),_0x13f346[_0x0619('0x46')],_0xfe219b[_0x0619('0x4b')],md5(_0xfe219b[_0x0619('0x4b')]));}headers[_0x0619('0x4c')]=getAuth(_0x13f346);return getUser(_0x13f346,_0x143dcc[_0x0619('0x64')])[_0x0619('0x16')](function(_0x2762e5){_0x17ea54=_0x2762e5;logger['info'](_0x0619('0x4d'),_0x17ea54['id']);return getEndUser(_0x13f346,_0xfe219b[_0x0619('0x65')],_0xfe219b[_0x0619('0x66')]);})['then'](function(_0x583260){_0x18c756=_0x583260;logger[_0x0619('0xa')]('The\x20Enduser\x20ID\x20is:',_0x18c756['id']);return getTicket(_0x13f346,_0x17ea54,_0x18c756,_0x220452,_0xfe219b);})[_0x0619('0x16')](function(_0x2d165b){if(_0x2d165b){logger[_0x0619('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2d165b['id']);switch(_0x13f346[_0x0619('0x3b')]){case'integrationTab':logger[_0x0619('0xa')](_0x0619('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x13f346[_0x0619('0xd')],_0x17ea54['id'],_0x2d165b['id']),'method':_0x0619('0xe')});case _0x0619('0x55'):logger[_0x0619('0xa')](_0x0619('0x63'),_0x0619('0x56'));emit(util['format']('user:%s',_0x143dcc['name']),'trigger:browser:url',{'uri':util['format'](_0x0619('0x59'),_0x13f346[_0x0619('0xd')][_0x0619('0x5a')](_0x0619('0x5b'),''),_0x2d165b['id'])});break;default:logger['error'](_0x0619('0x63'),_0x0619('0x5c'));}}})['catch'](function(_0x573e00){logger[_0x0619('0x5e')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x0619('0x60')](_0x573e00,{'showHidden':!![],'depth':null}));});};exports[_0x0619('0x67')]=function(_0x4789d6,_0x2c3a42,_0x544409,_0x163ed2,_0x28bc3e,_0x2161eb){var _0x516ef3,_0x4be463;_0x2161eb[_0x0619('0xd')]=intUtil['stripTrailingSlash'](_0x2161eb[_0x0619('0xd')]);_0x2161eb[_0x0619('0x46')]=intUtil[_0x0619('0x45')](_0x2161eb['serverUrl']);if(_0x28bc3e&&_0x28bc3e[_0x0619('0x47')]){logger['info']('['+_0x2c3a42['lastevent'][_0x0619('0x68')]()+']',_0x0619('0x48'));_0x2c3a42[_0x0619('0x49')]=util['format'](_0x0619('0x4a'),_0x2161eb[_0x0619('0x46')],_0x2c3a42[_0x0619('0x4b')],md5(_0x2c3a42[_0x0619('0x4b')]));}else{_0x2c3a42[_0x0619('0x49')]='';}headers[_0x0619('0x4c')]=getAuth(_0x2161eb);return getUser(_0x2161eb)[_0x0619('0x16')](function(_0x5d37ec){_0x516ef3=_0x5d37ec;logger[_0x0619('0xa')](_0x0619('0x4d'),_0x516ef3['id']);return getEndUser(_0x2161eb,_0x2c3a42[_0x0619('0x4e')],_0x2c3a42[_0x0619('0x4f')]);})[_0x0619('0x16')](function(_0x4080d5){_0x4be463=_0x4080d5;logger[_0x0619('0xa')](_0x0619('0x50'),_0x4be463['id']);return getTicket(_0x2161eb,_0x516ef3,_0x4be463,_0x544409,_0x2c3a42);})['then'](function(_0x48861f){if(_0x48861f){logger[_0x0619('0xa')]('The\x20Ticket\x20ID\x20is:',_0x48861f['id']);}})[_0x0619('0x5d')](function(_0x55757a){logger[_0x0619('0x5e')]('['+_0x2c3a42[_0x0619('0x69')][_0x0619('0x68')]()+']'+_0x0619('0x6a'),util[_0x0619('0x60')](_0x55757a,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x6d8b=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','replace','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Descriptions','Fields','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!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','%s:%s','username','password','authType','token','%s/token:%s','toString','base64','debug','[HTTP]','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x6d8b,0x106));var _0xb6d8=function(_0x143cd5,_0x3dfd3f){_0x143cd5=_0x143cd5-0x0;var _0x1ee635=_0x6d8b[_0x143cd5];return _0x1ee635;};'use strict';var _=require(_0xb6d8('0x0'));var rp=require(_0xb6d8('0x1'));var md5=require(_0xb6d8('0x2'));var util=require(_0xb6d8('0x3'));var Redis=require(_0xb6d8('0x4'));var intUtil=require('./util');var config=require(_0xb6d8('0x5'));var logger=require(_0xb6d8('0x6'))('zendesk');config[_0xb6d8('0x7')]=_[_0xb6d8('0x8')](config[_0xb6d8('0x7')],{'host':_0xb6d8('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb6d8('0x7')]));function emit(_0x299e54,_0x38bd24,_0x2bceac){io['to'](_0x299e54)[_0xb6d8('0xa')](_0x38bd24,_0x2bceac);}var headers={'Content-Type':_0xb6d8('0xb'),'Accept':_0xb6d8('0xb')};function getTicket(_0x4b6328,_0x87986a,_0x27f3b8,_0x36a120,_0x564583){logger[_0xb6d8('0xc')](_0xb6d8('0xd'));return request({'uri':util[_0xb6d8('0xe')](_0xb6d8('0xf'),_0x4b6328[_0xb6d8('0x10')]),'method':'POST','body':{'ticket':_[_0xb6d8('0x11')]({'requester_id':_0x27f3b8['id'],'submitter_id':_0x87986a?_0x87986a['id']:undefined,'assignee_id':_0x87986a?_0x87986a['id']:undefined,'tags':getTags(_0x36a120[_0xb6d8('0x12')],_0xb6d8('0x13')),'subject':intUtil[_0xb6d8('0x14')](_0x36a120['Subjects'],_0x564583,'\x20'),'description':intUtil['getString'](_0x36a120[_0xb6d8('0x15')],_0x564583,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb6d8('0x14')](_0x36a120[_0xb6d8('0x15')],_0x564583,'\x0a')}},getCustomFields(_0x36a120[_0xb6d8('0x16')],_0x564583))}})[_0xb6d8('0x17')](function(_0x3a9615){logger[_0xb6d8('0xc')](_0xb6d8('0x18'));return _0x3a9615[_0xb6d8('0x19')];});}function getUser(_0x15d30a,_0x1bed23){if(intUtil['validateEmail'](_0x1bed23)){logger[_0xb6d8('0xc')](_0xb6d8('0x1a'),_0x1bed23);return request({'uri':util[_0xb6d8('0xe')](_0xb6d8('0x1b'),_0x15d30a['remoteUri']),'qs':{'query':util[_0xb6d8('0xe')](_0xb6d8('0x1c'),_0x1bed23)}})[_0xb6d8('0x17')](function(_0x596668){if(_0x596668[_0xb6d8('0x1d')]){logger[_0xb6d8('0xc')](_0xb6d8('0x1e'));return _[_0xb6d8('0x1f')](_0x596668[_0xb6d8('0x20')],{'email':_0x1bed23,'role':_0xb6d8('0x21')});}else{logger[_0xb6d8('0xc')](_0xb6d8('0x22'));return request({'uri':util[_0xb6d8('0xe')](_0xb6d8('0x23'),_0x15d30a[_0xb6d8('0x10')])})['then'](function(_0x5d0734){logger['info'](_0xb6d8('0x24'));return _0x5d0734[_0xb6d8('0x25')];});}});}else{logger[_0xb6d8('0xc')](_0xb6d8('0x22'));return request({'uri':util[_0xb6d8('0xe')](_0xb6d8('0x23'),_0x15d30a['remoteUri'])})[_0xb6d8('0x17')](function(_0x29db4a){logger[_0xb6d8('0xc')]('Admin\x20account\x20selected.');return _0x29db4a[_0xb6d8('0x25')];});}}function getEndUser(_0x10b0e8,_0x5185a4,_0x3525f5){logger[_0xb6d8('0xc')](_0xb6d8('0x26'),_0x3525f5);return request({'uri':util['format'](_0xb6d8('0x1b'),_0x10b0e8['remoteUri']),'qs':{'query':util[_0xb6d8('0xe')](_0xb6d8('0x27'),_0x3525f5)}})[_0xb6d8('0x17')](function(_0x394f0f){var _0x184da3;if(_0x394f0f[_0xb6d8('0x20')]['length']){_0x394f0f[_0xb6d8('0x20')]=_[_0xb6d8('0x28')](_0x394f0f[_0xb6d8('0x20')],{'suspended':![],'role':_0xb6d8('0x29')});if(_0x394f0f[_0xb6d8('0x20')][_0xb6d8('0x2a')]){_0x184da3=_['first'](_0x394f0f[_0xb6d8('0x20')]);}}if(_0x184da3){logger['info'](_0xb6d8('0x2b'));return _0x184da3;}else{logger['info'](_0xb6d8('0x2c'));return request({'uri':util[_0xb6d8('0xe')]('%s/users.json',_0x10b0e8[_0xb6d8('0x10')]),'method':'POST','body':{'user':{'role':_0xb6d8('0x29'),'name':util['format'](_0xb6d8('0x2d'),_0x5185a4||_0x3525f5),'phone':_0x3525f5}}})[_0xb6d8('0x17')](function(_0x50bd57){logger['info'](_0xb6d8('0x2e'));return _0x50bd57[_0xb6d8('0x25')];});}});}function getAuth(_0x41aa56){var _0x2cb426;if(_0x41aa56['authType']==='password'){_0x2cb426=util[_0xb6d8('0xe')](_0xb6d8('0x2f'),_0x41aa56[_0xb6d8('0x30')],_0x41aa56[_0xb6d8('0x31')]);}else if(_0x41aa56[_0xb6d8('0x32')]===_0xb6d8('0x33')){_0x2cb426=util[_0xb6d8('0xe')](_0xb6d8('0x34'),_0x41aa56[_0xb6d8('0x30')],_0x41aa56[_0xb6d8('0x33')]);}return util['format']('Basic\x20%s',new Buffer(_0x2cb426)[_0xb6d8('0x35')](_0xb6d8('0x36')));}function request(_0x357f2d){logger[_0xb6d8('0x37')](_0xb6d8('0x38'),JSON['stringify'](_0x357f2d));return rp(_[_0xb6d8('0x8')](_0x357f2d,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1b2955,_0x13b6f5){var _0x42a901=[];if(_0x1b2955&&_0x1b2955[_0xb6d8('0x2a')]>0x0){_0x42a901=_[_0xb6d8('0x39')](_0x1b2955,_0x13b6f5);}return _0x42a901;}function getCustomFields(_0x1675f3,_0x4f169b){var _0x3168be=[];var _0x827e24={'custom_fields':[]};if(_0x1675f3[_0xb6d8('0x2a')]>0x0){_[_0xb6d8('0x3a')](_0x1675f3,function(_0x11d8c6){if(_[_0xb6d8('0x3b')]([_0xb6d8('0x3c'),_0xb6d8('0x3d')],_0x11d8c6['type'])&&_0x11d8c6[_0xb6d8('0x3e')]&&!_0x11d8c6[_0xb6d8('0x3f')]){_0x827e24[_0x11d8c6[_0xb6d8('0x3e')][_0xb6d8('0x40')]()]=_0x11d8c6[_0xb6d8('0x41')][_0xb6d8('0x35')]();}else if(_[_0xb6d8('0x3b')]([_0xb6d8('0x3c'),'picklist'],_0x11d8c6[_0xb6d8('0x42')])&&_0x11d8c6[_0xb6d8('0x43')]&&_0x11d8c6['customField']){_0x827e24[_0xb6d8('0x44')][_0xb6d8('0x45')]({'id':_0x11d8c6[_0xb6d8('0x43')],'value':_0x11d8c6['content'][_0xb6d8('0x35')]()});}else if(_0x11d8c6[_0xb6d8('0x42')]===_0xb6d8('0x46')&&_0x11d8c6[_0xb6d8('0x47')]&&_0x11d8c6[_0xb6d8('0x43')]&&_0x11d8c6[_0xb6d8('0x3f')]){_0x4f169b[_0x11d8c6[_0xb6d8('0x47')]]&&_0x827e24[_0xb6d8('0x44')][_0xb6d8('0x45')]({'id':_0x11d8c6['idField'],'value':_0x4f169b[_0x11d8c6[_0xb6d8('0x47')]]['toString']()});}else if(_0x11d8c6[_0xb6d8('0x42')]===_0xb6d8('0x48')&&_0x11d8c6[_0xb6d8('0x49')]&&_0x11d8c6[_0xb6d8('0x49')][_0xb6d8('0x13')]&&_0x11d8c6[_0xb6d8('0x43')]&&_0x11d8c6[_0xb6d8('0x3f')]){_0x4f169b[_0x11d8c6[_0xb6d8('0x49')][_0xb6d8('0x13')]['toLowerCase']()]&&_0x827e24['custom_fields'][_0xb6d8('0x45')]({'id':_0x11d8c6[_0xb6d8('0x43')],'value':_0x4f169b[_0x11d8c6['Variable'][_0xb6d8('0x13')][_0xb6d8('0x40')]()]['toString']()});}});}return _0x827e24;}exports['queue']=function(_0x34b5d3,_0x1eadf2,_0x4d133b,_0x3a178d,_0x4da0,_0x3f6253){var _0x1a7efc,_0x170176;_0x3f6253[_0xb6d8('0x10')]=intUtil[_0xb6d8('0x4a')](_0x3f6253[_0xb6d8('0x10')]);_0x3f6253['serverUrl']=intUtil[_0xb6d8('0x4a')](_0x3f6253[_0xb6d8('0x4b')]);if(_0x4da0&&_0x4da0[_0xb6d8('0x4c')]){logger[_0xb6d8('0xc')](_0xb6d8('0x4d'),_0xb6d8('0x4e'));_0x1eadf2[_0xb6d8('0x4f')]=util[_0xb6d8('0xe')](_0xb6d8('0x50'),_0x3f6253[_0xb6d8('0x4b')],_0x1eadf2[_0xb6d8('0x51')],md5(_0x1eadf2['uniqueid']));}else{_0x1eadf2[_0xb6d8('0x4f')]='';}headers[_0xb6d8('0x52')]=getAuth(_0x3f6253);return getUser(_0x3f6253,_0x3a178d[_0xb6d8('0x53')])[_0xb6d8('0x17')](function(_0x115fcf){_0x1a7efc=_0x115fcf;logger[_0xb6d8('0xc')]('The\x20User\x20ID\x20is:',_0x1a7efc['id']);return getEndUser(_0x3f6253,_0x1eadf2[_0xb6d8('0x54')],_0x1eadf2[_0xb6d8('0x55')]);})[_0xb6d8('0x17')](function(_0x5e0f84){_0x170176=_0x5e0f84;logger['info'](_0xb6d8('0x56'),_0x170176['id']);return getTicket(_0x3f6253,_0x1a7efc,_0x170176,_0x4d133b,_0x1eadf2);})[_0xb6d8('0x17')](function(_0x43996c){if(_0x43996c){logger[_0xb6d8('0xc')]('The\x20Ticket\x20ID\x20is:',_0x43996c['id']);switch(_0x3f6253[_0xb6d8('0x42')]){case _0xb6d8('0x57'):logger[_0xb6d8('0xc')](_0xb6d8('0x4d'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xb6d8('0xe')](_0xb6d8('0x58'),_0x3f6253['remoteUri'],_0x1a7efc['id'],_0x43996c['id']),'method':_0xb6d8('0x59')});case _0xb6d8('0x5a'):logger['info'](_0xb6d8('0x4d'),_0xb6d8('0x5b'));emit(util[_0xb6d8('0xe')](_0xb6d8('0x5c'),_0x3a178d[_0xb6d8('0x13')]),_0xb6d8('0x5d'),{'uri':util[_0xb6d8('0xe')](_0xb6d8('0x5e'),_0x3f6253[_0xb6d8('0x10')]['replace']('/api/v2',''),_0x43996c['id'])});break;default:logger[_0xb6d8('0x5f')](_0xb6d8('0x4d'),_0xb6d8('0x60'));}}})['catch'](function(_0x4773dc){logger[_0xb6d8('0x5f')](_0xb6d8('0x61'),util[_0xb6d8('0x62')](_0x4773dc,{'showHidden':!![],'depth':null}));});};exports[_0xb6d8('0x63')]=function(_0x32e1dd,_0x561958,_0x1d948c,_0x591b0e,_0x1e9388,_0x159c9d,_0x57b1d9){var _0x340d90,_0x4edb6c;_0x159c9d['remoteUri']=intUtil[_0xb6d8('0x4a')](_0x159c9d['remoteUri']);_0x159c9d[_0xb6d8('0x4b')]=intUtil[_0xb6d8('0x4a')](_0x159c9d[_0xb6d8('0x4b')]);if(_0x57b1d9&&_0x57b1d9[_0xb6d8('0x64')]&&_0x57b1d9[_0xb6d8('0x64')]!==_0xb6d8('0x65')){logger[_0xb6d8('0xc')](_0xb6d8('0x66'),'Recording\x20is\x20enabled!');_0x561958[_0xb6d8('0x4f')]=util[_0xb6d8('0xe')](_0xb6d8('0x50'),_0x159c9d['serverUrl'],_0x561958[_0xb6d8('0x51')],md5(_0x561958[_0xb6d8('0x51')]));}headers['Authorization']=getAuth(_0x159c9d);return getUser(_0x159c9d,_0x591b0e['email'])[_0xb6d8('0x17')](function(_0x41e203){_0x340d90=_0x41e203;logger[_0xb6d8('0xc')](_0xb6d8('0x67'),_0x340d90['id']);return getEndUser(_0x159c9d,_0x561958[_0xb6d8('0x68')],_0x561958['destcalleridnum']);})[_0xb6d8('0x17')](function(_0x2e0e15){_0x4edb6c=_0x2e0e15;logger[_0xb6d8('0xc')](_0xb6d8('0x56'),_0x4edb6c['id']);return getTicket(_0x159c9d,_0x340d90,_0x4edb6c,_0x1d948c,_0x561958);})[_0xb6d8('0x17')](function(_0x2e7c90){if(_0x2e7c90){logger[_0xb6d8('0xc')](_0xb6d8('0x69'),_0x2e7c90['id']);switch(_0x159c9d['type']){case _0xb6d8('0x57'):logger[_0xb6d8('0xc')](_0xb6d8('0x66'),_0xb6d8('0x6a'));return request({'uri':util[_0xb6d8('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x159c9d[_0xb6d8('0x10')],_0x340d90['id'],_0x2e7c90['id']),'method':_0xb6d8('0x59')});case _0xb6d8('0x5a'):logger[_0xb6d8('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb6d8('0xe')](_0xb6d8('0x5c'),_0x591b0e[_0xb6d8('0x13')]),_0xb6d8('0x5d'),{'uri':util[_0xb6d8('0xe')]('%s/agent/tickets/%s',_0x159c9d['remoteUri'][_0xb6d8('0x6b')](_0xb6d8('0x6c'),''),_0x2e7c90['id'])});break;default:logger[_0xb6d8('0x5f')](_0xb6d8('0x66'),_0xb6d8('0x60'));}}})[_0xb6d8('0x6d')](function(_0x1f3158){logger[_0xb6d8('0x5f')](_0xb6d8('0x6e'),util['inspect'](_0x1f3158,{'showHidden':!![],'depth':null}));});};exports[_0xb6d8('0x6f')]=function(_0x50eed1,_0x2cb91b,_0x159d4f,_0x5db784,_0x5031be,_0x191f2e){var _0x5392d9,_0x218cd7;_0x191f2e['remoteUri']=intUtil[_0xb6d8('0x4a')](_0x191f2e['remoteUri']);_0x191f2e['serverUrl']=intUtil['stripTrailingSlash'](_0x191f2e[_0xb6d8('0x4b')]);if(_0x5031be&&_0x5031be[_0xb6d8('0x4c')]){logger[_0xb6d8('0xc')]('['+_0x2cb91b[_0xb6d8('0x70')]['toUpperCase']()+']',_0xb6d8('0x4e'));_0x2cb91b[_0xb6d8('0x4f')]=util[_0xb6d8('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x191f2e[_0xb6d8('0x4b')],_0x2cb91b[_0xb6d8('0x51')],md5(_0x2cb91b[_0xb6d8('0x51')]));}else{_0x2cb91b[_0xb6d8('0x4f')]='';}headers['Authorization']=getAuth(_0x191f2e);return getUser(_0x191f2e)['then'](function(_0x10fa4e){_0x5392d9=_0x10fa4e;logger[_0xb6d8('0xc')](_0xb6d8('0x67'),_0x5392d9['id']);return getEndUser(_0x191f2e,_0x2cb91b[_0xb6d8('0x54')],_0x2cb91b[_0xb6d8('0x55')]);})['then'](function(_0x4d9058){_0x218cd7=_0x4d9058;logger['info'](_0xb6d8('0x56'),_0x218cd7['id']);return getTicket(_0x191f2e,_0x5392d9,_0x218cd7,_0x159d4f,_0x2cb91b);})[_0xb6d8('0x17')](function(_0x551927){if(_0x551927){logger['info'](_0xb6d8('0x69'),_0x551927['id']);}})[_0xb6d8('0x6d')](function(_0x3d5de8){logger[_0xb6d8('0x5f')]('['+_0x2cb91b[_0xb6d8('0x70')][_0xb6d8('0x71')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xb6d8('0x62')](_0x3d5de8,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 69b6f90..fe9c09b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ac=['info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','users','isArrayLikeObject','findIndex','email','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','catch','enduserType','POST','/crm/v2/','startCase','role','first_name','last_name','data','code','SUCCESS','details','moduleCreate','Error:\x20','log','GET','Zoho-oauthtoken\x20','contact_lead','uri','https://www.zohoapis.','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','Call_Duration','utc','talktime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Called','Call_Result','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','Inbound','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','localhost','socket.io-emitter','redis','[HTTP]','stringify','string','picklist','idField','content','variableName','toString','type','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','Failing\x20creating\x20the\x20access_token','stack'];(function(_0x29d40f,_0x3bcd3f){var _0x17a8b2=function(_0x30fcbc){while(--_0x30fcbc){_0x29d40f['push'](_0x29d40f['shift']());}};_0x17a8b2(++_0x3bcd3f);}(_0x49ac,0x19e));var _0xc49a=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x49ac[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0xc49a('0x0'));var rp=require(_0xc49a('0x1'));var md5=require(_0xc49a('0x2'));var util=require(_0xc49a('0x3'));var intUtil=require(_0xc49a('0x4'));var moment=require(_0xc49a('0x5'));var Redis=require(_0xc49a('0x6'));var BPromise=require(_0xc49a('0x7'));var config=require(_0xc49a('0x8'));var logger=require(_0xc49a('0x9'))(_0xc49a('0xa'));config['redis']=_[_0xc49a('0xb')](config['redis'],{'host':_0xc49a('0xc'),'port':0x18eb});var io=require(_0xc49a('0xd'))(new Redis(config[_0xc49a('0xe')]));function emit(_0x457829,_0x54434d,_0x35f07d){io['to'](_0x457829)['emit'](_0x54434d,_0x35f07d);}function request(_0xec60ff){logger['debug'](_0xc49a('0xf'),JSON[_0xc49a('0x10')](_0xec60ff));return rp(_0xec60ff);}function getCustomFields(_0x463e88,_0x3713cf){var _0x7d2794={};if(_0x463e88['length']>0x0){_['forEach'](_0x463e88,function(_0x2fa3c5){if(_['includes']([_0xc49a('0x11'),_0xc49a('0x12')],_0x2fa3c5['type'])&&_0x2fa3c5[_0xc49a('0x13')]){_0x7d2794[_0x2fa3c5[_0xc49a('0x13')]]=_0x2fa3c5[_0xc49a('0x14')]['toString']();}else if(_0x2fa3c5['type']==='variable'&&_0x2fa3c5[_0xc49a('0x15')]&&_0x2fa3c5[_0xc49a('0x13')]&&_0x3713cf[_0x2fa3c5[_0xc49a('0x15')]]){_0x7d2794[_0x2fa3c5[_0xc49a('0x13')]]=_0x3713cf[_0x2fa3c5[_0xc49a('0x15')]][_0xc49a('0x16')]();}else if(_0x2fa3c5[_0xc49a('0x17')]===_0xc49a('0x18')&&_0x2fa3c5['Variable']&&_0x2fa3c5[_0xc49a('0x19')]['name']&&_0x2fa3c5[_0xc49a('0x13')]&&_0x3713cf[_0x2fa3c5[_0xc49a('0x19')][_0xc49a('0x1a')][_0xc49a('0x1b')]()]){_0x7d2794[_0x2fa3c5[_0xc49a('0x13')]]=_0x3713cf[_0x2fa3c5[_0xc49a('0x19')][_0xc49a('0x1a')][_0xc49a('0x1b')]()][_0xc49a('0x16')]();}});}return _0x7d2794;}function getName(_0x59283c){if(_0x59283c[_0xc49a('0x1c')]('\x20')>0x0){var _0x3d35d0=_0x59283c[_0xc49a('0x1d')](/ (.+)/);if(_0x3d35d0[0x1]){return _0x3d35d0;}}return[_0x59283c,_0x59283c];}var accountsTokens={};function getAccessToken(_0x302d31){return new Promise(function(_0xc1d93c,_0x534c22){if(!_[_0xc49a('0x1e')](accountsTokens[_0x302d31['id']])&&!_[_0xc49a('0x1e')](accountsTokens[_0x302d31['id']]['access_token'])){if(moment()[_0xc49a('0x1f')](accountsTokens[_0x302d31['id']][_0xc49a('0x20')])){_0xc1d93c(accountsTokens[_0x302d31['id']][_0xc49a('0x21')]);}}var _0x30654a;switch(_0x302d31['zone']){case'US':_0x30654a=_0xc49a('0x22');break;case'AU':_0x30654a=_0xc49a('0x23');break;case'EU':_0x30654a=_0xc49a('0x24');break;case'IN':_0x30654a=_0xc49a('0x25');break;case'CN':_0x30654a=_0xc49a('0x26');break;default:_0x30654a='https://accounts.zoho.eu';break;}var _0x11ac73={'method':'POST','uri':_0x30654a+'/oauth/v2/token','qs':{'refresh_token':_0x302d31[_0xc49a('0x27')],'client_id':_0x302d31[_0xc49a('0x28')],'client_secret':_0x302d31[_0xc49a('0x29')],'grant_type':_0xc49a('0x2a')},'json':!![]};return rp(_0x11ac73)[_0xc49a('0x2b')](function(_0x4130b5){accountsTokens[_0x302d31['id']]={'access_token':_0x4130b5[_0xc49a('0x21')],'expires_in':moment()[_0xc49a('0x2c')](_0x4130b5['expires_in'],_0xc49a('0x2d'))};_0xc1d93c(_0x4130b5[_0xc49a('0x21')]);})['catch'](function(_0x585987){logger['error'](_0xc49a('0x2e'),_0x585987[_0xc49a('0x2f')]);_0x534c22(_0x585987);});});}function getUser(_0x5e079c,_0x18c483,_0x32278b,_0x5ede06){logger[_0xc49a('0x30')](_0xc49a('0x31'));return request({'method':'GET','uri':util[_0xc49a('0x32')](_0xc49a('0x33'),_0x18c483),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5e079c},'json':!![]})['then'](function(_0x204dac){if(_0x204dac[_0xc49a('0x34')]){var _0x884c55=-0x1;if(_[_0xc49a('0x35')](_0x204dac['users'])){if(!_['isNil'](_0x5ede06)){_0x884c55=_[_0xc49a('0x36')](_0x204dac[_0xc49a('0x34')],function(_0xe9a171){return _0xe9a171[_0xc49a('0x37')]===_0x5ede06;});}if(_0x884c55>=0x0){logger[_0xc49a('0x30')]('Agent\x20found!');}else{logger[_0xc49a('0x30')]('Using\x20the\x20admin\x20account!');_0x884c55=_[_0xc49a('0x36')](_0x204dac['users'],function(_0x507c67){return _0x507c67[_0xc49a('0x38')][_0xc49a('0x1a')]===_0xc49a('0x39');});}return _0x204dac['users'][_0x884c55];}else{if(_0x204dac[_0xc49a('0x3a')]['profile']['name']===_0xc49a('0x39')){logger['info'](_0xc49a('0x3b'));user=_0x204dac['user'];return user;}else{logger[_0xc49a('0x3c')]('The\x20failing\x20result\x20is',JSON[_0xc49a('0x10')](_0x204dac));throw new Error(_0xc49a('0x3d')+JSON[_0xc49a('0x10')](_0x204dac));}}}else{logger[_0xc49a('0x3c')](_0xc49a('0x3e'),JSON[_0xc49a('0x10')](_0x204dac));throw new Error(_0xc49a('0x3d')+JSON[_0xc49a('0x10')](_0x204dac));}})[_0xc49a('0x3f')](function(_0xeca4f8){console[_0xc49a('0x3c')](_0xeca4f8);});}function getZohoUser(_0x584ecf,_0x1af667){return new BPromise(function(_0x19b732,_0x175725){request(_0x584ecf)[_0xc49a('0x2b')](function(_0x4e863a){var _0x1d7de0=null;if(_0x4e863a){_0x1d7de0=_0x4e863a['data'][0x0];_0x1d7de0[_0xc49a('0x40')]=_0x1af667;}_0x19b732(_0x1d7de0);})[_0xc49a('0x3f')](function(_0x45cbde){_0x175725(_0x45cbde);});});}function createEndUser(_0x55aab6,_0x595c55,_0x299765,_0x3d1688,_0x87335,_0x4a051e){var _0x299765=getName(_0x299765);return request({'method':_0xc49a('0x41'),'uri':'https://www.zohoapis.'+_0x595c55+_0xc49a('0x42')+_[_0xc49a('0x43')](_0x4a051e['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x299765[0x1],'First_Name':_0x299765[0x0],'Phone':_0x3d1688,'Owner':{'name':!_[_0xc49a('0x1e')](_0x87335[_0xc49a('0x44')][_0xc49a('0x1a')])?_0x87335['role'][_0xc49a('0x1a')]:!_[_0xc49a('0x1e')](_0x87335[_0xc49a('0x45')])?_0x87335['first_name']+'\x20'+_0x87335[_0xc49a('0x46')]:_0x87335[_0xc49a('0x46')],'id':_0x87335['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x55aab6},'json':!![]})['then'](function(_0x317383){if(_0x317383&&_0x317383[_0xc49a('0x47')][0x0][_0xc49a('0x48')]===_0xc49a('0x49')){var _0x486b58=_0x317383[_0xc49a('0x47')][0x0][_0xc49a('0x4a')];_0x486b58[_0xc49a('0x40')]=_[_0xc49a('0x43')](_0x4a051e[_0xc49a('0x4b')])+'s';return _0x486b58;}logger[_0xc49a('0x3c')]('The\x20failing\x20result\x20is',JSON[_0xc49a('0x10')](data));throw new Error(_0xc49a('0x4c')+JSON['stringify'](data));})[_0xc49a('0x3f')](function(_0x22f22f){console[_0xc49a('0x4d')]('CREATE\x20ERROR',_0x22f22f);});}function getEndUser(_0x35b0f6,_0x1af0cf,_0xf86bf9,_0x4e1dab,_0x4db390,_0x31c978,_0x190171){var _0x4f0841={'method':_0xc49a('0x4e'),'uri':'','headers':{'Authorization':_0xc49a('0x4f')+_0x35b0f6},'json':!![]};switch(_0x190171['moduleSearch']){case _0xc49a('0x50'):_0x4f0841[_0xc49a('0x51')]=_0xc49a('0x52')+_0x1af0cf+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4db390+'))';return getZohoUser(_0x4f0841,_0xc49a('0x53'))[_0xc49a('0x2b')](function(_0x2f2399){if(_0x2f2399)return _0x2f2399;_0x4f0841[_0xc49a('0x51')]='https://www.zohoapis.'+_0x1af0cf+_0xc49a('0x54')+_0x4db390+'))';return getZohoUser(_0x4f0841,_0xc49a('0x55'))[_0xc49a('0x2b')](function(_0x2311c7){if(_0x2311c7)return _0x2311c7;if(_0x190171[_0xc49a('0x4b')]!=_0xc49a('0x56')){return createEndUser(_0x35b0f6,_0x1af0cf,_0x4e1dab,_0x4db390,_0x31c978,_0x190171);}else{return{};}});});break;case _0xc49a('0x57'):_0x4f0841[_0xc49a('0x51')]=_0xc49a('0x52')+_0x1af0cf+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4db390+'))';return getZohoUser(_0x4f0841,_0xc49a('0x53'))[_0xc49a('0x2b')](function(_0x454bc0){if(_0x454bc0)return _0x454bc0;if(_0x190171[_0xc49a('0x4b')]!=_0xc49a('0x56')){return createEndUser(_0x35b0f6,_0x1af0cf,_0x4e1dab,_0x4db390,_0x31c978,_0x190171);}else{return{};}});break;case _0xc49a('0x58'):_0x4f0841['uri']='https://www.zohoapis.'+_0x1af0cf+_0xc49a('0x54')+_0x4db390+'))';return getZohoUser(_0x4f0841,_0xc49a('0x55'))[_0xc49a('0x2b')](function(_0x6fcf24){if(_0x6fcf24)return _0x6fcf24;if(_0x190171['moduleCreate']!=_0xc49a('0x56')){return createEndUser(_0x35b0f6,_0x1af0cf,_0x4e1dab,_0x4db390,_0x31c978,_0x190171);}else{return{};}});break;}}function getCall(_0x4125da,_0x182647,_0x504986,_0x25b0e4,_0x1bdee8,_0x3beb1c,_0x44d375,_0x20f0a3){logger['info'](_0xc49a('0x59'));var _0x4e3634={};_0x4e3634['Owner']={'name':!_[_0xc49a('0x1e')](_0x25b0e4[_0xc49a('0x44')][_0xc49a('0x1a')])&&!_['isNil'](_0x25b0e4[_0xc49a('0x38')]['name'])&&_0x25b0e4[_0xc49a('0x38')][_0xc49a('0x1a')]==='administrator'?_0x25b0e4[_0xc49a('0x44')][_0xc49a('0x1a')]:!_['isNil'](_0x25b0e4[_0xc49a('0x45')])?_0x25b0e4[_0xc49a('0x45')]+'\x20'+_0x25b0e4[_0xc49a('0x46')]:_0x25b0e4[_0xc49a('0x46')],'id':_0x25b0e4['id']};_0x4e3634[_0xc49a('0x5a')]=intUtil['getString'](_0x3beb1c[_0xc49a('0x5b')],_0x44d375,'\x20');_0x4e3634[_0xc49a('0x5c')]=intUtil[_0xc49a('0x5d')](_0x3beb1c[_0xc49a('0x5e')],_0x44d375,'\x0a');if(_0x1bdee8[_0xc49a('0x40')]===_0xc49a('0x53')){_0x4e3634[_0xc49a('0x5f')]={'name':!_['isNil'](_0x1bdee8[_0xc49a('0x60')])?_0x1bdee8[_0xc49a('0x60')]:!_['isNil'](_0x1bdee8[_0xc49a('0x61')])?_0x1bdee8[_0xc49a('0x61')]+'\x20'+_0x1bdee8[_0xc49a('0x62')]:_0x1bdee8[_0xc49a('0x62')],'id':_0x1bdee8['id']};}if(_0x1bdee8[_0xc49a('0x40')]===_0xc49a('0x55')){_0x4e3634['What_Id']={'name':!_[_0xc49a('0x1e')](_0x1bdee8[_0xc49a('0x60')])?_0x1bdee8['Full_Name']:!_[_0xc49a('0x1e')](_0x1bdee8[_0xc49a('0x61')])?_0x1bdee8[_0xc49a('0x61')]+'\x20'+_0x1bdee8[_0xc49a('0x62')]:_0x1bdee8[_0xc49a('0x62')],'id':_0x1bdee8['id']};_0x4e3634[_0xc49a('0x63')]=_[_0xc49a('0x43')](_0x1bdee8[_0xc49a('0x40')]);}if(_0x44d375['talktime']){_0x4e3634[_0xc49a('0x64')]=moment[_0xc49a('0x65')](parseInt(_0x44d375[_0xc49a('0x66')])*0x3e8)[_0xc49a('0x32')]('mm:ss');}else if(_0x44d375['answertime']&&_0x44d375[_0xc49a('0x67')]){_0x4e3634[_0xc49a('0x64')]=moment['utc'](moment(_0x44d375['endtime'],_0xc49a('0x68'))[_0xc49a('0x69')](moment(_0x44d375[_0xc49a('0x6a')],_0xc49a('0x68'))))['format'](_0xc49a('0x6b'));}switch(_0x44d375['lastevent']){case _0xc49a('0x6c'):_0x4e3634['Call_Result']=_0xc49a('0x6d');break;case'complete':case'connect':_0x4e3634[_0xc49a('0x6e')]='Answered';break;case _0xc49a('0x6f'):_0x4e3634[_0xc49a('0x6e')]=_0xc49a('0x70');break;case _0xc49a('0x71'):_0x4e3634['Call_Result']=_0xc49a('0x72');break;case _0xc49a('0x73'):_0x4e3634[_0xc49a('0x6e')]=_0xc49a('0x74');default:}_0x4e3634[_0xc49a('0x75')]=(_0x20f0a3===_0xc49a('0x76')?moment(_0x44d375['starttime'])[_0xc49a('0x32')](_0xc49a('0x68')):moment(_0x44d375['agentcalledAt'])['format'](_0xc49a('0x68')))||moment()[_0xc49a('0x32')](_0xc49a('0x68'));_0x4e3634[_0xc49a('0x77')]=_0x20f0a3||'Inbound';_0x4e3634=_[_0xc49a('0x78')](_0x4e3634,getCustomFields(_0x3beb1c[_0xc49a('0x79')],_0x44d375));return request({'method':_0xc49a('0x41'),'uri':'https://www.zohoapis.'+_0x182647+_0xc49a('0x7a'),'headers':{'Authorization':_0xc49a('0x4f')+_0x4125da},'body':{'data':[_0x4e3634]},'json':!![]})['then'](function(_0x49ca0b){if(_0x49ca0b&&_0x49ca0b[_0xc49a('0x47')][0x0][_0xc49a('0x48')]===_0xc49a('0x49')){logger[_0xc49a('0x30')](_0xc49a('0x7b'));return{'id':_0x49ca0b[_0xc49a('0x47')][0x0][_0xc49a('0x4a')]['id']};}})['catch'](function(_0x112210){logger['info']('err',_0x112210[_0xc49a('0x2f')]);console['log']('err',_0x112210);});}exports[_0xc49a('0x7c')]=function(_0x5dc1ff,_0x90c6b,_0x828e6c,_0x3221f1,_0x44b1e6,_0x301c4b){var _0x57db27,_0x467262,_0xecce00;_0x301c4b[_0xc49a('0x7d')]=intUtil[_0xc49a('0x7e')](_0x301c4b['host']);_0x301c4b[_0xc49a('0x7f')]=intUtil[_0xc49a('0x7e')](_0x301c4b['serverUrl']);if(_0x44b1e6&&_0x44b1e6[_0xc49a('0x80')]){logger[_0xc49a('0x30')]('[QUEUE]',_0xc49a('0x81'));_0x90c6b[_0xc49a('0x82')]=_0x301c4b[_0xc49a('0x7f')]+_0xc49a('0x83')+_0x90c6b[_0xc49a('0x84')]+_0xc49a('0x85')+md5(_0x90c6b[_0xc49a('0x84')]);}else{_0x90c6b[_0xc49a('0x82')]='';}var _0x473ad3=_0x301c4b[_0xc49a('0x7d')]===_0xc49a('0x86')?'eu':_0xc49a('0x87');return getAccessToken(_0x301c4b)[_0xc49a('0x2b')](function(_0x39e9ac){_0xecce00=_0x39e9ac;return getUser(_0xecce00,_0x473ad3,_0x301c4b,_0x3221f1[_0xc49a('0x37')]);})[_0xc49a('0x2b')](function(_0x52470b){_0x57db27=_0x52470b;logger[_0xc49a('0x30')](_0xc49a('0x88'),_0x57db27['id']);return getEndUser(_0xecce00,_0x473ad3,_0x301c4b,_0x90c6b['calleridname'],_0x90c6b[_0xc49a('0x89')],_0x57db27,_0x828e6c);})['then'](function(_0x43e13f){_0x467262=_0x43e13f;return getCall(_0xecce00,_0x473ad3,_0x301c4b,_0x57db27,_0x467262,_0x828e6c,_0x90c6b,'Inbound');})[_0xc49a('0x2b')](function(_0x2388f2){if(_0x2388f2){logger['info'](_0xc49a('0x8a'),_0x2388f2['id']);logger[_0xc49a('0x30')](_0xc49a('0x8b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xc49a('0x8c'),_0x3221f1[_0xc49a('0x1a')]),_0xc49a('0x8d'),{'uri':_0xc49a('0x8e')+_0x301c4b['host']+_0xc49a('0x8f')+_0x2388f2['id']});}})[_0xc49a('0x3f')](function(_0x2d33ed){logger[_0xc49a('0x3c')](_0xc49a('0x8b'),JSON[_0xc49a('0x10')](_0x2d33ed));});};exports['outbound']=function(_0x42bc88,_0xc9d80b,_0xf95d76,_0x224a9f,_0x3ed3ef,_0x7aba46,_0x33ffce){var _0x2fda4e,_0x5cf264,_0x43c9ee;_0x7aba46[_0xc49a('0x7d')]=intUtil[_0xc49a('0x7e')](_0x7aba46[_0xc49a('0x7d')]);_0x7aba46[_0xc49a('0x7f')]=intUtil[_0xc49a('0x7e')](_0x7aba46[_0xc49a('0x7f')]);if(_0x33ffce&&_0x33ffce['recordingFormat']&&_0x33ffce[_0xc49a('0x90')]!==_0xc49a('0x91')){logger[_0xc49a('0x30')](_0xc49a('0x92'),_0xc49a('0x81'));_0xc9d80b['recordingURL']=_0x7aba46['serverUrl']+_0xc49a('0x83')+_0xc9d80b['uniqueid']+_0xc49a('0x85')+md5(_0xc9d80b[_0xc49a('0x84')]);}var _0x4081ff=_0x7aba46['host']===_0xc49a('0x86')?'eu':_0xc49a('0x87');return getAccessToken(_0x7aba46)[_0xc49a('0x2b')](function(_0x48ff21){_0x43c9ee=_0x48ff21;return getUser(_0x43c9ee,_0x4081ff,_0x7aba46,_0x224a9f[_0xc49a('0x37')]);})[_0xc49a('0x2b')](function(_0x981f9e){_0x2fda4e=_0x981f9e;logger[_0xc49a('0x30')]('The\x20User\x20ID\x20is:',_0x2fda4e['id']);return getEndUser(_0x43c9ee,_0x4081ff,_0x7aba46,_0xc9d80b['destcalleridname'],_0xc9d80b[_0xc49a('0x93')],_0x2fda4e,_0xf95d76);})[_0xc49a('0x2b')](function(_0x4d2e4d){_0x5cf264=_0x4d2e4d;return getCall(_0x43c9ee,_0x4081ff,_0x7aba46,_0x2fda4e,_0x5cf264,_0xf95d76,_0xc9d80b,_0xc49a('0x94'));})['then'](function(_0x598c2a){if(_0x598c2a){logger[_0xc49a('0x30')](_0xc49a('0x8a'),_0x598c2a['id']);logger[_0xc49a('0x30')](_0xc49a('0x92'),_0xc49a('0x95'));emit(util['format'](_0xc49a('0x8c'),_0x224a9f['name']),_0xc49a('0x8d'),{'uri':_0xc49a('0x8e')+_0x7aba46[_0xc49a('0x7d')]+'/crm/EntityInfo.do?module=Calls&id='+_0x598c2a['id']});}})[_0xc49a('0x3f')](function(_0x486e30){logger['error']('[OUTBOUND]',JSON[_0xc49a('0x10')](_0x486e30));});};exports[_0xc49a('0x96')]=function(_0x4bad7d,_0x375a25,_0x17b183,_0x19ff69,_0x38c960,_0x4f0814){var _0x50207f,_0x49f7c7,_0x37d508;_0x4f0814[_0xc49a('0x7d')]=intUtil[_0xc49a('0x7e')](_0x4f0814[_0xc49a('0x7d')]);_0x4f0814[_0xc49a('0x7f')]=intUtil['stripTrailingSlash'](_0x4f0814['serverUrl']);if(_0x38c960&&_0x38c960[_0xc49a('0x80')]){logger['info']('['+_0x375a25[_0xc49a('0x97')][_0xc49a('0x98')]()+']',_0xc49a('0x81'));_0x375a25[_0xc49a('0x82')]=_0x4f0814[_0xc49a('0x7f')]+_0xc49a('0x83')+_0x375a25['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x375a25['uniqueid']);}else{_0x375a25[_0xc49a('0x82')]='';}var _0x2710cd=_0x4f0814[_0xc49a('0x7d')]===_0xc49a('0x86')?'eu':_0xc49a('0x87');return getAccessToken(_0x4f0814)['then'](function(_0x508e95){_0x37d508=_0x508e95;return getUser(_0x37d508,_0x2710cd,_0x4f0814);})[_0xc49a('0x2b')](function(_0x51e3f6){_0x50207f=_0x51e3f6;logger[_0xc49a('0x30')]('The\x20User\x20ID\x20is:',_0x50207f['id']);return getEndUser(_0x37d508,_0x2710cd,_0x4f0814,_0x375a25['calleridname'],_0x375a25['calleridnum'],_0x50207f,_0x17b183);})[_0xc49a('0x2b')](function(_0xecc6db){_0x49f7c7=_0xecc6db;return getCall(_0x37d508,_0x2710cd,_0x4f0814,_0x50207f,_0x49f7c7,_0x17b183,_0x375a25,_0xc49a('0x99'));})[_0xc49a('0x2b')](function(_0x4d52db){if(_0x4d52db){logger[_0xc49a('0x30')]('The\x20Call\x20ID\x20is:',_0x4d52db['id']);}})['catch'](function(_0x1f1382){logger[_0xc49a('0x3c')]('['+_0x375a25[_0xc49a('0x97')][_0xc49a('0x98')]()+']',JSON[_0xc49a('0x10')](_0x1f1382));});};
\ No newline at end of file
+var _0x40ca=['https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','isNil','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','enduserType','https://www.zohoapis.','moduleCreate','role','last_name','SUCCESS','data','details','startCase','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','first_name','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','diff','starttime','lastevent','called','Call_Result','complete','connect','Answered','rejected','timeout','Timeout','Call_Start_Time','outbound','YYYY-MM-DDTHH:mm:ss','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','Call\x20created!','err','log','queue','stripTrailingSlash','host','serverUrl','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','com','destcalleridname','destcalleridnum','unmanaged','toUpperCase','lodash','util','./util','moment','ioredis','../../../../config/environment','zoho','defaults','localhost','socket.io-emitter','redis','emit','debug','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','content','variable','variableName','toString','Variable','name','toLowerCase','indexOf','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu'];(function(_0x305291,_0x227b75){var _0xd8d9b8=function(_0x4c0291){while(--_0x4c0291){_0x305291['push'](_0x305291['shift']());}};_0xd8d9b8(++_0x227b75);}(_0x40ca,0x1a1));var _0xa40c=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x40ca[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0xa40c('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xa40c('0x1'));var intUtil=require(_0xa40c('0x2'));var moment=require(_0xa40c('0x3'));var Redis=require(_0xa40c('0x4'));var BPromise=require('bluebird');var config=require(_0xa40c('0x5'));var logger=require('../../../../config/logger')(_0xa40c('0x6'));config['redis']=_[_0xa40c('0x7')](config['redis'],{'host':_0xa40c('0x8'),'port':0x18eb});var io=require(_0xa40c('0x9'))(new Redis(config[_0xa40c('0xa')]));function emit(_0x444497,_0x438c5d,_0x59ed3d){io['to'](_0x444497)[_0xa40c('0xb')](_0x438c5d,_0x59ed3d);}function request(_0x29d5f5){logger[_0xa40c('0xc')](_0xa40c('0xd'),JSON[_0xa40c('0xe')](_0x29d5f5));return rp(_0x29d5f5);}function getCustomFields(_0x2a9a6a,_0x2699c8){var _0x44d12b={};if(_0x2a9a6a[_0xa40c('0xf')]>0x0){_[_0xa40c('0x10')](_0x2a9a6a,function(_0x5904a6){if(_[_0xa40c('0x11')](['string',_0xa40c('0x12')],_0x5904a6[_0xa40c('0x13')])&&_0x5904a6[_0xa40c('0x14')]){_0x44d12b[_0x5904a6[_0xa40c('0x14')]]=_0x5904a6[_0xa40c('0x15')]['toString']();}else if(_0x5904a6[_0xa40c('0x13')]===_0xa40c('0x16')&&_0x5904a6['variableName']&&_0x5904a6[_0xa40c('0x14')]&&_0x2699c8[_0x5904a6['variableName']]){_0x44d12b[_0x5904a6[_0xa40c('0x14')]]=_0x2699c8[_0x5904a6[_0xa40c('0x17')]][_0xa40c('0x18')]();}else if(_0x5904a6['type']==='customVariable'&&_0x5904a6[_0xa40c('0x19')]&&_0x5904a6[_0xa40c('0x19')][_0xa40c('0x1a')]&&_0x5904a6[_0xa40c('0x14')]&&_0x2699c8[_0x5904a6[_0xa40c('0x19')][_0xa40c('0x1a')][_0xa40c('0x1b')]()]){_0x44d12b[_0x5904a6[_0xa40c('0x14')]]=_0x2699c8[_0x5904a6[_0xa40c('0x19')][_0xa40c('0x1a')][_0xa40c('0x1b')]()][_0xa40c('0x18')]();}});}return _0x44d12b;}function getName(_0x4fed31){if(_0x4fed31[_0xa40c('0x1c')]('\x20')>0x0){var _0x1b82c8=_0x4fed31['split'](/ (.+)/);if(_0x1b82c8[0x1]){return _0x1b82c8;}}return[_0x4fed31,_0x4fed31];}var accountsTokens={};function getAccessToken(_0x508ee7){return new Promise(function(_0xa9fc69,_0x185019){if(!_['isNil'](accountsTokens[_0x508ee7['id']])&&!_['isNil'](accountsTokens[_0x508ee7['id']][_0xa40c('0x1d')])){if(moment()[_0xa40c('0x1e')](accountsTokens[_0x508ee7['id']][_0xa40c('0x1f')])){_0xa9fc69(accountsTokens[_0x508ee7['id']][_0xa40c('0x1d')]);}}var _0xa93761;switch(_0x508ee7[_0xa40c('0x20')]){case'US':_0xa93761=_0xa40c('0x21');break;case'AU':_0xa93761=_0xa40c('0x22');break;case'EU':_0xa93761=_0xa40c('0x23');break;case'IN':_0xa93761=_0xa40c('0x24');break;case'CN':_0xa93761='https://accounts.zoho.com.cn';break;default:_0xa93761='https://accounts.zoho.eu';break;}var _0x19d6f3={'method':_0xa40c('0x25'),'uri':_0xa93761+'/oauth/v2/token','qs':{'refresh_token':_0x508ee7[_0xa40c('0x26')],'client_id':_0x508ee7[_0xa40c('0x27')],'client_secret':_0x508ee7[_0xa40c('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x19d6f3)['then'](function(_0x383928){accountsTokens[_0x508ee7['id']]={'access_token':_0x383928[_0xa40c('0x1d')],'expires_in':moment()[_0xa40c('0x29')](_0x383928[_0xa40c('0x1f')],'seconds')};_0xa9fc69(_0x383928[_0xa40c('0x1d')]);})[_0xa40c('0x2a')](function(_0x487145){logger[_0xa40c('0x2b')](_0xa40c('0x2c'),_0x487145[_0xa40c('0x2d')]);_0x185019(_0x487145);});});}function getUser(_0x29e1cd,_0x8ae47d,_0x370f56,_0x4bccd9){logger[_0xa40c('0x2e')](_0xa40c('0x2f'));return request({'method':_0xa40c('0x30'),'uri':util[_0xa40c('0x31')](_0xa40c('0x32'),_0x8ae47d),'qs':{'type':_0xa40c('0x33')},'headers':{'Authorization':_0xa40c('0x34')+_0x29e1cd},'json':!![]})['then'](function(_0x29347f){if(_0x29347f[_0xa40c('0x35')]){var _0x483801=-0x1;if(_[_0xa40c('0x36')](_0x29347f[_0xa40c('0x35')])){if(!_[_0xa40c('0x37')](_0x4bccd9)){_0x483801=_[_0xa40c('0x38')](_0x29347f[_0xa40c('0x35')],function(_0x388253){return _0x388253[_0xa40c('0x39')]===_0x4bccd9;});}if(_0x483801>=0x0){logger[_0xa40c('0x2e')](_0xa40c('0x3a'));}else{logger[_0xa40c('0x2e')](_0xa40c('0x3b'));_0x483801=_['findIndex'](_0x29347f['users'],function(_0x457981){return _0x457981[_0xa40c('0x3c')][_0xa40c('0x1a')]===_0xa40c('0x3d');});}return _0x29347f[_0xa40c('0x35')][_0x483801];}else{if(_0x29347f[_0xa40c('0x3e')][_0xa40c('0x3c')]['name']===_0xa40c('0x3d')){logger[_0xa40c('0x2e')](_0xa40c('0x3b'));user=_0x29347f[_0xa40c('0x3e')];return user;}else{logger[_0xa40c('0x2b')](_0xa40c('0x3f'),JSON[_0xa40c('0xe')](_0x29347f));throw new Error(_0xa40c('0x40')+JSON[_0xa40c('0xe')](_0x29347f));}}}else{logger[_0xa40c('0x2b')]('The\x20failing\x20result\x20is',JSON[_0xa40c('0xe')](_0x29347f));throw new Error(_0xa40c('0x40')+JSON[_0xa40c('0xe')](_0x29347f));}})[_0xa40c('0x2a')](function(_0x5903ca){console[_0xa40c('0x2b')](_0x5903ca);});}function getZohoUser(_0x4e8d2b,_0x33a3c1){return new BPromise(function(_0x58284d,_0x45bdcd){request(_0x4e8d2b)[_0xa40c('0x41')](function(_0xe5f2c2){var _0x4ac9f4=null;if(_0xe5f2c2){_0x4ac9f4=_0xe5f2c2['data'][0x0];_0x4ac9f4[_0xa40c('0x42')]=_0x33a3c1;}_0x58284d(_0x4ac9f4);})[_0xa40c('0x2a')](function(_0x167382){_0x45bdcd(_0x167382);});});}function createEndUser(_0x660870,_0x16b692,_0x3058c5,_0x4b9012,_0x180bda,_0x5b1fad){var _0x3058c5=getName(_0x3058c5);return request({'method':_0xa40c('0x25'),'uri':_0xa40c('0x43')+_0x16b692+'/crm/v2/'+_['startCase'](_0x5b1fad[_0xa40c('0x44')])+'s','body':{'data':[{'Last_Name':_0x3058c5[0x1],'First_Name':_0x3058c5[0x0],'Phone':_0x4b9012,'Owner':{'name':!_[_0xa40c('0x37')](_0x180bda[_0xa40c('0x45')][_0xa40c('0x1a')])?_0x180bda[_0xa40c('0x45')][_0xa40c('0x1a')]:!_[_0xa40c('0x37')](_0x180bda['first_name'])?_0x180bda['first_name']+'\x20'+_0x180bda[_0xa40c('0x46')]:_0x180bda['last_name'],'id':_0x180bda['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x660870},'json':!![]})[_0xa40c('0x41')](function(_0x5603b6){if(_0x5603b6&&_0x5603b6['data'][0x0]['code']===_0xa40c('0x47')){var _0x111e9b=_0x5603b6[_0xa40c('0x48')][0x0][_0xa40c('0x49')];_0x111e9b['enduserType']=_[_0xa40c('0x4a')](_0x5b1fad[_0xa40c('0x44')])+'s';return _0x111e9b;}logger[_0xa40c('0x2b')](_0xa40c('0x3f'),JSON[_0xa40c('0xe')](data));throw new Error('Error:\x20'+JSON[_0xa40c('0xe')](data));})[_0xa40c('0x2a')](function(_0x51d403){console['log'](_0xa40c('0x4b'),_0x51d403);});}function getEndUser(_0x515258,_0x5411a0,_0x4fb57d,_0x7b4f9e,_0x42dade,_0x44cbec,_0x164615){var _0x54b4ab={'method':'GET','uri':'','headers':{'Authorization':_0xa40c('0x34')+_0x515258},'json':!![]};switch(_0x164615[_0xa40c('0x4c')]){case'contact_lead':_0x54b4ab[_0xa40c('0x4d')]='https://www.zohoapis.'+_0x5411a0+_0xa40c('0x4e')+_0x42dade+'))';return getZohoUser(_0x54b4ab,_0xa40c('0x4f'))['then'](function(_0x495243){if(_0x495243)return _0x495243;_0x54b4ab['uri']=_0xa40c('0x43')+_0x5411a0+_0xa40c('0x50')+_0x42dade+'))';return getZohoUser(_0x54b4ab,_0xa40c('0x51'))[_0xa40c('0x41')](function(_0x4d4e25){if(_0x4d4e25)return _0x4d4e25;if(_0x164615[_0xa40c('0x44')]!=_0xa40c('0x52')){return createEndUser(_0x515258,_0x5411a0,_0x7b4f9e,_0x42dade,_0x44cbec,_0x164615);}else{return{};}});});break;case _0xa40c('0x53'):_0x54b4ab[_0xa40c('0x4d')]=_0xa40c('0x43')+_0x5411a0+_0xa40c('0x4e')+_0x42dade+'))';return getZohoUser(_0x54b4ab,_0xa40c('0x4f'))['then'](function(_0x4ba3af){if(_0x4ba3af)return _0x4ba3af;if(_0x164615[_0xa40c('0x44')]!='nothing'){return createEndUser(_0x515258,_0x5411a0,_0x7b4f9e,_0x42dade,_0x44cbec,_0x164615);}else{return{};}});break;case _0xa40c('0x54'):_0x54b4ab[_0xa40c('0x4d')]=_0xa40c('0x43')+_0x5411a0+_0xa40c('0x50')+_0x42dade+'))';return getZohoUser(_0x54b4ab,_0xa40c('0x51'))[_0xa40c('0x41')](function(_0x58c6d6){if(_0x58c6d6)return _0x58c6d6;if(_0x164615['moduleCreate']!='nothing'){return createEndUser(_0x515258,_0x5411a0,_0x7b4f9e,_0x42dade,_0x44cbec,_0x164615);}else{return{};}});break;}}function getCall(_0x4eb1bc,_0xf1c757,_0xb1504f,_0x420709,_0x26439b,_0x1f53d2,_0x2b85d8,_0x46781c){logger[_0xa40c('0x2e')](_0xa40c('0x55'));var _0x1fb459={};_0x1fb459[_0xa40c('0x56')]={'name':!_[_0xa40c('0x37')](_0x420709[_0xa40c('0x45')]['name'])&&!_[_0xa40c('0x37')](_0x420709[_0xa40c('0x3c')]['name'])&&_0x420709['profile'][_0xa40c('0x1a')]===_0xa40c('0x57')?_0x420709[_0xa40c('0x45')][_0xa40c('0x1a')]:!_[_0xa40c('0x37')](_0x420709[_0xa40c('0x58')])?_0x420709[_0xa40c('0x58')]+'\x20'+_0x420709[_0xa40c('0x46')]:_0x420709[_0xa40c('0x46')],'id':_0x420709['id']};_0x1fb459['Subject']=intUtil[_0xa40c('0x59')](_0x1f53d2['Subjects'],_0x2b85d8,'\x20');_0x1fb459[_0xa40c('0x5a')]=intUtil['getString'](_0x1f53d2[_0xa40c('0x5b')],_0x2b85d8,'\x0a');if(_0x26439b[_0xa40c('0x42')]==='Contacts'){_0x1fb459[_0xa40c('0x5c')]={'name':!_['isNil'](_0x26439b[_0xa40c('0x5d')])?_0x26439b['Full_Name']:!_[_0xa40c('0x37')](_0x26439b[_0xa40c('0x5e')])?_0x26439b[_0xa40c('0x5e')]+'\x20'+_0x26439b[_0xa40c('0x5f')]:_0x26439b[_0xa40c('0x5f')],'id':_0x26439b['id']};}if(_0x26439b[_0xa40c('0x42')]==='Leads'){_0x1fb459[_0xa40c('0x60')]={'name':!_[_0xa40c('0x37')](_0x26439b[_0xa40c('0x5d')])?_0x26439b['Full_Name']:!_[_0xa40c('0x37')](_0x26439b[_0xa40c('0x5e')])?_0x26439b[_0xa40c('0x5e')]+'\x20'+_0x26439b[_0xa40c('0x5f')]:_0x26439b[_0xa40c('0x5f')],'id':_0x26439b['id']};_0x1fb459[_0xa40c('0x61')]=_[_0xa40c('0x4a')](_0x26439b[_0xa40c('0x42')]);}if(_0x2b85d8[_0xa40c('0x62')]){_0x1fb459['Call_Duration']=moment[_0xa40c('0x63')](parseInt(_0x2b85d8[_0xa40c('0x62')])*0x3e8)[_0xa40c('0x31')](_0xa40c('0x64'));}else if(_0x2b85d8['answertime']&&_0x2b85d8['endtime']){_0x1fb459['Call_Duration']=moment[_0xa40c('0x63')](moment(_0x2b85d8['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0xa40c('0x65')](moment(_0x2b85d8[_0xa40c('0x66')],'YYYY-MM-DDTHH:mm:ss')))[_0xa40c('0x31')]('mm:ss');}switch(_0x2b85d8[_0xa40c('0x67')]){case _0xa40c('0x68'):_0x1fb459[_0xa40c('0x69')]='Called';break;case _0xa40c('0x6a'):case _0xa40c('0x6b'):_0x1fb459[_0xa40c('0x69')]=_0xa40c('0x6c');break;case _0xa40c('0x6d'):_0x1fb459[_0xa40c('0x69')]='Rejected';break;case'abandoned':_0x1fb459[_0xa40c('0x69')]='Abandoned';break;case _0xa40c('0x6e'):_0x1fb459[_0xa40c('0x69')]=_0xa40c('0x6f');default:}_0x1fb459[_0xa40c('0x70')]=(_0x46781c===_0xa40c('0x71')?moment(_0x2b85d8[_0xa40c('0x66')])[_0xa40c('0x31')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x2b85d8['agentcalledAt'])[_0xa40c('0x31')](_0xa40c('0x72')))||moment()[_0xa40c('0x31')](_0xa40c('0x72'));_0x1fb459[_0xa40c('0x73')]=_0x46781c||_0xa40c('0x74');_0x1fb459=_[_0xa40c('0x75')](_0x1fb459,getCustomFields(_0x1f53d2[_0xa40c('0x76')],_0x2b85d8));return request({'method':'POST','uri':_0xa40c('0x43')+_0xf1c757+_0xa40c('0x77'),'headers':{'Authorization':_0xa40c('0x34')+_0x4eb1bc},'body':{'data':[_0x1fb459]},'json':!![]})[_0xa40c('0x41')](function(_0x4655f5){if(_0x4655f5&&_0x4655f5['data'][0x0][_0xa40c('0x78')]===_0xa40c('0x47')){logger[_0xa40c('0x2e')](_0xa40c('0x79'));return{'id':_0x4655f5[_0xa40c('0x48')][0x0][_0xa40c('0x49')]['id']};}})[_0xa40c('0x2a')](function(_0x362291){logger[_0xa40c('0x2e')](_0xa40c('0x7a'),_0x362291[_0xa40c('0x2d')]);console[_0xa40c('0x7b')](_0xa40c('0x7a'),_0x362291);});}exports[_0xa40c('0x7c')]=function(_0x5d1415,_0x220317,_0x1d1965,_0x22e4f7,_0x2ecb5e,_0x33f703){var _0x50cd56,_0x595bc3,_0x318a95;_0x33f703['host']=intUtil[_0xa40c('0x7d')](_0x33f703[_0xa40c('0x7e')]);_0x33f703['serverUrl']=intUtil[_0xa40c('0x7d')](_0x33f703[_0xa40c('0x7f')]);if(_0x2ecb5e&&_0x2ecb5e['monitor_format']){logger['info']('[QUEUE]',_0xa40c('0x80'));_0x220317['recordingURL']=_0x33f703[_0xa40c('0x7f')]+_0xa40c('0x81')+_0x220317[_0xa40c('0x82')]+_0xa40c('0x83')+md5(_0x220317[_0xa40c('0x82')]);}else{_0x220317[_0xa40c('0x84')]='';}var _0x3089f7=_0x33f703[_0xa40c('0x7e')]===_0xa40c('0x85')?'eu':'com';return getAccessToken(_0x33f703)[_0xa40c('0x41')](function(_0x78776){_0x318a95=_0x78776;return getUser(_0x318a95,_0x3089f7,_0x33f703,_0x22e4f7['email']);})[_0xa40c('0x41')](function(_0x4a69ac){_0x50cd56=_0x4a69ac;logger[_0xa40c('0x2e')](_0xa40c('0x86'),_0x50cd56['id']);return getEndUser(_0x318a95,_0x3089f7,_0x33f703,_0x220317[_0xa40c('0x87')],_0x220317[_0xa40c('0x88')],_0x50cd56,_0x1d1965);})['then'](function(_0x39d409){_0x595bc3=_0x39d409;return getCall(_0x318a95,_0x3089f7,_0x33f703,_0x50cd56,_0x595bc3,_0x1d1965,_0x220317,_0xa40c('0x74'));})['then'](function(_0x4f6756){if(_0x4f6756){logger['info'](_0xa40c('0x89'),_0x4f6756['id']);logger[_0xa40c('0x2e')](_0xa40c('0x8a'),_0xa40c('0x8b'));emit(util[_0xa40c('0x31')](_0xa40c('0x8c'),_0x22e4f7[_0xa40c('0x1a')]),_0xa40c('0x8d'),{'uri':_0xa40c('0x8e')+_0x33f703[_0xa40c('0x7e')]+_0xa40c('0x8f')+_0x4f6756['id']});}})['catch'](function(_0x106a76){logger[_0xa40c('0x2b')]('[QUEUE]',JSON[_0xa40c('0xe')](_0x106a76));});};exports['outbound']=function(_0x5251e3,_0x48ab5e,_0x2a37c6,_0x84cc6c,_0x10ce74,_0x53e24b,_0x238985){var _0x3293be,_0x743ada,_0x4af5ef;_0x53e24b['host']=intUtil[_0xa40c('0x7d')](_0x53e24b[_0xa40c('0x7e')]);_0x53e24b[_0xa40c('0x7f')]=intUtil[_0xa40c('0x7d')](_0x53e24b[_0xa40c('0x7f')]);if(_0x238985&&_0x238985['recordingFormat']&&_0x238985[_0xa40c('0x90')]!=='none'){logger['info'](_0xa40c('0x91'),_0xa40c('0x80'));_0x48ab5e['recordingURL']=_0x53e24b['serverUrl']+'/api/voice/recordings/'+_0x48ab5e[_0xa40c('0x82')]+_0xa40c('0x83')+md5(_0x48ab5e[_0xa40c('0x82')]);}var _0x5f0959=_0x53e24b[_0xa40c('0x7e')]===_0xa40c('0x85')?'eu':_0xa40c('0x92');return getAccessToken(_0x53e24b)[_0xa40c('0x41')](function(_0x1abcab){_0x4af5ef=_0x1abcab;return getUser(_0x4af5ef,_0x5f0959,_0x53e24b,_0x84cc6c[_0xa40c('0x39')]);})[_0xa40c('0x41')](function(_0x258fc4){_0x3293be=_0x258fc4;logger[_0xa40c('0x2e')](_0xa40c('0x86'),_0x3293be['id']);return getEndUser(_0x4af5ef,_0x5f0959,_0x53e24b,_0x48ab5e[_0xa40c('0x93')],_0x48ab5e[_0xa40c('0x94')],_0x3293be,_0x2a37c6);})[_0xa40c('0x41')](function(_0x55ec82){_0x743ada=_0x55ec82;return getCall(_0x4af5ef,_0x5f0959,_0x53e24b,_0x3293be,_0x743ada,_0x2a37c6,_0x48ab5e,'Outbound');})[_0xa40c('0x41')](function(_0x116779){if(_0x116779){logger[_0xa40c('0x2e')](_0xa40c('0x89'),_0x116779['id']);logger[_0xa40c('0x2e')](_0xa40c('0x91'),_0xa40c('0x8b'));emit(util[_0xa40c('0x31')](_0xa40c('0x8c'),_0x84cc6c['name']),_0xa40c('0x8d'),{'uri':_0xa40c('0x8e')+_0x53e24b[_0xa40c('0x7e')]+_0xa40c('0x8f')+_0x116779['id']});}})[_0xa40c('0x2a')](function(_0xa9002){logger[_0xa40c('0x2b')]('[OUTBOUND]',JSON[_0xa40c('0xe')](_0xa9002));});};exports[_0xa40c('0x95')]=function(_0x77b7a5,_0x4cff1b,_0x3a3bf4,_0x3b53be,_0x7fc308,_0x5b7270){var _0x5ad922,_0x554af3,_0xeb6fc6;_0x5b7270['host']=intUtil['stripTrailingSlash'](_0x5b7270[_0xa40c('0x7e')]);_0x5b7270[_0xa40c('0x7f')]=intUtil['stripTrailingSlash'](_0x5b7270['serverUrl']);if(_0x7fc308&&_0x7fc308['monitor_format']){logger['info']('['+_0x4cff1b[_0xa40c('0x67')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x4cff1b[_0xa40c('0x84')]=_0x5b7270[_0xa40c('0x7f')]+_0xa40c('0x81')+_0x4cff1b[_0xa40c('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x4cff1b['uniqueid']);}else{_0x4cff1b[_0xa40c('0x84')]='';}var _0x34eac8=_0x5b7270['host']===_0xa40c('0x85')?'eu':_0xa40c('0x92');return getAccessToken(_0x5b7270)[_0xa40c('0x41')](function(_0x2e77a1){_0xeb6fc6=_0x2e77a1;return getUser(_0xeb6fc6,_0x34eac8,_0x5b7270);})['then'](function(_0x5bf9d1){_0x5ad922=_0x5bf9d1;logger['info'](_0xa40c('0x86'),_0x5ad922['id']);return getEndUser(_0xeb6fc6,_0x34eac8,_0x5b7270,_0x4cff1b[_0xa40c('0x87')],_0x4cff1b[_0xa40c('0x88')],_0x5ad922,_0x3a3bf4);})[_0xa40c('0x41')](function(_0x11e97c){_0x554af3=_0x11e97c;return getCall(_0xeb6fc6,_0x34eac8,_0x5b7270,_0x5ad922,_0x554af3,_0x3a3bf4,_0x4cff1b,_0xa40c('0x74'));})[_0xa40c('0x41')](function(_0x32d5b2){if(_0x32d5b2){logger[_0xa40c('0x2e')](_0xa40c('0x89'),_0x32d5b2['id']);}})[_0xa40c('0x2a')](function(_0x54dd97){logger[_0xa40c('0x2b')]('['+_0x4cff1b['lastevent'][_0xa40c('0x96')]()+']',JSON[_0xa40c('0xe')](_0x54dd97));});};
\ No newline at end of file
index b671baa..85284d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd731=['../../../../config/logger','trigger','exec','data2','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache'];(function(_0x2140d8,_0x53cad3){var _0x448f8a=function(_0x347aaf){while(--_0x347aaf){_0x2140d8['push'](_0x2140d8['shift']());}};_0x448f8a(++_0x53cad3);}(_0xd731,0x193));var _0x1d73=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd731[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x1d73('0x0'));var sh=require(_0x1d73('0x1'));var Mustache=require(_0x1d73('0x2'));var logger=require(_0x1d73('0x3'))(_0x1d73('0x4'));exports[_0x1d73('0x5')]=function(_0x1d24a0,_0x1ef2a5){var _0x212ec5=_0x1d24a0[_0x1d73('0x6')]?_0x1d24a0[_0x1d73('0x6')]:'Script';var _0x230fdb=_0x1d24a0[_0x1d73('0x7')]?Mustache[_0x1d73('0x8')](_0x1d24a0[_0x1d73('0x7')],_0x1ef2a5):_0x1ef2a5;sh[_0x1d73('0x5')](_0x230fdb,function(_0x255fe5,_0x2195b1,_0x2ff038){if(_0x255fe5!==0x0){logger[_0x1d73('0x9')](util[_0x1d73('0xa')](_0x1d73('0xb'),_0x212ec5,_0x230fdb,_0x255fe5,_0x2ff038));}else{logger[_0x1d73('0xc')](util[_0x1d73('0xa')](_0x1d73('0xd'),_0x212ec5,_0x230fdb,_0x2195b1));}});};
\ No newline at end of file
+var _0x452c=['trigger','data2','data3','render','exec','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger'];(function(_0x1185f0,_0x2e0dae){var _0x11358f=function(_0x319d80){while(--_0x319d80){_0x1185f0['push'](_0x1185f0['shift']());}};_0x11358f(++_0x2e0dae);}(_0x452c,0x1c3));var _0xc452=function(_0x4d2208,_0x308c32){_0x4d2208=_0x4d2208-0x0;var _0xf36615=_0x452c[_0x4d2208];return _0xf36615;};'use strict';var util=require(_0xc452('0x0'));var sh=require(_0xc452('0x1'));var Mustache=require(_0xc452('0x2'));var logger=require(_0xc452('0x3'))(_0xc452('0x4'));exports['exec']=function(_0x2b182b,_0x340547){var _0x73d048=_0x2b182b[_0xc452('0x5')]?_0x2b182b[_0xc452('0x5')]:'Script';var _0x47ef33=_0x2b182b[_0xc452('0x6')]?Mustache[_0xc452('0x7')](_0x2b182b['data3'],_0x340547):_0x340547;sh[_0xc452('0x8')](_0x47ef33,function(_0x4e6ba2,_0xb4d1cd,_0x4304a4){if(_0x4e6ba2!==0x0){logger[_0xc452('0x9')](util['format'](_0xc452('0xa'),_0x73d048,_0x47ef33,_0x4e6ba2,_0x4304a4));}else{logger[_0xc452('0xb')](util['format'](_0xc452('0xc'),_0x73d048,_0x47ef33,_0xb4d1cd));}});};
\ No newline at end of file
index 2fe7ba7..9804904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b8d=['headers','data6','render','error','stack','GET','DELETE','PUT','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','then','isNil',',\x20request\x20body:\x20','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','util','mustache','../../../../config/logger','trigger','data1','toUpperCase','data2','data5','number'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2b8d,0x140));var _0xd2b8=function(_0x2c944e,_0x26f659){_0x2c944e=_0x2c944e-0x0;var _0x2cc529=_0x2b8d[_0x2c944e];return _0x2cc529;};'use strict';var rp=require(_0xd2b8('0x0'));var util=require(_0xd2b8('0x1'));var _=require('lodash');var Mustache=require(_0xd2b8('0x2'));var logger=require(_0xd2b8('0x3'))(_0xd2b8('0x4'));exports['exec']=function(_0x2be039,_0x12ca6b){var _0x2ff2f8,_0x5c96e0;var _0x8602f0={'method':_0x2be039[_0xd2b8('0x5')][_0xd2b8('0x6')](),'uri':Mustache['render'](_0x2be039[_0xd2b8('0x7')],_0x12ca6b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2be039[_0xd2b8('0x8')])===_0xd2b8('0x9')&&parseInt(_0x2be039[_0xd2b8('0x8')])>=0x1&&parseInt(_0x2be039[_0xd2b8('0x8')])<=0xa?parseInt(_0x2be039[_0xd2b8('0x8')])*0x3e8:0x5*0x3e8};try{_0x8602f0[_0xd2b8('0xa')]=_0x2be039[_0xd2b8('0xb')]?JSON['parse'](Mustache[_0xd2b8('0xc')](_0x2be039['data6'],_0x12ca6b)):{};}catch(_0x301d64){logger[_0xd2b8('0xd')](_0x301d64[_0xd2b8('0xe')]);}switch(_0x2be039[_0xd2b8('0x5')][_0xd2b8('0x6')]()){case _0xd2b8('0xf'):case _0xd2b8('0x10'):_0x2ff2f8=null;_0x8602f0['qs']=_0x12ca6b;break;case'POST':case _0xd2b8('0x11'):if(_0x2be039[_0xd2b8('0x12')]){try{_0x2ff2f8=JSON[_0xd2b8('0x13')](Mustache[_0xd2b8('0xc')](_0x2be039['data7'],_0x12ca6b));_0x8602f0[_0xd2b8('0x14')]=_0x2ff2f8;}catch(_0x303712){logger['error'](_0x303712[_0xd2b8('0xe')]);logger[_0xd2b8('0xd')](_0xd2b8('0x15'));}}else{_0x2ff2f8=_0x12ca6b;_0x8602f0[_0xd2b8('0x14')]=_0x2ff2f8;}break;}logger[_0xd2b8('0x16')](util[_0xd2b8('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2be039['data1'],_0x2be039[_0xd2b8('0x7')],JSON['stringify'](_0x8602f0)));rp(_0x8602f0)[_0xd2b8('0x18')](function(_0x561e4f){_0x2ff2f8=!_[_0xd2b8('0x19')](_0x2ff2f8)?_0xd2b8('0x1a')+_0x2ff2f8:'';_0x5c96e0=typeof _0x561e4f[_0xd2b8('0x14')]==='object'?JSON[_0xd2b8('0x1b')](_0x561e4f[_0xd2b8('0x14')]):_0x561e4f[_0xd2b8('0x14')];logger[_0xd2b8('0x16')](util['format'](_0xd2b8('0x1c'),_0x2be039[_0xd2b8('0x5')],_0x2be039[_0xd2b8('0x7')],_0x561e4f[_0xd2b8('0x1d')],_0x5c96e0));})[_0xd2b8('0x1e')](function(_0x3c5bec){logger['error'](util[_0xd2b8('0x17')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2be039['data1'],_0x2be039['data2'],_0x3c5bec['statusCode'],_0x3c5bec[_0xd2b8('0x1f')],_0x3c5bec[_0xd2b8('0x20')]));});};
\ No newline at end of file
+var _0xd381=['data6','error','GET','DELETE','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','statusCode','name','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','data2','data5','headers','parse','render'];(function(_0x24fef8,_0x470e9b){var _0x517938=function(_0x92f678){while(--_0x92f678){_0x24fef8['push'](_0x24fef8['shift']());}};_0x517938(++_0x470e9b);}(_0xd381,0x99));var _0x1d38=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xd381[_0x3ea913];return _0x2b4f28;};'use strict';var rp=require('request-promise');var util=require(_0x1d38('0x0'));var _=require(_0x1d38('0x1'));var Mustache=require(_0x1d38('0x2'));var logger=require(_0x1d38('0x3'))(_0x1d38('0x4'));exports[_0x1d38('0x5')]=function(_0x5adc0c,_0x20fa1c){var _0x29b77b,_0x2e2955;var _0x5eb32d={'method':_0x5adc0c[_0x1d38('0x6')]['toUpperCase'](),'uri':Mustache['render'](_0x5adc0c[_0x1d38('0x7')],_0x20fa1c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5adc0c[_0x1d38('0x8')])==='number'&&parseInt(_0x5adc0c[_0x1d38('0x8')])>=0x1&&parseInt(_0x5adc0c[_0x1d38('0x8')])<=0xa?parseInt(_0x5adc0c['data5'])*0x3e8:0x5*0x3e8};try{_0x5eb32d[_0x1d38('0x9')]=_0x5adc0c['data6']?JSON[_0x1d38('0xa')](Mustache[_0x1d38('0xb')](_0x5adc0c[_0x1d38('0xc')],_0x20fa1c)):{};}catch(_0x361265){logger[_0x1d38('0xd')](_0x361265['stack']);}switch(_0x5adc0c[_0x1d38('0x6')]['toUpperCase']()){case _0x1d38('0xe'):case _0x1d38('0xf'):_0x29b77b=null;_0x5eb32d['qs']=_0x20fa1c;break;case'POST':case _0x1d38('0x10'):if(_0x5adc0c[_0x1d38('0x11')]){try{_0x29b77b=JSON[_0x1d38('0xa')](Mustache['render'](_0x5adc0c[_0x1d38('0x11')],_0x20fa1c));_0x5eb32d[_0x1d38('0x12')]=_0x29b77b;}catch(_0x185392){logger[_0x1d38('0xd')](_0x185392[_0x1d38('0x13')]);logger[_0x1d38('0xd')](_0x1d38('0x14'));}}else{_0x29b77b=_0x20fa1c;_0x5eb32d[_0x1d38('0x12')]=_0x29b77b;}break;}logger[_0x1d38('0x15')](util['format'](_0x1d38('0x16'),_0x5adc0c[_0x1d38('0x6')],_0x5adc0c['data2'],JSON[_0x1d38('0x17')](_0x5eb32d)));rp(_0x5eb32d)[_0x1d38('0x18')](function(_0x1cc00d){_0x29b77b=!_[_0x1d38('0x19')](_0x29b77b)?_0x1d38('0x1a')+_0x29b77b:'';_0x2e2955=typeof _0x1cc00d[_0x1d38('0x12')]===_0x1d38('0x1b')?JSON[_0x1d38('0x17')](_0x1cc00d[_0x1d38('0x12')]):_0x1cc00d[_0x1d38('0x12')];logger['info'](util[_0x1d38('0x1c')](_0x1d38('0x1d'),_0x5adc0c[_0x1d38('0x6')],_0x5adc0c[_0x1d38('0x7')],_0x1cc00d['statusCode'],_0x2e2955));})[_0x1d38('0x1e')](function(_0x18c520){logger['error'](util[_0x1d38('0x1c')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5adc0c[_0x1d38('0x6')],_0x5adc0c[_0x1d38('0x7')],_0x18c520[_0x1d38('0x1f')],_0x18c520[_0x1d38('0x20')],_0x18c520['message']));});};
\ No newline at end of file
index e728aef..eb92766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x540b=['then','debug','rpc','error','result','catch','exports','jayson/promise','bluebird','routing','http','Request','request'];(function(_0x4e5969,_0x59d73e){var _0x59d7ce=function(_0x13a624){while(--_0x13a624){_0x4e5969['push'](_0x4e5969['shift']());}};_0x59d7ce(++_0x59d73e);}(_0x540b,0x180));var _0xb540=function(_0x343511,_0x4d2d27){_0x343511=_0x343511-0x0;var _0x171b48=_0x540b[_0x343511];return _0x171b48;};'use strict';var jayson=require(_0xb540('0x0'));var BPromise=require(_0xb540('0x1'));var logger=require('../../config/logger')(_0xb540('0x2'));var client=jayson['client'][_0xb540('0x3')]({'port':0x2329});client[_0xb540('0x4')]=function(_0x1606f5,_0x325d9d){return new BPromise(function(_0xd78fe4,_0x3b1b24){return client[_0xb540('0x5')](_0x1606f5,_0x325d9d)[_0xb540('0x6')](function(_0x23f401){logger[_0xb540('0x7')](_0xb540('0x8'),_0xb540('0x2'),_0x1606f5,_0x325d9d,_0x23f401);if(_0x23f401['error']){logger[_0xb540('0x9')](_0xb540('0x8'),_0xb540('0x2'),_0x1606f5,_0x23f401['error']['message'],_0x325d9d);return _0x3b1b24(_0x23f401[_0xb540('0x9')]['message']);}else{return _0xd78fe4(_0x23f401[_0xb540('0xa')]);}})[_0xb540('0xb')](function(_0x544efe){logger[_0xb540('0x9')]('rpc','routing',_0x1606f5,_0x544efe,_0x325d9d);return _0x3b1b24(_0x544efe);});});};module[_0xb540('0xc')]=client;
\ No newline at end of file
+var _0x85aa=['jayson/promise','../../config/logger','client','Request','request','then','debug','rpc','routing','error','message','result','catch','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85aa,0x1c0));var _0xa85a=function(_0x308be9,_0x196233){_0x308be9=_0x308be9-0x0;var _0x8b4af1=_0x85aa[_0x308be9];return _0x8b4af1;};'use strict';var jayson=require(_0xa85a('0x0'));var BPromise=require('bluebird');var logger=require(_0xa85a('0x1'))('routing');var client=jayson[_0xa85a('0x2')]['http']({'port':0x2329});client[_0xa85a('0x3')]=function(_0x551c0f,_0x37c3e6){return new BPromise(function(_0x440b11,_0x2475cd){return client[_0xa85a('0x4')](_0x551c0f,_0x37c3e6)[_0xa85a('0x5')](function(_0x49fc1d){logger[_0xa85a('0x6')](_0xa85a('0x7'),_0xa85a('0x8'),_0x551c0f,_0x37c3e6,_0x49fc1d);if(_0x49fc1d[_0xa85a('0x9')]){logger[_0xa85a('0x9')]('rpc',_0xa85a('0x8'),_0x551c0f,_0x49fc1d[_0xa85a('0x9')]['message'],_0x37c3e6);return _0x2475cd(_0x49fc1d[_0xa85a('0x9')][_0xa85a('0xa')]);}else{return _0x440b11(_0x49fc1d[_0xa85a('0xb')]);}})[_0xa85a('0xc')](function(_0x3fbcb4){logger[_0xa85a('0x9')]('rpc',_0xa85a('0x8'),_0x551c0f,_0x3fbcb4,_0x37c3e6);return _0x2475cd(_0x3fbcb4);});});};module[_0xa85a('0xd')]=client;
\ No newline at end of file
index d290e47..4609f8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac03=['refresh','mailAccounts','listen','loginMailFrequency','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','then','initMailAccounts'];(function(_0x524208,_0x2c6e07){var _0x27773c=function(_0x1c94a2){while(--_0x1c94a2){_0x524208['push'](_0x524208['shift']());}};_0x27773c(++_0x2c6e07);}(_0xac03,0xf6));var _0x3ac0=function(_0x437bb4,_0x1e5e6b){_0x437bb4=_0x437bb4-0x0;var _0x53e6f7=_0xac03[_0x437bb4];return _0x53e6f7;};'use strict';var server=require('./server');var Realtime=require(_0x3ac0('0x0'));var EmailChannel=require(_0x3ac0('0x1'));var mailAccount=require(_0x3ac0('0x2'));var setting=require(_0x3ac0('0x3'));var logger=require(_0x3ac0('0x4'))(_0x3ac0('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x3ac0('0x6')]()['then'](mailAccount[_0x3ac0('0x7')]())[_0x3ac0('0x8')](realtime[_0x3ac0('0x9')]())[_0x3ac0('0x8')](function(){email[_0x3ac0('0xa')](realtime[_0x3ac0('0xb')]);return realtime;});}function main(){return server[_0x3ac0('0xc')](realtime,email)[_0x3ac0('0x8')](function(){return initRealtime();})[_0x3ac0('0x8')](function(){return setting['getSettings']();})[_0x3ac0('0x8')](function(_0x3b6032){return setInterval(initRealtime,_0x3b6032[_0x3ac0('0xd')]*0x3e8);})['catch'](function(_0x2ac4d0){logger[_0x3ac0('0xe')](_0x3ac0('0xf'),_0x2ac4d0);});}main();
\ No newline at end of file
+var _0xb9c6=['./lib/email','./rpc/mailAccount','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','getSettings','loginMailFrequency','catch','error','./server','./realtime'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb9c6,0x76));var _0x6b9c=function(_0x445121,_0xf426b4){_0x445121=_0x445121-0x0;var _0x59dc12=_0xb9c6[_0x445121];return _0x59dc12;};'use strict';var server=require(_0x6b9c('0x0'));var Realtime=require(_0x6b9c('0x1'));var EmailChannel=require(_0x6b9c('0x2'));var mailAccount=require(_0x6b9c('0x3'));var setting=require('./rpc/setting');var logger=require(_0x6b9c('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x6b9c('0x5')]()[_0x6b9c('0x6')](mailAccount[_0x6b9c('0x7')]())['then'](realtime[_0x6b9c('0x8')]())['then'](function(){email[_0x6b9c('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x6b9c('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0x6b9c('0x6')](function(){return setting[_0x6b9c('0xb')]();})[_0x6b9c('0x6')](function(_0x484ff0){return setInterval(initRealtime,_0x484ff0[_0x6b9c('0xc')]*0x3e8);})[_0x6b9c('0xd')](function(_0x1fb4a6){logger[_0x6b9c('0xe')]('Email\x20service\x20initialization',_0x1fb4a6);});}main();
\ No newline at end of file
index 050d6a4..0c64a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2190=['handleImapError','status','disabled','messageStatus','connected','name','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','Mail\x20accepted\x20from\x20routing','catch','stringify','handleImapEnd','lastSync','Smtp','smtp','verify','then','verified','exports','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','prototype','emit','Imap','isNil','mailAccount:update','refresh','hasOwnProperty','active','service','provider','bind','end','error'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x2190,0x150));var _0x0219=function(_0x3b5587,_0x22a6f4){_0x3b5587=_0x3b5587-0x0;var _0x3fbb62=_0x2190[_0x3b5587];return _0x3fbb62;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x0219('0x0'));var md5=require(_0x0219('0x1'));var Redis=require(_0x0219('0x2'));var config=require(_0x0219('0x3'));var logger=require(_0x0219('0x4'))(_0x0219('0x5'));config[_0x0219('0x6')]=_['defaults'](config[_0x0219('0x6')],{'host':_0x0219('0x7'),'port':0x18eb});var io=require(_0x0219('0x8'))(new Redis(config[_0x0219('0x6')]));var EmailImap=require(_0x0219('0x9'));var EmailSmtp=require(_0x0219('0xa'));var mailAccount=require(_0x0219('0xb'));var md5Accounts={};function EmailChannel(_0x2e966f){logger[_0x0219('0xc')]('start\x20email\x20channel');this[_0x0219('0xd')]=_0x2e966f['mailAccounts'];this[_0x0219('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x0219('0xf')][_0x0219('0x10')]=function(_0xcb2f52){var _0x47a0cb=this['mailAccounts'][_0xcb2f52];var _0x38c657={'id':_0x47a0cb['id'],'name':_0x47a0cb['name'],'key':_0x47a0cb['key'],'active':_0x47a0cb['active'],'Imap':{'status':_0x47a0cb[_0x0219('0x11')]['status'],'messageStatus':_0x47a0cb[_0x0219('0x11')]['messageStatus'],'total':_0x47a0cb[_0x0219('0x11')]['total']}};if(_[_0x0219('0x12')](md5Accounts[_0xcb2f52])){md5Accounts[_0xcb2f52]={};}var _0x1031f6=md5(JSON['stringify'](_0x38c657));if(md5Accounts[_0xcb2f52][_0x0219('0x1')]!==_0x1031f6){md5Accounts[_0xcb2f52][_0x0219('0x1')]=_0x1031f6;io[_0x0219('0x10')](_0x0219('0x13'),_0x38c657);}};EmailChannel[_0x0219('0xf')][_0x0219('0x14')]=function(_0x21e399){for(var _0x5927f2 in _0x21e399){if(_0x21e399[_0x0219('0x15')](_0x5927f2)){if(_0x21e399[_0x5927f2]['Imap']&&_0x21e399[_0x5927f2][_0x0219('0x16')]){var _0xfd23d0=_0x21e399[_0x5927f2]['Imap'];if(!_0xfd23d0[_0x0219('0x17')]&&_0x21e399[_0x5927f2][_0x0219('0x18')]!=='custom')_0xfd23d0[_0x0219('0x17')]=_0x21e399[_0x5927f2][_0x0219('0x18')];if(!this[_0x0219('0xe')][_0x0219('0x15')](_0xfd23d0['id'])){this[_0x0219('0xe')][_0xfd23d0['id']]=new EmailImap(_0xfd23d0,_0x21e399[_0x5927f2][_0x0219('0x5')]);this[_0x0219('0xe')][_0xfd23d0['id']]['on']('box',this['handleImapBox'][_0x0219('0x19')](this,_0x5927f2));this[_0x0219('0xe')][_0xfd23d0['id']]['on'](_0x0219('0x5'),this['handleImapEmail'][_0x0219('0x19')](this,_0x5927f2));this[_0x0219('0xe')][_0xfd23d0['id']]['on'](_0x0219('0x1a'),this['handleImapEnd'][_0x0219('0x19')](this,_0x5927f2));this[_0x0219('0xe')][_0xfd23d0['id']]['on'](_0x0219('0x1b'),this[_0x0219('0x1c')]['bind'](this,_0x5927f2));}}else{if(_[_0x0219('0x12')](this[_0x0219('0xd')][_0x5927f2][_0x0219('0x11')])){this[_0x0219('0xd')][_0x5927f2][_0x0219('0x11')]={};}this[_0x0219('0xd')][_0x5927f2][_0x0219('0x11')][_0x0219('0x1d')]=_0x0219('0x1e');this['mailAccounts'][_0x5927f2]['Imap'][_0x0219('0x1f')]='';this[_0x0219('0x10')](_0x5927f2);}}}};EmailChannel[_0x0219('0xf')]['handleImapBox']=function(_0x9666c6,_0xf8a70b){if(this[_0x0219('0xd')][_0x9666c6]){this['mailAccounts'][_0x9666c6]['Imap']['status']=_0x0219('0x20');this[_0x0219('0xd')][_0x9666c6][_0x0219('0x11')][_0x0219('0x1f')]=_0xf8a70b[_0x0219('0x21')];if(_0xf8a70b[_0x0219('0x22')]){this[_0x0219('0xd')][_0x9666c6]['Imap'][_0x0219('0x23')]=_0xf8a70b['messages'][_0x0219('0x23')];}return this['emit'](_0x9666c6);}};EmailChannel[_0x0219('0xf')][_0x0219('0x24')]=function(_0x118688,_0x19400b){logger[_0x0219('0xc')](_0x0219('0x25'),_0x19400b[_0x0219('0x26')],_0x19400b[_0x0219('0x27')],_0x19400b['from'],_0x118688);if(this[_0x0219('0xd')][_0x118688]){return mailAccount[_0x0219('0x28')](_0x118688,_0x19400b)['then'](function(_0x35c551){if(_0x35c551){logger[_0x0219('0xc')](_0x0219('0x29'));}})[_0x0219('0x2a')](function(_0x5ec088){logger[_0x0219('0x1b')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x0219('0x2b')](_0x5ec088));});}};EmailChannel[_0x0219('0xf')][_0x0219('0x2c')]=function(_0x41f916){if(this['mailAccounts'][_0x41f916]&&this[_0x0219('0xd')][_0x41f916][_0x0219('0x11')]){if(this[_0x0219('0xe')][this['mailAccounts'][_0x41f916]['Imap']['id']]){delete this[_0x0219('0xe')][this[_0x0219('0xd')][_0x41f916][_0x0219('0x11')]['id']];}this['mailAccounts'][_0x41f916][_0x0219('0x11')][_0x0219('0x2d')]=moment();this[_0x0219('0x10')](_0x41f916);}};EmailChannel[_0x0219('0xf')][_0x0219('0x1c')]=function(_0x5a9aca,_0x5c8eaf){if(this[_0x0219('0xd')][_0x5a9aca]){this[_0x0219('0xd')][_0x5a9aca][_0x0219('0x11')][_0x0219('0x1d')]='error';this[_0x0219('0xd')][_0x5a9aca][_0x0219('0x11')][_0x0219('0x1f')]=_0x5c8eaf;return this[_0x0219('0x10')](_0x5a9aca);}};EmailChannel[_0x0219('0xf')]['sendMail']=function(_0xc309ff,_0xd9c1cf){return this['smtp']['send'](_0xc309ff,_0xd9c1cf);};EmailChannel[_0x0219('0xf')]['verifySmtp']=function(_0x18188d){var _0x2ddfbb=this;if(this[_0x0219('0xd')][_0x18188d['id']]){if(_['isNil'](this[_0x0219('0xd')][_0x18188d['id']][_0x0219('0x2e')])){this[_0x0219('0xd')][_0x18188d['id']]['Smtp']={};}this[_0x0219('0xd')][_0x18188d['id']][_0x0219('0x2e')][_0x0219('0x2d')]=moment();return new BPromise(function(_0x5a6049,_0x3a3703){return _0x2ddfbb[_0x0219('0x2f')][_0x0219('0x30')](_0x18188d)[_0x0219('0x31')](function(_0x3c20a9){_0x2ddfbb[_0x0219('0xd')][_0x18188d['id']][_0x0219('0x2e')][_0x0219('0x1d')]=_0x0219('0x32');_0x2ddfbb[_0x0219('0xd')][_0x18188d['id']][_0x0219('0x2e')]['messageStatus']='';_0x2ddfbb[_0x0219('0x10')](_0x18188d['id']);_0x5a6049(_0x3c20a9);})[_0x0219('0x2a')](function(_0x2f1ba2){_0x2ddfbb[_0x0219('0xd')][_0x18188d['id']]['Smtp'][_0x0219('0x1d')]=_0x0219('0x1b');_0x2ddfbb[_0x0219('0xd')][_0x18188d['id']][_0x0219('0x2e')][_0x0219('0x1f')]=_0x2f1ba2;_0x2ddfbb[_0x0219('0x10')](_0x18188d['id']);_0x3a3703(_0x2f1ba2);});});}return this[_0x0219('0x2f')][_0x0219('0x30')](_0x18188d);};module[_0x0219('0x33')]=EmailChannel;
\ No newline at end of file
+var _0x04a4=['email','redis','localhost','socket.io-emitter','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','status','Imap','total','isNil','stringify','emit','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','verifySmtp','Smtp','lastSync','verify','verified','exports','lodash','moment','md5','../../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x04a4,0xd8));var _0x404a=function(_0x3e4e83,_0x4d643c){_0x3e4e83=_0x3e4e83-0x0;var _0x18010d=_0x04a4[_0x3e4e83];return _0x18010d;};'use strict';var _=require(_0x404a('0x0'));var moment=require(_0x404a('0x1'));var BPromise=require('bluebird');var md5=require(_0x404a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x404a('0x3'))(_0x404a('0x4'));config[_0x404a('0x5')]=_['defaults'](config[_0x404a('0x5')],{'host':_0x404a('0x6'),'port':0x18eb});var io=require(_0x404a('0x7'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0x404a('0x8'));var md5Accounts={};function EmailChannel(_0x1f03d0){logger[_0x404a('0x9')](_0x404a('0xa'));this[_0x404a('0xb')]=_0x1f03d0[_0x404a('0xb')];this[_0x404a('0xc')]={};this[_0x404a('0xd')]=new EmailSmtp();}EmailChannel[_0x404a('0xe')]['emit']=function(_0xa2e7c){var _0x7d9b7e=this['mailAccounts'][_0xa2e7c];var _0x1e4a32={'id':_0x7d9b7e['id'],'name':_0x7d9b7e[_0x404a('0xf')],'key':_0x7d9b7e[_0x404a('0x10')],'active':_0x7d9b7e[_0x404a('0x11')],'Imap':{'status':_0x7d9b7e['Imap'][_0x404a('0x12')],'messageStatus':_0x7d9b7e[_0x404a('0x13')]['messageStatus'],'total':_0x7d9b7e['Imap'][_0x404a('0x14')]}};if(_[_0x404a('0x15')](md5Accounts[_0xa2e7c])){md5Accounts[_0xa2e7c]={};}var _0x3b20cb=md5(JSON[_0x404a('0x16')](_0x1e4a32));if(md5Accounts[_0xa2e7c]['md5']!==_0x3b20cb){md5Accounts[_0xa2e7c][_0x404a('0x2')]=_0x3b20cb;io[_0x404a('0x17')]('mailAccount:update',_0x1e4a32);}};EmailChannel[_0x404a('0xe')][_0x404a('0x18')]=function(_0x540735){for(var _0x17c416 in _0x540735){if(_0x540735[_0x404a('0x19')](_0x17c416)){if(_0x540735[_0x17c416]['Imap']&&_0x540735[_0x17c416][_0x404a('0x11')]){var _0x39e441=_0x540735[_0x17c416][_0x404a('0x13')];if(!_0x39e441[_0x404a('0x1a')]&&_0x540735[_0x17c416][_0x404a('0x1b')]!==_0x404a('0x1c'))_0x39e441[_0x404a('0x1a')]=_0x540735[_0x17c416][_0x404a('0x1b')];if(!this[_0x404a('0xc')][_0x404a('0x19')](_0x39e441['id'])){this[_0x404a('0xc')][_0x39e441['id']]=new EmailImap(_0x39e441,_0x540735[_0x17c416]['email']);this[_0x404a('0xc')][_0x39e441['id']]['on'](_0x404a('0x1d'),this[_0x404a('0x1e')][_0x404a('0x1f')](this,_0x17c416));this['imapAccounts'][_0x39e441['id']]['on'](_0x404a('0x4'),this[_0x404a('0x20')][_0x404a('0x1f')](this,_0x17c416));this[_0x404a('0xc')][_0x39e441['id']]['on'](_0x404a('0x21'),this[_0x404a('0x22')][_0x404a('0x1f')](this,_0x17c416));this['imapAccounts'][_0x39e441['id']]['on'](_0x404a('0x23'),this[_0x404a('0x24')][_0x404a('0x1f')](this,_0x17c416));}}else{if(_[_0x404a('0x15')](this[_0x404a('0xb')][_0x17c416][_0x404a('0x13')])){this[_0x404a('0xb')][_0x17c416][_0x404a('0x13')]={};}this['mailAccounts'][_0x17c416][_0x404a('0x13')]['status']=_0x404a('0x25');this[_0x404a('0xb')][_0x17c416][_0x404a('0x13')][_0x404a('0x26')]='';this[_0x404a('0x17')](_0x17c416);}}}};EmailChannel[_0x404a('0xe')][_0x404a('0x1e')]=function(_0xdfab8f,_0x46ed7f){if(this[_0x404a('0xb')][_0xdfab8f]){this[_0x404a('0xb')][_0xdfab8f]['Imap']['status']='connected';this[_0x404a('0xb')][_0xdfab8f][_0x404a('0x13')][_0x404a('0x26')]=_0x46ed7f[_0x404a('0xf')];if(_0x46ed7f[_0x404a('0x27')]){this[_0x404a('0xb')][_0xdfab8f][_0x404a('0x13')][_0x404a('0x14')]=_0x46ed7f['messages'][_0x404a('0x14')];}return this[_0x404a('0x17')](_0xdfab8f);}};EmailChannel[_0x404a('0xe')][_0x404a('0x20')]=function(_0x5c7786,_0x597ddf){logger[_0x404a('0x9')](_0x404a('0x28'),_0x597ddf[_0x404a('0x29')],_0x597ddf[_0x404a('0x2a')],_0x597ddf[_0x404a('0x2b')],_0x5c7786);if(this[_0x404a('0xb')][_0x5c7786]){return mailAccount['notify'](_0x5c7786,_0x597ddf)[_0x404a('0x2c')](function(_0x28b6cf){if(_0x28b6cf){logger['info'](_0x404a('0x2d'));}})[_0x404a('0x2e')](function(_0x266ad2){logger[_0x404a('0x23')](_0x404a('0x2f'),JSON[_0x404a('0x16')](_0x266ad2));});}};EmailChannel[_0x404a('0xe')][_0x404a('0x22')]=function(_0x114fab){if(this[_0x404a('0xb')][_0x114fab]&&this[_0x404a('0xb')][_0x114fab]['Imap']){if(this['imapAccounts'][this['mailAccounts'][_0x114fab]['Imap']['id']]){delete this[_0x404a('0xc')][this[_0x404a('0xb')][_0x114fab][_0x404a('0x13')]['id']];}this[_0x404a('0xb')][_0x114fab][_0x404a('0x13')]['lastSync']=moment();this['emit'](_0x114fab);}};EmailChannel[_0x404a('0xe')][_0x404a('0x24')]=function(_0x285b87,_0x4d7905){if(this['mailAccounts'][_0x285b87]){this['mailAccounts'][_0x285b87]['Imap'][_0x404a('0x12')]=_0x404a('0x23');this[_0x404a('0xb')][_0x285b87][_0x404a('0x13')]['messageStatus']=_0x4d7905;return this['emit'](_0x285b87);}};EmailChannel[_0x404a('0xe')][_0x404a('0x30')]=function(_0x3ee7d3,_0x2858b5){return this[_0x404a('0xd')]['send'](_0x3ee7d3,_0x2858b5);};EmailChannel['prototype'][_0x404a('0x31')]=function(_0x3b8933){var _0x3965a5=this;if(this[_0x404a('0xb')][_0x3b8933['id']]){if(_[_0x404a('0x15')](this[_0x404a('0xb')][_0x3b8933['id']][_0x404a('0x32')])){this[_0x404a('0xb')][_0x3b8933['id']][_0x404a('0x32')]={};}this[_0x404a('0xb')][_0x3b8933['id']][_0x404a('0x32')][_0x404a('0x33')]=moment();return new BPromise(function(_0x347904,_0x53a9fa){return _0x3965a5[_0x404a('0xd')][_0x404a('0x34')](_0x3b8933)[_0x404a('0x2c')](function(_0x5ae18d){_0x3965a5[_0x404a('0xb')][_0x3b8933['id']][_0x404a('0x32')][_0x404a('0x12')]=_0x404a('0x35');_0x3965a5[_0x404a('0xb')][_0x3b8933['id']][_0x404a('0x32')][_0x404a('0x26')]='';_0x3965a5[_0x404a('0x17')](_0x3b8933['id']);_0x347904(_0x5ae18d);})[_0x404a('0x2e')](function(_0x114f58){_0x3965a5[_0x404a('0xb')][_0x3b8933['id']]['Smtp']['status']='error';_0x3965a5[_0x404a('0xb')][_0x3b8933['id']][_0x404a('0x32')][_0x404a('0x26')]=_0x114f58;_0x3965a5['emit'](_0x3b8933['id']);_0x53a9fa(_0x114f58);});});}return this[_0x404a('0xd')][_0x404a('0x34')](_0x3b8933);};module[_0x404a('0x36')]=EmailChannel;
\ No newline at end of file
index 2c0e2a1..90e39d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce68=['handleSimpleParser','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','email','anonymous@xcally.com','xoauth2','CloudProvider','data5','authentication','password','host','port','tls','autotls','required','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xce68,0x10c));var _0x8ce6=function(_0x393033,_0x12a72d){_0x393033=_0x393033-0x0;var _0x2d2faf=_0xce68[_0x393033];return _0x2d2faf;};'use strict';var _=require(_0x8ce6('0x0'));var util=require('util');var Imap=require(_0x8ce6('0x1'));var simpleParser=require(_0x8ce6('0x2'))[_0x8ce6('0x3')];var Iconv=require(_0x8ce6('0x4'))[_0x8ce6('0x5')];var EventEmitter=require('events')[_0x8ce6('0x6')];var utils=require(_0x8ce6('0x7'));var logger=require(_0x8ce6('0x8'))('email');function EmailImap(_0x116e0a,_0x10b3ca){this['mailbox']='INBOX';this[_0x8ce6('0x9')]=this[_0x8ce6('0xa')](_0x116e0a,_0x10b3ca);this[_0x8ce6('0x1')]=new Imap(this[_0x8ce6('0x9')]);this['imap'][_0x8ce6('0xb')](_0x8ce6('0xc'),this[_0x8ce6('0xd')][_0x8ce6('0xe')](this));this[_0x8ce6('0x1')][_0x8ce6('0xb')](_0x8ce6('0xf'),this[_0x8ce6('0x10')][_0x8ce6('0xe')](this));this[_0x8ce6('0x1')]['on'](_0x8ce6('0x11'),this[_0x8ce6('0x12')][_0x8ce6('0xe')](this));this[_0x8ce6('0x1')][_0x8ce6('0x13')]();}util[_0x8ce6('0x14')](EmailImap,EventEmitter);EmailImap[_0x8ce6('0x15')][_0x8ce6('0xa')]=function(_0x4a68fd,_0x20752c){var _0x5f0ff5={'connTimeout':_0x4a68fd[_0x8ce6('0x16')]?_0x4a68fd[_0x8ce6('0x16')]*0x3e8:0x2710,'authTimeout':_0x4a68fd[_0x8ce6('0x17')]?_0x4a68fd[_0x8ce6('0x17')]*0x3e8:0x1388};if(_0x4a68fd[_0x8ce6('0x18')]){_0x5f0ff5[_0x8ce6('0x19')]=_0x4a68fd[_0x8ce6('0x19')];_0x5f0ff5[_0x8ce6('0x1a')]=_0x20752c||_0x4a68fd[_0x8ce6('0x19')]||_0x8ce6('0x1b');if(_0x4a68fd['modernAuthentication']){_0x5f0ff5[_0x8ce6('0x1c')]=utils['generateXOAuth2Token'](_0x4a68fd[_0x8ce6('0x1d')][_0x8ce6('0x1e')],_0x4a68fd[_0x8ce6('0x19')]);}else{_0x5f0ff5['password']=_0x4a68fd['password'];}}else{if(_0x4a68fd[_0x8ce6('0x1f')]){_0x5f0ff5[_0x8ce6('0x19')]=_0x4a68fd['user'];_0x5f0ff5[_0x8ce6('0x20')]=_0x4a68fd[_0x8ce6('0x20')];}}_0x5f0ff5[_0x8ce6('0x21')]=_0x4a68fd[_0x8ce6('0x21')];_0x5f0ff5[_0x8ce6('0x22')]=_0x4a68fd[_0x8ce6('0x22')]||0x3e1;if(_0x4a68fd[_0x8ce6('0x23')]){_0x5f0ff5[_0x8ce6('0x23')]=!![];}else{_0x5f0ff5[_0x8ce6('0x23')]=![];_0x5f0ff5[_0x8ce6('0x24')]=_0x8ce6('0x25');}return _0x5f0ff5;};EmailImap[_0x8ce6('0x15')]['handleReady']=function(){this[_0x8ce6('0x1')]['openBox'](this[_0x8ce6('0x26')],![],this[_0x8ce6('0x27')][_0x8ce6('0xe')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x5d72b0,_0x5c2b61){if(_0x5d72b0){this[_0x8ce6('0x12')](_0x5d72b0,!![]);}else{this[_0x8ce6('0x28')](_0x8ce6('0x29'),_0x5c2b61);this[_0x8ce6('0x2a')]();}};EmailImap[_0x8ce6('0x15')][_0x8ce6('0x2b')]=function(_0x526e9e){if(_0x526e9e){this['handleError'](_0x526e9e,!![]);}else{this[_0x8ce6('0x1')][_0x8ce6('0xf')]();}};EmailImap[_0x8ce6('0x15')][_0x8ce6('0x2a')]=function(){this[_0x8ce6('0x1')][_0x8ce6('0x2c')](['UNSEEN'],this['handleReadUnseen'][_0x8ce6('0xe')](this));};EmailImap[_0x8ce6('0x15')][_0x8ce6('0x2d')]=function(_0x5e2798,_0x2cb8e7){if(_0x5e2798){this[_0x8ce6('0x12')](_0x5e2798,!![]);}else{if(_0x2cb8e7[_0x8ce6('0x2e')]){try{var _0x423e1c=this['imap'][_0x8ce6('0x2f')](_0x2cb8e7,{'bodies':'','markSeen':!![]});_0x423e1c['on'](_0x8ce6('0x30'),this['handleFetchMessage']['bind'](this));_0x423e1c[_0x8ce6('0xb')](_0x8ce6('0x11'),this[_0x8ce6('0x31')][_0x8ce6('0xe')](this));_0x423e1c[_0x8ce6('0xb')](_0x8ce6('0xf'),this[_0x8ce6('0x32')][_0x8ce6('0xe')](this));}catch(_0x28a5b3){logger[_0x8ce6('0x11')](_0x28a5b3);}}else{this[_0x8ce6('0x1')][_0x8ce6('0x33')](!![],this[_0x8ce6('0x2b')][_0x8ce6('0xe')](this));}}};EmailImap[_0x8ce6('0x15')][_0x8ce6('0x34')]=function(_0x4f7d39){_0x4f7d39['on'](_0x8ce6('0x35'),this[_0x8ce6('0x36')]['bind'](this));_0x4f7d39[_0x8ce6('0xb')](_0x8ce6('0x37'),this[_0x8ce6('0x38')][_0x8ce6('0xe')](this));_0x4f7d39[_0x8ce6('0xb')]('end',this['handleMessageEnd'][_0x8ce6('0xe')](this));};EmailImap[_0x8ce6('0x15')]['handleMessageBody']=function(_0x5199b4){simpleParser(_0x5199b4,{'Iconv':Iconv},this[_0x8ce6('0x39')][_0x8ce6('0xe')](this));};EmailImap[_0x8ce6('0x15')][_0x8ce6('0x38')]=function(){};EmailImap[_0x8ce6('0x15')][_0x8ce6('0x3a')]=function(){};EmailImap['prototype'][_0x8ce6('0x39')]=function(_0x4b05be,_0x14deb3){if(_0x4b05be){logger['error'](_0x4b05be);}else{var _0x25ff21=this;utils[_0x8ce6('0x3b')](this[_0x8ce6('0x9')],_0x14deb3,function(_0x3f3515){_0x25ff21['emit'](_0x8ce6('0x1a'),_0x3f3515);});}};EmailImap['prototype'][_0x8ce6('0x32')]=function(){this['imap'][_0x8ce6('0x33')](!![],this[_0x8ce6('0x2b')][_0x8ce6('0xe')](this));};EmailImap['prototype'][_0x8ce6('0x31')]=function(_0x27a045){this[_0x8ce6('0x12')](_0x27a045);this[_0x8ce6('0x1')][_0x8ce6('0x33')](!![],this[_0x8ce6('0x2b')]['bind'](this));};EmailImap[_0x8ce6('0x15')][_0x8ce6('0x10')]=function(){this[_0x8ce6('0x28')]('end');};EmailImap[_0x8ce6('0x15')][_0x8ce6('0x12')]=function(_0x1bf754,_0x3cd5a0){logger[_0x8ce6('0x11')](_0x8ce6('0x12'),this[_0x8ce6('0x9')][_0x8ce6('0x1a')],JSON[_0x8ce6('0x3c')](_0x1bf754));var _0x40c44f='';if(_0x1bf754){if(_0x1bf754[_0x8ce6('0x3d')]){_0x40c44f=_0x1bf754[_0x8ce6('0x3d')];}else{for(var _0x3a3cf1 in _0x1bf754){if(_0x1bf754[_0x8ce6('0x3e')](_0x3a3cf1)){_0x40c44f+=_[_0x8ce6('0x3f')](_0x3a3cf1)+':\x20'+_0x1bf754[_0x3a3cf1]+'\x0a';}}}}if(_0x3cd5a0){this['imap'][_0x8ce6('0xf')]();}else{this[_0x8ce6('0x28')](_0x8ce6('0x11'),_0x40c44f);this[_0x8ce6('0x28')](_0x8ce6('0xf'));}};module[_0x8ce6('0x40')]=EmailImap;
\ No newline at end of file
+var _0x9536=['handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','emit','handleFetchError','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','user','anonymous@xcally.com','xoauth2','generateXOAuth2Token','data5','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','handleError','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchEnd','closeBox'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9536,0x179));var _0x6953=function(_0x2906e6,_0x5ccd59){_0x2906e6=_0x2906e6-0x0;var _0x12517a=_0x9536[_0x2906e6];return _0x12517a;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var Imap=require(_0x6953('0x2'));var simpleParser=require(_0x6953('0x3'))['simpleParser'];var Iconv=require(_0x6953('0x4'))['Iconv'];var EventEmitter=require(_0x6953('0x5'))[_0x6953('0x6')];var utils=require(_0x6953('0x7'));var logger=require(_0x6953('0x8'))(_0x6953('0x9'));function EmailImap(_0x494ac2,_0x2b273e){this[_0x6953('0xa')]=_0x6953('0xb');this[_0x6953('0xc')]=this[_0x6953('0xd')](_0x494ac2,_0x2b273e);this['imap']=new Imap(this[_0x6953('0xc')]);this[_0x6953('0x2')][_0x6953('0xe')]('ready',this[_0x6953('0xf')][_0x6953('0x10')](this));this[_0x6953('0x2')][_0x6953('0xe')](_0x6953('0x11'),this[_0x6953('0x12')][_0x6953('0x10')](this));this[_0x6953('0x2')]['on'](_0x6953('0x13'),this['handleError'][_0x6953('0x10')](this));this['imap'][_0x6953('0x14')]();}util[_0x6953('0x15')](EmailImap,EventEmitter);EmailImap[_0x6953('0x16')][_0x6953('0xd')]=function(_0x1b5221,_0x244713){var _0x175fa9={'connTimeout':_0x1b5221[_0x6953('0x17')]?_0x1b5221[_0x6953('0x17')]*0x3e8:0x2710,'authTimeout':_0x1b5221[_0x6953('0x18')]?_0x1b5221[_0x6953('0x18')]*0x3e8:0x1388};if(_0x1b5221['service']){_0x175fa9['user']=_0x1b5221[_0x6953('0x19')];_0x175fa9[_0x6953('0x9')]=_0x244713||_0x1b5221[_0x6953('0x19')]||_0x6953('0x1a');if(_0x1b5221['modernAuthentication']){_0x175fa9[_0x6953('0x1b')]=utils[_0x6953('0x1c')](_0x1b5221['CloudProvider'][_0x6953('0x1d')],_0x1b5221[_0x6953('0x19')]);}else{_0x175fa9[_0x6953('0x1e')]=_0x1b5221[_0x6953('0x1e')];}}else{if(_0x1b5221[_0x6953('0x1f')]){_0x175fa9['user']=_0x1b5221[_0x6953('0x19')];_0x175fa9[_0x6953('0x1e')]=_0x1b5221[_0x6953('0x1e')];}}_0x175fa9[_0x6953('0x20')]=_0x1b5221[_0x6953('0x20')];_0x175fa9['port']=_0x1b5221[_0x6953('0x21')]||0x3e1;if(_0x1b5221[_0x6953('0x22')]){_0x175fa9['tls']=!![];}else{_0x175fa9[_0x6953('0x22')]=![];_0x175fa9[_0x6953('0x23')]=_0x6953('0x24');}return _0x175fa9;};EmailImap[_0x6953('0x16')]['handleReady']=function(){this[_0x6953('0x2')][_0x6953('0x25')](this[_0x6953('0xa')],![],this['handleOpenBox']['bind'](this));};EmailImap['prototype'][_0x6953('0x26')]=function(_0x1bf5a9,_0x550be4){if(_0x1bf5a9){this[_0x6953('0x27')](_0x1bf5a9,!![]);}else{this['emit'](_0x6953('0x28'),_0x550be4);this[_0x6953('0x29')]();}};EmailImap[_0x6953('0x16')][_0x6953('0x2a')]=function(_0x191d80){if(_0x191d80){this[_0x6953('0x27')](_0x191d80,!![]);}else{this['imap'][_0x6953('0x11')]();}};EmailImap[_0x6953('0x16')]['readUnseen']=function(){this[_0x6953('0x2')]['search']([_0x6953('0x2b')],this[_0x6953('0x2c')][_0x6953('0x10')](this));};EmailImap['prototype'][_0x6953('0x2c')]=function(_0x3d7b04,_0xf78141){if(_0x3d7b04){this['handleError'](_0x3d7b04,!![]);}else{if(_0xf78141[_0x6953('0x2d')]){try{var _0x132a71=this['imap']['fetch'](_0xf78141,{'bodies':'','markSeen':!![]});_0x132a71['on'](_0x6953('0x2e'),this[_0x6953('0x2f')][_0x6953('0x10')](this));_0x132a71[_0x6953('0xe')](_0x6953('0x13'),this['handleFetchError'][_0x6953('0x10')](this));_0x132a71['once'](_0x6953('0x11'),this[_0x6953('0x30')]['bind'](this));}catch(_0x4a4d41){logger[_0x6953('0x13')](_0x4a4d41);}}else{this[_0x6953('0x2')][_0x6953('0x31')](!![],this['handleCloseBox'][_0x6953('0x10')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x5eda70){_0x5eda70['on']('body',this[_0x6953('0x32')][_0x6953('0x10')](this));_0x5eda70[_0x6953('0xe')](_0x6953('0x33'),this[_0x6953('0x34')][_0x6953('0x10')](this));_0x5eda70['once'](_0x6953('0x11'),this['handleMessageEnd'][_0x6953('0x10')](this));};EmailImap['prototype'][_0x6953('0x32')]=function(_0x383e31){simpleParser(_0x383e31,{'Iconv':Iconv},this[_0x6953('0x35')][_0x6953('0x10')](this));};EmailImap['prototype'][_0x6953('0x34')]=function(){};EmailImap[_0x6953('0x16')][_0x6953('0x36')]=function(){};EmailImap[_0x6953('0x16')][_0x6953('0x35')]=function(_0x475ea8,_0x37b2b3){if(_0x475ea8){logger[_0x6953('0x13')](_0x475ea8);}else{var _0xdf1944=this;utils[_0x6953('0x37')](this[_0x6953('0xc')],_0x37b2b3,function(_0x483a33){_0xdf1944[_0x6953('0x38')](_0x6953('0x9'),_0x483a33);});}};EmailImap[_0x6953('0x16')]['handleFetchEnd']=function(){this['imap'][_0x6953('0x31')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x6953('0x16')][_0x6953('0x39')]=function(_0x4b5e1c){this[_0x6953('0x27')](_0x4b5e1c);this[_0x6953('0x2')][_0x6953('0x31')](!![],this[_0x6953('0x2a')][_0x6953('0x10')](this));};EmailImap[_0x6953('0x16')]['handleEnd']=function(){this[_0x6953('0x38')](_0x6953('0x11'));};EmailImap[_0x6953('0x16')][_0x6953('0x27')]=function(_0x26d3a5,_0x2a20bf){logger['error']('handleError',this[_0x6953('0xc')]['email'],JSON['stringify'](_0x26d3a5));var _0x2d5403='';if(_0x26d3a5){if(_0x26d3a5[_0x6953('0x3a')]){_0x2d5403=_0x26d3a5[_0x6953('0x3a')];}else{for(var _0x1da621 in _0x26d3a5){if(_0x26d3a5[_0x6953('0x3b')](_0x1da621)){_0x2d5403+=_['upperFirst'](_0x1da621)+':\x20'+_0x26d3a5[_0x1da621]+'\x0a';}}}}if(_0x2a20bf){this['imap'][_0x6953('0x11')]();}else{this[_0x6953('0x38')]('error',_0x2d5403);this[_0x6953('0x38')]('end');}};module[_0x6953('0x3c')]=EmailImap;
\ No newline at end of file
index 38b0577..f8c56f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3be9=['Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','toString','verify'];(function(_0x34c43b,_0x507409){var _0x15fe1c=function(_0x2607e5){while(--_0x2607e5){_0x34c43b['push'](_0x34c43b['shift']());}};_0x15fe1c(++_0x507409);}(_0x3be9,0x1df));var _0x93be=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0x3be9[_0x9c8b4a];return _0x198bef;};'use strict';var nodemailer=require(_0x93be('0x0'));var inlineBase64=require(_0x93be('0x1'));function EmailSmtp(){}EmailSmtp[_0x93be('0x2')][_0x93be('0x3')]=function(_0x59afc0,_0x2c6ea8){return new Promise(function(_0x5cd9d2,_0x10b730){var _0x37af72=nodemailer[_0x93be('0x4')](_0x59afc0);_0x37af72['use']('compile',inlineBase64());_0x37af72['sendMail'](_0x2c6ea8,function(_0x38b89e,_0x42a0d3){if(_0x38b89e){_0x10b730(_0x38b89e[_0x93be('0x5')]());}else{_0x5cd9d2(_0x42a0d3);}});});};EmailSmtp[_0x93be('0x2')][_0x93be('0x6')]=function(_0x148988){return new Promise(function(_0x4f813d,_0x507168){var _0x579db9=nodemailer[_0x93be('0x4')](_0x148988);_0x579db9[_0x93be('0x6')](function(_0x509b26,_0x3d8324){if(_0x509b26){_0x507168(_0x509b26[_0x93be('0x5')]());}else{if(_0x3d8324){_0x4f813d(_0x3d8324);}else{_0x507168(_0x93be('0x7'));}}});});};module[_0x93be('0x8')]=EmailSmtp;
\ No newline at end of file
+var _0xc498=['createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','prototype'];(function(_0x2430d7,_0x25adb7){var _0x308629=function(_0x43f795){while(--_0x43f795){_0x2430d7['push'](_0x2430d7['shift']());}};_0x308629(++_0x25adb7);}(_0xc498,0x182));var _0x8c49=function(_0x5073ec,_0x34ccb2){_0x5073ec=_0x5073ec-0x0;var _0x4b7226=_0xc498[_0x5073ec];return _0x4b7226;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8c49('0x0')]['send']=function(_0x6fdc3d,_0x4f30e1){return new Promise(function(_0x2b4a66,_0x806d23){var _0x1c0e75=nodemailer[_0x8c49('0x1')](_0x6fdc3d);_0x1c0e75[_0x8c49('0x2')](_0x8c49('0x3'),inlineBase64());_0x1c0e75[_0x8c49('0x4')](_0x4f30e1,function(_0x405121,_0x1d6355){if(_0x405121){_0x806d23(_0x405121[_0x8c49('0x5')]());}else{_0x2b4a66(_0x1d6355);}});});};EmailSmtp['prototype']['verify']=function(_0xa3bff4){return new Promise(function(_0x340fe9,_0xf3771e){var _0x1d84b8=nodemailer[_0x8c49('0x1')](_0xa3bff4);_0x1d84b8[_0x8c49('0x6')](function(_0x13d47e,_0x245136){if(_0x13d47e){_0xf3771e(_0x13d47e[_0x8c49('0x5')]());}else{if(_0x245136){_0x340fe9(_0x245136);}else{_0xf3771e(_0x8c49('0x7'));}}});});};module[_0x8c49('0x8')]=EmailSmtp;
\ No newline at end of file
index 96d7f7b..cb82651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40eb=['includes','bcc','type','attachment-','format','%s-%s','now','join','root','server/files/attachments/','writeFileSync','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','<p>Empty\x20message</p>','Attachments','Data','user=','auth=Bearer\x20','utf-8','toString','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice','Anonymous','length','pop','isEmpty','html','replace','<img','attachments','forEach','push','filename','_IMG','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','message','originCc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40eb,0x14d));var _0xb40e=function(_0x525245,_0x72bcfb){_0x525245=_0x525245-0x0;var _0x2ea70a=_0x40eb[_0x525245];return _0x2ea70a;};'use strict';var _=require('lodash');var moment=require(_0xb40e('0x0'));var random=require(_0xb40e('0x1'));var fs=require('fs');var path=require(_0xb40e('0x2'));var util=require(_0xb40e('0x3'));var tnef=require(_0xb40e('0x4'));var logger=require(_0xb40e('0x5'))(_0xb40e('0x6'));var config=require('../../../config/environment');function getAddress(_0x275bf9){var _0x25e223=_[_0xb40e('0x7')](_0x275bf9[_0xb40e('0x8')]);return _0x25e223&&_0x25e223['address']?_0x25e223[_0xb40e('0x9')]:_0xb40e('0xa')+random[_0xb40e('0xb')](0x6)+_0xb40e('0xc');}function getFirstName(_0x143325){var _0x3ac926=_['head'](_0x143325[_0xb40e('0x8')]);if(_0x3ac926&&_0x3ac926['name']){if(_0x3ac926[_0xb40e('0xd')]==_0x3ac926['address']){return _0x3ac926[_0xb40e('0xd')][_0xb40e('0xe')](0x0,_0x3ac926[_0xb40e('0xd')][_0xb40e('0xf')]('@'));}var _0x4571d8=_0x3ac926[_0xb40e('0xd')][_0xb40e('0x10')](/\s+/);return _0x4571d8['length']>0x1?_0x4571d8[_0xb40e('0x11')](0x0,-0x1)['join']('\x20'):_0x3ac926[_0xb40e('0xd')];}return _0xb40e('0x12');}function getLastName(_0x1d2d8e){var _0x2a50dc=_[_0xb40e('0x7')](_0x1d2d8e[_0xb40e('0x8')]);if(_0x2a50dc&&_0x2a50dc[_0xb40e('0xd')]){var _0x38dac6=_0x2a50dc[_0xb40e('0xd')][_0xb40e('0x10')](/\s+/);return _0x38dac6[_0xb40e('0x13')]>0x1?_0x38dac6[_0xb40e('0x14')]():'';}return'';}function getMails(_0x5e6c88,_0x5ce494){var _0xd4fb93='';for(var _0x43f7a3=0x0;_0x43f7a3<_0x5ce494[_0xb40e('0x8')][_0xb40e('0x13')];_0x43f7a3+=0x1){if(_0x5ce494['value'][_0x43f7a3]['address']!==_0x5e6c88){if(!_[_0xb40e('0x15')](_0xd4fb93)){_0xd4fb93+=',';}_0xd4fb93+=_0x5ce494[_0xb40e('0x8')][_0x43f7a3][_0xb40e('0xd')]||_0x5ce494[_0xb40e('0x8')][_0x43f7a3]['address']||'';_0xd4fb93+='\x20<';_0xd4fb93+=_0x5ce494[_0xb40e('0x8')][_0x43f7a3]['address']?_0x5ce494[_0xb40e('0x8')][_0x43f7a3][_0xb40e('0x9')]:_0xb40e('0xa')+random['generate'](0x6)+_0xb40e('0xc');_0xd4fb93+='>';}}return _0xd4fb93;}function parseEmail(_0x1809c7,_0x55dd33,_0x53bcf6){if(_0x55dd33['html']){var _0x2aabbc=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x2aabbc['test'](_0x55dd33['html'])){_0x55dd33[_0xb40e('0x16')]=_0x55dd33[_0xb40e('0x16')][_0xb40e('0x17')](_0x2aabbc,'');}if(_0x55dd33['html']['includes'](_0xb40e('0x18'))){var _0x2e871d=[];_0x55dd33[_0xb40e('0x19')][_0xb40e('0x1a')](_0x2e55cd=>{_0x2e871d[_0xb40e('0x1b')](_0x2e55cd[_0xb40e('0x1c')]);});var _0x168801=/<img.*? _SRC(.*?)[^>]+>/g;var _0xc7c189=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1585be=_0x55dd33['html'][_0xb40e('0x17')](_0xc7c189,'_SRC');var _0x48eb88=_0x1585be[_0xb40e('0x17')](_0x168801,_0xb40e('0x1d'));for(let _0x4cd767=0x0;_0x4cd767<_0x2e871d['length'];_0x4cd767++){var _0xa2ad63=_0x48eb88[_0xb40e('0x17')](_0xb40e('0x1d'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x2e871d[_0x4cd767]+_0xb40e('0x1e'));_0x48eb88=_0xa2ad63;}_0x55dd33[_0xb40e('0x16')]=_0x48eb88;}_0x53bcf6[_0xb40e('0x1f')]=_0x55dd33[_0xb40e('0x16')];}else{_0x53bcf6[_0xb40e('0x1f')]=_0x55dd33[_0xb40e('0x20')];}if(_0x53bcf6[_0xb40e('0x1f')]){_0x53bcf6['body']=_0x53bcf6['body'][_0xb40e('0x17')](/<a\s+/gi,_0xb40e('0x21'));}if(_0x55dd33['to']){_0x53bcf6['message'][_0xb40e('0x22')]=getMails(null,_0x55dd33['to']);var _0x1792a6=getMails(_0x1809c7[_0xb40e('0x6')],_0x55dd33['to']);if(!_[_0xb40e('0x15')](_0x1792a6)){_0x53bcf6[_0xb40e('0x23')]['cc']+=_0x1792a6;}}if(_0x55dd33['cc']){_0x53bcf6['message'][_0xb40e('0x24')]=getMails(null,_0x55dd33['cc']);var _0x21ad83=getMails(_0x1809c7[_0xb40e('0x6')],_0x55dd33['cc']);if(!_['isEmpty'](_0x21ad83)){if(!_[_0xb40e('0x15')](_0x53bcf6[_0xb40e('0x23')]['cc'])){_0x53bcf6[_0xb40e('0x23')]['cc']+=',';}_0x53bcf6['message']['cc']+=_0x21ad83;}}if(!_[_0xb40e('0x25')](_0x53bcf6['message']['originTo'],_0x1809c7[_0xb40e('0x6')])&&!_[_0xb40e('0x25')](_0x53bcf6[_0xb40e('0x23')][_0xb40e('0x24')],_0x1809c7[_0xb40e('0x6')])){_0x53bcf6[_0xb40e('0x23')][_0xb40e('0x26')]=_0x1809c7[_0xb40e('0x6')];}if(_0x55dd33[_0xb40e('0x19')]&&_0x55dd33['attachments'][_0xb40e('0x13')]){_0x53bcf6[_0xb40e('0x23')]['attach']=_0x55dd33[_0xb40e('0x19')][_0xb40e('0x13')];for(var _0x1fc48e=0x0,_0x1b900e,_0x5bb120,_0x185537;_0x1fc48e<_0x55dd33['attachments']['length'];_0x1fc48e+=0x1){if(_0x55dd33[_0xb40e('0x19')][_0x1fc48e][_0xb40e('0x27')]==='attachment'){_0x185537=_0x55dd33['attachments'][_0x1fc48e][_0xb40e('0x1c')]||_0xb40e('0x28')+_0x1fc48e;_0x1b900e=util[_0xb40e('0x29')](_0xb40e('0x2a'),Date[_0xb40e('0x2b')](),_0x185537);_0x5bb120=path[_0xb40e('0x2c')](config[_0xb40e('0x2d')],_0xb40e('0x2e'),_0x1b900e);fs[_0xb40e('0x2f')](_0x5bb120,_0x55dd33[_0xb40e('0x19')][_0x1fc48e]['content']);_0x53bcf6['message'][_0xb40e('0x19')][_0xb40e('0x1b')]({'name':_0x185537,'basename':_0x1b900e,'type':_0x55dd33[_0xb40e('0x19')][_0x1fc48e][_0xb40e('0x30')],'filepath':_0x5bb120});}}}if(_0x55dd33[_0xb40e('0x31')]&&_0x55dd33[_0xb40e('0x31')][_0xb40e('0x13')]>0x0){var _0x15da82=[_0xb40e('0x32'),_0xb40e('0x33'),_0xb40e('0x34')];for(var _0x170821=0x0;_0x170821<_0x55dd33['headerLines']['length'];_0x170821++){var _0x37344a=_[_0xb40e('0xf')](_0x15da82,_0x55dd33[_0xb40e('0x31')][_0x170821][_0xb40e('0x35')]);if(_0x37344a>=0x0){_0x53bcf6[_0xb40e('0x36')]=!![];}}}return _0x53bcf6;}exports[_0xb40e('0x37')]=function(_0x5a9d18,_0x1e052e,_0x5cba92){var _0x4379dc={'from':getAddress(_0x1e052e[_0xb40e('0x38')]),'firstName':getFirstName(_0x1e052e[_0xb40e('0x38')]),'lastName':getLastName(_0x1e052e[_0xb40e('0x38')]),'mapKey':_0xb40e('0x6'),'message':{'from':getMails(_0x5a9d18[_0xb40e('0x6')],_0x1e052e[_0xb40e('0x38')]),'to':_0x5a9d18[_0xb40e('0x6')],'cc':'','subject':_0x1e052e['subject']||'','messageId':_0x1e052e[_0xb40e('0x39')],'inReplyTo':_0x1e052e[_0xb40e('0x3a')],'sentAt':moment(_0x1e052e[_0xb40e('0x3b')])[_0xb40e('0x29')](_0xb40e('0x3c')),'attach':![],'attachments':[]}};if(!_0x1e052e[_0xb40e('0x16')]&&!_0x1e052e[_0xb40e('0x20')]){var _0x36259d=_['filter'](_0x1e052e[_0xb40e('0x19')],{'contentType':_0xb40e('0x3d')});if(_0x36259d['length']){logger[_0xb40e('0x3e')](util[_0xb40e('0x29')](_0xb40e('0x3f'),_0x1e052e['messageId']));tnef[_0xb40e('0x40')](_[_0xb40e('0x41')](_0x36259d)[_0xb40e('0x42')],function(_0xf45570,_0x13617c){if(_0x13617c){_0x1e052e[_0xb40e('0x16')]=_0x13617c['BodyHTML']||_0xb40e('0x43');if(_0x13617c[_0xb40e('0x44')]){for(var _0x321b67=0x0;_0x321b67<_0x13617c['Attachments'][_0xb40e('0x13')];_0x321b67++){var _0x3503d6=_0x13617c[_0xb40e('0x44')][_0x321b67];_0x4379dc[_0xb40e('0x23')][_0xb40e('0x19')]['push']({'filename':_0x3503d6['Title'],'content':Buffer[_0xb40e('0x38')](_0x3503d6[_0xb40e('0x45')])});}}}_0x5cba92(parseEmail(_0x5a9d18,_0x1e052e,_0x4379dc));});}else{_0x1e052e[_0xb40e('0x16')]='<p>Empty\x20message</p>';_0x5cba92(parseEmail(_0x5a9d18,_0x1e052e,_0x4379dc));}}else{_0x5cba92(parseEmail(_0x5a9d18,_0x1e052e,_0x4379dc));}};exports['generateXOAuth2Token']=function(_0x46cd75,_0x4ae81a){var _0x177846=[_0xb40e('0x46')+(_0x4ae81a||''),_0xb40e('0x47')+_0x46cd75,'',''];return Buffer[_0xb40e('0x38')](_0x177846[_0xb40e('0x2c')]('\ 1'),_0xb40e('0x48'))[_0xb40e('0x49')]('base64');};
\ No newline at end of file
+var _0x8eb0=['first','BodyHTML','<p>Empty\x20message</p>','Attachments','user=','auth=Bearer\x20','toString','base64','randomstring','path','node-tnef','../../../config/logger','../../../config/environment','head','address','anonymous','generate','@xcally.com','name','substring','split','slice','join','Anonymous','value','length','pop','html','test','replace','includes','<img','attachments','_SRC','<span\x20style=font-weight:bold>\x20[Attachment:\x20','body','<a\x20target=\x22_blank\x22\x20','message','email','isEmpty','originCc','originTo','attach','type','attachment','filename','attachment-','format','%s-%s','now','root','server/files/attachments/','content','push','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','from','messageId','inReplyTo','textAsHtml','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8eb0,0x161));var _0x08eb=function(_0x2a7dfe,_0x32eeec){_0x2a7dfe=_0x2a7dfe-0x0;var _0xb6dd24=_0x8eb0[_0x2a7dfe];return _0xb6dd24;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x08eb('0x0'));var fs=require('fs');var path=require(_0x08eb('0x1'));var util=require('util');var tnef=require(_0x08eb('0x2'));var logger=require(_0x08eb('0x3'))('email');var config=require(_0x08eb('0x4'));function getAddress(_0x219db1){var _0x596b89=_[_0x08eb('0x5')](_0x219db1['value']);return _0x596b89&&_0x596b89[_0x08eb('0x6')]?_0x596b89['address']:_0x08eb('0x7')+random[_0x08eb('0x8')](0x6)+_0x08eb('0x9');}function getFirstName(_0x24f8c8){var _0xa09865=_[_0x08eb('0x5')](_0x24f8c8['value']);if(_0xa09865&&_0xa09865[_0x08eb('0xa')]){if(_0xa09865[_0x08eb('0xa')]==_0xa09865['address']){return _0xa09865[_0x08eb('0xa')][_0x08eb('0xb')](0x0,_0xa09865[_0x08eb('0xa')]['indexOf']('@'));}var _0x3fd5a8=_0xa09865[_0x08eb('0xa')][_0x08eb('0xc')](/\s+/);return _0x3fd5a8['length']>0x1?_0x3fd5a8[_0x08eb('0xd')](0x0,-0x1)[_0x08eb('0xe')]('\x20'):_0xa09865['name'];}return _0x08eb('0xf');}function getLastName(_0x53428e){var _0x3f9b4e=_[_0x08eb('0x5')](_0x53428e[_0x08eb('0x10')]);if(_0x3f9b4e&&_0x3f9b4e[_0x08eb('0xa')]){var _0x305cab=_0x3f9b4e[_0x08eb('0xa')][_0x08eb('0xc')](/\s+/);return _0x305cab[_0x08eb('0x11')]>0x1?_0x305cab[_0x08eb('0x12')]():'';}return'';}function getMails(_0x2214fe,_0x594cbd){var _0x4dbe03='';for(var _0x500164=0x0;_0x500164<_0x594cbd['value'][_0x08eb('0x11')];_0x500164+=0x1){if(_0x594cbd[_0x08eb('0x10')][_0x500164][_0x08eb('0x6')]!==_0x2214fe){if(!_['isEmpty'](_0x4dbe03)){_0x4dbe03+=',';}_0x4dbe03+=_0x594cbd[_0x08eb('0x10')][_0x500164][_0x08eb('0xa')]||_0x594cbd[_0x08eb('0x10')][_0x500164]['address']||'';_0x4dbe03+='\x20<';_0x4dbe03+=_0x594cbd[_0x08eb('0x10')][_0x500164]['address']?_0x594cbd[_0x08eb('0x10')][_0x500164][_0x08eb('0x6')]:_0x08eb('0x7')+random[_0x08eb('0x8')](0x6)+_0x08eb('0x9');_0x4dbe03+='>';}}return _0x4dbe03;}function parseEmail(_0x191376,_0x57c753,_0x2c688b){if(_0x57c753[_0x08eb('0x13')]){var _0xf59362=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0xf59362[_0x08eb('0x14')](_0x57c753['html'])){_0x57c753[_0x08eb('0x13')]=_0x57c753['html'][_0x08eb('0x15')](_0xf59362,'');}if(_0x57c753['html'][_0x08eb('0x16')](_0x08eb('0x17'))){var _0x1dd47f=[];_0x57c753[_0x08eb('0x18')]['forEach'](_0x245c08=>{_0x1dd47f['push'](_0x245c08['filename']);});var _0x4fc7f8=/<img.*? _SRC(.*?)[^>]+>/g;var _0x4afb80=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2d2f41=_0x57c753[_0x08eb('0x13')][_0x08eb('0x15')](_0x4afb80,_0x08eb('0x19'));var _0x177238=_0x2d2f41[_0x08eb('0x15')](_0x4fc7f8,'_IMG');for(let _0x19988e=0x0;_0x19988e<_0x1dd47f[_0x08eb('0x11')];_0x19988e++){var _0x589fd4=_0x177238['replace']('_IMG',_0x08eb('0x1a')+_0x1dd47f[_0x19988e]+'\x20]</span>');_0x177238=_0x589fd4;}_0x57c753[_0x08eb('0x13')]=_0x177238;}_0x2c688b[_0x08eb('0x1b')]=_0x57c753['html'];}else{_0x2c688b[_0x08eb('0x1b')]=_0x57c753['textAsHtml'];}if(_0x2c688b['body']){_0x2c688b['body']=_0x2c688b[_0x08eb('0x1b')][_0x08eb('0x15')](/<a\s+/gi,_0x08eb('0x1c'));}if(_0x57c753['to']){_0x2c688b[_0x08eb('0x1d')]['originTo']=getMails(null,_0x57c753['to']);var _0x120d4d=getMails(_0x191376[_0x08eb('0x1e')],_0x57c753['to']);if(!_[_0x08eb('0x1f')](_0x120d4d)){_0x2c688b[_0x08eb('0x1d')]['cc']+=_0x120d4d;}}if(_0x57c753['cc']){_0x2c688b[_0x08eb('0x1d')][_0x08eb('0x20')]=getMails(null,_0x57c753['cc']);var _0x27d740=getMails(_0x191376[_0x08eb('0x1e')],_0x57c753['cc']);if(!_[_0x08eb('0x1f')](_0x27d740)){if(!_[_0x08eb('0x1f')](_0x2c688b[_0x08eb('0x1d')]['cc'])){_0x2c688b[_0x08eb('0x1d')]['cc']+=',';}_0x2c688b[_0x08eb('0x1d')]['cc']+=_0x27d740;}}if(!_[_0x08eb('0x16')](_0x2c688b['message'][_0x08eb('0x21')],_0x191376[_0x08eb('0x1e')])&&!_[_0x08eb('0x16')](_0x2c688b[_0x08eb('0x1d')]['originCc'],_0x191376[_0x08eb('0x1e')])){_0x2c688b[_0x08eb('0x1d')]['bcc']=_0x191376[_0x08eb('0x1e')];}if(_0x57c753[_0x08eb('0x18')]&&_0x57c753[_0x08eb('0x18')][_0x08eb('0x11')]){_0x2c688b['message'][_0x08eb('0x22')]=_0x57c753[_0x08eb('0x18')][_0x08eb('0x11')];for(var _0x5d8c22=0x0,_0x34af34,_0x17da83,_0x12cc12;_0x5d8c22<_0x57c753[_0x08eb('0x18')][_0x08eb('0x11')];_0x5d8c22+=0x1){if(_0x57c753['attachments'][_0x5d8c22][_0x08eb('0x23')]===_0x08eb('0x24')){_0x12cc12=_0x57c753['attachments'][_0x5d8c22][_0x08eb('0x25')]||_0x08eb('0x26')+_0x5d8c22;_0x34af34=util[_0x08eb('0x27')](_0x08eb('0x28'),Date[_0x08eb('0x29')](),_0x12cc12);_0x17da83=path[_0x08eb('0xe')](config[_0x08eb('0x2a')],_0x08eb('0x2b'),_0x34af34);fs['writeFileSync'](_0x17da83,_0x57c753[_0x08eb('0x18')][_0x5d8c22][_0x08eb('0x2c')]);_0x2c688b['message'][_0x08eb('0x18')][_0x08eb('0x2d')]({'name':_0x12cc12,'basename':_0x34af34,'type':_0x57c753['attachments'][_0x5d8c22][_0x08eb('0x2e')],'filepath':_0x17da83});}}}if(_0x57c753['headerLines']&&_0x57c753[_0x08eb('0x2f')]['length']>0x0){var _0x40e368=['Auto-Submitted:\x20auto-replied',_0x08eb('0x30'),_0x08eb('0x31')];for(var _0xd3ec89=0x0;_0xd3ec89<_0x57c753[_0x08eb('0x2f')]['length'];_0xd3ec89++){var _0x3226de=_[_0x08eb('0x32')](_0x40e368,_0x57c753[_0x08eb('0x2f')][_0xd3ec89][_0x08eb('0x33')]);if(_0x3226de>=0x0){_0x2c688b[_0x08eb('0x34')]=!![];}}}return _0x2c688b;}exports['parser']=function(_0x56ac81,_0x66b1f3,_0x4eb29b){var _0x2d2890={'from':getAddress(_0x66b1f3[_0x08eb('0x35')]),'firstName':getFirstName(_0x66b1f3['from']),'lastName':getLastName(_0x66b1f3[_0x08eb('0x35')]),'mapKey':_0x08eb('0x1e'),'message':{'from':getMails(_0x56ac81[_0x08eb('0x1e')],_0x66b1f3[_0x08eb('0x35')]),'to':_0x56ac81[_0x08eb('0x1e')],'cc':'','subject':_0x66b1f3['subject']||'','messageId':_0x66b1f3[_0x08eb('0x36')],'inReplyTo':_0x66b1f3[_0x08eb('0x37')],'sentAt':moment(_0x66b1f3['date'])[_0x08eb('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x66b1f3[_0x08eb('0x13')]&&!_0x66b1f3[_0x08eb('0x38')]){var _0x1d37c5=_[_0x08eb('0x39')](_0x66b1f3[_0x08eb('0x18')],{'contentType':_0x08eb('0x3a')});if(_0x1d37c5[_0x08eb('0x11')]){logger[_0x08eb('0x3b')](util[_0x08eb('0x27')](_0x08eb('0x3c'),_0x66b1f3['messageId']));tnef['parseBuffer'](_[_0x08eb('0x3d')](_0x1d37c5)[_0x08eb('0x2c')],function(_0x4a0cd2,_0x250144){if(_0x250144){_0x66b1f3[_0x08eb('0x13')]=_0x250144[_0x08eb('0x3e')]||_0x08eb('0x3f');if(_0x250144[_0x08eb('0x40')]){for(var _0x42dc0f=0x0;_0x42dc0f<_0x250144[_0x08eb('0x40')]['length'];_0x42dc0f++){var _0x5e5252=_0x250144[_0x08eb('0x40')][_0x42dc0f];_0x2d2890['message'][_0x08eb('0x18')][_0x08eb('0x2d')]({'filename':_0x5e5252['Title'],'content':Buffer[_0x08eb('0x35')](_0x5e5252['Data'])});}}}_0x4eb29b(parseEmail(_0x56ac81,_0x66b1f3,_0x2d2890));});}else{_0x66b1f3[_0x08eb('0x13')]=_0x08eb('0x3f');_0x4eb29b(parseEmail(_0x56ac81,_0x66b1f3,_0x2d2890));}}else{_0x4eb29b(parseEmail(_0x56ac81,_0x66b1f3,_0x2d2890));}};exports['generateXOAuth2Token']=function(_0x2ea4da,_0x30cd99){var _0x46c2ac=[_0x08eb('0x41')+(_0x30cd99||''),_0x08eb('0x42')+_0x2ea4da,'',''];return Buffer[_0x08eb('0x35')](_0x46c2ac[_0x08eb('0xe')]('\ 1'),'utf-8')[_0x08eb('0x43')](_0x08eb('0x44'));};
\ No newline at end of file
index cd28611..ec5779e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e4=['name','Service','key','active','Imap','exports'];(function(_0x499c0d,_0x3a36b7){var _0x19dfb4=function(_0x55463f){while(--_0x55463f){_0x499c0d['push'](_0x499c0d['shift']());}};_0x19dfb4(++_0x3a36b7);}(_0x50e4,0x84));var _0x450e=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x50e4[_0x4b73a2];return _0x383c66;};'use strict';var _=require('lodash');function MailAccount(_0x507f23){this['id']=_0x507f23['id']||0x0;this[_0x450e('0x0')]=_0x507f23[_0x450e('0x0')]||_0x450e('0x1');this[_0x450e('0x2')]=_0x507f23[_0x450e('0x2')]||'SERV';this[_0x450e('0x3')]=_0x507f23[_0x450e('0x3')]||![];this[_0x450e('0x4')]=_0x507f23[_0x450e('0x4')]||[];this['Smtp']=_0x507f23['Smtp']||[];}module[_0x450e('0x5')]=MailAccount;
\ No newline at end of file
+var _0xa0ea=['Imap','Smtp','exports','lodash','name','key','SERV','active'];(function(_0x7d1a16,_0x1bc3fb){var _0x307967=function(_0x2b23ed){while(--_0x2b23ed){_0x7d1a16['push'](_0x7d1a16['shift']());}};_0x307967(++_0x1bc3fb);}(_0xa0ea,0x1a3));var _0xaa0e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa0ea[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa0e('0x0'));function MailAccount(_0x16491f){this['id']=_0x16491f['id']||0x0;this[_0xaa0e('0x1')]=_0x16491f[_0xaa0e('0x1')]||'Service';this[_0xaa0e('0x2')]=_0x16491f[_0xaa0e('0x2')]||_0xaa0e('0x3');this['active']=_0x16491f[_0xaa0e('0x4')]||![];this[_0xaa0e('0x5')]=_0x16491f[_0xaa0e('0x5')]||[];this[_0xaa0e('0x6')]=_0x16491f[_0xaa0e('0x6')]||[];}module[_0xaa0e('0x7')]=MailAccount;
\ No newline at end of file
index 0c91095..cea2f1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9efe=['mergeFromDatabase','prototype','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9efe,0x124));var _0xe9ef=function(_0x388c94,_0x53e4a0){_0x388c94=_0x388c94-0x0;var _0x26bf41=_0x9efe[_0x388c94];return _0x26bf41;};'use strict';var _=require(_0xe9ef('0x0'));var MailAccount=require(_0xe9ef('0x1'));var Realtime=function(){this[_0xe9ef('0x2')]={};};function freeIsNotKey(_0xcae34b,_0x109fe0,_0x6cedeb){var _0x3574be=_[_0xe9ef('0x3')](_0xcae34b,function(_0x163d5e,_0x114ec5){return _0x163d5e[_0x6cedeb];});for(var _0x1cd1c7 in _0x109fe0){if(_0x109fe0[_0xe9ef('0x4')](_0x1cd1c7)){if(!_0x3574be[_0x1cd1c7]){delete _0x109fe0[_0x1cd1c7];}}}}Realtime['prototype'][_0xe9ef('0x5')]=function(_0x4310f5,_0x1fecee){for(var _0xe4d786 in _0x1fecee){if(_0x4310f5['hasOwnProperty'](_0xe4d786)){_0x4310f5[_0xe4d786]=_0x1fecee[_0xe4d786];}}};Realtime[_0xe9ef('0x6')]['initMailAccounts']=function(){var _0x3d7724=this;return function(_0x4b3c81){if(_0x4b3c81){freeIsNotKey(_0x4b3c81,_0x3d7724['mailAccounts'],'id');for(var _0x1d3cf0=0x0,_0x588518={},_0x412527={};_0x1d3cf0<_0x4b3c81[_0xe9ef('0x7')];_0x1d3cf0+=0x1){_0x588518=_0x4b3c81[_0x1d3cf0];if(_[_0xe9ef('0x8')](_0x3d7724[_0xe9ef('0x2')][_0x588518['id']])){_0x3d7724[_0xe9ef('0x2')][_0x588518['id']]=new MailAccount(_0x588518);}else{_[_0xe9ef('0x9')](_0x3d7724[_0xe9ef('0x2')][_0x588518['id']],_0x588518);}}}return _0x3d7724[_0xe9ef('0x2')];};};module[_0xe9ef('0xa')]=Realtime;
\ No newline at end of file
+var _0x53f7=['prototype','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge','../model/mailAccount','mapKeys','hasOwnProperty'];(function(_0x4faf8a,_0x3b331a){var _0x4fc0d3=function(_0xb6f4eb){while(--_0xb6f4eb){_0x4faf8a['push'](_0x4faf8a['shift']());}};_0x4fc0d3(++_0x3b331a);}(_0x53f7,0x11f));var _0x753f=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x53f7[_0x2f6233];return _0x1c9c36;};'use strict';var _=require('lodash');var MailAccount=require(_0x753f('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1791ec,_0x5ec2a8,_0x1138e4){var _0x44a693=_[_0x753f('0x1')](_0x1791ec,function(_0x5d4467,_0x21084c){return _0x5d4467[_0x1138e4];});for(var _0x58e1c6 in _0x5ec2a8){if(_0x5ec2a8[_0x753f('0x2')](_0x58e1c6)){if(!_0x44a693[_0x58e1c6]){delete _0x5ec2a8[_0x58e1c6];}}}}Realtime[_0x753f('0x3')][_0x753f('0x4')]=function(_0x3ff88d,_0x17924d){for(var _0x132498 in _0x17924d){if(_0x3ff88d[_0x753f('0x2')](_0x132498)){_0x3ff88d[_0x132498]=_0x17924d[_0x132498];}}};Realtime[_0x753f('0x3')][_0x753f('0x5')]=function(){var _0x15d4b0=this;return function(_0x204d7c){if(_0x204d7c){freeIsNotKey(_0x204d7c,_0x15d4b0[_0x753f('0x6')],'id');for(var _0x4c5723=0x0,_0x2b0ec2={},_0x538e12={};_0x4c5723<_0x204d7c[_0x753f('0x7')];_0x4c5723+=0x1){_0x2b0ec2=_0x204d7c[_0x4c5723];if(_[_0x753f('0x8')](_0x15d4b0['mailAccounts'][_0x2b0ec2['id']])){_0x15d4b0[_0x753f('0x6')][_0x2b0ec2['id']]=new MailAccount(_0x2b0ec2);}else{_[_0x753f('0x9')](_0x15d4b0[_0x753f('0x6')][_0x2b0ec2['id']],_0x2b0ec2);}}}return _0x15d4b0['mailAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
index a5f5cfd..ec35806 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfd3=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','key','MailServerIn','Imap','CloudProvider','MailServerOut','Smtp','type','data5','getMailAccount','notify'];(function(_0x13d0d9,_0x5adf33){var _0x4bcb76=function(_0x1d9c81){while(--_0x1d9c81){_0x13d0d9['push'](_0x13d0d9['shift']());}};_0x4bcb76(++_0x5adf33);}(_0xbfd3,0x144));var _0x3bfd=function(_0x475a58,_0x3bb8cd){_0x475a58=_0x475a58-0x0;var _0x5a0757=_0xbfd3[_0x475a58];return _0x5a0757;};'use strict';var client=require(_0x3bfd('0x0'));exports[_0x3bfd('0x1')]=function(){return function(){return client[_0x3bfd('0x2')](_0x3bfd('0x3'),{'options':{'attributes':['id',_0x3bfd('0x4'),'provider',_0x3bfd('0x5'),'email','active',_0x3bfd('0x6'),'ListId','TemplateId'],'raw':![],'include':[{'model':_0x3bfd('0x7'),'as':_0x3bfd('0x8'),'include':[{'model':_0x3bfd('0x9'),'attributes':['id',_0x3bfd('0x4'),_0x3bfd('0x5'),'type','data5'],'as':_0x3bfd('0x9')}]},{'model':_0x3bfd('0xa'),'as':_0x3bfd('0xb'),'include':[{'model':'CloudProvider','attributes':['id',_0x3bfd('0x4'),_0x3bfd('0x5'),_0x3bfd('0xc'),_0x3bfd('0xd')],'as':_0x3bfd('0x9')}]}]},'log':_0x3bfd('0xe')});};};exports[_0x3bfd('0xf')]=function(_0xcdc6ca,_0x2ca7e8){return client[_0x3bfd('0x2')](_0x3bfd('0x10'),{'account':{'id':_0xcdc6ca},'body':_0x2ca7e8,'log':_0x3bfd('0x10')});};
\ No newline at end of file
+var _0x96fd=['email','active','key','TemplateId','MailServerIn','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','GetMailAccount','name','service'];(function(_0x396539,_0x44d8b3){var _0x35540f=function(_0x4bc016){while(--_0x4bc016){_0x396539['push'](_0x396539['shift']());}};_0x35540f(++_0x44d8b3);}(_0x96fd,0x1e9));var _0xd96f=function(_0x152ea0,_0x41680d){_0x152ea0=_0x152ea0-0x0;var _0x4fb061=_0x96fd[_0x152ea0];return _0x4fb061;};'use strict';var client=require('../client');exports[_0xd96f('0x0')]=function(){return function(){return client['Request'](_0xd96f('0x1'),{'options':{'attributes':['id',_0xd96f('0x2'),'provider',_0xd96f('0x3'),_0xd96f('0x4'),_0xd96f('0x5'),_0xd96f('0x6'),'ListId',_0xd96f('0x7')],'raw':![],'include':[{'model':_0xd96f('0x8'),'as':'Imap','include':[{'model':_0xd96f('0x9'),'attributes':['id',_0xd96f('0x2'),_0xd96f('0x3'),_0xd96f('0xa'),_0xd96f('0xb')],'as':_0xd96f('0x9')}]},{'model':_0xd96f('0xc'),'as':_0xd96f('0xd'),'include':[{'model':_0xd96f('0x9'),'attributes':['id',_0xd96f('0x2'),_0xd96f('0x3'),_0xd96f('0xa'),_0xd96f('0xb')],'as':_0xd96f('0x9')}]}]},'log':_0xd96f('0xe')});};};exports[_0xd96f('0xf')]=function(_0x2b2226,_0x187274){return client['Request']('NotifyMailAccount',{'account':{'id':_0x2b2226},'body':_0x187274,'log':_0xd96f('0x10')});};
\ No newline at end of file
index 6a01607..c9e9d00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef13=['loginMailFrequency','getSettings','ShowSetting'];(function(_0x26e563,_0x1277c2){var _0x5f0074=function(_0x1ef782){while(--_0x1ef782){_0x26e563['push'](_0x26e563['shift']());}};_0x5f0074(++_0x1277c2);}(_0xef13,0xd0));var _0x3ef1=function(_0x1ea4bd,_0x34f465){_0x1ea4bd=_0x1ea4bd-0x0;var _0x5cc83c=_0xef13[_0x1ea4bd];return _0x5cc83c;};'use strict';var client=require('../client');exports[_0x3ef1('0x0')]=function(){return client['Request'](_0x3ef1('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3ef1('0x2')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0x4fcd=['Request','ShowSetting','loginMailFrequency','../client','getSettings'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0x4fcd,0x76));var _0xd4fc=function(_0x4a9dd1,_0xfa8de5){_0x4a9dd1=_0x4a9dd1-0x0;var _0x2e761a=_0x4fcd[_0x4a9dd1];return _0x2e761a;};'use strict';var client=require(_0xd4fc('0x0'));exports[_0xd4fc('0x1')]=function(){return client[_0xd4fc('0x2')](_0xd4fc('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd4fc('0x4')]},'log':'GetSettings'});};
\ No newline at end of file
index 918a9ee..bf355fb 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 e6407c7..b9ca388 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0038=['default','../../config/socketio','../../config/express','../../routes','once','listening','log','exports','http','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers'];(function(_0xd8e664,_0x5c8f14){var _0x4a4e7c=function(_0x23f46d){while(--_0x23f46d){_0xd8e664['push'](_0xd8e664['shift']());}};_0x4a4e7c(++_0x5c8f14);}(_0x0038,0xd7));var _0x8003=function(_0x4a4bfe,_0xcf1c9b){_0x4a4bfe=_0x4a4bfe-0x0;var _0x3714dc=_0x0038[_0x4a4bfe];return _0x3714dc;};'use strict';var _=require('lodash');var http=require(_0x8003('0x0'));var express=require('express');var sticky=require(_0x8003('0x1'));var Redis=require(_0x8003('0x2'));var config=require(_0x8003('0x3'));var app=express();var server=http[_0x8003('0x4')](app);server[_0x8003('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x8003('0x6')])){var socketio=require(_0x8003('0x7'))(server,{'transports':[_0x8003('0x8'),_0x8003('0x9')]});config[_0x8003('0xa')]=_[_0x8003('0xb')](config['redis'],{'host':_0x8003('0xc'),'port':0x18eb});socketio['adapter'](require(_0x8003('0xd'))({'pubClient':new Redis(config[_0x8003('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x8003('0xe'))[_0x8003('0xf')]();require(_0x8003('0x10'))[_0x8003('0xf')](socketio);require(_0x8003('0x11'))[_0x8003('0xf')](app);require(_0x8003('0x12'))[_0x8003('0xf')](app);}else{server[_0x8003('0x13')](_0x8003('0x14'),function(){console[_0x8003('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x8003('0x6')]);});}exports=module[_0x8003('0x16')]=app;
\ No newline at end of file
+var _0x363c=['localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','port','socket.io','websocket','defaults','redis'];(function(_0x170e45,_0x1334f1){var _0x48a42c=function(_0x556d5e){while(--_0x556d5e){_0x170e45['push'](_0x170e45['shift']());}};_0x48a42c(++_0x1334f1);}(_0x363c,0x96));var _0xc363=function(_0x381dbb,_0x4a1419){_0x381dbb=_0x381dbb-0x0;var _0x301378=_0x363c[_0x381dbb];return _0x301378;};'use strict';var _=require(_0xc363('0x0'));var http=require(_0xc363('0x1'));var express=require(_0xc363('0x2'));var sticky=require(_0xc363('0x3'));var Redis=require(_0xc363('0x4'));var config=require(_0xc363('0x5'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0xc363('0x6')])){var socketio=require(_0xc363('0x7'))(server,{'transports':[_0xc363('0x8'),'polling']});config['redis']=_[_0xc363('0x9')](config[_0xc363('0xa')],{'host':_0xc363('0xb'),'port':0x18eb});socketio[_0xc363('0xc')](require(_0xc363('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xc363('0xa')])}));require('../../config/triggers')[_0xc363('0xe')]();require(_0xc363('0xf'))[_0xc363('0xe')](socketio);require(_0xc363('0x10'))[_0xc363('0xe')](app);require(_0xc363('0x11'))[_0xc363('0xe')](app);}else{server[_0xc363('0x12')](_0xc363('0x13'),function(){console[_0xc363('0x14')](_0xc363('0x15'),config[_0xc363('0x6')]);});}exports=module[_0xc363('0x16')]=app;
\ No newline at end of file
index 6bb8a5c..aa12b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5db5=['catch','jayson/promise','../../config/logger','routing','http','Request','request','then','debug','rpc','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5db5,0x83));var _0x55db=function(_0xf204c0,_0x1cd229){_0xf204c0=_0xf204c0-0x0;var _0x1b7add=_0x5db5[_0xf204c0];return _0x1b7add;};'use strict';var jayson=require(_0x55db('0x0'));var BPromise=require('bluebird');var logger=require(_0x55db('0x1'))(_0x55db('0x2'));var client=jayson['client'][_0x55db('0x3')]({'port':0x2329});client[_0x55db('0x4')]=function(_0x3dad24,_0x1eb00b){return new BPromise(function(_0x107a12,_0x1024d1){return client[_0x55db('0x5')](_0x3dad24,_0x1eb00b)[_0x55db('0x6')](function(_0x278579){logger[_0x55db('0x7')](_0x55db('0x8'),_0x55db('0x2'),_0x3dad24,_0x1eb00b,_0x278579);if(_0x278579['error']){logger[_0x55db('0x9')](_0x55db('0x8'),'routing',_0x3dad24,_0x278579['error'][_0x55db('0xa')],_0x1eb00b);return _0x1024d1(_0x278579[_0x55db('0x9')]['message']);}else{return _0x107a12(_0x278579[_0x55db('0xb')]);}})[_0x55db('0xc')](function(_0x180d9f){logger[_0x55db('0x9')](_0x55db('0x8'),_0x55db('0x2'),_0x3dad24,_0x180d9f,_0x1eb00b);return _0x1024d1(_0x180d9f);});});};module['exports']=client;
\ No newline at end of file
+var _0x244b=['bluebird','routing','http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x244b,0xa7));var _0xb244=function(_0x3244f5,_0x7f56c5){_0x3244f5=_0x3244f5-0x0;var _0x53757e=_0x244b[_0x3244f5];return _0x53757e;};'use strict';var jayson=require(_0xb244('0x0'));var BPromise=require(_0xb244('0x1'));var logger=require('../../config/logger')(_0xb244('0x2'));var client=jayson['client'][_0xb244('0x3')]({'port':0x2329});client[_0xb244('0x4')]=function(_0x2c6338,_0x3c2694){return new BPromise(function(_0x232675,_0x33e132){return client[_0xb244('0x5')](_0x2c6338,_0x3c2694)[_0xb244('0x6')](function(_0x6d4c25){logger[_0xb244('0x7')](_0xb244('0x8'),'routing',_0x2c6338,_0x3c2694,_0x6d4c25);if(_0x6d4c25['error']){logger[_0xb244('0x9')]('rpc',_0xb244('0x2'),_0x2c6338,_0x6d4c25['error'][_0xb244('0xa')],_0x3c2694);return _0x33e132(_0x6d4c25['error'][_0xb244('0xa')]);}else{return _0x232675(_0x6d4c25[_0xb244('0xb')]);}})[_0xb244('0xc')](function(_0x1aa91f){logger[_0xb244('0x9')]('rpc',_0xb244('0x2'),_0x2c6338,_0x1aa91f,_0x3c2694);return _0x33e132(_0x1aa91f);});});};module[_0xb244('0xd')]=client;
\ No newline at end of file
index 39a80cb..2393d69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7220=['then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','bluebird','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve'];(function(_0x44058a,_0x7eb345){var _0x259299=function(_0x46e826){while(--_0x46e826){_0x44058a['push'](_0x44058a['shift']());}};_0x259299(++_0x7eb345);}(_0x7220,0xf5));var _0x0722=function(_0x591b1a,_0x527d94){_0x591b1a=_0x591b1a-0x0;var _0x487d57=_0x7220[_0x591b1a];return _0x487d57;};'use strict';var BPromise=require(_0x0722('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0x0722('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x0722('0x2'));var chatQueue=require(_0x0722('0x3'));var smsQueue=require(_0x0722('0x4'));var mailQueue=require(_0x0722('0x5'));var faxQueue=require(_0x0722('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x0722('0x7')]()[_0x0722('0x8')](user[_0x0722('0x9')]())[_0x0722('0x8')](realtime[_0x0722('0xa')]())['then'](interval[_0x0722('0xb')]())['then'](realtime[_0x0722('0xc')]())[_0x0722('0x8')](openchannelQueue[_0x0722('0xd')]())[_0x0722('0x8')](realtime[_0x0722('0xe')]())['then'](chatQueue[_0x0722('0xf')]())[_0x0722('0x8')](realtime['initChatQueues']())['then'](smsQueue[_0x0722('0x10')]())[_0x0722('0x8')](realtime[_0x0722('0x11')]())[_0x0722('0x8')](mailQueue['getMailQueues']())[_0x0722('0x8')](realtime[_0x0722('0x12')]())[_0x0722('0x8')](faxQueue[_0x0722('0x13')]())[_0x0722('0x8')](realtime['initFaxQueues']())[_0x0722('0x8')](whatsappQueue[_0x0722('0x14')]())[_0x0722('0x8')](realtime[_0x0722('0x15')]())[_0x0722('0x8')](function(){return realtime;});}function main(){return server[_0x0722('0x16')](realtime)[_0x0722('0x8')](function(_0x4e7676){return initRealtime();})[_0x0722('0x8')](function(_0x5f9c25){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1f41e6){console['log'](_0x1f41e6);});}main();
\ No newline at end of file
+var _0xacb9=['getAgents','then','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x459c09,_0x596ed4){var _0x2aee20=function(_0x113d25){while(--_0x113d25){_0x459c09['push'](_0x459c09['shift']());}};_0x2aee20(++_0x596ed4);}(_0xacb9,0xc6));var _0x9acb=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0xacb9[_0x260f28];return _0x3aefcc;};'use strict';var BPromise=require(_0x9acb('0x0'));var server=require('./server');var Realtime=require(_0x9acb('0x1'));var user=require(_0x9acb('0x2'));var interval=require(_0x9acb('0x3'));var openchannelQueue=require(_0x9acb('0x4'));var chatQueue=require(_0x9acb('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x9acb('0x6'));var faxQueue=require(_0x9acb('0x7'));var whatsappQueue=require(_0x9acb('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9acb('0x9')]()['then'](user[_0x9acb('0xa')]())[_0x9acb('0xb')](realtime['initAgents']())[_0x9acb('0xb')](interval[_0x9acb('0xc')]())['then'](realtime[_0x9acb('0xd')]())[_0x9acb('0xb')](openchannelQueue['getOpenchannelQueues']())[_0x9acb('0xb')](realtime[_0x9acb('0xe')]())[_0x9acb('0xb')](chatQueue[_0x9acb('0xf')]())[_0x9acb('0xb')](realtime[_0x9acb('0x10')]())[_0x9acb('0xb')](smsQueue[_0x9acb('0x11')]())[_0x9acb('0xb')](realtime['initSmsQueues']())['then'](mailQueue[_0x9acb('0x12')]())[_0x9acb('0xb')](realtime[_0x9acb('0x13')]())[_0x9acb('0xb')](faxQueue[_0x9acb('0x14')]())[_0x9acb('0xb')](realtime['initFaxQueues']())[_0x9acb('0xb')](whatsappQueue[_0x9acb('0x15')]())[_0x9acb('0xb')](realtime[_0x9acb('0x16')]())[_0x9acb('0xb')](function(){return realtime;});}function main(){return server[_0x9acb('0x17')](realtime)[_0x9acb('0xb')](function(_0x1e2a51){return initRealtime();})[_0x9acb('0xb')](function(_0x1cde2a){return setInterval(initRealtime,0x1388);})[_0x9acb('0x18')](function(_0x566a3d){console[_0x9acb('0x19')](_0x566a3d);});}main();
\ No newline at end of file
index 2eec84b..ab6eabe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x340bf1,_0x28154e){var _0x5d6835=function(_0x2b688e){while(--_0x2b688e){_0x340bf1['push'](_0x340bf1['shift']());}};_0x5d6835(++_0x28154e);}(_0x326f,0xd1));var _0xf326=function(_0x42b6a8,_0x559a1b){_0x42b6a8=_0x42b6a8-0x0;var _0x1ba8b6=_0x326f[_0x42b6a8];return _0x1ba8b6;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};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(_0x3b6013,_0x148fe7){var _0x44bba1=function(_0x2d23d6){while(--_0x2d23d6){_0x3b6013['push'](_0x3b6013['shift']());}};_0x44bba1(++_0x148fe7);}(_0xe14b,0x93));var _0xbe14=function(_0x504e4e,_0x1dfcd2){_0x504e4e=_0x504e4e-0x0;var _0x497838=_0xe14b[_0x504e4e];return _0x497838;};'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 ff4329b..ca40078 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e07=['request','error','message','result','catch','jayson/promise','client','http'];(function(_0x177ccc,_0xd9d8b2){var _0x797fdf=function(_0x2f4e2d){while(--_0x2f4e2d){_0x177ccc['push'](_0x177ccc['shift']());}};_0x797fdf(++_0xd9d8b2);}(_0x3e07,0x1bd));var _0x73e0=function(_0x16b163,_0x546be7){_0x16b163=_0x16b163-0x0;var _0x246b0d=_0x3e07[_0x16b163];return _0x246b0d;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x73e0('0x0'));var client=jayson[_0x73e0('0x1')][_0x73e0('0x2')]({'port':0x232b});function request(_0x3c68d5,_0x37f310){return new BPromise(function(_0x491989,_0x5b5382){return client[_0x73e0('0x3')](_0x3c68d5,_0x37f310)['then'](function(_0x1b7c24){if(_0x1b7c24[_0x73e0('0x4')]){return _0x5b5382(_0x1b7c24[_0x73e0('0x4')][_0x73e0('0x5')]);}else{return _0x491989(_0x1b7c24[_0x73e0('0x6')]);}})[_0x73e0('0x7')](function(_0x40ec53){return _0x5b5382(_0x40ec53);});});}exports['sendMailMessage']=function(_0x344d33,_0x3a8dcd){return request('SendMail',{'account':_0x344d33,'message':_0x3a8dcd});};
\ No newline at end of file
+var _0xbf6a=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','error','message'];(function(_0x256a31,_0x468360){var _0x541165=function(_0x28e0c4){while(--_0x28e0c4){_0x256a31['push'](_0x256a31['shift']());}};_0x541165(++_0x468360);}(_0xbf6a,0x147));var _0xabf6=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0xbf6a[_0x400322];return _0xfdd597;};'use strict';var BPromise=require(_0xabf6('0x0'));var jayson=require(_0xabf6('0x1'));var client=jayson[_0xabf6('0x2')][_0xabf6('0x3')]({'port':0x232b});function request(_0x42e78a,_0x3582b0){return new BPromise(function(_0x4b2ec3,_0x2fd4b4){return client['request'](_0x42e78a,_0x3582b0)['then'](function(_0x12839b){if(_0x12839b[_0xabf6('0x4')]){return _0x2fd4b4(_0x12839b[_0xabf6('0x4')][_0xabf6('0x5')]);}else{return _0x4b2ec3(_0x12839b['result']);}})[_0xabf6('0x6')](function(_0x3acd29){return _0x2fd4b4(_0x3acd29);});});}exports[_0xabf6('0x7')]=function(_0x2d41cb,_0x2c1bf0){return request(_0xabf6('0x8'),{'account':_0x2d41cb,'message':_0x2c1bf0});};
\ No newline at end of file
index e52c81b..e632b9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30ad=['emit','user:save','exports','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailPause','chatStatusTime','faxCurrentCapacity','smsStatusTime','smsCurrentCapacity','busyQueue'];(function(_0x3eeb9e,_0x5b72b8){var _0x126da0=function(_0x46aa22){while(--_0x46aa22){_0x3eeb9e['push'](_0x3eeb9e['shift']());}};_0x126da0(++_0x5b72b8);}(_0x30ad,0xb7));var _0xd30a=function(_0xa3b6b8,_0x301e91){_0xa3b6b8=_0xa3b6b8-0x0;var _0x1a727d=_0x30ad[_0xa3b6b8];return _0x1a727d;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0xd30a('0x0'));var Redis=require(_0xd30a('0x1'));var config=require(_0xd30a('0x2'));config['redis']=_[_0xd30a('0x3')](config[_0xd30a('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xd30a('0x5'))(new Redis(config[_0xd30a('0x4')]));function Agent(_0x1b0136){this['id']=_0x1b0136['id']||0x0;this[_0xd30a('0x6')]=_0x1b0136[_0xd30a('0x6')]||'';this['online']=_0x1b0136[_0xd30a('0x7')]||!![];this[_0xd30a('0x8')]=_0x1b0136[_0xd30a('0x8')]||![];this[_0xd30a('0x9')]=_0x1b0136['chatPause']||![];this['mailPause']=_0x1b0136['mailPause']||![];this[_0xd30a('0xa')]=_0x1b0136['faxPause']||![];this['smsPause']=_0x1b0136[_0xd30a('0xb')]||![];this[_0xd30a('0xc')]=_0x1b0136[_0xd30a('0xc')]||![];this[_0xd30a('0xd')]=_0xd30a('0xe');this['chatStatusTime']=0x0;this[_0xd30a('0xf')]=_0x1b0136['chatCapacity']||0x0;this[_0xd30a('0x10')]=0x0;this[_0xd30a('0x11')]='unknown';this['mailStatusTime']=0x0;this[_0xd30a('0x12')]=_0x1b0136['mailCapacity']||0x0;this[_0xd30a('0x13')]=0x0;this[_0xd30a('0x14')]=_0xd30a('0xe');this[_0xd30a('0x15')]=0x0;this[_0xd30a('0x16')]=_0x1b0136[_0xd30a('0x16')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xd30a('0x17')]=_0xd30a('0xe');this['smsStatusTime']=0x0;this[_0xd30a('0x18')]=_0x1b0136[_0xd30a('0x18')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xd30a('0x19')]=_0xd30a('0xe');this[_0xd30a('0x1a')]=0x0;this[_0xd30a('0x1b')]=_0x1b0136[_0xd30a('0x1b')]||0x0;this[_0xd30a('0x1c')]=0x0;this[_0xd30a('0x1d')]=_0xd30a('0xe');this[_0xd30a('0x1e')]=0x0;this[_0xd30a('0x1f')]=_0x1b0136[_0xd30a('0x1f')]||0x0;this[_0xd30a('0x20')]=0x0;this[_0xd30a('0x21')]=![];this['busyQueue']=undefined;this[_0xd30a('0x0')]='';this[_0xd30a('0x22')]();}Agent[_0xd30a('0x23')][_0xd30a('0x24')]=function(_0x2d5a85){if(this[_0x2d5a85+_0xd30a('0x25')]>0x0){if(this[_0x2d5a85+'Capacity']>0x0&&this[_0x2d5a85+'CurrentCapacity']>=this[_0x2d5a85+_0xd30a('0x26')]){return _0xd30a('0x27');}else{return _0xd30a('0x28');}}else{return _0xd30a('0x29');}};Agent[_0xd30a('0x23')][_0xd30a('0x22')]=function(){var _0x2fb43c=[_0xd30a('0x2a'),'chat','openchannel',_0xd30a('0x2b'),_0xd30a('0x2c'),_0xd30a('0x2d')];for(var _0x27c702=0x0;_0x27c702<_0x2fb43c[_0xd30a('0x2e')];_0x27c702+=0x1){var _0x9110e2=this[_0xd30a('0x24')](_0x2fb43c[_0x27c702]);if(this[_0x2fb43c[_0x27c702]+_0xd30a('0x2f')]!==_0x9110e2){this[_0x2fb43c[_0x27c702]+_0xd30a('0x30')]=_[_0xd30a('0x31')](moment()[_0xd30a('0x32')]('x'));}this[_0x2fb43c[_0x27c702]+_0xd30a('0x2f')]=_0x9110e2;}var _0x481752={'id':this['id'],'name':this[_0xd30a('0x6')],'online':this[_0xd30a('0x7')],'voicePause':this[_0xd30a('0x8')],'chatPause':this[_0xd30a('0x9')],'mailPause':this[_0xd30a('0x33')],'smsPause':this[_0xd30a('0xb')],'faxPause':this[_0xd30a('0xa')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xd30a('0x34')],'chatCapacity':this[_0xd30a('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xd30a('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xd30a('0x13')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xd30a('0x15')],'faxCapacity':this[_0xd30a('0x16')],'faxCurrentCapacity':this[_0xd30a('0x35')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xd30a('0x36')],'smsCapacity':this[_0xd30a('0x18')],'smsCurrentCapacity':this[_0xd30a('0x37')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xd30a('0x1a')],'whatsappCapacity':this[_0xd30a('0x1b')],'whatsappCurrentCapacity':this[_0xd30a('0x1c')],'openchannelStatus':this[_0xd30a('0x1d')],'openchannelStatusTime':this[_0xd30a('0x1e')],'openchannelCapacity':this[_0xd30a('0x1f')],'openchannelCurrentCapacity':this[_0xd30a('0x20')],'busy':this['busy'],'busyQueue':this[_0xd30a('0x38')]};var _0x49e055=md5(JSON['stringify'](_0x481752));if(this[_0xd30a('0x0')]!==_0x49e055){this['md5']=_0x49e055;io[_0xd30a('0x39')](_0xd30a('0x3a'),_0x481752);}};module[_0xd30a('0x3b')]=Agent;
\ No newline at end of file
+var _0x5c00=['CurrentCapacity','Capacity','maxcapacity','working','prototype','updateRealtime','sms','whatsapp','length','getChannelStatus','Status','toNumber','format','openchannelPause','chatCurrentCapacity','whatsappStatusTime','openchannelStatus','busy','stringify','emit','user:save','exports','lodash','moment','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','unknown','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0x5c00,0x17e));var _0x05c0=function(_0xaa0140,_0xd6c719){_0xaa0140=_0xaa0140-0x0;var _0x11ac88=_0x5c00[_0xaa0140];return _0x11ac88;};'use strict';var _=require(_0x05c0('0x0'));var moment=require(_0x05c0('0x1'));var md5=require(_0x05c0('0x2'));var Redis=require('ioredis');var config=require(_0x05c0('0x3'));config['redis']=_[_0x05c0('0x4')](config[_0x05c0('0x5')],{'host':_0x05c0('0x6'),'port':0x18eb});var io=require(_0x05c0('0x7'))(new Redis(config['redis']));function Agent(_0x145973){this['id']=_0x145973['id']||0x0;this[_0x05c0('0x8')]=_0x145973[_0x05c0('0x8')]||'';this[_0x05c0('0x9')]=_0x145973['online']||!![];this[_0x05c0('0xa')]=_0x145973[_0x05c0('0xa')]||![];this[_0x05c0('0xb')]=_0x145973['chatPause']||![];this[_0x05c0('0xc')]=_0x145973[_0x05c0('0xc')]||![];this[_0x05c0('0xd')]=_0x145973[_0x05c0('0xd')]||![];this[_0x05c0('0xe')]=_0x145973[_0x05c0('0xe')]||![];this['openchannelPause']=_0x145973['openchannelPause']||![];this[_0x05c0('0xf')]='unknown';this[_0x05c0('0x10')]=0x0;this[_0x05c0('0x11')]=_0x145973[_0x05c0('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x05c0('0x12')]='unknown';this[_0x05c0('0x13')]=0x0;this[_0x05c0('0x14')]=_0x145973[_0x05c0('0x14')]||0x0;this[_0x05c0('0x15')]=0x0;this[_0x05c0('0x16')]=_0x05c0('0x17');this[_0x05c0('0x18')]=0x0;this[_0x05c0('0x19')]=_0x145973['faxCapacity']||0x0;this[_0x05c0('0x1a')]=0x0;this[_0x05c0('0x1b')]=_0x05c0('0x17');this[_0x05c0('0x1c')]=0x0;this[_0x05c0('0x1d')]=_0x145973[_0x05c0('0x1d')]||0x0;this[_0x05c0('0x1e')]=0x0;this[_0x05c0('0x1f')]=_0x05c0('0x17');this['whatsappStatusTime']=0x0;this[_0x05c0('0x20')]=_0x145973[_0x05c0('0x20')]||0x0;this[_0x05c0('0x21')]=0x0;this['openchannelStatus']=_0x05c0('0x17');this[_0x05c0('0x22')]=0x0;this[_0x05c0('0x23')]=_0x145973[_0x05c0('0x23')]||0x0;this[_0x05c0('0x24')]=0x0;this['busy']=![];this[_0x05c0('0x25')]=undefined;this[_0x05c0('0x2')]='';this['updateRealtime']();}Agent['prototype']['getChannelStatus']=function(_0x1c448b){if(this[_0x1c448b+_0x05c0('0x26')]>0x0){if(this[_0x1c448b+_0x05c0('0x27')]>0x0&&this[_0x1c448b+_0x05c0('0x26')]>=this[_0x1c448b+_0x05c0('0x27')]){return _0x05c0('0x28');}else{return _0x05c0('0x29');}}else{return'idle';}};Agent[_0x05c0('0x2a')][_0x05c0('0x2b')]=function(){var _0x4ba978=['mail','chat','openchannel','fax',_0x05c0('0x2c'),_0x05c0('0x2d')];for(var _0x48b56f=0x0;_0x48b56f<_0x4ba978[_0x05c0('0x2e')];_0x48b56f+=0x1){var _0x336e1b=this[_0x05c0('0x2f')](_0x4ba978[_0x48b56f]);if(this[_0x4ba978[_0x48b56f]+_0x05c0('0x30')]!==_0x336e1b){this[_0x4ba978[_0x48b56f]+'StatusTime']=_[_0x05c0('0x31')](moment()[_0x05c0('0x32')]('x'));}this[_0x4ba978[_0x48b56f]+_0x05c0('0x30')]=_0x336e1b;}var _0x200e80={'id':this['id'],'name':this[_0x05c0('0x8')],'online':this[_0x05c0('0x9')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x05c0('0xc')],'smsPause':this[_0x05c0('0xe')],'faxPause':this[_0x05c0('0xd')],'openchannelPause':this[_0x05c0('0x33')],'chatStatus':this[_0x05c0('0xf')],'chatStatusTime':this[_0x05c0('0x10')],'chatCapacity':this[_0x05c0('0x11')],'chatCurrentCapacity':this[_0x05c0('0x34')],'mailStatus':this[_0x05c0('0x12')],'mailStatusTime':this[_0x05c0('0x13')],'mailCapacity':this[_0x05c0('0x14')],'mailCurrentCapacity':this[_0x05c0('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x05c0('0x19')],'faxCurrentCapacity':this[_0x05c0('0x1a')],'smsStatus':this[_0x05c0('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x05c0('0x1d')],'smsCurrentCapacity':this[_0x05c0('0x1e')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x05c0('0x35')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x05c0('0x21')],'openchannelStatus':this[_0x05c0('0x36')],'openchannelStatusTime':this[_0x05c0('0x22')],'openchannelCapacity':this[_0x05c0('0x23')],'openchannelCurrentCapacity':this[_0x05c0('0x24')],'busy':this[_0x05c0('0x37')],'busyQueue':this[_0x05c0('0x25')]};var _0x9da3fa=md5(JSON[_0x05c0('0x38')](_0x200e80));if(this[_0x05c0('0x2')]!==_0x9da3fa){this[_0x05c0('0x2')]=_0x9da3fa;io[_0x05c0('0x39')](_0x05c0('0x3a'),_0x200e80);}};module[_0x05c0('0x3b')]=Agent;
\ No newline at end of file
index 020c6b2..d7a2307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cc=['util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','chatPause','paused','available','waiting','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash'];(function(_0x11a882,_0xc65693){var _0xf34782=function(_0x2f848b){while(--_0x2f848b){_0x11a882['push'](_0x11a882['shift']());}};_0xf34782(++_0xc65693);}(_0xf3cc,0x185));var _0xcf3c=function(_0x274e0e,_0x2e7080){_0x274e0e=_0x274e0e-0x0;var _0x4c370f=_0xf3cc[_0x274e0e];return _0x4c370f;};'use strict';var _=require(_0xcf3c('0x0'));var md5=require('md5');var util=require(_0xcf3c('0x1'));var Redis=require('ioredis');var config=require(_0xcf3c('0x2'));config[_0xcf3c('0x3')]=_[_0xcf3c('0x4')](config[_0xcf3c('0x3')],{'host':_0xcf3c('0x5'),'port':0x18eb});var io=require(_0xcf3c('0x6'))(new Redis(config[_0xcf3c('0x3')]));function ChatQueue(_0x34a796){this['id']=_0x34a796['id']||0x0;this[_0xcf3c('0x7')]=_0x34a796[_0xcf3c('0x7')]||'';this[_0xcf3c('0x8')]=_0x34a796['timeout']||0xa;this[_0xcf3c('0x9')]=_0x34a796[_0xcf3c('0x9')]||_0xcf3c('0xa');this[_0xcf3c('0xb')]=_0x34a796[_0xcf3c('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xcf3c('0xc')]='';this[_0xcf3c('0xd')]();this[_0xcf3c('0xe')]();}ChatQueue[_0xcf3c('0xf')][_0xcf3c('0xd')]=function(){var _0xc36d2b=this[_0xcf3c('0x10')][_0xcf3c('0x11')];this[_0xcf3c('0x10')]=_[_0xcf3c('0x12')](this[_0xcf3c('0xb')],'id');this[_0xcf3c('0x10')]['_rr']=_0xc36d2b;};ChatQueue[_0xcf3c('0xf')][_0xcf3c('0xe')]=function(){this[_0xcf3c('0x13')]=0x0;this['paused']=0x0;for(var _0x17bedd=0x0;_0x17bedd<this[_0xcf3c('0xb')][_0xcf3c('0x14')];_0x17bedd+=0x1){if(this['Agents'][_0x17bedd]['online']){this['loggedIn']+=0x1;}if(this[_0xcf3c('0xb')][_0x17bedd][_0xcf3c('0x15')]){this[_0xcf3c('0x16')]+=0x1;}}this[_0xcf3c('0x17')]=this[_0xcf3c('0x13')]-this['paused'];this['available']=this['available']>=0x0?this['available']:0x0;var _0x38c5b4={'id':this['id'],'available':this[_0xcf3c('0x17')],'loggedIn':this[_0xcf3c('0x13')],'name':this[_0xcf3c('0x7')],'paused':this['paused'],'waiting':this[_0xcf3c('0x18')]};var _0xfb34c8=md5(JSON[_0xcf3c('0x19')](_0x38c5b4));if(this[_0xcf3c('0xc')]!==_0xfb34c8){this[_0xcf3c('0xc')]=_0xfb34c8;io['to'](util['format'](_0xcf3c('0x1a'),_0x38c5b4['name']))[_0xcf3c('0x1b')](_0xcf3c('0x1c'),_0x38c5b4);}};module[_0xcf3c('0x1d')]=ChatQueue;
\ No newline at end of file
+var _0x8490=['chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','paused','available','stringify','format','emit'];(function(_0x476154,_0x220ac4){var _0x2764f2=function(_0x5d8891){while(--_0x5d8891){_0x476154['push'](_0x476154['shift']());}};_0x2764f2(++_0x220ac4);}(_0x8490,0x14c));var _0x0849=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x8490[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0x0849('0x0'));var md5=require('md5');var util=require(_0x0849('0x1'));var Redis=require(_0x0849('0x2'));var config=require(_0x0849('0x3'));config['redis']=_[_0x0849('0x4')](config['redis'],{'host':_0x0849('0x5'),'port':0x18eb});var io=require(_0x0849('0x6'))(new Redis(config[_0x0849('0x7')]));function ChatQueue(_0x3c6bfb){this['id']=_0x3c6bfb['id']||0x0;this['name']=_0x3c6bfb[_0x0849('0x8')]||'';this['timeout']=_0x3c6bfb['timeout']||0xa;this[_0x0849('0x9')]=_0x3c6bfb['strategy']||_0x0849('0xa');this[_0x0849('0xb')]=_0x3c6bfb[_0x0849('0xb')];this['mapAgentsId']={};this[_0x0849('0xc')]=0x0;this[_0x0849('0xd')]='';this[_0x0849('0xe')]();this[_0x0849('0xf')]();}ChatQueue[_0x0849('0x10')][_0x0849('0xe')]=function(){var _0x4c9274=this[_0x0849('0x11')][_0x0849('0x12')];this[_0x0849('0x11')]=_[_0x0849('0x13')](this['Agents'],'id');this[_0x0849('0x11')]['_rr']=_0x4c9274;};ChatQueue['prototype'][_0x0849('0xf')]=function(){this[_0x0849('0x14')]=0x0;this['paused']=0x0;for(var _0x33a633=0x0;_0x33a633<this[_0x0849('0xb')][_0x0849('0x15')];_0x33a633+=0x1){if(this[_0x0849('0xb')][_0x33a633][_0x0849('0x16')]){this[_0x0849('0x14')]+=0x1;}if(this[_0x0849('0xb')][_0x33a633]['chatPause']){this[_0x0849('0x17')]+=0x1;}}this['available']=this[_0x0849('0x14')]-this['paused'];this[_0x0849('0x18')]=this[_0x0849('0x18')]>=0x0?this['available']:0x0;var _0x3b0aaa={'id':this['id'],'available':this[_0x0849('0x18')],'loggedIn':this[_0x0849('0x14')],'name':this[_0x0849('0x8')],'paused':this['paused'],'waiting':this[_0x0849('0xc')]};var _0x28825=md5(JSON[_0x0849('0x19')](_0x3b0aaa));if(this[_0x0849('0xd')]!==_0x28825){this[_0x0849('0xd')]=_0x28825;io['to'](util[_0x0849('0x1a')]('chat:queue:%s',_0x3b0aaa[_0x0849('0x8')]))[_0x0849('0x1b')](_0x0849('0x1c'),_0x3b0aaa);}};module[_0x0849('0x1d')]=ChatQueue;
\ No newline at end of file
index 161be58..8528e13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2c3=['timeout','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','map','loggedIn','paused','length','online','faxPause','available','waiting','format','fax:queue:%s','emit','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0xde5157,_0x1529ce){var _0x310616=function(_0x251944){while(--_0x251944){_0xde5157['push'](_0xde5157['shift']());}};_0x310616(++_0x1529ce);}(_0xe2c3,0xd0));var _0x3e2c=function(_0x1f9faf,_0x227808){_0x1f9faf=_0x1f9faf-0x0;var _0x13ab2c=_0xe2c3[_0x1f9faf];return _0x13ab2c;};'use strict';var _=require(_0x3e2c('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x3e2c('0x1'));var config=require(_0x3e2c('0x2'));config[_0x3e2c('0x3')]=_[_0x3e2c('0x4')](config[_0x3e2c('0x3')],{'host':_0x3e2c('0x5'),'port':0x18eb});var io=require(_0x3e2c('0x6'))(new Redis(config[_0x3e2c('0x3')]));function FaxQueue(_0x1f7c8b){this['id']=_0x1f7c8b['id']||0x0;this['name']=_0x1f7c8b[_0x3e2c('0x7')]||'';this[_0x3e2c('0x8')]=_0x1f7c8b['timeout']||0xa;this['strategy']=_0x1f7c8b[_0x3e2c('0x9')]||'beepall';this[_0x3e2c('0xa')]=_0x1f7c8b['Agents'];this[_0x3e2c('0xb')]={};this['waiting']=0x0;this[_0x3e2c('0xc')]='';this[_0x3e2c('0xd')]();this[_0x3e2c('0xe')]();}FaxQueue['prototype'][_0x3e2c('0xd')]=function(){var _0x1f62a1=this['mapAgentsId']['_rr'];this[_0x3e2c('0xb')]=_[_0x3e2c('0xf')](this[_0x3e2c('0xa')],'id');this[_0x3e2c('0xb')]['_rr']=_0x1f62a1;};FaxQueue['prototype'][_0x3e2c('0xe')]=function(){this[_0x3e2c('0x10')]=0x0;this[_0x3e2c('0x11')]=0x0;for(var _0x480473=0x0;_0x480473<this[_0x3e2c('0xa')][_0x3e2c('0x12')];_0x480473+=0x1){if(this[_0x3e2c('0xa')][_0x480473][_0x3e2c('0x13')]){this['loggedIn']+=0x1;}if(this[_0x3e2c('0xa')][_0x480473][_0x3e2c('0x14')]){this['paused']+=0x1;}}this['available']=this['loggedIn']-this[_0x3e2c('0x11')];this['available']=this['available']>=0x0?this[_0x3e2c('0x15')]:0x0;var _0x41fac2={'id':this['id'],'available':this[_0x3e2c('0x15')],'loggedIn':this[_0x3e2c('0x10')],'name':this[_0x3e2c('0x7')],'paused':this[_0x3e2c('0x11')],'waiting':this[_0x3e2c('0x16')]};var _0x59cf3e=md5(JSON['stringify'](_0x41fac2));if(this[_0x3e2c('0xc')]!==_0x59cf3e){this[_0x3e2c('0xc')]=_0x59cf3e;io['to'](util[_0x3e2c('0x17')](_0x3e2c('0x18'),_0x41fac2[_0x3e2c('0x7')]))[_0x3e2c('0x19')]('fax_queue:save',_0x41fac2);}};module[_0x3e2c('0x1a')]=FaxQueue;
\ No newline at end of file
+var _0x7f62=['defaults','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','paused','length','loggedIn','faxPause','available','name','stringify','format','fax:queue:%s','emit','fax_queue:save','md5','util','ioredis','../../../config/environment','redis'];(function(_0x588be9,_0x322db2){var _0x19947c=function(_0x10b18a){while(--_0x10b18a){_0x588be9['push'](_0x588be9['shift']());}};_0x19947c(++_0x322db2);}(_0x7f62,0xd3));var _0x27f6=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x7f62[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require('lodash');var md5=require(_0x27f6('0x0'));var util=require(_0x27f6('0x1'));var Redis=require(_0x27f6('0x2'));var config=require(_0x27f6('0x3'));config[_0x27f6('0x4')]=_[_0x27f6('0x5')](config[_0x27f6('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x27f6('0x4')]));function FaxQueue(_0x478777){this['id']=_0x478777['id']||0x0;this['name']=_0x478777['name']||'';this[_0x27f6('0x6')]=_0x478777[_0x27f6('0x6')]||0xa;this[_0x27f6('0x7')]=_0x478777['strategy']||'beepall';this[_0x27f6('0x8')]=_0x478777[_0x27f6('0x8')];this[_0x27f6('0x9')]={};this['waiting']=0x0;this[_0x27f6('0x0')]='';this[_0x27f6('0xa')]();this[_0x27f6('0xb')]();}FaxQueue[_0x27f6('0xc')]['updateRouting']=function(){var _0x17cf0d=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this[_0x27f6('0x8')],'id');this[_0x27f6('0x9')]['_rr']=_0x17cf0d;};FaxQueue[_0x27f6('0xc')][_0x27f6('0xb')]=function(){this['loggedIn']=0x0;this[_0x27f6('0xd')]=0x0;for(var _0x3646d9=0x0;_0x3646d9<this[_0x27f6('0x8')][_0x27f6('0xe')];_0x3646d9+=0x1){if(this['Agents'][_0x3646d9]['online']){this[_0x27f6('0xf')]+=0x1;}if(this[_0x27f6('0x8')][_0x3646d9][_0x27f6('0x10')]){this['paused']+=0x1;}}this['available']=this[_0x27f6('0xf')]-this[_0x27f6('0xd')];this[_0x27f6('0x11')]=this[_0x27f6('0x11')]>=0x0?this[_0x27f6('0x11')]:0x0;var _0x1a19a4={'id':this['id'],'available':this[_0x27f6('0x11')],'loggedIn':this[_0x27f6('0xf')],'name':this[_0x27f6('0x12')],'paused':this[_0x27f6('0xd')],'waiting':this['waiting']};var _0x3fd861=md5(JSON[_0x27f6('0x13')](_0x1a19a4));if(this[_0x27f6('0x0')]!==_0x3fd861){this[_0x27f6('0x0')]=_0x3fd861;io['to'](util[_0x27f6('0x14')](_0x27f6('0x15'),_0x1a19a4[_0x27f6('0x12')]))[_0x27f6('0x16')](_0x27f6('0x17'),_0x1a19a4);}};module['exports']=FaxQueue;
\ No newline at end of file
index bbc478b..a729cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd79=['name','Intervals'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcd79,0x8e));var _0x9cd7=function(_0x1a6faf,_0x5eeb5f){_0x1a6faf=_0x1a6faf-0x0;var _0x19ed15=_0xcd79[_0x1a6faf];return _0x19ed15;};'use strict';function Interval(_0x48076d){this['id']=_0x48076d['id']||0x0;this[_0x9cd7('0x0')]=_0x48076d[_0x9cd7('0x0')]||'';this[_0x9cd7('0x1')]=_0x48076d[_0x9cd7('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
+var _0xc961=['exports','name','Intervals'];(function(_0x19b3f8,_0x150751){var _0x22c3a1=function(_0x16bf0a){while(--_0x16bf0a){_0x19b3f8['push'](_0x19b3f8['shift']());}};_0x22c3a1(++_0x150751);}(_0xc961,0xdc));var _0x1c96=function(_0x4a8c28,_0x2b0254){_0x4a8c28=_0x4a8c28-0x0;var _0x1ee153=_0xc961[_0x4a8c28];return _0x1ee153;};'use strict';function Interval(_0x840bd5){this['id']=_0x840bd5['id']||0x0;this[_0x1c96('0x0')]=_0x840bd5[_0x1c96('0x0')]||'';this[_0x1c96('0x1')]=_0x840bd5['Intervals']||{};}module[_0x1c96('0x2')]=Interval;
\ No newline at end of file
index 30a724f..c7187b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x196b=['md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused','length','online','loggedIn','mailPause','available','emit','lodash'];(function(_0x3130c3,_0x1a2b56){var _0x4be085=function(_0x2f894d){while(--_0x2f894d){_0x3130c3['push'](_0x3130c3['shift']());}};_0x4be085(++_0x1a2b56);}(_0x196b,0x67));var _0xb196=function(_0x11d8d0,_0x36e72e){_0x11d8d0=_0x11d8d0-0x0;var _0x2048b9=_0x196b[_0x11d8d0];return _0x2048b9;};'use strict';var _=require(_0xb196('0x0'));var md5=require(_0xb196('0x1'));var util=require(_0xb196('0x2'));var Redis=require(_0xb196('0x3'));var config=require(_0xb196('0x4'));config[_0xb196('0x5')]=_[_0xb196('0x6')](config[_0xb196('0x5')],{'host':_0xb196('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb196('0x5')]));function MailQueue(_0x400585){this['id']=_0x400585['id']||0x0;this['name']=_0x400585[_0xb196('0x8')]||'';this[_0xb196('0x9')]=_0x400585['timeout']||0xa;this[_0xb196('0xa')]=_0x400585['strategy']||'beepall';this['Agents']=_0x400585[_0xb196('0xb')];this[_0xb196('0xc')]={};this[_0xb196('0xd')]=0x0;this[_0xb196('0x1')]='';this[_0xb196('0xe')]();this['updateRealtime']();}MailQueue[_0xb196('0xf')][_0xb196('0xe')]=function(){var _0x956154=this[_0xb196('0xc')][_0xb196('0x10')];this[_0xb196('0xc')]=_[_0xb196('0x11')](this[_0xb196('0xb')],'id');this['mapAgentsId']['_rr']=_0x956154;};MailQueue[_0xb196('0xf')][_0xb196('0x12')]=function(){this['loggedIn']=0x0;this[_0xb196('0x13')]=0x0;for(var _0x32c3d6=0x0;_0x32c3d6<this['Agents'][_0xb196('0x14')];_0x32c3d6+=0x1){if(this[_0xb196('0xb')][_0x32c3d6][_0xb196('0x15')]){this[_0xb196('0x16')]+=0x1;}if(this[_0xb196('0xb')][_0x32c3d6][_0xb196('0x17')]){this[_0xb196('0x13')]+=0x1;}}this[_0xb196('0x18')]=this['loggedIn']-this['paused'];this[_0xb196('0x18')]=this[_0xb196('0x18')]>=0x0?this[_0xb196('0x18')]:0x0;var _0x222d8a={'id':this['id'],'available':this[_0xb196('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xb196('0x8')],'paused':this['paused'],'waiting':this[_0xb196('0xd')]};var _0x371aa9=md5(JSON['stringify'](_0x222d8a));if(this[_0xb196('0x1')]!==_0x371aa9){this[_0xb196('0x1')]=_0x371aa9;io['to'](util['format']('mail:queue:%s',_0x222d8a[_0xb196('0x8')]))[_0xb196('0x19')]('mail_queue:save',_0x222d8a);}};module['exports']=MailQueue;
\ No newline at end of file
+var _0x8c1b=['format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','mailPause','available','waiting','stringify'];(function(_0x90a4d3,_0xb80b3e){var _0x2a6b69=function(_0x292c35){while(--_0x292c35){_0x90a4d3['push'](_0x90a4d3['shift']());}};_0x2a6b69(++_0xb80b3e);}(_0x8c1b,0xb9));var _0xb8c1=function(_0x43b2ba,_0x71bf8){_0x43b2ba=_0x43b2ba-0x0;var _0x5b7685=_0x8c1b[_0x43b2ba];return _0x5b7685;};'use strict';var _=require(_0xb8c1('0x0'));var md5=require('md5');var util=require(_0xb8c1('0x1'));var Redis=require(_0xb8c1('0x2'));var config=require('../../../config/environment');config[_0xb8c1('0x3')]=_['defaults'](config['redis'],{'host':_0xb8c1('0x4'),'port':0x18eb});var io=require(_0xb8c1('0x5'))(new Redis(config[_0xb8c1('0x3')]));function MailQueue(_0x28c1d2){this['id']=_0x28c1d2['id']||0x0;this[_0xb8c1('0x6')]=_0x28c1d2[_0xb8c1('0x6')]||'';this[_0xb8c1('0x7')]=_0x28c1d2[_0xb8c1('0x7')]||0xa;this[_0xb8c1('0x8')]=_0x28c1d2[_0xb8c1('0x8')]||_0xb8c1('0x9');this['Agents']=_0x28c1d2[_0xb8c1('0xa')];this[_0xb8c1('0xb')]={};this['waiting']=0x0;this[_0xb8c1('0xc')]='';this[_0xb8c1('0xd')]();this[_0xb8c1('0xe')]();}MailQueue[_0xb8c1('0xf')][_0xb8c1('0xd')]=function(){var _0x5b6991=this['mapAgentsId'][_0xb8c1('0x10')];this['mapAgentsId']=_[_0xb8c1('0x11')](this[_0xb8c1('0xa')],'id');this['mapAgentsId'][_0xb8c1('0x10')]=_0x5b6991;};MailQueue[_0xb8c1('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xb8c1('0x12')]=0x0;for(var _0x3eca7e=0x0;_0x3eca7e<this[_0xb8c1('0xa')][_0xb8c1('0x13')];_0x3eca7e+=0x1){if(this[_0xb8c1('0xa')][_0x3eca7e]['online']){this[_0xb8c1('0x14')]+=0x1;}if(this[_0xb8c1('0xa')][_0x3eca7e][_0xb8c1('0x15')]){this[_0xb8c1('0x12')]+=0x1;}}this[_0xb8c1('0x16')]=this[_0xb8c1('0x14')]-this['paused'];this[_0xb8c1('0x16')]=this[_0xb8c1('0x16')]>=0x0?this[_0xb8c1('0x16')]:0x0;var _0x51b234={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb8c1('0x14')],'name':this[_0xb8c1('0x6')],'paused':this[_0xb8c1('0x12')],'waiting':this[_0xb8c1('0x17')]};var _0x12f874=md5(JSON[_0xb8c1('0x18')](_0x51b234));if(this[_0xb8c1('0xc')]!==_0x12f874){this[_0xb8c1('0xc')]=_0x12f874;io['to'](util[_0xb8c1('0x19')](_0xb8c1('0x1a'),_0x51b234[_0xb8c1('0x6')]))[_0xb8c1('0x1b')](_0xb8c1('0x1c'),_0x51b234);}};module[_0xb8c1('0x1d')]=MailQueue;
\ No newline at end of file
index cba6510..45b9941 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x1261,0x144));var _0x1126=function(_0x291c1b,_0x5216a6){_0x291c1b=_0x291c1b-0x0;var _0x2109c9=_0x1261[_0x291c1b];return _0x2109c9;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0<this['Agents'][_0x1126('0x16')];_0x53a8f0+=0x1){if(this[_0x1126('0xc')][_0x53a8f0][_0x1126('0x17')]){this['loggedIn']+=0x1;}if(this[_0x1126('0xc')][_0x53a8f0]['openchannelPause']){this[_0x1126('0x15')]+=0x1;}}this[_0x1126('0x18')]=this[_0x1126('0x14')]-this['paused'];this[_0x1126('0x18')]=this[_0x1126('0x18')]>=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x5c5b73,_0x26c7e4){var _0x3975db=function(_0x129032){while(--_0x129032){_0x5c5b73['push'](_0x5c5b73['shift']());}};_0x3975db(++_0x26c7e4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0x5fc3[_0x59dccc];return _0xc97bcb;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
index 809b5e5..5a81c7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee11=['smsPause','available','md5','format','sms:queue:%s','sms_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x4534e3,_0x56de6e){var _0x50c3a3=function(_0xb4117f){while(--_0xb4117f){_0x4534e3['push'](_0x4534e3['shift']());}};_0x50c3a3(++_0x56de6e);}(_0xee11,0x146));var _0x1ee1=function(_0x19fec1,_0x1cc62f){_0x19fec1=_0x19fec1-0x0;var _0x29cd35=_0xee11[_0x19fec1];return _0x29cd35;};'use strict';var _=require(_0x1ee1('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x1ee1('0x1'));var config=require(_0x1ee1('0x2'));config[_0x1ee1('0x3')]=_[_0x1ee1('0x4')](config[_0x1ee1('0x3')],{'host':_0x1ee1('0x5'),'port':0x18eb});var io=require(_0x1ee1('0x6'))(new Redis(config[_0x1ee1('0x3')]));function SmsQueue(_0x517892){this['id']=_0x517892['id']||0x0;this[_0x1ee1('0x7')]=_0x517892[_0x1ee1('0x7')]||'';this[_0x1ee1('0x8')]=_0x517892[_0x1ee1('0x8')]||0xa;this[_0x1ee1('0x9')]=_0x517892['strategy']||'beepall';this[_0x1ee1('0xa')]=_0x517892[_0x1ee1('0xa')];this[_0x1ee1('0xb')]={};this[_0x1ee1('0xc')]=0x0;this['md5']='';this[_0x1ee1('0xd')]();this['updateRealtime']();}SmsQueue[_0x1ee1('0xe')][_0x1ee1('0xd')]=function(){var _0x43cbdd=this[_0x1ee1('0xb')]['_rr'];this[_0x1ee1('0xb')]=_[_0x1ee1('0xf')](this['Agents'],'id');this[_0x1ee1('0xb')][_0x1ee1('0x10')]=_0x43cbdd;};SmsQueue[_0x1ee1('0xe')][_0x1ee1('0x11')]=function(){this[_0x1ee1('0x12')]=0x0;this[_0x1ee1('0x13')]=0x0;for(var _0x1a23e4=0x0;_0x1a23e4<this[_0x1ee1('0xa')][_0x1ee1('0x14')];_0x1a23e4+=0x1){if(this[_0x1ee1('0xa')][_0x1a23e4][_0x1ee1('0x15')]){this[_0x1ee1('0x12')]+=0x1;}if(this[_0x1ee1('0xa')][_0x1a23e4][_0x1ee1('0x16')]){this['paused']+=0x1;}}this['available']=this[_0x1ee1('0x12')]-this[_0x1ee1('0x13')];this[_0x1ee1('0x17')]=this[_0x1ee1('0x17')]>=0x0?this[_0x1ee1('0x17')]:0x0;var _0xff3d76={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1ee1('0x12')],'name':this[_0x1ee1('0x7')],'paused':this['paused'],'waiting':this[_0x1ee1('0xc')]};var _0xa5ec64=md5(JSON['stringify'](_0xff3d76));if(this['md5']!==_0xa5ec64){this[_0x1ee1('0x18')]=_0xa5ec64;io['to'](util[_0x1ee1('0x19')](_0x1ee1('0x1a'),_0xff3d76[_0x1ee1('0x7')]))['emit'](_0x1ee1('0x1b'),_0xff3d76);}};module[_0x1ee1('0x1c')]=SmsQueue;
\ No newline at end of file
+var _0x5fc7=['waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','available','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x58ca91,_0x57861b){var _0x2f7976=function(_0x4d961e){while(--_0x4d961e){_0x58ca91['push'](_0x58ca91['shift']());}};_0x2f7976(++_0x57861b);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x5fc7[_0x441563];return _0x2369ec;};'use strict';var _=require(_0x75fc('0x0'));var md5=require(_0x75fc('0x1'));var util=require(_0x75fc('0x2'));var Redis=require(_0x75fc('0x3'));var config=require(_0x75fc('0x4'));config[_0x75fc('0x5')]=_[_0x75fc('0x6')](config[_0x75fc('0x5')],{'host':_0x75fc('0x7'),'port':0x18eb});var io=require(_0x75fc('0x8'))(new Redis(config[_0x75fc('0x5')]));function SmsQueue(_0x4772a6){this['id']=_0x4772a6['id']||0x0;this['name']=_0x4772a6[_0x75fc('0x9')]||'';this[_0x75fc('0xa')]=_0x4772a6[_0x75fc('0xa')]||0xa;this[_0x75fc('0xb')]=_0x4772a6[_0x75fc('0xb')]||_0x75fc('0xc');this[_0x75fc('0xd')]=_0x4772a6[_0x75fc('0xd')];this[_0x75fc('0xe')]={};this[_0x75fc('0xf')]=0x0;this['md5']='';this[_0x75fc('0x10')]();this[_0x75fc('0x11')]();}SmsQueue[_0x75fc('0x12')][_0x75fc('0x10')]=function(){var _0x5e4cb9=this[_0x75fc('0xe')][_0x75fc('0x13')];this[_0x75fc('0xe')]=_[_0x75fc('0x14')](this[_0x75fc('0xd')],'id');this[_0x75fc('0xe')][_0x75fc('0x13')]=_0x5e4cb9;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x75fc('0x15')]=0x0;for(var _0x2e0e83=0x0;_0x2e0e83<this[_0x75fc('0xd')][_0x75fc('0x16')];_0x2e0e83+=0x1){if(this[_0x75fc('0xd')][_0x2e0e83][_0x75fc('0x17')]){this[_0x75fc('0x18')]+=0x1;}if(this[_0x75fc('0xd')][_0x2e0e83]['smsPause']){this[_0x75fc('0x15')]+=0x1;}}this[_0x75fc('0x19')]=this['loggedIn']-this[_0x75fc('0x15')];this[_0x75fc('0x19')]=this['available']>=0x0?this['available']:0x0;var _0x25b52b={'id':this['id'],'available':this[_0x75fc('0x19')],'loggedIn':this[_0x75fc('0x18')],'name':this[_0x75fc('0x9')],'paused':this[_0x75fc('0x15')],'waiting':this[_0x75fc('0xf')]};var _0x523d14=md5(JSON[_0x75fc('0x1a')](_0x25b52b));if(this['md5']!==_0x523d14){this[_0x75fc('0x1')]=_0x523d14;io['to'](util[_0x75fc('0x1b')](_0x75fc('0x1c'),_0x25b52b[_0x75fc('0x9')]))['emit'](_0x75fc('0x1d'),_0x25b52b);}};module[_0x75fc('0x1e')]=SmsQueue;
\ No newline at end of file
index 2efdbf0..dbfdc2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad92=['socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','loggedIn','length','online','whatsappPause','paused','available','stringify','whatsapp:queue:%s','emit','md5','util','../../../config/environment','redis','localhost'];(function(_0x56fdc1,_0x252e62){var _0x11a28b=function(_0x2f4bfd){while(--_0x2f4bfd){_0x56fdc1['push'](_0x56fdc1['shift']());}};_0x11a28b(++_0x252e62);}(_0xad92,0x154));var _0x2ad9=function(_0x4a13db,_0x912364){_0x4a13db=_0x4a13db-0x0;var _0x3bdc9e=_0xad92[_0x4a13db];return _0x3bdc9e;};'use strict';var _=require('lodash');var md5=require(_0x2ad9('0x0'));var util=require(_0x2ad9('0x1'));var Redis=require('ioredis');var config=require(_0x2ad9('0x2'));config[_0x2ad9('0x3')]=_['defaults'](config['redis'],{'host':_0x2ad9('0x4'),'port':0x18eb});var io=require(_0x2ad9('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x45c0a8){this['id']=_0x45c0a8['id']||0x0;this[_0x2ad9('0x6')]=_0x45c0a8[_0x2ad9('0x6')]||'';this[_0x2ad9('0x7')]=_0x45c0a8[_0x2ad9('0x7')]||0xa;this['strategy']=_0x45c0a8['strategy']||_0x2ad9('0x8');this[_0x2ad9('0x9')]=_0x45c0a8['Agents'];this[_0x2ad9('0xa')]={};this['waiting']=0x0;this['md5']='';this[_0x2ad9('0xb')]();this['updateRealtime']();}WhatsappQueue[_0x2ad9('0xc')][_0x2ad9('0xb')]=function(){var _0x5c45da=this['mapAgentsId'][_0x2ad9('0xd')];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x2ad9('0xa')][_0x2ad9('0xd')]=_0x5c45da;};WhatsappQueue[_0x2ad9('0xc')]['updateRealtime']=function(){this[_0x2ad9('0xe')]=0x0;this['paused']=0x0;for(var _0x2b8f6f=0x0;_0x2b8f6f<this['Agents'][_0x2ad9('0xf')];_0x2b8f6f+=0x1){if(this[_0x2ad9('0x9')][_0x2b8f6f][_0x2ad9('0x10')]){this[_0x2ad9('0xe')]+=0x1;}if(this[_0x2ad9('0x9')][_0x2b8f6f][_0x2ad9('0x11')]){this[_0x2ad9('0x12')]+=0x1;}}this[_0x2ad9('0x13')]=this['loggedIn']-this[_0x2ad9('0x12')];this[_0x2ad9('0x13')]=this[_0x2ad9('0x13')]>=0x0?this[_0x2ad9('0x13')]:0x0;var _0x101faa={'id':this['id'],'available':this[_0x2ad9('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x2ad9('0x6')],'paused':this[_0x2ad9('0x12')],'waiting':this['waiting']};var _0x22f325=md5(JSON[_0x2ad9('0x14')](_0x101faa));if(this[_0x2ad9('0x0')]!==_0x22f325){this[_0x2ad9('0x0')]=_0x22f325;io['to'](util['format'](_0x2ad9('0x15'),_0x101faa[_0x2ad9('0x6')]))[_0x2ad9('0x16')]('whatsapp_queue:save',_0x101faa);}};module['exports']=WhatsappQueue;
\ No newline at end of file
+var _0xe460=['updateRouting','_rr','map','prototype','paused','length','loggedIn','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime'];(function(_0x495984,_0x20ff45){var _0x93c24c=function(_0x48015b){while(--_0x48015b){_0x495984['push'](_0x495984['shift']());}};_0x93c24c(++_0x20ff45);}(_0xe460,0x109));var _0x0e46=function(_0x1486e5,_0x39684f){_0x1486e5=_0x1486e5-0x0;var _0x29d89b=_0xe460[_0x1486e5];return _0x29d89b;};'use strict';var _=require('lodash');var md5=require(_0x0e46('0x0'));var util=require('util');var Redis=require(_0x0e46('0x1'));var config=require(_0x0e46('0x2'));config[_0x0e46('0x3')]=_[_0x0e46('0x4')](config['redis'],{'host':_0x0e46('0x5'),'port':0x18eb});var io=require(_0x0e46('0x6'))(new Redis(config[_0x0e46('0x3')]));function WhatsappQueue(_0x2f4d0b){this['id']=_0x2f4d0b['id']||0x0;this['name']=_0x2f4d0b[_0x0e46('0x7')]||'';this[_0x0e46('0x8')]=_0x2f4d0b[_0x0e46('0x8')]||0xa;this['strategy']=_0x2f4d0b[_0x0e46('0x9')]||_0x0e46('0xa');this[_0x0e46('0xb')]=_0x2f4d0b[_0x0e46('0xb')];this[_0x0e46('0xc')]={};this[_0x0e46('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x0e46('0xe')]();}WhatsappQueue['prototype'][_0x0e46('0xf')]=function(){var _0x37eab1=this[_0x0e46('0xc')][_0x0e46('0x10')];this[_0x0e46('0xc')]=_[_0x0e46('0x11')](this[_0x0e46('0xb')],'id');this[_0x0e46('0xc')][_0x0e46('0x10')]=_0x37eab1;};WhatsappQueue[_0x0e46('0x12')][_0x0e46('0xe')]=function(){this['loggedIn']=0x0;this[_0x0e46('0x13')]=0x0;for(var _0x3721fb=0x0;_0x3721fb<this[_0x0e46('0xb')][_0x0e46('0x14')];_0x3721fb+=0x1){if(this[_0x0e46('0xb')][_0x3721fb]['online']){this[_0x0e46('0x15')]+=0x1;}if(this[_0x0e46('0xb')][_0x3721fb][_0x0e46('0x16')]){this['paused']+=0x1;}}this[_0x0e46('0x17')]=this['loggedIn']-this[_0x0e46('0x13')];this[_0x0e46('0x17')]=this[_0x0e46('0x17')]>=0x0?this[_0x0e46('0x17')]:0x0;var _0x523052={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0e46('0x15')],'name':this['name'],'paused':this[_0x0e46('0x13')],'waiting':this[_0x0e46('0xd')]};var _0x1c3084=md5(JSON[_0x0e46('0x18')](_0x523052));if(this[_0x0e46('0x0')]!==_0x1c3084){this[_0x0e46('0x0')]=_0x1c3084;io['to'](util[_0x0e46('0x19')]('whatsapp:queue:%s',_0x523052[_0x0e46('0x7')]))[_0x0e46('0x1a')](_0x0e46('0x1b'),_0x523052);}};module['exports']=WhatsappQueue;
\ No newline at end of file
index e4c1cc6..78b97c9 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(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x2fd652,_0x574f94){var _0x5470be=function(_0x5e699d){while(--_0x5e699d){_0x2fd652['push'](_0x2fd652['shift']());}};_0x5470be(++_0x574f94);}(_0xb10b,0x12a));var _0xbb10=function(_0x1212cf,_0x34fcd8){_0x1212cf=_0x1212cf-0x0;var _0x443478=_0xb10b[_0x1212cf];return _0x443478;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
index a8de958..2691800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabfb=['../client','update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x2f9341,_0x564cdd){var _0x429aa0=function(_0x52085c){while(--_0x52085c){_0x2f9341['push'](_0x2f9341['shift']());}};_0x429aa0(++_0x564cdd);}(_0xabfb,0x132));var _0xbabf=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xabfb[_0x37cc52];return _0x2b4a90;};'use strict';var client=require(_0xbabf('0x0'));exports[_0xbabf('0x1')]=function(_0x3b3120,_0x4e4b24){return client[_0xbabf('0x2')]('UpdateChatInteraction',{'body':_0x4e4b24,'options':{'where':{'id':_0x3b3120}},'log':_0xbabf('0x3')});};exports[_0xbabf('0x4')]=function(_0x5cb97e,_0x80132f){return client[_0xbabf('0x2')](_0xbabf('0x5'),{'body':_0x80132f,'options':{'where':{'id':_0x5cb97e}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x7a87=['Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x5521d5,_0x4d984f){var _0x19e227=function(_0x1dc823){while(--_0x1dc823){_0x5521d5['push'](_0x5521d5['shift']());}};_0x19e227(++_0x4d984f);}(_0x7a87,0x108));var _0x77a8=function(_0x3eb096,_0x376467){_0x3eb096=_0x3eb096-0x0;var _0x388289=_0x7a87[_0x3eb096];return _0x388289;};'use strict';var client=require(_0x77a8('0x0'));exports[_0x77a8('0x1')]=function(_0x4e9d50,_0x4d2220){return client[_0x77a8('0x2')]('UpdateChatInteraction',{'body':_0x4d2220,'options':{'where':{'id':_0x4e9d50}},'log':_0x77a8('0x3')});};exports[_0x77a8('0x4')]=function(_0x19c2b7,_0x368700){return client['Request'](_0x77a8('0x5'),{'body':_0x368700,'options':{'where':{'id':_0x19c2b7}},'log':_0x77a8('0x6')});};
\ No newline at end of file
index 965024c..7eb5978 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee7f=['create','Request','createChatMessage'];(function(_0xaa5340,_0xd5b447){var _0x26f1d2=function(_0x509e77){while(--_0x509e77){_0xaa5340['push'](_0xaa5340['shift']());}};_0x26f1d2(++_0xd5b447);}(_0xee7f,0x195));var _0xfee7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xee7f[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0xfee7('0x0')]=function(_0x3f2b7a){return client[_0xfee7('0x1')]('CreateChatMessage',{'body':_0x3f2b7a,'log':_0xfee7('0x2')});};
\ No newline at end of file
+var _0x1e5e=['create','Request','../client'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1e5e,0x185));var _0xe1e5=function(_0x384b76,_0x496cf3){_0x384b76=_0x384b76-0x0;var _0x4dbfac=_0x1e5e[_0x384b76];return _0x4dbfac;};'use strict';var client=require(_0xe1e5('0x0'));exports[_0xe1e5('0x1')]=function(_0x54927d){return client[_0xe1e5('0x2')]('CreateChatMessage',{'body':_0x54927d,'log':'createChatMessage'});};
\ No newline at end of file
index e7a8db3..e1de4ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4a1=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','strategy'];(function(_0x938db0,_0x2914e9){var _0x3b1538=function(_0x4241b4){while(--_0x4241b4){_0x938db0['push'](_0x938db0['shift']());}};_0x3b1538(++_0x2914e9);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x45b33b,_0x201f61){_0x45b33b=_0x45b33b-0x0;var _0x8e60b9=_0xc4a1[_0x45b33b];return _0x8e60b9;};'use strict';var client=require(_0x1c4a('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x1c4a('0x1')](_0x1c4a('0x2'),{'options':{'raw':![],'attributes':['id',_0x1c4a('0x3'),'timeout',_0x1c4a('0x4')],'include':[{'model':_0x1c4a('0x5'),'as':_0x1c4a('0x6'),'attributes':['id',_0x1c4a('0x3'),_0x1c4a('0x7'),_0x1c4a('0x8')]}]},'log':_0x1c4a('0x9')});};};
\ No newline at end of file
+var _0x5549=['name','strategy','User','Agents','online','../client','getChatQueues','Request','GetChatQueue'];(function(_0x19c0bd,_0x3f7d42){var _0x41fb5f=function(_0x53a398){while(--_0x53a398){_0x19c0bd['push'](_0x19c0bd['shift']());}};_0x41fb5f(++_0x3f7d42);}(_0x5549,0x1f4));var _0x9554=function(_0xbc2b76,_0xe44b55){_0xbc2b76=_0xbc2b76-0x0;var _0x5cdc5f=_0x5549[_0xbc2b76];return _0x5cdc5f;};'use strict';var client=require(_0x9554('0x0'));exports[_0x9554('0x1')]=function(){return function(){return client[_0x9554('0x2')](_0x9554('0x3'),{'options':{'raw':![],'attributes':['id',_0x9554('0x4'),'timeout',_0x9554('0x5')],'include':[{'model':_0x9554('0x6'),'as':_0x9554('0x7'),'attributes':['id',_0x9554('0x4'),_0x9554('0x8'),'chatPause']}]},'log':_0x9554('0x1')});};};
\ No newline at end of file
index f2bd086..8973ef9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab5b=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC'];(function(_0x4ef72e,_0x548b57){var _0x5c3dfe=function(_0x273e00){while(--_0x273e00){_0x4ef72e['push'](_0x4ef72e['shift']());}};_0x5c3dfe(++_0x548b57);}(_0xab5b,0x11a));var _0xbab5=function(_0x4ec754,_0x4937ff){_0x4ec754=_0x4ec754-0x0;var _0x174573=_0xab5b[_0x4ec754];return _0x174573;};'use strict';var client=require(_0xbab5('0x0'));exports[_0xbab5('0x1')]=function(_0x52fbcc){return client[_0xbab5('0x2')](_0xbab5('0x3'),{'body':_0x52fbcc,'log':'CreateChatQueueReport'});};exports['update']=function(_0x2a5d23,_0x58f49f){return client[_0xbab5('0x2')](_0xbab5('0x4'),{'body':_0x58f49f,'options':{'where':{'uniqueid':_0x2a5d23},'order':[['id',_0xbab5('0x5')]],'limit':0x1},'log':_0xbab5('0x4')});};
\ No newline at end of file
+var _0x45ea=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','../client','create'];(function(_0x1754b2,_0x2cf49e){var _0x4fa409=function(_0x49d309){while(--_0x49d309){_0x1754b2['push'](_0x1754b2['shift']());}};_0x4fa409(++_0x2cf49e);}(_0x45ea,0x1f0));var _0xa45e=function(_0x4dc0b2,_0x4be49e){_0x4dc0b2=_0x4dc0b2-0x0;var _0x51faef=_0x45ea[_0x4dc0b2];return _0x51faef;};'use strict';var client=require(_0xa45e('0x0'));exports[_0xa45e('0x1')]=function(_0x1cfef8){return client[_0xa45e('0x2')](_0xa45e('0x3'),{'body':_0x1cfef8,'log':_0xa45e('0x3')});};exports[_0xa45e('0x4')]=function(_0x3dc05b,_0x43da76){return client[_0xa45e('0x2')](_0xa45e('0x5'),{'body':_0x43da76,'options':{'where':{'uniqueid':_0x3dc05b},'order':[['id','DESC']],'limit':0x1},'log':_0xa45e('0x5')});};
\ No newline at end of file
index f07cfc4..9eae569 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(_0x3a647d,_0x2fb0f9){var _0x573de5=function(_0xe1b935){while(--_0xe1b935){_0x3a647d['push'](_0x3a647d['shift']());}};_0x573de5(++_0x2fb0f9);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x7a54,0x106));var _0x47a5=function(_0x11b47b,_0x4538bf){_0x11b47b=_0x11b47b-0x0;var _0x4dca24=_0x7a54[_0x11b47b];return _0x4dca24;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
index 0b70258..08155a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b2b=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x51ebd3,_0x1eab9e){var _0x2ba30b=function(_0x401c82){while(--_0x401c82){_0x51ebd3['push'](_0x51ebd3['shift']());}};_0x2ba30b(++_0x1eab9e);}(_0x1b2b,0x158));var _0xb1b2=function(_0x4359fa,_0x4d5f23){_0x4359fa=_0x4359fa-0x0;var _0x3df26d=_0x1b2b[_0x4359fa];return _0x3df26d;};'use strict';var client=require('../client');exports[_0xb1b2('0x0')]=function(_0xdeb89b){return client[_0xb1b2('0x1')](_0xb1b2('0x2'),{'body':_0xdeb89b,'log':_0xb1b2('0x3')});};
\ No newline at end of file
+var _0x8d6b=['Request','createFaxMessage','../client','create'];(function(_0x1ab3f9,_0x5f10bd){var _0xb0b36=function(_0x1cd75a){while(--_0x1cd75a){_0x1ab3f9['push'](_0x1ab3f9['shift']());}};_0xb0b36(++_0x5f10bd);}(_0x8d6b,0x13a));var _0xb8d6=function(_0x59a5a4,_0xd550e3){_0x59a5a4=_0x59a5a4-0x0;var _0x4e8e04=_0x8d6b[_0x59a5a4];return _0x4e8e04;};'use strict';var client=require(_0xb8d6('0x0'));exports[_0xb8d6('0x1')]=function(_0x2a3a5e){return client[_0xb8d6('0x2')]('CreateFaxMessage',{'body':_0x2a3a5e,'log':_0xb8d6('0x3')});};
\ No newline at end of file
index 18511a5..63d869b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dfc=['GetFaxQueue','timeout','strategy','User','Agents','name','online','faxPause','../client','getFaxQueues','Request'];(function(_0x504a99,_0xd78e59){var _0x55107e=function(_0x55eae0){while(--_0x55eae0){_0x504a99['push'](_0x504a99['shift']());}};_0x55107e(++_0xd78e59);}(_0x2dfc,0xc3));var _0xc2df=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2dfc[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0xc2df('0x0'));exports[_0xc2df('0x1')]=function(){return function(){return client[_0xc2df('0x2')](_0xc2df('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc2df('0x4'),_0xc2df('0x5')],'include':[{'model':_0xc2df('0x6'),'as':_0xc2df('0x7'),'attributes':['id',_0xc2df('0x8'),_0xc2df('0x9'),_0xc2df('0xa')]}]},'log':_0xc2df('0x1')});};};
\ No newline at end of file
+var _0x016c=['getFaxQueues','Request','GetFaxQueue','name','online','../client'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x016c,0xef));var _0xc016=function(_0x2d99eb,_0x48c5c5){_0x2d99eb=_0x2d99eb-0x0;var _0x55e2fb=_0x016c[_0x2d99eb];return _0x55e2fb;};'use strict';var client=require(_0xc016('0x0'));exports[_0xc016('0x1')]=function(){return function(){return client[_0xc016('0x2')](_0xc016('0x3'),{'options':{'raw':![],'attributes':['id',_0xc016('0x4'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xc016('0x4'),_0xc016('0x5'),'faxPause']}]},'log':_0xc016('0x1')});};};
\ No newline at end of file
index ffd0629..064682c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2e8=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x635036,_0x5e542d){var _0x477e47=function(_0x28bc1e){while(--_0x28bc1e){_0x635036['push'](_0x635036['shift']());}};_0x477e47(++_0x5e542d);}(_0xd2e8,0x107));var _0x8d2e=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xd2e8[_0x18d631];return _0x50d708;};'use strict';var client=require(_0x8d2e('0x0'));exports[_0x8d2e('0x1')]=function(_0x861c60){return client[_0x8d2e('0x2')](_0x8d2e('0x3'),{'body':_0x861c60,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x8e5285,_0x29bbd7){return client[_0x8d2e('0x2')](_0x8d2e('0x4'),{'body':_0x29bbd7,'options':{'where':{'uniqueid':_0x8e5285},'order':[['id',_0x8d2e('0x5')]],'limit':0x1},'log':_0x8d2e('0x4')});};
\ No newline at end of file
+var _0xf4a4=['CreateFaxQueueReport','update','DESC','../client','create','Request'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xf4a4,0x129));var _0x4f4a=function(_0x46edbd,_0x1b1765){_0x46edbd=_0x46edbd-0x0;var _0x5cce3b=_0xf4a4[_0x46edbd];return _0x5cce3b;};'use strict';var client=require(_0x4f4a('0x0'));exports[_0x4f4a('0x1')]=function(_0xa75618){return client[_0x4f4a('0x2')](_0x4f4a('0x3'),{'body':_0xa75618,'log':'CreateFaxQueueReport'});};exports[_0x4f4a('0x4')]=function(_0x57ce44,_0x2cf328){return client[_0x4f4a('0x2')]('UpdateFaxQueueReport',{'body':_0x2cf328,'options':{'where':{'uniqueid':_0x57ce44},'order':[['id',_0x4f4a('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index 4bec93a..5222fe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c0=['Request','name','Interval','Intervals','../client'];(function(_0x1be160,_0x1bc0a1){var _0x171549=function(_0x1abcf7){while(--_0x1abcf7){_0x1be160['push'](_0x1be160['shift']());}};_0x171549(++_0x1bc0a1);}(_0x12c0,0x1d5));var _0x012c=function(_0x268aba,_0x5a5f16){_0x268aba=_0x268aba-0x0;var _0x277aa2=_0x12c0[_0x268aba];return _0x277aa2;};'use strict';var client=require(_0x012c('0x0'));exports['getIntervals']=function(){return function(){return client[_0x012c('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x012c('0x2')],'include':[{'model':_0x012c('0x3'),'as':_0x012c('0x4'),'attributes':['id',_0x012c('0x2'),'interval']}]},'log':'getIntervals'});};};
\ No newline at end of file
+var _0xaded=['name','interval','getIntervals','Request','GetInterval'];(function(_0xe1e38b,_0x205c99){var _0x5c54f4=function(_0x4a910a){while(--_0x4a910a){_0xe1e38b['push'](_0xe1e38b['shift']());}};_0x5c54f4(++_0x205c99);}(_0xaded,0xd9));var _0xdade=function(_0xc9306d,_0x6ff335){_0xc9306d=_0xc9306d-0x0;var _0x13e994=_0xaded[_0xc9306d];return _0x13e994;};'use strict';var client=require('../client');exports[_0xdade('0x0')]=function(){return function(){return client[_0xdade('0x1')](_0xdade('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xdade('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xdade('0x3'),_0xdade('0x4')]}]},'log':_0xdade('0x0')});};};
\ No newline at end of file
index 8bfcd0d..818737e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e3=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xf2e3[_0x4a3898];return _0x25ceb0;};'use strict';var client=require(_0x3f2e('0x0'));exports['update']=function(_0x143e9e,_0x231b2b){return client[_0x3f2e('0x1')](_0x3f2e('0x2'),{'body':_0x231b2b,'options':{'where':{'id':_0x143e9e}},'log':_0x3f2e('0x3')});};exports[_0x3f2e('0x4')]=function(_0x3938e2,_0xabcf5c){return client[_0x3f2e('0x1')]('AddTagsToMailInteraction',{'body':_0xabcf5c,'options':{'where':{'id':_0x3938e2}},'log':_0x3f2e('0x5')});};
\ No newline at end of file
+var _0xb016=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','updateMailInteraction','addTags'];(function(_0x3dd92b,_0x4d1139){var _0x5e1d23=function(_0x5d866f){while(--_0x5d866f){_0x3dd92b['push'](_0x3dd92b['shift']());}};_0x5e1d23(++_0x4d1139);}(_0xb016,0x159));var _0x6b01=function(_0x20072a,_0x4852e1){_0x20072a=_0x20072a-0x0;var _0x1900da=_0xb016[_0x20072a];return _0x1900da;};'use strict';var client=require(_0x6b01('0x0'));exports[_0x6b01('0x1')]=function(_0x513ed6,_0x57ecae){return client[_0x6b01('0x2')]('UpdateMailInteraction',{'body':_0x57ecae,'options':{'where':{'id':_0x513ed6}},'log':_0x6b01('0x3')});};exports[_0x6b01('0x4')]=function(_0x161b59,_0x3b9de1){return client['Request'](_0x6b01('0x5'),{'body':_0x3b9de1,'options':{'where':{'id':_0x161b59}},'log':_0x6b01('0x6')});};
\ No newline at end of file
index 1cebe50..532c172 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf406=['createMailMessage'];(function(_0x2124f8,_0x2b515e){var _0xbe4669=function(_0x484819){while(--_0x484819){_0x2124f8['push'](_0x2124f8['shift']());}};_0xbe4669(++_0x2b515e);}(_0xf406,0x11e));var _0x6f40=function(_0x545e41,_0x55830d){_0x545e41=_0x545e41-0x0;var _0x20ee17=_0xf406[_0x545e41];return _0x20ee17;};'use strict';var client=require('../client');exports['create']=function(_0x1e5128){return client['Request']('CreateMailMessage',{'body':_0x1e5128,'log':_0x6f40('0x0')});};
\ No newline at end of file
+var _0x654f=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x3ad9b3,_0x5c76e9){var _0x4ef8d1=function(_0x239036){while(--_0x239036){_0x3ad9b3['push'](_0x3ad9b3['shift']());}};_0x4ef8d1(++_0x5c76e9);}(_0x654f,0x9c));var _0xf654=function(_0x474031,_0xf13a2a){_0x474031=_0x474031-0x0;var _0x1e76eb=_0x654f[_0x474031];return _0x1e76eb;};'use strict';var client=require(_0xf654('0x0'));exports[_0xf654('0x1')]=function(_0x24c060){return client[_0xf654('0x2')](_0xf654('0x3'),{'body':_0x24c060,'log':_0xf654('0x4')});};
\ No newline at end of file
index 42b9e30..3da53df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8167=['name','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x3ffbd8,_0x1f7190){var _0x4f07c8=function(_0x4971ea){while(--_0x4971ea){_0x3ffbd8['push'](_0x3ffbd8['shift']());}};_0x4f07c8(++_0x1f7190);}(_0x8167,0x164));var _0x7816=function(_0x3554c0,_0x4cc8e1){_0x3554c0=_0x3554c0-0x0;var _0x4588c8=_0x8167[_0x3554c0];return _0x4588c8;};'use strict';var client=require(_0x7816('0x0'));exports[_0x7816('0x1')]=function(){return function(){return client[_0x7816('0x2')](_0x7816('0x3'),{'options':{'raw':![],'attributes':['id',_0x7816('0x4'),'timeout',_0x7816('0x5')],'include':[{'model':_0x7816('0x6'),'as':_0x7816('0x7'),'attributes':['id',_0x7816('0x4'),_0x7816('0x8'),_0x7816('0x9')]}]},'log':_0x7816('0x1')});};};
\ No newline at end of file
+var _0xb4f3=['name','timeout','strategy','online','getMailQueues','../client','Request','GetMailQueue'];(function(_0x517160,_0x3ecafa){var _0x7acb61=function(_0xb270b4){while(--_0xb270b4){_0x517160['push'](_0x517160['shift']());}};_0x7acb61(++_0x3ecafa);}(_0xb4f3,0x1d5));var _0x3b4f=function(_0xb525fc,_0x8495e9){_0xb525fc=_0xb525fc-0x0;var _0x2b2f90=_0xb4f3[_0xb525fc];return _0x2b2f90;};'use strict';var client=require(_0x3b4f('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x3b4f('0x1')](_0x3b4f('0x2'),{'options':{'raw':![],'attributes':['id',_0x3b4f('0x3'),_0x3b4f('0x4'),_0x3b4f('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x3b4f('0x3'),_0x3b4f('0x6'),'mailPause']}]},'log':_0x3b4f('0x7')});};};
\ No newline at end of file
index 4992a84..f0f716c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63da=['DESC','create','Request','CreateMailQueueReport','update'];(function(_0xd157d5,_0x5d1649){var _0x27a2e1=function(_0x31869d){while(--_0x31869d){_0xd157d5['push'](_0xd157d5['shift']());}};_0x27a2e1(++_0x5d1649);}(_0x63da,0xba));var _0xa63d=function(_0x5ac339,_0x4c58c3){_0x5ac339=_0x5ac339-0x0;var _0x24ea40=_0x63da[_0x5ac339];return _0x24ea40;};'use strict';var client=require('../client');exports[_0xa63d('0x0')]=function(_0x14094c){return client[_0xa63d('0x1')]('CreateMailQueueReport',{'body':_0x14094c,'log':_0xa63d('0x2')});};exports[_0xa63d('0x3')]=function(_0x57e013,_0x1d451a){return client['Request']('UpdateMailQueueReport',{'body':_0x1d451a,'options':{'where':{'uniqueid':_0x57e013},'order':[['id',_0xa63d('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0x9900=['../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x3b4d7a,_0x463470){var _0x1c41a4=function(_0x483b08){while(--_0x483b08){_0x3b4d7a['push'](_0x3b4d7a['shift']());}};_0x1c41a4(++_0x463470);}(_0x9900,0x6c));var _0x0990=function(_0x5b69f5,_0x4ca780){_0x5b69f5=_0x5b69f5-0x0;var _0xafaeb8=_0x9900[_0x5b69f5];return _0xafaeb8;};'use strict';var client=require(_0x0990('0x0'));exports[_0x0990('0x1')]=function(_0x2da3e9){return client[_0x0990('0x2')](_0x0990('0x3'),{'body':_0x2da3e9,'log':_0x0990('0x3')});};exports['update']=function(_0x22b768,_0x23c6b9){return client[_0x0990('0x2')](_0x0990('0x4'),{'body':_0x23c6b9,'options':{'where':{'uniqueid':_0x22b768},'order':[['id',_0x0990('0x5')]],'limit':0x1},'log':_0x0990('0x4')});};
\ No newline at end of file
index a574b43..f1d4890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb0c=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','update'];(function(_0x336924,_0x40e73a){var _0x335d61=function(_0x1307a3){while(--_0x1307a3){_0x336924['push'](_0x336924['shift']());}};_0x335d61(++_0x40e73a);}(_0xeb0c,0x1bb));var _0xceb0=function(_0xd2f4ac,_0x5aa8e5){_0xd2f4ac=_0xd2f4ac-0x0;var _0x9757b2=_0xeb0c[_0xd2f4ac];return _0x9757b2;};'use strict';var client=require('../client');exports[_0xceb0('0x0')]=function(_0x485bb1,_0x22a394){return client[_0xceb0('0x1')](_0xceb0('0x2'),{'body':_0x22a394,'options':{'where':{'id':_0x485bb1}},'log':_0xceb0('0x3')});};exports[_0xceb0('0x4')]=function(_0xae797d,_0x226fab){return client[_0xceb0('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x226fab,'options':{'where':{'id':_0xae797d}},'log':_0xceb0('0x5')});};
\ No newline at end of file
+var _0x5238=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x1ee7ef,_0x3a02c7){var _0x84066e=function(_0x546ed7){while(--_0x546ed7){_0x1ee7ef['push'](_0x1ee7ef['shift']());}};_0x84066e(++_0x3a02c7);}(_0x5238,0x68));var _0x8523=function(_0x5c05ff,_0x590fc6){_0x5c05ff=_0x5c05ff-0x0;var _0x1303af=_0x5238[_0x5c05ff];return _0x1303af;};'use strict';var client=require(_0x8523('0x0'));exports['update']=function(_0x59c217,_0x5474cf){return client[_0x8523('0x1')](_0x8523('0x2'),{'body':_0x5474cf,'options':{'where':{'id':_0x59c217}},'log':_0x8523('0x3')});};exports[_0x8523('0x4')]=function(_0x16329a,_0x398552){return client['Request'](_0x8523('0x5'),{'body':_0x398552,'options':{'where':{'id':_0x16329a}},'log':_0x8523('0x6')});};
\ No newline at end of file
index 0e62bb0..60afacd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2446=['createOpenchannelMessage','create','Request'];(function(_0x5dac46,_0x28e9dc){var _0x51095c=function(_0x5918c6){while(--_0x5918c6){_0x5dac46['push'](_0x5dac46['shift']());}};_0x51095c(++_0x28e9dc);}(_0x2446,0xc4));var _0x6244=function(_0x524e90,_0x4f8426){_0x524e90=_0x524e90-0x0;var _0xfd4c4e=_0x2446[_0x524e90];return _0xfd4c4e;};'use strict';var client=require('../client');exports[_0x6244('0x0')]=function(_0x46d0e4){return client[_0x6244('0x1')]('CreateOpenchannelMessage',{'body':_0x46d0e4,'log':_0x6244('0x2')});};
\ No newline at end of file
+var _0x8c96=['CreateOpenchannelMessage','createOpenchannelMessage','Request'];(function(_0x481df5,_0x216652){var _0x32726e=function(_0x2133f4){while(--_0x2133f4){_0x481df5['push'](_0x481df5['shift']());}};_0x32726e(++_0x216652);}(_0x8c96,0xfb));var _0x68c9=function(_0x1894e7,_0x1253e6){_0x1894e7=_0x1894e7-0x0;var _0x5e857f=_0x8c96[_0x1894e7];return _0x5e857f;};'use strict';var client=require('../client');exports['create']=function(_0x5dd3f9){return client[_0x68c9('0x0')](_0x68c9('0x1'),{'body':_0x5dd3f9,'log':_0x68c9('0x2')});};
\ No newline at end of file
index 21b5788..81d31d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf806=['name','timeout','strategy','User','Agents','../client','getOpenchannelQueues','Request'];(function(_0x4aef00,_0x5d81f5){var _0x5eba52=function(_0x412012){while(--_0x412012){_0x4aef00['push'](_0x4aef00['shift']());}};_0x5eba52(++_0x5d81f5);}(_0xf806,0x85));var _0x6f80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf806[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6f80('0x0'));exports[_0x6f80('0x1')]=function(){return function(){return client[_0x6f80('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x6f80('0x3'),_0x6f80('0x4'),_0x6f80('0x5')],'include':[{'model':_0x6f80('0x6'),'as':_0x6f80('0x7'),'attributes':['id',_0x6f80('0x3'),'online','openchannelPause']}]},'log':_0x6f80('0x1')});};};
\ No newline at end of file
+var _0x90a8=['../client','getOpenchannelQueues','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause'];(function(_0xed5d03,_0x40d189){var _0x129b17=function(_0x2cf6ee){while(--_0x2cf6ee){_0xed5d03['push'](_0xed5d03['shift']());}};_0x129b17(++_0x40d189);}(_0x90a8,0x14a));var _0x890a=function(_0x332a53,_0xf7b2f2){_0x332a53=_0x332a53-0x0;var _0x4a36e7=_0x90a8[_0x332a53];return _0x4a36e7;};'use strict';var client=require(_0x890a('0x0'));exports[_0x890a('0x1')]=function(){return function(){return client['Request'](_0x890a('0x2'),{'options':{'raw':![],'attributes':['id',_0x890a('0x3'),_0x890a('0x4'),_0x890a('0x5')],'include':[{'model':_0x890a('0x6'),'as':_0x890a('0x7'),'attributes':['id',_0x890a('0x3'),_0x890a('0x8'),_0x890a('0x9')]}]},'log':_0x890a('0x1')});};};
\ No newline at end of file
index 2b76822..2331ff0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4333=['CreateOpenchannelQueueReport','DESC','UpdateOpenchannelQueueReport','create'];(function(_0x391c9c,_0x426b77){var _0x43aa95=function(_0x16ef34){while(--_0x16ef34){_0x391c9c['push'](_0x391c9c['shift']());}};_0x43aa95(++_0x426b77);}(_0x4333,0x1eb));var _0x3433=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x4333[_0x45783c];return _0x1161da;};'use strict';var client=require('../client');exports[_0x3433('0x0')]=function(_0xf2c544){return client['Request'](_0x3433('0x1'),{'body':_0xf2c544,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x35323e,_0x49b62a){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x49b62a,'options':{'where':{'uniqueid':_0x35323e},'order':[['id',_0x3433('0x2')]],'limit':0x1},'log':_0x3433('0x3')});};
\ No newline at end of file
+var _0x4ffe=['create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x5a198b,_0x3409af){var _0x24a938=function(_0x1b4144){while(--_0x1b4144){_0x5a198b['push'](_0x5a198b['shift']());}};_0x24a938(++_0x3409af);}(_0x4ffe,0x172));var _0xe4ff=function(_0x322e89,_0x29cc1d){_0x322e89=_0x322e89-0x0;var _0x88f22b=_0x4ffe[_0x322e89];return _0x88f22b;};'use strict';var client=require(_0xe4ff('0x0'));exports[_0xe4ff('0x1')]=function(_0x39f3e5){return client['Request'](_0xe4ff('0x2'),{'body':_0x39f3e5,'log':_0xe4ff('0x2')});};exports[_0xe4ff('0x3')]=function(_0x52dbd6,_0x45c5e9){return client[_0xe4ff('0x4')](_0xe4ff('0x5'),{'body':_0x45c5e9,'options':{'where':{'uniqueid':_0x52dbd6},'order':[['id',_0xe4ff('0x6')]],'limit':0x1},'log':_0xe4ff('0x5')});};
\ No newline at end of file
index c94dbbe..5eb439d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84ab=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update','Request'];(function(_0x461925,_0x31f1e4){var _0x3b16c9=function(_0x8cf3e4){while(--_0x8cf3e4){_0x461925['push'](_0x461925['shift']());}};_0x3b16c9(++_0x31f1e4);}(_0x84ab,0x12f));var _0xb84a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x84ab[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0xb84a('0x0'));exports[_0xb84a('0x1')]=function(_0xd2561,_0x1ea089){return client[_0xb84a('0x2')]('UpdateSmsInteraction',{'body':_0x1ea089,'options':{'where':{'id':_0xd2561}},'log':_0xb84a('0x3')});};exports[_0xb84a('0x4')]=function(_0x47b8e3,_0x9d3a00){return client[_0xb84a('0x2')](_0xb84a('0x5'),{'body':_0x9d3a00,'options':{'where':{'id':_0x47b8e3}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
+var _0xaeab=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request'];(function(_0x20cdd1,_0xbfc0b4){var _0xf06ebc=function(_0x1b920f){while(--_0x1b920f){_0x20cdd1['push'](_0x20cdd1['shift']());}};_0xf06ebc(++_0xbfc0b4);}(_0xaeab,0x91));var _0xbaea=function(_0x2bd436,_0x50cfd5){_0x2bd436=_0x2bd436-0x0;var _0x20faf9=_0xaeab[_0x2bd436];return _0x20faf9;};'use strict';var client=require(_0xbaea('0x0'));exports['update']=function(_0x4aa896,_0x5e8f3a){return client[_0xbaea('0x1')](_0xbaea('0x2'),{'body':_0x5e8f3a,'options':{'where':{'id':_0x4aa896}},'log':_0xbaea('0x3')});};exports[_0xbaea('0x4')]=function(_0x36e839,_0xbe1ff5){return client[_0xbaea('0x1')](_0xbaea('0x5'),{'body':_0xbe1ff5,'options':{'where':{'id':_0x36e839}},'log':_0xbaea('0x6')});};
\ No newline at end of file
index f2a8251..a9c90ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e30=['create','Request','createSmsMessage','../client'];(function(_0x2283cb,_0x4de35e){var _0x4e56d6=function(_0x1ac831){while(--_0x1ac831){_0x2283cb['push'](_0x2283cb['shift']());}};_0x4e56d6(++_0x4de35e);}(_0x6e30,0x11b));var _0x06e3=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x6e30[_0x1cd47d];return _0x29d52f;};'use strict';var client=require(_0x06e3('0x0'));exports[_0x06e3('0x1')]=function(_0x37514d){return client[_0x06e3('0x2')]('CreateSmsMessage',{'body':_0x37514d,'log':_0x06e3('0x3')});};
\ No newline at end of file
+var _0x89fd=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x35750f,_0x205c49){var _0xb341ce=function(_0x320e39){while(--_0x320e39){_0x35750f['push'](_0x35750f['shift']());}};_0xb341ce(++_0x205c49);}(_0x89fd,0xdc));var _0xd89f=function(_0x15bb92,_0x11c05e){_0x15bb92=_0x15bb92-0x0;var _0x561c59=_0x89fd[_0x15bb92];return _0x561c59;};'use strict';var client=require(_0xd89f('0x0'));exports[_0xd89f('0x1')]=function(_0x18d588){return client[_0xd89f('0x2')](_0xd89f('0x3'),{'body':_0x18d588,'log':_0xd89f('0x4')});};
\ No newline at end of file
index f30dd0a..84268fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x2c80c0,_0x5479b5){var _0x23bb3d=function(_0x12dfed){while(--_0x12dfed){_0x2c80c0['push'](_0x2c80c0['shift']());}};_0x23bb3d(++_0x5479b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x34f787,_0x3734c8){var _0x5d6b90=function(_0x5d2415){while(--_0x5d2415){_0x34f787['push'](_0x34f787['shift']());}};_0x5d6b90(++_0x3734c8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xcb91[_0x48d6a3];return _0x38bfa0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
index d249590..6458cf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4a21a9,_0x428547){var _0x375d50=function(_0x390c41){while(--_0x390c41){_0x4a21a9['push'](_0x4a21a9['shift']());}};_0x375d50(++_0x428547);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});};
\ No newline at end of file
+var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xedd9,0xfc));var _0x9edd=function(_0x555310,_0x117b44){_0x555310=_0x555310-0x0;var _0x16d661=_0xedd9[_0x555310];return _0x16d661;};'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 d132465..13e9e9a 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(_0x371baa,_0xe896e){var _0x4f4f2b=function(_0x121711){while(--_0x121711){_0x371baa['push'](_0x371baa['shift']());}};_0x4f4f2b(++_0xe896e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x4817a1,_0x2be025){var _0x58d938=function(_0x5c18cd){while(--_0x5c18cd){_0x4817a1['push'](_0x4817a1['shift']());}};_0x58d938(++_0x2be025);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 6fee4fb..4f59707 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15b2=['update','Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x15b2,0x145));var _0x215b=function(_0xe0d025,_0x220fa0){_0xe0d025=_0xe0d025-0x0;var _0x2901dd=_0x15b2[_0xe0d025];return _0x2901dd;};'use strict';var client=require('../client');exports[_0x215b('0x0')]=function(_0x51f311,_0x322651){return client[_0x215b('0x1')]('UpdateWhatsappInteraction',{'body':_0x322651,'options':{'where':{'id':_0x51f311}},'log':_0x215b('0x2')});};exports[_0x215b('0x3')]=function(_0x62c5ce,_0x506d00){return client['Request'](_0x215b('0x4'),{'body':_0x506d00,'options':{'where':{'id':_0x62c5ce}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0xdf98=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x48789c,_0x301c18){var _0x5e27d2=function(_0xaee73c){while(--_0xaee73c){_0x48789c['push'](_0x48789c['shift']());}};_0x5e27d2(++_0x301c18);}(_0xdf98,0xcf));var _0x8df9=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xdf98[_0x36f47c];return _0x296c55;};'use strict';var client=require(_0x8df9('0x0'));exports['update']=function(_0x1f9abd,_0x4bbb45){return client['Request'](_0x8df9('0x1'),{'body':_0x4bbb45,'options':{'where':{'id':_0x1f9abd}},'log':_0x8df9('0x2')});};exports[_0x8df9('0x3')]=function(_0xeec2ab,_0x3f2ade){return client[_0x8df9('0x4')](_0x8df9('0x5'),{'body':_0x3f2ade,'options':{'where':{'id':_0xeec2ab}},'log':_0x8df9('0x6')});};
\ No newline at end of file
index 9714ac5..8f1fef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf84f=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x513ea1,_0x390b66){var _0x4812a6=function(_0xa8bba0){while(--_0xa8bba0){_0x513ea1['push'](_0x513ea1['shift']());}};_0x4812a6(++_0x390b66);}(_0xf84f,0xd1));var _0xff84=function(_0xc82ee2,_0x5e9b96){_0xc82ee2=_0xc82ee2-0x0;var _0x294bb8=_0xf84f[_0xc82ee2];return _0x294bb8;};'use strict';var client=require(_0xff84('0x0'));exports[_0xff84('0x1')]=function(_0x469352){return client[_0xff84('0x2')](_0xff84('0x3'),{'body':_0x469352,'log':_0xff84('0x4')});};
\ No newline at end of file
+var _0xa723=['Request','CreateWhatsappMessage','../client','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa723,0x1d6));var _0x3a72=function(_0x45b1ba,_0x5a6a21){_0x45b1ba=_0x45b1ba-0x0;var _0x145ddb=_0xa723[_0x45b1ba];return _0x145ddb;};'use strict';var client=require(_0x3a72('0x0'));exports[_0x3a72('0x1')]=function(_0x3173ed){return client[_0x3a72('0x2')](_0x3a72('0x3'),{'body':_0x3173ed,'log':'createWhatsappMessage'});};
\ No newline at end of file
index e66fe46..02813df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15fb=['../client','Request','name','timeout','strategy','User','Agents','online','getWhatsappQueues'];(function(_0x3c013a,_0x3ee6ab){var _0x373dca=function(_0x1ccff5){while(--_0x1ccff5){_0x3c013a['push'](_0x3c013a['shift']());}};_0x373dca(++_0x3ee6ab);}(_0x15fb,0x1a7));var _0xb15f=function(_0x4d11cd,_0x595625){_0x4d11cd=_0x4d11cd-0x0;var _0x3f8554=_0x15fb[_0x4d11cd];return _0x3f8554;};'use strict';var client=require(_0xb15f('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xb15f('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xb15f('0x2'),_0xb15f('0x3'),_0xb15f('0x4')],'include':[{'model':_0xb15f('0x5'),'as':_0xb15f('0x6'),'attributes':['id','name',_0xb15f('0x7'),'whatsappPause']}]},'log':_0xb15f('0x8')});};};
\ No newline at end of file
+var _0x6bc8=['../client','getWhatsappQueues','GetWhatsappQueue','name','timeout','User','Agents','online'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x6bc8,0x150));var _0x86bc=function(_0x259cb2,_0x1da73f){_0x259cb2=_0x259cb2-0x0;var _0x7d3865=_0x6bc8[_0x259cb2];return _0x7d3865;};'use strict';var client=require(_0x86bc('0x0'));exports[_0x86bc('0x1')]=function(){return function(){return client['Request'](_0x86bc('0x2'),{'options':{'raw':![],'attributes':['id',_0x86bc('0x3'),_0x86bc('0x4'),'strategy'],'include':[{'model':_0x86bc('0x5'),'as':_0x86bc('0x6'),'attributes':['id',_0x86bc('0x3'),_0x86bc('0x7'),'whatsappPause']}]},'log':_0x86bc('0x1')});};};
\ No newline at end of file
index 9278ced..b1b5fa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef4=['CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x8ef4,0x123));var _0x48ef=function(_0xcb785d,_0x29e22d){_0xcb785d=_0xcb785d-0x0;var _0x6e8faf=_0x8ef4[_0xcb785d];return _0x6e8faf;};'use strict';var client=require(_0x48ef('0x0'));exports[_0x48ef('0x1')]=function(_0x525115){return client[_0x48ef('0x2')](_0x48ef('0x3'),{'body':_0x525115,'log':'CreateWhatsappQueueReport'});};exports[_0x48ef('0x4')]=function(_0x26f024,_0x4f8a7b){return client[_0x48ef('0x2')]('UpdateWhatsappQueueReport',{'body':_0x4f8a7b,'options':{'where':{'uniqueid':_0x26f024},'order':[['id',_0x48ef('0x5')]],'limit':0x1},'log':_0x48ef('0x6')});};
\ No newline at end of file
+var _0xe367=['update','Request','UpdateWhatsappQueueReport','DESC','../client','create','CreateWhatsappQueueReport'];(function(_0x372b0a,_0x4b6fd5){var _0x34ab57=function(_0x2a9046){while(--_0x2a9046){_0x372b0a['push'](_0x372b0a['shift']());}};_0x34ab57(++_0x4b6fd5);}(_0xe367,0x1e7));var _0x7e36=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe367[_0x5c2e3e];return _0x53f64a;};'use strict';var client=require(_0x7e36('0x0'));exports[_0x7e36('0x1')]=function(_0x4f4280){return client['Request'](_0x7e36('0x2'),{'body':_0x4f4280,'log':'CreateWhatsappQueueReport'});};exports[_0x7e36('0x3')]=function(_0x445903,_0x1f08ac){return client[_0x7e36('0x4')](_0x7e36('0x5'),{'body':_0x1f08ac,'options':{'where':{'uniqueid':_0x445903},'order':[['id',_0x7e36('0x6')]],'limit':0x1},'log':_0x7e36('0x5')});};
\ No newline at end of file
index b810141..672a622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa88d=['timeout','createQueue','atimeout','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find'];(function(_0x274a9c,_0x31badd){var _0x8851ef=function(_0x37ac4a){while(--_0x37ac4a){_0x274a9c['push'](_0x274a9c['shift']());}};_0x8851ef(++_0x31badd);}(_0xa88d,0x179));var _0xda88=function(_0x358aea,_0x40c6fd){_0x358aea=_0x358aea-0x0;var _0x30aaa9=_0xa88d[_0x358aea];return _0x30aaa9;};'use strict';var schema=require(_0xda88('0x0'));var _=require('lodash');var util=require(_0xda88('0x1'));var seqqueue=require(_0xda88('0x2'));var logger=require('../../../../config/logger')(_0xda88('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xda88('0x4'),'required':!![],'message':_0xda88('0x5')},'timeout':{'type':'number','message':_0xda88('0x6')}});function writeLog(_0x2fa649,_0x5756f0,_0x2eec29){return logger[_0xda88('0x7')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x2fa649,_0x5756f0[_0xda88('0x8')],_0x2eec29));}function handleFindAgent(_0x18cd83){return function(_0x270ce7){return _0x270ce7['name'][_0xda88('0x9')]()===_0x18cd83[_0xda88('0x9')]();};}exports[_0xda88('0xa')]=function(_0x493e4b,_0x1dae93,_0x3368d1,_0x4bc469){return function(_0x2eea1d){try{var _0x352a11={'name':_0x1dae93[0x0],'timeout':_0x1dae93[0x1]};var _0x4755bb=queue[_0xda88('0x0')](_0x352a11,{'typecast':!![]});if(_0x4755bb[_0xda88('0xb')]){logger[_0xda88('0xc')](_0xda88('0xd'),_0x493e4b,_[_0xda88('0xe')](_0x4755bb,_0xda88('0xf'))[_0xda88('0x10')](',\x20'));_0x2eea1d[_0xda88('0x11')]();}else{var _0x3a8df5=_[_0xda88('0x12')](_0x3368d1['agents'],handleFindAgent(_0x352a11[_0xda88('0x8')]));if(_0x3a8df5){var _0x16c726=(_0x352a11[_0xda88('0x13')]||0xa)*0x3e8;var _0x719cbb,_0x454427;var _0x500c1e=seqqueue[_0xda88('0x14')](_0x16c726);_0x500c1e['id']=_0x493e4b;_0x500c1e[_0xda88('0x15')]=_0x16c726;_0x500c1e['channel']=_0x4bc469[_0xda88('0x16')];writeLog(_0x493e4b,_0x3a8df5,util[_0xda88('0x17')](_0xda88('0x18'),_0x16c726));_0x3368d1['rules'][_0x493e4b]['on'](_0xda88('0x19'),function(){logger[_0xda88('0x7')](_0xda88('0x1a'),_0x493e4b);clearTimeout(_0x454427);_0x454427=undefined;_0x500c1e[_0xda88('0x1b')]();if(_0x3368d1[_0xda88('0x1c')][_0x493e4b]){delete _0x3368d1[_0xda88('0x1c')][_0x493e4b];}_0x2eea1d[_0xda88('0x11')]();});_0x3368d1[_0xda88('0x1c')][_0x493e4b]['on'](_0xda88('0x1d'),function(){if(_0x3368d1['rules'][_0x493e4b]){delete _0x3368d1[_0xda88('0x1c')][_0x493e4b];}});_0x454427=setTimeout(function(){logger[_0xda88('0x7')](_0xda88('0x1e'),_0x493e4b);clearTimeout(_0x454427);_0x500c1e[_0xda88('0x1b')]();_0x2eea1d['next']();},_0x16c726);strategy[_0xda88('0x1f')](_0x500c1e,_0x3a8df5,_0x3368d1,_0x4bc469);}else{logger[_0xda88('0xc')](_0xda88('0x20'),_0x493e4b,_0x352a11[_0xda88('0x8')]);_0x2eea1d[_0xda88('0x11')]();}}}catch(_0x4ff737){console[_0xda88('0x21')](_0x4ff737);logger[_0xda88('0xc')](_0xda88('0x22'),_0x493e4b,_0x4ff737[_0xda88('0x23')]);_0x2eea1d[_0xda88('0x11')]();}};};
\ No newline at end of file
+var _0xf893=['toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','agents','createQueue','atimeout','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','[%s][AGENT]\x20ROUTING\x20END','next','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x4970f2,_0xf059df){var _0x35f90e=function(_0x3cd177){while(--_0x3cd177){_0x4970f2['push'](_0x4970f2['shift']());}};_0x35f90e(++_0xf059df);}(_0xf893,0x149));var _0x3f89=function(_0x472a95,_0x565d28){_0x472a95=_0x472a95-0x0;var _0x331050=_0xf893[_0x472a95];return _0x331050;};'use strict';var schema=require(_0x3f89('0x0'));var _=require('lodash');var util=require(_0x3f89('0x1'));var seqqueue=require(_0x3f89('0x2'));var logger=require('../../../../config/logger')(_0x3f89('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x3f89('0x4'),'required':!![],'message':_0x3f89('0x5')},'timeout':{'type':_0x3f89('0x6'),'message':_0x3f89('0x7')}});function writeLog(_0x3c7da0,_0x38223b,_0x4198d6){return logger[_0x3f89('0x8')](util[_0x3f89('0x9')](_0x3f89('0xa'),_0x3c7da0,_0x38223b[_0x3f89('0xb')],_0x4198d6));}function handleFindAgent(_0x412433){return function(_0xdc1565){return _0xdc1565[_0x3f89('0xb')][_0x3f89('0xc')]()===_0x412433[_0x3f89('0xc')]();};}exports[_0x3f89('0xd')]=function(_0x39b54a,_0x2ecad9,_0x52d794,_0x1494af){return function(_0x4c653b){try{var _0x4efd4e={'name':_0x2ecad9[0x0],'timeout':_0x2ecad9[0x1]};var _0x456a2a=queue[_0x3f89('0x0')](_0x4efd4e,{'typecast':!![]});if(_0x456a2a[_0x3f89('0xe')]){logger[_0x3f89('0xf')](_0x3f89('0x10'),_0x39b54a,_['map'](_0x456a2a,_0x3f89('0x11'))[_0x3f89('0x12')](',\x20'));_0x4c653b['stop']();}else{var _0x351b81=_['find'](_0x52d794[_0x3f89('0x13')],handleFindAgent(_0x4efd4e[_0x3f89('0xb')]));if(_0x351b81){var _0x22ddba=(_0x4efd4e['timeout']||0xa)*0x3e8;var _0x2d42db,_0x596ba6;var _0x495b07=seqqueue[_0x3f89('0x14')](_0x22ddba);_0x495b07['id']=_0x39b54a;_0x495b07[_0x3f89('0x15')]=_0x22ddba;_0x495b07['channel']=_0x1494af['channel'];writeLog(_0x39b54a,_0x351b81,util[_0x3f89('0x9')]('START:%s',_0x22ddba));_0x52d794[_0x3f89('0x16')][_0x39b54a]['on'](_0x3f89('0x17'),function(){logger[_0x3f89('0x8')](_0x3f89('0x18'),_0x39b54a);clearTimeout(_0x596ba6);_0x596ba6=undefined;_0x495b07[_0x3f89('0x19')]();if(_0x52d794[_0x3f89('0x16')][_0x39b54a]){delete _0x52d794['rules'][_0x39b54a];}_0x4c653b[_0x3f89('0x1a')]();});_0x52d794[_0x3f89('0x16')][_0x39b54a]['on']('complete',function(){if(_0x52d794[_0x3f89('0x16')][_0x39b54a]){delete _0x52d794[_0x3f89('0x16')][_0x39b54a];}});_0x596ba6=setTimeout(function(){logger['info'](_0x3f89('0x1b'),_0x39b54a);clearTimeout(_0x596ba6);_0x495b07[_0x3f89('0x19')]();_0x4c653b[_0x3f89('0x1c')]();},_0x22ddba);strategy['agent'](_0x495b07,_0x351b81,_0x52d794,_0x1494af);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x39b54a,_0x4efd4e[_0x3f89('0xb')]);_0x4c653b['stop']();}}}catch(_0x248932){console['log'](_0x248932);logger[_0x3f89('0xf')](_0x3f89('0x1d'),_0x39b54a,_0x248932[_0x3f89('0x1e')]);_0x4c653b[_0x3f89('0x1a')]();}};};
\ No newline at end of file
index b89c311..f08cd21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4978=['finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerResponse','Message','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','body','catch','error','stringify'];(function(_0x3a8ce2,_0x552ad5){var _0x2e5a45=function(_0x5de5ed){while(--_0x5de5ed){_0x3a8ce2['push'](_0x3a8ce2['shift']());}};_0x2e5a45(++_0x552ad5);}(_0x4978,0xa4));var _0x8497=function(_0x397f34,_0x3ac328){_0x397f34=_0x397f34-0x0;var _0x272cda=_0x4978[_0x397f34];return _0x272cda;};'use strict';var _=require(_0x8497('0x0'));var moment=require(_0x8497('0x1'));var AWS=require(_0x8497('0x2'));var utils=require(_0x8497('0x3'));var logger=require(_0x8497('0x4'))(_0x8497('0x5'));var rpc={'chatMessage':require(_0x8497('0x6')),'openchannelMessage':require(_0x8497('0x7')),'mailMessage':require(_0x8497('0x8')),'smsMessage':require(_0x8497('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x8497('0xa'))};exports[_0x8497('0xb')]=function(_0x233f4a,_0x25fb7f){return function(_0x54ebe2){try{if(!_[_0x8497('0xc')](this[_0x8497('0xd')][_0x8497('0xe')])){logger[_0x8497('0xf')](_0x8497('0x10'),_0x233f4a,_0x8497('0x11'));return _0x54ebe2[_0x8497('0x12')]();}var _0x53cc94={'ContactId':this[_0x8497('0x13')]['id'],'sentAt':moment()[_0x8497('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x8497('0x15')};if(this[_0x8497('0x16')]===_0x8497('0x17')||this[_0x8497('0x16')]===_0x8497('0x18')){_0x53cc94[_0x8497('0x19')]=this[_0x8497('0xd')]['phone'];}var _0x28772c=this[_0x8497('0x16')];if(_0x28772c===_0x8497('0x1a')){_0x53cc94['ChatWebsiteId']=this[_0x8497('0x1b')]['id'];}else{_0x53cc94[_[_0x8497('0x1c')](_0x28772c)+_0x8497('0x1d')]=this[_0x8497('0x1b')]['id'];}_0x53cc94[_[_0x8497('0x1c')](_0x28772c)+_0x8497('0x1e')]=this[_0x8497('0xd')]['id'];if(this[_0x8497('0xd')][_0x8497('0x1f')]){var _0x3aca83=_0x25fb7f[0x4];if(!_['isEmpty'](_0x3aca83)){_0x53cc94['body']=utils['getMustacheRender'](_0x3aca83,this);return rpc[_0x28772c+'Message']['create'](_0x53cc94)['then'](function(_0x1d750c){logger['info'](_0x8497('0x10'),_0x233f4a,_0x53cc94[_0x8497('0x20')]);})[_0x8497('0x21')](function(_0xc5dfe){logger[_0x8497('0x22')](_0x8497('0x10'),_0x233f4a,JSON[_0x8497('0x23')](_0xc5dfe));})[_0x8497('0x24')](function(){logger[_0x8497('0xf')](_0x8497('0x25'),_0x233f4a);_0x54ebe2[_0x8497('0x26')]();});}else{logger[_0x8497('0xf')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x233f4a);_0x54ebe2[_0x8497('0x26')]();}}else{var _0x3dd5a1=this;var _0x319686=new AWS[(_0x8497('0x27'))]({'accessKeyId':_0x25fb7f[0x0],'secretAccessKey':_0x25fb7f[0x1],'region':_0x25fb7f[0x2]});var _0x2b8e0d={'botAlias':_0x8497('0x28'),'botName':_0x25fb7f[0x3],'inputText':this[_0x8497('0x29')][_0x8497('0x20')],'userId':this[_0x8497('0x16')]+':'+this[_0x8497('0xd')]['id'][_0x8497('0x2a')]()};_0x319686[_0x8497('0x2b')](_0x2b8e0d,function(_0x3df9cf,_0x1d57f3){if(_0x3df9cf){logger[_0x8497('0x22')](_0x8497('0x10'),_0x233f4a,_0x3df9cf[_0x8497('0x29')]);_0x54ebe2['next']();}else if(_0x1d57f3&&_0x1d57f3[_0x8497('0x29')]){_0x3dd5a1[_0x8497('0x20')]['amazonlex']=_0x1d57f3;_0x53cc94[_0x8497('0x20')]=_0x1d57f3[_0x8497('0x29')];_0x53cc94['providerName']=_0x8497('0x2c');_0x53cc94[_0x8497('0x2d')]=JSON[_0x8497('0x23')](_0x1d57f3);return rpc[_0x28772c+_0x8497('0x2e')]['create'](_0x53cc94)[_0x8497('0x2f')](function(_0x1c8759){logger[_0x8497('0xf')]('[%s][AMAZONLEX]\x20%s',_0x233f4a,_0x53cc94[_0x8497('0x20')]);if(_0x1d57f3[_0x8497('0x30')]==_0x8497('0x31')){_0x54ebe2['next']();}else{_0x54ebe2['stop']();}})['catch'](function(_0x70306f){logger[_0x8497('0x22')](_0x8497('0x10'),_0x233f4a,JSON[_0x8497('0x23')](_0x70306f));_0x54ebe2[_0x8497('0x12')]();});}else{_0x54ebe2[_0x8497('0x12')]();}});}}catch(_0x53e45b){logger[_0x8497('0x22')](_0x8497('0x10'),_0x233f4a,JSON[_0x8497('0x23')](_0x53e45b));_0x54ebe2[_0x8497('0x26')]();}};};
\ No newline at end of file
+var _0xd385=['AccountId','InteractionId','interaction','created','isEmpty','body','getMustacheRender','create','then','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','message','toString','postText','amazonlex','providerName','dialogState','Failed','catch','error','moment','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','account','upperFirst'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xd385,0xd0));var _0x5d38=function(_0x153230,_0x1ae7df){_0x153230=_0x153230-0x0;var _0x574ccc=_0xd385[_0x153230];return _0x574ccc;};'use strict';var _=require('lodash');var moment=require(_0x5d38('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x5d38('0x1'));var rpc={'chatMessage':require(_0x5d38('0x2')),'openchannelMessage':require(_0x5d38('0x3')),'mailMessage':require(_0x5d38('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x5d38('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x5d38('0x6')]=function(_0x418c52,_0x5dfe47){return function(_0x502b51){try{if(!_[_0x5d38('0x7')](this['interaction'][_0x5d38('0x8')])){logger[_0x5d38('0x9')](_0x5d38('0xa'),_0x418c52,_0x5d38('0xb'));return _0x502b51[_0x5d38('0xc')]();}var _0x5d6be2={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5d38('0xd')](_0x5d38('0xe')),'direction':_0x5d38('0xf')};if(this[_0x5d38('0x10')]==='sms'||this[_0x5d38('0x10')]===_0x5d38('0x11')){_0x5d6be2[_0x5d38('0x12')]=this['interaction']['phone'];}var _0x187831=this[_0x5d38('0x10')];if(_0x187831==='chat'){_0x5d6be2[_0x5d38('0x13')]=this[_0x5d38('0x14')]['id'];}else{_0x5d6be2[_[_0x5d38('0x15')](_0x187831)+_0x5d38('0x16')]=this['account']['id'];}_0x5d6be2[_[_0x5d38('0x15')](_0x187831)+_0x5d38('0x17')]=this[_0x5d38('0x18')]['id'];if(this[_0x5d38('0x18')][_0x5d38('0x19')]){var _0x2a105f=_0x5dfe47[0x4];if(!_[_0x5d38('0x1a')](_0x2a105f)){_0x5d6be2[_0x5d38('0x1b')]=utils[_0x5d38('0x1c')](_0x2a105f,this);return rpc[_0x187831+'Message'][_0x5d38('0x1d')](_0x5d6be2)[_0x5d38('0x1e')](function(_0x4ee022){logger[_0x5d38('0x9')](_0x5d38('0xa'),_0x418c52,_0x5d6be2['body']);})['catch'](function(_0x94ea15){logger['error'](_0x5d38('0xa'),_0x418c52,JSON[_0x5d38('0x1f')](_0x94ea15));})[_0x5d38('0x20')](function(){logger['info'](_0x5d38('0x21'),_0x418c52);_0x502b51[_0x5d38('0x22')]();});}else{logger[_0x5d38('0x9')](_0x5d38('0x23'),_0x418c52);_0x502b51[_0x5d38('0x22')]();}}else{var _0x509196=this;var _0x29657c=new AWS['LexRuntime']({'accessKeyId':_0x5dfe47[0x0],'secretAccessKey':_0x5dfe47[0x1],'region':_0x5dfe47[0x2]});var _0x20c62d={'botAlias':_0x5d38('0x24'),'botName':_0x5dfe47[0x3],'inputText':this[_0x5d38('0x25')][_0x5d38('0x1b')],'userId':this[_0x5d38('0x10')]+':'+this[_0x5d38('0x18')]['id'][_0x5d38('0x26')]()};_0x29657c[_0x5d38('0x27')](_0x20c62d,function(_0x4a3ac9,_0x228205){if(_0x4a3ac9){logger['error']('[%s][AMAZONLEX]\x20%s',_0x418c52,_0x4a3ac9['message']);_0x502b51[_0x5d38('0xc')]();}else if(_0x228205&&_0x228205[_0x5d38('0x25')]){_0x509196[_0x5d38('0x1b')][_0x5d38('0x28')]=_0x228205;_0x5d6be2[_0x5d38('0x1b')]=_0x228205['message'];_0x5d6be2[_0x5d38('0x29')]='amazonlex';_0x5d6be2['providerResponse']=JSON[_0x5d38('0x1f')](_0x228205);return rpc[_0x187831+'Message'][_0x5d38('0x1d')](_0x5d6be2)['then'](function(_0x575160){logger[_0x5d38('0x9')](_0x5d38('0xa'),_0x418c52,_0x5d6be2['body']);if(_0x228205[_0x5d38('0x2a')]==_0x5d38('0x2b')){_0x502b51[_0x5d38('0xc')]();}else{_0x502b51[_0x5d38('0x22')]();}})[_0x5d38('0x2c')](function(_0x1e5689){logger[_0x5d38('0x2d')](_0x5d38('0xa'),_0x418c52,JSON['stringify'](_0x1e5689));_0x502b51[_0x5d38('0xc')]();});}else{_0x502b51[_0x5d38('0xc')]();}});}}catch(_0x13990c){logger[_0x5d38('0x2d')](_0x5d38('0xa'),_0x418c52,JSON[_0x5d38('0x1f')](_0x13990c));_0x502b51['stop']();}};};
\ No newline at end of file
index 22f2827..3f52b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x877a=['chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','finally','resolve','autoreplyExecuted','Interaction','update','then','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','channel','mail','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20'];(function(_0x2c6b86,_0x18f5b7){var _0x348b59=function(_0x4bcc90){while(--_0x4bcc90){_0x2c6b86['push'](_0x2c6b86['shift']());}};_0x348b59(++_0x18f5b7);}(_0x877a,0x66));var _0xa877=function(_0x16521f,_0x520899){_0x16521f=_0x16521f-0x0;var _0x4eb765=_0x877a[_0x16521f];return _0x4eb765;};'use strict';var _=require(_0xa877('0x0'));var moment=require(_0xa877('0x1'));var utils=require(_0xa877('0x2'));var logger=require(_0xa877('0x3'))('routing');var rpc={'chatMessage':require(_0xa877('0x4')),'openchannelMessage':require(_0xa877('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xa877('0x6')),'faxMessage':require(_0xa877('0x7')),'whatsappMessage':require(_0xa877('0x8')),'chatInteraction':require(_0xa877('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xa877('0xa')),'smsInteraction':require(_0xa877('0xb')),'faxInteraction':require(_0xa877('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0xa877('0xd')]=function(_0xa41fbe,_0x3a7248,_0x44638b,_0x472ff4){return function(_0x376597){try{var _0x293547=this[_0xa877('0xe')];if(_0x293547===_0xa877('0xf')&&_0x472ff4['body']['isAutoreply']){logger['info'](_0xa877('0x10'),_0xa41fbe,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x376597[_0xa877('0x11')]();}if(_0x3a7248[0x0]==='1'&&(_[_0xa877('0x12')](this[_0xa877('0x13')][_0xa877('0x14')])||!this[_0xa877('0x13')][_0xa877('0x14')])){logger[_0xa877('0x15')]('[%s][AUTOREPLY]\x20%s',_0xa41fbe,_0xa877('0x16'));return _0x376597[_0xa877('0x11')]();}if(_0x3a7248[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0xa877('0x15')](_0xa877('0x17'),_0xa41fbe,_0xa877('0x18'));return _0x376597[_0xa877('0x11')]();}var _0x1930f3={'ContactId':this[_0xa877('0x19')]['id'],'sentAt':moment()[_0xa877('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa877('0x1b')};if(this['channel']===_0xa877('0xf')){_0x1930f3[_0xa877('0x1c')]=utils[_0xa877('0x1d')](_0x3a7248[0x2],this);}else{_0x1930f3[_0xa877('0x1c')]=utils[_0xa877('0x1d')](_0x3a7248[0x1],this);}if(this[_0xa877('0x1e')]){_0x1930f3['to']=this[_0xa877('0x1e')][_0xa877('0x1f')]||'';if(this[_0xa877('0xe')]===_0xa877('0xf')&&_0x3a7248[0x1]==='1'){_0x1930f3['cc']=this[_0xa877('0x1e')]['cc']||'';}_0x1930f3[_0xa877('0x1f')]=this[_0xa877('0x1e')]['to']||'';_0x1930f3[_0xa877('0x20')]=this['message'][_0xa877('0x20')]||'';_0x1930f3[_0xa877('0x21')]=!![];if(this[_0xa877('0x1e')][_0xa877('0x22')]){_0x1930f3[_0xa877('0x22')]='';_0x1930f3[_0xa877('0x22')]+=_[_0xa877('0x23')](this[_0xa877('0x1e')]['subject'],_0xa877('0x24'))?'':_0xa877('0x25');_0x1930f3[_0xa877('0x22')]+=this[_0xa877('0x1e')][_0xa877('0x22')];}}if(this[_0xa877('0xe')]===_0xa877('0x26')){_0x1930f3[_0xa877('0x27')]=this['account']['id'];}else{_0x1930f3[_[_0xa877('0x28')](this[_0xa877('0xe')])+_0xa877('0x29')]=this[_0xa877('0x2a')]['id'];}_0x1930f3[_[_0xa877('0x28')](this['channel'])+_0xa877('0x2b')]=this[_0xa877('0x13')]['id'];var _0x3489d8=this[_0xa877('0x13')];if(rpc[this[_0xa877('0xe')]+_0xa877('0x2c')]){if(this[_0xa877('0xe')]===_0xa877('0xf')){_0x1930f3[_0xa877('0x2d')]=this[_0xa877('0x1e')][_0xa877('0x2e')];_0x1930f3['html']=_0xa877('0x2f')+_[_0xa877('0x30')](_0x1930f3[_0xa877('0x1c')],_0xa877('0x31'),'<div')+_0xa877('0x32');_0x1930f3[_0xa877('0x33')]={'Auto-Submitted':_0xa877('0x34'),'X-Auto-Response-Suppress':_0xa877('0x35'),'Precedence':_0xa877('0x36')};return mailRpc[_0xa877('0x37')](this[_0xa877('0x2a')][_0xa877('0x38')],_0x1930f3)['then'](function(_0x3e1981){logger[_0xa877('0x15')](_0xa877('0x39'),_0xa41fbe);_0x1930f3[_0xa877('0x2e')]=_0x3e1981[_0xa877('0x1e')][_0xa877('0x2e')];return rpc[_0x293547+'Message'][_0xa877('0x3a')](_0x1930f3);})['then'](function(_0x591519){logger[_0xa877('0x15')](_0xa877('0x10'),_0xa41fbe,JSON[_0xa877('0x3b')](_0x591519));})[_0xa877('0x3c')](function(_0x3201cc){logger[_0xa877('0x3d')]('[RPC][%s][AUTOREPLY]\x20%s',_0xa41fbe,JSON[_0xa877('0x3b')](_0x3201cc));})[_0xa877('0x3e')](function(){Promise[_0xa877('0x3f')]()['then'](function(){if(_0x3a7248[0x0]!=='2'||_0x3489d8[_0xa877('0x40')])return;return rpc[_0x293547+_0xa877('0x41')][_0xa877('0x42')](_0x3489d8['id'],{'autoreplyExecuted':!![]})['then'](function(_0x21e3b1){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xa41fbe,JSON[_0xa877('0x3b')](_0x21e3b1));})[_0xa877('0x3c')](function(_0x1a243f){logger[_0xa877('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xa41fbe,JSON[_0xa877('0x3b')](_0x1a243f));});})['then'](function(){_0x376597[_0xa877('0x11')]();});});}else{return rpc[this[_0xa877('0xe')]+_0xa877('0x2c')][_0xa877('0x3a')](_0x1930f3)['then'](function(){logger[_0xa877('0x15')](_0xa877('0x10'),_0xa41fbe,_0x1930f3[_0xa877('0x1c')]);})['catch'](function(_0xf57958){logger['error'](_0xa877('0x10'),_0xa41fbe,JSON['stringify'](_0xf57958));})[_0xa877('0x3e')](function(){Promise[_0xa877('0x3f')]()[_0xa877('0x43')](function(){if(_0x3a7248[0x0]!=='2'||_0x3489d8[_0xa877('0x40')])return;return rpc[_0x293547+_0xa877('0x41')][_0xa877('0x42')](_0x3489d8['id'],{'autoreplyExecuted':!![]})[_0xa877('0x43')](function(_0x580e1b){logger[_0xa877('0x15')](_0xa877('0x17'),_0xa41fbe,JSON['stringify'](_0x580e1b));})[_0xa877('0x3c')](function(_0x42531b){logger[_0xa877('0x3d')](_0xa877('0x44'),_0xa41fbe,JSON[_0xa877('0x3b')](_0x42531b));});})[_0xa877('0x43')](function(){_0x376597['next']();});});}}}catch(_0x512550){logger[_0xa877('0x3d')](_0xa877('0x10'),_0xa41fbe,JSON['stringify'](_0x512550));_0x376597[_0xa877('0x45')]();}};};
\ No newline at end of file
+var _0xbf83=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','mail','getMustacheRender','message','from','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','update','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x462c65,_0x3fabb0){var _0x42f5b7=function(_0x2c3480){while(--_0x2c3480){_0x462c65['push'](_0x462c65['shift']());}};_0x42f5b7(++_0x3fabb0);}(_0xbf83,0x1dc));var _0x3bf8=function(_0x3f7d92,_0x2ea184){_0x3f7d92=_0x3f7d92-0x0;var _0xb33df2=_0xbf83[_0x3f7d92];return _0xb33df2;};'use strict';var _=require(_0x3bf8('0x0'));var moment=require(_0x3bf8('0x1'));var utils=require('./utils');var logger=require(_0x3bf8('0x2'))(_0x3bf8('0x3'));var rpc={'chatMessage':require(_0x3bf8('0x4')),'openchannelMessage':require(_0x3bf8('0x5')),'mailMessage':require(_0x3bf8('0x6')),'smsMessage':require(_0x3bf8('0x7')),'faxMessage':require(_0x3bf8('0x8')),'whatsappMessage':require(_0x3bf8('0x9')),'chatInteraction':require(_0x3bf8('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x3bf8('0xb')),'smsInteraction':require(_0x3bf8('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x3bf8('0xd'))};var mailRpc=require(_0x3bf8('0xe'));exports['consequence']=function(_0x1bcb61,_0x287756,_0x6086d0,_0x29de9c){return function(_0x532fcf){try{var _0x5e894d=this[_0x3bf8('0xf')];if(_0x5e894d==='mail'&&_0x29de9c[_0x3bf8('0x10')][_0x3bf8('0x11')]){logger['info'](_0x3bf8('0x12'),_0x1bcb61,_0x3bf8('0x13'));return _0x532fcf[_0x3bf8('0x14')]();}if(_0x287756[0x0]==='1'&&(_[_0x3bf8('0x15')](this['interaction']['created'])||!this[_0x3bf8('0x16')][_0x3bf8('0x17')])){logger[_0x3bf8('0x18')](_0x3bf8('0x12'),_0x1bcb61,_0x3bf8('0x19'));return _0x532fcf[_0x3bf8('0x14')]();}if(_0x287756[0x0]==='2'&&this[_0x3bf8('0x16')][_0x3bf8('0x1a')]){logger[_0x3bf8('0x18')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1bcb61,_0x3bf8('0x1b'));return _0x532fcf[_0x3bf8('0x14')]();}var _0x21141c={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3bf8('0x1c')](_0x3bf8('0x1d')),'direction':'out'};if(this['channel']===_0x3bf8('0x1e')){_0x21141c['body']=utils['getMustacheRender'](_0x287756[0x2],this);}else{_0x21141c['body']=utils[_0x3bf8('0x1f')](_0x287756[0x1],this);}if(this[_0x3bf8('0x20')]){_0x21141c['to']=this['message'][_0x3bf8('0x21')]||'';if(this[_0x3bf8('0xf')]===_0x3bf8('0x1e')&&_0x287756[0x1]==='1'){_0x21141c['cc']=this['message']['cc']||'';}_0x21141c[_0x3bf8('0x21')]=this[_0x3bf8('0x20')]['to']||'';_0x21141c['phone']=this[_0x3bf8('0x20')]['phone']||'';_0x21141c[_0x3bf8('0x22')]=!![];if(this[_0x3bf8('0x20')][_0x3bf8('0x23')]){_0x21141c[_0x3bf8('0x23')]='';_0x21141c[_0x3bf8('0x23')]+=_[_0x3bf8('0x24')](this[_0x3bf8('0x20')][_0x3bf8('0x23')],_0x3bf8('0x25'))?'':_0x3bf8('0x26');_0x21141c[_0x3bf8('0x23')]+=this[_0x3bf8('0x20')][_0x3bf8('0x23')];}}if(this[_0x3bf8('0xf')]===_0x3bf8('0x27')){_0x21141c[_0x3bf8('0x28')]=this[_0x3bf8('0x29')]['id'];}else{_0x21141c[_[_0x3bf8('0x2a')](this[_0x3bf8('0xf')])+'AccountId']=this['account']['id'];}_0x21141c[_[_0x3bf8('0x2a')](this['channel'])+_0x3bf8('0x2b')]=this['interaction']['id'];var _0xa6ff1f=this[_0x3bf8('0x16')];if(rpc[this[_0x3bf8('0xf')]+_0x3bf8('0x2c')]){if(this[_0x3bf8('0xf')]==='mail'){_0x21141c[_0x3bf8('0x2d')]=this[_0x3bf8('0x20')][_0x3bf8('0x2e')];_0x21141c[_0x3bf8('0x2f')]=_0x3bf8('0x30')+_[_0x3bf8('0x31')](_0x21141c[_0x3bf8('0x10')],_0x3bf8('0x32'),_0x3bf8('0x33'))+'</div>';_0x21141c['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x3bf8('0x34'),'Precedence':_0x3bf8('0x35')};return mailRpc[_0x3bf8('0x36')](this[_0x3bf8('0x29')]['smtpOptions'],_0x21141c)[_0x3bf8('0x37')](function(_0x33f4b6){logger[_0x3bf8('0x18')](_0x3bf8('0x38'),_0x1bcb61);_0x21141c[_0x3bf8('0x2e')]=_0x33f4b6[_0x3bf8('0x20')][_0x3bf8('0x2e')];return rpc[_0x5e894d+_0x3bf8('0x2c')][_0x3bf8('0x39')](_0x21141c);})[_0x3bf8('0x37')](function(_0x2835bc){logger['info'](_0x3bf8('0x12'),_0x1bcb61,JSON['stringify'](_0x2835bc));})[_0x3bf8('0x3a')](function(_0x58906d){logger[_0x3bf8('0x3b')](_0x3bf8('0x3c'),_0x1bcb61,JSON[_0x3bf8('0x3d')](_0x58906d));})[_0x3bf8('0x3e')](function(){Promise['resolve']()['then'](function(){if(_0x287756[0x0]!=='2'||_0xa6ff1f[_0x3bf8('0x1a')])return;return rpc[_0x5e894d+_0x3bf8('0x3f')]['update'](_0xa6ff1f['id'],{'autoreplyExecuted':!![]})[_0x3bf8('0x37')](function(_0x2b572e){logger[_0x3bf8('0x18')](_0x3bf8('0x40'),_0x1bcb61,JSON[_0x3bf8('0x3d')](_0x2b572e));})['catch'](function(_0x3fe6f6){logger['error'](_0x3bf8('0x41'),_0x1bcb61,JSON[_0x3bf8('0x3d')](_0x3fe6f6));});})[_0x3bf8('0x37')](function(){_0x532fcf['next']();});});}else{return rpc[this['channel']+'Message'][_0x3bf8('0x39')](_0x21141c)[_0x3bf8('0x37')](function(){logger[_0x3bf8('0x18')](_0x3bf8('0x12'),_0x1bcb61,_0x21141c[_0x3bf8('0x10')]);})['catch'](function(_0x2911ab){logger[_0x3bf8('0x3b')](_0x3bf8('0x12'),_0x1bcb61,JSON[_0x3bf8('0x3d')](_0x2911ab));})[_0x3bf8('0x3e')](function(){Promise[_0x3bf8('0x42')]()[_0x3bf8('0x37')](function(){if(_0x287756[0x0]!=='2'||_0xa6ff1f['autoreplyExecuted'])return;return rpc[_0x5e894d+_0x3bf8('0x3f')][_0x3bf8('0x43')](_0xa6ff1f['id'],{'autoreplyExecuted':!![]})['then'](function(_0x34bc51){logger[_0x3bf8('0x18')](_0x3bf8('0x40'),_0x1bcb61,JSON[_0x3bf8('0x3d')](_0x34bc51));})[_0x3bf8('0x3a')](function(_0x28de75){logger[_0x3bf8('0x3b')](_0x3bf8('0x41'),_0x1bcb61,JSON[_0x3bf8('0x3d')](_0x28de75));});})[_0x3bf8('0x37')](function(){_0x532fcf[_0x3bf8('0x14')]();});});}}}catch(_0x4f69a9){logger[_0x3bf8('0x3b')]('[%s][AUTOREPLY]\x20%s',_0x1bcb61,JSON[_0x3bf8('0x3d')](_0x4f69a9));_0x532fcf[_0x3bf8('0x44')]();}};};
\ No newline at end of file
index 824529e..2123737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98fc=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','[%s][CLOSE]\x20%s','stringify','finally','error','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x98fc,0x79));var _0xc98f=function(_0xbd1f60,_0x470e77){_0xbd1f60=_0xbd1f60-0x0;var _0x25802f=_0x98fc[_0xbd1f60];return _0x25802f;};'use strict';var moment=require(_0xc98f('0x0'));var logger=require('../../../../config/logger')(_0xc98f('0x1'));var rpc={'chatInteraction':require(_0xc98f('0x2')),'openchannelInteraction':require(_0xc98f('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xc98f('0x4')),'faxInteraction':require(_0xc98f('0x5')),'whatsappInteraction':require(_0xc98f('0x6'))};exports['consequence']=function(_0x2e9763,_0x4e6ebf,_0x18bcd3,_0x5c3801){return function(_0x527457){try{logger[_0xc98f('0x7')](_0xc98f('0x8'),_0x2e9763,_0x4e6ebf[0x0]);var _0x10d0d7={'closed':0x1,'closedAt':moment()[_0xc98f('0x9')](_0xc98f('0xa')),'closeReason':_0xc98f('0xb'),'disposition':_0x4e6ebf[0x0]};if(rpc[_0x5c3801[_0xc98f('0xc')]+_0xc98f('0xd')]){rpc[_0x5c3801[_0xc98f('0xc')]+'Interaction']['update'](_0x5c3801[_0xc98f('0xe')]['id'],_0x10d0d7)['then'](function(_0x5f6d9d){logger[_0xc98f('0x7')](_0xc98f('0xf'),_0x2e9763,_0x5c3801[_0xc98f('0xe')]['id']);})['catch'](function(_0x3d07da){logger['error'](_0xc98f('0x10'),_0x2e9763,JSON[_0xc98f('0x11')](_0x3d07da));})[_0xc98f('0x12')](function(){_0x527457['stop']();});}}catch(_0x430bc1){logger[_0xc98f('0x13')](_0xc98f('0x10'),_0x2e9763,JSON[_0xc98f('0x11')](_0x430bc1));_0x527457[_0xc98f('0x14')]();}};};
\ No newline at end of file
+var _0x648c=['channel','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','error','moment','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction'];(function(_0xb275fa,_0x389d3b){var _0x1e4679=function(_0x56db26){while(--_0x56db26){_0xb275fa['push'](_0xb275fa['shift']());}};_0x1e4679(++_0x389d3b);}(_0x648c,0x15a));var _0xc648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x648c[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xc648('0x0'));var logger=require('../../../../config/logger')(_0xc648('0x1'));var rpc={'chatInteraction':require(_0xc648('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xc648('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xc648('0x4')),'whatsappInteraction':require(_0xc648('0x5'))};exports['consequence']=function(_0x1ca7f3,_0x3bf1c8,_0x2824da,_0xd9ce6a){return function(_0x937414){try{logger['info'](_0xc648('0x6'),_0x1ca7f3,_0x3bf1c8[0x0]);var _0x45ba33={'closed':0x1,'closedAt':moment()[_0xc648('0x7')](_0xc648('0x8')),'closeReason':_0xc648('0x9'),'disposition':_0x3bf1c8[0x0]};if(rpc[_0xd9ce6a['channel']+_0xc648('0xa')]){rpc[_0xd9ce6a[_0xc648('0xb')]+_0xc648('0xa')][_0xc648('0xc')](_0xd9ce6a[_0xc648('0xd')]['id'],_0x45ba33)[_0xc648('0xe')](function(_0x5a96de){logger[_0xc648('0xf')](_0xc648('0x10'),_0x1ca7f3,_0xd9ce6a[_0xc648('0xd')]['id']);})[_0xc648('0x11')](function(_0x3ca306){logger['error'](_0xc648('0x12'),_0x1ca7f3,JSON[_0xc648('0x13')](_0x3ca306));})['finally'](function(){_0x937414['stop']();});}}catch(_0x57a7b6){logger[_0xc648('0x14')]('[%s][CLOSE]\x20%s',_0x1ca7f3,JSON[_0xc648('0x13')](_0x57a7b6));_0x937414['stop']();}};};
\ No newline at end of file
index 5f498c2..30c8623 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e0c=['next','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','stop','textRequest','message','dialogflow','providerName','providerResponse','endConversation'];(function(_0x1991c6,_0x42b6c0){var _0x171ca0=function(_0x4a22dc){while(--_0x4a22dc){_0x1991c6['push'](_0x1991c6['shift']());}};_0x171ca0(++_0x42b6c0);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x1e9738,_0x249de6){_0x1e9738=_0x1e9738-0x0;var _0x4e967a=_0x5e0c[_0x1e9738];return _0x4e967a;};'use strict';var _=require('lodash');var moment=require(_0xc5e0('0x0'));var apiai=require(_0xc5e0('0x1'));var md5=require(_0xc5e0('0x2'));var utils=require(_0xc5e0('0x3'));var logger=require(_0xc5e0('0x4'))(_0xc5e0('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc5e0('0x6')),'mailMessage':require(_0xc5e0('0x7')),'smsMessage':require(_0xc5e0('0x8')),'faxMessage':require(_0xc5e0('0x9')),'whatsappMessage':require(_0xc5e0('0xa'))};exports['consequence']=function(_0x4b46de,_0x12b5cb){return function(_0x59063b){try{if(!_[_0xc5e0('0xb')](this[_0xc5e0('0xc')][_0xc5e0('0xd')])){logger[_0xc5e0('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x4b46de,_0xc5e0('0xf'));return _0x59063b['next']();}var _0x37627e={'ContactId':this[_0xc5e0('0x10')]['id'],'sentAt':moment()[_0xc5e0('0x11')](_0xc5e0('0x12')),'direction':_0xc5e0('0x13')};if(this[_0xc5e0('0x14')]==='sms'||this[_0xc5e0('0x14')]===_0xc5e0('0x15')){_0x37627e[_0xc5e0('0x16')]=this[_0xc5e0('0xc')][_0xc5e0('0x16')];}var _0x5074a1=this[_0xc5e0('0x14')];if(_0x5074a1===_0xc5e0('0x17')){_0x37627e['ChatWebsiteId']=this['account']['id'];}else{_0x37627e[_[_0xc5e0('0x18')](_0x5074a1)+'AccountId']=this['account']['id'];}_0x37627e[_[_0xc5e0('0x18')](_0x5074a1)+_0xc5e0('0x19')]=this[_0xc5e0('0xc')]['id'];if(this[_0xc5e0('0xc')][_0xc5e0('0x1a')]){var _0x247138=_0x12b5cb[0x2];if(!_[_0xc5e0('0x1b')](_0x247138)){_0x37627e[_0xc5e0('0x1c')]=utils[_0xc5e0('0x1d')](_0x247138,this);return rpc[_0x5074a1+_0xc5e0('0x1e')][_0xc5e0('0x1f')](_0x37627e)[_0xc5e0('0x20')](function(_0x7cdb63){logger[_0xc5e0('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x4b46de,_0x37627e['body']);})[_0xc5e0('0x21')](function(_0x181d82){logger[_0xc5e0('0x22')](_0xc5e0('0x23'),_0x4b46de,JSON[_0xc5e0('0x24')](_0x181d82));})[_0xc5e0('0x25')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4b46de);_0x59063b['stop']();});}else{logger[_0xc5e0('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4b46de);_0x59063b[_0xc5e0('0x26')]();}}else{var _0x452d39=this;var _0x3b938e=apiai(_0x12b5cb[0x0],{'language':_0x12b5cb[0x1]||'en'});return _0x3b938e[_0xc5e0('0x27')](this[_0xc5e0('0x28')][_0xc5e0('0x1c')],{'sessionId':md5(this[_0xc5e0('0xc')]['id'])})['then'](function(_0x10039c){_0x452d39['body'][_0xc5e0('0x29')]=_0x10039c;_0x37627e[_0xc5e0('0x1c')]=_0x10039c['result']['fulfillment']['speech'];_0x37627e[_0xc5e0('0x2a')]='dialogflow';_0x37627e[_0xc5e0('0x2b')]=JSON[_0xc5e0('0x24')](_0x10039c);return rpc[_0x5074a1+'Message'][_0xc5e0('0x1f')](_0x37627e)[_0xc5e0('0x20')](function(_0x326479){logger[_0xc5e0('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x4b46de,_0x37627e['body']);if(_0x10039c['result']['metadata'][_0xc5e0('0x2c')]){_0x59063b['next']();}else{_0x59063b[_0xc5e0('0x26')]();}})[_0xc5e0('0x21')](function(_0x40ec9a){logger[_0xc5e0('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x4b46de,JSON[_0xc5e0('0x24')](_0x40ec9a));_0x59063b[_0xc5e0('0x2d')]();});})['catch'](function(_0x40b717){logger[_0xc5e0('0x22')](_0xc5e0('0x23'),_0x4b46de,_0x40b717[_0xc5e0('0x28')]);_0x59063b[_0xc5e0('0x2d')]();});}}catch(_0xec225c){logger[_0xc5e0('0x22')](_0xc5e0('0x23'),_0x4b46de,JSON[_0xc5e0('0x24')](_0xec225c));_0x59063b[_0xc5e0('0x26')]();}};};
\ No newline at end of file
+var _0xafca=['catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','create','metadata','endConversation','lodash','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','then'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xafca,0x1ef));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaafc('0x0'));var moment=require('moment');var apiai=require(_0xaafc('0x1'));var md5=require(_0xaafc('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xaafc('0x3'));var rpc={'chatMessage':require(_0xaafc('0x4')),'openchannelMessage':require(_0xaafc('0x5')),'mailMessage':require(_0xaafc('0x6')),'smsMessage':require(_0xaafc('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xaafc('0x8'))};exports[_0xaafc('0x9')]=function(_0x978cf0,_0x29d3ec){return function(_0x83ea82){try{if(!_[_0xaafc('0xa')](this[_0xaafc('0xb')][_0xaafc('0xc')])){logger[_0xaafc('0xd')](_0xaafc('0xe'),_0x978cf0,_0xaafc('0xf'));return _0x83ea82[_0xaafc('0x10')]();}var _0x492f3c={'ContactId':this['contact']['id'],'sentAt':moment()[_0xaafc('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xaafc('0x12')};if(this['channel']===_0xaafc('0x13')||this['channel']===_0xaafc('0x14')){_0x492f3c[_0xaafc('0x15')]=this[_0xaafc('0xb')][_0xaafc('0x15')];}var _0x31b893=this[_0xaafc('0x16')];if(_0x31b893===_0xaafc('0x17')){_0x492f3c[_0xaafc('0x18')]=this[_0xaafc('0x19')]['id'];}else{_0x492f3c[_[_0xaafc('0x1a')](_0x31b893)+_0xaafc('0x1b')]=this['account']['id'];}_0x492f3c[_[_0xaafc('0x1a')](_0x31b893)+_0xaafc('0x1c')]=this[_0xaafc('0xb')]['id'];if(this[_0xaafc('0xb')][_0xaafc('0x1d')]){var _0x1248ac=_0x29d3ec[0x2];if(!_[_0xaafc('0x1e')](_0x1248ac)){_0x492f3c[_0xaafc('0x1f')]=utils[_0xaafc('0x20')](_0x1248ac,this);return rpc[_0x31b893+_0xaafc('0x21')]['create'](_0x492f3c)[_0xaafc('0x22')](function(_0x504fa0){logger[_0xaafc('0xd')](_0xaafc('0xe'),_0x978cf0,_0x492f3c[_0xaafc('0x1f')]);})[_0xaafc('0x23')](function(_0x41033){logger[_0xaafc('0x24')](_0xaafc('0xe'),_0x978cf0,JSON[_0xaafc('0x25')](_0x41033));})[_0xaafc('0x26')](function(){logger['info'](_0xaafc('0x27'),_0x978cf0);_0x83ea82[_0xaafc('0x28')]();});}else{logger['info'](_0xaafc('0x29'),_0x978cf0);_0x83ea82[_0xaafc('0x28')]();}}else{var _0x7bc70a=this;var _0x521f26=apiai(_0x29d3ec[0x0],{'language':_0x29d3ec[0x1]||'en'});return _0x521f26[_0xaafc('0x2a')](this[_0xaafc('0x2b')][_0xaafc('0x1f')],{'sessionId':md5(this['interaction']['id'])})[_0xaafc('0x22')](function(_0xd3b1a2){_0x7bc70a['body'][_0xaafc('0x2c')]=_0xd3b1a2;_0x492f3c[_0xaafc('0x1f')]=_0xd3b1a2[_0xaafc('0x2d')][_0xaafc('0x2e')][_0xaafc('0x2f')];_0x492f3c[_0xaafc('0x30')]='dialogflow';_0x492f3c[_0xaafc('0x31')]=JSON[_0xaafc('0x25')](_0xd3b1a2);return rpc[_0x31b893+_0xaafc('0x21')][_0xaafc('0x32')](_0x492f3c)['then'](function(_0x43e3f1){logger[_0xaafc('0xd')](_0xaafc('0xe'),_0x978cf0,_0x492f3c[_0xaafc('0x1f')]);if(_0xd3b1a2[_0xaafc('0x2d')][_0xaafc('0x33')][_0xaafc('0x34')]){_0x83ea82[_0xaafc('0x10')]();}else{_0x83ea82[_0xaafc('0x28')]();}})[_0xaafc('0x23')](function(_0x731bb4){logger[_0xaafc('0x24')](_0xaafc('0xe'),_0x978cf0,JSON[_0xaafc('0x25')](_0x731bb4));_0x83ea82[_0xaafc('0x10')]();});})[_0xaafc('0x23')](function(_0x35a29f){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x978cf0,_0x35a29f['message']);_0x83ea82[_0xaafc('0x10')]();});}}catch(_0x3d4a5e){logger[_0xaafc('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x978cf0,JSON[_0xaafc('0x25')](_0x3d4a5e));_0x83ea82[_0xaafc('0x28')]();}};};
\ No newline at end of file
index 6bc8f10..c032dde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc07a=['upperFirst','InteractionId','created','isEmpty','getMustacheRender','create','then','catch','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','boolValue','intent','name','displayName','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','message','lodash','dialogflow','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','info','[%s][DIALOGFLOWV2]\x20%s','error','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','interaction','chat','account'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc07a,0x15c));var _0xac07=function(_0x2fb28c,_0x458fc5){_0x2fb28c=_0x2fb28c-0x0;var _0x22ee82=_0xc07a[_0x2fb28c];return _0x22ee82;};'use strict';var _=require(_0xac07('0x0'));var dialogflow=require(_0xac07('0x1'));var md5=require('md5');var moment=require('moment');var Promise=require(_0xac07('0x2'));var logger=require(_0xac07('0x3'))(_0xac07('0x4'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xac07('0x5')),'mailMessage':require(_0xac07('0x6')),'smsMessage':require(_0xac07('0x7')),'faxMessage':require(_0xac07('0x8')),'whatsappMessage':require(_0xac07('0x9'))};function createMessage(_0x11f938,_0x1bd379,_0x4f38c5,_0x8fcfd0){return new Promise(function(_0x3edbd1,_0x289090){var _0x7d016f=_['clone'](_0x4f38c5);_0x7d016f[_0xac07('0xa')]=_0x8fcfd0;return rpc[_0x1bd379+_0xac07('0xb')]['create'](_0x7d016f)['then'](function(){logger[_0xac07('0xc')](_0xac07('0xd'),_0x11f938,_0x7d016f[_0xac07('0xa')]);_0x3edbd1();})['catch'](function(_0x3e0c57){logger[_0xac07('0xe')](_0xac07('0xd'),_0x11f938,JSON['stringify'](_0x3e0c57));_0x289090(_0x3e0c57);});});}exports[_0xac07('0xf')]=function(_0x21cb43,_0x237ef1){return function(_0x5e67f5){try{if(!_[_0xac07('0x10')](this['interaction'][_0xac07('0x11')])){logger['info'](_0xac07('0xd'),_0x21cb43,_0xac07('0x12'));return _0x5e67f5[_0xac07('0x13')]();}var _0xe781ca={'ContactId':this[_0xac07('0x14')]['id'],'sentAt':moment()[_0xac07('0x15')](_0xac07('0x16')),'direction':_0xac07('0x17')};if(this['channel']===_0xac07('0x18')||this['channel']===_0xac07('0x19')){_0xe781ca[_0xac07('0x1a')]=this[_0xac07('0x1b')][_0xac07('0x1a')];}var _0x11c93f=this['channel'];if(_0x11c93f===_0xac07('0x1c')){_0xe781ca['ChatWebsiteId']=this[_0xac07('0x1d')]['id'];}else{_0xe781ca[_[_0xac07('0x1e')](_0x11c93f)+'AccountId']=this[_0xac07('0x1d')]['id'];}_0xe781ca[_[_0xac07('0x1e')](_0x11c93f)+_0xac07('0x1f')]=this[_0xac07('0x1b')]['id'];if(this[_0xac07('0x1b')][_0xac07('0x20')]){var _0x544a8b=_0x237ef1[0x4];if(!_[_0xac07('0x21')](_0x544a8b)){_0xe781ca[_0xac07('0xa')]=utils[_0xac07('0x22')](_0x544a8b,this);return rpc[_0x11c93f+'Message'][_0xac07('0x23')](_0xe781ca)[_0xac07('0x24')](function(_0x478153){logger[_0xac07('0xc')](_0xac07('0xd'),_0x21cb43,_0xe781ca[_0xac07('0xa')]);})[_0xac07('0x25')](function(_0x35b894){logger[_0xac07('0xe')](_0xac07('0xd'),_0x21cb43,JSON[_0xac07('0x26')](_0x35b894));})[_0xac07('0x27')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x21cb43);_0x5e67f5[_0xac07('0x28')]();});}else{logger[_0xac07('0xc')](_0xac07('0x29'),_0x21cb43);_0x5e67f5[_0xac07('0x28')]();}}else{var _0x3ca3ea=this;var _0x3a464b=_0x237ef1[0x2][_0xac07('0x2a')](/\\n/g,'\x0a');var _0x2e67f0={'credentials':{'private_key':_0x3a464b,'client_email':_0x237ef1[0x1]}};var _0x301657=new dialogflow[(_0xac07('0x2b'))](_0x2e67f0);var _0x26f52f=_0x301657['sessionPath'](_0x237ef1[0x0],md5(_0x3ca3ea[_0xac07('0x1b')]['id']));var _0x17833c={'session':_0x26f52f,'queryInput':{'text':{'text':_0x3ca3ea['message']['body'],'languageCode':_0x237ef1[0x3]||'en'}}};return _0x301657['detectIntent'](_0x17833c)['then'](function(_0x33df7f){if(_0x33df7f&&_0x33df7f['length']){_0x3ca3ea['body']['dialogflowV2']=_0x33df7f;var _0x5c17d9=_0x33df7f[0x0];var _0x45e640=_0x5c17d9[_0xac07('0x2c')][_0xac07('0x2d')]&&_0x5c17d9[_0xac07('0x2c')]['diagnosticInfo'][_0xac07('0x2e')]?_0x5c17d9[_0xac07('0x2c')][_0xac07('0x2d')][_0xac07('0x2e')][_0xac07('0x2f')]['boolValue']:![];_0x3ca3ea[_0xac07('0xa')][_0xac07('0x30')]=_0x5c17d9[_0xac07('0x2c')][_0xac07('0x31')];_0x3ca3ea[_0xac07('0xa')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x5c17d9[_0xac07('0x2c')]['allRequiredParamsPresent'];_0x3ca3ea[_0xac07('0xa')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x5c17d9[_0xac07('0x2c')][_0xac07('0x2d')]&&_0x5c17d9['queryResult'][_0xac07('0x2d')][_0xac07('0x2e')]?_0x5c17d9[_0xac07('0x2c')][_0xac07('0x2d')]['fields'][_0xac07('0x2f')][_0xac07('0x32')]:![];_0x3ca3ea[_0xac07('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x5c17d9[_0xac07('0x2c')][_0xac07('0x33')][_0xac07('0x34')];_0x3ca3ea[_0xac07('0xa')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x5c17d9['queryResult'][_0xac07('0x33')][_0xac07('0x35')];_0x3ca3ea['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x5c17d9['queryResult'][_0xac07('0x33')]['isFallback'];_0x3ca3ea[_0xac07('0xa')]['DIALOGFLOWV2_LANGUAGECODE']=_0x5c17d9[_0xac07('0x2c')]['languageCode'];_0x3ca3ea[_0xac07('0xa')][_0xac07('0x36')]=_0x5c17d9[_0xac07('0x2c')][_0xac07('0x37')];_0x3ca3ea[_0xac07('0xa')]['DIALOGFLOWV2_SCORE']=_0x5c17d9[_0xac07('0x2c')][_0xac07('0x38')];_0xe781ca[_0xac07('0x39')]='dialogflowV2';_0xe781ca[_0xac07('0x3a')]=JSON['stringify'](_0x33df7f);var _0x383804=[];for(var _0x58b913=0x0;_0x58b913<_0x33df7f['length'];_0x58b913++){var _0x390929=_0x33df7f[_0x58b913];if(_0x390929&&_0x390929[_0xac07('0x2c')]&&_0x390929['queryResult']['fulfillmentText']){_0x383804[_0xac07('0x3b')](createMessage(_0x21cb43,_0x11c93f,_0xe781ca,_0x390929[_0xac07('0x2c')][_0xac07('0x3c')]));}}return Promise[_0xac07('0x3d')](_0x383804)[_0xac07('0x24')](function(){if(_0x45e640){_0x5e67f5['next']();}else{_0x5e67f5['stop']();}})[_0xac07('0x25')](function(_0x2ba1fc){logger[_0xac07('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x21cb43,JSON[_0xac07('0x26')](_0x2ba1fc));_0x5e67f5[_0xac07('0x13')]();});}})['catch'](function(_0x2044b6){logger['error'](_0xac07('0xd'),_0x21cb43,_0x2044b6[_0xac07('0x3e')]);_0x5e67f5[_0xac07('0x13')]();});}}catch(_0x8675cf){logger[_0xac07('0xe')](_0xac07('0xd'),_0x21cb43,JSON[_0xac07('0x26')](_0x8675cf));_0x5e67f5[_0xac07('0x28')]();}};};
\ No newline at end of file
+var _0x4294=['contact','format','out','sms','channel','phone','interaction','chat','account','upperFirst','InteractionId','isEmpty','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','then','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','lodash','dialogflow','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','create','info','catch','error','stringify','consequence','[%s][DIALOGFLOWV2]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0xb29bba,_0x56d41f){var _0x1c5ed2=function(_0x447eff){while(--_0x447eff){_0xb29bba['push'](_0xb29bba['shift']());}};_0x1c5ed2(++_0x56d41f);}(_0x4294,0x6c));var _0x4429=function(_0x127442,_0x13180a){_0x127442=_0x127442-0x0;var _0x4ef394=_0x4294[_0x127442];return _0x4ef394;};'use strict';var _=require(_0x4429('0x0'));var dialogflow=require(_0x4429('0x1'));var md5=require('md5');var moment=require(_0x4429('0x2'));var Promise=require(_0x4429('0x3'));var logger=require('../../../../config/logger')(_0x4429('0x4'));var utils=require(_0x4429('0x5'));var rpc={'chatMessage':require(_0x4429('0x6')),'openchannelMessage':require(_0x4429('0x7')),'mailMessage':require(_0x4429('0x8')),'smsMessage':require(_0x4429('0x9')),'faxMessage':require(_0x4429('0xa')),'whatsappMessage':require(_0x4429('0xb'))};function createMessage(_0x424003,_0x193879,_0xb22e26,_0x37a2d2){return new Promise(function(_0x4bfeed,_0x10965d){var _0x57fe21=_['clone'](_0xb22e26);_0x57fe21[_0x4429('0xc')]=_0x37a2d2;return rpc[_0x193879+'Message'][_0x4429('0xd')](_0x57fe21)['then'](function(){logger[_0x4429('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x424003,_0x57fe21[_0x4429('0xc')]);_0x4bfeed();})[_0x4429('0xf')](function(_0x53c1dd){logger[_0x4429('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x424003,JSON[_0x4429('0x11')](_0x53c1dd));_0x10965d(_0x53c1dd);});});}exports[_0x4429('0x12')]=function(_0x34f79c,_0x3bcf0a){return function(_0x18d54e){try{if(!_['isNil'](this['interaction']['UserId'])){logger['info'](_0x4429('0x13'),_0x34f79c,_0x4429('0x14'));return _0x18d54e[_0x4429('0x15')]();}var _0x477ca3={'ContactId':this[_0x4429('0x16')]['id'],'sentAt':moment()[_0x4429('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x4429('0x18')};if(this['channel']===_0x4429('0x19')||this[_0x4429('0x1a')]==='whatsapp'){_0x477ca3[_0x4429('0x1b')]=this[_0x4429('0x1c')][_0x4429('0x1b')];}var _0x3c3671=this[_0x4429('0x1a')];if(_0x3c3671===_0x4429('0x1d')){_0x477ca3['ChatWebsiteId']=this[_0x4429('0x1e')]['id'];}else{_0x477ca3[_['upperFirst'](_0x3c3671)+'AccountId']=this['account']['id'];}_0x477ca3[_[_0x4429('0x1f')](_0x3c3671)+_0x4429('0x20')]=this[_0x4429('0x1c')]['id'];if(this[_0x4429('0x1c')]['created']){var _0x44b3b1=_0x3bcf0a[0x4];if(!_[_0x4429('0x21')](_0x44b3b1)){_0x477ca3[_0x4429('0xc')]=utils['getMustacheRender'](_0x44b3b1,this);return rpc[_0x3c3671+'Message']['create'](_0x477ca3)['then'](function(_0x305814){logger[_0x4429('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x34f79c,_0x477ca3[_0x4429('0xc')]);})[_0x4429('0xf')](function(_0x50d5d6){logger['error'](_0x4429('0x13'),_0x34f79c,JSON['stringify'](_0x50d5d6));})['finally'](function(){logger['info'](_0x4429('0x22'),_0x34f79c);_0x18d54e[_0x4429('0x23')]();});}else{logger['info'](_0x4429('0x24'),_0x34f79c);_0x18d54e[_0x4429('0x23')]();}}else{var _0x3c426d=this;var _0x166320=_0x3bcf0a[0x2][_0x4429('0x25')](/\\n/g,'\x0a');var _0x4a324b={'credentials':{'private_key':_0x166320,'client_email':_0x3bcf0a[0x1]}};var _0x5e1664=new dialogflow[(_0x4429('0x26'))](_0x4a324b);var _0x10666d=_0x5e1664[_0x4429('0x27')](_0x3bcf0a[0x0],md5(_0x3c426d['interaction']['id']));var _0x161b78={'session':_0x10666d,'queryInput':{'text':{'text':_0x3c426d[_0x4429('0x28')]['body'],'languageCode':_0x3bcf0a[0x3]||'en'}}};return _0x5e1664[_0x4429('0x29')](_0x161b78)[_0x4429('0x2a')](function(_0x4cd41b){if(_0x4cd41b&&_0x4cd41b[_0x4429('0x2b')]){_0x3c426d['body'][_0x4429('0x2c')]=_0x4cd41b;var _0x3ae9b9=_0x4cd41b[0x0];var _0x5791e8=_0x3ae9b9[_0x4429('0x2d')][_0x4429('0x2e')]&&_0x3ae9b9[_0x4429('0x2d')][_0x4429('0x2e')][_0x4429('0x2f')]?_0x3ae9b9['queryResult'][_0x4429('0x2e')][_0x4429('0x2f')][_0x4429('0x30')][_0x4429('0x31')]:![];_0x3c426d['body'][_0x4429('0x32')]=_0x3ae9b9['queryResult']['action'];_0x3c426d[_0x4429('0xc')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3ae9b9['queryResult']['allRequiredParamsPresent'];_0x3c426d[_0x4429('0xc')][_0x4429('0x33')]=_0x3ae9b9[_0x4429('0x2d')][_0x4429('0x2e')]&&_0x3ae9b9['queryResult'][_0x4429('0x2e')][_0x4429('0x2f')]?_0x3ae9b9[_0x4429('0x2d')]['diagnosticInfo']['fields'][_0x4429('0x30')][_0x4429('0x31')]:![];_0x3c426d[_0x4429('0xc')][_0x4429('0x34')]=_0x3ae9b9[_0x4429('0x2d')][_0x4429('0x35')][_0x4429('0x36')];_0x3c426d['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x3ae9b9[_0x4429('0x2d')][_0x4429('0x35')]['displayName'];_0x3c426d['body'][_0x4429('0x37')]=_0x3ae9b9[_0x4429('0x2d')][_0x4429('0x35')][_0x4429('0x38')];_0x3c426d[_0x4429('0xc')][_0x4429('0x39')]=_0x3ae9b9['queryResult'][_0x4429('0x3a')];_0x3c426d['body']['DIALOGFLOWV2_QUERYTEXT']=_0x3ae9b9[_0x4429('0x2d')][_0x4429('0x3b')];_0x3c426d[_0x4429('0xc')][_0x4429('0x3c')]=_0x3ae9b9[_0x4429('0x2d')][_0x4429('0x3d')];_0x477ca3[_0x4429('0x3e')]=_0x4429('0x2c');_0x477ca3[_0x4429('0x3f')]=JSON[_0x4429('0x11')](_0x4cd41b);var _0x10be62=[];for(var _0x57f51b=0x0;_0x57f51b<_0x4cd41b[_0x4429('0x2b')];_0x57f51b++){var _0xa1ef8b=_0x4cd41b[_0x57f51b];if(_0xa1ef8b&&_0xa1ef8b[_0x4429('0x2d')]&&_0xa1ef8b[_0x4429('0x2d')][_0x4429('0x40')]){_0x10be62['push'](createMessage(_0x34f79c,_0x3c3671,_0x477ca3,_0xa1ef8b['queryResult']['fulfillmentText']));}}return Promise['all'](_0x10be62)['then'](function(){if(_0x5791e8){_0x18d54e[_0x4429('0x15')]();}else{_0x18d54e[_0x4429('0x23')]();}})[_0x4429('0xf')](function(_0x250d6c){logger[_0x4429('0x10')](_0x4429('0x13'),_0x34f79c,JSON[_0x4429('0x11')](_0x250d6c));_0x18d54e[_0x4429('0x15')]();});}})[_0x4429('0xf')](function(_0x46d5a3){logger[_0x4429('0x10')](_0x4429('0x13'),_0x34f79c,_0x46d5a3[_0x4429('0x28')]);_0x18d54e[_0x4429('0x15')]();});}}catch(_0x50172d){logger[_0x4429('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x34f79c,JSON[_0x4429('0x11')](_0x50172d));_0x18d54e['stop']();}};};
\ No newline at end of file
index b3e9bd7..3943f5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dbb=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse'];(function(_0x43a786,_0x38a98e){var _0x2b0c30=function(_0x231080){while(--_0x231080){_0x43a786['push'](_0x43a786['shift']());}};_0x2b0c30(++_0x38a98e);}(_0x8dbb,0x19c));var _0xb8db=function(_0xf6c2d4,_0x3bba39){_0xf6c2d4=_0xf6c2d4-0x0;var _0x28eca3=_0x8dbb[_0xf6c2d4];return _0x28eca3;};'use strict';var schema=require(_0xb8db('0x0'));var _=require(_0xb8db('0x1'));var htmlToText=require(_0xb8db('0x2'));var utils=require(_0xb8db('0x3'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0xb8db('0x4'),'required':!![],'message':_0xb8db('0x5')},'priorityTrue':{'type':_0xb8db('0x6'),'message':_0xb8db('0x7')},'priorityFalse':{'type':_0xb8db('0x6'),'message':_0xb8db('0x8')}});exports[_0xb8db('0x9')]=function(_0x1d6fb8,_0x34ac4b){return function(_0x5043a4){try{var _0x397743={'condition':htmlToText[_0xb8db('0xa')](utils[_0xb8db('0xb')](_0x34ac4b[0x0],this),{'wordwrap':![]})[_0xb8db('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x34ac4b[0x1],'priorityFalse':_0x34ac4b[0x2]};var _0x10a084=gotoif[_0xb8db('0x0')](_0x397743,{'typecast':!![]});if(_0x10a084[_0xb8db('0xd')]){logger[_0xb8db('0xe')](_0xb8db('0xf'),_0x1d6fb8,_[_0xb8db('0x10')](_0x10a084,_0xb8db('0x11'))['join'](',\x20'));_0x5043a4[_0xb8db('0x12')]();}else{try{var _0x1afa95=eval('('+_0x397743[_0xb8db('0x13')]+')');var _0x37e9c4=_0x1afa95?_0x397743[_0xb8db('0x14')]:_0x397743[_0xb8db('0x15')];logger[_0xb8db('0x16')](_0xb8db('0x17'),_0x1d6fb8,_0x397743[_0xb8db('0x13')],_0x1afa95,_0x37e9c4||_0xb8db('0x18'));if(_0x37e9c4){var _0x517851=_[_0xb8db('0x19')](_0x5043a4[_0xb8db('0x1a')](),{'p':_0x37e9c4});if(_0x517851>=0x0){logger[_0xb8db('0x16')](_0xb8db('0x1b'),_0x1d6fb8,_0x37e9c4||_0xb8db('0x18'),_0x517851);_0x5043a4['next'](_0x517851);}else{logger[_0xb8db('0x16')](_0xb8db('0x1c'),_0x1d6fb8,_0x37e9c4||_0xb8db('0x18'));_0x5043a4['stop']();}}else{_0x5043a4['next']();}}catch(_0x25e764){logger['error'](_0xb8db('0x1d'),_0x1d6fb8,_0x25e764[_0xb8db('0x11')]);_0x5043a4[_0xb8db('0x12')]();}}}catch(_0x369bb6){logger[_0xb8db('0xe')](_0xb8db('0xf'),_0x1d6fb8,JSON[_0xb8db('0x1e')](_0x369bb6));_0x5043a4['stop']();}};};
\ No newline at end of file
+var _0x997d=['priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number'];(function(_0x3a2e8c,_0x4001d3){var _0x588177=function(_0x2dbc02){while(--_0x2dbc02){_0x3a2e8c['push'](_0x3a2e8c['shift']());}};_0x588177(++_0x4001d3);}(_0x997d,0x1e5));var _0xd997=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0x997d[_0x48a96f];return _0x3ff3ef;};'use strict';var schema=require('validate');var _=require(_0xd997('0x0'));var htmlToText=require('html-to-text');var utils=require(_0xd997('0x1'));var logger=require(_0xd997('0x2'))(_0xd997('0x3'));var gotoif=schema({'condition':{'type':_0xd997('0x4'),'required':!![],'message':_0xd997('0x5')},'priorityTrue':{'type':_0xd997('0x6'),'message':_0xd997('0x7')},'priorityFalse':{'type':_0xd997('0x6'),'message':_0xd997('0x8')}});exports['consequence']=function(_0x4a1731,_0x33e9e6){return function(_0x575aa8){try{var _0xf14154={'condition':htmlToText[_0xd997('0x9')](utils[_0xd997('0xa')](_0x33e9e6[0x0],this),{'wordwrap':![]})[_0xd997('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x33e9e6[0x1],'priorityFalse':_0x33e9e6[0x2]};var _0x1500df=gotoif[_0xd997('0xc')](_0xf14154,{'typecast':!![]});if(_0x1500df[_0xd997('0xd')]){logger[_0xd997('0xe')](_0xd997('0xf'),_0x4a1731,_[_0xd997('0x10')](_0x1500df,_0xd997('0x11'))['join'](',\x20'));_0x575aa8[_0xd997('0x12')]();}else{try{var _0x30ad84=eval('('+_0xf14154[_0xd997('0x13')]+')');var _0x5c00f4=_0x30ad84?_0xf14154['priorityTrue']:_0xf14154['priorityFalse'];logger['info'](_0xd997('0x14'),_0x4a1731,_0xf14154['condition'],_0x30ad84,_0x5c00f4||_0xd997('0x15'));if(_0x5c00f4){var _0x2a8596=_[_0xd997('0x16')](_0x575aa8[_0xd997('0x17')](),{'p':_0x5c00f4});if(_0x2a8596>=0x0){logger[_0xd997('0x18')](_0xd997('0x19'),_0x4a1731,_0x5c00f4||_0xd997('0x15'),_0x2a8596);_0x575aa8['next'](_0x2a8596);}else{logger[_0xd997('0x18')](_0xd997('0x1a'),_0x4a1731,_0x5c00f4||_0xd997('0x15'));_0x575aa8[_0xd997('0x12')]();}}else{_0x575aa8[_0xd997('0x15')]();}}catch(_0x107ade){logger['error'](_0xd997('0x1b'),_0x4a1731,_0x107ade['message']);_0x575aa8[_0xd997('0x12')]();}}}catch(_0x4072b5){logger[_0xd997('0xe')]('[%s][GOTOIF]\x20%s',_0x4a1731,JSON[_0xd997('0x1c')](_0x4072b5));_0x575aa8[_0xd997('0x12')]();}};};
\ No newline at end of file
index 6219a54..e066bfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8495=['stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s'];(function(_0x234e67,_0x2cbb09){var _0x415b13=function(_0x565b41){while(--_0x565b41){_0x234e67['push'](_0x234e67['shift']());}};_0x415b13(++_0x2cbb09);}(_0x8495,0x111));var _0x5849=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x8495[_0x9df060];return _0x338dfe;};'use strict';var schema=require(_0x5849('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x5849('0x1'));var gotop=schema({'priority':{'type':_0x5849('0x2'),'required':!![],'message':_0x5849('0x3')}});exports[_0x5849('0x4')]=function(_0x558838,_0x12291a){return function(_0x1f7f16){try{var _0x560fad={'priority':_0x12291a[0x0]};var _0x4b5a8=gotop[_0x5849('0x0')](_0x560fad,{'typecast':!![]});if(_0x4b5a8['length']){logger[_0x5849('0x5')]('[%s][GOTOP]\x20%s',_0x558838,_['map'](_0x4b5a8,_0x5849('0x6'))[_0x5849('0x7')](',\x20'));_0x1f7f16[_0x5849('0x8')]();}else{logger['info'](_0x5849('0x9'),_0x558838,_0x560fad[_0x5849('0xa')]);if(_0x560fad[_0x5849('0xa')]){var _0x250fb7=_[_0x5849('0xb')](_0x1f7f16['rules'](),{'p':_0x560fad[_0x5849('0xa')]});if(_0x250fb7>=0x0){logger[_0x5849('0xc')](_0x5849('0xd'),_0x558838,_0x560fad['priority']||'next',_0x250fb7);_0x1f7f16['next'](_0x250fb7);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x558838,_0x560fad['priority']||_0x5849('0xe'));_0x1f7f16[_0x5849('0x8')]();}}else{_0x1f7f16[_0x5849('0xe')]();}}}catch(_0xc9530d){logger[_0x5849('0x5')](_0x5849('0xf'),_0x558838,JSON[_0x5849('0x10')](_0xc9530d));_0x1f7f16[_0x5849('0x8')]();}};};
\ No newline at end of file
+var _0xe122=['findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','info','[%s][GOTOP]\x20priority\x20%s','priority'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xe122,0x14b));var _0x2e12=function(_0x50d45b,_0x2672d3){_0x50d45b=_0x50d45b-0x0;var _0xfc5578=_0xe122[_0x50d45b];return _0xfc5578;};'use strict';var schema=require(_0x2e12('0x0'));var _=require(_0x2e12('0x1'));var logger=require(_0x2e12('0x2'))(_0x2e12('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x2e12('0x4')}});exports[_0x2e12('0x5')]=function(_0x4817da,_0x10da78){return function(_0x5e652e){try{var _0xf6bd62={'priority':_0x10da78[0x0]};var _0x1dfac6=gotop[_0x2e12('0x0')](_0xf6bd62,{'typecast':!![]});if(_0x1dfac6[_0x2e12('0x6')]){logger['error'](_0x2e12('0x7'),_0x4817da,_['map'](_0x1dfac6,'message')['join'](',\x20'));_0x5e652e['stop']();}else{logger[_0x2e12('0x8')](_0x2e12('0x9'),_0x4817da,_0xf6bd62[_0x2e12('0xa')]);if(_0xf6bd62[_0x2e12('0xa')]){var _0x4ea4f0=_[_0x2e12('0xb')](_0x5e652e[_0x2e12('0xc')](),{'p':_0xf6bd62[_0x2e12('0xa')]});if(_0x4ea4f0>=0x0){logger['info'](_0x2e12('0xd'),_0x4817da,_0xf6bd62[_0x2e12('0xa')]||_0x2e12('0xe'),_0x4ea4f0);_0x5e652e['next'](_0x4ea4f0);}else{logger[_0x2e12('0x8')](_0x2e12('0xf'),_0x4817da,_0xf6bd62['priority']||_0x2e12('0xe'));_0x5e652e[_0x2e12('0x10')]();}}else{_0x5e652e[_0x2e12('0xe')]();}}}catch(_0xaf31dc){logger[_0x2e12('0x11')](_0x2e12('0x7'),_0x4817da,JSON['stringify'](_0xaf31dc));_0x5e652e[_0x2e12('0x10')]();}};};
\ No newline at end of file
index 3c02eed..d6231ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x977c=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','chat','upperFirst','account','channel','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/mailMessage'];(function(_0xbfc560,_0x311fba){var _0x47b022=function(_0x2cd37f){while(--_0x2cd37f){_0xbfc560['push'](_0xbfc560['shift']());}};_0x47b022(++_0x311fba);}(_0x977c,0x1d0));var _0xc977=function(_0x4a008b,_0x5bd330){_0x4a008b=_0x4a008b-0x0;var _0x56bcd9=_0x977c[_0x4a008b];return _0x56bcd9;};'use strict';var _=require('lodash');var utils=require(_0xc977('0x0'));var logger=require(_0xc977('0x1'))(_0xc977('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xc977('0x3')),'smsMessage':require(_0xc977('0x4')),'faxMessage':require(_0xc977('0x5')),'whatsappMessage':require(_0xc977('0x6'))};exports[_0xc977('0x7')]=function(_0x421929,_0x306914){return function(_0x510999){try{var _0x28645f={'body':utils[_0xc977('0x8')](_0x306914[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0xc977('0x9')){_0x28645f['ChatWebsiteId']=this['account']['id'];}else{_0x28645f[_[_0xc977('0xa')](this['channel'])+'AccountId']=this[_0xc977('0xb')]['id'];}_0x28645f[_['upperFirst'](this[_0xc977('0xc')])+_0xc977('0xd')]=this[_0xc977('0xe')]['id'];if(rpc[this['channel']+_0xc977('0xf')]){return rpc[this[_0xc977('0xc')]+'Message'][_0xc977('0x10')](_0x28645f)[_0xc977('0x11')](function(_0x507c02){logger[_0xc977('0x12')](_0xc977('0x13'),_0x421929,_0x28645f[_0xc977('0x14')]);_0x510999[_0xc977('0x15')]();})[_0xc977('0x16')](function(_0x556f15){logger[_0xc977('0x17')]('[%s][MESSAGE]\x20%s',_0x421929,JSON[_0xc977('0x18')](_0x556f15));_0x510999[_0xc977('0x19')]();});}}catch(_0x3db407){logger[_0xc977('0x17')]('[%s][MESSAGE]\x20%s',_0x421929,JSON[_0xc977('0x18')](_0x3db407));_0x510999[_0xc977('0x19')]();}};};
\ No newline at end of file
+var _0x2802=['next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s'];(function(_0x45ce6f,_0x25528c){var _0x522dc5=function(_0xbef0b){while(--_0xbef0b){_0x45ce6f['push'](_0x45ce6f['shift']());}};_0x522dc5(++_0x25528c);}(_0x2802,0x1b5));var _0x2280=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x2802[_0x390733];return _0x33beb9;};'use strict';var _=require(_0x2280('0x0'));var utils=require(_0x2280('0x1'));var logger=require(_0x2280('0x2'))(_0x2280('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2280('0x4')),'smsMessage':require(_0x2280('0x5')),'faxMessage':require(_0x2280('0x6')),'whatsappMessage':require(_0x2280('0x7'))};exports[_0x2280('0x8')]=function(_0x21861e,_0x8cffc8){return function(_0x30a0c9){try{var _0x755629={'body':utils[_0x2280('0x9')](_0x8cffc8[0x0],this),'ContactId':this[_0x2280('0xa')]['id']};if(this[_0x2280('0xb')]===_0x2280('0xc')){_0x755629[_0x2280('0xd')]=this['account']['id'];}else{_0x755629[_['upperFirst'](this[_0x2280('0xb')])+'AccountId']=this[_0x2280('0xe')]['id'];}_0x755629[_[_0x2280('0xf')](this[_0x2280('0xb')])+_0x2280('0x10')]=this[_0x2280('0x11')]['id'];if(rpc[this[_0x2280('0xb')]+'Message']){return rpc[this['channel']+_0x2280('0x12')][_0x2280('0x13')](_0x755629)[_0x2280('0x14')](function(_0x5751a1){logger['info'](_0x2280('0x15'),_0x21861e,_0x755629['body']);_0x30a0c9[_0x2280('0x16')]();})[_0x2280('0x17')](function(_0x42a459){logger[_0x2280('0x18')](_0x2280('0x15'),_0x21861e,JSON[_0x2280('0x19')](_0x42a459));_0x30a0c9['stop']();});}}catch(_0x5462a8){logger[_0x2280('0x18')]('[%s][MESSAGE]\x20%s',_0x21861e,JSON[_0x2280('0x19')](_0x5462a8));_0x30a0c9[_0x2280('0x1a')]();}};};
\ No newline at end of file
index 2e2505b..ea33267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd75b=['getMustacheRender','next','[%s][NOOP]\x20%s','stringify','../../../../config/logger','routing'];(function(_0x3c9a09,_0x1e6b87){var _0x33bdb6=function(_0x4e75d8){while(--_0x4e75d8){_0x3c9a09['push'](_0x3c9a09['shift']());}};_0x33bdb6(++_0x1e6b87);}(_0xd75b,0x1de));var _0xbd75=function(_0x1f08ba,_0x6afc4d){_0x1f08ba=_0x1f08ba-0x0;var _0x3e987=_0xd75b[_0x1f08ba];return _0x3e987;};'use strict';var utils=require('./utils');var logger=require(_0xbd75('0x0'))(_0xbd75('0x1'));exports['consequence']=function(_0x191926,_0x55b1da){return function(_0x59961a){try{logger['info']('[%s][NOOP]\x20%s',_0x191926,utils[_0xbd75('0x2')](_0x55b1da[0x0],this));_0x59961a[_0xbd75('0x3')]();}catch(_0x165ea9){logger['error'](_0xbd75('0x4'),_0x191926,JSON[_0xbd75('0x5')](_0x165ea9));_0x59961a['stop']();}};};
\ No newline at end of file
+var _0x85f0=['info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x520a60,_0x3d28b2){var _0x30b601=function(_0x102ed2){while(--_0x102ed2){_0x520a60['push'](_0x520a60['shift']());}};_0x30b601(++_0x3d28b2);}(_0x85f0,0x193));var _0x085f=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x85f0[_0x28947d];return _0x12d2ee;};'use strict';var utils=require(_0x085f('0x0'));var logger=require(_0x085f('0x1'))(_0x085f('0x2'));exports[_0x085f('0x3')]=function(_0xee3c57,_0x101d0b){return function(_0x3ed114){try{logger[_0x085f('0x4')](_0x085f('0x5'),_0xee3c57,utils[_0x085f('0x6')](_0x101d0b[0x0],this));_0x3ed114[_0x085f('0x7')]();}catch(_0x177f1b){logger[_0x085f('0x8')]('[%s][NOOP]\x20%s',_0xee3c57,JSON[_0x085f('0x9')](_0x177f1b));_0x3ed114[_0x085f('0xa')]();}};};
\ No newline at end of file
index dbc1842..ae7f235 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20ba=['AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','Queues','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','ioredis','../../../../config/environment','routing','./strategy','redis','socket.io-emitter','queue','from','joinAt','emit','clone','queue_id','account','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat'];(function(_0x251811,_0x300bc3){var _0x19c4aa=function(_0x50a002){while(--_0x50a002){_0x251811['push'](_0x251811['shift']());}};_0x19c4aa(++_0x300bc3);}(_0x20ba,0x1a4));var _0xa20b=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x20ba[_0x3718b7];return _0xf8c91e;};'use strict';var schema=require(_0xa20b('0x0'));var _=require(_0xa20b('0x1'));var util=require('util');var seqqueue=require(_0xa20b('0x2'));var moment=require('moment');var Redis=require(_0xa20b('0x3'));var config=require(_0xa20b('0x4'));var logger=require('../../../../config/logger')(_0xa20b('0x5'));var strategy=require(_0xa20b('0x6'));config[_0xa20b('0x7')]=_['defaults'](config[_0xa20b('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xa20b('0x8'))(new Redis(config['redis']));var attributes=['id','queue_id','account',_0xa20b('0x9'),_0xa20b('0xa'),_0xa20b('0xb')];function emit(_0x5ec146,_0x16e712,_0x506e6b){io['to'](_0x5ec146)[_0xa20b('0xc')](_0x16e712,_0x506e6b);}function emitChannelQueueInteraction(_0x4a7210,_0x83b088,_0x209ed6,_0x24ec37,_0x156601,_0x2d5f60,_0x237bba,_0x199b6e){var _0x511605=_[_0xa20b('0xd')](_0x209ed6);_0x511605[_0xa20b('0xe')]=_0x199b6e;_0x511605[_0xa20b('0x9')]=_0x83b088;_0x511605[_0xa20b('0xf')]=_0x24ec37;_0x511605['id']=_0x156601;if(_0x2d5f60){_0x237bba[util[_0xa20b('0x10')](_0xa20b('0x11'),_0x4a7210)][_0x156601]=_['pick'](_0x511605,attributes);}else{delete _0x237bba[util[_0xa20b('0x10')]('%sQueuesWaitingInteractions',_0x4a7210)][_0x156601];}emit(util[_0xa20b('0x10')](_0xa20b('0x12'),_0x4a7210,_0x83b088),util[_0xa20b('0x10')](_0xa20b('0x13'),_0x4a7210,_0x2d5f60?_0xa20b('0x14'):_0xa20b('0x15')),_['pick'](_0x511605,attributes));}var rpc={'openchannelQueueReport':require(_0xa20b('0x16')),'mailQueueReport':require(_0xa20b('0x17')),'chatQueueReport':require(_0xa20b('0x18')),'smsQueueReport':require(_0xa20b('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa20b('0x1a'))};var queue=schema({'name':{'type':_0xa20b('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa20b('0x1c'),'message':_0xa20b('0x1d')}});function startRouting(_0x460052,_0x467112,_0x3b39dd,_0x53fc3d){if(_0x460052&&_0x467112&&_0x3b39dd){_0x467112[_0xa20b('0x1e')]+=0x1;var _0x2ad6f9={'uniqueid':_0x460052,'from':_0x3b39dd[_0xa20b('0x1f')]?_0x3b39dd[_0xa20b('0x1f')]['from']:'','joinAt':moment()[_0xa20b('0x10')](_0xa20b('0x20')),'ContactId':_0x3b39dd[_0xa20b('0x21')]?_0x3b39dd[_0xa20b('0x21')]['id']:null,'ListId':_0x3b39dd[_0xa20b('0x22')]?_0x3b39dd[_0xa20b('0x22')]['id']:null};_0x2ad6f9[_[_0xa20b('0x23')](_0x3b39dd[_0xa20b('0x24')])+_0xa20b('0x25')]=_0x467112['id']||null;_0x2ad6f9[_[_0xa20b('0x23')](_0x3b39dd[_0xa20b('0x24')])+_0xa20b('0x26')]=_0x3b39dd[_0xa20b('0x27')]?_0x3b39dd['interaction']['id']:null;_0x2ad6f9[_[_0xa20b('0x23')](_0x3b39dd[_0xa20b('0x24')])+'MessageId']=_0x3b39dd[_0xa20b('0x28')]?_0x3b39dd[_0xa20b('0x28')]['id']:null;_0x2ad6f9[_['upperFirst'](_0x3b39dd['channel'])+(_0x3b39dd[_0xa20b('0x24')]!==_0xa20b('0x29')?_0xa20b('0x2a'):_0xa20b('0x2b'))]=_0x3b39dd[_0xa20b('0xf')]?_0x3b39dd[_0xa20b('0xf')]['id']:null;logger[_0xa20b('0x2c')](util['format'](_0xa20b('0x2d'),_0x460052,_0x467112[_0xa20b('0x2e')]));emitChannelQueueInteraction(_0x3b39dd[_0xa20b('0x24')],_0x467112[_0xa20b('0x2e')],_0x2ad6f9,_0x3b39dd[_0xa20b('0xf')]['name'],_0x3b39dd[_0xa20b('0x28')]['id'],!![],_0x53fc3d,_0x467112['id']);if(rpc[_0x3b39dd[_0xa20b('0x24')]+_0xa20b('0x2f')]){return rpc[_0x3b39dd[_0xa20b('0x24')]+'QueueReport']['create'](_0x2ad6f9)[_0xa20b('0x30')](function(_0xc7ffd6){logger[_0xa20b('0x31')](_0xa20b('0x32'));});}}}function stopRouting(_0x15cf3b,_0xce2ccd,_0x42b2f8,_0xf563fd){if(_0x15cf3b&&_0xce2ccd){_0xce2ccd[_0xa20b('0x1e')]-=0x1;var _0x27ba54={'leaveAt':moment()['format'](_0xa20b('0x20')),'acceptAt':moment()[_0xa20b('0x10')](_0xa20b('0x20')),'reason':_0xa20b('0x33')};logger[_0xa20b('0x2c')](util[_0xa20b('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x15cf3b,_0xce2ccd['name']));emitChannelQueueInteraction(_0x42b2f8['channel'],_0xce2ccd['name'],_0x42b2f8['body'],_0x42b2f8[_0xa20b('0xf')]['name'],_0x42b2f8['message']['id'],![],_0xf563fd,_0xce2ccd['id']);if(rpc[_0x42b2f8['channel']+_0xa20b('0x2f')]){return rpc[_0x42b2f8[_0xa20b('0x24')]+_0xa20b('0x2f')][_0xa20b('0x34')](_0x15cf3b,_0x27ba54)[_0xa20b('0x30')](function(_0x74d451){logger[_0xa20b('0x31')](_0xa20b('0x35'));});}}}function endRouting(_0x357032,_0x16845d,_0x5b5e63,_0x1e7589){if(_0x357032&&_0x16845d){_0x16845d[_0xa20b('0x1e')]-=0x1;var _0x2cbc2b={'leaveAt':moment()[_0xa20b('0x10')](_0xa20b('0x20')),'exitAt':moment()[_0xa20b('0x10')](_0xa20b('0x20')),'reason':_0xa20b('0x36')};logger[_0xa20b('0x2c')](util[_0xa20b('0x10')]('[%s][END:QUEUE][NAME:%s]',_0x357032,_0x16845d['name']));emitChannelQueueInteraction(_0x5b5e63[_0xa20b('0x24')],_0x16845d[_0xa20b('0x2e')],_0x5b5e63['body'],_0x5b5e63[_0xa20b('0xf')][_0xa20b('0x2e')],_0x5b5e63[_0xa20b('0x28')]['id'],![],_0x1e7589);if(rpc[_0x5b5e63[_0xa20b('0x24')]+_0xa20b('0x2f')]){return rpc[_0x5b5e63[_0xa20b('0x24')]+_0xa20b('0x2f')][_0xa20b('0x34')](_0x357032,_0x2cbc2b)[_0xa20b('0x30')](function(_0x3e55dd){logger[_0xa20b('0x31')](_0xa20b('0x35'));});}}}function handleFindQueue(_0x516aeb){return function(_0x4bf9bd){return _0x4bf9bd[_0xa20b('0x2e')][_0xa20b('0x37')]()===_0x516aeb[_0xa20b('0x37')]();};}exports[_0xa20b('0x38')]=function(_0x29a6e5,_0xeca353,_0xadd1ff,_0x4b5b12){return function(_0x1daffb){try{var _0x1e5fad={'name':_0xeca353[0x0],'timeout':_0xeca353[0x1]};var _0x4a166f=queue[_0xa20b('0x0')](_0x1e5fad,{'typecast':!![]});if(_0x4a166f[_0xa20b('0x39')]){logger['error'](_0xa20b('0x3a'),_0x29a6e5,_[_0xa20b('0x3b')](_0x4a166f,_0xa20b('0x28'))['join'](',\x20'));_0x1daffb[_0xa20b('0x3c')]();}else{var _0x388142=_['find'](_0xadd1ff[_0x4b5b12['channel']+_0xa20b('0x3d')],handleFindQueue(_0x1e5fad['name']));if(_0x388142){startRouting(_0x29a6e5,_0x388142,_0x4b5b12,_0xadd1ff);var _0x5f4f35=(_0x388142[_0xa20b('0x36')]||0xa)*0x3e8;var _0x41aaf2=(_0x1e5fad['timeout']||0x14)*0x3e8;var _0x534da5,_0x320146;if(_0x5f4f35>_0x41aaf2){_0x41aaf2=_0x5f4f35;}var _0x3244e5=seqqueue[_0xa20b('0x3e')](_0x5f4f35);_0x3244e5['id']=_0x29a6e5;_0x3244e5[_0xa20b('0x3f')]=_0x5f4f35;_0x3244e5[_0xa20b('0x40')]=_0x41aaf2;_0x3244e5[_0xa20b('0x24')]=_0x4b5b12[_0xa20b('0x24')];_0xadd1ff['rules'][_0x29a6e5]['on'](_0xa20b('0x41'),function(){logger[_0xa20b('0x2c')](_0xa20b('0x42'),_0x29a6e5);stopRouting(_0x29a6e5,_0x388142,_0x4b5b12,_0xadd1ff);clearTimeout(_0x534da5);_0x534da5=undefined;_0x3244e5['close'](!![]);if(_0xadd1ff[_0xa20b('0x43')][_0x29a6e5]){delete _0xadd1ff[_0xa20b('0x43')][_0x29a6e5];}_0x1daffb[_0xa20b('0x3c')]();});_0xadd1ff[_0xa20b('0x43')][_0x29a6e5]['on'](_0xa20b('0x44'),function(){if(_0xadd1ff['rules'][_0x29a6e5]){delete _0xadd1ff[_0xa20b('0x43')][_0x29a6e5];}});_0x534da5=setTimeout(function(){logger[_0xa20b('0x2c')](_0xa20b('0x45'),_0x29a6e5);endRouting(_0x29a6e5,_0x388142,_0x4b5b12,_0xadd1ff);clearTimeout(_0x534da5);_0x3244e5[_0xa20b('0x46')](!![]);_0x1daffb[_0xa20b('0x47')]();},_0x41aaf2);switch(_0x388142[_0xa20b('0x48')]){case _0xa20b('0x49'):strategy[_0xa20b('0x49')](_0x3244e5,_0x388142,_0xadd1ff,_0x4b5b12);break;default:strategy['beepall'](_0x3244e5,_0x388142,_0xadd1ff,_0x4b5b12);}}else{logger[_0xa20b('0x31')](_0xa20b('0x4a'),_0x29a6e5,_0x1e5fad['name']);_0x1daffb[_0xa20b('0x3c')]();}}}catch(_0x1483ad){console[_0xa20b('0x4b')](_0x1483ad);logger[_0xa20b('0x31')]('[%s][QUEUE]\x20%s',_0x29a6e5,_0x1483ad[_0xa20b('0x4c')]);_0x1daffb['stop']();}};};
\ No newline at end of file
+var _0x26e4=['util','seq-queue','moment','../../../../config/logger','routing','defaults','redis','localhost','account','queue','from','joinAt','clone','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','name','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash'];(function(_0xc80702,_0x18ef50){var _0x4c4c76=function(_0x24ee31){while(--_0x24ee31){_0xc80702['push'](_0xc80702['shift']());}};_0x4c4c76(++_0x18ef50);}(_0x26e4,0xec));var _0x426e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x26e4[_0x14add3];return _0x4a174f;};'use strict';var schema=require('validate');var _=require(_0x426e('0x0'));var util=require(_0x426e('0x1'));var seqqueue=require(_0x426e('0x2'));var moment=require(_0x426e('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x426e('0x4'))(_0x426e('0x5'));var strategy=require('./strategy');config['redis']=_[_0x426e('0x6')](config[_0x426e('0x7')],{'host':_0x426e('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id','queue_id',_0x426e('0x9'),_0x426e('0xa'),_0x426e('0xb'),_0x426e('0xc')];function emit(_0x597999,_0x31497b,_0x3023d8){io['to'](_0x597999)['emit'](_0x31497b,_0x3023d8);}function emitChannelQueueInteraction(_0x2580cb,_0x465956,_0x3b1b8c,_0x5bd15a,_0x57a8c3,_0x5b7f6d,_0x242e82,_0x243264){var _0x36960e=_[_0x426e('0xd')](_0x3b1b8c);_0x36960e[_0x426e('0xe')]=_0x243264;_0x36960e[_0x426e('0xa')]=_0x465956;_0x36960e[_0x426e('0x9')]=_0x5bd15a;_0x36960e['id']=_0x57a8c3;if(_0x5b7f6d){_0x242e82[util[_0x426e('0xf')](_0x426e('0x10'),_0x2580cb)][_0x57a8c3]=_[_0x426e('0x11')](_0x36960e,attributes);}else{delete _0x242e82[util['format'](_0x426e('0x10'),_0x2580cb)][_0x57a8c3];}emit(util[_0x426e('0xf')](_0x426e('0x12'),_0x2580cb,_0x465956),util['format'](_0x426e('0x13'),_0x2580cb,_0x5b7f6d?'save':_0x426e('0x14')),_['pick'](_0x36960e,attributes));}var rpc={'openchannelQueueReport':require(_0x426e('0x15')),'mailQueueReport':require(_0x426e('0x16')),'chatQueueReport':require(_0x426e('0x17')),'smsQueueReport':require(_0x426e('0x18')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x426e('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x426e('0x1a'),'message':_0x426e('0x1b')}});function startRouting(_0x288d95,_0x48deb9,_0x2df9da,_0x25e700){if(_0x288d95&&_0x48deb9&&_0x2df9da){_0x48deb9[_0x426e('0x1c')]+=0x1;var _0x21074b={'uniqueid':_0x288d95,'from':_0x2df9da[_0x426e('0x1d')]?_0x2df9da[_0x426e('0x1d')]['from']:'','joinAt':moment()[_0x426e('0xf')](_0x426e('0x1e')),'ContactId':_0x2df9da['contact']?_0x2df9da[_0x426e('0x1f')]['id']:null,'ListId':_0x2df9da['list']?_0x2df9da[_0x426e('0x20')]['id']:null};_0x21074b[_[_0x426e('0x21')](_0x2df9da['channel'])+'QueueId']=_0x48deb9['id']||null;_0x21074b[_['upperFirst'](_0x2df9da[_0x426e('0x22')])+_0x426e('0x23')]=_0x2df9da['interaction']?_0x2df9da[_0x426e('0x24')]['id']:null;_0x21074b[_['upperFirst'](_0x2df9da['channel'])+'MessageId']=_0x2df9da[_0x426e('0x25')]?_0x2df9da[_0x426e('0x25')]['id']:null;_0x21074b[_['upperFirst'](_0x2df9da[_0x426e('0x22')])+(_0x2df9da['channel']!=='chat'?_0x426e('0x26'):_0x426e('0x27'))]=_0x2df9da['account']?_0x2df9da[_0x426e('0x9')]['id']:null;logger[_0x426e('0x28')](util[_0x426e('0xf')](_0x426e('0x29'),_0x288d95,_0x48deb9['name']));emitChannelQueueInteraction(_0x2df9da['channel'],_0x48deb9['name'],_0x21074b,_0x2df9da[_0x426e('0x9')]['name'],_0x2df9da[_0x426e('0x25')]['id'],!![],_0x25e700,_0x48deb9['id']);if(rpc[_0x2df9da[_0x426e('0x22')]+_0x426e('0x2a')]){return rpc[_0x2df9da[_0x426e('0x22')]+'QueueReport'][_0x426e('0x2b')](_0x21074b)[_0x426e('0x2c')](function(_0x447160){logger[_0x426e('0x2d')](_0x426e('0x2e'));});}}}function stopRouting(_0x26ee45,_0x3a582f,_0x5287a7,_0x3c5592){if(_0x26ee45&&_0x3a582f){_0x3a582f[_0x426e('0x1c')]-=0x1;var _0x3bb29e={'leaveAt':moment()['format'](_0x426e('0x1e')),'acceptAt':moment()[_0x426e('0xf')](_0x426e('0x1e')),'reason':_0x426e('0x2f')};logger[_0x426e('0x28')](util[_0x426e('0xf')](_0x426e('0x30'),_0x26ee45,_0x3a582f[_0x426e('0x31')]));emitChannelQueueInteraction(_0x5287a7['channel'],_0x3a582f[_0x426e('0x31')],_0x5287a7['body'],_0x5287a7[_0x426e('0x9')][_0x426e('0x31')],_0x5287a7[_0x426e('0x25')]['id'],![],_0x3c5592,_0x3a582f['id']);if(rpc[_0x5287a7[_0x426e('0x22')]+_0x426e('0x2a')]){return rpc[_0x5287a7[_0x426e('0x22')]+_0x426e('0x2a')][_0x426e('0x32')](_0x26ee45,_0x3bb29e)['catch'](function(_0x3b5402){logger[_0x426e('0x2d')](_0x426e('0x33'));});}}}function endRouting(_0x4d8e59,_0x592027,_0x4fe3bf,_0x5adc13){if(_0x4d8e59&&_0x592027){_0x592027['waiting']-=0x1;var _0x298629={'leaveAt':moment()[_0x426e('0xf')](_0x426e('0x1e')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x426e('0x28')](util['format'](_0x426e('0x34'),_0x4d8e59,_0x592027[_0x426e('0x31')]));emitChannelQueueInteraction(_0x4fe3bf[_0x426e('0x22')],_0x592027['name'],_0x4fe3bf[_0x426e('0x1d')],_0x4fe3bf[_0x426e('0x9')][_0x426e('0x31')],_0x4fe3bf[_0x426e('0x25')]['id'],![],_0x5adc13);if(rpc[_0x4fe3bf['channel']+_0x426e('0x2a')]){return rpc[_0x4fe3bf['channel']+_0x426e('0x2a')][_0x426e('0x32')](_0x4d8e59,_0x298629)[_0x426e('0x2c')](function(_0x337d0b){logger['error'](_0x426e('0x33'));});}}}function handleFindQueue(_0x33d1ba){return function(_0x3a3282){return _0x3a3282[_0x426e('0x31')][_0x426e('0x35')]()===_0x33d1ba[_0x426e('0x35')]();};}exports[_0x426e('0x36')]=function(_0x311d0f,_0x58bec0,_0x5cfd96,_0x4c6085){return function(_0x3877fb){try{var _0x303621={'name':_0x58bec0[0x0],'timeout':_0x58bec0[0x1]};var _0x12aa34=queue['validate'](_0x303621,{'typecast':!![]});if(_0x12aa34[_0x426e('0x37')]){logger['error'](_0x426e('0x38'),_0x311d0f,_[_0x426e('0x39')](_0x12aa34,_0x426e('0x25'))[_0x426e('0x3a')](',\x20'));_0x3877fb[_0x426e('0x3b')]();}else{var _0x2f05ad=_[_0x426e('0x3c')](_0x5cfd96[_0x4c6085[_0x426e('0x22')]+_0x426e('0x3d')],handleFindQueue(_0x303621['name']));if(_0x2f05ad){startRouting(_0x311d0f,_0x2f05ad,_0x4c6085,_0x5cfd96);var _0x5e760b=(_0x2f05ad['timeout']||0xa)*0x3e8;var _0x4c5df4=(_0x303621[_0x426e('0x3e')]||0x14)*0x3e8;var _0x574cdf,_0x79084a;if(_0x5e760b>_0x4c5df4){_0x4c5df4=_0x5e760b;}var _0x3839d3=seqqueue[_0x426e('0x3f')](_0x5e760b);_0x3839d3['id']=_0x311d0f;_0x3839d3[_0x426e('0x40')]=_0x5e760b;_0x3839d3[_0x426e('0x41')]=_0x4c5df4;_0x3839d3['channel']=_0x4c6085['channel'];_0x5cfd96['rules'][_0x311d0f]['on'](_0x426e('0x42'),function(){logger[_0x426e('0x28')](_0x426e('0x43'),_0x311d0f);stopRouting(_0x311d0f,_0x2f05ad,_0x4c6085,_0x5cfd96);clearTimeout(_0x574cdf);_0x574cdf=undefined;_0x3839d3[_0x426e('0x44')](!![]);if(_0x5cfd96[_0x426e('0x45')][_0x311d0f]){delete _0x5cfd96[_0x426e('0x45')][_0x311d0f];}_0x3877fb[_0x426e('0x3b')]();});_0x5cfd96[_0x426e('0x45')][_0x311d0f]['on'](_0x426e('0x46'),function(){if(_0x5cfd96[_0x426e('0x45')][_0x311d0f]){delete _0x5cfd96[_0x426e('0x45')][_0x311d0f];}});_0x574cdf=setTimeout(function(){logger[_0x426e('0x28')](_0x426e('0x47'),_0x311d0f);endRouting(_0x311d0f,_0x2f05ad,_0x4c6085,_0x5cfd96);clearTimeout(_0x574cdf);_0x3839d3['close'](!![]);_0x3877fb[_0x426e('0x48')]();},_0x4c5df4);switch(_0x2f05ad[_0x426e('0x49')]){case _0x426e('0x4a'):strategy[_0x426e('0x4a')](_0x3839d3,_0x2f05ad,_0x5cfd96,_0x4c6085);break;default:strategy[_0x426e('0x4b')](_0x3839d3,_0x2f05ad,_0x5cfd96,_0x4c6085);}}else{logger[_0x426e('0x2d')](_0x426e('0x4c'),_0x311d0f,_0x303621[_0x426e('0x31')]);_0x3877fb[_0x426e('0x3b')]();}}}catch(_0x478eda){console[_0x426e('0x4d')](_0x478eda);logger[_0x426e('0x2d')](_0x426e('0x38'),_0x311d0f,_0x478eda[_0x426e('0x4e')]);_0x3877fb[_0x426e('0x3b')]();}};};
\ No newline at end of file
index c317450..32dcfc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2b1=['isAgentAvailable','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','forcedOwnership'];(function(_0x2e5f28,_0x350e71){var _0x4bf287=function(_0x9d2c8b){while(--_0x9d2c8b){_0x2e5f28['push'](_0x2e5f28['shift']());}};_0x4bf287(++_0x350e71);}(_0xa2b1,0x67));var _0x1a2b=function(_0x114f87,_0x128e6e){_0x114f87=_0x114f87-0x0;var _0xbf0eb8=_0xa2b1[_0x114f87];return _0xbf0eb8;};'use strict';var _=require(_0x1a2b('0x0'));var uuid=require('uuid');var util=require(_0x1a2b('0x1'));var logger=require(_0x1a2b('0x2'))(_0x1a2b('0x3'));var Agent=function(_0x1bcc49,_0x4e323d,_0xf4a71a,_0x5b8f54){this[_0x1a2b('0x4')]=uuid['v4']();this[_0x1a2b('0x5')]=_0x1bcc49;this['agent']=_0x4e323d;this[_0x1a2b('0x6')]=_0xf4a71a;this[_0x1a2b('0x3')]=_0x5b8f54;this[_0x1a2b('0x5')][_0x1a2b('0x7')](this[_0x1a2b('0x8')][_0x1a2b('0x9')](this),this[_0x1a2b('0xa')][_0x1a2b('0x9')](this));this[_0x1a2b('0x5')]['on'](_0x1a2b('0xb'),this[_0x1a2b('0xa')][_0x1a2b('0x9')](this));this[_0x1a2b('0x5')]['on'](_0x1a2b('0xc'),this[_0x1a2b('0xd')][_0x1a2b('0x9')](this));};Agent[_0x1a2b('0xe')][_0x1a2b('0x7')]=function(){this['squeue'][_0x1a2b('0x7')](this[_0x1a2b('0x8')][_0x1a2b('0x9')](this),this['handleTimeout'][_0x1a2b('0x9')](this));};Agent['prototype'][_0x1a2b('0xd')]=function(){this[_0x1a2b('0xa')](!![]);};Agent[_0x1a2b('0xe')]['handleRun']=function(_0x1c0354){logger[_0x1a2b('0xf')](_0x1a2b('0x10'),this[_0x1a2b('0x5')]['id'],this[_0x1a2b('0x11')]['id']);if(_[_0x1a2b('0x12')](this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']])){logger[_0x1a2b('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1a2b('0x5')]['id'],this[_0x1a2b('0x11')]['id']);setTimeout(this[_0x1a2b('0x7')][_0x1a2b('0x9')](this),0x3e8);}else{if(this[_0x1a2b('0x3')][_0x1a2b('0x14')]||util[_0x1a2b('0x15')](this[_0x1a2b('0x5')]['id'],this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']],this[_0x1a2b('0x5')][_0x1a2b('0x16')],![])){this[_0x1a2b('0x6')]['agents'][this[_0x1a2b('0x11')]['id']][_0x1a2b('0x17')]=!![];this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']][_0x1a2b('0x18')]=undefined;util['showNotification'](this['notificationId'],this[_0x1a2b('0x5')]['id'],this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']],null,this['routing']);util[_0x1a2b('0x19')](this[_0x1a2b('0x5')]['id'],this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']],_0x1a2b('0x1a')+(this[_0x1a2b('0x3')][_0x1a2b('0x14')]?_0x1a2b('0x1b'):''));}else{logger[_0x1a2b('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x1a2b('0x5')]['id'],this[_0x1a2b('0x11')]['id']);setTimeout(this['push'][_0x1a2b('0x9')](this),0x3e8);}}};Agent[_0x1a2b('0xe')][_0x1a2b('0xa')]=function(_0x1689e9){if(_[_0x1a2b('0x12')](this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x1a2b('0x11')]['id']);}else{logger[_0x1a2b('0xf')](_0x1a2b('0x1c'),this['squeue']['id'],this[_0x1a2b('0x11')]['id']);util['hideNotification'](this['notificationId'],this[_0x1a2b('0x5')]['id'],this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']],null,this[_0x1a2b('0x3')]);this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']][_0x1a2b('0x17')]=![];this['realtime']['agents'][this[_0x1a2b('0x11')]['id']][_0x1a2b('0x18')]=undefined;util[_0x1a2b('0x19')](this['squeue']['id'],this[_0x1a2b('0x6')][_0x1a2b('0x13')][this[_0x1a2b('0x11')]['id']],_0x1689e9?'STOP':_0x1a2b('0x1d'));}if(!_0x1689e9){setTimeout(this[_0x1a2b('0x7')][_0x1a2b('0x9')](this),0x3e8);}};function agent(_0x4b6bd4,_0x186377,_0x50c49e,_0x3581a0){return new Agent(_0x4b6bd4,_0x186377,_0x50c49e,_0x3581a0);}module[_0x1a2b('0x1e')]=agent;
\ No newline at end of file
+var _0x6a03=[':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','lodash','uuid','../../../../../config/logger','squeue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','agents','busy','busyQueue','showNotification','notificationId','writeLog','RINGING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6a03,0xf3));var _0x36a0=function(_0x2cb06d,_0x15c601){_0x2cb06d=_0x2cb06d-0x0;var _0x24fdec=_0x6a03[_0x2cb06d];return _0x24fdec;};'use strict';var _=require(_0x36a0('0x0'));var uuid=require(_0x36a0('0x1'));var util=require('./util');var logger=require(_0x36a0('0x2'))('routing');var Agent=function(_0x3b2e73,_0x118e8b,_0x1d472c,_0x1cfd94){this['notificationId']=uuid['v4']();this[_0x36a0('0x3')]=_0x3b2e73;this['agent']=_0x118e8b;this[_0x36a0('0x4')]=_0x1d472c;this[_0x36a0('0x5')]=_0x1cfd94;this[_0x36a0('0x3')][_0x36a0('0x6')](this[_0x36a0('0x7')][_0x36a0('0x8')](this),this[_0x36a0('0x9')][_0x36a0('0x8')](this));this[_0x36a0('0x3')]['on'](_0x36a0('0xa'),this['handleTimeout'][_0x36a0('0x8')](this));this[_0x36a0('0x3')]['on'](_0x36a0('0xb'),this[_0x36a0('0xc')][_0x36a0('0x8')](this));};Agent[_0x36a0('0xd')]['push']=function(){this[_0x36a0('0x3')][_0x36a0('0x6')](this[_0x36a0('0x7')][_0x36a0('0x8')](this),this[_0x36a0('0x9')][_0x36a0('0x8')](this));};Agent[_0x36a0('0xd')][_0x36a0('0xc')]=function(){this[_0x36a0('0x9')](!![]);};Agent[_0x36a0('0xd')][_0x36a0('0x7')]=function(_0x4e44f6){logger[_0x36a0('0xe')](_0x36a0('0xf'),this[_0x36a0('0x3')]['id'],this['agent']['id']);if(_[_0x36a0('0x10')](this['realtime']['agents'][this[_0x36a0('0x11')]['id']])){logger['info'](_0x36a0('0x12'),this[_0x36a0('0x3')]['id'],this[_0x36a0('0x11')]['id']);setTimeout(this[_0x36a0('0x6')][_0x36a0('0x8')](this),0x3e8);}else{if(this[_0x36a0('0x5')][_0x36a0('0x13')]||util[_0x36a0('0x14')](this[_0x36a0('0x3')]['id'],this['realtime']['agents'][this[_0x36a0('0x11')]['id']],this['squeue'][_0x36a0('0x15')],![])){this[_0x36a0('0x4')][_0x36a0('0x16')][this[_0x36a0('0x11')]['id']][_0x36a0('0x17')]=!![];this[_0x36a0('0x4')][_0x36a0('0x16')][this[_0x36a0('0x11')]['id']][_0x36a0('0x18')]=undefined;util[_0x36a0('0x19')](this[_0x36a0('0x1a')],this[_0x36a0('0x3')]['id'],this[_0x36a0('0x4')][_0x36a0('0x16')][this[_0x36a0('0x11')]['id']],null,this[_0x36a0('0x5')]);util[_0x36a0('0x1b')](this[_0x36a0('0x3')]['id'],this[_0x36a0('0x4')]['agents'][this['agent']['id']],_0x36a0('0x1c')+(this[_0x36a0('0x5')][_0x36a0('0x13')]?_0x36a0('0x1d'):''));}else{logger[_0x36a0('0xe')](_0x36a0('0x1e'),this[_0x36a0('0x3')]['id'],this[_0x36a0('0x11')]['id']);setTimeout(this[_0x36a0('0x6')][_0x36a0('0x8')](this),0x3e8);}}};Agent[_0x36a0('0xd')][_0x36a0('0x9')]=function(_0x1bdd23){if(_[_0x36a0('0x10')](this[_0x36a0('0x4')][_0x36a0('0x16')][this['agent']['id']])){return logger[_0x36a0('0xe')](_0x36a0('0x12'),this[_0x36a0('0x3')]['id'],this['agent']['id']);}else{logger[_0x36a0('0xe')](_0x36a0('0x1f'),this[_0x36a0('0x3')]['id'],this[_0x36a0('0x11')]['id']);util[_0x36a0('0x20')](this['notificationId'],this[_0x36a0('0x3')]['id'],this[_0x36a0('0x4')][_0x36a0('0x16')][this[_0x36a0('0x11')]['id']],null,this[_0x36a0('0x5')]);this[_0x36a0('0x4')][_0x36a0('0x16')][this[_0x36a0('0x11')]['id']]['busy']=![];this[_0x36a0('0x4')]['agents'][this[_0x36a0('0x11')]['id']]['busyQueue']=undefined;util['writeLog'](this['squeue']['id'],this[_0x36a0('0x4')][_0x36a0('0x16')][this[_0x36a0('0x11')]['id']],_0x1bdd23?_0x36a0('0x21'):'TIMEOUT');}if(!_0x1bdd23){setTimeout(this[_0x36a0('0x6')][_0x36a0('0x8')](this),0x3e8);}};function agent(_0x2ae419,_0x4d6f3d,_0x376e62,_0x35f1e4){return new Agent(_0x2ae419,_0x4d6f3d,_0x376e62,_0x35f1e4);}module['exports']=agent;
\ No newline at end of file
index 1af345a..02d4ced 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab0=['bind','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','busy','exports','uuid','./util','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','push','handleRun','handleTimeout'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4ab0,0xd5));var _0x04ab=function(_0x344412,_0x4a5ee2){_0x344412=_0x344412-0x0;var _0x3a452e=_0x4ab0[_0x344412];return _0x3a452e;};'use strict';var _=require('lodash');var uuid=require(_0x04ab('0x0'));var util=require(_0x04ab('0x1'));var logger=require(_0x04ab('0x2'))(_0x04ab('0x3'));var Beepall=function(_0x3a7b9f,_0x51135e,_0x4c3a53,_0x45dfee){this[_0x04ab('0x4')]=uuid['v4']();this['squeue']=_0x3a7b9f;this[_0x04ab('0x5')]=_0x51135e;this[_0x04ab('0x6')]=_0x4c3a53;this['routing']=_0x45dfee;this[_0x04ab('0x7')][_0x04ab('0x8')](this[_0x04ab('0x9')]['bind'](this),this[_0x04ab('0xa')][_0x04ab('0xb')](this));this[_0x04ab('0x7')]['on'](_0x04ab('0xc'),this['handleTimeout'][_0x04ab('0xb')](this));this[_0x04ab('0x7')]['on'](_0x04ab('0xd'),this[_0x04ab('0xe')]['bind'](this));};Beepall[_0x04ab('0xf')][_0x04ab('0x8')]=function(){this[_0x04ab('0x7')][_0x04ab('0x8')](this[_0x04ab('0x9')][_0x04ab('0xb')](this),this['handleTimeout'][_0x04ab('0xb')](this));};Beepall['prototype'][_0x04ab('0xe')]=function(_0xef8710){this[_0x04ab('0xa')](!![]);};Beepall[_0x04ab('0xf')]['handleRun']=function(_0x5eef81){var _0x58aef3=!![];if(!_[_0x04ab('0x10')](this[_0x04ab('0x5')])&&!_[_0x04ab('0x10')](this[_0x04ab('0x5')][_0x04ab('0x11')])&&this[_0x04ab('0x5')][_0x04ab('0x11')][_0x04ab('0x12')]>0x0){for(var _0x1f3251=0x0,_0x205600;_0x1f3251<this['queue'][_0x04ab('0x11')][_0x04ab('0x12')];_0x1f3251+=0x1){_0x205600=this[_0x04ab('0x5')][_0x04ab('0x11')][_0x1f3251]['id'];if(_[_0x04ab('0x10')](this[_0x04ab('0x6')][_0x04ab('0x13')][_0x205600])){logger[_0x04ab('0x14')](_0x04ab('0x15'),this['squeue']['id'],_0x205600);}else{if(util[_0x04ab('0x16')](this['squeue']['id'],this[_0x04ab('0x6')][_0x04ab('0x13')][_0x205600],this[_0x04ab('0x7')]['channel'],!![])){_0x58aef3=![];util[_0x04ab('0x17')](this[_0x04ab('0x7')]['id'],this[_0x04ab('0x6')]['agents'][_0x205600],'RINGING');this[_0x04ab('0x6')][_0x04ab('0x13')][_0x205600]['busy']=!![];this['realtime'][_0x04ab('0x13')][_0x205600][_0x04ab('0x18')]=this[_0x04ab('0x5')][_0x04ab('0x19')];util[_0x04ab('0x1a')](this[_0x04ab('0x4')],this[_0x04ab('0x7')]['id'],this[_0x04ab('0x6')][_0x04ab('0x13')][_0x205600],this['queue'],this[_0x04ab('0x3')]);}}}if(_0x58aef3){logger[_0x04ab('0x14')](_0x04ab('0x1b'),this[_0x04ab('0x7')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}else{logger[_0x04ab('0x14')]('[%s][QUEUE]\x20EMPTY',this[_0x04ab('0x7')]['id']);setTimeout(this[_0x04ab('0x8')][_0x04ab('0xb')](this),0x3e8);}};Beepall[_0x04ab('0xf')][_0x04ab('0xa')]=function(_0x5596fc){if(!_['isNil'](this[_0x04ab('0x5')])&&!_[_0x04ab('0x10')](this[_0x04ab('0x5')][_0x04ab('0x11')])){for(var _0x1ac676=0x0,_0x459e8c;_0x1ac676<this[_0x04ab('0x5')][_0x04ab('0x11')][_0x04ab('0x12')];_0x1ac676+=0x1){_0x459e8c=this[_0x04ab('0x5')][_0x04ab('0x11')][_0x1ac676]['id'];if(_[_0x04ab('0x10')](this[_0x04ab('0x6')]['agents'][_0x459e8c])){logger[_0x04ab('0x14')](_0x04ab('0x15'),this['squeue']['id'],_0x459e8c);}else{util[_0x04ab('0x1c')](this[_0x04ab('0x4')],this['squeue']['id'],this[_0x04ab('0x6')][_0x04ab('0x13')][_0x459e8c],this['queue'],this[_0x04ab('0x3')]);util[_0x04ab('0x17')](this[_0x04ab('0x7')]['id'],this[_0x04ab('0x6')][_0x04ab('0x13')][_0x459e8c],_0x5596fc?_0x04ab('0x1d'):'TIMEOUT');this[_0x04ab('0x6')][_0x04ab('0x13')][_0x459e8c][_0x04ab('0x1e')]=![];this['realtime'][_0x04ab('0x13')][_0x459e8c]['busyQueue']=undefined;}}}if(!_0x5596fc){setTimeout(this['push'][_0x04ab('0xb')](this),0x3e8);}};function beepall(_0x3b7b51,_0x5569ba,_0x40995c,_0x487093){return new Beepall(_0x3b7b51,_0x5569ba,_0x40995c,_0x487093);}module[_0x04ab('0x1f')]=beepall;
\ No newline at end of file
+var _0x27c9=['hideNotification','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','routing','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0x27c9,0x1af));var _0x927c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x27c9[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x927c('0x0'));var uuid=require(_0x927c('0x1'));var util=require(_0x927c('0x2'));var logger=require(_0x927c('0x3'))('routing');var Beepall=function(_0x105c50,_0x4ee9fa,_0x591cb0,_0x3a091e){this[_0x927c('0x4')]=uuid['v4']();this[_0x927c('0x5')]=_0x105c50;this[_0x927c('0x6')]=_0x4ee9fa;this[_0x927c('0x7')]=_0x591cb0;this['routing']=_0x3a091e;this[_0x927c('0x5')][_0x927c('0x8')](this[_0x927c('0x9')]['bind'](this),this[_0x927c('0xa')][_0x927c('0xb')](this));this[_0x927c('0x5')]['on']('timeout',this[_0x927c('0xa')][_0x927c('0xb')](this));this[_0x927c('0x5')]['on'](_0x927c('0xc'),this[_0x927c('0xd')][_0x927c('0xb')](this));};Beepall[_0x927c('0xe')][_0x927c('0x8')]=function(){this['squeue']['push'](this[_0x927c('0x9')][_0x927c('0xb')](this),this[_0x927c('0xa')][_0x927c('0xb')](this));};Beepall['prototype'][_0x927c('0xd')]=function(_0x4ffdc6){this['handleTimeout'](!![]);};Beepall[_0x927c('0xe')][_0x927c('0x9')]=function(_0x3751a2){var _0xb24ff4=!![];if(!_[_0x927c('0xf')](this[_0x927c('0x6')])&&!_[_0x927c('0xf')](this[_0x927c('0x6')][_0x927c('0x10')])&&this[_0x927c('0x6')][_0x927c('0x10')][_0x927c('0x11')]>0x0){for(var _0x5cde06=0x0,_0x312e52;_0x5cde06<this[_0x927c('0x6')]['Agents'][_0x927c('0x11')];_0x5cde06+=0x1){_0x312e52=this[_0x927c('0x6')]['Agents'][_0x5cde06]['id'];if(_[_0x927c('0xf')](this[_0x927c('0x7')][_0x927c('0x12')][_0x312e52])){logger[_0x927c('0x13')](_0x927c('0x14'),this['squeue']['id'],_0x312e52);}else{if(util['isAgentAvailable'](this['squeue']['id'],this[_0x927c('0x7')][_0x927c('0x12')][_0x312e52],this[_0x927c('0x5')][_0x927c('0x15')],!![])){_0xb24ff4=![];util[_0x927c('0x16')](this[_0x927c('0x5')]['id'],this['realtime'][_0x927c('0x12')][_0x312e52],_0x927c('0x17'));this[_0x927c('0x7')][_0x927c('0x12')][_0x312e52][_0x927c('0x18')]=!![];this[_0x927c('0x7')]['agents'][_0x312e52][_0x927c('0x19')]=this[_0x927c('0x6')][_0x927c('0x1a')];util[_0x927c('0x1b')](this['notificationId'],this[_0x927c('0x5')]['id'],this[_0x927c('0x7')][_0x927c('0x12')][_0x312e52],this[_0x927c('0x6')],this[_0x927c('0x1c')]);}}}if(_0xb24ff4){logger['info'](_0x927c('0x1d'),this[_0x927c('0x5')]['id']);setTimeout(this[_0x927c('0x8')]['bind'](this),0x3e8);}}else{logger[_0x927c('0x13')](_0x927c('0x1e'),this[_0x927c('0x5')]['id']);setTimeout(this[_0x927c('0x8')][_0x927c('0xb')](this),0x3e8);}};Beepall[_0x927c('0xe')][_0x927c('0xa')]=function(_0x56e01e){if(!_[_0x927c('0xf')](this[_0x927c('0x6')])&&!_[_0x927c('0xf')](this[_0x927c('0x6')][_0x927c('0x10')])){for(var _0x2577cf=0x0,_0x31fd00;_0x2577cf<this[_0x927c('0x6')][_0x927c('0x10')][_0x927c('0x11')];_0x2577cf+=0x1){_0x31fd00=this['queue'][_0x927c('0x10')][_0x2577cf]['id'];if(_[_0x927c('0xf')](this[_0x927c('0x7')]['agents'][_0x31fd00])){logger[_0x927c('0x13')](_0x927c('0x14'),this[_0x927c('0x5')]['id'],_0x31fd00);}else{util[_0x927c('0x1f')](this['notificationId'],this[_0x927c('0x5')]['id'],this[_0x927c('0x7')][_0x927c('0x12')][_0x31fd00],this[_0x927c('0x6')],this['routing']);util[_0x927c('0x16')](this['squeue']['id'],this['realtime'][_0x927c('0x12')][_0x31fd00],_0x56e01e?'STOP':_0x927c('0x20'));this['realtime'][_0x927c('0x12')][_0x31fd00][_0x927c('0x18')]=![];this[_0x927c('0x7')][_0x927c('0x12')][_0x31fd00][_0x927c('0x19')]=undefined;}}}if(!_0x56e01e){setTimeout(this['push'][_0x927c('0xb')](this),0x3e8);}};function beepall(_0x11e3f0,_0x2dc51c,_0x55e093,_0xe8b53a){return new Beepall(_0x11e3f0,_0x2dc51c,_0x55e093,_0xe8b53a);}module['exports']=beepall;
\ No newline at end of file
index ecc85ec..c740bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9668=['./beepall','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9668,0x99));var _0x8966=function(_0x9da1a9,_0x28bc26){_0x9da1a9=_0x9da1a9-0x0;var _0x34d732=_0x9668[_0x9da1a9];return _0x34d732;};'use strict';module[_0x8966('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x8966('0x1')),'agent':require('./agent')};
\ No newline at end of file
+var _0xfc5b=['./beepall','./agent','exports','./rrmemory'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xfc5b,0xe6));var _0xbfc5=function(_0x34cc95,_0x479ef5){_0x34cc95=_0x34cc95-0x0;var _0x28698e=_0xfc5b[_0x34cc95];return _0x28698e;};'use strict';module[_0xbfc5('0x0')]={'rrmemory':require(_0xbfc5('0x1')),'beepall':require(_0xbfc5('0x2')),'agent':require(_0xbfc5('0x3'))};
\ No newline at end of file
index 3aa4306..21a73d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2810=['isAgentAvailable','agents','agentId','info','[%s][QUEUE]\x20available\x20again\x20%s','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','name','showNotification','writeLog','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','isNil','TIMEOUT','busyQueue','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','intervals','handleRun','bind','handleTimeout','module','drained','handleDrained','prototype','push','handleCheckReject'];(function(_0xa611df,_0x2131ad){var _0x2be9d9=function(_0x5a778a){while(--_0x5a778a){_0xa611df['push'](_0xa611df['shift']());}};_0x2be9d9(++_0x2131ad);}(_0x2810,0x10e));var _0x0281=function(_0x5dcb43,_0x292f66){_0x5dcb43=_0x5dcb43-0x0;var _0x2e501d=_0x2810[_0x5dcb43];return _0x2e501d;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x0281('0x0'));var util=require(_0x0281('0x1'));var logger=require(_0x0281('0x2'))(_0x0281('0x3'));var RRMemory=function(_0x5dc629,_0x538d45,_0x53d088,_0x3b2c4f){this[_0x0281('0x4')]=uuid['v4']();this[_0x0281('0x5')]=_0x5dc629;this[_0x0281('0x6')]=_0x538d45;this[_0x0281('0x7')]=_0x53d088;this[_0x0281('0x3')]=_0x3b2c4f;this[_0x0281('0x8')]={};this[_0x0281('0x5')]['push'](this[_0x0281('0x9')][_0x0281('0xa')](this),this[_0x0281('0xb')]['bind'](this),this[_0x0281('0xc')]);this[_0x0281('0x5')]['on']('timeout',this[_0x0281('0xb')][_0x0281('0xa')](this));this[_0x0281('0x5')]['on'](_0x0281('0xd'),this[_0x0281('0xe')][_0x0281('0xa')](this));};RRMemory[_0x0281('0xf')]['push']=function(){this[_0x0281('0x5')][_0x0281('0x10')](this[_0x0281('0x9')][_0x0281('0xa')](this),this[_0x0281('0xb')][_0x0281('0xa')](this));};RRMemory[_0x0281('0xf')][_0x0281('0xe')]=function(_0xc98159){this['handleTimeout'](!![]);};RRMemory[_0x0281('0xf')][_0x0281('0x11')]=function(_0x41f345){if(util[_0x0281('0x12')](this[_0x0281('0x5')]['id'],this[_0x0281('0x7')][_0x0281('0x13')][this[_0x0281('0x14')]],this[_0x0281('0x5')]['channel'],!![])){logger[_0x0281('0x15')](_0x0281('0x16'),this[_0x0281('0x5')]['id'],this['agentId']);clearInterval(this[_0x0281('0x8')][this[_0x0281('0x14')]]);_0x41f345[_0x0281('0x17')]();setTimeout(this[_0x0281('0x10')]['bind'](this),0x3e8);}};RRMemory[_0x0281('0xf')][_0x0281('0x9')]=function(_0x2525e8){this[_0x0281('0x14')]=rr(this['queue'][_0x0281('0x18')]);logger[_0x0281('0x15')](_0x0281('0x19'),this[_0x0281('0x5')]['id'],this[_0x0281('0x14')]);if(_['isNil'](this[_0x0281('0x7')][_0x0281('0x13')][this['agentId']])){logger[_0x0281('0x15')](_0x0281('0x1a'),this[_0x0281('0x5')]['id'],this['agentId']);_0x2525e8[_0x0281('0x17')]();setTimeout(this[_0x0281('0x10')][_0x0281('0xa')](this),0x3e8);}else{if(util[_0x0281('0x12')](this[_0x0281('0x5')]['id'],this[_0x0281('0x7')][_0x0281('0x13')][this[_0x0281('0x14')]],this['squeue'][_0x0281('0x1b')],!![])){this[_0x0281('0x7')]['agents'][this[_0x0281('0x14')]][_0x0281('0x1c')]=!![];this[_0x0281('0x7')][_0x0281('0x13')][this[_0x0281('0x14')]]['busyQueue']=this[_0x0281('0x6')][_0x0281('0x1d')];util[_0x0281('0x1e')](this['notificationId'],this[_0x0281('0x5')]['id'],this[_0x0281('0x7')]['agents'][this['agentId']],this['queue'],this[_0x0281('0x3')]);util[_0x0281('0x1f')](this[_0x0281('0x5')]['id'],this[_0x0281('0x7')]['agents'][this[_0x0281('0x14')]],'RINGING');this[_0x0281('0x8')][this[_0x0281('0x14')]]=setInterval(this[_0x0281('0x11')][_0x0281('0xa')](this,_0x2525e8),0x3e8);}else{logger['info'](_0x0281('0x20'),this['squeue']['id'],this[_0x0281('0x14')]);_0x2525e8[_0x0281('0x17')]();setTimeout(this[_0x0281('0x10')][_0x0281('0xa')](this),0x3e8);}}};RRMemory[_0x0281('0xf')][_0x0281('0xb')]=function(_0x29628e){logger[_0x0281('0x15')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0x0281('0x5')]['id'],this['agentId']);if(_[_0x0281('0x21')](this[_0x0281('0x7')][_0x0281('0x13')][this[_0x0281('0x14')]])){logger[_0x0281('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x0281('0x14')]);}else{clearInterval(this[_0x0281('0x8')][this[_0x0281('0x14')]]);util['hideNotification'](this['notificationId'],this['squeue']['id'],this[_0x0281('0x7')]['agents'][this[_0x0281('0x14')]],this[_0x0281('0x6')],this[_0x0281('0x3')]);util[_0x0281('0x1f')](this[_0x0281('0x5')]['id'],this['realtime'][_0x0281('0x13')][this['agentId']],_0x0281('0x22'));this[_0x0281('0x7')][_0x0281('0x13')][this[_0x0281('0x14')]]['busy']=![];this[_0x0281('0x7')]['agents'][this[_0x0281('0x14')]][_0x0281('0x23')]=undefined;}if(!_0x29628e){setTimeout(this['push']['bind'](this),0x3e8);}};function rrmemory(_0x48d23d,_0x31796a,_0x1a653a,_0xef21e7){return new RRMemory(_0x48d23d,_0x31796a,_0x1a653a,_0xef21e7);}module['exports']=rrmemory;
\ No newline at end of file
+var _0x2fe2=['isNil','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','notificationId','squeue','realtime','routing','intervals','push','handleRun','bind','handleTimeout','module','timeout','drained','prototype','handleDrained','handleCheckReject','isAgentAvailable','agents','agentId','channel','[%s][QUEUE]\x20available\x20again\x20%s','done','queue','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s'];(function(_0x18e6cf,_0x22b3f0){var _0x10e871=function(_0x3accc7){while(--_0x3accc7){_0x18e6cf['push'](_0x18e6cf['shift']());}};_0x10e871(++_0x22b3f0);}(_0x2fe2,0x1ed));var _0x22fe=function(_0x17f743,_0xa0e705){_0x17f743=_0x17f743-0x0;var _0x51636d=_0x2fe2[_0x17f743];return _0x51636d;};'use strict';var rr=require('rr');var _=require(_0x22fe('0x0'));var uuid=require(_0x22fe('0x1'));var util=require(_0x22fe('0x2'));var logger=require('../../../../../config/logger')('routing');var RRMemory=function(_0x57f712,_0xe21f,_0x468fe5,_0x583228){this[_0x22fe('0x3')]=uuid['v4']();this[_0x22fe('0x4')]=_0x57f712;this['queue']=_0xe21f;this[_0x22fe('0x5')]=_0x468fe5;this[_0x22fe('0x6')]=_0x583228;this[_0x22fe('0x7')]={};this[_0x22fe('0x4')][_0x22fe('0x8')](this[_0x22fe('0x9')][_0x22fe('0xa')](this),this[_0x22fe('0xb')][_0x22fe('0xa')](this),this[_0x22fe('0xc')]);this['squeue']['on'](_0x22fe('0xd'),this[_0x22fe('0xb')][_0x22fe('0xa')](this));this['squeue']['on'](_0x22fe('0xe'),this['handleDrained'][_0x22fe('0xa')](this));};RRMemory[_0x22fe('0xf')]['push']=function(){this[_0x22fe('0x4')]['push'](this[_0x22fe('0x9')][_0x22fe('0xa')](this),this[_0x22fe('0xb')][_0x22fe('0xa')](this));};RRMemory['prototype'][_0x22fe('0x10')]=function(_0x4f2a47){this[_0x22fe('0xb')](!![]);};RRMemory[_0x22fe('0xf')][_0x22fe('0x11')]=function(_0x4f5725){if(util[_0x22fe('0x12')](this[_0x22fe('0x4')]['id'],this['realtime'][_0x22fe('0x13')][this[_0x22fe('0x14')]],this[_0x22fe('0x4')][_0x22fe('0x15')],!![])){logger['info'](_0x22fe('0x16'),this['squeue']['id'],this[_0x22fe('0x14')]);clearInterval(this['intervals'][this[_0x22fe('0x14')]]);_0x4f5725[_0x22fe('0x17')]();setTimeout(this[_0x22fe('0x8')][_0x22fe('0xa')](this),0x3e8);}};RRMemory[_0x22fe('0xf')][_0x22fe('0x9')]=function(_0xf226f7){this[_0x22fe('0x14')]=rr(this[_0x22fe('0x18')][_0x22fe('0x19')]);logger['info'](_0x22fe('0x1a'),this[_0x22fe('0x4')]['id'],this[_0x22fe('0x14')]);if(_[_0x22fe('0x1b')](this[_0x22fe('0x5')][_0x22fe('0x13')][this['agentId']])){logger[_0x22fe('0x1c')](_0x22fe('0x1d'),this['squeue']['id'],this[_0x22fe('0x14')]);_0xf226f7[_0x22fe('0x17')]();setTimeout(this[_0x22fe('0x8')][_0x22fe('0xa')](this),0x3e8);}else{if(util[_0x22fe('0x12')](this[_0x22fe('0x4')]['id'],this[_0x22fe('0x5')][_0x22fe('0x13')][this[_0x22fe('0x14')]],this[_0x22fe('0x4')]['channel'],!![])){this[_0x22fe('0x5')][_0x22fe('0x13')][this[_0x22fe('0x14')]][_0x22fe('0x1e')]=!![];this[_0x22fe('0x5')][_0x22fe('0x13')][this[_0x22fe('0x14')]][_0x22fe('0x1f')]=this[_0x22fe('0x18')]['name'];util[_0x22fe('0x20')](this[_0x22fe('0x3')],this[_0x22fe('0x4')]['id'],this['realtime'][_0x22fe('0x13')][this[_0x22fe('0x14')]],this['queue'],this[_0x22fe('0x6')]);util[_0x22fe('0x21')](this['squeue']['id'],this[_0x22fe('0x5')][_0x22fe('0x13')][this['agentId']],_0x22fe('0x22'));this[_0x22fe('0x7')][this['agentId']]=setInterval(this['handleCheckReject'][_0x22fe('0xa')](this,_0xf226f7),0x3e8);}else{logger['info'](_0x22fe('0x23'),this['squeue']['id'],this['agentId']);_0xf226f7[_0x22fe('0x17')]();setTimeout(this['push'][_0x22fe('0xa')](this),0x3e8);}}};RRMemory['prototype'][_0x22fe('0xb')]=function(_0x4c1028){logger[_0x22fe('0x1c')](_0x22fe('0x24'),this[_0x22fe('0x4')]['id'],this[_0x22fe('0x14')]);if(_[_0x22fe('0x1b')](this['realtime'][_0x22fe('0x13')][this[_0x22fe('0x14')]])){logger[_0x22fe('0x1c')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x22fe('0x4')]['id'],this['agentId']);}else{clearInterval(this[_0x22fe('0x7')][this[_0x22fe('0x14')]]);util[_0x22fe('0x25')](this[_0x22fe('0x3')],this[_0x22fe('0x4')]['id'],this[_0x22fe('0x5')][_0x22fe('0x13')][this[_0x22fe('0x14')]],this[_0x22fe('0x18')],this[_0x22fe('0x6')]);util['writeLog'](this[_0x22fe('0x4')]['id'],this['realtime'][_0x22fe('0x13')][this['agentId']],_0x22fe('0x26'));this[_0x22fe('0x5')][_0x22fe('0x13')][this[_0x22fe('0x14')]][_0x22fe('0x1e')]=![];this[_0x22fe('0x5')][_0x22fe('0x13')][this[_0x22fe('0x14')]][_0x22fe('0x1f')]=undefined;}if(!_0x4c1028){setTimeout(this['push'][_0x22fe('0xa')](this),0x3e8);}};function rrmemory(_0x3a3a10,_0x4f53a0,_0x33cf8b,_0x49108b){return new RRMemory(_0x3a3a10,_0x4f53a0,_0x33cf8b,_0x49108b);}module[_0x22fe('0x27')]=rrmemory;
\ No newline at end of file
index af8acf6..4dbb67a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','info','isAgentAvailable','busy','BUSY','online','OFFLINE','Capacity','hasOwnProperty'];(function(_0x493c48,_0x4a41a8){var _0x598d76=function(_0xf25c10){while(--_0xf25c10){_0x493c48['push'](_0x493c48['shift']());}};_0x598d76(++_0x4a41a8);}(_0x326f,0xd1));var _0xf326=function(_0x42c974,_0x834afb){_0x42c974=_0x42c974-0x0;var _0x55f424=_0x326f[_0x42c974];return _0x55f424;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var config=require(_0xf326('0x3'));var logger=require(_0xf326('0x4'))(_0xf326('0x5'));config[_0xf326('0x6')]=_[_0xf326('0x7')](config[_0xf326('0x6')],{'host':_0xf326('0x8'),'port':0x18eb});var io=require(_0xf326('0x9'))(new Redis(config['redis']));function emit(_0x3c254d,_0x3851eb,_0x165f95){io['to'](_0x3c254d)[_0xf326('0xa')](_0x3851eb,_0x165f95);}function sendNotification(_0x515bfa,_0x4c206c,_0x592975,_0x3bacf2,_0x1fc80e,_0x163416){io['to'](util[_0xf326('0xb')](_0xf326('0xc'),_0x3bacf2['name']))[_0xf326('0xa')]('user:save',_0x3bacf2);var _0x1cf441=_0x163416||{};var _0x4aaf3a=_0x592975[_0xf326('0xd')]('.');var _0x518ab5={'uniqueid':_0x4c206c,'channel':_0x4aaf3a[0x0],'id':_0x4aaf3a[0x1],'title':_0x4aaf3a[0x0]+_0xf326('0xe'),'interactionId':_0x4aaf3a[0x2],'queue':_0x1fc80e?_0x1fc80e[_0xf326('0xf')]:null,'sound':_0x1cf441['account'][_0xf326('0x10')],'shake':_0x1cf441[_0xf326('0x11')][_0xf326('0x12')]};try{if(!_0x1cf441[_0xf326('0x13')]){_0x1cf441['body']={};}if(_0x1fc80e){_0x1cf441[_0xf326('0x13')]['queue']=_0x1fc80e;}else if(_0x1cf441['body'][_0xf326('0x14')]){delete _0x1cf441[_0xf326('0x13')][_0xf326('0x14')];}_0x518ab5[_0xf326('0x15')]=utils[_0xf326('0x16')](_0x1cf441[_0xf326('0x11')][_0xf326('0x17')],_0x1cf441);}catch(_0x2cf2ca){_0x518ab5['msg']=_0xf326('0x18');logger[_0xf326('0x19')](util[_0xf326('0xb')](_0xf326('0x1a'),_0x4c206c,_0x2cf2ca[_0xf326('0x1b')]));}io['to'](util[_0xf326('0xb')]('user:%s',_0x3bacf2['name']))['emit'](util[_0xf326('0xb')](_0xf326('0x1c'),_0x515bfa?'save':'remove'),_0x518ab5);}function writeLog(_0x128c68,_0x4dfa76,_0x5b6d3c){return logger[_0xf326('0x1d')](util[_0xf326('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x128c68,_0x4dfa76['name'],_0x5b6d3c));}exports[_0xf326('0x1e')]=function(_0xb1efcf,_0x5f21a2,_0x337ed5,_0x1b9039){if(_0x5f21a2[_0xf326('0x1f')]){writeLog(_0xb1efcf,_0x5f21a2,_0xf326('0x20'));return![];}if(!_0x5f21a2[_0xf326('0x21')]){writeLog(_0xb1efcf,_0x5f21a2,_0xf326('0x22'));return![];}if(_0x5f21a2[_0x337ed5+'Pause']){writeLog(_0xb1efcf,_0x5f21a2,'PAUSE');return![];}if(_0x1b9039&&_0x5f21a2['hasOwnProperty'](_0x337ed5+_0xf326('0x23'))&&_0x5f21a2[_0xf326('0x24')](_0x337ed5+_0xf326('0x25'))){if(_0x5f21a2[_0x337ed5+_0xf326('0x23')]>0x0&&_0x5f21a2[_0x337ed5+_0xf326('0x25')]>=_0x5f21a2[_0x337ed5+_0xf326('0x23')]){writeLog(_0xb1efcf,_0x5f21a2,_0x337ed5['toUpperCase']()+_0xf326('0x26'));return![];}}return!![];};exports[_0xf326('0x27')]=function(_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf){return sendNotification(!![],_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf);};exports[_0xf326('0x28')]=function(_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500){return sendNotification(![],_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x7c09=['[%s][QUEUE]\x20%s','message','user:%s','notification:%s','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','emit','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','error','format'];(function(_0xd8ca9,_0x323ade){var _0x13f7e7=function(_0x43bdbe){while(--_0x43bdbe){_0xd8ca9['push'](_0xd8ca9['shift']());}};_0x13f7e7(++_0x323ade);}(_0x7c09,0x102));var _0x97c0=function(_0x1db7dd,_0x442811){_0x1db7dd=_0x1db7dd-0x0;var _0x284f84=_0x7c09[_0x1db7dd];return _0x284f84;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var utils=require(_0x97c0('0x1'));var Mustache=require('mustache');var Redis=require(_0x97c0('0x2'));var config=require(_0x97c0('0x3'));var logger=require(_0x97c0('0x4'))(_0x97c0('0x5'));config[_0x97c0('0x6')]=_[_0x97c0('0x7')](config[_0x97c0('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x46fdd9,_0x42c6c7,_0x2c19fa){io['to'](_0x46fdd9)[_0x97c0('0x8')](_0x42c6c7,_0x2c19fa);}function sendNotification(_0x293785,_0x57661a,_0x205520,_0x4ac5f1,_0x2d5507,_0x28cac4){io['to'](util['format']('user:%s',_0x4ac5f1[_0x97c0('0x9')]))[_0x97c0('0x8')](_0x97c0('0xa'),_0x4ac5f1);var _0x238ed9=_0x28cac4||{};var _0x346e34=_0x205520[_0x97c0('0xb')]('.');var _0x7fc93={'uniqueid':_0x57661a,'channel':_0x346e34[0x0],'id':_0x346e34[0x1],'title':_0x346e34[0x0]+_0x97c0('0xc'),'interactionId':_0x346e34[0x2],'queue':_0x2d5507?_0x2d5507[_0x97c0('0x9')]:null,'sound':_0x238ed9[_0x97c0('0xd')][_0x97c0('0xe')],'shake':_0x238ed9[_0x97c0('0xd')][_0x97c0('0xf')]};try{if(!_0x238ed9['body']){_0x238ed9[_0x97c0('0x10')]={};}if(_0x2d5507){_0x238ed9[_0x97c0('0x10')][_0x97c0('0x11')]=_0x2d5507;}else if(_0x238ed9['body'][_0x97c0('0x11')]){delete _0x238ed9[_0x97c0('0x10')][_0x97c0('0x11')];}_0x7fc93[_0x97c0('0x12')]=utils[_0x97c0('0x13')](_0x238ed9[_0x97c0('0xd')]['notificationTemplate'],_0x238ed9);}catch(_0x16fea6){_0x7fc93[_0x97c0('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x97c0('0x14')](util[_0x97c0('0x15')](_0x97c0('0x16'),_0x57661a,_0x16fea6[_0x97c0('0x17')]));}io['to'](util[_0x97c0('0x15')](_0x97c0('0x18'),_0x4ac5f1[_0x97c0('0x9')]))[_0x97c0('0x8')](util[_0x97c0('0x15')](_0x97c0('0x19'),_0x293785?'save':'remove'),_0x7fc93);}function writeLog(_0x2b74a2,_0xa3f59d,_0x169f19){return logger['info'](util[_0x97c0('0x15')](_0x97c0('0x1a'),_0x2b74a2,_0xa3f59d[_0x97c0('0x9')],_0x169f19));}exports[_0x97c0('0x1b')]=function(_0x30fba2,_0x3a0bfb,_0x9dff60,_0x5ac457){if(_0x3a0bfb[_0x97c0('0x1c')]){writeLog(_0x30fba2,_0x3a0bfb,_0x97c0('0x1d'));return![];}if(!_0x3a0bfb[_0x97c0('0x1e')]){writeLog(_0x30fba2,_0x3a0bfb,_0x97c0('0x1f'));return![];}if(_0x3a0bfb[_0x9dff60+'Pause']){writeLog(_0x30fba2,_0x3a0bfb,_0x97c0('0x20'));return![];}if(_0x5ac457&&_0x3a0bfb[_0x97c0('0x21')](_0x9dff60+'Capacity')&&_0x3a0bfb[_0x97c0('0x21')](_0x9dff60+_0x97c0('0x22'))){if(_0x3a0bfb[_0x9dff60+_0x97c0('0x23')]>0x0&&_0x3a0bfb[_0x9dff60+'CurrentCapacity']>=_0x3a0bfb[_0x9dff60+'Capacity']){writeLog(_0x30fba2,_0x3a0bfb,_0x9dff60['toUpperCase']()+_0x97c0('0x24'));return![];}}return!![];};exports[_0x97c0('0x25')]=function(_0x3a744c,_0x225e43,_0x26939e,_0x153b14,_0x4a3645){return sendNotification(!![],_0x3a744c,_0x225e43,_0x26939e,_0x153b14,_0x4a3645);};exports[_0x97c0('0x26')]=function(_0x1c183f,_0x325090,_0x4ad645,_0x14617c,_0x148e95){return sendNotification(![],_0x1c183f,_0x325090,_0x4ad645,_0x14617c,_0x148e95);};exports[_0x97c0('0x27')]=writeLog;
\ No newline at end of file
index 10adc06..77adb14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4718=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','next','validate','shelljs','lodash','./utils'];(function(_0x5764d9,_0x2bb4c6){var _0x1edfcf=function(_0x28f679){while(--_0x28f679){_0x5764d9['push'](_0x5764d9['shift']());}};_0x1edfcf(++_0x2bb4c6);}(_0x4718,0x17c));var _0x8471=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x4718[_0x2d61b2];return _0x12df89;};'use strict';var schema=require(_0x8471('0x0'));var sh=require(_0x8471('0x1'));var _=require(_0x8471('0x2'));var utils=require(_0x8471('0x3'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x8471('0x4')}});exports[_0x8471('0x5')]=function(_0x2ce582,_0x157a8d){return function(_0x2e86e2){try{var _0x133e42={'command':_0x157a8d[0x0]};var _0x3b39c8=system[_0x8471('0x0')](_0x133e42,{'typecast':!![]});if(_0x3b39c8[_0x8471('0x6')]){logger[_0x8471('0x7')](_0x8471('0x8'),_0x2ce582,_[_0x8471('0x9')](_0x3b39c8,_0x8471('0xa'))[_0x8471('0xb')](',\x20'));logger['info'](_0x8471('0xc'),_0x2ce582);_0x2e86e2['next']();}else{var _0x49ea10=this;var _0x465ed2=utils['getMustacheRender'](_0x157a8d[0x0],this);logger[_0x8471('0xd')](_0x8471('0xe'),_0x2ce582,_0x465ed2);sh[_0x8471('0xf')](_['trim'](_0x465ed2),function(_0x148271,_0x66ba0f){logger[_0x8471('0xd')](_0x8471('0x10'),_0x2ce582,_0x148271);if(_0x148271==0x0){var _0x5a3535=_0x66ba0f[_0x8471('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x8471('0x12')](_0x157a8d[0x1])||_[_0x8471('0x13')](_0x157a8d[0x1])){logger[_0x8471('0xd')](_0x8471('0x14'),_0x2ce582);_0x49ea10['body'][_0x157a8d[0x1]]=_0x5a3535;}else{logger[_0x8471('0xd')](_0x8471('0x15'),_0x2ce582,_0x157a8d[0x1],_0x5a3535);_0x49ea10['body'][_0x157a8d[0x1]]=_0x5a3535;}}_0x2e86e2['next']();});}}catch(_0x478be3){logger['error'](_0x8471('0x8'),_0x2ce582,_['isObject'](_0x478be3)?JSON[_0x8471('0x16')](_0x478be3):_0x478be3);logger['info'](_0x8471('0xc'),_0x2ce582);_0x2e86e2[_0x8471('0x17')]();}};};
\ No newline at end of file
+var _0x6597=['isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','string','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','info','exec','trim'];(function(_0xc3d54,_0x497498){var _0x2c38ff=function(_0x2b763d){while(--_0x2b763d){_0xc3d54['push'](_0xc3d54['shift']());}};_0x2c38ff(++_0x497498);}(_0x6597,0x16e));var _0x7659=function(_0x52890a,_0x126885){_0x52890a=_0x52890a-0x0;var _0x5ae06b=_0x6597[_0x52890a];return _0x5ae06b;};'use strict';var schema=require(_0x7659('0x0'));var sh=require(_0x7659('0x1'));var _=require(_0x7659('0x2'));var utils=require('./utils');var logger=require(_0x7659('0x3'))('routing');var system=schema({'command':{'type':_0x7659('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x576e8b,_0xbcb138){return function(_0x15c85b){try{var _0x4e09cc={'command':_0xbcb138[0x0]};var _0xb90fa2=system[_0x7659('0x0')](_0x4e09cc,{'typecast':!![]});if(_0xb90fa2['length']){logger['error'](_0x7659('0x5'),_0x576e8b,_[_0x7659('0x6')](_0xb90fa2,_0x7659('0x7'))[_0x7659('0x8')](',\x20'));logger['info'](_0x7659('0x9'),_0x576e8b);_0x15c85b[_0x7659('0xa')]();}else{var _0x59e8c1=this;var _0xdf7c1a=utils['getMustacheRender'](_0xbcb138[0x0],this);logger[_0x7659('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x576e8b,_0xdf7c1a);sh[_0x7659('0xc')](_[_0x7659('0xd')](_0xdf7c1a),function(_0x4ce4fb,_0x45d6a7){logger[_0x7659('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x576e8b,_0x4ce4fb);if(_0x4ce4fb==0x0){var _0x56c2a0=_0x45d6a7['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0xbcb138[0x1])||_[_0x7659('0xe')](_0xbcb138[0x1])){logger[_0x7659('0xb')](_0x7659('0xf'),_0x576e8b);_0x59e8c1[_0x7659('0x10')][_0xbcb138[0x1]]=_0x56c2a0;}else{logger[_0x7659('0xb')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x576e8b,_0xbcb138[0x1],_0x56c2a0);_0x59e8c1['body'][_0xbcb138[0x1]]=_0x56c2a0;}}_0x15c85b[_0x7659('0xa')]();});}}catch(_0x2bea71){logger[_0x7659('0x11')](_0x7659('0x5'),_0x576e8b,_[_0x7659('0x12')](_0x2bea71)?JSON[_0x7659('0x13')](_0x2bea71):_0x2bea71);logger['info'](_0x7659('0x9'),_0x576e8b);_0x15c85b[_0x7659('0xa')]();}};};
\ No newline at end of file
index 70605fc..81ac3d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ec6=['stringify','next','[%s][TAG]\x20%s','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch'];(function(_0x15fb0b,_0x44b92d){var _0x423f50=function(_0x32b8c5){while(--_0x32b8c5){_0x15fb0b['push'](_0x15fb0b['shift']());}};_0x423f50(++_0x44b92d);}(_0x0ec6,0x6c));var _0x60ec=function(_0x1755c7,_0x3a723b){_0x1755c7=_0x1755c7-0x0;var _0x5b840f=_0x0ec6[_0x1755c7];return _0x5b840f;};'use strict';var schema=require(_0x60ec('0x0'));var _=require(_0x60ec('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x60ec('0x2')),'smsInteraction':require(_0x60ec('0x3')),'mailInteraction':require(_0x60ec('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x60ec('0x5'))};var logger=require(_0x60ec('0x6'))('routing');var tag=schema({'tag':{'type':_0x60ec('0x7'),'required':!![],'message':_0x60ec('0x8')}});exports[_0x60ec('0x9')]=function(_0x207821,_0x50f975,_0x43d600,_0x353b2d){return function(_0x3d16d5){try{var _0x13676c={'tag':_0x50f975[0x0]};var _0x2ef4d5=tag[_0x60ec('0x0')](_0x13676c,{'typecast':!![]});if(_0x2ef4d5[_0x60ec('0xa')]){logger[_0x60ec('0xb')]('[%s][TAG]\x20%s',_0x207821,_[_0x60ec('0xc')](_0x2ef4d5,_0x60ec('0xd'))['join'](',\x20'));logger[_0x60ec('0xe')](_0x60ec('0xf'),_0x207821);_0x3d16d5['next']();}else{var _0x4fc333={'ids':[_0x50f975[0x0]]};if(rpc[_0x353b2d[_0x60ec('0x10')]+'Interaction']){rpc[_0x353b2d[_0x60ec('0x10')]+_0x60ec('0x11')][_0x60ec('0x12')](_0x353b2d[_0x60ec('0x13')]['id'],_0x4fc333)['then'](function(_0x48c788){logger[_0x60ec('0xe')](_0x60ec('0x14'),_0x207821,_0x50f975[0x1],_0x353b2d[_0x60ec('0x10')],_0x353b2d[_0x60ec('0x13')]['id']);})[_0x60ec('0x15')](function(_0x42e3dd){logger[_0x60ec('0xb')]('[%s][TAG]\x20%s',_0x207821,JSON[_0x60ec('0x16')](_0x42e3dd));logger[_0x60ec('0xe')](_0x60ec('0xf'),_0x207821);})['finally'](function(){_0x3d16d5[_0x60ec('0x17')]();});}}}catch(_0x22d47d){logger['error'](_0x60ec('0x18'),_0x207821,_[_0x60ec('0x19')](_0x22d47d)?JSON['stringify'](_0x22d47d):_0x22d47d);logger[_0x60ec('0xe')](_0x60ec('0xf'),_0x207821);_0x3d16d5[_0x60ec('0x17')]();}};};
\ No newline at end of file
+var _0xfbbe=['message','join','next','channel','Interaction','addTags','interaction','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xfbbe,0x7a));var _0xefbb=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xfbbe[_0x2070da];return _0x4f9fe1;};'use strict';var schema=require('validate');var _=require(_0xefbb('0x0'));var rpc={'chatInteraction':require(_0xefbb('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xefbb('0x2')),'mailInteraction':require(_0xefbb('0x3')),'faxInteraction':require(_0xefbb('0x4')),'whatsappInteraction':require(_0xefbb('0x5'))};var logger=require('../../../../config/logger')(_0xefbb('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xefbb('0x7')}});exports[_0xefbb('0x8')]=function(_0x2455fa,_0xbadec5,_0x30dc62,_0x307de9){return function(_0x1cb120){try{var _0x12bec9={'tag':_0xbadec5[0x0]};var _0x4b32e3=tag['validate'](_0x12bec9,{'typecast':!![]});if(_0x4b32e3[_0xefbb('0x9')]){logger[_0xefbb('0xa')](_0xefbb('0xb'),_0x2455fa,_[_0xefbb('0xc')](_0x4b32e3,_0xefbb('0xd'))[_0xefbb('0xe')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2455fa);_0x1cb120[_0xefbb('0xf')]();}else{var _0x163de={'ids':[_0xbadec5[0x0]]};if(rpc[_0x307de9[_0xefbb('0x10')]+_0xefbb('0x11')]){rpc[_0x307de9[_0xefbb('0x10')]+_0xefbb('0x11')][_0xefbb('0x12')](_0x307de9[_0xefbb('0x13')]['id'],_0x163de)['then'](function(_0x25cf78){logger[_0xefbb('0x14')](_0xefbb('0x15'),_0x2455fa,_0xbadec5[0x1],_0x307de9['channel'],_0x307de9[_0xefbb('0x13')]['id']);})[_0xefbb('0x16')](function(_0x491e9f){logger['error'](_0xefbb('0xb'),_0x2455fa,JSON[_0xefbb('0x17')](_0x491e9f));logger[_0xefbb('0x14')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2455fa);})[_0xefbb('0x18')](function(){_0x1cb120[_0xefbb('0xf')]();});}}}catch(_0x444360){logger['error'](_0xefbb('0xb'),_0x2455fa,_[_0xefbb('0x19')](_0x444360)?JSON[_0xefbb('0x17')](_0x444360):_0x444360);logger[_0xefbb('0x14')](_0xefbb('0x1a'),_0x2455fa);_0x1cb120[_0xefbb('0xf')]();}};};
\ No newline at end of file
index 4af6838..132dd5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc001=['[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','consequence','replace','includes','push','urlOnAnswer','?params=','title','2.0','method','login','params','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stringify','then','info','catch','error','[%s][TVOX]\x20%s'];(function(_0x5b697a,_0x280202){var _0x5de43b=function(_0x2bc32f){while(--_0x2bc32f){_0x5b697a['push'](_0x5b697a['shift']());}};_0x5de43b(++_0x280202);}(_0xc001,0x110));var _0x1c00=function(_0x22bb8a,_0x4744f3){_0x22bb8a=_0x22bb8a-0x0;var _0x136000=_0xc001[_0x22bb8a];return _0x136000;};'use strict';var rp=require(_0x1c00('0x0'));var logger=require('../../../../config/logger')(_0x1c00('0x1'));var _=require('lodash');var arr=[];exports[_0x1c00('0x2')]=function(_0x4c04e3,_0x2444df){return function(_0x5aee13){var _0x1b15a8=_0x2444df[0xa];var _0x5dea1c=_0x2444df[0xb];var _0x407752=_0x2444df[0xc];var _0x32801d=_0x2444df[0xd];var _0x26bd6d=_0x2444df[0xe];var _0xbebe5=_0x2444df[0xf][_0x1c00('0x3')](/\n/g,'\x20-\x20');var _0x92385=_0x2444df[0x10][_0x1c00('0x3')](/\n/g,'\x20');if(!arr[_0x1c00('0x4')](_0x5dea1c)){arr[_0x1c00('0x5')](_0x5dea1c);var _0x5ca2f8=_0x2444df[0x3];var _0x6f2f21=_0x2444df[0x4];var _0x789563=_0x2444df[0x1];var _0x35f572=_0x2444df[0x0];var _0x21d411={};_0x21d411[_0x1c00('0x6')]=_0x2444df[0x8]+_0x1c00('0x7')+_0x407752+'|'+_0x1b15a8+'|'+_0x32801d+'|'+_0x5dea1c+'|'+_0x26bd6d;_0x21d411['urlOnRing']=_0x2444df[0x7]+'?params='+_0x407752+'|'+_0x1b15a8+'|'+_0x32801d+'|'+_0x5dea1c+'|'+_0x26bd6d+'|'+_0xbebe5+'|'+_0x92385;_0x21d411[_0x1c00('0x8')]=_0x2444df[0x9];var _0x303acb={};_0x303acb['jsonrpc']=_0x1c00('0x9');_0x303acb[_0x1c00('0xa')]=_0x1c00('0xb');var _0x105918=[];_0x105918[_0x1c00('0x5')](_0x2444df[0x2]);_0x105918[_0x1c00('0x5')](_0x2444df[0x5]);_0x105918[_0x1c00('0x5')](_0x2444df[0x6]);_0x303acb[_0x1c00('0xc')]=_0x105918;_0x303acb['id']=0x1;var _0x3c30ca=JSON['stringify'](_0x303acb);var _0x1530a3={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x5ca2f8,'headers':{'Content-Type':'application/json-rpc'},'body':_0x3c30ca};return rp(_0x1530a3)['then'](function(_0x1c0979){const _0x50b325=JSON['parse'](_0x1c0979);if(!_0x50b325['result'][_0x1c00('0xd')]){throw new Error(_0x1c00('0xe'));}var _0x2daadd=_0x5dea1c;var _0x3dd2b4=_0x1c00('0xf')+_0x789563+_0x1c00('0x10')+_0x35f572+_0x1c00('0x11')+_0x2daadd+_0x1c00('0x12')+JSON[_0x1c00('0x13')](_0x21d411);var _0x4f1864=_0x6f2f21+'?'+_0x3dd2b4;return rp(_0x4f1864);})[_0x1c00('0x14')](function(_0x4da3b2){logger[_0x1c00('0x15')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x4c04e3,_0x4da3b2);_0x5aee13['stop']();})[_0x1c00('0x16')](function(_0x504af5){logger[_0x1c00('0x17')](_0x1c00('0x18'),_0x4c04e3,_['isObject'](_0x504af5)?JSON[_0x1c00('0x13')](_0x504af5):_0x504af5);_0x5aee13['stop']();});}else{logger['info'](_0x1c00('0x19'),_0x4c04e3);_0x5aee13[_0x1c00('0x1a')]();}};};
\ No newline at end of file
+var _0x3893=['replace','\x20-\x20','includes','urlOnAnswer','urlOnRing','?params=','jsonrpc','2.0','method','push','params','utf8','POST','application/json-rpc','then','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','routing','lodash','consequence'];(function(_0x40f15d,_0x5c7730){var _0x1c4b56=function(_0x3adc47){while(--_0x3adc47){_0x40f15d['push'](_0x40f15d['shift']());}};_0x1c4b56(++_0x5c7730);}(_0x3893,0xb0));var _0x3389=function(_0xfe26da,_0x5ac1b7){_0xfe26da=_0xfe26da-0x0;var _0x2abe6e=_0x3893[_0xfe26da];return _0x2abe6e;};'use strict';var rp=require('request-promise');var logger=require(_0x3389('0x0'))(_0x3389('0x1'));var _=require(_0x3389('0x2'));var arr=[];exports[_0x3389('0x3')]=function(_0x418a29,_0x3bd7da){return function(_0x3799db){var _0x1a5d62=_0x3bd7da[0xa];var _0x1751ac=_0x3bd7da[0xb];var _0x21e64d=_0x3bd7da[0xc];var _0x21cdfb=_0x3bd7da[0xd];var _0x3ca74c=_0x3bd7da[0xe];var _0xc9357a=_0x3bd7da[0xf][_0x3389('0x4')](/\n/g,_0x3389('0x5'));var _0x246b21=_0x3bd7da[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x3389('0x6')](_0x1751ac)){arr['push'](_0x1751ac);var _0x4c1307=_0x3bd7da[0x3];var _0x3a5c9f=_0x3bd7da[0x4];var _0x24d8aa=_0x3bd7da[0x1];var _0x3dc430=_0x3bd7da[0x0];var _0x11b3e4={};_0x11b3e4[_0x3389('0x7')]=_0x3bd7da[0x8]+'?params='+_0x21e64d+'|'+_0x1a5d62+'|'+_0x21cdfb+'|'+_0x1751ac+'|'+_0x3ca74c;_0x11b3e4[_0x3389('0x8')]=_0x3bd7da[0x7]+_0x3389('0x9')+_0x21e64d+'|'+_0x1a5d62+'|'+_0x21cdfb+'|'+_0x1751ac+'|'+_0x3ca74c+'|'+_0xc9357a+'|'+_0x246b21;_0x11b3e4['title']=_0x3bd7da[0x9];var _0x6a5c4f={};_0x6a5c4f[_0x3389('0xa')]=_0x3389('0xb');_0x6a5c4f[_0x3389('0xc')]='login';var _0x277884=[];_0x277884['push'](_0x3bd7da[0x2]);_0x277884[_0x3389('0xd')](_0x3bd7da[0x5]);_0x277884[_0x3389('0xd')](_0x3bd7da[0x6]);_0x6a5c4f[_0x3389('0xe')]=_0x277884;_0x6a5c4f['id']=0x1;var _0x12c1dd=JSON['stringify'](_0x6a5c4f);var _0xd57238={'encoding':_0x3389('0xf'),'method':_0x3389('0x10'),'timeout':0x2710,'url':_0x4c1307,'headers':{'Content-Type':_0x3389('0x11')},'body':_0x12c1dd};return rp(_0xd57238)[_0x3389('0x12')](function(_0x518073){const _0x1046fe=JSON['parse'](_0x518073);if(!_0x1046fe['result']['logged']){throw new Error(_0x3389('0x13'));}var _0x30d63b=_0x1751ac;var _0x101178='channelId='+_0x24d8aa+_0x3389('0x14')+_0x3dc430+_0x3389('0x15')+_0x30d63b+_0x3389('0x16')+JSON[_0x3389('0x17')](_0x11b3e4);var _0x4ffd3b=_0x3a5c9f+'?'+_0x101178;return rp(_0x4ffd3b);})[_0x3389('0x12')](function(_0x1d5132){logger[_0x3389('0x18')](_0x3389('0x19'),_0x418a29,_0x1d5132);_0x3799db[_0x3389('0x1a')]();})['catch'](function(_0x41b20f){logger[_0x3389('0x1b')](_0x3389('0x1c'),_0x418a29,_['isObject'](_0x41b20f)?JSON[_0x3389('0x17')](_0x41b20f):_0x41b20f);_0x3799db['stop']();});}else{logger[_0x3389('0x18')](_0x3389('0x1d'),_0x418a29);_0x3799db['next']();}};};
\ No newline at end of file
index ec7a3c4..16df6f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x5fdacd,_0x4e4bb7){var _0x44042a=function(_0x257fff){while(--_0x257fff){_0x5fdacd['push'](_0x5fdacd['shift']());}};_0x44042a(++_0x4e4bb7);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x76a56a,_0x3eba1e){var _0x1fd497=function(_0xf123bd){while(--_0xf123bd){_0x76a56a['push'](_0x76a56a['shift']());}};_0x1fd497(++_0x3eba1e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
index e74de23..64eed95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75b=['join','dialogflow','dialogflowv2','amazonlex','tag','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','%s:%s:%s','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','.js','Applications\x20executed','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','error','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','stringify','127.0.0.1','log','lodash','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','existsSync','app','toLowerCase','appdata','split','mail','push','slice','length'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xa75b,0x170));var _0xba75=function(_0xb6a5b3,_0x11927f){_0xb6a5b3=_0xb6a5b3-0x0;var _0x307a8e=_0xa75b[_0xb6a5b3];return _0x307a8e;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0xba75('0x1'));var BPromise=require(_0xba75('0x2'));var uuid=require(_0xba75('0x3'));var utils=require(_0xba75('0x4'));var config=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var rpc={'openchannelQueueReport':require(_0xba75('0x8')),'mailQueueReport':require(_0xba75('0x9')),'chatQueueReport':require(_0xba75('0xa')),'smsQueueReport':require(_0xba75('0xb')),'faxQueueReport':require(_0xba75('0xc')),'whatsappQueueReport':require(_0xba75('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4b842d,_0x731cae,_0x52669f){return util['format'](_0xba75('0xe'),_0x4b842d,_0x731cae||0x0,_0x52669f||0x0);}function getIntervals(_0x4f4d0a,_0x2e8905){var _0x470836=[];if(!_[_0xba75('0xf')](_0x2e8905[_0xba75('0x10')])&&!_[_0xba75('0xf')](_0x4f4d0a[_0x2e8905[_0xba75('0x10')]])&&!_[_0xba75('0xf')](_0x4f4d0a[_0x2e8905[_0xba75('0x10')]][_0xba75('0x11')])){_0x470836=_[_0xba75('0x12')](_0x4f4d0a[_0x2e8905[_0xba75('0x10')]][_0xba75('0x11')],'interval');}else if(!_['isNil'](_0x2e8905[_0xba75('0x13')])){_0x470836=[_0x2e8905['interval']];}return _0x470836;}exports[_0xba75('0x14')]=function(_0x2df615){_0x2df615[_0xba75('0x15')]={};return new BPromise(function(_0x383b1e,_0x4c4a0b){var _0x31b3b3={'Start':function(_0x18bab2){var _0x256678=this;return new Promise(function(_0x4028f9,_0x41c9e5){if(_0x18bab2){try{var _0x51112b=[];var _0x350a9d=getId(_0x18bab2[_0xba75('0x16')],_0x18bab2[_0xba75('0x17')]?_0x18bab2['message']['id']:0x0,_0x18bab2[_0xba75('0x18')]?_0x18bab2[_0xba75('0x18')]['id']:0x0);if(_0x18bab2[_0xba75('0x19')]&&_[_0xba75('0x1a')](_0x18bab2[_0xba75('0x19')])&&_0x18bab2[_0xba75('0x19')]['length']){for(var _0x23c2ec=0x0;_0x23c2ec<_0x18bab2[_0xba75('0x19')]['length'];_0x23c2ec+=0x1){var _0x5217aa=_0x18bab2[_0xba75('0x19')][_0x23c2ec];if(fs[_0xba75('0x1b')](path['join'](__dirname,'applications',_0x5217aa[_0xba75('0x1c')]+'.js'))){var _0x1b8a36=[];switch(_0x5217aa[_0xba75('0x1c')][_0xba75('0x1d')]()){case'autoreply':var _0x458475=_0x5217aa[_0xba75('0x1e')][_0xba75('0x1f')](',');if(_0x18bab2[_0xba75('0x16')]===_0xba75('0x20')){_0x1b8a36[_0xba75('0x21')](_0x458475[0x0]);_0x1b8a36['push'](_0x458475[0x1]);_0x1b8a36[_0xba75('0x21')](_0x458475[_0xba75('0x22')](0x2,_0x458475[_0xba75('0x23')])[_0xba75('0x24')](','));}else{_0x1b8a36[_0xba75('0x21')](_0x458475[0x0]);_0x1b8a36[_0xba75('0x21')](_0x458475[_0xba75('0x22')](0x1,_0x458475[_0xba75('0x23')])[_0xba75('0x24')](','));}break;case _0xba75('0x25'):var _0x47ddff=_0x5217aa['appdata']['split'](',');_0x1b8a36[_0xba75('0x21')](_0x47ddff[0x0]);_0x1b8a36['push'](_0x47ddff[0x1]);_0x1b8a36[_0xba75('0x21')](_0x47ddff['slice'](0x2,_0x47ddff[_0xba75('0x23')])[_0xba75('0x24')](','));break;case _0xba75('0x26'):var _0x4edc2e=_0x5217aa[_0xba75('0x1e')][_0xba75('0x1f')](',');_0x1b8a36[_0xba75('0x21')](_0x4edc2e[0x0]);_0x1b8a36[_0xba75('0x21')](_0x4edc2e[0x1]);_0x1b8a36['push'](_0x4edc2e[0x2]);_0x1b8a36['push'](_0x4edc2e[0x3]);_0x1b8a36[_0xba75('0x21')](_0x4edc2e['slice'](0x4,_0x4edc2e[_0xba75('0x23')])[_0xba75('0x24')](','));break;case _0xba75('0x27'):var _0x32166a=_0x5217aa['appdata'][_0xba75('0x1f')](',');_0x1b8a36[_0xba75('0x21')](_0x32166a[0x0]);_0x1b8a36['push'](_0x32166a[0x1]);_0x1b8a36[_0xba75('0x21')](_0x32166a[0x2]);_0x1b8a36[_0xba75('0x21')](_0x32166a[0x3]);_0x1b8a36[_0xba75('0x21')](_0x32166a[_0xba75('0x22')](0x4,_0x32166a['length'])[_0xba75('0x24')](','));break;case _0xba75('0x17'):_0x1b8a36['push'](_0x5217aa[_0xba75('0x1e')]);break;case _0xba75('0x28'):_0x1b8a36[_0xba75('0x21')](_0x5217aa['TagId']);_0x1b8a36[_0xba75('0x21')](_0x5217aa[_0xba75('0x1e')]);break;case _0xba75('0x29'):var _0x381cb=utils[_0xba75('0x2a')](_0x18bab2[_0xba75('0x2b')][_0xba75('0x2c')],_0x18bab2);var _0x4c9fb2=_0x5217aa['appdata'][_0xba75('0x1f')](',');_0x1b8a36[_0xba75('0x21')](_0x4c9fb2[0x0]);_0x1b8a36[_0xba75('0x21')](_0x4c9fb2[0x1]);_0x1b8a36['push'](_0x4c9fb2[0x2]);_0x1b8a36[_0xba75('0x21')](_0x4c9fb2[0x3]);_0x1b8a36[_0xba75('0x21')](_0x4c9fb2[0x4]);_0x1b8a36['push'](_0x4c9fb2[0x5]);_0x1b8a36['push'](_0x4c9fb2[0x6]);_0x1b8a36[_0xba75('0x21')](_0x4c9fb2[0x7]);_0x1b8a36[_0xba75('0x21')](_0x4c9fb2[0x8]);_0x1b8a36[_0xba75('0x21')](_0x4c9fb2[0x9]);_0x1b8a36[_0xba75('0x21')](_0x4c9fb2[0xa]);_0x1b8a36[_0xba75('0x21')](_0x18bab2['interaction']['id']);_0x1b8a36['push'](_0x18bab2[_0xba75('0x17')]['id']);_0x1b8a36[_0xba75('0x21')](_0x5217aa[_0xba75('0x2d')]);_0x1b8a36[_0xba75('0x21')](_0x18bab2[_0xba75('0x18')][_0xba75('0x2e')]);_0x1b8a36[_0xba75('0x21')](_0x18bab2['body'][_0xba75('0x2f')]);_0x1b8a36[_0xba75('0x21')](_0x381cb);break;default:_0x1b8a36=_['isNil'](_0x5217aa[_0xba75('0x1e')])?[]:_0x5217aa[_0xba75('0x1e')][_0xba75('0x1f')](',');}var _0x45d8cd={'id':util[_0xba75('0x30')](_0xba75('0x31'),_0x350a9d,_0x5217aa['id'],_0x5217aa[_0xba75('0x1c')]),'condition':require('./interval')[_0xba75('0x32')](_0x350a9d,getIntervals(_0x2df615['intervals'],_0x5217aa),_0x2df615),'consequence':require(_0xba75('0x33')+_0x5217aa['app'])[_0xba75('0x34')](_0x350a9d,_0x1b8a36,_0x2df615,_0x18bab2),'p':_0x5217aa[_0xba75('0x35')]||0x0};logger[_0xba75('0x36')](_0xba75('0x37'),_0x45d8cd['id'],_0xba75('0x38'),getIntervals(_0x2df615[_0xba75('0x39')],_0x5217aa)[_0xba75('0x24')](_0xba75('0x3a')));_0x51112b[_0xba75('0x21')](_0x45d8cd);}else{logger['error'](_0xba75('0x3b'),path[_0xba75('0x24')](__dirname,'applications',_0x5217aa[_0xba75('0x1c')]+_0xba75('0x3c')));}}_0x2df615[_0xba75('0x15')][_0x350a9d]=new RuleEngine(_0x51112b);_0x2df615['rules'][_0x350a9d]['execute'](_0x18bab2,function(_0x5c6491){logger['info'](_0xba75('0x3d'),JSON['stringify'](_0x5c6491[_0xba75('0x3e')]));if(_0x2df615[_0xba75('0x15')][_0x350a9d]){_0x2df615[_0xba75('0x15')][_0x350a9d][_0xba75('0x3f')](_0xba75('0x40'));}});return _0x4028f9({'code':0xc8,'message':_0x18bab2});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x4028f9({'code':0xc8,'message':_0x18bab2});}}catch(_0x354c52){logger['error'](_0x354c52[_0xba75('0x41')]);return _0x41c9e5(_0x256678['error'](0x1f4,_0x354c52));}}return _0x41c9e5(_0xba75('0x42'));});},'AcceptMessage':function(_0x426e29){var _0x22e5b4=this;return new Promise(function(_0x3983dc,_0x52a504){if(_0x426e29[_0xba75('0x43')]&&_0x426e29[_0xba75('0x43')]['id']){if(_0x2df615[_0xba75('0x44')][_0x426e29[_0xba75('0x43')]['id']]){_0x2df615[_0xba75('0x44')][_0x426e29[_0xba75('0x43')]['id']][_0xba75('0x45')]=![];_0x2df615[_0xba75('0x44')][_0x426e29['agent']['id']][_0xba75('0x46')]=undefined;}}if(_0x426e29[_0xba75('0x17')]&&_0x426e29[_0xba75('0x17')]['id']){try{var _0x27917d=getId(_0x426e29[_0xba75('0x16')],_0x426e29['message']?_0x426e29[_0xba75('0x17')]['id']:0x0,_0x426e29[_0xba75('0x18')]?_0x426e29[_0xba75('0x18')]['id']:0x0);if(_0x2df615[_0xba75('0x15')][_0x27917d]){_0x2df615[_0xba75('0x15')][_0x27917d][_0xba75('0x3f')](_0xba75('0x47'));if(rpc[_0x426e29['channel']+_0xba75('0x48')]){rpc[_0x426e29[_0xba75('0x16')]+_0xba75('0x48')]['update'](_0x27917d,{'UserId':_0x426e29[_0xba75('0x17')][_0xba75('0x49')]})['catch'](function(_0x4d7e7e){logger[_0xba75('0x4a')]('error\x20update\x20queue\x20report');});}}return _0x3983dc({'code':0xc8,'message':_0x426e29});}catch(_0x49a4df){logger[_0xba75('0x4a')](_0x49a4df['stack']);return _0x52a504(_0x22e5b4[_0xba75('0x4a')](0x1f4,_0x49a4df));}}logger[_0xba75('0x4a')](_0xba75('0x4b'));return _0x52a504(_0x22e5b4[_0xba75('0x4a')](0x1f4,_0xba75('0x4b')));});},'RejectMessage':function(_0x490071){var _0xfa79e6=this;return new Promise(function(_0x3dee66,_0x57aaa6){if(_0x490071[_0xba75('0x43')]&&_0x490071[_0xba75('0x43')]['id']){try{if(_0x2df615[_0xba75('0x44')][_0x490071[_0xba75('0x43')]['id']]){_0x2df615[_0xba75('0x44')][_0x490071['agent']['id']][_0xba75('0x45')]=![];_0x2df615[_0xba75('0x44')][_0x490071['agent']['id']][_0xba75('0x46')]=undefined;}return _0x3dee66({'code':0xc8,'message':_0x490071});}catch(_0xd9da55){logger[_0xba75('0x4a')](_0xd9da55[_0xba75('0x41')]);return _0x57aaa6(_0xfa79e6[_0xba75('0x4a')](0x1f4,_0xd9da55));}}logger[_0xba75('0x4a')]('message\x20is\x20empty');return _0x57aaa6(_0xfa79e6[_0xba75('0x4a')](0x1f4,_0xba75('0x4b')));});},'AbandonInteraction':function(_0x361efb){var _0x429e26=this;return new Promise(function(_0x38129c,_0x1ddb64){if(_0x361efb['channel']&&_0x361efb['interaction']&&_0x361efb['interaction']['id']){try{var _0x4cda26=getId(_0x361efb[_0xba75('0x16')],_0x361efb[_0xba75('0x17')]?_0x361efb[_0xba75('0x17')]['id']:0x0,_0x361efb[_0xba75('0x18')]?_0x361efb[_0xba75('0x18')]['id']:0x0);if(_0x2df615[_0xba75('0x15')][_0x4cda26]){_0x2df615[_0xba75('0x15')][_0x4cda26]['emit'](_0xba75('0x47'));}return _0x38129c({'code':0xc8,'message':_0x361efb});}catch(_0x1e7500){logger[_0xba75('0x4a')](_0x1e7500[_0xba75('0x41')]);return _0x1ddb64(_0x429e26['error'](0x1f4,_0x1e7500));}}logger[_0xba75('0x4a')](_0xba75('0x4b'));return _0x1ddb64(_0x429e26['error'](0x1f4,_0xba75('0x4b')));});},'AgentCapacity':function(_0x4cfd9d){var _0x1f5120=this;return new Promise(function(_0x177f7c,_0x57eceb){if(_0x2df615[_0xba75('0x44')][_0xba75('0x4c')](_0x4cfd9d['id'])){for(var _0x4b5b61 in _0x4cfd9d['capacity']){if(_0x4cfd9d[_0xba75('0x4d')]['hasOwnProperty'](_0x4b5b61)){if(_0x2df615[_0xba75('0x44')][_0x4cfd9d['id']]['hasOwnProperty'](_0x4b5b61+_0xba75('0x4e'))){_0x2df615[_0xba75('0x44')][_0x4cfd9d['id']][_0x4b5b61+_0xba75('0x4e')]=parseInt(_0x4cfd9d[_0xba75('0x4d')][_0x4b5b61],0xa);}}}_0x2df615[_0xba75('0x44')][_0x4cfd9d['id']]['updateRealtime']();return _0x177f7c({'code':0xc8,'message':_0x2df615[_0xba75('0x44')][_0x4cfd9d['id']]});}else{return _0x57eceb(_0x1f5120[_0xba75('0x4a')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x22f170){return new Promise(function(_0x4563c3,_0x16f8ff){var _0x40bf04=_[_0xba75('0x4f')](_0x2df615[_0xba75('0x44')]);_0x4563c3({'count':_0x40bf04[_0xba75('0x23')],'rows':_0x40bf04});});},'ChatQueues':function(_0xb6d3a2){return new Promise(function(_0x14ee95,_0x36bd35){var _0xa0a92=[];for(var _0x9da35c in _0x2df615['chatQueues']){if(_0x2df615['chatQueues'][_0xba75('0x4c')](_0x9da35c)){var _0x31e3b6=_0x2df615[_0xba75('0x50')][_0x9da35c];var _0x441462={'id':_0x31e3b6['id'],'available':_0x31e3b6[_0xba75('0x51')],'loggedIn':_0x31e3b6[_0xba75('0x52')],'name':_0x31e3b6[_0xba75('0x53')],'paused':_0x31e3b6[_0xba75('0x54')],'waiting':_0x31e3b6[_0xba75('0x55')]};_0xa0a92[_0xba75('0x21')](_0x441462);}}_0x14ee95({'count':_0xa0a92[_0xba75('0x23')],'rows':_0xa0a92});});},'MailQueues':function(_0x5dace4){return new Promise(function(_0x20f222,_0x5c1e1d){var _0x7a722d=[];for(var _0x10ff6f in _0x2df615[_0xba75('0x56')]){if(_0x2df615[_0xba75('0x56')][_0xba75('0x4c')](_0x10ff6f)){var _0x1f7623=_0x2df615['mailQueues'][_0x10ff6f];var _0x2108c1={'id':_0x1f7623['id'],'available':_0x1f7623['available'],'loggedIn':_0x1f7623[_0xba75('0x52')],'name':_0x1f7623[_0xba75('0x53')],'paused':_0x1f7623['paused'],'waiting':_0x1f7623['waiting']};_0x7a722d[_0xba75('0x21')](_0x2108c1);}}_0x20f222({'count':_0x7a722d[_0xba75('0x23')],'rows':_0x7a722d});});},'OpenchannelQueues':function(_0x30ef23){return new Promise(function(_0x3146d9,_0x7cf469){var _0xdac989=[];for(var _0x57f65e in _0x2df615[_0xba75('0x57')]){if(_0x2df615[_0xba75('0x57')]['hasOwnProperty'](_0x57f65e)){var _0x1df030=_0x2df615[_0xba75('0x57')][_0x57f65e];var _0x281499={'id':_0x1df030['id'],'available':_0x1df030[_0xba75('0x51')],'loggedIn':_0x1df030[_0xba75('0x52')],'name':_0x1df030['name'],'paused':_0x1df030[_0xba75('0x54')],'waiting':_0x1df030['waiting']};_0xdac989[_0xba75('0x21')](_0x281499);}}_0x3146d9({'count':_0xdac989[_0xba75('0x23')],'rows':_0xdac989});});},'SmsQueues':function(_0x46b595){return new Promise(function(_0x42dcc7,_0x67446f){var _0x2a70ac=[];for(var _0x599d61 in _0x2df615['smsQueues']){if(_0x2df615[_0xba75('0x58')]['hasOwnProperty'](_0x599d61)){var _0x42aa26=_0x2df615[_0xba75('0x58')][_0x599d61];var _0x5187a0={'id':_0x42aa26['id'],'available':_0x42aa26[_0xba75('0x51')],'loggedIn':_0x42aa26[_0xba75('0x52')],'name':_0x42aa26[_0xba75('0x53')],'paused':_0x42aa26['paused'],'waiting':_0x42aa26['waiting']};_0x2a70ac['push'](_0x5187a0);}}_0x42dcc7({'count':_0x2a70ac['length'],'rows':_0x2a70ac});});},'FaxQueues':function(_0x58e3bb){return new Promise(function(_0xce1b93,_0x549f1d){var _0x22a214=[];for(var _0x159c0a in _0x2df615[_0xba75('0x59')]){if(_0x2df615[_0xba75('0x59')][_0xba75('0x4c')](_0x159c0a)){var _0x3cb6e1=_0x2df615[_0xba75('0x59')][_0x159c0a];var _0x482033={'id':_0x3cb6e1['id'],'available':_0x3cb6e1['available'],'loggedIn':_0x3cb6e1[_0xba75('0x52')],'name':_0x3cb6e1[_0xba75('0x53')],'paused':_0x3cb6e1['paused'],'waiting':_0x3cb6e1[_0xba75('0x55')]};_0x22a214['push'](_0x482033);}}_0xce1b93({'count':_0x22a214[_0xba75('0x23')],'rows':_0x22a214});});},'WhatsappQueues':function(_0xc00f73){return new Promise(function(_0x5ade59,_0x1b459c){var _0x4cf755=[];for(var _0x32c3a3 in _0x2df615[_0xba75('0x5a')]){if(_0x2df615['whatsappQueues'][_0xba75('0x4c')](_0x32c3a3)){var _0x3fe397=_0x2df615[_0xba75('0x5a')][_0x32c3a3];var _0x1907f1={'id':_0x3fe397['id'],'available':_0x3fe397[_0xba75('0x51')],'loggedIn':_0x3fe397[_0xba75('0x52')],'name':_0x3fe397[_0xba75('0x53')],'paused':_0x3fe397[_0xba75('0x54')],'waiting':_0x3fe397['waiting']};_0x4cf755[_0xba75('0x21')](_0x1907f1);}}_0x5ade59({'count':_0x4cf755[_0xba75('0x23')],'rows':_0x4cf755});});},'ChatQueuesWaitingInteractions':function(_0x55b326){return new Promise(function(_0x47b37b,_0x5474ea){var _0x35da71=_['values'](_0x2df615[_0xba75('0x5b')]);_0x47b37b({'count':_0x35da71['length'],'rows':_0x35da71});});},'MailQueuesWaitingInteractions':function(_0xceb67d){return new Promise(function(_0x47fa0a,_0x4a8699){var _0x10f7df=_['values'](_0x2df615[_0xba75('0x5c')]);_0x47fa0a({'count':_0x10f7df['length'],'rows':_0x10f7df});});},'OpenchannelQueuesWaitingInteractions':function(_0x5db76b){return new Promise(function(_0x1b4c76,_0x4aa672){var _0x3edf13=_['values'](_0x2df615[_0xba75('0x5d')]);_0x1b4c76({'count':_0x3edf13[_0xba75('0x23')],'rows':_0x3edf13});});},'SmsQueuesWaitingInteractions':function(_0x21fa25){return new Promise(function(_0x595962,_0x5389a){var _0x1de4a3=_['values'](_0x2df615[_0xba75('0x5e')]);_0x595962({'count':_0x1de4a3['length'],'rows':_0x1de4a3});});},'FaxQueuesWaitingInteractions':function(_0x4bce2f){return new Promise(function(_0x3791c4,_0x545e77){var _0x3add47=_[_0xba75('0x4f')](_0x2df615[_0xba75('0x5f')]);_0x3791c4({'count':_0x3add47[_0xba75('0x23')],'rows':_0x3add47});});},'WhatsappQueuesWaitingInteractions':function(_0x37e149){return new Promise(function(_0x1cc94d,_0x468587){var _0x3c14e2=_[_0xba75('0x4f')](_0x2df615[_0xba75('0x60')]);_0x1cc94d({'count':_0x3c14e2[_0xba75('0x23')],'rows':_0x3c14e2});});}};var _0x5d89ee=jayson['server'](_0x31b3b3)[_0xba75('0x61')]();_0x5d89ee['on']('error',function(_0x5443f4){logger[_0xba75('0x4a')](JSON[_0xba75('0x62')](_0x5443f4));return _0x4c4a0b(_0x5443f4);});_0x5d89ee[_0xba75('0x14')](0x232c,_0xba75('0x63'),function(){console[_0xba75('0x64')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x383b1e('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0xc5ba=['stringify','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','join','app','.js','split','push','slice','dialogflow','appdata','dialogflowv2','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','info','on\x20interval','intervals','error','execute','Applications\x20executed','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','update','catch','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','http'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0xc5ba,0xb9));var _0xac5b=function(_0x36ed6c,_0x302b25){_0x36ed6c=_0x36ed6c-0x0;var _0x13a7e4=_0xc5ba[_0x36ed6c];return _0x13a7e4;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var path=require(_0xac5b('0x2'));var fs=require('fs');var jayson=require(_0xac5b('0x3'));var BPromise=require(_0xac5b('0x4'));var uuid=require(_0xac5b('0x5'));var utils=require(_0xac5b('0x6'));var config=require(_0xac5b('0x7'));var logger=require(_0xac5b('0x8'))(_0xac5b('0x9'));var rpc={'openchannelQueueReport':require(_0xac5b('0xa')),'mailQueueReport':require(_0xac5b('0xb')),'chatQueueReport':require(_0xac5b('0xc')),'smsQueueReport':require(_0xac5b('0xd')),'faxQueueReport':require(_0xac5b('0xe')),'whatsappQueueReport':require(_0xac5b('0xf'))};var RuleEngine=require(_0xac5b('0x10'));function getId(_0x4a7fc7,_0x525e20,_0x31af86){return util['format'](_0xac5b('0x11'),_0x4a7fc7,_0x525e20||0x0,_0x31af86||0x0);}function getIntervals(_0x338faf,_0x221d70){var _0x19952f=[];if(!_[_0xac5b('0x12')](_0x221d70[_0xac5b('0x13')])&&!_[_0xac5b('0x12')](_0x338faf[_0x221d70[_0xac5b('0x13')]])&&!_[_0xac5b('0x12')](_0x338faf[_0x221d70['IntervalId']][_0xac5b('0x14')])){_0x19952f=_[_0xac5b('0x15')](_0x338faf[_0x221d70[_0xac5b('0x13')]][_0xac5b('0x14')],_0xac5b('0x16'));}else if(!_[_0xac5b('0x12')](_0x221d70[_0xac5b('0x16')])){_0x19952f=[_0x221d70[_0xac5b('0x16')]];}return _0x19952f;}exports[_0xac5b('0x17')]=function(_0x58dc98){_0x58dc98[_0xac5b('0x18')]={};return new BPromise(function(_0xab11ec,_0x5e1482){var _0x3bad56={'Start':function(_0xe88a79){var _0x3803cf=this;return new Promise(function(_0x2e4742,_0xa0b4f2){if(_0xe88a79){try{var _0x73f919=[];var _0x363de5=getId(_0xe88a79[_0xac5b('0x19')],_0xe88a79[_0xac5b('0x1a')]?_0xe88a79[_0xac5b('0x1a')]['id']:0x0,_0xe88a79[_0xac5b('0x1b')]?_0xe88a79['interaction']['id']:0x0);if(_0xe88a79[_0xac5b('0x1c')]&&_['isArray'](_0xe88a79[_0xac5b('0x1c')])&&_0xe88a79['applications'][_0xac5b('0x1d')]){for(var _0x2ec29f=0x0;_0x2ec29f<_0xe88a79['applications']['length'];_0x2ec29f+=0x1){var _0x564dfe=_0xe88a79[_0xac5b('0x1c')][_0x2ec29f];if(fs['existsSync'](path[_0xac5b('0x1e')](__dirname,_0xac5b('0x1c'),_0x564dfe[_0xac5b('0x1f')]+_0xac5b('0x20')))){var _0x335852=[];switch(_0x564dfe['app']['toLowerCase']()){case'autoreply':var _0xf01a69=_0x564dfe['appdata'][_0xac5b('0x21')](',');if(_0xe88a79[_0xac5b('0x19')]==='mail'){_0x335852[_0xac5b('0x22')](_0xf01a69[0x0]);_0x335852[_0xac5b('0x22')](_0xf01a69[0x1]);_0x335852[_0xac5b('0x22')](_0xf01a69[_0xac5b('0x23')](0x2,_0xf01a69[_0xac5b('0x1d')])[_0xac5b('0x1e')](','));}else{_0x335852[_0xac5b('0x22')](_0xf01a69[0x0]);_0x335852[_0xac5b('0x22')](_0xf01a69[_0xac5b('0x23')](0x1,_0xf01a69[_0xac5b('0x1d')])['join'](','));}break;case _0xac5b('0x24'):var _0xa48194=_0x564dfe[_0xac5b('0x25')][_0xac5b('0x21')](',');_0x335852[_0xac5b('0x22')](_0xa48194[0x0]);_0x335852[_0xac5b('0x22')](_0xa48194[0x1]);_0x335852[_0xac5b('0x22')](_0xa48194[_0xac5b('0x23')](0x2,_0xa48194[_0xac5b('0x1d')])[_0xac5b('0x1e')](','));break;case _0xac5b('0x26'):var _0x5f07c1=_0x564dfe[_0xac5b('0x25')][_0xac5b('0x21')](',');_0x335852[_0xac5b('0x22')](_0x5f07c1[0x0]);_0x335852['push'](_0x5f07c1[0x1]);_0x335852[_0xac5b('0x22')](_0x5f07c1[0x2]);_0x335852['push'](_0x5f07c1[0x3]);_0x335852[_0xac5b('0x22')](_0x5f07c1[_0xac5b('0x23')](0x4,_0x5f07c1[_0xac5b('0x1d')])[_0xac5b('0x1e')](','));break;case'amazonlex':var _0x1e046a=_0x564dfe['appdata']['split'](',');_0x335852[_0xac5b('0x22')](_0x1e046a[0x0]);_0x335852[_0xac5b('0x22')](_0x1e046a[0x1]);_0x335852['push'](_0x1e046a[0x2]);_0x335852['push'](_0x1e046a[0x3]);_0x335852[_0xac5b('0x22')](_0x1e046a[_0xac5b('0x23')](0x4,_0x1e046a['length'])[_0xac5b('0x1e')](','));break;case _0xac5b('0x1a'):_0x335852[_0xac5b('0x22')](_0x564dfe['appdata']);break;case'tag':_0x335852[_0xac5b('0x22')](_0x564dfe[_0xac5b('0x27')]);_0x335852['push'](_0x564dfe[_0xac5b('0x25')]);break;case _0xac5b('0x28'):var _0x3f267b=utils[_0xac5b('0x29')](_0xe88a79['account'][_0xac5b('0x2a')],_0xe88a79);var _0x2bfe03=_0x564dfe[_0xac5b('0x25')][_0xac5b('0x21')](',');_0x335852[_0xac5b('0x22')](_0x2bfe03[0x0]);_0x335852['push'](_0x2bfe03[0x1]);_0x335852[_0xac5b('0x22')](_0x2bfe03[0x2]);_0x335852['push'](_0x2bfe03[0x3]);_0x335852[_0xac5b('0x22')](_0x2bfe03[0x4]);_0x335852['push'](_0x2bfe03[0x5]);_0x335852[_0xac5b('0x22')](_0x2bfe03[0x6]);_0x335852[_0xac5b('0x22')](_0x2bfe03[0x7]);_0x335852[_0xac5b('0x22')](_0x2bfe03[0x8]);_0x335852[_0xac5b('0x22')](_0x2bfe03[0x9]);_0x335852[_0xac5b('0x22')](_0x2bfe03[0xa]);_0x335852[_0xac5b('0x22')](_0xe88a79['interaction']['id']);_0x335852[_0xac5b('0x22')](_0xe88a79[_0xac5b('0x1a')]['id']);_0x335852[_0xac5b('0x22')](_0x564dfe[_0xac5b('0x2b')]);_0x335852[_0xac5b('0x22')](_0xe88a79[_0xac5b('0x1b')][_0xac5b('0x2c')]);_0x335852['push'](_0xe88a79[_0xac5b('0x2d')][_0xac5b('0x2d')]);_0x335852[_0xac5b('0x22')](_0x3f267b);break;default:_0x335852=_[_0xac5b('0x12')](_0x564dfe[_0xac5b('0x25')])?[]:_0x564dfe[_0xac5b('0x25')]['split'](',');}var _0x2a0d37={'id':util['format'](_0xac5b('0x2e'),_0x363de5,_0x564dfe['id'],_0x564dfe['app']),'condition':require(_0xac5b('0x2f'))['condition'](_0x363de5,getIntervals(_0x58dc98['intervals'],_0x564dfe),_0x58dc98),'consequence':require('./applications/'+_0x564dfe['app'])['consequence'](_0x363de5,_0x335852,_0x58dc98,_0xe88a79),'p':_0x564dfe['priority']||0x0};logger[_0xac5b('0x30')]('Push\x20new\x20rule',_0x2a0d37['id'],_0xac5b('0x31'),getIntervals(_0x58dc98[_0xac5b('0x32')],_0x564dfe)[_0xac5b('0x1e')]('\x20|\x20'));_0x73f919['push'](_0x2a0d37);}else{logger[_0xac5b('0x33')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xac5b('0x1e')](__dirname,_0xac5b('0x1c'),_0x564dfe[_0xac5b('0x1f')]+_0xac5b('0x20')));}}_0x58dc98['rules'][_0x363de5]=new RuleEngine(_0x73f919);_0x58dc98[_0xac5b('0x18')][_0x363de5][_0xac5b('0x34')](_0xe88a79,function(_0xef2367){logger['info'](_0xac5b('0x35'),JSON['stringify'](_0xef2367[_0xac5b('0x36')]));if(_0x58dc98[_0xac5b('0x18')][_0x363de5]){_0x58dc98[_0xac5b('0x18')][_0x363de5]['emit'](_0xac5b('0x37'));}});return _0x2e4742({'code':0xc8,'message':_0xe88a79});}else{logger[_0xac5b('0x30')](_0xac5b('0x38'));return _0x2e4742({'code':0xc8,'message':_0xe88a79});}}catch(_0x46163a){logger[_0xac5b('0x33')](_0x46163a[_0xac5b('0x39')]);return _0xa0b4f2(_0x3803cf[_0xac5b('0x33')](0x1f4,_0x46163a));}}return _0xa0b4f2(_0xac5b('0x3a'));});},'AcceptMessage':function(_0x2a23d4){var _0x5bf030=this;return new Promise(function(_0x599a07,_0x2792a8){if(_0x2a23d4['agent']&&_0x2a23d4['agent']['id']){if(_0x58dc98['agents'][_0x2a23d4['agent']['id']]){_0x58dc98['agents'][_0x2a23d4[_0xac5b('0x3b')]['id']][_0xac5b('0x3c')]=![];_0x58dc98[_0xac5b('0x3d')][_0x2a23d4[_0xac5b('0x3b')]['id']][_0xac5b('0x3e')]=undefined;}}if(_0x2a23d4['message']&&_0x2a23d4[_0xac5b('0x1a')]['id']){try{var _0x4224df=getId(_0x2a23d4[_0xac5b('0x19')],_0x2a23d4[_0xac5b('0x1a')]?_0x2a23d4[_0xac5b('0x1a')]['id']:0x0,_0x2a23d4[_0xac5b('0x1b')]?_0x2a23d4[_0xac5b('0x1b')]['id']:0x0);if(_0x58dc98[_0xac5b('0x18')][_0x4224df]){_0x58dc98[_0xac5b('0x18')][_0x4224df]['emit'](_0xac5b('0x3f'));if(rpc[_0x2a23d4[_0xac5b('0x19')]+_0xac5b('0x40')]){rpc[_0x2a23d4[_0xac5b('0x19')]+_0xac5b('0x40')][_0xac5b('0x41')](_0x4224df,{'UserId':_0x2a23d4[_0xac5b('0x1a')]['UserId']})[_0xac5b('0x42')](function(_0x3a9114){logger['error']('error\x20update\x20queue\x20report');});}}return _0x599a07({'code':0xc8,'message':_0x2a23d4});}catch(_0x397fff){logger[_0xac5b('0x33')](_0x397fff[_0xac5b('0x39')]);return _0x2792a8(_0x5bf030[_0xac5b('0x33')](0x1f4,_0x397fff));}}logger[_0xac5b('0x33')](_0xac5b('0x43'));return _0x2792a8(_0x5bf030[_0xac5b('0x33')](0x1f4,_0xac5b('0x43')));});},'RejectMessage':function(_0x1af4c3){var _0xe989dc=this;return new Promise(function(_0x2ce3e9,_0x12cc2a){if(_0x1af4c3[_0xac5b('0x3b')]&&_0x1af4c3[_0xac5b('0x3b')]['id']){try{if(_0x58dc98[_0xac5b('0x3d')][_0x1af4c3[_0xac5b('0x3b')]['id']]){_0x58dc98[_0xac5b('0x3d')][_0x1af4c3[_0xac5b('0x3b')]['id']][_0xac5b('0x3c')]=![];_0x58dc98[_0xac5b('0x3d')][_0x1af4c3[_0xac5b('0x3b')]['id']][_0xac5b('0x3e')]=undefined;}return _0x2ce3e9({'code':0xc8,'message':_0x1af4c3});}catch(_0x34983f){logger[_0xac5b('0x33')](_0x34983f[_0xac5b('0x39')]);return _0x12cc2a(_0xe989dc['error'](0x1f4,_0x34983f));}}logger[_0xac5b('0x33')](_0xac5b('0x43'));return _0x12cc2a(_0xe989dc[_0xac5b('0x33')](0x1f4,_0xac5b('0x43')));});},'AbandonInteraction':function(_0x561c3c){var _0x178998=this;return new Promise(function(_0x43f804,_0x43729e){if(_0x561c3c[_0xac5b('0x19')]&&_0x561c3c['interaction']&&_0x561c3c[_0xac5b('0x1b')]['id']){try{var _0x3a283c=getId(_0x561c3c[_0xac5b('0x19')],_0x561c3c[_0xac5b('0x1a')]?_0x561c3c[_0xac5b('0x1a')]['id']:0x0,_0x561c3c[_0xac5b('0x1b')]?_0x561c3c[_0xac5b('0x1b')]['id']:0x0);if(_0x58dc98['rules'][_0x3a283c]){_0x58dc98[_0xac5b('0x18')][_0x3a283c]['emit'](_0xac5b('0x3f'));}return _0x43f804({'code':0xc8,'message':_0x561c3c});}catch(_0x156779){logger[_0xac5b('0x33')](_0x156779[_0xac5b('0x39')]);return _0x43729e(_0x178998[_0xac5b('0x33')](0x1f4,_0x156779));}}logger[_0xac5b('0x33')]('message\x20is\x20empty');return _0x43729e(_0x178998[_0xac5b('0x33')](0x1f4,_0xac5b('0x43')));});},'AgentCapacity':function(_0x4afd82){var _0x18fc04=this;return new Promise(function(_0x3d5a16,_0x590063){if(_0x58dc98[_0xac5b('0x3d')]['hasOwnProperty'](_0x4afd82['id'])){for(var _0x3be074 in _0x4afd82[_0xac5b('0x44')]){if(_0x4afd82[_0xac5b('0x44')]['hasOwnProperty'](_0x3be074)){if(_0x58dc98[_0xac5b('0x3d')][_0x4afd82['id']][_0xac5b('0x45')](_0x3be074+_0xac5b('0x46'))){_0x58dc98[_0xac5b('0x3d')][_0x4afd82['id']][_0x3be074+_0xac5b('0x46')]=parseInt(_0x4afd82['capacity'][_0x3be074],0xa);}}}_0x58dc98['agents'][_0x4afd82['id']]['updateRealtime']();return _0x3d5a16({'code':0xc8,'message':_0x58dc98[_0xac5b('0x3d')][_0x4afd82['id']]});}else{return _0x590063(_0x18fc04[_0xac5b('0x33')](0x1f4,_0xac5b('0x47')));}});},'Agents':function(_0x5e17b8){return new Promise(function(_0x3ccea0,_0x1fc9bc){var _0x3decab=_[_0xac5b('0x48')](_0x58dc98[_0xac5b('0x3d')]);_0x3ccea0({'count':_0x3decab[_0xac5b('0x1d')],'rows':_0x3decab});});},'ChatQueues':function(_0x568262){return new Promise(function(_0x55f1d2,_0x578c93){var _0x18792a=[];for(var _0x1c627f in _0x58dc98[_0xac5b('0x49')]){if(_0x58dc98[_0xac5b('0x49')][_0xac5b('0x45')](_0x1c627f)){var _0x4d2d4d=_0x58dc98[_0xac5b('0x49')][_0x1c627f];var _0x439be6={'id':_0x4d2d4d['id'],'available':_0x4d2d4d[_0xac5b('0x4a')],'loggedIn':_0x4d2d4d[_0xac5b('0x4b')],'name':_0x4d2d4d['name'],'paused':_0x4d2d4d[_0xac5b('0x4c')],'waiting':_0x4d2d4d[_0xac5b('0x4d')]};_0x18792a['push'](_0x439be6);}}_0x55f1d2({'count':_0x18792a[_0xac5b('0x1d')],'rows':_0x18792a});});},'MailQueues':function(_0x108081){return new Promise(function(_0x3deff0,_0x59fa3d){var _0x3ebe9a=[];for(var _0x5797ba in _0x58dc98[_0xac5b('0x4e')]){if(_0x58dc98['mailQueues'][_0xac5b('0x45')](_0x5797ba)){var _0x527b7f=_0x58dc98[_0xac5b('0x4e')][_0x5797ba];var _0x5bcc27={'id':_0x527b7f['id'],'available':_0x527b7f[_0xac5b('0x4a')],'loggedIn':_0x527b7f[_0xac5b('0x4b')],'name':_0x527b7f[_0xac5b('0x4f')],'paused':_0x527b7f[_0xac5b('0x4c')],'waiting':_0x527b7f['waiting']};_0x3ebe9a[_0xac5b('0x22')](_0x5bcc27);}}_0x3deff0({'count':_0x3ebe9a['length'],'rows':_0x3ebe9a});});},'OpenchannelQueues':function(_0x5b9925){return new Promise(function(_0x2a8284,_0x487fc8){var _0x4f9f15=[];for(var _0x2659f2 in _0x58dc98['openchannelQueues']){if(_0x58dc98[_0xac5b('0x50')][_0xac5b('0x45')](_0x2659f2)){var _0x26455a=_0x58dc98[_0xac5b('0x50')][_0x2659f2];var _0x485528={'id':_0x26455a['id'],'available':_0x26455a[_0xac5b('0x4a')],'loggedIn':_0x26455a[_0xac5b('0x4b')],'name':_0x26455a[_0xac5b('0x4f')],'paused':_0x26455a[_0xac5b('0x4c')],'waiting':_0x26455a[_0xac5b('0x4d')]};_0x4f9f15[_0xac5b('0x22')](_0x485528);}}_0x2a8284({'count':_0x4f9f15['length'],'rows':_0x4f9f15});});},'SmsQueues':function(_0xbcbb15){return new Promise(function(_0x1891b8,_0x2e8a72){var _0x4b6d41=[];for(var _0x39f2e2 in _0x58dc98[_0xac5b('0x51')]){if(_0x58dc98[_0xac5b('0x51')]['hasOwnProperty'](_0x39f2e2)){var _0x4a1787=_0x58dc98['smsQueues'][_0x39f2e2];var _0x4b6f7e={'id':_0x4a1787['id'],'available':_0x4a1787[_0xac5b('0x4a')],'loggedIn':_0x4a1787[_0xac5b('0x4b')],'name':_0x4a1787['name'],'paused':_0x4a1787['paused'],'waiting':_0x4a1787[_0xac5b('0x4d')]};_0x4b6d41['push'](_0x4b6f7e);}}_0x1891b8({'count':_0x4b6d41[_0xac5b('0x1d')],'rows':_0x4b6d41});});},'FaxQueues':function(_0x657ac1){return new Promise(function(_0x83252a,_0x3910cb){var _0x3fe636=[];for(var _0x16ea7c in _0x58dc98[_0xac5b('0x52')]){if(_0x58dc98[_0xac5b('0x52')]['hasOwnProperty'](_0x16ea7c)){var _0x1a7c4d=_0x58dc98[_0xac5b('0x52')][_0x16ea7c];var _0xccf7c9={'id':_0x1a7c4d['id'],'available':_0x1a7c4d[_0xac5b('0x4a')],'loggedIn':_0x1a7c4d[_0xac5b('0x4b')],'name':_0x1a7c4d[_0xac5b('0x4f')],'paused':_0x1a7c4d[_0xac5b('0x4c')],'waiting':_0x1a7c4d[_0xac5b('0x4d')]};_0x3fe636[_0xac5b('0x22')](_0xccf7c9);}}_0x83252a({'count':_0x3fe636[_0xac5b('0x1d')],'rows':_0x3fe636});});},'WhatsappQueues':function(_0x15d7e1){return new Promise(function(_0x58f56a,_0x3872e5){var _0x4040d5=[];for(var _0x4b398d in _0x58dc98[_0xac5b('0x53')]){if(_0x58dc98[_0xac5b('0x53')][_0xac5b('0x45')](_0x4b398d)){var _0x4cc1f5=_0x58dc98[_0xac5b('0x53')][_0x4b398d];var _0x3d863d={'id':_0x4cc1f5['id'],'available':_0x4cc1f5[_0xac5b('0x4a')],'loggedIn':_0x4cc1f5[_0xac5b('0x4b')],'name':_0x4cc1f5[_0xac5b('0x4f')],'paused':_0x4cc1f5['paused'],'waiting':_0x4cc1f5[_0xac5b('0x4d')]};_0x4040d5[_0xac5b('0x22')](_0x3d863d);}}_0x58f56a({'count':_0x4040d5[_0xac5b('0x1d')],'rows':_0x4040d5});});},'ChatQueuesWaitingInteractions':function(_0x405a4f){return new Promise(function(_0x47bb31,_0x239cd3){var _0x5e0f21=_[_0xac5b('0x48')](_0x58dc98['chatQueuesWaitingInteractions']);_0x47bb31({'count':_0x5e0f21[_0xac5b('0x1d')],'rows':_0x5e0f21});});},'MailQueuesWaitingInteractions':function(_0x372c9d){return new Promise(function(_0x29fe5b,_0x5f3a78){var _0x3eefe8=_[_0xac5b('0x48')](_0x58dc98[_0xac5b('0x54')]);_0x29fe5b({'count':_0x3eefe8[_0xac5b('0x1d')],'rows':_0x3eefe8});});},'OpenchannelQueuesWaitingInteractions':function(_0x395ea1){return new Promise(function(_0x12aeb0,_0x337890){var _0x3b29cf=_[_0xac5b('0x48')](_0x58dc98[_0xac5b('0x55')]);_0x12aeb0({'count':_0x3b29cf[_0xac5b('0x1d')],'rows':_0x3b29cf});});},'SmsQueuesWaitingInteractions':function(_0x5afd95){return new Promise(function(_0x1e95b8,_0x56fc0a){var _0x49313d=_[_0xac5b('0x48')](_0x58dc98['smsQueuesWaitingInteractions']);_0x1e95b8({'count':_0x49313d[_0xac5b('0x1d')],'rows':_0x49313d});});},'FaxQueuesWaitingInteractions':function(_0x5eb092){return new Promise(function(_0x30445a,_0x2f56c9){var _0xba4109=_['values'](_0x58dc98[_0xac5b('0x56')]);_0x30445a({'count':_0xba4109['length'],'rows':_0xba4109});});},'WhatsappQueuesWaitingInteractions':function(_0x210930){return new Promise(function(_0x5e6f6c,_0x269e2d){var _0x4038d3=_['values'](_0x58dc98['whatsappQueuesWaitingInteractions']);_0x5e6f6c({'count':_0x4038d3[_0xac5b('0x1d')],'rows':_0x4038d3});});}};var _0x5f1850=jayson['server'](_0x3bad56)[_0xac5b('0x57')]();_0x5f1850['on'](_0xac5b('0x33'),function(_0xf05f66){logger[_0xac5b('0x33')](JSON[_0xac5b('0x58')](_0xf05f66));return _0x5e1482(_0xf05f66);});_0x5f1850[_0xac5b('0x17')](0x232c,'127.0.0.1',function(){console[_0xac5b('0x59')](_0xac5b('0x5a'),0x232c);return _0xab11ec('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
index cebbfe9..af041a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1f2=['some','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all'];(function(_0xb6d355,_0x2879e0){var _0x5ee370=function(_0x595a37){while(--_0x595a37){_0xb6d355['push'](_0xb6d355['shift']());}};_0x5ee370(++_0x2879e0);}(_0xc1f2,0x126));var _0x2c1f=function(_0x137ef8,_0x3384dc){_0x137ef8=_0x137ef8-0x0;var _0x3b7d28=_0xc1f2[_0x137ef8];return _0x3b7d28;};'use strict';var util=require(_0x2c1f('0x0'));var BPromise=require(_0x2c1f('0x1'));var jayson=require(_0x2c1f('0x2'));var _=require(_0x2c1f('0x3'));var logger=require(_0x2c1f('0x4'))(_0x2c1f('0x5'));var client=jayson[_0x2c1f('0x6')][_0x2c1f('0x7')]({'port':0x232a});function request(_0x2bc168,_0x3f10a2){return new BPromise(function(_0xd8d185,_0x33a4cd){return client[_0x2c1f('0x8')](_0x2bc168,_0x3f10a2)[_0x2c1f('0x9')](function(_0x43fdb4){if(_0x43fdb4[_0x2c1f('0xa')]){return _0x33a4cd(_0x43fdb4['error'][_0x2c1f('0xb')]);}else{return _0xd8d185(_0x43fdb4[_0x2c1f('0xc')]);}})[_0x2c1f('0xd')](function(_0xc4ef7e){return _0x33a4cd(_0xc4ef7e);});});}exports[_0x2c1f('0xe')]=function(_0x1e9b27,_0x4c8bd7,_0x1da513){return function(_0x351b38){if(_0x1da513[_0x2c1f('0xf')]&&!_0x1da513[_0x2c1f('0xf')][_0x1e9b27]){logger[_0x2c1f('0x10')](_0x2c1f('0x11'),_0x1e9b27);return _0x351b38['stop']();}var _0x23ef21=[];for(var _0x2ce486=0x0;_0x2ce486<_0x4c8bd7[_0x2c1f('0x12')];_0x2ce486+=0x1){_0x23ef21['push'](request(_0x2c1f('0x13'),{'command':util[_0x2c1f('0x14')](_0x2c1f('0x15'),_0x4c8bd7[_0x2ce486])})['then'](function(_0x1615a0){return _0x1615a0&&_0x1615a0[_0x2c1f('0xb')]&&_0x1615a0['message'][_0x2c1f('0x16')](_0x2c1f('0x17'))>=0x0?!![]:![];})['catch'](function(_0x57156d){logger[_0x2c1f('0xa')](_0x2c1f('0x18'),_0x1e9b27,_0x4c8bd7[_0x2ce486]);}));}BPromise[_0x2c1f('0x19')](_0x23ef21)[_0x2c1f('0x9')](function(_0x588dce){var _0x35b83e=_[_0x2c1f('0x1a')](_0x588dce);logger['info'](_0x2c1f('0x1b'),_0x1e9b27,_0x4c8bd7[_0x2c1f('0x1c')]('\x20|\x20'),_0x35b83e);_0x351b38[_0x2c1f('0x1d')](_0x35b83e);})[_0x2c1f('0xd')](function(_0x3c7b77){console['log'](_0x3c7b77);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x1e9b27,_0x4c8bd7['join'](_0x2c1f('0x1e')),_0x3c7b77[_0x2c1f('0x1f')]);_0x351b38['stop']();});};};
\ No newline at end of file
+var _0x81de=['condition','rules','info','stop','length','push','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','lodash','../../../config/logger','routing','client','request','then','error','message','result','catch'];(function(_0x16a2d0,_0x428248){var _0x453d43=function(_0x420cbd){while(--_0x420cbd){_0x16a2d0['push'](_0x16a2d0['shift']());}};_0x453d43(++_0x428248);}(_0x81de,0x150));var _0xe81d=function(_0x1f18c8,_0x4a4190){_0x1f18c8=_0x1f18c8-0x0;var _0x43c474=_0x81de[_0x1f18c8];return _0x43c474;};'use strict';var util=require(_0xe81d('0x0'));var BPromise=require(_0xe81d('0x1'));var jayson=require('jayson/promise');var _=require(_0xe81d('0x2'));var logger=require(_0xe81d('0x3'))(_0xe81d('0x4'));var client=jayson[_0xe81d('0x5')]['http']({'port':0x232a});function request(_0x33c607,_0x5456ee){return new BPromise(function(_0x382d18,_0x2de11e){return client[_0xe81d('0x6')](_0x33c607,_0x5456ee)[_0xe81d('0x7')](function(_0x1402db){if(_0x1402db[_0xe81d('0x8')]){return _0x2de11e(_0x1402db[_0xe81d('0x8')][_0xe81d('0x9')]);}else{return _0x382d18(_0x1402db[_0xe81d('0xa')]);}})[_0xe81d('0xb')](function(_0xbf9448){return _0x2de11e(_0xbf9448);});});}exports[_0xe81d('0xc')]=function(_0x4c04ea,_0x39e2eb,_0x14a7fc){return function(_0x282fd2){if(_0x14a7fc['rules']&&!_0x14a7fc[_0xe81d('0xd')][_0x4c04ea]){logger[_0xe81d('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4c04ea);return _0x282fd2[_0xe81d('0xf')]();}var _0x9a394f=[];for(var _0x2218d2=0x0;_0x2218d2<_0x39e2eb[_0xe81d('0x10')];_0x2218d2+=0x1){_0x9a394f[_0xe81d('0x11')](request('Command',{'command':util['format'](_0xe81d('0x12'),_0x39e2eb[_0x2218d2])})[_0xe81d('0x7')](function(_0x3d3376){return _0x3d3376&&_0x3d3376['message']&&_0x3d3376['message']['indexOf'](_0xe81d('0x13'))>=0x0?!![]:![];})[_0xe81d('0xb')](function(_0x28768e){logger[_0xe81d('0x8')](_0xe81d('0x14'),_0x4c04ea,_0x39e2eb[_0x2218d2]);}));}BPromise[_0xe81d('0x15')](_0x9a394f)[_0xe81d('0x7')](function(_0x561147){var _0xaeb7c4=_[_0xe81d('0x16')](_0x561147);logger[_0xe81d('0xe')](_0xe81d('0x17'),_0x4c04ea,_0x39e2eb[_0xe81d('0x18')](_0xe81d('0x19')),_0xaeb7c4);_0x282fd2[_0xe81d('0x1a')](_0xaeb7c4);})[_0xe81d('0xb')](function(_0x4c0ecf){console[_0xe81d('0x1b')](_0x4c0ecf);logger[_0xe81d('0x8')](_0xe81d('0x17'),_0x4c04ea,_0x39e2eb[_0xe81d('0x18')](_0xe81d('0x19')),_0x4c0ecf[_0xe81d('0x1c')]);_0x282fd2[_0xe81d('0xf')]();});};};
\ No newline at end of file
index bd3a664..ac9507e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41bb=['transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','transfertargetuniqueid','clone','hangup','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','complete','[%s][agents][hangup]','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','destuniqueid','lastevent','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','ringtime','talktime','push','error','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','answered_elsewhere','reason','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind'];(function(_0x4b42c6,_0x5a077d){var _0x387df9=function(_0x38ddda){while(--_0x38ddda){_0x4b42c6['push'](_0x4b42c6['shift']());}};_0x387df9(++_0x5a077d);}(_0x41bb,0xc5));var _0xb41b=function(_0x47b449,_0x403996){_0x47b449=_0x47b449-0x0;var _0x303f97=_0x41bb[_0x47b449];return _0x303f97;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x428431,_0x4d5578){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x4'),_0x428431[_0xb41b('0x5')],_0x428431['channel'],_0x428431[_0xb41b('0x6')],_0x428431[_0xb41b('0x7')],_0x428431[_0xb41b('0x8')],_0x428431['calleridnum'],_0x428431['connectedlinenum'],_0x428431['lastevent']));if(_0x428431[_0xb41b('0x6')]){utils[_0xb41b('0x9')](_0x428431['queue'])[_0xb41b('0xa')](function(_0x2c1a53){if(_0x2c1a53){_0x428431[_0xb41b('0xb')]=_0x2c1a53[_0xb41b('0xb')];_0x428431[_0xb41b('0xc')]=_0x428431[_0xb41b('0xd')]?_0x2c1a53[_0xb41b('0xe')]:![];_0x428431['acwtime']=_0x428431[_0xb41b('0xc')]?_0x2c1a53['acwTimeout']:0x0;}utils[_0xb41b('0xf')](_0xb41b('0x10'),_0x428431);});}else{utils[_0xb41b('0xf')](_0xb41b('0x10'),_0x428431);}if(_0x4d5578){delete transfers[_0x428431[_0xb41b('0x5')]];}else{delete agents[_0x428431['destuniqueid']];}}exports[_0xb41b('0x11')]=function(_0x2d947a){try{utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x13'),_0x2d947a['uniqueid']),_0x2d947a);agents[_0x2d947a['destuniqueid']]=_0x2d947a;agents[_0x2d947a['destuniqueid']][_0xb41b('0x14')]=utils[_0xb41b('0x15')]();agents[_0x2d947a[_0xb41b('0x16')]][_0xb41b('0x17')]=_0xb41b('0x18');agents[_0x2d947a['destuniqueid']][_0xb41b('0x19')]=null;agents[_0x2d947a[_0xb41b('0x16')]][_0xb41b('0x1a')]=null;utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x1b'),_0x2d947a[_0xb41b('0x5')],agents[_0x2d947a['destuniqueid']]['membername'],_0x2d947a['destuniqueid']));}catch(_0xf109f8){utils['error'](util[_0xb41b('0x3')](_0xb41b('0x13'),_0x2d947a[_0xb41b('0x5')]),_0xf109f8);}};exports['agentringnoanswer']=function(_0x53bc44){try{if(!_[_0xb41b('0x1c')](agents[_0x53bc44[_0xb41b('0x16')]])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x1d'),_0x53bc44[_0xb41b('0x5')]),_0x53bc44);utils['info'](util['format'](_0xb41b('0x1e'),_0x53bc44[_0xb41b('0x5')],agents[_0x53bc44[_0xb41b('0x16')]]['membername'],_0x53bc44[_0xb41b('0x16')]));agents[_0x53bc44[_0xb41b('0x16')]]['agentringnoanswer']=!![];agents[_0x53bc44[_0xb41b('0x16')]][_0xb41b('0x1f')]=utils['now']();agents[_0x53bc44[_0xb41b('0x16')]]['lastevent']=_0xb41b('0x20');agents[_0x53bc44[_0xb41b('0x16')]]['reason']=_0xb41b('0x20');agents[_0x53bc44[_0xb41b('0x16')]]['holdtime']=_0x53bc44['ringtime']?parseInt(_0x53bc44[_0xb41b('0x21')])/0x3e8:0x0;agents[_0x53bc44[_0xb41b('0x16')]][_0xb41b('0x22')]=0x0;unanswered[_0xb41b('0x23')](_0x53bc44[_0xb41b('0x16')]);}}catch(_0x181cbd){utils[_0xb41b('0x24')](util['format'](_0xb41b('0x1d'),_0x53bc44[_0xb41b('0x5')]),_0x181cbd);}};exports['queuecallerabandon']=function(_0xe64568){try{_['forIn'](agents,function(_0x38277f,_0x31d4cd){if(_0x38277f['uniqueid']==_0xe64568[_0xb41b('0x5')]&&!_['includes'](unanswered,_0x38277f[_0xb41b('0x16')])){utils[_0xb41b('0x12')](util['format'](_0xb41b('0x25'),_0xe64568[_0xb41b('0x5')]),_0xe64568);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x26'),_0xe64568[_0xb41b('0x5')],_0x38277f[_0xb41b('0x7')],_0x38277f[_0xb41b('0x16')]));_0x38277f[_0xb41b('0x27')]=!![];_0x38277f[_0xb41b('0x1f')]=utils['now']();_0x38277f[_0xb41b('0x17')]='abandoned';_0x38277f['reason']=_0xb41b('0x28');_0x38277f[_0xb41b('0x29')]=_0xe64568[_0xb41b('0x29')];_0x38277f[_0xb41b('0x22')]=0x0;writeDB(_0x38277f);}});}catch(_0x1b8681){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x25'),_0xe64568[_0xb41b('0x5')]),_0x1b8681);}};exports[_0xb41b('0x2a')]=function(_0x3a06a0){try{if(agents[_0x3a06a0['destuniqueid']]){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x2b'),_0x3a06a0[_0xb41b('0x5')]),_0x3a06a0);utils[_0xb41b('0x2')](util[_0xb41b('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x3a06a0['uniqueid'],agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x7')],_0x3a06a0['destuniqueid']));agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x2c')]=utils[_0xb41b('0x15')]();agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x19')]=_0x3a06a0['connectedlinenum'];agents[_0x3a06a0[_0xb41b('0x16')]]['connectedlinename']=_0x3a06a0[_0xb41b('0x1a')];agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x29')]=_0x3a06a0[_0xb41b('0x21')];agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x17')]=_0xb41b('0x2d');_[_0xb41b('0x2e')](agents,function(_0x2b0721,_0x578b67){if(_0x2b0721['destuniqueid']!=_0x3a06a0['destuniqueid']&&_0x2b0721[_0xb41b('0x5')]==_0x3a06a0['uniqueid']){_0x2b0721['talktime']=0x0;_0x2b0721[_0xb41b('0x29')]=_0x3a06a0['ringtime'];_0x2b0721[_0xb41b('0x27')]=!![];_0x2b0721[_0xb41b('0x1f')]=utils[_0xb41b('0x15')]();_0x2b0721[_0xb41b('0x17')]=_0xb41b('0x2f');_0x2b0721[_0xb41b('0x30')]=_0xb41b('0x2f');_0x2b0721['answeredelsewheredestinationuniqueid']=_0x3a06a0[_0xb41b('0x16')];_0x2b0721[_0xb41b('0x31')]=_0x3a06a0[_0xb41b('0x7')];writeDB(_0x2b0721);}});}}catch(_0x174d6c){utils['error'](util[_0xb41b('0x3')]('[%s][agents][agentconnect]',_0x3a06a0[_0xb41b('0x5')]),_0x174d6c);}};exports[_0xb41b('0xd')]=function(_0x46dbbf){try{if(!_['isNil'](agents[_0x46dbbf['destuniqueid']])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x32'),_0x46dbbf[_0xb41b('0x5')]),_0x46dbbf);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x33'),_0x46dbbf['uniqueid'],agents[_0x46dbbf['destuniqueid']][_0xb41b('0x7')],_0x46dbbf['destuniqueid']));agents[_0x46dbbf[_0xb41b('0x16')]]['agentcomplete']=!![];agents[_0x46dbbf[_0xb41b('0x16')]]['agentcompleteAt']=utils[_0xb41b('0x15')]();agents[_0x46dbbf['destuniqueid']][_0xb41b('0x22')]=utils[_0xb41b('0x34')](agents[_0x46dbbf[_0xb41b('0x16')]][_0xb41b('0x35')],agents[_0x46dbbf['destuniqueid']][_0xb41b('0x2c')]);agents[_0x46dbbf[_0xb41b('0x16')]]['reason']=_0x46dbbf[_0xb41b('0x30')];agents[_0x46dbbf['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x46dbbf['destuniqueid']]);}}catch(_0x263d8d){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x32'),_0x46dbbf[_0xb41b('0x5')]),_0x263d8d);}};exports[_0xb41b('0x36')]=function(_0x34d076){try{if(!_[_0xb41b('0x1c')](agents[_0x34d076[_0xb41b('0x37')]])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x38'),_0x34d076[_0xb41b('0x5')]),_0x34d076);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x39'),_0x34d076['uniqueid'],agents[_0x34d076[_0xb41b('0x37')]]['membername'],agents[_0x34d076['transfereruniqueid']][_0xb41b('0x5')]));agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3a')]=!![];agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3b')]=_0xb41b('0x3c');agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3d')]=_0x34d076[_0xb41b('0x3e')];agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3f')]=agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x5')];}}catch(_0x3ce89e){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x38'),_0x34d076[_0xb41b('0x5')]),_0x3ce89e);}};exports[_0xb41b('0x40')]=function(_0x247ca0){try{utils[_0xb41b('0x12')](util['format'](_0xb41b('0x41'),_0x247ca0['origtransfereruniqueid']),_0x247ca0);if(_0x247ca0[_0xb41b('0x42')]==_0x247ca0[_0xb41b('0x43')]){if(!_[_0xb41b('0x1c')](agents[_0x247ca0[_0xb41b('0x44')]])){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x45'),_0x247ca0['origtransfereruniqueid'],agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x7')]));agents[_0x247ca0[_0xb41b('0x44')]]['transfer']=!![];agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x3b')]=_0xb41b('0x46');agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x3d')]=_0x247ca0[_0xb41b('0x47')];agents[_0x247ca0[_0xb41b('0x44')]]['transferuniqueid']=_0x247ca0['origtransfereruniqueid'];}if(_0x247ca0[_0xb41b('0x48')]&&agents[_0x247ca0[_0xb41b('0x48')]]){agents[_0x247ca0['transfereeuniqueid']][_0xb41b('0x49')]=0x1;transfers[_0x247ca0[_0xb41b('0x48')]]=_['clone'](agents[_0x247ca0[_0xb41b('0x48')]]);transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x4a')]=agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x4a')];transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x4b')]=agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x4b')];transfers[_0x247ca0[_0xb41b('0x48')]]['agentcalledAt']=utils[_0xb41b('0x15')]();transfers[_0x247ca0[_0xb41b('0x48')]]['agentconnectAt']=utils['now']();transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x29')]=0x0;transfers[_0x247ca0[_0xb41b('0x48')]]['agententerreason']=0x2;}}else if(_0x247ca0[_0xb41b('0x44')]==_0x247ca0[_0xb41b('0x4c')]){if(!_[_0xb41b('0x1c')](agents[_0x247ca0[_0xb41b('0x42')]])){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x45'),_0x247ca0[_0xb41b('0x42')],agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x7')]));agents[_0x247ca0['origtransfereruniqueid']][_0xb41b('0x3a')]=!![];agents[_0x247ca0[_0xb41b('0x42')]]['transfertype']=_0xb41b('0x46');agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x3d')]=_0x247ca0['secondtransfererexten'];agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x3f')]=_0x247ca0[_0xb41b('0x44')];}if(_0x247ca0[_0xb41b('0x4d')]&&agents[_0x247ca0[_0xb41b('0x4d')]]){agents[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x49')]=0x1;transfers[_0x247ca0[_0xb41b('0x4d')]]=_[_0xb41b('0x4e')](agents[_0x247ca0[_0xb41b('0x4d')]]);transfers[_0x247ca0['transfertargetuniqueid']]['calleridnum']=agents[_0x247ca0['origtransfereruniqueid']]['calleridnum'];transfers[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x4b')]=agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x4b')];transfers[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x14')]=utils['now']();transfers[_0x247ca0[_0xb41b('0x4d')]]['agentconnectAt']=utils[_0xb41b('0x15')]();transfers[_0x247ca0['transfertargetuniqueid']][_0xb41b('0x29')]=0x0;transfers[_0x247ca0['transfertargetuniqueid']][_0xb41b('0x49')]=0x2;}}}catch(_0xc2afd1){utils['error'](util[_0xb41b('0x3')](_0xb41b('0x41'),_0x247ca0[_0xb41b('0x42')]),_0xc2afd1);}};exports[_0xb41b('0x4f')]=function(_0x39f6ad){try{utils[_0xb41b('0x12')](util[_0xb41b('0x3')]('[%s][agents][hangup]',_0x39f6ad[_0xb41b('0x5')]),_0x39f6ad);if(agents[_0x39f6ad['uniqueid']]&&agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]===_0xb41b('0x20')){if(_0x39f6ad['cause']==='21'){agents[_0x39f6ad['uniqueid']]['reason']='rejected';agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]=_0xb41b('0x50');}utils['info'](util['format'](_0xb41b('0x51'),_0x39f6ad[_0xb41b('0x5')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x7')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')],agents[_0x39f6ad[_0xb41b('0x5')]]['lastevent']));writeDB(agents[_0x39f6ad['uniqueid']]);var _0x303ca3=unanswered[_0xb41b('0x52')](_0x39f6ad['uniqueid']);if(_0x303ca3>-0x1){unanswered[_0xb41b('0x53')](_0x303ca3,0x1);}}if(transfers[_0x39f6ad['uniqueid']]){transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0xd')]=!![];transfers[_0x39f6ad['uniqueid']][_0xb41b('0x35')]=utils[_0xb41b('0x15')]();transfers[_0x39f6ad['uniqueid']]['talktime']=utils[_0xb41b('0x34')](transfers[_0x39f6ad[_0xb41b('0x5')]]['agentcompleteAt'],transfers[_0x39f6ad[_0xb41b('0x5')]]['agentconnectAt']);transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]='agent';transfers[_0x39f6ad['uniqueid']][_0xb41b('0x17')]=_0xb41b('0x54');utils['info'](util[_0xb41b('0x3')](_0xb41b('0x51'),_0x39f6ad[_0xb41b('0x5')],transfers[_0x39f6ad['uniqueid']][_0xb41b('0x7')],transfers[_0x39f6ad['uniqueid']]['reason'],transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]));writeDB(transfers[_0x39f6ad[_0xb41b('0x5')]],!![]);}if(agents[_0x39f6ad[_0xb41b('0x5')]]&&agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x2c')]){agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0xd')]=!![];agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x35')]=utils[_0xb41b('0x15')]();agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x22')]=utils['diffTime'](agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x35')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x2c')]);agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]=agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x3a')]?'transfer':'agent';agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]=_0xb41b('0x54');utils['info'](util[_0xb41b('0x3')](_0xb41b('0x51'),_0x39f6ad['uniqueid'],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x7')],agents[_0x39f6ad['uniqueid']][_0xb41b('0x30')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]));writeDB(agents[_0x39f6ad[_0xb41b('0x5')]]);}}catch(_0x31c5c1){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x55'),_0x39f6ad[_0xb41b('0x5')]),_0x31c5c1);}};
\ No newline at end of file
+var _0xbc9d=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','lodash','util','./utils','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','debug','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','timeout','reason','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','talktime','answered_elsewhere','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected'];(function(_0x2df5ac,_0x173319){var _0x19b41c=function(_0x51c00a){while(--_0x51c00a){_0x2df5ac['push'](_0x2df5ac['shift']());}};_0x19b41c(++_0x173319);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x4b3ceb,_0x17e072){_0x4b3ceb=_0x4b3ceb-0x0;var _0x58ec2c=_0xbc9d[_0x4b3ceb];return _0x58ec2c;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var utils=require(_0xdbc9('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x434f6e,_0x35f89c){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x434f6e[_0xdbc9('0x3')],_0x434f6e[_0xdbc9('0x4')],_0x434f6e[_0xdbc9('0x5')],_0x434f6e[_0xdbc9('0x6')],_0x434f6e[_0xdbc9('0x7')],_0x434f6e[_0xdbc9('0x8')],_0x434f6e[_0xdbc9('0x9')],_0x434f6e['lastevent']));if(_0x434f6e[_0xdbc9('0x5')]){utils[_0xdbc9('0xa')](_0x434f6e[_0xdbc9('0x5')])['then'](function(_0x2c7ba5){if(_0x2c7ba5){_0x434f6e['type']=_0x2c7ba5['type'];_0x434f6e[_0xdbc9('0xb')]=_0x434f6e[_0xdbc9('0xc')]?_0x2c7ba5[_0xdbc9('0xd')]:![];_0x434f6e[_0xdbc9('0xe')]=_0x434f6e['agentacw']?_0x2c7ba5[_0xdbc9('0xf')]:0x0;}utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);});}else{utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);}if(_0x35f89c){delete transfers[_0x434f6e[_0xdbc9('0x3')]];}else{delete agents[_0x434f6e['destuniqueid']];}}exports['agentcalled']=function(_0x3d0fdd){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x3d0fdd);agents[_0x3d0fdd['destuniqueid']]=_0x3d0fdd;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x16')]=utils[_0xdbc9('0x17')]();agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x19');agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x9')]=null;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=null;utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x1c'),_0x3d0fdd[_0xdbc9('0x3')],agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x3d0fdd[_0xdbc9('0x15')]));}catch(_0x57a546){utils[_0xdbc9('0x1d')](util['format'](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x57a546);}};exports['agentringnoanswer']=function(_0x4408e9){try{if(!_['isNil'](agents[_0x4408e9['destuniqueid']])){utils['debug'](util['format'](_0xdbc9('0x1e'),_0x4408e9[_0xdbc9('0x3')]),_0x4408e9);utils['info'](util[_0xdbc9('0x13')](_0xdbc9('0x1f'),_0x4408e9['uniqueid'],agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x4408e9[_0xdbc9('0x15')]));agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x20')]=!![];agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();agents[_0x4408e9[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]]['holdtime']=_0x4408e9[_0xdbc9('0x24')]?parseInt(_0x4408e9[_0xdbc9('0x24')])/0x3e8:0x0;agents[_0x4408e9['destuniqueid']]['talktime']=0x0;unanswered[_0xdbc9('0x25')](_0x4408e9[_0xdbc9('0x15')]);}}catch(_0x473430){utils['error'](util[_0xdbc9('0x13')]('[%s][agents][agentringnoanswer]',_0x4408e9['uniqueid']),_0x473430);}};exports[_0xdbc9('0x26')]=function(_0x49da36){try{_['forIn'](agents,function(_0x417b17,_0x20eb4f){if(_0x417b17[_0xdbc9('0x3')]==_0x49da36['uniqueid']&&!_[_0xdbc9('0x27')](unanswered,_0x417b17[_0xdbc9('0x15')])){utils['debug'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x49da36);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x29'),_0x49da36[_0xdbc9('0x3')],_0x417b17[_0xdbc9('0x6')],_0x417b17['destuniqueid']));_0x417b17[_0xdbc9('0x20')]=!![];_0x417b17[_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();_0x417b17[_0xdbc9('0x18')]=_0xdbc9('0x2a');_0x417b17[_0xdbc9('0x23')]='abandoned';_0x417b17[_0xdbc9('0x2b')]=_0x49da36['holdtime'];_0x417b17['talktime']=0x0;writeDB(_0x417b17);}});}catch(_0x495c0e){utils['error'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x495c0e);}};exports[_0xdbc9('0x2c')]=function(_0x5527fc){try{if(agents[_0x5527fc[_0xdbc9('0x15')]]){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc[_0xdbc9('0x3')]),_0x5527fc);utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x2e'),_0x5527fc[_0xdbc9('0x3')],agents[_0x5527fc[_0xdbc9('0x15')]]['membername'],_0x5527fc[_0xdbc9('0x15')]));agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();agents[_0x5527fc['destuniqueid']]['connectedlinenum']=_0x5527fc[_0xdbc9('0x9')];agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=_0x5527fc[_0xdbc9('0x1a')];agents[_0x5527fc['destuniqueid']][_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];agents[_0x5527fc[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x30');_[_0xdbc9('0x31')](agents,function(_0x444219,_0x523c79){if(_0x444219[_0xdbc9('0x15')]!=_0x5527fc[_0xdbc9('0x15')]&&_0x444219['uniqueid']==_0x5527fc['uniqueid']){_0x444219[_0xdbc9('0x32')]=0x0;_0x444219[_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];_0x444219[_0xdbc9('0x20')]=!![];_0x444219['agentringnoanswerAt']=utils[_0xdbc9('0x17')]();_0x444219[_0xdbc9('0x18')]='answered_elsewhere';_0x444219[_0xdbc9('0x23')]=_0xdbc9('0x33');_0x444219['answeredelsewheredestinationuniqueid']=_0x5527fc[_0xdbc9('0x15')];_0x444219[_0xdbc9('0x34')]=_0x5527fc[_0xdbc9('0x6')];writeDB(_0x444219);}});}}catch(_0x3415c3){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc['uniqueid']),_0x3415c3);}};exports['agentcomplete']=function(_0x768856){try{if(!_[_0xdbc9('0x35')](agents[_0x768856[_0xdbc9('0x15')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x36'),_0x768856[_0xdbc9('0x3')]),_0x768856);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x37'),_0x768856[_0xdbc9('0x3')],agents[_0x768856['destuniqueid']]['membername'],_0x768856[_0xdbc9('0x15')]));agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0xc')]=!![];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x32')]=utils['diffTime'](agents[_0x768856['destuniqueid']][_0xdbc9('0x38')],agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x2f')]);agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0x768856[_0xdbc9('0x23')];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x18')]=_0xdbc9('0x39');writeDB(agents[_0x768856['destuniqueid']]);}}catch(_0x2c24a9){utils[_0xdbc9('0x1d')](util['format']('[%s][agents][agentcomplete]',_0x768856[_0xdbc9('0x3')]),_0x2c24a9);}};exports[_0xdbc9('0x3a')]=function(_0x133a13){try{if(!_['isNil'](agents[_0x133a13[_0xdbc9('0x3b')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13['uniqueid']),_0x133a13);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x3d'),_0x133a13[_0xdbc9('0x3')],agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x6')],agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3')]));agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3e')]=!![];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3f')]=_0xdbc9('0x40');agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x41')]=_0x133a13['extension'];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x42')]=agents[_0x133a13['transfereruniqueid']]['uniqueid'];}}catch(_0xc7335d){utils['error'](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13[_0xdbc9('0x3')]),_0xc7335d);}};exports['attendedtransfer']=function(_0x32b38d){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x32b38d);if(_0x32b38d[_0xdbc9('0x44')]==_0x32b38d[_0xdbc9('0x45')]){if(!_[_0xdbc9('0x35')](agents[_0x32b38d['secondtransfereruniqueid']])){utils['info'](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d[_0xdbc9('0x47')]]['membername']));agents[_0x32b38d['secondtransfereruniqueid']][_0xdbc9('0x3e')]=!![];agents[_0x32b38d[_0xdbc9('0x47')]]['transfertype']='ATTENDED';agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x48')];agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x44')];}if(_0x32b38d['transfereeuniqueid']&&agents[_0x32b38d[_0xdbc9('0x49')]]){agents[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d['transfereeuniqueid']]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x49')]]);transfers[_0x32b38d[_0xdbc9('0x49')]]['calleridnum']=agents[_0x32b38d[_0xdbc9('0x47')]]['calleridnum'];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4c')]=agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x16')]=utils['now']();transfers[_0x32b38d[_0xdbc9('0x49')]]['agentconnectAt']=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x49')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x2;}}else if(_0x32b38d['secondtransfereruniqueid']==_0x32b38d['secondtransfererlinkedid']){if(!_[_0xdbc9('0x35')](agents[_0x32b38d[_0xdbc9('0x44')]])){utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x6')]));agents[_0x32b38d[_0xdbc9('0x44')]]['transfer']=!![];agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x3f')]=_0xdbc9('0x4d');agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x4e')];agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x47')];}if(_0x32b38d['transfertargetuniqueid']&&agents[_0x32b38d[_0xdbc9('0x4f')]]){agents[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d[_0xdbc9('0x4f')]]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x4f')]]);transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x8')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x8')];transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x4c')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x4f')]]['agentcalledAt']=utils['now']();transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x4f')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x2;}}}catch(_0x53843c){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x53843c);}};exports[_0xdbc9('0x50')]=function(_0xfdfb20){try{utils['debug'](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20['uniqueid']),_0xfdfb20);if(agents[_0xfdfb20['uniqueid']]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]===_0xdbc9('0x22')){if(_0xfdfb20[_0xdbc9('0x52')]==='21'){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]=_0xdbc9('0x53');agents[_0xfdfb20['uniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x53');}utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x54'),_0xfdfb20[_0xdbc9('0x3')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);var _0x1afbcd=unanswered[_0xdbc9('0x55')](_0xfdfb20[_0xdbc9('0x3')]);if(_0x1afbcd>-0x1){unanswered['splice'](_0x1afbcd,0x1);}}if(transfers[_0xfdfb20['uniqueid']]){transfers[_0xfdfb20[_0xdbc9('0x3')]]['agentcomplete']=!![];transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();transfers[_0xfdfb20[_0xdbc9('0x3')]]['talktime']=utils[_0xdbc9('0x56')](transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')],transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x2f')]);transfers[_0xfdfb20[_0xdbc9('0x3')]]['reason']=_0xdbc9('0x57');transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20[_0xdbc9('0x3')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['membername'],transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['lastevent']));writeDB(transfers[_0xfdfb20[_0xdbc9('0x3')]],!![]);}if(agents[_0xfdfb20[_0xdbc9('0x3')]]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x2f')]){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0xc')]=!![];agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')]=utils['now']();agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x32')]=utils[_0xdbc9('0x56')](agents[_0xfdfb20[_0xdbc9('0x3')]]['agentcompleteAt'],agents[_0xfdfb20[_0xdbc9('0x3')]]['agentconnectAt']);agents[_0xfdfb20['uniqueid']][_0xdbc9('0x23')]=agents[_0xfdfb20[_0xdbc9('0x3')]]['transfer']?_0xdbc9('0x3e'):_0xdbc9('0x57');agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20['uniqueid'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]]['reason'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);}}catch(_0x1839e4){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20[_0xdbc9('0x3')]),_0x1839e4);}};
\ No newline at end of file
index 0d5ee9d..d40da36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b7=['format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','destinationchannel','answertime','now','toNumber','ANSWERED','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','starttime','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','source','value','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','[%s][calls][newexten]','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x00b7,0x13c));var _0x700b=function(_0x5cb7b0,_0x3b5793){_0x5cb7b0=_0x5cb7b0-0x0;var _0x448a44=_0x00b7[_0x5cb7b0];return _0x448a44;};'use strict';var _=require(_0x700b('0x0'));var util=require('util');var utils=require(_0x700b('0x1'));var transfers=require(_0x700b('0x2'));var dispositions=[_0x700b('0x3'),_0x700b('0x4'),_0x700b('0x4'),_0x700b('0x3'),_0x700b('0x3'),_0x700b('0x3'),'ANSWERED','BUSY',_0x700b('0x4'),'FAILED','FAILED'];var channels={};function writeDB(_0x2425d8){var _0x2bb6af;if(transfers[_0x700b('0x5')][_0x2425d8[_0x700b('0x6')]]){_0x2bb6af=_0x2425d8['uniqueid'];_0x2425d8[_0x700b('0x6')]=transfers[_0x700b('0x5')][_0x2425d8[_0x700b('0x6')]][_0x700b('0x7')];}utils['info'](util[_0x700b('0x8')](_0x700b('0x9'),_0x2425d8[_0x700b('0x6')],_0x2425d8[_0x700b('0xa')],_0x2425d8[_0x700b('0xb')],_0x2425d8[_0x700b('0xc')],_0x2425d8[_0x700b('0xd')],_0x2425d8[_0x700b('0xe')],_0x2425d8[_0x700b('0xf')],_0x2425d8['lastevent']));if(_0x2425d8[_0x700b('0x10')]){utils['getUserByInternal'](_0x2425d8[_0x700b('0x10')])['then'](function(_0x32b97b){if(_0x32b97b){_0x2425d8[_0x700b('0x11')]=_0x32b97b['id'];}utils['request']('CreateVoiceCallReport',_0x2425d8);});}else{utils[_0x700b('0x12')](_0x700b('0x13'),_0x2425d8);}if(channels[_0x2425d8['uniqueid']]){delete channels[_0x2425d8[_0x700b('0x6')]];}else if(_0x2bb6af&&channels[_0x2bb6af]){if(!transfers['blinds'][_0x2bb6af][_0x700b('0x14')])delete transfers[_0x700b('0x5')][_0x2bb6af];delete channels[_0x2bb6af];}}exports[_0x700b('0x15')]=function(_0x53b5f8){try{utils[_0x700b('0x16')](util['format'](_0x700b('0x17'),_0x53b5f8[_0x700b('0x6')]),_0x53b5f8);if(_0x53b5f8[_0x700b('0x6')]==_0x53b5f8[_0x700b('0x18')]&&_0x53b5f8['channel']!='OutgoingSpoolFailed'){utils[_0x700b('0x19')](util['format'](_0x700b('0x1a'),_0x53b5f8[_0x700b('0x6')],_0x53b5f8[_0x700b('0x1b')],_0x53b5f8['exten']));channels[_0x53b5f8[_0x700b('0x6')]]={'uniqueid':_0x53b5f8[_0x700b('0x6')],'accountcode':_0x53b5f8['accountcode'],'source':_0x53b5f8[_0x700b('0xe')],'destination':_0x53b5f8[_0x700b('0x1c')],'destinationcontext':_0x53b5f8['context'],'channel':_0x53b5f8['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x700b('0x3'),'amaflags':_0x700b('0x1d')};}}catch(_0x8f0866){utils[_0x700b('0x1e')](util['format'](_0x700b('0x17'),_0x53b5f8[_0x700b('0x6')]),_0x8f0866);}};exports[_0x700b('0x1f')]=function(_0x54e733){try{utils['debug'](util[_0x700b('0x8')](_0x700b('0x20'),_0x54e733['uniqueid']),_0x54e733);if(!_[_0x700b('0x21')](channels[_0x54e733['uniqueid']])&&_0x54e733[_0x700b('0x22')]==0x6){utils['info'](util[_0x700b('0x8')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x54e733[_0x700b('0x6')],_0x54e733[_0x700b('0x1b')],_0x54e733[_0x700b('0xa')]));if(_[_0x700b('0x21')](channels[_0x54e733[_0x700b('0x6')]]['systemanswertime'])){channels[_0x54e733[_0x700b('0x6')]][_0x700b('0x23')]=utils['now']();}}else if(!_['isNil'](channels[_0x54e733[_0x700b('0x18')]])&&_0x54e733[_0x700b('0x22')]==0x6&&_0x54e733[_0x700b('0x1b')]!='transfer'){utils[_0x700b('0x19')](util[_0x700b('0x8')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x54e733[_0x700b('0x6')],_0x54e733[_0x700b('0x18')],_0x54e733[_0x700b('0x1b')],_0x54e733['channel']));channels[_0x54e733[_0x700b('0x18')]][_0x700b('0x10')]=_0x54e733[_0x700b('0x10')];channels[_0x54e733[_0x700b('0x18')]][_0x700b('0x24')]=_0x54e733['channel'];if(_[_0x700b('0x21')](channels[_0x54e733[_0x700b('0x18')]]['answertime'])){channels[_0x54e733[_0x700b('0x18')]][_0x700b('0x25')]=utils[_0x700b('0x26')]();}channels[_0x54e733[_0x700b('0x18')]]['disposition']=dispositions[_[_0x700b('0x27')](_0x54e733[_0x700b('0x22')])]||_0x700b('0x28');}}catch(_0x121219){utils[_0x700b('0x1e')](util[_0x700b('0x8')](_0x700b('0x20'),_0x54e733[_0x700b('0x6')]),_0x121219);}};exports[_0x700b('0x29')]=function(_0x3d2d85){try{if(!_[_0x700b('0x21')](channels[_0x3d2d85[_0x700b('0x6')]])){utils[_0x700b('0x16')](util[_0x700b('0x8')](_0x700b('0x2a'),_0x3d2d85[_0x700b('0x6')]),_0x3d2d85);if(_[_0x700b('0x21')](channels[_0x3d2d85[_0x700b('0x6')]][_0x700b('0x2b')])){channels[_0x3d2d85[_0x700b('0x6')]][_0x700b('0x2b')]=_0x3d2d85['calleridname']+'\x20<'+_0x3d2d85[_0x700b('0xe')]+'>';}utils[_0x700b('0x19')](util[_0x700b('0x8')](_0x700b('0x2c'),_0x3d2d85[_0x700b('0x6')],channels[_0x3d2d85['uniqueid']][_0x700b('0x2b')],_0x3d2d85[_0x700b('0x2d')]));channels[_0x3d2d85['uniqueid']]['endtime']=utils[_0x700b('0x26')]();channels[_0x3d2d85[_0x700b('0x6')]][_0x700b('0x2e')]=utils['diffTime'](channels[_0x3d2d85[_0x700b('0x6')]]['endtime'],channels[_0x3d2d85['uniqueid']][_0x700b('0x2f')]);channels[_0x3d2d85[_0x700b('0x6')]][_0x700b('0x30')]=channels[_0x3d2d85[_0x700b('0x6')]][_0x700b('0x25')]?utils[_0x700b('0x31')](channels[_0x3d2d85[_0x700b('0x6')]]['endtime'],channels[_0x3d2d85[_0x700b('0x6')]][_0x700b('0x25')]):0x0;writeDB(channels[_0x3d2d85[_0x700b('0x6')]]);}}catch(_0x1ca311){utils[_0x700b('0x1e')](util['format'](_0x700b('0x2a'),_0x3d2d85[_0x700b('0x6')]),_0x1ca311);}};exports[_0x700b('0x32')]=function(_0x547636){try{if(!_['isNil'](channels[_0x547636['localtwolinkedid']])){utils[_0x700b('0x16')](util[_0x700b('0x8')](_0x700b('0x33'),_0x547636[_0x700b('0x34')]),_0x547636);if(channels[_0x547636[_0x700b('0x35')]][_0x700b('0xa')]==_0x547636[_0x700b('0x36')]){utils[_0x700b('0x19')](util[_0x700b('0x8')](_0x700b('0x37'),_0x547636[_0x700b('0x34')],_0x547636[_0x700b('0x35')],_0x547636[_0x700b('0x38')]));channels[_0x547636[_0x700b('0x35')]][_0x700b('0x24')]=_0x547636[_0x700b('0x38')];channels[_0x547636[_0x700b('0x35')]]['userfield']=_0x700b('0x39');}else if(channels[_0x547636['localtwolinkedid']][_0x700b('0xa')]=_0x547636['transfertargetchannel']){utils[_0x700b('0x19')](util['format'](_0x700b('0x37'),_0x547636[_0x700b('0x34')],_0x547636[_0x700b('0x35')],_0x547636[_0x700b('0x3a')]));channels[_0x547636[_0x700b('0x35')]][_0x700b('0x24')]=_0x547636[_0x700b('0x3a')];channels[_0x547636[_0x700b('0x35')]][_0x700b('0x3b')]='_attended';}}}catch(_0x201f7f){utils['error'](util[_0x700b('0x8')]('[%s][calls][attendedtransfer]',_0x547636[_0x700b('0x34')]),_0x201f7f);}};exports[_0x700b('0x3c')]=function(_0x142711){try{if(!_['isNil'](channels[_0x142711['uniqueid']])){utils[_0x700b('0x16')](util['format'](_0x700b('0x3d'),_0x142711[_0x700b('0x6')]),_0x142711);channels[_0x142711[_0x700b('0x6')]]['musiconholdstartAt']=utils['now']();utils['info'](util[_0x700b('0x8')](_0x700b('0x3e'),_0x142711['uniqueid'],channels[_0x142711[_0x700b('0x6')]][_0x700b('0x3f')]));}}catch(_0x410955){utils[_0x700b('0x1e')](util[_0x700b('0x8')](_0x700b('0x3d'),_0x142711['uniqueid']),_0x410955);}};exports[_0x700b('0x40')]=function(_0x582fe0){try{if(!_[_0x700b('0x21')](channels[_0x582fe0['uniqueid']])){utils[_0x700b('0x16')](util[_0x700b('0x8')](_0x700b('0x41'),_0x582fe0['uniqueid']),_0x582fe0);if(!_['isNil'](channels[_0x582fe0['uniqueid']][_0x700b('0x3f')])){channels[_0x582fe0[_0x700b('0x6')]][_0x700b('0x42')]+=utils[_0x700b('0x31')](utils[_0x700b('0x26')](),channels[_0x582fe0[_0x700b('0x6')]][_0x700b('0x3f')]);utils[_0x700b('0x19')](util[_0x700b('0x8')](_0x700b('0x43'),_0x582fe0[_0x700b('0x6')],channels[_0x582fe0[_0x700b('0x6')]][_0x700b('0x42')]));delete channels[_0x582fe0[_0x700b('0x6')]][_0x700b('0x3f')];}}}catch(_0x49f126){utils[_0x700b('0x1e')](util[_0x700b('0x8')](_0x700b('0x41'),_0x582fe0['uniqueid']),_0x49f126);}};exports['varset']=function(_0xa120e){try{if(!_[_0x700b('0x21')](channels[_0xa120e[_0x700b('0x6')]])){utils[_0x700b('0x16')](util[_0x700b('0x8')](_0x700b('0x44'),_0xa120e[_0x700b('0x6')]),_0xa120e);if(!_['isNil'](_0xa120e['variable'][_0x700b('0x45')])){utils['info'](util[_0x700b('0x8')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0xa120e[_0x700b('0x6')],_0xa120e['value']));channels[_0xa120e[_0x700b('0x6')]][_0x700b('0x46')]=_0xa120e[_0x700b('0x47')];}if(!_[_0x700b('0x21')](_0xa120e[_0x700b('0x48')]['xmd-phone'])){utils[_0x700b('0x19')](util[_0x700b('0x8')](_0x700b('0x49'),_0xa120e[_0x700b('0x6')],_0xa120e['value']));channels[_0xa120e['uniqueid']][_0x700b('0x4a')]=_0xa120e[_0x700b('0x47')];channels[_0xa120e[_0x700b('0x6')]]['callerid']='\x22'+_0xa120e[_0x700b('0x47')]+_0x700b('0x4b')+_0xa120e['value']+'>';}if(!_[_0x700b('0x21')](_0xa120e['variable'][_0x700b('0x4c')])||!_[_0x700b('0x21')](_0xa120e[_0x700b('0x48')][_0x700b('0x4d')])){utils[_0x700b('0x19')](util[_0x700b('0x8')](_0x700b('0x4e'),_0xa120e[_0x700b('0x6')],!_['isNil'](_0xa120e['variable']['xmd-callerid-preview'])?'xmd-callerid-preview':'xmd-callerid',_0xa120e[_0x700b('0x47')]));channels[_0xa120e[_0x700b('0x6')]][_0x700b('0x2b')]=_0xa120e[_0x700b('0x47')];}if(!_[_0x700b('0x21')](_0xa120e[_0x700b('0x48')]['xmd-queue'])||!_[_0x700b('0x21')](_0xa120e[_0x700b('0x48')][_0x700b('0x4f')])){utils[_0x700b('0x19')](util['format'](_0x700b('0x4e'),_0xa120e[_0x700b('0x6')],!_[_0x700b('0x21')](_0xa120e['variable'][_0x700b('0x50')])?_0x700b('0x50'):_0x700b('0x4f'),_0xa120e['value']));channels[_0xa120e['uniqueid']]['lastapplication']=_0x700b('0x51');channels[_0xa120e[_0x700b('0x6')]][_0x700b('0x52')]=_0xa120e['value'];channels[_0xa120e[_0x700b('0x6')]][_0x700b('0xb')]=!![];}if(!_[_0x700b('0x21')](_0xa120e[_0x700b('0x48')]['xmd-contactid'])){utils['info'](util[_0x700b('0x8')](_0x700b('0x53'),_0xa120e[_0x700b('0x6')],_0xa120e[_0x700b('0x47')]));channels[_0xa120e[_0x700b('0x6')]][_0x700b('0x54')]=_0xa120e[_0x700b('0x47')];}if(!_['isNil'](_0xa120e[_0x700b('0x48')][_0x700b('0x55')])){utils[_0x700b('0x19')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xa120e['uniqueid'],_0xa120e[_0x700b('0x47')]));channels[_0xa120e[_0x700b('0x6')]][_0x700b('0x56')]=_0xa120e[_0x700b('0x47')];}if(!_[_0x700b('0x21')](_0xa120e['variable'][_0x700b('0x57')])){utils['info'](util['format'](_0x700b('0x58'),_0xa120e['uniqueid'],_0xa120e[_0x700b('0x47')]));channels[_0xa120e[_0x700b('0x6')]][_0x700b('0x59')]=_0xa120e['value'];}if(!_['isNil'](_0xa120e['variable'][_0x700b('0x5a')])){utils[_0x700b('0x19')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xa120e[_0x700b('0x6')],_0xa120e[_0x700b('0x47')]));channels[_0xa120e['uniqueid']][_0x700b('0x5a')]=_0xa120e[_0x700b('0x47')];}}}catch(_0x4348fa){utils[_0x700b('0x1e')](util[_0x700b('0x8')](_0x700b('0x44'),_0xa120e[_0x700b('0x6')]),_0x4348fa);}};exports[_0x700b('0x5b')]=function(_0x4f8359){try{if(!_[_0x700b('0x21')](channels[_0x4f8359[_0x700b('0x6')]])){utils['debug'](util['format']('[%s][calls][newexten]',_0x4f8359[_0x700b('0x6')]),_0x4f8359);utils[_0x700b('0x19')](util[_0x700b('0x8')](_0x700b('0x5c'),_0x4f8359['uniqueid'],_0x4f8359[_0x700b('0x5d')],_0x4f8359['appdata']));if(_0x4f8359[_0x700b('0x5d')][_0x700b('0x5e')]()==_0x700b('0x5f')&&_[_0x700b('0x60')](_0x4f8359[_0x700b('0x61')]['toLowerCase'](),_0x700b('0x62'))){var _0x53f4ca=_0x4f8359[_0x700b('0x61')][_0x700b('0x63')]('=');var _0x2ce47a=_0x53f4ca[0x0][_0x700b('0x64')](_0x53f4ca[0x0][_0x700b('0x65')]('(')+0x1,_0x53f4ca[0x0]['lastIndexOf'](')'));var _0x47052d=_0x53f4ca[0x1];channels[_0x4f8359[_0x700b('0x6')]][_0x2ce47a]=_0x47052d;}if(!_[_0x700b('0x66')]([_0x700b('0x29'),_0x700b('0x67'),_0x700b('0x68'),'set',_0x700b('0x69')],_0x4f8359[_0x700b('0x5d')][_0x700b('0x5e')]())){channels[_0x4f8359['uniqueid']][_0x700b('0x6a')]=_0x4f8359[_0x700b('0x5d')];channels[_0x4f8359[_0x700b('0x6')]]['lastdata']=_0x4f8359[_0x700b('0x61')];}}}catch(_0x486d2f){utils[_0x700b('0x1e')](util['format'](_0x700b('0x6b'),_0x4f8359[_0x700b('0x6')]),_0x486d2f);}};
\ No newline at end of file
+var _0xe2fe=['variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','substring','lastIndexOf','noop','execif','gotoif','lodash','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','channel','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','request','CreateVoiceCallReport','recording','newchannel','debug','format','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0xee2f('0x1'));var dispositions=['NO\x20ANSWER',_0xee2f('0x2'),_0xee2f('0x2'),_0xee2f('0x3'),_0xee2f('0x3'),_0xee2f('0x3'),'ANSWERED',_0xee2f('0x4'),_0xee2f('0x2'),'FAILED',_0xee2f('0x2')];var channels={};function writeDB(_0x2e1c8c){var _0x5a7975;if(transfers[_0xee2f('0x5')][_0x2e1c8c['uniqueid']]){_0x5a7975=_0x2e1c8c[_0xee2f('0x6')];_0x2e1c8c[_0xee2f('0x6')]=transfers['blinds'][_0x2e1c8c[_0xee2f('0x6')]][_0xee2f('0x7')];}utils['info'](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2e1c8c['uniqueid'],_0x2e1c8c[_0xee2f('0x8')],_0x2e1c8c['queue'],_0x2e1c8c['membername'],_0x2e1c8c['interface'],_0x2e1c8c[_0xee2f('0x9')],_0x2e1c8c[_0xee2f('0xa')],_0x2e1c8c[_0xee2f('0xb')]));if(_0x2e1c8c[_0xee2f('0xc')]){utils[_0xee2f('0xd')](_0x2e1c8c[_0xee2f('0xc')])['then'](function(_0x3861e6){if(_0x3861e6){_0x2e1c8c['UserId']=_0x3861e6['id'];}utils[_0xee2f('0xe')](_0xee2f('0xf'),_0x2e1c8c);});}else{utils['request'](_0xee2f('0xf'),_0x2e1c8c);}if(channels[_0x2e1c8c[_0xee2f('0x6')]]){delete channels[_0x2e1c8c[_0xee2f('0x6')]];}else if(_0x5a7975&&channels[_0x5a7975]){if(!transfers[_0xee2f('0x5')][_0x5a7975][_0xee2f('0x10')])delete transfers['blinds'][_0x5a7975];delete channels[_0x5a7975];}}exports[_0xee2f('0x11')]=function(_0x4afcd1){try{utils[_0xee2f('0x12')](util[_0xee2f('0x13')]('[%s][calls][newchannel]',_0x4afcd1['uniqueid']),_0x4afcd1);if(_0x4afcd1[_0xee2f('0x6')]==_0x4afcd1['linkedid']&&_0x4afcd1[_0xee2f('0x8')]!=_0xee2f('0x14')){utils[_0xee2f('0x15')](util['format'](_0xee2f('0x16'),_0x4afcd1[_0xee2f('0x6')],_0x4afcd1[_0xee2f('0x17')],_0x4afcd1[_0xee2f('0x18')]));channels[_0x4afcd1[_0xee2f('0x6')]]={'uniqueid':_0x4afcd1['uniqueid'],'accountcode':_0x4afcd1['accountcode'],'source':_0x4afcd1[_0xee2f('0x9')],'destination':_0x4afcd1[_0xee2f('0x18')],'destinationcontext':_0x4afcd1[_0xee2f('0x17')],'channel':_0x4afcd1[_0xee2f('0x8')],'starttime':utils[_0xee2f('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xee2f('0x3'),'amaflags':_0xee2f('0x1a')};}}catch(_0x4d68d3){utils[_0xee2f('0x1b')](util[_0xee2f('0x13')](_0xee2f('0x1c'),_0x4afcd1[_0xee2f('0x6')]),_0x4d68d3);}};exports[_0xee2f('0x1d')]=function(_0xf77cf5){try{utils[_0xee2f('0x12')](util[_0xee2f('0x13')](_0xee2f('0x1e'),_0xf77cf5[_0xee2f('0x6')]),_0xf77cf5);if(!_[_0xee2f('0x1f')](channels[_0xf77cf5[_0xee2f('0x6')]])&&_0xf77cf5[_0xee2f('0x20')]==0x6){utils[_0xee2f('0x15')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0xf77cf5['uniqueid'],_0xf77cf5[_0xee2f('0x17')],_0xf77cf5[_0xee2f('0x8')]));if(_[_0xee2f('0x1f')](channels[_0xf77cf5[_0xee2f('0x6')]][_0xee2f('0x21')])){channels[_0xf77cf5[_0xee2f('0x6')]]['systemanswertime']=utils[_0xee2f('0x19')]();}}else if(!_['isNil'](channels[_0xf77cf5[_0xee2f('0x22')]])&&_0xf77cf5[_0xee2f('0x20')]==0x6&&_0xf77cf5[_0xee2f('0x17')]!=_0xee2f('0x23')){utils[_0xee2f('0x15')](util['format'](_0xee2f('0x24'),_0xf77cf5[_0xee2f('0x6')],_0xf77cf5['linkedid'],_0xf77cf5['context'],_0xf77cf5[_0xee2f('0x8')]));channels[_0xf77cf5['linkedid']][_0xee2f('0xc')]=_0xf77cf5[_0xee2f('0xc')];channels[_0xf77cf5['linkedid']][_0xee2f('0x25')]=_0xf77cf5['channel'];if(_['isNil'](channels[_0xf77cf5['linkedid']][_0xee2f('0x26')])){channels[_0xf77cf5[_0xee2f('0x22')]]['answertime']=utils[_0xee2f('0x19')]();}channels[_0xf77cf5[_0xee2f('0x22')]][_0xee2f('0x27')]=dispositions[_[_0xee2f('0x28')](_0xf77cf5[_0xee2f('0x20')])]||'ANSWERED';}}catch(_0x2c789d){utils['error'](util[_0xee2f('0x13')](_0xee2f('0x1e'),_0xf77cf5[_0xee2f('0x6')]),_0x2c789d);}};exports['hangup']=function(_0x169c75){try{if(!_['isNil'](channels[_0x169c75[_0xee2f('0x6')]])){utils['debug'](util[_0xee2f('0x13')](_0xee2f('0x29'),_0x169c75[_0xee2f('0x6')]),_0x169c75);if(_[_0xee2f('0x1f')](channels[_0x169c75[_0xee2f('0x6')]][_0xee2f('0x2a')])){channels[_0x169c75[_0xee2f('0x6')]][_0xee2f('0x2a')]=_0x169c75[_0xee2f('0x2b')]+'\x20<'+_0x169c75[_0xee2f('0x9')]+'>';}utils[_0xee2f('0x15')](util['format'](_0xee2f('0x2c'),_0x169c75['uniqueid'],channels[_0x169c75[_0xee2f('0x6')]][_0xee2f('0x2a')],_0x169c75[_0xee2f('0x2d')]));channels[_0x169c75[_0xee2f('0x6')]][_0xee2f('0x2e')]=utils[_0xee2f('0x19')]();channels[_0x169c75[_0xee2f('0x6')]][_0xee2f('0x2f')]=utils['diffTime'](channels[_0x169c75['uniqueid']]['endtime'],channels[_0x169c75[_0xee2f('0x6')]]['starttime']);channels[_0x169c75[_0xee2f('0x6')]]['billableseconds']=channels[_0x169c75['uniqueid']]['answertime']?utils['diffTime'](channels[_0x169c75[_0xee2f('0x6')]][_0xee2f('0x2e')],channels[_0x169c75[_0xee2f('0x6')]][_0xee2f('0x26')]):0x0;writeDB(channels[_0x169c75['uniqueid']]);}}catch(_0x5986f4){utils[_0xee2f('0x1b')](util['format']('[%s][calls][hangup]',_0x169c75[_0xee2f('0x6')]),_0x5986f4);}};exports[_0xee2f('0x30')]=function(_0x3a0949){try{if(!_['isNil'](channels[_0x3a0949[_0xee2f('0x31')]])){utils[_0xee2f('0x12')](util[_0xee2f('0x13')]('[%s][calls][attendedtransfer]',_0x3a0949['origtransfereruniqueid']),_0x3a0949);if(channels[_0x3a0949[_0xee2f('0x31')]][_0xee2f('0x8')]==_0x3a0949[_0xee2f('0x32')]){utils[_0xee2f('0x15')](util['format'](_0xee2f('0x33'),_0x3a0949[_0xee2f('0x34')],_0x3a0949[_0xee2f('0x31')],_0x3a0949[_0xee2f('0x35')]));channels[_0x3a0949[_0xee2f('0x31')]][_0xee2f('0x25')]=_0x3a0949[_0xee2f('0x35')];channels[_0x3a0949[_0xee2f('0x31')]][_0xee2f('0x36')]=_0xee2f('0x37');}else if(channels[_0x3a0949['localtwolinkedid']]['channel']=_0x3a0949['transfertargetchannel']){utils['info'](util[_0xee2f('0x13')](_0xee2f('0x33'),_0x3a0949[_0xee2f('0x34')],_0x3a0949[_0xee2f('0x31')],_0x3a0949[_0xee2f('0x38')]));channels[_0x3a0949['localtwolinkedid']][_0xee2f('0x25')]=_0x3a0949[_0xee2f('0x38')];channels[_0x3a0949[_0xee2f('0x31')]][_0xee2f('0x36')]='_attended';}}}catch(_0x5c887b){utils['error'](util[_0xee2f('0x13')]('[%s][calls][attendedtransfer]',_0x3a0949['origtransfereruniqueid']),_0x5c887b);}};exports['musiconholdstart']=function(_0x5f39b4){try{if(!_[_0xee2f('0x1f')](channels[_0x5f39b4[_0xee2f('0x6')]])){utils[_0xee2f('0x12')](util['format'](_0xee2f('0x39'),_0x5f39b4['uniqueid']),_0x5f39b4);channels[_0x5f39b4[_0xee2f('0x6')]][_0xee2f('0x3a')]=utils[_0xee2f('0x19')]();utils[_0xee2f('0x15')](util[_0xee2f('0x13')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x5f39b4['uniqueid'],channels[_0x5f39b4[_0xee2f('0x6')]]['musiconholdstartAt']));}}catch(_0x2b6beb){utils[_0xee2f('0x1b')](util[_0xee2f('0x13')](_0xee2f('0x39'),_0x5f39b4['uniqueid']),_0x2b6beb);}};exports['musiconholdstop']=function(_0x1f5a7a){try{if(!_[_0xee2f('0x1f')](channels[_0x1f5a7a[_0xee2f('0x6')]])){utils[_0xee2f('0x12')](util[_0xee2f('0x13')](_0xee2f('0x3b'),_0x1f5a7a[_0xee2f('0x6')]),_0x1f5a7a);if(!_[_0xee2f('0x1f')](channels[_0x1f5a7a[_0xee2f('0x6')]][_0xee2f('0x3a')])){channels[_0x1f5a7a[_0xee2f('0x6')]][_0xee2f('0x3c')]+=utils['diffTime'](utils[_0xee2f('0x19')](),channels[_0x1f5a7a[_0xee2f('0x6')]][_0xee2f('0x3a')]);utils[_0xee2f('0x15')](util['format'](_0xee2f('0x3d'),_0x1f5a7a[_0xee2f('0x6')],channels[_0x1f5a7a[_0xee2f('0x6')]][_0xee2f('0x3c')]));delete channels[_0x1f5a7a[_0xee2f('0x6')]]['musiconholdstartAt'];}}}catch(_0x8b135b){utils['error'](util['format'](_0xee2f('0x3b'),_0x1f5a7a[_0xee2f('0x6')]),_0x8b135b);}};exports[_0xee2f('0x3e')]=function(_0x292bba){try{if(!_[_0xee2f('0x1f')](channels[_0x292bba[_0xee2f('0x6')]])){utils[_0xee2f('0x12')](util['format'](_0xee2f('0x3f'),_0x292bba[_0xee2f('0x6')]),_0x292bba);if(!_[_0xee2f('0x1f')](_0x292bba[_0xee2f('0x40')][_0xee2f('0x41')])){utils[_0xee2f('0x15')](util[_0xee2f('0x13')](_0xee2f('0x42'),_0x292bba[_0xee2f('0x6')],_0x292bba['value']));channels[_0x292bba[_0xee2f('0x6')]]['source']=_0x292bba[_0xee2f('0x43')];}if(!_[_0xee2f('0x1f')](_0x292bba[_0xee2f('0x40')][_0xee2f('0x44')])){utils[_0xee2f('0x15')](util['format'](_0xee2f('0x45'),_0x292bba[_0xee2f('0x6')],_0x292bba[_0xee2f('0x43')]));channels[_0x292bba[_0xee2f('0x6')]]['destination']=_0x292bba['value'];channels[_0x292bba['uniqueid']]['callerid']='\x22'+_0x292bba['value']+_0xee2f('0x46')+_0x292bba['value']+'>';}if(!_[_0xee2f('0x1f')](_0x292bba[_0xee2f('0x40')][_0xee2f('0x47')])||!_[_0xee2f('0x1f')](_0x292bba[_0xee2f('0x40')][_0xee2f('0x48')])){utils['info'](util['format'](_0xee2f('0x49'),_0x292bba['uniqueid'],!_[_0xee2f('0x1f')](_0x292bba['variable'][_0xee2f('0x47')])?'xmd-callerid-preview':_0xee2f('0x48'),_0x292bba[_0xee2f('0x43')]));channels[_0x292bba[_0xee2f('0x6')]]['callerid']=_0x292bba[_0xee2f('0x43')];}if(!_[_0xee2f('0x1f')](_0x292bba[_0xee2f('0x40')][_0xee2f('0x4a')])||!_[_0xee2f('0x1f')](_0x292bba[_0xee2f('0x40')][_0xee2f('0x4b')])){utils['info'](util[_0xee2f('0x13')](_0xee2f('0x49'),_0x292bba[_0xee2f('0x6')],!_[_0xee2f('0x1f')](_0x292bba[_0xee2f('0x40')][_0xee2f('0x4a')])?_0xee2f('0x4a'):_0xee2f('0x4b'),_0x292bba[_0xee2f('0x43')]));channels[_0x292bba[_0xee2f('0x6')]][_0xee2f('0x4c')]='Queue';channels[_0x292bba[_0xee2f('0x6')]][_0xee2f('0x4d')]=_0x292bba['value'];channels[_0x292bba[_0xee2f('0x6')]]['queue']=!![];}if(!_[_0xee2f('0x1f')](_0x292bba['variable']['xmd-contactid'])){utils[_0xee2f('0x15')](util[_0xee2f('0x13')](_0xee2f('0x4e'),_0x292bba[_0xee2f('0x6')],_0x292bba[_0xee2f('0x43')]));channels[_0x292bba['uniqueid']][_0xee2f('0x4f')]=_0x292bba[_0xee2f('0x43')];}if(!_[_0xee2f('0x1f')](_0x292bba['variable'][_0xee2f('0x50')])){utils[_0xee2f('0x15')](util['format'](_0xee2f('0x51'),_0x292bba[_0xee2f('0x6')],_0x292bba[_0xee2f('0x43')]));channels[_0x292bba[_0xee2f('0x6')]][_0xee2f('0x52')]=_0x292bba[_0xee2f('0x43')];}if(!_[_0xee2f('0x1f')](_0x292bba[_0xee2f('0x40')][_0xee2f('0x53')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x292bba[_0xee2f('0x6')],_0x292bba[_0xee2f('0x43')]));channels[_0x292bba[_0xee2f('0x6')]][_0xee2f('0x54')]=_0x292bba[_0xee2f('0x43')];}if(!_['isNil'](_0x292bba[_0xee2f('0x40')][_0xee2f('0x55')])){utils['info'](util[_0xee2f('0x13')](_0xee2f('0x56'),_0x292bba[_0xee2f('0x6')],_0x292bba['value']));channels[_0x292bba[_0xee2f('0x6')]]['sipcallid']=_0x292bba[_0xee2f('0x43')];}}}catch(_0x9732af){utils['error'](util[_0xee2f('0x13')](_0xee2f('0x3f'),_0x292bba['uniqueid']),_0x9732af);}};exports['newexten']=function(_0x48f0ff){try{if(!_[_0xee2f('0x1f')](channels[_0x48f0ff['uniqueid']])){utils['debug'](util[_0xee2f('0x13')](_0xee2f('0x57'),_0x48f0ff['uniqueid']),_0x48f0ff);utils[_0xee2f('0x15')](util['format'](_0xee2f('0x58'),_0x48f0ff[_0xee2f('0x6')],_0x48f0ff[_0xee2f('0x59')],_0x48f0ff[_0xee2f('0x5a')]));if(_0x48f0ff[_0xee2f('0x59')][_0xee2f('0x5b')]()==_0xee2f('0x5c')&&_['startsWith'](_0x48f0ff[_0xee2f('0x5a')][_0xee2f('0x5b')](),_0xee2f('0x5d'))){var _0x2613ba=_0x48f0ff[_0xee2f('0x5a')]['split']('=');var _0x270191=_0x2613ba[0x0][_0xee2f('0x5e')](_0x2613ba[0x0][_0xee2f('0x5f')]('(')+0x1,_0x2613ba[0x0][_0xee2f('0x5f')](')'));var _0x422e3b=_0x2613ba[0x1];channels[_0x48f0ff[_0xee2f('0x6')]][_0x270191]=_0x422e3b;}if(!_['includes'](['hangup',_0xee2f('0x60'),_0xee2f('0x61'),_0xee2f('0x5c'),_0xee2f('0x62')],_0x48f0ff[_0xee2f('0x59')][_0xee2f('0x5b')]())){channels[_0x48f0ff[_0xee2f('0x6')]]['lastapplication']=_0x48f0ff['application'];channels[_0x48f0ff[_0xee2f('0x6')]][_0xee2f('0x4d')]=_0x48f0ff[_0xee2f('0x5a')];}}}catch(_0xc92046){utils[_0xee2f('0x1b')](util[_0xee2f('0x13')](_0xee2f('0x57'),_0x48f0ff[_0xee2f('0x6')]),_0xc92046);}};
\ No newline at end of file
index b7ecaa9..ba3350a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0813=['[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','fullybooted'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0813,0x1b3));var _0x3081=function(_0x27a0db,_0x4f8e3e){_0x27a0db=_0x27a0db-0x0;var _0x4d84ce=_0x0813[_0x27a0db];return _0x4d84ce;};'use strict';var utils=require(_0x3081('0x0'));exports[_0x3081('0x1')]=function(){utils[_0x3081('0x2')](_0x3081('0x3'));};exports['shutdown']=function(){utils[_0x3081('0x2')]('[core]\x20shutdown');};exports[_0x3081('0x4')]=function(){utils[_0x3081('0x2')](_0x3081('0x5'));};exports[_0x3081('0x6')]=function(_0xe2247b){utils[_0x3081('0x6')](_0x3081('0x7'),_0xe2247b);};exports['close']=function(){utils['info'](_0x3081('0x8'));};exports[_0x3081('0x9')]=function(_0x3e19f9){};
\ No newline at end of file
+var _0x0554=['fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','[core]\x20shutdown'];(function(_0x4d584f,_0x385fcd){var _0x383793=function(_0x309159){while(--_0x309159){_0x4d584f['push'](_0x4d584f['shift']());}};_0x383793(++_0x385fcd);}(_0x0554,0x11a));var _0x4055=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x0554[_0x54d4fe];return _0x1ab5bb;};'use strict';var utils=require('./utils');exports[_0x4055('0x0')]=function(){utils[_0x4055('0x1')](_0x4055('0x2'));};exports['shutdown']=function(){utils[_0x4055('0x1')](_0x4055('0x3'));};exports[_0x4055('0x4')]=function(){utils[_0x4055('0x1')](_0x4055('0x5'));};exports[_0x4055('0x6')]=function(_0x19fac0){utils[_0x4055('0x6')](_0x4055('0x7'),_0x19fac0);};exports[_0x4055('0x8')]=function(){utils[_0x4055('0x1')](_0x4055('0x9'));};exports[_0x4055('0xa')]=function(_0x42dc57){};
\ No newline at end of file
index 1a77d73..971ffdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf99=['info','application','appdata','toLowerCase','set','split','error','debug','[%s][dials][varset]','variable','outboundrouteid','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','isNil','dialstatus','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','uniqueid'];(function(_0x3288a2,_0x4ac4be){var _0x319f4a=function(_0x27b50c){while(--_0x27b50c){_0x3288a2['push'](_0x3288a2['shift']());}};_0x319f4a(++_0x4ac4be);}(_0xdf99,0x1d9));var _0x9df9=function(_0x5e6515,_0x2954b1){_0x5e6515=_0x5e6515-0x0;var _0xd33ce2=_0xdf99[_0x5e6515];return _0xd33ce2;};'use strict';var _=require(_0x9df9('0x0'));var util=require(_0x9df9('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x2702ac){utils['info'](util[_0x9df9('0x2')](_0x9df9('0x3'),_0x2702ac['uniqueid'],_0x2702ac['channel'],_0x2702ac['dialstring'],_0x2702ac[_0x9df9('0x4')],_0x2702ac[_0x9df9('0x5')],_0x2702ac['dialstatus']));utils[_0x9df9('0x6')](_0x9df9('0x7'),_0x2702ac);delete dials[_0x2702ac['uniqueid']];}exports[_0x9df9('0x8')]=function(_0x2982ee){try{utils['debug'](util['format'](_0x9df9('0x9'),_0x2982ee[_0x9df9('0xa')]),_0x2982ee);utils[_0x9df9('0xb')](util[_0x9df9('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x2982ee[_0x9df9('0xa')],_0x2982ee[_0x9df9('0xc')],_0x2982ee[_0x9df9('0xd')]));if(_0x2982ee[_0x9df9('0xc')][_0x9df9('0xe')]()==_0x9df9('0xf')&&_['startsWith'](_0x2982ee[_0x9df9('0xd')][_0x9df9('0xe')](),'cdr(routeid)')){var _0x300b70=_0x2982ee[_0x9df9('0xd')][_0x9df9('0x10')]('=');dials[_0x2982ee['uniqueid']]={'routeId':_0x300b70[0x1]};}}catch(_0x621bd0){utils[_0x9df9('0x11')](util['format'](_0x9df9('0x9'),_0x2982ee[_0x9df9('0xa')]),_0x621bd0);}};exports['varset']=function(_0xef6bab){try{utils[_0x9df9('0x12')](util['format'](_0x9df9('0x13'),_0xef6bab[_0x9df9('0xa')]),_0xef6bab);if(!_['isNil'](_0xef6bab[_0x9df9('0x14')][_0x9df9('0x15')])){utils[_0x9df9('0xb')](util[_0x9df9('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0xef6bab[_0x9df9('0xa')],_0xef6bab[_0x9df9('0x16')]));dials[_0xef6bab[_0x9df9('0xa')]]={'routeId':_0xef6bab[_0x9df9('0x16')]};}}catch(_0x348988){utils[_0x9df9('0x11')](util['format'](_0x9df9('0x13'),_0xef6bab[_0x9df9('0xa')]),_0x348988);}};exports['dialbegin']=function(_0x1e5ea8){try{if(!_['isNil'](dials[_0x1e5ea8['uniqueid']])){utils['debug'](util[_0x9df9('0x2')](_0x9df9('0x17'),_0x1e5ea8[_0x9df9('0xa')]),_0x1e5ea8);dials[_0x1e5ea8[_0x9df9('0xa')]]=_[_0x9df9('0x18')](dials[_0x1e5ea8[_0x9df9('0xa')]],_0x1e5ea8);dials[_0x1e5ea8[_0x9df9('0xa')]][_0x9df9('0x19')]=utils[_0x9df9('0x1a')]();dials[_0x1e5ea8[_0x9df9('0xa')]][_0x9df9('0x1b')]=_0x9df9('0x1c');utils[_0x9df9('0xb')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1e5ea8['uniqueid'],dials[_0x1e5ea8[_0x9df9('0xa')]][_0x9df9('0x19')]));}}catch(_0x313251){utils[_0x9df9('0x11')](util[_0x9df9('0x2')]('[%s][dials][dialbegin]',_0x1e5ea8['uniqueid']),_0x313251);}};exports[_0x9df9('0x1d')]=function(_0x3893b5){try{if(!_[_0x9df9('0x1e')](dials[_0x3893b5['uniqueid']])){utils[_0x9df9('0x12')](util[_0x9df9('0x2')]('[%s][dials][dialend]',_0x3893b5[_0x9df9('0xa')]),_0x3893b5);dials[_0x3893b5[_0x9df9('0xa')]]['dialstatus']=_0x3893b5[_0x9df9('0x1f')];if(_0x3893b5[_0x9df9('0x1f')]==_0x9df9('0x20')){dials[_0x3893b5[_0x9df9('0xa')]]=_[_0x9df9('0x18')](dials[_0x3893b5[_0x9df9('0xa')]],_0x3893b5);dials[_0x3893b5[_0x9df9('0xa')]][_0x9df9('0x21')]=utils[_0x9df9('0x1a')]();dials[_0x3893b5[_0x9df9('0xa')]]['lastevent']='connect';utils[_0x9df9('0xb')](util[_0x9df9('0x2')](_0x9df9('0x22'),_0x3893b5['uniqueid'],_0x3893b5[_0x9df9('0x1f')],dials[_0x3893b5[_0x9df9('0xa')]][_0x9df9('0x21')]));}else{utils[_0x9df9('0xb')](util[_0x9df9('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x3893b5[_0x9df9('0xa')],_0x3893b5[_0x9df9('0x1f')]));}}}catch(_0x3f2331){utils[_0x9df9('0x11')](util[_0x9df9('0x2')]('[%s][dials][dialend]',_0x3893b5[_0x9df9('0xa')]),_0x3f2331);}};exports[_0x9df9('0x23')]=function(_0x25bf70){try{if(!_[_0x9df9('0x1e')](dials[_0x25bf70[_0x9df9('0xa')]])){utils[_0x9df9('0x12')](util[_0x9df9('0x2')](_0x9df9('0x24'),_0x25bf70[_0x9df9('0xa')]),_0x25bf70);utils[_0x9df9('0xb')](util[_0x9df9('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x25bf70[_0x9df9('0xa')],_0x25bf70[_0x9df9('0x4')],_0x25bf70[_0x9df9('0x25')],_0x25bf70[_0x9df9('0x26')]));dials[_0x25bf70['uniqueid']]=_['assign'](dials[_0x25bf70[_0x9df9('0xa')]],{'endtime':utils[_0x9df9('0x1a')](),'lastevent':_0x9df9('0x27')});dials[_0x25bf70[_0x9df9('0xa')]][_0x9df9('0x28')]=utils[_0x9df9('0x29')](dials[_0x25bf70[_0x9df9('0xa')]][_0x9df9('0x2a')],dials[_0x25bf70['uniqueid']][_0x9df9('0x19')]);dials[_0x25bf70['uniqueid']]['holdtime']=utils[_0x9df9('0x29')](dials[_0x25bf70[_0x9df9('0xa')]][_0x9df9('0x21')]||dials[_0x25bf70[_0x9df9('0xa')]][_0x9df9('0x2a')],dials[_0x25bf70['uniqueid']][_0x9df9('0x19')]);dials[_0x25bf70['uniqueid']][_0x9df9('0x2b')]=dials[_0x25bf70['uniqueid']]['answertime']?utils['diffTime'](dials[_0x25bf70[_0x9df9('0xa')]][_0x9df9('0x2a')],dials[_0x25bf70['uniqueid']][_0x9df9('0x21')]):0x0;writeDB(dials[_0x25bf70[_0x9df9('0xa')]]);}}catch(_0x3e09eb){utils['error'](util['format'](_0x9df9('0x24'),_0x25bf70[_0x9df9('0xa')]),_0x3e09eb);}};
\ No newline at end of file
+var _0xec56=['value','dialbegin','[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','starttime','billableseconds','./utils','info','format','uniqueid','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xec56,0x113));var _0x6ec5=function(_0xc3c7bc,_0xe9447e){_0xc3c7bc=_0xc3c7bc-0x0;var _0x47f28c=_0xec56[_0xc3c7bc];return _0x47f28c;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x6ec5('0x0'));var dials={};function writeDB(_0x31abcb){utils[_0x6ec5('0x1')](util[_0x6ec5('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x31abcb[_0x6ec5('0x3')],_0x31abcb[_0x6ec5('0x4')],_0x31abcb[_0x6ec5('0x5')],_0x31abcb[_0x6ec5('0x6')],_0x31abcb['connectedlinenum'],_0x31abcb[_0x6ec5('0x7')]));utils[_0x6ec5('0x8')](_0x6ec5('0x9'),_0x31abcb);delete dials[_0x31abcb[_0x6ec5('0x3')]];}exports[_0x6ec5('0xa')]=function(_0x4f4a0b){try{utils[_0x6ec5('0xb')](util['format'](_0x6ec5('0xc'),_0x4f4a0b[_0x6ec5('0x3')]),_0x4f4a0b);utils[_0x6ec5('0x1')](util[_0x6ec5('0x2')](_0x6ec5('0xd'),_0x4f4a0b[_0x6ec5('0x3')],_0x4f4a0b[_0x6ec5('0xe')],_0x4f4a0b[_0x6ec5('0xf')]));if(_0x4f4a0b[_0x6ec5('0xe')][_0x6ec5('0x10')]()=='set'&&_[_0x6ec5('0x11')](_0x4f4a0b[_0x6ec5('0xf')][_0x6ec5('0x10')](),_0x6ec5('0x12'))){var _0x71399f=_0x4f4a0b[_0x6ec5('0xf')]['split']('=');dials[_0x4f4a0b[_0x6ec5('0x3')]]={'routeId':_0x71399f[0x1]};}}catch(_0xb24c54){utils[_0x6ec5('0x13')](util[_0x6ec5('0x2')]('[%s][dials][newexten]',_0x4f4a0b['uniqueid']),_0xb24c54);}};exports[_0x6ec5('0x14')]=function(_0x14e8fe){try{utils[_0x6ec5('0xb')](util[_0x6ec5('0x2')](_0x6ec5('0x15'),_0x14e8fe[_0x6ec5('0x3')]),_0x14e8fe);if(!_[_0x6ec5('0x16')](_0x14e8fe[_0x6ec5('0x17')]['outboundrouteid'])){utils[_0x6ec5('0x1')](util[_0x6ec5('0x2')](_0x6ec5('0x18'),_0x14e8fe[_0x6ec5('0x3')],_0x14e8fe[_0x6ec5('0x19')]));dials[_0x14e8fe[_0x6ec5('0x3')]]={'routeId':_0x14e8fe['value']};}}catch(_0x31de43){utils[_0x6ec5('0x13')](util[_0x6ec5('0x2')](_0x6ec5('0x15'),_0x14e8fe['uniqueid']),_0x31de43);}};exports[_0x6ec5('0x1a')]=function(_0x46c524){try{if(!_[_0x6ec5('0x16')](dials[_0x46c524['uniqueid']])){utils[_0x6ec5('0xb')](util[_0x6ec5('0x2')](_0x6ec5('0x1b'),_0x46c524['uniqueid']),_0x46c524);dials[_0x46c524[_0x6ec5('0x3')]]=_[_0x6ec5('0x1c')](dials[_0x46c524[_0x6ec5('0x3')]],_0x46c524);dials[_0x46c524[_0x6ec5('0x3')]]['starttime']=utils['now']();dials[_0x46c524[_0x6ec5('0x3')]][_0x6ec5('0x1d')]=_0x6ec5('0x1e');utils['info'](util[_0x6ec5('0x2')](_0x6ec5('0x1f'),_0x46c524[_0x6ec5('0x3')],dials[_0x46c524['uniqueid']]['starttime']));}}catch(_0x4e32b1){utils[_0x6ec5('0x13')](util[_0x6ec5('0x2')](_0x6ec5('0x1b'),_0x46c524[_0x6ec5('0x3')]),_0x4e32b1);}};exports[_0x6ec5('0x20')]=function(_0x12e2b8){try{if(!_[_0x6ec5('0x16')](dials[_0x12e2b8[_0x6ec5('0x3')]])){utils['debug'](util[_0x6ec5('0x2')]('[%s][dials][dialend]',_0x12e2b8['uniqueid']),_0x12e2b8);dials[_0x12e2b8['uniqueid']][_0x6ec5('0x7')]=_0x12e2b8[_0x6ec5('0x7')];if(_0x12e2b8[_0x6ec5('0x7')]=='ANSWER'){dials[_0x12e2b8['uniqueid']]=_[_0x6ec5('0x1c')](dials[_0x12e2b8['uniqueid']],_0x12e2b8);dials[_0x12e2b8['uniqueid']][_0x6ec5('0x21')]=utils[_0x6ec5('0x22')]();dials[_0x12e2b8[_0x6ec5('0x3')]][_0x6ec5('0x1d')]=_0x6ec5('0x23');utils[_0x6ec5('0x1')](util['format'](_0x6ec5('0x24'),_0x12e2b8[_0x6ec5('0x3')],_0x12e2b8[_0x6ec5('0x7')],dials[_0x12e2b8[_0x6ec5('0x3')]][_0x6ec5('0x21')]));}else{utils[_0x6ec5('0x1')](util['format'](_0x6ec5('0x25'),_0x12e2b8['uniqueid'],_0x12e2b8[_0x6ec5('0x7')]));}}}catch(_0x46a856){utils['error'](util[_0x6ec5('0x2')](_0x6ec5('0x26'),_0x12e2b8[_0x6ec5('0x3')]),_0x46a856);}};exports[_0x6ec5('0x27')]=function(_0x432515){try{if(!_[_0x6ec5('0x16')](dials[_0x432515[_0x6ec5('0x3')]])){utils[_0x6ec5('0xb')](util[_0x6ec5('0x2')](_0x6ec5('0x28'),_0x432515['uniqueid']),_0x432515);utils[_0x6ec5('0x1')](util[_0x6ec5('0x2')](_0x6ec5('0x29'),_0x432515[_0x6ec5('0x3')],_0x432515['calleridnum'],_0x432515[_0x6ec5('0x2a')],_0x432515[_0x6ec5('0x2b')]));dials[_0x432515[_0x6ec5('0x3')]]=_[_0x6ec5('0x1c')](dials[_0x432515[_0x6ec5('0x3')]],{'endtime':utils[_0x6ec5('0x22')](),'lastevent':_0x6ec5('0x2c')});dials[_0x432515['uniqueid']][_0x6ec5('0x2d')]=utils[_0x6ec5('0x2e')](dials[_0x432515[_0x6ec5('0x3')]][_0x6ec5('0x2f')],dials[_0x432515[_0x6ec5('0x3')]][_0x6ec5('0x30')]);dials[_0x432515[_0x6ec5('0x3')]]['holdtime']=utils[_0x6ec5('0x2e')](dials[_0x432515['uniqueid']]['answertime']||dials[_0x432515[_0x6ec5('0x3')]][_0x6ec5('0x2f')],dials[_0x432515[_0x6ec5('0x3')]][_0x6ec5('0x30')]);dials[_0x432515['uniqueid']][_0x6ec5('0x31')]=dials[_0x432515[_0x6ec5('0x3')]][_0x6ec5('0x21')]?utils[_0x6ec5('0x2e')](dials[_0x432515[_0x6ec5('0x3')]][_0x6ec5('0x2f')],dials[_0x432515[_0x6ec5('0x3')]][_0x6ec5('0x21')]):0x0;writeDB(dials[_0x432515[_0x6ec5('0x3')]]);}}catch(_0x2bfa92){utils[_0x6ec5('0x13')](util[_0x6ec5('0x2')]('[%s][dials][hangup]',_0x432515[_0x6ec5('0x3')]),_0x2bfa92);}};
\ No newline at end of file
index 6d133e6..59695f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55d3=['./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][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','./utils','util','xdr','disabled','env','production','local','asterisk','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./recordings.controller','./members.controller','./transfers.controller'];(function(_0xf3e972,_0x2aded7){var _0x306959=function(_0x4cd080){while(--_0x4cd080){_0xf3e972['push'](_0xf3e972['shift']());}};_0x306959(++_0x2aded7);}(_0x55d3,0xff));var _0x355d=function(_0x5641ca,_0x56318b){_0x5641ca=_0x5641ca-0x0;var _0x431445=_0x55d3[_0x5641ca];return _0x431445;};var AsteriskManager=require(_0x355d('0x0'));var config=require('../../config/environment');var utils=require(_0x355d('0x1'));var util=require(_0x355d('0x2'));var isXDREnabled=config['xdr']&&config[_0x355d('0x3')][_0x355d('0x4')]?!config[_0x355d('0x3')]['disabled']:!![];var isProduction=config[_0x355d('0x5')]===_0x355d('0x6')||![];var isLocalAsterisk=config[_0x355d('0x3')]&&config[_0x355d('0x3')][_0x355d('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x355d('0x8')]['port'],config['asterisk']['ip'],config[_0x355d('0x8')]['username'],config[_0x355d('0x8')][_0x355d('0x9')],!![]);ami[_0x355d('0xa')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x355d('0xb')](_0x355d('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0x355d('0xd'));var queues=require('./queues.controller');var recordings=require(_0x355d('0xe'));var members=require(_0x355d('0xf'));var dials=require('./dials.controller');var transfers=require(_0x355d('0x10'));var core=require(_0x355d('0x11'));ami['on']('connect',core[_0x355d('0x12')]);ami['on'](_0x355d('0x13'),core[_0x355d('0x13')]);ami['on'](_0x355d('0x14'),core[_0x355d('0x14')]);ami['on'](_0x355d('0x15'),core[_0x355d('0x15')]);ami['on'](_0x355d('0x16'),core[_0x355d('0x16')]);ami['on'](_0x355d('0x17'),core['managerevent']);ami['on'](_0x355d('0x18'),function(_0x3aaa89){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x1b'),_0x3aaa89[_0x355d('0x1c')]),_0x3aaa89);members[_0x355d('0x18')](_0x3aaa89);}catch(_0x49e6cd){utils['error'](util['format']('[%s][index][devicestatechange]',_0x3aaa89['device']),_0x49e6cd);}});ami['on'](_0x355d('0x1d'),function(_0xef8bfd){try{utils[_0x355d('0x19')](util['format']('[%s][index][agentcalled]',_0xef8bfd[_0x355d('0x1e')]),_0xef8bfd);agents['agentcalled'](_0xef8bfd);}catch(_0x5ed651){utils['error'](util[_0x355d('0x1a')]('[%s][index][agentcalled]',_0xef8bfd[_0x355d('0x1e')]),_0x5ed651);}});ami['on'](_0x355d('0x1f'),function(_0x1df6f8){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')]('[%s][index][agentringnoanswer]',_0x1df6f8[_0x355d('0x1e')]),_0x1df6f8);agents[_0x355d('0x1f')](_0x1df6f8);}catch(_0x1d4a32){utils[_0x355d('0x15')](util[_0x355d('0x1a')](_0x355d('0x20'),_0x1df6f8[_0x355d('0x1e')]),_0x1d4a32);}});ami['on'](_0x355d('0x21'),function(_0x5715b9){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x22'),_0x5715b9['uniqueid']),_0x5715b9);agents[_0x355d('0x21')](_0x5715b9);queues['agentconnect'](_0x5715b9);}catch(_0x171bc9){utils[_0x355d('0x15')](util['format']('[%s][index][agentconnect]',_0x5715b9[_0x355d('0x1e')]),_0x171bc9);}});ami['on']('agentcomplete',function(_0x2efcf8){try{utils['debug'](util[_0x355d('0x1a')]('[%s][index][agentcomplete]',_0x2efcf8['uniqueid']),_0x2efcf8);agents[_0x355d('0x23')](_0x2efcf8);queues[_0x355d('0x23')](_0x2efcf8);members['agentcomplete'](_0x2efcf8);}catch(_0x4beaf6){utils['error'](util['format'](_0x355d('0x24'),_0x2efcf8[_0x355d('0x1e')]),_0x4beaf6);}});ami['on']('queuecallerabandon',function(_0x42838a){try{utils['debug'](util[_0x355d('0x1a')](_0x355d('0x25'),_0x42838a[_0x355d('0x1e')]),_0x42838a);agents[_0x355d('0x26')](_0x42838a);queues[_0x355d('0x26')](_0x42838a);}catch(_0x13ec09){utils['error'](util[_0x355d('0x1a')](_0x355d('0x25'),_0x42838a['uniqueid']),_0x13ec09);}});ami['on'](_0x355d('0x27'),function(_0x5bb94f){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x28'),_0x5bb94f['uniqueid']),_0x5bb94f);queues[_0x355d('0x27')](_0x5bb94f);recordings[_0x355d('0x27')](_0x5bb94f);}catch(_0x582d7b){utils[_0x355d('0x15')](util[_0x355d('0x1a')](_0x355d('0x28'),_0x5bb94f['uniqueid']),_0x582d7b);}});ami['on'](_0x355d('0x29'),function(_0x4ccc9f){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x2a'),_0x4ccc9f[_0x355d('0x1e')]),_0x4ccc9f);queues[_0x355d('0x29')](_0x4ccc9f);}catch(_0x505d10){utils[_0x355d('0x15')](util[_0x355d('0x1a')]('[%s][index][queuecallerleave]',_0x4ccc9f[_0x355d('0x1e')]),_0x505d10);}});ami['on'](_0x355d('0x2b'),function(_0x2a1f90){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x2c'),_0x2a1f90['uniqueid']),_0x2a1f90);queues['musiconholdstart'](_0x2a1f90);calls[_0x355d('0x2b')](_0x2a1f90);}catch(_0x28422b){utils['error'](util[_0x355d('0x1a')](_0x355d('0x2c'),_0x2a1f90['uniqueid']),_0x28422b);}});ami['on'](_0x355d('0x2d'),function(_0x187760){try{utils[_0x355d('0x19')](util['format']('[%s][index][musiconholdstop]',_0x187760['uniqueid']),_0x187760);queues[_0x355d('0x2d')](_0x187760);calls[_0x355d('0x2d')](_0x187760);}catch(_0x1c01ac){utils[_0x355d('0x15')](util[_0x355d('0x1a')]('[%s][index][musiconholdstop]',_0x187760[_0x355d('0x1e')]),_0x1c01ac);}});ami['on'](_0x355d('0x2e'),function(_0x2d5399){try{utils['debug'](util['format'](_0x355d('0x2f'),_0x2d5399[_0x355d('0x1e')]),_0x2d5399);calls[_0x355d('0x2e')](_0x2d5399);recordings[_0x355d('0x2e')](_0x2d5399);}catch(_0xf84131){utils[_0x355d('0x15')](util[_0x355d('0x1a')]('[%s][index][newstate]',_0x2d5399[_0x355d('0x1e')]),_0xf84131);}});ami['on'](_0x355d('0x30'),function(_0x542b97){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x31'),_0x542b97['uniqueid']),_0x542b97);calls[_0x355d('0x30')](_0x542b97);recordings[_0x355d('0x30')](_0x542b97);dials[_0x355d('0x30')](_0x542b97);agents[_0x355d('0x30')](_0x542b97);queues[_0x355d('0x30')](_0x542b97);}catch(_0xf41d23){utils[_0x355d('0x15')](util['format'](_0x355d('0x31'),_0x542b97[_0x355d('0x1e')]),_0xf41d23);}});ami['on'](_0x355d('0x32'),function(_0x5309e5){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')]('[%s][index][cdr]',_0x5309e5['uniqueid']),_0x5309e5);members[_0x355d('0x32')](_0x5309e5);}catch(_0x3c69e0){utils[_0x355d('0x15')](util[_0x355d('0x1a')](_0x355d('0x33'),_0x5309e5[_0x355d('0x1e')]),_0x3c69e0);}});ami['on'](_0x355d('0x34'),function(_0x2d4306){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')]('[%s][index][blindtransfer]',_0x2d4306[_0x355d('0x1e')]),_0x2d4306);queues[_0x355d('0x34')](_0x2d4306);agents[_0x355d('0x34')](_0x2d4306);transfers['blindtransfer'](_0x2d4306);recordings[_0x355d('0x34')](_0x2d4306);}catch(_0x4a7c27){utils[_0x355d('0x15')](util[_0x355d('0x1a')](_0x355d('0x35'),_0x2d4306[_0x355d('0x1e')]),_0x4a7c27);}});ami['on'](_0x355d('0x36'),function(_0x55f294){try{utils['debug'](util['format'](_0x355d('0x37'),_0x55f294[_0x355d('0x38')]),_0x55f294);queues[_0x355d('0x36')](_0x55f294);transfers['attendedtransfer'](_0x55f294);agents[_0x355d('0x36')](_0x55f294);calls[_0x355d('0x36')](_0x55f294);}catch(_0x14b230){utils[_0x355d('0x15')](util[_0x355d('0x1a')]('[%s][index][attendedtransfer]',_0x55f294['origtransfereruniqueid']),_0x14b230);}});ami['on'](_0x355d('0x39'),function(_0x3ce26d){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x3a'),_0x3ce26d['uniqueid']),_0x3ce26d);queues['varset'](_0x3ce26d);recordings['varset'](_0x3ce26d);calls[_0x355d('0x39')](_0x3ce26d);dials[_0x355d('0x39')](_0x3ce26d);}catch(_0x2a987c){utils[_0x355d('0x15')](util['format'](_0x355d('0x3a'),_0x3ce26d['uniqueid']),_0x2a987c);}});ami['on'](_0x355d('0x3b'),function(_0x533ed1){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x3c'),_0x533ed1['uniqueid']),_0x533ed1);calls[_0x355d('0x3b')](_0x533ed1);recordings[_0x355d('0x3b')](_0x533ed1);dials['newexten'](_0x533ed1);}catch(_0x3c5bb1){utils[_0x355d('0x15')](util['format'](_0x355d('0x3c'),_0x533ed1['uniqueid']),_0x3c5bb1);}});ami['on'](_0x355d('0x3d'),function(_0x15d16f){try{utils['debug'](util[_0x355d('0x1a')](_0x355d('0x3e'),_0x15d16f[_0x355d('0x1e')]),_0x15d16f);calls[_0x355d('0x3d')](_0x15d16f);recordings[_0x355d('0x3d')](_0x15d16f);}catch(_0x38cfe8){utils[_0x355d('0x15')](util[_0x355d('0x1a')](_0x355d('0x3e'),_0x15d16f['uniqueid']),_0x38cfe8);}});ami['on'](_0x355d('0x3f'),function(_0xd9edbd){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')](_0x355d('0x40'),_0xd9edbd[_0x355d('0x1e')]),_0xd9edbd);dials[_0x355d('0x3f')](_0xd9edbd);}catch(_0x5ebd6e){utils[_0x355d('0x15')](util['format'](_0x355d('0x41'),_0xd9edbd[_0x355d('0x1e')]),_0x5ebd6e);}});ami['on'](_0x355d('0x42'),function(_0x6b09e7){try{utils[_0x355d('0x19')](util[_0x355d('0x1a')]('[%s][index][dialend]',_0x6b09e7[_0x355d('0x1e')]),_0x6b09e7);dials[_0x355d('0x42')](_0x6b09e7);}catch(_0x229010){utils[_0x355d('0x15')](util[_0x355d('0x1a')](_0x355d('0x43'),_0x6b09e7[_0x355d('0x1e')]),_0x229010);}});}
\ No newline at end of file
+var _0xf218=['devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','util','xdr','disabled','env','local','asterisk','username','password','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent'];(function(_0x1237d3,_0x5f6f6f){var _0x18e5c4=function(_0x344f0e){while(--_0x344f0e){_0x1237d3['push'](_0x1237d3['shift']());}};_0x18e5c4(++_0x5f6f6f);}(_0xf218,0x140));var _0x8f21=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xf218[_0x178e48];return _0x440d7e;};var AsteriskManager=require(_0x8f21('0x0'));var config=require(_0x8f21('0x1'));var utils=require('./utils');var util=require(_0x8f21('0x2'));var isXDREnabled=config[_0x8f21('0x3')]&&config[_0x8f21('0x3')][_0x8f21('0x4')]?!config[_0x8f21('0x3')][_0x8f21('0x4')]:!![];var isProduction=config[_0x8f21('0x5')]==='production'||![];var isLocalAsterisk=config[_0x8f21('0x3')]&&config[_0x8f21('0x3')][_0x8f21('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x8f21('0x7')]['port'],config[_0x8f21('0x7')]['ip'],config['asterisk'][_0x8f21('0x8')],config[_0x8f21('0x7')][_0x8f21('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x8f21('0xa')](_0x8f21('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x8f21('0xc'));var calls=require(_0x8f21('0xd'));var queues=require(_0x8f21('0xe'));var recordings=require(_0x8f21('0xf'));var members=require(_0x8f21('0x10'));var dials=require('./dials.controller');var transfers=require(_0x8f21('0x11'));var core=require(_0x8f21('0x12'));ami['on'](_0x8f21('0x13'),core[_0x8f21('0x13')]);ami['on']('shutdown',core[_0x8f21('0x14')]);ami['on'](_0x8f21('0x15'),core[_0x8f21('0x15')]);ami['on'](_0x8f21('0x16'),core['error']);ami['on'](_0x8f21('0x17'),core[_0x8f21('0x17')]);ami['on'](_0x8f21('0x18'),core[_0x8f21('0x18')]);ami['on'](_0x8f21('0x19'),function(_0x234167){try{utils[_0x8f21('0x1a')](util['format'](_0x8f21('0x1b'),_0x234167[_0x8f21('0x1c')]),_0x234167);members[_0x8f21('0x19')](_0x234167);}catch(_0x21203d){utils['error'](util[_0x8f21('0x1d')](_0x8f21('0x1b'),_0x234167[_0x8f21('0x1c')]),_0x21203d);}});ami['on'](_0x8f21('0x1e'),function(_0x2e4a4b){try{utils[_0x8f21('0x1a')](util['format'](_0x8f21('0x1f'),_0x2e4a4b[_0x8f21('0x20')]),_0x2e4a4b);agents[_0x8f21('0x1e')](_0x2e4a4b);}catch(_0x27583d){utils['error'](util[_0x8f21('0x1d')]('[%s][index][agentcalled]',_0x2e4a4b['uniqueid']),_0x27583d);}});ami['on'](_0x8f21('0x21'),function(_0x386de){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')](_0x8f21('0x22'),_0x386de[_0x8f21('0x20')]),_0x386de);agents[_0x8f21('0x21')](_0x386de);}catch(_0x175c6c){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')](_0x8f21('0x22'),_0x386de[_0x8f21('0x20')]),_0x175c6c);}});ami['on'](_0x8f21('0x23'),function(_0x3e195b){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')](_0x8f21('0x24'),_0x3e195b['uniqueid']),_0x3e195b);agents[_0x8f21('0x23')](_0x3e195b);queues[_0x8f21('0x23')](_0x3e195b);}catch(_0x834526){utils['error'](util[_0x8f21('0x1d')](_0x8f21('0x24'),_0x3e195b[_0x8f21('0x20')]),_0x834526);}});ami['on']('agentcomplete',function(_0x1652d3){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')](_0x8f21('0x25'),_0x1652d3['uniqueid']),_0x1652d3);agents['agentcomplete'](_0x1652d3);queues[_0x8f21('0x26')](_0x1652d3);members[_0x8f21('0x26')](_0x1652d3);}catch(_0x2cf70e){utils['error'](util[_0x8f21('0x1d')](_0x8f21('0x25'),_0x1652d3[_0x8f21('0x20')]),_0x2cf70e);}});ami['on'](_0x8f21('0x27'),function(_0x228e68){try{utils[_0x8f21('0x1a')](util['format'](_0x8f21('0x28'),_0x228e68[_0x8f21('0x20')]),_0x228e68);agents[_0x8f21('0x27')](_0x228e68);queues[_0x8f21('0x27')](_0x228e68);}catch(_0x114859){utils[_0x8f21('0x16')](util['format'](_0x8f21('0x28'),_0x228e68[_0x8f21('0x20')]),_0x114859);}});ami['on']('queuecallerjoin',function(_0x187036){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')](_0x8f21('0x29'),_0x187036[_0x8f21('0x20')]),_0x187036);queues['queuecallerjoin'](_0x187036);recordings[_0x8f21('0x2a')](_0x187036);}catch(_0x18ca96){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')](_0x8f21('0x29'),_0x187036[_0x8f21('0x20')]),_0x18ca96);}});ami['on'](_0x8f21('0x2b'),function(_0x29d6bb){try{utils[_0x8f21('0x1a')](util['format'](_0x8f21('0x2c'),_0x29d6bb[_0x8f21('0x20')]),_0x29d6bb);queues[_0x8f21('0x2b')](_0x29d6bb);}catch(_0x5cfdaf){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')](_0x8f21('0x2c'),_0x29d6bb[_0x8f21('0x20')]),_0x5cfdaf);}});ami['on'](_0x8f21('0x2d'),function(_0xa38d12){try{utils['debug'](util['format'](_0x8f21('0x2e'),_0xa38d12[_0x8f21('0x20')]),_0xa38d12);queues[_0x8f21('0x2d')](_0xa38d12);calls[_0x8f21('0x2d')](_0xa38d12);}catch(_0x22f9e9){utils['error'](util[_0x8f21('0x1d')](_0x8f21('0x2e'),_0xa38d12[_0x8f21('0x20')]),_0x22f9e9);}});ami['on'](_0x8f21('0x2f'),function(_0x61d0cd){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')](_0x8f21('0x30'),_0x61d0cd[_0x8f21('0x20')]),_0x61d0cd);queues[_0x8f21('0x2f')](_0x61d0cd);calls[_0x8f21('0x2f')](_0x61d0cd);}catch(_0x2581df){utils['error'](util[_0x8f21('0x1d')](_0x8f21('0x30'),_0x61d0cd['uniqueid']),_0x2581df);}});ami['on'](_0x8f21('0x31'),function(_0x309d9d){try{utils['debug'](util[_0x8f21('0x1d')](_0x8f21('0x32'),_0x309d9d[_0x8f21('0x20')]),_0x309d9d);calls[_0x8f21('0x31')](_0x309d9d);recordings[_0x8f21('0x31')](_0x309d9d);}catch(_0x16f28c){utils['error'](util[_0x8f21('0x1d')](_0x8f21('0x32'),_0x309d9d[_0x8f21('0x20')]),_0x16f28c);}});ami['on']('hangup',function(_0x3f83f8){try{utils[_0x8f21('0x1a')](util['format']('[%s][index][hangup]',_0x3f83f8[_0x8f21('0x20')]),_0x3f83f8);calls[_0x8f21('0x33')](_0x3f83f8);recordings[_0x8f21('0x33')](_0x3f83f8);dials[_0x8f21('0x33')](_0x3f83f8);agents[_0x8f21('0x33')](_0x3f83f8);queues['hangup'](_0x3f83f8);}catch(_0x1a97ac){utils['error'](util[_0x8f21('0x1d')](_0x8f21('0x34'),_0x3f83f8[_0x8f21('0x20')]),_0x1a97ac);}});ami['on'](_0x8f21('0x35'),function(_0xf6ef98){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')]('[%s][index][cdr]',_0xf6ef98[_0x8f21('0x20')]),_0xf6ef98);members[_0x8f21('0x35')](_0xf6ef98);}catch(_0x31b1a2){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')]('[%s][index][cdr]',_0xf6ef98['uniqueid']),_0x31b1a2);}});ami['on']('blindtransfer',function(_0x2c79a7){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')]('[%s][index][blindtransfer]',_0x2c79a7[_0x8f21('0x20')]),_0x2c79a7);queues[_0x8f21('0x36')](_0x2c79a7);agents[_0x8f21('0x36')](_0x2c79a7);transfers[_0x8f21('0x36')](_0x2c79a7);recordings[_0x8f21('0x36')](_0x2c79a7);}catch(_0x2b483b){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')](_0x8f21('0x37'),_0x2c79a7['uniqueid']),_0x2b483b);}});ami['on'](_0x8f21('0x38'),function(_0x30b925){try{utils['debug'](util[_0x8f21('0x1d')](_0x8f21('0x39'),_0x30b925[_0x8f21('0x3a')]),_0x30b925);queues[_0x8f21('0x38')](_0x30b925);transfers[_0x8f21('0x38')](_0x30b925);agents[_0x8f21('0x38')](_0x30b925);calls[_0x8f21('0x38')](_0x30b925);}catch(_0x132f6f){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')]('[%s][index][attendedtransfer]',_0x30b925[_0x8f21('0x3a')]),_0x132f6f);}});ami['on'](_0x8f21('0x3b'),function(_0x1a3a1e){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')]('[%s][index][varset]',_0x1a3a1e[_0x8f21('0x20')]),_0x1a3a1e);queues[_0x8f21('0x3b')](_0x1a3a1e);recordings[_0x8f21('0x3b')](_0x1a3a1e);calls[_0x8f21('0x3b')](_0x1a3a1e);dials[_0x8f21('0x3b')](_0x1a3a1e);}catch(_0x56e7d3){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')](_0x8f21('0x3c'),_0x1a3a1e['uniqueid']),_0x56e7d3);}});ami['on'](_0x8f21('0x3d'),function(_0x1e4b7e){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')](_0x8f21('0x3e'),_0x1e4b7e[_0x8f21('0x20')]),_0x1e4b7e);calls[_0x8f21('0x3d')](_0x1e4b7e);recordings[_0x8f21('0x3d')](_0x1e4b7e);dials['newexten'](_0x1e4b7e);}catch(_0xb62992){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')](_0x8f21('0x3e'),_0x1e4b7e[_0x8f21('0x20')]),_0xb62992);}});ami['on'](_0x8f21('0x3f'),function(_0x4ad90d){try{utils[_0x8f21('0x1a')](util['format'](_0x8f21('0x40'),_0x4ad90d[_0x8f21('0x20')]),_0x4ad90d);calls[_0x8f21('0x3f')](_0x4ad90d);recordings['newchannel'](_0x4ad90d);}catch(_0x2a28a0){utils[_0x8f21('0x16')](util['format']('[%s][index][newchannel]',_0x4ad90d[_0x8f21('0x20')]),_0x2a28a0);}});ami['on']('dialbegin',function(_0x29d6a0){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')](_0x8f21('0x41'),_0x29d6a0[_0x8f21('0x20')]),_0x29d6a0);dials['dialbegin'](_0x29d6a0);}catch(_0x6b4a6c){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')](_0x8f21('0x42'),_0x29d6a0['uniqueid']),_0x6b4a6c);}});ami['on']('dialend',function(_0x525acf){try{utils[_0x8f21('0x1a')](util[_0x8f21('0x1d')](_0x8f21('0x43'),_0x525acf['uniqueid']),_0x525acf);dials[_0x8f21('0x44')](_0x525acf);}catch(_0x198fa2){utils[_0x8f21('0x16')](util[_0x8f21('0x1d')](_0x8f21('0x43'),_0x525acf[_0x8f21('0x20')]),_0x198fa2);}});}
\ No newline at end of file
index 8fc85ab..ff421e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ab=['lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','name','request','CreateMemberReport','split','then','internal','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','assign','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel'];(function(_0x47571a,_0xe34d6b){var _0x105076=function(_0xc9190c){while(--_0xc9190c){_0x47571a['push'](_0x47571a['shift']());}};_0x105076(++_0xe34d6b);}(_0xc6ab,0x96));var _0xbc6a=function(_0x15fd5a,_0x1f7b5c){_0x15fd5a=_0x15fd5a-0x0;var _0x23dcd4=_0xc6ab[_0x15fd5a];return _0x23dcd4;};'use strict';var _=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var utils=require(_0xbc6a('0x2'));var members={};var exclude=[_0xbc6a('0x3'),_0xbc6a('0x4')];function writeDB(_0x4fd8be){utils['info'](util[_0xbc6a('0x5')](_0xbc6a('0x6'),_0x4fd8be[_0xbc6a('0x7')],_0x4fd8be[_0xbc6a('0x8')],_0x4fd8be[_0xbc6a('0x9')],_0x4fd8be['data2'],_0x4fd8be[_0xbc6a('0xa')],_0x4fd8be[_0xbc6a('0xb')]));if(_0x4fd8be[_0xbc6a('0x8')]){utils[_0xbc6a('0xc')](_0x4fd8be[_0xbc6a('0x8')])['then'](function(_0x4bb311){if(_0x4bb311){_0x4fd8be[_0xbc6a('0xa')]=_0x4bb311[_0xbc6a('0xd')];_0x4fd8be['internal']=_0x4bb311['internal'];utils[_0xbc6a('0xe')](_0xbc6a('0xf'),_0x4fd8be);}else{utils['getUserByName'](_0x4fd8be[_0xbc6a('0x8')][_0xbc6a('0x10')]('/')[0x1])[_0xbc6a('0x11')](function(_0x54a6e6){if(_0x54a6e6){_0x4fd8be[_0xbc6a('0xa')]=_0x54a6e6[_0xbc6a('0xd')];_0x4fd8be[_0xbc6a('0x12')]=_0x54a6e6[_0xbc6a('0x12')];utils['request']('CreateMemberReport',_0x4fd8be);}});}})['catch'](function(_0x94a247){utils[_0xbc6a('0x13')](util['format'](_0xbc6a('0x14'),_0x4fd8be['uniqueid']),_0x94a247);});}delete members[_0x4fd8be[_0xbc6a('0x8')]];}function startsWith(_0x4d92aa,_0x2c0fdf){return _[_0xbc6a('0x15')](_0x4d92aa,function(_0xdf0869){return _[_0xbc6a('0x16')](_0x2c0fdf,_0xdf0869);});}exports[_0xbc6a('0x17')]=function(_0x3e6393){try{utils[_0xbc6a('0x18')](util['format']('[%s][members][devicestatechange]',members[_0x3e6393[_0xbc6a('0x19')]]?members[_0x3e6393[_0xbc6a('0x19')]][_0xbc6a('0x7')]:_0x3e6393[_0xbc6a('0x19')]),_0x3e6393);utils[_0xbc6a('0x1a')](util[_0xbc6a('0x5')](_0xbc6a('0x1b'),members[_0x3e6393[_0xbc6a('0x19')]]?members[_0x3e6393[_0xbc6a('0x19')]][_0xbc6a('0x7')]:_0x3e6393[_0xbc6a('0x19')],_0x3e6393[_0xbc6a('0x1c')],_0x3e6393[_0xbc6a('0x19')]));switch(_0x3e6393['state']){case _0xbc6a('0x1d'):case'BUSY':if(!startsWith(exclude,_0x3e6393['device'])){members[_0x3e6393[_0xbc6a('0x19')]]={'channel':'voice','interface':_0x3e6393[_0xbc6a('0x19')],'type':'TALKING','enterAt':utils[_0xbc6a('0x1e')](),'role':'agent'};}break;case _0xbc6a('0x1f'):if(!_[_0xbc6a('0x20')](members[_0x3e6393[_0xbc6a('0x19')]])){members[_0x3e6393[_0xbc6a('0x19')]][_0xbc6a('0x21')]=utils[_0xbc6a('0x1e')]();members[_0x3e6393[_0xbc6a('0x19')]][_0xbc6a('0x22')]=utils[_0xbc6a('0x23')](members[_0x3e6393[_0xbc6a('0x19')]]['exitAt'],members[_0x3e6393[_0xbc6a('0x19')]][_0xbc6a('0x24')]);if(members[_0x3e6393[_0xbc6a('0x19')]][_0xbc6a('0x7')]){writeDB(members[_0x3e6393[_0xbc6a('0x19')]]);}}break;default:break;}}catch(_0x5c03c5){utils[_0xbc6a('0x13')](util[_0xbc6a('0x5')](_0xbc6a('0x25'),members[_0x3e6393[_0xbc6a('0x19')]]?members[_0x3e6393[_0xbc6a('0x19')]][_0xbc6a('0x7')]:_0x3e6393[_0xbc6a('0x19')]),_0x5c03c5);}};exports[_0xbc6a('0x26')]=function(_0xabc702){try{if(!_['isNil'](members[_0xabc702[_0xbc6a('0x8')]])){utils['debug'](util['format']('[%s][members][agentcomplete]',_0xabc702['uniqueid']),_0xabc702);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0xabc702[_0xbc6a('0x7')],_0xabc702[_0xbc6a('0x8')],_0xabc702['queue']));members[_0xabc702[_0xbc6a('0x8')]]=_[_0xbc6a('0x27')](members[_0xabc702[_0xbc6a('0x8')]],{'data4':_0xabc702[_0xbc6a('0x28')],'uniqueid':_0xabc702[_0xbc6a('0x7')]});}}catch(_0x2507a4){utils[_0xbc6a('0x13')](util[_0xbc6a('0x5')](_0xbc6a('0x29'),_0xabc702[_0xbc6a('0x7')]),_0x2507a4);}};exports[_0xbc6a('0x2a')]=function(_0x363b5f){try{utils[_0xbc6a('0x18')](util[_0xbc6a('0x5')](_0xbc6a('0x2b'),_0x363b5f[_0xbc6a('0x7')]),_0x363b5f);if(_0x363b5f[_0xbc6a('0x9')]){var _0x28a2a2=_0x363b5f['channel'][_0xbc6a('0x10')]('-')[0x0];if(!_['isNil'](members[_0x28a2a2])){members[_0x28a2a2]=_['assign'](members[_0x28a2a2],{'data1':members[_0x28a2a2][_0xbc6a('0x2c')]||_0x363b5f[_0xbc6a('0xb')],'data2':members[_0x28a2a2]['data2']||_0x363b5f['source'],'data3':members[_0x28a2a2][_0xbc6a('0x2d')]||_0x363b5f[_0xbc6a('0x2e')],'uniqueid':members[_0x28a2a2][_0xbc6a('0x7')]||_0x363b5f[_0xbc6a('0x7')]});utils[_0xbc6a('0x1a')](util[_0xbc6a('0x5')](_0xbc6a('0x2f'),_0x363b5f[_0xbc6a('0x7')],members[_0x28a2a2][_0xbc6a('0x2c')],members[_0x28a2a2][_0xbc6a('0x30')],members[_0x28a2a2][_0xbc6a('0x2d')]));if(members[_0x28a2a2]['exitAt']){writeDB(members[_0x28a2a2]);}}}if(_0x363b5f[_0xbc6a('0x31')]){var _0xa3743c=_0x363b5f[_0xbc6a('0x31')][_0xbc6a('0x10')]('-')[0x0];if(!_[_0xbc6a('0x20')](members[_0xa3743c])){members[_0xa3743c]=_[_0xbc6a('0x27')](members[_0xa3743c],{'data1':members[_0xa3743c]['data1']||_0x363b5f[_0xbc6a('0xb')],'data2':members[_0xa3743c][_0xbc6a('0x30')]||_0x363b5f['source'],'data3':members[_0xa3743c][_0xbc6a('0x2d')]||_0x363b5f[_0xbc6a('0x2e')],'uniqueid':members[_0xa3743c][_0xbc6a('0x7')]||_0x363b5f[_0xbc6a('0x7')]});utils[_0xbc6a('0x1a')](util[_0xbc6a('0x5')](_0xbc6a('0x2f'),_0x363b5f['uniqueid'],members[_0xa3743c]['data1'],members[_0xa3743c]['data2'],members[_0xa3743c]['data3']));if(members[_0xa3743c][_0xbc6a('0x21')]){writeDB(members[_0xa3743c]);}}}}catch(_0x2a4596){utils[_0xbc6a('0x13')](util['format'](_0xbc6a('0x2b'),_0x363b5f[_0xbc6a('0x7')]),_0x2a4596);}};
\ No newline at end of file
+var _0x782e=['split','catch','error','format','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','exitAt','duration','diffTime','enterAt','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','type','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x782e,0xb9));var _0xe782=function(_0x4ffbf3,_0x52e503){_0x4ffbf3=_0x4ffbf3-0x0;var _0x468c33=_0x782e[_0x4ffbf3];return _0x468c33;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xe782('0x0'));var members={};var exclude=[_0xe782('0x1'),'Queue:'];function writeDB(_0x18c841){utils[_0xe782('0x2')](util['format'](_0xe782('0x3'),_0x18c841[_0xe782('0x4')],_0x18c841[_0xe782('0x5')],_0x18c841[_0xe782('0x6')],_0x18c841['data2'],_0x18c841[_0xe782('0x7')],_0x18c841['type']));if(_0x18c841['interface']){utils[_0xe782('0x8')](_0x18c841['interface'])[_0xe782('0x9')](function(_0x345b9b){if(_0x345b9b){_0x18c841[_0xe782('0x7')]=_0x345b9b[_0xe782('0xa')];_0x18c841[_0xe782('0xb')]=_0x345b9b[_0xe782('0xb')];utils[_0xe782('0xc')](_0xe782('0xd'),_0x18c841);}else{utils[_0xe782('0xe')](_0x18c841[_0xe782('0x5')][_0xe782('0xf')]('/')[0x1])[_0xe782('0x9')](function(_0x273966){if(_0x273966){_0x18c841[_0xe782('0x7')]=_0x273966['name'];_0x18c841[_0xe782('0xb')]=_0x273966['internal'];utils[_0xe782('0xc')](_0xe782('0xd'),_0x18c841);}});}})[_0xe782('0x10')](function(_0x395030){utils[_0xe782('0x11')](util[_0xe782('0x12')]('[%s][members][writeDB]',_0x18c841['uniqueid']),_0x395030);});}delete members[_0x18c841['interface']];}function startsWith(_0x15d85b,_0xb2c79d){return _['some'](_0x15d85b,function(_0x23cdc6){return _[_0xe782('0x13')](_0xb2c79d,_0x23cdc6);});}exports[_0xe782('0x14')]=function(_0x1a7c8e){try{utils[_0xe782('0x15')](util[_0xe782('0x12')](_0xe782('0x16'),members[_0x1a7c8e[_0xe782('0x17')]]?members[_0x1a7c8e[_0xe782('0x17')]][_0xe782('0x4')]:_0x1a7c8e[_0xe782('0x17')]),_0x1a7c8e);utils[_0xe782('0x2')](util['format'](_0xe782('0x18'),members[_0x1a7c8e[_0xe782('0x17')]]?members[_0x1a7c8e[_0xe782('0x17')]]['uniqueid']:_0x1a7c8e[_0xe782('0x17')],_0x1a7c8e['state'],_0x1a7c8e[_0xe782('0x17')]));switch(_0x1a7c8e['state']){case _0xe782('0x19'):case _0xe782('0x1a'):if(!startsWith(exclude,_0x1a7c8e[_0xe782('0x17')])){members[_0x1a7c8e['device']]={'channel':_0xe782('0x1b'),'interface':_0x1a7c8e[_0xe782('0x17')],'type':_0xe782('0x1c'),'enterAt':utils[_0xe782('0x1d')](),'role':'agent'};}break;case _0xe782('0x1e'):if(!_['isNil'](members[_0x1a7c8e[_0xe782('0x17')]])){members[_0x1a7c8e[_0xe782('0x17')]][_0xe782('0x1f')]=utils[_0xe782('0x1d')]();members[_0x1a7c8e[_0xe782('0x17')]][_0xe782('0x20')]=utils[_0xe782('0x21')](members[_0x1a7c8e[_0xe782('0x17')]][_0xe782('0x1f')],members[_0x1a7c8e[_0xe782('0x17')]][_0xe782('0x22')]);if(members[_0x1a7c8e[_0xe782('0x17')]][_0xe782('0x4')]){writeDB(members[_0x1a7c8e[_0xe782('0x17')]]);}}break;default:break;}}catch(_0x5f45bb){utils[_0xe782('0x11')](util[_0xe782('0x12')](_0xe782('0x16'),members[_0x1a7c8e['device']]?members[_0x1a7c8e['device']][_0xe782('0x4')]:_0x1a7c8e['device']),_0x5f45bb);}};exports['agentcomplete']=function(_0x27244d){try{if(!_[_0xe782('0x23')](members[_0x27244d['interface']])){utils[_0xe782('0x15')](util[_0xe782('0x12')](_0xe782('0x24'),_0x27244d[_0xe782('0x4')]),_0x27244d);utils[_0xe782('0x2')](util[_0xe782('0x12')](_0xe782('0x25'),_0x27244d[_0xe782('0x4')],_0x27244d[_0xe782('0x5')],_0x27244d[_0xe782('0x26')]));members[_0x27244d[_0xe782('0x5')]]=_[_0xe782('0x27')](members[_0x27244d[_0xe782('0x5')]],{'data4':_0x27244d[_0xe782('0x26')],'uniqueid':_0x27244d[_0xe782('0x4')]});}}catch(_0x296742){utils[_0xe782('0x11')](util[_0xe782('0x12')](_0xe782('0x24'),_0x27244d[_0xe782('0x4')]),_0x296742);}};exports[_0xe782('0x28')]=function(_0x3f997c){try{utils[_0xe782('0x15')](util[_0xe782('0x12')](_0xe782('0x29'),_0x3f997c[_0xe782('0x4')]),_0x3f997c);if(_0x3f997c['channel']){var _0x414c15=_0x3f997c[_0xe782('0x6')][_0xe782('0xf')]('-')[0x0];if(!_[_0xe782('0x23')](members[_0x414c15])){members[_0x414c15]=_['assign'](members[_0x414c15],{'data1':members[_0x414c15][_0xe782('0x2a')]||_0x3f997c[_0xe782('0x2b')],'data2':members[_0x414c15][_0xe782('0x2c')]||_0x3f997c[_0xe782('0x2d')],'data3':members[_0x414c15][_0xe782('0x2e')]||_0x3f997c[_0xe782('0x2f')],'uniqueid':members[_0x414c15][_0xe782('0x4')]||_0x3f997c[_0xe782('0x4')]});utils['info'](util[_0xe782('0x12')](_0xe782('0x30'),_0x3f997c[_0xe782('0x4')],members[_0x414c15][_0xe782('0x2a')],members[_0x414c15][_0xe782('0x2c')],members[_0x414c15][_0xe782('0x2e')]));if(members[_0x414c15]['exitAt']){writeDB(members[_0x414c15]);}}}if(_0x3f997c[_0xe782('0x31')]){var _0x4b81ab=_0x3f997c[_0xe782('0x31')][_0xe782('0xf')]('-')[0x0];if(!_[_0xe782('0x23')](members[_0x4b81ab])){members[_0x4b81ab]=_['assign'](members[_0x4b81ab],{'data1':members[_0x4b81ab]['data1']||_0x3f997c['type'],'data2':members[_0x4b81ab]['data2']||_0x3f997c[_0xe782('0x2d')],'data3':members[_0x4b81ab][_0xe782('0x2e')]||_0x3f997c[_0xe782('0x2f')],'uniqueid':members[_0x4b81ab][_0xe782('0x4')]||_0x3f997c[_0xe782('0x4')]});utils[_0xe782('0x2')](util[_0xe782('0x12')](_0xe782('0x30'),_0x3f997c['uniqueid'],members[_0x4b81ab][_0xe782('0x2a')],members[_0x4b81ab][_0xe782('0x2c')],members[_0x4b81ab][_0xe782('0x2e')]));if(members[_0x4b81ab][_0xe782('0x1f')]){writeDB(members[_0x4b81ab]);}}}}catch(_0x4348ac){utils['error'](util[_0xe782('0x12')](_0xe782('0x29'),_0x3f997c['uniqueid']),_0x4348ac);}};
\ No newline at end of file
index be6b4ca..a11ca18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe28a=['[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','origtransfererexten','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','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','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','COMPLETEDBY','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]'];(function(_0x5ab39b,_0x346b1b){var _0x3150e2=function(_0x5d17f7){while(--_0x5d17f7){_0x5ab39b['push'](_0x5ab39b['shift']());}};_0x3150e2(++_0x346b1b);}(_0xe28a,0x7d));var _0xae28=function(_0x3c0258,_0xe1d969){_0x3c0258=_0x3c0258-0x0;var _0x52c3b8=_0xe28a[_0x3c0258];return _0x52c3b8;};'use strict';var _=require(_0xae28('0x0'));var util=require(_0xae28('0x1'));var utils=require(_0xae28('0x2'));var queues={};function writeDB(_0x46f2a5){utils['info'](util[_0xae28('0x3')](_0xae28('0x4'),_0x46f2a5[_0xae28('0x5')],_0x46f2a5[_0xae28('0x6')],_0x46f2a5[_0xae28('0x7')],_0x46f2a5[_0xae28('0x8')],_0x46f2a5[_0xae28('0x9')],_0x46f2a5[_0xae28('0xa')],_0x46f2a5[_0xae28('0xb')]));if(_0x46f2a5[_0xae28('0x7')]){utils[_0xae28('0xc')](_0x46f2a5[_0xae28('0x7')])[_0xae28('0xd')](function(_0x2ce02a){if(_0x2ce02a){_0x46f2a5['type']=_0x2ce02a[_0xae28('0xe')];}utils[_0xae28('0xf')](_0xae28('0x10'),_0x46f2a5);});}else{utils[_0xae28('0xf')]('CreateVoiceQueueReport',_0x46f2a5);}if(_0x46f2a5[_0xae28('0x11')]){delete queues[_0x46f2a5[_0xae28('0x11')]];}else{delete queues[_0x46f2a5[_0xae28('0x5')]];}}exports[_0xae28('0x12')]=function(_0x1843b9){try{utils[_0xae28('0x13')](util[_0xae28('0x3')](_0xae28('0x14'),_0x1843b9['uniqueid']),_0x1843b9);utils[_0xae28('0x15')](util[_0xae28('0x3')](_0xae28('0x16'),_0x1843b9[_0xae28('0x5')],_0x1843b9[_0xae28('0x7')],_0x1843b9['position']));queues[_0x1843b9[_0xae28('0x5')]]=_[_0xae28('0x17')](_0x1843b9,{'originalposition':_0x1843b9[_0xae28('0x18')],'queuecallerjoinAt':utils[_0xae28('0x19')](),'mohtime':0x0});}catch(_0x3d2f2a){utils[_0xae28('0x1a')](util[_0xae28('0x3')](_0xae28('0x14'),_0x1843b9[_0xae28('0x5')]),_0x3d2f2a);}};exports[_0xae28('0x1b')]=function(_0x2e083d){try{if(!_[_0xae28('0x1c')](queues[_0x2e083d[_0xae28('0x5')]])){utils[_0xae28('0x13')](util['format'](_0xae28('0x1d'),_0x2e083d['uniqueid']),_0x2e083d);if(queues[_0x2e083d[_0xae28('0x5')]][_0xae28('0x1e')]){if(!queues[_0x2e083d[_0xae28('0x5')]][_0xae28('0x1f')]&&!queues[_0x2e083d[_0xae28('0x5')]][_0xae28('0x20')]){queues[_0x2e083d['uniqueid']]['queuecallercomplete']=!![];queues[_0x2e083d['uniqueid']][_0xae28('0x21')]=utils[_0xae28('0x19')]();queues[_0x2e083d['uniqueid']][_0xae28('0xb')]='COMPLETEDBYAGENT';}utils[_0xae28('0x15')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x2e083d['uniqueid'],queues[_0x2e083d['uniqueid']][_0xae28('0x22')],queues[_0x2e083d['uniqueid']][_0xae28('0xb')]));writeDB(queues[_0x2e083d['uniqueid']]);}else if(queues[_0x2e083d['uniqueid']]['transfereduniqueid']){utils[_0xae28('0x15')](util[_0xae28('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2e083d[_0xae28('0x5')],queues[_0x2e083d[_0xae28('0x5')]][_0xae28('0x22')],queues[_0x2e083d[_0xae28('0x5')]]['transfereduniqueid']));queues[queues[_0x2e083d['uniqueid']]['transfereduniqueid']]=queues[_0x2e083d['uniqueid']];queues[queues[_0x2e083d[_0xae28('0x5')]]['transfereduniqueid']][_0xae28('0x23')]=0x2;delete queues[_0x2e083d['uniqueid']];}}}catch(_0x2e3dbc){utils[_0xae28('0x1a')](util[_0xae28('0x3')]('[%s][queues][hangup]',_0x2e083d[_0xae28('0x5')]),_0x2e3dbc);}};exports[_0xae28('0x24')]=function(_0x2a48d5){try{utils['debug'](util['format'](_0xae28('0x25'),_0x2a48d5[_0xae28('0x5')]),_0x2a48d5);if(!_[_0xae28('0x1c')](_0x2a48d5[_0xae28('0x26')][_0xae28('0x27')])&&_0x2a48d5[_0xae28('0x28')][_0xae28('0x29')]()!==_0xae28('0x2a')){if(!_[_0xae28('0x1c')](queues[_0x2a48d5[_0xae28('0x5')]])){queues[_0x2a48d5['uniqueid']][_0xae28('0x1f')]=![];queues[_0x2a48d5[_0xae28('0x5')]]['queuecallerabandonAt']=null;queues[_0x2a48d5[_0xae28('0x5')]][_0xae28('0x20')]=!![];queues[_0x2a48d5[_0xae28('0x5')]][_0xae28('0x2b')]=utils[_0xae28('0x19')]();queues[_0x2a48d5[_0xae28('0x5')]][_0xae28('0xb')]=_0x2a48d5[_0xae28('0x28')][_0xae28('0x29')]();utils[_0xae28('0x15')](util[_0xae28('0x3')](_0xae28('0x2c'),_0x2a48d5[_0xae28('0x5')],queues[_0x2a48d5['uniqueid']][_0xae28('0x22')],_0x2a48d5[_0xae28('0x28')],queues[_0x2a48d5['uniqueid']][_0xae28('0xb')]));writeDB(queues[_0x2a48d5['uniqueid']]);}}else if(!_[_0xae28('0x1c')](_0x2a48d5[_0xae28('0x26')][_0xae28('0x2d')])){if(!_[_0xae28('0x1c')](queues[_0x2a48d5[_0xae28('0x5')]])&&!queues[_0x2a48d5['uniqueid']][_0xae28('0x1f')]){queues[_0x2a48d5['uniqueid']][_0xae28('0x1f')]=![];queues[_0x2a48d5[_0xae28('0x5')]][_0xae28('0x2e')]=null;queues[_0x2a48d5[_0xae28('0x5')]][_0xae28('0x20')]=!![];queues[_0x2a48d5[_0xae28('0x5')]][_0xae28('0x2b')]=utils[_0xae28('0x19')]();queues[_0x2a48d5[_0xae28('0x5')]][_0xae28('0xb')]=_0xae28('0x2f');utils[_0xae28('0x15')](util[_0xae28('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x2a48d5[_0xae28('0x5')],queues[_0x2a48d5[_0xae28('0x5')]][_0xae28('0x22')],_0x2a48d5[_0xae28('0x28')],queues[_0x2a48d5['uniqueid']][_0xae28('0xb')]));}}}catch(_0x3aba4e){utils[_0xae28('0x1a')](util[_0xae28('0x3')](_0xae28('0x25'),_0x2a48d5['uniqueid']),_0x3aba4e);}};exports[_0xae28('0x1f')]=function(_0x23aa1f){try{if(!_[_0xae28('0x1c')](queues[_0x23aa1f[_0xae28('0x5')]])){utils['debug'](util[_0xae28('0x3')](_0xae28('0x30'),_0x23aa1f[_0xae28('0x5')]),_0x23aa1f);queues[_0x23aa1f[_0xae28('0x5')]][_0xae28('0x20')]=![];queues[_0x23aa1f[_0xae28('0x5')]][_0xae28('0x2b')]=null;queues[_0x23aa1f[_0xae28('0x5')]][_0xae28('0x1f')]=!![];queues[_0x23aa1f[_0xae28('0x5')]]['queuecallerabandonAt']=utils[_0xae28('0x19')]();queues[_0x23aa1f[_0xae28('0x5')]][_0xae28('0xb')]=_0xae28('0x31');utils[_0xae28('0x15')](util['format'](_0xae28('0x32'),_0x23aa1f[_0xae28('0x5')],queues[_0x23aa1f[_0xae28('0x5')]][_0xae28('0x22')],queues[_0x23aa1f[_0xae28('0x5')]][_0xae28('0xb')]));}}catch(_0x167c7d){utils[_0xae28('0x1a')](util['format'](_0xae28('0x30'),_0x23aa1f[_0xae28('0x5')]),_0x167c7d);}};exports[_0xae28('0x33')]=function(_0x2615d0){try{if(!_[_0xae28('0x1c')](queues[_0x2615d0[_0xae28('0x5')]])){utils[_0xae28('0x13')](util['format']('[%s][queues][queuecallerleave]',_0x2615d0[_0xae28('0x5')]),_0x2615d0);utils[_0xae28('0x15')](util[_0xae28('0x3')](_0xae28('0x34'),_0x2615d0['uniqueid'],queues[_0x2615d0[_0xae28('0x5')]][_0xae28('0x22')],_0x2615d0[_0xae28('0x35')],_0x2615d0['connectedlinename']));queues[_0x2615d0[_0xae28('0x5')]][_0xae28('0x33')]=!![];queues[_0x2615d0[_0xae28('0x5')]][_0xae28('0x1e')]=utils['now']();queues[_0x2615d0['uniqueid']][_0xae28('0x36')]=utils[_0xae28('0x37')](queues[_0x2615d0[_0xae28('0x5')]][_0xae28('0x1e')],queues[_0x2615d0[_0xae28('0x5')]][_0xae28('0x38')]);queues[_0x2615d0[_0xae28('0x5')]][_0xae28('0x18')]=_0x2615d0[_0xae28('0x18')];queues[_0x2615d0['uniqueid']]['count']=_0x2615d0[_0xae28('0x39')];queues[_0x2615d0[_0xae28('0x5')]]['connectedlinenum']=_0x2615d0[_0xae28('0x35')];queues[_0x2615d0[_0xae28('0x5')]][_0xae28('0x3a')]=_0x2615d0[_0xae28('0x3a')];}}catch(_0x24eb10){utils[_0xae28('0x1a')](util[_0xae28('0x3')](_0xae28('0x3b'),_0x2615d0['uniqueid']),_0x24eb10);}};exports[_0xae28('0x3c')]=function(_0x41c24d){try{if(!_[_0xae28('0x1c')](queues[_0x41c24d[_0xae28('0x5')]])){utils[_0xae28('0x13')](util[_0xae28('0x3')]('[%s][queues][agentconnect]',_0x41c24d['uniqueid']),_0x41c24d);utils['info'](util[_0xae28('0x3')](_0xae28('0x3d'),_0x41c24d[_0xae28('0x5')],queues[_0x41c24d[_0xae28('0x5')]][_0xae28('0x22')],_0x41c24d[_0xae28('0x3e')],_0x41c24d['destaccountcode']));queues[_0x41c24d[_0xae28('0x5')]][_0xae28('0x1f')]=![];queues[_0x41c24d['uniqueid']][_0xae28('0x1f')]=![];queues[_0x41c24d[_0xae28('0x5')]][_0xae28('0x2e')]=null;queues[_0x41c24d['uniqueid']][_0xae28('0x20')]=![];queues[_0x41c24d[_0xae28('0x5')]][_0xae28('0xb')]=null;queues[_0x41c24d[_0xae28('0x5')]][_0xae28('0x2b')]=null;queues[_0x41c24d['uniqueid']][_0xae28('0x3f')]=!![];queues[_0x41c24d[_0xae28('0x5')]][_0xae28('0xa')]=_0x41c24d['destaccountcode'];queues[_0x41c24d[_0xae28('0x5')]][_0xae28('0x8')]=_0x41c24d[_0xae28('0x3e')];}}catch(_0x4ad323){utils[_0xae28('0x1a')](util['format'](_0xae28('0x40'),_0x41c24d[_0xae28('0x5')]),_0x4ad323);}};exports[_0xae28('0x41')]=function(_0x3ad99b){try{if(!_['isNil'](queues[_0x3ad99b[_0xae28('0x5')]])){if(queues[_0x3ad99b[_0xae28('0x5')]]['queuecallerleaveAt']){utils[_0xae28('0x13')](util[_0xae28('0x3')](_0xae28('0x42'),_0x3ad99b[_0xae28('0x5')]),_0x3ad99b);queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0x1f')]=![];queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0x1f')]=![];queues[_0x3ad99b['uniqueid']][_0xae28('0x2e')]=null;queues[_0x3ad99b[_0xae28('0x5')]]['queuecallerexit']=![];queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0x2b')]=null;queues[_0x3ad99b['uniqueid']]['assigned']=!![];queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0x8')]=_0x3ad99b[_0xae28('0x3e')];queues[_0x3ad99b['uniqueid']][_0xae28('0x43')]=!![];queues[_0x3ad99b['uniqueid']][_0xae28('0x21')]=utils[_0xae28('0x19')]();if(_0x3ad99b[_0xae28('0x44')]==_0xae28('0x45')){if(!queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0x45')]){queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0xb')]='TRANSFER';}}else{queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0xb')]=_0xae28('0x46')+_0x3ad99b[_0xae28('0x44')]['toUpperCase']();}utils[_0xae28('0x15')](util[_0xae28('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x3ad99b[_0xae28('0x5')],queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0x22')],_0x3ad99b['membername'],queues[_0x3ad99b[_0xae28('0x5')]][_0xae28('0xb')]));writeDB(queues[_0x3ad99b[_0xae28('0x5')]]);}}}catch(_0xad6bf5){utils[_0xae28('0x1a')](util[_0xae28('0x3')](_0xae28('0x42'),_0x3ad99b[_0xae28('0x5')]),_0xad6bf5);}};exports['blindtransfer']=function(_0x1f8b0d){try{if(!_['isNil'](queues[_0x1f8b0d['transfereeuniqueid']])){utils[_0xae28('0x13')](util['format']('[%s][queues][blindtransfer]',_0x1f8b0d['uniqueid']),_0x1f8b0d);queues[_0x1f8b0d[_0xae28('0x47')]][_0xae28('0x45')]=!![];queues[_0x1f8b0d[_0xae28('0x47')]][_0xae28('0x48')]=_0xae28('0x49');queues[_0x1f8b0d['transfereeuniqueid']][_0xae28('0x4a')]=_0x1f8b0d[_0xae28('0x4b')];queues[_0x1f8b0d['transfereeuniqueid']][_0xae28('0x4c')]=_0x1f8b0d[_0xae28('0x47')];queues[_0x1f8b0d[_0xae28('0x47')]][_0xae28('0xb')]='BLINDTRANSFER';utils[_0xae28('0x15')](util[_0xae28('0x3')](_0xae28('0x4d'),_0x1f8b0d['uniqueid'],queues[_0x1f8b0d[_0xae28('0x47')]][_0xae28('0x22')],_0x1f8b0d['transfereeuniqueid'],_0x1f8b0d['extension']));}}catch(_0x560ea6){utils[_0xae28('0x1a')](util[_0xae28('0x3')](_0xae28('0x4e'),_0x1f8b0d['uniqueid']),_0x560ea6);}};exports['attendedtransfer']=function(_0x5d544c){try{utils['debug'](util['format'](_0xae28('0x4f'),_0x5d544c[_0xae28('0x50')]),_0x5d544c);if(_0x5d544c['origtransfereruniqueid']==_0x5d544c[_0xae28('0x51')]){if(!_[_0xae28('0x1c')](queues[_0x5d544c['secondtransfererlinkedid']])){utils[_0xae28('0x15')](util[_0xae28('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5d544c['origtransfereruniqueid'],queues[_0x5d544c['secondtransfererlinkedid']][_0xae28('0x22')],_0x5d544c[_0xae28('0x52')]));queues[_0x5d544c[_0xae28('0x53')]][_0xae28('0x45')]=!![];queues[_0x5d544c['secondtransfererlinkedid']][_0xae28('0x48')]=_0xae28('0x54');queues[_0x5d544c[_0xae28('0x53')]]['transferexten']=_0x5d544c[_0xae28('0x52')];queues[_0x5d544c[_0xae28('0x53')]][_0xae28('0x4c')]=_0x5d544c[_0xae28('0x50')];queues[_0x5d544c[_0xae28('0x53')]][_0xae28('0xb')]=_0xae28('0x55');}if(!_[_0xae28('0x1c')](queues[_0x5d544c['origtransfererlinkedid']])){if(_0x5d544c[_0xae28('0x56')]&&queues[_0x5d544c['transfereelinkedid']]){queues[_0x5d544c[_0xae28('0x56')]][_0xae28('0x23')]=0x1;queues[_0x5d544c[_0xae28('0x47')]]=_['clone'](queues[_0x5d544c[_0xae28('0x56')]]);queues[_0x5d544c[_0xae28('0x47')]][_0xae28('0x11')]=_0x5d544c['transfertargetuniqueid'];queues[_0x5d544c['transfereeuniqueid']][_0xae28('0x23')]=0x2;queues[_0x5d544c[_0xae28('0x47')]]['calleridnum']=queues[_0x5d544c['secondtransfererlinkedid']]['calleridnum'];queues[_0x5d544c[_0xae28('0x47')]][_0xae28('0x57')]=queues[_0x5d544c[_0xae28('0x53')]][_0xae28('0x57')];queues[_0x5d544c[_0xae28('0x47')]][_0xae28('0x38')]=utils[_0xae28('0x19')]();queues[_0x5d544c[_0xae28('0x47')]][_0xae28('0x1e')]=utils[_0xae28('0x19')]();queues[_0x5d544c[_0xae28('0x47')]][_0xae28('0x36')]=0x0;queues[_0x5d544c[_0xae28('0x47')]][_0xae28('0x58')]=0x0;utils['info'](util[_0xae28('0x3')](_0xae28('0x59'),_0x5d544c[_0xae28('0x50')],queues[_0x5d544c[_0xae28('0x47')]][_0xae28('0x22')],queues[_0x5d544c[_0xae28('0x47')]]['calleridnum'],queues[_0x5d544c[_0xae28('0x47')]]['calleridname']));}else{utils['info'](util[_0xae28('0x3')](_0xae28('0x5a'),_0x5d544c['origtransfereruniqueid'],queues[_0x5d544c[_0xae28('0x51')]][_0xae28('0x22')],_0x5d544c[_0xae28('0x53')]));queues[_0x5d544c[_0xae28('0x51')]][_0xae28('0x11')]=_0x5d544c[_0xae28('0x53')];}}}else if(_0x5d544c[_0xae28('0x5b')]==_0x5d544c['secondtransfererlinkedid']){if(!_[_0xae28('0x1c')](queues[_0x5d544c[_0xae28('0x51')]])){utils[_0xae28('0x15')](util[_0xae28('0x3')](_0xae28('0x5c'),_0x5d544c['origtransfereruniqueid'],queues[_0x5d544c[_0xae28('0x51')]][_0xae28('0x22')],_0x5d544c[_0xae28('0x5b')],_0x5d544c[_0xae28('0x5d')]));queues[_0x5d544c[_0xae28('0x51')]][_0xae28('0x45')]=!![];queues[_0x5d544c[_0xae28('0x51')]]['transfertype']=_0xae28('0x54');queues[_0x5d544c['origtransfererlinkedid']][_0xae28('0x4a')]=_0x5d544c['secondtransfererexten'];queues[_0x5d544c[_0xae28('0x51')]][_0xae28('0x4c')]=_0x5d544c[_0xae28('0x5b')];queues[_0x5d544c[_0xae28('0x51')]]['queuecallerexitreason']=_0xae28('0x55');}if(!_[_0xae28('0x1c')](queues[_0x5d544c[_0xae28('0x53')]])){if(_0x5d544c[_0xae28('0x5e')]&&queues[_0x5d544c[_0xae28('0x5e')]]){queues[_0x5d544c[_0xae28('0x5e')]][_0xae28('0x23')]=0x1;queues[_0x5d544c['transfertargetuniqueid']]=_['clone'](queues[_0x5d544c['transfertargetlinkedid']]);queues[_0x5d544c[_0xae28('0x5f')]][_0xae28('0x11')]=_0x5d544c['transfertargetuniqueid'];queues[_0x5d544c['transfertargetuniqueid']][_0xae28('0x23')]=0x2;queues[_0x5d544c[_0xae28('0x5f')]]['calleridnum']=queues[_0x5d544c[_0xae28('0x51')]][_0xae28('0x9')];queues[_0x5d544c[_0xae28('0x5f')]][_0xae28('0x57')]=queues[_0x5d544c[_0xae28('0x51')]][_0xae28('0x57')];queues[_0x5d544c[_0xae28('0x5f')]][_0xae28('0x38')]=utils[_0xae28('0x19')]();queues[_0x5d544c['transfertargetuniqueid']][_0xae28('0x1e')]=utils[_0xae28('0x19')]();queues[_0x5d544c['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x5d544c[_0xae28('0x5f')]][_0xae28('0x58')]=0x0;utils[_0xae28('0x15')](util['format'](_0xae28('0x60'),_0x5d544c[_0xae28('0x50')],queues[_0x5d544c[_0xae28('0x5f')]][_0xae28('0x22')],queues[_0x5d544c['transfertargetuniqueid']][_0xae28('0x11')],queues[_0x5d544c[_0xae28('0x5f')]]['calleridnum'],queues[_0x5d544c[_0xae28('0x5f')]][_0xae28('0x57')]));}else{utils[_0xae28('0x15')](util[_0xae28('0x3')](_0xae28('0x5a'),_0x5d544c['origtransfereruniqueid'],queues[_0x5d544c[_0xae28('0x53')]][_0xae28('0x22')],_0x5d544c[_0xae28('0x51')]));queues[_0x5d544c[_0xae28('0x53')]][_0xae28('0x11')]=_0x5d544c['origtransfererlinkedid'];}}}}catch(_0x45c4df){utils[_0xae28('0x1a')](util['format']('[%s][queues][attendedtransfer]',_0x5d544c['origtransfereruniqueid']),_0x45c4df);}};exports[_0xae28('0x61')]=function(_0x308d65){try{if(!_[_0xae28('0x1c')](queues[_0x308d65[_0xae28('0x5')]])){utils['debug'](util[_0xae28('0x3')](_0xae28('0x62'),_0x308d65['uniqueid']),_0x308d65);queues[_0x308d65[_0xae28('0x5')]][_0xae28('0x63')]=utils[_0xae28('0x19')]();utils[_0xae28('0x15')](util[_0xae28('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x308d65['uniqueid'],queues[_0x308d65[_0xae28('0x5')]][_0xae28('0x22')],queues[_0x308d65[_0xae28('0x5')]][_0xae28('0x63')]));}}catch(_0x28c0b7){utils[_0xae28('0x1a')](util[_0xae28('0x3')](_0xae28('0x62'),_0x308d65[_0xae28('0x5')]),_0x28c0b7);}};exports['musiconholdstop']=function(_0xfc41c2){try{if(!_[_0xae28('0x1c')](queues[_0xfc41c2['uniqueid']])){if(!_[_0xae28('0x1c')](queues[_0xfc41c2[_0xae28('0x5')]][_0xae28('0x63')])){utils[_0xae28('0x13')](util[_0xae28('0x3')](_0xae28('0x64'),_0xfc41c2[_0xae28('0x5')]),_0xfc41c2);queues[_0xfc41c2[_0xae28('0x5')]][_0xae28('0x58')]+=utils[_0xae28('0x37')](utils[_0xae28('0x19')](),queues[_0xfc41c2[_0xae28('0x5')]][_0xae28('0x63')]);utils[_0xae28('0x15')](util['format'](_0xae28('0x65'),_0xfc41c2['uniqueid'],queues[_0xfc41c2['uniqueid']]['name'],queues[_0xfc41c2[_0xae28('0x5')]][_0xae28('0x58')]));delete queues[_0xfc41c2[_0xae28('0x5')]]['musiconholdstartAt'];}}}catch(_0x488cdc){utils[_0xae28('0x1a')](util['format'](_0xae28('0x64'),_0xfc41c2[_0xae28('0x5')]),_0x488cdc);}};
\ No newline at end of file
+var _0x1eeb=['[%s][queues][varset]','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','destaccountcode','lastAssignedTo','membername','[%s][queues][agentconnect]','agentcomplete','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','clone','calleridname','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','mohtime','lodash','info','uniqueid','channel','queue','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1eeb,0xaf));var _0xb1ee=function(_0x204e64,_0x51194d){_0x204e64=_0x204e64-0x0;var _0x2882d2=_0x1eeb[_0x204e64];return _0x2882d2;};'use strict';var _=require(_0xb1ee('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x1d1a68){utils[_0xb1ee('0x1')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x1d1a68[_0xb1ee('0x2')],_0x1d1a68[_0xb1ee('0x3')],_0x1d1a68[_0xb1ee('0x4')],_0x1d1a68['lastAssignedTo'],_0x1d1a68[_0xb1ee('0x5')],_0x1d1a68['accountcode'],_0x1d1a68[_0xb1ee('0x6')]));if(_0x1d1a68[_0xb1ee('0x4')]){utils[_0xb1ee('0x7')](_0x1d1a68[_0xb1ee('0x4')])[_0xb1ee('0x8')](function(_0x2a3ced){if(_0x2a3ced){_0x1d1a68['type']=_0x2a3ced['type'];}utils['request'](_0xb1ee('0x9'),_0x1d1a68);});}else{utils[_0xb1ee('0xa')]('CreateVoiceQueueReport',_0x1d1a68);}if(_0x1d1a68[_0xb1ee('0xb')]){delete queues[_0x1d1a68[_0xb1ee('0xb')]];}else{delete queues[_0x1d1a68[_0xb1ee('0x2')]];}}exports[_0xb1ee('0xc')]=function(_0xf4ab1f){try{utils[_0xb1ee('0xd')](util[_0xb1ee('0xe')](_0xb1ee('0xf'),_0xf4ab1f[_0xb1ee('0x2')]),_0xf4ab1f);utils[_0xb1ee('0x1')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xf4ab1f['uniqueid'],_0xf4ab1f[_0xb1ee('0x4')],_0xf4ab1f[_0xb1ee('0x10')]));queues[_0xf4ab1f[_0xb1ee('0x2')]]=_[_0xb1ee('0x11')](_0xf4ab1f,{'originalposition':_0xf4ab1f[_0xb1ee('0x10')],'queuecallerjoinAt':utils[_0xb1ee('0x12')](),'mohtime':0x0});}catch(_0x3d1baa){utils[_0xb1ee('0x13')](util['format']('[%s][queues][queuecallerjoin]',_0xf4ab1f[_0xb1ee('0x2')]),_0x3d1baa);}};exports[_0xb1ee('0x14')]=function(_0x1049be){try{if(!_[_0xb1ee('0x15')](queues[_0x1049be[_0xb1ee('0x2')]])){utils[_0xb1ee('0xd')](util[_0xb1ee('0xe')](_0xb1ee('0x16'),_0x1049be[_0xb1ee('0x2')]),_0x1049be);if(queues[_0x1049be[_0xb1ee('0x2')]][_0xb1ee('0x17')]){if(!queues[_0x1049be[_0xb1ee('0x2')]]['queuecallerabandon']&&!queues[_0x1049be[_0xb1ee('0x2')]][_0xb1ee('0x18')]){queues[_0x1049be[_0xb1ee('0x2')]][_0xb1ee('0x19')]=!![];queues[_0x1049be[_0xb1ee('0x2')]][_0xb1ee('0x1a')]=utils[_0xb1ee('0x12')]();queues[_0x1049be[_0xb1ee('0x2')]][_0xb1ee('0x6')]='COMPLETEDBYAGENT';}utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x1049be[_0xb1ee('0x2')],queues[_0x1049be[_0xb1ee('0x2')]][_0xb1ee('0x1b')],queues[_0x1049be['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x1049be['uniqueid']]);}else if(queues[_0x1049be[_0xb1ee('0x2')]][_0xb1ee('0xb')]){utils['info'](util['format'](_0xb1ee('0x1c'),_0x1049be[_0xb1ee('0x2')],queues[_0x1049be[_0xb1ee('0x2')]]['name'],queues[_0x1049be['uniqueid']][_0xb1ee('0xb')]));queues[queues[_0x1049be[_0xb1ee('0x2')]]['transfereduniqueid']]=queues[_0x1049be[_0xb1ee('0x2')]];queues[queues[_0x1049be[_0xb1ee('0x2')]]['transfereduniqueid']][_0xb1ee('0x1d')]=0x2;delete queues[_0x1049be[_0xb1ee('0x2')]];}}}catch(_0x3799b5){utils[_0xb1ee('0x13')](util['format']('[%s][queues][hangup]',_0x1049be[_0xb1ee('0x2')]),_0x3799b5);}};exports[_0xb1ee('0x1e')]=function(_0x4fbfbd){try{utils[_0xb1ee('0xd')](util[_0xb1ee('0xe')](_0xb1ee('0x1f'),_0x4fbfbd[_0xb1ee('0x2')]),_0x4fbfbd);if(!_[_0xb1ee('0x15')](_0x4fbfbd['variable']['queuestatus'])&&_0x4fbfbd[_0xb1ee('0x20')][_0xb1ee('0x21')]()!==_0xb1ee('0x22')){if(!_[_0xb1ee('0x15')](queues[_0x4fbfbd['uniqueid']])){queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x23')]=![];queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x24')]=null;queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x18')]=!![];queues[_0x4fbfbd[_0xb1ee('0x2')]]['queuecallerexitAt']=utils['now']();queues[_0x4fbfbd['uniqueid']][_0xb1ee('0x6')]=_0x4fbfbd[_0xb1ee('0x20')][_0xb1ee('0x21')]();utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')](_0xb1ee('0x25'),_0x4fbfbd[_0xb1ee('0x2')],queues[_0x4fbfbd['uniqueid']][_0xb1ee('0x1b')],_0x4fbfbd[_0xb1ee('0x20')],queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x6')]));writeDB(queues[_0x4fbfbd[_0xb1ee('0x2')]]);}}else if(!_[_0xb1ee('0x15')](_0x4fbfbd[_0xb1ee('0x26')]['queueposition'])){if(!_['isNil'](queues[_0x4fbfbd[_0xb1ee('0x2')]])&&!queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x23')]){queues[_0x4fbfbd[_0xb1ee('0x2')]]['queuecallerabandon']=![];queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x24')]=null;queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x18')]=!![];queues[_0x4fbfbd['uniqueid']][_0xb1ee('0x27')]=utils[_0xb1ee('0x12')]();queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x6')]=_0xb1ee('0x28');utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')](_0xb1ee('0x29'),_0x4fbfbd['uniqueid'],queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x1b')],_0x4fbfbd[_0xb1ee('0x20')],queues[_0x4fbfbd[_0xb1ee('0x2')]][_0xb1ee('0x6')]));}}}catch(_0x31bce8){utils[_0xb1ee('0x13')](util[_0xb1ee('0xe')]('[%s][queues][varset]',_0x4fbfbd['uniqueid']),_0x31bce8);}};exports[_0xb1ee('0x23')]=function(_0x3ed903){try{if(!_[_0xb1ee('0x15')](queues[_0x3ed903[_0xb1ee('0x2')]])){utils[_0xb1ee('0xd')](util[_0xb1ee('0xe')]('[%s][queues][queuecallerabandon]',_0x3ed903[_0xb1ee('0x2')]),_0x3ed903);queues[_0x3ed903[_0xb1ee('0x2')]][_0xb1ee('0x18')]=![];queues[_0x3ed903['uniqueid']][_0xb1ee('0x27')]=null;queues[_0x3ed903[_0xb1ee('0x2')]][_0xb1ee('0x23')]=!![];queues[_0x3ed903[_0xb1ee('0x2')]]['queuecallerabandonAt']=utils[_0xb1ee('0x12')]();queues[_0x3ed903[_0xb1ee('0x2')]]['queuecallerexitreason']=_0xb1ee('0x2a');utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')](_0xb1ee('0x2b'),_0x3ed903[_0xb1ee('0x2')],queues[_0x3ed903['uniqueid']][_0xb1ee('0x1b')],queues[_0x3ed903[_0xb1ee('0x2')]][_0xb1ee('0x6')]));}}catch(_0x25927f){utils[_0xb1ee('0x13')](util[_0xb1ee('0xe')](_0xb1ee('0x2c'),_0x3ed903[_0xb1ee('0x2')]),_0x25927f);}};exports[_0xb1ee('0x2d')]=function(_0x381609){try{if(!_[_0xb1ee('0x15')](queues[_0x381609[_0xb1ee('0x2')]])){utils[_0xb1ee('0xd')](util['format'](_0xb1ee('0x2e'),_0x381609[_0xb1ee('0x2')]),_0x381609);utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')](_0xb1ee('0x2f'),_0x381609['uniqueid'],queues[_0x381609[_0xb1ee('0x2')]]['name'],_0x381609[_0xb1ee('0x30')],_0x381609[_0xb1ee('0x31')]));queues[_0x381609['uniqueid']][_0xb1ee('0x2d')]=!![];queues[_0x381609[_0xb1ee('0x2')]][_0xb1ee('0x17')]=utils[_0xb1ee('0x12')]();queues[_0x381609[_0xb1ee('0x2')]][_0xb1ee('0x32')]=utils[_0xb1ee('0x33')](queues[_0x381609[_0xb1ee('0x2')]]['queuecallerleaveAt'],queues[_0x381609[_0xb1ee('0x2')]][_0xb1ee('0x34')]);queues[_0x381609[_0xb1ee('0x2')]][_0xb1ee('0x10')]=_0x381609['position'];queues[_0x381609['uniqueid']][_0xb1ee('0x35')]=_0x381609[_0xb1ee('0x35')];queues[_0x381609[_0xb1ee('0x2')]][_0xb1ee('0x30')]=_0x381609[_0xb1ee('0x30')];queues[_0x381609[_0xb1ee('0x2')]][_0xb1ee('0x31')]=_0x381609['connectedlinename'];}}catch(_0x5a5b25){utils[_0xb1ee('0x13')](util['format'](_0xb1ee('0x2e'),_0x381609['uniqueid']),_0x5a5b25);}};exports[_0xb1ee('0x36')]=function(_0x1a1857){try{if(!_[_0xb1ee('0x15')](queues[_0x1a1857['uniqueid']])){utils[_0xb1ee('0xd')](util[_0xb1ee('0xe')]('[%s][queues][agentconnect]',_0x1a1857[_0xb1ee('0x2')]),_0x1a1857);utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')](_0xb1ee('0x37'),_0x1a1857[_0xb1ee('0x2')],queues[_0x1a1857[_0xb1ee('0x2')]][_0xb1ee('0x1b')],_0x1a1857['membername'],_0x1a1857['destaccountcode']));queues[_0x1a1857['uniqueid']]['queuecallerabandon']=![];queues[_0x1a1857[_0xb1ee('0x2')]][_0xb1ee('0x23')]=![];queues[_0x1a1857[_0xb1ee('0x2')]][_0xb1ee('0x24')]=null;queues[_0x1a1857[_0xb1ee('0x2')]][_0xb1ee('0x18')]=![];queues[_0x1a1857[_0xb1ee('0x2')]][_0xb1ee('0x6')]=null;queues[_0x1a1857['uniqueid']]['queuecallerexitAt']=null;queues[_0x1a1857[_0xb1ee('0x2')]][_0xb1ee('0x38')]=!![];queues[_0x1a1857[_0xb1ee('0x2')]]['accountcode']=_0x1a1857[_0xb1ee('0x39')];queues[_0x1a1857['uniqueid']][_0xb1ee('0x3a')]=_0x1a1857[_0xb1ee('0x3b')];}}catch(_0x1c473c){utils['error'](util[_0xb1ee('0xe')](_0xb1ee('0x3c'),_0x1a1857[_0xb1ee('0x2')]),_0x1c473c);}};exports[_0xb1ee('0x3d')]=function(_0x444c29){try{if(!_['isNil'](queues[_0x444c29[_0xb1ee('0x2')]])){if(queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x17')]){utils[_0xb1ee('0xd')](util['format']('[%s][queues][agentcomplete]',_0x444c29['uniqueid']),_0x444c29);queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x23')]=![];queues[_0x444c29[_0xb1ee('0x2')]]['queuecallerabandon']=![];queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x24')]=null;queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x18')]=![];queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x27')]=null;queues[_0x444c29[_0xb1ee('0x2')]]['assigned']=!![];queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x3a')]=_0x444c29[_0xb1ee('0x3b')];queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x19')]=!![];queues[_0x444c29[_0xb1ee('0x2')]]['queuecallercompleteAt']=utils['now']();if(_0x444c29['reason']=='transfer'){if(!queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x3e')]){queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x6')]=_0xb1ee('0x3f');}}else{queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x6')]=_0xb1ee('0x40')+_0x444c29[_0xb1ee('0x41')]['toUpperCase']();}utils['info'](util['format'](_0xb1ee('0x42'),_0x444c29['uniqueid'],queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x1b')],_0x444c29[_0xb1ee('0x3b')],queues[_0x444c29[_0xb1ee('0x2')]][_0xb1ee('0x6')]));writeDB(queues[_0x444c29['uniqueid']]);}}}catch(_0x1aa035){utils[_0xb1ee('0x13')](util[_0xb1ee('0xe')](_0xb1ee('0x43'),_0x444c29['uniqueid']),_0x1aa035);}};exports[_0xb1ee('0x44')]=function(_0x43bd66){try{if(!_['isNil'](queues[_0x43bd66[_0xb1ee('0x45')]])){utils[_0xb1ee('0xd')](util['format'](_0xb1ee('0x46'),_0x43bd66[_0xb1ee('0x2')]),_0x43bd66);queues[_0x43bd66['transfereeuniqueid']][_0xb1ee('0x3e')]=!![];queues[_0x43bd66[_0xb1ee('0x45')]][_0xb1ee('0x47')]=_0xb1ee('0x48');queues[_0x43bd66[_0xb1ee('0x45')]][_0xb1ee('0x49')]=_0x43bd66[_0xb1ee('0x4a')];queues[_0x43bd66['transfereeuniqueid']][_0xb1ee('0x4b')]=_0x43bd66[_0xb1ee('0x45')];queues[_0x43bd66['transfereeuniqueid']][_0xb1ee('0x6')]=_0xb1ee('0x4c');utils[_0xb1ee('0x1')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x43bd66[_0xb1ee('0x2')],queues[_0x43bd66[_0xb1ee('0x45')]][_0xb1ee('0x1b')],_0x43bd66['transfereeuniqueid'],_0x43bd66[_0xb1ee('0x4a')]));}}catch(_0x1e43de){utils[_0xb1ee('0x13')](util[_0xb1ee('0xe')](_0xb1ee('0x46'),_0x43bd66[_0xb1ee('0x2')]),_0x1e43de);}};exports[_0xb1ee('0x4d')]=function(_0x168f13){try{utils['debug'](util[_0xb1ee('0xe')](_0xb1ee('0x4e'),_0x168f13[_0xb1ee('0x4f')]),_0x168f13);if(_0x168f13['origtransfereruniqueid']==_0x168f13[_0xb1ee('0x50')]){if(!_[_0xb1ee('0x15')](queues[_0x168f13[_0xb1ee('0x51')]])){utils[_0xb1ee('0x1')](util['format'](_0xb1ee('0x52'),_0x168f13['origtransfereruniqueid'],queues[_0x168f13[_0xb1ee('0x51')]][_0xb1ee('0x1b')],_0x168f13[_0xb1ee('0x53')]));queues[_0x168f13[_0xb1ee('0x51')]][_0xb1ee('0x3e')]=!![];queues[_0x168f13[_0xb1ee('0x51')]]['transfertype']=_0xb1ee('0x54');queues[_0x168f13['secondtransfererlinkedid']][_0xb1ee('0x49')]=_0x168f13[_0xb1ee('0x53')];queues[_0x168f13[_0xb1ee('0x51')]][_0xb1ee('0x4b')]=_0x168f13[_0xb1ee('0x4f')];queues[_0x168f13['secondtransfererlinkedid']][_0xb1ee('0x6')]='ATTENDEDTRANSFER';}if(!_[_0xb1ee('0x15')](queues[_0x168f13[_0xb1ee('0x50')]])){if(_0x168f13[_0xb1ee('0x55')]&&queues[_0x168f13[_0xb1ee('0x55')]]){queues[_0x168f13[_0xb1ee('0x55')]]['queuecallerenterreason']=0x1;queues[_0x168f13['transfereeuniqueid']]=_[_0xb1ee('0x56')](queues[_0x168f13['transfereelinkedid']]);queues[_0x168f13[_0xb1ee('0x45')]][_0xb1ee('0xb')]=_0x168f13['transfertargetuniqueid'];queues[_0x168f13['transfereeuniqueid']][_0xb1ee('0x1d')]=0x2;queues[_0x168f13[_0xb1ee('0x45')]][_0xb1ee('0x5')]=queues[_0x168f13['secondtransfererlinkedid']]['calleridnum'];queues[_0x168f13[_0xb1ee('0x45')]][_0xb1ee('0x57')]=queues[_0x168f13[_0xb1ee('0x51')]][_0xb1ee('0x57')];queues[_0x168f13[_0xb1ee('0x45')]]['queuecallerjoinAt']=utils['now']();queues[_0x168f13[_0xb1ee('0x45')]][_0xb1ee('0x17')]=utils[_0xb1ee('0x12')]();queues[_0x168f13['transfereeuniqueid']][_0xb1ee('0x32')]=0x0;queues[_0x168f13[_0xb1ee('0x45')]]['mohtime']=0x0;utils['info'](util[_0xb1ee('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x168f13[_0xb1ee('0x4f')],queues[_0x168f13['transfereeuniqueid']][_0xb1ee('0x1b')],queues[_0x168f13[_0xb1ee('0x45')]][_0xb1ee('0x5')],queues[_0x168f13[_0xb1ee('0x45')]][_0xb1ee('0x57')]));}else{utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x168f13['origtransfereruniqueid'],queues[_0x168f13[_0xb1ee('0x50')]][_0xb1ee('0x1b')],_0x168f13[_0xb1ee('0x51')]));queues[_0x168f13[_0xb1ee('0x50')]][_0xb1ee('0xb')]=_0x168f13[_0xb1ee('0x51')];}}}else if(_0x168f13[_0xb1ee('0x58')]==_0x168f13[_0xb1ee('0x51')]){if(!_[_0xb1ee('0x15')](queues[_0x168f13[_0xb1ee('0x50')]])){utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')](_0xb1ee('0x59'),_0x168f13[_0xb1ee('0x4f')],queues[_0x168f13[_0xb1ee('0x50')]][_0xb1ee('0x1b')],_0x168f13['secondtransfereruniqueid'],_0x168f13[_0xb1ee('0x5a')]));queues[_0x168f13[_0xb1ee('0x50')]][_0xb1ee('0x3e')]=!![];queues[_0x168f13[_0xb1ee('0x50')]]['transfertype']=_0xb1ee('0x54');queues[_0x168f13['origtransfererlinkedid']]['transferexten']=_0x168f13[_0xb1ee('0x5a')];queues[_0x168f13[_0xb1ee('0x50')]][_0xb1ee('0x4b')]=_0x168f13['secondtransfereruniqueid'];queues[_0x168f13[_0xb1ee('0x50')]][_0xb1ee('0x6')]=_0xb1ee('0x5b');}if(!_[_0xb1ee('0x15')](queues[_0x168f13[_0xb1ee('0x51')]])){if(_0x168f13[_0xb1ee('0x5c')]&&queues[_0x168f13['transfertargetlinkedid']]){queues[_0x168f13[_0xb1ee('0x5c')]][_0xb1ee('0x1d')]=0x1;queues[_0x168f13[_0xb1ee('0x5d')]]=_[_0xb1ee('0x56')](queues[_0x168f13[_0xb1ee('0x5c')]]);queues[_0x168f13[_0xb1ee('0x5d')]][_0xb1ee('0xb')]=_0x168f13[_0xb1ee('0x5d')];queues[_0x168f13[_0xb1ee('0x5d')]]['queuecallerenterreason']=0x2;queues[_0x168f13[_0xb1ee('0x5d')]][_0xb1ee('0x5')]=queues[_0x168f13[_0xb1ee('0x50')]][_0xb1ee('0x5')];queues[_0x168f13[_0xb1ee('0x5d')]]['calleridname']=queues[_0x168f13[_0xb1ee('0x50')]][_0xb1ee('0x57')];queues[_0x168f13[_0xb1ee('0x5d')]][_0xb1ee('0x34')]=utils[_0xb1ee('0x12')]();queues[_0x168f13['transfertargetuniqueid']][_0xb1ee('0x17')]=utils[_0xb1ee('0x12')]();queues[_0x168f13[_0xb1ee('0x5d')]][_0xb1ee('0x32')]=0x0;queues[_0x168f13[_0xb1ee('0x5d')]]['mohtime']=0x0;utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')](_0xb1ee('0x5e'),_0x168f13['origtransfereruniqueid'],queues[_0x168f13[_0xb1ee('0x5d')]][_0xb1ee('0x1b')],queues[_0x168f13['transfertargetuniqueid']][_0xb1ee('0xb')],queues[_0x168f13[_0xb1ee('0x5d')]][_0xb1ee('0x5')],queues[_0x168f13[_0xb1ee('0x5d')]][_0xb1ee('0x57')]));}else{utils['info'](util['format'](_0xb1ee('0x5f'),_0x168f13[_0xb1ee('0x4f')],queues[_0x168f13[_0xb1ee('0x51')]][_0xb1ee('0x1b')],_0x168f13['origtransfererlinkedid']));queues[_0x168f13[_0xb1ee('0x51')]][_0xb1ee('0xb')]=_0x168f13[_0xb1ee('0x50')];}}}}catch(_0x27448e){utils[_0xb1ee('0x13')](util[_0xb1ee('0xe')]('[%s][queues][attendedtransfer]',_0x168f13[_0xb1ee('0x4f')]),_0x27448e);}};exports[_0xb1ee('0x60')]=function(_0x5edb06){try{if(!_[_0xb1ee('0x15')](queues[_0x5edb06['uniqueid']])){utils[_0xb1ee('0xd')](util[_0xb1ee('0xe')](_0xb1ee('0x61'),_0x5edb06[_0xb1ee('0x2')]),_0x5edb06);queues[_0x5edb06[_0xb1ee('0x2')]][_0xb1ee('0x62')]=utils['now']();utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x5edb06[_0xb1ee('0x2')],queues[_0x5edb06['uniqueid']][_0xb1ee('0x1b')],queues[_0x5edb06['uniqueid']]['musiconholdstartAt']));}}catch(_0x39cca4){utils[_0xb1ee('0x13')](util['format']('[%s][queues][musiconholdstart]',_0x5edb06[_0xb1ee('0x2')]),_0x39cca4);}};exports[_0xb1ee('0x63')]=function(_0x82a5ce){try{if(!_['isNil'](queues[_0x82a5ce['uniqueid']])){if(!_[_0xb1ee('0x15')](queues[_0x82a5ce[_0xb1ee('0x2')]][_0xb1ee('0x62')])){utils[_0xb1ee('0xd')](util[_0xb1ee('0xe')](_0xb1ee('0x64'),_0x82a5ce[_0xb1ee('0x2')]),_0x82a5ce);queues[_0x82a5ce[_0xb1ee('0x2')]]['mohtime']+=utils['diffTime'](utils[_0xb1ee('0x12')](),queues[_0x82a5ce[_0xb1ee('0x2')]][_0xb1ee('0x62')]);utils[_0xb1ee('0x1')](util[_0xb1ee('0xe')](_0xb1ee('0x65'),_0x82a5ce[_0xb1ee('0x2')],queues[_0x82a5ce[_0xb1ee('0x2')]][_0xb1ee('0x1b')],queues[_0x82a5ce[_0xb1ee('0x2')]][_0xb1ee('0x66')]));delete queues[_0x82a5ce[_0xb1ee('0x2')]][_0xb1ee('0x62')];}}}catch(_0x599e42){utils[_0xb1ee('0x13')](util['format'](_0xb1ee('0x64'),_0x82a5ce['uniqueid']),_0x599e42);}};
\ No newline at end of file
index 02b2858..1fd7933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4255=['getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereruniqueid','lodash','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode'];(function(_0x56500a,_0x5953c7){var _0x333977=function(_0x374007){while(--_0x374007){_0x56500a['push'](_0x56500a['shift']());}};_0x333977(++_0x5953c7);}(_0x4255,0x1e8));var _0x5425=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x4255[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0x5425('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x5425('0x1'));var recordings={};function writeDB(_0x3b0fc6){var _0x2e1756;utils[_0x5425('0x2')](util[_0x5425('0x3')](_0x5425('0x4'),_0x3b0fc6['uniqueid']));if(transfers['blinds'][_0x3b0fc6['uniqueid']]){_0x2e1756=_0x3b0fc6[_0x5425('0x5')];_0x3b0fc6[_0x5425('0x5')]=transfers[_0x5425('0x6')][_0x3b0fc6[_0x5425('0x5')]][_0x5425('0x7')];}if(_0x3b0fc6[_0x5425('0x8')]){utils[_0x5425('0x9')](_0x3b0fc6[_0x5425('0x8')])[_0x5425('0xa')](function(_0x3932f0){if(_0x3932f0){_0x3b0fc6[_0x5425('0xb')]=_0x3932f0[_0x5425('0xc')];_0x3b0fc6[_0x5425('0xd')]=_0x3932f0['id'];}utils[_0x5425('0xe')](_0x5425('0xf'),_0x3b0fc6);});}else{utils[_0x5425('0xe')](_0x5425('0xf'),_0x3b0fc6);}if(_0x2e1756)delete transfers[_0x5425('0x6')][_0x2e1756];}exports[_0x5425('0x10')]=function(_0x32dae6){try{utils[_0x5425('0x11')](util[_0x5425('0x3')](_0x5425('0x12'),_0x32dae6[_0x5425('0x5')]),_0x32dae6);if(_0x32dae6[_0x5425('0x5')]==_0x32dae6[_0x5425('0x13')]){utils[_0x5425('0x2')](util[_0x5425('0x3')](_0x5425('0x14'),_0x32dae6[_0x5425('0x5')],_0x32dae6[_0x5425('0x15')],_0x32dae6[_0x5425('0x16')]));recordings[_0x32dae6[_0x5425('0x5')]]={'uniqueid':_0x32dae6[_0x5425('0x5')],'accountcode':_0x32dae6[_0x5425('0x8')],'exten':_0x32dae6[_0x5425('0x16')],'context':_0x32dae6[_0x5425('0x15')],'channel':_0x32dae6[_0x5425('0x17')],'monitors':[]};}}catch(_0x10da25){utils[_0x5425('0x18')](util['format'](_0x5425('0x12'),_0x32dae6[_0x5425('0x5')]),_0x10da25);}};exports[_0x5425('0x19')]=function(_0xad30a1){try{utils['debug'](util[_0x5425('0x3')](_0x5425('0x1a'),_0xad30a1['uniqueid']),_0xad30a1);if(!_['isNil'](recordings[_0xad30a1[_0x5425('0x5')]])&&_0xad30a1['channelstate']==0x6){utils[_0x5425('0x2')](util[_0x5425('0x3')](_0x5425('0x1b'),_0xad30a1[_0x5425('0x5')],_0xad30a1[_0x5425('0x15')],_0xad30a1['channel']));}else if(!_[_0x5425('0x1c')](recordings[_0xad30a1[_0x5425('0x13')]])&&_0xad30a1[_0x5425('0x1d')]==0x6&&_0xad30a1[_0x5425('0x15')]!=_0x5425('0x1e')){utils[_0x5425('0x2')](util[_0x5425('0x3')](_0x5425('0x1f'),_0xad30a1[_0x5425('0x5')],_0xad30a1[_0x5425('0x13')],_0xad30a1['context'],_0xad30a1[_0x5425('0x17')]));recordings[_0xad30a1['linkedid']][_0x5425('0x8')]=_0xad30a1['accountcode'];}}catch(_0x3a2723){utils[_0x5425('0x18')](util[_0x5425('0x3')](_0x5425('0x1a'),_0xad30a1['uniqueid']),_0x3a2723);}};exports['varset']=function(_0x27287c){try{if(!_[_0x5425('0x1c')](_0x27287c[_0x5425('0x20')])&&!_[_0x5425('0x1c')](_0x27287c[_0x5425('0x20')]['mixmonitor_filename'])){utils[_0x5425('0x11')](util[_0x5425('0x3')](_0x5425('0x21'),_0x27287c[_0x5425('0x5')]),_0x27287c);utils[_0x5425('0x2')](util[_0x5425('0x3')](_0x5425('0x22'),_0x27287c[_0x5425('0x5')],_0x27287c[_0x5425('0x20')],_0x27287c['value']));if(_[_0x5425('0x23')](_0x27287c[_0x5425('0x24')],'.wav49')){_0x27287c['value']=_0x27287c['value'][_0x5425('0x25')](_0x5425('0x26'),_0x5425('0x27'));}if(recordings[_0x27287c[_0x5425('0x13')]]){var _0x51661a=_[_0x5425('0x28')](recordings[_0x27287c[_0x5425('0x13')]]['monitors'],{'value':_0x27287c[_0x5425('0x24')]});if(_[_0x5425('0x1c')](_0x51661a)){recordings[_0x27287c[_0x5425('0x13')]][_0x5425('0x29')][_0x5425('0x2a')]({'value':_0x27287c[_0x5425('0x24')]});}}}}catch(_0x10f460){utils[_0x5425('0x18')](util['format']('[%s][recordings][varset]',_0x27287c['uniqueid']),_0x10f460);}};exports[_0x5425('0x2b')]=function(_0x52754f){try{if(!_[_0x5425('0x1c')](recordings[_0x52754f[_0x5425('0x5')]])){utils['debug'](util[_0x5425('0x3')](_0x5425('0x2c'),_0x52754f[_0x5425('0x5')]),_0x52754f);utils[_0x5425('0x2')](util[_0x5425('0x3')](_0x5425('0x2d'),_0x52754f[_0x5425('0x5')],_0x52754f[_0x5425('0x2e')],_0x52754f[_0x5425('0x2f')],_0x52754f[_0x5425('0x30')]));recordings[_0x52754f[_0x5425('0x5')]][_0x5425('0x2e')]=_0x52754f[_0x5425('0x2e')];recordings[_0x52754f['uniqueid']]['calleridname']=_0x52754f[_0x5425('0x2f')];recordings[_0x52754f[_0x5425('0x5')]][_0x5425('0x31')]=_0x52754f[_0x5425('0x31')];recordings[_0x52754f[_0x5425('0x5')]]['connectedlinename']=_0x52754f[_0x5425('0x32')];if(recordings[_0x52754f[_0x5425('0x5')]]['type']==_0x5425('0x33')&&recordings[_0x52754f[_0x5425('0x5')]][_0x5425('0x8')]){recordings[_0x52754f[_0x5425('0x5')]]['connectedlinenum']=recordings[_0x52754f[_0x5425('0x5')]][_0x5425('0x8')];recordings[_0x52754f['uniqueid']]['connectedlinename']='';}recordings[_0x52754f[_0x5425('0x5')]][_0x5425('0x29')][_0x5425('0x34')](function(_0x5546e8){var _0x326df8=_[_0x5425('0x35')](recordings[_0x52754f['uniqueid']]);_0x326df8['value']=_0x5546e8[_0x5425('0x24')];writeDB(_0x326df8);});delete recordings[_0x52754f[_0x5425('0x5')]];}}catch(_0x4dbbdc){utils[_0x5425('0x18')](util[_0x5425('0x3')](_0x5425('0x2c'),_0x52754f[_0x5425('0x5')]),_0x4dbbdc);}};exports[_0x5425('0x36')]=function(_0x592c86){try{if(!_[_0x5425('0x1c')](recordings[_0x592c86[_0x5425('0x5')]])){utils['debug'](util[_0x5425('0x3')](_0x5425('0x37'),_0x592c86[_0x5425('0x5')]),_0x592c86);utils['info'](util[_0x5425('0x3')](_0x5425('0x38'),_0x592c86[_0x5425('0x5')],_0x592c86[_0x5425('0x39')],_0x592c86[_0x5425('0x3a')]));if(_0x592c86[_0x5425('0x39')][_0x5425('0x3b')]()==_0x5425('0x3c')&&_[_0x5425('0x3d')](_0x592c86[_0x5425('0x3a')][_0x5425('0x3b')](),_0x5425('0x3e'))){var _0x20c51c=_0x592c86[_0x5425('0x3a')][_0x5425('0x3f')]('=');var _0x2ffdc1=_0x20c51c[0x0]['substring'](_0x20c51c[0x0]['lastIndexOf']('(')+0x1,_0x20c51c[0x0]['lastIndexOf'](')'));var _0x27f45f=_0x20c51c[0x1];recordings[_0x592c86[_0x5425('0x5')]][_0x2ffdc1]=_0x27f45f;}}}catch(_0x1b7818){utils[_0x5425('0x18')](util[_0x5425('0x3')](_0x5425('0x37'),_0x592c86[_0x5425('0x5')]),_0x1b7818);}};exports['queuecallerjoin']=function(_0x2306ab){try{if(!_['isNil'](recordings[_0x2306ab['uniqueid']])){utils['debug'](util['format']('[%s][recordings][queuecallerjoin]',_0x2306ab[_0x5425('0x5')]),_0x2306ab);utils[_0x5425('0x2')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x2306ab[_0x5425('0x5')],_0x2306ab[_0x5425('0x40')]));recordings[_0x2306ab[_0x5425('0x5')]][_0x5425('0x40')]=_0x2306ab[_0x5425('0x40')];}}catch(_0x502067){utils[_0x5425('0x18')](util[_0x5425('0x3')](_0x5425('0x41'),_0x2306ab[_0x5425('0x5')]),_0x502067);}};exports[_0x5425('0x42')]=function(_0x2a272f){try{utils[_0x5425('0x11')](util['format'](_0x5425('0x43'),_0x2a272f[_0x5425('0x5')]),_0x2a272f);utils[_0x5425('0x2')](util[_0x5425('0x3')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2a272f[_0x5425('0x5')],_0x2a272f[_0x5425('0x44')],_0x2a272f[_0x5425('0x45')],_0x2a272f['transfereecalleridnum'],_0x2a272f['transfereecalleridname']));if(recordings[_0x2a272f[_0x5425('0x46')]]&&transfers['blinds'][_0x2a272f[_0x5425('0x46')]]){transfers[_0x5425('0x6')][_0x2a272f[_0x5425('0x46')]]['recording']=!![];}}catch(_0x117e6e){utils['error'](util['format']('[%s][recordings][blindtransfer]',_0x2a272f[_0x5425('0x5')]),_0x117e6e);}};
\ No newline at end of file
+var _0xb2e5=['[%s][recordings][newchannel]','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./transfers.controller','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug'];(function(_0x3b4fa9,_0x407ce7){var _0xa85627=function(_0x2a814a){while(--_0x2a814a){_0x3b4fa9['push'](_0x3b4fa9['shift']());}};_0xa85627(++_0x407ce7);}(_0xb2e5,0x1a6));var _0x5b2e=function(_0x12a728,_0x58a302){_0x12a728=_0x12a728-0x0;var _0x3726fa=_0xb2e5[_0x12a728];return _0x3726fa;};'use strict';var _=require(_0x5b2e('0x0'));var util=require(_0x5b2e('0x1'));var utils=require('./utils');var transfers=require(_0x5b2e('0x2'));var recordings={};function writeDB(_0x2a58a9){var _0x2a745a;utils[_0x5b2e('0x3')](util[_0x5b2e('0x4')]('[%s][recordings][writeDB]',_0x2a58a9[_0x5b2e('0x5')]));if(transfers[_0x5b2e('0x6')][_0x2a58a9[_0x5b2e('0x5')]]){_0x2a745a=_0x2a58a9['uniqueid'];_0x2a58a9[_0x5b2e('0x5')]=transfers[_0x5b2e('0x6')][_0x2a58a9['uniqueid']][_0x5b2e('0x7')];}if(_0x2a58a9[_0x5b2e('0x8')]){utils['getUserByInternal'](_0x2a58a9[_0x5b2e('0x8')])['then'](function(_0x1ecc17){if(_0x1ecc17){_0x2a58a9[_0x5b2e('0x9')]=_0x1ecc17[_0x5b2e('0xa')];_0x2a58a9[_0x5b2e('0xb')]=_0x1ecc17['id'];}utils[_0x5b2e('0xc')](_0x5b2e('0xd'),_0x2a58a9);});}else{utils[_0x5b2e('0xc')](_0x5b2e('0xd'),_0x2a58a9);}if(_0x2a745a)delete transfers[_0x5b2e('0x6')][_0x2a745a];}exports[_0x5b2e('0xe')]=function(_0x57b62a){try{utils[_0x5b2e('0xf')](util[_0x5b2e('0x4')](_0x5b2e('0x10'),_0x57b62a[_0x5b2e('0x5')]),_0x57b62a);if(_0x57b62a[_0x5b2e('0x5')]==_0x57b62a['linkedid']){utils[_0x5b2e('0x3')](util[_0x5b2e('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x57b62a[_0x5b2e('0x5')],_0x57b62a[_0x5b2e('0x11')],_0x57b62a[_0x5b2e('0x12')]));recordings[_0x57b62a[_0x5b2e('0x5')]]={'uniqueid':_0x57b62a[_0x5b2e('0x5')],'accountcode':_0x57b62a[_0x5b2e('0x8')],'exten':_0x57b62a[_0x5b2e('0x12')],'context':_0x57b62a[_0x5b2e('0x11')],'channel':_0x57b62a[_0x5b2e('0x13')],'monitors':[]};}}catch(_0x1a48fe){utils[_0x5b2e('0x14')](util[_0x5b2e('0x4')]('[%s][recordings][newchannel]',_0x57b62a['uniqueid']),_0x1a48fe);}};exports[_0x5b2e('0x15')]=function(_0x5811ee){try{utils[_0x5b2e('0xf')](util[_0x5b2e('0x4')](_0x5b2e('0x16'),_0x5811ee[_0x5b2e('0x5')]),_0x5811ee);if(!_[_0x5b2e('0x17')](recordings[_0x5811ee[_0x5b2e('0x5')]])&&_0x5811ee[_0x5b2e('0x18')]==0x6){utils[_0x5b2e('0x3')](util[_0x5b2e('0x4')](_0x5b2e('0x19'),_0x5811ee[_0x5b2e('0x5')],_0x5811ee[_0x5b2e('0x11')],_0x5811ee[_0x5b2e('0x13')]));}else if(!_['isNil'](recordings[_0x5811ee['linkedid']])&&_0x5811ee[_0x5b2e('0x18')]==0x6&&_0x5811ee[_0x5b2e('0x11')]!='transfer'){utils[_0x5b2e('0x3')](util[_0x5b2e('0x4')](_0x5b2e('0x1a'),_0x5811ee[_0x5b2e('0x5')],_0x5811ee['linkedid'],_0x5811ee[_0x5b2e('0x11')],_0x5811ee[_0x5b2e('0x13')]));recordings[_0x5811ee[_0x5b2e('0x1b')]]['accountcode']=_0x5811ee[_0x5b2e('0x8')];}}catch(_0x29b2c4){utils[_0x5b2e('0x14')](util[_0x5b2e('0x4')](_0x5b2e('0x16'),_0x5811ee[_0x5b2e('0x5')]),_0x29b2c4);}};exports[_0x5b2e('0x1c')]=function(_0x27fd8c){try{if(!_[_0x5b2e('0x17')](_0x27fd8c[_0x5b2e('0x1d')])&&!_['isNil'](_0x27fd8c['variable'][_0x5b2e('0x1e')])){utils['debug'](util[_0x5b2e('0x4')](_0x5b2e('0x1f'),_0x27fd8c[_0x5b2e('0x5')]),_0x27fd8c);utils['info'](util[_0x5b2e('0x4')](_0x5b2e('0x20'),_0x27fd8c[_0x5b2e('0x5')],_0x27fd8c[_0x5b2e('0x1d')],_0x27fd8c['value']));if(_[_0x5b2e('0x21')](_0x27fd8c[_0x5b2e('0x22')],_0x5b2e('0x23'))){_0x27fd8c[_0x5b2e('0x22')]=_0x27fd8c[_0x5b2e('0x22')][_0x5b2e('0x24')](_0x5b2e('0x23'),'.WAV');}if(recordings[_0x27fd8c['linkedid']]){var _0xd1ddf5=_[_0x5b2e('0x25')](recordings[_0x27fd8c[_0x5b2e('0x1b')]][_0x5b2e('0x26')],{'value':_0x27fd8c[_0x5b2e('0x22')]});if(_[_0x5b2e('0x17')](_0xd1ddf5)){recordings[_0x27fd8c[_0x5b2e('0x1b')]][_0x5b2e('0x26')][_0x5b2e('0x27')]({'value':_0x27fd8c[_0x5b2e('0x22')]});}}}}catch(_0x331b67){utils[_0x5b2e('0x14')](util[_0x5b2e('0x4')](_0x5b2e('0x1f'),_0x27fd8c[_0x5b2e('0x5')]),_0x331b67);}};exports[_0x5b2e('0x28')]=function(_0x36a3bf){try{if(!_['isNil'](recordings[_0x36a3bf[_0x5b2e('0x5')]])){utils[_0x5b2e('0xf')](util[_0x5b2e('0x4')](_0x5b2e('0x29'),_0x36a3bf['uniqueid']),_0x36a3bf);utils[_0x5b2e('0x3')](util[_0x5b2e('0x4')](_0x5b2e('0x2a'),_0x36a3bf[_0x5b2e('0x5')],_0x36a3bf[_0x5b2e('0x2b')],_0x36a3bf[_0x5b2e('0x2c')],_0x36a3bf[_0x5b2e('0x2d')]));recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x2b')]=_0x36a3bf[_0x5b2e('0x2b')];recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x2c')]=_0x36a3bf['calleridname'];recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x2e')]=_0x36a3bf[_0x5b2e('0x2e')];recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x2f')]=_0x36a3bf[_0x5b2e('0x2f')];if(recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x30')]==_0x5b2e('0x31')&&recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x8')]){recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x2e')]=recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x8')];recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x2f')]='';}recordings[_0x36a3bf[_0x5b2e('0x5')]][_0x5b2e('0x26')]['forEach'](function(_0x2ebe06){var _0x4b6514=_[_0x5b2e('0x32')](recordings[_0x36a3bf['uniqueid']]);_0x4b6514[_0x5b2e('0x22')]=_0x2ebe06['value'];writeDB(_0x4b6514);});delete recordings[_0x36a3bf['uniqueid']];}}catch(_0x48c93f){utils[_0x5b2e('0x14')](util[_0x5b2e('0x4')](_0x5b2e('0x29'),_0x36a3bf[_0x5b2e('0x5')]),_0x48c93f);}};exports['newexten']=function(_0x2da9c7){try{if(!_['isNil'](recordings[_0x2da9c7[_0x5b2e('0x5')]])){utils['debug'](util[_0x5b2e('0x4')](_0x5b2e('0x33'),_0x2da9c7[_0x5b2e('0x5')]),_0x2da9c7);utils['info'](util[_0x5b2e('0x4')](_0x5b2e('0x34'),_0x2da9c7['uniqueid'],_0x2da9c7[_0x5b2e('0x35')],_0x2da9c7[_0x5b2e('0x36')]));if(_0x2da9c7[_0x5b2e('0x35')][_0x5b2e('0x37')]()=='set'&&_[_0x5b2e('0x38')](_0x2da9c7[_0x5b2e('0x36')][_0x5b2e('0x37')](),'cdr')){var _0x238083=_0x2da9c7[_0x5b2e('0x36')][_0x5b2e('0x39')]('=');var _0x5f2538=_0x238083[0x0][_0x5b2e('0x3a')](_0x238083[0x0]['lastIndexOf']('(')+0x1,_0x238083[0x0][_0x5b2e('0x3b')](')'));var _0x1e4d53=_0x238083[0x1];recordings[_0x2da9c7[_0x5b2e('0x5')]][_0x5f2538]=_0x1e4d53;}}}catch(_0x42c506){utils['error'](util[_0x5b2e('0x4')](_0x5b2e('0x33'),_0x2da9c7[_0x5b2e('0x5')]),_0x42c506);}};exports[_0x5b2e('0x3c')]=function(_0x16aa31){try{if(!_['isNil'](recordings[_0x16aa31[_0x5b2e('0x5')]])){utils[_0x5b2e('0xf')](util['format'](_0x5b2e('0x3d'),_0x16aa31['uniqueid']),_0x16aa31);utils[_0x5b2e('0x3')](util['format'](_0x5b2e('0x3e'),_0x16aa31[_0x5b2e('0x5')],_0x16aa31[_0x5b2e('0x3f')]));recordings[_0x16aa31[_0x5b2e('0x5')]][_0x5b2e('0x3f')]=_0x16aa31[_0x5b2e('0x3f')];}}catch(_0x227f02){utils[_0x5b2e('0x14')](util[_0x5b2e('0x4')](_0x5b2e('0x3d'),_0x16aa31[_0x5b2e('0x5')]),_0x227f02);}};exports[_0x5b2e('0x40')]=function(_0x3ca025){try{utils[_0x5b2e('0xf')](util[_0x5b2e('0x4')](_0x5b2e('0x41'),_0x3ca025[_0x5b2e('0x5')]),_0x3ca025);utils[_0x5b2e('0x3')](util[_0x5b2e('0x4')](_0x5b2e('0x42'),_0x3ca025[_0x5b2e('0x5')],_0x3ca025[_0x5b2e('0x43')],_0x3ca025[_0x5b2e('0x44')],_0x3ca025[_0x5b2e('0x45')],_0x3ca025[_0x5b2e('0x46')]));if(recordings[_0x3ca025[_0x5b2e('0x47')]]&&transfers[_0x5b2e('0x6')][_0x3ca025[_0x5b2e('0x47')]]){transfers[_0x5b2e('0x6')][_0x3ca025[_0x5b2e('0x47')]][_0x5b2e('0x48')]=!![];}}catch(_0x16586a){utils['error'](util[_0x5b2e('0x4')](_0x5b2e('0x41'),_0x3ca025[_0x5b2e('0x5')]),_0x16586a);}};
\ No newline at end of file
index cfb8550..c083bf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b83=['transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetcalleridname'];(function(_0x177704,_0xf2c51a){var _0x1cc175=function(_0x141c62){while(--_0x141c62){_0x177704['push'](_0x177704['shift']());}};_0x1cc175(++_0xf2c51a);}(_0x9b83,0xcc));var _0x39b8=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x9b83[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var utils=require(_0x39b8('0x2'));function writeDB(_0x2b3ad8){utils[_0x39b8('0x3')](util[_0x39b8('0x4')](_0x39b8('0x5'),_0x2b3ad8[_0x39b8('0x6')]===_0x39b8('0x7')?_0x2b3ad8[_0x39b8('0x8')]:_0x2b3ad8[_0x39b8('0x9')],_0x2b3ad8[_0x39b8('0x6')]));utils[_0x39b8('0xa')](_0x39b8('0xb'),_0x2b3ad8);}exports['blinds']={};exports['blindtransfer']=function(_0x2245f6){try{utils[_0x39b8('0xc')](util[_0x39b8('0x4')](_0x39b8('0xd'),_0x2245f6[_0x39b8('0x9')]),_0x2245f6);utils['info'](util[_0x39b8('0x4')](_0x39b8('0xe'),_0x2245f6[_0x39b8('0x9')],_0x2245f6[_0x39b8('0xf')],_0x2245f6['transferercalleridname'],_0x2245f6['transfereecalleridnum'],_0x2245f6[_0x39b8('0x10')]));_0x2245f6[_0x39b8('0x6')]=_0x39b8('0x11');exports[_0x39b8('0x12')][_0x2245f6[_0x39b8('0x13')]]=_0x2245f6;writeDB(_0x2245f6);}catch(_0x926dc5){utils[_0x39b8('0x14')](util[_0x39b8('0x4')](_0x39b8('0xd'),_0x2245f6[_0x39b8('0x9')]),_0x926dc5);}};exports[_0x39b8('0x15')]=function(_0x56d217){try{utils[_0x39b8('0xc')](util[_0x39b8('0x4')](_0x39b8('0x16'),_0x56d217[_0x39b8('0x8')]),_0x56d217);utils[_0x39b8('0x3')](util['format'](_0x39b8('0x17'),_0x56d217[_0x39b8('0x8')],_0x56d217[_0x39b8('0x18')],_0x56d217['origtransferercalleridname'],_0x56d217[_0x39b8('0x19')],_0x56d217['transfertargetcalleridname']));_0x56d217=_[_0x39b8('0x1a')](_0x56d217,{'transfererchannel':_0x56d217[_0x39b8('0x1b')],'transferercalleridnum':_0x56d217['origtransferercalleridnum'],'transferercalleridname':_0x56d217['origtransferercalleridname'],'transfererconnectedlinenum':_0x56d217['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x56d217[_0x39b8('0x1c')],'transfereraccountcode':_0x56d217['origtransfereraccountcode'],'transferercontext':_0x56d217[_0x39b8('0x1d')],'transfererexten':_0x56d217[_0x39b8('0x1e')],'transfererlinkedid':_0x56d217[_0x39b8('0x1f')],'context':_0x56d217['origtransferercontext'],'extension':_0x56d217[_0x39b8('0x20')],'type':'attended'});if(_[_0x39b8('0x21')](_0x56d217[_0x39b8('0x22')])){_0x56d217=_['assign'](_0x56d217,{'transfereechannel':_0x56d217['transfertargetchannel'],'transfereecalleridnum':_0x56d217[_0x39b8('0x19')],'transfereecalleridname':_0x56d217[_0x39b8('0x23')],'transfereeconnectedlinenum':_0x56d217[_0x39b8('0x24')],'transfereeconnectedlinename':_0x56d217['transfertargetconnectedlinename'],'transfereeaccountcode':_0x56d217[_0x39b8('0x25')],'transfereecontext':_0x56d217[_0x39b8('0x26')],'transfereeexten':_0x56d217[_0x39b8('0x27')],'transfereelinkedid':_0x56d217['transfertargetlinkedid']});}writeDB(_0x56d217);}catch(_0x4ad93d){utils[_0x39b8('0x14')](util[_0x39b8('0x4')](_0x39b8('0x16'),_0x56d217[_0x39b8('0x8')]),_0x4ad93d);}};
\ No newline at end of file
+var _0x8b1d=['info','format','type','attended','origtransfereruniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0x8b1d,0x9e));var _0xd8b1=function(_0x283693,_0x3bfd4f){_0x283693=_0x283693-0x0;var _0x14bc96=_0x8b1d[_0x283693];return _0x14bc96;};'use strict';var _=require(_0xd8b1('0x0'));var util=require(_0xd8b1('0x1'));var utils=require('./utils');function writeDB(_0x25b53d){utils[_0xd8b1('0x2')](util[_0xd8b1('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x25b53d[_0xd8b1('0x4')]===_0xd8b1('0x5')?_0x25b53d[_0xd8b1('0x6')]:_0x25b53d['uniqueid'],_0x25b53d['type']));utils[_0xd8b1('0x7')]('CreateVoiceTransferReport',_0x25b53d);}exports[_0xd8b1('0x8')]={};exports[_0xd8b1('0x9')]=function(_0x2e0376){try{utils[_0xd8b1('0xa')](util[_0xd8b1('0x3')](_0xd8b1('0xb'),_0x2e0376[_0xd8b1('0xc')]),_0x2e0376);utils[_0xd8b1('0x2')](util['format'](_0xd8b1('0xd'),_0x2e0376['uniqueid'],_0x2e0376[_0xd8b1('0xe')],_0x2e0376['transferercalleridname'],_0x2e0376[_0xd8b1('0xf')],_0x2e0376[_0xd8b1('0x10')]));_0x2e0376[_0xd8b1('0x4')]='blind';exports[_0xd8b1('0x8')][_0x2e0376[_0xd8b1('0x11')]]=_0x2e0376;writeDB(_0x2e0376);}catch(_0x9e5e7d){utils[_0xd8b1('0x12')](util[_0xd8b1('0x3')](_0xd8b1('0xb'),_0x2e0376['uniqueid']),_0x9e5e7d);}};exports['attendedtransfer']=function(_0x4a96b2){try{utils[_0xd8b1('0xa')](util[_0xd8b1('0x3')](_0xd8b1('0x13'),_0x4a96b2[_0xd8b1('0x6')]),_0x4a96b2);utils[_0xd8b1('0x2')](util[_0xd8b1('0x3')](_0xd8b1('0x14'),_0x4a96b2['origtransfereruniqueid'],_0x4a96b2[_0xd8b1('0x15')],_0x4a96b2[_0xd8b1('0x16')],_0x4a96b2[_0xd8b1('0x17')],_0x4a96b2[_0xd8b1('0x18')]));_0x4a96b2=_['assign'](_0x4a96b2,{'transfererchannel':_0x4a96b2[_0xd8b1('0x19')],'transferercalleridnum':_0x4a96b2['origtransferercalleridnum'],'transferercalleridname':_0x4a96b2['origtransferercalleridname'],'transfererconnectedlinenum':_0x4a96b2[_0xd8b1('0x1a')],'transfererconnectedlinename':_0x4a96b2[_0xd8b1('0x1b')],'transfereraccountcode':_0x4a96b2[_0xd8b1('0x1c')],'transferercontext':_0x4a96b2['secondtransferercontext'],'transfererexten':_0x4a96b2[_0xd8b1('0x1d')],'transfererlinkedid':_0x4a96b2[_0xd8b1('0x1e')],'context':_0x4a96b2[_0xd8b1('0x1f')],'extension':_0x4a96b2['origtransfererexten'],'type':_0xd8b1('0x5')});if(_[_0xd8b1('0x20')](_0x4a96b2['transfereechannel'])){_0x4a96b2=_[_0xd8b1('0x21')](_0x4a96b2,{'transfereechannel':_0x4a96b2[_0xd8b1('0x22')],'transfereecalleridnum':_0x4a96b2[_0xd8b1('0x17')],'transfereecalleridname':_0x4a96b2['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4a96b2[_0xd8b1('0x23')],'transfereeconnectedlinename':_0x4a96b2[_0xd8b1('0x24')],'transfereeaccountcode':_0x4a96b2[_0xd8b1('0x25')],'transfereecontext':_0x4a96b2[_0xd8b1('0x26')],'transfereeexten':_0x4a96b2[_0xd8b1('0x27')],'transfereelinkedid':_0x4a96b2['transfertargetlinkedid']});}writeDB(_0x4a96b2);}catch(_0xc751ff){utils['error'](util[_0xd8b1('0x3')]('[%s][transfers][attendedtransfer]',_0x4a96b2[_0xd8b1('0x6')]),_0xc751ff);}};
\ No newline at end of file
index b2d41ab..f4c2fc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb5f=['getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','subtractTime','subtract','diffTime','diff','sumTime','now','format','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','internal','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdb5f,0x1d0));var _0xfdb5=function(_0x52195d,_0x52e4fd){_0x52195d=_0x52195d-0x0;var _0x522e83=_0xdb5f[_0x52195d];return _0x522e83;};'use strict';var BPromise=require(_0xfdb5('0x0'));var jayson=require(_0xfdb5('0x1'));var moment=require(_0xfdb5('0x2'));var util=require('util');var client=jayson[_0xfdb5('0x3')][_0xfdb5('0x4')]({'port':0x2329});var logger=require(_0xfdb5('0x5'))('xdr');exports[_0xfdb5('0x6')]=function(_0xfd7340,_0x560264){logger[_0xfdb5('0x6')](_0xfd7340,_0x560264?util['inspect'](_0x560264,{'showHidden':![],'depth':null}):'');};exports[_0xfdb5('0x7')]=function(_0x525fd0,_0x19b091){logger[_0xfdb5('0x7')](_0x525fd0,_0x19b091?util[_0xfdb5('0x8')](_0x19b091,{'showHidden':![],'depth':null}):'');};exports[_0xfdb5('0x9')]=function(_0x59859a,_0x49f16b){logger[_0xfdb5('0x9')](_0x59859a,_0x49f16b?util[_0xfdb5('0x8')](_0x49f16b,{'showHidden':![],'depth':null}):'');};exports[_0xfdb5('0xa')]=function(_0x1378e6,_0x34bc1a){return client['request'](_0x1378e6,{'body':_0x34bc1a})[_0xfdb5('0xb')](function(_0x3a37f7){logger[_0xfdb5('0x7')](_0xfdb5('0xc'),_0x1378e6,_0x3a37f7?util['inspect'](_0x3a37f7,{'showHidden':![],'depth':null}):'');})[_0xfdb5('0xd')](function(_0x301c51){logger[_0xfdb5('0x9')]('[utils][request]\x20name:%s',_0x1378e6,_0x301c51?util['inspect'](_0x301c51,{'showHidden':![],'depth':null}):'');});};function getUser(_0x53c02b){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xfdb5('0xe'),'name','interface'],'where':_0x53c02b,'limit':0x1}})['then'](function(_0xca39eb){logger['debug'](_0xfdb5('0xf'),JSON[_0xfdb5('0x10')](_0x53c02b),_0xca39eb?util[_0xfdb5('0x8')](_0xca39eb,{'showHidden':![],'depth':null}):'');return _0xca39eb[_0xfdb5('0x11')][_0xfdb5('0x12')]?_0xca39eb['result'][0x0]:null;});}exports[_0xfdb5('0x13')]=function(_0x1874b4){return new BPromise(function(_0x35d74c,_0x4f9969){if(_0x1874b4){return getUser({'internal':_0x1874b4})['then'](function(_0x28e8f9){logger[_0xfdb5('0x6')](_0xfdb5('0x14'),_0x1874b4,_0x28e8f9?_0xfdb5('0x15'):'notfound');return _0x35d74c(_0x28e8f9);})['catch'](function(_0x99044c){logger['error'](_0xfdb5('0x16'),_0x99044c?util['inspect'](_0x99044c,{'showHidden':![],'depth':null}):'');return _0x35d74c(null);});}return _0x35d74c(null);});};exports[_0xfdb5('0x17')]=function(_0x4ed5c1){return new BPromise(function(_0x32856d,_0x453608){if(_0x4ed5c1){return getUser({'interface':_0x4ed5c1})[_0xfdb5('0xb')](function(_0x3c0013){logger[_0xfdb5('0x6')](_0xfdb5('0x18'),_0x4ed5c1,_0x3c0013?_0xfdb5('0x15'):'notfound');return _0x32856d(_0x3c0013);})[_0xfdb5('0xd')](function(_0x494792){logger[_0xfdb5('0x9')](_0xfdb5('0x19'),_0x494792?util[_0xfdb5('0x8')](_0x494792,{'showHidden':![],'depth':null}):'');return _0x32856d(null);});}return _0x32856d(null);});};exports[_0xfdb5('0x1a')]=function(_0x1c1c7e){return new BPromise(function(_0x93d8c4,_0x27136c){if(_0x1c1c7e){return getUser({'name':_0x1c1c7e})[_0xfdb5('0xb')](function(_0x4bd62b){logger[_0xfdb5('0x6')](_0xfdb5('0x1b'),_0x1c1c7e,_0x4bd62b?_0xfdb5('0x15'):_0xfdb5('0x1c'));return _0x93d8c4(_0x4bd62b);})[_0xfdb5('0xd')](function(_0x22d840){logger[_0xfdb5('0x9')](_0xfdb5('0x1d'),_0x22d840?util['inspect'](_0x22d840,{'showHidden':![],'depth':null}):'');return _0x93d8c4(null);});}return _0x93d8c4(null);});};exports[_0xfdb5('0x1e')]=function(_0x3f8fe0){return new BPromise(function(_0x11f1a1,_0x16f013){if(_0x3f8fe0){return client[_0xfdb5('0xa')](_0xfdb5('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0xfdb5('0x20'),_0xfdb5('0x21'),_0xfdb5('0x22')],'where':{'name':_0x3f8fe0},'limit':0x1}})[_0xfdb5('0xb')](function(_0x1e740a){logger[_0xfdb5('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x3f8fe0,_0x1e740a?util['inspect'](_0x1e740a,{'showHidden':![],'depth':null}):'');logger[_0xfdb5('0x6')](_0xfdb5('0x23'),_0x3f8fe0,_0x1e740a?_0xfdb5('0x15'):_0xfdb5('0x1c'));return _0x11f1a1(_0x1e740a['result'][_0xfdb5('0x12')]?_0x1e740a['result'][0x0]:null);})[_0xfdb5('0xd')](function(_0x3260d3){logger['error'](_0xfdb5('0x24'),_0x3260d3?util[_0xfdb5('0x8')](_0x3260d3,{'showHidden':![],'depth':null}):'');return _0x11f1a1(null);});}return _0x11f1a1(null);});};exports[_0xfdb5('0x25')]=function(_0xea752a,_0x695e4b){return moment(_0xea752a)[_0xfdb5('0x26')](_0x695e4b,_0xfdb5('0x27'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xfdb5('0x28')]=function(_0x712b5d,_0xe74e62){return moment(_0x712b5d)[_0xfdb5('0x29')](_0xe74e62,_0xfdb5('0x27'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xfdb5('0x2a')]=function(_0x3ca81e,_0x203d3d){return moment(_0x3ca81e)[_0xfdb5('0x2b')](moment(_0x203d3d),_0xfdb5('0x27'));};exports[_0xfdb5('0x2c')]=function(_0x278e84,_0x9ec16){return parseInt(_0x278e84,0xa)+parseInt(_0x9ec16,0xa);};exports[_0xfdb5('0x2d')]=function(){return moment()[_0xfdb5('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xfdb5('0x2f')]=function(_0x2b9f4f,_0x181ce2){if(_0x181ce2){return moment(_0x2b9f4f)['isAfter'](_0x181ce2);}return!![];};exports[_0xfdb5('0x30')]=function(_0x3d56b2,_0x59d5b7){if(_0x59d5b7){return moment(_0x3d56b2)['isBefore'](_0x59d5b7);}else if(_0x3d56b2){return!![];}return![];};
\ No newline at end of file
+var _0xc9b0=['error','request','catch','[utils][request]\x20name:%s','GetUser','internal','name','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','seconds','format','subtractTime','subtract','diffTime','diff','sumTime','now','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug'];(function(_0xa0d663,_0x4c9b80){var _0x982d6a=function(_0x5d1063){while(--_0x5d1063){_0xa0d663['push'](_0xa0d663['shift']());}};_0x982d6a(++_0x4c9b80);}(_0xc9b0,0x14c));var _0x0c9b=function(_0x30d29c,_0x47dd3a){_0x30d29c=_0x30d29c-0x0;var _0x3973cb=_0xc9b0[_0x30d29c];return _0x3973cb;};'use strict';var BPromise=require(_0x0c9b('0x0'));var jayson=require(_0x0c9b('0x1'));var moment=require(_0x0c9b('0x2'));var util=require(_0x0c9b('0x3'));var client=jayson[_0x0c9b('0x4')][_0x0c9b('0x5')]({'port':0x2329});var logger=require(_0x0c9b('0x6'))(_0x0c9b('0x7'));exports[_0x0c9b('0x8')]=function(_0x206641,_0x10bf09){logger['info'](_0x206641,_0x10bf09?util[_0x0c9b('0x9')](_0x10bf09,{'showHidden':![],'depth':null}):'');};exports[_0x0c9b('0xa')]=function(_0x623184,_0x343a12){logger[_0x0c9b('0xa')](_0x623184,_0x343a12?util[_0x0c9b('0x9')](_0x343a12,{'showHidden':![],'depth':null}):'');};exports[_0x0c9b('0xb')]=function(_0x3f9b7f,_0x1fa2e4){logger[_0x0c9b('0xb')](_0x3f9b7f,_0x1fa2e4?util[_0x0c9b('0x9')](_0x1fa2e4,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x489177,_0xe083d2){return client[_0x0c9b('0xc')](_0x489177,{'body':_0xe083d2})['then'](function(_0x34f2db){logger[_0x0c9b('0xa')]('[utils][request]\x20name:%s',_0x489177,_0x34f2db?util[_0x0c9b('0x9')](_0x34f2db,{'showHidden':![],'depth':null}):'');})[_0x0c9b('0xd')](function(_0x22c253){logger[_0x0c9b('0xb')](_0x0c9b('0xe'),_0x489177,_0x22c253?util['inspect'](_0x22c253,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1da456){return client['request'](_0x0c9b('0xf'),{'options':{'raw':!![],'attributes':['id',_0x0c9b('0x10'),_0x0c9b('0x11'),'interface'],'where':_0x1da456,'limit':0x1}})[_0x0c9b('0x12')](function(_0x4b36e5){logger[_0x0c9b('0xa')](_0x0c9b('0x13'),JSON[_0x0c9b('0x14')](_0x1da456),_0x4b36e5?util[_0x0c9b('0x9')](_0x4b36e5,{'showHidden':![],'depth':null}):'');return _0x4b36e5[_0x0c9b('0x15')][_0x0c9b('0x16')]?_0x4b36e5[_0x0c9b('0x15')][0x0]:null;});}exports[_0x0c9b('0x17')]=function(_0x54771f){return new BPromise(function(_0xb22111,_0x438337){if(_0x54771f){return getUser({'internal':_0x54771f})[_0x0c9b('0x12')](function(_0x2c2aeb){logger['info'](_0x0c9b('0x18'),_0x54771f,_0x2c2aeb?_0x0c9b('0x19'):_0x0c9b('0x1a'));return _0xb22111(_0x2c2aeb);})['catch'](function(_0x484e64){logger['error']('[utils][getUserByInternal]',_0x484e64?util[_0x0c9b('0x9')](_0x484e64,{'showHidden':![],'depth':null}):'');return _0xb22111(null);});}return _0xb22111(null);});};exports[_0x0c9b('0x1b')]=function(_0x1574b5){return new BPromise(function(_0xb3db26,_0x221fb5){if(_0x1574b5){return getUser({'interface':_0x1574b5})['then'](function(_0x3f7937){logger[_0x0c9b('0x8')](_0x0c9b('0x1c'),_0x1574b5,_0x3f7937?_0x0c9b('0x19'):'notfound');return _0xb3db26(_0x3f7937);})[_0x0c9b('0xd')](function(_0x4893b0){logger[_0x0c9b('0xb')](_0x0c9b('0x1d'),_0x4893b0?util[_0x0c9b('0x9')](_0x4893b0,{'showHidden':![],'depth':null}):'');return _0xb3db26(null);});}return _0xb3db26(null);});};exports[_0x0c9b('0x1e')]=function(_0x45d94e){return new BPromise(function(_0x23ac7a,_0x448ab5){if(_0x45d94e){return getUser({'name':_0x45d94e})[_0x0c9b('0x12')](function(_0x37fa90){logger[_0x0c9b('0x8')](_0x0c9b('0x1f'),_0x45d94e,_0x37fa90?_0x0c9b('0x19'):_0x0c9b('0x1a'));return _0x23ac7a(_0x37fa90);})['catch'](function(_0x3a7de5){logger['error'](_0x0c9b('0x20'),_0x3a7de5?util[_0x0c9b('0x9')](_0x3a7de5,{'showHidden':![],'depth':null}):'');return _0x23ac7a(null);});}return _0x23ac7a(null);});};exports[_0x0c9b('0x21')]=function(_0x424519){return new BPromise(function(_0x227ef,_0x11cbc5){if(_0x424519){return client[_0x0c9b('0xc')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x0c9b('0x11'),_0x0c9b('0x22'),'acw',_0x0c9b('0x23')],'where':{'name':_0x424519},'limit':0x1}})[_0x0c9b('0x12')](function(_0x3f1924){logger[_0x0c9b('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x424519,_0x3f1924?util['inspect'](_0x3f1924,{'showHidden':![],'depth':null}):'');logger[_0x0c9b('0x8')](_0x0c9b('0x24'),_0x424519,_0x3f1924?'found':_0x0c9b('0x1a'));return _0x227ef(_0x3f1924['result'][_0x0c9b('0x16')]?_0x3f1924[_0x0c9b('0x15')][0x0]:null);})[_0x0c9b('0xd')](function(_0x25e31e){logger[_0x0c9b('0xb')](_0x0c9b('0x25'),_0x25e31e?util[_0x0c9b('0x9')](_0x25e31e,{'showHidden':![],'depth':null}):'');return _0x227ef(null);});}return _0x227ef(null);});};exports['addTime']=function(_0x65e127,_0x5f1cbc){return moment(_0x65e127)['add'](_0x5f1cbc,_0x0c9b('0x26'))[_0x0c9b('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0c9b('0x28')]=function(_0x5f4021,_0x59f1a5){return moment(_0x5f4021)[_0x0c9b('0x29')](_0x59f1a5,_0x0c9b('0x26'))[_0x0c9b('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0c9b('0x2a')]=function(_0x440a60,_0x5e5459){return moment(_0x440a60)[_0x0c9b('0x2b')](moment(_0x5e5459),_0x0c9b('0x26'));};exports[_0x0c9b('0x2c')]=function(_0x56a709,_0x37508d){return parseInt(_0x56a709,0xa)+parseInt(_0x37508d,0xa);};exports[_0x0c9b('0x2d')]=function(){return moment()['format'](_0x0c9b('0x2e'));};exports[_0x0c9b('0x2f')]=function(_0x473db9,_0x54f70b){if(_0x54f70b){return moment(_0x473db9)['isAfter'](_0x54f70b);}return!![];};exports[_0x0c9b('0x30')]=function(_0x103e8e,_0x29b3dd){if(_0x29b3dd){return moment(_0x103e8e)[_0x0c9b('0x30')](_0x29b3dd);}else if(_0x103e8e){return!![];}return![];};
\ No newline at end of file
index 13bd6c9..147b6b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53af=['format','method','connection','role','other','agent_name','test','lodash','path','util','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','name','ensureDir','then','user','no-user','timestamp','catch','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53af,0x97));var _0xf53a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x53af[_0x19950b];return _0x3c6b41;};var fs=require('fs-extra');var _=require(_0xf53a('0x0'));var ewinston=require('express-winston');var path=require(_0xf53a('0x1'));var util=require(_0xf53a('0x2'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0xf53a('0x3'))[_0xf53a('0x4')];var maskSensitiveData=require(_0xf53a('0x5'))[_0xf53a('0x6')];function ClientSideLogger(){function _0x50677e(_0xf942db){var _0x6e5cb7=path[_0xf53a('0x7')](_0xf53a('0x8'),_0xf53a('0x9'),_0xf53a('0xa'));var _0x4e0d7f=path[_0xf53a('0x7')](_0xf53a('0xb'),_0xf942db['role']+'-'+_0xf942db[_0xf53a('0xc')]);return fs[_0xf53a('0xd')](path[_0xf53a('0x7')](_0x6e5cb7,_0x4e0d7f))[_0xf53a('0xe')](function(){var _0x19fff4=fileLogger(_0xf53a('0xb'),path[_0xf53a('0x7')](_0x6e5cb7,_0x4e0d7f));return _0x19fff4;})['catch'](function(_0x1617a8){throw _0x1617a8;});}this[_0xf53a('0x9')]=function(_0xef7ad9,_0x4ece95,_0x584ffe,_0x2df0b4){return _0x50677e(_0xef7ad9[_0xf53a('0xf')])[_0xf53a('0xe')](function(_0xbe0934){var _0x430b8d=_0xbe0934[_0x4ece95];return _0x430b8d;})[_0xf53a('0xe')](function(_0x5eaa02){var _0x599748=_0xef7ad9[_0xf53a('0xf')]?_0xef7ad9[_0xf53a('0xf')]['id']:_0xf53a('0x10');var _0x11cc1a=_0x2df0b4['data'];var _0x2fdaf2=_0x2df0b4[_0xf53a('0x11')];var _0x57ec56=new Date(Number(_0x2fdaf2));return _0x5eaa02(_0x599748,_0x57ec56,_0x584ffe,_0x11cc1a);})[_0xf53a('0x12')](function(_0x5dfc28){fileLogger('client')[_0xf53a('0x13')](_0x5dfc28);});};}function setupLoggers(_0x364583){return new Promise(function(_0x2df6da){var _0x463f4d=new ClientSideLogger();var _0x4f48f5=fileLogger(_0xf53a('0x14'));var _0x2cc916=fileLogger(_0xf53a('0x15'));_0x364583[_0xf53a('0x16')](_0xf53a('0x17'),_0x463f4d);_0x364583[_0xf53a('0x18')](ewinston[_0xf53a('0x19')]({'winstonInstance':_0x4f48f5,'meta':![],'statusLevels':!![],'msg':function(_0x3a6d12,_0x24f629){var _0xfc3051=_0xf53a('0x1a');if(!_[_0xf53a('0x1b')](_0x3a6d12[_0xf53a('0x1c')])){_0xfc3051+=_0xf53a('0x1d');var _0x490752=_0x3a6d12['body'];maskSensitiveData(_0x490752);}return safeTemplate(util['format'](_0xfc3051,_0x3a6d12['method'],_0x3a6d12[_0xf53a('0x1e')][_0xf53a('0x1f')]?_0x3a6d12[_0xf53a('0x1e')][_0xf53a('0x1f')]:_0x3a6d12['connection'][_0xf53a('0x20')]||_0x3a6d12['ip'],_0x3a6d12[_0xf53a('0x21')],_0x24f629[_0xf53a('0x22')],_0x24f629[_0xf53a('0x23')],_0x3a6d12[_0xf53a('0xf')]?_0x3a6d12[_0xf53a('0xf')]['id']:null,_0x3a6d12[_0xf53a('0xf')]?_0x3a6d12[_0xf53a('0xf')]['name']:null,_0x3a6d12['user']?_0x3a6d12[_0xf53a('0xf')]['role']:null,_0x490752?util[_0xf53a('0x24')](_0x490752,![],null):''));}}));_0x364583[_0xf53a('0x18')](ewinston[_0xf53a('0x19')]({'winstonInstance':_0x2cc916,'meta':![],'statusLevels':!![],'msg':function(_0x10271f,_0x947fa4){var _0x2564ac=_0xf53a('0x25');if(_0x10271f[_0xf53a('0x1c')]&&_0x10271f['body'][_0xf53a('0x26')]&&_0x10271f[_0xf53a('0x1c')][_0xf53a('0x27')]){_0x2564ac=_0xf53a('0x28');}return util[_0xf53a('0x29')](_0x2564ac,_0x10271f[_0xf53a('0x2a')],_0x10271f['headers'][_0xf53a('0x1f')]?_0x10271f[_0xf53a('0x1e')][_0xf53a('0x1f')]:_0x10271f[_0xf53a('0x2b')][_0xf53a('0x20')]||_0x10271f['ip'],_0x10271f['url'],_0x947fa4[_0xf53a('0x22')],_0x947fa4[_0xf53a('0x23')],_0x10271f[_0xf53a('0xf')]?_0x10271f['user']['id']:null,_0x10271f[_0xf53a('0xf')]?_0x10271f[_0xf53a('0xf')]['name']:null,_0x10271f[_0xf53a('0xf')]?_0x10271f[_0xf53a('0xf')][_0xf53a('0x2c')]:null,_0x10271f[_0xf53a('0x1c')]&&_0x10271f[_0xf53a('0x1c')]['device']?_0x10271f['body']['device']:_0xf53a('0x2d'),_0x10271f[_0xf53a('0x1c')]&&_0x10271f[_0xf53a('0x1c')]['agent_id']?_0x10271f[_0xf53a('0x1c')][_0xf53a('0x27')]:'',_0x10271f[_0xf53a('0x1c')]&&_0x10271f[_0xf53a('0x1c')]['agent_name']?_0x10271f[_0xf53a('0x1c')][_0xf53a('0x2e')]:'');},'ignoreRoute':function(_0x356237){var _0x582c89=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x582c89[_0xf53a('0x2f')](_0x356237[_0xf53a('0x21')]);}}));return _0x2df6da();});}exports['setupLoggers']=setupLoggers;
\ No newline at end of file
+var _0x83e1=['util','fileLogger','./safe-template','join','log','xcally','client','role','ensureDir','then','catch','user','no-user','error','client-side-logger','use','isEmpty','body','format','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','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','fs-extra','lodash','express-winston','path'];(function(_0x2e19d6,_0x3052af){var _0x2e6dda=function(_0x2ed220){while(--_0x2ed220){_0x2e19d6['push'](_0x2e19d6['shift']());}};_0x2e6dda(++_0x3052af);}(_0x83e1,0x94));var _0x183e=function(_0x3e2f2c,_0x3cdf76){_0x3e2f2c=_0x3e2f2c-0x0;var _0x12dbd5=_0x83e1[_0x3e2f2c];return _0x12dbd5;};var fs=require(_0x183e('0x0'));var _=require(_0x183e('0x1'));var ewinston=require(_0x183e('0x2'));var path=require(_0x183e('0x3'));var util=require(_0x183e('0x4'));var fileLogger=require('./loggers')[_0x183e('0x5')];var safeTemplate=require(_0x183e('0x6'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')['maskSensitiveData'];function ClientSideLogger(){function _0x5cb9e4(_0x4b8371){var _0x39126f=path[_0x183e('0x7')]('/var',_0x183e('0x8'),_0x183e('0x9'));var _0x55dbd1=path[_0x183e('0x7')](_0x183e('0xa'),_0x4b8371[_0x183e('0xb')]+'-'+_0x4b8371['name']);return fs[_0x183e('0xc')](path['join'](_0x39126f,_0x55dbd1))[_0x183e('0xd')](function(){var _0x2de347=fileLogger(_0x183e('0xa'),path[_0x183e('0x7')](_0x39126f,_0x55dbd1));return _0x2de347;})[_0x183e('0xe')](function(_0x5f4c38){throw _0x5f4c38;});}this[_0x183e('0x8')]=function(_0x35ce6f,_0x17e54c,_0x5f05ef,_0x57cb31){return _0x5cb9e4(_0x35ce6f[_0x183e('0xf')])['then'](function(_0x41cf02){var _0x1d67fc=_0x41cf02[_0x17e54c];return _0x1d67fc;})[_0x183e('0xd')](function(_0x5d5601){var _0x314435=_0x35ce6f[_0x183e('0xf')]?_0x35ce6f['user']['id']:_0x183e('0x10');var _0x4e8ca1=_0x57cb31['data'];var _0x1fbc53=_0x57cb31['timestamp'];var _0x52e3fa=new Date(Number(_0x1fbc53));return _0x5d5601(_0x314435,_0x52e3fa,_0x5f05ef,_0x4e8ca1);})[_0x183e('0xe')](function(_0x4165a2){fileLogger(_0x183e('0xa'))[_0x183e('0x11')](_0x4165a2);});};}function setupLoggers(_0x3e533d){return new Promise(function(_0x3b4a4b){var _0x176021=new ClientSideLogger();var _0x17d497=fileLogger('api');var _0x2823bd=fileLogger('auth');_0x3e533d['set'](_0x183e('0x12'),_0x176021);_0x3e533d[_0x183e('0x13')](ewinston['logger']({'winstonInstance':_0x17d497,'meta':![],'statusLevels':!![],'msg':function(_0x1522a3,_0x4aac27){var _0x485724='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x183e('0x14')](_0x1522a3[_0x183e('0x15')])){_0x485724+='\x20body=%s';var _0x3ea2d0=_0x1522a3[_0x183e('0x15')];maskSensitiveData(_0x3ea2d0);}return safeTemplate(util[_0x183e('0x16')](_0x485724,_0x1522a3['method'],_0x1522a3[_0x183e('0x17')][_0x183e('0x18')]?_0x1522a3[_0x183e('0x17')][_0x183e('0x18')]:_0x1522a3[_0x183e('0x19')][_0x183e('0x1a')]||_0x1522a3['ip'],_0x1522a3[_0x183e('0x1b')],_0x4aac27['statusCode'],_0x4aac27[_0x183e('0x1c')],_0x1522a3[_0x183e('0xf')]?_0x1522a3['user']['id']:null,_0x1522a3[_0x183e('0xf')]?_0x1522a3['user'][_0x183e('0x1d')]:null,_0x1522a3[_0x183e('0xf')]?_0x1522a3['user'][_0x183e('0xb')]:null,_0x3ea2d0?util[_0x183e('0x1e')](_0x3ea2d0,![],null):''));}}));_0x3e533d['use'](ewinston['logger']({'winstonInstance':_0x2823bd,'meta':![],'statusLevels':!![],'msg':function(_0x54c467,_0x1c12aa){var _0x5a18dd=_0x183e('0x1f');if(_0x54c467[_0x183e('0x15')]&&_0x54c467['body']['device']&&_0x54c467[_0x183e('0x15')][_0x183e('0x20')]){_0x5a18dd=_0x183e('0x21');}return util[_0x183e('0x16')](_0x5a18dd,_0x54c467['method'],_0x54c467[_0x183e('0x17')][_0x183e('0x18')]?_0x54c467[_0x183e('0x17')]['x-forwarded-for']:_0x54c467[_0x183e('0x19')]['remoteAddress']||_0x54c467['ip'],_0x54c467[_0x183e('0x1b')],_0x1c12aa[_0x183e('0x22')],_0x1c12aa[_0x183e('0x1c')],_0x54c467[_0x183e('0xf')]?_0x54c467['user']['id']:null,_0x54c467[_0x183e('0xf')]?_0x54c467[_0x183e('0xf')][_0x183e('0x1d')]:null,_0x54c467['user']?_0x54c467[_0x183e('0xf')][_0x183e('0xb')]:null,_0x54c467[_0x183e('0x15')]&&_0x54c467[_0x183e('0x15')]['device']?_0x54c467[_0x183e('0x15')][_0x183e('0x23')]:_0x183e('0x24'),_0x54c467[_0x183e('0x15')]&&_0x54c467[_0x183e('0x15')][_0x183e('0x20')]?_0x54c467[_0x183e('0x15')][_0x183e('0x20')]:'',_0x54c467[_0x183e('0x15')]&&_0x54c467[_0x183e('0x15')][_0x183e('0x25')]?_0x54c467[_0x183e('0x15')]['agent_name']:'');},'ignoreRoute':function(_0x5ad9c4){var _0xa30c7c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xa30c7c['test'](_0x5ad9c4[_0x183e('0x1b')]);}}));return _0x3b4a4b();});}exports['setupLoggers']=setupLoggers;
\ No newline at end of file
index d062876..c5c510e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b98=['bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','keys','meta','length','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','winston','../config/environment','debugLevel','info','red','bold\x20white','bold\x20green','bold\x20magenta'];(function(_0x976826,_0x3a903b){var _0x5d0be7=function(_0x3e1bfa){while(--_0x3e1bfa){_0x976826['push'](_0x976826['shift']());}};_0x5d0be7(++_0x3a903b);}(_0x1b98,0x121));var _0x81b9=function(_0x173131,_0x694769){_0x173131=_0x173131-0x0;var _0x43749b=_0x1b98[_0x173131];return _0x43749b;};'use strict';var path=require('path');var util=require('util');var moment=require('moment');var winston=require(_0x81b9('0x0'));var config=require(_0x81b9('0x1'));var debugLevel=config[_0x81b9('0x2')]?config[_0x81b9('0x2')]['toLowerCase']():_0x81b9('0x3');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':_0x81b9('0x4'),'warn':'bold\x20yellow','info':'white','print':_0x81b9('0x5'),'success':_0x81b9('0x6'),'http':'gray','verbose':_0x81b9('0x7'),'debug':_0x81b9('0x8'),'silly':_0x81b9('0x9')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0xc62566,_0x67b10c,_0xd053e2){var _0x1d7b2d=_0xc62566||_0x81b9('0xa');return path[_0x81b9('0xb')](_0x1d7b2d,util[_0x81b9('0xc')]('%s-%s.log',_0x67b10c,_0xd053e2));}function formatter(_0x531993,_0x2a258f){_0x2a258f[_0x81b9('0xd')]=_0x2a258f[_0x81b9('0xd')][_0x81b9('0xe')](/@@{/g,_0x81b9('0xf'))[_0x81b9('0xe')](/}@@/g,_0x81b9('0x10'))[_0x81b9('0xe')](/@{/g,'{{')[_0x81b9('0xe')](/}@/g,'}}');return util[_0x81b9('0xc')](_0x81b9('0x11'),moment()[_0x81b9('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),_0x2a258f[_0x81b9('0x12')][_0x81b9('0x13')](),_0x531993,_0x2a258f['message']);}function fileFormat(_0x512b06,_0x5940e6){_0x5940e6['message']=_0x5940e6['message'][_0x81b9('0xe')](/@@{/g,_0x81b9('0xf'))[_0x81b9('0xe')](/}@@/g,_0x81b9('0x10'))[_0x81b9('0xe')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x57e666=_0x5940e6['meta']&&Object[_0x81b9('0x14')](_0x5940e6[_0x81b9('0x15')])[_0x81b9('0x16')]?'\x0a\x09'+JSON['stringify'](_0x5940e6[_0x81b9('0x15')]):'';return util[_0x81b9('0xc')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0x81b9('0x17')),_0x5940e6[_0x81b9('0x12')][_0x81b9('0x13')](),_0x512b06,_0x5940e6[_0x81b9('0xd')],_0x57e666);}function consoleLogger(){var _0x229aee=new winston[(_0x81b9('0x18'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x81b9('0x19'))][(_0x81b9('0x1a'))]({'level':_0x81b9('0x1b'),'json':![],'formatter':function(_0x5d5d7d){return formatter('',_0x5d5d7d);}})]});return _0x229aee;}function fileLogger(_0x498ef5,_0x2e338c){var _0x288097=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0x81b9('0xc')](_0x81b9('0x1c'),_0x498ef5,_0x81b9('0x1d')),'filename':getLogFileName(_0x2e338c,_0x498ef5,_0x81b9('0x1d')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1ffca0){return fileFormat(_0x498ef5,_0x1ffca0);}}),new winston[(_0x81b9('0x19'))][(_0x81b9('0x1e'))]({'name':util['format']('%s-%s',_0x498ef5,debugLevel),'filename':getLogFileName(_0x2e338c,_0x498ef5,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42fedc){return fileFormat(_0x498ef5,_0x42fedc);}}),new winston['transports'][(_0x81b9('0x1a'))]({'level':_0x81b9('0x1b'),'json':![],'formatter':function(_0x176108){return fileFormat(_0x498ef5,_0x176108);}})]});return _0x288097;}exports[_0x81b9('0x1f')]=consoleLogger;exports[_0x81b9('0x20')]=fileLogger;
\ No newline at end of file
+var _0x4064=['../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','error','File','%s-%s','consoleLogger','fileLogger','path','util','moment','winston'];(function(_0x18dedd,_0x4cb9e5){var _0x35b7e1=function(_0x429eb0){while(--_0x429eb0){_0x18dedd['push'](_0x18dedd['shift']());}};_0x35b7e1(++_0x4cb9e5);}(_0x4064,0xa4));var _0x4406=function(_0x4ff279,_0x9cf5a8){_0x4ff279=_0x4ff279-0x0;var _0x392c11=_0x4064[_0x4ff279];return _0x392c11;};'use strict';var path=require(_0x4406('0x0'));var util=require(_0x4406('0x1'));var moment=require(_0x4406('0x2'));var winston=require(_0x4406('0x3'));var config=require(_0x4406('0x4'));var debugLevel=config[_0x4406('0x5')]?config['debugLevel'][_0x4406('0x6')]():_0x4406('0x7');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':_0x4406('0x8'),'error':_0x4406('0x9'),'warn':_0x4406('0xa'),'info':_0x4406('0xb'),'print':_0x4406('0xc'),'success':_0x4406('0xd'),'http':_0x4406('0xe'),'verbose':_0x4406('0xf'),'debug':_0x4406('0x10'),'silly':_0x4406('0x11')};winston[_0x4406('0x12')](XC_LOG_COLORS);function getLogFileName(_0x4aaecd,_0x244e23,_0x4ab5fe){var _0x3b42a0=_0x4aaecd||'/var/log/xcally';return path[_0x4406('0x13')](_0x3b42a0,util[_0x4406('0x14')](_0x4406('0x15'),_0x244e23,_0x4ab5fe));}function formatter(_0x59b883,_0x4bcb46){_0x4bcb46['message']=_0x4bcb46[_0x4406('0x16')][_0x4406('0x17')](/@@{/g,_0x4406('0x18'))['replace'](/}@@/g,_0x4406('0x19'))[_0x4406('0x17')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x4406('0x14')](_0x4406('0x1a'),moment()['format'](_0x4406('0x1b')),_0x4bcb46['level'][_0x4406('0x1c')](),_0x59b883,_0x4bcb46[_0x4406('0x16')]);}function fileFormat(_0x43cd55,_0x31266c){_0x31266c[_0x4406('0x16')]=_0x31266c[_0x4406('0x16')][_0x4406('0x17')](/@@{/g,_0x4406('0x18'))[_0x4406('0x17')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x4406('0x17')](/}@/g,'}}');var _0x21331c=_0x31266c[_0x4406('0x1d')]&&Object[_0x4406('0x1e')](_0x31266c[_0x4406('0x1d')])[_0x4406('0x1f')]?'\x0a\x09'+JSON['stringify'](_0x31266c[_0x4406('0x1d')]):'';return util[_0x4406('0x14')](_0x4406('0x20'),moment()[_0x4406('0x14')](_0x4406('0x1b')),_0x31266c['level'][_0x4406('0x1c')](),_0x43cd55,_0x31266c[_0x4406('0x16')],_0x21331c);}function consoleLogger(){var _0x343014=new winston[(_0x4406('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x4406('0x22'))][(_0x4406('0x23'))]({'level':_0x4406('0x24'),'json':![],'formatter':function(_0x1a9514){return formatter('',_0x1a9514);}})]});return _0x343014;}function fileLogger(_0x25b03a,_0x469fb1){var _0x12f4fd=new winston[(_0x4406('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0x4406('0x14')]('%s-%s',_0x25b03a,_0x4406('0x25')),'filename':getLogFileName(_0x469fb1,_0x25b03a,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4ed47d){return fileFormat(_0x25b03a,_0x4ed47d);}}),new winston[(_0x4406('0x22'))][(_0x4406('0x26'))]({'name':util[_0x4406('0x14')](_0x4406('0x27'),_0x25b03a,debugLevel),'filename':getLogFileName(_0x469fb1,_0x25b03a,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3dbee2){return fileFormat(_0x25b03a,_0x3dbee2);}}),new winston[(_0x4406('0x22'))][(_0x4406('0x23'))]({'level':_0x4406('0x24'),'json':![],'formatter':function(_0x28b864){return fileFormat(_0x25b03a,_0x28b864);}})]});return _0x12f4fd;}exports[_0x4406('0x28')]=consoleLogger;exports[_0x4406('0x29')]=fileLogger;
\ No newline at end of file
index 6f4e627..4d57a4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x57ca,0x108));var _0xa57c=function(_0x12b4d5,_0x40ec9e){_0x12b4d5=_0x12b4d5-0x0;var _0x585567=_0x57ca[_0x12b4d5];return _0x585567;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
+var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdb28,0x106));var _0x8db2=function(_0x1f744f,_0x142661){_0x1f744f=_0x1f744f-0x0;var _0x583b7e=_0xdb28[_0x1f744f];return _0x583b7e;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData;
\ No newline at end of file
index 57205af..397f768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03e=['safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','exports'];(function(_0x404905,_0xfc82c4){var _0xffaa00=function(_0x3bda64){while(--_0x3bda64){_0x404905['push'](_0x404905['shift']());}};_0xffaa00(++_0xfc82c4);}(_0xb03e,0x1eb));var _0xeb03=function(_0x1bc071,_0x333b45){_0x1bc071=_0x1bc071-0x0;var _0x112193=_0xb03e[_0x1bc071];return _0x112193;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x36351b){return _0x36351b==='{{'?_0xeb03('0x0'):_0xeb03('0x1');}function safeTemplate(_0x3c5e68){var _0x1c58b5=_0x3c5e68;if(typeof _0x3c5e68===_0xeb03('0x2')){_0x1c58b5=_0x3c5e68[_0xeb03('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb03('0x4')](_0x3c5e68)){_0x1c58b5=_0x3c5e68[_0xeb03('0x5')](function(_0x3ba4b0){return safeTemplate(_0x3ba4b0);});}else if(_[_0xeb03('0x6')](_0x3c5e68)){_0x1c58b5=Object[_0xeb03('0x7')](_0x3c5e68)['reduce'](function(_0x3b58a2,_0x3d3322){_0x3b58a2[_0x3d3322]=safeTemplate(_0x3c5e68[_0x3d3322]);return _0x3b58a2;},{});}return _0x1c58b5;}module[_0xeb03('0x8')][_0xeb03('0x9')]=safeTemplate;
\ No newline at end of file
+var _0x0972=['safeTemplate','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce','exports'];(function(_0x444acc,_0x8f0c49){var _0x545a62=function(_0x4b7acd){while(--_0x4b7acd){_0x444acc['push'](_0x444acc['shift']());}};_0x545a62(++_0x8f0c49);}(_0x0972,0x64));var _0x2097=function(_0x570969,_0x30520b){_0x570969=_0x570969-0x0;var _0x53ceac=_0x0972[_0x570969];return _0x53ceac;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1591ae){return _0x1591ae==='{{'?'{\x20{\x20':_0x2097('0x0');}function safeTemplate(_0x4ec7aa){var _0x36912c=_0x4ec7aa;if(typeof _0x4ec7aa===_0x2097('0x1')){_0x36912c=_0x4ec7aa['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2097('0x2')](_0x4ec7aa)){_0x36912c=_0x4ec7aa[_0x2097('0x3')](function(_0xe6fbae){return safeTemplate(_0xe6fbae);});}else if(_[_0x2097('0x4')](_0x4ec7aa)){_0x36912c=Object[_0x2097('0x5')](_0x4ec7aa)[_0x2097('0x6')](function(_0x2b4f21,_0x59739f){_0x2b4f21[_0x59739f]=safeTemplate(_0x4ec7aa[_0x59739f]);return _0x2b4f21;},{});}return _0x36912c;}module[_0x2097('0x7')][_0x2097('0x8')]=safeTemplate;
\ No newline at end of file